From: dongsug.song Date: Tue, 21 Nov 2017 07:57:15 +0000 (+0900) Subject: migration devel/master branch from csapi-nui project X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=28a51179f4f325986f3418670a9f290bf5da3b00;p=platform%2Fcore%2Fcsapi%2Ftizenfx.git migration devel/master branch from csapi-nui project Change-Id: I2f1376e53dde344779802e59a6e5b59b6d3da931 Signed-off-by: dongsug.song --- diff --git a/LICENSE b/LICENSE deleted file mode 100644 index d64569567..000000000 --- a/LICENSE +++ /dev/null @@ -1,202 +0,0 @@ - - Apache License - Version 2.0, January 2004 - http://www.apache.org/licenses/ - - TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION - - 1. Definitions. - - "License" shall mean the terms and conditions for use, reproduction, - and distribution as defined by Sections 1 through 9 of this document. - - "Licensor" shall mean the copyright owner or entity authorized by - the copyright owner that is granting the License. - - "Legal Entity" shall mean the union of the acting entity and all - other entities that control, are controlled by, or are under common - control with that entity. For the purposes of this definition, - "control" means (i) the power, direct or indirect, to cause the - direction or management of such entity, whether by contract or - otherwise, or (ii) ownership of fifty percent (50%) or more of the - outstanding shares, or (iii) beneficial ownership of such entity. - - "You" (or "Your") shall mean an individual or Legal Entity - exercising permissions granted by this License. - - "Source" form shall mean the preferred form for making modifications, - including but not limited to software source code, documentation - source, and configuration files. - - "Object" form shall mean any form resulting from mechanical - transformation or translation of a Source form, including but - not limited to compiled object code, generated documentation, - and conversions to other media types. - - "Work" shall mean the work of authorship, whether in Source or - Object form, made available under the License, as indicated by a - copyright notice that is included in or attached to the work - (an example is provided in the Appendix below). - - "Derivative Works" shall mean any work, whether in Source or Object - form, that is based on (or derived from) the Work and for which the - editorial revisions, annotations, elaborations, or other modifications - represent, as a whole, an original work of authorship. For the purposes - of this License, Derivative Works shall not include works that remain - separable from, or merely link (or bind by name) to the interfaces of, - the Work and Derivative Works thereof. - - "Contribution" shall mean any work of authorship, including - the original version of the Work and any modifications or additions - to that Work or Derivative Works thereof, that is intentionally - submitted to Licensor for inclusion in the Work by the copyright owner - or by an individual or Legal Entity authorized to submit on behalf of - the copyright owner. For the purposes of this definition, "submitted" - means any form of electronic, verbal, or written communication sent - to the Licensor or its representatives, including but not limited to - communication on electronic mailing lists, source code control systems, - and issue tracking systems that are managed by, or on behalf of, the - Licensor for the purpose of discussing and improving the Work, but - excluding communication that is conspicuously marked or otherwise - designated in writing by the copyright owner as "Not a Contribution." - - "Contributor" shall mean Licensor and any individual or Legal Entity - on behalf of whom a Contribution has been received by Licensor and - subsequently incorporated within the Work. - - 2. Grant of Copyright License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - copyright license to reproduce, prepare Derivative Works of, - publicly display, publicly perform, sublicense, and distribute the - Work and such Derivative Works in Source or Object form. - - 3. Grant of Patent License. Subject to the terms and conditions of - this License, each Contributor hereby grants to You a perpetual, - worldwide, non-exclusive, no-charge, royalty-free, irrevocable - (except as stated in this section) patent license to make, have made, - use, offer to sell, sell, import, and otherwise transfer the Work, - where such license applies only to those patent claims licensable - by such Contributor that are necessarily infringed by their - Contribution(s) alone or by combination of their Contribution(s) - with the Work to which such Contribution(s) was submitted. If You - institute patent litigation against any entity (including a - cross-claim or counterclaim in a lawsuit) alleging that the Work - or a Contribution incorporated within the Work constitutes direct - or contributory patent infringement, then any patent licenses - granted to You under this License for that Work shall terminate - as of the date such litigation is filed. - - 4. Redistribution. You may reproduce and distribute copies of the - Work or Derivative Works thereof in any medium, with or without - modifications, and in Source or Object form, provided that You - meet the following conditions: - - (a) You must give any other recipients of the Work or - Derivative Works a copy of this License; and - - (b) You must cause any modified files to carry prominent notices - stating that You changed the files; and - - (c) You must retain, in the Source form of any Derivative Works - that You distribute, all copyright, patent, trademark, and - attribution notices from the Source form of the Work, - excluding those notices that do not pertain to any part of - the Derivative Works; and - - (d) If the Work includes a "NOTICE" text file as part of its - distribution, then any Derivative Works that You distribute must - include a readable copy of the attribution notices contained - within such NOTICE file, excluding those notices that do not - pertain to any part of the Derivative Works, in at least one - of the following places: within a NOTICE text file distributed - as part of the Derivative Works; within the Source form or - documentation, if provided along with the Derivative Works; or, - within a display generated by the Derivative Works, if and - wherever such third-party notices normally appear. The contents - of the NOTICE file are for informational purposes only and - do not modify the License. You may add Your own attribution - notices within Derivative Works that You distribute, alongside - or as an addendum to the NOTICE text from the Work, provided - that such additional attribution notices cannot be construed - as modifying the License. - - You may add Your own copyright statement to Your modifications and - may provide additional or different license terms and conditions - for use, reproduction, or distribution of Your modifications, or - for any such Derivative Works as a whole, provided Your use, - reproduction, and distribution of the Work otherwise complies with - the conditions stated in this License. - - 5. Submission of Contributions. Unless You explicitly state otherwise, - any Contribution intentionally submitted for inclusion in the Work - by You to the Licensor shall be under the terms and conditions of - this License, without any additional terms or conditions. - Notwithstanding the above, nothing herein shall supersede or modify - the terms of any separate license agreement you may have executed - with Licensor regarding such Contributions. - - 6. Trademarks. This License does not grant permission to use the trade - names, trademarks, service marks, or product names of the Licensor, - except as required for reasonable and customary use in describing the - origin of the Work and reproducing the content of the NOTICE file. - - 7. Disclaimer of Warranty. Unless required by applicable law or - agreed to in writing, Licensor provides the Work (and each - Contributor provides its Contributions) on an "AS IS" BASIS, - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or - implied, including, without limitation, any warranties or conditions - of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A - PARTICULAR PURPOSE. You are solely responsible for determining the - appropriateness of using or redistributing the Work and assume any - risks associated with Your exercise of permissions under this License. - - 8. Limitation of Liability. In no event and under no legal theory, - whether in tort (including negligence), contract, or otherwise, - unless required by applicable law (such as deliberate and grossly - negligent acts) or agreed to in writing, shall any Contributor be - liable to You for damages, including any direct, indirect, special, - incidental, or consequential damages of any character arising as a - result of this License or out of the use or inability to use the - Work (including but not limited to damages for loss of goodwill, - work stoppage, computer failure or malfunction, or any and all - other commercial damages or losses), even if such Contributor - has been advised of the possibility of such damages. - - 9. Accepting Warranty or Additional Liability. While redistributing - the Work or Derivative Works thereof, You may choose to offer, - and charge a fee for, acceptance of support, warranty, indemnity, - or other liability obligations and/or rights consistent with this - License. However, in accepting such obligations, You may act only - on Your own behalf and on Your sole responsibility, not on behalf - of any other Contributor, and only if You agree to indemnify, - defend, and hold each Contributor harmless for any liability - incurred by, or claims asserted against, such Contributor by reason - of your accepting any such warranty or additional liability. - - END OF TERMS AND CONDITIONS - - APPENDIX: How to apply the Apache License to your work. - - To apply the Apache License to your work, attach the following - boilerplate notice, with the fields enclosed by brackets "[]" - replaced with your own identifying information. (Don't include - the brackets!) The text should be enclosed in the appropriate - comment syntax for the file format. We also recommend that a - file or class name and description of purpose be included on the - same "printed page" as the copyright notice for easier - identification within third-party archives. - - Copyright [yyyy] [name of copyright owner] - - 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. diff --git a/NUIsamples/NUIsamples.sln b/NUIsamples/NUIsamples.sln deleted file mode 100755 index e7692405d..000000000 --- a/NUIsamples/NUIsamples.sln +++ /dev/null @@ -1,55 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26730.16 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NUIsamples", "NUIsamples\NUIsamples.csproj", "{9FA72502-47A9-40E8-8265-F6AF63961051}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.NUI", "..\src\Tizen.NUI\Tizen.NUI.csproj", "{F7BFC7DE-9994-4237-B94C-AF07FF71FB1B}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Applications.Common", "..\src\Tizen.Applications.Common\Tizen.Applications.Common.csproj", "{A37D3703-06F4-4533-B183-108D8CDEDF31}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen", "..\src\Tizen\Tizen.csproj", "{8BFE2A6F-5BB5-4A25-86E1-8448BF03C6F2}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Log", "..\src\Tizen.Log\Tizen.Log.csproj", "{743831B0-B40E-4A10-A50D-C4C31E895379}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.System.SystemSettings", "..\src\Tizen.System.SystemSettings\Tizen.System.SystemSettings.csproj", "{0DF75E1B-C3FF-4E63-A654-8579075C0271}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {9FA72502-47A9-40E8-8265-F6AF63961051}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {9FA72502-47A9-40E8-8265-F6AF63961051}.Debug|Any CPU.Build.0 = Debug|Any CPU - {9FA72502-47A9-40E8-8265-F6AF63961051}.Release|Any CPU.ActiveCfg = Release|Any CPU - {9FA72502-47A9-40E8-8265-F6AF63961051}.Release|Any CPU.Build.0 = Release|Any CPU - {F7BFC7DE-9994-4237-B94C-AF07FF71FB1B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F7BFC7DE-9994-4237-B94C-AF07FF71FB1B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F7BFC7DE-9994-4237-B94C-AF07FF71FB1B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F7BFC7DE-9994-4237-B94C-AF07FF71FB1B}.Release|Any CPU.Build.0 = Release|Any CPU - {A37D3703-06F4-4533-B183-108D8CDEDF31}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A37D3703-06F4-4533-B183-108D8CDEDF31}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A37D3703-06F4-4533-B183-108D8CDEDF31}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A37D3703-06F4-4533-B183-108D8CDEDF31}.Release|Any CPU.Build.0 = Release|Any CPU - {8BFE2A6F-5BB5-4A25-86E1-8448BF03C6F2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {8BFE2A6F-5BB5-4A25-86E1-8448BF03C6F2}.Debug|Any CPU.Build.0 = Debug|Any CPU - {8BFE2A6F-5BB5-4A25-86E1-8448BF03C6F2}.Release|Any CPU.ActiveCfg = Release|Any CPU - {8BFE2A6F-5BB5-4A25-86E1-8448BF03C6F2}.Release|Any CPU.Build.0 = Release|Any CPU - {743831B0-B40E-4A10-A50D-C4C31E895379}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {743831B0-B40E-4A10-A50D-C4C31E895379}.Debug|Any CPU.Build.0 = Debug|Any CPU - {743831B0-B40E-4A10-A50D-C4C31E895379}.Release|Any CPU.ActiveCfg = Release|Any CPU - {743831B0-B40E-4A10-A50D-C4C31E895379}.Release|Any CPU.Build.0 = Release|Any CPU - {0DF75E1B-C3FF-4E63-A654-8579075C0271}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {0DF75E1B-C3FF-4E63-A654-8579075C0271}.Debug|Any CPU.Build.0 = Debug|Any CPU - {0DF75E1B-C3FF-4E63-A654-8579075C0271}.Release|Any CPU.ActiveCfg = Release|Any CPU - {0DF75E1B-C3FF-4E63-A654-8579075C0271}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {42B5CE69-D380-4AAF-B50B-47C0F6702963} - EndGlobalSection -EndGlobal diff --git a/NUIsamples/NUIsamples/NUIsamples.csproj b/NUIsamples/NUIsamples/NUIsamples.csproj deleted file mode 100755 index cd2ba4f6e..000000000 --- a/NUIsamples/NUIsamples/NUIsamples.csproj +++ /dev/null @@ -1,48 +0,0 @@ - - - - - $(MSBuildExtensionsPath)\Tizen\VisualStudio\ - - - - - - Exe - netcoreapp2.0 - true - TizenTVNUI.snk - - - - portable - TRACE;DEBUG;NETCOREAPP2_0;DEBUG_ON; - - - None - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/NUIsamples/NUIsamples/TizenTVNUI.snk b/NUIsamples/NUIsamples/TizenTVNUI.snk deleted file mode 100755 index 957e8d429..000000000 Binary files a/NUIsamples/NUIsamples/TizenTVNUI.snk and /dev/null differ diff --git a/NUIsamples/NUIsamples/res/images/Dino-Painted_lambert2SG_color.png b/NUIsamples/NUIsamples/res/images/Dino-Painted_lambert2SG_color.png deleted file mode 100755 index 3930181f8..000000000 Binary files a/NUIsamples/NUIsamples/res/images/Dino-Painted_lambert2SG_color.png and /dev/null differ diff --git a/NUIsamples/NUIsamples/res/images/Dino-Painted_lambert2SG_gloss.png b/NUIsamples/NUIsamples/res/images/Dino-Painted_lambert2SG_gloss.png deleted file mode 100755 index 0e6c95838..000000000 Binary files a/NUIsamples/NUIsamples/res/images/Dino-Painted_lambert2SG_gloss.png and /dev/null differ diff --git a/NUIsamples/NUIsamples/res/images/Dino-Painted_lambert2SG_nmap.png b/NUIsamples/NUIsamples/res/images/Dino-Painted_lambert2SG_nmap.png deleted file mode 100755 index c2d4bf4e9..000000000 Binary files a/NUIsamples/NUIsamples/res/images/Dino-Painted_lambert2SG_nmap.png and /dev/null differ diff --git a/NUIsamples/NUIsamples/res/images/Dino2_lambert2SG_color.png b/NUIsamples/NUIsamples/res/images/Dino2_lambert2SG_color.png deleted file mode 100755 index 5ee5d2c7b..000000000 Binary files a/NUIsamples/NUIsamples/res/images/Dino2_lambert2SG_color.png and /dev/null differ diff --git a/NUIsamples/NUIsamples/res/images/Dino2_lambert2SG_nmap.png b/NUIsamples/NUIsamples/res/images/Dino2_lambert2SG_nmap.png deleted file mode 100755 index 361603cfd..000000000 Binary files a/NUIsamples/NUIsamples/res/images/Dino2_lambert2SG_nmap.png and /dev/null differ diff --git a/NUIsamples/NUIsamples/res/images/Kid1.svg b/NUIsamples/NUIsamples/res/images/Kid1.svg deleted file mode 100755 index b7d547678..000000000 --- a/NUIsamples/NUIsamples/res/images/Kid1.svg +++ /dev/null @@ -1,491 +0,0 @@ - - - -image/svg+xml diff --git a/NUIsamples/NUIsamples/res/images/Mail.svg b/NUIsamples/NUIsamples/res/images/Mail.svg deleted file mode 100755 index 63fdd1f5b..000000000 --- a/NUIsamples/NUIsamples/res/images/Mail.svg +++ /dev/null @@ -1,170 +0,0 @@ - - - -image/svg+xml \ No newline at end of file diff --git a/NUIsamples/NUIsamples/res/images/World.svg b/NUIsamples/NUIsamples/res/images/World.svg deleted file mode 100755 index 91aef1351..000000000 --- a/NUIsamples/NUIsamples/res/images/World.svg +++ /dev/null @@ -1,284 +0,0 @@ - - - -image/svg+xml \ No newline at end of file diff --git a/NUIsamples/NUIsamples/res/images/anim-gif/0.gif b/NUIsamples/NUIsamples/res/images/anim-gif/0.gif deleted file mode 100755 index 9a085ba95..000000000 Binary files a/NUIsamples/NUIsamples/res/images/anim-gif/0.gif and /dev/null differ diff --git a/NUIsamples/NUIsamples/res/images/anim-gif/1.gif b/NUIsamples/NUIsamples/res/images/anim-gif/1.gif deleted file mode 100755 index c4cc65a4a..000000000 Binary files a/NUIsamples/NUIsamples/res/images/anim-gif/1.gif and /dev/null differ diff --git a/NUIsamples/NUIsamples/res/images/anim-gif/10.gif b/NUIsamples/NUIsamples/res/images/anim-gif/10.gif deleted file mode 100755 index cc6d7a912..000000000 Binary files a/NUIsamples/NUIsamples/res/images/anim-gif/10.gif and /dev/null differ diff --git a/NUIsamples/NUIsamples/res/images/anim-gif/11.gif b/NUIsamples/NUIsamples/res/images/anim-gif/11.gif deleted file mode 100755 index 354459a1b..000000000 Binary files a/NUIsamples/NUIsamples/res/images/anim-gif/11.gif and /dev/null differ diff --git a/NUIsamples/NUIsamples/res/images/anim-gif/12.gif b/NUIsamples/NUIsamples/res/images/anim-gif/12.gif deleted file mode 100755 index a43380d85..000000000 Binary files a/NUIsamples/NUIsamples/res/images/anim-gif/12.gif and /dev/null differ diff --git a/NUIsamples/NUIsamples/res/images/anim-gif/13.gif b/NUIsamples/NUIsamples/res/images/anim-gif/13.gif deleted file mode 100755 index 0f649dda0..000000000 Binary files a/NUIsamples/NUIsamples/res/images/anim-gif/13.gif and /dev/null differ diff --git a/NUIsamples/NUIsamples/res/images/anim-gif/14.gif b/NUIsamples/NUIsamples/res/images/anim-gif/14.gif deleted file mode 100755 index 23e819928..000000000 Binary files a/NUIsamples/NUIsamples/res/images/anim-gif/14.gif and /dev/null differ diff --git a/NUIsamples/NUIsamples/res/images/anim-gif/2.gif b/NUIsamples/NUIsamples/res/images/anim-gif/2.gif deleted file mode 100755 index c33ba6c2a..000000000 Binary files a/NUIsamples/NUIsamples/res/images/anim-gif/2.gif and /dev/null differ diff --git a/NUIsamples/NUIsamples/res/images/anim-gif/3.gif b/NUIsamples/NUIsamples/res/images/anim-gif/3.gif deleted file mode 100755 index 5371a3e6a..000000000 Binary files a/NUIsamples/NUIsamples/res/images/anim-gif/3.gif and /dev/null differ diff --git a/NUIsamples/NUIsamples/res/images/anim-gif/4.gif b/NUIsamples/NUIsamples/res/images/anim-gif/4.gif deleted file mode 100755 index ab609288d..000000000 Binary files a/NUIsamples/NUIsamples/res/images/anim-gif/4.gif and /dev/null differ diff --git a/NUIsamples/NUIsamples/res/images/anim-gif/5.gif b/NUIsamples/NUIsamples/res/images/anim-gif/5.gif deleted file mode 100755 index 68ec2f461..000000000 Binary files a/NUIsamples/NUIsamples/res/images/anim-gif/5.gif and /dev/null differ diff --git a/NUIsamples/NUIsamples/res/images/anim-gif/6.gif b/NUIsamples/NUIsamples/res/images/anim-gif/6.gif deleted file mode 100755 index 288f9339f..000000000 Binary files a/NUIsamples/NUIsamples/res/images/anim-gif/6.gif and /dev/null differ diff --git a/NUIsamples/NUIsamples/res/images/anim-gif/7.gif b/NUIsamples/NUIsamples/res/images/anim-gif/7.gif deleted file mode 100755 index 93ca68bbc..000000000 Binary files a/NUIsamples/NUIsamples/res/images/anim-gif/7.gif and /dev/null differ diff --git a/NUIsamples/NUIsamples/res/images/anim-gif/8.gif b/NUIsamples/NUIsamples/res/images/anim-gif/8.gif deleted file mode 100755 index decc49304..000000000 Binary files a/NUIsamples/NUIsamples/res/images/anim-gif/8.gif and /dev/null differ diff --git a/NUIsamples/NUIsamples/res/images/anim-gif/9.gif b/NUIsamples/NUIsamples/res/images/anim-gif/9.gif deleted file mode 100755 index c97884b92..000000000 Binary files a/NUIsamples/NUIsamples/res/images/anim-gif/9.gif and /dev/null differ diff --git a/NUIsamples/NUIsamples/res/images/application-icon-0.png b/NUIsamples/NUIsamples/res/images/application-icon-0.png deleted file mode 100755 index 339b19ca5..000000000 Binary files a/NUIsamples/NUIsamples/res/images/application-icon-0.png and /dev/null differ diff --git a/NUIsamples/NUIsamples/res/images/arrow.png b/NUIsamples/NUIsamples/res/images/arrow.png deleted file mode 100755 index 87abefddf..000000000 Binary files a/NUIsamples/NUIsamples/res/images/arrow.png and /dev/null differ diff --git a/NUIsamples/NUIsamples/res/images/background-blocks.jpg b/NUIsamples/NUIsamples/res/images/background-blocks.jpg deleted file mode 100755 index d8fed652c..000000000 Binary files a/NUIsamples/NUIsamples/res/images/background-blocks.jpg and /dev/null differ diff --git a/NUIsamples/NUIsamples/res/images/dali-logo-anim.gif b/NUIsamples/NUIsamples/res/images/dali-logo-anim.gif deleted file mode 100755 index 9a085ba95..000000000 Binary files a/NUIsamples/NUIsamples/res/images/dali-logo-anim.gif and /dev/null differ diff --git a/NUIsamples/NUIsamples/res/images/dog-anim.gif b/NUIsamples/NUIsamples/res/images/dog-anim.gif deleted file mode 100755 index ddc331286..000000000 Binary files a/NUIsamples/NUIsamples/res/images/dog-anim.gif and /dev/null differ diff --git a/NUIsamples/NUIsamples/res/images/echo.gif b/NUIsamples/NUIsamples/res/images/echo.gif deleted file mode 100755 index 31b8040cf..000000000 Binary files a/NUIsamples/NUIsamples/res/images/echo.gif and /dev/null differ diff --git a/NUIsamples/NUIsamples/res/images/focuseffect/0-normal.png b/NUIsamples/NUIsamples/res/images/focuseffect/0-normal.png deleted file mode 100755 index ee755c33e..000000000 Binary files a/NUIsamples/NUIsamples/res/images/focuseffect/0-normal.png and /dev/null differ diff --git a/NUIsamples/NUIsamples/res/images/focuseffect/1-normal.png b/NUIsamples/NUIsamples/res/images/focuseffect/1-normal.png deleted file mode 100755 index 432bf7f6a..000000000 Binary files a/NUIsamples/NUIsamples/res/images/focuseffect/1-normal.png and /dev/null differ diff --git a/NUIsamples/NUIsamples/res/images/focuseffect/2-normal.png b/NUIsamples/NUIsamples/res/images/focuseffect/2-normal.png deleted file mode 100755 index c92191806..000000000 Binary files a/NUIsamples/NUIsamples/res/images/focuseffect/2-normal.png and /dev/null differ diff --git a/NUIsamples/NUIsamples/res/images/focuseffect/background.png b/NUIsamples/NUIsamples/res/images/focuseffect/background.png deleted file mode 100755 index 7e4caadce..000000000 Binary files a/NUIsamples/NUIsamples/res/images/focuseffect/background.png and /dev/null differ diff --git a/NUIsamples/NUIsamples/res/images/focuseffect/focus_grid.9.png b/NUIsamples/NUIsamples/res/images/focuseffect/focus_grid.9.png deleted file mode 100755 index 04ccb1f12..000000000 Binary files a/NUIsamples/NUIsamples/res/images/focuseffect/focus_grid.9.png and /dev/null differ diff --git a/NUIsamples/NUIsamples/res/images/focuseffect/focus_launcher_shadow.9.png b/NUIsamples/NUIsamples/res/images/focuseffect/focus_launcher_shadow.9.png deleted file mode 100755 index f989071df..000000000 Binary files a/NUIsamples/NUIsamples/res/images/focuseffect/focus_launcher_shadow.9.png and /dev/null differ diff --git a/NUIsamples/NUIsamples/res/images/focuseffect/focus_launcher_shadow_n.png b/NUIsamples/NUIsamples/res/images/focuseffect/focus_launcher_shadow_n.png deleted file mode 100755 index 0805e9e9c..000000000 Binary files a/NUIsamples/NUIsamples/res/images/focuseffect/focus_launcher_shadow_n.png and /dev/null differ diff --git a/NUIsamples/NUIsamples/res/images/focuseffect/halo.png b/NUIsamples/NUIsamples/res/images/focuseffect/halo.png deleted file mode 100755 index 307f67e80..000000000 Binary files a/NUIsamples/NUIsamples/res/images/focuseffect/halo.png and /dev/null differ diff --git a/NUIsamples/NUIsamples/res/images/focuseffect/highlight_spot.png b/NUIsamples/NUIsamples/res/images/focuseffect/highlight_spot.png deleted file mode 100755 index 8caa716a6..000000000 Binary files a/NUIsamples/NUIsamples/res/images/focuseffect/highlight_spot.png and /dev/null differ diff --git a/NUIsamples/NUIsamples/res/images/focuseffect/highlight_stroke.9.png b/NUIsamples/NUIsamples/res/images/focuseffect/highlight_stroke.9.png deleted file mode 100755 index 493b2067c..000000000 Binary files a/NUIsamples/NUIsamples/res/images/focuseffect/highlight_stroke.9.png and /dev/null differ diff --git a/NUIsamples/NUIsamples/res/images/focuseffect/horizontalFrame.png b/NUIsamples/NUIsamples/res/images/focuseffect/horizontalFrame.png deleted file mode 100755 index abff4ecd2..000000000 Binary files a/NUIsamples/NUIsamples/res/images/focuseffect/horizontalFrame.png and /dev/null differ diff --git a/NUIsamples/NUIsamples/res/images/focuseffect/thumbnail_shadow.9.png b/NUIsamples/NUIsamples/res/images/focuseffect/thumbnail_shadow.9.png deleted file mode 100755 index 61f5a9905..000000000 Binary files a/NUIsamples/NUIsamples/res/images/focuseffect/thumbnail_shadow.9.png and /dev/null differ diff --git a/NUIsamples/NUIsamples/res/images/focuseffect/verticalFrame.png b/NUIsamples/NUIsamples/res/images/focuseffect/verticalFrame.png deleted file mode 100755 index bdd372d48..000000000 Binary files a/NUIsamples/NUIsamples/res/images/focuseffect/verticalFrame.png and /dev/null differ diff --git a/NUIsamples/NUIsamples/res/images/focuseffect/white-pixel.png b/NUIsamples/NUIsamples/res/images/focuseffect/white-pixel.png deleted file mode 100755 index c63f333a8..000000000 Binary files a/NUIsamples/NUIsamples/res/images/focuseffect/white-pixel.png and /dev/null differ diff --git a/NUIsamples/NUIsamples/res/images/gallery-0.jpg b/NUIsamples/NUIsamples/res/images/gallery-0.jpg deleted file mode 100755 index e42dba762..000000000 Binary files a/NUIsamples/NUIsamples/res/images/gallery-0.jpg and /dev/null differ diff --git a/NUIsamples/NUIsamples/res/images/gallery-1.jpg b/NUIsamples/NUIsamples/res/images/gallery-1.jpg deleted file mode 100755 index 6a427adf6..000000000 Binary files a/NUIsamples/NUIsamples/res/images/gallery-1.jpg and /dev/null differ diff --git a/NUIsamples/NUIsamples/res/images/gallery-2.jpg b/NUIsamples/NUIsamples/res/images/gallery-2.jpg deleted file mode 100755 index 30b1a51ab..000000000 Binary files a/NUIsamples/NUIsamples/res/images/gallery-2.jpg and /dev/null differ diff --git a/NUIsamples/NUIsamples/res/images/gallery-3.jpg b/NUIsamples/NUIsamples/res/images/gallery-3.jpg deleted file mode 100755 index 2da2ceba5..000000000 Binary files a/NUIsamples/NUIsamples/res/images/gallery-3.jpg and /dev/null differ diff --git a/NUIsamples/NUIsamples/res/images/gallery-4.jpg b/NUIsamples/NUIsamples/res/images/gallery-4.jpg deleted file mode 100755 index 902b711cb..000000000 Binary files a/NUIsamples/NUIsamples/res/images/gallery-4.jpg and /dev/null differ diff --git a/NUIsamples/NUIsamples/res/images/gallery-5.jpg b/NUIsamples/NUIsamples/res/images/gallery-5.jpg deleted file mode 100755 index 490fb5669..000000000 Binary files a/NUIsamples/NUIsamples/res/images/gallery-5.jpg and /dev/null differ diff --git a/NUIsamples/NUIsamples/res/images/gallery-small-43.jpg b/NUIsamples/NUIsamples/res/images/gallery-small-43.jpg deleted file mode 100755 index c59b841d1..000000000 Binary files a/NUIsamples/NUIsamples/res/images/gallery-small-43.jpg and /dev/null differ diff --git a/NUIsamples/NUIsamples/res/images/image-1.jpg b/NUIsamples/NUIsamples/res/images/image-1.jpg deleted file mode 100755 index 155ab30bc..000000000 Binary files a/NUIsamples/NUIsamples/res/images/image-1.jpg and /dev/null differ diff --git a/NUIsamples/NUIsamples/res/images/image-2.jpg b/NUIsamples/NUIsamples/res/images/image-2.jpg deleted file mode 100755 index e855ecfdb..000000000 Binary files a/NUIsamples/NUIsamples/res/images/image-2.jpg and /dev/null differ diff --git a/NUIsamples/NUIsamples/res/images/image-3.jpg b/NUIsamples/NUIsamples/res/images/image-3.jpg deleted file mode 100755 index 8dee462e2..000000000 Binary files a/NUIsamples/NUIsamples/res/images/image-3.jpg and /dev/null differ diff --git a/NUIsamples/NUIsamples/res/images/mask.png b/NUIsamples/NUIsamples/res/images/mask.png deleted file mode 100755 index b3e423c96..000000000 Binary files a/NUIsamples/NUIsamples/res/images/mask.png and /dev/null differ diff --git a/NUIsamples/NUIsamples/res/images/menu/0.png b/NUIsamples/NUIsamples/res/images/menu/0.png deleted file mode 100755 index 10e1d179f..000000000 Binary files a/NUIsamples/NUIsamples/res/images/menu/0.png and /dev/null differ diff --git a/NUIsamples/NUIsamples/res/images/menu/1.png b/NUIsamples/NUIsamples/res/images/menu/1.png deleted file mode 100755 index e3e72f52b..000000000 Binary files a/NUIsamples/NUIsamples/res/images/menu/1.png and /dev/null differ diff --git a/NUIsamples/NUIsamples/res/images/menu/2.png b/NUIsamples/NUIsamples/res/images/menu/2.png deleted file mode 100755 index 10138e58e..000000000 Binary files a/NUIsamples/NUIsamples/res/images/menu/2.png and /dev/null differ diff --git a/NUIsamples/NUIsamples/res/images/menu/3.png b/NUIsamples/NUIsamples/res/images/menu/3.png deleted file mode 100755 index b4a6e61f8..000000000 Binary files a/NUIsamples/NUIsamples/res/images/menu/3.png and /dev/null differ diff --git a/NUIsamples/NUIsamples/res/images/menu/4.png b/NUIsamples/NUIsamples/res/images/menu/4.png deleted file mode 100755 index 58d716f4f..000000000 Binary files a/NUIsamples/NUIsamples/res/images/menu/4.png and /dev/null differ diff --git a/NUIsamples/NUIsamples/res/images/menu/5.png b/NUIsamples/NUIsamples/res/images/menu/5.png deleted file mode 100755 index 1548244f9..000000000 Binary files a/NUIsamples/NUIsamples/res/images/menu/5.png and /dev/null differ diff --git a/NUIsamples/NUIsamples/res/images/menu/6.png b/NUIsamples/NUIsamples/res/images/menu/6.png deleted file mode 100755 index 6545c2d74..000000000 Binary files a/NUIsamples/NUIsamples/res/images/menu/6.png and /dev/null differ diff --git a/NUIsamples/NUIsamples/res/images/not_yet_sign.png b/NUIsamples/NUIsamples/res/images/not_yet_sign.png deleted file mode 100755 index 12b48c1d1..000000000 Binary files a/NUIsamples/NUIsamples/res/images/not_yet_sign.png and /dev/null differ diff --git a/NUIsamples/NUIsamples/res/images/poster0/0.jpg b/NUIsamples/NUIsamples/res/images/poster0/0.jpg deleted file mode 100755 index fafd6029d..000000000 Binary files a/NUIsamples/NUIsamples/res/images/poster0/0.jpg and /dev/null differ diff --git a/NUIsamples/NUIsamples/res/images/poster0/1.jpg b/NUIsamples/NUIsamples/res/images/poster0/1.jpg deleted file mode 100755 index beb415aa4..000000000 Binary files a/NUIsamples/NUIsamples/res/images/poster0/1.jpg and /dev/null differ diff --git a/NUIsamples/NUIsamples/res/images/poster0/10.jpg b/NUIsamples/NUIsamples/res/images/poster0/10.jpg deleted file mode 100755 index 74feaec04..000000000 Binary files a/NUIsamples/NUIsamples/res/images/poster0/10.jpg and /dev/null differ diff --git a/NUIsamples/NUIsamples/res/images/poster0/11.jpg b/NUIsamples/NUIsamples/res/images/poster0/11.jpg deleted file mode 100755 index 5f03bec59..000000000 Binary files a/NUIsamples/NUIsamples/res/images/poster0/11.jpg and /dev/null differ diff --git a/NUIsamples/NUIsamples/res/images/poster0/12.jpg b/NUIsamples/NUIsamples/res/images/poster0/12.jpg deleted file mode 100755 index 60acbfa4e..000000000 Binary files a/NUIsamples/NUIsamples/res/images/poster0/12.jpg and /dev/null differ diff --git a/NUIsamples/NUIsamples/res/images/poster0/13.jpg b/NUIsamples/NUIsamples/res/images/poster0/13.jpg deleted file mode 100755 index 902b711cb..000000000 Binary files a/NUIsamples/NUIsamples/res/images/poster0/13.jpg and /dev/null differ diff --git a/NUIsamples/NUIsamples/res/images/poster0/2.jpg b/NUIsamples/NUIsamples/res/images/poster0/2.jpg deleted file mode 100755 index 7173b853a..000000000 Binary files a/NUIsamples/NUIsamples/res/images/poster0/2.jpg and /dev/null differ diff --git a/NUIsamples/NUIsamples/res/images/poster0/3.jpg b/NUIsamples/NUIsamples/res/images/poster0/3.jpg deleted file mode 100755 index c8188c6f8..000000000 Binary files a/NUIsamples/NUIsamples/res/images/poster0/3.jpg and /dev/null differ diff --git a/NUIsamples/NUIsamples/res/images/poster0/4.jpg b/NUIsamples/NUIsamples/res/images/poster0/4.jpg deleted file mode 100755 index 4405083a2..000000000 Binary files a/NUIsamples/NUIsamples/res/images/poster0/4.jpg and /dev/null differ diff --git a/NUIsamples/NUIsamples/res/images/poster0/5.jpg b/NUIsamples/NUIsamples/res/images/poster0/5.jpg deleted file mode 100755 index 5c1faf100..000000000 Binary files a/NUIsamples/NUIsamples/res/images/poster0/5.jpg and /dev/null differ diff --git a/NUIsamples/NUIsamples/res/images/poster0/6.jpg b/NUIsamples/NUIsamples/res/images/poster0/6.jpg deleted file mode 100755 index 5a8ba6308..000000000 Binary files a/NUIsamples/NUIsamples/res/images/poster0/6.jpg and /dev/null differ diff --git a/NUIsamples/NUIsamples/res/images/poster0/7.jpg b/NUIsamples/NUIsamples/res/images/poster0/7.jpg deleted file mode 100755 index 7a12aed9f..000000000 Binary files a/NUIsamples/NUIsamples/res/images/poster0/7.jpg and /dev/null differ diff --git a/NUIsamples/NUIsamples/res/images/poster0/8.jpg b/NUIsamples/NUIsamples/res/images/poster0/8.jpg deleted file mode 100755 index b528cdbe7..000000000 Binary files a/NUIsamples/NUIsamples/res/images/poster0/8.jpg and /dev/null differ diff --git a/NUIsamples/NUIsamples/res/images/poster0/9.jpg b/NUIsamples/NUIsamples/res/images/poster0/9.jpg deleted file mode 100755 index e855ecfdb..000000000 Binary files a/NUIsamples/NUIsamples/res/images/poster0/9.jpg and /dev/null differ diff --git a/NUIsamples/NUIsamples/res/images/poster1/0.jpg b/NUIsamples/NUIsamples/res/images/poster1/0.jpg deleted file mode 100755 index a7d2add98..000000000 Binary files a/NUIsamples/NUIsamples/res/images/poster1/0.jpg and /dev/null differ diff --git a/NUIsamples/NUIsamples/res/images/poster1/1.jpg b/NUIsamples/NUIsamples/res/images/poster1/1.jpg deleted file mode 100755 index b5337987a..000000000 Binary files a/NUIsamples/NUIsamples/res/images/poster1/1.jpg and /dev/null differ diff --git a/NUIsamples/NUIsamples/res/images/poster1/2.jpg b/NUIsamples/NUIsamples/res/images/poster1/2.jpg deleted file mode 100755 index ae6e1b270..000000000 Binary files a/NUIsamples/NUIsamples/res/images/poster1/2.jpg and /dev/null differ diff --git a/NUIsamples/NUIsamples/res/images/poster1/3.jpg b/NUIsamples/NUIsamples/res/images/poster1/3.jpg deleted file mode 100755 index ac65a2dc3..000000000 Binary files a/NUIsamples/NUIsamples/res/images/poster1/3.jpg and /dev/null differ diff --git a/NUIsamples/NUIsamples/res/images/poster1/4.jpg b/NUIsamples/NUIsamples/res/images/poster1/4.jpg deleted file mode 100755 index 226f1871f..000000000 Binary files a/NUIsamples/NUIsamples/res/images/poster1/4.jpg and /dev/null differ diff --git a/NUIsamples/NUIsamples/res/images/poster1/5.jpg b/NUIsamples/NUIsamples/res/images/poster1/5.jpg deleted file mode 100755 index 490fb5669..000000000 Binary files a/NUIsamples/NUIsamples/res/images/poster1/5.jpg and /dev/null differ diff --git a/NUIsamples/NUIsamples/res/images/star-dim.png b/NUIsamples/NUIsamples/res/images/star-dim.png deleted file mode 100755 index 38cc674e4..000000000 Binary files a/NUIsamples/NUIsamples/res/images/star-dim.png and /dev/null differ diff --git a/NUIsamples/NUIsamples/res/images/star-highlight.png b/NUIsamples/NUIsamples/res/images/star-highlight.png deleted file mode 100755 index f99ee25bb..000000000 Binary files a/NUIsamples/NUIsamples/res/images/star-highlight.png and /dev/null differ diff --git a/NUIsamples/NUIsamples/res/images/star-mod.png b/NUIsamples/NUIsamples/res/images/star-mod.png deleted file mode 100755 index 2e3212e66..000000000 Binary files a/NUIsamples/NUIsamples/res/images/star-mod.png and /dev/null differ diff --git a/NUIsamples/NUIsamples/res/json/control-dashboard.json b/NUIsamples/NUIsamples/res/json/control-dashboard.json deleted file mode 100755 index c2609c423..000000000 --- a/NUIsamples/NUIsamples/res/json/control-dashboard.json +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2017 Samsung Electronics Co., Ltd. - * - * This file is part of Dali Toolkit - * - * 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. - */ - -{ - "styles": - { - "ProgressBar": - { - } - } -} diff --git a/NUIsamples/NUIsamples/res/json/date-picker-template.json b/NUIsamples/NUIsamples/res/json/date-picker-template.json deleted file mode 100755 index 79ab9a2dd..000000000 --- a/NUIsamples/NUIsamples/res/json/date-picker-template.json +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright (c) 2017 Samsung Electronics Co., Ltd. - * - * 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. - * - */ -{ - // Data picker loaded directly on to the stage - // - "templates": { - "date-picker": - { - "type":"FlexContainer", - "name":"exampleDatePicker", - "flexDirection":"ROW", - "size":[480.0, 150, 0 ], - "actors": [ - { - - "type": "Spin", - "name": "Year", - "Value":2017, - "MinValue":1900, - "MaxValue":2100, - "Step":1, - "TextColor":[0.0,0.0,1.0,1.0], - "properties": { // properties registered dynamically - "flex":0.3, - "flexMargin": [5.0,0.0,5.0,0.0] - } - }, - { - - "type": "Spin", - "name": "Month", - "Value":10, - "Step":1, - "MinValue":1, - "MaxValue":12, - "TextColor":[1.0,1.0,1.0,1.0], - "properties": { // properties registered dynamically - "flex":0.3, - "flexMargin": [5.0,0.0,5.0,0.0] - } - - }, - { - - "type": "Spin", - "name": "Day", - "Value":1, - "MinValue":1, - "MaxValue":31, - "TextColor":[1.0,0.0,0.0,1.0], - "properties": { // properties registered dynamically - "flex":0.3, - "flexMargin": [5.0,0.0,5.0,0.0] - } - }] - - } -} - -} - diff --git a/NUIsamples/NUIsamples/res/json/date-picker-theme.json b/NUIsamples/NUIsamples/res/json/date-picker-theme.json deleted file mode 100755 index 6424a38e2..000000000 --- a/NUIsamples/NUIsamples/res/json/date-picker-theme.json +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (c) 2017 Samsung Electronics Co., Ltd. - * - * This file is part of Dali Toolkit - * - * 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. - */ - -{ - "styles": { - "Spin": { - "MinValue": 0, - "MaxValue": 100, - "Value": 50, - "Step": 1, - "TextColor": [ 1.0, 0.0, 0.0, 1.0 ] - } - } -} diff --git a/NUIsamples/NUIsamples/res/json/date-picker.json b/NUIsamples/NUIsamples/res/json/date-picker.json deleted file mode 100755 index 3126aa39b..000000000 --- a/NUIsamples/NUIsamples/res/json/date-picker.json +++ /dev/null @@ -1,82 +0,0 @@ -/* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. - * - * 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. - * - */ -{ - // Data picker loaded directly on to the stage - // - "stage": [{ - - "type":"FlexContainer", - "name":"exampleDatePicker", - "parentOrigin": "CENTER", - "anchorPoint": "CENTER", - "flexDirection":"ROW", - "size":[480.0, 150, 0 ], - "actors": [ - { - - "type": "Spin", - "name": "Year", - "parentOrigin": "CENTER", - "anchorPoint": "CENTER", - "MinValue":1900, - "MaxValue":2100, - "Value":2017, - "Step":1, - "TextColor":[0.0,0.0,1.0,1.0], - "properties": { // properties registered dynamically - "flex":0.3, - "flexMargin": [5.0,0.0,5.0,0.0] - } - }, - { - - "type": "Spin", - "name": "Month", - "parentOrigin": "CENTER", - "anchorPoint": "CENTER", - "parentOrigin": "CENTER", - "Step":1, - "MinValue":1, - "MaxValue":12, - "Value":10, - "TextColor":[1.0,1.0,1.0,1.0], - "properties": { // properties registered dynamically - "flex":0.3, - "flexMargin": [5.0,0.0,5.0,0.0] - } - - }, - { - - "type": "Spin", - "name": "Day", - "parentOrigin": "CENTER", - "anchorPoint": "CENTER", - "MinValue":1, - "MaxValue":31, - "Value":1, - "TextColor":[1.0,0.0,0.0,1.0], - "properties": { // properties registered dynamically - "flex":0.3, - "flexMargin": [5.0,0.0,5.0,0.0] - } - }] - -}] - -} - diff --git a/NUIsamples/NUIsamples/res/json/spin.json b/NUIsamples/NUIsamples/res/json/spin.json deleted file mode 100755 index df9b10caf..000000000 --- a/NUIsamples/NUIsamples/res/json/spin.json +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) 2014 Samsung Electronics Co., Ltd. - * - * 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. - * - */ -{ - // a tree of actors - "stage": [ - // You can add an array of Actors / Views here - // Lets add a spin to the stage - { - "type":"Spin", - "parentOrigin":"CENTER", - "size":[120,120,0] - // now lets use the C# app json-loader.exe to load it - } - - ] -} diff --git a/NUIsamples/NUIsamples/res/json/style-example-theme-one.json b/NUIsamples/NUIsamples/res/json/style-example-theme-one.json deleted file mode 100755 index 5f0ef9467..000000000 --- a/NUIsamples/NUIsamples/res/json/style-example-theme-one.json +++ /dev/null @@ -1,407 +0,0 @@ -{ - "constants": { - "STYLE_DIR": "{APPLICATION_RESOURCE_PATH}/style" - }, - "styles": { - "Title": { - "textColor": "#0000ff", - "background": { - "visualType": "COLOR", - "mixColor": [ 1.0, 1.0, 1.0, 1.0 ] - } - }, - "TableView": { - "background": { - "visualType": "COLOR", - "mixColor": [ 1.0, 1.0, 1.0, 0.03 ] - } - }, - "FlexContainer": { - "background": { - "visualType": "COLOR", - "mixColor": [ 1.0, 1.0, 1.0, 0.1 ] - } - }, - "RadioButton": { - "label": { - "textColor": [ 1, 1, 1, 1 ] - } - }, - "CheckBoxButton": { - "label": { - "textColor": [ 1, 1, 1, 1 ] - } - }, - "ColorLabel1": { - "textColor": [ 1, 0, 0, 1 ] - }, - "ColorLabel2": { - "textColor": [ 0, 1, 0, 1 ] - }, - "ColorLabel3": { - "textColor": [ 0.3, 0.3, 1, 1 ] - }, - "ThemeLabel": { - "textColor": [ 0, 1, 1, 1 ] - }, - "PopupTitle": { - "textColor": [ 1, 1, 1, 1 ] - }, - "PopupBody": { - "textColor": [ 1, 1, 0, 1 ] - }, - "TextLabel": { - "textColor": [ 0, 0, 0, 1 ] - }, - "ColorSlider1": { - "styles": [ "Slider" ] - }, - "ColorSlider2": { - "styles": [ "slider" ] - }, - "ColorSlider3": { - "styles": [ "slider" ] - }, - "ImageChannelControl": { - "enableVisibilityTransition": [ - { - "target": "imageVisual", - "property": "opacity", - "initialValue": 0, - "targetValue": 1, - "animator": { - "alphaFunction": "EASE_IN_OUT", - "timePeriod": { - "duration": 0.25, - "delay": 0 - } - } - }, - { - "target": "imageVisual", - "property": "size", - "targetValue": [ 1, 1 ] - } - ], - "disableVisibilityTransition": [ - { - "target": "imageVisual", - "property": "opacity", - "targetValue": 0, - "animator": { - "alphaFunction": "EASE_IN_OUT", - "timePeriod": { - "duration": 0.25, - "delay": 0 - } - } - }, - { - "target": "imageVisual", - "property": "size", - "targetValue": [ 1, 1, 1 ] - } - ] - }, - "ShadowButton": { - "backgroundVisual": { - "visualType": "IMAGE", - "url": "{STYLE_DIR}/images/shadowButtonBg.9.png", - "mixColor": [ 1, 1, 1, 0 ] - }, - "checkboxBgVisual": { - "visualType": "IMAGE", - "url": "{STYLE_DIR}/images/CheckBg.png", - "transform": { - "size": [ 0.09, 0.28 ], - "offset": [ 30, 0 ], - "offsetSizeMode": [ 1, 1, 0, 0 ], - "origin": "CENTER_BEGIN", - "anchorPoint": "CENTER_BEGIN" - } - }, - "checkboxFgVisual": { - "visualType": "IMAGE", - "url": "{STYLE_DIR}/images/Tick.png", - "transform": { - "size": [ 0.09, 0.28 ], - "offset": [ 30, 0 ], - "offsetSizeMode": [ 1, 1, 0, 0 ], - "origin": "CENTER_BEGIN", - "anchorPoint": "CENTER_BEGIN" - } - }, - "labelVisual": { - "visualType": "TEXT", - "text": "Don't show again", - "pointSize": 20, - "horizontalAlignment": "END", - "verticalAlignment": "CENTER", - "textColor": [ 1, 1, 1, 1 ], - "mixColor": [ 0.3, 0.3, 0.3, 1 ], - "transform": { - "size": [ 0.9, 0.9 ], - "offset": [ -30, 0 ], - "offsetSizeMode": [ 1, 1, 0, 0 ], - "origin": "CENTER_END", - "anchorPoint": "CENTER_END" - } - }, - "activeTransition": [ - { - "target": "checkboxBgVisual", - "property": "size", - "initialValue": [ 0.09, 0.28 ], - "targetValue": [ 0.12, 0.37 ], - "animator": { - "alphaFunction": "EASE_OUT_BACK", - "timePeriod": { - "duration": 0.8, - "delay": 0 - } - } - }, - { - "target": "backgroundVisual", - "property": "mixColor", - "initialValue": [ 1, 1, 1, 0 ], - "targetValue": [ 1, 1, 1, 1 ], - "animator": { - "alphaFunction": "EASE_OUT_BACK", - "timePeriod": { - "duration": 0.8, - "delay": 0 - } - } - }, - { - "target": "backgroundVisual", - "property": "size", - "initialValue": [ 0.9, 0.9 ], - "targetValue": [ 1, 1 ], - "animator": { - "alphaFunction": "EASE_OUT_BACK", - "timePeriod": { - "duration": 0.8, - "delay": 0 - } - } - }, - { - "target": "checkboxFgVisual", - "property": "size", - "initialValue": [ 0.09, 0.28 ], - "targetValue": [ 0.12, 0.37 ], - "animator": { - "alphaFunction": "EASE_OUT_BACK", - "timePeriod": { - "duration": 0.8, - "delay": 0 - } - } - }, - { - "target": "labelVisual", - "property": "mixColor", - "initialValue": [ 0.2, 0.2, 0.2, 1.0 ], - "targetValue": [ 0, 0, 0, 1 ], - "animator": { - "alphaFunction": "EASE_OUT_BACK", - "timePeriod": { - "duration": 0.8, - "delay": 0 - } - } - } - ], - "inactiveTransition": [ - { - "target": "checkboxBgVisual", - "property": "size", - "initialValue": [ 0.12, 0.37 ], - "targetValue": [ 0.09, 0.28 ], - "animator": { - "alphaFunction": "EASE_OUT_BACK", - "timePeriod": { - "duration": 0.8, - "delay": 0 - } - } - }, - { - "target": "backgroundVisual", - "property": "mixColor", - "targetValue": [ 1, 1, 1, 0 ], - "animator": { - "alphaFunction": "EASE_OUT_BACK", - "timePeriod": { - "duration": 0.8, - "delay": 0 - } - } - }, - { - "target": "checkboxFgVisual", - "property": "size", - "initialValue": [ 0.12, 0.37 ], - "targetValue": [ 0.09, 0.28 ], - "animator": { - "alphaFunction": "EASE_OUT_BACK", - "timePeriod": { - "duration": 0.8, - "delay": 0 - } - } - }, - { - "target": "labelVisual", - "property": "mixColor", - "targetValue": [ 0.4, 0.4, 0.4, 1.0 ], - "animator": { - "alphaFunction": "EASE_OUT_BACK", - "timePeriod": { - "duration": 0.8, - "delay": 0 - } - } - }, - { - "target": "backgroundVisual", - "property": "size", - "targetValue": [ 0.9, 0.9 ], - "animator": { - "alphaFunction": "EASE_OUT_BACK", - "timePeriod": { - "duration": 0.8, - "delay": 0 - } - } - } - ], - "checkTransition": [ - { - "target": "checkboxFgVisual", - "property": "pixelArea", - "initialValue": [ 0.0, 0.0, 0.0, 1.0 ], - "targetValue": [ 0.0, 0.0, 1.0, 1.0 ], - "animator": { - "alphaFunction": "EASE_IN", - "timePeriod": { - "duration": 0.4, - "delay": 0 - } - } - }, - { - "target": "checkboxFgVisual", - "property": "size", - "initialValue": [ 0.0, 0.37 ], - "targetValue": [ 0.12, 0.37 ], - "animator": { - "alphaFunction": "EASE_IN", - "timePeriod": { - "duration": 0.4, - "delay": 0 - } - } - } - ], - "uncheckTransition": [ - { - "target": "checkboxFgVisual", - "property": "pixelArea", - "initialValue": [ 0.0, 0.0, 1.0, 1.0 ], - "targetValue": [ 0.0, 0.0, 0.0, 1.0 ], - "animator": { - "alphaFunction": "EASE_OUT", - "timePeriod": { - "duration": 0.4, - "delay": 0 - } - } - }, - { - "target": "checkboxFgVisual", - "property": "size", - "targetValue": [ 0.0, 0.37 ], - "animator": { - "alphaFunction": "EASE_OUT", - "timePeriod": { - "duration": 0.4, - "delay": 0 - } - } - } - ] - }, - "BeatControl": { - "beatVisual": { - "visualType": "IMAGE", - "url": "{APPLICATION_RESOURCE_PATH}/images/Logo-for-demo.png" - }, - - "bounceTransition": [ - { - "target": "beatVisual", - "property": "size", - "initialValue": [ 0.5, 0.5 ], - "targetValue": [ 0.75, 0.75 ], - "animator": { - "alphaFunction": "BOUNCE", - "timePeriod": { - "duration": 0.5, - "delay": 0 - } - } - } - ], - - "leftTransition": [ - { - "target": "beatVisual", - "property": "offset", - "initialValue": [ 0, 0 ], - "targetValue": [ 0.25, 0 ], - "animator": { - "alphaFunction": "BOUNCE", - "timePeriod": { - "duration": 0.5, - "delay": 0 - } - } - } - ], - - "upTransition": [ - { - "target": "beatVisual", - "property": "offset", - "initialValue": [ 0, 0 ], - "targetValue": [ 0, 0.25 ], - "animator": { - "alphaFunction": "BOUNCE", - "timePeriod": { - "duration": 0.5, - "delay": 0 - } - } - } - ], - - "fadeTransition": [ - { - "target": "beatVisual", - "property": "opacity", - "targetValue": 0, - "animator": { - "alphaFunction": "BOUNCE", - "timePeriod": { - "duration": 0.8, - "delay": 0 - } - } - } - ] - } - } -} \ No newline at end of file diff --git a/NUIsamples/NUIsamples/res/models/Dino.mtl b/NUIsamples/NUIsamples/res/models/Dino.mtl deleted file mode 100755 index 049595a66..000000000 --- a/NUIsamples/NUIsamples/res/models/Dino.mtl +++ /dev/null @@ -1,11 +0,0 @@ -newmtl lambert2SG -illum 4 -Kd 0.00 0.00 0.00 -Ka 0.00 0.00 0.00 -Tf 1.00 1.00 1.00 -map_Kd Dino-Painted_lambert2SG_color.png -bump Dino-Painted_lambert2SG_nmap.png -bm 0.05 -Ni 1.00 -Ks 0.00 0.00 0.00 -map_Ks Dino-Painted_lambert2SG_gloss.png -Ns 100.00 diff --git a/NUIsamples/NUIsamples/shared/res/NUIsamples.png b/NUIsamples/NUIsamples/shared/res/NUIsamples.png deleted file mode 100755 index 9f3cb9860..000000000 Binary files a/NUIsamples/NUIsamples/shared/res/NUIsamples.png and /dev/null differ diff --git a/NUIsamples/NUIsamples/src/examples/Main.cs b/NUIsamples/NUIsamples/src/examples/Main.cs deleted file mode 100755 index 613a70b8e..000000000 --- a/NUIsamples/NUIsamples/src/examples/Main.cs +++ /dev/null @@ -1,47 +0,0 @@ -using System; -using Tizen.NUI; - - -namespace NUIsamples -{ - /// - /// The main entry point for the application. - /// - /// - - class Application - { - [STAThread] - static void Main(string[] args) - { - //new ControlDashboard.Example().Run(args); - //new DatePickerTest.Example().Run(args); - //new DatePickerUsingJson.Example().Run(args); - //new HelloTest.Example().Run(args); - //new HelloWorldTest.Example().Run(args); - //new Test1.Example().Run(args); - //new SiblingOrderTest.Example().Run(args); - //new UserAlphaFunctionTest.Example().Run(args); - //new MyCSharpExample.Example().Run(args); - //new CustomControlTest.Example().Run(args); - //new ScrollViewTest.Example().Run(args); - //new ImageViewTest.Example().Run(args); - //new FlexContainerTest.SampleMain().Run(args); - //new DaliTest.Example().Run(args); - //new RelativeVectorTest.Example().Run(args); - //new VisaulAnimationExample.Example().Run(args); - //new VisaulAnimationExample.Example2().Run(args); - //new VisaulAnimationExample.Example3().Run(args); - //new VisualViewTest.Example().Run(args); - //new VisualViewTest2.VisualSample().Run(args); - //new PositionUsesPivotPointTest.Example().Run(args); - //new VisualViewTest3.Example().Run(args); - //new VisualsUsingCustomView.VisualsExample().Run(args); - //new FirstScreen.FirstScreenApp().Run(args); - //new VisualsExampleTest.Example().Run(args); - //new AsIsTest.Example().Run(args); - //new WidgetViewTest.Example().Run(args); - new TimerTest.Example().Run(args); - } - } -} diff --git a/NUIsamples/NUIsamples/src/examples/as-is-test-sample.cs b/NUIsamples/NUIsamples/src/examples/as-is-test-sample.cs deleted file mode 100755 index da94300d4..000000000 --- a/NUIsamples/NUIsamples/src/examples/as-is-test-sample.cs +++ /dev/null @@ -1,255 +0,0 @@ -using System; -using Tizen.NUI.BaseComponents; -using Tizen.NUI; - -namespace AsIsTest -{ - class Example : NUIApplication - { - private Timer myTimer; - - private View myView; - private TextLabel myTextLabel; - - - //=========================== - Layer layer; - View vi1, vi2, vi3; - TextLabel tl1, tl2, tl3; - ToggleButton tb1, tb2, tb3; - - - protected override void OnCreate() - { - base.OnCreate(); - - myView = new View(); - myView.Size2D = new Size2D(100, 100); - myView.Position = new Position(100, 100, 0); - myView.BackgroundColor = Color.Red; - myView.Name = "myView"; - myView.SizeWidth = 111; - - Window.Instance.GetDefaultLayer().Add(myView); - - myTextLabel = new TextLabel(); - myTextLabel.Position = new Position(100, 100, 0); - myTextLabel.Size2D = new Size2D(100, 100); - myTextLabel.Name = "myTextLabel"; - - myView.Add(myTextLabel); - - //=========================== - LayerTest2(); - - myTimer = new Timer(500); - myTimer.Tick += Mytimer_Tick; - myTimer.Start(); - } - - private void ObjectDumpTrigger() - { - for (int i = 0; i < Window.LayerCount; i++) - { - BFS(Window.GetLayer((uint)i), 1); - } - } - - - - private static void BFS(Animatable o, int depth) - { - if (o == null) - { - Tizen.Log.Fatal("NUI-APP", "##### o == null! return here!"); - return; - } - - Tizen.Log.Fatal("NUI-APP", "##### o.GetTypeName()=" + o.GetTypeName()); - - if (o is View) - { - View myView = o as View; - - if (o is TextLabel) - { - TextLabel myTextLabel = o as TextLabel; - - Tizen.Log.Fatal("NUI-APP", string.Format("it is TextLabel, {0}", myTextLabel.Text)); - - return; - } - else - { - Tizen.Log.Fatal("NUI-APP", string.Format("it is not TextLaebl")); - } - - for (int i = 0; i < myView.ChildCount; i++) - { - BFS(myView.GetChildAt((uint)i), depth + 1); - } - } - else if (o is Layer) - { - Layer myLayer = o as Layer; - - for (int i = 0; i < myLayer.ChildCount; i++) - { - BFS(myLayer.GetChildAt((uint)i), depth + 1); - } - } - else - { - return; - } - } - - private bool Mytimer_Tick(object source, Timer.TickEventArgs e) - { - ObjectDumpTrigger(); - ObjectDumpTrigger2(); - Tizen.Log.Debug("NUI", " === Size property set/get test!"); - myView.Size2D.Width += 5; //this is not working, because stage's Size is Vector2 but view's Size is Vector3. need to figure out. - myView.SizeHeight += 5; - Tizen.Log.Debug("NUI", $" view's size width= {myView.Size2D.Width} heigh={myView.Size2D.Height}"); - - return true; - } - - - - //====================================================================== - void LayerTest2() - { - layer = new Layer(); - - vi1 = new View(); - vi2 = new View(); - vi3 = new View(); - - tl1 = new TextLabel(); - tl2 = new TextLabel(); - tl3 = new TextLabel(); - - tb1 = new ToggleButton(); - tb2 = new ToggleButton(); - tb3 = new ToggleButton(); - - vi1.Add(vi3); - vi1.Add(tl1); - vi1.Add(tl2); - - vi3.Add(tb1); - vi3.Add(tb2); - - vi2.Add(tl3); - - layer.Add(vi1); - layer.Add(vi2); - layer.Add(tb3); - - Window.Instance.AddLayer(layer); - } - - void ObjectDumpTrigger2() - { - uint layerCnt = Window.LayerCount; - Tizen.Log.Fatal("NUI-APP", "layerCnt=" + layerCnt); - - for (uint i = 0; i < layerCnt; i++) - { - Tizen.Log.Fatal("NUI-APP", "T[" + DateTime.Now + "]__________ layer #" + i + " traverse"); - CheckViewsInLayer(Window.GetLayer(i)); - } - } - void CheckViewsInLayer(Animatable obj) - { - if (obj is Layer) - { - var layer = obj as Layer; - if (layer == null) - { - Tizen.Log.Fatal("NUI-APP", "### layer is null! just return!"); - return; - } - uint childCnt = layer.ChildCount; - if (childCnt > 0) - { - for (uint i = 0; i < childCnt; i++) - { - var temp = layer.GetChildAt(i) as View; - Tizen.Log.Fatal("NUI-APP", "depth[1] child in layer! type=" + temp?.GetTypeName()); - ViewCheckRecurse(temp, 1); - } - } - else - { - Tizen.Log.Fatal("NUI-APP", "### there is no child in this layer! just return!"); - } - } - else - { - Tizen.Log.Fatal("NUI-APP", "obj is NOT Layer! do nothing!"); - } - } - void ViewCheckRecurse(View view, int depth) - { - if (view) - { - uint childCnt = view.ChildCount; - if (childCnt > 0) - { - depth = depth + 1; - for (uint i = 0; i < childCnt; i++) - { - var temp = view.GetChildAt(i) as View; - Tizen.Log.Fatal("NUI-APP", "depth[" + depth + "] child in layer! type=" + temp.GetTypeName() + " AS-IS Test: IsView?=" + (temp is View) + " IsTextLabel?=" + (temp is TextLabel) ); - - if (temp is TextLabel) - { - ToggleButton _toggleBt = temp as ToggleButton; - if(_toggleBt == null) - { - Tizen.Log.Debug("NUI", $"temp is TextLabel! try to do invalid cast! should return null! OK!GOOD!"); - } - else - { - Tizen.Log.Debug("NUI", $"temp is TextLabel! try to do invalid cast! should return null! BAD!ERROR!"); - } - } - else if (temp is ToggleButton) - { - TextLabel _textLb = temp as TextLabel; - if(_textLb == null) - { - Tizen.Log.Debug("NUI", $"temp is ToggleButton! try to do invalid cast! should return null! OK!GOOD!"); - } - else - { - Tizen.Log.Debug("NUI", $"temp is ToggleButton! try to do invalid cast! should return null! BAD!ERROR!"); - } - } - - ViewCheckRecurse(temp, depth); - } - } - else - { - //Tizen.Log.Fatal("NUI-APP", "depth[" + depth + "] child in layer! type=" + view.GetTypeName()); - return; - } - } - else - { - //Tizen.Log.Fatal("NUI-APP", "### view is null! just return!"); - } - } - - private static void _Main(string[] args) - { - //Create an Application - Example myProgram = new Example(); - myProgram.Run(args); - } - } -} \ No newline at end of file diff --git a/NUIsamples/NUIsamples/src/examples/control-dashboard.cs b/NUIsamples/NUIsamples/src/examples/control-dashboard.cs deleted file mode 100755 index bea0ec6a7..000000000 --- a/NUIsamples/NUIsamples/src/examples/control-dashboard.cs +++ /dev/null @@ -1,502 +0,0 @@ -/* - * Copyright (c) 2017 Samsung Electronics Co., Ltd. - * - * 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; -using Tizen.NUI; -using Tizen.NUI.UIComponents; -using Tizen.NUI.BaseComponents; -using Tizen.NUI.Constants; - -namespace ControlDashboard -{ - class Example : NUIApplication - { - // This is simple structure to contain Control name and implement state at once - // name : control name - // isImplemented : the state which the control is implemented in public or not - private struct Item - { - public String name; - public bool isImplemented; - - public Item(String name, bool isImplemented) - { - this.name = name; - this.isImplemented = isImplemented; - } - } - - private TableView _contentContainer; - private Timer _timer; - private Window _window; - private Popup _popup; - private ProgressBar _progressBar; - //private const string _resPath = "/home/owner/apps_rw/NUISamples.TizenTV/res"; - private const string _resPath = "./res"; //for ubuntu - - - // List of items - private Item[] mViewList = { - new Item("PushButton", true), new Item("DropDown", false), new Item("Toggle", true), - new Item("InputField", false), new Item("AnimateGif", false), new Item("Loading", false), - new Item("ProgressBar", true), new Item("CheckBox", false), new Item("RadioButton", true), - new Item("Tooltip", true), new Item("Popup", true), new Item("Toast", true), - new Item("ItemView", false), new Item("CheckBox", true) - }; - - public Example() : base() - { - } - - public Example(string stylesheet) : base(stylesheet) - { - } - - public Example(string stylesheet, NUIApplication.WindowMode windowMode) : base(stylesheet, windowMode) - { - } - - protected override void OnCreate() - { - base.OnCreate(); - Initialize(); - } - - public void Initialize() - { - Tizen.Log.Debug("NUI", "Customized Application Initialize event handler"); - _window = Window.Instance; - _window.BackgroundColor = Color.White; - - // Top label - TextLabel topLabel = new TextLabel(); - topLabel.WidthResizePolicy = ResizePolicyType.FillToParent; - topLabel.HeightResizePolicy = ResizePolicyType.SizeRelativeToParent; - topLabel.PivotPoint = PivotPoint.TopCenter; - topLabel.SetSizeModeFactor(new Vector3(0.0f, 0.1f, 0.0f)); - topLabel.BackgroundColor = new Color(43.0f / 255.0f, 145.0f / 255.0f, 175.0f / 255.0f, 1.0f); - topLabel.TextColor = Color.White; - topLabel.Text = " DALi Views"; - topLabel.HorizontalAlignment = HorizontalAlignment.Begin; - topLabel.VerticalAlignment = VerticalAlignment.Center; - topLabel.PointSize = 42.0f; - _window.Add(topLabel); - //StyleManager.Get().ApplyStyle(topLabel, _resPath + "/json/control-dashboard-theme.json", "TextFieldFontSize4"); - topLabel.SetStyleName("TextFieldFontSize4"); - - // Grid container to contain items. Use tableView because FlexContainer support focus navigation just two direction ( up/down or left/right ) - _contentContainer = new TableView(6, 5); - _contentContainer.WidthResizePolicy = ResizePolicyType.FillToParent; - _contentContainer.HeightResizePolicy = ResizePolicyType.SizeRelativeToParent; - _contentContainer.SetSizeModeFactor(new Vector3(0.0f, 0.9f, 0.0f)); - _contentContainer.PivotPoint = PivotPoint.BottomCenter; - _contentContainer.Position = new Position(0, _window.Size.Height * 0.1f, 0); - _contentContainer.SetRelativeHeight(0, 0.07f); - _contentContainer.SetRelativeHeight(1, 0.26f); - _contentContainer.SetRelativeHeight(2, 0.07f); - _contentContainer.SetRelativeHeight(3, 0.26f); - _contentContainer.SetRelativeHeight(4, 0.07f); - _contentContainer.SetRelativeHeight(5, 0.26f); - _contentContainer.Focusable = (true); - _window.Add(_contentContainer); - - CreateContent(); - - FocusManager.Instance.PreFocusChange += OnPreFocusChange; - } - - // Callback for KeyboardFocusManager - private View OnPreFocusChange(object source, FocusManager.PreFocusChangeEventArgs e) - { - if (!e.ProposedView && !e.CurrentView) - { - e.ProposedView = _contentContainer.GetChildAt(1); - } - return e.ProposedView; - } - - private void CreateContent() - { - for (int i = 0; i < mViewList.Length; i++) - { - CreateItem(mViewList[i], i); - } - } - - private void CreateItem(Item item, int idx) - { - // Make label for item - TextLabel itemLabel = new TextLabel(" " + item.name); - itemLabel.Size2D = new Size2D((int)(_window.Size.Width * 0.2f), (int)(_window.Size.Height * 0.05f)); - itemLabel.HorizontalAlignment = HorizontalAlignment.Begin; - itemLabel.VerticalAlignment = VerticalAlignment.Bottom; - //itemLabel.PointSize = 18.0f; - _contentContainer.AddChild(itemLabel, new TableView.CellPosition(((uint)idx / 5) * 2, (uint)idx % 5)); - - // If item is implemented in public, attach it on window - if (item.isImplemented) - { - if (item.name.CompareTo("PushButton") == 0) - { - PushButton pushButton = new PushButton(); - pushButton.LabelText = "Push Button"; - pushButton.WidthResizePolicy = ResizePolicyType.FillToParent; - pushButton.HeightResizePolicy = ResizePolicyType.FillToParent; - pushButton.UnselectedColor = new Vector4(1.0f, 0.0f, 0.0f, 1.0f); - pushButton.SelectedColor = new Vector4(0.0f, 1.0f, 0.0f, 1.0f); - pushButton.Clicked += (obj, e) => - { - Button sender = obj as Button; - sender.LabelText = "Click Me"; - sender.UnselectedColor = new Vector4(0.0f, 0.0f, 1.0f, 1.0f); - return true; - }; - - _contentContainer.AddChild(pushButton, new TableView.CellPosition(((uint)idx / 5) * 2 + 1, (uint)idx % 5)); - } - if (item.name.CompareTo("DropDown") == 0) - { - - } - if (item.name.CompareTo("Toggle") == 0) - { - ToggleButton toggleButton = new ToggleButton(); - PropertyArray array = new PropertyArray(); - array.Add(new PropertyValue(_resPath + "/images/star-highlight.png")); - array.Add(new PropertyValue(_resPath + "/images/star-mod.png")); - array.Add(new PropertyValue(_resPath + "/images/star-dim.png")); - toggleButton.StateVisuals = array; - - PropertyArray tooltips = new PropertyArray(); - tooltips.Add(new PropertyValue("State A")); - tooltips.Add(new PropertyValue("State B")); - tooltips.Add(new PropertyValue("State C")); - toggleButton.Tooltips = tooltips; - - toggleButton.WidthResizePolicy = ResizePolicyType.FillToParent; - toggleButton.HeightResizePolicy = ResizePolicyType.FillToParent; - toggleButton.Clicked += (obj, e) => - { - Tizen.Log.Debug("NUI", "Toggle button state changed."); - return true; - }; - - _contentContainer.AddChild(toggleButton, new TableView.CellPosition(((uint)idx / 5) * 2 + 1, (uint)idx % 5)); - } - if (item.name.CompareTo("InputField") == 0) - { - - } - if (item.name.CompareTo("AnimateGif") == 0) - { - - } - if (item.name.CompareTo("Loading") == 0) - { - - } - if (item.name.CompareTo("ProgressBar") == 0) - { - _progressBar = new ProgressBar(); - _progressBar.WidthResizePolicy = ResizePolicyType.FillToParent; - _progressBar.HeightResizePolicy = ResizePolicyType.Fixed; - _progressBar.Size2D = new Size2D(0, 100); - - _progressBar.ValueChanged += OnProgressBarValueChanged; - - _timer = new Timer(100); - _timer.Tick += (obj, e) => - { - float progress = (float)Math.Round(_progressBar.ProgressValue, 2); - - if (progress == 1.0f) - { - _progressBar.ProgressValue = 0.0f; - _progressBar.SecondaryProgressValue = 0.01f; - } - else - { - _progressBar.ProgressValue = progress + 0.01f; - _progressBar.SecondaryProgressValue = progress + 0.21f; - } - return true; - }; - _timer.Start(); - - _contentContainer.AddChild(_progressBar, new TableView.CellPosition(((uint)idx / 5) * 2 + 1, (uint)idx % 5)); - } - if (item.name.CompareTo("ScrollBar") == 0) - { - - } - if (item.name.CompareTo("CheckBox") == 0) - { - CheckBoxButton checkBoxButton = new CheckBoxButton(); - checkBoxButton.LabelText = "Yes"; - - _contentContainer.AddChild(checkBoxButton, new TableView.CellPosition(((uint)idx / 5) * 2 + 1, (uint)idx % 5)); - } - if (item.name.CompareTo("RadioButton") == 0) - { - TableView tableView = new TableView(2, 1); - tableView.WidthResizePolicy = ResizePolicyType.FillToParent; - tableView.HeightResizePolicy = ResizePolicyType.FillToParent; - - RadioButton rButton = new RadioButton(); - rButton.LabelText = "Yes"; - rButton.Selected = true; - tableView.AddChild(rButton, new TableView.CellPosition(0, 0)); - - rButton = new RadioButton(); - rButton.LabelText = "No"; - - tableView.AddChild(rButton, new TableView.CellPosition(1, 0)); - - _contentContainer.AddChild(tableView, new TableView.CellPosition(((uint)idx / 5) * 2 + 1, (uint)idx % 5)); - } - if (item.name.CompareTo("Tooltip") == 0) - { - TableView tableView = new TableView(2, 1); - tableView.WidthResizePolicy = ResizePolicyType.FillToParent; - tableView.HeightResizePolicy = ResizePolicyType.FillToParent; - - // Create two push buttons and add them to a table view - PushButton buttonWithSimpleTooltip = new PushButton(); - buttonWithSimpleTooltip.LabelText = "Tooltip with text only"; - buttonWithSimpleTooltip.UnselectedColor = new Vector4(0.5f, 0.5f, 0.7f, 1.0f); - buttonWithSimpleTooltip.SelectedColor = new Vector4(0.7f, 0.5f, 0.7f, 1.0f); - buttonWithSimpleTooltip.WidthResizePolicy = ResizePolicyType.FillToParent; - tableView.AddChild(buttonWithSimpleTooltip, new TableView.CellPosition(0, 0)); - - PushButton buttonWithIconTooltip = new PushButton(); - buttonWithIconTooltip.LabelText = "Tooltip with Text and Icon"; - buttonWithIconTooltip.WidthResizePolicy = ResizePolicyType.FillToParent; - buttonWithIconTooltip.UnselectedColor = new Vector4(0.5f, 0.5f, 0.7f, 1.0f); - buttonWithIconTooltip.SelectedColor = new Vector4(0.7f, 0.5f, 0.7f, 1.0f); - tableView.AddChild(buttonWithIconTooltip, new TableView.CellPosition(1, 0)); - - // Add a simple text only tooltip to the first push button - buttonWithSimpleTooltip.TooltipText = "Simple Tooltip"; - - // Create a property map for a tooltip with one icon and one text - PropertyArray iconTooltipContent = new PropertyArray(); - - PropertyMap iconVisual = new PropertyMap(); - iconVisual.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.Image)) - .Add(ImageVisualProperty.URL, new PropertyValue(_resPath + "/images/star-highlight.png")); - iconTooltipContent.Add(new PropertyValue(iconVisual)); - - PropertyMap textVisual = new PropertyMap(); - textVisual.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.Text)) - .Add(TextVisualProperty.Text, new PropertyValue("Tooltip with Icon")); - iconTooltipContent.Add(new PropertyValue(textVisual)); - - PropertyMap iconTooltip = new PropertyMap(); - iconTooltip.Add(Tizen.NUI.Constants.Tooltip.Property.Content, new PropertyValue(iconTooltipContent)) - .Add(Tizen.NUI.Constants.Tooltip.Property.Tail, new PropertyValue(true)); - - // Add the tooltip with icon and text to the second push button - buttonWithIconTooltip.Tooltip = iconTooltip; - - _contentContainer.AddChild(tableView, new TableView.CellPosition(((uint)idx / 5) * 2 + 1, (uint)idx % 5)); - } - if (item.name.CompareTo("Popup") == 0) - { - PushButton button = new PushButton(); - button.LabelText = "Popup"; - button.PivotPoint = PivotPoint.Center; - button.MaximumSize = new Size2D(150, 100); - _popup = CreatePopup(); - _popup.SetTitle(CreateTitle("Popup")); - - TextLabel text = new TextLabel("This will erase the file permanently. Are you sure?"); - text.BackgroundColor = Color.White; - text.MultiLine = true; - text.WidthResizePolicy = ResizePolicyType.FillToParent; - text.HeightResizePolicy = ResizePolicyType.DimensionDependency; - text.SetPadding(new PaddingType(10.0f, 10.0f, 20.0f, 0.0f)); - _popup.SetContent(text); - _popup.Focusable = (true); - _popup.SetDisplayState(Popup.DisplayStateType.Hidden); - - button.Clicked += (obj, ee) => - { - _window.Add(_popup); - _popup.SetDisplayState(Popup.DisplayStateType.Shown); - FocusManager.Instance.SetCurrentFocusView((_popup.FindChildByName("Footer")).FindChildByName("OKButton")); - return true; - }; - _contentContainer.AddChild(button, new TableView.CellPosition(((uint)idx / 5) * 2 + 1, (uint)idx % 5)); - } - if (item.name.CompareTo("Toast") == 0) - { - PushButton button = new PushButton(); - button.LabelText = "Toast"; - button.PivotPoint = PivotPoint.Center; - button.Clicked += (obj, ee) => - { - Popup toast = new Popup(); - toast.SizeModeFactor = new Vector3(0.75f, 0.75f, 0.75f); - toast.WidthResizePolicy = ResizePolicyType.SizeRelativeToParent; - toast.HeightResizePolicy = ResizePolicyType.UseNaturalSize; - toast.ContextualMode = Popup.ContextualModeType.NonContextual; - toast.AnimationDuration = 0.65f; - toast.TailVisibility = false; - - // Disable the dimmed backing. - toast.BackingEnabled = false; - - // The toast popup should fade in (not zoom). - toast.AnimationMode = Popup.AnimationModeType.Fade; - - // The toast popup should auto-hide. - toast.AutoHideDelay = 3000; - - // Align to the bottom of the screen. - toast.ParentOrigin = new Position(0.5f, 0.94f, 0.5f); - toast.PivotPoint = PivotPoint.BottomCenter; - - // Let events pass through the toast popup. - toast.TouchTransparent = true; - - TextLabel text = new TextLabel("This is a Toast.\nIt will auto-hide itself"); - text.TextColor = Color.White; - text.MultiLine = true; - text.HorizontalAlignment = HorizontalAlignment.Center; - toast.SetTitle(text); - _window.Add(toast); - toast.DisplayState = Popup.DisplayStateType.Shown; - - return true; - }; - _contentContainer.AddChild(button, new TableView.CellPosition(((uint)idx / 5) * 2 + 1, (uint)idx % 5)); - } - if (item.name.CompareTo("ItemView") == 0) - { - - } - } - else - { - ImageView notSupportView = new ImageView(_resPath + "/images/not_yet_sign.png"); - notSupportView.Size2D = new Size2D((int)(_window.Size.Width * 0.2f), (int)(_window.Size.Height * 0.25f)); - notSupportView.Focusable = (true); - _contentContainer.AddChild(notSupportView, new TableView.CellPosition(((uint)idx / 5) * 2 + 1, (uint)idx % 5)); - } - } - Popup CreatePopup() - { - Popup confirmationPopup = new Popup(); - - View footer = new View(); - footer.Name = ("Footer"); - footer.WidthResizePolicy = ResizePolicyType.FillToParent; - footer.HeightResizePolicy = ResizePolicyType.Fixed; - footer.Size2D = new Size2D(0, 80); - footer.PivotPoint = PivotPoint.Center; - - PushButton okButton = CreateOKButton(); - okButton.PivotPoint = PivotPoint.Center; - okButton.WidthResizePolicy = ResizePolicyType.SizeFixedOffsetFromParent; - okButton.HeightResizePolicy = ResizePolicyType.SizeFixedOffsetFromParent; - okButton.SetSizeModeFactor(new Vector3(-20.0f, -20.0f, 0.0f)); - - PushButton cancelButton = CreateCancelButton(); - cancelButton.PivotPoint = PivotPoint.Center; - cancelButton.WidthResizePolicy = ResizePolicyType.SizeFixedOffsetFromParent; - cancelButton.HeightResizePolicy = ResizePolicyType.SizeFixedOffsetFromParent; - cancelButton.SetSizeModeFactor(new Vector3(-20.0f, -20.0f, 0.0f)); - - TableView controlLayout = new TableView(1, 2); - controlLayout.PivotPoint = PivotPoint.Center; - controlLayout.WidthResizePolicy = ResizePolicyType.FillToParent; - controlLayout.HeightResizePolicy = ResizePolicyType.FillToParent; - controlLayout.SetCellPadding(new Size2D(10, 10)); - controlLayout.SetRelativeWidth(0, 0.5f); - controlLayout.SetRelativeWidth(1, 0.5f); - controlLayout.SetCellAlignment(new TableView.CellPosition(0, 0), HorizontalAlignmentType.Center, VerticalAlignmentType.Center); - controlLayout.SetCellAlignment(new TableView.CellPosition(0, 1), HorizontalAlignmentType.Center, VerticalAlignmentType.Center); - controlLayout.AddChild(okButton, new TableView.CellPosition(0, 0)); - controlLayout.AddChild(cancelButton, new TableView.CellPosition(0, 1)); - - footer.Add(controlLayout); - - confirmationPopup.SetFooter(footer); - return confirmationPopup; - } - View CreateTitle(string title) - { - TextLabel titleView = new TextLabel(title); - titleView.TextColor = Color.White; - titleView.MultiLine = true; - titleView.HorizontalAlignment = HorizontalAlignment.Center; - return titleView; - } - - PushButton CreateOKButton() - { - PushButton okayButton = new PushButton(); - okayButton.Name = ("OKButton"); - okayButton.LabelText = "OK"; - okayButton.Focusable = (true); - okayButton.Clicked += (obj, ee) => - { - _popup.SetDisplayState(Popup.DisplayStateType.Hidden); - return true; - }; - return okayButton; - } - PushButton CreateCancelButton() - { - PushButton cancelButton = new PushButton(); - cancelButton.LabelText = "Cancel"; - cancelButton.Focusable = (true); - cancelButton.Clicked += (obj, ee) => - { - _popup.SetDisplayState(Popup.DisplayStateType.Hidden); - return true; - }; - return cancelButton; - } - - void OnProgressBarValueChanged(object source, ProgressBar.ValueChangedEventArgs e) - { - PropertyMap labelVisual = new PropertyMap(); - labelVisual.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.Text)) - .Add(TextVisualProperty.Text, new PropertyValue(Math.Round(e.ProgressBar.ProgressValue, 2) + " / " + Math.Round(e.ProgressBar.SecondaryProgressValue, 2))) - .Add(TextVisualProperty.PointSize, new PropertyValue(10.0f)); - e.ProgressBar.LabelVisual = labelVisual; - return; - } - - - /// - /// The main entry point for the application. - /// - - [STAThread] - static void _Main(string[] args) - { - Tizen.Log.Debug("NUI", "Hello Mono World"); - - Example example = new Example("/home/owner/apps_rw/NUISamples.TizenTV/res/json/control-dashboard-theme.json"); - - example.Run(args); - } - } -} diff --git a/NUIsamples/NUIsamples/src/examples/custom-control.cs b/NUIsamples/NUIsamples/src/examples/custom-control.cs deleted file mode 100755 index df9e60eb9..000000000 --- a/NUIsamples/NUIsamples/src/examples/custom-control.cs +++ /dev/null @@ -1,261 +0,0 @@ -/* - * Copyright (c) 2017 Samsung Electronics Co., Ltd. - * - * 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; -using Tizen.NUI.UIComponents; -using Tizen.NUI.BaseComponents; -using Tizen.NUI; - -namespace CustomControlTest -{ - - // A custom control for star rating (draggable to change the rating) - class StarRating : CustomView - { - private const string resources = "/home/owner/apps_rw/NUISamples.TizenTV/res"; - private FlexContainer _container; - private ImageView[] _images; - private Vector3 _gestureDisplacement; - private int _currentValue; - private int _myRating; - private bool _myDragEnabled; - - // Called by DALi Builder if it finds a StarRating control in a JSON file - static CustomView CreateInstance() - { - return new StarRating(); - } - - // static constructor registers the control type (only runs once) - static StarRating() - { - // ViewRegistry registers control type with DALi type registery - // also uses introspection to find any properties that need to be registered with type registry - CustomViewRegistry.Instance.Register(CreateInstance, typeof(StarRating) ); - } - - public StarRating() : base(typeof(StarRating).Name, CustomViewBehaviour.ViewBehaviourDefault) - { - } - - public override void OnInitialize() - { - // Create a container for the star images - _container = new FlexContainer(); - - _container.FlexDirection = FlexContainer.FlexDirectionType.Row; - _container.WidthResizePolicy = ResizePolicyType.FillToParent; - _container.HeightResizePolicy = ResizePolicyType.FillToParent; - - this.Add(_container); - - // Create the images - _images = new ImageView[5]; - - for(int i = 0; i < 5; i++) - { - _images[i] = new ImageView(resources+"/images/star-dim.png"); - _container.Add( _images[i] ); - } - - // Update the images according to the rating (dimmed star by default) - _myRating = 0; - UpdateStartImages(_myRating); - - // Enable pan gesture detection - EnableGestureDetection(Gesture.GestureType.Pan); - _myDragEnabled = true; // Allow dragging by default (can be disabled) - } - - // Pan gesture handling - public override void OnPan(PanGesture gesture) - { - // Only handle pan gesture if dragging is allowed - if(_myDragEnabled) - { - switch (gesture.State) - { - case Gesture.StateType.Started: - { - _gestureDisplacement = new Vector3(0.0f, 0.0f, 0.0f); - _currentValue = 0; - break; - } - case Gesture.StateType.Continuing: - { - // Calculate the rating according to pan desture displacement - _gestureDisplacement.X += gesture.Displacement.X; - int delta = (int)Math.Ceiling(_gestureDisplacement.X / 40.0f); - _currentValue = _myRating + delta; - - // Clamp the rating - if(_currentValue < 0) _currentValue = 0; - if(_currentValue > 5) _currentValue = 5; - - // Update the images according to the rating - UpdateStartImages(_currentValue); - break; - } - default: - { - _myRating = _currentValue; - break; - } - } - } - } - - // Update the images according to the rating - private void UpdateStartImages(int rating) - { - for(int i = 0; i < rating; i++) - { - _images[i].WidthResizePolicy = ResizePolicyType.UseNaturalSize; - _images[i].HeightResizePolicy = ResizePolicyType.UseNaturalSize; - _images[i].SetImage(resources+"/images/star-highlight.png"); - } - - for(int i = rating; i < 5; i++) - { - _images[i].WidthResizePolicy = ResizePolicyType.UseNaturalSize; - _images[i].HeightResizePolicy = ResizePolicyType.UseNaturalSize; - _images[i].SetImage(resources+"/images/star-dim.png"); - } - } - - // Rating property of type int: - public int Rating - { - get - { - return _myRating; - } - set - { - _myRating = value; - UpdateStartImages(_myRating); - } - } - - // DragEnabled property of type bool: - public bool DragEnabled - { - get - { - return _myDragEnabled; - } - set - { - _myDragEnabled = value; - } - } - } - - class Example : NUIApplication - { - [UnmanagedFunctionPointer(CallingConvention.StdCall)] - delegate void CallbackDelegate(); - private const string resources = "/home/owner/apps_rw/NUISamples.TizenTV/res"; - - - public Example() : base() - { - } - - public Example(string stylesheet) : base(stylesheet) - { - } - - public Example(string stylesheet, WindowMode windowMode) : base(stylesheet, windowMode) - { - } - - protected override void OnCreate() - { - base.OnCreate(); - Initialize(); - } - - public void Initialize() - { - Window window = Window.Instance; - window.BackgroundColor = Color.White; - - // Create a container to layout the rows of image and rating vertically - FlexContainer container = new FlexContainer(); - - container.ParentOrigin = ParentOrigin.TopLeft; - container.PivotPoint = PivotPoint.TopLeft; - container.FlexDirection = (int)FlexContainer.FlexDirectionType.Column; - container.WidthResizePolicy = ResizePolicyType.FillToParent; - container.HeightResizePolicy = ResizePolicyType.FillToParent; - - window.Add(container); - - Random random = new Random(); - - for(int i = 0; i < 6; i++) // 6 rows in total - { - // Create a container to layout the image and rating (in each row) horizontally - FlexContainer imageRow = new FlexContainer(); - imageRow.ParentOrigin = ParentOrigin.TopLeft; - imageRow.PivotPoint = PivotPoint.TopLeft; - imageRow.FlexDirection = FlexContainer.FlexDirectionType.Row; - imageRow.Flex = 1.0f; - container.Add(imageRow); - - // Add the image view to the row - ImageView image = new ImageView(resources+"/images/gallery-" + i + ".jpg"); - image.Size2D = new Size2D(120, 120); - image.WidthResizePolicy = ResizePolicyType.Fixed; - image.HeightResizePolicy = ResizePolicyType.Fixed; - image.AlignSelf = (int)FlexContainer.Alignment.AlignCenter; - image.Flex = 0.3f; - image.FlexMargin = new Vector4(10.0f, 0.0f, 0.0f, 0.0f); - imageRow.Add(image); - - // Create a rating control - StarRating view = new StarRating(); - - // Add the rating control to the row - view.ParentOrigin = ParentOrigin.Center; - view.PivotPoint = PivotPoint.Center; - view.Size2D = new Size2D(200, 40); - view.Flex = 0.7f; - view.AlignSelf = (int)FlexContainer.Alignment.AlignCenter; - view.FlexMargin = new Vector4(30.0f, 0.0f, 0.0f, 0.0f); - imageRow.Add(view); - - // Set the initial rating randomly between 1 and 5 - view.Rating = random.Next(1, 6); - } - } - - /// - /// The main entry point for the application. - /// - [STAThread] - static void _Main(string[] args) - { - //System.Runtime.CompilerServices.RuntimeHelpers.RunClassConstructor (typeof(MyCSharpExample.StarRating).TypeHandle); - - Example example = new Example(); - example.Run(args); - } - } -} diff --git a/NUIsamples/NUIsamples/src/examples/dali-test.cs b/NUIsamples/NUIsamples/src/examples/dali-test.cs deleted file mode 100755 index b25aa6e31..000000000 --- a/NUIsamples/NUIsamples/src/examples/dali-test.cs +++ /dev/null @@ -1,914 +0,0 @@ -/* - * Copyright (c) 2017 Samsung Electronics Co., Ltd. - * - * 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; -using Tizen.NUI; -using Tizen.NUI.UIComponents; -using Tizen.NUI.BaseComponents; -using Tizen.NUI.Constants; - -namespace DaliTest -{ - class MyView : View - { - private string _myOwnName; - public int _myCurrentValue; - - public MyView() - { - _myCurrentValue = 0; - } - - public string MyOwnName - { - get - { - return _myOwnName; - } - set - { - _myOwnName = value; - } - } - } - - class MyButton : PushButton - { - private string _myOwnName; - public int _myCurrentValue; - - public MyButton() - { - _myCurrentValue = 0; - } - - public string MyOwnName - { - get - { - return _myOwnName; - } - set - { - _myOwnName = value; - } - } - } - - class MySpin : Spin - { - private string _myOwnName; - public int _myCurrentValue; - - public MySpin() - { - _myCurrentValue = 0; - } - - public string MyOwnName - { - get - { - return _myOwnName; - } - set - { - _myOwnName = value; - } - } - } - - class Example : NUIApplication - { - //private const string _resPath = "/home/owner/apps_rw/NUISamples.TizenTV/res"; - private const string _resPath = "./res"; //for ubuntu - - [UnmanagedFunctionPointer(CallingConvention.StdCall)] - delegate void CallbackDelegate(IntPtr appPtr); // void, void delgate - - public Example() : base() - { - } - - public Example(string stylesheet) : base(stylesheet) - { - } - - public Example(string stylesheet, WindowMode windowMode) : base(stylesheet, windowMode) - { - } - - protected override void OnCreate() - { - base.OnCreate(); - Initialize(); - } - - public void Initialize() - { - DowncastTest(); - - NavigationPropertiesTests(); - - OperatorTests(); - - CustomViewPropertyTest(); - - VisibilityChangeTest(); - - ResourceReadyTest(); - - ViewFocusTest(); - - WindowDevelPropertyTest(); - - Animatable handle = new Animatable(); - int myPropertyIndex = handle.RegisterProperty("myProperty", new PropertyValue(10.0f), PropertyAccessMode.ReadWrite); - float myProperty = 0.0f; - handle.GetProperty(myPropertyIndex).Get(out myProperty); - Tizen.Log.Debug("NUI", "myProperty value: " + myProperty ); - - int myPropertyIndex2 = handle.RegisterProperty("myProperty2", new PropertyValue(new Size(5.0f, 5.0f, 0.0f)), PropertyAccessMode.ReadWrite); - Size2D myProperty2 = new Size2D(0, 0); - handle.GetProperty(myPropertyIndex2).Get(myProperty2); - Tizen.Log.Debug("NUI", "myProperty2 value: " + myProperty2.Width + ", " + myProperty2.Height ); - - View view = new View(); - view.Size2D = new Size2D(200, 200); - view.Name = "MyView"; - //view.MixColor = new Color(1.0f, 0.0f, 1.0f, 0.8f); - Tizen.Log.Debug("NUI", "View size: " + view.Size2D.Width + ", " + view.Size2D.Height); - Tizen.Log.Debug("NUI", "View name: " + view.Name); - - Window window = Window.Instance; - window.BackgroundColor = Color.White; - Size windowSize = new Size(window.Size.Width, window.Size.Height, 0.0f); - Tizen.Log.Debug("NUI", "Window size: " + windowSize.Width + ", " + windowSize.Height); - window.Add(view); - - TextLabel text = new TextLabel("Hello Mono World"); - text.ParentOrigin = ParentOrigin.Center; - text.PivotPoint = PivotPoint.Center; - text.HorizontalAlignment = HorizontalAlignment.Center; - window.Add(text); - - Tizen.Log.Debug("NUI", "Text label text: " + text.Text ); - - Tizen.Log.Debug("NUI", "Text label point size: " + text.PointSize ); - text.PointSize = 32.0f; - Tizen.Log.Debug("NUI", "Text label new point size: " + text.PointSize ); - - RectanglePaddingClassTest(); - - Tizen.Log.Debug("NUI", " *************************" ); - Size Size = new Size(100, 50, 0); - Tizen.Log.Debug("NUI", " Created " + Size ); - Tizen.Log.Debug("NUI", " Size x = " + Size.Width + ", y = " + Size.Height ); - Size += new Size(20, 20, 0); - Tizen.Log.Debug("NUI", " Size x = " + Size.Width + ", y = " + Size.Height ); - Size.Width += 10; - Size.Height += 10; - Tizen.Log.Debug("NUI", " Size width = " + Size.Width + ", height = " + Size.Height ); - - Tizen.Log.Debug("NUI", " *************************" ); - Position Position = new Position(20, 100, 50); - Tizen.Log.Debug("NUI", " Created " + Position ); - Tizen.Log.Debug("NUI", " Position x = " + Position.X + ", y = " + Position.Y + ", z = " + Position.Z ); - Position += new Position(20, 20, 20); - Tizen.Log.Debug("NUI", " Position x = " + Position.X + ", y = " + Position.Y + ", z = " + Position.Z ); - Position.X += 10; - Position.Y += 10; - Position.Z += 10; - Tizen.Log.Debug("NUI", " Position width = " + Position.X + ", height = " + Position.Y + ", depth = " + Position.Z ); - - Tizen.Log.Debug("NUI", " *************************" ); - Color color = new Color(20, 100, 50, 200); - Tizen.Log.Debug("NUI", " Created " + color ); - Tizen.Log.Debug("NUI", " Color R = " + color.R + ", G = " + color.G + ", B = " + color.B + ", A = " + color.A ); - color += new Color(20, 20, 20, 20); - Tizen.Log.Debug("NUI", " Color R = " + color.R + ", G = " + color.G + ", B = " + color.B + ", A = " + color.A ); - color.R += 10; - color.G += 10; - color.B += 10; - color.A += 10; - Tizen.Log.Debug("NUI", " Color r = " + color.R + ", g = " + color.G + ", b = " + color.B + ", a = " + color.A ); - - ViewDownCastTest(); - } - - public void RectanglePaddingClassTest() - { - using (Rectangle r1 = new Rectangle(2, 5, 20, 30)) - { - Tizen.Log.Debug("NUI", " Created " + r1 ); - Tizen.Log.Debug("NUI", " IsEmpty() = " + r1.IsEmpty() ); - Tizen.Log.Debug("NUI", " Left = " + r1.Left() ); - Tizen.Log.Debug("NUI", " Right = " + r1.Right() ); - Tizen.Log.Debug("NUI", " Top = " + r1.Top() ); - Tizen.Log.Debug("NUI", " Bottom = " + r1.Bottom() ); - Tizen.Log.Debug("NUI", " Area = " + r1.Area() ); - } - - Tizen.Log.Debug("NUI", " *************************" ); - - using (Rectangle r2 = new Rectangle(2, 5, 20, 30)) - { - Tizen.Log.Debug("NUI", " Created " + r2 ); - r2.Set(1,1,40,40); - Tizen.Log.Debug("NUI", " IsEmpty() = " + r2.IsEmpty() ); - Tizen.Log.Debug("NUI", " Left = " + r2.Left() ); - Tizen.Log.Debug("NUI", " Right = " + r2.Right() ); - Tizen.Log.Debug("NUI", " Top = " + r2.Top() ); - Tizen.Log.Debug("NUI", " Bottom = " + r2.Bottom() ); - Tizen.Log.Debug("NUI", " Area = " + r2.Area() ); - } - - Tizen.Log.Debug("NUI", " *************************" ); - - Rectangle r3 = new Rectangle(10, 10, 20, 20); - Rectangle r4 = new Rectangle(10, 10, 20, 20); - - if (r3 == r4) - { - Tizen.Log.Debug("NUI", "r3 == r4"); - } - else - { - Tizen.Log.Debug("NUI", "r3 != r4"); - } - - r4 = new Rectangle(12, 10, 20, 20); - - if (r3 == r4) - { - Tizen.Log.Debug("NUI", "r3 == r4"); - } - else - { - Tizen.Log.Debug("NUI", "r3 != r4"); - } - - PaddingType p1 = new PaddingType(10.5f, 10.7f, 20.8f, 20.8f); - PaddingType p2 = new PaddingType(10.5f, 10.7f, 20.8f, 20.8f); - - if (p1 == p2) - { - Tizen.Log.Debug("NUI", "p1 == p2"); - } - else - { - Tizen.Log.Debug("NUI", "p1 != p2"); - } - - p2 = new PaddingType(12.0f, 10.7f, 20.2f, 20.0f); - - if (p1 == p2) - { - Tizen.Log.Debug("NUI", "p1 == p2"); - } - else - { - Tizen.Log.Debug("NUI", "p1 != p2"); - } - } - - public void NavigationPropertiesTests() - { - View view = new View(); - View leftView, rightView, upView, downView, tmpView; - - leftView = new View(); - leftView.Name = "leftView"; - rightView = new View(); - rightView.Name = "rightView"; - upView = new View(); - upView.Name = "upView"; - downView = new View(); - downView.Name = "downView"; - - Window.Instance.Add(leftView); - Window.Instance.Add(rightView); - Window.Instance.Add(upView); - Window.Instance.Add(downView); - - view.LeftFocusableView = leftView; - tmpView = view.LeftFocusableView; - if (string.Compare(tmpView.Name, "leftView") == 0) - { - Tizen.Log.Debug("NUI", "Passed: LeftFocusedView = " + tmpView.Name); - } - else - { - Tizen.Log.Debug("NUI", "Failed: LeftFocusedView = " + tmpView.Name); - } - - view.RightFocusableView = rightView; - tmpView = view.RightFocusableView; - if (string.Compare(tmpView.Name, "rightView") == 0) - { - Tizen.Log.Debug("NUI", "Passed: RightFocusedView = " + tmpView.Name); - } - else - { - Tizen.Log.Debug("NUI", "Failed: RightFocusedView = " + tmpView.Name); - } - - Window.Instance.Add(view); - - view.UpFocusableView = upView; - tmpView = view.UpFocusableView; - if (string.Compare(tmpView.Name, "upView") == 0) - { - Tizen.Log.Debug("NUI", "Passed: UpFocusedView = " + tmpView.Name); - } - else - { - Tizen.Log.Debug("NUI", "Failed: UpFocusedView = " + tmpView.Name); - } - - view.DownFocusableView = downView; - tmpView = view.DownFocusableView; - if (string.Compare(tmpView.Name, "downView") == 0) - { - Tizen.Log.Debug("NUI", "Passed: DownFocusedView = " + tmpView.Name); - } - else - { - Tizen.Log.Debug("NUI", "Failed: DownFocusedView = " + tmpView.Name); - } - - Window.Instance.Remove(leftView); - tmpView = view.LeftFocusableView; - if (!tmpView) - { - Tizen.Log.Debug("NUI", "Passed: NULL LeftFocusedView"); - } - else - { - Tizen.Log.Debug("NUI", "Failed: LeftFocusedView = " + tmpView.Name); - } - } - - public void OperatorTests() - { - View view = new View(); - View differentView = new View(); - View viewSame = view; - View nullView = null; - - // test the true operator - if ( view ) - { - Tizen.Log.Debug("NUI", "BaseHandle Operator true (view) : test passed "); - } - else - { - Tizen.Log.Debug("NUI", "BaseHandle Operator true (view): test failed "); - } - - View parent = view.Parent; - - if ( parent ) - { - Tizen.Log.Debug("NUI", "Handle with Empty body :failed "); - } - else - { - Tizen.Log.Debug("NUI", "Valid with Empty body :passed "); - } - - view.Add( differentView ); - - // here we test two different C# objects, which on the native side have the same body/ ref-object - if ( view == differentView.Parent ) - { - Tizen.Log.Debug("NUI", "view == differentView.GetParent() :passed "); - } - else - { - Tizen.Log.Debug("NUI", "view == differentView.GetParent() :failed "); - } - - if ( differentView == differentView.Parent ) - { - Tizen.Log.Debug("NUI", "differentView == differentView.GetParent() :failed "); - } - else - { - Tizen.Log.Debug("NUI", "differentView == differentView.GetParent() :passed "); - } - - if ( nullView ) - { - Tizen.Log.Debug("NUI", "BaseHandle Operator true (nullView) : test failed "); - } - else - { - Tizen.Log.Debug("NUI", "BaseHandle Operator true (nullView): test passed "); - } - - // ! operator - if ( !view ) - { - Tizen.Log.Debug("NUI", "BaseHandle Operator !(view) : test failed "); - } - else - { - Tizen.Log.Debug("NUI", "BaseHandle Operator !(view): test passed "); - } - - if ( !nullView ) - { - Tizen.Log.Debug("NUI", "BaseHandle Operator !(nullView) : test passed "); - } - else - { - Tizen.Log.Debug("NUI", "BaseHandle Operator !(nullView): test failed "); - } - - // Note: operator false only used inside & operator - // test equality operator == - if ( view == viewSame ) - { - Tizen.Log.Debug("NUI", "BaseHandle Operator (view == viewSame) : test passed"); - } - else - { - Tizen.Log.Debug("NUI", "BaseHandle Operator (view == viewSame) : test failed"); - } - - if ( view == differentView ) - { - Tizen.Log.Debug("NUI", "BaseHandle Operator (view == differentView) : test failed"); - } - else - { - Tizen.Log.Debug("NUI", "BaseHandle Operator (view == differentView) : test passed"); - } - - if ( view == nullView ) - { - Tizen.Log.Debug("NUI", "BaseHandle Operator (view == nullView) : test failed"); - } - else - { - Tizen.Log.Debug("NUI", "BaseHandle Operator (view == nullView) : test passed"); - } - - if ( nullView == nullView ) - { - Tizen.Log.Debug("NUI", "BaseHandle Operator (nullView == nullView) : test passed"); - } - else - { - Tizen.Log.Debug("NUI", "BaseHandle Operator (nullView == nullView) : test failed"); - } - - // test || operator - if ( view || viewSame ) - { - Tizen.Log.Debug("NUI", "BaseHandle Operator (view || viewSame) : test passed"); - } - else - { - Tizen.Log.Debug("NUI", "BaseHandle Operator (view || viewSame) : test failed"); - } - - if ( view || nullView ) - { - Tizen.Log.Debug("NUI", "BaseHandle Operator (view || nullView) : test passed"); - } - else - { - Tizen.Log.Debug("NUI", "BaseHandle Operator (view || nullView) : test failed"); - } - - if ( nullView || nullView ) - { - Tizen.Log.Debug("NUI", "BaseHandle Operator (nullView || nullView) : test failed"); - } - else - { - Tizen.Log.Debug("NUI", "BaseHandle Operator (nullView || nullView) : test passed"); - } - - // test && operator - if ( view && viewSame ) - { - Tizen.Log.Debug("NUI", "BaseHandle Operator (view && viewSame) : test passed"); - } - else - { - Tizen.Log.Debug("NUI", "BaseHandle Operator (view && viewSame) : test failed"); - } - - if ( view && nullView ) - { - Tizen.Log.Debug("NUI", "BaseHandle Operator (view && nullView) : test failed"); - } - else - { - Tizen.Log.Debug("NUI", "BaseHandle Operator (view && nullView) : test passed"); - } - - if ( nullView && nullView ) - { - Tizen.Log.Debug("NUI", "BaseHandle Operator (nullView && nullView) : test failed"); - } - else - { - Tizen.Log.Debug("NUI", "BaseHandle Operator (nullView && nullView) : test passed"); - } - } - - - private TextLabel label; - public void VisibilityChangeTest() - { - label = new TextLabel(); - label.Text = "Visibility"; - label.TextColor = Color.Red; - label.PointSize = 30.0f; - label.ParentOrigin = ParentOrigin.TopLeft; - label.PivotPoint = PivotPoint.TopLeft; - label.Position = new Position(0.0f, 50.0f, 0.0f); - Window.Instance.Add(label); - label.VisibilityChanged += (sender, e) => - { - if (e.Visibility) - Tizen.Log.Debug("NUI", "VisibilityChanged, label show."); - else - Tizen.Log.Debug("NUI", "VisibilityChanged, label hide."); - }; - - PushButton button = new PushButton(); - button.LabelText = "Change Visibility"; - button.ParentOrigin = ParentOrigin.TopLeft; - button.PivotPoint = PivotPoint.TopLeft; - Window.Instance.Add(button); - button.Clicked += (sender, e) => - { - if (label.Visible) - { - label.Hide(); - } - else - { - label.Show(); - } - - return true; - }; - } - - public void ResourceReadyTest() - { - ImageView image = new ImageView(); - image.ResourceUrl = _resPath + "/images/dog-anim.gif"; - image.Size2D = new Size2D(150, 150); - image.ParentOrigin = ParentOrigin.TopLeft; - image.PivotPoint = PivotPoint.TopLeft; - image.Position = new Position(0.0f, 150.0f, 0.0f); - image.ResourceReady += (sender, e) => - { - Tizen.Log.Debug("NUI", "Resource is ready!"); - }; - Window.Instance.Add(image); - } - - public void ViewFocusTest() - { - View view1 = new View(); - view1.BackgroundColor = Color.Red; - view1.Size2D = new Size2D(80, 50); - view1.ParentOrigin = ParentOrigin.CenterLeft; - view1.PivotPoint = PivotPoint.CenterLeft; - view1.Position = new Position(10.0f, 50.0f, 0.0f); - view1.Focusable = true; - View view2 = new View(); - view2.BackgroundColor = Color.Cyan; - view2.Size2D = new Size2D(80, 50); - view2.ParentOrigin = ParentOrigin.CenterLeft; - view2.PivotPoint = PivotPoint.CenterLeft; - view2.Position = new Position(100.0f, 50.0f, 0.0f); - view2.Focusable = true; - view1.RightFocusableView = view2; - view2.LeftFocusableView = view1; - Window.Instance.Add(view1); - Window.Instance.Add(view2); - FocusManager.Instance.SetCurrentFocusView(view1); - - PushButton button = new PushButton(); - button.LabelText = "Focus Back"; - button.Size2D = new Size2D(150, 50); - button.ParentOrigin = ParentOrigin.CenterLeft; - button.PivotPoint = PivotPoint.CenterLeft; - button.Position = new Position(190.0f, 50.0f, 0.0f); - - button.Focusable = true; - view2.RightFocusableView = button; - - button.Pressed += (obj, e) => - { - FocusManager.Instance.MoveFocusBackward(); - return true; - }; - Window.Instance.Add(button); - } - - public void WindowDevelPropertyTest() - { - Window window = Window.Instance; - uint count = window.GetSupportedAuxiliaryHintCount(); - if (count > 0) - { - window.BackgroundColor = Color.Blue; - } - uint id = window.AddAuxiliaryHint("wm.policy.win.effect.disable", "1"); - window.RemoveAuxiliaryHint(id); - window.RemoveAuxiliaryHint(2); - - id = window.AddAuxiliaryHint("wm.policy.win.effect.disable", "1"); - window.SetAuxiliaryHintValue(id, "0"); - string value = window.GetAuxiliaryHintValue(id); - if(value.Length > 0) - { - window.BackgroundColor = Color.Red; - } - - window.SetInputRegion(new Rectangle(0, 0, 0, 0)); - WindowType type = window.Type; - Tizen.Log.Debug("NUI", "window type is "+type); - window.Type = WindowType.Notification; - - NotificationLevel level = window.GetNotificationLevel(); - window.SetNotificationLevel(NotificationLevel.High); - level = window.GetNotificationLevel(); - Tizen.Log.Debug("NUI", "window notification level is " + level); - - window.SetOpaqueState(true); - Tizen.Log.Debug("NUI", "window is opaque? " + window.IsOpaqueState()); - - window.SetScreenMode(ScreenMode.AlwaysOn); - ScreenMode screenMode = window.GetScreenMode(); - Tizen.Log.Debug("NUI", "window screen mode is " + screenMode); - - bool ret = window.SetBrightness(50); - int brightness = window.GetBrightness(); - Tizen.Log.Debug("NUI", "window brightness is " + brightness, ", return "+ret); - } - - public void CustomViewPropertyTest() - { - // Create a Spin control - Spin spin = new Spin(); - - // Background property - PropertyMap background = new PropertyMap(); - background.Add( Visual.Property.Type, new PropertyValue((int)Visual.Type.Color) ) - .Add( ColorVisualProperty.MixColor, new PropertyValue(Color.Red) ); - spin.Background = background; - - background = spin.Background; - Color backgroundColor = new Color(); - background.Find(ColorVisualProperty.MixColor, "mixColor")?.Get(backgroundColor); - if( backgroundColor == Color.Red ) - { - Tizen.Log.Debug("NUI", "Custom View Background property : test passed"); - } - else - { - Tizen.Log.Debug("NUI", "Custom View Background property : test failed"); - } - - // BackgroundColor property - spin.BackgroundColor = Color.Yellow; - if(spin.BackgroundColor == Color.Yellow) - { - Tizen.Log.Debug("NUI", "Custom View BackgroundColor property : test passed"); - } - else - { - Tizen.Log.Debug("NUI", "Custom View BackgroundColor property : test failed"); - } - - // BackgroundImage property - spin.BackgroundImage = "background-image.jpg"; - if(spin.BackgroundImage == "background-image.jpg") - { - Tizen.Log.Debug("NUI", "Custom View BackgroundImage property : test passed"); - } - else - { - Tizen.Log.Debug("NUI", "Custom View BackgroundImage property : test failed"); - } - - // StyleName property - spin.StyleName = "MyCustomStyle"; - if(spin.StyleName == "MyCustomStyle") - { - Tizen.Log.Debug("NUI", "Custom View StyleName property : test passed"); - } - else - { - Tizen.Log.Debug("NUI", "Custom View StyleName property : test failed"); - } - } - - public void ViewDownCastTest() - { - View container = new View(); - container.Position = new Position(-800.0f, -800.0f, 0.0f); - Window.Instance.Add(container); - Tizen.Log.Debug("NUI", "winow layer count is "+Window.Instance.LayerCount); - Tizen.Log.Debug("NUI", "winow default layer child at 0 is "+Window.Instance.GetDefaultLayer().GetChildAt(0)); - // Test downcast for native control - TextLabel myLabel = new TextLabel(); - myLabel.Name = "MyLabelName"; - myLabel.Text = "MyText"; - - Tizen.Log.Debug("NUI", "myLabel.Name = " + myLabel.Name + ", Text = " + myLabel.Text); - - container.Add(myLabel); - - View myLabelView = container.FindChildByName("MyLabelName"); - if(myLabelView) - { - TextLabel newLabel = myLabelView as TextLabel; - if(newLabel) - { - Tizen.Log.Debug("NUI", "Downcast to TextLabel successful: newLabel Name = " + newLabel.Name + ", Text = " + newLabel.Text); - } - else - { - Tizen.Log.Debug("NUI", "Downcast to TextLabel failed!"); - } - } - - // Test downcast for class directly inherited from View - MyView myView = new MyView(); - myView.Name = "MyViewName"; - myView.MyOwnName = "MyOwnViewName"; - myView._myCurrentValue = 5; - - Tizen.Log.Debug("NUI", "myView.Name = " + myView.Name + ", MyOwnName = " + myView.MyOwnName + ", myCurrentValue = " + myView._myCurrentValue); - - container.Add(myView); - - View myViewView = container.FindChildByName("MyViewName"); - if(myViewView) - { - MyView newView = myViewView as MyView; - if(newView) - { - Tizen.Log.Debug("NUI", "Downcast to MyView successful: newView Name = " + newView.Name + ", MyOwnName = " + newView.MyOwnName + ", myCurrentValue = " + newView._myCurrentValue); - } - else - { - Tizen.Log.Debug("NUI", "Downcast to MyView failed!"); - } - } - - // Test downcast for class directly inherited from native control - MyButton myButton = new MyButton(); - myButton.Name = "MyButtonName"; - myButton.MyOwnName = "MyOwnViewName"; - myButton.LabelText = "MyLabelText"; - myButton._myCurrentValue = 5; - - Tizen.Log.Debug("NUI", "myButton.Name = " + myButton.Name + ", MyOwnName = " + myButton.MyOwnName + ", LabelText = " + myButton.LabelText + ", myCurrentValue = " + myButton._myCurrentValue); - - container.Add(myButton); - - View myButtonView = container.FindChildByName("MyButtonName"); - if(myButtonView) - { - MyButton newButton = myButtonView as MyButton; - if(newButton) - { - Tizen.Log.Debug("NUI", "Downcast to MyButton successful: newButton Name = " + newButton.Name + ", MyOwnName = " + newButton.MyOwnName + ", LabelText = " + myButton.LabelText + ", myCurrentValue = " + newButton._myCurrentValue); - } - else - { - Tizen.Log.Debug("NUI", "Downcast to MyButton failed!"); - } - } - - // Test downcast for a CustomView - Spin spin = new Spin(); - spin.Name = "SpinName"; - spin.MaxValue = 8888; - - Tizen.Log.Debug("NUI", "spin.Name = " + spin.Name + ", MaxValue = " + spin.MaxValue); - - container.Add(spin); - - View spinView = container.FindChildByName("SpinName"); - if(spinView) - { - Spin newSpin = spinView as Spin; - if(newSpin) - { - Tizen.Log.Debug("NUI", "Downcast to Spin successful: newSpin Name = " + newSpin.Name + ", MaxValue = " + newSpin.MaxValue); - } - else - { - Tizen.Log.Debug("NUI", "Downcast to Spin failed!"); - } - } - - // Test downcast for class inherited from a CustomView - MySpin mySpin = new MySpin(); - mySpin.Name = "MySpinName"; - mySpin.MyOwnName = "MyOwnSpinName"; - mySpin.MaxValue = 8888; - mySpin._myCurrentValue = 5; - - Tizen.Log.Debug("NUI", "mySpin.Name = " + mySpin.Name + ", MyOwnName = " + mySpin.MyOwnName + ", MaxValue = " + mySpin.MaxValue + ", currentValue = " + mySpin._myCurrentValue); - - container.Add(mySpin); - - View mySpinView = container.FindChildByName("MySpinName"); - if(mySpinView) - { - MySpin newSpin = mySpinView as MySpin; - if(newSpin) - { - Tizen.Log.Debug("NUI", "Downcast to MySpin successful: newSpin Name = " + newSpin.Name + ", MyOwnName = " + newSpin.MyOwnName + ", MaxValue = " + newSpin.MaxValue + ", currentValue = " + newSpin._myCurrentValue); - } - else - { - Tizen.Log.Debug("NUI", "Downcast to MySpin failed!"); - } - } - } - - - - public void DowncastTest() - { - //Create a View as a child of parent View, get it use parent.GetChildAt(i), then DownCast to View handle, but call BackgroundColor property will crash. - View parent = new View(); - View[] childs = new View[5]; - - for (int i = 0; i < 5; i++) - { - childs[i] = new View(); - childs[i].Name = "child_view_" + i; - childs[i].BackgroundColor = Color.Red; - parent.Add(childs[i]); - } - - for (uint i = 0; i < parent.ChildCount; i++) - { - View childView = parent.GetChildAt(i); - if (childView) - { - Tizen.Log.Debug("NUI", "Type[" + childView.GetTypeName() + "] BGColor[" + childView.BackgroundColor.R + "]" + " Name[" + childView.Name + "]"); - } - } - - PushButton button = new PushButton(); - button.LabelText = "ButtonTest!"; - button.BackgroundColor = Color.White; - View parentView = new View(); - parentView.Add(button); - PushButton view = parentView.GetChildAt(0) as PushButton; - if (view) - { - Tizen.Log.Debug("NUI", "NUI view GetTypeName= " + view.GetTypeName()); - Tizen.Log.Debug("NUI", "NUI view LabelText= " + view.LabelText); - Tizen.Log.Debug("NUI", "NUI view color= " + view.BackgroundColor.R); - } - } - - - - /// - /// The main entry point for the application. - /// - [STAThread] - static void _Main(string[] args) - { - Tizen.Log.Debug("NUI", "Hello Mono World"); - - Example example = new Example(); - example.Run(args); - } - } -} diff --git a/NUIsamples/NUIsamples/src/examples/date-picker-using-json/ViewRegistryHelper.cs b/NUIsamples/NUIsamples/src/examples/date-picker-using-json/ViewRegistryHelper.cs deleted file mode 100755 index 95a86d8de..000000000 --- a/NUIsamples/NUIsamples/src/examples/date-picker-using-json/ViewRegistryHelper.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System; -using Tizen.NUI; - - -namespace DatePickerUsingJson -{ - public class ViewRegistryHelper - { - static public void Initialize() - { - // Register all views with the type registry - System.Runtime.CompilerServices.RuntimeHelpers.RunClassConstructor (typeof(Spin).TypeHandle); - } - } -} - diff --git a/NUIsamples/NUIsamples/src/examples/date-picker-using-json/date-picker-using-json.cs b/NUIsamples/NUIsamples/src/examples/date-picker-using-json/date-picker-using-json.cs deleted file mode 100755 index 56e7ab956..000000000 --- a/NUIsamples/NUIsamples/src/examples/date-picker-using-json/date-picker-using-json.cs +++ /dev/null @@ -1,172 +0,0 @@ -/* - * Copyright (c) 2017 Samsung Electronics Co., Ltd. - * - * 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; -using Tizen.NUI; -using Tizen.NUI.BaseComponents; - -namespace DatePickerUsingJson -{ - // A spin control (for continously changing values when users can easily predict a set of values) - - class Example : NUIApplication - { - private Spin _spinYear; // spin control for year - private Spin _spinMonth; // spin control for month - private Spin _spinDay; // spin control for day - //private Builder _builder; // DALi Builder - - //private const string _resPath = "/home/owner/apps_rw/NUISamples.TizenTV/res"; - private const string _resPath = "./res"; //for ubuntu - - public Example() : base() - { - } - - protected override void OnCreate() - { - base.OnCreate(); - Initialize(); - } - - public void Initialize() - { - Window window = Window.Instance; - window.BackgroundColor = Color.White; - - //This is required for the Application which uses JSON theme and style of Dali builder - ViewRegistryHelper.Initialize(); - /* - // load date JSON template... - _builder = new Builder (); - - // Optional constant to see logging information coming out - // of DALi JSON parser (builder) - PropertyMap constants = new PropertyMap(); - constants.Insert( "CONFIG_SCRIPT_LOG_LEVEL", new PropertyValue( "Verbose") ); - _builder.AddConstants( constants ); - - _builder.LoadFromFile(_resPath + "/json/date-picker-template.json" ); - - // create the date-picker from the template in the json file - View actorTree = _builder.Create( "date-picker"); - - window.Add( actorTree ); - - View year = actorTree.FindChildByName("Year"); - View month = actorTree.FindChildByName("Month" ); - View day = actorTree.FindChildByName("Day"); - - // need to get the actual C# Spin object associated with the actor, - _spinYear = year as Spin; - _spinMonth = month as Spin; - _spinDay = day as Spin; - - _spinYear.Value = 2099; - _spinMonth.Value = 5; - _spinDay.Value = 23; - - _spinYear.Focusable = (true); - _spinMonth.Focusable = (true); - _spinDay.Focusable = (true); - - FocusManager keyboardFocusManager = FocusManager.Instance; - keyboardFocusManager.PreFocusChange += OnKeyboardPreFocusChange; - //keyboardFocusManager.FocusedViewActivated += OnFocusedViewActivated; - - StyleManager.Get().ApplyTheme(_resPath + "/json/date-picker-theme.json"); - */ - } - - private View OnKeyboardPreFocusChange(object source, FocusManager.PreFocusChangeEventArgs e) - { - View nextFocusView = e.ProposedView; - - // When nothing has been focused initially, focus the text field in the first spin - if (!e.CurrentView && !e.ProposedView) - { - nextFocusView = _spinYear.SpinText; - } - else if(e.Direction == View.FocusDirection.Left) - { - // Move the focus to the spin in the left of the current focused spin - if(e.CurrentView == _spinMonth.SpinText) - { - nextFocusView = _spinYear.SpinText; - } - else if(e.CurrentView == _spinDay.SpinText) - { - nextFocusView = _spinMonth.SpinText; - } - } - else if(e.Direction == View.FocusDirection.Right) - { - // Move the focus to the spin in the right of the current focused spin - if(e.CurrentView == _spinYear.SpinText) - { - nextFocusView = _spinMonth.SpinText; - } - else if(e.CurrentView == _spinMonth.SpinText) - { - nextFocusView = _spinDay.SpinText; - } - } - - return nextFocusView; - } - /* - private void OnFocusedViewActivated(object source, FocusManager.FocusedViewActivatedEventArgs e) - { - // Make the text field in the current focused spin to take the key input - KeyInputFocusManager manager = KeyInputFocusManager.Get(); - - if (e.View == _spinYear.SpinText) - { - if (manager.GetCurrentFocusControl() != _spinYear.SpinText) - { - manager.SetFocus(_spinYear.SpinText); - } - } - else if (e.View == _spinMonth.SpinText) - { - if (manager.GetCurrentFocusControl() != _spinMonth.SpinText) - { - manager.SetFocus(_spinMonth.SpinText); - } - } - else if (e.View == _spinDay.SpinText) - { - if (manager.GetCurrentFocusControl() != _spinDay.SpinText) - { - manager.SetFocus(_spinDay.SpinText); - } - } - } - */ - - /// - /// The main entry point for the application. - /// - [STAThread] - static void _Main(string[] args) - { - Example example = new Example(); - example.Run(args); - } - } -} diff --git a/NUIsamples/NUIsamples/src/examples/date-picker.cs b/NUIsamples/NUIsamples/src/examples/date-picker.cs deleted file mode 100755 index 1163ee4b4..000000000 --- a/NUIsamples/NUIsamples/src/examples/date-picker.cs +++ /dev/null @@ -1,165 +0,0 @@ -/* - * Copyright (c) 2017 Samsung Electronics Co., Ltd. - * - * 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; -using Tizen.NUI; -using Tizen.NUI.BaseComponents; -using Tizen.NUI.UIComponents; - - -namespace DatePickerTest -{ - // A spin control (for continously changing values when users can easily predict a set of values) - - class Example : NUIApplication - { - private FlexContainer _container; // Flex container to hold spin controls - private Spin _spinYear; // spin control for year - private Spin _spinMonth; // spin control for month - private Spin _spinDay; // spin control for day - - public Example() : base() - { - - } - - protected override void OnCreate() - { - base.OnCreate(); - Initialize(); - } - - public void Initialize() - { - Window window = Window.Instance; - window.BackgroundColor = Color.White; - - // Create a container for the spins - _container = new FlexContainer(); - - _container.FlexDirection = FlexContainer.FlexDirectionType.Row; - _container.Size2D = new Size2D(480, 150); - - window.Add(_container); - - // Create a Spin control for year - _spinYear = new Spin(); - _spinYear.Flex = 0.3f; - _spinYear.FlexMargin = new Vector4(5.0f, 0.0f, 5.0f, 0.0f); - _container.Add(_spinYear); - - _spinYear.MinValue = 1900; - _spinYear.MaxValue = 2100; - _spinYear.Value = 2016; - _spinYear.Step = 1; - _spinYear.MaxTextLength = 4; - _spinYear.TextPointSize = 15; - _spinYear.TextColor = Color.Red; - _spinYear.Focusable = (true); - _spinYear.Name = "_spinYear"; - - // Create a Spin control for month - _spinMonth = new Spin(); - _spinMonth.Flex = 0.3f; - _spinMonth.FlexMargin = new Vector4(5.0f, 0.0f, 5.0f, 0.0f); - _container.Add(_spinMonth); - - _spinMonth.MinValue = 1; - _spinMonth.MaxValue = 12; - _spinMonth.Value = 10; - _spinMonth.Step = 1; - _spinMonth.MaxTextLength = 2; - _spinMonth.TextPointSize = 15; - _spinMonth.TextColor = Color.Green; - _spinMonth.Focusable = (true); - _spinMonth.Name = "_spinMonth"; - - // Create a Spin control for day - _spinDay = new Spin(); - _spinDay.Flex = 0.3f; - _spinDay.FlexMargin = new Vector4(5.0f, 0.0f, 5.0f, 0.0f); - _container.Add(_spinDay); - - _spinDay.MinValue = 1; - _spinDay.MaxValue = 31; - _spinDay.Value = 26; - _spinDay.Step = 1; - _spinDay.MaxTextLength = 2; - _spinDay.TextPointSize = 15; - _spinDay.TextColor = Color.Blue; - _spinDay.Focusable = (true); - _spinDay.Name = "_spinDay"; - - FocusManager keyboardFocusManager = FocusManager.Instance; - keyboardFocusManager.PreFocusChange += OnKeyboardPreFocusChange; - keyboardFocusManager.FocusedViewActivated += OnFocusedViewActivated; - } - - private View OnKeyboardPreFocusChange(object source, FocusManager.PreFocusChangeEventArgs e) - { - View nextFocusView = e.ProposedView; - - // When nothing has been focused initially, focus the text field in the first spin - if (!e.CurrentView && !e.ProposedView) - { - nextFocusView = _spinYear.SpinText; - } - else if(e.Direction == View.FocusDirection.Left) - { - // Move the focus to the spin in the left of the current focused spin - if(e.CurrentView == _spinMonth.SpinText) - { - nextFocusView = _spinYear.SpinText; - } - else if(e.CurrentView == _spinDay.SpinText) - { - nextFocusView = _spinMonth.SpinText; - } - } - else if(e.Direction == View.FocusDirection.Right) - { - // Move the focus to the spin in the right of the current focused spin - if(e.CurrentView == _spinYear.SpinText) - { - nextFocusView = _spinMonth.SpinText; - } - else if(e.CurrentView == _spinMonth.SpinText) - { - nextFocusView = _spinDay.SpinText; - } - } - - return nextFocusView; - } - - private void OnFocusedViewActivated(object source, FocusManager.FocusedViewActivatedEventArgs e) - { - - } - - /// - /// The main entry point for the application. - /// - [STAThread] - static void _Main(string[] args) - { - Example example = new Example(); - example.Run(args); - } - } -} diff --git a/NUIsamples/NUIsamples/src/examples/feedkey-test.cs b/NUIsamples/NUIsamples/src/examples/feedkey-test.cs deleted file mode 100755 index 01383760a..000000000 --- a/NUIsamples/NUIsamples/src/examples/feedkey-test.cs +++ /dev/null @@ -1,114 +0,0 @@ -/* -* Copyright (c) 2017 Samsung Electronics Co., Ltd. -* -* 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; -using Tizen.NUI; -using Tizen.NUI.BaseComponents; -using Tizen.NUI.Constants; - -namespace FeedKeyTest -{ - class Example : NUIApplication - { - public Example() : base() - { - } - - public Example(string stylesheet) : base(stylesheet) - { - } - - public Example(string stylesheet, WindowMode windowMode) : base(stylesheet, windowMode) - { - } - - protected override void OnCreate() - { - base.OnCreate(); - Initialize(); - } - - public void Initialize() - { - Window window = Window.Instance; - window.BackgroundColor = Color.White; - - View view1 = new View() - { - Position2D = new Position2D(10, 10), - BackgroundColor = Color.Magenta, - Size2D = new Size2D(200, 200), - Focusable = true - }; - - View view2 = new View() - { - Position2D = new Position2D(10, 240), - BackgroundColor = Color.Red, - Size2D = new Size2D(200, 200), - Focusable = true - }; - - window.Add(view1); - window.Add(view2); - - FocusManager.Instance.SetCurrentFocusView(view1); - view2.UpFocusableView = view1; - view1.DownFocusableView = view2; - - view1.KeyEvent += (obj, e) => - { - if (e.Key.State != Key.StateType.Down) - { - return false; - } - Tizen.Log.Debug("NUI", "View1 KeyPressedName: " + e.Key.KeyPressedName); - Window.FeedKeyEvent(e.Key); - return false; - }; - - view2.KeyEvent += (obj, e) => - { - if (e.Key.State != Key.StateType.Down) - { - // Tizen.Log.Debug("NUI", "View2 key state != Down"); - return false; - } - - // Tizen.Log.Debug("NUI", "View2 KeyPressedName: " + e.Key.KeyPressedName); - View v = obj as View; - if(v == view1) - { - Tizen.Log.Debug("NUI", "View2 received view1 feed event: " + e.Key.KeyPressedName); - } - if (v == view2) - { - Tizen.Log.Debug("NUI", "View2 received event: " + e.Key.KeyPressedName); - } - return false; - }; - } - - [STAThread] - static void _Main(string[] args) - { - Example example = new Example(); - example.Run(args); - } - } -} diff --git a/NUIsamples/NUIsamples/src/examples/flex-container.cs b/NUIsamples/NUIsamples/src/examples/flex-container.cs deleted file mode 100755 index f753255c1..000000000 --- a/NUIsamples/NUIsamples/src/examples/flex-container.cs +++ /dev/null @@ -1,196 +0,0 @@ - -using System; -using Tizen.NUI; -using Tizen.NUI.UIComponents; -using Tizen.NUI.BaseComponents; - -namespace FlexContainerTest -{ - public class SampleMain : NUIApplication - { - public readonly static string[] samples = new string[] - { - "AnimationSample", - "BasicElement", - "TextSample", - "ImageViewSample", - "EventSample", - "FlexContainer", - "FrameAnimationSample" - }; - - TextLabel[] label; - FlexContainer container; - View focusIndicator; - int numOfSamples; - PushButton pushButton1, pushButton2; - private int _cnt; - private Animation _ani; - - protected override void OnCreate() - { - base.OnCreate(); - - Window.Instance.BackgroundColor = new Color(0.1f, 0.8f, 0.1f, 1.0f); - - container = new FlexContainer(); - container.Size2D = new Size2D(Window.Instance.Size.Width, Window.Instance.Size.Height); - container.PivotPoint = PivotPoint.TopLeft; - container.Padding = new Vector4(100, 100, 100, 100); - - container.FlexWrap = FlexContainer.WrapType.Wrap; - container.FlexDirection = FlexContainer.FlexDirectionType.Column; - - Window.Instance.Add(container); - - numOfSamples = samples.GetLength(0); - Tizen.Log.Debug("NUI", "NUM = " + numOfSamples); - label = new TextLabel[numOfSamples]; - for (int i = 0; i < numOfSamples; i++) - { - label[i] = new TextLabel(); - label[i].Focusable = true; - label[i].BackgroundColor = Color.Red; - //label[i].Size = new Size(100, 50, 0); - label[i].Text = samples[i]; - label[i].FlexMargin = new Vector4(20, 20, 20, 20); - label[i].PointSize = 10; - label[i].Name = "label" + i.ToString(); - container.Add(label[i]); - } - - //label[3].SetKeyInputFocus(); //removed - FocusManager.Instance.SetCurrentFocusView(label[3]); - - FocusManager.Instance.PreFocusChange += Instance_PreFocusChange; - //added - FocusManager.Instance.FocusChanged += (sender, e) => - { - if(e.CurrentView) Tizen.Log.Debug("NUI", "FocusManager FocusChanged signal callback! e.CurrentView.Name=" + e.CurrentView.Name); - else Tizen.Log.Debug("NUI", "FocusManager FocusChanged signal callback! e.CurrentView is null!"); - if (e.NextView) Tizen.Log.Debug("NUI", "FocusManager FocusChanged signal callback! e.NextView.Name=" + e.NextView.Name); - else Tizen.Log.Debug("NUI", "FocusManager FocusChanged signal callback! e.NextView is null!"); - }; - //added - FocusManager.Instance.FocusedViewActivated += (sender, e) => - { - if (e.View) Tizen.Log.Debug("NUI", "FocusManager FocusedViewEnterKeyPressed signal callback! e.View.Name=" + e.View.Name); - else Tizen.Log.Debug("NUI", "FocusManager FocusChanged signal callback! e.View is null!"); - }; - - //added - Window.Instance.TouchEvent += (sender, e) => - { - Tizen.Log.Debug("NUI", "Window Touch signal callback! To avoid crash, when losing key focus, set here again unless the NextView is null"); - FocusManager.Instance.SetCurrentFocusView(label[3]); - }; - - //added - pushButton1 = new PushButton(); - pushButton1.MinimumSize = new Size2D(400, 200); - pushButton1.LabelText = "+PreFocusChange"; - pushButton1.ParentOrigin = ParentOrigin.TopLeft; - pushButton1.PivotPoint = PivotPoint.TopLeft; - pushButton1.Position2D = new Position2D(200, 800); - pushButton1.Clicked += (sender, e) => - { - Tizen.Log.Debug("NUI", "pushbutton1 clicked! add handler!"); - _cnt++; - FocusManager.Instance.PreFocusChange += Instance_PreFocusChange; - _ani.Finished += _ani_Finished; - pushButton1.LabelText = "Add Handler" + _cnt; - pushButton2.LabelText = "Remove Handler" + _cnt; - return true; - }; - Window.Instance.Add(pushButton1); - - pushButton2 = new PushButton(); - pushButton2.MinimumSize = new Size2D(400, 200); - pushButton2.LabelText = "-PreFocusChange"; - pushButton2.ParentOrigin = ParentOrigin.TopLeft; - pushButton2.PivotPoint = PivotPoint.TopLeft; - pushButton2.Position2D = new Position2D(800, 800); - pushButton2.Clicked += (sender, e) => - { - Tizen.Log.Debug("NUI", "pushbutton2 clicked! remove handler!"); - _cnt--; - FocusManager.Instance.PreFocusChange -= Instance_PreFocusChange; - _ani.Finished -= _ani_Finished; - pushButton1.LabelText = "Add Handler" + _cnt; - pushButton2.LabelText = "Remove Handler" + _cnt; - return true; - }; - Window.Instance.Add(pushButton2); - - //added - _ani = new Animation(2000); - _ani.AnimateTo(pushButton1, "Opacity", 0.0f); - _ani.AnimateTo(pushButton2, "Opacity", 0.0f); - _ani.EndAction = Animation.EndActions.Discard; - _ani.Finished += _ani_Finished; - - } - - private void _ani_Finished(object sender, EventArgs e) - { - Tizen.Log.Debug("NUI", "_ani finished! _cnt=" + _cnt); - } - - private View Instance_PreFocusChange(object source, FocusManager.PreFocusChangeEventArgs e) - { - View nextView; - Tizen.Log.Debug("NUI", "Instance_PreFocusChange = " + e.Direction.ToString()); - - //added - if (e.CurrentView == null) e.CurrentView = label[0]; - if (e.ProposedView == null) e.ProposedView = label[0]; - - int index = Array.FindIndex(label, x => x == e.CurrentView); - - Tizen.Log.Debug("NUI", "index = " + index); - - switch (e.Direction) - { - case View.FocusDirection.Up: - index = (index + numOfSamples - 2) % numOfSamples; //changed - _ani.Play(); - break; - case View.FocusDirection.Down: - index = (index + 2) % numOfSamples; //changed - Tizen.Log.Debug("NUI", "pushbutton1 Visible=" + pushButton1.Visible + " pushbutton2 Visible=" + pushButton2.Visible); //added - break; - case View.FocusDirection.Left: - //added - pushButton1.Show(); - pushButton2.Show(); - break; - case View.FocusDirection.Right: - //added - pushButton1.Hide(); - pushButton2.Hide(); - break; - default: - break; - } - - Tizen.Log.Debug("NUI", "next index = " + index); - nextView = label[index]; - - if (e.CurrentView.HasFocus()) - { - //currentView?.ClearKeyInputFocus(); //removed - } - //nextView?.SetKeyInputFocus(); //removed - - return nextView; - } - - static void _Main(string[] args) - { - - SampleMain sample = new SampleMain(); - sample.Run(args); - } - } -} - diff --git a/NUIsamples/NUIsamples/src/examples/gc-test.cs b/NUIsamples/NUIsamples/src/examples/gc-test.cs deleted file mode 100755 index 04c9b29a9..000000000 --- a/NUIsamples/NUIsamples/src/examples/gc-test.cs +++ /dev/null @@ -1,261 +0,0 @@ - -using System.Collections.Generic; -using System; -using Tizen.NUI.BaseComponents; -using Tizen.NUI.UIComponents; - -namespace TizenVDUIApplication19 -{ - using Tizen.NUI; - - internal class Program : NUIApplication - { - private Timer myTimer; - private List myViewList; - private const int numberOfObjects = 500; - private Random myRandom; - private const string resources = "/home/owner/apps_rw/NUISamples.TizenTV/res"; - - protected override void OnCreate() - { - base.OnCreate(); - - Window.Instance.BackgroundColor = Color.White; - - myViewList = new List(); - - myRandom = new Random(); - - for (int i = 0; i < numberOfObjects; i++) - { - View v = new View(); - - float intensity = myRandom.Next(0, 255) / 255.0f; - v.BackgroundColor = new Color(intensity, intensity, intensity, 1); - v.Position = new Position(myRandom.Next(0, 1820), myRandom.Next(0, 980), 0); - v.PivotPoint = PivotPoint.TopLeft; - v.Size2D = new Size2D(100, 100); - - myViewList.Add(v); - - Window.Instance.GetDefaultLayer().Add(v); - } - - myTimer = new Timer(1000); - - myTimer.Tick += MyTimer_Tick; - - myTimer.Start(); - } - - private bool MyTimer_Tick(object source, System.EventArgs e) - { - //Remove current Scene, - foreach (View v in myViewList) - { - Window.Instance.GetDefaultLayer().Remove(v); - } - - myViewList.Clear(); - - ////Add View - - GC.Collect(); - GC.WaitForPendingFinalizers(); - - for (int i = 0; i < 50; i++) - { - TextLabel v = new TextLabel(); - - float intensity = myRandom.Next(0, 255) / 255.0f; - v.BackgroundColor = new Color(intensity, intensity, intensity, 1); - v.Position = new Position(myRandom.Next(0, 1820), myRandom.Next(0, 980), 0); - v.PivotPoint = PivotPoint.TopLeft; - v.Size2D = new Size2D(100, 100); - v.Text = "label " + i; - - myViewList.Add(v); - - Window.Instance.GetDefaultLayer().Add(v); - } - - for (int i = 50; i < 100; i++) - { - PushButton v = new PushButton(); - - float intensity = myRandom.Next(0, 255) / 255.0f; - v.BackgroundColor = new Color(intensity, intensity, intensity, 1); - v.Position = new Position(myRandom.Next(0, 1820), myRandom.Next(0, 980), 0); - v.PivotPoint = PivotPoint.TopLeft; - v.Size2D = new Size2D(100, 100); - v.LabelText = "button " + i; - - myViewList.Add(v); - - Window.Instance.GetDefaultLayer().Add(v); - } - - for (int i = 100; i < 150; i++) - { - ImageView v = new ImageView(); - - float intensity = myRandom.Next(0, 255) / 255.0f; - v.BackgroundColor = new Color(intensity, intensity, intensity, 1); - v.Position = new Position(myRandom.Next(0, 1820), myRandom.Next(0, 980), 0); - v.PivotPoint = PivotPoint.TopLeft; - v.Size2D = new Size2D(100, 100); - v.ResourceUrl = resources + "/images/gallery-3.jpg"; - - myViewList.Add(v); - - Window.Instance.GetDefaultLayer().Add(v); - } - - for (int i = 150; i < 200; i++) - { - TextEditor v = new TextEditor(); - - float intensity = myRandom.Next(0, 255) / 255.0f; - v.BackgroundColor = new Color(intensity, intensity, intensity, 1); - v.Position = new Position(myRandom.Next(0, 1820), myRandom.Next(0, 980), 0); - v.PivotPoint = PivotPoint.TopLeft; - v.Size2D = new Size2D(100, 100); - v.Text = "editor" + i; - - myViewList.Add(v); - - Window.Instance.GetDefaultLayer().Add(v); - } - - for (int i = 200; i < 250; i++) - { - TextField v = new TextField(); - - float intensity = myRandom.Next(0, 255) / 255.0f; - v.BackgroundColor = new Color(intensity, intensity, intensity, 1); - v.Position = new Position(myRandom.Next(0, 1820), myRandom.Next(0, 980), 0); - v.PivotPoint = PivotPoint.TopLeft; - v.Size2D = new Size2D(100, 100); - v.Text = "field " + i; - - myViewList.Add(v); - - Window.Instance.GetDefaultLayer().Add(v); - } - - for (int i = 250; i < 300; i++) - { - CheckBoxButton v = new CheckBoxButton(); - - float intensity = myRandom.Next(0, 255) / 255.0f; - v.BackgroundColor = new Color(intensity, intensity, intensity, 1); - v.Position = new Position(myRandom.Next(0, 1820), myRandom.Next(0, 980), 0); - v.PivotPoint = PivotPoint.TopLeft; - v.Size2D = new Size2D(100, 100); - v.LabelText = "check " + i; - - myViewList.Add(v); - - Window.Instance.GetDefaultLayer().Add(v); - } - - for (int i = 300; i < 350; i++) - { - ScrollBar v = new ScrollBar(); - - float intensity = myRandom.Next(0, 255) / 255.0f; - v.BackgroundColor = new Color(intensity, intensity, intensity, 1); - v.Position = new Position(myRandom.Next(0, 1820), myRandom.Next(0, 980), 0); - v.PivotPoint = PivotPoint.TopLeft; - v.Size2D = new Size2D(100, 100); - - myViewList.Add(v); - - Window.Instance.GetDefaultLayer().Add(v); - } - - for (int i = 350; i < 400; i++) - { - Slider v = new Slider(); - - float intensity = myRandom.Next(0, 255) / 255.0f; - v.BackgroundColor = new Color(intensity, intensity, intensity, 1); - v.Position = new Position(myRandom.Next(0, 1820), myRandom.Next(0, 980), 0); - v.PivotPoint = PivotPoint.TopLeft; - v.Size2D = new Size2D(100, 100); - - myViewList.Add(v); - - Window.Instance.GetDefaultLayer().Add(v); - } - - for (int i = 400; i < 450; i++) - { - TableView v = new TableView(1, 1); - - float intensity = myRandom.Next(0, 255) / 255.0f; - v.BackgroundColor = new Color(intensity, intensity, intensity, 1); - v.Position = new Position(myRandom.Next(0, 1820), myRandom.Next(0, 980), 0); - v.PivotPoint = PivotPoint.TopLeft; - v.Size2D = new Size2D(100, 100); - - myViewList.Add(v); - - Window.Instance.GetDefaultLayer().Add(v); - } - - for (int i = 450; i < numberOfObjects; i++) - { - View v = new View(); - - float intensity = myRandom.Next(0, 255) / 255.0f; - v.BackgroundColor = new Color(intensity, intensity, intensity, 1); - v.Position = new Position(myRandom.Next(0, 1820), myRandom.Next(0, 980), 0); - v.PivotPoint = PivotPoint.TopLeft; - v.Size2D = new Size2D(100, 100); - - myViewList.Add(v); - - Window.Instance.GetDefaultLayer().Add(v); - } - - return true; - } - - protected override void OnPause() - { - //This function is called when the window's visibility is changed from visible to invisible. - base.OnPause(); - } - - protected override void OnResume() - { - //This function is called when the window's visibility is changed from invisible to visible. - base.OnResume(); - } - - protected override void OnTerminate() - { - //This function is called when the app exit normally. - base.OnTerminate(); - } - /* - protected override void OnLowMemory(LowMemoryEventArgs e) - { - //This function is called when the system is low on memory. - base.OnLowMemory(e); - } - protected override void OnLocaleChanged(LocaleChangedEventArgs e) - { - //This function is called when the language is changed. - base.OnLocaleChanged(e); - } - */ - private static void _Main(string[] args) - { - //Create an Application - Program myProgram = new Program(); - myProgram.Run(args); - } - } -} \ No newline at end of file diff --git a/NUIsamples/NUIsamples/src/examples/hello-test.cs b/NUIsamples/NUIsamples/src/examples/hello-test.cs deleted file mode 100755 index e67995f2f..000000000 --- a/NUIsamples/NUIsamples/src/examples/hello-test.cs +++ /dev/null @@ -1,124 +0,0 @@ -/* - * Copyright (c) 2017 Samsung Electronics Co., Ltd. - * - * 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; -using Tizen.NUI; -using Tizen.NUI.UIComponents; -using Tizen.NUI.BaseComponents; -using Tizen.NUI.Constants; -//using Tizen.Applications; - -//------------------------------------------------------------------------------ -// -// -// This file can only run on Tizen target. You should compile it with DaliApplication.cs, and -// add tizen c# application related library as reference. -//------------------------------------------------------------------------------ -namespace HelloTest -{ - class Example : NUIApplication - { - private Animation _animation; - private TextLabel _text; - private Window _window; - - public Example():base() - { - } - - public Example(string stylesheet):base(stylesheet) - { - } - - public Example(string stylesheet, WindowMode windowMode):base(stylesheet, windowMode) - { - } - - protected override void OnCreate() - { - base.OnCreate(); - Initialize(); - } - - private void Initialize() - { - // Connect the signal callback for window touched signal - _window = Window.Instance; - _window.TouchEvent += OnWindowTouched; - - // Add a _text label to the window - _text = new TextLabel("Hello Mono World"); - _text.ParentOrigin = ParentOrigin.Center; - _text.PivotPoint = PivotPoint.Center; - _text.HorizontalAlignment = HorizontalAlignment.Center; - _text.PointSize = 32.0f; - - _window.Add(_text); - } - - // Callback for _animation finished signal handling - private void AnimationFinished(object sender, EventArgs e) - { - if (_animation) - { - Tizen.Log.Debug("NUI", "Duration= " + _animation.Duration); - Tizen.Log.Debug("NUI", "EndAction= " + _animation.EndAction); - } - } - - // Callback for window touched signal handling - private void OnWindowTouched(object sender, Window.TouchEventArgs e) - { - // Only animate the _text label when touch down happens - if (e.Touch.GetState(0) == PointStateType.Down) - { - // Create a new _animation - if (_animation) - { - _animation.Reset(); - } - - _animation = new Animation(1000); // 1 second of duration - - _animation.AnimateTo(_text, "Orientation", new Rotation(new Radian(new Degree(180.0f)), Vector3.XAxis), 0, 500); - _animation.AnimateTo(_text, "Orientation", new Rotation(new Radian(new Degree(0.0f)), Vector3.XAxis), 500, 1000); - _animation.EndAction = Animation.EndActions.Discard; - - // Connect the signal callback for animaiton finished signal - _animation.Finished += AnimationFinished; - - // Play the _animation - _animation.Play(); - } - } - - /// - /// The main entry point for the application. - /// - - [STAThread] - static void _Main(string[] args) - { - Tizen.Log.Debug("NUI", "Hello mono world."); - //Example example = new Example(); - //Example example = new Example("stylesheet"); - Example example = new Example("stylesheet", WindowMode.Transparent); - example.Run(args); - } - } -} diff --git a/NUIsamples/NUIsamples/src/examples/hello-world.cs b/NUIsamples/NUIsamples/src/examples/hello-world.cs deleted file mode 100755 index 78895a974..000000000 --- a/NUIsamples/NUIsamples/src/examples/hello-world.cs +++ /dev/null @@ -1,278 +0,0 @@ -/* -* Copyright (c) 2017 Samsung Electronics Co., Ltd. -* -* 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.Threading.Tasks; -using Tizen.NUI; -using Tizen.NUI.BaseComponents; - -namespace HelloWorldTest -{ - class Example : NUIApplication - { - private Animation _animation; - private TextLabel _text; - private int cnt; - private View _view; - - protected override void OnCreate() - { - base.OnCreate(); - Initialize(); - } - - TextLabel pixelLabel; - TextLabel pointLabel; - public void Initialize() - { - Window window = Window.Instance; - window.BackgroundColor = Color.White; - window.TouchEvent += OnWindowTouched; - window.KeyEvent += OnWindowKeyEvent; - window.Resized += (obj, e) => - { - Tizen.Log.Debug("NUI", "Height: " + e.WindowSize.Height); - Tizen.Log.Debug("NUI", "Width: " + e.WindowSize.Width); - }; - - pixelLabel = new TextLabel("Test Pixel Size 32.0f"); - pixelLabel.Position2D = new Position2D(10, 10); - pixelLabel.PixelSize = 32.0f; - window.Add(pixelLabel); - - pointLabel = new TextLabel("Test Point Size 32.0f"); - pointLabel.Position2D = new Position2D(10, 100); - pointLabel.PointSize = 32.0f; - window.Add(pointLabel); - - Task.Factory.StartNew(() => - { - try - { - TextLabel ellipsis = new TextLabel("Ellipsis of TextLabel is enabled."); - ellipsis.Size2D = new Size2D(100, 100); - ellipsis.Position2D = new Position2D(10, 250); - ellipsis.PointSize = 20.0f; - ellipsis.Ellipsis = true; - window.Add(ellipsis); - } - catch (Exception e) - { - Tizen.Log.Debug("NUI", $"exception caught! e={e}"); - } - }).Wait(); - - TextLabel autoScrollStopMode = new TextLabel("AutoScrollStopMode is finish-loop."); - autoScrollStopMode.Size2D = new Size2D(400, 100); - autoScrollStopMode.Position2D = new Position2D(10, 400); - autoScrollStopMode.PointSize = 15.0f; - autoScrollStopMode.AutoScrollStopMode = AutoScrollStopMode.FinishLoop; - autoScrollStopMode.AutoScrollLoopDelay = 10.0f; - autoScrollStopMode.EnableAutoScroll = true; - window.Add(autoScrollStopMode); - - _text = new TextLabel("Hello NUI World"); - _text.Position2D = new Position2D(10, 500); - _text.HorizontalAlignment = HorizontalAlignment.Center; - _text.PointSize = 20.0f; - _text.TextColor = Color.Magenta; - window.Add(_text); - - _view = new View(); - _view.Size2D = new Size2D(100, 100); - _view.SizeWidth = 50; - Tizen.Log.Debug("NUI", "[1]_view SizeWidth=" + _view.SizeWidth); - - _animation = new Animation - { - Duration = 2000 - }; - _animation.AnimateTo(_text, "Orientation", new Rotation(new Radian(new Degree(180.0f)), PositionAxis.X), 0, 500); - _animation.AnimateTo(_text, "Orientation", new Rotation(new Radian(new Degree(0.0f)), PositionAxis.X), 500, 1000); - _animation.AnimateBy(_text, "ScaleX", 3, 1000, 1500); - _animation.AnimateBy(_text, "ScaleY", 4.0f, 1500, 2000); - _animation.EndAction = Animation.EndActions.Discard; - _animation.Finished += AnimationFinished; - - _view.SizeWidth = 50; - Tizen.Log.Debug("NUI", "[2]_view SizeWidth=" + _view.SizeWidth); - - TextLabelLineWrapModeTest(); - ViewLayoutDirectionTest(); - } - - - private View view1, view11, view12, view111, view121; - public void ViewLayoutDirectionTest() - { - view1 = new View(); - view1.Name = "view 1"; - view1.LayoutDirection = ViewLayoutDirectionType.RTL; - Window.Instance.GetDefaultLayer().Add(view1); - view1.LayoutDirectionChanged += View1_LayoutDirectionChanged; - - view11 = new View(); - view11.Name = "view 11"; - view11.InheritLayoutDirection = true; - view1.Add(view11); - - view12 = new View(); - view12.Name = "view 12"; - view12.LayoutDirection = ViewLayoutDirectionType.LTR; - view1.Add(view12); - - view111 = new View(); - view111.Name = "view 111"; - view111.InheritLayoutDirection = true; - view11.Add(view111); - - view121 = new View(); - view121.Name = "view 121"; - view121.InheritLayoutDirection = true; - view12.Add(view121); - } - - private void View1_LayoutDirectionChanged(object sender, View.LayoutDirectionChangedEventArgs e) - { - NUILog.Error("View1_LayoutDirectionChanged()! e.Type=" + e.Type); - } - - public void AnimationFinished(object sender, EventArgs e) - { - Tizen.Log.Debug("NUI", "AnimationFinished()! cnt=" + (cnt)); - if (_animation) - { - Tizen.Log.Debug("NUI", "Duration= " + _animation.Duration + "EndAction= " + _animation.EndAction); - } - _view.SizeWidth = 50; - Tizen.Log.Debug("NUI", "[3]_view SizeWidth=" + _view.SizeWidth); - } - - int win_test; - public void OnWindowKeyEvent(object sender, Window.KeyEventArgs e) - { - Tizen.Log.Debug("NUI", "e.Key.KeyPressedName=" + e.Key.KeyPressedName); - - if (e.Key.State == Key.StateType.Down) - { - if (e.Key.KeyPressedName == "Up") - { - if (_animation) - { - _animation.Finished += AnimationFinished; - cnt++; - Tizen.Log.Debug("NUI", "AnimationFinished added!"); - } - pointLabel.TextColorAnimatable = Color.Blue; - pixelLabel.TextColorAnimatable = Color.Blue; - - Tizen.Log.Debug("NUI", $"LineWrapMode 1st={ myTextLabel?.LineWrapMode} 2nd={ myTextLabel2?.LineWrapMode}"); - } - else if (e.Key.KeyPressedName == "Down") - { - if (_animation) - { - _animation.Finished -= AnimationFinished; - cnt--; - Tizen.Log.Debug("NUI", "AnimationFinished removed!"); - } - pointLabel.TextColorAnimatable = Color.Red; - pixelLabel.TextColorAnimatable = Color.Red; - - Window.Instance.SetClass($"Window.SetClass() Test #{win_test++}", ""); - Tizen.Log.Debug("NUI", $"Check with enlightenment_info -topwins ! Window.SetClass() Test #{win_test}"); - } - else if (e.Key.KeyPressedName == "Return") - { - _animation.Play(); - Tizen.Log.Debug("NUI", "_animation play here!"); - } - } - } - - public void OnWindowTouched(object sender, Window.TouchEventArgs e) - { - if (e.Touch.GetState(0) == PointStateType.Down) - { - _animation.Play(); - } - } - - private TextLabel myTextLabel; - private TextLabel myTextLabel2; - private TextEditor myTextEditor; - private TextEditor myTextEditor2; - public void TextLabelLineWrapModeTest() - { - Tizen.Log.Debug("NUI", "WrapModeTest START!"); - myTextLabel = new TextLabel(); - myTextLabel.Position2D = new Position2D(10, 600); - myTextLabel.Size2D = new Size2D(400, 90); - myTextLabel.BackgroundColor = Color.Blue; - myTextLabel.PointSize = 20; - myTextLabel.TextColor = Color.White; - myTextLabel.MultiLine = true; - myTextLabel.LineWrapMode = LineWrapMode.Character; - myTextLabel.Text = $"[TextLabel LineWrapMode.Character] hello ABCDEFGHI is my name, it is very very long beautiful hansome awesome name."; - Window.Instance.GetDefaultLayer().Add(myTextLabel); - - myTextLabel2 = new TextLabel(); - myTextLabel2.Position2D = new Position2D(450, 600); - myTextLabel2.Size2D = new Size2D(400, 90); - myTextLabel2.BackgroundColor = Color.Blue; - myTextLabel2.PointSize = 20; - myTextLabel2.TextColor = Color.White; - myTextLabel2.MultiLine = true; - myTextLabel2.LineWrapMode = LineWrapMode.Word; - myTextLabel2.Text = $"[TextLabel LineWrapMode.Word] hello ABCDEFGHI is my name, it is very very long beautiful hansome awesome name."; - Window.Instance.GetDefaultLayer().Add(myTextLabel2); - - Tizen.Log.Debug("NUI", $"TextLabel LineWrapMode 1st={ myTextLabel?.LineWrapMode} 2nd={ myTextLabel2?.LineWrapMode}"); - - myTextEditor = new TextEditor(); - myTextEditor.Position2D = new Position2D(10, 700); - myTextEditor.Size2D = new Size2D(400, 90); - myTextEditor.BackgroundColor = Color.Red; - myTextEditor.PointSize = 20; - myTextEditor.TextColor = Color.White; - //myTextEditor.MultiLine = true; - myTextEditor.LineWrapMode = LineWrapMode.Character; - myTextEditor.Text = $"[TextEditor LineWrapMode.Character] hello ABCDEFGHI is my name, it is very very long beautiful hansome awesome name."; - Window.Instance.GetDefaultLayer().Add(myTextEditor); - - myTextEditor2 = new TextEditor(); - myTextEditor2.Position2D = new Position2D(450, 700); - myTextEditor2.Size2D = new Size2D(400, 90); - myTextEditor2.BackgroundColor = Color.Red; - myTextEditor2.PointSize = 20; - myTextEditor2.TextColor = Color.White; - //myTextEditor2.MultiLine = true; - myTextEditor2.LineWrapMode = LineWrapMode.Word; - myTextEditor2.Text = $"[TextEditor LineWrapMode.Word] hello ABCDEFGHI is my name, it is very very long beautiful hansome awesome name."; - Window.Instance.GetDefaultLayer().Add(myTextEditor2); - - Tizen.Log.Debug("NUI", $"TextEditor LineWrapMode 1st={ myTextEditor?.LineWrapMode} 2nd={ myTextEditor2?.LineWrapMode}"); - } - - [STAThread] - static void _Main(string[] args) - { - Example example = new Example(); - example.Run(args); - } - } -} diff --git a/NUIsamples/NUIsamples/src/examples/image-view.cs b/NUIsamples/NUIsamples/src/examples/image-view.cs deleted file mode 100755 index 97f974f13..000000000 --- a/NUIsamples/NUIsamples/src/examples/image-view.cs +++ /dev/null @@ -1,264 +0,0 @@ -/* -* Copyright (c) 2017 Samsung Electronics Co., Ltd. -* -* 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; -using Tizen.NUI; -using Tizen.NUI.UIComponents; -using Tizen.NUI.BaseComponents; -using Tizen.NUI.Constants; - -namespace ImageViewTest -{ - class Example : NUIApplication - { - - private const string resources = "/home/owner/apps_rw/NUISamples.TizenTV/res"; - public static void Log(string str) - { - Tizen.Log.Debug("NUI", "[DALI C# SAMPLE] " + str); - } - - private Animation _animation; - private ImageView _imageView; - private bool _isAniFinised = true; - private Layer layer, _layer1, _layer2; - private PushButton _pushButton1, _pushButton2; - private Window window; - - public Example() : base() - { - } - - public Example(string stylesheet) : base(stylesheet) - { - } - - public Example(string stylesheet, WindowMode windowMode) : base(stylesheet, windowMode) - { - } - - protected override void OnCreate() - { - base.OnCreate(); - Initialize(); - } - - public void Initialize() - { - Log("Customized Application Initialize event handler"); - window = Window.Instance; - window.BackgroundColor = Color.Cyan; - window.TouchEvent += OnWindowTouched; - window.WheelEvent += OnWindowWheelMoved; - window.KeyEvent += OnWindowKeyPressed; - //window.EventProcessingFinished += OnWindowEventProcessingFinished; - - layer = window.GetDefaultLayer(); - _layer1 = new Layer(); - _layer2 = new Layer(); - window.AddLayer(_layer1); - window.AddLayer(_layer2); - Log("_layer1.Behavior =" + _layer1.Behavior); - if (_layer1.Behavior == Layer.LayerBehavior.LayerUI) - { - _layer1.Behavior = Layer.LayerBehavior.Layer2D; - Log("again _layer1.Behavior =" + _layer1.Behavior); - } - // Add a ImageView to the window - // PropertyMap map = new PropertyMap(); - // map.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.NPatch)); - // map.Add(NpatchImageVisualProperty.URL, new PropertyValue(resources+"/images/00_popup_bg.9.png")); - // map.Add(NpatchImageVisualProperty.Border, new PropertyValue(new Rectangle(100, 100, 100, 100))); - _imageView = new ImageView(); - //_imageView.ImageMap = map; - _imageView.ResourceUrl = resources+"/images/00_popup_bg.9.png"; - //_imageView.Border = new Rectangle(100, 100, 100, 100); - _imageView.ParentOrigin = ParentOrigin.TopLeft; - _imageView.PivotPoint = PivotPoint.TopLeft; - _imageView.Position = new Position(5.0f, 5.0f, 0.0f); - _imageView.PixelArea = new Vector4(0.0f, 0.0f, 0.5f, 0.5f); - _imageView.Size2D = new Size2D(200, 80); - //_imageView.SetResizePolicy(ResizePolicyType.USE_NATURAL_SIZE, DimensionType.ALL_DIMENSIONS); - layer.Add(_imageView); - - _pushButton1 = new PushButton(); - _pushButton1.ParentOrigin = ParentOrigin.BottomLeft; - _pushButton1.PivotPoint = PivotPoint.BottomLeft; - _pushButton1.LabelText = "start animation"; - _pushButton1.Position = new Vector3(0.0f, window.Size.Height * 0.1f, 0.0f); - _pushButton1.Clicked += OnPushButtonClicked1; - _layer1.Add(_pushButton1); - - _pushButton2 = new PushButton(); - _pushButton2.ParentOrigin = ParentOrigin.BottomLeft; - _pushButton2.PivotPoint = PivotPoint.BottomLeft; - _pushButton2.LabelText = "reload image with same URL"; - _pushButton2.Position = new Vector3(0.0f, window.Size.Height * 0.2f, 0.0f); - _pushButton2.Clicked += OnPushButtonClicked2; - _layer2.Add(_pushButton2); - - ImageView syncImage = new ImageView(); - syncImage.ParentOrigin = ParentOrigin.CenterLeft; - syncImage.PivotPoint = PivotPoint.CenterLeft; - syncImage.PositionUsesPivotPoint = true; - syncImage.Size2D = new Size2D(150, 150); - syncImage.ResourceUrl = resources+"/images/gallery-3.jpg"; - syncImage.SynchronosLoading = true; - layer.Add(syncImage); - - PropertyMap _map = new PropertyMap(); - _map.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.NPatch)); - _map.Add(NpatchImageVisualProperty.URL, new PropertyValue(resources+"/images/00_popup_bg.9.png")); - _map.Add(NpatchImageVisualProperty.SynchronousLoading, new PropertyValue(true)); - ImageView nPatchImage = new ImageView(); - nPatchImage.ParentOrigin = ParentOrigin.BottomLeft; - nPatchImage.PivotPoint = PivotPoint.BottomLeft; - nPatchImage.PositionUsesPivotPoint = true; - nPatchImage.Size2D = new Size2D(300, 100); - nPatchImage.ImageMap = _map; - layer.Add(nPatchImage); - - ImageView syncNineImage = new ImageView(); - syncNineImage.ParentOrigin = ParentOrigin.CenterLeft; - syncNineImage.PivotPoint = PivotPoint.CenterLeft; - syncNineImage.Position2D = new Position2D(0, 200); - syncNineImage.PositionUsesPivotPoint = true; - syncNineImage.Size2D = new Size2D(150, 150); - syncNineImage.ResourceUrl = resources+"/images/00_popup_bg.9.png"; - syncNineImage.SynchronosLoading = true; - syncNineImage.Border = new Rectangle(0, 0, 0, 0); - layer.Add(syncNineImage); - } - - public bool OnPushButtonClicked2(object sender, EventArgs e) - { - if (_imageView) - { - Log("OnPushButtonClicked2()!"); - layer.Remove(_imageView); - _imageView = new ImageView(); - _imageView.ResourceUrl = resources+"/images/gallery-3.jpg"; - _imageView.ParentOrigin = ParentOrigin.Center; - _imageView.PivotPoint = PivotPoint.Center; - _imageView.PixelArea = new Vector4(0.0f, 0.0f, 0.5f, 0.5f); - //_imageView.SetResizePolicy(ResizePolicyType.USE_NATURAL_SIZE, DimensionType.ALL_DIMENSIONS); - layer.Add(_imageView); - } - - return true; - } - - public bool OnPushButtonClicked1(object sender, EventArgs e) - { - if (_isAniFinised == true) - { - _isAniFinised = false; - Log("OnPushButtonClicked1()!"); - - // Create a new _animation - if (_animation) - { - //_animation.Stop(Tizen.NUI.Constants.Animation.EndAction.Stop); - _animation.Reset(); - } - - _animation = new Animation(); - _animation.AnimateTo(_imageView, "PixelArea", new Vector4(0.5f, 0.0f, 0.5f, 0.5f), 0, 1000); - _animation.AnimateTo(_imageView, "PixelArea", new Vector4(0.5f, 0.5f, 0.5f, 0.5f), 1000, 2000); - _animation.AnimateTo(_imageView, "PixelArea", new Vector4(0.0f, 0.0f, 1.0f, 1.0f), 2000, 3000); - _animation.AnimateTo(_imageView, "PixelArea", new Vector4(0.5f, 0.5f, 0.5f, 0.5f), 3000, 4000); - - KeyFrames _keyFrames = new KeyFrames(); - _keyFrames.Add(0.0f, new Size(0.0f, 0.0f, 0.0f)); - _keyFrames.Add(0.3f, new Size(window.Size.Width * 0.7f, window.Size.Height * 0.7f, 0.0f)); - _keyFrames.Add(1.0f, new Size(window.Size)); - _animation.AnimateBetween(_imageView, "Size", _keyFrames, 4000, 6000, Animation.Interpolation.Linear); - - _animation.EndAction = Animation.EndActions.Discard; - - // Connect the signal callback for animaiton finished signal - _animation.Finished += AnimationFinished; - _animation.Finished += AnimationFinished2; - - // Play the _animation - _animation.Play(); - } - - return true; - } - - // Callback for _animation finished signal handling - public void AnimationFinished(object sender, EventArgs e) - { - Log("AnimationFinished()!"); - } - - // Callback for second _animation finished signal handling - public void AnimationFinished2(object sender, EventArgs e) - { - Log("AnimationFinished2()!"); - if (_animation) - { - Log("Duration= " + _animation.Duration); - Log("EndAction= " + _animation.EndAction); - _isAniFinised = true; - } - } - - public void OnWindowEventProcessingFinished(object sender, EventArgs e) - { - Log("OnWindowEventProcessingFinished()!"); - if (e != null) - { - Log("e != null !"); - } - } - - public void OnWindowKeyPressed(object sender, Window.KeyEventArgs e) - { - Log("OnWindowKeyEventOccured()!"); - Log("keyPressedName=" + e.Key.KeyPressedName); - Log("state=" + e.Key.State); - } - - public void OnWindowWheelMoved(object sender, Window.WheelEventArgs e) - { - Log("OnWindowWheelEventOccured()!"); - Log("direction=" + e.Wheel.Direction); - Log("type=" + e.Wheel.Type); - } - - // Callback for window touched signal handling - public void OnWindowTouched(object sender, Window.TouchEventArgs e) - { - Log("OnWindowTouched()! e.TouchData.GetState(0)=" + e.Touch.GetState(0)); - } - - /// - /// The main entry point for the application. - /// - [STAThread] - static void _Main(string[] args) - { - Log("Main() called!"); - - Example example = new Example(); - example.Run(args); - } - } -} diff --git a/NUIsamples/NUIsamples/src/examples/positionUsesPivotPoint-test.cs b/NUIsamples/NUIsamples/src/examples/positionUsesPivotPoint-test.cs deleted file mode 100755 index d2088a2a6..000000000 --- a/NUIsamples/NUIsamples/src/examples/positionUsesPivotPoint-test.cs +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright (c) 2017 Samsung Electronics Co., Ltd. - * - * 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; -using Tizen.NUI; -using Tizen.NUI.UIComponents; -using Tizen.NUI.BaseComponents; -using Tizen.NUI.Constants; -//using Tizen.Applications; - -//------------------------------------------------------------------------------ -// -// -// This file can only run on Tizen target. You should compile it with DaliApplication.cs, and -// add tizen c# application related library as reference. -//------------------------------------------------------------------------------ -namespace PositionUsesPivotPointTest -{ - class Example : NUIApplication - { - private TextLabel _text1; - private TextLabel _text2; - private Window _window; - - public Example():base() - { - } - - public Example(string stylesheet):base(stylesheet) - { - } - - public Example(string stylesheet, WindowMode windowMode):base(stylesheet, windowMode) - { - } - - protected override void OnCreate() - { - base.OnCreate(); - Initialize(); - } - - private void Initialize() - { - // Connect the signal callback for window touched signal - _window = Window.Instance; - _text1 = new TextLabel("PositionUsesPivotPoint"); - _text1.ParentOrigin = ParentOrigin.Center; - _text1.PivotPoint = PivotPoint.Center; - _text1.Position = new Position(0, 0, 0); - _text1.PositionUsesPivotPoint = true; - _text1.HorizontalAlignment = HorizontalAlignment.Center; - _text1.Size2D = new Size2D(200, 100); - _text1.PointSize = 10.0f; - _text1.BackgroundColor = Color.Blue; - _window.Add(_text1); - - _text2 = new TextLabel("PositionNotUsesPivotPoint"); - _text2.ParentOrigin = ParentOrigin.Center; - _text2.PivotPoint = PivotPoint.Center; - _text2.Position = new Position(0, 0, 0); - _text2.PositionUsesPivotPoint = false; - _text2.HorizontalAlignment = HorizontalAlignment.Center; - _text2.Size2D = new Size2D(200, 100); - _text2.PointSize = 10.0f; - _text2.BackgroundColor = Color.Red; - _window.Add(_text2); - } - - - - /// - /// The main entry point for the application. - /// - [STAThread] - static void _Main(string[] args) - { - Tizen.Log.Debug("NUI", "Hello mono world."); - Example example = new Example("stylesheet", WindowMode.Transparent); - example.Run(args); - } - } -} diff --git a/NUIsamples/NUIsamples/src/examples/relative-vector.cs b/NUIsamples/NUIsamples/src/examples/relative-vector.cs deleted file mode 100755 index eb27855d6..000000000 --- a/NUIsamples/NUIsamples/src/examples/relative-vector.cs +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Copyright (c) 2017 Samsung Electronics Co., Ltd. - * - * 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; -using Tizen.NUI; -using Tizen.NUI.UIComponents; -using Tizen.NUI.BaseComponents; -//using Tizen.Applications; - -//------------------------------------------------------------------------------ -// -// -// This file can only run on Tizen target. You should compile it with DaliApplication.cs, and -// add tizen c# application related library as reference. -//------------------------------------------------------------------------------ -namespace RelativeVectorTest -{ - class Example : NUIApplication - { - private Animation _animation; - private ImageView _imageView; - private Window _window; - private const string resources = "/home/owner/apps_rw/NUISamples.TizenTV/res"; - - public Example():base() - { - } - - public Example(string stylesheet):base(stylesheet) - { - } - - public Example(string stylesheet, WindowMode windowMode):base(stylesheet, windowMode) - { - } - - protected override void OnCreate() - { - base.OnCreate(); - Initialize(); - } - - private void Initialize() - { - _window = Window.Instance; - _window.TouchEvent += OnWindowTouched; - - _imageView = new ImageView(); - _imageView.ResourceUrl = resources+"/images/gallery-3.jpg"; - _imageView.ParentOrigin = ParentOrigin.Center; - _imageView.PivotPoint = PivotPoint.Center; - _imageView.PixelArea = new RelativeVector4(0.0f, 0.0f, 0.0f, 0.0f); - - _window.Add(_imageView); - } - - // Callback for window touched signal handling - private void OnWindowTouched(object sender, Window.TouchEventArgs e) - { - // Only animate the _text label when touch down happens - if (e.Touch.GetState(0) == PointStateType.Down) - { - // Create a new _animation - if (_animation) - { - _animation.Reset(); - } - - _animation = new Animation(1000); // 1 second of duration - _animation.AnimateTo(_imageView, "PixelArea", new RelativeVector4(0.0f, 0.0f, 1.0f, 1.0f), 0, 1000); - _animation.EndAction = Animation.EndActions.Discard; - _animation.PlayRange = new RelativeVector2(0.2f, 0.8f); - - // Play the _animation - _animation.Play(); - } - } - - /// - /// The main entry point for the application. - /// - - [STAThread] - static void _Main(string[] args) - { - Tizen.Log.Debug("NUI", "Hello mono world."); - Example example = new Example("stylesheet", WindowMode.Transparent); - example.Run(args); - } - } -} diff --git a/NUIsamples/NUIsamples/src/examples/scroll-view.cs b/NUIsamples/NUIsamples/src/examples/scroll-view.cs deleted file mode 100755 index 15eab9164..000000000 --- a/NUIsamples/NUIsamples/src/examples/scroll-view.cs +++ /dev/null @@ -1,213 +0,0 @@ -/* - * Copyright (c) 2017 Samsung Electronics Co., Ltd. - * - * 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; -using Tizen.NUI; -using Tizen.NUI.UIComponents; -using Tizen.NUI.BaseComponents; -using Tizen.NUI.Constants; - -namespace ScrollViewTest -{ - class Example : NUIApplication - { - private const string resources = "/home/owner/apps_rw/NUISamples.TizenTV/res"; - - [UnmanagedFunctionPointer(CallingConvention.StdCall)] - delegate void CallbackDelegate(IntPtr data); - - [UnmanagedFunctionPointer(CallingConvention.StdCall)] - delegate void ActorCallbackDelegate(IntPtr data); - - private ScrollView _scrollView; - private ScrollBar _scrollBar; - private Animation _animation; - private TextLabel _text; - - public Example() : base() - { - } - - public Example(string stylesheet) : base(stylesheet) - { - } - - public Example(string stylesheet, WindowMode windowMode) : base(stylesheet, windowMode) - { - } - - protected override void OnCreate() - { - base.OnCreate(); - Initialize(); - } - - public void Initialize() - { - CreateScrollView(); - } - - private void CreateScrollView() - { - Window window = Window.Instance; - window.BackgroundColor = Color.White; - - // Create a scroll view - _scrollView = new ScrollView(); - Size windowSize = new Size(window.Size.Width, window.Size.Height, 0.0f); - _scrollView.Size2D = new Size2D((int)windowSize.Width, (int)windowSize.Height); - _scrollView.ParentOrigin = ParentOrigin.Center; - _scrollView.PivotPoint = PivotPoint.Center; - window.Add(_scrollView); - - // Add actors to a scroll view with 3 pages - int pageRows = 1; - int pageColumns = 3; - for(int pageRow = 0; pageRow < pageRows; pageRow++) - { - for(int pageColumn = 0; pageColumn < pageColumns; pageColumn++) - { - View pageActor = new View(); - pageActor.WidthResizePolicy = ResizePolicyType.FillToParent; - pageActor.HeightResizePolicy = ResizePolicyType.FillToParent; - pageActor.ParentOrigin = ParentOrigin.Center; - pageActor.PivotPoint = PivotPoint.Center; - pageActor.Position = new Position(pageColumn * windowSize.Width, pageRow * windowSize.Height, 0.0f); - - // Add images in a 3x4 grid layout for each page - int imageRows = 4; - int imageColumns = 3; - float margin = 10.0f; - Position imageSize = new Position((windowSize.Width / imageColumns) - margin, (windowSize.Height / imageRows) - margin, 0.0f); - - for(int row = 0; row < imageRows; row++) - { - for(int column = 0; column < imageColumns;column++) - { - int imageId = (row * imageColumns + column) % 2 + 1; - ImageView imageView = new ImageView(resources+"/images/image-" + imageId + ".jpg"); - imageView.ParentOrigin = ParentOrigin.Center; - imageView.PivotPoint = PivotPoint.Center; - imageView.Size2D = new Size2D((int)imageSize.X, (int)imageSize.Y); - imageView.Position = new Position( margin * 0.5f + (imageSize.X + margin) * column - windowSize.Width * 0.5f + imageSize.X * 0.5f, - margin * 0.5f + (imageSize.Y + margin) * row - windowSize.Height * 0.5f + imageSize.Y * 0.5f, 0.0f ); - pageActor.Add(imageView); - } - } - - _scrollView.Add(pageActor); - } - } - - _scrollView.SetAxisAutoLock(true); - - // Set scroll view to have 3 pages in X axis and allow page snapping, - // and also disable scrolling in Y axis. - PropertyMap rulerMap = new PropertyMap(); - rulerMap.Add((int)ScrollModeType.XAxisScrollEnabled, new PropertyValue(true)); - rulerMap.Add((int)ScrollModeType.XAxisSnapToInterval, new PropertyValue(windowSize.Width)); - rulerMap.Add((int)ScrollModeType.XAxisScrollBoundary, new PropertyValue(windowSize.Width * pageColumns ) ); - rulerMap.Add((int)ScrollModeType.YAxisScrollEnabled, new PropertyValue( false ) ); - _scrollView.ScrollMode = rulerMap; - - // Create a horizontal scroll bar in the bottom of scroll view (which is optional) - _scrollBar = new ScrollBar(ScrollBar.Direction.Horizontal); - _scrollBar.ParentOrigin = ParentOrigin.BottomLeft; - _scrollBar.PivotPoint = PivotPoint.TopLeft; - _scrollBar.WidthResizePolicy = ResizePolicyType.FitToChildren; - _scrollBar.HeightResizePolicy = ResizePolicyType.FillToParent; - _scrollBar.Orientation = new Rotation( new Radian( new Degree( 270.0f ) ), Vector3.ZAxis ); - _scrollView.Add(_scrollBar); - - // Connect to the OnRelayout signal - _scrollView.Relayout += OnScrollViewRelayout; - //_scrollView.Touched += OnTouch; - _scrollView.WheelEvent += Onwheel; - _scrollView.FocusGained += OnKey; - _text = new TextLabel("View Touch Event Handler Test"); - _text.ParentOrigin = ParentOrigin.Center; - _text.PivotPoint = PivotPoint.Center; - _text.HorizontalAlignment = HorizontalAlignment.Center; - _text.PointSize = 20.0f; - - _scrollView.Add(_text); - } - - // Callback for _animation finished signal handling - public void AnimationFinished(object sender, EventArgs e) - { - Tizen.Log.Debug("NUI", "Customized Animation Finished Event handler"); - } - private void OnKey(object source, EventArgs e) - { - Tizen.Log.Debug("NUI", "View Keyevent EVENT callback...."); - } - - private bool Onwheel(object source, View.WheelEventArgs e) - { - Tizen.Log.Debug("NUI", "View Wheel EVENT callback...."); - return true; - } - - private bool OnTouch(object source, View.TouchEventArgs e) - { - Tizen.Log.Debug("NUI", "View TOUCH EVENT callback...."); - - // Only animate the _text label when touch down happens - if( e.Touch.GetState(0) == PointStateType.Down ) - { - Tizen.Log.Debug("NUI", "Customized Window Touch event handler"); - // Create a new _animation - if( _animation ) - { - _animation.Reset(); - } - - _animation = new Animation(1); // 1 second of duration - - _animation.AnimateTo(_text, "Orientation", new Rotation( new Radian( new Degree( 180.0f ) ), Vector3.XAxis ), 0, 500); - _animation.AnimateTo(_text, "Orientation", new Rotation( new Radian( new Degree( 0.0f ) ), Vector3.XAxis ), 500, 1000); - - // Connect the signal callback for animaiton finished signal - _animation.Finished += AnimationFinished; - - // Play the _animation - _animation.Play(); - } - return true; - } - - private void OnScrollViewRelayout(object source, EventArgs e) - { - Tizen.Log.Debug("NUI", "View OnRelayoutEventArgs EVENT callback...."); - - // Set the correct scroll bar size after size negotiation of scroll view is done - _scrollBar.Size2D = new Size2D(0, (int)_scrollView.GetRelayoutSize(DimensionType.Width)); - } - - /// - /// The main entry point for the application. - /// - [STAThread] - static void _Main(string[] args) - { - Example example = new Example(); - example.Run(args); - } - } -} diff --git a/NUIsamples/NUIsamples/src/examples/sibling-order-test.cs b/NUIsamples/NUIsamples/src/examples/sibling-order-test.cs deleted file mode 100755 index eaf9f699a..000000000 --- a/NUIsamples/NUIsamples/src/examples/sibling-order-test.cs +++ /dev/null @@ -1,195 +0,0 @@ -// Copyright (c) 2017 Samsung Electronics Co., Ltd. -// -// 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.NUI; -using Tizen.NUI.UIComponents; -using Tizen.NUI.BaseComponents; -using System.Collections.Generic; - - -// 1) sibling order test -namespace SiblingOrderTest -{ - class Example : NUIApplication - { - public Example() : base() - { - } - - public Example(string stylesheet) : base(stylesheet) - { - } - - public Example(string stylesheet, WindowMode windowMode) : base(stylesheet, windowMode) - { - } - - protected override void OnCreate() - { - base.OnCreate(); - Initialize(); - } - - Window _window; - - public void Initialize() - { - _window = Window.Instance; - _window.BackgroundColor = Color.White; - - // sibling order test - // By default, the SiblingOrder is 0. - SiblingTest1(); - - // sibling order test - // Set the SiblingOrder 0 -> 9 - SiblingTest2(); - - // sibling order test - // Set the SiblingOrder 10 -> 1 - SiblingTest3(); - - // sibling order test - // Set the SiblingOrder 5 -> 1 & 0 -> 4 - SiblingTest4(); - - // sibling order test - // Set the SiblingOrder 0 -> 4 & 5 -> 1 - SiblingTest5(); - } - - public void SiblingTest1() - { - Position2D _myPos = new Position2D(100, 30); - - for (int i = 0; i < 10; i++) - { - PushButton _view = new PushButton(); - - _view.Name = "sibling" + i; - _view.LabelText = "view" + i; - _view.MinimumSize = new Size2D(100, 50); - _view.ParentOrigin = ParentOrigin.TopLeft; - _view.PivotPoint = PivotPoint.TopLeft; - _view.Position2D = _myPos + new Position2D(20 * i, 10 * i); - - _window.Add(_view); - } - } - - public void SiblingTest2() - { - Position2D _myPos = new Position2D(100, 180); - - for (int i = 0; i < 10; i++) - { - PushButton _view = new PushButton(); - - _view.Name = "sibling" + i; - _view.LabelText = "view" + i; - _view.MinimumSize = new Size2D(100, 50); - _view.ParentOrigin = ParentOrigin.TopLeft; - _view.PivotPoint = PivotPoint.TopLeft; - _view.Position2D = _myPos + new Position2D(20 * i, 10 * i); - - _window.Add(_view); - _view.SiblingOrder = i; - } - } - - public void SiblingTest3() - { - Position2D _myPos = new Position2D(100, 330); - - for (int i = 0; i < 10; i++) - { - PushButton _view = new PushButton(); - - _view.Name = "sibling" + i; - _view.LabelText = "view" + i; - _view.MinimumSize = new Size2D(100, 50); - _view.ParentOrigin = ParentOrigin.TopLeft; - _view.PivotPoint = PivotPoint.TopLeft; - _view.Position2D = _myPos + new Position2D(20 * i, 10 * i); - - _window.Add(_view); - _view.SiblingOrder = 10-i; - } - } - - public void SiblingTest4() - { - Position2D _myPos = new Position2D(100, 480); - - for (int i = 0; i < 10; i++) - { - PushButton _view = new PushButton(); - - _view.Name = "sibling" + i; - _view.LabelText = "view" + i; - _view.MinimumSize = new Size2D(100, 50); - _view.ParentOrigin = ParentOrigin.TopLeft; - _view.PivotPoint = PivotPoint.TopLeft; - _view.Position2D = _myPos + new Position2D(20 * i, 10 * i); - - _window.Add(_view); - - if (i<5) - { - _view.SiblingOrder = 5-i; - } - else - { - _view.SiblingOrder = i-5; - } - } - } - - public void SiblingTest5() - { - Position2D _myPos = new Position2D(100, 630); - - for (int i = 0; i < 10; i++) - { - PushButton _view = new PushButton(); - - _view.Name = "sibling" + i; - _view.LabelText = "view" + i; - _view.MinimumSize = new Size2D(100, 50); - _view.ParentOrigin = ParentOrigin.TopLeft; - _view.PivotPoint = PivotPoint.TopLeft; - _view.Position2D = _myPos + new Position2D(20 * i, 10 * i); - - _window.Add(_view); - - if (i<5) - { - _view.SiblingOrder = i; - } - else - { - _view.SiblingOrder = 10-i; - } - } - } - - static void _Main(string[] args) - { - Example example = new Example(); - example.Run(args); - } - } -} diff --git a/NUIsamples/NUIsamples/src/examples/test1.cs b/NUIsamples/NUIsamples/src/examples/test1.cs deleted file mode 100755 index 583784d0f..000000000 --- a/NUIsamples/NUIsamples/src/examples/test1.cs +++ /dev/null @@ -1,317 +0,0 @@ -// Copyright (c) 2017 Samsung Electronics Co., Ltd. -// -// 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.NUI; -using Tizen.NUI.UIComponents; -using Tizen.NUI.BaseComponents; -using System.Collections.Generic; - - -// 1) sibling order test -namespace Test1 -{ - class Example : NUIApplication - { - public Example() : base() - { - } - - public Example(string stylesheet) : base(stylesheet) - { - } - - public Example(string stylesheet, WindowMode windowMode) : base(stylesheet, windowMode) - { - } - - protected override void OnCreate() - { - base.OnCreate(); - Initialize(); - } - - Window _window; - StyleManager _style; - - public void Initialize() - { - _window = Window.Instance; - _window.BackgroundColor = Color.White; - - // 1) sibling order test - SiblingTest(); - // 2) text visual test - dali_VisualBase_Creation_test(); - - // 3) visual creation test - VisualTest2(); - - _style = StyleManager.Get(); - //_style.StyleChanged += _style_StyleChanged; - _style.StyleChanged += (obj, e) => - { - Tizen.Log.Debug("NUI", "in stylechanged.. C#side..\n"); - //flag = true; - }; - - _style.ApplyTheme("/home/owner/apps_rw/NUISamples.TizenTV/res/json/date-picker-theme.json"); - Tizen.Log.Debug("NUI", "#### 1) first change!"); - - - AnimatePath_1(); - } - - private void _style_StyleChanged(object sender, StyleManager.StyleChangedEventArgs e) - { - Tizen.Log.Debug("NUI", "style changed event handler comes"); - } - - public void SiblingTest() - { - View _prev = null; - Position2D _myPos = new Position2D(100, 100); - List list_view = new List(); - TextLabel _txt = new TextLabel(); - - for (int i = 0; i < 10; i++) - { - View _view0 = new PushButton(); - PushButton _view = _view0 as PushButton; - - _view.Name = "sibling" + i; - _view.MinimumSize = new Size2D(100, 50); - _view.LabelText = "sibling" + i; - _view.ParentOrigin = ParentOrigin.TopLeft; - _view.PivotPoint = PivotPoint.TopLeft; - _view.Position2D = _myPos + new Position2D(20 * i, 10 * i); - _view.Clicked += (sender, ee) => - { - View curr = sender as View; - Tizen.Log.Debug("NUI", "clicked curr view name=" + curr.Name + " sibling=" + curr.SiblingOrder); - curr.RaiseToTop(); - if (_prev) - { - _prev.LowerToBottom(); - Tizen.Log.Debug("NUI", "raise on top is called!curr sibling=" + curr.SiblingOrder + " prev name=" + _prev.Name + " sibling=" + _prev.SiblingOrder); - } - _prev = curr; - _txt.Text = "on top: " + curr.Name + ", sibling order=" + curr.SiblingOrder; - - _style.ApplyTheme("/home/owner/apps_rw/NUISamples.TizenTV/res/json/style-example-theme-one.json"); - Tizen.Log.Debug("NUI", "#### 2) second change!"); - - return true; - }; - list_view.Add(_view); - } - - for (int i = 0; i < 10; i++) - { - _window.Add(list_view[i]); - Tizen.Log.Debug("NUI", list_view[i].Name + "'s sibling order=" + list_view[i].SiblingOrder); - } - - _txt.ParentOrigin = ParentOrigin.TopLeft; - _txt.PivotPoint = PivotPoint.TopLeft; - _txt.Text = "on top: sibling#, sibling order=?"; - _txt.Position2D = _myPos + new Position2D(-50, 200); - _txt.TextColor = Color.Blue; - _window.Add(_txt); - - } - - public class VisualTest : CustomView - { - private int TextVisualPropertyIndex = -1; - private VisualBase _textVisual; - private string _string; - - public VisualTest() : base(typeof(VisualTest).Name, CustomViewBehaviour.RequiresKeyboardNavigationSupport) - { - } - public string TextVisual - { - get - { - return _string; - } - set - { - _string = value; - - TextVisualPropertyIndex = RegisterProperty("textvisualtest", new PropertyValue("textvisualtest"), PropertyAccessMode.ReadWrite); - - PropertyMap textVisual = new PropertyMap(); - textVisual.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.Text)) - .Add(TextVisualProperty.Text, new PropertyValue(_string)) - .Add(TextVisualProperty.TextColor, new PropertyValue(Color.Blue)) - .Add(TextVisualProperty.PointSize, new PropertyValue(10)) - .Add(TextVisualProperty.HorizontalAlignment, new PropertyValue("CENTER")) - .Add(TextVisualProperty.VerticalAlignment, new PropertyValue("CENTER")); - _textVisual = VisualFactory.Instance.CreateVisual(textVisual); - RegisterVisual(TextVisualPropertyIndex, _textVisual); - _textVisual.DepthIndex = TextVisualPropertyIndex; - } - } - } - - //when use belowing testcase, Time is out and this case is BLOCK - public void dali_VisualBase_Creation_test() - { - try - { - Tizen.Log.Debug("NUI", "##### start! ######"); - - VisualTest _visualTest = new VisualTest(); - _visualTest.TextVisual = "Hello NUI Text Visual!"; - _visualTest.ParentOrigin = ParentOrigin.TopLeft; - _visualTest.PivotPoint = PivotPoint.TopLeft; - _visualTest.Size2D = new Size2D(600, 200); - _visualTest.Position2D = new Position2D(50, 400); - _visualTest.BackgroundColor = Color.Yellow; - _window.Add(_visualTest); - } - catch (Exception e) - { - Tizen.Log.Error("NUI", "##### Caught Exception" + e.ToString()); - throw new System.InvalidOperationException("visual test error!!!"); - } - } - - public void VisualTest2() - { - try - { - Tizen.Log.Debug("NUI", "##### VisualTest2() start! ######"); - - VisualFactory visualfactory = VisualFactory.Instance; - PropertyMap textMap1 = new PropertyMap(); - textMap1.Insert(Visual.Property.Type, new PropertyValue((int)Visual.Type.Text)); - textMap1.Insert(TextVisualProperty.Text, new PropertyValue("Hello")); - textMap1.Insert(TextVisualProperty.PointSize, new PropertyValue(10.0f)); - - PropertyMap textMap2 = new PropertyMap(); - VisualBase textVisual1 = visualfactory.CreateVisual(textMap1); - textVisual1.Creation = textMap2; - } - catch (Exception e) - { - Tizen.Log.Error("NUI", "Caught Exception" + e.ToString()); - throw new System.InvalidOperationException("visual test2 error!!!"); - //LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Caught Exception" + e.ToString()); - //Assert.IsTrue(e is ArgumentException, "Argument Exception Not Recieved"); - } - } - - //[Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] - public void AnimatePath_1() - { - Tizen.Log.Debug("NUI", "#### 1) animate path test !"); - /* TEST CODE */ - View view = new View(); - view.ParentOrigin = ParentOrigin.TopLeft; - view.PivotPoint = PivotPoint.TopLeft; - view.MinimumSize = new Size2D(100, 100); - view.BackgroundColor = Color.Red; - _window.Add(view); - - Position position0 = new Position(200.0f, 200.0f, 0.0f); - Position position1 = new Position(300.0f, 300.0f, 0.0f); - Position position2 = new Position(400.0f, 400.0f, 0.0f); - - Path path = new Path(); - path.AddPoint(position0); - path.AddPoint(position1); - path.AddPoint(position2); - //Control points for first segment - path.AddControlPoint(new Vector3(39.0f, 90.0f, 0.0f)); - path.AddControlPoint(new Vector3(56.0f, 119.0f, 0.0f)); - //Control points for second segment - path.AddControlPoint(new Vector3(78.0f, 120.0f, 0.0f)); - path.AddControlPoint(new Vector3(93.0f, 104.0f, 0.0f)); - - Animation animation = new Animation(); - animation.AnimatePath(view, path, Vector3.XAxis, 0, 5000, new AlphaFunction(AlphaFunction.BuiltinFunctions.Linear)); - animation.Play(); - Vector3 position = new Vector3(); - Vector3 tangent = new Vector3(); - - path.Sample(0.0f, position, tangent); - Rotation rotation = new Rotation(new Radian(new Degree(0.0f)), tangent); - Tizen.Log.Debug("NUI", "################ progress = 0! "); - Tizen.Log.Debug("NUI", "position=(" + position.X + "," + position.Y + "," + position.Z + ")"); - Tizen.Log.Debug("NUI", "view position=(" + view.Position.X + "," + view.Position.Y + "," + view.Position.Z + ")"); - Tizen.Log.Debug("NUI", "view position=(" + view.PositionX + "," + view.PositionY + "," + view.PositionZ + ")"); - Tizen.Log.Debug("NUI", "view cur position=(" + view.CurrentPosition.X + "," + view.CurrentPosition.Y + "," + view.CurrentPosition.Z + ")"); - Tizen.Log.Debug("NUI", "tangent=(" + tangent.X + "," + tangent.Y + "," + tangent.Z + ")"); - Tizen.Log.Debug("NUI", "angle between=" + Rotation.AngleBetween(view.Orientation, rotation) + " view orientation length=" + view.Orientation.Length() + " rotation length=" + rotation.Length()); - //Assert.AreEqual(position.X, view.PositionX, "The actor's PositionX of is not correct"); - //Assert.AreEqual(position.Y, actor.PositionY, "The actor's PositionY of is not correct"); - //Assert.AreEqual(position.Z, actor.PositionZ, "The actor's PositionZ of is not correct"); - //Assert.IsTrue(rotation.Equals(actor.Orientation)); - //await Task.Delay(250); - path.Sample(0.25f, position, tangent); - rotation = new Rotation(new Radian(new Degree(0.0f)), tangent); - Tizen.Log.Debug("NUI", "################ progress = 0.25! "); - Tizen.Log.Debug("NUI", "position=(" + position.X + "," + position.Y + "," + position.Z + ")"); - Tizen.Log.Debug("NUI", "view position=(" + view.Position.X + "," + view.Position.Y + "," + view.Position.Z + ")"); - Tizen.Log.Debug("NUI", "view position=(" + view.PositionX + "," + view.PositionY + "," + view.PositionZ + ")"); - Tizen.Log.Debug("NUI", "view cur position=(" + view.CurrentPosition.X + "," + view.CurrentPosition.Y + "," + view.CurrentPosition.Z + ")"); - Tizen.Log.Debug("NUI", "tangent=(" + tangent.X + "," + tangent.Y + "," + tangent.Z + ")"); - Tizen.Log.Debug("NUI", "angle between=" + Rotation.AngleBetween(view.Orientation, rotation) + " view orientation length=" + view.Orientation.Length() + " rotation length=" + rotation.Length()); - //Assert.AreEqual(position.X, actor.PositionX, "The PositionX of actor is not correct"); - //Assert.AreEqual(position.Y, actor.PositionY, "The PositionY of actor is not correct"); - //Assert.AreEqual(position.Z, actor.PositionZ, "The PositionZ of actor is not correct"); - //Assert.IsTrue(rotation.Equals(actor.Orientation)); - //await Task.Delay(500); - path.Sample(0.75f, position, tangent); - rotation = new Rotation(new Radian(new Degree(0.0f)), tangent); - Tizen.Log.Debug("NUI", "################ progress = 0.75! "); - Tizen.Log.Debug("NUI", "position=(" + position.X + "," + position.Y + "," + position.Z + ")"); - Tizen.Log.Debug("NUI", "view position=(" + view.Position.X + "," + view.Position.Y + "," + view.Position.Z + ")"); - Tizen.Log.Debug("NUI", "view position=(" + view.PositionX + "," + view.PositionY + "," + view.PositionZ + ")"); - Tizen.Log.Debug("NUI", "view cur position=(" + view.CurrentPosition.X + "," + view.CurrentPosition.Y + "," + view.CurrentPosition.Z + ")"); - Tizen.Log.Debug("NUI", "tangent=(" + tangent.X + "," + tangent.Y + "," + tangent.Z + ")"); - Tizen.Log.Debug("NUI", "angle between=" + Rotation.AngleBetween(view.Orientation, rotation) + " view orientation length=" + view.Orientation.Length() + " rotation length=" + rotation.Length()); - //Assert.AreEqual(position.X, actor.PositionX, "The PositionX of actor is not correct here"); - //Assert.AreEqual(position.Y, actor.PositionY, "The PositionY of actor is not correct here"); - //Assert.AreEqual(position.Z, actor.PositionZ, "The PositionZ of actor is not correct here"); - //Assert.IsTrue(rotation.Equals(actor.Orientation)); - - path.Sample(1.0f, position, tangent); - rotation = new Rotation(new Radian(new Degree(0.0f)), tangent); - Tizen.Log.Debug("NUI", "################ progress = 1.0! "); - Tizen.Log.Debug("NUI", "position=(" + position.X + "," + position.Y + "," + position.Z + ")"); - Tizen.Log.Debug("NUI", "view position=(" + view.Position.X + "," + view.Position.Y + "," + view.Position.Z + ")"); - Tizen.Log.Debug("NUI", "view position=(" + view.PositionX + "," + view.PositionY + "," + view.PositionZ + ")"); - Tizen.Log.Debug("NUI", "view cur position=(" + view.CurrentPosition.X + "," + view.CurrentPosition.Y + "," + view.CurrentPosition.Z + ")"); - Tizen.Log.Debug("NUI", "tangent=(" + tangent.X + "," + tangent.Y + "," + tangent.Z + ")"); - Tizen.Log.Debug("NUI", "angle between=" + Rotation.AngleBetween(view.Orientation, rotation) + " view orientation length=" + view.Orientation.Length() + " rotation length=" + rotation.Length()); - - - Tizen.Log.Debug("NUI", "#### 2) animate path test end!"); - } - - - - - static void _Main(string[] args) - { - Example example = new Example(); - example.Run(args); - } - } -} diff --git a/NUIsamples/NUIsamples/src/examples/text-test.cs b/NUIsamples/NUIsamples/src/examples/text-test.cs deleted file mode 100755 index d8a744574..000000000 --- a/NUIsamples/NUIsamples/src/examples/text-test.cs +++ /dev/null @@ -1,177 +0,0 @@ -/* -* Copyright (c) 2017 Samsung Electronics Co., Ltd. -* -* 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; -using Tizen.NUI; -using Tizen.NUI.UIComponents; -using Tizen.NUI.BaseComponents; -using Tizen.NUI.Constants; - -namespace TextTest -{ - class Example : NUIApplication - { - TextLabel _pointLabel; - Boolean _colorToggle; - - public Example() : base() - { - } - - public Example(string stylesheet) : base(stylesheet) - { - } - - public Example(string stylesheet, WindowMode windowMode) : base(stylesheet, windowMode) - { - } - - protected override void OnCreate() - { - base.OnCreate(); - Initialize(); - } - - private bool LabelTouched(object sender, View.TouchEventArgs e) - { - if (e.Touch.GetState(0) == PointStateType.Down) - { - Animation textColorAnimation = new Animation(1000); - if (_colorToggle) - { - textColorAnimation.AnimateTo(_pointLabel, "TextColorAnimatable", Color.Blue ); - _colorToggle = false; - } - else - { - textColorAnimation.AnimateTo(_pointLabel, "TextColorAnimatable", Color.Green ); - _colorToggle = true; - } - textColorAnimation.Play(); - } - return true; - } - - - public void Initialize() - { - Window window = Window.Instance; - window.BackgroundColor = Color.White; - - TextLabel pixelLabel = new TextLabel("Test Pixel Size 32.0f"); - pixelLabel.Position2D = new Position2D(10, 10); - pixelLabel.PixelSize = 32.0f; - pixelLabel.BackgroundColor = Color.Magenta; - window.Add(pixelLabel); - - _pointLabel = new TextLabel("Test Point Size 32.0f"); - _pointLabel.Position2D = new Position2D(10, 100); - _pointLabel.PointSize = 32.0f; - _pointLabel.BackgroundColor = Color.Red; - _pointLabel.TextColorAnimatable = Color.Green; // Set initial text color using animatable property - _pointLabel.TouchEvent += LabelTouched; - _colorToggle = true; - - window.Add(_pointLabel); - - - TextLabel ellipsis = new TextLabel("Ellipsis of TextLabel is enabled."); - ellipsis.Size2D = new Size2D(100, 80); - ellipsis.Position2D = new Position2D(10, 200); - ellipsis.PointSize = 20.0f; - ellipsis.Ellipsis = true; - ellipsis.BackgroundColor = Color.Cyan; - window.Add(ellipsis); - - TextLabel autoScrollStopMode = new TextLabel("AutoScrollStopMode is finish-loop."); - autoScrollStopMode.Size2D = new Size2D(400, 50); - autoScrollStopMode.Position2D = new Position2D(10, 300); - autoScrollStopMode.PointSize = 15.0f; - autoScrollStopMode.BackgroundColor = Color.Green; - autoScrollStopMode.AutoScrollStopMode = AutoScrollStopMode.FinishLoop; - autoScrollStopMode.EnableAutoScroll = true; - window.Add(autoScrollStopMode); - - TextField field = new TextField(); - field.Size2D = new Size2D(400, 100); - field.Position2D = new Position2D(10, 400); - field.BackgroundColor = Color.Cyan; - field.PlaceholderText = "input someth..."; - field.PlaceholderTextFocused = "input someth... focused"; - field.Focusable = true; - PropertyMap hiddenMap = new PropertyMap(); - hiddenMap.Add(HiddenInputProperty.Mode, new PropertyValue((int)HiddenInputModeType.ShowLastCharacter)); - hiddenMap.Add(HiddenInputProperty.ShowDuration, new PropertyValue(2)); - hiddenMap.Add(HiddenInputProperty.SubstituteCount, new PropertyValue(4)); - hiddenMap.Add(HiddenInputProperty.SubstituteCharacter, new PropertyValue(0x23)); - field.HiddenInputSettings = hiddenMap; - field.EnableSelection = true; - window.Add(field); - - InputMethod inputMethod = new InputMethod(); - inputMethod.PanelLayout = InputMethod.PanelLayoutType.Number; - inputMethod.ActionButton = InputMethod.ActionButtonTitleType.Go; - inputMethod.AutoCapital = InputMethod.AutoCapitalType.Word; - inputMethod.Variation = 1; - - field.InputMethodSettings = inputMethod.OutputMap; - - PropertyMap propertyMap = new PropertyMap(); - propertyMap.Add("placeholderText", new PropertyValue("Placeholder Text")); - propertyMap.Add("placeholderTextFocused", new PropertyValue("Placeholder Text Focused")); - propertyMap.Add("placeholderColor", new PropertyValue(Color.Red)); - propertyMap.Add("placeholderPointSize", new PropertyValue(15.0f)); - - PropertyMap fontStyleMap = new PropertyMap(); - fontStyleMap.Add("weight", new PropertyValue("bold")); - fontStyleMap.Add("width", new PropertyValue("condensed")); - fontStyleMap.Add("slant", new PropertyValue("italic")); - propertyMap.Add("placeholderFontStyle", new PropertyValue(fontStyleMap)); - - TextEditor editor = new TextEditor(); - editor.Size2D = new Size2D(400, 100); - editor.Position2D = new Position2D(10, 550); - editor.BackgroundColor = Color.Magenta; - editor.EnableScrollBar = true; - editor.EnableSelection = true; - editor.Focusable = true; - editor.Placeholder = propertyMap; - window.Add(editor); - editor.TextChanged += (obj, e) => { - Tizen.Log.Debug("NUI", "editor line count: " + e.TextEditor.LineCount); - }; - - editor.ScrollStateChanged += (obj, e)=> { - Tizen.Log.Debug("NUI", "editor scroll state:" + e.ScrollState); - }; - - Tizen.Log.Debug("NUI", "editor id: " + editor.ID); - - FocusManager.Instance.SetCurrentFocusView(editor); - editor.UpFocusableView = field; - field.DownFocusableView = editor; - } - - [STAThread] - static void _Main(string[] args) - { - Example example = new Example(); - example.Run(args); - } - } -} diff --git a/NUIsamples/NUIsamples/src/examples/text-test2.cs b/NUIsamples/NUIsamples/src/examples/text-test2.cs deleted file mode 100755 index 75d43fe63..000000000 --- a/NUIsamples/NUIsamples/src/examples/text-test2.cs +++ /dev/null @@ -1,222 +0,0 @@ -/* -* Copyright (c) 2017 Samsung Electronics Co., Ltd. -* -* 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; -using Tizen.NUI; -using Tizen.NUI.UIComponents; -using Tizen.NUI.BaseComponents; -using Tizen.NUI.Constants; - -namespace TextTest2 -{ - class Example : NUIApplication - { - public Example() : base() - { - } - - public Example(string stylesheet) : base(stylesheet) - { - } - - public Example(string stylesheet, WindowMode windowMode) : base(stylesheet, windowMode) - { - } - - protected override void OnCreate() - { - base.OnCreate(); - Initialize(); - } - - private PushButton button; - private TextEditor editor; - private ImfManager imfManager; - - - public void Initialize() - { - Window window = Window.Instance; - window.BackgroundColor = Color.White; - - PropertyMap propertyMap = new PropertyMap(); - propertyMap.Add("placeholderText", new PropertyValue("TextEditor Placeholder Text")); - propertyMap.Add("placeholderColor", new PropertyValue(Color.Red)); - propertyMap.Add("placeholderPointSize", new PropertyValue(12.0f)); - - PropertyMap fontStyleMap = new PropertyMap(); - fontStyleMap.Add("weight", new PropertyValue("bold")); - fontStyleMap.Add("width", new PropertyValue("condensed")); - fontStyleMap.Add("slant", new PropertyValue("italic")); - propertyMap.Add("placeholderFontStyle", new PropertyValue(fontStyleMap)); - - - editor = new TextEditor() - { - Size2D = new Size2D(500, 300), - Position2D = new Position2D(10, 550), - BackgroundColor = Color.Magenta, - Focusable = true, - Placeholder = propertyMap - }; - - window.Add(editor); - - editor.TextChanged += (obj, e) => { - Tizen.Log.Fatal("NUI", "editor line count: " + e.TextEditor.LineCount); - }; - - editor.ScrollStateChanged += (obj, e) => { - Tizen.Log.Fatal("NUI", "editor scroll state:" + e.ScrollState); - }; - - editor.KeyEvent += OnKeyEvent; - - - Tizen.Log.Debug("NUI", "editor id: " + editor.ID); - - imfManager = ImfManager.Get(); - imfManager.AutoEnableInputPanel(false); - imfManager.SetInputPanelUserData("layouttype = 1 & entrylimit = 255 & action = clearall_for_voice_commit & caller = org.volt.search - all"); - - - // send privatecommand event - ImfManager.ImfEventData imfevent = new ImfManager.ImfEventData(ImfManager.ImfEvent.PrivateCommand, "", 0, 0); - imfManager.EventReceived += ImfManager_ImfManagerEventReceived; - - imfManager.LanguageChanged += ImfManager_LanguageChanged; - - imfManager.Activated += (obj, e) => { - Tizen.Log.Debug("NUI", "ImfManager Activated !!!!!"); - }; - imfManager.StatusChanged += (obj, e) => { - Tizen.Log.Debug("NUI", "ImfManager StatusChanged: !!!!!" + e.StatusChanged); - }; - imfManager.Resized += (obj, e) => - { - Tizen.Log.Debug("NUI", "ImfManager Resized !!!!!"); - }; - imfManager.KeyboardTypeChanged += (obj, e) => { - Tizen.Log.Debug("NUI", "ImfManager KeyboardTypeChanged: !!!!!" + e.KeyboardType); - }; - - button = new PushButton() - { - LabelText = "Button", - Size2D = new Size2D(400, 200), - Position2D = new Position2D(10, -10), - ParentOrigin = ParentOrigin.BottomLeft, - PivotPoint = PivotPoint.BottomLeft, - PositionUsesPivotPoint = true, - Focusable = true - }; - - window.Add(button); - - button.UpFocusableView = editor; - editor.DownFocusableView = button; - - FocusManager.Instance.SetCurrentFocusView(button); - } - - private bool OnKeyEvent(object source, View.KeyEventArgs e) - { - Tizen.Log.Debug("NUI", "KeyEvent called !!!!!"); - if (e.Key.State != Key.StateType.Down || editor.Focusable == false) - { - Tizen.Log.Debug("NUI", "KeyEvent ignored !!!!!"); - return false; - } - switch (e.Key.KeyPressedName) - { - case "Return": - Tizen.Log.Debug("NUI", "KeyPressedName: Return !!!!!"); - ShowImf(); - return true; - case "Select": - Tizen.Log.Debug("NUI", "KeyPressedName: Select !!!!!"); - HideImf(); - return true; - case "Cancel": - Tizen.Log.Debug("NUI", "KeyPressedName: Cancel !!!!!"); - HideImf(); - return true; - case "Down": - Tizen.Log.Debug("NUI", "KeyPressedName: Down !!!!!"); - HideImf(); - return MoveFocusTo(button); - } - return false; - } - - private void ShowImf() - { - imfManager.Activate(); - imfManager.ShowInputPanel(); - Tizen.Log.Debug("NUI", "IME showed !!!!!"); - } - - private bool MoveFocusTo(View view) - { - if (view == null) return false; - return FocusManager.Instance.SetCurrentFocusView(view); - } - - private void HideImf() - { - imfManager.Deactivate(); - imfManager.HideInputPanel(); - Tizen.Log.Debug("NUI", "IME hided !!!!!"); - } - - public ImfManager.ImfCallbackData ImfManager_ImfManagerEventReceived(object sender, ImfManager.EventReceivedEventArgs e) - { - Tizen.Log.Debug("NUI", "ImfManager_ImfManagerEventReceived()!"); - - Tizen.Log.Debug("NUI", "e.ImfEventData.PredictiveString= " + e?.ImfEventData?.PredictiveString); - Tizen.Log.Debug("NUI", "e.ImfEventData.CursorOffset= " + e?.ImfEventData?.CursorOffset); - Tizen.Log.Debug("NUI", "e.ImfEventData.EventName= " + e?.ImfEventData?.EventName); - Tizen.Log.Debug("NUI", "e.ImfEventData.NumberOfChars= " + e?.ImfEventData?.NumberOfChars); - - //Be able to compare VD specific private command with ImfEventData.predictiveString - if (e.ImfEventData.PredictiveString == "IME_F31") - { - ImfManager.Get().Deactivate(); - ImfManager.Get().HideInputPanel(); - // Do Something the user wants - Tizen.Log.Debug("NUI", "ImfManager ImfEventData.PredictiveString: IME_F31!!!"); - } - ImfManager.ImfCallbackData callbackData = new ImfManager.ImfCallbackData(true, 0, e.ImfEventData.PredictiveString, false); - Tizen.Log.Debug("NUI", "ImfManager return callbackData!!!"); - return callbackData; - } - - public void ImfManager_LanguageChanged(object sender, EventArgs args) - { - Tizen.Log.Debug("NUI", "ImfManager LanguageChanged!!!"); - return; - } - - [STAThread] - static void _Main(string[] args) - { - Example example = new Example(); - example.Run(args); - } - } -} diff --git a/NUIsamples/NUIsamples/src/examples/timer-test.cs b/NUIsamples/NUIsamples/src/examples/timer-test.cs deleted file mode 100755 index 549e54506..000000000 --- a/NUIsamples/NUIsamples/src/examples/timer-test.cs +++ /dev/null @@ -1,132 +0,0 @@ -using System; -using Tizen.NUI; -using Tizen.NUI.BaseComponents; -using Tizen.NUI.UIComponents; -using Tizen.NUI.Constants; - -namespace TimerTest -{ - // An example of Visual View control. - class Example : NUIApplication - { - private static int i = 0; - - public Example() : base() - { - } - - protected override void OnCreate() - { - base.OnCreate(); - Initialize(); - } - - protected override void OnTerminate() - { - NUILog.Debug("OnTerminate() is called!"); - base.OnTerminate(); - } - - public void Initialize() - { - NUILog.Debug("Initialize() is called!"); - - Window window = Window.Instance; - window.BackgroundColor = Color.White; - - TextLabel label = new TextLabel() - { - Text = "Steps: 0", - Size2D = new Size2D(460, 80), - Position2D = new Position2D(10, 10) - }; - - RadioButton radio1 = new RadioButton() - { - LabelText = "Set interval 500", - Size2D = new Size2D(300, 50), - Position2D = new Position2D(10, 100), - }; - RadioButton radio2 = new RadioButton() - { - LabelText = "Set interval 1000", - Size2D = new Size2D(300, 50), - Position2D = new Position2D(10, 160), - Selected = true - }; - RadioButton radio3 = new RadioButton() - { - LabelText = "Set interval 3000", - Size2D = new Size2D(300, 50), - Position2D = new Position2D(10, 220), - }; - - PushButton button1 = new PushButton() - { - LabelText = "Start", - Size2D = new Size2D(100, 50), - Position2D = new Position2D(10, 300), - Focusable = true - }; - - PushButton button2 = new PushButton() - { - LabelText = "Stop", - Size2D = new Size2D(100, 50), - Position2D = new Position2D(140, 300), - Focusable = true - }; - - window.Add(label); - window.Add(radio1); - window.Add(radio2); - window.Add(radio3); - window.Add(button1); - window.Add(button2); - - FocusManager.Instance.SetCurrentFocusView(button1); - button1.LeftFocusableView = button1.RightFocusableView = button2; - button2.RightFocusableView = button2.LeftFocusableView = button1; - button1.UpFocusableView = button2.UpFocusableView = radio3; - radio3.UpFocusableView = radio2; - radio2.UpFocusableView = radio1; - radio1.DownFocusableView = radio2; - radio2.DownFocusableView = radio3; - radio3.DownFocusableView = button1; - - Timer timer = new Timer(1000); - timer.Tick += (obj, e) => - { - Tizen.Log.Fatal("NUI", "NUI Timer tick called!"); - label.Text = "Steps: " + (i++); - return true; - }; - - button1.Clicked += (obj, e) => - { - if (radio1.Selected == true) timer.Interval = 500; - if (radio2.Selected == true) timer.Interval = 1000; - if (radio3.Selected == true) timer.Interval = 3000; - timer.Start(); - return true; - }; - button2.Clicked += (obj, e) => - { - timer.Stop(); - return true; - }; - - window.KeyEvent += Instance_Key; - } - private void Instance_Key(object sender, Window.KeyEventArgs e) - { - NUILog.Debug("Instance_Key: " + e.Key.KeyPressedName); - - if (e.Key.State == Key.StateType.Down && (e.Key.KeyPressedName == "BackSpace" || e.Key.KeyPressedName == "XF86Back")) - { - Exit(); - } - } - - } -} \ No newline at end of file diff --git a/NUIsamples/NUIsamples/src/examples/ttsplayer-test.cs b/NUIsamples/NUIsamples/src/examples/ttsplayer-test.cs deleted file mode 100755 index e0807ce35..000000000 --- a/NUIsamples/NUIsamples/src/examples/ttsplayer-test.cs +++ /dev/null @@ -1,68 +0,0 @@ -/* -* Copyright (c) 2017 Samsung Electronics Co., Ltd. -* -* 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.NUI; - -namespace TTSPlayerTest -{ - class Example : NUIApplication - { - public Example() : base() - { - } - - public Example(string stylesheet) : base(stylesheet) - { - } - - public Example(string stylesheet, WindowMode windowMode) : base(stylesheet, windowMode) - { - } - - protected override void OnCreate() - { - base.OnCreate(); - Initialize(); - } - - public void Initialize() - { - Window window = Window.Instance; - window.BackgroundColor = Color.White; - - TTSPlayer ttsPlayer = TTSPlayer.Get(TTSPlayer.TTSMode.Default); - ttsPlayer.Play("tts player test"); - - ttsPlayer.StateChanged += (s, e) => - { - Tizen.Log.Debug("NUI", "TTS state changed!!!"); - }; - ttsPlayer.Pause(); - ttsPlayer.Resume(); - ttsPlayer.Stop(); - Tizen.Log.Debug("NUI", "TTS state: " + ttsPlayer.GetState()); - } - - [STAThread] - static void _Main(string[] args) - { - Example example = new Example(); - example.Run(args); - } - } -} diff --git a/NUIsamples/NUIsamples/src/examples/user-alphafunction.cs b/NUIsamples/NUIsamples/src/examples/user-alphafunction.cs deleted file mode 100755 index f805af021..000000000 --- a/NUIsamples/NUIsamples/src/examples/user-alphafunction.cs +++ /dev/null @@ -1,203 +0,0 @@ -/* -* Copyright (c) 2017 Samsung Electronics Co., Ltd. -* -* 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; -using Tizen.NUI; -using Tizen.NUI.UIComponents; -using Tizen.NUI.BaseComponents; -using Tizen.NUI.Constants; - -namespace UserAlphaFunctionTest -{ - class Example : NUIApplication - { - private Animation _animation; - private TextLabel _text; - private View _view1, _view2, _view3; - private UserAlphaFunctionDelegate _user_alpha_func; - private int myCount; - - public static void Log(string str) - { - Tizen.Log.Debug("NUI", "[DALI C# SAMPLE] " + str); - } - - public Example() : base() - { - } - - public Example(string stylesheet) : base(stylesheet) - { - } - - public Example(string stylesheet, WindowMode windowMode) : base(stylesheet, windowMode) - { - } - - protected override void OnCreate() - { - base.OnCreate(); - Initialize(); - } - - // Declare user alpha function delegate - [UnmanagedFunctionPointer(CallingConvention.StdCall)] - delegate float UserAlphaFunctionDelegate(float progress); - - public void Initialize() - { - Log("Initialize() is called!"); - Window window = Window.Instance; - window.BackgroundColor = Color.White; - window.TouchEvent += OnWindowTouched; - window.TouchEvent += OnWindowTouched2; - //window.EventProcessingFinished += OnEventProcessingFinished; - window.WheelEvent += OnWindowWheelEvent; - - // Add a _text label to the window - _text = new TextLabel("Hello Mono World"); - _text.ParentOrigin = ParentOrigin.BottomCenter; - _text.PivotPoint = PivotPoint.BottomCenter; - _text.HorizontalAlignment = HorizontalAlignment.Center; - _text.PointSize = 32.0f; - window.Add(_text); - - _view1 = new View(); - _view1.Size2D = new Size2D(200, 200); - _view1.BackgroundColor = Color.Green; - _view1.ParentOrigin = ParentOrigin.Center; - _view1.PivotPoint = PivotPoint.Center; - _view1.WidthResizePolicy = ResizePolicyType.Fixed; - _view1.HeightResizePolicy = ResizePolicyType.Fixed; - _view1.AddedToWindow += OnWindow; - window.Add(_view1); - - _view2 = new View(); - _view2.BackgroundColor = Color.Red; - _view2.Size2D = new Size2D(50, 50); - _view2.ParentOrigin = ParentOrigin.TopLeft; - _view2.PivotPoint = PivotPoint.TopLeft; - _view2.WidthResizePolicy = ResizePolicyType.Fixed; - _view2.HeightResizePolicy = ResizePolicyType.Fixed; - _view1.Add(_view2); - - _view3 = new View(); - _view3.BackgroundColor = Color.Blue; - _view3.Size2D = new Size2D(50, 50); - _view3.ParentOrigin = ParentOrigin.TopLeft; - _view3.PivotPoint = PivotPoint.TopLeft; - _view3.WidthResizePolicy = ResizePolicyType.Fixed; - _view3.HeightResizePolicy = ResizePolicyType.Fixed; - _view1.Add(_view3); - - _user_alpha_func = new UserAlphaFunctionDelegate(body); - - MyAnimating(); - } - - // User defines alpha function as custom alpha function - // Important Notification : when this custom alpha-function is implemented, - // the other function call nor other data excess is prevented. - // this method must be implemented to calculate the values of input and output purely. - // unless, this will cause application crash. - float body(float progress) - { - if (progress > 0.2f && progress < 0.7f) - { - return progress + 0.8f; - } - return progress; - } - - // Callback for _animation finished signal handling - public void AnimationFinished(object sender, EventArgs e) - { - Log("AnimationFinished() is called!"); - myCount = 0; - } - - public void MyAnimating() - { - // Create a new _animation - if (_animation) - { - _animation.Clear(); - _animation.Reset(); - } - - _animation = new Animation(10000); // 10000 milli-second of duration - _animation.AnimateTo(_view2, "Position", new Vector3(150.0f, 150.0f, 0.0f), 5000, 10000, new AlphaFunction(_user_alpha_func)); - // Connect the signal callback for animaiton finished signal - _animation.Finished += AnimationFinished; - _animation.EndAction = Animation.EndActions.Discard; - // Play the _animation - _animation.Play(); - } - - // Callback for window touched signal handling - public void OnWindowTouched(object source, Window.TouchEventArgs e) - { - // Only animate the _text label when touch down happens - if (e.Touch.GetState(0) == PointStateType.Down) - { - Log("OnWindowTouched() is called! PointStateType.DOWN came!"); - myCount++; - if (myCount > 1) - { - _animation.Stop(); - Log("_animation.Stop() is called!"); - } - } - } - - // Callback for window touched signal handling - public void OnWindowTouched2(object source, Window.TouchEventArgs e) - { - Log("OnWindowTouched2() is called!state=" + e.Touch.GetState(0)); - } - - public void OnEventProcessingFinished(object source) - { - Log("OnEventProcessingFinished() is called!"); - } - - public void OnWindowWheelEvent(object source, Window.WheelEventArgs e) - { - Log("OnWindowWheelEvent() is called!"); - //Log("OnWindowWheelEvent() is called!direction="+ e.WheelEvent.direction + " timeStamp=" + e.WheelEvent.timeStamp ); - } - - - public void OnWindow(object source, EventArgs e) - { - Log("OnWindow() is called!"); - } - - [STAThread] - static void _Main(string[] args) - { - Log("Main() is called!"); - - Example example = new Example(); - example.Run(args); - - Log("After MainLoop()"); - } - } -} - diff --git a/NUIsamples/NUIsamples/src/examples/view-navi-property.cs b/NUIsamples/NUIsamples/src/examples/view-navi-property.cs deleted file mode 100755 index ce68ed0f7..000000000 --- a/NUIsamples/NUIsamples/src/examples/view-navi-property.cs +++ /dev/null @@ -1,180 +0,0 @@ -/* - * Copyright (c) 2017 Samsung Electronics Co., Ltd. - * - * 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.NUI; -using Tizen.NUI.BaseComponents; - -namespace MyCSharpExample -{ - class Example : NUIApplication - { - const int num = 2; - View[] view; - - View lastFocusedView; - - protected override void OnCreate() - { - base.OnCreate(); - Initialize(); - } - - public void Initialize() - { - view = new View[2]; - - for (int i = 0; i < num; i++) - { - view[i] = new View(); - view[i].Size2D = new Size2D(200, 200); - view[i].BackgroundColor = Color.Blue; - view[i].Position = new Position(300 + i * 300, 300, 0); - view[i].Name = "MyView" + i; - view[i].Focusable = true; - Window.Instance.Add(view[i]); - view[i].FocusGained += FocusNavigationSample_FocusGained; - view[i].FocusLost += FocusNavigationSample_FocusLost; - view[i].KeyEvent += FocusNavigationSample_KeyEvent; - } - - view[0].RightFocusableView = view[1]; - view[0].LeftFocusableView = view[1]; - view[1].RightFocusableView = view[0]; - view[1].LeftFocusableView = view[0]; - - FocusManager.Instance.SetCurrentFocusView(view[0]); - FocusManager.Instance.PreFocusChange += Instance_PreFocusChange; - - Window.Instance.TouchEvent += Instance_Touch; - } - - private void Instance_Touch(object sender, Window.TouchEventArgs e) - { - Tizen.Log.Debug("NUI", "window touched! set key focus as view[0]!"); - FocusManager.Instance.SetCurrentFocusView(view[0]); - } - - private bool FocusNavigationSample_KeyEvent(object source, View.KeyEventArgs e) - { - Tizen.Log.Debug("NUI", "..."); - View view = source as View; - - Tizen.Log.Debug("NUI", "NUI-1 " + "View-" + view.Name + ", Pressed-" + e.Key.KeyPressedName + e.Key.State.ToString()); - - return false; - } - - private void FocusNavigationSample_FocusLost(object sender, EventArgs e) - { - Tizen.Log.Debug("NUI", "..."); - View view = sender as View; - view.BackgroundColor = Color.Blue; - view.Scale = new Vector3(1.0f, 1.0f, 1.0f); - - Tizen.Log.Debug("NUI", "NUI-2 " + "FocusLost-" + view.Name); - } - - private void FocusNavigationSample_FocusGained(object sender, EventArgs e) - { - Tizen.Log.Debug("NUI", "..."); - View view = sender as View; - view.BackgroundColor = Color.Red; - view.Scale = new Vector3(1.2f, 1.2f, 1.0f); - - Tizen.Log.Debug("NUI", "NUI-3 " + "FocusGained-" + view.Name); - } - - private View Instance_PreFocusChange(object source, FocusManager.PreFocusChangeEventArgs e) - { - Tizen.Log.Debug("NUI", "..."); - View currentView = (e.CurrentView) ?? lastFocusedView; - View nextView = null; - - Tizen.Log.Debug("NUI", "NUI-4 " + "PreFocusChange-" + e.Direction); - - if (currentView != null && currentView.HasBody()) - Tizen.Log.Debug("NUI", "NUI-5 " + " Current-" + currentView.Name); - - if (currentView) - { - switch (e.Direction) - { - case View.FocusDirection.Left: - nextView = currentView.LeftFocusableView; - if (nextView == null) - Tizen.Log.Debug("NUI", "NUI-6 " + "LeftFocusableView is NULL!!!!"); - else - Tizen.Log.Debug("NUI", "NUI-7 " + currentView.Name + ".LeftFocusableView =" + nextView.Name); - break; - case View.FocusDirection.Right: - nextView = currentView.RightFocusableView; - if (nextView == null) - Tizen.Log.Debug("NUI", "NUI-8 " + "RightFocusableView is NULL!!!!"); - else - Tizen.Log.Debug("NUI", "NUI-9 " + currentView.Name + ".RightFocusableView =" + nextView.Name); - break; - case View.FocusDirection.Up: - nextView = currentView.UpFocusableView; - if (nextView == null) - Tizen.Log.Debug("NUI", "NUI-10 " + "UpFocusableView is NULL!!!!"); - else - Tizen.Log.Debug("NUI", "NUI-11 " + currentView.Name + ".UpFocusableView =" + nextView.Name); - break; - case View.FocusDirection.Down: - nextView = currentView.DownFocusableView; - if (nextView == null) - Tizen.Log.Debug("NUI", "NUI-12 " + "DownFocusableView is NULL!!!!"); - else - Tizen.Log.Debug("NUI", "NUI-13 " + currentView.Name + ".DownFocusableView =" + nextView.Name); - break; - default: - nextView = null; //added - break; - } - } - - if (e.ProposedView == null) - { - Tizen.Log.Debug("NUI", "NUI-14 " + "ProposedView in NULL!!"); - } - else if (e.ProposedView.HasBody()) - { - Tizen.Log.Debug("NUI", "NUI-15 " + "ProposedView-" + e.ProposedView.Name); - } - else - { - Tizen.Log.Debug("NUI", "NUI-16 " + "ProposedView does NOT have body!!!" + e.ProposedView); - } - - nextView = nextView ?? (e.ProposedView) ?? currentView; - lastFocusedView = nextView; - - if (nextView != null && nextView.HasBody()) - Tizen.Log.Debug("NUI", "NUI-17 " + "Next-" + nextView.Name); - - return nextView; - } - - [STAThread] - static void _Main(string[] args) - { - Example example = new Example(); - example.Run(args); - } - } -} \ No newline at end of file diff --git a/NUIsamples/NUIsamples/src/examples/visual-animation-test.cs b/NUIsamples/NUIsamples/src/examples/visual-animation-test.cs deleted file mode 100755 index 39ea8f49d..000000000 --- a/NUIsamples/NUIsamples/src/examples/visual-animation-test.cs +++ /dev/null @@ -1,263 +0,0 @@ -/* - * Copyright (c) 2017 Samsung Electronics Co., Ltd. - * - * 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; -using Tizen.NUI; -using Tizen.NUI.UIComponents; -using Tizen.NUI.BaseComponents; -using Tizen.NUI.Constants; - -namespace VisaulAnimationExample -{ - class Example : NUIApplication - { - private VisualView _contentView; - private TextLabel _title; - private PushButton _shadowButton; - private bool _active = false; - private const string _resPath = "/home/owner/apps_rw/NUISamples.TizenTV/res"; //for tizen - //private const string _resPath = "./res"; //for ubuntu - - private Animation _animation1; - private bool _transitionInProgress = false; - private int cnt1, cnt2; - - private SVGVisual svgVisual; - private AnimatedImageVisual gifVisual; - private ImageVisual _icon; - - protected override void OnCreate() - { - base.OnCreate(); - Initialize(); - } - - public void Initialize() - { - Window window = Window.Instance; - window.BackgroundColor = Color.White; - - TableView titleLayout = new TableView(2, 1); - titleLayout.Name = ("TitleLayout"); - titleLayout.PivotPoint = PivotPoint.TopLeft; - titleLayout.Position2D = new Position2D(10, 10); - titleLayout.Size2D = new Size2D((int)(window.Size.Width * 0.9f), (int)(window.Size.Height * 0.9f)); - titleLayout.SetCellPadding(new Size2D(10, 10)); - titleLayout.BackgroundColor = Color.Cyan; - window.Add(titleLayout); - - _title = new TextLabel("Visual Transition / SVG / AGIF Example"); - _title.Name = ("Title"); - _title.SetStyleName("Title"); - _title.WidthResizePolicy = ResizePolicyType.FillToParent; - _title.HeightResizePolicy = ResizePolicyType.UseNaturalSize; - _title.HorizontalAlignment = HorizontalAlignment.Center; - titleLayout.AddChild(_title, new TableView.CellPosition(0, 0)); - titleLayout.SetFitHeight(0); - - TableView contentLayout = new TableView(3, 2); - contentLayout.Name = ("ContentLayout"); - contentLayout.WidthResizePolicy = ResizePolicyType.FillToParent; - contentLayout.HeightResizePolicy = ResizePolicyType.FillToParent; - contentLayout.PivotPoint = PivotPoint.TopLeft; - contentLayout.SetCellPadding(new Size2D(10, 10)); - contentLayout.BackgroundColor = Color.Magenta; - titleLayout.AddChild(contentLayout, new TableView.CellPosition(1, 0)); - - ////////////////////////////////////////////////////////////////////// - // Create a conttent view - _contentView = new VisualView(); - _contentView.WidthResizePolicy = ResizePolicyType.SizeRelativeToParent; - _contentView.HeightResizePolicy = ResizePolicyType.SizeRelativeToParent; - //_contentView.Size2D = new Size2D(250, 250); - _contentView.BackgroundImage = _resPath + "/images/background-blocks.jpg"; - - _icon = new ImageVisual(); - _icon.URL = _resPath + "/images/application-icon-0.png"; - _icon.DepthIndex = 1; - _icon.Size = new Size2D(50, 50); - _icon.SizePolicy = VisualTransformPolicyType.Absolute; - _icon.Position = new Position2D(5, 5); - _icon.PositionPolicy = VisualTransformPolicyType.Absolute; - _icon.Origin = Visual.AlignType.TopBegin; - _icon.AnchorPoint = Visual.AlignType.TopBegin; - _icon.MixColor = new Color(0, 1, 0, 0.5f); - _icon.Opacity = 0.5f; - _contentView.AddVisual("icon_visual1", _icon); - - contentLayout.AddChild(_contentView, new TableView.CellPosition(0, 0)); - - _shadowButton = new PushButton(); - _shadowButton.LabelText = "Toggle Transition"; - _shadowButton.Name = ("ToggleTransition"); - _shadowButton.ParentOrigin = ParentOrigin.Center; - _shadowButton.PivotPoint = PivotPoint.Center; - _shadowButton.Clicked += (obj, ev) => - { - _active = !_active; - StartTransition(_active); - return true; - }; - _shadowButton.WidthResizePolicy = ResizePolicyType.FillToParent; - _shadowButton.HeightResizePolicy = ResizePolicyType.FillToParent; - contentLayout.AddChild(_shadowButton, new TableView.CellPosition(0, 1)); - - ////////////////////////////////////////////////////////////////////// - // make NPatch visual test - NPatchVisual npatch1 = new NPatchVisual(); - npatch1.URL = _resPath + "/images/gallery-2.jpg"; - npatch1.Size = new Size2D(400, 400); - npatch1.SizePolicy = VisualTransformPolicyType.Absolute; - npatch1.Position = new Position2D(400, 0); - npatch1.PositionPolicy = VisualTransformPolicyType.Absolute; - npatch1.Origin = Visual.AlignType.TopBegin; - npatch1.AnchorPoint = Visual.AlignType.TopBegin; - npatch1.Border = new Rectangle(100, 100, 100, 100); - npatch1.DepthIndex = 2; - npatch1.MixColor = new Color(1, 0, 0, 1); - npatch1.Opacity = 0.5f; - _contentView.AddVisual("npatchImageVisual1", npatch1); - - ////////////////////////////////////////////////////////////////////// - // make SVG visual test - VisualView VisualView1 = new VisualView(); - VisualView1.WidthResizePolicy = ResizePolicyType.FillToParent; - VisualView1.HeightResizePolicy = ResizePolicyType.FillToParent; - VisualView1.BackgroundColor = Color.Black; - contentLayout.AddChild(VisualView1, new TableView.CellPosition(1, 0)); - - svgVisual = new SVGVisual(); - svgVisual.URL = _resPath + "/images/Kid1.svg"; - svgVisual.Size = new Size2D(300, 300); - svgVisual.SizePolicy = VisualTransformPolicyType.Absolute; - svgVisual.Position = new Position2D(0, 0); - svgVisual.PositionPolicy = VisualTransformPolicyType.Absolute; - svgVisual.Origin = Visual.AlignType.TopBegin; - svgVisual.AnchorPoint = Visual.AlignType.TopBegin; - VisualView1.AddVisual("svg_visual1", svgVisual); - - PushButton svgButton = new PushButton(); - svgButton.LabelText = "SVG Visual Test"; - svgButton.Name = ("svg_visual_test"); - svgButton.PivotPoint = PivotPoint.Center; - svgButton.WidthResizePolicy = ResizePolicyType.FillToParent; - svgButton.HeightResizePolicy = ResizePolicyType.FillToParent; - svgButton.Clicked += (obj, ev) => - { - cnt1++; - if (cnt1 % 2 == 0) - { - svgVisual.URL = _resPath + "/images/World.svg"; - } - else - { - svgVisual.URL = _resPath + "/images/Mail.svg"; - } - Tizen.Log.Debug("NUI", "svg button clicked!"); - return true; - }; - contentLayout.AddChild(svgButton, new TableView.CellPosition(1, 1)); - - ////////////////////////////////////////////////////////////////////// - // make AnimatedImage visual test - VisualView VisualView2 = new VisualView(); - VisualView2.WidthResizePolicy = ResizePolicyType.FillToParent; - VisualView2.HeightResizePolicy = ResizePolicyType.FillToParent; - VisualView2.BackgroundColor = Color.Blue; - contentLayout.AddChild(VisualView2, new TableView.CellPosition(2, 0)); - - gifVisual = new AnimatedImageVisual(); - gifVisual.URL = _resPath + "/images/dog-anim.gif"; - gifVisual.Size = new Size2D(200, 200); - gifVisual.SizePolicy = VisualTransformPolicyType.Absolute; - gifVisual.Position = new Position2D(0, 0); - gifVisual.PositionPolicy = VisualTransformPolicyType.Absolute; - gifVisual.Origin = Visual.AlignType.TopBegin; - gifVisual.AnchorPoint = Visual.AlignType.TopBegin; - VisualView2.AddVisual("gif_visual", gifVisual); - - PushButton gifButton = new PushButton(); - gifButton.LabelText = "AnimatedImage Visual Test"; - gifButton.Name = ("gif_visual_test"); - gifButton.PivotPoint = PivotPoint.Center; - gifButton.WidthResizePolicy = ResizePolicyType.FillToParent; - gifButton.HeightResizePolicy = ResizePolicyType.FillToParent; - gifButton.Clicked += (obj, ev) => - { - Tizen.Log.Debug("NUI", "gif button clicked!"); - cnt2++; - int gifNum = cnt2 % 15; - gifVisual.URL = _resPath + "/images/anim-gif/" + gifNum + ".gif"; - gifButton.LabelText = "file:" + gifNum + ".gif"; - return true; - }; - contentLayout.AddChild(gifButton, new TableView.CellPosition(2, 1)); - } - - private void StartTransition(bool activate) - { - if (_animation1) - { - _animation1.Stop(); - _animation1.Finished += OnTransitionFinished1; - } - - if (activate) - { - _contentView.AnimateVisualAdd(_icon, "Size", new Size2D(150, 150), 0, 1000, AlphaFunction.BuiltinFunctions.Linear); - _contentView.AnimateVisualAdd(_icon, "Position", new Position2D(40, 40), 0, 1000); - _animation1 = _contentView.AnimateVisualAddFinish(); - } - else - { - _contentView.AnimateVisualAdd(_icon, "Size", new Position2D(50, 50), 0, 1000, AlphaFunction.BuiltinFunctions.Linear); - _contentView.AnimateVisualAdd(_icon, "Position", new Position2D(5, 5), 0, 1000); - _animation1 = _contentView.AnimateVisualAddFinish(); - } - - if (_animation1) - { - _animation1.Finished += OnTransitionFinished1; - _transitionInProgress = true; - _animation1.Play(); - } - } - private void OnTransitionFinished1(object sender, EventArgs e) - { - _transitionInProgress = false; - if (_animation1) - { - _animation1.Finished += OnTransitionFinished1; - _animation1.Reset(); - } - } - - - /// - /// The main entry point for the application. - /// - [STAThread] - static void _Main(string[] args) - { - Example example = new Example(); - example.Run(args); - } - - - } -} diff --git a/NUIsamples/NUIsamples/src/examples/visual-animation-test2.cs b/NUIsamples/NUIsamples/src/examples/visual-animation-test2.cs deleted file mode 100755 index 92528c0cb..000000000 --- a/NUIsamples/NUIsamples/src/examples/visual-animation-test2.cs +++ /dev/null @@ -1,278 +0,0 @@ -/* - * Copyright (c) 2017 Samsung Electronics Co., Ltd. - * - * 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; -using Tizen.NUI; -using Tizen.NUI.UIComponents; -using Tizen.NUI.BaseComponents; -using Tizen.NUI.Constants; - -namespace VisaulAnimationExample -{ - class Example2 : NUIApplication - { - private VisualView _contentView1; - private VisualView _contentView2; - private VisualView _contentView3; - private TextLabel _title; - private PushButton _shadowButton1; - private PushButton _shadowButton2; - private PushButton _shadowButton3; - private bool _active1 = false; - private bool _active2 = false; - private bool _active3 = false; - private const string _resPath = "/home/owner/apps_rw/NUISamples.TizenTV/res"; - - private Animation _animation; - private bool _transitionInProgress = false; - - public Example2() : base() - { - } - - public Example2(string stylesheet) : base(stylesheet) - { - } - - public Example2(string stylesheet, WindowMode windowMode) : base(stylesheet, windowMode) - { - } - - protected override void OnCreate() - { - base.OnCreate(); - Initialize(); - } - - public void Initialize() - { - Window window = Window.Instance; - window.BackgroundColor = Color.White; - - TableView titleLayout = new TableView(2, 1); - titleLayout.Name = ("TitleLayout"); - titleLayout.PivotPoint = PivotPoint.TopLeft; - titleLayout.Position2D = new Position2D(10, 10); - titleLayout.Size2D = new Size2D((int)(window.Size.Width * 0.9f), (int)(window.Size.Height * 0.9f)); - titleLayout.SetCellPadding(new Size2D(10, 10)); - titleLayout.BackgroundColor = Color.Cyan; - window.Add(titleLayout); - - _title = new TextLabel("Visual Transition Example"); - _title.Name = ("Title"); - _title.SetStyleName("Title"); - _title.WidthResizePolicy = ResizePolicyType.FillToParent; - _title.HeightResizePolicy = ResizePolicyType.UseNaturalSize; - _title.HorizontalAlignment = HorizontalAlignment.Center; - titleLayout.AddChild(_title, new TableView.CellPosition(0, 0)); - titleLayout.SetFitHeight(0); - - TableView contentLayout = new TableView(3, 2); - contentLayout.Name = ("ContentLayout"); - contentLayout.WidthResizePolicy = ResizePolicyType.FillToParent; - contentLayout.HeightResizePolicy = ResizePolicyType.FillToParent; - contentLayout.PivotPoint = PivotPoint.TopLeft; - contentLayout.SetCellPadding(new Size2D(10, 10)); - contentLayout.BackgroundColor = Color.Magenta; - titleLayout.AddChild(contentLayout, new TableView.CellPosition(1, 0)); - - ////////////////////////////////////////////////////////////////////// - // make visual position animation - _contentView1 = new VisualView(); - _contentView1.WidthResizePolicy = ResizePolicyType.SizeRelativeToParent; - _contentView1.HeightResizePolicy = ResizePolicyType.SizeRelativeToParent; - //_contentView.Size2D = new Size2D(250, 250); - _contentView1.BackgroundImage = _resPath + "/images/background-blocks.jpg"; - - ImageVisual _icon = new ImageVisual(); - _icon.URL = _resPath + "/images/application-icon-0.png"; - _icon.DepthIndex = 1; - _icon.Size = new Size2D(50, 50); - _icon.SizePolicy = VisualTransformPolicyType.Absolute; - _icon.Position = new Position2D(5, 5); - _icon.PositionPolicy = VisualTransformPolicyType.Absolute; - _icon.Origin = Visual.AlignType.TopBegin; - _icon.AnchorPoint = Visual.AlignType.TopBegin; - _icon.MixColor = new Color(0, 1, 0, 0.5f); - _icon.Opacity = 0.5f; - _contentView1.AddVisual("icon_visual1", _icon); - - contentLayout.AddChild(_contentView1, new TableView.CellPosition(0, 0)); - - _shadowButton1 = new PushButton(); - _shadowButton1.LabelText = "Toggle Transition Position"; - _shadowButton1.Name = ("ToggleTransition"); - _shadowButton1.ParentOrigin = ParentOrigin.Center; - _shadowButton1.PivotPoint = PivotPoint.Center; - _shadowButton1.Clicked += (obj, ev) => - { - _active1 = !_active1; - StartTransition(_contentView1, _icon, "Position", _active1); - return true; - }; - _shadowButton1.WidthResizePolicy = ResizePolicyType.FillToParent; - _shadowButton1.HeightResizePolicy = ResizePolicyType.FillToParent; - contentLayout.AddChild(_shadowButton1, new TableView.CellPosition(0, 1)); - - ////////////////////////////////////////////////////////////////////// - // make visual opacity animation - _contentView2 = new VisualView(); - _contentView2.WidthResizePolicy = ResizePolicyType.SizeRelativeToParent; - _contentView2.HeightResizePolicy = ResizePolicyType.SizeRelativeToParent; - //_contentView.Size2D = new Size2D(250, 250); - _contentView2.BackgroundImage = _resPath + "/images/background-blocks.jpg"; - - ImageVisual _icon2 = new ImageVisual(); - _icon2.URL = _resPath + "/images/application-icon-0.png"; - _icon2.DepthIndex = 1; - _icon2.Size = new Size2D(50, 50); - _icon2.SizePolicy = VisualTransformPolicyType.Absolute; - _icon2.Position = new Position2D(5, 5); - _icon2.PositionPolicy = VisualTransformPolicyType.Absolute; - _icon2.Origin = Visual.AlignType.TopBegin; - _icon2.AnchorPoint = Visual.AlignType.TopBegin; - _icon2.MixColor = new Color(0, 1, 0, 0.5f); - _icon2.Opacity = 0.5f; - _contentView2.AddVisual("icon_visual2", _icon2); - - contentLayout.AddChild(_contentView2, new TableView.CellPosition(1, 0)); - - _shadowButton2 = new PushButton(); - _shadowButton2.LabelText = "Toggle Transition Opacity"; - _shadowButton2.Name = ("ToggleTransition"); - _shadowButton2.ParentOrigin = ParentOrigin.Center; - _shadowButton2.PivotPoint = PivotPoint.Center; - _shadowButton2.Clicked += (obj, ev) => - { - _active2 = !_active2; - StartTransition(_contentView2, _icon2, "Opacity", _active2); - return true; - }; - _shadowButton2.WidthResizePolicy = ResizePolicyType.FillToParent; - _shadowButton2.HeightResizePolicy = ResizePolicyType.FillToParent; - contentLayout.AddChild(_shadowButton2, new TableView.CellPosition(1, 1)); - - ////////////////////////////////////////////////////////////////////// - // make AnimatedImage visual test - _contentView3 = new VisualView(); - _contentView3.WidthResizePolicy = ResizePolicyType.SizeRelativeToParent; - _contentView3.HeightResizePolicy = ResizePolicyType.SizeRelativeToParent; - //_contentView.Size2D = new Size2D(250, 250); - _contentView3.BackgroundImage = _resPath + "/images/background-blocks.jpg"; - - ImageVisual _icon3 = new ImageVisual(); - _icon3.URL = _resPath + "/images/application-icon-0.png"; - _icon3.DepthIndex = 1; - _icon3.Size = new Size2D(50, 50); - _icon3.SizePolicy = VisualTransformPolicyType.Absolute; - _icon3.Position = new Position2D(5, 5); - _icon3.PositionPolicy = VisualTransformPolicyType.Absolute; - _icon3.Origin = Visual.AlignType.TopBegin; - _icon3.AnchorPoint = Visual.AlignType.TopBegin; - _icon3.MixColor = new Color(0, 1, 0, 0.5f); - _icon3.Opacity = 0.5f; - _contentView3.AddVisual("icon_visual3", _icon3); - - contentLayout.AddChild(_contentView3, new TableView.CellPosition(2, 0)); - - _shadowButton3 = new PushButton(); - _shadowButton3.LabelText = "Toggle Transition MixColor"; - _shadowButton3.Name = ("ToggleTransition"); - _shadowButton3.ParentOrigin = ParentOrigin.Center; - _shadowButton3.PivotPoint = PivotPoint.Center; - _shadowButton3.Clicked += (obj, ev) => - { - _active3 = !_active3; - StartTransition(_contentView3, _icon3, "MixColor", _active3); - return true; - }; - _shadowButton3.WidthResizePolicy = ResizePolicyType.FillToParent; - _shadowButton3.HeightResizePolicy = ResizePolicyType.FillToParent; - contentLayout.AddChild(_shadowButton3, new TableView.CellPosition(2, 1)); - } - - private void StartTransition(VisualView view, VisualMap target, string property, bool activate) - { - if (_animation) - { - _animation.Stop(); - _animation.Finished += OnTransitionFinished; - } - - if (activate) - { - if (property == "Position") - { - _animation = view.AnimateVisual(target, property, new Position2D(20, 20), 0, 1000, AlphaFunction.BuiltinFunctions.Linear, new Position2D(40, 40)); - } - else if (property == "Opacity") - { - _animation = view.AnimateVisual(target, property, 0.0f, 0, 1000, AlphaFunction.BuiltinFunctions.Linear); - } - else if (property == "MixColor") - { - _animation = view.AnimateVisual(target, property, Color.Green, 0, 1000, AlphaFunction.BuiltinFunctions.Linear); - } - } - else - { - if (property == "Position") - { - _animation = view.AnimateVisual(target, property, new Position2D(5, 5), 0, 1000); - } - else if (property == "Opacity") - { - _animation = view.AnimateVisual(target, property, 1.0f, 0, 1000); - } - else if (property == "MixColor") - { - _animation = view.AnimateVisual(target, property, Color.Red, 0, 1000); - } - } - - if (_animation) - { - _animation.Finished += OnTransitionFinished; - _transitionInProgress = true; - _animation.Play(); - } - } - private void OnTransitionFinished(object sender, EventArgs e) - { - _transitionInProgress = false; - if (_animation) - { - _animation.Finished += OnTransitionFinished; - _animation.Reset(); - } - } - - - /// - /// The main entry point for the application. - /// - [STAThread] - static void _Main(string[] args) - { - Example example = new Example(); - example.Run(args); - } - - - } -} diff --git a/NUIsamples/NUIsamples/src/examples/visual-animation-test3.cs b/NUIsamples/NUIsamples/src/examples/visual-animation-test3.cs deleted file mode 100755 index f356c54a3..000000000 --- a/NUIsamples/NUIsamples/src/examples/visual-animation-test3.cs +++ /dev/null @@ -1,233 +0,0 @@ -/* - * Copyright (c) 2017 Samsung Electronics Co., Ltd. - * - * 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; -using Tizen.NUI; -using Tizen.NUI.UIComponents; -using Tizen.NUI.BaseComponents; -using Tizen.NUI.Constants; - -namespace VisaulAnimationExample -{ - class Example3 : NUIApplication - { - private VisualView _contentView1; - private VisualView _contentView2; - private VisualView _contentView3; - private TextLabel _title; - private PushButton _shadowButton1; - private PushButton _shadowButton2; - private PushButton _shadowButton3; - private bool _active1 = false; - private bool _active2 = false; - private bool _active3 = false; - //private const string _resPath = "/home/owner/apps_rw/NUISamples.TizenTV/res"; - private const string _resPath = "./res"; //for ubuntu - - private Animation _animation; - private ImageVisual _icon; - private ImageVisual _icon2; - private ImageVisual _icon3; - private ImageVisual _icon4; - private bool _transitionInProgress = false; - - public Example3() : base() - { - } - - public Example3(string stylesheet) : base(stylesheet) - { - } - - public Example3(string stylesheet, WindowMode windowMode) : base(stylesheet, windowMode) - { - } - - protected override void OnCreate() - { - base.OnCreate(); - Initialize(); - } - - public void Initialize() - { - Window window = Window.Instance; - window.BackgroundColor = Color.White; - - TableView titleLayout = new TableView(2, 1); - titleLayout.Name = ("TitleLayout"); - titleLayout.PivotPoint = PivotPoint.TopLeft; - titleLayout.Position2D = new Position2D(10, 10); - titleLayout.Size2D = new Size2D((int)(window.Size.Width * 0.9f), (int)(window.Size.Height * 0.9f)); - titleLayout.SetCellPadding(new Size2D(10, 10)); - titleLayout.BackgroundColor = Color.Cyan; - window.Add(titleLayout); - - _title = new TextLabel("Visual Transition Example"); - _title.Name = ("Title"); - _title.SetStyleName("Title"); - _title.WidthResizePolicy = ResizePolicyType.FillToParent; - _title.HeightResizePolicy = ResizePolicyType.UseNaturalSize; - _title.HorizontalAlignment = HorizontalAlignment.Center; - titleLayout.AddChild(_title, new TableView.CellPosition(0, 0)); - titleLayout.SetFitHeight(0); - - TableView contentLayout = new TableView(2, 1); - contentLayout.Name = ("ContentLayout"); - contentLayout.WidthResizePolicy = ResizePolicyType.FillToParent; - contentLayout.HeightResizePolicy = ResizePolicyType.FillToParent; - contentLayout.PivotPoint = PivotPoint.TopLeft; - contentLayout.SetCellPadding(new Size2D(10, 10)); - contentLayout.BackgroundColor = Color.Magenta; - titleLayout.AddChild(contentLayout, new TableView.CellPosition(1, 0)); - - // make visual position animation - _contentView1 = new VisualView(); - _contentView1.WidthResizePolicy = ResizePolicyType.SizeRelativeToParent; - _contentView1.HeightResizePolicy = ResizePolicyType.SizeRelativeToParent; - //_contentView.Size2D = new Size2D(250, 250); - _contentView1.BackgroundImage = _resPath + "/images/background-blocks.jpg"; - - _icon = new ImageVisual(); - _icon.URL = _resPath + "/images/application-icon-0.png"; - _icon.DepthIndex = 1; - _icon.Size = new Size2D(50, 50); - _icon.SizePolicy = VisualTransformPolicyType.Absolute; - _icon.Position = new Position2D(5, 5); - _icon.PositionPolicy = VisualTransformPolicyType.Absolute; - _icon.Origin = Visual.AlignType.TopBegin; - _icon.AnchorPoint = Visual.AlignType.TopBegin; - _icon.MixColor = new Color(0, 1, 0, 0.5f); - _icon.Opacity = 0.5f; - _contentView1.AddVisual("icon_visual1", _icon); - - _icon2 = new ImageVisual(); - _icon2.URL = _resPath + "/images/application-icon-0.png"; - _icon2.DepthIndex = 1; - _icon2.Size = new Size2D(50, 50); - _icon2.SizePolicy = VisualTransformPolicyType.Absolute; - _icon2.Position = new Position2D(200, 5); - _icon2.PositionPolicy = VisualTransformPolicyType.Absolute; - _icon2.Origin = Visual.AlignType.TopBegin; - _icon2.AnchorPoint = Visual.AlignType.TopBegin; - _icon2.MixColor = new Color(0, 1, 0, 0.5f); - _icon2.Opacity = 0.5f; - _contentView1.AddVisual("icon_visual2", _icon2); - - _icon3 = new ImageVisual(); - _icon3.URL = _resPath + "/images/application-icon-0.png"; - _icon3.DepthIndex = 1; - _icon3.Size = new Size2D(50, 50); - _icon3.SizePolicy = VisualTransformPolicyType.Absolute; - _icon3.Position = new Position2D(5, 200); - _icon3.PositionPolicy = VisualTransformPolicyType.Absolute; - _icon3.Origin = Visual.AlignType.TopBegin; - _icon3.AnchorPoint = Visual.AlignType.TopBegin; - _icon3.MixColor = new Color(0, 1, 0, 0.5f); - _icon3.Opacity = 0.5f; - _contentView1.AddVisual("icon_visual3", _icon3); - - _icon4 = new ImageVisual(); - _icon4.URL = _resPath + "/images/application-icon-0.png"; - _icon4.DepthIndex = 1; - _icon4.Size = new Size2D(50, 50); - _icon4.SizePolicy = VisualTransformPolicyType.Absolute; - _icon4.Position = new Position2D(200, 200); - _icon4.PositionPolicy = VisualTransformPolicyType.Absolute; - _icon4.Origin = Visual.AlignType.TopBegin; - _icon4.AnchorPoint = Visual.AlignType.TopBegin; - _icon4.MixColor = new Color(0, 1, 0, 0.5f); - _icon4.Opacity = 0.5f; - _contentView1.AddVisual("icon_visual4", _icon4); - - contentLayout.AddChild(_contentView1, new TableView.CellPosition(0, 0)); - - _shadowButton1 = new PushButton(); - _shadowButton1.LabelText = "Toggle Transition Position"; - _shadowButton1.Name = ("ToggleTransition"); - _shadowButton1.ParentOrigin = ParentOrigin.Center; - _shadowButton1.PivotPoint = PivotPoint.Center; - _shadowButton1.Clicked += (obj, ev) => - { - _active1 = !_active1; - StartTransition(_contentView1, _active1); - return true; - }; - _shadowButton1.WidthResizePolicy = ResizePolicyType.FillToParent; - _shadowButton1.HeightResizePolicy = ResizePolicyType.UseNaturalSize; - contentLayout.AddChild(_shadowButton1, new TableView.CellPosition(1, 0)); - contentLayout.SetFitHeight(1); - } - - private void StartTransition(VisualView view, bool activate) - { - if (_animation) - { - _animation.Stop(); - _animation.Finished += OnTransitionFinished; - } - - if (activate) - { - view.AnimateVisualAdd(_icon, "Position", new Position2D(80, 80), 0, 2000, AlphaFunction.BuiltinFunctions.Linear, new Position2D(5, 5)); - view.AnimateVisualAdd(_icon2, "Opacity", 0.0f, 0, 2000, AlphaFunction.BuiltinFunctions.Linear); - view.AnimateVisualAdd(_icon3, "MixColor", Color.Green, 0, 2000, AlphaFunction.BuiltinFunctions.Linear); - view.AnimateVisualAdd(_icon4, "Size", new Size2D(150, 150), 0, 2000, AlphaFunction.BuiltinFunctions.Linear); - _animation = view.AnimateVisualAddFinish(); - } - else - { - view.AnimateVisualAdd(_icon, "Position", new Position2D(5, 5), 0, 2000, AlphaFunction.BuiltinFunctions.Linear, new Position2D(80, 80)); - view.AnimateVisualAdd(_icon2, "Opacity", 1.0f, 0, 2000); - view.AnimateVisualAdd(_icon3, "MixColor", Color.Red, 0, 2000); - view.AnimateVisualAdd(_icon4, "Size", new Size2D(50, 50), 0, 2000, AlphaFunction.BuiltinFunctions.Linear); - _animation = view.AnimateVisualAddFinish(); - } - - if (_animation) - { - _animation.Finished += OnTransitionFinished; - _animation.EndAction = Animation.EndActions.StopFinal; - _transitionInProgress = true; - _animation.Play(); - } - } - - private void OnTransitionFinished(object sender, EventArgs e) - { - _transitionInProgress = false; - if (_animation) - { - _animation.Finished += OnTransitionFinished; - _animation.Reset(); - } - } - - /// - /// The main entry point for the application. - /// - [STAThread] - static void _Main(string[] args) - { - Example3 example = new Example3(); - example.Run(args); - } - - - } -} diff --git a/NUIsamples/NUIsamples/src/examples/visual-view-test.cs b/NUIsamples/NUIsamples/src/examples/visual-view-test.cs deleted file mode 100755 index 6c199d3ab..000000000 --- a/NUIsamples/NUIsamples/src/examples/visual-view-test.cs +++ /dev/null @@ -1,297 +0,0 @@ -/* - * Copyright (c) 2017 Samsung Electronics Co., Ltd. - * - * 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; -using Tizen.NUI; -using Tizen.NUI.BaseComponents; -using Tizen.NUI.Constants; - -namespace VisualViewTest -{ - // An example of Visual View control. - class Example : NUIApplication - { - private VisualView _visualView = null; - private const string resources = "/home/owner/apps_rw/NUISamples.TizenTV/res"; - private Window _window; - - public Example() : base() - { - } - - public Example(string stylesheet) : base(stylesheet) - { - } - - public Example(string stylesheet, WindowMode windowMode) : base(stylesheet, windowMode) - { - } - - protected override void OnCreate() - { - base.OnCreate(); - Initialize(); - } - - private ImageVisual imageVisualMap1; - private TextVisual textVisualMap1; - private NPatchVisual npatchImageVisualMap1; - private BorderVisual borderVisualMap1; - private int cnt; - - public void Initialize() - { - Window window = Window.Instance; - - /* Create a visual view. */ - _visualView = new VisualView(); - _visualView.ParentOrigin = ParentOrigin.TopLeft; - _visualView.PivotPoint = PivotPoint.TopLeft; - _visualView.Size2D = new Size2D((int)window.Size.Width, (int)window.Size.Height); - - /* color visual */ - ColorVisual colorVisualMap1 = new ColorVisual(); - colorVisualMap1.Color = Color.Green; - _visualView.Background = colorVisualMap1.OutputVisualMap; - - window.Add(_visualView); - - /* image visual 1. */ - imageVisualMap1 = new ImageVisual(); - imageVisualMap1.URL = resources + "/images/image-1.jpg"; - imageVisualMap1.Size = new Vector2(200.0f, 200.0f); - imageVisualMap1.Position = new Vector2(10.0f, 10.0f); - imageVisualMap1.PositionPolicy = VisualTransformPolicyType.Absolute; - Console.WriteLine("PositionPolicy:{0}",imageVisualMap1.PositionPolicy); - imageVisualMap1.SizePolicy = VisualTransformPolicyType.Absolute; - Console.WriteLine("SizePolicy:{0}",imageVisualMap1.SizePolicy); - imageVisualMap1.Origin = Visual.AlignType.TopBegin; - imageVisualMap1.AnchorPoint = Visual.AlignType.TopBegin; - _visualView.AddVisual("imageVisual1", imageVisualMap1); - imageVisualMap1.URL = resources + "/images/image-3.jpg"; - - /* image visual 2. */ - ImageVisual imageVisualMap2 = new ImageVisual(); - imageVisualMap2.URL = resources + "/images/image-2.jpg"; - imageVisualMap2.Size = new Vector2(250.0f, 200.0f); - imageVisualMap2.Position = new Vector2(220.0f, 10.0f); - imageVisualMap2.PositionPolicy = VisualTransformPolicyType.Absolute; - imageVisualMap2.SizePolicy = VisualTransformPolicyType.Absolute; - imageVisualMap2.Origin = Visual.AlignType.TopBegin; - imageVisualMap2.AnchorPoint = Visual.AlignType.TopBegin; - _visualView.AddVisual("imageVisual2", imageVisualMap2); - - /* text visual. */ - textVisualMap1 = new TextVisual(); - textVisualMap1.Text = "Hello Goodbye"; - textVisualMap1.PointSize = 20.0f; - - textVisualMap1.Size = new Vector2(900.0f, 250.0f); - textVisualMap1.Position = new Vector2(10.0f, 220.0f); - textVisualMap1.PositionPolicy = VisualTransformPolicyType.Absolute; - textVisualMap1.SizePolicy = VisualTransformPolicyType.Absolute; - textVisualMap1.Origin = Visual.AlignType.TopBegin; - textVisualMap1.AnchorPoint = Visual.AlignType.TopBegin; - _visualView.AddVisual("textVisual1", textVisualMap1); - - /* border visual */ - borderVisualMap1 = new BorderVisual(); - borderVisualMap1.Color = Color.Red; - borderVisualMap1.BorderSize = 5.0f; - - borderVisualMap1.Size = new Vector2(100.0f, 100.0f); - borderVisualMap1.Position = new Vector2(10.0f, 380.0f); - borderVisualMap1.PositionPolicy = VisualTransformPolicyType.Absolute; - borderVisualMap1.SizePolicy = VisualTransformPolicyType.Absolute; - borderVisualMap1.Origin = Visual.AlignType.TopBegin; - borderVisualMap1.AnchorPoint = Visual.AlignType.TopBegin; - _visualView.AddVisual("borderVisual1", borderVisualMap1); - - /* gradient visual */ - GradientVisual gradientVisualMap1 = new GradientVisual(); - PropertyArray stopPosition = new PropertyArray(); - stopPosition.Add(new PropertyValue(0.0f)); - stopPosition.Add(new PropertyValue(0.3f)); - stopPosition.Add(new PropertyValue(0.6f)); - stopPosition.Add(new PropertyValue(0.8f)); - stopPosition.Add(new PropertyValue(1.0f)); - gradientVisualMap1.StopOffset = stopPosition; - PropertyArray stopColor = new PropertyArray(); - stopColor.Add(new PropertyValue(new Vector4(129.0f, 198.0f, 193.0f, 255.0f) / 255.0f)); - stopColor.Add(new PropertyValue(new Vector4(196.0f, 198.0f, 71.0f, 122.0f) / 255.0f)); - stopColor.Add(new PropertyValue(new Vector4(214.0f, 37.0f, 139.0f, 191.0f) / 255.0f)); - stopColor.Add(new PropertyValue(new Vector4(129.0f, 198.0f, 193.0f, 150.0f) / 255.0f)); - stopColor.Add(new PropertyValue(Color.Yellow)); - gradientVisualMap1.StopColor = stopColor; - gradientVisualMap1.StartPosition = new Vector2(0.5f, 0.5f); - gradientVisualMap1.EndPosition = new Vector2(-0.5f, -0.5f); - gradientVisualMap1.Center = new Vector2(0.5f, 0.5f); - gradientVisualMap1.Radius = 1.414f; - - gradientVisualMap1.Size = new Vector2(100.0f, 100.0f); - gradientVisualMap1.Position = new Vector2(120.0f, 380.0f); - gradientVisualMap1.PositionPolicy = VisualTransformPolicyType.Absolute; - gradientVisualMap1.SizePolicy = VisualTransformPolicyType.Absolute; - gradientVisualMap1.Origin = Visual.AlignType.TopBegin; - gradientVisualMap1.AnchorPoint = Visual.AlignType.TopBegin; - _visualView.AddVisual("gradientVisual1", gradientVisualMap1); - - /* primitive visual: Cone */ - PrimitiveVisual primitiveVisualMap1 = new PrimitiveVisual(); - primitiveVisualMap1.Shape = PrimitiveVisualShapeType.Cone; - primitiveVisualMap1.BevelPercentage = 0.3f; - primitiveVisualMap1.BevelSmoothness = 0.0f; - primitiveVisualMap1.ScaleDimensions = new Vector3(1.0f, 1.0f, 0.3f); - primitiveVisualMap1.MixColor = new Vector4((245.0f / 255.0f), (188.0f / 255.0f), (73.0f / 255.0f), 1.0f); - - primitiveVisualMap1.Size = new Vector2(100.0f, 100.0f); - primitiveVisualMap1.Position = new Vector2(230.0f, 380.0f); - primitiveVisualMap1.PositionPolicy = VisualTransformPolicyType.Absolute; - primitiveVisualMap1.SizePolicy = VisualTransformPolicyType.Absolute; - primitiveVisualMap1.Origin = Visual.AlignType.TopBegin; - primitiveVisualMap1.AnchorPoint = Visual.AlignType.TopBegin; - _visualView.AddVisual("primitiveVisual1", primitiveVisualMap1); - - /* primitive visual: Sphere */ - PrimitiveVisual primitiveVisualMap2 = new PrimitiveVisual(); - primitiveVisualMap2.Shape = PrimitiveVisualShapeType.Sphere; - primitiveVisualMap2.BevelPercentage = 0.3f; - primitiveVisualMap2.BevelSmoothness = 0.0f; - primitiveVisualMap2.ScaleDimensions = new Vector3(1.0f, 1.0f, 0.3f); - primitiveVisualMap2.MixColor = new Vector4((245.0f / 255.0f), (188.0f / 255.0f), (73.0f / 255.0f), 1.0f); - - primitiveVisualMap2.Size = new Vector2(100.0f, 100.0f); - primitiveVisualMap2.Position = new Vector2(340.0f, 380.0f); - primitiveVisualMap2.PositionPolicy = VisualTransformPolicyType.Absolute; - primitiveVisualMap2.SizePolicy = VisualTransformPolicyType.Absolute; - primitiveVisualMap2.Origin = Visual.AlignType.TopBegin; - primitiveVisualMap2.AnchorPoint = Visual.AlignType.TopBegin; - _visualView.AddVisual("primitiveVisual2", primitiveVisualMap2); - - /* primitive visual: Cylinder */ - PrimitiveVisual primitiveVisualMap3 = new PrimitiveVisual(); - primitiveVisualMap3.Shape = PrimitiveVisualShapeType.Cylinder; - primitiveVisualMap3.BevelPercentage = 0.3f; - primitiveVisualMap3.BevelSmoothness = 0.0f; - primitiveVisualMap3.ScaleDimensions = new Vector3(1.0f, 1.0f, 0.3f); - primitiveVisualMap3.MixColor = new Vector4((245.0f / 255.0f), (188.0f / 255.0f), (73.0f / 255.0f), 1.0f); - - primitiveVisualMap3.Size = new Vector2(100.0f, 100.0f); - primitiveVisualMap3.Position = new Vector2(10.0f, 490.0f); - primitiveVisualMap3.PositionPolicy = VisualTransformPolicyType.Absolute; - primitiveVisualMap3.SizePolicy = VisualTransformPolicyType.Absolute; - primitiveVisualMap3.Origin = Visual.AlignType.TopBegin; - primitiveVisualMap3.AnchorPoint = Visual.AlignType.TopBegin; - _visualView.AddVisual("primitiveVisual3", primitiveVisualMap3); - - /* primitive visual: ConicalFrustrum */ - PrimitiveVisual primitiveVisualMap4 = new PrimitiveVisual(); - primitiveVisualMap4.Shape = PrimitiveVisualShapeType.ConicalFrustrum; - primitiveVisualMap4.BevelPercentage = 0.3f; - primitiveVisualMap4.BevelSmoothness = 0.0f; - primitiveVisualMap4.ScaleDimensions = new Vector3(1.0f, 1.0f, 0.3f); - primitiveVisualMap4.MixColor = new Vector4((245.0f / 255.0f), (188.0f / 255.0f), (73.0f / 255.0f), 1.0f); - - primitiveVisualMap4.Size = new Vector2(100.0f, 100.0f); - primitiveVisualMap4.Position = new Vector2(120.0f, 490.0f); - primitiveVisualMap4.PositionPolicy = VisualTransformPolicyType.Absolute; - primitiveVisualMap4.SizePolicy = VisualTransformPolicyType.Absolute; - primitiveVisualMap4.Origin = Visual.AlignType.TopBegin; - primitiveVisualMap4.AnchorPoint = Visual.AlignType.TopBegin; - _visualView.AddVisual("primitiveVisual4", primitiveVisualMap4); - - /* primitive visual: Cube */ - PrimitiveVisual primitiveVisualMap5 = new PrimitiveVisual(); - primitiveVisualMap5.Shape = PrimitiveVisualShapeType.Cube; - primitiveVisualMap5.BevelPercentage = 0.3f; - primitiveVisualMap5.BevelSmoothness = 0.0f; - primitiveVisualMap5.ScaleDimensions = new Vector3(1.0f, 1.0f, 0.3f); - primitiveVisualMap5.MixColor = new Vector4((245.0f / 255.0f), (188.0f / 255.0f), (73.0f / 255.0f), 1.0f); - - primitiveVisualMap5.Size = new Vector2(100.0f, 100.0f); - primitiveVisualMap5.Position = new Vector2(230.0f, 490.0f); - primitiveVisualMap5.PositionPolicy = VisualTransformPolicyType.Absolute; - primitiveVisualMap5.SizePolicy = VisualTransformPolicyType.Absolute; - primitiveVisualMap5.Origin = Visual.AlignType.TopBegin; - primitiveVisualMap5.AnchorPoint = Visual.AlignType.TopBegin; - _visualView.AddVisual("primitiveVisual5", primitiveVisualMap5); - - /* mesh visual nothing show. */ - MeshVisual meshVisualMap1 = new MeshVisual(); - meshVisualMap1.ObjectURL = resources + "/models/Dino.obj"; - meshVisualMap1.MaterialtURL = resources + "/models/Dino.mtl"; - meshVisualMap1.TexturesPath = resources + "/images/"; - meshVisualMap1.ShadingMode = MeshVisualShadingModeValue.TexturedWithSpecularLighting; - - meshVisualMap1.Size = new Size2D(400, 400); - meshVisualMap1.Position = new Position2D(-50, 600); - meshVisualMap1.PositionPolicy = VisualTransformPolicyType.Absolute; - meshVisualMap1.SizePolicy = VisualTransformPolicyType.Absolute; - meshVisualMap1.Origin = Visual.AlignType.TopBegin; - meshVisualMap1.AnchorPoint = Visual.AlignType.TopBegin; - _visualView.AddVisual("meshVisual1", meshVisualMap1); - - /* n-patch image visual 1. */ - npatchImageVisualMap1 = new NPatchVisual(); - npatchImageVisualMap1.URL = resources + "/images/gallery-4.jpg"; - npatchImageVisualMap1.Size = new Size2D(400, 400); - npatchImageVisualMap1.Position = new Position2D(300, 600); - npatchImageVisualMap1.PositionPolicyX = VisualTransformPolicyType.Absolute; - npatchImageVisualMap1.PositionPolicyY = VisualTransformPolicyType.Absolute; - npatchImageVisualMap1.SizePolicyWidth = VisualTransformPolicyType.Absolute; - npatchImageVisualMap1.SizePolicyHeight = VisualTransformPolicyType.Absolute; - npatchImageVisualMap1.Origin = Visual.AlignType.TopBegin; - npatchImageVisualMap1.AnchorPoint = Visual.AlignType.TopBegin; - npatchImageVisualMap1.Border = new Rectangle(100, 100, 100, 100); - _visualView.AddVisual("npatchImageVisual1", npatchImageVisualMap1); - - _window = Window.Instance; - _window.FocusChanged += (sender, ee) => - { - cnt++; - Tizen.Log.Debug("NUI", "[WindowFocusTest] WindowFocusChanged event comes! focus gained=" + ee.FocusGained); - imageVisualMap1.Size += new Size2D(50, 50); - imageVisualMap1.Position += new Vector2(20.0f, 20.0f); - - textVisualMap1.Text = "Hello Goodbye" + cnt; - textVisualMap1.PointSize = 10.0f + (float)(cnt); - - npatchImageVisualMap1.URL = resources + "/images/gallery-" + (cnt % 5) + ".jpg"; - - borderVisualMap1.BorderSize = 1.0f + (float)cnt; - }; - - Tizen.Log.Debug("NUI", "[WindowFocusTest] is focus acceptable=" + _window.IsFocusAcceptable()); - _window.SetAcceptFocus(false); - Tizen.Log.Debug("NUI", "[WindowFocusTest] set focus acceptable=false!!!"); - Tizen.Log.Debug("NUI", "[WindowFocusTest] is focus acceptable=" + _window.IsFocusAcceptable()); - _window.SetAcceptFocus(true); - Tizen.Log.Debug("NUI", "[WindowFocusTest] set focus acceptable=true!!!"); - Tizen.Log.Debug("NUI", "[WindowFocusTest] is focus acceptable=" + _window.IsFocusAcceptable()); - - - } - - [STAThread] - static void _Main(string[] args) - { - Example example = new Example(); - example.Run(args); - } - } -} \ No newline at end of file diff --git a/NUIsamples/NUIsamples/src/examples/visual-view-test2.cs b/NUIsamples/NUIsamples/src/examples/visual-view-test2.cs deleted file mode 100755 index 659e9ba0b..000000000 --- a/NUIsamples/NUIsamples/src/examples/visual-view-test2.cs +++ /dev/null @@ -1,289 +0,0 @@ -using System; -using Tizen.NUI; -using Tizen.NUI.UIComponents; -using Tizen.NUI.BaseComponents; - -namespace VisualViewTest2 -{ - public class VisualSample : NUIApplication - { - const int num = 2; - VisualView[] view; - - TextLabel guide; - ImageVisual imageMap; - ImageVisual imageMap2; - - ImageVisual highlightImageMap; - ImageVisual dimImageMap; - - TextVisual textMap1; - TextVisual textMap2; - - Window _window; - - int imgIndex; - - readonly string resourcePath = "/home/owner/apps_rw/NUISamples.TizenTV/res/images/"; - - protected override void OnCreate() - { - base.OnCreate(); - - view = new VisualView[2]; - - for (int i = 0; i < num; i++) - { - view[i] = new VisualView(); - view[i].Size2D = new Size2D(600, 600); - view[i].BackgroundColor = Color.Blue; - view[i].Position = new Position(400 + i * 800, 600, 0); - view[i].Focusable = true; - view[i].Name = "MyView" + i; - Window.Instance.Add(view[i]); - view[i].FocusGained += VisualSample_FocusGained; - view[i].FocusLost += VisualSample_FocusLost; - view[i].KeyEvent += VisualSample_KeyEvent; - } - - view[0].RightFocusableView = view[1]; - view[1].LeftFocusableView = view[0]; - - imageMap = new ImageVisual(); - imageMap.URL = resourcePath + "gallery-" + imgIndex++ + ".jpg"; - imageMap.AnchorPoint = Visual.AlignType.TopBegin; - imageMap.Origin = Visual.AlignType.TopBegin; - imageMap.Position = new Vector2(0, 0); - imageMap.PositionPolicy = VisualTransformPolicyType.Absolute; - imageMap.Size = new Size2D(500, 500); - imageMap.SizePolicy = VisualTransformPolicyType.Absolute; - imageMap.DepthIndex = 0; - view[0].AddVisual("bgVisual", imageMap); - - - highlightImageMap = new ImageVisual(); - highlightImageMap.URL = resourcePath + "star-highlight.png"; - highlightImageMap.AnchorPoint = Visual.AlignType.TopBegin; - highlightImageMap.Origin = Visual.AlignType.TopBegin; - highlightImageMap.Size = new Vector2(40, 40); - highlightImageMap.SizePolicy = VisualTransformPolicyType.Absolute; - highlightImageMap.Position = new Vector2(10, 10); - highlightImageMap.PositionPolicy = VisualTransformPolicyType.Absolute; - highlightImageMap.DepthIndex = 1; - view[0].AddVisual("iconVisual", highlightImageMap); - - - textMap1 = new TextVisual(); - textMap1.Text = "Hello"; - textMap1.AnchorPoint = Visual.AlignType.TopBegin; - textMap1.Origin = Visual.AlignType.TopBegin; - textMap1.PointSize = 20; - textMap1.Position = new Vector2(60, 210); - textMap1.PositionPolicy = VisualTransformPolicyType.Absolute; - textMap1.Size = new Vector2(600, 200); - textMap1.SizePolicy = VisualTransformPolicyType.Absolute; - textMap1.TextColor = Color.Red; - textMap1.DepthIndex = 5; - view[0].AddVisual("textVisual", textMap1); - - - - imageMap2 = new ImageVisual(); - imageMap2.URL = resourcePath + "gallery-" + imgIndex + ".jpg"; - imageMap2.AnchorPoint = Visual.AlignType.TopBegin; - imageMap2.Origin = Visual.AlignType.TopBegin; - imageMap2.Position = new Vector2(0, 0); - imageMap2.PositionPolicy = VisualTransformPolicyType.Absolute; - imageMap2.Size = new Vector2(500, 500); - imageMap2.SizePolicy = VisualTransformPolicyType.Absolute; - imageMap2.DepthIndex = 0; - view[1].AddVisual("bgVisual", imageMap2); - - dimImageMap = new ImageVisual(); - dimImageMap.URL = resourcePath + "star-dim.png"; - dimImageMap.Size = new Vector2(40, 40); - dimImageMap.SizePolicy = VisualTransformPolicyType.Absolute; - dimImageMap.AnchorPoint = Visual.AlignType.TopBegin; - dimImageMap.Origin = Visual.AlignType.TopBegin; - dimImageMap.Position = new Vector2(10, 10); - dimImageMap.PositionPolicy = VisualTransformPolicyType.Absolute; - dimImageMap.DepthIndex = 1; - view[1].AddVisual("iconVisual", dimImageMap); - - textMap2 = new TextVisual(); - textMap2.Text = "I'm"; - textMap2.PointSize = 20; - textMap2.AnchorPoint = Visual.AlignType.TopBegin; - textMap2.Origin = Visual.AlignType.TopBegin; - textMap2.Position = new Vector2(60, 210); - textMap2.PositionPolicy = VisualTransformPolicyType.Absolute; - textMap2.Size = new Vector2(600, 200); - textMap2.SizePolicy = VisualTransformPolicyType.Absolute; - textMap2.TextColor = Color.Black; - textMap2.DepthIndex = 5; - view[1].AddVisual("textVisual", textMap2); - - - guide = new TextLabel(); - guide.PivotPoint = PivotPoint.TopLeft; - guide.Size2D = new Size2D(800, 200); - guide.Padding = new Vector4(50, 50, 50, 50); - guide.MultiLine = true; - guide.BackgroundColor = Color.Magenta; - guide.PointSize = 10; - guide.TextColor = Color.Black; - guide.Text = "Left/Right - Move focus\n" + - "Up/Down - Change Text\n" + - "Enter - Change BG image\n"; - Window.Instance.Add(guide); - - Window.Instance.KeyEvent += Instance_Key; - FocusManager.Instance.SetCurrentFocusView(view[0]); - Window.Instance.TouchEvent += Instance_Touch; - _window = Window.Instance; - _window.FocusChanged += _window_WindowFocusChanged; - - } - - private void _window_WindowFocusChanged(object sender, Window.FocusChangedEventArgs e) - { - Tizen.Log.Fatal("NUI", "window focus changed!() focus gained=" + e.FocusGained); - } - - private void Instance_Touch(object sender, Window.TouchEventArgs e) - { - FocusManager.Instance.SetCurrentFocusView(view[0]); - } - - private bool VisualSample_KeyEvent(object source, View.KeyEventArgs e) - { - Tizen.Log.Fatal("NUI", "View_KeyEvent" + e.Key.State.ToString() + ", Pressed-" + e.Key.KeyPressedName); - - if (e.Key.State == Key.StateType.Down) - { - if (source.Equals(view[0])) - { - if (e.Key.KeyPressedName == "Up") - { - textMap1.PointSize = 14; - textMap1.TextColor = Color.Red; - textMap1.Text = "Hello NY!"; - //this.VersionCheckTest(); - /* - DALI_KEY_VOLUME_UP = 200, ///< Volume up key @SINCE_1_0.0 - DALI_KEY_VOLUME_DOWN = 201, ///< Volume down key @SINCE_1_0.0 - */ - try - { - Tizen.Log.Fatal("NUI", "GrabKeyTopmost (200==vol up) ret=" + _window.GrabKeyTopmost(200)); - } - catch (Exception except) - { - Tizen.Log.Fatal("NUI", "Exception!!! GrabKeyTopmost (200==vol up) msg=" + except.Message); - } - - } - else if (e.Key.KeyPressedName == "Down") - { - textMap1.PointSize = 17; - textMap1.TextColor = Color.Blue; - textMap1.Text = "Goodbye NY."; - - Tizen.Log.Fatal("NUI", "UngrabKeyTopmost (200==vol up) ret=" + _window.UngrabKeyTopmost(200)); - - } - else if (e.Key.KeyPressedName == "Return") - { - imgIndex = (imgIndex + 1) % 6; - imageMap.URL = resourcePath + "gallery-" + imgIndex + ".jpg"; - //Tizen.Log.Fatal("NUI", "get native ecore wayland hander=" + _window.GetNativeWindowHandler()); - } - - } - else - { - if (e.Key.KeyPressedName == "Up") - { - textMap2.PointSize = 14; - textMap2.TextColor = Color.Red; - textMap2.Text = "I'm happy!"; - Tizen.Log.Fatal("NUI", "grab key (201==vol down) ret=" + _window.GrabKey(201, Window.KeyGrabMode.Topmost)); - } - - if (e.Key.KeyPressedName == "Down") - { - textMap2.PointSize = 17; - textMap2.TextColor = Color.Blue; - textMap2.Text = "I'm unhappy"; - Tizen.Log.Fatal("NUI", "ungrab key (201==vol down) ret=" + _window.UngrabKey(201)); - } - else if (e.Key.KeyPressedName == "Return") - { - imgIndex = (imgIndex + 1) % 6; - imageMap2.URL = resourcePath + "gallery-" + imgIndex + ".jpg"; - //Tizen.Log.Fatal("NUI", "get native ecore wayland hander=" + _window.GetNativeWindowHandler()); - } - } - } - return false; - } - - private void Instance_Key(object sender, Window.KeyEventArgs e) - { - View currentFocusView = FocusManager.Instance.GetCurrentFocusView(); - - Tizen.Log.Fatal("NUI", "Window_KeyEvent" + e.Key.State.ToString() + ", Pressed-" + e.Key.KeyPressedName); - //Tizen.Log.Fatal("NUI", " CurrentFocusView : " + currentFocusView.HasBody() + currentFocusView?.Name); - } - - private void VisualSample_FocusLost(object sender, EventArgs e) - { - VisualView view = sender as VisualView; - view.BackgroundColor = Color.Green; - view.Scale = new Vector3(1.0f, 1.0f, 1.0f); - - view.AddVisual("iconVisual", dimImageMap); - - if (view.Name == "MyView1") - { - imageMap2.MixColor = new Color(1, 0, 0, 0.5f); - imageMap2.Opacity = 0.5f; - } - else if (view.Name == "MyView0") - { - imageMap.MixColor = new Color(1, 0, 0, 0.5f); - imageMap.Opacity = 0.5f; - } - - Tizen.Log.Fatal("NUI", "FocusLost-" + view.Name); - } - - private void VisualSample_FocusGained(object sender, EventArgs e) - { - VisualView view = sender as VisualView; - view.BackgroundColor = Color.Yellow; - view.Scale = new Vector3(1.2f, 1.2f, 1.0f); - - view.AddVisual("iconVisual", highlightImageMap); - - if (view.Name == "MyView1") - { - imageMap2.MixColor = new Color(1, 1, 1, 1); - imageMap2.Opacity = 1.0f; - } - else if (view.Name == "MyView0") - { - imageMap.MixColor = new Color(1, 1, 1, 1); - imageMap.Opacity = 1.0f; - } - - Tizen.Log.Fatal("NUI", "FocusGained-" + view.Name); - } - - static void _Main(string[] args) - { - VisualSample sample = new VisualSample(); - sample.Run(args); - } - } -} \ No newline at end of file diff --git a/NUIsamples/NUIsamples/src/examples/visual-view-test3.cs b/NUIsamples/NUIsamples/src/examples/visual-view-test3.cs deleted file mode 100755 index ea9205ab2..000000000 --- a/NUIsamples/NUIsamples/src/examples/visual-view-test3.cs +++ /dev/null @@ -1,119 +0,0 @@ -/* - * Copyright (c) 2017 Samsung Electronics Co., Ltd. - * - * 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; -using Tizen.NUI; -using Tizen.NUI.Constants; -using Tizen.NUI.BaseComponents; - -namespace VisualViewTest3 -{ - // An example of Visual View control. - class Example : NUIApplication - { - private VisualView _visualView = null; - private const string resources = "/home/owner/apps_rw/NUISamples.TizenTV/res"; - private Window _window; - - public Example() : base() - { - } - - public Example(string stylesheet) : base(stylesheet) - { - } - - public Example(string stylesheet, WindowMode windowMode) : base(stylesheet, windowMode) - { - } - - protected override void OnCreate() - { - base.OnCreate(); - Initialize(); - } - - private ImageVisual imageVisualMap1; - private ImageVisual imageVisualMap2; - private int cnt; - - public void Initialize() - { - Window window = Window.Instance; - - /* Create a visual view. */ - _visualView = new VisualView(); - _visualView.ParentOrigin = ParentOrigin.TopLeft; - _visualView.PivotPoint = PivotPoint.TopLeft; - _visualView.Size2D = new Size2D(window.Size.Width, window.Size.Height); - - /* color visual */ - ColorVisual colorVisualMap1 = new ColorVisual(); - colorVisualMap1.Color = Color.Green; - _visualView.Background = colorVisualMap1.OutputVisualMap; - - window.Add(_visualView); - - /* image visual 1. No transform setting case. */ - imageVisualMap1 = new ImageVisual(); - imageVisualMap1.URL = resources + "/images/image-1.jpg"; - imageVisualMap1.DepthIndex = 1; - //_visualView.AddVisual("imageVisual1", imageVisualMap1); - - /* image visual 2. Using RelativePosition and SizePolicyWidth setting case. */ - imageVisualMap2 = new ImageVisual(); - imageVisualMap2.URL = resources + "/images/image-2.jpg"; - /* Using Size, you can set SizePolicyWidth and SizePolicyHeight separately, default by relative. */ - imageVisualMap2.Size = new Vector2(400.0f, 0.3f); - /* Using RelativePosition, then PositionPolicyX and PositionPolicyY will be relative. */ - imageVisualMap2.RelativePosition = new Vector2(0.1f, 0.1f); - imageVisualMap2.SizePolicyWidth = VisualTransformPolicyType.Absolute; - imageVisualMap2.Origin = Visual.AlignType.TopBegin; - imageVisualMap2.AnchorPoint = Visual.AlignType.TopBegin; - /* Ensure imageVisual show */ - imageVisualMap2.DepthIndex = 9; - _visualView.AddVisual("imageVisual2", imageVisualMap2); - /* If imageVisual2 added first, the it will be covered by imageVisual1. - so, we need to set their depth index to ensure they all can be showed. - */ - _visualView.AddVisual("imageVisual1", imageVisualMap1); - - _window = Window.Instance; - _window.FocusChanged += (sender, ee) => - { - cnt++; - Tizen.Log.Debug("NUI", "[WindowFocusTest] WindowFocusChanged event comes! focus gained=" + ee.FocusGained); - }; - - Tizen.Log.Debug("NUI", "[WindowFocusTest] is focus acceptable=" + _window.IsFocusAcceptable()); - _window.SetAcceptFocus(false); - Tizen.Log.Debug("NUI", "[WindowFocusTest] set focus acceptable=false!!!"); - Tizen.Log.Debug("NUI", "[WindowFocusTest] is focus acceptable=" + _window.IsFocusAcceptable()); - _window.SetAcceptFocus(true); - Tizen.Log.Debug("NUI", "[WindowFocusTest] set focus acceptable=true!!!"); - Tizen.Log.Debug("NUI", "[WindowFocusTest] is focus acceptable=" + _window.IsFocusAcceptable()); - } - - [STAThread] - static void _Main(string[] args) - { - Example example = new Example(); - example.Run(args); - } - } -} diff --git a/NUIsamples/NUIsamples/src/examples/visuals-example.cs b/NUIsamples/NUIsamples/src/examples/visuals-example.cs deleted file mode 100755 index 8c0a724ba..000000000 --- a/NUIsamples/NUIsamples/src/examples/visuals-example.cs +++ /dev/null @@ -1,150 +0,0 @@ -/* - * Copyright (c) 2017 Samsung Electronics Co., Ltd. - * - * 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.NUI; -using Tizen.NUI.Constants; -using Tizen.NUI.BaseComponents; - -namespace VisualsExampleTest -{ - class Example : NUIApplication - { - private TextLabel _title; - private const string resources = "/home/owner/apps_rw/NUISamples.TizenTV/res"; - - public Example() : base() - { - } - - public Example(string stylesheet) : base(stylesheet) - { - } - - public Example(string stylesheet, WindowMode windowMode) : base(stylesheet, windowMode) - { - } - - protected override void OnCreate() - { - base.OnCreate(); - Initialize(); - } - - public void Initialize() - { - Window window = Window.Instance; - window.BackgroundColor = Color.White; - - TableView contentLayout = new TableView(4, 1); - contentLayout.Name = ("ContentLayout"); - contentLayout.WidthResizePolicy = ResizePolicyType.FillToParent; - contentLayout.HeightResizePolicy = ResizePolicyType.FillToParent; - - contentLayout.SetCellPadding(new Size2D(0, 5)); - contentLayout.BackgroundColor = Color.Red;//new Color(0.949f, 0.949f, 0.949f, 1.0f); - - window.Add(contentLayout); - - _title = new TextLabel("Visuals Example"); - _title.Name = "Title"; - _title.StyleName = "Title"; - _title.WidthResizePolicy = ResizePolicyType.FillToParent; - _title.HeightResizePolicy = ResizePolicyType.UseNaturalSize; - _title.HorizontalAlignment = HorizontalAlignment.Center; - _title.BackgroundColor = Color.Yellow; - contentLayout.Add(_title); - contentLayout.SetFitHeight(0); - - // Color Visual example - ImageView colorView = new ImageView(); - //colorView.WidthResizePolicy = ResizePolicyType.SizeRelativeToParent; - //colorView.HeightResizePolicy = ResizePolicyType.SizeRelativeToParent; - // PropertyMap colorVisual = new PropertyMap(); - // colorVisual.Add( Visual.Property.Type, new PropertyValue( (int)Visual.Type.Color )) - // .Add( ColorVisualProperty.MixColor, new PropertyValue( Color.Green )); - //colorView.Background = colorVisual; - colorView.Size2D = new Size2D(500, 200); - colorView.ResourceUrl = resources+"/images/00_popup_bg.9.png"; - colorView.Border = new Rectangle(100, 100, 100, 100); - // colorView. - // PropertyMap _map = new PropertyMap(); - // _map.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.NPatch)); - // _map.Add(NpatchImageVisualProperty.URL, new PropertyValue(resources+"/images/00_popup_bg.9.png")); - // _map.Add(NpatchImageVisualProperty.Border, new PropertyValue(new Rectangle(100, 100, 100, 100))); - //_map.Add(NpatchImageVisualProperty.BorderOnly, new PropertyValue(true)); - //colorView.Background = _map; - contentLayout.Add(colorView); - - // Image Visual example - View imageView = new View(); - imageView.WidthResizePolicy = ResizePolicyType.UseNaturalSize; - imageView.HeightResizePolicy = ResizePolicyType.UseNaturalSize; - PropertyMap imageVisual = new PropertyMap(); - imageVisual.Add( Visual.Property.Type, new PropertyValue( (int)Visual.Type.Image )); - imageVisual.Add(ImageVisualProperty.URL, new PropertyValue( resources + "/images/gallery-0.jpg" )); - imageView.Background = imageVisual; - contentLayout.SetCellAlignment(new TableView.CellPosition(2, 0), HorizontalAlignmentType.Center, VerticalAlignmentType.Center); - contentLayout.Add(imageView); - for(int i =1; i<=5; i++) - { - PropertyMap imageVisual1 = new PropertyMap(); - imageVisual1.Add( Visual.Property.Type, new PropertyValue( (int)Visual.Type.Image )); - imageVisual1.Add(ImageVisualProperty.URL, new PropertyValue( resources + "/images/gallery-"+i+".jpg" )); - imageView.Background = imageVisual1; - } - - // Primitive Visual example - View primitiveView = new View(); - primitiveView.WidthResizePolicy = ResizePolicyType.SizeRelativeToParent; - primitiveView.HeightResizePolicy = ResizePolicyType.SizeRelativeToParent; - PropertyMap primitiveVisual = new PropertyMap(); - primitiveVisual.Add( Visual.Property.Type, new PropertyValue( (int)Visual.Type.Primitive )) - .Add( PrimitiveVisualProperty.Shape, new PropertyValue((int)PrimitiveVisualShapeType.BevelledCube)) - .Add( PrimitiveVisualProperty.BevelPercentage, new PropertyValue(0.3f)) - .Add( PrimitiveVisualProperty.BevelSmoothness, new PropertyValue(0.0f)) - .Add( PrimitiveVisualProperty.ScaleDimensions, new PropertyValue(new Vector3(1.0f,1.0f,0.3f))) - .Add( PrimitiveVisualProperty.MixColor, new PropertyValue(new Vector4(0.7f, 0.5f, 0.05f, 1.0f))); - primitiveView.Background = primitiveVisual; - Radian rad = new Radian(new Degree(45.0f)); - primitiveView.Orientation = new Rotation(rad, Vector3.YAxis); - contentLayout.Add(primitiveView); - - // Text Visual example - View textView = new View(); - textView.WidthResizePolicy = ResizePolicyType.SizeRelativeToParent; - textView.HeightResizePolicy = ResizePolicyType.SizeRelativeToParent; - PropertyMap textVisual = new PropertyMap(); - textVisual.Add( Visual.Property.Type, new PropertyValue( (int)Visual.Type.Text )) - .Add( TextVisualProperty.Text, new PropertyValue("I am text visual")) - .Add( TextVisualProperty.TextColor, new PropertyValue(Color.Blue)) - .Add( TextVisualProperty.PointSize, new PropertyValue(20)); - textView.Background = textVisual; - contentLayout.Add(textView); - } - - /// - /// The main entry point for the application. - /// - [STAThread] - static void _Main(string[] args) - { - Example example = new Example( resources + "/json/style-example-theme-one.json"); - example.Run(args); - } - } -} diff --git a/NUIsamples/NUIsamples/src/examples/visuals-using-custom-view/ContactData.cs b/NUIsamples/NUIsamples/src/examples/visuals-using-custom-view/ContactData.cs deleted file mode 100755 index 9a3b9a8c9..000000000 --- a/NUIsamples/NUIsamples/src/examples/visuals-using-custom-view/ContactData.cs +++ /dev/null @@ -1,131 +0,0 @@ -/* - * Copyright (c) 2017 Samsung Electronics Co., Ltd. - * - * 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.NUI; -using Tizen.NUI.Constants; - -namespace VisualsUsingCustomView -{ - // The collection of contacts - static class ContactsList - { - private const string resources = "/home/SERILOCAL/david.steele/Git/Tizen/nui/NUISamples/NUISamples/NUISamples.TizenTV/res"; - - public static readonly ContactItem[] s_contactData = new ContactItem[] - { - new ContactItem ("Emmett Yates", resources + "/images/gallery-small-43.jpg", - resources + "/images/mask.png", - new Color((73.0f/255.0f),(182.0f/255.0f), (245.0f/255.0f), 1.0f), - (int)PrimitiveVisualShapeType.Cone), - new ContactItem ("Leslie Wong", resources+ "/images/gallery-2.jpg", - resources + "/images/mask.png", - new Color((51.0f/255.0f), (51.0f/255.0f), (102.0f/255.0f), 1.0f), - (int)PrimitiveVisualShapeType.Sphere), - new ContactItem ("Walter Jensen", resources+ "/images/gallery-0.jpg", - resources + "/images/mask.png", - new Color((151.0f/255.0f), (214.0f/255.0f), (240.0f/255.0f), 1.0f), - (int)PrimitiveVisualShapeType.Cylinder), - new ContactItem ("Dan Haynes", resources+"/images/gallery-1.jpg", - resources + "/images/mask.png", - new Color((102.0f/255.0f), (251.0f/255.0f), (102.0f/255.0f), 1.0f), - (int)PrimitiveVisualShapeType.ConicalFrustrum), - new ContactItem ("Mable Hodges", resources+"/images/gallery-3.jpg", - resources + "/images/mask.png", - new Color((255.0f/255.0f), (102.0f/255.0f), (102.0f/255.0f), 1.0f), - (int)PrimitiveVisualShapeType.Cube) - }; - } - - // The information for an individual contact - class ContactItem - { - private string _name; - private string _imageURL; - private Color _color; - private int _shape; - private string _maskURL; - - public ContactItem(string name, string imageURL, string maskURL, Color color, int shape) - { - _name = name; - _imageURL = imageURL; - _maskURL = maskURL; - _color = color; - _shape = shape; - } - - public string ImageURL - { - get - { - return _imageURL; - } - set - { - _imageURL = value; - } - } - public string MaskURL - { - get - { - return _maskURL; - } - set - { - _maskURL = value; - } - } - - public string Name - { - get - { - return _name; - } - set - { - _name = value; - } - } - - public Color Color - { - get - { - return _color; - } - set - { - _color = value; - } - } - - public int Shape - { - get - { - return _shape; - } - set - { - _shape = value; - } - } - } -} diff --git a/NUIsamples/NUIsamples/src/examples/visuals-using-custom-view/ContactView.cs b/NUIsamples/NUIsamples/src/examples/visuals-using-custom-view/ContactView.cs deleted file mode 100755 index 52995a74f..000000000 --- a/NUIsamples/NUIsamples/src/examples/visuals-using-custom-view/ContactView.cs +++ /dev/null @@ -1,241 +0,0 @@ -/* - * Copyright (c) 2017 Samsung Electronics Co., Ltd. - * - * 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.NUI; -using Tizen.NUI.Constants; -using Tizen.NUI.BaseComponents; - -// A ContactView is a Custom View which consists of four visuals (Image, Primitive, Text and Color). -// All of these visuals can be configured via properties - ImageURL (Image), Shape (Primitive), Name (Text) and Color. -// Tap gesture is also enabled on the ContactView which changes the color visual to some random color when ContactView is tapped. - -namespace VisualsUsingCustomView -{ - public class ContactView : CustomView - { - private VisualBase _imageVisual; - private VisualBase _primitiveVisual; - private VisualBase _textVisual; - private int _shape; - private string _imageURL; - private string _maskURL; - private string _name; - private Color _color; - - static CustomView CreateInstance() - { - return new ContactView(); - } - - static ContactView() - { - CustomViewRegistry.Instance.Register( CreateInstance, typeof(ContactView)); - } - - public ContactView() : base( typeof(ContactView).FullName, CustomViewBehaviour.RequiresKeyboardNavigationSupport) - { - } - - public string MaskURL - { - get { return _maskURL; } - set { _maskURL=value; } - } - - [ScriptableProperty()] - public string ImageURL - { - get - { - return _imageURL; - } - set - { - _imageURL = value; - - ImageVisual imageVisual = new ImageVisual(); - imageVisual.URL = value; - imageVisual.AlphaMaskURL = _maskURL; - //imageVisual.MaskContentScale = 1.6f; - //imageVisual.CropToMask = true; - ImageVisual = imageVisual.OutputVisualMap; - } - } - - [ScriptableProperty()] - public PropertyMap ImageVisual - { - //get - //{ - // return _imageVisual.Creation; - //} - set - { - _imageVisual = VisualFactory.Instance.CreateVisual( value ); - RegisterVisual( GetPropertyIndex("ImageVisual"), _imageVisual ); - - // Set the depth index for Image visual - _imageVisual.DepthIndex = 30; - } - } - - [ScriptableProperty()] - public string NameField - { - get - { - return _name; - } - set - { - _name = value; - - // Create and Register Text Visual - TextVisual textVisual = new TextVisual(); - textVisual.Text = _name; - textVisual.TextColor = Color.Black; - textVisual.PointSize = 12; - textVisual.HorizontalAlignment = HorizontalAlignment.Center; - textVisual.VerticalAlignment = VerticalAlignment.Center; - NameVisual = textVisual.OutputVisualMap; - } - } - - [ScriptableProperty()] - public PropertyMap NameVisual - { - //get - //{ - // return _textVisual.Creation; - //} - set - { - _textVisual = VisualFactory.Instance.CreateVisual( value ); - RegisterVisual( GetPropertyIndex("NameVisual"), _textVisual ); - - // Set the depth index for Text visual - _textVisual.DepthIndex = 30; - } - } - - [ScriptableProperty()] - public Color Color - { - get - { - return _color; - } - set - { - _color = value; - BackgroundColor = value; - } - } - - [ScriptableProperty()] - public int Shape - { - get - { - return _shape; - } - set - { - _shape = value; - - // Create and Register Primitive Visual - var primitiveVisual = new PrimitiveVisual(); - primitiveVisual.Shape = (PrimitiveVisualShapeType)_shape; - primitiveVisual.BevelPercentage = 0.3f; - primitiveVisual.BevelSmoothness = 0.0f; - primitiveVisual.ScaleDimensions = new Vector3( 1.0f, 1.0f, 0.3f ); - primitiveVisual.MixColor = new Vector4( (245.0f/255.0f), (188.0f/255.0f), (73.0f/255.0f), 1.0f); - - ShapeVisual = primitiveVisual.OutputVisualMap; - } - } - - [ScriptableProperty()] - public PropertyMap ShapeVisual - { - //get - //{ - // return _primitiveVisual.Creation; - //} - set - { - _primitiveVisual = VisualFactory.Instance.CreateVisual( value ); - RegisterVisual( GetPropertyIndex("ShapeVisual"), _primitiveVisual ); - - // Set the depth index for Primitive visual - _primitiveVisual.DepthIndex = 30; - } - } - - public override void OnInitialize() - { - // Enable Tap gesture on ContactView - EnableGestureDetection(Gesture.GestureType.Tap); - } - - public override void OnTap(TapGesture tap) - { - // Change the Color visual of ContactView with some random color - Random random = new Random(); - float nextRed = (random.Next(0, 256) / 255.0f); - float nextGreen = (random.Next(0, 256) / 255.0f); - float nextBlue = (random.Next(0, 256) / 255.0f); - Animation anim = AnimateBackgroundColor( new Color( nextRed, nextGreen, nextBlue, 1.0f), 0, 2000 ); - if( anim ) - anim.Play(); - } - - public override void OnRelayout(Vector2 size, RelayoutContainer container) - { - // Configure the transform and size of Image visual. - PropertyMap imageVisualTransform = new PropertyMap(); - imageVisualTransform.Add((int)VisualTransformPropertyType.Offset, new PropertyValue(new Vector2(10.0f, 0.0f))) - .Add((int)VisualTransformPropertyType.OffsetPolicy, new PropertyValue(new Vector2((int)VisualTransformPolicyType.Absolute, (int)VisualTransformPolicyType.Absolute))) - .Add((int)VisualTransformPropertyType.SizePolicy, new PropertyValue(new Vector2((int)VisualTransformPolicyType.Absolute, (int)VisualTransformPolicyType.Absolute))) - .Add((int)VisualTransformPropertyType.Size, new PropertyValue(new Vector2(40.0f, 40.0f))) - .Add((int)VisualTransformPropertyType.Origin, new PropertyValue((int)Visual.AlignType.CenterBegin)) - .Add((int)VisualTransformPropertyType.AnchorPoint, new PropertyValue((int)Visual.AlignType.CenterBegin)); - _imageVisual.SetTransformAndSize(imageVisualTransform, size); - - // Configure the transform and size of Text visual. - PropertyMap textVisualTransform = new PropertyMap(); - textVisualTransform.Add((int)VisualTransformPropertyType.Offset, new PropertyValue(new Vector2(0.0f, 0.0f))) - .Add((int)VisualTransformPropertyType.OffsetPolicy, new PropertyValue(new Vector2((int)VisualTransformPolicyType.Relative, (int)VisualTransformPolicyType.Relative))) - .Add((int)VisualTransformPropertyType.SizePolicy, new PropertyValue(new Vector2((int)VisualTransformPolicyType.Absolute, (int)VisualTransformPolicyType.Absolute))) - .Add((int)VisualTransformPropertyType.Size, new PropertyValue(new Vector2(size.X - 100.0f, 50.0f))) - .Add((int)VisualTransformPropertyType.Origin, new PropertyValue((int)Visual.AlignType.Center)) - .Add((int)VisualTransformPropertyType.AnchorPoint, new PropertyValue((int)Visual.AlignType.Center)); - _textVisual.SetTransformAndSize(textVisualTransform, size); - - // Configure the transform and size of Primitive visual. - PropertyMap primitiveVisualTransform = new PropertyMap(); - primitiveVisualTransform.Add((int)VisualTransformPropertyType.Offset, new PropertyValue(new Vector2(size.X - 60.0f, 0.0f))) - .Add((int)VisualTransformPropertyType.OffsetPolicy, new PropertyValue(new Vector2((int)VisualTransformPolicyType.Absolute, (int)VisualTransformPolicyType.Absolute))) - .Add((int)VisualTransformPropertyType.SizePolicy, new PropertyValue(new Vector2((int)VisualTransformPolicyType.Absolute, (int)VisualTransformPolicyType.Absolute))) - .Add((int)VisualTransformPropertyType.Size, new PropertyValue(new Vector2(40.0f, 40.0f))) - .Add((int)VisualTransformPropertyType.Origin, new PropertyValue((int)Visual.AlignType.CenterBegin)) - .Add((int)VisualTransformPropertyType.AnchorPoint, new PropertyValue((int)Visual.AlignType.CenterBegin)); - _primitiveVisual.SetTransformAndSize(primitiveVisualTransform, size); - } - } -} diff --git a/NUIsamples/NUIsamples/src/examples/visuals-using-custom-view/visuals-using-custom-view.cs b/NUIsamples/NUIsamples/src/examples/visuals-using-custom-view/visuals-using-custom-view.cs deleted file mode 100755 index be327fe06..000000000 --- a/NUIsamples/NUIsamples/src/examples/visuals-using-custom-view/visuals-using-custom-view.cs +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Copyright (c) 2017 Samsung Electronics Co., Ltd. - * - * 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.NUI; -using Tizen.NUI.UIComponents; -using Tizen.NUI.BaseComponents; -using Tizen.NUI.Constants; - -namespace VisualsUsingCustomView -{ - class VisualsExample : NUIApplication - { - public VisualsExample() : base() - { - } - - public VisualsExample(string stylesheet) : base(stylesheet) - { - } - - public VisualsExample(string stylesheet, WindowMode windowMode) : base(stylesheet, windowMode) - { - } - - protected override void OnCreate() - { - base.OnCreate(); - Initialize(); - } - - private void Initialize() - { - Window window = Window.Instance; - window.BackgroundColor = Color.White; - - TableView contentLayout = new TableView(14, 1); - contentLayout.Name = "ContentLayout"; - //contentLayout.WidthResizePolicy = ResizePolicyType.FillToParent; - //contentLayout.HeightResizePolicy = ResizePolicyType.FillToParent; - contentLayout.PivotPoint = PivotPoint.TopLeft; - contentLayout.ParentOrigin = ParentOrigin.TopLeft; - contentLayout.Size2D = new Vector2(window.Size.Width, window.Size.Height); - contentLayout.SetCellPadding(new Size2D(5, 5)); - contentLayout.BackgroundColor = new Color(0.949f, 0.949f, 0.949f, 1.0f); - - window.Add(contentLayout); - - TextLabel title = new TextLabel("Contacts List with Visuals"); - title.Name = "Title"; - title.StyleName = "Title"; - title.WidthResizePolicy = ResizePolicyType.FillToParent; - title.HeightResizePolicy = ResizePolicyType.UseNaturalSize; - title.HorizontalAlignment = HorizontalAlignment.Center; - contentLayout.Add(title); - contentLayout.SetFitHeight(0); - - // Create ContactView(s) from ContactItem(s) in ContactsList and add them to TableView - ContactView contactView; - foreach (ContactItem contact in ContactsList.s_contactData) - { - contactView = new ContactView(); - contactView.WidthResizePolicy = ResizePolicyType.FillToParent; - contactView.HeightResizePolicy = ResizePolicyType.FillToParent; - - // Configure visuals of ContactView via properties - contactView.NameField = contact.Name; - contactView.MaskURL = contact.MaskURL; - contactView.ImageURL = contact.ImageURL; - contactView.Color = contact.Color; - contactView.Shape = contact.Shape; - contentLayout.Add(contactView); - } - } - - /// - /// The main entry point for the application. - /// - [STAThread] - static void _Main(string[] args) - { - VisualsExample visualsExample = new VisualsExample(); - visualsExample.Run(args); - } - } -} diff --git a/NUIsamples/NUIsamples/src/examples/widget-view-test.cs b/NUIsamples/NUIsamples/src/examples/widget-view-test.cs deleted file mode 100755 index 521e376ed..000000000 --- a/NUIsamples/NUIsamples/src/examples/widget-view-test.cs +++ /dev/null @@ -1,105 +0,0 @@ -using System; -using Tizen.NUI; -using Tizen.NUI.UIComponents; -using Tizen.NUI.BaseComponents; - -namespace WidgetViewTest -{ - class Example : NUIApplication - { - private PushButton _widgetButton; - private PushButton _deletedButton; - private WidgetView _widgetView; - private WidgetViewManager _widgetViewManager; - private View _container; - private string _instanceID; - - protected override void OnCreate() - { - base.OnCreate(); - Initialize(); - } - - protected override void OnTerminate() - { - //This function is called when the app exit normally. - base.OnTerminate(); - } - - public void Initialize() - { - Window window = Window.Instance; - window.BackgroundColor = Color.White; - - Tizen.Log.Debug("NUI", "### DP1"); - Layer layer = new Layer(); - layer.Behavior = Layer.LayerBehavior.Layer3D; - window.AddLayer(layer); - Tizen.Log.Debug("NUI", "### DP2"); - _container = new View(); - _container.ParentOrigin = ParentOrigin.Center; - _container.PivotPoint = PivotPoint.Center; - _container.Size2D = new Size2D(400, 400); - Tizen.Log.Debug("NUI", "### DP3"); - _widgetButton = new PushButton(); - _widgetButton.LabelText = "Widget"; - _widgetButton.ParentOrigin = ParentOrigin.BottomLeft; - _widgetButton.PivotPoint = PivotPoint.BottomLeft; - _widgetButton.PositionUsesAnchorPoint = true; - _widgetButton.Size2D = new Size2D(200, 100); - window.Add(_widgetButton); - _widgetButton.Clicked += (obj, e) => - { - _widgetView = _widgetViewManager.AddWidget("widget-efl.example", "", 450, 700, -1); - //_widgetView.PositionUsesPivotPoint = true; - //_widgetView.ParentOrigin = ParentOrigin.Center; - _widgetView.PivotPoint = PivotPoint.TopLeft; - _widgetView.PositionUsesAnchorPoint = true; - _widgetView.BackgroundColor = Color.Yellow; - _widgetView.WidgetAdded += (sender, eargs) => - { - _widgetButton.LabelText = "Quit"; - window.Add(_widgetView); - }; - _widgetView.WidgetDeleted += (sender, eargs) => - { - window.Remove(_widgetView); - _widgetButton.LabelText = "Button"; - }; - _instanceID = _widgetView.InstanceID; - return false; - }; - - _deletedButton = new PushButton(); - _deletedButton.LabelText = "Buton"; - _deletedButton.ParentOrigin = ParentOrigin.BottomRight; - _deletedButton.PivotPoint = PivotPoint.BottomRight; - _deletedButton.PositionUsesAnchorPoint = true; - _deletedButton.Size2D = new Size2D(200, 100); - window.Add(_deletedButton); - _deletedButton.Clicked += (obj, e) => - { - OnTerminate(); - return true; - }; - - layer.Add(_container); - Tizen.Log.Debug("NUI", "### widget view manager create start"); - _widgetViewManager = new WidgetViewManager(this, "org.tizen.example.NUISamples.TizenTV"); - if (!_widgetViewManager) - { - Tizen.Log.Fatal("NUI", "### Widget is not enabled!"); - } - - Tizen.Log.Debug("NUI", "### widget view manager create sucess"); - } - - [STAThread] - static void _Main(string[] args) - { - Example example = new Example(); - example.Run(args); - } - } -} - diff --git a/NUIsamples/NUIsamples/tizen-manifest.xml b/NUIsamples/NUIsamples/tizen-manifest.xml deleted file mode 100755 index f1122bdd5..000000000 --- a/NUIsamples/NUIsamples/tizen-manifest.xml +++ /dev/null @@ -1,14 +0,0 @@ - - - - - - NUIsamples.png - - diff --git a/build.sh b/build.sh deleted file mode 100755 index 359af21f6..000000000 --- a/build.sh +++ /dev/null @@ -1,102 +0,0 @@ -#!/bin/bash - -SCRIPT_FILE=$(readlink -f $0) -SCRIPT_DIR=$(dirname $SCRIPT_FILE) - -# Properties -OUTDIR=$SCRIPT_DIR/Artifacts - -NUGET_CMD="mono $SCRIPT_DIR/tools/NuGet.exe" - -RETRY_CMD="$SCRIPT_DIR/tools/retry.sh" -TIMEOUT_CMD="$SCRIPT_DIR/tools/timeout.sh" - -DOTNET_CMD="$RETRY_CMD $TIMEOUT_CMD 600 dotnet" - -RUN_BUILD="$DOTNET_CMD msbuild $SCRIPT_DIR/build/build.proj" -RUN_BUILD_DUMMY="$DOTNET_CMD build $SCRIPT_DIR/build/build.dummy.csproj" - - -usage() { - echo "Usage: $0 [options] [args]" - echo " Options:" - echo " -h, --help Show this usages message" - echo " -b, --build [module] Build a module" - echo " -f, --full Build all modules in src/ directory" - echo " -d, --dummy Build dummy modules" - echo " -p, --pack Make nuget packages" - echo " -c, --clean Clean all artifacts" -} - -cmd_clean() { - $RUN_BUILD /t:clean -} - -cmd_build() { - if [ -z "$1" ]; then - echo "No module specified." - exit 1 - fi - if [ -d /nuget ]; then - NUGET_SOURCE_OPT="/p:RestoreSources=/nuget" - fi - $RUN_BUILD /t:build /p:Project=$1 $NUGET_SOURCE_OPT -} - -cmd_full_build() { - if [ -d /nuget ]; then - NUGET_SOURCE_OPT="/p:RestoreSources=/nuget" - fi - $RUN_BUILD /t:build $NUGET_SOURCE_OPT -} - -cmd_pack() { - VERSION_FILE=$OUTDIR/Version.txt - if [ -f $VERSION_FILE ]; then - NUGET_VERSION_PREFIX=$(cat $VERSION_FILE | grep Prefix | cut -d: -f2 | sed 's/\r$//') - NUGET_VERSION_SUFFIX=$(cat $VERSION_FILE | grep Suffix | cut -d: -f2 | sed 's/\r$//') - NUGET_VERSION_OPT="-Version $NUGET_VERSION_PREFIX-$NUGET_VERSION_SUFFIX" - fi - $NUGET_CMD pack $SCRIPT_DIR/pkg/Tizen.NET.Private.nuspec -Symbols -NoPackageAnalysis $NUGET_VERSION_OPT -BasePath $SCRIPT_DIR -OutputDirectory $OUTDIR - $NUGET_CMD pack $SCRIPT_DIR/pkg/Tizen.NET.nuspec -Symbols -NoPackageAnalysis $NUGET_VERSION_OPT -BasePath $SCRIPT_DIR -OutputDirectory $OUTDIR -} - -cmd_dummy_build() { - if [ -d /nuget ]; then - NUGET_SOURCE_OPT="/p:RestoreSources=/nuget" - fi - $RUN_BUILD_DUMMY $NUGET_SOURCE_OPT -} - -OPTS=`getopt -o hcbfpd --long help,clean,build,full,pack,dummy -n 'build' -- "$@"` -if [ $? != 0 ] ; then echo "Failed parsing options." >&2 ; usage; exit 1 ; fi -eval set -- "$OPTS" - -FLAG_HELP=false -FLAG_FULL=false -FLAG_BUILD=false -FLAG_CLEAN=false -FLAG_DUMMY=false -FLAG_PACK=false - -while true; do - case "$1" in - -h|--help) FLAG_HELP=true; shift ;; - -b|--build) FLAG_BUILD=true; shift ;; - -f|--full) FLAG_FULL=true; shift ;; - -d|--dummy) FLAG_DUMMY=true; shift ;; - -p|--pack) FLAG_PACK=true; shift ;; - -c|--clean) FLAG_CLEAN=true; shift ;; - --) shift; break ;; - *) break ;; - esac -done - -if $FLAG_HELP; then usage; exit 0; fi -if $FLAG_CLEAN; then cmd_clean; exit 0; fi -if $FLAG_FULL; then cmd_full_build; exit 0; fi -if $FLAG_BUILD; then cmd_build $@; exit 0; fi -if $FLAG_PACK; then cmd_pack $@; exit 0; fi -if $FLAG_DUMMY; then cmd_dummy_build; exit 0; fi - -usage; diff --git a/build/Open.snk b/build/Open.snk deleted file mode 100644 index 4aed427a6..000000000 Binary files a/build/Open.snk and /dev/null differ diff --git a/build/build.dummy.csproj b/build/build.dummy.csproj deleted file mode 100644 index 47e393473..000000000 --- a/build/build.dummy.csproj +++ /dev/null @@ -1,121 +0,0 @@ - - - - - - - - - netstandard2.0 - false - $(VersionPrefix) - $(OutputDummyDir) - - - - - $(BaseIntermediateOutputPath)_ref_lib\ - $(BaseIntermediateOutputPath)_ref_api\ - - - - - dotnet $(GenAPIDir)GenAPI.exe - - - - - - - - - - - - - - - - - - - - - - - - - - - - - $(IntermediateAPIDir)%(TizenAssemblies.Filename).AssemblyInfo.cs - - - - - - - - - - - - - - - - - - $(IntermediateAPIDir)%(TizenAssemblies.Filename).cs - - - - - - - - - - - %(TizenAssemblies.Filename) - $(IntermediateAPIDir)%(TizenAssemblies.Filename).AssemblyInfo.cs - $(IntermediateAPIDir)%(TizenAssemblies.Filename).cs - $(OutputDummyDir)%(TizenAssemblies.Filename).dll - - - - - - - - - - - - - - - - - - diff --git a/build/build.proj b/build/build.proj old mode 100644 new mode 100755 index 58e76f8f9..8e56e86ee --- a/build/build.proj +++ b/build/build.proj @@ -2,11 +2,6 @@ - - - $(PackageSrcDir)PublicModuleList.txt - - Release @@ -14,6 +9,7 @@ + @@ -40,44 +36,33 @@ - - + + + + + + - - - - - - - <_PublicFilesToMove Include="$(OutputPlatformDir)%(PublicProject.Identity).dll" /> - <_PublicFilesToMove Include="$(OutputPlatformDir)%(PublicProject.Identity).pdb" /> - <_PublicFilesToMove Include="$(OutputPlatformDir)%(PublicProject.Identity).xml" /> - - - - - - - - diff --git a/build/common.props b/build/common.props deleted file mode 100644 index 563ffc149..000000000 --- a/build/common.props +++ /dev/null @@ -1,18 +0,0 @@ - - - - True - True - False - $(NoWarn);1570;1587;1591 - - - - True - $(MSBuildThisFileDirectory)Open.snk - true - - - - - diff --git a/build/directories.props b/build/directories.props old mode 100644 new mode 100755 index 32ed3868d..6871c5262 --- a/build/directories.props +++ b/build/directories.props @@ -4,15 +4,15 @@ $(MSBuildThisFileDirectory)..\ - $(ProjectRootDir)src\ - $(ProjectRootDir)pkg\ + $(ProjectRootDir)\ + $(ProjectRootDir)\internal\src\ $(ProjectRootDir)tools\ $(ToolsDir)GenAPI\ $(ProjectRootDir)Artifacts\ $(OutputBaseDir)bin\public\ - $(OutputBaseDir)bin\platform\ + $(OutputBaseDir)bin\internal\ $(OutputBaseDir)bin\dummy\ diff --git a/build/version.props b/build/version.props deleted file mode 100644 index 9115119f7..000000000 --- a/build/version.props +++ /dev/null @@ -1,8 +0,0 @@ - - - - 4.0.0 - preview1 - - - \ No newline at end of file diff --git a/nui.csproj b/nui.csproj new file mode 100755 index 000000000..759d80130 --- /dev/null +++ b/nui.csproj @@ -0,0 +1,18 @@ + + + + Exe + netcoreapp2.0 + + + + + + + + + + + + + diff --git a/nui.sln b/nui.sln new file mode 100755 index 000000000..26000c77e --- /dev/null +++ b/nui.sln @@ -0,0 +1,25 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 15 +VisualStudioVersion = 15.0.27004.2009 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "nui", "nui.csproj", "{6650626A-5CBC-4A9B-8D75-30DDA89708DD}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {6650626A-5CBC-4A9B-8D75-30DDA89708DD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {6650626A-5CBC-4A9B-8D75-30DDA89708DD}.Debug|Any CPU.Build.0 = Debug|Any CPU + {6650626A-5CBC-4A9B-8D75-30DDA89708DD}.Release|Any CPU.ActiveCfg = Release|Any CPU + {6650626A-5CBC-4A9B-8D75-30DDA89708DD}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {938384D2-CD04-4481-9102-D919C1DBACE8} + EndGlobalSection +EndGlobal diff --git a/packaging/csapi-tizenfx.manifest b/packaging/csapi-tizenfx.manifest deleted file mode 100644 index 75b0fa5e3..000000000 --- a/packaging/csapi-tizenfx.manifest +++ /dev/null @@ -1,5 +0,0 @@ - - - - - diff --git a/packaging/csapi-tizenfx.spec b/packaging/csapi-tizenfx.spec deleted file mode 100644 index 4dd0ae40e..000000000 --- a/packaging/csapi-tizenfx.spec +++ /dev/null @@ -1,191 +0,0 @@ -# !! IMPORTANT !! -# This packaging spec file is for developer testing only. -# For Tizen release, the spec file in the tizen branch should be used. - -%define DOTNET_ASSEMBLY_PATH /usr/share/dotnet.tizen/framework -%define DOTNET_ASSEMBLY_DUMMY_PATH %{DOTNET_ASSEMBLY_PATH}/ref -%define DOTNET_ASSEMBLY_RES_PATH %{DOTNET_ASSEMBLY_PATH}/res -%define DOTNET_NUGET_SOURCE /nuget - -%define _tizenfx_bin_path Artifacts - -Name: csapi-tizenfx -Summary: Assemblies of Tizen .NET -Version: 99.99.99 -Release: 1 -Group: Development/Libraries -License: Apache-2.0 -URL: https://www.tizen.org -Source0: %{name}-%{version}.tar.gz -Source1: %{name}.manifest - -BuildRequires: dotnet-build-tools - -BuildArch: noarch -AutoReqProv: no - -%description -%{summary} - -%package nuget -Summary: NuGet package for %{name} -Group: Development/Libraries -AutoReqProv: no - -%description nuget -NuGet package for %{name} - -%package dummy -Summary: Dummy assemblies of Tizen .NET -Group: Development/Libraries -AutoReqProv: no - -%description dummy -Dummy assemblies of Tizen .NET - -%package full -Summary: All Tizen .NET assemblies -Group: Development/Libraries -AutoReqProv: no - -%description full -All Tizen .NET assemblies - -%package debug -Summary: All .pdb files of Tizen .NET -Group: Development/Libraries -AutoReqProv: no - -%description debug -All .pdb files of Tizen .NET - -%package common -Summary: Tizen .NET assemblies for Common profile -Group: Development/Libraries -Requires: csapi-tizenfx-dummy -AutoReqProv: no - -%description common -Tizen .NET assemblies for Common profile - -%package mobile -Summary: Tizen .NET assemblies for Mobile profile -Group: Development/Libraries -Requires: csapi-tizenfx-dummy -AutoReqProv: no - -%description mobile -Tizen .NET assemblies for Mobile profile - -%package mobile-emul -Summary: Tizen .NET assemblies for Emulator of Mobile profile -Group: Development/Libraries -Requires: csapi-tizenfx-dummy -AutoReqProv: no - -%description mobile-emul -Tizen .NET assemblies for Emulator of Mobile profile - -%package tv -Summary: Tizen .NET assemblies for TV profile -Group: Development/Libraries -Requires: csapi-tizenfx-dummy -AutoReqProv: no - -%description tv -Tizen .NET assemblies for TV profile - -%package ivi -Summary: Tizen .NET assemblies for IVI profile -Group: Development/Libraries -Requires: csapi-tizenfx-dummy -AutoReqProv: no - -%description ivi -Tizen .NET assemblies for IVI profile - -%package wearable -Summary: Tizen .NET assemblies for Wearable profile -Group: Development/Libraries -Requires: csapi-tizenfx-dummy -AutoReqProv: no - -%description wearable -Tizen .NET assemblies for Wearable profile - -%prep -%setup -q -cp %{SOURCE1} . - -%build - -GetFileList() { - PROFILE=$1 - cat pkg/PlatformFileList.txt | grep -E "#$PROFILE[[:space:]]|#$PROFILE$" | cut -d# -f1 | sed "s#^#%{DOTNET_ASSEMBLY_PATH}/#" -} - -GetFileList common > common.filelist -GetFileList mobile > mobile.filelist -GetFileList mobile-emul > mobile-emul.filelist -GetFileList tv > tv.filelist -GetFileList ivi > ivi.filelist -GetFileList wearable > wearable.filelist - -rm -fr %{_tizenfx_bin_path} -export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=true -./build.sh --full -./build.sh --dummy -./build.sh --pack - -%install -mkdir -p %{buildroot}%{DOTNET_ASSEMBLY_PATH} -mkdir -p %{buildroot}%{DOTNET_ASSEMBLY_DUMMY_PATH} -mkdir -p %{buildroot}%{DOTNET_ASSEMBLY_RES_PATH} -mkdir -p %{buildroot}%{DOTNET_NUGET_SOURCE} - -install -p -m 644 %{_tizenfx_bin_path}/bin/public/*.dll %{buildroot}%{DOTNET_ASSEMBLY_PATH} -install -p -m 644 %{_tizenfx_bin_path}/bin/public/*.pdb %{buildroot}%{DOTNET_ASSEMBLY_PATH} -install -p -m 644 %{_tizenfx_bin_path}/bin/platform/*.dll %{buildroot}%{DOTNET_ASSEMBLY_PATH} -install -p -m 644 %{_tizenfx_bin_path}/bin/platform/*.pdb %{buildroot}%{DOTNET_ASSEMBLY_PATH} -install -p -m 644 %{_tizenfx_bin_path}/bin/platform/res/* %{buildroot}%{DOTNET_ASSEMBLY_RES_PATH} -install -p -m 644 %{_tizenfx_bin_path}/bin/dummy/*.dll %{buildroot}%{DOTNET_ASSEMBLY_DUMMY_PATH} -install -p -m 644 %{_tizenfx_bin_path}/*.nupkg %{buildroot}%{DOTNET_NUGET_SOURCE} - -%files nuget -%{DOTNET_NUGET_SOURCE}/*.nupkg - -%files dummy -%attr(644,root,root) %{DOTNET_ASSEMBLY_DUMMY_PATH}/*.dll - -%files full -%manifest %{name}.manifest -%license LICENSE -%attr(644,root,root) %{DOTNET_ASSEMBLY_PATH}/*.dll -%attr(644,root,root) %{DOTNET_ASSEMBLY_RES_PATH}/* - -%files debug -%attr(644,root,root) %{DOTNET_ASSEMBLY_PATH}/*.pdb - -%files common -f common.filelist -%manifest %{name}.manifest -%license LICENSE - -%files mobile -f mobile.filelist -%manifest %{name}.manifest -%license LICENSE - -%files mobile-emul -f mobile-emul.filelist -%manifest %{name}.manifest -%license LICENSE - -%files tv -f tv.filelist -%manifest %{name}.manifest -%license LICENSE - -%files ivi -f ivi.filelist -%manifest %{name}.manifest -%license LICENSE - -%files wearable -f wearable.filelist -%manifest %{name}.manifest -%license LICENSE diff --git a/pkg/PlatformFileList.txt b/pkg/PlatformFileList.txt deleted file mode 100644 index 0b4ab6c73..000000000 --- a/pkg/PlatformFileList.txt +++ /dev/null @@ -1,86 +0,0 @@ -ElmSharp.dll #common #mobile #mobile-emul #tv #ivi #wearable -ElmSharp.Wearable.dll #wearable -res/maps_marker_pin_48.png #mobile #mobile-emul #tv -res/maps_marker_pin_72.png #mobile #mobile-emul #tv -res/maps_marker_sticker_48.png #mobile #mobile-emul #tv -res/maps_marker_sticker_72.png #mobile #mobile-emul #tv -Tizen.Account.AccountManager.dll #mobile #mobile-emul #ivi #wearable -Tizen.Account.FidoClient.dll #mobile #mobile-emul #wearable -Tizen.Account.OAuth2.dll #mobile #mobile-emul #ivi #wearable -Tizen.Account.SyncManager.dll #mobile #mobile-emul #wearable -Tizen.Applications.Alarm.dll #common #mobile #mobile-emul #tv #ivi #wearable -Tizen.Applications.AttachPanel.dll #mobile #mobile-emul -Tizen.Applications.Badge.dll #mobile #mobile-emul #ivi #wearable -Tizen.Applications.Common.dll #common #mobile #mobile-emul #tv #ivi #wearable -Tizen.Applications.DataControl.dll #common #mobile #mobile-emul #tv #ivi #wearable -Tizen.Applications.MessagePort.dll #common #mobile #mobile-emul #tv #ivi #wearable -Tizen.Applications.Notification.dll #common #mobile #mobile-emul #tv #ivi #wearable -Tizen.Applications.NotificationEventListener.dll #common #mobile #mobile-emul #tv #ivi #wearable -Tizen.Applications.PackageManager.dll #common #mobile #mobile-emul #tv #ivi #wearable -Tizen.Applications.Preference.dll #common #mobile #mobile-emul #tv #ivi #wearable -Tizen.Applications.RemoteView.dll #mobile #mobile-emul #tv #wearable -Tizen.Applications.Service.dll #common #mobile #mobile-emul #tv #ivi #wearable -Tizen.Applications.ToastMessage.dll #common #mobile #mobile-emul #tv #ivi #wearable -Tizen.Applications.UI.dll #common #mobile #mobile-emul #tv #ivi #wearable -Tizen.Applications.WatchApplication.dll #wearable -Tizen.Applications.WidgetApplication.dll #mobile #mobile-emul #tv #ivi #wearable -Tizen.Applications.WidgetControl.dll #mobile #mobile-emul #tv #ivi #wearable -Tizen.Content.Download.dll #common #mobile #mobile-emul #tv #ivi #wearable -Tizen.Content.MediaContent.dll #common #mobile #mobile-emul #tv #ivi #wearable -Tizen.Content.MimeType.dll #common #mobile #mobile-emul #tv #ivi #wearable -Tizen.Context.dll #mobile #mobile-emul #wearable -Tizen.Convergence.dll #common #mobile #mobile-emul #ivi #wearable -Tizen.dll #common #mobile #mobile-emul #tv #ivi #wearable -Tizen.Location.dll #mobile #mobile-emul #tv #ivi #wearable -Tizen.Location.Geofence.dll #mobile #mobile-emul -Tizen.Log.dll #common #mobile #mobile-emul #tv #ivi #wearable -Tizen.Maps.dll #mobile #mobile-emul #tv #wearable -Tizen.Messaging.dll #mobile #mobile-emul #wearable -Tizen.Messaging.Push.dll #common #mobile #mobile-emul #tv #ivi #wearable -Tizen.Multimedia.AudioIO.dll #common #mobile #mobile-emul #tv #ivi #wearable -Tizen.Multimedia.Camera.dll #common #mobile #mobile-emul #tv #ivi -Tizen.Multimedia.dll #common #mobile #mobile-emul #tv #ivi #wearable -Tizen.Multimedia.MediaCodec.dll #common #mobile #mobile-emul #tv #ivi #wearable -Tizen.Multimedia.MediaPlayer.dll #common #mobile #mobile-emul #tv #ivi #wearable -Tizen.Multimedia.Metadata.dll #common #mobile #mobile-emul #tv #ivi #wearable -Tizen.Multimedia.Radio.dll #common #mobile #mobile-emul #ivi #wearable -Tizen.Multimedia.Recorder.dll #common #mobile #mobile-emul #tv #ivi #wearable -Tizen.Multimedia.Remoting.dll #common #mobile #mobile-emul #tv #ivi #wearable -Tizen.Multimedia.StreamRecorder.dll #common #mobile #mobile-emul #tv #ivi #wearable -Tizen.Multimedia.Util.dll #common #mobile #mobile-emul #tv #ivi #wearable -Tizen.Multimedia.Vision.dll #common #mobile #mobile-emul #tv #ivi #wearable -Tizen.Network.Bluetooth.dll #common #mobile #tv #ivi #wearable -Tizen.Network.Connection.dll #common #mobile #mobile-emul #tv #ivi #wearable -Tizen.Network.IoTConnectivity.dll #common #mobile #mobile-emul #tv #ivi #wearable -Tizen.Network.Mtp.dll -Tizen.Network.Nfc.dll #mobile #mobile-emul #ivi #wearable -Tizen.Network.Nsd.dll #common #mobile #mobile-emul #tv #wearable -Tizen.Network.Smartcard.dll #mobile #mobile-emul #ivi #wearable -Tizen.Network.WiFi.dll #common #mobile #mobile-emul #tv #ivi #wearable -Tizen.Network.WiFiDirect.dll #mobile #tv #ivi -Tizen.NUI.dll #common #mobile #mobile-emul #tv #wearable -Tizen.PhonenumberUtils.dll #mobile #mobile-emul #wearable -Tizen.Pims.Calendar.dll #common #mobile #mobile-emul #tv #wearable -Tizen.Pims.Contacts.dll #mobile #mobile-emul #wearable -Tizen.Security.dll #common #mobile #mobile-emul #tv #ivi #wearable -Tizen.Security.SecureRepository.dll #common #mobile #mobile-emul #tv #ivi #wearable -Tizen.Security.TEEC.dll #mobile #mobile-emul #tv #ivi #wearable -Tizen.Sensor.dll #common #mobile #mobile-emul #tv #ivi #wearable -Tizen.System.dll #common #mobile #mobile-emul #tv #ivi #wearable -Tizen.System.Feedback.dll #common #mobile #mobile-emul #tv #ivi #wearable -Tizen.System.Information.dll #common #mobile #mobile-emul #tv #ivi #wearable -Tizen.System.MediaKey.dll #common #mobile #mobile-emul #tv #ivi #wearable -Tizen.System.PlatformConfig.dll #common #mobile #mobile-emul #tv #ivi #wearable -Tizen.System.Storage.dll #common #mobile #mobile-emul #tv #ivi #wearable -Tizen.System.SystemSettings.dll #common #mobile #mobile-emul #tv #ivi #wearable -Tizen.Tapi.dll -Tizen.Telephony.dll #mobile #mobile-emul #ivi #wearable -Tizen.Tracer.dll #common #mobile #mobile-emul #tv #ivi #wearable -Tizen.Uix.InputMethod.dll #common #mobile #mobile-emul #tv #ivi #wearable -Tizen.Uix.InputMethodManager.dll #common #mobile #mobile-emul #tv #ivi #wearable -Tizen.Uix.Stt.dll #common #mobile #mobile-emul #tv #ivi #wearable -Tizen.Uix.SttEngine.dll #common #mobile #mobile-emul #tv #ivi #wearable -Tizen.Uix.Tts.dll #common #mobile #mobile-emul #tv #ivi #wearable -Tizen.Uix.TtsEngine.dll #common #mobile #mobile-emul #tv #ivi #wearable -Tizen.Uix.VoiceControl.dll #common #mobile #mobile-emul #tv #ivi #wearable -Tizen.WebView.dll #common #mobile #mobile-emul #tv #ivi #wearable diff --git a/pkg/PublicModuleList.txt b/pkg/PublicModuleList.txt deleted file mode 100644 index f1fd12699..000000000 --- a/pkg/PublicModuleList.txt +++ /dev/null @@ -1,78 +0,0 @@ -ElmSharp -ElmSharp.Wearable -Tizen -Tizen.Account.AccountManager -Tizen.Account.FidoClient -Tizen.Account.OAuth2 -Tizen.Account.SyncManager -Tizen.Applications.Alarm -Tizen.Applications.AttachPanel -Tizen.Applications.Badge -Tizen.Applications.Common -Tizen.Applications.DataControl -Tizen.Applications.MessagePort -Tizen.Applications.Notification -Tizen.Applications.NotificationEventListener -Tizen.Applications.PackageManager -Tizen.Applications.Preference -Tizen.Applications.RemoteView -Tizen.Applications.Service -Tizen.Applications.ToastMessage -Tizen.Applications.UI -Tizen.Applications.WatchApplication -Tizen.Applications.WidgetApplication -Tizen.Applications.WidgetControl -Tizen.Content.Download -Tizen.Content.MediaContent -Tizen.Content.MimeType -Tizen.Context -Tizen.Convergence -Tizen.Location -Tizen.Location.Geofence -Tizen.Log -Tizen.Maps -Tizen.Messaging -Tizen.Messaging.Push -Tizen.Multimedia -Tizen.Multimedia.AudioIO -Tizen.Multimedia.Camera -Tizen.Multimedia.MediaCodec -Tizen.Multimedia.MediaPlayer -Tizen.Multimedia.Metadata -Tizen.Multimedia.Radio -Tizen.Multimedia.Recorder -Tizen.Multimedia.Remoting -Tizen.Multimedia.StreamRecorder -Tizen.Multimedia.Util -Tizen.Multimedia.Vision -Tizen.Network.Bluetooth -Tizen.Network.Connection -Tizen.Network.IoTConnectivity -Tizen.Network.Nfc -Tizen.Network.Nsd -Tizen.Network.Smartcard -Tizen.Network.WiFi -Tizen.Network.WiFiDirect -Tizen.NUI -Tizen.PhonenumberUtils -Tizen.Pims.Calendar -Tizen.Pims.Contacts -Tizen.Security -Tizen.Security.SecureRepository -Tizen.Security.TEEC -Tizen.Sensor -Tizen.System -Tizen.System.Feedback -Tizen.System.Information -Tizen.System.MediaKey -Tizen.System.PlatformConfig -Tizen.System.Storage -Tizen.System.SystemSettings -Tizen.Telephony -Tizen.Tracer -Tizen.Uix.InputMethod -Tizen.Uix.InputMethodManager -Tizen.Uix.Stt -Tizen.Uix.Tts -Tizen.Uix.VoiceControl -Tizen.WebView diff --git a/pkg/Tizen.NET.Private.nuspec b/pkg/Tizen.NET.Private.nuspec deleted file mode 100644 index 0c31525d5..000000000 --- a/pkg/Tizen.NET.Private.nuspec +++ /dev/null @@ -1,28 +0,0 @@ - - - - Tizen.NET.Private - 4.0.0-preview1 - Samsung Electronics - Samsung Electronics - false - https://www.apache.org/licenses/LICENSE-2.0 - https://www.tizen.org/ - https://developer.tizen.org/sites/default/files/images/tizen-pinwheel-on-light-rgb_64_64.png - A set of Tizen.NET APIs. This includes all of the APIs built on top of Tizen Platform. - © Samsung Electronics Co., Ltd All Rights Reserved - - - - - - - - - - - - - - - diff --git a/pkg/Tizen.NET.nuspec b/pkg/Tizen.NET.nuspec deleted file mode 100644 index 18f462b74..000000000 --- a/pkg/Tizen.NET.nuspec +++ /dev/null @@ -1,28 +0,0 @@ - - - - Tizen.NET - 4.0.0-preview1 - Samsung Electronics - Samsung Electronics - false - https://www.apache.org/licenses/LICENSE-2.0 - https://www.tizen.org/ - https://developer.tizen.org/sites/default/files/images/tizen-pinwheel-on-light-rgb_64_64.png - A set of Tizen.NET APIs. This includes all of the APIs built on top of Tizen Platform. - © Samsung Electronics Co., Ltd All Rights Reserved - - - - - - - - - - - - diff --git a/pkg/build/LICENSE.NETStandardLibrary.txt b/pkg/build/LICENSE.NETStandardLibrary.txt deleted file mode 100644 index 56e51b1c0..000000000 --- a/pkg/build/LICENSE.NETStandardLibrary.txt +++ /dev/null @@ -1,21 +0,0 @@ -The MIT License (MIT) - -Copyright (c) .NET Foundation and Contributors - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. diff --git a/pkg/build/Tizen.NET.props b/pkg/build/Tizen.NET.props deleted file mode 100644 index 5f2f1728c..000000000 --- a/pkg/build/Tizen.NET.props +++ /dev/null @@ -1,12 +0,0 @@ - - - - $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - - - - Tizen.NET - 4.0.0 - - - diff --git a/pkg/build/Tizen.NET.targets b/pkg/build/Tizen.NET.targets deleted file mode 100644 index 6afc0326c..000000000 --- a/pkg/build/Tizen.NET.targets +++ /dev/null @@ -1,9 +0,0 @@ - - - - $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - - - - - \ No newline at end of file diff --git a/pkg/build/tizen40/Tizen.NET.props b/pkg/build/tizen40/Tizen.NET.props deleted file mode 100644 index e75cfc972..000000000 --- a/pkg/build/tizen40/Tizen.NET.props +++ /dev/null @@ -1,19 +0,0 @@ - - - - $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - - - - - Tizen - v4.0 - <_IsNETCoreOrNETStandard>true - - - - - - diff --git a/pkg/build/tizen40/Tizen.NET.targets b/pkg/build/tizen40/Tizen.NET.targets deleted file mode 100644 index e745ed842..000000000 --- a/pkg/build/tizen40/Tizen.NET.targets +++ /dev/null @@ -1,40 +0,0 @@ - - - - $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - - - - - - - false - false - true - $(TizenNETPackageName) - $(TizenNETPackageVersion) - - - - - - $(NoWarn);NU1701 - netcoreapp2.0 - - - - - - - - - - \ No newline at end of file diff --git a/pkg/build/tizen40/ref/Microsoft.Win32.Primitives.dll b/pkg/build/tizen40/ref/Microsoft.Win32.Primitives.dll deleted file mode 100644 index 8bbd88fa2..000000000 Binary files a/pkg/build/tizen40/ref/Microsoft.Win32.Primitives.dll and /dev/null differ diff --git a/pkg/build/tizen40/ref/System.AppContext.dll b/pkg/build/tizen40/ref/System.AppContext.dll deleted file mode 100644 index 73dd72d06..000000000 Binary files a/pkg/build/tizen40/ref/System.AppContext.dll and /dev/null differ diff --git a/pkg/build/tizen40/ref/System.Collections.Concurrent.dll b/pkg/build/tizen40/ref/System.Collections.Concurrent.dll deleted file mode 100644 index 0401bd8d5..000000000 Binary files a/pkg/build/tizen40/ref/System.Collections.Concurrent.dll and /dev/null differ diff --git a/pkg/build/tizen40/ref/System.Collections.NonGeneric.dll b/pkg/build/tizen40/ref/System.Collections.NonGeneric.dll deleted file mode 100644 index 31d2491bc..000000000 Binary files a/pkg/build/tizen40/ref/System.Collections.NonGeneric.dll and /dev/null differ diff --git a/pkg/build/tizen40/ref/System.Collections.Specialized.dll b/pkg/build/tizen40/ref/System.Collections.Specialized.dll deleted file mode 100644 index 20f1740b1..000000000 Binary files a/pkg/build/tizen40/ref/System.Collections.Specialized.dll and /dev/null differ diff --git a/pkg/build/tizen40/ref/System.Collections.dll b/pkg/build/tizen40/ref/System.Collections.dll deleted file mode 100644 index 9af035ae2..000000000 Binary files a/pkg/build/tizen40/ref/System.Collections.dll and /dev/null differ diff --git a/pkg/build/tizen40/ref/System.ComponentModel.Composition.dll b/pkg/build/tizen40/ref/System.ComponentModel.Composition.dll deleted file mode 100644 index cc6470b3d..000000000 Binary files a/pkg/build/tizen40/ref/System.ComponentModel.Composition.dll and /dev/null differ diff --git a/pkg/build/tizen40/ref/System.ComponentModel.EventBasedAsync.dll b/pkg/build/tizen40/ref/System.ComponentModel.EventBasedAsync.dll deleted file mode 100644 index 081c4e04f..000000000 Binary files a/pkg/build/tizen40/ref/System.ComponentModel.EventBasedAsync.dll and /dev/null differ diff --git a/pkg/build/tizen40/ref/System.ComponentModel.Primitives.dll b/pkg/build/tizen40/ref/System.ComponentModel.Primitives.dll deleted file mode 100644 index c87ee2194..000000000 Binary files a/pkg/build/tizen40/ref/System.ComponentModel.Primitives.dll and /dev/null differ diff --git a/pkg/build/tizen40/ref/System.ComponentModel.TypeConverter.dll b/pkg/build/tizen40/ref/System.ComponentModel.TypeConverter.dll deleted file mode 100644 index 64cf5a81b..000000000 Binary files a/pkg/build/tizen40/ref/System.ComponentModel.TypeConverter.dll and /dev/null differ diff --git a/pkg/build/tizen40/ref/System.ComponentModel.dll b/pkg/build/tizen40/ref/System.ComponentModel.dll deleted file mode 100644 index 86f6362f5..000000000 Binary files a/pkg/build/tizen40/ref/System.ComponentModel.dll and /dev/null differ diff --git a/pkg/build/tizen40/ref/System.Console.dll b/pkg/build/tizen40/ref/System.Console.dll deleted file mode 100644 index 425f59925..000000000 Binary files a/pkg/build/tizen40/ref/System.Console.dll and /dev/null differ diff --git a/pkg/build/tizen40/ref/System.Core.dll b/pkg/build/tizen40/ref/System.Core.dll deleted file mode 100644 index 28c102da2..000000000 Binary files a/pkg/build/tizen40/ref/System.Core.dll and /dev/null differ diff --git a/pkg/build/tizen40/ref/System.Data.Common.dll b/pkg/build/tizen40/ref/System.Data.Common.dll deleted file mode 100644 index 1287f6360..000000000 Binary files a/pkg/build/tizen40/ref/System.Data.Common.dll and /dev/null differ diff --git a/pkg/build/tizen40/ref/System.Data.dll b/pkg/build/tizen40/ref/System.Data.dll deleted file mode 100644 index a0910ed2c..000000000 Binary files a/pkg/build/tizen40/ref/System.Data.dll and /dev/null differ diff --git a/pkg/build/tizen40/ref/System.Diagnostics.Contracts.dll b/pkg/build/tizen40/ref/System.Diagnostics.Contracts.dll deleted file mode 100644 index a4145948e..000000000 Binary files a/pkg/build/tizen40/ref/System.Diagnostics.Contracts.dll and /dev/null differ diff --git a/pkg/build/tizen40/ref/System.Diagnostics.Debug.dll b/pkg/build/tizen40/ref/System.Diagnostics.Debug.dll deleted file mode 100644 index 872fe9d28..000000000 Binary files a/pkg/build/tizen40/ref/System.Diagnostics.Debug.dll and /dev/null differ diff --git a/pkg/build/tizen40/ref/System.Diagnostics.FileVersionInfo.dll b/pkg/build/tizen40/ref/System.Diagnostics.FileVersionInfo.dll deleted file mode 100644 index 6650a49d2..000000000 Binary files a/pkg/build/tizen40/ref/System.Diagnostics.FileVersionInfo.dll and /dev/null differ diff --git a/pkg/build/tizen40/ref/System.Diagnostics.Process.dll b/pkg/build/tizen40/ref/System.Diagnostics.Process.dll deleted file mode 100644 index 73031557c..000000000 Binary files a/pkg/build/tizen40/ref/System.Diagnostics.Process.dll and /dev/null differ diff --git a/pkg/build/tizen40/ref/System.Diagnostics.StackTrace.dll b/pkg/build/tizen40/ref/System.Diagnostics.StackTrace.dll deleted file mode 100644 index 31ae34dc2..000000000 Binary files a/pkg/build/tizen40/ref/System.Diagnostics.StackTrace.dll and /dev/null differ diff --git a/pkg/build/tizen40/ref/System.Diagnostics.TextWriterTraceListener.dll b/pkg/build/tizen40/ref/System.Diagnostics.TextWriterTraceListener.dll deleted file mode 100644 index 966fb425e..000000000 Binary files a/pkg/build/tizen40/ref/System.Diagnostics.TextWriterTraceListener.dll and /dev/null differ diff --git a/pkg/build/tizen40/ref/System.Diagnostics.Tools.dll b/pkg/build/tizen40/ref/System.Diagnostics.Tools.dll deleted file mode 100644 index d1fff1940..000000000 Binary files a/pkg/build/tizen40/ref/System.Diagnostics.Tools.dll and /dev/null differ diff --git a/pkg/build/tizen40/ref/System.Diagnostics.TraceSource.dll b/pkg/build/tizen40/ref/System.Diagnostics.TraceSource.dll deleted file mode 100644 index 091d6ab35..000000000 Binary files a/pkg/build/tizen40/ref/System.Diagnostics.TraceSource.dll and /dev/null differ diff --git a/pkg/build/tizen40/ref/System.Diagnostics.Tracing.dll b/pkg/build/tizen40/ref/System.Diagnostics.Tracing.dll deleted file mode 100644 index cbd08a0a9..000000000 Binary files a/pkg/build/tizen40/ref/System.Diagnostics.Tracing.dll and /dev/null differ diff --git a/pkg/build/tizen40/ref/System.Drawing.Primitives.dll b/pkg/build/tizen40/ref/System.Drawing.Primitives.dll deleted file mode 100644 index 27159ad17..000000000 Binary files a/pkg/build/tizen40/ref/System.Drawing.Primitives.dll and /dev/null differ diff --git a/pkg/build/tizen40/ref/System.Drawing.dll b/pkg/build/tizen40/ref/System.Drawing.dll deleted file mode 100644 index eaf29d811..000000000 Binary files a/pkg/build/tizen40/ref/System.Drawing.dll and /dev/null differ diff --git a/pkg/build/tizen40/ref/System.Dynamic.Runtime.dll b/pkg/build/tizen40/ref/System.Dynamic.Runtime.dll deleted file mode 100644 index e98b9664d..000000000 Binary files a/pkg/build/tizen40/ref/System.Dynamic.Runtime.dll and /dev/null differ diff --git a/pkg/build/tizen40/ref/System.Globalization.Calendars.dll b/pkg/build/tizen40/ref/System.Globalization.Calendars.dll deleted file mode 100644 index fdfda90db..000000000 Binary files a/pkg/build/tizen40/ref/System.Globalization.Calendars.dll and /dev/null differ diff --git a/pkg/build/tizen40/ref/System.Globalization.Extensions.dll b/pkg/build/tizen40/ref/System.Globalization.Extensions.dll deleted file mode 100644 index bc632374d..000000000 Binary files a/pkg/build/tizen40/ref/System.Globalization.Extensions.dll and /dev/null differ diff --git a/pkg/build/tizen40/ref/System.Globalization.dll b/pkg/build/tizen40/ref/System.Globalization.dll deleted file mode 100644 index e3fa8ce30..000000000 Binary files a/pkg/build/tizen40/ref/System.Globalization.dll and /dev/null differ diff --git a/pkg/build/tizen40/ref/System.IO.Compression.FileSystem.dll b/pkg/build/tizen40/ref/System.IO.Compression.FileSystem.dll deleted file mode 100644 index 13f9f2c91..000000000 Binary files a/pkg/build/tizen40/ref/System.IO.Compression.FileSystem.dll and /dev/null differ diff --git a/pkg/build/tizen40/ref/System.IO.Compression.ZipFile.dll b/pkg/build/tizen40/ref/System.IO.Compression.ZipFile.dll deleted file mode 100644 index 7023245b8..000000000 Binary files a/pkg/build/tizen40/ref/System.IO.Compression.ZipFile.dll and /dev/null differ diff --git a/pkg/build/tizen40/ref/System.IO.Compression.dll b/pkg/build/tizen40/ref/System.IO.Compression.dll deleted file mode 100644 index 61b5a0207..000000000 Binary files a/pkg/build/tizen40/ref/System.IO.Compression.dll and /dev/null differ diff --git a/pkg/build/tizen40/ref/System.IO.FileSystem.DriveInfo.dll b/pkg/build/tizen40/ref/System.IO.FileSystem.DriveInfo.dll deleted file mode 100644 index c46960a35..000000000 Binary files a/pkg/build/tizen40/ref/System.IO.FileSystem.DriveInfo.dll and /dev/null differ diff --git a/pkg/build/tizen40/ref/System.IO.FileSystem.Primitives.dll b/pkg/build/tizen40/ref/System.IO.FileSystem.Primitives.dll deleted file mode 100644 index f81a24dc2..000000000 Binary files a/pkg/build/tizen40/ref/System.IO.FileSystem.Primitives.dll and /dev/null differ diff --git a/pkg/build/tizen40/ref/System.IO.FileSystem.Watcher.dll b/pkg/build/tizen40/ref/System.IO.FileSystem.Watcher.dll deleted file mode 100644 index b042db4f3..000000000 Binary files a/pkg/build/tizen40/ref/System.IO.FileSystem.Watcher.dll and /dev/null differ diff --git a/pkg/build/tizen40/ref/System.IO.FileSystem.dll b/pkg/build/tizen40/ref/System.IO.FileSystem.dll deleted file mode 100644 index a2a83e814..000000000 Binary files a/pkg/build/tizen40/ref/System.IO.FileSystem.dll and /dev/null differ diff --git a/pkg/build/tizen40/ref/System.IO.IsolatedStorage.dll b/pkg/build/tizen40/ref/System.IO.IsolatedStorage.dll deleted file mode 100644 index 68efeb102..000000000 Binary files a/pkg/build/tizen40/ref/System.IO.IsolatedStorage.dll and /dev/null differ diff --git a/pkg/build/tizen40/ref/System.IO.MemoryMappedFiles.dll b/pkg/build/tizen40/ref/System.IO.MemoryMappedFiles.dll deleted file mode 100644 index 78ed46ae4..000000000 Binary files a/pkg/build/tizen40/ref/System.IO.MemoryMappedFiles.dll and /dev/null differ diff --git a/pkg/build/tizen40/ref/System.IO.Pipes.dll b/pkg/build/tizen40/ref/System.IO.Pipes.dll deleted file mode 100644 index 833125095..000000000 Binary files a/pkg/build/tizen40/ref/System.IO.Pipes.dll and /dev/null differ diff --git a/pkg/build/tizen40/ref/System.IO.UnmanagedMemoryStream.dll b/pkg/build/tizen40/ref/System.IO.UnmanagedMemoryStream.dll deleted file mode 100644 index 657f6bee7..000000000 Binary files a/pkg/build/tizen40/ref/System.IO.UnmanagedMemoryStream.dll and /dev/null differ diff --git a/pkg/build/tizen40/ref/System.IO.dll b/pkg/build/tizen40/ref/System.IO.dll deleted file mode 100644 index e0da075d4..000000000 Binary files a/pkg/build/tizen40/ref/System.IO.dll and /dev/null differ diff --git a/pkg/build/tizen40/ref/System.Linq.Expressions.dll b/pkg/build/tizen40/ref/System.Linq.Expressions.dll deleted file mode 100644 index 38fc22f6c..000000000 Binary files a/pkg/build/tizen40/ref/System.Linq.Expressions.dll and /dev/null differ diff --git a/pkg/build/tizen40/ref/System.Linq.Parallel.dll b/pkg/build/tizen40/ref/System.Linq.Parallel.dll deleted file mode 100644 index ec9491961..000000000 Binary files a/pkg/build/tizen40/ref/System.Linq.Parallel.dll and /dev/null differ diff --git a/pkg/build/tizen40/ref/System.Linq.Queryable.dll b/pkg/build/tizen40/ref/System.Linq.Queryable.dll deleted file mode 100644 index de407f002..000000000 Binary files a/pkg/build/tizen40/ref/System.Linq.Queryable.dll and /dev/null differ diff --git a/pkg/build/tizen40/ref/System.Linq.dll b/pkg/build/tizen40/ref/System.Linq.dll deleted file mode 100644 index 57d8adb05..000000000 Binary files a/pkg/build/tizen40/ref/System.Linq.dll and /dev/null differ diff --git a/pkg/build/tizen40/ref/System.Net.Http.dll b/pkg/build/tizen40/ref/System.Net.Http.dll deleted file mode 100644 index 5161655f9..000000000 Binary files a/pkg/build/tizen40/ref/System.Net.Http.dll and /dev/null differ diff --git a/pkg/build/tizen40/ref/System.Net.NameResolution.dll b/pkg/build/tizen40/ref/System.Net.NameResolution.dll deleted file mode 100644 index e53c683c7..000000000 Binary files a/pkg/build/tizen40/ref/System.Net.NameResolution.dll and /dev/null differ diff --git a/pkg/build/tizen40/ref/System.Net.NetworkInformation.dll b/pkg/build/tizen40/ref/System.Net.NetworkInformation.dll deleted file mode 100644 index c0c5eece5..000000000 Binary files a/pkg/build/tizen40/ref/System.Net.NetworkInformation.dll and /dev/null differ diff --git a/pkg/build/tizen40/ref/System.Net.Ping.dll b/pkg/build/tizen40/ref/System.Net.Ping.dll deleted file mode 100644 index c4601d365..000000000 Binary files a/pkg/build/tizen40/ref/System.Net.Ping.dll and /dev/null differ diff --git a/pkg/build/tizen40/ref/System.Net.Primitives.dll b/pkg/build/tizen40/ref/System.Net.Primitives.dll deleted file mode 100644 index c138ba129..000000000 Binary files a/pkg/build/tizen40/ref/System.Net.Primitives.dll and /dev/null differ diff --git a/pkg/build/tizen40/ref/System.Net.Requests.dll b/pkg/build/tizen40/ref/System.Net.Requests.dll deleted file mode 100644 index 558fd0582..000000000 Binary files a/pkg/build/tizen40/ref/System.Net.Requests.dll and /dev/null differ diff --git a/pkg/build/tizen40/ref/System.Net.Security.dll b/pkg/build/tizen40/ref/System.Net.Security.dll deleted file mode 100644 index a3541bf22..000000000 Binary files a/pkg/build/tizen40/ref/System.Net.Security.dll and /dev/null differ diff --git a/pkg/build/tizen40/ref/System.Net.Sockets.dll b/pkg/build/tizen40/ref/System.Net.Sockets.dll deleted file mode 100644 index c281793e4..000000000 Binary files a/pkg/build/tizen40/ref/System.Net.Sockets.dll and /dev/null differ diff --git a/pkg/build/tizen40/ref/System.Net.WebHeaderCollection.dll b/pkg/build/tizen40/ref/System.Net.WebHeaderCollection.dll deleted file mode 100644 index 88868bc1b..000000000 Binary files a/pkg/build/tizen40/ref/System.Net.WebHeaderCollection.dll and /dev/null differ diff --git a/pkg/build/tizen40/ref/System.Net.WebSockets.Client.dll b/pkg/build/tizen40/ref/System.Net.WebSockets.Client.dll deleted file mode 100644 index ab055df81..000000000 Binary files a/pkg/build/tizen40/ref/System.Net.WebSockets.Client.dll and /dev/null differ diff --git a/pkg/build/tizen40/ref/System.Net.WebSockets.dll b/pkg/build/tizen40/ref/System.Net.WebSockets.dll deleted file mode 100644 index 6ea8d7499..000000000 Binary files a/pkg/build/tizen40/ref/System.Net.WebSockets.dll and /dev/null differ diff --git a/pkg/build/tizen40/ref/System.Net.dll b/pkg/build/tizen40/ref/System.Net.dll deleted file mode 100644 index 6c733dcd7..000000000 Binary files a/pkg/build/tizen40/ref/System.Net.dll and /dev/null differ diff --git a/pkg/build/tizen40/ref/System.Numerics.dll b/pkg/build/tizen40/ref/System.Numerics.dll deleted file mode 100644 index 02bc2abde..000000000 Binary files a/pkg/build/tizen40/ref/System.Numerics.dll and /dev/null differ diff --git a/pkg/build/tizen40/ref/System.ObjectModel.dll b/pkg/build/tizen40/ref/System.ObjectModel.dll deleted file mode 100644 index 18e767539..000000000 Binary files a/pkg/build/tizen40/ref/System.ObjectModel.dll and /dev/null differ diff --git a/pkg/build/tizen40/ref/System.Reflection.Extensions.dll b/pkg/build/tizen40/ref/System.Reflection.Extensions.dll deleted file mode 100644 index f4b5b2e5a..000000000 Binary files a/pkg/build/tizen40/ref/System.Reflection.Extensions.dll and /dev/null differ diff --git a/pkg/build/tizen40/ref/System.Reflection.Primitives.dll b/pkg/build/tizen40/ref/System.Reflection.Primitives.dll deleted file mode 100644 index 330901c06..000000000 Binary files a/pkg/build/tizen40/ref/System.Reflection.Primitives.dll and /dev/null differ diff --git a/pkg/build/tizen40/ref/System.Reflection.dll b/pkg/build/tizen40/ref/System.Reflection.dll deleted file mode 100644 index ab9cfdcad..000000000 Binary files a/pkg/build/tizen40/ref/System.Reflection.dll and /dev/null differ diff --git a/pkg/build/tizen40/ref/System.Resources.Reader.dll b/pkg/build/tizen40/ref/System.Resources.Reader.dll deleted file mode 100644 index a117af1d5..000000000 Binary files a/pkg/build/tizen40/ref/System.Resources.Reader.dll and /dev/null differ diff --git a/pkg/build/tizen40/ref/System.Resources.ResourceManager.dll b/pkg/build/tizen40/ref/System.Resources.ResourceManager.dll deleted file mode 100644 index f90b702ba..000000000 Binary files a/pkg/build/tizen40/ref/System.Resources.ResourceManager.dll and /dev/null differ diff --git a/pkg/build/tizen40/ref/System.Resources.Writer.dll b/pkg/build/tizen40/ref/System.Resources.Writer.dll deleted file mode 100644 index 615c08568..000000000 Binary files a/pkg/build/tizen40/ref/System.Resources.Writer.dll and /dev/null differ diff --git a/pkg/build/tizen40/ref/System.Runtime.CompilerServices.VisualC.dll b/pkg/build/tizen40/ref/System.Runtime.CompilerServices.VisualC.dll deleted file mode 100644 index a59cc3a32..000000000 Binary files a/pkg/build/tizen40/ref/System.Runtime.CompilerServices.VisualC.dll and /dev/null differ diff --git a/pkg/build/tizen40/ref/System.Runtime.Extensions.dll b/pkg/build/tizen40/ref/System.Runtime.Extensions.dll deleted file mode 100644 index a9a8af469..000000000 Binary files a/pkg/build/tizen40/ref/System.Runtime.Extensions.dll and /dev/null differ diff --git a/pkg/build/tizen40/ref/System.Runtime.Handles.dll b/pkg/build/tizen40/ref/System.Runtime.Handles.dll deleted file mode 100644 index f0794db1e..000000000 Binary files a/pkg/build/tizen40/ref/System.Runtime.Handles.dll and /dev/null differ diff --git a/pkg/build/tizen40/ref/System.Runtime.InteropServices.RuntimeInformation.dll b/pkg/build/tizen40/ref/System.Runtime.InteropServices.RuntimeInformation.dll deleted file mode 100644 index 5170f6bb2..000000000 Binary files a/pkg/build/tizen40/ref/System.Runtime.InteropServices.RuntimeInformation.dll and /dev/null differ diff --git a/pkg/build/tizen40/ref/System.Runtime.InteropServices.dll b/pkg/build/tizen40/ref/System.Runtime.InteropServices.dll deleted file mode 100644 index 8832980fb..000000000 Binary files a/pkg/build/tizen40/ref/System.Runtime.InteropServices.dll and /dev/null differ diff --git a/pkg/build/tizen40/ref/System.Runtime.Numerics.dll b/pkg/build/tizen40/ref/System.Runtime.Numerics.dll deleted file mode 100644 index e2f83cb4b..000000000 Binary files a/pkg/build/tizen40/ref/System.Runtime.Numerics.dll and /dev/null differ diff --git a/pkg/build/tizen40/ref/System.Runtime.Serialization.Formatters.dll b/pkg/build/tizen40/ref/System.Runtime.Serialization.Formatters.dll deleted file mode 100644 index 098c26d01..000000000 Binary files a/pkg/build/tizen40/ref/System.Runtime.Serialization.Formatters.dll and /dev/null differ diff --git a/pkg/build/tizen40/ref/System.Runtime.Serialization.Json.dll b/pkg/build/tizen40/ref/System.Runtime.Serialization.Json.dll deleted file mode 100644 index 2ec1256a1..000000000 Binary files a/pkg/build/tizen40/ref/System.Runtime.Serialization.Json.dll and /dev/null differ diff --git a/pkg/build/tizen40/ref/System.Runtime.Serialization.Primitives.dll b/pkg/build/tizen40/ref/System.Runtime.Serialization.Primitives.dll deleted file mode 100644 index 94945ab8f..000000000 Binary files a/pkg/build/tizen40/ref/System.Runtime.Serialization.Primitives.dll and /dev/null differ diff --git a/pkg/build/tizen40/ref/System.Runtime.Serialization.Xml.dll b/pkg/build/tizen40/ref/System.Runtime.Serialization.Xml.dll deleted file mode 100644 index 94fe3839e..000000000 Binary files a/pkg/build/tizen40/ref/System.Runtime.Serialization.Xml.dll and /dev/null differ diff --git a/pkg/build/tizen40/ref/System.Runtime.Serialization.dll b/pkg/build/tizen40/ref/System.Runtime.Serialization.dll deleted file mode 100644 index bdc862266..000000000 Binary files a/pkg/build/tizen40/ref/System.Runtime.Serialization.dll and /dev/null differ diff --git a/pkg/build/tizen40/ref/System.Runtime.dll b/pkg/build/tizen40/ref/System.Runtime.dll deleted file mode 100644 index f4c7b4986..000000000 Binary files a/pkg/build/tizen40/ref/System.Runtime.dll and /dev/null differ diff --git a/pkg/build/tizen40/ref/System.Security.Claims.dll b/pkg/build/tizen40/ref/System.Security.Claims.dll deleted file mode 100644 index 527451cac..000000000 Binary files a/pkg/build/tizen40/ref/System.Security.Claims.dll and /dev/null differ diff --git a/pkg/build/tizen40/ref/System.Security.Cryptography.Algorithms.dll b/pkg/build/tizen40/ref/System.Security.Cryptography.Algorithms.dll deleted file mode 100644 index 318ba5816..000000000 Binary files a/pkg/build/tizen40/ref/System.Security.Cryptography.Algorithms.dll and /dev/null differ diff --git a/pkg/build/tizen40/ref/System.Security.Cryptography.Csp.dll b/pkg/build/tizen40/ref/System.Security.Cryptography.Csp.dll deleted file mode 100644 index 0235c934a..000000000 Binary files a/pkg/build/tizen40/ref/System.Security.Cryptography.Csp.dll and /dev/null differ diff --git a/pkg/build/tizen40/ref/System.Security.Cryptography.Encoding.dll b/pkg/build/tizen40/ref/System.Security.Cryptography.Encoding.dll deleted file mode 100644 index 7ff7e8846..000000000 Binary files a/pkg/build/tizen40/ref/System.Security.Cryptography.Encoding.dll and /dev/null differ diff --git a/pkg/build/tizen40/ref/System.Security.Cryptography.Primitives.dll b/pkg/build/tizen40/ref/System.Security.Cryptography.Primitives.dll deleted file mode 100644 index 71c6f30e4..000000000 Binary files a/pkg/build/tizen40/ref/System.Security.Cryptography.Primitives.dll and /dev/null differ diff --git a/pkg/build/tizen40/ref/System.Security.Cryptography.X509Certificates.dll b/pkg/build/tizen40/ref/System.Security.Cryptography.X509Certificates.dll deleted file mode 100644 index 1dc936f6d..000000000 Binary files a/pkg/build/tizen40/ref/System.Security.Cryptography.X509Certificates.dll and /dev/null differ diff --git a/pkg/build/tizen40/ref/System.Security.Principal.dll b/pkg/build/tizen40/ref/System.Security.Principal.dll deleted file mode 100644 index bff448f84..000000000 Binary files a/pkg/build/tizen40/ref/System.Security.Principal.dll and /dev/null differ diff --git a/pkg/build/tizen40/ref/System.Security.SecureString.dll b/pkg/build/tizen40/ref/System.Security.SecureString.dll deleted file mode 100644 index bc5f63833..000000000 Binary files a/pkg/build/tizen40/ref/System.Security.SecureString.dll and /dev/null differ diff --git a/pkg/build/tizen40/ref/System.ServiceModel.Web.dll b/pkg/build/tizen40/ref/System.ServiceModel.Web.dll deleted file mode 100644 index 2aab36e0f..000000000 Binary files a/pkg/build/tizen40/ref/System.ServiceModel.Web.dll and /dev/null differ diff --git a/pkg/build/tizen40/ref/System.Text.Encoding.Extensions.dll b/pkg/build/tizen40/ref/System.Text.Encoding.Extensions.dll deleted file mode 100644 index 52b723e86..000000000 Binary files a/pkg/build/tizen40/ref/System.Text.Encoding.Extensions.dll and /dev/null differ diff --git a/pkg/build/tizen40/ref/System.Text.Encoding.dll b/pkg/build/tizen40/ref/System.Text.Encoding.dll deleted file mode 100644 index 48614e4c0..000000000 Binary files a/pkg/build/tizen40/ref/System.Text.Encoding.dll and /dev/null differ diff --git a/pkg/build/tizen40/ref/System.Text.RegularExpressions.dll b/pkg/build/tizen40/ref/System.Text.RegularExpressions.dll deleted file mode 100644 index 8755aaa49..000000000 Binary files a/pkg/build/tizen40/ref/System.Text.RegularExpressions.dll and /dev/null differ diff --git a/pkg/build/tizen40/ref/System.Threading.Overlapped.dll b/pkg/build/tizen40/ref/System.Threading.Overlapped.dll deleted file mode 100644 index 0805ebd0c..000000000 Binary files a/pkg/build/tizen40/ref/System.Threading.Overlapped.dll and /dev/null differ diff --git a/pkg/build/tizen40/ref/System.Threading.Tasks.Parallel.dll b/pkg/build/tizen40/ref/System.Threading.Tasks.Parallel.dll deleted file mode 100644 index 6ede6f409..000000000 Binary files a/pkg/build/tizen40/ref/System.Threading.Tasks.Parallel.dll and /dev/null differ diff --git a/pkg/build/tizen40/ref/System.Threading.Tasks.dll b/pkg/build/tizen40/ref/System.Threading.Tasks.dll deleted file mode 100644 index 78dfdc3d1..000000000 Binary files a/pkg/build/tizen40/ref/System.Threading.Tasks.dll and /dev/null differ diff --git a/pkg/build/tizen40/ref/System.Threading.Thread.dll b/pkg/build/tizen40/ref/System.Threading.Thread.dll deleted file mode 100644 index 84e1c2749..000000000 Binary files a/pkg/build/tizen40/ref/System.Threading.Thread.dll and /dev/null differ diff --git a/pkg/build/tizen40/ref/System.Threading.ThreadPool.dll b/pkg/build/tizen40/ref/System.Threading.ThreadPool.dll deleted file mode 100644 index 20176b284..000000000 Binary files a/pkg/build/tizen40/ref/System.Threading.ThreadPool.dll and /dev/null differ diff --git a/pkg/build/tizen40/ref/System.Threading.Timer.dll b/pkg/build/tizen40/ref/System.Threading.Timer.dll deleted file mode 100644 index b391a1a89..000000000 Binary files a/pkg/build/tizen40/ref/System.Threading.Timer.dll and /dev/null differ diff --git a/pkg/build/tizen40/ref/System.Threading.dll b/pkg/build/tizen40/ref/System.Threading.dll deleted file mode 100644 index 859b3278e..000000000 Binary files a/pkg/build/tizen40/ref/System.Threading.dll and /dev/null differ diff --git a/pkg/build/tizen40/ref/System.Transactions.dll b/pkg/build/tizen40/ref/System.Transactions.dll deleted file mode 100644 index 1c974d919..000000000 Binary files a/pkg/build/tizen40/ref/System.Transactions.dll and /dev/null differ diff --git a/pkg/build/tizen40/ref/System.ValueTuple.dll b/pkg/build/tizen40/ref/System.ValueTuple.dll deleted file mode 100644 index 38f8c3717..000000000 Binary files a/pkg/build/tizen40/ref/System.ValueTuple.dll and /dev/null differ diff --git a/pkg/build/tizen40/ref/System.Web.dll b/pkg/build/tizen40/ref/System.Web.dll deleted file mode 100644 index 628f19282..000000000 Binary files a/pkg/build/tizen40/ref/System.Web.dll and /dev/null differ diff --git a/pkg/build/tizen40/ref/System.Windows.dll b/pkg/build/tizen40/ref/System.Windows.dll deleted file mode 100644 index 165bb70ea..000000000 Binary files a/pkg/build/tizen40/ref/System.Windows.dll and /dev/null differ diff --git a/pkg/build/tizen40/ref/System.Xml.Linq.dll b/pkg/build/tizen40/ref/System.Xml.Linq.dll deleted file mode 100644 index cdefde7eb..000000000 Binary files a/pkg/build/tizen40/ref/System.Xml.Linq.dll and /dev/null differ diff --git a/pkg/build/tizen40/ref/System.Xml.ReaderWriter.dll b/pkg/build/tizen40/ref/System.Xml.ReaderWriter.dll deleted file mode 100644 index 7b35a0de9..000000000 Binary files a/pkg/build/tizen40/ref/System.Xml.ReaderWriter.dll and /dev/null differ diff --git a/pkg/build/tizen40/ref/System.Xml.Serialization.dll b/pkg/build/tizen40/ref/System.Xml.Serialization.dll deleted file mode 100644 index d3df293e8..000000000 Binary files a/pkg/build/tizen40/ref/System.Xml.Serialization.dll and /dev/null differ diff --git a/pkg/build/tizen40/ref/System.Xml.XDocument.dll b/pkg/build/tizen40/ref/System.Xml.XDocument.dll deleted file mode 100644 index c076bd5e9..000000000 Binary files a/pkg/build/tizen40/ref/System.Xml.XDocument.dll and /dev/null differ diff --git a/pkg/build/tizen40/ref/System.Xml.XPath.XDocument.dll b/pkg/build/tizen40/ref/System.Xml.XPath.XDocument.dll deleted file mode 100644 index ba7ddd303..000000000 Binary files a/pkg/build/tizen40/ref/System.Xml.XPath.XDocument.dll and /dev/null differ diff --git a/pkg/build/tizen40/ref/System.Xml.XPath.dll b/pkg/build/tizen40/ref/System.Xml.XPath.dll deleted file mode 100644 index 6c62dd46e..000000000 Binary files a/pkg/build/tizen40/ref/System.Xml.XPath.dll and /dev/null differ diff --git a/pkg/build/tizen40/ref/System.Xml.XmlDocument.dll b/pkg/build/tizen40/ref/System.Xml.XmlDocument.dll deleted file mode 100644 index 37bcbc938..000000000 Binary files a/pkg/build/tizen40/ref/System.Xml.XmlDocument.dll and /dev/null differ diff --git a/pkg/build/tizen40/ref/System.Xml.XmlSerializer.dll b/pkg/build/tizen40/ref/System.Xml.XmlSerializer.dll deleted file mode 100644 index ba911c69d..000000000 Binary files a/pkg/build/tizen40/ref/System.Xml.XmlSerializer.dll and /dev/null differ diff --git a/pkg/build/tizen40/ref/System.Xml.dll b/pkg/build/tizen40/ref/System.Xml.dll deleted file mode 100644 index ceded26ca..000000000 Binary files a/pkg/build/tizen40/ref/System.Xml.dll and /dev/null differ diff --git a/pkg/build/tizen40/ref/System.dll b/pkg/build/tizen40/ref/System.dll deleted file mode 100644 index 2a5432f63..000000000 Binary files a/pkg/build/tizen40/ref/System.dll and /dev/null differ diff --git a/pkg/build/tizen40/ref/mscorlib.dll b/pkg/build/tizen40/ref/mscorlib.dll deleted file mode 100644 index b49875f3a..000000000 Binary files a/pkg/build/tizen40/ref/mscorlib.dll and /dev/null differ diff --git a/pkg/build/tizen40/ref/netstandard.dll b/pkg/build/tizen40/ref/netstandard.dll deleted file mode 100644 index 1c394c24a..000000000 Binary files a/pkg/build/tizen40/ref/netstandard.dll and /dev/null differ diff --git a/pkg/build/tizen40/ref/netstandard.xml b/pkg/build/tizen40/ref/netstandard.xml deleted file mode 100644 index 6dd8ce4d6..000000000 --- a/pkg/build/tizen40/ref/netstandard.xml +++ /dev/null @@ -1,149249 +0,0 @@ - - - - netstandard - - - - Identifies code generated by a tool. This class cannot be inherited. - - - Initializes a new instance of the class specifying the name and version of the tool that generated the code. - The name of the tool that generated the code. - The version of the tool that generated the code. - - - Gets the name of the tool that generated the code. - The name of the tool that generated to code. - - - Gets the version of the tool that generated the code. - The version of the tool that generated the code. - - - Provides a text writer that can indent new lines by a tab string token. - - - Initializes a new instance of the class using the specified text writer and default tab string. - The to use for output. - - - Initializes a new instance of the class using the specified text writer and tab string. - The to use for output. - The tab string to use for indentation. - - - Closes the document being written to. - - - Specifies the default tab string. This field is constant. - - - - Gets the encoding for the text writer to use. - An that indicates the encoding for the text writer to use. - - - Flushes the stream. - - - Gets or sets the number of spaces to indent. - The number of spaces to indent. - - - Gets the to use. - The to use. - - - Gets or sets the new line character to use. - The new line character to use. - - - Outputs the tab string once for each level of indentation according to the property. - - - Writes out a formatted string, using the same semantics as specified. - The formatting string to use. - The first object to write into the formatted string. - The second object to write into the formatted string. - - - Writes a subarray of characters to the text stream. - The character array to write data from. - Starting index in the buffer. - The number of characters to write. - - - Writes out a formatted string, using the same semantics as specified. - The formatting string to use. - The argument array to output. - - - Writes the specified string to the text stream. - The string to write. - - - Writes the text representation of a Single to the text stream. - The single to write. - - - Writes the text representation of an object to the text stream. - The object to write. - - - Writes out a formatted string, using the same semantics as specified. - The formatting string. - The object to write into the formatted string. - - - Writes the text representation of an integer to the text stream. - The integer to write. - - - Writes the text representation of a Double to the text stream. - The double to write. - - - Writes a character array to the text stream. - The character array to write. - - - Writes a character to the text stream. - The character to write. - - - Writes the text representation of a Boolean value to the text stream. - The Boolean value to write. - - - Writes the text representation of an 8-byte integer to the text stream. - The 8-byte integer to write. - - - Writes a subarray of characters, followed by a line terminator, to the text stream. - The character array to write data from. - Starting index in the buffer. - The number of characters to write. - - - Writes out a formatted string, followed by a line terminator, using the same semantics as specified. - The formatting string to use. - The argument array to output. - - - Writes out a formatted string, followed by a line terminator, using the same semantics as specified. - The formatting string. - The object to write into the formatted string. - - - Writes the text representation of a UInt32, followed by a line terminator, to the text stream. - A UInt32 to output. - - - Writes the specified string, followed by a line terminator, to the text stream. - The string to write. - - - Writes the text representation of a Single, followed by a line terminator, to the text stream. - The single to write. - - - Writes the text representation of an object, followed by a line terminator, to the text stream. - The object to write. - - - Writes the text representation of a Double, followed by a line terminator, to the text stream. - The double to write. - - - Writes the text representation of an integer, followed by a line terminator, to the text stream. - The integer to write. - - - Writes a character array, followed by a line terminator, to the text stream. - The character array to write. - - - Writes a character, followed by a line terminator, to the text stream. - The character to write. - - - Writes the text representation of a Boolean, followed by a line terminator, to the text stream. - The Boolean to write. - - - Writes a line terminator. - - - Writes out a formatted string, followed by a line terminator, using the same semantics as specified. - The formatting string to use. - The first object to write into the formatted string. - The second object to write into the formatted string. - - - Writes the text representation of an 8-byte integer, followed by a line terminator, to the text stream. - The 8-byte integer to write. - - - Writes the specified string to a line without tabs. - The string to write. - - - Implements the interface using an array whose size is dynamically increased as required. - - - Initializes a new instance of the class that is empty and has the default initial capacity. - - - Initializes a new instance of the class that contains elements copied from the specified collection and that has the same initial capacity as the number of elements copied. - The whose elements are copied to the new list. - c is null. - - - Initializes a new instance of the class that is empty and has the specified initial capacity. - The number of elements that the new list can initially store. - capacity is less than zero. - - - Creates an wrapper for a specific . - The to wrap. - The wrapper around the . - list is null. - - - Adds an object to the end of the . - The to be added to the end of the . The value can be null. - The index at which the value has been added. - The is read-only. -or- The has a fixed size. - - - Adds the elements of an to the end of the . - The whose elements should be added to the end of the . The collection itself cannot be null, but it can contain elements that are null. - c is null. - The is read-only. -or- The has a fixed size. - - - Searches the entire sorted for an element using the default comparer and returns the zero-based index of the element. - The to locate. The value can be null. - The zero-based index of value in the sorted , if value is found; otherwise, a negative number, which is the bitwise complement of the index of the next element that is larger than value or, if there is no larger element, the bitwise complement of . - Neither value nor the elements of implement the interface. - value is not of the same type as the elements of the . - - - Searches the entire sorted for an element using the specified comparer and returns the zero-based index of the element. - The to locate. The value can be null. - The implementation to use when comparing elements. -or- null to use the default comparer that is the implementation of each element. - The zero-based index of value in the sorted , if value is found; otherwise, a negative number, which is the bitwise complement of the index of the next element that is larger than value or, if there is no larger element, the bitwise complement of . - comparer is null and neither value nor the elements of implement the interface. - comparer is null and value is not of the same type as the elements of the . - - - Searches a range of elements in the sorted for an element using the specified comparer and returns the zero-based index of the element. - The zero-based starting index of the range to search. - The length of the range to search. - The to locate. The value can be null. - The implementation to use when comparing elements. -or- null to use the default comparer that is the implementation of each element. - The zero-based index of value in the sorted , if value is found; otherwise, a negative number, which is the bitwise complement of the index of the next element that is larger than value or, if there is no larger element, the bitwise complement of . - index and count do not denote a valid range in the . -or- comparer is null and neither value nor the elements of implement the interface. - comparer is null and value is not of the same type as the elements of the . - index is less than zero. -or- count is less than zero. - - - Gets or sets the number of elements that the can contain. - The number of elements that the can contain. - is set to a value that is less than . - There is not enough memory available on the system. - - - Removes all elements from the . - The is read-only. -or- The has a fixed size. - - - Creates a shallow copy of the . - A shallow copy of the . - - - Determines whether an element is in the . - The to locate in the . The value can be null. - true if item is found in the ; otherwise, false. - - - Copies the entire to a compatible one-dimensional , starting at the beginning of the target array. - The one-dimensional that is the destination of the elements copied from . The must have zero-based indexing. - array is null. - array is multidimensional. -or- The number of elements in the source is greater than the number of elements that the destination array can contain. - The type of the source cannot be cast automatically to the type of the destination array. - - - Copies the entire to a compatible one-dimensional , starting at the specified index of the target array. - The one-dimensional that is the destination of the elements copied from . The must have zero-based indexing. - The zero-based index in array at which copying begins. - array is null. - arrayIndex is less than zero. - array is multidimensional. -or- The number of elements in the source is greater than the available space from arrayIndex to the end of the destination array. - The type of the source cannot be cast automatically to the type of the destination array. - - - Copies a range of elements from the to a compatible one-dimensional , starting at the specified index of the target array. - The zero-based index in the source at which copying begins. - The one-dimensional that is the destination of the elements copied from . The must have zero-based indexing. - The zero-based index in array at which copying begins. - The number of elements to copy. - array is null. - index is less than zero. -or- arrayIndex is less than zero. -or- count is less than zero. - array is multidimensional. -or- index is equal to or greater than the of the source . -or- The number of elements from index to the end of the source is greater than the available space from arrayIndex to the end of the destination array. - The type of the source cannot be cast automatically to the type of the destination array. - - - Gets the number of elements actually contained in the . - The number of elements actually contained in the . - - - Returns an wrapper with a fixed size. - The to wrap. - An wrapper with a fixed size. - list is null. - - - Returns an wrapper with a fixed size. - The to wrap. - An wrapper with a fixed size. - list is null. - - - Returns an enumerator for the entire . - An for the entire . - - - Returns an enumerator for a range of elements in the . - The zero-based starting index of the section that the enumerator should refer to. - The number of elements in the section that the enumerator should refer to. - An for the specified range of elements in the . - index is less than zero. -or- count is less than zero. - index and count do not specify a valid range in the . - - - Returns an which represents a subset of the elements in the source . - The zero-based index at which the range starts. - The number of elements in the range. - An which represents a subset of the elements in the source . - index is less than zero. -or- count is less than zero. - index and count do not denote a valid range of elements in the . - - - Searches for the specified and returns the zero-based index of the first occurrence within the entire . - The to locate in the . The value can be null. - The zero-based index of the first occurrence of value within the entire , if found; otherwise, -1. - - - Searches for the specified and returns the zero-based index of the first occurrence within the range of elements in the that extends from the specified index to the last element. - The to locate in the . The value can be null. - The zero-based starting index of the search. 0 (zero) is valid in an empty list. - The zero-based index of the first occurrence of value within the range of elements in the that extends from startIndex to the last element, if found; otherwise, -1. - startIndex is outside the range of valid indexes for the . - - - Searches for the specified and returns the zero-based index of the first occurrence within the range of elements in the that starts at the specified index and contains the specified number of elements. - The to locate in the . The value can be null. - The zero-based starting index of the search. 0 (zero) is valid in an empty list. - The number of elements in the section to search. - The zero-based index of the first occurrence of value within the range of elements in the that starts at startIndex and contains count number of elements, if found; otherwise, -1. - startIndex is outside the range of valid indexes for the . -or- count is less than zero. -or- startIndex and count do not specify a valid section in the . - - - Inserts an element into the at the specified index. - The zero-based index at which value should be inserted. - The to insert. The value can be null. - index is less than zero. -or- index is greater than . - The is read-only. -or- The has a fixed size. - - - Inserts the elements of a collection into the at the specified index. - The zero-based index at which the new elements should be inserted. - The whose elements should be inserted into the . The collection itself cannot be null, but it can contain elements that are null. - c is null. - index is less than zero. -or- index is greater than . - The is read-only. -or- The has a fixed size. - - - Gets a value indicating whether the has a fixed size. - true if the has a fixed size; otherwise, false. The default is false. - - - Gets a value indicating whether the is read-only. - true if the is read-only; otherwise, false. The default is false. - - - Gets a value indicating whether access to the is synchronized (thread safe). - true if access to the is synchronized (thread safe); otherwise, false. The default is false. - - - Gets or sets the element at the specified index. - The zero-based index of the element to get or set. - The element at the specified index. - index is less than zero. -or- index is equal to or greater than . - - - Searches for the specified and returns the zero-based index of the last occurrence within the entire . - The to locate in the . The value can be null. - The zero-based index of the last occurrence of value within the entire the , if found; otherwise, -1. - - - Searches for the specified and returns the zero-based index of the last occurrence within the range of elements in the that extends from the first element to the specified index. - The to locate in the . The value can be null. - The zero-based starting index of the backward search. - The zero-based index of the last occurrence of value within the range of elements in the that extends from the first element to startIndex, if found; otherwise, -1. - startIndex is outside the range of valid indexes for the . - - - Searches for the specified and returns the zero-based index of the last occurrence within the range of elements in the that contains the specified number of elements and ends at the specified index. - The to locate in the . The value can be null. - The zero-based starting index of the backward search. - The number of elements in the section to search. - The zero-based index of the last occurrence of value within the range of elements in the that contains count number of elements and ends at startIndex, if found; otherwise, -1. - startIndex is outside the range of valid indexes for the . -or- count is less than zero. -or- startIndex and count do not specify a valid section in the . - - - Returns a read-only wrapper. - The to wrap. - A read-only wrapper around list. - list is null. - - - Returns a read-only wrapper. - The to wrap. - A read-only wrapper around list. - list is null. - - - Removes the first occurrence of a specific object from the . - The to remove from the . The value can be null. - The is read-only. -or- The has a fixed size. - - - Removes the element at the specified index of the . - The zero-based index of the element to remove. - index is less than zero. -or- index is equal to or greater than . - The is read-only. -or- The has a fixed size. - - - Removes a range of elements from the . - The zero-based starting index of the range of elements to remove. - The number of elements to remove. - index is less than zero. -or- count is less than zero. - index and count do not denote a valid range of elements in the . - The is read-only. -or- The has a fixed size. - - - Returns an whose elements are copies of the specified value. - The to copy multiple times in the new . The value can be null. - The number of times value should be copied. - An with count number of elements, all of which are copies of value. - count is less than zero. - - - Reverses the order of the elements in the entire . - The is read-only. - - - Reverses the order of the elements in the specified range. - The zero-based starting index of the range to reverse. - The number of elements in the range to reverse. - index is less than zero. -or- count is less than zero. - index and count do not denote a valid range of elements in the . - The is read-only. - - - Copies the elements of a collection over a range of elements in the . - The zero-based index at which to start copying the elements of c. - The whose elements to copy to the . The collection itself cannot be null, but it can contain elements that are null. - index is less than zero. -or- index plus the number of elements in c is greater than . - c is null. - The is read-only. - - - Sorts the elements in the entire . - The is read-only. - - - Sorts the elements in the entire using the specified comparer. - The implementation to use when comparing elements. -or- A null reference (Nothing in Visual Basic) to use the implementation of each element. - The is read-only. - An error occurred while comparing two elements. - null is passed for comparer, and the elements in the list do not implement . - - - Sorts the elements in a range of elements in using the specified comparer. - The zero-based starting index of the range to sort. - The length of the range to sort. - The implementation to use when comparing elements. -or- A null reference (Nothing in Visual Basic) to use the implementation of each element. - index is less than zero. -or- count is less than zero. - index and count do not specify a valid range in the . - The is read-only. - An error occurred while comparing two elements. - - - Returns an wrapper that is synchronized (thread safe). - The to synchronize. - An wrapper that is synchronized (thread safe). - list is null. - - - Returns an wrapper that is synchronized (thread safe). - The to synchronize. - An wrapper that is synchronized (thread safe). - list is null. - - - Gets an object that can be used to synchronize access to the . - An object that can be used to synchronize access to the . - - - Copies the elements of the to a new array. - An array containing copies of the elements of the . - - - Copies the elements of the to a new array of the specified element type. - The element of the destination array to create and copy elements to. - An array of the specified element type containing copies of the elements of the . - type is null. - The type of the source cannot be cast automatically to the specified type. - - - Sets the capacity to the actual number of elements in the . - The is read-only. -or- The has a fixed size. - - - Manages a compact array of bit values, which are represented as Booleans, where true indicates that the bit is on (1) and false indicates the bit is off (0). - - - Initializes a new instance of the class that contains bit values copied from the specified array of Booleans. - An array of Booleans to copy. - values is null. - - - Initializes a new instance of the class that contains bit values copied from the specified array of bytes. - An array of bytes containing the values to copy, where each byte represents eight consecutive bits. - bytes is null. - The length of bytes is greater than . - - - Initializes a new instance of the class that contains bit values copied from the specified . - The to copy. - bits is null. - - - Initializes a new instance of the class that can hold the specified number of bit values, which are initially set to false. - The number of bit values in the new . - length is less than zero. - - - Initializes a new instance of the class that contains bit values copied from the specified array of 32-bit integers. - An array of integers containing the values to copy, where each integer represents 32 consecutive bits. - values is null. - The length of values is greater than - - - Initializes a new instance of the class that can hold the specified number of bit values, which are initially set to the specified value. - The number of bit values in the new . - The Boolean value to assign to each bit. - length is less than zero. - - - Performs the bitwise AND operation between the elements of the current object and the corresponding elements in the specified array. The current object will be modified to store the result of the bitwise AND operation. - The array with which to perform the bitwise AND operation. - An array containing the result of the bitwise AND operation, which is a reference to the current object. - value is null. - value and the current do not have the same number of elements. - - - Creates a shallow copy of the . - A shallow copy of the . - - - Copies the entire to a compatible one-dimensional , starting at the specified index of the target array. - The one-dimensional that is the destination of the elements copied from . The must have zero-based indexing. - The zero-based index in array at which copying begins. - array is null. - index is less than zero. - array is multidimensional. -or- The number of elements in the source is greater than the available space from index to the end of the destination array. - The type of the source cannot be cast automatically to the type of the destination array. - - - Gets the number of elements contained in the . - The number of elements contained in the . - - - Gets the value of the bit at a specific position in the . - The zero-based index of the value to get. - The value of the bit at position index. - index is less than zero. -or- index is greater than or equal to the number of elements in the . - - - Returns an enumerator that iterates through the . - An for the entire . - - - Gets a value indicating whether the is read-only. - This property is always false. - - - Gets a value indicating whether access to the is synchronized (thread safe). - This property is always false. - - - Gets or sets the value of the bit at a specific position in the . - The zero-based index of the value to get or set. - The value of the bit at position index. - index is less than zero. -or- index is equal to or greater than . - - - Gets or sets the number of elements in the . - The number of elements in the . - The property is set to a value that is less than zero. - - - Inverts all the bit values in the current , so that elements set to true are changed to false, and elements set to false are changed to true. - The current instance with inverted bit values. - - - Performs the bitwise OR operation between the elements of the current object and the corresponding elements in the specified array. The current object will be modified to store the result of the bitwise OR operation. - The array with which to perform the bitwise OR operation. - An array containing the result of the bitwise OR operation, which is a reference to the current object. - value is null. - value and the current do not have the same number of elements. - - - Sets the bit at a specific position in the to the specified value. - The zero-based index of the bit to set. - The Boolean value to assign to the bit. - index is less than zero. -or- index is greater than or equal to the number of elements in the . - - - Sets all bits in the to the specified value. - The Boolean value to assign to all bits. - - - Gets an object that can be used to synchronize access to the . - An object that can be used to synchronize access to the . - - - Performs the bitwise exclusive OR operation between the elements of the current object against the corresponding elements in the specified array. The current object will be modified to store the result of the bitwise exclusive OR operation. - The array with which to perform the bitwise exclusive OR operation. - An array containing the result of the bitwise exclusive OR operation, which is a reference to the current object. - value is null. - value and the current do not have the same number of elements. - - - Compares two objects for equivalence, ignoring the case of strings. - - - Initializes a new instance of the class using the of the current thread. - - - Initializes a new instance of the class using the specified . - The to use for the new . - culture is null. - - - Performs a case-insensitive comparison of two objects of the same type and returns a value indicating whether one is less than, equal to, or greater than the other. - The first object to compare. - The second object to compare. -

A signed integer that indicates the relative values of a and b, as shown in the following table.

-
Value

-

Meaning

-

Less than zero

-

a is less than b, with casing ignored.

-

Zero

-

a equals b, with casing ignored.

-

Greater than zero

-

a is greater than b, with casing ignored.

-

-
- Neither a nor b implements the interface. -or- a and b are of different types. -
- - Gets an instance of that is associated with the of the current thread and that is always available. - An instance of that is associated with the of the current thread. - - - Gets an instance of that is associated with and that is always available. - An instance of that is associated with . - - - Provides a simple default implementation of the interface. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class using a parent custom type descriptor. - The parent custom type descriptor. - - - Returns a collection of custom attributes for the type represented by this type descriptor. - An containing the attributes for the type. The default is . - - - Returns the fully qualified name of the class represented by this type descriptor. - A containing the fully qualified class name of the type this type descriptor is describing. The default is null. - - - Returns the name of the class represented by this type descriptor. - A containing the name of the component instance this type descriptor is describing. The default is null. - - - Returns a type converter for the type represented by this type descriptor. - A for the type represented by this type descriptor. The default is a newly created . - - - Returns the event descriptor for the default event of the object represented by this type descriptor. - The for the default event on the object represented by this type descriptor. The default is null. - - - Returns the property descriptor for the default property of the object represented by this type descriptor. - A for the default property on the object represented by this type descriptor. The default is null. - - - Returns an editor of the specified type that is to be associated with the class represented by this type descriptor. - The base type of the editor to retrieve. - An editor of the given type that is to be associated with the class represented by this type descriptor. The default is null. - - - Returns a collection of event descriptors for the object represented by this type descriptor. - An containing the event descriptors for the object represented by this type descriptor. The default is . - - - Returns a filtered collection of event descriptors for the object represented by this type descriptor. - An array of attributes to use as a filter. This can be null. - An containing the event descriptions for the object represented by this type descriptor. The default is . - - - Returns a collection of property descriptors for the object represented by this type descriptor. - A containing the property descriptions for the object represented by this type descriptor. The default is . - - - Returns a filtered collection of property descriptors for the object represented by this type descriptor. - An array of attributes to use as a filter. This can be null. - A containing the property descriptions for the object represented by this type descriptor. The default is . - - - Returns an object that contains the property described by the specified property descriptor. - The property descriptor for which to retrieve the owning object. - An that owns the given property specified by the type descriptor. The default is null. - - - Indicates the base serializer to use for a root designer object. This class cannot be inherited. - - - Initializes a new instance of the class using the specified attributes. - The fully qualified name of the data type of the serializer. - The name of the base type of the serializer. A class can include multiple serializers as they all have different base types. - true if this serializer supports dynamic reloading of the document; otherwise, false. - - - Initializes a new instance of the class using the specified attributes. - The fully qualified name of the data type of the serializer. - The name of the base type of the serializer. A class can include multiple serializers, as they all have different base types. - true if this serializer supports dynamic reloading of the document; otherwise, false. - - - Initializes a new instance of the class using the specified attributes. - The data type of the serializer. - The base type of the serializer. A class can include multiple serializers as they all have different base types. - true if this serializer supports dynamic reloading of the document; otherwise, false. - - - Gets a value indicating whether the root serializer supports reloading of the design document without first disposing the designer host. - true if the root serializer supports reloading; otherwise, false. - - - Gets the fully qualified type name of the base type of the serializer. - The name of the base type of the serializer. - - - Gets the fully qualified type name of the serializer. - The name of the type of the serializer. - - - Gets a unique ID for this attribute type. - An object containing a unique ID for this attribute type. - - - Provides the base class for storing serialization data for the . - - - Initializes a new instance of the class. - - - Closes the serialization store. - - - Releases the unmanaged resources used by the and optionally releases the managed resources. - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - Gets a collection of errors that occurred during serialization or deserialization. - An that contains errors that occurred during serialization or deserialization. - - - Saves the store to the given stream. - The stream to which the store will be serialized. - - - Releases all resources used by the . - - - Provides a simple implementation of the interface. This class cannot be inherited. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class using the specified parent service provider. - A parent service provider. - - - Adds the specified service to the service container. - The type of service to add. - A callback object that can create the service. This allows a service to be declared as available, but delays creation of the object until the service is requested. - serviceType or callback is null. - A service of type serviceType already exists in the container. - - - Adds the specified service to the service container. - The type of service to add. - An instance of the service to add. This object must implement or inherit from the type indicated by the serviceType parameter. - serviceType or serviceInstance is null. - A service of type serviceType already exists in the container. - - - Adds the specified service to the service container. - The type of service to add. - A callback object that can create the service. This allows a service to be declared as available, but delays creation of the object until the service is requested. - true if this service should be added to any parent service containers; otherwise, false. - serviceType or callback is null. - A service of type serviceType already exists in the container. - - - Adds the specified service to the service container. - The type of service to add. - An instance of the service type to add. This object must implement or inherit from the type indicated by the serviceType parameter. - true if this service should be added to any parent service containers; otherwise, false. - serviceType or serviceInstance is null. - A service of type serviceType already exists in the container. - - - Gets the default services implemented directly by . - The default services. - - - Disposes this service container. - - - Disposes this service container. - true if the is in the process of being disposed of; otherwise, false. - - - Gets the requested service. - The type of service to retrieve. - An instance of the service if it could be found, or null if it could not be found. - - - Removes the specified service type from the service container. - The type of service to remove. - serviceType is null. - - - Removes the specified service type from the service container. - The type of service to remove. - true if this service should be removed from any parent service containers; otherwise, false. - serviceType is null. - - - Provides a callback mechanism that can create an instance of a service on demand. - The service container that requested the creation of the service. - The type of service to create. - - - - Defines identifiers for the standard set of commands that are available to most applications. - - - Initializes a new instance of the class. - - - Gets the for the AlignBottom command. This field is read-only. - - - - Gets the for the AlignHorizontalCenters command. This field is read-only. - - - - Gets the for the AlignLeft command. This field is read-only. - - - - Gets the for the AlignRight command. This field is read-only. - - - - Gets the for the AlignToGrid command. This field is read-only. - - - - Gets the for the AlignTop command. This field is read-only. - - - - Gets the for the AlignVerticalCenters command. This field is read-only. - - - - Gets the for the ArrangeBottom command. This field is read-only. - - - - Gets the for the ArrangeIcons command. This field is read-only. - - - - Gets the for the ArrangeRight command. This field is read-only. - - - - Gets the for the BringForward command. This field is read-only. - - - - Gets the for the BringToFront command. This field is read-only. - - - - Gets the for the CenterHorizontally command. This field is read-only. - - - - Gets the for the CenterVertically command. This field is read-only. - - - - Gets the for the Copy command. This field is read-only. - - - - Gets the for the Cut command. This field is read-only. - - - - Gets the for the Delete command. This field is read-only. - - - - Gets the for the Document Outline command. This field is read-only. - - - - Gets the for the F1Help command. This field is read-only. - - - - Gets the for the Group command. This field is read-only. - - - - Gets the for the HorizSpaceConcatenate command. This field is read-only. - - - - Gets the for the HorizSpaceDecrease command. This field is read-only. - - - - Gets the for the HorizSpaceIncrease command. This field is read-only. - - - - Gets the for the HorizSpaceMakeEqual command. This field is read-only. - - - - Gets the for the LineupIcons command. This field is read-only. - - - - Gets the for the LockControls command. This field is read-only. - - - - Gets the for the MultiLevelRedo command. This field is read-only. - - - - Gets the for the MultiLevelUndo command. This field is read-only. - - - - Gets the for the Paste command. This field is read-only. - - - - Gets the for the Properties command. This field is read-only. - - - - Gets the for the PropertiesWindow command. This field is read-only. - - - - Gets the for the Redo command. This field is read-only. - - - - Gets the for the Replace command. This field is read-only. - - - - Gets the for the SelectAll command. This field is read-only. - - - - Gets the for the SendBackward command. This field is read-only. - - - - Gets the for the SendToBack command. This field is read-only. - - - - Gets the for the ShowGrid command. This field is read-only. - - - - Gets the for the ShowLargeIcons command. This field is read-only. - - - - Gets the for the SizeToControl command. This field is read-only. - - - - Gets the for the SizeToControlHeight command. This field is read-only. - - - - Gets the for the SizeToControlWidth command. This field is read-only. - - - - Gets the for the SizeToFit command. This field is read-only. - - - - Gets the for the SizeToGrid command. This field is read-only. - - - - Gets the for the SnapToGrid command. This field is read-only. - - - - Gets the for the TabOrder command. This field is read-only. - - - - Gets the for the Undo command. This field is read-only. - - - - Gets the for the Ungroup command. This field is read-only. - - - - Gets the first of a set of verbs. This field is read-only. - - - - Gets the last of a set of verbs. This field is read-only. - - - - Gets the for the VertSpaceConcatenate command. This field is read-only. - - - - Gets the for the VertSpaceDecrease command. This field is read-only. - - - - Gets the for the VertSpaceIncrease command. This field is read-only. - - - - Gets the for the VertSpaceMakeEqual command. This field is read-only. - - - - Gets the for the ViewCode command. This field is read-only. - - - - Gets the for the ViewGrid command. This field is read-only. - - - - Defines GUID identifiers that correspond to the standard set of tool windows that are available in the design environment. - - - Initializes a new instance of the class. - - - Gets the GUID for the object browser. This field is read-only. - - - - Gets the GUID for the output window. This field is read-only. - - - - Gets the GUID for the solution explorer. This field is read-only. - - - - Gets the GUID for the Properties window. This field is read-only. - - - - Gets the GUID for the related links frame. This field is read-only. - - - - Gets the GUID for the server explorer. This field is read-only. - - - - Gets the GUID for the task list. This field is read-only. - - - - Gets the GUID for the Toolbox. This field is read-only. - - - - Provides a type description provider for a specified type. - - - Initializes a new instance of the class. - - - Gets a type description provider for the specified object. - The object to get a type description provider for. - A that corresponds with instance. - - - Gets a type description provider for the specified type. - The type to get a type description provider for. - A that corresponds with type. - - - Defines identifiers for a set of technologies that designer hosts support. - - - Specifies the default view technology support. - - - - Represents a mode in which the view object is passed directly to the development environment. - - - - Represents a mode in which a Windows Forms control object provides the display for the root designer. - - - - Specifies the class used to implement design-time services for a component. - - - Initializes a new instance of the class using the name of the type that provides design-time services. - The concatenation of the fully qualified name of the type that provides design-time services for the component this attribute is bound to, and the name of the assembly this type resides in. - - - Initializes a new instance of the class using the type that provides design-time services. - A that represents the class that provides design-time services for the component this attribute is bound to. - - - Initializes a new instance of the class using the designer type and the base class for the designer. - The concatenation of the fully qualified name of the type that provides design-time services for the component this attribute is bound to, and the name of the assembly this type resides in. - The fully qualified name of the base class to associate with the designer class. - - - Initializes a new instance of the class, using the name of the designer class and the base class for the designer. - The concatenation of the fully qualified name of the type that provides design-time services for the component this attribute is bound to, and the name of the assembly this type resides in. - A that represents the base class to associate with the designerTypeName. - - - Initializes a new instance of the class using the types of the designer and designer base class. - A that represents the class that provides design-time services for the component this attribute is bound to. - A that represents the base class to associate with the designerType. - - - Gets the name of the base type of this designer. - The name of the base type of this designer. - - - Gets the name of the designer type associated with this designer attribute. - The name of the designer type associated with this designer attribute. - - - Returns whether the value of the given object is equal to the current . - The object to test the value equality of. - true if the value of the given object is equal to that of the current; otherwise, false. - - - Returns the hash code for this instance. - A 32-bit signed integer hash code. - - - Gets a unique ID for this attribute type. - A unique ID for this attribute type. - - - Specifies that the designer for a class belongs to a certain category. - - - Initializes a new instance of the class with an empty string (""). - - - Initializes a new instance of the class with the given category name. - The name of the category. - - - Gets the name of the category. - The name of the category. - - - Specifies that a component marked with this category use a component designer. This field is read-only. - - - - Specifies that a component marked with this category cannot use a visual designer. This static field is read-only. - - - - Returns whether the value of the given object is equal to the current . - The object to test the value equality of. - true if the value of the given object is equal to that of the current; otherwise, false. - - - Specifies that a component marked with this category use a form designer. This static field is read-only. - - - - Specifies that a component marked with this category use a generic designer. This static field is read-only. - - - - Returns the hash code for this instance. - A 32-bit signed integer hash code. - - - Determines if this attribute is the default. - true if the attribute is the default value for this attribute class; otherwise, false. - - - Gets a unique identifier for this attribute. - An that is a unique identifier for the attribute. - - - Specifies the visibility a property has to the design-time serializer. - - - The code generator produces code for the contents of the object, rather than for the object itself. - - - - The code generator does not produce code for the object. - - - - The code generator produces code for the object. - - - - Specifies the type of persistence to use when serializing a property on a component at design time. - - - Initializes a new instance of the class using the specified value. - One of the values. - - - Specifies that a serializer should serialize the contents of the property, rather than the property itself. This field is read-only. - - - - Specifies the default value, which is , that is, a visual designer uses default rules to generate the value of a property. This static field is read-only. - - - - Indicates whether this instance and a specified object are equal. - Another object to compare to. - true if obj is equal to this instance; otherwise, false. - - - Returns the hash code for this object. - A 32-bit signed integer hash code. - - - Specifies that a serializer should not serialize the value of the property. This static field is read-only. - - - - Gets a value indicating whether the current value of the attribute is the default value for the attribute. - true if the attribute is set to the default value; otherwise, false. - - - Gets a value indicating the basic serialization mode a serializer should use when determining whether and how to persist the value of a property. - One of the values. The default is . - - - Specifies that a serializer should be allowed to serialize the value of the property. This static field is read-only. - - - - Specifies whether a property can only be set at design time. - - - Initializes a new instance of the class. - true if a property can be set only at design time; false if the property can be set at design time and at run time. - - - Specifies the default value for the , which is . This static field is read-only. - - - - Returns whether the value of the given object is equal to the current . - The object to test the value equality of. - true if the value of the given object is equal to that of the current; otherwise, false. - - - Returns the hash code for this instance. - A 32-bit signed integer hash code. - - - Determines if this attribute is the default. - true if the attribute is the default value for this attribute class; otherwise, false. - - - Gets a value indicating whether a property can be set only at design time. - true if a property can be set only at design time; otherwise, false. - - - Specifies that a property can be set at design time or at run time. This static field is read-only. - - - - Specifies that a property can be set only at design time. This static field is read-only. - - - - marks a component's visibility. If is present, a visual designer can show this component on a designer. - - - Creates a new set to the default value of false. - - - Creates a new with the property set to the given value in visible. - The value that the property will be set against. - - - The default visibility which is Yes. - - - - Returns a value that indicates whether this instance is equal to a specified object. - An Object to compare with this instance or a null reference (Nothing in Visual Basic). - true if obj equals the type and value of this instance; otherwise, false. - - - Returns the hash code for this instance. - A 32-bit signed integer hash code. - - - Gets a value indicating if this instance is equal to the value. - true, if this instance is equal to the value; otherwise, false. - - - Marks a component as not visible in a visual designer. - - - - Gets or sets whether the component should be shown at design time. - true if this component should be shown at design time, or false if it shouldn't. - - - Marks a component as visible in a visual designer. - - - - Specifies the display name for a property, event, or public void method which takes no arguments. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class using the display name. - The display name. - - - Specifies the default value for the . This field is read-only. - - - - Gets the display name for a property, event, or public void method that takes no arguments stored in this attribute. - The display name. - - - Gets or sets the display name. - The display name. - - - Determines whether two instances are equal. - The to test the value equality of. - true if the value of the given object is equal to that of the current object; otherwise, false. - - - Returns the hash code for this instance. - A hash code for the current . - - - Determines if this attribute is the default. - true if the attribute is the default value for this attribute class; otherwise, false. - - - Provides a type converter to convert double-precision, floating point number objects to and from various other representations. - - - Initializes a new instance of the class. - - - Provides data for the event handler. - - - Initializes a new instance of the class. - Specifies an argument for an asynchronous operation. - - - Gets a value that represents the argument of an asynchronous operation. - An representing the argument of an asynchronous operation. - - - Gets or sets a value that represents the result of an asynchronous operation. - An representing the result of an asynchronous operation. - - - Represents the method that will handle the event. This class cannot be inherited. - The source of the event. - A that contains the event data. - - - Specifies the editor to use to change a property. This class cannot be inherited. - - - Initializes a new instance of the class with the default editor, which is no editor. - - - Initializes a new instance of the class with the type name and base type name of the editor. - The fully qualified type name of the editor. - The fully qualified type name of the base class or interface to use as a lookup key for the editor. This class must be or derive from . - - - Initializes a new instance of the class with the type name and the base type. - The fully qualified type name of the editor. - The of the base class or interface to use as a lookup key for the editor. This class must be or derive from . - - - Initializes a new instance of the class with the type and the base type. - A that represents the type of the editor. - The of the base class or interface to use as a lookup key for the editor. This class must be or derive from . - - - Gets the name of the base class or interface serving as a lookup key for this editor. - The name of the base class or interface serving as a lookup key for this editor. - - - Gets the name of the editor class in the format. - The name of the editor class in the format. - - - Returns whether the value of the given object is equal to the current . - The object to test the value equality of. - true if the value of the given object is equal to that of the current object; otherwise, false. - - - Returns the hash code for this instance. - A 32-bit signed integer hash code. - - - Gets a unique ID for this attribute type. - A unique ID for this attribute type. - - - Specifies that a property or method is viewable in an editor. This class cannot be inherited. - - - Initializes a new instance of the class with set to the default state. - - - Initializes a new instance of the class with an . - The to set to. - - - Returns whether the value of the given object is equal to the current . - The object to test the value equality of. - true if the value of the given object is equal to that of the current; otherwise, false. - - - Returns the hash code for this instance. - A 32-bit signed integer hash code. - - - Gets the browsable state of the property or method. - An that is the browsable state of the property or method. - - - Specifies the browsable state of a property or method from within an editor. - - - The property or method is a feature that only advanced users should see. An editor can either show or hide such properties. - - - - The property or method is always browsable from within an editor. - - - - The property or method is never browsable from within an editor. - - - - Provides a type converter to convert objects to and from various other representations. - - - Initializes a new instance of the class for the given type. - A that represents the type of enumeration to associate with this enumeration converter. - - - Gets a value indicating whether this converter can convert an object in the given source type to an enumeration object using the specified context. - An that provides a format context. - A that represents the type you wish to convert from. - true if this converter can perform the conversion; otherwise, false. - - - Gets a value indicating whether this converter can convert an object to the given destination type using the context. - An that provides a format context. - A that represents the type you wish to convert to. - true if this converter can perform the conversion; otherwise, false. - - - Gets an that can be used to sort the values of the enumeration. - An for sorting the enumeration values. - - - Converts the specified value object to an enumeration object. - An that provides a format context. - An optional . If not supplied, the current culture is assumed. - The to convert. - An that represents the converted value. - value is not a valid value for the target type. - The conversion cannot be performed. - - - Converts the given value object to the specified destination type. - An that provides a format context. - An optional . If not supplied, the current culture is assumed. - The to convert. - The to convert the value to. - An that represents the converted value. - destinationType is null. - value is not a valid value for the enumeration. - The conversion cannot be performed. - - - Specifies the type of the enumerator this converter is associated with. - The type of the enumerator this converter is associated with. - - - Gets a collection of standard values for the data type this validator is designed for. - An that provides a format context. - A that holds a standard set of valid values, or null if the data type does not support a standard set of values. - - - Gets a value indicating whether the list of standard values returned from is an exclusive list using the specified context. - An that provides a format context. - true if the returned from is an exhaustive list of possible values; false if other values are possible. - - - Gets a value indicating whether this object supports a standard set of values that can be picked from a list using the specified context. - An that provides a format context. - true because should be called to find a common set of values the object supports. This method never returns false. - - - Gets a value indicating whether the given object value is valid for this type. - An that provides a format context. - The to test. - true if the specified value is valid for this object; otherwise, false. - - - Gets or sets a that specifies the possible values for the enumeration. - A that specifies the possible values for the enumeration. - - - Provides information about an event. - - - Initializes a new instance of the class with the name and attributes in the specified . - A that contains the name of the event and its attributes. - - - Initializes a new instance of the class with the name in the specified and the attributes in both the and the array. - A that has the name of the member and its attributes. - An array with the attributes you want to add to this event description. - - - Initializes a new instance of the class with the specified name and attribute array. - The name of the event. - An array of type that contains the event attributes. - - - When overridden in a derived class, binds the event to the component. - A component that provides events to the delegate. - A delegate that represents the method that handles the event. - - - When overridden in a derived class, gets the type of component this event is bound to. - A that represents the type of component the event is bound to. - - - When overridden in a derived class, gets the type of delegate for the event. - A that represents the type of delegate for the event. - - - When overridden in a derived class, gets a value indicating whether the event delegate is a multicast delegate. - true if the event delegate is multicast; otherwise, false. - - - When overridden in a derived class, unbinds the delegate from the component so that the delegate will no longer receive events from the component. - The component that the delegate is bound to. - The delegate to unbind from the component. - - - Represents the exception that is thrown when the property of a cannot be evaluated. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with the specified string. - The string to display when the exception is thrown. - - - Initializes a new instance of the class with the and the . - The data needed to serialize or deserialize an object. - The source and destination of a particular serialized stream. - - - Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. - The error message that explains the reason for the exception. - The exception that is the cause of the current exception, or a null reference (Nothing in Visual Basic) if no inner exception is specified. - - - Provides data for the event of a . - - - Initializes a new instance of the class. - The being updated. - The values for the row being updated. - - - Gets or sets a value indicating whether to continue the fill operation despite the error. - true if the fill operation should continue; otherwise, false. - - - Gets the being updated when the error occurred. - The being updated. - - - Gets the errors being handled. - The errors being handled. - - - Gets the values for the row being updated when the error occurred. - The values for the row being updated. - - - Represents the method that will handle the event. - The source of the event. - The that contains the event data. - - - Represents an action restriction enforced on a set of columns in a primary key/foreign key relationship when a value or row is either deleted or updated. - - - Initializes a new instance of the class with the specified parent and child objects. - The parent in the constraint. - The child in the constraint. - One or both of the columns is null. - The columns have different data types. -Or - The tables don't belong to the same . - - - Initializes a new instance of the class with the specified arrays of parent and child objects. - An array of parent in the constraint. - An array of child in the constraint. - One or both of the columns is null. - The columns have different data types. -Or - The tables don't belong to the same . - - - Initializes a new instance of the class with the specified name, parent and child objects. - The name of the constraint. - The parent in the constraint. - The child in the constraint. - One or both of the columns is null. - The columns have different data types. -Or - The tables don't belong to the same . - - - Initializes a new instance of the class with the specified name, and arrays of parent and child objects. - The name of the . If null or empty string, a default name will be given when added to the constraints collection. - An array of parent in the constraint. - An array of child in the constraint. - One or both of the columns is null. - The columns have different data types. -Or - The tables don't belong to the same . - - - This constructor is provided for design time support in the Visual Studio environment. objects created by using this constructor must then be added to the collection via . Tables and columns with the specified names must exist at the time the method is called, or if has been called prior to calling this constructor, the tables and columns with the specified names must exist at the time that is called. - The name of the constraint. - The name of the parent that contains parent objects in the constraint. - An array of the names of parent objects in the constraint. - An array of the names of child objects in the constraint. - One of the values. Possible values include None, Cascade, and Default. - One of the values to use when a row is deleted. The default is Cascade. Possible values include: None, Cascade, SetNull, SetDefault, and Default. - One of the values to use when a row is updated. The default is Cascade. Possible values include: None, Cascade, SetNull, SetDefault, and Default. - One or both of the columns is null. - The columns have different data types. -Or - The tables don't belong to the same . - - - This constructor is provided for design time support in the Visual Studio environment. objects created by using this constructor must then be added to the collection via . Tables and columns with the specified names must exist at the time the method is called, or if has been called prior to calling this constructor, the tables and columns with the specified names must exist at the time that is called. - The name of the constraint. - The name of the parent that contains parent objects in the constraint. - The name of the . - An array of the names of parent objects in the constraint. - An array of the names of child objects in the constraint. - One of the values. Possible values include None, Cascade, and Default. - One of the values to use when a row is deleted. The default is Cascade. Possible values include: None, Cascade, SetNull, SetDefault, and Default. - One of the values to use when a row is updated. The default is Cascade. Possible values include: None, Cascade, SetNull, SetDefault, and Default. - One or both of the columns is null. - The columns have different data types. -Or - The tables don't belong to the same . - - - Indicates the action that should take place across this constraint when is invoked. - One of the values. Possible values include None, and Cascade. The default is None. - - - Gets the child columns of this constraint. - An array of objects that are the child columns of the constraint. - - - Gets or sets the action that occurs across this constraint when a row is deleted. - One of the values. The default is Cascade. - - - Gets a value indicating whether the current is identical to the specified object. - The object to which this is compared. Two are equal if they constrain the same columns. - true, if the objects are identical; otherwise, false. - - - Gets the hash code of this instance of the object. - A 32-bit signed integer hash code. - - - The parent columns of this constraint. - An array of objects that are the parent columns of the constraint. - - - Gets the parent table of this constraint. - The parent of this constraint. - - - Gets the child table of this constraint. - A that is the child table in the constraint. - - - Gets or sets the action that occurs across this constraint on when a row is updated. - One of the values. The default is Cascade. - - - Associates a data source column with a column, and is implemented by the class, which is used in common by .NET Framework data providers. - - - Gets or sets the name of the column within the to map to. - The name of the column within the to map to. The name is not case sensitive. - - - Gets or sets the name of the column within the data source to map from. The name is case-sensitive. - The case-sensitive name of the column in the data source. - - - Contains a collection of DataColumnMapping objects, and is implemented by the , which is used in common by .NET Framework data providers. - - - Adds a ColumnMapping object to the ColumnMapping collection using the source column and column names. - The case-sensitive name of the source column. - The name of the column. - The ColumnMapping object that was added to the collection. - - - Gets a value indicating whether the contains a object with the specified source column name. - The case-sensitive name of the source column. - true if a object with the specified source column name exists, otherwise false. - - - Gets the ColumnMapping object with the specified column name. - The name of the column within the collection. - The ColumnMapping object with the specified DataSet column name. - - - Gets the location of the object with the specified source column name. The name is case-sensitive. - The case-sensitive name of the source column. - The zero-based location of the DataColumnMapping object with the specified source column name. - - - Gets or sets the object with the specified SourceColumn name. - The SourceColumn name of the IColumnMapping object to find. - The IColumnMapping object with the specified SourceColumn name. - - - Removes the object with the specified name from the collection. - The case-sensitive SourceColumn name. - A object does not exist with the specified SourceColumn name. - - - Allows an object to implement a DataAdapter, and represents a set of methods and mapping action-related properties that are used to fill and update a and update a data source. instances are for data sources that are (or resemble) relational databases with textual commands (like Transact-SQL), while instances could can use any type of data source. - - - Adds or updates rows in the to match those in the data source using the name, and creates a named "Table". - A to fill with records and, if necessary, schema. - The number of rows successfully added to or refreshed in the . This does not include rows affected by statements that do not return rows. - - - Adds a named "Table" to the specified and configures the schema to match that in the data source based on the specified . - The to be filled with the schema from the data source. - One of the values. - An array of objects that contain schema information returned from the data source. - - - Gets the parameters set by the user when executing an SQL SELECT statement. - An array of objects that contains the parameters set by the user. - - - Indicates or specifies whether unmapped source tables or columns are passed with their source names in order to be filtered or to raise an error. - One of the values. The default is Passthrough. - The value set is not one of the values. - - - Indicates or specifies whether missing source tables, columns, and their relationships are added to the dataset schema, ignored, or cause an error to be raised. - One of the values. The default is Add. - The value set is not one of the values. - - - Indicates how a source table is mapped to a dataset table. - A collection that provides the master mapping between the returned records and the . The default value is an empty collection. - - - Calls the respective INSERT, UPDATE, or DELETE statements for each inserted, updated, or deleted row in the specified from a named "Table". - The used to update the data source. - The number of rows successfully updated from the . - An attempt to execute an INSERT, UPDATE, or DELETE statement resulted in zero records affected. - - - Represents a parameter to a Command object, and optionally, its mapping to columns; and is implemented by .NET Framework data providers that access data sources. - - - Gets or sets the of the parameter. - One of the values. The default is . - The property was not set to a valid . - - - Gets or sets a value indicating whether the parameter is input-only, output-only, bidirectional, or a stored procedure return value parameter. - One of the values. The default is Input. - The property was not set to one of the valid values. - - - Gets a value indicating whether the parameter accepts null values. - true if null values are accepted; otherwise, false. The default is false. - - - Gets or sets the name of the . - The name of the . The default is an empty string. - - - Gets or sets the name of the source column that is mapped to the and used for loading or returning the . - The name of the source column that is mapped to the . The default is an empty string. - - - Gets or sets the to use when loading . - One of the values. The default is Current. - The property was not set one of the values. - - - Gets or sets the value of the parameter. - An that is the value of the parameter. The default value is null. - - - Collects all parameters relevant to a Command object and their mappings to columns, and is implemented by .NET Framework data providers that access data sources. - - - Gets a value indicating whether a parameter in the collection has the specified name. - The name of the parameter. - true if the collection contains the parameter; otherwise, false. - - - Gets the location of the within the collection. - The name of the parameter. - The zero-based location of the within the collection. - - - Gets or sets the parameter at the specified index. - The name of the parameter to retrieve. - An at the specified index. - - - Removes the from the collection. - The name of the parameter. - - - Provides a means of reading one or more forward-only streams of result sets obtained by executing a command at a data source, and is implemented by .NET Framework data providers that access relational databases. - - - Closes the Object. - - - Gets a value indicating the depth of nesting for the current row. - The level of nesting. - - - Returns a that describes the column metadata of the . - A that describes the column metadata. - The is closed. - - - Gets a value indicating whether the data reader is closed. - true if the data reader is closed; otherwise, false. - - - Advances the data reader to the next result, when reading the results of batch SQL statements. - true if there are more rows; otherwise, false. - - - Advances the to the next record. - true if there are more rows; otherwise, false. - - - Gets the number of rows changed, inserted, or deleted by execution of the SQL statement. - The number of rows changed, inserted, or deleted; 0 if no rows were affected or the statement failed; and -1 for SELECT statements. - - - Provides access to the column values within each row for a DataReader, and is implemented by .NET Framework data providers that access relational databases. - - - Gets the number of columns in the current row. - When not positioned in a valid recordset, 0; otherwise, the number of columns in the current record. The default is -1. - - - Gets the value of the specified column as a Boolean. - The zero-based column ordinal. - The value of the column. - The index passed was outside the range of 0 through . - - - Gets the 8-bit unsigned integer value of the specified column. - The zero-based column ordinal. - The 8-bit unsigned integer value of the specified column. - The index passed was outside the range of 0 through . - - - Reads a stream of bytes from the specified column offset into the buffer as an array, starting at the given buffer offset. - The zero-based column ordinal. - The index within the field from which to start the read operation. - The buffer into which to read the stream of bytes. - The index for buffer to start the read operation. - The number of bytes to read. - The actual number of bytes read. - The index passed was outside the range of 0 through . - - - Gets the character value of the specified column. - The zero-based column ordinal. - The character value of the specified column. - The index passed was outside the range of 0 through . - - - Reads a stream of characters from the specified column offset into the buffer as an array, starting at the given buffer offset. - The zero-based column ordinal. - The index within the row from which to start the read operation. - The buffer into which to read the stream of bytes. - The index for buffer to start the read operation. - The number of bytes to read. - The actual number of characters read. - The index passed was outside the range of 0 through . - - - Returns an for the specified column ordinal. - The index of the field to find. - The for the specified column ordinal. - The index passed was outside the range of 0 through . - - - Gets the data type information for the specified field. - The index of the field to find. - The data type information for the specified field. - The index passed was outside the range of 0 through . - - - Gets the date and time data value of the specified field. - The index of the field to find. - The date and time data value of the specified field. - The index passed was outside the range of 0 through . - - - Gets the fixed-position numeric value of the specified field. - The index of the field to find. - The fixed-position numeric value of the specified field. - The index passed was outside the range of 0 through . - - - Gets the double-precision floating point number of the specified field. - The index of the field to find. - The double-precision floating point number of the specified field. - The index passed was outside the range of 0 through . - - - Gets the information corresponding to the type of that would be returned from . - The index of the field to find. - The information corresponding to the type of that would be returned from . - The index passed was outside the range of 0 through . - - - Gets the single-precision floating point number of the specified field. - The index of the field to find. - The single-precision floating point number of the specified field. - The index passed was outside the range of 0 through . - - - Returns the GUID value of the specified field. - The index of the field to find. - The GUID value of the specified field. - The index passed was outside the range of 0 through . - - - Gets the 16-bit signed integer value of the specified field. - The index of the field to find. - The 16-bit signed integer value of the specified field. - The index passed was outside the range of 0 through . - - - Gets the 32-bit signed integer value of the specified field. - The index of the field to find. - The 32-bit signed integer value of the specified field. - The index passed was outside the range of 0 through . - - - Gets the 64-bit signed integer value of the specified field. - The index of the field to find. - The 64-bit signed integer value of the specified field. - The index passed was outside the range of 0 through . - - - Gets the name for the field to find. - The index of the field to find. - The name of the field or the empty string (""), if there is no value to return. - The index passed was outside the range of 0 through . - - - Return the index of the named field. - The name of the field to find. - The index of the named field. - - - Gets the string value of the specified field. - The index of the field to find. - The string value of the specified field. - The index passed was outside the range of 0 through . - - - Return the value of the specified field. - The index of the field to find. - The which will contain the field value upon return. - The index passed was outside the range of 0 through . - - - Populates an array of objects with the column values of the current record. - An array of to copy the attribute fields into. - The number of instances of in the array. - - - Return whether the specified field is set to null. - The index of the field to find. - true if the specified field is set to null; otherwise, false. - The index passed was outside the range of 0 through . - - - Gets the column located at the specified index. - The zero-based index of the column to get. - The column located at the specified index as an . - The index passed was outside the range of 0 through . - - - Gets the column with the specified name. - The name of the column to find. - The column with the specified name as an . - No column with the specified name was found. - - - Represents an SQL statement that is executed while connected to a data source, and is implemented by .NET Framework data providers that access relational databases. - - - Attempts to cancels the execution of an . - - - Gets or sets the text command to run against the data source. - The text command to execute. The default value is an empty string (""). - - - Gets or sets the wait time before terminating the attempt to execute a command and generating an error. - The time (in seconds) to wait for the command to execute. The default value is 30 seconds. - The property value assigned is less than 0. - - - Indicates or specifies how the property is interpreted. - One of the values. The default is Text. - - - Gets or sets the used by this instance of the . - The connection to the data source. - - - Creates a new instance of an object. - An IDbDataParameter object. - - - Executes an SQL statement against the Connection object of a .NET Framework data provider, and returns the number of rows affected. - The number of rows affected. - The connection does not exist. -or- The connection is not open. - - - Executes the against the and builds an . - An object. - - - Executes the against the , and builds an using one of the values. - One of the values. - An object. - - - Executes the query, and returns the first column of the first row in the resultset returned by the query. Extra columns or rows are ignored. - The first column of the first row in the resultset. - - - Gets the . - The parameters of the SQL statement or stored procedure. - - - Creates a prepared (or compiled) version of the command on the data source. - The is not set. -or- The is not . - - - Gets or sets the transaction within which the Command object of a .NET Framework data provider executes. - the Command object of a .NET Framework data provider executes. The default value is null. - - - Gets or sets how command results are applied to the when used by the method of a . - One of the values. The default is Both unless the command is automatically generated. Then the default is None. - The value entered was not one of the values. - - - Represents an open connection to a data source, and is implemented by .NET Framework data providers that access relational databases. - - - Begins a database transaction. - An object representing the new transaction. - - - Begins a database transaction with the specified value. - One of the values. - An object representing the new transaction. - - - Changes the current database for an open Connection object. - The name of the database to use in place of the current database. - - - Closes the connection to the database. - - - Gets or sets the string used to open a database. - A string containing connection settings. - - - Gets the time to wait while trying to establish a connection before terminating the attempt and generating an error. - The time (in seconds) to wait for a connection to open. The default value is 15 seconds. - - - Creates and returns a Command object associated with the connection. - A Command object associated with the connection. - - - Gets the name of the current database or the database to be used after a connection is opened. - The name of the current database or the name of the database to be used once a connection is open. The default value is an empty string. - - - Opens a database connection with the settings specified by the ConnectionString property of the provider-specific Connection object. - - - Gets the current state of the connection. - One of the values. - - - Represents a set of command-related properties that are used to fill the and update a data source, and is implemented by .NET Framework data providers that access relational databases. - - - Gets or sets an SQL statement for deleting records from the data set. - An used during to delete records in the data source for deleted rows in the data set. - - - Gets or sets an SQL statement used to insert new records into the data source. - An used during to insert records in the data source for new rows in the data set. - - - Gets or sets an SQL statement used to select records in the data source. - An that is used during to select records from data source for placement in the data set. - - - Gets or sets an SQL statement used to update records in the data source. - An used during to update records in the data source for modified rows in the data set. - - - Used by the Visual Basic .NET Data Designers to represent a parameter to a Command object, and optionally, its mapping to columns. - - - Indicates the precision of numeric parameters. - The maximum number of digits used to represent the Value property of a data provider Parameter object. The default value is 0, which indicates that a data provider sets the precision for Value. - - - Indicates the scale of numeric parameters. - The number of decimal places to which is resolved. The default is 0. - - - The size of the parameter. - The maximum size, in bytes, of the data within the column. The default value is inferred from the the parameter value. - - - Represents a transaction to be performed at a data source, and is implemented by .NET Framework data providers that access relational databases. - - - Commits the database transaction. - An error occurred while trying to commit the transaction. - The transaction has already been committed or rolled back. -or- The connection is broken. - - - Specifies the Connection object to associate with the transaction. - The Connection object to associate with the transaction. - - - Specifies the for this transaction. - The for this transaction. The default is ReadCommitted. - - - Rolls back a transaction from a pending state. - An error occurred while trying to commit the transaction. - The transaction has already been committed or rolled back. -or- The connection is broken. - - - Represents the exception that is thrown when you call the method within the event. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with the specified string. - The string to display when the exception is thrown. - - - Initializes a new instance of the class with serialization information. - The data that is required to serialize or deserialize an object. - Description of the source and destination of the specified serialized stream. - - - Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. - The error message that explains the reason for the exception. - The exception that is the cause of the current exception, or a null reference (Nothing in Visual Basic) if no inner exception is specified. - - - Specifies SQL Server-specific data type of a field, property, for use in a . - - - . A 64-bit signed integer. - - - - of type . A fixed-length stream of binary data ranging between 1 and 8,000 bytes. - - - - . An unsigned numeric value that can be 0, 1, or null. - - - - . A fixed-length stream of non-Unicode characters ranging between 1 and 8,000 characters. - - - - Date data ranging in value from January 1,1 AD through December 31, 9999 AD. - - - - . Date and time data ranging in value from January 1, 1753 to December 31, 9999 to an accuracy of 3.33 milliseconds. - - - - Date and time data. Date value range is from January 1,1 AD through December 31, 9999 AD. Time value range is 00:00:00 through 23:59:59.9999999 with an accuracy of 100 nanoseconds. - - - - Date and time data with time zone awareness. Date value range is from January 1,1 AD through December 31, 9999 AD. Time value range is 00:00:00 through 23:59:59.9999999 with an accuracy of 100 nanoseconds. Time zone value range is -14:00 through +14:00. - - - - . A fixed precision and scale numeric value between -10 38 -1 and 10 38 -1. - - - - . A floating point number within the range of -1.79E +308 through 1.79E +308. - - - - of type . A variable-length stream of binary data ranging from 0 to 2 31 -1 (or 2,147,483,647) bytes. - - - - . A 32-bit signed integer. - - - - . A currency value ranging from -2 63 (or -9,223,372,036,854,775,808) to 2 63 -1 (or +9,223,372,036,854,775,807) with an accuracy to a ten-thousandth of a currency unit. - - - - . A fixed-length stream of Unicode characters ranging between 1 and 4,000 characters. - - - - . A variable-length stream of Unicode data with a maximum length of 2 30 - 1 (or 1,073,741,823) characters. - - - - . A variable-length stream of Unicode characters ranging between 1 and 4,000 characters. Implicit conversion fails if the string is greater than 4,000 characters. Explicitly set the object when working with strings longer than 4,000 characters. Use when the database column is nvarchar(max). - - - - . A floating point number within the range of -3.40E +38 through 3.40E +38. - - - - . Date and time data ranging in value from January 1, 1900 to June 6, 2079 to an accuracy of one minute. - - - - . A 16-bit signed integer. - - - - . A currency value ranging from -214,748.3648 to +214,748.3647 with an accuracy to a ten-thousandth of a currency unit. - - - - A special data type for specifying structured data contained in table-valued parameters. - - - - . A variable-length stream of non-Unicode data with a maximum length of 2 31 -1 (or 2,147,483,647) characters. - - - - Time data based on a 24-hour clock. Time value range is 00:00:00 through 23:59:59.9999999 with an accuracy of 100 nanoseconds. Corresponds to a SQL Server time value. - - - - of type . Automatically generated binary numbers, which are guaranteed to be unique within a database. timestamp is used typically as a mechanism for version-stamping table rows. The storage size is 8 bytes. - - - - . An 8-bit unsigned integer. - - - - A SQL Server user-defined type (UDT). - - - - . A globally unique identifier (or GUID). - - - - of type . A variable-length stream of binary data ranging between 1 and 8,000 bytes. Implicit conversion fails if the byte array is greater than 8,000 bytes. Explicitly set the object when working with byte arrays larger than 8,000 bytes. - - - - . A variable-length stream of non-Unicode characters ranging between 1 and 8,000 characters. Use when the database column is varchar(max). - - - - . A special data type that can contain numeric, string, binary, or date data as well as the SQL Server values Empty and Null, which is assumed if no other type is declared. - - - - An XML value. Obtain the XML as a string using the method or property, or as an by calling the method. - - - - Indicates whether a listener should trace based on the event type. - - - Initializes a new instance of the class. - A bitwise combination of the values that specifies the event type of the messages to trace. - - - Gets or sets the event type of the messages to trace. - A bitwise combination of the values. - - - Determines whether the trace listener should trace the event. - A that represents the information cache for the trace event. - The name of the source. - One of the values. - A trace identifier number. - The format to use for writing an array of arguments, or a message to write. - An array of argument objects. - A trace data object. - An array of trace data objects. - true if the trace should be produced; otherwise, false. - - - Provides version information for a physical file on disk. - - - Gets the comments associated with the file. - The comments associated with the file or null if the file did not contain version information. - - - Gets the name of the company that produced the file. - The name of the company that produced the file or null if the file did not contain version information. - - - Gets the build number of the file. - A value representing the build number of the file or null if the file did not contain version information. - - - Gets the description of the file. - The description of the file or null if the file did not contain version information. - - - Gets the major part of the version number. - A value representing the major part of the version number or 0 (zero) if the file did not contain version information. - - - Gets the minor part of the version number of the file. - A value representing the minor part of the version number of the file or 0 (zero) if the file did not contain version information. - - - Gets the name of the file that this instance of describes. - The name of the file described by this instance of . - - - Gets the file private part number. - A value representing the file private part number or null if the file did not contain version information. - - - Gets the file version number. - The version number of the file or null if the file did not contain version information. - - - Returns a representing the version information associated with the specified file. - The fully qualified path and name of the file to retrieve the version information for. - A containing information about the file. If the file did not contain version information, the contains only the name of the file requested. - The file specified cannot be found. - - - Gets the internal name of the file, if one exists. - The internal name of the file. If none exists, this property will contain the original name of the file without the extension. - - - Gets a value that specifies whether the file contains debugging information or is compiled with debugging features enabled. - true if the file contains debugging information or is compiled with debugging features enabled; otherwise, false. - - - Gets a value that specifies whether the file has been modified and is not identical to the original shipping file of the same version number. - true if the file is patched; otherwise, false. - - - Gets a value that specifies whether the file is a development version, rather than a commercially released product. - true if the file is prerelease; otherwise, false. - - - Gets a value that specifies whether the file was built using standard release procedures. - true if the file is a private build; false if the file was built using standard release procedures or if the file did not contain version information. - - - Gets a value that specifies whether the file is a special build. - true if the file is a special build; otherwise, false. - - - Gets the default language string for the version info block. - The description string for the Microsoft Language Identifier in the version resource or null if the file did not contain version information. - - - Gets all copyright notices that apply to the specified file. - The copyright notices that apply to the specified file. - - - Gets the trademarks and registered trademarks that apply to the file. - The trademarks and registered trademarks that apply to the file or null if the file did not contain version information. - - - Gets the name the file was created with. - The name the file was created with or null if the file did not contain version information. - - - Gets information about a private version of the file. - Information about a private version of the file or null if the file did not contain version information. - - - Gets the build number of the product this file is associated with. - A value representing the build number of the product this file is associated with or null if the file did not contain version information. - - - Gets the major part of the version number for the product this file is associated with. - A value representing the major part of the product version number or null if the file did not contain version information. - - - Gets the minor part of the version number for the product the file is associated with. - A value representing the minor part of the product version number or null if the file did not contain version information. - - - Gets the name of the product this file is distributed with. - The name of the product this file is distributed with or null if the file did not contain version information. - - - Gets the private part number of the product this file is associated with. - A value representing the private part number of the product this file is associated with or null if the file did not contain version information. - - - Gets the version of the product this file is distributed with. - The version of the product this file is distributed with or null if the file did not contain version information. - - - Gets the special build information for the file. - The special build information for the file or null if the file did not contain version information. - - - Returns a partial list of properties in the and their values. - A list of the following properties in this class and their values: , , , , , , , , , , , , . If the file did not contain version information, this list will contain only the name of the requested file. Boolean values will be false, and all other entries will be null. - - - Specifies a description for a property or event. - - - Initializes a new instance of the class, using the specified description. - The application-defined description text. - - - Gets description text associated with the item monitored. - An application-defined description. - - - Encapsulates a method that has one parameter and returns a value of the type specified by the TResult parameter. - The parameter of the method that this delegate encapsulates. - The type of the parameter of the method that this delegate encapsulates. - The type of the return value of the method that this delegate encapsulates. - - - - Encapsulates a method that has two parameters and returns a value of the type specified by the TResult parameter. - The first parameter of the method that this delegate encapsulates. - The second parameter of the method that this delegate encapsulates. - The type of the first parameter of the method that this delegate encapsulates. - The type of the second parameter of the method that this delegate encapsulates. - The type of the return value of the method that this delegate encapsulates. - - - - Encapsulates a method that has three parameters and returns a value of the type specified by the TResult parameter. - The first parameter of the method that this delegate encapsulates. - The second parameter of the method that this delegate encapsulates. - The third parameter of the method that this delegate encapsulates. - The type of the first parameter of the method that this delegate encapsulates. - The type of the second parameter of the method that this delegate encapsulates. - The type of the third parameter of the method that this delegate encapsulates. - The type of the return value of the method that this delegate encapsulates. - - - - Encapsulates a method that has four parameters and returns a value of the type specified by the TResult parameter. - The first parameter of the method that this delegate encapsulates. - The second parameter of the method that this delegate encapsulates. - The third parameter of the method that this delegate encapsulates. - The fourth parameter of the method that this delegate encapsulates. - The type of the first parameter of the method that this delegate encapsulates. - The type of the second parameter of the method that this delegate encapsulates. - The type of the third parameter of the method that this delegate encapsulates. - The type of the fourth parameter of the method that this delegate encapsulates. - The type of the return value of the method that this delegate encapsulates. - - - - Encapsulates a method that has five parameters and returns a value of the type specified by the TResult parameter. - The first parameter of the method that this delegate encapsulates. - The second parameter of the method that this delegate encapsulates. - The third parameter of the method that this delegate encapsulates. - The fourth parameter of the method that this delegate encapsulates. - The fifth parameter of the method that this delegate encapsulates. - The type of the first parameter of the method that this delegate encapsulates. - The type of the second parameter of the method that this delegate encapsulates. - The type of the third parameter of the method that this delegate encapsulates. - The type of the fourth parameter of the method that this delegate encapsulates. - The type of the fifth parameter of the method that this delegate encapsulates. - The type of the return value of the method that this delegate encapsulates. - - - - Encapsulates a method that has six parameters and returns a value of the type specified by the TResult parameter. - The first parameter of the method that this delegate encapsulates. - The second parameter of the method that this delegate encapsulates. - The third parameter of the method that this delegate encapsulates. - The fourth parameter of the method that this delegate encapsulates. - The fifth parameter of the method that this delegate encapsulates. - The sixth parameter of the method that this delegate encapsulates. - The type of the first parameter of the method that this delegate encapsulates. - The type of the second parameter of the method that this delegate encapsulates. - The type of the third parameter of the method that this delegate encapsulates. - The type of the fourth parameter of the method that this delegate encapsulates. - The type of the fifth parameter of the method that this delegate encapsulates. - The type of the sixth parameter of the method that this delegate encapsulates. - The type of the return value of the method that this delegate encapsulates. - - - - Encapsulates a method that has seven parameters and returns a value of the type specified by the TResult parameter. - The first parameter of the method that this delegate encapsulates. - The second parameter of the method that this delegate encapsulates. - The third parameter of the method that this delegate encapsulates. - The fourth parameter of the method that this delegate encapsulates. - The fifth parameter of the method that this delegate encapsulates. - The sixth parameter of the method that this delegate encapsulates. - The seventh parameter of the method that this delegate encapsulates. - The type of the first parameter of the method that this delegate encapsulates. - The type of the second parameter of the method that this delegate encapsulates. - The type of the third parameter of the method that this delegate encapsulates. - The type of the fourth parameter of the method that this delegate encapsulates. - The type of the fifth parameter of the method that this delegate encapsulates. - The type of the sixth parameter of the method that this delegate encapsulates. - The type of the seventh parameter of the method that this delegate encapsulates. - The type of the return value of the method that this delegate encapsulates. - - - - Encapsulates a method that has eight parameters and returns a value of the type specified by the TResult parameter. - The first parameter of the method that this delegate encapsulates. - The second parameter of the method that this delegate encapsulates. - The third parameter of the method that this delegate encapsulates. - The fourth parameter of the method that this delegate encapsulates. - The fifth parameter of the method that this delegate encapsulates. - The sixth parameter of the method that this delegate encapsulates. - The seventh parameter of the method that this delegate encapsulates. - The eighth parameter of the method that this delegate encapsulates. - The type of the first parameter of the method that this delegate encapsulates. - The type of the second parameter of the method that this delegate encapsulates. - The type of the third parameter of the method that this delegate encapsulates. - The type of the fourth parameter of the method that this delegate encapsulates. - The type of the fifth parameter of the method that this delegate encapsulates. - The type of the sixth parameter of the method that this delegate encapsulates. - The type of the seventh parameter of the method that this delegate encapsulates. - The type of the eighth parameter of the method that this delegate encapsulates. - The type of the return value of the method that this delegate encapsulates. - - - - Controls the system garbage collector, a service that automatically reclaims unused memory. - - - Informs the runtime of a large allocation of unmanaged memory that should be taken into account when scheduling garbage collection. - The incremental amount of unmanaged memory that has been allocated. - bytesAllocated is less than or equal to 0. -or- On a 32-bit computer, bytesAllocated is larger than . - - - Cancels the registration of a garbage collection notification. - This member is not available when concurrent garbage collection is enabled. See the runtime setting for information about how to disable concurrent garbage collection. - - - Forces an immediate garbage collection of all generations. - - - Forces an immediate garbage collection from generation 0 through a specified generation. - The number of the oldest generation to be garbage collected. - generation is not valid. - - - Forces a garbage collection from generation 0 through a specified generation, at a time specified by a value. - The number of the oldest generation to be garbage collected. - An enumeration value that specifies whether the garbage collection is forced ( or ) or optimized (). - generation is not valid. -or- mode is not one of the values. - - - Forces a garbage collection from generation 0 through a specified generation, at a time specified by a value, with a value specifying whether the collection should be blocking. - The number of the oldest generation to be garbage collected. - An enumeration value that specifies whether the garbage collection is forced ( or ) or optimized (). - true to perform a blocking garbage collection; false to perform a background garbage collection where possible. - generation is not valid. -or- mode is not one of the values. - - - Forces a garbage collection from generation 0 through a specified generation, at a time specified by a value, with values that specify whether the collection should be blocking and compacting. - The number of the oldest generation to be garbage collected. - An enumeration value that specifies whether the garbage collection is forced ( or ) or optimized (). - true to perform a blocking garbage collection; false to perform a background garbage collection where possible. - true to compact the small object heap; false to sweep only. - - - Returns the number of times garbage collection has occurred for the specified generation of objects. - The generation of objects for which the garbage collection count is to be determined. - The number of times garbage collection has occurred for the specified generation since the process was started. - generation is less than 0. - - - Ends the no GC region latency mode. - The garbage collector is not in no GC region latency mode. -or- The no GC region latency mode was ended previously because a garbage collection was induced. -or- A memory allocation exceeded the amount specified in the call to the method. - - - Returns the current generation number of the specified object. - The object that generation information is retrieved for. - The current generation number of obj. - - - Returns the current generation number of the target of a specified weak reference. - A that refers to the target object whose generation number is to be determined. - The current generation number of the target of wo. - Garbage collection has already been performed on wo. - - - Retrieves the number of bytes currently thought to be allocated. A parameter indicates whether this method can wait a short interval before returning, to allow the system to collect garbage and finalize objects. - true to indicate that this method can wait for garbage collection to occur before returning; otherwise, false. - A number that is the best available approximation of the number of bytes currently allocated in managed memory. - - - References the specified object, which makes it ineligible for garbage collection from the start of the current routine to the point where this method is called. - The object to reference. - - - Gets the maximum number of generations that the system currently supports. - A value that ranges from zero to the maximum number of supported generations. - - - Specifies that a garbage collection notification should be raised when conditions favor full garbage collection and when the collection has been completed. - A number between 1 and 99 that specifies when the notification should be raised based on the objects allocated in generation 2. - A number between 1 and 99 that specifies when the notification should be raised based on objects allocated in the large object heap. - maxGenerationThreshold or largeObjectHeapThreshold is not between 1 and 99. - - - Informs the runtime that unmanaged memory has been released and no longer needs to be taken into account when scheduling garbage collection. - The amount of unmanaged memory that has been released. - bytesAllocated is less than or equal to 0. -or- On a 32-bit computer, bytesAllocated is larger than . - - - Requests that the system call the finalizer for the specified object for which has previously been called. - The object that a finalizer must be called for. - obj is null. - - - Requests that the common language runtime not call the finalizer for the specified object. - The object whose finalizer must not be executed. - obj is null. - - - Attempts to disallow garbage collection during the execution of a critical path if a specified amount of memory is available. - The amount of memory in bytes to allocate without triggering a garbage collection. It must be less than or equal to the size of an ephemeral segment. For information on the size of an ephemeral segement, see the "Ephemeral generations and segments" section in the Fundamentals of Garbage Collection article. - true if the runtime was able to commit the required amount of memory and the garbage collector is able to enter no GC region latency mode; otherwise, false. - totalSize exceeds the ephemeral segment size. - The process is already in no GC region latency mode. - - - Attempts to disallow garbage collection during the execution of a critical path if a specified amount of memory is available, and controls whether the garbage collector does a full blocking garbage collection if not enough memory is initially available. - The amount of memory in bytes to allocate without triggering a garbage collection. It must be less than or equal to the size of an ephemeral segment. For information on the size of an ephemeral segement, see the "Ephemeral generations and segments" section in the Fundamentals of Garbage Collection article. - true to omit a full blocking garbage collection if the garbage collector is initially unable to allocate totalSize bytes; otherwise, false. - true if the runtime was able to commit the required amount of memory and the garbage collector is able to enter no GC region latency mode; otherwise, false. - totalSize exceeds the ephemeral segment size. - The process is already in no GC region latency mode. - - - Attempts to disallow garbage collection during the execution of a critical path if a specified amount of memory is available for the large object heap and the small object heap. - The amount of memory in bytes to allocate without triggering a garbage collection. totalSize –lohSize must be less than or equal to the size of an ephemeral segment. For information on the size of an ephemeral segement, see the "Ephemeral generations and segments" section in the Fundamentals of Garbage Collection article. - The number of bytes in totalSize to use for large object heap (LOH) allocations. - true if the runtime was able to commit the required amount of memory and the garbage collector is able to enter no GC region latency mode; otherwise, false. - totalSize – lohSize exceeds the ephemeral segment size. - The process is already in no GC region latency mode. - - - Attempts to disallow garbage collection during the execution of a critical path if a specified amount of memory is available for the large object heap and the small object heap, and controls whether the garbage collector does a full blocking garbage collection if not enough memory is initially available. - The amount of memory in bytes to allocate without triggering a garbage collection. totalSize –lohSize must be less than or equal to the size of an ephemeral segment. For information on the size of an ephemeral segement, see the "Ephemeral generations and segments" section in the Fundamentals of Garbage Collection article. - The number of bytes in totalSize to use for large object heap (LOH) allocations. - true to omit a full blocking garbage collection if the garbage collector is initially unable to allocate the specified memory on the small object heap (SOH) and LOH; otherwise, false. - true if the runtime was able to commit the required amount of memory and the garbage collector is able to enter no GC region latency mode; otherwise, false. - totalSize – lohSize exceeds the ephemeral segment size. - The process is already in no GC region latency mode. - - - Returns the status of a registered notification for determining whether a full, blocking garbage collection by the common language runtime is imminent. - The status of the registered garbage collection notification. - - - Returns, in a specified time-out period, the status of a registered notification for determining whether a full, blocking garbage collection by the common language runtime is imminent. - The length of time to wait before a notification status can be obtained. Specify -1 to wait indefinitely. - The status of the registered garbage collection notification. - millisecondsTimeout must be either non-negative or less than or equal to or -1. - - - Returns the status of a registered notification for determining whether a full, blocking garbage collection by the common language runtime has completed. - The status of the registered garbage collection notification. - - - Returns, in a specified time-out period, the status of a registered notification for determining whether a full, blocking garbage collection by common language the runtime has completed. - The length of time to wait before a notification status can be obtained. Specify -1 to wait indefinitely. - The status of the registered garbage collection notification. - millisecondsTimeout must be either non-negative or less than or equal to or -1. - - - Suspends the current thread until the thread that is processing the queue of finalizers has emptied that queue. - - - Specifies the behavior for a forced garbage collection. - - - The default setting for this enumeration, which is currently . - - - - Forces the garbage collection to occur immediately. - - - - Allows the garbage collector to determine whether the current time is optimal to reclaim objects. - - - - Provides information about the current registration for notification of the next full garbage collection. - - - The current registration was canceled by the user. - - - - The notification failed for any reason. - - - - This result can be caused by the following: there is no current registration for a garbage collection notification, concurrent garbage collection is enabled, or the time specified for the millisecondsTimeout parameter has expired and no garbage collection notification was obtained. (See the runtime setting for information about how to disable concurrent garbage collection.) - - - - The notification was successful and the registration was not canceled. - - - - The time specified by the millisecondsTimeout parameter for either or has elapsed. - - - - A customizable parser for a hierarchical URI. - - - Create a customizable parser for a hierarchical URI. - Specify the options for this . - - - Specifies options for a . - - - The parser allows a URI with no authority. - - - - The parser: - - - - The parser does not canonicalize the URI. - - - - The parser does not convert back slashes into forward slashes. - - - - The parser does not unescape path dots, forward slashes, or back slashes. - - - - The parser allows a registry-based authority. - - - - The parser supports Internationalized Domain Name (IDN) parsing (IDN) of host names. Whether IDN is used is dictated by configuration values. - - - - The parser supports the parsing rules specified in RFC 3987 for International Resource Identifiers (IRI). Whether IRI is used is dictated by configuration values. - - - - The scheme does not define a fragment part. - - - - The scheme does not define a port. - - - - The scheme does not define a query part. - - - - The scheme does not define a user information part. - - - - Represents time in divisions, such as weeks, months, and years. - - - Initializes a new instance of the class. - - - Returns a that is the specified number of days away from the specified . - The to which to add days. - The number of days to add. - The that results from adding the specified number of days to the specified . - The resulting is outside the supported range of this calendar. - days is outside the supported range of the return value. - - - Returns a that is the specified number of hours away from the specified . - The to which to add hours. - The number of hours to add. - The that results from adding the specified number of hours to the specified . - The resulting is outside the supported range of this calendar. - hours is outside the supported range of the return value. - - - Returns a that is the specified number of milliseconds away from the specified . - The to add milliseconds to. - The number of milliseconds to add. - The that results from adding the specified number of milliseconds to the specified . - The resulting is outside the supported range of this calendar. - milliseconds is outside the supported range of the return value. - - - Returns a that is the specified number of minutes away from the specified . - The to which to add minutes. - The number of minutes to add. - The that results from adding the specified number of minutes to the specified . - The resulting is outside the supported range of this calendar. - minutes is outside the supported range of the return value. - - - When overridden in a derived class, returns a that is the specified number of months away from the specified . - The to which to add months. - The number of months to add. - The that results from adding the specified number of months to the specified . - The resulting is outside the supported range of this calendar. - months is outside the supported range of the return value. - - - Returns a that is the specified number of seconds away from the specified . - The to which to add seconds. - The number of seconds to add. - The that results from adding the specified number of seconds to the specified . - The resulting is outside the supported range of this calendar. - seconds is outside the supported range of the return value. - - - Returns a that is the specified number of weeks away from the specified . - The to which to add weeks. - The number of weeks to add. - The that results from adding the specified number of weeks to the specified . - The resulting is outside the supported range of this calendar. - weeks is outside the supported range of the return value. - - - When overridden in a derived class, returns a that is the specified number of years away from the specified . - The to which to add years. - The number of years to add. - The that results from adding the specified number of years to the specified . - The resulting is outside the supported range of this calendar. - years is outside the supported range of the return value. - - - Gets a value indicating whether the current calendar is solar-based, lunar-based, or a combination of both. - One of the values. - - - Creates a new object that is a copy of the current object. - A new instance of that is the memberwise clone of the current object. - - - Represents the current era of the current calendar. - - - - Gets the number of days in the year that precedes the year that is specified by the property. - The number of days in the year that precedes the year specified by . - - - When overridden in a derived class, gets the list of eras in the current calendar. - An array of integers that represents the eras in the current calendar. - - - When overridden in a derived class, returns the day of the month in the specified . - The to read. - A positive integer that represents the day of the month in the time parameter. - - - When overridden in a derived class, returns the day of the week in the specified . - The to read. - A value that represents the day of the week in the time parameter. - - - When overridden in a derived class, returns the day of the year in the specified . - The to read. - A positive integer that represents the day of the year in the time parameter. - - - Returns the number of days in the specified month and year of the current era. - An integer that represents the year. - A positive integer that represents the month. - The number of days in the specified month in the specified year in the current era. - year is outside the range supported by the calendar. -or- month is outside the range supported by the calendar. - - - When overridden in a derived class, returns the number of days in the specified month, year, and era. - An integer that represents the year. - A positive integer that represents the month. - An integer that represents the era. - The number of days in the specified month in the specified year in the specified era. - year is outside the range supported by the calendar. -or- month is outside the range supported by the calendar. -or- era is outside the range supported by the calendar. - - - Returns the number of days in the specified year of the current era. - An integer that represents the year. - The number of days in the specified year in the current era. - year is outside the range supported by the calendar. - - - When overridden in a derived class, returns the number of days in the specified year and era. - An integer that represents the year. - An integer that represents the era. - The number of days in the specified year in the specified era. - year is outside the range supported by the calendar. -or- era is outside the range supported by the calendar. - - - When overridden in a derived class, returns the era in the specified . - The to read. - An integer that represents the era in time. - - - Returns the hours value in the specified . - The to read. - An integer from 0 to 23 that represents the hour in time. - - - Calculates the leap month for a specified year and era. - A year. - An era. - A positive integer that indicates the leap month in the specified year and era. -or- Zero if this calendar does not support a leap month or if the year and era parameters do not specify a leap year. - - - Calculates the leap month for a specified year. - A year. - A positive integer that indicates the leap month in the specified year. -or- Zero if this calendar does not support a leap month or if the year parameter does not represent a leap year. - - - Returns the milliseconds value in the specified . - The to read. - A double-precision floating-point number from 0 to 999 that represents the milliseconds in the time parameter. - - - Returns the minutes value in the specified . - The to read. - An integer from 0 to 59 that represents the minutes in time. - - - When overridden in a derived class, returns the month in the specified . - The to read. - A positive integer that represents the month in time. - - - Returns the number of months in the specified year in the current era. - An integer that represents the year. - The number of months in the specified year in the current era. - year is outside the range supported by the calendar. - - - When overridden in a derived class, returns the number of months in the specified year in the specified era. - An integer that represents the year. - An integer that represents the era. - The number of months in the specified year in the specified era. - year is outside the range supported by the calendar. -or- era is outside the range supported by the calendar. - - - Returns the seconds value in the specified . - The to read. - An integer from 0 to 59 that represents the seconds in time. - - - Returns the week of the year that includes the date in the specified value. - A date and time value. - An enumeration value that defines a calendar week. - An enumeration value that represents the first day of the week. - A positive integer that represents the week of the year that includes the date in the time parameter. - time is earlier than or later than . -or- firstDayOfWeek is not a valid value. -or- rule is not a valid value. - - - When overridden in a derived class, returns the year in the specified . - The to read. - An integer that represents the year in time. - - - Determines whether the specified date in the current era is a leap day. - An integer that represents the year. - A positive integer that represents the month. - A positive integer that represents the day. - true if the specified day is a leap day; otherwise, false. - year is outside the range supported by the calendar. -or- month is outside the range supported by the calendar. -or- day is outside the range supported by the calendar. - - - When overridden in a derived class, determines whether the specified date in the specified era is a leap day. - An integer that represents the year. - A positive integer that represents the month. - A positive integer that represents the day. - An integer that represents the era. - true if the specified day is a leap day; otherwise, false. - year is outside the range supported by the calendar. -or- month is outside the range supported by the calendar. -or- day is outside the range supported by the calendar. -or- era is outside the range supported by the calendar. - - - When overridden in a derived class, determines whether the specified month in the specified year in the specified era is a leap month. - An integer that represents the year. - A positive integer that represents the month. - An integer that represents the era. - true if the specified month is a leap month; otherwise, false. - year is outside the range supported by the calendar. -or- month is outside the range supported by the calendar. -or- era is outside the range supported by the calendar. - - - Determines whether the specified month in the specified year in the current era is a leap month. - An integer that represents the year. - A positive integer that represents the month. - true if the specified month is a leap month; otherwise, false. - year is outside the range supported by the calendar. -or- month is outside the range supported by the calendar. - - - Determines whether the specified year in the current era is a leap year. - An integer that represents the year. - true if the specified year is a leap year; otherwise, false. - year is outside the range supported by the calendar. - - - When overridden in a derived class, determines whether the specified year in the specified era is a leap year. - An integer that represents the year. - An integer that represents the era. - true if the specified year is a leap year; otherwise, false. - year is outside the range supported by the calendar. -or- era is outside the range supported by the calendar. - - - Gets a value indicating whether this object is read-only. - true if this object is read-only; otherwise, false. - - - Gets the latest date and time supported by this object. - The latest date and time supported by this calendar. The default is . - - - Gets the earliest date and time supported by this object. - The earliest date and time supported by this calendar. The default is . - - - Returns a read-only version of the specified object. - A object. - The object specified by the calendar parameter, if calendar is read-only. -or- A read-only memberwise clone of the object specified by calendar, if calendar is not read-only. - calendar is null. - - - Returns a that is set to the specified date and time in the current era. - An integer that represents the year. - A positive integer that represents the month. - A positive integer that represents the day. - An integer from 0 to 23 that represents the hour. - An integer from 0 to 59 that represents the minute. - An integer from 0 to 59 that represents the second. - An integer from 0 to 999 that represents the millisecond. - The that is set to the specified date and time in the current era. - year is outside the range supported by the calendar. -or- month is outside the range supported by the calendar. -or- day is outside the range supported by the calendar. -or- hour is less than zero or greater than 23. -or- minute is less than zero or greater than 59. -or- second is less than zero or greater than 59. -or- millisecond is less than zero or greater than 999. - - - When overridden in a derived class, returns a that is set to the specified date and time in the specified era. - An integer that represents the year. - A positive integer that represents the month. - A positive integer that represents the day. - An integer from 0 to 23 that represents the hour. - An integer from 0 to 59 that represents the minute. - An integer from 0 to 59 that represents the second. - An integer from 0 to 999 that represents the millisecond. - An integer that represents the era. - The that is set to the specified date and time in the current era. - year is outside the range supported by the calendar. -or- month is outside the range supported by the calendar. -or- day is outside the range supported by the calendar. -or- hour is less than zero or greater than 23. -or- minute is less than zero or greater than 59. -or- second is less than zero or greater than 59. -or- millisecond is less than zero or greater than 999. -or- era is outside the range supported by the calendar. - - - Converts the specified year to a four-digit year by using the property to determine the appropriate century. - A two-digit or four-digit integer that represents the year to convert. - An integer that contains the four-digit representation of year. - year is outside the range supported by the calendar. - - - Gets or sets the last year of a 100-year range that can be represented by a 2-digit year. - The last year of a 100-year range that can be represented by a 2-digit year. - The current object is read-only. - - - Specifies whether a calendar is solar-based, lunar-based, or lunisolar-based. - - - A lunar-based calendar. - - - - A lunisolar-based calendar. - - - - A solar-based calendar. - - - - An unknown calendar basis. - - - - Defines different rules for determining the first week of the year. - - - Indicates that the first week of the year starts on the first day of the year and ends before the following designated first day of the week. The value is 0. - - - - Indicates that the first week of the year is the first week with four or more days before the designated first day of the week. The value is 2. - - - - Indicates that the first week of the year begins on the first occurrence of the designated first day of the week on or after the first day of the year. The value is 1. - - - - Retrieves information about a Unicode character. This class cannot be inherited. - - - Gets the decimal digit value of the specified numeric character. - The Unicode character for which to get the decimal digit value. - The decimal digit value of the specified numeric character. -or- -1, if the specified character is not a decimal digit. - - - Gets the decimal digit value of the numeric character at the specified index of the specified string. - The containing the Unicode character for which to get the decimal digit value. - The index of the Unicode character for which to get the decimal digit value. - The decimal digit value of the numeric character at the specified index of the specified string. -or- -1, if the character at the specified index of the specified string is not a decimal digit. - s is null. - index is outside the range of valid indexes in s. - - - Gets the digit value of the specified numeric character. - The Unicode character for which to get the digit value. - The digit value of the specified numeric character. -or- -1, if the specified character is not a digit. - - - Gets the digit value of the numeric character at the specified index of the specified string. - The containing the Unicode character for which to get the digit value. - The index of the Unicode character for which to get the digit value. - The digit value of the numeric character at the specified index of the specified string. -or- -1, if the character at the specified index of the specified string is not a digit. - s is null. - index is outside the range of valid indexes in s. - - - Gets the numeric value associated with the specified character. - The Unicode character for which to get the numeric value. - The numeric value associated with the specified character. -or- -1, if the specified character is not a numeric character. - - - Gets the numeric value associated with the character at the specified index of the specified string. - The containing the Unicode character for which to get the numeric value. - The index of the Unicode character for which to get the numeric value. - The numeric value associated with the character at the specified index of the specified string. -or- -1, if the character at the specified index of the specified string is not a numeric character. - s is null. - index is outside the range of valid indexes in s. - - - Gets the Unicode category of the specified character. - The Unicode character for which to get the Unicode category. - A value indicating the category of the specified character. - - - Gets the Unicode category of the character at the specified index of the specified string. - The containing the Unicode character for which to get the Unicode category. - The index of the Unicode character for which to get the Unicode category. - A value indicating the category of the character at the specified index of the specified string. - s is null. - index is outside the range of valid indexes in s. - - - Represents time in divisions, such as months, days, and years. Years are calculated using the Chinese calendar, while days and months are calculated using the lunisolar calendar. - - - Initializes a new instance of the class. - - - Specifies the era that corresponds to the current object. - - - - Gets the number of days in the year that precedes the year that is specified by the property. - The number of days in the year that precedes the year specified by . - - - Gets the eras that correspond to the range of dates and times supported by the current object. - An array of 32-bit signed integers that specify the relevant eras. The return value for a object is always an array containing one element equal to the value. - - - Retrieves the era that corresponds to the specified type. - The type to read. - An integer that represents the era in the time parameter. - time is less than or greater than . - - - Gets the maximum date and time supported by the class. - A type that represents the last moment on January 28, 2101 in the Gregorian calendar, which is approximately equal to the constructor DateTime(2101, 1, 28, 23, 59, 59, 999). - - - Gets the minimum date and time supported by the class. - A type that represents February 19, 1901 in the Gregorian calendar, which is equivalent to the constructor, DateTime(1901, 2, 19). - - - Implements a set of methods for culture-sensitive string comparisons. - - - Compares two strings. - The first string to compare. - The second string to compare. -

A 32-bit signed integer indicating the lexical relationship between the two comparands.

-
Value

-

Condition

-

zero

-

The two strings are equal.

-

less than zero

-

string1 is less than string2.

-

greater than zero

-

string1 is greater than string2.

-

-
-
- - Compares two strings using the specified value. - The first string to compare. - The second string to compare. - A value that defines how string1 and string2 should be compared. options is either the enumeration value , or a bitwise combination of one or more of the following values: , , , , , and . -

A 32-bit signed integer indicating the lexical relationship between the two comparands.

-
Value

-

Condition

-

zero

-

The two strings are equal.

-

less than zero

-

string1 is less than string2.

-

greater than zero

-

string1 is greater than string2.

-

-
- options contains an invalid value. -
- - Compares the end section of a string with the end section of another string. - The first string to compare. - The zero-based index of the character in string1 at which to start comparing. - The second string to compare. - The zero-based index of the character in string2 at which to start comparing. -

A 32-bit signed integer indicating the lexical relationship between the two comparands.

-
Value

-

Condition

-

zero

-

The two strings are equal.

-

less than zero

-

The specified section of string1 is less than the specified section of string2.

-

greater than zero

-

The specified section of string1 is greater than the specified section of string2.

-

-
- offset1 or offset2 is less than zero. -or- offset1 is greater than or equal to the number of characters in string1. -or- offset2 is greater than or equal to the number of characters in string2. -
- - Compares the end section of a string with the end section of another string using the specified value. - The first string to compare. - The zero-based index of the character in string1 at which to start comparing. - The second string to compare. - The zero-based index of the character in string2 at which to start comparing. - A value that defines how string1 and string2 should be compared. options is either the enumeration value , or a bitwise combination of one or more of the following values: , , , , , and . -

A 32-bit signed integer indicating the lexical relationship between the two comparands.

-
Value

-

Condition

-

zero

-

The two strings are equal.

-

less than zero

-

The specified section of string1 is less than the specified section of string2.

-

greater than zero

-

The specified section of string1 is greater than the specified section of string2.

-

-
- offset1 or offset2 is less than zero. -or- offset1 is greater than or equal to the number of characters in string1. -or- offset2 is greater than or equal to the number of characters in string2. - options contains an invalid value. -
- - Compares a section of one string with a section of another string. - The first string to compare. - The zero-based index of the character in string1 at which to start comparing. - The number of consecutive characters in string1 to compare. - The second string to compare. - The zero-based index of the character in string2 at which to start comparing. - The number of consecutive characters in string2 to compare. -

A 32-bit signed integer indicating the lexical relationship between the two comparands.

-
Value

-

Condition

-

zero

-

The two strings are equal.

-

less than zero

-

The specified section of string1 is less than the specified section of string2.

-

greater than zero

-

The specified section of string1 is greater than the specified section of string2.

-

-
- offset1 or length1 or offset2 or length2 is less than zero. -or- offset1 is greater than or equal to the number of characters in string1. -or- offset2 is greater than or equal to the number of characters in string2. -or- length1 is greater than the number of characters from offset1 to the end of string1. -or- length2 is greater than the number of characters from offset2 to the end of string2. -
- - Compares a section of one string with a section of another string using the specified value. - The first string to compare. - The zero-based index of the character in string1 at which to start comparing. - The number of consecutive characters in string1 to compare. - The second string to compare. - The zero-based index of the character in string2 at which to start comparing. - The number of consecutive characters in string2 to compare. - A value that defines how string1 and string2 should be compared. options is either the enumeration value , or a bitwise combination of one or more of the following values: , , , , , and . -

A 32-bit signed integer indicating the lexical relationship between the two comparands.

-
Value

-

Condition

-

zero

-

The two strings are equal.

-

less than zero

-

The specified section of string1 is less than the specified section of string2.

-

greater than zero

-

The specified section of string1 is greater than the specified section of string2.

-

-
- offset1 or length1 or offset2 or length2 is less than zero. -or- offset1 is greater than or equal to the number of characters in string1. -or- offset2 is greater than or equal to the number of characters in string2. -or- length1 is greater than the number of characters from offset1 to the end of string1. -or- length2 is greater than the number of characters from offset2 to the end of string2. - options contains an invalid value. -
- - Determines whether the specified object is equal to the current object. - The object to compare with the current . - true if the specified object is equal to the current ; otherwise, false. - - - Initializes a new object that is associated with the specified culture and that uses string comparison methods in the specified . - A string representing the culture name. - An that contains the string comparison methods to use. - A new object associated with the culture with the specified identifier and using string comparison methods in the current . - name is null. -or- assembly is null. - name is an invalid culture name. -or- assembly is of an invalid type. - - - Initializes a new object that is associated with the specified culture and that uses string comparison methods in the specified . - An integer representing the culture identifier. - An that contains the string comparison methods to use. - A new object associated with the culture with the specified identifier and using string comparison methods in the current . - assembly is null. - assembly is of an invalid type. - - - Initializes a new object that is associated with the culture with the specified identifier. - An integer representing the culture identifier. - A new object associated with the culture with the specified identifier and using string comparison methods in the current . - - - Initializes a new object that is associated with the culture with the specified name. - A string representing the culture name. - A new object associated with the culture with the specified identifier and using string comparison methods in the current . - name is null. - name is an invalid culture name. - - - Serves as a hash function for the current for hashing algorithms and data structures, such as a hash table. - A hash code for the current . - - - Gets the hash code for a string based on specified comparison options. - The string whose hash code is to be returned. - A value that determines how strings are compared. - A 32-bit signed integer hash code. - source is null. - - - Gets the sort key for the specified string. - The string for which a object is obtained. - The object that contains the sort key for the specified string. - - - Gets a object for the specified string using the specified value. - The string for which a object is obtained. - A bitwise combination of one or more of the following enumeration values that define how the sort key is calculated: , , , , , and . - The object that contains the sort key for the specified string. - options contains an invalid value. - - - Searches for the specified character and returns the zero-based index of the first occurrence within the section of the source string that starts at the specified index and contains the specified number of elements. - The string to search. - The character to locate within source. - The zero-based starting index of the search. - The number of elements in the section to search. - The zero-based index of the first occurrence of value, if found, within the section of source that starts at startIndex and contains the number of elements specified by count; otherwise, -1. Returns startIndex if value is an ignorable character. - source is null. - startIndex is outside the range of valid indexes for source. -or- count is less than zero. -or- startIndex and count do not specify a valid section in source. - - - Searches for the specified substring and returns the zero-based index of the first occurrence within the section of the source string that starts at the specified index and contains the specified number of elements using the specified value. - The string to search. - The string to locate within source. - The zero-based starting index of the search. - The number of elements in the section to search. - A value that defines how source and value should be compared. options is either the enumeration value , or a bitwise combination of one or more of the following values: , , , , and . - The zero-based index of the first occurrence of value, if found, within the section of source that starts at startIndex and contains the number of elements specified by count, using the specified comparison options; otherwise, -1. Returns startIndex if value is an ignorable character. - source is null. -or- value is null. - startIndex is outside the range of valid indexes for source. -or- count is less than zero. -or- startIndex and count do not specify a valid section in source. - options contains an invalid value. - - - Searches for the specified character and returns the zero-based index of the first occurrence within the section of the source string that starts at the specified index and contains the specified number of elements using the specified value. - The string to search. - The character to locate within source. - The zero-based starting index of the search. - The number of elements in the section to search. - A value that defines how source and value should be compared. options is either the enumeration value , or a bitwise combination of one or more of the following values: , , , , and . - The zero-based index of the first occurrence of value, if found, within the section of source that starts at startIndex and contains the number of elements specified by count, using the specified comparison options; otherwise, -1. Returns startIndex if value is an ignorable character. - source is null. - startIndex is outside the range of valid indexes for source. -or- count is less than zero. -or- startIndex and count do not specify a valid section in source. - options contains an invalid value. - - - Searches for the specified substring and returns the zero-based index of the first occurrence within the section of the source string that extends from the specified index to the end of the string using the specified value. - The string to search. - The string to locate within source. - The zero-based starting index of the search. - A value that defines how source and value should be compared. options is either the enumeration value , or a bitwise combination of one or more of the following values: , , , , and . - The zero-based index of the first occurrence of value, if found, within the section of source that extends from startIndex to the end of source, using the specified comparison options; otherwise, -1. Returns startIndex if value is an ignorable character. - source is null. -or- value is null. - startIndex is outside the range of valid indexes for source. - options contains an invalid value. - - - Searches for the specified character and returns the zero-based index of the first occurrence within the section of the source string that extends from the specified index to the end of the string using the specified value. - The string to search. - The character to locate within source. - The zero-based starting index of the search. - A value that defines how source and value should be compared. options is either the enumeration value , or a bitwise combination of one or more of the following values: , , , , and . - The zero-based index of the first occurrence of value, if found, within the section of source that extends from startIndex to the end of source, using the specified comparison options; otherwise, -1. Returns startIndex if value is an ignorable character. - source is null. - startIndex is outside the range of valid indexes for source. - options contains an invalid value. - - - Searches for the specified substring and returns the zero-based index of the first occurrence within the section of the source string that starts at the specified index and contains the specified number of elements. - The string to search. - The string to locate within source. - The zero-based starting index of the search. - The number of elements in the section to search. - The zero-based index of the first occurrence of value, if found, within the section of source that starts at startIndex and contains the number of elements specified by count; otherwise, -1. Returns startIndex if value is an ignorable character. - source is null. -or- value is null. - startIndex is outside the range of valid indexes for source. -or- count is less than zero. -or- startIndex and count do not specify a valid section in source. - - - Searches for the specified substring and returns the zero-based index of the first occurrence within the entire source string using the specified value. - The string to search. - The string to locate within source. - A value that defines how source and value should be compared. options is either the enumeration value , or a bitwise combination of one or more of the following values: , , , , and . - The zero-based index of the first occurrence of value, if found, within source, using the specified comparison options; otherwise, -1. Returns 0 (zero) if value is an ignorable character. - source is null. -or- value is null. - options contains an invalid value. - - - Searches for the specified character and returns the zero-based index of the first occurrence within the section of the source string that extends from the specified index to the end of the string. - The string to search. - The character to locate within source. - The zero-based starting index of the search. - The zero-based index of the first occurrence of value, if found, within the section of source that extends from startIndex to the end of source; otherwise, -1. Returns startIndex if value is an ignorable character. - source is null. - startIndex is outside the range of valid indexes for source. - - - Searches for the specified character and returns the zero-based index of the first occurrence within the entire source string using the specified value. - The string to search. - The character to locate within source. - A value that defines how the strings should be compared. options is either the enumeration value , or a bitwise combination of one or more of the following values: , , , , and . - The zero-based index of the first occurrence of value, if found, within source, using the specified comparison options; otherwise, -1. Returns 0 (zero) if value is an ignorable character. - source is null. - options contains an invalid value. - - - Searches for the specified substring and returns the zero-based index of the first occurrence within the section of the source string that extends from the specified index to the end of the string. - The string to search. - The string to locate within source. - The zero-based starting index of the search. - The zero-based index of the first occurrence of value, if found, within the section of source that extends from startIndex to the end of source; otherwise, -1. Returns startIndex if value is an ignorable character. - source is null. -or- value is null. - startIndex is outside the range of valid indexes for source. - - - Searches for the specified substring and returns the zero-based index of the first occurrence within the entire source string. - The string to search. - The string to locate within source. - The zero-based index of the first occurrence of value, if found, within source; otherwise, -1. Returns 0 (zero) if value is an ignorable character. - source is null. -or- value is null. - - - Searches for the specified character and returns the zero-based index of the first occurrence within the entire source string. - The string to search. - The character to locate within source. - The zero-based index of the first occurrence of value, if found, within source; otherwise, -1. Returns 0 (zero) if value is an ignorable character. - source is null. - - - Determines whether the specified source string starts with the specified prefix. - The string to search in. - The string to compare with the beginning of source. - true if the length of prefix is less than or equal to the length of source and source starts with prefix; otherwise, false. - source is null. -or- prefix is null. - - - Determines whether the specified source string starts with the specified prefix using the specified value. - The string to search in. - The string to compare with the beginning of source. - A value that defines how source and prefix should be compared. options is either the enumeration value , or a bitwise combination of one or more of the following values: , , , , and . - true if the length of prefix is less than or equal to the length of source and source starts with prefix; otherwise, false. - source is null. -or- prefix is null. - options contains an invalid value. - - - Indicates whether a specified Unicode string is sortable. - A string of zero or more Unicode characters. - true if the str parameter is not an empty string ("") and all the Unicode characters in str are sortable; otherwise, false. - str is null. - - - Indicates whether a specified Unicode character is sortable. - A Unicode character. - true if the ch parameter is sortable; otherwise, false. - - - Determines whether the specified source string ends with the specified suffix. - The string to search in. - The string to compare with the end of source. - true if the length of suffix is less than or equal to the length of source and source ends with suffix; otherwise, false. - source is null. -or- suffix is null. - - - Determines whether the specified source string ends with the specified suffix using the specified value. - The string to search in. - The string to compare with the end of source. - A value that defines how source and suffix should be compared. options is either the enumeration value used by itself, or the bitwise combination of one or more of the following values: , , , , and . - true if the length of suffix is less than or equal to the length of source and source ends with suffix; otherwise, false. - source is null. -or- suffix is null. - options contains an invalid value. - - - Searches for the specified character and returns the zero-based index of the last occurrence within the section of the source string that contains the specified number of elements and ends at the specified index using the specified value. - The string to search. - The character to locate within source. - The zero-based starting index of the backward search. - The number of elements in the section to search. - A value that defines how source and value should be compared. options is either the enumeration value , or a bitwise combination of one or more of the following values: , , , , and . - The zero-based index of the last occurrence of value, if found, within the section of source that contains the number of elements specified by count and that ends at startIndex, using the specified comparison options; otherwise, -1. Returns startIndex if value is an ignorable character. - source is null. - startIndex is outside the range of valid indexes for source. -or- count is less than zero. -or- startIndex and count do not specify a valid section in source. - options contains an invalid value. - - - Searches for the specified substring and returns the zero-based index of the last occurrence within the section of the source string that contains the specified number of elements and ends at the specified index. - The string to search. - The string to locate within source. - The zero-based starting index of the backward search. - The number of elements in the section to search. - The zero-based index of the last occurrence of value, if found, within the section of source that contains the number of elements specified by count and that ends at startIndex; otherwise, -1. Returns startIndex if value is an ignorable character. - source is null. -or- value is null. - startIndex is outside the range of valid indexes for source. -or- count is less than zero. -or- startIndex and count do not specify a valid section in source. - - - Searches for the specified substring and returns the zero-based index of the last occurrence within the section of the source string that contains the specified number of elements and ends at the specified index using the specified value. - The string to search. - The string to locate within source. - The zero-based starting index of the backward search. - The number of elements in the section to search. - A value that defines how source and value should be compared. options is either the enumeration value , or a bitwise combination of one or more of the following values: , , , , and . - The zero-based index of the last occurrence of value, if found, within the section of source that contains the number of elements specified by count and that ends at startIndex, using the specified comparison options; otherwise, -1. Returns startIndex if value is an ignorable character. - source is null. -or- value is null. - startIndex is outside the range of valid indexes for source. -or- count is less than zero. -or- startIndex and count do not specify a valid section in source. - options contains an invalid value. - - - Searches for the specified substring and returns the zero-based index of the last occurrence within the section of the source string that extends from the beginning of the string to the specified index using the specified value. - The string to search. - The string to locate within source. - The zero-based starting index of the backward search. - A value that defines how source and value should be compared. options is either the enumeration value , or a bitwise combination of one or more of the following values: , , , , and . - The zero-based index of the last occurrence of value, if found, within the section of source that extends from the beginning of source to startIndex, using the specified comparison options; otherwise, -1. Returns startIndex if value is an ignorable character. - source is null. -or- value is null. - startIndex is outside the range of valid indexes for source. - options contains an invalid value. - - - Searches for the specified character and returns the zero-based index of the last occurrence within the section of the source string that contains the specified number of elements and ends at the specified index. - The string to search. - The character to locate within source. - The zero-based starting index of the backward search. - The number of elements in the section to search. - The zero-based index of the last occurrence of value, if found, within the section of source that contains the number of elements specified by count and that ends at startIndex; otherwise, -1. Returns startIndex if value is an ignorable character. - source is null. - startIndex is outside the range of valid indexes for source. -or- count is less than zero. -or- startIndex and count do not specify a valid section in source. - - - Searches for the specified character and returns the zero-based index of the last occurrence within the section of the source string that extends from the beginning of the string to the specified index using the specified value. - The string to search. - The character to locate within source. - The zero-based starting index of the backward search. - A value that defines how source and value should be compared. options is either the enumeration value , or a bitwise combination of one or more of the following values: , , , , and . - The zero-based index of the last occurrence of value, if found, within the section of source that extends from the beginning of source to startIndex, using the specified comparison options; otherwise, -1. Returns startIndex if value is an ignorable character. - source is null. - startIndex is outside the range of valid indexes for source. - options contains an invalid value. - - - Searches for the specified character and returns the zero-based index of the last occurrence within the entire source string using the specified value. - The string to search. - The character to locate within source. - A value that defines how source and value should be compared. options is either the enumeration value , or a bitwise combination of one or more of the following values: , , , , and . - The zero-based index of the last occurrence of value, if found, within source, using the specified comparison options; otherwise, -1. - source is null. - options contains an invalid value. - - - Searches for the specified substring and returns the zero-based index of the last occurrence within the entire source string using the specified value. - The string to search. - The string to locate within source. - A value that defines how source and value should be compared. options is either the enumeration value , or a bitwise combination of one or more of the following values: , , , , and . - The zero-based index of the last occurrence of value, if found, within source, using the specified comparison options; otherwise, -1. - source is null. -or- value is null. - options contains an invalid value. - - - Searches for the specified character and returns the zero-based index of the last occurrence within the section of the source string that extends from the beginning of the string to the specified index. - The string to search. - The character to locate within source. - The zero-based starting index of the backward search. - The zero-based index of the last occurrence of value, if found, within the section of source that extends from the beginning of source to startIndex; otherwise, -1. Returns startIndex if value is an ignorable character. - source is null. - startIndex is outside the range of valid indexes for source. - - - Searches for the specified substring and returns the zero-based index of the last occurrence within the entire source string. - The string to search. - The string to locate within source. - The zero-based index of the last occurrence of value, if found, within source; otherwise, -1. - source is null. -or- value is null. - - - Searches for the specified character and returns the zero-based index of the last occurrence within the entire source string. - The string to search. - The character to locate within source. - The zero-based index of the last occurrence of value, if found, within source; otherwise, -1. - source is null. - - - Searches for the specified substring and returns the zero-based index of the last occurrence within the section of the source string that extends from the beginning of the string to the specified index. - The string to search. - The string to locate within source. - The zero-based starting index of the backward search. - The zero-based index of the last occurrence of value, if found, within the section of source that extends from the beginning of source to startIndex; otherwise, -1. Returns startIndex if value is an ignorable character. - source is null. -or- value is null. - startIndex is outside the range of valid indexes for source. - - - Gets the properly formed culture identifier for the current . - The properly formed culture identifier for the current . - - - Gets the name of the culture used for sorting operations by this object. - The name of a culture. - - - Returns a string that represents the current object. - A string that represents the current object. - - - Gets information about the version of Unicode used for comparing and sorting strings. - An object that contains information about the Unicode version used for comparing and sorting strings. - - - Runs when the entire object graph has been deserialized. - The object that initiated the callback. - - - Defines the string comparison options to use with . - - - Indicates that the string comparison must ignore case. - - - - Indicates that the string comparison must ignore the Kana type. Kana type refers to Japanese hiragana and katakana characters, which represent phonetic sounds in the Japanese language. Hiragana is used for native Japanese expressions and words, while katakana is used for words borrowed from other languages, such as "computer" or "Internet". A phonetic sound can be expressed in both hiragana and katakana. If this value is selected, the hiragana character for one sound is considered equal to the katakana character for the same sound. - - - - Indicates that the string comparison must ignore nonspacing combining characters, such as diacritics. The Unicode Standard defines combining characters as characters that are combined with base characters to produce a new character. Nonspacing combining characters do not occupy a spacing position by themselves when rendered. - - - - Indicates that the string comparison must ignore symbols, such as white-space characters, punctuation, currency symbols, the percent sign, mathematical symbols, the ampersand, and so on. - - - - Indicates that the string comparison must ignore the character width. For example, Japanese katakana characters can be written as full-width or half-width. If this value is selected, the katakana characters written as full-width are considered equal to the same characters written as half-width. - - - - Indicates the default option settings for string comparisons. - - - - Indicates that the string comparison must use successive Unicode UTF-16 encoded values of the string (code unit by code unit comparison), leading to a fast comparison but one that is culture-insensitive. A string starting with a code unit XXXX16 comes before a string starting with YYYY16, if XXXX16 is less than YYYY16. This value cannot be combined with other values and must be used alone. - - - - String comparison must ignore case, then perform an ordinal comparison. This technique is equivalent to converting the string to uppercase using the invariant culture and then performing an ordinal comparison on the result. - - - - Indicates that the string comparison must use the string sort algorithm. In a string sort, the hyphen and the apostrophe, as well as other nonalphanumeric symbols, come before alphanumeric characters. - - - - Provides information about a specific culture (called a locale for unmanaged code development). The information includes the names for the culture, the writing system, the calendar used, the sort order of strings, and formatting for dates and numbers. - - - Initializes a new instance of the class based on the culture specified by the culture identifier. - A predefined identifier, property of an existing object, or Windows-only culture identifier. - culture is less than zero. - culture is not a valid culture identifier. See the Notes to Callers section for more information. - - - Initializes a new instance of the class based on the culture specified by name. - A predefined name, of an existing , or Windows-only culture name. name is not case-sensitive. - name is null. - name is not a valid culture name. For more information, see the Notes to Callers section. - - - Initializes a new instance of the class based on the culture specified by the culture identifier and on the Boolean that specifies whether to use the user-selected culture settings from the system. - A predefined identifier, property of an existing object, or Windows-only culture identifier. - A Boolean that denotes whether to use the user-selected culture settings (true) or the default culture settings (false). - culture is less than zero. - culture is not a valid culture identifier. See the Notes to Callers section for more information. - - - Initializes a new instance of the class based on the culture specified by name and on the Boolean that specifies whether to use the user-selected culture settings from the system. - A predefined name, of an existing , or Windows-only culture name. name is not case-sensitive. - A Boolean that denotes whether to use the user-selected culture settings (true) or the default culture settings (false). - name is null. - name is not a valid culture name. See the Notes to Callers section for more information. - - - Gets the default calendar used by the culture. - A that represents the default calendar used by the culture. - - - Refreshes cached culture-related information. - - - Creates a copy of the current . - A copy of the current . - - - Gets the that defines how to compare strings for the culture. - The that defines how to compare strings for the culture. - - - Creates a that represents the specific culture that is associated with the specified name. - A predefined name or the name of an existing object. name is not case-sensitive. - A object that represents: The invariant culture, if name is an empty string (""). -or- The specific culture associated with name, if name is a neutral culture. -or- The culture specified by name, if name is already a specific culture. - name is not a valid culture name. -or- The culture specified by name does not have a specific culture associated with it. - name is null. - - - Gets the culture types that pertain to the current object. - A bitwise combination of one or more values. There is no default value. - - - Gets or sets the object that represents the culture used by the current thread. - An object that represents the culture used by the current thread. - The property is set to null. - - - Gets or sets the object that represents the current user interface culture used by the Resource Manager to look up culture-specific resources at run time. - The culture used by the Resource Manager to look up culture-specific resources at run time. - The property is set to null. - The property is set to a culture name that cannot be used to locate a resource file. Resource filenames can include only letters, numbers, hyphens, or underscores. - - - Gets or sets a that defines the culturally appropriate format of displaying dates and times. - A that defines the culturally appropriate format of displaying dates and times. - The property is set to null. - The property or any of the properties is set, and the is read-only. - - - Gets or sets the default culture for threads in the current application domain. - The default culture for threads in the current application domain, or null if the current system culture is the default thread culture in the application domain. - - - Gets or sets the default UI culture for threads in the current application domain. - The default UI culture for threads in the current application domain, or null if the current system UI culture is the default thread UI culture in the application domain. - In a set operation, the property value is invalid. - - - Gets the full localized culture name. - The full localized culture name in the format languagefull [country/regionfull], where languagefull is the full name of the language and country/regionfull is the full name of the country/region. - - - Gets the culture name in the format languagefull [country/regionfull] in English. - The culture name in the format languagefull [country/regionfull] in English, where languagefull is the full name of the language and country/regionfull is the full name of the country/region. - - - Determines whether the specified object is the same culture as the current . - The object to compare with the current . - true if value is the same culture as the current ; otherwise, false. - - - Gets an alternate user interface culture suitable for console applications when the default graphic user interface culture is unsuitable. - An alternate culture that is used to read and display text on the console. - - - Retrieves a cached, read-only instance of a culture by using the specified culture identifier. - A locale identifier (LCID). - A read-only object. - culture is less than zero. - culture specifies a culture that is not supported. See the Notes to Caller section for more information. - - - Retrieves a cached, read-only instance of a culture using the specified culture name. - The name of a culture. name is not case-sensitive. - A read-only object. - name is null. - name specifies a culture that is not supported. See the Notes to Callers section for more information. - - - Retrieves a cached, read-only instance of a culture. Parameters specify a culture that is initialized with the and objects specified by another culture. - The name of a culture. name is not case-sensitive. - The name of a culture that supplies the and objects used to initialize name. altName is not case-sensitive. - A read-only object. - name or altName is null. - name or altName specifies a culture that is not supported. See the Notes to Callers section for more information. - - - Deprecated. Retrieves a read-only object having linguistic characteristics that are identified by the specified RFC 4646 language tag. - The name of a language as specified by the RFC 4646 standard. - A read-only object. - name is null. - name does not correspond to a supported culture. - - - Gets the list of supported cultures filtered by the specified parameter. - A bitwise combination of the enumeration values that filter the cultures to retrieve. - An array that contains the cultures specified by the types parameter. The array of cultures is unsorted. - types specifies an invalid combination of values. - - - Gets an object that defines how to format the specified type. - The for which to get a formatting object. This method only supports the and types. - The value of the property, which is a containing the default number format information for the current , if formatType is the object for the class. -or- The value of the property, which is a containing the default date and time format information for the current , if formatType is the object for the class. -or- null, if formatType is any other object. - - - Serves as a hash function for the current , suitable for hashing algorithms and data structures, such as a hash table. - A hash code for the current . - - - Deprecated. Gets the RFC 4646 standard identification for a language. - A string that is the RFC 4646 standard identification for a language. - - - Gets the that represents the culture installed with the operating system. - The that represents the culture installed with the operating system. - - - Gets the object that is culture-independent (invariant). - The object that is culture-independent (invariant). - - - Gets a value indicating whether the current represents a neutral culture. - true if the current represents a neutral culture; otherwise, false. - - - Gets a value indicating whether the current is read-only. - true if the current is read-only; otherwise, false. The default is false. - - - Gets the active input locale identifier. - A 32-bit signed number that specifies an input locale identifier. - - - Gets the culture identifier for the current . - The culture identifier for the current . - - - Gets the culture name in the format languagecode2-country/regioncode2. - The culture name in the format languagecode2-country/regioncode2. languagecode2 is a lowercase two-letter code derived from ISO 639-1. country/regioncode2 is derived from ISO 3166 and usually consists of two uppercase letters, or a BCP-47 language tag. - - - Gets the culture name, consisting of the language, the country/region, and the optional script, that the culture is set to display. - The culture name. consisting of the full name of the language, the full name of the country/region, and the optional script. The format is discussed in the description of the class. - - - Gets or sets a that defines the culturally appropriate format of displaying numbers, currency, and percentage. - A that defines the culturally appropriate format of displaying numbers, currency, and percentage. - The property is set to null. - The property or any of the properties is set, and the is read-only. - - - Gets the list of calendars that can be used by the culture. - An array of type that represents the calendars that can be used by the culture represented by the current . - - - Gets the that represents the parent culture of the current . - The that represents the parent culture of the current . - - - Returns a read-only wrapper around the specified object. - The object to wrap. - A read-only wrapper around ci. - ci is null. - - - Gets the that defines the writing system associated with the culture. - The that defines the writing system associated with the culture. - - - Gets the ISO 639-2 three-letter code for the language of the current . - The ISO 639-2 three-letter code for the language of the current . - - - Gets the three-letter code for the language as defined in the Windows API. - The three-letter code for the language as defined in the Windows API. - - - Returns a string containing the name of the current in the format languagecode2-country/regioncode2. - A string containing the name of the current . - - - Gets the ISO 639-1 two-letter code for the language of the current . - The ISO 639-1 two-letter code for the language of the current . - - - Gets a value indicating whether the current object uses the user-selected culture settings. - true if the current uses the user-selected culture settings; otherwise, false. - - - The exception that is thrown when a method attempts to construct a culture that is not available. - - - Initializes a new instance of the class with its message string set to a system-supplied message. - - - Initializes a new instance of the class with the specified error message. - The error message to display with this exception. - - - Initializes a new instance of the class using the specified serialization data and context. - The object that holds the serialized object data. - The contextual information about the source or destination. - - - Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. - The error message to display with this exception. - The exception that is the cause of the current exception. If the innerException parameter is not a null reference, the current exception is raised in a catch block that handles the inner exception. - - - Initializes a new instance of the class with a specified error message and the name of the parameter that is the cause this exception. - The name of the parameter that is the cause of the current exception. - The error message to display with this exception. - - - Initializes a new instance of the class with a specified error message, the invalid Culture ID, and a reference to the inner exception that is the cause of this exception. - The error message to display with this exception. - The Culture ID that cannot be found. - The exception that is the cause of the current exception. If the innerException parameter is not a null reference, the current exception is raised in a catch block that handles the inner exception. - - - Initializes a new instance of the class with a specified error message, the invalid Culture ID, and the name of the parameter that is the cause this exception. - The name of the parameter that is the cause the current exception. - The Culture ID that cannot be found. - The error message to display with this exception. - - - Initializes a new instance of the class with a specified error message, the invalid Culture Name, and a reference to the inner exception that is the cause of this exception. - The error message to display with this exception. - The Culture Name that cannot be found. - The exception that is the cause of the current exception. If the innerException parameter is not a null reference, the current exception is raised in a catch block that handles the inner exception. - - - Initializes a new instance of the class with a specified error message, the invalid Culture Name, and the name of the parameter that is the cause this exception. - The name of the parameter that is the cause the current exception. - The Culture Name that cannot be found. - The error message to display with this exception. - - - Sets the object with the parameter name and additional exception information. - The object that holds the serialized object data. - The contextual information about the source or destination. - info is null. - - - Gets the culture identifier that cannot be found. - The invalid culture identifier. - - - Gets the culture name that cannot be found. - The invalid culture name. - - - Gets the error message that explains the reason for the exception. - A text string describing the details of the exception. - - - Defines the types of culture lists that can be retrieved using the method. - - - All cultures that ship with the .NET Framework, including neutral and specific cultures, cultures installed in the Windows operating system, and custom cultures created by the user. is a composite field that includes the , , and values. - - - - This member is deprecated; using this value with returns neutral and specific cultures shipped with the .NET Framework 2.0. - - - - All cultures that are installed in the Windows operating system. Note that not all cultures supported by the .NET Framework are installed in the operating system. - - - - Cultures that are associated with a language but are not specific to a country/region. The names of .NET Framework cultures consist of the lowercase two-letter code derived from ISO 639-1. For example: "en" (English) is a neutral culture. - - - - Custom cultures created by the user that replace cultures shipped with the .NET Framework. - - - -

Cultures that are specific to a country/region. The names of these cultures follow RFC 4646 (Windows Vista and later). The format is "-", where is a lowercase two-letter code derived from ISO 639-1 and is an uppercase two-letter code derived from ISO 3166. For example, "en-US" for English (United States) is a specific culture.

-

-
- -
- - Custom cultures created by the user. - - - - This member is deprecated. If it is used as an argument to the method, the method returns an empty array. - - - - Provides culture-specific information about the format of date and time values. - - - Initializes a new writable instance of the class that is culture-independent (invariant). - - - Gets or sets a one-dimensional array of type containing the culture-specific abbreviated names of the days of the week. - A one-dimensional array of type containing the culture-specific abbreviated names of the days of the week. The array for contains "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", and "Sat". - The property is being set to null. - The property is being set to an array that is multidimensional or that has a length that is not exactly 7. - The property is being set and the object is read-only. - - - Gets or sets a string array of abbreviated month names associated with the current object. - An array of abbreviated month names. - In a set operation, the array is multidimensional or has a length that is not exactly 13. - In a set operation, the array or one of the elements of the array is null. - In a set operation, the current object is read-only. - - - Gets or sets a one-dimensional string array that contains the culture-specific abbreviated names of the months. - A one-dimensional string array with 13 elements that contains the culture-specific abbreviated names of the months. For 12-month calendars, the 13th element of the array is an empty string. The array for contains "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", and "". - The property is being set to null. - The property is being set to an array that is multidimensional or that has a length that is not exactly 13. - The property is being set and the object is read-only. - - - Gets or sets the string designator for hours that are "ante meridiem" (before noon). - The string designator for hours that are ante meridiem. The default for is "AM". - The property is being set to null. - The property is being set and the object is read-only. - - - Gets or sets the calendar to use for the current culture. - The calendar to use for the current culture. The default for is a object. - The property is being set to null. - The property is being set to a object that is not valid for the current culture. - The property is being set and the object is read-only. - - - Gets or sets a value that specifies which rule is used to determine the first calendar week of the year. - A value that determines the first calendar week of the year. The default for is . - The property is being set to a value that is not a valid value. - In a set operation, the current object is read-only. - - - Creates a shallow copy of the . - A new object copied from the original . - - - Gets a read-only object that formats values based on the current culture. - A read-only object based on the object for the current thread. - - - Gets or sets the string that separates the components of a date, that is, the year, month, and day. - The string that separates the components of a date, that is, the year, month, and day. The default for is "/". - The property is being set to null. - The property is being set and the object is read-only. - - - Gets or sets a one-dimensional string array that contains the culture-specific full names of the days of the week. - A one-dimensional string array that contains the culture-specific full names of the days of the week. The array for contains "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", and "Saturday". - The property is being set to null. - The property is being set to an array that is multidimensional or that has a length that is not exactly 7. - The property is being set and the object is read-only. - - - Gets or sets the first day of the week. - An enumeration value that represents the first day of the week. The default for is . - The property is being set to a value that is not a valid value. - The property is being set and the object is read-only. - - - Gets or sets the custom format string for a long date and long time value. - The custom format string for a long date and long time value. - The property is being set to null. - The property is being set and the object is read-only. - - - Returns the culture-specific abbreviated name of the specified day of the week based on the culture associated with the current object. - A value. - The culture-specific abbreviated name of the day of the week represented by dayofweek. - dayofweek is not a valid value. - - - Returns the string containing the abbreviated name of the specified era, if an abbreviation exists. - The integer representing the era. - A string containing the abbreviated name of the specified era, if an abbreviation exists. -or- A string containing the full name of the era, if an abbreviation does not exist. - era does not represent a valid era in the calendar specified in the property. - - - Returns the culture-specific abbreviated name of the specified month based on the culture associated with the current object. - An integer from 1 through 13 representing the name of the month to retrieve. - The culture-specific abbreviated name of the month represented by month. - month is less than 1 or greater than 13. - - - Returns all the standard patterns in which date and time values can be formatted. - An array that contains the standard patterns in which date and time values can be formatted. - - - Returns all the patterns in which date and time values can be formatted using the specified standard format string. - A standard format string. - An array containing the standard patterns in which date and time values can be formatted using the specified format string. - format is not a valid standard format string. - - - Returns the culture-specific full name of the specified day of the week based on the culture associated with the current object. - A value. - The culture-specific full name of the day of the week represented by dayofweek. - dayofweek is not a valid value. - - - Returns the integer representing the specified era. - The string containing the name of the era. - The integer representing the era, if eraName is valid; otherwise, -1. - eraName is null. - - - Returns the string containing the name of the specified era. - The integer representing the era. - A string containing the name of the era. - era does not represent a valid era in the calendar specified in the property. - - - Returns an object of the specified type that provides a date and time formatting service. - The type of the required formatting service. - The current object, if formatType is the same as the type of the current ; otherwise, null. - - - Returns the object associated with the specified . - The that gets the object. -or- null to get . - A object associated with . - - - Returns the culture-specific full name of the specified month based on the culture associated with the current object. - An integer from 1 through 13 representing the name of the month to retrieve. - The culture-specific full name of the month represented by month. - month is less than 1 or greater than 13. - - - Obtains the shortest abbreviated day name for a specified day of the week associated with the current object. - One of the values. - The abbreviated name of the week that corresponds to the dayOfWeek parameter. - dayOfWeek is not a value in the enumeration. - - - Gets the default read-only object that is culture-independent (invariant). - A read-only object that is culture-independent (invariant). - - - Gets a value indicating whether the object is read-only. - true if the object is read-only; otherwise, false. - - - Gets or sets the custom format string for a long date value. - The custom format string for a long date value. - The property is being set to null. - The property is being set and the object is read-only. - - - Gets or sets the custom format string for a long time value. - The format pattern for a long time value. - The property is being set to null. - The property is being set and the object is read-only. - - - Gets or sets the custom format string for a month and day value. - The custom format string for a month and day value. - The property is being set to null. - The property is being set and the object is read-only. - - - Gets or sets a string array of month names associated with the current object. - A string array of month names. - In a set operation, the array is multidimensional or has a length that is not exactly 13. - In a set operation, the array or one of its elements is null. - In a set operation, the current object is read-only. - - - Gets or sets a one-dimensional array of type containing the culture-specific full names of the months. - A one-dimensional array of type containing the culture-specific full names of the months. In a 12-month calendar, the 13th element of the array is an empty string. The array for contains "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December", and "". - The property is being set to null. - The property is being set to an array that is multidimensional or that has a length that is not exactly 13. - The property is being set and the object is read-only. - - - Gets the native name of the calendar associated with the current object. - The native name of the calendar used in the culture associated with the current object if that name is available, or the empty string ("") if the native calendar name is not available. - - - Gets or sets the string designator for hours that are "post meridiem" (after noon). - The string designator for hours that are "post meridiem" (after noon). The default for is "PM". - The property is being set to null. - The property is being set and the object is read-only. - - - Returns a read-only wrapper. - The object to wrap. - A read-only wrapper. - dtfi is null. - - - Gets the custom format string for a time value that is based on the Internet Engineering Task Force (IETF) Request for Comments (RFC) 1123 specification. - The custom format string for a time value that is based on the IETF RFC 1123 specification. - - - Sets the custom date and time format strings that correspond to a specified standard format string. - An array of custom format strings. - The standard format string associated with the custom format strings specified in the patterns parameter. - patterns is null or a zero-length array. -or- format is not a valid standard format string or is a standard format string whose patterns cannot be set. - patterns has an array element whose value is null. - This object is read-only. - - - Gets or sets the custom format string for a short date value. - The custom format string for a short date value. - The property is being set to null. - The property is being set and the object is read-only. - - - Gets or sets a string array of the shortest unique abbreviated day names associated with the current object. - A string array of day names. - In a set operation, the array does not have exactly seven elements. - In a set operation, the value array or one of the elements of the value array is null. - In a set operation, the current object is read-only. - - - Gets or sets the custom format string for a short time value. - The custom format string for a short time value. - The property is being set to null. - The property is being set and the object is read-only. - - - Gets the custom format string for a sortable date and time value. - The custom format string for a sortable date and time value. - - - Gets or sets the string that separates the components of time, that is, the hour, minutes, and seconds. - The string that separates the components of time. The default for is ":". - The property is being set to null. - The property is being set and the object is read-only. - - - Gets the custom format string for a universal, sortable date and time string. - The custom format string for a universal, sortable date and time string. - - - Gets or sets the custom format string for a year and month value. - The custom format string for a year and month value. - The property is being set to null. - The property is being set and the object is read-only. - - - Defines the formatting options that customize string parsing for some date and time parsing methods. - - - Date and time are returned as a Coordinated Universal Time (UTC). If the input string denotes a local time, through a time zone specifier or , the date and time are converted from the local time to UTC. If the input string denotes a UTC time, through a time zone specifier or , no conversion occurs. If the input string does not denote a local or UTC time, no conversion occurs and the resulting property is . - - - - Extra white-space characters in the middle of the string must be ignored during parsing, except if they occur in the format patterns. - - - - Leading white-space characters must be ignored during parsing, except if they occur in the format patterns. - - - - Trailing white-space characters must be ignored during parsing, except if they occur in the format patterns. - - - - Extra white-space characters anywhere in the string must be ignored during parsing, except if they occur in the format patterns. This value is a combination of the , , and values. - - - - If no time zone is specified in the parsed string, the string is assumed to denote a local time. - - - - If no time zone is specified in the parsed string, the string is assumed to denote a UTC. - - - - If the parsed string contains only the time and not the date, the parsing methods assume the Gregorian date with year = 1, month = 1, and day = 1. If this value is not used, the current date is assumed. - - - - Default formatting options must be used. This value represents the default style for the , , and methods. - - - - The field of a date is preserved when a object is converted to a string using the "o" or "r" standard format specifier, and the string is then converted back to a object. - - - - Defines the period of daylight saving time. - - - Initializes a new instance of the class with the specified start, end, and time difference information. - The object that represents the date and time when daylight saving time begins. The value must be in local time. - The object that represents the date and time when daylight saving time ends. The value must be in local time. - The object that represents the difference between standard time and daylight saving time, in ticks. - - - Gets the time interval that represents the difference between standard time and daylight saving time. - The time interval that represents the difference between standard time and daylight saving time. - - - Gets the object that represents the date and time when the daylight saving period ends. - The object that represents the date and time when the daylight saving period ends. The value is in local time. - - - Gets the object that represents the date and time when the daylight saving period begins. - The object that represents the date and time when the daylight saving period begins. The value is in local time. - - - Specifies the culture-specific display of digits. - - - The digit shape depends on the previous text in the same output. European digits follow Latin scripts; Arabic-Indic digits follow Arabic text; and Thai digits follow Thai text. - - - - The digit shape is the native equivalent of the digits from 0 through 9. ASCII digits from 0 through 9 are replaced by equivalent native national digits. - - - - The digit shape is not changed. Full Unicode compatibility is maintained. - - - - Represents a calendar that divides time into months, days, years, and eras, and has dates that are based on cycles of the sun and the moon. - - - Calculates the date that is the specified number of months away from the specified date. - The to which to add months. - The number of months to add. - A new that results from adding the specified number of months to the time parameter. - The result is outside the supported range of a . - months is less than -120000 or greater than 120000. -or- time is less than or greater than . - - - Calculates the date that is the specified number of years away from the specified date. - The to which to add years. - The number of years to add. - A new that results from adding the specified number of years to the time parameter. - The result is outside the supported range of a . - time is less than or greater than . - - - Gets a value indicating whether the current calendar is solar-based, lunar-based, or a combination of both. - Always returns . - - - Calculates the celestial stem of the specified year in the sexagenary (60-year) cycle. - An integer from 1 through 60 that represents a year in the sexagenary cycle. - A number from 1 through 10. - sexagenaryYear is less than 1 or greater than 60. - - - Calculates the day of the month in the specified date. - The to read. - An integer from 1 through 31 that represents the day of the month specified in the time parameter. - - - Calculates the day of the week in the specified date. - The to read. - One of the values that represents the day of the week specified in the time parameter. - time is less than or greater than . - - - Calculates the day of the year in the specified date. - The to read. - An integer from 1 through 354 in a common year, or 1 through 384 in a leap year, that represents the day of the year specified in the time parameter. - - - Calculates the number of days in the specified month of the specified year and era. - An integer that represents the year. - An integer from 1 through 12 in a common year, or 1 through 13 in a leap year, that represents the month. - An integer that represents the era. - The number of days in the specified month of the specified year and era. - year, month, or era is outside the range supported by this calendar. - - - Calculates the number of days in the specified year and era. - An integer that represents the year. - An integer that represents the era. - The number of days in the specified year and era. - year or era is outside the range supported by this calendar. - - - Calculates the leap month for the specified year and era. - An integer that represents the year. - An integer that represents the era. - A positive integer from 1 through 13 that indicates the leap month in the specified year and era. -or- Zero if this calendar does not support a leap month, or if the year and era parameters do not specify a leap year. - - - Returns the month in the specified date. - The to read. - An integer from 1 to 13 that represents the month specified in the time parameter. - - - Calculates the number of months in the specified year and era. - An integer that represents the year. - An integer that represents the era. - The number of months in the specified year in the specified era. The return value is 12 months in a common year or 13 months in a leap year. - year or era is outside the range supported by this calendar. - - - Calculates the year in the sexagenary (60-year) cycle that corresponds to the specified date. - A to read. - A number from 1 through 60 in the sexagenary cycle that corresponds to the date parameter. - - - Calculates the terrestrial branch of the specified year in the sexagenary (60-year) cycle. - An integer from 1 through 60 that represents a year in the sexagenary cycle. - An integer from 1 through 12. - sexagenaryYear is less than 1 or greater than 60. - - - Returns the year in the specified date. - The to read. - An integer that represents the year in the specified . - - - Determines whether the specified date in the specified era is a leap day. - An integer that represents the year. - An integer from 1 through 13 that represents the month. - An integer from 1 through 31 that represents the day. - An integer that represents the era. - true if the specified day is a leap day; otherwise, false. - year, month, day, or era is outside the range supported by this calendar. - - - Determines whether the specified month in the specified year and era is a leap month. - An integer that represents the year. - An integer from 1 through 13 that represents the month. - An integer that represents the era. - true if the month parameter is a leap month; otherwise, false. - year, month, or era is outside the range supported by this calendar. - - - Determines whether the specified year in the specified era is a leap year. - An integer that represents the year. - An integer that represents the era. - true if the specified year is a leap year; otherwise, false. - year or era is outside the range supported by this calendar. - - - Returns a that is set to the specified date, time, and era. - An integer that represents the year. - An integer from 1 through 13 that represents the month. - An integer from 1 through 31 that represents the day. - An integer from 0 through 23 that represents the hour. - An integer from 0 through 59 that represents the minute. - An integer from 0 through 59 that represents the second. - An integer from 0 through 999 that represents the millisecond. - An integer that represents the era. - A that is set to the specified date, time, and era. - year, month, day, hour, minute, second, millisecond, or era is outside the range supported by this calendar. - - - Converts the specified year to a four-digit year. - A two-digit or four-digit integer that represents the year to convert. - An integer that contains the four-digit representation of the year parameter. - year is outside the range supported by this calendar. - - - Gets or sets the last year of a 100-year range that can be represented by a 2-digit year. - The last year of a 100-year range that can be represented by a 2-digit year. - The current is read-only. - The value in a set operation is less than 99 or greater than the maximum supported year in the current calendar. - - - - - - - - - - - Represents the Gregorian calendar. - - - Initializes a new instance of the class using the default value. - - - Initializes a new instance of the class using the specified value. - The value that denotes which language version of the calendar to create. - type is not a member of the enumeration. - - - Returns a that is the specified number of months away from the specified . - The to which to add months. - The number of months to add. - The that results from adding the specified number of months to the specified . - The resulting is outside the supported range. - months is less than -120000. -or- months is greater than 120000. - - - Returns a that is the specified number of years away from the specified . - The to which to add years. - The number of years to add. - The that results from adding the specified number of years to the specified . - The resulting is outside the supported range. - - - Represents the current era. This field is constant. - - - - Gets a value that indicates whether the current calendar is solar-based, lunar-based, or a combination of both. - Always returns . - - - Gets or sets the value that denotes the language version of the current . - A value that denotes the language version of the current . - The value specified in a set operation is not a member of the enumeration. - In a set operation, the current instance is read-only. - - - Gets the list of eras in the . - An array of integers that represents the eras in the . - - - Returns the day of the month in the specified . - The to read. - An integer from 1 to 31 that represents the day of the month in time. - - - Returns the day of the week in the specified . - The to read. - A value that represents the day of the week in time. - - - Returns the day of the year in the specified . - The to read. - An integer from 1 to 366 that represents the day of the year in time. - - - Returns the number of days in the specified month in the specified year in the specified era. - An integer that represents the year. - An integer from 1 to 12 that represents the month. - An integer that represents the era. - The number of days in the specified month in the specified year in the specified era. - era is outside the range supported by the calendar. -or- year is outside the range supported by the calendar. -or- month is outside the range supported by the calendar. - - - Returns the number of days in the specified year in the specified era. - An integer that represents the year. - An integer that represents the era. - The number of days in the specified year in the specified era. - era is outside the range supported by the calendar. -or- year is outside the range supported by the calendar. - - - Returns the era in the specified . - The to read. - An integer that represents the era in time. - - - Calculates the leap month for a specified year and era. - A year. - An era. Specify either or GregorianCalendar.Eras[Calendar.CurrentEra]. - Always 0 because the Gregorian calendar does not recognize leap months. - year is less than the Gregorian calendar year 1 or greater than the Gregorian calendar year 9999. -or- era is not or GregorianCalendar.Eras[Calendar.CurrentEra]. - - - Returns the month in the specified . - The to read. - An integer from 1 to 12 that represents the month in time. - - - Returns the number of months in the specified year in the specified era. - An integer that represents the year. - An integer that represents the era. - The number of months in the specified year in the specified era. - era is outside the range supported by the calendar. -or- year is outside the range supported by the calendar. - - - Returns the year in the specified . - The to read. - An integer that represents the year in time. - - - Determines whether the specified date in the specified era is a leap day. - An integer that represents the year. - An integer from 1 to 12 that represents the month. - An integer from 1 to 31 that represents the day. - An integer that represents the era. - true if the specified day is a leap day; otherwise, false. - era is outside the range supported by the calendar. -or- year is outside the range supported by the calendar. -or- month is outside the range supported by the calendar. -or- day is outside the range supported by the calendar. - - - Determines whether the specified month in the specified year in the specified era is a leap month. - An integer that represents the year. - An integer from 1 to 12 that represents the month. - An integer that represents the era. - This method always returns false, unless overridden by a derived class. - era is outside the range supported by the calendar. -or- year is outside the range supported by the calendar. -or- month is outside the range supported by the calendar. - - - Determines whether the specified year in the specified era is a leap year. - An integer that represents the year. - An integer that represents the era. - true if the specified year is a leap year; otherwise, false. - era is outside the range supported by the calendar. -or- year is outside the range supported by the calendar. - - - Gets the latest date and time supported by the type. - The latest date and time supported by the type, which is the last moment of December 31, 9999 C.E. and is equivalent to . - - - Gets the earliest date and time supported by the type. - The earliest date and time supported by the type, which is the first moment of January 1, 0001 C.E. and is equivalent to . - - - Returns a that is set to the specified date and time in the specified era. - An integer that represents the year. - An integer from 1 to 12 that represents the month. - An integer from 1 to 31 that represents the day. - An integer from 0 to 23 that represents the hour. - An integer from 0 to 59 that represents the minute. - An integer from 0 to 59 that represents the second. - An integer from 0 to 999 that represents the millisecond. - An integer that represents the era. - The that is set to the specified date and time in the current era. - era is outside the range supported by the calendar. -or- year is outside the range supported by the calendar. -or- month is outside the range supported by the calendar. -or- day is outside the range supported by the calendar. -or- hour is less than zero or greater than 23. -or- minute is less than zero or greater than 59. -or- second is less than zero or greater than 59. -or- millisecond is less than zero or greater than 999. - - - Converts the specified year to a four-digit year by using the property to determine the appropriate century. - A two-digit or four-digit integer that represents the year to convert. - An integer that contains the four-digit representation of year. - year is outside the range supported by the calendar. - - - Gets or sets the last year of a 100-year range that can be represented by a 2-digit year. - The last year of a 100-year range that can be represented by a 2-digit year. - The value specified in a set operation is less than 99. -or- The value specified in a set operation is greater than MaxSupportedDateTime.Year. - In a set operation, the current instance is read-only. - - - Defines the different language versions of the Gregorian calendar. - - - Refers to the Arabic version of the Gregorian calendar. - - - - Refers to the localized version of the Gregorian calendar, based on the language of the that uses the . - - - - Refers to the Middle East French version of the Gregorian calendar. - - - - Refers to the transliterated English version of the Gregorian calendar. - - - - Refers to the transliterated French version of the Gregorian calendar. - - - - Refers to the U.S. English version of the Gregorian calendar. - - - - Represents the Hebrew calendar. - - - Initializes a new instance of the class. - - - Returns a that is the specified number of months away from the specified . - The to which to add months. - The number of months to add. - The that results from adding the specified number of months to the specified . - The resulting is outside the supported range. - months is less than -120,000 or greater than 120,000. - - - Returns a that is the specified number of years away from the specified . - The to which to add years. - The number of years to add. - The that results from adding the specified number of years to the specified . - The resulting is outside the supported range. - - - Gets a value that indicates whether the current calendar is solar-based, lunar-based, or a combination of both. - Always returns . - - - Gets the list of eras in the . - An array of integers that represents the eras in the type. The return value is always an array containing one element equal to . - - - Returns the day of the month in the specified . - The to read. - An integer from 1 to 30 that represents the day of the month in the specified . - - - Returns the day of the week in the specified . - The to read. - A value that represents the day of the week in the specified . - - - Returns the day of the year in the specified . - The to read. - An integer from 1 to 385 that represents the day of the year in the specified . - time is earlier than September 17, 1583 in the Gregorian calendar, or greater than . - - - Returns the number of days in the specified month in the specified year in the specified era. - An integer that represents the year. - An integer from 1 to 13 that represents the month. - An integer that represents the era. Specify either or Calendar.Eras[Calendar.CurrentEra]. - The number of days in the specified month in the specified year in the specified era. - year, month, or era is outside the range supported by the current object. - - - Returns the number of days in the specified year in the specified era. - An integer that represents the year. - An integer that represents the era. Specify either or HebrewCalendar.Eras[Calendar.CurrentEra]. - The number of days in the specified year in the specified era. - year or era is outside the range supported by the current object. - - - Returns the era in the specified . - The to read. - An integer that represents the era in the specified . The return value is always . - - - Calculates the leap month for a specified year and era. - A year. - An era. Specify either or HebrewCalendar.Eras[Calendar.CurrentEra]. - A positive integer that indicates the leap month in the specified year and era. The return value is 7 if the year and era parameters specify a leap year, or 0 if the year is not a leap year. - era is not or HebrewCalendar.Eras[Calendar.CurrentEra]. -or- year is less than the Hebrew calendar year 5343 or greater than the Hebrew calendar year 5999. - - - Returns the month in the specified . - The to read. - An integer from 1 to 13 that represents the month in the specified . - time is less than or greater than . - - - Returns the number of months in the specified year in the specified era. - An integer that represents the year. - An integer that represents the era. Specify either or HebrewCalendar.Eras[Calendar.CurrentEra]. - The number of months in the specified year in the specified era. The return value is either 12 in a common year, or 13 in a leap year. - year or era is outside the range supported by the current object. - - - Returns the year in the specified value. - The to read. - An integer that represents the year in the specified value. - time is outside the range supported by the current object. - - - Represents the current era. This field is constant. - - - - Determines whether the specified date in the specified era is a leap day. - An integer that represents the year. - An integer from 1 to 13 that represents the month. - An integer from 1 to 30 that represents the day. - An integer that represents the era. Specify either or HebrewCalendar.Eras[Calendar.CurrentEra].. - true if the specified day is a leap day; otherwise, false. - year, month, day, or era is outside the range supported by this calendar. - - - Determines whether the specified month in the specified year in the specified era is a leap month. - An integer that represents the year. - An integer from 1 to 13 that represents the month. - An integer that represents the era. Specify either or HebrewCalendar.Eras[Calendar.CurrentEra]. - true if the specified month is a leap month; otherwise, false. - year, month, or era is outside the range supported by this calendar. - - - Determines whether the specified year in the specified era is a leap year. - An integer that represents the year. - An integer that represents the era. Specify either or HebrewCalendar.Eras[Calendar.CurrentEra]. - true if the specified year is a leap year; otherwise, false. - year or era is outside the range supported by this calendar. - - - Gets the latest date and time supported by the type. - The latest date and time supported by the type, which is equivalent to the last moment of September, 29, 2239 C.E. in the Gregorian calendar. - - - Gets the earliest date and time supported by the type. - The earliest date and time supported by the type, which is equivalent to the first moment of January, 1, 1583 C.E. in the Gregorian calendar. - - - Returns a that is set to the specified date and time in the specified era. - An integer that represents the year. - An integer from 1 to 13 that represents the month. - An integer from 1 to 30 that represents the day. - An integer from 0 to 23 that represents the hour. - An integer from 0 to 59 that represents the minute. - An integer from 0 to 59 that represents the second. - An integer from 0 to 999 that represents the millisecond. - An integer that represents the era. Specify either or HebrewCalendar.Eras[Calendar.CurrentEra]. - The that is set to the specified date and time in the current era. - year, month, day or era is outside the range supported by the current object. -or- hour is less than 0 or greater than 23. -or- minute is less than 0 or greater than 59. -or- second is less than 0 or greater than 59. -or- millisecond is less than 0 or greater than 999. - - - Converts the specified year to a 4-digit year by using the property to determine the appropriate century. - A 2-digit year from 0 through 99, or a 4-digit Hebrew calendar year from 5343 through 5999. - If the year parameter is a 2-digit year, the return value is the corresponding 4-digit year. If the year parameter is a 4-digit year, the return value is the unchanged year parameter. - year is less than 0. -or- year is less than or greater than . - - - Gets or sets the last year of a 100-year range that can be represented by a 2-digit year. - The last year of a 100-year range that can be represented by a 2-digit year. - The current object is read-only. - In a set operation, the Hebrew calendar year value is less than 5343 but is not 99, or the year value is greater than 5999. - - - Represents the Hijri calendar. - - - Initializes a new instance of the class. - - - Returns a that is the specified number of months away from the specified . - The to add months to. - The number of months to add. - The that results from adding the specified number of months to the specified . - The resulting . - months is less than -120000. -or- months is greater than 120000. - - - Returns a that is the specified number of years away from the specified . - The to add years to. - The number of years to add. - The that results from adding the specified number of years to the specified . - The resulting is outside the supported range. - - - Gets a value that indicates whether the current calendar is solar-based, lunar-based, or a combination of both. - Always returns . - - - Gets the number of days in the year that precedes the year that is specified by the property. - The number of days in the year that precedes the year specified by . - - - Gets the list of eras in the . - An array of integers that represents the eras in the . - - - Returns the day of the month in the specified . - The to read. - An integer from 1 to 30 that represents the day of the month in the specified . - - - Returns the day of the week in the specified . - The to read. - A value that represents the day of the week in the specified . - - - Returns the day of the year in the specified . - The to read. - An integer from 1 to 355 that represents the day of the year in the specified . - - - Returns the number of days in the specified month of the specified year and era. - An integer that represents the year. - An integer from 1 to 12 that represents the month. - An integer that represents the era. - The number of days in the specified month in the specified year in the specified era. - era is outside the range supported by this calendar. -or- year is outside the range supported by this calendar. -or- month is outside the range supported by this calendar. - - - Returns the number of days in the specified year and era. - An integer that represents the year. - An integer that represents the era. - The number of days in the specified year and era. The number of days is 354 in a common year or 355 in a leap year. - year or era is outside the range supported by this calendar. - - - Returns the era in the specified . - The to read. - An integer that represents the era in the specified . - - - Calculates the leap month for a specified year and era. - A year. - An era. Specify or . - Always 0 because the type does not support the notion of a leap month. - year is less than the Hijri calendar year 1 or greater than the year 9666. -or- era is not or . - - - Returns the month in the specified . - The to read. - An integer from 1 to 12 that represents the month in the specified . - - - Returns the number of months in the specified year and era. - An integer that represents the year. - An integer that represents the era. - The number of months in the specified year and era. - era is outside the range supported by this calendar. -or- year is outside the range supported by this calendar. - - - Returns the year in the specified . - The to read. - An integer that represents the year in the specified . - - - Gets or sets the number of days to add or subtract from the calendar to accommodate the variances in the start and the end of Ramadan and to accommodate the date difference between countries/regions. - An integer from -2 to 2 that represents the number of days to add or subtract from the calendar. - The property is being set to an invalid value. - - - Represents the current era. This field is constant. - - - - Determines whether the specified date is a leap day. - An integer that represents the year. - An integer from 1 to 12 that represents the month. - An integer from 1 to 30 that represents the day. - An integer that represents the era. - true if the specified day is a leap day; otherwise, false. - era is outside the range supported by this calendar. -or- year is outside the range supported by this calendar. -or- month is outside the range supported by this calendar. -or- day is outside the range supported by this calendar. - - - Determines whether the specified month in the specified year and era is a leap month. - An integer that represents the year. - An integer from 1 to 12 that represents the month. - An integer that represents the era. - This method always returns false. - era is outside the range supported by this calendar. -or- year is outside the range supported by this calendar. -or- month is outside the range supported by this calendar. - - - Determines whether the specified year in the specified era is a leap year. - An integer that represents the year. - An integer that represents the era. - true if the specified year is a leap year; otherwise, false. - era is outside the range supported by this calendar. -or- year is outside the range supported by this calendar. - - - Gets the latest date and time supported by this calendar. - The latest date and time supported by the type, which is equivalent to the last moment of December 31, 9999 C.E. in the Gregorian calendar. - - - Gets the earliest date and time supported by this calendar. - The earliest date and time supported by the type, which is equivalent to the first moment of July 18, 622 C.E. in the Gregorian calendar. - - - Returns a that is set to the specified date, time, and era. - An integer that represents the year. - An integer from 1 to 12 that represents the month. - An integer from 1 to 30 that represents the day. - An integer from 0 to 23 that represents the hour. - An integer from 0 to 59 that represents the minute. - An integer from 0 to 59 that represents the second. - An integer from 0 to 999 that represents the millisecond. - An integer that represents the era. - The that is set to the specified date and time in the current era. - era is outside the range supported by this calendar. -or- year is outside the range supported by this calendar. -or- month is outside the range supported by this calendar. -or- day is outside the range supported by this calendar. -or- hour is less than zero or greater than 23. -or- minute is less than zero or greater than 59. -or- second is less than zero or greater than 59. -or- millisecond is less than zero or greater than 999. - - - Converts the specified year to a four-digit year by using the property to determine the appropriate century. - A two-digit or four-digit integer that represents the year to convert. - An integer that contains the four-digit representation of year. - year is outside the range supported by this calendar. - - - Gets or sets the last year of a 100-year range that can be represented by a 2-digit year. - The last year of a 100-year range that can be represented by a 2-digit year. - This calendar is read-only. - The value in a set operation is less than 100 or greater than 9666. - - - Supports the use of non-ASCII characters for Internet domain names. This class cannot be inherited. - - - Initializes a new instance of the class. - - - Gets or sets a value that indicates whether unassigned Unicode code points are used in operations performed by members of the current object. - true if unassigned code points are used in operations; otherwise, false. - - - Indicates whether a specified object and the current object are equal. - The object to compare to the current object. - true if the object specified by the obj parameter is derived from and its and properties are equal; otherwise, false. - - - Encodes a string of domain name labels that consist of Unicode characters to a string of displayable Unicode characters in the US-ASCII character range. The string is formatted according to the IDNA standard. - The string to convert, which consists of one or more domain name labels delimited with label separators. - The equivalent of the string specified by the unicode parameter, consisting of displayable Unicode characters in the US-ASCII character range (U+0020 to U+007E) and formatted according to the IDNA standard. - unicode is null. - unicode is invalid based on the and properties, and the IDNA standard. - - - Encodes a substring of domain name labels that include Unicode characters outside the US-ASCII character range. The substring is converted to a string of displayable Unicode characters in the US-ASCII character range and is formatted according to the IDNA standard. - The string to convert, which consists of one or more domain name labels delimited with label separators. - A zero-based offset into unicode that specifies the start of the substring to convert. The conversion operation continues to the end of the unicode string. - The equivalent of the substring specified by the unicode and index parameters, consisting of displayable Unicode characters in the US-ASCII character range (U+0020 to U+007E) and formatted according to the IDNA standard. - unicode is null. - index is less than zero. -or- index is greater than the length of unicode. - unicode is invalid based on the and properties, and the IDNA standard. - - - Encodes the specified number of characters in a substring of domain name labels that include Unicode characters outside the US-ASCII character range. The substring is converted to a string of displayable Unicode characters in the US-ASCII character range and is formatted according to the IDNA standard. - The string to convert, which consists of one or more domain name labels delimited with label separators. - A zero-based offset into unicode that specifies the start of the substring. - The number of characters to convert in the substring that starts at the position specified by index in the unicode string. - The equivalent of the substring specified by the unicode, index, and count parameters, consisting of displayable Unicode characters in the US-ASCII character range (U+0020 to U+007E) and formatted according to the IDNA standard. - unicode is null. - index or count is less than zero. -or- index is greater than the length of unicode. -or- index is greater than the length of unicode minus count. - unicode is invalid based on the and properties, and the IDNA standard. - - - Returns a hash code for this object. - One of four 32-bit signed constants derived from the properties of an object. The return value has no special meaning and is not suitable for use in a hash code algorithm. - - - Decodes a string of one or more domain name labels, encoded according to the IDNA standard, to a string of Unicode characters. - The string to decode, which consists of one or more labels in the US-ASCII character range (U+0020 to U+007E) encoded according to the IDNA standard. - The Unicode equivalent of the IDNA substring specified by the ascii parameter. - ascii is null. - ascii is invalid based on the and properties, and the IDNA standard. - - - Decodes a substring of one or more domain name labels, encoded according to the IDNA standard, to a string of Unicode characters. - The string to decode, which consists of one or more labels in the US-ASCII character range (U+0020 to U+007E) encoded according to the IDNA standard. - A zero-based offset into ascii that specifies the start of the substring to decode. The decoding operation continues to the end of the ascii string. - The Unicode equivalent of the IDNA substring specified by the ascii and index parameters. - ascii is null. - index is less than zero. -or- index is greater than the length of ascii. - ascii is invalid based on the and properties, and the IDNA standard. - - - Decodes a substring of a specified length that contains one or more domain name labels, encoded according to the IDNA standard, to a string of Unicode characters. - The string to decode, which consists of one or more labels in the US-ASCII character range (U+0020 to U+007E) encoded according to the IDNA standard. - A zero-based offset into ascii that specifies the start of the substring. - The number of characters to convert in the substring that starts at the position specified by index in the ascii string. - The Unicode equivalent of the IDNA substring specified by the ascii, index, and count parameters. - ascii is null. - index or count is less than zero. -or- index is greater than the length of ascii. -or- index is greater than the length of ascii minus count. - ascii is invalid based on the and properties, and the IDNA standard. - - - Gets or sets a value that indicates whether standard or relaxed naming conventions are used in operations performed by members of the current object. - true if standard naming conventions are used in operations; otherwise, false. - - - Represents the Japanese calendar. - - - Initializes a new instance of the class. - Unable to initialize a object because of missing culture information. - - - Returns a that is the specified number of months away from the specified . - The to which to add months. - The number of months to add. - The that results from adding the specified number of months to the specified . - The resulting is outside the supported range. - months is less than -120000. -or- months is greater than 120000. - - - Returns a that is the specified number of years away from the specified . - The to which to add years. - The number of years to add. - The that results from adding the specified number of years to the specified . - The resulting is outside the supported range. - time is outside the supported range of the type. -or- years is less than -10,000 or greater than 10,000. - - - Gets a value that indicates whether the current calendar is solar-based, lunar-based, or a combination of both. - Always returns . - - - Gets the list of eras in the . - An array of integers that represents the eras in the . - - - Returns the day of the month in the specified . - The to read. - An integer from 1 to 31 that represents the day of the month in the specified . - - - Returns the day of the week in the specified . - The to read. - A value that represents the day of the week in the specified . - - - Returns the day of the year in the specified . - The to read. - An integer from 1 to 366 that represents the day of the year in the specified . - - - Returns the number of days in the specified month in the specified year in the specified era. - An integer that represents the year. - An integer from 1 to 12 that represents the month. - An integer that represents the era. - The number of days in the specified month in the specified year in the specified era. - year is outside the range supported by the calendar. -or- month is outside the range supported by the calendar. -or- era is outside the range supported by the calendar. - - - Returns the number of days in the specified year in the specified era. - An integer that represents the year. - An integer that represents the era. - The number of days in the specified year in the specified era. - year is outside the range supported by the calendar. -or- era is outside the range supported by the calendar. - - - Returns the era in the specified . - The to read. - An integer that represents the era in the specified . - The resulting is outside the supported range. - - - Calculates the leap month for a specified year and era. - A year. - An era. - The return value is always 0 because the type does not support the notion of a leap month. - year or era is outside the range supported by the type. - - - Returns the month in the specified . - The to read. - An integer from 1 to 12 that represents the month in the specified . - - - Returns the number of months in the specified year in the specified era. - An integer that represents the year. - An integer that represents the era. - The return value is always 12. - year is outside the range supported by the calendar. -or- era is outside the range supported by the calendar. - - - Returns the week of the year that includes the date in the specified . - The to read. - One of the values that defines a calendar week. - One of the values that represents the first day of the week. - A 1-based integer that represents the week of the year that includes the date in the time parameter. - time or firstDayOfWeek is outside the range supported by the calendar. -or- rule is not a valid value. - - - Returns the year in the specified . - The to read. - An integer that represents the year in the specified . - - - Determines whether the specified date in the specified era is a leap day. - An integer that represents the year. - An integer from 1 to 12 that represents the month. - An integer from 1 to 31 that represents the day. - An integer that represents the era. - true, if the specified day is a leap day; otherwise, false. - year is outside the range supported by the calendar. -or- month is outside the range supported by the calendar. -or- day is outside the range supported by the calendar. -or- era is outside the range supported by the calendar. - - - Determines whether the specified month in the specified year in the specified era is a leap month. - An integer that represents the year. - An integer from 1 to 12 that represents the month. - An integer that represents the era. - This method always returns false, unless overridden by a derived class. - year is outside the range supported by the calendar. -or- month is outside the range supported by the calendar. -or- era is outside the range supported by the calendar. - - - Determines whether the specified year in the specified era is a leap year. - An integer that represents the year. - An integer that represents the era. - true, if the specified year is a leap year; otherwise, false. - year is outside the range supported by the calendar. -or- era is outside the range supported by the calendar. - - - Gets the latest date and time supported by the current object. - The latest date and time supported by the type, which is equivalent to the last moment of December 31, 9999 C.E. in the Gregorian calendar. - - - Gets the earliest date and time supported by the current object. - The earliest date and time supported by the type, which is equivalent to the first moment of September 8, 1868 C.E. in the Gregorian calendar. - - - Returns a that is set to the specified date and time in the specified era. - An integer that represents the year. - An integer from 1 to 12 that represents the month. - An integer from 1 to 31 that represents the day. - An integer from 0 to 23 that represents the hour. - An integer from 0 to 59 that represents the minute. - An integer from 0 to 59 that represents the second. - An integer from 0 to 999 that represents the millisecond. - An integer that represents the era. - The that is set to the specified date and time in the current era. - year is outside the range supported by the calendar. -or- month is outside the range supported by the calendar. -or- day is outside the range supported by the calendar. -or- hour is less than zero or greater than 23. -or- minute is less than zero or greater than 59. -or- second is less than zero or greater than 59. -or- millisecond is less than zero or greater than 999. -or- era is outside the range supported by the calendar. - - - Converts the specified year to a four-digit year by using the property to determine the appropriate century. - An integer (usually two digits) that represents the year to convert. - An integer that contains the four-digit representation of year. - year is outside the range supported by the calendar. - - - Gets or sets the last year of a 100-year range that can be represented by a 2-digit year. - The last year of a 100-year range that can be represented by a 2-digit year. - The value specified in a set operation is less than 99. -or- The value specified in a set operation is greater than 8011 (or MaxSupportedDateTime.Year). - In a set operation, the current instance is read-only. - - - Represents time in divisions, such as months, days, and years. Years are calculated as for the Japanese calendar, while days and months are calculated using the lunisolar calendar. - - - Initializes a new instance of the class. - - - Gets the number of days in the year that precedes the year that is specified by the property. - The number of days in the year that precedes the year specified by . - - - Gets the eras that are relevant to the object. - An array of 32-bit signed integers that specify the relevant eras. - - - Retrieves the era that corresponds to the specified . - The to read. - An integer that represents the era specified in the time parameter. - - - Specifies the current era. - - - - Gets the maximum date and time supported by the class. - The latest date and time supported by the class, which is equivalent to the last moment of January 22, 2050 C.E. in the Gregorian calendar. - - - Gets the minimum date and time supported by the class. - The earliest date and time supported by the class, which is equivalent to the first moment of January 28, 1960 C.E. in the Gregorian calendar. - - - Represents the Julian calendar. - - - Initializes a new instance of the class. - - - Returns a that is the specified number of months away from the specified . - The to which to add months. - The number of months to add. - The that results from adding the specified number of months to the specified . - The resulting is outside the supported range. - months is less than -120000. -or- months is greater than 120000. - - - Returns a that is the specified number of years away from the specified . - The to which to add years. - The number of years to add. - The that results from adding the specified number of years to the specified . - The resulting is outside the supported range. - - - Gets a value that indicates whether the current calendar is solar-based, lunar-based, or a combination of both. - Always returns . - - - Gets the list of eras in the . - An array of integers that represents the eras in the . - - - Returns the day of the month in the specified . - The to read. - An integer from 1 to 31 that represents the day of the month in time. - - - Returns the day of the week in the specified . - The to read. - A value that represents the day of the week in time. - - - Returns the day of the year in the specified . - The to read. - An integer from 1 to 366 that represents the day of the year in time. - - - Returns the number of days in the specified month in the specified year in the specified era. - An integer that represents the year. - An integer from 1 to 12 that represents the month. - An integer that represents the era. - The number of days in the specified month in the specified year in the specified era. - era is outside the range supported by the calendar. -or- year is outside the range supported by the calendar. -or- month is outside the range supported by the calendar. - - - Returns the number of days in the specified year in the specified era. - An integer that represents the year. - An integer that represents the era. - The number of days in the specified year in the specified era. - era is outside the range supported by the calendar. -or- year is outside the range supported by the calendar. - - - Returns the era in the specified . - The to read. - An integer that represents the era in time. - - - Calculates the leap month for a specified year and era. - An integer that represents the year. - An integer that represents the era. - A positive integer that indicates the leap month in the specified year and era. Alternatively, this method returns zero if the calendar does not support a leap month, or if year and era do not specify a leap year. - - - Returns the month in the specified . - The to read. - An integer from 1 to 12 that represents the month in time. - - - Returns the number of months in the specified year in the specified era. - An integer that represents the year. - An integer that represents the era. - The number of months in the specified year in the specified era. - era is outside the range supported by the calendar. -or- year is outside the range supported by the calendar. - - - Returns the year in the specified . - The to read. - An integer that represents the year in time. - - - Determines whether the specified date in the specified era is a leap day. - An integer that represents the year. - An integer from 1 to 12 that represents the month. - An integer from 1 to 31 that represents the day. - An integer that represents the era. - true if the specified day is a leap day; otherwise, false. - year is outside the range supported by the calendar. -or- month is outside the range supported by the calendar. -or- day is outside the range supported by the calendar. -or- era is outside the range supported by the calendar. - - - Determines whether the specified month in the specified year in the specified era is a leap month. - An integer that represents the year. - An integer from 1 to 12 that represents the month. - An integer that represents the era. - This method always returns false, unless overridden by a derived class. - year is outside the range supported by the calendar. -or- month is outside the range supported by the calendar. -or- era is outside the range supported by the calendar. - - - Determines whether the specified year in the specified era is a leap year. - An integer that represents the year. - An integer that represents the era. - true if the specified year is a leap year; otherwise, false. - year is outside the range supported by the calendar. -or- era is outside the range supported by the calendar. - - - Represents the current era. This field is constant. - - - - Gets the latest date and time supported by the class. - The latest date and time supported by the class, which is equivalent to the last moment of December 31, 9999 C.E. in the Gregorian calendar. - - - Gets the earliest date and time supported by the class. - The earliest date and time supported by the class, which is equivalent to the first moment of January 1, 0001 C.E. in the Gregorian calendar. - - - Returns a that is set to the specified date and time in the specified era. - An integer that represents the year. - An integer from 1 to 12 that represents the month. - An integer from 1 to 31 that represents the day. - An integer from 0 to 23 that represents the hour. - An integer from 0 to 59 that represents the minute. - An integer from 0 to 59 that represents the second. - An integer from 0 to 999 that represents the millisecond. - An integer that represents the era. - The that is set to the specified date and time in the current era. - year is outside the range supported by the calendar. -or- month is outside the range supported by the calendar. -or- day is outside the range supported by the calendar. -or- hour is less than zero or greater than 23. -or- minute is less than zero or greater than 59. -or- second is less than zero or greater than 59. -or- millisecond is less than zero or greater than 999. -or- era is outside the range supported by the calendar. - - - Converts the specified year to a four-digit year by using the property to determine the appropriate century. - A two-digit or four-digit integer that represents the year to convert. - An integer that contains the four-digit representation of year. - year is outside the range supported by the calendar. - - - Gets or sets the last year of a 100-year range that can be represented by a 2-digit year. - The last year of a 100-year range that can be represented by a 2-digit year. - The value specified in a set operation is less than 99. -or- The value specified in a set operation is greater than MaxSupportedDateTime.Year. - In a set operation, the current instance is read-only. - - - Represents the Korean calendar. - - - Initializes a new instance of the class. - Unable to initialize a object because of missing culture information. - - - Returns a that is the specified number of months away from the specified . - The to which to add months. - The number of months to add. - The that results from adding the specified number of months to the specified . - months is less than -120000. -or- months is greater than 120000. - - - Returns a that is the specified number of years away from the specified . - The to which to add years. - The number of years to add. - The that results from adding the specified number of years to the specified . - years or time is out of range. - - - Gets a value indicating whether the current calendar is solar-based, lunar-based, or a combination of both. - Always returns . - - - Gets the list of eras in the . - An array of integers that represents the eras in the . - - - Returns the day of the month in the specified . - The to read. - An integer from 1 to 31 that represents the day of the month in the specified . - - - Returns the day of the week in the specified . - The to read. - A value that represents the day of the week in the specified . - - - Returns the day of the year in the specified . - The to read. - An integer from 1 to 366 that represents the day of the year in the specified . - - - Returns the number of days in the specified month in the specified year in the specified era. - An integer that represents the year. - An integer from 1 to 12 that represents the month. - An integer that represents the era. - The number of days in the specified month in the specified year in the specified era. - year is outside the range supported by the calendar. -or- month is outside the range supported by the calendar. -or- era is outside the range supported by the calendar. - - - Returns the number of days in the specified year in the specified era. - An integer that represents the year. - An integer that represents the era. - The number of days in the specified year in the specified era. - year is outside the range supported by the calendar. -or- era is outside the range supported by the calendar. - - - Returns the era in the specified . - The to read. - An integer that represents the era in the specified . - - - Calculates the leap month for a specified year and era. - A year. - An era. - The return value is always 0 because the class does not support the notion of a leap month. - - - Returns the month in the specified . - The to read. - An integer from 1 to 12 that represents the month in the specified . - - - Returns the number of months in the specified year in the specified era. - An integer that represents the year. - An integer that represents the era. - The number of months in the specified year in the specified era. - year is outside the range supported by the calendar. -or- era is outside the range supported by the calendar. - - - Returns the week of the year that includes the date in the specified . - The to read. - One of the values that defines a calendar week. - One of the values that represents the first day of the week. - A 1-based integer that represents the week of the year that includes the date in the time parameter. - time or firstDayOfWeek is outside the range supported by the calendar. -or- rule is not a valid value. - - - Returns the year in the specified . - The to read. - An integer that represents the year in the specified . - - - Determines whether the specified date in the specified era is a leap day. - An integer that represents the year. - An integer from 1 to 12 that represents the month. - An integer from 1 to 31 that represents the day. - An integer that represents the era. - true if the specified day is a leap day; otherwise, false. - year is outside the range supported by the calendar. -or- month is outside the range supported by the calendar. -or- day is outside the range supported by the calendar. -or- era is outside the range supported by the calendar. - - - Determines whether the specified month in the specified year in the specified era is a leap month. - An integer that represents the year. - An integer from 1 to 12 that represents the month. - An integer that represents the era. - This method always returns false, unless overridden by a derived class. - year is outside the range supported by the calendar. -or- month is outside the range supported by the calendar. -or- era is outside the range supported by the calendar. - - - Determines whether the specified year in the specified era is a leap year. - An integer that represents the year. - An integer that represents the era. - true if the specified year is a leap year; otherwise, false. - year is outside the range supported by the calendar. -or- era is outside the range supported by the calendar. - - - Represents the current era. This field is constant. - - - - Gets the latest date and time supported by the class. - The latest date and time supported by the class, which is equivalent to the last moment of December 31, 9999 C.E. in the Gregorian calendar. - - - Gets the earliest date and time supported by the class. - The earliest date and time supported by the class, which is equivalent to the first moment of January 1, 0001 C.E. in the Gregorian calendar. - - - Returns a that is set to the specified date and time in the specified era. - An integer that represents the year. - An integer from 1 to 12 that represents the month. - An integer from 1 to 31 that represents the day. - An integer from 0 to 23 that represents the hour. - An integer from 0 to 59 that represents the minute. - An integer from 0 to 59 that represents the second. - An integer from 0 to 999 that represents the millisecond. - An integer that represents the era. - The that is set to the specified date and time in the current era. - year is outside the range supported by the calendar. -or- month is outside the range supported by the calendar. -or- day is outside the range supported by the calendar. -or- hour is less than zero or greater than 23. -or- minute is less than zero or greater than 59. -or- second is less than zero or greater than 59. -or- millisecond is less than zero or greater than 999. -or- era is outside the range supported by the calendar. - - - Converts the specified year to a four-digit year by using the property to determine the appropriate century. - A two-digit or four-digit integer that represents the year to convert. - An integer that contains the four-digit representation of year. - year is outside the range supported by the calendar. - - - Gets or sets the last year of a 100-year range that can be represented by a 2-digit year. - The last year of a 100-year range that can be represented by a 2-digit year. - The value specified in a set operation is less than 99. -or- The value specified in a set operation is greater than MaxSupportedDateTime.Year. - In a set operation, the current instance is read-only. - - - Represents time in divisions, such as months, days, and years. Years are calculated using the Gregorian calendar, while days and months are calculated using the lunisolar calendar. - - - Initializes a new instance of the class. - - - Gets the number of days in the year that precedes the year specified by the property. - The number of days in the year that precedes the year specified by . - - - Gets the eras that correspond to the range of dates and times supported by the current object. - An array of 32-bit signed integers that specify the relevant eras. The return value for a object is always an array containing one element equal to the value. - - - Retrieves the era that corresponds to the specified . - The to read. - An integer that represents the era specified by the time parameter. The return value for a object is always the value. - time represents a date and time less than or greater than . - - - Specifies the Gregorian era that corresponds to the current object. - - - - Gets the maximum date and time supported by the class. - The latest date and time supported by the class, which is equivalent to the last moment of February 10, 2051 C.E. in the Gregorian calendar. - - - Gets the minimum date and time supported by the class. - The earliest date and time supported by the class, which is equivalent to the first moment of February 14, 918 C.E. in the Gregorian calendar. - - - Provides culture-specific information for formatting and parsing numeric values. - - - Initializes a new writable instance of the class that is culture-independent (invariant). - - - Creates a shallow copy of the object. - A new object copied from the original object. - - - Gets or sets the number of decimal places to use in currency values. - The number of decimal places to use in currency values. The default for is 2. - The property is being set to a value that is less than 0 or greater than 99. - The property is being set and the object is read-only. - - - Gets or sets the string to use as the decimal separator in currency values. - The string to use as the decimal separator in currency values. The default for is ".". - The property is being set to null. - The property is being set and the object is read-only. - The property is being set to an empty string. - - - Gets or sets the string that separates groups of digits to the left of the decimal in currency values. - The string that separates groups of digits to the left of the decimal in currency values. The default for is ",". - The property is being set to null. - The property is being set and the object is read-only. - - - Gets or sets the number of digits in each group to the left of the decimal in currency values. - The number of digits in each group to the left of the decimal in currency values. The default for is a one-dimensional array with only one element, which is set to 3. - The property is being set to null. - The property is being set and the array contains an entry that is less than 0 or greater than 9. -or- The property is being set and the array contains an entry, other than the last entry, that is set to 0. - The property is being set and the object is read-only. - - - Gets or sets the format pattern for negative currency values. - The format pattern for negative currency values. The default for is 0, which represents "($n)", where "$" is the and n is a number. - The property is being set to a value that is less than 0 or greater than 15. - The property is being set and the object is read-only. - - - Gets or sets the format pattern for positive currency values. - The format pattern for positive currency values. The default for is 0, which represents "$n", where "$" is the and n is a number. - The property is being set to a value that is less than 0 or greater than 3. - The property is being set and the object is read-only. - - - Gets or sets the string to use as the currency symbol. - The string to use as the currency symbol. The default for is "¤". - The property is being set to null. - The property is being set and the object is read-only. - - - Gets a read-only that formats values based on the current culture. - A read-only based on the culture of the current thread. - - - Gets or sets a value that specifies how the graphical user interface displays the shape of a digit. - One of the enumeration values that specifies the culture-specific digit shape. - The current object is read-only. - The value in a set operation is not a valid value. - - - Gets an object of the specified type that provides a number formatting service. - The of the required formatting service. - The current , if formatType is the same as the type of the current ; otherwise, null. - - - Gets the associated with the specified . - The used to get the . -or- null to get . - The associated with the specified . - - - Gets a read-only object that is culture-independent (invariant). - A read-only object that is culture-independent (invariant). - - - Gets a value that indicates whether this object is read-only. - true if the is read-only; otherwise, false. - - - Gets or sets the string that represents the IEEE NaN (not a number) value. - The string that represents the IEEE NaN (not a number) value. The default for is "NaN". - The property is being set to null. - The property is being set and the object is read-only. - - - Gets or sets a string array of native digits equivalent to the Western digits 0 through 9. - A string array that contains the native equivalent of the Western digits 0 through 9. The default is an array having the elements "0", "1", "2", "3", "4", "5", "6", "7", "8", and "9". - The current object is read-only. - In a set operation, the value is null. -or- In a set operation, an element of the value array is null. - In a set operation, the value array does not contain 10 elements. -or- In a set operation, an element of the value array does not contain either a single object or a pair of objects that comprise a surrogate pair. -or- In a set operation, an element of the value array is not a number digit as defined by the Unicode Standard. That is, the digit in the array element does not have the Unicode Number, Decimal Digit (Nd) General Category value. -or- In a set operation, the numeric value of an element in the value array does not correspond to the element's position in the array. That is, the element at index 0, which is the first element of the array, does not have a numeric value of 0, or the element at index 1 does not have a numeric value of 1. - - - Gets or sets the string that represents negative infinity. - The string that represents negative infinity. The default for is "-Infinity". - The property is being set to null. - The property is being set and the object is read-only. - - - Gets or sets the string that denotes that the associated number is negative. - The string that denotes that the associated number is negative. The default for is "-". - The property is being set to null. - The property is being set and the object is read-only. - - - Gets or sets the number of decimal places to use in numeric values. - The number of decimal places to use in numeric values. The default for is 2. - The property is being set to a value that is less than 0 or greater than 99. - The property is being set and the object is read-only. - - - Gets or sets the string to use as the decimal separator in numeric values. - The string to use as the decimal separator in numeric values. The default for is ".". - The property is being set to null. - The property is being set and the object is read-only. - The property is being set to an empty string. - - - Gets or sets the string that separates groups of digits to the left of the decimal in numeric values. - The string that separates groups of digits to the left of the decimal in numeric values. The default for is ",". - The property is being set to null. - The property is being set and the object is read-only. - - - Gets or sets the number of digits in each group to the left of the decimal in numeric values. - The number of digits in each group to the left of the decimal in numeric values. The default for is a one-dimensional array with only one element, which is set to 3. - The property is being set to null. - The property is being set and the array contains an entry that is less than 0 or greater than 9. -or- The property is being set and the array contains an entry, other than the last entry, that is set to 0. - The property is being set and the object is read-only. - - - Gets or sets the format pattern for negative numeric values. - The format pattern for negative numeric values. - The property is being set to a value that is less than 0 or greater than 4. - The property is being set and the object is read-only. - - - Gets or sets the number of decimal places to use in percent values. - The number of decimal places to use in percent values. The default for is 2. - The property is being set to a value that is less than 0 or greater than 99. - The property is being set and the object is read-only. - - - Gets or sets the string to use as the decimal separator in percent values. - The string to use as the decimal separator in percent values. The default for is ".". - The property is being set to null. - The property is being set and the object is read-only. - The property is being set to an empty string. - - - Gets or sets the string that separates groups of digits to the left of the decimal in percent values. - The string that separates groups of digits to the left of the decimal in percent values. The default for is ",". - The property is being set to null. - The property is being set and the object is read-only. - - - Gets or sets the number of digits in each group to the left of the decimal in percent values. - The number of digits in each group to the left of the decimal in percent values. The default for is a one-dimensional array with only one element, which is set to 3. - The property is being set to null. - The property is being set and the array contains an entry that is less than 0 or greater than 9. -or- The property is being set and the array contains an entry, other than the last entry, that is set to 0. - The property is being set and the object is read-only. - - - Gets or sets the format pattern for negative percent values. - The format pattern for negative percent values. The default for is 0, which represents "-n %", where "%" is the and n is a number. - The property is being set to a value that is less than 0 or greater than 11. - The property is being set and the object is read-only. - - - Gets or sets the format pattern for positive percent values. - The format pattern for positive percent values. The default for is 0, which represents "n %", where "%" is the and n is a number. - The property is being set to a value that is less than 0 or greater than 3. - The property is being set and the object is read-only. - - - Gets or sets the string to use as the percent symbol. - The string to use as the percent symbol. The default for is "%". - The property is being set to null. - The property is being set and the object is read-only. - - - Gets or sets the string to use as the per mille symbol. - The string to use as the per mille symbol. The default for is "‰", which is the Unicode character U+2030. - The property is being set to null. - The property is being set and the object is read-only. - - - Gets or sets the string that represents positive infinity. - The string that represents positive infinity. The default for is "Infinity". - The property is being set to null. - The property is being set and the object is read-only. - - - Gets or sets the string that denotes that the associated number is positive. - The string that denotes that the associated number is positive. The default for is "+". - In a set operation, the value to be assigned is null. - The property is being set and the object is read-only. - - - Returns a read-only wrapper. - The to wrap. - A read-only wrapper around nfi. - nfi is null. - - - Determines the styles permitted in numeric string arguments that are passed to the Parse and TryParse methods of the integral and floating-point numeric types. - - - Indicates that the numeric string can contain a currency symbol. Valid currency symbols are determined by the property. - - - - Indicates that the numeric string can have a decimal point. If the value includes the flag and the parsed string includes a currency symbol, the decimal separator character is determined by the property. Otherwise, the decimal separator character is determined by the property. - - - - Indicates that the numeric string can be in exponential notation. The flag allows the parsed string to contain an exponent that begins with the "E" or "e" character and that is followed by an optional positive or negative sign and an integer. In other words, it successfully parses strings in the form nnnExx, nnnE+xx, and nnnE-xx. It does not allow a decimal separator or sign in the significand or mantissa; to allow these elements in the string to be parsed, use the and flags, or use a composite style that includes these individual flags. - - - - Indicates that the numeric string represents a hexadecimal value. Valid hexadecimal values include the numeric digits 0-9 and the hexadecimal digits A-F and a-f. Strings that are parsed using this style cannot be prefixed with "0x" or "&h". A string that is parsed with the style will always be interpreted as a hexadecimal value. The only flags that can be combined with are and . The enumeration includes a composite style, , that consists of these three flags. - - - - Indicates that the numeric string can have a leading sign. Valid leading sign characters are determined by the and properties. - - - - Indicates that leading white-space characters can be present in the parsed string. Valid white-space characters have the Unicode values U+0009, U+000A, U+000B, U+000C, U+000D, and U+0020. Note that this is a subset of the characters for which the method returns true. - - - - Indicates that the numeric string can have one pair of parentheses enclosing the number. The parentheses indicate that the string to be parsed represents a negative number. - - - - Indicates that the numeric string can have group separators, such as symbols that separate hundreds from thousands. If the value includes the flag and the string to be parsed includes a currency symbol, the valid group separator character is determined by the property, and the number of digits in each group is determined by the property. Otherwise, the valid group separator character is determined by the property, and the number of digits in each group is determined by the property. - - - - Indicates that the numeric string can have a trailing sign. Valid trailing sign characters are determined by the and properties. - - - - Indicates that trailing white-space characters can be present in the parsed string. Valid white-space characters have the Unicode values U+0009, U+000A, U+000B, U+000C, U+000D, and U+0020. Note that this is a subset of the characters for which the method returns true. - - - - Indicates that all styles except are used. This is a composite number style. - - - - Indicates that all styles except and are used. This is a composite number style. - - - - Indicates that the , , , , and styles are used. This is a composite number style. - - - - Indicates that the , , and styles are used. This is a composite number style. - - - - Indicates that the , , and styles are used. This is a composite number style. - - - - Indicates that no style elements, such as leading or trailing white space, thousands separators, or a decimal separator, can be present in the parsed string. The string to be parsed must consist of integral decimal digits only. - - - - Indicates that the , , , , , and styles are used. This is a composite number style. - - - - Represents the Persian calendar. - - - Initializes a new instance of the class. - - - Returns a object that is offset the specified number of months from the specified object. - The to which to add months. - The positive or negative number of months to add. - A object that represents the date yielded by adding the number of months specified by the months parameter to the date specified by the time parameter. - The resulting is outside the supported range. - months is less than -120,000 or greater than 120,000. - - - Returns a object that is offset the specified number of years from the specified object. - The to which to add years. - The positive or negative number of years to add. - The object that results from adding the specified number of years to the specified object. - The resulting is outside the supported range. - years is less than -10,000 or greater than 10,000. - - - Gets a value indicating whether the current calendar is solar-based, lunar-based, or lunisolar-based. - Always returns . - - - Gets the list of eras in a object. - An array of integers that represents the eras in a object. The array consists of a single element having a value of . - - - Returns the day of the month in the specified object. - The to read. - An integer from 1 through 31 that represents the day of the month in the specified object. - The time parameter represents a date less than or greater than . - - - Returns the day of the week in the specified object. - The to read. - A value that represents the day of the week in the specified object. - - - Returns the day of the year in the specified object. - The to read. - An integer from 1 through 366 that represents the day of the year in the specified object. - The time parameter represents a date less than or greater than . - - - Returns the number of days in the specified month of the specified year and era. - An integer from 1 through 9378 that represents the year. - An integer that represents the month, and ranges from 1 through 12 if year is not 9378, or 1 through 10 if year is 9378. - An integer from 0 through 1 that represents the era. - The number of days in the specified month of the specified year and era. - year, month, or era is outside the range supported by this calendar. - - - Returns the number of days in the specified year of the specified era. - An integer from 1 through 9378 that represents the year. - An integer from 0 through 1 that represents the era. - The number of days in the specified year and era. The number of days is 365 in a common year or 366 in a leap year. - year or era is outside the range supported by this calendar. - - - Returns the era in the specified object. - The to read. - Always returns . - The time parameter represents a date less than or greater than . - - - Returns the leap month for a specified year and era. - An integer from 1 through 9378 that represents the year to convert. - An integer from 0 through 1 that represents the era. - The return value is always 0. - year or era is outside the range supported by this calendar. - - - Returns the month in the specified object. - The to read. - An integer from 1 through 12 that represents the month in the specified object. - The time parameter represents a date less than or greater than . - - - Returns the number of months in the specified year of the specified era. - An integer from 1 through 9378 that represents the year. - An integer from 0 through 1 that represents the era. - Returns 10 if the year parameter is 9378; otherwise, always returns 12. - year or era is outside the range supported by this calendar. - - - Returns the year in the specified object. - The to read. - An integer from 1 through 9378 that represents the year in the specified . - The time parameter represents a date less than or greater than . - - - Determines whether the specified date is a leap day. - An integer from 1 through 9378 that represents the year. - An integer that represents the month and ranges from 1 through 12 if year is not 9378, or 1 through 10 if year is 9378. - An integer from 1 through 31 that represents the day. - An integer from 0 through 1 that represents the era. - true if the specified day is a leap day; otherwise, false. - year, month, day, or era is outside the range supported by this calendar. - - - Determines whether the specified month in the specified year and era is a leap month. - An integer from 1 through 9378 that represents the year. - An integer that represents the month and ranges from 1 through 12 if year is not 9378, or 1 through 10 if year is 9378. - An integer from 0 through 1 that represents the era. - Always returns false because the class does not support the notion of a leap month. - year, month, or era is outside the range supported by this calendar. - - - Determines whether the specified year in the specified era is a leap year. - An integer from 1 through 9378 that represents the year. - An integer from 0 through 1 that represents the era. - true if the specified year is a leap year; otherwise, false. - year or era is outside the range supported by this calendar. - - - Gets the latest date and time supported by the class. - The latest date and time supported by the class. - - - Gets the earliest date and time supported by the class. - The earliest date and time supported by the class. - - - Represents the current era. This field is constant. - - - - Returns a object that is set to the specified date, time, and era. - An integer from 1 through 9378 that represents the year. - An integer from 1 through 12 that represents the month. - An integer from 1 through 31 that represents the day. - An integer from 0 through 23 that represents the hour. - An integer from 0 through 59 that represents the minute. - An integer from 0 through 59 that represents the second. - An integer from 0 through 999 that represents the millisecond. - An integer from 0 through 1 that represents the era. - A object that is set to the specified date and time in the current era. - year, month, day, hour, minute, second, millisecond, or era is outside the range supported by this calendar. - - - Converts the specified year to a four-digit year representation. - An integer from 1 through 9378 that represents the year to convert. - An integer that contains the four-digit representation of year. - year is less than 0 or greater than 9378. - - - Gets or sets the last year of a 100-year range that can be represented by a 2-digit year. - The last year of a 100-year range that can be represented by a 2-digit year. - This calendar is read-only. - The value in a set operation is less than 100 or greater than 9378. - - - Contains information about the country/region. - - - Initializes a new instance of the class based on the country/region associated with the specified culture identifier. - A culture identifier. - culture specifies either an invariant, custom, or neutral culture. - - - Initializes a new instance of the class based on the country/region or specific culture, specified by name. - A string that contains a two-letter code defined in ISO 3166 for country/region. -or- A string that contains the culture name for a specific culture, custom culture, or Windows-only culture. If the culture name is not in RFC 4646 format, your application should specify the entire culture name instead of just the country/region. - name is null. - name is not a valid country/region name or specific culture name. - - - Gets the name, in English, of the currency used in the country/region. - The name, in English, of the currency used in the country/region. - - - Gets the name of the currency used in the country/region, formatted in the native language of the country/region. - The native name of the currency used in the country/region, formatted in the language associated with the ISO 3166 country/region code. - - - Gets the currency symbol associated with the country/region. - The currency symbol associated with the country/region. - - - Gets the that represents the country/region used by the current thread. - The that represents the country/region used by the current thread. - - - Gets the full name of the country/region in the language of the localized version of .NET Framework. - The full name of the country/region in the language of the localized version of .NET Framework. - - - Gets the full name of the country/region in English. - The full name of the country/region in English. - - - Determines whether the specified object is the same instance as the current . - The object to compare with the current . - true if the value parameter is a object and its property is the same as the property of the current object; otherwise, false. - - - Gets a unique identification number for a geographical region, country, city, or location. - A 32-bit signed number that uniquely identifies a geographical location. - - - Serves as a hash function for the current , suitable for hashing algorithms and data structures, such as a hash table. - A hash code for the current . - - - Gets a value indicating whether the country/region uses the metric system for measurements. - true if the country/region uses the metric system for measurements; otherwise, false. - - - Gets the three-character ISO 4217 currency symbol associated with the country/region. - The three-character ISO 4217 currency symbol associated with the country/region. - - - Gets the name or ISO 3166 two-letter country/region code for the current object. - The value specified by the name parameter of the constructor. The return value is in uppercase. -or- The two-letter code defined in ISO 3166 for the country/region specified by the culture parameter of the constructor. The return value is in uppercase. - - - Gets the name of a country/region formatted in the native language of the country/region. - The native name of the country/region formatted in the language associated with the ISO 3166 country/region code. - - - Gets the three-letter code defined in ISO 3166 for the country/region. - The three-letter code defined in ISO 3166 for the country/region. - - - Gets the three-letter code assigned by Windows to the country/region represented by this . - The three-letter code assigned by Windows to the country/region represented by this . - - - Returns a string containing the culture name or ISO 3166 two-letter country/region codes specified for the current . - A string containing the culture name or ISO 3166 two-letter country/region codes defined for the current . - - - Gets the two-letter code defined in ISO 3166 for the country/region. - The two-letter code defined in ISO 3166 for the country/region. - - - Represents the result of mapping a string to its sort key. - - - Compares two sort keys. - The first sort key to compare. - The second sort key to compare. -

A signed integer that indicates the relationship between sortkey1 and sortkey2.

-
Value

-

Condition

-

Less than zero

-

sortkey1 is less than sortkey2.

-

Zero

-

sortkey1 is equal to sortkey2.

-

Greater than zero

-

sortkey1 is greater than sortkey2.

-

-
- sortkey1 or sortkey2 is null. -
- - Determines whether the specified object is equal to the current object. - The object to compare with the current object. - true if the value parameter is equal to the current object; otherwise, false. - value is null. - - - Serves as a hash function for the current object that is suitable for hashing algorithms and data structures such as a hash table. - A hash code for the current object. - - - Gets the byte array representing the current object. - A byte array representing the current object. - - - Gets the original string used to create the current object. - The original string used to create the current object. - - - Returns a string that represents the current object. - A string that represents the current object. - - - Provides information about the version of Unicode used to compare and order strings. - - - Creates a new instance of the class. - A version number. - A sort ID. - - - Returns a value that indicates whether this instance is equal to a specified object. - The object to compare with this instance. - true if other represents the same version as this instance; otherwise, false. - - - Returns a value that indicates whether this instance is equal to a specified object. - An object to compare with this instance. - true if obj is a object that represents the same version as this instance; otherwise, false. - - - Gets the full version number of the object. - The version number of this object. - - - Returns a hash code for this instance. - A 32-bit signed integer hash code. - - - Indicates whether two instances are equal. - The first instance to compare. - The second instance to compare. - true if the values of left and right are equal; otherwise, false. - - - Indicates whether two instances are not equal. - The first instance to compare. - The second instance to compare. - true if the values of left and right are not equal; otherwise, false. - - - Gets a globally unique identifier for this object. - A globally unique identifier for this object. - - - Provides functionality to split a string into text elements and to iterate through those text elements. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class to a specified string. - A string to initialize this object. - value is null. - - - Indicates whether the current object is equal to a specified object. - An object. - true if the value parameter is a object and its property equals the property of this object; otherwise, false. - - - Calculates a hash code for the value of the current object. - A 32-bit signed integer hash code based on the string value of this object. - - - Gets the first text element in a specified string. - The string from which to get the text element. - A string containing the first text element in the specified string. - str is null. - - - Gets the text element at the specified index of the specified string. - The string from which to get the text element. - The zero-based index at which the text element starts. - A string containing the text element at the specified index of the specified string. - str is null. - index is outside the range of valid indexes for str. - - - Returns an enumerator that iterates through the text elements of the entire string. - The string to iterate through. - A for the entire string. - str is null. - - - Returns an enumerator that iterates through the text elements of the string, starting at the specified index. - The string to iterate through. - The zero-based index at which to start iterating. - A for the string starting at index. - str is null. - index is outside the range of valid indexes for str. - - - Gets the number of text elements in the current object. - The number of base characters, surrogate pairs, and combining character sequences in this object. - - - Returns the indexes of each base character, high surrogate, or control character within the specified string. - The string to search. - An array of integers that contains the zero-based indexes of each base character, high surrogate, or control character within the specified string. - str is null. - - - Gets or sets the value of the current object. - The string that is the value of the current object. - The value in a set operation is null. - - - Retrieves a substring of text elements from the current object starting from a specified text element and continuing through the last text element. - The zero-based index of a text element in this object. - A substring of text elements in this object, starting from the text element index specified by the startingTextElement parameter and continuing through the last text element in this object. - startingTextElement is less than zero. -or- The string that is the value of the current object is the empty string (""). - - - Retrieves a substring of text elements from the current object starting from a specified text element and continuing through the specified number of text elements. - The zero-based index of a text element in this object. - The number of text elements to retrieve. - A substring of text elements in this object. The substring consists of the number of text elements specified by the lengthInTextElements parameter and starts from the text element index specified by the startingTextElement parameter. - startingTextElement is less than zero. -or- startingTextElement is greater than or equal to the length of the string that is the value of the current object. -or- lengthInTextElements is less than zero. -or- The string that is the value of the current object is the empty string (""). -or- startingTextElement + lengthInTextElements specify an index that is greater than the number of text elements in this object. - - - the Taiwan calendar. - - - Initializes a new instance of the class. - Unable to initialize a object because of missing culture information. - - - Returns a that is the specified number of months away from the specified . - The to which to add months. - The number of months to add. - The that results from adding the specified number of months to the specified . - The resulting is outside the supported range. - months is less than -120000. -or- months is greater than 120000. - - - Returns a that is the specified number of years away from the specified . - The to which to add years. - The number of years to add. - The that results from adding the specified number of years to the specified . - The resulting is outside the supported range. - - - Gets a value that indicates whether the current calendar is solar-based, lunar-based, or a combination of both. - Always returns . - - - Gets the list of eras in the . - An array that consists of a single element for which the value is always the current era. - - - Returns the day of the month in the specified . - The to read. - An integer from 1 to 31 that represents the day of the month in the specified . - - - Returns the day of the week in the specified . - The to read. - A value that represents the day of the week in the specified . - - - Returns the day of the year in the specified . - The to read. - An integer from 1 to 366 that represents the day of the year in the specified . - - - Returns the number of days in the specified month in the specified year in the specified era. - An integer that represents the year. - An integer from 1 to 12 that represents the month. - An integer that represents the era. - The number of days in the specified month in the specified year in the specified era. - year is outside the range supported by the calendar. -or- month is outside the range supported by the calendar. -or- era is outside the range supported by the calendar. - - - Returns the number of days in the specified year in the specified era. - An integer that represents the year. - An integer that represents the era. - The number of days in the specified year in the specified era. - year is outside the range supported by the calendar. -or- era is outside the range supported by the calendar. - - - Returns the era in the specified . - The to read. - An integer that represents the era in the specified . - - - Calculates the leap month for a specified year and era. - A year. - An era. - The return value is always 0 because the class does not support the notion of a leap month. - - - Returns the month in the specified . - The to read. - An integer from 1 to 12 that represents the month in the specified . - - - Returns the number of months in the specified year in the specified era. - An integer that represents the year. - An integer that represents the era. - The number of months in the specified year in the specified era. - year is outside the range supported by the calendar. -or- era is outside the range supported by the calendar. - - - Returns the week of the year that includes the date in the specified . - The to read. - One of the values that defines a calendar week. - One of the values that represents the first day of the week. - A positive integer that represents the week of the year that includes the date in the time parameter. - time or firstDayOfWeek is outside the range supported by the calendar. -or- rule is not a valid value. - - - Returns the year in the specified . - The to read. - An integer that represents the year in the specified . - - - Determines whether the specified date in the specified era is a leap day. - An integer that represents the year. - An integer from 1 to 12 that represents the month. - An integer from 1 to 31 that represents the day. - An integer that represents the era. - true if the specified day is a leap day; otherwise, false. - year is outside the range supported by the calendar. -or- month is outside the range supported by the calendar. -or- day is outside the range supported by the calendar. -or- era is outside the range supported by the calendar. - - - Determines whether the specified month in the specified year in the specified era is a leap month. - An integer that represents the year. - An integer from 1 to 12 that represents the month. - An integer that represents the era. - This method always returns false, unless overridden by a derived class. - year is outside the range supported by the calendar. -or- month is outside the range supported by the calendar. -or- era is outside the range supported by the calendar. - - - Determines whether the specified year in the specified era is a leap year. - An integer that represents the year. - An integer that represents the era. - true if the specified year is a leap year; otherwise, false. - year is outside the range supported by the calendar. -or- era is outside the range supported by the calendar. - - - Gets the latest date and time supported by the class. - The latest date and time supported by the class, which is equivalent to the last moment of December 31, 9999 C.E. in the Gregorian calendar. - - - Gets the earliest date and time supported by the class. - The earliest date and time supported by the class, which is equivalent to the first moment of January 1, 1912 C.E. in the Gregorian calendar. - - - Returns a that is set to the specified date and time in the specified era. - An integer that represents the year. - An integer from 1 to 12 that represents the month. - An integer from 1 to 31 that represents the day. - An integer from 0 to 23 that represents the hour. - An integer from 0 to 59 that represents the minute. - An integer from 0 to 59 that represents the second. - An integer from 0 to 999 that represents the millisecond. - An integer that represents the era. - The that is set to the specified date and time in the current era. - year is outside the range supported by the calendar. -or- month is outside the range supported by the calendar. -or- day is outside the range supported by the calendar. -or- hour is less than zero or greater than 23. -or- minute is less than zero or greater than 59. -or- second is less than zero or greater than 59. -or- millisecond is less than zero or greater than 999. -or- era is outside the range supported by the calendar. - - - Converts the specified year to a four-digit year by using the property to determine the appropriate century. - A two-digit or four-digit integer that represents the year to convert. - An integer that contains the four-digit representation of year. - year is outside the range supported by the calendar. - - - Gets or sets the last year of a 100-year range that can be represented by a 2-digit year. - The last year of a 100-year range that can be represented by a 2-digit year. - The value specified in a set operation is less than 99. -or- The value specified in a set operation is greater than MaxSupportedDateTime.Year. - In a set operation, the current instance is read-only. - - - Represents the Taiwan lunisolar calendar. As for the Taiwan calendar, years are calculated using the Gregorian calendar, while days and months are calculated using the lunisolar calendar. - - - Initializes a new instance of the class. - - - Gets the number of days in the year that precedes the year specified by the property. - The number of days in the year that precedes the year specified by . - - - Gets the eras that are relevant to the current object. - An array that consists of a single element having a value that is always the current era. - - - Retrieves the era that corresponds to the specified . - The to read. - An integer that represents the era specified in the time parameter. - - - Gets the maximum date and time supported by the class. - The latest date and time supported by the class, which is equivalent to the last moment of February 10, 2051 C.E. in the Gregorian calendar. - - - Gets the minimum date and time supported by the class. - The earliest date and time supported by the class, which is equivalent to the first moment of February 18, 1912 C.E. in the Gregorian calendar. - - - Enumerates the text elements of a string. - - - Gets the current text element in the string. - An object containing the current text element in the string. - The enumerator is positioned before the first text element of the string or after the last text element. - - - Gets the index of the text element that the enumerator is currently positioned over. - The index of the text element that the enumerator is currently positioned over. - The enumerator is positioned before the first text element of the string or after the last text element. - - - Gets the current text element in the string. - A new string containing the current text element in the string being read. - The enumerator is positioned before the first text element of the string or after the last text element. - - - Advances the enumerator to the next text element of the string. - true if the enumerator was successfully advanced to the next text element; false if the enumerator has passed the end of the string. - - - Sets the enumerator to its initial position, which is before the first text element in the string. - - - Defines text properties and behaviors, such as casing, that are specific to a writing system. - - - Gets the American National Standards Institute (ANSI) code page used by the writing system represented by the current . - The ANSI code page used by the writing system represented by the current . - - - Creates a new object that is a copy of the current object. - A new instance of that is the memberwise clone of the current object. - - - Gets the name of the culture associated with the current object. - The name of a culture. - - - Gets the Extended Binary Coded Decimal Interchange Code (EBCDIC) code page used by the writing system represented by the current . - The EBCDIC code page used by the writing system represented by the current . - - - Determines whether the specified object represents the same writing system as the current object. - The object to compare with the current . - true if obj represents the same writing system as the current ; otherwise, false. - - - Serves as a hash function for the current , suitable for hashing algorithms and data structures, such as a hash table. - A hash code for the current . - - - Gets a value indicating whether the current object is read-only. - true if the current object is read-only; otherwise, false. - - - Gets a value indicating whether the current object represents a writing system where text flows from right to left. - true if text flows from right to left; otherwise, false. - - - Gets the culture identifier for the culture associated with the current object. - A number that identifies the culture from which the current object was created. - - - Gets or sets the string that separates items in a list. - The string that separates items in a list. - The value in a set operation is null. - In a set operation, the current object is read-only. - - - Gets the Macintosh code page used by the writing system represented by the current . - The Macintosh code page used by the writing system represented by the current . - - - Gets the original equipment manufacturer (OEM) code page used by the writing system represented by the current . - The OEM code page used by the writing system represented by the current . - - - Returns a read-only version of the specified object. - A object. - The object specified by the textInfo parameter, if textInfo is read-only. -or- A read-only memberwise clone of the object specified by textInfo, if textInfo is not read-only. - textInfo is null. - - - Converts the specified character to lowercase. - The character to convert to lowercase. - The specified character converted to lowercase. - - - Converts the specified string to lowercase. - The string to convert to lowercase. - The specified string converted to lowercase. - str is null. - - - Returns a string that represents the current . - A string that represents the current . - - - Converts the specified string to title case (except for words that are entirely in uppercase, which are considered to be acronyms). - The string to convert to title case. - The specified string converted to title case. - str is null. - - - Converts the specified character to uppercase. - The character to convert to uppercase. - The specified character converted to uppercase. - - - Converts the specified string to uppercase. - The string to convert to uppercase. - The specified string converted to uppercase. - str is null. - - - Raises the deserialization event when deserialization is complete. - The source of the deserialization event. - - - Represents the Thai Buddhist calendar. - - - Initializes a new instance of the class. - - - Returns a that is the specified number of months away from the specified . - The to which to add months. - The number of months to add. - The that results from adding the specified number of months to the specified . - The resulting is outside the supported range. - months is less than -120000. -or- months is greater than 120000. - - - Returns a that is the specified number of years away from the specified . - The to which to add years. - The number of years to add. - The that results from adding the specified number of years to the specified . - The resulting is outside the supported range. - - - Gets a value indicating whether the current calendar is solar-based, lunar-based, or a combination of both. - Always returns . - - - Gets the list of eras in the class. - An array that consists of a single element having a value that is always the current era. - - - Returns the day of the month in the specified . - The to read. - An integer from 1 to 31 that represents the day of the month in the specified . - - - Returns the day of the week in the specified . - The to read. - A value that represents the day of the week in the specified . - - - Returns the day of the year in the specified . - The to read. - An integer from 1 to 366 that represents the day of the year in the specified . - - - Returns the number of days in the specified month in the specified year in the specified era. - An integer that represents the year. - An integer from 1 to 12 that represents the month. - An integer that represents the era. - The number of days in the specified month in the specified year in the specified era. - year is outside the range supported by the calendar. -or- month is outside the range supported by the calendar. -or- era is outside the range supported by the calendar. - - - Returns the number of days in the specified year in the specified era. - An integer that represents the year. - An integer that represents the era. - The number of days in the specified year in the specified era. - year is outside the range supported by the calendar. -or- era is outside the range supported by the calendar. - - - Returns the era in the specified . - The to read. - An integer that represents the era in the specified . - - - Calculates the leap month for a specified year and era. - A year. - An era. - The return value is always 0 because the class does not support the notion of a leap month. - - - Returns the month in the specified . - The to read. - An integer from 1 to 12 that represents the month in the specified . - - - Returns the number of months in the specified year in the specified era. - An integer that represents the year. - An integer that represents the era. - The number of months in the specified year in the specified era. - year is outside the range supported by the calendar. -or- era is outside the range supported by the calendar. - - - Returns the week of the year that includes the date in the specified . - The to read. - One of the values that defines a calendar week. - One of the values that represents the first day of the week. - A 1-based positive integer that represents the week of the year that includes the date in the time parameter. - time or firstDayOfWeek is outside the range supported by the calendar. -or- rule is not a valid value. - - - Returns the year in the specified . - The to read. - An integer that represents the year in the specified . - - - Determines whether the specified date in the specified era is a leap day. - An integer that represents the year. - An integer from 1 to 12 that represents the month. - An integer from 1 to 31 that represents the day. - An integer that represents the era. - true if the specified day is a leap day; otherwise, false. - year is outside the range supported by the calendar. -or- month is outside the range supported by the calendar. -or- day is outside the range supported by the calendar. -or- era is outside the range supported by the calendar. - - - Determines whether the specified month in the specified year in the specified era is a leap month. - An integer that represents the year. - An integer from 1 to 12 that represents the month. - An integer that represents the era. - This method always returns false, unless overridden by a derived class. - year is outside the range supported by the calendar. -or- month is outside the range supported by the calendar. -or- era is outside the range supported by the calendar. - - - Determines whether the specified year in the specified era is a leap year. - An integer that represents the year. - An integer that represents the era. - true if the specified year is a leap year; otherwise, false. - year is outside the range supported by the calendar. -or- era is outside the range supported by the calendar. - - - Gets the latest date and time supported by the class. - The latest date and time supported by the class, which is equivalent to the last moment of December 31, 9999 C.E. in the Gregorian calendar. - - - Gets the earliest date and time supported by the class. - The earliest date and time supported by the class, which is equivalent to the first moment of January 1, 0001 C.E. in the Gregorian calendar. - - - Represents the current era. This field is constant. - - - - Returns a that is set to the specified date and time in the specified era. - An integer that represents the year. - An integer from 1 to 12 that represents the month. - An integer from 1 to 31 that represents the day. - An integer from 0 to 23 that represents the hour. - An integer from 0 to 59 that represents the minute. - An integer from 0 to 59 that represents the second. - An integer from 0 to 999 that represents the millisecond. - An integer that represents the era. - The that is set to the specified date and time in the current era. - year is outside the range supported by the calendar. -or- month is outside the range supported by the calendar. -or- day is outside the range supported by the calendar. -or- hour is less than zero or greater than 23. -or- minute is less than zero or greater than 59. -or- second is less than zero or greater than 59. -or- millisecond is less than zero or greater than 999. -or- era is outside the range supported by the calendar. - - - Converts the specified year to a four-digit year by using the property to determine the appropriate century. - A two-digit or four-digit integer that represents the year to convert. - An integer that contains the four-digit representation of year. - year is outside the range supported by the calendar. - - - Gets or sets the last year of a 100-year range that can be represented by a 2-digit year. - The last year of a 100-year range that can be represented by a 2-digit year. - The value specified in a set operation is less than 99. -or- The value specified in a set operation is greater than MaxSupportedDateTime.Year. - In a set operation, the current instance is read-only. - - - Defines the formatting options that customize string parsing for the and methods. - - - Indicates that input is always interpreted as a negative time interval. - - - - Indicates that input is interpreted as a negative time interval only if a negative sign is present. - - - - Represents the Saudi Hijri (Um Al Qura) calendar. - - - Initializes a new instance of the class. - - - Calculates a date that is a specified number of months away from a specified initial date. - The date to which to add months. The class supports only dates from 04/30/1900 00.00.00 (Gregorian date) through 11/16/2077 23:59:59 (Gregorian date). - The positive or negative number of months to add. - The date yielded by adding the number of months specified by the months parameter to the date specified by the time parameter. - The resulting date is outside the range supported by the class. - months is less than -120,000 or greater than 120,000. -or- time is outside the range supported by this calendar. - - - Calculates a date that is a specified number of years away from a specified initial date. - The date to which to add years. The class supports only dates from 04/30/1900 00.00.00 (Gregorian date) through 11/16/2077 23:59:59 (Gregorian date). - The positive or negative number of years to add. - The date yielded by adding the number of years specified by the years parameter to the date specified by the time parameter. - The resulting date is outside the range supported by the class. - years is less than -10,000 or greater than 10,000. -or- time is outside the range supported by this calendar. - - - Gets a value indicating whether the current calendar is solar-based, lunar-based, or a combination of both. - Always returns . - - - Gets the number of days in the year that precedes the year that is specified by the property. - The number of days in the year that precedes the year specified by . - - - Gets a list of the eras that are supported by the current . - An array that consists of a single element having a value that is . - - - Calculates the day of the month on which a specified date occurs. - The date value to read. The class supports only dates from 04/30/1900 00.00.00 (Gregorian date) through 11/16/2077 23:59:59 (Gregorian date). - An integer from 1 through 30 that represents the day of the month specified by the time parameter. - time is outside the range supported by this calendar. - - - Calculates the day of the week on which a specified date occurs. - The date value to read. The class supports only dates from 04/30/1900 00.00.00 (Gregorian date) through 11/16/2077 23:59:59 (Gregorian date). - A value that represents the day of the week specified by the time parameter. - time is outside the range supported by this calendar. - - - Calculates the day of the year on which a specified date occurs. - The date value to read. The class supports only dates from 04/30/1900 00.00.00 (Gregorian date) through 11/16/2077 23:59:59 (Gregorian date). - An integer from 1 through 355 that represents the day of the year specified by the time parameter. - time is outside the range supported by this calendar. - - - Calculates the number of days in the specified month of the specified year and era. - A year. - An integer from 1 through 12 that represents a month. - An era. Specify UmAlQuraCalendar.Eras[UmAlQuraCalendar.CurrentEra] or . - The number of days in the specified month in the specified year and era. The return value is 29 in a common year and 30 in a leap year. - year, month, or era is outside the range supported by the class. - - - Calculates the number of days in the specified year of the specified era. - A year. - An era. Specify UmAlQuraCalendar.Eras[UmAlQuraCalendar.CurrentEra] or . - The number of days in the specified year and era. The number of days is 354 in a common year or 355 in a leap year. - year or era is outside the range supported by the class. - - - Calculates the era in which a specified date occurs. - The date value to read. - Always returns the value. - time is outside the range supported by this calendar. - - - Calculates the leap month for a specified year and era. - A year. - An era. Specify UmAlQuraCalendar.Eras[UmAlQuraCalendar.CurrentEra] or . - Always 0 because the class does not support leap months. - year is less than 1318 or greater than 1450. -or- era is not UmAlQuraCalendar.Eras[UmAlQuraCalendar.CurrentEra] or . - - - Calculates the month in which a specified date occurs. - The date value to read. The class supports only dates from 04/30/1900 00.00.00 (Gregorian date) through 11/16/2077 23:59:59 (Gregorian date). - An integer from 1 through 12 that represents the month in the date specified by the time parameter. - time is outside the range supported by this calendar. - - - Calculates the number of months in the specified year of the specified era. - A year. - An era. Specify UmAlQuaraCalendar.Eras[UmAlQuraCalendar.CurrentEra] or . - Always 12. - year is outside the range supported by this calendar. - era is outside the range supported by this calendar. - - - Calculates the year of a date represented by a specified . - The date value to read. The class supports only dates from 04/30/1900 00.00.00 (Gregorian date) through 11/16/2077 23:59:59 (Gregorian date). - An integer that represents the year specified by the time parameter. - time is outside the range supported by this calendar. - - - Determines whether the specified date is a leap day. - A year. - An integer from 1 through 12 that represents a month. - An integer from 1 through 30 that represents a day. - An era. Specify UmAlQuraCalendar.Eras[UmAlQuraCalendar.CurrentEra] or . - true if the specified day is a leap day; otherwise, false. The return value is always false because the class does not support leap days. - year, month, day, or era is outside the range supported by the class. - - - Determines whether the specified month in the specified year and era is a leap month. - A year. - An integer from 1 through 12 that represents a month. - An era. Specify UmAlQuraCalendar.Eras[UmAlQuraCalendar.CurrentEra] or . - Always false because the class does not support leap months. - year, month, or era is outside the range supported by the class. - - - Determines whether the specified year in the specified era is a leap year. - A year. - An era. Specify UmAlQuraCalendar.Eras[UmAlQuraCalendar.CurrentEra] or . - true if the specified year is a leap year; otherwise, false. - year or era is outside the range supported by the class. - - - Gets the latest date and time supported by this calendar. - The latest date and time supported by the class, which is equivalent to the last moment of November 16, 2077 C.E. in the Gregorian calendar. - - - Gets the earliest date and time supported by this calendar. - The earliest date and time supported by the class, which is equivalent to the first moment of April 30, 1900 C.E. in the Gregorian calendar. - - - Returns a that is set to the specified date, time, and era. - A year. - An integer from 1 through 12 that represents a month. - An integer from 1 through 29 that represents a day. - An integer from 0 through 23 that represents an hour. - An integer from 0 through 59 that represents a minute. - An integer from 0 through 59 that represents a second. - An integer from 0 through 999 that represents a millisecond. - An era. Specify UmAlQuraCalendar.Eras[UmAlQuraCalendar.CurrentEra] or . - The that is set to the specified date and time in the current era. - year, month, day, or era is outside the range supported by the class. -or- hour is less than zero or greater than 23. -or- minute is less than zero or greater than 59. -or- second is less than zero or greater than 59. -or- millisecond is less than zero or greater than 999. - - - Converts the specified year to a four-digit year by using the property to determine the appropriate century. - A 2-digit year from 0 through 99, or a 4-digit Um Al Qura calendar year from 1318 through 1450. - If the year parameter is a 2-digit year, the return value is the corresponding 4-digit year. If the year parameter is a 4-digit year, the return value is the unchanged year parameter. - year is outside the range supported by this calendar. - - - Gets or sets the last year of a 100-year range that can be represented by a 2-digit year. - The last year of a 100-year range that can be represented by a 2-digit year. - This calendar is read-only. - In a set operation, the Um Al Qura calendar year value is less than 1318 but not 99, or is greater than 1450. - - - Represents the current era. This field is constant. - - - - Defines the Unicode category of a character. - - - Closing character of one of the paired punctuation marks, such as parentheses, square brackets, and braces. Signified by the Unicode designation "Pe" (punctuation, close). The value is 21. - - - - Connector punctuation character that connects two characters. Signified by the Unicode designation "Pc" (punctuation, connector). The value is 18. - - - - Control code character, with a Unicode value of U+007F or in the range U+0000 through U+001F or U+0080 through U+009F. Signified by the Unicode designation "Cc" (other, control). The value is 14. - - - - Currency symbol character. Signified by the Unicode designation "Sc" (symbol, currency). The value is 26. - - - - Dash or hyphen character. Signified by the Unicode designation "Pd" (punctuation, dash). The value is 19. - - - - Decimal digit character, that is, a character in the range 0 through 9. Signified by the Unicode designation "Nd" (number, decimal digit). The value is 8. - - - - Enclosing mark character, which is a nonspacing combining character that surrounds all previous characters up to and including a base character. Signified by the Unicode designation "Me" (mark, enclosing). The value is 7. - - - - Closing or final quotation mark character. Signified by the Unicode designation "Pf" (punctuation, final quote). The value is 23. - - - - Format character that affects the layout of text or the operation of text processes, but is not normally rendered. Signified by the Unicode designation "Cf" (other, format). The value is 15. - - - - Opening or initial quotation mark character. Signified by the Unicode designation "Pi" (punctuation, initial quote). The value is 22. - - - - Number represented by a letter, instead of a decimal digit, for example, the Roman numeral for five, which is "V". The indicator is signified by the Unicode designation "Nl" (number, letter). The value is 9. - - - - Character that is used to separate lines of text. Signified by the Unicode designation "Zl" (separator, line). The value is 12. - - - - Lowercase letter. Signified by the Unicode designation "Ll" (letter, lowercase). The value is 1. - - - - Mathematical symbol character, such as "+" or "= ". Signified by the Unicode designation "Sm" (symbol, math). The value is 25. - - - - Modifier letter character, which is free-standing spacing character that indicates modifications of a preceding letter. Signified by the Unicode designation "Lm" (letter, modifier). The value is 3. - - - - Modifier symbol character, which indicates modifications of surrounding characters. For example, the fraction slash indicates that the number to the left is the numerator and the number to the right is the denominator. The indicator is signified by the Unicode designation "Sk" (symbol, modifier). The value is 27. - - - - Nonspacing character that indicates modifications of a base character. Signified by the Unicode designation "Mn" (mark, nonspacing). The value is 5. - - - - Opening character of one of the paired punctuation marks, such as parentheses, square brackets, and braces. Signified by the Unicode designation "Ps" (punctuation, open). The value is 20. - - - - Letter that is not an uppercase letter, a lowercase letter, a titlecase letter, or a modifier letter. Signified by the Unicode designation "Lo" (letter, other). The value is 4. - - - - Character that is not assigned to any Unicode category. Signified by the Unicode designation "Cn" (other, not assigned). The value is 29. - - - - Number that is neither a decimal digit nor a letter number, for example, the fraction 1/2. The indicator is signified by the Unicode designation "No" (number, other). The value is 10. - - - - Punctuation character that is not a connector, a dash, open punctuation, close punctuation, an initial quote, or a final quote. Signified by the Unicode designation "Po" (punctuation, other). The value is 24. - - - - Symbol character that is not a mathematical symbol, a currency symbol or a modifier symbol. Signified by the Unicode designation "So" (symbol, other). The value is 28. - - - - Character used to separate paragraphs. Signified by the Unicode designation "Zp" (separator, paragraph). The value is 13. - - - - Private-use character, with a Unicode value in the range U+E000 through U+F8FF. Signified by the Unicode designation "Co" (other, private use). The value is 17. - - - - Space character, which has no glyph but is not a control or format character. Signified by the Unicode designation "Zs" (separator, space). The value is 11. - - - - Spacing character that indicates modifications of a base character and affects the width of the glyph for that base character. Signified by the Unicode designation "Mc" (mark, spacing combining). The value is 6. - - - - High surrogate or a low surrogate character. Surrogate code values are in the range U+D800 through U+DFFF. Signified by the Unicode designation "Cs" (other, surrogate). The value is 16. - - - - Titlecase letter. Signified by the Unicode designation "Lt" (letter, titlecase). The value is 2. - - - - Uppercase letter. Signified by the Unicode designation "Lu" (letter, uppercase). The value is 0. - - - - A customizable parser based on the Gopher scheme. - - - Creates a customizable parser based on the Gopher scheme. - - - Represents a globally unique identifier (GUID). - - - Initializes a new instance of the structure by using the specified array of bytes. - A 16-element byte array containing values with which to initialize the GUID. - b is null. - b is not 16 bytes long. - - - Initializes a new instance of the structure by using the value represented by the specified string. - A string that contains a GUID in one of the following formats ("d" represents a hexadecimal digit whose case is ignored): 32 contiguous digits: dddddddddddddddddddddddddddddddd -or- Groups of 8, 4, 4, 4, and 12 digits with hyphens between the groups. The entire GUID can optionally be enclosed in matching braces or parentheses: dddddddd-dddd-dddd-dddd-dddddddddddd -or- {dddddddd-dddd-dddd-dddd-dddddddddddd} -or- (dddddddd-dddd-dddd-dddd-dddddddddddd) -or- Groups of 8, 4, and 4 digits, and a subset of eight groups of 2 digits, with each group prefixed by "0x" or "0X", and separated by commas. The entire GUID, as well as the subset, is enclosed in matching braces: {0xdddddddd, 0xdddd, 0xdddd,{0xdd,0xdd,0xdd,0xdd,0xdd,0xdd,0xdd,0xdd}} All braces, commas, and "0x" prefixes are required. All embedded spaces are ignored. All leading zeros in a group are ignored. The digits shown in a group are the maximum number of meaningful digits that can appear in that group. You can specify from 1 to the number of digits shown for a group. The specified digits are assumed to be the low-order digits of the group. - g is null. - The format of g is invalid. - The format of g is invalid. - - - Initializes a new instance of the structure by using the specified integers and byte array. - The first 4 bytes of the GUID. - The next 2 bytes of the GUID. - The next 2 bytes of the GUID. - The remaining 8 bytes of the GUID. - d is null. - d is not 8 bytes long. - - - Initializes a new instance of the structure by using the specified integers and bytes. - The first 4 bytes of the GUID. - The next 2 bytes of the GUID. - The next 2 bytes of the GUID. - The next byte of the GUID. - The next byte of the GUID. - The next byte of the GUID. - The next byte of the GUID. - The next byte of the GUID. - The next byte of the GUID. - The next byte of the GUID. - The next byte of the GUID. - - - Initializes a new instance of the structure by using the specified unsigned integers and bytes. - The first 4 bytes of the GUID. - The next 2 bytes of the GUID. - The next 2 bytes of the GUID. - The next byte of the GUID. - The next byte of the GUID. - The next byte of the GUID. - The next byte of the GUID. - The next byte of the GUID. - The next byte of the GUID. - The next byte of the GUID. - The next byte of the GUID. - - - Compares this instance to a specified object and returns an indication of their relative values. - An object to compare to this instance. -

A signed number indicating the relative values of this instance and value.

-
Return value

-

Description

-

A negative integer

-

This instance is less than value.

-

Zero

-

This instance is equal to value.

-

A positive integer

-

This instance is greater than value.

-

-
-
- - Compares this instance to a specified object and returns an indication of their relative values. - An object to compare, or null. -

A signed number indicating the relative values of this instance and value.

-
Return value

-

Description

-

A negative integer

-

This instance is less than value.

-

Zero

-

This instance is equal to value.

-

A positive integer

-

This instance is greater than value, or value is null.

-

-
- value is not a . -
- - A read-only instance of the structure whose value is all zeros. - - - - Returns a value indicating whether this instance and a specified object represent the same value. - An object to compare to this instance. - true if g is equal to this instance; otherwise, false. - - - Returns a value that indicates whether this instance is equal to a specified object. - The object to compare with this instance. - true if o is a that has the same value as this instance; otherwise, false. - - - Returns the hash code for this instance. - The hash code for this instance. - - - Initializes a new instance of the structure. - A new GUID object. - - - Indicates whether the values of two specified objects are equal. - The first object to compare. - The second object to compare. - true if a and b are equal; otherwise, false. - - - Indicates whether the values of two specified objects are not equal. - The first object to compare. - The second object to compare. - true if a and b are not equal; otherwise, false. - - - Converts the string representation of a GUID to the equivalent structure. - The string to convert. - A structure that contains the value that was parsed. - input is null. - input is not in a recognized format. - - - Converts the string representation of a GUID to the equivalent structure, provided that the string is in the specified format. - The GUID to convert. - One of the following specifiers that indicates the exact format to use when interpreting input: "N", "D", "B", "P", or "X". - A structure that contains the value that was parsed. - input or format is null. - input is not in the format specified by format. - - - Returns a 16-element byte array that contains the value of this instance. - A 16-element byte array. - - - Returns a string representation of the value of this instance in registry format. - The value of this , formatted by using the "D" format specifier as follows: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx where the value of the GUID is represented as a series of lowercase hexadecimal digits in groups of 8, 4, 4, 4, and 12 digits and separated by hyphens. An example of a return value is "382c74c3-721d-4f34-80e5-57657b6cbc27". To convert the hexadecimal digits from a through f to uppercase, call the method on the returned string. - - - Returns a string representation of the value of this instance, according to the provided format specifier. - A single format specifier that indicates how to format the value of this . The format parameter can be "N", "D", "B", "P", or "X". If format is null or an empty string (""), "D" is used. - The value of this , represented as a series of lowercase hexadecimal digits in the specified format. - The value of format is not null, an empty string (""), "N", "D", "B", "P", or "X". - - - Returns a string representation of the value of this instance of the class, according to the provided format specifier and culture-specific format information. - A single format specifier that indicates how to format the value of this . The format parameter can be "N", "D", "B", "P", or "X". If format is null or an empty string (""), "D" is used. - (Reserved) An object that supplies culture-specific formatting information. - The value of this , represented as a series of lowercase hexadecimal digits in the specified format. - The value of format is not null, an empty string (""), "N", "D", "B", "P", or "X". - - - Converts the string representation of a GUID to the equivalent structure. - The GUID to convert. - The structure that will contain the parsed value. If the method returns true, result contains a valid . If the method returns false, result equals . - true if the parse operation was successful; otherwise, false. - - - Converts the string representation of a GUID to the equivalent structure, provided that the string is in the specified format. - The GUID to convert. - One of the following specifiers that indicates the exact format to use when interpreting input: "N", "D", "B", "P", or "X". - The structure that will contain the parsed value. If the method returns true, result contains a valid . If the method returns false, result equals . - true if the parse operation was successful; otherwise, false. - - - A customizable parser based on the HTTP scheme. - - - Create a customizable parser based on the HTTP scheme. - - - Represents the status of an asynchronous operation. - - - Gets a user-defined object that qualifies or contains information about an asynchronous operation. - A user-defined object that qualifies or contains information about an asynchronous operation. - - - Gets a that is used to wait for an asynchronous operation to complete. - A that is used to wait for an asynchronous operation to complete. - - - Gets a value that indicates whether the asynchronous operation completed synchronously. - true if the asynchronous operation completed synchronously; otherwise, false. - - - Gets a value that indicates whether the asynchronous operation has completed. - true if the operation is complete; otherwise, false. - - - Supports cloning, which creates a new instance of a class with the same value as an existing instance. - - - Creates a new object that is a copy of the current instance. - A new object that is a copy of this instance. - - - Defines a generalized comparison method that a value type or class implements to create a type-specific comparison method for ordering or sorting its instances. - The type of object to compare. - - - Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object. - An object to compare with this instance. -

A value that indicates the relative order of the objects being compared. The return value has these meanings:

-
Value

-

Meaning

-

Less than zero

-

This instance precedes other in the sort order.

-

Zero

-

This instance occurs in the same position in the sort order as other.

-

Greater than zero

-

This instance follows other in the sort order.

-

-
-
- - The exception that is thrown when there is an invalid attempt to access a method, such as accessing a private method from partially trusted code. - - - Initializes a new instance of the class, setting the property of the new instance to a system-supplied message that describes the error, such as "Attempt to access the method failed." This message takes into account the current system culture. - - - Initializes a new instance of the class with a specified error message. - A that describes the error. - - - Initializes a new instance of the class with serialized data. - The object that holds the serialized object data. - The contextual information about the source or destination. - - - Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. - The error message that explains the reason for the exception. - The exception that is the cause of the current exception. If the inner parameter is not a null reference (Nothing in Visual Basic), the current exception is raised in a catch block that handles the inner exception. - - - Specifies how mathematical rounding methods should process a number that is midway between two numbers. - - - When a number is halfway between two others, it is rounded toward the nearest number that is away from zero. - - - - When a number is halfway between two others, it is rounded toward the nearest even number. - - - - The exception that is thrown when there is an attempt to dynamically access a field that does not exist. If a field in a class library has been removed or renamed, recompile any assemblies that reference that library. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with a specified error message. - A that describes the error. - - - Initializes a new instance of the class with serialized data. - The object that holds the serialized object data. - The contextual information about the source or destination. - - - Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. - The error message that explains the reason for the exception. - The exception that is the cause of the current exception. If the inner parameter is not a null reference (Nothing in Visual Basic), the current exception is raised in a catch block that handles the inner exception. - - - Initializes a new instance of the class with the specified class name and field name. - The name of the class in which access to a nonexistent field was attempted. - The name of the field that cannot be accessed. - - - Gets the text string showing the signature of the missing field, the class name, and the field name. This property is read-only. - The error message string. - - - The exception that is thrown when there is an attempt to dynamically access a class member that does not exist or that is not declared as public. If a member in a class library has been removed or renamed, recompile any assemblies that reference that library. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with a specified error message. - The message that describes the error. - - - Initializes a new instance of the class with serialized data. - The object that holds the serialized object data. - The contextual information about the source or destination. - - - Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the root cause of this exception. - The error message that explains the reason for the exception. - An instance of that is the cause of the current Exception. If inner is not a null reference (Nothing in Visual Basic), then the current Exception is raised in a catch block handling inner. - - - Initializes a new instance of the class with the specified class name and member name. - The name of the class in which access to a nonexistent member was attempted. - The name of the member that cannot be accessed. - - - Holds the class name of the missing member. - - - - Sets the object with the class name, the member name, the signature of the missing member, and additional exception information. - The object that holds the serialized object data. - The contextual information about the source or destination. - The info object is null. - - - Holds the name of the missing member. - - - - Gets the text string showing the class name, the member name, and the signature of the missing member. - The error message string. - - - Holds the signature of the missing member. - - - - The exception that is thrown when there is an attempt to dynamically access a method that does not exist. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with a specified error message. - A that describes the error. - - - Initializes a new instance of the class with serialized data. - The object that holds the serialized object data. - The contextual information about the source or destination. - - - Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. - The error message that explains the reason for the exception. - The exception that is the cause of the current exception. If the inner parameter is not a null reference (Nothing in Visual Basic), the current exception is raised in a catch block that handles the inner exception. - - - Initializes a new instance of the class with the specified class name and method name. - The name of the class in which access to a nonexistent method was attempted. - The name of the method that cannot be accessed. - - - Gets the text string showing the class name, the method name, and the signature of the missing method. This property is read-only. - The error message string. - - - Represents a runtime handle for a module. - - - Represents an empty module handle. - - - - Returns a value indicating whether the specified structure is equal to the current . - The structure to be compared with the current . - true if handle is equal to the current structure; otherwise false. - - - Returns a value indicating whether the specified object is a structure, and equal to the current . - The object to be compared with the current structure. - true if obj is a structure, and is equal to the current structure; otherwise, false. - - - Returns the hash code for this instance. - A 32-bit signed integer that is the hash code for this instance. - - - Returns a runtime handle for the field identified by the specified metadata token. - A metadata token that identifies a field in the module. - A for the field identified by fieldToken. - - - Returns a runtime method handle for the method or constructor identified by the specified metadata token. - A metadata token that identifies a method or constructor in the module. - A for the method or constructor identified by methodToken. - - - Returns a runtime type handle for the type identified by the specified metadata token. - A metadata token that identifies a type in the module. - A for the type identified by typeToken. - - - Gets the metadata stream version. - A 32-bit integer representing the metadata stream version. The high-order two bytes represent the major version number, and the low-order two bytes represent the minor version number. - - - Tests whether two structures are equal. - The structure to the left of the equality operator. - The structure to the right of the equality operator. - true if the structures are equal; otherwise, false. - - - Tests whether two structures are unequal. - The structure to the left of the inequality operator. - The structure to the right of the inequality operator. - true if the structures are unequal; otherwise, false. - - - Returns a runtime handle for the field identified by the specified metadata token. - A metadata token that identifies a field in the module. - A for the field identified by fieldToken. - metadataToken is not a valid token in the scope of the current module. -or- metadataToken is not a token for a field in the scope of the current module. -or- metadataToken identifies a field whose parent TypeSpec has a signature containing element type var or mvar. - The method is called on an empty field handle. - - - Returns a runtime field handle for the field identified by the specified metadata token, specifying the generic type arguments of the type and method where the token is in scope. - A metadata token that identifies a field in the module. - An array of structures representing the generic type arguments of the type where the token is in scope, or null if that type is not generic. - An array of structures representing the generic type arguments of the method where the token is in scope, or null if that method is not generic. - A for the field identified by fieldToken. - metadataToken is not a valid token in the scope of the current module. -or- metadataToken is not a token for a field in the scope of the current module. -or- metadataToken identifies a field whose parent TypeSpec has a signature containing element type var or mvar. - The method is called on an empty field handle. - fieldToken is not a valid token. - - - Returns a runtime method handle for the method or constructor identified by the specified metadata token. - A metadata token that identifies a method or constructor in the module. - A for the method or constructor identified by methodToken. - methodToken is not a valid metadata token for a method in the current module. -or- metadataToken is not a token for a method or constructor in the scope of the current module. -or- metadataToken is a MethodSpec whose signature contains element type var or mvar. - The method is called on an empty method handle. - - - Returns a runtime method handle for the method or constructor identified by the specified metadata token, specifying the generic type arguments of the type and method where the token is in scope. - A metadata token that identifies a method or constructor in the module. - An array of structures representing the generic type arguments of the type where the token is in scope, or null if that type is not generic. - An array of structures representing the generic type arguments of the method where the token is in scope, or null if that method is not generic. - A for the method or constructor identified by methodToken. - methodToken is not a valid metadata token for a method in the current module. -or- metadataToken is not a token for a method or constructor in the scope of the current module. -or- metadataToken is a MethodSpec whose signature contains element type var or mvar. - The method is called on an empty method handle. - methodToken is not a valid token. - - - Returns a runtime type handle for the type identified by the specified metadata token. - A metadata token that identifies a type in the module. - A for the type identified by typeToken. - typeToken is not a valid metadata token for a type in the current module. -or- metadataToken is not a token for a type in the scope of the current module. -or- metadataToken is a TypeSpec whose signature contains element type var or mvar. - The method is called on an empty type handle. - - - Returns a runtime type handle for the type identified by the specified metadata token, specifying the generic type arguments of the type and method where the token is in scope. - A metadata token that identifies a type in the module. - An array of structures representing the generic type arguments of the type where the token is in scope, or null if that type is not generic. - An array of structures objects representing the generic type arguments of the method where the token is in scope, or null if that method is not generic. - A for the type identified by typeToken. - typeToken is not a valid metadata token for a type in the current module. -or- metadataToken is not a token for a type in the scope of the current module. -or- metadataToken is a TypeSpec whose signature contains element type var or mvar. - The method is called on an empty type handle. - typeToken is not a valid token. - - - Indicates that the COM threading model for an application is multithreaded apartment (MTA). - - - Initializes a new instance of the class. - - - Represents a multicast delegate; that is, a delegate that can have more than one element in its invocation list. - - - Initializes a new instance of the class. - The object on which method is defined. - The name of the method for which a delegate is created. - Cannot create an instance of an abstract class, or this member was invoked with a late-binding mechanism. - - - Initializes a new instance of the class. - The type of object on which method is defined. - The name of the static method for which a delegate is created. - Cannot create an instance of an abstract class, or this member was invoked with a late-binding mechanism. - - - Combines this with the specified to form a new delegate. - The delegate to combine with this delegate. - A delegate that is the new root of the invocation list. - follow does not have the same type as this instance. - Cannot create an instance of an abstract class, or this member was invoked with a late-binding mechanism. - - - Determines whether this multicast delegate and the specified object are equal. - The object to compare with this instance. - true if obj and this instance have the same invocation lists; otherwise, false. - Cannot create an instance of an abstract class, or this member was invoked with a late-binding mechanism. - - - Returns the hash code for this instance. - A 32-bit signed integer hash code. - Cannot create an instance of an abstract class, or this member was invoked with a late-binding mechanism. - - - Returns the invocation list of this multicast delegate, in invocation order. - An array of delegates whose invocation lists collectively match the invocation list of this instance. - Cannot create an instance of an abstract class, or this member was invoked with a late-binding mechanism. - - - Returns a static method represented by the current . - A static method represented by the current . - - - Populates a object with all the data needed to serialize this instance. - An object that holds all the data needed to serialize or deserialize this instance. - (Reserved) The location where serialized data is stored and retrieved. - info is null. - Cannot create an instance of an abstract class, or this member was invoked with a late-binding mechanism. - A serialization error occurred. - - - Determines whether two objects are equal. - The left operand. - The right operand. - true if d1 and d2 have the same invocation lists; otherwise, false. - Cannot create an instance of an abstract class, or this member was invoked with a late-binding mechanism. - - - Determines whether two objects are not equal. - The left operand. - The right operand. - true if d1 and d2 do not have the same invocation lists; otherwise, false. - Cannot create an instance of an abstract class, or this member was invoked with a late-binding mechanism. - - - Removes an element from the invocation list of this that is equal to the specified delegate. - The delegate to search for in the invocation list. - If value is found in the invocation list for this instance, then a new without value in its invocation list; otherwise, this instance with its original invocation list. - Cannot create an instance of an abstract class, or this member was invoked with a late-binding mechanism. - - - The exception that is thrown when there is an attempt to combine two delegates based on the type instead of the type. This class cannot be inherited. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with a specified error message. - The message that describes the error. - - - Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. - The error message that explains the reason for the exception. - The exception that is the cause of the current exception. If the inner parameter is not a null reference (Nothing in Visual Basic), the current exception is raised in a catch block that handles the inner exception. - - - Manages the authentication modules called during the client authentication process. - - - Calls each registered authentication module to find the first module that can respond to the authentication request. - The challenge returned by the Internet resource. - The that initiated the authentication challenge. - The associated with this request. - An instance of the class containing the result of the authorization attempt. If there is no authentication module to respond to the challenge, this method returns null. - challenge is null. -or- request is null. -or- credentials is null. - - - Gets or sets the credential policy to be used for resource requests made using the class. - An object that implements the interface that determines whether credentials are sent with requests. The default value is null. - - - Gets the dictionary that contains Service Principal Names (SPNs) that are used to identify hosts during Kerberos authentication for requests made using and its derived classes. - A writable that contains the SPN values for keys composed of host information. - - - Preauthenticates a request. - A to an Internet resource. - The associated with the request. - An instance of the class if the request can be preauthenticated; otherwise, null. If credentials is null, this method returns null. - request is null. - - - Registers an authentication module with the authentication manager. - The to register with the authentication manager. - authenticationModule is null. - - - Gets a list of authentication modules that are registered with the authentication manager. - An that enables the registered authentication modules to be read. - - - Removes the specified authentication module from the list of registered modules. - The to remove from the list of registered modules. - authenticationModule is null. - The specified is not registered. - - - Removes authentication modules with the specified authentication scheme from the list of registered modules. - The authentication scheme of the module to remove. - authenticationScheme is null. - A module for this authentication scheme is not registered. - - - Specifies protocols for authentication. - - - Specifies anonymous authentication. - - - - Specifies basic authentication. - - - - Specifies digest authentication. - - - - Specifies Windows authentication. - - - - Negotiates with the client to determine the authentication scheme. If both client and server support Kerberos, it is used; otherwise, NTLM is used. - - - - No authentication is allowed. A client requesting an object with this flag set will always receive a 403 Forbidden status. Use this flag when a resource should never be served to a client. - - - - Specifies NTLM authentication. - - - - Selects the authentication scheme for an instance. - The instance for which to select an authentication scheme. - - - - Contains an authentication message for an Internet server. - - - Creates a new instance of the class with the specified authorization message. - The encrypted authorization message expected by the server. - - - Creates a new instance of the class with the specified authorization message and completion status. - The encrypted authorization message expected by the server. - The completion status of the authorization attempt. true if the authorization attempt is complete; otherwise, false. - - - Creates a new instance of the class with the specified authorization message, completion status, and connection group identifier. - The encrypted authorization message expected by the server. - The completion status of the authorization attempt. true if the authorization attempt is complete; otherwise, false. - A unique identifier that can be used to create private client-server connections that are bound only to this authentication scheme. - - - Gets the completion status of the authorization. - true if the authentication process is complete; otherwise, false. - - - Gets a unique identifier for user-specific connections. - A unique string that associates a connection with an authenticating entity. - - - Gets the message returned to the server in response to an authentication challenge. - The message that will be returned to the server in response to an authentication challenge. - - - Gets or sets a value that indicates whether mutual authentication occurred. - true if both client and server were authenticated; otherwise, false. - - - Gets or sets the prefix for Uniform Resource Identifiers (URIs) that can be authenticated with the property. - An array of strings that contains URI prefixes. - - - Represents the method that specifies a local Internet Protocol address and port number for a . - The associated with the connection to be created. - The remote that specifies the remote host. - The number of times this delegate was called for a specified connection. - - - - Specifies the method to call when you register an assembly for use from COM; this enables the execution of user-written code during the registration process. - - - Initializes a new instance of the class. - - - Identifies a list of interfaces that are exposed as COM event sources for the attributed class. - - - Initializes a new instance of the class with the name of the event source interface. - A null-delimited list of fully qualified event source interface names. - - - Initializes a new instance of the class with the type to use as a source interface. - The of the source interface. - - - Initializes a new instance of the class with the types to use as source interfaces. - The of the default source interface. - The of a source interface. - - - Initializes a new instance of the ComSourceInterfacesAttribute class with the types to use as source interfaces. - The of the default source interface. - The of a source interface. - The of a source interface. - - - Initializes a new instance of the class with the types to use as source interfaces. - The of the default source interface. - The of a source interface. - The of a source interface. - The of a source interface. - - - Gets the fully qualified name of the event source interface. - The fully qualified name of the event source interface. - - - Specifies the requested behavior when setting up an advise sink or a caching connection with an object. - - - For data advisory connections, assures accessibility to data. - - - - For data advisory connections ( or ), this flag requests the data object not to send data when it calls . - - - - Requests that the object make only one change notification or cache update before deleting the connection. - - - - Requests that the object not wait for the data or view to change before making an initial call to (for data or view advisory connections) or updating the cache (for cache connections). - - - - This value is used by DLL object applications and object handlers that perform the drawing of their objects. - - - - Synonym for , which is used more often. - - - - For cache connections, this flag updates the cached representation only when the object containing the cache is saved. - - - - Contains a pointer to a bound-to structure, structure, or an ITypeComp interface. - - - Represents a pointer to a structure. - - - - Represents a pointer to an interface. - - - - Represents a pointer to a structure. - - - - Stores the parameters that are used during a moniker binding operation. - - - Specifies the size, in bytes, of the BIND_OPTS structure. - - - - Indicates the amount of time (clock time in milliseconds, as returned by the GetTickCount function) that the caller specified to complete the binding operation. - - - - Controls aspects of moniker binding operations. - - - - Represents flags that should be used when opening the file that contains the object identified by the moniker. - - - - Identifies the calling convention used by a method described in a METHODDATA structure. - - - Indicates that the C declaration (CDECL) calling convention is used for a method. - - - - Indicates that the Macintosh Pascal (MACPASCAL) calling convention is used for a method. - - - - Indicates the end of the enumeration. - - - - Indicates that the Macintosh Programmers' Workbench (MPW) CDECL calling convention is used for a method. - - - - Indicates that the Macintosh Programmers' Workbench (MPW) PASCAL calling convention is used for a method. - - - - Indicates that the MSC Pascal (MSCPASCAL) calling convention is used for a method. - - - - Indicates that the Pascal calling convention is used for a method. - - - - This value is reserved for future use. - - - - Indicates that the standard calling convention (STDCALL) is used for a method. - - - - Indicates that the standard SYSCALL calling convention is used for a method. - - - - Describes a connection that exists to a given connection point. - - - Represents a connection token that is returned from a call to . - - - - Represents a pointer to the IUnknown interface on a connected advisory sink. The caller must call IUnknown::Release on this pointer when the CONNECTDATA structure is no longer needed. - - - - Specifies the direction of the data flow in the dwDirection parameter of the method. This determines the formats that the resulting enumerator can enumerate. - - - Requests that supply an enumerator for the formats that can be specified in . - - - - Requests that supply an enumerator for the formats that can be specified in . - - - - Identifies the type description being bound to. - - - Indicates that a structure was returned. - - - - Indicates that an IMPLICITAPPOBJ was returned. - - - - Indicates an end-of-enumeration marker. - - - - Indicates that no match was found. - - - - Indicates that a TYPECOMP was returned. - - - - Indicates that a VARDESC was returned. - - - - Contains the arguments passed to a method or property by IDispatch::Invoke. - - - Represents the count of arguments. - - - - Represents the count of named arguments - - - - Represents the dispatch IDs of named arguments. - - - - Represents a reference to the array of arguments. - - - - Specifies the desired data or view aspect of the object when drawing or getting data. - - - A representation of an object that lets that object be displayed as an embedded object inside a container. This value is typically specified for compound document objects. The presentation can be provided for the screen or printer. - - - - A representation of an object on the screen as though it were printed to a printer using the Print command from the File menu. The described data may represent a sequence of pages. - - - - An iconic representation of an object. - - - - A thumbnail representation of an object that lets that object be displayed in a browsing tool. The thumbnail is approximately a 120 by 120 pixel, 16-color (recommended), device-independent bitmap potentially wrapped in a metafile. - - - - Contains information about an element. - - - Contains information for remoting the element. - - - - Contains information about the parameter. - - - - Contains the type description and process transfer information for a variable, function, or a function parameter. - - - Contains information about an element. - - - - Identifies the type of the element. - - - - Describes the exceptions that occur during IDispatch::Invoke. - - - Describes the error intended for the customer. - - - - Contains the fully-qualified drive, path, and file name of a Help file that contains more information about the error. - - - - Indicates the name of the source of the exception. Typically, this is an application name. - - - - Indicates the Help context ID of the topic within the Help file. - - - - Represents a pointer to a function that takes an structure as an argument and returns an HRESULT value. If deferred fill-in is not desired, this field is set to null. - - - - This field is reserved; it must be set to null. - - - - A return value describing the error. - - - - Represents an error code identifying the error. - - - - This field is reserved; it must be set to 0. - - - - Represents the number of 100-nanosecond intervals since January 1, 1601. This structure is a 64-bit value. - - - Specifies the high 32 bits of the FILETIME. - - - - Specifies the low 32 bits of the FILETIME. - - - - Represents a generalized Clipboard format. - - - Specifies the particular clipboard format of interest. - - - - Specifies one of the enumeration constants that indicates how much detail should be contained in the rendering. - - - - Specifies part of the aspect when the data must be split across page boundaries. - - - - Specifies a pointer to a DVTARGETDEVICE structure containing information about the target device that the data is being composed for. - - - - Specifies one of the enumeration constants, which indicates the type of storage medium used to transfer the object's data. - - - - Defines a function description. - - - Specifies the calling convention of a function. - - - - Counts the total number of parameters. - - - - Counts the optional parameters. - - - - Counts the permitted return values. - - - - Contains the return type of the function. - - - - Specifies whether the function is virtual, static, or dispatch-only. - - - - Specifies the type of a property function. - - - - Indicates the size of . - - - - Stores the count of errors a function can return on a 16-bit system. - - - - Identifies the function member ID. - - - - Specifies the offset in the VTBL for . - - - - Indicates the of a function. - - - - Identifies the constants that define the properties of a function. - - - The function that supports data binding. - - - - The function that best represents the object. Only one function in a type can have this attribute. - - - - Permits an optimization in which the compiler looks for a member named "xyz" on the type of "abc". If such a member is found, and is flagged as an accessor function for an element of the default collection, a call is generated to that member function. Permitted on members in dispinterfaces and interfaces; not permitted on modules. - - - - The function that is displayed to the user as bindable. must also be set. - - - - The function should not be displayed to the user, although it exists and is bindable. - - - - Mapped as individual bindable properties. - - - - The property appears in an object browser, but not in a properties browser. - - - - Tags the interface as having default behaviors. - - - - When set, any call to a method that sets the property results first in a call to IPropertyNotifySink::OnRequestEdit. The implementation of OnRequestEdit determines if the call is allowed to set the property. - - - - The function should not be accessible from macro languages. This flag is intended for system-level functions or functions that type browsers should not display. - - - - The function returns an object that is a source of events. - - - - The type information member is the default member for display in the user interface. - - - - The function supports GetLastError. If an error occurs during the function, the caller can call GetLastError to retrieve the error code. - - - - Defines how to access a function. - - - The function can be accessed only through IDispatch. - - - - The function is accessed by static address and takes an implicit this pointer. - - - - The function is accessed through the virtual function table (VTBL), and takes an implicit this pointer. - - - - The function is accessed by static address and does not take an implicit this pointer. - - - - The function is accessed in the same way as , except the function has an implementation. - - - - Provides a managed definition of the IAdviseSink interface. - - - Notifies all registered advisory sinks that the object has changed from the running state to the loaded state. This method is called by a server. - - - Notifies all data objects currently registered advisory sinks that data in the object has changed. - A , passed by reference, which describes the format, target device, rendering, and storage information of the calling data object. - A , passed by reference, which defines the storage medium (global memory, disk file, storage object, stream object, Graphics Device Interface (GDI) object, or undefined) and ownership of that medium for the calling data object. - - - Notifies all registered advisory sinks that the object has been renamed. This method is called by a server. - A pointer to the IMoniker interface on the new full moniker of the object. - - - Notifies all registered advisory sinks that the object has been saved. This method is called by a server. - - - Notifies an object's registered advisory sinks that its view has changed. This method is called by a server. - The aspect, or view, of the object. Contains a value taken from the enumeration. - The portion of the view that has changed. Currently, only -1 is valid. - - - Provides the managed definition of the IBindCtx interface. - - - Enumerates the strings that are the keys of the internally maintained table of contextual object parameters. - When this method returns, contains a reference to the object parameter enumerator. This parameter is passed uninitialized. - - - Returns the current binding options stored in the current bind context. - A pointer to the structure to receive the binding options. - - - Looks up the given key in the internally maintained table of contextual object parameters and returns the corresponding object, if one exists. - The name of the object to search for. - When this method returns, contains the object interface pointer. This parameter is passed uninitialized. - - - Returns access to the Running Object Table (ROT) relevant to this binding process. - When this method returns, contains a reference to the Running Object Table (ROT). This parameter is passed uninitialized. - - - Registers the passed object as one of the objects that has been bound during a moniker operation and that should be released when the operation is complete. - The object to register for release. - - - Registers the specified object pointer under the specified name in the internally maintained table of object pointers. - The name to register punk with. - The object to register. - - - Releases all the objects currently registered with the bind context by using the method. - - - Removes the object from the set of registered objects that need to be released. - The object to unregister for release. - - - Revokes the registration of the object currently found under the specified key in the internally maintained table of contextual object parameters, if that key is currently registered. - The key to unregister. - An S_OK``HRESULT value if the specified key was successfully removed from the table; otherwise, an S_FALSE``HRESULT value. - - - Stores a block of parameters in the bind context. These parameters will apply to later UCOMIMoniker operations that use this bind context. - The structure containing the binding options to set. - - - Provides the managed definition of the IConnectionPoint interface. - - - Establishes an advisory connection between the connection point and the caller's sink object. - A reference to the sink to receive calls for the outgoing interface managed by this connection point. - When this method returns, contains the connection cookie. This parameter is passed uninitialized. - - - Creates an enumerator object for iteration through the connections that exist to this connection point. - When this method returns, contains the newly created enumerator. This parameter is passed uninitialized. - - - Returns the IID of the outgoing interface managed by this connection point. - When this parameter returns, contains the IID of the outgoing interface managed by this connection point. This parameter is passed uninitialized. - - - Retrieves the IConnectionPointContainer interface pointer to the connectable object that conceptually owns this connection point. - When this parameter returns, contains the connectable object's IConnectionPointContainer interface. This parameter is passed uninitialized. - - - Terminates an advisory connection previously established through the method. - The connection cookie previously returned from the method. - - - Provides the managed definition of the IConnectionPointContainer interface. - - - Creates an enumerator of all the connection points supported in the connectable object, one connection point per IID. - When this method returns, contains the interface pointer of the enumerator. This parameter is passed uninitialized. - - - Asks the connectable object if it has a connection point for a particular IID, and if so, returns the IConnectionPoint interface pointer to that connection point. - A reference to the outgoing interface IID whose connection point is being requested. - When this method returns, contains the connection point that manages the outgoing interface riid. This parameter is passed uninitialized. - - - Provides the managed definition of the IDataObject interface. - - - Creates a connection between a data object and an advisory sink. This method is called by an object that supports an advisory sink and enables the advisory sink to be notified of changes in the object's data. - A structure, passed by reference, that defines the format, target device, aspect, and medium that will be used for future notifications. - One of the values that specifies a group of flags for controlling the advisory connection. - A pointer to the interface on the advisory sink that will receive the change notification. - When this method returns, contains a pointer to a DWORD token that identifies this connection. You can use this token later to delete the advisory connection by passing it to . If this value is zero, the connection was not established. This parameter is passed uninitialized. -

This method supports the standard return values E_INVALIDARG, E_UNEXPECTED, and E_OUTOFMEMORY, as well as the following:

-
Value

-

Description

-

S_OK

-

The advisory connection was created.

-

E_NOTIMPL

-

This method is not implemented on the data object.

-

DV_E_LINDEX

-

There is an invalid value for ; currently, only -1 is supported.

-

DV_E_FORMATETC

-

There is an invalid value for the pFormatetc parameter.

-

OLE_E_ADVISENOTSUPPORTED

-

The data object does not support change notification.

-

-
-
- - Destroys a notification connection that had been previously established. - A DWORD token that specifies the connection to remove. Use the value returned by when the connection was originally established. - - - Creates an object that can be used to enumerate the current advisory connections. - When this method returns, contains an that receives the interface pointer to the new enumerator object. If the implementation sets enumAdvise to null, there are no connections to advisory sinks at this time. This parameter is passed uninitialized. -

This method supports the standard return value E_OUTOFMEMORY, as well as the following:

-
Value

-

Description

-

S_OK

-

The enumerator object is successfully instantiated or there are no connections.

-

OLE_E_ADVISENOTSUPPORTED

-

This object does not support advisory notifications.

-

-
-
- - Creates an object for enumerating the structures for a data object. These structures are used in calls to or . - One of the values that specifies the direction of the data. -

This method supports the standard return values E_INVALIDARG and E_OUTOFMEMORY, as well as the following:

-
Value

-

Description

-

S_OK

-

The enumerator object was successfully created.

-

E_NOTIMPL

-

The direction specified by the direction parameter is not supported.

-

OLE_S_USEREG

-

Requests that OLE enumerate the formats from the registry.

-

-
-
- - Provides a standard structure that is logically equivalent to a more complex structure. Use this method to determine whether two different structures would return the same data, removing the need for duplicate rendering. - A pointer to a structure, passed by reference, that defines the format, medium, and target device that the caller would like to use to retrieve data in a subsequent call such as . The member is not significant in this case and should be ignored. - When this method returns, contains a pointer to a structure that contains the most general information possible for a specific rendering, making it canonically equivalent to formatetIn. The caller must allocate this structure and the method must fill in the data. To retrieve data in a subsequent call such as , the caller uses the supplied value of formatOut, unless the value supplied is null. This value is null if the method returns DATA_S_SAMEFORMATETC. The member is not significant in this case and should be ignored. This parameter is passed uninitialized. -

This method supports the standard return values E_INVALIDARG, E_UNEXPECTED, and E_OUTOFMEMORY, as well as the following:

-
Value

-

Description

-

S_OK

-

The returned structure is different from the one that was passed.

-

DATA_S_SAMEFORMATETC

-

The structures are the same and null is returned in the formatOut parameter.

-

DV_E_LINDEX

-

There is an invalid value for ; currently, only -1 is supported.

-

DV_E_FORMATETC

-

There is an invalid value for the pFormatetc parameter.

-

OLE_E_NOTRUNNING

-

The application is not running.

-

-
-
- - Obtains data from a source data object. The method, which is called by a data consumer, renders the data described in the specified structure and transfers it through the specified structure. The caller then assumes responsibility for releasing the structure. - A pointer to a structure, passed by reference, that defines the format, medium, and target device to use when passing the data. It is possible to specify more than one medium by using the Boolean OR operator, allowing the method to choose the best medium among those specified. - When this method returns, contains a pointer to the structure that indicates the storage medium containing the returned data through its member, and the responsibility for releasing the medium through the value of its member. If is null, the receiver of the medium is responsible for releasing it; otherwise, points to the IUnknown interface on the appropriate object so its Release method can be called. The medium must be allocated and filled in by . This parameter is passed uninitialized. - - - Obtains data from a source data object. This method, which is called by a data consumer, differs from the method in that the caller must allocate and free the specified storage medium. - A pointer to a structure, passed by reference, that defines the format, medium, and target device to use when passing the data. Only one medium can be specified in , and only the following values are valid: , , , or . - A , passed by reference, that defines the storage medium containing the data being transferred. The medium must be allocated by the caller and filled in by . The caller must also free the medium. The implementation of this method must always supply a value of null for the member of the structure that this parameter points to. - - - Determines whether the data object is capable of rendering the data described in the structure. Objects attempting a paste or drop operation can call this method before calling to get an indication of whether the operation may be successful. - A pointer to a structure, passed by reference, that defines the format, medium, and target device to use for the query. -

This method supports the standard return values E_INVALIDARG, E_UNEXPECTED, and E_OUTOFMEMORY, as well as the following:

-
Value

-

Description

-

S_OK

-

A subsequent call to would probably be successful.

-

DV_E_LINDEX

-

An invalid value for ; currently, only -1 is supported.

-

DV_E_FORMATETC

-

An invalid value for the pFormatetc parameter.

-

DV_E_TYMED

-

An invalid value.

-

DV_E_DVASPECT

-

An invalid value.

-

OLE_E_NOTRUNNING

-

The application is not running.

-

-
-
- - Transfers data to the object that implements this method. This method is called by an object that contains a data source. - A structure, passed by reference, that defines the format used by the data object when interpreting the data contained in the storage medium. - A structure, passed by reference, that defines the storage medium in which the data is being passed. - true to specify that the data object called, which implements , owns the storage medium after the call returns. This means that the data object must free the medium after it has been used by calling the ReleaseStgMedium function. false to specify that the caller retains ownership of the storage medium, and the data object called uses the storage medium for the duration of the call only. - - - Contains information needed for transferring a structure element, parameter, or function return value between processes. - - - Reserved; set to null. - - - - Indicates an value describing the type. - - - - Describes how to transfer a structure element, parameter, or function return value between processes. - - - The parameter passes information from the caller to the callee. - - - - The parameter is the local identifier of a client application. - - - - The parameter returns information from the callee to the caller. - - - - The parameter is the return value of the member. - - - - Does not specify whether the parameter passes or receives information. - - - - Manages the definition of the IEnumConnectionPoints interface. - - - Creates a new enumerator that contains the same enumeration state as the current one. - When this method returns, contains a reference to the newly created enumerator. This parameter is passed uninitialized. - - - Retrieves a specified number of items in the enumeration sequence. - The number of IConnectionPoint references to return in rgelt. - When this method returns, contains a reference to the enumerated connections. This parameter is passed uninitialized. - When this method returns, contains a reference to the actual number of connections enumerated in rgelt. - S_OK if the pceltFetched parameter equals the celt parameter; otherwise, S_FALSE. - - - Resets the enumeration sequence to the beginning. - - - Skips a specified number of items in the enumeration sequence. - The number of elements to skip in the enumeration. - S_OK if the number of elements skipped equals the celt parameter; otherwise, S_FALSE. - - - Manages the definition of the IEnumConnections interface. - - - Creates a new enumerator that contains the same enumeration state as the current one. - When this method returns, contains a reference to the newly created enumerator. This parameter is passed uninitialized. - - - Retrieves a specified number of items in the enumeration sequence. - The number of structures to return in rgelt. - When this method returns, contains a reference to the enumerated connections. This parameter is passed uninitialized. - When this method returns, contains a reference to the actual number of connections enumerated in rgelt. - S_OK if the pceltFetched parameter equals the celt parameter; otherwise, S_FALSE. - - - Resets the enumeration sequence to the beginning. - - - Skips a specified number of items in the enumeration sequence. - The number of elements to skip in the enumeration. - S_OK if the number of elements skipped equals the celt parameter; otherwise, S_FALSE. - - - Provides the managed definition of the IEnumFORMATETC interface. - - - Creates a new enumerator that contains the same enumeration state as the current enumerator. - When this method returns, contains a reference to the newly created enumerator. This parameter is passed uninitialized. - - - Retrieves a specified number of items in the enumeration sequence. - The number of references to return in rgelt. - When this method returns, contains a reference to the enumerated references. This parameter is passed uninitialized. - When this method returns, contains a reference to the actual number of references enumerated in rgelt. This parameter is passed uninitialized. - S_OK if the pceltFetched parameter equals the celt parameter; otherwise, S_FALSE. - - - Resets the enumeration sequence to the beginning. - An HRESULT with the value S_OK. - - - Skips a specified number of items in the enumeration sequence. - The number of elements to skip in the enumeration. - S_OK if the number of elements skipped equals the celt parameter; otherwise, S_FALSE. - - - Manages the definition of the IEnumMoniker interface. - - - Creates a new enumerator that contains the same enumeration state as the current one. - When this method returns, contains a reference to the newly created enumerator. This parameter is passed uninitialized. - - - Retrieves a specified number of items in the enumeration sequence. - The number of monikers to return in rgelt. - When this method returns, contains a reference to the enumerated monikers. This parameter is passed uninitialized. - When this method returns, contains a reference to the actual number of monikers enumerated in rgelt. - S_OK if the pceltFetched parameter equals the celt parameter; otherwise, S_FALSE. - - - Resets the enumeration sequence to the beginning. - - - Skips a specified number of items in the enumeration sequence. - The number of elements to skip in the enumeration. - S_OK if the number of elements skipped equals the celt parameter; otherwise, S_FALSE. - - - Provides the managed definition of the IEnumSTATDATA interface. - - - Creates a new enumerator that contains the same enumeration state as the current enumerator. - When this method returns, contains a reference to the newly created enumerator. This parameter is passed uninitialized. - - - Retrieves a specified number of items in the enumeration sequence. - The number of references to return in rgelt. - When this method returns, contains a reference to the enumerated references. This parameter is passed uninitialized. - When this parameter returns, contains a reference to the actual number of references enumerated in rgelt. This parameter is passed uninitialized. - S_OK if the pceltFetched parameter equals the celt parameter; otherwise, S_FALSE. - - - Resets the enumeration sequence to the beginning. - An HRESULT with the value S_OK. - - - Skips a specified number of items in the enumeration sequence. - The number of elements to skip in the enumeration. - S_OK if the number of elements skipped equals the celt parameter; otherwise, S_FALSE. - - - Manages the definition of the IEnumString interface. - - - Creates a new enumerator that contains the same enumeration state as the current one. - When this method returns, contains a reference to the newly created enumerator. This parameter is passed uninitialized. - - - Retrieves a specified number of items in the enumeration sequence. - The number of strings to return in rgelt. - When this method returns, contains a reference to the enumerated strings. This parameter is passed uninitialized. - When this method returns, contains a reference to the actual number of strings enumerated in rgelt. - S_OK if the pceltFetched parameter equals the celt parameter; otherwise, S_FALSE. - - - Resets the enumeration sequence to the beginning. - - - Skips a specified number of items in the enumeration sequence. - The number of elements to skip in the enumeration. - S_OK if the number of elements skipped equals the celt parameter; otherwise, S_FALSE. - - - Manages the definition of the IEnumVARIANT interface. - - - Creates a new enumerator that contains the same enumeration state as the current one. - An reference to the newly created enumerator. - - - Retrieves a specified number of items in the enumeration sequence. - The number of elements to return in rgelt. - When this method returns, contains a reference to the enumerated elements. This parameter is passed uninitialized. - When this method returns, contains a reference to the actual number of elements enumerated in rgelt. - S_OK if the pceltFetched parameter equals the celt parameter; otherwise, S_FALSE. - - - Resets the enumeration sequence to the beginning. - An HRESULT with the value S_OK. - - - Skips a specified number of items in the enumeration sequence. - The number of elements to skip in the enumeration. - S_OK if the number of elements skipped equals celt parameter; otherwise, S_FALSE. - - - Provides the managed definition of the IMoniker interface, with COM functionality from IPersist and IPersistStream. - - - Uses the moniker to bind to the object that it identifies. - A reference to the IBindCtx interface on the bind context object used in this binding operation. - A reference to the moniker to the left of the current moniker, if the moniker is part of a composite moniker. - The interface identifier (IID) of the interface that the client intends to use to communicate with the object that the moniker identifies. - When this method returns, contains a reference to the interface requested by riidResult. This parameter is passed uninitialized. - - - Retrieves an interface pointer to the storage that contains the object identified by the moniker. - A reference to the IBindCtx interface on the bind context object used during this binding operation. - A reference to the moniker to the left of the current moniker, if the moniker is part of a composite moniker. - The interface identifier (IID) of the storage interface requested. - When this method returns, contains a reference to the interface requested by riid. This parameter is passed uninitialized. - - - Creates a new moniker based on the common prefix that this moniker shares with another moniker. - A reference to the IMoniker interface on another moniker to compare with the current moniker for a common prefix. - When this method returns, contains the moniker that is the common prefix of the current moniker and pmkOther. This parameter is passed uninitialized. - - - Combines the current moniker with another moniker, creating a new composite moniker. - A reference to the IMoniker interface on a moniker to append to the end of the current moniker. - true to indicate that the caller requires a nongeneric composition. The operation proceeds only if pmkRight is a moniker class that the current moniker can combine with in some way other than forming a generic composite. false to indicate that the method can create a generic composite if necessary. - When this method returns, contains a reference to the resulting composite moniker. This parameter is passed uninitialized. - - - Supplies a pointer to an enumerator that can enumerate the components of a composite moniker. - true to enumerate the monikers from left to right. false to enumerate from right to left. - When this method returns, contains a reference to the enumerator object for the moniker. This parameter is passed uninitialized. - - - Retrieves the class identifier (CLSID) of an object. - When this method returns, contains the CLSID. This parameter is passed uninitialized. - - - Gets the display name, which is a user-readable representation of the current moniker. - A reference to the bind context to use in this operation. - A reference to the moniker to the left of the current moniker, if the moniker is part of a composite moniker. - When this method returns, contains the display name string. This parameter is passed uninitialized. - - - Returns the size, in bytes, of the stream needed to save the object. - When this method returns, contains a long value indicating the size, in bytes, of the stream needed to save this object. This parameter is passed uninitialized. - - - Provides a number representing the time that the object identified by the current moniker was last changed. - A reference to the bind context to use in this binding operation. - A reference to the moniker to the left of the current moniker, if the moniker is part of a composite moniker. - When this method returns, contains the time of the last change. This parameter is passed uninitialized. - - - Calculates a 32-bit integer using the internal state of the moniker. - When this method returns, contains the hash value for this moniker. This parameter is passed uninitialized. - - - Provides a moniker that, when composed to the right of the current moniker or one of similar structure, composes to nothing. - When this method returns, contains a moniker that is the inverse of the current moniker. This parameter is passed uninitialized. - - - Checks the object for changes since it was last saved. - An S_OK``HRESULT value if the object has changed; otherwise, an S_FALSE``HRESULT value. - - - Compares the current moniker with a specified moniker and indicates whether they are identical. - A reference to the moniker to use for comparison. - An S_OK``HRESULT value if the monikers are identical; otherwise, an S_FALSE``HRESULT value. - - - Determines whether the object that is identified by the current moniker is currently loaded and running. - A reference to the bind context to use in this binding operation. - A reference to the moniker to the left of the current moniker if the current moniker is part of a composite. - A reference to the moniker most recently added to the Running Object Table (ROT). - An S_OK``HRESULT value if the moniker is running; an S_FALSE``HRESULT value if the moniker is not running; or an E_UNEXPECTED``HRESULT value. - - - Indicates whether this moniker is of one of the system-supplied moniker classes. - When this method returns, contains a pointer to an integer that is one of the values from the MKSYS enumeration, and refers to one of the COM moniker classes. This parameter is passed uninitialized. - An S_OK``HRESULT value if the moniker is a system moniker; otherwise, an S_FALSE``HRESULT value. - - - Initializes an object from the stream where it was previously saved. - The stream that the object is loaded from. - - - Reads as many characters of the specified display name as the understands and builds a moniker corresponding to the portion read. - A reference to the bind context to use in this binding operation. - A reference to the moniker that has been built from the display name up to this point. - A reference to the string containing the remaining display name to parse. - When this method returns, contains the number of characters that were consumed in parsing pszDisplayName. This parameter is passed uninitialized. - When this method returns, contains a reference to the moniker that was built from pszDisplayName. This parameter is passed uninitialized. - - - Returns a reduced moniker, which is another moniker that refers to the same object as the current moniker but can be bound with equal or greater efficiency. - A reference to the IBindCtx interface on the bind context to use in this binding operation. - A value that specifies how far the current moniker should be reduced. - A reference to the moniker to the left of the current moniker. - When this method returns, contains a reference to the reduced form of the current moniker, which can be null if an error occurs or if the current moniker is reduced to nothing. This parameter is passed uninitialized. - - - Supplies a moniker that, when appended to the current moniker (or one with a similar structure), yields the specified moniker. - A reference to the moniker to which a relative path should be taken. - When this method returns, contains a reference to the relative moniker. This parameter is passed uninitialized. - - - Saves an object to the specified stream. - The stream to which the object is saved. - true to clear the modified flag after the save is complete; otherwise false - - - Defines the attributes of an implemented or inherited interface of a type. - - - The interface or dispinterface represents the default for the source or sink. - - - - Sinks receive events through the virtual function table (VTBL). - - - - The member should not be displayed or programmable by users. - - - - This member of a coclass is called rather than implemented. - - - - Specifies how to invoke a function by IDispatch::Invoke. - - - The member is called using a normal function invocation syntax. - - - - The function is invoked using a normal property access syntax. - - - - The function is invoked using a property value assignment syntax. - - - - The function is invoked using a property reference assignment syntax. - - - - Provides the managed definition of the IPersistFile interface, with functionality from IPersist. - - - Retrieves the class identifier (CLSID) of an object. - When this method returns, contains a reference to the CLSID. This parameter is passed uninitialized. - - - Retrieves either the absolute path to the current working file of the object or, if there is no current working file, the default file name prompt of the object. - When this method returns, contains the address of a pointer to a zero-terminated string containing the path for the current file, or the default file name prompt (such as *.txt). This parameter is passed uninitialized. - - - Checks an object for changes since it was last saved to its current file. - S_OK if the file has changed since it was last saved; S_FALSE if the file has not changed since it was last saved. - - - Opens the specified file and initializes an object from the file contents. - A zero-terminated string containing the absolute path of the file to open. - A combination of values from the STGM enumeration to indicate the access mode in which to open pszFileName. - - - Saves a copy of the object into the specified file. - A zero-terminated string containing the absolute path of the file to which the object is saved. - true to used the pszFileName parameter as the current working file; otherwise false. - - - Notifies the object that it can write to its file. - The absolute path of the file where the object was previously saved. - - - Provides the managed definition of the IRunningObjectTable interface. - - - Enumerates the objects currently registered as running. - When this method returns, contains the new enumerator for the Running Object Table (ROT). This parameter is passed uninitialized. - - - Returns the registered object if the supplied object name is registered as running. - A reference to the moniker to search for in the Running Object Table (ROT). - When this method returns, contains the requested running object. This parameter is passed uninitialized. - An HRESULT value that indicates the success or failure of the operation. - - - Searches for this moniker in the Running Object Table (ROT) and reports the recorded time of change, if present. - A reference to the moniker to search for in the Running Object Table (ROT). - When this object returns, contains the objects last change time. This parameter is passed uninitialized. - An HRESULT value that indicates the success or failure of the operation. - - - Determines whether the specified moniker is currently registered in the Running Object Table (ROT). - A reference to the moniker to search for in the Running Object Table (ROT). - An HRESULT value that indicates the success or failure of the operation. - - - Notes the time that a particular object changed so IMoniker::GetTimeOfLastChange can report an appropriate change time. - The Running Object Table (ROT) entry of the changed object. - A reference to the object's last change time. - - - Registers that the supplied object has entered the running state. - Specifies whether the Running Object Table's (ROT) reference to punkObject is weak or strong, and controls access to the object through its entry in the ROT. - A reference to the object being registered as running. - A reference to the moniker that identifies punkObject. - A value that can be used to identify this ROT entry in subsequent calls to or . - - - Unregisters the specified object from the Running Object Table (ROT). - The Running Object Table (ROT) entry to revoke. - - - Provides the managed definition of the IStream interface, with ISequentialStream functionality. - - - Creates a new stream object with its own seek pointer that references the same bytes as the original stream. - When this method returns, contains the new stream object. This parameter is passed uninitialized. - - - Ensures that any changes made to a stream object that is open in transacted mode are reflected in the parent storage. - A value that controls how the changes for the stream object are committed. - - - Copies a specified number of bytes from the current seek pointer in the stream to the current seek pointer in another stream. - A reference to the destination stream. - The number of bytes to copy from the source stream. - On successful return, contains the actual number of bytes read from the source. - On successful return, contains the actual number of bytes written to the destination. - - - Restricts access to a specified range of bytes in the stream. - The byte offset for the beginning of the range. - The length of the range, in bytes, to restrict. - The requested restrictions on accessing the range. - - - Reads a specified number of bytes from the stream object into memory starting at the current seek pointer. - When this method returns, contains the data read from the stream. This parameter is passed uninitialized. - The number of bytes to read from the stream object. - A pointer to a ULONG variable that receives the actual number of bytes read from the stream object. - - - Discards all changes that have been made to a transacted stream since the last call. - - - Changes the seek pointer to a new location relative to the beginning of the stream, to the end of the stream, or to the current seek pointer. - The displacement to add to dwOrigin. - The origin of the seek. The origin can be the beginning of the file, the current seek pointer, or the end of the file. - On successful return, contains the offset of the seek pointer from the beginning of the stream. - - - Changes the size of the stream object. - The new size of the stream as a number of bytes. - - - Retrieves the structure for this stream. - When this method returns, contains a STATSTG structure that describes this stream object. This parameter is passed uninitialized. - Members in the STATSTG structure that this method does not return, thus saving some memory allocation operations. - - - Removes the access restriction on a range of bytes previously restricted with the method. - The byte offset for the beginning of the range. - The length, in bytes, of the range to restrict. - The access restrictions previously placed on the range. - - - Writes a specified number of bytes into the stream object starting at the current seek pointer. - The buffer to write this stream to. - The number of bytes to write to the stream. - On successful return, contains the actual number of bytes written to the stream object. If the caller sets this pointer to , this method does not provide the actual number of bytes written. - - - Provides the managed definition of the ITypeComp interface. - - - Maps a name to a member of a type, or binds global variables and functions contained in a type library. - The name to bind. - A hash value for szName computed by LHashValOfNameSys. - A flags word containing one or more of the invoke flags defined in the INVOKEKIND enumeration. - When this method returns, contains a reference to the type description that contains the item to which it is bound, if a FUNCDESC or VARDESC was returned. This parameter is passed uninitialized. - When this method returns, contains a reference to a DESCKIND enumerator that indicates whether the name bound-to is a VARDESC, FUNCDESC, or TYPECOMP. This parameter is passed uninitialized. - When this method returns, contains a reference to the bound-to VARDESC, FUNCDESC, or ITypeComp interface. This parameter is passed uninitialized. - - - Binds to the type descriptions contained within a type library. - The name to bind. - A hash value for szName determined by LHashValOfNameSys. - When this method returns, contains a reference to an ITypeInfo of the type to which szName was bound. This parameter is passed uninitialized. - When this method returns, contains a reference to an ITypeComp variable. This parameter is passed uninitialized. - - - Provides the managed definition of the Component Automation ITypeInfo interface. - - - Retrieves the addresses of static functions or variables, such as those defined in a DLL. - The member ID of the static member's address to retrieve. - One of the values that specifies whether the member is a property, and if so, what kind. - When this method returns, contains a reference to the static member. This parameter is passed uninitialized. - - - Creates a new instance of a type that describes a component class (coclass). - The object that acts as the controlling IUnknown. - The IID of the interface that the caller uses to communicate with the resulting object. - When this method returns, contains a reference to the created object. This parameter is passed uninitialized. - - - Retrieves the type library that contains this type description and its index within that type library. - When this method returns, contains a reference to the containing type library. This parameter is passed uninitialized. - When this method returns, contains a reference to the index of the type description within the containing type library. This parameter is passed uninitialized. - - - Retrieves a description or specification of an entry point for a function in a DLL. - The ID of the member function whose DLL entry description is to be returned. - One of the values that specifies the kind of member identified by memid. - If not null, the function sets pBstrDllName to a BSTR that contains the name of the DLL. - If not null, the function sets lpbstrName to a BSTR that contains the name of the entry point. - If not null, and the function is defined by an ordinal, then lpwOrdinal is set to point to the ordinal. - - - Retrieves the documentation string, the complete Help file name and path, and the context ID for the Help topic for a specified type description. - The ID of the member whose documentation is to be returned. - When this method returns, contains the name of the item method. This parameter is passed uninitialized. - When this method returns, contains the documentation string for the specified item. This parameter is passed uninitialized. - When this method returns, contains a reference to the Help context associated with the specified item. This parameter is passed uninitialized. - When this method returns, contains the fully qualified name of the Help file. This parameter is passed uninitialized. - - - Retrieves the structure that contains information about a specified function. - The index of the function description to return. - When this method returns, contains a reference to a FUNCDESC structure that describes the specified function. This parameter is passed uninitialized. - - - Maps between member names and member IDs, and parameter names and parameter IDs. - An array of names to map. - The count of names to map. - When this method returns, contains a reference to an array in which name mappings are placed. This parameter is passed uninitialized. - - - Retrieves the value for one implemented interface or base interface in a type description. - The index of the implemented interface or base interface. - When this method returns, contains a reference to the IMPLTYPEFLAGS enumeration. This parameter is passed uninitialized. - - - Retrieves marshaling information. - The member ID that indicates which marshaling information is needed. - When this method returns, contains a reference to the opcode string used in marshaling the fields of the structure described by the referenced type description, or returns null if there is no information to return. This parameter is passed uninitialized. - - - Retrieves the variable with the specified member ID (or the name of the property or method and its parameters) that corresponds to the specified function ID. - The ID of the member whose name (or names) is to be returned. - When this method returns, contains the name (or names) associated with the member. This parameter is passed uninitialized. - The length of the rgBstrNames array. - When this method returns, contains the number of names in the rgBstrNames array. This parameter is passed uninitialized. - - - Retrieves the referenced type descriptions if a type description references other type descriptions. - A handle to the referenced type description to return. - When this method returns, contains the referenced type description. This parameter is passed uninitialized. - - - Retrieves the type description of the implemented interface types if a type description describes a COM class. - The index of the implemented type whose handle is returned. - When this method returns, contains a reference to a handle for the implemented interface. This parameter is passed uninitialized. - - - Retrieves a structure that contains the attributes of the type description. - When this method returns, contains a reference to the structure that contains the attributes of this type description. This parameter is passed uninitialized. - - - Retrieves the ITypeComp interface for the type description, which enables a client compiler to bind to the type description's members. - When this method returns, contains a reference to the ITypeComp interface of the containing type library. This parameter is passed uninitialized. - - - Retrieves a VARDESC structure that describes the specified variable. - The index of the variable description to return. - When this method returns, contains a reference to the VARDESC structure that describes the specified variable. This parameter is passed uninitialized. - - - Invokes a method, or accesses a property of an object, that implements the interface described by the type description. - A reference to the interface described by this type description. - A value that identifies the interface member. - Flags that describe the context of the invoke call. - A reference to a structure that contains an array of arguments, an array of DISPIDs for named arguments, and counts of the number of elements in each array. - A reference to the location at which the result is to be stored. If wFlags specifies DISPATCH_PROPERTYPUT or DISPATCH_PROPERTYPUTREF, pVarResult is ignored. Set to null if no result is desired. - A pointer to an exception information structure, which is filled in only if DISP_E_EXCEPTION is returned. - If Invoke returns DISP_E_TYPEMISMATCH, puArgErr indicates the index within rgvarg of the argument with the incorrect type. If more than one argument returns an error, puArgErr indicates only the first argument with an error. This parameter is passed uninitialized. - - - Releases a structure previously returned by the method. - A reference to the FUNCDESC structure to release. - - - Releases a structure previously returned by the method. - A reference to the TYPEATTR structure to release. - - - Releases a VARDESC structure previously returned by the method. - A reference to the VARDESC structure to release. - - - Provides the managed definition of the ITypeInfo2 interface. - - - Retrieves the addresses of static functions or variables, such as those defined in a DLL. - The member ID of the static member's address to retrieve. - One of the values that specifies whether the member is a property, and if so, what kind. - When this method returns, contains a reference to the static member. This parameter is passed uninitialized. - - - Creates a new instance of a type that describes a component class (coclass). - An object that acts as the controlling IUnknown. - The IID of the interface that the caller uses to communicate with the resulting object. - When this method returns, contains a reference to the created object. This parameter is passed uninitialized. - - - Gets all custom data items for the library. - A pointer to CUSTDATA, which holds all custom data items. - - - Gets all custom data from the specified function. - The index of the function to get the custom data for. - A pointer to CUSTDATA, which holds all custom data items. - - - Gets all custom data for the specified implementation type. - The index of the implementation type for the custom data. - A pointer to CUSTDATA which holds all custom data items. - - - Gets all of the custom data for the specified function parameter. - The index of the function to get the custom data for. - The index of the parameter of this function to get the custom data for. - A pointer to CUSTDATA, which holds all custom data items. - - - Gets the variable for the custom data. - The index of the variable to get the custom data for. - A pointer to CUSTDATA, which holds all custom data items. - - - Retrieves the type library that contains this type description and its index within that type library. - When this method returns, contains a reference to the containing type library. This parameter is passed uninitialized. - When this method returns, contains a reference to the index of the type description within the containing type library. This parameter is passed uninitialized. - - - Gets the custom data. - The GUID used to identify the data. - When this method returns, contains an Object that specifies where to put the retrieved data. This parameter is passed uninitialized. - - - Retrieves a description or specification of an entry point for a function in a DLL. - The ID of the member function whose DLL entry description is to be returned. - One of the values that specifies the kind of member identified by memid. - If not null, the function sets pBstrDllName to a BSTR that contains the name of the DLL. - If not null, the function sets lpbstrName to a BSTR that contains the name of the entry point. - If not null, and the function is defined by an ordinal, then lpwOrdinal is set to point to the ordinal. - - - Retrieves the documentation string, the complete Help file name and path, and the context ID for the Help topic for a specified type description. - The ID of the member whose documentation is to be returned. - When this method returns, contains the name of the item method. This parameter is passed uninitialized. - When this method returns, contains the documentation string for the specified item. This parameter is passed uninitialized. - When this method returns, contains a reference to the Help context associated with the specified item. This parameter is passed uninitialized. - When this method returns, contains the fully qualified name of the Help file. This parameter is passed uninitialized. - - - Retrieves the documentation string, the complete Help file name and path, the localization context to use, and the context ID for the library Help topic in the Help file. - The member identifier for the type description. - When this method returns, contains a BSTR that contains the name of the specified item. If the caller does not need the item name, pbstrHelpString can be null. This parameter is passed uninitialized. - When this method returns, contains the Help localization context. If the caller does not need the Help context, pdwHelpStringContext can be null. This parameter is passed uninitialized. - When this method returns, contains a BSTR that contains the fully qualified name of the file containing the DLL used for the Help file. If the caller does not need the file name, pbstrHelpStringDll can be null. This parameter is passed uninitialized. - - - Gets the custom data from the specified function. - The index of the function to get the custom data for. - The GUID used to identify the data. - When this method returns, contains an Object that specified where to put the data. This parameter is passed uninitialized. - - - Retrieves the structure that contains information about a specified function. - The index of the function description to return. - When this method returns, contains a reference to a FUNCDESC structure that describes the specified function. This parameter is passed uninitialized. - - - Binds to a specific member based on a known DISPID, where the member name is not known (for example, when binding to a default member). - The member identifier. - One of the values that specifies the kind of member identified by memid. - When this method returns, contains an index into the function. This parameter is passed uninitialized. - - - Maps between member names and member IDs, and parameter names and parameter IDs. - An array of names to map. - The count of names to map. - When this method returns, contains a reference to an array in which name mappings are placed. This parameter is passed uninitialized. - - - Gets the implementation type of the custom data. - The index of the implementation type for the custom data. - The GUID used to identify the data. - When this method returns, contains an Object that specifies where to put the retrieved data. This parameter is passed uninitialized. - - - Retrieves the value for one implemented interface or base interface in a type description. - The index of the implemented interface or base interface. - When this method returns, contains a reference to the IMPLTYPEFLAGS enumeration. This parameter is passed uninitialized. - - - Retrieves marshaling information. - The member ID that indicates which marshaling information is needed. - When this method returns, contains a reference to the opcode string used in marshaling the fields of the structure described by the referenced type description, or returns null if there is no information to return. This parameter is passed uninitialized. - - - Retrieves the variable with the specified member ID (or the name of the property or method and its parameters) that corresponds to the specified function ID. - The ID of the member whose name (or names) is to be returned. - When this method returns, contains the name (or names) associated with the member. This parameter is passed uninitialized. - The length of the rgBstrNames array. - When this method returns, contains the number of names in the rgBstrNames array. This parameter is passed uninitialized. - - - Gets the specified custom data parameter. - The index of the function to get the custom data for. - The index of the parameter of this function to get the custom data for. - The GUID used to identify the data. - When this method returns, contains an Object that specifies where to put the retrieved data. This parameter is passed uninitialized. - - - Retrieves the referenced type descriptions, if a type description references other type descriptions. - A handle to the referenced type description to return. - When this method returns, contains the referenced type description. This parameter is passed uninitialized. - - - Retrieves the type description of the implemented interface types, if a type description describes a COM class. - The index of the implemented type whose handle is returned. - When this method returns, contains a reference to a handle for the implemented interface. This parameter is passed uninitialized. - - - Retrieves a structure that contains the attributes of the type description. - When this method returns, contains a reference to the structure that contains the attributes of this type description. This parameter is passed uninitialized. - - - Retrieves the ITypeComp interface for the type description, which enables a client compiler to bind to the type description's members. - When this method returns, contains a reference to the ITypeComp of the containing type library. This parameter is passed uninitialized. - - - Returns the type flags without any allocations. This method returns a DWORD type flag, which expands the type flags without growing the TYPEATTR (type attribute). - When this method returns, contains a DWORD reference to a TYPEFLAG. This parameter is passed uninitialized. - - - Returns the TYPEKIND enumeration quickly, without doing any allocations. - When this method returns, contains a reference to a TYPEKIND enumeration. This parameter is passed uninitialized. - - - Gets the variable for the custom data. - The index of the variable to get the custom data for. - The GUID used to identify the data. - When this method returns, contains an Object that specifies where to put the retrieved data. This parameter is passed uninitialized. - - - Retrieves a VARDESC structure that describes the specified variable. - The index of the variable description to return. - When this method returns, contains a reference to the VARDESC structure that describes the specified variable. This parameter is passed uninitialized. - - - Binds to a specific member based on a known DISPID, where the member name is not known (for example, when binding to a default member). - The member identifier. - When this method returns, contains an index of memid. This parameter is passed uninitialized. - - - Invokes a method, or accesses a property of an object, that implements the interface described by the type description. - A reference to the interface described by this type description. - Identifier of the interface member. - Flags describing the context of the invoke call. - A reference to a structure that contains an array of arguments, an array of DISPIDs for named arguments, and counts of the number of elements in each array. - A reference to the location at which the result is to be stored. If wFlags specifies DISPATCH_PROPERTYPUT or DISPATCH_PROPERTYPUTREF, pVarResult is ignored. Set to null if no result is desired. - A pointer to an exception information structure, which is filled in only if DISP_E_EXCEPTION is returned. - If Invoke returns DISP_E_TYPEMISMATCH, puArgErr indicates the index of the argument with incorrect type. If more than one argument returns an error, puArgErr indicates only the first argument with an error. - - - Releases a structure previously returned by the method. - A reference to the FUNCDESC structure to release. - - - Releases a structure previously returned by the method. - A reference to the TYPEATTR structure to release. - - - Releases a VARDESC structure previously returned by the method. - A reference to the VARDESC structure to release. - - - Provides the managed definition of the ITypeLib interface. - - - Finds occurrences of a type description in a type library. - The name to search for. This is an in/out parameter. - A hash value to speed up the search, computed by the LHashValOfNameSys function. If lHashVal is 0, a value is computed. - When this method returns, contains an array of pointers to the type descriptions that contain the name specified in szNameBuf. This parameter is passed uninitialized. - An array of the MEMBERID 's of the found items; rgMemId [i] is the MEMBERID that indexes into the type description specified by ppTInfo [i]. Cannot be null. - On entry, indicates how many instances to look for. For example, pcFound = 1 can be called to find the first occurrence. The search stops when one instance is found. On exit, indicates the number of instances that were found. If the in and out values of pcFound are identical, there might be more type descriptions that contain the name. - - - Retrieves the library's documentation string, the complete Help file name and path, and the context identifier for the library Help topic in the Help file. - The index of the type description whose documentation is to be returned. - When this method returns, contains a string that represents the name of the specified item. This parameter is passed uninitialized. - When this method returns, contains a string that represents the documentation string for the specified item. This parameter is passed uninitialized. - When this method returns, contains the Help context identifier associated with the specified item. This parameter is passed uninitialized. - When this method returns, contains a string that represents the fully qualified name of the Help file. This parameter is passed uninitialized. - - - Retrieves the structure that contains the library's attributes. - When this method returns, contains a structure that contains the library's attributes. This parameter is passed uninitialized. - - - Enables a client compiler to bind to a library's types, variables, constants, and global functions. - When this method returns, contains an instance of a ITypeComp instance for this ITypeLib. This parameter is passed uninitialized. - - - Retrieves the specified type description in the library. - The index of the ITypeInfo interface to return. - When this method returns, contains an ITypeInfo describing the type referenced by index. This parameter is passed uninitialized. - - - Returns the number of type descriptions in the type library. - The number of type descriptions in the type library. - - - Retrieves the type description that corresponds to the specified GUID. - The IID of the interface or CLSID of the class whose type info is requested. - When this method returns, contains the requested ITypeInfo interface. This parameter is passed uninitialized. - - - Retrieves the type of a type description. - The index of the type description within the type library. - When this method returns, contains a reference to the TYPEKIND enumeration for the type description. This parameter is passed uninitialized. - - - Indicates whether a passed-in string contains the name of a type or member described in the library. - The string to test. This is an in/out parameter. - The hash value of szNameBuf. - true if szNameBuf was found in the type library; otherwise, false. - - - Releases the structure originally obtained from the method. - The TLIBATTR structure to release. - - - Provides a managed definition of the ITypeLib2 interface. - - - Finds occurrences of a type description in a type library. - The name to search for. - A hash value to speed up the search, computed by the LHashValOfNameSys function. If lHashVal is 0, a value is computed. - When this method returns, contains an array of pointers to the type descriptions that contain the name specified in szNameBuf. This parameter is passed uninitialized. - When this method returns, contains an array of the MEMBERIDs of the found items; rgMemId [i] is the MEMBERID that indexes into the type description specified by ppTInfo [i]. This parameter cannot be null. This parameter is passed uninitialized. - On entry, a value, passed by reference, that indicates how many instances to look for. For example, pcFound = 1 can be called to find the first occurrence. The search stops when one instance is found. On exit, indicates the number of instances that were found. If the in and out values of pcFound are identical, there might be more type descriptions that contain the name. - - - Gets all custom data items for the library. - A pointer to CUSTDATA, which holds all custom data items. - - - Gets the custom data. - A , passed by reference, that is used to identify the data. - When this method returns, contains an object that specifies where to put the retrieved data. This parameter is passed uninitialized. - - - Retrieves the library's documentation string, the complete Help file name and path, and the context identifier for the library Help topic in the Help file. - An index of the type description whose documentation is to be returned. - When this method returns, contains a string that specifies the name of the specified item. This parameter is passed uninitialized. - When this method returns, contains the documentation string for the specified item. This parameter is passed uninitialized. - When this method returns, contains the Help context identifier associated with the specified item. This parameter is passed uninitialized. - When this method returns, contains a string that specifies the fully qualified name of the Help file. This parameter is passed uninitialized. - - - Retrieves the library's documentation string, the complete Help file name and path, the localization context to use, and the context ID for the library Help topic in the Help file. - An index of the type description whose documentation is to be returned; if index is -1, the documentation for the library is returned. - When this method returns, contains a BSTR that specifies the name of the specified item. If the caller does not need the item name, pbstrHelpString can be null. This parameter is passed uninitialized. - When this method returns, contains the Help localization context. If the caller does not need the Help context, pdwHelpStringContext can be null. This parameter is passed uninitialized. - When this method returns, contains a BSTR that specifies the fully qualified name of the file containing the DLL used for Help file. If the caller does not need the file name, pbstrHelpStringDll can be null. This parameter is passed uninitialized. - - - Retrieves the structure that contains the library's attributes. - When this method returns, contains a structure that contains the library's attributes. This parameter is passed uninitialized. - - - Returns statistics about a type library that are required for efficient sizing of hash tables. - A pointer to a count of unique names. If the caller does not need this information, set to null. - When this method returns, contains a pointer to a change in the count of unique names. This parameter is passed uninitialized. - - - Enables a client compiler to bind to a library's types, variables, constants, and global functions. - When this method returns, contains an ITypeComp instance for this ITypeLib. This parameter is passed uninitialized. - - - Retrieves the specified type description in the library. - An index of the ITypeInfo interface to return. - When this method returns, contains an ITypeInfo describing the type referenced by index. This parameter is passed uninitialized. - - - Returns the number of type descriptions in the type library. - The number of type descriptions in the type library. - - - Retrieves the type description that corresponds to the specified GUID. - The , passed by reference, that represents the IID of the CLSID interface of the class whose type info is requested. - When this method returns, contains the requested ITypeInfo interface. This parameter is passed uninitialized. - - - Retrieves the type of a type description. - The index of the type description within the type library. - When this method returns, contains a reference to the TYPEKIND enumeration for the type description. This parameter is passed uninitialized. - - - Indicates whether a passed-in string contains the name of a type or member described in the library. - The string to test. - The hash value of szNameBuf. - true if szNameBuf was found in the type library; otherwise, false. - - - Releases the structure originally obtained from the method. - The TLIBATTR structure to release. - - - Defines flags that apply to type libraries. - - - The type library describes controls and should not be displayed in type browsers intended for nonvisual objects. - - - - The type library exists in a persisted form on disk. - - - - The type library should not be displayed to users, although its use is not restricted. The type library should be used by controls. Hosts should create a new type library that wraps the control with extended properties. - - - - The type library is restricted, and should not be displayed to users. - - - - Contains information about how to transfer a structure element, parameter, or function return value between processes. - - - Represents a pointer to a value that is being passed between processes. - - - - Represents bitmask values that describe the structure element, parameter, or return value. - - - - Describes how to transfer a structure element, parameter, or function return value between processes. - - - The parameter has custom data. - - - - The parameter has default behaviors defined. - - - - The parameter passes information from the caller to the callee. - - - - The parameter is the local identifier of a client application. - - - - The parameter is optional. - - - - The parameter returns information from the callee to the caller. - - - - The parameter is the return value of the member. - - - - Does not specify whether the parameter passes or receives information. - - - - Provides the managed definition of the STATDATA structure. - - - Represents the enumeration value that determines when the advisory sink is notified of changes in the data. - - - - Represents the interface that will receive change notifications. - - - - Represents the token that uniquely identifies the advisory connection. This token is returned by the method that sets up the advisory connection. - - - - Represents the structure for the data of interest to the advise sink. The advise sink receives notification of changes to the data specified by this structure. - - - - Contains statistical information about an open storage, stream, or byte-array object. - - - Specifies the last access time for this storage, stream, or byte array. - - - - Specifies the size, in bytes, of the stream or byte array. - - - - Indicates the class identifier for the storage object. - - - - Indicates the creation time for this storage, stream, or byte array. - - - - Indicates the types of region locking supported by the stream or byte array. - - - - Indicates the access mode that was specified when the object was opened. - - - - Indicates the current state bits of the storage object (the value most recently set by the IStorage::SetStateBits method). - - - - Indicates the last modification time for this storage, stream, or byte array. - - - - Represents a pointer to a null-terminated string containing the name of the object described by this structure. - - - - Reserved for future use. - - - - Indicates the type of storage object, which is one of the values from the STGTY enumeration. - - - - Provides the managed definition of the STGMEDIUM structure. - - - Represents a pointer to an interface instance that allows the sending process to control the way the storage is released when the receiving process calls the ReleaseStgMedium function. If is null, ReleaseStgMedium uses default procedures to release the storage; otherwise, ReleaseStgMedium uses the specified IUnknown interface. - - - - Specifies the type of storage medium. The marshaling and unmarshaling routines use this value to determine which union member was used. This value must be one of the elements of the enumeration. - - - - Represents a handle, string, or interface pointer that the receiving process can use to access the data being transferred. - - - - Identifies the target operating system platform. - - - The target operating system for the type library is Apple Macintosh. By default, all data fields are aligned on even-byte boundaries. - - - - The target operating system for the type library is 16-bit Windows systems. By default, data fields are packed. - - - - The target operating system for the type library is 32-bit Windows systems. By default, data fields are naturally aligned (for example, 2-byte integers are aligned on even-byte boundaries; 4-byte integers are aligned on quad-word boundaries, and so on). - - - - The target operating system for the type library is 64-bit Windows systems. - - - - Provides the managed definition of the TYMED structure. - - - The storage medium is an enhanced metafile. If the member is null, the destination process should use DeleteEnhMetaFile to delete the bitmap. - - - - The storage medium is a disk file identified by a path. If the STGMEDIUM member is null, the destination process should use OpenFile to delete the file. - - - - The storage medium is a Graphics Device Interface (GDI) component (HBITMAP). If the member is null, the destination process should use DeleteObject to delete the bitmap. - - - - The storage medium is a global memory handle (HGLOBAL). Allocate the global handle with the GMEM_SHARE flag. If the member is null, the destination process should use GlobalFree to release the memory. - - - - The storage medium is a storage component identified by an IStorage pointer. The data is in the streams and storages contained by this IStorage instance. If the member is not null, the destination process should use IStorage::Release to release the storage component. - - - - The storage medium is a stream object identified by an IStream pointer. Use ISequentialStream::Read to read the data. If the member is not null, the destination process should use IStream::Release to release the stream component. - - - - The storage medium is a metafile (HMETAFILE). Use the Windows or WIN32 functions to access the metafile's data. If the member is null, the destination process should use DeleteMetaFile to delete the bitmap. - - - - No data is being passed. - - - - Contains attributes of a UCOMITypeInfo. - - - Specifies the byte alignment for an instance of this type. - - - - The size of an instance of this type. - - - - The size of this type's virtual method table (VTBL). - - - - Indicates the number of functions on the interface this structure describes. - - - - Indicates the number of implemented interfaces on the interface this structure describes. - - - - Indicates the number of variables and data fields on the interface described by this structure. - - - - Reserved for future use. - - - - The GUID of the type information. - - - - IDL attributes of the described type. - - - - Locale of member names and documentation strings. - - - - Reserved for future use. - - - - A constant used with the and fields. - - - - ID of constructor, or if none. - - - - ID of destructor, or if none. - - - - If == , specifies the type for which this type is an alias. - - - - A value describing the type this information describes. - - - - Major version number. - - - - Minor version number. - - - - A value describing this information. - - - - Describes the type of a variable, return type of a function, or the type of a function parameter. - - - If the variable is VT_SAFEARRAY or VT_PTR, the lpValue field contains a pointer to a TYPEDESC that specifies the element type. - - - - Indicates the variant type for the item described by this TYPEDESC. - - - - Defines the properties and attributes of a type description. - - - The class supports aggregation. - - - - A type description that describes an Application object. - - - - Instances of the type can be created by ITypeInfo::CreateInstance. - - - - The type is a control from which other types will be derived and should not be displayed to users. - - - - Indicates that the interface derives from IDispatch, either directly or indirectly. This flag is computed; there is no Object Description Language for the flag. - - - - The interface supplies both IDispatch and VTBL binding. - - - - The type should not be displayed to browsers. - - - - The type is licensed. - - - - The interface cannot add members at run time. - - - - The types used in the interface are fully compatible with Automation, including VTBL binding support. Setting dual on an interface sets both this flag and the . This flag is not allowed on dispinterfaces. - - - - The type is predefined. The client application should automatically create a single instance of the object that has this attribute. The name of the variable that points to the object is the same as the class name of the object. - - - - Indicates that the interface will be using a proxy/stub dynamic link library. This flag specifies that the type library proxy should not be unregistered when the type library is unregistered. - - - - The object supports IConnectionPointWithDefault, and has default behaviors. - - - - Should not be accessible from macro languages. This flag is intended for system-level types or types that type browsers should not display. - - - - Indicates base interfaces should be checked for name resolution before checking children, which is the reverse of the default behavior. - - - - Specifies various types of data and functions. - - - A type that is an alias for another type. - - - - A set of implemented components interfaces. - - - - A set of methods and properties that are accessible through IDispatch::Invoke. By default, dual interfaces return TKIND_DISPATCH. - - - - A set of enumerators. - - - - A type that has virtual functions, all of which are pure. - - - - End-of-enumeration marker. - - - - A module that can have only static functions and data (for example, a DLL). - - - - A structure with no methods. - - - - A union of all members that have an offset of zero. - - - - Identifies a particular type library and provides localization support for member names. - - - Represents a globally unique library ID of a type library. - - - - Represents a locale ID of a type library. - - - - Represents the target hardware platform of a type library. - - - - Represents library flags. - - - - Represents the major version number of a type library. - - - - Represents the minor version number of a type library. - - - - Contains information about a variable. - - - Describes a symbolic constant. - - - - Indicates the offset of this variable within the instance. - - - - Describes a variable, constant, or data member. - - - Contains information about a variable. - - - - Contains the variable type. - - - - This field is reserved for future use. - - - - Indicates the member ID of a variable. - - - - Defines how to marshal a variable. - - - - Defines the properties of a variable. - - - - Identifies the constants that define the properties of a variable. - - - The variable supports data binding. - - - - The variable is the single property that best represents the object. Only one variable in type information can have this attribute. - - - - Permits an optimization in which the compiler looks for a member named "xyz" on the type of "abc". If such a member is found and is flagged as an accessor function for an element of the default collection, then a call is generated to that member function. Permitted on members in dispinterfaces and interfaces; not permitted on modules. - - - - The variable is displayed to the user as bindable. must also be set. - - - - The variable should not be displayed to the user in a browser, although it exists and is bindable. - - - - The variable is mapped as individual bindable properties. - - - - The variable appears in an object browser, but not in a properties browser. - - - - Assignment to the variable should not be allowed. - - - - Tags the interface as having default behaviors. - - - - When set, any attempt to directly change the property results in a call to IPropertyNotifySink::OnRequestEdit. The implementation of OnRequestEdit determines if the change is accepted. - - - - The variable should not be accessible from macro languages. This flag is intended for system-level variables or variables that you do not want type browsers to display. - - - - The variable returns an object that is a source of events. - - - - The variable is the default display in the user interface. - - - - Defines the kind of variable. - - - The VARDESC structure describes a symbolic constant. There is no memory associated with it. - - - - The variable can be accessed only through IDispatch::Invoke. - - - - The variable is a field or member of the type. It exists at a fixed offset within each instance of the type. - - - - There is only one instance of the variable. - - - - Specifies the method to call when you unregister an assembly for use from COM; this allows for the execution of user-written code during the unregistration process. - - - Initializes a new instance of the class. - - - Controls accessibility of an individual managed type or member, or of all types within an assembly, to COM. - - - Initializes a new instance of the ComVisibleAttribute class. - true to indicate that the type is visible to COM; otherwise, false. The default is true. - - - Gets a value that indicates whether the COM type is visible. - true if the type is visible; otherwise, false. The default value is true. - - - Provides the base class used to serialize objects as XML streams or documents. This class is abstract. - - - Initializes a new instance of the class. - - - Gets a value that specifies whether the is positioned over an XML element that can be read. - An used to read the XML stream or document. - true if the reader can read the data; otherwise, false. - - - Gets a value that specifies whether the is positioned over an XML element that can be read. - An used to read the XML stream or document. - true if the reader is positioned over the starting element; otherwise, false. - - - Reads the XML stream or document with a and returns the deserialized object. - A used to read the XML stream or document. - The deserialized object. - - - Reads the XML document or stream with an and returns the deserialized object. - An used to read the XML document. - The deserialized object. - - - Reads the XML document or stream with an and returns the deserialized object. - An used to read the XML stream or document. - The deserialized object. - - - Reads the XML stream or document with an and returns the deserialized object; it also enables you to specify whether the serializer can read the data before attempting to read it. - An used to read the XML document. - true to check whether the enclosing XML element name and namespace correspond to the root name and root namespace; otherwise, false to skip the verification. - The deserialized object. - - - Reads the XML document or stream with an and returns the deserialized object; it also enables you to specify whether the serializer can read the data before attempting to read it. - An used to read the XML document or stream. - true to check whether the enclosing XML element name and namespace correspond to the root name and root namespace; false to skip the verification. - The deserialized object. - - - Writes the end of the object data as a closing XML element to the XML document or stream with an . - An used to write the XML document or stream. - the type being serialized does not conform to data contract rules. For example, the attribute has not been applied to the type. - there is a problem with the instance being serialized. - the maximum number of objects to serialize has been exceeded. Check the property. - - - Writes the end of the object data as a closing XML element to the XML document or stream with an . - An used to write the XML document or stream. - the type being serialized does not conform to data contract rules. For example, the attribute has not been applied to the type. - there is a problem with the instance being serialized. - the maximum number of objects to serialize has been exceeded. Check the property. - - - Writes the complete content (start, content, and end) of the object to the XML document or stream with the specified . - A used to write the XML document or stream. - The object that contains the data to write to the stream. - the type being serialized does not conform to data contract rules. For example, the attribute has not been applied to the type. - there is a problem with the instance being serialized. - the maximum number of objects to serialize has been exceeded. Check the property. - - - Writes the complete content (start, content, and end) of the object to the XML document or stream with the specified . - An used to write the content to the XML document or stream. - The object that contains the content to write. - the type being serialized does not conform to data contract rules. For example, the attribute has not been applied to the type. - there is a problem with the instance being serialized. - the maximum number of objects to serialize has been exceeded. Check the property. - - - Writes the complete content (start, content, and end) of the object to the XML document or stream with the specified . - An used to write the XML document or stream. - The object that contains the content to write. - the type being serialized does not conform to data contract rules. For example, the attribute has not been applied to the type. - there is a problem with the instance being serialized. - the maximum number of objects to serialize has been exceeded. Check the property. - - - Writes only the content of the object to the XML document or stream using the specified . - An used to write the XML document or stream. - The object that contains the content to write. - the type being serialized does not conform to data contract rules. For example, the attribute has not been applied to the type. - there is a problem with the instance being serialized. - the maximum number of objects to serialize has been exceeded. Check the property. - - - Writes only the content of the object to the XML document or stream with the specified . - An used to write the XML document or stream. - The object that contains the content to write. - the type being serialized does not conform to data contract rules. For example, the attribute has not been applied to the type. - there is a problem with the instance being serialized. - the maximum number of objects to serialize has been exceeded. Check the property. - - - Writes the start of the object's data as an opening XML element using the specified . - An used to write the XML document. - The object to serialize. - the type being serialized does not conform to data contract rules. For example, the attribute has not been applied to the type. - there is a problem with the instance being serialized. - the maximum number of objects to serialize has been exceeded. Check the property. - - - Writes the start of the object's data as an opening XML element using the specified . - An used to write the XML document. - The object to serialize. - the type being serialized does not conform to data contract rules. For example, the attribute has not been applied to the type. - there is a problem with the instance being serialized. - the maximum number of objects to serialize has been exceeded. Check the property. - - - Contains methods for reading and writing XML. - - - Generates a default schema type given the specified type name and adds it to the specified schema set. - An to add the generated schema type to. - An that specifies the type name to assign the schema to. - The schemas or typeQName argument is null. - - - Reads a set of XML nodes from the specified reader and returns the result. - An used for reading. - An array of type . - The xmlReader argument is null. - While reading, a null node was encountered. - - - Writes the supplied nodes using the specified writer. - An used for writing. - An array of type to write. - The xmlWriter argument is null. - - - When given a class representing a data contract, and metadata representing a member of the contract, produces an XPath query for the member. - - - Creates an XPath from a data contract using the specified data contract type, array of metadata elements, and namespaces.. - The type that represents a data contract. - The metadata, generated using the method of the class, that points to the specific data member used to generate the query. - The XML namespaces and their prefixes found in the data contract. - The XPath generated from the type and member data. - - - Creates an XPath from a data contract using the specified contract data type, array of metadata elements, the top level element, and namespaces. - The type that represents a data contract. - The metadata, generated using the method of the class, that points to the specific data member used to generate the query. - The top level element in the xpath. - The XML namespaces and their prefixes found in the data contract. - The XPath generated from the type and member data. - - - Allows the transformation of a set of .NET Framework types that are used in data contracts into an XML schema file (.xsd). - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with the specified set of schemas. - An that contains the schemas to be exported. - - - Gets a value that indicates whether the set of .common language runtime (CLR) types contained in a set of assemblies can be exported. - A of that contains the assemblies with the types to export. - true if the types can be exported; otherwise, false. - - - Gets a value that indicates whether the set of .common language runtime (CLR) types contained in a can be exported. - A that contains the specified types to export. - true if the types can be exported; otherwise, false. - - - Gets a value that indicates whether the specified common language runtime (CLR) type can be exported. - The to export. - true if the type can be exported; otherwise, false. - - - Transforms the types contained in the specified collection of assemblies. - A (of ) that contains the types to export. - The assemblies argument is null. - An in the collection is null. - - - Transforms the types contained in the passed to this method. - A (of ) that contains the types to export. - The types argument is null. - A type in the collection is null. - - - Transforms the specified .NET Framework type into an XML schema definition language (XSD) schema. - The to transform into an XML schema. - The type argument is null. - - - Returns the top-level name and namespace for the . - The to query. - The that represents the top-level name and namespace for this , which is written to the stream when writing this object. - The type argument is null. - - - Returns the XML schema type for the specified type. - The type to return a schema for. - An that contains the XML schema. - The type argument is null. - - - Returns the contract name and contract namespace for the . - The that was exported. - An that represents the contract name of the type and its namespace. - The type argument is null. - - - Gets or sets an that contains options that can be set for the export operation. - An that contains options used to customize how types are exported to schemas. - - - Gets the collection of exported XML schemas. - An that contains the schemas transformed from the set of common language runtime (CLR) types after calling the method. - - - Indicates that the .NET Framework class library method to which this attribute is applied is unlikely to be affected by servicing releases, and therefore is eligible to be inlined across Native Image Generator (NGen) images. - - - Initializes a new instance of the class. - The reason why the method to which the attribute is applied is considered to be eligible for inlining across Native Image Generator (NGen) images. - - - Gets the reason why the method to which this attribute is applied is considered to be eligible for inlining across Native Image Generator (NGen) images. - The reason why the method is considered to be eligible for inlining across NGen images. - - - Defines the compatibility guarantee of a component, type, or type member that may span multiple versions. - - - Initializes a new instance of the class with a value that indicates a library, type, or member's guaranteed level of compatibility across multiple versions. - One of the enumeration values that specifies the level of compatibility that is guaranteed across multiple versions. - - - Gets a value that indicates the guaranteed level of compatibility of a library, type, or type member that spans multiple versions. - One of the enumeration values that specifies the level of compatibility that is guaranteed across multiple versions. - - - Describes the compatibility guarantee of a component, type, or type member that may span multiple versions. - - - The developer promises multi-version exchange compatibility for the type. Consumers of the type can expect compatibility across future versions and can use the type in all their interfaces. Versioning problems cannot be fixed by side-by-side execution. - - - - The developer does not guarantee compatibility across versions. Consumers of the component, type, or member can expect future versions to break the existing client. - - - - The component has been tested to work when more than one version of the assembly is loaded into the same application domain. Future versions can break compatibility. However, when such breaking changes are made, the old version is not modified but continues to exist alongside the new version. - - - - The developer promises stable compatibility across versions. Consumers of the type can expect that future versions will not break the existing client. However, if they do and if the client has not used the type in its interfaces, side-by-side execution may fix the problem. - - - - Represents the name of a version of the .NET Framework. - - - Initializes a new instance of the class from a string that contains information about a version of the .NET Framework. - A string that contains .NET Framework version information. - frameworkName is . -or- frameworkName has fewer than two components or more than three components. -or- frameworkName does not include a major and minor version number. -or- frameworkName does not include a valid version number. - frameworkName is null. - - - Initializes a new instance of the class from a string and a object that identify a .NET Framework version. - A string that identifies a .NET Framework version. - An object that contains .NET Framework version information. - identifier is . - identifier is null. -or- version is null. - - - Initializes a new instance of the class from a string, a object that identifies a .NET Framework version, and a profile name. - A string that identifies a .NET Framework version. - An object that contains .NET Framework version information. - A profile name. - identifier is . - identifier is null. -or- version is null. - - - Returns a value that indicates whether this instance represents the same .NET Framework version as a specified object. - The object to compare to the current instance. - true if every component of the current object matches the corresponding component of obj; otherwise, false. - - - Returns a value that indicates whether this instance represents the same .NET Framework version as a specified instance. - The object to compare to the current instance. - true if every component of the current object matches the corresponding component of other; otherwise, false. - - - Gets the full name of this object. - The full name of this object. - - - Returns the hash code for the object. - A 32-bit signed integer that represents the hash code of this instance. - - - Gets the identifier of this object. - The identifier of this object. - - - Returns a value that indicates whether two objects represent the same .NET Framework version. - The first object to compare. - The second object to compare. - true if the left and right parameters represent the same .NET Framework version; otherwise, false. - - - Returns a value that indicates whether two objects represent different .NET Framework versions. - The first object to compare. - The second object to compare. - true if the left and right parameters represent different .NET Framework versions; otherwise, false. - - - Gets the profile name of this object. - The profile name of this object. - - - Returns the string representation of this object. - A string that represents this object. - - - Gets the version of this object. - An object that contains version information about this object. - - - Specifies the resource consumed by the member of a class. This class cannot be inherited. - - - Initializes a new instance of the class specifying the scope of the consumed resource. - The for the consumed resource. - - - Initializes a new instance of the class specifying the scope of the consumed resource and the scope of how it is consumed. - The for the consumed resource. - The used by this member. - - - Gets the consumption scope for this member. - A object specifying the resource scope used by this member. - - - Gets the resource scope for the consumed resource. - A object specifying the resource scope of the consumed member. - - - Specifies the resource exposure for a member of a class. This class cannot be inherited. - - - Initializes a new instance of the class with the specified exposure level. - The scope of the resource. - - - Gets the resource exposure scope. - A object. - - - Identifies the scope of a sharable resource. - - - The state is shared by objects within an . - - - - The resource is visible at an assembly scope. - - - - The state is shared by objects within a library. - - - - The state is shared by objects within the machine. - - - - There is no shared state. - - - - The resource is visible to only the type. - - - - The state is shared within a process. - - - - Identifies the version of the .NET Framework that a particular assembly was compiled against. - - - Initializes an instance of the class by specifying the .NET Framework version against which an assembly was built. - The version of the .NET Framework against which the assembly was built. - frameworkName is null. - - - Gets the display name of the .NET Framework version against which an assembly was built. - The display name of the .NET Framework version. - - - Gets the name of the .NET Framework version against which a particular assembly was compiled. - The name of the .NET Framework version with which the assembly was compiled. - - - Provides methods to aid developers in writing version-safe code. This class cannot be inherited. - - - Returns a version-safe name based on the specified resource name and the intended resource consumption source. - The name of the resource. - The scope of the resource. - The desired resource consumption scope. - A version-safe name. - - - Returns a version-safe name based on the specified resource name, the intended resource consumption scope, and the type using the resource. - The name of the resource. - The beginning of the scope range. - The end of the scope range. - The of the resource. - A version-safe name. - The values for from and to are invalid. The resource type in the enumeration is going from a more restrictive resource type to a more general resource type. - type is null. - - - References a variable-length argument list. - - - Represents a field using an internal metadata token. - - - Indicates whether the current instance is equal to the specified object. - The object to compare to the current instance. - true if obj is a and equal to the value of the current instance; otherwise, false. - - - Indicates whether the current instance is equal to the specified . - The to compare to the current instance. - true if the value of handle is equal to the value of the current instance; otherwise, false. - - - Returns the hash code for this instance. - A 32-bit signed integer that is the hash code for this instance. - - - Populates a with the data necessary to deserialize the field represented by the current instance. - The object to populate with serialization information. - (Reserved) The place to store and retrieve serialized data. - info is null. - The property of the current instance is not a valid handle. - - - Indicates whether two structures are equal. - The to compare to right. - The to compare to left. - true if left is equal to right; otherwise, false. - - - Indicates whether two structures are not equal. - The to compare to right. - The to compare to left. - true if left is not equal to right; otherwise, false. - - - Gets a handle to the field represented by the current instance. - An that contains the handle to the field represented by the current instance. - - - is a handle to the internal metadata representation of a method. - - - Indicates whether this instance is equal to a specified object. - A to compare to this instance. - true if obj is a and equal to the value of this instance; otherwise, false. - - - Indicates whether this instance is equal to a specified . - A to compare to this instance. - true if handle is equal to the value of this instance; otherwise, false. - - - Obtains a pointer to the method represented by this instance. - A pointer to the method represented by this instance. - The caller does not have the necessary permission to perform this operation. - - - Returns the hash code for this instance. - A 32-bit signed integer hash code. - - - Populates a with the data necessary to deserialize the field represented by this instance. - The object to populate with serialization information. - (Reserved) The place to store and retrieve serialized data. - info is null. - is invalid. - - - Indicates whether two instances of are equal. - A to compare to right. - A to compare to left. - true if the value of left is equal to the value of right; otherwise, false. - - - Indicates whether two instances of are not equal. - A to compare to right. - A to compare to left. - true if the value of left is unequal to the value of right; otherwise, false. - - - Gets the value of this instance. - A that is the internal metadata representation of a method. - - - Represents a type using an internal metadata token. - - - Indicates whether the specified object is equal to the current structure. - An object to compare to the current instance. - true if obj is a structure and is equal to the value of this instance; otherwise, false. - - - Indicates whether the specified structure is equal to the current structure. - The structure to compare to the current instance. - true if the value of handle is equal to the value of this instance; otherwise, false. - - - Returns the hash code for the current instance. - A 32-bit signed integer hash code. - - - Gets a handle to the module that contains the type represented by the current instance. - A structure representing a handle to the module that contains the type represented by the current instance. - - - Populates a with the data necessary to deserialize the type represented by the current instance. - The object to be populated with serialization information. - (Reserved) The location where serialized data will be stored and retrieved. - info is null. - is invalid. - - - Indicates whether an object and a structure are equal. - An object to compare to right. - A structure to compare to left. - true if left is a structure and is equal to right; otherwise, false. - - - Indicates whether a structure is equal to an object. - A structure to compare to right. - An object to compare to left. - true if right is a and is equal to left; otherwise, false. - - - Indicates whether an object and a structure are not equal. - An object to compare to right. - A structure to compare to left. - true if left is a and is not equal to right; otherwise, false. - - - Indicates whether a structure is not equal to an object. - A structure to compare to right. - An object to compare to left. - true if right is a structure and is not equal to left; otherwise, false. - - - Gets a handle to the type represented by this instance. - A handle to the type represented by this instance. - - - Represents an 8-bit signed integer. - - - Compares this instance to a specified object and returns an indication of their relative values. - An object to compare, or null. -

A signed number indicating the relative values of this instance and obj.

-
Return Value

-

Description

-

Less than zero

-

This instance is less than obj.

-

Zero

-

This instance is equal to obj.

-

Greater than zero

-

This instance is greater than obj.

-

-or-

-

obj is null.

-

-
- obj is not an . -
- - Compares this instance to a specified 8-bit signed integer and returns an indication of their relative values. - An 8-bit signed integer to compare. -

A signed integer that indicates the relative order of this instance and value.

-
Return Value

-

Description

-

Less than zero

-

This instance is less than value.

-

Zero

-

This instance is equal to value.

-

Greater than zero

-

This instance is greater than value.

-

-
-
- - Returns a value indicating whether this instance is equal to a specified object. - An object to compare with this instance. - true if obj is an instance of and equals the value of this instance; otherwise, false. - - - Returns a value indicating whether this instance is equal to a specified value. - An value to compare to this instance. - true if obj has the same value as this instance; otherwise, false. - - - Returns the hash code for this instance. - A 32-bit signed integer hash code. - - - Returns the for value type . - The enumerated constant, . - - - Represents the largest possible value of . This field is constant. - - - - Represents the smallest possible value of . This field is constant. - - - - Converts the string representation of a number that is in a specified style and culture-specific format to its 8-bit signed equivalent. - A string that contains the number to convert. The string is interpreted by using the style specified by style. - A bitwise combination of the enumeration values that indicates the style elements that can be present in s. A typical value to specify is . - An object that supplies culture-specific formatting information about s. If provider is null, the thread current culture is used. - An 8-bit signed byte value that is equivalent to the number specified in the s parameter. - style is not a value. -or- style is not a combination of and . - s is null. - s is not in a format that is compliant with style. - s represents a number that is less than or greater than . -or- s includes non-zero, fractional digits. - - - Converts the string representation of a number in a specified culture-specific format to its 8-bit signed integer equivalent. - A string that represents a number to convert. The string is interpreted using the style. - An object that supplies culture-specific formatting information about s. If provider is null, the thread current culture is used. - An 8-bit signed integer that is equivalent to the number specified in s. - s is null. - s is not in the correct format. - s represents a number less than or greater than . - - - Converts the string representation of a number to its 8-bit signed integer equivalent. - A string that represents a number to convert. The string is interpreted using the style. - An 8-bit signed integer that is equivalent to the number contained in the s parameter. - s is null. - s does not consist of an optional sign followed by a sequence of digits (zero through nine). - s represents a number less than or greater than . - - - Converts the string representation of a number in a specified style to its 8-bit signed integer equivalent. - A string that contains a number to convert. The string is interpreted using the style specified by style. - A bitwise combination of the enumeration values that indicates the style elements that can be present in s. A typical value to specify is . - An 8-bit signed integer that is equivalent to the number specified in s. - s is null. - s is not in a format that is compliant with style. - s represents a number less than or greater than . -or- s includes non-zero, fractional digits. - style is not a value. -or- style is not a combination of and values. - - - Converts the numeric value of this instance to its equivalent string representation. - The string representation of the value of this instance, consisting of a negative sign if the value is negative, and a sequence of digits ranging from 0 to 9 with no leading zeroes. - - - Converts the numeric value of this instance to its equivalent string representation using the specified format and culture-specific format information. - A standard or custom numeric format string. - An object that supplies culture-specific formatting information. - The string representation of the value of this instance as specified by format and provider. - format is invalid. - - - Converts the numeric value of this instance to its equivalent string representation, using the specified format. - A standard or custom numeric format string. - The string representation of the value of this instance as specified by format. - format is invalid. - - - Converts the numeric value of this instance to its equivalent string representation using the specified culture-specific format information. - An object that supplies culture-specific formatting information. - The string representation of the value of this instance, as specified by provider. - - - Tries to convert the string representation of a number to its equivalent, and returns a value that indicates whether the conversion succeeded. - A string that contains a number to convert. - When this method returns, contains the 8-bit signed integer value that is equivalent to the number contained in s if the conversion succeeded, or zero if the conversion failed. The conversion fails if the s parameter is null or , is not in the correct format, or represents a number that is less than or greater than . This parameter is passed uninitialized; any value originally supplied in result will be overwritten. - true if s was converted successfully; otherwise, false. - - - Tries to convert the string representation of a number in a specified style and culture-specific format to its equivalent, and returns a value that indicates whether the conversion succeeded. - A string representing a number to convert. - A bitwise combination of enumeration values that indicates the permitted format of s. A typical value to specify is . - An object that supplies culture-specific formatting information about s. - When this method returns, contains the 8-bit signed integer value equivalent to the number contained in s, if the conversion succeeded, or zero if the conversion failed. The conversion fails if the s parameter is null or , is not in a format compliant with style, or represents a number less than or greater than . This parameter is passed uninitialized; any value originally supplied in result will be overwritten. - true if s was converted successfully; otherwise, false. - style is not a value. -or- style is not a combination of and values. - - - For a description of this member, see . - This parameter is unused. - true if the value of the current instance is not zero; otherwise, false. - - - For a description of this member, see . - This parameter is unused. - The value of the current instance, converted to a . - - - For a description of this member, see . - This parameter is ignored. - The value of the current instance, converted to a . - - - This conversion is not supported. Attempting to do so throws an . - This parameter is ignored. - None. This conversion is not supported. - In all cases. - - - For a description of this member, see . - This parameter is unused. - The value of the current instance, converted to a . - - - For a description of this member, see . - This parameter is ignored. - The value of the current instance, converted to a . - - - For a description of this member, see . - This parameter is ignored. - The value of the current instance, converted to an . - - - For a description of this member, see . - This parameter is ignored. - The value of the current instance, converted to an . - - - For a description of this member, see . - This parameter is ignored. - The value of the current instance, converted to an . - - - For a description of this member, see . - This parameter is ignored. - The value of the current instance, unchanged. - - - For a description of this member, see . - This parameter is ignored. - The value of the current instance, converted to a . - - - For a description of this member, see . - The to which to convert this value. - A implementation that provides information about the format of the returned value. - The value of the current instance, converted to an object of type type. - - - For a description of this member, see . - This parameter is ignored. - The value of the current instance, converted to a . - - - For a description of this member, see . - This parameter is ignored. - The value of the current instance, converted to a . - - - For a description of this member, see . - This parameter is ignored. - The value of the current instance, converted to a . - - - Represents a generic user. - - - Initializes a new instance of the class by using the specified object. - The object from which to construct the new instance of . - - - Initializes a new instance of the class representing the user with the specified name. - The name of the user on whose behalf the code is running. - The name parameter is null. - - - Initializes a new instance of the class representing the user with the specified name and authentication type. - The name of the user on whose behalf the code is running. - The type of authentication used to identify the user. - The name parameter is null. -or- The type parameter is null. - - - Gets the type of authentication used to identify the user. - The type of authentication used to identify the user. - - - Gets all claims for the user represented by this generic identity. - A collection of claims for this object. - - - Creates a new object that is a copy of the current instance. - A copy of the current instance. - - - Gets a value indicating whether the user has been authenticated. - true if the user was has been authenticated; otherwise, false. - - - Gets the user's name. - The name of the user on whose behalf the code is being run. - - - Represents a generic principal. - - - Initializes a new instance of the class from a user identity and an array of role names to which the user represented by that identity belongs. - A basic implementation of that represents any user. - An array of role names to which the user represented by the identity parameter belongs. - The identity parameter is null. - - - Gets the of the user represented by the current . - The of the user represented by the . - - - Determines whether the current belongs to the specified role. - The name of the role for which to check membership. - true if the current is a member of the specified role; otherwise, false. - - - Defines the basic functionality of an identity object. - - - Gets the type of authentication used. - The type of authentication used to identify the user. - - - Gets a value that indicates whether the user has been authenticated. - true if the user was authenticated; otherwise, false. - - - Gets the name of the current user. - The name of the user on whose behalf the code is running. - - - Defines the basic functionality of a principal object. - - - Gets the identity of the current principal. - The object associated with the current principal. - - - Determines whether the current principal belongs to the specified role. - The name of the role for which to check membership. - true if the current principal is a member of the specified role; otherwise, false. - - - Specifies how principal and identity objects should be created for an application domain. The default is UnauthenticatedPrincipal. - - - No principal or identity objects should be created. - - - - Principal and identity objects for the unauthenticated entity should be created. An unauthenticated entity has set to the empty string ("") and set to false. - - - - Principal and identity objects that reflect the operating system token associated with the current execution thread should be created, and the associated operating system groups should be mapped into roles. - - - - Defines security impersonation levels. Security impersonation levels govern the degree to which a server process can act on behalf of a client process. - - - The server process cannot obtain identification information about the client, and it cannot impersonate the client. - - - - The server process can impersonate the client's security context on remote systems. - - - - The server process can obtain information about the client, such as security identifiers and privileges, but it cannot impersonate the client. This is useful for servers that export their own objects, for example, database products that export tables and views. Using the retrieved client-security information, the server can make access-validation decisions without being able to use other services that are using the client's security context. - - - - The server process can impersonate the client's security context on its local system. The server cannot impersonate the client on remote systems. - - - - An impersonation level is not assigned. - - - - Represents text that should be kept confidential, such as by deleting it from computer memory when no longer needed. This class cannot be inherited. - - - Initializes a new instance of the class. - An error occurred while protecting or unprotecting the value of this instance. - This operation is not supported on this platform. - - - Initializes a new instance of the class from a subarray of objects. This constructor is not CLS-compliant. The CLS-compliant alternative is . - A pointer to an array of objects. - The number of elements of value to include in the new instance. - value is null. - length is less than zero or greater than 65,536. - An error occurred while protecting or unprotecting the value of this secure string. - This operation is not supported on this platform. - - - Appends a character to the end of the current secure string. - A character to append to this secure string. - This secure string has already been disposed. - This secure string is read-only. - Performing this operation would make the length of this secure string greater than 65,536 characters. - An error occurred while protecting or unprotecting the value of this secure string. - - - Deletes the value of the current secure string. - This secure string has already been disposed. - This secure string is read-only. - - - Creates a copy of the current secure string. - A duplicate of this secure string. - This secure string has already been disposed. - An error occurred while protecting or unprotecting the value of this secure string. - - - Releases all resources used by the current object. - - - Inserts a character in this secure string at the specified index position. - The index position where parameter c is inserted. - The character to insert. - This secure string has already been disposed. - This secure string is read-only. - index is less than zero, or greater than the length of this secure string. -or- Performing this operation would make the length of this secure string greater than 65,536 characters. - An error occurred while protecting or unprotecting the value of this secure string. - - - Indicates whether this secure string is marked read-only. - true if this secure string is marked read-only; otherwise, false. - This secure string has already been disposed. - - - Gets the number of characters in the current secure string. - The number of objects in this secure string. - This secure string has already been disposed. - - - Makes the text value of this secure string read-only. - This secure string has already been disposed. - - - Removes the character at the specified index position from this secure string. - The index position of a character in this secure string. - This secure string has already been disposed. - This secure string is read-only. - index is less than zero, or greater than or equal to the length of this secure string. - An error occurred while protecting or unprotecting the value of this secure string. - - - Replaces the existing character at the specified index position with another character. - The index position of an existing character in this secure string - A character that replaces the existing character. - This secure string has already been disposed. - This secure string is read-only. - index is less than zero, or greater than or equal to the length of this secure string. - An error occurred while protecting or unprotecting the value of this secure string. - - - - - - - - - - - - - - - - - - - - - - Specifies that code or an assembly performs security-critical operations. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with the specified scope. - One of the enumeration values that specifies the scope of the attribute. - - - Gets the scope for the attribute. - One of the enumeration values that specifies the scope of the attribute. The default is , which indicates that the attribute applies only to the immediate target. - - - Represents a 5-tuple, or quintuple. - The type of the tuple's first component. - The type of the tuple's second component. - The type of the tuple's third component. - The type of the tuple's fourth component. - The type of the tuple's fifth component. - - - Initializes a new instance of the class. - The value of the tuple's first component. - The value of the tuple's second component. - The value of the tuple's third component. - The value of the tuple's fourth component - The value of the tuple's fifth component. - - - Returns a value that indicates whether the current object is equal to a specified object. - The object to compare with this instance. - true if the current instance is equal to the specified object; otherwise, false. - - - Returns the hash code for the current object. - A 32-bit signed integer hash code. - - - Gets the value of the current object's first component. - The value of the current object's first component. - - - Gets the value of the current object's second component. - The value of the current object's second component. - - - Gets the value of the current object's third component. - The value of the current object's third component. - - - Gets the value of the current object's fourth component. - The value of the current object's fourth component. - - - Gets the value of the current object's fifth component. - The value of the current object's fifth component. - - - Returns a string that represents the value of this instance. - The string representation of this object. - - - Compares the current object to a specified object by using a specified comparer and returns an integer that indicates whether the current object is before, after, or in the same position as the specified object in the sort order. - An object to compare with the current instance. - An object that provides custom rules for comparison. -

A signed integer that indicates the relative position of this instance and other in the sort order, as shown in the following table.

-
Value

-

Description

-

A negative integer

-

This instance precedes other.

-

Zero

-

This instance and other have the same position in the sort order.

-

A positive integer

-

This instance follows other.

-

-
- other is not a object. -
- - Returns a value that indicates whether the current object is equal to a specified object based on a specified comparison method. - The object to compare with this instance. - An object that defines the method to use to evaluate whether the two objects are equal. - true if the current instance is equal to the specified object; otherwise, false. - - - Calculates the hash code for the current object by using a specified computation method. - An object whose method calculates the hash code of the current object. - A 32-bit signed integer hash code. - - - Compares the current object to a specified object and returns an integer that indicates whether the current object is before, after, or in the same position as the specified object in the sort order. - An object to compare with the current instance. -

A signed integer that indicates the relative position of this instance and obj in the sort order, as shown in the following table.

-
Value

-

Description

-

A negative integer

-

This instance precedes obj.

-

Zero

-

This instance and obj have the same position in the sort order.

-

A positive integer

-

This instance follows obj.

-

-
- obj is not a object. -
- - Represents a 6-tuple, or sextuple. - The type of the tuple's first component. - The type of the tuple's second component. - The type of the tuple's third component. - The type of the tuple's fourth component. - The type of the tuple's fifth component. - The type of the tuple's sixth component. - - - Initializes a new instance of the class. - The value of the tuple's first component. - The value of the tuple's second component. - The value of the tuple's third component. - The value of the tuple's fourth component - The value of the tuple's fifth component. - The value of the tuple's sixth component. - - - Returns a value that indicates whether the current object is equal to a specified object. - The object to compare with this instance. - true if the current instance is equal to the specified object; otherwise, false. - - - Returns the hash code for the current object. - A 32-bit signed integer hash code. - - - Gets the value of the current object's first component. - The value of the current object's first component. - - - Gets the value of the current object's second component. - The value of the current object's second component. - - - Gets the value of the current object's third component. - The value of the current object's third component. - - - Gets the value of the current object's fourth component. - The value of the current object's fourth component. - - - Gets the value of the current object's fifth component. - The value of the current object's fifth component. - - - Gets the value of the current object's sixth component. - The value of the current object's sixth component. - - - Returns a string that represents the value of this instance. - The string representation of this object. - - - Compares the current object to a specified object by using a specified comparer and returns an integer that indicates whether the current object is before, after, or in the same position as the specified object in the sort order. - An object to compare with the current instance. - An object that provides custom rules for comparison. -

A signed integer that indicates the relative position of this instance and other in the sort order, as shown in the following table.

-
Value

-

Description

-

A negative integer

-

This instance precedes other.

-

Zero

-

This instance and other have the same position in the sort order.

-

A positive integer

-

This instance follows other.

-

-
- other is not a object. -
- - Returns a value that indicates whether the current object is equal to a specified object based on a specified comparison method. - The object to compare with this instance. - An object that defines the method to use to evaluate whether the two objects are equal. - true if the current instance is equal to the specified object; otherwise, false. - - - Calculates the hash code for the current object by using a specified computation method. - An object whose method calculates the hash code of the current object. - A 32-bit signed integer hash code. - - - Compares the current object to a specified object and returns an integer that indicates whether the current object is before, after, or in the same position as the specified object in the sort order. - An object to compare with the current instance. -

A signed integer that indicates the relative position of this instance and obj in the sort order, as shown in the following table.

-
Value

-

Description

-

A negative integer

-

This instance precedes obj.

-

Zero

-

This instance and obj have the same position in the sort order.

-

A positive integer

-

This instance follows obj.

-

-
- obj is not a object. -
- - Represents a 7-tuple, or septuple. - The type of the tuple's first component. - The type of the tuple's second component. - The type of the tuple's third component. - The type of the tuple's fourth component. - The type of the tuple's fifth component. - The type of the tuple's sixth component. - The type of the tuple's seventh component. - - - Initializes a new instance of the class. - The value of the tuple's first component. - The value of the tuple's second component. - The value of the tuple's third component. - The value of the tuple's fourth component - The value of the tuple's fifth component. - The value of the tuple's sixth component. - The value of the tuple's seventh component. - - - Returns a value that indicates whether the current object is equal to a specified object. - The object to compare with this instance. - true if the current instance is equal to the specified object; otherwise, false. - - - Returns the hash code for the current object. - A 32-bit signed integer hash code. - - - Gets the value of the current object's first component. - The value of the current object's first component. - - - Gets the value of the current object's second component. - The value of the current object's second component. - - - Gets the value of the current object's third component. - The value of the current object's third component. - - - Gets the value of the current object's fourth component. - The value of the current object's fourth component. - - - Gets the value of the current object's fifth component. - The value of the current object's fifth component. - - - Gets the value of the current object's sixth component. - The value of the current object's sixth component. - - - Gets the value of the current object's seventh component. - The value of the current object's seventh component. - - - Returns a string that represents the value of this instance. - The string representation of this object. - - - Compares the current object to a specified object by using a specified comparer, and returns an integer that indicates whether the current object is before, after, or in the same position as the specified object in the sort order. - An object to compare with the current instance. - An object that provides custom rules for comparison. -

A signed integer that indicates the relative position of this instance and other in the sort order, as shown in the following table.

-
Value

-

Description

-

A negative integer

-

This instance precedes other.

-

Zero

-

This instance and other have the same position in the sort order.

-

A positive integer

-

This instance follows other.

-

-
- other is not a object. -
- - Returns a value that indicates whether the current object is equal to a specified object based on a specified comparison method. - The object to compare with this instance. - An object that defines the method to use to evaluate whether the two objects are equal. - true if the current instance is equal to the specified object; otherwise, false. - - - Calculates the hash code for the current object by using a specified computation method. - An object whose method calculates the hash code of the current object. - A 32-bit signed integer hash code. - - - Compares the current object to a specified object and returns an integer that indicates whether the current object is before, after, or in the same position as the specified object in the sort order. - An object to compare with the current instance. -

A signed integer that indicates the relative position of this instance and obj in the sort order, as shown in the following table.

-
Value

-

Description

-

A negative integer

-

This instance precedes obj.

-

Zero

-

This instance and obj have the same position in the sort order.

-

A positive integer

-

This instance follows obj.

-

-
- obj is not a object. -
- - Represents an n-tuple, where n is 8 or greater. - The type of the tuple's first component. - The type of the tuple's second component. - The type of the tuple's third component. - The type of the tuple's fourth component. - The type of the tuple's fifth component. - The type of the tuple's sixth component. - The type of the tuple's seventh component. - Any generic Tuple object that defines the types of the tuple's remaining components. - - - Initializes a new instance of the class. - The value of the tuple's first component. - The value of the tuple's second component. - The value of the tuple's third component. - The value of the tuple's fourth component - The value of the tuple's fifth component. - The value of the tuple's sixth component. - The value of the tuple's seventh component. - Any generic Tuple object that contains the values of the tuple's remaining components. - rest is not a generic Tuple object. - - - Returns a value that indicates whether the current object is equal to a specified object. - The object to compare with this instance. - true if the current instance is equal to the specified object; otherwise, false. - - - Calculates the hash code for the current object. - A 32-bit signed integer hash code. - - - Gets the value of the current object's first component. - The value of the current object's first component. - - - Gets the value of the current object's second component. - The value of the current object's second component. - - - Gets the value of the current object's third component. - The value of the current object's third component. - - - Gets the value of the current object's fourth component. - The value of the current object's fourth component. - - - Gets the value of the current object's fifth component. - The value of the current object's fifth component. - - - Gets the value of the current object's sixth component. - The value of the current object's sixth component. - - - Gets the value of the current object's seventh component. - The value of the current object's seventh component. - - - Gets the current object's remaining components. - The value of the current object's remaining components. - - - Returns a string that represents the value of this instance. - The string representation of this object. - - - Compares the current object to a specified object by using a specified comparer and returns an integer that indicates whether the current object is before, after, or in the same position as the specified object in the sort order. - An object to compare with the current instance. - An object that provides custom rules for comparison. -

A signed integer that indicates the relative position of this instance and other in the sort order, as shown in the following table.

-
Value

-

Description

-

A negative integer

-

This instance precedes other.

-

Zero

-

This instance and other have the same position in the sort order.

-

A positive integer

-

This instance follows other.

-

-
- other is not a object. -
- - Returns a value that indicates whether the current object is equal to a specified object based on a specified comparison method. - The object to compare with this instance. - An object that defines the method to use to evaluate whether the two objects are equal. - true if the current instance is equal to the specified object; otherwise, false. - - - Calculates the hash code for the current object by using a specified computation method. - An object whose method calculates the hash code of the current object. - A 32-bit signed integer hash code. - - - Compares the current object to a specified object and returns an integer that indicates whether the current object is before, after, or in the same position as the specified object in the sort order. - An object to compare with the current instance. -

A signed integer that indicates the relative position of this instance and obj in the sort order, as shown in the following table.

-
Value

-

Description

-

A negative integer

-

This instance precedes obj.

-

Zero

-

This instance and obj have the same position in the sort order.

-

A positive integer

-

This instance follows obj.

-

-
- obj is not a object. -
- - Provides static methods for creating tuple objects. - - - Creates a new 8-tuple, or octuple. - The value of the first component of the tuple. - The value of the second component of the tuple. - The value of the third component of the tuple. - The value of the fourth component of the tuple. - The value of the fifth component of the tuple. - The value of the sixth component of the tuple. - The value of the seventh component of the tuple. - The value of the eighth component of the tuple. - The type of the first component of the tuple. - The type of the second component of the tuple. - The type of the third component of the tuple. - The type of the fourth component of the tuple. - The type of the fifth component of the tuple. - The type of the sixth component of the tuple. - The type of the seventh component of the tuple. - The type of the eighth component of the tuple. - An 8-tuple (octuple) whose value is (item1, item2, item3, item4, item5, item6, item7, item8). - - - Creates a new 7-tuple, or septuple. - The value of the first component of the tuple. - The value of the second component of the tuple. - The value of the third component of the tuple. - The value of the fourth component of the tuple. - The value of the fifth component of the tuple. - The value of the sixth component of the tuple. - The value of the seventh component of the tuple. - The type of the first component of the tuple. - The type of the second component of the tuple. - The type of the third component of the tuple. - The type of the fourth component of the tuple. - The type of the fifth component of the tuple. - The type of the sixth component of the tuple. - The type of the seventh component of the tuple. - A 7-tuple whose value is (item1, item2, item3, item4, item5, item6, item7). - - - Creates a new 6-tuple, or sextuple. - The value of the first component of the tuple. - The value of the second component of the tuple. - The value of the third component of the tuple. - The value of the fourth component of the tuple. - The value of the fifth component of the tuple. - The value of the sixth component of the tuple. - The type of the first component of the tuple. - The type of the second component of the tuple. - The type of the third component of the tuple. - The type of the fourth component of the tuple. - The type of the fifth component of the tuple. - The type of the sixth component of the tuple. - A 6-tuple whose value is (item1, item2, item3, item4, item5, item6). - - - Creates a new 5-tuple, or quintuple. - The value of the first component of the tuple. - The value of the second component of the tuple. - The value of the third component of the tuple. - The value of the fourth component of the tuple. - The value of the fifth component of the tuple. - The type of the first component of the tuple. - The type of the second component of the tuple. - The type of the third component of the tuple. - The type of the fourth component of the tuple. - The type of the fifth component of the tuple. - A 5-tuple whose value is (item1, item2, item3, item4, item5). - - - Creates a new 4-tuple, or quadruple. - The value of the first component of the tuple. - The value of the second component of the tuple. - The value of the third component of the tuple. - The value of the fourth component of the tuple. - The type of the first component of the tuple. - The type of the second component of the tuple. - The type of the third component of the tuple. - The type of the fourth component of the tuple. - A 4-tuple whose value is (item1, item2, item3, item4). - - - Creates a new 3-tuple, or triple. - The value of the first component of the tuple. - The value of the second component of the tuple. - The value of the third component of the tuple. - The type of the first component of the tuple. - The type of the second component of the tuple. - The type of the third component of the tuple. - A 3-tuple whose value is (item1, item2, item3). - - - Creates a new 2-tuple, or pair. - The value of the first component of the tuple. - The value of the second component of the tuple. - The type of the first component of the tuple. - The type of the second component of the tuple. - A 2-tuple whose value is (item1, item2). - - - Creates a new 1-tuple, or singleton. - The value of the only component of the tuple. - The type of the only component of the tuple. - A tuple whose value is (item1). - - - Provides extension methods for tuples to interoperate with language support for tuples in C#. - - - Deconstructs a tuple with 21 elements into separate variables. - The 21-element tuple to deconstruct into 21 separate variables. - The value of the first element. - The value of the second element. - The value of the third element. - The value of the fourth element. - The value of the fifth element. - The value of the sixth element. - The value of the seventh element. - The value of the eighth element, or value.Rest.Item1. - The value of the ninth element, or value.Rest.Item2. - The value of the tenth element, or value.Rest.Item3. - The value of the eleventh element, or value.Rest.Item4. - The value of the twelfth element, or value.Rest.Item5. - The value of the thirteenth element, or value.Rest.Item6. - The value of the fourteenth element, or value.Rest.Item7. - The value of the fifteenth element, or value.Rest.Rest.Item1. - The value of the sixteenth element, or value.Rest.Rest.Item2. - The value of the seventeenth element, or value.Rest.Rest.Item3. - The value of the eighteenth element, or value.Rest.Rest.Item4. - The value of the nineteenth element, or value.Rest.Rest.Item5. - The value of the twentieth element, or value.Rest.Rest.Item6. - The value of the twenty-first element, or value.Rest.Rest.Item7. - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - The type of the eighth element. - The type of the ninth element. - The type of the tenth element. - The type of the eleventh element. - The type of the twelfth element. - The type of the thirteenth element. - The type of the fourteenth element. - The type of the fifteenth element. - The type of the sixteenth element. - The type of the seventeenth element. - The type of the eighteenth element. - The type of the nineteenth element. - The type of the twentieth element. - The type of the twenty-first element. - - - Deconstructs a tuple with 20 elements into separate variables. - The 20-element tuple to deconstruct into 20 separate variables. - The value of the first element. - The value of the second element. - The value of the third element. - The value of the fourth element. - The value of the fifth element. - The value of the sixth element. - The value of the seventh element. - The value of the eighth element, or value.Rest.Item1. - The value of the ninth element, or value.Rest.Item2. - The value of the tenth element, or value.Rest.Item3. - The value of the eleventh element, or value.Rest.Item4. - The value of the twelfth element, or value.Rest.Item5. - The value of the thirteenth element, or value.Rest.Item6. - The value of the fourteenth element, or value.Rest.Item7. - The value of the fifteenth element, or value.Rest.Rest.Item1. - The value of the sixteenth element, or value.Rest.Rest.Item2. - The value of the seventeenth element, or value.Rest.Rest.Item3. - The value of the eighteenth element, or value.Rest.Rest.Item4. - The value of the nineteenth element, or value.Rest.Rest.Item5. - The value of the twentieth element, or value.Rest.Rest.Item6. - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - The type of the eighth element. - The type of the ninth element. - The type of the tenth element. - The type of the eleventh element. - The type of the twelfth element. - The type of the thirteenth element. - The type of the fourteenth element. - The type of the fifteenth element. - The type of the sixteenth element. - The type of the seventeenth element. - The type of the eighteenth element. - The type of the nineteenth element. - The type of the twentieth element. - - - Deconstructs a tuple with 19 elements into separate variables. - The 19-element tuple to deconstruct into 19 separate variables. - The value of the first element. - The value of the second element. - The value of the third element. - The value of the fourth element. - The value of the fifth element. - The value of the sixth element. - The value of the seventh element. - The value of the eighth element, or value.Rest.Item1. - The value of the ninth element, or value.Rest.Item2. - The value of the tenth element, or value.Rest.Item3. - The value of the eleventh element, or value.Rest.Item4. - The value of the twelfth element, or value.Rest.Item5. - The value of the thirteenth element, or value.Rest.Item6. - The value of the fourteenth element, or value.Rest.Item7. - The value of the fifteenth element, or value.Rest.Rest.Item1. - The value of the sixteenth element, or value.Rest.Rest.Item2. - The value of the seventeenth element, or value.Rest.Rest.Item3. - The value of the eighteenth element, or value.Rest.Rest.Item4. - The value of the nineteenth element, or value.Rest.Rest.Item5. - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - The type of the eighth element. - The type of the ninth element. - The type of the tenth element. - The type of the eleventh element. - The type of the twelfth element. - The type of the thirteenth element. - The type of the fourteenth element. - The type of the fifteenth element. - The type of the sixteenth element. - The type of the seventeenth element. - The type of the eighteenth element. - The type of the nineteenth element. - - - Deconstructs a tuple with 18 elements into separate variables. - The 18-element tuple to deconstruct into 18 separate variables. - The value of the first element. - The value of the second element. - The value of the third element. - The value of the fourth element. - The value of the fifth element. - The value of the sixth element. - The value of the seventh element. - The value of the eighth element, or value.Rest.Item1. - The value of the ninth element, or value.Rest.Item2. - The value of the tenth element, or value.Rest.Item3. - The value of the eleventh element, or value.Rest.Item4. - The value of the twelfth element, or value.Rest.Item5. - The value of the thirteenth element, or value.Rest.Item6. - The value of the fourteenth element, or value.Rest.Item7. - The value of the fifteenth element, or value.Rest.Rest.Item1. - The value of the sixteenth element, or value.Rest.Rest.Item2. - The value of the seventeenth element, or value.Rest.Rest.Item3. - The value of the eighteenth element, or value.Rest.Rest.Item4. - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - The type of the eighth element. - The type of the ninth element. - The type of the tenth element. - The type of the eleventh element. - The type of the twelfth element. - The type of the thirteenth element. - The type of the fourteenth element. - The type of the fifteenth element. - The type of the sixteenth element. - The type of the seventeenth element. - The type of the eighteenth element. - - - Deconstructs a tuple with 17 elements into separate variables. - The 17-element tuple to deconstruct into 17 separate variables. - The value of the first element. - The value of the second element. - The value of the third element. - The value of the fourth element. - The value of the fifth element. - The value of the sixth element. - The value of the seventh element. - The value of the eighth element, or value.Rest.Item1. - The value of the ninth element, or value.Rest.Item2. - The value of the tenth element, or value.Rest.Item3. - The value of the eleventh element, or value.Rest.Item4. - The value of the twelfth element, or value.Rest.Item5. - The value of the thirteenth element, or value.Rest.Item6. - The value of the fourteenth element, or value.Rest.Item7. - The value of the fifteenth element, or value.Rest.Rest.Item1. - The value of the sixteenth element, or value.Rest.Rest.Item2. - The value of the seventeenth element, or value.Rest.Rest.Item3. - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - The type of the eighth element. - The type of the ninth element. - The type of the tenth element. - The type of the eleventh element. - The type of the twelfth element. - The type of the thirteenth element. - The type of the fourteenth element. - The type of the fifteenth element. - The type of the sixteenth element. - The type of the seventeenth element. - - - Deconstructs a tuple with 16 elements into separate variables. - The 16-element tuple to deconstruct into 16 separate variables. - The value of the first element. - The value of the second element. - The value of the third element. - The value of the fourth element. - The value of the fifth element. - The value of the sixth element. - The value of the seventh element. - The value of the eighth element, or value.Rest.Item1. - The value of the ninth element, or value.Rest.Item2. - The value of the tenth element, or value.Rest.Item3. - The value of the eleventh element, or value.Rest.Item4. - The value of the twelfth element, or value.Rest.Item5. - The value of the thirteenth element, or value.Rest.Item6. - The value of the fourteenth element, or value.Rest.Item7. - The value of the fifteenth element, or value.Rest.Rest.Item1. - The value of the sixteenth element, or value.Rest.Rest.Item2. - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - The type of the eighth element. - The type of the ninth element. - The type of the tenth element. - The type of the eleventh element. - The type of the twelfth element. - The type of the thirteenth element. - The type of the fourteenth element. - The type of the fifteenth element. - The type of the sixteenth element. - - - Deconstructs a tuple with 15 elements into separate variables. - The 15-element tuple to deconstruct into 15 separate variables. - The value of the first element. - The value of the second element. - The value of the third element. - The value of the fourth element. - The value of the fifth element. - The value of the sixth element. - The value of the seventh element. - The value of the eighth element, or value.Rest.Item1. - The value of the ninth element, or value.Rest.Item2. - The value of the tenth element, or value.Rest.Item3. - The value of the eleventh element, or value.Rest.Item4. - The value of the twelfth element, or value.Rest.Item5. - The value of the thirteenth element, or value.Rest.Item6. - The value of the fourteenth element, or value.Rest.Item7. - The value of the fifteenth element, or value.Rest.Rest.Item1. - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - The type of the eighth element. - The type of the ninth element. - The type of the tenth element. - The type of the eleventh element. - The type of the twelfth element. - The type of the thirteenth element. - The type of the fourteenth element. - The type of the fifteenth element. - - - Deconstructs a tuple with 14 elements into separate variables. - The 14-element tuple to deconstruct into 14 separate variables. - The value of the first element. - The value of the second element. - The value of the third element. - The value of the fourth element. - The value of the fifth element. - The value of the sixth element. - The value of the seventh element. - The value of the eighth element, or value.Rest.Item1. - The value of the ninth element, or value.Rest.Item2. - The value of the tenth element, or value.Rest.Item3. - The value of the eleventh element, or value.Rest.Item4. - The value of the twelfth element, or value.Rest.Item5. - The value of the thirteenth element, or value.Rest.Item6. - The value of the fourteenth element, or value.Rest.Item7. - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - The type of the eighth element. - The type of the ninth element. - The type of the tenth element. - The type of the eleventh element. - The type of the twelfth element. - The type of the thirteenth element. - The type of the fourteenth element. - - - Deconstructs a tuple with 13 elements into separate variables. - The 13-element tuple to deconstruct into 13 separate variables. - The value of the first element. - The value of the second element. - The value of the third element. - The value of the fourth element. - The value of the fifth element. - The value of the sixth element. - The value of the seventh element. - The value of the eighth element, or value.Rest.Item1. - The value of the ninth element, or value.Rest.Item2. - The value of the tenth element, or value.Rest.Item3. - The value of the eleventh element, or value.Rest.Item4. - The value of the twelfth element, or value.Rest.Item5. - The value of the thirteenth element, or value.Rest.Item6. - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - The type of the eighth element. - The type of the ninth element. - The type of the tenth element. - The type of the eleventh element. - The type of the twelfth element. - The type of the thirteenth element. - - - Deconstructs a tuple with 12 elements into separate variables. - The 12-element tuple to deconstruct into 12 separate variables. - The value of the first element. - The value of the second element. - The value of the third element. - The value of the fourth element. - The value of the fifth element. - The value of the sixth element. - The value of the seventh element. - The value of the eighth element, or value.Rest.Item1. - The value of the ninth element, or value.Rest.Item2. - The value of the tenth element, or value.Rest.Item3. - The value of the eleventh element, or value.Rest.Item4. - The value of the twelfth element, or value.Rest.Item5. - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - The type of the eighth element. - The type of the ninth element. - The type of the tenth element. - The type of the eleventh element. - The type of the twelfth element. - - - Deconstructs a tuple with 11 elements into separate variables. - The 11-element tuple to deconstruct into 11 separate variables. - The value of the first element. - The value of the second element. - The value of the third element. - The value of the fourth element. - The value of the fifth element. - The value of the sixth element. - The value of the seventh element. - The value of the eighth element, or value.Rest.Item1. - The value of the ninth element, or value.Rest.Item2. - The value of the tenth element, or value.Rest.Item3. - The value of the eleventh element, or value.Rest.Item4. - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - The type of the eighth element. - The type of the ninth element. - The type of the tenth element. - The type of the eleventh element. - - - Deconstructs a tuple with 10 elements into separate variables. - The 10-element tuple to deconstruct into 10 separate variables. - The value of the first element. - The value of the second element. - The value of the third element. - The value of the fourth element. - The value of the fifth element. - The value of the sixth element. - The value of the seventh element. - The value of the eighth element, or value.Rest.Item1. - The value of the ninth element, or value.Rest.Item2. - The value of the tenth element, or value.Rest.Item3. - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - The type of the eighth element. - The type of the ninth element. - The type of the tenth element. - - - Deconstructs a tuple with 9 elements into separate variables. - The 9-element tuple to deconstruct into 9 separate variables. - The value of the first element. - The value of the second element. - The value of the third element. - The value of the fourth element. - The value of the fifth element. - The value of the sixth element. - The value of the seventh element. - The value of the eighth element, or value.Rest.Item1. - The value of the ninth element, or value.Rest.Item2. - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - The type of the eighth element. - The type of the ninth element. - - - Deconstructs a tuple with 8 elements into separate variables. - The 8-element tuple to deconstruct into 8 separate variables. - The value of the first element. - The value of the second element. - The value of the third element. - The value of the fourth element. - The value of the fifth element. - The value of the sixth element. - The value of the seventh element. - The value of the eighth element, or value.Rest.Item1. - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - The type of the eighth element. - - - Deconstructs a tuple with 7 elements into separate variables. - The 7-element tuple to deconstruct into 7 separate variables. - The value of the first element. - The value of the second element. - The value of the third element. - The value of the fourth element. - The value of the fifth element. - The value of the sixth element. - The value of the seventh element. - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - - - Deconstructs a tuple with 6 elements into separate variables. - The 6-element tuple to deconstruct into 6 separate variables. - The value of the first element. - The value of the second element. - The value of the third element. - The value of the fourth element. - The value of the fifth element. - The value of the sixth element. - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - - - Deconstructs a tuple with 5 elements into separate variables. - The 5-element tuple to deconstruct into 5 separate variables. - The value of the first element. - The value of the second element. - The value of the third element. - The value of the fourth element. - The value of the fifth element. - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - - - Deconstructs a tuple with 4 elements into separate variables. - The 4-element tuple to deconstruct into 4 separate variables. - The value of the first element. - The value of the second element. - The value of the third element. - The value of the fourth element. - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - - - Deconstructs a tuple with 3 elements into separate variables. - The 3-element tuple to deconstruct into 3 separate variables. - The value of the first element. - The value of the second element. - The value of the third element. - The type of the first element. - The type of the second element. - The type of the third element. - - - Deconstructs a tuple with 2 elements into separate variables. - The 2-element tuple to deconstruct into 2 separate variables. - The value of the first element. - The value of the second element. - The type of the first element. - The type of the second element. - - - Deconstructs a tuple with 1 element into a separate variable. - The 1-element tuple to deconstruct into a separate variable. - The value of the single element. - The type of the single element. - - - Converts an instance of the ValueTuple structure to an instance of the Tuple class. - The value tuple instance to convert to a tuple. - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - The type of the eighth element, or value.Rest.Item1. - The type of the ninth element, or value.Rest.Item2. - The type of the tenth element, or value.Rest.Item3. - The type of the eleventh element, or value.Rest.Item4. - The type of the twelfth element, or value.Rest.Item5. - The type of the thirteenth element, or value.Rest.Item6. - The type of the fourteenth element, or value.Rest.Item7. - The type of the fifteenth element., or value.Rest.Rest.Item1. - The type of the sixteenth element, ., or value.Rest.Rest.Item2. - The type of the seventeenth element., or value.Rest.Rest.Item3. - The type of the eighteenth element., or value.Rest.Rest.Item4. - The type of the nineteenth element., or value.Rest.Rest.Item5. - The type of the twentieth element., or value.Rest.Rest.Item6. - The type of the twenty-first element., or value.Rest.Rest.Item7. - The converted tuple. - - - Converts an instance of the ValueTuple structure to an instance of the Tuple class. - The value tuple instance to convert to a tuple. - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - The type of the eighth element, or value.Rest.Item1. - The type of the ninth element, or value.Rest.Item2. - The type of the tenth element, or value.Rest.Item3. - The type of the eleventh element, or value.Rest.Item4. - The type of the twelfth element, or value.Rest.Item5. - The type of the thirteenth element, or value.Rest.Item6. - The type of the fourteenth element, or value.Rest.Item7. - The type of the fifteenth element., or value.Rest.Rest.Item1. - The type of the sixteenth element, ., or value.Rest.Rest.Item2. - The type of the seventeenth element., or value.Rest.Rest.Item3. - The type of the eighteenth element., or value.Rest.Rest.Item4. - The type of the nineteenth element., or value.Rest.Rest.Item5. - The type of the twentieth element., or value.Rest.Rest.Item6. - The converted tuple. - - - Converts an instance of the ValueTuple structure to an instance of the Tuple class. - The value tuple instance to convert to a tuple. - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - The type of the eighth element, or value.Rest.Item1. - The type of the ninth element, or value.Rest.Item2. - The type of the tenth element, or value.Rest.Item3. - The type of the eleventh element, or value.Rest.Item4. - The type of the twelfth element, or value.Rest.Item5. - The type of the thirteenth element, or value.Rest.Item6. - The type of the fourteenth element, or value.Rest.Item7. - The type of the fifteenth element., or value.Rest.Rest.Item1. - The type of the sixteenth element, ., or value.Rest.Rest.Item2. - The type of the seventeenth element., or value.Rest.Rest.Item3. - The type of the eighteenth element., or value.Rest.Rest.Item4. - The type of the nineteenth element., or value.Rest.Rest.Item5. - The converted tuple. - - - Converts an instance of the ValueTuple structure to an instance of the Tuple class. - The value tuple instance to convert to a tuple. - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - The type of the eighth element, or value.Rest.Item1. - The type of the ninth element, or value.Rest.Item2. - The type of the tenth element, or value.Rest.Item3. - The type of the eleventh element, or value.Rest.Item4. - The type of the twelfth element, or value.Rest.Item5. - The type of the thirteenth element, or value.Rest.Item6. - The type of the fourteenth element, or value.Rest.Item7. - The type of the fifteenth element., or value.Rest.Rest.Item1. - The type of the sixteenth element, ., or value.Rest.Rest.Item2. - The type of the seventeenth element., or value.Rest.Rest.Item3. - The type of the eighteenth element., or value.Rest.Rest.Item4. - The converted tuple. - - - Converts an instance of the ValueTuple structure to an instance of the Tuple class. - The value tuple instance to convert to a tuple. - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - The type of the eighth element, or value.Rest.Item1. - The type of the ninth element, or value.Rest.Item2. - The type of the tenth element, or value.Rest.Item3. - The type of the eleventh element, or value.Rest.Item4. - The type of the twelfth element, or value.Rest.Item5. - The type of the thirteenth element, or value.Rest.Item6. - The type of the fourteenth element, or value.Rest.Item7. - The type of the fifteenth element., or value.Rest.Rest.Item1. - The type of the sixteenth element, ., or value.Rest.Rest.Item2. - The type of the seventeenth element., or value.Rest.Rest.Item3. - The converted tuple. - - - Converts an instance of the ValueTuple structure to an instance of the Tuple class. - The value tuple instance to convert to a tuple. - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - The type of the eighth element, or value.Rest.Item1. - The type of the ninth element, or value.Rest.Item2. - The type of the tenth element, or value.Rest.Item3. - The type of the eleventh element, or value.Rest.Item4. - The type of the twelfth element, or value.Rest.Item5. - The type of the thirteenth element, or value.Rest.Item6. - The type of the fourteenth element, or value.Rest.Item7. - The type of the fifteenth element., or value.Rest.Rest.Item1. - The type of the sixteenth element, ., or value.Rest.Rest.Item2. - The converted tuple. - - - Converts an instance of the ValueTuple structure to an instance of the Tuple class. - The value tuple instance to convert to a tuple. - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - The type of the eighth element, or value.Rest.Item1. - The type of the ninth element, or value.Rest.Item2. - The type of the tenth element, or value.Rest.Item3. - The type of the eleventh element, or value.Rest.Item4. - The type of the twelfth element, or value.Rest.Item5. - The type of the thirteenth element, or value.Rest.Item6. - The type of the fourteenth element, or value.Rest.Item7. - The type of the fifteenth element., or value.Rest.Rest.Item1. - The converted tuple. - - - Converts an instance of the ValueTuple structure to an instance of the Tuple class. - The value tuple instance to convert to a tuple. - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - The type of the eighth element, or value.Rest.Item1. - The type of the ninth element, or value.Rest.Item2. - The type of the tenth element, or value.Rest.Item3. - The type of the eleventh element, or value.Rest.Item4. - The type of the twelfth element, or value.Rest.Item5. - The type of the thirteenth element, or value.Rest.Item6. - The type of the fourteenth element, or value.Rest.Item7. - The converted tuple. - - - Converts an instance of the ValueTuple structure to an instance of the Tuple class. - The value tuple instance to convert to a tuple. - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - The type of the eighth element, or value.Rest.Item1. - The type of the ninth element, or value.Rest.Item2. - The type of the tenth element, or value.Rest.Item3. - The type of the eleventh element, or value.Rest.Item4. - The type of the twelfth element, or value.Rest.Item5. - The type of the thirteenth element, or value.Rest.Item6. - The converted tuple. - - - Converts an instance of the ValueTuple structure to an instance of the Tuple class. - The value tuple instance to convert to a tuple. - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - The type of the eighth element, or value.Rest.Item1. - The type of the ninth element, or value.Rest.Item2. - The type of the tenth element, or value.Rest.Item3. - The type of the eleventh element, or value.Rest.Item4. - The type of the twelfth element, or value.Rest.Item5. - The converted tuple. - - - Converts an instance of the ValueTuple structure to an instance of the Tuple class. - The value tuple instance to convert to a tuple. - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - The type of the eighth element, or value.Rest.Item1. - The type of the ninth element, or value.Rest.Item2. - The type of the tenth element, or value.Rest.Item3. - The type of the eleventh element, or value.Rest.Item4. - The converted tuple. - - - Converts an instance of the ValueTuple structure to an instance of the Tuple class. - The value tuple instance to convert to a tuple. - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - The type of the eighth element, or value.Rest.Item1. - The type of the ninth element, or value.Rest.Item2. - The type of the tenth element, or value.Rest.Item3. - The converted tuple. - - - Converts an instance of the ValueTuple structure to an instance of the Tuple class. - The value tuple instance to convert to a tuple. - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - The type of the eighth element, or value.Rest.Item1. - The type of the ninth element, or value.Rest.Item2. - The converted tuple. - - - Converts an instance of the ValueTuple structure to an instance of the Tuple class. - The value tuple instance to convert to a tuple. - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - The type of the eighth element, or value.Rest.Item1. - The converted tuple. - - - Converts an instance of the ValueTuple structure to an instance of the Tuple class. - The value tuple instance to convert to a tuple. - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - The converted tuple. - - - Converts an instance of the ValueTuple structure to an instance of the Tuple class. - The value tuple instance to convert to a tuple. - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The converted tuple. - - - Converts an instance of the ValueTuple structure to an instance of the Tuple class. - The value tuple instance to convert to a tuple. - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The converted tuple. - - - Converts an instance of the ValueTuple structure to an instance of the Tuple class. - The value tuple instance to convert to a tuple. - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The converted tuple. - - - Converts an instance of the ValueTuple structure to an instance of the Tuple class. - The value tuple instance to convert to a tuple. - The type of the first element. - The type of the second element. - The type of the third element. - The converted tuple. - - - Converts an instance of the ValueTuple structure to an instance of the Tuple class. - The value tuple instance to convert to a tuple. - The type of the first element. - The type of the second element. - The converted tuple. - - - Converts an instance of the ValueTuple structure to an instance of the Tuple class. - The value tuple instance to convert to a tuple. - The type of the first element. - The converted tuple. - - - Converts an instance of the Tuple class to an instance of the ValueTuple structure. - The tuple object to convert to a value tuple - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - The type of the eighth element, or value.Rest.Item1. - The type of the ninth element, or value.Rest.Item2. - The type of the tenth element, or value.Rest.Item3. - The type of the eleventh element, or value.Rest.Item4. - The type of the twelfth element, or value.Rest.Item5. - The type of the thirteenth element, or value.Rest.Item6. - The type of the fourteenth element, or value.Rest.Item7. - The type of the fifteenth element., or value.Rest.Rest.Item1. - The type of the sixteenth element, ., or value.Rest.Rest.Item2. - The type of the seventeenth element., or value.Rest.Rest.Item3. - The type of the eighteenth element., or value.Rest.Rest.Item4. - The type of the nineteenth element., or value.Rest.Rest.Item5. - The type of the twentieth element., or value.Rest.Rest.Item6. - The type of the twenty-first element., or value.Rest.Rest.Item7. - The converted value tuple instance. - - - Converts an instance of the Tuple class to an instance of the ValueTuple structure. - The tuple object to convert to a value tuple - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - The type of the eighth element, or value.Rest.Item1. - The type of the ninth element, or value.Rest.Item2. - The type of the tenth element, or value.Rest.Item3. - The type of the eleventh element, or value.Rest.Item4. - The type of the twelfth element, or value.Rest.Item5. - The type of the thirteenth element, or value.Rest.Item6. - The type of the fourteenth element, or value.Rest.Item7. - The type of the fifteenth element., or value.Rest.Rest.Item1. - The type of the sixteenth element, ., or value.Rest.Rest.Item2. - The type of the seventeenth element., or value.Rest.Rest.Item3. - The type of the eighteenth element., or value.Rest.Rest.Item4. - The type of the nineteenth element., or value.Rest.Rest.Item5. - The type of the twentieth element., or value.Rest.Rest.Item6. - The converted value tuple instance. - - - Converts an instance of the Tuple class to an instance of the ValueTuple structure. - The tuple object to convert to a value tuple - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - The type of the eighth element, or value.Rest.Item1. - The type of the ninth element, or value.Rest.Item2. - The type of the tenth element, or value.Rest.Item3. - The type of the eleventh element, or value.Rest.Item4. - The type of the twelfth element, or value.Rest.Item5. - The type of the thirteenth element, or value.Rest.Item6. - The type of the fourteenth element, or value.Rest.Item7. - The type of the fifteenth element., or value.Rest.Rest.Item1. - The type of the sixteenth element, ., or value.Rest.Rest.Item2. - The type of the seventeenth element., or value.Rest.Rest.Item3. - The type of the eighteenth element., or value.Rest.Rest.Item4. - The type of the nineteenth element., or value.Rest.Rest.Item5. - The converted value tuple instance. - - - Converts an instance of the Tuple class to an instance of the ValueTuple structure. - The tuple object to convert to a value tuple - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - The type of the eighth element, or value.Rest.Item1. - The type of the ninth element, or value.Rest.Item2. - The type of the tenth element, or value.Rest.Item3. - The type of the eleventh element, or value.Rest.Item4. - The type of the twelfth element, or value.Rest.Item5. - The type of the thirteenth element, or value.Rest.Item6. - The type of the fourteenth element, or value.Rest.Item7. - The type of the fifteenth element., or value.Rest.Rest.Item1. - The type of the sixteenth element, ., or value.Rest.Rest.Item2. - The type of the seventeenth element., or value.Rest.Rest.Item3. - The type of the eighteenth element., or value.Rest.Rest.Item4. - The converted value tuple instance. - - - Converts an instance of the Tuple class to an instance of the ValueTuple structure. - The tuple object to convert to a value tuple - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - The type of the eighth element, or value.Rest.Item1. - The type of the ninth element, or value.Rest.Item2. - The type of the tenth element, or value.Rest.Item3. - The type of the eleventh element, or value.Rest.Item4. - The type of the twelfth element, or value.Rest.Item5. - The type of the thirteenth element, or value.Rest.Item6. - The type of the fourteenth element, or value.Rest.Item7. - The type of the fifteenth element., or value.Rest.Rest.Item1. - The type of the sixteenth element, ., or value.Rest.Rest.Item2. - The type of the seventeenth element., or value.Rest.Rest.Item3. - The converted value tuple instance. - - - Converts an instance of the Tuple class to an instance of the ValueTuple structure. - The tuple object to convert to a value tuple - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - The type of the eighth element, or value.Rest.Item1. - The type of the ninth element, or value.Rest.Item2. - The type of the tenth element, or value.Rest.Item3. - The type of the eleventh element, or value.Rest.Item4. - The type of the twelfth element, or value.Rest.Item5. - The type of the thirteenth element, or value.Rest.Item6. - The type of the fourteenth element, or value.Rest.Item7. - The type of the fifteenth element., or value.Rest.Rest.Item1. - The type of the sixteenth element, ., or value.Rest.Rest.Item2. - The converted value tuple instance. - - - Converts an instance of the Tuple class to an instance of the ValueTuple structure. - The tuple object to convert to a value tuple - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - The type of the eighth element, or value.Rest.Item1. - The type of the ninth element, or value.Rest.Item2. - The type of the tenth element, or value.Rest.Item3. - The type of the eleventh element, or value.Rest.Item4. - The type of the twelfth element, or value.Rest.Item5. - The type of the thirteenth element, or value.Rest.Item6. - The type of the fourteenth element, or value.Rest.Item7. - The type of the fifteenth element., or value.Rest.Rest.Item1. - The converted value tuple instance. - - - Converts an instance of the Tuple class to an instance of the ValueTuple structure. - The tuple object to convert to a value tuple - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - The type of the eighth element, or value.Rest.Item1. - The type of the ninth element, or value.Rest.Item2. - The type of the tenth element, or value.Rest.Item3. - The type of the eleventh element, or value.Rest.Item4. - The type of the twelfth element, or value.Rest.Item5. - The type of the thirteenth element, or value.Rest.Item6. - The type of the fourteenth element, or value.Rest.Item7. - The converted value tuple instance. - - - Converts an instance of the Tuple class to an instance of the ValueTuple structure. - The tuple object to convert to a value tuple - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - The type of the eighth element, or value.Rest.Item1. - The type of the ninth element, or value.Rest.Item2. - The type of the tenth element, or value.Rest.Item3. - The type of the eleventh element, or value.Rest.Item4. - The type of the twelfth element, or value.Rest.Item5. - The type of the thirteenth element, or value.Rest.Item6. - The converted value tuple instance. - - - Converts an instance of the Tuple class to an instance of the ValueTuple structure. - The tuple object to convert to a value tuple - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - The type of the eighth element, or value.Rest.Item1. - The type of the ninth element, or value.Rest.Item2. - The type of the tenth element, or value.Rest.Item3. - The type of the eleventh element, or value.Rest.Item4. - The type of the twelfth element, or value.Rest.Item5. - The converted value tuple instance. - - - Converts an instance of the Tuple class to an instance of the ValueTuple structure. - The tuple object to convert to a value tuple - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - The type of the eighth element, or value.Rest.Item1. - The type of the ninth element, or value.Rest.Item2. - The type of the tenth element, or value.Rest.Item3. - The type of the eleventh element, or value.Rest.Item4. - The converted value tuple instance. - - - Converts an instance of the Tuple class to an instance of the ValueTuple structure. - The tuple object to convert to a value tuple - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - The type of the eighth element, or value.Rest.Item1. - The type of the ninth element, or value.Rest.Item2. - The type of the tenth element, or value.Rest.Item3. - The converted value tuple instance. - - - Converts an instance of the Tuple class to an instance of the ValueTuple structure. - The tuple object to convert to a value tuple - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - The type of the eighth element, or value.Rest.Item1. - The type of the ninth element, or value.Rest.Item2. - The converted value tuple instance. - - - Converts an instance of the Tuple class to an instance of the ValueTuple structure. - The tuple object to convert to a value tuple - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - The type of the eighth element, or value.Rest.Item1. - The converted value tuple instance. - - - Converts an instance of the Tuple class to an instance of the ValueTuple structure. - The tuple object to convert to a value tuple - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The type of the seventh element. - The converted value tuple instance. - - - Converts an instance of the Tuple class to an instance of the ValueTuple structure. - The tuple object to convert to a value tuple - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The type of the sixth element. - The converted value tuple instance. - - - Converts an instance of the Tuple class to an instance of the ValueTuple structure. - The tuple object to convert to a value tuple - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The type of the fifth element. - The converted value tuple instance. - - - Converts an instance of the Tuple class to an instance of the ValueTuple structure. - The tuple object to convert to a value tuple - The type of the first element. - The type of the second element. - The type of the third element. - The type of the fourth element. - The converted value tuple instance. - - - Converts an instance of the Tuple class to an instance of the ValueTuple structure. - The tuple object to convert to a value tuple - The type of the first element. - The type of the second element. - The type of the third element. - The converted value tuple instance. - - - Converts an instance of the Tuple class to an instance of the ValueTuple structure. - The tuple object to convert to a value tuple - The type of the first element. - The type of the second element. - The converted value tuple instance. - - - Converts an instance of the Tuple class to an instance of the ValueTuple structure. - The tuple object to convert to a value tuple - The type of the first element. - The converted value tuple instance. - - - Represents type declarations: class types, interface types, array types, value types, enumeration types, type parameters, generic type definitions, and open or closed constructed generic types. - - - Initializes a new instance of the class. - - - Gets the in which the type is declared. For generic types, gets the in which the generic type is defined. - An instance that describes the assembly containing the current type. For generic types, the instance describes the assembly that contains the generic type definition, not the assembly that creates and uses a particular constructed type. - - - Gets the assembly-qualified name of the type, which includes the name of the assembly from which this object was loaded. - The assembly-qualified name of the , which includes the name of the assembly from which the was loaded, or null if the current instance represents a generic type parameter. - - - Gets the attributes associated with the . - A object representing the attribute set of the , unless the represents a generic type parameter, in which case the value is unspecified. - - - Gets the type from which the current directly inherits. - The from which the current directly inherits, or null if the current Type represents the class or an interface. - - - Gets a value indicating whether the current object has type parameters that have not been replaced by specific types. - true if the object is itself a generic type parameter or has type parameters for which specific types have not been supplied; otherwise, false. - - - Gets a that represents the declaring method, if the current represents a type parameter of a generic method. - If the current represents a type parameter of a generic method, a that represents declaring method; otherwise, null. - - - Gets the type that declares the current nested type or generic type parameter. - A object representing the enclosing type, if the current type is a nested type; or the generic type definition, if the current type is a type parameter of a generic type; or the type that declares the generic method, if the current type is a type parameter of a generic method; otherwise, null. - - - Gets a reference to the default binder, which implements internal rules for selecting the appropriate members to be called by . - A reference to the default binder used by the system. - - - Separates names in the namespace of the . This field is read-only. - - - - Represents an empty array of type . This field is read-only. - - - - Determines if the underlying system type of the current object is the same as the underlying system type of the specified . - The object whose underlying system type is to be compared with the underlying system type of the current . For the comparison to succeed, o must be able to be cast or converted to an object of type . - true if the underlying system type of o is the same as the underlying system type of the current ; otherwise, false. This method also returns false if: . o is null. o cannot be cast or converted to a object. - - - Determines if the underlying system type of the current is the same as the underlying system type of the specified . - The object whose underlying system type is to be compared with the underlying system type of the current . - true if the underlying system type of o is the same as the underlying system type of the current ; otherwise, false. - - - Represents the member filter used on attributes. This field is read-only. - - - - Represents the case-sensitive member filter used on names. This field is read-only. - - - - Represents the case-insensitive member filter used on names. This field is read-only. - - - - Returns an array of objects representing a filtered list of interfaces implemented or inherited by the current . - The delegate that compares the interfaces against filterCriteria. - The search criteria that determines whether an interface should be included in the returned array. - An array of objects representing a filtered list of the interfaces implemented or inherited by the current , or an empty array of type if no interfaces matching the filter are implemented or inherited by the current . - filter is null. - A static initializer is invoked and throws an exception. - - - Returns a filtered array of objects of the specified member type. - An object that indicates the type of member to search for. - A bitmask comprised of one or more that specify how the search is conducted. -or- Zero, to return null. - The delegate that does the comparisons, returning true if the member currently being inspected matches the filterCriteria and false otherwise. You can use the FilterAttribute, FilterName, and FilterNameIgnoreCase delegates supplied by this class. The first uses the fields of FieldAttributes, MethodAttributes, and MethodImplAttributes as search criteria, and the other two delegates use String objects as the search criteria. - The search criteria that determines whether a member is returned in the array of MemberInfo objects. The fields of FieldAttributes, MethodAttributes, and MethodImplAttributes can be used in conjunction with the FilterAttribute delegate supplied by this class. - A filtered array of objects of the specified member type. -or- An empty array of type , if the current does not have members of type memberType that match the filter criteria. - filter is null. - - - Gets the fully qualified name of the type, including its namespace but not its assembly. - The fully qualified name of the type, including its namespace but not its assembly; or null if the current instance represents a generic type parameter, an array type, pointer type, or byref type based on a type parameter, or a generic type that is not a generic type definition but contains unresolved type parameters. - - - Gets a combination of flags that describe the covariance and special constraints of the current generic type parameter. - A bitwise combination of values that describes the covariance and special constraints of the current generic type parameter. - The current object is not a generic type parameter. That is, the property returns false. - The invoked method is not supported in the base class. - - - Gets the position of the type parameter in the type parameter list of the generic type or method that declared the parameter, when the object represents a type parameter of a generic type or a generic method. - The position of a type parameter in the type parameter list of the generic type or method that defines the parameter. Position numbers begin at 0. - The current type does not represent a type parameter. That is, returns false. - - - Gets an array of the generic type arguments for this type. - An array of the generic type arguments for this type. - - - Gets the number of dimensions in an array. - An integer that contains the number of dimensions in the current type. - The functionality of this method is unsupported in the base class and must be implemented in a derived class instead. - The current type is not an array. - - - When overridden in a derived class, implements the property and gets a bitmask indicating the attributes associated with the . - A object representing the attribute set of the . - - - Searches for a public instance constructor whose parameters match the types in the specified array. - An array of objects representing the number, order, and type of the parameters for the desired constructor. -or- An empty array of objects, to get a constructor that takes no parameters. Such an empty array is provided by the static field . - An object representing the public instance constructor whose parameters match the types in the parameter type array, if found; otherwise, null. - types is null. -or- One of the elements in types is null. - types is multidimensional. - - - Searches for a constructor whose parameters match the specified argument types and modifiers, using the specified binding constraints. - A bitmask comprised of one or more that specify how the search is conducted. -or- Zero, to return null. - An object that defines a set of properties and enables binding, which can involve selection of an overloaded method, coercion of argument types, and invocation of a member through reflection. -or- A null reference (Nothing in Visual Basic), to use the . - An array of objects representing the number, order, and type of the parameters for the constructor to get. -or- An empty array of the type (that is, Type[] types = new Type[0]) to get a constructor that takes no parameters. -or- . - An array of objects representing the attributes associated with the corresponding element in the parameter type array. The default binder does not process this parameter. - A object representing the constructor that matches the specified requirements, if found; otherwise, null. - types is null. -or- One of the elements in types is null. - types is multidimensional. -or- modifiers is multidimensional. -or- types and modifiers do not have the same length. - - - Searches for a constructor whose parameters match the specified argument types and modifiers, using the specified binding constraints and the specified calling convention. - A bitmask comprised of one or more that specify how the search is conducted. -or- Zero, to return null. - An object that defines a set of properties and enables binding, which can involve selection of an overloaded method, coercion of argument types, and invocation of a member through reflection. -or- A null reference (Nothing in Visual Basic), to use the . - The object that specifies the set of rules to use regarding the order and layout of arguments, how the return value is passed, what registers are used for arguments, and the stack is cleaned up. - An array of objects representing the number, order, and type of the parameters for the constructor to get. -or- An empty array of the type (that is, Type[] types = new Type[0]) to get a constructor that takes no parameters. - An array of objects representing the attributes associated with the corresponding element in the types array. The default binder does not process this parameter. - An object representing the constructor that matches the specified requirements, if found; otherwise, null. - types is null. -or- One of the elements in types is null. - types is multidimensional. -or- modifiers is multidimensional. -or- types and modifiers do not have the same length. - - - When overridden in a derived class, searches for a constructor whose parameters match the specified argument types and modifiers, using the specified binding constraints and the specified calling convention. - A bitmask comprised of one or more that specify how the search is conducted. -or- Zero, to return null. - An object that defines a set of properties and enables binding, which can involve selection of an overloaded method, coercion of argument types, and invocation of a member through reflection. -or- A null reference (Nothing in Visual Basic), to use the . - The object that specifies the set of rules to use regarding the order and layout of arguments, how the return value is passed, what registers are used for arguments, and the stack is cleaned up. - An array of objects representing the number, order, and type of the parameters for the constructor to get. -or- An empty array of the type (that is, Type[] types = new Type[0]) to get a constructor that takes no parameters. - An array of objects representing the attributes associated with the corresponding element in the types array. The default binder does not process this parameter. - A object representing the constructor that matches the specified requirements, if found; otherwise, null. - types is null. -or- One of the elements in types is null. - types is multidimensional. -or- modifiers is multidimensional. -or- types and modifiers do not have the same length. - The current type is a or . - - - Returns all the public constructors defined for the current . - An array of objects representing all the public instance constructors defined for the current , but not including the type initializer (static constructor). If no public instance constructors are defined for the current , or if the current represents a type parameter in the definition of a generic type or generic method, an empty array of type is returned. - - - When overridden in a derived class, searches for the constructors defined for the current , using the specified BindingFlags. - A bitmask comprised of one or more that specify how the search is conducted. -or- Zero, to return null. - An array of objects representing all constructors defined for the current that match the specified binding constraints, including the type initializer if it is defined. Returns an empty array of type if no constructors are defined for the current , if none of the defined constructors match the binding constraints, or if the current represents a type parameter in the definition of a generic type or generic method. - - - Searches for the members defined for the current whose is set. - An array of objects representing all default members of the current . -or- An empty array of type , if the current does not have default members. - - - When overridden in a derived class, returns the of the object encompassed or referred to by the current array, pointer or reference type. - The of the object encompassed or referred to by the current array, pointer, or reference type, or null if the current is not an array or a pointer, or is not passed by reference, or represents a generic type or a type parameter in the definition of a generic type or generic method. - - - Returns the name of the constant that has the specified value, for the current enumeration type. - The value whose name is to be retrieved. - The name of the member of the current enumeration type that has the specified value, or null if no such constant is found. - The current type is not an enumeration. -or- value is neither of the current type nor does it have the same underlying type as the current type. - value is null. - - - Returns the names of the members of the current enumeration type. - An array that contains the names of the members of the enumeration. - The current type is not an enumeration. - - - Returns the underlying type of the current enumeration type. - The underlying type of the current enumeration. - The current type is not an enumeration. -or- The enumeration type is not valid, because it contains more than one instance field. - - - Returns an array of the values of the constants in the current enumeration type. - An array that contains the values. The elements of the array are sorted by the binary values (that is, the unsigned values) of the enumeration constants. - The current type is not an enumeration. - - - Returns the object representing the specified public event. - The string containing the name of an event that is declared or inherited by the current . - The object representing the specified public event that is declared or inherited by the current , if found; otherwise, null. - name is null. - - - When overridden in a derived class, returns the object representing the specified event, using the specified binding constraints. - The string containing the name of an event which is declared or inherited by the current . - A bitmask comprised of one or more that specify how the search is conducted. -or- Zero, to return null. - The object representing the specified event that is declared or inherited by the current , if found; otherwise, null. - name is null. - - - Returns all the public events that are declared or inherited by the current . - An array of objects representing all the public events which are declared or inherited by the current . -or- An empty array of type , if the current does not have public events. - - - When overridden in a derived class, searches for events that are declared or inherited by the current , using the specified binding constraints. - A bitmask comprised of one or more that specify how the search is conducted. -or- Zero, to return null. - An array of objects representing all events that are declared or inherited by the current that match the specified binding constraints. -or- An empty array of type , if the current does not have events, or if none of the events match the binding constraints. - - - Searches for the public field with the specified name. - The string containing the name of the data field to get. - An object representing the public field with the specified name, if found; otherwise, null. - name is null. - This object is a whose method has not yet been called. - - - Searches for the specified field, using the specified binding constraints. - The string containing the name of the data field to get. - A bitmask comprised of one or more that specify how the search is conducted. -or- Zero, to return null. - An object representing the field that matches the specified requirements, if found; otherwise, null. - name is null. - - - Returns all the public fields of the current . - An array of objects representing all the public fields defined for the current . -or- An empty array of type , if no public fields are defined for the current . - - - When overridden in a derived class, searches for the fields defined for the current , using the specified binding constraints. - A bitmask comprised of one or more that specify how the search is conducted. -or- Zero, to return null. - An array of objects representing all fields defined for the current that match the specified binding constraints. -or- An empty array of type , if no fields are defined for the current , or if none of the defined fields match the binding constraints. - - - Returns an array of objects that represent the type arguments of a closed generic type or the type parameters of a generic type definition. - An array of objects that represent the type arguments of a generic type. Returns an empty array if the current type is not a generic type. - The invoked method is not supported in the base class. Derived classes must provide an implementation. - - - Returns an array of objects that represent the constraints on the current generic type parameter. - An array of objects that represent the constraints on the current generic type parameter. - The current object is not a generic type parameter. That is, the property returns false. - - - Returns a object that represents a generic type definition from which the current generic type can be constructed. - A object representing a generic type from which the current type can be constructed. - The current type is not a generic type. That is, returns false. - The invoked method is not supported in the base class. Derived classes must provide an implementation. - - - Returns the hash code for this instance. - The hash code for this instance. - - - Searches for the interface with the specified name. - The string containing the name of the interface to get. For generic interfaces, this is the mangled name. - An object representing the interface with the specified name, implemented or inherited by the current , if found; otherwise, null. - name is null. - The current represents a type that implements the same generic interface with different type arguments. - - - When overridden in a derived class, searches for the specified interface, specifying whether to do a case-insensitive search for the interface name. - The string containing the name of the interface to get. For generic interfaces, this is the mangled name. - true to ignore the case of that part of name that specifies the simple interface name (the part that specifies the namespace must be correctly cased). -or- false to perform a case-sensitive search for all parts of name. - An object representing the interface with the specified name, implemented or inherited by the current , if found; otherwise, null. - name is null. - The current represents a type that implements the same generic interface with different type arguments. - - - Returns an interface mapping for the specified interface type. - The interface type to retrieve a mapping for. - An object that represents the interface mapping for interfaceType. - interfaceType is not implemented by the current type. -or- The interfaceType parameter does not refer to an interface. -or- interfaceType is a generic interface, and the current type is an array type. - interfaceType is null. - The current represents a generic type parameter; that is, is true. - The invoked method is not supported in the base class. Derived classes must provide an implementation. - - - When overridden in a derived class, gets all the interfaces implemented or inherited by the current . - An array of objects representing all the interfaces implemented or inherited by the current . -or- An empty array of type , if no interfaces are implemented or inherited by the current . - A static initializer is invoked and throws an exception. - - - Searches for the public members with the specified name. - The string containing the name of the public members to get. - An array of objects representing the public members with the specified name, if found; otherwise, an empty array. - name is null. - - - Searches for the specified members, using the specified binding constraints. - The string containing the name of the members to get. - A bitmask comprised of one or more that specify how the search is conducted. -or- Zero, to return an empty array. - An array of objects representing the public members with the specified name, if found; otherwise, an empty array. - name is null. - - - Searches for the specified members of the specified member type, using the specified binding constraints. - The string containing the name of the members to get. - The value to search for. - A bitmask comprised of one or more that specify how the search is conducted. -or- Zero, to return an empty array. - An array of objects representing the public members with the specified name, if found; otherwise, an empty array. - name is null. - A derived class must provide an implementation. - - - Returns all the public members of the current . - An array of objects representing all the public members of the current . -or- An empty array of type , if the current does not have public members. - - - When overridden in a derived class, searches for the members defined for the current , using the specified binding constraints. - A bitmask comprised of one or more that specify how the search is conducted. -or- Zero (), to return an empty array. - An array of objects representing all members defined for the current that match the specified binding constraints. -or- An empty array of type , if no members are defined for the current , or if none of the defined members match the binding constraints. - - - Searches for the specified method whose parameters match the specified argument types and modifiers, using the specified binding constraints and the specified calling convention. - The string containing the name of the method to get. - A bitmask comprised of one or more that specify how the search is conducted. -or- Zero, to return null. - An object that defines a set of properties and enables binding, which can involve selection of an overloaded method, coercion of argument types, and invocation of a member through reflection. -or- A null reference (Nothing in Visual Basic), to use the . - The object that specifies the set of rules to use regarding the order and layout of arguments, how the return value is passed, what registers are used for arguments, and how the stack is cleaned up. - An array of objects representing the number, order, and type of the parameters for the method to get. -or- An empty array of objects (as provided by the field) to get a method that takes no parameters. - An array of objects representing the attributes associated with the corresponding element in the types array. To be only used when calling through COM interop, and only parameters that are passed by reference are handled. The default binder does not process this parameter. - An object representing the method that matches the specified requirements, if found; otherwise, null. - More than one method is found with the specified name and matching the specified binding constraints. - name is null. -or- types is null. -or- One of the elements in types is null. - types is multidimensional. -or- modifiers is multidimensional. - - - Searches for the specified method whose parameters match the specified argument types and modifiers, using the specified binding constraints. - The string containing the name of the method to get. - A bitmask comprised of one or more that specify how the search is conducted. -or- Zero, to return null. - An object that defines a set of properties and enables binding, which can involve selection of an overloaded method, coercion of argument types, and invocation of a member through reflection. -or- A null reference (Nothing in Visual Basic), to use the . - An array of objects representing the number, order, and type of the parameters for the method to get. -or- An empty array of objects (as provided by the field) to get a method that takes no parameters. - An array of objects representing the attributes associated with the corresponding element in the types array. To be only used when calling through COM interop, and only parameters that are passed by reference are handled. The default binder does not process this parameter. - An object representing the method that matches the specified requirements, if found; otherwise, null. - More than one method is found with the specified name and matching the specified binding constraints. - name is null. -or- types is null. -or- One of the elements in types is null. - types is multidimensional. -or- modifiers is multidimensional. - - - Searches for the specified public method whose parameters match the specified argument types and modifiers. - The string containing the name of the public method to get. - An array of objects representing the number, order, and type of the parameters for the method to get. -or- An empty array of objects (as provided by the field) to get a method that takes no parameters. - An array of objects representing the attributes associated with the corresponding element in the types array. To be only used when calling through COM interop, and only parameters that are passed by reference are handled. The default binder does not process this parameter. - An object representing the public method that matches the specified requirements, if found; otherwise, null. - More than one method is found with the specified name and specified parameters. - name is null. -or- types is null. -or- One of the elements in types is null. - types is multidimensional. -or- modifiers is multidimensional. - - - Searches for the public method with the specified name. - The string containing the name of the public method to get. - An object that represents the public method with the specified name, if found; otherwise, null. - More than one method is found with the specified name. - name is null. - - - Searches for the specified method, using the specified binding constraints. - The string containing the name of the method to get. - A bitmask comprised of one or more that specify how the search is conducted. -or- Zero, to return null. - An object representing the method that matches the specified requirements, if found; otherwise, null. - More than one method is found with the specified name and matching the specified binding constraints. - name is null. - - - Searches for the specified public method whose parameters match the specified argument types. - The string containing the name of the public method to get. - An array of objects representing the number, order, and type of the parameters for the method to get. -or- An empty array of objects (as provided by the field) to get a method that takes no parameters. - An object representing the public method whose parameters match the specified argument types, if found; otherwise, null. - More than one method is found with the specified name and specified parameters. - name is null. -or- types is null. -or- One of the elements in types is null. - types is multidimensional. - - - When overridden in a derived class, searches for the specified method whose parameters match the specified argument types and modifiers, using the specified binding constraints and the specified calling convention. - The string containing the name of the method to get. - A bitmask comprised of one or more that specify how the search is conducted. -or- Zero, to return null. - An object that defines a set of properties and enables binding, which can involve selection of an overloaded method, coercion of argument types, and invocation of a member through reflection. -or- A null reference (Nothing in Visual Basic), to use the . - The object that specifies the set of rules to use regarding the order and layout of arguments, how the return value is passed, what registers are used for arguments, and what process cleans up the stack. - An array of objects representing the number, order, and type of the parameters for the method to get. -or- An empty array of the type (that is, Type[] types = new Type[0]) to get a method that takes no parameters. -or- null. If types is null, arguments are not matched. - An array of objects representing the attributes associated with the corresponding element in the types array. The default binder does not process this parameter. - An object representing the method that matches the specified requirements, if found; otherwise, null. - More than one method is found with the specified name and matching the specified binding constraints. - name is null. - types is multidimensional. -or- modifiers is multidimensional. -or- types and modifiers do not have the same length. - The current type is a or . - - - Returns all the public methods of the current . - An array of objects representing all the public methods defined for the current . -or- An empty array of type , if no public methods are defined for the current . - - - When overridden in a derived class, searches for the methods defined for the current , using the specified binding constraints. - A bitmask comprised of one or more that specify how the search is conducted. -or- Zero, to return null. - An array of objects representing all methods defined for the current that match the specified binding constraints. -or- An empty array of type , if no methods are defined for the current , or if none of the defined methods match the binding constraints. - - - When overridden in a derived class, searches for the specified nested type, using the specified binding constraints. - The string containing the name of the nested type to get. - A bitmask comprised of one or more that specify how the search is conducted. -or- Zero, to return null. - An object representing the nested type that matches the specified requirements, if found; otherwise, null. - name is null. - - - Searches for the public nested type with the specified name. - The string containing the name of the nested type to get. - An object representing the public nested type with the specified name, if found; otherwise, null. - name is null. - - - When overridden in a derived class, searches for the types nested in the current , using the specified binding constraints. - A bitmask comprised of one or more that specify how the search is conducted. -or- Zero, to return null. - An array of objects representing all the types nested in the current that match the specified binding constraints (the search is not recursive), or an empty array of type , if no nested types are found that match the binding constraints. - - - Returns the public types nested in the current . - An array of objects representing the public types nested in the current (the search is not recursive), or an empty array of type if no public types are nested in the current . - - - Returns all the public properties of the current . - An array of objects representing all public properties of the current . -or- An empty array of type , if the current does not have public properties. - - - When overridden in a derived class, searches for the properties of the current , using the specified binding constraints. - A bitmask comprised of one or more that specify how the search is conducted. -or- Zero, to return null. - An array of objects representing all properties of the current that match the specified binding constraints. -or- An empty array of type , if the current does not have properties, or if none of the properties match the binding constraints. - - - Searches for the public property with the specified name. - The string containing the name of the public property to get. - An object representing the public property with the specified name, if found; otherwise, null. - More than one property is found with the specified name. - name is null. - - - Searches for the specified property, using the specified binding constraints. - The string containing the name of the property to get. - A bitmask comprised of one or more that specify how the search is conducted. -or- Zero, to return null. - An object representing the property that matches the specified requirements, if found; otherwise, null. - More than one property is found with the specified name and matching the specified binding constraints. - name is null. - - - Searches for the public property with the specified name and return type. - The string containing the name of the public property to get. - The return type of the property. - An object representing the public property with the specified name, if found; otherwise, null. - More than one property is found with the specified name. - name is null, or returnType is null. - - - Searches for the specified public property whose parameters match the specified argument types. - The string containing the name of the public property to get. - An array of objects representing the number, order, and type of the parameters for the indexed property to get. -or- An empty array of the type (that is, Type[] types = new Type[0]) to get a property that is not indexed. - An object representing the public property whose parameters match the specified argument types, if found; otherwise, null. - More than one property is found with the specified name and matching the specified argument types. - name is null. -or- types is null. - types is multidimensional. - An element of types is null. - - - Searches for the specified public property whose parameters match the specified argument types. - The string containing the name of the public property to get. - The return type of the property. - An array of objects representing the number, order, and type of the parameters for the indexed property to get. -or- An empty array of the type (that is, Type[] types = new Type[0]) to get a property that is not indexed. - An object representing the public property whose parameters match the specified argument types, if found; otherwise, null. - More than one property is found with the specified name and matching the specified argument types. - name is null. -or- types is null. - types is multidimensional. - An element of types is null. - - - Searches for the specified public property whose parameters match the specified argument types and modifiers. - The string containing the name of the public property to get. - The return type of the property. - An array of objects representing the number, order, and type of the parameters for the indexed property to get. -or- An empty array of the type (that is, Type[] types = new Type[0]) to get a property that is not indexed. - An array of objects representing the attributes associated with the corresponding element in the types array. The default binder does not process this parameter. - An object representing the public property that matches the specified requirements, if found; otherwise, null. - More than one property is found with the specified name and matching the specified argument types and modifiers. - name is null. -or- types is null. - types is multidimensional. -or- modifiers is multidimensional. -or- types and modifiers do not have the same length. - An element of types is null. - - - Searches for the specified property whose parameters match the specified argument types and modifiers, using the specified binding constraints. - The string containing the name of the property to get. - A bitmask comprised of one or more that specify how the search is conducted. -or- Zero, to return null. - An object that defines a set of properties and enables binding, which can involve selection of an overloaded method, coercion of argument types, and invocation of a member through reflection. -or- A null reference (Nothing in Visual Basic), to use the . - The return type of the property. - An array of objects representing the number, order, and type of the parameters for the indexed property to get. -or- An empty array of the type (that is, Type[] types = new Type[0]) to get a property that is not indexed. - An array of objects representing the attributes associated with the corresponding element in the types array. The default binder does not process this parameter. - An object representing the property that matches the specified requirements, if found; otherwise, null. - More than one property is found with the specified name and matching the specified binding constraints. - name is null. -or- types is null. - types is multidimensional. -or- modifiers is multidimensional. -or- types and modifiers do not have the same length. - An element of types is null. - - - When overridden in a derived class, searches for the specified property whose parameters match the specified argument types and modifiers, using the specified binding constraints. - The string containing the name of the property to get. - A bitmask comprised of one or more that specify how the search is conducted. -or- Zero, to return null. - An object that defines a set of properties and enables binding, which can involve selection of an overloaded member, coercion of argument types, and invocation of a member through reflection. -or- A null reference (Nothing in Visual Basic), to use the . - The return type of the property. - An array of objects representing the number, order, and type of the parameters for the indexed property to get. -or- An empty array of the type (that is, Type[] types = new Type[0]) to get a property that is not indexed. - An array of objects representing the attributes associated with the corresponding element in the types array. The default binder does not process this parameter. - An object representing the property that matches the specified requirements, if found; otherwise, null. - More than one property is found with the specified name and matching the specified binding constraints. - name is null. -or- types is null. -or- One of the elements in types is null. - types is multidimensional. -or- modifiers is multidimensional. -or- types and modifiers do not have the same length. - The current type is a , , or . - - - Gets the type with the specified name, specifying whether to perform a case-sensitive search and whether to throw an exception if the type is not found, and optionally providing custom methods to resolve the assembly and the type. - The name of the type to get. If the typeResolver parameter is provided, the type name can be any string that typeResolver is capable of resolving. If the assemblyResolver parameter is provided or if standard type resolution is used, typeName must be an assembly-qualified name (see ), unless the type is in the currently executing assembly or in Mscorlib.dll, in which case it is sufficient to supply the type name qualified by its namespace. - A method that locates and returns the assembly that is specified in typeName. The assembly name is passed to assemblyResolver as an object. If typeName does not contain the name of an assembly, assemblyResolver is not called. If assemblyResolver is not supplied, standard assembly resolution is performed. Caution Do not pass methods from unknown or untrusted callers. Doing so could result in elevation of privilege for malicious code. Use only methods that you provide or that you are familiar with. - A method that locates and returns the type that is specified by typeName from the assembly that is returned by assemblyResolver or by standard assembly resolution. If no assembly is provided, the method can provide one. The method also takes a parameter that specifies whether to perform a case-insensitive search; the value of ignoreCase is passed to that parameter. Caution Do not pass methods from unknown or untrusted callers. - true to throw an exception if the type cannot be found; false to return null. Specifying false also suppresses some other exception conditions, but not all of them. See the Exceptions section. - true to perform a case-insensitive search for typeName, false to perform a case-sensitive search for typeName. - The type with the specified name. If the type is not found, the throwOnError parameter specifies whether null is returned or an exception is thrown. In some cases, an exception is thrown regardless of the value of throwOnError. See the Exceptions section. - typeName is null. - A class initializer is invoked and throws an exception. - throwOnError is true and the type is not found. -or- throwOnError is true and typeName contains invalid characters, such as an embedded tab. -or- throwOnError is true and typeName is an empty string. -or- throwOnError is true and typeName represents an array type with an invalid size. -or- typeName represents an array of . - An error occurs when typeName is parsed into a type name and an assembly name (for example, when the simple type name includes an unescaped special character). -or- throwOnError is true and typeName contains invalid syntax (for example, "MyType[,*,]"). -or- typeName represents a generic type that has a pointer type, a ByRef type, or as one of its type arguments. -or- typeName represents a generic type that has an incorrect number of type arguments. -or- typeName represents a generic type, and one of its type arguments does not satisfy the constraints for the corresponding type parameter. - throwOnError is true and the assembly or one of its dependencies was not found. - The assembly or one of its dependencies was found, but could not be loaded. -or- typeName contains an invalid assembly name. -or- typeName is a valid assembly name without a type name. - The assembly or one of its dependencies is not valid. -or- The assembly was compiled with a later version of the common language runtime than the version that is currently loaded. - - - Gets the type with the specified name, specifying whether to throw an exception if the type is not found, and optionally providing custom methods to resolve the assembly and the type. - The name of the type to get. If the typeResolver parameter is provided, the type name can be any string that typeResolver is capable of resolving. If the assemblyResolver parameter is provided or if standard type resolution is used, typeName must be an assembly-qualified name (see ), unless the type is in the currently executing assembly or in Mscorlib.dll, in which case it is sufficient to supply the type name qualified by its namespace. - A method that locates and returns the assembly that is specified in typeName. The assembly name is passed to assemblyResolver as an object. If typeName does not contain the name of an assembly, assemblyResolver is not called. If assemblyResolver is not supplied, standard assembly resolution is performed. Caution Do not pass methods from unknown or untrusted callers. Doing so could result in elevation of privilege for malicious code. Use only methods that you provide or that you are familiar with. - A method that locates and returns the type that is specified by typeName from the assembly that is returned by assemblyResolver or by standard assembly resolution. If no assembly is provided, the method can provide one. The method also takes a parameter that specifies whether to perform a case-insensitive search; false is passed to that parameter. Caution Do not pass methods from unknown or untrusted callers. - true to throw an exception if the type cannot be found; false to return null. Specifying false also suppresses some other exception conditions, but not all of them. See the Exceptions section. - The type with the specified name. If the type is not found, the throwOnError parameter specifies whether null is returned or an exception is thrown. In some cases, an exception is thrown regardless of the value of throwOnError. See the Exceptions section. - typeName is null. - A class initializer is invoked and throws an exception. - throwOnError is true and the type is not found. -or- throwOnError is true and typeName contains invalid characters, such as an embedded tab. -or- throwOnError is true and typeName is an empty string. -or- throwOnError is true and typeName represents an array type with an invalid size. -or- typeName represents an array of . - An error occurs when typeName is parsed into a type name and an assembly name (for example, when the simple type name includes an unescaped special character). -or- throwOnError is true and typeName contains invalid syntax (for example, "MyType[,*,]"). -or- typeName represents a generic type that has a pointer type, a ByRef type, or as one of its type arguments. -or- typeName represents a generic type that has an incorrect number of type arguments. -or- typeName represents a generic type, and one of its type arguments does not satisfy the constraints for the corresponding type parameter. - throwOnError is true and the assembly or one of its dependencies was not found. -or- typeName contains an invalid assembly name. -or- typeName is a valid assembly name without a type name. - The assembly or one of its dependencies was found, but could not be loaded. - The assembly or one of its dependencies is not valid. -or- The assembly was compiled with a later version of the common language runtime than the version that is currently loaded. - - - Gets the type with the specified name, optionally providing custom methods to resolve the assembly and the type. - The name of the type to get. If the typeResolver parameter is provided, the type name can be any string that typeResolver is capable of resolving. If the assemblyResolver parameter is provided or if standard type resolution is used, typeName must be an assembly-qualified name (see ), unless the type is in the currently executing assembly or in Mscorlib.dll, in which case it is sufficient to supply the type name qualified by its namespace. - A method that locates and returns the assembly that is specified in typeName. The assembly name is passed to assemblyResolver as an object. If typeName does not contain the name of an assembly, assemblyResolver is not called. If assemblyResolver is not supplied, standard assembly resolution is performed. Caution Do not pass methods from unknown or untrusted callers. Doing so could result in elevation of privilege for malicious code. Use only methods that you provide or that you are familiar with. - A method that locates and returns the type that is specified by typeName from the assembly that is returned by assemblyResolver or by standard assembly resolution. If no assembly is provided, the typeResolver method can provide one. The method also takes a parameter that specifies whether to perform a case-insensitive search; false is passed to that parameter. Caution Do not pass methods from unknown or untrusted callers. - The type with the specified name, or null if the type is not found. - typeName is null. - A class initializer is invoked and throws an exception. - An error occurs when typeName is parsed into a type name and an assembly name (for example, when the simple type name includes an unescaped special character). -or- typeName represents a generic type that has a pointer type, a ByRef type, or as one of its type arguments. -or- typeName represents a generic type that has an incorrect number of type arguments. -or- typeName represents a generic type, and one of its type arguments does not satisfy the constraints for the corresponding type parameter. - typeName represents an array of . - The assembly or one of its dependencies was found, but could not be loaded. -or- typeName contains an invalid assembly name. -or- typeName is a valid assembly name without a type name. - The assembly or one of its dependencies is not valid. -or- The assembly was compiled with a later version of the common language runtime than the version that is currently loaded. - - - Gets the current . - The current . - A class initializer is invoked and throws an exception. - - - Gets the with the specified name, performing a case-sensitive search and specifying whether to throw an exception if the type is not found. - The assembly-qualified name of the type to get. See . If the type is in the currently executing assembly or in Mscorlib.dll, it is sufficient to supply the type name qualified by its namespace. - true to throw an exception if the type cannot be found; false to return null. Specifying false also suppresses some other exception conditions, but not all of them. See the Exceptions section. - The type with the specified name. If the type is not found, the throwOnError parameter specifies whether null is returned or an exception is thrown. In some cases, an exception is thrown regardless of the value of throwOnError. See the Exceptions section. - typeName is null. - A class initializer is invoked and throws an exception. - throwOnError is true and the type is not found. -or- throwOnError is true and typeName contains invalid characters, such as an embedded tab. -or- throwOnError is true and typeName is an empty string. -or- throwOnError is true and typeName represents an array type with an invalid size. -or- typeName represents an array of . - throwOnError is true and typeName contains invalid syntax. For example, "MyType[,*,]". -or- typeName represents a generic type that has a pointer type, a ByRef type, or as one of its type arguments. -or- typeName represents a generic type that has an incorrect number of type arguments. -or- typeName represents a generic type, and one of its type arguments does not satisfy the constraints for the corresponding type parameter. - throwOnError is true and the assembly or one of its dependencies was not found. - - In the [.NET for Windows Store apps](http://go.microsoft.com/fwlink/?LinkID=247912) or the [Portable Class Library](~/docs/standard/cross-platform/cross-platform-development-with-the-portable-class-library.md), catch the base class exception, , instead. - - The assembly or one of its dependencies was found, but could not be loaded. - The assembly or one of its dependencies is not valid. -or- Version 2.0 or later of the common language runtime is currently loaded, and the assembly was compiled with a later version. - - - Gets the with the specified name, performing a case-sensitive search. - The assembly-qualified name of the type to get. See . If the type is in the currently executing assembly or in Mscorlib.dll, it is sufficient to supply the type name qualified by its namespace. - The type with the specified name, if found; otherwise, null. - typeName is null. - A class initializer is invoked and throws an exception. - typeName represents a generic type that has a pointer type, a ByRef type, or as one of its type arguments. -or- typeName represents a generic type that has an incorrect number of type arguments. -or- typeName represents a generic type, and one of its type arguments does not satisfy the constraints for the corresponding type parameter. - typeName represents an array of . - - In the [.NET for Windows Store apps](http://go.microsoft.com/fwlink/?LinkID=247912) or the [Portable Class Library](~/docs/standard/cross-platform/cross-platform-development-with-the-portable-class-library.md), catch the base class exception, , instead. - - The assembly or one of its dependencies was found, but could not be loaded. - The assembly or one of its dependencies is not valid. -or- Version 2.0 or later of the common language runtime is currently loaded, and the assembly was compiled with a later version. - - - Gets the with the specified name, specifying whether to throw an exception if the type is not found and whether to perform a case-sensitive search. - The assembly-qualified name of the type to get. See . If the type is in the currently executing assembly or in Mscorlib.dll, it is sufficient to supply the type name qualified by its namespace. - true to throw an exception if the type cannot be found; false to return null.Specifying false also suppresses some other exception conditions, but not all of them. See the Exceptions section. - true to perform a case-insensitive search for typeName, false to perform a case-sensitive search for typeName. - The type with the specified name. If the type is not found, the throwOnError parameter specifies whether null is returned or an exception is thrown. In some cases, an exception is thrown regardless of the value of throwOnError. See the Exceptions section. - typeName is null. - A class initializer is invoked and throws an exception. - throwOnError is true and the type is not found. -or- throwOnError is true and typeName contains invalid characters, such as an embedded tab. -or- throwOnError is true and typeName is an empty string. -or- throwOnError is true and typeName represents an array type with an invalid size. -or- typeName represents an array of . - throwOnError is true and typeName contains invalid syntax. For example, "MyType[,*,]". -or- typeName represents a generic type that has a pointer type, a ByRef type, or as one of its type arguments. -or- typeName represents a generic type that has an incorrect number of type arguments. -or- typeName represents a generic type, and one of its type arguments does not satisfy the constraints for the corresponding type parameter. - throwOnError is true and the assembly or one of its dependencies was not found. - The assembly or one of its dependencies was found, but could not be loaded. - The assembly or one of its dependencies is not valid. -or- Version 2.0 or later of the common language runtime is currently loaded, and the assembly was compiled with a later version. - - - Gets the types of the objects in the specified array. - An array of objects whose types to determine. - An array of objects representing the types of the corresponding elements in args. - args is null. -or- One or more of the elements in args is null. - The class initializers are invoked and at least one throws an exception. - - - Gets the underlying type code of the specified . - The type whose underlying type code to get. - The code of the underlying type, or if type is null. - - - Returns the underlying type code of this instance. - The type code of the underlying type. - - - Gets the type associated with the specified class identifier (CLSID) from the specified server, specifying whether to throw an exception if an error occurs while loading the type. - The CLSID of the type to get. - The server from which to load the type. If the server name is null, this method automatically reverts to the local machine. - true to throw any exception that occurs. -or- false to ignore any exception that occurs. - System.__ComObject regardless of whether the CLSID is valid. - - - Gets the type associated with the specified class identifier (CLSID) from the specified server. - The CLSID of the type to get. - The server from which to load the type. If the server name is null, this method automatically reverts to the local machine. - System.__ComObject regardless of whether the CLSID is valid. - - - Gets the type associated with the specified class identifier (CLSID), specifying whether to throw an exception if an error occurs while loading the type. - The CLSID of the type to get. - true to throw any exception that occurs. -or- false to ignore any exception that occurs. - System.__ComObject regardless of whether the CLSID is valid. - - - Gets the type associated with the specified class identifier (CLSID). - The CLSID of the type to get. - System.__ComObject regardless of whether the CLSID is valid. - - - Gets the type referenced by the specified type handle. - The object that refers to the type. - The type referenced by the specified , or null if the property of handle is null. - A class initializer is invoked and throws an exception. - - - Gets the type associated with the specified program identifier (ProgID), returning null if an error is encountered while loading the . - The ProgID of the type to get. - The type associated with the specified ProgID, if progID is a valid entry in the registry and a type is associated with it; otherwise, null. - progID is null. - - - Gets the type associated with the specified program identifier (ProgID), specifying whether to throw an exception if an error occurs while loading the type. - The ProgID of the type to get. - true to throw any exception that occurs. -or- false to ignore any exception that occurs. - The type associated with the specified program identifier (ProgID), if progID is a valid entry in the registry and a type is associated with it; otherwise, null. - progID is null. - The specified ProgID is not registered. - - - Gets the type associated with the specified program identifier (progID) from the specified server, returning null if an error is encountered while loading the type. - The progID of the type to get. - The server from which to load the type. If the server name is null, this method automatically reverts to the local machine. - The type associated with the specified program identifier (progID), if progID is a valid entry in the registry and a type is associated with it; otherwise, null. - prodID is null. - - - Gets the type associated with the specified program identifier (progID) from the specified server, specifying whether to throw an exception if an error occurs while loading the type. - The progID of the to get. - The server from which to load the type. If the server name is null, this method automatically reverts to the local machine. - true to throw any exception that occurs. -or- false to ignore any exception that occurs. - The type associated with the specified program identifier (progID), if progID is a valid entry in the registry and a type is associated with it; otherwise, null. - progID is null. - The specified progID is not registered. - - - Gets the handle for the of a specified object. - The object for which to get the type handle. - The handle for the of the specified . - o is null. - - - Gets the GUID associated with the . - The GUID associated with the . - - - Gets a value indicating whether the current encompasses or refers to another type; that is, whether the current is an array, a pointer, or is passed by reference. - true if the is an array, a pointer, or is passed by reference; otherwise, false. - - - When overridden in a derived class, implements the property and determines whether the current encompasses or refers to another type; that is, whether the current is an array, a pointer, or is passed by reference. - true if the is an array, a pointer, or is passed by reference; otherwise, false. - - - When overridden in a derived class, invokes the specified member, using the specified binding constraints and matching the specified argument list, modifiers and culture. - The string containing the name of the constructor, method, property, or field member to invoke. -or- An empty string ("") to invoke the default member. -or- For IDispatch members, a string representing the DispID, for example "[DispID=3]". - A bitmask comprised of one or more that specify how the search is conducted. The access can be one of the BindingFlags such as Public, NonPublic, Private, InvokeMethod, GetField, and so on. The type of lookup need not be specified. If the type of lookup is omitted, BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static are used. - An object that defines a set of properties and enables binding, which can involve selection of an overloaded method, coercion of argument types, and invocation of a member through reflection. -or- A null reference (Nothing in Visual Basic), to use the . Note that explicitly defining a object may be required for successfully invoking method overloads with variable arguments. - The object on which to invoke the specified member. - An array containing the arguments to pass to the member to invoke. - An array of objects representing the attributes associated with the corresponding element in the args array. A parameter's associated attributes are stored in the member's signature. The default binder processes this parameter only when calling a COM component. - The object representing the globalization locale to use, which may be necessary for locale-specific conversions, such as converting a numeric String to a Double. -or- A null reference (Nothing in Visual Basic) to use the current thread's . - An array containing the names of the parameters to which the values in the args array are passed. - An object representing the return value of the invoked member. - invokeAttr does not contain CreateInstance and name is null. - args and modifiers do not have the same length. -or- invokeAttr is not a valid attribute. -or- invokeAttr does not contain one of the following binding flags: InvokeMethod, CreateInstance, GetField, SetField, GetProperty, or SetProperty. -or- invokeAttr contains CreateInstance combined with InvokeMethod, GetField, SetField, GetProperty, or SetProperty. -or- invokeAttr contains both GetField and SetField. -or- invokeAttr contains both GetProperty and SetProperty. -or- invokeAttr contains InvokeMethod combined with SetField or SetProperty. -or- invokeAttr contains SetField and args has more than one element. -or- The named parameter array is larger than the argument array. -or- This method is called on a COM object and one of the following binding flags was not passed in: BindingFlags.InvokeMethod, BindingFlags.GetProperty, BindingFlags.SetProperty, BindingFlags.PutDispProperty, or BindingFlags.PutRefDispProperty. -or- One of the named parameter arrays contains a string that is null. - The specified member is a class initializer. - The field or property cannot be found. - No method can be found that matches the arguments in args. -or- No member can be found that has the argument names supplied in namedParameters. -or- The current object represents a type that contains open type parameters, that is, returns true. - The specified member cannot be invoked on target. - More than one method matches the binding criteria. - The method represented by name has one or more unspecified generic type parameters. That is, the method's property returns true. - - - Invokes the specified member, using the specified binding constraints and matching the specified argument list. - The string containing the name of the constructor, method, property, or field member to invoke. -or- An empty string ("") to invoke the default member. -or- For IDispatch members, a string representing the DispID, for example "[DispID=3]". - A bitmask comprised of one or more that specify how the search is conducted. The access can be one of the BindingFlags such as Public, NonPublic, Private, InvokeMethod, GetField, and so on. The type of lookup need not be specified. If the type of lookup is omitted, BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static are used. - An object that defines a set of properties and enables binding, which can involve selection of an overloaded method, coercion of argument types, and invocation of a member through reflection. -or- A null reference (Nothing in Visual Basic), to use the . Note that explicitly defining a object may be required for successfully invoking method overloads with variable arguments. - The object on which to invoke the specified member. - An array containing the arguments to pass to the member to invoke. - An object representing the return value of the invoked member. - invokeAttr does not contain CreateInstance and name is null. - invokeAttr is not a valid attribute. -or- invokeAttr does not contain one of the following binding flags: InvokeMethod, CreateInstance, GetField, SetField, GetProperty, or SetProperty. -or- invokeAttr contains CreateInstance combined with InvokeMethod, GetField, SetField, GetProperty, or SetProperty. -or- invokeAttr contains both GetField and SetField. -or- invokeAttr contains both GetProperty and SetProperty. -or- invokeAttr contains InvokeMethod combined with SetField or SetProperty. -or- invokeAttr contains SetField and args has more than one element. -or- This method is called on a COM object and one of the following binding flags was not passed in: BindingFlags.InvokeMethod, BindingFlags.GetProperty, BindingFlags.SetProperty, BindingFlags.PutDispProperty, or BindingFlags.PutRefDispProperty. -or- One of the named parameter arrays contains a string that is null. - The specified member is a class initializer. - The field or property cannot be found. - No method can be found that matches the arguments in args. -or- The current object represents a type that contains open type parameters, that is, returns true. - The specified member cannot be invoked on target. - More than one method matches the binding criteria. - The .NET Compact Framework does not currently support this method. - The method represented by name has one or more unspecified generic type parameters. That is, the method's property returns true. - - - Invokes the specified member, using the specified binding constraints and matching the specified argument list and culture. - The string containing the name of the constructor, method, property, or field member to invoke. -or- An empty string ("") to invoke the default member. -or- For IDispatch members, a string representing the DispID, for example "[DispID=3]". - A bitmask comprised of one or more that specify how the search is conducted. The access can be one of the BindingFlags such as Public, NonPublic, Private, InvokeMethod, GetField, and so on. The type of lookup need not be specified. If the type of lookup is omitted, BindingFlags.Public | BindingFlags.Instance | BindingFlags.Static are used. - An object that defines a set of properties and enables binding, which can involve selection of an overloaded method, coercion of argument types, and invocation of a member through reflection. -or- A null reference (Nothing in Visual Basic), to use the . Note that explicitly defining a object may be required for successfully invoking method overloads with variable arguments. - The object on which to invoke the specified member. - An array containing the arguments to pass to the member to invoke. - The object representing the globalization locale to use, which may be necessary for locale-specific conversions, such as converting a numeric to a . -or- A null reference (Nothing in Visual Basic) to use the current thread's . - An object representing the return value of the invoked member. - invokeAttr does not contain CreateInstance and name is null. - invokeAttr is not a valid attribute. -or- invokeAttr does not contain one of the following binding flags: InvokeMethod, CreateInstance, GetField, SetField, GetProperty, or SetProperty. -or- invokeAttr contains CreateInstance combined with InvokeMethod, GetField, SetField, GetProperty, or SetProperty. -or- invokeAttr contains both GetField and SetField. -or- invokeAttr contains both GetProperty and SetProperty. -or- invokeAttr contains InvokeMethod combined with SetField or SetProperty. -or- invokeAttr contains SetField and args has more than one element. -or- This method is called on a COM object and one of the following binding flags was not passed in: BindingFlags.InvokeMethod, BindingFlags.GetProperty, BindingFlags.SetProperty, BindingFlags.PutDispProperty, or BindingFlags.PutRefDispProperty. -or- One of the named parameter arrays contains a string that is null. - The specified member is a class initializer. - The field or property cannot be found. - No method can be found that matches the arguments in args. -or- The current object represents a type that contains open type parameters, that is, returns true. - The specified member cannot be invoked on target. - More than one method matches the binding criteria. - The method represented by name has one or more unspecified generic type parameters. That is, the method's property returns true. - - - Gets a value indicating whether the is abstract and must be overridden. - true if the is abstract; otherwise, false. - - - Gets a value indicating whether the string format attribute AnsiClass is selected for the . - true if the string format attribute AnsiClass is selected for the ; otherwise, false. - - - Gets a value that indicates whether the type is an array. - true if the current type is an array; otherwise, false. - - - When overridden in a derived class, implements the property and determines whether the is an array. - true if the is an array; otherwise, false. - - - Determines whether an instance of a specified type can be assigned to an instance of the current type. - The type to compare with the current type. - true if any of the following conditions is true: c and the current instance represent the same type. c is derived either directly or indirectly from the current instance. c is derived directly from the current instance if it inherits from the current instance; c is derived indirectly from the current instance if it inherits from a succession of one or more classes that inherit from the current instance. The current instance is an interface that c implements. c is a generic type parameter, and the current instance represents one of the constraints of c. In the following example, the current instance is a object that represents the class. GenericWithConstraint is a generic type whose generic type parameter must be of type . Passing its generic type parameter to the indicates that an instance of the generic type parameter can be assigned to an object. using System; -using System.IO; - -public class Example -{ - public static void Main() - { - Type t = typeof(Stream); - Type genericT = typeof(GenericWithConstraint<>); - Type genericParam = genericT.GetGenericArguments()[0]; - Console.WriteLine(t.IsAssignableFrom(genericParam)); - // Displays True. - } -} - -public class GenericWithConstraint<T> where T : Stream -{} -Imports System.IO - -Module Example - Public Sub Main() - Dim t As Type = GetType(Stream) - Dim genericT As Type = GetType(GenericWithConstraint(Of )) - Dim genericParam As Type = genericT.GetGenericArguments()(0) - Console.WriteLine(t.IsAssignableFrom(genericParam)) - ' Displays True. - End Sub -End Module - -Public Class GenericWithConstraint(Of T As Stream) -End Class -c represents a value type, and the current instance represents Nullable (Nullable(Of c) in Visual Basic). false if none of these conditions are true, or if c is null. - - - Gets a value indicating whether the string format attribute AutoClass is selected for the . - true if the string format attribute AutoClass is selected for the ; otherwise, false. - - - Gets a value indicating whether the fields of the current type are laid out automatically by the common language runtime. - true if the property of the current type includes ; otherwise, false. - - - Gets a value indicating whether the is passed by reference. - true if the is passed by reference; otherwise, false. - - - When overridden in a derived class, implements the property and determines whether the is passed by reference. - true if the is passed by reference; otherwise, false. - - - Gets a value indicating whether the is a class or a delegate; that is, not a value type or interface. - true if the is a class; otherwise, false. - - - Gets a value indicating whether the is a COM object. - true if the is a COM object; otherwise, false. - - - When overridden in a derived class, implements the property and determines whether the is a COM object. - true if the is a COM object; otherwise, false. - - - Gets a value that indicates whether this object represents a constructed generic type. You can create instances of a constructed generic type. - true if this object represents a constructed generic type; otherwise, false. - - - Gets a value indicating whether the can be hosted in a context. - true if the can be hosted in a context; otherwise, false. - - - Implements the property and determines whether the can be hosted in a context. - true if the can be hosted in a context; otherwise, false. - - - Gets a value indicating whether the current represents an enumeration. - true if the current represents an enumeration; otherwise, false. - - - Returns a value that indicates whether the specified value exists in the current enumeration type. - The value to be tested. - true if the specified value is a member of the current enumeration type; otherwise, false. - The current type is not an enumeration. - value is null. - value is of a type that cannot be the underlying type of an enumeration. - - - Determines whether two COM types have the same identity and are eligible for type equivalence. - The COM type that is tested for equivalence with the current type. - true if the COM types are equivalent; otherwise, false. This method also returns false if one type is in an assembly that is loaded for execution, and the other is in an assembly that is loaded into the reflection-only context. - - - Gets a value indicating whether the fields of the current type are laid out at explicitly specified offsets. - true if the property of the current type includes ; otherwise, false. - - - Gets a value indicating whether the current represents a type parameter in the definition of a generic type or method. - true if the object represents a type parameter of a generic type definition or generic method definition; otherwise, false. - - - Gets a value indicating whether the current type is a generic type. - true if the current type is a generic type; otherwise, false. - - - Gets a value indicating whether the current represents a generic type definition, from which other generic types can be constructed. - true if the object represents a generic type definition; otherwise, false. - - - Gets a value indicating whether the has a attribute applied, indicating that it was imported from a COM type library. - true if the has a ; otherwise, false. - - - Determines whether the specified object is an instance of the current . - The object to compare with the current type. - true if the current Type is in the inheritance hierarchy of the object represented by o, or if the current Type is an interface that o implements. false if neither of these conditions is the case, if o is null, or if the current Type is an open generic type (that is, returns true). - - - Gets a value indicating whether the is an interface; that is, not a class or a value type. - true if the is an interface; otherwise, false. - - - Gets a value indicating whether the fields of the current type are laid out sequentially, in the order that they were defined or emitted to the metadata. - true if the property of the current type includes ; otherwise, false. - - - Gets a value indicating whether the is marshaled by reference. - true if the is marshaled by reference; otherwise, false. - - - Implements the property and determines whether the is marshaled by reference. - true if the is marshaled by reference; otherwise, false. - - - Gets a value indicating whether the current object represents a type whose definition is nested inside the definition of another type. - true if the is nested inside another type; otherwise, false. - - - Gets a value indicating whether the is nested and visible only within its own assembly. - true if the is nested and visible only within its own assembly; otherwise, false. - - - Gets a value indicating whether the is nested and visible only to classes that belong to both its own family and its own assembly. - true if the is nested and visible only to classes that belong to both its own family and its own assembly; otherwise, false. - - - Gets a value indicating whether the is nested and visible only within its own family. - true if the is nested and visible only within its own family; otherwise, false. - - - Gets a value indicating whether the is nested and visible only to classes that belong to either its own family or to its own assembly. - true if the is nested and visible only to classes that belong to its own family or to its own assembly; otherwise, false. - - - Gets a value indicating whether the is nested and declared private. - true if the is nested and declared private; otherwise, false. - - - Gets a value indicating whether a class is nested and declared public. - true if the class is nested and declared public; otherwise, false. - - - Gets a value indicating whether the is not declared public. - true if the is not declared public and is not a nested type; otherwise, false. - - - Gets a value indicating whether the is a pointer. - true if the is a pointer; otherwise, false. - - - When overridden in a derived class, implements the property and determines whether the is a pointer. - true if the is a pointer; otherwise, false. - - - Gets a value indicating whether the is one of the primitive types. - true if the is one of the primitive types; otherwise, false. - - - When overridden in a derived class, implements the property and determines whether the is one of the primitive types. - true if the is one of the primitive types; otherwise, false. - - - Gets a value indicating whether the is declared public. - true if the is declared public and is not a nested type; otherwise, false. - - - Gets a value indicating whether the is declared sealed. - true if the is declared sealed; otherwise, false. - - - Gets a value that indicates whether the current type is security-critical or security-safe-critical at the current trust level, and therefore can perform critical operations. - true if the current type is security-critical or security-safe-critical at the current trust level; false if it is transparent. - - - Gets a value that indicates whether the current type is security-safe-critical at the current trust level; that is, whether it can perform critical operations and can be accessed by transparent code. - true if the current type is security-safe-critical at the current trust level; false if it is security-critical or transparent. - - - Gets a value that indicates whether the current type is transparent at the current trust level, and therefore cannot perform critical operations. - true if the type is security-transparent at the current trust level; otherwise, false. - - - Gets a value indicating whether the is serializable. - true if the is serializable; otherwise, false. - - - Gets a value indicating whether the type has a name that requires special handling. - true if the type has a name that requires special handling; otherwise, false. - - - Determines whether the current derives from the specified . - The type to compare with the current type. - true if the current Type derives from c; otherwise, false. This method also returns false if c and the current Type are equal. - c is null. - - - Gets a value indicating whether the string format attribute UnicodeClass is selected for the . - true if the string format attribute UnicodeClass is selected for the ; otherwise, false. - - - Gets a value indicating whether the is a value type. - true if the is a value type; otherwise, false. - - - Implements the property and determines whether the is a value type; that is, not a class or an interface. - true if the is a value type; otherwise, false. - - - Gets a value indicating whether the can be accessed by code outside the assembly. - true if the current is a public type or a public nested type such that all the enclosing types are public; otherwise, false. - - - Returns a object representing an array of the current type, with the specified number of dimensions. - The number of dimensions for the array. This number must be less than or equal to 32. - An object representing an array of the current type, with the specified number of dimensions. - rank is invalid. For example, 0 or negative. - The invoked method is not supported in the base class. - The current type is . -or- The current type is a ByRef type. That is, returns true. -or- rank is greater than 32. - - - Returns a object representing a one-dimensional array of the current type, with a lower bound of zero. - A object representing a one-dimensional array of the current type, with a lower bound of zero. - The invoked method is not supported in the base class. Derived classes must provide an implementation. - The current type is . -or- The current type is a ByRef type. That is, returns true. - - - Returns a object that represents the current type when passed as a ref parameter (ByRef parameter in Visual Basic). - A object that represents the current type when passed as a ref parameter (ByRef parameter in Visual Basic). - The invoked method is not supported in the base class. - The current type is . -or- The current type is a ByRef type. That is, returns true. - - - Substitutes the elements of an array of types for the type parameters of the current generic type definition and returns a object representing the resulting constructed type. - An array of types to be substituted for the type parameters of the current generic type. - A representing the constructed type formed by substituting the elements of typeArguments for the type parameters of the current generic type. - The current type does not represent a generic type definition. That is, returns false. - typeArguments is null. -or- Any element of typeArguments is null. - The number of elements in typeArguments is not the same as the number of type parameters in the current generic type definition. -or- Any element of typeArguments does not satisfy the constraints specified for the corresponding type parameter of the current generic type. -or- typeArguments contains an element that is a pointer type ( returns true), a by-ref type ( returns true), or . - The invoked method is not supported in the base class. Derived classes must provide an implementation. - - - Returns a object that represents a pointer to the current type. - A object that represents a pointer to the current type. - The invoked method is not supported in the base class. - The current type is . -or- The current type is a ByRef type. That is, returns true. - - - Gets a value indicating that this member is a type or a nested type. - A value indicating that this member is a type or a nested type. - - - Represents a missing value in the information. This field is read-only. - - - - Gets the module (the DLL) in which the current is defined. - The module in which the current is defined. - - - Gets the namespace of the . - The namespace of the ; null if the current instance has no namespace or represents a generic parameter. - - - Indicates whether two objects are equal. - The first object to compare. - The second object to compare. - true if left is equal to right; otherwise, false. - - - Indicates whether two objects are not equal. - The first object to compare. - The second object to compare. - true if left is not equal to right; otherwise, false. - - - Gets the class object that was used to obtain this member. - The Type object through which this object was obtained. - - - Gets the with the specified name, specifying whether to perform a case-sensitive search and whether to throw an exception if the type is not found. The type is loaded for reflection only, not for execution. - The assembly-qualified name of the to get. - true to throw a if the type cannot be found; false to return null if the type cannot be found. Specifying false also suppresses some other exception conditions, but not all of them. See the Exceptions section. - true to perform a case-insensitive search for typeName; false to perform a case-sensitive search for typeName. - The type with the specified name, if found; otherwise, null. If the type is not found, the throwIfNotFound parameter specifies whether null is returned or an exception is thrown. In some cases, an exception is thrown regardless of the value of throwIfNotFound. See the Exceptions section. - typeName is null. - A class initializer is invoked and throws an exception. - throwIfNotFound is true and the type is not found. -or- throwIfNotFound is true and typeName contains invalid characters, such as an embedded tab. -or- throwIfNotFound is true and typeName is an empty string. -or- throwIfNotFound is true and typeName represents an array type with an invalid size. -or- typeName represents an array of objects. - typeName does not include the assembly name. -or- throwIfNotFound is true and typeName contains invalid syntax; for example, "MyType[,*,]". -or- typeName represents a generic type that has a pointer type, a ByRef type, or as one of its type arguments. -or- typeName represents a generic type that has an incorrect number of type arguments. -or- typeName represents a generic type, and one of its type arguments does not satisfy the constraints for the corresponding type parameter. - throwIfNotFound is true and the assembly or one of its dependencies was not found. - The assembly or one of its dependencies was found, but could not be loaded. - The assembly or one of its dependencies is not valid. -or- The assembly was compiled with a later version of the common language runtime than the version that is currently loaded. - - - Gets a that describes the layout of the current type. - Gets a that describes the gross layout features of the current type. - The invoked method is not supported in the base class. - - - Returns a String representing the name of the current Type. - A representing the name of the current . - - - Gets the handle for the current . - The handle for the current . - The .NET Compact Framework does not currently support this property. - - - Gets the initializer for the type. - An object that contains the name of the class constructor for the . - - - Indicates the type provided by the common language runtime that represents this type. - The underlying system type for the . - - - The exception that is thrown when a method attempts to use a type that it does not have access to. - - - Initializes a new instance of the class with a system-supplied message that describes the error. - - - Initializes a new instance of the class with a specified message that describes the error. - The message that describes the exception. The caller of this constructor must ensure that this string has been localized for the current system culture. - - - Initializes a new instance of the class with serialized data. - The object that holds the serialized data. - The contextual information about the source or destination. - - - Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. - The message that describes the exception. The caller of this constructor must ensure that this string has been localized for the current system culture. - The exception that is the cause of the current exception. If the inner parameter is not null, the current exception is raised in a catch block that handles the inner exception. - - - Specifies the type of an object. - - - A simple type representing Boolean values of true or false. - - - - An integral type representing unsigned 8-bit integers with values between 0 and 255. - - - - An integral type representing unsigned 16-bit integers with values between 0 and 65535. The set of possible values for the type corresponds to the Unicode character set. - - - - A type representing a date and time value. - - - - A database null (column) value. - - - - A simple type representing values ranging from 1.0 x 10 -28 to approximately 7.9 x 10 28 with 28-29 significant digits. - - - - A floating point type representing values ranging from approximately 5.0 x 10 -324 to 1.7 x 10 308 with a precision of 15-16 digits. - - - - A null reference. - - - - An integral type representing signed 16-bit integers with values between -32768 and 32767. - - - - An integral type representing signed 32-bit integers with values between -2147483648 and 2147483647. - - - - An integral type representing signed 64-bit integers with values between -9223372036854775808 and 9223372036854775807. - - - - A general type representing any reference or value type not explicitly represented by another TypeCode. - - - - An integral type representing signed 8-bit integers with values between -128 and 127. - - - - A floating point type representing values ranging from approximately 1.5 x 10 -45 to 3.4 x 10 38 with a precision of 7 digits. - - - - A sealed class type representing Unicode character strings. - - - - An integral type representing unsigned 16-bit integers with values between 0 and 65535. - - - - An integral type representing unsigned 32-bit integers with values between 0 and 4294967295. - - - - An integral type representing unsigned 64-bit integers with values between 0 and 18446744073709551615. - - - - Describes objects that contain both a managed pointer to a location and a runtime representation of the type that may be stored at that location. - - - Checks if this object is equal to the specified object. - The object with which to compare the current object. - true if this object is equal to the specified object; otherwise, false. - This method is not implemented. - - - Returns the hash code of this object. - The hash code of this object. - - - Returns the type of the target of the specified TypedReference. - The value whose target's type is to be returned. - The type of the target of the specified TypedReference. - - - Makes a TypedReference for a field identified by a specified object and list of field descriptions. - An object that contains the field described by the first element of flds. - A list of field descriptions where each element describes a field that contains the field described by the succeeding element. Each described field must be a value type. The field descriptions must be RuntimeFieldInfo objects supplied by the type system. - A for the field described by the last element of flds. - target or flds is null. -or- An element of flds is null. - The flds array has no elements. -or- An element of flds is not a RuntimeFieldInfo object. -or- The or property of an element of flds is true. - Parameter target does not contain the field described by the first element of flds, or an element of flds describes a field that is not contained in the field described by the succeeding element of flds. -or- The field described by an element of flds is not a value type. - - - Converts the specified value to a TypedReference. This method is not supported. - The target of the conversion. - The value to be converted. - In all cases. - - - Returns the internal metadata type handle for the specified TypedReference. - The TypedReference for which the type handle is requested. - The internal metadata type handle for the specified TypedReference. - - - Converts the specified TypedReference to an Object. - The TypedReference to be converted. - An converted from a TypedReference. - - - The exception that is thrown as a wrapper around the exception thrown by the class initializer. This class cannot be inherited. - - - Initializes a new instance of the class with the default error message, the specified type name, and a reference to the inner exception that is the root cause of this exception. - The fully qualified name of the type that fails to initialize. - The exception that is the cause of the current exception. If the innerException parameter is not a null reference (Nothing in Visual Basic), the current exception is raised in a catch block that handles the inner exception. - - - Sets the object with the type name and additional exception information. - The that holds the serialized object data about the exception being thrown. - The that contains contextual information about the source or destination. - - - Gets the fully qualified name of the type that fails to initialize. - The fully qualified name of the type that fails to initialize. - - - The exception that is thrown when type-loading failures occur. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with a specified error message. - The message that describes the error. - - - Initializes a new instance of the class with serialized data. - The object that holds the serialized object data. - The contextual information about the source or destination. - The info object is null. - - - Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. - The error message that explains the reason for the exception. - The exception that is the cause of the current exception. If the inner parameter is not null, the current exception is raised in a catch block that handles the inner exception. - - - Sets the object with the class name, method name, resource ID, and additional exception information. - The object that holds the serialized object data. - The contextual information about the source or destination. - The info object is null. - - - Gets the error message for this exception. - The error message string. - - - Gets the fully qualified name of the type that causes the exception. - The fully qualified type name. - - - The exception that is thrown when there is an attempt to access an unloaded class. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with a specified error message. - The message that describes the error. - - - Initializes a new instance of the class with serialized data. - The object that holds the serialized object data. - The contextual information about the source or destination. - - - Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. - The error message that explains the reason for the exception. - The exception that is the cause of the current exception. If the innerException parameter is not a null reference (Nothing in Visual Basic), the current exception is raised in a catch block that handles the inner exception. - - - Represents a 16-bit unsigned integer. - - - Compares this instance to a specified object and returns an indication of their relative values. - An object to compare, or null. -

A signed number indicating the relative values of this instance and value.

-
Return Value

-

Description

-

Less than zero

-

This instance is less than value.

-

Zero

-

This instance is equal to value.

-

Greater than zero

-

This instance is greater than value.

-

-or-

-

value is null.

-

-
- value is not a . -
- - Compares this instance to a specified 16-bit unsigned integer and returns an indication of their relative values. - An unsigned integer to compare. -

A signed number indicating the relative values of this instance and value.

-
Return Value

-

Description

-

Less than zero

-

This instance is less than value.

-

Zero

-

This instance is equal to value.

-

Greater than zero

-

This instance is greater than value.

-

-
-
- - Returns a value indicating whether this instance is equal to a specified object. - An object to compare to this instance. - true if obj is an instance of and equals the value of this instance; otherwise, false. - - - Returns a value indicating whether this instance is equal to a specified value. - A 16-bit unsigned integer to compare to this instance. - true if obj has the same value as this instance; otherwise, false. - - - Returns the hash code for this instance. - A 32-bit signed integer hash code. - - - Returns the for value type . - The enumerated constant, . - - - Represents the largest possible value of . This field is constant. - - - - Represents the smallest possible value of . This field is constant. - - - - Converts the string representation of a number in a specified style and culture-specific format to its 16-bit unsigned integer equivalent. - A string that represents the number to convert. The string is interpreted by using the style specified by the style parameter. - A bitwise combination of enumeration values that indicate the style elements that can be present in s. A typical value to specify is . - An object that supplies culture-specific formatting information about s. - A 16-bit unsigned integer equivalent to the number specified in s. - s is null. - style is not a value. -or- style is not a combination of and values. - s is not in a format compliant with style. - s represents a number that is less than or greater than . -or- s includes non-zero, fractional digits. - - - Converts the string representation of a number in a specified culture-specific format to its 16-bit unsigned integer equivalent. - A string that represents the number to convert. - An object that supplies culture-specific formatting information about s. - A 16-bit unsigned integer equivalent to the number specified in s. - s is null. - s is not in the correct format. - s represents a number less than or greater than . - - - Converts the string representation of a number to its 16-bit unsigned integer equivalent. - A string that represents the number to convert. - A 16-bit unsigned integer equivalent to the number contained in s. - s is null. - s is not in the correct format. - s represents a number less than or greater than . - - - Converts the string representation of a number in a specified style to its 16-bit unsigned integer equivalent. This method is not CLS-compliant. The CLS-compliant alternative is . - A string that represents the number to convert. The string is interpreted by using the style specified by the style parameter. - A bitwise combination of the enumeration values that specify the permitted format of s. A typical value to specify is . - A 16-bit unsigned integer equivalent to the number specified in s. - s is null. - style is not a value. -or- style is not a combination of and values. - s is not in a format compliant with style. - s represents a number less than or greater than . -or- s includes non-zero, fractional digits. - - - Converts the numeric value of this instance to its equivalent string representation. - The string representation of the value of this instance, which consists of a sequence of digits ranging from 0 to 9, without a sign or leading zeros. - - - Converts the numeric value of this instance to its equivalent string representation using the specified format and culture-specific format information. - A numeric format string. - An object that supplies culture-specific formatting information. - The string representation of the value of this instance, as specified by format and provider. - format is invalid. - - - Converts the numeric value of this instance to its equivalent string representation using the specified format. - A numeric format string. - The string representation of the value of this instance as specified by format. - The format parameter is invalid. - - - Converts the numeric value of this instance to its equivalent string representation using the specified culture-specific format information. - An object that supplies culture-specific formatting information. - The string representation of the value of this instance, which consists of a sequence of digits ranging from 0 to 9, without a sign or leading zeros. - - - Tries to convert the string representation of a number to its 16-bit unsigned integer equivalent. A return value indicates whether the conversion succeeded or failed. - A string that represents the number to convert. - When this method returns, contains the 16-bit unsigned integer value that is equivalent to the number contained in s, if the conversion succeeded, or zero if the conversion failed. The conversion fails if the s parameter is null or , is not in the correct format. , or represents a number less than or greater than . This parameter is passed uninitialized; any value originally supplied in result will be overwritten. - true if s was converted successfully; otherwise, false. - - - Tries to convert the string representation of a number in a specified style and culture-specific format to its 16-bit unsigned integer equivalent. A return value indicates whether the conversion succeeded or failed. - A string that represents the number to convert. The string is interpreted by using the style specified by the style parameter. - A bitwise combination of enumeration values that indicates the permitted format of s. A typical value to specify is . - An object that supplies culture-specific formatting information about s. - When this method returns, contains the 16-bit unsigned integer value equivalent to the number contained in s, if the conversion succeeded, or zero if the conversion failed. The conversion fails if the s parameter is null or , is not in a format compliant with style, or represents a number less than or greater than . This parameter is passed uninitialized; any value originally supplied in result will be overwritten. - true if s was converted successfully; otherwise, false. - style is not a value. -or- style is not a combination of and values. - - - For a description of this member, see . - This parameter is ignored. - true if the value of the current instance is not zero; otherwise, false. - - - For a description of this member, see . - This parameter is ignored. - The value of the current instance, converted to a . - - - For a description of this member, see . - This parameter is ignored. - The value of the current instance, converted to a . - - - This conversion is not supported. Attempting to use this method throws an . - This parameter is ignored. - This conversion is not supported. No value is returned. - In all cases. - - - For a description of this member, see . - This parameter is ignored. - The current value of this instance, converted to a . - - - For a description of this member, see . - This parameter is ignored. - The current value of this instance, converted to a . - - - For a description of this member, see . - This parameter is ignored. - The current value of this instance, converted to an . - - - For a description of this member, see . - This parameter is ignored. - The value of this instance, converted to an . - - - For a description of this member, see . - This parameter is ignored. - The current value of this instance, converted to an . - - - For a description of this member, see . - This parameter is ignored. - The current value of this instance, converted to an . - - - For a description of this member, see . - This parameter is ignored. - The current value pf this instance, converted to a . - - - For a description of this member, see . - The type to which to convert this value. - An implementation that supplies information about the format of the returned value. - The current value of this instance, converted to type. - - - For a description of this member, see . - This parameter is ignored. - The current value of this instance, unchanged. - - - For a description of this member, see . - This parameter is ignored. - The current value of this instance, converted to a . - - - For a description of this member, see . - This parameter is ignored. - The current value of this instance, converted to a . - - - Represents a 32-bit unsigned integer. - - - Compares this instance to a specified object and returns an indication of their relative values. - An object to compare, or null. -

A signed number indicating the relative values of this instance and value.

-
Return Value

-

Description

-

Less than zero

-

This instance is less than value.

-

Zero

-

This instance is equal to value.

-

Greater than zero

-

This instance is greater than value.

-

-or-

-

value is null.

-

-
- value is not a . -
- - Compares this instance to a specified 32-bit unsigned integer and returns an indication of their relative values. - An unsigned integer to compare. -

A signed number indicating the relative values of this instance and value.

-
Return value

-

Description

-

Less than zero

-

This instance is less than value.

-

Zero

-

This instance is equal to value.

-

Greater than zero

-

This instance is greater than value.

-

-
-
- - Returns a value indicating whether this instance is equal to a specified object. - An object to compare with this instance. - true if obj is an instance of and equals the value of this instance; otherwise, false. - - - Returns a value indicating whether this instance is equal to a specified . - A value to compare to this instance. - true if obj has the same value as this instance; otherwise, false. - - - Returns the hash code for this instance. - A 32-bit signed integer hash code. - - - Returns the for value type . - The enumerated constant, . - - - Represents the largest possible value of . This field is constant. - - - - Represents the smallest possible value of . This field is constant. - - - - Converts the string representation of a number in a specified style and culture-specific format to its 32-bit unsigned integer equivalent. - A string representing the number to convert. The string is interpreted by using the style specified by the style parameter. - A bitwise combination of enumeration values that indicates the style elements that can be present in s. A typical value to specify is . - An object that supplies culture-specific formatting information about s. - A 32-bit unsigned integer equivalent to the number specified in s. - s is null. - style is not a value. -or- style is not a combination of and values. - s is not in a format compliant with style. - s represents a number that is less than or greater than . -or- s includes non-zero, fractional digits. - - - Converts the string representation of a number in a specified culture-specific format to its 32-bit unsigned integer equivalent. - A string that represents the number to convert. - An object that supplies culture-specific formatting information about s. - A 32-bit unsigned integer equivalent to the number specified in s. - s is null. - s is not in the correct style. - s represents a number that is less than or greater than . - - - Converts the string representation of a number to its 32-bit unsigned integer equivalent. - A string representing the number to convert. - A 32-bit unsigned integer equivalent to the number contained in s. - The s parameter is null. - The s parameter is not of the correct format. - The s parameter represents a number that is less than or greater than . - - - Converts the string representation of a number in a specified style to its 32-bit unsigned integer equivalent. - A string representing the number to convert. The string is interpreted by using the style specified by the style parameter. - A bitwise combination of the enumeration values that specify the permitted format of s. A typical value to specify is . - A 32-bit unsigned integer equivalent to the number specified in s. - s is null. - style is not a value. -or- style is not a combination of and values. - s is not in a format compliant with style. - s represents a number that is less than or greater than . -or- s includes non-zero, fractional digits. - - - Converts the numeric value of this instance to its equivalent string representation. - The string representation of the value of this instance, consisting of a sequence of digits ranging from 0 to 9, without a sign or leading zeroes. - - - Converts the numeric value of this instance to its equivalent string representation using the specified format and culture-specific format information. - A numeric format string. - An object that supplies culture-specific formatting information about this instance. - The string representation of the value of this instance as specified by format and provider. - The format parameter is invalid. - - - Converts the numeric value of this instance to its equivalent string representation using the specified format. - A numeric format string. - The string representation of the value of this instance as specified by format. - The format parameter is invalid. - - - Converts the numeric value of this instance to its equivalent string representation using the specified culture-specific format information. - An object that supplies culture-specific formatting information. - The string representation of the value of this instance, which consists of a sequence of digits ranging from 0 to 9, without a sign or leading zeros. - - - Tries to convert the string representation of a number to its 32-bit unsigned integer equivalent. A return value indicates whether the conversion succeeded or failed. - A string that represents the number to convert. - When this method returns, contains the 32-bit unsigned integer value that is equivalent to the number contained in s, if the conversion succeeded, or zero if the conversion failed. The conversion fails if the s parameter is null or , is not of the correct format, or represents a number that is less than or greater than . This parameter is passed uninitialized; any value originally supplied in result will be overwritten. - true if s was converted successfully; otherwise, false. - - - Tries to convert the string representation of a number in a specified style and culture-specific format to its 32-bit unsigned integer equivalent. A return value indicates whether the conversion succeeded or failed. - A string that represents the number to convert. The string is interpreted by using the style specified by the style parameter. - A bitwise combination of enumeration values that indicates the permitted format of s. A typical value to specify is . - An object that supplies culture-specific formatting information about s. - When this method returns, contains the 32-bit unsigned integer value equivalent to the number contained in s, if the conversion succeeded, or zero if the conversion failed. The conversion fails if the s parameter is null or , is not in a format compliant with style, or represents a number that is less than or greater than . This parameter is passed uninitialized; any value originally supplied in result will be overwritten. - true if s was converted successfully; otherwise, false. - style is not a value. -or- style is not a combination of and values. - - - For a description of this member, see . - This parameter is ignored. - true if the value of the current instance is not zero; otherwise, false. - - - For a description of this member, see . - This parameter is ignored. - The value of the current instance, converted to a . - - - For a description of this member, see . - This parameter is ignored. - The value of the current instance, converted to a . - - - This conversion is not supported. Attempting to use this method throws an . - This parameter is ignored. - This conversion is not supported. No value is returned. - In all cases. - - - For a description of this member, see . - This parameter is ignored. - The value of the current instance, converted to a . - - - For a description of this member, see . - This parameter is ignored. - The value of the current instance, converted to a . - - - For a description of this member, see . - This parameter is ignored. - The value of the current instance, converted to an . - - - For a description of this member, see . - This parameter is ignored. - The value of the current instance, converted to an . - - - For a description of this member, see . - This parameter is ignored. - The value of the current instance, converted to an . - - - For a description of this member, see . - This parameter is ignored. - The value of the current instance, converted to an . - - - For a description of this member, see . - This parameter is ignored. - The value of the current instance, converted to a . - - - For a description of this member, see . - The type to which to convert this value. - An implementation that supplies culture-specific information about the format of the returned value. - The value of the current instance, converted to type. - - - For a description of this member, see . - This parameter is ignored. - The value of the current instance, converted to a . - - - For a description of this member, see . - This parameter is ignored. - The value of the current instance, unchanged. - - - For a description of this member, see . - This parameter is ignored. - The value of the current instance, converted to a . - - - Represents a 64-bit unsigned integer. - - - Compares this instance to a specified object and returns an indication of their relative values. - An object to compare, or null. -

A signed number indicating the relative values of this instance and value.

-
Return Value

-

Description

-

Less than zero

-

This instance is less than value.

-

Zero

-

This instance is equal to value.

-

Greater than zero

-

This instance is greater than value.

-

-or-

-

value is null.

-

-
- value is not a . -
- - Compares this instance to a specified 64-bit unsigned integer and returns an indication of their relative values. - An unsigned integer to compare. -

A signed number indicating the relative values of this instance and value.

-
Return Value

-

Description

-

Less than zero

-

This instance is less than value.

-

Zero

-

This instance is equal to value.

-

Greater than zero

-

This instance is greater than value.

-

-
-
- - Returns a value indicating whether this instance is equal to a specified object. - An object to compare to this instance. - true if obj is an instance of and equals the value of this instance; otherwise, false. - - - Returns a value indicating whether this instance is equal to a specified value. - A value to compare to this instance. - true if obj has the same value as this instance; otherwise, false. - - - Returns the hash code for this instance. - A 32-bit signed integer hash code. - - - Returns the for value type . - The enumerated constant, . - - - Represents the largest possible value of . This field is constant. - - - - Represents the smallest possible value of . This field is constant. - - - - Converts the string representation of a number in a specified style and culture-specific format to its 64-bit unsigned integer equivalent. - A string that represents the number to convert. The string is interpreted by using the style specified by the style parameter. - A bitwise combination of enumeration values that indicates the style elements that can be present in s. A typical value to specify is . - An object that supplies culture-specific formatting information about s. - A 64-bit unsigned integer equivalent to the number specified in s. - The s parameter is null. - style is not a value. -or- style is not a combination of and values. - The s parameter is not in a format compliant with style. - The s parameter represents a number less than or greater than . -or- s includes non-zero, fractional digits. - - - Converts the string representation of a number in a specified culture-specific format to its 64-bit unsigned integer equivalent. - A string that represents the number to convert. - An object that supplies culture-specific formatting information about s. - A 64-bit unsigned integer equivalent to the number specified in s. - The s parameter is null. - The s parameter is not in the correct style. - The s parameter represents a number less than or greater than . - - - Converts the string representation of a number to its 64-bit unsigned integer equivalent. - A string that represents the number to convert. - A 64-bit unsigned integer equivalent to the number contained in s. - The s parameter is null. - The s parameter is not in the correct format. - The s parameter represents a number less than or greater than . - - - Converts the string representation of a number in a specified style to its 64-bit unsigned integer equivalent. - A string that represents the number to convert. The string is interpreted by using the style specified by the style parameter. - A bitwise combination of the enumeration values that specifies the permitted format of s. A typical value to specify is . - A 64-bit unsigned integer equivalent to the number specified in s. - The s parameter is null. - style is not a value. -or- style is not a combination of and values. - The s parameter is not in a format compliant with style. - The s parameter represents a number less than or greater than . -or- s includes non-zero, fractional digits. - - - Converts the numeric value of this instance to its equivalent string representation. - The string representation of the value of this instance, consisting of a sequence of digits ranging from 0 to 9, without a sign or leading zeroes. - - - Converts the numeric value of this instance to its equivalent string representation using the specified format and culture-specific format information. - A numeric format string. - An object that supplies culture-specific formatting information about this instance. - The string representation of the value of this instance as specified by format and provider. - The format parameter is invalid. - - - Converts the numeric value of this instance to its equivalent string representation using the specified format. - A numeric format string. - The string representation of the value of this instance as specified by format. - The format parameter is invalid. - - - Converts the numeric value of this instance to its equivalent string representation using the specified culture-specific format information. - An object that supplies culture-specific formatting information. - The string representation of the value of this instance, consisting of a sequence of digits ranging from 0 to 9, without a sign or leading zeros. - - - Tries to convert the string representation of a number to its 64-bit unsigned integer equivalent. A return value indicates whether the conversion succeeded or failed. - A string that represents the number to convert. - When this method returns, contains the 64-bit unsigned integer value that is equivalent to the number contained in s, if the conversion succeeded, or zero if the conversion failed. The conversion fails if the s parameter is null or , is not of the correct format, or represents a number less than or greater than . This parameter is passed uninitialized; any value originally supplied in result will be overwritten. - true if s was converted successfully; otherwise, false. - - - Tries to convert the string representation of a number in a specified style and culture-specific format to its 64-bit unsigned integer equivalent. A return value indicates whether the conversion succeeded or failed. - A string that represents the number to convert. The string is interpreted by using the style specified by the style parameter. - A bitwise combination of enumeration values that indicates the permitted format of s. A typical value to specify is . - An object that supplies culture-specific formatting information about s. - When this method returns, contains the 64-bit unsigned integer value equivalent to the number contained in s, if the conversion succeeded, or zero if the conversion failed. The conversion fails if the s parameter is null or , is not in a format compliant with style, or represents a number less than or greater than . This parameter is passed uninitialized; any value originally supplied in result will be overwritten. - true if s was converted successfully; otherwise, false. - style is not a value. -or- style is not a combination of and values. - - - For a description of this member, see . - This parameter is ignored. - true if the value of the current instance is not zero; otherwise, false. - - - For a description of this member, see . - This parameter is ignored. - The value of the current instance, converted to a . - - - For a description of this member, see . - This parameter is ignored. - The value of the current instance, converted to a . - - - This conversion is not supported. Attempting to use this method throws an . - This parameter is ignored. - This conversion is not supported. No value is returned. - In all cases. - - - For a description of this member, see . - This parameter is ignored. - The value of the current instance, converted to a . - - - For a description of this member, see . - This parameter is ignored. - The value of the current instance, converted to a . - - - For a description of this member, see . - This parameter is ignored. - The value of the current instance, converted to an . - - - For a description of this member, see . - This parameter is ignored. - The value of the current instance, converted to an . - - - For a description of this member, see . - This parameter is ignored. - The value of the current instance, converted to an . - - - For a description of this member, see . - This parameter is ignored. - The value of the current instance, converted to an . - - - For a description of this member, see . - This parameter is ignored. - The value of the current instance, converted to a . - - - For a description of this member, see . - The type to which to convert this value. - An implementation that supplies information about the format of the returned value. - The value of the current instance, converted to type. - - - For a description of this member, see . - This parameter is ignored. - The value of the current instance, converted to a . - - - For a description of this member, see . - This parameter is ignored. - The value of the current instance, converted to a . - - - For a description of this member, see . - This parameter is ignored. - The value of the current instance, unchanged. - - - A platform-specific type that is used to represent a pointer or a handle. - - - Initializes a new instance of the structure using the specified 32-bit pointer or handle. - A pointer or handle contained in a 32-bit unsigned integer. - - - Initializes a new instance of using the specified 64-bit pointer or handle. - A pointer or handle contained in a 64-bit unsigned integer. - On a 32-bit platform, value is too large to represent as an . - - - Initializes a new instance of using the specified pointer to an unspecified type. - A pointer to an unspecified type. - - - Adds an offset to the value of an unsigned pointer. - The unsigned pointer to add the offset to. - The offset to add. - A new unsigned pointer that reflects the addition of offset to pointer. - - - Returns a value indicating whether this instance is equal to a specified object. - An object to compare with this instance or null. - true if obj is an instance of and equals the value of this instance; otherwise, false. - - - Returns the hash code for this instance. - A 32-bit signed integer hash code. - - - Adds an offset to the value of an unsigned pointer. - The unsigned pointer to add the offset to. - The offset to add. - A new unsigned pointer that reflects the addition of offset to pointer. - - - Determines whether two specified instances of are equal. - The first pointer or handle to compare. - The second pointer or handle to compare. - true if value1 equals value2; otherwise, false. - - - - - - - - - - - - - - - - - - - - - - - - - - - Determines whether two specified instances of are not equal. - The first pointer or handle to compare. - The second pointer or handle to compare. - true if value1 does not equal value2; otherwise, false. - - - Subtracts an offset from the value of an unsigned pointer. - The unsigned pointer to subtract the offset from. - The offset to subtract. - A new unsigned pointer that reflects the subtraction of offset from pointer. - - - Gets the size of this instance. - The size of a pointer or handle on this platform, measured in bytes. The value of this property is 4 on a 32-bit platform, and 8 on a 64-bit platform. - - - Subtracts an offset from the value of an unsigned pointer. - The unsigned pointer to subtract the offset from. - The offset to subtract. - A new unsigned pointer that reflects the subtraction of offset from pointer. - - - Converts the value of this instance to a pointer to an unspecified type. - A pointer to ; that is, a pointer to memory containing data of an unspecified type. - - - Converts the numeric value of this instance to its equivalent string representation. - The string representation of the value of this instance. - - - Converts the value of this instance to a 32-bit unsigned integer. - A 32-bit unsigned integer equal to the value of this instance. - On a 64-bit platform, the value of this instance is too large to represent as a 32-bit unsigned integer. - - - Converts the value of this instance to a 64-bit unsigned integer. - A 64-bit unsigned integer equal to the value of this instance. - - - A read-only field that represents a pointer or handle that has been initialized to zero. - - - - Populates a object with the data needed to serialize the current object. - The object to populate with data. - The destination for this serialization. (This parameter is not used; specify null.) - info is null. - - - The exception that is thrown when the operating system denies access because of an I/O error or a specific type of security error. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with a specified error message. - The message that describes the error. - - - Initializes a new instance of the class with serialized data. - The that holds the serialized object data about the exception being thrown. - The that contains contextual information about the source or destination. - - - Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. - The error message that explains the reason for the exception. - The exception that is the cause of the current exception. If the inner parameter is not a null reference (Nothing in Visual Basic), the current exception is raised in a catch block that handles the inner exception. - - - Provides data for the event that is raised when there is an exception that is not handled in any application domain. - - - Initializes a new instance of the class with the exception object and a common language runtime termination flag. - The exception that is not handled. - true if the runtime is terminating; otherwise, false. - - - Gets the unhandled exception object. - The unhandled exception object. - - - Indicates whether the common language runtime is terminating. - true if the runtime is terminating; otherwise, false. - - - Represents the method that will handle the event raised by an exception that is not handled by the application domain. - The source of the unhandled exception event. - An UnhandledExceptionEventArgs that contains the event data. - - - Provides an object representation of a uniform resource identifier (URI) and easy access to the parts of the URI. - - - Initializes a new instance of the class with the specified URI. - A URI. - uriString is null. -

-


In the .NET for Windows Store apps or the Portable Class Library, catch the base class exception, , instead.

-

- - uriString is empty.

-

-or-

-

The scheme specified in uriString is not correctly formed. See .

-

-or-

-

uriString contains too many slashes.

-

-or-

-

The password specified in uriString is not valid.

-

-or-

-

The host name specified in uriString is not valid.

-

-or-

-

The file name specified in uriString is not valid.

-

-or-

-

The user name specified in uriString is not valid.

-

-or-

-

The host or authority name specified in uriString cannot be terminated by backslashes.

-

-or-

-

The port number specified in uriString is not valid or cannot be parsed.

-

-or-

-

The length of uriString exceeds 65519 characters.

-

-or-

-

The length of the scheme specified in uriString exceeds 1023 characters.

-

-or-

-

There is an invalid character sequence in uriString.

-

-or-

-

The MS-DOS path specified in uriString must start with c:\\.

-
-
- - Initializes a new instance of the class from the specified instances of the and classes. - An instance of the class containing the information required to serialize the new instance. - An instance of the class containing the source of the serialized stream associated with the new instance. - The serializationInfo parameter contains a null URI. - The serializationInfo parameter contains a URI that is empty. -or- The scheme specified is not correctly formed. See . -or- The URI contains too many slashes. -or- The password specified in the URI is not valid. -or- The host name specified in URI is not valid. -or- The file name specified in the URI is not valid. -or- The user name specified in the URI is not valid. -or- The host or authority name specified in the URI cannot be terminated by backslashes. -or- The port number specified in the URI is not valid or cannot be parsed. -or- The length of URI exceeds 65519 characters. -or- The length of the scheme specified in the URI exceeds 1023 characters. -or- There is an invalid character sequence in the URI. -or- The MS-DOS path specified in the URI must start with c:\\. - - - Initializes a new instance of the class with the specified URI, with explicit control of character escaping. - The URI. - true if uriString is completely escaped; otherwise, false. - uriString is null. - uriString is empty or contains only spaces. -or- The scheme specified in uriString is not valid. -or- uriString contains too many slashes. -or- The password specified in uriString is not valid. -or- The host name specified in uriString is not valid. -or- The file name specified in uriString is not valid. -or- The user name specified in uriString is not valid. -or- The host or authority name specified in uriString cannot be terminated by backslashes. -or- The port number specified in uriString is not valid or cannot be parsed. -or- The length of uriString exceeds 65519 characters. -or- The length of the scheme specified in uriString exceeds 1023 characters. -or- There is an invalid character sequence in uriString. -or- The MS-DOS path specified in uriString must start with c:\\. - - - Initializes a new instance of the class with the specified URI. This constructor allows you to specify if the URI string is a relative URI, absolute URI, or is indeterminate. - A string that identifies the resource to be represented by the instance. - Specifies whether the URI string is a relative URI, absolute URI, or is indeterminate. - uriKind is invalid. - uriString is null. -

-


In the .NET for Windows Store apps or the Portable Class Library, catch the base class exception, , instead.

-

- - uriString contains a relative URI and uriKind is .

-

or

-

uriString contains an absolute URI and uriKind is .

-

or

-

uriString is empty.

-

-or-

-

The scheme specified in uriString is not correctly formed. See .

-

-or-

-

uriString contains too many slashes.

-

-or-

-

The password specified in uriString is not valid.

-

-or-

-

The host name specified in uriString is not valid.

-

-or-

-

The file name specified in uriString is not valid.

-

-or-

-

The user name specified in uriString is not valid.

-

-or-

-

The host or authority name specified in uriString cannot be terminated by backslashes.

-

-or-

-

The port number specified in uriString is not valid or cannot be parsed.

-

-or-

-

The length of uriString exceeds 65519 characters.

-

-or-

-

The length of the scheme specified in uriString exceeds 1023 characters.

-

-or-

-

There is an invalid character sequence in uriString.

-

-or-

-

The MS-DOS path specified in uriString must start with c:\\.

-
-
- - Initializes a new instance of the class based on the specified base URI and relative URI string. - The base URI. - The relative URI to add to the base URI. - baseUri is null. - baseUri is not an absolute instance. - - In the [.NET for Windows Store apps](http://go.microsoft.com/fwlink/?LinkID=247912) or the [Portable Class Library](~/docs/standard/cross-platform/cross-platform-development-with-the-portable-class-library.md), catch the base class exception, , instead. - - The URI formed by combining baseUri and relativeUri is empty or contains only spaces. -or- The scheme specified in the URI formed by combining baseUri and relativeUri is not valid. -or- The URI formed by combining baseUri and relativeUri contains too many slashes. -or- The password specified in the URI formed by combining baseUri and relativeUri is not valid. -or- The host name specified in the URI formed by combining baseUri and relativeUri is not valid. -or- The file name specified in the URI formed by combining baseUri and relativeUri is not valid. -or- The user name specified in the URI formed by combining baseUri and relativeUri is not valid. -or- The host or authority name specified in the URI formed by combining baseUri and relativeUri cannot be terminated by backslashes. -or- The port number specified in the URI formed by combining baseUri and relativeUri is not valid or cannot be parsed. -or- The length of the URI formed by combining baseUri and relativeUri exceeds 65519 characters. -or- The length of the scheme specified in the URI formed by combining baseUri and relativeUri exceeds 1023 characters. -or- There is an invalid character sequence in the URI formed by combining baseUri and relativeUri. -or- The MS-DOS path specified in uriString must start with c:\\. - - - Initializes a new instance of the class based on the combination of a specified base instance and a relative instance. - An absolute that is the base for the new instance. - A relative instance that is combined with baseUri. - baseUri is not an absolute instance. - baseUri is null. - baseUri is not an absolute instance. - - In the [.NET for Windows Store apps](http://go.microsoft.com/fwlink/?LinkID=247912) or the [Portable Class Library](~/docs/standard/cross-platform/cross-platform-development-with-the-portable-class-library.md), catch the base class exception, , instead. - - The URI formed by combining baseUri and relativeUri is empty or contains only spaces. -or- The scheme specified in the URI formed by combining baseUri and relativeUri is not valid. -or- The URI formed by combining baseUri and relativeUri contains too many slashes. -or- The password specified in the URI formed by combining baseUri and relativeUri is not valid. -or- The host name specified in the URI formed by combining baseUri and relativeUri is not valid. -or- The file name specified in the URI formed by combining baseUri and relativeUri is not valid. -or- The user name specified in the URI formed by combining baseUri and relativeUri is not valid. -or- The host or authority name specified in the URI formed by combining baseUri and relativeUri cannot be terminated by backslashes. -or- The port number specified in the URI formed by combining baseUri and relativeUri is not valid or cannot be parsed. -or- The length of the URI formed by combining baseUri and relativeUri exceeds 65519 characters. -or- The length of the scheme specified in the URI formed by combining baseUri and relativeUri exceeds 1023 characters. -or- There is an invalid character sequence in the URI formed by combining baseUri and relativeUri. -or- The MS-DOS path specified in uriString must start with c:\\. - - - Initializes a new instance of the class based on the specified base and relative URIs, with explicit control of character escaping. - The base URI. - The relative URI to add to the base URI. - true if uriString is completely escaped; otherwise, false. - baseUri is null. - baseUri is not an absolute instance. - The URI formed by combining baseUri and relativeUri is empty or contains only spaces. -or- The scheme specified in the URI formed by combining baseUri and relativeUri is not valid. -or- The URI formed by combining baseUri and relativeUri contains too many slashes. -or- The password specified in the URI formed by combining baseUri and relativeUri is not valid. -or- The host name specified in the URI formed by combining baseUri and relativeUri is not valid. -or- The file name specified in the URI formed by combining baseUri and relativeUri is not valid. -or- The user name specified in the URI formed by combining baseUri and relativeUri is not valid. -or- The host or authority name specified in the URI formed by combining baseUri and relativeUri cannot be terminated by backslashes. -or- The port number specified in the URI formed by combining baseUri and relativeUri is not valid or cannot be parsed. -or- The length of the URI formed by combining baseUri and relativeUri exceeds 65519 characters. -or- The length of the scheme specified in the URI formed by combining baseUri and relativeUri exceeds 1023 characters. -or- There is an invalid character sequence in the URI formed by combining baseUri and relativeUri. -or- The MS-DOS path specified in uriString must start with c:\\. - - - Gets the absolute path of the URI. - A containing the absolute path to the resource. - This instance represents a relative URI, and this property is valid only for absolute URIs. - - - Gets the absolute URI. - A containing the entire URI. - This instance represents a relative URI, and this property is valid only for absolute URIs. - - - Gets the Domain Name System (DNS) host name or IP address and the port number for a server. - A containing the authority component of the URI represented by this instance. - This instance represents a relative URI, and this property is valid only for absolute URIs. - - - Converts the internally stored URI to canonical form. - This instance represents a relative URI, and this method is valid only for absolute URIs. - The URI is incorrectly formed. - - - Determines whether the specified host name is a valid DNS name. - The host name to validate. This can be an IPv4 or IPv6 address or an Internet host name. - A that indicates the type of the host name. If the type of the host name cannot be determined or if the host name is null or a zero-length string, this method returns . - - - Determines whether the specified scheme name is valid. - The scheme name to validate. - A value that is true if the scheme name is valid; otherwise, false. - - - Calling this method has no effect. - - - Compares the specified parts of two URIs using the specified comparison rules. - The first . - The second . - A bitwise combination of the values that specifies the parts of uri1 and uri2 to compare. - One of the values that specifies the character escaping used when the URI components are compared. - One of the values. -

An value that indicates the lexical relationship between the compared components.

-
Value

-

Meaning

-

Less than zero

-

uri1 is less than uri2.

-

Zero

-

uri1 equals uri2.

-

Greater than zero

-

uri1 is greater than uri2.

-

-
- comparisonType is not a valid value. -
- - Gets an unescaped host name that is safe to use for DNS resolution. - A that contains the unescaped host part of the URI that is suitable for DNS resolution; or the original unescaped host string, if it is already suitable for resolution. - This instance represents a relative URI, and this property is valid only for absolute URIs. - - - Compares two instances for equality. - The instance or a URI identifier to compare with the current instance. - A value that is true if the two instances represent the same URI; otherwise, false. - - - Converts any unsafe or reserved characters in the path component to their hexadecimal character representations. - The URI passed from the constructor is invalid. This exception can occur if a URI has too many characters or the URI is relative. - - - Converts a string to its escaped representation. - The string to escape. - A that contains the escaped representation of stringToEscape. - stringToEscape is null. - - In the [.NET for Windows Store apps](http://go.microsoft.com/fwlink/?LinkID=247912) or the [Portable Class Library](~/docs/standard/cross-platform/cross-platform-development-with-the-portable-class-library.md), catch the base class exception, , instead. - - The length of stringToEscape exceeds 32766 characters. - - - Converts a string to its escaped representation. - The string to transform to its escaped representation. - The escaped representation of the string. - - - Converts a URI string to its escaped representation. - The string to escape. - A that contains the escaped representation of stringToEscape. - stringToEscape is null. - - In the [.NET for Windows Store apps](http://go.microsoft.com/fwlink/?LinkID=247912) or the [Portable Class Library](~/docs/standard/cross-platform/cross-platform-development-with-the-portable-class-library.md), catch the base class exception, , instead. - - The length of stringToEscape exceeds 32766 characters. - - - Gets the escaped URI fragment. - A that contains any URI fragment information. - This instance represents a relative URI, and this property is valid only for absolute URIs. - - - Gets the decimal value of a hexadecimal digit. - The hexadecimal digit (0-9, a-f, A-F) to convert. - An value that contains a number from 0 to 15 that corresponds to the specified hexadecimal digit. - digit is not a valid hexadecimal digit (0-9, a-f, A-F). - - - Gets the specified components of the current instance using the specified escaping for special characters. - A bitwise combination of the values that specifies which parts of the current instance to return to the caller. - One of the values that controls how special characters are escaped. - A that contains the components. - components is not a combination of valid values. - The current is not an absolute URI. Relative URIs cannot be used with this method. - - - Gets the hash code for the URI. - An containing the hash value generated for this URI. - - - Gets the specified portion of a instance. - One of the values that specifies the end of the URI portion to return. - A that contains the specified portion of the instance. - The current instance is not an absolute instance. - The specified part is not valid. - - - Returns the data needed to serialize the current instance. - A object containing the information required to serialize the . - A object containing the source and destination of the serialized stream associated with the . - - - Converts a specified character into its hexadecimal equivalent. - The character to convert to hexadecimal representation. - The hexadecimal representation of the specified character. - character is greater than 255. - - - Converts a specified hexadecimal representation of a character to the character. - The hexadecimal representation of a character. - The location in pattern where the hexadecimal representation of a character begins. - The character represented by the hexadecimal encoding at position index. If the character at index is not hexadecimal encoded, the character at index is returned. The value of index is incremented to point to the character following the one returned. - index is less than 0 or greater than or equal to the number of characters in pattern. - - - Gets the host component of this instance. - A that contains the host name. This is usually the DNS host name or IP address of the server. - This instance represents a relative URI, and this property is valid only for absolute URIs. - - - Gets the type of the host name specified in the URI. - A member of the enumeration. - This instance represents a relative URI, and this property is valid only for absolute URIs. - - - The RFC 3490 compliant International Domain Name of the host, using Punycode as appropriate. - Returns the hostname, formatted with Punycode according to the IDN standard.. - - - Gets whether the instance is absolute. - A value that is true if the instance is absolute; otherwise, false. - - - Gets whether a character is invalid in a file system name. - The to test. - A value that is true if the specified character is invalid; otherwise false. - - - Determines whether the current instance is a base of the specified instance. - The specified instance to test. - true if the current instance is a base of uri; otherwise, false. - uri is null. - - - Gets whether the port value of the URI is the default for this scheme. - A value that is true if the value in the property is the default port for this scheme; otherwise, false. - This instance represents a relative URI, and this property is valid only for absolute URIs. - - - Gets whether the specified character should be escaped. - The to test. - A value that is true if the specified character should be escaped; otherwise, false. - - - Gets a value indicating whether the specified is a file URI. - A value that is true if the is a file URI; otherwise, false. - This instance represents a relative URI, and this property is valid only for absolute URIs. - - - Determines whether a specified character is a valid hexadecimal digit. - The character to validate. - A value that is true if the character is a valid hexadecimal digit; otherwise false. - - - Determines whether a character in a string is hexadecimal encoded. - The string to check. - The location in pattern to check for hexadecimal encoding. - A value that is true if pattern is hexadecimal encoded at the specified location; otherwise, false. - - - Gets whether the specified references the local host. - A value that is true if this references the local host; otherwise, false. - This instance represents a relative URI, and this property is valid only for absolute URIs. - - - Gets whether the specified character is a reserved character. - The to test. - A value that is true if the specified character is a reserved character otherwise, false. - - - Gets whether the specified is a universal naming convention (UNC) path. - A value that is true if the is a UNC path; otherwise, false. - This instance represents a relative URI, and this property is valid only for absolute URIs. - - - Indicates whether the string used to construct this was well-formed and is not required to be further escaped. - A value that is true if the string was well-formed; else false. - - - Indicates whether the string is well-formed by attempting to construct a URI with the string and ensures that the string does not require further escaping. - The string used to attempt to construct a . - The type of the in uriString. - A value that is true if the string was well-formed; else false. - - - Gets a local operating-system representation of a file name. - A that contains the local operating-system representation of a file name. - This instance represents a relative URI, and this property is valid only for absolute URIs. - - - Determines the difference between two instances. - The URI to compare to the current URI. - If the hostname and scheme of this URI instance and toUri are the same, then this method returns a that represents a relative URI that, when appended to the current URI instance, yields the toUri parameter. If the hostname or scheme is different, then this method returns a that represents the toUri parameter. - toUri is null. - This instance represents a relative URI, and this method is valid only for absolute URIs. - - - Determines the difference between two instances. - The URI to compare to the current URI. - If the hostname and scheme of this URI instance and uri are the same, then this method returns a relative that, when appended to the current URI instance, yields uri. If the hostname or scheme is different, then this method returns a that represents the uri parameter. - uri is null. - This instance represents a relative URI, and this property is valid only for absolute URIs. - - - Determines whether two instances have the same value. - A instance to compare with uri2. - A instance to compare with uri1. - A value that is true if the instances are equivalent; otherwise, false. - - - Determines whether two instances do not have the same value. - A instance to compare with uri2. - A instance to compare with uri1. - A value that is true if the two instances are not equal; otherwise, false. If either parameter is null, this method returns true. - - - Gets the original URI string that was passed to the constructor. - A containing the exact URI specified when this instance was constructed; otherwise, . - This instance represents a relative URI, and this property is valid only for absolute URIs. - - - Parses the URI of the current instance to ensure it contains all the parts required for a valid URI. - The Uri passed from the constructor is invalid. - - - Gets the and properties separated by a question mark (?). - A that contains the and properties separated by a question mark (?). - This instance represents a relative URI, and this property is valid only for absolute URIs. - - - Gets the port number of this URI. - An value that contains the port number for this URI. - This instance represents a relative URI, and this property is valid only for absolute URIs. - - - Gets any query information included in the specified URI. - A that contains any query information included in the specified URI. - This instance represents a relative URI, and this property is valid only for absolute URIs. - - - Gets the scheme name for this URI. - A that contains the scheme for this URI, converted to lowercase. - This instance represents a relative URI, and this property is valid only for absolute URIs. - - - Specifies the characters that separate the communication protocol scheme from the address portion of the URI. This field is read-only. - - - - Gets an array containing the path segments that make up the specified URI. - A array that contains the path segments that make up the specified URI. - This instance represents a relative URI, and this property is valid only for absolute URIs. - - - Gets a canonical string representation for the specified instance. - A instance that contains the unescaped canonical representation of the instance. All characters are unescaped except #, ?, and %. - - - Creates a new using the specified instance and a . - The representing the . - The type of the Uri. - When this method returns, contains the constructed . - A value that is true if the was successfully created; otherwise, false. - - - Creates a new using the specified base and relative instances. - The base . - The relative , represented as a , to add to the base . - When this method returns, contains a constructed from baseUri and relativeUri. This parameter is passed uninitialized. - A value that is true if the was successfully created; otherwise, false. - - - Creates a new using the specified base and relative instances. - The base . - The relative to add to the base . - When this method returns, contains a constructed from baseUri and relativeUri. This parameter is passed uninitialized. - A value that is true if the was successfully created; otherwise, false. - baseUri is null. - - - Converts the specified string by replacing any escape sequences with their unescaped representation. - The to convert. - A that contains the unescaped value of the path parameter. - - - Converts a string to its unescaped representation. - The string to unescape. - A that contains the unescaped representation of stringToUnescape. - stringToUnescape is null. - - - Specifies that the URI is a pointer to a file. This field is read-only. - - - - Specifies that the URI is accessed through the File Transfer Protocol (FTP). This field is read-only. - - - - Specifies that the URI is accessed through the Gopher protocol. This field is read-only. - - - - Specifies that the URI is accessed through the Hypertext Transfer Protocol (HTTP). This field is read-only. - - - - Specifies that the URI is accessed through the Secure Hypertext Transfer Protocol (HTTPS). This field is read-only. - - - - Specifies that the URI is an e-mail address and is accessed through the Simple Mail Transport Protocol (SMTP). This field is read-only. - - - - Specifies that the URI is accessed through the NetPipe scheme used by Windows Communication Foundation (WCF). This field is read-only. - - - - Specifies that the URI is accessed through the NetTcp scheme used by Windows Communication Foundation (WCF). This field is read-only. - - - - Specifies that the URI is an Internet news group and is accessed through the Network News Transport Protocol (NNTP). This field is read-only. - - - - Specifies that the URI is an Internet news group and is accessed through the Network News Transport Protocol (NNTP). This field is read-only. - - - - Indicates that the URI string was completely escaped before the instance was created. - A value that is true if the dontEscape parameter was set to true when the instance was created; otherwise, false. - - - Gets the user name, password, or other user-specific information associated with the specified URI. - A that contains the user information associated with the URI. The returned value does not include the '@' character reserved for delimiting the user information part of the URI. - This instance represents a relative URI, and this property is valid only for absolute URIs. - - - Returns the data needed to serialize the current instance. - A object containing the information required to serialize the . - A object containing the source and destination of the serialized stream associated with the . - - - Provides a custom constructor for uniform resource identifiers (URIs) and modifies URIs for the class. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with the specified URI. - A URI string. - uri is null. -

-


In the .NET for Windows Store apps or the Portable Class Library, catch the base class exception, , instead.

-

- - uri is a zero length string or contains only spaces.

-

-or-

-

The parsing routine detected a scheme in an invalid form.

-

-or-

-

The parser detected more than two consecutive slashes in a URI that does not use the "file" scheme.

-

-or-

-

uri is not a valid URI.

-
-
- - Initializes a new instance of the class with the specified instance. - An instance of the class. - uri is null. - - - Initializes a new instance of the class with the specified scheme and host. - An Internet access protocol. - A DNS-style domain name or IP address. - - - Initializes a new instance of the class with the specified scheme, host, and port. - An Internet access protocol. - A DNS-style domain name or IP address. - An IP port number for the service. - portNumber is less than -1 or greater than 65,535. - - - Initializes a new instance of the class with the specified scheme, host, port number, and path. - An Internet access protocol. - A DNS-style domain name or IP address. - An IP port number for the service. - The path to the Internet resource. - port is less than -1 or greater than 65,535. - - - Initializes a new instance of the class with the specified scheme, host, port number, path and query string or fragment identifier. - An Internet access protocol. - A DNS-style domain name or IP address. - An IP port number for the service. - The path to the Internet resource. - A query string or fragment identifier. - extraValue is neither null nor , nor does a valid fragment identifier begin with a number sign (#), nor a valid query string begin with a question mark (?). - port is less than -1 or greater than 65,535. - - - Compares an existing instance with the contents of the for equality. - The object to compare with the current instance. - true if rparam represents the same as the constructed by this instance; otherwise, false. - - - Gets or sets the fragment portion of the URI. - The fragment portion of the URI. The fragment identifier ("#") is added to the beginning of the fragment. - - - Returns the hash code for the URI. - The hash code generated for the URI. - - - Gets or sets the Domain Name System (DNS) host name or IP address of a server. - The DNS host name or IP address of the server. - - - Gets or sets the password associated with the user that accesses the URI. - The password of the user that accesses the URI. - - - Gets or sets the path to the resource referenced by the URI. - The path to the resource referenced by the URI. - - - Gets or sets the port number of the URI. - The port number of the URI. - The port cannot be set to a value less than -1 or greater than 65,535. - - - Gets or sets any query information included in the URI. - The query information included in the URI. - - - Gets or sets the scheme name of the URI. - The scheme of the URI. - The scheme cannot be set to an invalid scheme name. - - - Returns the display string for the specified instance. - The string that contains the unescaped display string of the . - - In the [.NET for Windows Store apps](http://go.microsoft.com/fwlink/?LinkID=247912) or the [Portable Class Library](~/docs/standard/cross-platform/cross-platform-development-with-the-portable-class-library.md), catch the base class exception, , instead. - - The instance has a bad password. - - - Gets the instance constructed by the specified instance. - A that contains the URI constructed by the . - - In the [.NET for Windows Store apps](http://go.microsoft.com/fwlink/?LinkID=247912) or the [Portable Class Library](~/docs/standard/cross-platform/cross-platform-development-with-the-portable-class-library.md), catch the base class exception, , instead. - - The URI constructed by the properties is invalid. - - - The user name associated with the user that accesses the URI. - The user name of the user that accesses the URI. - - - Specifies the parts of a . - - - The , , , , , , and data. - - - - The data. - - - - The data. - - - - The and data. If no port data is in the Uri and a default port has been assigned to the , the default port is returned. If there is no default port, -1 is returned. - - - - The , , , , and data. - - - - Specifies that the delimiter should be included. - - - - The normalized form of the . - - - - The data. - - - - The and data. Also see . - - - - The data. - - - - The data. - - - - The data. - - - - The , , and data. - - - - The complete context that is needed for Uri Serializers. The context includes the IPv6 scope. - - - - The , , and data. If no port data is in the and a default port has been assigned to the , the default port is returned. If there is no default port, -1 is returned. - - - - The data. If no port data is in the and a default port has been assigned to the , the default port is returned. If there is no default port, -1 is returned. - - - - The data. - - - - Controls how URI information is escaped. - - - Characters that have a reserved meaning in the requested URI components remain escaped. All others are not escaped. - - - - No escaping is performed. - - - - Escaping is performed according to the rules in RFC 2396. - - - - The exception that is thrown when an invalid Uniform Resource Identifier (URI) is detected. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with the specified message. - The error message string. - - - Initializes a new instance of the class from the specified and instances. - A that contains the information that is required to serialize the new . - A that contains the source of the serialized stream that is associated with the new . - - - Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. - The message that describes the exception. The caller of this constructor is required to ensure that this string has been localized for the current system culture. - The exception that is the cause of the current exception. If the innerException parameter is not null, the current exception is raised in a catch block that handles the inner exception. - - - Populates a instance with the data that is needed to serialize the . - A that will hold the serialized data for the . - A that contains the destination of the serialized stream that is associated with the new . - - - Defines host name types for the method. - - - The host is set, but the type cannot be determined. - - - - The host name is a domain name system (DNS) style host name. - - - - The host name is an Internet Protocol (IP) version 4 host address. - - - - The host name is an Internet Protocol (IP) version 6 host address. - - - - The type of the host name is not supplied. - - - - Defines the kinds of s for the and several methods. - - - The Uri is an absolute Uri. - - - - The Uri is a relative Uri. - - - - The kind of the Uri is indeterminate. - - - - Parses a new URI scheme. This is an abstract class. - - - Constructs a default URI parser. - - - Gets the components from a URI. - The URI to parse. - The to retrieve from uri. - One of the values that controls how special characters are escaped. - A string that contains the components. - uriFormat is invalid. - or - uriComponents is not a combination of valid values. - uri requires user-driven parsing - or - uri is not an absolute URI. Relative URIs cannot be used with this method. - - - Initialize the state of the parser and validate the URI. - The T:System.Uri to validate. - Validation errors, if any. - - - Determines whether baseUri is a base URI for relativeUri. - The base URI. - The URI to test. - true if baseUri is a base URI for relativeUri; otherwise, false. - - - Indicates whether the parser for a scheme is registered. - The scheme name to check. - true if schemeName has been registered; otherwise, false. - The schemeName parameter is null. - The schemeName parameter is not valid. - - - Indicates whether a URI is well-formed. - The URI to check. - true if uri is well-formed; otherwise, false. - - - Invoked by a constructor to get a instance - A for the constructed . - - - Invoked by the Framework when a method is registered. - The scheme that is associated with this . - The port number of the scheme. - - - Associates a scheme and port number with a . - The URI parser to register. - The name of the scheme that is associated with this parser. - The default port number for the specified scheme. - uriParser parameter is null - or - schemeName parameter is null. - schemeName parameter is not valid - or - defaultPort parameter is not valid. The defaultPort parameter is less than -1 or greater than 65,534. - - - Called by constructors and to resolve a relative URI. - A base URI. - A relative URI. - Errors during the resolve process, if any. - The string of the resolved relative . - baseUri parameter is not an absolute - or - baseUri parameter requires user-driven parsing. - - - Defines the parts of a URI for the method. - - - The scheme and authority segments of the URI. - - - - The scheme, authority, and path segments of the URI. - - - - The scheme, authority, path, and query segments of the URI. - - - - The scheme segment of the URI. - - - - Converts a type to a type, and vice versa. - - - Initializes a new instance of the class. - - - Returns whether this converter can convert an object of the given type to the type of this converter. - An that provides a format context. - A that represents the type that you want to convert from. - true if sourceType is a type or a type can be assigned from sourceType; otherwise, false. - The sourceType parameter is null. - - - Returns whether this converter can convert the object to the specified type, using the specified context. - An that provides a format context. - A that represents the type that you want to convert to. - true if destinationType is of type , , or ; otherwise, false. - - - Converts the given object to the type of this converter, using the specified context and culture information. - An that provides a format context. - The to use as the current culture. - The to convert. - An that represents the converted value. - The conversion cannot be performed. - - - Converts a given value object to the specified type, using the specified context and culture information. - An that provides a format context. - A . If null is passed, the current culture is assumed. - The to convert. - The to convert the value parameter to. - An that represents the converted value. - The destinationType parameter is null. - The conversion cannot be performed. - - - Returns whether the given value object is a or a can be created from it. - An that provides a format context. - The to test for validity. - true if value is a or a from which a can be created; otherwise, false. - - - Represents a value tuple with a single component. - The type of the value tuple's only element. - - - Initializes a new instance. - The value tuple's first element. - - - Compares the current instance to a specified instance. - The tuple to compare with this instance. -

A signed integer that indicates the relative position of this instance and other in the sort order, as shown in the following able.

-
Vaue

-

Description

-

A negative integer

-

This instance precedes other.

-

Zero

-

This instance and other have the same position in the sort order.

-

A positive integer

-

This instance follows other.

-

-
-
- - Returns a value that indicates whether the current instance is equal to a specified object. - The object to compare with this instance. - true if the current instance is equal to the specified object; otherwise, false. - - - Returns a value that indicates whether the current instance is equal to a specified instance. - The value tuple to compare with this instance. - true if the current instance is equal to the specified tuple; otherwise, false. - - - Calculates the hash code for the current instance. - The hash code for the current instance. - - - Gets the value of the current instance's first element. - - - - Returns a string that represents the value of this instance. - The string representation of this instance. - - - Compares the current instance to a specified object by using a specified comparer and returns an integer that indicates whether the current object is before, after, or in the same position as the specified object in the sort order. - The object to compare with the current instance. - An object that provides custom rules for comparison. -

A signed integer that indicates the relative position of this instance and other in the sort order, as shown in the following able.

-
Vaue

-

Description

-

A negative integer

-

This instance precedes other.

-

Zero

-

This instance and other have the same position in the sort order.

-

A positive integer

-

This instance follows other.

-

-
-
- - Returns a value that indicates whether the current instance is equal to a specified object based on a specified comparison method. - The object to compare with this instance. - An object that defines the method to use to evaluate whether the two objects are equal. - true if the current instance is equal to the specified object; otherwise, false. - - - Calculates the hash code for the current instance by using a specified computation method. - An object whose method calculates the hash code of the current instance. - A 32-bit signed integer hash code. - - - Compares the current instance to a specified object by using a specified comparer and returns an integer that indicates whether the current object is before, after, or in the same position as the specified object in the sort order. - The object to compare with the current instance. -

A signed integer that indicates the relative position of this instance and obj in the sort order, as shown in the following table.

-
Value

-

Description

-

A negative integer

-

This instance precedes other.

-

Zero

-

This instance and other have the same position in the sort order.

-

A positive integer

-

This instance follows other.

-

-
-
- - Represents a value tuple with 2 components. - The type of the value tuple's first element. - The type of the value tuple's second element. - - - Initializes a new instance. - The value tuple's first element. - The value tuple's second element. - - - Compares the current instance to a specified instance. - The tuple to compare with this instance. -

A signed integer that indicates the relative position of this instance and other in the sort order, as shown in the following able.

-
Vaue

-

Description

-

A negative integer

-

This instance precedes other.

-

Zero

-

This instance and other have the same position in the sort order.

-

A positive integer

-

This instance follows other.

-

-
-
- - Returns a value that indicates whether the current instance is equal to a specified object. - The object to compare with this instance. - true if the current instance is equal to the specified object; otherwise, false. - - - Returns a value that indicates whether the current instance is equal to a specified instance. - The value tuple to compare with this instance. - true if the current instance is equal to the specified tuple; otherwise, false. - - - Calculates the hash code for the current instance. - The hash code for the current instance. - - - Gets the value of the current instance's first element. - - - - Gets the value of the current instance's second element. - - - - Returns a string that represents the value of this instance. - The string representation of this instance. - - - Compares the current instance to a specified object by using a specified comparer and returns an integer that indicates whether the current object is before, after, or in the same position as the specified object in the sort order. - The object to compare with the current instance. - An object that provides custom rules for comparison. -

A signed integer that indicates the relative position of this instance and other in the sort order, as shown in the following able.

-
Vaue

-

Description

-

A negative integer

-

This instance precedes other.

-

Zero

-

This instance and other have the same position in the sort order.

-

A positive integer

-

This instance follows other.

-

-
-
- - Returns a value that indicates whether the current instance is equal to a specified object based on a specified comparison method. - The object to compare with this instance. - An object that defines the method to use to evaluate whether the two objects are equal. - true if the current instance is equal to the specified objects; otherwise, false. - - - Calculates the hash code for the current instance by using a specified computation method. - An object whose method calculates the hash code of the current instance. - A 32-bit signed integer hash code. - - - Compares the current instance to a specified object by using a specified comparer and returns an integer that indicates whether the current object is before, after, or in the same position as the specified object in the sort order. - The object to compare with the current instance. -

A signed integer that indicates the relative position of this instance and obj in the sort order, as shown in the following table.

-
Value

-

Description

-

A negative integer

-

This instance precedes other.

-

Zero

-

This instance and other have the same position in the sort order.

-

A positive integer

-

This instance follows other.

-

-
-
- - Represents a value tuple with 3 components. - The type of the value tuple's first element. - The type of the value tuple's second element. - The type of the value tuple's third element. - - - Initializes a new instance. - The value tuple's first element. - The value tuple's second element. - The value tuple's third element. - - - Compares the current instance to a specified instance. - The tuple to compare with this instance. -

A signed integer that indicates the relative position of this instance and other in the sort order, as shown in the following able.

-
Vaue

-

Description

-

A negative integer

-

This instance precedes other.

-

Zero

-

This instance and other have the same position in the sort order.

-

A positive integer

-

This instance follows other.

-

-
-
- - Returns a value that indicates whether the current instance is equal to a specified object. - The object to compare with this instance. - true if the current instance is equal to the specified object; otherwise, false. - - - Returns a value that indicates whether the current instance is equal to a specified instance. - The value tuple to compare with this instance. - true if the current instance is equal to the specified tuple; otherwise, false. - - - Calculates the hash code for the current instance. - The hash code for the current instance. - - - Gets the value of the current instance's first element. - - - - Gets the value of the current instance's second element. - - - - Gets the value of the current instance's third element. - - - - Returns a string that represents the value of this instance. - The string representation of this instance. - - - Compares the current instance to a specified object by using a specified comparer and returns an integer that indicates whether the current object is before, after, or in the same position as the specified object in the sort order. - The object to compare with the current instance. - An object that provides custom rules for comparison. -

A signed integer that indicates the relative position of this instance and other in the sort order, as shown in the following able.

-
Vaue

-

Description

-

A negative integer

-

This instance precedes other.

-

Zero

-

This instance and other have the same position in the sort order.

-

A positive integer

-

This instance follows other.

-

-
-
- - Returns a value that indicates whether the current instance is equal to a specified object based on a specified comparison method. - The object to compare with this instance. - An object that defines the method to use to evaluate whether the two objects are equal. - true if the current instance is equal to the specified objects; otherwise, false. - - - Calculates the hash code for the current instance by using a specified computation method. - An object whose method calculates the hash code of the current instance. - A 32-bit signed integer hash code. - - - Compares the current instance to a specified object by using a specified comparer and returns an integer that indicates whether the current object is before, after, or in the same position as the specified object in the sort order. - The object to compare with the current instance. -

A signed integer that indicates the relative position of this instance and obj in the sort order, as shown in the following table.

-
Value

-

Description

-

A negative integer

-

This instance precedes other.

-

Zero

-

This instance and other have the same position in the sort order.

-

A positive integer

-

This instance follows other.

-

-
-
- - Represents a value tuple with 4 components. - The type of the value tuple's first element. - The type of the value tuple's second element. - The type of the value tuple's third element. - The type of the value tuple's fourth element. - - - Initializes a new instance. - The value tuple's first element. - The value tuple's second element. - The value tuple's third element. - The value tuple's fourth element. - - - Compares the current instance to a specified instance. - The tuple to compare with this instance. -

A signed integer that indicates the relative position of this instance and other in the sort order, as shown in the following able.

-
Vaue

-

Description

-

A negative integer

-

This instance precedes other.

-

Zero

-

This instance and other have the same position in the sort order.

-

A positive integer

-

This instance follows other.

-

-
-
- - Returns a value that indicates whether the current instance is equal to a specified object. - The object to compare with this instance. - true if the current instance is equal to the specified object; otherwise, false. - - - Returns a value that indicates whether the current instance is equal to a specified instance. - The value tuple to compare with this instance. - true if the current instance is equal to the specified tuple; otherwise, false. - - - Calculates the hash code for the current instance. - The hash code for the current instance. - - - Gets the value of the current instance's first element. - - - - Gets the value of the current instance's second element. - - - - Gets the value of the current instance's third element. - - - - Gets the value of the current instance's fourth element. - - - - Returns a string that represents the value of this instance. - The string representation of this instance. - - - Compares the current instance to a specified object by using a specified comparer and returns an integer that indicates whether the current object is before, after, or in the same position as the specified object in the sort order. - The object to compare with the current instance. - An object that provides custom rules for comparison. -

A signed integer that indicates the relative position of this instance and other in the sort order, as shown in the following able.

-
Vaue

-

Description

-

A negative integer

-

This instance precedes other.

-

Zero

-

This instance and other have the same position in the sort order.

-

A positive integer

-

This instance follows other.

-

-
-
- - Returns a value that indicates whether the current instance is equal to a specified object based on a specified comparison method. - The object to compare with this instance. - An object that defines the method to use to evaluate whether the two objects are equal. - true if the current instance is equal to the specified objects; otherwise, false. - - - Calculates the hash code for the current instance by using a specified computation method. - An object whose method calculates the hash code of the current instance. - A 32-bit signed integer hash code. - - - Compares the current instance to a specified object by using a specified comparer and returns an integer that indicates whether the current object is before, after, or in the same position as the specified object in the sort order. - The object to compare with the current instance. -

A signed integer that indicates the relative position of this instance and obj in the sort order, as shown in the following table.

-
Value

-

Description

-

A negative integer

-

This instance precedes other.

-

Zero

-

This instance and other have the same position in the sort order.

-

A positive integer

-

This instance follows other.

-

-
-
- - Represents a value tuple with 5 components. - The type of the value tuple's first element. - The type of the value tuple's second element. - The type of the value tuple's third element. - The type of the value tuple's fourth element. - The type of the value tuple's fifth element. - - - Initializes a new instance. - The value tuple's first element. - The value tuple's second element. - The value tuple's third element. - The value tuple's fourth element. - The value tuple's fifth element. - - - Compares the current instance to a specified instance. - The tuple to compare with this instance. -

A signed integer that indicates the relative position of this instance and other in the sort order, as shown in the following able.

-
Vaue

-

Description

-

A negative integer

-

This instance precedes other.

-

Zero

-

This instance and other have the same position in the sort order.

-

A positive integer

-

This instance follows other.

-

-
-
- - Returns a value that indicates whether the current instance is equal to a specified object. - The object to compare with this instance. - true if the current instance is equal to the specified object; otherwise, false. - - - Returns a value that indicates whether the current instance is equal to a specified instance. - The value tuple to compare with this instance. - true if the current instance is equal to the specified tuple; otherwise, false. - - - Calculates the hash code for the current instance. - The hash code for the current instance. - - - Gets the value of the current instance's first element. - - - - Gets the value of the current instance's second element. - - - - Gets the value of the current instance's third element. - - - - Gets the value of the current instance's fourth element. - - - - Gets the value of the current instance's fifth element. - - - - Returns a string that represents the value of this instance. - The string representation of this instance. - - - Compares the current instance to a specified object by using a specified comparer and returns an integer that indicates whether the current object is before, after, or in the same position as the specified object in the sort order. - The object to compare with the current instance. - An object that provides custom rules for comparison. -

A signed integer that indicates the relative position of this instance and other in the sort order, as shown in the following able.

-
Vaue

-

Description

-

A negative integer

-

This instance precedes other.

-

Zero

-

This instance and other have the same position in the sort order.

-

A positive integer

-

This instance follows other.

-

-
-
- - Returns a value that indicates whether the current instance is equal to a specified object based on a specified comparison method. - The object to compare with this instance. - An object that defines the method to use to evaluate whether the two objects are equal. - true if the current instance is equal to the specified objects; otherwise, false. - - - Calculates the hash code for the current instance by using a specified computation method. - An object whose method calculates the hash code of the current instance. - A 32-bit signed integer hash code. - - - Compares the current instance to a specified object by using a specified comparer and returns an integer that indicates whether the current object is before, after, or in the same position as the specified object in the sort order. - The object to compare with the current instance. -

A signed integer that indicates the relative position of this instance and obj in the sort order, as shown in the following table.

-
Value

-

Description

-

A negative integer

-

This instance precedes other.

-

Zero

-

This instance and other have the same position in the sort order.

-

A positive integer

-

This instance follows other.

-

-
-
- - Represents a value tuple with 6 components. - The type of the value tuple's first element. - The type of the value tuple's second element. - The type of the value tuple's third element. - The type of the value tuple's fourth element. - The type of the value tuple's fifth element. - The type of the value tuple's sixth element. - - - Initializes a new instance. - The value tuple's first element. - The value tuple's second element. - The value tuple's third element. - The value tuple's fourth element. - The value tuple's fifth element. - The value tuple's sixth element. - - - Compares the current instance to a specified instance. - The tuple to compare with this instance. -

A signed integer that indicates the relative position of this instance and other in the sort order, as shown in the following able.

-
Vaue

-

Description

-

A negative integer

-

This instance precedes other.

-

Zero

-

This instance and other have the same position in the sort order.

-

A positive integer

-

This instance follows other.

-

-
-
- - Returns a value that indicates whether the current instance is equal to a specified object. - The object to compare with this instance. - true if the current instance is equal to the specified object; otherwise, false. - - - Returns a value that indicates whether the current instance is equal to a specified instance. - The value tuple to compare with this instance. - true if the current instance is equal to the specified tuple; otherwise, false. - - - Calculates the hash code for the current instance. - The hash code for the current instance. - - - Gets the value of the current instance's first element. - - - - Gets the value of the current instance's second element. - - - - Gets the value of the current instance's third element. - - - - Gets the value of the current instance's fourth element. - - - - Gets the value of the current instance's fifth element. - - - - Gets the value of the current instance's sixth element. - - - - Returns a string that represents the value of this instance. - The string representation of this instance. - - - Compares the current instance to a specified object by using a specified comparer and returns an integer that indicates whether the current object is before, after, or in the same position as the specified object in the sort order. - The object to compare with the current instance. - An object that provides custom rules for comparison. -

A signed integer that indicates the relative position of this instance and other in the sort order, as shown in the following able.

-
Vaue

-

Description

-

A negative integer

-

This instance precedes other.

-

Zero

-

This instance and other have the same position in the sort order.

-

A positive integer

-

This instance follows other.

-

-
-
- - Returns a value that indicates whether the current instance is equal to a specified object based on a specified comparison method. - The object to compare with this instance. - An object that defines the method to use to evaluate whether the two objects are equal. - true if the current instance is equal to the specified objects; otherwise, false. - - - Calculates the hash code for the current instance by using a specified computation method. - An object whose method calculates the hash code of the current instance. - A 32-bit signed integer hash code. - - - Compares the current instance to a specified object by using a specified comparer and returns an integer that indicates whether the current object is before, after, or in the same position as the specified object in the sort order. - The object to compare with the current instance. -

A signed integer that indicates the relative position of this instance and obj in the sort order, as shown in the following table.

-
Value

-

Description

-

A negative integer

-

This instance precedes other.

-

Zero

-

This instance and other have the same position in the sort order.

-

A positive integer

-

This instance follows other.

-

-
-
- - Represents a value tuple with 7 components. - The type of the value tuple's first element. - The type of the value tuple's second element. - The type of the value tuple's third element. - The type of the value tuple's fourth element. - The type of the value tuple's fifth element. - The type of the value tuple's sixth element. - The type of the value tuple's seventh element. - - - Initializes a new instance. - The value tuple's first element. - The value tuple's second element. - The value tuple's third element. - The value tuple's fourth element. - The value tuple's fifth element. - The value tuple's sixth element. - The value tuple's seventh element. - - - Compares the current instance to a specified instance. - The tuple to compare with this instance. -

A signed integer that indicates the relative position of this instance and other in the sort order, as shown in the following able.

-
Vaue

-

Description

-

A negative integer

-

This instance precedes other.

-

Zero

-

This instance and other have the same position in the sort order.

-

A positive integer

-

This instance follows other.

-

-
-
- - Returns a value that indicates whether the current instance is equal to a specified object. - The object to compare with this instance. - true if the current instance is equal to the specified object; otherwise, false. - - - Returns a value that indicates whether the current instance is equal to a specified instance. - The value tuple to compare with this instance. - true if the current instance is equal to the specified tuple; otherwise, false. - - - Calculates the hash code for the current instance. - The hash code for the current instance. - - - Gets the value of the current instance's first element. - - - - Gets the value of the current instance's second element. - - - - Gets the value of the current instance's third element. - - - - Gets the value of the current instance's fourth element. - - - - Gets the value of the current instance's fifth element. - - - - Gets the value of the current instance's sixth element. - - - - Gets the value of the current instance's seventh element. - - - - Returns a string that represents the value of this instance. - The string representation of this instance. - - - Compares the current instance to a specified object by using a specified comparer and returns an integer that indicates whether the current object is before, after, or in the same position as the specified object in the sort order. - The object to compare with the current instance. - An object that provides custom rules for comparison. -

A signed integer that indicates the relative position of this instance and other in the sort order, as shown in the following able.

-
Vaue

-

Description

-

A negative integer

-

This instance precedes other.

-

Zero

-

This instance and other have the same position in the sort order.

-

A positive integer

-

This instance follows other.

-

-
-
- - Returns a value that indicates whether the current instance is equal to a specified object based on a specified comparison method. - The object to compare with this instance. - An object that defines the method to use to evaluate whether the two objects are equal. - true if the current instance is equal to the specified objects; otherwise, false. - - - Calculates the hash code for the current instance by using a specified computation method. - An object whose method calculates the hash code of the current instance. - A 32-bit signed integer hash code. - - - Compares the current instance to a specified object by using a specified comparer and returns an integer that indicates whether the current object is before, after, or in the same position as the specified object in the sort order. - The object to compare with the current instance. -

A signed integer that indicates the relative position of this instance and obj in the sort order, as shown in the following table.

-
Value

-

Description

-

A negative integer

-

This instance precedes other.

-

Zero

-

This instance and other have the same position in the sort order.

-

A positive integer

-

This instance follows other.

-

-
-
- - Represents an n-value tuple, where n is 8 or greater. - The type of the value tuple's first element. - The type of the value tuple's second element. - The type of the value tuple's third element. - The type of the value tuple's fourth element. - The type of the value tuple's fifth element. - The type of the value tuple's sixth element. - The type of the value tuple's seventh element. - Any generic value tuple instance that defines the types of the tuple's remaining elements. - - - Initializes a new instance. - The value tuple's first element. - The value tuple's second element. - The value tuple's third element. - The value tuple's fourth element. - The value tuple's fifth element. - The value tuple's sixth element. - The value tuple's seventh element. - An instance of any value tuple type that contains the values of the value's tuple's remaining elements. - rest is not a generic value tuple type. - - - Compares the current instance to a specified instance - The tuple to compare with this instance. -

A signed integer that indicates the relative position of this instance and other in the sort order, as shown in the following able.

-
Vaue

-

Description

-

A negative integer

-

This instance precedes other.

-

Zero

-

This instance and other have the same position in the sort order.

-

A positive integer

-

This instance follows other.

-

-
-
- - Returns a value that indicates whether the current instance is equal to a specified object. - The object to compare with this instance. - true if the current instance is equal to the specified object; otherwise, false. - - - Returns a value that indicates whether the current instance is equal to a specified instance. - The value tuple to compare with this instance. - true if the current instance is equal to the specified tuple; otherwise, false. - - - Calculates the hash code for the current instance. - The hash code for the current instance. - - - Gets the value of the current instance's first element. - - - - Gets the value of the current instance's second element. - - - - Gets the value of the current instance's third element. - - - - Gets the value of the current instance's fourth element. - - - - Gets the value of the current instance's fifth element. - - - - Gets the value of the current instance's sixth element. - - - - Gets the value of the current instance's seventh element. - - - - Gets the current instance's remaining elements. - - - - Returns a string that represents the value of this instance. - The string representation of this instance. - - - Compares the current instance to a specified object by using a specified comparer and returns an integer that indicates whether the current object is before, after, or in the same position as the specified object in the sort order. - The object to compare with the current instance. - An object that provides custom rules for comparison. -

A signed integer that indicates the relative position of this instance and other in the sort order, as shown in the following able.

-
Vaue

-

Description

-

A negative integer

-

This instance precedes other.

-

Zero

-

This instance and other have the same position in the sort order.

-

A positive integer

-

This instance follows other.

-

-
- other is not a object. -
- - Returns a value that indicates whether the current instance is equal to a specified object based on a specified comparison method. - The object to compare with this instance. - An object that defines the method to use to evaluate whether the two objects are equal. - true if the current instance is equal to the specified objects; otherwise, false. - - - Calculates the hash code for the current instance by using a specified computation method. - An object whose method calculates the hash code of the current instance. - A 32-bit signed integer hash code. - - - Compares the current object to a specified object and returns an integer that indicates whether the current object is before, after, or in the same position as the specified object in the sort order. - An object to compare with the current instance. -

A signed integer that indicates the relative position of this instance and obj in the sort order, as shown in the following table.

-
Value

-

Description

-

A negative integer

-

This instance precedes other.

-

Zero

-

This instance and other have the same position in the sort order.

-

A positive integer

-

This instance follows other.

-

-
- other is not a object. -
- - Provides static methods for creating value tuples. - - - Compares the current instance with a specified object. - The object to compare with the current instance. - Returns 0 if other is a instance and 1 if other is null. - other is not a instance. - - - Creates a new value tuple with zero components. - A new value tuple with no components. - - - Creates a new value tuple with 8 components (an octuple). - The value of the value tuple's first component. - The value of the value tuple's second component. - The value of the value tuple's third component. - The value of the value tuple's fourth component. - The value of the value tuple's fifth component. - The value of the value tuple's sixth component. - The value of the value tuple's seventh component. - The value of the value tuple's eighth component. - The type of the value tuple's first component. - The type of the value tuple's second component. - The type of the value tuple's third component. - The type of the value tuple's fourth component. - The type of the value tuple's fifth component. - The type of the value tuple's sixth component. - The type of the value tuple's seventh component. - The type of the value tuple's eighth component. - A value tuple with 8 components. - - - Creates a new value tuple with 7 components (a septuple). - The value of the value tuple's first component. - The value of the value tuple's second component. - The value of the value tuple's third component. - The value of the value tuple's fourth component. - The value of the value tuple's fifth component. - The value of the value tuple's sixth component. - The value of the value tuple's seventh component. - The type of the value tuple's first component. - The type of the value tuple's second component. - The type of the value tuple's third component. - The type of the value tuple's fourth component. - The type of the value tuple's fifth component. - The type of the value tuple's sixth component. - The type of the value tuple's seventh component. - A value tuple with 7 components. - - - Creates a new value tuple with 6 components (a sexuple). - The value of the value tuple's first component. - The value of the value tuple's second component. - The value of the value tuple's third component. - The value of the value tuple's fourth component. - The value of the value tuple's fifth component. - The value of the value tuple's sixth component. - The type of the value tuple's first component. - The type of the value tuple's second component. - The type of the value tuple's third component. - The type of the value tuple's fourth component. - The type of the value tuple's fifth component. - The type of the value tuple's sixth component. - A value tuple with 6 components. - - - Creates a new value tuple with 5 components (a quintuple). - The value of the value tuple's first component. - The value of the value tuple's second component. - The value of the value tuple's third component. - The value of the value tuple's fourth component. - The value of the value tuple's fifth component. - The type of the value tuple's first component. - The type of the value tuple's second component. - The type of the value tuple's third component. - The type of the value tuple's fourth component. - The type of the value tuple's fifth component. - A value tuple with 5 components. - - - Creates a new value tuple with 4 components (a quadruple). - The value of the value tuple's first component. - The value of the value tuple's second component. - The value of the value tuple's third component. - The value of the value tuple's fourth component. - The type of the value tuple's first component. - The type of the value tuple's second component. - The type of the value tuple's third component. - The type of the value tuple's fourth component. - A value tuple with 4 components. - - - Creates a new value tuple with 3 components (a triple). - The value of the value tuple's first component. - The value of the value tuple's second component. - The value of the value tuple's third component. - The type of the value tuple's first component. - The type of the value tuple's second component. - The type of the value tuple's third component. - A value tuple with 3 components. - - - Creates a new value tuple with 2 components (a pair). - The value of the value tuple's first component. - The value of the value tuple's second component. - The type of the value tuple's first component. - The type of the value tuple's second component. - A value tuple with 2 components. - - - Creates a new value tuple with 1 component (a singleton). - The value of the value tuple's only component. - The type of the value tuple's only component. - A value tuple with 1 component. - - - Determines whether two instances are equal. This method always returns true. - The value tuple to compare with the current instance. - This method always returns true. - - - Returns a value that indicates whether the current instance is equal to a specified object. - The object to compare to the current instance. - true if obj is a instance; otherwise, false. - - - Returns the hash code for the current instance. - The hash code for the current instance. - - - Returns the string representation of this instance. - This method always returns "()". - - - Compares the current instance to a specified object. - The object to compare with the current instance. - An object that provides custom rules for comparison. This parameter is ignored. - Returns 0 if other is a instance and 1 if other is null. - other is not a instance. - - - Returns a value that indicates whether the current instance is equal to a specified object based on a specified comparison method. - The object to compare with this instance. - An object that defines the method to use to evaluate whether the two objects are equal. - true if the current instance is equal to the specified object; otherwise, false. - - - Returns the hash code for this instance. - An object whose method computes the hash code. This parameter is ignored. - The hash code for this instance. - - - Compares this instance with a specified object and returns an indication of their relative values. - The object to compare with the current instance - 0 if other is a instance; otherwise, 1 if other is null. - other is not a instance. - - - Provides the base class for value types. - - - Initializes a new instance of the class. - - - Indicates whether this instance and a specified object are equal. - The object to compare with the current instance. - true if obj and this instance are the same type and represent the same value; otherwise, false. - - - Returns the hash code for this instance. - A 32-bit signed integer that is the hash code for this instance. - - - Returns the fully qualified type name of this instance. - The fully qualified type name. - - - Represents the version number of an assembly, operating system, or the common language runtime. This class cannot be inherited. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class using the specified string. - A string containing the major, minor, build, and revision numbers, where each number is delimited with a period character ('.'). - version has fewer than two components or more than four components. - version is null. - A major, minor, build, or revision component is less than zero. - At least one component of version does not parse to an integer. - At least one component of version represents a number greater than . - - - Initializes a new instance of the class using the specified major and minor values. - The major version number. - The minor version number. - major or minor is less than zero. - - - Initializes a new instance of the class using the specified major, minor, and build values. - The major version number. - The minor version number. - The build number. - major, minor, or build is less than zero. - - - Initializes a new instance of the class with the specified major, minor, build, and revision numbers. - The major version number. - The minor version number. - The build number. - The revision number. - major, minor, build, or revision is less than zero. - - - Gets the value of the build component of the version number for the current object. - The build number, or -1 if the build number is undefined. - - - Returns a new object whose value is the same as the current object. - A new whose values are a copy of the current object. - - - Compares the current object to a specified object and returns an indication of their relative values. - An object to compare, or null. -

A signed integer that indicates the relative values of the two objects, as shown in the following table.

-
Return value

-

Meaning

-

Less than zero

-

The current object is a version before version.

-

Zero

-

The current object is the same version as version.

-

Greater than zero

-

The current object is a version subsequent to version.

-

-or-

-

version is null.

-

-
- version is not of type . -
- - Compares the current object to a specified object and returns an indication of their relative values. - A object to compare to the current object, or null. -

A signed integer that indicates the relative values of the two objects, as shown in the following table.

-
Return value

-

Meaning

-

Less than zero

-

The current object is a version before value.

-

Zero

-

The current object is the same version as value.

-

Greater than zero

-

The current object is a version subsequent to value.

-

-or-

-

value is null.

-

-
-
- - Returns a value indicating whether the current object is equal to a specified object. - An object to compare with the current object, or null. - true if the current object and obj are both objects, and every component of the current object matches the corresponding component of obj; otherwise, false. - - - Returns a value indicating whether the current object and a specified object represent the same value. - A object to compare to the current object, or null. - true if every component of the current object matches the corresponding component of the obj parameter; otherwise, false. - - - Returns a hash code for the current object. - A 32-bit signed integer hash code. - - - Gets the value of the major component of the version number for the current object. - The major version number. - - - Gets the high 16 bits of the revision number. - A 16-bit signed integer. - - - Gets the value of the minor component of the version number for the current object. - The minor version number. - - - Gets the low 16 bits of the revision number. - A 16-bit signed integer. - - - Determines whether two specified objects are equal. - The first object. - The second object. - true if v1 equals v2; otherwise, false. - - - Determines whether the first specified object is greater than the second specified object. - The first object. - The second object. - true if v1 is greater than v2; otherwise, false. - - - Determines whether the first specified object is greater than or equal to the second specified object. - The first object. - The second object. - true if v1 is greater than or equal to v2; otherwise, false. - - - Determines whether two specified objects are not equal. - The first object. - The second object. - true if v1 does not equal v2; otherwise, false. - - - Determines whether the first specified object is less than the second specified object. - The first object. - The second object. - true if v1 is less than v2; otherwise, false. - v1 is null. - - - Determines whether the first specified object is less than or equal to the second object. - The first object. - The second object. - true if v1 is less than or equal to v2; otherwise, false. - v1 is null. - - - Converts the string representation of a version number to an equivalent object. - A string that contains a version number to convert. - An object that is equivalent to the version number specified in the input parameter. - input is null. - input has fewer than two or more than four version components. - At least one component in input is less than zero. - At least one component in input is not an integer. - At least one component in input represents a number that is greater than . - - - Gets the value of the revision component of the version number for the current object. - The revision number, or -1 if the revision number is undefined. - - - Converts the value of the current object to its equivalent representation. - The representation of the values of the major, minor, build, and revision components of the current object, as depicted in the following format. Each component is separated by a period character ('.'). Square brackets ('[' and ']') indicate a component that will not appear in the return value if the component is not defined: major.minor[.build[.revision]] For example, if you create a object using the constructor Version(1,1), the returned string is "1.1". If you create a object using the constructor Version(1,3,4,2), the returned string is "1.3.4.2". - - - Converts the value of the current object to its equivalent representation. A specified count indicates the number of components to return. - The number of components to return. The fieldCount ranges from 0 to 4. - The representation of the values of the major, minor, build, and revision components of the current object, each separated by a period character ('.'). The fieldCount parameter determines how many components are returned. fieldCount - - Return Value - - 0 - - An empty string (""). - - 1 - - major - - 2 - - major.minor - - 3 - - major.minor.build - - 4 - - major.minor.build.revision - - For example, if you create object using the constructor Version(1,3,5), ToString(2) returns "1.3" and ToString(4) throws an exception. - fieldCount is less than 0, or more than 4. -or- fieldCount is more than the number of components defined in the current object. - - - Tries to convert the string representation of a version number to an equivalent object, and returns a value that indicates whether the conversion succeeded. - A string that contains a version number to convert. - When this method returns, contains the equivalent of the number that is contained in input, if the conversion succeeded, or a object whose major and minor version numbers are 0 if the conversion failed. If input is null or , result is null when the method returns. - true if the input parameter was converted successfully; otherwise, false. - - - Specifies a return value type for a method that does not return a value. - - - Represents a typed weak reference, which references an object while still allowing that object to be reclaimed by garbage collection. - The type of the object referenced. - - - Initializes a new instance of the class that references the specified object. - The object to reference, or null. - - - Initializes a new instance of the class that references the specified object and uses the specified resurrection tracking. - The object to reference, or null. - true to track the object after finalization; false to track the object only until finalization. - - - Populates a object with all the data necessary to serialize the current object. - An object that holds all the data necessary to serialize or deserialize the current object. - The location where serialized data is stored and retrieved. - info is null. - - - Sets the target object that is referenced by this object. - The new target object. - - - Tries to retrieve the target object that is referenced by the current object. - When this method returns, contains the target object, if it is available. This parameter is treated as uninitialized. - true if the target was retrieved; otherwise, false. - - - Represents a weak reference, which references an object while still allowing that object to be reclaimed by garbage collection. - - - Initializes a new instance of the class, referencing the specified object. - The object to track or null. - - - Initializes a new instance of the class, referencing the specified object and using the specified resurrection tracking. - An object to track. - Indicates when to stop tracking the object. If true, the object is tracked after finalization; if false, the object is only tracked until finalization. - - - Initializes a new instance of the class, using deserialized data from the specified serialization and stream objects. - An object that holds all the data needed to serialize or deserialize the current object. - (Reserved) Describes the source and destination of the serialized stream specified by info. - info is null. - - - Discards the reference to the target represented by the current object. - - - Populates a object with all the data needed to serialize the current object. - An object that holds all the data needed to serialize or deserialize the current object. - (Reserved) The location where serialized data is stored and retrieved. - info is null. - - - Gets an indication whether the object referenced by the current object has been garbage collected. - true if the object referenced by the current object has not been garbage collected and is still accessible; otherwise, false. - - - Gets or sets the object (the target) referenced by the current object. - null if the object referenced by the current object has been garbage collected; otherwise, a reference to the object referenced by the current object. - The reference to the target object is invalid. This exception can be thrown while setting this property if the value is a null reference or if the object has been finalized during the set operation. - - - Gets an indication whether the object referenced by the current object is tracked after it is finalized. - true if the object the current object refers to is tracked after finalization; or false if the object is only tracked until finalization. - - - Provides methods for encoding and decoding URLs when processing Web requests. This class cannot be inherited. - - - Initializes a new instance of the class. - - - Minimally converts a string to an HTML-encoded string. - The string to encode. - An encoded string. - - - Minimally converts a string into an HTML-encoded string and sends the encoded string to a output stream. - The string to encode - A output stream. - - - Converts a string that has been HTML-encoded for HTTP transmission into a decoded string. - The string to decode. - A decoded string. - - - Converts a string that has been HTML-encoded into a decoded string, and sends the decoded string to a output stream. - The string to decode. - A stream of output. - - - Converts an object's string representation into an HTML-encoded string, and returns the encoded string. - An object. - An encoded string. - - - Converts a string to an HTML-encoded string. - The string to encode. - An encoded string. - - - Converts a string into an HTML-encoded string, and returns the output as a stream of output. - The string to encode - A output stream. - - - Encodes a string. - A string to encode. - An encoded string. - - - Encodes a string. - A string to encode. - A value that indicates whether double quotation marks will be included around the encoded string. - An encoded string. - - - Parses a query string into a using encoding. - The query string to parse. - A of query parameters and values. - query is null. - - - Parses a query string into a using the specified . - The query string to parse. - The to use. - A of query parameters and values. - query is null. - or - encoding is null. - - - Converts a URL-encoded string into a decoded string, using the specified encoding object. - - The that specifies the decoding scheme. - A decoded string. - - - Converts a URL-encoded byte array into a decoded string using the specified encoding object, starting at the specified position in the array, and continuing for the specified number of bytes. - The array of bytes to decode. - The position in the byte to begin decoding. - The number of bytes to decode. - The object that specifies the decoding scheme. - A decoded string. - bytes is null, but count does not equal 0. - offset is less than 0 or greater than the length of the bytes array. - or - count is less than 0, or count + offset is greater than the length of the bytes array. - - - Converts a string that has been encoded for transmission in a URL into a decoded string. - The string to decode. - A decoded string. - - - Converts a URL-encoded byte array into a decoded string using the specified decoding object. - The array of bytes to decode. - The that specifies the decoding scheme. - A decoded string. - - - Converts a URL-encoded array of bytes into a decoded array of bytes. - The array of bytes to decode. - A decoded array of bytes. - - - Converts a URL-encoded string into a decoded array of bytes. - The string to decode. - A decoded array of bytes. - - - Converts a URL-encoded string into a decoded array of bytes using the specified decoding object. - The string to decode. - The object that specifies the decoding scheme. - A decoded array of bytes. - - - Converts a URL-encoded array of bytes into a decoded array of bytes, starting at the specified position in the array and continuing for the specified number of bytes. - The array of bytes to decode. - The position in the byte array at which to begin decoding. - The number of bytes to decode. - A decoded array of bytes. - bytes is null, but count does not equal 0. - offset is less than 0 or greater than the length of the bytes array. - or - count is less than 0, or count + offset is greater than the length of the bytes array. - - - Converts a byte array into a URL-encoded string, starting at the specified position in the array and continuing for the specified number of bytes. - The array of bytes to encode. - The position in the byte array at which to begin encoding. - The number of bytes to encode. - An encoded string. - - - Encodes a URL string using the specified encoding object. - - - An encoded string. - - - Converts a byte array into an encoded URL string. - The array of bytes to encode. - An encoded string. - - - Encodes a URL string. - The text to encode. - An encoded string. - - - Converts an array of bytes into a URL-encoded array of bytes. - The array of bytes to encode. - An encoded array of bytes. - - - Converts a string into a URL-encoded array of bytes. - The string to encode. - An encoded array of bytes. - - - Converts a string into a URL-encoded array of bytes using the specified encoding object. - The string to encode - The that specifies the encoding scheme. - An encoded array of bytes. - - - Converts an array of bytes into a URL-encoded array of bytes, starting at the specified position in the array and continuing for the specified number of bytes. - The array of bytes to encode. - The position in the byte array at which to begin encoding. - The number of bytes to encode. - An encoded array of bytes. - bytes is null, but count does not equal 0. - offset is less than 0 or greater than the length of the bytes array. - or - count is less than 0, or count + offset is greater than the length of the bytes array. - - - Converts a string into a Unicode string. - The string to convert. - A Unicode string in %UnicodeValue notation. - - - Converts a Unicode string into an array of bytes. - The string to convert. - A byte array. - - - Do not use; intended only for browser compatibility. Use . - - The encoded text. - - - Describes the context in which a set of schema is bound to .NET Framework code entities. - - - Initializes a new instance of the class for the given code identifiers, with the given type-sharing option. - The code entities to which the context applies. - A value that determines whether custom types are shared among schema. - - - Gets a value that determines whether custom types are shared. - true, if custom types are shared among schema; otherwise, false. - - - Gets a set of code entities to which the context applies. - A that specifies the code entities to which the context applies. - - - Gets a collection of warnings that are generated when importing the code entity descriptions. - A that contains warnings that were generated when importing the code entity descriptions. - - - Provides custom formatting for XML serialization and deserialization. - - - This method is reserved and should not be used. When implementing the IXmlSerializable interface, you should return null (Nothing in Visual Basic) from this method, and instead, if specifying a custom schema is required, apply the to the class. - An that describes the XML representation of the object that is produced by the method and consumed by the method. - - - Generates an object from its XML representation. - The stream from which the object is deserialized. - - - Converts an object into its XML representation. - The stream to which the object is serialized. - - - Establishes a property for use by the .NET Framework infrastructure. - - - Gets or sets whether white space and attribute values are normalized. - true if white space attributes values are normalized; otherwise, false. - - - Gets or sets how white space is handled when parsing XML. - A member of the enumeration that describes how whites pace is handled when parsing XML. - - - Specifies that the must serialize the class member as an encoded SOAP attribute. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class using the specified value as the name of the XML attribute. - The name of the XML attribute. - - - Gets or sets the name of the XML attribute generated by the . - The name of the XML attribute. The default is the member identifier. - - - Gets or sets the XML Schema definition language (XSD) data type of the SOAP attribute generated by the . - An XML Schema data type, as defined by the World Wide Web Consortium (www.w3.org) document named "XML Schema Part 2: Datatypes". - The XML Schema data type you have specified cannot be mapped to the .NET data type. - - - Gets or sets the XML namespace of the XML attribute. - The XML namespace of the XML attribute. - - - Allows you to override attributes applied to properties, fields, and classes when you use an to serialize or deserialize an object as encoded SOAP. - - - Initializes a new instance of the class. - - - Adds a to a collection of objects. The type parameter specifies an object to be overridden by the . - The of the object that is overridden. - A that represents the overriding attributes. - - - Adds a to the collection of objects contained by the . The type parameter specifies the object to be overridden by the . The member parameter specifies the name of a member that is overridden. - The of the object to override. - The name of the member to override. - A that represents the overriding attributes. - - - Gets the object associated with the specified (base class) type. - The base class that is associated with the collection of attributes you want to retrieve. - A that represents the collection of overriding attributes. - - - Gets the object associated with the specified (base class) type. The member parameter specifies the base class member that is overridden. - The base class that is associated with the collection of attributes you want to override. - The name of the overridden member that specifies the to return. - A that represents the collection of overriding attributes. - - - Represents a collection of attribute objects that control how the serializes and deserializes SOAP methods. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class using the specified custom type. - Any object that implements the interface, such as the class. - - - Gets or sets the to override. - A that overrides the behavior of the when the member is serialized. - - - Gets or sets the default value of an XML element or attribute. - An object that represents the default value of an XML element or attribute. - - - Gets or sets a to override. - The to override. - - - Gets or sets an object that specifies how the serializes a SOAP enumeration. - An object that specifies how the serializes an enumeration member. - - - Gets or sets a value that specifies whether the serializes a public field or property as encoded SOAP XML. - true if the must not serialize the field or property; otherwise, false. - - - Gets or sets an object that instructs the how to serialize an object type into encoded SOAP XML. - A that either overrides a applied to a class declaration, or is applied to a class declaration. - - - Specifies that the public member value be serialized by the as an encoded SOAP XML element. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class and specifies the name of the XML element. - The XML element name of the serialized member. - - - Gets or sets the XML Schema definition language (XSD) data type of the generated XML element. - One of the XML Schema data types. - - - Gets or sets the name of the generated XML element. - The name of the generated XML element. The default is the member identifier. - - - Gets or sets a value that indicates whether the must serialize a member that has the xsi:null attribute set to "1". - true if the generates the xsi:null attribute; otherwise, false. - - - Controls how the serializes an enumeration member. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class using the specified element name. - The XML element name generated by the . - - - Gets or sets the value generated in an XML document when the serializes an enumeration, or the value recognized when it deserializes the enumeration member. - The value generated in an XML document when the serializes the enumeration, or the value recognized when it deserializes the enumeration member. - - - Instructs the not to serialize the public field or public read/write property value. - - - Initializes a new instance of the class. - - - Allows the to recognize a type when it serializes or deserializes an object as encoded SOAP XML. - - - Initializes a new instance of the class using the specified type. - The type of the object to include. - - - Gets or sets the type of the object to use when serializing or deserializing an object. - The type of the object to include. - - - Generates mappings to SOAP-encoded messages from .NET Framework types or Web service method information. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class, specifying a default XML namespace for imported type mappings. - The default XML namespace to use for imported type mappings. - - - Initializes a new instance of the class, specifying overrides for XML serialization. - A object that overrides how the class serializes mapped types using SOAP encoding. - - - Initializes a new instance of the class, specifying XML serialization overrides and a default XML namespace. - A object that overrides how the class serializes mapped types using SOAP encoding. - The default XML namespace to use for imported type mappings. - - - Generates internal type mappings for information that is gathered from a Web service method. - An XML element name produced from the Web service method. - An XML element namespace produced from the Web service method. - An array of .NET Framework code entities that belong to a Web service method. - Internal .NET Framework type mappings to the element parts of a WSDL message definition. - - - Generates internal type mappings for information that is gathered from a Web service method. - An XML element name produced from the Web service method. - An XML element namespace produced from the Web service method. - An array of .NET Framework code entities that belong to a Web service method. - true to indicate that elements that correspond to WSDL message parts should be enclosed in an extra wrapper element in a SOAP message; otherwise, false. - true to indicate an RPC-style Web service binding; false to indicate a document-style Web service binding or a SOAP header. - Internal .NET Framework type mappings to the element parts of a WSDL message definition. - - - Generates internal type mappings for information that is gathered from a Web service method. - An XML element name produced from the Web service method. - An XML element namespace produced from the Web service method. - An array of .NET Framework code entities that belong to a Web service method. - true to indicate that elements that correspond to WSDL message parts should be enclosed in an extra wrapper element in a SOAP message; otherwise, false. - true to indicate an RPC-style Web service binding; false to indicate a document-style Web service binding or a SOAP header. - true to indicate that a generated deserializer should check for the expected qualified name of the wrapper element; otherwise, false. This parameter's value is relevant only if the hasWrapperElement parameter's value is true. - Internal .NET Framework type mappings to the element parts of a WSDL message definition. - - - Generates internal type mappings for information that is gathered from a Web service method. - An XML element name produced from the Web service method. - An XML element namespace produced from the Web service method. - An array of .NET Framework code entities that belong to a Web service method. - true to indicate that elements that correspond to WSDL message parts should be enclosed in an extra wrapper element in a SOAP message; otherwise, false. - true to indicate an RPC-style Web service binding; false to indicate a document-style Web service binding or a SOAP header. - true to indicate that a generated deserializer should check for the expected qualified name of the wrapper element; otherwise, false. This parameter's value is relevant only if the hasWrapperElement parameter's value is true. - One of the values. - Internal .NET Framework type mappings to the element parts of a WSDL message definition. - - - Generates a mapping to an XML Schema element for a .NET Framework type. - The .NET Framework type for which to generate a type mapping. - Internal .NET Framework mapping of a type to an XML Schema element. - - - Generates a mapping to an XML Schema element for a .NET Framework type. - The .NET Framework type for which to generate a type mapping. - The default XML namespace to use. - Internal .NET Framework mapping of a type to an XML Schema element. - - - Places mappings for a type in the instance's context for later use when import methods are invoked. - The .NET Framework type for which to save type mapping information. - - - Places mappings for derived types in the instance's context for later use when import methods are invoked. - An reflection object that contains custom attributes that are derived from the attribute. - - - Represents certain attributes of a XSD <part> element in a WSDL document for generating classes from the document. - - - Initializes a new instance of the class. - - - Gets or sets a value that corresponds to the name attribute of the WSDL part element. - The element name. - - - Gets or sets a value that corresponds to the type attribute of the WSDL part element. - An that corresponds to the XML type. - - - Controls the schema generated by the when a class instance is serialized as SOAP encoded XML. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class and specifies the name of the XML type. - The name of the XML type that the generates when it serializes the class instance (and recognizes when it deserializes the class instance). - - - Initializes a new instance of the class and specifies the name and XML namespace of the type. - The name of the XML type that the generates when it serializes the class instance (and recognizes when it deserializes the class instance). - The XML namespace of the type. - - - Gets or sets a value that indicates whether to include the type in SOAP-encoded XML Schema documents. - true to include the type in SOAP-encoded XML Schema documents; otherwise, false. The default is true. - - - Gets or sets the namespace of the XML type. - The namespace of the XML type. The default is an empty string (""). - - - Gets or sets the name of the XML type. - The name of the XML type. The default is the class name. - - - Provides data for the known, but unreferenced, object found in an encoded SOAP XML stream during deserialization. - - - Initializes a new instance of the class. - The unreferenced object. - A unique string used to identify the unreferenced object. - - - Gets the ID of the object. - The ID of the object. - - - Gets the deserialized, but unreferenced, object. - The deserialized, but unreferenced, object. - - - Represents the method that handles the event of an . - The source of the event. - An that contains the event data. - - - Specifies that the member (a field that returns an array of objects) can contain any XML attributes. - - - Constructs a new instance of the class. - - - Specifies that the member (a field that returns an array of or objects) contains objects that represent any XML element that has no corresponding member in the object being serialized or deserialized. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class and specifies the XML element name generated in the XML document. - The name of the XML element that the generates. - - - Initializes a new instance of the class and specifies the XML element name generated in the XML document and its XML namespace. - The name of the XML element that the generates. - The XML namespace of the XML element. - - - Gets or sets the XML element name. - The name of the XML element. - The element name of an array member does not match the element name specified by the property. - - - Gets or sets the XML namespace generated in the XML document. - An XML namespace. - - - Gets or sets the explicit order in which the elements are serialized or deserialized. - The order of the code generation. - - - Represents a collection of objects. - - - Initializes a new instance of the class. - - - Adds an to the collection. - The to add. - The index of the newly added . - - - Gets a value that indicates whether the specified exists in the collection. - The you are interested in. - true if the exists in the collection; otherwise, false. - - - Copies the entire collection to a compatible one-dimensional array of objects, starting at the specified index of the target array. - The one-dimensional array of objects that is the destination of the elements copied from the collection. The array must have zero-based indexing. - The zero-based index in array at which copying begins. - - - Gets the index of the specified . - The whose index you want. - The index of the specified . - - - Inserts an into the collection at the specified index. - The index where the is inserted. - The to insert. - - - Gets or sets the at the specified index. - The index of the . - An at the specified index. - - - Removes the specified from the collection. - The to remove. - - - Specifies that the must serialize a particular class member as an array of XML elements. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class and specifies the XML element name generated in the XML document instance. - The name of the XML element that the generates. - - - Gets or sets the XML element name given to the serialized array. - The XML element name of the serialized array. The default is the name of the member to which the is assigned. - - - Gets or sets a value that indicates whether the XML element name generated by the is qualified or unqualified. - One of the values. The default is XmlSchemaForm.None. - - - Gets or sets a value that indicates whether the must serialize a member as an empty XML tag with the xsi:nil attribute set to true. - true if the generates the xsi:nil attribute; otherwise, false. - - - Gets or sets the namespace of the XML element. - The namespace of the XML element. - - - Gets or sets the explicit order in which the elements are serialized or deserialized. - The order of the code generation. - - - Represents an attribute that specifies the derived types that the can place in a serialized array. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class and specifies the name of the XML element generated in the XML document. - The name of the XML element. - - - Initializes a new instance of the class and specifies the that can be inserted into the serialized array. - The of the object to serialize. - - - Initializes a new instance of the class and specifies the name of the XML element generated in the XML document and the that can be inserted into the generated XML document. - The name of the XML element. - The of the object to serialize. - - - Gets or sets the XML data type of the generated XML element. - An XML schema definition (XSD) data type, as defined by the World Wide Web Consortium (www.w3.org) document "XML Schema Part 2: DataTypes". - - - Gets or sets the name of the generated XML element. - The name of the generated XML element. The default is the member identifier. - - - Gets or sets a value that indicates whether the name of the generated XML element is qualified. - One of the values. The default is XmlSchemaForm.None. - The property is set to XmlSchemaForm.Unqualified and a value is specified. - - - Gets or sets a value that indicates whether the must serialize a member as an empty XML tag with the xsi:nil attribute set to true. - true if the generates the xsi:nil attribute; otherwise, false, and no instance is generated. The default is true. - - - Gets or sets the namespace of the generated XML element. - The namespace of the generated XML element. - - - Gets or sets the level in a hierarchy of XML elements that the affects. - The zero-based index of a set of indexes in an array of arrays. - - - Gets or sets the type allowed in an array. - A that is allowed in the array. - - - Represents a collection of objects. - - - Initializes a new instance of the class. - - - Adds an to the collection. - The to add to the collection. - The index of the added item. - - - Determines whether the collection contains the specified . - The to check for. - true if the collection contains the specified ; otherwise, false. - - - Copies an array to the collection, starting at a specified target index. - The array of objects to copy to the collection. - The index at which the copied attributes begin. - - - Returns the zero-based index of the first occurrence of the specified in the collection or -1 if the attribute is not found in the collection. - The to locate in the collection. - The first index of the in the collection or -1 if the attribute is not found in the collection. - - - Inserts an into the collection at the specified index. - The index at which the attribute is inserted. - The to insert. - - - Gets or sets the item at the specified index. - The zero-based index of the collection member to get or set. - The at the specified index. - - - Removes an from the collection, if it is present. - The to remove. - - - Specifies that the must serialize the class member as an XML attribute. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class and specifies the name of the generated XML attribute. - The name of the XML attribute that the generates. - - - Initializes a new instance of the class. - The used to store the attribute. - - - Initializes a new instance of the class. - The name of the XML attribute that is generated. - The used to store the attribute. - - - Gets or sets the name of the XML attribute. - The name of the XML attribute. The default is the member name. - - - Gets or sets the XSD data type of the XML attribute generated by the . - An XSD (XML Schema Document) data type, as defined by the World Wide Web Consortium (www.w3.org) document named "XML Schema: DataTypes". - - - Gets or sets a value that indicates whether the XML attribute name generated by the is qualified. - One of the values. The default is XmlForm.None. - - - Gets or sets the XML namespace of the XML attribute. - The XML namespace of the XML attribute. - - - Gets or sets the complex type of the XML attribute. - The type of the XML attribute. - - - Provides data for the event. - - - Gets an object that represents the unknown XML attribute. - An that represents the unknown XML attribute. - - - Gets a comma-delimited list of XML attribute names expected to be in an XML document instance. - A comma-delimited list of XML attribute names. Each name is in the following format: namespace:name. - - - Gets the line number of the unknown XML attribute. - The line number of the unknown XML attribute. - - - Gets the position in the line of the unknown XML attribute. - The position number of the unknown XML attribute. - - - Gets the object being deserialized. - The object being deserialized. - - - Represents the method that handles the - The source of the event. - An that contains the event data. - - - Allows you to override property, field, and class attributes when you use the to serialize or deserialize an object. - - - Initializes a new instance of the class. - - - Adds an object to the collection of objects. The type parameter specifies an object to be overridden by the object. - The of the object that is overridden. - An object that represents the overriding attributes. - - - Adds an object to the collection of objects. The type parameter specifies an object to be overridden. The member parameter specifies the name of a member that is overridden. - The of the object to override. - The name of the member to override. - An object that represents the overriding attributes. - - - Gets the object associated with the specified, base-class, type. - The base class that is associated with the collection of attributes you want to retrieve. - An that represents the collection of overriding attributes. - - - Gets the object associated with the specified (base-class) type. The member parameter specifies the base-class member that is overridden. - The base class that is associated with the collection of attributes you want. - The name of the overridden member that specifies the to return. - An that represents the collection of overriding attributes. - - - Represents a collection of attribute objects that control how the serializes and deserializes an object. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class and customizes how the serializes and deserializes an object. - A class that can provide alternative implementations of attributes that control XML serialization. - - - Gets or sets the to override. - The to override. - - - Gets the collection of objects to override. - An object that represents the collection of objects. - - - Gets or sets an object that specifies how the serializes a public field or read/write property that returns an array. - An that specifies how the serializes a public field or read/write property that returns an array. - - - Gets or sets a collection of objects that specify how the serializes items inserted into an array returned by a public field or read/write property. - An object that contains a collection of objects. - - - Gets or sets an object that specifies how the serializes a public field or public read/write property as an XML attribute. - An that controls the serialization of a public field or read/write property as an XML attribute. - - - Gets or sets an object that allows you to distinguish between a set of choices. - An that can be applied to a class member that is serialized as an xsi:choice element. - - - Gets or sets the default value of an XML element or attribute. - An that represents the default value of an XML element or attribute. - - - Gets a collection of objects that specify how the serializes a public field or read/write property as an XML element. - An that contains a collection of objects. - - - Gets or sets an object that specifies how the serializes an enumeration member. - An that specifies how the serializes an enumeration member. - - - Gets or sets a value that specifies whether or not the serializes a public field or public read/write property. - true if the must not serialize the field or property; otherwise, false. - - - Gets or sets a value that specifies whether to keep all namespace declarations when an object containing a member that returns an object is overridden. - true if the namespace declarations should be kept; otherwise, false. - - - Gets or sets an object that specifies how the serializes a class as an XML root element. - An that overrides a class attributed as an XML root element. - - - Gets or sets an object that instructs the to serialize a public field or public read/write property as XML text. - An that overrides the default serialization of a public property or field. - - - Gets or sets an object that specifies how the serializes a class to which the has been applied. - An that overrides an applied to a class declaration. - - - Specifies that the member can be further detected by using an enumeration. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. - The member name that returns the enumeration used to detect a choice. - - - Gets or sets the name of the field that returns the enumeration to use when detecting types. - The name of a field that returns an enumeration. - - - Contains fields that can be used to pass event delegates to a thread-safe method of the . - - - Gets or sets an object that represents the method that handles the event. - An that points to the event handler. - - - Gets or sets an object that represents the method that handles the event. - An that points to the event handler. - - - Gets or sets an object that represents the method that handles the event. - An that points to the event handler. - - - Gets or sets an object that represents the method that handles the event. - An that points to the event handler. - - - Indicates that a public field or property represents an XML element when the serializes or deserializes the object that contains it. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class and specifies the name of the XML element. - The XML element name of the serialized member. - - - Initializes a new instance of the class and specifies a type for the member to which the is applied. This type is used by the when serializing or deserializing object that contains it. - The of an object derived from the member's type. - - - Initializes a new instance of the and specifies the name of the XML element and a derived type for the member to which the is applied. This member type is used when the serializes the object that contains it. - The XML element name of the serialized member. - The of an object derived from the member's type. - - - Gets or sets the XML Schema definition (XSD) data type of the XML element generated by the . - An XML Schema data type, as defined by the World Wide Web Consortium (www.w3.org) document named "XML Schema Part 2: Datatypes". - The XML Schema data type you have specified cannot be mapped to the.NET data type. - - - Gets or sets the name of the generated XML element. - The name of the generated XML element. The default is the member identifier. - - - Gets or sets a value that indicates whether the element is qualified. - One of the values. The default is . - - - Gets or sets a value that indicates whether the must serialize a member that is set to null as an empty tag with the xsi:nil attribute set to true. - true if the generates the xsi:nil attribute; otherwise, false. - - - Gets or sets the namespace assigned to the XML element that results when the class is serialized. - The namespace of the XML element. - - - Gets or sets the explicit order in which the elements are serialized or deserialized. - The order of the code generation. - - - Gets or sets the object type used to represent the XML element. - The of the member. - - - Represents a collection of objects used by the to override the default way it serializes a class. - - - Initializes a new instance of the class. - - - Adds an to the collection. - The to add. - The zero-based index of the newly added item. - - - Determines whether the collection contains the specified object. - The to look for. - true if the object exists in the collection; otherwise, false. - - - Copies the , or a portion of it to a one-dimensional array. - The array to hold the copied elements. - The zero-based index in array at which copying begins. - - - Gets the index of the specified . - The whose index is being retrieved. - The zero-based index of the . - - - Inserts an into the collection. - The zero-based index where the member is inserted. - The to insert. - - - Gets or sets the element at the specified index. - The zero-based index of the element to get or set. - The element at the specified index. - index is not a valid index in the . - The property is set and the is read-only. - - - Removes the specified object from the collection. - The to remove from the collection. - - - Provides data for the event. - - - Gets the object that represents the unknown XML element. - The object that represents the unknown XML element. - - - Gets a comma-delimited list of XML element names expected to be in an XML document instance. - A comma-delimited list of XML element names. Each name is in the following format: namespace:name. - - - Gets the line number where the unknown element was encountered if the XML reader is an . - The line number where the unknown element was encountered if the XML reader is an ; otherwise, -1. - - - Gets the place in the line where the unknown element occurs if the XML reader is an . - The number in the line where the unknown element occurs if the XML reader is an ; otherwise, -1. - - - Gets the object the is deserializing. - The object that is being deserialized by the . - - - Represents the method that handles the event of an . - The source of the event. - A that contains the event data. - - - Controls how the serializes an enumeration member. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class, and specifies the XML value that the generates or recognizes (when it serializes or deserializes the enumeration, respectively). - The overriding name of the enumeration member. - - - Gets or sets the value generated in an XML-document instance when the serializes an enumeration, or the value recognized when it deserializes the enumeration member. - The value generated in an XML-document instance when the serializes the enumeration, or the value recognized when it is deserializes the enumeration member. - - - Instructs the method of the not to serialize the public field or public read/write property value. - - - Initializes a new instance of the class. - - - Allows the to recognize a type when it serializes or deserializes an object. - - - Initializes a new instance of the class. - The of the object to include. - - - Gets or sets the type of the object to include. - The of the object to include. - - - Supports mappings between .NET Framework types and XML Schema data types. - - - Get the name of the mapped element. - The name of the mapped element. - - - Gets the namespace of the mapped element. - The namespace of the mapped element. - - - Sets the key used to look up the mapping. - A that contains the lookup key. - - - Gets the name of the XSD element of the mapping. - The XSD element name. - - - Specifies whether a mapping is read, write, or both. - - - Both read and write methods are generated. - - - - Read methods are generated. - - - - Write methods are generated. - - - - Maps a code entity in a .NET Framework Web service method to an element in a Web Services Description Language (WSDL) message. - - - Gets or sets a value that indicates whether the .NET Framework type maps to an XML element or attribute of any type. - true, if the type maps to an XML any element or attribute; otherwise, false. - - - Gets a value that indicates whether the accompanying field in the .NET Framework type has a value specified. - true, if the accompanying field has a value specified; otherwise, false. - - - Gets the unqualified name of the XML element declaration that applies to this mapping. - The unqualified name of the XML element declaration that applies to this mapping. - - - Gets the name of the Web service method member that is represented by this mapping. - The name of the Web service method member represented by this mapping. - - - Gets the XML namespace that applies to this mapping. - The XML namespace that applies to this mapping. - - - Gets the fully qualified type name of the .NET Framework type for this mapping. - The fully qualified type name of the .NET Framework type for this mapping. - - - Gets the type name of the .NET Framework type for this mapping. - The type name of the .NET Framework type for this mapping. - - - Gets the namespace of the .NET Framework type for this mapping. - The namespace of the .NET Framework type for this mapping. - - - Gets the XML element name as it appears in the service description document. - The XML element name. - - - Provides mappings between .NET Framework Web service methods and Web Services Description Language (WSDL) messages that are defined for SOAP Web services. - - - Gets the number of .NET Framework code entities that belong to a Web service method to which a SOAP message is being mapped. - The number of mappings in the collection. - - - Gets an item that contains internal type mapping information for a .NET Framework code entity that belongs to a Web service method being mapped to a SOAP message. - The index of the mapping to return. - The requested . - - - Gets the name of the .NET Framework type being mapped to the data type of an XML Schema element that represents a SOAP message. - The name of the .NET Framework type. - - - Gets the namespace of the .NET Framework type being mapped to the data type of an XML Schema element that represents a SOAP message. - The .NET Framework namespace of the mapping. - - - Specifies that the target property, parameter, return value, or class member contains prefixes associated with namespaces that are used within an XML document. - - - Initializes a new instance of the class. - - - Provides data for the event. - - - Gets the line number of the unknown XML node. - The line number of the unknown XML node. - - - Gets the position in the line of the unknown XML node. - The position number of the unknown XML node. - - - Gets the XML local name of the XML node being deserialized. - The XML local name of the node being deserialized. - - - Gets the name of the XML node being deserialized. - The name of the node being deserialized. - - - Gets the namespace URI that is associated with the XML node being deserialized. - The namespace URI that is associated with the XML node being deserialized. - - - Gets the type of the XML node being deserialized. - The that represents the XML node being deserialized. - - - Gets the object being deserialized. - The being deserialized. - - - Gets the text of the XML node being deserialized. - The text of the XML node being deserialized. - - - Represents the method that handles the event of an . - The source of the event. - An that contains the event data. - - - Generates mappings to XML schema element declarations, including literal XML Schema Definition (XSD) message parts in a Web Services Description Language (WSDL) document, for .NET Framework types or Web service method information. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class using the specified default XML namespace. - The default XML namespace to use for imported type mappings. - - - Initializes a new instance of the class using the specified XML serialization overrides. - An object that overrides how the class serializes mapped types. - - - Initializes a new instance of the class using the specified XML serialization overrides and default XML namespace. - An object that overrides how the class serializes mapped types. - The default XML namespace to use for imported type mappings. - - - Generates internal type mappings for information from a Web service method. - An XML element name produced from the Web service method. - An XML element namespace produced from the Web service method. - An array of objects that contain .NET Framework code entities that belong to a Web service method. - true if elements that correspond to Web Services Description Language (WSDL) message parts should be enclosed in an extra wrapper element in a SOAP message; otherwise, false. - An with mappings to the element parts of a WSDL message definition. - - - Returns internal type mappings using information from a Web service method, and allows you to specify an XML element name, XML namespace, and other options. - An XML element name produced from the Web service method. - An XML element namespace produced from the Web service method. - An array of objects that contain .NET Framework code entities that belong to a Web service method. - true if elements that correspond to Web Services Description Language (WSDL) message parts should be enclosed in an extra wrapper element in a SOAP message; otherwise, false. - true if the method is a remote procedure call; otherwise, false. - An that contains the mappings. - - - Returns internal type mappings using information from a Web service method, and allows you to specify an XML element name, XML namespace, and other options. - An XML element name produced from the Web service method. - An XML element namespace produced from the Web service method. - An array of objects that contain .NET Framework code entities that belong to a Web service method. - true if elements that correspond to Web Services Description Language (WSDL) message parts should be enclosed in an extra wrapper element in a SOAP message; otherwise, false. - true if the method is a remote procedure call; otherwise, false. - true to specify that the generated schema type will be marked with the <xs:anyAttribute> element; otherwise, false. - An that contains the mappings. - - - Generates internal type mappings for information from a Web service method. - An XML element name produced from the Web service method. - An XML element namespace produced from the Web service method. - An array of objects that contain .NET Framework code entities that belong to a Web service method. - true if elements that correspond to Web Services Description Language (WSDL) message parts should be enclosed in an extra wrapper element in a SOAP message; otherwise, false. - true if the method is a remote procedure call; otherwise, false. - true to specify that the generated schema type will be marked with the <xs:anyAttribute> element; otherwise, false. - One of the values. The default is None. - An that contains the mappings. - - - Generates a mapping to an XML Schema element for a specified .NET Framework type. - The .NET Framework type for which to generate a type mapping. - Internal .NET Framework mapping of a type to an XML Schema element. - - - Generates a mapping to an XML Schema element for a .NET Framework type, using the specified type and namespace. - The .NET Framework type for which to generate a type mapping. - The default XML namespace to use. - Internal .NET Framework mapping of a type to an XML Schema element. - - - Generates a mapping to an XML Schema element for a .NET Framework type, using the specified type and attribute. - The .NET Framework type for which to generate a type mapping. - An attribute that is applied to the type. - An that represents a mapping of a .NET Framework type to an XML Schema element. - - - Generates a mapping to an XML Schema element for a .NET Framework type, using the specified type, attribute, and namespace. - The .NET Framework type for which to generate a type mapping. - An attribute that is applied to the type. - The default XML namespace to use. - An that contains the internal .NET Framework mapping of a type to an XML Schema element. - - - Includes mappings for a type for later use when import methods are invoked. - The .NET Framework type for which to save type mapping information. - - - Includes mappings for derived types for later use when import methods are invoked. - An instance of the class that contains custom attributes derived from the attribute. - - - Provides mappings between code entities in .NET Framework Web service methods and the content of Web Services Description Language (WSDL) messages that are defined for SOAP Web services. - - - Initializes a new instance of the class. - - - Gets or sets a value that indicates whether the represents a Web service method return value, as opposed to an output parameter. - true, if the member represents a Web service return value; otherwise, false. - - - Gets or sets the name of the Web service method member for this mapping. - The name of the Web service method. - - - Gets or sets the type of the Web service method member code entity that is represented by this mapping. - The of the Web service method member code entity that is represented by this mapping. - - - Gets or sets a value that indicates that the value of the corresponding XML element definition's isNullable attribute is false. - True to override the property; otherwise, false. - - - Gets or sets a with the collection of SOAP-related attributes that have been applied to the member code entity. - A that contains the objects that represent SOAP attributes applied to the member. - - - Gets or sets an with the collection of -related attributes that have been applied to the member code entity. - An that represents XML attributes that have been applied to the member code. - - - Controls XML serialization of the attribute target as an XML root element. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class and specifies the name of the XML root element. - The name of the XML root element. - - - Gets or sets the XSD data type of the XML root element. - An XSD (XML Schema Document) data type, as defined by the World Wide Web Consortium (www.w3.org) document named "XML Schema: DataTypes". - - - Gets or sets the name of the XML element that is generated and recognized by the class's and methods, respectively. - The name of the XML root element that is generated and recognized in an XML-document instance. The default is the name of the serialized class. - - - Gets or sets a value that indicates whether the must serialize a member that is set to null into the xsi:nil attribute set to true. - true if the generates the xsi:nil attribute; otherwise, false. - - - Gets or sets the namespace for the XML root element. - The namespace for the XML element. - - - Enables iteration over a collection of objects. - - - Initializes a new instance of the class. - The object you want to iterate over. - - - Gets the current element in the collection. - The current object in the collection. - - - Releases all resources used by the . - - - Advances the enumerator to the next item in the collection. - true if the move is successful; otherwise, false. - - - Gets the current element in the collection of objects. - The current element in the collection of objects. - - - Sets the enumerator to its initial position, which is before the first element in the collection of objects. - - - Populates objects with XML schema element declarations that are found in type mapping objects. - - - Initializes a new instance of the class. - A collection of objects to which element declarations obtained from type mappings are added. - - - Exports an element to the object that is identified by the specified namespace. - The namespace of the XML schema document to which to add an element. - An arbitrary name assigned to the element declaration. - - - Adds an element declaration for an object or type to a SOAP message or to an object. - An that contains mappings to export. - The string "any" with an appended integer. - - - Adds an element declaration to the applicable for each of the element parts of a literal SOAP message definition. - The internal .NET Framework type mappings for the element parts of a Web Services Description Language (WSDL) message definition. - - - Adds an element declaration to the applicable for each of the element parts of a literal SOAP message definition, and specifies whether enclosing elements are included. - The internal mapping between a .NET Framework type and an XML schema element. - true if the schema elements that enclose the schema are to be included; otherwise, false. - - - Adds an element declaration to the applicable object for a single element part of a literal SOAP message definition. - Internal .NET Framework type mappings for the element parts of a Web Services Description Language (WSDL) message definition. - An that represents the qualified XML name of the exported element declaration. - - - Adds an element declaration for a .NET Framework type to the applicable object. - The internal mapping between a .NET Framework type and an XML schema element. - - - Generates internal mappings to .NET Framework types for XML schema element declarations, including literal XSD message parts in a WSDL document. - - - Initializes a new instance of the class, taking a collection of objects representing the XML schemas used by SOAP literal messages defined in a WSDL document. - A collection of objects. - - - Initializes a new instance of the class, taking a collection of objects that represents the XML schemas used by SOAP literal messages, plus classes being generated for bindings defined in a Web Services Description Language (WSDL) document. - An object. - A object that specifies a collection of classes being generated for bindings defined in a WSDL document. - - - Generates internal type mapping information for a single, (SOAP) literal element part defined in a WSDL document. - An that specifies the name of an element's type for which a .NET Framework type is generated. - The name of the part element in the WSDL document. - An representing the .NET Framework type mapping for a single element part of a WSDL message definition. - - - Generates internal type mapping information for an element defined in an XML schema document. - An that specifies the name of an element defined in an XML schema document. - A base type for the .NET Framework type that is generated to correspond to an XSD element's type. - An representing the.NET Framework type mapping information for an XML schema element. - - - Generates internal type mapping information for an element defined in an XML schema document or as a part in a WSDL document. - An that specifies the name of an element defined in an XML schema document. - A base type for the .NET Framework type that is generated to correspond to an XSD element's type. - true to indicate that the type corresponding to an XSD element can indirectly inherit from the base type; otherwise, false. - The .NET Framework type mapping information for an XML schema element. - - - Generates internal type mapping information for a single element part of a literal-use SOAP message defined in a WSDL document. - An that specifies the name of the message part. - The .NET Framework type mapping for a WSDL message definition containing a single element part. - - - Generates internal type mapping information for the element parts of a literal-use SOAP message defined in a WSDL document. - An array of type that specifies the names of the message parts. - An that represents the .NET Framework type mappings for the element parts of a WSDL message definition. - - - Generates internal type mapping information for the element parts of a literal-use SOAP message defined in a WSDL document. - The name of the element for which to generate a mapping. - The namespace of the element for which to generate a mapping. - An array of instances that specifies the members of the element for which to generate a mapping. - A that contains type mapping information. - - - Generates internal type mapping information for the element parts of a literal-use SOAP message defined in a WSDL document. - An array of type that specifies the names of the message parts. - A base type for all .NET Framework types that are generated to correspond to message parts. - true to indicate that the types corresponding to message parts can indirectly inherit from the base type; otherwise, false. - The .NET Framework type mappings for the element parts of a WSDL message definition. - - - Generates internal type mapping information for an element defined in an XML schema document. - A that specifies an XML element. - A object that describes a type mapping. - - - Generates internal type mapping information for an element defined in an XML schema document. - A that specifies an XML element. - A object that specifies a base type. - A object that describes a type mapping. - - - Generates internal type mapping information for an element defined in an XML schema document. - A that specifies an XML element. - A object that specifies a base type. - A value that specifies whether the generated type can indirectly inherit the baseType. - A object that describes a type mapping. - - - Generates internal type mapping information for an element defined in an XML schema document. - An that specifies the name of an element defined in an XML schema document. - The .NET Framework type mapping information for an XML schema element. - - - When applied to a type, stores the name of a static method of the type that returns an XML schema and a (or for anonymous types) that controls the serialization of the type. - - - Initializes a new instance of the class, taking the name of the static method that supplies the type's XML schema. - The name of the static method that must be implemented. - - - Gets or sets a value that determines whether the target class is a wildcard, or that the schema for the class has contains only an xs:any element. - true, if the class is a wildcard, or if the schema contains only the xs:any element; otherwise, false. - - - Gets the name of the static method that supplies the type's XML schema and the name of its XML Schema data type. - The name of the method that is invoked by the XML infrastructure to return an XML schema. - - - Represents the collection of XML schemas. - - - Initializes a new instance of the class. - - - Adds an object to the end of the collection. - The object to be added to the collection of objects. - The index at which the is added. - - - Adds an instance of the class to the end of the collection. - The object to be added to the end of the collection. - - - Adds an object that represents an assembly reference to the collection. - The to add. - The of the schema object. - The index at which the is added. - - - Adds an object that represents an assembly reference to the collection. - The to add. - - - Processes the element and attribute names in the XML schemas and, optionally, validates the XML schemas. - A that specifies the callback method that handles errors and warnings during XML Schema validation, if the strict parameter is set to true. - true to validate the XML schemas in the collection using the method of the class; otherwise, false. - - - Returns a value that indicates whether the collection contains an object that belongs to the specified namespace. - The namespace of the item to check for. - true if the item is found; otherwise, false. - - - Determines whether the contains a specific schema. - The object to locate. - true, if the collection contains the specified item; otherwise, false. - - - Copies the entire to a compatible one-dimensional , which starts at the specified index of the target array. - The one-dimensional that is the destination of the schemas copied from . The must have zero-based indexing. - A 32-bit integer that represents the index in the array where copying begins. - - - Locates in one of the XML schemas an of the specified name and type. - An that specifies a fully qualified name with a namespace used to locate an object in the collection. - The of the object to find. Possible types include: , , , , and . - An instance, such as an or . - - - Gets a collection of schemas that belong to the same namespace. - The namespace of the schemas to retrieve. - An implementation that contains the schemas. - - - Searches for the specified schema and returns the zero-based index of the first occurrence within the entire . - The to locate. - The zero-based index of the first occurrence of the value within the entire , if found; otherwise, -1. - - - Inserts a schema into the at the specified index. - The zero-based index at which schema should be inserted. - The object to be inserted. - - - Gets a value that indicates whether the schemas have been compiled. - true, if the schemas have been compiled; otherwise, false. - - - Static method that determines whether the specified XML schema contains a custom IsDataSet attribute set to true, or its equivalent. - The XML schema to check for an IsDataSet attribute with a true value. - true if the specified schema exists; otherwise, false. - - - Gets or sets the object at the specified index. - The index of the item to retrieve. - The specified . - - - Gets a specified object that represents the XML schema associated with the specified namespace. - The namespace of the specified object. - The specified object. - - - Performs additional custom processes when clearing the contents of the instance. - - - Performs additional custom processes before inserting a new element into the instance. - The zero-based index at which to insert value. - The new value of the element at index. - - - Performs additional custom processes when removing an element from the instance. - The zero-based index at which value can be found. - The value of the element to remove at index. - - - Performs additional custom processes before setting a value in the instance. - The zero-based index at which oldValue can be found. - The value to replace with newValue. - The new value of the element at index. - - - Removes the first occurrence of a specific schema from the . - The to remove. - - - Returns an enumerator that iterates through the collection of XML schemas. - An object that can be used to iterate through the collection. - - - Delegate used by the class for deserialization of SOAP-encoded XML data types that map to collections or enumerations. - The collection into which the collection items array is copied. - An array of items to be copied into the object collection. - - - Delegate used by the class for deserialization of SOAP-encoded XML data. - An instance of the class that contains the object to be fixed and the array of string identifiers for the items to fill in. - - - An abstract class that is the base class for and and that contains methods common to both of these types. - - - Initializes an instance of the class. - - - Delegate used by the class for deserialization of types from SOAP-encoded, non-root XML data. - - - - Holds an delegate instance, plus the method's inputs; also supplies the method's parameters. - - - Initializes a new instance of the class with parameters for a callback method. - A collection into which the callback method copies the collection items array. - A method that instantiates the delegate. - An array into which the callback method copies a collection. - - - Gets the callback method that instantiates the delegate. - The delegate that points to the callback method. - - - Gets the object collection for the callback method. - The collection that is used for the fixup. - - - Gets the array into which the callback method copies a collection. - The array into which the callback method copies a collection. - - - The exception that is thrown when an attempt is made to access an unloaded application domain. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with a specified error message. - The message that describes the error. - - - Initializes a new instance of the class with serialized data. - The object that holds the serialized object data. - The contextual information about the source or destination. - - - Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. - The message that describes the error. - The exception that is the cause of the current exception. If the innerException parameter is not a null reference, the current exception is raised in a catch block that handles the inner exception. - - - Serves as the base class for application-defined exceptions. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with a specified error message. - A message that describes the error. - - - Initializes a new instance of the class with serialized data. - The object that holds the serialized object data. - The contextual information about the source or destination. - - - Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. - The error message that explains the reason for the exception. - The exception that is the cause of the current exception. If the innerException parameter is not a null reference, the current exception is raised in a catch block that handles the inner exception. - - - Contains information used to uniquely identify a manifest-based application. This class cannot be inherited. - - - Initializes a new instance of the class. - The array of bytes representing the raw public key data. - The name of the application. - A object that specifies the version of the application. - The processor architecture of the application. - The culture of the application. - name is null. -or- version is null. -or- publicKeyToken is null. - name is an empty string. - - - Creates and returns an identical copy of the current application identity. - An object that represents an exact copy of the original. - - - Gets a string representing the culture information for the application. - The culture information for the application. - - - Determines whether the specified object is equivalent to the current . - The object to compare to the current . - true if the specified object is equivalent to the current ; otherwise, false. - - - Gets the hash code for the current application identity. - The hash code for the current application identity. - - - Gets the name of the application. - The name of the application. - - - Gets the target processor architecture for the application. - The processor architecture of the application. - - - Gets the public key token for the application. - A byte array containing the public key token for the application. - - - Creates and returns a string representation of the application identity. - A string representation of the application identity. - - - Gets the version of the application. - A that specifies the version of the application. - - - The exception that is thrown when one of the arguments provided to a method is not valid. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with a specified error message. - The error message that explains the reason for the exception. - - - Initializes a new instance of the class with serialized data. - The object that holds the serialized object data. - The contextual information about the source or destination. - - - Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. - The error message that explains the reason for the exception. - The exception that is the cause of the current exception. If the innerException parameter is not a null reference, the current exception is raised in a catch block that handles the inner exception. - - - Initializes a new instance of the class with a specified error message and the name of the parameter that causes this exception. - The error message that explains the reason for the exception. - The name of the parameter that caused the current exception. - - - Initializes a new instance of the class with a specified error message, the parameter name, and a reference to the inner exception that is the cause of this exception. - The error message that explains the reason for the exception. - The name of the parameter that caused the current exception. - The exception that is the cause of the current exception. If the innerException parameter is not a null reference, the current exception is raised in a catch block that handles the inner exception. - - - Sets the object with the parameter name and additional exception information. - The object that holds the serialized object data. - The contextual information about the source or destination. - The info object is a null reference (Nothing in Visual Basic). - - - Gets the error message and the parameter name, or only the error message if no parameter name is set. -

A text string describing the details of the exception. The value of this property takes one of two forms:

-
Condition

-

Value

-

The paramName is a null reference (Nothing in Visual Basic) or of zero length.

-

The message string passed to the constructor.

-

The paramName is not null reference (Nothing in Visual Basic) and it has a length greater than zero.

-

The message string appended with the name of the invalid parameter.

-

-
-
- - Gets the name of the parameter that causes this exception. - The parameter name. - - - The exception that is thrown when a null reference (Nothing in Visual Basic) is passed to a method that does not accept it as a valid argument. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with the name of the parameter that causes this exception. - The name of the parameter that caused the exception. - - - Initializes a new instance of the class with serialized data. - The object that holds the serialized object data. - An object that describes the source or destination of the serialized data. - - - Initializes a new instance of the class with a specified error message and the exception that is the cause of this exception. - The error message that explains the reason for this exception. - The exception that is the cause of the current exception, or a null reference (Nothing in Visual Basic) if no inner exception is specified. - - - Initializes an instance of the class with a specified error message and the name of the parameter that causes this exception. - The name of the parameter that caused the exception. - A message that describes the error. - - - The exception that is thrown when the value of an argument is outside the allowable range of values as defined by the invoked method. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with the name of the parameter that causes this exception. - The name of the parameter that causes this exception. - - - Initializes a new instance of the class with serialized data. - The object that holds the serialized object data. - An object that describes the source or destination of the serialized data. - - - Initializes a new instance of the class with a specified error message and the exception that is the cause of this exception. - The error message that explains the reason for this exception. - The exception that is the cause of the current exception, or a null reference (Nothing in Visual Basic) if no inner exception is specified. - - - Initializes a new instance of the class with the name of the parameter that causes this exception and a specified error message. - The name of the parameter that caused the exception. - The message that describes the error. - - - Initializes a new instance of the class with the parameter name, the value of the argument, and a specified error message. - The name of the parameter that caused the exception. - The value of the argument that causes this exception. - The message that describes the error. - - - Gets the argument value that causes this exception. - An Object that contains the value of the parameter that caused the current . - - - Sets the object with the invalid argument value and additional exception information. - The object that holds the serialized object data. - An object that describes the source or destination of the serialized data. - The info object is null. - - - Gets the error message and the string representation of the invalid argument value, or only the error message if the argument value is null. -

The text message for this exception. The value of this property takes one of two forms, as follows.

-
Condition

-

Value

-

The actualValue is null.

-

The message string passed to the constructor.

-

The actualValue is not null.

-

The message string appended with the string representation of the invalid argument value.

-

-
-
- - The exception that is thrown for errors in an arithmetic, casting, or conversion operation. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with a specified error message. - A that describes the error. - - - Initializes a new instance of the class with serialized data. - The object that holds the serialized object data. - The contextual information about the source or destination. - - - Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. - The error message that explains the reason for the exception. - The exception that is the cause of the current exception. If the innerException parameter is not a null reference, the current exception is raised in a catch block that handles the inner exception. - - - Provides methods for creating, manipulating, searching, and sorting arrays, thereby serving as the base class for all arrays in the common language runtime. - - - Returns a read-only wrapper for the specified array. - The one-dimensional, zero-based array to wrap in a read-only wrapper. - The type of the elements of the array. - A read-only wrapper for the specified array. - array is null. - - - Searches an entire one-dimensional sorted array for a specific element, using the interface implemented by each element of the array and by the specified object. - The sorted one-dimensional to search. - The object to search for. - The index of the specified value in the specified array, if value is found; otherwise, a negative number. If value is not found and value is less than one or more elements in array, the negative number returned is the bitwise complement of the index of the first element that is larger than value. If value is not found and value is greater than all elements in array, the negative number returned is the bitwise complement of (the index of the last element plus 1). If this method is called with a non-sorted array, the return value can be incorrect and a negative number could be returned, even if value is present in array. - array is null. - array is multidimensional. - value is of a type that is not compatible with the elements of array. - value does not implement the interface, and the search encounters an element that does not implement the interface. - - - Searches an entire one-dimensional sorted array for a value using the specified interface. - The sorted one-dimensional to search. - The object to search for. - The implementation to use when comparing elements. -or- null to use the implementation of each element. - The index of the specified value in the specified array, if value is found; otherwise, a negative number. If value is not found and value is less than one or more elements in array, the negative number returned is the bitwise complement of the index of the first element that is larger than value. If value is not found and value is greater than all elements in array, the negative number returned is the bitwise complement of (the index of the last element plus 1). If this method is called with a non-sorted array, the return value can be incorrect and a negative number could be returned, even if value is present in array. - array is null. - array is multidimensional. - comparer is null, and value is of a type that is not compatible with the elements of array. - comparer is null, value does not implement the interface, and the search encounters an element that does not implement the interface. - - - Searches a range of elements in a one-dimensional sorted array for a value, using the interface implemented by each element of the array and by the specified value. - The sorted one-dimensional to search. - The starting index of the range to search. - The length of the range to search. - The object to search for. - The index of the specified value in the specified array, if value is found; otherwise, a negative number. If value is not found and value is less than one or more elements in array, the negative number returned is the bitwise complement of the index of the first element that is larger than value. If value is not found and value is greater than all elements in array, the negative number returned is the bitwise complement of (the index of the last element plus 1). If this method is called with a non-sorted array, the return value can be incorrect and a negative number could be returned, even if value is present in array. - array is null. - array is multidimensional. - index is less than the lower bound of array. -or- length is less than zero. - index and length do not specify a valid range in array. -or- value is of a type that is not compatible with the elements of array. - value does not implement the interface, and the search encounters an element that does not implement the interface. - - - Searches a range of elements in a one-dimensional sorted array for a value, using the specified interface. - The sorted one-dimensional to search. - The starting index of the range to search. - The length of the range to search. - The object to search for. - The implementation to use when comparing elements. -or- null to use the implementation of each element. - The index of the specified value in the specified array, if value is found; otherwise, a negative number. If value is not found and value is less than one or more elements in array, the negative number returned is the bitwise complement of the index of the first element that is larger than value. If value is not found and value is greater than all elements in array, the negative number returned is the bitwise complement of (the index of the last element plus 1). If this method is called with a non-sorted array, the return value can be incorrect and a negative number could be returned, even if value is present in array. - array is null. - array is multidimensional. - index is less than the lower bound of array. -or- length is less than zero. - index and length do not specify a valid range in array. -or- comparer is null, and value is of a type that is not compatible with the elements of array. - comparer is null, value does not implement the interface, and the search encounters an element that does not implement the interface. - - - Searches an entire one-dimensional sorted array for a specific element, using the generic interface implemented by each element of the and by the specified object. - The sorted one-dimensional, zero-based to search. - The object to search for. - The type of the elements of the array. - The index of the specified value in the specified array, if value is found; otherwise, a negative number. If value is not found and value is less than one or more elements in array, the negative number returned is the bitwise complement of the index of the first element that is larger than value. If value is not found and value is greater than all elements in array, the negative number returned is the bitwise complement of (the index of the last element plus 1). If this method is called with a non-sorted array, the return value can be incorrect and a negative number could be returned, even if value is present in array. - array is null. - T does not implement the generic interface. - - - Searches an entire one-dimensional sorted array for a value using the specified generic interface. - The sorted one-dimensional, zero-based to search. - The object to search for. - The implementation to use when comparing elements. -or- null to use the implementation of each element. - The type of the elements of the array. - The index of the specified value in the specified array, if value is found; otherwise, a negative number. If value is not found and value is less than one or more elements in array, the negative number returned is the bitwise complement of the index of the first element that is larger than value. If value is not found and value is greater than all elements in array, the negative number returned is the bitwise complement of (the index of the last element plus 1). If this method is called with a non-sorted array, the return value can be incorrect and a negative number could be returned, even if value is present in array. - array is null. - comparer is null, and value is of a type that is not compatible with the elements of array. - comparer is null, and T does not implement the generic interface - - - Searches a range of elements in a one-dimensional sorted array for a value, using the generic interface implemented by each element of the and by the specified value. - The sorted one-dimensional, zero-based to search. - The starting index of the range to search. - The length of the range to search. - The object to search for. - The type of the elements of the array. - The index of the specified value in the specified array, if value is found; otherwise, a negative number. If value is not found and value is less than one or more elements in array, the negative number returned is the bitwise complement of the index of the first element that is larger than value. If value is not found and value is greater than all elements in array, the negative number returned is the bitwise complement of (the index of the last element plus 1). If this method is called with a non-sorted array, the return value can be incorrect and a negative number could be returned, even if value is present in array. - array is null. - index is less than the lower bound of array. -or- length is less than zero. - index and length do not specify a valid range in array. -or- value is of a type that is not compatible with the elements of array. - T does not implement the generic interface. - - - Searches a range of elements in a one-dimensional sorted array for a value, using the specified generic interface. - The sorted one-dimensional, zero-based to search. - The starting index of the range to search. - The length of the range to search. - The object to search for. - The implementation to use when comparing elements. -or- null to use the implementation of each element. - The type of the elements of the array. - The index of the specified value in the specified array, if value is found; otherwise, a negative number. If value is not found and value is less than one or more elements in array, the negative number returned is the bitwise complement of the index of the first element that is larger than value. If value is not found and value is greater than all elements in array, the negative number returned is the bitwise complement of (the index of the last element plus 1). If this method is called with a non-sorted array, the return value can be incorrect and a negative number could be returned, even if value is present in array. - array is null. - index is less than the lower bound of array. -or- length is less than zero. - index and length do not specify a valid range in array. -or- comparer is null, and value is of a type that is not compatible with the elements of array. - comparer is null, and T does not implement the generic interface. - - - Sets a range of elements in an array to the default value of each element type. - The array whose elements need to be cleared. - The starting index of the range of elements to clear. - The number of elements to clear. - array is null. - index is less than the lower bound of array. -or- length is less than zero. -or- The sum of index and length is greater than the size of array. - - - Creates a shallow copy of the . - A shallow copy of the . - - - Copies a range of elements from an starting at the specified source index and pastes them to another starting at the specified destination index. Guarantees that all changes are undone if the copy does not succeed completely. - The that contains the data to copy. - A 32-bit integer that represents the index in the sourceArray at which copying begins. - The that receives the data. - A 32-bit integer that represents the index in the destinationArray at which storing begins. - A 32-bit integer that represents the number of elements to copy. - sourceArray is null. -or- destinationArray is null. - sourceArray and destinationArray have different ranks. - The sourceArray type is neither the same as nor derived from the destinationArray type. - At least one element in sourceArray cannot be cast to the type of destinationArray. - sourceIndex is less than the lower bound of the first dimension of sourceArray. -or- destinationIndex is less than the lower bound of the first dimension of destinationArray. -or- length is less than zero. - length is greater than the number of elements from sourceIndex to the end of sourceArray. -or- length is greater than the number of elements from destinationIndex to the end of destinationArray. - - - Converts an array of one type to an array of another type. - The one-dimensional, zero-based to convert to a target type. - A that converts each element from one type to another type. - The type of the elements of the source array. - The type of the elements of the target array. - An array of the target type containing the converted elements from the source array. - array is null. -or- converter is null. - - - Copies a range of elements from an starting at the specified source index and pastes them to another starting at the specified destination index. The length and the indexes are specified as 64-bit integers. - The that contains the data to copy. - A 64-bit integer that represents the index in the sourceArray at which copying begins. - The that receives the data. - A 64-bit integer that represents the index in the destinationArray at which storing begins. - A 64-bit integer that represents the number of elements to copy. The integer must be between zero and , inclusive. - sourceArray is null. -or- destinationArray is null. - sourceArray and destinationArray have different ranks. - sourceArray and destinationArray are of incompatible types. - At least one element in sourceArray cannot be cast to the type of destinationArray. - sourceIndex is outside the range of valid indexes for the sourceArray. -or- destinationIndex is outside the range of valid indexes for the destinationArray. -or- length is less than 0 or greater than . - length is greater than the number of elements from sourceIndex to the end of sourceArray. -or- length is greater than the number of elements from destinationIndex to the end of destinationArray. - - - Copies a range of elements from an starting at the specified source index and pastes them to another starting at the specified destination index. The length and the indexes are specified as 32-bit integers. - The that contains the data to copy. - A 32-bit integer that represents the index in the sourceArray at which copying begins. - The that receives the data. - A 32-bit integer that represents the index in the destinationArray at which storing begins. - A 32-bit integer that represents the number of elements to copy. - sourceArray is null. -or- destinationArray is null. - sourceArray and destinationArray have different ranks. - sourceArray and destinationArray are of incompatible types. - At least one element in sourceArray cannot be cast to the type of destinationArray. - sourceIndex is less than the lower bound of the first dimension of sourceArray. -or- destinationIndex is less than the lower bound of the first dimension of destinationArray. -or- length is less than zero. - length is greater than the number of elements from sourceIndex to the end of sourceArray. -or- length is greater than the number of elements from destinationIndex to the end of destinationArray. - - - Copies a range of elements from an starting at the first element and pastes them into another starting at the first element. The length is specified as a 64-bit integer. - The that contains the data to copy. - The that receives the data. - A 64-bit integer that represents the number of elements to copy. The integer must be between zero and , inclusive. - sourceArray is null. -or- destinationArray is null. - sourceArray and destinationArray have different ranks. - sourceArray and destinationArray are of incompatible types. - At least one element in sourceArray cannot be cast to the type of destinationArray. - length is less than 0 or greater than . - length is greater than the number of elements in sourceArray. -or- length is greater than the number of elements in destinationArray. - - - Copies a range of elements from an starting at the first element and pastes them into another starting at the first element. The length is specified as a 32-bit integer. - The that contains the data to copy. - The that receives the data. - A 32-bit integer that represents the number of elements to copy. - sourceArray is null. -or- destinationArray is null. - sourceArray and destinationArray have different ranks. - sourceArray and destinationArray are of incompatible types. - At least one element in sourceArray cannot be cast to the type of destinationArray. - length is less than zero. - length is greater than the number of elements in sourceArray. -or- length is greater than the number of elements in destinationArray. - - - Copies all the elements of the current one-dimensional array to the specified one-dimensional array starting at the specified destination array index. The index is specified as a 32-bit integer. - The one-dimensional array that is the destination of the elements copied from the current array. - A 32-bit integer that represents the index in array at which copying begins. - array is null. - index is less than the lower bound of array. - array is multidimensional. -or- The number of elements in the source array is greater than the available number of elements from index to the end of the destination array. - The type of the source cannot be cast automatically to the type of the destination array. - The source array is multidimensional. - At least one element in the source cannot be cast to the type of destination array. - - - Copies all the elements of the current one-dimensional array to the specified one-dimensional array starting at the specified destination array index. The index is specified as a 64-bit integer. - The one-dimensional array that is the destination of the elements copied from the current array. - A 64-bit integer that represents the index in array at which copying begins. - array is null. - index is outside the range of valid indexes for array. - array is multidimensional. -or- The number of elements in the source array is greater than the available number of elements from index to the end of the destination array. - The type of the source cannot be cast automatically to the type of the destination array. - The source is multidimensional. - At least one element in the source cannot be cast to the type of destination array. - - - Creates a one-dimensional of the specified and length, with zero-based indexing. - The of the to create. - The size of the to create. - A new one-dimensional of the specified with the specified length, using zero-based indexing. - elementType is null. - elementType is not a valid . - elementType is not supported. For example, is not supported. -or- elementType is an open generic type. - length is less than zero. - - - Creates a multidimensional of the specified and dimension lengths, with zero-based indexing. The dimension lengths are specified in an array of 32-bit integers. - The of the to create. - An array of 32-bit integers that represent the size of each dimension of the to create. - A new multidimensional of the specified with the specified length for each dimension, using zero-based indexing. - elementType is null. -or- lengths is null. - elementType is not a valid . -or- The lengths array contains less than one element. - elementType is not supported. For example, is not supported. -or- elementType is an open generic type. - Any value in lengths is less than zero. - - - Creates a multidimensional of the specified and dimension lengths, with zero-based indexing. The dimension lengths are specified in an array of 64-bit integers. - The of the to create. - An array of 64-bit integers that represent the size of each dimension of the to create. Each integer in the array must be between zero and , inclusive. - A new multidimensional of the specified with the specified length for each dimension, using zero-based indexing. - elementType is null. -or- lengths is null. - elementType is not a valid . -or- The lengths array contains less than one element. - elementType is not supported. For example, is not supported. -or- elementType is an open generic type. - Any value in lengths is less than zero or greater than . - - - Creates a two-dimensional of the specified and dimension lengths, with zero-based indexing. - The of the to create. - The size of the first dimension of the to create. - The size of the second dimension of the to create. - A new two-dimensional of the specified with the specified length for each dimension, using zero-based indexing. - elementType is null. - elementType is not a valid . - elementType is not supported. For example, is not supported. -or- elementType is an open generic type. - length1 is less than zero. -or- length2 is less than zero. - - - Creates a multidimensional of the specified and dimension lengths, with the specified lower bounds. - The of the to create. - A one-dimensional array that contains the size of each dimension of the to create. - A one-dimensional array that contains the lower bound (starting index) of each dimension of the to create. - A new multidimensional of the specified with the specified length and lower bound for each dimension. - elementType is null. -or- lengths is null. -or- lowerBounds is null. - elementType is not a valid . -or- The lengths array contains less than one element. -or- The lengths and lowerBounds arrays do not contain the same number of elements. - elementType is not supported. For example, is not supported. -or- elementType is an open generic type. - Any value in lengths is less than zero. -or- Any value in lowerBounds is very large, such that the sum of a dimension's lower bound and length is greater than . - - - Creates a three-dimensional of the specified and dimension lengths, with zero-based indexing. - The of the to create. - The size of the first dimension of the to create. - The size of the second dimension of the to create. - The size of the third dimension of the to create. - A new three-dimensional of the specified with the specified length for each dimension, using zero-based indexing. - elementType is null. - elementType is not a valid . - elementType is not supported. For example, is not supported. -or- elementType is an open generic type. - length1 is less than zero. -or- length2 is less than zero. -or- length3 is less than zero. - - - Returns an empty array. - The type of the elements of the array. - Returns an empty . - - - Determines whether the specified array contains elements that match the conditions defined by the specified predicate. - The one-dimensional, zero-based to search. - The that defines the conditions of the elements to search for. - The type of the elements of the array. - true if array contains one or more elements that match the conditions defined by the specified predicate; otherwise, false. - array is null. -or- match is null. - - - Searches for an element that matches the conditions defined by the specified predicate, and returns the first occurrence within the entire . - The one-dimensional, zero-based array to search. - The predicate that defines the conditions of the element to search for. - The type of the elements of the array. - The first element that matches the conditions defined by the specified predicate, if found; otherwise, the default value for type T. - array is null. -or- match is null. - - - Retrieves all the elements that match the conditions defined by the specified predicate. - The one-dimensional, zero-based to search. - The that defines the conditions of the elements to search for. - The type of the elements of the array. - An containing all the elements that match the conditions defined by the specified predicate, if found; otherwise, an empty . - array is null. -or- match is null. - - - Searches for an element that matches the conditions defined by the specified predicate, and returns the zero-based index of the first occurrence within the entire . - The one-dimensional, zero-based to search. - The that defines the conditions of the element to search for. - The type of the elements of the array. - The zero-based index of the first occurrence of an element that matches the conditions defined by match, if found; otherwise, -1. - array is null. -or- match is null. - - - Searches for an element that matches the conditions defined by the specified predicate, and returns the zero-based index of the first occurrence within the range of elements in the that extends from the specified index to the last element. - The one-dimensional, zero-based to search. - The zero-based starting index of the search. - The that defines the conditions of the element to search for. - The type of the elements of the array. - The zero-based index of the first occurrence of an element that matches the conditions defined by match, if found; otherwise, -1. - array is null. -or- match is null. - startIndex is outside the range of valid indexes for array. - - - Searches for an element that matches the conditions defined by the specified predicate, and returns the zero-based index of the first occurrence within the range of elements in the that starts at the specified index and contains the specified number of elements. - The one-dimensional, zero-based to search. - The zero-based starting index of the search. - The number of elements in the section to search. - The that defines the conditions of the element to search for. - The type of the elements of the array. - The zero-based index of the first occurrence of an element that matches the conditions defined by match, if found; otherwise, -1. - array is null. -or- match is null. - startIndex is outside the range of valid indexes for array. -or- count is less than zero. -or- startIndex and count do not specify a valid section in array. - - - Searches for an element that matches the conditions defined by the specified predicate, and returns the last occurrence within the entire . - The one-dimensional, zero-based to search. - The that defines the conditions of the element to search for. - The type of the elements of the array. - The last element that matches the conditions defined by the specified predicate, if found; otherwise, the default value for type T. - array is null. -or- match is null. - - - Searches for an element that matches the conditions defined by the specified predicate, and returns the zero-based index of the last occurrence within the entire . - The one-dimensional, zero-based to search. - The that defines the conditions of the element to search for. - The type of the elements of the array. - The zero-based index of the last occurrence of an element that matches the conditions defined by match, if found; otherwise, –1. - array is null. -or- match is null. - - - Searches for an element that matches the conditions defined by the specified predicate, and returns the zero-based index of the last occurrence within the range of elements in the that extends from the first element to the specified index. - The one-dimensional, zero-based to search. - The zero-based starting index of the backward search. - The that defines the conditions of the element to search for. - The type of the elements of the array. - The zero-based index of the last occurrence of an element that matches the conditions defined by match, if found; otherwise, –1. - array is null. -or- match is null. - startIndex is outside the range of valid indexes for array. - - - Searches for an element that matches the conditions defined by the specified predicate, and returns the zero-based index of the last occurrence within the range of elements in the that contains the specified number of elements and ends at the specified index. - The one-dimensional, zero-based to search. - The zero-based starting index of the backward search. - The number of elements in the section to search. - The that defines the conditions of the element to search for. - The type of the elements of the array. - The zero-based index of the last occurrence of an element that matches the conditions defined by match, if found; otherwise, –1. - array is null. -or- match is null. - startIndex is outside the range of valid indexes for array. -or- count is less than zero. -or- startIndex and count do not specify a valid section in array. - - - Performs the specified action on each element of the specified array. - The one-dimensional, zero-based on whose elements the action is to be performed. - The to perform on each element of array. - The type of the elements of the array. - array is null. -or- action is null. - - - Returns an for the . - An for the . - - - Gets a 32-bit integer that represents the number of elements in the specified dimension of the . - A zero-based dimension of the whose length needs to be determined. - A 32-bit integer that represents the number of elements in the specified dimension. - dimension is less than zero. -or- dimension is equal to or greater than . - - - Gets a 64-bit integer that represents the number of elements in the specified dimension of the . - A zero-based dimension of the whose length needs to be determined. - A 64-bit integer that represents the number of elements in the specified dimension. - dimension is less than zero. -or- dimension is equal to or greater than . - - - Gets the index of the first element of the specified dimension in the array. - A zero-based dimension of the array whose starting index needs to be determined. - The index of the first element of the specified dimension in the array. - dimension is less than zero. -or- dimension is equal to or greater than . - - - Gets the index of the last element of the specified dimension in the array. - A zero-based dimension of the array whose upper bound needs to be determined. - The index of the last element of the specified dimension in the array, or -1 if the specified dimension is empty. - dimension is less than zero. -or- dimension is equal to or greater than . - - - Gets the value at the specified position in the three-dimensional . The indexes are specified as 64-bit integers. - A 64-bit integer that represents the first-dimension index of the element to get. - A 64-bit integer that represents the second-dimension index of the element to get. - A 64-bit integer that represents the third-dimension index of the element to get. - The value at the specified position in the three-dimensional . - The current does not have exactly three dimensions. - index1 or index2 or index3 is outside the range of valid indexes for the corresponding dimension of the current . - - - Gets the value at the specified position in the three-dimensional . The indexes are specified as 32-bit integers. - A 32-bit integer that represents the first-dimension index of the element to get. - A 32-bit integer that represents the second-dimension index of the element to get. - A 32-bit integer that represents the third-dimension index of the element to get. - The value at the specified position in the three-dimensional . - The current does not have exactly three dimensions. - index1 or index2 or index3 is outside the range of valid indexes for the corresponding dimension of the current . - - - Gets the value at the specified position in the two-dimensional . The indexes are specified as 64-bit integers. - A 64-bit integer that represents the first-dimension index of the element to get. - A 64-bit integer that represents the second-dimension index of the element to get. - The value at the specified position in the two-dimensional . - The current does not have exactly two dimensions. - Either index1 or index2 is outside the range of valid indexes for the corresponding dimension of the current . - - - Gets the value at the specified position in the two-dimensional . The indexes are specified as 32-bit integers. - A 32-bit integer that represents the first-dimension index of the element to get. - A 32-bit integer that represents the second-dimension index of the element to get. - The value at the specified position in the two-dimensional . - The current does not have exactly two dimensions. - Either index1 or index2 is outside the range of valid indexes for the corresponding dimension of the current . - - - Gets the value at the specified position in the one-dimensional . The index is specified as a 32-bit integer. - A 32-bit integer that represents the position of the element to get. - The value at the specified position in the one-dimensional . - The current does not have exactly one dimension. - index is outside the range of valid indexes for the current . - - - Gets the value at the specified position in the one-dimensional . The index is specified as a 64-bit integer. - A 64-bit integer that represents the position of the element to get. - The value at the specified position in the one-dimensional . - The current does not have exactly one dimension. - index is outside the range of valid indexes for the current . - - - Gets the value at the specified position in the multidimensional . The indexes are specified as an array of 32-bit integers. - A one-dimensional array of 32-bit integers that represent the indexes specifying the position of the element to get. - The value at the specified position in the multidimensional . - indices is null. - The number of dimensions in the current is not equal to the number of elements in indices. - Any element in indices is outside the range of valid indexes for the corresponding dimension of the current . - - - Gets the value at the specified position in the multidimensional . The indexes are specified as an array of 64-bit integers. - A one-dimensional array of 64-bit integers that represent the indexes specifying the position of the element to get. - The value at the specified position in the multidimensional . - indices is null. - The number of dimensions in the current is not equal to the number of elements in indices. - Any element in indices is outside the range of valid indexes for the corresponding dimension of the current . - - - Searches for the specified object and returns the index of its first occurrence in a one-dimensional array. - The one-dimensional array to search. - The object to locate in array. - The index of the first occurrence of value in array, if found; otherwise, the lower bound of the array minus 1. - array is null. - array is multidimensional. - - - Searches for the specified object in a range of elements of a one-dimensional array, and returns the index of its first occurrence. The range extends from a specified index to the end of the array. - The one-dimensional array to search. - The object to locate in array. - The starting index of the search. 0 (zero) is valid in an empty array. - The index of the first occurrence of value, if it’s found, within the range of elements in array that extends from startIndex to the last element; otherwise, the lower bound of the array minus 1. - array is null. - startIndex is outside the range of valid indexes for array. - array is multidimensional. - - - Searches for the specified object in a range of elements of a one-dimensional array, and returns the index of ifs first occurrence. The range extends from a specified index for a specified number of elements. - The one-dimensional array to search. - The object to locate in array. - The starting index of the search. 0 (zero) is valid in an empty array. - The number of elements to search. - The index of the first occurrence of value, if it’s found in the array from index startIndex to startIndex + count - 1; otherwise, the lower bound of the array minus 1. - array is null. - startIndex is outside the range of valid indexes for array. -or- count is less than zero. -or- startIndex and count do not specify a valid section in array. - array is multidimensional. - - - Searches for the specified object in a range of elements of a one-dimensional array, and returns the index of its first occurrence. The range extends from a specified index for a specified number of elements. - The one-dimensional, zero-based array to search. - The object to locate in array. - The zero-based starting index of the search. 0 (zero) is valid in an empty array. - The number of elements in the section to search. - The type of the elements of the array. - The zero-based index of the first occurrence of value within the range of elements in array that starts at startIndex and contains the number of elements specified in count, if found; otherwise, –1. - array is null. - startIndex is outside the range of valid indexes for array. -or- count is less than zero. -or- startIndex and count do not specify a valid section in array. - - - Searches for the specified object and returns the index of its first occurrence in a one-dimensional array. - The one-dimensional, zero-based array to search. - The object to locate in array. - The type of the elements of the array. - The zero-based index of the first occurrence of value in the entire array, if found; otherwise, –1. - array is null. - - - Searches for the specified object in a range of elements of a one dimensional array, and returns the index of its first occurrence. The range extends from a specified index to the end of the array. - The one-dimensional, zero-based array to search. - The object to locate in array. - The zero-based starting index of the search. 0 (zero) is valid in an empty array. - The type of the elements of the array. - The zero-based index of the first occurrence of value within the range of elements in array that extends from startIndex to the last element, if found; otherwise, –1. - array is null. - startIndex is outside the range of valid indexes for array. - - - Initializes every element of the value-type by calling the default constructor of the value type. - - - Gets a value indicating whether the has a fixed size. - This property is always true for all arrays. - - - Gets a value indicating whether the is read-only. - This property is always false for all arrays. - - - Gets a value indicating whether access to the is synchronized (thread safe). - This property is always false for all arrays. - - - Searches for the specified object and returns the index of the last occurrence within the entire one-dimensional . - The one-dimensional to search. - The object to locate in array. - The index of the last occurrence of value within the entire array, if found; otherwise, the lower bound of the array minus 1. - array is null. - array is multidimensional. - - - Searches for the specified object and returns the index of the last occurrence within the range of elements in the one-dimensional that extends from the first element to the specified index. - The one-dimensional to search. - The object to locate in array. - The starting index of the backward search. - The index of the last occurrence of value within the range of elements in array that extends from the first element to startIndex, if found; otherwise, the lower bound of the array minus 1. - array is null. - startIndex is outside the range of valid indexes for array. - array is multidimensional. - - - Searches for the specified object and returns the index of the last occurrence within the range of elements in the one-dimensional that contains the specified number of elements and ends at the specified index. - The one-dimensional to search. - The object to locate in array. - The starting index of the backward search. - The number of elements in the section to search. - The index of the last occurrence of value within the range of elements in array that contains the number of elements specified in count and ends at startIndex, if found; otherwise, the lower bound of the array minus 1. - array is null. - startIndex is outside the range of valid indexes for array. -or- count is less than zero. -or- startIndex and count do not specify a valid section in array. - array is multidimensional. - - - Searches for the specified object and returns the index of the last occurrence within the entire . - The one-dimensional, zero-based to search. - The object to locate in array. - The type of the elements of the array. - The zero-based index of the last occurrence of value within the entire array, if found; otherwise, –1. - array is null. - - - Searches for the specified object and returns the index of the last occurrence within the range of elements in the that extends from the first element to the specified index. - The one-dimensional, zero-based to search. - The object to locate in array. - The zero-based starting index of the backward search. - The type of the elements of the array. - The zero-based index of the last occurrence of value within the range of elements in array that extends from the first element to startIndex, if found; otherwise, –1. - array is null. - startIndex is outside the range of valid indexes for array. - - - Searches for the specified object and returns the index of the last occurrence within the range of elements in the that contains the specified number of elements and ends at the specified index. - The one-dimensional, zero-based to search. - The object to locate in array. - The zero-based starting index of the backward search. - The number of elements in the section to search. - The type of the elements of the array. - The zero-based index of the last occurrence of value within the range of elements in array that contains the number of elements specified in count and ends at startIndex, if found; otherwise, –1. - array is null. - startIndex is outside the range of valid indexes for array. -or- count is less than zero. -or- startIndex and count do not specify a valid section in array. - - - Gets the total number of elements in all the dimensions of the . - The total number of elements in all the dimensions of the ; zero if there are no elements in the array. - The array is multidimensional and contains more than elements. - - - Gets a 64-bit integer that represents the total number of elements in all the dimensions of the . - A 64-bit integer that represents the total number of elements in all the dimensions of the . - - - Gets the rank (number of dimensions) of the . For example, a one-dimensional array returns 1, a two-dimensional array returns 2, and so on. - The rank (number of dimensions) of the . - - - Changes the number of elements of a one-dimensional array to the specified new size. - The one-dimensional, zero-based array to resize, or null to create a new array with the specified size. - The size of the new array. - The type of the elements of the array. - newSize is less than zero. - - - Reverses the sequence of the elements in a range of elements in the one-dimensional . - The one-dimensional to reverse. - The starting index of the section to reverse. - The number of elements in the section to reverse. - array is null. - array is multidimensional. - index is less than the lower bound of array. -or- length is less than zero. - index and length do not specify a valid range in array. - - - Reverses the sequence of the elements in the entire one-dimensional . - The one-dimensional to reverse. - array is null. - array is multidimensional. - - - Sets a value to the element at the specified position in the one-dimensional . The index is specified as a 32-bit integer. - The new value for the specified element. - A 32-bit integer that represents the position of the element to set. - The current does not have exactly one dimension. - value cannot be cast to the element type of the current . - index is outside the range of valid indexes for the current . - - - Sets a value to the element at the specified position in the multidimensional . The indexes are specified as an array of 32-bit integers. - The new value for the specified element. - A one-dimensional array of 32-bit integers that represent the indexes specifying the position of the element to set. - indices is null. - The number of dimensions in the current is not equal to the number of elements in indices. - value cannot be cast to the element type of the current . - Any element in indices is outside the range of valid indexes for the corresponding dimension of the current . - - - Sets a value to the element at the specified position in the one-dimensional . The index is specified as a 64-bit integer. - The new value for the specified element. - A 64-bit integer that represents the position of the element to set. - The current does not have exactly one dimension. - value cannot be cast to the element type of the current . - index is outside the range of valid indexes for the current . - - - Sets a value to the element at the specified position in the multidimensional . The indexes are specified as an array of 64-bit integers. - The new value for the specified element. - A one-dimensional array of 64-bit integers that represent the indexes specifying the position of the element to set. - indices is null. - The number of dimensions in the current is not equal to the number of elements in indices. - value cannot be cast to the element type of the current . - Any element in indices is outside the range of valid indexes for the corresponding dimension of the current . - - - Sets a value to the element at the specified position in the two-dimensional . The indexes are specified as 32-bit integers. - The new value for the specified element. - A 32-bit integer that represents the first-dimension index of the element to set. - A 32-bit integer that represents the second-dimension index of the element to set. - The current does not have exactly two dimensions. - value cannot be cast to the element type of the current . - Either index1 or index2 is outside the range of valid indexes for the corresponding dimension of the current . - - - Sets a value to the element at the specified position in the two-dimensional . The indexes are specified as 64-bit integers. - The new value for the specified element. - A 64-bit integer that represents the first-dimension index of the element to set. - A 64-bit integer that represents the second-dimension index of the element to set. - The current does not have exactly two dimensions. - value cannot be cast to the element type of the current . - Either index1 or index2 is outside the range of valid indexes for the corresponding dimension of the current . - - - Sets a value to the element at the specified position in the three-dimensional . The indexes are specified as 32-bit integers. - The new value for the specified element. - A 32-bit integer that represents the first-dimension index of the element to set. - A 32-bit integer that represents the second-dimension index of the element to set. - A 32-bit integer that represents the third-dimension index of the element to set. - The current does not have exactly three dimensions. - value cannot be cast to the element type of the current . - index1 or index2 or index3 is outside the range of valid indexes for the corresponding dimension of the current . - - - Sets a value to the element at the specified position in the three-dimensional . The indexes are specified as 64-bit integers. - The new value for the specified element. - A 64-bit integer that represents the first-dimension index of the element to set. - A 64-bit integer that represents the second-dimension index of the element to set. - A 64-bit integer that represents the third-dimension index of the element to set. - The current does not have exactly three dimensions. - value cannot be cast to the element type of the current . - index1 or index2 or index3 is outside the range of valid indexes for the corresponding dimension of the current . - - - Sorts the elements in a range of elements in a one-dimensional using the specified . - The one-dimensional to sort. - The starting index of the range to sort. - The number of elements in the range to sort. - The implementation to use when comparing elements. -or- null to use the implementation of each element. - array is null. - array is multidimensional. - index is less than the lower bound of array. -or- length is less than zero. - index and length do not specify a valid range in array. -or- The implementation of comparer caused an error during the sort. For example, comparer might not return 0 when comparing an item with itself. - comparer is null, and one or more elements in array do not implement the interface. - - - Sorts a range of elements in a pair of one-dimensional objects (one contains the keys and the other contains the corresponding items) based on the keys in the first using the specified . - The one-dimensional that contains the keys to sort. - The one-dimensional that contains the items that correspond to each of the keys in the keys. -or- null to sort only the keys. - The starting index of the range to sort. - The number of elements in the range to sort. - The implementation to use when comparing elements. -or- null to use the implementation of each element. - keys is null. - The keys is multidimensional. -or- The items is multidimensional. - index is less than the lower bound of keys. -or- length is less than zero. - items is not null, and the lower bound of keys does not match the lower bound of items. -or- items is not null, and the length of keys is greater than the length of items. -or- index and length do not specify a valid range in the keys. -or- items is not null, and index and length do not specify a valid range in the items. -or- The implementation of comparer caused an error during the sort. For example, comparer might not return 0 when comparing an item with itself. - comparer is null, and one or more elements in the keys do not implement the interface. - - - Sorts the elements in a range of elements in a one-dimensional using the implementation of each element of the . - The one-dimensional to sort. - The starting index of the range to sort. - The number of elements in the range to sort. - array is null. - array is multidimensional. - index is less than the lower bound of array. -or- length is less than zero. - index and length do not specify a valid range in array. - One or more elements in array do not implement the interface. - - - Sorts a range of elements in a pair of one-dimensional objects (one contains the keys and the other contains the corresponding items) based on the keys in the first using the implementation of each key. - The one-dimensional that contains the keys to sort. - The one-dimensional that contains the items that correspond to each of the keys in the keys. -or- null to sort only the keys. - The starting index of the range to sort. - The number of elements in the range to sort. - keys is null. - The keys is multidimensional. -or- The items is multidimensional. - index is less than the lower bound of keys. -or- length is less than zero. - items is not null, and the length of keys is greater than the length of items. -or- index and length do not specify a valid range in the keys. -or- items is not null, and index and length do not specify a valid range in the items. - One or more elements in the keys do not implement the interface. - - - Sorts the elements in a one-dimensional using the specified . - The one-dimensional array to sort. - The implementation to use when comparing elements. -or- null to use the implementation of each element. - array is null. - array is multidimensional. - comparer is null, and one or more elements in array do not implement the interface. - The implementation of comparer caused an error during the sort. For example, comparer might not return 0 when comparing an item with itself. - - - Sorts a pair of one-dimensional objects (one contains the keys and the other contains the corresponding items) based on the keys in the first using the specified . - The one-dimensional that contains the keys to sort. - The one-dimensional that contains the items that correspond to each of the keys in the keys. -or- null to sort only the keys. - The implementation to use when comparing elements. -or- null to use the implementation of each element. - keys is null. - The keys is multidimensional. -or- The items is multidimensional. - items is not null, and the length of keys is greater than the length of items. -or- The implementation of comparer caused an error during the sort. For example, comparer might not return 0 when comparing an item with itself. - comparer is null, and one or more elements in the keys do not implement the interface. - - - Sorts a pair of one-dimensional objects (one contains the keys and the other contains the corresponding items) based on the keys in the first using the implementation of each key. - The one-dimensional that contains the keys to sort. - The one-dimensional that contains the items that correspond to each of the keys in the keys. -or- null to sort only the keys. - keys is null. - The keys is multidimensional. -or- The items is multidimensional. - items is not null, and the length of keys is greater than the length of items. - One or more elements in the keys do not implement the interface. - - - Sorts the elements in an entire one-dimensional using the implementation of each element of the . - The one-dimensional to sort. - array is null. - array is multidimensional. - One or more elements in array do not implement the interface. - - - Sorts the elements in an entire using the generic interface implementation of each element of the . - The one-dimensional, zero-based to sort. - The type of the elements of the array. - array is null. - One or more elements in array do not implement the generic interface. - - - Sorts the elements in an using the specified generic interface. - The one-dimensional, zero-base to sort - The generic interface implementation to use when comparing elements, or null to use the generic interface implementation of each element. - The type of the elements of the array. - array is null. - comparer is null, and one or more elements in array do not implement the generic interface. - The implementation of comparer caused an error during the sort. For example, comparer might not return 0 when comparing an item with itself. - - - Sorts the elements in an using the specified . - The one-dimensional, zero-based to sort - The to use when comparing elements. - The type of the elements of the array. - array is null. -or- comparison is null. - The implementation of comparison caused an error during the sort. For example, comparison might not return 0 when comparing an item with itself. - - - Sorts the elements in a range of elements in an using the generic interface implementation of each element of the . - The one-dimensional, zero-based to sort - The starting index of the range to sort. - The number of elements in the range to sort. - The type of the elements of the array. - array is null. - index is less than the lower bound of array. -or- length is less than zero. - index and length do not specify a valid range in array. - One or more elements in array do not implement the generic interface. - - - Sorts the elements in a range of elements in an using the specified generic interface. - The one-dimensional, zero-based to sort. - The starting index of the range to sort. - The number of elements in the range to sort. - The generic interface implementation to use when comparing elements, or null to use the generic interface implementation of each element. - The type of the elements of the array. - array is null. - index is less than the lower bound of array. -or- length is less than zero. - index and length do not specify a valid range in array. -or- The implementation of comparer caused an error during the sort. For example, comparer might not return 0 when comparing an item with itself. - comparer is null, and one or more elements in array do not implement the generic interface. - - - Sorts a pair of objects (one contains the keys and the other contains the corresponding items) based on the keys in the first using the generic interface implementation of each key. - The one-dimensional, zero-based that contains the keys to sort. - The one-dimensional, zero-based that contains the items that correspond to the keys in keys, or null to sort only keys. - The type of the elements of the key array. - The type of the elements of the items array. - keys is null. - items is not null, and the lower bound of keys does not match the lower bound of items. -or- items is not null, and the length of keys is greater than the length of items. - One or more elements in the keys do not implement the generic interface. - - - Sorts a pair of objects (one contains the keys and the other contains the corresponding items) based on the keys in the first using the specified generic interface. - The one-dimensional, zero-based that contains the keys to sort. - The one-dimensional, zero-based that contains the items that correspond to the keys in keys, or null to sort only keys. - The generic interface implementation to use when comparing elements, or null to use the generic interface implementation of each element. - The type of the elements of the key array. - The type of the elements of the items array. - keys is null. - items is not null, and the lower bound of keys does not match the lower bound of items. -or- items is not null, and the length of keys is greater than the length of items. -or- The implementation of comparer caused an error during the sort. For example, comparer might not return 0 when comparing an item with itself. - comparer is null, and one or more elements in the keys do not implement the generic interface. - - - Sorts a range of elements in a pair of objects (one contains the keys and the other contains the corresponding items) based on the keys in the first using the generic interface implementation of each key. - The one-dimensional, zero-based that contains the keys to sort. - The one-dimensional, zero-based that contains the items that correspond to the keys in keys, or null to sort only keys. - The starting index of the range to sort. - The number of elements in the range to sort. - The type of the elements of the key array. - The type of the elements of the items array. - keys is null. - index is less than the lower bound of keys. -or- length is less than zero. - items is not null, and the lower bound of keys does not match the lower bound of items. -or- items is not null, and the length of keys is greater than the length of items. -or- index and length do not specify a valid range in the keys. -or- items is not null, and index and length do not specify a valid range in the items. - One or more elements in the keys do not implement the generic interface. - - - Sorts a range of elements in a pair of objects (one contains the keys and the other contains the corresponding items) based on the keys in the first using the specified generic interface. - The one-dimensional, zero-based that contains the keys to sort. - The one-dimensional, zero-based that contains the items that correspond to the keys in keys, or null to sort only keys. - The starting index of the range to sort. - The number of elements in the range to sort. - The generic interface implementation to use when comparing elements, or null to use the generic interface implementation of each element. - The type of the elements of the key array. - The type of the elements of the items array. - keys is null. - index is less than the lower bound of keys. -or- length is less than zero. - items is not null, and the lower bound of keys does not match the lower bound of items. -or- items is not null, and the length of keys is greater than the length of items. -or- index and length do not specify a valid range in the keys. -or- items is not null, and index and length do not specify a valid range in the items. -or- The implementation of comparer caused an error during the sort. For example, comparer might not return 0 when comparing an item with itself. - comparer is null, and one or more elements in the keys do not implement the generic interface. - - - Gets an object that can be used to synchronize access to the . - An object that can be used to synchronize access to the . - - - Determines whether every element in the array matches the conditions defined by the specified predicate. - The one-dimensional, zero-based to check against the conditions. - The predicate that defines the conditions to check against the elements. - The type of the elements of the array. - true if every element in array matches the conditions defined by the specified predicate; otherwise, false. If there are no elements in the array, the return value is true. - array is null. -or- match is null. - - - Gets the number of elements contained in the . - The number of elements contained in the collection. - - - Calling this method always throws a exception. - The object to be added to the . - Adding a value to an array is not supported. No value is returned. - The has a fixed size. - - - Removes all items from the . - The is read-only. - - - Determines whether an element is in the . - The object to locate in the current list. The element to locate can be null for reference types. - true if value is found in the ; otherwise, false. - - - Determines the index of a specific item in the . - The object to locate in the current list. - The index of value if found in the list; otherwise, -1. - - - Inserts an item to the at the specified index. - The index at which value should be inserted. - The object to insert. - index is not a valid index in the . - The is read-only. -or- The has a fixed size. - value is null reference in the . - - - Gets or sets the element at the specified index. - The index of the element to get or set. - The element at the specified index. - index is less than zero. -or- index is equal to or greater than . - The current does not have exactly one dimension. - - - Removes the first occurrence of a specific object from the . - The object to remove from the . - The is read-only. -or- The has a fixed size. - - - Removes the item at the specified index. - The index of the element to remove. - index is not a valid index in the . - The is read-only. -or- The has a fixed size. - - - Determines whether the current collection object precedes, occurs in the same position as, or follows another object in the sort order. - The object to compare with the current instance. - An object that compares the current object and other. -

An integer that indicates the relationship of the current collection object to other, as shown in the following table.

-
Return value

-

Description

-

-1

-

The current instance precedes other.

-

0

-

The current instance and other are equal.

-

1

-

The current instance follows other.

-

-
-
- - Determines whether an object is equal to the current instance. - The object to compare with the current instance. - An object that determines whether the current instance and other are equal. - true if the two objects are equal; otherwise, false. - - - Returns a hash code for the current instance. - An object that computes the hash code of the current object. - The hash code for the current instance. - - - Delimits a section of a one-dimensional array. - The type of the elements in the array segment. - - - Initializes a new instance of the structure that delimits all the elements in the specified array. - The array to wrap. - array is null. - - - Initializes a new instance of the structure that delimits the specified range of the elements in the specified array. - The array containing the range of elements to delimit. - The zero-based index of the first element in the range. - The number of elements in the range. - array is null. - offset or count is less than 0. - offset and count do not specify a valid range in array. - - - Gets the original array containing the range of elements that the array segment delimits. - The original array that was passed to the constructor, and that contains the range delimited by the . - - - Gets the number of elements in the range delimited by the array segment. - The number of elements in the range delimited by the . - - - Determines whether the specified structure is equal to the current instance. - The structure to compare with the current instance. - true if the specified structure is equal to the current instance; otherwise, false. - - - Determines whether the specified object is equal to the current instance. - The object to be compared with the current instance. - true if the specified object is a structure and is equal to the current instance; otherwise, false. - - - Returns the hash code for the current instance. - A 32-bit signed integer hash code. - - - Gets the position of the first element in the range delimited by the array segment, relative to the start of the original array. - The position of the first element in the range delimited by the , relative to the start of the original array. - - - Indicates whether two structures are equal. - The structure on the left side of the equality operator. - The structure on the right side of the equality operator. - true if a is equal to b; otherwise, false. - - - Indicates whether two structures are unequal. - The structure on the left side of the inequality operator. - The structure on the right side of the inequality operator. - true if a is not equal to b; otherwise, false. - - - Adds an item to the array segment. - The object to add to the array segment. - The array segment is read-only. - - - Removes all items from the array segment. - The array segment is read-only. - - - Determines whether the array segment contains a specific value. - The object to locate in the array segment. - true if item is found in the array segment; otherwise, false. - - - Copies the elements of the array segment to an array, starting at the specified array index. - The one-dimensional array that is the destination of the elements copied from the array segment. The array must have zero-based indexing. - The zero-based index in array at which copying begins. - array is null. - arrayIndex is less than 0. - array is multidimensional. -or- The number of elements in the source array segment is greater than the available space from arrayIndex to the end of the destination array. -or- Type T cannot be cast automatically to the type of the destination array. - - - Gets a value that indicates whether the array segment is read-only. - true if the array segment is read-only; otherwise, false. - - - Removes the first occurrence of a specific object from the array segment. - The object to remove from the array segment. - true if item was successfully removed from the array segment; otherwise, false. This method also returns false if item is not found in the array segment. - The array segment is read-only. - - - Returns an enumerator that iterates through the array segment. - An enumerator that can be used to iterate through the array segment. - - - Determines the index of a specific item in the array segment. - The object to locate in the array segment. - The index of item if found in the list; otherwise, -1. - - - Inserts an item into the array segment at the specified index. - The zero-based index at which item should be inserted. - The object to insert into the array segment. - index is not a valid index in the array segment. - The array segment is read-only. - - - Gets or sets the element at the specified index. - The zero-based index of the element to get or set. - The element at the specified index. - index is not a valid index in the . - The property is set and the array segment is read-only. - - - Removes the array segment item at the specified index. - The zero-based index of the item to remove. - index is not a valid index in the array segment. - The array segment is read-only. - - - Gets the element at the specified index of the array segment. - The zero-based index of the element to get. - The element at the specified index. - index is not a valid index in the . - The property is set. - - - Returns an enumerator that iterates through an array segment. - An enumerator that can be used to iterate through the array segment. - - - The exception that is thrown when an attempt is made to store an element of the wrong type within an array. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with a specified error message. - A that describes the error. - - - Initializes a new instance of the class with serialized data. - The object that holds the serialized object data. - The contextual information about the source or destination. - - - Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. - The error message that explains the reason for the exception. - The exception that is the cause of the current exception. If the innerException parameter is not a null reference, the current exception is raised in a catch block that handles the inner exception. - - - Provides data for the event. - - - Initializes a new instance of the class using the specified . - An instance that represents the currently loaded assembly. - - - Gets an that represents the currently loaded assembly. - An instance of that represents the currently loaded assembly. - - - Represents the method that handles the event of an . - The source of the event. - An that contains the event data. - - - References a method to be called when a corresponding asynchronous operation completes. - The result of the asynchronous operation. - - - Represents the base class for custom attributes. - - - Initializes a new instance of the class. - - - Returns a value that indicates whether this instance is equal to a specified object. - An to compare with this instance or null. - true if obj equals the type and value of this instance; otherwise, false. - - - Retrieves a custom attribute applied to a method parameter. Parameters specify the method parameter, the type of the custom attribute to search for, and whether to search ancestors of the method parameter. - An object derived from the class that describes a parameter of a member of a class. - The type, or a base type, of the custom attribute to search for. - If true, specifies to also search the ancestors of element for custom attributes. - A reference to the single custom attribute of type attributeType that is applied to element, or null if there is no such attribute. - element or attributeType is null. - attributeType is not derived from . - More than one of the requested attributes was found. - A custom attribute type cannot be loaded. - - - Retrieves a custom attribute applied to a member of a type. Parameters specify the member, the type of the custom attribute to search for, and whether to search ancestors of the member. - An object derived from the class that describes a constructor, event, field, method, or property member of a class. - The type, or a base type, of the custom attribute to search for. - If true, specifies to also search the ancestors of element for custom attributes. - A reference to the single custom attribute of type attributeType that is applied to element, or null if there is no such attribute. - element or attributeType is null. - attributeType is not derived from . - element is not a constructor, method, property, event, type, or field. - More than one of the requested attributes was found. - A custom attribute type cannot be loaded. - - - Retrieves a custom attribute applied to an assembly. Parameters specify the assembly, the type of the custom attribute to search for, and an ignored search option. - An object derived from the class that describes a reusable collection of modules. - The type, or a base type, of the custom attribute to search for. - This parameter is ignored, and does not affect the operation of this method. - A reference to the single custom attribute of type attributeType that is applied to element, or null if there is no such attribute. - element or attributeType is null. - attributeType is not derived from . - More than one of the requested attributes was found. - - - Retrieves a custom attribute applied to a module. Parameters specify the module, the type of the custom attribute to search for, and an ignored search option. - An object derived from the class that describes a portable executable file. - The type, or a base type, of the custom attribute to search for. - This parameter is ignored, and does not affect the operation of this method. - A reference to the single custom attribute of type attributeType that is applied to element, or null if there is no such attribute. - element or attributeType is null. - attributeType is not derived from . - More than one of the requested attributes was found. - - - Retrieves a custom attribute applied to a module. Parameters specify the module, and the type of the custom attribute to search for. - An object derived from the class that describes a portable executable file. - The type, or a base type, of the custom attribute to search for. - A reference to the single custom attribute of type attributeType that is applied to element, or null if there is no such attribute. - element or attributeType is null. - attributeType is not derived from . - More than one of the requested attributes was found. - - - Retrieves a custom attribute applied to a member of a type. Parameters specify the member, and the type of the custom attribute to search for. - An object derived from the class that describes a constructor, event, field, method, or property member of a class. - The type, or a base type, of the custom attribute to search for. - A reference to the single custom attribute of type attributeType that is applied to element, or null if there is no such attribute. - element or attributeType is null. - attributeType is not derived from . - element is not a constructor, method, property, event, type, or field. - More than one of the requested attributes was found. - A custom attribute type cannot be loaded. - - - Retrieves a custom attribute applied to a specified assembly. Parameters specify the assembly and the type of the custom attribute to search for. - An object derived from the class that describes a reusable collection of modules. - The type, or a base type, of the custom attribute to search for. - A reference to the single custom attribute of type attributeType that is applied to element, or null if there is no such attribute. - element or attributeType is null. - attributeType is not derived from . - More than one of the requested attributes was found. - - - Retrieves a custom attribute applied to a method parameter. Parameters specify the method parameter, and the type of the custom attribute to search for. - An object derived from the class that describes a parameter of a member of a class. - The type, or a base type, of the custom attribute to search for. - A reference to the single custom attribute of type attributeType that is applied to element, or null if there is no such attribute. - element or attributeType is null. - attributeType is not derived from . - More than one of the requested attributes was found. - A custom attribute type cannot be loaded. - - - Retrieves an array of the custom attributes applied to a module. Parameters specify the module, and the type of the custom attribute to search for. - An object derived from the class that describes a portable executable file. - The type, or a base type, of the custom attribute to search for. - An array that contains the custom attributes of type attributeType applied to element, or an empty array if no such custom attributes exist. - element or attributeType is null. - attributeType is not derived from . - - - Retrieves an array of the custom attributes applied to a method parameter. Parameters specify the method parameter, the type of the custom attribute to search for, and whether to search ancestors of the method parameter. - An object derived from the class that describes a parameter of a member of a class. - The type, or a base type, of the custom attribute to search for. - If true, specifies to also search the ancestors of element for custom attributes. - An array that contains the custom attributes of type attributeType applied to element, or an empty array if no such custom attributes exist. - element or attributeType is null. - attributeType is not derived from . - A custom attribute type cannot be loaded. - - - Retrieves an array of the custom attributes applied to a module. Parameters specify the module, the type of the custom attribute to search for, and an ignored search option. - An object derived from the class that describes a portable executable file. - The type, or a base type, of the custom attribute to search for. - This parameter is ignored, and does not affect the operation of this method. - An array that contains the custom attributes of type attributeType applied to element, or an empty array if no such custom attributes exist. - element or attributeType is null. - attributeType is not derived from . - - - Retrieves an array of the custom attributes applied to a member of a type. Parameters specify the member, the type of the custom attribute to search for, and whether to search ancestors of the member. - An object derived from the class that describes a constructor, event, field, method, or property member of a class. - The type, or a base type, of the custom attribute to search for. - If true, specifies to also search the ancestors of element for custom attributes. - An array that contains the custom attributes of type type applied to element, or an empty array if no such custom attributes exist. - element or type is null. - type is not derived from . - element is not a constructor, method, property, event, type, or field. - A custom attribute type cannot be loaded. - - - Retrieves an array of the custom attributes applied to an assembly. Parameters specify the assembly, the type of the custom attribute to search for, and an ignored search option. - An object derived from the class that describes a reusable collection of modules. - The type, or a base type, of the custom attribute to search for. - This parameter is ignored, and does not affect the operation of this method. - An array that contains the custom attributes of type attributeType applied to element, or an empty array if no such custom attributes exist. - element or attributeType is null. - attributeType is not derived from . - - - Retrieves an array of the custom attributes applied to a method parameter. Parameters specify the method parameter, and the type of the custom attribute to search for. - An object derived from the class that describes a parameter of a member of a class. - The type, or a base type, of the custom attribute to search for. - An array that contains the custom attributes of type attributeType applied to element, or an empty array if no such custom attributes exist. - element or attributeType is null. - attributeType is not derived from . - A custom attribute type cannot be loaded. - - - Retrieves an array of the custom attributes applied to a module. Parameters specify the module, and an ignored search option. - An object derived from the class that describes a portable executable file. - This parameter is ignored, and does not affect the operation of this method. - An array that contains the custom attributes applied to element, or an empty array if no such custom attributes exist. - element or attributeType is null. - - - Retrieves an array of the custom attributes applied to a method parameter. Parameters specify the method parameter, and whether to search ancestors of the method parameter. - An object derived from the class that describes a parameter of a member of a class. - If true, specifies to also search the ancestors of element for custom attributes. - An array that contains the custom attributes applied to element, or an empty array if no such custom attributes exist. - The property of element is `null.``` - element is null. - A custom attribute type cannot be loaded. - - - Retrieves an array of the custom attributes applied to a member of a type. Parameters specify the member, the type of the custom attribute to search for, and whether to search ancestors of the member. - An object derived from the class that describes a constructor, event, field, method, or property member of a class. - If true, specifies to also search the ancestors of element for custom attributes. - An array that contains the custom attributes applied to element, or an empty array if no such custom attributes exist. - element is null. - element is not a constructor, method, property, event, type, or field. - A custom attribute type cannot be loaded. - - - Retrieves an array of the custom attributes applied to an assembly. Parameters specify the assembly, and the type of the custom attribute to search for. - An object derived from the class that describes a reusable collection of modules. - The type, or a base type, of the custom attribute to search for. - An array that contains the custom attributes of type attributeType applied to element, or an empty array if no such custom attributes exist. - element or attributeType is null. - attributeType is not derived from . - - - Retrieves an array of the custom attributes applied to an assembly. Parameters specify the assembly, and an ignored search option. - An object derived from the class that describes a reusable collection of modules. - This parameter is ignored, and does not affect the operation of this method. - An array that contains the custom attributes applied to element, or an empty array if no such custom attributes exist. - element or attributeType is null. - - - Retrieves an array of the custom attributes applied to a method parameter. A parameter specifies the method parameter. - An object derived from the class that describes a parameter of a member of a class. - An array that contains the custom attributes applied to element, or an empty array if no such custom attributes exist. - element is null. - A custom attribute type cannot be loaded. - - - Retrieves an array of the custom attributes applied to a module. A parameter specifies the module. - An object derived from the class that describes a portable executable file. - An array that contains the custom attributes applied to element, or an empty array if no such custom attributes exist. - element is null. - - - Retrieves an array of the custom attributes applied to a member of a type. A parameter specifies the member. - An object derived from the class that describes a constructor, event, field, method, or property member of a class. - An array that contains the custom attributes applied to element, or an empty array if no such custom attributes exist. - element is null. - element is not a constructor, method, property, event, type, or field. - A custom attribute type cannot be loaded. - - - Retrieves an array of the custom attributes applied to an assembly. A parameter specifies the assembly. - An object derived from the class that describes a reusable collection of modules. - An array that contains the custom attributes applied to element, or an empty array if no such custom attributes exist. - element is null. - - - Retrieves an array of the custom attributes applied to a member of a type. Parameters specify the member, and the type of the custom attribute to search for. - An object derived from the class that describes a constructor, event, field, method, or property member of a class. - The type, or a base type, of the custom attribute to search for. - An array that contains the custom attributes of type type applied to element, or an empty array if no such custom attributes exist. - element or type is null. - type is not derived from . - element is not a constructor, method, property, event, type, or field. - A custom attribute type cannot be loaded. - - - Returns the hash code for this instance. - A 32-bit signed integer hash code. - - - When overridden in a derived class, indicates whether the value of this instance is the default value for the derived class. - true if this instance is the default attribute for the class; otherwise, false. - - - Determines whether any custom attributes are applied to a method parameter. Parameters specify the method parameter, the type of the custom attribute to search for, and whether to search ancestors of the method parameter. - An object derived from the class that describes a parameter of a member of a class. - The type, or a base type, of the custom attribute to search for. - If true, specifies to also search the ancestors of element for custom attributes. - true if a custom attribute of type attributeType is applied to element; otherwise, false. - element or attributeType is null. - attributeType is not derived from . - element is not a method, constructor, or type. - - - Determines whether any custom attributes are applied to a module. Parameters specify the module, the type of the custom attribute to search for, and an ignored search option. - An object derived from the class that describes a portable executable file. - The type, or a base type, of the custom attribute to search for. - This parameter is ignored, and does not affect the operation of this method. - true if a custom attribute of type attributeType is applied to element; otherwise, false. - element or attributeType is null. - attributeType is not derived from . - - - Determines whether any custom attributes are applied to a member of a type. Parameters specify the member, the type of the custom attribute to search for, and whether to search ancestors of the member. - An object derived from the class that describes a constructor, event, field, method, type, or property member of a class. - The type, or a base type, of the custom attribute to search for. - If true, specifies to also search the ancestors of element for custom attributes. - true if a custom attribute of type attributeType is applied to element; otherwise, false. - element or attributeType is null. - attributeType is not derived from . - element is not a constructor, method, property, event, type, or field. - - - Determines whether any custom attributes are applied to an assembly. Parameters specify the assembly, the type of the custom attribute to search for, and an ignored search option. - An object derived from the class that describes a reusable collection of modules. - The type, or a base type, of the custom attribute to search for. - This parameter is ignored, and does not affect the operation of this method. - true if a custom attribute of type attributeType is applied to element; otherwise, false. - element or attributeType is null. - attributeType is not derived from . - - - Determines whether any custom attributes are applied to a member of a type. Parameters specify the member, and the type of the custom attribute to search for. - An object derived from the class that describes a constructor, event, field, method, type, or property member of a class. - The type, or a base type, of the custom attribute to search for. - true if a custom attribute of type attributeType is applied to element; otherwise, false. - element or attributeType is null. - attributeType is not derived from . - element is not a constructor, method, property, event, type, or field. - - - Determines whether any custom attributes of a specified type are applied to a module. Parameters specify the module, and the type of the custom attribute to search for. - An object derived from the class that describes a portable executable file. - The type, or a base type, of the custom attribute to search for. - true if a custom attribute of type attributeType is applied to element; otherwise, false. - element or attributeType is null. - attributeType is not derived from . - - - Determines whether any custom attributes are applied to an assembly. Parameters specify the assembly, and the type of the custom attribute to search for. - An object derived from the class that describes a reusable collection of modules. - The type, or a base type, of the custom attribute to search for. - true if a custom attribute of type attributeType is applied to element; otherwise, false. - element or attributeType is null. - attributeType is not derived from . - - - Determines whether any custom attributes are applied to a method parameter. Parameters specify the method parameter, and the type of the custom attribute to search for. - An object derived from the class that describes a parameter of a member of a class. - The type, or a base type, of the custom attribute to search for. - true if a custom attribute of type attributeType is applied to element; otherwise, false. - element or attributeType is null. - attributeType is not derived from . - - - When overridden in a derived class, returns a value that indicates whether this instance equals a specified object. - An to compare with this instance of . - true if this instance equals obj; otherwise, false. - - - When implemented in a derived class, gets a unique identifier for this . - An that is a unique identifier for the attribute. - - - Specifies the application elements on which it is valid to apply an attribute. - - - Attribute can be applied to any application element. - - - - Attribute can be applied to an assembly. - - - - Attribute can be applied to a class. - - - - Attribute can be applied to a constructor. - - - - Attribute can be applied to a delegate. - - - - Attribute can be applied to an enumeration. - - - - Attribute can be applied to an event. - - - - Attribute can be applied to a field. - - - - Attribute can be applied to a generic parameter. - - - - Attribute can be applied to an interface. - - - - Attribute can be applied to a method. - - - - Attribute can be applied to a module. - - - - Attribute can be applied to a parameter. - - - - Attribute can be applied to a property. - - - - Attribute can be applied to a return value. - - - - Attribute can be applied to a structure; that is, a value type. - - - - Specifies the usage of another attribute class. This class cannot be inherited. - - - Initializes a new instance of the class with the specified list of , the value, and the value. - The set of values combined using a bitwise OR operation to indicate which program elements are valid. - - - Gets or sets a Boolean value indicating whether more than one instance of the indicated attribute can be specified for a single program element. - true if more than one instance is allowed to be specified; otherwise, false. The default is false. - - - Gets or sets a value that determines whether the indicated attribute is inherited by derived classes and overriding members. - true if the attribute can be inherited by derived classes and overriding members; otherwise, false. The default is true. - - - Gets a set of values identifying which program elements that the indicated attribute can be applied to. - One or several values. The default is All. - - - The exception that is thrown when the file image of a dynamic link library (DLL) or an executable program is invalid. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with a specified error message. - The message that describes the error. - - - Initializes a new instance of the class with serialized data. - The that holds the serialized object data about the exception being thrown. - The that contains contextual information about the source or destination. - - - Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. - The error message that explains the reason for the exception. - The exception that is the cause of the current exception. If the inner parameter is not a null reference, the current exception is raised in a catch block that handles the inner exception. - - - Initializes a new instance of the class with a specified error message and file name. - A message that describes the error. - The full name of the file with the invalid image. - - - Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. - The error message that explains the reason for the exception. - The full name of the file with the invalid image. - The exception that is the cause of the current exception. If the inner parameter is not null, the current exception is raised in a catch block that handles the inner exception. - - - Gets the name of the file that causes this exception. - The name of the file with the invalid image, or a null reference if no file name was passed to the constructor for the current instance. - - - Gets the log file that describes why an assembly load failed. - A String containing errors reported by the assembly cache. - - - Sets the object with the file name, assembly cache log, and additional exception information. - The that holds the serialized object data about the exception being thrown. - The that contains contextual information about the source or destination. - The caller does not have the required permission. - - - Gets the error message and the name of the file that caused this exception. - A string containing the error message and the name of the file that caused this exception. - - - Returns the fully qualified name of this exception and possibly the error message, the name of the inner exception, and the stack trace. - A string containing the fully qualified name of this exception and possibly the error message, the name of the inner exception, and the stack trace. - - - Specifies whether relevant and methods insert line breaks in their output. - - - Inserts line breaks after every 76 characters in the string representation. - - - - Does not insert line breaks after every 76 characters in the string representation. - - - - Converts base data types to an array of bytes, and an array of bytes to base data types. - - - Converts the specified double-precision floating point number to a 64-bit signed integer. - The number to convert. - A 64-bit signed integer whose value is equivalent to value. - - - Returns the specified Boolean value as a byte array. - A Boolean value. - A byte array with length 1. - - - Returns the specified Unicode character value as an array of bytes. - A character to convert. - An array of bytes with length 2. - - - Returns the specified double-precision floating point value as an array of bytes. - The number to convert. - An array of bytes with length 8. - - - Returns the specified 16-bit signed integer value as an array of bytes. - The number to convert. - An array of bytes with length 2. - - - Returns the specified 32-bit signed integer value as an array of bytes. - The number to convert. - An array of bytes with length 4. - - - Returns the specified 64-bit signed integer value as an array of bytes. - The number to convert. - An array of bytes with length 8. - - - Returns the specified single-precision floating point value as an array of bytes. - The number to convert. - An array of bytes with length 4. - - - Returns the specified 16-bit unsigned integer value as an array of bytes. - The number to convert. - An array of bytes with length 2. - - - Returns the specified 32-bit unsigned integer value as an array of bytes. - The number to convert. - An array of bytes with length 4. - - - Returns the specified 64-bit unsigned integer value as an array of bytes. - The number to convert. - An array of bytes with length 8. - - - Converts the specified 64-bit signed integer to a double-precision floating point number. - The number to convert. - A double-precision floating point number whose value is equivalent to value. - - - Indicates the byte order ("endianness") in which data is stored in this computer architecture. - - - - Returns a Boolean value converted from the byte at a specified position in a byte array. - A byte array. - The index of the byte within value. - true if the byte at startIndex in value is nonzero; otherwise, false. - value is null. - startIndex is less than zero or greater than the length of value minus 1. - - - Returns a Unicode character converted from two bytes at a specified position in a byte array. - An array. - The starting position within value. - A character formed by two bytes beginning at startIndex. - startIndex equals the length of value minus 1. - value is null. - startIndex is less than zero or greater than the length of value minus 1. - - - Returns a double-precision floating point number converted from eight bytes at a specified position in a byte array. - An array of bytes. - The starting position within value. - A double precision floating point number formed by eight bytes beginning at startIndex. - startIndex is greater than or equal to the length of value minus 7, and is less than or equal to the length of value minus 1. - value is null. - startIndex is less than zero or greater than the length of value minus 1. - - - Returns a 16-bit signed integer converted from two bytes at a specified position in a byte array. - An array of bytes. - The starting position within value. - A 16-bit signed integer formed by two bytes beginning at startIndex. - startIndex equals the length of value minus 1. - value is null. - startIndex is less than zero or greater than the length of value minus 1. - - - Returns a 32-bit signed integer converted from four bytes at a specified position in a byte array. - An array of bytes. - The starting position within value. - A 32-bit signed integer formed by four bytes beginning at startIndex. - startIndex is greater than or equal to the length of value minus 3, and is less than or equal to the length of value minus 1. - value is null. - startIndex is less than zero or greater than the length of value minus 1. - - - Returns a 64-bit signed integer converted from eight bytes at a specified position in a byte array. - An array of bytes. - The starting position within value. - A 64-bit signed integer formed by eight bytes beginning at startIndex. - startIndex is greater than or equal to the length of value minus 7, and is less than or equal to the length of value minus 1. - value is null. - startIndex is less than zero or greater than the length of value minus 1. - - - Returns a single-precision floating point number converted from four bytes at a specified position in a byte array. - An array of bytes. - The starting position within value. - A single-precision floating point number formed by four bytes beginning at startIndex. - startIndex is greater than or equal to the length of value minus 3, and is less than or equal to the length of value minus 1. - value is null. - startIndex is less than zero or greater than the length of value minus 1. - - - Converts the numeric value of each element of a specified array of bytes to its equivalent hexadecimal string representation. - An array of bytes. - A string of hexadecimal pairs separated by hyphens, where each pair represents the corresponding element in value; for example, "7F-2C-4A-00". - value is null. - - - Converts the numeric value of each element of a specified subarray of bytes to its equivalent hexadecimal string representation. - An array of bytes. - The starting position within value. - A string of hexadecimal pairs separated by hyphens, where each pair represents the corresponding element in a subarray of value; for example, "7F-2C-4A-00". - value is null. - startIndex is less than zero or greater than the length of value minus 1. - - - Converts the numeric value of each element of a specified subarray of bytes to its equivalent hexadecimal string representation. - An array of bytes. - The starting position within value. - The number of array elements in value to convert. - A string of hexadecimal pairs separated by hyphens, where each pair represents the corresponding element in a subarray of value; for example, "7F-2C-4A-00". - value is null. - startIndex or length is less than zero. -or- startIndex is greater than zero and is greater than or equal to the length of value. - The combination of startIndex and length does not specify a position within value; that is, the startIndex parameter is greater than the length of value minus the length parameter. - - - Returns a 16-bit unsigned integer converted from two bytes at a specified position in a byte array. - The array of bytes. - The starting position within value. - A 16-bit unsigned integer formed by two bytes beginning at startIndex. - startIndex equals the length of value minus 1. - value is null. - startIndex is less than zero or greater than the length of value minus 1. - - - Returns a 32-bit unsigned integer converted from four bytes at a specified position in a byte array. - An array of bytes. - The starting position within value. - A 32-bit unsigned integer formed by four bytes beginning at startIndex. - startIndex is greater than or equal to the length of value minus 3, and is less than or equal to the length of value minus 1. - value is null. - startIndex is less than zero or greater than the length of value minus 1. - - - Returns a 64-bit unsigned integer converted from eight bytes at a specified position in a byte array. - An array of bytes. - The starting position within value. - A 64-bit unsigned integer formed by the eight bytes beginning at startIndex. - startIndex is greater than or equal to the length of value minus 7, and is less than or equal to the length of value minus 1. - value is null. - startIndex is less than zero or greater than the length of value minus 1. - - - Represents a Boolean (true or false) value. - - - Compares this instance to a specified object and returns an integer that indicates their relationship to one another. - A object to compare to this instance. -

A signed integer that indicates the relative values of this instance and value.

-
Return Value

-

Condition

-

Less than zero

-

This instance is false and value is true.

-

Zero

-

This instance and value are equal (either both are true or both are false).

-

Greater than zero

-

This instance is true and value is false.

-

-
-
- - Compares this instance to a specified object and returns an integer that indicates their relationship to one another. - An object to compare to this instance, or null. -

A signed integer that indicates the relative order of this instance and obj.

-
Return Value

-

Condition

-

Less than zero

-

This instance is false and obj is true.

-

Zero

-

This instance and obj are equal (either both are true or both are false).

-

Greater than zero

-

This instance is true and obj is false.

-

-or-

-

obj is null.

-

-
- obj is not a . -
- - Returns a value indicating whether this instance is equal to a specified object. - A value to compare to this instance. - true if obj has the same value as this instance; otherwise, false. - - - Returns a value indicating whether this instance is equal to a specified object. - An object to compare to this instance. - true if obj is a and has the same value as this instance; otherwise, false. - - - Represents the Boolean value false as a string. This field is read-only. - - - - Returns the hash code for this instance. - A hash code for the current . - - - Returns the type code for the value type. - The enumerated constant . - - - Converts the specified string representation of a logical value to its equivalent. - A string containing the value to convert. - true if value is equivalent to ; false if value is equivalent to . - value is null. - value is not equivalent to or . - - - Converts the value of this instance to its equivalent string representation (either "True" or "False"). - (Reserved) An object. - if the value of this instance is true, or if the value of this instance is false. - - - Converts the value of this instance to its equivalent string representation (either "True" or "False"). - "True" (the value of the property) if the value of this instance is true, or "False" (the value of the property) if the value of this instance is false. - - - Represents the Boolean value true as a string. This field is read-only. - - - - Tries to convert the specified string representation of a logical value to its equivalent. A return value indicates whether the conversion succeeded or failed. - A string containing the value to convert. - When this method returns, if the conversion succeeded, contains true if value is equal to or false if value is equal to . If the conversion failed, contains false. The conversion fails if value is null or is not equal to the value of either the or field. - true if value was converted successfully; otherwise, false. - - - For a description of this member, see . - This parameter is ignored. - true or false. - - - For a description of this member, see . - This parameter is ignored. - 1 if the value of this instance is true; otherwise, 0. - - - This conversion is not supported. Attempting to use this method throws an . - This parameter is ignored. - This conversion is not supported. No value is returned. - You attempt to convert a value to a value. This conversion is not supported. - - - This conversion is not supported. Attempting to use this method throws an . - This parameter is ignored. - This conversion is not supported. No value is returned. - You attempt to convert a value to a value. This conversion is not supported. - - - For a description of this member, see .. - This parameter is ignored. - 1 if this instance is true; otherwise, 0. - - - For a description of this member, see .. - This parameter is ignored. - 1 if this instance is true; otherwise, 0. - - - For a description of this member, see . - This parameter is ignored. - 1 if this instance is true; otherwise, 0. - - - For a description of this member, see . - This parameter is ignored. - 1 if this instance is true; otherwise, 0. - - - For a description of this member, see . - This parameter is ignored. - 1 if this instance is true; otherwise, 0. - - - For a description of this member, see . - This parameter is ignored. - 1 if this instance is true; otherwise, 0. - - - For a description of this member, see .. - This parameter is ignored. - 1 if this instance is true; otherwise, 0. - - - For a description of this member, see . - The desired type. - An implementation that supplies culture-specific information about the format of the returned value. - An object of the specified type, with a value that is equivalent to the value of this Boolean object. - type is null. - The requested type conversion is not supported. - - - For a description of this member, see . - This parameter is ignored. - 1 if this instance is true; otherwise, 0. - - - For a description of this member, see . - This parameter is ignored. - 1 if this instance is true; otherwise, 0. - - - For a description of this member, see . - This parameter is ignored. - 1 if this instance is true; otherwise, 0. - - - Manipulates arrays of primitive types. - - - Copies a specified number of bytes from a source array starting at a particular offset to a destination array starting at a particular offset. - The source buffer. - The zero-based byte offset into src. - The destination buffer. - The zero-based byte offset into dst. - The number of bytes to copy. - src or dst is null. - src or dst is not an array of primitives. -or- The number of bytes in src is less than srcOffset plus count. -or- The number of bytes in dst is less than dstOffset plus count. - srcOffset, dstOffset, or count is less than 0. - - - Returns the number of bytes in the specified array. - An array. - The number of bytes in the array. - array is null. - array is not a primitive. - array is larger than 2 gigabytes (GB). - - - Retrieves the byte at a specified location in a specified array. - An array. - A location in the array. - Returns the index byte in the array. - array is not a primitive. - array is null. - index is negative or greater than the length of array. - array is larger than 2 gigabytes (GB). - - - Copies a number of bytes specified as a long integer value from one address in memory to another. This API is not CLS-compliant. - The address of the bytes to copy. - The target address. - The number of bytes available in the destination memory block. - The number of bytes to copy. - sourceBytesToCopy is greater than destinationSizeInBytes. - - - Copies a number of bytes specified as an unsigned long integer value from one address in memory to another. This API is not CLS-compliant. - The address of the bytes to copy. - The target address. - The number of bytes available in the destination memory block. - The number of bytes to copy. - sourceBytesToCopy is greater than destinationSizeInBytes. - - - Assigns a specified value to a byte at a particular location in a specified array. - An array. - A location in the array. - A value to assign. - array is not a primitive. - array is null. - index is negative or greater than the length of array. - array is larger than 2 gigabytes (GB). - - - Represents an 8-bit unsigned integer. - - - Compares this instance to a specified 8-bit unsigned integer and returns an indication of their relative values. - An 8-bit unsigned integer to compare. -

A signed integer that indicates the relative order of this instance and value.

-
Return Value

-

Description

-

Less than zero

-

This instance is less than value.

-

Zero

-

This instance is equal to value.

-

Greater than zero

-

This instance is greater than value.

-

-
-
- - Compares this instance to a specified object and returns an indication of their relative values. - An object to compare, or null. -

A signed integer that indicates the relative order of this instance and value.

-
Return Value

-

Description

-

Less than zero

-

This instance is less than value.

-

Zero

-

This instance is equal to value.

-

Greater than zero

-

This instance is greater than value.

-

-or-

-

value is null.

-

-
- value is not a . -
- - Returns a value indicating whether this instance and a specified object represent the same value. - An object to compare to this instance. - true if obj is equal to this instance; otherwise, false. - - - Returns a value indicating whether this instance is equal to a specified object. - An object to compare with this instance, or null. - true if obj is an instance of and equals the value of this instance; otherwise, false. - - - Returns the hash code for this instance. - A hash code for the current . - - - Returns the for value type . - The enumerated constant, . - - - Represents the largest possible value of a . This field is constant. - - - - Represents the smallest possible value of a . This field is constant. - - - - Converts the string representation of a number in a specified style and culture-specific format to its equivalent. - A string that contains a number to convert. The string is interpreted using the style specified by style. - A bitwise combination of enumeration values that indicates the style elements that can be present in s. A typical value to specify is . - An object that supplies culture-specific information about the format of s. If provider is null, the thread current culture is used. - A byte value that is equivalent to the number contained in s. - s is null. - s is not of the correct format. - s represents a number less than or greater than . -or- s includes non-zero, fractional digits. - style is not a value. -or- style is not a combination of and values. - - - Converts the string representation of a number in a specified culture-specific format to its equivalent. - A string that contains a number to convert. The string is interpreted using the style. - An object that supplies culture-specific parsing information about s. If provider is null, the thread current culture is used. - A byte value that is equivalent to the number contained in s. - s is null. - s is not of the correct format. - s represents a number less than or greater than . - - - Converts the string representation of a number to its equivalent. - A string that contains a number to convert. The string is interpreted using the style. - A byte value that is equivalent to the number contained in s. - s is null. - s is not of the correct format. - s represents a number less than or greater than . - - - Converts the string representation of a number in a specified style to its equivalent. - A string that contains a number to convert. The string is interpreted using the style specified by style. - A bitwise combination of enumeration values that indicates the style elements that can be present in s. A typical value to specify is . - A byte value that is equivalent to the number contained in s. - s is null. - s is not of the correct format. - s represents a number less than or greater than . -or- s includes non-zero, fractional digits. - style is not a value. -or- style is not a combination of and values. - - - Converts the value of the current object to its equivalent string representation. - The string representation of the value of this object, which consists of a sequence of digits that range from 0 to 9 with no leading zeroes. - - - Converts the value of the current object to its equivalent string representation using the specified format and culture-specific formatting information. - A standard or custom numeric format string. - An object that supplies culture-specific formatting information. - The string representation of the current object, formatted as specified by the format and provider parameters. - format includes an unsupported specifier. Supported format specifiers are listed in the Remarks section. - - - Converts the value of the current object to its equivalent string representation using the specified format. - A numeric format string. - The string representation of the current object, formatted as specified by the format parameter. - format includes an unsupported specifier. Supported format specifiers are listed in the Remarks section. - - - Converts the numeric value of the current object to its equivalent string representation using the specified culture-specific formatting information. - An object that supplies culture-specific formatting information. - The string representation of the value of this object in the format specified by the provider parameter. - - - Tries to convert the string representation of a number to its equivalent, and returns a value that indicates whether the conversion succeeded. - A string that contains a number to convert. The string is interpreted using the style. - When this method returns, contains the value equivalent to the number contained in s if the conversion succeeded, or zero if the conversion failed. This parameter is passed uninitialized; any value originally supplied in result will be overwritten. - true if s was converted successfully; otherwise, false. - - - Converts the string representation of a number in a specified style and culture-specific format to its equivalent. A return value indicates whether the conversion succeeded or failed. - A string containing a number to convert. The string is interpreted using the style specified by style. - A bitwise combination of enumeration values that indicates the style elements that can be present in s. A typical value to specify is . - An object that supplies culture-specific formatting information about s. If provider is null, the thread current culture is used. - When this method returns, contains the 8-bit unsigned integer value equivalent to the number contained in s if the conversion succeeded, or zero if the conversion failed. The conversion fails if the s parameter is null or , is not of the correct format, or represents a number less than or greater than . This parameter is passed uninitialized; any value originally supplied in result will be overwritten. - true if s was converted successfully; otherwise, false. - style is not a value. -or- style is not a combination of and values. - - - For a description of this member, see . - This parameter is ignored. - true if the value of the current instance is not zero; otherwise, false. - - - For a description of this member, see . - This parameter is ignored. - The value of the current instance, unchanged. - - - For a description of this member, see . - This parameter is ignored. - The value of the current instance, converted to a . - - - This conversion is not supported. Attempting to use this method throws an . - This parameter is ignored. - This conversion is not supported. No value is returned. - In all cases. - - - For a description of this member, see . - This parameter is ignored. - The value of the current instance, converted to a . - - - For a description of this member, see . - This parameter is ignored. - The value of the current instance, converted to a . - - - For a description of this member, see . - This parameter is ignored. - The value of the current instance, converted to an . - - - For a description of this member, see . - This parameter is ignored. - The value of the current instance, converted to an . - - - For a description of this member, see . - This parameter is ignored. - The value of the current instance, converted to an . - - - For a description of this member, see . - This parameter is ignored. - The value of the current instance, converted to an . - - - For a description of this member, see . - This parameter is ignored. - The value of the current instance, converted to a . - - - For a description of this member, see . - The type to which to convert this value. - An implementation that supplies information about the format of the returned value. - The value of the current instance, converted to type. - type is null. - The requested type conversion is not supported. - - - For a description of this member, see . - This parameter is ignored. - The value of the current instance, converted to a . - - - For a description of this member, see . - This parameter is ignored. - The value of the current instance, converted to a . - - - For a description of this member, see . - This parameter is ignored. - The value of the current instance, converted to a . - - - The exception that is thrown when an attempt to unload an application domain fails. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with a specified error message. - A that describes the error. - - - Initializes a new instance of the class from serialized data. - The object that holds the serialized object data. - The contextual information about the source or destination. - - - Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. - The error message that explains the reason for the exception. - The exception that is the cause of the current exception. If the innerException parameter is not a null reference (Nothing in Visual Basic), the current exception is raised in a catch block that handles the inner exception. - - - Represents a character as a UTF-16 code unit. - - - Compares this instance to a specified object and indicates whether this instance precedes, follows, or appears in the same position in the sort order as the specified object. - A object to compare. -

A signed number indicating the position of this instance in the sort order in relation to the value parameter.

-
Return Value

-

Description

-

Less than zero

-

This instance precedes value.

-

Zero

-

This instance has the same position in the sort order as value.

-

Greater than zero

-

This instance follows value.

-

-
-
- - Compares this instance to a specified object and indicates whether this instance precedes, follows, or appears in the same position in the sort order as the specified . - An object to compare this instance to, or null. -

A signed number indicating the position of this instance in the sort order in relation to the value parameter.

-
Return Value

-

Description

-

Less than zero

-

This instance precedes value.

-

Zero

-

This instance has the same position in the sort order as value.

-

Greater than zero

-

This instance follows value.

-

-or-

-

value is null.

-

-
- value is not a object. -
- - Converts the specified Unicode code point into a UTF-16 encoded string. - A 21-bit Unicode code point. - A string consisting of one object or a surrogate pair of objects equivalent to the code point specified by the utf32 parameter. - utf32 is not a valid 21-bit Unicode code point ranging from U+0 through U+10FFFF, excluding the surrogate pair range from U+D800 through U+DFFF. - - - Converts the value of a UTF-16 encoded surrogate pair into a Unicode code point. - A high surrogate code unit (that is, a code unit ranging from U+D800 through U+DBFF). - A low surrogate code unit (that is, a code unit ranging from U+DC00 through U+DFFF). - The 21-bit Unicode code point represented by the highSurrogate and lowSurrogate parameters. - highSurrogate is not in the range U+D800 through U+DBFF, or lowSurrogate is not in the range U+DC00 through U+DFFF. - - - Converts the value of a UTF-16 encoded character or surrogate pair at a specified position in a string into a Unicode code point. - A string that contains a character or surrogate pair. - The index position of the character or surrogate pair in s. - The 21-bit Unicode code point represented by the character or surrogate pair at the position in the s parameter specified by the index parameter. - s is null. - index is not a position within s. - The specified index position contains a surrogate pair, and either the first character in the pair is not a valid high surrogate or the second character in the pair is not a valid low surrogate. - - - Returns a value that indicates whether this instance is equal to the specified object. - An object to compare to this instance. - true if the obj parameter equals the value of this instance; otherwise, false. - - - Returns a value that indicates whether this instance is equal to a specified object. - An object to compare with this instance or null. - true if obj is an instance of and equals the value of this instance; otherwise, false. - - - Returns the hash code for this instance. - A 32-bit signed integer hash code. - - - Converts the numeric Unicode character at the specified position in a specified string to a double-precision floating point number. - A . - The character position in s. - The numeric value of the character at position index in s if that character represents a number; otherwise, -1. - s is null. - index is less than zero or greater than the last position in s. - - - Converts the specified numeric Unicode character to a double-precision floating point number. - The Unicode character to convert. - The numeric value of c if that character represents a number; otherwise, -1.0. - - - Returns the for value type . - The enumerated constant, . - - - Categorizes a specified Unicode character into a group identified by one of the values. - The Unicode character to categorize. - A value that identifies the group that contains c. - - - Categorizes the character at the specified position in a specified string into a group identified by one of the values. - A . - The character position in s. - A enumerated constant that identifies the group that contains the character at position index in s. - s is null. - index is less than zero or greater than the last position in s. - - - Indicates whether the specified Unicode character is categorized as a control character. - The Unicode character to evaluate. - true if c is a control character; otherwise, false. - - - Indicates whether the character at the specified position in a specified string is categorized as a control character. - A string. - The position of the character to evaluate in s. - true if the character at position index in s is a control character; otherwise, false. - s is null. - index is less than zero or greater than the last position in s. - - - Indicates whether the specified Unicode character is categorized as a decimal digit. - The Unicode character to evaluate. - true if c is a decimal digit; otherwise, false. - - - Indicates whether the character at the specified position in a specified string is categorized as a decimal digit. - A string. - The position of the character to evaluate in s. - true if the character at position index in s is a decimal digit; otherwise, false. - s is null. - index is less than zero or greater than the last position in s. - - - Indicates whether the object at the specified position in a string is a high surrogate. - A string. - The position of the character to evaluate in s. - true if the numeric value of the specified character in the s parameter ranges from U+D800 through U+DBFF; otherwise, false. - s is null. - index is not a position within s. - - - Indicates whether the specified object is a high surrogate. - The Unicode character to evaluate. - true if the numeric value of the c parameter ranges from U+D800 through U+DBFF; otherwise, false. - - - Indicates whether the specified Unicode character is categorized as a Unicode letter. - The Unicode character to evaluate. - true if c is a letter; otherwise, false. - - - Indicates whether the character at the specified position in a specified string is categorized as a Unicode letter. - A string. - The position of the character to evaluate in s. - true if the character at position index in s is a letter; otherwise, false. - s is null. - index is less than zero or greater than the last position in s. - - - Indicates whether the specified Unicode character is categorized as a letter or a decimal digit. - The Unicode character to evaluate. - true if c is a letter or a decimal digit; otherwise, false. - - - Indicates whether the character at the specified position in a specified string is categorized as a letter or a decimal digit. - A string. - The position of the character to evaluate in s. - true if the character at position index in s is a letter or a decimal digit; otherwise, false. - s is null. - index is less than zero or greater than the last position in s. - - - Indicates whether the specified Unicode character is categorized as a lowercase letter. - The Unicode character to evaluate. - true if c is a lowercase letter; otherwise, false. - - - Indicates whether the character at the specified position in a specified string is categorized as a lowercase letter. - A string. - The position of the character to evaluate in s. - true if the character at position index in s is a lowercase letter; otherwise, false. - s is null. - index is less than zero or greater than the last position in s. - - - Indicates whether the specified object is a low surrogate. - The character to evaluate. - true if the numeric value of the c parameter ranges from U+DC00 through U+DFFF; otherwise, false. - - - Indicates whether the object at the specified position in a string is a low surrogate. - A string. - The position of the character to evaluate in s. - true if the numeric value of the specified character in the s parameter ranges from U+DC00 through U+DFFF; otherwise, false. - s is null. - index is not a position within s. - - - Indicates whether the specified Unicode character is categorized as a number. - The Unicode character to evaluate. - true if c is a number; otherwise, false. - - - Indicates whether the character at the specified position in a specified string is categorized as a number. - A string. - The position of the character to evaluate in s. - true if the character at position index in s is a number; otherwise, false. - s is null. - index is less than zero or greater than the last position in s. - - - Indicates whether the specified Unicode character is categorized as a punctuation mark. - The Unicode character to evaluate. - true if c is a punctuation mark; otherwise, false. - - - Indicates whether the character at the specified position in a specified string is categorized as a punctuation mark. - A string. - The position of the character to evaluate in s. - true if the character at position index in s is a punctuation mark; otherwise, false. - s is null. - index is less than zero or greater than the last position in s. - - - Indicates whether the specified Unicode character is categorized as a separator character. - The Unicode character to evaluate. - true if c is a separator character; otherwise, false. - - - Indicates whether the character at the specified position in a specified string is categorized as a separator character. - A string. - The position of the character to evaluate in s. - true if the character at position index in s is a separator character; otherwise, false. - s is null. - index is less than zero or greater than the last position in s. - - - Indicates whether the specified character has a surrogate code unit. - The Unicode character to evaluate. - true if c is either a high surrogate or a low surrogate; otherwise, false. - - - Indicates whether the character at the specified position in a specified string has a surrogate code unit. - A string. - The position of the character to evaluate in s. - true if the character at position index in s is a either a high surrogate or a low surrogate; otherwise, false. - s is null. - index is less than zero or greater than the last position in s. - - - Indicates whether two adjacent objects at a specified position in a string form a surrogate pair. - A string. - The starting position of the pair of characters to evaluate within s. - true if the s parameter includes adjacent characters at positions index and index + 1, and the numeric value of the character at position index ranges from U+D800 through U+DBFF, and the numeric value of the character at position index+1 ranges from U+DC00 through U+DFFF; otherwise, false. - s is null. - index is not a position within s. - - - Indicates whether the two specified objects form a surrogate pair. - The character to evaluate as the high surrogate of a surrogate pair. - The character to evaluate as the low surrogate of a surrogate pair. - true if the numeric value of the highSurrogate parameter ranges from U+D800 through U+DBFF, and the numeric value of the lowSurrogate parameter ranges from U+DC00 through U+DFFF; otherwise, false. - - - Indicates whether the specified Unicode character is categorized as a symbol character. - The Unicode character to evaluate. - true if c is a symbol character; otherwise, false. - - - Indicates whether the character at the specified position in a specified string is categorized as a symbol character. - A string. - The position of the character to evaluate in s. - true if the character at position index in s is a symbol character; otherwise, false. - s is null. - index is less than zero or greater than the last position in s. - - - Indicates whether the specified Unicode character is categorized as an uppercase letter. - The Unicode character to evaluate. - true if c is an uppercase letter; otherwise, false. - - - Indicates whether the character at the specified position in a specified string is categorized as an uppercase letter. - A string. - The position of the character to evaluate in s. - true if the character at position index in s is an uppercase letter; otherwise, false. - s is null. - index is less than zero or greater than the last position in s. - - - Indicates whether the specified Unicode character is categorized as white space. - The Unicode character to evaluate. - true if c is white space; otherwise, false. - - - Indicates whether the character at the specified position in a specified string is categorized as white space. - A string. - The position of the character to evaluate in s. - true if the character at position index in s is white space; otherwise, false. - s is null. - index is less than zero or greater than the last position in s. - - - Represents the largest possible value of a . This field is constant. - - - - Represents the smallest possible value of a . This field is constant. - - - - Converts the value of the specified string to its equivalent Unicode character. - A string that contains a single character, or null. - A Unicode character equivalent to the sole character in s. - s is null. - The length of s is not 1. - - - Converts the value of a specified Unicode character to its lowercase equivalent using specified culture-specific formatting information. - The Unicode character to convert. - An object that supplies culture-specific casing rules. - The lowercase equivalent of c, modified according to culture, or the unchanged value of c, if c is already lowercase or not alphabetic. - culture is null. - - - Converts the value of a Unicode character to its lowercase equivalent. - The Unicode character to convert. - The lowercase equivalent of c, or the unchanged value of c, if c is already lowercase or not alphabetic. - - - Converts the value of a Unicode character to its lowercase equivalent using the casing rules of the invariant culture. - The Unicode character to convert. - The lowercase equivalent of the c parameter, or the unchanged value of c, if c is already lowercase or not alphabetic. - - - Converts the value of this instance to its equivalent string representation using the specified culture-specific format information. - (Reserved) An object that supplies culture-specific formatting information. - The string representation of the value of this instance as specified by provider. - - - Converts the specified Unicode character to its equivalent string representation. - The Unicode character to convert. - The string representation of the value of c. - - - Converts the value of this instance to its equivalent string representation. - The string representation of the value of this instance. - - - Converts the value of a specified Unicode character to its uppercase equivalent using specified culture-specific formatting information. - The Unicode character to convert. - An object that supplies culture-specific casing rules. - The uppercase equivalent of c, modified according to culture, or the unchanged value of c if c is already uppercase, has no uppercase equivalent, or is not alphabetic. - culture is null. - - - Converts the value of a Unicode character to its uppercase equivalent. - The Unicode character to convert. - The uppercase equivalent of c, or the unchanged value of c if c is already uppercase, has no uppercase equivalent, or is not alphabetic. - - - Converts the value of a Unicode character to its uppercase equivalent using the casing rules of the invariant culture. - The Unicode character to convert. - The uppercase equivalent of the c parameter, or the unchanged value of c, if c is already uppercase or not alphabetic. - - - Converts the value of the specified string to its equivalent Unicode character. A return code indicates whether the conversion succeeded or failed. - A string that contains a single character, or null. - When this method returns, contains a Unicode character equivalent to the sole character in s, if the conversion succeeded, or an undefined value if the conversion failed. The conversion fails if the s parameter is null or the length of s is not 1. This parameter is passed uninitialized. - true if the s parameter was converted successfully; otherwise, false. - - - Note This conversion is not supported. Attempting to do so throws an . - This parameter is ignored. - This conversion is not supported. No value is returned. - This conversion is not supported. - - - For a description of this member, see . - This parameter is ignored. - The converted value of the current object. - - - For a description of this member, see . - This parameter is ignored. - The value of the current object unchanged. - - - Note This conversion is not supported. Attempting to do so throws an . - This parameter is ignored. - No value is returned. - This conversion is not supported. - - - Note This conversion is not supported. Attempting to do so throws an . - This parameter is ignored. - No value is returned. - This conversion is not supported. - - - Note This conversion is not supported. Attempting to do so throws an . - This parameter is ignored. - No value is returned. - This conversion is not supported. - - - For a description of this member, see . - This parameter is ignored. - The converted value of the current object. - - - For a description of this member, see . - This parameter is ignored. - The converted value of the current object. - - - For a description of this member, see . - This parameter is ignored. - The converted value of the current object. - - - For a description of this member, see . - This parameter is ignored. - The converted value of the current object. - - - Note This conversion is not supported. Attempting to do so throws an . - This parameter is ignored. - No value is returned. - This conversion is not supported. - - - For a description of this member, see . - A object. - An object. - An object of the specified type. - type is null. - The value of the current object cannot be converted to the type specified by the type parameter. - - - For a description of this member, see . - An object. (Specify null because the provider parameter is ignored.) - The converted value of the current object. - - - For a description of this member, see . - An object. (Specify null because the provider parameter is ignored.) - The converted value of the current object. - - - For a description of this member, see . - An object. (Specify null because the provider parameter is ignored.) - The converted value of the current object. - - - Creates collections that ignore the case in strings. - - - Initializes a new instance of the class. - - - Creates a new case-insensitive instance of the class with the default initial capacity. - A new case-insensitive instance of the class with the default initial capacity. - - - Copies the entries from the specified dictionary to a new case-insensitive instance of the class with the same initial capacity as the number of entries copied. - The to copy to a new case-insensitive . - A new case-insensitive instance of the class containing the entries from the specified . - d is null. - - - Creates a new case-insensitive instance of the class with the specified initial capacity. - The approximate number of entries that the can initially contain. - A new case-insensitive instance of the class with the specified initial capacity. - capacity is less than zero. - - - Creates a new instance of the class that ignores the case of strings. - A new instance of the class that ignores the case of strings. - - - Implements IDictionary by using a while the collection is small, and then switching to a when the collection gets large. - - - Creates an empty case-sensitive . - - - Creates an empty with the specified case sensitivity. - A Boolean that denotes whether the is case-insensitive. - - - Creates a case-sensitive with the specified initial size. - The approximate number of entries that the can initially contain. - - - Creates a with the specified initial size and case sensitivity. - The approximate number of entries that the can initially contain. - A Boolean that denotes whether the is case-insensitive. - - - Adds an entry with the specified key and value into the . - The key of the entry to add. - The value of the entry to add. The value can be null. - key is null. - An entry with the same key already exists in the . - - - Removes all entries from the . - - - Determines whether the contains a specific key. - The key to locate in the . - true if the contains an entry with the specified key; otherwise, false. - key is null. - - - Copies the entries to a one-dimensional instance at the specified index. - The one-dimensional that is the destination of the objects copied from . The must have zero-based indexing. - The zero-based index in array at which copying begins. - array is null. - index is less than zero. - array is multidimensional. -or- The number of elements in the source is greater than the available space from arrayIndex to the end of the destination array. - The type of the source cannot be cast automatically to the type of the destination array. - - - Gets the number of key/value pairs contained in the . - The number of key/value pairs contained in the . Retrieving the value of this property is an O(1) operation. - - - Returns an that iterates through the . - An for the . - - - Gets a value indicating whether the has a fixed size. - This property always returns false. - - - Gets a value indicating whether the is read-only. - This property always returns false. - - - Gets a value indicating whether the is synchronized (thread safe). - This property always returns false. - - - Gets or sets the value associated with the specified key. - The key whose value to get or set. - The value associated with the specified key. If the specified key is not found, attempting to get it returns null, and attempting to set it creates a new entry using the specified key. - key is null. - - - Gets an containing the keys in the . - An containing the keys in the . - - - Removes the entry with the specified key from the . - The key of the entry to remove. - key is null. - - - Gets an object that can be used to synchronize access to the . - An object that can be used to synchronize access to the . - - - Gets an containing the values in the . - An containing the values in the . - - - Returns an that iterates through the . - An for the . - - - Notifies listeners of dynamic changes, such as when an item is added and removed or the whole list is cleared. - - - Occurs when the collection changes. - - - - Represents an indexed collection of key/value pairs. - - - Returns an enumerator that iterates through the collection. - An for the entire collection. - - - Inserts a key/value pair into the collection at the specified index. - The zero-based index at which the key/value pair should be inserted. - The object to use as the key of the element to add. - The object to use as the value of the element to add. The value can be null. - index is less than 0. -or- index is greater than . - key is null. - An element with the same key already exists in the collection. - The collection is read-only. -or- The collection has a fixed size. - - - Gets or sets the element at the specified index. - The zero-based index of the element to get or set. - The element at the specified index. - index is less than 0. -or- index is equal to or greater than . - - - Removes the element at the specified index. - The zero-based index of the element to remove. - index is less than 0. -or- index is equal to or greater than . - The collection is read-only. -or- The collection has a fixed size. - - - Implements IDictionary using a singly linked list. Recommended for collections that typically include fewer than 10 items. - - - Creates an empty using the default comparer. - - - Creates an empty using the specified comparer. - The to use to determine whether two keys are equal. -or- null to use the default comparer, which is each key's implementation of . - - - Adds an entry with the specified key and value into the . - The key of the entry to add. - The value of the entry to add. The value can be null. - key is null. - An entry with the same key already exists in the . - - - Removes all entries from the . - - - Determines whether the contains a specific key. - The key to locate in the . - true if the contains an entry with the specified key; otherwise, false. - key is null. - - - Copies the entries to a one-dimensional instance at the specified index. - The one-dimensional that is the destination of the objects copied from . The must have zero-based indexing. - The zero-based index in array at which copying begins. - array is null. - index is less than zero. - array is multidimensional. -or- The number of elements in the source is greater than the available space from index to the end of the destination array. - The type of the source cannot be cast automatically to the type of the destination array. - - - Gets the number of key/value pairs contained in the . - The number of key/value pairs contained in the . - - - Returns an that iterates through the . - An for the . - - - Gets a value indicating whether the has a fixed size. - This property always returns false. - - - Gets a value indicating whether the is read-only. - This property always returns false. - - - Gets a value indicating whether the is synchronized (thread safe). - This property always returns false. - - - Gets or sets the value associated with the specified key. - The key whose value to get or set. - The value associated with the specified key. If the specified key is not found, attempting to get it returns null, and attempting to set it creates a new entry using the specified key. - key is null. - - - Gets an containing the keys in the . - An containing the keys in the . - - - Removes the entry with the specified key from the . - The key of the entry to remove. - key is null. - - - Gets an object that can be used to synchronize access to the . - An object that can be used to synchronize access to the . - - - Gets an containing the values in the . - An containing the values in the . - - - Returns an that iterates through the . - An for the . - - - Represents a collection of the keys of a collection. - - - Gets the number of keys in the . - The number of keys in the . - - - Gets the key at the specified index of the collection. - The zero-based index of the key to get from the collection. - A that contains the key at the specified index of the collection. - index is outside the valid range of indexes for the collection. - - - Returns an enumerator that iterates through the . - An for the . - - - Gets the entry at the specified index of the collection. - The zero-based index of the entry to locate in the collection. - The key of the entry at the specified index of the collection. - index is outside the valid range of indexes for the collection. - - - Copies the entire to a compatible one-dimensional , starting at the specified index of the target array. - The one-dimensional that is the destination of the elements copied from . The must have zero-based indexing. - The zero-based index in array at which copying begins. - array is null. - index is less than zero. - array is multidimensional. -or- The number of elements in the source is greater than the available space from index to the end of the destination array. - The type of the source cannot be cast automatically to the type of the destination array. - - - Gets a value indicating whether access to the is synchronized (thread safe). - true if access to the is synchronized (thread safe); otherwise, false. The default is false. - - - Gets an object that can be used to synchronize access to the . - An object that can be used to synchronize access to the . - - - Provides the abstract base class for a collection of associated keys and values that can be accessed either with the key or with the index. - - - Initializes a new instance of the class that is empty. - - - Initializes a new instance of the class that is empty, has the default initial capacity, and uses the specified object. - The object to use to determine whether two keys are equal and to generate hash codes for the keys in the collection. - - - Initializes a new instance of the class that is empty, has the specified initial capacity, and uses the default hash code provider and the default comparer. - The approximate number of entries that the instance can initially contain. - capacity is less than zero. - - - Initializes a new instance of the class that is empty, has the default initial capacity, and uses the specified hash code provider and the specified comparer. - The that will supply the hash codes for all keys in the instance. - The to use to determine whether two keys are equal. - - - Initializes a new instance of the class that is empty, has the specified initial capacity, and uses the specified object. - The approximate number of entries that the object can initially contain. - The object to use to determine whether two keys are equal and to generate hash codes for the keys in the collection. - capacity is less than zero. - - - Initializes a new instance of the class that is serializable and uses the specified and . - A object that contains the information required to serialize the new instance. - A object that contains the source and destination of the serialized stream associated with the new instance. - - - Initializes a new instance of the class that is empty, has the specified initial capacity and uses the specified hash code provider and the specified comparer. - The approximate number of entries that the instance can initially contain. - The that will supply the hash codes for all keys in the instance. - The to use to determine whether two keys are equal. - capacity is less than zero. - - - Adds an entry with the specified key and value into the instance. - The key of the entry to add. The key can be null. - The value of the entry to add. The value can be null. - The collection is read-only. - - - Removes all entries from the instance. - The collection is read-only. - - - Gets the value of the entry at the specified index of the instance. - The zero-based index of the value to get. - An that represents the value of the entry at the specified index. - index is outside the valid range of indexes for the collection. - - - Gets the value of the first entry with the specified key from the instance. - The key of the entry to get. The key can be null. - An that represents the value of the first entry with the specified key, if found; otherwise, null. - - - Returns a array that contains all the keys in the instance. - A array that contains all the keys in the instance. - - - Returns an array that contains all the values in the instance. - An array that contains all the values in the instance. - - - Returns an array of the specified type that contains all the values in the instance. - A that represents the type of array to return. - An array of the specified type that contains all the values in the instance. - type is null. - type is not a valid . - - - Gets the key of the entry at the specified index of the instance. - The zero-based index of the key to get. - A that represents the key of the entry at the specified index. - index is outside the valid range of indexes for the collection. - - - Gets a value indicating whether the instance contains entries whose keys are not null. - true if the instance contains entries whose keys are not null; otherwise, false. - - - Removes the entries with the specified key from the instance. - The key of the entries to remove. The key can be null. - The collection is read-only. - - - Removes the entry at the specified index of the instance. - The zero-based index of the entry to remove. - index is outside the valid range of indexes for the collection. - The collection is read-only. - - - Sets the value of the entry at the specified index of the instance. - The zero-based index of the entry to set. - The that represents the new value of the entry to set. The value can be null. - The collection is read-only. - index is outside the valid range of indexes for the collection. - - - Sets the value of the first entry with the specified key in the instance, if found; otherwise, adds an entry with the specified key and value into the instance. - The key of the entry to set. The key can be null. - The that represents the new value of the entry to set. The value can be null. - The collection is read-only. - - - Gets the number of key/value pairs contained in the instance. - The number of key/value pairs contained in the instance. - - - Returns an enumerator that iterates through the . - An for the instance. - - - Implements the interface and returns the data needed to serialize the instance. - A object that contains the information required to serialize the instance. - A object that contains the source and destination of the serialized stream associated with the instance. - info is null. - - - Gets or sets a value indicating whether the instance is read-only. - true if the instance is read-only; otherwise, false. - - - Gets a instance that contains all the keys in the instance. - A instance that contains all the keys in the instance. - - - Implements the interface and raises the deserialization event when the deserialization is complete. - The source of the deserialization event. - The object associated with the current instance is invalid. - - - Copies the entire to a compatible one-dimensional , starting at the specified index of the target array. - The one-dimensional that is the destination of the elements copied from . The must have zero-based indexing. - The zero-based index in array at which copying begins. - array is null. - index is less than zero. - array is multidimensional. -or- The number of elements in the source is greater than the available space from index to the end of the destination array. - The type of the source cannot be cast automatically to the type of the destination array. - - - Gets a value indicating whether access to the object is synchronized (thread safe). - true if access to the object is synchronized (thread safe); otherwise, false. The default is false. - - - Gets an object that can be used to synchronize access to the object. - An object that can be used to synchronize access to the object. - - - Represents a collection of associated keys and values that can be accessed either with the key or with the index. - - - Initializes a new instance of the class that is empty, has the default initial capacity and uses the default case-insensitive hash code provider and the default case-insensitive comparer. - - - Initializes a new instance of the class that is empty, has the default initial capacity, and uses the specified object. - The object to use to determine whether two keys are equal and to generate hash codes for the keys in the collection. - - - Copies the entries from the specified to a new with the same initial capacity as the number of entries copied and using the same hash code provider and the same comparer as the source collection. - The to copy to the new instance. - col is null. - - - Initializes a new instance of the class that is empty, has the specified initial capacity and uses the default case-insensitive hash code provider and the default case-insensitive comparer. - The initial number of entries that the can contain. - capacity is less than zero. - - - Initializes a new instance of the class that is empty, has the default initial capacity and uses the specified hash code provider and the specified comparer. - The that will supply the hash codes for all keys in the . - The to use to determine whether two keys are equal. - - - Initializes a new instance of the class that is empty, has the specified initial capacity, and uses the specified object. - The initial number of entries that the object can contain. - The object to use to determine whether two keys are equal and to generate hash codes for the keys in the collection. - capacity is less than zero. - - - Copies the entries from the specified to a new with the specified initial capacity or the same initial capacity as the number of entries copied, whichever is greater, and using the default case-insensitive hash code provider and the default case-insensitive comparer. - The initial number of entries that the can contain. - The to copy to the new instance. - capacity is less than zero. - col is null. - - - Initializes a new instance of the class that is serializable and uses the specified and . - A object that contains the information required to serialize the new instance. - A object that contains the source and destination of the serialized stream associated with the new instance. - - - Initializes a new instance of the class that is empty, has the specified initial capacity and uses the specified hash code provider and the specified comparer. - The initial number of entries that the can contain. - The that will supply the hash codes for all keys in the . - The to use to determine whether two keys are equal. - capacity is less than zero. - - - Copies the entries in the specified to the current . - The to copy to the current . - The collection is read-only. - c is null. - - - Adds an entry with the specified name and value to the . - The key of the entry to add. The key can be null. - The value of the entry to add. The value can be null. - The collection is read-only. - - - Gets all the keys in the . - A array that contains all the keys of the . - - - Invalidates the cached arrays and removes all entries from the . - The collection is read-only. - - - Copies the entire to a compatible one-dimensional , starting at the specified index of the target array. - The one-dimensional that is the destination of the elements copied from . The must have zero-based indexing. - The zero-based index in dest at which copying begins. - dest is null. - index is less than zero. - dest is multidimensional. -or- The number of elements in the source is greater than the available space from index to the end of the destination dest. - The type of the source cannot be cast automatically to the type of the destination dest. - - - Gets the values at the specified index of the combined into one comma-separated list. - The zero-based index of the entry that contains the values to get from the collection. - A that contains a comma-separated list of the values at the specified index of the , if found; otherwise, null. - index is outside the valid range of indexes for the collection. - - - Gets the values associated with the specified key from the combined into one comma-separated list. - The key of the entry that contains the values to get. The key can be null. - A that contains a comma-separated list of the values associated with the specified key from the , if found; otherwise, null. - - - Gets the key at the specified index of the . - The zero-based index of the key to get from the collection. - A that contains the key at the specified index of the , if found; otherwise, null. - index is outside the valid range of indexes for the collection. - - - Gets the values at the specified index of the . - The zero-based index of the entry that contains the values to get from the collection. - A array that contains the values at the specified index of the , if found; otherwise, null. - index is outside the valid range of indexes for the collection. - - - Gets the values associated with the specified key from the . - The key of the entry that contains the values to get. The key can be null. - A array that contains the values associated with the specified key from the , if found; otherwise, null. - - - Gets a value indicating whether the contains keys that are not null. - true if the contains keys that are not null; otherwise, false. - - - Resets the cached arrays of the collection to null. - - - Gets the entry at the specified index of the . - The zero-based index of the entry to locate in the collection. - A that contains the comma-separated list of values at the specified index of the collection. - index is outside the valid range of indexes for the collection. - - - Gets or sets the entry with the specified key in the . - The key of the entry to locate. The key can be null. - A that contains the comma-separated list of values associated with the specified key, if found; otherwise, null. - The collection is read-only and the operation attempts to modify the collection. - - - Removes the entries with the specified key from the instance. - The key of the entry to remove. The key can be null. - The collection is read-only. - - - Sets the value of an entry in the . - The key of the entry to add the new value to. The key can be null. - The that represents the new value to add to the specified entry. The value can be null. - The collection is read-only. - - - Describes the action that caused a event. - - - An item was added to the collection. - - - - An item was moved within the collection. - - - - An item was removed from the collection. - - - - An item was replaced in the collection. - - - - The content of the collection was cleared. - - - - Provides data for the event. - - - Initializes a new instance of the class that describes a change. - The action that caused the event. This must be set to . - - - Initializes a new instance of the class that describes a multi-item change. - The action that caused the event. This can be set to , , or . - The items that are affected by the change. - - - Initializes a new instance of the class that describes a one-item change. - The action that caused the event. This can be set to , , or . - The item that is affected by the change. - If action is not Reset, Add, or Remove, or if action is Reset and changedItem is not null. - - - Initializes a new instance of the class that describes a multi-item change. - The action that caused the event. This can only be set to . - The new items that are replacing the original items. - The original items that are replaced. - If action is not Replace. - If oldItems or newItems is null. - - - Initializes a new instance of the class that describes a multi-item change or a change. - The action that caused the event. This can be set to , , or . - The items affected by the change. - The index where the change occurred. - If action is not Reset, Add, or Remove, if action is Reset and either changedItems is not null or startingIndex is not -1, or if action is Add or Remove and startingIndex is less than -1. - If action is Add or Remove and changedItems is null. - - - Initializes a new instance of the class that describes a one-item change. - The action that caused the event. This can be set to , , or . - The item that is affected by the change. - The index where the change occurred. - If action is not Reset, Add, or Remove, or if action is Reset and either changedItems is not null or index is not -1. - - - Initializes a new instance of the class that describes a one-item change. - The action that caused the event. This can only be set to . - The new item that is replacing the original item. - The original item that is replaced. - If action is not Replace. - - - Initializes a new instance of the class that describes a multi-item change. - The action that caused the event. This can only be set to . - The new items that are replacing the original items. - The original items that are replaced. - The index of the first item of the items that are being replaced. - If action is not Replace. - If oldItems or newItems is null. - - - Initializes a new instance of the class that describes a multi-item change. - The action that caused the event. This can only be set to . - The items affected by the change. - The new index for the changed items. - The old index for the changed items. - If action is not Move or index is less than 0. - - - Initializes a new instance of the class that describes a one-item change. - The action that caused the event. This can only be set to . - The item affected by the change. - The new index for the changed item. - The old index for the changed item. - If action is not Move or index is less than 0. - - - Initializes a new instance of the class that describes a one-item change. - The action that caused the event. This can be set to . - The new item that is replacing the original item. - The original item that is replaced. - The index of the item being replaced. - If action is not Replace. - - - Gets the action that caused the event. - A value that describes the action that caused the event. - - - Gets the list of new items involved in the change. - The list of new items involved in the change. - - - Gets the index at which the change occurred. - The zero-based index at which the change occurred. - - - Gets the list of items affected by a , Remove, or Move action. - The list of items affected by a , Remove, or Move action. - - - Gets the index at which a , Remove, or Replace action occurred. - The zero-based index at which a , Remove, or Replace action occurred. - - - Represents the method that handles the event. - The object that raised the event. - Information about the event. - - - Represents a collection of key/value pairs that are accessible by the key or index. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class using the specified comparer. - The to use to determine whether two keys are equal. -or- null to use the default comparer, which is each key's implementation of . - - - Initializes a new instance of the class using the specified initial capacity. - The initial number of elements that the collection can contain. - - - Initializes a new instance of the class using the specified initial capacity and comparer. - The initial number of elements that the collection can contain. - The to use to determine whether two keys are equal. -or- null to use the default comparer, which is each key's implementation of . - - - Initializes a new instance of the class that is serializable using the specified and objects. - A object containing the information required to serialize the collection. - A object containing the source and destination of the serialized stream associated with the . - - - Adds an entry with the specified key and value into the collection with the lowest available index. - The key of the entry to add. - The value of the entry to add. This value can be null. - The collection is read-only. - - - Returns a read-only copy of the current collection. - A read-only copy of the current collection. - - - Removes all elements from the collection. - The collection is read-only. - - - Determines whether the collection contains a specific key. - The key to locate in the collection. - true if the collection contains an element with the specified key; otherwise, false. - - - Copies the elements to a one-dimensional object at the specified index. - The one-dimensional object that is the destination of the objects copied from collection. The must have zero-based indexing. - The zero-based index in array at which copying begins. - - - Gets the number of key/values pairs contained in the collection. - The number of key/value pairs contained in the collection. - - - Returns an object that iterates through the collection. - An object for the collection. - - - Implements the interface and returns the data needed to serialize the collection. - A object containing the information required to serialize the collection. - A object containing the source and destination of the serialized stream associated with the . - info is null. - - - Inserts a new entry into the collection with the specified key and value at the specified index. - The zero-based index at which the element should be inserted. - The key of the entry to add. - The value of the entry to add. The value can be null. - index is out of range. - This collection is read-only. - - - Gets a value indicating whether the collection is read-only. - true if the collection is read-only; otherwise, false. The default is false. - - - Gets or sets the value at the specified index. - The zero-based index of the value to get or set. - The value of the item at the specified index. - The property is being set and the collection is read-only. - index is less than zero. -or- index is equal to or greater than . - - - Gets or sets the value with the specified key. - The key of the value to get or set. - The value associated with the specified key. If the specified key is not found, attempting to get it returns null, and attempting to set it creates a new element using the specified key. - The property is being set and the collection is read-only. - - - Gets an object containing the keys in the collection. - An object containing the keys in the collection. - - - Implements the interface and is called back by the deserialization event when deserialization is complete. - The source of the deserialization event. - The object associated with the current collection is invalid. - - - Removes the entry with the specified key from the collection. - The key of the entry to remove. - The collection is read-only. - key is null. - - - Removes the entry at the specified index from the collection. - The zero-based index of the entry to remove. - The collection is read-only. - index is less than zero. - or - index is equal to or greater than . - - - Gets an object containing the values in the collection. - An object containing the values in the collection. - - - Gets a value indicating whether access to the object is synchronized (thread-safe). - This method always returns false. - - - Gets an object that can be used to synchronize access to the object. - An object that can be used to synchronize access to the object. - - - Gets a value indicating whether the has a fixed size. - true if the has a fixed size; otherwise, false. The default is false. - - - Returns an object that iterates through the collection. - An object for the collection. - - - Implements the interface and is called back by the deserialization event when deserialization is complete. - The source of the deserialization event. - - - Represents a collection of strings. - - - Initializes a new instance of the class. - - - Adds a string to the end of the . - The string to add to the end of the . The value can be null. - The zero-based index at which the new element is inserted. - - - Copies the elements of a string array to the end of the . - An array of strings to add to the end of the . The array itself can not be null but it can contain elements that are null. - value is null. - - - Removes all the strings from the . - - - Determines whether the specified string is in the . - The string to locate in the . The value can be null. - true if value is found in the ; otherwise, false. - - - Copies the entire values to a one-dimensional array of strings, starting at the specified index of the target array. - The one-dimensional array of strings that is the destination of the elements copied from . The must have zero-based indexing. - The zero-based index in array at which copying begins. - array is null. - index is less than zero. - array is multidimensional. -or- The number of elements in the source is greater than the available space from index to the end of the destination array. - The type of the source cannot be cast automatically to the type of the destination array. - - - Gets the number of strings contained in the . - The number of strings contained in the . - - - Returns a that iterates through the . - A for the . - - - Searches for the specified string and returns the zero-based index of the first occurrence within the . - The string to locate. The value can be null. - The zero-based index of the first occurrence of value in the , if found; otherwise, -1. - - - Inserts a string into the at the specified index. - The zero-based index at which value is inserted. - The string to insert. The value can be null. - index is less than zero. -or- index greater than . - - - Gets a value indicating whether the is read-only. - This property always returns false. - - - Gets a value indicating whether access to the is synchronized (thread safe). - This property always returns false. - - - Gets or sets the element at the specified index. - The zero-based index of the entry to get or set. - The element at the specified index. - index is less than zero. -or- index is equal to or greater than . - - - Removes the first occurrence of a specific string from the . - The string to remove from the . The value can be null. - - - Removes the string at the specified index of the . - The zero-based index of the string to remove. - index is less than zero. -or- index is equal to or greater than . - - - Gets an object that can be used to synchronize access to the . - An object that can be used to synchronize access to the . - - - Copies the entire to a compatible one-dimensional , starting at the specified index of the target array. - The one-dimensional that is the destination of the elements copied from . The must have zero-based indexing. - The zero-based index in array at which copying begins. - array is null. - index is less than zero. - array is multidimensional. -or- The number of elements in the source is greater than the available space from index to the end of the destination array. - The type of the source cannot be cast automatically to the type of the destination array. - - - Returns a that iterates through the . - A for the . - - - Adds an object to the end of the . - The to be added to the end of the . The value can be null. - The index at which the value has been added. - The is read-only. -or- The has a fixed size. - - - Determines whether an element is in the . - The to locate in the . The value can be null. - true if value is found in the ; otherwise, false. - - - Searches for the specified and returns the zero-based index of the first occurrence within the entire . - The to locate in the . The value can be null. - The zero-based index of the first occurrence of value within the entire , if found; otherwise, -1. - - - Inserts an element into the at the specified index. - The zero-based index at which value should be inserted. - The to insert. The value can be null. - index is less than zero. -or- index is greater than . - The is read-only. -or- The has a fixed size. - - - Gets a value indicating whether the object has a fixed size. - true if the object has a fixed size; otherwise, false. The default is false. - - - Gets a value indicating whether the object is read-only. - true if the object is read-only; otherwise, false. The default is false. - - - Gets or sets the element at the specified index. - The zero-based index of the element to get or set. - The element at the specified index. - index is less than zero. -or- index is equal to or greater than . - - - Removes the first occurrence of a specific object from the . - The to remove from the . The value can be null. - The is read-only. -or- The has a fixed size. - - - Implements a hash table with the key and the value strongly typed to be strings rather than objects. - - - Initializes a new instance of the class. - - - Adds an entry with the specified key and value into the . - The key of the entry to add. - The value of the entry to add. The value can be null. - key is null. - An entry with the same key already exists in the . - The is read-only. - - - Removes all entries from the . - The is read-only. - - - Determines if the contains a specific key. - The key to locate in the . - true if the contains an entry with the specified key; otherwise, false. - The key is null. - - - Determines if the contains a specific value. - The value to locate in the . The value can be null. - true if the contains an element with the specified value; otherwise, false. - - - Copies the string dictionary values to a one-dimensional instance at the specified index. - The one-dimensional that is the destination of the values copied from the . - The index in the array where copying begins. - array is multidimensional. -or- The number of elements in the is greater than the available space from index to the end of array. - array is null. - index is less than the lower bound of array. - - - Gets the number of key/value pairs in the . - The number of key/value pairs in the . Retrieving the value of this property is an O(1) operation. - - - Returns an enumerator that iterates through the string dictionary. - An that iterates through the string dictionary. - - - Gets a value indicating whether access to the is synchronized (thread safe). - true if access to the is synchronized (thread safe); otherwise, false. - - - Gets or sets the value associated with the specified key. - The key whose value to get or set. - The value associated with the specified key. If the specified key is not found, Get returns null, and Set creates a new entry with the specified key. - key is null. - - - Gets a collection of keys in the . - An that provides the keys in the . - - - Removes the entry with the specified key from the string dictionary. - The key of the entry to remove. - The key is null. - The is read-only. - - - Gets an object that can be used to synchronize access to the . - An that can be used to synchronize access to the . - - - Gets a collection of values in the . - An that provides the values in the . - - - Supports a simple iteration over a . - - - Gets the current element in the collection. - The current element in the collection. - The enumerator is positioned before the first element of the collection or after the last element. - - - Advances the enumerator to the next element of the collection. - true if the enumerator was successfully advanced to the next element; false if the enumerator has passed the end of the collection. - The collection was modified after the enumerator was created. - - - Sets the enumerator to its initial position, which is before the first element in the collection. - The collection was modified after the enumerator was created. - - - Represents a simple last-in-first-out (LIFO) non-generic collection of objects. - - - Initializes a new instance of the class that is empty and has the default initial capacity. - - - Initializes a new instance of the class that contains elements copied from the specified collection and has the same initial capacity as the number of elements copied. - The to copy elements from. - col is null. - - - Initializes a new instance of the class that is empty and has the specified initial capacity or the default initial capacity, whichever is greater. - The initial number of elements that the can contain. - initialCapacity is less than zero. - - - Removes all objects from the . - - - Creates a shallow copy of the . - A shallow copy of the . - - - Determines whether an element is in the . - The object to locate in the . The value can be null. - true, if obj is found in the ; otherwise, false. - - - Copies the to an existing one-dimensional , starting at the specified array index. - The one-dimensional that is the destination of the elements copied from . The must have zero-based indexing. - The zero-based index in array at which copying begins. - array is null. - index is less than zero. - array is multidimensional. -or- The number of elements in the source is greater than the available space from index to the end of the destination array. - The type of the source cannot be cast automatically to the type of the destination array. - - - Gets the number of elements contained in the . - The number of elements contained in the . - - - Returns an for the . - An for the . - - - Gets a value indicating whether access to the is synchronized (thread safe). - true, if access to the is synchronized (thread safe); otherwise, false. The default is false. - - - Returns the object at the top of the without removing it. - The at the top of the . - The is empty. - - - Removes and returns the object at the top of the . - The removed from the top of the . - The is empty. - - - Inserts an object at the top of the . - The to push onto the . The value can be null. - - - Returns a synchronized (thread safe) wrapper for the . - The to synchronize. - A synchronized wrapper around the . - stack is null. - - - Gets an object that can be used to synchronize access to the . - An that can be used to synchronize access to the . - - - Copies the to a new array. - A new array containing copies of the elements of the . - - - Provides objects for performing a structural comparison of two collection objects. - - - Gets a predefined object that performs a structural comparison of two objects. - A predefined object that is used to perform a structural comparison of two collection objects. - - - Gets a predefined object that compares two objects for structural equality. - A predefined object that is used to compare two collection objects for structural equality. - - - Represents the method that compares two objects of the same type. - The first object to compare. - The second object to compare. - The type of the objects to compare. - - - - Provides data for the event. - - - Initializes a new instance of the class using no parameters. - - - Initializes a new instance of the class using the specified object as the new item. - An to use as the new item value. - - - Gets or sets the object to be added to the binding list. - The to be added as a new item to the associated collection. - - - Represents the method that will handle the event. - The source of the event, typically a data container or data-bound collection. - A that contains the event data. - - - Specifies the value to pass to a property to cause the property to get its value from another source. This is known as ambience. This class cannot be inherited. - - - Initializes a new instance of the class, given a Boolean value for its value. - The value of this attribute. - - - Initializes a new instance of the class, given an 8-bit unsigned integer for its value. - The value of this attribute. - - - Initializes a new instance of the class, given a Unicode character for its value. - The value of this attribute. - - - Initializes a new instance of the class, given a double-precision floating-point number for its value. - The value of this attribute. - - - Initializes a new instance of the class, given a 16-bit signed integer for its value. - The value of this attribute. - - - Initializes a new instance of the class, given a 32-bit signed integer for its value. - The value of this attribute. - - - Initializes a new instance of the class, given a 64-bit signed integer for its value. - The value of this attribute. - - - Initializes a new instance of the class, given an object for its value. - The value of this attribute. - - - Initializes a new instance of the class, given a single-precision floating point number for its value. - The value of this attribute. - - - Initializes a new instance of the class, given a string for its value. - The value of this attribute. - - - Initializes a new instance of the class, given the value and its type. - The of the value parameter. - The value for this attribute. - - - Determines whether the specified is equal to the current . - The to compare with the current . - true if the specified is equal to the current ; otherwise, false. - - - Returns the hash code for this instance. - A hash code for the current . - - - Gets the object that is the value of this . - The object that is the value of this . - - - Provides a type converter to convert objects to and from various other representations. - - - Initializes a new instance of the class. - - - Converts the given value object to the specified destination type. - An that provides a format context. - The culture into which value will be converted. - The to convert. - The to convert the value to. - An that represents the converted value. - destinationType is null. - The conversion cannot be performed. - - - Gets a collection of properties for the type of array specified by the value parameter. - An that provides a format context. - An that specifies the type of array to get the properties for. - An array of type that will be used as a filter. - A with the properties that are exposed for an array, or null if there are no properties. - - - Gets a value indicating whether this object supports properties. - An that provides a format context. - true because should be called to find the properties of this object. This method never returns false. - - - Provides data for the MethodNameCompleted event. - - - Initializes a new instance of the class. - Any error that occurred during the asynchronous operation. - A value indicating whether the asynchronous operation was canceled. - The optional user-supplied state object passed to the method. - - - Gets a value indicating whether an asynchronous operation has been canceled. - true if the background operation has been canceled; otherwise false. The default is false. - - - Gets a value indicating which error occurred during an asynchronous operation. - An instance, if an error occurred during an asynchronous operation; otherwise null. - - - Raises a user-supplied exception if an asynchronous operation failed. - The property is true. - The property has been set by the asynchronous operation. The property holds a reference to . - - - Gets the unique identifier for the asynchronous task. - An object reference that uniquely identifies the asynchronous task; otherwise, null if no value has been set. - - - Represents the method that will handle the MethodNameCompleted event of an asynchronous operation. - The source of the event. - An that contains the event data. - - - Tracks the lifetime of an asynchronous operation. - - - Ends the lifetime of an asynchronous operation. - has been called previously for this task. - - - Invokes a delegate on the thread or context appropriate for the application model. - A object that wraps the delegate to be called when the operation ends. - An argument for the delegate contained in the d parameter. - The method has been called previously for this task. - d is null. - - - Ends the lifetime of an asynchronous operation. - A object that wraps the delegate to be called when the operation ends. - An argument for the delegate contained in the d parameter. - has been called previously for this task. - d is null. - - - Gets the object that was passed to the constructor. - The object that was passed to the constructor. - - - Gets or sets an object used to uniquely identify an asynchronous operation. - The state object passed to the asynchronous method invocation. - - - Provides concurrency management for classes that support asynchronous method calls. This class cannot be inherited. - - - Returns an for tracking the duration of a particular asynchronous operation. - An object used to associate a piece of client state, such as a task ID, with a particular asynchronous operation. - An that you can use to track the duration of an asynchronous method invocation. - - - Gets or sets the synchronization context for the asynchronous operation. - The synchronization context for the asynchronous operation. - - - Represents a collection of attributes. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. - An array of type that provides the attributes for this collection. - attributes is null. - - - Gets the attribute collection. - The attribute collection. - - - Determines whether this collection of attributes has the specified attribute. - An to find in the collection. - true if the collection contains the attribute or is the default attribute for the type of attribute; otherwise, false. - - - Determines whether this attribute collection contains all the specified attributes in the attribute array. - An array of type to find in the collection. - true if the collection contains all the attributes; otherwise, false. - - - Copies the collection to an array, starting at the specified index. - The to copy the collection to. - The index to start from. - - - Gets the number of attributes. - The number of attributes. - - - Specifies an empty collection that you can use, rather than creating a new one. This field is read-only. - - - - Creates a new from an existing . - An from which to create the copy. - An array of type that provides the attributes for this collection. Can be null. - A new that is a copy of existing. - existing is null. - - - Returns the default of a given . - The of the attribute to retrieve. - The default of a given attributeType. - - - Gets an enumerator for this collection. - An enumerator of type . - - - Gets the attribute with the specified index number. - The zero-based index of . - The with the specified index number. - - - Gets the attribute with the specified type. - The of the to get from the collection. - The with the specified type or, if the attribute does not exist, the default value for the attribute type. - - - Determines whether a specified attribute is the same as an attribute in the collection. - An instance of to compare with the attributes in this collection. - true if the attribute is contained within the collection and has the same value as the attribute in the collection; otherwise, false. - - - Determines whether the attributes in the specified array are the same as the attributes in the collection. - An array of to compare with the attributes in this collection. - true if all the attributes in the array are contained in the collection and have the same values as the attributes in the collection; otherwise, false. - - - Gets the number of elements contained in the collection. - The number of elements contained in the collection. - - - Gets a value indicating whether access to the collection is synchronized (thread-safe). - true if access to the collection is synchronized (thread-safe); otherwise, false. - - - Gets an object that can be used to synchronize access to the collection. - An object that can be used to synchronize access to the collection. - - - Returns an for the . - An for the . - - - Enables attribute redirection. This class cannot be inherited. - - - Initializes a new instance of the class with the given type name. - The name of the type to specify. - typeName is null. - - - Initializes a new instance of the class with the given type. - The type to specify. - type is null. - - - Initializes a new instance of the class with the given type name and property name. - The name of the type to specify. - The name of the property for which attributes will be retrieved. - propertyName is null. - - - Gets the name of the property for which attributes will be retrieved. - The name of the property for which attributes will be retrieved. - - - Gets the assembly qualified type name passed into the constructor. - The assembly qualified name of the type specified in the constructor. - - - Executes an operation on a separate thread. - - - Initializes a new instance of the class. - - - Requests cancellation of a pending background operation. - is false. - - - Gets a value indicating whether the application has requested cancellation of a background operation. - true if the application has requested cancellation of a background operation; otherwise, false. The default is false. - - - Occurs when is called. - - - - Gets a value indicating whether the is running an asynchronous operation. - true, if the is running an asynchronous operation; otherwise, false. - - - Raises the event. - An that contains the event data. - - - Raises the event. - An that contains the event data. - - - Raises the event. - An that contains the event data. - - - Occurs when is called. - - - - Raises the event. - The percentage, from 0 to 100, of the background operation that is complete. - The property is set to false. - - - Raises the event. - The percentage, from 0 to 100, of the background operation that is complete. - The state object passed to . - The property is set to false. - - - Starts execution of a background operation. - is true. - - - Starts execution of a background operation. - A parameter for use by the background operation to be executed in the event handler. - is true. - - - Occurs when the background operation has completed, has been canceled, or has raised an exception. - - - - Gets or sets a value indicating whether the can report progress updates. - true if the supports progress updates; otherwise false. The default is false. - - - Gets or sets a value indicating whether the supports asynchronous cancellation. - true if the supports cancellation; otherwise false. The default is false. - - - Provides a base type converter for nonfloating-point numerical types. - - - Initializes a new instance of the class. - - - Determines if this converter can convert an object in the given source type to the native type of the converter. - An that provides a format context. - A that represents the type from which you want to convert. - true if this converter can perform the operation; otherwise, false. - - - Returns a value indicating whether this converter can convert an object to the given destination type using the context. - An that provides a format context. - A that represents the type to which you want to convert. - true if this converter can perform the operation; otherwise, false. - - - Converts the given object to the converter's native type. - An that provides a format context. - A that specifies the culture to represent the number. - The object to convert. - An that represents the converted value. - value is not a valid value for the target type. - The conversion cannot be performed. - - - Converts the specified object to another type. - An that provides a format context. - A that specifies the culture to represent the number. - The object to convert. - The type to convert the object to. - An that represents the converted value. - destinationType is null. - The conversion cannot be performed. - - - Represents a collection of designers. - - - Initializes a new instance of the class that contains the specified set of designers. - A list that contains the collection of designers to add. - - - Initializes a new instance of the class that contains the specified designers. - An array of objects to store. - - - Gets the number of designers in the collection. - The number of designers in the collection. - - - Gets a new enumerator for this collection. - An that enumerates the collection. - - - Gets the designer at the specified index. - The index of the designer to return. - The designer at the specified index. - - - Copies the elements of the collection to an , starting at a particular index. - The one-dimensional that is the destination of the elements copied from collection. The must have zero-based indexing. - The zero-based index in array at which copying begins. - - - Gets the number of elements contained in the collection. - The number of elements contained in the collection. - - - Gets a value indicating whether access to the is synchronized (thread safe). - true if access to the is synchronized (thread safe); otherwise, false. - - - Gets an object that can be used to synchronize access to the collection. - An object that can be used to synchronize access to the collection. - - - Gets a new enumerator for this collection. - An that enumerates the collection. - - - Provides data for the and events. - - - Initializes a new instance of the class. - The of the document. - - - Gets the host of the document. - The of the document. - - - Represents the method that will handle the and events that are raised when a document is created or disposed of. - The source of the event. - A that contains the event data. - - - Contains a collection of designer options. This class cannot be inherited. - - - Copies the entire collection to a compatible one-dimensional , starting at the specified index of the target array. - The one-dimensional that is the destination of the elements copied from the collection. The array must have zero-based indexing. - The zero-based index in array at which copying begins. - - - Gets the number of child option collections this contains. - The number of child option collections this contains. - - - Returns an that can be used to iterate this collection. - An that can be used to iterate this collection. - - - Returns the index of the first occurrence of a given value in a range of this collection. - The object to locate in the collection. - The index of the first occurrence of value within the entire collection, if found; otherwise, the lower bound of the collection minus 1. - - - Gets the child collection at the given index. - The zero-based index of the child collection to get. - The child collection at the specified index. - - - Gets the child collection at the given name. - The name of the child collection. - The child collection with the name specified by the name parameter, or null if the name is not found. - - - Gets the name of this . - The name of this . - - - Gets the parent collection object. - The parent collection object, or null if there is no parent. - - - Gets the collection of properties offered by this , along with all of its children. - The collection of properties offered by this , along with all of its children. - - - Displays a dialog box user interface (UI) with which the user can configure the options in this . - true if the dialog box can be displayed; otherwise, false. - - - Gets a value indicating whether access to the collection is synchronized and, therefore, thread safe. - true if the access to the collection is synchronized; otherwise, false. - - - Gets an object that can be used to synchronize access to the collection. - An object that can be used to synchronize access to the collection. - - - Adds an item to the . - The to add to the . - The position into which the new element was inserted. - - - Removes all items from the collection. - - - Determines whether the collection contains a specific value. - The to locate in the collection - true if the is found in the collection; otherwise, false. - - - Determines the index of a specific item in the collection. - The to locate in the collection. - The index of value if found in the list; otherwise, -1. - - - Inserts an item into the collection at the specified index. - The zero-based index at which value should be inserted. - The to insert into the collection. - - - Gets a value indicating whether the collection has a fixed size. - true if the collection has a fixed size; otherwise, false. - - - Gets a value indicating whether the collection is read-only. - true if the collection is read-only; otherwise, false. - - - Gets or sets the element at the specified index. - The zero-based index of the element to get or set. - The element at the specified index. - - - Removes the first occurrence of a specific object from the collection. - The to remove from the collection. - - - Removes the collection item at the specified index. - The zero-based index of the item to remove. - - - Specifies that the property can be used as an application setting. - - - Initializes a new instance of the class. - true if the property this attribute is bound to can be used as an application setting; otherwise, false. - - - Specifies the default value for the , which is . This static field is read-only. - - - - Indicates whether this instance and a specified object are equal. - Another object to compare to. - true if obj is equal to this instance; otherwise, false. - - - Returns the hash code for this instance. - A hash code for the current . - - - Indicates whether the value of this instance is the default value for the class. - true if this instance is the default attribute for the class; otherwise, false. - - - Specifies that a property cannot be used as an application setting. This static field is read-only. - - - - Gets a value indicating whether the property this attribute is bound to can be used as an application setting. - true if the property this attribute is bound to can be used as an application setting; otherwise, false. - - - Specifies that a property can be used as an application setting. This static field is read-only. - - - - Provides a type converter to convert object references to and from other representations. - - - Initializes a new instance of the class. - A that represents the type to associate with this reference converter. - - - Gets a value indicating whether this converter can convert an object in the given source type to a reference object using the specified context. - An that provides a format context. - A that represents the type you wish to convert from. - true if this object can perform the conversion; otherwise, false. - - - Converts the given object to the reference type. - An that provides a format context. - A that specifies the culture used to represent the font. - The to convert. - An that represents the converted value. - The conversion cannot be performed. - - - Converts the given value object to the reference type using the specified context and arguments. - An that provides a format context. - A that specifies the culture used to represent the font. - The to convert. - The type to convert the object to. - The converted object. - destinationType is null. - The conversion cannot be performed. - - - Gets a collection of standard values for the reference data type. - An that provides a format context. - A that holds a standard set of valid values, or null if the data type does not support a standard set of values. - - - Gets a value indicating whether the list of standard values returned from is an exclusive list. - An that provides a format context. - true because the returned from is an exhaustive list of possible values. This method never returns false. - - - Gets a value indicating whether this object supports a standard set of values that can be picked from a list. - An that provides a format context. - true because can be called to find a common set of values the object supports. This method never returns false. - - - Returns a value indicating whether a particular value can be added to the standard values collection. - An that provides an additional context. - The value to check. - true if the value is allowed and can be added to the standard values collection; false if the value cannot be added to the standard values collection. - - - Provides data for the event. - - - Initializes a new instance of the class with the component that has changed. - The component that changed. - - - Initializes a new instance of the class with the type of component that has changed. - The that changed. - - - Gets the component that changed its properties, events, or extenders. - The component that changed its properties, events, or extenders, or null if all components of the same type have changed. - - - Gets the that changed its properties or events. - The that changed its properties or events. - - - Represents the method that handles the event raised when a or component is changed during design time. - A that contains the component or that changed. - - - Defines identifiers that indicate the type of a refresh of the Properties window. - - - The properties should be requeried and the view should be refreshed. - - - - No refresh is necessary. - - - - The view should be refreshed. - - - - Indicates that the property grid should refresh when the associated property value changes. This class cannot be inherited. - - - Initializes a new instance of the class. - A value indicating the nature of the refresh. - - - Indicates that all properties are queried again and refreshed if the property value is changed. This field is read-only. - - - - Indicates that no other properties are refreshed if the property value is changed. This field is read-only. - - - - Overrides the object's method. - The object to test for equality. - true if the specified object is the same; otherwise, false. - - - Returns the hash code for this object. - The hash code for the object that the attribute belongs to. - - - Gets a value indicating whether the current value of the attribute is the default value for the attribute. - true if the current value of the attribute is the default; otherwise, false. - - - Gets the refresh properties for the member. - A that indicates the current refresh properties for the member. - - - Indicates that all properties are repainted if the property value is changed. This field is read-only. - - - - Specifies whether the Visual Studio Custom Action Installer or the Installutil.exe (Installer Tool) should be invoked when the assembly is installed. - - - Initializes a new instance of the class. - true if an installer should be invoked during installation of an assembly; otherwise, false. - - - Specifies the default visiblity, which is . This static field is read-only. - - - - Determines whether the value of the specified is equivalent to the current . - The object to compare. - true if the specified is equal to the current ; otherwise, false. - - - Generates a hash code for the current . - A hash code for the current . - - - Determines if this attribute is the default. - true if the attribute is the default value for this attribute class; otherwise, false. - - - Specifies that the Visual Studio Custom Action Installer or the Installutil.exe (Installer Tool) should not be invoked when the assembly is installed. This static field is read-only. - - - - Gets a value indicating whether an installer should be invoked during installation of an assembly. - true if an installer should be invoked during installation of an assembly; otherwise, false. - - - Specifies that the Visual Studio Custom Action Installer or the Installutil.exe (Installer Tool) should be invoked when the assembly is installed. This static field is read-only. - - - - Provides data for the MethodNameCompleted event. - - - Initializes a new instance of the class. - The result of an asynchronous operation. - Any error that occurred during the asynchronous operation. - A value indicating whether the asynchronous operation was canceled. - - - Gets a value that represents the result of an asynchronous operation. - An representing the result of an asynchronous operation. - is not null. The property holds a reference to . - is true. - - - Gets a value that represents the user state. - An representing the user state. - - - Represents the method that will handle the event of a class. - The source of the event. - A that contains the event data. - - - Provides a type converter to convert 8-bit unsigned integer objects to and from a string. - - - Initializes a new instance of the class. - - - Specifies when a component property can be bound to an application setting. - - - Initializes a new instance of the class. - true to specify that a property is appropriate to bind settings to; otherwise, false. - - - Gets a value indicating whether a property is appropriate to bind settings to. - true if the property is appropriate to bind settings to; otherwise, false. - - - Returns a value that indicates whether this instance is equal to a specified object. - An to compare with this instance or a null reference (Nothing in Visual Basic). - true if obj equals the type and value of this instance; otherwise, false. - - - Returns the hash code for this instance. - A 32-bit signed integer hash code. - - - Specifies that a property is not appropriate to bind settings to. - - - - Specifies that a property is appropriate to bind settings to. - - - - Provides a type converter to convert single-precision, floating point number objects to and from various other representations. - - - Initializes a new instance of the class. - - - Provides a type converter to convert string objects to and from other representations. - - - Initializes a new instance of the class. - - - Gets a value indicating whether this converter can convert an object in the given source type to a string using the specified context. - An that provides a format context. - A that represents the type you wish to convert from. - true if this converter can perform the conversion; otherwise, false. - - - Converts the specified value object to a object. - An that provides a format context. - The to use. - The to convert. - An that represents the converted value. - The conversion could not be performed. - - - Provides methods to verify the machine name and path conform to a specific syntax. This class cannot be inherited. - - - Checks the syntax of the machine name to confirm that it does not contain "\". - A string containing the machine name to check. - true if value matches the proper machine name format; otherwise, false. - - - Checks the syntax of the path to see whether it starts with "\\". - A string containing the path to check. - true if value matches the proper path format; otherwise, false. - - - Checks the syntax of the path to see if it starts with "\" or drive letter "C:". - A string containing the path to check. - true if value matches the proper path format; otherwise, false. - - - Provides a type converter to convert objects to and from other representations. - - - Initializes a new instance of the class. - - - Gets a value indicating whether this converter can convert an object in the given source type to a using the specified context. - An that provides a format context. - A that represents the type you wish to convert from. - true if this converter can perform the conversion; otherwise, false. - - - Gets a value indicating whether this converter can convert an object to the given destination type using the context. - An that provides a format context. - A that represents the type you wish to convert to. - true if this converter can perform the conversion; otherwise, false. - destinationType is null. - value is not a valid value for the target type. - - - Converts the given object to a . - An that provides a format context. - An optional . If not supplied, the current culture is assumed. - The to convert. - An that represents the converted value. - The conversion cannot be performed. - value is not a valid value for the target type. - - - Converts the given object to another type. - A formatter context. - The culture into which value will be converted. - The object to convert. - The type to convert the object to. - The converted object. - - - Represents an attribute of a toolbox item. - - - Initializes a new instance of the class and specifies whether to use default initialization values. - true to create a toolbox item attribute for a default type; false to associate no default toolbox item support for this attribute. - - - Initializes a new instance of the class using the specified name of the type. - The names of the type of the toolbox item and of the assembly that contains the type. - - - Initializes a new instance of the class using the specified type of the toolbox item. - The type of the toolbox item. - - - Initializes a new instance of the class and sets the type to the default, . This field is read-only. - - - - Returns a value that indicates whether this instance is equal to a specified object. - An to compare with this instance or a null reference (Nothing in Visual Basic). - true if obj equals the type and value of this instance; otherwise, false. - - - Returns the hash code for this instance. - A 32-bit signed integer hash code. - - - Gets a value indicating whether the current value of the attribute is the default value for the attribute. - true if the current value of the attribute is the default; otherwise, false. - - - Initializes a new instance of the class and sets the type to null. This field is read-only. - - - - Gets or sets the type of the toolbox item. - The type of the toolbox item. - The type cannot be found. - - - Gets or sets the name of the type of the current . - The fully qualified type name of the current toolbox item. - - - Specifies the filter string and filter type to use for a toolbox item. - - - Initializes a new instance of the class using the specified filter string. - The filter string for the toolbox item. - - - Initializes a new instance of the class using the specified filter string and type. - The filter string for the toolbox item. - A indicating the type of the filter. - - - Returns a value that indicates whether this instance is equal to a specified object. - An to compare with this instance or a null reference (Nothing in Visual Basic). - true if obj equals the type and value of this instance; otherwise, false. - - - Gets the filter string for the toolbox item. - The filter string for the toolbox item. - - - Gets the type of the filter. - A that indicates the type of the filter. - - - Returns the hash code for this instance. - A 32-bit signed integer hash code. - - - Indicates whether the specified object has a matching filter string. - The object to test for a matching filter string. - true if the specified object has a matching filter string; otherwise, false. - - - Returns a string that represents the current object. - A string that represents the current object. - - - Gets the type ID for the attribute. - The type ID for this attribute. All objects with the same filter string return the same type ID. - - - Defines identifiers used to indicate the type of filter that a uses. - - - Indicates that a toolbox item filter string is allowed, but not required. - - - - Indicates that custom processing is required to determine whether to use a toolbox item filter string. - - - - Indicates that a toolbox item filter string is not allowed. - - - - Indicates that a toolbox item filter string must be present for a toolbox item to be enabled. - - - - Represents an abstract class that provides properties for objects that do not have properties. - - - Initializes a new instance of the class. - A that represents the type of component to which this property descriptor binds. - The name of the property. - A that represents the data type for this property. - - - Initializes a new instance of the class. - A that represents the type of component to which this property descriptor binds. - The name of the property. - A that represents the data type for this property. - An array with the attributes to associate with the property. - - - Returns whether resetting the component changes the value of the component. - The component to test for reset capability. - true if resetting the component changes the value of the component; otherwise, false. - - - Gets the type of component to which this property description binds. - A that represents the type of component to which this property binds. - - - Gets a value indicating whether this property is read-only. - true if the property is read-only; false if the property is read/write. - - - Gets the type of the property. - A that represents the type of the property. - - - Resets the value for this property of the component. - The component with the property value to be reset. - - - Returns whether the value of this property can persist. - The component with the property that is to be examined for persistence. - true if the value of the property can persist; otherwise, false. - - - Represents a collection of values. - - - Initializes a new instance of the class. - An that represents the objects to put into the collection. - - - Copies the contents of this collection to an array. - An that represents the array to copy to. - The index to start from. - - - Gets the number of objects in the collection. - The number of objects in the collection. - - - Returns an enumerator for this collection. - An enumerator of type . - - - Gets the object at the specified index number. - The zero-based index of the to get from the collection. - The with the specified index. - - - Copies the contents of this collection to an array. - The array to copy to. - The index in the array where copying should begin. - - - For a description of this member, see . - The number of elements contained in the . - - - For a description of this member, see . - false in all cases. - - - For a description of this member, see . - null in all cases. - - - For a description of this member, see . - An that can be used to iterate through the collection. - - - Provides a unified way of converting types of values to other types, as well as for accessing standard values and subproperties. - - - Initializes a new instance of the class. - - - Returns whether this converter can convert an object of the given type to the type of this converter. - A that represents the type you want to convert from. - true if this converter can perform the conversion; otherwise, false. - - - Returns whether this converter can convert an object of the given type to the type of this converter, using the specified context. - An that provides a format context. - A that represents the type you want to convert from. - true if this converter can perform the conversion; otherwise, false. - - - Returns whether this converter can convert the object to the specified type. - A that represents the type you want to convert to. - true if this converter can perform the conversion; otherwise, false. - - - Returns whether this converter can convert the object to the specified type, using the specified context. - An that provides a format context. - A that represents the type you want to convert to. - true if this converter can perform the conversion; otherwise, false. - - - Converts the given value to the type of this converter. - The to convert. - An that represents the converted value. - The conversion cannot be performed. - - - Converts the given object to the type of this converter, using the specified context and culture information. - An that provides a format context. - The to use as the current culture. - The to convert. - An that represents the converted value. - The conversion cannot be performed. - - - Converts the given string to the type of this converter, using the invariant culture. - The to convert. - An that represents the converted text. - The conversion cannot be performed. - - - Converts the given string to the type of this converter, using the invariant culture and the specified context. - An that provides a format context. - The to convert. - An that represents the converted text. - The conversion cannot be performed. - - - Converts the given text to an object, using the specified context and culture information. - An that provides a format context. - A . If null is passed, the current culture is assumed. - The to convert. - An that represents the converted text. - The conversion cannot be performed. - - - Converts the specified text to an object. - The text representation of the object to convert. - An that represents the converted text. - The string cannot be converted into the appropriate object. - - - Converts the given text to an object, using the specified context. - An that provides a format context. - The to convert. - An that represents the converted text. - The conversion cannot be performed. - - - Converts the given value object to the specified type, using the arguments. - The to convert. - The to convert the value parameter to. - An that represents the converted value. - The destinationType parameter is null. - The conversion cannot be performed. - - - Converts the given value object to the specified type, using the specified context and culture information. - An that provides a format context. - A . If null is passed, the current culture is assumed. - The to convert. - The to convert the value parameter to. - An that represents the converted value. - The destinationType parameter is null. - The conversion cannot be performed. - - - Converts the specified value to a culture-invariant string representation. - The to convert. - A that represents the converted value. - The conversion cannot be performed. - - - Converts the specified value to a culture-invariant string representation, using the specified context. - An that provides a format context. - The to convert. - A that represents the converted value. - The conversion cannot be performed. - - - Converts the given value to a string representation, using the specified context and culture information. - An that provides a format context. - A . If null is passed, the current culture is assumed. - The to convert. - An that represents the converted value. - The conversion cannot be performed. - - - Converts the specified value to a string representation. - The to convert. - An that represents the converted value. - The conversion cannot be performed. - - - Converts the given value to a string representation, using the given context. - An that provides a format context. - The to convert. - An that represents the converted value. - The conversion cannot be performed. - - - Creates an instance of the type that this is associated with, using the specified context, given a set of property values for the object. - An that provides a format context. - An of new property values. - An representing the given , or null if the object cannot be created. This method always returns null. - - - Re-creates an given a set of property values for the object. - An that represents a dictionary of new property values. - An representing the given , or null if the object cannot be created. This method always returns null. - - - Returns an exception to throw when a conversion cannot be performed. - The to convert, or null if the object is not available. - An that represents the exception to throw when a conversion cannot be performed. - Automatically thrown by this method. - - - Returns an exception to throw when a conversion cannot be performed. - The to convert, or null if the object is not available. - A that represents the type the conversion was trying to convert to. - An that represents the exception to throw when a conversion cannot be performed. - Automatically thrown by this method. - - - Returns whether changing a value on this object requires a call to the method to create a new value. - true if changing a property on this object requires a call to to create a new value; otherwise, false. - - - Returns whether changing a value on this object requires a call to to create a new value, using the specified context. - An that provides a format context. - true if changing a property on this object requires a call to to create a new value; otherwise, false. - - - Returns a collection of properties for the type of array specified by the value parameter. - An that specifies the type of array for which to get properties. - A with the properties that are exposed for this data type, or null if there are no properties. - - - Returns a collection of properties for the type of array specified by the value parameter, using the specified context. - An that provides a format context. - An that specifies the type of array for which to get properties. - A with the properties that are exposed for this data type, or null if there are no properties. - - - Returns a collection of properties for the type of array specified by the value parameter, using the specified context and attributes. - An that provides a format context. - An that specifies the type of array for which to get properties. - An array of type that is used as a filter. - A with the properties that are exposed for this data type, or null if there are no properties. - - - Returns whether this object supports properties, using the specified context. - An that provides a format context. - true if should be called to find the properties of this object; otherwise, false. - - - Returns whether this object supports properties. - true if should be called to find the properties of this object; otherwise, false. - - - Returns a collection of standard values from the default context for the data type this type converter is designed for. - A containing a standard set of valid values, or null if the data type does not support a standard set of values. - - - Returns a collection of standard values for the data type this type converter is designed for when provided with a format context. - An that provides a format context that can be used to extract additional information about the environment from which this converter is invoked. This parameter or properties of this parameter can be null. - A that holds a standard set of valid values, or null if the data type does not support a standard set of values. - - - Returns whether the collection of standard values returned from is an exclusive list. - true if the returned from is an exhaustive list of possible values; false if other values are possible. - - - Returns whether the collection of standard values returned from is an exclusive list of possible values, using the specified context. - An that provides a format context. - true if the returned from is an exhaustive list of possible values; false if other values are possible. - - - Returns whether this object supports a standard set of values that can be picked from a list. - true if should be called to find a common set of values the object supports; otherwise, false. - - - Returns whether this object supports a standard set of values that can be picked from a list, using the specified context. - An that provides a format context. - true if should be called to find a common set of values the object supports; otherwise, false. - - - Returns whether the given value object is valid for this type and for the specified context. - An that provides a format context. - The to test for validity. - true if the specified value is valid for this object; otherwise, false. - - - Returns whether the given value object is valid for this type. - The object to test for validity. - true if the specified value is valid for this object; otherwise, false. - - - Sorts a collection of properties. - A that has the properties to sort. - An array of names in the order you want the properties to appear in the collection. - A that contains the sorted properties. - - - Specifies what type to use as a converter for the object this attribute is bound to. - - - Initializes a new instance of the class with the default type converter, which is an empty string (""). - - - Initializes a new instance of the class, using the specified type name as the data converter for the object this attribute is bound to. - The fully qualified name of the class to use for data conversion for the object this attribute is bound to. - - - Initializes a new instance of the class, using the specified type as the data converter for the object this attribute is bound to. - A that represents the type of the converter class to use for data conversion for the object this attribute is bound to. - - - Gets the fully qualified type name of the to use as a converter for the object this attribute is bound to. - The fully qualified type name of the to use as a converter for the object this attribute is bound to, or an empty string ("") if none exists. The default value is an empty string (""). - - - Specifies the type to use as a converter for the object this attribute is bound to. - - - - Returns whether the value of the given object is equal to the current . - The object to test the value equality of. - true if the value of the given object is equal to that of the current ; otherwise, false. - - - Returns the hash code for this instance. - A hash code for the current . - - - Provides supplemental metadata to the . - - - Initializes a new instance of the class. - - - Initializes a new instance of the class using a parent type description provider. - The parent type description provider. - - - Creates an object that can substitute for another data type. - An optional service provider. - The type of object to create. This parameter is never null. - An optional array of types that represent the parameter types to be passed to the object's constructor. This array can be null or of zero length. - An optional array of parameter values to pass to the object's constructor. - The substitute . - - - Gets a per-object cache, accessed as an of key/value pairs. - The object for which to get the cache. - An if the provided object supports caching; otherwise, null. - - - Gets an extended custom type descriptor for the given object. - The object for which to get the extended type descriptor. - An that can provide extended metadata for the object. - - - Gets the extender providers for the specified object. - The object to get extender providers for. - An array of extender providers for instance. - instance is null. - - - Gets the name of the specified component, or null if the component has no name. - The specified component. - The name of the specified component. - component is null. - - - Performs normal reflection against the given object. - An instance of the type (should not be null). - The type of reflection for this instance. - instance is null. - - - Performs normal reflection against a type. - The type of object for which to retrieve the . - The type of reflection for this objectType. - objectType is null. - - - Performs normal reflection against the given object with the given type. - The type of object for which to retrieve the . - An instance of the type. Can be null. - The type of reflection for this objectType. - - - Converts a reflection type into a runtime type. - The type to convert to its runtime equivalent. - A that represents the runtime equivalent of reflectionType. - reflectionType is null. - - - Gets a custom type descriptor for the given object. - An instance of the type. Can be null if no instance was passed to the . - An that can provide metadata for the type. - instance is null. - - - Gets a custom type descriptor for the given type. - The type of object for which to retrieve the type descriptor. - An that can provide metadata for the type. - - - Gets a custom type descriptor for the given type and object. - The type of object for which to retrieve the type descriptor. - An instance of the type. Can be null if no instance was passed to the . - An that can provide metadata for the type. - - - Gets a value that indicates whether the specified type is compatible with the type description and its chain of type description providers. - The type to test for compatibility. - true if type is compatible with the type description and its chain of type description providers; otherwise, false. - type is null. - - - Specifies the custom type description provider for a class. This class cannot be inherited. - - - Initializes a new instance of the class using the specified type name. - The qualified name of the type. - typeName is null. - - - Initializes a new instance of the class using the specified type. - The type to store in the attribute. - type is null. - - - Gets the type name for the type description provider. - A containing the qualified type name for the . - - - Provides information about the characteristics for a component, such as its attributes, properties, and events. This class cannot be inherited. - - - Adds class-level attributes to the target component instance. - An instance of the target component. - An array of objects to add to the component's class. - The newly created that was used to add the specified attributes. - One or both of the parameters is null. - - - Adds class-level attributes to the target component type. - The of the target component. - An array of objects to add to the component's class. - The newly created that was used to add the specified attributes. - One or both of the parameters is null. - - - Adds an editor table for the given editor base type. - The editor base type to add the editor table for. If a table already exists for this type, this method will do nothing. - The to add. - - - Adds a type description provider for a single instance of a component. - The to add. - An instance of the target component. - One or both of the parameters are null. - - - Adds a type description provider for a component class. - The to add. - The of the target component. - One or both of the parameters are null. - - - Adds a type description provider for a single instance of a component. - The to add. - An instance of the target component. - One or both of the parameters are null. - - - Adds a type description provider for a component class. - The to add. - The of the target component. - One or both of the parameters are null. - - - Gets or sets the provider for the Component Object Model (COM) type information for the target component. - An instance representing the COM type information provider. - - - Gets the type of the Component Object Model (COM) object represented by the target component. - The of the COM object represented by this component, or null for non-COM objects. - - - Creates a primary-secondary association between two objects. - The primary . - The secondary . - One or both of the parameters are null. - primary is equal to secondary. - - - Creates an instance of the designer associated with the specified component and of the specified type of designer. - An that specifies the component to associate with the designer. - A that represents the type of designer to create. - An that is an instance of the designer for the component, or null if no designer can be found. - - - Creates a new event descriptor that is identical to an existing event descriptor, when passed the existing . - The type of the component for which to create the new event. - The existing event information. - The new attributes. - A new that has merged the specified metadata attributes with the existing metadata attributes. - - - Creates a new event descriptor that is identical to an existing event descriptor by dynamically generating descriptor information from a specified event on a type. - The type of the component the event lives on. - The name of the event. - The type of the delegate that handles the event. - The attributes for this event. - An that is bound to a type. - - - Creates an object that can substitute for another data type. - The service provider that provides a service. This parameter can be null. - The of object to create. - An optional array of parameter types to be passed to the object's constructor. This parameter can be null or an array of zero length. - An optional array of parameter values to pass to the object's constructor. If not null, the number of elements must be the same as argTypes. - An instance of the substitute data type if an associated is found; otherwise, null. - objectType is null, or args is null when argTypes is not null. - argTypes and args have different number of elements. - - - Creates and dynamically binds a property descriptor to a type, using the specified property name, type, and attribute array. - The of the component that the property is a member of. - The name of the property. - The of the property. - The new attributes for this property. - A that is bound to the specified type and that has the specified metadata attributes merged with the existing metadata attributes. - - - Creates a new property descriptor from an existing property descriptor, using the specified existing and attribute array. - The of the component that the property is a member of. - The existing property descriptor. - The new attributes for this property. - A new that has the specified metadata attributes merged with the existing metadata attributes. - - - Returns an instance of the type associated with the specified primary object. - The of the target component. - The primary object of the association. - An instance of the secondary type that has been associated with the primary object if an association exists; otherwise, primary if no specified association exists. - One or both of the parameters are null. - - - Returns the collection of attributes for the specified component. - The component for which you want to get attributes. - An containing the attributes for the component. If component is null, this method returns an empty collection. - - - Returns a collection of attributes for the specified type of component. - The of the target component. - An with the attributes for the type of the component. If the component is null, this method returns an empty collection. - - - Returns a collection of attributes for the specified component and a Boolean indicating that a custom type descriptor has been created. - The component for which you want to get attributes. - true to use a baseline set of attributes from the custom type descriptor if component is of type ; otherwise, false. - An with the attributes for the component. If the component is null, this method returns an empty collection. - - - Returns the name of the class for the specified component using the default type descriptor. - The for which you want the class name. - A containing the name of the class for the specified component. - component is null. - - - Returns the name of the class for the specified type. - The of the target component. - A containing the name of the class for the specified component type. - componentType is null. - - - Returns the name of the class for the specified component using a custom type descriptor. - The for which you want the class name. - true to consider custom type description information; otherwise, false. - A containing the name of the class for the specified component. - component is null. - component is a cross-process remoted object. - - - Returns the name of the specified component using the default type descriptor. - The for which you want the class name. - A containing the name of the specified component, or null if there is no component name. - component is null. - component is a cross-process remoted object. - - - Returns the name of the specified component using a custom type descriptor. - The for which you want the class name. - true to consider custom type description information; otherwise, false. - The name of the class for the specified component, or null if there is no component name. - component is null. - component is a cross-process remoted object. - - - Returns a type converter for the type of the specified component. - A component to get the converter for. - A for the specified component. - component is null. - component is a cross-process remoted object. - - - Returns a type converter for the specified type. - The of the target component. - A for the specified type. - component is null. - - - Returns a type converter for the type of the specified component with a custom type descriptor. - A component to get the converter for. - true to consider custom type description information; otherwise, false. - A for the specified component. - component is null. - component is a cross-process remoted object. - - - Returns the default event for the specified type of component. - The of the target component. - An with the default event, or null if there are no events. - component is null. - - - Returns the default event for a component with a custom type descriptor. - The component to get the event for. - true to consider custom type description information; otherwise, false. - An with the default event, or null if there are no events. - component is null. - component is a cross-process remoted object. - - - Returns the default event for the specified component. - The component to get the event for. - An with the default event, or null if there are no events. - component is null. - component is a cross-process remoted object. - - - Returns the default property for the specified type of component. - A that represents the class to get the property for. - A with the default property, or null if there are no properties. - - - Returns the default property for the specified component with a custom type descriptor. - The component to get the default property for. - true to consider custom type description information; otherwise, false. - A with the default property, or null if there are no properties. - component is a cross-process remoted object. - - - Returns the default property for the specified component. - The component to get the default property for. - A with the default property, or null if there are no properties. - component is a cross-process remoted object. - - - Gets an editor with the specified base type for the specified component. - The component to get the editor for. - A that represents the base type of the editor you want to find. - An instance of the editor that can be cast to the specified editor type, or null if no editor of the requested type can be found. - component or editorBaseType is null. - component is a cross-process remoted object. - - - Returns an editor with the specified base type for the specified type. - The of the target component. - A that represents the base type of the editor you are trying to find. - An instance of the editor object that can be cast to the given base type, or null if no editor of the requested type can be found. - type or editorBaseType is null. - - - Returns an editor with the specified base type and with a custom type descriptor for the specified component. - The component to get the editor for. - A that represents the base type of the editor you want to find. - A flag indicating whether custom type description information should be considered. - An instance of the editor that can be cast to the specified editor type, or null if no editor of the requested type can be found. - component or editorBaseType is null. - component is a cross-process remoted object. - - - Returns the collection of events for the specified component. - A component to get the events for. - An with the events for this component. - component is a cross-process remoted object. - - - Returns the collection of events for a specified type of component. - The of the target component. - An with the events for this component. - - - Returns the collection of events for a specified component using a specified array of attributes as a filter. - A component to get the events for. - An array of type that you can use as a filter. - An with the events that match the specified attributes for this component. - component is a cross-process remoted object. - - - Returns the collection of events for a specified component with a custom type descriptor. - A component to get the events for. - true to consider custom type description information; otherwise, false. - An with the events for this component. - component is a cross-process remoted object. - - - Returns the collection of events for a specified type of component using a specified array of attributes as a filter. - The of the target component. - An array of type that you can use as a filter. - An with the events that match the specified attributes for this component. - - - Returns the collection of events for a specified component using a specified array of attributes as a filter and using a custom type descriptor. - A component to get the events for. - An array of type to use as a filter. - true to consider custom type description information; otherwise, false. - An with the events that match the specified attributes for this component. - component is a cross-process remoted object. - - - Returns the fully qualified name of the component. - The to find the name for. - The fully qualified name of the specified component, or null if the component has no name. - component is null. - - - Returns the collection of properties for a specified component using a specified array of attributes as a filter and using a custom type descriptor. - A component to get the properties for. - An array of type to use as a filter. - true to consider custom type description information; otherwise, false. - A with the events that match the specified attributes for the specified component. - component is a cross-process remoted object. - - - Returns the collection of properties for a specified component using the default type descriptor. - A component to get the properties for. - true to not consider custom type description information; otherwise, false. - A with the properties for a specified component. - component is a cross-process remoted object. - - - Returns the collection of properties for a specified type of component using a specified array of attributes as a filter. - The of the target component. - An array of type to use as a filter. - A with the properties that match the specified attributes for this type of component. - - - Returns the collection of properties for a specified type of component. - A that represents the component to get properties for. - A with the properties for a specified type of component. - - - Returns the collection of properties for a specified component. - A component to get the properties for. - A with the properties for the specified component. - component is a cross-process remoted object. - - - Returns the collection of properties for a specified component using a specified array of attributes as a filter. - A component to get the properties for. - An array of type to use as a filter. - A with the properties that match the specified attributes for the specified component. - component is a cross-process remoted object. - - - Returns the type description provider for the specified component. - An instance of the target component. - A associated with the specified component. - instance is null. - - - Returns the type description provider for the specified type. - The of the target component. - A associated with the specified type. - type is null. - - - Returns a that can be used to perform reflection, given an object. - An instance of the target component. - A for the specified object. - instance is null. - - - Returns a that can be used to perform reflection, given a class type. - The of the target component. - A of the specified class. - type is null. - - - Gets a type that represents a type description provider for all interface types. - A that represents a custom type description provider for all interface types. - - - Clears the properties and events for the specified type of component from the cache. - The of the target component. - - - Clears the properties and events for the specified module from the cache. - The that represents the module to refresh. Each in this module will be refreshed. - - - Clears the properties and events for the specified component from the cache. - A component for which the properties or events have changed. - - - Clears the properties and events for the specified assembly from the cache. - The that represents the assembly to refresh. Each in this assembly will be refreshed. - - - Occurs when the cache for a component is cleared. - - - - Removes an association between two objects. - The primary . - The secondary . - One or both of the parameters are null. - - - Removes all associations for a primary object. - The primary in an association. - primary is null. - - - Removes a previously added type description provider that is associated with the specified object. - The to remove. - An instance of the target component. - One or both of the parameters are null. - - - Removes a previously added type description provider that is associated with the specified type. - The to remove. - The of the target component. - One or both of the parameters are null. - - - Removes a previously added type description provider that is associated with the specified type. - The to remove. - The of the target component. - One or both of the parameters are null. - - - Removes a previously added type description provider that is associated with the specified object. - The to remove. - An instance of the target component. - One or both of the parameters are null. - - - Sorts descriptors using the name of the descriptor. - An that contains the descriptors to sort. - infos is null. - - - Provides a type converter that can be used to populate a list box with available types. - - - Initializes a new instance of the class using the type array as the available types. - The array of type to use as the available types. - - - Gets a value indicating whether this converter can convert the specified of the source object using the given context. - An that provides a format context. - The of the source object. - true if this converter can perform the conversion; otherwise, false. - - - Gets a value indicating whether this converter can convert an object to the given destination type using the context. - An that provides a format context. - A that represents the type you wish to convert to. - true if this converter can perform the conversion; otherwise, false. - - - Converts the specified object to the native type of the converter. - An that provides a format context. - A that specifies the culture used to represent the font. - The to convert. - An that represents the converted value. - - - Converts the given value object to the specified destination type. - An that provides a format context. - An optional . If not supplied, the current culture is assumed. - The to convert. - The to convert the value to. - An that represents the converted value. - destinationType is null. - The conversion cannot be performed. - - - Gets a collection of standard values for the data type this validator is designed for. - An that provides a format context. - A that holds a standard set of valid values, or null if the data type does not support a standard set of values. - - - Gets a value indicating whether the list of standard values returned from the method is an exclusive list. - An that provides a format context. - true because the returned from is an exhaustive list of possible values. This method never returns false. - - - Gets a value indicating whether this object supports a standard set of values that can be picked from a list using the specified context. - An that provides a format context. - true because should be called to find a common set of values the object supports. This method never returns false. - - - Provides a type converter to convert 16-bit unsigned integer objects to and from other representations. - - - Initializes a new instance of the class. - - - Provides a type converter to convert 32-bit unsigned integer objects to and from various other representations. - - - Initializes a new instance of the class. - - - Provides a type converter to convert 64-bit unsigned integer objects to and from other representations. - - - Initializes a new instance of the class. - - - Specifies an exception that is handled as a warning instead of an error. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with the specified message and no Help file. - The message to display to the end user. - - - Initializes a new instance of the class using the specified serialization data and context. - The to be used for deserialization. - The destination to be used for deserialization. - - - Initializes a new instance of the class with the specified detailed description and the specified exception. - A detailed description of the error. - A reference to the inner exception that is the cause of this exception. - - - Initializes a new instance of the class with the specified message, and with access to the specified Help file. - The message to display to the end user. - The Help file to display if the user requests help. - - - Initializes a new instance of the class with the specified message, and with access to the specified Help file and topic. - The message to display to the end user. - The Help file to display if the user requests help. - The Help topic to display if the user requests help. - - - Sets the with the parameter name and additional exception information. - Stores the data that was being used to serialize or deserialize the object that the was serializing or deserializing. - Describes the source and destination of the stream that generated the exception, as well as a means for serialization to retain that context and an additional caller-defined context. - info is null. - - - Gets the Help topic associated with the warning. - The Help topic associated with the warning. - - - Gets the Help file associated with the warning. - The Help file associated with the warning. - - - Represents the standard input, output, and error streams for console applications. This class cannot be inherited. - - - Gets or sets the background color of the console. - A value that specifies the background color of the console; that is, the color that appears behind each character. The default is black. - The color specified in a set operation is not a valid member of . - The user does not have permission to perform this action. - An I/O error occurred. - - - Plays the sound of a beep through the console speaker. - This method was executed on a server, such as SQL Server, that does not permit access to a user interface. - - - Plays the sound of a beep of a specified frequency and duration through the console speaker. - The frequency of the beep, ranging from 37 to 32767 hertz. - The duration of the beep measured in milliseconds. - frequency is less than 37 or more than 32767 hertz. -or- duration is less than or equal to zero. - This method was executed on a server, such as SQL Server, that does not permit access to the console. - - - Gets or sets the height of the buffer area. - The current height, in rows, of the buffer area. - The value in a set operation is less than or equal to zero. -or- The value in a set operation is greater than or equal to . -or- The value in a set operation is less than + . - The user does not have permission to perform this action. - An I/O error occurred. - - - Gets or sets the width of the buffer area. - The current width, in columns, of the buffer area. - The value in a set operation is less than or equal to zero. -or- The value in a set operation is greater than or equal to . -or- The value in a set operation is less than + . - The user does not have permission to perform this action. - An I/O error occurred. - - - Occurs when the modifier key (Ctrl) and either the console key (C) or the Break key are pressed simultaneously (Ctrl+C or Ctrl+Break). - - - - Gets a value indicating whether the CAPS LOCK keyboard toggle is turned on or turned off. - true if CAPS LOCK is turned on; false if CAPS LOCK is turned off. - - - Clears the console buffer and corresponding console window of display information. - An I/O error occurred. - - - Gets or sets the column position of the cursor within the buffer area. - The current position, in columns, of the cursor. - The value in a set operation is less than zero. -or- The value in a set operation is greater than or equal to . - The user does not have permission to perform this action. - An I/O error occurred. - - - Gets or sets the height of the cursor within a character cell. - The size of the cursor expressed as a percentage of the height of a character cell. The property value ranges from 1 to 100. - The value specified in a set operation is less than 1 or greater than 100. - The user does not have permission to perform this action. - An I/O error occurred. - - - Gets or sets the row position of the cursor within the buffer area. - The current position, in rows, of the cursor. - The value in a set operation is less than zero. -or- The value in a set operation is greater than or equal to . - The user does not have permission to perform this action. - An I/O error occurred. - - - Gets or sets a value indicating whether the cursor is visible. - true if the cursor is visible; otherwise, false. - The user does not have permission to perform this action. - An I/O error occurred. - - - Gets the standard error output stream. - A that represents the standard error output stream. - - - Gets or sets the foreground color of the console. - A that specifies the foreground color of the console; that is, the color of each character that is displayed. The default is gray. - The color specified in a set operation is not a valid member of . - The user does not have permission to perform this action. - An I/O error occurred. - - - Gets the standard input stream. - A that represents the standard input stream. - - - Gets or sets the encoding the console uses to read input. - The encoding used to read console input. - The property value in a set operation is null. - An error occurred during the execution of this operation. - Your application does not have permission to perform this operation. - - - Gets a value that indicates whether the error output stream has been redirected from the standard error stream. - true if error output is redirected; otherwise, false. - - - Gets a value that indicates whether input has been redirected from the standard input stream. - true if input is redirected; otherwise, false. - - - Gets a value that indicates whether output has been redirected from the standard output stream. - true if output is redirected; otherwise, false. - - - Gets a value indicating whether a key press is available in the input stream. - true if a key press is available; otherwise, false. - An I/O error occurred. - Standard input is redirected to a file instead of the keyboard. - - - Gets the largest possible number of console window rows, based on the current font and screen resolution. - The height of the largest possible console window measured in rows. - - - Gets the largest possible number of console window columns, based on the current font and screen resolution. - The width of the largest possible console window measured in columns. - - - Copies a specified source area of the screen buffer to a specified destination area. - The leftmost column of the source area. - The topmost row of the source area. - The number of columns in the source area. - The number of rows in the source area. - The leftmost column of the destination area. - The topmost row of the destination area. - One or more of the parameters is less than zero. -or- sourceLeft or targetLeft is greater than or equal to . -or- sourceTop or targetTop is greater than or equal to . -or- sourceTop + sourceHeight is greater than or equal to . -or- sourceLeft + sourceWidth is greater than or equal to . - The user does not have permission to perform this action. - An I/O error occurred. - - - Copies a specified source area of the screen buffer to a specified destination area. - The leftmost column of the source area. - The topmost row of the source area. - The number of columns in the source area. - The number of rows in the source area. - The leftmost column of the destination area. - The topmost row of the destination area. - The character used to fill the source area. - The foreground color used to fill the source area. - The background color used to fill the source area. - One or more of the parameters is less than zero. -or- sourceLeft or targetLeft is greater than or equal to . -or- sourceTop or targetTop is greater than or equal to . -or- sourceTop + sourceHeight is greater than or equal to . -or- sourceLeft + sourceWidth is greater than or equal to . - One or both of the color parameters is not a member of the enumeration. - The user does not have permission to perform this action. - An I/O error occurred. - - - Gets a value indicating whether the NUM LOCK keyboard toggle is turned on or turned off. - true if NUM LOCK is turned on; false if NUM LOCK is turned off. - - - Acquires the standard error stream. - The standard error stream. - - - Acquires the standard error stream, which is set to a specified buffer size. - The internal stream buffer size. - The standard error stream. - bufferSize is less than or equal to zero. - - - Acquires the standard input stream. - The standard input stream. - - - Acquires the standard input stream, which is set to a specified buffer size. - The internal stream buffer size. - The standard input stream. - bufferSize is less than or equal to zero. - - - Acquires the standard output stream. - The standard output stream. - - - Acquires the standard output stream, which is set to a specified buffer size. - The internal stream buffer size. - The standard output stream. - bufferSize is less than or equal to zero. - - - Gets the standard output stream. - A that represents the standard output stream. - - - Gets or sets the encoding the console uses to write output. - The encoding used to write console output. - The property value in a set operation is null. - An error occurred during the execution of this operation. - Your application does not have permission to perform this operation. - - - Reads the next character from the standard input stream. - The next character from the input stream, or negative one (-1) if there are currently no more characters to be read. - An I/O error occurred. - - - Obtains the next character or function key pressed by the user. The pressed key is displayed in the console window. - An object that describes the constant and Unicode character, if any, that correspond to the pressed console key. The object also describes, in a bitwise combination of values, whether one or more Shift, Alt, or Ctrl modifier keys was pressed simultaneously with the console key. - The property is redirected from some stream other than the console. - - - Obtains the next character or function key pressed by the user. The pressed key is optionally displayed in the console window. - Determines whether to display the pressed key in the console window. true to not display the pressed key; otherwise, false. - An object that describes the constant and Unicode character, if any, that correspond to the pressed console key. The object also describes, in a bitwise combination of values, whether one or more Shift, Alt, or Ctrl modifier keys was pressed simultaneously with the console key. - The property is redirected from some stream other than the console. - - - Reads the next line of characters from the standard input stream. - The next line of characters from the input stream, or null if no more lines are available. - An I/O error occurred. - There is insufficient memory to allocate a buffer for the returned string. - The number of characters in the next line of characters is greater than . - - - Sets the foreground and background console colors to their defaults. - The user does not have permission to perform this action. - An I/O error occurred. - - - Sets the height and width of the screen buffer area to the specified values. - The width of the buffer area measured in columns. - The height of the buffer area measured in rows. - height or width is less than or equal to zero. -or- height or width is greater than or equal to . -or- width is less than + . -or- height is less than + . - The user does not have permission to perform this action. - An I/O error occurred. - - - Sets the position of the cursor. - The column position of the cursor. Columns are numbered from left to right starting at 0. - The row position of the cursor. Rows are numbered from top to bottom starting at 0. - left or top is less than zero. -or- left is greater than or equal to . -or- top is greater than or equal to . - The user does not have permission to perform this action. - An I/O error occurred. - - - Sets the property to the specified object. - A stream that is the new standard error output. - newError is null. - The caller does not have the required permission. - - - Sets the property to the specified object. - A stream that is the new standard input. - newIn is null. - The caller does not have the required permission. - - - Sets the property to the specified object. - A stream that is the new standard output. - newOut is null. - The caller does not have the required permission. - - - Sets the position of the console window relative to the screen buffer. - The column position of the upper left corner of the console window. - The row position of the upper left corner of the console window. - left or top is less than zero. -or- left + is greater than . -or- top + is greater than . - The user does not have permission to perform this action. - An I/O error occurred. - - - Sets the height and width of the console window to the specified values. - The width of the console window measured in columns. - The height of the console window measured in rows. - width or height is less than or equal to zero. -or- width plus or height plus is greater than or equal to . -or- width or height is greater than the largest possible window width or height for the current screen resolution and console font. - The user does not have permission to perform this action. - An I/O error occurred. - - - Gets or sets the title to display in the console title bar. - The string to be displayed in the title bar of the console. The maximum length of the title string is 24500 characters. - In a get operation, the retrieved title is longer than 24500 characters. - In a set operation, the specified title is longer than 24500 characters. - In a set operation, the specified title is null. - An I/O error occurred. - - - Gets or sets a value indicating whether the combination of the modifier key and console key (Ctrl+C) is treated as ordinary input or as an interruption that is handled by the operating system. - true if Ctrl+C is treated as ordinary input; otherwise, false. - Unable to get or set the input mode of the console input buffer. - - - Gets or sets the height of the console window area. - The height of the console window measured in rows. - The value of the property or the value of the property is less than or equal to 0. -or- The value of the property plus the value of the property is greater than or equal to . -or- The value of the property or the value of the property is greater than the largest possible window width or height for the current screen resolution and console font. - Error reading or writing information. - - - Gets or sets the leftmost position of the console window area relative to the screen buffer. - The leftmost console window position measured in columns. - In a set operation, the value to be assigned is less than zero. -or- As a result of the assignment, plus would exceed . - Error reading or writing information. - - - Gets or sets the top position of the console window area relative to the screen buffer. - The uppermost console window position measured in rows. - In a set operation, the value to be assigned is less than zero. -or- As a result of the assignment, plus would exceed . - Error reading or writing information. - - - Gets or sets the width of the console window. - The width of the console window measured in columns. - The value of the property or the value of the property is less than or equal to 0. -or- The value of the property plus the value of the property is greater than or equal to . -or- The value of the property or the value of the property is greater than the largest possible window width or height for the current screen resolution and console font. - Error reading or writing information. - - - Writes the text representation of the specified objects and variable-length parameter list to the standard output stream using the specified format information. - A composite format string. - The first object to write using format. - The second object to write using format. - The third object to write using format. - The fourth object to write using format. - An I/O error occurred. - format is null. - The format specification in format is invalid. - - - Writes the text representation of the specified objects to the standard output stream using the specified format information. - A composite format string. - The first object to write using format. - The second object to write using format. - The third object to write using format. - An I/O error occurred. - format is null. - The format specification in format is invalid. - - - Writes the text representation of the specified objects to the standard output stream using the specified format information. - A composite format string. - The first object to write using format. - The second object to write using format. - An I/O error occurred. - format is null. - The format specification in format is invalid. - - - Writes the text representation of the specified array of objects to the standard output stream using the specified format information. - A composite format string. - An array of objects to write using format. - An I/O error occurred. - format or arg is null. - The format specification in format is invalid. - - - Writes the text representation of the specified object to the standard output stream using the specified format information. - A composite format string. - An object to write using format. - An I/O error occurred. - format is null. - The format specification in format is invalid. - - - Writes the text representation of the specified 64-bit unsigned integer value to the standard output stream. - The value to write. - An I/O error occurred. - - - Writes the text representation of the specified 32-bit unsigned integer value to the standard output stream. - The value to write. - An I/O error occurred. - - - Writes the specified string value to the standard output stream. - The value to write. - An I/O error occurred. - - - Writes the specified subarray of Unicode characters to the standard output stream. - An array of Unicode characters. - The starting position in buffer. - The number of characters to write. - buffer is null. - index or count is less than zero. - index plus count specify a position that is not within buffer. - An I/O error occurred. - - - Writes the text representation of the specified object to the standard output stream. - The value to write, or null. - An I/O error occurred. - - - Writes the text representation of the specified single-precision floating-point value to the standard output stream. - The value to write. - An I/O error occurred. - - - Writes the specified Unicode character value to the standard output stream. - The value to write. - An I/O error occurred. - - - Writes the specified array of Unicode characters to the standard output stream. - A Unicode character array. - An I/O error occurred. - - - Writes the text representation of the specified Boolean value to the standard output stream. - The value to write. - An I/O error occurred. - - - Writes the text representation of the specified double-precision floating-point value to the standard output stream. - The value to write. - An I/O error occurred. - - - Writes the text representation of the specified 32-bit signed integer value to the standard output stream. - The value to write. - An I/O error occurred. - - - Writes the text representation of the specified 64-bit signed integer value to the standard output stream. - The value to write. - An I/O error occurred. - - - Writes the text representation of the specified value to the standard output stream. - The value to write. - An I/O error occurred. - - - Writes the text representation of the specified objects, followed by the current line terminator, to the standard output stream using the specified format information. - A composite format string. - The first object to write using format. - The second object to write using format. - An I/O error occurred. - format is null. - The format specification in format is invalid. - - - Writes the specified string value, followed by the current line terminator, to the standard output stream. - The value to write. - An I/O error occurred. - - - Writes the specified subarray of Unicode characters, followed by the current line terminator, to the standard output stream. - An array of Unicode characters. - The starting position in buffer. - The number of characters to write. - buffer is null. - index or count is less than zero. - index plus count specify a position that is not within buffer. - An I/O error occurred. - - - Writes the text representation of the specified array of objects, followed by the current line terminator, to the standard output stream using the specified format information. - A composite format string. - An array of objects to write using format. - An I/O error occurred. - format or arg is null. - The format specification in format is invalid. - - - Writes the text representation of the specified object, followed by the current line terminator, to the standard output stream using the specified format information. - A composite format string. - An object to write using format. - An I/O error occurred. - format is null. - The format specification in format is invalid. - - - Writes the text representation of the specified 64-bit unsigned integer value, followed by the current line terminator, to the standard output stream. - The value to write. - An I/O error occurred. - - - Writes the text representation of the specified 32-bit unsigned integer value, followed by the current line terminator, to the standard output stream. - The value to write. - An I/O error occurred. - - - Writes the text representation of the specified single-precision floating-point value, followed by the current line terminator, to the standard output stream. - The value to write. - An I/O error occurred. - - - Writes the text representation of the specified value, followed by the current line terminator, to the standard output stream. - The value to write. - An I/O error occurred. - - - Writes the text representation of the specified 64-bit signed integer value, followed by the current line terminator, to the standard output stream. - The value to write. - An I/O error occurred. - - - Writes the text representation of the specified 32-bit signed integer value, followed by the current line terminator, to the standard output stream. - The value to write. - An I/O error occurred. - - - Writes the text representation of the specified double-precision floating-point value, followed by the current line terminator, to the standard output stream. - The value to write. - An I/O error occurred. - - - Writes the specified array of Unicode characters, followed by the current line terminator, to the standard output stream. - A Unicode character array. - An I/O error occurred. - - - Writes the specified Unicode character, followed by the current line terminator, value to the standard output stream. - The value to write. - An I/O error occurred. - - - Writes the text representation of the specified Boolean value, followed by the current line terminator, to the standard output stream. - The value to write. - An I/O error occurred. - - - Writes the current line terminator to the standard output stream. - An I/O error occurred. - - - Writes the text representation of the specified objects, followed by the current line terminator, to the standard output stream using the specified format information. - A composite format string. - The first object to write using format. - The second object to write using format. - The third object to write using format. - An I/O error occurred. - format is null. - The format specification in format is invalid. - - - Writes the text representation of the specified object, followed by the current line terminator, to the standard output stream. - The value to write. - An I/O error occurred. - - - Writes the text representation of the specified objects and variable-length parameter list, followed by the current line terminator, to the standard output stream using the specified format information. - A composite format string. - The first object to write using format. - The second object to write using format. - The third object to write using format. - The fourth object to write using format. - An I/O error occurred. - format is null. - The format specification in format is invalid. - - - Provides data for the event. This class cannot be inherited. - - - Gets or sets a value that indicates whether simultaneously pressing the modifier key and the console key (Ctrl+C) or the Ctrl+Break keys terminates the current process. The default is false, which terminates the current process. - true if the current process should resume when the event handler concludes; false if the current process should terminate. The default value is false; the current process terminates when the event handler returns. If true, the current process continues. - - - Gets the combination of modifier and console keys that interrupted the current process. - One of the enumeration values that specifies the key combination that interrupted the current process. There is no default value. - - - Represents the method that will handle the event of a . - The source of the event. - A object that contains the event data. - - - Specifies constants that define foreground and background colors for the console. - - - The color black. - - - - The color blue. - - - - The color cyan (blue-green). - - - - The color dark blue. - - - - The color dark cyan (dark blue-green). - - - - The color dark gray. - - - - The color dark green. - - - - The color dark magenta (dark purplish-red). - - - - The color dark red. - - - - The color dark yellow (ochre). - - - - The color gray. - - - - The color green. - - - - The color magenta (purplish-red). - - - - The color red. - - - - The color white. - - - - The color yellow. - - - - Specifies the standard keys on a console. - - - The A key. - - - - The Add key (the addition key on the numeric keypad). - - - - The Application key (Microsoft Natural Keyboard). - - - - The ATTN key. - - - - The B key. - - - - The BACKSPACE key. - - - - The Browser Back key (Windows 2000 or later). - - - - The Browser Favorites key (Windows 2000 or later). - - - - The Browser Forward key (Windows 2000 or later). - - - - The Browser Home key (Windows 2000 or later). - - - - The Browser Refresh key (Windows 2000 or later). - - - - The Browser Search key (Windows 2000 or later). - - - - The Browser Stop key (Windows 2000 or later). - - - - The C key. - - - - The CLEAR key. - - - - The CRSEL (CURSOR SELECT) key. - - - - The D key. - - - - The 0 key. - - - - The 1 key. - - - - The 2 key. - - - - The 3 key. - - - - The 4 key. - - - - The 5 key. - - - - The 6 key. - - - - The 7 key. - - - - The 8 key. - - - - The 9 key. - - - - The Decimal key (the decimal key on the numeric keypad). - - - - The DEL (DELETE) key. - - - - The Divide key (the division key on the numeric keypad). - - - - The DOWN ARROW key. - - - - The E key. - - - - The END key. - - - - The ENTER key. - - - - The ERASE EOF key. - - - - The ESC (ESCAPE) key. - - - - The EXECUTE key. - - - - The EXSEL (EXTEND SELECTION) key. - - - - The F key. - - - - The F1 key. - - - - The F10 key. - - - - The F11 key. - - - - The F12 key. - - - - The F13 key. - - - - The F14 key. - - - - The F15 key. - - - - The F16 key. - - - - The F17 key. - - - - The F18 key. - - - - The F19 key. - - - - The F2 key. - - - - The F20 key. - - - - The F21 key. - - - - The F22 key. - - - - The F23 key. - - - - The F24 key. - - - - The F3 key. - - - - The F4 key. - - - - The F5 key. - - - - The F6 key. - - - - The F7 key. - - - - The F8 key. - - - - The F9 key. - - - - The G key. - - - - The H key. - - - - The HELP key. - - - - The HOME key. - - - - The I key. - - - - The INS (INSERT) key. - - - - The J key. - - - - The K key. - - - - The L key. - - - - The Start Application 1 key (Microsoft Natural Keyboard, Windows 2000 or later). - - - - The Start Application 2 key (Microsoft Natural Keyboard, Windows 2000 or later). - - - - The Start Mail key (Microsoft Natural Keyboard, Windows 2000 or later). - - - - The Select Media key (Microsoft Natural Keyboard, Windows 2000 or later). - - - - The LEFT ARROW key. - - - - The left Windows logo key (Microsoft Natural Keyboard). - - - - The M key. - - - - The Media Next Track key (Windows 2000 or later). - - - - The Media Play/Pause key (Windows 2000 or later). - - - - The Media Previous Track key (Windows 2000 or later). - - - - The Media Stop key (Windows 2000 or later). - - - - The Multiply key (the multiplication key on the numeric keypad). - - - - The N key. - - - - A constant reserved for future use. - - - - The 0 key on the numeric keypad. - - - - The 1 key on the numeric keypad. - - - - The 2 key on the numeric keypad. - - - - The 3 key on the numeric keypad. - - - - The 4 key on the numeric keypad. - - - - The 5 key on the numeric keypad. - - - - The 6 key on the numeric keypad. - - - - The 7 key on the numeric keypad. - - - - The 8 key on the numeric keypad. - - - - The 9 key on the numeric keypad. - - - - The O key. - - - - The OEM 1 key (OEM specific). - - - - The OEM 102 key (OEM specific). - - - - The OEM 2 key (OEM specific). - - - - The OEM 3 key (OEM specific). - - - - The OEM 4 key (OEM specific). - - - - The OEM 5 (OEM specific). - - - - The OEM 6 key (OEM specific). - - - - The OEM 7 key (OEM specific). - - - - The OEM 8 key (OEM specific). - - - - The CLEAR key (OEM specific). - - - - The OEM Comma key on any country/region keyboard (Windows 2000 or later). - - - - The OEM Minus key on any country/region keyboard (Windows 2000 or later). - - - - The OEM Period key on any country/region keyboard (Windows 2000 or later). - - - - The OEM Plus key on any country/region keyboard (Windows 2000 or later). - - - - The P key. - - - - The PA1 key. - - - - The PACKET key (used to pass Unicode characters with keystrokes). - - - - The PAGE DOWN key. - - - - The PAGE UP key. - - - - The PAUSE key. - - - - The PLAY key. - - - - The PRINT key. - - - - The PRINT SCREEN key. - - - - The IME PROCESS key. - - - - The Q key. - - - - The R key. - - - - The RIGHT ARROW key. - - - - The right Windows logo key (Microsoft Natural Keyboard). - - - - The S key. - - - - The SELECT key. - - - - The Separator key. - - - - The Computer Sleep key. - - - - The SPACEBAR key. - - - - The Subtract key (the subtraction key on the numeric keypad). - - - - The T key. - - - - The TAB key. - - - - The U key. - - - - The UP ARROW key. - - - - The V key. - - - - The Volume Down key (Microsoft Natural Keyboard, Windows 2000 or later). - - - - The Volume Mute key (Microsoft Natural Keyboard, Windows 2000 or later). - - - - The Volume Up key (Microsoft Natural Keyboard, Windows 2000 or later). - - - - The W key. - - - - The X key. - - - - The Y key. - - - - The Z key. - - - - The ZOOM key. - - - - Describes the console key that was pressed, including the character represented by the console key and the state of the SHIFT, ALT, and CTRL modifier keys. - - - Initializes a new instance of the structure using the specified character, console key, and modifier keys. - The Unicode character that corresponds to the key parameter. - The console key that corresponds to the keyChar parameter. - true to indicate that a SHIFT key was pressed; otherwise, false. - true to indicate that an ALT key was pressed; otherwise, false. - true to indicate that a CTRL key was pressed; otherwise, false. - The numeric value of the key parameter is less than 0 or greater than 255. - - - Gets a value indicating whether the specified object is equal to the current object. - An object to compare to the current object. - true if obj is equal to the current object; otherwise, false. - - - Gets a value indicating whether the specified object is equal to the current object. - An object to compare to the current object. - true if value is a object and is equal to the current object; otherwise, false. - - - Returns the hash code for the current object. - A 32-bit signed integer hash code. - - - Gets the console key represented by the current object. - A value that identifies the console key that was pressed. - - - Gets the Unicode character represented by the current object. - An object that corresponds to the console key represented by the current object. - - - Gets a bitwise combination of values that specifies one or more modifier keys pressed simultaneously with the console key. - A bitwise combination of the enumeration values. There is no default value. - - - Indicates whether the specified objects are equal. - The first object to compare. - The second object to compare. - true if a is equal to b; otherwise, false. - - - Indicates whether the specified objects are not equal. - The first object to compare. - The second object to compare. - true if a is not equal to b; otherwise, false. - - - Represents the SHIFT, ALT, and CTRL modifier keys on a keyboard. - - - The left or right ALT modifier key. - - - - The left or right CTRL modifier key. - - - - The left or right SHIFT modifier key. - - - - Specifies combinations of modifier and console keys that can interrupt the current process. - - - The modifier key plus the BREAK console key. - - - - The modifier key plus the console key. - - - - Defines the base class for all context-bound classes. - - - Instantiates an instance of the class. - - - The exception that is thrown when an attempt to marshal an object across a context boundary fails. - - - Initializes a new instance of the class with default properties. - - - Initializes a new instance of the class with a specified error message. - The error message that explains the reason for the exception. - - - Initializes a new instance of the class with serialized data. - The that holds the serialized object data about the exception being thrown. - The that contains contextual information about the source or destination. - - - Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. - The error message that explains the reason for the exception. - The exception that is the cause of the current exception. If the inner parameter is not null, the current exception is raised in a catch block that handles the inner exception. - - - Indicates that the value of a static field is unique for a particular context. - - - Initializes a new instance of the class. - - - Converts a base data type to another base data type. - - - Returns an object of the specified type and whose value is equivalent to the specified object. - An object that implements the interface. - The type of object to return. - An object whose type is conversionType and whose value is equivalent to value. -or- A null reference (Nothing in Visual Basic), if value is null and conversionType is not a value type. - This conversion is not supported. -or- value is null and conversionType is a value type. -or- value does not implement the interface. - value is not in a format recognized by conversionType. - value represents a number that is out of the range of conversionType. - conversionType is null. - - - Returns an object of the specified type whose value is equivalent to the specified object. - An object that implements the interface. - The type of object to return. - An object whose underlying type is typeCode and whose value is equivalent to value. -or- A null reference (Nothing in Visual Basic), if value is null and typeCode is , , or . - This conversion is not supported. -or- value is null and typeCode specifies a value type. -or- value does not implement the interface. - value is not in a format recognized by the typeCode type. - value represents a number that is out of the range of the typeCode type. - typeCode is invalid. - - - Returns an object of the specified type whose value is equivalent to the specified object. A parameter supplies culture-specific formatting information. - An object that implements the interface. - The type of object to return. - An object that supplies culture-specific formatting information. - An object whose type is conversionType and whose value is equivalent to value. -or- value, if the of value and conversionType are equal. -or- A null reference (Nothing in Visual Basic), if value is null and conversionType is not a value type. - This conversion is not supported. -or- value is null and conversionType is a value type. -or- value does not implement the interface. - value is not in a format for conversionType recognized by provider. - value represents a number that is out of the range of conversionType. - conversionType is null. - - - Returns an object of the specified type whose value is equivalent to the specified object. A parameter supplies culture-specific formatting information. - An object that implements the interface. - The type of object to return. - An object that supplies culture-specific formatting information. - An object whose underlying type is typeCode and whose value is equivalent to value. -or- A null reference (Nothing in Visual Basic), if value is null and typeCode is , , or . - This conversion is not supported. -or- value is null and typeCode specifies a value type. -or- value does not implement the interface. - value is not in a format for the typeCode type recognized by provider. - value represents a number that is out of the range of the typeCode type. - typeCode is invalid. - - - A constant that represents a database column that is absent of data; that is, database null. - - - - Converts a subset of a Unicode character array, which encodes binary data as base-64 digits, to an equivalent 8-bit unsigned integer array. Parameters specify the subset in the input array and the number of elements to convert. - A Unicode character array. - A position within inArray. - The number of elements in inArray to convert. - An array of 8-bit unsigned integers equivalent to length elements at position offset in inArray. - inArray is null. - offset or length is less than 0. -or- offset plus length indicates a position not within inArray. - The length of inArray, ignoring white-space characters, is not zero or a multiple of 4. -or- The format of inArray is invalid. inArray contains a non-base-64 character, more than two padding characters, or a non-white-space character among the padding characters. - - - Converts the specified string, which encodes binary data as base-64 digits, to an equivalent 8-bit unsigned integer array. - The string to convert. - An array of 8-bit unsigned integers that is equivalent to s. - s is null. - The length of s, ignoring white-space characters, is not zero or a multiple of 4. -or- The format of s is invalid. s contains a non-base-64 character, more than two padding characters, or a non-white space-character among the padding characters. - - - Returns the for the specified object. - An object that implements the interface. - The for value, or if value is null. - - - Returns an indication whether the specified object is of type . - An object. - true if value is of type ; otherwise, false. - - - Converts a subset of an 8-bit unsigned integer array to an equivalent subset of a Unicode character array encoded with base-64 digits. Parameters specify the subsets as offsets in the input and output arrays, and the number of elements in the input array to convert. - An input array of 8-bit unsigned integers. - A position within inArray. - The number of elements of inArray to convert. - An output array of Unicode characters. - A position within outArray. - A 32-bit signed integer containing the number of bytes in outArray. - inArray or outArray is null. - offsetIn, offsetOut, or length is negative. -or- offsetIn plus length is greater than the length of inArray. -or- offsetOut plus the number of elements to return is greater than the length of outArray. - - - Converts a subset of an 8-bit unsigned integer array to an equivalent subset of a Unicode character array encoded with base-64 digits. Parameters specify the subsets as offsets in the input and output arrays, the number of elements in the input array to convert, and whether line breaks are inserted in the output array. - An input array of 8-bit unsigned integers. - A position within inArray. - The number of elements of inArray to convert. - An output array of Unicode characters. - A position within outArray. - to insert a line break every 76 characters, or to not insert line breaks. - A 32-bit signed integer containing the number of bytes in outArray. - inArray or outArray is null. - offsetIn, offsetOut, or length is negative. -or- offsetIn plus length is greater than the length of inArray. -or- offsetOut plus the number of elements to return is greater than the length of outArray. - options is not a valid value. - - - Converts a subset of an array of 8-bit unsigned integers to its equivalent string representation that is encoded with base-64 digits. Parameters specify the subset as an offset in the input array, the number of elements in the array to convert, and whether to insert line breaks in the return value. - An array of 8-bit unsigned integers. - An offset in inArray. - The number of elements of inArray to convert. - to insert a line break every 76 characters, or to not insert line breaks. - The string representation in base 64 of length elements of inArray, starting at position offset. - inArray is null. - offset or length is negative. -or- offset plus length is greater than the length of inArray. - options is not a valid value. - - - Converts a subset of an array of 8-bit unsigned integers to its equivalent string representation that is encoded with base-64 digits. Parameters specify the subset as an offset in the input array, and the number of elements in the array to convert. - An array of 8-bit unsigned integers. - An offset in inArray. - The number of elements of inArray to convert. - The string representation in base 64 of length elements of inArray, starting at position offset. - inArray is null. - offset or length is negative. -or- offset plus length is greater than the length of inArray. - - - Converts an array of 8-bit unsigned integers to its equivalent string representation that is encoded with base-64 digits. - An array of 8-bit unsigned integers. - The string representation, in base 64, of the contents of inArray. - inArray is null. - - - Converts an array of 8-bit unsigned integers to its equivalent string representation that is encoded with base-64 digits. A parameter specifies whether to insert line breaks in the return value. - An array of 8-bit unsigned integers. - to insert a line break every 76 characters, or to not insert line breaks. - The string representation in base 64 of the elements in inArray. - inArray is null. - options is not a valid value. - - - Converts the value of the specified 8-bit signed integer to an equivalent Boolean value. - The 8-bit signed integer to convert. - true if value is not zero; otherwise, false. - - - Converts the specified string representation of a logical value to its Boolean equivalent, using the specified culture-specific formatting information. - A string that contains the value of either or . - An object that supplies culture-specific formatting information. This parameter is ignored. - true if value equals , or false if value equals or null. - value is not equal to or . - - - Converts the value of the specified object to an equivalent Boolean value, using the specified culture-specific formatting information. - An object that implements the interface, or null. - An object that supplies culture-specific formatting information. - true or false, which reflects the value returned by invoking the method for the underlying type of value. If value is null, the method returns false. - value is a string that does not equal or . - value does not implement the interface. -or- The conversion of value to a is not supported. - - - Converts the value of the specified 64-bit unsigned integer to an equivalent Boolean value. - The 64-bit unsigned integer to convert. - true if value is not zero; otherwise, false. - - - Converts the value of the specified 32-bit unsigned integer to an equivalent Boolean value. - The 32-bit unsigned integer to convert. - true if value is not zero; otherwise, false. - - - Converts the value of the specified 16-bit unsigned integer to an equivalent Boolean value. - The 16-bit unsigned integer to convert. - true if value is not zero; otherwise, false. - - - Converts the specified string representation of a logical value to its Boolean equivalent. - A string that contains the value of either or . - true if value equals , or false if value equals or null. - value is not equal to or . - - - Converts the value of the specified single-precision floating-point number to an equivalent Boolean value. - The single-precision floating-point number to convert. - true if value is not zero; otherwise, false. - - - Converts the value of a specified object to an equivalent Boolean value. - An object that implements the interface, or null. - true or false, which reflects the value returned by invoking the method for the underlying type of value. If value is null, the method returns false. - value is a string that does not equal or . - value does not implement the interface. -or- The conversion of value to a is not supported. - - - Converts the value of the specified double-precision floating-point number to an equivalent Boolean value. - The double-precision floating-point number to convert. - true if value is not zero; otherwise, false. - - - Converts the value of the specified 32-bit signed integer to an equivalent Boolean value. - The 32-bit signed integer to convert. - true if value is not zero; otherwise, false. - - - Converts the value of the specified 16-bit signed integer to an equivalent Boolean value. - The 16-bit signed integer to convert. - true if value is not zero; otherwise, false. - - - Converts the value of the specified decimal number to an equivalent Boolean value. - The number to convert. - true if value is not zero; otherwise, false. - - - Calling this method always throws . - The date and time value to convert. - This conversion is not supported. No value is returned. - This conversion is not supported. - - - Calling this method always throws . - The Unicode character to convert. - This conversion is not supported. No value is returned. - This conversion is not supported. - - - Converts the value of the specified 8-bit unsigned integer to an equivalent Boolean value. - The 8-bit unsigned integer to convert. - true if value is not zero; otherwise, false. - - - Returns the specified Boolean value; no actual conversion is performed. - The Boolean value to return. - value is returned unchanged. - - - Converts the value of the specified 64-bit signed integer to an equivalent Boolean value. - The 64-bit signed integer to convert. - true if value is not zero; otherwise, false. - - - Converts the specified string representation of a number to an equivalent 8-bit unsigned integer. - A string that contains the number to convert. - An 8-bit unsigned integer that is equivalent to value, or zero if value is null. - value does not consist of an optional sign followed by a sequence of digits (0 through 9). - value represents a number that is less than or greater than . - - - Converts the value of the specified 16-bit unsigned integer to an equivalent 8-bit unsigned integer. - The 16-bit unsigned integer to convert. - An 8-bit unsigned integer that is equivalent to value. - value is greater than . - - - Converts the value of the specified 32-bit unsigned integer to an equivalent 8-bit unsigned integer. - The 32-bit unsigned integer to convert. - An 8-bit unsigned integer that is equivalent to value. - value is greater than . - - - Converts the string representation of a number in a specified base to an equivalent 8-bit unsigned integer. - A string that contains the number to convert. - The base of the number in value, which must be 2, 8, 10, or 16. - An 8-bit unsigned integer that is equivalent to the number in value, or 0 (zero) if value is null. - fromBase is not 2, 8, 10, or 16. -or- value, which represents a non-base 10 unsigned number, is prefixed with a negative sign. - value is . - value contains a character that is not a valid digit in the base specified by fromBase. The exception message indicates that there are no digits to convert if the first character in value is invalid; otherwise, the message indicates that value contains invalid trailing characters. - value, which represents a base 10 unsigned number, is prefixed with a negative sign. -or- value represents a number that is less than or greater than . - - - Converts the value of the specified object to an 8-bit unsigned integer, using the specified culture-specific formatting information. - An object that implements the interface. - An object that supplies culture-specific formatting information. - An 8-bit unsigned integer that is equivalent to value, or zero if value is null. - value is not in the property format for a value. - value does not implement . -or- Conversion from value to the type is not supported. - value represents a number that is less than or greater than . - - - Converts the specified string representation of a number to an equivalent 8-bit unsigned integer, using specified culture-specific formatting information. - A string that contains the number to convert. - An object that supplies culture-specific formatting information. - An 8-bit unsigned integer that is equivalent to value, or zero if value is null. - value does not consist of an optional sign followed by a sequence of digits (0 through 9). - value represents a number that is less than or greater than . - - - Converts the value of the specified single-precision floating-point number to an equivalent 8-bit unsigned integer. - A single-precision floating-point number. - value, rounded to the nearest 8-bit unsigned integer. If value is halfway between two whole numbers, the even number is returned; that is, 4.5 is converted to 4, and 5.5 is converted to 6. - value is greater than or less than . - - - Converts the value of the specified 64-bit unsigned integer to an equivalent 8-bit unsigned integer. - The 64-bit unsigned integer to convert. - An 8-bit unsigned integer that is equivalent to value. - value is greater than . - - - Converts the value of the specified 8-bit signed integer to an equivalent 8-bit unsigned integer. - The 8-bit signed integer to be converted. - An 8-bit unsigned integer that is equivalent to value. - value is less than . - - - Converts the value of the specified 16-bit signed integer to an equivalent 8-bit unsigned integer. - The 16-bit signed integer to convert. - An 8-bit unsigned integer that is equivalent to value. - value is less than or greater than . - - - Converts the value of the specified 64-bit signed integer to an equivalent 8-bit unsigned integer. - The 64-bit signed integer to convert. - An 8-bit unsigned integer that is equivalent to value. - value is less than or greater than . - - - Returns the specified 8-bit unsigned integer; no actual conversion is performed. - The 8-bit unsigned integer to return. - value is returned unchanged. - - - Converts the value of the specified Unicode character to the equivalent 8-bit unsigned integer. - The Unicode character to convert. - An 8-bit unsigned integer that is equivalent to value. - value represents a number that is greater than . - - - Calling this method always throws . - The date and time value to convert. - This conversion is not supported. No value is returned. - This conversion is not supported. - - - Converts the specified Boolean value to the equivalent 8-bit unsigned integer. - The Boolean value to convert. - The number 1 if value is true; otherwise, 0. - - - Converts the value of the specified double-precision floating-point number to an equivalent 8-bit unsigned integer. - The double-precision floating-point number to convert. - value, rounded to the nearest 8-bit unsigned integer. If value is halfway between two whole numbers, the even number is returned; that is, 4.5 is converted to 4, and 5.5 is converted to 6. - value is greater than or less than . - - - Converts the value of the specified 32-bit signed integer to an equivalent 8-bit unsigned integer. - The 32-bit signed integer to convert. - An 8-bit unsigned integer that is equivalent to value. - value is less than or greater than . - - - Converts the value of the specified decimal number to an equivalent 8-bit unsigned integer. - The number to convert. - value, rounded to the nearest 8-bit unsigned integer. If value is halfway between two whole numbers, the even number is returned; that is, 4.5 is converted to 4, and 5.5 is converted to 6. - value is greater than or less than . - - - Converts the value of the specified object to an 8-bit unsigned integer. - An object that implements the interface, or null. - An 8-bit unsigned integer that is equivalent to value, or zero if value is null. - value is not in the property format for a value. - value does not implement . -or- Conversion from value to the type is not supported. - value represents a number that is less than or greater than . - - - Converts the first character of a specified string to a Unicode character, using specified culture-specific formatting information. - A string of length 1 or null. - An object that supplies culture-specific formatting information. This parameter is ignored. - A Unicode character that is equivalent to the first and only character in value. - value is null. - The length of value is not 1. - - - Converts the value of the specified object to a Unicode character. - An object that implements the interface. - A Unicode character that is equivalent to value, or if value is null. - value is a null string. - value does not implement the interface. -or- The conversion of value to a is not supported. - value is less than or greater than . - - - Converts the value of the specified object to its equivalent Unicode character, using the specified culture-specific formatting information. - An object that implements the interface. - An object that supplies culture-specific formatting information. - A Unicode character that is equivalent to value, or if value is null. - value is a null string. - value does not implement the interface. -or- The conversion of value to a is not supported. - value is less than or greater than . - - - Converts the value of the specified 64-bit unsigned integer to its equivalent Unicode character. - The 64-bit unsigned integer to convert. - A Unicode character that is equivalent to value. - value is greater than . - - - Converts the value of the specified 32-bit unsigned integer to its equivalent Unicode character. - The 32-bit unsigned integer to convert. - A Unicode character that is equivalent to value. - value is greater than . - - - Converts the value of the specified 16-bit unsigned integer to its equivalent Unicode character. - The 16-bit unsigned integer to convert. - A Unicode character that is equivalent to value. - - - Converts the first character of a specified string to a Unicode character. - A string of length 1. - A Unicode character that is equivalent to the first and only character in value. - value is null. - The length of value is not 1. - - - Calling this method always throws . - The single-precision floating-point number to convert. - This conversion is not supported. No value is returned. - This conversion is not supported. - - - Converts the value of the specified 8-bit signed integer to its equivalent Unicode character. - The 8-bit signed integer to convert. - A Unicode character that is equivalent to value. - value is less than . - - - Converts the value of the specified 64-bit signed integer to its equivalent Unicode character. - The 64-bit signed integer to convert. - A Unicode character that is equivalent to value. - value is less than or greater than . - - - Converts the value of the specified 16-bit signed integer to its equivalent Unicode character. - The 16-bit signed integer to convert. - A Unicode character that is equivalent to value. - value is less than . - - - Calling this method always throws . - The double-precision floating-point number to convert. - This conversion is not supported. No value is returned. - This conversion is not supported. - - - Calling this method always throws . - The decimal number to convert. - This conversion is not supported. No value is returned. - This conversion is not supported. - - - Calling this method always throws . - The date and time value to convert. - This conversion is not supported. No value is returned. - This conversion is not supported. - - - Returns the specified Unicode character value; no actual conversion is performed. - The Unicode character to return. - value is returned unchanged. - - - Converts the value of the specified 8-bit unsigned integer to its equivalent Unicode character. - The 8-bit unsigned integer to convert. - A Unicode character that is equivalent to value. - - - Calling this method always throws . - The Boolean value to convert. - This conversion is not supported. No value is returned. - This conversion is not supported. - - - Converts the value of the specified 32-bit signed integer to its equivalent Unicode character. - The 32-bit signed integer to convert. - A Unicode character that is equivalent to value. - value is less than or greater than . - - - Calling this method always throws . - The single-precision floating-point value to convert. - This conversion is not supported. No value is returned. - This conversion is not supported. - - - Converts the specified string representation of a date and time to an equivalent date and time value. - The string representation of a date and time. - The date and time equivalent of the value of value, or the date and time equivalent of if value is null. - value is not a properly formatted date and time string. - - - Calling this method always throws . - The 16-bit unsigned integer to convert. - This conversion is not supported. No value is returned. - This conversion is not supported. - - - Converts the specified string representation of a number to an equivalent date and time, using the specified culture-specific formatting information. - A string that contains a date and time to convert. - An object that supplies culture-specific formatting information. - The date and time equivalent of the value of value, or the date and time equivalent of if value is null. - value is not a properly formatted date and time string. - - - Calling this method always throws . - The 64-bit unsigned integer to convert. - This conversion is not supported. No value is returned. - This conversion is not supported. - - - Converts the value of the specified object to a object, using the specified culture-specific formatting information. - An object that implements the interface. - An object that supplies culture-specific formatting information. - The date and time equivalent of the value of value, or the date and time equivalent of if value is null. - value is not a valid date and time value. - value does not implement the interface. -or- The conversion is not supported. - - - Calling this method always throws . - The 8-bit signed integer to convert. - This conversion is not supported. No value is returned. - This conversion is not supported. - - - Calling this method always throws . - The 32-bit unsigned integer to convert. - This conversion is not supported. No value is returned. - This conversion is not supported. - - - Converts the value of the specified object to a object. - An object that implements the interface, or null. - The date and time equivalent of the value of value, or a date and time equivalent of if value is null. - value is not a valid date and time value. - value does not implement the interface. -or- The conversion is not supported. - - - Calling this method always throws . - The double-precision floating-point value to convert. - This conversion is not supported. No value is returned. - This conversion is not supported. - - - Calling this method always throws . - The 32-bit signed integer to convert. - This conversion is not supported. No value is returned. - This conversion is not supported. - - - Calling this method always throws . - The Boolean value to convert. - This conversion is not supported. No value is returned. - This conversion is not supported. - - - Calling this method always throws . - The 8-bit unsigned integer to convert. - This conversion is not supported. No value is returned. - This conversion is not supported. - - - Calling this method always throws . - The Unicode character to convert. - This conversion is not supported. No value is returned. - This conversion is not supported. - - - Calling this method always throws . - The 64-bit signed integer to convert. - This conversion is not supported. No value is returned. - This conversion is not supported. - - - Calling this method always throws . - The number to convert. - This conversion is not supported. No value is returned. - This conversion is not supported. - - - Calling this method always throws . - The 16-bit signed integer to convert. - This conversion is not supported. No value is returned. - This conversion is not supported. - - - Returns the specified object; no actual conversion is performed. - A date and time value. - value is returned unchanged. - - - Converts the specified string representation of a number to an equivalent decimal number, using the specified culture-specific formatting information. - A string that contains a number to convert. - An object that supplies culture-specific formatting information. - A decimal number that is equivalent to the number in value, or 0 (zero) if value is null. - value is not a number in a valid format. - value represents a number that is less than or greater than . - - - Converts the value of the specified object to an equivalent decimal number, using the specified culture-specific formatting information. - An object that implements the interface. - An object that supplies culture-specific formatting information. - A decimal number that is equivalent to value, or 0 (zero) if value is null. - value is not in an appropriate format for a type. - value does not implement the interface. -or- The conversion is not supported. - value represents a number that is less than or greater than . - - - Converts the value of the specified 64-bit unsigned integer to an equivalent decimal number. - The 64-bit unsigned integer to convert. - A decimal number that is equivalent to value. - - - Converts the value of the specified 32-bit unsigned integer to an equivalent decimal number. - The 32-bit unsigned integer to convert. - A decimal number that is equivalent to value. - - - Converts the value of the specified 16-bit unsigned integer to an equivalent decimal number. - The 16-bit unsigned integer to convert. - The decimal number that is equivalent to value. - - - Converts the specified string representation of a number to an equivalent decimal number. - A string that contains a number to convert. - A decimal number that is equivalent to the number in value, or 0 (zero) if value is null. - value is not a number in a valid format. - value represents a number that is less than or greater than . - - - Converts the value of the specified 8-bit signed integer to the equivalent decimal number. - The 8-bit signed integer to convert. - A decimal number that is equivalent to value. - - - Converts the value of the specified object to an equivalent decimal number. - An object that implements the interface, or null. - A decimal number that is equivalent to value, or 0 (zero) if value is null. - value is not in an appropriate format for a type. - value does not implement the interface. -or- The conversion is not supported. - value represents a number that is less than or greater than . - - - Converts the value of the specified single-precision floating-point number to the equivalent decimal number. - The single-precision floating-point number to convert. - A decimal number that is equivalent to value. - value is greater than or less than . - - - Converts the value of the specified 32-bit signed integer to an equivalent decimal number. - The 32-bit signed integer to convert. - A decimal number that is equivalent to value. - - - Converts the specified Boolean value to the equivalent decimal number. - The Boolean value to convert. - The number 1 if value is true; otherwise, 0. - - - Converts the value of the specified 8-bit unsigned integer to the equivalent decimal number. - The 8-bit unsigned integer to convert. - The decimal number that is equivalent to value. - - - Calling this method always throws . - The Unicode character to convert. - This conversion is not supported. No value is returned. - This conversion is not supported. - - - Converts the value of the specified 64-bit signed integer to an equivalent decimal number. - The 64-bit signed integer to convert. - A decimal number that is equivalent to value. - - - Returns the specified decimal number; no actual conversion is performed. - A decimal number. - value is returned unchanged. - - - Converts the value of the specified double-precision floating-point number to an equivalent decimal number. - The double-precision floating-point number to convert. - A decimal number that is equivalent to value. - value is greater than or less than . - - - Converts the value of the specified 16-bit signed integer to an equivalent decimal number. - The 16-bit signed integer to convert. - A decimal number that is equivalent to value. - - - Calling this method always throws . - The date and time value to convert. - This conversion is not supported. No value is returned. - This conversion is not supported. - - - Converts the value of the specified 8-bit signed integer to the equivalent double-precision floating-point number. - The 8-bit signed integer to convert. - The 8-bit signed integer that is equivalent to value. - - - Converts the value of the specified object to an double-precision floating-point number, using the specified culture-specific formatting information. - An object that implements the interface. - An object that supplies culture-specific formatting information. - A double-precision floating-point number that is equivalent to value, or zero if value is null. - value is not in an appropriate format for a type. - value does not implement the interface. - value represents a number that is less than or greater than . - - - Converts the value of the specified 64-bit unsigned integer to an equivalent double-precision floating-point number. - The 64-bit unsigned integer to convert. - A double-precision floating-point number that is equivalent to value. - - - Converts the value of the specified 32-bit unsigned integer to an equivalent double-precision floating-point number. - The 32-bit unsigned integer to convert. - A double-precision floating-point number that is equivalent to value. - - - Converts the value of the specified 16-bit unsigned integer to the equivalent double-precision floating-point number. - The 16-bit unsigned integer to convert. - A double-precision floating-point number that is equivalent to value. - - - Converts the specified string representation of a number to an equivalent double-precision floating-point number. - A string that contains the number to convert. - A double-precision floating-point number that is equivalent to the number in value, or 0 (zero) if value is null. - value is not a number in a valid format. - value represents a number that is less than or greater than . - - - Converts the value of the specified single-precision floating-point number to an equivalent double-precision floating-point number. - The single-precision floating-point number. - A double-precision floating-point number that is equivalent to value. - - - Converts the specified string representation of a number to an equivalent double-precision floating-point number, using the specified culture-specific formatting information. - A string that contains the number to convert. - An object that supplies culture-specific formatting information. - A double-precision floating-point number that is equivalent to the number in value, or 0 (zero) if value is null. - value is not a number in a valid format. - value represents a number that is less than or greater than . - - - Converts the value of the specified object to a double-precision floating-point number. - An object that implements the interface, or null. - A double-precision floating-point number that is equivalent to value, or zero if value is null. - value is not in an appropriate format for a type. - value does not implement the interface. -or- The conversion is not supported. - value represents a number that is less than or greater than . - - - Converts the value of the specified 32-bit signed integer to an equivalent double-precision floating-point number. - The 32-bit signed integer to convert. - A double-precision floating-point number that is equivalent to value. - - - Converts the specified Boolean value to the equivalent double-precision floating-point number. - The Boolean value to convert. - The number 1 if value is true; otherwise, 0. - - - Converts the value of the specified 8-bit unsigned integer to the equivalent double-precision floating-point number. - The 8-bit unsigned integer to convert. - The double-precision floating-point number that is equivalent to value. - - - Calling this method always throws . - The Unicode character to convert. - This conversion is not supported. No value is returned. - This conversion is not supported. - - - Converts the value of the specified 64-bit signed integer to an equivalent double-precision floating-point number. - The 64-bit signed integer to convert. - A double-precision floating-point number that is equivalent to value. - - - Converts the value of the specified decimal number to an equivalent double-precision floating-point number. - The decimal number to convert. - A double-precision floating-point number that is equivalent to value. - - - Returns the specified double-precision floating-point number; no actual conversion is performed. - The double-precision floating-point number to return. - value is returned unchanged. - - - Converts the value of the specified 16-bit signed integer to an equivalent double-precision floating-point number. - The 16-bit signed integer to convert. - A double-precision floating-point number equivalent to value. - - - Calling this method always throws . - The date and time value to convert. - This conversion is not supported. No value is returned. - This conversion is not supported. - - - Converts the value of the specified 8-bit signed integer to the equivalent 16-bit signed integer. - The 8-bit signed integer to convert. - A 8-bit signed integer that is equivalent to value. - - - Converts the specified string representation of a number to an equivalent 16-bit signed integer, using the specified culture-specific formatting information. - A string that contains the number to convert. - An object that supplies culture-specific formatting information. - A 16-bit signed integer that is equivalent to the number in value, or 0 (zero) if value is null. - value does not consist of an optional sign followed by a sequence of digits (0 through 9). - value represents a number that is less than or greater than . - - - Converts the value of the specified object to a 16-bit signed integer, using the specified culture-specific formatting information. - An object that implements the interface. - An object that supplies culture-specific formatting information. - A 16-bit signed integer that is equivalent to value, or zero if value is null. - value is not in an appropriate format for an type. - value does not implement . - value represents a number that is less than or greater than . - - - Converts the value of the specified 64-bit unsigned integer to an equivalent 16-bit signed integer. - The 64-bit unsigned integer to convert. - A 16-bit signed integer that is equivalent to value. - value is greater than . - - - Converts the value of the specified 32-bit unsigned integer to an equivalent 16-bit signed integer. - The 32-bit unsigned integer to convert. - A 16-bit signed integer that is equivalent to value. - value is greater than . - - - Converts the value of the specified 16-bit unsigned integer to the equivalent 16-bit signed integer. - The 16-bit unsigned integer to convert. - A 16-bit signed integer that is equivalent to value. - value is greater than . - - - Converts the specified string representation of a number to an equivalent 16-bit signed integer. - A string that contains the number to convert. - A 16-bit signed integer that is equivalent to the number in value, or 0 (zero) if value is null. - value does not consist of an optional sign followed by a sequence of digits (0 through 9). - value represents a number that is less than or greater than . - - - Converts the value of the specified single-precision floating-point number to an equivalent 16-bit signed integer. - The single-precision floating-point number to convert. - value, rounded to the nearest 16-bit signed integer. If value is halfway between two whole numbers, the even number is returned; that is, 4.5 is converted to 4, and 5.5 is converted to 6. - value is greater than or less than . - - - Converts the string representation of a number in a specified base to an equivalent 16-bit signed integer. - A string that contains the number to convert. - The base of the number in value, which must be 2, 8, 10, or 16. - A 16-bit signed integer that is equivalent to the number in value, or 0 (zero) if value is null. - fromBase is not 2, 8, 10, or 16. -or- value, which represents a non-base 10 signed number, is prefixed with a negative sign. - value is . - value contains a character that is not a valid digit in the base specified by fromBase. The exception message indicates that there are no digits to convert if the first character in value is invalid; otherwise, the message indicates that value contains invalid trailing characters. - value, which represents a non-base 10 signed number, is prefixed with a negative sign. -or- value represents a number that is less than or greater than . - - - Converts the value of the specified object to a 16-bit signed integer. - An object that implements the interface, or null. - A 16-bit signed integer that is equivalent to value, or zero if value is null. - value is not in an appropriate format for an type. - value does not implement the interface. -or- The conversion is not supported. - value represents a number that is less than or greater than . - - - Converts the value of the specified 32-bit signed integer to an equivalent 16-bit signed integer. - The 32-bit signed integer to convert. - The 16-bit signed integer equivalent of value. - value is greater than or less than . - - - Returns the specified 16-bit signed integer; no actual conversion is performed. - The 16-bit signed integer to return. - value is returned unchanged. - - - Converts the value of the specified double-precision floating-point number to an equivalent 16-bit signed integer. - The double-precision floating-point number to convert. - value, rounded to the nearest 16-bit signed integer. If value is halfway between two whole numbers, the even number is returned; that is, 4.5 is converted to 4, and 5.5 is converted to 6. - value is greater than or less than . - - - Converts the value of the specified decimal number to an equivalent 16-bit signed integer. - The decimal number to convert. - value, rounded to the nearest 16-bit signed integer. If value is halfway between two whole numbers, the even number is returned; that is, 4.5 is converted to 4, and 5.5 is converted to 6. - value is greater than or less than . - - - Calling this method always throws . - The date and time value to convert. - This conversion is not supported. No value is returned. - This conversion is not supported. - - - Converts the value of the specified Unicode character to the equivalent 16-bit signed integer. - The Unicode character to convert. - A 16-bit signed integer that is equivalent to value. - value is greater than . - - - Converts the value of the specified 8-bit unsigned integer to the equivalent 16-bit signed integer. - The 8-bit unsigned integer to convert. - A 16-bit signed integer that is equivalent to value. - - - Converts the specified Boolean value to the equivalent 16-bit signed integer. - The Boolean value to convert. - The number 1 if value is true; otherwise, 0. - - - Converts the value of the specified 64-bit signed integer to an equivalent 16-bit signed integer. - The 64-bit signed integer to convert. - A 16-bit signed integer that is equivalent to value. - value is greater than or less than . - - - Converts the value of the specified single-precision floating-point number to an equivalent 32-bit signed integer. - The single-precision floating-point number to convert. - value, rounded to the nearest 32-bit signed integer. If value is halfway between two whole numbers, the even number is returned; that is, 4.5 is converted to 4, and 5.5 is converted to 6. - value is greater than or less than . - - - Converts the value of the specified 16-bit unsigned integer to the equivalent 32-bit signed integer. - The 16-bit unsigned integer to convert. - A 32-bit signed integer that is equivalent to value. - - - Converts the value of the specified 32-bit unsigned integer to an equivalent 32-bit signed integer. - The 32-bit unsigned integer to convert. - A 32-bit signed integer that is equivalent to value. - value is greater than . - - - Converts the value of the specified 8-bit signed integer to the equivalent 32-bit signed integer. - The 8-bit signed integer to convert. - A 8-bit signed integer that is equivalent to value. - - - Converts the value of the specified object to a 32-bit signed integer, using the specified culture-specific formatting information. - An object that implements the interface. - An object that supplies culture-specific formatting information. - A 32-bit signed integer that is equivalent to value, or zero if value is null. - value is not in an appropriate format. - value does not implement . - value represents a number that is less than or greater than . - - - Converts the specified string representation of a number to an equivalent 32-bit signed integer, using the specified culture-specific formatting information. - A string that contains the number to convert. - An object that supplies culture-specific formatting information. - A 32-bit signed integer that is equivalent to the number in value, or 0 (zero) if value is null. - value does not consist of an optional sign followed by a sequence of digits (0 through 9). - value represents a number that is less than or greater than . - - - Converts the string representation of a number in a specified base to an equivalent 32-bit signed integer. - A string that contains the number to convert. - The base of the number in value, which must be 2, 8, 10, or 16. - A 32-bit signed integer that is equivalent to the number in value, or 0 (zero) if value is null. - fromBase is not 2, 8, 10, or 16. -or- value, which represents a non-base 10 signed number, is prefixed with a negative sign. - value is . - value contains a character that is not a valid digit in the base specified by fromBase. The exception message indicates that there are no digits to convert if the first character in value is invalid; otherwise, the message indicates that value contains invalid trailing characters. - value, which represents a non-base 10 signed number, is prefixed with a negative sign. -or- value represents a number that is less than or greater than . - - - Converts the value of the specified 64-bit unsigned integer to an equivalent 32-bit signed integer. - The 64-bit unsigned integer to convert. - A 32-bit signed integer that is equivalent to value. - value is greater than . - - - Converts the value of the specified object to a 32-bit signed integer. - An object that implements the interface, or null. - A 32-bit signed integer equivalent to value, or zero if value is null. - value is not in an appropriate format. - value does not implement the interface. -or- The conversion is not supported. - value represents a number that is less than or greater than . - - - Converts the specified string representation of a number to an equivalent 32-bit signed integer. - A string that contains the number to convert. - A 32-bit signed integer that is equivalent to the number in value, or 0 (zero) if value is null. - value does not consist of an optional sign followed by a sequence of digits (0 through 9). - value represents a number that is less than or greater than . - - - Returns the specified 32-bit signed integer; no actual conversion is performed. - The 32-bit signed integer to return. - value is returned unchanged. - - - Converts the value of the specified 8-bit unsigned integer to the equivalent 32-bit signed integer. - The 8-bit unsigned integer to convert. - A 32-bit signed integer that is equivalent to value. - - - Converts the value of the specified Unicode character to the equivalent 32-bit signed integer. - The Unicode character to convert. - A 32-bit signed integer that is equivalent to value. - - - Calling this method always throws . - The date and time value to convert. - This conversion is not supported. No value is returned. - This conversion is not supported. - - - Converts the specified Boolean value to the equivalent 32-bit signed integer. - The Boolean value to convert. - The number 1 if value is true; otherwise, 0. - - - Converts the value of the specified double-precision floating-point number to an equivalent 32-bit signed integer. - The double-precision floating-point number to convert. - value, rounded to the nearest 32-bit signed integer. If value is halfway between two whole numbers, the even number is returned; that is, 4.5 is converted to 4, and 5.5 is converted to 6. - value is greater than or less than . - - - Converts the value of the specified 64-bit signed integer to an equivalent 32-bit signed integer. - The 64-bit signed integer to convert. - A 32-bit signed integer that is equivalent to value. - value is greater than or less than . - - - Converts the value of the specified 16-bit signed integer to an equivalent 32-bit signed integer. - The 16-bit signed integer to convert. - A 32-bit signed integer that is equivalent to value. - - - Converts the value of the specified decimal number to an equivalent 32-bit signed integer. - The decimal number to convert. - value, rounded to the nearest 32-bit signed integer. If value is halfway between two whole numbers, the even number is returned; that is, 4.5 is converted to 4, and 5.5 is converted to 6. - value is greater than or less than . - - - Converts the value of the specified single-precision floating-point number to an equivalent 64-bit signed integer. - The single-precision floating-point number to convert. - value, rounded to the nearest 64-bit signed integer. If value is halfway between two whole numbers, the even number is returned; that is, 4.5 is converted to 4, and 5.5 is converted to 6. - value is greater than or less than . - - - Converts the string representation of a number in a specified base to an equivalent 64-bit signed integer. - A string that contains the number to convert. - The base of the number in value, which must be 2, 8, 10, or 16. - A 64-bit signed integer that is equivalent to the number in value, or 0 (zero) if value is null. - fromBase is not 2, 8, 10, or 16. -or- value, which represents a non-base 10 signed number, is prefixed with a negative sign. - value is . - value contains a character that is not a valid digit in the base specified by fromBase. The exception message indicates that there are no digits to convert if the first character in value is invalid; otherwise, the message indicates that value contains invalid trailing characters. - value, which represents a non-base 10 signed number, is prefixed with a negative sign. -or- value represents a number that is less than or greater than . - - - Converts the specified string representation of a number to an equivalent 64-bit signed integer, using the specified culture-specific formatting information. - A string that contains the number to convert. - An object that supplies culture-specific formatting information. - A 64-bit signed integer that is equivalent to the number in value, or 0 (zero) if value is null. - value does not consist of an optional sign followed by a sequence of digits (0 through 9). - value represents a number that is less than or greater than . - - - Converts the value of the specified object to a 64-bit signed integer, using the specified culture-specific formatting information. - An object that implements the interface. - An object that supplies culture-specific formatting information. - A 64-bit signed integer that is equivalent to value, or zero if value is null. - value is not in an appropriate format. - value does not implement the interface. -or- The conversion is not supported. - value represents a number that is less than or greater than . - - - Converts the value of the specified 64-bit unsigned integer to an equivalent 64-bit signed integer. - The 64-bit unsigned integer to convert. - A 64-bit signed integer that is equivalent to value. - value is greater than . - - - Converts the value of the specified 32-bit unsigned integer to an equivalent 64-bit signed integer. - The 32-bit unsigned integer to convert. - A 64-bit signed integer that is equivalent to value. - - - Converts the value of the specified 16-bit unsigned integer to the equivalent 64-bit signed integer. - The 16-bit unsigned integer to convert. - A 64-bit signed integer that is equivalent to value. - - - Converts the specified string representation of a number to an equivalent 64-bit signed integer. - A string that contains a number to convert. - A 64-bit signed integer that is equivalent to the number in value, or 0 (zero) if value is null. - value does not consist of an optional sign followed by a sequence of digits (0 through 9). - value represents a number that is less than or greater than . - - - Converts the value of the specified 8-bit signed integer to the equivalent 64-bit signed integer. - The 8-bit signed integer to convert. - A 64-bit signed integer that is equivalent to value. - - - Converts the value of the specified object to a 64-bit signed integer. - An object that implements the interface, or null. - A 64-bit signed integer that is equivalent to value, or zero if value is null. - value is not in an appropriate format. - value does not implement the interface. -or- The conversion is not supported. - value represents a number that is less than or greater than . - - - Returns the specified 64-bit signed integer; no actual conversion is performed. - A 64-bit signed integer. - value is returned unchanged. - - - Converts the value of the specified 8-bit unsigned integer to the equivalent 64-bit signed integer. - The 8-bit unsigned integer to convert. - A 64-bit signed integer that is equivalent to value. - - - Converts the value of the specified Unicode character to the equivalent 64-bit signed integer. - The Unicode character to convert. - A 64-bit signed integer that is equivalent to value. - - - Calling this method always throws . - The date and time value to convert. - This conversion is not supported. No value is returned. - This conversion is not supported. - - - Converts the specified Boolean value to the equivalent 64-bit signed integer. - The Boolean value to convert. - The number 1 if value is true; otherwise, 0. - - - Converts the value of the specified double-precision floating-point number to an equivalent 64-bit signed integer. - The double-precision floating-point number to convert. - value, rounded to the nearest 64-bit signed integer. If value is halfway between two whole numbers, the even number is returned; that is, 4.5 is converted to 4, and 5.5 is converted to 6. - value is greater than or less than . - - - Converts the value of the specified 16-bit signed integer to an equivalent 64-bit signed integer. - The 16-bit signed integer to convert. - A 64-bit signed integer that is equivalent to value. - - - Converts the value of the specified 32-bit signed integer to an equivalent 64-bit signed integer. - The 32-bit signed integer to convert. - A 64-bit signed integer that is equivalent to value. - - - Converts the value of the specified decimal number to an equivalent 64-bit signed integer. - The decimal number to convert. - value, rounded to the nearest 64-bit signed integer. If value is halfway between two whole numbers, the even number is returned; that is, 4.5 is converted to 4, and 5.5 is converted to 6. - value is greater than or less than . - - - Returns the specified 8-bit signed integer; no actual conversion is performed. - The 8-bit signed integer to return. - value is returned unchanged. - - - Converts the string representation of a number in a specified base to an equivalent 8-bit signed integer. - A string that contains the number to convert. - The base of the number in value, which must be 2, 8, 10, or 16. - An 8-bit signed integer that is equivalent to the number in value, or 0 (zero) if value is null. - fromBase is not 2, 8, 10, or 16. -or- value, which represents a non-base 10 signed number, is prefixed with a negative sign. - value is . - value contains a character that is not a valid digit in the base specified by fromBase. The exception message indicates that there are no digits to convert if the first character in value is invalid; otherwise, the message indicates that value contains invalid trailing characters. - value, which represents a non-base 10 signed number, is prefixed with a negative sign. -or- value represents a number that is less than or greater than . - - - Converts the specified string representation of a number to an equivalent 8-bit signed integer, using the specified culture-specific formatting information. - A string that contains the number to convert. - An object that supplies culture-specific formatting information. - An 8-bit signed integer that is equivalent to value. - value is null. - value does not consist of an optional sign followed by a sequence of digits (0 through 9). - value represents a number that is less than or greater than . - - - Converts the value of the specified object to an 8-bit signed integer, using the specified culture-specific formatting information. - An object that implements the interface. - An object that supplies culture-specific formatting information. - An 8-bit signed integer that is equivalent to value, or zero if value is null. - value is not in an appropriate format. - value does not implement the interface. -or- The conversion is not supported. - value represents a number that is less than or greater than . - - - Converts the value of the specified 64-bit unsigned integer to an equivalent 8-bit signed integer. - The 64-bit unsigned integer to convert. - An 8-bit signed integer that is equivalent to value. - value is greater than or less than . - - - Converts the value of the specified 32-bit unsigned integer to an equivalent 8-bit signed integer. - The 32-bit unsigned integer to convert. - An 8-bit signed integer that is equivalent to value. - value is greater than or less than . - - - Converts the specified string representation of a number to an equivalent 8-bit signed integer. - A string that contains the number to convert. - An 8-bit signed integer that is equivalent to the number in value, or 0 (zero) if value is null. - value does not consist of an optional sign followed by a sequence of digits (0 through 9). - value represents a number that is less than or greater than . - - - Converts the value of the specified single-precision floating-point number to an equivalent 8-bit signed integer. - The single-precision floating-point number to convert. - value, rounded to the nearest 8-bit signed integer. If value is halfway between two whole numbers, the even number is returned; that is, 4.5 is converted to 4, and 5.5 is converted to 6. - value is greater than or less than . - - - Converts the value of the specified object to an 8-bit signed integer. - An object that implements the interface, or null. - An 8-bit signed integer that is equivalent to value, or zero if value is null. - value is not in an appropriate format. - value does not implement the interface. -or- The conversion is not supported. - value represents a number that is less than or greater than . - - - Converts the value of the specified 16-bit unsigned integer to the equivalent 8-bit signed integer. - The 16-bit unsigned integer to convert. - An 8-bit signed integer that is equivalent to value. - value is greater than . - - - Converts the value of the specified 32-bit signed integer to an equivalent 8-bit signed integer. - The 32-bit signed integer to convert. - An 8-bit signed integer that is equivalent to value. - value is greater than or less than . - - - Converts the value of the specified 64-bit signed integer to an equivalent 8-bit signed integer. - The 64-bit signed integer to convert. - An 8-bit signed integer that is equivalent to value. - value is greater than or less than . - - - Converts the value of the specified 8-bit unsigned integer to the equivalent 8-bit signed integer. - The 8-bit unsigned integer to convert. - An 8-bit signed integer that is equivalent to value. - value is greater than . - - - Converts the value of the specified Unicode character to the equivalent 8-bit signed integer. - The Unicode character to convert. - An 8-bit signed integer that is equivalent to value. - value is greater than . - - - Calling this method always throws . - The date and time value to convert. - This conversion is not supported. No value is returned. - This conversion is not supported. - - - Converts the specified Boolean value to the equivalent 8-bit signed integer. - The Boolean value to convert. - The number 1 if value is true; otherwise, 0. - - - Converts the value of the specified double-precision floating-point number to an equivalent 8-bit signed integer. - The double-precision floating-point number to convert. - value, rounded to the nearest 8-bit signed integer. If value is halfway between two whole numbers, the even number is returned; that is, 4.5 is converted to 4, and 5.5 is converted to 6. - value is greater than or less than . - - - Converts the value of the specified 16-bit signed integer to the equivalent 8-bit signed integer. - The 16-bit signed integer to convert. - An 8-bit signed integer that is equivalent to value. - value is greater than or less than . - - - Converts the value of the specified decimal number to an equivalent 8-bit signed integer. - The decimal number to convert. - value, rounded to the nearest 8-bit signed integer. If value is halfway between two whole numbers, the even number is returned; that is, 4.5 is converted to 4, and 5.5 is converted to 6. - value is greater than or less than . - - - Converts the specified string representation of a number to an equivalent single-precision floating-point number, using the specified culture-specific formatting information. - A string that contains the number to convert. - An object that supplies culture-specific formatting information. - A single-precision floating-point number that is equivalent to the number in value, or 0 (zero) if value is null. - value is not a number in a valid format. - value represents a number that is less than or greater than . - - - Converts the value of the specified 8-bit signed integer to the equivalent single-precision floating-point number. - The 8-bit signed integer to convert. - An 8-bit signed integer that is equivalent to value. - - - Converts the value of the specified object to an single-precision floating-point number, using the specified culture-specific formatting information. - An object that implements the interface. - An object that supplies culture-specific formatting information. - A single-precision floating-point number that is equivalent to value, or zero if value is null. - value is not in an appropriate format. - value does not implement . - value represents a number that is less than or greater than . - - - Converts the value of the specified 64-bit unsigned integer to an equivalent single-precision floating-point number. - The 64-bit unsigned integer to convert. - A single-precision floating-point number that is equivalent to value. - - - Converts the value of the specified 32-bit unsigned integer to an equivalent single-precision floating-point number. - The 32-bit unsigned integer to convert. - A single-precision floating-point number that is equivalent to value. - - - Converts the specified string representation of a number to an equivalent single-precision floating-point number. - A string that contains the number to convert. - A single-precision floating-point number that is equivalent to the number in value, or 0 (zero) if value is null. - value is not a number in a valid format. - value represents a number that is less than or greater than . - - - Returns the specified single-precision floating-point number; no actual conversion is performed. - The single-precision floating-point number to return. - value is returned unchanged. - - - Converts the value of the specified object to a single-precision floating-point number. - An object that implements the interface, or null. - A single-precision floating-point number that is equivalent to value, or zero if value is null. - value is not in an appropriate format. - value does not implement the interface. -or- The conversion is not supported. - value represents a number that is less than or greater than . - - - Converts the value of the specified 16-bit unsigned integer to the equivalent single-precision floating-point number. - The 16-bit unsigned integer to convert. - A single-precision floating-point number that is equivalent to value. - - - Converts the value of the specified 32-bit signed integer to an equivalent single-precision floating-point number. - The 32-bit signed integer to convert. - A single-precision floating-point number that is equivalent to value. - - - Converts the value of the specified 16-bit signed integer to an equivalent single-precision floating-point number. - The 16-bit signed integer to convert. - A single-precision floating-point number that is equivalent to value. - - - Converts the value of the specified double-precision floating-point number to an equivalent single-precision floating-point number. - The double-precision floating-point number to convert. - A single-precision floating-point number that is equivalent to value. value is rounded using rounding to nearest. For example, when rounded to two decimals, the value 2.345 becomes 2.34 and the value 2.355 becomes 2.36. - - - Converts the value of the specified decimal number to an equivalent single-precision floating-point number. - The decimal number to convert. - A single-precision floating-point number that is equivalent to value. value is rounded using rounding to nearest. For example, when rounded to two decimals, the value 2.345 becomes 2.34 and the value 2.355 becomes 2.36. - - - Calling this method always throws . - The date and time value to convert. - This conversion is not supported. No value is returned. - This conversion is not supported. - - - Calling this method always throws . - The Unicode character to convert. - This conversion is not supported. No value is returned. - This conversion is not supported. - - - Converts the value of the specified 8-bit unsigned integer to the equivalent single-precision floating-point number. - The 8-bit unsigned integer to convert. - A single-precision floating-point number that is equivalent to value. - - - Converts the specified Boolean value to the equivalent single-precision floating-point number. - The Boolean value to convert. - The number 1 if value is true; otherwise, 0. - - - Converts the value of the specified 64-bit signed integer to an equivalent single-precision floating-point number. - The 64-bit signed integer to convert. - A single-precision floating-point number that is equivalent to value. - - - Converts the value of a 16-bit signed integer to its equivalent string representation in a specified base. - The 16-bit signed integer to convert. - The base of the return value, which must be 2, 8, 10, or 16. - The string representation of value in base toBase. - toBase is not 2, 8, 10, or 16. - - - Converts the value of the specified 16-bit signed integer to its equivalent string representation, using the specified culture-specific formatting information. - The 16-bit signed integer to convert. - An object that supplies culture-specific formatting information. - The string representation of value. - - - Converts the value of the specified to its equivalent string representation, using the specified culture-specific formatting information. - The date and time value to convert. - An object that supplies culture-specific formatting information. - The string representation of value. - - - Converts the value of the specified 64-bit unsigned integer to its equivalent string representation, using the specified culture-specific formatting information. - The 64-bit unsigned integer to convert. - An object that supplies culture-specific formatting information. - The string representation of value. - - - Converts the value of the specified decimal number to its equivalent string representation, using the specified culture-specific formatting information. - The decimal number to convert. - An object that supplies culture-specific formatting information. - The string representation of value. - - - Converts the value of the specified 32-bit signed integer to its equivalent string representation, using the specified culture-specific formatting information. - The 32-bit signed integer to convert. - An object that supplies culture-specific formatting information. - The string representation of value. - - - Converts the value of the specified double-precision floating-point number to its equivalent string representation. - The double-precision floating-point number to convert. - An object that supplies culture-specific formatting information. - The string representation of value. - - - Converts the value of a 32-bit signed integer to its equivalent string representation in a specified base. - The 32-bit signed integer to convert. - The base of the return value, which must be 2, 8, 10, or 16. - The string representation of value in base toBase. - toBase is not 2, 8, 10, or 16. - - - Converts the value of the specified 8-bit signed integer to its equivalent string representation, using the specified culture-specific formatting information. - The 8-bit signed integer to convert. - An object that supplies culture-specific formatting information. - The string representation of value. - - - Converts the value of a 64-bit signed integer to its equivalent string representation in a specified base. - The 64-bit signed integer to convert. - The base of the return value, which must be 2, 8, 10, or 16. - The string representation of value in base toBase. - toBase is not 2, 8, 10, or 16. - - - Converts the value of the specified object to its equivalent string representation using the specified culture-specific formatting information. - An object that supplies the value to convert, or null. - An object that supplies culture-specific formatting information. - The string representation of value, or if value is an object whose value is null. If value is null, the method returns null. - - - Converts the value of the specified single-precision floating-point number to its equivalent string representation, using the specified culture-specific formatting information. - The single-precision floating-point number to convert. - An object that supplies culture-specific formatting information. - The string representation of value. - - - Returns the specified string instance; no actual conversion is performed. - The string to return. - An object that supplies culture-specific formatting information. This parameter is ignored. - value is returned unchanged. - - - Converts the value of the specified 16-bit unsigned integer to its equivalent string representation, using the specified culture-specific formatting information. - The 16-bit unsigned integer to convert. - An object that supplies culture-specific formatting information. - The string representation of value. - - - Converts the value of the specified 32-bit unsigned integer to its equivalent string representation, using the specified culture-specific formatting information. - The 32-bit unsigned integer to convert. - An object that supplies culture-specific formatting information. - The string representation of value. - - - Converts the value of the specified Unicode character to its equivalent string representation, using the specified culture-specific formatting information. - The Unicode character to convert. - An object that supplies culture-specific formatting information. This parameter is ignored. - The string representation of value. - - - Converts the value of the specified 64-bit signed integer to its equivalent string representation, using the specified culture-specific formatting information. - The 64-bit signed integer to convert. - An object that supplies culture-specific formatting information. - The string representation of value. - - - Converts the value of an 8-bit unsigned integer to its equivalent string representation in a specified base. - The 8-bit unsigned integer to convert. - The base of the return value, which must be 2, 8, 10, or 16. - The string representation of value in base toBase. - toBase is not 2, 8, 10, or 16. - - - Converts the value of the specified 16-bit unsigned integer to its equivalent string representation. - The 16-bit unsigned integer to convert. - The string representation of value. - - - Converts the specified Boolean value to its equivalent string representation. - The Boolean value to convert. - An instance of an object. This parameter is ignored. - The string representation of value. - - - Converts the value of the specified 8-bit unsigned integer to its equivalent string representation, using the specified culture-specific formatting information. - The 8-bit unsigned integer to convert. - An object that supplies culture-specific formatting information. - The string representation of value. - - - Converts the specified Boolean value to its equivalent string representation. - The Boolean value to convert. - The string representation of value. - - - Converts the value of the specified 8-bit unsigned integer to its equivalent string representation. - The 8-bit unsigned integer to convert. - The string representation of value. - - - Converts the value of the specified Unicode character to its equivalent string representation. - The Unicode character to convert. - The string representation of value. - - - Converts the value of the specified decimal number to its equivalent string representation. - The decimal number to convert. - The string representation of value. - - - Converts the value of the specified double-precision floating-point number to its equivalent string representation. - The double-precision floating-point number to convert. - The string representation of value. - - - Converts the value of the specified 16-bit signed integer to its equivalent string representation. - The 16-bit signed integer to convert. - The string representation of value. - - - Converts the value of the specified to its equivalent string representation. - The date and time value to convert. - The string representation of value. - - - Converts the value of the specified 64-bit signed integer to its equivalent string representation. - The 64-bit signed integer to convert. - The string representation of value. - - - Converts the value of the specified object to its equivalent string representation. - An object that supplies the value to convert, or null. - The string representation of value, or if value is null. - - - Converts the value of the specified 8-bit signed integer to its equivalent string representation. - The 8-bit signed integer to convert. - The string representation of value. - - - Converts the value of the specified single-precision floating-point number to its equivalent string representation. - The single-precision floating-point number to convert. - The string representation of value. - - - Returns the specified string instance; no actual conversion is performed. - The string to return. - value is returned unchanged. - - - Converts the value of the specified 32-bit unsigned integer to its equivalent string representation. - The 32-bit unsigned integer to convert. - The string representation of value. - - - Converts the value of the specified 64-bit unsigned integer to its equivalent string representation. - The 64-bit unsigned integer to convert. - The string representation of value. - - - Converts the value of the specified 32-bit signed integer to its equivalent string representation. - The 32-bit signed integer to convert. - The string representation of value. - - - Converts the specified string representation of a number to an equivalent 16-bit unsigned integer. - A string that contains the number to convert. - A 16-bit unsigned integer that is equivalent to the number in value, or 0 (zero) if value is null. - value does not consist of an optional sign followed by a sequence of digits (0 through 9). - value represents a number that is less than or greater than . - - - Returns the specified 16-bit unsigned integer; no actual conversion is performed. - The 16-bit unsigned integer to return. - value is returned unchanged. - - - Converts the value of the specified 32-bit unsigned integer to an equivalent 16-bit unsigned integer. - The 32-bit unsigned integer to convert. - A 16-bit unsigned integer that is equivalent to value. - value is greater than . - - - Converts the string representation of a number in a specified base to an equivalent 16-bit unsigned integer. - A string that contains the number to convert. - The base of the number in value, which must be 2, 8, 10, or 16. - A 16-bit unsigned integer that is equivalent to the number in value, or 0 (zero) if value is null. - fromBase is not 2, 8, 10, or 16. -or- value, which represents a non-base 10 unsigned number, is prefixed with a negative sign. - value is . - value contains a character that is not a valid digit in the base specified by fromBase. The exception message indicates that there are no digits to convert if the first character in value is invalid; otherwise, the message indicates that value contains invalid trailing characters. - value, which represents a non-base 10 unsigned number, is prefixed with a negative sign. -or- value represents a number that is less than or greater than . - - - Converts the value of the specified object to a 16-bit unsigned integer, using the specified culture-specific formatting information. - An object that implements the interface. - An object that supplies culture-specific formatting information. - A 16-bit unsigned integer that is equivalent to value, or zero if value is null. - value is not in an appropriate format. - value does not implement the interface. -or- The conversion is not supported. - value represents a number that is less than or greater than . - - - Converts the specified string representation of a number to an equivalent 16-bit unsigned integer, using the specified culture-specific formatting information. - A string that contains the number to convert. - An object that supplies culture-specific formatting information. - A 16-bit unsigned integer that is equivalent to the number in value, or 0 (zero) if value is null. - value does not consist of an optional sign followed by a sequence of digits (0 through 9). - value represents a number that is less than or greater than . - - - Converts the value of the specified single-precision floating-point number to an equivalent 16-bit unsigned integer. - The single-precision floating-point number to convert. - value, rounded to the nearest 16-bit unsigned integer. If value is halfway between two whole numbers, the even number is returned; that is, 4.5 is converted to 4, and 5.5 is converted to 6. - value is less than zero or greater than . - - - Converts the value of the specified 64-bit unsigned integer to an equivalent 16-bit unsigned integer. - The 64-bit unsigned integer to convert. - A 16-bit unsigned integer that is equivalent to value. - value is greater than . - - - Converts the value of the specified 8-bit signed integer to the equivalent 16-bit unsigned integer. - The 8-bit signed integer to convert. - A 16-bit unsigned integer that is equivalent to value. - value is less than zero. - - - Converts the value of the specified double-precision floating-point number to an equivalent 16-bit unsigned integer. - The double-precision floating-point number to convert. - value, rounded to the nearest 16-bit unsigned integer. If value is halfway between two whole numbers, the even number is returned; that is, 4.5 is converted to 4, and 5.5 is converted to 6. - value is less than zero or greater than . - - - Converts the value of the specified 64-bit signed integer to an equivalent 16-bit unsigned integer. - The 64-bit signed integer to convert. - A 16-bit unsigned integer that is equivalent to value. - value is less than zero or greater than . - - - Converts the value of the specified object to a 16-bit unsigned integer. - An object that implements the interface, or null. - A 16-bit unsigned integer that is equivalent to value, or zero if value is null. - value is not in an appropriate format. - value does not implement the interface. -or- The conversion is not supported. - value represents a number that is less than or greater than . - - - Converts the value of the specified 8-bit unsigned integer to the equivalent 16-bit unsigned integer. - The 8-bit unsigned integer to convert. - A 16-bit unsigned integer that is equivalent to value. - - - Converts the value of the specified Unicode character to the equivalent 16-bit unsigned integer. - The Unicode character to convert. - The 16-bit unsigned integer equivalent to value. - - - Calling this method always throws . - The date and time value to convert. - This conversion is not supported. No value is returned. - This conversion is not supported. - - - Converts the specified Boolean value to the equivalent 16-bit unsigned integer. - The Boolean value to convert. - The number 1 if value is true; otherwise, 0. - - - Converts the value of the specified 16-bit signed integer to the equivalent 16-bit unsigned integer. - The 16-bit signed integer to convert. - A 16-bit unsigned integer that is equivalent to value. - value is less than zero. - - - Converts the value of the specified 32-bit signed integer to an equivalent 16-bit unsigned integer. - The 32-bit signed integer to convert. - A 16-bit unsigned integer that is equivalent to value. - value is less than zero or greater than . - - - Converts the value of the specified decimal number to an equivalent 16-bit unsigned integer. - The decimal number to convert. - value, rounded to the nearest 16-bit unsigned integer. If value is halfway between two whole numbers, the even number is returned; that is, 4.5 is converted to 4, and 5.5 is converted to 6. - value is less than zero or greater than . - - - Converts the value of the specified single-precision floating-point number to an equivalent 32-bit unsigned integer. - The single-precision floating-point number to convert. - value, rounded to the nearest 32-bit unsigned integer. If value is halfway between two whole numbers, the even number is returned; that is, 4.5 is converted to 4, and 5.5 is converted to 6. - value is less than zero or greater than . - - - Converts the string representation of a number in a specified base to an equivalent 32-bit unsigned integer. - A string that contains the number to convert. - The base of the number in value, which must be 2, 8, 10, or 16. - A 32-bit unsigned integer that is equivalent to the number in value, or 0 (zero) if value is null. - fromBase is not 2, 8, 10, or 16. -or- value, which represents a non-base 10 unsigned number, is prefixed with a negative sign. - value is . - value contains a character that is not a valid digit in the base specified by fromBase. The exception message indicates that there are no digits to convert if the first character in value is invalid; otherwise, the message indicates that value contains invalid trailing characters. - value, which represents a non-base 10 unsigned number, is prefixed with a negative sign. -or- value represents a number that is less than or greater than . - - - Converts the specified string representation of a number to an equivalent 32-bit unsigned integer, using the specified culture-specific formatting information. - A string that contains the number to convert. - An object that supplies culture-specific formatting information. - A 32-bit unsigned integer that is equivalent to the number in value, or 0 (zero) if value is null. - value does not consist of an optional sign followed by a sequence of digits (0 through 9). - value represents a number that is less than or greater than . - - - Converts the value of the specified object to a 32-bit unsigned integer, using the specified culture-specific formatting information. - An object that implements the interface. - An object that supplies culture-specific formatting information. - A 32-bit unsigned integer that is equivalent to value, or zero if value is null. - value is not in an appropriate format. - value does not implement the interface. -or- The conversion is not supported. - value represents a number that is less than or greater than . - - - Converts the value of the specified 64-bit unsigned integer to an equivalent 32-bit unsigned integer. - The 64-bit unsigned integer to convert. - A 32-bit unsigned integer that is equivalent to value. - value is greater than . - - - Returns the specified 32-bit unsigned integer; no actual conversion is performed. - The 32-bit unsigned integer to return. - value is returned unchanged. - - - Converts the value of the specified 16-bit unsigned integer to the equivalent 32-bit unsigned integer. - The 16-bit unsigned integer to convert. - A 32-bit unsigned integer that is equivalent to value. - - - Converts the specified string representation of a number to an equivalent 32-bit unsigned integer. - A string that contains the number to convert. - A 32-bit unsigned integer that is equivalent to the number in value, or 0 (zero) if value is null. - value does not consist of an optional sign followed by a sequence of digits (0 through 9). - value represents a number that is less than or greater than . - - - Converts the value of the specified 8-bit signed integer to the equivalent 32-bit unsigned integer. - The 8-bit signed integer to convert. - A 32-bit unsigned integer that is equivalent to value. - value is less than zero. - - - Converts the specified Boolean value to the equivalent 32-bit unsigned integer. - The Boolean value to convert. - The number 1 if value is true; otherwise, 0. - - - Converts the value of the specified 64-bit signed integer to an equivalent 32-bit unsigned integer. - The 64-bit signed integer to convert. - A 32-bit unsigned integer that is equivalent to value. - value is less than zero or greater than . - - - Converts the value of the specified 32-bit signed integer to an equivalent 32-bit unsigned integer. - The 32-bit signed integer to convert. - A 32-bit unsigned integer that is equivalent to value. - value is less than zero. - - - Converts the value of the specified 16-bit signed integer to the equivalent 32-bit unsigned integer. - The 16-bit signed integer to convert. - A 32-bit unsigned integer that is equivalent to value. - value is less than zero. - - - Converts the value of the specified double-precision floating-point number to an equivalent 32-bit unsigned integer. - The double-precision floating-point number to convert. - value, rounded to the nearest 32-bit unsigned integer. If value is halfway between two whole numbers, the even number is returned; that is, 4.5 is converted to 4, and 5.5 is converted to 6. - value is less than zero or greater than . - - - Converts the value of the specified decimal number to an equivalent 32-bit unsigned integer. - The decimal number to convert. - value, rounded to the nearest 32-bit unsigned integer. If value is halfway between two whole numbers, the even number is returned; that is, 4.5 is converted to 4, and 5.5 is converted to 6. - value is less than zero or greater than . - - - Calling this method always throws . - The date and time value to convert. - This conversion is not supported. No value is returned. - This conversion is not supported. - - - Converts the value of the specified Unicode character to the equivalent 32-bit unsigned integer. - The Unicode character to convert. - A 32-bit unsigned integer that is equivalent to value. - - - Converts the value of the specified 8-bit unsigned integer to the equivalent 32-bit unsigned integer. - The 8-bit unsigned integer to convert. - A 32-bit unsigned integer that is equivalent to value. - - - Converts the value of the specified object to a 32-bit unsigned integer. - An object that implements the interface, or null. - A 32-bit unsigned integer that is equivalent to value, or 0 (zero) if value is null. - value is not in an appropriate format. - value does not implement the interface. -or- The conversion is not supported. - value represents a number that is less than or greater than . - - - Converts the value of the specified single-precision floating-point number to an equivalent 64-bit unsigned integer. - The single-precision floating-point number to convert. - value, rounded to the nearest 64-bit unsigned integer. If value is halfway between two whole numbers, the even number is returned; that is, 4.5 is converted to 4, and 5.5 is converted to 6. - value is less than zero or greater than . - - - Converts the specified string representation of a number to an equivalent 64-bit unsigned integer. - A string that contains the number to convert. - A 64-bit signed integer that is equivalent to the number in value, or 0 (zero) if value is null. - value does not consist of an optional sign followed by a sequence of digits (0 through 9). - value represents a number that is less than or greater than . - - - Converts the value of the specified object to a 64-bit unsigned integer, using the specified culture-specific formatting information. - An object that implements the interface. - An object that supplies culture-specific formatting information. - A 64-bit unsigned integer that is equivalent to value, or zero if value is null. - value is not in an appropriate format. - value does not implement the interface. -or- The conversion is not supported. - value represents a number that is less than or greater than . - - - Converts the value of the specified 32-bit unsigned integer to an equivalent 64-bit unsigned integer. - The 32-bit unsigned integer to convert. - A 64-bit unsigned integer that is equivalent to value. - - - Returns the specified 64-bit unsigned integer; no actual conversion is performed. - The 64-bit unsigned integer to return. - value is returned unchanged. - - - Converts the value of the specified 8-bit signed integer to the equivalent 64-bit unsigned integer. - The 8-bit signed integer to convert. - A 64-bit unsigned integer that is equivalent to value. - value is less than zero. - - - Converts the value of the specified 16-bit unsigned integer to the equivalent 64-bit unsigned integer. - The 16-bit unsigned integer to convert. - A 64-bit unsigned integer that is equivalent to value. - - - Converts the value of the specified object to a 64-bit unsigned integer. - An object that implements the interface, or null. - A 64-bit unsigned integer that is equivalent to value, or zero if value is null. - value is not in an appropriate format. - value does not implement the interface. -or- The conversion is not supported. - value represents a number that is less than or greater than . - - - Converts the value of the specified decimal number to an equivalent 64-bit unsigned integer. - The decimal number to convert. - value, rounded to the nearest 64-bit unsigned integer. If value is halfway between two whole numbers, the even number is returned; that is, 4.5 is converted to 4, and 5.5 is converted to 6. - value is less than zero or greater than . - - - Converts the value of the specified 32-bit signed integer to an equivalent 64-bit unsigned integer. - The 32-bit signed integer to convert. - A 64-bit unsigned integer that is equivalent to value. - value is less than zero. - - - Converts the value of the specified 16-bit signed integer to the equivalent 64-bit unsigned integer. - The 16-bit signed integer to convert. - A 64-bit unsigned integer that is equivalent to value. - value is less than zero. - - - Converts the value of the specified double-precision floating-point number to an equivalent 64-bit unsigned integer. - The double-precision floating-point number to convert. - value, rounded to the nearest 64-bit unsigned integer. If value is halfway between two whole numbers, the even number is returned; that is, 4.5 is converted to 4, and 5.5 is converted to 6. - value is less than zero or greater than . - - - Calling this method always throws . - The date and time value to convert. - This conversion is not supported. No value is returned. - This conversion is not supported. - - - Converts the value of the specified Unicode character to the equivalent 64-bit unsigned integer. - The Unicode character to convert. - A 64-bit unsigned integer that is equivalent to value. - - - Converts the value of the specified 8-bit unsigned integer to the equivalent 64-bit unsigned integer. - The 8-bit unsigned integer to convert. - A 64-bit signed integer that is equivalent to value. - - - Converts the specified Boolean value to the equivalent 64-bit unsigned integer. - The Boolean value to convert. - The number 1 if value is true; otherwise, 0. - - - Converts the specified string representation of a number to an equivalent 64-bit unsigned integer, using the specified culture-specific formatting information. - A string that contains the number to convert. - An object that supplies culture-specific formatting information. - A 64-bit unsigned integer that is equivalent to the number in value, or 0 (zero) if value is null. - value does not consist of an optional sign followed by a sequence of digits (0 through 9). - value represents a number that is less than or greater than . - - - Converts the value of the specified 64-bit signed integer to an equivalent 64-bit unsigned integer. - The 64-bit signed integer to convert. - A 64-bit unsigned integer that is equivalent to value. - value is less than zero. - - - Converts the string representation of a number in a specified base to an equivalent 64-bit unsigned integer. - A string that contains the number to convert. - The base of the number in value, which must be 2, 8, 10, or 16. - A 64-bit unsigned integer that is equivalent to the number in value, or 0 (zero) if value is null. - fromBase is not 2, 8, 10, or 16. -or- value, which represents a non-base 10 unsigned number, is prefixed with a negative sign. - value is . - value contains a character that is not a valid digit in the base specified by fromBase. The exception message indicates that there are no digits to convert if the first character in value is invalid; otherwise, the message indicates that value contains invalid trailing characters. - value, which represents a non-base 10 unsigned number, is prefixed with a negative sign. -or- value represents a number that is less than or greater than . - - - Represents a method that converts an object from one type to another type. - The object to convert. - The type of object that is to be converted. - The type the input object is to be converted to. - - - - Determines the action that occurs when the or method is invoked on a with a . - - - Changes are cascaded across the relationship. - - - - No action occurs (default). - - - - Provides a description of the results of the query and its effect on the database. - - - When the command is executed, the associated Connection object is closed when the associated DataReader object is closed. - - - - The query may return multiple result sets. Execution of the query may affect the database state. Default sets no flags, so calling ExecuteReader(CommandBehavior.Default) is functionally equivalent to calling ExecuteReader(). - - - - The query returns column and primary key information. - - - - The query returns column information only. When using , the .NET Framework Data Provider for SQL Server precedes the statement being executed with SET FMTONLY ON. - - - - Provides a way for the DataReader to handle rows that contain columns with large binary values. Rather than loading the entire row, SequentialAccess enables the DataReader to load data as a stream. You can then use the GetBytes or GetChars method to specify a byte location to start the read operation, and a limited buffer size for the data being returned. - - - - The query returns a single result set. - - - - The query is expected to return a single row of the first result set. Execution of the query may affect the database state. Some .NET Framework data providers may, but are not required to, use this information to optimize the performance of the command. When you specify with the method of the object, the .NET Framework Data Provider for OLE DB performs binding using the OLE DB IRow interface if it is available. Otherwise, it uses the IRowset interface. If your SQL statement is expected to return only a single row, specifying can also improve application performance. It is possible to specify SingleRow when executing queries that are expected to return multiple result sets. In that case, where both a multi-result set SQL query and single row are specified, the result returned will contain only the first row of the first result set. The other result sets of the query will not be returned. - - - - Specifies how a command string is interpreted. - - - The name of a stored procedure. - - - - The name of a table. - - - - An SQL text command. (Default.) - - - - Indicates the position of the catalog name in a qualified table name in a text command. - - - Indicates that the position of the catalog name occurs after the schema portion of a fully qualified table name in a text command. - - - - Indicates that the position of the catalog name occurs before the schema portion of a fully qualified table name in a text command. - - - - Provides the base functionality for creating collections. - - - Initializes a new instance of the class. - - - Copies all the elements of the current to a one-dimensional , starting at the specified index. - The one-dimensional to copy the current object's elements into. - The destination index to start copying into. - - - Gets the total number of elements in a collection. - The total number of elements in a collection. - - - Gets an for the collection. - An for the collection. - - - Gets a value that indicates whether the is read-only. - true if the collection is read-only; otherwise, false. The default is false. - - - Gets a value that indicates whether the is synchonized. - true if the collection is synchronized; otherwise, false. The default is false. - - - Gets the items of the collection as a list. - An that contains the collection. - - - Gets an object that can be used to synchronize the collection. - The used to synchronize the collection. - - - Represents the exception that is thrown when incorrectly trying to create or access a relation. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with the specified string. - The string to display when the exception is thrown. - - - Initializes a new instance of the class with serialization information. - The data that is required to serialize or deserialize an object. - Description of the source and destination of the specified serialized stream. - - - Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. - The error message that explains the reason for the exception. - The exception that is the cause of the current exception, or a null reference (Nothing in Visual Basic) if no inner exception is specified. - - - Represents the exception that is thrown when you try to add a that contains an invalid to a . - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with the specified string. - The string to display when the exception is thrown. - - - Initializes a new instance of the class with the and the . - The data needed to serialize or deserialize an object. - The source and destination of a given serialized stream. - - - Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. - The error message that explains the reason for the exception. - The exception that is the cause of the current exception, or a null reference (Nothing in Visual Basic) if no inner exception is specified. - - - Specifies the transaction locking behavior for the connection. - - - The pending changes from more highly isolated transactions cannot be overwritten. - - - - Shared locks are held while the data is being read to avoid dirty reads, but the data can be changed before the end of the transaction, resulting in non-repeatable reads or phantom data. - - - - A dirty read is possible, meaning that no shared locks are issued and no exclusive locks are honored. - - - - Locks are placed on all data that is used in a query, preventing other users from updating the data. Prevents non-repeatable reads but phantom rows are still possible. - - - - A range lock is placed on the , preventing other users from updating or inserting rows into the dataset until the transaction is complete. - - - - Reduces blocking by storing a version of data that one application can read while another is modifying the same data. Indicates that from one transaction you cannot see changes made in other transactions, even if you requery. - - - - A different isolation level than the one specified is being used, but the level cannot be determined. - - - - Associates a source table with a table in a , and is implemented by the class, which is used in common by .NET Framework data providers. - - - Gets the derived for the . - A collection of data column mappings. - - - Gets or sets the case-insensitive name of the table within the . - The case-insensitive name of the table within the . - - - Gets or sets the case-sensitive name of the source table. - The case-sensitive name of the source table. - - - Contains a collection of TableMapping objects, and is implemented by the , which is used in common by .NET Framework data providers. - - - Adds a table mapping to the collection. - The case-sensitive name of the source table. - The name of the table. - A reference to the newly-mapped object. - - - Gets a value indicating whether the collection contains a table mapping with the specified source table name. - The case-sensitive name of the source table. - true if a table mapping with the specified source table name exists, otherwise false. - - - Gets the TableMapping object with the specified table name. - The name of the DataSet table within the collection. - The TableMapping object with the specified DataSet table name. - - - Gets the location of the object within the collection. - The case-sensitive name of the source table. - The zero-based location of the object within the collection. - - - Gets or sets the instance of with the specified name. - The SourceTable name of the . - The instance of with the specified SourceTable name. - - - Removes the object with the specified name from the collection. - The case-sensitive name of the SourceTable. - - - Identifies a list of connection string parameters identified by the KeyRestrictions property that are either allowed or not allowed. - - - Default. Identifies the only additional connection string parameters that are allowed. - - - - Identifies additional connection string parameters that are not allowed. - - - - Specifies the type of a parameter within a query relative to the . - - - The parameter is an input parameter. - - - - The parameter is capable of both input and output. - - - - The parameter is an output parameter. - - - - The parameter represents a return value from an operation such as a stored procedure, built-in function, or user-defined function. - - - - Represents a collection of properties that can be added to , , or . - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. - The data needed to serialize or deserialize an object. - The source and destination of a given serialized stream. - - - Creates a shallow copy of the object. - Returns , a shallow copy of the object. - - - Represents the exception that is thrown when you try to change the value of a read-only column. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with the specified string. - The string to display when the exception is thrown. - - - Initializes a new instance of the class with serialization information. - The data that is required to serialize or deserialize an object. - Description of the source and destination of the specified serialized stream. - - - Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. - The error message that explains the reason for the exception. - The exception that is the cause of the current exception, or a null reference (Nothing in Visual Basic) if no inner exception is specified. - - - Provides data for the state change event of a .NET Framework data provider. - - - Initializes a new instance of the class, when given the original state and the current state of the object. - One of the values. - One of the values. - - - Gets the new state of the connection. The connection object will be in the new state already when the event is fired. - One of the values. - - - Gets the original state of the connection. - One of the values. - - - Represents the method that will handle the event. - The source of the event. - The that contains the event data. - - - Provides additional information for the event. - - - Creates a new instance of the class. - Indicates the number of rows affected by the statement that caused the event to occur. - - - Indicates the number of rows affected by the statement that caused the event to occur. - The number of rows affected. - - - The delegate type for the event handlers of the event. - The source of the event. - The data for the event. - - - Specifies the type of SQL query to be used by the , , , or class. - - - A SQL query that is a batch statement. - - - - An SQL query that is a DELETE statement. - - - - An SQL query that is an INSERT statement. - - - - An SQL query that is a SELECT statement. - - - - An SQL query that is an UPDATE statement. - - - - The exception that is thrown by a strongly typed when the user accesses a DBNull value. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with the specified string. - The string to display when the exception is thrown. - - - Initializes a new instance of the class using the specified serialization information and streaming context. - A object. - A structure. - - - Initializes a new instance of the class with the specified string and inner exception. - The string to display when the exception is thrown. - A reference to an inner exception. - - - Represents the exception that is thrown when the property of a contains a syntax error. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with the specified string. - The string to display when the exception is thrown. - - - Initializes a new instance of the class with the and the . - The data needed to serialize or deserialize an object. - The source and destination of a specific serialized stream. - - - Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. - The error message that explains the reason for the exception. - The exception that is the cause of the current exception, or a null reference (Nothing in Visual Basic) if no inner exception is specified. - - - Represents a restriction on a set of columns in which all values must be unique. - - - Initializes a new instance of the class with the specified . - The to constrain. - - - Initializes a new instance of the class with the given array of objects. - The array of objects to constrain. - - - Initializes a new instance of the class with the to constrain, and a value specifying whether the constraint is a primary key. - The to constrain. - true to indicate that the constraint is a primary key; otherwise, false. - - - Initializes a new instance of the class with an array of objects to constrain, and a value specifying whether the constraint is a primary key. - An array of objects to constrain. - true to indicate that the constraint is a primary key; otherwise, false. - - - Initializes a new instance of the class with the specified name and . - The name of the constraint. - The to constrain. - - - Initializes a new instance of the class with the specified name and array of objects. - The name of the constraint. - The array of objects to constrain. - - - Initializes a new instance of the class with the specified name, the to constrain, and a value specifying whether the constraint is a primary key. - The name of the constraint. - The to constrain. - true to indicate that the constraint is a primary key; otherwise, false. - - - Initializes a new instance of the class with the specified name, an array of objects to constrain, and a value specifying whether the constraint is a primary key. - The name of the constraint. - An array of objects to constrain. - true to indicate that the constraint is a primary key; otherwise, false. - - - Initializes a new instance of the class with the specified name, an array of objects to constrain, and a value specifying whether the constraint is a primary key. - The name of the constraint. - An array of objects to constrain. - true to indicate that the constraint is a primary key; otherwise, false. - - - Gets the array of columns that this constraint affects. - An array of objects. - - - Compares this constraint to a second to determine if both are identical. - The object to which this is compared. - true, if the contraints are equal; otherwise, false. - - - Gets the hash code of this instance of the object. - A 32-bit signed integer hash code. - - - Gets a value indicating whether or not the constraint is on a primary key. - true, if the constraint is on a primary key; otherwise, false. - - - Gets the table to which this constraint belongs. - The to which the constraint belongs. - - - Specifies how query command results are applied to the row being updated. - - - Both the output parameters and the first returned row are mapped to the changed row in the . - - - - The data in the first returned row is mapped to the changed row in the . - - - - Any returned parameters or rows are ignored. - - - - Output parameters are mapped to the changed row in the . - - - - Provides a mechanism for releasing unmanaged resources. - - - Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources. - - - Defines a generalized method that a value type or class implements to create a type-specific method for determining equality of instances. - The type of objects to compare. - - - Indicates whether the current object is equal to another object of the same type. - An object to compare with this object. - true if the current object is equal to the other parameter; otherwise, false. - - - Provides a mechanism for retrieving an object to control formatting. - - - Returns an object that provides formatting services for the specified type. - An object that specifies the type of format object to return. - An instance of the object specified by formatType, if the implementation can supply that type of object; otherwise, null. - - - Provides functionality to format the value of an object into a string representation. - - - Formats the value of the current instance using the specified format. - The format to use. -or- A null reference (Nothing in Visual Basic) to use the default format defined for the type of the implementation. - The provider to use to format the value. -or- A null reference (Nothing in Visual Basic) to obtain the numeric format information from the current locale setting of the operating system. - The value of the current instance in the specified format. - - - The exception that is thrown when an attempt is made to access an element of an array or collection with an index that is outside its bounds. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with a specified error message. - The message that describes the error. - - - Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. - The error message that explains the reason for the exception. - The exception that is the cause of the current exception. If the innerException parameter is not a null reference (Nothing in Visual Basic), the current exception is raised in a catch block that handles the inner exception. - - - The exception that is thrown when there is insufficient execution stack available to allow most methods to execute. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with a specified error message. - The error message that explains the reason for the exception. - - - Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. - The error message that explains the reason for the exception. - The exception that is the cause of the current exception. If the inner parameter is not null, the current exception is raised in a catch block that handles the inner exception. - - - The exception that is thrown when a check for sufficient available memory fails. This class cannot be inherited. - - - Initializes a new instance of the class with a system-supplied message that describes the error. - - - Initializes a new instance of the class with a specified message that describes the error. - The message that describes the exception. The caller of this constructor is required to ensure that this string has been localized for the current system culture. - - - Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. - The message that describes the exception. The caller of this constructor is required to ensure that this string has been localized for the current system culture. - The exception that is the cause of the current exception. If the innerException parameter is not null, the current exception is raised in a catch block that handles the inner exception. - - - Represents a 16-bit signed integer. - - - Compares this instance to a specified 16-bit signed integer and returns an integer that indicates whether the value of this instance is less than, equal to, or greater than the value of the specified 16-bit signed integer. - An integer to compare. -

A signed number indicating the relative values of this instance and value.

-
Return Value

-

Description

-

Less than zero

-

This instance is less than value.

-

Zero

-

This instance is equal to value.

-

Greater than zero

-

This instance is greater than value.

-

-
-
- - Compares this instance to a specified object and returns an integer that indicates whether the value of this instance is less than, equal to, or greater than the value of the object. - An object to compare, or null. -

A signed number indicating the relative values of this instance and value.

-
Return Value

-

Description

-

Less than zero

-

This instance is less than value.

-

Zero

-

This instance is equal to value.

-

Greater than zero

-

This instance is greater than value.

-

-or-

-

value is null.

-

-
- value is not an . -
- - Returns a value indicating whether this instance is equal to a specified value. - An value to compare to this instance. - true if obj has the same value as this instance; otherwise, false. - - - Returns a value indicating whether this instance is equal to a specified object. - An object to compare to this instance. - true if obj is an instance of and equals the value of this instance; otherwise, false. - - - Returns the hash code for this instance. - A 32-bit signed integer hash code. - - - Returns the for value type . - The enumerated constant, . - - - Represents the largest possible value of an . This field is constant. - - - - Represents the smallest possible value of . This field is constant. - - - - Converts the string representation of a number in a specified style and culture-specific format to its 16-bit signed integer equivalent. - A string containing a number to convert. - A bitwise combination of enumeration values that indicates the style elements that can be present in s. A typical value to specify is . - An that supplies culture-specific formatting information about s. - A 16-bit signed integer equivalent to the number specified in s. - s is null. - style is not a value. -or- style is not a combination of and values. - s is not in a format compliant with style. - s represents a number less than or greater than . -or- s includes non-zero fractional digits. - - - Converts the string representation of a number in a specified culture-specific format to its 16-bit signed integer equivalent. - A string containing a number to convert. - An that supplies culture-specific formatting information about s. - A 16-bit signed integer equivalent to the number specified in s. - s is null. - s is not in the correct format. - s represents a number less than or greater than . - - - Converts the string representation of a number to its 16-bit signed integer equivalent. - A string containing a number to convert. - A 16-bit signed integer equivalent to the number contained in s. - s is null. - s is not in the correct format. - s represents a number less than or greater than . - - - Converts the string representation of a number in a specified style to its 16-bit signed integer equivalent. - A string containing a number to convert. - A bitwise combination of the enumeration values that indicates the style elements that can be present in s. A typical value to specify is . - A 16-bit signed integer equivalent to the number specified in s. - s is null. - style is not a value. -or- style is not a combination of and values. - s is not in a format compliant with style. - s represents a number less than or greater than . -or- s includes non-zero fractional digits. - - - Converts the numeric value of this instance to its equivalent string representation. - The string representation of the value of this instance, consisting of a minus sign if the value is negative, and a sequence of digits ranging from 0 to 9 with no leading zeroes. - - - Converts the numeric value of this instance to its equivalent string representation using the specified format and culture-specific formatting information. - A numeric format string. - An object that supplies culture-specific formatting information. - The string representation of the value of this instance as specified by format and provider. - - - Converts the numeric value of this instance to its equivalent string representation, using the specified format. - A numeric format string. - The string representation of the value of this instance as specified by format. - - - Converts the numeric value of this instance to its equivalent string representation using the specified culture-specific format information. - An that supplies culture-specific formatting information. - The string representation of the value of this instance as specified by provider. - - - Converts the string representation of a number to its 16-bit signed integer equivalent. A return value indicates whether the conversion succeeded or failed. - A string containing a number to convert. - When this method returns, contains the 16-bit signed integer value equivalent to the number contained in s, if the conversion succeeded, or zero if the conversion failed. The conversion fails if the s parameter is null or , is not of the correct format, or represents a number less than or greater than . This parameter is passed uninitialized; any value originally supplied in result will be overwritten. - true if s was converted successfully; otherwise, false. - - - Converts the string representation of a number in a specified style and culture-specific format to its 16-bit signed integer equivalent. A return value indicates whether the conversion succeeded or failed. - A string containing a number to convert. The string is interpreted using the style specified by style. - A bitwise combination of enumeration values that indicates the style elements that can be present in s. A typical value to specify is . - An object that supplies culture-specific formatting information about s. - When this method returns, contains the 16-bit signed integer value equivalent to the number contained in s, if the conversion succeeded, or zero if the conversion failed. The conversion fails if the s parameter is null or , is not in a format compliant with style, or represents a number less than or greater than . This parameter is passed uninitialized; any value originally supplied in result will be overwritten. - true if s was converted successfully; otherwise, false. - style is not a value. -or- style is not a combination of and values. - - - For a description of this member, see . - This parameter is ignored. - true if the value of the current instance is not zero; otherwise, false. - - - For a description of this member, see . - This parameter is ignored. - The value of the current instance, converted to a . - - - For a description of this member, see . - This parameter is ignored. - The value of the current instance, converted to a . - - - This conversion is not supported. Attempting to use this method throws an . - This parameter is ignored. - This conversion is not supported. No value is returned. - In all cases. - - - For a description of this member, see . - This parameter is ignored. - The value of the current instance, converted to a . - - - For a description of this member, see . - This parameter is ignored. - The value of the current instance, converted to a . - - - For a description of this member, see . - This parameter is ignored. - The value of the current instance, unchanged. - - - For a description of this member, see . - This parameter is ignored. - The value of the current instance, converted to an . - - - For a description of this member, see . - This parameter is ignored. - The value of the current instance, converted to an . - - - For a description of this member, see . - This parameter is ignored. - The value of the current instance, converted to an . - - - For a description of this member, see . - This parameter is ignored. - The value of the current instance, converted to a . - - - For a description of this member, see . - The type to which to convert this value. - An implementation that supplies information about the format of the returned value. - The value of the current instance, converted to type. - - - For a description of this member, see . - This parameter is ignored. - The value of the current instance, unchanged. - - - For a description of this member, see . - This parameter is ignored. - The value of the current instance, converted to a . - - - For a description of this member, see . - This parameter is ignored. - The value of the current instance, converted to a . - - - Represents a 32-bit signed integer. - - - Compares this instance to a specified 32-bit signed integer and returns an indication of their relative values. - An integer to compare. -

A signed number indicating the relative values of this instance and value.

-
Return Value

-

Description

-

Less than zero

-

This instance is less than value.

-

Zero

-

This instance is equal to value.

-

Greater than zero

-

This instance is greater than value.

-

-
-
- - Compares this instance to a specified object and returns an indication of their relative values. - An object to compare, or null. -

A signed number indicating the relative values of this instance and value.

-
Return Value

-

Description

-

Less than zero

-

This instance is less than value.

-

Zero

-

This instance is equal to value.

-

Greater than zero

-

This instance is greater than value.

-

-or-

-

value is null.

-

-
- value is not an . -
- - Returns a value indicating whether this instance is equal to a specified value. - An value to compare to this instance. - true if obj has the same value as this instance; otherwise, false. - - - Returns a value indicating whether this instance is equal to a specified object. - An object to compare with this instance. - true if obj is an instance of and equals the value of this instance; otherwise, false. - - - Returns the hash code for this instance. - A 32-bit signed integer hash code. - - - Returns the for value type . - The enumerated constant, . - - - Represents the largest possible value of an . This field is constant. - - - - Represents the smallest possible value of . This field is constant. - - - - Converts the string representation of a number in a specified style and culture-specific format to its 32-bit signed integer equivalent. - A string containing a number to convert. - A bitwise combination of enumeration values that indicates the style elements that can be present in s. A typical value to specify is . - An object that supplies culture-specific information about the format of s. - A 32-bit signed integer equivalent to the number specified in s. - s is null. - style is not a value. -or- style is not a combination of and values. - s is not in a format compliant with style. - s represents a number less than or greater than . -or- s includes non-zero, fractional digits. - - - Converts the string representation of a number in a specified culture-specific format to its 32-bit signed integer equivalent. - A string containing a number to convert. - An object that supplies culture-specific formatting information about s. - A 32-bit signed integer equivalent to the number specified in s. - s is null. - s is not of the correct format. - s represents a number less than or greater than . - - - Converts the string representation of a number to its 32-bit signed integer equivalent. - A string containing a number to convert. - A 32-bit signed integer equivalent to the number contained in s. - s is null. - s is not in the correct format. - s represents a number less than or greater than . - - - Converts the string representation of a number in a specified style to its 32-bit signed integer equivalent. - A string containing a number to convert. - A bitwise combination of the enumeration values that indicates the style elements that can be present in s. A typical value to specify is . - A 32-bit signed integer equivalent to the number specified in s. - s is null. - style is not a value. -or- style is not a combination of and values. - s is not in a format compliant with style. - s represents a number less than or greater than . -or- s includes non-zero, fractional digits. - - - Converts the numeric value of this instance to its equivalent string representation. - The string representation of the value of this instance, consisting of a negative sign if the value is negative, and a sequence of digits ranging from 0 to 9 with no leading zeroes. - - - Converts the numeric value of this instance to its equivalent string representation using the specified format and culture-specific format information. - A standard or custom numeric format string. - An object that supplies culture-specific formatting information. - The string representation of the value of this instance as specified by format and provider. - format is invalid or not supported. - - - Converts the numeric value of this instance to its equivalent string representation, using the specified format. - A standard or custom numeric format string. - The string representation of the value of this instance as specified by format. - format is invalid or not supported. - - - Converts the numeric value of this instance to its equivalent string representation using the specified culture-specific format information. - An object that supplies culture-specific formatting information. - The string representation of the value of this instance as specified by provider. - - - Converts the string representation of a number to its 32-bit signed integer equivalent. A return value indicates whether the conversion succeeded. - A string containing a number to convert. - When this method returns, contains the 32-bit signed integer value equivalent of the number contained in s, if the conversion succeeded, or zero if the conversion failed. The conversion fails if the s parameter is null or , is not of the correct format, or represents a number less than or greater than . This parameter is passed uninitialized; any value originally supplied in result will be overwritten. - true if s was converted successfully; otherwise, false. - - - Converts the string representation of a number in a specified style and culture-specific format to its 32-bit signed integer equivalent. A return value indicates whether the conversion succeeded. - A string containing a number to convert. The string is interpreted using the style specified by style. - A bitwise combination of enumeration values that indicates the style elements that can be present in s. A typical value to specify is . - An object that supplies culture-specific formatting information about s. - When this method returns, contains the 32-bit signed integer value equivalent of the number contained in s, if the conversion succeeded, or zero if the conversion failed. The conversion fails if the s parameter is null or , is not in a format compliant with style, or represents a number less than or greater than . This parameter is passed uninitialized; any value originally supplied in result will be overwritten. - true if s was converted successfully; otherwise, false. - style is not a value. -or- style is not a combination of and values. - - - For a description of this member, see . - This parameter is ignored. - true if the value of the current instance is not zero; otherwise, false. - - - For a description of this member, see . - This parameter is ignored. - The value of the current instance, converted to a . - - - For a description of this member, see . - This parameter is ignored. - The value of the current instance, converted to a . - - - This conversion is not supported. Attempting to use this method throws an . - This parameter is ignored. - This conversion is not supported. No value is returned. - In all cases. - - - For a description of this member, see . - This parameter is ignored. - The value of the current instance, converted to a . - - - For a description of this member, see . - This parameter is ignored. - The value of the current instance, converted to a . - - - For a description of this member, see . - This parameter is ignored. - The value of the current instance, converted to an . - - - For a description of this member, see . - This parameter is ignored. - The value of the current instance, unchanged. - - - For a description of this member, see . - This parameter is ignored. - The value of the current instance, converted to an . - - - For a description of this member, see . - This parameter is ignored. - The value of the current instance, converted to an . - - - For a description of this member, see . - This parameter is ignored. - The value of the current instance, converted to a . - - - For a description of this member, see . - The type to which to convert this value. - An object that provides information about the format of the returned value. - The value of the current instance, converted to type. - - - For a description of this member, see . - This parameter is ignored. - The value of the current instance, converted to a . - - - For a description of this member, see . - This parameter is ignored. - The value of the current instance, converted to a . - - - For a description of this member, see . - This parameter is ignored. - The value of the current instance, converted to a . - - - Represents a 64-bit signed integer. - - - Compares this instance to a specified 64-bit signed integer and returns an indication of their relative values. - An integer to compare. -

A signed number indicating the relative values of this instance and value.

-
Return Value

-

Description

-

Less than zero

-

This instance is less than value.

-

Zero

-

This instance is equal to value.

-

Greater than zero

-

This instance is greater than value.

-

-
-
- - Compares this instance to a specified object and returns an indication of their relative values. - An object to compare, or null. -

A signed number indicating the relative values of this instance and value.

-
Return Value

-

Description

-

Less than zero

-

This instance is less than value.

-

Zero

-

This instance is equal to value.

-

Greater than zero

-

This instance is greater than value.

-

-or-

-

value is null.

-

-
- value is not an . -
- - Returns a value indicating whether this instance is equal to a specified value. - An value to compare to this instance. - true if obj has the same value as this instance; otherwise, false. - - - Returns a value indicating whether this instance is equal to a specified object. - An object to compare with this instance. - true if obj is an instance of an and equals the value of this instance; otherwise, false. - - - Returns the hash code for this instance. - A 32-bit signed integer hash code. - - - Returns the for value type . - The enumerated constant, . - - - Represents the largest possible value of an Int64. This field is constant. - - - - Represents the smallest possible value of an Int64. This field is constant. - - - - Converts the string representation of a number in a specified style and culture-specific format to its 64-bit signed integer equivalent. - A string containing a number to convert. - A bitwise combination of enumeration values that indicates the style elements that can be present in s. A typical value to specify is . - An that supplies culture-specific formatting information about s. - A 64-bit signed integer equivalent to the number specified in s. - s is null. - style is not a value. -or- style is not a combination of and values. - s is not in a format compliant with style. - s represents a number less than or greater than . -or- style supports fractional digits, but s includes non-zero fractional digits. - - - Converts the string representation of a number in a specified culture-specific format to its 64-bit signed integer equivalent. - A string containing a number to convert. - An object that supplies culture-specific formatting information about s. - A 64-bit signed integer equivalent to the number specified in s. - s is null. - s is not in the correct format. - s represents a number less than or greater than . - - - Converts the string representation of a number to its 64-bit signed integer equivalent. - A string containing a number to convert. - A 64-bit signed integer equivalent to the number contained in s. - s is null. - s is not in the correct format. - s represents a number less than or greater than . - - - Converts the string representation of a number in a specified style to its 64-bit signed integer equivalent. - A string containing a number to convert. - A bitwise combination of values that indicates the permitted format of s. A typical value to specify is . - A 64-bit signed integer equivalent to the number specified in s. - s is null. - style is not a value. -or- style is not a combination of and values. - s is not in a format compliant with style. - s represents a number less than or greater than . -or- style supports fractional digits but s includes non-zero fractional digits. - - - Converts the numeric value of this instance to its equivalent string representation. - The string representation of the value of this instance, consisting of a minus sign if the value is negative, and a sequence of digits ranging from 0 to 9 with no leading zeroes. - - - Converts the numeric value of this instance to its equivalent string representation using the specified format and culture-specific format information. - A numeric format string. - An object that supplies culture-specific formatting information about this instance. - The string representation of the value of this instance as specified by format and provider. - format is invalid or not supported. - - - Converts the numeric value of this instance to its equivalent string representation, using the specified format. - A numeric format string. - The string representation of the value of this instance as specified by format. - format is invalid or not supported. - - - Converts the numeric value of this instance to its equivalent string representation using the specified culture-specific format information. - An that supplies culture-specific formatting information. - The string representation of the value of this instance as specified by provider. - - - Converts the string representation of a number to its 64-bit signed integer equivalent. A return value indicates whether the conversion succeeded or failed. - A string containing a number to convert. - When this method returns, contains the 64-bit signed integer value equivalent of the number contained in s, if the conversion succeeded, or zero if the conversion failed. The conversion fails if the s parameter is null or , is not of the correct format, or represents a number less than or greater than . This parameter is passed uninitialized; any value originally supplied in result will be overwritten. - true if s was converted successfully; otherwise, false. - - - Converts the string representation of a number in a specified style and culture-specific format to its 64-bit signed integer equivalent. A return value indicates whether the conversion succeeded or failed. - A string containing a number to convert. The string is interpreted using the style specified by style. - A bitwise combination of enumeration values that indicates the style elements that can be present in s. A typical value to specify is . - An object that supplies culture-specific formatting information about s. - When this method returns, contains the 64-bit signed integer value equivalent of the number contained in s, if the conversion succeeded, or zero if the conversion failed. The conversion fails if the s parameter is null or , is not in a format compliant with style, or represents a number less than or greater than . This parameter is passed uninitialized; any value originally supplied in result will be overwritten. - true if s was converted successfully; otherwise, false. - style is not a value. -or- style is not a combination of and values. - - - For a description of this member, see . - This parameter is ignored. - true if the value of the current instance is not zero; otherwise, false. - - - For a description of this member, see . - This parameter is ignored. - The value of the current instance, converted to a . - - - For a description of this member, see . - This parameter is ignored. - The value of the current instance, converted to a . - - - This conversion is not supported. Attempting to use this method throws an . - This parameter is ignored. - This conversion is not supported. No value is returned. - In all cases. - - - For a description of this member, see . - This parameter is ignored. - The value of the current instance, converted to a . - - - For a description of this member, see . - This parameter is ignored. - The value of the current instance, converted to a . - - - For a description of this member, see . - This parameter is ignored. - The value of the current instance, converted to an . - - - For a description of this member, see . - This parameter is ignored. - The value of the current instance, converted to an . - - - For a description of this member, see . - This parameter is ignored. - The value of the current instance, unchanged. - - - For a description of this member, see . - This parameter is ignored. - The value of the current instance, converted to an . - - - For a description of this member, see . - This parameter is ignored. - The value of the current instance, converted to a . - - - For a description of this member, see . - The type to which to convert this value. - An implementation that provides information about the format of the returned value. - The value of the current instance, converted to type. - - - For a description of this member, see . - This parameter is ignored. - The value of the current instance, converted to a . - - - For a description of this member, see . - This parameter is ignored. - The value of the current instance, converted to a . - - - For a description of this member, see . - This parameter is ignored. - The value of the current instance, converted to a . - - - A platform-specific type that is used to represent a pointer or a handle. - - - Initializes a new instance of using the specified 32-bit pointer or handle. - A pointer or handle contained in a 32-bit signed integer. - - - Initializes a new instance of using the specified 64-bit pointer. - A pointer or handle contained in a 64-bit signed integer. - On a 32-bit platform, value is too large or too small to represent as an . - - - Initializes a new instance of using the specified pointer to an unspecified type. - A pointer to an unspecified type. - - - Adds an offset to the value of a pointer. - The pointer to add the offset to. - The offset to add. - A new pointer that reflects the addition of offset to pointer. - - - Returns a value indicating whether this instance is equal to a specified object. - An object to compare with this instance or null. - true if obj is an instance of and equals the value of this instance; otherwise, false. - - - Returns the hash code for this instance. - A 32-bit signed integer hash code. - - - Adds an offset to the value of a pointer. - The pointer to add the offset to. - The offset to add. - A new pointer that reflects the addition of offset to pointer. - - - Determines whether two specified instances of are equal. - The first pointer or handle to compare. - The second pointer or handle to compare. - true if value1 equals value2; otherwise, false. - - - - - - - - - - - - - - - - - - - - - - - - - - - Determines whether two specified instances of are not equal. - The first pointer or handle to compare. - The second pointer or handle to compare. - true if value1 does not equal value2; otherwise, false. - - - Subtracts an offset from the value of a pointer. - The pointer to subtract the offset from. - The offset to subtract. - A new pointer that reflects the subtraction of offset from pointer. - - - Gets the size of this instance. - The size of a pointer or handle in this process, measured in bytes. The value of this property is 4 in a 32-bit process, and 8 in a 64-bit process. You can define the process type by setting the /platform switch when you compile your code with the C# and Visual Basic compilers. - - - Subtracts an offset from the value of a pointer. - The pointer to subtract the offset from. - The offset to subtract. - A new pointer that reflects the subtraction of offset from pointer. - - - Converts the value of this instance to a 32-bit signed integer. - A 32-bit signed integer equal to the value of this instance. - On a 64-bit platform, the value of this instance is too large or too small to represent as a 32-bit signed integer. - - - Converts the value of this instance to a 64-bit signed integer. - A 64-bit signed integer equal to the value of this instance. - - - Converts the value of this instance to a pointer to an unspecified type. - A pointer to ; that is, a pointer to memory containing data of an unspecified type. - - - Converts the numeric value of the current object to its equivalent string representation. - A format specification that governs how the current object is converted. - The string representation of the value of the current object. - - - Converts the numeric value of the current object to its equivalent string representation. - The string representation of the value of this instance. - - - A read-only field that represents a pointer or handle that has been initialized to zero. - - - - Populates a object with the data needed to serialize the current object. - The object to populate with data. - The destination for this serialization. (This parameter is not used; specify null.) - info is null. - - - The exception that is thrown for invalid casting or explicit conversion. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with a specified error message. - The message that describes the error. - - - Initializes a new instance of the class with serialized data. - The object that holds the serialized object data. - The contextual information about the source or destination. - - - Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. - The error message that explains the reason for the exception. - The exception that is the cause of the current exception. If the innerException parameter is not null, the current exception is raised in a catch block that handles the inner exception. - - - Initializes a new instance of the class with a specified message and error code. - The message that indicates the reason the exception occurred. - The error code (HRESULT) value associated with the exception. - - - The exception that is thrown when a method call is invalid for the object's current state. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with a specified error message. - The message that describes the error. - - - Initializes a new instance of the class with serialized data. - The object that holds the serialized object data. - The contextual information about the source or destination. - - - Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. - The error message that explains the reason for the exception. - The exception that is the cause of the current exception. If the innerException parameter is not a null reference (Nothing in Visual Basic), the current exception is raised in a catch block that handles the inner exception. - - - The exception that is thrown when a program contains invalid Microsoft intermediate language (MSIL) or metadata. Generally this indicates a bug in the compiler that generated the program. - - - Initializes a new instance of the class with default properties. - - - Initializes a new instance of the class with a specified error message. - The error message that explains the reason for the exception. - - - Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. - The error message that explains the reason for the exception. - The exception that is the cause of the current exception. If the inner parameter is not a null reference (Nothing in Visual Basic), the current exception is raised in a catch block that handles the inner exception. - - - The exception that is thrown when time zone information is invalid. - - - Initializes a new instance of the class with a system-supplied message. - - - Initializes a new instance of the class with the specified message string. - A string that describes the exception. - - - Initializes a new instance of the class from serialized data. - The object that contains the serialized data. - The stream that contains the serialized data. - The info parameter is null. -or- The context parameter is null. - - - Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. - A string that describes the exception. - The exception that is the cause of the current exception. - - - Reads primitive data types as binary values in a specific encoding. - - - Initializes a new instance of the class based on the specified stream and using UTF-8 encoding. - The input stream. - The stream does not support reading, is null, or is already closed. - - - Initializes a new instance of the class based on the specified stream and character encoding. - The input stream. - The character encoding to use. - The stream does not support reading, is null, or is already closed. - encoding is null. - - - Initializes a new instance of the class based on the specified stream and character encoding, and optionally leaves the stream open. - The input stream. - The character encoding to use. - true to leave the stream open after the object is disposed; otherwise, false. - The stream does not support reading, is null, or is already closed. - encoding or input is null. - - - Exposes access to the underlying stream of the . - The underlying stream associated with the BinaryReader. - - - Closes the current reader and the underlying stream. - - - Releases all resources used by the current instance of the class. - - - Releases the unmanaged resources used by the class and optionally releases the managed resources. - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - Fills the internal buffer with the specified number of bytes read from the stream. - The number of bytes to be read. - The end of the stream is reached before numBytes could be read. - An I/O error occurs. - Requested numBytes is larger than the internal buffer size. - - - Returns the next available character and does not advance the byte or character position. - The next available character, or -1 if no more characters are available or the stream does not support seeking. - An I/O error occurs. - The current character cannot be decoded into the internal character buffer by using the selected for the stream. - - - Reads characters from the underlying stream and advances the current position of the stream in accordance with the Encoding used and the specific character being read from the stream. - The next character from the input stream, or -1 if no characters are currently available. - An I/O error occurs. - The stream is closed. - - - Reads the specified number of bytes from the stream, starting from a specified point in the byte array. - The buffer to read data into. - The starting point in the buffer at which to begin reading into the buffer. - The number of bytes to read. - The number of bytes read into buffer. This might be less than the number of bytes requested if that many bytes are not available, or it might be zero if the end of the stream is reached. - The buffer length minus index is less than count. -or- The number of decoded characters to read is greater than count. This can happen if a Unicode decoder returns fallback characters or a surrogate pair. - buffer is null. - index or count is negative. - The stream is closed. - An I/O error occurs. - - - Reads the specified number of characters from the stream, starting from a specified point in the character array. - The buffer to read data into. - The starting point in the buffer at which to begin reading into the buffer. - The number of characters to read. - The total number of characters read into the buffer. This might be less than the number of characters requested if that many characters are not currently available, or it might be zero if the end of the stream is reached. - The buffer length minus index is less than count. -or- The number of decoded characters to read is greater than count. This can happen if a Unicode decoder returns fallback characters or a surrogate pair. - buffer is null. - index or count is negative. - The stream is closed. - An I/O error occurs. - - - Reads in a 32-bit integer in compressed format. - A 32-bit integer in compressed format. - The end of the stream is reached. - The stream is closed. - An I/O error occurs. - The stream is corrupted. - - - Reads a Boolean value from the current stream and advances the current position of the stream by one byte. - true if the byte is nonzero; otherwise, false. - The end of the stream is reached. - The stream is closed. - An I/O error occurs. - - - Reads the next byte from the current stream and advances the current position of the stream by one byte. - The next byte read from the current stream. - The end of the stream is reached. - The stream is closed. - An I/O error occurs. - - - Reads the specified number of bytes from the current stream into a byte array and advances the current position by that number of bytes. - The number of bytes to read. This value must be 0 or a non-negative number or an exception will occur. - A byte array containing data read from the underlying stream. This might be less than the number of bytes requested if the end of the stream is reached. - The number of decoded characters to read is greater than count. This can happen if a Unicode decoder returns fallback characters or a surrogate pair. - An I/O error occurs. - The stream is closed. - count is negative. - - - Reads the next character from the current stream and advances the current position of the stream in accordance with the Encoding used and the specific character being read from the stream. - A character read from the current stream. - The end of the stream is reached. - The stream is closed. - An I/O error occurs. - A surrogate character was read. - - - Reads the specified number of characters from the current stream, returns the data in a character array, and advances the current position in accordance with the Encoding used and the specific character being read from the stream. - The number of characters to read. - A character array containing data read from the underlying stream. This might be less than the number of characters requested if the end of the stream is reached. - The number of decoded characters to read is greater than count. This can happen if a Unicode decoder returns fallback characters or a surrogate pair. - The stream is closed. - An I/O error occurs. - count is negative. - - - Reads a decimal value from the current stream and advances the current position of the stream by sixteen bytes. - A decimal value read from the current stream. - The end of the stream is reached. - The stream is closed. - An I/O error occurs. - - - Reads an 8-byte floating point value from the current stream and advances the current position of the stream by eight bytes. - An 8-byte floating point value read from the current stream. - The end of the stream is reached. - The stream is closed. - An I/O error occurs. - - - Reads a 2-byte signed integer from the current stream and advances the current position of the stream by two bytes. - A 2-byte signed integer read from the current stream. - The end of the stream is reached. - The stream is closed. - An I/O error occurs. - - - Reads a 4-byte signed integer from the current stream and advances the current position of the stream by four bytes. - A 4-byte signed integer read from the current stream. - The end of the stream is reached. - The stream is closed. - An I/O error occurs. - - - Reads an 8-byte signed integer from the current stream and advances the current position of the stream by eight bytes. - An 8-byte signed integer read from the current stream. - The end of the stream is reached. - The stream is closed. - An I/O error occurs. - - - Reads a signed byte from this stream and advances the current position of the stream by one byte. - A signed byte read from the current stream. - The end of the stream is reached. - The stream is closed. - An I/O error occurs. - - - Reads a 4-byte floating point value from the current stream and advances the current position of the stream by four bytes. - A 4-byte floating point value read from the current stream. - The end of the stream is reached. - The stream is closed. - An I/O error occurs. - - - Reads a string from the current stream. The string is prefixed with the length, encoded as an integer seven bits at a time. - The string being read. - The end of the stream is reached. - The stream is closed. - An I/O error occurs. - - - Reads a 2-byte unsigned integer from the current stream using little-endian encoding and advances the position of the stream by two bytes. - A 2-byte unsigned integer read from this stream. - The end of the stream is reached. - The stream is closed. - An I/O error occurs. - - - Reads a 4-byte unsigned integer from the current stream and advances the position of the stream by four bytes. - A 4-byte unsigned integer read from this stream. - The end of the stream is reached. - The stream is closed. - An I/O error occurs. - - - Reads an 8-byte unsigned integer from the current stream and advances the position of the stream by eight bytes. - An 8-byte unsigned integer read from this stream. - The end of the stream is reached. - An I/O error occurs. - The stream is closed. - - - Writes primitive types in binary to a stream and supports writing strings in a specific encoding. - - - Initializes a new instance of the class that writes to a stream. - - - Initializes a new instance of the class based on the specified stream and using UTF-8 encoding. - The output stream. - The stream does not support writing or is already closed. - output is null. - - - Initializes a new instance of the class based on the specified stream and character encoding. - The output stream. - The character encoding to use. - The stream does not support writing or is already closed. - output or encoding is null. - - - Initializes a new instance of the class based on the specified stream and character encoding, and optionally leaves the stream open. - The output stream. - The character encoding to use. - true to leave the stream open after the object is disposed; otherwise, false. - The stream does not support writing or is already closed. - output or encoding is null. - - - Gets the underlying stream of the . - The underlying stream associated with the BinaryWriter. - - - Closes the current and the underlying stream. - - - Releases all resources used by the current instance of the class. - - - Releases the unmanaged resources used by the and optionally releases the managed resources. - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - Clears all buffers for the current writer and causes any buffered data to be written to the underlying device. - - - Specifies a with no backing store. - - - - Holds the underlying stream. - - - - Sets the position within the current stream. - A byte offset relative to origin. - A field of indicating the reference point from which the new position is to be obtained. - The position with the current stream. - The file pointer was moved to an invalid location. - The value is invalid. - - - Writes a region of a byte array to the current stream. - A byte array containing the data to write. - The starting point in buffer at which to begin writing. - The number of bytes to write. - The buffer length minus index is less than count. - buffer is null. - index or count is negative. - An I/O error occurs. - The stream is closed. - - - Writes an eight-byte unsigned integer to the current stream and advances the stream position by eight bytes. - The eight-byte unsigned integer to write. - An I/O error occurs. - The stream is closed. - - - Writes a four-byte unsigned integer to the current stream and advances the stream position by four bytes. - The four-byte unsigned integer to write. - An I/O error occurs. - The stream is closed. - - - Writes a two-byte unsigned integer to the current stream and advances the stream position by two bytes. - The two-byte unsigned integer to write. - An I/O error occurs. - The stream is closed. - - - Writes a length-prefixed string to this stream in the current encoding of the , and advances the current position of the stream in accordance with the encoding used and the specific characters being written to the stream. - The value to write. - An I/O error occurs. - value is null. - The stream is closed. - - - Writes a four-byte floating-point value to the current stream and advances the stream position by four bytes. - The four-byte floating-point value to write. - An I/O error occurs. - The stream is closed. - - - Writes a signed byte to the current stream and advances the stream position by one byte. - The signed byte to write. - An I/O error occurs. - The stream is closed. - - - Writes an eight-byte signed integer to the current stream and advances the stream position by eight bytes. - The eight-byte signed integer to write. - An I/O error occurs. - The stream is closed. - - - Writes a Unicode character to the current stream and advances the current position of the stream in accordance with the Encoding used and the specific characters being written to the stream. - The non-surrogate, Unicode character to write. - An I/O error occurs. - The stream is closed. - ch is a single surrogate character. - - - Writes a two-byte signed integer to the current stream and advances the stream position by two bytes. - The two-byte signed integer to write. - An I/O error occurs. - The stream is closed. - - - Writes an eight-byte floating-point value to the current stream and advances the stream position by eight bytes. - The eight-byte floating-point value to write. - An I/O error occurs. - The stream is closed. - - - Writes a decimal value to the current stream and advances the stream position by sixteen bytes. - The decimal value to write. - An I/O error occurs. - The stream is closed. - - - Writes a character array to the current stream and advances the current position of the stream in accordance with the Encoding used and the specific characters being written to the stream. - A character array containing the data to write. - chars is null. - The stream is closed. - An I/O error occurs. - - - Writes a section of a character array to the current stream, and advances the current position of the stream in accordance with the Encoding used and perhaps the specific characters being written to the stream. - A character array containing the data to write. - The starting point in chars from which to begin writing. - The number of characters to write. - The buffer length minus index is less than count. - chars is null. - index or count is negative. - An I/O error occurs. - The stream is closed. - - - Writes a byte array to the underlying stream. - A byte array containing the data to write. - An I/O error occurs. - The stream is closed. - buffer is null. - - - Writes an unsigned byte to the current stream and advances the stream position by one byte. - The unsigned byte to write. - An I/O error occurs. - The stream is closed. - - - Writes a one-byte Boolean value to the current stream, with 0 representing false and 1 representing true. - The Boolean value to write (0 or 1). - An I/O error occurs. - The stream is closed. - - - Writes a four-byte signed integer to the current stream and advances the stream position by four bytes. - The four-byte signed integer to write. - An I/O error occurs. - The stream is closed. - - - Writes a 32-bit integer in a compressed format. - The 32-bit integer to be written. - The end of the stream is reached. - The stream is closed. - The stream is closed. - - - Adds a buffering layer to read and write operations on another stream. This class cannot be inherited. - - - Initializes a new instance of the class with a default buffer size of 4096 bytes. - The current stream. - stream is null. - - - Initializes a new instance of the class with the specified buffer size. - The current stream. - The buffer size in bytes. - stream is null. - bufferSize is negative. - - - Begins an asynchronous read operation. (Consider using instead.) - The buffer to read the data into. - The byte offset in buffer at which to begin writing data read from the stream. - The maximum number of bytes to read. - An optional asynchronous callback, to be called when the read is complete. - A user-provided object that distinguishes this particular asynchronous read request from other requests. - An object that represents the asynchronous read, which could still be pending. - buffer is null. - offset or count is negative. - Attempted an asynchronous read past the end of the stream. - The buffer length minus offset is less than count. - The current stream does not support the read operation. - - - Begins an asynchronous write operation. (Consider using instead.) - The buffer containing data to write to the current stream. - The zero-based byte offset in buffer at which to begin copying bytes to the current stream. - The maximum number of bytes to write. - The method to be called when the asynchronous write operation is completed. - A user-provided object that distinguishes this particular asynchronous write request from other requests. - An object that references the asynchronous write which could still be pending. - buffer length minus offset is less than count. - buffer is null. - offset or count is negative. - The stream does not support writing. - - - Gets a value indicating whether the current stream supports reading. - true if the stream supports reading; false if the stream is closed or was opened with write-only access. - - - Gets a value indicating whether the current stream supports seeking. - true if the stream supports seeking; false if the stream is closed or if the stream was constructed from an operating system handle such as a pipe or output to the console. - - - Gets a value indicating whether the current stream supports writing. - true if the stream supports writing; false if the stream is closed or was opened with read-only access. - - - Waits for the pending asynchronous read operation to complete. (Consider using instead.) - The reference to the pending asynchronous request to wait for. - The number of bytes read from the stream, between 0 (zero) and the number of bytes you requested. Streams only return 0 only at the end of the stream, otherwise, they should block until at least 1 byte is available. - asyncResult is null. - This object was not created by calling on this class. - - - Ends an asynchronous write operation and blocks until the I/O operation is complete. (Consider using instead.) - The pending asynchronous request. - asyncResult is null. - This object was not created by calling on this class. - - - Clears all buffers for this stream and causes any buffered data to be written to the underlying device. - The stream has been disposed. - The data source or repository is not open. - - - Asynchronously clears all buffers for this stream, causes any buffered data to be written to the underlying device, and monitors cancellation requests. - The token to monitor for cancellation requests. - A task that represents the asynchronous flush operation. - The stream has been disposed. - - - Gets the stream length in bytes. - The stream length in bytes. - The underlying stream is null or closed. - The stream does not support seeking. - Methods were called after the stream was closed. - - - Gets the position within the current stream. - The position within the current stream. - The value passed to is negative. - An I/O error occurs, such as the stream being closed. - The stream does not support seeking. - Methods were called after the stream was closed. - - - Copies bytes from the current buffered stream to an array. - The buffer to which bytes are to be copied. - The byte offset in the buffer at which to begin reading bytes. - The number of bytes to be read. - The total number of bytes read into array. This can be less than the number of bytes requested if that many bytes are not currently available, or 0 if the end of the stream has been reached before any data can be read. - Length of array minus offset is less than count. - array is null. - offset or count is negative. - The stream is not open or is null. - The stream does not support reading. - Methods were called after the stream was closed. - - - Asynchronously reads a sequence of bytes from the current stream, advances the position within the stream by the number of bytes read, and monitors cancellation requests. - The buffer to write the data into. - The byte offset in buffer at which to begin writing data from the stream. - The maximum number of bytes to read. - The token to monitor for cancellation requests. - A task that represents the asynchronous read operation. The value of the TResult parameter contains the total number of bytes read into the buffer. The result value can be less than the number of bytes requested if the number of bytes currently available is less than the requested number, or it can be 0 (zero) if the end of the stream has been reached. - buffer is null. - offset or count is negative. - The sum of offset and count is larger than the buffer length. - The stream does not support reading. - The stream has been disposed. - The stream is currently in use by a previous read operation. - - - Reads a byte from the underlying stream and returns the byte cast to an int, or returns -1 if reading from the end of the stream. - The byte cast to an int, or -1 if reading from the end of the stream. - An I/O error occurs, such as the stream being closed. - The stream does not support reading. - Methods were called after the stream was closed. - - - Sets the position within the current buffered stream. - A byte offset relative to origin. - A value of type indicating the reference point from which to obtain the new position. - The new position within the current buffered stream. - The stream is not open or is null. - The stream does not support seeking. - Methods were called after the stream was closed. - - - Sets the length of the buffered stream. - An integer indicating the desired length of the current buffered stream in bytes. - value is negative. - The stream is not open or is null. - The stream does not support both writing and seeking. - Methods were called after the stream was closed. - - - Copies bytes to the buffered stream and advances the current position within the buffered stream by the number of bytes written. - The byte array from which to copy count bytes to the current buffered stream. - The offset in the buffer at which to begin copying bytes to the current buffered stream. - The number of bytes to be written to the current buffered stream. - Length of array minus offset is less than count. - array is null. - offset or count is negative. - The stream is closed or null. - The stream does not support writing. - Methods were called after the stream was closed. - - - Asynchronously writes a sequence of bytes to the current stream, advances the current position within this stream by the number of bytes written, and monitors cancellation requests. - The buffer to write data from. - The zero-based byte offset in buffer from which to begin copying bytes to the stream. - The maximum number of bytes to write. - The token to monitor for cancellation requests. - A task that represents the asynchronous write operation. - buffer is null. - offset or count is negative. - The sum of offset and count is larger than the buffer length. - The stream does not support writing. - The stream has been disposed. - The stream is currently in use by a previous write operation. - - - Writes a byte to the current position in the buffered stream. - A byte to write to the stream. - The stream does not support writing. - value is null. - Methods were called after the stream was closed. - - - Specifies values that indicate whether a compression operation emphasizes speed or compression size. - - - The compression operation should complete as quickly as possible, even if the resulting file is not optimally compressed. - - - - No compression should be performed on the file. - - - - The compression operation should be optimally compressed, even if the operation takes a longer time to complete. - - - - Specifies whether to compress or decompress the underlying stream. - - - Compresses the underlying stream. - - - - Decompresses the underlying stream. - - - - Provides methods and properties for compressing and decompressing streams by using the Deflate algorithm. - - - Initializes a new instance of the class by using the specified stream and compression level. - The stream to compress. - One of the enumeration values that indicates whether to emphasize speed or compression efficiency when compressing the stream. - stream is null. - The stream does not support write operations such as compression. (The property on the stream object is false.) - - - Initializes a new instance of the class by using the specified stream and compression mode. - The stream to compress or decompress. - One of the enumeration values that indicates whether to compress or decompress the stream. - stream is null. - mode is not a valid value. -or- is and is false. -or- is and is false. - - - Initializes a new instance of the class by using the specified stream and compression level, and optionally leaves the stream open. - The stream to compress. - One of the enumeration values that indicates whether to emphasize speed or compression efficiency when compressing the stream. - true to leave the stream object open after disposing the object; otherwise, false. - stream is null. - The stream does not support write operations such as compression. (The property on the stream object is false.) - - - Initializes a new instance of the class by using the specified stream and compression mode, and optionally leaves the stream open. - The stream to compress or decompress. - One of the enumeration values that indicates whether to compress or decompress the stream. - true to leave the stream open after disposing the object; otherwise, false. - stream is null. - mode is not a valid value. -or- is and is false. -or- is and is false. - - - Gets a reference to the underlying stream. - A stream object that represents the underlying stream. - The underlying stream is closed. - - - Begins an asynchronous read operation. (Consider using the method instead.) - - The byte offset in array at which to begin reading data from the stream. - The maximum number of bytes to read. - - - An object that represents the asynchronous read operation, which could still be pending. - The method tried to read asynchronously past the end of the stream, or a disk error occurred. - One or more of the arguments is invalid. - Methods were called after the stream was closed. - The current implementation does not support the read operation. - This call cannot be completed. - - - Begins an asynchronous write operation. (Consider using the method instead.) - - The byte offset in buffer to begin writing from. - The maximum number of bytes to write. - - - An object that represents the asynchronous write operation, which could still be pending. - The method tried to write asynchronously past the end of the stream, or a disk error occurred. - One or more of the arguments is invalid. - Methods were called after the stream was closed. - The current implementation does not support the write operation. - The write operation cannot be performed because the stream is closed. - - - Gets a value indicating whether the stream supports reading while decompressing a file. - true if the value is Decompress, and the underlying stream is opened and supports reading; otherwise, false. - - - Gets a value indicating whether the stream supports seeking. - false in all cases. - - - Gets a value indicating whether the stream supports writing. - true if the value is Compress, and the underlying stream supports writing and is not closed; otherwise, false. - - - Releases the unmanaged resources used by the and optionally releases the managed resources. - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - Waits for the pending asynchronous read to complete. (Consider using the method instead.) - - The number of bytes read from the stream, between 0 (zero) and the number of bytes you requested. returns 0 only at the end of the stream; otherwise, it blocks until at least one byte is available. - async_result is null. - async_result did not originate from a method on the current stream. - An exception was thrown during a call to . - The stream is null. - - - Ends an asynchronous write operation. (Consider using the method instead.) - - async_result is null. - async_result did not originate from a method on the current stream. - An exception was thrown during a call to . - The end write call is invalid. - - - The current implementation of this method has no functionality. - The stream is closed. - - - This property is not supported and always throws a . - A long value. - This property is not supported on this stream. - - - This property is not supported and always throws a . - A long value. - This property is not supported on this stream. - - - Reads a number of decompressed bytes into the specified byte array. - The array to store decompressed bytes. - The byte offset in array at which the read bytes will be placed. - The maximum number of decompressed bytes to read. - The number of bytes that were read into the byte array. - array is null. - The value was Compress when the object was created. - or - The underlying stream does not support reading. - offset or count is less than zero. -or- array length minus the index starting point is less than count. - The data is in an invalid format. - The stream is closed. - - - This operation is not supported and always throws a . - The location in the stream. - One of the values. - A long value. - This property is not supported on this stream. - - - This operation is not supported and always throws a . - The length of the stream. - This property is not supported on this stream. - - - Writes compressed bytes to the underlying stream from the specified byte array. - The buffer that contains the data to compress. - The byte offset in array from which the bytes will be read. - The maximum number of bytes to write. - - - Provides methods and properties used to compress and decompress streams. - - - Initializes a new instance of the class by using the specified stream and compression level. - The stream to write the compressed data to. - One of the enumeration values that indicates whether to emphasize speed or compression efficiency when compressing the stream. - stream is null. - The stream does not support write operations such as compression. (The property on the stream object is false.) - - - Initializes a new instance of the class by using the specified stream and compression mode. - The stream the compressed or decompressed data is written to. - One of the enumeration values that indicates whether to compress or decompress the stream. - stream is null. - mode is not a valid enumeration value. -or- is and is false. -or- is and is false. - - - Initializes a new instance of the class by using the specified stream and compression level, and optionally leaves the stream open. - The stream to write the compressed data to. - One of the enumeration values that indicates whether to emphasize speed or compression efficiency when compressing the stream. - true to leave the stream object open after disposing the object; otherwise, false. - stream is null. - The stream does not support write operations such as compression. (The property on the stream object is false.) - - - Initializes a new instance of the class by using the specified stream and compression mode, and optionally leaves the stream open. - The stream the compressed or decompressed data is written to. - One of the enumeration values that indicates whether to compress or decompress the stream. - true to leave the stream open after disposing the object; otherwise, false. - stream is null. - mode is not a valid value. -or- is and is false. -or- is and is false. - - - Gets a reference to the underlying stream. - A stream object that represents the underlying stream. - The underlying stream is closed. - - - Begins an asynchronous read operation. (Consider using the method instead.) - - The byte offset in array at which to begin reading data from the stream. - The maximum number of bytes to read. - - - An object that represents the asynchronous read operation, which could still be pending. - The method tried to read asynchronously past the end of the stream, or a disk error occurred. - One or more of the arguments is invalid. - Methods were called after the stream was closed. - The current implementation does not support the read operation. - A read operation cannot be performed because the stream is closed. - - - Begins an asynchronous write operation. (Consider using the method instead.) - - The byte offset in array at which to begin writing. - The maximum number of bytes to write. - - - An object that represents the asynchronous write operation, which could still be pending. - The underlying stream is null. -or- The underlying stream is closed. - - - Gets a value indicating whether the stream supports reading while decompressing a file. - true if the value is Decompress, and the underlying stream supports reading and is not closed; otherwise, false. - - - Gets a value indicating whether the stream supports seeking. - false in all cases. - - - Gets a value indicating whether the stream supports writing. - true if the value is Compress, and the underlying stream supports writing and is not closed; otherwise, false. - - - Releases the unmanaged resources used by the and optionally releases the managed resources. - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - Waits for the pending asynchronous read to complete. (Consider using the the method instead.) - - The number of bytes read from the stream, between 0 (zero) and the number of bytes you requested. returns 0 only at the end of the stream; otherwise, it blocks until at least one byte is available. - async_result is null. - async_result did not originate from a method on the current stream. - The end operation cannot be performed because the stream is closed. - - - Handles the end of an asynchronous write operation. (Consider using the method instead.) - - The underlying stream is null. -or- The underlying stream is closed. - - - The current implementation of this method has no functionality. - The stream is closed. - - - This property is not supported and always throws a . - A long value. - This property is not supported on this stream. - - - This property is not supported and always throws a . - A long value. - This property is not supported on this stream. - - - Reads a number of decompressed bytes into the specified byte array. - The array used to store decompressed bytes. - The byte offset in array at which the read bytes will be placed. - The maximum number of decompressed bytes to read. - The number of bytes that were decompressed into the byte array. If the end of the stream has been reached, zero or the number of bytes read is returned. - array is null. - The value was Compress when the object was created. - or - The underlying stream does not support reading. - offset or count is less than zero. -or- array length minus the index starting point is less than count. - The data is in an invalid format. - The stream is closed. - - - This property is not supported and always throws a . - The location in the stream. - One of the values. - A long value. - This property is not supported on this stream. - - - This property is not supported and always throws a . - The length of the stream. - This property is not supported on this stream. - - - Writes compressed bytes to the underlying stream from the specified byte array. - The buffer that contains the data to compress. - The byte offset in array from which the bytes will be read. - The maximum number of bytes to write. - The write operation cannot be performed because the stream is closed. - - - Represents a package of compressed files in the zip archive format. - - - Initializes a new instance of the class from the specified stream. - The stream that contains the archive to be read. - The stream is already closed or does not support reading. - stream is null. - The contents of the stream are not in the zip archive format. - - - Initializes a new instance of the class from the specified stream and with the specified mode. - The input or output stream. - One of the enumeration values that indicates whether the zip archive is used to read, create, or update entries. - The stream is already closed, or the capabilities of the stream do not match the mode. - stream is null. - mode is an invalid value. - The contents of the stream could not be interpreted as a zip archive. -or- mode is and an entry is missing from the archive or is corrupt and cannot be read. -or- mode is and an entry is too large to fit into memory. - - - Initializes a new instance of the class on the specified stream for the specified mode, and optionally leaves the stream open. - The input or output stream. - One of the enumeration values that indicates whether the zip archive is used to read, create, or update entries. - true to leave the stream open after the object is disposed; otherwise, false. - The stream is already closed, or the capabilities of the stream do not match the mode. - stream is null. - mode is an invalid value. - The contents of the stream could not be interpreted as a zip archive. -or- mode is and an entry is missing from the archive or is corrupt and cannot be read. -or- mode is and an entry is too large to fit into memory. - - - Initializes a new instance of the class on the specified stream for the specified mode, uses the specified encoding for entry names, and optionally leaves the stream open. - The input or output stream. - One of the enumeration values that indicates whether the zip archive is used to read, create, or update entries. - true to leave the stream open after the object is disposed; otherwise, false. - The encoding to use when reading or writing entry names in this archive. Specify a value for this parameter only when an encoding is required for interoperability with zip archive tools and libraries that do not support UTF-8 encoding for entry names. - The stream is already closed, or the capabilities of the stream do not match the mode. - stream is null. - mode is an invalid value. - The contents of the stream could not be interpreted as a zip archive. -or- mode is and an entry is missing from the archive or is corrupt and cannot be read. -or- mode is and an entry is too large to fit into memory. - - - Creates an empty entry that has the specified path and entry name in the zip archive. - A path, relative to the root of the archive, that specifies the name of the entry to be created. - An empty entry in the zip archive. - entryName is . - entryName is null. - The zip archive does not support writing. - The zip archive has been disposed. - - - Creates an empty entry that has the specified entry name and compression level in the zip archive. - A path, relative to the root of the archive, that specifies the name of the entry to be created. - One of the enumeration values that indicates whether to emphasize speed or compression effectiveness when creating the entry. - An empty entry in the zip archive. - entryName is . - entryName is null. - The zip archive does not support writing. - The zip archive has been disposed. - - - Releases the resources used by the current instance of the class. - - - Called by the and methods to release the unmanaged resources used by the current instance of the class, and optionally finishes writing the archive and releases the managed resources. - true to finish writing the archive and release unmanaged and managed resources; false to release only unmanaged resources. - - - Gets the collection of entries that are currently in the zip archive. - The collection of entries that are currently in the zip archive. - The zip archive does not support reading. - The zip archive has been disposed. - The zip archive is corrupt, and its entries cannot be retrieved. - - - Retrieves a wrapper for the specified entry in the zip archive. - A path, relative to the root of the archive, that identifies the entry to retrieve. - A wrapper for the specified entry in the archive; null if the entry does not exist in the archive. - entryName is . - entryName is null. - The zip archive does not support reading. - The zip archive has been disposed. - The zip archive is corrupt, and its entries cannot be retrieved. - - - Gets a value that describes the type of action the zip archive can perform on entries. - One of the enumeration values that describes the type of action (read, create, or update) the zip archive can perform on entries. - - - Represents a compressed file within a zip archive. - - - Gets the zip archive that the entry belongs to. - The zip archive that the entry belongs to, or null if the entry has been deleted. - - - Gets the compressed size of the entry in the zip archive. - The compressed size of the entry in the zip archive. - The value of the property is not available because the entry has been modified. - - - Deletes the entry from the zip archive. - The entry is already open for reading or writing. - The zip archive for this entry was opened in a mode other than . - The zip archive for this entry has been disposed. - - - Gets the relative path of the entry in the zip archive. - The relative path of the entry in the zip archive. - - - Gets or sets the last time the entry in the zip archive was changed. - The last time the entry in the zip archive was changed. - The attempt to set this property failed, because the zip archive for the entry is in mode. - The archive mode is set to . - or - The archive mode is set to and the entry has been opened. - An attempt was made to set this property to a value that is either earlier than 1980 January 1 0:00:00 (midnight) or later than 2107 December 31 23:59:58 (one second before midnight). - - - Gets the uncompressed size of the entry in the zip archive. - The uncompressed size of the entry in the zip archive. - The value of the property is not available because the entry has been modified. - - - Gets the file name of the entry in the zip archive. - The file name of the entry in the zip archive. - - - Opens the entry from the zip archive. - The stream that represents the contents of the entry. - The entry is already currently open for writing. -or- The entry has been deleted from the archive. -or- The archive for this entry was opened with the mode, and this entry has already been written to. - The entry is either missing from the archive or is corrupt and cannot be read. -or- The entry has been compressed by using a compression method that is not supported. - The zip archive for this entry has been disposed. - - - Retrieves the relative path of the entry in the zip archive. - The relative path of the entry, which is the value stored in the property. - - - Specifies values for interacting with zip archive entries. - - - Only creating new archive entries is permitted. - - - - Only reading archive entries is permitted. - - - - Both read and write operations are permitted for archive entries. - - - - Provides static methods for creating, extracting, and opening zip archives. - - - Creates a zip archive that contains the files and directories from the specified directory. - The path to the directory to be archived, specified as a relative or absolute path. A relative path is interpreted as relative to the current working directory. - The path of the archive to be created, specified as a relative or absolute path. A relative path is interpreted as relative to the current working directory. - sourceDirectoryName or destinationArchiveFileName is , contains only white space, or contains at least one invalid character. - sourceDirectoryName or destinationArchiveFileName is null. - In sourceDirectoryName or destinationArchiveFileName, the specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must not exceed 248 characters, and file names must not exceed 260 characters. - sourceDirectoryName is invalid or does not exist (for example, it is on an unmapped drive). - destinationArchiveFileName already exists. -or- A file in the specified directory could not be opened. - destinationArchiveFileName specifies a directory. -or- The caller does not have the required permission to access the directory specified in sourceDirectoryName or the file specified in destinationArchiveFileName. - sourceDirectoryName or destinationArchiveFileName contains an invalid format. -or- The zip archive does not support writing. - - - Creates a zip archive that contains the files and directories from the specified directory, uses the specified compression level, and optionally includes the base directory. - The path to the directory to be archived, specified as a relative or absolute path. A relative path is interpreted as relative to the current working directory. - The path of the archive to be created, specified as a relative or absolute path. A relative path is interpreted as relative to the current working directory. - One of the enumeration values that indicates whether to emphasize speed or compression effectiveness when creating the entry. - true to include the directory name from sourceDirectoryName at the root of the archive; false to include only the contents of the directory. - sourceDirectoryName or destinationArchiveFileName is , contains only white space, or contains at least one invalid character. - sourceDirectoryName or destinationArchiveFileName is null. - In sourceDirectoryName or destinationArchiveFileName, the specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must not exceed 248 characters, and file names must not exceed 260 characters. - sourceDirectoryName is invalid or does not exist (for example, it is on an unmapped drive). - destinationArchiveFileName already exists. -or- A file in the specified directory could not be opened. - destinationArchiveFileName specifies a directory. -or- The caller does not have the required permission to access the directory specified in sourceDirectoryName or the file specified in destinationArchiveFileName. - sourceDirectoryName or destinationArchiveFileName contains an invalid format. -or- The zip archive does not support writing. - - - Creates a zip archive that contains the files and directories from the specified directory, uses the specified compression level and character encoding for entry names, and optionally includes the base directory. - The path to the directory to be archived, specified as a relative or absolute path. A relative path is interpreted as relative to the current working directory. - The path of the archive to be created, specified as a relative or absolute path. A relative path is interpreted as relative to the current working directory. - One of the enumeration values that indicates whether to emphasize speed or compression effectiveness when creating the entry. - true to include the directory name from sourceDirectoryName at the root of the archive; false to include only the contents of the directory. - The encoding to use when reading or writing entry names in this archive. Specify a value for this parameter only when an encoding is required for interoperability with zip archive tools and libraries that do not support UTF-8 encoding for entry names. - sourceDirectoryName or destinationArchiveFileName is , contains only white space, or contains at least one invalid character. -or- entryNameEncoding is set to a Unicode encoding other than UTF-8. - sourceDirectoryName or destinationArchiveFileName is null. - In sourceDirectoryName or destinationArchiveFileName, the specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must not exceed 248 characters, and file names must not exceed 260 characters. - sourceDirectoryName is invalid or does not exist (for example, it is on an unmapped drive). - destinationArchiveFileName already exists. -or- A file in the specified directory could not be opened. - destinationArchiveFileName specifies a directory. -or- The caller does not have the required permission to access the directory specified in sourceDirectoryName or the file specified in destinationArchiveFileName. - sourceDirectoryName or destinationArchiveFileName contains an invalid format. -or- The zip archive does not support writing. - - - Extracts all the files in the specified zip archive to a directory on the file system. - The path to the archive that is to be extracted. - The path to the directory in which to place the extracted files, specified as a relative or absolute path. A relative path is interpreted as relative to the current working directory. - destinationDirectoryName or sourceArchiveFileName is , contains only white space, or contains at least one invalid character. - destinationDirectoryName or sourceArchiveFileName is null. - The specified path in destinationDirectoryName or sourceArchiveFileName exceeds the system-defined maximum length. For example, on Windows-based platforms, paths must not exceed 248 characters, and file names must not exceed 260 characters. - The specified path is invalid (for example, it is on an unmapped drive). - The directory specified by destinationDirectoryName already exists. -or- The name of an entry in the archive is , contains only white space, or contains at least one invalid character. -or- Extracting an archive entry would create a file that is outside the directory specified by destinationDirectoryName. (For example, this might happen if the entry name contains parent directory accessors.) -or- An archive entry to extract has the same name as an entry that has already been extracted from the same archive. - The caller does not have the required permission to access the archive or the destination directory. - destinationDirectoryName or sourceArchiveFileName contains an invalid format. - sourceArchiveFileName was not found. - The archive specified by sourceArchiveFileName is not a valid zip archive. -or- An archive entry was not found or was corrupt. -or- An archive entry was compressed by using a compression method that is not supported. - - - Extracts all the files in the specified zip archive to a directory on the file system and uses the specified character encoding for entry names. - The path to the archive that is to be extracted. - The path to the directory in which to place the extracted files, specified as a relative or absolute path. A relative path is interpreted as relative to the current working directory. - The encoding to use when reading or writing entry names in this archive. Specify a value for this parameter only when an encoding is required for interoperability with zip archive tools and libraries that do not support UTF-8 encoding for entry names. - destinationDirectoryName or sourceArchiveFileName is , contains only white space, or contains at least one invalid character. -or- entryNameEncoding is set to a Unicode encoding other than UTF-8. - destinationDirectoryName or sourceArchiveFileName is null. - The specified path in destinationDirectoryName or sourceArchiveFileName exceeds the system-defined maximum length. For example, on Windows-based platforms, paths must not exceed 248 characters, and file names must not exceed 260 characters. - The specified path is invalid (for example, it is on an unmapped drive). - The directory specified by destinationDirectoryName already exists. -or- The name of an entry in the archive is , contains only white space, or contains at least one invalid character. -or- Extracting an archive entry would create a file that is outside the directory specified by destinationDirectoryName. (For example, this might happen if the entry name contains parent directory accessors.) -or- An archive entry to extract has the same name as an entry that has already been extracted from the same archive. - The caller does not have the required permission to access the archive or the destination directory. - destinationDirectoryName or sourceArchiveFileName contains an invalid format. - sourceArchiveFileName was not found. - The archive specified by sourceArchiveFileName is not a valid zip archive. -or- An archive entry was not found or was corrupt. -or- An archive entry was compressed by using a compression method that is not supported. - - - Opens a zip archive at the specified path and in the specified mode. - The path to the archive to open, specified as a relative or absolute path. A relative path is interpreted as relative to the current working directory. - One of the enumeration values that specifies the actions which are allowed on the entries in the opened archive. - The opened zip archive. - archiveFileName is , contains only white space, or contains at least one invalid character. - archiveFileName is null. - In archiveFileName, the specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must not exceed 248 characters, and file names must not exceed 260 characters. - archiveFileName is invalid or does not exist (for example, it is on an unmapped drive). - archiveFileName could not be opened. -or- mode is set to , but the file specified in archiveFileName already exists. - archiveFileName specifies a directory. -or- The caller does not have the required permission to access the file specified in archiveFileName. - mode specifies an invalid value. - mode is set to , but the file specified in archiveFileName is not found. - archiveFileName contains an invalid format. - archiveFileName could not be interpreted as a zip archive. -or- mode is , but an entry is missing or corrupt and cannot be read. -or- mode is , but an entry is too large to fit into memory. - - - Opens a zip archive at the specified path, in the specified mode, and by using the specified character encoding for entry names. - The path to the archive to open, specified as a relative or absolute path. A relative path is interpreted as relative to the current working directory. - One of the enumeration values that specifies the actions that are allowed on the entries in the opened archive. - The encoding to use when reading or writing entry names in this archive. Specify a value for this parameter only when an encoding is required for interoperability with zip archive tools and libraries that do not support UTF-8 encoding for entry names. - The opened zip archive. - archiveFileName is , contains only white space, or contains at least one invalid character. -or- entryNameEncoding is set to a Unicode encoding other than UTF-8. - archiveFileName is null. - In archiveFileName, the specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must not exceed 248 characters, and file names must not exceed 260 characters. - archiveFileName is invalid or does not exist (for example, it is on an unmapped drive). - archiveFileName could not be opened. -or- mode is set to , but the file specified in archiveFileName already exists. - archiveFileName specifies a directory. -or- The caller does not have the required permission to access the file specified in archiveFileName. - mode specifies an invalid value. - mode is set to , but the file specified in archiveFileName is not found. - archiveFileName contains an invalid format. - archiveFileName could not be interpreted as a zip archive. -or- mode is , but an entry is missing or corrupt and cannot be read. -or- mode is , but an entry is too large to fit into memory. - - - Opens a zip archive for reading at the specified path. - The path to the archive to open, specified as a relative or absolute path. A relative path is interpreted as relative to the current working directory. - The opened zip archive. - archiveFileName is , contains only white space, or contains at least one invalid character. - archiveFileName is null. - In archiveFileName, the specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must not exceed 248 characters, and file names must not exceed 260 characters. - archiveFileName is invalid or does not exist (for example, it is on an unmapped drive). - archiveFileName could not be opened. - archiveFileName specifies a directory. -or- The caller does not have the required permission to access the file specified in archiveFileName. - The file specified in archiveFileName is not found. - archiveFileName contains an invalid format. - archiveFileName could not be interpreted as a zip archive. - - - Provides extension methods for the and classes. - - - Archives a file by compressing it and adding it to the zip archive. - The zip archive to add the file to. - The path to the file to be archived. You can specify either a relative or an absolute path. A relative path is interpreted as relative to the current working directory. - The name of the entry to create in the zip archive. - A wrapper for the new entry in the zip archive. - sourceFileName is , contains only white space, or contains at least one invalid character. -or- entryName is . - sourceFileName or entryName is null. - In sourceFileName, the specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must not exceed 248 characters, and file names must not exceed 260 characters. - sourceFileName is invalid (for example, it is on an unmapped drive). - The file specified by sourceFileName cannot be opened. - sourceFileName specifies a directory. -or- The caller does not have the required permission to access the file specified by sourceFileName. - The file specified by sourceFileName is not found. - The sourceFileName parameter is in an invalid format. -or- The zip archive does not support writing. - The zip archive has been disposed. - - - Archives a file by compressing it using the specified compression level and adding it to the zip archive. - The zip archive to add the file to. - The path to the file to be archived. You can specify either a relative or an absolute path. A relative path is interpreted as relative to the current working directory. - The name of the entry to create in the zip archive. - One of the enumeration values that indicates whether to emphasize speed or compression effectiveness when creating the entry. - A wrapper for the new entry in the zip archive. - sourceFileName is , contains only white space, or contains at least one invalid character. -or- entryName is . - sourceFileName or entryName is null. - sourceFileName is invalid (for example, it is on an unmapped drive). - In sourceFileName, the specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must not exceed 248 characters, and file names must not exceed 260 characters. - The file specified by sourceFileName cannot be opened. - sourceFileName specifies a directory. -or- The caller does not have the required permission to access the file specified by sourceFileName. - The file specified by sourceFileName is not found. - The sourceFileName parameter is in an invalid format. -or- The zip archive does not support writing. - The zip archive has been disposed. - - - Extracts all the files in the zip archive to a directory on the file system. - The zip archive to extract files from. - The path to the directory to place the extracted files in. You can specify either a relative or an absolute path. A relative path is interpreted as relative to the current working directory. - destinationDirectoryName is , contains only white space, or contains at least one invalid character. - destinationDirectoryName is null. - The specified path exceeds the system-defined maximum length. For example, on Windows-based platforms, paths must not exceed 248 characters, and file names must not exceed 260 characters. - The specified path is invalid (for example, it is on an unmapped drive). - The directory specified by destinationDirectoryName already exists. -or- The name of an entry in the archive is , contains only white space, or contains at least one invalid character. -or- Extracting an entry from the archive would create a file that is outside the directory specified by destinationDirectoryName. (For example, this might happen if the entry name contains parent directory accessors.) -or- Two or more entries in the archive have the same name. - The caller does not have the required permission to write to the destination directory. - destinationDirectoryName contains an invalid format. - An archive entry cannot be found or is corrupt. -or- An archive entry was compressed by using a compression method that is not supported. - - - Extracts an entry in the zip archive to a file. - The zip archive entry to extract a file from. - The path of the file to create from the contents of the entry. You can specify either a relative or an absolute path. A relative path is interpreted as relative to the current working directory. - destinationFileName is a zero-length string, contains only white space, or contains one or more invalid characters as defined by . -or- destinationFileName specifies a directory. - destinationFileName is null. - The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must not exceed 248 characters, and file names must not exceed 260 characters. - The specified path is invalid (for example, it is on an unmapped drive). - destinationFileName already exists. -or- An I/O error occurred. -or- The entry is currently open for writing. -or- The entry has been deleted from the archive. - The caller does not have the required permission to create the new file. - The entry is missing from the archive, or is corrupt and cannot be read. -or- The entry has been compressed by using a compression method that is not supported. - The zip archive that this entry belongs to has been disposed. - destinationFileName is in an invalid format. -or- The zip archive for this entry was opened in mode, which does not permit the retrieval of entries. - - - Extracts an entry in the zip archive to a file, and optionally overwrites an existing file that has the same name. - The zip archive entry to extract a file from. - The path of the file to create from the contents of the entry. You can specify either a relative or an absolute path. A relative path is interpreted as relative to the current working directory. - true to overwrite an existing file that has the same name as the destination file; otherwise, false. - destinationFileName is a zero-length string, contains only white space, or contains one or more invalid characters as defined by . -or- destinationFileName specifies a directory. - destinationFileName is null. - The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must not exceed 248 characters, and file names must not exceed 260 characters. - The specified path is invalid (for example, it is on an unmapped drive). - destinationFileName already exists and overwrite is false. -or- An I/O error occurred. -or- The entry is currently open for writing. -or- The entry has been deleted from the archive. - The caller does not have the required permission to create the new file. - The entry is missing from the archive or is corrupt and cannot be read. -or- The entry has been compressed by using a compression method that is not supported. - The zip archive that this entry belongs to has been disposed. - destinationFileName is in an invalid format. -or- The zip archive for this entry was opened in mode, which does not permit the retrieval of entries. - - - Exposes static methods for creating, moving, and enumerating through directories and subdirectories. This class cannot be inherited. - - - Creates all directories and subdirectories in the specified path unless they already exist. - The directory to create. - An object that represents the directory at the specified path. This object is returned regardless of whether a directory at the specified path already exists. - The directory specified by path is a file. -or- The network name is not known. - The caller does not have the required permission. - path is a zero-length string, contains only white space, or contains one or more invalid characters. You can query for invalid characters by using the method. -or- path is prefixed with, or contains, only a colon character (:). - path is null. - The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters and file names must be less than 260 characters. - The specified path is invalid (for example, it is on an unmapped drive). - path contains a colon character (:) that is not part of a drive label ("C:\"). - - - Deletes an empty directory from a specified path. - The name of the empty directory to remove. This directory must be writable and empty. - A file with the same name and location specified by path exists. -or- The directory is the application's current working directory. -or- The directory specified by path is not empty. -or- The directory is read-only or contains a read-only file. -or- The directory is being used by another process. - The caller does not have the required permission. - path is a zero-length string, contains only white space, or contains one or more invalid characters. You can query for invalid characters by using the method. - path is null. - The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters and file names must be less than 260 characters. - path does not exist or could not be found. -or- The specified path is invalid (for example, it is on an unmapped drive). - - - Deletes the specified directory and, if indicated, any subdirectories and files in the directory. - The name of the directory to remove. - true to remove directories, subdirectories, and files in path; otherwise, false. - A file with the same name and location specified by path exists. -or- The directory specified by path is read-only, or recursive is false and path is not an empty directory. -or- The directory is the application's current working directory. -or- The directory contains a read-only file. -or- The directory is being used by another process. - The caller does not have the required permission. - path is a zero-length string, contains only white space, or contains one or more invalid characters. You can query for invalid characters by using the method. - path is null. - The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters and file names must be less than 260 characters. - path does not exist or could not be found. -or- The specified path is invalid (for example, it is on an unmapped drive). - - - Returns an enumerable collection of directory names in a specified path. - The relative or absolute path to the directory to search. This string is not case-sensitive. - An enumerable collection of the full names (including paths) for the directories in the directory specified by path. - path is a zero-length string, contains only white space, or contains invalid characters. You can query for invalid characters by using the method. - path is null. - path is invalid, such as referring to an unmapped drive. - path is a file name. - The specified path, file name, or combined exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters and file names must be less than 260 characters. - The caller does not have the required permission. - The caller does not have the required permission. - - - Returns an enumerable collection of directory names that match a search pattern in a specified path. - The relative or absolute path to the directory to search. This string is not case-sensitive. - The search string to match against the names of directories in path. This parameter can contain a combination of valid literal path and wildcard (* and ?) characters, but it doesn't support regular expressions. - An enumerable collection of the full names (including paths) for the directories in the directory specified by path and that match the specified search pattern. - path is a zero-length string, contains only white space, or contains invalid characters. You can query for invalid characters with the method. - or - searchPattern does not contain a valid pattern. - path is null. -or- searchPattern is null. - path is invalid, such as referring to an unmapped drive. - path is a file name. - The specified path, file name, or combined exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters and file names must be less than 260 characters. - The caller does not have the required permission. - The caller does not have the required permission. - - - Returns an enumerable collection of directory names that match a search pattern in a specified path, and optionally searches subdirectories. - The relative or absolute path to the directory to search. This string is not case-sensitive. - The search string to match against the names of directories in path. This parameter can contain a combination of valid literal path and wildcard (* and ?) characters, but it doesn't support regular expressions. - One of the enumeration values that specifies whether the search operation should include only the current directory or should include all subdirectories. The default value is . - An enumerable collection of the full names (including paths) for the directories in the directory specified by path and that match the specified search pattern and option. - path is a zero-length string, contains only white space, or contains invalid characters. You can query for invalid characters by using the method. - or - searchPattern does not contain a valid pattern. - path is null. -or- searchPattern is null. - searchOption is not a valid value. - path is invalid, such as referring to an unmapped drive. - path is a file name. - The specified path, file name, or combined exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters and file names must be less than 260 characters. - The caller does not have the required permission. - The caller does not have the required permission. - - - Returns an enumerable collection of file names that match a search pattern in a specified path. - The relative or absolute path to the directory to search. This string is not case-sensitive. - The search string to match against the names of files in path. This parameter can contain a combination of valid literal path and wildcard (* and ?) characters, but it doesn't support regular expressions. - An enumerable collection of the full names (including paths) for the files in the directory specified by path and that match the specified search pattern. - path is a zero-length string, contains only white space, or contains invalid characters. You can query for invalid characters by using the method. - or - searchPattern does not contain a valid pattern. - path is null. -or- searchPattern is null. - path is invalid, such as referring to an unmapped drive. - path is a file name. - The specified path, file name, or combined exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters and file names must be less than 260 characters. - The caller does not have the required permission. - The caller does not have the required permission. - - - Returns an enumerable collection of file names that match a search pattern in a specified path, and optionally searches subdirectories. - The relative or absolute path to the directory to search. This string is not case-sensitive. - The search string to match against the names of files in path. This parameter can contain a combination of valid literal path and wildcard (* and ?) characters, but it doesn't support regular expressions. - One of the enumeration values that specifies whether the search operation should include only the current directory or should include all subdirectories. The default value is . - An enumerable collection of the full names (including paths) for the files in the directory specified by path and that match the specified search pattern and option. - path is a zero-length string, contains only white space, or contains invalid characters. You can query for invalid characters by using the method. - or - searchPattern does not contain a valid pattern. - path is null. -or- searchPattern is null. - searchOption is not a valid value. - path is invalid, such as referring to an unmapped drive. - path is a file name. - The specified path, file name, or combined exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters and file names must be less than 260 characters. - The caller does not have the required permission. - The caller does not have the required permission. - - - Returns an enumerable collection of file names in a specified path. - The relative or absolute path to the directory to search. This string is not case-sensitive. - An enumerable collection of the full names (including paths) for the files in the directory specified by path. - path is a zero-length string, contains only white space, or contains invalid characters. You can query for invalid characters by using the method. - path is null. - path is invalid, such as referring to an unmapped drive. - path is a file name. - The specified path, file name, or combined exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters and file names must be less than 260 characters. - The caller does not have the required permission. - The caller does not have the required permission. - - - Returns an enumerable collection of file names and directory names in a specified path. - The relative or absolute path to the directory to search. This string is not case-sensitive. - An enumerable collection of file-system entries in the directory specified by path. - path is a zero-length string, contains only white space, or contains invalid characters. You can query for invalid characters by using the method. - path is null. - path is invalid, such as referring to an unmapped drive. - path is a file name. - The specified path, file name, or combined exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters and file names must be less than 260 characters. - The caller does not have the required permission. - The caller does not have the required permission. - - - Returns an enumerable collection of file names and directory names that match a search pattern in a specified path. - The relative or absolute path to the directory to search. This string is not case-sensitive. - The search string to match against the names of file-system entries in path. This parameter can contain a combination of valid literal path and wildcard (* and ?) characters, but it doesn't support regular expressions. - An enumerable collection of file-system entries in the directory specified by path and that match the specified search pattern. - path is a zero-length string, contains only white space, or contains invalid characters. You can query for invalid characters by using the method. - or - searchPattern does not contain a valid pattern. - path is null. -or- searchPattern is null. - path is invalid, such as referring to an unmapped drive. - path is a file name. - The specified path, file name, or combined exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters and file names must be less than 260 characters. - The caller does not have the required permission. - The caller does not have the required permission. - - - Returns an enumerable collection of file names and directory names that match a search pattern in a specified path, and optionally searches subdirectories. - The relative or absolute path to the directory to search. This string is not case-sensitive. - The search string to match against file-system entries in path. This parameter can contain a combination of valid literal path and wildcard (* and ?) characters, but it doesn't support regular expressions. - One of the enumeration values that specifies whether the search operation should include only the current directory or should include all subdirectories. The default value is . - An enumerable collection of file-system entries in the directory specified by path and that match the specified search pattern and option. - path is a zero-length string, contains only white space, or contains invalid characters. You can query for invalid characters by using the method. - or - searchPattern does not contain a valid pattern. - path is null. -or- searchPattern is null. - searchOption is not a valid value. - path is invalid, such as referring to an unmapped drive. - path is a file name. - The specified path, file name, or combined exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters and file names must be less than 260 characters. - The caller does not have the required permission. - The caller does not have the required permission. - - - Determines whether the given path refers to an existing directory on disk. - The path to test. - true if path refers to an existing directory; false if the directory does not exist or an error occurs when trying to determine if the specified directory exists. - - - Gets the creation date and time of a directory. - The path of the directory. - A structure that is set to the creation date and time for the specified directory. This value is expressed in local time. - The caller does not have the required permission. - path is a zero-length string, contains only white space, or contains one or more invalid characters. You can query for invalid characters by using the method. - path is null. - The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters and file names must be less than 260 characters. - - - Gets the creation date and time, in Coordinated Universal Time (UTC) format, of a directory. - The path of the directory. - A structure that is set to the creation date and time for the specified directory. This value is expressed in UTC time. - The caller does not have the required permission. - path is a zero-length string, contains only white space, or contains one or more invalid characters. You can query for invalid characters by using the method. - path is null. - The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters and file names must be less than 260 characters. - - - Gets the current working directory of the application. - A string that contains the path of the current working directory, and does not end with a backslash (\). - The caller does not have the required permission. - The operating system is Windows CE, which does not have current directory functionality. This method is available in the .NET Compact Framework, but is not currently supported. - - - Returns the names of subdirectories (including their paths) that match the specified search pattern in the specified directory. - The relative or absolute path to the directory to search. This string is not case-sensitive. - The search string to match against the names of subdirectories in path. This parameter can contain a combination of valid literal and wildcard characters, but it doesn't support regular expressions. - An array of the full names (including paths) of the subdirectories that match the search pattern in the specified directory, or an empty array if no directories are found. - The caller does not have the required permission. - path is a zero-length string, contains only white space, or contains one or more invalid characters. You can query for invalid characters by using . -or- searchPattern doesn't contain a valid pattern. - path or searchPattern is null. - The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters and file names must be less than 260 characters. - path is a file name. - The specified path is invalid (for example, it is on an unmapped drive). - - - Returns the names of the subdirectories (including their paths) that match the specified search pattern in the specified directory, and optionally searches subdirectories. - The relative or absolute path to the directory to search. This string is not case-sensitive. - The search string to match against the names of subdirectories in path. This parameter can contain a combination of valid literal and wildcard characters, but it doesn't support regular expressions. - One of the enumeration values that specifies whether the search operation should include all subdirectories or only the current directory. - An array of the full names (including paths) of the subdirectories that match the specified criteria, or an empty array if no directories are found. - path is a zero-length string, contains only white space, or contains one or more invalid characters. You can query for invalid characters by using the method. -or- searchPattern does not contain a valid pattern. - path or searchPattern is null. - searchOption is not a valid value. - The caller does not have the required permission. - The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters and file names must be less than 260 characters. - path is a file name. - The specified path is invalid (for example, it is on an unmapped drive). - - - Returns the names of subdirectories (including their paths) in the specified directory. - The relative or absolute path to the directory to search. This string is not case-sensitive. - An array of the full names (including paths) of subdirectories in the specified path, or an empty array if no directories are found. - The caller does not have the required permission. - path is a zero-length string, contains only white space, or contains one or more invalid characters. You can query for invalid characters by using the method. - path is null. - The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters and file names must be less than 260 characters. - path is a file name. - The specified path is invalid (for example, it is on an unmapped drive). - - - Returns the volume information, root information, or both for the specified path. - The path of a file or directory. - A string that contains the volume information, root information, or both for the specified path. - The caller does not have the required permission. - path is a zero-length string, contains only white space, or contains one or more invalid characters. You can query for invalid characters with . - path is null. - The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters and file names must be less than 260 characters. - - - Returns the names of files (including their paths) in the specified directory. - The relative or absolute path to the directory to search. This string is not case-sensitive. - An array of the full names (including paths) for the files in the specified directory, or an empty array if no files are found. - path is a file name. -or- A network error has occurred. - The caller does not have the required permission. - path is a zero-length string, contains only white space, or contains one or more invalid characters. You can query for invalid characters by using the method. - path is null. - The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters and file names must be less than 260 characters. - The specified path is not found or is invalid (for example, it is on an unmapped drive). - - - Returns the names of files (including their paths) that match the specified search pattern in the specified directory. - The relative or absolute path to the directory to search. This string is not case-sensitive. - The search string to match against the names of files in path. This parameter can contain a combination of valid literal path and wildcard (* and ?) characters, but it doesn't support regular expressions. - An array of the full names (including paths) for the files in the specified directory that match the specified search pattern, or an empty array if no files are found. - path is a file name. -or- A network error has occurred. - The caller does not have the required permission. - path is a zero-length string, contains only white space, or contains one or more invalid characters. You can query for invalid characters by using . -or- searchPattern doesn't contain a valid pattern. - path or searchPattern is null. - The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters and file names must be less than 260 characters. - The specified path is not found or is invalid (for example, it is on an unmapped drive). - - - Returns the names of files (including their paths) that match the specified search pattern in the specified directory, using a value to determine whether to search subdirectories. - The relative or absolute path to the directory to search. This string is not case-sensitive. - The search string to match against the names of files in path. This parameter can contain a combination of valid literal path and wildcard (* and ?) characters, but it doesn't support regular expressions. - One of the enumeration values that specifies whether the search operation should include all subdirectories or only the current directory. - An array of the full names (including paths) for the files in the specified directory that match the specified search pattern and option, or an empty array if no files are found. - path is a zero-length string, contains only white space, or contains one or more invalid characters. You can query for invalid characters with the method. -or- searchPattern does not contain a valid pattern. - path or searchpattern is null. - searchOption is not a valid value. - The caller does not have the required permission. - The specified path is not found or is invalid (for example, it is on an unmapped drive). - The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters and file names must be less than 260 characters. - path is a file name. -or- A network error has occurred. - - - Returns the names of all files and subdirectories in a specified path. - The relative or absolute path to the directory to search. This string is not case-sensitive. - An array of the names of files and subdirectories in the specified directory, or an empty array if no files or subdirectories are found. - The caller does not have the required permission. - path is a zero-length string, contains only white space, or contains one or more invalid characters. You can query for invalid characters with . - path is null. - The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters and file names must be less than 260 characters. - path is a file name. - The specified path is invalid (for example, it is on an unmapped drive). - - - Returns an array of file names and directory names that that match a search pattern in a specified path. - The relative or absolute path to the directory to search. This string is not case-sensitive. - The search string to match against the names of file and directories in path. This parameter can contain a combination of valid literal path and wildcard (* and ?) characters, but it doesn't support regular expressions. - An array of file names and directory names that match the specified search criteria, or an empty array if no files or directories are found. - The caller does not have the required permission. - path is a zero-length string, contains only white space, or contains one or more invalid characters. You can query for invalid characters with the method. -or- searchPattern does not contain a valid pattern. - path or searchPattern is null. - The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters and file names must be less than 260 characters. - path is a file name. - The specified path is invalid (for example, it is on an unmapped drive). - - - Returns an array of all the file names and directory names that match a search pattern in a specified path, and optionally searches subdirectories. - The relative or absolute path to the directory to search. This string is not case-sensitive. - The search string to match against the names of files and directories in path. This parameter can contain a combination of valid literal path and wildcard (* and ?) characters, but it doesn't support regular expressions. - One of the enumeration values that specifies whether the search operation should include only the current directory or should include all subdirectories. The default value is . - An array of file the file names and directory names that match the specified search criteria, or an empty array if no files or directories are found. - path is a zero-length string, contains only white space, or contains invalid characters. You can query for invalid characters by using the method. - or - searchPattern does not contain a valid pattern. - path is null. -or- searchPattern is null. - searchOption is not a valid value. - path is invalid, such as referring to an unmapped drive. - path is a file name. - The specified path, file name, or combined exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters and file names must be less than 260 characters. - The caller does not have the required permission. - The caller does not have the required permission. - - - Returns the date and time the specified file or directory was last accessed. - The file or directory for which to obtain access date and time information. - A structure that is set to the date and time the specified file or directory was last accessed. This value is expressed in local time. - The caller does not have the required permission. - path is a zero-length string, contains only white space, or contains one or more invalid characters. You can query for invalid characters with the method. - path is null. - The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters and file names must be less than 260 characters. - The path parameter is in an invalid format. - - - Returns the date and time, in Coordinated Universal Time (UTC) format, that the specified file or directory was last accessed. - The file or directory for which to obtain access date and time information. - A structure that is set to the date and time the specified file or directory was last accessed. This value is expressed in UTC time. - The caller does not have the required permission. - path is a zero-length string, contains only white space, or contains one or more invalid characters. You can query for invalid characters with the method. - path is null. - The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters and file names must be less than 260 characters. - The path parameter is in an invalid format. - - - Returns the date and time the specified file or directory was last written to. - The file or directory for which to obtain modification date and time information. - A structure that is set to the date and time the specified file or directory was last written to. This value is expressed in local time. - The caller does not have the required permission. - path is a zero-length string, contains only white space, or contains one or more invalid characters. You can query for invalid characters with the method. - path is null. - The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters and file names must be less than 260 characters. - - - Returns the date and time, in Coordinated Universal Time (UTC) format, that the specified file or directory was last written to. - The file or directory for which to obtain modification date and time information. - A structure that is set to the date and time the specified file or directory was last written to. This value is expressed in UTC time. - The caller does not have the required permission. - path is a zero-length string, contains only white space, or contains one or more invalid characters. You can query for invalid characters with the method. - path is null. - The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters and file names must be less than 260 characters. - - -

Retrieves the names of the logical drives on this computer in the form ":&quot;.

-

-
- The logical drives on this computer. - An I/O error occured (for example, a disk error). - The caller does not have the required permission. -
- - Retrieves the parent directory of the specified path, including both absolute and relative paths. - The path for which to retrieve the parent directory. - The parent directory, or null if path is the root directory, including the root of a UNC server or share name. - The directory specified by path is read-only. - The caller does not have the required permission. - path is a zero-length string, contains only white space, or contains one or more invalid characters. You can query for invalid characters with the method. - path is null. - The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters and file names must be less than 260 characters. - The specified path was not found. - - - Moves a file or a directory and its contents to a new location. - The path of the file or directory to move. - The path to the new location for sourceDirName. If sourceDirName is a file, then destDirName must also be a file name. - An attempt was made to move a directory to a different volume. -or- destDirName already exists. -or- The sourceDirName and destDirName parameters refer to the same file or directory. -or- The directory or a file within it is being used by another process. - The caller does not have the required permission. - sourceDirName or destDirName is a zero-length string, contains only white space, or contains one or more invalid characters. You can query for invalid characters with the method. - sourceDirName or destDirName is null. - The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters and file names must be less than 260 characters. - The path specified by sourceDirName is invalid (for example, it is on an unmapped drive). - - - Sets the creation date and time for the specified file or directory. - The file or directory for which to set the creation date and time information. - The date and time the file or directory was last written to. This value is expressed in local time. - The specified path was not found. - path is a zero-length string, contains only white space, or contains one or more invalid characters. You can query for invalid characters with the method. - path is null. - The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters and file names must be less than 260 characters. - The caller does not have the required permission. - creationTime specifies a value outside the range of dates or times permitted for this operation. - The current operating system is not Windows NT or later. - - - Sets the creation date and time, in Coordinated Universal Time (UTC) format, for the specified file or directory. - The file or directory for which to set the creation date and time information. - The date and time the directory or file was created. This value is expressed in local time. - The specified path was not found. - path is a zero-length string, contains only white space, or contains one or more invalid characters. You can query for invalid characters with the method. - path is null. - The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters and file names must be less than 260 characters. - The caller does not have the required permission. - creationTime specifies a value outside the range of dates or times permitted for this operation. - The current operating system is not Windows NT or later. - - - Sets the application's current working directory to the specified directory. - The path to which the current working directory is set. - An I/O error occurred. - path is a zero-length string, contains only white space, or contains one or more invalid characters. You can query for invalid characters with the method. - path is null. - The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters and file names must be less than 260 characters. - The caller does not have the required permission to access unmanaged code. - The specified path was not found. - The specified directory was not found. - - - Sets the date and time the specified file or directory was last accessed. - The file or directory for which to set the access date and time information. - An object that contains the value to set for the access date and time of path. This value is expressed in local time. - The specified path was not found. - path is a zero-length string, contains only white space, or contains one or more invalid characters. You can query for invalid characters with the method. - path is null. - The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters and file names must be less than 260 characters. - The caller does not have the required permission. - The current operating system is not Windows NT or later. - lastAccessTime specifies a value outside the range of dates or times permitted for this operation. - - - Sets the date and time, in Coordinated Universal Time (UTC) format, that the specified file or directory was last accessed. - The file or directory for which to set the access date and time information. - An object that contains the value to set for the access date and time of path. This value is expressed in UTC time. - The specified path was not found. - path is a zero-length string, contains only white space, or contains one or more invalid characters. You can query for invalid characters with the method. - path is null. - The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters and file names must be less than 260 characters. - The caller does not have the required permission. - The current operating system is not Windows NT or later. - lastAccessTimeUtc specifies a value outside the range of dates or times permitted for this operation. - - - Sets the date and time a directory was last written to. - The path of the directory. - The date and time the directory was last written to. This value is expressed in local time. - The specified path was not found. - path is a zero-length string, contains only white space, or contains one or more invalid characters. You can query for invalid characters with the method. - path is null. - The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters and file names must be less than 260 characters. - The caller does not have the required permission. - The current operating system is not Windows NT or later. - lastWriteTime specifies a value outside the range of dates or times permitted for this operation. - - - Sets the date and time, in Coordinated Universal Time (UTC) format, that a directory was last written to. - The path of the directory. - The date and time the directory was last written to. This value is expressed in UTC time. - The specified path was not found. - path is a zero-length string, contains only white space, or contains one or more invalid characters. You can query for invalid characters with the method. - path is null. - The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters and file names must be less than 260 characters. - The caller does not have the required permission. - The current operating system is not Windows NT or later. - lastWriteTimeUtc specifies a value outside the range of dates or times permitted for this operation. - - - Exposes instance methods for creating, moving, and enumerating through directories and subdirectories. This class cannot be inherited. - - - Initializes a new instance of the class on the specified path. - A string specifying the path on which to create the DirectoryInfo. - path is null. - The caller does not have the required permission. - path contains invalid characters such as ", <, >, or |. - The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters, and file names must be less than 260 characters. The specified path, file name, or both are too long. - - - Creates a directory. - The directory cannot be created. - - - Creates a subdirectory or subdirectories on the specified path. The specified path can be relative to this instance of the class. - The specified path. This cannot be a different disk volume or Universal Naming Convention (UNC) name. - The last directory specified in path. - path does not specify a valid file path or contains invalid DirectoryInfo characters. - path is null. - The specified path is invalid, such as being on an unmapped drive. - The subdirectory cannot be created. -or- A file or directory already has the name specified by path. - The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters, and file names must be less than 260 characters. The specified path, file name, or both are too long. - The caller does not have code access permission to create the directory. -or- The caller does not have code access permission to read the directory described by the returned object. This can occur when the path parameter describes an existing directory. - path contains a colon character (:) that is not part of a drive label ("C:\"). - - - Deletes this if it is empty. - The directory contains a read-only file. - The directory described by this object does not exist or could not be found. - The directory is not empty. -or- The directory is the application's current working directory. -or- There is an open handle on the directory, and the operating system is Windows XP or earlier. This open handle can result from enumerating directories. For more information, see How to: Enumerate Directories and Files. - The caller does not have the required permission. - - - Deletes this instance of a , specifying whether to delete subdirectories and files. - true to delete this directory, its subdirectories, and all files; otherwise, false. - The directory contains a read-only file. - The directory described by this object does not exist or could not be found. - The directory is read-only. -or- The directory contains one or more files or subdirectories and recursive is false. -or- The directory is the application's current working directory. -or- There is an open handle on the directory or on one of its files, and the operating system is Windows XP or earlier. This open handle can result from enumerating directories and files. For more information, see How to: Enumerate Directories and Files. - The caller does not have the required permission. - - - Returns an enumerable collection of directory information that matches a specified search pattern and search subdirectory option. - The search string to match against the names of directories. This parameter can contain a combination of valid literal path and wildcard (* and ?) characters, but it doesn't support regular expressions. The default pattern is "*", which returns all files. - One of the enumeration values that specifies whether the search operation should include only the current directory or all subdirectories. The default value is . - An enumerable collection of directories that matches searchPattern and searchOption. - searchPattern is null. - searchOption is not a valid value. - The path encapsulated in the object is invalid (for example, it is on an unmapped drive). - The caller does not have the required permission. - - - Returns an enumerable collection of directory information that matches a specified search pattern. - The search string to match against the names of directories. This parameter can contain a combination of valid literal path and wildcard (* and ?) characters, but it doesn't support regular expressions. The default pattern is "*", which returns all files. - An enumerable collection of directories that matches searchPattern. - searchPattern is null. - The path encapsulated in the object is invalid (for example, it is on an unmapped drive). - The caller does not have the required permission. - - - Returns an enumerable collection of directory information in the current directory. - An enumerable collection of directories in the current directory. - The path encapsulated in the object is invalid (for example, it is on an unmapped drive). - The caller does not have the required permission. - - - Returns an enumerable collection of file information in the current directory. - An enumerable collection of the files in the current directory. - The path encapsulated in the object is invalid (for example, it is on an unmapped drive). - The caller does not have the required permission. - - - Returns an enumerable collection of file information that matches a search pattern. - The search string to match against the names of files. This parameter can contain a combination of valid literal path and wildcard (* and ?) characters, but it doesn't support regular expressions. The default pattern is "*", which returns all files. - An enumerable collection of files that matches searchPattern. - searchPattern is null. - The path encapsulated in the object is invalid, (for example, it is on an unmapped drive). - The caller does not have the required permission. - - - Returns an enumerable collection of file information that matches a specified search pattern and search subdirectory option. - The search string to match against the names of files. This parameter can contain a combination of valid literal path and wildcard (* and ?) characters, but it doesn't support regular expressions. The default pattern is "*", which returns all files. - One of the enumeration values that specifies whether the search operation should include only the current directory or all subdirectories. The default value is . - An enumerable collection of files that matches searchPattern and searchOption. - searchPattern is null. - searchOption is not a valid value. - The path encapsulated in the object is invalid (for example, it is on an unmapped drive). - The caller does not have the required permission. - - - Returns an enumerable collection of file system information in the current directory. - An enumerable collection of file system information in the current directory. - The path encapsulated in the object is invalid (for example, it is on an unmapped drive). - The caller does not have the required permission. - - - Returns an enumerable collection of file system information that matches a specified search pattern. - The search string to match against the names of directories. This parameter can contain a combination of valid literal path and wildcard (* and ?) characters, but it doesn't support regular expressions. The default pattern is "*", which returns all files. - An enumerable collection of file system information objects that matches searchPattern. - searchPattern is null. - The path encapsulated in the object is invalid (for example, it is on an unmapped drive). - The caller does not have the required permission. - - - Returns an enumerable collection of file system information that matches a specified search pattern and search subdirectory option. - The search string to match against the names of directories. This parameter can contain a combination of valid literal path and wildcard (* and ?) characters, but it doesn't support regular expressions. The default pattern is "*", which returns all files. - One of the enumeration values that specifies whether the search operation should include only the current directory or all subdirectories. The default value is . - An enumerable collection of file system information objects that matches searchPattern and searchOption. - searchPattern is null. - searchOption is not a valid value. - The path encapsulated in the object is invalid (for example, it is on an unmapped drive). - The caller does not have the required permission. - - - Gets a value indicating whether the directory exists. - true if the directory exists; otherwise, false. - - - Returns the subdirectories of the current directory. - An array of objects. - The path encapsulated in the object is invalid, such as being on an unmapped drive. - The caller does not have the required permission. - The caller does not have the required permission. - - - Returns an array of directories in the current matching the given search criteria. - The search string to match against the names of directories. This parameter can contain a combination of valid literal path and wildcard (* and ?) characters, but it doesn't support regular expressions. The default pattern is "*", which returns all files. - An array of type DirectoryInfo matching searchPattern. - searchPattern contains one or more invalid characters defined by the method. - searchPattern is null. - The path encapsulated in the DirectoryInfo object is invalid (for example, it is on an unmapped drive). - The caller does not have the required permission. - - - Returns an array of directories in the current matching the given search criteria and using a value to determine whether to search subdirectories. - The search string to match against the names of directories. This parameter can contain a combination of valid literal path and wildcard (* and ?) characters, but it doesn't support regular expressions. The default pattern is "*", which returns all files. - One of the enumeration values that specifies whether the search operation should include only the current directory or all subdirectories. - An array of type DirectoryInfo matching searchPattern. - searchPattern contains one or more invalid characters defined by the method. - searchPattern is null. - searchOption is not a valid value. - The path encapsulated in the DirectoryInfo object is invalid (for example, it is on an unmapped drive). - The caller does not have the required permission. - - - Returns a file list from the current directory. - An array of type . - The path is invalid, such as being on an unmapped drive. - - - Returns a file list from the current directory matching the given search pattern. - The search string to match against the names of files. This parameter can contain a combination of valid literal path and wildcard (* and ?) characters, but it doesn't support regular expressions. The default pattern is "*", which returns all files. - An array of type . - searchPattern contains one or more invalid characters defined by the method. - searchPattern is null. - The path is invalid (for example, it is on an unmapped drive). - The caller does not have the required permission. - - - Returns a file list from the current directory matching the given search pattern and using a value to determine whether to search subdirectories. - The search string to match against the names of files. This parameter can contain a combination of valid literal path and wildcard (* and ?) characters, but it doesn't support regular expressions. The default pattern is "*", which returns all files. - One of the enumeration values that specifies whether the search operation should include only the current directory or all subdirectories. - An array of type . - searchPattern contains one or more invalid characters defined by the method. - searchPattern is null. - searchOption is not a valid value. - The path is invalid (for example, it is on an unmapped drive). - The caller does not have the required permission. - - - Retrieves an array of objects that represent the files and subdirectories matching the specified search criteria. - The search string to match against the names of directories and filesa. This parameter can contain a combination of valid literal path and wildcard (* and ?) characters, but it doesn't support regular expressions. The default pattern is "*", which returns all files. - One of the enumeration values that specifies whether the search operation should include only the current directory or all subdirectories. The default value is . - An array of file system entries that match the search criteria. - searchPattern contains one or more invalid characters defined by the method. - searchPattern is null. - searchOption is not a valid value. - The specified path is invalid (for example, it is on an unmapped drive). - The caller does not have the required permission. - - - Returns an array of strongly typed entries representing all the files and subdirectories in a directory. - An array of strongly typed entries. - The path is invalid (for example, it is on an unmapped drive). - - - Retrieves an array of strongly typed objects representing the files and subdirectories that match the specified search criteria. - The search string to match against the names of directories and files. This parameter can contain a combination of valid literal path and wildcard (* and ?) characters, but it doesn't support regular expressions. The default pattern is "*", which returns all files. - An array of strongly typed FileSystemInfo objects matching the search criteria. - searchPattern contains one or more invalid characters defined by the method. - searchPattern is null. - The specified path is invalid (for example, it is on an unmapped drive). - The caller does not have the required permission. - - - Moves a instance and its contents to a new path. - The name and path to which to move this directory. The destination cannot be another disk volume or a directory with the identical name. It can be an existing directory to which you want to add this directory as a subdirectory. - destDirName is null. - destDirName is an empty string (''"). - An attempt was made to move a directory to a different volume. -or- destDirName already exists. -or- You are not authorized to access this path. -or- The directory being moved and the destination directory have the same name. - The caller does not have the required permission. - The destination directory cannot be found. - - - Gets the name of this instance. - The directory name. - - - Gets the parent directory of a specified subdirectory. - The parent directory, or null if the path is null or if the file path denotes a root (such as "\", "C:", or * "\\server\share"). - The caller does not have the required permission. - - - Gets the root portion of the directory. - An object that represents the root of the directory. - The caller does not have the required permission. - - - Returns the original path that was passed by the user. - Returns the original path that was passed by the user. - - - The exception that is thrown when part of a file or directory cannot be found. - - - Initializes a new instance of the class with its message string set to a system-supplied message and its HRESULT set to COR_E_DIRECTORYNOTFOUND. - - - Initializes a new instance of the class with its message string set to message and its HRESULT set to COR_E_DIRECTORYNOTFOUND. - A that describes the error. The content of message is intended to be understood by humans. The caller of this constructor is required to ensure that this string has been localized for the current system culture. - - - Initializes a new instance of the class with the specified serialization and context information. - The that holds the serialized object data about the exception being thrown. - The that contains contextual information about the source or destination. - - - Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. - The error message that explains the reason for the exception. - The exception that is the cause of the current exception. If the innerException parameter is not null, the current exception is raised in a catch block that handles the inner exception. - - - Provides access to information on a drive. - - - Provides access to information on the specified drive. - A valid drive path or drive letter. This can be either uppercase or lowercase, 'a' to 'z'. A null value is not valid. - The drive letter cannot be null. - The first letter of driveName is not an uppercase or lowercase letter from 'a' to 'z'. -or- driveName does not refer to a valid drive. - - - Indicates the amount of available free space on a drive, in bytes. - The amount of free space available on the drive, in bytes. - Access to the drive information is denied. - An I/O error occurred (for example, a disk error or a drive was not ready). - - - Gets the name of the file system, such as NTFS or FAT32. - The name of the file system on the specified drive. - Access to the drive information is denied. - The drive does not exist or is not mapped. - An I/O error occurred (for example, a disk error or a drive was not ready). - - - Gets the drive type, such as CD-ROM, removable, network, or fixed. - One of the enumeration values that specifies a drive type. - - - Retrieves the drive names of all logical drives on a computer. - An array of type that represents the logical drives on a computer. - An I/O error occurred (for example, a disk error or a drive was not ready). - The caller does not have the required permission. - - - Gets a value that indicates whether a drive is ready. - true if the drive is ready; false if the drive is not ready. - - - Gets the name of a drive, such as C:\. - The name of the drive. - - - Gets the root directory of a drive. - An object that contains the root directory of the drive. - - - Returns a drive name as a string. - The name of the drive. - - - Gets the total amount of free space available on a drive, in bytes. - The total free space available on a drive, in bytes. - Access to the drive information is denied. - The drive is not mapped or does not exist. - An I/O error occurred (for example, a disk error or a drive was not ready). - - - Gets the total size of storage space on a drive, in bytes. - The total size of the drive, in bytes. - Access to the drive information is denied. - The drive is not mapped or does not exist. - An I/O error occurred (for example, a disk error or a drive was not ready). - - - Gets or sets the volume label of a drive. - The volume label. - An I/O error occurred (for example, a disk error or a drive was not ready). - The drive is not mapped or does not exist. - The caller does not have the required permission. - The volume label is being set on a network or CD-ROM drive. -or- Access to the drive information is denied. - - - Populates a object with the data needed to serialize the target object. - The object to populate with data. - The destination (see ) for this serialization. - - - The exception that is thrown when trying to access a drive or share that is not available. - - - Initializes a new instance of the class with its message string set to a system-supplied message and its HRESULT set to COR_E_DIRECTORYNOTFOUND. - - - Initializes a new instance of the class with the specified message string and the HRESULT set to COR_E_DIRECTORYNOTFOUND. - A object that describes the error. The caller of this constructor is required to ensure that this string has been localized for the current system culture. - - - Initializes a new instance of the class with the specified serialization and context information. - A object that contains the serialized object data about the exception being thrown. - A object that contains contextual information about the source or destination of the exception being thrown. - - - Initializes a new instance of the class with the specified error message and a reference to the inner exception that is the cause of this exception. - The error message that explains the reason for the exception. - The exception that is the cause of the current exception. If the innerException parameter is not null, the current exception is raised in a catch block that handles the inner exception. - - - Defines constants for drive types, including CDRom, Fixed, Network, NoRootDirectory, Ram, Removable, and Unknown. - - - The drive is an optical disc device, such as a CD or DVD-ROM. - - - - The drive is a fixed disk. - - - - The drive is a network drive. - - - - The drive does not have a root directory. - - - - The drive is a RAM disk. - - - - The drive is a removable storage device, such as a floppy disk drive or a USB flash drive. - - - - The type of drive is unknown. - - - - The exception that is thrown when reading is attempted past the end of a stream. - - - Initializes a new instance of the class with its message string set to a system-supplied message and its HRESULT set to COR_E_ENDOFSTREAM. - - - Initializes a new instance of the class with its message string set to message and its HRESULT set to COR_E_ENDOFSTREAM. - A string that describes the error. The content of message is intended to be understood by humans. The caller of this constructor is required to ensure that this string has been localized for the current system culture. - - - Initializes a new instance of the class with the specified serialization and context information. - The that holds the serialized object data about the exception being thrown. - The that contains contextual information about the source or destination. - - - Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. - A string that describes the error. The content of message is intended to be understood by humans. The caller of this constructor is required to ensure that this string has been localized for the current system culture. - The exception that is the cause of the current exception. If the innerException parameter is not null, the current exception is raised in a catch block that handles the inner exception. - - - Provides data for the event. - - - Initializes a new instance of the class. - An that represents the error that occurred. - - - Gets the that represents the error that occurred. - An that represents the error that occurred. - - - Represents the method that will handle the event of a object. - The source of the event. - An object that contains the event data. - - - Provides static methods for the creation, copying, deletion, moving, and opening of a single file, and aids in the creation of objects. - - - Appends lines to a file, and then closes the file. If the specified file does not exist, this method creates a file, writes the specified lines to the file, and then closes the file. - The file to append the lines to. The file is created if it doesn't already exist. - The lines to append to the file. - path is a zero-length string, contains only white space, or contains one more invalid characters defined by the method. - Either path or contents is null. - path is invalid (for example, the directory doesn’t exist or it is on an unmapped drive). - The file specified by path was not found. - An I/O error occurred while opening the file. - path exceeds the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters and file names must be less than 260 characters. - path is in an invalid format. - The caller does not have permission to write to the file. - path specifies a file that is read-only. -or- This operation is not supported on the current platform. -or- path is a directory. - - - Appends lines to a file by using a specified encoding, and then closes the file. If the specified file does not exist, this method creates a file, writes the specified lines to the file, and then closes the file. - The file to append the lines to. The file is created if it doesn't already exist. - The lines to append to the file. - The character encoding to use. - path is a zero-length string, contains only white space, or contains one more invalid characters defined by the method. - Either path, contents, or encoding is null. - path is invalid (for example, the directory doesn’t exist or it is on an unmapped drive). - The file specified by path was not found. - An I/O error occurred while opening the file. - path exceeds the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters and file names must be less than 260 characters. - path is in an invalid format. - The caller does not have the required permission. - path specifies a file that is read-only. -or- This operation is not supported on the current platform. -or- path is a directory. -or- The caller does not have the required permission. - - - Opens a file, appends the specified string to the file, and then closes the file. If the file does not exist, this method creates a file, writes the specified string to the file, then closes the file. - The file to append the specified string to. - The string to append to the file. - path is a zero-length string, contains only white space, or contains one or more invalid characters as defined by . - path is null. - The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters, and file names must be less than 260 characters. - The specified path is invalid (for example, the directory doesn’t exist or it is on an unmapped drive). - An I/O error occurred while opening the file. - path specified a file that is read-only. -or- This operation is not supported on the current platform. -or- path specified a directory. -or- The caller does not have the required permission. - path is in an invalid format. - The caller does not have the required permission. - - - Appends the specified string to the file, creating the file if it does not already exist. - The file to append the specified string to. - The string to append to the file. - The character encoding to use. - path is a zero-length string, contains only white space, or contains one or more invalid characters as defined by . - path is null. - The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters, and file names must be less than 260 characters. - The specified path is invalid (for example, the directory doesn’t exist or it is on an unmapped drive). - An I/O error occurred while opening the file. - path specified a file that is read-only. -or- This operation is not supported on the current platform. -or- path specified a directory. -or- The caller does not have the required permission. - path is in an invalid format. - The caller does not have the required permission. - - - Creates a that appends UTF-8 encoded text to an existing file, or to a new file if the specified file does not exist. - The path to the file to append to. - A stream writer that appends UTF-8 encoded text to the specified file or to a new file. - The caller does not have the required permission. - path is a zero-length string, contains only white space, or contains one or more invalid characters as defined by . - path is null. - The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters, and file names must be less than 260 characters. - The specified path is invalid (for example, the directory doesn’t exist or it is on an unmapped drive). - path is in an invalid format. - - - Copies an existing file to a new file. Overwriting a file of the same name is not allowed. - The file to copy. - The name of the destination file. This cannot be a directory or an existing file. - The caller does not have the required permission. - sourceFileName or destFileName is a zero-length string, contains only white space, or contains one or more invalid characters as defined by . -or- sourceFileName or destFileName specifies a directory. - sourceFileName or destFileName is null. - The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters, and file names must be less than 260 characters. - The path specified in sourceFileName or destFileName is invalid (for example, it is on an unmapped drive). - sourceFileName was not found. - destFileName exists. -or- An I/O error has occurred. - sourceFileName or destFileName is in an invalid format. - - - Copies an existing file to a new file. Overwriting a file of the same name is allowed. - The file to copy. - The name of the destination file. This cannot be a directory. - true if the destination file can be overwritten; otherwise, false. - The caller does not have the required permission. -or- destFileName is read-only. - sourceFileName or destFileName is a zero-length string, contains only white space, or contains one or more invalid characters as defined by . -or- sourceFileName or destFileName specifies a directory. - sourceFileName or destFileName is null. - The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters, and file names must be less than 260 characters. - The path specified in sourceFileName or destFileName is invalid (for example, it is on an unmapped drive). - sourceFileName was not found. - destFileName exists and overwrite is false. -or- An I/O error has occurred. - sourceFileName or destFileName is in an invalid format. - - - Creates or overwrites a file in the specified path. - The path and name of the file to create. - A that provides read/write access to the file specified in path. - The caller does not have the required permission. -or- path specified a file that is read-only. - path is a zero-length string, contains only white space, or contains one or more invalid characters as defined by . - path is null. - The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters, and file names must be less than 260 characters. - The specified path is invalid (for example, it is on an unmapped drive). - An I/O error occurred while creating the file. - path is in an invalid format. - - - Creates or overwrites the specified file. - The name of the file. - The number of bytes buffered for reads and writes to the file. - A with the specified buffer size that provides read/write access to the file specified in path. - The caller does not have the required permission. -or- path specified a file that is read-only. - path is a zero-length string, contains only white space, or contains one or more invalid characters as defined by . - path is null. - The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters, and file names must be less than 260 characters. - The specified path is invalid (for example, it is on an unmapped drive). - An I/O error occurred while creating the file. - path is in an invalid format. - - - Creates or overwrites the specified file, specifying a buffer size and a value that describes how to create or overwrite the file. - The name of the file. - The number of bytes buffered for reads and writes to the file. - One of the values that describes how to create or overwrite the file. - A new file with the specified buffer size. - The caller does not have the required permission. -or- path specified a file that is read-only. - path is a zero-length string, contains only white space, or contains one or more invalid characters as defined by . - path is null. - The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters, and file names must be less than 260 characters. - The specified path is invalid (for example, it is on an unmapped drive. - An I/O error occurred while creating the file. - path is in an invalid format. - - - Creates or opens a file for writing UTF-8 encoded text. If the file already exists, its contents are overwritten. - The file to be opened for writing. - A that writes to the specified file using UTF-8 encoding. - The caller does not have the required permission. - path is a zero-length string, contains only white space, or contains one or more invalid characters as defined by . - path is null. - The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters, and file names must be less than 260 characters. - The specified path is invalid (for example, it is on an unmapped drive). - path is in an invalid format. - - - Decrypts a file that was encrypted by the current account using the method. - A path that describes a file to decrypt. - The path parameter is a zero-length string, contains only white space, or contains one or more invalid characters as defined by . - The path parameter is null. - An invalid drive was specified. - The file described by the path parameter could not be found. - An I/O error occurred while opening the file. For example, the encrypted file is already open. -or- This operation is not supported on the current platform. - The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters, and file names must be less than 260 characters. - The current operating system is not Windows NT or later. - The file system is not NTFS. - The path parameter specified a file that is read-only. -or- This operation is not supported on the current platform. -or- The path parameter specified a directory. -or- The caller does not have the required permission. - - - Deletes the specified file. - The name of the file to be deleted. Wildcard characters are not supported. - path is a zero-length string, contains only white space, or contains one or more invalid characters as defined by . - path is null. - The specified path is invalid (for example, it is on an unmapped drive). - The specified file is in use. -or- There is an open handle on the file, and the operating system is Windows XP or earlier. This open handle can result from enumerating directories and files. For more information, see How to: Enumerate Directories and Files. - path is in an invalid format. - The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters, and file names must be less than 260 characters. - The caller does not have the required permission. -or- The file is an executable file that is in use. -or- path is a directory. -or- path specified a read-only file. - - - Encrypts a file so that only the account used to encrypt the file can decrypt it. - A path that describes a file to encrypt. - The path parameter is a zero-length string, contains only white space, or contains one or more invalid characters as defined by . - The path parameter is null. - An invalid drive was specified. - The file described by the path parameter could not be found. - An I/O error occurred while opening the file. -or- This operation is not supported on the current platform. - The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters, and file names must be less than 260 characters. - The current operating system is not Windows NT or later. - The file system is not NTFS. - The path parameter specified a file that is read-only. -or- This operation is not supported on the current platform. -or- The path parameter specified a directory. -or- The caller does not have the required permission. - - - Determines whether the specified file exists. - The file to check. - true if the caller has the required permissions and path contains the name of an existing file; otherwise, false. This method also returns false if path is null, an invalid path, or a zero-length string. If the caller does not have sufficient permissions to read the specified file, no exception is thrown and the method returns false regardless of the existence of path. - - - Gets the of the file on the path. - The path to the file. - The of the file on the path. - path is empty, contains only white spaces, or contains invalid characters. - The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters, and file names must be less than 260 characters. - path is in an invalid format. - path represents a file and is invalid, such as being on an unmapped drive, or the file cannot be found. - path represents a directory and is invalid, such as being on an unmapped drive, or the directory cannot be found. - This file is being used by another process. - The caller does not have the required permission. - - - Returns the creation date and time of the specified file or directory. - The file or directory for which to obtain creation date and time information. - A structure set to the creation date and time for the specified file or directory. This value is expressed in local time. - The caller does not have the required permission. - path is a zero-length string, contains only white space, or contains one or more invalid characters as defined by . - path is null. - The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters, and file names must be less than 260 characters. - path is in an invalid format. - - - Returns the creation date and time, in coordinated universal time (UTC), of the specified file or directory. - The file or directory for which to obtain creation date and time information. - A structure set to the creation date and time for the specified file or directory. This value is expressed in UTC time. - The caller does not have the required permission. - path is a zero-length string, contains only white space, or contains one or more invalid characters as defined by . - path is null. - The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters, and file names must be less than 260 characters. - path is in an invalid format. - - - Returns the date and time the specified file or directory was last accessed. - The file or directory for which to obtain access date and time information. - A structure set to the date and time that the specified file or directory was last accessed. This value is expressed in local time. - The caller does not have the required permission. - path is a zero-length string, contains only white space, or contains one or more invalid characters as defined by . - path is null. - The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters, and file names must be less than 260 characters. - path is in an invalid format. - - - Returns the date and time, in coordinated universal time (UTC), that the specified file or directory was last accessed. - The file or directory for which to obtain access date and time information. - A structure set to the date and time that the specified file or directory was last accessed. This value is expressed in UTC time. - The caller does not have the required permission. - path is a zero-length string, contains only white space, or contains one or more invalid characters as defined by . - path is null. - The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters, and file names must be less than 260 characters. - path is in an invalid format. - - - Returns the date and time the specified file or directory was last written to. - The file or directory for which to obtain write date and time information. - A structure set to the date and time that the specified file or directory was last written to. This value is expressed in local time. - The caller does not have the required permission. - path is a zero-length string, contains only white space, or contains one or more invalid characters as defined by . - path is null. - The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters, and file names must be less than 260 characters. - path is in an invalid format. - - - Returns the date and time, in coordinated universal time (UTC), that the specified file or directory was last written to. - The file or directory for which to obtain write date and time information. - A structure set to the date and time that the specified file or directory was last written to. This value is expressed in UTC time. - The caller does not have the required permission. - path is a zero-length string, contains only white space, or contains one or more invalid characters as defined by . - path is null. - The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters, and file names must be less than 260 characters. - path is in an invalid format. - - - Moves a specified file to a new location, providing the option to specify a new file name. - The name of the file to move. Can include a relative or absolute path. - The new path and name for the file. - The destination file already exists. -or- sourceFileName was not found. - sourceFileName or destFileName is null. - sourceFileName or destFileName is a zero-length string, contains only white space, or contains invalid characters as defined in . - The caller does not have the required permission. - The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters, and file names must be less than 260 characters. - The path specified in sourceFileName or destFileName is invalid, (for example, it is on an unmapped drive). - sourceFileName or destFileName is in an invalid format. - - - Opens a on the specified path with read/write access. - The file to open. - A value that specifies whether a file is created if one does not exist, and determines whether the contents of existing files are retained or overwritten. - A opened in the specified mode and path, with read/write access and not shared. - path is a zero-length string, contains only white space, or contains one or more invalid characters as defined by . - path is null. - The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters, and file names must be less than 260 characters. - The specified path is invalid, (for example, it is on an unmapped drive). - An I/O error occurred while opening the file. - path specified a file that is read-only. -or- This operation is not supported on the current platform. -or- path specified a directory. -or- The caller does not have the required permission. -or- mode is and the specified file is a hidden file. - mode specified an invalid value. - The file specified in path was not found. - path is in an invalid format. - - - Opens a on the specified path, with the specified mode and access. - The file to open. - A value that specifies whether a file is created if one does not exist, and determines whether the contents of existing files are retained or overwritten. - A value that specifies the operations that can be performed on the file. - An unshared that provides access to the specified file, with the specified mode and access. - path is a zero-length string, contains only white space, or contains one or more invalid characters as defined by . -or- access specified Read and mode specified Create, CreateNew, Truncate, or Append. - path is null. - The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters, and file names must be less than 260 characters. - The specified path is invalid, (for example, it is on an unmapped drive). - An I/O error occurred while opening the file. - path specified a file that is read-only and access is not Read. -or- path specified a directory. -or- The caller does not have the required permission. -or- mode is and the specified file is a hidden file. - mode or access specified an invalid value. - The file specified in path was not found. - path is in an invalid format. - - - Opens a on the specified path, having the specified mode with read, write, or read/write access and the specified sharing option. - The file to open. - A value that specifies whether a file is created if one does not exist, and determines whether the contents of existing files are retained or overwritten. - A value that specifies the operations that can be performed on the file. - A value specifying the type of access other threads have to the file. - A on the specified path, having the specified mode with read, write, or read/write access and the specified sharing option. - path is a zero-length string, contains only white space, or contains one or more invalid characters as defined by . -or- access specified Read and mode specified Create, CreateNew, Truncate, or Append. - path is null. - The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters, and file names must be less than 260 characters. - The specified path is invalid, (for example, it is on an unmapped drive). - An I/O error occurred while opening the file. - path specified a file that is read-only and access is not Read. -or- path specified a directory. -or- The caller does not have the required permission. -or- mode is and the specified file is a hidden file. - mode, access, or share specified an invalid value. - The file specified in path was not found. - path is in an invalid format. - - - Opens an existing file for reading. - The file to be opened for reading. - A read-only on the specified path. - path is a zero-length string, contains only white space, or contains one or more invalid characters as defined by . - path is null. - The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters, and file names must be less than 260 characters. - The specified path is invalid, (for example, it is on an unmapped drive). - path specified a directory. -or- The caller does not have the required permission. - The file specified in path was not found. - path is in an invalid format. - An I/O error occurred while opening the file. - - - Opens an existing UTF-8 encoded text file for reading. - The file to be opened for reading. - A on the specified path. - The caller does not have the required permission. - path is a zero-length string, contains only white space, or contains one or more invalid characters as defined by . - path is null. - The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters, and file names must be less than 260 characters. - The specified path is invalid, (for example, it is on an unmapped drive). - The file specified in path was not found. - path is in an invalid format. - - - Opens an existing file or creates a new file for writing. - The file to be opened for writing. - An unshared object on the specified path with access. - The caller does not have the required permission. -or- path specified a read-only file or directory. - path is a zero-length string, contains only white space, or contains one or more invalid characters as defined by . - path is null. - The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters, and file names must be less than 260 characters. - The specified path is invalid, (for example, it is on an unmapped drive). - path is in an invalid format. - - - Opens a binary file, reads the contents of the file into a byte array, and then closes the file. - The file to open for reading. - A byte array containing the contents of the file. - path is a zero-length string, contains only white space, or contains one or more invalid characters as defined by . - path is null. - The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters, and file names must be less than 260 characters. - The specified path is invalid (for example, it is on an unmapped drive). - An I/O error occurred while opening the file. - This operation is not supported on the current platform. -or- path specified a directory. -or- The caller does not have the required permission. - The file specified in path was not found. - path is in an invalid format. - The caller does not have the required permission. - - - Opens a text file, reads all lines of the file, and then closes the file. - The file to open for reading. - A string array containing all lines of the file. - path is a zero-length string, contains only white space, or contains one or more invalid characters as defined by . - path is null. - The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters, and file names must be less than 260 characters. - The specified path is invalid (for example, it is on an unmapped drive). - An I/O error occurred while opening the file. - path specified a file that is read-only. -or- This operation is not supported on the current platform. -or- path specified a directory. -or- The caller does not have the required permission. - The file specified in path was not found. - path is in an invalid format. - The caller does not have the required permission. - - - Opens a file, reads all lines of the file with the specified encoding, and then closes the file. - The file to open for reading. - The encoding applied to the contents of the file. - A string array containing all lines of the file. - path is a zero-length string, contains only white space, or contains one or more invalid characters as defined by . - path is null. - The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters, and file names must be less than 260 characters. - The specified path is invalid (for example, it is on an unmapped drive). - An I/O error occurred while opening the file. - path specified a file that is read-only. -or- This operation is not supported on the current platform. -or- path specified a directory. -or- The caller does not have the required permission. - The file specified in path was not found. - path is in an invalid format. - The caller does not have the required permission. - - - Opens a file, reads all lines of the file with the specified encoding, and then closes the file. - The file to open for reading. - The encoding applied to the contents of the file. - A string containing all lines of the file. - path is a zero-length string, contains only white space, or contains one or more invalid characters as defined by . - path is null. - The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters, and file names must be less than 260 characters. - The specified path is invalid (for example, it is on an unmapped drive). - An I/O error occurred while opening the file. - path specified a file that is read-only. -or- This operation is not supported on the current platform. -or- path specified a directory. -or- The caller does not have the required permission. - The file specified in path was not found. - path is in an invalid format. - The caller does not have the required permission. - - - Opens a text file, reads all lines of the file, and then closes the file. - The file to open for reading. - A string containing all lines of the file. - path is a zero-length string, contains only white space, or contains one or more invalid characters as defined by . - path is null. - The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters, and file names must be less than 260 characters. - The specified path is invalid (for example, it is on an unmapped drive). - An I/O error occurred while opening the file. - path specified a file that is read-only. -or- This operation is not supported on the current platform. -or- path specified a directory. -or- The caller does not have the required permission. - The file specified in path was not found. - path is in an invalid format. - The caller does not have the required permission. - - - Reads the lines of a file. - The file to read. - All the lines of the file, or the lines that are the result of a query. - path is a zero-length string, contains only white space, or contains one or more invalid characters defined by the method. - path is null. - path is invalid (for example, it is on an unmapped drive). - The file specified by path was not found. - An I/O error occurred while opening the file. - path exceeds the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters and file names must be less than 260 characters. - The caller does not have the required permission. - path specifies a file that is read-only. -or- This operation is not supported on the current platform. -or- path is a directory. -or- The caller does not have the required permission. - - - Read the lines of a file that has a specified encoding. - The file to read. - The encoding that is applied to the contents of the file. - All the lines of the file, or the lines that are the result of a query. - path is a zero-length string, contains only white space, or contains one or more invalid characters as defined by the method. - path is null. - path is invalid (for example, it is on an unmapped drive). - The file specified by path was not found. - An I/O error occurred while opening the file. - path exceeds the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters and file names must be less than 260 characters. - The caller does not have the required permission. - path specifies a file that is read-only. -or- This operation is not supported on the current platform. -or- path is a directory. -or- The caller does not have the required permission. - - - Replaces the contents of a specified file with the contents of another file, deleting the original file, and creating a backup of the replaced file. - The name of a file that replaces the file specified by destinationFileName. - The name of the file being replaced. - The name of the backup file. - The path described by the destinationFileName parameter was not of a legal form. -or- The path described by the destinationBackupFileName parameter was not of a legal form. - The destinationFileName parameter is null. - An invalid drive was specified. - The file described by the current object could not be found. -or- The file described by the destinationBackupFileName parameter could not be found. - An I/O error occurred while opening the file. - or - The sourceFileName and destinationFileName parameters specify the same file. - The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters, and file names must be less than 260 characters. - The operating system is Windows 98 Second Edition or earlier and the files system is not NTFS. - The sourceFileName or destinationFileName parameter specifies a file that is read-only. -or- This operation is not supported on the current platform. -or- Source or destination parameters specify a directory instead of a file. -or- The caller does not have the required permission. - - - Replaces the contents of a specified file with the contents of another file, deleting the original file, and creating a backup of the replaced file and optionally ignores merge errors. - The name of a file that replaces the file specified by destinationFileName. - The name of the file being replaced. - The name of the backup file. - true to ignore merge errors (such as attributes and access control lists (ACLs)) from the replaced file to the replacement file; otherwise, false. - The path described by the destinationFileName parameter was not of a legal form. -or- The path described by the destinationBackupFileName parameter was not of a legal form. - The destinationFileName parameter is null. - An invalid drive was specified. - The file described by the current object could not be found. -or- The file described by the destinationBackupFileName parameter could not be found. - An I/O error occurred while opening the file. - or - The sourceFileName and destinationFileName parameters specify the same file. - The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters, and file names must be less than 260 characters. - The operating system is Windows 98 Second Edition or earlier and the files system is not NTFS. - The sourceFileName or destinationFileName parameter specifies a file that is read-only. -or- This operation is not supported on the current platform. -or- Source or destination parameters specify a directory instead of a file. -or- The caller does not have the required permission. - - - Sets the specified of the file on the specified path. - The path to the file. - A bitwise combination of the enumeration values. - path is empty, contains only white spaces, contains invalid characters, or the file attribute is invalid. - The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters, and file names must be less than 260 characters. - path is in an invalid format. - The specified path is invalid, (for example, it is on an unmapped drive). - The file cannot be found. - path specified a file that is read-only. -or- This operation is not supported on the current platform. -or- path specified a directory. -or- The caller does not have the required permission. - - - Sets the date and time the file was created. - The file for which to set the creation date and time information. - A containing the value to set for the creation date and time of path. This value is expressed in local time. - The specified path was not found. - path is a zero-length string, contains only white space, or contains one or more invalid characters as defined by . - path is null. - The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters, and file names must be less than 260 characters. - An I/O error occurred while performing the operation. - creationTime specifies a value outside the range of dates, times, or both permitted for this operation. - The caller does not have the required permission. - path is in an invalid format. - - - Sets the date and time, in coordinated universal time (UTC), that the file was created. - The file for which to set the creation date and time information. - A containing the value to set for the creation date and time of path. This value is expressed in UTC time. - The specified path was not found. - path is a zero-length string, contains only white space, or contains one or more invalid characters as defined by . - path is null. - The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters, and file names must be less than 260 characters. - An I/O error occurred while performing the operation. - creationTime specifies a value outside the range of dates, times, or both permitted for this operation. - The caller does not have the required permission. - path is in an invalid format. - - - Sets the date and time the specified file was last accessed. - The file for which to set the access date and time information. - A containing the value to set for the last access date and time of path. This value is expressed in local time. - path is a zero-length string, contains only white space, or contains one or more invalid characters as defined by . - path is null. - The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters, and file names must be less than 260 characters. - The specified path was not found. - The caller does not have the required permission. - path is in an invalid format. - lastAccessTime specifies a value outside the range of dates or times permitted for this operation. - - - Sets the date and time, in coordinated universal time (UTC), that the specified file was last accessed. - The file for which to set the access date and time information. - A containing the value to set for the last access date and time of path. This value is expressed in UTC time. - path is a zero-length string, contains only white space, or contains one or more invalid characters as defined by . - path is null. - The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters, and file names must be less than 260 characters. - The specified path was not found. - The caller does not have the required permission. - path is in an invalid format. - lastAccessTimeUtc specifies a value outside the range of dates or times permitted for this operation. - - - Sets the date and time that the specified file was last written to. - The file for which to set the date and time information. - A containing the value to set for the last write date and time of path. This value is expressed in local time. - path is a zero-length string, contains only white space, or contains one or more invalid characters as defined by . - path is null. - The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters, and file names must be less than 260 characters. - The specified path was not found. - The caller does not have the required permission. - path is in an invalid format. - lastWriteTime specifies a value outside the range of dates or times permitted for this operation. - - - Sets the date and time, in coordinated universal time (UTC), that the specified file was last written to. - The file for which to set the date and time information. - A containing the value to set for the last write date and time of path. This value is expressed in UTC time. - path is a zero-length string, contains only white space, or contains one or more invalid characters as defined by . - path is null. - The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters, and file names must be less than 260 characters. - The specified path was not found. - The caller does not have the required permission. - path is in an invalid format. - lastWriteTimeUtc specifies a value outside the range of dates or times permitted for this operation. - - - Creates a new file, writes the specified byte array to the file, and then closes the file. If the target file already exists, it is overwritten. - The file to write to. - The bytes to write to the file. - path is a zero-length string, contains only white space, or contains one or more invalid characters as defined by . - path is null or the byte array is empty. - The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters, and file names must be less than 260 characters. - The specified path is invalid (for example, it is on an unmapped drive). - An I/O error occurred while opening the file. - path specified a file that is read-only. -or- This operation is not supported on the current platform. -or- path specified a directory. -or- The caller does not have the required permission. - path is in an invalid format. - The caller does not have the required permission. - - - Creates a new file, writes the specified string array to the file by using the specified encoding, and then closes the file. - The file to write to. - The string array to write to the file. - An object that represents the character encoding applied to the string array. - path is a zero-length string, contains only white space, or contains one or more invalid characters as defined by . - Either path or contents is null. - The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters, and file names must be less than 260 characters. - The specified path is invalid (for example, it is on an unmapped drive). - An I/O error occurred while opening the file. - path specified a file that is read-only. -or- This operation is not supported on the current platform. -or- path specified a directory. -or- The caller does not have the required permission. - path is in an invalid format. - The caller does not have the required permission. - - - Creates a new file by using the specified encoding, writes a collection of strings to the file, and then closes the file. - The file to write to. - The lines to write to the file. - The character encoding to use. - path is a zero-length string, contains only white space, or contains one or more invalid characters defined by the method. - Either path, contents, or encoding is null. - path is invalid (for example, it is on an unmapped drive). - An I/O error occurred while opening the file. - path exceeds the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters and file names must be less than 260 characters. - path is in an invalid format. - The caller does not have the required permission. - path specifies a file that is read-only. -or- This operation is not supported on the current platform. -or- path is a directory. -or- The caller does not have the required permission. - - - Creates a new file, write the specified string array to the file, and then closes the file. - The file to write to. - The string array to write to the file. - path is a zero-length string, contains only white space, or contains one or more invalid characters as defined by . - Either path or contents is null. - The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters, and file names must be less than 260 characters. - The specified path is invalid (for example, it is on an unmapped drive). - An I/O error occurred while opening the file. - path specified a file that is read-only. -or- This operation is not supported on the current platform. -or- path specified a directory. -or- The caller does not have the required permission. - path is in an invalid format. - The caller does not have the required permission. - - - Creates a new file, writes a collection of strings to the file, and then closes the file. - The file to write to. - The lines to write to the file. - path is a zero-length string, contains only white space, or contains one or more invalid characters defined by the method. - Either path or contents is null. - path is invalid (for example, it is on an unmapped drive). - An I/O error occurred while opening the file. - path exceeds the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters and file names must be less than 260 characters. - path is in an invalid format. - The caller does not have the required permission. - path specifies a file that is read-only. -or- This operation is not supported on the current platform. -or- path is a directory. -or- The caller does not have the required permission. - - - Creates a new file, writes the specified string to the file, and then closes the file. If the target file already exists, it is overwritten. - The file to write to. - The string to write to the file. - path is a zero-length string, contains only white space, or contains one or more invalid characters as defined by . - path is null or contents is empty. - The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters, and file names must be less than 260 characters. - The specified path is invalid (for example, it is on an unmapped drive). - An I/O error occurred while opening the file. - path specified a file that is read-only. -or- This operation is not supported on the current platform. -or- path specified a directory. -or- The caller does not have the required permission. - path is in an invalid format. - The caller does not have the required permission. - - - Creates a new file, writes the specified string to the file using the specified encoding, and then closes the file. If the target file already exists, it is overwritten. - The file to write to. - The string to write to the file. - The encoding to apply to the string. - path is a zero-length string, contains only white space, or contains one or more invalid characters as defined by . - path is null or contents is empty. - The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters, and file names must be less than 260 characters. - The specified path is invalid (for example, it is on an unmapped drive). - An I/O error occurred while opening the file. - path specified a file that is read-only. -or- This operation is not supported on the current platform. -or- path specified a directory. -or- The caller does not have the required permission. - path is in an invalid format. - The caller does not have the required permission. - - - Defines constants for read, write, or read/write access to a file. - - - Read access to the file. Data can be read from the file. Combine with Write for read/write access. - - - - Read and write access to the file. Data can be written to and read from the file. - - - - Write access to the file. Data can be written to the file. Combine with Read for read/write access. - - - - Provides attributes for files and directories. - - - The file is a candidate for backup or removal. - - - - The file is compressed. - - - - Reserved for future use. - - - - The file is a directory. - - - - The file or directory is encrypted. For a file, this means that all data in the file is encrypted. For a directory, this means that encryption is the default for newly created files and directories. - - - - The file is hidden, and thus is not included in an ordinary directory listing. - - - - The file or directory includes data integrity support. When this value is applied to a file, all data streams in the file have integrity support. When this value is applied to a directory, all new files and subdirectories within that directory, by default, include integrity support. - - - - The file is a standard file that has no special attributes. This attribute is valid only if it is used alone. - - - - The file or directory is excluded from the data integrity scan. When this value is applied to a directory, by default, all new files and subdirectories within that directory are excluded from data integrity. - - - - The file will not be indexed by the operating system's content indexing service. - - - - The file is offline. The data of the file is not immediately available. - - - - The file is read-only. - - - - The file contains a reparse point, which is a block of user-defined data associated with a file or a directory. - - - - The file is a sparse file. Sparse files are typically large files whose data consists of mostly zeros. - - - - The file is a system file. That is, the file is part of the operating system or is used exclusively by the operating system. - - - - The file is temporary. A temporary file contains data that is needed while an application is executing but is not needed after the application is finished. File systems try to keep all the data in memory for quicker access rather than flushing the data back to mass storage. A temporary file should be deleted by the application as soon as it is no longer needed. - - - - Provides properties and instance methods for the creation, copying, deletion, moving, and opening of files, and aids in the creation of objects. This class cannot be inherited. - - - Initializes a new instance of the class, which acts as a wrapper for a file path. - The fully qualified name of the new file, or the relative file name. Do not end the path with the directory separator character. - fileName is null. - The caller does not have the required permission. - The file name is empty, contains only white spaces, or contains invalid characters. - Access to fileName is denied. - The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters, and file names must be less than 260 characters. - fileName contains a colon (:) in the middle of the string. - - - Creates a that appends text to the file represented by this instance of the . - A new StreamWriter. - - - Copies an existing file to a new file, disallowing the overwriting of an existing file. - The name of the new file to copy to. - A new file with a fully qualified path. - destFileName is empty, contains only white spaces, or contains invalid characters. - An error occurs, or the destination file already exists. - The caller does not have the required permission. - destFileName is null. - A directory path is passed in, or the file is being moved to a different drive. - The directory specified in destFileName does not exist. - The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters, and file names must be less than 260 characters. - destFileName contains a colon (:) within the string but does not specify the volume. - - - Copies an existing file to a new file, allowing the overwriting of an existing file. - The name of the new file to copy to. - true to allow an existing file to be overwritten; otherwise, false. - A new file, or an overwrite of an existing file if overwrite is true. If the file exists and overwrite is false, an is thrown. - destFileName is empty, contains only white spaces, or contains invalid characters. - An error occurs, or the destination file already exists and overwrite is false. - The caller does not have the required permission. - destFileName is null. - The directory specified in destFileName does not exist. - A directory path is passed in, or the file is being moved to a different drive. - The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters, and file names must be less than 260 characters. - destFileName contains a colon (:) in the middle of the string. - - - Creates a file. - A new file. - - - Creates a that writes a new text file. - A new StreamWriter. - The file name is a directory. - The disk is read-only. - The caller does not have the required permission. - - - Decrypts a file that was encrypted by the current account using the method. - An invalid drive was specified. - The file described by the current object could not be found. - An I/O error occurred while opening the file. - The file system is not NTFS. - The current operating system is not Microsoft Windows NT or later. - The file described by the current object is read-only. -or- This operation is not supported on the current platform. -or- The caller does not have the required permission. - - - Permanently deletes a file. - The target file is open or memory-mapped on a computer running Microsoft Windows NT. -or- There is an open handle on the file, and the operating system is Windows XP or earlier. This open handle can result from enumerating directories and files. For more information, see How to: Enumerate Directories and Files. - The caller does not have the required permission. - The path is a directory. - - - Gets an instance of the parent directory. - A object representing the parent directory of this file. - The specified path is invalid, such as being on an unmapped drive. - The caller does not have the required permission. - - - Gets a string representing the directory's full path. - A string representing the directory's full path. - null was passed in for the directory name. - The fully qualified path is 260 or more characters. - The caller does not have the required permission. - - - Encrypts a file so that only the account used to encrypt the file can decrypt it. - An invalid drive was specified. - The file described by the current object could not be found. - An I/O error occurred while opening the file. - The file system is not NTFS. - The current operating system is not Microsoft Windows NT or later. - The file described by the current object is read-only. -or- This operation is not supported on the current platform. -or- The caller does not have the required permission. - - - Gets a value indicating whether a file exists. - true if the file exists; false if the file does not exist or if the file is a directory. - - - Gets or sets a value that determines if the current file is read only. - true if the current file is read only; otherwise, false. - The file described by the current object could not be found. - An I/O error occurred while opening the file. - This operation is not supported on the current platform. -or- The caller does not have the required permission. - The user does not have write permission, but attempted to set this property to false. - - - Gets the size, in bytes, of the current file. - The size of the current file in bytes. - cannot update the state of the file or directory. - The file does not exist. -or- The Length property is called for a directory. - - - Moves a specified file to a new location, providing the option to specify a new file name. - The path to move the file to, which can specify a different file name. - An I/O error occurs, such as the destination file already exists or the destination device is not ready. - destFileName is null. - destFileName is empty, contains only white spaces, or contains invalid characters. - The caller does not have the required permission. - destFileName is read-only or is a directory. - The file is not found. - The specified path is invalid, such as being on an unmapped drive. - The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters, and file names must be less than 260 characters. - destFileName contains a colon (:) in the middle of the string. - - - Gets the name of the file. - The name of the file. - - - Opens a file in the specified mode. - A constant specifying the mode (for example, Open or Append) in which to open the file. - A file opened in the specified mode, with read/write access and unshared. - The file is not found. - The file is read-only or is a directory. - The specified path is invalid, such as being on an unmapped drive. - The file is already open. - - - Opens a file in the specified mode with read, write, or read/write access. - A constant specifying the mode (for example, Open or Append) in which to open the file. - A constant specifying whether to open the file with Read, Write, or ReadWrite file access. - A object opened in the specified mode and access, and unshared. - The caller does not have the required permission. - The file is not found. - path is read-only or is a directory. - The specified path is invalid, such as being on an unmapped drive. - The file is already open. - - - Opens a file in the specified mode with read, write, or read/write access and the specified sharing option. - A constant specifying the mode (for example, Open or Append) in which to open the file. - A constant specifying whether to open the file with Read, Write, or ReadWrite file access. - A constant specifying the type of access other FileStream objects have to this file. - A object opened with the specified mode, access, and sharing options. - The caller does not have the required permission. - The file is not found. - path is read-only or is a directory. - The specified path is invalid, such as being on an unmapped drive. - The file is already open. - - - Creates a read-only . - A new read-only object. - path is read-only or is a directory. - The specified path is invalid, such as being on an unmapped drive. - The file is already open. - - - Creates a with UTF8 encoding that reads from an existing text file. - A new StreamReader with UTF8 encoding. - The caller does not have the required permission. - The file is not found. - path is read-only or is a directory. - The specified path is invalid, such as being on an unmapped drive. - - - Creates a write-only . - A write-only unshared object for a new or existing file. - The path specified when creating an instance of the object is read-only or is a directory. - The path specified when creating an instance of the object is invalid, such as being on an unmapped drive. - - - Replaces the contents of a specified file with the file described by the current object, deleting the original file, and creating a backup of the replaced file. - The name of a file to replace with the current file. - The name of a file with which to create a backup of the file described by the destFileName parameter. - A object that encapsulates information about the file described by the destFileName parameter. - The path described by the destFileName parameter was not of a legal form. -or- The path described by the destBackupFileName parameter was not of a legal form. - The destFileName parameter is null. - The file described by the current object could not be found. -or- The file described by the destinationFileName parameter could not be found. - The current operating system is not Microsoft Windows NT or later. - - - Replaces the contents of a specified file with the file described by the current object, deleting the original file, and creating a backup of the replaced file. Also specifies whether to ignore merge errors. - The name of a file to replace with the current file. - The name of a file with which to create a backup of the file described by the destFileName parameter. - true to ignore merge errors (such as attributes and ACLs) from the replaced file to the replacement file; otherwise false. - A object that encapsulates information about the file described by the destFileName parameter. - The path described by the destFileName parameter was not of a legal form. -or- The path described by the destBackupFileName parameter was not of a legal form. - The destFileName parameter is null. - The file described by the current object could not be found. -or- The file described by the destinationFileName parameter could not be found. - The current operating system is not Microsoft Windows NT or later. - - - Returns the path as a string. - A string representing the path. - - - The exception that is thrown when a managed assembly is found but cannot be loaded. - - - Initializes a new instance of the class, setting the property of the new instance to a system-supplied message that describes the error, such as "Could not load the specified file." This message takes into account the current system culture. - - - Initializes a new instance of the class with the specified error message. - A that describes the error. The content of message is intended to be understood by humans. The caller of this constructor is required to ensure that this string has been localized for the current system culture. - - - Initializes a new instance of the class with serialized data. - The that holds the serialized object data about the exception being thrown. - The that contains contextual information about the source or destination. - - - Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. - A that describes the error. The content of message is intended to be understood by humans. The caller of this constructor is required to ensure that this string has been localized for the current system culture. - The exception that is the cause of the current exception. If the inner parameter is not null, the current exception is raised in a catch block that handles the inner exception. - - - Initializes a new instance of the class with a specified error message and the name of the file that could not be loaded. - A that describes the error. The content of message is intended to be understood by humans. The caller of this constructor is required to ensure that this string has been localized for the current system culture. - A containing the name of the file that was not loaded. - - - Initializes a new instance of the class with a specified error message, the name of the file that could not be loaded, and a reference to the inner exception that is the cause of this exception. - A that describes the error. The content of message is intended to be understood by humans. The caller of this constructor is required to ensure that this string has been localized for the current system culture. - A containing the name of the file that was not loaded. - The exception that is the cause of the current exception. If the inner parameter is not null, the current exception is raised in a catch block that handles the inner exception. - - - Gets the name of the file that causes this exception. - A containing the name of the file with the invalid image, or a null reference if no file name was passed to the constructor for the current instance. - - - Gets the log file that describes why an assembly load failed. - A string containing errors reported by the assembly cache. - The caller does not have the required permission. - - - Sets the with the file name and additional exception information. - The that holds the serialized object data about the exception being thrown. - The that contains contextual information about the source or destination. - The caller does not have the required permission. - - - Gets the error message and the name of the file that caused this exception. - A string containing the error message and the name of the file that caused this exception. - - - Returns the fully qualified name of the current exception, and possibly the error message, the name of the inner exception, and the stack trace. - A string containing the fully qualified name of this exception, and possibly the error message, the name of the inner exception, and the stack trace, depending on which constructor is used. - - - Specifies how the operating system should open a file. - - - Opens the file if it exists and seeks to the end of the file, or creates a new file. This requires permission. FileMode.Append can be used only in conjunction with FileAccess.Write. Trying to seek to a position before the end of the file throws an exception, and any attempt to read fails and throws a exception. - - - - Specifies that the operating system should create a new file. If the file already exists, it will be overwritten. This requires permission. FileMode.Create is equivalent to requesting that if the file does not exist, use ; otherwise, use . If the file already exists but is a hidden file, an exception is thrown. - - - - Specifies that the operating system should create a new file. This requires permission. If the file already exists, an exception is thrown. - - - - Specifies that the operating system should open an existing file. The ability to open the file is dependent on the value specified by the enumeration. A exception is thrown if the file does not exist. - - - - Specifies that the operating system should open a file if it exists; otherwise, a new file should be created. If the file is opened with FileAccess.Read, permission is required. If the file access is FileAccess.Write, permission is required. If the file is opened with FileAccess.ReadWrite, both and permissions are required. - - - - Specifies that the operating system should open an existing file. When the file is opened, it should be truncated so that its size is zero bytes. This requires permission. Attempts to read from a file opened with FileMode.Truncate cause an exception. - - - - The exception that is thrown when an attempt to access a file that does not exist on disk fails. - - - Initializes a new instance of the class with its message string set to a system-supplied message and its HRESULT set to COR_E_FILENOTFOUND. - - - Initializes a new instance of the class with its message string set to message and its HRESULT set to COR_E_FILENOTFOUND. - A description of the error. The content of message is intended to be understood by humans. The caller of this constructor is required to ensure that this string has been localized for the current system culture. - - - Initializes a new instance of the class with the specified serialization and context information. - An object that holds the serialized object data about the exception being thrown. - An object that contains contextual information about the source or destination. - - - Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. - A description of the error. The content of message is intended to be understood by humans. The caller of this constructor is required to ensure that this string has been localized for the current system culture. - The exception that is the cause of the current exception. If the innerException parameter is not null, the current exception is raised in a catch block that handles the inner exception. - - - Initializes a new instance of the class with its message string set to message, specifying the file name that cannot be found, and its HRESULT set to COR_E_FILENOTFOUND. - A description of the error. The content of message is intended to be understood by humans. The caller of this constructor is required to ensure that this string has been localized for the current system culture. - The full name of the file with the invalid image. - - - Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. - The error message that explains the reason for the exception. - The full name of the file with the invalid image. - The exception that is the cause of the current exception. If the innerException parameter is not null, the current exception is raised in a catch block that handles the inner exception. - - - Gets the name of the file that cannot be found. - The name of the file, or null if no file name was passed to the constructor for this instance. - - - Gets the log file that describes why loading of an assembly failed. - The errors reported by the assembly cache. - The caller does not have the required permission. - - - Sets the object with the file name and additional exception information. - The object that holds the serialized object data about the exception being thrown. - The object that contains contextual information about the source or destination. - - - Gets the error message that explains the reason for the exception. - The error message. - - - Returns the fully qualified name of this exception and possibly the error message, the name of the inner exception, and the stack trace. - The fully qualified name of this exception and possibly the error message, the name of the inner exception, and the stack trace. - - - Represents advanced options for creating a object. - - - Indicates that a file can be used for asynchronous reading and writing. - - - - Indicates that a file is automatically deleted when it is no longer in use. - - - - Indicates that a file is encrypted and can be decrypted only by using the same user account used for encryption. - - - - Indicates that no additional options should be used when creating a object. - - - - Indicates that the file is accessed randomly. The system can use this as a hint to optimize file caching. - - - - Indicates that the file is to be accessed sequentially from beginning to end. The system can use this as a hint to optimize file caching. If an application moves the file pointer for random access, optimum caching may not occur; however, correct operation is still guaranteed. - - - - Indicates that the system should write through any intermediate cache and go directly to disk. - - - - Contains constants for controlling the kind of access other objects can have to the same file. - - - Allows subsequent deleting of a file. - - - - Makes the file handle inheritable by child processes. This is not directly supported by Win32. - - - - Declines sharing of the current file. Any request to open the file (by this process or another process) will fail until the file is closed. - - - - Allows subsequent opening of the file for reading. If this flag is not specified, any request to open the file for reading (by this process or another process) will fail until the file is closed. However, even if this flag is specified, additional permissions might still be needed to access the file. - - - - Allows subsequent opening of the file for reading or writing. If this flag is not specified, any request to open the file for reading or writing (by this process or another process) will fail until the file is closed. However, even if this flag is specified, additional permissions might still be needed to access the file. - - - - Allows subsequent opening of the file for writing. If this flag is not specified, any request to open the file for writing (by this process or another process) will fail until the file is closed. However, even if this flag is specified, additional permissions might still be needed to access the file. - - - - Provides a for a file, supporting both synchronous and asynchronous read and write operations. - - - Initializes a new instance of the class for the specified file handle, with the specified read/write permission. - A file handle for the file that the current FileStream object will encapsulate. - A constant that sets the and properties of the FileStream object. - access is not a field of . - The caller does not have the required permission. - An I/O error, such as a disk error, occurred. -or- The stream has been closed. - The access requested is not permitted by the operating system for the specified file handle, such as when access is Write or ReadWrite and the file handle is set for read-only access. - - - Initializes a new instance of the class with the specified path, creation mode, read/write and sharing permission, the access other FileStreams can have to the same file, the buffer size, and additional file options. - A relative or absolute path for the file that the current FileStream object will encapsulate. - A constant that determines how to open or create the file. - A constant that determines how the file can be accessed by the FileStream object. This also determines the values returned by the and properties of the FileStream object. is true if path specifies a disk file. - A constant that determines how the file will be shared by processes. - A positive value greater than 0 indicating the buffer size. The default buffer size is 4096. - A value that specifies additional file options. - path is null. - path is an empty string (""), contains only white space, or contains one or more invalid characters. -or- path refers to a non-file device, such as "con:", "com1:", "lpt1:", etc. in an NTFS environment. - path refers to a non-file device, such as "con:", "com1:", "lpt1:", etc. in a non-NTFS environment. - bufferSize is negative or zero. -or- mode, access, or share contain an invalid value. - The file cannot be found, such as when mode is FileMode.Truncate or FileMode.Open, and the file specified by path does not exist. The file must already exist in these modes. - An I/O error, such as specifying FileMode.CreateNew when the file specified by path already exists, occurred. -or- The stream has been closed. - The caller does not have the required permission. - The specified path is invalid, such as being on an unmapped drive. - The access requested is not permitted by the operating system for the specified path, such as when access is Write or ReadWrite and the file or directory is set for read-only access. -or- is specified for options, but file encryption is not supported on the current platform. - The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters, and file names must be less than 260 characters. - - - Initializes a new instance of the class with the specified path, creation mode, read/write and sharing permission, buffer size, and synchronous or asynchronous state. - A relative or absolute path for the file that the current FileStream object will encapsulate. - A constant that determines how to open or create the file. - A constant that determines how the file can be accessed by the FileStream object. This also determines the values returned by the and properties of the FileStream object. is true if path specifies a disk file. - A constant that determines how the file will be shared by processes. - A positive value greater than 0 indicating the buffer size. The default buffer size is 4096.. - Specifies whether to use asynchronous I/O or synchronous I/O. However, note that the underlying operating system might not support asynchronous I/O, so when specifying true, the handle might be opened synchronously depending on the platform. When opened asynchronously, the and methods perform better on large reads or writes, but they might be much slower for small reads or writes. If the application is designed to take advantage of asynchronous I/O, set the useAsync parameter to true. Using asynchronous I/O correctly can speed up applications by as much as a factor of 10, but using it without redesigning the application for asynchronous I/O can decrease performance by as much as a factor of 10. - path is null. - path is an empty string (""), contains only white space, or contains one or more invalid characters. -or- path refers to a non-file device, such as "con:", "com1:", "lpt1:", etc. in an NTFS environment. - path refers to a non-file device, such as "con:", "com1:", "lpt1:", etc. in a non-NTFS environment. - bufferSize is negative or zero. -or- mode, access, or share contain an invalid value. - The file cannot be found, such as when mode is FileMode.Truncate or FileMode.Open, and the file specified by path does not exist. The file must already exist in these modes. - An I/O error, such as specifying FileMode.CreateNew when the file specified by path already exists, occurred. -or- The system is running Windows 98 or Windows 98 Second Edition and share is set to FileShare.Delete. -or- The stream has been closed. - The caller does not have the required permission. - The specified path is invalid, such as being on an unmapped drive. - The access requested is not permitted by the operating system for the specified path, such as when access is Write or ReadWrite and the file or directory is set for read-only access. - The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters, and file names must be less than 260 characters. - - - Initializes a new instance of the class for the specified file handle, with the specified read/write permission, FileStream instance ownership, buffer size, and synchronous or asynchronous state. - A file handle for the file that this FileStream object will encapsulate. - A constant that sets the and properties of the FileStream object. - true if the file handle will be owned by this FileStream instance; otherwise, false. - A positive value greater than 0 indicating the buffer size. The default buffer size is 4096. - true if the handle was opened asynchronously (that is, in overlapped I/O mode); otherwise, false. - access is less than FileAccess.Read or greater than FileAccess.ReadWrite or bufferSize is less than or equal to 0. - The handle is invalid. - An I/O error, such as a disk error, occurred. -or- The stream has been closed. - The caller does not have the required permission. - The access requested is not permitted by the operating system for the specified file handle, such as when access is Write or ReadWrite and the file handle is set for read-only access. - - - Initializes a new instance of the class with the specified path, creation mode, read/write permission, and sharing permission. - A relative or absolute path for the file that the current FileStream object will encapsulate. - A constant that determines how to open or create the file. - A constant that determines how the file can be accessed by the FileStream object. This also determines the values returned by the and properties of the FileStream object. is true if path specifies a disk file. - A constant that determines how the file will be shared by processes. - path is null. - path is an empty string (""), contains only white space, or contains one or more invalid characters. -or- path refers to a non-file device, such as "con:", "com1:", "lpt1:", etc. in an NTFS environment. - path refers to a non-file device, such as "con:", "com1:", "lpt1:", etc. in a non-NTFS environment. - The file cannot be found, such as when mode is FileMode.Truncate or FileMode.Open, and the file specified by path does not exist. The file must already exist in these modes. - An I/O error, such as specifying FileMode.CreateNew when the file specified by path already exists, occurred. -or- The system is running Windows 98 or Windows 98 Second Edition and share is set to FileShare.Delete. -or- The stream has been closed. - The caller does not have the required permission. - The specified path is invalid, such as being on an unmapped drive. - The access requested is not permitted by the operating system for the specified path, such as when access is Write or ReadWrite and the file or directory is set for read-only access. - The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters, and file names must be less than 260 characters. - mode contains an invalid value. - - - Initializes a new instance of the class with the specified path, creation mode, read/write and sharing permission, and buffer size. - A relative or absolute path for the file that the current FileStream object will encapsulate. - A constant that determines how to open or create the file. - A constant that determines how the file can be accessed by the FileStream object. This also determines the values returned by the and properties of the FileStream object. is true if path specifies a disk file. - A constant that determines how the file will be shared by processes. - A positive value greater than 0 indicating the buffer size. The default buffer size is 4096. - path is null. - path is an empty string (""), contains only white space, or contains one or more invalid characters. -or- path refers to a non-file device, such as "con:", "com1:", "lpt1:", etc. in an NTFS environment. - path refers to a non-file device, such as "con:", "com1:", "lpt1:", etc. in a non-NTFS environment. - bufferSize is negative or zero. -or- mode, access, or share contain an invalid value. - The file cannot be found, such as when mode is FileMode.Truncate or FileMode.Open, and the file specified by path does not exist. The file must already exist in these modes. - An I/O error, such as specifying FileMode.CreateNew when the file specified by path already exists, occurred. -or- The system is running Windows 98 or Windows 98 Second Edition and share is set to FileShare.Delete. -or- The stream has been closed. - The caller does not have the required permission. - The specified path is invalid, such as being on an unmapped drive. - The access requested is not permitted by the operating system for the specified path, such as when access is Write or ReadWrite and the file or directory is set for read-only access. - The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters, and file names must be less than 260 characters. - - - Initializes a new instance of the class for the specified file handle, with the specified read/write permission, buffer size, and synchronous or asynchronous state. - A file handle for the file that this FileStream object will encapsulate. - A constant that sets the and properties of the FileStream object. - A positive value greater than 0 indicating the buffer size. The default buffer size is 4096. - true if the handle was opened asynchronously (that is, in overlapped I/O mode); otherwise, false. - The handle parameter is an invalid handle. -or- The handle parameter is a synchronous handle and it was used asynchronously. - The bufferSize parameter is negative. - An I/O error, such as a disk error, occurred. -or- The stream has been closed. - The caller does not have the required permission. - The access requested is not permitted by the operating system for the specified file handle, such as when access is Write or ReadWrite and the file handle is set for read-only access. - - - Initializes a new instance of the class with the specified path, creation mode, and read/write permission. - A relative or absolute path for the file that the current FileStream object will encapsulate. - A constant that determines how to open or create the file. - A constant that determines how the file can be accessed by the FileStream object. This also determines the values returned by the and properties of the FileStream object. is true if path specifies a disk file. - path is null. - path is an empty string (""), contains only white space, or contains one or more invalid characters. -or- path refers to a non-file device, such as "con:", "com1:", "lpt1:", etc. in an NTFS environment. - path refers to a non-file device, such as "con:", "com1:", "lpt1:", etc. in a non-NTFS environment. - The file cannot be found, such as when mode is FileMode.Truncate or FileMode.Open, and the file specified by path does not exist. The file must already exist in these modes. - An I/O error, such as specifying FileMode.CreateNew when the file specified by path already exists, occurred. -or- The stream has been closed. - The caller does not have the required permission. - The specified path is invalid, such as being on an unmapped drive. - The access requested is not permitted by the operating system for the specified path, such as when access is Write or ReadWrite and the file or directory is set for read-only access. - The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters, and file names must be less than 260 characters. - mode contains an invalid value. - - - Initializes a new instance of the class for the specified file handle, with the specified read/write permission and FileStream instance ownership. - A file handle for the file that the current FileStream object will encapsulate. - A constant that sets the and properties of the FileStream object. - true if the file handle will be owned by this FileStream instance; otherwise, false. - access is not a field of . - The caller does not have the required permission. - An I/O error, such as a disk error, occurred. -or- The stream has been closed. - The access requested is not permitted by the operating system for the specified file handle, such as when access is Write or ReadWrite and the file handle is set for read-only access. - - - Initializes a new instance of the class for the specified file handle, with the specified read/write permission, and buffer size. - A file handle for the file that the current FileStream object will encapsulate. - A constant that sets the and properties of the FileStream object. - A positive value greater than 0 indicating the buffer size. The default buffer size is 4096. - The handle parameter is an invalid handle. -or- The handle parameter is a synchronous handle and it was used asynchronously. - The bufferSize parameter is negative. - An I/O error, such as a disk error, occurred. -or- The stream has been closed. - The caller does not have the required permission. - The access requested is not permitted by the operating system for the specified file handle, such as when access is Write or ReadWrite and the file handle is set for read-only access. - - - Initializes a new instance of the class with the specified path and creation mode. - A relative or absolute path for the file that the current FileStream object will encapsulate. - A constant that determines how to open or create the file. - path is an empty string (""), contains only white space, or contains one or more invalid characters. -or- path refers to a non-file device, such as "con:", "com1:", "lpt1:", etc. in an NTFS environment. - path refers to a non-file device, such as "con:", "com1:", "lpt1:", etc. in a non-NTFS environment. - path is null. - The caller does not have the required permission. - The file cannot be found, such as when mode is FileMode.Truncate or FileMode.Open, and the file specified by path does not exist. The file must already exist in these modes. - An I/O error, such as specifying FileMode.CreateNew when the file specified by path already exists, occurred. -or- The stream has been closed. - The specified path is invalid, such as being on an unmapped drive. - The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters, and file names must be less than 260 characters. - mode contains an invalid value. - - - Initializes a new instance of the class for the specified file handle, with the specified read/write permission. - A file handle for the file that the current FileStream object will encapsulate. - A constant that sets the and properties of the FileStream object. - access is not a field of . - The caller does not have the required permission. - An I/O error, such as a disk error, occurred. -or- The stream has been closed. - The access requested is not permitted by the operating system for the specified file handle, such as when access is Write or ReadWrite and the file handle is set for read-only access. - - - Initializes a new instance of the class for the specified file handle, with the specified read/write permission, FileStream instance ownership, and buffer size. - A file handle for the file that this FileStream object will encapsulate. - A constant that sets the and properties of the FileStream object. - true if the file handle will be owned by this FileStream instance; otherwise, false. - A positive value greater than 0 indicating the buffer size. The default buffer size is 4096. - bufferSize is negative. - An I/O error, such as a disk error, occurred. -or- The stream has been closed. - The caller does not have the required permission. - The access requested is not permitted by the operating system for the specified file handle, such as when access is Write or ReadWrite and the file handle is set for read-only access. - - - Begins an asynchronous read operation. (Consider using instead.) - The buffer to read data into. - The byte offset in array at which to begin reading. - The maximum number of bytes to read. - The method to be called when the asynchronous read operation is completed. - A user-provided object that distinguishes this particular asynchronous read request from other requests. - An object that references the asynchronous read. - The array length minus offset is less than numBytes. - array is null. - offset or numBytes is negative. - An asynchronous read was attempted past the end of the file. - - - Begins an asynchronous write operation. (Consider using instead.) - The buffer containing data to write to the current stream. - The zero-based byte offset in array at which to begin copying bytes to the current stream. - The maximum number of bytes to write. - The method to be called when the asynchronous write operation is completed. - A user-provided object that distinguishes this particular asynchronous write request from other requests. - An object that references the asynchronous write. - array length minus offset is less than numBytes. - array is null. - offset or numBytes is negative. - The stream does not support writing. - The stream is closed. - An I/O error occurred. - - - Gets a value indicating whether the current stream supports reading. - true if the stream supports reading; false if the stream is closed or was opened with write-only access. - - - Gets a value indicating whether the current stream supports seeking. - true if the stream supports seeking; false if the stream is closed or if the FileStream was constructed from an operating-system handle such as a pipe or output to the console. - - - Gets a value indicating whether the current stream supports writing. - true if the stream supports writing; false if the stream is closed or was opened with read-only access. - - - Releases the unmanaged resources used by the and optionally releases the managed resources. - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - Waits for the pending asynchronous read operation to complete. (Consider using instead.) - The reference to the pending asynchronous request to wait for. - The number of bytes read from the stream, between 0 and the number of bytes you requested. Streams only return 0 at the end of the stream, otherwise, they should block until at least 1 byte is available. - asyncResult is null. - This object was not created by calling on this class. - is called multiple times. - The stream is closed or an internal error has occurred. - - - Ends an asynchronous write operation and blocks until the I/O operation is complete. (Consider using instead.) - The pending asynchronous I/O request. - asyncResult is null. - This object was not created by calling on this class. - is called multiple times. - The stream is closed or an internal error has occurred. - - - Ensures that resources are freed and other cleanup operations are performed when the garbage collector reclaims the FileStream. - - - Clears buffers for this stream and causes any buffered data to be written to the file. - An I/O error occurred. - The stream is closed. - - - Clears buffers for this stream and causes any buffered data to be written to the file, and also clears all intermediate file buffers. - true to flush all intermediate file buffers; otherwise, false. - - - Asynchronously clears all buffers for this stream, causes any buffered data to be written to the underlying device, and monitors cancellation requests. - The token to monitor for cancellation requests. - A task that represents the asynchronous flush operation. - The stream has been disposed. - - - Gets the operating system file handle for the file that the current FileStream object encapsulates. - The operating system file handle for the file encapsulated by this FileStream object, or -1 if the FileStream has been closed. - The caller does not have the required permission. - - - Gets a value indicating whether the FileStream was opened asynchronously or synchronously. - true if the FileStream was opened asynchronously; otherwise, false. - - - Gets the length in bytes of the stream. - A long value representing the length of the stream in bytes. - for this stream is false. - An I/O error, such as the file being closed, occurred. - - - Prevents other processes from reading from or writing to the . - The beginning of the range to lock. The value of this parameter must be equal to or greater than zero (0). - The range to be locked. - position or length is negative. - The file is closed. - The process cannot access the file because another process has locked a portion of the file. - - - Gets the name of the FileStream that was passed to the constructor. - A string that is the name of the FileStream. - - - Gets or sets the current position of this stream. - The current position of this stream. - The stream does not support seeking. - An I/O error occurred. - or - The position was set to a very large value beyond the end of the stream in Windows 98 or earlier. - Attempted to set the position to a negative value. - Attempted seeking past the end of a stream that does not support this. - - - Reads a block of bytes from the stream and writes the data in a given buffer. - When this method returns, contains the specified byte array with the values between offset and (offset + count - 1) replaced by the bytes read from the current source. - The byte offset in array at which the read bytes will be placed. - The maximum number of bytes to read. - The total number of bytes read into the buffer. This might be less than the number of bytes requested if that number of bytes are not currently available, or zero if the end of the stream is reached. - array is null. - offset or count is negative. - The stream does not support reading. - An I/O error occurred. - offset and count describe an invalid range in array. - Methods were called after the stream was closed. - - - Asynchronously reads a sequence of bytes from the current stream, advances the position within the stream by the number of bytes read, and monitors cancellation requests. - The buffer to write the data into. - The byte offset in buffer at which to begin writing data from the stream. - The maximum number of bytes to read. - The token to monitor for cancellation requests. - A task that represents the asynchronous read operation. The value of the TResult parameter contains the total number of bytes read into the buffer. The result value can be less than the number of bytes requested if the number of bytes currently available is less than the requested number, or it can be 0 (zero) if the end of the stream has been reached. - buffer is null. - offset or count is negative. - The sum of offset and count is larger than the buffer length. - The stream does not support reading. - The stream has been disposed. - The stream is currently in use by a previous read operation. - - - Reads a byte from the file and advances the read position one byte. - The byte, cast to an , or -1 if the end of the stream has been reached. - The current stream does not support reading. - The current stream is closed. - - - Gets a object that represents the operating system file handle for the file that the current object encapsulates. - An object that represents the operating system file handle for the file that the current object encapsulates. - - - Sets the current position of this stream to the given value. - The point relative to origin from which to begin seeking. - Specifies the beginning, the end, or the current position as a reference point for offset, using a value of type . - The new position in the stream. - An I/O error occurred. - The stream does not support seeking, such as if the FileStream is constructed from a pipe or console output. - Seeking is attempted before the beginning of the stream. - Methods were called after the stream was closed. - - - Sets the length of this stream to the given value. - The new length of the stream. - An I/O error has occurred. - The stream does not support both writing and seeking. - Attempted to set the value parameter to less than 0. - - - Allows access by other processes to all or part of a file that was previously locked. - The beginning of the range to unlock. - The range to be unlocked. - position or length is negative. - - - Writes a block of bytes to the file stream. - The buffer containing data to write to the stream. - The zero-based byte offset in array from which to begin copying bytes to the stream. - The maximum number of bytes to write. - array is null. - offset and count describe an invalid range in array. - offset or count is negative. - An I/O error occurred. - or - Another thread may have caused an unexpected change in the position of the operating system's file handle. - The stream is closed. - The current stream instance does not support writing. - - - Asynchronously writes a sequence of bytes to the current stream, advances the current position within this stream by the number of bytes written, and monitors cancellation requests. - The buffer to write data from. - The zero-based byte offset in buffer from which to begin copying bytes to the stream. - The maximum number of bytes to write. - The token to monitor for cancellation requests. - A task that represents the asynchronous write operation. - buffer is null. - offset or count is negative. - The sum of offset and count is larger than the buffer length. - The stream does not support writing. - The stream has been disposed. - The stream is currently in use by a previous write operation. - - - Writes a byte to the current position in the file stream. - A byte to write to the stream. - The stream is closed. - The stream does not support writing. - - - Provides a file system implementation of the class. - - - Initializes a new instance of the class from the specified instances of the and classes. - A instance that contains the information required to serialize the new instance. - An instance of the class that contains the source of the serialized stream associated with the new instance. - - - Closes the response stream. - - - Gets the length of the content in the file system resource. - The number of bytes returned from the file system resource. - - - Gets the content type of the file system resource. - The value "binary/octet-stream". - - - Populates a with the data needed to serialize the target object. - The to populate with data. - A that specifies the destination for this serialization. - - - Returns the data stream from the file system resource. - A for reading data from the file system resource. - - - Gets a collection of header name/value pairs associated with the response. - A that contains the header name/value pairs associated with the response. - - - Gets the URI of the file system resource that provided the response. - A that contains the URI of the file system resource that provided the response. - - - Gets a value that indicates whether the property is supported by the instance. - Returns . true if the property is supported by the instance; otherwise, false. - - - Populates a instance with the data needed to serialize the . - A , which will hold the serialized data for the . - A containing the destination of the serialized stream associated with the new . - - - Specifies the status codes returned for a File Transfer Protocol (FTP) operation. - - - Specifies that a user account on the server is required. - - - - Specifies that an error occurred that prevented the request action from completing. - - - - Specifies that the requested action cannot be taken because the specified page type is unknown. Page types are described in RFC 959 Section 3.1.2.3 - - - - Specifies that the requested action cannot be performed on the specified file. - - - - Specifies that the requested action cannot be performed on the specified file because the file is not available. - - - - Specifies that the requested action cannot be performed on the specified file because the file is not available or is being used. - - - - Specifies that the requested action cannot be performed because there is not enough space on the server. - - - - Specifies that one or more command arguments has a syntax error. - - - - Specifies that the sequence of commands is not in the correct order. - - - - Specifies that the data connection cannot be opened. - - - - Specifies that the server is closing the control connection. - - - - Specifies that the server is closing the data connection and that the requested file action was successful. - - - - Specifies that the command is not implemented by the server because it is not needed. - - - - Specifies that the command is not implemented by the FTP server. - - - - Specifies that the command completed successfully. - - - - Specifies that the command has a syntax error or is not a command recognized by the server. - - - - Specifies that the connection has been closed. - - - - Specifies that the data connection is already open and the requested transfer is starting. - - - - Specifies the status of a directory. - - - - Specifies that the server is entering passive mode. - - - - Specifies that the requested action cannot be performed. - - - - Specifies that the requested file action completed successfully. - - - - Specifies that the requested file action requires additional information. - - - - Specifies the status of a file. - - - - Specifies that the user is logged in and can send commands. - - - - Specifies that the server requires a login account to be supplied. - - - - Specifies that login information must be sent to the server. - - - - Specifies that the server is opening the data connection. - - - - Specifies that the requested path name was created. - - - - Specifies that the response contains a restart marker reply. The text of the description that accompanies this status contains the user data stream marker and the server marker. - - - - Specifies that the server expects a password to be supplied. - - - - Specifies that the server is ready for a user login operation. - - - - Specifies that the server accepts the authentication mechanism specified by the client, and the exchange of security data is complete. - - - - Specifies that the service is not available. - - - - Specifies that the service is not available now; try your request later. - - - - Specifies the system type name using the system names published in the Assigned Numbers document published by the Internet Assigned Numbers Authority. - - - - Included for completeness, this value is never returned by servers. - - - - Implements a File Transfer Protocol (FTP) client. - - - Terminates an asynchronous FTP operation. - - - Begins asynchronously opening a request's content stream for writing. - An delegate that references the method to invoke when the operation is complete. - A user-defined object that contains information about the operation. This object is passed to the callback delegate when the operation completes. - An instance that indicates the status of the operation. - A previous call to this method or has not yet completed. - A connection to the FTP server could not be established. - The property is not set to . - - - Begins sending a request and receiving a response from an FTP server asynchronously. - An delegate that references the method to invoke when the operation is complete. - A user-defined object that contains information about the operation. This object is passed to the callback delegate when the operation completes. - An instance that indicates the status of the operation. - or has already been called for this instance. - - - Gets or sets the certificates used for establishing an encrypted connection to the FTP server. - An object that contains the client certificates. - The value specified for a set operation is null. - - - Gets or sets the name of the connection group that contains the service point used to send the current request. - A value that contains a connection group name. - A new value was specified for this property for a request that is already in progress. - - - Gets or sets a value that is ignored by the class. - An value that should be ignored. - - - Gets or sets a byte offset into the file being downloaded by this request. - An instance that specifies the file offset, in bytes. The default value is zero. - A new value was specified for this property for a request that is already in progress. - The value specified for this property is less than zero. - - - Always throws a . - Always throws a . - Content type information is not supported for FTP. - - - Gets or sets the credentials used to communicate with the FTP server. - An instance; otherwise, null if the property has not been set. - The value specified for a set operation is null. - An of a type other than was specified for a set operation. - A new value was specified for this property for a request that is already in progress. - - - Defines the default cache policy for all FTP requests. - A that defines the cache policy for FTP requests. - The caller tried to set this property to null. - - - Gets or sets a that specifies that an SSL connection should be used. - true if control and data transmissions are encrypted; otherwise, false. The default value is false. - The connection to the FTP server has already been established. - - - Ends a pending asynchronous operation started with . - The object that was returned when the operation started. - A writable instance associated with this instance. - asyncResult is null. - asyncResult was not obtained by calling . - This method was already called for the operation identified by asyncResult. - - - Ends a pending asynchronous operation started with . - The that was returned when the operation started. - A reference that contains an instance. This object contains the FTP server's response to the request. - asyncResult is null. - asyncResult was not obtained by calling . - This method was already called for the operation identified by asyncResult. - An error occurred using an HTTP proxy. - - - Retrieves the stream used to upload data to an FTP server. - A writable instance used to store data to be sent to the server by the current request. - has been called and has not completed. - or - An HTTP proxy is enabled, and you attempted to use an FTP command other than , , or . - A connection to the FTP server could not be established. - The property is not set to or . - - - Returns the FTP server response. - A reference that contains an instance. This object contains the FTP server's response to the request. - or has already been called for this instance. - or - An HTTP proxy is enabled, and you attempted to use an FTP command other than , , or . - is set to true, but the server does not support this feature. - or - A was specified and the timeout has expired. - - - Gets an empty object. - An empty object. - - - Gets or sets a value that specifies whether the control connection to the FTP server is closed after the request completes. - true if the connection to the server should not be destroyed; otherwise, false. The default value is true. - A new value was specified for this property for a request that is already in progress. - - - Gets or sets the command to send to the FTP server. - A value that contains the FTP command to send to the server. The default value is . - A new value was specified for this property for a request that is already in progress. - The method is invalid. - or - The method is not supported. - or - Multiple methods were specified. - - - Always throws a . - Always throws a . - Preauthentication is not supported for FTP. - - - Gets or sets the proxy used to communicate with the FTP server. - An instance responsible for communicating with the FTP server. - This property cannot be set to null. - A new value was specified for this property for a request that is already in progress. - - - Gets or sets a time-out when reading from or writing to a stream. - The number of milliseconds before the reading or writing times out. The default value is 300,000 milliseconds (5 minutes). - The request has already been sent. - The value specified for a set operation is less than or equal to zero and is not equal to . - - - Gets or sets the new name of a file being renamed. - The new name of the file being renamed. - The value specified for a set operation is null or an empty string. - A new value was specified for this property for a request that is already in progress. - - - Gets the URI requested by this instance. - A instance that identifies a resource that is accessed using the File Transfer Protocol. - - - Gets the object used to connect to the FTP server. - A object that can be used to customize connection behavior. - - - Gets or sets the number of milliseconds to wait for a request. - An value that contains the number of milliseconds to wait before a request times out. The default value is . - The value specified is less than zero and is not . - A new value was specified for this property for a request that is already in progress. - - - Gets or sets a value that specifies the data type for file transfers. - true to indicate to the server that the data to be transferred is binary; false to indicate that the data is text. The default value is true. - A new value was specified for this property for a request that is already in progress. - - - Always throws a . - Always throws a . - Default credentials are not supported for FTP. - - - Gets or sets the behavior of a client application's data transfer process. - false if the client application's data transfer process listens for a connection on the data port; otherwise, true if the client should initiate a connection on the data port. The default value is true. - A new value was specified for this property for a request that is already in progress. - - - Encapsulates a File Transfer Protocol (FTP) server's response to a request. - - - Gets the message sent by the FTP server when a connection is established prior to logon. - A that contains the banner message sent by the server; otherwise, if no message is sent. - - - Frees the resources held by the response. - - - Gets the length of the data received from the FTP server. - An value that contains the number of bytes of data received from the FTP server. - - - Gets the message sent by the server when the FTP session is ending. - A that contains the exit message sent by the server; otherwise, if no message is sent. - - - Retrieves the stream that contains response data sent from an FTP server. - A readable instance that contains data returned with the response; otherwise, if no response data was returned by the server. - The response did not return a data stream. - - - Gets an empty object. - An empty object. - - - Gets the date and time that a file on an FTP server was last modified. - A that contains the last modified date and time for a file. - - - Gets the URI that sent the response to the request. - A instance that identifies the resource associated with this response. - - - Gets the most recent status code sent from the FTP server. - An value that indicates the most recent status code returned with this response. - - - Gets text that describes a status code sent from the FTP server. - A instance that contains the status code and message returned with this response. - - - Gets a value that indicates whether the property is supported by the instance. - Returns . true if the property is supported by the instance; otherwise, false. - - - Gets the message sent by the FTP server when authentication is complete. - A that contains the welcome message sent by the server; otherwise, if no message is sent. - - - Contains a global default proxy instance for all HTTP requests. - - - Initializes a new instance of the class. - - - Returns an empty proxy instance. - An that contains no information. - - - Gets or sets the global HTTP proxy. - An that every call to uses. - The value specified for a set operation was null. - The caller does not have permission for the requested operation. - - - Provides HTTP content based on a byte array. - - - Initializes a new instance of the class. - The content used to initialize the . - The content parameter is null. - - - Initializes a new instance of the class. - The content used to initialize the . - The offset, in bytes, in the content parameter used to initialize the . - The number of bytes in the content starting from the offset parameter used to initialize the . - The content parameter is null. - The offset parameter is less than zero. -or- The offset parameter is greater than the length of content specified by the content parameter. -or- The count parameter is less than zero. -or- The count parameter is greater than the length of content specified by the content parameter - minus the offset parameter. - - - Creates an HTTP content stream as an asynchronous operation for reading whose backing store is memory from the . - The task object representing the asynchronous operation. - - - Serialize and write the byte array provided in the constructor to an HTTP content stream as an asynchronous operation. - The target stream. - Information about the transport, like channel binding token. This parameter may be null. - The task object representing the asynchronous operation. - - - Determines whether a byte array has a valid length in bytes. - The length in bytes of the byte array. - true if length is a valid length; otherwise, false. - - - Specifies how client certificates are provided. - - - The will attempt to provide all available client certificates automatically. - - - - The application manually provides the client certificates to the . This value is the default. - - - - A type for HTTP handlers that delegate the processing of HTTP response messages to another handler, called the inner handler. - - - Creates a new instance of the class. - - - Creates a new instance of the class with a specific inner handler. - The inner handler which is responsible for processing the HTTP response messages. - - - Releases the unmanaged resources used by the , and optionally disposes of the managed resources. - true to release both managed and unmanaged resources; false to releases only unmanaged resources. - - - Gets or sets the inner handler which processes the HTTP response messages. - The inner handler for HTTP response messages. - - - Sends an HTTP request to the inner handler to send to the server as an asynchronous operation. - The HTTP request message to send to the server. - A cancellation token to cancel operation. - The task object representing the asynchronous operation. - The request was null. - - - A container for name/value tuples encoded using application/x-www-form-urlencoded MIME type. - - - Initializes a new instance of the class with a specific collection of name/value pairs. - A collection of name/value pairs. - - - Represents authentication information in Authorization, ProxyAuthorization, WWW-Authenticate, and Proxy-Authenticate header values. - - - Initializes a new instance of the class. - The scheme to use for authorization. - - - Initializes a new instance of the class. - The scheme to use for authorization. - The credentials containing the authentication information of the user agent for the resource being requested. - - - Determines whether the specified is equal to the current object. - The object to compare with the current object. - true if the specified is equal to the current object; otherwise, false. - - - Serves as a hash function for an object. - A hash code for the current object. - - - Gets the credentials containing the authentication information of the user agent for the resource being requested. - The credentials containing the authentication information. - - - Converts a string to an instance. - A string that represents authentication header value information. - An instance. - input is a null reference. - input is not valid authentication header value information. - - - Gets the scheme to use for authorization. - The scheme to use for authorization. - - - Returns a string that represents the current object. - A string that represents the current object. - - - Determines whether a string is valid information. - The string to validate. - The version of the string. - true if input is valid information; otherwise, false. - - - Creates a new object that is a copy of the current instance. - A copy of the current instance. - - - Represents the value of the Cache-Control header. - - - Initializes a new instance of the class. - - - Determines whether the specified is equal to the current object. - The object to compare with the current object. - true if the specified is equal to the current object; otherwise, false. - - - Cache-extension tokens, each with an optional assigned value. - A collection of cache-extension tokens each with an optional assigned value. - - - Serves as a hash function for a object. - A hash code for the current object. - - - The maximum age, specified in seconds, that the HTTP client is willing to accept a response. - The time in seconds. - - - Whether an HTTP client is willing to accept a response that has exceeded its expiration time. - true if the HTTP client is willing to accept a response that has exceed the expiration time; otherwise, false. - - - The maximum time, in seconds, an HTTP client is willing to accept a response that has exceeded its expiration time. - The time in seconds. - - - The freshness lifetime, in seconds, that an HTTP client is willing to accept a response. - The time in seconds. - - - Whether the origin server require revalidation of a cache entry on any subsequent use when the cache entry becomes stale. - true if the origin server requires revalidation of a cache entry on any subsequent use when the entry becomes stale; otherwise, false. - - - Whether an HTTP client is willing to accept a cached response. - true if the HTTP client is willing to accept a cached response; otherwise, false. - - - A collection of fieldnames in the "no-cache" directive in a cache-control header field on an HTTP response. - A collection of fieldnames. - - - Whether a cache must not store any part of either the HTTP request mressage or any response. - true if a cache must not store any part of either the HTTP request mressage or any response; otherwise, false. - - - Whether a cache or proxy must not change any aspect of the entity-body. - true if a cache or proxy must not change any aspect of the entity-body; otherwise, false. - - - Whether a cache should either respond using a cached entry that is consistent with the other constraints of the HTTP request, or respond with a 504 (Gateway Timeout) status. - true if a cache should either respond using a cached entry that is consistent with the other constraints of the HTTP request, or respond with a 504 (Gateway Timeout) status; otherwise, false. - - - Converts a string to an instance. - A string that represents cache-control header value information. - A instance. - input is a null reference. - input is not valid cache-control header value information. - - - Whether all or part of the HTTP response message is intended for a single user and must not be cached by a shared cache. - true if the HTTP response message is intended for a single user and must not be cached by a shared cache; otherwise, false. - - - A collection fieldnames in the "private" directive in a cache-control header field on an HTTP response. - A collection of fieldnames. - - - Whether the origin server require revalidation of a cache entry on any subsequent use when the cache entry becomes stale for shared user agent caches. - true if the origin server requires revalidation of a cache entry on any subsequent use when the entry becomes stale for shared user agent caches; otherwise, false. - - - Whether an HTTP response may be cached by any cache, even if it would normally be non-cacheable or cacheable only within a non- shared cache. - true if the HTTP response may be cached by any cache, even if it would normally be non-cacheable or cacheable only within a non- shared cache; otherwise, false. - - - The shared maximum age, specified in seconds, in an HTTP response that overrides the "max-age" directive in a cache-control header or an Expires header for a shared cache. - The time in seconds. - - - Returns a string that represents the current object. - A string that represents the current object. - - - Determines whether a string is valid information. - The string to validate. - The version of the string. - true if input is valid information; otherwise, false. - - - Creates a new object that is a copy of the current instance. - A copy of the current instance. - - - Represents the value of the Content-Disposition header. - - - Initializes a new instance of the class. - A . - - - Initializes a new instance of the class. - A string that contains a . - - - The date at which the file was created. - The file creation date. - - - The disposition type for a content body part. - The disposition type. - - - Determines whether the specified is equal to the current object. - The object to compare with the current object. - true if the specified is equal to the current object; otherwise, false. - - - A suggestion for how to construct a filename for storing the message payload to be used if the entity is detached and stored in a separate file. - A suggested filename. - - - A suggestion for how to construct filenames for storing message payloads to be used if the entities are detached and stored in a separate files. - A suggested filename of the form filename*. - - - Serves as a hash function for an object. - A hash code for the current object. - - - The date at which the file was last modified. - The file modification date. - - - The name for a content body part. - The name for the content body part. - - - A set of parameters included the Content-Disposition header. - A collection of parameters. - - - Converts a string to an instance. - A string that represents content disposition header value information. - An instance. - input is a null reference. - input is not valid content disposition header value information. - - - The date the file was last read. - The last read date. - - - The approximate size, in bytes, of the file. - The approximate size, in bytes. - - - Returns a string that represents the current object. - A string that represents the current object. - - - Determines whether a string is valid information. - The string to validate. - The version of the string. - true if input is valid information; otherwise, false. - - - Creates a new object that is a copy of the current instance. - A copy of the current instance. - - - Represents the value of the Content-Range header. - - - Initializes a new instance of the class. - The starting or ending point of the range, in bytes. - - - Initializes a new instance of the class. - The position, in bytes, at which to start sending data. - The position, in bytes, at which to stop sending data. - - - Initializes a new instance of the class. - The position, in bytes, at which to start sending data. - The position, in bytes, at which to stop sending data. - The starting or ending point of the range, in bytes. - - - Determines whether the specified Object is equal to the current object. - The object to compare with the current object. - true if the specified is equal to the current object; otherwise, false. - - - Gets the position at which to start sending data. - The position, in bytes, at which to start sending data. - - - Serves as a hash function for an object. - A hash code for the current object. - - - Gets whether the Content-Range header has a length specified. - true if the Content-Range has a length specified; otherwise, false. - - - Gets whether the Content-Range has a range specified. - true if the Content-Range has a range specified; otherwise, false. - - - Gets the length of the full entity-body. - The length of the full entity-body. - - - Converts a string to an instance. - A string that represents content range header value information. - An instance. - input is a null reference. - input is not valid content range header value information. - - - Gets the position at which to stop sending data. - The position at which to stop sending data. - - - Returns a string that represents the current object. - A string that represents the current object. - - - Determines whether a string is valid information. - The string to validate. - The version of the string. - true if input is valid information; otherwise, false. - - - The range units used. - A that contains range units. - - - Creates a new object that is a copy of the current instance. - A copy of the current instance. - - - Represents an entity-tag header value. - - - Initializes a new instance of the class. - A string that contains an . - - - Initializes a new instance of the class. - A string that contains an . - A value that indicates if this entity-tag header is a weak validator. If the entity-tag header is weak validator, then isWeak should be set to true. If the entity-tag header is a strong validator, then isWeak should be set to false. - - - Gets the entity-tag header value. - Returns . - - - Determines whether the specified is equal to the current object. - The object to compare with the current object. - true if the specified is equal to the current object; otherwise, false. - - - Serves as a hash function for an object. - A hash code for the current object. - - - Gets whether the entity-tag is prefaced by a weakness indicator. - true if the entity-tag is prefaced by a weakness indicator; otherwise, false. - - - Converts a string to an instance. - A string that represents entity tag header value information. - An instance. - input is a null reference. - input is not valid entity tag header value information. - - - Gets the opaque quoted string. - An opaque quoted string. - - - Returns a string that represents the current object. - A string that represents the current object. - - - Determines whether a string is valid information. - The string to validate. - The version of the string. - true if input is valid information; otherwise, false. - - - Creates a new object that is a copy of the current instance. - A copy of the current instance. - - - Represents the collection of Content Headers as defined in RFC 2616. - - - Gets the value of the Allow content header on an HTTP response. - The value of the Allow header on an HTTP response. - - - Gets the value of the Content-Disposition content header on an HTTP response. - The value of the Content-Disposition content header on an HTTP response. - - - Gets the value of the Content-Encoding content header on an HTTP response. - The value of the Content-Encoding content header on an HTTP response. - - - Gets the value of the Content-Language content header on an HTTP response. - The value of the Content-Language content header on an HTTP response. - - - Gets or sets the value of the Content-Length content header on an HTTP response. - The value of the Content-Length content header on an HTTP response. - - - Gets or sets the value of the Content-Location content header on an HTTP response. - The value of the Content-Location content header on an HTTP response. - - - Gets or sets the value of the Content-MD5 content header on an HTTP response. - The value of the Content-MD5 content header on an HTTP response. - - - Gets or sets the value of the Content-Range content header on an HTTP response. - The value of the Content-Range content header on an HTTP response. - - - Gets or sets the value of the Content-Type content header on an HTTP response. - The value of the Content-Type content header on an HTTP response. - - - Gets or sets the value of the Expires content header on an HTTP response. - The value of the Expires content header on an HTTP response. - - - Gets or sets the value of the Last-Modified content header on an HTTP response. - The value of the Last-Modified content header on an HTTP response. - - - A collection of headers and their values as defined in RFC 2616. - - - Initializes a new instance of the class. - - - Adds the specified header and its values into the collection. - The header to add to the collection. - A list of header values to add to the collection. - - - Adds the specified header and its value into the collection. - The header to add to the collection. - The content of the header. - - - Removes all headers from the collection. - - - Returns if a specific header exists in the collection. - The specific header. - true is the specified header exists in the collection; otherwise false. - - - Returns an enumerator that can iterate through the instance. - An enumerator for the . - - - Returns all header values for a specified header stored in the collection. - The specified header to return values for. - An array of header strings. - - - Removes the specified header from the collection. - The name of the header to remove from the collection. - Returns . - - - Returns a string that represents the current object. - A string that represents the current object. - - - Returns a value that indicates whether the specified header and its values were added to the collection without validating the provided information. - The header to add to the collection. - The values of the header. - true if the specified header name and values could be added to the collection; otherwise false. - - - Returns a value that indicates whether the specified header and its value were added to the collection without validating the provided information. - The header to add to the collection. - The content of the header. - true if the specified header name and value could be added to the collection; otherwise false. - - - Return if a specified header and specified values are stored in the collection. - The specified header. - The specified header values. - true is the specified header name and values are stored in the collection; otherwise false. - - - Gets an enumerator that can iterate through a . - An instance of an implementation of an that can iterate through a . - - - Represents a collection of header values. - The header collection type. - - - Adds an entry to the . - The item to add to the header collection. - - - Removes all entries from the . - - - Determines if the contains an item. - The item to find to the header collection. - true if the entry is contained in the instance; otherwise, false - - - Copies the entire to a compatible one-dimensional , starting at the specified index of the target array. - The one-dimensional that is the destination of the elements copied from . The must have zero-based indexing. - The zero-based index in array at which copying begins. - - - Gets the number of headers in the . - The number of headers in a collection - - - Returns an enumerator that iterates through the . - An enumerator for the instance. - - - Gets a value indicating whether the instance is read-only. - true if the instance is read-only; otherwise, false. - - - Parses and adds an entry to the . - The entry to add. - - - Removes the specified item from the . - The item to remove. - true if the item was removed from the instance; otherwise, false - - - Returns a string that represents the current object. object. - A string that represents the current object. - - - Determines whether the input could be parsed and added to the . - The entry to validate. - true if the input could be parsed and added to the instance; otherwise, false - - - Returns an enumerator that iterates through the . - An enumerator for the instance. - - - Represents the collection of Request Headers as defined in RFC 2616. - - - Gets the value of the Accept header for an HTTP request. - The value of the Accept header for an HTTP request. - - - Gets the value of the Accept-Charset header for an HTTP request. - The value of the Accept-Charset header for an HTTP request. - - - Gets the value of the Accept-Encoding header for an HTTP request. - The value of the Accept-Encoding header for an HTTP request. - - - Gets the value of the Accept-Language header for an HTTP request. - The value of the Accept-Language header for an HTTP request. - - - Gets or sets the value of the Authorization header for an HTTP request. - The value of the Authorization header for an HTTP request. - - - Gets or sets the value of the Cache-Control header for an HTTP request. - The value of the Cache-Control header for an HTTP request. - - - Gets the value of the Connection header for an HTTP request. - The value of the Connection header for an HTTP request. - - - Gets or sets a value that indicates if the Connection header for an HTTP request contains Close. - true if the Connection header contains Close, otherwise false. - - - Gets or sets the value of the Date header for an HTTP request. - The value of the Date header for an HTTP request. - - - Gets the value of the Expect header for an HTTP request. - The value of the Expect header for an HTTP request. - - - Gets or sets a value that indicates if the Expect header for an HTTP request contains Continue. - true if the Expect header contains Continue, otherwise false. - - - Gets or sets the value of the From header for an HTTP request. - The value of the From header for an HTTP request. - - - Gets or sets the value of the Host header for an HTTP request. - The value of the Host header for an HTTP request. - - - Gets the value of the If-Match header for an HTTP request. - Returns . The value of the If-Match header for an HTTP request. - - - Gets or sets the value of the If-Modified-Since header for an HTTP request. - The value of the If-Modified-Since header for an HTTP request. - - - Gets the value of the If-None-Match header for an HTTP request. - Gets the value of the If-None-Match header for an HTTP request. - - - Gets or sets the value of the If-Range header for an HTTP request. - The value of the If-Range header for an HTTP request. - - - Gets or sets the value of the If-Unmodified-Since header for an HTTP request. - The value of the If-Unmodified-Since header for an HTTP request. - - - Gets or sets the value of the Max-Forwards header for an HTTP request. - The value of the Max-Forwards header for an HTTP request. - - - Gets the value of the Pragma header for an HTTP request. - The value of the Pragma header for an HTTP request. - - - Gets or sets the value of the Proxy-Authorization header for an HTTP request. - The value of the Proxy-Authorization header for an HTTP request. - - - Gets or sets the value of the Range header for an HTTP request. - The value of the Range header for an HTTP request. - - - Gets or sets the value of the Referer header for an HTTP request. - The value of the Referer header for an HTTP request. - - - Gets the value of the TE header for an HTTP request. - The value of the TE header for an HTTP request. - - - Gets the value of the Trailer header for an HTTP request. - The value of the Trailer header for an HTTP request. - - - Gets the value of the Transfer-Encoding header for an HTTP request. - The value of the Transfer-Encoding header for an HTTP request. - - - Gets or sets a value that indicates if the Transfer-Encoding header for an HTTP request contains chunked. - true if the Transfer-Encoding header contains chunked, otherwise false. - - - Gets the value of the Upgrade header for an HTTP request. - The value of the Upgrade header for an HTTP request. - - - Gets the value of the User-Agent header for an HTTP request. - The value of the User-Agent header for an HTTP request. - - - Gets the value of the Via header for an HTTP request. - The value of the Via header for an HTTP request. - - - Gets the value of the Warning header for an HTTP request. - The value of the Warning header for an HTTP request. - - - Represents the collection of Response Headers as defined in RFC 2616. - - - Gets the value of the Accept-Ranges header for an HTTP response. - The value of the Accept-Ranges header for an HTTP response. - - - Gets or sets the value of the Age header for an HTTP response. - The value of the Age header for an HTTP response. - - - Gets or sets the value of the Cache-Control header for an HTTP response. - The value of the Cache-Control header for an HTTP response. - - - Gets the value of the Connection header for an HTTP response. - The value of the Connection header for an HTTP response. - - - Gets or sets a value that indicates if the Connection header for an HTTP response contains Close. - true if the Connection header contains Close, otherwise false. - - - Gets or sets the value of the Date header for an HTTP response. - The value of the Date header for an HTTP response. - - - Gets or sets the value of the ETag header for an HTTP response. - The value of the ETag header for an HTTP response. - - - Gets or sets the value of the Location header for an HTTP response. - The value of the Location header for an HTTP response. - - - Gets the value of the Pragma header for an HTTP response. - Returns . The value of the Pragma header for an HTTP response. - - - Gets the value of the Proxy-Authenticate header for an HTTP response. - The value of the Proxy-Authenticate header for an HTTP response. - - - Gets or sets the value of the Retry-After header for an HTTP response. - The value of the Retry-After header for an HTTP response. - - - Gets the value of the Server header for an HTTP response. - The value of the Server header for an HTTP response. - - - Gets the value of the Trailer header for an HTTP response. - The value of the Trailer header for an HTTP response. - - - Gets the value of the Transfer-Encoding header for an HTTP response. - The value of the Transfer-Encoding header for an HTTP response. - - - Gets or sets a value that indicates if the Transfer-Encoding header for an HTTP response contains chunked. - true if the Transfer-Encoding header contains chunked, otherwise false. - - - Gets the value of the Upgrade header for an HTTP response. - The value of the Upgrade header for an HTTP response. - - - Gets the value of the Vary header for an HTTP response. - The value of the Vary header for an HTTP response. - - - Gets the value of the Via header for an HTTP response. - The value of the Via header for an HTTP response. - - - Gets the value of the Warning header for an HTTP response. - The value of the Warning header for an HTTP response. - - - Gets the value of the WWW-Authenticate header for an HTTP response. - The value of the WWW-Authenticate header for an HTTP response. - - - Represents a media type used in a Content-Type header as defined in the RFC 2616. - - - Initializes a new instance of the class. - A object used to initialize the new instance. - - - Initializes a new instance of the class. - The source represented as a string to initialize the new instance. - - - Gets or sets the character set. - The character set. - - - Determines whether the specified is equal to the current object. - The object to compare with the current object. - true if the specified is equal to the current object; otherwise, false. - - - Serves as a hash function for an object. - A hash code for the current object. - - - Gets or sets the media-type header value. - The media-type header value. - - - Gets or sets the media-type header value parameters. - The media-type header value parameters. - - - Converts a string to an instance. - A string that represents media type header value information. - A instance. - input is a null reference. - input is not valid media type header value information. - - - Returns a string that represents the current object. - A string that represents the current object. - - - Determines whether a string is valid information. - The string to validate. - The version of the string. - true if input is valid information; otherwise, false. - - - Creates a new object that is a copy of the current instance. - A copy of the current instance. - - - Represents a media type with an additional quality factor used in a Content-Type header. - - - Initializes a new instance of the class. - A represented as string to initialize the new instance. - - - Initializes a new instance of the class. - A represented as string to initialize the new instance. - The quality associated with this header value. - - - Converts a string to an instance. - A string that represents media type with quality header value information. - A instance. - input is a null reference. - input is not valid media type with quality header value information. - - - Get or set the quality value for the . - The quality value for the object. - - - Determines whether a string is valid information. - The string to validate. - The version of the string. - true if input is valid information; otherwise, false. - - - Creates a new object that is a copy of the current instance. - A copy of the current instance. - - - Represents a name/value pair used in various headers as defined in RFC 2616. - - - Initializes a new instance of the class. - A object used to initialize the new instance. - - - Initializes a new instance of the class. - The header name. - - - Initializes a new instance of the class. - The header name. - The header value. - - - Determines whether the specified is equal to the current object. - The object to compare with the current object. - true if the specified is equal to the current object; otherwise, false. - - - Serves as a hash function for an object. - A hash code for the current object. - - - Gets the header name. - The header name. - - - Converts a string to an instance. - A string that represents name value header value information. - A instance. - input is a null reference. - input is not valid name value header value information. - - - Returns a string that represents the current object. - A string that represents the current object. - - - Determines whether a string is valid information. - The string to validate. - The version of the string. - true if input is valid information; otherwise, false. - - - Gets the header value. - The header value. - - - Creates a new object that is a copy of the current instance. - A copy of the current instance. - - - Represents a name/value pair with parameters used in various headers as defined in RFC 2616. - - - Initializes a new instance of the class. - A object used to initialize the new instance. - - - Initializes a new instance of the class. - The header name. - - - Initializes a new instance of the class. - The header name. - The header value. - - - Determines whether the specified is equal to the current object. - The object to compare with the current object. - true if the specified is equal to the current object; otherwise, false. - - - Serves as a hash function for an object. - A hash code for the current object. - - - Gets the parameters from the object. - A collection containing the parameters. - - - Converts a string to an instance. - A string that represents name value with parameter header value information. - A instance. - input is a null reference. - input is not valid name value with parameter header value information. - - - Returns a string that represents the current object. - A string that represents the current object. - - - Determines whether a string is valid information. - The string to validate. - The version of the string. - true if input is valid information; otherwise, false. - - - Creates a new object that is a copy of the current instance. - A copy of the current instance. - - - Represents a product token value in a User-Agent header. - - - Initializes a new instance of the class. - The product name. - - - Initializes a new instance of the class. - The product name value. - The product version value. - - - Determines whether the specified is equal to the current object. - The object to compare with the current object. - true if the specified is equal to the current object; otherwise, false. - - - Serves as a hash function for an object. - A hash code for the current object. - - - Gets the name of the product token. - The name of the product token. - - - Converts a string to an instance. - A string that represents product header value information. - A instance. - - - Returns a string that represents the current object. - A string that represents the current object. - - - Determines whether a string is valid information. - The string to validate. - The version of the string. - true if input is valid information; otherwise, false. - - - Gets the version of the product token. - The version of the product token. - - - Creates a new object that is a copy of the current instance. - A copy of the current instance. - - - Represents a value which can either be a product or a comment in a User-Agent header. - - - Initializes a new instance of the class. - A object used to initialize the new instance. - - - Initializes a new instance of the class. - A comment value. - - - Initializes a new instance of the class. - The product name value. - The product version value. - - - Gets the comment from the object. - The comment value this . - - - Determines whether the specified is equal to the current object. - The object to compare with the current object. - true if the specified is equal to the current object; otherwise, false. - - - Serves as a hash function for an object. - A hash code for the current object. - - - Converts a string to an instance. - A string that represents product info header value information. - A instance. - input is a null reference. - input is not valid product info header value information. - - - Gets the product from the object. - The product value from this . - - - Returns a string that represents the current object. - A string that represents the current object. - - - Determines whether a string is valid information. - The string to validate. - The version of the string. - true if input is valid information; otherwise, false. - - - Creates a new object that is a copy of the current instance. - A copy of the current instance. - - - Represents an If-Range header value which can either be a date/time or an entity-tag value. - - - Initializes a new instance of the class. - A date value used to initialize the new instance. - - - Initializes a new instance of the class. - An object used to initialize the new instance. - - - Initializes a new instance of the class. - An entity tag represented as a string used to initialize the new instance. - - - Gets the date from the object. - The date from the object. - - - Gets the entity tag from the object. - The entity tag from the object. - - - Determines whether the specified is equal to the current object. - The object to compare with the current object. - true if the specified is equal to the current object; otherwise, false. - - - Serves as a hash function for an object. - A hash code for the current object. - - - Converts a string to an instance. - A string that represents range condition header value information. - A instance. - input is a null reference. - input is not valid range Condition header value information. - - - Returns a string that represents the current object. - A string that represents the current object. - - - Determines whether a string is valid information. - The string to validate. - The version of the string. - true if input is valid information; otherwise, false. - - - Creates a new object that is a copy of the current instance. - A copy of the current instance. - - - Represents a Range header value. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with a byte range. - The position at which to start sending data. - The position at which to stop sending data. - from is greater than to -or- from or to is less than 0. - - - Determines whether the specified is equal to the current object. - The object to compare with the current object. - true if the specified is equal to the current object; otherwise, false. - - - Serves as a hash function for an object. - A hash code for the current object. - - - Converts a string to an instance. - A string that represents range header value information. - A instance. - input is a null reference. - input is not valid range header value information. - - - Gets the ranges specified from the object. - The ranges from the object. - - - Returns a string that represents the current object. - A string that represents the current object. - - - Determines whether a string is valid information. - he string to validate. - The version of the string. - true if input is valid information; otherwise, false. - - - Gets the unit from the object. - The unit from the object. - - - Creates a new object that is a copy of the current instance. - A copy of the current instance. - - - Represents a byte range in a Range header value. - - - Initializes a new instance of the class. - The position at which to start sending data. - The position at which to stop sending data. - from is greater than to -or- from or to is less than 0. - - - Determines whether the specified is equal to the current object. - The object to compare with the current object. - true if the specified is equal to the current object; otherwise, false. - - - Gets the position at which to start sending data. - The position at which to start sending data. - - - Serves as a hash function for an object. - A hash code for the current object. - - - Gets the position at which to stop sending data. - The position at which to stop sending data. - - - Returns a string that represents the current object. - A string that represents the current object. - - - Creates a new object that is a copy of the current instance. - A copy of the current instance. - - - Represents a Retry-After header value which can either be a date/time or a timespan value. - - - Initializes a new instance of the class. - The date and time offset used to initialize the new instance. - - - Initializes a new instance of the class. - The delta, in seconds, used to initialize the new instance. - - - Gets the date and time offset from the object. - The date and time offset from the object. - - - Gets the delta in seconds from the object. - The delta in seconds from the object. - - - Determines whether the specified is equal to the current object. - The object to compare with the current object. - true if the specified is equal to the current object; otherwise, false. - - - Serves as a hash function for an object. - A hash code for the current object. - - - Converts a string to an instance. - A string that represents retry condition header value information. - A instance. - input is a null reference. - input is not valid retry condition header value information. - - - Returns a string that represents the current object. - A string that represents the current object. - - - Determines whether a string is valid information. - The string to validate. - The version of the string. - true if input is valid information; otherwise, false. - - - Creates a new object that is a copy of the current instance. - A copy of the current instance. - - - Represents a string header value with an optional quality. - - - Initializes a new instance of the class. - The string used to initialize the new instance. - - - Initializes a new instance of the class. - A string used to initialize the new instance. - A quality factor used to initialize the new instance. - - - Determines whether the specified Object is equal to the current object. - The object to compare with the current object. - true if the specified is equal to the current object; otherwise, false. - - - Serves as a hash function for an object. - A hash code for the current object. - - - Converts a string to an instance. - A string that represents quality header value information. - A instance. - input is a null reference. - input is not valid string with quality header value information. - - - Gets the quality factor from the object. - The quality factor from the object. - - - Returns a string that represents the current object. - A string that represents the current object. - - - Determines whether a string is valid information. - The string to validate. - The version of the string. - true if input is valid information; otherwise, false. - - - Gets the string value from the object. - The string value from the object. - - - Creates a new object that is a copy of the current instance. - A copy of the current instance. - - - Represents an accept-encoding header value. - - - Initializes a new instance of the class. - A object used to initialize the new instance. - - - Initializes a new instance of the class. - A string used to initialize the new instance. - - - Determines whether the specified Object is equal to the current object. - The object to compare with the current object. - true if the specified is equal to the current object; otherwise, false. - - - Serves as a hash function for an object. - A hash code for the current object. - - - Gets the transfer-coding parameters. - The transfer-coding parameters. - - - Converts a string to an instance. - A string that represents transfer-coding header value information. - A instance. - input is a null reference. - input is not valid transfer-coding header value information. - - - Returns a string that represents the current object. - A string that represents the current object. - - - Determines whether a string is valid information. - The string to validate. - The version of the string. - true if input is valid information; otherwise, false. - - - Gets the transfer-coding value. - The transfer-coding value. - - - Creates a new object that is a copy of the current instance. - A copy of the current instance. - - - Represents an Accept-Encoding header value.with optional quality factor. - - - Initializes a new instance of the class. - A string used to initialize the new instance. - - - Initializes a new instance of the class. - A string used to initialize the new instance. - A value for the quality factor. - - - Converts a string to an instance. - A string that represents transfer-coding value information. - A instance. - input is a null reference. - input is not valid transfer-coding with quality header value information. - - - Gets the quality factor from the . - The quality factor from the . - - - Determines whether a string is valid information. - The string to validate. - The version of the string. - true if input is valid information; otherwise, false. - - - Creates a new object that is a copy of the current instance. - A copy of the current instance. - - - Represents the value of a Via header. - - - Initializes a new instance of the class. - The protocol version of the received protocol. - The host and port that the request or response was received by. - - - Initializes a new instance of the class. - The protocol version of the received protocol. - The host and port that the request or response was received by. - The protocol name of the received protocol. - - - Initializes a new instance of the class. - The protocol version of the received protocol. - The host and port that the request or response was received by. - The protocol name of the received protocol. - The comment field used to identify the software of the recipient proxy or gateway. - - - Gets the comment field used to identify the software of the recipient proxy or gateway. - The comment field used to identify the software of the recipient proxy or gateway. - - - Determines whether the specified is equal to the current object. - The object to compare with the current object. - true if the specified is equal to the current object; otherwise, false. - - - Serves as a hash function for an object. - Returns a hash code for the current object. - - - Converts a string to an instance. - A string that represents via header value information. - A instance. - input is a null reference. - input is not valid via header value information. - - - Gets the protocol name of the received protocol. - The protocol name. - - - Gets the protocol version of the received protocol. - The protocol version. - - - Gets the host and port that the request or response was received by. - The host and port that the request or response was received by. - - - Returns a string that represents the current object. - A string that represents the current object. - - - Determines whether a string is valid information. - The string to validate. - The version of the string. - true if input is valid information; otherwise, false. - - - Creates a new object that is a copy of the current instance. - A copy of the current instance. - - - Represents a warning value used by the Warning header. - - - Initializes a new instance of the class. - The specific warning code. - The host that attached the warning. - A quoted-string containing the warning text. - - - Initializes a new instance of the class. - The specific warning code. - The host that attached the warning. - A quoted-string containing the warning text. - The date/time stamp of the warning. - - - Gets the host that attached the warning. - The host that attached the warning. - - - Gets the specific warning code. - The specific warning code. - - - Gets the date/time stamp of the warning. - The date/time stamp of the warning. - - - Determines whether the specified is equal to the current object. - The object to compare with the current object. - true if the specified is equal to the current object; otherwise, false. - - - Serves as a hash function for an object. - A hash code for the current object. - - - Converts a string to an instance. - A string that represents authentication header value information. - Returns a instance. - input is a null reference. - input is not valid authentication header value information. - - - Gets a quoted-string containing the warning text. - A quoted-string containing the warning text. - - - Returns a string that represents the current object. - A string that represents the current object. - - - Determines whether a string is valid information. - The string to validate. - The version of the string. - true if input is valid information; otherwise, false. - - - Creates a new object that is a copy of the current instance. - Returns a copy of the current instance. - - - Provides a base class for sending HTTP requests and receiving HTTP responses from a resource identified by a URI. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with a specific handler. - The HTTP handler stack to use for sending requests. - - - Initializes a new instance of the class with a specific handler. - The responsible for processing the HTTP response messages. - true if the inner handler should be disposed of by Dispose(), false if you intend to reuse the inner handler. - - - Gets or sets the base address of Uniform Resource Identifier (URI) of the Internet resource used when sending requests. - The base address of Uniform Resource Identifier (URI) of the Internet resource used when sending requests. - - - Cancel all pending requests on this instance. - - - Gets the headers which should be sent with each request. - The headers which should be sent with each request. - - - Send a DELETE request to the specified Uri with a cancellation token as an asynchronous operation. - The Uri the request is sent to. - A cancellation token that can be used by other objects or threads to receive notice of cancellation. - The task object representing the asynchronous operation. - The requestUri was null. - The request message was already sent by the instance. - The request failed due to an underlying issue such as network connectivity, DNS failure, server certificate validation or timeout. - - - Send a DELETE request to the specified Uri with a cancellation token as an asynchronous operation. - The Uri the request is sent to. - A cancellation token that can be used by other objects or threads to receive notice of cancellation. - The task object representing the asynchronous operation. - The requestUri was null. - The request message was already sent by the instance. - The request failed due to an underlying issue such as network connectivity, DNS failure, server certificate validation or timeout. - - - Send a DELETE request to the specified Uri as an asynchronous operation. - The Uri the request is sent to. - The task object representing the asynchronous operation. - The requestUri was null. - The request message was already sent by the instance. - The request failed due to an underlying issue such as network connectivity, DNS failure, server certificate validation or timeout. - - - Send a DELETE request to the specified Uri as an asynchronous operation. - The Uri the request is sent to. - The task object representing the asynchronous operation. - The requestUri was null. - The request message was already sent by the instance. - The request failed due to an underlying issue such as network connectivity, DNS failure, server certificate validation or timeout. - - - Releases the unmanaged resources used by the and optionally disposes of the managed resources. - true to release both managed and unmanaged resources; false to releases only unmanaged resources. - - - Send a GET request to the specified Uri with an HTTP completion option and a cancellation token as an asynchronous operation. - The Uri the request is sent to. - An HTTP completion option value that indicates when the operation should be considered completed. - A cancellation token that can be used by other objects or threads to receive notice of cancellation. - The task object representing the asynchronous operation. - The requestUri was null. - The request failed due to an underlying issue such as network connectivity, DNS failure, server certificate validation or timeout. - - - Send a GET request to the specified Uri as an asynchronous operation. - The Uri the request is sent to. - The task object representing the asynchronous operation. - The requestUri was null. - The request failed due to an underlying issue such as network connectivity, DNS failure, server certificate validation or timeout. - - - Send a GET request to the specified Uri as an asynchronous operation. - The Uri the request is sent to. - The task object representing the asynchronous operation. - The requestUri was null. - The request failed due to an underlying issue such as network connectivity, DNS failure, server certificate validation or timeout. - - - Send a GET request to the specified Uri with an HTTP completion option as an asynchronous operation. - The Uri the request is sent to. - An HTTP completion option value that indicates when the operation should be considered completed. - The task object representing the asynchronous operation. - The requestUri was null. - The request failed due to an underlying issue such as network connectivity, DNS failure, server certificate validation or timeout. - - - Send a GET request to the specified Uri with a cancellation token as an asynchronous operation. - The Uri the request is sent to. - A cancellation token that can be used by other objects or threads to receive notice of cancellation. - The task object representing the asynchronous operation. - The requestUri was null. - The request failed due to an underlying issue such as network connectivity, DNS failure, server certificate validation or timeout. - - - Send a GET request to the specified Uri with an HTTP completion option as an asynchronous operation. - The Uri the request is sent to. - An HTTP completion option value that indicates when the operation should be considered completed. - The task object representing the asynchronous operation. - The requestUri was null. - The request failed due to an underlying issue such as network connectivity, DNS failure, server certificate validation or timeout. - - - Send a GET request to the specified Uri with a cancellation token as an asynchronous operation. - The Uri the request is sent to. - A cancellation token that can be used by other objects or threads to receive notice of cancellation. - The task object representing the asynchronous operation. - The requestUri was null. - The request failed due to an underlying issue such as network connectivity, DNS failure, server certificate validation or timeout. - - - Send a GET request to the specified Uri with an HTTP completion option and a cancellation token as an asynchronous operation. - The Uri the request is sent to. - An HTTP completion option value that indicates when the operation should be considered completed. - A cancellation token that can be used by other objects or threads to receive notice of cancellation. - The task object representing the asynchronous operation. - The requestUri was null. - The request failed due to an underlying issue such as network connectivity, DNS failure, server certificate validation or timeout. - - - Send a GET request to the specified Uri and return the response body as a byte array in an asynchronous operation. - The Uri the request is sent to. - The task object representing the asynchronous operation. - The requestUri was null. - The request failed due to an underlying issue such as network connectivity, DNS failure, server certificate validation or timeout. - - - Send a GET request to the specified Uri and return the response body as a byte array in an asynchronous operation. - The Uri the request is sent to. - The task object representing the asynchronous operation. - The requestUri was null. - The request failed due to an underlying issue such as network connectivity, DNS failure, server certificate validation or timeout. - - - Send a GET request to the specified Uri and return the response body as a stream in an asynchronous operation. - The Uri the request is sent to. - The task object representing the asynchronous operation. - The requestUri was null. - The request failed due to an underlying issue such as network connectivity, DNS failure, server certificate validation or timeout. - - - Send a GET request to the specified Uri and return the response body as a stream in an asynchronous operation. - The Uri the request is sent to. - The task object representing the asynchronous operation. - The requestUri was null. - The request failed due to an underlying issue such as network connectivity, DNS failure, server certificate validation or timeout. - - - Send a GET request to the specified Uri and return the response body as a string in an asynchronous operation. - The Uri the request is sent to. - The task object representing the asynchronous operation. - The requestUri was null. - The request failed due to an underlying issue such as network connectivity, DNS failure, server certificate validation or timeout. - - - Send a GET request to the specified Uri and return the response body as a string in an asynchronous operation. - The Uri the request is sent to. - The task object representing the asynchronous operation. - The requestUri was null. - The request failed due to an underlying issue such as network connectivity, DNS failure, server certificate validation or timeout. - - - Gets or sets the maximum number of bytes to buffer when reading the response content. - The maximum number of bytes to buffer when reading the response content. The default value for this property is 2 gigabytes. - The size specified is less than or equal to zero. - An operation has already been started on the current instance. - The current instance has been disposed. - - - Send a POST request with a cancellation token as an asynchronous operation. - The Uri the request is sent to. - The HTTP request content sent to the server. - A cancellation token that can be used by other objects or threads to receive notice of cancellation. - The task object representing the asynchronous operation. - The requestUri was null. - The request failed due to an underlying issue such as network connectivity, DNS failure, server certificate validation or timeout. - - - Send a POST request with a cancellation token as an asynchronous operation. - The Uri the request is sent to. - The HTTP request content sent to the server. - A cancellation token that can be used by other objects or threads to receive notice of cancellation. - The task object representing the asynchronous operation. - The requestUri was null. - The request failed due to an underlying issue such as network connectivity, DNS failure, server certificate validation or timeout. - - - Send a POST request to the specified Uri as an asynchronous operation. - The Uri the request is sent to. - The HTTP request content sent to the server. - The task object representing the asynchronous operation. - The requestUri was null. - The request failed due to an underlying issue such as network connectivity, DNS failure, server certificate validation or timeout. - - - Send a POST request to the specified Uri as an asynchronous operation. - The Uri the request is sent to. - The HTTP request content sent to the server. - The task object representing the asynchronous operation. - The requestUri was null. - The request failed due to an underlying issue such as network connectivity, DNS failure, server certificate validation or timeout. - - - Send a PUT request to the specified Uri as an asynchronous operation. - The Uri the request is sent to. - The HTTP request content sent to the server. - The task object representing the asynchronous operation. - The requestUri was null. - The request failed due to an underlying issue such as network connectivity, DNS failure, server certificate validation or timeout. - - - Send a PUT request to the specified Uri as an asynchronous operation. - The Uri the request is sent to. - The HTTP request content sent to the server. - The task object representing the asynchronous operation. - The requestUri was null. - The request failed due to an underlying issue such as network connectivity, DNS failure, server certificate validation or timeout. - - - Send a PUT request with a cancellation token as an asynchronous operation. - The Uri the request is sent to. - The HTTP request content sent to the server. - A cancellation token that can be used by other objects or threads to receive notice of cancellation. - The task object representing the asynchronous operation. - The requestUri was null. - The request failed due to an underlying issue such as network connectivity, DNS failure, server certificate validation or timeout. - - - Send a PUT request with a cancellation token as an asynchronous operation. - The Uri the request is sent to. - The HTTP request content sent to the server. - A cancellation token that can be used by other objects or threads to receive notice of cancellation. - The task object representing the asynchronous operation. - The requestUri was null. - The request failed due to an underlying issue such as network connectivity, DNS failure, server certificate validation or timeout. - - - Send an HTTP request as an asynchronous operation. - The HTTP request message to send. - When the operation should complete (as soon as a response is available or after reading the whole response content). - The cancellation token to cancel operation. - The task object representing the asynchronous operation. - The request was null. - The request message was already sent by the instance. - The request failed due to an underlying issue such as network connectivity, DNS failure, server certificate validation or timeout. - - - Send an HTTP request as an asynchronous operation. - The HTTP request message to send. - The task object representing the asynchronous operation. - The request was null. - The request message was already sent by the instance. - The request failed due to an underlying issue such as network connectivity, DNS failure, server certificate validation or timeout. - - - Send an HTTP request as an asynchronous operation. - The HTTP request message to send. - When the operation should complete (as soon as a response is available or after reading the whole response content). - The task object representing the asynchronous operation. - The request was null. - The request message was already sent by the instance. - The request failed due to an underlying issue such as network connectivity, DNS failure, server certificate validation or timeout. - - - Send an HTTP request as an asynchronous operation. - The HTTP request message to send. - The cancellation token to cancel operation. - The task object representing the asynchronous operation. - The request was null. - The request message was already sent by the instance. - The request failed due to an underlying issue such as network connectivity, DNS failure, server certificate validation or timeout. - - - Gets or sets the timespan to wait before the request times out. - The timespan to wait before the request times out. - The timeout specified is less than or equal to zero and is not . - An operation has already been started on the current instance. - The current instance has been disposed. - - - The default message handler used by . - - - Creates an instance of a class. - - - Gets or sets a value that indicates whether the handler should follow redirection responses. - true if the if the handler should follow redirection responses; otherwise false. The default value is true. - - - Gets or sets the type of decompression method used by the handler for automatic decompression of the HTTP content response. - The automatic decompression method used by the handler. - - - - - - Gets or sets a value that indicates if the certificate is automatically picked from the certificate store or if the caller is allowed to pass in a specific client certificate. - The collection of security certificates associated with this handler. - - - - - - Gets or sets the cookie container used to store server cookies by the handler. - The cookie container used to store server cookies by the handler. - - - Gets or sets authentication information used by this handler. - The authentication credentials associated with the handler. The default is null. - - - - - - Releases the unmanaged resources used by the and optionally disposes of the managed resources. - true to release both managed and unmanaged resources; false to releases only unmanaged resources. - - - Gets or sets the maximum number of redirects that the handler follows. - The maximum number of redirection responses that the handler follows. The default value is 50. - - - - - - Gets or sets the maximum request content buffer size used by the handler. - The maximum request content buffer size in bytes. The default value is 2 gigabytes. - - - - - - Gets or sets a value that indicates whether the handler sends an Authorization header with the request. - true for the handler to send an HTTP Authorization header with requests after authentication has taken place; otherwise, false. The default is false. - - - - - - Gets or sets proxy information used by the handler. - The proxy information used by the handler. The default value is null. - - - Creates an instance of based on the information provided in the as an operation that will not block. - The HTTP request message. - A cancellation token to cancel the operation. - The task object representing the asynchronous operation. - The request was null. - - - - - - - - - Gets a value that indicates whether the handler supports automatic response content decompression. - true if the if the handler supports automatic response content decompression; otherwise false. The default value is true. - - - Gets a value that indicates whether the handler supports proxy settings. - true if the if the handler supports proxy settings; otherwise false. The default value is true. - - - Gets a value that indicates whether the handler supports configuration settings for the and properties. - true if the if the handler supports configuration settings for the and properties; otherwise false. The default value is true. - - - Gets or sets a value that indicates whether the handler uses the property to store server cookies and uses these cookies when sending requests. - true if the if the handler supports uses the property to store server cookies and uses these cookies when sending requests; otherwise false. The default value is true. - - - Gets or sets a value that controls whether default credentials are sent with requests by the handler. - true if the default credentials are used; otherwise false. The default value is false. - - - Gets or sets a value that indicates whether the handler uses a proxy for requests. - true if the handler should use a proxy for requests; otherwise false. The default value is true. - - - Indicates if operations should be considered completed either as soon as a response is available, or after reading the entire response message including the content. - - - The operation should complete after reading the entire response including the content. - - - - The operation should complete as soon as a response is available and headers are read. The content is not read yet. - - - - A base class representing an HTTP entity body and content headers. - - - Initializes a new instance of the class. - - - Serialize the HTTP content into a stream of bytes and copies it to the stream object provided as the stream parameter. - The target stream. - The task object representing the asynchronous operation. - - - Serialize the HTTP content into a stream of bytes and copies it to the stream object provided as the stream parameter. - The target stream. - Information about the transport (channel binding token, for example). This parameter may be null. - The task object representing the asynchronous operation. - - - Serialize the HTTP content to a memory stream as an asynchronous operation. - The task object representing the asynchronous operation. - - - Releases the unmanaged resources and disposes of the managed resources used by the . - - - Releases the unmanaged resources used by the and optionally disposes of the managed resources. - true to release both managed and unmanaged resources; false to releases only unmanaged resources. - - - Gets the HTTP content headers as defined in RFC 2616. - The content headers as defined in RFC 2616. - - - Serialize the HTTP content to a memory buffer as an asynchronous operation. - The task object representing the asynchronous operation. - - - Serialize the HTTP content to a memory buffer as an asynchronous operation. - The maximum size, in bytes, of the buffer to use. - The task object representing the asynchronous operation. - - - Serialize the HTTP content to a byte array as an asynchronous operation. - The task object representing the asynchronous operation. - - - Serialize the HTTP content and return a stream that represents the content as an asynchronous operation. - The task object representing the asynchronous operation. - - - Serialize the HTTP content to a string as an asynchronous operation. - The task object representing the asynchronous operation. - - - Serialize the HTTP content to a stream as an asynchronous operation. - The target stream. - Information about the transport (channel binding token, for example). This parameter may be null. - The task object representing the asynchronous operation. - - - Determines whether the HTTP content has a valid length in bytes. - The length in bytes of the HTTP content. - true if length is a valid length; otherwise, false. - - - A base type for HTTP message handlers. - - - Initializes a new instance of the class. - - - Releases the unmanaged resources and disposes of the managed resources used by the . - - - Releases the unmanaged resources used by the and optionally disposes of the managed resources. - true to release both managed and unmanaged resources; false to releases only unmanaged resources. - - - Send an HTTP request as an asynchronous operation. - The HTTP request message to send. - The cancellation token to cancel operation. - The task object representing the asynchronous operation. - The request was null. - - - A specialty class that allows applications to call the method on an Http handler chain. - - - Initializes an instance of a class with a specific . - The responsible for processing the HTTP response messages. - - - Initializes an instance of a class with a specific . - The responsible for processing the HTTP response messages. - true if the inner handler should be disposed of by Dispose(), false if you intend to reuse the inner handler. - - - Releases the unmanaged resources and disposes of the managed resources used by the . - - - Releases the unmanaged resources used by the and optionally disposes of the managed resources. - true to release both managed and unmanaged resources; false to releases only unmanaged resources. - - - Send an HTTP request as an asynchronous operation. - The HTTP request message to send. - The cancellation token to cancel operation. - The task object representing the asynchronous operation. - The request was null. - - - A helper class for retrieving and comparing standard HTTP methods and for creating new HTTP methods. - - - Initializes a new instance of the class with a specific HTTP method. - The HTTP method. - - - Represents an HTTP DELETE protocol method. - Returns . - - - Determines whether the specified is equal to the current . - The HTTP method to compare with the current object. - true if the specified object is equal to the current object; otherwise, false. - - - Determines whether the specified is equal to the current . - The object to compare with the current object. - true if the specified object is equal to the current object; otherwise, false. - - - Represents an HTTP GET protocol method. - Returns . - - - Serves as a hash function for this type. - A hash code for the current . - - - Represents an HTTP HEAD protocol method. The HEAD method is identical to GET except that the server only returns message-headers in the response, without a message-body. - Returns . - - - An HTTP method. - An HTTP method represented as a . - - - The equality operator for comparing two objects. - The left to an equality operator. - The right to an equality operator. - true if the specified left and right parameters are equal; otherwise, false. - - - The inequality operator for comparing two objects. - The left to an inequality operator. - The right to an inequality operator. - true if the specified left and right parameters are inequal; otherwise, false. - - - Represents an HTTP OPTIONS protocol method. - Returns . - - - Represents an HTTP POST protocol method that is used to post a new entity as an addition to a URI. - Returns . - - - Represents an HTTP PUT protocol method that is used to replace an entity identified by a URI. - Returns . - - - Returns a string that represents the current object. - A string representing the current object. - - - Represents an HTTP TRACE protocol method. - Returns . - - - A base class for exceptions thrown by the and classes. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with a specific message that describes the current exception. - A message that describes the current exception. - - - Initializes a new instance of the class with a specific message that describes the current exception and an inner exception. - A message that describes the current exception. - The inner exception. - - - Represents a HTTP request message. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with an HTTP method and a request . - The HTTP method. - A string that represents the request . - - - Initializes a new instance of the class with an HTTP method and a request . - The HTTP method. - The to request. - - - Gets or sets the contents of the HTTP message. - The content of a message - - - Releases the unmanaged resources and disposes of the managed resources used by the . - - - Releases the unmanaged resources used by the and optionally disposes of the managed resources. - true to release both managed and unmanaged resources; false to releases only unmanaged resources. - - - Gets the collection of HTTP request headers. - The collection of HTTP request headers. - - - Gets or sets the HTTP method used by the HTTP request message. - The HTTP method used by the request message. The default is the GET method. - - - Gets a set of properties for the HTTP request. - Returns . - - - Gets or sets the used for the HTTP request. - The used for the HTTP request. - - - Returns a string that represents the current object. - A string representation of the current object. - - - Gets or sets the HTTP message version. - The HTTP message version. The default is 1.1. - - - Represents a HTTP response message including the status code and data. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with a specific . - The status code of the HTTP response. - - - Gets or sets the content of a HTTP response message. - The content of the HTTP response message. - - - Releases the unmanaged resources and disposes of unmanaged resources used by the . - - - Releases the unmanaged resources used by the and optionally disposes of the managed resources. - true to release both managed and unmanaged resources; false to releases only unmanaged resources. - - - Throws an exception if the property for the HTTP response is false. - The HTTP response message if the call is successful. - - - Gets the collection of HTTP response headers. - The collection of HTTP response headers. - - - Gets a value that indicates if the HTTP response was successful. - A value that indicates if the HTTP response was successful. true if was in the range 200-299; otherwise false. - - - Gets or sets the reason phrase which typically is sent by servers together with the status code. - The reason phrase sent by the server. - - - Gets or sets the request message which led to this response message. - The request message which led to this response message. - - - Gets or sets the status code of the HTTP response. - The status code of the HTTP response. - - - Returns a string that represents the current object. - A string representation of the current object. - - - Gets or sets the HTTP message version. - The HTTP message version. The default is 1.1. - - - A base type for handlers which only do some small processing of request and/or response messages. - - - Creates an instance of a class. - - - Creates an instance of a class with a specific inner handler. - The inner handler which is responsible for processing the HTTP response messages. - - - Performs processing on each request sent to the server. - The HTTP request message to process. - A cancellation token that can be used by other objects or threads to receive notice of cancellation. - The HTTP request message that was processed. - - - Perform processing on each response from the server. - The HTTP response message to process. - A cancellation token that can be used by other objects or threads to receive notice of cancellation. - The HTTP response message that was processed. - - - Sends an HTTP request to the inner handler to send to the server as an asynchronous operation. - The HTTP request message to send to the server. - A cancellation token that can be used by other objects or threads to receive notice of cancellation. - The task object representing the asynchronous operation. - The request was null. - - - Provides a collection of objects that get serialized using the multipart/* content type specification. - - - Creates a new instance of the class. - - - Creates a new instance of the class. - The subtype of the multipart content. - The subtype was null or contains only white space characters. - - - Creates a new instance of the class. - The subtype of the multipart content. - The boundary string for the multipart content. - The subtype was null or an empty string. The boundary was null or contains only white space characters. -or- The boundary ends with a space character. - The length of the boundary was greater than 70. - - - Add multipart HTTP content to a collection of objects that get serialized using the multipart/* content type specification. - The HTTP content to add to the collection. - The content was null. - - - Releases the unmanaged resources used by the and optionally disposes of the managed resources. - true to release both managed and unmanaged resources; false to releases only unmanaged resources. - - - Returns an enumerator that iterates through the collection of objects that get serialized using the multipart/* content type specification.. - An object that can be used to iterate through the collection. - - - Serialize the multipart HTTP content to a stream as an asynchronous operation. - The target stream. - Information about the transport (channel binding token, for example). This parameter may be null. - The task object representing the asynchronous operation. - - - Determines whether the HTTP multipart content has a valid length in bytes. - The length in bytes of the HHTP content. - true if length is a valid length; otherwise, false. - - - The explicit implementation of the method. - An object that can be used to iterate through the collection. - - - Provides a container for content encoded using multipart/form-data MIME type. - - - Creates a new instance of the class. - - - Creates a new instance of the class. - The boundary string for the multipart form data content. - The boundary was null or contains only white space characters. -or- The boundary ends with a space character. - The length of the boundary was greater than 70. - - - Add HTTP content to a collection of objects that get serialized to multipart/form-data MIME type. - The HTTP content to add to the collection. - The content was null. - - - Add HTTP content to a collection of objects that get serialized to multipart/form-data MIME type. - The HTTP content to add to the collection. - The name for the HTTP content to add. - The name was null or contains only white space characters. - The content was null. - - - Add HTTP content to a collection of objects that get serialized to multipart/form-data MIME type. - The HTTP content to add to the collection. - The name for the HTTP content to add. - The file name for the HTTP content to add to the collection. - The name was null or contains only white space characters. -or- The fileName was null or contains only white space characters. - The content was null. - - - Provides HTTP content based on a stream. - - - Creates a new instance of the class. - The content used to initialize the . - - - Creates a new instance of the class. - The content used to initialize the . - The size, in bytes, of the buffer for the . - The content was null. - The bufferSize was less than or equal to zero. - - - Write the HTTP stream content to a memory stream as an asynchronous operation. - The task object representing the asynchronous operation. - - - Releases the unmanaged resources used by the and optionally disposes of the managed resources. - true to release both managed and unmanaged resources; false to releases only unmanaged resources. - - - Serialize the HTTP content to a stream as an asynchronous operation. - The target stream. - Information about the transport (channel binding token, for example). This parameter may be null. - The task object representing the asynchronous operation. - - - Determines whether the stream content has a valid length in bytes. - The length in bytes of the stream content. - true if length is a valid length; otherwise, false. - - - Provides HTTP content based on a string. - - - Creates a new instance of the class. - The content used to initialize the . - - - Creates a new instance of the class. - The content used to initialize the . - The encoding to use for the content. - - - Creates a new instance of the class. - The content used to initialize the . - The encoding to use for the content. - The media type to use for the content. - - - Represents the method that notifies callers when a continue response is received by the client. - The numeric value of the HTTP status from the server. - The headers returned with the 100-continue response from the server. - - - A delegate called to determine the to use for each request. - The to determine the extended protection policy that the instance will use to provide extended protection. - - - - Provides a simple, programmatically controlled HTTP protocol listener. This class cannot be inherited. - - - Initializes a new instance of the class. - This class cannot be used on the current operating system. Windows Server 2003 or Windows XP SP2 is required to use instances of this class. - - - Shuts down the object immediately, discarding all currently queued requests. - - - Gets or sets the scheme used to authenticate clients. - A bitwise combination of enumeration values that indicates how clients are to be authenticated. The default value is . - This object has been closed. - - - Gets or sets the delegate called to determine the protocol used to authenticate clients. - An delegate that invokes the method used to select an authentication protocol. The default value is null. - This object has been closed. - - - Begins asynchronously retrieving an incoming request. - An delegate that references the method to invoke when a client request is available. - A user-defined object that contains information about the operation. This object is passed to the callback delegate when the operation completes. - An object that indicates the status of the asynchronous operation. - A Win32 function call failed. Check the exception's property to determine the cause of the exception. - This object has not been started or is currently stopped. - This object is closed. - - - Shuts down the . - - - Gets a default list of Service Provider Names (SPNs) as determined by registered prefixes. - A that contains a list of SPNs. - - - Completes an asynchronous operation to retrieve an incoming client request. - An object that was obtained when the asynchronous operation was started. - An object that represents the client request. - asyncResult was not obtained by calling the method. - asyncResult is null. - The method was already called for the specified asyncResult object. - This object is closed. - - - Get or set the to use for extended protection for a session. - A that specifies the policy to use for extended protection. - An attempt was made to set the property, but the property was not null. - An attempt was made to set the property to null. - An attempt was made to set the property after the method was already called. - This object is closed. - The property was set to on a platform that does not support extended protection. - - - Get or set the delegate called to determine the to use for each request. - A that specifies the policy to use for extended protection. - An attempt was made to set the property, but the property must be null. - An attempt was made to set the property to null. - An attempt was made to set the property after the method was already called. - This object is closed. - An attempt was made to set the property on a platform that does not support extended protection. - - - Waits for an incoming request and returns when one is received. - An object that represents a client request. - A Win32 function call failed. Check the exception's property to determine the cause of the exception. - This object has not been started or is currently stopped. -or- The does not have any Uniform Resource Identifier (URI) prefixes to respond to. - This object is closed. - - - Waits for an incoming request as an asynchronous operation. - Returns . The task object representing the asynchronous operation. The property on the task object returns an object that represents a client request. - - - Gets or sets a value that specifies whether your application receives exceptions that occur when an sends the response to the client. - true if this should not return exceptions that occur when sending the response to the client; otherwise false. The default value is false. - This object has been closed. - - - Gets a value that indicates whether has been started. - true if the was started; otherwise, false. - - - Gets a value that indicates whether can be used with the current operating system. - true if is supported; otherwise, false. - - - Gets the Uniform Resource Identifier (URI) prefixes handled by this object. - An that contains the URI prefixes that this object is configured to handle. - This object has been closed. - - - Gets or sets the realm, or resource partition, associated with this object. - A value that contains the name of the realm associated with the object. - This object has been closed. - - - Allows this instance to receive incoming requests. - A Win32 function call failed. Check the exception's property to determine the cause of the exception. - This object is closed. - - - Causes this instance to stop receiving incoming requests. - This object has been closed. - - - The timeout manager for this instance. - Returns . The timeout manager for this instance. - - - Gets or sets a value that controls whether, when NTLM is used, additional requests using the same Transmission Control Protocol (TCP) connection are required to authenticate. - true if the of the first request will be used for subsequent requests on the same connection; otherwise, false. The default value is false. - This object has been closed. - - - Releases the resources held by this object. - - - Holds the user name and password from a basic authentication request. - - - Initializes a new instance of the class using the specified user name and password. - The user name. - The password. - - - Indicates the password from a basic authentication attempt. - A that holds the password. - - - Provides access to the request and response objects used by the class. This class cannot be inherited. - - - Accept a WebSocket connection as an asynchronous operation. - The supported WebSocket sub-protocol. - Returns . The task object representing the asynchronous operation. The property on the task object returns an object. - subProtocol is an empty string -or- subProtocol contains illegal characters. - An error occurred when sending the response to complete the WebSocket handshake. - - - Accept a WebSocket connection specifying the supported WebSocket sub-protocol and WebSocket keep-alive interval as an asynchronous operation. - The supported WebSocket sub-protocol. - The WebSocket protocol keep-alive interval in milliseconds. - Returns . The task object representing the asynchronous operation. The property on the task object returns an object. - subProtocol is an empty string -or- subProtocol contains illegal characters. - keepAliveInterval is too small. - An error occurred when sending the response to complete the WebSocket handshake. - - - Accept a WebSocket connection specifying the supported WebSocket sub-protocol, receive buffer size, and WebSocket keep-alive interval as an asynchronous operation. - The supported WebSocket sub-protocol. - The receive buffer size in bytes. - The WebSocket protocol keep-alive interval in milliseconds. - Returns . The task object representing the asynchronous operation. The property on the task object returns an object. - subProtocol is an empty string -or- subProtocol contains illegal characters. - keepAliveInterval is too small. -or- receiveBufferSize is less than 16 bytes -or- receiveBufferSize is greater than 64K bytes. - An error occurred when sending the response to complete the WebSocket handshake. - - - Accept a WebSocket connection specifying the supported WebSocket sub-protocol, receive buffer size, WebSocket keep-alive interval, and the internal buffer as an asynchronous operation. - The supported WebSocket sub-protocol. - The receive buffer size in bytes. - The WebSocket protocol keep-alive interval in milliseconds. - An internal buffer to use for this operation. - Returns . The task object representing the asynchronous operation. The property on the task object returns an object. - subProtocol is an empty string -or- subProtocol contains illegal characters. - keepAliveInterval is too small. -or- receiveBufferSize is less than 16 bytes -or- receiveBufferSize is greater than 64K bytes. - An error occurred when sending the response to complete the WebSocket handshake. - - - Gets the that represents a client's request for a resource. - An object that represents the client request. - - - Gets the object that will be sent to the client in response to the client's request. - An object used to send a response back to the client. - - - Gets an object used to obtain identity, authentication information, and security roles for the client whose request is represented by this object. - An object that describes the client, or null if the that supplied this does not require authentication. - - - The exception that is thrown when an error occurs processing an HTTP request. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class using the specified error code. - A value that identifies the error that occurred. - - - Initializes a new instance of the class using the specified error code and message. - A value that identifies the error that occurred. - A that describes the error that occurred. - - - Initializes a new instance of the class from the specified instances of the and classes. - A object that contains the information required to deserialize the new object. - A object. - - - Gets a value that identifies the error that occurred. - A value. - - - The exception that is thrown when an array with the wrong number of dimensions is passed to a method. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with a specified error message. - A that describes the error. - - - Initializes a new instance of the class with serialized data. - The object that holds the serialized object data. - The contextual information about the source or destination. - - - Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. - The error message that explains the reason for the exception. - The exception that is the cause of the current exception. If the innerException parameter is not a null reference (Nothing in Visual Basic), the current exception is raised in a catch block that handles the inner exception. - - - The exception that is thrown when binding to a member results in more than one member matching the binding criteria. This class cannot be inherited. - - - Initializes a new instance of the class with an empty message string and the root cause exception set to null. - - - Initializes a new instance of the class with its message string set to the given message and the root cause exception set to null. - A string indicating the reason this exception was thrown. - - - Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. - The error message that explains the reason for the exception. - The exception that is the cause of the current exception. If the inner parameter is not null, the current exception is raised in a catch block that handles the inner exception. - - - Represents an assembly, which is a reusable, versionable, and self-describing building block of a common language runtime application. - - - Initializes a new instance of the class. - - - Gets the location of the assembly as specified originally, for example, in an object. - The location of the assembly as specified originally. - - - Locates the specified type from this assembly and creates an instance of it using the system activator, using case-sensitive search. - The of the type to locate. - An instance of the specified type created with the default constructor; or null if typeName is not found. The type is resolved using the default binder, without specifying culture or activation attributes, and with set to Public or Instance. - typeName is an empty string ("") or a string beginning with a null character. -or- The current assembly was loaded into the reflection-only context. - typeName is null. - No matching constructor was found. - typeName requires a dependent assembly that could not be found. - typeName requires a dependent assembly that was found but could not be loaded. -or- The current assembly was loaded into the reflection-only context, and typeName requires a dependent assembly that was not preloaded. - typeName requires a dependent assembly, but the file is not a valid assembly. -or- typeName requires a dependent assembly that was compiled for a version of the runtime that is later than the currently loaded version. - - - Locates the specified type from this assembly and creates an instance of it using the system activator, with optional case-sensitive search. - The of the type to locate. - true to ignore the case of the type name; otherwise, false. - An instance of the specified type created with the default constructor; or null if typeName is not found. The type is resolved using the default binder, without specifying culture or activation attributes, and with set to Public or Instance. - typeName is an empty string ("") or a string beginning with a null character. -or- The current assembly was loaded into the reflection-only context. - No matching constructor was found. - typeName is null. - typeName requires a dependent assembly that could not be found. - typeName requires a dependent assembly that was found but could not be loaded. -or- The current assembly was loaded into the reflection-only context, and typeName requires a dependent assembly that was not preloaded. - typeName requires a dependent assembly, but the file is not a valid assembly. -or- typeName requires a dependent assembly that was compiled for a version of the runtime that is later than the currently loaded version. - - - Locates the specified type from this assembly and creates an instance of it using the system activator, with optional case-sensitive search and having the specified culture, arguments, and binding and activation attributes. - The of the type to locate. - true to ignore the case of the type name; otherwise, false. - A bitmask that affects the way in which the search is conducted. The value is a combination of bit flags from . - An object that enables the binding, coercion of argument types, invocation of members, and retrieval of MemberInfo objects via reflection. If binder is null, the default binder is used. - An array that contains the arguments to be passed to the constructor. This array of arguments must match in number, order, and type the parameters of the constructor to be invoked. If the default constructor is desired, args must be an empty array or null. - An instance of CultureInfo used to govern the coercion of types. If this is null, the CultureInfo for the current thread is used. (This is necessary to convert a String that represents 1000 to a Double value, for example, since 1000 is represented differently by different cultures.) - An array of one or more attributes that can participate in activation. Typically, an array that contains a single object that specifies the URL that is required to activate a remote object. This parameter is related to client-activated objects. Client activation is a legacy technology that is retained for backward compatibility but is not recommended for new development. Distributed applications should instead use Windows Communication Foundation. - An instance of the specified type, or null if typeName is not found. The supplied arguments are used to resolve the type, and to bind the constructor that is used to create the instance. - typeName is an empty string ("") or a string beginning with a null character. -or- The current assembly was loaded into the reflection-only context. - typeName is null. - No matching constructor was found. - A non-empty activation attributes array is passed to a type that does not inherit from . - typeName requires a dependent assembly that could not be found. - typeName requires a dependent assembly that was found but could not be loaded. -or- The current assembly was loaded into the reflection-only context, and typeName requires a dependent assembly that was not preloaded. - typeName requires a dependent assembly, but the file is not a valid assembly. -or- typeName requires a dependent assembly which that was compiled for a version of the runtime that is later than the currently loaded version. - - - Creates the name of a type qualified by the display name of its assembly. - The display name of an assembly. - The full name of a type. - The full name of the type qualified by the display name of the assembly. - - - Gets a collection that contains this assembly's custom attributes. - A collection that contains this assembly's custom attributes. - - - Gets a collection of the types defined in this assembly. - A collection of the types defined in this assembly. - - - Gets the entry point of this assembly. - An object that represents the entry point of this assembly. If no entry point is found (for example, the assembly is a DLL), null is returned. - - - Determines whether this assembly and the specified object are equal. - The object to compare with this instance. - true if o is equal to this instance; otherwise, false. - - - Gets the URI, including escape characters, that represents the codebase. - A URI with escape characters. - - - Gets a collection of the public types defined in this assembly that are visible outside the assembly. - A collection of the public types defined in this assembly that are visible outside the assembly. - - - Gets the display name of the assembly. - The display name of the assembly. - - - Gets the currently loaded assembly in which the specified type is defined. - An object representing a type in the assembly that will be returned. - The assembly in which the specified type is defined. - type is null. - - - Returns the of the method that invoked the currently executing method. - The Assembly object of the method that invoked the currently executing method. - - - Gets all the custom attributes for this assembly. - This argument is ignored for objects of type . - An array that contains the custom attributes for this assembly. - - - Gets the custom attributes for this assembly as specified by type. - The type for which the custom attributes are to be returned. - This argument is ignored for objects of type . - An array that contains the custom attributes for this assembly as specified by attributeType. - attributeType is null. - attributeType is not a runtime type. - - - Returns information about the attributes that have been applied to the current , expressed as objects. - A generic list of objects representing data about the attributes that have been applied to the current assembly. - - - Gets the process executable in the default application domain. In other application domains, this is the first executable that was executed by . - The assembly that is the process executable in the default application domain, or the first executable that was executed by . Can return null when called from unmanaged code. - - - Gets the assembly that contains the code that is currently executing. - The assembly that contains the code that is currently executing. - - - Gets the public types defined in this assembly that are visible outside the assembly. - An array that represents the types defined in this assembly that are visible outside the assembly. - The assembly is a dynamic assembly. - - - Gets a for the specified file in the file table of the manifest of this assembly. - The name of the specified file. Do not include the path to the file. - A stream that contains the specified file, or null if the file is not found. - A file that was found could not be loaded. - The name parameter is null. - The name parameter is an empty string (""). - name was not found. - name is not a valid assembly. - - - Gets the files in the file table of an assembly manifest. - An array of streams that contain the files. - A file that was found could not be loaded. - A file was not found. - A file was not a valid assembly. - - - Gets the files in the file table of an assembly manifest, specifying whether to include resource modules. - true to include resource modules; otherwise, false. - An array of streams that contain the files. - A file that was found could not be loaded. - A file was not found. - A file was not a valid assembly. - - - Returns the hash code for this instance. - A 32-bit signed integer hash code. - - - Gets all the loaded modules that are part of this assembly. - An array of modules. - - - Gets all the loaded modules that are part of this assembly, specifying whether to include resource modules. - true to include resource modules; otherwise, false. - An array of modules. - - - Returns information about how the given resource has been persisted. - The case-sensitive name of the resource. - An object that is populated with information about the resource's topology, or null if the resource is not found. - resourceName is null. - The resourceName parameter is an empty string (""). - - - Returns the names of all the resources in this assembly. - An array that contains the names of all the resources. - - - Loads the specified manifest resource, scoped by the namespace of the specified type, from this assembly. - The type whose namespace is used to scope the manifest resource name. - The case-sensitive name of the manifest resource being requested. - The manifest resource; or null if no resources were specified during compilation or if the resource is not visible to the caller. - The name parameter is null. - The name parameter is an empty string (""). - A file that was found could not be loaded. - name was not found. - name is not a valid assembly. - Resource length is greater than . - - - Loads the specified manifest resource from this assembly. - The case-sensitive name of the manifest resource being requested. - The manifest resource; or null if no resources were specified during compilation or if the resource is not visible to the caller. - The name parameter is null. - The name parameter is an empty string (""). - - In the [.NET for Windows Store apps](http://go.microsoft.com/fwlink/?LinkID=247912) or the [Portable Class Library](~/docs/standard/cross-platform/cross-platform-development-with-the-portable-class-library.md), catch the base class exception, , instead. - - A file that was found could not be loaded. - name was not found. - name is not a valid assembly. - Resource length is greater than . - - - Gets the specified module in this assembly. - The name of the module being requested. - The module being requested, or null if the module is not found. - The name parameter is null. - The name parameter is an empty string (""). - A file that was found could not be loaded. - name was not found. - name is not a valid assembly. - - - Gets all the modules that are part of this assembly. - An array of modules. - The module to be loaded does not specify a file name extension. - - - Gets all the modules that are part of this assembly, specifying whether to include resource modules. - true to include resource modules; otherwise, false. - An array of modules. - - - Gets an for this assembly. - An object that contains the fully parsed display name for this assembly. - - - Gets an for this assembly, setting the codebase as specified by copiedName. - true to set the to the location of the assembly after it was shadow copied; false to set to the original location. - An object that contains the fully parsed display name for this assembly. - - - Gets serialization information with all of the data needed to reinstantiate this assembly. - The object to be populated with serialization information. - The destination context of the serialization. - info is null. - - - Gets the objects for all the assemblies referenced by this assembly. - An array that contains the fully parsed display names of all the assemblies referenced by this assembly. - - - Gets the specified version of the satellite assembly for the specified culture. - The specified culture. - The version of the satellite assembly. - The specified satellite assembly. - culture is null. - The satellite assembly with a matching file name was found, but the CultureInfo or the version did not match the one specified. - The assembly cannot be found. - The satellite assembly is not a valid assembly. - - - Gets the satellite assembly for the specified culture. - The specified culture. - The specified satellite assembly. - culture is null. - The assembly cannot be found. - The satellite assembly with a matching file name was found, but the CultureInfo did not match the one specified. - The satellite assembly is not a valid assembly. - - - Gets the object with the specified name in the assembly instance and optionally throws an exception if the type is not found. - The full name of the type. - true to throw an exception if the type is not found; false to return null. - An object that represents the specified class. - name is invalid. -or- The length of name exceeds 1024 characters. - name is null. - throwOnError is true, and the type cannot be found. - name requires a dependent assembly that could not be found. - name requires a dependent assembly that was found but could not be loaded. -or- The current assembly was loaded into the reflection-only context, and name requires a dependent assembly that was not preloaded. - name requires a dependent assembly, but the file is not a valid assembly. -or- name requires a dependent assembly which was compiled for a version of the runtime later than the currently loaded version. - - - Gets the object with the specified name in the assembly instance, with the options of ignoring the case, and of throwing an exception if the type is not found. - The full name of the type. - true to throw an exception if the type is not found; false to return null. - true to ignore the case of the type name; otherwise, false. - An object that represents the specified class. - name is invalid. -or- The length of name exceeds 1024 characters. - name is null. - throwOnError is true, and the type cannot be found. - name requires a dependent assembly that could not be found. - name requires a dependent assembly that was found but could not be loaded. -or- The current assembly was loaded into the reflection-only context, and name requires a dependent assembly that was not preloaded. - name requires a dependent assembly, but the file is not a valid assembly. -or- name requires a dependent assembly which was compiled for a version of the runtime later than the currently loaded version. - - - Gets the object with the specified name in the assembly instance. - The full name of the type. - An object that represents the specified class, or null if the class is not found. - name is invalid. - name is null. - name requires a dependent assembly that could not be found. -

-


In the .NET for Windows Store apps or the Portable Class Library, catch the base class exception, , instead.

-

- - name requires a dependent assembly that was found but could not be loaded.

-

-or-

-

The current assembly was loaded into the reflection-only context, and name requires a dependent assembly that was not preloaded.

-
- name requires a dependent assembly, but the file is not a valid assembly. -or- name requires a dependent assembly which was compiled for a version of the runtime later than the currently loaded version. -
- - Gets the types defined in this assembly. - An array that contains all the types that are defined in this assembly. - The assembly contains one or more types that cannot be loaded. The array returned by the property of this exception contains a object for each type that was loaded and null for each type that could not be loaded, while the property contains an exception for each type that could not be loaded. - - - Gets a value indicating whether the assembly was loaded from the global assembly cache. - true if the assembly was loaded from the global assembly cache; otherwise, false. - - - Gets the host context with which the assembly was loaded. - An value that indicates the host context with which the assembly was loaded, if any. - - - Gets a string representing the version of the common language runtime (CLR) saved in the file containing the manifest. - The CLR version folder name. This is not a full path. - - - Indicates whether or not a specified attribute has been applied to the assembly. - The type of the attribute to be checked for this assembly. - This argument is ignored for objects of this type. - true if the attribute has been applied to the assembly; otherwise, false. - attributeType is null. - attributeType uses an invalid type. - - - Gets a value that indicates whether the current assembly was generated dynamically in the current process by using reflection emit. - true if the current assembly was generated dynamically in the current process; otherwise, false. - - - Gets a value that indicates whether the current assembly is loaded with full trust. - true if the current assembly is loaded with full trust; otherwise, false. - - - Loads an assembly given its . - The object that describes the assembly to be loaded. - The loaded assembly. - assemblyRef is null. - assemblyRef is not found. - - In the [.NET for Windows Store apps](http://go.microsoft.com/fwlink/?LinkID=247912) or the [Portable Class Library](~/docs/standard/cross-platform/cross-platform-development-with-the-portable-class-library.md), catch the base class exception, , instead. - - A file that was found could not be loaded. - assemblyRef is not a valid assembly. -or- Version 2.0 or later of the common language runtime is currently loaded and assemblyRef was compiled with a later version. - - - Loads the assembly with a common object file format (COFF)-based image containing an emitted assembly. The assembly is loaded into the application domain of the caller. - A byte array that is a COFF-based image containing an emitted assembly. - The loaded assembly. - rawAssembly is null. - rawAssembly is not a valid assembly. -or- Version 2.0 or later of the common language runtime is currently loaded and rawAssembly was compiled with a later version. - - - Loads the assembly with a common object file format (COFF)-based image containing an emitted assembly, optionally including symbols for the assembly. The assembly is loaded into the application domain of the caller. - A byte array that is a COFF-based image containing an emitted assembly. - A byte array that contains the raw bytes representing the symbols for the assembly. - The loaded assembly. - rawAssembly is null. - rawAssembly is not a valid assembly. -or- Version 2.0 or later of the common language runtime is currently loaded and rawAssembly was compiled with a later version. - - - Loads an assembly given the long form of its name. - The long form of the assembly name. - The loaded assembly. - assemblyString is null. - assemblyString is a zero-length string. - assemblyString is not found. - A file that was found could not be loaded. - assemblyString is not a valid assembly. -or- Version 2.0 or later of the common language runtime is currently loaded and assemblyString was compiled with a later version. - - - Loads the contents of an assembly file on the specified path. - The fully qualified path of the file to load. - The loaded assembly. - The path argument is not an absolute path. - The path parameter is null. - A file that was found could not be loaded. - The path parameter is an empty string ("") or does not exist. - path is not a valid assembly. -or- Version 2.0 or later of the common language runtime is currently loaded and path was compiled with a later version. - - - Loads an assembly given its file name or path, hash value, and hash algorithm. - The name or path of the file that contains the manifest of the assembly. - The value of the computed hash code. - The hash algorithm used for hashing files and for generating the strong name. - The loaded assembly. - assemblyFile is null. - assemblyFile is not found, or the module you are trying to load does not specify a file name extension. - A file that was found could not be loaded. - assemblyFile is not a valid assembly; for example, a 32-bit assembly in a 64-bit process. See the exception topic for more information. -or- assemblyFile was compiled with a later version of the common language runtime than the version that is currently loaded. - A codebase that does not start with "file://" was specified without the required . - The assemblyFile parameter is an empty string (""). - The assembly name is longer than MAX_PATH characters. - - - Loads an assembly given its file name or path. - The name or path of the file that contains the manifest of the assembly. - The loaded assembly. - assemblyFile is null. - assemblyFile is not found, or the module you are trying to load does not specify a filename extension. - A file that was found could not be loaded. - assemblyFile is not a valid assembly; for example, a 32-bit assembly in a 64-bit process. See the exception topic for more information. -or- Version 2.0 or later of the common language runtime is currently loaded and assemblyFile was compiled with a later version. - A codebase that does not start with "file://" was specified without the required . - The assemblyFile parameter is an empty string (""). - The assembly name is longer than MAX_PATH characters. - - - Loads the module, internal to this assembly, with a common object file format (COFF)-based image containing an emitted module, or a resource file. - The name of the module. This string must correspond to a file name in this assembly's manifest. - A byte array that is a COFF-based image containing an emitted module, or a resource. - The loaded module. - moduleName or rawModule is null. - moduleName does not match a file entry in this assembly's manifest. - rawModule is not a valid module. - A file that was found could not be loaded. - - - Loads the module, internal to this assembly, with a common object file format (COFF)-based image containing an emitted module, or a resource file. The raw bytes representing the symbols for the module are also loaded. - The name of the module. This string must correspond to a file name in this assembly's manifest. - A byte array that is a COFF-based image containing an emitted module, or a resource. - A byte array containing the raw bytes representing the symbols for the module. Must be null if this is a resource file. - The loaded module. - moduleName or rawModule is null. - moduleName does not match a file entry in this assembly's manifest. - rawModule is not a valid module. - A file that was found could not be loaded. - - - Loads an assembly from the application directory or from the global assembly cache using a partial name. - The display name of the assembly. - The loaded assembly. If partialName is not found, this method returns null. - The partialName parameter is null. - assemblyFile is not a valid assembly. -or- Version 2.0 or later of the common language runtime is currently loaded and partialName was compiled with a later version. - - - Gets the full path or UNC location of the loaded file that contains the manifest. - The location of the loaded file that contains the manifest. If the loaded file was shadow-copied, the location is that of the file after being shadow-copied. If the assembly is loaded from a byte array, such as when using the method overload, the value returned is an empty string (""). - The current assembly is a dynamic assembly, represented by an object. - - - Gets the module that contains the manifest for the current assembly. - The module that contains the manifest for the assembly. - - - Occurs when the common language runtime class loader cannot resolve a reference to an internal module of an assembly through normal means. - - - - Gets a collection that contains the modules in this assembly. - A collection that contains the modules in this assembly. - - - Indicates whether two objects are equal. - The assembly to compare to right. - The assembly to compare to left. - true if left is equal to right; otherwise, false. - - - Indicates whether two objects are not equal. - The assembly to compare to right. - The assembly to compare to left. - true if left is not equal to right; otherwise, false. - - - Gets a value indicating whether this assembly was loaded into the reflection-only context. - true if the assembly was loaded into the reflection-only context, rather than the execution context; otherwise, false. - - - Loads the assembly from a common object file format (COFF)-based image containing an emitted assembly. The assembly is loaded into the reflection-only context of the caller's application domain. - A byte array that is a COFF-based image containing an emitted assembly. - The loaded assembly. - rawAssembly is null. - rawAssembly is not a valid assembly. -or- Version 2.0 or later of the common language runtime is currently loaded and rawAssembly was compiled with a later version. - rawAssembly cannot be loaded. - - - Loads an assembly into the reflection-only context, given its display name. - The display name of the assembly, as returned by the property. - The loaded assembly. - assemblyString is null. - assemblyString is an empty string (""). - assemblyString is not found. - assemblyString is found, but cannot be loaded. - assemblyString is not a valid assembly. -or- Version 2.0 or later of the common language runtime is currently loaded and assemblyString was compiled with a later version. - - - Loads an assembly into the reflection-only context, given its path. - The path of the file that contains the manifest of the assembly. - The loaded assembly. - assemblyFile is null. - assemblyFile is not found, or the module you are trying to load does not specify a file name extension. - assemblyFile is found, but could not be loaded. - assemblyFile is not a valid assembly. -or- Version 2.0 or later of the common language runtime is currently loaded and assemblyFile was compiled with a later version. - A codebase that does not start with "file://" was specified without the required . - The assembly name is longer than MAX_PATH characters. - assemblyFile is an empty string (""). - - - Gets a value that indicates which set of security rules the common language runtime (CLR) enforces for this assembly. - The security rule set that the CLR enforces for this assembly. - - - Returns the full name of the assembly, also known as the display name. - The full name of the assembly, or the class name if the full name of the assembly cannot be determined. - - - Loads an assembly into the load-from context, bypassing some security checks. - The name or path of the file that contains the manifest of the assembly. - The loaded assembly. - assemblyFile is null. - assemblyFile is not found, or the module you are trying to load does not specify a filename extension. - A file that was found could not be loaded. - assemblyFile is not a valid assembly. -or- assemblyFile was compiled with a later version of the common language runtime than the version that is currently loaded. - A codebase that does not start with "file://" was specified without the required . - The assemblyFile parameter is an empty string (""). - The assembly name is longer than MAX_PATH characters. - - - Specifies an algorithm to hash all files in an assembly. This class cannot be inherited. - - - Initializes a new instance of the class with the specified hash algorithm, using one of the members of to represent the hash algorithm. - A member of AssemblyHashAlgorithm that represents the hash algorithm. - - - Initializes a new instance of the class with the specified hash algorithm, using an unsigned integer to represent the hash algorithm. - An unsigned integer representing the hash algorithm. - - - Gets the hash algorithm of an assembly manifest's contents. - An unsigned integer representing the assembly hash algorithm. - - - Defines a company name custom attribute for an assembly manifest. - - - Initializes a new instance of the class. - The company name information. - - - Gets company name information. - A string containing the company name. - - - Specifies the build configuration, such as retail or debug, for an assembly. - - - Initializes a new instance of the class. - The assembly configuration. - - - Gets assembly configuration information. - A string containing the assembly configuration information. - - - Provides information about the type of code contained in an assembly. - - - The assembly contains .NET Framework code. - - - - The assembly contains Windows Runtime code. - - - - Defines a copyright custom attribute for an assembly manifest. - - - Initializes a new instance of the class. - The copyright information. - - - Gets copyright information. - A string containing the copyright information. - - - Specifies which culture the assembly supports. - - - Initializes a new instance of the class with the culture supported by the assembly being attributed. - The culture supported by the attributed assembly. - - - Gets the supported culture of the attributed assembly. - A string containing the name of the supported culture. - - - Defines a friendly default alias for an assembly manifest. - - - Initializes a new instance of the class. - The assembly default alias information. - - - Gets default alias information. - A string containing the default alias information. - - - Specifies that the assembly is not fully signed when created. - - - Initializes a new instance of the class. - true if the feature this attribute represents is activated; otherwise, false. - - - Gets a value indicating the state of the attribute. - true if this assembly has been built as delay-signed; otherwise, false. - - - Provides a text description for an assembly. - - - Initializes a new instance of the class. - The assembly description. - - - Gets assembly description information. - A string containing the assembly description. - - - Instructs a compiler to use a specific version number for the Win32 file version resource. The Win32 file version is not required to be the same as the assembly's version number. - - - Initializes a new instance of the class, specifying the file version. - The file version. - version is null. - - - Gets the Win32 file version resource name. - A string containing the file version resource name. - - - Specifies a bitwise combination of flags for an assembly, describing just-in-time (JIT) compiler options, whether the assembly is retargetable, and whether it has a full or tokenized public key. This class cannot be inherited. - - - Initializes a new instance of the class with the specified combination of flags, cast as an integer value. - A bitwise combination of flags, cast as an integer value, representing just-in-time (JIT) compiler options, longevity, whether an assembly is retargetable, and whether it has a full or tokenized public key. - - - Initializes a new instance of the class with the specified combination of flags. - A bitwise combination of flags representing just-in-time (JIT) compiler options, longevity, whether an assembly is retargetable, and whether it has a full or tokenized public key. - - - Initializes a new instance of the class with the specified combination of flags, cast as an unsigned integer value. - A bitwise combination of flags, cast as an unsigned integer value, representing just-in-time (JIT) compiler options, longevity, whether an assembly is retargetable, and whether it has a full or tokenized public key. - - - Gets an integer value representing the combination of flags specified when this attribute instance was created. - An integer value representing a bitwise combination of flags. - - - Gets an unsigned integer value representing the combination of flags specified when this attribute instance was created. - An unsigned integer value representing a bitwise combination of flags. - - - Defines additional version information for an assembly manifest. - - - Initializes a new instance of the class. - The assembly version information. - - - Gets version information. - A string containing the version information. - - - Specifies the name of a file containing the key pair used to generate a strong name. - - - Initializes a new instance of the AssemblyKeyFileAttribute class with the name of the file containing the key pair to generate a strong name for the assembly being attributed. - The name of the file containing the key pair. - - - Gets the name of the file containing the key pair used to generate a strong name for the attributed assembly. - A string containing the name of the file that contains the key pair. - - - Specifies the name of a key container within the CSP containing the key pair used to generate a strong name. - - - Initializes a new instance of the class with the name of the container holding the key pair used to generate a strong name for the assembly being attributed. - The name of the container containing the key pair. - - - Gets the name of the container having the key pair that is used to generate a strong name for the attributed assembly. - A string containing the name of the container that has the relevant key pair. - - - Defines a key/value metadata pair for the decorated assembly. - - - Initializes a new instance of the class by using the specified metadata key and value. - The metadata key. - The metadata value. - - - Gets the metadata key. - The metadata key. - - - Gets the metadata value. - The metadata value. - - - Describes an assembly's unique identity in full. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with the specified display name. - The display name of the assembly, as returned by the property. - assemblyName is null. - assemblyName is a zero length string. - - In the [.NET for Windows Store apps](http://go.microsoft.com/fwlink/?LinkID=247912) or the [Portable Class Library](~/docs/standard/cross-platform/cross-platform-development-with-the-portable-class-library.md), catch the base class exception, , instead. - - The referenced assembly could not be found, or could not be loaded. - - - Makes a copy of this object. - An object that is a copy of this object. - - - Gets or sets the location of the assembly as a URL. - A string that is the URL location of the assembly. - - - Gets or sets a value that indicates what type of content the assembly contains. - A value that indicates what type of content the assembly contains. - - - Gets or sets the culture supported by the assembly. - An object that represents the culture supported by the assembly. - - - Gets or sets the name of the culture associated with the assembly. - The culture name. - - - Gets the URI, including escape characters, that represents the codebase. - A URI with escape characters. - - - Gets or sets the attributes of the assembly. - A value that represents the attributes of the assembly. - - - Gets the full name of the assembly, also known as the display name. - A string that is the full name of the assembly, also known as the display name. - - - Gets the for a given file. - The path for the assembly whose is to be returned. - An object that represents the given assembly file. - assemblyFile is null. - assemblyFile is invalid, such as an assembly with an invalid culture. - assemblyFile is not found. - The caller does not have path discovery permission. - assemblyFile is not a valid assembly. - An assembly or module was loaded twice with two different sets of evidence. - - - Gets serialization information with all the data needed to recreate an instance of this AssemblyName. - The object to be populated with serialization information. - The destination context of the serialization. - info is null. - - - Gets the public key of the assembly. - A byte array that contains the public key of the assembly. - A public key was provided (for example, by using the method), but no public key token was provided. - - - Gets the public key token, which is the last 8 bytes of the SHA-1 hash of the public key under which the application or assembly is signed. - A byte array that contains the public key token. - - - Gets or sets the hash algorithm used by the assembly manifest. - The hash algorithm used by the assembly manifest. - - - Gets or sets the public and private cryptographic key pair that is used to create a strong name signature for the assembly. - The public and private cryptographic key pair to be used to create a strong name for the assembly. - - - Gets or sets the simple name of the assembly. This is usually, but not necessarily, the file name of the manifest file of the assembly, minus its extension. - The simple name of the assembly. - - - Implements the interface and is called back by the deserialization event when deserialization is complete. - The source of the deserialization event. - - - Gets or sets a value that identifies the processor and bits-per-word of the platform targeted by an executable. - One of the enumeration values that identifies the processor and bits-per-word of the platform targeted by an executable. - - - Returns a value indicating whether two assembly names are the same. The comparison is based on the simple assembly names. - The reference assembly name. - The assembly name that is compared to the reference assembly. - true if the simple assembly names are the same; otherwise, false. - - - Sets the public key identifying the assembly. - A byte array containing the public key of the assembly. - - - Sets the public key token, which is the last 8 bytes of the SHA-1 hash of the public key under which the application or assembly is signed. - A byte array containing the public key token of the assembly. - - - Returns the full name of the assembly, also known as the display name. - The full name of the assembly, or the class name if the full name cannot be determined. - - - Gets or sets the major, minor, build, and revision numbers of the assembly. - An object that represents the major, minor, build, and revision numbers of the assembly. - - - Gets or sets the information related to the assembly's compatibility with other assemblies. - A value that represents information about the assembly's compatibility with other assemblies. - - - Provides information about an reference. - - - Specifies that just-in-time (JIT) compiler optimization is disabled for the assembly. This is the exact opposite of the meaning that is suggested by the member name. - - - - Specifies that just-in-time (JIT) compiler tracking is enabled for the assembly. - - - - Specifies that no flags are in effect. - - - - Specifies that a public key is formed from the full public key rather than the public key token. - - - - Specifies that the assembly can be retargeted at runtime to an assembly from a different publisher. This value supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - - Provides a remotable version of the AssemblyName. - - - Initializes a new instance of the class. - - - Gets the AssemblyName for a given file. - The assembly file for which to get the AssemblyName. - An AssemblyName object representing the given file. - assemblyFile is null. - assemblyFile is empty. - assemblyFile is not found. - The caller does not have the required permission. - assemblyFile is not a valid assembly. - - - Defines a product name custom attribute for an assembly manifest. - - - Initializes a new instance of the class. - The product name information. - - - Gets product name information. - A string containing the product name. - - - Provides migration from an older, simpler strong name key to a larger key with a stronger hashing algorithm. - - - Creates a new instance of the class by using the specified public key and countersignature. - The public or identity key. - The countersignature, which is the signature key portion of the strong-name key. - - - Gets the countersignature for the strong name for this assembly. - The countersignature for this signature key. - - - Gets the public key for the strong name used to sign the assembly. - The public key for this assembly. - - - Specifies a description for an assembly. - - - Initializes a new instance of the class. - The assembly title. - - - Gets assembly title information. - The assembly title. - - - Defines a trademark custom attribute for an assembly manifest. - - - Initializes a new instance of the class. - The trademark information. - - - Gets trademark information. - A String containing trademark information. - - - Specifies the version of the assembly being attributed. - - - Initializes a new instance of the AssemblyVersionAttribute class with the version number of the assembly being attributed. - The version number of the attributed assembly. - - - Gets the version number of the attributed assembly. - A string containing the assembly version number. - - - Selects a member from a list of candidates, and performs type conversion from actual argument type to formal argument type. - - - Initializes a new instance of the class. - - - Selects a field from the given set of fields, based on the specified criteria. - A bitwise combination of values. - The set of fields that are candidates for matching. For example, when a object is used by , this parameter specifies the set of fields that reflection has determined to be possible matches, typically because they have the correct member name. The default implementation provided by changes the order of this array. - The field value used to locate a matching field. - An instance of that is used to control the coercion of data types, in binder implementations that coerce types. If culture is null, the for the current thread is used. Note For example, if a binder implementation allows coercion of string values to numeric types, this parameter is necessary to convert a String that represents 1000 to a Double value, because 1000 is represented differently by different cultures. The default binder does not do such string coercions. - The matching field. - For the default binder, bindingAttr includes , and match contains multiple fields that are equally good matches for value. For example, value contains a MyClass object that implements the IMyClass interface, and match contains a field of type MyClass and a field of type IMyClass. - For the default binder, bindingAttr includes , and match contains no fields that can accept value. - For the default binder, bindingAttr includes , and match is null or an empty array. -or- bindingAttr includes , and value is null. - - - Selects a method to invoke from the given set of methods, based on the supplied arguments. - A bitwise combination of values. - The set of methods that are candidates for matching. For example, when a object is used by , this parameter specifies the set of methods that reflection has determined to be possible matches, typically because they have the correct member name. The default implementation provided by changes the order of this array. - The arguments that are passed in. The binder can change the order of the arguments in this array; for example, the default binder changes the order of arguments if the names parameter is used to specify an order other than positional order. If a binder implementation coerces argument types, the types and values of the arguments can be changed as well. - An array of parameter modifiers that enable binding to work with parameter signatures in which the types have been modified. The default binder implementation does not use this parameter. - An instance of that is used to control the coercion of data types, in binder implementations that coerce types. If culture is null, the for the current thread is used. Note For example, if a binder implementation allows coercion of string values to numeric types, this parameter is necessary to convert a String that represents 1000 to a Double value, because 1000 is represented differently by different cultures. The default binder does not do such string coercions. - The parameter names, if parameter names are to be considered when matching, or null if arguments are to be treated as purely positional. For example, parameter names must be used if arguments are not supplied in positional order. - After the method returns, state contains a binder-provided object that keeps track of argument reordering. The binder creates this object, and the binder is the sole consumer of this object. If state is not null when BindToMethod returns, you must pass state to the method if you want to restore args to its original order, for example, so that you can retrieve the values of ref parameters (ByRef parameters in Visual Basic). - The matching method. - For the default binder, match contains multiple methods that are equally good matches for args. For example, args contains a MyClass object that implements the IMyClass interface, and match contains a method that takes MyClass and a method that takes IMyClass. - For the default binder, match contains no methods that can accept the arguments supplied in args. - For the default binder, match is null or an empty array. - - - Changes the type of the given Object to the given Type. - The object to change into a new Type. - The new Type that value will become. - An instance of that is used to control the coercion of data types. If culture is null, the for the current thread is used. Note For example, this parameter is necessary to convert a String that represents 1000 to a Double value, because 1000 is represented differently by different cultures. - An object that contains the given value as the new type. - - - Upon returning from , restores the args argument to what it was when it came from BindToMethod. - The actual arguments that are passed in. Both the types and values of the arguments can be changed. - A binder-provided object that keeps track of argument reordering. - - - Selects a method from the given set of methods, based on the argument type. - A bitwise combination of values. - The set of methods that are candidates for matching. For example, when a object is used by , this parameter specifies the set of methods that reflection has determined to be possible matches, typically because they have the correct member name. The default implementation provided by changes the order of this array. - The parameter types used to locate a matching method. - An array of parameter modifiers that enable binding to work with parameter signatures in which the types have been modified. - The matching method, if found; otherwise, null. - For the default binder, match contains multiple methods that are equally good matches for the parameter types described by types. For example, the array in types contains a object for MyClass and the array in match contains a method that takes a base class of MyClass and a method that takes an interface that MyClass implements. - For the default binder, match is null or an empty array. -or- An element of types derives from , but is not of type RuntimeType. - - - Selects a property from the given set of properties, based on the specified criteria. - A bitwise combination of values. - The set of properties that are candidates for matching. For example, when a object is used by , this parameter specifies the set of properties that reflection has determined to be possible matches, typically because they have the correct member name. The default implementation provided by changes the order of this array. - The return value the matching property must have. - The index types of the property being searched for. Used for index properties such as the indexer for a class. - An array of parameter modifiers that enable binding to work with parameter signatures in which the types have been modified. - The matching property. - For the default binder, match contains multiple properties that are equally good matches for returnType and indexes. - For the default binder, match is null or an empty array. - - - Specifies flags that control binding and the way in which the search for members and types is conducted by reflection. - - - Specifies that reflection should create an instance of the specified type. Calls the constructor that matches the given arguments. The supplied member name is ignored. If the type of lookup is not specified, (Instance | Public) will apply. It is not possible to call a type initializer. This flag is passed to an InvokeMember method to invoke a constructor. - - - - Specifies that only members declared at the level of the supplied type's hierarchy should be considered. Inherited members are not considered. - - - - Specifies that no binding flags are defined. - - - - Specifies that types of the supplied arguments must exactly match the types of the corresponding formal parameters. Reflection throws an exception if the caller supplies a non-null Binder object, since that implies that the caller is supplying BindToXXX implementations that will pick the appropriate method. - - - - Specifies that public and protected static members up the hierarchy should be returned. Private static members in inherited classes are not returned. Static members include fields, methods, events, and properties. Nested types are not returned. - - - - Specifies that the value of the specified field should be returned. This flag is passed to an InvokeMember method to get a field value. - - - - Specifies that the value of the specified property should be returned. This flag is passed to an InvokeMember method to invoke a property getter. - - - - Specifies that the case of the member name should not be considered when binding. - - - - Used in COM interop to specify that the return value of the member can be ignored. - - - - Specifies that instance members are to be included in the search. - - - - Specifies that a method is to be invoked. This must not be a constructor or a type initializer. This flag is passed to an InvokeMember method to invoke a method. - - - - Specifies that non-public members are to be included in the search. - - - - Returns the set of members whose parameter count matches the number of supplied arguments. This binding flag is used for methods with parameters that have default values and methods with variable arguments (varargs). This flag should only be used with . - - - - Specifies that public members are to be included in the search. - - - - Specifies that the PROPPUT member on a COM object should be invoked. PROPPUT specifies a property-setting function that uses a value. Use PutDispProperty if a property has both PROPPUT and PROPPUTREF and you need to distinguish which one is called. - - - - Specifies that the PROPPUTREF member on a COM object should be invoked. PROPPUTREF specifies a property-setting function that uses a reference instead of a value. Use PutRefDispProperty if a property has both PROPPUT and PROPPUTREF and you need to distinguish which one is called. - - - - Specifies that the value of the specified field should be set. This flag is passed to an InvokeMember method to set a field value. - - - - Specifies that the value of the specified property should be set. For COM properties, specifying this binding flag is equivalent to specifying PutDispProperty and PutRefDispProperty. This flag is passed to an InvokeMember method to invoke a property setter. - - - - Specifies that static members are to be included in the search. - - - - Not implemented. - - - - Defines the valid calling conventions for a method. - - - Specifies that either the Standard or the VarArgs calling convention may be used. - - - - Specifies that the signature is a function-pointer signature, representing a call to an instance or virtual method (not a static method). If ExplicitThis is set, HasThis must also be set. The first argument passed to the called method is still a this pointer, but the type of the first argument is now unknown. Therefore, a token that describes the type (or class) of the this pointer is explicitly stored into its metadata signature. - - - - Specifies an instance or virtual method (not a static method). At run-time, the called method is passed a pointer to the target object as its first argument (the this pointer). The signature stored in metadata does not include the type of this first argument, because the method is known and its owner class can be discovered from metadata. - - - - Specifies the default calling convention as determined by the common language runtime. Use this calling convention for static methods. For instance or virtual methods use HasThis. - - - - Specifies the calling convention for methods with variable arguments. - - - - Discovers the attributes of a class constructor and provides access to constructor metadata. - - - Initializes a new instance of the class. - - - Represents the name of the class constructor method as it is stored in metadata. This name is always ".ctor". This field is read-only. - - - - Returns a value that indicates whether this instance is equal to a specified object. - An object to compare with this instance, or null. - true if obj equals the type and value of this instance; otherwise, false. - - - Returns the hash code for this instance. - A 32-bit signed integer hash code. - - - Invokes the constructor reflected by the instance that has the specified parameters, providing default values for the parameters not commonly used. - An array of values that matches the number, order and type (under the constraints of the default binder) of the parameters for this constructor. If this constructor takes no parameters, then use either an array with zero elements or null, as in Object[] parameters = new Object[0]. Any object in this array that is not explicitly initialized with a value will contain the default value for that object type. For reference-type elements, this value is null. For value-type elements, this value is 0, 0.0, or false, depending on the specific element type. - An instance of the class associated with the constructor. - The class is abstract. -or- The constructor is a class initializer. - - In the [.NET for Windows Store apps](http://go.microsoft.com/fwlink/?LinkID=247912) or the [Portable Class Library](~/docs/standard/cross-platform/cross-platform-development-with-the-portable-class-library.md), catch the base class exception, , instead. - - The constructor is private or protected, and the caller lacks . - The parameters array does not contain values that match the types accepted by this constructor. - The invoked constructor throws an exception. - An incorrect number of parameters was passed. - Creation of , , and types is not supported. - The caller does not have the necessary code access permission. - - - When implemented in a derived class, invokes the constructor reflected by this ConstructorInfo with the specified arguments, under the constraints of the specified Binder. - One of the BindingFlags values that specifies the type of binding. - A Binder that defines a set of properties and enables the binding, coercion of argument types, and invocation of members using reflection. If binder is null, then Binder.DefaultBinding is used. - An array of type Object used to match the number, order and type of the parameters for this constructor, under the constraints of binder. If this constructor does not require parameters, pass an array with zero elements, as in Object[] parameters = new Object[0]. Any object in this array that is not explicitly initialized with a value will contain the default value for that object type. For reference-type elements, this value is null. For value-type elements, this value is 0, 0.0, or false, depending on the specific element type. - A used to govern the coercion of types. If this is null, the for the current thread is used. - An instance of the class associated with the constructor. - The parameters array does not contain values that match the types accepted by this constructor, under the constraints of the binder. - The invoked constructor throws an exception. - An incorrect number of parameters was passed. - Creation of , , and types is not supported. - The caller does not have the necessary code access permissions. - The class is abstract. -or- The constructor is a class initializer. - The constructor is private or protected, and the caller lacks . - - - Gets a value indicating that this member is a constructor. - A value indicating that this member is a constructor. - - - Indicates whether two objects are equal. - The first to compare. - The second to compare. - true if left is equal to right; otherwise false. - - - Indicates whether two objects are not equal. - The first to compare. - The second to compare. - true if left is not equal to right; otherwise false. - - - Represents the name of the type constructor method as it is stored in metadata. This name is always ".cctor". This property is read-only. - - - - Provides access to custom attribute data for assemblies, modules, types, members and parameters that are loaded into the reflection-only context. - - - Initializes a new instance of the class. - - - Gets the type of the attribute. - The type of the attribute. - - - Gets a object that represents the constructor that would have initialized the custom attribute. - An object that represents the constructor that would have initialized the custom attribute represented by the current instance of the class. - - - Gets the list of positional arguments specified for the attribute instance represented by the object. - A collection of structures that represent the positional arguments specified for the custom attribute instance. - - - Returns a value that indicates whether this instance is equal to a specified object. - An object to compare with this instance, or null. - true if obj is equal to the current instance; otherwise, false. - - - Returns a list of objects representing data about the attributes that have been applied to the target assembly. - The assembly whose custom attribute data is to be retrieved. - A list of objects that represent data about the attributes that have been applied to the target assembly. - target is null. - - - Returns a list of objects representing data about the attributes that have been applied to the target member. - The member whose attribute data is to be retrieved. - A list of objects that represent data about the attributes that have been applied to the target member. - target is null. - - - Returns a list of objects representing data about the attributes that have been applied to the target module. - The module whose custom attribute data is to be retrieved. - A list of objects that represent data about the attributes that have been applied to the target module. - target is null. - - - Returns a list of objects representing data about the attributes that have been applied to the target parameter. - The parameter whose attribute data is to be retrieved. - A list of objects that represent data about the attributes that have been applied to the target parameter. - target is null. - - - Serves as a hash function for a particular type. - A hash code for the current . - - - Gets the list of named arguments specified for the attribute instance represented by the object. - A collection of structures that represent the named arguments specified for the custom attribute instance. - - - Returns a string representation of the custom attribute. - A string value that represents the custom attribute. - - - Contains static methods for retrieving custom attributes. - - - Retrieves a custom attribute of a specified type that is applied to a specified assembly. - The assembly to inspect. - The type of attribute to search for. - A custom attribute that matches attributeType, or null if no such attribute is found. - element or attributeType is null. - attributeType is not derived from . - More than one of the requested attributes was found. - - - Retrieves a custom attribute of a specified type that is applied to a specified member. - The member to inspect. - The type of attribute to search for. - A custom attribute that matches attributeType, or null if no such attribute is found. - element or attributeType is null. - attributeType is not derived from . - element is not a constructor, method, property, event, type, or field. - More than one of the requested attributes was found. - A custom attribute type cannot be loaded. - - - Retrieves a custom attribute of a specified type that is applied to a specified module. - The module to inspect. - The type of attribute to search for. - A custom attribute that matches attributeType, or null if no such attribute is found. - element or attributeType is null. - attributeType is not derived from . - More than one of the requested attributes was found. - - - Retrieves a custom attribute of a specified type that is applied to a specified parameter. - The parameter to inspect. - The type of attribute to search for. - A custom attribute that matches attributeType, or null if no such attribute is found. - element or attributeType is null. - attributeType is not derived from . - More than one of the requested attributes was found. - A custom attribute type cannot be loaded. - - - Retrieves a custom attribute of a specified type that is applied to a specified member, and optionally inspects the ancestors of that member. - The member to inspect. - The type of attribute to search for. - true to inspect the ancestors of element; otherwise, false. - A custom attribute that matches attributeType, or null if no such attribute is found. - element or attributeType is null. - attributeType is not derived from . - element is not a constructor, method, property, event, type, or field. - More than one of the requested attributes was found. - A custom attribute type cannot be loaded. - - - Retrieves a custom attribute of a specified type that is applied to a specified parameter, and optionally inspects the ancestors of that parameter. - The parameter to inspect. - The type of attribute to search for. - true to inspect the ancestors of element; otherwise, false. - A custom attribute matching attributeType, or null if no such attribute is found. - element or attributeType is null. - attributeType is not derived from . - More than one of the requested attributes was found. - A custom attribute type cannot be loaded. - - - Retrieves a custom attribute of a specified type that is applied to a specified parameter, and optionally inspects the ancestors of that parameter. - The parameter to inspect. - true to inspect the ancestors of element; otherwise, false. - The type of attribute to search for. - A custom attribute that matches T, or null if no such attribute is found. - element is null. - element is not a constructor, method, property, event, type, or field. - More than one of the requested attributes was found. - A custom attribute type cannot be loaded. - - - Retrieves a custom attribute of a specified type that is applied to a specified member, and optionally inspects the ancestors of that member. - The member to inspect. - true to inspect the ancestors of element; otherwise, false. - The type of attribute to search for. - A custom attribute that matches T, or null if no such attribute is found. - element is null. - element is not a constructor, method, property, event, type, or field. - More than one of the requested attributes was found. - A custom attribute type cannot be loaded. - - - Retrieves a custom attribute of a specified type that is applied to a specified parameter. - The parameter to inspect. - The type of attribute to search for. - A custom attribute that matches T, or null if no such attribute is found. - element is null. - element is not a constructor, method, property, event, type, or field. - More than one of the requested attributes was found. - A custom attribute type cannot be loaded. - - - Retrieves a custom attribute of a specified type that is applied to a specified module. - The module to inspect. - The type of attribute to search for. - A custom attribute that matches T, or null if no such attribute is found. - element is null. - More than one of the requested attributes was found. - - - Retrieves a custom attribute of a specified type that is applied to a specified member. - The member to inspect. - The type of attribute to search for. - A custom attribute that matches T, or null if no such attribute is found. - element is null. - element is not a constructor, method, property, event, type, or field. - More than one of the requested attributes was found. - A custom attribute type cannot be loaded. - - - Retrieves a custom attribute of a specified type that is applied to a specified assembly. - The assembly to inspect. - The type of attribute to search for. - A custom attribute that matches T, or null if no such attribute is found. - element is null. - More than one of the requested attributes was found. - - - Retrieves a collection of custom attributes of a specified type that are applied to a specified parameter, and optionally inspects the ancestors of that parameter. - The parameter to inspect. - The type of attribute to search for. - true to inspect the ancestors of element; otherwise, false. - A collection of the custom attributes that are applied to element and that match attributeType, or an empty collection if no such attributes exist. - element or attributeType is null. - attributeType is not derived from . - element is not a constructor, method, property, event, type, or field. - A custom attribute type cannot be loaded. - - - Retrieves a collection of custom attributes of a specified type that are applied to a specified member, and optionally inspects the ancestors of that member. - The member to inspect. - The type of attribute to search for. - true to inspect the ancestors of element; otherwise, false. - A collection of the custom attributes that are applied to element and that match attributeType, or an empty collection if no such attributes exist. - element or attributeType is null. - attributeType is not derived from . - element is not a constructor, method, property, event, type, or field. - A custom attribute type cannot be loaded. - - - Retrieves a collection of custom attributes of a specified type that are applied to a specified parameter. - The parameter to inspect. - The type of attribute to search for. - A collection of the custom attributes that are applied to element and that match attributeType, or an empty collection if no such attributes exist. - element or attributeType is null. - attributeType is not derived from . - element is not a constructor, method, property, event, type, or field. - A custom attribute type cannot be loaded. - - - Retrieves a collection of custom attributes that are applied to a specified parameter, and optionally inspects the ancestors of that parameter. - The parameter to inspect. - true to inspect the ancestors of element; otherwise, false. - A collection of the custom attributes that are applied to element, or an empty collection if no such attributes exist. - element is null. - element is not a constructor, method, property, event, type, or field. - A custom attribute type cannot be loaded. - - - Retrieves a collection of custom attributes of a specified type that are applied to a specified module. - The module to inspect. - The type of attribute to search for. - A collection of the custom attributes that are applied to element and that match attributeType, or an empty collection if no such attributes exist. - element or attributeType is null. - attributeType is not derived from . - - - Retrieves a collection of custom attributes of a specified type that are applied to a specified member. - The member to inspect. - The type of attribute to search for. - A collection of the custom attributes that are applied to element and that match attributeType, or an empty collection if no such attributes exist. - element or attributeType is null. - attributeType is not derived from . - element is not a constructor, method, property, event, type, or field. - A custom attribute type cannot be loaded. - - - Retrieves a collection of custom attributes that are applied to a specified member, and optionally inspects the ancestors of that member. - The member to inspect. - true to inspect the ancestors of element; otherwise, false. - A collection of the custom attributes that are applied to element that match the specified criteria, or an empty collection if no such attributes exist. - element is null. - element is not a constructor, method, property, event, type, or field. - A custom attribute type cannot be loaded. - - - Retrieves a collection of custom attributes of a specified type that are applied to a specified assembly. - The assembly to inspect. - The type of attribute to search for. - A collection of the custom attributes that are applied to element and that match attributeType, or an empty collection if no such attributes exist. - element or attributeType is null. - attributeType is not derived from . - - - Retrieves a collection of custom attributes that are applied to a specified parameter. - The parameter to inspect. - A collection of the custom attributes that are applied to element, or an empty collection if no such attributes exist. - element is null. - element is not a constructor, method, property, event, type, or field. - A custom attribute type cannot be loaded. - - - Retrieves a collection of custom attributes that are applied to a specified module. - The module to inspect. - A collection of the custom attributes that are applied to element, or an empty collection if no such attributes exist. - element is null. - - - Retrieves a collection of custom attributes that are applied to a specified member. - The member to inspect. - A collection of the custom attributes that are applied to element, or an empty collection if no such attributes exist. - element is null. - element is not a constructor, method, property, event, type, or field. - A custom attribute type cannot be loaded. - - - Retrieves a collection of custom attributes that are applied to a specified assembly. - The assembly to inspect. - A collection of the custom attributes that are applied to element, or an empty collection if no such attributes exist. - element is null. - - - Retrieves a collection of custom attributes of a specified type that are applied to a specified parameter, and optionally inspects the ancestors of that parameter. - The parameter to inspect. - true to inspect the ancestors of element; otherwise, false. - The type of attribute to search for. - A collection of the custom attributes that are applied to element and that match T, or an empty collection if no such attributes exist. - element is null. - element is not a constructor, method, property, event, type, or field. - A custom attribute type cannot be loaded. - - - Retrieves a collection of custom attributes of a specified type that are applied to a specified member, and optionally inspects the ancestors of that member. - The member to inspect. - true to inspect the ancestors of element; otherwise, false. - The type of attribute to search for. - A collection of the custom attributes that are applied to element and that match T, or an empty collection if no such attributes exist. - element is null. - element is not a constructor, method, property, event, type, or field. - A custom attribute type cannot be loaded. - - - Retrieves a collection of custom attributes of a specified type that are applied to a specified parameter. - The parameter to inspect. - The type of attribute to search for. - A collection of the custom attributes that are applied to element and that match T, or an empty collection if no such attributes exist. - element is null. - element is not a constructor, method, property, event, type, or field. - A custom attribute type cannot be loaded. - - - Retrieves a collection of custom attributes of a specified type that are applied to a specified member. - The member to inspect. - The type of attribute to search for. - A collection of the custom attributes that are applied to element and that match T, or an empty collection if no such attributes exist. - element is null. - element is not a constructor, method, property, event, type, or field. - A custom attribute type cannot be loaded. - - - Retrieves a collection of custom attributes of a specified type that are applied to a specified assembly. - The assembly to inspect. - The type of attribute to search for. - A collection of the custom attributes that are applied to element and that match T, or an empty collection if no such attributes exist. - element is null. - - - Retrieves a collection of custom attributes of a specified type that are applied to a specified module. - The module to inspect. - The type of attribute to search for. - A collection of the custom attributes that are applied to element and that match T, or an empty collection if no such attributes exist. - element is null. - - - Indicates whether custom attributes of a specified type are applied to a specified member, and, optionally, applied to its ancestors. - The member to inspect. - The type of the attribute to search for. - true to inspect the ancestors of element; otherwise, false. - true if an attribute of the specified type is applied to element; otherwise, false. - element or attributeType is null. - attributeType is not derived from . - element is not a constructor, method, property, event, type, or field. - - - Indicates whether custom attributes of a specified type are applied to a specified assembly. - The assembly to inspect. - The type of the attribute to search for. - true if an attribute of the specified type is applied to element; otherwise, false. - element or attributeType is null. - attributeType is not derived from . - - - Indicates whether custom attributes of a specified type are applied to a specified member. - The member to inspect. - The type of attribute to search for. - true if an attribute of the specified type is applied to element; otherwise, false. - element or attributeType is null. - attributeType is not derived from . - element is not a constructor, method, property, event, type, or field. - - - Indicates whether custom attributes of a specified type are applied to a specified module. - The module to inspect. - The type of attribute to search for. - true if an attribute of the specified type is applied to element; otherwise, false. - element or attributeType is null. - attributeType is not derived from . - - - Indicates whether custom attributes of a specified type are applied to a specified parameter. - The parameter to inspect. - The type of attribute to search for. - true if an attribute of the specified type is applied to element; otherwise, false. - element or attributeType is null. - attributeType is not derived from . - - - Indicates whether custom attributes of a specified type are applied to a specified parameter, and, optionally, applied to its ancestors. - The parameter to inspect. - The type of attribute to search for. - true to inspect the ancestors of element; otherwise, false. - true if an attribute of the specified type is applied to element; otherwise, false. - element or attributeType is null. - attributeType is not derived from . - - - The exception that is thrown when the binary format of a custom attribute is invalid. - - - Initializes a new instance of the class with the default properties. - - - Initializes a new instance of the class with the specified message. - The message that indicates the reason this exception was thrown. - - - Initializes a new instance of the class with the specified serialization and context information. - The data for serializing or deserializing the custom attribute. - The source and destination for the custom attribute. - - - Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. - The error message that explains the reason for the exception. - The exception that is the cause of the current exception. If the inner parameter is not null, the current exception is raised in a catch block that handles the inner exception. - - - Represents a named argument of a custom attribute in the reflection-only context. - - - Initializes a new instance of the class, which represents the specified field or property of the custom attribute, and specifies the value of the field or property. - A field or property of the custom attribute. The new object represents this member and its value. - The value of the field or property of the custom attribute. - memberInfo is null. - memberInfo is not a field or property of the custom attribute. - - - Initializes a new instance of the class, which represents the specified field or property of the custom attribute, and specifies a object that describes the type and value of the field or property. - A field or property of the custom attribute. The new object represents this member and its value. - An object that describes the type and value of the field or property. - memberInfo is null. - - - Returns a value that indicates whether this instance is equal to a specified object. - An object to compare with this instance, or null. - true if obj equals the type and value of this instance; otherwise, false. - - - Returns the hash code for this instance. - A 32-bit signed integer hash code. - - - Gets a value that indicates whether the named argument is a field. - true if the named argument is a field; otherwise, false. - - - Gets the attribute member that would be used to set the named argument. - The attribute member that would be used to set the named argument. - - - Gets the name of the attribute member that would be used to set the named argument. - The name of the attribute member that would be used to set the named argument. - - - Tests whether two structures are equivalent. - The structure to the left of the equality operator. - The structure to the right of the equality operator. - true if the two structures are equal; otherwise, false. - - - Tests whether two structures are different. - The structure to the left of the inequality operator. - The structure to the right of the inequality operator. - true if the two structures are different; otherwise, false. - - - Returns a string that consists of the argument name, the equal sign, and a string representation of the argument value. - A string that consists of the argument name, the equal sign, and a string representation of the argument value. - - - Gets a structure that can be used to obtain the type and value of the current named argument. - A structure that can be used to obtain the type and value of the current named argument. - - - Represents an argument of a custom attribute in the reflection-only context, or an element of an array argument. - - - Initializes a new instance of the class with the specified value. - The value of the custom attribute argument. - value is null. - - - Initializes a new instance of the class with the specified type and value. - The type of the custom attribute argument. - The value of the custom attribute argument. - argumentType is null. - - - Gets the type of the argument or of the array argument element. - A object representing the type of the argument or of the array element. - - - Indicates whether this instance and a specified object are equal. - Another object to compare to. - true if obj and this instance are the same type and represent the same value; otherwise, false. - - - Returns the hash code for this instance. - A 32-bit signed integer that is the hash code for this instance. - - - Tests whether two structures are equivalent. - The structure to the left of the equality operator. - The structure to the right of the equality operator. - true if the two structures are equal; otherwise, false. - - - Tests whether two structures are different. - The structure to the left of the inequality operator. - The structure to the right of the inequality operator. - true if the two structures are different; otherwise, false. - - - Returns a string consisting of the argument name, the equal sign, and a string representation of the argument value. - A string consisting of the argument name, the equal sign, and a string representation of the argument value. - - - Gets the value of the argument for a simple argument or for an element of an array argument; gets a collection of values for an array argument. - An object that represents the value of the argument or element, or a generic of objects that represent the values of an array-type argument. - - - Defines the member of a type that is the default member used by . - - - Initializes a new instance of the class. - A String containing the name of the member to invoke. This may be a constructor, method, property, or field. A suitable invocation attribute must be specified when the member is invoked. The default member of a class can be specified by passing an empty String as the name of the member. The default member of a type is marked with the DefaultMemberAttribute custom attribute or marked in COM in the usual way. - - - Gets the name from the attribute. - A string representing the member name. - - - Describes how an instruction alters the flow of control. - - - Branch instruction. - - - - Break instruction. - - - - Call instruction. - - - - Conditional branch instruction. - - - - Provides information about a subsequent instruction. For example, the Unaligned instruction of Reflection.Emit.Opcodes has FlowControl.Meta and specifies that the subsequent pointer instruction might be unaligned. - - - - Normal flow of control. - - - - This enumerator value is reserved and should not be used. - - - - Return instruction. - - - - Exception throw instruction. - - - - Specifies the name of the property that accesses the attributed field. - - - Initializes a new instance of the AccessedThroughPropertyAttribute class with the name of the property used to access the attributed field. - The name of the property used to access the attributed field. - - - Gets the name of the property used to access the attributed field. - The name of the property used to access the attributed field. - - - Indicates whether a method is marked with either the Async or async modifier. - - - Initializes a new instance of the class. - The type object for the underlying state machine type that's used to implement a state machine method. - - - Represents a builder for asynchronous methods that returns a task and provides a parameter for the result. - The result to use to complete the task. - - - Schedules the state machine to proceed to the next action when the specified awaiter completes. - The awaiter. - The state machine. - The type of the awaiter. - The type of the state machine. - - - Schedules the state machine to proceed to the next action when the specified awaiter completes. This method can be called from partially trusted code. - The awaiter. - The state machine. - The type of the awaiter. - The type of the state machine. - - - Creates an instance of the class. - A new instance of the builder. - - - Marks the task as failed and binds the specified exception to the task. - The exception to bind to the task. - exception is null. - The task has already completed. - - - Marks the task as successfully completed. - The result to use to complete the task. - The task has already completed. - - - Associates the builder with the specified state machine. - The state machine instance to associate with the builder. - stateMachine is null. - The state machine was previously set. - - - Begins running the builder with the associated state machine. - The state machine instance, passed by reference. - The type of the state machine. - stateMachine is null. - - - Gets the task for this builder. - The task for this builder. - - - Represents a builder for asynchronous methods that return a task. - - - Schedules the state machine to proceed to the next action when the specified awaiter completes. - The awaiter. - The state machine. - The type of the awaiter. - The type of the state machine. - - - Schedules the state machine to proceed to the next action when the specified awaiter completes. This method can be called from partially trusted code. - The awaiter. - The state machine. - The type of the awaiter. - The type of the state machine. - - - Creates an instance of the class. - A new instance of the builder. - - - Marks the task as failed and binds the specified exception to the task. - The exception to bind to the task. - exception is null. - The task has already completed. -or- The builder is not initialized. - - - Marks the task as successfully completed. - The task has already completed. -or- The builder is not initialized. - - - Associates the builder with the specified state machine. - The state machine instance to associate with the builder. - stateMachine is null. - The state machine was previously set. - - - Begins running the builder with the associated state machine. - The state machine instance, passed by reference. - The type of the state machine. - stateMachine is null. - - - Gets the task for this builder. - The task for this builder. - The builder is not initialized. - - - Represents a builder for asynchronous methods that do not return a value. - - - Schedules the state machine to proceed to the next action when the specified awaiter completes. - The awaiter. - The state machine. - The type of the awaiter. - The type of the state machine. - - - Schedules the state machine to proceed to the next action when the specified awaiter completes. This method can be called from partially trusted code. - The awaiter. - The state machine. - The type of the awaiter. - The type of the state machine. - - - Creates an instance of the class. - A new instance of the builder. - - - Binds an exception to the method builder. - The exception to bind. - exception is null. - The builder is not initialized. - - - Marks the method builder as successfully completed. - The builder is not initialized. - - - Associates the builder with the specified state machine. - The state machine instance to associate with the builder. - stateMachine is null. - The state machine was previously set. - - - Begins running the builder with the associated state machine. - The state machine instance, passed by reference. - The type of the state machine. - stateMachine is null. - - - Indicates that a method should use the Cdecl calling convention. - - - Initializes a new instance of the class. - - - This calling convention is not supported in this version of the .NET Framework. - - - Initializes a new instance of the class. - - - Indicates that a method should use the StdCall calling convention. - - - Initializes a new instance of the class. - - - Indicates that a method should use the ThisCall calling convention. - - - Initializes a new instance of the class. - - - Allows you to obtain the full path of the source file that contains the caller. This is the file path at the time of compile. - - - Initializes a new instance of the class. - - - Allows you to obtain the line number in the source file at which the method is called. - - - Initializes a new instance of the class. - - - Allows you to obtain the method or property name of the caller to the method. - - - Initializes a new instance of the class. - - - Dynamic site type. - The delegate type. - - - Creates an instance of the dynamic call site, initialized with the binder responsible for the runtime binding of the dynamic operations at this call site. - The binder responsible for the runtime binding of the dynamic operations at this call site. - The new instance of dynamic call site. - - - The Level 0 cache - a delegate specialized based on the site history. - - - - The update delegate. Called when the dynamic site experiences cache miss. - The update delegate. - - - A dynamic call site base class. This type is used as a parameter type to the dynamic site targets. - - - Class responsible for binding dynamic operations on the dynamic site. - The object responsible for binding dynamic operations. - - - Creates a call site with the given delegate type and binder. - The call site delegate type. - The call site binder. - The new call site. - - - Class responsible for runtime binding of the dynamic operations on the dynamic call site. - - - Initializes a new instance of the class. - - - Performs the runtime binding of the dynamic operation on a set of arguments. - An array of arguments to the dynamic operation. - The array of instances that represent the parameters of the call site in the binding process. - A LabelTarget used to return the result of the dynamic binding. - An Expression that performs tests on the dynamic operation arguments, and performs the dynamic operation if the tests are valid. If the tests fail on subsequent occurrences of the dynamic operation, Bind will be called again to produce a new for the new argument types. - - - Provides low-level runtime binding support. Classes can override this and provide a direct delegate for the implementation of rule. This can enable saving rules to disk, having specialized rules available at runtime, or providing a different caching policy. - The CallSite the bind is being performed for. - The arguments for the binder. - The target type of the CallSite. - A new delegate which replaces the CallSite Target. - - - Adds a target to the cache of known targets. The cached targets will be scanned before calling BindDelegate to produce the new rule. - The target delegate to be added to the cache. - The type of target being added. - - - Gets a label that can be used to cause the binding to be updated. It indicates that the expression's binding is no longer valid. This is typically used when the "version" of a dynamic object has changed. - The object representing a label that can be used to trigger the binding update. - - - Class that contains helper methods for DLR CallSites. - - - Checks if a is internally used by DLR and should not be displayed on the language code's stack. - The input - True if the input is internally used by DLR and should not be displayed on the language code's stack. Otherwise, false. - - - Specifies parameters that control the strictness of the code generated by the common language runtime's just-in-time (JIT) compiler. - - - Marks an assembly as not requiring string-literal interning. - - - - Controls the strictness of the code generated by the common language runtime's just-in-time (JIT) compiler. - - - Initializes a new instance of the class with the specified compilation relaxations. - The compilation relaxations. - - - Initializes a new instance of the class with the specified value. - One of the values. - - - Gets the compilation relaxations specified when the current object was constructed. - The compilation relaxations specified when the current object was constructed. Use the enumeration with the property. - - - Distinguishes a compiler-generated element from a user-generated element. This class cannot be inherited. - - - Initializes a new instance of the class. - - - Indicates that a class should be treated as if it has global scope. - - - Initializes a new instance of the class. - - - Indicates that the modified instance of a variable differs from its true type when marshaling. This class cannot be inherited. - - - Represents a method that creates a non-default value to add as part of a key/value pair to a object. - The key that belongs to the value to create. - - - - - - Enables compilers to dynamically attach object fields to managed objects. - The reference type to which the field is attached. - The field's type. This must be a reference type. - - - Initializes a new instance of the class. - - - Adds a key to the table. - The key to add. key represents the object to which the property is attached. - The key's property value. - key is null. - key already exists. - - - Atomically searches for a specified key in the table and returns the corresponding value. If the key does not exist in the table, the method invokes the default constructor of the class that represents the table's value to create a value that is bound to the specified key. - The key to search for. key represents the object to which the property is attached. - The value that corresponds to key, if key already exists in the table; otherwise, a new value created by the default constructor of the class defined by the TValue generic type parameter. - key is null. - - In the [.NET for Windows Store apps](http://go.microsoft.com/fwlink/?LinkID=247912) or the [Portable Class Library](~/docs/standard/cross-platform/cross-platform-development-with-the-portable-class-library.md), catch the base class exception, , instead. - - The class that represents the table's value does not define a default constructor. - - - Atomically searches for a specified key in the table and returns the corresponding value. If the key does not exist in the table, the method invokes a callback method to create a value that is bound to the specified key. - The key to search for. key represents the object to which the property is attached. - A delegate to a method that can create a value for the given key. It has a single parameter of type TKey, and returns a value of type TValue. - The value attached to key, if key already exists in the table; otherwise, the new value returned by the createValueCallback delegate. - key or createValueCallback is null. - - - Removes a key and its value from the table. - The key to remove. - true if the key is found and removed; otherwise, false. - key is null. - - - Gets the value of the specified key. - The key that represents an object with an attached property. - When this method returns, contains the attached property value. If key is not found, value contains the default value. - true if key is found; otherwise, false. - key is null. - - - Provides an awaiter for an awaitable object(). - - - - Ends the await on the completed task. - The result of the completed task. - The awaiter was not properly initialized. - The task was canceled. - The task completed in a faulted state. - - - Gets a value that specifies whether the task being awaited has been completed. - true if the task being awaited has been completed; otherwise, false. - The awaiter was not properly initialized. - - - Schedules the continuation action for the task associated with this awaiter. - The action to invoke when the await operation completes. - The continuation argument is null. - The awaiter was not properly initialized. - - - Schedules the continuation action for the task associated with this awaiter. - The action to invoke when the await operation completes. - The continuation argument is null. - The awaiter was not properly initialized. - - - Provides an awaitable object that enables configured awaits on a task. - The type of the result produced by this . - - - Returns an awaiter for this awaitable object. - The awaiter. - - - Provides an awaiter for an awaitable () object. - - - Ends the await on the completed task. - The awaiter was not properly initialized. - The task was canceled. - The task completed in a faulted state. - - - Gets a value that specifies whether the task being awaited is completed. - true if the task being awaited is completed; otherwise, false. - The awaiter was not properly initialized. - - - Schedules the continuation action for the task associated with this awaiter. - The action to invoke when the await operation completes. - The continuation argument is null. - The awaiter was not properly initialized. - - - Schedules the continuation action for the task associated with this awaiter. - The action to invoke when the await operation completes. - The continuation argument is null. - The awaiter was not properly initialized. - - - Provides an awaitable object that enables configured awaits on a task. - - - Returns an awaiter for this awaitable object. - The awaiter. - - - Provides methods that the binary rewriter uses to handle contract failures. - - - Used by the binary rewriter to activate the default failure behavior. - One of the enumeration values that specifies the type of failure. - Additional user information. - The description of the condition that caused the failure. - The inner exception that caused the current exception. - A null reference (Nothing in Visual Basic) if the event was handled and should not trigger a failure; otherwise, returns the localized failure message. - failureKind is not a valid value. - - - Triggers the default failure behavior. - One of the enumeration values that specifies the type of failure. - The message to display. - Additional user information. - The description of the condition that caused the failure. - The inner exception that caused the current exception. - - - Defines a constant value that a compiler can persist for a field or method parameter. - - - Initializes a new instance of the class. - - - Gets the constant value stored by this attribute. - The constant value stored by this attribute. - - - Persists an 8-byte constant for a field or parameter. - - - Initializes a new instance of the DateTimeConstantAttribute class with the number of 100-nanosecond ticks that represent the date and time of this instance. - The number of 100-nanosecond ticks that represent the date and time of this instance. - - - Gets the number of 100-nanosecond ticks that represent the date and time of this instance. - The number of 100-nanosecond ticks that represent the date and time of this instance. - - - Generates debug information for lambda expressions in an expression tree. - - - Initializes a new instance of the class. - - - Creates a program database (PDB) symbol generator. - A PDB symbol generator. - - - Marks a sequence point in Microsoft intermediate language (MSIL) code. - The lambda expression that is generated. - The offset within MSIL code at which to mark the sequence point. - Debug information that corresponds to the sequence point. - - - Stores the value of a constant in metadata. This class cannot be inherited. - - - Initializes a new instance of the class with the specified signed integer values. - The power of 10 scaling factor that indicates the number of digits to the right of the decimal point. Valid values are 0 through 28 inclusive. - A value of 0 indicates a positive value, and a value of 1 indicates a negative value. - The high 32 bits of the 96-bit . - The middle 32 bits of the 96-bit . - The low 32 bits of the 96-bit . - - - Initializes a new instance of the class with the specified unsigned integer values. - The power of 10 scaling factor that indicates the number of digits to the right of the decimal point. Valid values are 0 through 28 inclusive. - A value of 0 indicates a positive value, and a value of 1 indicates a negative value. - The high 32 bits of the 96-bit . - The middle 32 bits of the 96-bit . - The low 32 bits of the 96-bit . - scale > 28. - - - Gets the decimal constant stored in this attribute. - The decimal constant stored in this attribute. - - - Provides a hint to the common language runtime (CLR) indicating how likely a dependency is to be loaded. This class is used in a dependent assembly to indicate what hint should be used when the parent does not specify the attribute. This class cannot be inherited. - - - Initializes a new instance of the class with the specified binding. - One of the values that indicates the default binding preference. - - - Gets the value that indicates when an assembly loads a dependency. - One of the values. - - - Indicates when a dependency is to be loaded by the referring assembly. This class cannot be inherited. - - - Initializes a new instance of the class with the specified value. - The dependent assembly to bind to. - One of the values. - - - Gets the value of the dependent assembly. - The name of the dependent assembly. - - - Gets the value that indicates when an assembly is to load a dependency. - One of the values. - - - Indicates that any private members contained in an assembly's types are not available to reflection. - - - Initializes a new instances of the class. - - - Marks a type definition as discardable. - - - Initializes a new instance of the class with default values. - - - Indicates that the use of on a member is meant to be treated as a dynamically dispatched type. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. - Specifies, in a prefix traversal of a type's construction, which occurrences are meant to be treated as a dynamically dispatched type. - - - Specifies, in a prefix traversal of a type's construction, which occurrences are meant to be treated as a dynamically dispatched type. - The list of occurrences that are meant to be treated as a dynamically dispatched type. - - - Indicates that a method is an extension method, or that a class or assembly contains extension methods. - - - Initializes a new instance of the class. - - - Fixes the address of a static value type field throughout its lifetime. This class cannot be inherited. - - - Initializes a new instance of the class. - - - Indicates that a field should be treated as containing a fixed number of elements of the specified primitive type. This class cannot be inherited. - - - Initializes a new instance of the class. - The type of the elements contained in the buffer. - The number of elements in the buffer. - - - Gets the type of the elements contained in the fixed buffer. - The type of the elements. - - - Gets the number of elements in the fixed buffer. - The number of elements in the fixed buffer. - - - Provides a static method to create a object from a composite format string and its arguments. - - - Creates a instance from a composite format string and its arguments. - A composite format string. - The arguments whose string representations are to be inserted in the result string. - The object that represents the composite format string and its arguments. - format is null. -or- arguments is null. - - - This class is not used in the .NET Framework version 2.0 and is reserved for future use. This class cannot be inherited. - - - Initializes a new instance of the class. - - - Represents state machines that are generated for asynchronous methods. This type is intended for compiler use only. - - - Moves the state machine to its next state. - - - Configures the state machine with a heap-allocated replica. - The heap-allocated replica. - - - Represents an awaiter that schedules continuations when an await operation completes. - - - Schedules the continuation action that's invoked when the instance completes. - The action to invoke when the operation completes. - The continuation argument is null (Nothing in Visual Basic). - - - Indicates the name by which an indexer is known in programming languages that do not support indexers directly. - - - Initializes a new instance of the class. - The name of the indexer, as shown to other languages. - - - Represents an operation that schedules continuations when it completes. - - - Schedules the continuation action that's invoked when the instance completes. - The action to invoke when the operation completes. - The continuation argument is null (Nothing in Visual Basic). - - - Defines methods implemented by permission types. - - - Creates and returns an identical copy of the current permission. - A copy of the current permission. - - - Throws a at run time if the security requirement is not met. - - - Creates and returns a permission that is the intersection of the current permission and the specified permission. - A permission to intersect with the current permission. It must be of the same type as the current permission. - A new permission that represents the intersection of the current permission and the specified permission. This new permission is null if the intersection is empty. - The target parameter is not null and is not an instance of the same class as the current permission. - - - Determines whether the current permission is a subset of the specified permission. - A permission that is to be tested for the subset relationship. This permission must be of the same type as the current permission. - true if the current permission is a subset of the specified permission; otherwise, false. - The target parameter is not null and is not of the same type as the current permission. - - - Creates a permission that is the union of the current permission and the specified permission. - A permission to combine with the current permission. It must be of the same type as the current permission. - A new permission that represents the union of the current permission and the specified permission. - The target parameter is not null and is not of the same type as the current permission. - - - Defines the methods that convert permission object state to and from XML element representation. - - - Reconstructs a security object with a specified state from an XML encoding. - The XML encoding to use to reconstruct the security object. - - - Creates an XML encoding of the security object and its current state. - An XML encoding of the security object, including any state information. - - - Specifies the default partial-trust visibility for code that is marked with the (APTCA) attribute. - - - The assembly has been audited for partial trust, but it is not visible to partial-trust code in all hosts. To make the assembly visible to partial-trust code, add it to the property. - - - - The assembly can always be called by partial-trust code. - - - - Specifies the base attribute class for code access security. - - - Initializes a new instance of with the specified . - One of the values. - - - The exception that is thrown when the execution stack overflows because it contains too many nested method calls. This class cannot be inherited. - - - Initializes a new instance of the class, setting the property of the new instance to a system-supplied message that describes the error, such as "The requested operation caused a stack overflow." This message takes into account the current system culture. - - - Initializes a new instance of the class with a specified error message. - A that describes the error. The content of message is intended to be understood by humans. The caller of this constructor is required to ensure that this string has been localized for the current system culture. - - - Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. - The error message that explains the reason for the exception. - The exception that is the cause of the current exception. If the innerException parameter is not a null reference (Nothing in Visual Basic), the current exception is raised in a catch block that handles the inner exception. - - - Indicates that the COM threading model for an application is single-threaded apartment (STA). - - - Initializes a new instance of the class. - - - Represents text as a sequence of UTF-16 code units. - - - Initializes a new instance of the class to the value indicated by a specified pointer to an array of Unicode characters. - A pointer to a null-terminated array of Unicode characters. - The current process does not have read access to all the addressed characters. - value specifies an array that contains an invalid Unicode character, or value specifies an address less than 64000. - - - Initializes a new instance of the class to the value indicated by an array of Unicode characters. - An array of Unicode characters. - - - Initializes a new instance of the class to the value indicated by a pointer to an array of 8-bit signed integers. - A pointer to a null-terminated array of 8-bit signed integers. The integers are interpreted using the current system code page encoding (that is, the encoding specified by ). - value is null. - A new instance of could not be initialized using value, assuming value is encoded in ANSI. - The length of the new string to initialize, which is determined by the null termination character of value, is too large to allocate. - value specifies an invalid address. - - - Initializes a new instance of the class to the value indicated by a specified Unicode character repeated a specified number of times. - A Unicode character. - The number of times c occurs. - count is less than zero. - - - Initializes a new instance of the class to the value indicated by a specified pointer to an array of Unicode characters, a starting character position within that array, and a length. - A pointer to an array of Unicode characters. - The starting position within value. - The number of characters within value to use. - startIndex or length is less than zero, value + startIndex cause a pointer overflow, or the current process does not have read access to all the addressed characters. - value specifies an array that contains an invalid Unicode character, or value + startIndex specifies an address less than 64000. - - - Initializes a new instance of the class to the value indicated by an array of Unicode characters, a starting character position within that array, and a length. - An array of Unicode characters. - The starting position within value. - The number of characters within value to use. - value is null. - startIndex or length is less than zero. -or- The sum of startIndex and length is greater than the number of elements in value. - - - Initializes a new instance of the class to the value indicated by a specified pointer to an array of 8-bit signed integers, a starting position within that array, and a length. - A pointer to an array of 8-bit signed integers. The integers are interpreted using the current system code page encoding (that is, the encoding specified by ). - The starting position within value. - The number of characters within value to use. - value is null. - startIndex or length is less than zero. -or- The address specified by value + startIndex is too large for the current platform; that is, the address calculation overflowed. -or- The length of the new string to initialize is too large to allocate. - The address specified by value + startIndex is less than 64K. -or- A new instance of could not be initialized using value, assuming value is encoded in ANSI. - value, startIndex, and length collectively specify an invalid address. - - - Initializes a new instance of the class to the value indicated by a specified pointer to an array of 8-bit signed integers, a starting position within that array, a length, and an object. - A pointer to an array of 8-bit signed integers. - The starting position within value. - The number of characters within value to use. - An object that specifies how the array referenced by value is encoded. If enc is null, ANSI encoding is assumed. - value is null. - startIndex or length is less than zero. -or- The address specified by value + startIndex is too large for the current platform; that is, the address calculation overflowed. -or- The length of the new string to initialize is too large to allocate. - The address specified by value + startIndex is less than 64K. -or- A new instance of could not be initialized using value, assuming value is encoded as specified by enc. - value, startIndex, and length collectively specify an invalid address. - - - Gets the object at a specified position in the current object. - A position in the current string. - The object at position index. - index is greater than or equal to the length of this object or less than zero. - - - Returns a reference to this instance of . - This instance of . - - - Compares substrings of two specified objects, ignoring or honoring their case and using culture-specific information to influence the comparison, and returns an integer that indicates their relative position in the sort order. - The first string to use in the comparison. - The position of the substring within strA. - The second string to use in the comparison. - The position of the substring within strB. - The maximum number of characters in the substrings to compare. - true to ignore case during the comparison; otherwise, false. - An object that supplies culture-specific comparison information. -

An integer that indicates the lexical relationship between the two comparands.

-
Value

-

Condition

-

Less than zero

-

The substring in strA precedes the substring in strB in the sort order.

-

Zero

-

The substrings occur in the same position in the sort order, or length is zero.

-

Greater than zero

-

The substring in strA follows the substring in strB in the sort order.

-

-
- indexA is greater than strA.. -or- indexB is greater than strB.. -or- indexA, indexB, or length is negative. -or- Either strA or strB is null, and length is greater than zero. - culture is null. -
- - Compares substrings of two specified objects using the specified rules, and returns an integer that indicates their relative position in the sort order. - The first string to use in the comparison. - The position of the substring within strA. - The second string to use in the comparison. - The position of the substring within strB. - The maximum number of characters in the substrings to compare. - One of the enumeration values that specifies the rules to use in the comparison. -

A 32-bit signed integer that indicates the lexical relationship between the two comparands.

-
Value

-

Condition

-

Less than zero

-

The substring in strA precedes the substring in strB in the sort order.

-

Zero

-

The substrings occur in the same position in the sort order, or the length parameter is zero.

-

Greater than zero

-

The substring in strA follllows the substring in strB in the sort order.

-

-
- indexA is greater than strA.. -or- indexB is greater than strB.. -or- indexA, indexB, or length is negative. -or- Either indexA or indexB is null, and length is greater than zero. - comparisonType is not a value. -
- - Compares substrings of two specified objects, ignoring or honoring their case, and returns an integer that indicates their relative position in the sort order. - The first string to use in the comparison. - The position of the substring within strA. - The second string to use in the comparison. - The position of the substring within strB. - The maximum number of characters in the substrings to compare. - true to ignore case during the comparison; otherwise, false. -

A 32-bit signed integer that indicates the lexical relationship between the two comparands.

-
Value

-

Condition

-

Less than zero

-

The substring in strA precedes the substring in strB in the sort order.

-

Zero

-

The substrings occur in the same position in the sort order, or length is zero.

-

Greater than zero

-

The substring in strA follows the substring in strB in the sort order.

-

-
- indexA is greater than strA.. -or- indexB is greater than strB.. -or- indexA, indexB, or length is negative. -or- Either indexA or indexB is null, and length is greater than zero. -
- - Compares substrings of two specified objects and returns an integer that indicates their relative position in the sort order. - The first string to use in the comparison. - The position of the substring within strA. - The second string to use in the comparison. - The position of the substring within strB. - The maximum number of characters in the substrings to compare. -

A 32-bit signed integer indicating the lexical relationship between the two comparands.

-
Value

-

Condition

-

Less than zero

-

The substring in strA precedes the substring in strB in the sort order.

-

Zero

-

The substrings occur in the same position in the sort order, or length is zero.

-

Greater than zero

-

The substring in strA follows the substring in strB in the sort order.

-

-
- indexA is greater than strA.. -or- indexB is greater than strB.. -or- indexA, indexB, or length is negative. -or- Either indexA or indexB is null, and length is greater than zero. -
- - Compares two specified objects and returns an integer that indicates their relative position in the sort order. - The first string to compare. - The second string to compare. -

A 32-bit signed integer that indicates the lexical relationship between the two comparands.

-
Value

-

Condition

-

Less than zero

-

strA precedes strB in the sort order.

-

Zero

-

strA occurs in the same position as strB in the sort order.

-

Greater than zero

-

strA follows strB in the sort order.

-

-
-
- - Compares two specified objects, ignoring or honoring their case, and using culture-specific information to influence the comparison, and returns an integer that indicates their relative position in the sort order. - The first string to compare. - The second string to compare. - true to ignore case during the comparison; otherwise, false. - An object that supplies culture-specific comparison information. -

A 32-bit signed integer that indicates the lexical relationship between the two comparands.

-
Value

-

Condition

-

Less than zero

-

strA precedes strB in the sort order.

-

Zero

-

strA occurs in the same position as strB in the sort order.

-

Greater than zero

-

strA follows strB in the sort order.

-

-
- culture is null. -
- - Compares two specified objects using the specified rules, and returns an integer that indicates their relative position in the sort order. - The first string to compare. - The second string to compare. - One of the enumeration values that specifies the rules to use in the comparison. -

A 32-bit signed integer that indicates the lexical relationship between the two comparands.

-
Value

-

Condition

-

Less than zero

-

strA precedes strB in the sort order.

-

Zero

-

strA is in the same position as strB in the sort order.

-

Greater than zero

-

strA follows strB in the sort order.

-

-
- comparisonType is not a value. - is not supported. -
- - Compares two specified objects, ignoring or honoring their case, and returns an integer that indicates their relative position in the sort order. - The first string to compare. - The second string to compare. - true to ignore case during the comparison; otherwise, false. -

A 32-bit signed integer that indicates the lexical relationship between the two comparands.

-
Value

-

Condition

-

Less than zero

-

strA precedes strB in the sort order.

-

Zero

-

strA occurs in the same position as strB in the sort order.

-

Greater than zero

-

strA follows strB in the sort order.

-

-
-
- - Compares substrings of two specified objects using the specified comparison options and culture-specific information to influence the comparison, and returns an integer that indicates the relationship of the two substrings to each other in the sort order. - The first string to use in the comparison. - The starting position of the substring within strA. - The second string to use in the comparison. - The starting position of the substring within strB. - The maximum number of characters in the substrings to compare. - An object that supplies culture-specific comparison information. - Options to use when performing the comparison (such as ignoring case or symbols). -

An integer that indicates the lexical relationship between the two substrings, as shown in the following table.

-
Value

-

Condition

-

Less than zero

-

The substring in strA precedes the substring in strB in the sort order.

-

Zero

-

The substrings occur in the same position in the sort order, or length is zero.

-

Greater than zero

-

The substring in strA follows the substring in strB in the sort order.

-

-
- options is not a value. - indexA is greater than strA.Length. -or- indexB is greater than strB.Length. -or- indexA, indexB, or length is negative. -or- Either strA or strB is null, and length is greater than zero. - culture is null. -
- - Compares two specified objects using the specified comparison options and culture-specific information to influence the comparison, and returns an integer that indicates the relationship of the two strings to each other in the sort order. - The first string to compare. - The second string to compare. - The culture that supplies culture-specific comparison information. - Options to use when performing the comparison (such as ignoring case or symbols). -

A 32-bit signed integer that indicates the lexical relationship between strA and strB, as shown in the following table

-
Value

-

Condition

-

Less than zero

-

strA precedes strB in the sort order.

-

Zero

-

strA occurs in the same position as strB in the sort order.

-

Greater than zero

-

strA follows strB in the sort order.

-

-
- options is not a value. - culture is null. -
- - Compares substrings of two specified objects by evaluating the numeric values of the corresponding objects in each substring. - The first string to use in the comparison. - The starting index of the substring in strA. - The second string to use in the comparison. - The starting index of the substring in strB. - The maximum number of characters in the substrings to compare. -

A 32-bit signed integer that indicates the lexical relationship between the two comparands.

-
Value

-

Condition

-

Less than zero

-

The substring in strA is less than the substring in strB.

-

Zero

-

The substrings are equal, or length is zero.

-

Greater than zero

-

The substring in strA is greater than the substring in strB.

-

-
- strA is not null and indexA is greater than strA.. -or- strB is not null and indexB is greater than strB.. -or- indexA, indexB, or length is negative. -
- - Compares two specified objects by evaluating the numeric values of the corresponding objects in each string. - The first string to compare. - The second string to compare. -

An integer that indicates the lexical relationship between the two comparands.

-
Value

-

Condition

-

Less than zero

-

strA is less than strB.

-

Zero

-

strA and strB are equal.

-

Greater than zero

-

strA is greater than strB.

-

-
-
- - Compares this instance with a specified and indicates whether this instance precedes, follows, or appears in the same position in the sort order as the specified . - An object that evaluates to a . -

A 32-bit signed integer that indicates whether this instance precedes, follows, or appears in the same position in the sort order as the value parameter.

-
Value

-

Condition

-

Less than zero

-

This instance precedes value.

-

Zero

-

This instance has the same position in the sort order as value.

-

Greater than zero

-

This instance follows value.

-

-or-

-

value is null.

-

-
- value is not a . -
- - Compares this instance with a specified object and indicates whether this instance precedes, follows, or appears in the same position in the sort order as the specified string. - The string to compare with this instance. -

A 32-bit signed integer that indicates whether this instance precedes, follows, or appears in the same position in the sort order as the strB parameter.

-
Value

-

Condition

-

Less than zero

-

This instance precedes strB.

-

Zero

-

This instance has the same position in the sort order as strB.

-

Greater than zero

-

This instance follows strB.

-

-or-

-

strB is null.

-

-
-
- - Concatenates four specified instances of . - The first string to concatenate. - The second string to concatenate. - The third string to concatenate. - The fourth string to concatenate. - The concatenation of str0, str1, str2, and str3. - - - Concatenates the string representations of four specified objects and any objects specified in an optional variable length parameter list. - The first object to concatenate. - The second object to concatenate. - The third object to concatenate. - The fourth object to concatenate. - The concatenated string representation of each value in the parameter list. - - - Concatenates the string representations of three specified objects. - The first object to concatenate. - The second object to concatenate. - The third object to concatenate. - The concatenated string representations of the values of arg0, arg1, and arg2. - - - Concatenates two specified instances of . - The first string to concatenate. - The second string to concatenate. - The concatenation of str0 and str1. - - - Concatenates three specified instances of . - The first string to concatenate. - The second string to concatenate. - The third string to concatenate. - The concatenation of str0, str1, and str2. - - - Concatenates the elements of a specified array. - An array of string instances. - The concatenated elements of values. - values is null. - Out of memory. - - - Concatenates the string representations of the elements in a specified array. - An object array that contains the elements to concatenate. - The concatenated string representations of the values of the elements in args. - args is null. - Out of memory. - - - Creates the string representation of a specified object. - The object to represent, or null. - The string representation of the value of arg0, or if arg0 is null. - - - Concatenates the members of a constructed collection of type . - A collection object that implements and whose generic type argument is . - The concatenated strings in values, or if values is an empty IEnumerable(Of String). - values is null. - - - Concatenates the string representations of two specified objects. - The first object to concatenate. - The second object to concatenate. - The concatenated string representations of the values of arg0 and arg1. - - - Concatenates the members of an implementation. - A collection object that implements the interface. - The type of the members of values. - The concatenated members in values. - values is null. - - - Returns a value indicating whether a specified substring occurs within this string. - The string to seek. - true if the value parameter occurs within this string, or if value is the empty string (""); otherwise, false. - value is null. - - - Creates a new instance of with the same value as a specified . - The string to copy. - A new string with the same value as str. - str is null. - - - Copies a specified number of characters from a specified position in this instance to a specified position in an array of Unicode characters. - The index of the first character in this instance to copy. - An array of Unicode characters to which characters in this instance are copied. - The index in destination at which the copy operation begins. - The number of characters in this instance to copy to destination. - destination is null. - sourceIndex, destinationIndex, or count is negative -or- sourceIndex does not identify a position in the current instance. -or- destinationIndex does not identify a valid index in the destination array. -or- count is greater than the length of the substring from startIndex to the end of this instance -or- count is greater than the length of the subarray from destinationIndex to the end of the destination array. - - - Represents the empty string. This field is read-only. - - - - Determines whether the end of this string instance matches the specified string when compared using the specified culture. - The string to compare to the substring at the end of this instance. - true to ignore case during the comparison; otherwise, false. - Cultural information that determines how this instance and value are compared. If culture is null, the current culture is used. - true if the value parameter matches the end of this string; otherwise, false. - value is null. - - - Determines whether the end of this string instance matches the specified string when compared using the specified comparison option. - The string to compare to the substring at the end of this instance. - One of the enumeration values that determines how this string and value are compared. - true if the value parameter matches the end of this string; otherwise, false. - value is null. - comparisonType is not a value. - - - Determines whether the end of this string instance matches the specified string. - The string to compare to the substring at the end of this instance. - true if value matches the end of this instance; otherwise, false. - value is null. - - - Determines whether this instance and a specified object, which must also be a object, have the same value. - The string to compare to this instance. - true if obj is a and its value is the same as this instance; otherwise, false. If obj is null, the method returns false. - - - Determines whether this instance and another specified object have the same value. - The string to compare to this instance. - true if the value of the value parameter is the same as the value of this instance; otherwise, false. If value is null, the method returns false. - - - Determines whether two specified objects have the same value. - The first string to compare, or null. - The second string to compare, or null. - true if the value of a is the same as the value of b; otherwise, false. If both a and b are null, the method returns true. - - - Determines whether this string and a specified object have the same value. A parameter specifies the culture, case, and sort rules used in the comparison. - The string to compare to this instance. - One of the enumeration values that specifies how the strings will be compared. - true if the value of the value parameter is the same as this string; otherwise, false. - comparisonType is not a value. - - - Determines whether two specified objects have the same value. A parameter specifies the culture, case, and sort rules used in the comparison. - The first string to compare, or null. - The second string to compare, or null. - One of the enumeration values that specifies the rules for the comparison. - true if the value of the a parameter is equal to the value of the b parameter; otherwise, false. - comparisonType is not a value. - - - Replaces the format items in a specified string with the string representation of three specified objects. An parameter supplies culture-specific formatting information. - An object that supplies culture-specific formatting information. - A composite format string. - The first object to format. - The second object to format. - The third object to format. - A copy of format in which the format items have been replaced by the string representations of arg0, arg1, and arg2. - format, arg0, arg1, or arg2 is null. - format is invalid. -or- The index of a format item is less than zero, or greater than or equal to three. - - - Replaces the format items in a specified string with the string representation of three specified objects. - A composite format string. - The first object to format. - The second object to format. - The third object to format. - A copy of format in which the format items have been replaced by the string representations of arg0, arg1, and arg2. - format is null. - format is invalid. -or- The index of a format item is less than zero, or greater than two. - - - Replaces the format items in a specified string with the string representation of two specified objects. A parameter supplies culture-specific formatting information. - An object that supplies culture-specific formatting information. - A composite format string. - The first object to format. - The second object to format. - A copy of format in which format items are replaced by the string representations of arg0 and arg1. - format, arg0, or arg1 is null. - format is invalid. -or- The index of a format item is less than zero, or greater than or equal to two. - - - Replaces the format items in a specified string with the string representation of two specified objects. - A composite format string. - The first object to format. - The second object to format. - A copy of format in which format items are replaced by the string representations of arg0 and arg1. - format is null. - format is invalid. -or- The index of a format item is not zero or one. - - - Replaces the format item or items in a specified string with the string representation of the corresponding object. A parameter supplies culture-specific formatting information. - An object that supplies culture-specific formatting information. - A composite format string. - The object to format. - A copy of format in which the format item or items have been replaced by the string representation of arg0. - format or arg0 is null. - format is invalid. -or- The index of a format item is less than zero, or greater than or equal to one. - - - Replaces the format item in a specified string with the string representation of a corresponding object in a specified array. - A composite format string. - An object array that contains zero or more objects to format. - A copy of format in which the format items have been replaced by the string representation of the corresponding objects in args. - format or args is null. - format is invalid. -or- The index of a format item is less than zero, or greater than or equal to the length of the args array. - - - Replaces one or more format items in a specified string with the string representation of a specified object. - A composite format string. - The object to format. - A copy of format in which any format items are replaced by the string representation of arg0. - format is null. - The format item in format is invalid. -or- The index of a format item is not zero. - - - Replaces the format items in a specified string with the string representations of corresponding objects in a specified array. A parameter supplies culture-specific formatting information. - An object that supplies culture-specific formatting information. - A composite format string. - An object array that contains zero or more objects to format. - A copy of format in which the format items have been replaced by the string representation of the corresponding objects in args. - format or args is null. - format is invalid. -or- The index of a format item is less than zero, or greater than or equal to the length of the args array. - - - Retrieves an object that can iterate through the individual characters in this string. - An enumerator object. - - - Returns the hash code for this string. - A 32-bit signed integer hash code. - - - Returns the for class . - The enumerated constant, . - - - Reports the zero-based index of the first occurrence of the specified string in this instance. The search starts at a specified character position and examines a specified number of character positions. - The string to seek. - The search starting position. - The number of character positions to examine. - The zero-based index position of value from the start of the current instance if that string is found, or -1 if it is not. If value is , the return value is startIndex. - value is null. - count or startIndex is negative. -or- startIndex is greater than the length of this string. -or- count is greater than the length of this string minus startIndex. - - - Reports the zero-based index of the first occurrence of the specified string in the current object. Parameters specify the starting search position in the current string, the number of characters in the current string to search, and the type of search to use for the specified string. - The string to seek. - The search starting position. - The number of character positions to examine. - One of the enumeration values that specifies the rules for the search. - The zero-based index position of the value parameter from the start of the current instance if that string is found, or -1 if it is not. If value is , the return value is startIndex. - value is null. - count or startIndex is negative. -or- startIndex is greater than the length of this instance. -or- count is greater than the length of this string minus startIndex. - comparisonType is not a valid value. - - - Reports the zero-based index of the first occurrence of the specified string in the current object. Parameters specify the starting search position in the current string and the type of search to use for the specified string. - The string to seek. - The search starting position. - One of the enumeration values that specifies the rules for the search. - The zero-based index position of the value parameter from the start of the current instance if that string is found, or -1 if it is not. If value is , the return value is startIndex. - value is null. - startIndex is less than 0 (zero) or greater than the length of this string. - comparisonType is not a valid value. - - - Reports the zero-based index of the first occurrence of the specified character in this instance. The search starts at a specified character position and examines a specified number of character positions. - A Unicode character to seek. - The search starting position. - The number of character positions to examine. - The zero-based index position of value from the start of the string if that character is found, or -1 if it is not. - count or startIndex is negative. -or- startIndex is greater than the length of this string. -or- count is greater than the length of this string minus startIndex. - - - Reports the zero-based index of the first occurrence of the specified string in this instance. - The string to seek. - The zero-based index position of value if that string is found, or -1 if it is not. If value is , the return value is 0. - value is null. - - - Reports the zero-based index of the first occurrence of the specified string in this instance. The search starts at a specified character position. - The string to seek. - The search starting position. - The zero-based index position of value from the start of the current instance if that string is found, or -1 if it is not. If value is , the return value is startIndex. - value is null. - startIndex is less than 0 (zero) or greater than the length of this string. - - - Reports the zero-based index of the first occurrence of the specified Unicode character in this string. The search starts at a specified character position. - A Unicode character to seek. - The search starting position. - The zero-based index position of value from the start of the string if that character is found, or -1 if it is not. - startIndex is less than 0 (zero) or greater than the length of the string. - - - Reports the zero-based index of the first occurrence of the specified string in the current object. A parameter specifies the type of search to use for the specified string. - The string to seek. - One of the enumeration values that specifies the rules for the search. - The index position of the value parameter if that string is found, or -1 if it is not. If value is , the return value is 0. - value is null. - comparisonType is not a valid value. - - - Reports the zero-based index of the first occurrence of the specified Unicode character in this string. - A Unicode character to seek. - The zero-based index position of value if that character is found, or -1 if it is not. - - - Reports the zero-based index of the first occurrence in this instance of any character in a specified array of Unicode characters. - A Unicode character array containing one or more characters to seek. - The zero-based index position of the first occurrence in this instance where any character in anyOf was found; -1 if no character in anyOf was found. - anyOf is null. - - - Reports the zero-based index of the first occurrence in this instance of any character in a specified array of Unicode characters. The search starts at a specified character position. - A Unicode character array containing one or more characters to seek. - The search starting position. - The zero-based index position of the first occurrence in this instance where any character in anyOf was found; -1 if no character in anyOf was found. - anyOf is null. - startIndex is negative. -or- startIndex is greater than the number of characters in this instance. - - - Reports the zero-based index of the first occurrence in this instance of any character in a specified array of Unicode characters. The search starts at a specified character position and examines a specified number of character positions. - A Unicode character array containing one or more characters to seek. - The search starting position. - The number of character positions to examine. - The zero-based index position of the first occurrence in this instance where any character in anyOf was found; -1 if no character in anyOf was found. - anyOf is null. - count or startIndex is negative. -or- count + startIndex is greater than the number of characters in this instance. - - - Returns a new string in which a specified string is inserted at a specified index position in this instance. - The zero-based index position of the insertion. - The string to insert. - A new string that is equivalent to this instance, but with value inserted at position startIndex. - value is null. - startIndex is negative or greater than the length of this instance. - - - Retrieves the system's reference to the specified . - A string to search for in the intern pool. - The system's reference to str, if it is interned; otherwise, a new reference to a string with the value of str. - str is null. - - - Retrieves a reference to a specified . - The string to search for in the intern pool. - A reference to str if it is in the common language runtime intern pool; otherwise, null. - str is null. - - - Indicates whether this string is in Unicode normalization form C. - true if this string is in normalization form C; otherwise, false. - The current instance contains invalid Unicode characters. - - - Indicates whether this string is in the specified Unicode normalization form. - A Unicode normalization form. - true if this string is in the normalization form specified by the normalizationForm parameter; otherwise, false. - The current instance contains invalid Unicode characters. - - - Indicates whether the specified string is null or an string. - The string to test. - true if the value parameter is null or an empty string (""); otherwise, false. - - - Indicates whether a specified string is null, empty, or consists only of white-space characters. - The string to test. - true if the value parameter is null or , or if value consists exclusively of white-space characters. - - - Concatenates the specified elements of a string array, using the specified separator between each element. - The string to use as a separator. separator is included in the returned string only if value has more than one element. - An array that contains the elements to concatenate. - The first element in value to use. - The number of elements of value to use. - A string that consists of the strings in value delimited by the separator string. -or- if count is zero, value has no elements, or separator and all the elements of value are . - value is null. - startIndex or count is less than 0. -or- startIndex plus count is greater than the number of elements in value. - Out of memory. - - - Concatenates all the elements of a string array, using the specified separator between each element. - The string to use as a separator. separator is included in the returned string only if value has more than one element. - An array that contains the elements to concatenate. - A string that consists of the elements in value delimited by the separator string. If value is an empty array, the method returns . - value is null. - - - Concatenates the elements of an object array, using the specified separator between each element. - The string to use as a separator. separator is included in the returned string only if values has more than one element. - An array that contains the elements to concatenate. - A string that consists of the elements of values delimited by the separator string. If values is an empty array, the method returns . - values is null. - - - Concatenates the members of a constructed collection of type , using the specified separator between each member. - The string to use as a separator.separator is included in the returned string only if values has more than one element. - A collection that contains the strings to concatenate. - A string that consists of the members of values delimited by the separator string. If values has no members, the method returns . - values is null. - - - Concatenates the members of a collection, using the specified separator between each member. - The string to use as a separator.separator is included in the returned string only if values has more than one element. - A collection that contains the objects to concatenate. - The type of the members of values. - A string that consists of the members of values delimited by the separator string. If values has no members, the method returns . - values is null. - - - Reports the zero-based index position of the last occurrence of a specified string within this instance. The search starts at a specified character position and proceeds backward toward the beginning of the string for the specified number of character positions. A parameter specifies the type of comparison to perform when searching for the specified string. - The string to seek. - The search starting position. The search proceeds from startIndex toward the beginning of this instance. - The number of character positions to examine. - One of the enumeration values that specifies the rules for the search. - The zero-based starting index position of the value parameter if that string is found, or -1 if it is not found or if the current instance equals . If value is , the return value is the smaller of startIndex and the last index position in this instance. - value is null. - count is negative. -or- The current instance does not equal , and startIndex is negative. -or- The current instance does not equal , and startIndex is greater than the length of this instance. -or- The current instance does not equal , and startIndex + 1 - count specifies a position that is not within this instance. -or- The current instance equals and start is less than -1 or greater than zero. -or- The current instance equals and count is greater than 1. - comparisonType is not a valid value. - - - Reports the zero-based index of the last occurrence of a specified string within the current object. The search starts at a specified character position and proceeds backward toward the beginning of the string. A parameter specifies the type of comparison to perform when searching for the specified string. - The string to seek. - The search starting position. The search proceeds from startIndex toward the beginning of this instance. - One of the enumeration values that specifies the rules for the search. - The zero-based starting index position of the value parameter if that string is found, or -1 if it is not found or if the current instance equals . If value is , the return value is the smaller of startIndex and the last index position in this instance. - value is null. - The current instance does not equal , and startIndex is less than zero or greater than the length of the current instance. -or- The current instance equals , and startIndex is less than -1 or greater than zero. - comparisonType is not a valid value. - - - Reports the zero-based index position of the last occurrence of the specified Unicode character in a substring within this instance. The search starts at a specified character position and proceeds backward toward the beginning of the string for a specified number of character positions. - The Unicode character to seek. - The starting position of the search. The search proceeds from startIndex toward the beginning of this instance. - The number of character positions to examine. - The zero-based index position of value if that character is found, or -1 if it is not found or if the current instance equals . - The current instance does not equal , and startIndex is less than zero or greater than or equal to the length of this instance. -or- The current instance does not equal , and startIndex - count + 1 is less than zero. - - - Reports the zero-based index of the last occurrence of a specified string within the current object. A parameter specifies the type of search to use for the specified string. - The string to seek. - One of the enumeration values that specifies the rules for the search. - The zero-based starting index position of the value parameter if that string is found, or -1 if it is not. If value is , the return value is the last index position in this instance. - value is null. - comparisonType is not a valid value. - - - Reports the zero-based index position of the last occurrence of a specified string within this instance. The search starts at a specified character position and proceeds backward toward the beginning of the string for a specified number of character positions. - The string to seek. - The search starting position. The search proceeds from startIndex toward the beginning of this instance. - The number of character positions to examine. - The zero-based starting index position of value if that string is found, or -1 if it is not found or if the current instance equals . If value is , the return value is the smaller of startIndex and the last index position in this instance. - value is null. - count is negative. -or- The current instance does not equal , and startIndex is negative. -or- The current instance does not equal , and startIndex is greater than the length of this instance. -or- The current instance does not equal , and startIndex - count+ 1 specifies a position that is not within this instance. -or- The current instance equals and start is less than -1 or greater than zero. -or- The current instance equals and count is greater than 1. - - - Reports the zero-based index position of the last occurrence of a specified Unicode character within this instance. The search starts at a specified character position and proceeds backward toward the beginning of the string. - The Unicode character to seek. - The starting position of the search. The search proceeds from startIndex toward the beginning of this instance. - The zero-based index position of value if that character is found, or -1 if it is not found or if the current instance equals . - The current instance does not equal , and startIndex is less than zero or greater than or equal to the length of this instance. - - - Reports the zero-based index position of the last occurrence of a specified string within this instance. - The string to seek. - The zero-based starting index position of value if that string is found, or -1 if it is not. If value is , the return value is the last index position in this instance. - value is null. - - - Reports the zero-based index position of the last occurrence of a specified Unicode character within this instance. - The Unicode character to seek. - The zero-based index position of value if that character is found, or -1 if it is not. - - - Reports the zero-based index position of the last occurrence of a specified string within this instance. The search starts at a specified character position and proceeds backward toward the beginning of the string. - The string to seek. - The search starting position. The search proceeds from startIndex toward the beginning of this instance. - The zero-based starting index position of value if that string is found, or -1 if it is not found or if the current instance equals . If value is , the return value is the smaller of startIndex and the last index position in this instance. - value is null. - The current instance does not equal , and startIndex is less than zero or greater than the length of the current instance. -or- The current instance equals , and startIndex is less than -1 or greater than zero. - - - Reports the zero-based index position of the last occurrence in this instance of one or more characters specified in a Unicode array. - A Unicode character array containing one or more characters to seek. - The index position of the last occurrence in this instance where any character in anyOf was found; -1 if no character in anyOf was found. - anyOf is null. - - - Reports the zero-based index position of the last occurrence in this instance of one or more characters specified in a Unicode array. The search starts at a specified character position and proceeds backward toward the beginning of the string. - A Unicode character array containing one or more characters to seek. - The search starting position. The search proceeds from startIndex toward the beginning of this instance. - The index position of the last occurrence in this instance where any character in anyOf was found; -1 if no character in anyOf was found or if the current instance equals . - anyOf is null. - The current instance does not equal , and startIndex specifies a position that is not within this instance. - - - Reports the zero-based index position of the last occurrence in this instance of one or more characters specified in a Unicode array. The search starts at a specified character position and proceeds backward toward the beginning of the string for a specified number of character positions. - A Unicode character array containing one or more characters to seek. - The search starting position. The search proceeds from startIndex toward the beginning of this instance. - The number of character positions to examine. - The index position of the last occurrence in this instance where any character in anyOf was found; -1 if no character in anyOf was found or if the current instance equals . - anyOf is null. - The current instance does not equal , and count or startIndex is negative. -or- The current instance does not equal , and startIndex minus count + 1 is less than zero. - - - Gets the number of characters in the current object. - The number of characters in the current string. - - - Returns a new string whose textual value is the same as this string, but whose binary representation is in the specified Unicode normalization form. - A Unicode normalization form. - A new string whose textual value is the same as this string, but whose binary representation is in the normalization form specified by the normalizationForm parameter. - The current instance contains invalid Unicode characters. - - - Returns a new string whose textual value is the same as this string, but whose binary representation is in Unicode normalization form C. - A new, normalized string whose textual value is the same as this string, but whose binary representation is in normalization form C. - The current instance contains invalid Unicode characters. - - - Determines whether two specified strings have the same value. - The first string to compare, or null. - The second string to compare, or null. - true if the value of a is the same as the value of b; otherwise, false. - - - Determines whether two specified strings have different values. - The first string to compare, or null. - The second string to compare, or null. - true if the value of a is different from the value of b; otherwise, false. - - - Returns a new string that right-aligns the characters in this instance by padding them with spaces on the left, for a specified total length. - The number of characters in the resulting string, equal to the number of original characters plus any additional padding characters. - A new string that is equivalent to this instance, but right-aligned and padded on the left with as many spaces as needed to create a length of totalWidth. However, if totalWidth is less than the length of this instance, the method returns a reference to the existing instance. If totalWidth is equal to the length of this instance, the method returns a new string that is identical to this instance. - totalWidth is less than zero. - - - Returns a new string that right-aligns the characters in this instance by padding them on the left with a specified Unicode character, for a specified total length. - The number of characters in the resulting string, equal to the number of original characters plus any additional padding characters. - A Unicode padding character. - A new string that is equivalent to this instance, but right-aligned and padded on the left with as many paddingChar characters as needed to create a length of totalWidth. However, if totalWidth is less than the length of this instance, the method returns a reference to the existing instance. If totalWidth is equal to the length of this instance, the method returns a new string that is identical to this instance. - totalWidth is less than zero. - - - Returns a new string that left-aligns the characters in this string by padding them with spaces on the right, for a specified total length. - The number of characters in the resulting string, equal to the number of original characters plus any additional padding characters. - A new string that is equivalent to this instance, but left-aligned and padded on the right with as many spaces as needed to create a length of totalWidth. However, if totalWidth is less than the length of this instance, the method returns a reference to the existing instance. If totalWidth is equal to the length of this instance, the method returns a new string that is identical to this instance. - totalWidth is less than zero. - - - Returns a new string that left-aligns the characters in this string by padding them on the right with a specified Unicode character, for a specified total length. - The number of characters in the resulting string, equal to the number of original characters plus any additional padding characters. - A Unicode padding character. - A new string that is equivalent to this instance, but left-aligned and padded on the right with as many paddingChar characters as needed to create a length of totalWidth. However, if totalWidth is less than the length of this instance, the method returns a reference to the existing instance. If totalWidth is equal to the length of this instance, the method returns a new string that is identical to this instance. - totalWidth is less than zero. - - - Returns a new string in which all the characters in the current instance, beginning at a specified position and continuing through the last position, have been deleted. - The zero-based position to begin deleting characters. - A new string that is equivalent to this string except for the removed characters. - startIndex is less than zero. -or- startIndex specifies a position that is not within this string. - - - Returns a new string in which a specified number of characters in the current instance beginning at a specified position have been deleted. - The zero-based position to begin deleting characters. - The number of characters to delete. - A new string that is equivalent to this instance except for the removed characters. - Either startIndex or count is less than zero. -or- startIndex plus count specify a position outside this instance. - - - Returns a new string in which all occurrences of a specified Unicode character in this instance are replaced with another specified Unicode character. - The Unicode character to be replaced. - The Unicode character to replace all occurrences of oldChar. - A string that is equivalent to this instance except that all instances of oldChar are replaced with newChar. If oldChar is not found in the current instance, the method returns the current instance unchanged. - - - Returns a new string in which all occurrences of a specified string in the current instance are replaced with another specified string. - The string to be replaced. - The string to replace all occurrences of oldValue. - A string that is equivalent to the current string except that all instances of oldValue are replaced with newValue. If oldValue is not found in the current instance, the method returns the current instance unchanged. - oldValue is null. - oldValue is the empty string (""). - - - Splits a string into a maximum number of substrings based on the strings in an array. You can specify whether the substrings include empty array elements. - A string array that delimits the substrings in this string, an empty array that contains no delimiters, or null. - The maximum number of substrings to return. - to omit empty array elements from the array returned; or to include empty array elements in the array returned. - An array whose elements contain the substrings in this string that are delimited by one or more strings in separator. For more information, see the Remarks section. - count is negative. - options is not one of the values. - - - Splits a string into a maximum number of substrings based on the characters in an array. - A character array that delimits the substrings in this string, an empty array that contains no delimiters, or null. - The maximum number of substrings to return. - to omit empty array elements from the array returned; or to include empty array elements in the array returned. - An array whose elements contain the substrings in this string that are delimited by one or more characters in separator. For more information, see the Remarks section. - count is negative. - options is not one of the values. - - - Splits a string into substrings based on the strings in an array. You can specify whether the substrings include empty array elements. - A string array that delimits the substrings in this string, an empty array that contains no delimiters, or null. - to omit empty array elements from the array returned; or to include empty array elements in the array returned. - An array whose elements contain the substrings in this string that are delimited by one or more strings in separator. For more information, see the Remarks section. - options is not one of the values. - - - Splits a string into substrings based on the characters in an array. You can specify whether the substrings include empty array elements. - A character array that delimits the substrings in this string, an empty array that contains no delimiters, or null. - to omit empty array elements from the array returned; or to include empty array elements in the array returned. - An array whose elements contain the substrings in this string that are delimited by one or more characters in separator. For more information, see the Remarks section. - options is not one of the values. - - - Splits a string into a maximum number of substrings based on the characters in an array. You also specify the maximum number of substrings to return. - A character array that delimits the substrings in this string, an empty array that contains no delimiters, or null. - The maximum number of substrings to return. - An array whose elements contain the substrings in this instance that are delimited by one or more characters in separator. For more information, see the Remarks section. - count is negative. - - - Splits a string into substrings that are based on the characters in an array. - A character array that delimits the substrings in this string, an empty array that contains no delimiters, or null. - An array whose elements contain the substrings from this instance that are delimited by one or more characters in separator. For more information, see the Remarks section. - - - Determines whether the beginning of this string instance matches the specified string when compared using the specified culture. - The string to compare. - true to ignore case during the comparison; otherwise, false. - Cultural information that determines how this string and value are compared. If culture is null, the current culture is used. - true if the value parameter matches the beginning of this string; otherwise, false. - value is null. - - - Determines whether the beginning of this string instance matches the specified string when compared using the specified comparison option. - The string to compare. - One of the enumeration values that determines how this string and value are compared. - true if this instance begins with value; otherwise, false. - value is null. - comparisonType is not a value. - - - Determines whether the beginning of this string instance matches the specified string. - The string to compare. - true if value matches the beginning of this string; otherwise, false. - value is null. - - - Retrieves a substring from this instance. The substring starts at a specified character position and continues to the end of the string. - The zero-based starting character position of a substring in this instance. - A string that is equivalent to the substring that begins at startIndex in this instance, or if startIndex is equal to the length of this instance. - startIndex is less than zero or greater than the length of this instance. - - - Retrieves a substring from this instance. The substring starts at a specified character position and has a specified length. - The zero-based starting character position of a substring in this instance. - The number of characters in the substring. - A string that is equivalent to the substring of length length that begins at startIndex in this instance, or if startIndex is equal to the length of this instance and length is zero. - startIndex plus length indicates a position not within this instance. -or- startIndex or length is less than zero. - - - Copies the characters in a specified substring in this instance to a Unicode character array. - The starting position of a substring in this instance. - The length of the substring in this instance. - A Unicode character array whose elements are the length number of characters in this instance starting from character position startIndex. - startIndex or length is less than zero. -or- startIndex plus length is greater than the length of this instance. - - - Copies the characters in this instance to a Unicode character array. - A Unicode character array whose elements are the individual characters of this instance. If this instance is an empty string, the returned array is empty and has a zero length. - - - Returns a copy of this string converted to lowercase. - A string in lowercase. - - - Returns a copy of this string converted to lowercase, using the casing rules of the specified culture. - An object that supplies culture-specific casing rules. - The lowercase equivalent of the current string. - culture is null. - - - Returns a copy of this object converted to lowercase using the casing rules of the invariant culture. - The lowercase equivalent of the current string. - - - Returns this instance of ; no actual conversion is performed. - The current string. - - - Returns this instance of ; no actual conversion is performed. - (Reserved) An object that supplies culture-specific formatting information. - The current string. - - - Returns a copy of this string converted to uppercase. - The uppercase equivalent of the current string. - - - Returns a copy of this string converted to uppercase, using the casing rules of the specified culture. - An object that supplies culture-specific casing rules. - The uppercase equivalent of the current string. - culture is null. - - - Returns a copy of this object converted to uppercase using the casing rules of the invariant culture. - The uppercase equivalent of the current string. - - - Removes all leading and trailing occurrences of a set of characters specified in an array from the current object. - An array of Unicode characters to remove, or null. - The string that remains after all occurrences of the characters in the trimChars parameter are removed from the start and end of the current string. If trimChars is null or an empty array, white-space characters are removed instead. If no characters can be trimmed from the current instance, the method returns the current instance unchanged. - - - Removes all leading and trailing white-space characters from the current object. - The string that remains after all white-space characters are removed from the start and end of the current string. If no characters can be trimmed from the current instance, the method returns the current instance unchanged. - - - Removes all trailing occurrences of a set of characters specified in an array from the current object. - An array of Unicode characters to remove, or null. - The string that remains after all occurrences of the characters in the trimChars parameter are removed from the end of the current string. If trimChars is null or an empty array, Unicode white-space characters are removed instead. If no characters can be trimmed from the current instance, the method returns the current instance unchanged. - - - Removes all leading occurrences of a set of characters specified in an array from the current object. - An array of Unicode characters to remove, or null. - The string that remains after all occurrences of characters in the trimChars parameter are removed from the start of the current string. If trimChars is null or an empty array, white-space characters are removed instead. - - - Returns an enumerator that iterates through the current object. - A strongly-typed enumerator that can be used to iterate through the current object. - - - Returns an enumerator that iterates through the current object. - An enumerator that can be used to iterate through the current string. - - - For a description of this member, see . - This parameter is ignored. - true if the value of the current string is ; false if the value of the current string is . - The value of the current string is not or . - - - For a description of this member, see . - An object that provides culture-specific formatting information. - The converted value of the current object. - The value of the current object cannot be parsed. - The value of the current object is a number greater than or less than . - - - For a description of this member, see . - An object that provides culture-specific formatting information. - The character at index 0 in the current object. - - - For a description of this member, see . - An object that provides culture-specific formatting information. - The converted value of the current object. - - - For a description of this member, see . - An object that provides culture-specific formatting information. - The converted value of the current object. - The value of the current object cannot be parsed. - The value of the current object is a number less than or than greater. - - - For a description of this member, see . - An object that provides culture-specific formatting information. - The converted value of the current object. - The value of the current object cannot be parsed. - The value of the current object is a number less than or greater than . - - - For a description of this member, see . - An object that provides culture-specific formatting information. - The converted value of the current object. - The value of the current object cannot be parsed. - The value of the current object is a number greater than or less than . - - - For a description of this member, see . - An object that provides culture-specific formatting information. - The converted value of the current object. - - - For a description of this member, see . - An object that provides culture-specific formatting information. - The converted value of the current object. - - - For a description of this member, see . - An object that provides culture-specific formatting information. - The converted value of the current object. - The value of the current object cannot be parsed. - The value of the current object is a number greater than or less than . - - - For a description of this member, see . - An object that provides culture-specific formatting information. - The converted value of the current object. - - - For a description of this member, see . - The type of the returned object. - An object that provides culture-specific formatting information. - The converted value of the current object. - type is null. - The value of the current object cannot be converted to the type specified by the type parameter. - - - For a description of this member, see . - An object that provides culture-specific formatting information. - The converted value of the current object. - The value of the current object cannot be parsed. - The value of the current object is a number greater than or less than . - - - For a description of this member, see . - An object that provides culture-specific formatting information. - The converted value of the current object. - The value of the current object cannot be parsed. - The value of the current object is a number greater or less than - - - For a description of this member, see . - An object that provides culture-specific formatting information. - The converted value of the current object. - - - Represents a string comparison operation that uses specific case and culture-based or ordinal comparison rules. - - - Initializes a new instance of the class. - - - When overridden in a derived class, compares two objects and returns an indication of their relative sort order. - An object to compare to y. - An object to compare to x. -

A signed integer that indicates the relative values of x and y, as shown in the following table.

-
Value

-

Meaning

-

Less than zero

-

x precedes y in the sort order.

-

-or-

-

x is null and y is not null.

-

Zero

-

x is equal to y.

-

-or-

-

x and y are both null.

-

Greater than zero

-

x follows y in the sort order.

-

-or-

-

y is null and x is not null.

-

-
- Neither x nor y is a object, and neither x nor y implements the interface. -
- - When overridden in a derived class, compares two strings and returns an indication of their relative sort order. - A string to compare to y. - A string to compare to x. -

A signed integer that indicates the relative values of x and y, as shown in the following table.

-
Value

-

Meaning

-

Less than zero

-

x precedes y in the sort order.

-

-or-

-

x is null and y is not null.

-

Zero

-

x is equal to y.

-

-or-

-

x and y are both null.

-

Greater than zero

-

x follows y in the sort order.

-

-or-

-

y is null and x is not null.

-

-
-
- - Creates a object that compares strings according to the rules of a specified culture. - A culture whose linguistic rules are used to perform a string comparison. - true to specify that comparison operations be case-insensitive; false to specify that comparison operations be case-sensitive. - A new object that performs string comparisons according to the comparison rules used by the culture parameter and the case rule specified by the ignoreCase parameter. - culture is null. - - - Gets a object that performs a case-sensitive string comparison using the word comparison rules of the current culture. - A new object. - - - Gets a object that performs case-insensitive string comparisons using the word comparison rules of the current culture. - A new object. - - - When overridden in a derived class, indicates whether two objects are equal. - An object to compare to y. - An object to compare to x. - true if x and y refer to the same object, or x and y are both the same type of object and those objects are equal, or both x and y are null; otherwise, false. - - - When overridden in a derived class, indicates whether two strings are equal. - A string to compare to y. - A string to compare to x. - true if x and y refer to the same object, or x and y are equal, or x and y are null; otherwise, false. - - - When overridden in a derived class, gets the hash code for the specified object. - An object. - A 32-bit signed hash code calculated from the value of the obj parameter. - Not enough memory is available to allocate the buffer that is required to compute the hash code. - obj is null. - - - When overridden in a derived class, gets the hash code for the specified string. - A string. - A 32-bit signed hash code calculated from the value of the obj parameter. - Not enough memory is available to allocate the buffer that is required to compute the hash code. - obj is null. - - - Gets a object that performs a case-sensitive string comparison using the word comparison rules of the invariant culture. - A new object. - - - Gets a object that performs a case-insensitive string comparison using the word comparison rules of the invariant culture. - A new object. - - - Gets a object that performs a case-sensitive ordinal string comparison. - A object. - - - Gets a object that performs a case-insensitive ordinal string comparison. - A object. - - - Specifies the culture, case, and sort rules to be used by certain overloads of the and methods. - - - Compare strings using culture-sensitive sort rules and the current culture. - - - - Compare strings using culture-sensitive sort rules, the current culture, and ignoring the case of the strings being compared. - - - - Compare strings using culture-sensitive sort rules and the invariant culture. - - - - Compare strings using culture-sensitive sort rules, the invariant culture, and ignoring the case of the strings being compared. - - - - Compare strings using ordinal (binary) sort rules. - - - - Compare strings using ordinal (binary) sort rules and ignoring the case of the strings being compared. - - - - - - - - - - - - - - - - - - - - - - - - - Specifies whether applicable method overloads include or omit empty substrings from the return value. - - - The return value includes array elements that contain an empty string - - - - The return value does not include array elements that contain an empty string - - - - Serves as the base class for system exceptions namespace. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with a specified error message. - The message that describes the error. - - - Initializes a new instance of the class with serialized data. - The object that holds the serialized object data. - The contextual information about the source or destination. - - - Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. - The error message that explains the reason for the exception. - The exception that is the cause of the current exception. If the innerException parameter is not a null reference (Nothing in Visual Basic), the current exception is raised in a catch block that handles the inner exception. - - - Represents an ASCII character encoding of Unicode characters. - - - Initializes a new instance of the class. - - - Calculates the number of bytes produced by encoding the characters in the specified . - The containing the set of characters to encode. - The number of bytes produced by encoding the specified characters. - chars is null. - The resulting number of bytes is greater than the maximum number that can be returned as an integer. - A fallback occurred (see Character Encoding in the .NET Framework for complete explanation) -and- is set to . - - - Calculates the number of bytes produced by encoding a set of characters starting at the specified character pointer. - A pointer to the first character to encode. - The number of characters to encode. - The number of bytes produced by encoding the specified characters. - chars is null. - count is less than zero. -or- The resulting number of bytes is greater than the maximum number that can be returned as an integer. - A fallback occurred (see Character Encoding in the .NET Framework for complete explanation) -and- is set to . - - - Calculates the number of bytes produced by encoding a set of characters from the specified character array. - The character array containing the set of characters to encode. - The index of the first character to encode. - The number of characters to encode. - The number of bytes produced by encoding the specified characters. - chars is null. - index or count is less than zero. -or- index and count do not denote a valid range in chars. -or- The resulting number of bytes is greater than the maximum number that can be returned as an integer. - A fallback occurred (see Character Encoding in the .NET Framework for complete explanation) -and- is set to . - - - Encodes a set of characters starting at the specified character pointer into a sequence of bytes that are stored starting at the specified byte pointer. - A pointer to the first character to encode. - The number of characters to encode. - A pointer to the location at which to start writing the resulting sequence of bytes. - The maximum number of bytes to write. - The actual number of bytes written at the location indicated by bytes. - chars is null. -or- bytes is null. - charCount or byteCount is less than zero. - byteCount is less than the resulting number of bytes. - A fallback occurred (see Character Encoding in the .NET Framework for complete explanation) -and- is set to . - - - Encodes a set of characters from the specified character array into the specified byte array. - The character array containing the set of characters to encode. - The index of the first character to encode. - The number of characters to encode. - The byte array to contain the resulting sequence of bytes. - The index at which to start writing the resulting sequence of bytes. - The actual number of bytes written into bytes. - chars is null. -or- bytes is null. - charIndex or charCount or byteIndex is less than zero. -or- charIndex and charCount do not denote a valid range in chars. -or- byteIndex is not a valid index in bytes. - bytes does not have enough capacity from byteIndex to the end of the array to accommodate the resulting bytes. - A fallback occurred (see Character Encoding in the .NET Framework for complete explanation) -and- is set to . - - - Encodes a set of characters from the specified into the specified byte array. - The containing the set of characters to encode. - The index of the first character to encode. - The number of characters to encode. - The byte array to contain the resulting sequence of bytes. - The index at which to start writing the resulting sequence of bytes. - The actual number of bytes written into bytes. - s is null. -or- bytes is null. - charIndex or charCount or byteIndex is less than zero. -or- charIndex and charCount do not denote a valid range in chars. -or- byteIndex is not a valid index in bytes. - bytes does not have enough capacity from byteIndex to the end of the array to accommodate the resulting bytes. - A fallback occurred (see Character Encoding in the .NET Framework for complete explanation) -and- is set to . - - - Calculates the number of characters produced by decoding a sequence of bytes from the specified byte array. - The byte array containing the sequence of bytes to decode. - The index of the first byte to decode. - The number of bytes to decode. - The number of characters produced by decoding the specified sequence of bytes. - bytes is null. - index or count is less than zero. -or- index and count do not denote a valid range in bytes. -or- The resulting number of bytes is greater than the maximum number that can be returned as an integer. - A fallback occurred (see Character Encoding in the .NET Framework for complete explanation) -and- is set to . - - - Calculates the number of characters produced by decoding a sequence of bytes starting at the specified byte pointer. - A pointer to the first byte to decode. - The number of bytes to decode. - The number of characters produced by decoding the specified sequence of bytes. - bytes is null. - count is less than zero. -or- The resulting number of bytes is greater than the maximum number that can be returned as an integer. - A fallback occurred (see Character Encoding in the .NET Framework for complete explanation) -and- is set to . - - - Decodes a sequence of bytes starting at the specified byte pointer into a set of characters that are stored starting at the specified character pointer. - A pointer to the first byte to decode. - The number of bytes to decode. - A pointer to the location at which to start writing the resulting set of characters. - The maximum number of characters to write. - The actual number of characters written at the location indicated by chars. - bytes is null. -or- chars is null. - byteCount or charCount is less than zero. - charCount is less than the resulting number of characters. - A fallback occurred (see Character Encoding in the .NET Framework for complete explanation) -and- is set to . - - - Decodes a sequence of bytes from the specified byte array into the specified character array. - The byte array containing the sequence of bytes to decode. - The index of the first byte to decode. - The number of bytes to decode. - The character array to contain the resulting set of characters. - The index at which to start writing the resulting set of characters. - The actual number of characters written into chars. - bytes is null. -or- chars is null. - byteIndex or byteCount or charIndex is less than zero. -or- byteindex and byteCount do not denote a valid range in bytes. -or- charIndex is not a valid index in chars. - chars does not have enough capacity from charIndex to the end of the array to accommodate the resulting characters. - A fallback occurred (see Character Encoding in the .NET Framework for complete explanation) -and- is set to . - - - Obtains a decoder that converts an ASCII encoded sequence of bytes into a sequence of Unicode characters. - A that converts an ASCII encoded sequence of bytes into a sequence of Unicode characters. - - - Obtains an encoder that converts a sequence of Unicode characters into an ASCII encoded sequence of bytes. - An that converts a sequence of Unicode characters into an ASCII encoded sequence of bytes. - - - Calculates the maximum number of bytes produced by encoding the specified number of characters. - The number of characters to encode. - The maximum number of bytes produced by encoding the specified number of characters. - charCount is less than zero. -or- The resulting number of bytes is greater than the maximum number that can be returned as an integer. - - - Calculates the maximum number of characters produced by decoding the specified number of bytes. - The number of bytes to decode. - The maximum number of characters produced by decoding the specified number of bytes. - byteCount is less than zero. -or- The resulting number of bytes is greater than the maximum number that can be returned as an integer. - - - Decodes a range of bytes from a byte array into a string. - The byte array containing the sequence of bytes to decode. - The index of the first byte to decode. - The number of bytes to decode. - A containing the results of decoding the specified sequence of bytes. - bytes is null. - index or count is less than zero. -or- index and count do not denote a valid range in bytes. - A fallback occurred (see Character Encoding in the .NET Framework for complete explanation) -and- is set to . - - - Gets a value indicating whether the current encoding uses single-byte code points. - This property is always true. - - - Converts a sequence of encoded bytes into a set of characters. - - - Initializes a new instance of the class. - - - Converts a buffer of encoded bytes to UTF-16 encoded characters and stores the result in another buffer. - The address of a buffer that contains the byte sequences to convert. - The number of bytes in bytes to convert. - The address of a buffer to store the converted characters. - The maximum number of characters in chars to use in the conversion. - true to indicate no further data is to be converted; otherwise, false. - When this method returns, contains the number of bytes that were produced by the conversion. This parameter is passed uninitialized. - When this method returns, contains the number of characters from chars that were used in the conversion. This parameter is passed uninitialized. - When this method returns, contains true if all the characters specified by byteCount were converted; otherwise, false. This parameter is passed uninitialized. - chars or bytes is null (Nothing). - charCount or byteCount is less than zero. - The output buffer is too small to contain any of the converted input. The output buffer should be greater than or equal to the size indicated by the method. - A fallback occurred (see Character Encoding in the .NET Framework for fuller explanation) -and- is set to . - - - Converts an array of encoded bytes to UTF-16 encoded characters and stores the result in a character array. - A byte array to convert. - The first element of bytes to convert. - The number of elements of bytes to convert. - An array to store the converted characters. - The first element of chars in which data is stored. - The maximum number of elements of chars to use in the conversion. - true to indicate that no further data is to be converted; otherwise, false. - When this method returns, contains the number of bytes that were used in the conversion. This parameter is passed uninitialized. - When this method returns, contains the number of characters from chars that were produced by the conversion. This parameter is passed uninitialized. - When this method returns, contains true if all the characters specified by byteCount were converted; otherwise, false. This parameter is passed uninitialized. - chars or bytes is null (Nothing). - charIndex, charCount, byteIndex, or byteCount is less than zero. -or- The length of chars - charIndex is less than charCount. -or- The length of bytes - byteIndex is less than byteCount. - The output buffer is too small to contain any of the converted input. The output buffer should be greater than or equal to the size indicated by the method. - A fallback occurred (see Character Encoding in the .NET Framework for fuller explanation) -and- is set to . - - - Gets or sets a object for the current object. - A object. - The value in a set operation is null (Nothing). - A new value cannot be assigned in a set operation because the current object contains data that has not been decoded yet. - - - Gets the object associated with the current object. - A object. - - - When overridden in a derived class, calculates the number of characters produced by decoding a sequence of bytes starting at the specified byte pointer. A parameter indicates whether to clear the internal state of the decoder after the calculation. - A pointer to the first byte to decode. - The number of bytes to decode. - true to simulate clearing the internal state of the encoder after the calculation; otherwise, false. - The number of characters produced by decoding the specified sequence of bytes and any bytes in the internal buffer. - bytes is null (Nothing in Visual Basic .NET). - count is less than zero. - A fallback occurred (see Character Encoding in the .NET Framework for fuller explanation) -and- is set to . - - - When overridden in a derived class, calculates the number of characters produced by decoding a sequence of bytes from the specified byte array. - The byte array containing the sequence of bytes to decode. - The index of the first byte to decode. - The number of bytes to decode. - The number of characters produced by decoding the specified sequence of bytes and any bytes in the internal buffer. - bytes is null (Nothing). - index or count is less than zero. -or- index and count do not denote a valid range in bytes. - A fallback occurred (see Character Encoding in the .NET Framework for fuller explanation) -and- is set to . - - - When overridden in a derived class, calculates the number of characters produced by decoding a sequence of bytes from the specified byte array. A parameter indicates whether to clear the internal state of the decoder after the calculation. - The byte array containing the sequence of bytes to decode. - The index of the first byte to decode. - The number of bytes to decode. - true to simulate clearing the internal state of the encoder after the calculation; otherwise, false. - The number of characters produced by decoding the specified sequence of bytes and any bytes in the internal buffer. - bytes is null (Nothing). - index or count is less than zero. -or- index and count do not denote a valid range in bytes. - A fallback occurred (see Character Encoding in the .NET Framework for fuller explanation) -and- is set to . - - - When overridden in a derived class, decodes a sequence of bytes starting at the specified byte pointer and any bytes in the internal buffer into a set of characters that are stored starting at the specified character pointer. A parameter indicates whether to clear the internal state of the decoder after the conversion. - A pointer to the first byte to decode. - The number of bytes to decode. - A pointer to the location at which to start writing the resulting set of characters. - The maximum number of characters to write. - true to clear the internal state of the decoder after the conversion; otherwise, false. - The actual number of characters written at the location indicated by the chars parameter. - bytes is null (Nothing). -or- chars is null (Nothing). - byteCount or charCount is less than zero. - charCount is less than the resulting number of characters. - A fallback occurred (see Character Encoding in the .NET Framework for fuller explanation) -and- is set to . - - - When overridden in a derived class, decodes a sequence of bytes from the specified byte array and any bytes in the internal buffer into the specified character array. - The byte array containing the sequence of bytes to decode. - The index of the first byte to decode. - The number of bytes to decode. - The character array to contain the resulting set of characters. - The index at which to start writing the resulting set of characters. - The actual number of characters written into chars. - bytes is null (Nothing). -or- chars is null (Nothing). - byteIndex or byteCount or charIndex is less than zero. -or- byteindex and byteCount do not denote a valid range in bytes. -or- charIndex is not a valid index in chars. - chars does not have enough capacity from charIndex to the end of the array to accommodate the resulting characters. - A fallback occurred (see Character Encoding in the .NET Framework for fuller explanation) -and- is set to . - - - When overridden in a derived class, decodes a sequence of bytes from the specified byte array and any bytes in the internal buffer into the specified character array. A parameter indicates whether to clear the internal state of the decoder after the conversion. - The byte array containing the sequence of bytes to decode. - The index of the first byte to decode. - The number of bytes to decode. - The character array to contain the resulting set of characters. - The index at which to start writing the resulting set of characters. - true to clear the internal state of the decoder after the conversion; otherwise, false. - The actual number of characters written into the chars parameter. - bytes is null (Nothing). -or- chars is null (Nothing). - byteIndex or byteCount or charIndex is less than zero. -or- byteindex and byteCount do not denote a valid range in bytes. -or- charIndex is not a valid index in chars. - chars does not have enough capacity from charIndex to the end of the array to accommodate the resulting characters. - A fallback occurred (see Character Encoding in the .NET Framework for fuller explanation) -and- is set to . - - - When overridden in a derived class, sets the decoder back to its initial state. - - - Provides a failure-handling mechanism, called a fallback, for an encoded input byte sequence that cannot be converted to an input character. The fallback throws an exception instead of decoding the input byte sequence. This class cannot be inherited. - - - Initializes a new instance of the class. - - - Returns a decoder fallback buffer that throws an exception if it cannot convert a sequence of bytes to a character. - A decoder fallback buffer that throws an exception when it cannot decode a byte sequence. - - - Indicates whether the current object and a specified object are equal. - An object that derives from the class. - true if value is not null and is a object; otherwise, false. - - - Retrieves the hash code for this instance. - The return value is always the same arbitrary value, and has no special significance. - - - Gets the maximum number of characters this instance can return. - The return value is always zero. - - - Throws when an encoded input byte sequence cannot be converted to a decoded output character. This class cannot be inherited. - - - Initializes a new instance of the class. - - - Throws when the input byte sequence cannot be decoded. The nominal return value is not used. - An input array of bytes. - The index position of a byte in the input. - None. No value is returned because the method always throws an exception. The nominal return value is true. A return value is defined, although it is unchanging, because this method implements an abstract method. - This method always throws an exception that reports the value and index position of the input byte that cannot be decoded. - - - Retrieves the next character in the exception data buffer. - The return value is always the Unicode character NULL (U+0000). A return value is defined, although it is unchanging, because this method implements an abstract method. - - - Causes the next call to to access the exception data buffer character position that is prior to the current position. - The return value is always false. A return value is defined, although it is unchanging, because this method implements an abstract method. - - - Gets the number of characters in the current object that remain to be processed. - The return value is always zero. A return value is defined, although it is unchanging, because this method implements an abstract method. - - - Provides a failure-handling mechanism, called a fallback, for an encoded input byte sequence that cannot be converted to an output character. - - - Initializes a new instance of the class. - - - When overridden in a derived class, initializes a new instance of the class. - An object that provides a fallback buffer for a decoder. - - - Gets an object that throws an exception when an input byte sequence cannot be decoded. - A type derived from the class. The default value is a object. - - - When overridden in a derived class, gets the maximum number of characters the current object can return. - The maximum number of characters the current object can return. - - - Gets an object that outputs a substitute string in place of an input byte sequence that cannot be decoded. - A type derived from the class. The default value is a object that emits the QUESTION MARK character ("?", U+003F) in place of unknown byte sequences. - - - Provides a buffer that allows a fallback handler to return an alternate string to a decoder when it cannot decode an input byte sequence. - - - Initializes a new instance of the class. - - - When overridden in a derived class, prepares the fallback buffer to handle the specified input byte sequence. - An input array of bytes. - The index position of a byte in bytesUnknown. - true if the fallback buffer can process bytesUnknown; false if the fallback buffer ignores bytesUnknown. - - - When overridden in a derived class, retrieves the next character in the fallback buffer. - The next character in the fallback buffer. - - - When overridden in a derived class, causes the next call to the method to access the data buffer character position that is prior to the current character position. - true if the operation was successful; otherwise, false. - - - When overridden in a derived class, gets the number of characters in the current object that remain to be processed. - The number of characters in the current fallback buffer that have not yet been processed. - - - Initializes all data and state information pertaining to this fallback buffer. - - - The exception that is thrown when a decoder fallback operation fails. This class cannot be inherited. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. A parameter specifies the error message. - An error message. - - - Initializes a new instance of the class. Parameters specify the error message and the inner exception that is the cause of this exception. - An error message. - The exception that caused this exception. - - - Initializes a new instance of the class. Parameters specify the error message, the array of bytes being decoded, and the index of the byte that cannot be decoded. - An error message. - The input byte array. - The index position in bytesUnknown of the byte that cannot be decoded. - - - Gets the input byte sequence that caused the exception. - The input byte array that cannot be decoded. - - - Gets the index position in the input byte sequence of the byte that caused the exception. - The index position in the input byte array of the byte that cannot be decoded. The index position is zero-based. - - - Provides a failure-handling mechanism, called a fallback, for an encoded input byte sequence that cannot be converted to an output character. The fallback emits a user-specified replacement string instead of a decoded input byte sequence. This class cannot be inherited. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class using a specified replacement string. - A string that is emitted in a decoding operation in place of an input byte sequence that cannot be decoded. - replacement is null. - replacement contains an invalid surrogate pair. In other words, the surrogate pair does not consist of one high surrogate component followed by one low surrogate component. - - - Creates a object that is initialized with the replacement string of this object. - A object that specifies a string to use instead of the original decoding operation input. - - - Gets the replacement string that is the value of the object. - A substitute string that is emitted in place of an input byte sequence that cannot be decoded. - - - Indicates whether the value of a specified object is equal to the object. - A object. - true if value is a object having a property that is equal to the property of the current object; otherwise, false. - - - Retrieves the hash code for the value of the object. - The hash code of the value of the object. - - - Gets the number of characters in the replacement string for the object. - The number of characters in the string that is emitted in place of a byte sequence that cannot be decoded, that is, the length of the string returned by the property. - - - Represents a substitute output string that is emitted when the original input byte sequence cannot be decoded. This class cannot be inherited. - - - Initializes a new instance of the class using the value of a object. - A object that contains a replacement string. - - - Prepares the replacement fallback buffer to use the current replacement string. - An input byte sequence. This parameter is ignored unless an exception is thrown. - The index position of the byte in bytesUnknown. This parameter is ignored in this operation. - true if the replacement string is not empty; false if the replacement string is empty. - This method is called again before the method has read all the characters in the replacement fallback buffer. - - - Retrieves the next character in the replacement fallback buffer. - The next character in the replacement fallback buffer. - - - Causes the next call to to access the character position in the replacement fallback buffer prior to the current character position. - true if the operation was successful; otherwise, false. - - - Gets the number of characters in the replacement fallback buffer that remain to be processed. - The number of characters in the replacement fallback buffer that have not yet been processed. - - - Initializes all internal state information and data in the object. - - - Converts a set of characters into a sequence of bytes. - - - Initializes a new instance of the class. - - - Converts a buffer of Unicode characters to an encoded byte sequence and stores the result in another buffer. - The address of a string of UTF-16 encoded characters to convert. - The number of characters in chars to convert. - The address of a buffer to store the converted bytes. - The maximum number of bytes in bytes to use in the conversion. - true to indicate no further data is to be converted; otherwise, false. - When this method returns, contains the number of characters from chars that were used in the conversion. This parameter is passed uninitialized. - When this method returns, contains the number of bytes that were used in the conversion. This parameter is passed uninitialized. - When this method returns, contains true if all the characters specified by charCount were converted; otherwise, false. This parameter is passed uninitialized. - chars or bytes is null (Nothing). - charCount or byteCount is less than zero. - The output buffer is too small to contain any of the converted input. The output buffer should be greater than or equal to the size indicated by the method. - A fallback occurred (see Character Encoding in the .NET Framework for fuller explanation) -and- is set to . - - - Converts an array of Unicode characters to an encoded byte sequence and stores the result in an array of bytes. - An array of characters to convert. - The first element of chars to convert. - The number of elements of chars to convert. - An array where the converted bytes are stored. - The first element of bytes in which data is stored. - The maximum number of elements of bytes to use in the conversion. - true to indicate no further data is to be converted; otherwise, false. - When this method returns, contains the number of characters from chars that were used in the conversion. This parameter is passed uninitialized. - When this method returns, contains the number of bytes that were produced by the conversion. This parameter is passed uninitialized. - When this method returns, contains true if all the characters specified by charCount were converted; otherwise, false. This parameter is passed uninitialized. - chars or bytes is null (Nothing). - charIndex, charCount, byteIndex, or byteCount is less than zero. -or- The length of chars - charIndex is less than charCount. -or- The length of bytes - byteIndex is less than byteCount. - The output buffer is too small to contain any of the converted input. The output buffer should be greater than or equal to the size indicated by the method. - A fallback occurred (see Character Encoding in the .NET Framework for fuller explanation) -and- is set to . - - - Gets or sets a object for the current object. - A object. - The value in a set operation is null (Nothing). - A new value cannot be assigned in a set operation because the current object contains data that has not been encoded yet. - A fallback occurred (see Character Encoding in the .NET Framework for fuller explanation) -and- is set to . - - - Gets the object associated with the current object. - A object. - - - When overridden in a derived class, calculates the number of bytes produced by encoding a set of characters starting at the specified character pointer. A parameter indicates whether to clear the internal state of the encoder after the calculation. - A pointer to the first character to encode. - The number of characters to encode. - true to simulate clearing the internal state of the encoder after the calculation; otherwise, false. - The number of bytes produced by encoding the specified characters and any characters in the internal buffer. - chars is null (Nothing in Visual Basic .NET). - count is less than zero. - A fallback occurred (see Character Encoding in the .NET Framework for fuller explanation) -and- is set to . - - - When overridden in a derived class, calculates the number of bytes produced by encoding a set of characters from the specified character array. A parameter indicates whether to clear the internal state of the encoder after the calculation. - The character array containing the set of characters to encode. - The index of the first character to encode. - The number of characters to encode. - true to simulate clearing the internal state of the encoder after the calculation; otherwise, false. - The number of bytes produced by encoding the specified characters and any characters in the internal buffer. - chars is null. - index or count is less than zero. -or- index and count do not denote a valid range in chars. - A fallback occurred (see Character Encoding in the .NET Framework for fuller explanation) -and- is set to . - - - When overridden in a derived class, encodes a set of characters starting at the specified character pointer and any characters in the internal buffer into a sequence of bytes that are stored starting at the specified byte pointer. A parameter indicates whether to clear the internal state of the encoder after the conversion. - A pointer to the first character to encode. - The number of characters to encode. - A pointer to the location at which to start writing the resulting sequence of bytes. - The maximum number of bytes to write. - true to clear the internal state of the encoder after the conversion; otherwise, false. - The actual number of bytes written at the location indicated by the bytes parameter. - chars is null (Nothing). -or- bytes is null (Nothing). - charCount or byteCount is less than zero. - byteCount is less than the resulting number of bytes. - A fallback occurred (see Character Encoding in the .NET Framework for fuller explanation) -and- is set to . - - - When overridden in a derived class, encodes a set of characters from the specified character array and any characters in the internal buffer into the specified byte array. A parameter indicates whether to clear the internal state of the encoder after the conversion. - The character array containing the set of characters to encode. - The index of the first character to encode. - The number of characters to encode. - The byte array to contain the resulting sequence of bytes. - The index at which to start writing the resulting sequence of bytes. - true to clear the internal state of the encoder after the conversion; otherwise, false. - The actual number of bytes written into bytes. - chars is null (Nothing). -or- bytes is null (Nothing). - charIndex or charCount or byteIndex is less than zero. -or- charIndex and charCount do not denote a valid range in chars. -or- byteIndex is not a valid index in bytes. - bytes does not have enough capacity from byteIndex to the end of the array to accommodate the resulting bytes. - A fallback occurred (see Character Encoding in the .NET Framework for fuller explanation) -and- is set to . - - - When overridden in a derived class, sets the encoder back to its initial state. - - - Provides a failure-handling mechanism, called a fallback, for an input character that cannot be converted to an output byte sequence. The fallback throws an exception if an input character cannot be converted to an output byte sequence. This class cannot be inherited. - - - Initializes a new instance of the class. - - - Returns an encoder fallback buffer that throws an exception if it cannot convert a character sequence to a byte sequence. - An encoder fallback buffer that throws an exception when it cannot encode a character sequence. - - - Indicates whether the current object and a specified object are equal. - An object that derives from the class. - true if value is not null (Nothing in Visual Basic .NET) and is a object; otherwise, false. - - - Retrieves the hash code for this instance. - The return value is always the same arbitrary value, and has no special significance. - - - Gets the maximum number of characters this instance can return. - The return value is always zero. - - - Throws when an input character cannot be converted to an encoded output byte sequence. This class cannot be inherited. - - - Initializes a new instance of the class. - - - Throws an exception because the input character cannot be encoded. Parameters specify the value and index position of the character that cannot be converted. - An input character. - The index position of the character in the input buffer. - None. No value is returned because the method always throws an exception. - charUnknown cannot be encoded. This method always throws an exception that reports the value of the charUnknown and index parameters. - - - Throws an exception because the input character cannot be encoded. Parameters specify the value and index position of the surrogate pair in the input, and the nominal return value is not used. - The high surrogate of the input pair. - The low surrogate of the input pair. - The index position of the surrogate pair in the input buffer. - None. No value is returned because the method always throws an exception. - The character represented by charUnknownHigh and charUnknownLow cannot be encoded. - Either charUnknownHigh or charUnknownLow is invalid. charUnknownHigh is not between U+D800 and U+DBFF, inclusive, or charUnknownLow is not between U+DC00 and U+DFFF, inclusive. - - - Retrieves the next character in the exception fallback buffer. - The return value is always the Unicode character, NULL (U+0000). A return value is defined, although it is unchanging, because this method implements an abstract method. - - - Causes the next call to the method to access the exception data buffer character position that is prior to the current position. - The return value is always false. A return value is defined, although it is unchanging, because this method implements an abstract method. - - - Gets the number of characters in the current object that remain to be processed. - The return value is always zero. A return value is defined, although it is unchanging, because this method implements an abstract method. - - - Provides a failure-handling mechanism, called a fallback, for an input character that cannot be converted to an encoded output byte sequence. - - - Initializes a new instance of the class. - - - When overridden in a derived class, initializes a new instance of the class. - An object that provides a fallback buffer for an encoder. - - - Gets an object that throws an exception when an input character cannot be encoded. - A type derived from the class. The default value is a object. - - - When overridden in a derived class, gets the maximum number of characters the current object can return. - The maximum number of characters the current object can return. - - - Gets an object that outputs a substitute string in place of an input character that cannot be encoded. - A type derived from the class. The default value is a object that replaces unknown input characters with the QUESTION MARK character ("?", U+003F). - - - Provides a buffer that allows a fallback handler to return an alternate string to an encoder when it cannot encode an input character. - - - Initializes a new instance of the class. - - - When overridden in a derived class, prepares the fallback buffer to handle the specified input character. - An input character. - The index position of the character in the input buffer. - true if the fallback buffer can process charUnknown; false if the fallback buffer ignores charUnknown. - - - When overridden in a derived class, prepares the fallback buffer to handle the specified surrogate pair. - The high surrogate of the input pair. - The low surrogate of the input pair. - The index position of the surrogate pair in the input buffer. - true if the fallback buffer can process charUnknownHigh and charUnknownLow; false if the fallback buffer ignores the surrogate pair. - - - When overridden in a derived class, retrieves the next character in the fallback buffer. - The next character in the fallback buffer. - - - When overridden in a derived class, causes the next call to the method to access the data buffer character position that is prior to the current character position. - true if the operation was successful; otherwise, false. - - - When overridden in a derived class, gets the number of characters in the current object that remain to be processed. - The number of characters in the current fallback buffer that have not yet been processed. - - - Initializes all data and state information pertaining to this fallback buffer. - - - The exception that is thrown when an encoder fallback operation fails. This class cannot be inherited. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. A parameter specifies the error message. - An error message. - - - Initializes a new instance of the class. Parameters specify the error message and the inner exception that is the cause of this exception. - An error message. - The exception that caused this exception. - - - Gets the input character that caused the exception. - The character that cannot be encoded. - - - Gets the high component character of the surrogate pair that caused the exception. - The high component character of the surrogate pair that cannot be encoded. - - - Gets the low component character of the surrogate pair that caused the exception. - The low component character of the surrogate pair that cannot be encoded. - - - Gets the index position in the input buffer of the character that caused the exception. - The index position in the input buffer of the character that cannot be encoded. - - - Indicates whether the input that caused the exception is a surrogate pair. - true if the input was a surrogate pair; otherwise, false. - - - Provides a failure handling mechanism, called a fallback, for an input character that cannot be converted to an output byte sequence. The fallback uses a user-specified replacement string instead of the original input character. This class cannot be inherited. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class using a specified replacement string. - A string that is converted in an encoding operation in place of an input character that cannot be encoded. - replacement is null. - replacement contains an invalid surrogate pair. In other words, the surrogate does not consist of one high surrogate component followed by one low surrogate component. - - - Creates a object that is initialized with the replacement string of this object. - A object equal to this object. - - - Gets the replacement string that is the value of the object. - A substitute string that is used in place of an input character that cannot be encoded. - - - Indicates whether the value of a specified object is equal to the object. - A object. - true if the value parameter specifies an object and the replacement string of that object is equal to the replacement string of this object; otherwise, false. - - - Retrieves the hash code for the value of the object. - The hash code of the value of the object. - - - Gets the number of characters in the replacement string for the object. - The number of characters in the string used in place of an input character that cannot be encoded. - - - Represents a substitute input string that is used when the original input character cannot be encoded. This class cannot be inherited. - - - Initializes a new instance of the class using the value of a object. - A object. - - - Prepares the replacement fallback buffer to use the current replacement string. - An input character. This parameter is ignored in this operation unless an exception is thrown. - The index position of the character in the input buffer. This parameter is ignored in this operation. - true if the replacement string is not empty; false if the replacement string is empty. - This method is called again before the method has read all the characters in the replacement fallback buffer. - - - Indicates whether a replacement string can be used when an input surrogate pair cannot be encoded, or whether the surrogate pair can be ignored. Parameters specify the surrogate pair and the index position of the pair in the input. - The high surrogate of the input pair. - The low surrogate of the input pair. - The index position of the surrogate pair in the input buffer. - true if the replacement string is not empty; false if the replacement string is empty. - This method is called again before the method has read all the replacement string characters. - The value of charUnknownHigh is less than U+D800 or greater than U+D8FF. -or- The value of charUnknownLow is less than U+DC00 or greater than U+DFFF. - - - Retrieves the next character in the replacement fallback buffer. - The next Unicode character in the replacement fallback buffer that the application can encode. - - - Causes the next call to the method to access the character position in the replacement fallback buffer prior to the current character position. - true if the operation was successful; otherwise, false. - - - Gets the number of characters in the replacement fallback buffer that remain to be processed. - The number of characters in the replacement fallback buffer that have not yet been processed. - - - Initializes all internal state information and data in this instance of . - - - Represents a character encoding. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class that corresponds to the specified code page. - The code page identifier of the preferred encoding. -or- 0, to use the default encoding. - codePage is less than zero. - - - Initializes a new instance of the class that corresponds to the specified code page with the specified encoder and decoder fallback strategies. - The encoding code page identifier. - An object that provides an error-handling procedure when a character cannot be encoded with the current encoding. - An object that provides an error-handling procedure when a byte sequence cannot be decoded with the current encoding. - codePage is less than zero. - - - Gets an encoding for the ASCII (7-bit) character set. - An encoding for the ASCII (7-bit) character set. - - - Gets an encoding for the UTF-16 format that uses the big endian byte order. - An encoding object for the UTF-16 format that uses the big endian byte order. - - - When overridden in a derived class, gets a name for the current encoding that can be used with mail agent body tags. - A name for the current that can be used with mail agent body tags. -or- An empty string (""), if the current cannot be used. - - - When overridden in a derived class, creates a shallow copy of the current object. - A copy of the current object. - - - When overridden in a derived class, gets the code page identifier of the current . - The code page identifier of the current . - - - Converts a range of bytes in a byte array from one encoding to another. - The encoding of the source array, bytes. - The encoding of the output array. - The array of bytes to convert. - The index of the first element of bytes to convert. - The number of bytes to convert. - An array of type containing the result of converting a range of bytes in bytes from srcEncoding to dstEncoding. - srcEncoding is null. -or- dstEncoding is null. -or- bytes is null. - index and count do not specify a valid range in the byte array. - A fallback occurred (see Character Encoding in the .NET Framework for complete explanation) -and- srcEncoding. is set to . - A fallback occurred (see Character Encoding in the .NET Framework for complete explanation) -and- dstEncoding. is set to . - - - Converts an entire byte array from one encoding to another. - The encoding format of bytes. - The target encoding format. - The bytes to convert. - An array of type containing the results of converting bytes from srcEncoding to dstEncoding. - srcEncoding is null. -or- dstEncoding is null. -or- bytes is null. - A fallback occurred (see Character Encoding in the .NET Framework for complete explanation) -and- srcEncoding. is set to . - A fallback occurred (see Character Encoding in the .NET Framework for complete explanation) -and- dstEncoding. is set to . - - - Gets or sets the object for the current object. - The decoder fallback object for the current object. - The value in a set operation is null. - A value cannot be assigned in a set operation because the current object is read-only. - - - Gets an encoding for the operating system's current ANSI code page. - An encoding for the operating system's current ANSI code page. - - - Gets or sets the object for the current object. - The encoder fallback object for the current object. - The value in a set operation is null. - A value cannot be assigned in a set operation because the current object is read-only. - - - When overridden in a derived class, gets the human-readable description of the current encoding. - The human-readable description of the current . - - - Determines whether the specified is equal to the current instance. - The to compare with the current instance. - true if value is an instance of and is equal to the current instance; otherwise, false. - - - When overridden in a derived class, calculates the number of bytes produced by encoding a set of characters from the specified character array. - The character array containing the set of characters to encode. - The index of the first character to encode. - The number of characters to encode. - The number of bytes produced by encoding the specified characters. - chars is null. - index or count is less than zero. -or- index and count do not denote a valid range in chars. - A fallback occurred (see Character Encoding in the .NET Framework for complete explanation) -and- is set to . - - - When overridden in a derived class, calculates the number of bytes produced by encoding all the characters in the specified character array. - The character array containing the characters to encode. - The number of bytes produced by encoding all the characters in the specified character array. - chars is null. - A fallback occurred (see Character Encoding in the .NET Framework for complete explanation) -and- is set to . - - - When overridden in a derived class, calculates the number of bytes produced by encoding the characters in the specified string. - The string containing the set of characters to encode. - The number of bytes produced by encoding the specified characters. - s is null. - A fallback occurred (see Character Encoding in the .NET Framework for complete explanation) -and- is set to . - - - When overridden in a derived class, calculates the number of bytes produced by encoding a set of characters starting at the specified character pointer. - A pointer to the first character to encode. - The number of characters to encode. - The number of bytes produced by encoding the specified characters. - chars is null. - count is less than zero. - A fallback occurred (see Character Encoding in the .NET Framework for complete explanation) -and- is set to . - - - When overridden in a derived class, encodes all the characters in the specified character array into a sequence of bytes. - The character array containing the characters to encode. - A byte array containing the results of encoding the specified set of characters. - chars is null. - A fallback occurred (see Character Encoding in the .NET Framework for complete explanation) -and- is set to . - - - When overridden in a derived class, encodes all the characters in the specified string into a sequence of bytes. - The string containing the characters to encode. - A byte array containing the results of encoding the specified set of characters. - s is null. - A fallback occurred (see Character Encoding in the .NET Framework for complete explanation) -and- is set to . - - - When overridden in a derived class, encodes a set of characters from the specified character array into a sequence of bytes. - The character array containing the set of characters to encode. - The index of the first character to encode. - The number of characters to encode. - A byte array containing the results of encoding the specified set of characters. - chars is null. - index or count is less than zero. -or- index and count do not denote a valid range in chars. - A fallback occurred (see Character Encoding in the .NET Framework for complete explanation) -and- is set to . - - - When overridden in a derived class, encodes a set of characters starting at the specified character pointer into a sequence of bytes that are stored starting at the specified byte pointer. - A pointer to the first character to encode. - The number of characters to encode. - A pointer to the location at which to start writing the resulting sequence of bytes. - The maximum number of bytes to write. - The actual number of bytes written at the location indicated by the bytes parameter. - chars is null. -or- bytes is null. - charCount or byteCount is less than zero. - byteCount is less than the resulting number of bytes. - A fallback occurred (see Character Encoding in the .NET Framework for complete explanation) -and- is set to . - - - When overridden in a derived class, encodes a set of characters from the specified character array into the specified byte array. - The character array containing the set of characters to encode. - The index of the first character to encode. - The number of characters to encode. - The byte array to contain the resulting sequence of bytes. - The index at which to start writing the resulting sequence of bytes. - The actual number of bytes written into bytes. - chars is null. -or- bytes is null. - charIndex or charCount or byteIndex is less than zero. -or- charIndex and charCount do not denote a valid range in chars. -or- byteIndex is not a valid index in bytes. - bytes does not have enough capacity from byteIndex to the end of the array to accommodate the resulting bytes. - A fallback occurred (see Character Encoding in the .NET Framework for complete explanation) -and- is set to . - - - When overridden in a derived class, encodes a set of characters from the specified string into the specified byte array. - The string containing the set of characters to encode. - The index of the first character to encode. - The number of characters to encode. - The byte array to contain the resulting sequence of bytes. - The index at which to start writing the resulting sequence of bytes. - The actual number of bytes written into bytes. - s is null. -or- bytes is null. - charIndex or charCount or byteIndex is less than zero. -or- charIndex and charCount do not denote a valid range in chars. -or- byteIndex is not a valid index in bytes. - bytes does not have enough capacity from byteIndex to the end of the array to accommodate the resulting bytes. - A fallback occurred (see Character Encoding in the .NET Framework for complete explanation) -and- is set to . - - - When overridden in a derived class, calculates the number of characters produced by decoding all the bytes in the specified byte array. - The byte array containing the sequence of bytes to decode. - The number of characters produced by decoding the specified sequence of bytes. - bytes is null. - A fallback occurred (see Character Encoding in the .NET Framework for complete explanation) -and- is set to . - - - When overridden in a derived class, calculates the number of characters produced by decoding a sequence of bytes starting at the specified byte pointer. - A pointer to the first byte to decode. - The number of bytes to decode. - The number of characters produced by decoding the specified sequence of bytes. - bytes is null. - count is less than zero. - A fallback occurred (see Character Encoding in the .NET Framework for complete explanation) -and- is set to . - - - When overridden in a derived class, calculates the number of characters produced by decoding a sequence of bytes from the specified byte array. - The byte array containing the sequence of bytes to decode. - The index of the first byte to decode. - The number of bytes to decode. - The number of characters produced by decoding the specified sequence of bytes. - bytes is null. - index or count is less than zero. -or- index and count do not denote a valid range in bytes. - A fallback occurred (see Character Encoding in the .NET Framework for complete explanation) -and- is set to . - - - When overridden in a derived class, decodes a sequence of bytes from the specified byte array into the specified character array. - The byte array containing the sequence of bytes to decode. - The index of the first byte to decode. - The number of bytes to decode. - The character array to contain the resulting set of characters. - The index at which to start writing the resulting set of characters. - The actual number of characters written into chars. - bytes is null. -or- chars is null. - byteIndex or byteCount or charIndex is less than zero. -or- byteindex and byteCount do not denote a valid range in bytes. -or- charIndex is not a valid index in chars. - chars does not have enough capacity from charIndex to the end of the array to accommodate the resulting characters. - A fallback occurred (see Character Encoding in the .NET Framework for complete explanation) -and- is set to . - - - When overridden in a derived class, decodes a sequence of bytes starting at the specified byte pointer into a set of characters that are stored starting at the specified character pointer. - A pointer to the first byte to decode. - The number of bytes to decode. - A pointer to the location at which to start writing the resulting set of characters. - The maximum number of characters to write. - The actual number of characters written at the location indicated by the chars parameter. - bytes is null. -or- chars is null. - byteCount or charCount is less than zero. - charCount is less than the resulting number of characters. - A fallback occurred (see Character Encoding in the .NET Framework for complete explanation) -and- is set to . - - - When overridden in a derived class, decodes a sequence of bytes from the specified byte array into a set of characters. - The byte array containing the sequence of bytes to decode. - The index of the first byte to decode. - The number of bytes to decode. - A character array containing the results of decoding the specified sequence of bytes. - bytes is null. - index or count is less than zero. -or- index and count do not denote a valid range in bytes. - A fallback occurred (see Character Encoding in the .NET Framework for complete explanation) -and- is set to . - - - When overridden in a derived class, decodes all the bytes in the specified byte array into a set of characters. - The byte array containing the sequence of bytes to decode. - A character array containing the results of decoding the specified sequence of bytes. - bytes is null. - A fallback occurred (see Character Encoding in the .NET Framework for complete explanation) -and- is set to . - - - When overridden in a derived class, obtains a decoder that converts an encoded sequence of bytes into a sequence of characters. - A that converts an encoded sequence of bytes into a sequence of characters. - - - When overridden in a derived class, obtains an encoder that converts a sequence of Unicode characters into an encoded sequence of bytes. - A that converts a sequence of Unicode characters into an encoded sequence of bytes. - - - Returns the encoding associated with the specified code page identifier. - The code page identifier of the preferred encoding. Possible values are listed in the Code Page column of the table that appears in the class topic. -or- 0 (zero), to use the default encoding. - The encoding that is associated with the specified code page. - codepage is less than zero or greater than 65535. - codepage is not supported by the underlying platform. - codepage is not supported by the underlying platform. - - - Returns the encoding associated with the specified code page name. - The code page name of the preferred encoding. Any value returned by the property is valid. Possible values are listed in the Name column of the table that appears in the class topic. - The encoding associated with the specified code page. - name is not a valid code page name. -or- The code page indicated by name is not supported by the underlying platform. - - - Returns the encoding associated with the specified code page identifier. Parameters specify an error handler for characters that cannot be encoded and byte sequences that cannot be decoded. - The code page identifier of the preferred encoding. Possible values are listed in the Code Page column of the table that appears in the class topic. -or- 0 (zero), to use the default encoding. - An object that provides an error-handling procedure when a character cannot be encoded with the current encoding. - An object that provides an error-handling procedure when a byte sequence cannot be decoded with the current encoding. - The encoding that is associated with the specified code page. - codepage is less than zero or greater than 65535. - codepage is not supported by the underlying platform. - codepage is not supported by the underlying platform. - - - Returns the encoding associated with the specified code page name. Parameters specify an error handler for characters that cannot be encoded and byte sequences that cannot be decoded. - The code page name of the preferred encoding. Any value returned by the property is valid. Possible values are listed in the Name column of the table that appears in the class topic. - An object that provides an error-handling procedure when a character cannot be encoded with the current encoding. - An object that provides an error-handling procedure when a byte sequence cannot be decoded with the current encoding. - The encoding that is associated with the specified code page. - name is not a valid code page name. -or- The code page indicated by name is not supported by the underlying platform. - - - Returns an array that contains all encodings. - An array that contains all encodings. - - - Returns the hash code for the current instance. - The hash code for the current instance. - - - When overridden in a derived class, calculates the maximum number of bytes produced by encoding the specified number of characters. - The number of characters to encode. - The maximum number of bytes produced by encoding the specified number of characters. - charCount is less than zero. - A fallback occurred (see Character Encoding in the .NET Framework for complete explanation) -and- is set to . - - - When overridden in a derived class, calculates the maximum number of characters produced by decoding the specified number of bytes. - The number of bytes to decode. - The maximum number of characters produced by decoding the specified number of bytes. - byteCount is less than zero. - A fallback occurred (see Character Encoding in the .NET Framework for complete explanation) -and- is set to . - - - When overridden in a derived class, returns a sequence of bytes that specifies the encoding used. - A byte array containing a sequence of bytes that specifies the encoding used. -or- A byte array of length zero, if a preamble is not required. - - - When overridden in a derived class, decodes all the bytes in the specified byte array into a string. - The byte array containing the sequence of bytes to decode. - A string that contains the results of decoding the specified sequence of bytes. - The byte array contains invalid Unicode code points. - bytes is null. - A fallback occurred (see Character Encoding in the .NET Framework for complete explanation) -and- is set to . - - - When overridden in a derived class, decodes a specified number of bytes starting at a specified address into a string. - A pointer to a byte array. - The number of bytes to decode. - A string that contains the results of decoding the specified sequence of bytes. - bytes is a null pointer. - byteCount is less than zero. - A fallback occurred (see Character Encoding in the .NET Framework for a complete explanation) -and- is set to . - - - When overridden in a derived class, decodes a sequence of bytes from the specified byte array into a string. - The byte array containing the sequence of bytes to decode. - The index of the first byte to decode. - The number of bytes to decode. - A string that contains the results of decoding the specified sequence of bytes. - The byte array contains invalid Unicode code points. - bytes is null. - index or count is less than zero. -or- index and count do not denote a valid range in bytes. - A fallback occurred (see Character Encoding in the .NET Framework for complete explanation) -and- is set to . - - - When overridden in a derived class, gets a name for the current encoding that can be used with mail agent header tags. - A name for the current to use with mail agent header tags. -or- An empty string (""), if the current cannot be used. - - - Gets a value indicating whether the current encoding is always normalized, using the default normalization form. - true if the current is always normalized; otherwise, false. The default is false. - - - When overridden in a derived class, gets a value indicating whether the current encoding is always normalized, using the specified normalization form. - One of the values. - true if the current object is always normalized using the specified value; otherwise, false. The default is false. - - - When overridden in a derived class, gets a value indicating whether the current encoding can be used by browser clients for displaying content. - true if the current can be used by browser clients for displaying content; otherwise, false. - - - When overridden in a derived class, gets a value indicating whether the current encoding can be used by browser clients for saving content. - true if the current can be used by browser clients for saving content; otherwise, false. - - - When overridden in a derived class, gets a value indicating whether the current encoding can be used by mail and news clients for displaying content. - true if the current can be used by mail and news clients for displaying content; otherwise, false. - - - When overridden in a derived class, gets a value indicating whether the current encoding can be used by mail and news clients for saving content. - true if the current can be used by mail and news clients for saving content; otherwise, false. - - - When overridden in a derived class, gets a value indicating whether the current encoding is read-only. - true if the current is read-only; otherwise, false. The default is true. - - - When overridden in a derived class, gets a value indicating whether the current encoding uses single-byte code points. - true if the current uses single-byte code points; otherwise, false. - - - Registers an encoding provider. - A subclass of that provides access to additional character encodings. - provider is null. - - - Gets an encoding for the UTF-16 format using the little endian byte order. - An encoding for the UTF-16 format using the little endian byte order. - - - Gets an encoding for the UTF-32 format using the little endian byte order. - An encoding object for the UTF-32 format using the little endian byte order. - - - Gets an encoding for the UTF-7 format. - An encoding for the UTF-7 format. - - - Gets an encoding for the UTF-8 format. - An encoding for the UTF-8 format. - - - When overridden in a derived class, gets the name registered with the Internet Assigned Numbers Authority (IANA) for the current encoding. - The IANA name for the current . - - - When overridden in a derived class, gets the Windows operating system code page that most closely corresponds to the current encoding. - The Windows operating system code page that most closely corresponds to the current . - - - Provides basic information about an encoding. - - - Gets the code page identifier of the encoding. - The code page identifier of the encoding. - - - Gets the human-readable description of the encoding. - The human-readable description of the encoding. - - - Gets a value indicating whether the specified object is equal to the current object. - An object to compare to the current object. - true if value is a object and is equal to the current object; otherwise, false. - - - Returns a object that corresponds to the current object. - A object that corresponds to the current object. - - - Returns the hash code for the current object. - A 32-bit signed integer hash code. - - - Gets the name registered with the Internet Assigned Numbers Authority (IANA) for the encoding. - The IANA name for the encoding. For more information about the IANA, see www.iana.org. - - - Provides the base class for an encoding provider, which supplies encodings that are unavailable on a particular platform. - - - Initializes a new instance of the class. - - - Returns the encoding associated with the specified code page identifier. - The code page identifier of the requested encoding. - The encoding that is associated with the specified code page, or null if this cannot return a valid encoding that corresponds to codepage. - - - Returns the encoding with the specified name. - The name of the requested encoding. - The encoding that is associated with the specified name, or null if this cannot return a valid encoding that corresponds to name. - - - Returns the encoding associated with the specified code page identifier. Parameters specify an error handler for characters that cannot be encoded and byte sequences that cannot be decoded. - The code page identifier of the requested encoding. - An object that provides an error-handling procedure when a character cannot be encoded with this encoding. - An object that provides an error-handling procedure when a byte sequence cannot be decoded with this encoding. - The encoding that is associated with the specified code page, or null if this cannot return a valid encoding that corresponds to codepage. - - - Returns the encoding associated with the specified name. Parameters specify an error handler for characters that cannot be encoded and byte sequences that cannot be decoded. - The name of the preferred encoding. - An object that provides an error-handling procedure when a character cannot be encoded with this encoding. - An object that provides an error-handling procedure when a byte sequence cannot be decoded with the current encoding. - The encoding that is associated with the specified name, or null if this cannot return a valid encoding that corresponds to name. - - - Defines the type of normalization to perform. - - - Indicates that a Unicode string is normalized using full canonical decomposition, followed by the replacement of sequences with their primary composites, if possible. - - - - Indicates that a Unicode string is normalized using full canonical decomposition. - - - - Indicates that a Unicode string is normalized using full compatibility decomposition, followed by the replacement of sequences with their primary composites, if possible. - - - - Indicates that a Unicode string is normalized using full compatibility decomposition. - - - - Represents the results from a single successful subexpression capture. - - - The position in the original string where the first character of the captured substring is found. - The zero-based starting position in the original string where the captured substring is found. - - - Gets the length of the captured substring. - The length of the captured substring. - - - Retrieves the captured substring from the input string by calling the property. - The substring that was captured by the match. - - - Gets the captured substring from the input string. - The substring that is captured by the match. - - - Represents the set of captures made by a single capturing group. - - - Copies all the elements of the collection to the given array beginning at the given index. - The array the collection is to be copied into. - The position in the destination array where copying is to begin. - array is null. - arrayIndex is outside the bounds of array. -or- arrayIndex plus is outside the bounds of array. - - - Gets the number of substrings captured by the group. - The number of items in the . - - - Provides an enumerator that iterates through the collection. - An object that contains all objects within the . - - - Gets a value that indicates whether the collection is read only. - true in all cases. - - - Gets a value that indicates whether access to the collection is synchronized (thread-safe). - false in all cases. - - - Gets an individual member of the collection. - Index into the capture collection. - The captured substring at position i in the collection. - i is less than 0 or greater than . - - - Gets an object that can be used to synchronize access to the collection. - An object that can be used to synchronize access to the collection. - - - Defines a command. - - - Defines the method that determines whether the command can execute in its current state. - Data used by the command. If the command does not require data to be passed, this object can be set to null. - true if this command can be executed; otherwise, false. - - - Occurs when changes occur that affect whether or not the command should execute. - - - - Defines the method to be called when the command is invoked. - Data used by the command. If the command does not require data to be passed, this object can be set to null. - - - Specifies the amount of input or output checking that and objects perform. - - - The or object automatically detects whether document-level or fragment-level checking should be performed, and does the appropriate checking. If you're wrapping another or object, the outer object doesn't do any additional conformance checking. Conformance checking is left up to the underlying object. See the and properties for details on how the compliance level is determined. - - - - The XML data complies with the rules for a well-formed XML 1.0 document, as defined by the W3C. - - - - The XML data is a well-formed XML fragment, as defined by the W3C. - - - - Specifies the options for processing DTDs. The enumeration is used by the class. - - - Causes the DOCTYPE element to be ignored. No DTD processing occurs. - - - - Used for parsing DTDs. - - - - Specifies that when a DTD is encountered, an is thrown with a message that states that DTDs are prohibited. This is the default behavior. - - - - Specifies how the or handle entities. - - - Expands character entities and returns general entities as nodes. - - - - Expands all entities and returns the expanded nodes. - - - - Specifies formatting options for the . - - - Causes child elements to be indented according to the and settings. - - - - No special formatting is applied. This is the default. - - - - Contains properties and methods that when implemented by a , allows processing of XML fragments. - - - Gets a value that indicates whether this can process XML fragments. - true if this can process XML fragments; otherwise, false. - - - Ends the processing of an XML fragment. - - - Starts the processing of an XML fragment. - The stream to write to. - If true, any namespaces declared outside the fragment is declared again if used inside of it; if false the namespaces are not declared again. - - - Writes an XML fragment to the underlying stream of the writer. - The buffer to write to. - The starting position from which to write in buffer. - The number of bytes to be written to the buffer. - - - Enables a class to return an from the current context or position. - - - Returns the for the current position. - The XmlNode for the current position. - - - Represents an interface that can be implemented by classes providing streams. - - - Gets a stream. - A object. - - - Releases a stream to output. - The stream being released. - - - Provides methods for reinitializing a binary reader to read a new document. - - - Reinitializes the binary reader using the given input stream. - The stream from which to read. - to use. - to apply. - to use. - Delegate to call when the reader is closed. - - - Reinitializes the binary reader using the given input buffer. - The buffer from which to read. - Starting position from which to read in buffer. - Number of bytes that can be read from buffer. - to use. - to apply. - to use. - Delegate to call when the reader is closed. - - - Specifies implementation requirements for XML binary writers that derive from this interface. - - - Specifies initialization requirements for XML binary writers that implement this method. - The stream to write to. - The to use. - The to use. - If true, stream is closed by the writer when done; otherwise false. - - - An interface that defines the contract that an Xml dictionary must implement to be used by and implementations. - - - Attempts to look up an entry in the dictionary. - Key to look up. - If key is defined, the that is mapped to the key; otherwise null. - true if key is in the dictionary, otherwise false. - - - Checks the dictionary for a specified string value. - String value being checked for. - The corresponding , if found; otherwise null. - true if value is in the dictionary, otherwise false. - - - Checks the dictionary for a specified . - The being checked for. - The matching , if found; otherwise null. - true if is in the dictionary, otherwise false. - - - Provides an interface to enable a class to return line and position information. - - - Gets a value indicating whether the class can return line information. - true if and can be provided; otherwise, false. - - - Gets the current line number. - The current line number or 0 if no line information is available (for example, returns false). - - - Gets the current line position. - The current line position or 0 if no line information is available (for example, returns false). - - - Provides read-only access to a set of prefix and namespace mappings. - - - Gets a collection of defined prefix-namespace mappings that are currently in scope. - An value that specifies the type of namespace nodes to return. - An that contains the current in-scope namespaces. - - - Gets the namespace URI mapped to the specified prefix. - The prefix whose namespace URI you wish to find. - The namespace URI that is mapped to the prefix; null if the prefix is not mapped to a namespace URI. - - - Gets the prefix that is mapped to the specified namespace URI. - The namespace URI whose prefix you wish to find. - The prefix that is mapped to the namespace URI; null if the namespace URI is not mapped to a prefix. - - - Specifies implementation requirements for XML text readers that derive from this interface. - - - Specifies initialization requirements for XML text readers that read a stream. - The stream from which to read. - The character encoding of the stream. - The to apply. - The delegate to be called when the reader is closed. - - - Specifies initialization requirements for XML text readers that read a buffer. - The buffer from which to read. - The starting position from which to read in buffer. - The number of bytes that can be read from buffer. - The character encoding of the stream. - The to apply. - The delegate to be called when the reader is closed. - - - Specifies implementation requirements for XML text writers that derive from this interface. - - - Specifies initialization requirements for XML text writers that implement this method. - The stream to write to. - The character encoding of the stream. - If true, stream is closed by the writer when done; otherwise false. - - - Contains the LINQ to XML extension methods. - - - Returns a collection of elements that contains the ancestors of every node in the source collection. - An of that contains the source collection. - The type of the objects in source, constrained to . - An of that contains the ancestors of every node in the source collection. - - - Returns a filtered collection of elements that contains the ancestors of every node in the source collection. Only elements that have a matching are included in the collection. - An of that contains the source collection. - The to match. - The type of the objects in source, constrained to . - An of that contains the ancestors of every node in the source collection. Only elements that have a matching are included in the collection. - - - Returns a collection of elements that contains every element in the source collection, and the ancestors of every element in the source collection. - An of that contains the source collection. - An of that contains every element in the source collection, and the ancestors of every element in the source collection. - - - Returns a filtered collection of elements that contains every element in the source collection, and the ancestors of every element in the source collection. Only elements that have a matching are included in the collection. - An of that contains the source collection. - The to match. - An of that contains every element in the source collection, and the ancestors of every element in the source collection. Only elements that have a matching are included in the collection. - - - Returns a collection of the attributes of every element in the source collection. - An of that contains the source collection. - An of that contains the attributes of every element in the source collection. - - - Returns a filtered collection of the attributes of every element in the source collection. Only elements that have a matching are included in the collection. - An of that contains the source collection. - The to match. - An of that contains a filtered collection of the attributes of every element in the source collection. Only elements that have a matching are included in the collection. - - - Returns a collection of the descendant nodes of every document and element in the source collection. - An of that contains the source collection. - The type of the objects in source, constrained to . - An of of the descendant nodes of every document and element in the source collection. - - - Returns a collection of nodes that contains every element in the source collection, and the descendant nodes of every element in the source collection. - An of that contains the source collection. - An of that contains every element in the source collection, and the descendant nodes of every element in the source collection. - - - Returns a filtered collection of elements that contains the descendant elements of every element and document in the source collection. Only elements that have a matching are included in the collection. - An of that contains the source collection. - The to match. - The type of the objects in source, constrained to . - An of that contains the descendant elements of every element and document in the source collection. Only elements that have a matching are included in the collection. - - - Returns a collection of elements that contains the descendant elements of every element and document in the source collection. - An of that contains the source collection. - The type of the objects in source, constrained to . - An of that contains the descendant elements of every element and document in the source collection. - - - Returns a collection of elements that contains every element in the source collection, and the descendent elements of every element in the source collection. - An of that contains the source collection. - An of that contains every element in the source collection, and the descendent elements of every element in the source collection. - - - Returns a filtered collection of elements that contains every element in the source collection, and the descendents of every element in the source collection. Only elements that have a matching are included in the collection. - An of that contains the source collection. - The to match. - An of that contains every element in the source collection, and the descendents of every element in the source collection. Only elements that have a matching are included in the collection. - - - Returns a collection of the child elements of every element and document in the source collection. - An of that contains the source collection. - The type of the objects in source, constrained to . - An of of the child elements of every element or document in the source collection. - - - Returns a filtered collection of the child elements of every element and document in the source collection. Only elements that have a matching are included in the collection. - An of that contains the source collection. - The to match. - The type of the objects in source, constrained to . - An of of the child elements of every element and document in the source collection. Only elements that have a matching are included in the collection. - - - Returns a collection of nodes that contains all nodes in the source collection, sorted in document order. - An of that contains the source collection. - The type of the objects in source, constrained to . - An of that contains all nodes in the source collection, sorted in document order. - - - Returns a collection of the child nodes of every document and element in the source collection. - An of that contains the source collection. - The type of the objects in source, constrained to . - An of of the child nodes of every document and element in the source collection. - - - Removes every attribute in the source collection from its parent element. - An of that contains the source collection. - - - Removes every node in the source collection from its parent node. - An of that contains the source collection. - The type of the objects in source, constrained to . - - - Specifies load options when parsing XML. - - - Does not preserve insignificant white space or load base URI and line information. - - - - Preserves insignificant white space while parsing. - - - - Requests the base URI information from the , and makes it available via the property. - - - - Requests the line information from the and makes it available via properties on . - - - - Specifies whether to omit duplicate namespaces when loading an with an . - - - No reader options specified. - - - - Omit duplicate namespaces when loading the . - - - - Specifies serialization options. - - - Preserve all insignificant white space while serializing. - - - - Format (indent) the XML while serializing. - - - - Remove the duplicate namespace declarations while serializing. - - - - Represents an XML attribute. - - - Initializes a new instance of the class from another object. - An object to copy from. - The other parameter is null. - - - Initializes a new instance of the class from the specified name and value. - The of the attribute. - An containing the value of the attribute. - The name or value parameter is null. - - - Gets an empty collection of attributes. - An of containing an empty collection. - - - Determines if this attribute is a namespace declaration. - true if this attribute is a namespace declaration; otherwise false. - - - Gets the expanded name of this attribute. - An containing the name of this attribute. - - - Gets the next attribute of the parent element. - An containing the next attribute of the parent element. - - - Gets the node type for this node. - The node type. For objects, this value is . - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Gets the previous attribute of the parent element. - An containing the previous attribute of the parent element. - - - Removes this attribute from its parent element. - The parent element is null. - - - Sets the value of this attribute. - The value to assign to this attribute. - The value parameter is null. - The value is an . - - - Converts the current object to a string representation. - A containing the XML text representation of an attribute and its value. - - - Gets or sets the value of this attribute. - A containing the value of this attribute. - When setting, the value is null. - - - Represents a text node that contains CDATA. - - - Initializes a new instance of the class. - A string that contains the value of the node. - - - Initializes a new instance of the class. - The node to copy from. - - - Gets the node type for this node. - The node type. For objects, this value is . - - - Writes this CDATA object to an . - An into which this method will write. - - - Represents a collection of key/value pairs that are organized based on the hash code of the key. - - - Initializes a new, empty instance of the class using the default initial capacity, load factor, hash code provider, and comparer. - - - Initializes a new, empty instance of the class using the specified initial capacity, load factor, hash code provider, and comparer. - The approximate number of elements that the object can initially contain. - A number in the range from 0.1 through 1.0 that is multiplied by the default value which provides the best performance. The result is the maximum ratio of elements to buckets. - The object that supplies the hash codes for all keys in the . -or- null to use the default hash code provider, which is each key's implementation of . - The object to use to determine whether two keys are equal. -or- null to use the default comparer, which is each key's implementation of . - capacity is less than zero. -or- loadFactor is less than 0.1. -or- loadFactor is greater than 1.0. - - - Initializes a new instance of the class by copying the elements from the specified dictionary to the new object. The new object has an initial capacity equal to the number of elements copied, and uses the specified load factor, hash code provider, and comparer. - The object to copy to a new object. - A number in the range from 0.1 through 1.0 that is multiplied by the default value which provides the best performance. The result is the maximum ratio of elements to buckets. - The object that supplies the hash codes for all keys in the . -or- null to use the default hash code provider, which is each key's implementation of . - The object to use to determine whether two keys are equal. -or- null to use the default comparer, which is each key's implementation of . - d is null. - loadFactor is less than 0.1. -or- loadFactor is greater than 1.0. - - - Initializes a new, empty instance of the class using the specified initial capacity, load factor, and object. - The approximate number of elements that the object can initially contain. - A number in the range from 0.1 through 1.0 that is multiplied by the default value which provides the best performance. The result is the maximum ratio of elements to buckets. - The object that defines the hash code provider and the comparer to use with the . -or- null to use the default hash code provider and the default comparer. The default hash code provider is each key's implementation of and the default comparer is each key's implementation of . - capacity is less than zero. -or- loadFactor is less than 0.1. -or- loadFactor is greater than 1.0. - - - Initializes a new, empty instance of the class using the specified initial capacity, hash code provider, comparer, and the default load factor. - The approximate number of elements that the object can initially contain. - The object that supplies the hash codes for all keys in the . -or- null to use the default hash code provider, which is each key's implementation of . - The object to use to determine whether two keys are equal. -or- null to use the default comparer, which is each key's implementation of . - capacity is less than zero. - - - Initializes a new instance of the class by copying the elements from the specified dictionary to the new object. The new object has an initial capacity equal to the number of elements copied, and uses the specified load factor and object. - The object to copy to a new object. - A number in the range from 0.1 through 1.0 that is multiplied by the default value which provides the best performance. The result is the maximum ratio of elements to buckets. - The object that defines the hash code provider and the comparer to use with the . -or- null to use the default hash code provider and the default comparer. The default hash code provider is each key's implementation of and the default comparer is each key's implementation of . - d is null. - loadFactor is less than 0.1. -or- loadFactor is greater than 1.0. - - - Initializes a new instance of the class by copying the elements from the specified dictionary to the new object. The new object has an initial capacity equal to the number of elements copied, and uses the default load factor, and the specified hash code provider and comparer. This API is obsolete. For an alternative, see . - The object to copy to a new object. - The object that supplies the hash codes for all keys in the . -or- null to use the default hash code provider, which is each key's implementation of . - The object to use to determine whether two keys are equal. -or- null to use the default comparer, which is each key's implementation of . - d is null. - - - Initializes a new, empty instance of the class using the specified initial capacity and load factor, and the default hash code provider and comparer. - The approximate number of elements that the object can initially contain. - A number in the range from 0.1 through 1.0 that is multiplied by the default value which provides the best performance. The result is the maximum ratio of elements to buckets. - capacity is less than zero. -or- loadFactor is less than 0.1. -or- loadFactor is greater than 1.0. - capacity is causing an overflow. - - - Initializes a new, empty instance of the class that is serializable using the specified and objects. - A object containing the information required to serialize the object. - A object containing the source and destination of the serialized stream associated with the . - info is null. - - - Initializes a new, empty instance of the class using the default initial capacity and load factor, and the specified hash code provider and comparer. - The object that supplies the hash codes for all keys in the object. -or- null to use the default hash code provider, which is each key's implementation of . - The object to use to determine whether two keys are equal. -or- null to use the default comparer, which is each key's implementation of . - - - Initializes a new instance of the class by copying the elements from the specified dictionary to the new object. The new object has an initial capacity equal to the number of elements copied, and uses the specified load factor, and the default hash code provider and comparer. - The object to copy to a new object. - A number in the range from 0.1 through 1.0 that is multiplied by the default value which provides the best performance. The result is the maximum ratio of elements to buckets. - d is null. - loadFactor is less than 0.1. -or- loadFactor is greater than 1.0. - - - Initializes a new instance of the class by copying the elements from the specified dictionary to a new object. The new object has an initial capacity equal to the number of elements copied, and uses the default load factor and the specified object. - The object to copy to a new object. - The object that defines the hash code provider and the comparer to use with the . -or- null to use the default hash code provider and the default comparer. The default hash code provider is each key's implementation of and the default comparer is each key's implementation of . - d is null. - - - Initializes a new, empty instance of the class using the specified initial capacity, and the default load factor, hash code provider, and comparer. - The approximate number of elements that the object can initially contain. - capacity is less than zero. - - - Initializes a new, empty instance of the class using the default initial capacity and load factor, and the specified object. - The object that defines the hash code provider and the comparer to use with the object. -or- null to use the default hash code provider and the default comparer. The default hash code provider is each key's implementation of and the default comparer is each key's implementation of . - - - Initializes a new instance of the class by copying the elements from the specified dictionary to the new object. The new object has an initial capacity equal to the number of elements copied, and uses the default load factor, hash code provider, and comparer. - The object to copy to a new object. - d is null. - - - Initializes a new, empty instance of the class using the specified initial capacity and , and the default load factor. - The approximate number of elements that the object can initially contain. - The object that defines the hash code provider and the comparer to use with the . -or- null to use the default hash code provider and the default comparer. The default hash code provider is each key's implementation of and the default comparer is each key's implementation of . - capacity is less than zero. - - - Adds an element with the specified key and value into the . - The key of the element to add. - The value of the element to add. The value can be null. - key is null. - An element with the same key already exists in the . - The is read-only. -or- The has a fixed size. - - - Removes all elements from the . - The is read-only. - - - Creates a shallow copy of the . - A shallow copy of the . - - - Gets or sets the to use for the . - The to use for the . - The property is set to a value, but the hash table was created using an . - - - Determines whether the contains a specific key. - The key to locate in the . - true if the contains an element with the specified key; otherwise, false. - key is null. - - - Determines whether the contains a specific key. - The key to locate in the . - true if the contains an element with the specified key; otherwise, false. - key is null. - - - Determines whether the contains a specific value. - The value to locate in the . The value can be null. - true if the contains an element with the specified value; otherwise, false. - - - Copies the elements to a one-dimensional instance at the specified index. - The one-dimensional that is the destination of the objects copied from . The must have zero-based indexing. - The zero-based index in array at which copying begins. - array is null. - arrayIndex is less than zero. - array is multidimensional. -or- The number of elements in the source is greater than the available space from arrayIndex to the end of the destination array. - The type of the source cannot be cast automatically to the type of the destination array. - - - Gets the number of key/value pairs contained in the . - The number of key/value pairs contained in the . - - - Gets the to use for the . - The to use for the . - The property is set to a value, but the hash table was created using an and an . - - - Returns an that iterates through the . - An for the . - - - Returns the hash code for the specified key. - The for which a hash code is to be returned. - The hash code for key. - key is null. - - - Implements the interface and returns the data needed to serialize the . - A object containing the information required to serialize the . - A object containing the source and destination of the serialized stream associated with the . - info is null. - The collection was modified. - - - Gets or sets the object that can dispense hash codes. - The object that can dispense hash codes. - The property is set to a value, but the hash table was created using an . - - - Gets a value indicating whether the has a fixed size. - true if the has a fixed size; otherwise, false. The default is false. - - - Gets a value indicating whether the is read-only. - true if the is read-only; otherwise, false. The default is false. - - - Gets a value indicating whether access to the is synchronized (thread safe). - true if access to the is synchronized (thread safe); otherwise, false. The default is false. - - - Gets or sets the value associated with the specified key. - The key whose value to get or set. - The value associated with the specified key. If the specified key is not found, attempting to get it returns null, and attempting to set it creates a new element using the specified key. - key is null. - The property is set and the is read-only. -or- The property is set, key does not exist in the collection, and the has a fixed size. - - - Compares a specific with a specific key in the . - The to compare with key. - The key in the to compare with item. - true if item and key are equal; otherwise, false. - item is null. -or- key is null. - - - Gets an containing the keys in the . - An containing the keys in the . - - - Implements the interface and raises the deserialization event when the deserialization is complete. - The source of the deserialization event. - The object associated with the current is invalid. - - - Removes the element with the specified key from the . - The key of the element to remove. - key is null. - The is read-only. -or- The has a fixed size. - - - Returns a synchronized (thread-safe) wrapper for the . - The to synchronize. - A synchronized (thread-safe) wrapper for the . - table is null. - - - Gets an object that can be used to synchronize access to the . - An object that can be used to synchronize access to the . - - - Gets an containing the values in the . - An containing the values in the . - - - Returns an enumerator that iterates through a collection. - An that can be used to iterate through the collection. - - - Defines size, enumerators, and synchronization methods for all nongeneric collections. - - - Copies the elements of the to an , starting at a particular index. - The one-dimensional that is the destination of the elements copied from . The must have zero-based indexing. - The zero-based index in array at which copying begins. - array is null. - index is less than zero. - array is multidimensional. -or- The number of elements in the source is greater than the available space from index to the end of the destination array. -or- The type of the source cannot be cast automatically to the type of the destination array. - - - Gets the number of elements contained in the . - The number of elements contained in the . - - - Gets a value indicating whether access to the is synchronized (thread safe). - true if access to the is synchronized (thread safe); otherwise, false. - - - Gets an object that can be used to synchronize access to the . - An object that can be used to synchronize access to the . - - - Exposes a method that compares two objects. - - - Compares two objects and returns a value indicating whether one is less than, equal to, or greater than the other. - The first object to compare. - The second object to compare. -

A signed integer that indicates the relative values of x and y, as shown in the following table.

-
Value

-

Meaning

-

Less than zero

-

x is less than y.

-

Zero

-

x equals y.

-

Greater than zero

-

x is greater than y.

-

-
- Neither x nor y implements the interface. -or- x and y are of different types and neither one can handle comparisons with the other. -
- - Represents a nongeneric collection of key/value pairs. - - - Adds an element with the provided key and value to the object. - The to use as the key of the element to add. - The to use as the value of the element to add. - key is null. - An element with the same key already exists in the object. - The is read-only. -or- The has a fixed size. - - - Removes all elements from the object. - The object is read-only. - - - Determines whether the object contains an element with the specified key. - The key to locate in the object. - true if the contains an element with the key; otherwise, false. - key is null. - - - Returns an object for the object. - An object for the object. - - - Gets a value indicating whether the object has a fixed size. - true if the object has a fixed size; otherwise, false. - - - Gets a value indicating whether the object is read-only. - true if the object is read-only; otherwise, false. - - - Gets or sets the element with the specified key. - The key of the element to get or set. - The element with the specified key, or null if the key does not exist. - key is null. - The property is set and the object is read-only. -or- The property is set, key does not exist in the collection, and the has a fixed size. - - - Gets an object containing the keys of the object. - An object containing the keys of the object. - - - Removes the element with the specified key from the object. - The key of the element to remove. - key is null. - The object is read-only. -or- The has a fixed size. - - - Gets an object containing the values in the object. - An object containing the values in the object. - - - Enumerates the elements of a nongeneric dictionary. - - - Gets both the key and the value of the current dictionary entry. - A containing both the key and the value of the current dictionary entry. - The is positioned before the first entry of the dictionary or after the last entry. - - - Gets the key of the current dictionary entry. - The key of the current element of the enumeration. - The is positioned before the first entry of the dictionary or after the last entry. - - - Gets the value of the current dictionary entry. - The value of the current element of the enumeration. - The is positioned before the first entry of the dictionary or after the last entry. - - - Exposes an enumerator, which supports a simple iteration over a non-generic collection. - - - Returns an enumerator that iterates through a collection. - An object that can be used to iterate through the collection. - - - Supports a simple iteration over a non-generic collection. - - - Gets the element in the collection at the current position of the enumerator. - The element in the collection at the current position of the enumerator. - - - Advances the enumerator to the next element of the collection. - true if the enumerator was successfully advanced to the next element; false if the enumerator has passed the end of the collection. - The collection was modified after the enumerator was created. - - - Sets the enumerator to its initial position, which is before the first element in the collection. - The collection was modified after the enumerator was created. - - - Defines methods to support the comparison of objects for equality. - - - Determines whether the specified objects are equal. - The first object to compare. - The second object to compare. - true if the specified objects are equal; otherwise, false. - x and y are of different types and neither one can handle comparisons with the other. - - - Returns a hash code for the specified object. - The for which a hash code is to be returned. - A hash code for the specified object. - The type of obj is a reference type and obj is null. - - - Supplies a hash code for an object, using a custom hash function. - - - Returns a hash code for the specified object. - The for which a hash code is to be returned. - A hash code for the specified object. - The type of obj is a reference type and obj is null. - - - Represents a non-generic collection of objects that can be individually accessed by index. - - - Adds an item to the . - The object to add to the . - The position into which the new element was inserted, or -1 to indicate that the item was not inserted into the collection. - The is read-only. -or- The has a fixed size. - - - Removes all items from the . - The is read-only. - - - Determines whether the contains a specific value. - The object to locate in the . - true if the is found in the ; otherwise, false. - - - Determines the index of a specific item in the . - The object to locate in the . - The index of value if found in the list; otherwise, -1. - - - Inserts an item to the at the specified index. - The zero-based index at which value should be inserted. - The object to insert into the . - index is not a valid index in the . - The is read-only. -or- The has a fixed size. - value is null reference in the . - - - Gets a value indicating whether the has a fixed size. - true if the has a fixed size; otherwise, false. - - - Gets a value indicating whether the is read-only. - true if the is read-only; otherwise, false. - - - Gets or sets the element at the specified index. - The zero-based index of the element to get or set. - The element at the specified index. - index is not a valid index in the . - The property is set and the is read-only. - - - Removes the first occurrence of a specific object from the . - The object to remove from the . - The is read-only. -or- The has a fixed size. - - - Removes the item at the specified index. - The zero-based index of the item to remove. - index is not a valid index in the . - The is read-only. -or- The has a fixed size. - - - Provides data for the event. - - - Initializes a new instance of the class. - The name of the property that has an error. null or if the error is object-level. - - - Gets the name of the property that has an error. - The name of the property that has an error. null or if the error is object-level. - - - Identifies a type as an object suitable for binding to an object. This class cannot be inherited. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class and indicates whether an object is suitable for binding to an object. - true if the object is suitable for binding to an object; otherwise, false. - - - Indicates that the class is suitable for binding to an object at design time. This field is read-only. - - - - Represents the default value of the class, which indicates that the class is suitable for binding to an object at design time. This field is read-only. - - - - Determines whether this instance of fits the pattern of another object. - An object to compare with this instance of . - true if this instance is the same as the instance specified by the obj parameter; otherwise, false. - - - Returns the hash code for this instance. - A 32-bit signed integer hash code. - - - Gets a value indicating whether an object should be considered suitable for binding to an object at design time. - true if the object should be considered suitable for binding to an object; otherwise, false. - - - Gets a value indicating whether the current value of the attribute is the default value for the attribute. - true if the current value of the attribute is the default; otherwise, false. - - - Indicates that the class is not suitable for binding to an object at design time. This field is read-only. - - - - Provides metadata for a property representing a data field. This class cannot be inherited. - - - Initializes a new instance of the class and indicates whether the field is the primary key for the data row. - true to indicate that the field is in the primary key of the data row; otherwise, false. - - - Initializes a new instance of the class and indicates whether the field is the primary key for the data row, and whether the field is a database identity field. - true to indicate that the field is in the primary key of the data row; otherwise, false. - true to indicate that the field is an identity field that uniquely identifies the data row; otherwise, false. - - - Initializes a new instance of the class and indicates whether the field is the primary key for the data row, whether the field is a database identity field, and whether the field can be null. - true to indicate that the field is in the primary key of the data row; otherwise, false. - true to indicate that the field is an identity field that uniquely identifies the data row; otherwise, false. - true to indicate that the field can be null in the data store; otherwise, false. - - - Initializes a new instance of the class and indicates whether the field is the primary key for the data row, whether it is a database identity field, and whether it can be null and sets the length of the field. - true to indicate that the field is in the primary key of the data row; otherwise, false. - true to indicate that the field is an identity field that uniquely identifies the data row; otherwise, false. - true to indicate that the field can be null in the data store; otherwise, false. - The length of the field in bytes. - - - Returns a value indicating whether this instance is equal to a specified object. - An object to compare with this instance of . - true if this instance is the same as the instance specified by the obj parameter; otherwise, false. - - - Returns the hash code for this instance. - A 32-bit signed integer hash code. - - - Gets a value indicating whether a property represents an identity field in the underlying data. - true if the property represents an identity field in the underlying data; otherwise, false. The default value is false. - - - Gets a value indicating whether a property represents a field that can be null in the underlying data store. - true if the property represents a field that can be null in the underlying data store; otherwise, false. - - - Gets the length of the property in bytes. - The length of the property in bytes, or -1 if not set. - - - Gets a value indicating whether a property is in the primary key in the underlying data. - true if the property is in the primary key of the data store; otherwise, false. - - - Identifies a data operation method exposed by a type, what type of operation the method performs, and whether the method is the default data method. This class cannot be inherited. - - - Initializes a new instance of the class and identifies the type of data operation the method performs. - One of the values that describes the data operation the method performs. - - - Initializes a new instance of the class, identifies the type of data operation the method performs, and identifies whether the method is the default data method that the data object exposes. - One of the values that describes the data operation the method performs. - true to indicate the method that the attribute is applied to is the default method of the data object for the specified methodType; otherwise, false. - - - Returns a value indicating whether this instance is equal to a specified object. - An object to compare with this instance of . - true if this instance is the same as the instance specified by the obj parameter; otherwise, false. - - - Returns the hash code for this instance. - A 32-bit signed integer hash code. - - - Gets a value indicating whether the method that the is applied to is the default data method exposed by the data object for a specific method type. - true if the method is the default method exposed by the object for a method type; otherwise, false. - - - Gets a value indicating whether this instance shares a common pattern with a specified attribute. - An object to compare with this instance of . - true if this instance is the same as the instance specified by the obj parameter; otherwise, false. - - - Gets a value indicating the type of data operation the method performs. - One of the values that identifies the type of data operation performed by the method to which the is applied. - - - Identifies the type of data operation performed by a method, as specified by the applied to the method. - - - Indicates that a method is used for a data operation that deletes data. - - - - Indicates that a method is used for a data operation that fills a object. - - - - Indicates that a method is used for a data operation that inserts data. - - - - Indicates that a method is used for a data operation that retrieves data. - - - - Indicates that a method is used for a data operation that updates data. - - - - Provides a type converter to convert objects to and from various other representations. - - - Initializes a new instance of the class. - - - Gets a value indicating whether this converter can convert an object in the given source type to a using the specified context. - An that provides a format context. - A that represents the type you wish to convert from. - true if this object can perform the conversion; otherwise, false. - - - Gets a value indicating whether this converter can convert an object to the given destination type using the context. - An that provides a format context. - A that represents the type you wish to convert to. - true if this converter can perform the conversion; otherwise, false. - - - Converts the given value object to a . - An that provides a format context. - An optional . If not supplied, the current culture is assumed. - The to convert. - An that represents the converted value. - value is not a valid value for the target type. - The conversion cannot be performed. - - - Converts the given value object to a using the arguments. - An that provides a format context. - An optional . If not supplied, the current culture is assumed. - The to convert. - The to convert the value to. - An that represents the converted value. - The conversion cannot be performed. - - - Provides a type converter to convert structures to and from various other representations. - - - Initializes a new instance of the class. - - - Returns a value that indicates whether an object of the specified source type can be converted to a . - The date format context. - The source type to check. - true if the specified type can be converted to a ; otherwise, false. - - - Returns a value that indicates whether a can be converted to an object of the specified type. - The date format context. - The destination type to check. - true if a can be converted to the specified type; otherwise, false. - - - Converts the specified object to a . - The date format context. - The date culture. - The object to be converted. - A that represents the specified object. - The conversion cannot be performed. - - - Converts a to an object of the specified type. - The date format context. - The date culture. - The to be converted. - The type to convert to. - An object of the specified type that represents the . - The conversion cannot be performed. - - - Provides a type converter to convert objects to and from various other representations. - - - Initializes a new instance of the class. - - - Gets a value indicating whether this converter can convert an object to the given destination type using the context. - An that provides a format context. - A that represents the type you wish to convert to. - true if this converter can perform the conversion; otherwise, false. - - - Converts the given value object to a using the arguments. - An that provides a format context. - An optional . If not supplied, the current culture is assumed. - The to convert. - The to convert the value to. - An that represents the converted value. - The destinationType is null. - The conversion cannot be performed. - - - Specifies the default binding property for a component. This class cannot be inherited. - - - Initializes a new instance of the class using no parameters. - - - Initializes a new instance of the class using the specified property name. - The name of the default binding property. - - - Represents the default value for the class. - - - - Determines whether the specified is equal to the current instance. - The to compare with the current instance - true if the object is equal to the current instance; otherwise, false, indicating they are not equal. - - - Returns the hash code for this instance. - A 32-bit signed integer hash code. - - - Gets the name of the default binding property for the component to which the is bound. - The name of the default binding property for the component to which the is bound. - - - Specifies the default event for a component. - - - Initializes a new instance of the class. - The name of the default event for the component this attribute is bound to. - - - Specifies the default value for the , which is null. This static field is read-only. - - - - Returns whether the value of the given object is equal to the current . - The object to test the value equality of. - true if the value of the given object is equal to that of the current; otherwise, false. - - - Returns the hash code for this instance. - A 32-bit signed integer hash code. - - - Gets the name of the default event for the component this attribute is bound to. - The name of the default event for the component this attribute is bound to. The default value is null. - - - Specifies the default property for a component. - - - Initializes a new instance of the class. - The name of the default property for the component this attribute is bound to. - - - Specifies the default value for the , which is null. This static field is read-only. - - - - Returns whether the value of the given object is equal to the current . - The object to test the value equality of. - true if the value of the given object is equal to that of the current; otherwise, false. - - - Returns the hash code for this instance. - A 32-bit signed integer hash code. - - - Gets the name of the default property for the component this attribute is bound to. - The name of the default property for the component this attribute is bound to. The default value is null. - - - Specifies the default value for a property. - - - Initializes a new instance of the class using a value. - A that is the default value. - - - Initializes a new instance of the class, converting the specified value to the specified type, and using an invariant culture as the translation context. - A that represents the type to convert the value to. - A that can be converted to the type using the for the type and the U.S. English culture. - - - Initializes a new instance of the class using a . - A that is the default value. - - - Initializes a new instance of the class using a single-precision floating point number. - A single-precision floating point number that is the default value. - - - Initializes a new instance of the class using a 64-bit signed integer. - A 64-bit signed integer that is the default value. - - - Initializes a new instance of the class using a 32-bit signed integer. - A 32-bit signed integer that is the default value. - - - Initializes a new instance of the class using a 16-bit signed integer. - A 16-bit signed integer that is the default value. - - - Initializes a new instance of the class using a double-precision floating point number. - A double-precision floating point number that is the default value. - - - Initializes a new instance of the class using a Unicode character. - A Unicode character that is the default value. - - - Initializes a new instance of the class using an 8-bit unsigned integer. - An 8-bit unsigned integer that is the default value. - - - Initializes a new instance of the class. - An that represents the default value. - - - Returns whether the value of the given object is equal to the current . - The object to test the value equality of. - true if the value of the given object is equal to that of the current; otherwise, false. - - - Returns the hash code for this instance. - A 32-bit signed integer hash code. - - - Sets the default value for the property to which this attribute is bound. - The default value. - - - Gets the default value of the property this attribute is bound to. - An that represents the default value of the property this attribute is bound to. - - - Provides a description of the sort operation applied to a data source. - - - Initializes a new instance of the class with the specified property description and direction. - The that describes the property by which the data source is sorted. - One of the values. - - - Gets or sets the abstract description of a class property associated with this - The associated with this . - - - Gets or sets the direction of the sort operation associated with this . - One of the values. - - - Represents a collection of objects. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with the specified array of objects. - The array of objects to be contained in the collection. - - - Determines if the contains a specific value. - The to locate in the collection. - true if the is found in the collection; otherwise, false. - - - Copies the contents of the collection to the specified array, starting at the specified destination array index. - The destination array for the items copied from the collection. - The index of the destination array at which copying begins. - - - Gets the number of items in the collection. - The number of items in the collection. - - - Returns the index of the specified item in the collection. - The to locate in the collection. - The index of value if found in the list; otherwise, -1. - - - Gets or sets the specified . - The zero-based index of the to get or set in the collection. - The with the specified index. - An item is set in the , which is read-only. - - - Gets a value indicating whether access to the collection is thread safe. - true in all cases. - - - Gets the current instance that can be used to synchronize access to the collection. - The current instance of the . - - - Gets a that can be used to iterate through the collection. - An that can be used to iterate through the collection. - - - Adds an item to the collection. - The item to add to the collection. - The position into which the new element was inserted. - In all cases. - - - Removes all items from the collection. - In all cases. - - - Inserts an item into the collection at a specified index. - The zero-based index of the to get or set in the collection - The item to insert into the collection. - In all cases. - - - Gets a value indicating whether the collection has a fixed size. - true in all cases. - - - Gets a value indicating whether the collection is read-only. - true in all cases. - - - Gets the specified . - The zero-based index of the to get in the collection - The with the specified index. - - - Removes the first occurrence of an item from the collection. - The item to remove from the collection. - In all cases. - - - Removes an item from the collection at a specified index. - The zero-based index of the to remove from the collection - In all cases. - - - Specifies the direction of a sort operation. - - - Sorts in ascending order. - - - - Sorts in descending order. - - - - Specifies whether a property should be localized. This class cannot be inherited. - - - Initializes a new instance of the class. - true if a property should be localized; otherwise, false. - - - Specifies the default value, which is . This static field is read-only. - - - - Returns whether the value of the given object is equal to the current . - The object to test the value equality of. - true if the value of the given object is equal to that of the current; otherwise, false. - - - Returns the hash code for this instance. - A hash code for the current . - - - Determines if this attribute is the default. - true if the attribute is the default value for this attribute class; otherwise, false. - - - Gets a value indicating whether a property should be localized. - true if a property should be localized; otherwise, false. - - - Specifies that a property should not be localized. This static field is read-only. - - - - Specifies that a property should be localized. This static field is read-only. - - - - Specifies the properties that support lookup-based binding. This class cannot be inherited. - - - Initializes a new instance of the class using no parameters. - - - Initializes a new instance of the class. - The name of the property to be used as the data source. - The name of the property to be used for the display name. - The name of the property to be used as the source for values. - The name of the property to be used for lookups. - - - Gets the name of the data source property for the component to which the is bound. - The data source property for the component to which the is bound. - - - Represents the default value for the class. - - - - Gets the name of the display member property for the component to which the is bound. - The name of the display member property for the component to which the is bound. - - - Determines whether the specified is equal to the current instance. - The to compare with the current instance - true if the object is equal to the current instance; otherwise, false, indicating they are not equal. - - - Returns the hash code for this instance. - A hash code for the current . - - - Gets the name of the lookup member for the component to which this attribute is bound. - The name of the lookup member for the component to which the is bound. - - - Gets the name of the value member property for the component to which the is bound. - The name of the value member property for the component to which the is bound. - - - Implements and provides the base implementation for remotable components that are marshaled by value (a copy of the serialized object is passed). - - - Initializes a new instance of the class. - - - Gets the container for the component. - An object implementing the interface that represents the component's container, or null if the component does not have a site. - - - Gets a value indicating whether the component is currently in design mode. - true if the component is in design mode; otherwise, false. - - - Releases all resources used by the . - - - Releases the unmanaged resources used by the and optionally releases the managed resources. - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - Adds an event handler to listen to the event on the component. - - - - Gets the list of event handlers that are attached to this component. - An that provides the delegates for this component. - - - Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. - - - Gets the implementer of the . - A that represents the type of service you want. - An that represents the implementer of the . - - - Gets or sets the site of the component. - An object implementing the interface that represents the site of the component. - - - Returns a containing the name of the , if any. This method should not be overridden. - A containing the name of the , if any. null if the is unnamed. - - - Represents a mask-parsing service that can be used by any number of controls that support masking, such as the control. - - - Initializes a new instance of the class using the specified mask. - A that represents the input mask. - - - Initializes a new instance of the class using the specified mask and ASCII restriction value. - A that represents the input mask. - true to restrict input to ASCII-compatible characters; otherwise false to allow the entire Unicode set. - - - Initializes a new instance of the class using the specified mask and culture. - A that represents the input mask. - A that is used to set region-sensitive separator characters. - - - Initializes a new instance of the class using the specified mask, password character, and prompt usage value. - A that represents the input mask. - A that will be displayed for characters entered into a password string. - true to allow the prompt character as input; otherwise false. - - - Initializes a new instance of the class using the specified mask, culture, and ASCII restriction value. - A that represents the input mask. - A that is used to set region-sensitive separator characters. - true to restrict input to ASCII-compatible characters; otherwise false to allow the entire Unicode set. - - - Initializes a new instance of the class using the specified mask, culture, password character, and prompt usage value. - A that represents the input mask. - A that is used to set region-sensitive separator characters. - A that will be displayed for characters entered into a password string. - true to allow the prompt character as input; otherwise false. - - - Initializes a new instance of the class using the specified mask, culture, prompt usage value, prompt character, password character, and ASCII restriction value. - A that represents the input mask. - A that is used to set region-sensitive separator characters. - A value that specifies whether the prompt character should be allowed as a valid input character. - A that will be displayed as a placeholder for user input. - A that will be displayed for characters entered into a password string. - true to restrict input to ASCII-compatible characters; otherwise false to allow the entire Unicode set. - The mask parameter is null or . -or- The mask contains one or more non-printable characters. - - - Adds the characters in the specified input string to the end of the formatted string, and then outputs position and descriptive information. - A containing character values to be appended to the formatted string. - The zero-based position in the formatted string where the attempt was made to add the character. An output parameter. - A that succinctly describes the result of the operation. An output parameter. - true if all the characters from the input string were added successfully; otherwise false to indicate that no characters were added. - - - Adds the specified input character to the end of the formatted string, and then outputs position and descriptive information. - A value to be appended to the formatted string. - The zero-based position in the formatted string where the attempt was made to add the character. An output parameter. - A that succinctly describes the result of the operation. An output parameter. - true if the input character was added successfully; otherwise false. - - - Adds the specified input character to the end of the formatted string. - A value to be appended to the formatted string. - true if the input character was added successfully; otherwise false. - - - Adds the characters in the specified input string to the end of the formatted string. - A containing character values to be appended to the formatted string. - true if all the characters from the input string were added successfully; otherwise false to indicate that no characters were added. - The input parameter is null. - - - Gets a value indicating whether the prompt character should be treated as a valid input character or not. - true if the user can enter into the control; otherwise, false. The default is true. - - - Gets a value indicating whether the mask accepts characters outside of the ASCII character set. - true if only ASCII is accepted; false if can accept any arbitrary Unicode character. The default is false. - - - Gets the number of editable character positions that have already been successfully assigned an input value. - An containing the number of editable character positions in the input mask that have already been assigned a character value in the formatted string. - - - Gets the number of editable character positions in the input mask that have not yet been assigned an input value. - An containing the number of editable character positions that not yet been assigned a character value. - - - Clears all the editable input characters from the formatted string, replacing them with prompt characters. - - - Clears all the editable input characters from the formatted string, replacing them with prompt characters, and then outputs descriptive information. - A that succinctly describes the result of the operation. An output parameter. - - - Creates a copy of the current . - The object this method creates, cast as an object. - - - Gets the culture that determines the value of the localizable separators and placeholders in the input mask. - A containing the culture information associated with the input mask. - - - Gets the default password character used obscure user input. - A that represents the default password character. - - - Gets the number of editable positions in the formatted string. - An containing the number of editable positions in the formatted string. - - - Gets a newly created enumerator for the editable positions in the formatted string. - An that supports enumeration over the editable positions in the formatted string. - - - Returns the position of the first assigned editable position after the specified position using the specified search direction. - The zero-based position in the formatted string to start the search. - A indicating the search direction; either true to search forward or false to search backward. - If successful, an representing the zero-based position of the first assigned editable position encountered; otherwise . - - - Returns the position of the first assigned editable position between the specified positions using the specified search direction. - The zero-based position in the formatted string where the search starts. - The zero-based position in the formatted string where the search ends. - A indicating the search direction; either true to search forward or false to search backward. - If successful, an representing the zero-based position of the first assigned editable position encountered; otherwise . - - - Returns the position of the first editable position after the specified position using the specified search direction. - The zero-based position in the formatted string to start the search. - A indicating the search direction; either true to search forward or false to search backward. - If successful, an representing the zero-based position of the first editable position encountered; otherwise . - - - Returns the position of the first editable position between the specified positions using the specified search direction. - The zero-based position in the formatted string where the search starts. - The zero-based position in the formatted string where the search ends. - A indicating the search direction; either true to search forward or false to search backward. - If successful, an representing the zero-based position of the first editable position encountered; otherwise . - - - Returns the position of the first non-editable position after the specified position using the specified search direction. - The zero-based position in the formatted string to start the search. - A indicating the search direction; either true to search forward or false to search backward. - If successful, an representing the zero-based position of the first literal position encountered; otherwise . - - - Returns the position of the first non-editable position between the specified positions using the specified search direction. - The zero-based position in the formatted string where the search starts. - The zero-based position in the formatted string where the search ends. - A indicating the search direction; either true to search forward or false to search backward. - If successful, an representing the zero-based position of the first literal position encountered; otherwise . - - - Returns the position of the first unassigned editable position after the specified position using the specified search direction. - The zero-based position in the formatted string to start the search. - A indicating the search direction; either true to search forward or false to search backward. - If successful, an representing the zero-based position of the first unassigned editable position encountered; otherwise . - - - Returns the position of the first unassigned editable position between the specified positions using the specified search direction. - The zero-based position in the formatted string where the search starts. - The zero-based position in the formatted string where the search ends. - A indicating the search direction; either true to search forward or false to search backward. - If successful, an representing the zero-based position of the first unassigned editable position encountered; otherwise . - - - Determines whether the specified denotes success or failure. - A value typically obtained as an output parameter from a previous operation. - true if the specified value represents a success; otherwise, false if it represents failure. - - - Gets or sets a value that indicates whether literal characters in the input mask should be included in the formatted string. - true if literals are included; otherwise, false. The default is true. - - - Gets or sets a value indicating whether is used to represent the absence of user input when displaying the formatted string. - true if the prompt character is used to represent the positions where no user input was provided; otherwise, false. The default is true. - - - Inserts the specified character at the specified position within the formatted string. - The to be inserted. - The zero-based position in the formatted string to insert the character. - true if the insertion was successful; otherwise, false. - - - Inserts the specified string at a specified position within the formatted string. - The to be inserted. - The zero-based position in the formatted string to insert the input string. - true if the insertion was successful; otherwise, false. - The input parameter is null. - - - Inserts the specified character at the specified position within the formatted string, returning the last insertion position and the status of the operation. - The to be inserted. - The zero-based position in the formatted string to insert the character. - If the method is successful, the last position where a character was inserted; otherwise, the first position where the insertion failed. An output parameter. - A that succinctly describes the result of the insertion operation. An output parameter. - true if the insertion was successful; otherwise, false. - - - Inserts the specified string at a specified position within the formatted string, returning the last insertion position and the status of the operation. - The to be inserted. - The zero-based position in the formatted string to insert the input string. - If the method is successful, the last position where a character was inserted; otherwise, the first position where the insertion failed. An output parameter. - A that succinctly describes the result of the insertion operation. An output parameter. - true if the insertion was successful; otherwise, false. - The input parameter is null. - - - Gets the upper bound of the range of invalid indexes. - A value representing the largest invalid index, as determined by the provider implementation. For example, if the lowest valid index is 0, this property will return -1. - - - Determines whether the specified position is available for assignment. - The zero-based position in the mask to test. - true if the specified position in the formatted string is editable and has not been assigned to yet; otherwise false. - - - Determines whether the specified position is editable. - The zero-based position in the mask to test. - true if the specified position in the formatted string is editable; otherwise false. - - - Gets or sets a value that determines whether password protection should be applied to the formatted string. - true if the input string is to be treated as a password string; otherwise, false. The default is false. - - - Determines whether the specified character is a valid input character. - The value to test. - true if the specified character contains a valid input value; otherwise false. - - - Determines whether the specified character is a valid mask character. - The value to test. - true if the specified character contains a valid mask value; otherwise false. - - - Determines whether the specified character is a valid password character. - The value to test. - true if the specified character contains a valid password value; otherwise false. - - - Gets the element at the specified position in the formatted string. - A zero-based index of the element to retrieve. - The at the specified position in the formatted string. - index is less than zero or greater than or equal to the of the mask. - - - Gets the index in the mask of the rightmost input character that has been assigned to the mask. - If at least one input character has been assigned to the mask, an containing the index of rightmost assigned position; otherwise, if no position has been assigned, . - - - Gets the length of the mask, absent any mask modifier characters. - An containing the number of positions in the mask, excluding characters that modify mask input. - - - Gets the input mask. - A containing the full mask. - - - Gets a value indicating whether all required inputs have been entered into the formatted string. - true if all required input has been entered into the mask; otherwise, false. - - - Gets a value indicating whether all required and optional inputs have been entered into the formatted string. - true if all required and optional inputs have been entered; otherwise, false. - - - Gets or sets the character to be substituted for the actual input characters. - The value used as the password character. - The password character specified when setting this property is the same as the current prompt character, . The two are required to be different. - The character specified when setting this property is not a valid password character, as determined by the method. - - - Gets or sets the character used to represent the absence of user input for all available edit positions. - The character used to prompt the user for input. The default is an underscore (_). - The prompt character specified when setting this property is the same as the current password character, . The two are required to be different. - The character specified when setting this property is not a valid password character, as determined by the method. - - - Removes the last assigned character from the formatted string. - true if the character was successfully removed; otherwise, false. - - - Removes the last assigned character from the formatted string, and then outputs the removal position and descriptive information. - The zero-based position in the formatted string where the character was actually removed. An output parameter. - A that succinctly describes the result of the operation. An output parameter. - true if the character was successfully removed; otherwise, false. - - - Removes the assigned character at the specified position from the formatted string. - The zero-based position of the assigned character to remove. - true if the character was successfully removed; otherwise, false. - - - Removes the assigned characters between the specified positions from the formatted string. - The zero-based index of the first assigned character to remove. - The zero-based index of the last assigned character to remove. - true if the character was successfully removed; otherwise, false. - - - Removes the assigned characters between the specified positions from the formatted string, and then outputs the removal position and descriptive information. - The zero-based index of the first assigned character to remove. - The zero-based index of the last assigned character to remove. - If successful, the zero-based position in the formatted string of where the characters were actually removed; otherwise, the first position where the operation failed. An output parameter. - A that succinctly describes the result of the operation. An output parameter. - true if the character was successfully removed; otherwise, false. - - - Replaces a range of editable characters between the specified starting and ending positions with the specified string, and then outputs the removal position and descriptive information. - The value used to replace the existing editable characters. - The zero-based position in the formatted string where the replacement starts. - The zero-based position in the formatted string where the replacement ends. - If successful, the zero-based position in the formatted string where the last character was actually replaced; otherwise, the first position where the operation failed. An output parameter. - A that succinctly describes the result of the replacement operation. An output parameter. - true if all the characters were successfully replaced; otherwise, false. - - - Replaces a single character between the specified starting and ending positions with the specified character value, and then outputs the removal position and descriptive information. - The value that replaces the existing value. - The zero-based position in the formatted string where the replacement starts. - The zero-based position in the formatted string where the replacement ends. - If successful, the zero-based position in the formatted string where the last character was actually replaced; otherwise, the first position where the operation failed. An output parameter. - A that succinctly describes the result of the replacement operation. An output parameter. - true if the character was successfully replaced; otherwise, false. - - - Replaces a range of editable characters starting at the specified position with the specified string, and then outputs the removal position and descriptive information. - The value used to replace the existing editable characters. - The zero-based position to search for the first editable character to replace. - If successful, the zero-based position in the formatted string where the last character was actually replaced; otherwise, the first position where the operation failed. An output parameter. - A that succinctly describes the result of the replacement operation. An output parameter. - true if all the characters were successfully replaced; otherwise, false. - - - Replaces a single character at or beyond the specified position with the specified character value, and then outputs the removal position and descriptive information. - The value that replaces the existing value. - The zero-based position to search for the first editable character to replace. - If successful, the zero-based position in the formatted string where the last character was actually replaced; otherwise, the first position where the operation failed. An output parameter. - A that succinctly describes the result of the replacement operation. An output parameter. - true if the character was successfully replaced; otherwise, false. - - - Replaces a range of editable characters starting at the specified position with the specified string. - The value used to replace the existing editable characters. - The zero-based position to search for the first editable character to replace. - true if all the characters were successfully replaced; otherwise, false. - The input parameter is null. - - - Replaces a single character at or beyond the specified position with the specified character value. - The value that replaces the existing value. - The zero-based position to search for the first editable character to replace. - true if the character was successfully replaced; otherwise, false. - - - Gets or sets a value that determines how an input character that matches the prompt character should be handled. - true if the prompt character entered as input causes the current editable position in the mask to be reset; otherwise, false to indicate that the prompt character is to be processed as a normal input character. The default is true. - - - Gets or sets a value that determines how a space input character should be handled. - true if the space input character causes the current editable position in the mask to be reset; otherwise, false to indicate that it is to be processed as a normal input character. The default is true. - - - Sets the formatted string to the specified input string. - The value used to set the formatted string. - true if all the characters were successfully set; otherwise, false. - The input parameter is null. - - - Sets the formatted string to the specified input string, and then outputs the removal position and descriptive information. - The value used to set the formatted string. - If successful, the zero-based position in the formatted string where the last character was actually set; otherwise, the first position where the operation failed. An output parameter. - A that succinctly describes the result of the set operation. An output parameter. - true if all the characters were successfully set; otherwise, false. - The input parameter is null. - - - Gets or sets a value indicating whether literal character positions in the mask can be overwritten by their same values. - true to allow literals to be added back; otherwise, false to not allow the user to overwrite literal characters. The default is true. - - - Returns the formatted string in a displayable form. - The formatted that includes prompts and mask literals. - - - Returns a substring of the formatted string, optionally including prompt, literal, and password characters. - true to return the actual editable characters; otherwise, false to indicate that the property is to be honored. - true to include prompt characters in the return string; otherwise, false. - true to return literal characters in the return string; otherwise, false. - The zero-based position in the formatted string where the output begins. - The number of characters to return. - If successful, a substring of the formatted , which includes all the assigned character values and optionally includes literals, prompts, and password characters; otherwise the string. - - - Returns a substring of the formatted string, optionally including prompt and literal characters. - true to include prompt characters in the return string; otherwise, false. - true to include literal characters in the return string; otherwise, false. - The zero-based position in the formatted string where the output begins. - The number of characters to return. - If successful, a substring of the formatted , which includes all the assigned character values and optionally includes literals and prompts; otherwise the string. - - - Returns a substring of the formatted string, optionally including password characters. - true to return the actual editable characters; otherwise, false to indicate that the property is to be honored. - The zero-based position in the formatted string where the output begins. - The number of characters to return. - If successful, a substring of the formatted , which includes literals, prompts, and optionally password characters; otherwise the string. - - - Returns the formatted string, optionally including password characters. - true to return the actual editable characters; otherwise, false to indicate that the property is to be honored. - The formatted that includes literals, prompts, and optionally password characters. - - - Returns the formatted string, optionally including prompt and literal characters. - true to include prompt characters in the return string; otherwise, false. - true to include literal characters in the return string; otherwise, false. - The formatted that includes all the assigned character values and optionally includes literals and prompts. - - - Returns the formatted string that includes all the assigned character values. - The formatted that includes all the assigned character values. - - - Returns a substring of the formatted string. - The zero-based position in the formatted string where the output begins. - The number of characters to return. - If successful, a substring of the formatted , which includes all the assigned character values; otherwise the string. - - - Tests whether the specified character could be set successfully at the specified position. - The value to test. - The position in the mask to test the input character against. - A that succinctly describes the result of the operation. An output parameter. - true if the specified character is valid for the specified position; otherwise, false. - - - Tests whether the specified character would be escaped at the specified position. - The value to test. - The position in the mask to test the input character against. - true if the specified character would be escaped at the specified position; otherwise, false. - - - Tests whether the specified string could be set successfully. - The value to test. - true if the specified string represents valid input; otherwise, false. - - - Tests whether the specified string could be set successfully, and then outputs position and descriptive information. - The value to test. - If successful, the zero-based position of the last character actually tested; otherwise, the first position where the test failed. An output parameter. - A that succinctly describes the result of the test operation. An output parameter. - true if the specified string represents valid input; otherwise, false. - - - Specifies values that succinctly describe the results of a masked text parsing operation. - - - Operation did not succeed.An input character was encountered that was not alphanumeric. . - - - - Operation did not succeed.An input character was encountered that was not a member of the ASCII character set. - - - - Success. The operation succeeded because a literal, prompt or space character was an escaped character. For more information about escaped characters, see the method. - - - - Operation did not succeed. An input character was encountered that was not a digit. - - - - Operation did not succeed. The program encountered an input character that was not valid. For more information about characters that are not valid, see the method. - - - - Operation did not succeed. An input character was encountered that was not a letter. - - - - Success. The primary operation was not performed because it was not needed; therefore, no side effect was produced. - - - - Operation did not succeed. The current position in the formatted string is a literal character. - - - - Operation did not succeed. The specified position is not in the range of the target string; typically it is either less than zero or greater then the length of the target string. - - - - Operation did not succeed. The prompt character is not valid at input, perhaps because the property is set to false. - - - - Success. The primary operation was not performed because it was not needed, but the method produced a side effect. For example, the method can delete an unassigned edit position, which causes left-shifting of subsequent characters in the formatted string. - - - - Operation did not succeed. An input character was encountered that was not a signed digit. - - - - Success. The primary operation succeeded. - - - - Operation did not succeed. There were not enough edit positions available to fulfill the request. - - - - Unknown. The result of the operation could not be determined. - - - - Represents a class member, such as a property or event. This is an abstract base class. - - - Initializes a new instance of the class with the specified . - A that contains the name of the member and its attributes. - - - Initializes a new instance of the class with the specified name of the member. - The name of the member. - The name is an empty string ("") or null. - - - Initializes a new instance of the class with the name in the specified and the attributes in both the old and the array. - A that has the name of the member and its attributes. - An array of objects with the attributes you want to add to the member. - - - Initializes a new instance of the class with the specified name of the member and an array of attributes. - The name of the member. - An array of type that contains the member attributes. - The name is an empty string ("") or null. - - - Gets or sets an array of attributes. - An array of type that contains the attributes of this member. - - - Gets the collection of attributes for this member. - An that provides the attributes for this member, or an empty collection if there are no attributes in the . - - - Gets the name of the category to which the member belongs, as specified in the . - The name of the category to which the member belongs. If there is no , the category name is set to the default category, Misc. - - - Creates a collection of attributes using the array of attributes passed to the constructor. - A new that contains the attributes. - - - Gets the description of the member, as specified in the . - The description of the member. If there is no , the property value is set to the default, which is an empty string (""). - - - Gets whether this member should be set only at design time, as specified in the . - true if this member should be set only at design time; false if the member can be set during run time. - - - Gets the name that can be displayed in a window, such as a Properties window. - The name to display for the member. - - - Compares this instance to the given object to see if they are equivalent. - The object to compare to the current instance. - true if equivalent; otherwise, false. - - - When overridden in a derived class, adds the attributes of the inheriting class to the specified list of attributes in the parent class. - An that lists the attributes in the parent class. Initially, this is empty. - - - Finds the given method through reflection, searching only for public methods. - The component that contains the method. - The name of the method to find. - An array of parameters for the method, used to choose between overloaded methods. - The type to return for the method. - A that represents the method, or null if the method is not found. - - - Finds the given method through reflection, with an option to search only public methods. - The component that contains the method. - The name of the method to find. - An array of parameters for the method, used to choose between overloaded methods. - The type to return for the method. - Whether to restrict search to public methods. - A that represents the method, or null if the method is not found. - - - Returns the hash code for this instance. - A hash code for the current . - - - Retrieves the object that should be used during invocation of members. - The of the invocation target. - The potential invocation target. - The object to be used during member invocations. - type or instance is null. - - - Gets the component on which to invoke a method. - A representing the type of component this is bound to. For example, if this describes a property, this parameter should be the class that the property is declared on. - An instance of the object to call. - An instance of the component to invoke. This method returns a visual designer when the property is attached to a visual designer. - componentClass or component is null. - - - Gets a component site for the given component. - The component for which you want to find a site. - The site of the component, or null if a site does not exist. - - - Gets a value indicating whether the member is browsable, as specified in the . - true if the member is browsable; otherwise, false. If there is no , the property value is set to the default, which is true. - - - Gets the name of the member. - The name of the member. - - - Gets the hash code for the name of the member, as specified in . - The hash code for the name of the member. - - - Specifies that this property can be combined with properties belonging to other objects in a Properties window. - - - Initializes a new instance of the class. - true if this property can be combined with properties belonging to other objects in a Properties window; otherwise, false. - - - Gets a value indicating whether this property can be combined with properties belonging to other objects in a Properties window. - true if this property can be combined with properties belonging to other objects in a Properties window; otherwise, false. - - - Specifies the default value, which is , that is a property can be combined with properties belonging to other objects in a Properties window. This static field is read-only. - - - - Indicates whether this instance and a specified object are equal. - Another object to compare to. - true if obj is equal to this instance; otherwise, false. - - - Returns the hash code for this instance. - A hash code for the current . - - - Determines if this attribute is the default. - true if the attribute is the default value for this attribute class; otherwise, false. - - - Specifies that a property cannot be combined with properties belonging to other objects in a Properties window. This static field is read-only. - - - - Specifies that a property can be combined with properties belonging to other objects in a Properties window. This static field is read-only. - - - - Provides a type converter to convert multiline strings to a simple string. - - - Initializes a new instance of the class. - - - Converts the given value object to the specified type, using the specified context and culture information. - An that provides a format context. - A . If null is passed, the current culture is assumed. - The to convert. - The to convert the value parameter to. - An that represents the converted value. - destinationType is null. - The conversion cannot be performed. - - - Returns a collection of properties for the type of array specified by the value parameter, using the specified context and attributes. - An that provides a format context. - An that specifies the type of array for which to get properties. - An array of type that is used as a filter. - A with the properties that are exposed for this data type, or null if there are no properties. - - - Returns whether this object supports properties, using the specified context. - An that provides a format context. - true if should be called to find the properties of this object; otherwise, false. - - - Provides the base implementation for the interface, which enables containers to have an owning component. - - - Initializes a new instance of the class. - The that owns this nested container. - owner is null. - - - Creates a site for the component within the container. - The to create a site for. - The name to assign to component, or null to skip the name assignment. - The newly created . - component is null. - - - Releases the resources used by the nested container. - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - Gets the service object of the specified type, if it is available. - The of the service to retrieve. - An that implements the requested service, or null if the service cannot be resolved. - - - Gets the owning component for this nested container. - The that owns this nested container. - - - Gets the name of the owning component. - The name of the owning component. - - - Indicates that the parent property is notified when the value of the property that this attribute is applied to is modified. This class cannot be inherited. - - - Initializes a new instance of the class, using the specified value to determine whether the parent property is notified of changes to the value of the property. - true if the parent should be notified of changes; otherwise, false. - - - Indicates the default attribute state, that the property should not notify the parent property of changes to its value. This field is read-only. - - - - Gets a value indicating whether the specified object is the same as the current object. - The object to test for equality. - true if the object is the same as this object; otherwise, false. - - - Gets the hash code for this object. - The hash code for the object the attribute belongs to. - - - Gets a value indicating whether the current value of the attribute is the default value for the attribute. - true if the current value of the attribute is the default value of the attribute; otherwise, false. - - - Indicates that the parent property is not be notified of changes to the value of the property. This field is read-only. - - - - Gets or sets a value indicating whether the parent property should be notified of changes to the value of the property. - true if the parent property should be notified of changes; otherwise, false. - - - Indicates that the parent property is notified of changes to the value of the property. This field is read-only. - - - - Provides automatic conversion between a nullable type and its underlying primitive type. - - - Initializes a new instance of the class. - The specified nullable type. - type is not a nullable type. - - - Returns whether this converter can convert an object of the given type to the type of this converter, using the specified context. - An that provides a format context. - A that represents the type you want to convert from. - true if this converter can perform the conversion; otherwise, false. - - - Returns whether this converter can convert the object to the specified type, using the specified context. - An that provides a format context. - A that represents the type you want to convert to. - true if this converter can perform the conversion; otherwise, false. - - - Converts the given object to the type of this converter, using the specified context and culture information. - An that provides a format context. - The to use as the current culture. - The to convert. - An that represents the converted value. - The conversion cannot be performed. - - - Converts the given value object to the specified type, using the specified context and culture information. - An that provides a format context. - The to use as the current culture. - The to convert. - The to convert the value parameter to. - An that represents the converted value. - destinationType is null. - The conversion cannot be performed. - - - Creates an instance of the type that this is associated with, using the specified context, given a set of property values for the object. - An that provides a format context. - An of new property values. - An representing the given , or null if the object cannot be created. This method always returns null. - - - Returns whether changing a value on this object requires a call to to create a new value, using the specified context. - An that provides a format context. - true if changing a property on this object requires a call to to create a new value; otherwise, false. - - - Returns a collection of properties for the type of array specified by the value parameter, using the specified context and attributes. - An that provides a format context. - An that specifies the type of array for which to get properties. - An array of type that is used as a filter. - A with the properties that are exposed for this data type, or null if there are no properties. - - - Returns whether this object supports properties, using the specified context. - An that provides a format context. - true if should be called to find the properties of this object; otherwise, false. - - - Returns a collection of standard values for the data type this type converter is designed for when provided with a format context. - An that provides a format context that can be used to extract additional information about the environment from which this converter is invoked. This parameter or properties of this parameter can be null. - A that holds a standard set of valid values, or null if the data type does not support a standard set of values. - - - Returns whether the collection of standard values returned from is an exclusive list of possible values, using the specified context. - An that provides a format context. - true if the returned from is an exhaustive list of possible values; false if other values are possible. - - - Returns whether this object supports a standard set of values that can be picked from a list, using the specified context. - An that provides a format context. - true if should be called to find a common set of values the object supports; otherwise, false. - - - Returns whether the given value object is valid for this type and for the specified context. - An that provides a format context. - The to test for validity. - true if the specified value is valid for this object; otherwise, false. - - - Gets the nullable type. - A that represents the nullable type. - - - Gets the underlying type. - A that represents the underlying type. - - - Gets the underlying type converter. - A that represents the underlying type converter. - - - Indicates whether the name of the associated property is displayed with parentheses in the Properties window. This class cannot be inherited. - - - Initializes a new instance of the class that indicates that the associated property should not be shown with parentheses. - - - Initializes a new instance of the class, using the specified value to indicate whether the attribute is displayed with parentheses. - true if the name should be enclosed in parentheses; otherwise, false. - - - Initializes a new instance of the class with a default value that indicates that the associated property should not be shown with parentheses. This field is read-only. - - - - Compares the specified object to this object and tests for equality. - The object to be compared. - true if equal; otherwise, false. - - - Gets the hash code for this object. - The hash code for the object the attribute belongs to. - - - Gets a value indicating whether the current value of the attribute is the default value for the attribute. - true if the current value of the attribute is the default value of the attribute; otherwise, false. - - - Gets a value indicating whether the Properties window displays the name of the property in parentheses in the Properties window. - true if the property is displayed with parentheses; otherwise, false. - - - Indicates that an object's text representation is obscured by characters such as asterisks. This class cannot be inherited. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class, optionally showing password text. - true to indicate that the property should be shown as password text; otherwise, false. The default is false. - - - Specifies the default value for the . - - - - Determines whether two instances are equal. - The to compare with the current . - true if the specified is equal to the current ; otherwise, false. - - - Returns the hash code for this instance. - A hash code for the current . - - - Returns an indication whether the value of this instance is the default value. - true if this instance is the default attribute for the class; otherwise, false. - - - Specifies that a text property is not used as a password. This static (Shared in Visual Basic) field is read-only. - - - - Gets a value indicating if the property for which the is defined should be shown as password text. - true if the property should be shown as password text; otherwise, false. - - - Specifies that a text property is used as a password. This static (Shared in Visual Basic) field is read-only. - - - - Provides data for the event. - - - Initializes a new instance of the class. - The percentage of an asynchronous task that has been completed. - A unique user state. - - - Gets the asynchronous task progress percentage. - A percentage value indicating the asynchronous task progress. - - - Gets a unique user state. - A unique indicating the user state. - - - Represents the method that will handle the event of the class. This class cannot be inherited. - The source of the event. - A that contains the event data. - - - Provides data for the event. - - - Initializes a new instance of the class. - The name of the property that changed. - - - Gets the name of the property that changed. - The name of the property that changed. - - - Represents the method that will handle the event raised when a property is changed on a component. - The source of the event. - A that contains the event data. - - - Provides data for the event. - - - Initializes a new instance of the class. - The name of the property whose value is changing. - - - Gets the name of the property whose value is changing. - The name of the property whose value is changing. - - - Represents the method that will handle the event of an interface. - The source of the event. - A that contains the event data. - - - Provides an abstraction of a property on a class. - - - Initializes a new instance of the class with the name and attributes in the specified . - A that contains the name of the property and its attributes. - - - Initializes a new instance of the class with the name in the specified and the attributes in both the and the array. - A containing the name of the member and its attributes. - An array containing the attributes you want to associate with the property. - - - Initializes a new instance of the class with the specified name and attributes. - The name of the property. - An array of type that contains the property attributes. - - - Enables other objects to be notified when this property changes. - The component to add the handler for. - The delegate to add as a listener. - component or handler is null. - - - When overridden in a derived class, returns whether resetting an object changes its value. - The component to test for reset capability. - true if resetting the component changes its value; otherwise, false. - - - When overridden in a derived class, gets the type of the component this property is bound to. - A that represents the type of component this property is bound to. When the or methods are invoked, the object specified might be an instance of this type. - - - Gets the type converter for this property. - A that is used to convert the of this property. - - - Creates an instance of the specified type. - A that represents the type to create. - A new instance of the type. - - - Compares this to another object to see if they are equivalent. - The object to compare to this . - true if the values are equivalent; otherwise, false. - - - Adds the attributes of the to the specified list of attributes in the parent class. - An that lists the attributes in the parent class. Initially, this is empty. - - - Returns the default . - A collection of property descriptor. - - - Returns a using a specified array of attributes as a filter. - An array of type to use as a filter. - A with the properties that match the specified attributes. - - - Returns a for a given object. - A component to get the properties for. - A with the properties for the specified component. - - - Returns a for a given object using a specified array of attributes as a filter. - A component to get the properties for. - An array of type to use as a filter. - A with the properties that match the specified attributes for the specified component. - - - Gets an editor of the specified type. - The base type of editor, which is used to differentiate between multiple editors that a property supports. - An instance of the requested editor type, or null if an editor cannot be found. - - - Returns the hash code for this object. - The hash code for this object. - - - This method returns the object that should be used during invocation of members. - The of the invocation target. - The potential invocation target. - The that should be used during invocation of members. - - - Returns a type using its name. - The assembly-qualified name of the type to retrieve. - A that matches the given type name, or null if a match cannot be found. - - - When overridden in a derived class, gets the current value of the property on a component. - The component with the property for which to retrieve the value. - The value of a property for a given component. - - - Retrieves the current set of ValueChanged event handlers for a specific component - The component for which to retrieve event handlers. - A combined multicast event handler, or null if no event handlers are currently assigned to component. - - - Gets a value indicating whether this property should be localized, as specified in the . - true if the member is marked with the set to true; otherwise, false. - - - When overridden in a derived class, gets a value indicating whether this property is read-only. - true if the property is read-only; otherwise, false. - - - Raises the ValueChanged event that you implemented. - The object that raises the event. - An that contains the event data. - - - When overridden in a derived class, gets the type of the property. - A that represents the type of the property. - - - Enables other objects to be notified when this property changes. - The component to remove the handler for. - The delegate to remove as a listener. - component or handler is null. - - - When overridden in a derived class, resets the value for this property of the component to the default value. - The component with the property value that is to be reset to the default value. - - - Gets a value indicating whether this property should be serialized, as specified in the . - One of the enumeration values that specifies whether this property should be serialized. - - - When overridden in a derived class, sets the value of the component to a different value. - The component with the property value that is to be set. - The new value. - - - When overridden in a derived class, determines a value indicating whether the value of this property needs to be persisted. - The component with the property to be examined for persistence. - true if the property should be persisted; otherwise, false. - - - Gets a value indicating whether value change notifications for this property may originate from outside the property descriptor. - true if value change notifications may originate from outside the property descriptor; otherwise, false. - - - Represents a collection of objects. - - - Initializes a new instance of the class. - An array of type that provides the properties for this collection. - - - Initializes a new instance of the class, which is optionally read-only. - An array of type that provides the properties for this collection. - If true, specifies that the collection cannot be modified. - - - Adds the specified to the collection. - The to add to the collection. - The index of the that was added to the collection. - The collection is read-only. - - - Removes all objects from the collection. - The collection is read-only. - - - Returns whether the collection contains the given . - The to find in the collection. - true if the collection contains the given ; otherwise, false. - - - Copies the entire collection to an array, starting at the specified index number. - An array of objects to copy elements of the collection to. - The index of the array parameter at which copying begins. - - - Gets the number of property descriptors in the collection. - The number of property descriptors in the collection. - - - Specifies an empty collection that you can use instead of creating a new one with no items. This static field is read-only. - - - - Returns the with the specified name, using a Boolean to indicate whether to ignore case. - The name of the to return from the collection. - true if you want to ignore the case of the property name; otherwise, false. - A with the specified name, or null if the property does not exist. - - - Returns an enumerator for this class. - An enumerator of type . - - - Returns the index of the given . - The to return the index of. - The index of the given . - - - Adds the to the collection at the specified index number. - The index at which to add the value parameter to the collection. - The to add to the collection. - The collection is read-only. - - - Sorts the members of this collection, using the specified . - A comparer to use to sort the objects in this collection. - - - Sorts the members of this collection. The specified order is applied first, followed by the default sort for this collection, which is usually alphabetical. - An array of strings describing the order in which to sort the objects in this collection. - - - Gets or sets the at the specified index number. - The zero-based index of the to get or set. - The with the specified index number. - The index parameter is not a valid index for . - - - Gets or sets the with the specified name. - The name of the to get from the collection. - The with the specified name, or null if the property does not exist. - - - Removes the specified from the collection. - The to remove from the collection. - The collection is read-only. - - - Removes the at the specified index from the collection. - The index of the to remove from the collection. - The collection is read-only. - - - Sorts the members of this collection, using the default sort for this collection, which is usually alphabetical. - A new that contains the sorted objects. - - - Sorts the members of this collection, using the specified . - A comparer to use to sort the objects in this collection. - A new that contains the sorted objects. - - - Sorts the members of this collection. The specified order is applied first, followed by the default sort for this collection, which is usually alphabetical. - An array of strings describing the order in which to sort the objects in this collection. - A new that contains the sorted objects. - - - Sorts the members of this collection. The specified order is applied first, followed by the sort using the specified . - An array of strings describing the order in which to sort the objects in this collection. - A comparer to use to sort the objects in this collection. - A new that contains the sorted objects. - - - Gets the number of elements contained in the collection. - The number of elements contained in the collection. - - - Gets a value indicating whether access to the collection is synchronized (thread safe). - true if access to the collection is synchronized (thread safe); otherwise, false. - - - Gets an object that can be used to synchronize access to the collection. - An object that can be used to synchronize access to the collection. - - - Adds an element with the provided key and value to the . - The to use as the key of the element to add. - The to use as the value of the element to add. - The collection is read-only. - value is null. - - - Removes all elements from the . - - - Determines whether the contains an element with the specified key. - The key to locate in the . - true if the contains an element with the key; otherwise, false. - - - Returns an enumerator for this class. - An enumerator of type . - - - Gets a value indicating whether the has a fixed size. - true if the has a fixed size; otherwise, false. - - - Gets a value indicating whether the is read-only. - true if the is read-only; otherwise, false. - - - Gets or sets the element with the specified key. - The key of the element to get or set. - The element with the specified key. - - - Gets an containing the keys of the . - An containing the keys of the . - - - Removes the element with the specified key from the . - The key of the element to remove. - - - Gets an containing the values in the . - An containing the values in the . - - - Returns an for the . - An for the . - - - Adds an item to the . - The item to add to the collection. - The position into which the new element was inserted. - - - Removes all items from the collection. - The collection is read-only. - - - Determines whether the collection contains a specific value. - The item to locate in the collection. - true if the item is found in the collection; otherwise, false. - - - Determines the index of a specified item in the collection. - The item to locate in the collection. - The index of value if found in the list, otherwise -1. - - - Inserts an item into the collection at a specified index. - The zero-based index at which value should be inserted. - The item to insert into the collection. - The collection is read-only. - - - Gets a value indicating whether the collection has a fixed size. - true if the collection has a fixed size; otherwise, false. - - - Gets a value indicating whether the collection is read-only. - true if the collection is read-only; otherwise, false. - - - Gets or sets an item from the collection at a specified index. - The zero-based index of the item to get or set. - The element at the specified index. - The collection is read-only. - value is not a . - index is less than 0. -or- index is equal to or greater than . - - - Removes the first occurrence of a specified value from the collection. - The item to remove from the collection. - The collection is read-only. - - - Removes the item at the specified index. - The zero-based index of the item to remove. - The collection is read-only. - - - Identifies the property tab or tabs to display for the specified class or classes. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class using the specified tab class name. - The assembly qualified name of the type of tab to create. For an example of this format convention, see . - - - Initializes a new instance of the class using the specified type of tab. - The type of tab to create. - - - Initializes a new instance of the class using the specified tab class name and tab scope. - The assembly qualified name of the type of tab to create. For an example of this format convention, see . - A that indicates the scope of this tab. If the scope is , it is shown only for components with the corresponding . If it is , it is shown for all components on the document. - tabScope is not or . - - - Initializes a new instance of the class using the specified type of tab and tab scope. - The type of tab to create. - A that indicates the scope of this tab. If the scope is , it is shown only for components with the corresponding . If it is , it is shown for all components on the document. - tabScope is not or . - - - Returns a value indicating whether this instance is equal to a specified attribute. - A to compare to this instance, or null. - true if the instances are equal; otherwise, false. - The types specified by the property of the other parameter cannot be found. - - - Returns a value indicating whether this instance is equal to a specified object. - An object to compare to this instance, or null. - true if other refers to the same instance; otherwise, false. - The types specified by the property of the other parameter could not be found. - - - Gets the hash code for this object. - The hash code for the object the attribute belongs to. - - - Initializes the attribute using the specified names of tab classes and array of tab scopes. - An array of fully qualified type names of the types to create for tabs on the Properties window. - The scope of each tab. If the scope is , it is shown only for components with the corresponding . If it is , it is shown for all components on the document. - One or more of the values in tabScopes is not or . -or- The length of the tabClassNames and tabScopes arrays do not match. -or- tabClassNames or tabScopes is null. - - - Initializes the attribute using the specified names of tab classes and array of tab scopes. - The types of tabs to create. - The scope of each tab. If the scope is , it is shown only for components with the corresponding . If it is , it is shown for all components on the document. - One or more of the values in tabScopes is not or . -or- The length of the tabClassNames and tabScopes arrays do not match. -or- tabClassNames or tabScopes is null. - - - Gets the types of tabs that this attribute uses. - An array of types indicating the types of tabs that this attribute uses. - The types specified by the property could not be found. - - - Gets the names of the tab classes that this attribute uses. - The names of the tab classes that this attribute uses. - - - Gets an array of tab scopes of each tab of this . - An array of objects that indicate the scopes of the tabs. - - - Defines identifiers that indicate the persistence scope of a tab in the Properties window. - - - This tab is specific to the current component. This tab is added to the Properties window for the current component only and is removed when the component is no longer selected. - - - - This tab is specific to the current document. This tab is added to the Properties window and is removed when the currently selected document changes. - - - - This tab is added to the Properties window and can only be removed explicitly by a parent component. - - - - This tab is added to the Properties window and cannot be removed. - - - - Specifies the name of the property that an implementer of offers to other components. This class cannot be inherited - - - Initializes a new instance of the class with the name of the property and the type of its receiver. - The name of the property extending to an object of the specified type. - The name of the data type this property can extend. - - - Initializes a new instance of the class with the name of the property and its . - The name of the property extending to an object of the specified type. - The of the data type of the object that can receive the property. - - - Returns whether the value of the given object is equal to the current . - The object to test the value equality of. - true if the value of the given object is equal to that of the current; otherwise, false. - - - Returns the hash code for this instance. - A hash code for the current . - - - Gets the name of a property that this class provides. - The name of a property that this class provides. - - - Gets the name of the data type this property can extend. - The name of the data type this property can extend. - - - Gets a unique identifier for this attribute. - An that is a unique identifier for the attribute. - - - Specifies whether the property this attribute is bound to is read-only or read/write. This class cannot be inherited - - - Initializes a new instance of the class. - true to show that the property this attribute is bound to is read-only; false to show that the property is read/write. - - - Specifies the default value for the , which is (that is, the property this attribute is bound to is read/write). This static field is read-only. - - - - Indicates whether this instance and a specified object are equal. - Another object to compare to. - true if value is equal to this instance; otherwise, false. - - - Returns the hash code for this instance. - A hash code for the current . - - - Determines if this attribute is the default. - true if the attribute is the default value for this attribute class; otherwise, false. - - - Gets a value indicating whether the property this attribute is bound to is read-only. - true if the property this attribute is bound to is read-only; false if the property is read/write. - - - Specifies that the property this attribute is bound to is read/write and can be modified. This static field is read-only. - - - - Specifies that the property this attribute is bound to is read-only and cannot be modified in the server explorer. This static field is read-only. - - - - Represents the exception that is thrown when a duplicate database object name is encountered during an add operation in a -related object. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with the specified string. - The string to display when the exception is thrown. - - - Initializes a new instance of the class with serialization information. - The data that is required to serialize or deserialize an object. - Description of the source and destination of the specified serialized stream. - - - Initializes a new instance of the class with the specified string and exception. - The error message that explains the reason for the exception. - The exception that is the cause of the current exception, or a null reference (Nothing in Visual Basic) if no inner exception is specified. - - - The exception that is thrown when an attempt to load a class fails due to the absence of an entry method. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with a specified error message. - The error message that explains the reason for the exception. - - - Initializes a new instance of the class with serialized data. - The object that holds the serialized object data. - The contextual information about the source or destination. - - - Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. - The error message that explains the reason for the exception. - The exception that is the cause of the current exception. If the inner parameter is not a null reference (Nothing in Visual Basic), the current exception is raised in a catch block that handles the inner exception. - - - Provides the base class for enumerations. - - - Initializes a new instance of the class. - - - Compares this instance to a specified object and returns an indication of their relative values. - An object to compare, or null. -

A signed number that indicates the relative values of this instance and target.

-
Value

-

Meaning

-

Less than zero

-

The value of this instance is less than the value of target.

-

Zero

-

The value of this instance is equal to the value of target.

-

Greater than zero

-

The value of this instance is greater than the value of target.

-

-or-

-

target is null.

-

-
- target and this instance are not the same type. - This instance is not type , , , , , , , or . -
- - Returns a value indicating whether this instance is equal to a specified object. - An object to compare with this instance, or null. - true if obj is an enumeration value of the same type and with the same underlying value as this instance; otherwise, false. - - - Converts the specified value of a specified enumerated type to its equivalent string representation according to the specified format. - The enumeration type of the value to convert. - The value to convert. - The output format to use. - A string representation of value. - The enumType, value, or format parameter is null. - The enumType parameter is not an type. -or- The value is from an enumeration that differs in type from enumType. -or- The type of value is not an underlying type of enumType. - The format parameter contains an invalid value. - format equals "X", but the enumeration type is unknown. - - - Returns the hash code for the value of this instance. - A 32-bit signed integer hash code. - - - Retrieves the name of the constant in the specified enumeration that has the specified value. - An enumeration type. - The value of a particular enumerated constant in terms of its underlying type. - A string containing the name of the enumerated constant in enumType whose value is value; or null if no such constant is found. - enumType or value is null. - enumType is not an . -or- value is neither of type enumType nor does it have the same underlying type as enumType. - - - Retrieves an array of the names of the constants in a specified enumeration. - An enumeration type. - A string array of the names of the constants in enumType. - enumType is null. - enumType parameter is not an . - - - Returns the type code of the underlying type of this enumeration member. - The type code of the underlying type of this instance. - The enumeration type is unknown. - - - Returns the underlying type of the specified enumeration. - The enumeration whose underlying type will be retrieved. - The underlying type of enumType. - enumType is null. - enumType is not an . - - - Retrieves an array of the values of the constants in a specified enumeration. - An enumeration type. - An array that contains the values of the constants in enumType. - enumType is null. - enumType is not an . - The method is invoked by reflection in a reflection-only context, -or- enumType is a type from an assembly loaded in a reflection-only context. - - - Determines whether one or more bit fields are set in the current instance. - An enumeration value. - true if the bit field or bit fields that are set in flag are also set in the current instance; otherwise, false. - flag is a different type than the current instance. - - - Returns an indication whether a constant with a specified value exists in a specified enumeration. - An enumeration type. - The value or name of a constant in enumType. - true if a constant in enumType has a value equal to value; otherwise, false. - enumType or value is null. - enumType is not an Enum. -or- The type of value is an enumeration, but it is not an enumeration of type enumType. -or- The type of value is not an underlying type of enumType. - value is not type , , , , , , , or , or . - - - Converts the string representation of the name or numeric value of one or more enumerated constants to an equivalent enumerated object. - An enumeration type. - A string containing the name or value to convert. - An object of type enumType whose value is represented by value. - enumType or value is null. - enumType is not an . -or- value is either an empty string or only contains white space. -or- value is a name, but not one of the named constants defined for the enumeration. - value is outside the range of the underlying type of enumType. - - - Converts the string representation of the name or numeric value of one or more enumerated constants to an equivalent enumerated object. A parameter specifies whether the operation is case-insensitive. - An enumeration type. - A string containing the name or value to convert. - true to ignore case; false to regard case. - An object of type enumType whose value is represented by value. - enumType or value is null. - enumType is not an . -or- value is either an empty string ("") or only contains white space. -or- value is a name, but not one of the named constants defined for the enumeration. - value is outside the range of the underlying type of enumType. - - - Converts the specified 16-bit signed integer to an enumeration member. - The enumeration type to return. - The value to convert to an enumeration member. - An instance of the enumeration set to value. - enumType is null. - enumType is not an . - - - Converts the specified 64-bit unsigned integer value to an enumeration member. - The enumeration type to return. - The value to convert to an enumeration member. - An instance of the enumeration set to value. - enumType is null. - enumType is not an . - - - Converts the specified 32-bit unsigned integer value to an enumeration member. - The enumeration type to return. - The value to convert to an enumeration member. - An instance of the enumeration set to value. - enumType is null. - enumType is not an . - - - Converts the specified 16-bit unsigned integer value to an enumeration member. - The enumeration type to return. - The value to convert to an enumeration member. - An instance of the enumeration set to value. - enumType is null. - enumType is not an . - - - Converts the specified 8-bit signed integer value to an enumeration member. - The enumeration type to return. - The value to convert to an enumeration member. - An instance of the enumeration set to value. - enumType is null. - enumType is not an . - - - Converts the specified object with an integer value to an enumeration member. - The enumeration type to return. - The value convert to an enumeration member. - An enumeration object whose value is value. - enumType or value is null. - enumType is not an . -or- value is not type , , , , , , , or . - - - Converts the specified 64-bit signed integer to an enumeration member. - The enumeration type to return. - The value to convert to an enumeration member. - An instance of the enumeration set to value. - enumType is null. - enumType is not an . - - - Converts the specified 32-bit signed integer to an enumeration member. - The enumeration type to return. - The value to convert to an enumeration member. - An instance of the enumeration set to value. - enumType is null. - enumType is not an . - - - Converts the specified 8-bit unsigned integer to an enumeration member. - The enumeration type to return. - The value to convert to an enumeration member. - An instance of the enumeration set to value. - enumType is null. - enumType is not an . - - - This method overload is obsolete; use . - A format specification. - (Obsolete.) - The string representation of the value of this instance as specified by format. - format does not contain a valid format specification. - format equals "X", but the enumeration type is unknown. - - - Converts the value of this instance to its equivalent string representation using the specified format. - A format string. - The string representation of the value of this instance as specified by format. - format contains an invalid specification. - format equals "X", but the enumeration type is unknown. - - - This method overload is obsolete; use . - (obsolete) - The string representation of the value of this instance. - - - Converts the value of this instance to its equivalent string representation. - The string representation of the value of this instance. - - - Converts the string representation of the name or numeric value of one or more enumerated constants to an equivalent enumerated object. A parameter specifies whether the operation is case-sensitive. The return value indicates whether the conversion succeeded. - The string representation of the enumeration name or underlying value to convert. - true to ignore case; false to consider case. - When this method returns, result contains an object of type TEnum whose value is represented by value if the parse operation succeeds. If the parse operation fails, result contains the default value of the underlying type of TEnum. Note that this value need not be a member of the TEnum enumeration. This parameter is passed uninitialized. - The enumeration type to which to convert value. - true if the value parameter was converted successfully; otherwise, false. - TEnum is not an enumeration type. - - - Converts the string representation of the name or numeric value of one or more enumerated constants to an equivalent enumerated object. The return value indicates whether the conversion succeeded. - The string representation of the enumeration name or underlying value to convert. - When this method returns, result contains an object of type TEnum whose value is represented by value if the parse operation succeeds. If the parse operation fails, result contains the default value of the underlying type of TEnum. Note that this value need not be a member of the TEnum enumeration. This parameter is passed uninitialized. - The enumeration type to which to convert value. - true if the value parameter was converted successfully; otherwise, false. - TEnum is not an enumeration type. - - - Converts the current value to a Boolean value based on the underlying type. - An object that supplies culture-specific formatting information. - This member always throws an exception. - In all cases. - - - Converts the current value to an 8-bit unsigned integer based on the underlying type. - An object that supplies culture-specific formatting information. - The converted value. - - - Converts the current value to a Unicode character based on the underlying type. - An object that supplies culture-specific formatting information. - This member always throws an exception. - In all cases. - - - Converts the current value to a based on the underlying type. - An object that supplies culture-specific formatting information. - This member always throws an exception. - In all cases. - - - Converts the current value to a based on the underlying type. - An object that supplies culture-specific formatting information. - This member always throws an exception. - In all cases. - - - Converts the current value to a double-precision floating point number based on the underlying type. - An object that supplies culture-specific formatting information. - This member always throws an exception. - In all cases. - - - Converts the current value to a 16-bit signed integer based on the underlying type. - An object that supplies culture-specific formatting information. - The converted value. - - - Converts the current value to a 32-bit signed integer based on the underlying type. - An object that supplies culture-specific formatting information. - The converted value. - - - Converts the current value to a 64-bit signed integer based on the underlying type. - An object that supplies culture-specific formatting information. - The converted value. - - - Converts the current value to an 8-bit signed integer based on the underlying type. - An object that supplies culture-specific formatting information. - The converted value. - - - Converts the current value to a single-precision floating-point number based on the underlying type. - An object that supplies culture-specific formatting information. - This member always throws an exception. - In all cases. - - - Converts the current value to a specified type based on the underlying type. - The type to convert to. - An object that supplies culture-specific formatting information. - The converted value. - - - Converts the current value to a 16-bit unsigned integer based on the underlying type. - An object that supplies culture-specific formatting information. - The converted value. - - - Converts the current value to a 32-bit unsigned integer based on the underlying type. - An object that supplies culture-specific formatting information. - The converted value. - - - Converts the current value to a 64-bit unsigned integer based on the underlying type. - An object that supplies culture-specific formatting information. - The converted value. - - - Specifies enumerated constants used to retrieve directory paths to system special folders. - - - The file system directory that is used to store administrative tools for an individual user. The Microsoft Management Console (MMC) will save customized consoles to this directory, and it will roam with the user. Added in the .NET Framework 4. - - - - The directory that serves as a common repository for application-specific data for the current roaming user. - - - - The file system directory that acts as a staging area for files waiting to be written to a CD. Added in the .NET Framework 4. - - - - The file system directory that contains administrative tools for all users of the computer. Added in the .NET Framework 4. - - - - The directory that serves as a common repository for application-specific data that is used by all users. - - - - The file system directory that contains files and folders that appear on the desktop for all users. This special folder is valid only for Windows NT systems. Added in the .NET Framework 4. - - - - The file system directory that contains documents that are common to all users. This special folder is valid for Windows NT systems, Windows 95, and Windows 98 systems with Shfolder.dll installed. Added in the .NET Framework 4. - - - - The file system directory that serves as a repository for music files common to all users. Added in the .NET Framework 4. - - - - This value is recognized in Windows Vista for backward compatibility, but the special folder itself is no longer used. Added in the .NET Framework 4. - - - - The file system directory that serves as a repository for image files common to all users. Added in the .NET Framework 4. - - - - The directory for components that are shared across applications. To get the x86 common program files directory on a non-x86 system, use the member. - - - - The Program Files folder. Added in the .NET Framework 4. - - - - A folder for components that are shared across applications. This special folder is valid only for Windows NT, Windows 2000, and Windows XP systems. Added in the .NET Framework 4. - - - - The file system directory that contains the programs and folders that appear on the Start menu for all users. This special folder is valid only for Windows NT systems. Added in the .NET Framework 4. - - - - The file system directory that contains the programs that appear in the Startup folder for all users. This special folder is valid only for Windows NT systems. Added in the .NET Framework 4. - - - - The file system directory that contains the templates that are available to all users. This special folder is valid only for Windows NT systems. Added in the .NET Framework 4. - - - - The file system directory that serves as a repository for video files common to all users. Added in the .NET Framework 4. - - - - The directory that serves as a common repository for Internet cookies. - - - - The logical Desktop rather than the physical file system location. - - - - The directory used to physically store file objects on the desktop. - - - - The directory that serves as a common repository for the user's favorite items. - - - - A virtual folder that contains fonts. Added in the .NET Framework 4. - - - - The directory that serves as a common repository for Internet history items. - - - - The directory that serves as a common repository for temporary Internet files. - - - - The directory that serves as a common repository for application-specific data that is used by the current, non-roaming user. - - - - The file system directory that contains localized resource data. Added in the .NET Framework 4. - - - - The My Computer folder. - - - - The My Documents folder. - - - - The My Music folder. - - - - The My Pictures folder. - - - - The file system directory that serves as a repository for videos that belong to a user. Added in the .NET Framework 4. - - - - A file system directory that contains the link objects that may exist in the My Network Places virtual folder. Added in the .NET Framework 4. - - - - The directory that serves as a common repository for documents. - - - - The file system directory that contains the link objects that can exist in the Printers virtual folder. Added in the .NET Framework 4. - - - - The program files directory. On a non-x86 system, passing to the method returns the path for non-x86 programs. To get the x86 program files directory on a non-x86 system, use the member. - - - - The x86 Program Files folder. Added in the .NET Framework 4. - - - - The directory that contains the user's program groups. - - - - The directory that contains the user's most recently used documents. - - - - The file system directory that contains resource data. Added in the .NET Framework 4. - - - - The directory that contains the Send To menu items. - - - - The directory that contains the Start menu items. - - - - The directory that corresponds to the user's Startup program group. - - - - The System directory. - - - - The Windows System folder. Added in the .NET Framework 4. - - - - The directory that serves as a common repository for document templates. - - - - The user's profile folder. Applications should not create files or folders at this level; they should put their data under the locations referred to by . Added in the .NET Framework 4. - - - - The Windows directory or SYSROOT. This corresponds to the %windir% or %SYSTEMROOT% environment variables. Added in the .NET Framework 4. - - - - Specifies options to use for getting the path to a special folder. - - - The path to the folder is created if it does not already exist. - - - - The path to the folder is returned without verifying whether the path exists. If the folder is located on a network, specifying this option can reduce lag time. - - - - The path to the folder is verified. If the folder exists, the path is returned. If the folder does not exist, an empty string is returned. This is the default behavior. - - - - Provides information about, and means to manipulate, the current environment and platform. This class cannot be inherited. - - - Gets the command line for this process. - A string containing command-line arguments. - - - Gets or sets the fully qualified path of the current working directory. - A string containing a directory path. - Attempted to set to an empty string (""). - Attempted to set to null. - An I/O error occurred. - Attempted to set a local path that cannot be found. - The caller does not have the appropriate permission. - - - Gets a unique identifier for the current managed thread. - An integer that represents a unique identifier for this managed thread. - - - Terminates this process and returns an exit code to the operating system. - The exit code to return to the operating system. Use 0 (zero) to indicate that the process completed successfully. - The caller does not have sufficient security permission to perform this function. - - - Gets or sets the exit code of the process. - A 32-bit signed integer containing the exit code. The default value is 0 (zero), which indicates that the process completed successfully. - - - Replaces the name of each environment variable embedded in the specified string with the string equivalent of the value of the variable, then returns the resulting string. - A string containing the names of zero or more environment variables. Each environment variable is quoted with the percent sign character (%). - A string with each environment variable replaced by its value. - name is null. - - - Immediately terminates a process after writing a message to the Windows Application event log, and then includes the message in error reporting to Microsoft. - A message that explains why the process was terminated, or null if no explanation is provided. - - - Immediately terminates a process after writing a message to the Windows Application event log, and then includes the message and exception information in error reporting to Microsoft. - A message that explains why the process was terminated, or null if no explanation is provided. - An exception that represents the error that caused the termination. This is typically the exception in a catch block. - - - Returns a string array containing the command-line arguments for the current process. - An array of string where each element contains a command-line argument. The first element is the executable file name, and the following zero or more elements contain the remaining command-line arguments. - The system does not support command-line arguments. - - - Retrieves the value of an environment variable from the current process. - The name of the environment variable. - The value of the environment variable specified by variable, or null if the environment variable is not found. - variable is null. - The caller does not have the required permission to perform this operation. - - - Retrieves the value of an environment variable from the current process or from the Windows operating system registry key for the current user or local machine. - The name of an environment variable. - One of the values. - The value of the environment variable specified by the variable and target parameters, or null if the environment variable is not found. - variable is null. - target is not a valid value. - The caller does not have the required permission to perform this operation. - - - Retrieves all environment variable names and their values from the current process. - A dictionary that contains all environment variable names and their values; otherwise, an empty dictionary if no environment variables are found. - The caller does not have the required permission to perform this operation. - The buffer is out of memory. - - - Retrieves all environment variable names and their values from the current process, or from the Windows operating system registry key for the current user or local machine. - One of the values. - A dictionary that contains all environment variable names and their values from the source specified by the target parameter; otherwise, an empty dictionary if no environment variables are found. - The caller does not have the required permission to perform this operation for the specified value of target. - target contains an illegal value. - - - Gets the path to the system special folder that is identified by the specified enumeration. - An enumerated constant that identifies a system special folder. - The path to the specified system special folder, if that folder physically exists on your computer; otherwise, an empty string (""). A folder will not physically exist if the operating system did not create it, the existing folder was deleted, or the folder is a virtual directory, such as My Computer, which does not correspond to a physical path. - folder is not a member of . - The current platform is not supported. - - - Gets the path to the system special folder that is identified by the specified enumeration, and uses a specified option for accessing special folders. - An enumerated constant that identifies a system special folder. - Specifies options to use for accessing a special folder. - The path to the specified system special folder, if that folder physically exists on your computer; otherwise, an empty string (""). A folder will not physically exist if the operating system did not create it, the existing folder was deleted, or the folder is a virtual directory, such as My Computer, which does not correspond to a physical path. - folder is not a member of - - - - Returns an array of string containing the names of the logical drives on the current computer. - An array of strings where each element contains the name of a logical drive. For example, if the computer's hard drive is the first logical drive, the first element returned is "C:\". - An I/O error occurs. - The caller does not have the required permissions. - - - Gets a value that indicates whether the current application domain is being unloaded or the common language runtime (CLR) is shutting down. - true if the current application domain is being unloaded or the CLR is shutting down; otherwise, false. - - - Determines whether the current operating system is a 64-bit operating system. - true if the operating system is 64-bit; otherwise, false. - - - Determines whether the current process is a 64-bit process. - true if the process is 64-bit; otherwise, false. - - - Gets the NetBIOS name of this local computer. - A string containing the name of this computer. - The name of this computer cannot be obtained. - - - Gets the newline string defined for this environment. - A string containing "\r\n" for non-Unix platforms, or a string containing "\n" for Unix platforms. - - - Gets an object that contains the current platform identifier and version number. - An object that contains the platform identifier and version number. - This property was unable to obtain the system version. -or- The obtained platform identifier is not a member of - - - Gets the number of processors on the current machine. - The 32-bit signed integer that specifies the number of processors on the current machine. There is no default. If the current machine contains multiple processor groups, this property returns the number of logical processors that are available for use by the common language runtime (CLR). - - - Creates, modifies, or deletes an environment variable stored in the current process. - The name of an environment variable. - A value to assign to variable. - variable is null. - variable contains a zero-length string, an initial hexadecimal zero character (0x00), or an equal sign ("="). -or- The length of variable or value is greater than or equal to 32,767 characters. -or- An error occurred during the execution of this operation. - The caller does not have the required permission to perform this operation. - - - Creates, modifies, or deletes an environment variable stored in the current process or in the Windows operating system registry key reserved for the current user or local machine. - The name of an environment variable. - A value to assign to variable. - One of the enumeration values that specifies the location of the environment variable. - variable is null. - variable contains a zero-length string, an initial hexadecimal zero character (0x00), or an equal sign ("="). -or- The length of variable is greater than or equal to 32,767 characters. -or- target is not a member of the enumeration. -or- target is or , and the length of variable is greater than or equal to 255. -or- target is and the length of value is greater than or equal to 32,767 characters. -or- An error occurred during the execution of this operation. - The caller does not have the required permission to perform this operation. - - - Gets current stack trace information. - A string containing stack trace information. This value can be . - - - Gets the fully qualified path of the system directory. - A string containing a directory path. - - - Gets the number of bytes in the operating system's memory page. - The number of bytes in the system memory page. - - - Gets the number of milliseconds elapsed since the system started. - A 32-bit signed integer containing the amount of time in milliseconds that has passed since the last time the computer was started. - - - Gets the network domain name associated with the current user. - The network domain name associated with the current user. - The operating system does not support retrieving the network domain name. - The network domain name cannot be retrieved. - - - Gets a value indicating whether the current process is running in user interactive mode. - true if the current process is running in user interactive mode; otherwise, false. - - - Gets the user name of the person who is currently logged on to the Windows operating system. - The user name of the person who is logged on to Windows. - - - Gets a object that describes the major, minor, build, and revision numbers of the common language runtime. - An object that displays the version of the common language runtime. - - - Gets the amount of physical memory mapped to the process context. - A 64-bit signed integer containing the number of bytes of physical memory mapped to the process context. - - - Specifies the location where an environment variable is stored or retrieved in a set or get operation. - - - The environment variable is stored or retrieved from the HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment key in the Windows operating system registry. - - - - The environment variable is stored or retrieved from the environment block associated with the current process. - - - - The environment variable is stored or retrieved from the HKEY_CURRENT_USER\Environment key in the Windows operating system registry. - - - - Represents the base class for classes that contain event data, and provides a value to use for events that do not include event data. - - - Initializes a new instance of the class. - - - Provides a value to use with events that do not have event data. - - - - Represents the method that will handle an event when the event provides data. - The source of the event. - An object that contains the event data. - The type of the event data generated by the event. - - - Represents the method that will handle an event that has no event data. - The source of the event. - An object that contains no event data. - - - Represents errors that occur during application execution. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with a specified error message. - The message that describes the error. - - - Initializes a new instance of the class with serialized data. - The that holds the serialized object data about the exception being thrown. - The that contains contextual information about the source or destination. - The info parameter is null. - The class name is null or is zero (0). - - - Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. - The error message that explains the reason for the exception. - The exception that is the cause of the current exception, or a null reference (Nothing in Visual Basic) if no inner exception is specified. - - - Gets a collection of key/value pairs that provide additional user-defined information about the exception. - An object that implements the interface and contains a collection of user-defined key/value pairs. The default is an empty collection. - - - When overridden in a derived class, returns the that is the root cause of one or more subsequent exceptions. - The first exception thrown in a chain of exceptions. If the property of the current exception is a null reference (Nothing in Visual Basic), this property returns the current exception. - - - When overridden in a derived class, sets the with information about the exception. - The that holds the serialized object data about the exception being thrown. - The that contains contextual information about the source or destination. - The info parameter is a null reference (Nothing in Visual Basic). - - - Gets the runtime type of the current instance. - A object that represents the exact runtime type of the current instance. - - - Gets or sets a link to the help file associated with this exception. - The Uniform Resource Name (URN) or Uniform Resource Locator (URL). - - - Gets or sets HRESULT, a coded numerical value that is assigned to a specific exception. - The HRESULT value. - - - Gets the instance that caused the current exception. - An object that describes the error that caused the current exception. The property returns the same value as was passed into the constructor, or null if the inner exception value was not supplied to the constructor. This property is read-only. - - - Gets a message that describes the current exception. - The error message that explains the reason for the exception, or an empty string (""). - - - Occurs when an exception is serialized to create an exception state object that contains serialized data about the exception. - - - - Gets or sets the name of the application or the object that causes the error. - The name of the application or the object that causes the error. - The object must be a runtime object - - - Gets a string representation of the immediate frames on the call stack. - A string that describes the immediate frames of the call stack. - - - Gets the method that throws the current exception. - The that threw the current exception. - - - Creates and returns a string representation of the current exception. - A string representation of the current exception. - - - The exception that is thrown when there is an internal error in the execution engine of the common language runtime. This class cannot be inherited. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with a specified error message. - The message that describes the error. - - - Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. - The error message that explains the reason for the exception. - The exception that is the cause of the current exception. If the innerException parameter is not a null reference (Nothing in Visual Basic), the current exception is raised in a catch block that handles the inner exception. - - - The exception that is thrown when there is an invalid attempt to access a private or protected field inside a class. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with a specified error message. - The error message that explains the reason for the exception. - - - Initializes a new instance of the class with serialized data. - The object that holds the serialized object data. - The contextual information about the source or destination. - - - Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. - The error message that explains the reason for the exception. - The exception that is the cause of the current exception. If the inner parameter is not null, the current exception is raised in a catch block that handles the inner exception. - - - A customizable parser based on the File scheme. - - - Creates a customizable parser based on the File scheme. - - - Indicates that an enumeration can be treated as a bit field; that is, a set of flags. - - - Initializes a new instance of the class. - - - The exception that is thrown when the format of an argument is invalid, or when a composite format string is not well formed. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with a specified error message. - The message that describes the error. - - - Initializes a new instance of the class with serialized data. - The object that holds the serialized object data. - The contextual information about the source or destination. - - - Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. - The error message that explains the reason for the exception. - The exception that is the cause of the current exception. If the innerException parameter is not a null reference (Nothing in Visual Basic), the current exception is raised in a catch block that handles the inner exception. - - - Represents a composite format string, along with the arguments to be formatted. - - - Instantiates a new instance of the class. - - - Gets the number of arguments to be formatted. - The number of arguments to be formatted. - - - Returns the composite format string. - The composite format string. - - - Returns the argument at the specified index position. - The index of the argument. Its value can range from zero to one less than the value of . - The argument. - - - Returns an object array that contains one or more objects to format. - An object array that contains one or more objects to format. - - - Returns a result string in which arguments are formatted by using the conventions of the invariant culture. - The object to convert to a result string. - The string that results from formatting the current instance by using the conventions of the invariant culture. - formattable is null. - - - Returns the string that results from formatting the composite format string along with its arguments by using the formatting conventions of the current culture. - A result string formatted by using the conventions of the current culture. - - - Returns the string that results from formatting the composite format string along with its arguments by using the formatting conventions of a specified culture. - An object that provides culture-specific formatting information. - A result string formatted by using the conventions of formatProvider. - - - Returns the string that results from formatting the format string along with its arguments by using the formatting conventions of a specified culture. - A string. This argument is ignored. - An object that provides culture-specific formatting information. - A string formatted using the conventions of the formatProvider parameter. - - - A customizable parser based on the File Transfer Protocol (FTP) scheme. - - - Creates a customizable parser based on the File Transfer Protocol (FTP) scheme. - - - Encapsulates a method that has no parameters and returns a value of the type specified by the TResult parameter. - The type of the return value of the method that this delegate encapsulates. - - - - Encapsulates a method that has nine parameters and returns a value of the type specified by the TResult parameter. - The first parameter of the method that this delegate encapsulates. - The second parameter of the method that this delegate encapsulates. - The third parameter of the method that this delegate encapsulates. - The fourth parameter of the method that this delegate encapsulates. - The fifth parameter of the method that this delegate encapsulates. - The sixth parameter of the method that this delegate encapsulates. - The seventh parameter of the method that this delegate encapsulates. - The eighth parameter of the method that this delegate encapsulates. - The ninth parameter of the method that this delegate encapsulates. - The type of the first parameter of the method that this delegate encapsulates. - The type of the second parameter of the method that this delegate encapsulates. - The type of the third parameter of the method that this delegate encapsulates. - The type of the fourth parameter of the method that this delegate encapsulates. - The type of the fifth parameter of the method that this delegate encapsulates. - The type of the sixth parameter of the method that this delegate encapsulates. - The type of the seventh parameter of the method that this delegate encapsulates. - The type of the eighth parameter of the method that this delegate encapsulates. - The type of the ninth parameter of the method that this delegate encapsulates. - The type of the return value of the method that this delegate encapsulates. - - - - Encapsulates a method that has 10 parameters and returns a value of the type specified by the TResult parameter. - The first parameter of the method that this delegate encapsulates. - The second parameter of the method that this delegate encapsulates. - The third parameter of the method that this delegate encapsulates. - The fourth parameter of the method that this delegate encapsulates. - The fifth parameter of the method that this delegate encapsulates. - The sixth parameter of the method that this delegate encapsulates. - The seventh parameter of the method that this delegate encapsulates. - The eighth parameter of the method that this delegate encapsulates. - The ninth parameter of the method that this delegate encapsulates. - The tenth parameter of the method that this delegate encapsulates. - The type of the first parameter of the method that this delegate encapsulates. - The type of the second parameter of the method that this delegate encapsulates. - The type of the third parameter of the method that this delegate encapsulates. - The type of the fourth parameter of the method that this delegate encapsulates. - The type of the fifth parameter of the method that this delegate encapsulates. - The type of the sixth parameter of the method that this delegate encapsulates. - The type of the seventh parameter of the method that this delegate encapsulates. - The type of the eighth parameter of the method that this delegate encapsulates. - The type of the ninth parameter of the method that this delegate encapsulates. - The type of the tenth parameter of the method that this delegate encapsulates. - The type of the return value of the method that this delegate encapsulates. - - - - Encapsulates a method that has 11 parameters and returns a value of the type specified by the TResult parameter. - The first parameter of the method that this delegate encapsulates. - The second parameter of the method that this delegate encapsulates. - The third parameter of the method that this delegate encapsulates. - The fourth parameter of the method that this delegate encapsulates. - The fifth parameter of the method that this delegate encapsulates. - The sixth parameter of the method that this delegate encapsulates. - The seventh parameter of the method that this delegate encapsulates. - The eighth parameter of the method that this delegate encapsulates. - The ninth parameter of the method that this delegate encapsulates. - The tenth parameter of the method that this delegate encapsulates. - The eleventh parameter of the method that this delegate encapsulates. - The type of the first parameter of the method that this delegate encapsulates. - The type of the second parameter of the method that this delegate encapsulates. - The type of the third parameter of the method that this delegate encapsulates. - The type of the fourth parameter of the method that this delegate encapsulates. - The type of the fifth parameter of the method that this delegate encapsulates. - The type of the sixth parameter of the method that this delegate encapsulates. - The type of the seventh parameter of the method that this delegate encapsulates. - The type of the eighth parameter of the method that this delegate encapsulates. - The type of the ninth parameter of the method that this delegate encapsulates. - The type of the tenth parameter of the method that this delegate encapsulates. - The type of the eleventh parameter of the method that this delegate encapsulates. - The type of the return value of the method that this delegate encapsulates. - - - - Encapsulates a method that has 12 parameters and returns a value of the type specified by the TResult parameter. - The first parameter of the method that this delegate encapsulates. - The second parameter of the method that this delegate encapsulates. - The third parameter of the method that this delegate encapsulates. - The fourth parameter of the method that this delegate encapsulates. - The fifth parameter of the method that this delegate encapsulates. - The sixth parameter of the method that this delegate encapsulates. - The seventh parameter of the method that this delegate encapsulates. - The eighth parameter of the method that this delegate encapsulates. - The ninth parameter of the method that this delegate encapsulates. - The tenth parameter of the method that this delegate encapsulates. - The eleventh parameter of the method that this delegate encapsulates. - The twelfth parameter of the method that this delegate encapsulates. - The type of the first parameter of the method that this delegate encapsulates. - The type of the second parameter of the method that this delegate encapsulates. - The type of the third parameter of the method that this delegate encapsulates. - The type of the fourth parameter of the method that this delegate encapsulates. - The type of the fifth parameter of the method that this delegate encapsulates. - The type of the sixth parameter of the method that this delegate encapsulates. - The type of the seventh parameter of the method that this delegate encapsulates. - The type of the eighth parameter of the method that this delegate encapsulates. - The type of the ninth parameter of the method that this delegate encapsulates. - The type of the tenth parameter of the method that this delegate encapsulates. - The type of the eleventh parameter of the method that this delegate encapsulates. - The type of the twelfth parameter of the method that this delegate encapsulates. - The type of the return value of the method that this delegate encapsulates. - - - - Encapsulates a method that has 13 parameters and returns a value of the type specified by the TResult parameter. - The first parameter of the method that this delegate encapsulates. - The second parameter of the method that this delegate encapsulates. - The third parameter of the method that this delegate encapsulates. - The fourth parameter of the method that this delegate encapsulates. - The fifth parameter of the method that this delegate encapsulates. - The sixth parameter of the method that this delegate encapsulates. - The seventh parameter of the method that this delegate encapsulates. - The eighth parameter of the method that this delegate encapsulates. - The ninth parameter of the method that this delegate encapsulates. - The tenth parameter of the method that this delegate encapsulates. - The eleventh parameter of the method that this delegate encapsulates. - The twelfth parameter of the method that this delegate encapsulates. - The thirteenth parameter of the method that this delegate encapsulates. - The type of the first parameter of the method that this delegate encapsulates. - The type of the second parameter of the method that this delegate encapsulates. - The type of the third parameter of the method that this delegate encapsulates. - The type of the fourth parameter of the method that this delegate encapsulates. - The type of the fifth parameter of the method that this delegate encapsulates. - The type of the sixth parameter of the method that this delegate encapsulates. - The type of the seventh parameter of the method that this delegate encapsulates. - The type of the eighth parameter of the method that this delegate encapsulates. - The type of the ninth parameter of the method that this delegate encapsulates. - The type of the tenth parameter of the method that this delegate encapsulates. - The type of the eleventh parameter of the method that this delegate encapsulates. - The type of the twelfth parameter of the method that this delegate encapsulates. - The type of the thirteenth parameter of the method that this delegate encapsulates. - The type of the return value of the method that this delegate encapsulates. - - - - Encapsulates a method that has 14 parameters and returns a value of the type specified by the TResult parameter. - The first parameter of the method that this delegate encapsulates. - The second parameter of the method that this delegate encapsulates. - The third parameter of the method that this delegate encapsulates. - The fourth parameter of the method that this delegate encapsulates. - The fifth parameter of the method that this delegate encapsulates. - The sixth parameter of the method that this delegate encapsulates. - The seventh parameter of the method that this delegate encapsulates. - The eighth parameter of the method that this delegate encapsulates. - The ninth parameter of the method that this delegate encapsulates. - The tenth parameter of the method that this delegate encapsulates. - The eleventh parameter of the method that this delegate encapsulates. - The twelfth parameter of the method that this delegate encapsulates. - The thirteenth parameter of the method that this delegate encapsulates. - The fourteenth parameter of the method that this delegate encapsulates. - The type of the first parameter of the method that this delegate encapsulates. - The type of the second parameter of the method that this delegate encapsulates. - The type of the third parameter of the method that this delegate encapsulates. - The type of the fourth parameter of the method that this delegate encapsulates. - The type of the fifth parameter of the method that this delegate encapsulates. - The type of the sixth parameter of the method that this delegate encapsulates. - The type of the seventh parameter of the method that this delegate encapsulates. - The type of the eighth parameter of the method that this delegate encapsulates. - The type of the ninth parameter of the method that this delegate encapsulates. - The type of the tenth parameter of the method that this delegate encapsulates. - The type of the eleventh parameter of the method that this delegate encapsulates. - The type of the twelfth parameter of the method that this delegate encapsulates. - The type of the thirteenth parameter of the method that this delegate encapsulates. - The type of the fourteenth parameter of the method that this delegate encapsulates. - The type of the return value of the method that this delegate encapsulates. - - - - Encapsulates a method that has 15 parameters and returns a value of the type specified by the TResult parameter. - The first parameter of the method that this delegate encapsulates. - The second parameter of the method that this delegate encapsulates. - The third parameter of the method that this delegate encapsulates. - The fourth parameter of the method that this delegate encapsulates. - The fifth parameter of the method that this delegate encapsulates. - The sixth parameter of the method that this delegate encapsulates. - The seventh parameter of the method that this delegate encapsulates. - The eighth parameter of the method that this delegate encapsulates. - The ninth parameter of the method that this delegate encapsulates. - The tenth parameter of the method that this delegate encapsulates. - The eleventh parameter of the method that this delegate encapsulates. - The twelfth parameter of the method that this delegate encapsulates. - The thirteenth parameter of the method that this delegate encapsulates. - The fourteenth parameter of the method that this delegate encapsulates. - The fifteenth parameter of the method that this delegate encapsulates. - The type of the first parameter of the method that this delegate encapsulates. - The type of the second parameter of the method that this delegate encapsulates. - The type of the third parameter of the method that this delegate encapsulates. - The type of the fourth parameter of the method that this delegate encapsulates. - The type of the fifth parameter of the method that this delegate encapsulates. - The type of the sixth parameter of the method that this delegate encapsulates. - The type of the seventh parameter of the method that this delegate encapsulates. - The type of the eighth parameter of the method that this delegate encapsulates. - The type of the ninth parameter of the method that this delegate encapsulates. - The type of the tenth parameter of the method that this delegate encapsulates. - The type of the eleventh parameter of the method that this delegate encapsulates. - The type of the twelfth parameter of the method that this delegate encapsulates. - The type of the thirteenth parameter of the method that this delegate encapsulates. - The type of the fourteenth parameter of the method that this delegate encapsulates. - The type of the fifteenth parameter of the method that this delegate encapsulates. - The type of the return value of the method that this delegate encapsulates. - - - - Encapsulates a method that has 16 parameters and returns a value of the type specified by the TResult parameter. - The first parameter of the method that this delegate encapsulates. - The second parameter of the method that this delegate encapsulates. - The third parameter of the method that this delegate encapsulates. - The fourth parameter of the method that this delegate encapsulates. - The fifth parameter of the method that this delegate encapsulates. - The sixth parameter of the method that this delegate encapsulates. - The seventh parameter of the method that this delegate encapsulates. - The eighth parameter of the method that this delegate encapsulates. - The ninth parameter of the method that this delegate encapsulates. - The tenth parameter of the method that this delegate encapsulates. - The eleventh parameter of the method that this delegate encapsulates. - The twelfth parameter of the method that this delegate encapsulates. - The thirteenth parameter of the method that this delegate encapsulates. - The fourteenth parameter of the method that this delegate encapsulates. - The fifteenth parameter of the method that this delegate encapsulates. - The sixteenth parameter of the method that this delegate encapsulates. - The type of the first parameter of the method that this delegate encapsulates. - The type of the second parameter of the method that this delegate encapsulates. - The type of the third parameter of the method that this delegate encapsulates. - The type of the fourth parameter of the method that this delegate encapsulates. - The type of the fifth parameter of the method that this delegate encapsulates. - The type of the sixth parameter of the method that this delegate encapsulates. - The type of the seventh parameter of the method that this delegate encapsulates. - The type of the eighth parameter of the method that this delegate encapsulates. - The type of the ninth parameter of the method that this delegate encapsulates. - The type of the tenth parameter of the method that this delegate encapsulates. - The type of the eleventh parameter of the method that this delegate encapsulates. - The type of the twelfth parameter of the method that this delegate encapsulates. - The type of the thirteenth parameter of the method that this delegate encapsulates. - The type of the fourteenth parameter of the method that this delegate encapsulates. - The type of the fifteenth parameter of the method that this delegate encapsulates. - The type of the sixteenth parameter of the method that this delegate encapsulates. - The type of the return value of the method that this delegate encapsulates. - - - - Provides data for the directory events: , , . - - - Initializes a new instance of the class. - One of the values, which represents the kind of change detected in the file system. - The root directory of the affected file or directory. - The name of the affected file or directory. - - - Gets the type of directory event that occurred. - One of the values that represents the kind of change detected in the file system. - - - Gets the fully qualifed path of the affected file or directory. - The path of the affected file or directory. - - - Gets the name of the affected file or directory. - The name of the affected file or directory. - - - Represents the method that will handle the , , or event of a class. - The source of the event. - The that contains the event data. - - - Provides the base class for both and objects. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with serialized data. - The that holds the serialized object data about the exception being thrown. - The that contains contextual information about the source or destination. - The specified is null. - - - Gets or sets the attributes for the current file or directory. - of the current . - The specified file doesn't exist. Only thrown when setting the property value. - The specified path is invalid. For example, it's on an unmapped drive. Only thrown when setting the property value. - The caller doesn't have the required permission. - The caller attempts to set an invalid file attribute. -or- The user attempts to set an attribute value but doesn't have write permission. - cannot initialize the data. - - - Gets or sets the creation time of the current file or directory. - The creation date and time of the current object. - cannot initialize the data. - The specified path is invalid; for example, it is on an unmapped drive. - The current operating system is not Windows NT or later. - The caller attempts to set an invalid creation time. - - - Gets or sets the creation time, in coordinated universal time (UTC), of the current file or directory. - The creation date and time in UTC format of the current object. - cannot initialize the data. - The specified path is invalid; for example, it is on an unmapped drive. - The current operating system is not Windows NT or later. - The caller attempts to set an invalid access time. - - - Deletes a file or directory. - The specified path is invalid; for example, it is on an unmapped drive. - There is an open handle on the file or directory, and the operating system is Windows XP or earlier. This open handle can result from enumerating directories and files. For more information, see How to: Enumerate Directories and Files. - - - Gets a value indicating whether the file or directory exists. - true if the file or directory exists; otherwise, false. - - - Gets the string representing the extension part of the file. - A string containing the extension. - - - Gets the full path of the directory or file. - A string containing the full path. - The fully qualified path and file name is 260 or more characters. - The caller does not have the required permission. - - - Represents the fully qualified path of the directory or file. - - The fully qualified path is 260 or more characters. - - - Sets the object with the file name and additional exception information. - The that holds the serialized object data about the exception being thrown. - The that contains contextual information about the source or destination. - - - Gets or sets the time the current file or directory was last accessed. - The time that the current file or directory was last accessed. - cannot initialize the data. - The current operating system is not Windows NT or later. - The caller attempts to set an invalid access time - - - Gets or sets the time, in coordinated universal time (UTC), that the current file or directory was last accessed. - The UTC time that the current file or directory was last accessed. - cannot initialize the data. - The current operating system is not Windows NT or later. - The caller attempts to set an invalid access time. - - - Gets or sets the time when the current file or directory was last written to. - The time the current file was last written. - cannot initialize the data. - The current operating system is not Windows NT or later. - The caller attempts to set an invalid write time. - - - Gets or sets the time, in coordinated universal time (UTC), when the current file or directory was last written to. - The UTC time when the current file was last written to. - cannot initialize the data. - The current operating system is not Windows NT or later. - The caller attempts to set an invalid write time. - - - For files, gets the name of the file. For directories, gets the name of the last directory in the hierarchy if a hierarchy exists. Otherwise, the Name property gets the name of the directory. - A string that is the name of the parent directory, the name of the last directory in the hierarchy, or the name of a file, including the file name extension. - - - The path originally specified by the user, whether relative or absolute. - - - - Refreshes the state of the object. - A device such as a disk drive is not ready. - - - Listens to the file system change notifications and raises events when a directory, or file in a directory, changes. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class, given the specified directory to monitor. - The directory to monitor, in standard or Universal Naming Convention (UNC) notation. - The path parameter is null. - The path parameter is an empty string (""). -or- The path specified through the path parameter does not exist. - path is too long. - - - Initializes a new instance of the class, given the specified directory and type of files to monitor. - The directory to monitor, in standard or Universal Naming Convention (UNC) notation. - The type of files to watch. For example, "*.txt" watches for changes to all text files. - The path parameter is null. -or- The filter parameter is null. - The path parameter is an empty string (""). -or- The path specified through the path parameter does not exist. - path is too long. - - - Begins the initialization of a used on a form or used by another component. The initialization occurs at run time. - - - Occurs when a file or directory in the specified is changed. - - - - Occurs when a file or directory in the specified is created. - - - - Occurs when a file or directory in the specified is deleted. - - - - Releases the unmanaged resources used by the and optionally releases the managed resources. - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - Gets or sets a value indicating whether the component is enabled. - true if the component is enabled; otherwise, false. The default is false. If you are using the component on a designer in Visual Studio 2005, the default is true. - The object has been disposed. - The current operating system is not Microsoft Windows NT or later. - The directory specified in could not be found. - has not been set or is invalid. - - - Ends the initialization of a used on a form or used by another component. The initialization occurs at run time. - - - Occurs when the instance of is unable to continue monitoring changes or when the internal buffer overflows. - - - - Gets or sets the filter string used to determine what files are monitored in a directory. - The filter string. The default is ".\" (Watches all files.) - - - Gets or sets a value indicating whether subdirectories within the specified path should be monitored. - true if you want to monitor subdirectories; otherwise, false. The default is false. - - - Gets or sets the size (in bytes) of the internal buffer. - The internal buffer size in bytes. The default is 8192 (8 KB). - - - Gets or sets the type of changes to watch for. - One of the values. The default is the bitwise OR combination of LastWrite, FileName, and DirectoryName. - The value is not a valid bitwise OR combination of the values. - The value that is being set is not valid. - - - Raises the event. - A that contains the event data. - - - Raises the event. - A that contains the event data. - - - Raises the event. - A that contains the event data. - - - Raises the event. - An that contains the event data. - - - Raises the event. - A that contains the event data. - - - Gets or sets the path of the directory to watch. - The path to monitor. The default is an empty string (""). - The specified path does not exist or could not be found. -or- The specified path contains wildcard characters. -or- The specified path contains invalid path characters. - - - Occurs when a file or directory in the specified is renamed. - - - - Gets or sets an for the . - An for the . - - - Gets or sets the object used to marshal the event handler calls issued as a result of a directory change. - The that represents the object used to marshal the event handler calls issued as a result of a directory change. The default is null. - - - A synchronous method that returns a structure that contains specific information on the change that occurred, given the type of change you want to monitor. - The to watch for. - A that contains specific information on the change that occurred. - - - A synchronous method that returns a structure that contains specific information on the change that occurred, given the type of change you want to monitor and the time (in milliseconds) to wait before timing out. - The to watch for. - The time (in milliseconds) to wait before timing out. - A that contains specific information on the change that occurred. - - - Specifies whether the underlying handle is inheritable by child processes. - - - Specifies that the handle is inheritable by child processes. - - - - Specifies that the handle is not inheritable by child processes. - - - - The exception thrown when the internal buffer overflows. - - - Initializes a new default instance of the class. - - - Initializes a new instance of the class with the error message to be displayed specified. - The message to be given for the exception. - - - Initializes a new, empty instance of the class that is serializable using the specified and objects. - The information required to serialize the T:System.IO.InternalBufferOverflowException object. - The source and destination of the serialized stream associated with the T:System.IO.InternalBufferOverflowException object. - - - Initializes a new instance of the class with the message to be displayed and the generated inner exception specified. - The message to be given for the exception. - The inner exception. - - - The exception that is thrown when a data stream is in an invalid format. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with a specified error message. - The error message that explains the reason for the exception. - - - Initializes a new instance of the class with a reference to the inner exception that is the cause of this exception. - The error message that explains the reason for the exception. - The exception that is the cause of the current exception. If the innerException parameter is not null, the current exception is raised in a catch block that handles the inner exception. - - - The exception that is thrown when an I/O error occurs. - - - Initializes a new instance of the class with its message string set to the empty string (""), its HRESULT set to COR_E_IO, and its inner exception set to a null reference. - - - Initializes a new instance of the class with its message string set to message, its HRESULT set to COR_E_IO, and its inner exception set to null. - A that describes the error. The content of message is intended to be understood by humans. The caller of this constructor is required to ensure that this string has been localized for the current system culture. - - - Initializes a new instance of the class with the specified serialization and context information. - The data for serializing or deserializing the object. - The source and destination for the object. - - - Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. - The error message that explains the reason for the exception. - The exception that is the cause of the current exception. If the innerException parameter is not null, the current exception is raised in a catch block that handles the inner exception. - - - Initializes a new instance of the class with its message string set to message and its HRESULT user-defined. - A that describes the error. The content of message is intended to be understood by humans. The caller of this constructor is required to ensure that this string has been localized for the current system culture. - An integer identifying the error that has occurred. - - - Enables comparisons between an isolated store and an application domain and assembly's evidence. - - - When overridden in a derived class, returns a normalized copy of the object on which it is called. - A normalized object that represents the instance on which this method was called. This instance can be a string, stream, or any serializable object. - - - Represents the abstract base class from which all isolated storage implementations must derive. - - - Gets an application identity that scopes isolated storage. - An that represents the identity. - The code lacks the required to access this object. These permissions are granted by the runtime based on security policy. - The object is not isolated by the application . - - - Gets an assembly identity used to scope isolated storage. - An that represents the identity. - The code lacks the required to access this object. - The assembly is not defined. - - - When overridden in a derived class, gets the available free space for isolated storage, in bytes. - The available free space for isolated storage, in bytes. - An operation was performed that requires access to , but that property is not defined for this store. Stores that are obtained by using enumerations do not have a well-defined property, because partial evidence is used to open the store. - - - Gets a value representing the current size of isolated storage. - The number of storage units currently used within the isolated storage scope. - The current size of the isolated store is undefined. - - - Gets a domain identity that scopes isolated storage. - An that represents the identity. - The code lacks the required to access this object. These permissions are granted by the runtime based on security policy. - The object is not isolated by the domain . - - - When overridden in a derived class, prompts a user to approve a larger quota size, in bytes, for isolated storage. - The requested new quota size, in bytes, for the user to approve. - false in all cases. - - - Initializes a new object. - A bitwise combination of the values. - The type of that you can choose from the list of present in the domain of the calling application. null lets the object choose the evidence. - The type of that you can choose from the list of present in the assembly of the calling application. null lets the object choose the evidence. - The assembly specified has insufficient permissions to create isolated stores. - - - Initializes a new object. - A bitwise combination of the values. - The type of that you can choose from the list of for the calling application. null lets the object choose the evidence. - The assembly specified has insufficient permissions to create isolated stores. - - - Gets a value representing the maximum amount of space available for isolated storage. When overridden in a derived class, this value can take different units of measure. - The maximum amount of isolated storage space in bytes. Derived classes can return different units of value. - The quota has not been defined. - - - When overridden in a derived class, gets a value that represents the maximum amount of space available for isolated storage. - The limit of isolated storage space, in bytes. - An operation was performed that requires access to , but that property is not defined for this store. Stores that are obtained by using enumerations do not have a well-defined property, because partial evidence is used to open the store. - - - When overridden in a derived class, removes the individual isolated store and all contained data. - - - Gets an enumeration value specifying the scope used to isolate the store. - A bitwise combination of values specifying the scope used to isolate the store. - - - Gets a backslash character that can be used in a directory string. When overridden in a derived class, another character might be returned. - The default implementation returns the '\' (backslash) character. - - - Gets a period character that can be used in a directory string. When overridden in a derived class, another character might be returned. - The default implementation returns the '.' (period) character. - - - When overridden in a derived class, gets a value that represents the amount of the space used for isolated storage. - The used amount of isolated storage space, in bytes. - An operation was performed that requires access to , but that property is not defined for this store. Stores that are obtained by using enumerations do not have a well-defined property, because partial evidence is used to open the store. - - - The exception that is thrown when an operation in isolated storage fails. - - - Initializes a new instance of the class with default properties. - - - Initializes a new instance of the class with a specified error message. - The error message that explains the reason for the exception. - - - Initializes a new instance of the class with serialized data. - The object that holds the serialized object data. - The contextual information about the source or destination. - - - Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. - The error message that explains the reason for the exception. - The exception that is the cause of the current exception. If the inner parameter is not null, the current exception is raised in a catch block that handles the inner exception. - - - Represents an isolated storage area containing files and directories. - - - Gets a value that represents the amount of free space available for isolated storage. - The available free space for isolated storage, in bytes. - The isolated store is closed. - The isolated store has been removed. -or- Isolated storage is disabled. - The isolated store has been disposed. - - - Closes a store previously opened with , , or . - - - Copies an existing file to a new file. - The name of the file to copy. - The name of the destination file. This cannot be a directory or an existing file. - sourceFileName or destinationFileName is a zero-length string, contains only white space, or contains one or more invalid characters defined by the method. - sourceFileName or destinationFileName is null. - The isolated store has been closed. - The isolated store has been disposed. - sourceFileName was not found. - sourceFileName was not found. - The isolated store has been removed. -or- Isolated storage is disabled. -or- destinationFileName exists. -or- An I/O error has occurred. - - - Copies an existing file to a new file, and optionally overwrites an existing file. - The name of the file to copy. - The name of the destination file. This cannot be a directory. - true if the destination file can be overwritten; otherwise, false. - sourceFileName or destinationFileName is a zero-length string, contains only white space, or contains one or more invalid characters defined by the method. - sourceFileName or destinationFileName is null. - The isolated store has been closed. - The isolated store has been disposed. - sourceFileName was not found. - sourceFileName was not found. - The isolated store has been removed. -or- Isolated storage is disabled. -or- An I/O error has occurred. - - - Creates a directory in the isolated storage scope. - The relative path of the directory to create within the isolated storage scope. - The current code has insufficient permissions to create isolated storage directory. - The directory path is null. - - - Creates a file in the isolated store. - The relative path of the file to create. - A new isolated storage file. - The isolated store has been removed. -or- Isolated storage is disabled. - path is malformed. - path is null. - The directory in path does not exist. - The isolated store has been disposed. - - - Gets the current size of the isolated storage. - The total number of bytes of storage currently in use within the isolated storage scope. - The property is unavailable. The current store has a roaming scope or is not open. - The current object size is undefined. - - - Deletes a directory in the isolated storage scope. - The relative path of the directory to delete within the isolated storage scope. - The directory could not be deleted. - The directory path was null. - - - Deletes a file in the isolated storage scope. - The relative path of the file to delete within the isolated storage scope. - The target file is open or the path is incorrect. - The file path is null. - - - Determines whether the specified path refers to an existing directory in the isolated store. - The path to test. - true if path refers to an existing directory in the isolated store and is not null; otherwise, false. - path is null. - The isolated store is closed. - The isolated store has been disposed. - The isolated store has been removed. -or- Isolated storage is disabled. - - - Releases all resources used by the . - - - Determines whether the specified path refers to an existing file in the isolated store. - The path and file name to test. - true if path refers to an existing file in the isolated store and is not null; otherwise, false. - path is null. - The isolated store is closed. - The isolated store has been disposed. - The isolated store has been removed. - - - Returns the creation date and time of a specified file or directory. - The path to the file or directory for which to obtain creation date and time information. - The creation date and time for the specified file or directory. This value is expressed in local time. - path is a zero-length string, contains only white space, or contains one or more invalid characters defined by the method. - path is null. - The isolated store has been closed. - The isolated store has been disposed. - The isolated store has been removed. -or- Isolated storage is disabled. - - - Enumerates the directories at the root of an isolated store. - An array of relative paths of directories at the root of the isolated store. A zero-length array specifies that there are no directories at the root. - The isolated store has been disposed. - The isolated store is closed. - The isolated store has been removed. - Caller does not have permission to enumerate directories. - One or more directories are not found. - - - Enumerates the directories in an isolated storage scope that match a given search pattern. - A search pattern. Both single-character ("?") and multi-character ("*") wildcards are supported. - An array of the relative paths of directories in the isolated storage scope that match searchPattern. A zero-length array specifies that there are no directories that match. - searchPattern is null. - The isolated store is closed. - The isolated store has been disposed. - Caller does not have permission to enumerate directories resolved from searchPattern. - The directory or directories specified by searchPattern are not found. - The isolated store has been removed. - - - Gets the enumerator for the stores within an isolated storage scope. - Represents the for which to return isolated stores. User and User|Roaming are the only IsolatedStorageScope combinations supported. - Enumerator for the stores within the specified isolated storage scope. - - - Enumerates the file names at the root of an isolated store. - An array of relative paths of files at the root of the isolated store. A zero-length array specifies that there are no files at the root. - The isolated store has been removed. - The isolated store has been disposed. - File paths from the isolated store root cannot be determined. - - - Gets the file names that match a search pattern. - A search pattern. Both single-character ("?") and multi-character ("*") wildcards are supported. - An array of relative paths of files in the isolated storage scope that match searchPattern. A zero-length array specifies that there are no files that match. - searchPattern is null. - The isolated store has been disposed. - The isolated store has been removed. - The file path specified by searchPattern cannot be found. - - - Returns the date and time a specified file or directory was last accessed. - The path to the file or directory for which to obtain last access date and time information. - The date and time that the specified file or directory was last accessed. This value is expressed in local time. - path is a zero-length string, contains only white space, or contains one or more invalid characters defined by the method. - path is null. - The isolated store has been closed. - The isolated store has been disposed. - The isolated store has been removed. -or- Isolated storage is disabled. - - - Returns the date and time a specified file or directory was last written to. - The path to the file or directory for which to obtain last write date and time information. - The date and time that the specified file or directory was last written to. This value is expressed in local time. - path is a zero-length string, contains only white space, or contains one or more invalid characters defined by the method. - path is null. - The isolated store has been closed. - The isolated store has been disposed. - The isolated store has been removed. -or- Isolated storage is disabled. - - - Obtains machine-scoped isolated storage corresponding to the calling code's application identity. - An object corresponding to the isolated storage scope based on the calling code's application identity. - The application identity of the caller could not be determined. -or- The granted permission set for the application domain could not be determined. -or- An isolated storage location cannot be initialized. - Sufficient isolated storage permissions have not been granted. - - - Obtains machine-scoped isolated storage corresponding to the calling code's assembly identity. - An object corresponding to the isolated storage scope based on the calling code's assembly identity. - An isolated storage location cannot be initialized. - Sufficient isolated storage permissions have not been granted. - - - Obtains machine-scoped isolated storage corresponding to the application domain identity and the assembly identity. - An object corresponding to the , based on a combination of the application domain identity and the assembly identity. - Sufficient isolated storage permissions have not been granted. - The store failed to open. -or- The assembly specified has insufficient permissions to create isolated stores. -or- The permissions for the application domain cannot be determined. -or- An isolated storage location cannot be initialized. - - - Obtains isolated storage corresponding to the given application identity. - A bitwise combination of the enumeration values. - An object that contains evidence for the application identity. - An object that represents the parameters. - Sufficient isolated storage permissions have not been granted. - The applicationIdentity identity has not been passed in. - The scope is invalid. - An isolated storage location cannot be initialized. -or- scope contains the enumeration value , but the application identity of the caller cannot be determined,because the for the current application domain returned null. -or- scope contains the value , but the permissions for the application domain cannot be determined. -or- scope contains the value , but the permissions for the calling assembly cannot be determined. - - - Obtains isolated storage corresponding to the isolation scope and the application identity object. - A bitwise combination of the enumeration values. - An object that contains the application identity. - An object that represents the parameters. - Sufficient isolated storage permissions have not been granted. - The applicationEvidence identity has not been passed in. - The scope is invalid. - An isolated storage location cannot be initialized. -or- scope contains the enumeration value , but the application identity of the caller cannot be determined, because the for the current application domain returned null. -or- scope contains the value , but the permissions for the application domain cannot be determined. -or- scope contains the value , but the permissions for the calling assembly cannot be determined. - - - Obtains the isolated storage corresponding to the given application domain and assembly evidence objects. - A bitwise combination of the enumeration values. - An object that contains evidence for the application domain identity. - An object that contains evidence for the code assembly identity. - An object that represents the parameters. - Sufficient isolated storage permissions have not been granted. - Neither domainIdentity nor assemblyIdentity has been passed in. This verifies that the correct constructor is being used. -or- Either domainIdentity or assemblyIdentity is null. - The scope is invalid. - An isolated storage location cannot be initialized. -or- scope contains the enumeration value , but the application identity of the caller cannot be determined, because the for the current application domain returned null. -or- scope contains the value , but the permissions for the application domain cannot be determined. -or- scope contains the value , but the permissions for the calling assembly cannot be determined. - - - Obtains isolated storage corresponding to the isolated storage scope given the application domain and assembly evidence types. - A bitwise combination of the enumeration values. - The type of the that you can chose from the list of present in the domain of the calling application. null lets the object choose the evidence. - The type of the that you can chose from the list of present in the domain of the calling application. null lets the object choose the evidence. - An object that represents the parameters. - Sufficient isolated storage permissions have not been granted. - The scope is invalid. - The evidence type provided is missing in the assembly evidence list. -or- An isolated storage location cannot be initialized. -or- scope contains the enumeration value , but the application identity of the caller cannot be determined, because the for the current application domain returned null. -or- scope contains the value , but the permissions for the application domain cannot be determined. -or- scope contains , but the permissions for the calling assembly cannot be determined. - - - Obtains user-scoped isolated storage corresponding to the calling code's application identity. - An object corresponding to the isolated storage scope based on the calling code's assembly identity. - Sufficient isolated storage permissions have not been granted. - An isolated storage location cannot be initialized. -or- The application identity of the caller cannot be determined, because the property returned null. -or- The permissions for the application domain cannot be determined. - - - Obtains user-scoped isolated storage corresponding to the calling code's assembly identity. - An object corresponding to the isolated storage scope based on the calling code's assembly identity. - Sufficient isolated storage permissions have not been granted. - An isolated storage location cannot be initialized. -or- The permissions for the calling assembly cannot be determined. - - - Obtains user-scoped isolated storage corresponding to the application domain identity and assembly identity. - An object corresponding to the , based on a combination of the application domain identity and the assembly identity. - Sufficient isolated storage permissions have not been granted. - The store failed to open. -or- The assembly specified has insufficient permissions to create isolated stores. -or- An isolated storage location cannot be initialized. -or- The permissions for the application domain cannot be determined. - - - Obtains a user-scoped isolated store for use by applications in a virtual host domain. - The isolated storage file that corresponds to the isolated storage scope based on the calling code's application identity. - - - Enables an application to explicitly request a larger quota size, in bytes. - The requested size, in bytes. - true if the new quota is accepted; otherwise, false. - newQuotaSize is less than current quota size. - newQuotaSize is less than zero, or less than or equal to the current quota size. - The isolated store has been closed. - The current scope is not for an application user. - The isolated store has been disposed. - The isolated store has been removed. -or- Isolated storage is disabled. - - - Gets a value that indicates whether isolated storage is enabled. - true in all cases. - - - Gets a value representing the maximum amount of space available for isolated storage within the limits established by the quota. - The limit of isolated storage space in bytes. - The property is unavailable. cannot be determined without evidence from the assembly's creation. The evidence could not be determined when the object was created. - An isolated storage error occurred. - - - Moves a specified directory and its contents to a new location. - The name of the directory to move. - The path to the new location for sourceDirectoryName. This cannot be the path to an existing directory. - sourceFileName or destinationFileName is a zero-length string, contains only white space, or contains one or more invalid characters defined by the method. - sourceFileName or destinationFileName is null. - The isolated store has been closed. - The isolated store has been disposed. - sourceDirectoryName does not exist. - The isolated store has been removed. -or- Isolated storage is disabled. -or- destinationDirectoryName already exists. -or- sourceDirectoryName and destinationDirectoryName refer to the same directory. - - - Moves a specified file to a new location, and optionally lets you specify a new file name. - The name of the file to move. - The path to the new location for the file. If a file name is included, the moved file will have that name. - sourceFileName or destinationFileName is a zero-length string, contains only white space, or contains one or more invalid characters defined by the method. - sourceFileName or destinationFileName is null. - The isolated store has been closed. - The isolated store has been disposed. - sourceFileName was not found. - The isolated store has been removed. -or- Isolated storage is disabled. - - - Opens a file in the specified mode. - The relative path of the file within the isolated store. - One of the enumeration values that specifies how to open the file. - A file that is opened in the specified mode, with read/write access, and is unshared. - The isolated store has been removed. -or- Isolated storage is disabled. - path is malformed. - path is null. - The directory in path does not exist. - No file was found and the mode is set to . - The isolated store has been disposed. - - - Opens a file in the specified mode with the specified read/write access. - The relative path of the file within the isolated store. - One of the enumeration values that specifies how to open the file. - One of the enumeration values that specifies whether the file will be opened with read, write, or read/write access. - A file that is opened in the specified mode and access, and is unshared. - The isolated store has been removed. -or- Isolated storage is disabled. - path is malformed. - path is null. - The directory in path does not exist. - No file was found and the mode is set to . - The isolated store has been disposed. - - - Opens a file in the specified mode, with the specified read/write access and sharing permission. - The relative path of the file within the isolated store. - One of the enumeration values that specifies how to open or create the file. - One of the enumeration values that specifies whether the file will be opened with read, write, or read/write access - A bitwise combination of enumeration values that specify the type of access other objects have to this file. - A file that is opened in the specified mode and access, and with the specified sharing options. - The isolated store has been removed. -or- Isolated storage is disabled. - path is malformed. - path is null. - The directory in path does not exist. - No file was found and the mode is set to . - The isolated store has been disposed. - - - Gets a value that represents the maximum amount of space available for isolated storage. - The limit of isolated storage space, in bytes. - The isolated store has been removed. -or- Isolated storage is disabled. - The isolated store has been disposed. - - - Removes the isolated storage scope and all its contents. - The isolated store cannot be deleted. - - - Removes the specified isolated storage scope for all identities. - A bitwise combination of the values. - The isolated store cannot be removed. - - - Gets a value that represents the amount of the space used for isolated storage. - The used isolated storage space, in bytes. - The isolated store has been closed. - The isolated store has been removed. - The isolated store has been disposed. - - - Exposes a file within isolated storage. - - - Initializes a new instance of an object giving access to the file designated by path in the specified mode. - The relative path of the file within isolated storage. - One of the values. - The path is badly formed. - The path is null. - The directory in path does not exist. - No file was found and the mode is set to - - - Initializes a new instance of the class giving access to the file designated by path, in the specified mode, with the kind of access requested. - The relative path of the file within isolated storage. - One of the values. - A bitwise combination of the values. - The path is badly formed. - The path is null. - No file was found and the mode is set to . - - - Initializes a new instance of the class giving access to the file designated by path, in the specified mode, and in the context of the specified by isf. - The relative path of the file within isolated storage. - One of the values. - The in which to open the . - The path is badly formed. - The path is null. - No file was found and the mode is set to . - isf does not have a quota. - - - Initializes a new instance of the class giving access to the file designated by path, in the specified mode, with the specified file access, using the file sharing mode specified by share. - The relative path of the file within isolated storage. - One of the values. - A bitwise combination of the values. - A bitwise combination of the values. - The path is badly formed. - The path is null. - No file was found and the mode is set to . - - - Initializes a new instance of the class giving access to the file designated by path in the specified mode, with the specified file access, and in the context of the specified by isf. - The relative path of the file within isolated storage. - One of the values. - A bitwise combination of the values. - The in which to open the . - The path is badly formed. - The path is null. - The isolated store is closed. - No file was found and the mode is set to . - isf does not have a quota. - - - Initializes a new instance of the class giving access to the file designated by path, in the specified mode, with the specified file access, using the file sharing mode specified by share, with the buffersize specified. - The relative path of the file within isolated storage. - One of the values. - A bitwise combination of the values. - A bitwise combination of the values. - The buffer size. - The path is badly formed. - The path is null. - No file was found and the mode is set to . - - - Initializes a new instance of the class giving access to the file designated by path, in the specified mode, with the specified file access, using the file sharing mode specified by share, and in the context of the specified by isf. - The relative path of the file within isolated storage. - One of the values. - A bitwise combination of the values. - A bitwise combination of the values. - The in which to open the . - The path is badly formed. - The path is null. - No file was found and the mode is set to . - isf does not have a quota. - - - Initializes a new instance of the class giving access to the file designated by path, in the specified mode, with the specified file access, using the file sharing mode specified by share, with the buffersize specified, and in the context of the specified by isf. - The relative path of the file within isolated storage. - One of the values. - A bitwise combination of the values. - A bitwise combination of the values - The buffer size. - The in which to open the . - The path is badly formed. - The path is null. - No file was found and the mode is set to . - isf does not have a quota. - - - Begins an asynchronous read. - The buffer to read data into. - The byte offset in buffer at which to begin reading. - The maximum number of bytes to read. - The method to call when the asynchronous read operation is completed. This parameter is optional. - The status of the asynchronous read. - An object that represents the asynchronous read, which is possibly still pending. This must be passed to this stream's method to determine how many bytes were read. This can be done either by the same code that called or in a callback passed to . - An asynchronous read was attempted past the end of the file. - - - Begins an asynchronous write. - The buffer to write data to. - The byte offset in buffer at which to begin writing. - The maximum number of bytes to write. - The method to call when the asynchronous write operation is completed. This parameter is optional. - The status of the asynchronous write. - An that represents the asynchronous write, which is possibly still pending. This must be passed to this stream's method to ensure that the write is complete, then frees resources appropriately. This can be done either by the same code that called or in a callback passed to . - An asynchronous write was attempted past the end of the file. - - - Gets a Boolean value indicating whether the file can be read. - true if an object can be read; otherwise, false. - - - Gets a Boolean value indicating whether seek operations are supported. - true if an object supports seek operations; otherwise, false. - - - Gets a Boolean value indicating whether you can write to the file. - true if an object can be written; otherwise, false. - - - Releases the unmanaged resources used by the and optionally releases the managed resources. - true to release both managed and unmanaged resources; false to release only unmanaged resources - - - Ends a pending asynchronous read request. - The pending asynchronous request. - The number of bytes read from the stream, between zero and the number of requested bytes. Streams will only return zero at the end of the stream. Otherwise, they will block until at least one byte is available. - The asyncResult is null. - - - Ends an asynchronous write. - The pending asynchronous I/O request to end. - The asyncResult parameter is null. - - - Clears buffers for this stream and causes any buffered data to be written to the file. - - - Clears buffers for this stream and causes any buffered data to be written to the file, and also clears all intermediate file buffers. - true to flush all intermediate file buffers; otherwise, false. - - - Gets the file handle for the file that the current object encapsulates. Accessing this property is not permitted on an object, and throws an . - The file handle for the file that the current object encapsulates. - The property always generates this exception. - - - Gets a Boolean value indicating whether the object was opened asynchronously or synchronously. - true if the object supports asynchronous access; otherwise, false. - - - Gets the length of the object. - The length of the object in bytes. - - - Prevents other processes from reading from or writing to the stream. - The starting position of the range to lock. The value of this parameter must be equal to or greater than 0 (zero). - The number of bytes to lock. - position or length is negative. - The file is closed. - The process cannot access the file because another process has locked a portion of the file. - - - Gets or sets the current position of the current object. - The current position of this object. - The position cannot be set to a negative number. - - - Copies bytes from the current buffered object to an array. - The buffer to read. - The offset in the buffer at which to begin writing. - The maximum number of bytes to read. - The total number of bytes read into the buffer. This can be less than the number of bytes requested if that many bytes are not currently available, or zero if the end of the stream is reached. - - - Reads a single byte from the object in isolated storage. - The 8-bit unsigned integer value read from the isolated storage file. - - - Gets a object that represents the operating system file handle for the file that the current object encapsulates. - A object that represents the operating system file handle for the file that the current object encapsulates. - The property always generates this exception. - - - Sets the current position of this object to the specified value. - The new position of the object. - One of the values. - The new position in the object. - The origin must be one of the values. - - - Sets the length of this object to the specified value. - The new length of the object. - value is a negative number. - - - Allows other processes to access all or part of a file that was previously locked. - The starting position of the range to unlock. The value of this parameter must be equal to or greater than 0 (zero). - The number of bytes to unlock. - position or length is negative. - - - Writes a block of bytes to the object using data read from a byte array. - The buffer to write. - The byte offset in buffer from which to begin. - The maximum number of bytes to write. - The write attempt exceeds the quota for the object. - - - Writes a single byte to the object. - The byte value to write to the isolated storage file. - The write attempt exceeds the quota for the object. - - - Enumerates the levels of isolated storage scope that are supported by . - - - Isolated storage scoped to the application. - - - - Isolated storage scoped to the identity of the assembly. - - - - Isolated storage scoped to the application domain identity. - - - - Isolated storage scoped to the machine. - - - - No isolated storage usage. - - - - The isolated store can be placed in a location on the file system that might roam (if roaming user data is enabled on the underlying operating system). - - - - Isolated storage scoped by user identity. - - - - Represents a memory-mapped file. - - - Creates a memory-mapped file from a file on disk. - The path to file to map. - A memory-mapped file. - path is an empty string, contains only white space, or has one or more invalid characters, as defined by the method. -or- path refers to an invalid device. - path is null. - An I/O error occurred. - path exceeds the maximum length defined by the operating system. In Windows, paths must contain fewer than 248 characters, and file names must contain fewer than 260 characters. - The caller does not have the required permissions for the file. - - - Creates a memory-mapped file that has the specified access mode from a file on disk. - The path to file to map. - Access mode; must be . - A memory-mapped file that has the specified access mode. - path is an empty string, contains only white space, or has one or more invalid characters, as defined by the method. -or- path refers to an invalid device. -or- mode is . - path is null. - mode is , , or . -or- mode is and the file on disk does not exist. -or- An I/O error occurred. - path exceeds the maximum length defined by the operating system. In Windows, paths must contain fewer than 248 characters, and file names must contain fewer than 260 characters. - The caller does not have the required permissions for the file. - - - Creates a memory-mapped file that has the specified access mode and name from a file on disk. - The path to the file to map. - Access mode; must be . - A name to assign to the memory-mapped file. - A memory-mapped file that has the specified name and access mode. - path is an empty string, contains only white space, or has one or more invalid characters, as defined by the method. -or- path refers to an invalid device. -or- mapName is an empty string. -or- mode is . - path or mapName is null. - mode is , , or . -or- mode is and the file on disk does not exist. -or- An I/O error occurred. - path exceeds the maximum length defined by the operating system. In Windows, paths must contain fewer than 248 characters, and file names must contain fewer than 260 characters. - The caller does not have the required permissions for the file. - - - Creates a memory-mapped file that has the specified access mode, name, and capacity from a file on disk. - The path to the file to map. - Access mode; can be any of the enumeration values except . - A name to assign to the memory-mapped file. - The maximum size, in bytes, to allocate to the memory-mapped file. Specify 0 to set the capacity to the size of the file on disk. - A memory-mapped file that has the specified characteristics. - path is an empty string, contains only white space, or has one or more invalid characters, as defined by the method. -or- path refers to an invalid device. -or- mapName is an empty string. -or- mode is . - path or mapName is null. - capacity is greater than the size of the logical address space. -or- capacity is less than zero. -or- capacity is less than the file size (but not zero). -or- capacity is zero, and the size of the file on disk is also zero. - An I/O error occurred. - path exceeds the maximum length defined by the operating system. In Windows, paths must contain fewer than 248 characters, and file names must contain fewer than 260 characters. - The caller does not have the required permissions for the file. - - - Creates a memory-mapped file that has the specified access mode, name, capacity, and access type from a file on disk. - The path to the file to map. - Access mode; can be any of the enumeration values except . - A name to assign to the memory-mapped file. - The maximum size, in bytes, to allocate to the memory-mapped file. Specify 0 to set the capacity to the size of the file on disk. - One of the enumeration values that specifies the type of access allowed to the memory-mapped file. - A memory-mapped file that has the specified characteristics. - mapName is an empty string. -or- access is not an allowed value. -or- path specifies an empty file. -or- access is specified as and capacity is greater than the size of the file indicated by path. -or- mode is . - path or mapName is null. - capacity is greater than the size of the logical address space. -or- capacity is less than zero. -or- capacity is less than the file size (but not zero). -or- capacity is zero, and the size of the file on disk is also zero. -or- access is not a defined value. -or- The size of the file indicated by path is greater than capacity. - -or- An I/O error occurred. - path exceeds the maximum length defined by the operating system. In Windows, paths must contain fewer than 248 characters, and file names must contain fewer than 260 characters. - The caller does not have the required permissions for the file. - - - Creates a memory-mapped file from an existing file with the specified access mode, name, inheritability, and capacity. - The file stream of the existing file. - A name to assign to the memory-mapped file. - The maximum size, in bytes, to allocate to the memory-mapped file. Specify 0 to set the capacity to the size of filestream. - One of the enumeration values that specifies the type of access allowed to the memory-mapped file. This parameter can’t be set to . - One of the enumeration values that specifies whether a handle to the memory-mapped file can be inherited by a child process. The default is . - A value that indicates whether to close the source file stream when the is disposed. - A memory-mapped file that has the specified characteristics. - mapName is null or an empty string. -or- capacity and the length of the file are zero. -or- access is set to or enumeration value, which is not allowed. -or- access is set to and capacity is larger than the length of filestream. - fileStream is null. - capacity is less than zero. -or- capacity is less than the file size. -or- access is not a valid enumeration value. -or- inheritability is not a valid enumeration value. - - - Creates a memory-mapped file that has the specified capacity in system memory. - A name to assign to the memory-mapped file. - The maximum size, in bytes, to allocate to the memory-mapped file. - A memory-mapped file that has the specified name and capacity. - mapName is an empty string. - mapName is null. - capacity is less than or equal to zero. - - - Creates a memory-mapped file that has the specified capacity and access type in system memory. - A name to assign to the memory-mapped file. - The maximum size, in bytes, to allocate to the memory-mapped file. - One of the enumeration values that specifies the type of access allowed to the memory-mapped file. The default is . - A memory-mapped file that has the specified characteristics. - mapName is an empty string. -or- access is set to write-only with the enumeration value. - mapName is null. - capacity is less than or equal to zero. -or- access is not a valid enumeration value. - - - Creates a memory-mapped file that has the specified name, capacity, access type, memory allocation options and inheritability. - A name to assign to the memory-mapped file. - The maximum size, in bytes, to allocate to the memory-mapped file. - One of the enumeration values that specifies the type of access allowed to the memory-mapped file. The default is . - A bitwise combination of enumeration values that specifies memory allocation options for the memory-mapped file. - A value that specifies whether a handle to the memory-mapped file can be inherited by a child process. The default is . - A memory-mapped file that has the specified characteristics. - mapName is an empty string. -or- access is set to write-only with the enumeration value. - mapName is null. - capacity is less than or equal to zero. -or- access is not a valid enumeration value. -or- inheritability is not a valid value. - - - Creates a new empty memory mapped file or opens an existing memory mapped file if one exists with the same name. If opening an existing file, the capacity, options, and memory arguments will be ignored. - A name to assign to the memory-mapped file. - The maximum size, in bytes, to allocate to the memory-mapped file. - One of the enumeration values that specifies the type of access allowed to the memory-mapped file. The default is . - A bitwise combination of values that indicate the memory allocation options to apply to the file. - A value that specifies whether a handle to the memory-mapped file can be inherited by a child process. The default is . - A memory-mapped file that has the specified characteristics. - mapName is an empty string. -or- access is set to write-only with the enumeration value. - mapName is null. - capacity is greater than the size of the logical address space. -or- capacity is less than or equal to zero. -or- access is not a valid enumeration value. -or- inheritability is not a valid enumeration value. - The operating system denied the specified access to the file; for example, access is set to or , but the file or directory is read-only. - - - Creates or opens a memory-mapped file that has the specified capacity in system memory. - A name to assign to the memory-mapped file. - The maximum size, in bytes, to allocate to the memory-mapped file. - A memory-mapped file that has the specified name and size. - mapName is an empty string. - mapName is null. - capacity is greater than the size of the logical address space. -or- capacity is less than or equal to zero. - - - Creates or opens a memory-mapped file that has the specified capacity and access type in system memory. - A name to assign to the memory-mapped file. - The maximum size, in bytes, to allocate to the memory-mapped file. - One of the enumeration values that specifies the type of access allowed to the memory-mapped file. The default is . - A memory-mapped file that has the specified characteristics. - mapName is an empty string. -or- access is set to write-only with the enumeration value. - mapName is null. - capacity is greater than the size of the logical address space. -or- capacity is less than or equal to zero. -or- access is not a valid enumeration value. - The operating system denied the specified access to the file; for example, access is set to or , but the file or directory is read-only. - - - Creates a that maps to a view of the memory-mapped file. - A randomly accessible block of memory. - Access to the memory-mapped file is unauthorized. - - - Creates a that maps to a view of the memory-mapped file, and that has the specified offset and size. - The byte at which to start the view. - The size of the view. Specify 0 (zero) to create a view that starts at offset and ends approximately at the end of the memory-mapped file. - A randomly accessible block of memory. - offset or size is a negative value. -or- size is greater than the logical address space. - Access to the memory-mapped file is unauthorized. - An I/O error occurred. - - - Creates a that maps to a view of the memory-mapped file, and that has the specified offset, size, and access restrictions. - The byte at which to start the view. - The size of the view. Specify 0 (zero) to create a view that starts at offset and ends approximately at the end of the memory-mapped file. - One of the enumeration values that specifies the type of access allowed to the memory-mapped file. The default is . - A randomly accessible block of memory. - offset or size is a negative value. -or- size is greater than the logical address space. - access is invalid for the memory-mapped file. - An I/O error occurred. - - - Creates a stream that maps to a view of the memory-mapped file. - A stream of memory. - Access to the memory-mapped file is unauthorized. - - - Creates a stream that maps to a view of the memory-mapped file, and that has the specified offset and size. - The byte at which to start the view. - The size of the view. Specify 0 (zero) to create a view that starts at offset and ends approximately at the end of the memory-mapped file. - A stream of memory that has the specified offset and size. - offset or size is a negative value. -or- size is greater than the logical address space. - Access to the memory-mapped file is unauthorized. - size is greater than the total virtual memory. - - - Creates a stream that maps to a view of the memory-mapped file, and that has the specified offset, size, and access type. - The byte at which to start the view. - The size of the view. Specify 0 (zero) to create a view that starts at offset and ends approximately at the end of the memory-mapped file. - One of the enumeration values that specifies the type of access allowed to the memory-mapped file. The default is . - A stream of memory that has the specified characteristics. - offset or size is a negative value. -or- size is greater than the logical address space. -or- access is not a valid enumeration value. - access is invalid for the memory-mapped file. - size is greater than the total virtual memory. -or- access is invalid for the memory-mapped file. - - - Releases all resources used by the . - - - Releases the unmanaged resources used by the and optionally releases the managed resources. - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - Opens an existing memory-mapped file that has the specified name in system memory. - The name of the memory-mapped file to open. - A memory-mapped file that has the specified name. - mapName is an empty string. - mapName is null. - The file specified for mapName does not exist. - - - Opens an existing memory-mapped file that has the specified name and access rights in system memory. - The name of the memory-mapped file to open. - One of the enumeration values that specifies the access rights to apply to the memory-mapped file. - A memory-mapped file that has the specified characteristics. - mapName is an empty string. - mapName is null. - desiredAccessRights is not a valid enumeration value. - The file specified for mapName does not exist. - - - Opens an existing memory-mapped file that has the specified name, access rights, and inheritability in system memory. - The name of the memory-mapped file to open. - One of the enumeration values that specifies the access rights to apply to the memory-mapped file. - One of the enumeration values that specifies whether a handle to the memory-mapped file can be inherited by a child process. The default is . - A memory-mapped file that has the specified characteristics. - mapName is an empty string. - mapName is null. - desiredAccessRights is not a valid enumeration value. -or- inheritability is not a valid enumeration value. - The requested access is invalid for the memory-mapped file. - The file specified for mapName does not exist. - - - Gets the file handle of a memory-mapped file. - The handle to the memory-mapped file. - - - Specifies access capabilities and restrictions for a memory-mapped file or view. - - - Read and write access to the file, with the restriction that any write operations will not be seen by other processes. - - - - Read-only access to the file. - - - - Read access to the file that can store and run executable code. - - - - Read and write access to the file. - - - - Read and write access to the file that can can store and run executable code. - - - - Write-only access to file. - - - - Provides memory allocation options for memory-mapped files. - - - Memory allocation is delayed until a view is created with either the or method. - - - - No memory allocation options are applied. - - - - Specifies access rights to a memory-mapped file that is not associated with a file on disk. - - - The right to get or set permissions on a file. - - - - The right to change the security and audit rules associated with a file. - - - - The right to read and write to a file with the restriction that write operations will not be seen by other processes. - - - - The right to delete a file. - - - - The right to run an application file. - - - - The right to exert full control over a file, and to modify access control and audit rules. This value represents the right to do anything with a file and is the combination of all rights in this enumeration. - - - - The right to open and copy a file as read-only. - - - - The right to open and copy a folder or file as read-only, and to run application files. This right includes the right and the right. - - - - The right to open and copy access and audit rules from a file. This does not include the right to read data, file system attributes, or extended file system attributes. - - - - The right to open and copy a file, and the right to add data to a file or remove data from a file. - - - - The right to open and copy a file, the right to add data to a file or remove data from a file, and the right to run an application file. - - - - The right to change the owner of a file. - - - - The right to add data to a file or remove data from a file. - - - - Represents a randomly accessed view of a memory-mapped file. - - - Clears all buffers for this view and causes any buffered data to be written to the underlying file. - Methods were called after the accessor was closed. - - - [Supported in the .NET Framework 4.5.1 and later versions] Gets the number of bytes by which the starting position of this view is offset from the beginning of the memory-mapped file. - The number of bytes between the starting position of this view and the beginning of the memory-mapped file. - The object from which this instance was created is null. - - - Gets a handle to the view of a memory-mapped file. - A wrapper for the operating system's handle to the view of the file. - - - Represents a view of a memory-mapped file as a sequentially accessed stream. - - - Clears all buffers for this stream and causes any buffered data to be written to the underlying file. - - - [Supported in the .NET Framework 4.5.1 and later versions] Gets the number of bytes by which the starting position of this view is offset from the beginning of the memory-mapped file. - The number of bytes between the starting position of this view and the beginning of the memory-mapped file. - The object from which this instance was created is null. - - - Gets a handle to the view of a memory-mapped file. - A wrapper for the operating system's handle to the view of the file. - - - Sets the length of the current stream. - The desired length of the current stream in bytes. - This method is not supported. - - - Creates a stream whose backing store is memory. - - - Initializes a new instance of the class with an expandable capacity initialized to zero. - - - Initializes a new non-resizable instance of the class based on the specified byte array. - The array of unsigned bytes from which to create the current stream. - buffer is null. - - - Initializes a new instance of the class with an expandable capacity initialized as specified. - The initial size of the internal array in bytes. - capacity is negative. - - - Initializes a new non-resizable instance of the class based on the specified byte array with the property set as specified. - The array of unsigned bytes from which to create this stream. - The setting of the property, which determines whether the stream supports writing. - buffer is null. - - - Initializes a new non-resizable instance of the class based on the specified region (index) of a byte array. - The array of unsigned bytes from which to create this stream. - The index into buffer at which the stream begins. - The length of the stream in bytes. - buffer is null. - index or count is less than zero. - The buffer length minus index is less than count. - - - Initializes a new non-resizable instance of the class based on the specified region of a byte array, with the property set as specified. - The array of unsigned bytes from which to create this stream. - The index in buffer at which the stream begins. - The length of the stream in bytes. - The setting of the property, which determines whether the stream supports writing. - buffer is null. - index or count are negative. - The buffer length minus index is less than count. - - - Initializes a new instance of the class based on the specified region of a byte array, with the property set as specified, and the ability to call set as specified. - The array of unsigned bytes from which to create this stream. - The index into buffer at which the stream begins. - The length of the stream in bytes. - The setting of the property, which determines whether the stream supports writing. - true to enable , which returns the unsigned byte array from which the stream was created; otherwise, false. - buffer is null. - index or count is negative. - The buffer length minus index is less than count. - - - Gets a value indicating whether the current stream supports reading. - true if the stream is open. - - - Gets a value indicating whether the current stream supports seeking. - true if the stream is open. - - - Gets a value indicating whether the current stream supports writing. - true if the stream supports writing; otherwise, false. - - - Gets or sets the number of bytes allocated for this stream. - The length of the usable portion of the buffer for the stream. - A capacity is set that is negative or less than the current length of the stream. - The current stream is closed. - set is invoked on a stream whose capacity cannot be modified. - - - Asynchronously reads all the bytes from the current stream and writes them to another stream, using a specified buffer size and cancellation token. - The stream to which the contents of the current stream will be copied. - The size, in bytes, of the buffer. This value must be greater than zero. - The token to monitor for cancellation requests. - A task that represents the asynchronous copy operation. - destination is null. - buffersize is negative or zero. - Either the current stream or the destination stream is disposed. - The current stream does not support reading, or the destination stream does not support writing. - - - Releases the unmanaged resources used by the class and optionally releases the managed resources. - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - Overrides the method so that no action is performed. - - - Asynchronously clears all buffers for this stream, and monitors cancellation requests. - The token to monitor for cancellation requests. - A task that represents the asynchronous flush operation. - The stream has been disposed. - - - Returns the array of unsigned bytes from which this stream was created. - The byte array from which this stream was created, or the underlying array if a byte array was not provided to the constructor during construction of the current instance. - The MemoryStream instance was not created with a publicly visible buffer. - - - Gets the length of the stream in bytes. - The length of the stream in bytes. - The stream is closed. - - - Gets or sets the current position within the stream. - The current position within the stream. - The position is set to a negative value or a value greater than . - The stream is closed. - - - Reads a block of bytes from the current stream and writes the data to a buffer. - When this method returns, contains the specified byte array with the values between offset and (offset + count - 1) replaced by the characters read from the current stream. - The zero-based byte offset in buffer at which to begin storing data from the current stream. - The maximum number of bytes to read. - The total number of bytes written into the buffer. This can be less than the number of bytes requested if that number of bytes are not currently available, or zero if the end of the stream is reached before any bytes are read. - buffer is null. - offset or count is negative. - offset subtracted from the buffer length is less than count. - The current stream instance is closed. - - - Asynchronously reads a sequence of bytes from the current stream, advances the position within the stream by the number of bytes read, and monitors cancellation requests. - The buffer to write the data into. - The byte offset in buffer at which to begin writing data from the stream. - The maximum number of bytes to read. - The token to monitor for cancellation requests. The default value is . - A task that represents the asynchronous read operation. The value of the TResult parameter contains the total number of bytes read into the buffer. The result value can be less than the number of bytes requested if the number of bytes currently available is less than the requested number, or it can be 0 (zero) if the end of the stream has been reached. - buffer is null. - offset or count is negative. - The sum of offset and count is larger than the buffer length. - The stream does not support reading. - The stream has been disposed. - The stream is currently in use by a previous read operation. - - - Reads a byte from the current stream. - The byte cast to a , or -1 if the end of the stream has been reached. - The current stream instance is closed. - - - Sets the position within the current stream to the specified value. - The new position within the stream. This is relative to the loc parameter, and can be positive or negative. - A value of type , which acts as the seek reference point. - The new position within the stream, calculated by combining the initial reference point and the offset. - Seeking is attempted before the beginning of the stream. - offset is greater than . - There is an invalid . -or- offset caused an arithmetic overflow. - The current stream instance is closed. - - - Sets the length of the current stream to the specified value. - The value at which to set the length. - The current stream is not resizable and value is larger than the current capacity. -or- The current stream does not support writing. - value is negative or is greater than the maximum length of the , where the maximum length is( - origin), and origin is the index into the underlying buffer at which the stream starts. - - - Writes the stream contents to a byte array, regardless of the property. - A new byte array. - - - Returns the array of unsigned bytes from which this stream was created. The return value indicates whether the conversion succeeded. - The byte array segment from which this stream was created. - true if the conversion was successful; otherwise, false. - - - Writes a block of bytes to the current stream using data read from a buffer. - The buffer to write data from. - The zero-based byte offset in buffer at which to begin copying bytes to the current stream. - The maximum number of bytes to write. - buffer is null. - The stream does not support writing. For additional information see . -or- The current position is closer than count bytes to the end of the stream, and the capacity cannot be modified. - offset subtracted from the buffer length is less than count. - offset or count are negative. - An I/O error occurs. - The current stream instance is closed. - - - Asynchronously writes a sequence of bytes to the current stream, advances the current position within this stream by the number of bytes written, and monitors cancellation requests. - The buffer to write data from. - The zero-based byte offset in buffer from which to begin copying bytes to the stream. - The maximum number of bytes to write. - The token to monitor for cancellation requests. The default value is . - A task that represents the asynchronous write operation. - buffer is null. - offset or count is negative. - The sum of offset and count is larger than the buffer length. - The stream does not support writing. - The stream has been disposed. - The stream is currently in use by a previous write operation. - - - Writes a byte to the current stream at the current position. - The byte to write. - The stream does not support writing. For additional information see . -or- The current position is at the end of the stream, and the capacity cannot be modified. - The current stream is closed. - - - Writes the entire contents of this memory stream to another stream. - The stream to write this memory stream to. - stream is null. - The current or target stream is closed. - - - Specifies changes to watch for in a file or folder. - - - The attributes of the file or folder. - - - - The time the file or folder was created. - - - - The name of the directory. - - - - The name of the file. - - - - The date the file or folder was last opened. - - - - The date the file or folder last had anything written to it. - - - - The security settings of the file or folder. - - - - The size of the file or folder. - - - - Represents the collection used to store Uniform Resource Identifier (URI) prefixes for objects. - - - Adds a Uniform Resource Identifier (URI) prefix to the collection. - A that identifies the URI information that is compared in incoming requests. The prefix must be terminated with a forward slash ("/"). - uriPrefix is null. - uriPrefix does not use the http:// or https:// scheme. These are the only schemes supported for objects. -or- uriPrefix is not a correctly formatted URI prefix. Make sure the string is terminated with a "/". - The associated with this collection is closed. - A Windows function call failed. Check the exception's property to determine the cause of the exception. This exception is thrown if another has already added the prefix uriPrefix. - - - Removes all the Uniform Resource Identifier (URI) prefixes from the collection. - A Windows function call failed. Check the exception's property to determine the cause of the exception. - The associated with this collection is closed. - - - Returns a value that indicates whether the specified prefix is contained in the collection. - A that contains the Uniform Resource Identifier (URI) prefix to test. - true if this collection contains the prefix specified by uriPrefix; otherwise, false. - uriPrefix is null. - - - Copies the contents of an to the specified array. - The one dimensional that receives the Uniform Resource Identifier (URI) prefix strings in this collection. - The zero-based index in array at which copying begins. - array has more than one dimension. - This collection contains more elements than can be stored in array starting at offset. - The associated with this collection is closed. - array cannot store string values. - - - Copies the contents of an to the specified string array. - The one dimensional string array that receives the Uniform Resource Identifier (URI) prefix strings in this collection. - The zero-based index in array at which copying begins. - array has more than one dimension. - This collection contains more elements than can be stored in array starting at offset. - The associated with this collection is closed. - - - Gets the number of prefixes contained in the collection. - An that contains the number of prefixes in this collection. - - - Returns an object that can be used to iterate through the collection. - An object that implements the interface and provides access to the strings in this collection. - - - Gets a value that indicates whether access to the collection is read-only. - Always returns false. - - - Gets a value that indicates whether access to the collection is synchronized (thread-safe). - This property always returns false. - - - Removes the specified Uniform Resource Identifier (URI) from the list of prefixes handled by the object. - A that contains the URI prefix to remove. - true if the uriPrefix was found in the and removed; otherwise false. - uriPrefix is null. - A Windows function call failed. To determine the cause of the exception, check the exception's error code. - The associated with this collection is closed. - - - Returns an object that can be used to iterate through the collection. - An object that implements the interface and provides access to the strings in this collection. - - - Describes an incoming HTTP request to an object. This class cannot be inherited. - - - Gets the MIME types accepted by the client. - A array that contains the type names specified in the request's Accept header or null if the client request did not include an Accept header. - - - Begins an asynchronous request for the client's X.509 v.3 certificate. - An delegate that references the method to invoke when the operation is complete. - A user-defined object that contains information about the operation. This object is passed to the callback delegate when the operation completes. - An that indicates the status of the operation. - - - Gets an error code that identifies a problem with the provided by the client. - An value that contains a Windows error code. - The client certificate has not been initialized yet by a call to the or methods -or - The operation is still in progress. - - - Gets the content encoding that can be used with data sent with the request - An object suitable for use with the data in the property. - - - Gets the length of the body data included in the request. - The value from the request's Content-Length header. This value is -1 if the content length is not known. - - - Gets the MIME type of the body data included in the request. - A that contains the text of the request's Content-Type header. - - - Gets the cookies sent with the request. - A that contains cookies that accompany the request. This property returns an empty collection if the request does not contain cookies. - - - Ends an asynchronous request for the client's X.509 v.3 certificate. - The pending request for the certificate. - The object that is returned when the operation started. - asyncResult is null. - asyncResult was not obtained by calling e. - This method was already called for the operation identified by asyncResult. - - - Retrieves the client's X.509 v.3 certificate. - A object that contains the client's X.509 v.3 certificate. - A call to this method to retrieve the client's X.509 v.3 certificate is in progress and therefore another call to this method cannot be made. - - - Retrieves the client's X.509 v.3 certificate as an asynchronous operation. - Returns . The task object representing the asynchronous operation. The property on the task object returns a object that contains the client's X.509 v.3 certificate. - - - Gets a value that indicates whether the request has associated body data. - true if the request has associated body data; otherwise, false. - - - Gets the collection of header name/value pairs sent in the request. - A that contains the HTTP headers included in the request. - - - Gets the HTTP method specified by the client. - A that contains the method used in the request. - - - Gets a stream that contains the body data sent by the client. - A readable object that contains the bytes sent by the client in the body of the request. This property returns if no data is sent with the request. - - - Gets a value that indicates whether the client sending this request is authenticated. - true if the client was authenticated; otherwise, false. - - - Gets a value that indicates whether the request is sent from the local computer. - true if the request originated on the same computer as the object that provided the request; otherwise, false. - - - Gets a value that indicates whether the TCP connection used to send the request is using the Secure Sockets Layer (SSL) protocol. - true if the TCP connection is using SSL; otherwise, false. - - - Gets a value that indicates whether the TCP connection was a WebSocket request. - Returns . true if the TCP connection is a WebSocket request; otherwise, false. - - - Gets a value that indicates whether the client requests a persistent connection. - true if the connection should be kept open; otherwise, false. - - - Get the server IP address and port number to which the request is directed. - An that represents the IP address that the request is sent to. - - - Gets the HTTP version used by the requesting client. - A that identifies the client's version of HTTP. - - - Gets the query string included in the request. - A object that contains the query data included in the request . - - - Gets the URL information (without the host and port) requested by the client. - A that contains the raw URL for this request. - - - Gets the client IP address and port number from which the request originated. - An that represents the IP address and port number from which the request originated. - - - Gets the request identifier of the incoming HTTP request. - A object that contains the identifier of the HTTP request. - - - Gets the Service Provider Name (SPN) that the client sent on the request. - A that contains the SPN the client sent on the request. - - - Gets the for the client request. - A object for the client request. - - - Gets the object requested by the client. - A object that identifies the resource requested by the client. - - - Gets the Uniform Resource Identifier (URI) of the resource that referred the client to the server. - A object that contains the text of the request's header, or null if the header was not included in the request. - - - Gets the user agent presented by the client. - A object that contains the text of the request's User-Agent header. - - - Gets the server IP address and port number to which the request is directed. - A that contains the host address information. - - - Gets the DNS name and, if provided, the port number specified by the client. - A value that contains the text of the request's Host header. - - - Gets the natural languages that are preferred for the response. - A array that contains the languages specified in the request's header or null if the client request did not include an header. - - - Represents a response to a request being handled by an object. - - - Closes the connection to the client without sending a response. - - - Adds the specified header and value to the HTTP headers for this response. - The name of the HTTP header to set. - The value for the name header. - name is null or an empty string (""). - You are not allowed to specify a value for the specified header. -or- name or value contains invalid characters. - The length of value is greater than 65,535 characters. - - - Adds the specified to the collection of cookies for this response. - The to add to the collection to be sent with this response. - cookie is null. - - - Appends a value to the specified HTTP header to be sent with this response. - The name of the HTTP header to append value to. - The value to append to the name header. - name is null or an empty string (""). -or- You are not allowed to specify a value for the specified header. -or- name or value contains invalid characters. - The length of value is greater than 65,535 characters. - - - Sends the response to the client and releases the resources held by this instance. - - - Returns the specified byte array to the client and releases the resources held by this instance. - A array that contains the response to send to the client. - true to block execution while flushing the stream to the client; otherwise, false. - responseEntity is null. - This object is closed. - - - Gets or sets the for this response's . - An object suitable for use with the data in the property, or null if no encoding is specified. - - - Gets or sets the number of bytes in the body data included in the response. - The value of the response's Content-Length header. - The value specified for a set operation is less than zero. - The response is already being sent. - This object is closed. - - - Gets or sets the MIME type of the content returned. - A instance that contains the text of the response's Content-Type header. - The value specified for a set operation is null. - The value specified for a set operation is an empty string (""). - This object is closed. - - - Gets or sets the collection of cookies returned with the response. - A that contains cookies to accompany the response. The collection is empty if no cookies have been added to the response. - - - Copies properties from the specified to this response. - The instance to copy. - - - Gets or sets the collection of header name/value pairs returned by the server. - A instance that contains all the explicitly set HTTP headers to be included in the response. - The instance specified for a set operation is not valid for a response. - - - Gets or sets a value indicating whether the server requests a persistent connection. - true if the server requests a persistent connection; otherwise, false. The default is true. - This object is closed. - - - Gets a object to which a response can be written. - A object to which a response can be written. - This object is closed. - - - Gets or sets the HTTP version used for the response. - A object indicating the version of HTTP used when responding to the client. Note that this property is now obsolete. - The value specified for a set operation is null. - The value specified for a set operation does not have its property set to 1 or does not have its property set to either 0 or 1. - This object is closed. - - - Configures the response to redirect the client to the specified URL. - The URL that the client should use to locate the requested resource. - - - Gets or sets the value of the HTTP Location header in this response. - A that contains the absolute URL to be sent to the client in the Location header. - The value specified for a set operation is an empty string (""). - This object is closed. - - - Gets or sets whether the response uses chunked transfer encoding. - true if the response is set to use chunked transfer encoding; otherwise, false. The default is false. - - - Adds or updates a in the collection of cookies sent with this response. - A for this response. - cookie is null. - The cookie already exists in the collection and could not be replaced. - - - Gets or sets the HTTP status code to be returned to the client. - An value that specifies the HTTP status code for the requested resource. The default is , indicating that the server successfully processed the client's request and included the requested resource in the response body. - This object is closed. - The value specified for a set operation is not valid. Valid values are between 100 and 999 inclusive. - - - Gets or sets a text description of the HTTP status code returned to the client. - The text description of the HTTP status code returned to the client. The default is the RFC 2616 description for the property value, or an empty string ("") if an RFC 2616 description does not exist. - The value specified for a set operation is null. - The value specified for a set operation contains non-printable characters. - - - Releases all resources used by the . - - - The timeout manager to use for an object. - - - Gets or sets the time, in seconds, allowed for the to drain the entity body on a Keep-Alive connection. - Returns . The time, in seconds, allowed for the to drain the entity body on a Keep-Alive connection. - - - Gets or sets the time, in seconds, allowed for the request entity body to arrive. - Returns . The time, in seconds, allowed for the request entity body to arrive. - - - Gets or sets the time, in seconds, allowed for the to parse the request header. - Returns . The time, in seconds, allowed for the to parse the request header. - - - Gets or sets the time, in seconds, allowed for an idle connection. - Returns . The time, in seconds, allowed for an idle connection. - - - Gets or sets the minimum send rate, in bytes-per-second, for the response. - Returns . The minimum send rate, in bytes-per-second, for the response. - - - Gets or sets the time, in seconds, allowed for the request to remain in the request queue before the picks it up. - Returns . The time, in seconds, allowed for the request to remain in the request queue before the picks it up. - - - The HTTP headers that may be specified in a client request. - - - The Accept header, which specifies the MIME types that are acceptable for the response. - - - - The Accept-Charset header, which specifies the character sets that are acceptable for the response. - - - - The Accept-Encoding header, which specifies the content encodings that are acceptable for the response. - - - - The Accept-Langauge header, which specifies that natural languages that are preferred for the response. - - - - The Allow header, which specifies the set of HTTP methods supported. - - - - The Authorization header, which specifies the credentials that the client presents in order to authenticate itself to the server. - - - - The Cache-Control header, which specifies directives that must be obeyed by all cache control mechanisms along the request/response chain. - - - - The Connection header, which specifies options that are desired for a particular connection. - - - - The Content-Encoding header, which specifies the encodings that have been applied to the accompanying body data. - - - - The Content-Langauge header, which specifies the natural language(s) of the accompanying body data. - - - - The Content-Length header, which specifies the length, in bytes, of the accompanying body data. - - - - The Content-Location header, which specifies a URI from which the accompanying body may be obtained. - - - - The Content-MD5 header, which specifies the MD5 digest of the accompanying body data, for the purpose of providing an end-to-end message integrity check. - - - - The Content-Range header, which specifies where in the full body the accompanying partial body data should be applied. - - - - The Content-Type header, which specifies the MIME type of the accompanying body data. - - - - The Cookie header, which specifies cookie data presented to the server. - - - - The Date header, which specifies the date and time at which the request originated. - - - - The Expect header, which specifies particular server behaviors that are required by the client. - - - - The Expires header, which specifies the date and time after which the accompanying body data should be considered stale. - - - - The From header, which specifies an Internet E-mail address for the human user who controls the requesting user agent. - - - - The Host header, which specifies the host name and port number of the resource being requested. - - - - The If-Match header, which specifies that the requested operation should be performed only if the client's cached copy of the indicated resource is current. - - - - The If-Modified-Since header, which specifies that the requested operation should be performed only if the requested resource has been modified since the indicated data and time. - - - - The If-None-Match header, which specifies that the requested operation should be performed only if none of client's cached copies of the indicated resources are current. - - - - The If-Range header, which specifies that only the specified range of the requested resource should be sent, if the client's cached copy is current. - - - - The If-Unmodified-Since header, which specifies that the requested operation should be performed only if the requested resource has not been modified since the indicated date and time. - - - - The Keep-Alive header, which specifies a parameter used into order to maintain a persistent connection. - - - - The Last-Modified header, which specifies the date and time at which the accompanying body data was last modified. - - - - The Max-Forwards header, which specifies an integer indicating the remaining number of times that this request may be forwarded. - - - - The Pragma header, which specifies implementation-specific directives that might apply to any agent along the request/response chain. - - - - The Proxy-Authorization header, which specifies the credentials that the client presents in order to authenticate itself to a proxy. - - - - The Range header, which specifies the the sub-range(s) of the response that the client requests be returned in lieu of the entire response. - - - - The Referer header, which specifies the URI of the resource from which the request URI was obtained. - - - - The TE header, which specifies the transfer encodings that are acceptable for the response. - - - - The Trailer header, which specifies the header fields present in the trailer of a message encoded with chunked transfer-coding. - - - - The Transfer-Encoding header, which specifies what (if any) type of transformation that has been applied to the message body. - - - - The Translate header, a Microsoft extension to the HTTP specification used in conjunction with WebDAV functionality. - - - - The Upgrade header, which specifies additional communications protocols that the client supports. - - - - The User-Agent header, which specifies information about the client agent. - - - - The Via header, which specifies intermediate protocols to be used by gateway and proxy agents. - - - - The Warning header, which specifies additional information about that status or transformation of a message that might not be reflected in the message. - - - - The HTTP headers that can be specified in a server response. - - - The Accept-Ranges header, which specifies the range that is accepted by the server. - - - - The Age header, which specifies the time, in seconds, since the response was generated by the originating server. - - - - The Allow header, which specifies the set of HTTP methods that are supported. - - - - The Cache-Control header, which specifies caching directives that must be obeyed by all caching mechanisms along the request/response chain. - - - - The Connection header, which specifies options that are desired for a particular connection. - - - - The Content-Encoding header, which specifies the encodings that have been applied to the accompanying body data. - - - - The Content-Langauge header, which specifies the natural language or languages of the accompanying body data. - - - - The Content-Length header, which specifies the length, in bytes, of the accompanying body data. - - - - The Content-Location header, which specifies a URI from which the accompanying body can be obtained. - - - - The Content-MD5 header, which specifies the MD5 digest of the accompanying body data, for the purpose of providing an end-to-end message integrity check. - - - - The Range header, which specifies the subrange or subranges of the response that the client requests be returned in lieu of the entire response. - - - - The Content-Type header, which specifies the MIME type of the accompanying body data. - - - - The Date header, which specifies the date and time at which the response originated. - - - - The Etag header, which specifies the current value for the requested variant. - - - - The Expires header, which specifies the date and time after which the accompanying body data should be considered stale. - - - - The Keep-Alive header, which specifies a parameter to be used to maintain a persistent connection. - - - - The Last-Modified header, which specifies the date and time at which the accompanying body data was last modified. - - - - The Location header, which specifies a URI to which the client is redirected to obtain the requested resource. - - - - The Pragma header, which specifies implementation-specific directives that might apply to any agent along the request/response chain. - - - - The Proxy-Authenticate header, which specifies that the client must authenticate itself to a proxy. - - - - The Retry-After header, which specifies a time (in seconds), or a date and time, after which the client can retry its request. - - - - The Server header, which specifies information about the originating server agent. - - - - The Set-Cookie header, which specifies cookie data that is presented to the client. - - - - The Trailer header, which specifies that the indicated header fields are present in the trailer of a message that is encoded with chunked transfer-coding. - - - - The Transfer-Encoding header, which specifies what (if any) type of transformation has been applied to the message body. - - - - The Upgrade header, which specifies additional communications protocols that the client supports. - - - - The Vary header, which specifies the request headers that are used to determine whether a cached response is fresh. - - - - The Via header, which specifies intermediate protocols to be used by gateway and proxy agents. - - - - The Warning header, which specifies additional information about that status or transformation of a message that might not be reflected in the message. - - - - The WWW-Authenticate header, which specifies that the client must authenticate itself to the server. - - - - Contains the values of status codes defined for HTTP. - - - Equivalent to HTTP status 202. indicates that the request has been accepted for further processing. - - - - Equivalent to HTTP status 300. indicates that the requested information has multiple representations. The default action is to treat this status as a redirect and follow the contents of the Location header associated with this response. - - - - Equivalent to HTTP status 502. indicates that an intermediate proxy server received a bad response from another proxy or the origin server. - - - - Equivalent to HTTP status 400. indicates that the request could not be understood by the server. is sent when no other error is applicable, or if the exact error is unknown or does not have its own error code. - - - - Equivalent to HTTP status 409. indicates that the request could not be carried out because of a conflict on the server. - - - - Equivalent to HTTP status 100. indicates that the client can continue with its request. - - - - Equivalent to HTTP status 201. indicates that the request resulted in a new resource created before the response was sent. - - - - Equivalent to HTTP status 417. indicates that an expectation given in an Expect header could not be met by the server. - - - - Equivalent to HTTP status 403. indicates that the server refuses to fulfill the request. - - - - Equivalent to HTTP status 302. indicates that the requested information is located at the URI specified in the Location header. The default action when this status is received is to follow the Location header associated with the response. When the original request method was POST, the redirected request will use the GET method. - - - - Equivalent to HTTP status 504. indicates that an intermediate proxy server timed out while waiting for a response from another proxy or the origin server. - - - - Equivalent to HTTP status 410. indicates that the requested resource is no longer available. - - - - Equivalent to HTTP status 505. indicates that the requested HTTP version is not supported by the server. - - - - Equivalent to HTTP status 500. indicates that a generic error has occurred on the server. - - - - Equivalent to HTTP status 411. indicates that the required Content-length header is missing. - - - - Equivalent to HTTP status 405. indicates that the request method (POST or GET) is not allowed on the requested resource. - - - - Equivalent to HTTP status 301. indicates that the requested information has been moved to the URI specified in the Location header. The default action when this status is received is to follow the Location header associated with the response. When the original request method was POST, the redirected request will use the GET method. - - - - Equivalent to HTTP status 301. indicates that the requested information has been moved to the URI specified in the Location header. The default action when this status is received is to follow the Location header associated with the response. - - - - Equivalent to HTTP status 300. indicates that the requested information has multiple representations. The default action is to treat this status as a redirect and follow the contents of the Location header associated with this response. - - - - Equivalent to HTTP status 204. indicates that the request has been successfully processed and that the response is intentionally blank. - - - - Equivalent to HTTP status 203. indicates that the returned metainformation is from a cached copy instead of the origin server and therefore may be incorrect. - - - - Equivalent to HTTP status 406. indicates that the client has indicated with Accept headers that it will not accept any of the available representations of the resource. - - - - Equivalent to HTTP status 404. indicates that the requested resource does not exist on the server. - - - - Equivalent to HTTP status 501. indicates that the server does not support the requested function. - - - - Equivalent to HTTP status 304. indicates that the client's cached copy is up to date. The contents of the resource are not transferred. - - - - Equivalent to HTTP status 200. indicates that the request succeeded and that the requested information is in the response. This is the most common status code to receive. - - - - Equivalent to HTTP status 206. indicates that the response is a partial response as requested by a GET request that includes a byte range. - - - - Equivalent to HTTP status 402. is reserved for future use. - - - - Equivalent to HTTP status 412. indicates that a condition set for this request failed, and the request cannot be carried out. Conditions are set with conditional request headers like If-Match, If-None-Match, or If-Unmodified-Since. - - - - Equivalent to HTTP status 407. indicates that the requested proxy requires authentication. The Proxy-authenticate header contains the details of how to perform the authentication. - - - - Equivalent to HTTP status 302. indicates that the requested information is located at the URI specified in the Location header. The default action when this status is received is to follow the Location header associated with the response. When the original request method was POST, the redirected request will use the GET method. - - - - Equivalent to HTTP status 307. indicates that the request information is located at the URI specified in the Location header. The default action when this status is received is to follow the Location header associated with the response. When the original request method was POST, the redirected request will also use the POST method. - - - - Equivalent to HTTP status 303. automatically redirects the client to the URI specified in the Location header as the result of a POST. The request to the resource specified by the Location header will be made with a GET. - - - - Equivalent to HTTP status 416. indicates that the range of data requested from the resource cannot be returned, either because the beginning of the range is before the beginning of the resource, or the end of the range is after the end of the resource. - - - - Equivalent to HTTP status 413. indicates that the request is too large for the server to process. - - - - Equivalent to HTTP status 408. indicates that the client did not send a request within the time the server was expecting the request. - - - - Equivalent to HTTP status 414. indicates that the URI is too long. - - - - Equivalent to HTTP status 205. indicates that the client should reset (not reload) the current resource. - - - - Equivalent to HTTP status 303. automatically redirects the client to the URI specified in the Location header as the result of a POST. The request to the resource specified by the Location header will be made with a GET. - - - - Equivalent to HTTP status 503. indicates that the server is temporarily unavailable, usually due to high load or maintenance. - - - - Equivalent to HTTP status 101. indicates that the protocol version or protocol is being changed. - - - - Equivalent to HTTP status 307. indicates that the request information is located at the URI specified in the Location header. The default action when this status is received is to follow the Location header associated with the response. When the original request method was POST, the redirected request will also use the POST method. - - - - Equivalent to HTTP status 401. indicates that the requested resource requires authentication. The WWW-Authenticate header contains the details of how to perform the authentication. - - - - Equivalent to HTTP status 415. indicates that the request is an unsupported type. - - - - Equivalent to HTTP status 306. is a proposed extension to the HTTP/1.1 specification that is not fully specified. - - - - Equivalent to HTTP status 426. indicates that the client should switch to a different protocol such as TLS/1.0. - - - - Equivalent to HTTP status 305. indicates that the request should use the proxy server at the URI specified in the Location header. - - - - Defines the HTTP version numbers that are supported by the and classes. - - - Defines a instance for HTTP 1.0. - - - - Defines a instance for HTTP 1.1. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Provides the base authentication interface for Web client authentication modules. - - - Returns an instance of the class in respose to an authentication challenge from a server. - The authentication challenge sent by the server. - The instance associated with the challenge. - The credentials associated with the challenge. - An instance containing the authorization message for the request, or null if the challenge cannot be handled. - - - Gets the authentication type provided by this authentication module. - A string indicating the authentication type provided by this authentication module. - - - Gets a value indicating whether the authentication module supports preauthentication. - true if the authorization module supports preauthentication; otherwise false. - - - Returns an instance of the class for an authentication request to a server. - The instance associated with the authentication request. - The credentials associated with the authentication request. - An instance containing the authorization message for the request. - - - Defines the credential policy to be used for resource requests that are made using and its derived classes. - - - Returns a that indicates whether the client's credentials are sent with a resource request made using an instance of the class. - The that will receive the request. - The that represents the resource being requested. - The that will be sent with the request if this method returns true. - The that will conduct the authentication, if authentication is required. - true if the credentials are sent with the request; otherwise, false. - - - Provides the base authentication interface for retrieving credentials for Web client authentication. - - - Returns a object that is associated with the specified URI, and authentication type. - The that the client is providing authentication for. - The type of authentication, as defined in the property. - The that is associated with the specified URI and authentication type, or, if no credentials are available, null. - - - Provides the interface for retrieving credentials for a host, port, and authentication type. - - - Returns the credential for the specified host, port, and authentication protocol. - The host computer that is authenticating the client. - The port on host that the client will communicate with. - The authentication protocol. - A for the specified host, port, and authentication protocol, or null if there are no credentials available for the specified host, port, and authentication protocol. - - - Provides an Internet Protocol (IP) address. - - - Initializes a new instance of the class with the address specified as a array. - The byte array value of the IP address. - address is null. - address contains a bad IP address. - - - Initializes a new instance of the class with the address specified as an . - The long value of the IP address. For example, the value 0x2414188f in big-endian format would be the IP address "143.24.20.36". - newAddress < 0 or newAddress > 0x00000000FFFFFFFF - - - Initializes a new instance of the class with the address specified as a array and the specified scope identifier. - The byte array value of the IP address. - The long value of the scope identifier. - address is null. - address contains a bad IP address. - scopeid < 0 or scopeid > 0x00000000FFFFFFFF - - - An Internet Protocol (IP) address. - The long value of the IP address. - The address family is . - - - Gets the address family of the IP address. - Returns for IPv4 or for IPv6. - - - Provides an IP address that indicates that the server must listen for client activity on all network interfaces. This field is read-only. - - - - Provides the IP broadcast address. This field is read-only. - - - - Compares two IP addresses. - An instance to compare to the current instance. - true if the two addresses are equal; otherwise, false. - - - Provides a copy of the as an array of bytes. - A array. - - - Returns a hash value for an IP address. - An integer hash value. - - - Converts a short value from host byte order to network byte order. - The number to convert, expressed in host byte order. - A short value, expressed in network byte order. - - - Converts an integer value from host byte order to network byte order. - The number to convert, expressed in host byte order. - An integer value, expressed in network byte order. - - - Converts a long value from host byte order to network byte order. - The number to convert, expressed in host byte order. - A long value, expressed in network byte order. - - - The method uses the field to indicate that a must listen for client activity on all network interfaces. - - - - Provides the IP loopback address. This property is read-only. - - - - Provides an IP address that indicates that no network interface should be used. This property is read-only. - - - - Gets whether the IP address is an IPv4-mapped IPv6 address. - Returns . true if the IP address is an IPv4-mapped IPv6 address; otherwise, false. - - - Gets whether the address is an IPv6 link local address. - true if the IP address is an IPv6 link local address; otherwise, false. - - - Gets whether the address is an IPv6 multicast global address. - true if the IP address is an IPv6 multicast global address; otherwise, false. - - - Gets whether the address is an IPv6 site local address. - true if the IP address is an IPv6 site local address; otherwise, false. - - - Gets whether the address is an IPv6 Teredo address. - true if the IP address is an IPv6 Teredo address; otherwise, false. - - - Indicates whether the specified IP address is the loopback address. - An IP address. - true if address is the loopback address; otherwise, false. - - - Provides the IP loopback address. This field is read-only. - - - - Maps the object to an IPv4 address. - Returns . An IPv4 address. - - - Maps the object to an IPv6 address. - Returns . An IPv6 address. - - - Converts a short value from network byte order to host byte order. - The number to convert, expressed in network byte order. - A short value, expressed in host byte order. - - - Converts an integer value from network byte order to host byte order. - The number to convert, expressed in network byte order. - An integer value, expressed in host byte order. - - - Converts a long value from network byte order to host byte order. - The number to convert, expressed in network byte order. - A long value, expressed in host byte order. - - - Provides an IP address that indicates that no network interface should be used. This field is read-only. - - - - Converts an IP address string to an instance. - A string that contains an IP address in dotted-quad notation for IPv4 and in colon-hexadecimal notation for IPv6. - An instance. - ipString is null. - ipString is not a valid IP address. - - - Gets or sets the IPv6 address scope identifier. - A long integer that specifies the scope of the address. - AddressFamily = InterNetwork. - scopeId < 0 - or - scopeId > 0x00000000FFFFFFFF - - - Converts an Internet address to its standard notation. - A string that contains the IP address in either IPv4 dotted-quad or in IPv6 colon-hexadecimal notation. - The address family is and the address is bad. - - - Determines whether a string is a valid IP address. - The string to validate. - The version of the string. - true if ipString was able to be parsed as an IP address; otherwise, false. - - - Represents a network endpoint as an IP address and a port number. - - - Initializes a new instance of the class with the specified address and port number. - The IP address of the Internet host. - The port number associated with the address, or 0 to specify any available port. port is in host order. - port is less than . -or- port is greater than . -or- address is less than 0 or greater than 0x00000000FFFFFFFF. - - - Initializes a new instance of the class with the specified address and port number. - An . - The port number associated with the address, or 0 to specify any available port. port is in host order. - address is null. - port is less than . -or- port is greater than . -or- address is less than 0 or greater than 0x00000000FFFFFFFF. - - - Gets or sets the IP address of the endpoint. - An instance containing the IP address of the endpoint. - - - Gets the Internet Protocol (IP) address family. - Returns . - - - Creates an endpoint from a socket address. - The to use for the endpoint. - An instance using the specified socket address. - The AddressFamily of socketAddress is not equal to the AddressFamily of the current instance. -or- socketAddress.Size < 8. - - - Determines whether the specified is equal to the current . - The to compare with the current . - true if the specified is equal to the current ; otherwise, false. - - - Returns a hash value for a instance. - An integer hash value. - - - Specifies the maximum value that can be assigned to the property. The MaxPort value is set to 0x0000FFFF. This field is read-only. - - - - Specifies the minimum value that can be assigned to the property. This field is read-only. - - - - Gets or sets the port number of the endpoint. - An integer value in the range to indicating the port number of the endpoint. - The value that was specified for a set operation is less than or greater than . - - - Serializes endpoint information into a instance. - A instance containing the socket address for the endpoint. - - - Returns the IP address and port number of the specified endpoint. - A string containing the IP address and the port number of the specified endpoint (for example, 192.168.1.2:80). - - - Provides a container class for Internet host address information. - - - Initializes a new instance of the class. - - - Gets or sets a list of IP addresses that are associated with a host. - An array of type that contains IP addresses that resolve to the host names that are contained in the property. - - - Gets or sets a list of aliases that are associated with a host. - An array of strings that contain DNS names that resolve to the IP addresses in the property. - - - Gets or sets the DNS name of the host. - A string that contains the primary host name for the server. - - - Provides the base interface for implementation of proxy access for the class. - - - The credentials to submit to the proxy server for authentication. - An instance that contains the credentials that are needed to authenticate a request to the proxy server. - - - Returns the URI of a proxy. - A that specifies the requested Internet resource. - A instance that contains the URI of the proxy used to contact destination. - - - Indicates that the proxy should not be used for the specified host. - The of the host to check for proxy use. - true if the proxy server should not be used for host; otherwise, false. - - - Provides the base interface to load and execute scripts for automatic proxy detection. - - - Closes a script. - - - Loads a script. - Internal only. - Internal only. - Internal only. - A indicating whether the script was successfully loaded. - - - Runs a script. - Internal only. - Internal only. - A . An internal-only value returned. - - - Provides the base interface for creating instances. - - - Creates a instance. - The uniform resource identifier (URI) of the Web resource. - A instance. - The request scheme specified in uri is not supported by this instance. - uri is null. - - In the [.NET for Windows Store apps](http://go.microsoft.com/fwlink/?LinkID=247912) or the [Portable Class Library](~/docs/standard/cross-platform/cross-platform-development-with-the-portable-class-library.md), catch the base class exception, , instead. - - The URI specified in uri is not a valid URI. - - - Represents the format to view an email message. - - - Initializes a new instance of with the specified . - A stream that contains the content for this view. - contentStream is null. - - - Initializes a new instance of with the specified file name. - The name of the file that contains the content for this alternate view. - fileName is null. - The caller does not have the required permission. - An I/O error occurred, such as a disk error. - The access requested is not permitted by the operating system for the specified file handle, such as when access is Write or ReadWrite and the file handle is set for read-only access. - - - Initializes a new instance of with the specified and . - A stream that contains the content for this attachment. - The type of the content. - contentStream is null. - contentType is not a valid value. - - - Initializes a new instance of with the specified and media type. - A stream that contains the content for this attachment. - The MIME media type of the content. - contentStream is null. - mediaType is not a valid value. - - - Initializes a new instance of with the specified file name and content type. - The name of the file that contains the content for this alternate view. - The type of the content. - fileName is null. - contentType is not a valid value. - The caller does not have the required permission. - An I/O error occurred, such as a disk error. - The access requested is not permitted by the operating system for the specified file handle, such as when access is Write or ReadWrite and the file handle is set for read-only access. - - - Initializes a new instance of with the specified file name and media type. - The name of the file that contains the content for this alternate view. - The MIME media type of the content. - fileName is null. - mediaType is not a valid value. - The caller does not have the required permission. - An I/O error occurred, such as a disk error. - The access requested is not permitted by the operating system for the specified file handle, such as when access is Write or ReadWrite and the file handle is set for read-only access. - - - Gets or sets the base URI to use for resolving relative URIs in the . - A . The base . - - - Creates a of an email message using the content specified in a . - The that contains the content of the email message. - An object that represents an alternate view of an email message. - content is null. - - - Creates an of an email message using the content specified in a and the specified MIME media type of the content. - A that contains the content for this attachment. - A that describes the data in string. - An object that represents an alternate view of an email message. - content is null. - - - Creates an of an email message using the content specified in a , the specified text encoding, and MIME media type of the content. - A that contains the content for this attachment. - - The MIME media type of the content. - An object that represents an alternate view of an email message. - content is null. - - - Releases the unmanaged resources used by the and optionally releases the managed resources. - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - Gets the set of embedded resources referred to by this attachment. - A object that stores the collection of linked resources to be sent as part of an e-mail message. - - - Represents a collection of objects. - - - Releases all resources used by the . - - - Represents an attachment to an e-mail. - - - Initializes a new instance of the class with the specified content string. - A that contains a file path to use to create this attachment. - fileName is null. - fileName is empty. - - - Initializes a new instance of the class with the specified stream and content type. - A readable that contains the content for this attachment. - A that describes the data in stream. - contentType is null. -or- contentStream is null. - - - Initializes a new instance of the class with the specified stream and name. - A readable that contains the content for this attachment. - A that contains the value for the property of the associated with this attachment. This value can be null. - contentStream is null. - - - Initializes a new instance of the class with the specified content string and . - A that contains a file path to use to create this attachment. - A that describes the data in string. - fileName is null. - mediaType is not in the correct format. - - - Initializes a new instance of the class with the specified content string and MIME type information. - A that contains the content for this attachment. - A that contains the MIME Content-Header information for this attachment. This value can be null. - fileName is null. - mediaType is not in the correct format. - - - Initializes a new instance of the class with the specified stream, name, and MIME type information. - A readable that contains the content for this attachment. - A that contains the value for the property of the associated with this attachment. This value can be null. - A that contains the MIME Content-Header information for this attachment. This value can be null. - stream is null. - mediaType is not in the correct format. - - - Gets the MIME content disposition for this attachment. - A that provides the presentation information for this attachment. - - - Creates a mail attachment using the content from the specified string, and the specified . - A that contains the content for this attachment. - A object that represents the Multipurpose Internet Mail Exchange (MIME) protocol Content-Type header to be used. - An object of type . - - - Creates a mail attachment using the content from the specified string, and the specified MIME content type name. - A that contains the content for this attachment. - The MIME content type name value in the content type associated with this attachment. - An object of type . - - - Creates a mail attachment using the content from the specified string, the specified MIME content type name, character encoding, and MIME header information for the attachment. - A that contains the content for this attachment. - The MIME content type name value in the content type associated with this attachment. - An . This value can be null. - A that contains the MIME Content-Header information for this attachment. This value can be null. - An object of type . - - - Gets or sets the MIME content type name value in the content type associated with this attachment. - A that contains the value for the content type name represented by the property. - The value specified for a set operation is null. - The value specified for a set operation is (""). - - - Specifies the encoding for the . - An value that specifies the type of name encoding. The default value is determined from the name of the attachment. - - - Base class that represents an email attachment. Classes , , and derive from this class. - - - Instantiates an with the specified . - A stream containing the content for this attachment. - contentStream is null. - - - Instantiates an with the specified file name. - The file name holding the content for this attachment. - fileName is null. - - - Instantiates an with the specified and . - A stream containing the content for this attachment. - The type of the content. - contentStream is null. - contentType is not a valid value. - - - Instantiates an with the specified and media type. - A stream containing the content for this attachment. - The MIME media type of the content. - contentStream is null. - mediaType is not a valid value. - - - Instantiates an with the specified file name and content type. - The file name holding the content for this attachment. - The type of the content. - fileName is null. - contentType is not a valid value. - - - Instantiates an with the specified file name and media type. - The file name holding the content for this attachment. - The MIME media type of the content. - fileName is null. - mediaType is not a valid value. - - - Gets or sets the MIME content ID for this attachment. - A holding the content ID. - Attempted to set to null. - - - Gets the content stream of this attachment. - A . The content stream of this attachment. - - - Gets the content type of this attachment. - A . The content type for this attachment. - - - Releases the resources used by the . - - - Releases the unmanaged resources used by the and optionally releases the managed resources. - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - Gets or sets the encoding of this attachment. - A . The encoding for this attachment. - - - Stores attachments to be sent as part of an e-mail message. - - - Releases all resources used by the . - - - Describes the delivery notification options for e-mail. - - - Notify if the delivery is delayed. - - - - A notification should not be generated under any circumstances. - - - - No notification information will be sent. The mail server will utilize its configured behavior to determine whether it should generate a delivery notification. - - - - Notify if the delivery is unsuccessful. - - - - Notify if the delivery is successful. - - - - Represents an embedded external resource in an email attachment, such as an image in an HTML attachment. - - - Initializes a new instance of using the supplied . - A stream that contains the content for this embedded resource. - contentStream is null. - - - Initializes a new instance of using the specified file name. - The file name holding the content for this embedded resource. - fileName is null. - - - Initializes a new instance of with the values supplied by and . - A stream that contains the content for this embedded resource. - The type of the content. - contentStream is null. - contentType is not a valid value. - - - Initializes a new instance of with the specified and media type. - A stream that contains the content for this embedded resource. - The MIME media type of the content. - contentStream is null. - mediaType is not a valid value. - - - Initializes a new instance of with the specified file name and content type. - The file name that holds the content for this embedded resource. - The type of the content. - fileName is null. - contentType is not a valid value. - - - Initializes a new instance of with the specified file name and media type. - The file name that holds the content for this embedded resource. - The MIME media type of the content. - fileName is null. - mediaType is not a valid value. - - - Gets or sets a URI that the resource must match. - If is a relative URI, the recipient of the message must resolve it. - - - Creates a object from a string to be included in an email attachment as an embedded resource. The default media type is plain text, and the default content type is ASCII. - A string that contains the embedded resource to be included in the email attachment. - A object that contains the embedded resource to be included in the email attachment. - The specified content string is null. - - - Creates a object from a string to be included in an email attachment as an embedded resource, with the specified content type, and media type as plain text. - A string that contains the embedded resource to be included in the email attachment. - The type of the content. - A object that contains the embedded resource to be included in the email attachment. - The specified content string is null. - - - Creates a object from a string to be included in an email attachment as an embedded resource, with the specified content type, and media type. - A string that contains the embedded resource to be included in the email attachment. - The type of the content. - The MIME media type of the content. - A object that contains the embedded resource to be included in the email attachment. - The specified content string is null. - - - Stores linked resources to be sent as part of an e-mail message. - - - Releases all resources used by the . - - - Represents the address of an electronic mail sender or recipient. - - - Initializes a new instance of the class using the specified address. - A that contains an e-mail address. - address is null. - address is (""). - address is not in a recognized format. - - - Initializes a new instance of the class using the specified address and display name. - A that contains an e-mail address. - A that contains the display name associated with address. This parameter can be null. - address is null. - address is (""). - address is not in a recognized format. -or- address contains non-ASCII characters. - - - Initializes a new instance of the class using the specified address, display name, and encoding. - A that contains an e-mail address. - A that contains the display name associated with address. - The that defines the character set used for displayName. - address is null. -or- displayName is null. - address is (""). -or- displayName is (""). - address is not in a recognized format. -or- address contains non-ASCII characters. - - - Gets the e-mail address specified when this instance was created. - A that contains the e-mail address. - - - Gets the display name composed from the display name and address information specified when this instance was created. - A that contains the display name; otherwise, ("") if no display name information was specified when this instance was created. - - - Compares two mail addresses. - - true if the two mail addresses are equal; otherwise, false. - - - Returns a hash value for a mail address. - An integer hash value. - - - Gets the host portion of the address specified when this instance was created. - A that contains the name of the host computer that accepts e-mail for the property. - - - Returns a string representation of this instance. - A that contains the contents of this . - - - Gets the user information from the address specified when this instance was created. - A that contains the user name portion of the . - - - Store e-mail addresses that are associated with an e-mail message. - - - Initializes an empty instance of the class. - - - Add a list of e-mail addresses to the collection. - The e-mail addresses to add to the . Multiple e-mail addresses must be separated with a comma character (","). - The addresses parameter is null. - The addresses parameter is an empty string. - The addresses parameter contains an e-mail address that is invalid or not supported. - - - Inserts an e-mail address into the , at the specified location. - The location at which to insert the e-mail address that is specified by item. - The e-mail address to be inserted into the collection. - The item parameter is null. - - - Replaces the element at the specified index. - The index of the e-mail address element to be replaced. - An e-mail address that will replace the element in the collection. - The item parameter is null. - - - Returns a string representation of the e-mail addresses in this object. - A containing the e-mail addresses in this collection. - - - Represents an e-mail message that can be sent using the class. - - - Initializes an empty instance of the class. - - - Initializes a new instance of the class by using the specified class objects. - A that contains the address of the sender of the e-mail message. - A that contains the address of the recipient of the e-mail message. - from is null. -or- to is null. - from or to is malformed. - - - Initializes a new instance of the class by using the specified class objects. - A that contains the address of the sender of the e-mail message. - A that contains the addresses of the recipients of the e-mail message. - from is null. -or- to is null. - from is (""). -or- to is (""). - from or to is malformed. - - - Initializes a new instance of the class. - A that contains the address of the sender of the e-mail message. - A that contains the address of the recipient of the e-mail message. - A that contains the subject text. - A that contains the message body. - from is null. -or- to is null. - from is (""). -or- to is (""). - from or to is malformed. - - - Gets the attachment collection used to store alternate forms of the message body. - A writable . - - - Gets the attachment collection used to store data attached to this e-mail message. - A writable . - - - Gets the address collection that contains the blind carbon copy (BCC) recipients for this e-mail message. - A writable object. - - - Gets or sets the message body. - A value that contains the body text. - - - Gets or sets the encoding used to encode the message body. - An applied to the contents of the . - - - Gets or sets the transfer encoding used to encode the message body. - Returns . A applied to the contents of the . - - - Gets the address collection that contains the carbon copy (CC) recipients for this e-mail message. - A writable object. - - - Gets or sets the delivery notifications for this e-mail message. - A value that contains the delivery notifications for this message. - - - Releases the unmanaged resources used by the and optionally releases the managed resources. - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - Releases all resources used by the . - - - Gets or sets the from address for this e-mail message. - A that contains the from address information. - - - Gets the e-mail headers that are transmitted with this e-mail message. - A that contains the e-mail headers. - - - Gets or sets the encoding used for the user-defined custom headers for this e-mail message. - The encoding used for user-defined custom headers for this e-mail message. - - - Gets or sets a value indicating whether the mail message body is in Html. - true if the message body is in Html; else false. The default is false. - - - Gets or sets the priority of this e-mail message. - A that contains the priority of this message. - - - Gets or sets the ReplyTo address for the mail message. - A MailAddress that indicates the value of the field. - - - Gets or sets the list of addresses to reply to for the mail message. - The list of the addresses to reply to for the mail message. - - - Gets or sets the sender's address for this e-mail message. - A that contains the sender's address information. - - - Gets or sets the subject line for this e-mail message. - A that contains the subject content. - - - Gets or sets the encoding used for the subject content for this e-mail message. - An that was used to encode the property. - - - Gets the address collection that contains the recipients of this e-mail message. - A writable object. - - - Specifies the priority of a . - - - The email has high priority. - - - - The email has low priority. - - - - The email has normal priority. - - - - Represents the method that will handle the event. - The source of the event. - An containing event data. - - - Allows applications to send e-mail by using the Simple Mail Transfer Protocol (SMTP). - - - Initializes a new instance of the class by using configuration file settings. - - - Initializes a new instance of the class that sends e-mail by using the specified SMTP server. - A that contains the name or IP address of the host computer used for SMTP transactions. - - - Initializes a new instance of the class that sends e-mail by using the specified SMTP server and port. - A that contains the name or IP address of the host used for SMTP transactions. - An greater than zero that contains the port to be used on host. - port cannot be less than zero. - - - Specify which certificates should be used to establish the Secure Sockets Layer (SSL) connection. - An , holding one or more client certificates. The default value is derived from the mail configuration attributes in a configuration file. - - - Gets or sets the credentials used to authenticate the sender. - An that represents the credentials to use for authentication; or null if no credentials have been specified. - You cannot change the value of this property when an email is being sent. - - - Gets or sets the delivery format used by to send e-mail. - Returns . The delivery format used by . - - - Specifies how outgoing email messages will be handled. - An that indicates how email messages are delivered. - - - Sends a QUIT message to the SMTP server, gracefully ends the TCP connection, and releases all resources used by the current instance of the class. - - - Sends a QUIT message to the SMTP server, gracefully ends the TCP connection, releases all resources used by the current instance of the class, and optionally disposes of the managed resources. - true to release both managed and unmanaged resources; false to releases only unmanaged resources. - - - Specify whether the uses Secure Sockets Layer (SSL) to encrypt the connection. - true if the uses SSL; otherwise, false. The default is false. - - - Gets or sets the name or IP address of the host used for SMTP transactions. - A that contains the name or IP address of the computer to use for SMTP transactions. - The value specified for a set operation is null. - The value specified for a set operation is equal to (""). - You cannot change the value of this property when an email is being sent. - - - Raises the event. - An that contains event data. - - - Gets or sets the folder where applications save mail messages to be processed by the local SMTP server. - A that specifies the pickup directory for mail messages. - - - Gets or sets the port used for SMTP transactions. - An that contains the port number on the SMTP host. The default value is 25. - The value specified for a set operation is less than or equal to zero. - You cannot change the value of this property when an email is being sent. - - - Sends the specified message to an SMTP server for delivery. - A that contains the message to send. - message is null. - This has a call in progress. -or- is null. -or- There are no recipients specified in , , and properties. -or- property is set to and is null. -or- property is set to and is equal to the empty string (""). -or- property is set to and is zero, a negative number, or greater than 65,535. - This object has been disposed. - The connection to the SMTP server failed. -or- Authentication failed. -or- The operation timed out. -or- is set to true but the property is set to or . -or- is set to true, but the SMTP mail server did not advertise STARTTLS in the response to the EHLO command. - The message could not be delivered to one or more of the recipients in , , or . - - - Sends the specified e-mail message to an SMTP server for delivery. The message sender, recipients, subject, and message body are specified using objects. - A that contains the address information of the message sender. - - A that contains the subject line for the message. - A that contains the message body. - from is null. -or- recipients is null. - from is . -or- recipients is . - This has a call in progress. -or- property is set to and is null. -or- property is set to and is equal to the empty string (""). -or- property is set to and is zero, a negative number, or greater than 65,535. - This object has been disposed. - The connection to the SMTP server failed. -or- Authentication failed. -or- The operation timed out. -or- is set to true but the property is set to or . -or- is set to true, but the SMTP mail server did not advertise STARTTLS in the response to the EHLO command. - The message could not be delivered to one or more of the recipients in recipients. - - - Sends the specified e-mail message to an SMTP server for delivery. This method does not block the calling thread and allows the caller to pass an object to the method that is invoked when the operation completes. - A that contains the message to send. - A user-defined object that is passed to the method invoked when the asynchronous operation completes. - message is null. -or- is null. - This has a call in progress. -or- There are no recipients specified in , , and properties. -or- property is set to and is null. -or- property is set to and is equal to the empty string (""). -or- property is set to and is zero, a negative number, or greater than 65,535. - This object has been disposed. - The connection to the SMTP server failed. -or- Authentication failed. -or- The operation timed out. -or- is set to true but the property is set to or . -or- is set to true, but the SMTP mail server did not advertise STARTTLS in the response to the EHLO command. -or- The message could not be delivered to one or more of the recipients in , , or . - - - Sends an e-mail message to an SMTP server for delivery. The message sender, recipients, subject, and message body are specified using objects. This method does not block the calling thread and allows the caller to pass an object to the method that is invoked when the operation completes. - A that contains the address information of the message sender. - - A that contains the subject line for the message. - A that contains the message body. - A user-defined object that is passed to the method invoked when the asynchronous operation completes. - from is null. -or- recipient is null. - from is . -or- recipient is . - This has a call in progress. -or- property is set to and is null. -or- property is set to and is equal to the empty string (""). -or- property is set to and is zero, a negative number, or greater than 65,535. - This object has been disposed. - The connection to the SMTP server failed. -or- Authentication failed. -or- The operation timed out. -or- is set to true but the property is set to or . -or- is set to true, but the SMTP mail server did not advertise STARTTLS in the response to the EHLO command. -or- The message could not be delivered to one or more of the recipients in recipients. - - - Cancels an asynchronous operation to send an e-mail message. - This object has been disposed. - - - Occurs when an asynchronous e-mail send operation completes. - - - - Sends the specified message to an SMTP server for delivery as an asynchronous operation. - A that contains the message to send. - Returns . The task object representing the asynchronous operation. - message is null. - - - Sends the specified message to an SMTP server for delivery as an asynchronous operation. . The message sender, recipients, subject, and message body are specified using objects. - A that contains the address information of the message sender. - A that contains the addresses that the message is sent to. - A that contains the subject line for the message. - A that contains the message body. - Returns . The task object representing the asynchronous operation. - from is null. -or- recipients is null. - from is . -or- recipients is . - - - Gets the network connection used to transmit the e-mail message. - A that connects to the property used for SMTP. - is null or the empty string (""). -or- is zero. - - - Gets or sets the Service Provider Name (SPN) to use for authentication when using extended protection. -

A that specifies the SPN to use for extended protection. The default value for this SPN is of the form "SMTPSVC/" where is the hostname of the SMTP mail server.

-

-
-
- - Gets or sets a value that specifies the amount of time after which a synchronous call times out. - An that specifies the time-out value in milliseconds. The default value is 100,000 (100 seconds). - The value specified for a set operation was less than zero. - You cannot change the value of this property when an email is being sent. - - - Gets or sets a value that controls whether the are sent with requests. - true if the default credentials are used; otherwise false. The default value is false. - You cannot change the value of this property when an e-mail is being sent. - - - The delivery format to use for sending outgoing e-mail using the Simple Mail Transport Protocol (SMTP). - - - A delivery format where non-ASCII characters in the envelope and header fields used in the Simple Mail Transport Protocol (SMTP) for mail messages are encoded with UTF-8 characters. The extensions to support international e-mail are defined in IETF RFC 6530, 6531, and 6532. - - - - A delivery format using 7-bit ASCII. The traditional delivery format used in the Simple Mail Transport Protocol (SMTP) for mail messages. - - - - Specifies how email messages are delivered. - - - Email is sent through the network to an SMTP server. - - - - Email is copied to the pickup directory used by a local Internet Information Services (IIS) for delivery. - - - - Email is copied to the directory specified by the property for delivery by an external application. - - - - Represents the exception that is thrown when the is not able to complete a or operation. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with the specified status code. - An value. - - - Initializes a new instance of the class with the specified error message. - A that describes the error that occurred. - - - Initializes a new instance of the class with the specified status code and error message. - An value. - A that describes the error that occurred. - - - Initializes a new instance of the class from the specified instances of the and classes. - - - - - Initializes a new instance of the class with the specified error message and inner exception. - A that describes the error that occurred. - The exception that is the cause of the current exception. - - - Populates a instance with the data needed to serialize the . - - - - - Gets the status code returned by an SMTP server when an e-mail message is transmitted. - An value that indicates the error that occurred. - - - Populates a instance with the data needed to serialize the . - - - - - Represents the exception that is thrown when the is not able to complete a or operation to a particular recipient. - - - Initializes an empty instance of the class. - - - Initializes a new instance of the class with the specified error message. - A that contains the error message. - - - Initializes a new instance of the class with the specified status code and e-mail address. - An value. - A that contains the e-mail address. - - - Initializes a new instance of the class from the specified instances of the and classes. - - - - - Initializes a new instance of the class with the specified error message and inner exception. - A that describes the error that occurred. - The exception that is the cause of the current exception. - - - Initializes a new instance of the class with the specified status code, e-mail address, and server response. - An value. - A that contains the e-mail address. - A that contains the server response. - - - Initializes a new instance of the class with the specified error message, e-mail address, and inner exception. - A that describes the error that occurred. - A that contains the e-mail address. - The exception that is the cause of the current exception. - - - Indicates the e-mail address with delivery difficulties. - A that contains the e-mail address. - - - Populates a instance with the data that is needed to serialize the . - The to populate with data. - A that specifies the destination for this serialization. - - - Populates a instance with the data that is needed to serialize the . - A instance, which holds the serialized data for the . - A instance that contains the destination of the serialized stream that is associated with the new . - - - The exception that is thrown when e-mail is sent using an and cannot be delivered to all recipients. - - - Initializes an empty instance of the class. - - - Initializes a new instance of the class with the specified . - The exception message. - - - Initializes a new instance of the class from the specified instances of the and classes. - A instance that contains the information required to serialize the new instance. - A that contains the source of the serialized stream that is associated with the new instance. - - - Initializes a new instance of the class with the specified and inner . - The exception message. - The inner exception. - - - Initializes a new instance of the class with the specified and array of type . - The exception message. - The array of recipients with delivery errors. - - - Populates a instance with the data that is needed to serialize the . - - - - - Gets one or more s that indicate the e-mail recipients with SMTP delivery errors. - An array of type that lists the recipients with delivery errors. - - - Initializes a new instance of the class from the specified and instances. - - - - - Specifies the outcome of sending e-mail by using the class. - - - The commands were sent in the incorrect sequence. - - - - The specified user is not local, but the receiving SMTP service accepted the message and attempted to deliver it. This status code is defined in RFC 1123, which is available at http://www.ietf.org. - - - - The client was not authenticated or is not allowed to send mail using the specified SMTP host. - - - - The SMTP service does not implement the specified command. - - - - The SMTP service does not implement the specified command parameter. - - - - The SMTP service does not recognize the specified command. - - - - The message is too large to be stored in the destination mailbox. - - - - The transaction could not occur. You receive this error when the specified SMTP host cannot be found. - - - - A Help message was returned by the service. - - - - The SMTP service does not have sufficient storage to complete the request. - - - - The SMTP service cannot complete the request. This error can occur if the client's IP address cannot be resolved (that is, a reverse lookup failed). You can also receive this error if the client domain has been identified as an open relay or source for unsolicited e-mail (spam). For details, see RFC 2505, which is available at http://www.ietf.org. - - - - The destination mailbox is in use. - - - - The syntax used to specify the destination mailbox is incorrect. - - - - The destination mailbox was not found or could not be accessed. - - - - The SMTP server is configured to accept only TLS connections, and the SMTP client is attempting to connect by using a non-TLS connection. The solution is for the user to set EnableSsl=true on the SMTP Client. - - - - The email was successfully sent to the SMTP service. - - - - The SMTP service is closing the transmission channel. - - - - The SMTP service is not available; the server is closing the transmission channel. - - - - The SMTP service is ready. - - - - The SMTP service is ready to receive the e-mail content. - - - - The syntax used to specify a command or parameter is incorrect. - - - - A system status or system Help reply. - - - - The transaction failed. - - - - The user mailbox is not located on the receiving server. You should resend using the supplied address information. - - - - The user mailbox is not located on the receiving server; the server forwards the e-mail. - - - - Represents a MIME protocol Content-Disposition header. - - - Initializes a new instance of the class with a of . - - - Initializes a new instance of the class with the specified disposition information. - A value that contains the disposition. - disposition is null or equal to (""). - - - Gets or sets the creation date for a file attachment. - A value that indicates the file creation date; otherwise, if no date was specified. - - - Gets or sets the disposition type for an e-mail attachment. - A that contains the disposition type. The value is not restricted but is typically one of the values. - The value specified for a set operation is null. - The value specified for a set operation is equal to (""). - - - Determines whether the content-disposition header of the specified object is equal to the content-disposition header of this object. - The object to compare with this object. - true if the content-disposition headers are the same; otherwise false. - - - Gets or sets the suggested file name for an e-mail attachment. - A that contains the file name. - - - Determines the hash code of the specified object - An integer hash value. - - - Gets or sets a value that determines the disposition type (Inline or Attachment) for an e-mail attachment. - true if content in the attachment is presented inline as part of the e-mail body; otherwise, false. - - - Gets or sets the modification date for a file attachment. - A value that indicates the file modification date; otherwise, if no date was specified. - - - Gets the parameters included in the Content-Disposition header represented by this instance. - A writable that contains parameter name/value pairs. - - - Gets or sets the read date for a file attachment. - A value that indicates the file read date; otherwise, if no date was specified. - - - Gets or sets the size of a file attachment. - A that specifies the number of bytes in the file attachment. The default value is -1, which indicates that the file size is unknown. - - - Returns a representation of this instance. - A that contains the property values for this instance. - - - Represents a MIME protocol Content-Type header. - - - Initializes a new default instance of the class. - - - Initializes a new instance of the class using the specified string. - A , for example, "text/plain; charset=us-ascii", that contains the MIME media type, subtype, and optional parameters. - contentType is null. - contentType is (""). - contentType is in a form that cannot be parsed. - - - Gets or sets the value of the boundary parameter included in the Content-Type header represented by this instance. - A that contains the value associated with the boundary parameter. - - - Gets or sets the value of the charset parameter included in the Content-Type header represented by this instance. - A that contains the value associated with the charset parameter. - - - Determines whether the content-type header of the specified object is equal to the content-type header of this object. - The object to compare with this object. - true if the content-type headers are the same; otherwise false. - - - Determines the hash code of the specified object - An integer hash value. - - - Gets or sets the media type value included in the Content-Type header represented by this instance. - A that contains the media type and subtype value. This value does not include the semicolon (;) separator that follows the subtype. - The value specified for a set operation is null. - The value specified for a set operation is (""). - The value specified for a set operation is in a form that cannot be parsed. - - - Gets or sets the value of the name parameter included in the Content-Type header represented by this instance. - A that contains the value associated with the name parameter. - - - Gets the dictionary that contains the parameters included in the Content-Type header represented by this instance. - A writable that contains name and value pairs. - - - Returns a string representation of this object. - A that contains the current settings for this . - - - Supplies the strings used to specify the disposition type for an e-mail attachment. - - - Specifies that the attachment is to be displayed as a file attached to the e-mail message. - - - - Specifies that the attachment is to be displayed as part of the e-mail message body. - - - - Specifies the kind of application data in an e-mail message attachment. - - - Specifies that the data is not interpreted. - - - - Specifies that the data is in Portable Document Format (PDF). - - - - Specifies that the data is in Rich Text Format (RTF). - - - - Specifies that the data is a SOAP document. - - - - Specifies that the data is compressed. - - - - Specifies the type of image data in an e-mail message attachment. - - - Specifies that the data is in Graphics Interchange Format (GIF). - - - - Specifies that the data is in Joint Photographic Experts Group (JPEG) format. - - - - Specifies that the data is in Tagged Image File Format (TIFF). - - - - Specifies the type of text data in an e-mail message attachment. - - - Specifies that the data is in HTML format. - - - - Specifies that the data is in plain text format. - - - - Specifies that the data is in Rich Text Format (RTF). - - - - Specifies that the data is in XML format. - - - - Specifies the media type information for an e-mail message attachment. - - - Specifies the Content-Transfer-Encoding header information for an e-mail message attachment. - - - Encodes stream-based data. See RFC 2406 Section 6.8. - - - - The data is in 8-bit characters that may represent international characters with a total line length of no longer than 1000 8-bit characters. For more information about this 8-bit MIME transport extension, see IETF RFC 6152. - - - - Encodes data that consists of printable characters in the US-ASCII character set. See RFC 2406 Section 6.7. - - - - Used for data that is not encoded. The data is in 7-bit US-ASCII characters with a total line length of no longer than 1000 characters. See RFC2406 Section 2.7. - - - - Indicates that the transfer encoding is unknown. - - - - Provides credentials for password-based authentication schemes such as basic, digest, NTLM, and Kerberos authentication. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with the specified user name and password. - The user name associated with the credentials. - The password for the user name associated with the credentials. - The class is not supported on this platform. - - - Initializes a new instance of the class with the specified user name and password. - The user name associated with the credentials. - The password for the user name associated with the credentials. - - - Initializes a new instance of the class with the specified user name, password, and domain. - The user name associated with the credentials. - The password for the user name associated with the credentials. - The domain associated with these credentials. - The class is not supported on this platform. - - - Initializes a new instance of the class with the specified user name, password, and domain. - The user name associated with the credentials. - The password for the user name associated with the credentials. - The domain associated with these credentials. - - - Gets or sets the domain or computer name that verifies the credentials. - The name of the domain associated with the credentials. - - - Returns an instance of the class for the specified Uniform Resource Identifier (URI) and authentication type. - The URI that the client provides authentication for. - The type of authentication requested, as defined in the property. - A object. - - - Returns an instance of the class for the specified host, port, and authentication type. - The host computer that authenticates the client. - The port on the host that the client communicates with. - The type of authentication requested, as defined in the property. - A for the specified host, port, and authentication protocol, or null if there are no credentials available for the specified host, port, and authentication protocol. - - - Gets or sets the password for the user name associated with the credentials. - The password associated with the credentials. If this instance was initialized with the password parameter set to null, then the property will return an empty string. - - - Gets or sets the password as a instance. - The password for the user name associated with the credentials. - The class is not supported on this platform. - - - Gets or sets the user name associated with the credentials. - The user name associated with the credentials. - - - Specifies the current state of an IP address. - - - The address is valid, but it is nearing its lease lifetime and should not be used by applications. - - - - The address is not unique. This address should not be assigned to the network interface. - - - - The address is not valid. A nonvalid address is expired and no longer assigned to an interface; applications should not send data packets to it. - - - - The address is valid and its use is unrestricted. - - - - The duplicate address detection procedure's evaluation of the address has not completed successfully. Applications should not use the address because it is not yet valid and packets sent to it are discarded. - - - - Represents the IP address of the network gateway. This class cannot be instantiated. - - - Initializes the members of this class. - - - Get the IP address of the gateway. - An object that contains the IP address of the gateway. - - - Stores a set of types. - - - Initializes a new instance of the class. - - - Throws a because this operation is not supported for this collection. - The object to be added to the collection. - - - Throws a because this operation is not supported for this collection. - - - Checks whether the collection contains the specified object. - The object to be searched in the collection. - true if the object exists in the collection; otherwise false. - - - Copies the elements in this collection to a one-dimensional array of type . - A one-dimensional array that receives a copy of the collection. - The zero-based index in array at which the copy begins. - array is null. - count is less than zero. - array is multidimensional. -or- The number of elements in this is greater than the available space from count to the end of the destination array. - The elements in this cannot be cast automatically to the type of the destination array. - - - Gets the number of types in this collection. - An value that contains the number of types in this collection. - - - Returns an object that can be used to iterate through this collection. - An object that implements the interface and provides access to the types in this collection. - - - Gets a value that indicates whether access to this collection is read-only. - true in all cases. - - - Gets the at the specific index of the collection. - The index of interest. - The at the specific index in the collection. - - - Throws a because this operation is not supported for this collection. - The object to be removed. - Always throws a . - - - Returns an object that can be used to iterate through this collection. - An object that implements the interface and provides access to the types in this collection. - - - Provides Internet Control Message Protocol for IPv4 (ICMPv4) statistical data for the local computer. - - - Initializes a new instance of the class. - - - Gets the number of Internet Control Message Protocol version 4 (ICMPv4) Address Mask Reply messages that were received. - An value that specifies the total number of Address Mask Reply messages that were received. - - - Gets the number of Internet Control Message Protocol version 4 (ICMPv4) Address Mask Reply messages that were sent. - An value that specifies the total number of Address Mask Reply messages that were sent. - - - Gets the number of Internet Control Message Protocol version 4 (ICMPv4) Address Mask Request messages that were received. - An value that specifies the total number of Address Mask Request messages that were received. - - - Gets the number of Internet Control Message Protocol version 4 (ICMPv4) Address Mask Request messages that were sent. - An value that specifies the total number of Address Mask Request messages that were sent. - - - Gets the number of Internet Control Message Protocol version 4 (ICMPv4) messages that were received because of a packet having an unreachable address in its destination. - An value that specifies the total number of Destination Unreachable messages that were received. - - - Gets the number of Internet Control Message Protocol version 4 (ICMPv4) messages that were sent because of a packet having an unreachable address in its destination. - An value that specifies the total number of Destination Unreachable messages sent. - - - Gets the number of Internet Control Message Protocol version 4 (ICMPv4) Echo Reply messages that were received. - An value that specifies the total number of number of ICMP Echo Reply messages that were received. - - - Gets the number of Internet Control Message Protocol version 4 (ICMPv4) Echo Reply messages that were sent. - An value that specifies the total number of number of ICMP Echo Reply messages that were sent. - - - Gets the number of Internet Control Message Protocol version 4 (ICMPv4) Echo Request messages that were received. - An value that specifies the total number of number of ICMP Echo Request messages that were received. - - - Gets the number of Internet Control Message Protocol version 4 (ICMPv4) Echo Request messages that were sent. - An value that specifies the total number of number of ICMP Echo Request messages that were sent. - - - Gets the number of Internet Control Message Protocol version 4 (ICMPv4) error messages that were received. - An value that specifies the total number of ICMP error messages that were received. - - - Gets the number of Internet Control Message Protocol version 4 (ICMPv4) error messages that were sent. - An value that specifies the total number of number of ICMP error messages that were sent. - - - Gets the number of Internet Control Message Protocol messages that were received. - An value that specifies the total number of ICMPv4 messages that were received. - - - Gets the number of Internet Control Message Protocol version 4 (ICMPv4) messages that were sent. - An value that specifies the total number of ICMPv4 messages that were sent. - - - Gets the number of Internet Control Message Protocol version 4 (ICMPv4) Parameter Problem messages that were received. - An value that specifies the total number of ICMP Parameter Problem messages that were received. - - - Gets the number of Internet Control Message Protocol version 4 (ICMPv4) Parameter Problem messages that were sent. - An value that specifies the total number of ICMP Parameter Problem messages that were sent. - - - Gets the number of Internet Control Message Protocol version 4 (ICMPv4) Redirect messages that were received. - An value that specifies the total number of ICMP Redirect messages that were received. - - - Gets the number of Internet Control Message Protocol version 4 (ICMPv4) Redirect messages that were sent. - An value that specifies the total number of ICMP Redirect messages that were sent. - - - Gets the number of Internet Control Message Protocol version 4 (ICMPv4) Source Quench messages that were received. - An value that specifies the total number of Source Quench messages that were received. - - - Gets the number of Internet Control Message Protocol version 4 (ICMPv4) Source Quench messages that were sent. - An value that specifies the total number of Source Quench messages that were sent. - - - Gets the number of Internet Control Message Protocol version 4 (ICMPv4) Time Exceeded messages that were received. - An value that specifies the total number of ICMP Time Exceeded messages that were received. - - - Gets the number of Internet Control Message Protocol version 4 (ICMPv4) Time Exceeded messages that were sent. - An value that specifies the total number of ICMP Time Exceeded messages that were sent. - - - Gets the number of Internet Control Message Protocol version 4 (ICMPv4) Timestamp Reply messages that were received. - An value that specifies the total number of Timestamp Reply messages that were received. - - - Gets the number of Internet Control Message Protocol version 4 (ICMPv4) Timestamp Reply messages that were sent. - An value that specifies the total number of Timestamp Reply messages that were sent. - - - Gets the number of Internet Control Message Protocol version 4 (ICMPv4) Timestamp Request messages that were received. - An value that specifies the total number of Timestamp Request messages that were received. - - - Gets the number of Internet Control Message Protocol version 4 (ICMPv4) Timestamp Request messages that were sent. - An value that specifies the total number of Timestamp Request messages that were sent. - - - Provides Internet Control Message Protocol for Internet Protocol version 6 (ICMPv6) statistical data for the local computer. - - - Initializes a new instance of the class. - - - Gets the number of Internet Control Message Protocol version 6 (ICMPv6) messages received because of a packet having an unreachable address in its destination. - An value that specifies the total number of Destination Unreachable messages received. - - - Gets the number of Internet Control Message Protocol version 6 (ICMPv6) messages sent because of a packet having an unreachable address in its destination. - An value that specifies the total number of Destination Unreachable messages sent. - - - Gets the number of Internet Control Message Protocol version 6 (ICMPv6) Echo Reply messages received. - An value that specifies the total number of number of ICMP Echo Reply messages received. - - - Gets the number of Internet Control Message Protocol version 6 (ICMPv6) Echo Reply messages sent. - An value that specifies the total number of number of ICMP Echo Reply messages sent. - - - Gets the number of Internet Control Message Protocol version 6 (ICMPv6) Echo Request messages received. - An value that specifies the total number of number of ICMP Echo Request messages received. - - - Gets the number of Internet Control Message Protocol version 6 (ICMPv6) Echo Request messages sent. - An value that specifies the total number of number of ICMP Echo Request messages sent. - - - Gets the number of Internet Control Message Protocol version 6 (ICMPv6) error messages received. - An value that specifies the total number of ICMP error messages received. - - - Gets the number of Internet Control Message Protocol version 6 (ICMPv6) error messages sent. - An value that specifies the total number of ICMP error messages sent. - - - Gets the number of Internet Group management Protocol (IGMP) Group Membership Query messages received. - An value that specifies the total number of Group Membership Query messages received. - - - Gets the number of Internet Group management Protocol (IGMP) Group Membership Query messages sent. - An value that specifies the total number of Group Membership Query messages sent. - - - Gets the number of Internet Group Management Protocol (IGMP) Group Membership Reduction messages received. - An value that specifies the total number of Group Membership Reduction messages received. - - - Gets the number of Internet Group Management Protocol (IGMP) Group Membership Reduction messages sent. - An value that specifies the total number of Group Membership Reduction messages sent. - - - Gets the number of Internet Group Management Protocol (IGMP) Group Membership Report messages received. - An value that specifies the total number of Group Membership Report messages received. - - - Gets the number of Internet Group Management Protocol (IGMP) Group Membership Report messages sent. - An value that specifies the total number of Group Membership Report messages sent. - - - Gets the number of Internet Control Message Protocol version 6 (ICMPv6) messages received. - An value that specifies the total number of ICMPv6 messages received. - - - Gets the number of Internet Control Message Protocol version 6 (ICMPv6) messages sent. - An value that specifies the total number of ICMPv6 messages sent. - - - Gets the number of Internet Control Message Protocol version 6 (ICMPv6) Neighbor Advertisement messages received. - An value that specifies the total number of ICMP Neighbor Advertisement messages received. - - - Gets the number of Internet Control Message Protocol version 6 (ICMPv6) Neighbor Advertisement messages sent. - An value that specifies the total number of Neighbor Advertisement messages sent. - - - Gets the number of Internet Control Message Protocol version 6 (ICMPv6) Neighbor Solicitation messages received. - An value that specifies the total number of Neighbor Solicitation messages received. - - - Gets the number of Internet Control Message Protocol version 6 (ICMPv6) Neighbor Solicitation messages sent. - An value that specifies the total number of Neighbor Solicitation messages sent. - - - Gets the number of Internet Control Message Protocol version 6 (ICMPv6) Packet Too Big messages received. - An value that specifies the total number of ICMP Packet Too Big messages received. - - - Gets the number of Internet Control Message Protocol version 6 (ICMPv6) Packet Too Big messages sent. - An value that specifies the total number of ICMP Packet Too Big messages sent. - - - Gets the number of Internet Control Message Protocol version 6 (ICMPv6) Parameter Problem messages received. - An value that specifies the total number of ICMP Parameter Problem messages received. - - - Gets the number of Internet Control Message Protocol version 6 (ICMPv6) Parameter Problem messages sent. - An value that specifies the total number of ICMP Parameter Problem messages sent. - - - Gets the number of Internet Control Message Protocol version 6 (ICMPv6) Redirect messages received. - An value that specifies the total number of ICMP Redirect messages received. - - - Gets the number of Internet Control Message Protocol version 6 (ICMPv6) Redirect messages sent. - An value that specifies the total number of ICMP Redirect messages sent. - - - Gets the number of Internet Control Message Protocol version 6 (ICMPv6) Router Advertisement messages received. - An value that specifies the total number of Router Advertisement messages received. - - - Gets the number of Internet Control Message Protocol version 6 (ICMPv6) Router Advertisement messages sent. - An value that specifies the total number of Router Advertisement messages sent. - - - Gets the number of Internet Control Message Protocol version 6 (ICMPv6) Router Solicitation messages received. - An value that specifies the total number of Router Solicitation messages received. - - - Gets the number of Internet Control Message Protocol version 6 (ICMPv6) Router Solicitation messages sent. - An value that specifies the total number of Router Solicitation messages sent. - - - Gets the number of Internet Control Message Protocol version 6 (ICMPv6) Time Exceeded messages received. - An value that specifies the total number of ICMP Time Exceeded messages received. - - - Gets the number of Internet Control Message Protocol version 6 (ICMPv6) Time Exceeded messages sent. - An value that specifies the total number of ICMP Time Exceeded messages sent. - - - Describes an intermediate language (IL) instruction. - - - Tests whether the given object is equal to this Opcode. - The object to compare to this object. - true if obj is an instance of Opcode and is equal to this object; otherwise, false. - - - Indicates whether the current instance is equal to the specified . - The to compare to the current instance. - true if the value of obj is equal to the value of the current instance; otherwise, false. - - - The flow control characteristics of the intermediate language (IL) instruction. - Read-only. The type of flow control. - - - Returns the generated hash code for this Opcode. - Returns the hash code for this instance. - - - The name of the intermediate language (IL) instruction. - Read-only. The name of the IL instruction. - - - Indicates whether two structures are equal. - The to compare to b. - The to compare to a. - true if a is equal to b; otherwise, false. - - - Indicates whether two structures are not equal. - The to compare to b. - The to compare to a. - true if a is not equal to b; otherwise, false. - - - The type of intermediate language (IL) instruction. - Read-only. The type of intermediate language (IL) instruction. - - - The operand type of an intermediate language (IL) instruction. - Read-only. The operand type of an IL instruction. - - - The size of the intermediate language (IL) instruction. - Read-only. The size of the IL instruction. - - - How the intermediate language (IL) instruction pops the stack. - Read-only. The way the IL instruction pops the stack. - - - How the intermediate language (IL) instruction pushes operand onto the stack. - Read-only. The way the IL instruction pushes operand onto the stack. - - - Returns this Opcode as a . - Returns a containing the name of this Opcode. - - - Gets the numeric value of the intermediate language (IL) instruction. - Read-only. The numeric value of the IL instruction. - - - Provides field representations of the Microsoft Intermediate Language (MSIL) instructions for emission by the class members (such as ). - - - Adds two values and pushes the result onto the evaluation stack. - - - - Adds two integers, performs an overflow check, and pushes the result onto the evaluation stack. - - - - Adds two unsigned integer values, performs an overflow check, and pushes the result onto the evaluation stack. - - - - Computes the bitwise AND of two values and pushes the result onto the evaluation stack. - - - - Returns an unmanaged pointer to the argument list of the current method. - - - - Transfers control to a target instruction if two values are equal. - - - - Transfers control to a target instruction (short form) if two values are equal. - - - - Transfers control to a target instruction if the first value is greater than or equal to the second value. - - - - Transfers control to a target instruction (short form) if the first value is greater than or equal to the second value. - - - - Transfers control to a target instruction if the first value is greater than the second value, when comparing unsigned integer values or unordered float values. - - - - Transfers control to a target instruction (short form) if the first value is greater than the second value, when comparing unsigned integer values or unordered float values. - - - - Transfers control to a target instruction if the first value is greater than the second value. - - - - Transfers control to a target instruction (short form) if the first value is greater than the second value. - - - - Transfers control to a target instruction if the first value is greater than the second value, when comparing unsigned integer values or unordered float values. - - - - Transfers control to a target instruction (short form) if the first value is greater than the second value, when comparing unsigned integer values or unordered float values. - - - - Transfers control to a target instruction if the first value is less than or equal to the second value. - - - - Transfers control to a target instruction (short form) if the first value is less than or equal to the second value. - - - - Transfers control to a target instruction if the first value is less than or equal to the second value, when comparing unsigned integer values or unordered float values. - - - - Transfers control to a target instruction (short form) if the first value is less than or equal to the second value, when comparing unsigned integer values or unordered float values. - - - - Transfers control to a target instruction if the first value is less than the second value. - - - - Transfers control to a target instruction (short form) if the first value is less than the second value. - - - - Transfers control to a target instruction if the first value is less than the second value, when comparing unsigned integer values or unordered float values. - - - - Transfers control to a target instruction (short form) if the first value is less than the second value, when comparing unsigned integer values or unordered float values. - - - - Transfers control to a target instruction when two unsigned integer values or unordered float values are not equal. - - - - Transfers control to a target instruction (short form) when two unsigned integer values or unordered float values are not equal. - - - - Converts a value type to an object reference (type O). - - - - Unconditionally transfers control to a target instruction. - - - - Unconditionally transfers control to a target instruction (short form). - - - - Signals the Common Language Infrastructure (CLI) to inform the debugger that a break point has been tripped. - - - - Transfers control to a target instruction if value is false, a null reference (Nothing in Visual Basic), or zero. - - - - Transfers control to a target instruction if value is false, a null reference, or zero. - - - - Transfers control to a target instruction if value is true, not null, or non-zero. - - - - Transfers control to a target instruction (short form) if value is true, not null, or non-zero. - - - - Calls the method indicated by the passed method descriptor. - - - - Calls the method indicated on the evaluation stack (as a pointer to an entry point) with arguments described by a calling convention. - - - - Calls a late-bound method on an object, pushing the return value onto the evaluation stack. - - - - Attempts to cast an object passed by reference to the specified class. - - - - Compares two values. If they are equal, the integer value 1 (int32) is pushed onto the evaluation stack; otherwise 0 (int32) is pushed onto the evaluation stack. - - - - Compares two values. If the first value is greater than the second, the integer value 1 (int32) is pushed onto the evaluation stack; otherwise 0 (int32) is pushed onto the evaluation stack. - - - - Compares two unsigned or unordered values. If the first value is greater than the second, the integer value 1 (int32) is pushed onto the evaluation stack; otherwise 0 (int32) is pushed onto the evaluation stack. - - - - Throws if value is not a finite number. - - - - Compares two values. If the first value is less than the second, the integer value 1 (int32) is pushed onto the evaluation stack; otherwise 0 (int32) is pushed onto the evaluation stack. - - - - Compares the unsigned or unordered values value1 and value2. If value1 is less than value2, then the integer value 1 (int32) is pushed onto the evaluation stack; otherwise 0 (int32) is pushed onto the evaluation stack. - - - - Constrains the type on which a virtual method call is made. - - - - Converts the value on top of the evaluation stack to native int. - - - - Converts the value on top of the evaluation stack to int8, then extends (pads) it to int32. - - - - Converts the value on top of the evaluation stack to int16, then extends (pads) it to int32. - - - - Converts the value on top of the evaluation stack to int32. - - - - Converts the value on top of the evaluation stack to int64. - - - - Converts the signed value on top of the evaluation stack to signed native int, throwing on overflow. - - - - Converts the unsigned value on top of the evaluation stack to signed native int, throwing on overflow. - - - - Converts the signed value on top of the evaluation stack to signed int8 and extends it to int32, throwing on overflow. - - - - Converts the unsigned value on top of the evaluation stack to signed int8 and extends it to int32, throwing on overflow. - - - - Converts the signed value on top of the evaluation stack to signed int16 and extending it to int32, throwing on overflow. - - - - Converts the unsigned value on top of the evaluation stack to signed int16 and extends it to int32, throwing on overflow. - - - - Converts the signed value on top of the evaluation stack to signed int32, throwing on overflow. - - - - Converts the unsigned value on top of the evaluation stack to signed int32, throwing on overflow. - - - - Converts the signed value on top of the evaluation stack to signed int64, throwing on overflow. - - - - Converts the unsigned value on top of the evaluation stack to signed int64, throwing on overflow. - - - - Converts the signed value on top of the evaluation stack to unsigned native int, throwing on overflow. - - - - Converts the unsigned value on top of the evaluation stack to unsigned native int, throwing on overflow. - - - - Converts the signed value on top of the evaluation stack to unsigned int8 and extends it to int32, throwing on overflow. - - - - Converts the unsigned value on top of the evaluation stack to unsigned int8 and extends it to int32, throwing on overflow. - - - - Converts the signed value on top of the evaluation stack to unsigned int16 and extends it to int32, throwing on overflow. - - - - Converts the unsigned value on top of the evaluation stack to unsigned int16 and extends it to int32, throwing on overflow. - - - - Converts the signed value on top of the evaluation stack to unsigned int32, throwing on overflow. - - - - Converts the unsigned value on top of the evaluation stack to unsigned int32, throwing on overflow. - - - - Converts the signed value on top of the evaluation stack to unsigned int64, throwing on overflow. - - - - Converts the unsigned value on top of the evaluation stack to unsigned int64, throwing on overflow. - - - - Converts the unsigned integer value on top of the evaluation stack to float32. - - - - Converts the value on top of the evaluation stack to float32. - - - - Converts the value on top of the evaluation stack to float64. - - - - Converts the value on top of the evaluation stack to unsigned native int, and extends it to native int. - - - - Converts the value on top of the evaluation stack to unsigned int8, and extends it to int32. - - - - Converts the value on top of the evaluation stack to unsigned int16, and extends it to int32. - - - - Converts the value on top of the evaluation stack to unsigned int32, and extends it to int32. - - - - Converts the value on top of the evaluation stack to unsigned int64, and extends it to int64. - - - - Copies a specified number bytes from a source address to a destination address. - - - - Copies the value type located at the address of an object (type &, * or native int) to the address of the destination object (type &, * or native int). - - - - Divides two values and pushes the result as a floating-point (type F) or quotient (type int32) onto the evaluation stack. - - - - Divides two unsigned integer values and pushes the result (int32) onto the evaluation stack. - - - - Copies the current topmost value on the evaluation stack, and then pushes the copy onto the evaluation stack. - - - - Transfers control from the filter clause of an exception back to the Common Language Infrastructure (CLI) exception handler. - - - - Transfers control from the fault or finally clause of an exception block back to the Common Language Infrastructure (CLI) exception handler. - - - - Initializes a specified block of memory at a specific address to a given size and initial value. - - - - Initializes each field of the value type at a specified address to a null reference or a 0 of the appropriate primitive type. - - - - Tests whether an object reference (type O) is an instance of a particular class. - - - - Exits current method and jumps to specified method. - - - - Loads an argument (referenced by a specified index value) onto the stack. - - - - Loads the argument at index 0 onto the evaluation stack. - - - - Loads the argument at index 1 onto the evaluation stack. - - - - Loads the argument at index 2 onto the evaluation stack. - - - - Loads the argument at index 3 onto the evaluation stack. - - - - Loads the argument (referenced by a specified short form index) onto the evaluation stack. - - - - Load an argument address onto the evaluation stack. - - - - Load an argument address, in short form, onto the evaluation stack. - - - - Pushes a supplied value of type int32 onto the evaluation stack as an int32. - - - - Pushes the integer value of 0 onto the evaluation stack as an int32. - - - - Pushes the integer value of 1 onto the evaluation stack as an int32. - - - - Pushes the integer value of 2 onto the evaluation stack as an int32. - - - - Pushes the integer value of 3 onto the evaluation stack as an int32. - - - - Pushes the integer value of 4 onto the evaluation stack as an int32. - - - - Pushes the integer value of 5 onto the evaluation stack as an int32. - - - - Pushes the integer value of 6 onto the evaluation stack as an int32. - - - - Pushes the integer value of 7 onto the evaluation stack as an int32. - - - - Pushes the integer value of 8 onto the evaluation stack as an int32. - - - - Pushes the integer value of -1 onto the evaluation stack as an int32. - - - - Pushes the supplied int8 value onto the evaluation stack as an int32, short form. - - - - Pushes a supplied value of type int64 onto the evaluation stack as an int64. - - - - Pushes a supplied value of type float32 onto the evaluation stack as type F (float). - - - - Pushes a supplied value of type float64 onto the evaluation stack as type F (float). - - - - Loads the element at a specified array index onto the top of the evaluation stack as the type specified in the instruction. - - - - Loads the element with type native int at a specified array index onto the top of the evaluation stack as a native int. - - - - Loads the element with type int8 at a specified array index onto the top of the evaluation stack as an int32. - - - - Loads the element with type int16 at a specified array index onto the top of the evaluation stack as an int32. - - - - Loads the element with type int32 at a specified array index onto the top of the evaluation stack as an int32. - - - - Loads the element with type int64 at a specified array index onto the top of the evaluation stack as an int64. - - - - Loads the element with type float32 at a specified array index onto the top of the evaluation stack as type F (float). - - - - Loads the element with type float64 at a specified array index onto the top of the evaluation stack as type F (float). - - - - Loads the element containing an object reference at a specified array index onto the top of the evaluation stack as type O (object reference). - - - - Loads the element with type unsigned int8 at a specified array index onto the top of the evaluation stack as an int32. - - - - Loads the element with type unsigned int16 at a specified array index onto the top of the evaluation stack as an int32. - - - - Loads the element with type unsigned int32 at a specified array index onto the top of the evaluation stack as an int32. - - - - Loads the address of the array element at a specified array index onto the top of the evaluation stack as type & (managed pointer). - - - - Finds the value of a field in the object whose reference is currently on the evaluation stack. - - - - Finds the address of a field in the object whose reference is currently on the evaluation stack. - - - - Pushes an unmanaged pointer (type native int) to the native code implementing a specific method onto the evaluation stack. - - - - Loads a value of type native int as a native int onto the evaluation stack indirectly. - - - - Loads a value of type int8 as an int32 onto the evaluation stack indirectly. - - - - Loads a value of type int16 as an int32 onto the evaluation stack indirectly. - - - - Loads a value of type int32 as an int32 onto the evaluation stack indirectly. - - - - Loads a value of type int64 as an int64 onto the evaluation stack indirectly. - - - - Loads a value of type float32 as a type F (float) onto the evaluation stack indirectly. - - - - Loads a value of type float64 as a type F (float) onto the evaluation stack indirectly. - - - - Loads an object reference as a type O (object reference) onto the evaluation stack indirectly. - - - - Loads a value of type unsigned int8 as an int32 onto the evaluation stack indirectly. - - - - Loads a value of type unsigned int16 as an int32 onto the evaluation stack indirectly. - - - - Loads a value of type unsigned int32 as an int32 onto the evaluation stack indirectly. - - - - Pushes the number of elements of a zero-based, one-dimensional array onto the evaluation stack. - - - - Loads the local variable at a specific index onto the evaluation stack. - - - - Loads the local variable at index 0 onto the evaluation stack. - - - - Loads the local variable at index 1 onto the evaluation stack. - - - - Loads the local variable at index 2 onto the evaluation stack. - - - - Loads the local variable at index 3 onto the evaluation stack. - - - - Loads the local variable at a specific index onto the evaluation stack, short form. - - - - Loads the address of the local variable at a specific index onto the evaluation stack. - - - - Loads the address of the local variable at a specific index onto the evaluation stack, short form. - - - - Pushes a null reference (type O) onto the evaluation stack. - - - - Copies the value type object pointed to by an address to the top of the evaluation stack. - - - - Pushes the value of a static field onto the evaluation stack. - - - - Pushes the address of a static field onto the evaluation stack. - - - - Pushes a new object reference to a string literal stored in the metadata. - - - - Converts a metadata token to its runtime representation, pushing it onto the evaluation stack. - - - - Pushes an unmanaged pointer (type native int) to the native code implementing a particular virtual method associated with a specified object onto the evaluation stack. - - - - Exits a protected region of code, unconditionally transferring control to a specific target instruction. - - - - Exits a protected region of code, unconditionally transferring control to a target instruction (short form). - - - - Allocates a certain number of bytes from the local dynamic memory pool and pushes the address (a transient pointer, type *) of the first allocated byte onto the evaluation stack. - - - - Pushes a typed reference to an instance of a specific type onto the evaluation stack. - - - - Multiplies two values and pushes the result on the evaluation stack. - - - - Multiplies two integer values, performs an overflow check, and pushes the result onto the evaluation stack. - - - - Multiplies two unsigned integer values, performs an overflow check, and pushes the result onto the evaluation stack. - - - - Negates a value and pushes the result onto the evaluation stack. - - - - Pushes an object reference to a new zero-based, one-dimensional array whose elements are of a specific type onto the evaluation stack. - - - - Creates a new object or a new instance of a value type, pushing an object reference (type O) onto the evaluation stack. - - - - Fills space if opcodes are patched. No meaningful operation is performed although a processing cycle can be consumed. - - - - Computes the bitwise complement of the integer value on top of the stack and pushes the result onto the evaluation stack as the same type. - - - - Compute the bitwise complement of the two integer values on top of the stack and pushes the result onto the evaluation stack. - - - - Removes the value currently on top of the evaluation stack. - - - - This is a reserved instruction. - - - - This is a reserved instruction. - - - - This is a reserved instruction. - - - - This is a reserved instruction. - - - - This is a reserved instruction. - - - - This is a reserved instruction. - - - - This is a reserved instruction. - - - - This is a reserved instruction. - - - - Specifies that the subsequent array address operation performs no type check at run time, and that it returns a managed pointer whose mutability is restricted. - - - - Retrieves the type token embedded in a typed reference. - - - - Retrieves the address (type &) embedded in a typed reference. - - - - Divides two values and pushes the remainder onto the evaluation stack. - - - - Divides two unsigned values and pushes the remainder onto the evaluation stack. - - - - Returns from the current method, pushing a return value (if present) from the callee's evaluation stack onto the caller's evaluation stack. - - - - Rethrows the current exception. - - - - Shifts an integer value to the left (in zeroes) by a specified number of bits, pushing the result onto the evaluation stack. - - - - Shifts an integer value (in sign) to the right by a specified number of bits, pushing the result onto the evaluation stack. - - - - Shifts an unsigned integer value (in zeroes) to the right by a specified number of bits, pushing the result onto the evaluation stack. - - - - Pushes the size, in bytes, of a supplied value type onto the evaluation stack. - - - - Stores the value on top of the evaluation stack in the argument slot at a specified index. - - - - Stores the value on top of the evaluation stack in the argument slot at a specified index, short form. - - - - Replaces the array element at a given index with the value on the evaluation stack, whose type is specified in the instruction. - - - - Replaces the array element at a given index with the native int value on the evaluation stack. - - - - Replaces the array element at a given index with the int8 value on the evaluation stack. - - - - Replaces the array element at a given index with the int16 value on the evaluation stack. - - - - Replaces the array element at a given index with the int32 value on the evaluation stack. - - - - Replaces the array element at a given index with the int64 value on the evaluation stack. - - - - Replaces the array element at a given index with the float32 value on the evaluation stack. - - - - Replaces the array element at a given index with the float64 value on the evaluation stack. - - - - Replaces the array element at a given index with the object ref value (type O) on the evaluation stack. - - - - Replaces the value stored in the field of an object reference or pointer with a new value. - - - - Stores a value of type native int at a supplied address. - - - - Stores a value of type int8 at a supplied address. - - - - Stores a value of type int16 at a supplied address. - - - - Stores a value of type int32 at a supplied address. - - - - Stores a value of type int64 at a supplied address. - - - - Stores a value of type float32 at a supplied address. - - - - Stores a value of type float64 at a supplied address. - - - - Stores a object reference value at a supplied address. - - - - Pops the current value from the top of the evaluation stack and stores it in a the local variable list at a specified index. - - - - Pops the current value from the top of the evaluation stack and stores it in a the local variable list at index 0. - - - - Pops the current value from the top of the evaluation stack and stores it in a the local variable list at index 1. - - - - Pops the current value from the top of the evaluation stack and stores it in a the local variable list at index 2. - - - - Pops the current value from the top of the evaluation stack and stores it in a the local variable list at index 3. - - - - Pops the current value from the top of the evaluation stack and stores it in a the local variable list at index (short form). - - - - Copies a value of a specified type from the evaluation stack into a supplied memory address. - - - - Replaces the value of a static field with a value from the evaluation stack. - - - - Subtracts one value from another and pushes the result onto the evaluation stack. - - - - Subtracts one integer value from another, performs an overflow check, and pushes the result onto the evaluation stack. - - - - Subtracts one unsigned integer value from another, performs an overflow check, and pushes the result onto the evaluation stack. - - - - Implements a jump table. - - - - Performs a postfixed method call instruction such that the current method's stack frame is removed before the actual call instruction is executed. - - - - Returns true or false if the supplied opcode takes a single byte argument. - An instance of an Opcode object. - True or false. - - - Throws the exception object currently on the evaluation stack. - - - - Indicates that an address currently atop the evaluation stack might not be aligned to the natural size of the immediately following ldind, stind, ldfld, stfld, ldobj, stobj, initblk, or cpblk instruction. - - - - Converts the boxed representation of a value type to its unboxed form. - - - - Converts the boxed representation of a type specified in the instruction to its unboxed form. - - - - Specifies that an address currently atop the evaluation stack might be volatile, and the results of reading that location cannot be cached or that multiple stores to that location cannot be suppressed. - - - - Computes the bitwise XOR of the top two values on the evaluation stack, pushing the result onto the evaluation stack. - - - - Describes the types of the Microsoft intermediate language (MSIL) instructions. - - - This enumerator value is reserved and should not be used. - - - - These are Microsoft intermediate language (MSIL) instructions that are used as a synonym for other MSIL instructions. For example, ldarg.0 represents the ldarg instruction with an argument of 0. - - - - Describes a reserved Microsoft intermediate language (MSIL) instruction. - - - - Describes a Microsoft intermediate language (MSIL) instruction that applies to objects. - - - - Describes a prefix instruction that modifies the behavior of the following instruction. - - - - Describes a built-in instruction. - - - - Describes the operand type of Microsoft intermediate language (MSIL) instruction. - - - The operand is a 32-bit integer branch target. - - - - The operand is a 32-bit metadata token. - - - - The operand is a 32-bit integer. - - - - The operand is a 64-bit integer. - - - - The operand is a 32-bit metadata token. - - - - No operand. - - - - The operand is reserved and should not be used. - - - - The operand is a 64-bit IEEE floating point number. - - - - The operand is a 32-bit metadata signature token. - - - - The operand is a 32-bit metadata string token. - - - - The operand is the 32-bit integer argument to a switch instruction. - - - - The operand is a FieldRef, MethodRef, or TypeRef token. - - - - The operand is a 32-bit metadata token. - - - - The operand is 16-bit integer containing the ordinal of a local variable or an argument. - - - - The operand is an 8-bit integer branch target. - - - - The operand is an 8-bit integer. - - - - The operand is a 32-bit IEEE floating point number. - - - - The operand is an 8-bit integer containing the ordinal of a local variable or an argumenta. - - - - Specifies one of two factors that determine the memory alignment of fields when a type is marshaled. - - - The packing size is 1 byte. - - - - The packing size is 128 bytes. - - - - The packing size is 16 bytes. - - - - The packing size is 2 bytes. - - - - The packing size is 32 bytes. - - - - The packing size is 4 bytes. - - - - The packing size is 64 bytes. - - - - The packing size is 8 bytes. - - - - The packing size is not specified. - - - - Describes how values are pushed onto a stack or popped off a stack. - - - No values are popped off the stack. - - - - Pops one value off the stack. - - - - Pops 1 value off the stack for the first operand, and 1 value of the stack for the second operand. - - - - Pops a 32-bit integer off the stack. - - - - Pops a 32-bit integer off the stack for the first operand, and a value off the stack for the second operand. - - - - Pops a 32-bit integer off the stack for the first operand, and a 32-bit integer off the stack for the second operand. - - - - Pops a 32-bit integer off the stack for the first operand, a 32-bit integer off the stack for the second operand, and a 32-bit integer off the stack for the third operand. - - - - Pops a 32-bit integer off the stack for the first operand, and a 64-bit integer off the stack for the second operand. - - - - Pops a 32-bit integer off the stack for the first operand, and a 32-bit floating point number off the stack for the second operand. - - - - Pops a 32-bit integer off the stack for the first operand, and a 64-bit floating point number off the stack for the second operand. - - - - Pops a reference off the stack. - - - - Pops a reference off the stack for the first operand, and a value off the stack for the second operand. - - - - Pops a reference off the stack for the first operand, and a 32-bit integer off the stack for the second operand. - - - - Pops a reference off the stack for the first operand, a value off the stack for the second operand, and a 32-bit integer off the stack for the third operand. - - - - Pops a reference off the stack for the first operand, a value off the stack for the second operand, and a value off the stack for the third operand. - - - - Pops a reference off the stack for the first operand, a value off the stack for the second operand, and a 64-bit integer off the stack for the third operand. - - - - Pops a reference off the stack for the first operand, a value off the stack for the second operand, and a 32-bit integer off the stack for the third operand. - - - - Pops a reference off the stack for the first operand, a value off the stack for the second operand, and a 64-bit floating point number off the stack for the third operand. - - - - Pops a reference off the stack for the first operand, a value off the stack for the second operand, and a reference off the stack for the third operand. - - - - No values are pushed onto the stack. - - - - Pushes one value onto the stack. - - - - Pushes 1 value onto the stack for the first operand, and 1 value onto the stack for the second operand. - - - - Pushes a 32-bit integer onto the stack. - - - - Pushes a 64-bit integer onto the stack. - - - - Pushes a 32-bit floating point number onto the stack. - - - - Pushes a 64-bit floating point number onto the stack. - - - - Pushes a reference onto the stack. - - - - Pops a variable off the stack. - - - - Pushes a variable onto the stack. - - - - Specifies the attributes of an event. - - - Specifies that the event has no attributes. - - - - Specifies a reserved flag for common language runtime use only. - - - - Specifies that the common language runtime should check name encoding. - - - - Specifies that the event is special in a way described by the name. - - - - Discovers the attributes of an event and provides access to event metadata. - - - Initializes a new instance of the EventInfo class. - - - Adds an event handler to an event source. - The event source. - Encapsulates a method or methods to be invoked when the event is raised by the target. - The event does not have a public add accessor. - The handler that was passed in cannot be used. - - In the [.NET for Windows Store apps](http://go.microsoft.com/fwlink/?LinkID=247912) or the [Portable Class Library](~/docs/standard/cross-platform/cross-platform-development-with-the-portable-class-library.md), catch the base class exception, , instead. - - The caller does not have access permission to the member. - - In the [.NET for Windows Store apps](http://go.microsoft.com/fwlink/?LinkID=247912) or the [Portable Class Library](~/docs/standard/cross-platform/cross-platform-development-with-the-portable-class-library.md), catch instead. - - The target parameter is null and the event is not static. -or- The is not declared on the target. - - - Gets the object for the method of the event, including non-public methods. - The object for the method. - - - Gets the attributes for this event. - The read-only attributes for this event. - - - Returns a value that indicates whether this instance is equal to a specified object. - An object to compare with this instance, or null. - true if obj equals the type and value of this instance; otherwise, false. - - - Gets the Type object of the underlying event-handler delegate associated with this event. - A read-only Type object representing the delegate event handler. - The caller does not have the required permission. - - - Returns the method used to add an event handler delegate to the event source. - A object representing the method used to add an event handler delegate to the event source. - - - When overridden in a derived class, retrieves the MethodInfo object for the method of the event, specifying whether to return non-public methods. - true if non-public methods can be returned; otherwise, false. - A object representing the method used to add an event handler delegate to the event source. - nonPublic is true, the method used to add an event handler delegate is non-public, and the caller does not have permission to reflect on non-public methods. - - - Returns the hash code for this instance. - A 32-bit signed integer hash code. - - - Returns the public methods that have been associated with an event in metadata using the .other directive. - An array of objects representing the public methods that have been associated with the event in metadata by using the .other directive. If there are no such public methods, an empty array is returned. - - - Returns the methods that have been associated with the event in metadata using the .other directive, specifying whether to include non-public methods. - true to include non-public methods; otherwise, false. - An array of objects representing methods that have been associated with an event in metadata by using the .other directive. If there are no methods matching the specification, an empty array is returned. - This method is not implemented. - - - Returns the method that is called when the event is raised. - The method that is called when the event is raised. - - - When overridden in a derived class, returns the method that is called when the event is raised, specifying whether to return non-public methods. - true if non-public methods can be returned; otherwise, false. - A MethodInfo object that was called when the event was raised. - nonPublic is true, the method used to add an event handler delegate is non-public, and the caller does not have permission to reflect on non-public methods. - - - When overridden in a derived class, retrieves the MethodInfo object for removing a method of the event, specifying whether to return non-public methods. - true if non-public methods can be returned; otherwise, false. - A object representing the method used to remove an event handler delegate from the event source. - nonPublic is true, the method used to add an event handler delegate is non-public, and the caller does not have permission to reflect on non-public methods. - - - Returns the method used to remove an event handler delegate from the event source. - A object representing the method used to remove an event handler delegate from the event source. - - - Gets a value indicating whether the event is multicast. - true if the delegate is an instance of a multicast delegate; otherwise, false. - The caller does not have the required permission. - - - Gets a value indicating whether the EventInfo has a name with a special meaning. - true if this event has a special name; otherwise, false. - - - Gets a value indicating that this member is an event. - A value indicating that this member is an event. - - - Indicates whether two objects are equal. - The first object to compare. - The second object to compare. - true if left is equal to right; otherwise, false. - - - Indicates whether two objects are not equal. - The first object to compare. - The second object to compare. - true if left is not equal to right; otherwise, false. - - - Gets the method that is called when the event is raised, including non-public methods. - The method that is called when the event is raised. - - - Removes an event handler from an event source. - The event source. - The delegate to be disassociated from the events raised by target. - The event does not have a public remove accessor. - The handler that was passed in cannot be used. - - In the [.NET for Windows Store apps](http://go.microsoft.com/fwlink/?LinkID=247912) or the [Portable Class Library](~/docs/standard/cross-platform/cross-platform-development-with-the-portable-class-library.md), catch instead. - - The target parameter is null and the event is not static. -or- The is not declared on the target. - - In the [.NET for Windows Store apps](http://go.microsoft.com/fwlink/?LinkID=247912) or the [Portable Class Library](~/docs/standard/cross-platform/cross-platform-development-with-the-portable-class-library.md), catch the base class exception, , instead. - - The caller does not have access permission to the member. - - - Gets the MethodInfo object for removing a method of the event, including non-public methods. - The MethodInfo object for removing a method of the event. - - - Represents a clause in a structured exception-handling block. - - - Initializes a new instance of the class. - - - Gets the type of exception handled by this clause. - A object that represents that type of exception handled by this clause, or null if the property is or . - Invalid use of property for the object's current state. - - - Gets the offset within the method body, in bytes, of the user-supplied filter code. - The offset within the method body, in bytes, of the user-supplied filter code. The value of this property has no meaning if the property has any value other than . - Cannot get the offset because the exception handling clause is not a filter. - - - Gets a value indicating whether this exception-handling clause is a finally clause, a type-filtered clause, or a user-filtered clause. - An value that indicates what kind of action this clause performs. - - - Gets the length, in bytes, of the body of this exception-handling clause. - An integer that represents the length, in bytes, of the MSIL that forms the body of this exception-handling clause. - - - Gets the offset within the method body, in bytes, of this exception-handling clause. - An integer that represents the offset within the method body, in bytes, of this exception-handling clause. - - - A string representation of the exception-handling clause. - A string that lists appropriate property values for the filter clause type. - - - The total length, in bytes, of the try block that includes this exception-handling clause. - The total length, in bytes, of the try block that includes this exception-handling clause. - - - The offset within the method, in bytes, of the try block that includes this exception-handling clause. - An integer that represents the offset within the method, in bytes, of the try block that includes this exception-handling clause. - - - Identifies kinds of exception-handling clauses. - - - The clause accepts all exceptions that derive from a specified type. - - - - The clause is executed if an exception occurs, but not on completion of normal control flow. - - - - The clause contains user-specified instructions that determine whether the exception should be ignored (that is, whether normal execution should resume), be handled by the associated handler, or be passed on to the next clause. - - - - The clause is executed whenever the try block exits, whether through normal control flow or because of an unhandled exception. - - - - Specifies flags that describe the attributes of a field. - - - Specifies that the field is accessible throughout the assembly. - - - - Specifies that the field is accessible only by subtypes in this assembly. - - - - Specifies that the field is accessible only by type and subtypes. - - - - Specifies that the field is accessible by subtypes anywhere, as well as throughout this assembly. - - - - Specifies the access level of a given field. - - - - Specifies that the field has a default value. - - - - Specifies that the field has marshaling information. - - - - Specifies that the field has a relative virtual address (RVA). The RVA is the location of the method body in the current image, as an address relative to the start of the image file in which it is located. - - - - Specifies that the field is initialized only, and can be set only in the body of a constructor. - - - - Specifies that the field's value is a compile-time (static or early bound) constant. Any attempt to set it throws a . - - - - Specifies that the field does not have to be serialized when the type is remoted. - - - - Reserved for future use. - - - - Specifies that the field is accessible only by the parent type. - - - - Specifies that the field cannot be referenced. - - - - Specifies that the field is accessible by any member for whom this scope is visible. - - - - Reserved. - - - - Specifies that the common language runtime (metadata internal APIs) should check the name encoding. - - - - Specifies a special method, with the name describing how the method is special. - - - - Specifies that the field represents the defined type, or else it is per-instance. - - - - Discovers the attributes of a field and provides access to field metadata. - - - Initializes a new instance of the FieldInfo class. - - - Gets the attributes associated with this field. - The FieldAttributes for this field. - - - Returns a value that indicates whether this instance is equal to a specified object. - An object to compare with this instance, or null. - true if obj equals the type and value of this instance; otherwise, false. - - - Gets a RuntimeFieldHandle, which is a handle to the internal metadata representation of a field. - A handle to the internal metadata representation of a field. - - - Gets the type of this field object. - The type of this field object. - - - Gets a for the field represented by the specified handle. - A structure that contains the handle to the internal metadata representation of a field. - A object representing the field specified by handle. - handle is invalid. - - - Gets a for the field represented by the specified handle, for the specified generic type. - A structure that contains the handle to the internal metadata representation of a field. - A structure that contains the handle to the generic type that defines the field. - A object representing the field specified by handle, in the generic type specified by declaringType. - handle is invalid. -or- declaringType is not compatible with handle. For example, declaringType is the runtime type handle of the generic type definition, and handle comes from a constructed type. - - - Returns the hash code for this instance. - A 32-bit signed integer hash code. - - - Gets an array of types that identify the optional custom modifiers of the field. - An array of objects that identify the optional custom modifiers of the current field, such as . - - - Returns a literal value associated with the field by a compiler. - An that contains the literal value associated with the field. If the literal value is a class type with an element value of zero, the return value is null. - The Constant table in unmanaged metadata does not contain a constant value for the current field. - The type of the value is not one of the types permitted by the Common Language Specification (CLS). See the ECMA Partition II specification Metadata Logical Format: Other Structures, Element Types used in Signatures. - The constant value for the field is not set. - - - Gets an array of types that identify the required custom modifiers of the property. - An array of objects that identify the required custom modifiers of the current property, such as or . - - - When overridden in a derived class, returns the value of a field supported by a given object. - The object whose field value will be returned. - An object containing the value of the field reflected by this instance. - - In the [.NET for Windows Store apps](http://go.microsoft.com/fwlink/?LinkID=247912) or the Portable Class Library, catch instead. - - The field is non-static and obj is null. - A field is marked literal, but the field does not have one of the accepted literal types. - - In the [.NET for Windows Store apps](http://go.microsoft.com/fwlink/?LinkID=247912) or the Portable Class Library, catch the base class exception, , instead. - - The caller does not have permission to access this field. - The method is neither declared nor inherited by the class of obj. - - - Returns the value of a field supported by a given object. - A structure that encapsulates a managed pointer to a location and a runtime representation of the type that might be stored at that location. - An Object containing a field value. - The caller requires the Common Language Specification (CLS) alternative, but called this method instead. - - - Gets a value indicating whether the potential visibility of this field is described by ; that is, the field is visible at most to other types in the same assembly, and is not visible to derived types outside the assembly. - true if the visibility of this field is exactly described by ; otherwise, false. - - - Gets a value indicating whether the visibility of this field is described by ; that is, the field is visible only within its class and derived classes. - true if access to this field is exactly described by ; otherwise, false. - - - Gets a value indicating whether the visibility of this field is described by ; that is, the field can be accessed from derived classes, but only if they are in the same assembly. - true if access to this field is exactly described by ; otherwise, false. - - - Gets a value indicating whether the potential visibility of this field is described by ; that is, the field can be accessed by derived classes wherever they are, and by classes in the same assembly. - true if access to this field is exactly described by ; otherwise, false. - - - Gets a value indicating whether the field can only be set in the body of the constructor. - true if the field has the InitOnly attribute set; otherwise, false. - - - Gets a value indicating whether the value is written at compile time and cannot be changed. - true if the field has the Literal attribute set; otherwise, false. - - - Gets a value indicating whether this field has the NotSerialized attribute. - true if the field has the NotSerialized attribute set; otherwise, false. - - - Gets a value indicating whether the corresponding PinvokeImpl attribute is set in . - true if the PinvokeImpl attribute is set in ; otherwise, false. - - - Gets a value indicating whether the field is private. - true if the field is private; otherwise; false. - - - Gets a value indicating whether the field is public. - true if this field is public; otherwise, false. - - - Gets a value that indicates whether the current field is security-critical or security-safe-critical at the current trust level. - true if the current field is security-critical or security-safe-critical at the current trust level; false if it is transparent. - - - Gets a value that indicates whether the current field is security-safe-critical at the current trust level. - true if the current field is security-safe-critical at the current trust level; false if it is security-critical or transparent. - - - Gets a value that indicates whether the current field is transparent at the current trust level. - true if the field is security-transparent at the current trust level; otherwise, false. - - - Gets a value indicating whether the corresponding SpecialName attribute is set in the enumerator. - true if the SpecialName attribute is set in ; otherwise, false. - - - Gets a value indicating whether the field is static. - true if this field is static; otherwise, false. - - - Gets a value indicating that this member is a field. - A value indicating that this member is a field. - - - Indicates whether two objects are equal. - The first object to compare. - The second object to compare. - true if left is equal to right; otherwise, false. - - - Indicates whether two objects are not equal. - The first object to compare. - The second object to compare. - true if left is not equal to right; otherwise, false. - - - Sets the value of the field supported by the given object. - The object whose field value will be set. - The value to assign to the field. - - In the [.NET for Windows Store apps](http://go.microsoft.com/fwlink/?LinkID=247912) or the [Portable Class Library](~/docs/standard/cross-platform/cross-platform-development-with-the-portable-class-library.md), catch the base class exception, , instead. - - The caller does not have permission to access this field. - - In the [.NET for Windows Store apps](http://go.microsoft.com/fwlink/?LinkID=247912) or the [Portable Class Library](~/docs/standard/cross-platform/cross-platform-development-with-the-portable-class-library.md), catch instead. - - The obj parameter is null and the field is an instance field. - The field does not exist on the object. -or- The value parameter cannot be converted and stored in the field. - - - When overridden in a derived class, sets the value of the field supported by the given object. - The object whose field value will be set. - The value to assign to the field. - A field of Binder that specifies the type of binding that is desired (for example, Binder.CreateInstance or Binder.ExactBinding). - A set of properties that enables the binding, coercion of argument types, and invocation of members through reflection. If binder is null, then Binder.DefaultBinding is used. - The software preferences of a particular culture. - The caller does not have permission to access this field. - The obj parameter is null and the field is an instance field. - The field does not exist on the object. -or- The value parameter cannot be converted and stored in the field. - - - Sets the value of the field supported by the given object. - A structure that encapsulates a managed pointer to a location and a runtime representation of the type that can be stored at that location. - The value to assign to the field. - The caller requires the Common Language Specification (CLS) alternative, but called this method instead. - - - Describes the constraints on a generic type parameter of a generic type or method. - - - The generic type parameter is contravariant. A contravariant type parameter can appear as a parameter type in method signatures. - - - - The generic type parameter is covariant. A covariant type parameter can appear as the result type of a method, the type of a read-only field, a declared base type, or an implemented interface. - - - - A type can be substituted for the generic type parameter only if it has a parameterless constructor. - - - - There are no special flags. - - - - A type can be substituted for the generic type parameter only if it is a value type and is not nullable. - - - - A type can be substituted for the generic type parameter only if it is a reference type. - - - - Selects the combination of all special constraint flags. This value is the result of using logical OR to combine the following flags: , , and . - - - - Selects the combination of all variance flags. This value is the result of using logical OR to combine the following flags: and . - - - - Provides custom attributes for reflection objects that support them. - - - Returns an array of all of the custom attributes defined on this member, excluding named attributes, or an empty array if there are no custom attributes. - When true, look up the hierarchy chain for the inherited custom attribute. - An array of Objects representing custom attributes, or an empty array. - The custom attribute type cannot be loaded. - There is more than one attribute of type attributeType defined on this member. - - - Returns an array of custom attributes defined on this member, identified by type, or an empty array if there are no custom attributes of that type. - The type of the custom attributes. - When true, look up the hierarchy chain for the inherited custom attribute. - An array of Objects representing custom attributes, or an empty array. - The custom attribute type cannot be loaded. - attributeType is null. - - - Indicates whether one or more instance of attributeType is defined on this member. - The type of the custom attributes. - When true, look up the hierarchy chain for the inherited custom attribute. - true if the attributeType is defined on this member; false otherwise. - - - Identifies the platform targeted by an executable. - - - Targets a 64-bit AMD processor. - - - - Targets an ARM processor. - - - - Targets a 32-bit Intel processor. - - - - Targets a 64-bit Intel processor. - - - - Retrieves the mapping of an interface into the actual methods on a class that implements that interface. - - - Shows the methods that are defined on the interface. - - - - Shows the type that represents the interface. - - - - Shows the methods that implement the interface. - - - - Represents the type that was used to create the interface mapping. - - - - Contains methods for converting objects. - - - Returns the representation of the specified type. - The type to convert. - The converted object. - - - The exception that is thrown in when the filter criteria is not valid for the type of filter you are using. - - - Initializes a new instance of the class with the default properties. - - - Initializes a new instance of the class with the given HRESULT and message string. - The message text for the exception. - - - Initializes a new instance of the class with the specified serialization and context information. - A SerializationInfo object that contains the information required to serialize this instance. - A StreamingContext object that contains the source and destination of the serialized stream associated with this instance. - - - Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. - The error message that explains the reason for the exception. - The exception that is the cause of the current exception. If the inner parameter is not null, the current exception is raised in a catch block that handles the inner exception. - - - Interoperates with the IDispatch interface. - - - Returns the object that corresponds to the specified field and binding flag. - The name of the field to find. - The binding attributes used to control the search. - A object containing the field information for the named object that meets the search constraints specified in bindingAttr. - The object implements multiple fields with the same name. - - - Returns an array of objects that correspond to all fields of the current class. - The binding attributes used to control the search. - An array of objects containing all the field information for this reflection object that meets the search constraints specified in bindingAttr. - - - Retrieves an array of objects corresponding to all public members or to all members that match a specified name. - The name of the member to find. - The binding attributes used to control the search. - An array of objects matching the name parameter. - - - Retrieves an array of objects that correspond either to all public members or to all members of the current class. - The binding attributes used to control the search. - An array of objects containing all the member information for this reflection object. - - - Retrieves a object that corresponds to a specified method under specified search constraints. - The name of the member to find. - The binding attributes used to control the search. - A object containing the method information, with the match being based on the method name and search constraints specified in bindingAttr. - The object implements multiple methods with the same name. - - - Retrieves a object corresponding to a specified method, using a array to choose from among overloaded methods. - The name of the member to find. - The binding attributes used to control the search. - An object that implements , containing properties related to this method. - An array used to choose among overloaded methods. - An array of parameter modifiers used to make binding work with parameter signatures in which the types have been modified. - The requested method that matches all the specified parameters. - The object implements multiple methods with the same name. - - - Retrieves an array of objects with all public methods or all methods of the current class. - The binding attributes used to control the search. - An array of objects containing all the methods defined for this reflection object that meet the search constraints specified in bindingAttr. - - - Retrieves an array of objects corresponding to all public properties or to all properties of the current class. - The binding attribute used to control the search. - An array of objects for all the properties defined on the reflection object. - - - Retrieves a object corresponding to a specified property under specified search constraints. - The name of the property to find. - The binding attributes used to control the search. - A object for the located property that meets the search constraints specified in bindingAttr, or null if the property was not located. - The object implements multiple fields with the same name. - - - Retrieves a object that corresponds to a specified property with specified search constraints. - The name of the member to find. - The binding attribute used to control the search. - An object that implements , containing properties related to this method. - The type of the property. - An array used to choose among overloaded methods with the same name. - An array used to choose the parameter modifiers. - A object for the located property, if a property with the specified name was located in this reflection object, or null if the property was not located. - - - Invokes a specified member. - The name of the member to find. - One of the invocation attributes. The invokeAttr parameter may be a constructor, method, property, or field. A suitable invocation attribute must be specified. Invoke the default member of a class by passing the empty string ("") as the name of the member. - One of the bit flags. Implements , containing properties related to this method. - The object on which to invoke the specified member. This parameter is ignored for static members. - An array of objects that contains the number, order, and type of the parameters of the member to be invoked. This is an empty array if there are no parameters. - An array of objects. This array has the same length as the args parameter, representing the invoked member's argument attributes in the metadata. A parameter can have the following attributes: pdIn, pdOut, pdRetval, pdOptional, and pdHasDefault. These represent [In], [Out], [retval], [optional], and a default parameter, respectively. These attributes are used by various interoperability services. - An instance of used to govern the coercion of types. For example, culture converts a String that represents 1000 to a Double value, since 1000 is represented differently by different cultures. If this parameter is null, the for the current thread is used. - A String array of parameters. - The specified member. - More than one argument is specified for a field set. - The field or property cannot be found. - The method cannot be found. - A private member is invoked without the necessary . - - - Gets the underlying type that represents the object. - The underlying type that represents the object. - - - Represents a type that you can reflect over. - - - Retrieves an object that represents this type. - An object that represents this type. - - - Discovers the attributes of a local variable and provides access to local variable metadata. - - - Initializes a new instance of the class. - - - Gets a value that indicates whether the object referred to by the local variable is pinned in memory. - true if the object referred to by the variable is pinned in memory; otherwise, false. - - - Gets the index of the local variable within the method body. - An integer value that represents the order of declaration of the local variable within the method body. - - - Gets the type of the local variable. - The type of the local variable. - - - Returns a user-readable string that describes the local variable. - A string that displays information about the local variable, including the type name, index, and pinned status. - - - Provides access to manifest resources, which are XML files that describe application dependencies. - - - Initializes a new instance of the class for a resource that is contained by the specified assembly and file, and that has the specified location. - The assembly that contains the manifest resource. - The name of the file that contains the manifest resource, if the file is not the same as the manifest file. - A bitwise combination of enumeration values that provides information about the location of the manifest resource. - - - Gets the name of the file that contains the manifest resource, if it is not the same as the manifest file. - The manifest resource's file name. - - - Gets the containing assembly for the manifest resource. - The manifest resource's containing assembly. - - - Gets the manifest resource's location. - A bitwise combination of flags that indicates the location of the manifest resource. - - - Represents a delegate that is used to filter a list of members represented in an array of objects. - The object to which the filter is applied. - An arbitrary object used to filter the list. - - - - Obtains information about the attributes of a member and provides access to member metadata. - - - Initializes a new instance of the class. - - - Gets a collection that contains this member's custom attributes. - A collection that contains this member's custom attributes. - - - Gets the class that declares this member. - The Type object for the class that declares this member. - - - Returns a value that indicates whether this instance is equal to a specified object. - An object to compare with this instance, or null. - true if obj equals the type and value of this instance; otherwise, false. - - - When overridden in a derived class, returns an array of all custom attributes applied to this member. - true to search this member's inheritance chain to find the attributes; otherwise, false. This parameter is ignored for properties and events. - An array that contains all the custom attributes applied to this member, or an array with zero elements if no attributes are defined. - This member belongs to a type that is loaded into the reflection-only context. See How to: Load Assemblies into the Reflection-Only Context. - A custom attribute type could not be loaded. - - - When overridden in a derived class, returns an array of custom attributes applied to this member and identified by . - The type of attribute to search for. Only attributes that are assignable to this type are returned. - true to search this member's inheritance chain to find the attributes; otherwise, false. This parameter is ignored for properties and events. - An array of custom attributes applied to this member, or an array with zero elements if no attributes assignable to attributeType have been applied. - A custom attribute type cannot be loaded. - If attributeType is null. - This member belongs to a type that is loaded into the reflection-only context. See How to: Load Assemblies into the Reflection-Only Context. - - - Returns a list of objects representing data about the attributes that have been applied to the target member. - A generic list of objects representing data about the attributes that have been applied to the target member. - - - Returns the hash code for this instance. - A 32-bit signed integer hash code. - - - When overridden in a derived class, indicates whether one or more attributes of the specified type or of its derived types is applied to this member. - The type of custom attribute to search for. The search includes derived types. - true to search this member's inheritance chain to find the attributes; otherwise, false. This parameter is ignored for properties and events. - true if one or more instances of attributeType or any of its derived types is applied to this member; otherwise, false. - - - When overridden in a derived class, gets a value indicating the type of the member — method, constructor, event, and so on. - A value indicating the type of member. - - - Gets a value that identifies a metadata element. - A value which, in combination with , uniquely identifies a metadata element. - The current represents an array method, such as Address, on an array type whose element type is a dynamic type that has not been completed. To get a metadata token in this case, pass the object to the method; or use the method to get the token directly, instead of using the method to get a first. - - - Gets the module in which the type that declares the member represented by the current is defined. - The in which the type that declares the member represented by the current is defined. - This method is not implemented. - - - Gets the name of the current member. - A containing the name of this member. - - - Indicates whether two objects are equal. - The to compare to right. - The to compare to left. - true if left is equal to right; otherwise false. - - - Indicates whether two objects are not equal. - The to compare to right. - The to compare to left. - true if left is not equal to right; otherwise false. - - - Gets the class object that was used to obtain this instance of MemberInfo. - The Type object through which this MemberInfo object was obtained. - - - Marks each type of member that is defined as a derived class of . - - - Specifies all member types. - - - - Specifies that the member is a constructor - - - - Specifies that the member is a custom member type. - - - - Specifies that the member is an event. - - - - Specifies that the member is a field. - - - - Specifies that the member is a method. - - - - Specifies that the member is a nested type. - - - - Specifies that the member is a property. - - - - Specifies that the member is a type. - - - - Represents an exception whose state is captured at a certain point in code. - - - Creates an object that represents the specified exception at the current point in code. - The exception whose state is captured, and which is represented by the returned object. - An object that represents the specified exception at the current point in code. - source is null. - - - Gets the exception that is represented by the current instance. - The exception that is represented by the current instance. - - - Throws the exception that is represented by the current object, after restoring the state that was saved when the exception was captured. - - - Provides data for the notification event that is raised when a managed exception first occurs, before the common language runtime begins searching for event handlers. - - - Initializes a new instance of the class with a specified exception. - The exception that was just thrown by managed code, and that will be examined by the event. - - - The managed exception object that corresponds to the exception thrown in managed code. - The newly thrown exception. - - - Enables managed code to handle exceptions that indicate a corrupted process state. - - - Initializes a new instance of the class. - - - [Supported in the .NET Framework 4.5.1 and later versions] Indicates whether the next blocking garbage collection compacts the large object heap (LOH). - - - The large object heap (LOH) will be compacted during the next blocking generation 2 garbage collection. - - - - The large object heap (LOH) is not compacted. - - - - Adjusts the time that the garbage collector intrudes in your application. - - - Disables garbage collection concurrency and reclaims objects in a batch call. This is the most intrusive mode. - - - - Enables garbage collection concurrency and reclaims objects while the application is running. This is the default mode for garbage collection on a workstation and is less intrusive than . It balances responsiveness with throughput. - - - - Enables garbage collection that is more conservative in reclaiming objects. Full collections occur only if the system is under memory pressure, whereas generation 0 and generation 1 collections might occur more frequently - - - - Indicates that garbage collection is suspended while the app is executing a critical path. is a read-only value; that is, you cannot assign the value to the property. You specify the no GC region latency mode by calling the method and terminate it by calling the method. - - - - Enables garbage collection that tries to minimize latency over an extended period. The collector tries to perform only generation 0, generation 1, and concurrent generation 2 collections. Full blocking collections may still occur if the system is under memory pressure. - - - - Specifies the garbage collection settings for the current process. - - - Gets a value that indicates whether server garbage collection is enabled. - true if server garbage collection is enabled; otherwise, false. - - - [Supported in the .NET Framework 4.5.1 and later versions] Gets or sets a value that indicates whether a full blocking garbage collection compacts the large object heap (LOH). - One of the enumeration values that indicates whether a full blocking garbage collection compacts the LOH. - - - Gets or sets the current latency mode for garbage collection. - One of the enumeration values that specifies the latency mode. - The property is being set to an invalid value. -or- The property cannot be set to . - - - Allows an unmanaged method to call a managed method. - - - Initializes a new instance of the class. - - - - - - - - - - - - - - - - - - Encapsulates an array and an offset within the specified array. - - - Initializes a new instance of the structure. - A managed array. - The offset in bytes, of the element to be passed through platform invoke. - The array is larger than 2 gigabytes (GB). - - - Indicates whether the specified object matches the current object. - Object to compare with this instance. - true if the object matches this ; otherwise, false. - - - Indicates whether the specified object matches the current instance. - An object to compare with this instance. - true if the specified object matches the current instance; otherwise, false. - - - Returns the managed array referenced by this . - The managed array this instance references. - - - Returns a hash code for this value type. - The hash code for this instance. - - - Returns the offset provided when this was constructed. - The offset for this instance. - - - Determines whether two specified objects have the same value. - An object to compare with the b parameter. - An object to compare with the a parameter. - true if the value of a is the same as the value of b; otherwise, false. - - - Determines whether two specified objects no not have the same value. - An object to compare with the b parameter. - An object to compare with the a parameter. - true if the value of a is not the same as the value of b; otherwise, false. - - - Controls whether Unicode characters are converted to the closest matching ANSI characters. - - - Initializes a new instance of the class set to the value of the property. - true to indicate that best-fit mapping is enabled; otherwise, false. The default is true. - - - Gets the best-fit mapping behavior when converting Unicode characters to ANSI characters. - true if best-fit mapping is enabled; otherwise, false. The default is true. - - - Enables or disables the throwing of an exception on an unmappable Unicode character that is converted to an ANSI '?' character. - - - - Marshals data of type VT_BSTR from managed to unmanaged code. This class cannot be inherited. - - - Initializes a new instance of the class with the specified object. - The object to wrap and marshal as VT_BSTR. - - - Initializes a new instance of the class with the specified object. - The object to wrap and marshal as VT_BSTR. - - - Gets the wrapped object to marshal as type VT_BSTR. - The object that is wrapped by . - - - Specifies the calling convention required to call methods implemented in unmanaged code. - - - The caller cleans the stack. This enables calling functions with varargs, which makes it appropriate to use for methods that accept a variable number of parameters, such as Printf. - - - - This calling convention is not supported. - - - - The callee cleans the stack. This is the default convention for calling unmanaged functions with platform invoke. - - - - The first parameter is the this pointer and is stored in register ECX. Other parameters are pushed on the stack. This calling convention is used to call methods on classes exported from an unmanaged DLL. - - - - This member is not actually a calling convention, but instead uses the default platform calling convention. For example, on Windows the default is and on Windows CE.NET it is . - - - - Dictates which character set marshaled strings should use. - - - Marshal strings as multiple-byte character strings. - - - - Automatically marshal strings appropriately for the target operating system. The default is on Windows NT, Windows 2000, Windows XP, and the Windows Server 2003 family; the default is on Windows 98 and Windows Me. Although the common language runtime default is , languages may override this default. For example, by default C# marks all methods and types as . - - - - This value is obsolete and has the same behavior as . - - - - Marshal strings as Unicode 2-byte characters. - - - - Indicates the type of class interface to be generated for a class exposed to COM, if an interface is generated at all. - - - Initializes a new instance of the class with the specified enumeration value. - Describes the type of interface that is generated for a class. - - - Initializes a new instance of the class with the specified enumeration member. - One of the values that describes the type of interface that is generated for a class. - - - Gets the value that describes which type of interface should be generated for the class. - The value that describes which type of interface should be generated for the class. - - - Identifies the type of class interface that is generated for a class. - - - Indicates that the class only supports late binding for COM clients. A dispinterface for the class is automatically exposed to COM clients on request. The type library produced by Tlbexp.exe (Type Library Exporter) does not contain type information for the dispinterface in order to prevent clients from caching the DISPIDs of the interface. The dispinterface does not exhibit the versioning problems described in because clients can only late-bind to the interface. - - - - Indicates that a dual class interface is automatically generated for the class and exposed to COM. Type information is produced for the class interface and published in the type library. Using AutoDual is strongly discouraged because of the versioning limitations described in . - - - - Indicates that no class interface is generated for the class. If no interfaces are implemented explicitly, the class can only provide late-bound access through the IDispatch interface. This is the recommended setting for . Using ClassInterfaceType.None is the only way to expose functionality through interfaces implemented explicitly by the class. - - - - Specifies the class identifier of a coclass imported from a type library. - - - Initializes new instance of the with the class identifier of the original coclass. - A that contains the class identifier of the original coclass. - - - Gets the class identifier of the original coclass. - A containing the class identifier of the original coclass. - - - Indicates the COM alias for a parameter or field type. - - - Initializes a new instance of the class with the alias for the attributed field or parameter. - The alias for the field or parameter as found in the type library when it was imported. - - - Gets the alias for the field or parameter as found in the type library when it was imported. - The alias for the field or parameter as found in the type library when it was imported. - - - Permits late-bound registration of an event handler. - - - Initializes a new instance of the class by using the specified type and a name of the event on the type. - The type of object. - The name of an event on type. - - - Attaches an event handler to a COM object. - The target object that the event delegate should bind to. - The event delegate. - - - Gets the attributes for this event. - The read-only attributes for this event. - - - Gets the class that declares this member. - The object for the class that declares this member. - - - Gets the method that was used to add an event handler delegate to the event source. - true to return non-public methods; otherwise, false. - The method that was used to add an event handler delegate to the event source. - nonPublic is true and the method used to add an event handler delegate is non-public, but the caller does not have permission to reflect on non-public methods. - - - When overridden in a derived class, gets an array that contains all the custom attributes that are applied to this member. - true to search this member's inheritance chain to find the attributes; otherwise, false. - An array that contains all the custom attributes, or an array that has no elements if no attributes were defined. - This member belongs to a type that is loaded into the reflection-only context. See How to: Load Assemblies into the Reflection-Only Context. - A custom attribute type cannot be loaded. - - - When overridden in a derived class, gets an array that contains all the custom attributes of the specified type that are applied to this member. - The attribute type to search for. Only attributes that are assignable to this type can be returned. - true to search this member's inheritance chain to find the attributes; otherwise, false. - An array that contains all the custom attributes of the specified type, or an array that has no elements if no attributes were defined. - attributeType is null. - This member belongs to a type that is loaded into the reflection-only context. See How to: Load Assemblies into the Reflection-Only Context - A custom attribute type cannot be loaded. - - - When overridden in a derived class, returns the method that was called when the event was raised. - true to return non-public methods; otherwise, false. - The object that was called when the event was raised. - nonPublic is true and the method used to add an event handler delegate is non-public, but the caller does not have permission to reflect on non-public methods. - - - When overridden in a derived class, retrieves the object for removing a method of the event. - true to return non-public methods; otherwise, false. - The method that was used to remove an event handler delegate from the event source. - nonPublic is true and the method used to add an event handler delegate is non-public, but the caller does not have permission to reflect on non-public methods. - - - Indicates whether one or more instances of the specified attribute are applied to this member. - The attribute type to search for. - true to search this member's inheritance chain to find the attributes; otherwise, false. - true if the specified attribute has been applied to this member; otherwise, false. - - - Gets the name of the current member. - The name of this member. - - - Gets the class object that was used to initialize this instance. - The object that was used to initialize the current object. - - - Detaches an event handler from a COM object. - The target object that the event delegate is bound to. - The event delegate. - The event does not have a public remove accessor. - The handler that was passed in cannot be used. - - In the [.NET for Windows Store apps](http://go.microsoft.com/fwlink/?LinkID=247912) or the [Portable Class Library](~/docs/standard/cross-platform/cross-platform-development-with-the-portable-class-library.md), catch instead. - - The target parameter is null and the event is not static. -or- The is not declared on the target. - - In the [.NET for Windows Store apps](http://go.microsoft.com/fwlink/?LinkID=247912) or the [Portable Class Library](~/docs/standard/cross-platform/cross-platform-development-with-the-portable-class-library.md), catch the base class exception, , instead. - - The caller does not have access permission to the member. - - - Indicates to a COM client that all classes in the current version of an assembly are compatible with classes in an earlier version of the assembly. - - - Initializes a new instance of the class with the major version, minor version, build, and revision numbers of the assembly. - The major version number of the assembly. - The minor version number of the assembly. - The build number of the assembly. - The revision number of the assembly. - - - Gets the build number of the assembly. - The build number of the assembly. - - - Gets the major version number of the assembly. - The major version number of the assembly. - - - Gets the minor version number of the assembly. - The minor version number of the assembly. - - - Gets the revision number of the assembly. - The revision number of the assembly. - - - Indicates that information was lost about a class or interface when it was imported from a type library to an assembly. - - - Initializes a new instance of the ComConversionLossAttribute class. - - - Specifies a default interface to expose to COM. This class cannot be inherited. - - - Initializes a new instance of the class with the specified object as the default interface exposed to COM. - A value indicating the default interface to expose to COM. - - - Gets the object that specifies the default interface to expose to COM. - The object that specifies the default interface to expose to COM. - - - Identifies the source interface and the class that implements the methods of the event interface that is generated when a coclass is imported from a COM type library. - - - Initializes a new instance of the class with the source interface and event provider class. - A that contains the original source interface from the type library. COM uses this interface to call back to the managed class. - A that contains the class that implements the methods of the event interface. - - - Gets the class that implements the methods of the event interface. - A that contains the class that implements the methods of the event interface. - - - Gets the original source interface from the type library. - A containing the source interface. - - - Provides methods that enable .NET Framework delegates that handle events to be added and removed from COM objects. - - - Adds a delegate to the invocation list of events originating from a COM object. - The COM object that triggers the events the caller would like to respond to. - The identifier of the source interface used by the COM object to trigger events. - The dispatch identifier of the method on the source interface. - The delegate to invoke when the COM event is fired. - - - Removes a delegate from the invocation list of events originating from a COM object. - The COM object the delegate is attached to. - The identifier of the source interface used by the COM object to trigger events. - The dispatch identifier of the method on the source interface. - The delegate to remove from the invocation list. - The delegate that was removed from the invocation list. - - - The exception that is thrown when an unrecognized HRESULT is returned from a COM method call. - - - Initializes a new instance of the class with default values. - - - Initializes a new instance of the class with a specified message. - The message that indicates the reason for the exception. - - - Initializes a new instance of the class from serialization data. - The object that holds the serialized object data. - The object that supplies the contextual information about the source or destination. - info is null. - - - Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. - The error message that explains the reason for the exception. - The exception that is the cause of the current exception. If the inner parameter is not null, the current exception is raised in a catch block that handles the inner exception. - - - Initializes a new instance of the class with a specified message and error code. - The message that indicates the reason the exception occurred. - The error code (HRESULT) value associated with this exception. - - - Converts the contents of the exception to a string. - A string containing the , , , and properties of the exception. - - - Indicates that the attributed type was previously defined in COM. - - - Initializes a new instance of the . - - - Identifies how to expose an interface to COM. - - - Indicates that the interface is exposed to COM as a dual interface, which enables both early and late binding. is the default value. - - - - Indicates that an interface is exposed to COM as a dispinterface, which enables late binding only. - - - - Indicates that an interface is exposed to COM as a Windows Runtime interface. - - - - Indicates that an interface is exposed to COM as an interface that is derived from IUnknown, which enables only early binding. - - - - Describes the type of a COM member. - - - The member is a normal method. - - - - The member gets properties. - - - - The member sets properties. - - - - Specifies data contract serializer settings. - - - Initializes a new instance of the class. - - - Gets or sets the component used to dynamically map xsi:type declarations to known contract types. - The component used to dynamically map xsi:type declarations to known contract types. - - - Gets or sets a value that specifies whether to ignore data supplied by an extension of the class when the class is being serialized or deserialized. - True to ignore data supplied by an extension of the class when the class is being serialized or deserialized; otherwise, false. - - - Gets or sets a collection of types that may be present in the object graph serialized using this instance of the DataContractSerializerSettings. - A collection of types that may be present in the object graph serialized using this instance of the DataContractSerializerSettings. - - - Gets or sets the maximum number of items in an object graph to serialize or deserialize. - The maximum number of items in an object graph to serialize or deserialize. - - - Gets or sets a value that specifies whether to use non-standard XML constructs to preserve object reference data. - True to use non-standard XML constructs to preserve object reference data; otherwise, false. - - - Gets or sets the root name of the selected object. - The root name of the selected object. - - - Gets or sets the root namespace for the specified object. - The root namespace for the specified object. - - - Gets or sets a value that specifies whether to serialize read only types. - True to serialize read only types; otherwise, false. - - - When applied to the member of a type, specifies that the member is part of a data contract and is serializable by the . - - - Initializes a new instance of the class. - - - Gets or sets a value that specifies whether to serialize the default value for a field or property being serialized. - true if the default value for a member should be generated in the serialization stream; otherwise, false. The default is true. - - - Gets whether has been explicitly set. - Returns true if the name has been explicitly set; otherwise, false. - - - Gets or sets a value that instructs the serialization engine that the member must be present when reading or deserializing. - true, if the member is required; otherwise, false. - the member is not present. - - - Gets or sets a data member name. - The name of the data member. The default is the name of the target that the attribute is applied to. - - - Gets or sets the order of serialization and deserialization of a member. - The numeric order of serialization or deserialization. - - - Specifies date-time format options. - - - Initializes a new instance of the class using the format string. - The format string. - - - Initializes a new instance of the class using the format string and format provider. - The format sting. - The format provider. - - - Gets or sets the formatting options that customize string parsing for some date and time parsing methods. - The formatting options that customize string parsing for some date and time parsing methods. - - - Gets an object that controls formatting. - - - - Gets the format strings to control the formatting produced when a date or time is represented as a string. - The format strings to control the formatting produced when a date or time is represented as a string. - - - Specifies how often to emit type information. - - - Always to emit type information. - - - - As needed emit type information. - - - - Never to emit type information. - - - - Specifies that the field is an enumeration member and should be serialized. - - - Initializes a new instance of the class. - - - Gets whether the has been explicitly set. - true if the value has been explicitly set; otherwise, false. - - - Gets or sets the value associated with the enumeration member the attribute is applied to. - The value associated with the enumeration member. - - - Represents the options that can be set for an . - - - Initializes a new instance of the class. - - - Gets the collection of types that may be encountered during serialization or deserialization. - A KnownTypes collection that contains types that may be encountered during serialization or deserialization. XML schema representations are exported for all the types specified in this collection by the . - - - Stores data from a versioned data contract that has been extended by adding new members. - - - Provides base functionality for the common language runtime serialization formatters. - - - Initializes a new instance of the class. - - - When overridden in a derived class, gets or sets the used with the current formatter. - The used with the current formatter. - - - When overridden in a derived class, gets or sets the used for the current serialization. - The used for the current serialization. - - - When overridden in a derived class, deserializes the stream attached to the formatter when it was created, creating a graph of objects identical to the graph originally serialized into that stream. - The stream to deserialize. - The top object of the deserialized graph of objects. - - - Returns the next object to serialize, from the formatter's internal work queue. - The ID assigned to the current object during serialization. - The next object to serialize. - The next object retrieved from the work queue did not have an assigned ID. - - - Contains the used with the current formatter. - - - - Contains a of the objects left to serialize. - - - - Schedules an object for later serialization. - The object to schedule for serialization. - The object ID assigned to the object. - - - When overridden in a derived class, serializes the graph of objects with the specified root to the stream already attached to the formatter. - The stream to which the objects are serialized. - The object at the root of the graph to serialize. - - - When overridden in a derived class, gets or sets the used with the current formatter. - The used with the current formatter. - - - When overridden in a derived class, writes an array to the stream already attached to the formatter. - The array to write. - The name of the array. - The type of elements that the array holds. - - - When overridden in a derived class, writes a Boolean value to the stream already attached to the formatter. - The value to write. - The name of the member. - - - When overridden in a derived class, writes an 8-bit unsigned integer to the stream already attached to the formatter. - The value to write. - The name of the member. - - - When overridden in a derived class, writes a Unicode character to the stream already attached to the formatter. - The value to write. - The name of the member. - - - When overridden in a derived class, writes a value to the stream already attached to the formatter. - The value to write. - The name of the member. - - - When overridden in a derived class, writes a value to the stream already attached to the formatter. - The value to write. - The name of the member. - - - When overridden in a derived class, writes a double-precision floating-point number to the stream already attached to the formatter. - The value to write. - The name of the member. - - - When overridden in a derived class, writes a 16-bit signed integer to the stream already attached to the formatter. - The value to write. - The name of the member. - - - When overridden in a derived class, writes a 32-bit signed integer to the stream. - The value to write. - The name of the member. - - - When overridden in a derived class, writes a 64-bit signed integer to the stream. - The value to write. - The name of the member. - - - Inspects the type of data received, and calls the appropriate Write method to perform the write to the stream already attached to the formatter. - The name of the member to serialize. - The object to write to the stream attached to the formatter. - - - When overridden in a derived class, writes an object reference to the stream already attached to the formatter. - The object reference to write. - The name of the member. - The type of object the reference points to. - - - When overridden in a derived class, writes an 8-bit signed integer to the stream already attached to the formatter. - The value to write. - The name of the member. - - - When overridden in a derived class, writes a single-precision floating-point number to the stream already attached to the formatter. - The value to write. - The name of the member. - - - When overridden in a derived class, writes a value to the stream already attached to the formatter. - The value to write. - The name of the member. - - - When overridden in a derived class, writes a 16-bit unsigned integer to the stream already attached to the formatter. - The value to write. - The name of the member. - - - When overridden in a derived class, writes a 32-bit unsigned integer to the stream already attached to the formatter. - The value to write. - The name of the member. - - - When overridden in a derived class, writes a 64-bit unsigned integer to the stream already attached to the formatter. - The value to write. - The name of the member. - - - When overridden in a derived class, writes a value of the given type to the stream already attached to the formatter. - The object representing the value type. - The name of the member. - The of the value type. - - - Represents a base implementation of the interface that uses the class and the interface. - - - Initializes a new instance of the class. - - - Converts a value to the given . - The object to convert. - The into which value is converted. - The converted value or null if the type parameter is null. - The value parameter is null. - - - Converts a value to the given . - The object to convert. - The into which value is converted. - The converted value, or null if the type parameter is null. - The value parameter is null. - - - Converts a value to a . - The object to convert. - The converted value or null if the type parameter is null. - The value parameter is null. - - - Converts a value to an 8-bit unsigned integer. - The object to convert. - The converted value or null if the type parameter is null. - The value parameter is null. - - - Converts a value to a Unicode character. - The object to convert. - The converted value or null if the type parameter is null. - The value parameter is null. - - - Converts a value to a . - The object to convert. - The converted value or null if the type parameter is null. - The value parameter is null. - - - Converts a value to a . - The object to convert. - The converted value or null if the type parameter is null. - The value parameter is null. - - - Converts a value to a double-precision floating-point number. - The object to convert. - The converted value or null if the type parameter is null. - The value parameter is null. - - - Converts a value to a 16-bit signed integer. - The object to convert. - The converted value or null if the type parameter is null. - The value parameter is null. - - - Converts a value to a 32-bit signed integer. - The object to convert. - The converted value or null if the type parameter is null. - The value parameter is null. - - - Converts a value to a 64-bit signed integer. - The object to convert. - The converted value or null if the type parameter is null. - The value parameter is null. - - - Converts a value to a . - The object to convert. - The converted value or null if the type parameter is null. - The value parameter is null. - - - Converts a value to a single-precision floating-point number. - The object to convert. - The converted value or null if the type parameter is null. - The value parameter is null. - - - Converts the specified object to a . - The object to convert. - The converted value or null if the type parameter is null. - The value parameter is null. - - - Converts a value to a 16-bit unsigned integer. - The object to convert. - The converted value or null if the type parameter is null. - The value parameter is null. - - - Converts a value to a 32-bit unsigned integer. - The object to convert. - The converted value or null if the type parameter is null. - The value parameter is null. - - - Converts a value to a 64-bit unsigned integer. - The object to convert. - The converted value or null if the type parameter is null. - The value parameter is null. - - - Serializes and deserializes an object, or an entire graph of connected objects, in binary format. - - - Initializes a new instance of the class with default values. - - - Initializes a new instance of the class with a given surrogate selector and streaming context. - The to use. Can be null. - The source and destination for the serialized data. - - - Gets or sets the behavior of the deserializer with regards to finding and loading assemblies. - One of the values that specifies the deserializer behavior. - - - Gets or sets an object of type that controls the binding of a serialized object to a type. - The serialization binder to use with this formatter. - - - Gets or sets the for this formatter. - The streaming context to use with this formatter. - - - Deserializes the specified stream into an object graph. - The stream from which to deserialize the object graph. - The top (root) of the object graph. - The serializationStream is null. - The serializationStream supports seeking, but its length is 0. -or- The target type is a , but the value is out of range of the type. - The caller does not have the required permission. - - - Gets or sets the of automatic deserialization the performs. - The that represents the current automatic deserialization level. - - - Serializes the object, or graph of objects with the specified top (root), to the given stream. - The stream to which the graph is to be serialized. - The object at the root of the graph to serialize. - The serializationStream is null. -or- The graph is null. - An error has occurred during serialization, such as if an object in the graph parameter is not marked as serializable. - The caller does not have the required permission. - - - Gets or sets a that controls type substitution during serialization and deserialization. - The surrogate selector to use with this formatter. - - - Gets or sets the format in which type descriptions are laid out in the serialized stream. - The style of type layouts to use. - - - Indicates the method that will be used during deserialization for locating and loading assemblies. - - - In full mode, the assembly used during deserialization must match exactly the assembly used during serialization. The method of the class is used to load the assembly. - - - - In simple mode, the assembly used during deserialization need not match exactly the assembly used during serialization. Specifically, the version numbers need not match as the method is used to load the assembly. - - - - Indicates the format in which type descriptions are laid out in the serialized stream. - - - Indicates that types can be given to all object members and object members. - - - - Indicates that types can be stated only for arrays of objects, object members of type , and non-primitive value types. - - - - Indicates that strings can be given in the XSD format rather than SOAP. No string IDs are transmitted. - - - - Specifies the level of automatic deserialization for .NET Framework remoting. - - - The full deserialization level for .NET Framework remoting. It supports all types that remoting supports in all situations. - - - - The low deserialization level for .NET Framework remoting. It supports types associated with basic remoting functionality. - - - - Provides static methods to aid with the implementation of a for serialization. This class cannot be inherited. - - - Determines whether the specified can be deserialized with the property set to Low. - The to check for the ability to deserialize. - The property value. - The t parameter is an advanced type and cannot be deserialized when the property is set to Low. - - - Extracts the data from the specified object and returns it as an array of objects. - The object to write to the formatter. - The members to extract from the object. - An array of that contains data stored in members and associated with obj. - The obj or members parameter is null. An element of members is null. - An element of members does not represent a field. - - - Creates a new instance of the specified object type. - The type of object to create. - A zeroed object of the specified type. - The type parameter is null. - The type parameter is not a valid common language runtime type. - The caller does not have the required permission. - - - Gets all the serializable members for a class of the specified . - The type being serialized. - An array of type of the non-transient, non-static members. - The type parameter is null. - The caller does not have the required permission. - - - Gets all the serializable members for a class of the specified and in the provided . - The type being serialized or cloned. - The context where the serialization occurs. - An array of type of the non-transient, non-static members. - The type parameter is null. - The caller does not have the required permission. - - - Returns a serialization surrogate for the specified . - The specified surrogate. - An for the specified innerSurrogate. - - - Looks up the of the specified object in the provided . - The assembly where you want to look up the object. - The name of the object. - The of the named object. - The assem parameter is null. - The caller does not have the required permission. - - - Creates a new instance of the specified object type. - The type of object to create. - A zeroed object of the specified type. - The type parameter is null. - The caller does not have the required permission. - - - Populates the specified object with values for each field drawn from the data array of objects. - The object to populate. - An array of that describes which fields and properties to populate. - An array of that specifies the values for each field and property to populate. - The newly populated object. - The obj, members, or data parameter is null. An element of members is null. - The length of members does not match the length of data. - An element of members is not an instance of . - The caller does not have the required permission. - - - Indicates that a class is to be notified when deserialization of the entire object graph has been completed. Note that this interface is not called when deserializing with the XmlSerializer (System.Xml.Serialization.XmlSerializer). - - - Runs when the entire object graph has been deserialized. - The object that initiated the callback. The functionality for this parameter is not currently implemented. - - - Provides a data structure to store extra data encountered by the during deserialization of a type marked with the attribute. - - - Gets or sets the structure that contains extra data. - An that contains data that is not recognized as belonging to the data contract. - - - Provides functionality for formatting serialized objects. - - - Gets or sets the that performs type lookups during deserialization. - The that performs type lookups during deserialization. - - - Gets or sets the used for serialization and deserialization. - The used for serialization and deserialization. - - - Deserializes the data on the provided stream and reconstitutes the graph of objects. - The stream that contains the data to deserialize. - The top object of the deserialized graph. - - - Serializes an object, or graph of objects with the given root to the provided stream. - The stream where the formatter puts the serialized data. This stream can reference a variety of backing stores (such as files, network, memory, and so on). - The object, or root of the object graph, to serialize. All child objects of this root object are automatically serialized. - - - Gets or sets the used by the current formatter. - The used by this formatter. - - - Provides the connection between an instance of and the formatter-provided class best suited to parse the data inside the . - - - Converts a value to the given . - The object to be converted. - The into which value is to be converted. - The converted value. - - - Converts a value to the given . - The object to be converted. - The into which value is to be converted. - The converted value. - - - Converts a value to a . - The object to be converted. - The converted value. - - - Converts a value to an 8-bit unsigned integer. - The object to be converted. - The converted value. - - - Converts a value to a Unicode character. - The object to be converted. - The converted value. - - - Converts a value to a . - The object to be converted. - The converted value. - - - Converts a value to a . - The object to be converted. - The converted value. - - - Converts a value to a double-precision floating-point number. - The object to be converted. - The converted value. - - - Converts a value to a 16-bit signed integer. - The object to be converted. - The converted value. - - - Converts a value to a 32-bit signed integer. - The object to be converted. - The converted value. - - - Converts a value to a 64-bit signed integer. - The object to be converted. - The converted value. - - - Converts a value to a . - The object to be converted. - The converted value. - - - Converts a value to a single-precision floating-point number. - The object to be converted. - The converted value. - - - Converts a value to a . - The object to be converted. - The converted value. - - - Converts a value to a 16-bit unsigned integer. - The object to be converted. - The converted value. - - - Converts a value to a 32-bit unsigned integer. - The object to be converted. - The converted value. - - - Converts a value to a 64-bit unsigned integer. - The object to be converted. - The converted value. - - - When applied to the member of a type, specifies that the member is not part of a data contract and is not serialized. - - - Initializes a new instance of the class. - - - The exception that is thrown when the or encounters an invalid data contract during serialization and deserialization. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with the specified error message. - A description of the error. - - - Initializes a new instance of the class with the specified and . - A that contains data needed to serialize and deserialize an object. - A that specifies user context during serialization and deserialization. - - - Initializes a new instance of the class with the specified error message and inner exception. - A description of the error. - The original . - - - Indicates that the current interface implementer is a reference to another object. - - - Returns the real object that should be deserialized, rather than the object that the serialized stream specifies. - The from which the current object is deserialized. - Returns the actual object that is put into the graph. - The caller does not have the required permission. The call will not work on a medium trusted server. - - - Enables serialization of custom exception data in security-transparent code. - - - This method is called when the instance is deserialized. - An object that contains the state of the instance. - - - Allows an object to control its own serialization and deserialization. - - - Populates a with the data needed to serialize the target object. - The to populate with data. - The destination (see ) for this serialization. - The caller does not have the required permission. - - - Implements a serialization surrogate selector that allows one object to perform serialization and deserialization of another. - - - Populates the provided with the data needed to serialize the object. - The object to serialize. - The to populate with data. - The destination (see ) for this serialization. - The caller does not have the required permission. - - - Populates the object using the information in the . - The object to populate. - The information to populate the object. - The source from which the object is deserialized. - The surrogate selector where the search for a compatible surrogate begins. - The populated deserialized object. - The caller does not have the required permission. - - - - - - - - - - - - - - - - - - - - Indicates a serialization surrogate selector class. - - - Specifies the next for surrogates to examine if the current instance does not have a surrogate for the specified type and assembly in the specified context. - The next surrogate selector to examine. - The caller does not have the required permission. - - - Returns the next surrogate selector in the chain. - The next surrogate selector in the chain or null. - The caller does not have the required permission. - - - Finds the surrogate that represents the specified object's type, starting with the specified surrogate selector for the specified serialization context. - The of object (class) that needs a surrogate. - The source or destination context for the current serialization. - When this method returns, contains a that holds a reference to the surrogate selector where the appropriate surrogate was found. This parameter is passed uninitialized. - The appropriate surrogate for the given type in the given context. - The caller does not have the required permission. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Specifies settings. - - - Initializes a new instance of the class. - - - Gets or sets a DateTimeFormat that defines the culturally appropriate format of displaying dates and times. - The DateTimeFormat that defines the culturally appropriate format of displaying dates and times. - - - Gets or sets the data contract JSON serializer settings to emit type information. - The data contract JSON serializer settings to emit type information. - - - Gets or sets a value that specifies whether to ignore data supplied by an extension of the class when the class is being serialized or deserialized. - True to ignore data supplied by an extension of the class when the class is being serialized or deserialized; otherwise, false. - - - Gets or sets a collection of types that may be present in the object graph serialized using this instance the DataContractJsonSerializerSettings. - A collection of types that may be present in the object graph serialized using this instance the DataContractJsonSerializerSettings. - - - Gets or sets the maximum number of items in an object graph to serialize or deserialize. - The maximum number of items in an object graph to serialize or deserialize. - - - Gets or sets the root name of the selected object. - The root name of the selected object. - - - Gets or sets a value that specifies whether to serialize read only types. - True to serialize read only types; otherwise false. - - - Gets or sets a value that specifies whether to use a simple dictionary format. - True to use a simple dictionary format; otherwise, false. - - - Specifies the interface for initializing a JavaScript Object Notation (JSON) reader when reusing them to read from a particular stream or buffer. - - - Reinitializes a JavaScript Object Notation (JSON) enabled reader to a specified stream that contains JSON-encoded data. - The input from which to read. - The used by the reader. - to apply. - Delegate to call when the reader is closed. - - - Reinitializes a JavaScript Object Notation (JSON) enabled reader to a specified buffer that contains JSON-encoded data. - The input buffer array from which to read. - The starting position from which to read in buffer. - The number of bytes that can be read from buffer. - The used by the reader. - The to apply. - The delegate to call when the reader is closed. - - - Specifies the interface for initializing a JavaScript Object Notation (JSON) writer when reusing them to write to a particular output stream. - - - Initializes (or reinitializes) a JavaScript Object Notation (JSON) writer to a specified output stream with specified character encoding. - The output to which the writer writes. - The that specifies the character encoding of the output stream. - If true, the output stream is closed by the writer when done; otherwise false. - - - Produces instances of that can read data encoded with JavaScript Object Notation (JSON) from a stream or buffer and map it to an XML Infoset and instances of that can map an XML Infoset to JSON and write JSON-encoded data to a stream. - - - Creates an that can map buffers encoded with JavaScript Object Notation (JSON) to an XML Infoset. - The input buffer array from which to read. - The used to prevent Denial of Service attacks when reading untrusted data. - An that can process JavaScript Object Notation (JSON) data. - - - Creates an that can map streams encoded with JavaScript Object Notation (JSON) to an XML Infoset. - The input from which to read. - The used to prevent Denial of Service attacks when reading untrusted data. - An that can read JavaScript Object Notation (JSON). - - - Creates an that can map buffers encoded with JavaScript Object Notation (JSON), of a specified size and offset, to an XML Infoset. - The input buffer array from which to read. - Starting position from which to read in buffer. - Number of bytes that can be read from buffer. - The used to prevent Denial of Service attacks when reading untrusted data. - An that can read JavaScript Object Notation (JSON). - - - Creates an that can map streams encoded with JavaScript Object Notation (JSON), of a specified size and offset, to an XML Infoset. - The input from which to read. - The that specifies the character encoding used by the reader. If null is specified as the value, the reader attempts to auto-detect the encoding. - The used to prevent Denial of Service attacks when reading untrusted data. - The delegate to call when the reader is closed. - An that can read JavaScript Object Notation (JSON). - - - Creates an that can map buffers encoded with JavaScript Object Notation (JSON), with a specified size and offset and character encoding, to an XML Infoset. - The input buffer array from which to read. - Starting position from which to read in buffer. - Number of bytes that can be read from buffer. - The that specifies the character encoding used by the reader. If null is specified as the value, the reader attempts to auto-detect the encoding. - The used to prevent Denial of Service attacks when reading untrusted data. - The delegate to call when the reader is closed. The default value is null. - An that can read JavaScript Object Notation (JSON). - - - Creates an that writes data encoded with JSON to a stream. - The output for the JSON writer. - An that writes data encoded with JSON to the stream based on an XML Infoset. - - - Creates an that writes data encoded with JSON to a stream with a specified character encoding. - The output for the JSON writer. - The that specifies the character encoding used by the writer. The default encoding is UTF-8. - An that writes data encoded with JSON to the stream based on an XML Infoset. - - - Creates an that writes data encoded with JSON to a stream with a specified character encoding. - The output for the JSON writer. - The that specifies the character encoding used by the writer. The default encoding is UTF-8. - If true, the output stream is closed by the writer when done; otherwise false. The default value is true. - An that writes data encoded with JSON to the stream based on an XML Infoset. - - - Creates an that writes data encoded with JSON to a stream with a specified character. - The output for the JSON writer. - The that specifies the character encoding used by the writer. The default encoding is UTF-8. - If true, the output stream is closed by the writer when done; otherwise false. The default value is true. - If true, the output uses multiline format, indenting each level properly; otherwise, false. - An that writes data encoded with JSON to the stream based on an XML Infoset. - - - Creates an that writes data encoded with JSON to a stream with a specified character. - The output for the JSON writer. - The that specifies the character encoding used by the writer. The default encoding is UTF-8. - If true, the output stream is closed by the writer when done; otherwise false. The default value is true. - If true, the output uses multiline format, indenting each level properly; otherwise, false. - The string used to indent each level. - An that writes data encoded with JSON to the stream based on an XML Infoset. - - - Specifies types that should be recognized by the when serializing or deserializing a given type. - - - Initializes a new instance of the class with the name of a method that returns an of known types. - The name of the method that returns an of types used when serializing or deserializing data. - - - Initializes a new instance of the class with the specified type. - The that is included as a known type when serializing or deserializing data. - - - Gets the name of a method that will return a list of types that should be recognized during serialization or deserialization. - A that contains the name of the method on the type defined by the class. - - - Gets the type that should be recognized during serialization or deserialization by the . - The that is used during serialization or deserialization. - - - Generates IDs for objects. - - - Initializes a new instance of the class. - - - Returns the ID for the specified object, generating a new ID if the specified object has not already been identified by the . - The object you want an ID for. - true if obj was not previously known to the ; otherwise, false. - The object's ID is used for serialization. firstTime is set to true if this is the first time the object has been identified; otherwise, it is set to false. - The obj parameter is null. - The has been asked to keep track of too many objects. - - - Determines whether an object has already been assigned an ID. - The object you are asking for. - true if obj was not previously known to the ; otherwise, false. - The object ID of obj if previously known to the ; otherwise, zero. - The obj parameter is null. - - - Keeps track of objects as they are deserialized. - - - Initializes a new instance of the class. - The surrogate selector to use. The determines the correct surrogate to use when deserializing objects of a given type. At deserialization time, the surrogate selector creates a new instance of the object from the information transmitted on the stream. - The streaming context. The is not used by ObjectManager, but is passed as a parameter to any objects implementing or having a . These objects can take specific actions depending on the source of the information to deserialize. - The caller does not have the required permission. - - - Performs all the recorded fixups. - A fixup was not successfully completed. - - - Returns the object with the specified object ID. - The ID of the requested object. - The object with the specified object ID if it has been previously stored or null if no such object has been registered. - The objectID parameter is less than or equal to zero. - - - Raises the deserialization event to any registered object that implements . - - - Invokes the method marked with the . - The instance of the type that contains the method to be invoked. - - - Records a fixup for one element in an array. - The ID of the array used to record a fixup. - The index within arrayFixup that a fixup is requested for. - The ID of the object that the current array element will point to after fixup is completed. - The arrayToBeFixed or objectRequired parameter is less than or equal to zero. - The index parameter is null. - - - Records fixups for the specified elements in an array, to be executed later. - The ID of the array used to record a fixup. - The indexes within the multidimensional array that a fixup is requested for. - The ID of the object the array elements will point to after fixup is completed. - The arrayToBeFixed or objectRequired parameter is less than or equal to zero. - The indices parameter is null. - - - Records a fixup for an object member, to be executed later. - The ID of the object that needs the reference to objectRequired. - The member name of objectToBeFixed where the fixup will be performed. - The ID of the object required by objectToBeFixed. - objectToBeFixed or objectRequired parameter is less than or equal to zero. - The memberName parameter is null. - - - Records a fixup for a member of an object, to be executed later. - The ID of the object that needs the reference to the objectRequired object. - The member of objectToBeFixed where the fixup will be performed. - The ID of the object required by objectToBeFixed. - The objectToBeFixed or objectRequired parameter is less than or equal to zero. - The member parameter is null. - - - Registers an object as it is deserialized, associating it with objectID. - The object to register. - The ID of the object to register. - The obj parameter is null. - The objectID parameter is less than or equal to zero. - The objectID has already been registered for an object other than obj. - - - Registers an object as it is deserialized, associating it with objectID, and recording the used with it. - The object to register. - The ID of the object to register. - The used if obj implements or has a . info will be completed with any required fixup information and then passed to the required object when that object is completed. - The obj parameter is null. - The objectID parameter is less than or equal to zero. - The objectID has already been registered for an object other than obj. - - - Registers a member of an object as it is deserialized, associating it with objectID, and recording the . - The object to register. - The ID of the object to register. - The used if obj implements or has a . info will be completed with any required fixup information and then passed to the required object when that object is completed. - The ID of the object that contains obj. This parameter is required only if obj is a value type. - The field in the containing object where obj exists. This parameter has meaning only if obj is a value type. - The obj parameter is null. - The objectID parameter is less than or equal to zero. - The objectID has already been registered for an object other than obj, or member is not a and member is not null. - - - Registers a member of an array contained in an object while it is deserialized, associating it with objectID, and recording the . - The object to register. - The ID of the object to register. - The used if obj implements or has a . info will be completed with any required fixup information and then passed to the required object when that object is completed. - The ID of the object that contains obj. This parameter is required only if obj is a value type. - The field in the containing object where obj exists. This parameter has meaning only if obj is a value type. - If obj is a and a member of an array, arrayIndex contains the index within that array where obj exists. arrayIndex is ignored if obj is not both a and a member of an array. - The obj parameter is null. - The objectID parameter is less than or equal to zero. - The objectID has already been registered for an object other than obj, or member is not a and member isn't null. - - - When applied to a method, specifies that the method is called immediately after deserialization of an object in an object graph. The order of deserialization relative to other objects in the graph is non-deterministic. - - - Initializes a new instance of the class. - - - When applied to a method, specifies that the method is called during deserialization of an object in an object graph. The order of deserialization relative to other objects in the graph is non-deterministic. - - - Initializes a new instance of the class. - - - When applied to a method, specifies that the method is called after serialization of an object in an object graph. The order of serialization relative to other objects in the graph is non-deterministic. - - - Initializes a new instance of the class. - - - When applied to a method, specifies that the method is during serialization of an object in an object graph. The order of serialization relative to other objects in the graph is non-deterministic. - - - Initializes a new instance of the class. - - - Specifies that a field can be missing from a serialization stream so that the and the does not throw an exception. - - - Initializes a new instance of the class. - - - This property is unused and is reserved. - This property is reserved. - - - Provides data for the event. - - - Stores the state of the exception. - A state object that is serialized with the instance. - - - Gets or sets an object that describes the source and destination of a serialized stream. - An object that describes the source and destination of a serialized stream. - - - Allows users to control class loading and mandate what class to load. - - - Initializes a new instance of the class. - - - When overridden in a derived class, controls the binding of a serialized object to a type. - The type of the object the formatter creates a new instance of. - Specifies the name of the serialized object. - Specifies the name of the serialized object. - - - When overridden in a derived class, controls the binding of a serialized object to a type. - Specifies the name of the serialized object. - Specifies the name of the serialized object. - The type of the object the formatter creates a new instance of. - - - Holds the value, , and name of a serialized object. - - - Gets the name of the object. - The name of the object. - - - Gets the of the object. - The of the object. - - - Gets the value contained in the object. - The value contained in the object. - - - The exception thrown when an error occurs during serialization or deserialization. - - - Initializes a new instance of the class with default properties. - - - Initializes a new instance of the class with a specified message. - Indicates the reason why the exception occurred. - - - Initializes a new instance of the class from serialized data. - The serialization information object holding the serialized object data in the name-value form. - The contextual information about the source or destination of the exception. - The info parameter is null. - - - Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. - The error message that explains the reason for the exception. - The exception that is the cause of the current exception. If the innerException parameter is not null, the current exception is raised in a catch block that handles the inner exception. - - - Stores all the data needed to serialize or deserialize an object. This class cannot be inherited. - - - Creates a new instance of the class. - The of the object to serialize. - The used during deserialization. - type or converter is null. - - - Initializes a new instance of the class. - The of the object to serialize. - The used during deserialization. - Indicates whether the object requires same token in partial trust. - - - Adds a value into the store, where value is associated with name and is serialized as being of type. - The name to associate with the value, so it can be deserialized later. - The value to be serialized. Any children of this object will automatically be serialized. - The to associate with the current object. This parameter must always be the type of the object itself or of one of its base classes. - If name or type is null. - A value has already been associated with name. - - - Adds a 64-bit unsigned integer value into the store. - The name to associate with the value, so it can be deserialized later. - The UInt64 value to serialize. - The name parameter is null. - A value has already been associated with name. - - - Adds a 32-bit unsigned integer value into the store. - The name to associate with the value, so it can be deserialized later. - The UInt32 value to serialize. - The name parameter is null. - A value has already been associated with name. - - - Adds a 16-bit unsigned integer value into the store. - The name to associate with the value, so it can be deserialized later. - The UInt16 value to serialize. - The name parameter is null. - A value has already been associated with name. - - - Adds a single-precision floating-point value into the store. - The name to associate with the value, so it can be deserialized later. - The single value to serialize. - The name parameter is null. - A value has already been associated with name. - - - Adds an 8-bit signed integer value into the store. - The name to associate with the value, so it can be deserialized later. - The Sbyte value to serialize. - The name parameter is null. - A value has already been associated with name. - - - Adds the specified object into the store, where it is associated with a specified name. - The name to associate with the value, so it can be deserialized later. - The value to be serialized. Any children of this object will automatically be serialized. - name is null. - A value has already been associated with name. - - - Adds a 64-bit signed integer value into the store. - The name to associate with the value, so it can be deserialized later. - The Int64 value to serialize. - The name parameter is null. - A value has already been associated with name. - - - Adds a 32-bit signed integer value into the store. - The name to associate with the value, so it can be deserialized later. - The Int32 value to serialize. - The name parameter is null. - A value has already been associated with name. - - - Adds a 16-bit signed integer value into the store. - The name to associate with the value, so it can be deserialized later. - The Int16 value to serialize. - The name parameter is null. - A value has already been associated with name. - - - Adds a double-precision floating-point value into the store. - The name to associate with the value, so it can be deserialized later. - The double value to serialize. - The name parameter is null. - A value has already been associated with name. - - - Adds a decimal value into the store. - The name to associate with the value, so it can be deserialized later. - The decimal value to serialize. - If The name parameter is null. - If a value has already been associated with name. - - - Adds a value into the store. - The name to associate with the value, so it can be deserialized later. - The value to serialize. - The name parameter is null. - A value has already been associated with name. - - - Adds a Unicode character value into the store. - The name to associate with the value, so it can be deserialized later. - The character value to serialize. - The name parameter is null. - A value has already been associated with name. - - - Adds an 8-bit unsigned integer value into the store. - The name to associate with the value, so it can be deserialized later. - The byte value to serialize. - The name parameter is null. - A value has already been associated with name. - - - Adds a Boolean value into the store. - The name to associate with the value, so it can be deserialized later. - The Boolean value to serialize. - The name parameter is null. - A value has already been associated with name. - - - Gets or sets the assembly name of the type to serialize during serialization only. - The full name of the assembly of the type to serialize. - The value the property is set to is null. - - - Gets or sets the full name of the to serialize. - The full name of the type to serialize. - The value this property is set to is null. - - - Retrieves a Boolean value from the store. - The name associated with the value to retrieve. - The Boolean value associated with name. - name is null. - The value associated with name cannot be converted to a Boolean value. - An element with the specified name is not found in the current instance. - - - Retrieves an 8-bit unsigned integer value from the store. - The name associated with the value to retrieve. - The 8-bit unsigned integer associated with name. - name is null. - The value associated with name cannot be converted to an 8-bit unsigned integer. - An element with the specified name is not found in the current instance. - - - Retrieves a Unicode character value from the store. - The name associated with the value to retrieve. - The Unicode character associated with name. - name is null. - The value associated with name cannot be converted to a Unicode character. - An element with the specified name is not found in the current instance. - - - Retrieves a value from the store. - The name associated with the value to retrieve. - The value associated with name. - name is null. - The value associated with name cannot be converted to a value. - An element with the specified name is not found in the current instance. - - - Retrieves a decimal value from the store. - The name associated with the value to retrieve. - A decimal value from the . - name is null. - The value associated with name cannot be converted to a decimal. - An element with the specified name is not found in the current instance. - - - Retrieves a double-precision floating-point value from the store. - The name associated with the value to retrieve. - The double-precision floating-point value associated with name. - name is null. - The value associated with name cannot be converted to a double-precision floating-point value. - An element with the specified name is not found in the current instance. - - - Returns a used to iterate through the name-value pairs in the store. - A for parsing the name-value pairs contained in the store. - - - Retrieves a 16-bit signed integer value from the store. - The name associated with the value to retrieve. - The 16-bit signed integer associated with name. - name is null. - The value associated with name cannot be converted to a 16-bit signed integer. - An element with the specified name is not found in the current instance. - - - Retrieves a 32-bit signed integer value from the store. - The name of the value to retrieve. - The 32-bit signed integer associated with name. - name is null. - The value associated with name cannot be converted to a 32-bit signed integer. - An element with the specified name is not found in the current instance. - - - Retrieves a 64-bit signed integer value from the store. - The name associated with the value to retrieve. - The 64-bit signed integer associated with name. - name is null. - The value associated with name cannot be converted to a 64-bit signed integer. - An element with the specified name is not found in the current instance. - - - Retrieves an 8-bit signed integer value from the store. - The name associated with the value to retrieve. - The 8-bit signed integer associated with name. - name is null. - The value associated with name cannot be converted to an 8-bit signed integer. - An element with the specified name is not found in the current instance. - - - Retrieves a single-precision floating-point value from the store. - The name of the value to retrieve. - The single-precision floating-point value associated with name. - name is null. - The value associated with name cannot be converted to a single-precision floating-point value. - An element with the specified name is not found in the current instance. - - - Retrieves a value from the store. - The name associated with the value to retrieve. - The associated with name. - name is null. - The value associated with name cannot be converted to a . - An element with the specified name is not found in the current instance. - - - Retrieves a 16-bit unsigned integer value from the store. - The name associated with the value to retrieve. - The 16-bit unsigned integer associated with name. - name is null. - The value associated with name cannot be converted to a 16-bit unsigned integer. - An element with the specified name is not found in the current instance. - - - Retrieves a 32-bit unsigned integer value from the store. - The name associated with the value to retrieve. - The 32-bit unsigned integer associated with name. - name is null. - The value associated with name cannot be converted to a 32-bit unsigned integer. - An element with the specified name is not found in the current instance. - - - Retrieves a 64-bit unsigned integer value from the store. - The name associated with the value to retrieve. - The 64-bit unsigned integer associated with name. - name is null. - The value associated with name cannot be converted to a 64-bit unsigned integer. - An element with the specified name is not found in the current instance. - - - Retrieves a value from the store. - The name associated with the value to retrieve. - The of the value to retrieve. If the stored value cannot be converted to this type, the system will throw a . - The object of the specified associated with name. - name or type is null. - The value associated with name cannot be converted to type. - An element with the specified name is not found in the current instance. - - - Gets whether the assembly name has been explicitly set. - True if the assembly name has been explicitly set; otherwise false. - - - Gets whether the full type name has been explicitly set. - True if the full type name has been explicitly set; otherwise false. - - - Gets the number of members that have been added to the store. - The number of members that have been added to the current . - - - Returns the type of the object to be serialized. - The type of the object being serialized. - - - Sets the of the object to serialize. - The of the object to serialize. - The type parameter is null. - - - Provides a formatter-friendly mechanism for parsing the data in . This class cannot be inherited. - - - Gets the item currently being examined. - The item currently being examined. - The enumerator has not started enumerating items or has reached the end of the enumeration. - - - Updates the enumerator to the next item. - true if a new element is found; otherwise, false. - - - Gets the name for the item currently being examined. - The item name. - The enumerator has not started enumerating items or has reached the end of the enumeration. - - - Gets the type of the item currently being examined. - The type of the item currently being examined. - The enumerator has not started enumerating items or has reached the end of the enumeration. - - - Resets the enumerator to the first item. - - - Gets the value of the item currently being examined. - The value of the item currently being examined. - The enumerator has not started enumerating items or has reached the end of the enumeration. - - - Gets the current item in the collection. - A that contains the current serialization data. - The enumeration has not started or has already ended. - - - Manages serialization processes at run time. This class cannot be inherited. - - - Initializes a new instance of the class. - An instance of the class that contains information about the current serialization operation. - - - Invokes the OnSerializing callback event if the type of the object has one; and registers the object for raising the OnSerialized event if the type of the object has one. - - - Registers the object upon which events will be raised. - The object to register. - - - Describes the source and destination of a given serialized stream, and provides an additional caller-defined context. - - - Initializes a new instance of the class with a given context state. - A bitwise combination of the values that specify the source or destination context for this . - - - Initializes a new instance of the class with a given context state, and some additional information. - A bitwise combination of the values that specify the source or destination context for this . - Any additional information to be associated with the . This information is available to any object that implements or any serialization surrogate. Most users do not need to set this parameter. - - - Gets context specified as part of the additional context. - The context specified as part of the additional context. - - - Determines whether two instances contain the same values. - An object to compare with the current instance. - true if the specified object is an instance of and equals the value of the current instance; otherwise, false. - - - Returns a hash code of this object. - The value that contains the source or destination of the serialization for this . - - - Gets the source or destination of the transmitted data. - During serialization, the destination of the transmitted data. During deserialization, the source of the data. - - - Defines a set of flags that specifies the source or destination context for the stream during serialization. - - - Specifies that the serialized data can be transmitted to or received from any of the other contexts. - - - - Specifies that the object graph is being cloned. Users can assume that the cloned graph will continue to exist within the same process and be safe to access handles or other references to unmanaged resources. - - - - Specifies that the source or destination context is a different AppDomain. (For a description of AppDomains, see Application Domains). - - - - Specifies that the source or destination context is a different computer. - - - - Specifies that the source or destination context is a different process on the same computer. - - - - Specifies that the source or destination context is a file. Users can assume that files will last longer than the process that created them and not serialize objects in such a way that deserialization will require accessing any data from the current process. - - - - Specifies that the serialization context is unknown. - - - - Specifies that the source or destination context is a persisted store, which could include databases, files, or other backing stores. Users can assume that persisted data will last longer than the process that created the data and not serialize objects so that deserialization will require accessing any data from the current process. - - - - Specifies that the data is remoted to a context in an unknown location. Users cannot make any assumptions whether this is on the same computer. - - - - Assists formatters in selection of the serialization surrogate to delegate the serialization or deserialization process to. - - - Initializes a new instance of the class. - - - Adds a surrogate to the list of checked surrogates. - The for which the surrogate is required. - The context-specific data. - The surrogate to call for this type. - The type or surrogate parameter is null. - A surrogate already exists for this type and context. - - - Adds the specified that can handle a particular object type to the list of surrogates. - The surrogate selector to add. - The selector parameter is null. - The selector is already on the list of selectors. - The caller does not have the required permission. - - - Returns the next selector on the chain of selectors. - The next on the chain of selectors. - The caller does not have the required permission. - - - Returns the surrogate for a particular type. - The for which the surrogate is requested. - The streaming context. - The surrogate to use. - The surrogate for a particular type. - The type parameter is null. - The caller does not have the required permission. - - - Removes the surrogate associated with a given type. - The for which to remove the surrogate. - The for the current surrogate. - The type parameter is null. - - - Provides extension methods for retrieving implementations for the public and private keys of an . - - - Gets the private key from the . - The certificate. - The private key, or null if the certificate does not have an RSA private key. - certificate is null. - - - Gets the public key from the . - The certificate. - The public key, or null if the certificate does not have an RSA public key. - certificate is null. - Windows reports an error. See the property for more information. - - - Specifies the location of the X.509 certificate store. - - - The X.509 certificate store used by the current user. - - - - The X.509 certificate store assigned to the local machine. - - - - Specifies the name of the X.509 certificate store to open. - - - The X.509 certificate store for other users. - - - - The X.509 certificate store for third-party certificate authorities (CAs). - - - - The X.509 certificate store for intermediate certificate authorities (CAs). - - - - The X.509 certificate store for revoked certificates. - - - - The X.509 certificate store for personal certificates. - - - - The X.509 certificate store for trusted root certificate authorities (CAs). - - - - The X.509 certificate store for directly trusted people and resources. - - - - The X.509 certificate store for directly trusted publishers. - - - - Represents the distinguished name of an X509 certificate. This class cannot be inherited. - - - Initializes a new instance of the class using information from the specified byte array. - A byte array that contains distinguished name information. - - - Initializes a new instance of the class using the specified object. - An object that represents the distinguished name. - - - Initializes a new instance of the class using the specified object. - An object. - - - Initializes a new instance of the class using information from the specified string. - A string that represents the distinguished name. - - - Initializes a new instance of the class using the specified string and flag. - A string that represents the distinguished name. - A bitwise combination of the enumeration values that specify the characteristics of the distinguished name. - - - Decodes a distinguished name using the characteristics specified by the flag parameter. - A bitwise combination of the enumeration values that specify the characteristics of the distinguished name. - The decoded distinguished name. - The certificate has an invalid name. - - - Returns a formatted version of an X500 distinguished name for printing or for output to a text window or to a console. - true if the return string should contain carriage returns; otherwise, false. - A formatted string that represents the X500 distinguished name. - - - Gets the comma-delimited distinguished name from an X500 certificate. - The comma-delimited distinguished name of the X509 certificate. - - - Specifies characteristics of the X.500 distinguished name. - - - The distinguished name does not use the plus sign. - - - - The distinguished name does not use quotation marks. - - - - Forces the distinguished name to encode specific X.500 keys as UTF-8 strings rather than printable Unicode strings. For more information and the list of X.500 keys affected, see the X500NameFlags enumeration. - - - - The distinguished name has no special characteristics. - - - - The distinguished name is reversed. - - - - The distinguished name uses commas. - - - - The distinguished name uses the new line character. - - - - The distinguished name uses semicolons. - - - - The distinguished name uses T61 encoding. - - - - The distinguished name uses UTF8 encoding instead of Unicode character encoding. - - - - Defines the constraints set on a certificate. This class cannot be inherited. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class using an object and a value that identifies whether the extension is critical. - The encoded data to use to create the extension. - true if the extension is critical; otherwise, false. - - - Initializes a new instance of the class. Parameters specify a value that indicates whether a certificate is a certificate authority (CA) certificate, a value that indicates whether the certificate has a restriction on the number of path levels it allows, the number of levels allowed in a certificate's path, and a value that indicates whether the extension is critical. - true if the certificate is a certificate authority (CA) certificate; otherwise, false. - true if the certificate has a restriction on the number of path levels it allows; otherwise, false. - The number of levels allowed in a certificate's path. - true if the extension is critical; otherwise, false. - - - Gets a value indicating whether a certificate is a certificate authority (CA) certificate. - true if the certificate is a certificate authority (CA) certificate, otherwise, false. - - - Initializes a new instance of the class using an object. - The encoded data to use to create the extension. - - - Gets a value indicating whether a certificate has a restriction on the number of path levels it allows. - true if the certificate has a restriction on the number of path levels it allows, otherwise, false. - The extension cannot be decoded. - - - Gets the number of levels allowed in a certificate's path. - An integer indicating the number of levels allowed in a certificate's path. - The extension cannot be decoded. - - - Provides methods that help you use X.509 v.3 certificates. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class using a certificate file name, a password, and a key storage flag. - The name of a certificate file. - The password required to access the X.509 certificate data. - A bitwise combination of the enumeration values that control where and how to import the certificate. - An error with the certificate occurs. For example: The certificate file does not exist. The certificate is invalid. The certificate's password is incorrect. - The fileName parameter is null. - - - Initializes a new instance of the class using a byte array, a password, and a key storage flag. - A byte array containing data from an X.509 certificate. - The password required to access the X.509 certificate data. - A bitwise combination of the enumeration values that control where and how to import the certificate. - An error with the certificate occurs. For example: The certificate file does not exist. The certificate is invalid. The certificate's password is incorrect. - The rawData parameter is null. -or- The length of the rawData parameter is 0. - - - Initializes a new instance of the class using a byte array, a password, and a key storage flag. - A byte array that contains data from an X.509 certificate. - The password required to access the X.509 certificate data. - A bitwise combination of the enumeration values that control where and how to import the certificate. - An error with the certificate occurs. For example: The certificate file does not exist. The certificate is invalid. The certificate's password is incorrect. - The rawData parameter is null. -or- The length of the rawData parameter is 0. - - - Initializes a new instance of the class using the name of a PKCS7 signed file and a password to access the certificate. - The name of a PKCS7 signed file. - The password required to access the X.509 certificate data. - An error with the certificate occurs. For example: The certificate file does not exist. The certificate is invalid. The certificate's password is incorrect. - The fileName parameter is null. - - - Initializes a new instance of the class using a certificate file name and a password. - The name of a certificate file. - The password required to access the X.509 certificate data. - An error with the certificate occurs. For example: The certificate file does not exist. The certificate is invalid. The certificate's password is incorrect. - The fileName parameter is null. - - - Initializes a new instance of the class using a object and a structure. - A object that describes serialization information. - A structure that describes how serialization should be performed. - An error with the certificate occurs. For example: The certificate file does not exist. The certificate is invalid. The certificate's password is incorrect. - - - Initializes a new instance of the class using the name of a PKCS7 signed file, a password to access the certificate, and a key storage flag. - The name of a PKCS7 signed file. - The password required to access the X.509 certificate data. - A bitwise combination of the enumeration values that control where and how to import the certificate. - An error with the certificate occurs. For example: The certificate file does not exist. The certificate is invalid. The certificate's password is incorrect. - The fileName parameter is null. - - - Initializes a new instance of the class using a byte array and a password. - A byte array that contains data from an X.509 certificate. - The password required to access the X.509 certificate data. - An error with the certificate occurs. For example: The certificate file does not exist. The certificate is invalid. The certificate's password is incorrect. - The rawData parameter is null. -or- The length of the rawData parameter is 0. - - - Initializes a new instance of the class using the name of a PKCS7 signed file. - The name of a PKCS7 signed file. - An error with the certificate occurs. For example: The certificate file does not exist. The certificate is invalid. The certificate's password is incorrect. - The fileName parameter is null. - - - Initializes a new instance of the class using another class. - A class from which to initialize this class. - An error with the certificate occurs. For example: The certificate file does not exist. The certificate is invalid. The certificate's password is incorrect. - The value of the cert parameter is null. - - - Initializes a new instance of the class using a handle to an unmanaged PCCERT_CONTEXT structure. - A handle to an unmanaged PCCERT_CONTEXT structure. - An error with the certificate occurs. For example: The certificate file does not exist. The certificate is invalid. The certificate's password is incorrect. - The handle parameter does not represent a valid PCCERT_CONTEXT structure. - - - Initializes a new instance of the class defined from a sequence of bytes representing an X.509v3 certificate. - A byte array containing data from an X.509 certificate. - An error with the certificate occurs. For example: The certificate file does not exist. The certificate is invalid. The certificate's password is incorrect. - The rawData parameter is null. -or- The length of the rawData parameter is 0. - - - Initializes a new instance of the class using a byte array and a password. - A byte array containing data from an X.509 certificate. - The password required to access the X.509 certificate data. - An error with the certificate occurs. For example: The certificate file does not exist. The certificate is invalid. The certificate's password is incorrect. - The rawData parameter is null. -or- The length of the rawData parameter is 0. - - - Creates an X.509v3 certificate from the specified PKCS7 signed file. - The path of the PKCS7 signed file from which to create the X.509 certificate. - The newly created X.509 certificate. - The filename parameter is null. - - - Creates an X.509v3 certificate from the specified signed file. - The path of the signed file from which to create the X.509 certificate. - The newly created X.509 certificate. - - - Releases all of the unmanaged resources used by this and optionally releases the managed resources. - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - Releases all resources used by the current object. - - - Compares two objects for equality. - An object to compare to the current object. - true if the current object is equal to the object specified by the other parameter; otherwise, false. - - - Compares two objects for equality. - An object to compare to the current object. - true if the current object is equal to the object specified by the other parameter; otherwise, false. - - - Exports the current object to a byte array in a format described by one of the values. - One of the values that describes how to format the output data. - An array of bytes that represents the current object. - A value other than , , or was passed to the contentType parameter. -or- The certificate could not be exported. - - - Exports the current object to a byte array using the specified format and a password. - One of the values that describes how to format the output data. - The password required to access the X.509 certificate data. - A byte array that represents the current object. - A value other than , , or was passed to the contentType parameter. -or- The certificate could not be exported. - - - Exports the current object to a byte array in a format described by one of the values, and using the specified password. - One of the values that describes how to format the output data. - The password required to access the X.509 certificate data. - An array of bytes that represents the current object. - A value other than , , or was passed to the contentType parameter. -or- The certificate could not be exported. - - - Converts the specified date and time to a string. - The date and time to convert. - A string representation of the value of the object. - - - Returns the hash value for the X.509v3 certificate as an array of bytes. - The hash value for the X.509 certificate. - - - Returns the SHA1 hash value for the X.509v3 certificate as a hexadecimal string. - The hexadecimal string representation of the X.509 certificate hash value. - - - Returns the effective date of this X.509v3 certificate. - The effective date for this X.509 certificate. - - - Returns the expiration date of this X.509v3 certificate. - The expiration date for this X.509 certificate. - - - Returns the name of the format of this X.509v3 certificate. - The format of this X.509 certificate. - - - Returns the hash code for the X.509v3 certificate as an integer. - The hash code for the X.509 certificate as an integer. - - - Returns the name of the certification authority that issued the X.509v3 certificate. - The name of the certification authority that issued the X.509 certificate. - An error with the certificate occurs. For example: The certificate file does not exist. The certificate is invalid. The certificate's password is incorrect. - - - Returns the key algorithm information for this X.509v3 certificate as a string. - The key algorithm information for this X.509 certificate as a string. - The certificate context is invalid. - - - Returns the key algorithm parameters for the X.509v3 certificate as an array of bytes. - The key algorithm parameters for the X.509 certificate as an array of bytes. - The certificate context is invalid. - - - Returns the key algorithm parameters for the X.509v3 certificate as a hexadecimal string. - The key algorithm parameters for the X.509 certificate as a hexadecimal string. - The certificate context is invalid. - - - Returns the name of the principal to which the certificate was issued. - The name of the principal to which the certificate was issued. - The certificate context is invalid. - - - Returns the public key for the X.509v3 certificate as an array of bytes. - The public key for the X.509 certificate as an array of bytes. - The certificate context is invalid. - - - Returns the public key for the X.509v3 certificate as a hexadecimal string. - The public key for the X.509 certificate as a hexadecimal string. - - - Returns the raw data for the entire X.509v3 certificate as an array of bytes. - A byte array containing the X.509 certificate data. - - - Returns the raw data for the entire X.509v3 certificate as a hexadecimal string. - The X.509 certificate data as a hexadecimal string. - - - Returns the serial number of the X.509v3 certificate as an array of bytes. - The serial number of the X.509 certificate as an array of bytes. - The certificate context is invalid. - - - Returns the serial number of the X.509v3 certificate as a hexadecimal string. - The serial number of the X.509 certificate as a hexadecimal string. - - - Gets a handle to a Microsoft Cryptographic API certificate context described by an unmanaged PCCERT_CONTEXT structure. - An structure that represents an unmanaged PCCERT_CONTEXT structure. - - - Populates the object with data from a byte array. - A byte array containing data from an X.509 certificate. - The rawData parameter is null. -or- The length of the rawData parameter is 0. - - - Populates the object with information from a certificate file. - The name of a certificate file represented as a string. - The fileName parameter is null. - - - Populates an object using data from a byte array, a password, and a key storage flag. - A byte array that contains data from an X.509 certificate. - The password required to access the X.509 certificate data. - A bitwise combination of the enumeration values that control where and how to import the certificate. - The rawData parameter is null. -or- The length of the rawData parameter is 0. - - - Populates the object using data from a byte array, a password, and flags for determining how the private key is imported. - A byte array containing data from an X.509 certificate. - The password required to access the X.509 certificate data. - A bitwise combination of the enumeration values that control where and how to import the certificate. - The rawData parameter is null. -or- The length of the rawData parameter is 0. - - - Populates an object with information from a certificate file, a password, and a key storage flag. - The name of a certificate file. - The password required to access the X.509 certificate data. - A bitwise combination of the enumeration values that control where and how to import the certificate. - The fileName parameter is null. - - - Populates the object with information from a certificate file, a password, and a value. - The name of a certificate file represented as a string. - The password required to access the X.509 certificate data. - A bitwise combination of the enumeration values that control where and how to import the certificate. - The fileName parameter is null. - - - Gets the name of the certificate authority that issued the X.509v3 certificate. - The name of the certificate authority that issued the X.509v3 certificate. - The certificate handle is invalid. - - - Resets the state of the object. - - - Gets the subject distinguished name from the certificate. - The subject distinguished name from the certificate. - The certificate handle is invalid. - - - Returns a string representation of the current object. - A string representation of the current object. - - - Returns a string representation of the current object, with extra information, if specified. - true to produce the verbose form of the string representation; otherwise, false. - A string representation of the current object. - - - Implements the interface and is called back by the deserialization event when deserialization is complete. - The source of the deserialization event. - - - Gets serialization information with all the data needed to recreate an instance of the current object. - The object to populate with serialization information. - The destination context of the serialization. - - - Represents an X.509 certificate. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class using a certificate file name, a password used to access the certificate, and a key storage flag. - The name of a certificate file. - The password required to access the X.509 certificate data. - A bitwise combination of the enumeration values that control where and how to import the certificate. - An error with the certificate occurs. For example: The certificate file does not exist. The certificate is invalid. The certificate's password is incorrect. - - - Initializes a new instance of the class using a certificate file name, a password, and a key storage flag. - The name of a certificate file. - The password required to access the X.509 certificate data. - A bitwise combination of the enumeration values that control where and how to import the certificate. - An error with the certificate occurs. For example: The certificate file does not exist. The certificate is invalid. The certificate's password is incorrect. - - - Initializes a new instance of the class using a byte array, a password, and a key storage flag. - A byte array containing data from an X.509 certificate. - The password required to access the X.509 certificate data. - A bitwise combination of the enumeration values that control where and how to import the certificate. - An error with the certificate occurs. For example: The certificate file does not exist. The certificate is invalid. The certificate's password is incorrect. - - - Initializes a new instance of the class using a certificate file name and a password used to access the certificate. - The name of a certificate file. - The password required to access the X.509 certificate data. - An error with the certificate occurs. For example: The certificate file does not exist. The certificate is invalid. The certificate's password is incorrect. - - - Initializes a new instance of the class using a certificate file name and a password. - The name of a certificate file. - The password required to access the X.509 certificate data. - An error with the certificate occurs. For example: The certificate file does not exist. The certificate is invalid. The certificate's password is incorrect. - - - Initializes a new instance of the class using the specified serialization and stream context information. - The serialization information required to deserialize the new . - Contextual information about the source of the stream to be deserialized. - - - Initializes a new instance of the class using a byte array, a password, and a key storage flag. - A byte array that contains data from an X.509 certificate. - The password required to access the X.509 certificate data. - A bitwise combination of the enumeration values that control where and how to import the certificate. - An error with the certificate occurs. For example: The certificate file does not exist. The certificate is invalid. The certificate's password is incorrect. - - - Initializes a new instance of the class using a byte array and a password. - A byte array that contains data from an X.509 certificate. - The password required to access the X.509 certificate data. - An error with the certificate occurs. For example: The certificate file does not exist. The certificate is invalid. The certificate's password is incorrect. - - - Initializes a new instance of the class using a certificate file name. - The name of a certificate file. - An error with the certificate occurs. For example: The certificate file does not exist. The certificate is invalid. The certificate's password is incorrect. - - - Initializes a new instance of the class using an object. - An object. - An error with the certificate occurs. For example: The certificate file does not exist. The certificate is invalid. The certificate's password is incorrect. - - - Initializes a new instance of the class using an unmanaged handle. - A pointer to a certificate context in unmanaged code. The C structure is called PCCERT_CONTEXT. - An error with the certificate occurs. For example: The certificate file does not exist. The certificate is invalid. The certificate's password is incorrect. - - - Initializes a new instance of the class using information from a byte array. - A byte array containing data from an X.509 certificate. - An error with the certificate occurs. For example: The certificate file does not exist. The certificate is invalid. The certificate's password is incorrect. - - - Initializes a new instance of the class using a byte array and a password. - A byte array containing data from an X.509 certificate. - The password required to access the X.509 certificate data. - An error with the certificate occurs. For example: The certificate file does not exist. The certificate is invalid. The certificate's password is incorrect. - - - Gets or sets a value indicating that an X.509 certificate is archived. - true if the certificate is archived, false if the certificate is not archived. - The certificate is unreadable. - - - Gets a collection of objects. - An object. - The certificate is unreadable. - - - Gets or sets the associated alias for a certificate. - The certificate's friendly name. - The certificate is unreadable. - - - Indicates the type of certificate contained in a file. - The name of a certificate file. - An object. - fileName is null. - - - Indicates the type of certificate contained in a byte array. - A byte array containing data from an X.509 certificate. - An object. - rawData has a zero length or is null. - - - Gets the subject and issuer names from a certificate. - The value for the subject. - true to include the issuer name; otherwise, false. - The name of the certificate. - - - Gets a value that indicates whether an object contains a private key. - true if the object contains a private key; otherwise, false. - The certificate context is invalid. - - - Populates an object with data from a byte array. - A byte array containing data from an X.509 certificate. - - - Populates an object with information from a certificate file. - The name of a certificate. - - - Populates an object using data from a byte array, a password, and a key storage flag. - A byte array that contains data from an X.509 certificate. - The password required to access the X.509 certificate data. - A bitwise combination of the enumeration values that control where and how to import the certificate. - - - Populates an object using data from a byte array, a password, and flags for determining how to import the private key. - A byte array containing data from an X.509 certificate. - The password required to access the X.509 certificate data. - A bitwise combination of the enumeration values that control where and how to import the certificate. - - - Populates an object with information from a certificate file, a password, and a key storage flag. - The name of a certificate file. - The password required to access the X.509 certificate data. - A bitwise combination of the enumeration values that control where and how to import the certificate. - - - Populates an object with information from a certificate file, a password, and a value. - The name of a certificate file. - The password required to access the X.509 certificate data. - A bitwise combination of the enumeration values that control where and how to import the certificate. - - - Gets the distinguished name of the certificate issuer. - An object that contains the name of the certificate issuer. - The certificate context is invalid. - - - Gets the date in local time after which a certificate is no longer valid. - A object that represents the expiration date for the certificate. - The certificate is unreadable. - - - Gets the date in local time on which a certificate becomes valid. - A object that represents the effective date of the certificate. - The certificate is unreadable. - - - Gets or sets the object that represents the private key associated with a certificate. - An object, which is either an RSA or DSA cryptographic service provider. - The key value is not an RSA or DSA key, or the key is unreadable. - The value being set for this property is null. - The key algorithm for this private key is not supported. - The X.509 keys do not match. - The cryptographic service provider key is null. - - - Gets a object associated with a certificate. - A object. - The key value is not an RSA or DSA key, or the key is unreadable. - - - Gets the raw data of a certificate. - The raw data of the certificate as a byte array. - - - Resets the state of an object. - - - Gets the serial number of a certificate. - The serial number of the certificate. - - - Gets the algorithm used to create the signature of a certificate. - Returns the object identifier () of the signature algorithm. - The certificate is unreadable. - - - Gets the subject distinguished name from a certificate. - An object that represents the name of the certificate subject. - The certificate context is invalid. - - - Gets the thumbprint of a certificate. - The thumbprint of the certificate. - - - Displays an X.509 certificate in text format. - The certificate information. - - - Displays an X.509 certificate in text format. - true to display the public key, private key, extensions, and so forth; false to display information that is similar to the class, including thumbprint, serial number, subject and issuer names, and so on. - The certificate information. - - - Performs a X.509 chain validation using basic validation policy. - true if the validation succeeds; false if the validation fails. - The certificate is unreadable. - - - Gets the X.509 format version of a certificate. - The certificate format. - The certificate is unreadable. - - - Represents a collection of objects. This class cannot be inherited. - - - Initializes a new instance of the class without any information. - - - Initializes a new instance of the class using an object. - An object to start the collection from. - - - Initializes a new instance of the class using an array of objects. - An array of objects. - - - Initializes a new instance of the class using the specified certificate collection. - An object. - - - Adds an object to the end of the . - An X.509 certificate represented as an object. - The index at which the certificate has been added. - certificate is null. - - - Adds multiple objects in an array to the object. - An array of objects. - certificates is null. - - - Adds multiple objects in an object to another object. - An object. - certificates is null. - - - Determines whether the object contains a specific certificate. - The object to locate in the collection. - true if the contains the specified certificate; otherwise, false. - certificate is null. - - - Exports X.509 certificate information into a byte array. - A supported object. - X.509 certificate information in a byte array. - - - Exports X.509 certificate information into a byte array using a password. - A supported object. - A string used to protect the byte array. - X.509 certificate information in a byte array. - The certificate is unreadable, the content is invalid or, in the case of a certificate requiring a password, the private key could not be exported because the password provided was incorrect. - - - Searches an object using the search criteria specified by the enumeration and the findValue object. - One of the values. - The search criteria as an object. - true to allow only valid certificates to be returned from the search; otherwise, false. - An object. - findType is invalid. - - - Returns an enumerator that can iterate through a object. - An object that can iterate through the object. - - - Imports a certificate in the form of a byte array into a object. - A byte array containing data from an X.509 certificate. - - - Imports a certificate file into a object. - The name of the file containing the certificate information. - - - Imports a certificate, in the form of a byte array that requires a password to access the certificate, into a object. - A byte array containing data from an object. - The password required to access the certificate information. - A bitwise combination of the enumeration values that control how and where the certificate is imported. - - - Imports a certificate file that requires a password into a object. - The name of the file containing the certificate information. - The password required to access the certificate information. - A bitwise combination of the enumeration values that control how and where the certificate is imported. - - - Inserts an object into the object at the specified index. - The zero-based index at which to insert certificate. - The object to insert. - index is less than zero. -or- index is greater than the property. - The collection is read-only. -or- The collection has a fixed size. - certificate is null. - - - Gets or sets the element at the specified index. - The zero-based index of the element to get or set. - The element at the specified index. - index is less than zero. -or- index is equal to or greater than the property. - index is null. - - - Removes the first occurrence of a certificate from the object. - The object to be removed from the object. - certificate is null. - - - Removes multiple objects in an array from an object. - An array of objects. - certificates is null. - - - Removes multiple objects in an object from another object. - An object. - certificates is null. - - - Supports a simple iteration over a object. This class cannot be inherited. - - - Gets the current element in the object. - The current element in the object. - The enumerator is positioned before the first element of the collection or after the last element. - - - Advances the enumerator to the next element in the object. - true if the enumerator was successfully advanced to the next element; false if the enumerator has passed the end of the collection. - The collection was modified after the enumerator was created. - - - Sets the enumerator to its initial position, which is before the first element in the object. - The collection was modified after the enumerator was created. - - - For a description of this member, see . - The current element in the object. - The enumerator is positioned before the first element of the collection or after the last element. - - - For a description of this member, see . - true if the enumerator was successfully advanced to the next element; false if the enumerator has passed the end of the collection. - The collection was modified after the enumerator was created. - - - For a description of this member, see . - The collection was modified after the enumerator was created. - - - Enumerates the objects in an . - - - Initializes a new instance of the class for the specified . - The to enumerate. - - - Gets the current in the . - The current in the . - The enumerator is positioned before the first element of the collection or after the last element. - - - Advances the enumerator to the next element of the collection. - true if the enumerator was successfully advanced to the next element; false if the enumerator has passed the end of the collection. - The collection was modified after the enumerator was instantiated. - - - Sets the enumerator to its initial position, which is before the first element in the collection. - The collection is modified after the enumerator is instantiated. - - - For a description of this member, see . - The current X.509 certificate object in the object. - The enumerator is positioned before the first element of the collection or after the last element. - - - For a description of this member, see . - true if the enumerator was successfully advanced to the next element; false if the enumerator has passed the end of the collection. - The collection was modified after the enumerator was instantiated. - - - For a description of this member, see . - The collection was modified after the enumerator was instantiated. - - - Defines a collection that stores objects. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class from an array of objects. - The array of objects with which to initialize the new object. - - - Initializes a new instance of the class from another . - The with which to initialize the new object. - - - Adds an with the specified value to the current . - The to add to the current . - The index into the current at which the new was inserted. - - - Copies the elements of an array of type to the end of the current . - The array of type containing the objects to add to the current . - The value parameter is null. - - - Copies the elements of the specified to the end of the current . - The containing the objects to add to the collection. - The value parameter is null. - - - Gets a value indicating whether the current contains the specified . - The to locate. - true if the is contained in this collection; otherwise, false. - - - Copies the values in the current to a one-dimensional instance at the specified index. - The one-dimensional that is the destination of the values copied from . - The index into array to begin copying. - The array parameter is multidimensional. -or- The number of elements in the is greater than the available space between arrayIndex and the end of array. - The array parameter is null. - The arrayIndex parameter is less than the array parameter's lower bound. - - - Returns an enumerator that can iterate through the . - An enumerator of the subelements of you can use to iterate through the collection. - - - Builds a hash value based on all values contained in the current . - A hash value based on all values contained in the current . - - - Returns the index of the specified in the current . - The to locate. - The index of the specified by the value parameter in the , if found; otherwise, -1. - - - Inserts a into the current at the specified index. - The zero-based index where value should be inserted. - The to insert. - - - Gets or sets the entry at the specified index of the current . - The zero-based index of the entry to locate in the current . - The at the specified index of the current . - The index parameter is outside the valid range of indexes for the collection. - - - Removes a specific from the current . - The to remove from the current . - The specified by the value parameter is not found in the current . - - - Represents a chain-building engine for certificates. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class specifying a value that indicates whether the machine context should be used. - true to use the machine context; false to use the current user context. - - - Initializes a new instance of the class using an handle to an X.509 chain. - An handle to an X.509 chain. - The chainContext parameter is null. - The chainContext parameter points to an invalid context. - - - Builds an X.509 chain using the policy specified in . - An object. - true if the X.509 certificate is valid; otherwise, false. - The certificate is not a valid certificate or is null. - The certificate is unreadable. - - - Gets a handle to an X.509 chain. - An handle to an X.509 chain. - - - Gets a collection of objects. - An object. - - - Gets or sets the to use when building an X.509 certificate chain. - The object associated with this X.509 chain. - The value being set for this property is null. - - - Gets the status of each element in an object. - An array of objects. - - - Creates an object after querying for the mapping defined in the CryptoConfig file, and maps the chain to that mapping. - An object. - - - Releases all of the resources used by this . - - - Releases the unmanaged resources used by this , and optionally releases the managed resources. - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - Clears the current object. - - - Gets a safe handle for this instance. - Returns the . - - - Represents an element of an X.509 chain. - - - Gets the X.509 certificate at a particular chain element. - An object. - - - Gets the error status of the current X.509 certificate in a chain. - An array of objects. - - - Gets additional error information from an unmanaged certificate chain structure. - A string representing the pwszExtendedErrorInfo member of the unmanaged CERT_CHAIN_ELEMENT structure in the Crypto API. - - - Represents a collection of objects. This class cannot be inherited. - - - Copies an object into an array, starting at the specified index. - An array of objects. - An integer representing the index value. - The specified index is less than zero, or greater than or equal to the length of the array. - array is null. - index plus the current count is greater than the length of the array. - - - Gets the number of elements in the collection. - An integer representing the number of elements in the collection. - - - Gets an object that can be used to navigate through a collection of chain elements. - An object. - - - Gets a value indicating whether the collection of chain elements is synchronized. - Always returns false. - - - Gets the object at the specified index. - An integer value. - An object. - index is less than zero. - index is greater than or equal to the length of the collection. - - - Gets an object that can be used to synchronize access to an object. - A pointer reference to the current object. - - - Copies an object into an array, starting at the specified index. - An array to copy the object to. - The index of array at which to start copying. - The specified index is less than zero, or greater than or equal to the length of the array. - array is null. - index plus the current count is greater than the length of the array. - - - Gets an object that can be used to navigate a collection of chain elements. - An object. - - - Supports a simple iteration over an . This class cannot be inherited. - - - Gets the current element in the . - The current element in the . - The enumerator is positioned before the first element of the collection or after the last element. - - - Advances the enumerator to the next element in the . - true if the enumerator was successfully advanced to the next element; false if the enumerator has passed the end of the collection. - The collection was modified after the enumerator was created. - - - Sets the enumerator to its initial position, which is before the first element in the . - The collection was modified after the enumerator was created. - - - Gets the current element in the . - The current element in the . - The enumerator is positioned before the first element of the collection or after the last element. - - - Represents the chain policy to be applied when building an X509 certificate chain. This class cannot be inherited. - - - Initializes a new instance of the class. - - - Gets a collection of object identifiers (OIDs) specifying which application policies or enhanced key usages (EKUs) the certificate supports. - An object. - - - Gets a collection of object identifiers (OIDs) specifying which certificate policies the certificate supports. - An object. - - - Represents an additional collection of certificates that can be searched by the chaining engine when validating a certificate chain. - An object. - - - Resets the members to their default values. - - - Gets or sets values for X509 revocation flags. - An object. - The value supplied is not a valid flag. - - - Gets or sets values for X509 certificate revocation mode. - An object. - The value supplied is not a valid flag. - - - Gets the time span that elapsed during online revocation verification or downloading the certificate revocation list (CRL). - A object. - - - Gets verification flags for the certificate. - A value from the enumeration. - The value supplied is not a valid flag. is the default value. - - - The time that the certificate was verified expressed in local time. - A object. - - - Provides a simple structure for storing X509 chain status and error information. - - - Specifies the status of the X509 chain. - An value. - - - Specifies a description of the value. - A localizable string. - - - Defines the status of an X509 chain. - - - Specifies that the certificate trust list (CTL) contains an invalid signature. - - - - Specifies that the certificate trust list (CTL) is not valid because of an invalid time value, such as one that indicates that the CTL has expired. - - - - Specifies that the certificate trust list (CTL) is not valid for this use. - - - - Specifies that the X509 chain could not be built. - - - - Specifies that the certificate is explicitly distrusted. - - - - Specifies that the X509 chain is invalid because a certificate has excluded a name constraint. - - - - Specifies that the certificate has an undefined name constraint. - - - - Specifies that the certificate has an impermissible name constraint. - - - - Specifies that the certificate does not support a critical extension. - - - - Specifies that the certificate does not have a supported name constraint or has a name constraint that is unsupported. - - - - Specifies that the certificate has not been strong signed. Typically, this indicates that the MD2 or MD5 hashing algorithms were used to create a hash of the certificate. - - - - Specifies that the X509 chain is invalid due to invalid basic constraints. - - - - Specifies that the X509 chain is invalid due to an invalid extension. - - - - Specifies that the X509 chain is invalid due to invalid name constraints. - - - - Specifies that the X509 chain is invalid due to invalid policy constraints. - - - - Specifies that the X509 chain has no errors. - - - - Specifies that there is no certificate policy extension in the certificate. This error would occur if a group policy has specified that all certificates must have a certificate policy. - - - - Specifies that the X509 chain is invalid due to an invalid certificate signature. - - - - Deprecated. Specifies that the CA (certificate authority) certificate and the issued certificate have validity periods that are not nested. For example, the CA cert can be valid from January 1 to December 1 and the issued certificate from January 2 to December 2, which would mean the validity periods are not nested. - - - - Specifies that the X509 chain is not valid due to an invalid time value, such as a value that indicates an expired certificate. - - - - Specifies that the key usage is not valid. - - - - Specifies that the online certificate revocation list (CRL) the X509 chain relies on is currently offline. - - - - Specifies that the X509 chain could not be built up to the root certificate. - - - - Specifies that it is not possible to determine whether the certificate has been revoked. This can be due to the certificate revocation list (CRL) being offline or unavailable. - - - - Specifies that the X509 chain is invalid due to a revoked certificate. - - - - Specifies that the X509 chain is invalid due to an untrusted root certificate. - - - - Specifies the format of an X.509 certificate. - - - An Authenticode X.509 certificate. - - - - A single X.509 certificate. - - - - A PFX-formatted certificate. The Pfx value is identical to the Pkcs12 value. - - - - A PKCS #12–formatted certificate. The Pkcs12 value is identical to the Pfx value. - - - - A PKCS #7–formatted certificate. - - - - A single serialized X.509 certificate. - - - - A serialized store. - - - - An unknown X.509 certificate. - - - - Defines the collection of object identifiers (OIDs) that indicates the applications that use the key. This class cannot be inherited. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class using an object and a value that identifies whether the extension is critical. - The encoded data to use to create the extension. - true if the extension is critical; otherwise, false. - - - Initializes a new instance of the class using an and a value that identifies whether the extension is critical. - An collection. - true if the extension is critical; otherwise, false. - The specified contains one or more corrupt values. - - - Initializes a new instance of the class using an object. - The encoded data to use to create the extension. - - - Gets the collection of object identifiers (OIDs) that indicate the applications that use the key. - An object indicating the applications that use the key. - - - Represents an X509 extension. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. - The encoded data to be used to create the extension. - true if the extension is critical; otherwise false. - - - Initializes a new instance of the class. - The object identifier used to identify the extension. - The encoded data used to create the extension. - true if the extension is critical; otherwise false. - oid is null. - oid is an empty string (""). - - - Initializes a new instance of the class. - A string representing the object identifier. - The encoded data used to create the extension. - true if the extension is critical; otherwise false. - - - Copies the extension properties of the specified object. - The to be copied. - asnEncodedData is null. - asnEncodedData does not have a valid X.509 extension. - - - Gets a Boolean value indicating whether the extension is critical. - true if the extension is critical; otherwise, false. - - - Represents a collection of objects. This class cannot be inherited. - - - Initializes a new instance of the class. - - - Adds an object to an object. - An object to add to the object. - The index at which the extension parameter was added. - The value of the extension parameter is null. - - - Copies a collection into an array starting at the specified index. - An array of objects. - The location in the array at which copying starts. - index is a zero-length string or contains an invalid value. - index is null. - index specifies a value that is not in the range of the array. - - - Gets the number of objects in a object. - An integer representing the number of objects in the object. - - - Returns an enumerator that can iterate through an object. - An object to use to iterate through the object. - - - Gets a value indicating whether the collection is guaranteed to be thread safe. - true if the collection is thread safe; otherwise, false. - - - Gets the object at the specified index. - The location of the object to retrieve. - An object. - index is less than zero. - index is equal to or greater than the length of the array. - - - Gets the first object whose value or friendly name is specified by an object identifier (OID). - The object identifier (OID) of the extension to retrieve. - An object. - - - Gets an object that you can use to synchronize access to the object. - An object that you can use to synchronize access to the object. - - - Copies the collection into an array starting at the specified index. - An array of objects. - The location in the array at which copying starts. - index is a zero-length string or contains an invalid value. - index is null. - index specifies a value that is not in the range of the array. - - - Returns an enumerator that can iterate through an object. - An object to use to iterate through the object. - - - Supports a simple iteration over a . This class cannot be inherited. - - - Gets the current element in the . - The current element in the . - The enumerator is positioned before the first element of the collection or after the last element. - - - Advances the enumerator to the next element in the . - true if the enumerator was successfully advanced to the next element; false if the enumerator has passed the end of the collection. - The collection was modified after the enumerator was created. - - - Sets the enumerator to its initial position, which is before the first element in the . - The collection was modified after the enumerator was created. - - - Gets an object from a collection. - The current element in the . - The enumerator is positioned before the first element of the collection or after the last element. - - - Specifies the type of value the method searches for. - - - The findValue parameter for the method must be a string representing either the application policy friendly name or the object identifier (OID, or ) of the certificate. For example, "Encrypting File System" or "1.3.6.1.4.1.311.10.3.4" can be used. For an application that will be localized, the OID value must be used, because the friendly name is localized. - - - - The findValue parameter for the method must be a string representing either the friendly name or the object identifier (OID, or ) of the certificate policy. The best practice is to use the OID, such as "1.3.6.1.4.1.311.10.3.4". For an application that will be localized, the OID must be used, because the friendly name is localized. - - - - The findValue parameter for the method must be a string describing the extension to find. The object identifier (OID) is most commonly used to direct the method to search for all certificates that have an extension matching that OID value. - - - - The findValue parameter for the method must be a string representing the issuer distinguished name of the certificate. This is a more specific search than that provided by the enumeration value. Using the value, the method performs a case-insensitive string comparison for the entire distinguished name. Searching by issuer name is a less precise search. - - - - The findValue parameter for the method must be a string representing the issuer name of the certificate. This is a less specific search than that provided by the enumeration value. Using the value, the method performs a case-insensitive string comparison using the supplied value. For example, if you pass "MyCA" to the method, it will find all certificates with the issuer name containing that string, regardless of other issuer values. - - - - The findValue parameter for the method must be either a string representing the key usage or an integer representing a bit mask containing all the requested key usages. For the string value, only one key usage at a time can be specified, but the method can be used in a cascading sequence to get the intersection of the requested usages. For example, the findValue parameter can be set to "KeyEncipherment" or an integer (0x30 indicates "KeyEncipherment" and "DataEncipherment"). Values of the enumeration can also be used. - - - - The findValue parameter for the method must be a string that represents the serial number of the certificate as displayed by the certificate dialog box, but without the spaces, or as returned by the method. - - - - The findValue parameter for the method must be a string representing the subject distinguished name of the certificate. This is a more specific search than that provided by the enumeration value. Using the value, the method performs a case-insensitive string comparison for the entire distinguished name. Searching by subject name is a less precise search. - - - - The findValue parameter for the method must be a string representing the subject key identifier in hexadecimal, such as "F3E815D45E83B8477B9284113C64EF208E897112", as displayed in the UI. - - - - The findValue parameter for the method must be a string representing the subject name of the certificate. This is a less specific search than that provided by the enumeration value. Using the value, the method performs a case-insensitive string comparison using the supplied value. For example, if you pass "MyCert" to the method, it will find all certificates with the subject name containing that string, regardless of other subject values. Searching by distinguished name is a more precise search. - - - - The findValue parameter for the method must be a string representing the template name of the certificate, such as "ClientAuth". A template name is an X509 version 3 extension that specifies the uses of the certificate. - - - - The findValue parameter for the method must be a string representing the thumbprint of the certificate. - - - - The findValue parameter for the method must be a value in local time. For example, you can find all the certificates that will be valid until the end of the year by eliminating the results of a operation for of the last day of the year from the results of a operation for . - - - - The findValue parameter for the method must be a value in local time. The value does not have to be in the future. For example, you can use to find certificates that became valid in the current year by taking the intersection of the results of a operation for for the last day of last year with the results of a operation for of . - - - - The findValue parameter for the method must be a value in local time. You can use to find all the currently valid certificates. - - - - Specifies how much of the X.509 certificate chain should be included in the X.509 data. - - - Only the end certificate is included in the X.509 chain information. - - - - The entire X.509 chain is included except for the root certificate. - - - - No X.509 chain information is included. - - - - The entire X.509 chain is included. - - - - Defines where and how to import the private key of an X.509 certificate. - - - The default key set is used. The user key set is usually the default. - - - - Imported keys are marked as exportable. - - - - Private keys are stored in the local computer store rather than the current user store. - - - - The key associated with a PFX file is persisted when importing a certificate. - - - - Private keys are stored in the current user store rather than the local computer store. This occurs even if the certificate specifies that the keys should go in the local computer store. - - - - Notify the user through a dialog box or other method that the key is accessed. The Cryptographic Service Provider (CSP) in use defines the precise behavior. - - - - Defines the usage of a key contained within an X.509 certificate. This class cannot be inherited. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class using an object and a value that identifies whether the extension is critical. - The encoded data to use to create the extension. - true if the extension is critical; otherwise, false. - - - Initializes a new instance of the class using the specified value and a value that identifies whether the extension is critical. - One of the values that describes how to use the key. - true if the extension is critical; otherwise, false. - - - Initializes a new instance of the class using an object. - The encoded data to use to create the extension. - - - Gets the key usage flag associated with the certificate. - One of the values. - The extension cannot be decoded. - - - Defines how the certificate key can be used. If this value is not defined, the key can be used for any purpose. - - - The key can be used to sign a certificate revocation list (CRL). - - - - The key can be used for data encryption. - - - - The key can be used for decryption only. - - - - The key can be used as a digital signature. - - - - The key can be used for encryption only. - - - - The key can be used to determine key agreement, such as a key created using the Diffie-Hellman key agreement algorithm. - - - - The key can be used to sign certificates. - - - - The key can be used for key encryption. - - - - No key usage parameters. - - - - The key can be used for authentication. - - - - Specifies the type of name the X509 certificate contains. - - - The DNS name associated with the alternative name of either the subject or the issuer of an X.509 certificate. This value is equivalent to the value. - - - - The DNS name associated with the alternative name of either the subject or issuer of an X509 certificate. - - - - The email address of the subject or issuer associated of an X509 certificate. - - - - The simple name of a subject or issuer of an X509 certificate. - - - - The UPN name of the subject or issuer of an X509 certificate. - - - - The URL address associated with the alternative name of either the subject or issuer of an X509 certificate. - - - - Specifies which X509 certificates in the chain should be checked for revocation. - - - Only the end certificate is checked for revocation. - - - - The entire chain of certificates is checked for revocation. - - - - The entire chain, except the root certificate, is checked for revocation. - - - - Specifies the mode used to check for X509 certificate revocation. - - - No revocation check is performed on the certificate. - - - - A revocation check is made using a cached certificate revocation list (CRL). - - - - A revocation check is made using an online certificate revocation list (CRL). - - - - Represents an X.509 store, which is a physical store where certificates are persisted and managed. This class cannot be inherited. - - - Initializes a new instance of the class using the personal certificates of the current user store. - - - Initializes a new instance of the class using an Intptr handle to an HCERTSTORE store. - A handle to an HCERTSTORE store. - The storeHandle parameter is null. - The storeHandle parameter points to an invalid context. - - - Initializes a new instance of the class using the specified value. - One of the enumeration values that specifies the location of the X.509 certificate store. - - - Initializes a new instance of the class using the specified value. - One of the enumeration values that specifies the name of the X.509 certificate store. - - - Initializes a new instance of the class using the specified store name. - A string value that represents the store name. See for more information. - - - Initializes a new instance of the class using the specified and values. - One of the enumeration values that specifies the name of the X.509 certificate store. - One of the enumeration values that specifies the location of the X.509 certificate store. - storeLocation is not a valid location or storeName is not a valid name. - - - Initializes a new instance of the class using a string that represents a value from the enumeration and a value from the enumeration. - A string that represents a value from the enumeration. - One of the enumeration values that specifies the location of the X.509 certificate store. - storeLocation contains invalid values. - - - Adds a certificate to an X.509 certificate store. - The certificate to add. - certificate is null. - The certificate could not be added to the store. - - - Adds a collection of certificates to an X.509 certificate store. - The collection of certificates to add. - certificates is null. - The caller does not have the required permission. - - - Returns a collection of certificates located in an X.509 certificate store. - A collection of certificates. - - - Closes an X.509 certificate store. - - - Releases the resources used by this . - - - Gets the location of the X.509 certificate store. - The location of the certificate store. - - - Gets the name of the X.509 certificate store. - The name of the certificate store. - - - Opens an X.509 certificate store or creates a new store, depending on flag settings. - A bitwise combination of enumeration values that specifies the way to open the X.509 certificate store. - The store is unreadable. - The caller does not have the required permission. - The store contains invalid values. - - - Removes a certificate from an X.509 certificate store. - The certificate to remove. - certificate is null. - The caller does not have the required permission. - - - Removes a range of certificates from an X.509 certificate store. - A range of certificates to remove. - certificates is null. - The caller does not have the required permission. - - - Gets an handle to an HCERTSTORE store. - A handle to an HCERTSTORE store. - The store is not open. - - - Defines a string that identifies a certificate's subject key identifier (SKI). This class cannot be inherited. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class using a byte array and a value that identifies whether the extension is critical. - A byte array that represents data to use to create the extension. - true if the extension is critical; otherwise, false. - - - Initializes a new instance of the class using encoded data and a value that identifies whether the extension is critical. - The object to use to create the extension. - true if the extension is critical; otherwise, false. - - - Initializes a new instance of the class using a public key and a value indicating whether the extension is critical. - A object to create a subject key identifier (SKI) from. - true if the extension is critical; otherwise, false. - - - Initializes a new instance of the class using a string and a value that identifies whether the extension is critical. - A string, encoded in hexadecimal format, that represents the subject key identifier (SKI) for a certificate. - true if the extension is critical; otherwise, false. - - - Initializes a new instance of the class using a public key, a hash algorithm identifier, and a value indicating whether the extension is critical. - A object to create a subject key identifier (SKI) from. - One of the values that identifies which hash algorithm to use. - true if the extension is critical; otherwise, false. - - - Creates a new instance of the class by copying information from encoded data. - The object to use to create the extension. - - - Gets a string that represents the subject key identifier (SKI) for a certificate. - A string, encoded in hexadecimal format, that represents the subject key identifier (SKI). - The extension cannot be decoded. - - - Defines the type of hash algorithm to use with the class. - - - The subject key identifier (SKI) is composed of a 160-bit SHA-1 hash of the encoded public key (including the tag, length, and number of unused bits). - - - - The SKI is composed of the 160-bit SHA-1 hash of the value of the public key (excluding the tag, length, and number of unused bits). - - - - The SKI is composed of a four-bit type field with the value 0100, followed by the least significant 60 bits of the SHA-1 hash of the value of the public key (excluding the tag, length, and number of unused bit string bits) - - - - Specifies conditions under which verification of certificates in the X509 chain should be conducted. - - - All flags pertaining to verification are included. - - - - Ignore that the chain cannot be verified due to an unknown certificate authority (CA). - - - - Ignore that the certificate authority revocation is unknown when determining certificate verification. - - - - Ignore that the certificate trust list (CTL) is not valid, for reasons such as the CTL has expired, when determining certificate verification. - - - - Ignore that the certificate trust list (CTL) signer revocation is unknown when determining certificate verification. - - - - Ignore that the end certificate (the user certificate) revocation is unknown when determining certificate verification. - - - - Ignore that the basic constraints are not valid when determining certificate verification. - - - - Ignore that the certificate has an invalid name when determining certificate verification. - - - - Ignore that the certificate has invalid policy when determining certificate verification. - - - - Ignore that the CA (certificate authority) certificate and the issued certificate have validity periods that are not nested when verifying the certificate. For example, the CA cert can be valid from January 1 to December 1 and the issued certificate from January 2 to December 2, which would mean the validity periods are not nested. - - - - Ignore certificates in the chain that are not valid either because they have expired or they are not yet in effect when determining certificate validity. - - - - Ignore that the root revocation is unknown when determining certificate verification. - - - - Ignore that the certificate was not issued for the current use when determining certificate verification. - - - - No flags pertaining to verification are included. - - - - Represents a single-precision floating-point number. - - - Compares this instance to a specified object and returns an integer that indicates whether the value of this instance is less than, equal to, or greater than the value of the specified object. - An object to compare, or null. -

A signed number indicating the relative values of this instance and value.

-
Return Value

-

Description

-

Less than zero

-

This instance is less than value.

-

-or-

-

This instance is not a number () and value is a number.

-

Zero

-

This instance is equal to value.

-

-or-

-

This instance and value are both not a number (), , or .

-

Greater than zero

-

This instance is greater than value.

-

-or-

-

This instance is a number and value is not a number ().

-

-or-

-

value is null.

-

-
- value is not a . -
- - Compares this instance to a specified single-precision floating-point number and returns an integer that indicates whether the value of this instance is less than, equal to, or greater than the value of the specified single-precision floating-point number. - A single-precision floating-point number to compare. -

A signed number indicating the relative values of this instance and value.

-
Return Value

-

Description

-

Less than zero

-

This instance is less than value.

-

-or-

-

This instance is not a number () and value is a number.

-

Zero

-

This instance is equal to value.

-

-or-

-

Both this instance and value are not a number (), , or .

-

Greater than zero

-

This instance is greater than value.

-

-or-

-

This instance is a number and value is not a number ().

-

-
-
- - Represents the smallest positive value that is greater than zero. This field is constant. - - - - Returns a value indicating whether this instance is equal to a specified object. - An object to compare with this instance. - true if obj is an instance of and equals the value of this instance; otherwise, false. - - - Returns a value indicating whether this instance and a specified object represent the same value. - An object to compare with this instance. - true if obj is equal to this instance; otherwise, false. - - - Returns the hash code for this instance. - A 32-bit signed integer hash code. - - - Returns the for value type . - The enumerated constant, . - - - Returns a value indicating whether the specified number evaluates to negative or positive infinity. - A single-precision floating-point number. - true if f evaluates to or ; otherwise, false. - - - Returns a value that indicates whether the specified value is not a number (). - A single-precision floating-point number. - true if f evaluates to not a number (); otherwise, false. - - - Returns a value indicating whether the specified number evaluates to negative infinity. - A single-precision floating-point number. - true if f evaluates to ; otherwise, false. - - - Returns a value indicating whether the specified number evaluates to positive infinity. - A single-precision floating-point number. - true if f evaluates to ; otherwise, false. - - - Represents the largest possible value of . This field is constant. - - - - Represents the smallest possible value of . This field is constant. - - - - Represents not a number (NaN). This field is constant. - - - - Represents negative infinity. This field is constant. - - - - Returns a value that indicates whether two specified values are equal. - The first value to compare. - The second value to compare. - true if left and right are equal; otherwise, false. - - - Returns a value that indicates whether a specified value is greater than another specified value. - The first value to compare. - The second value to compare. - true if left is greater than right; otherwise, false. - - - Returns a value that indicates whether a specified value is greater than or equal to another specified value. - The first value to compare. - The second value to compare. - true if left is greater than or equal to right; otherwise, false. - - - Returns a value that indicates whether two specified values are not equal. - The first value to compare. - The second value to compare. - true if left and right are not equal; otherwise, false. - - - Returns a value that indicates whether a specified value is less than another specified value. - The first value to compare. - The second value to compare. - true if left is less than right; otherwise, false. - - - Returns a value that indicates whether a specified value is less than or equal to another specified value. - The first value to compare. - The second value to compare. - true if left is less than or equal to right; otherwise, false. - - - Converts the string representation of a number in a specified culture-specific format to its single-precision floating-point number equivalent. - A string that contains a number to convert. - An object that supplies culture-specific formatting information about s. - A single-precision floating-point number equivalent to the numeric value or symbol specified in s. - s is null. - s does not represent a number in a valid format. - s represents a number less than or greater than . - - - Converts the string representation of a number in a specified style and culture-specific format to its single-precision floating-point number equivalent. - A string that contains a number to convert. - A bitwise combination of enumeration values that indicates the style elements that can be present in s. A typical value to specify is combined with . - An object that supplies culture-specific formatting information about s. - A single-precision floating-point number equivalent to the numeric value or symbol specified in s. - s is null. - s does not represent a numeric value. - style is not a value. -or- style is the value. - s represents a number that is less than or greater than . - - - Converts the string representation of a number to its single-precision floating-point number equivalent. - A string that contains a number to convert. - A single-precision floating-point number equivalent to the numeric value or symbol specified in s. - s is null. - s does not represent a number in a valid format. - s represents a number less than or greater than . - - - Converts the string representation of a number in a specified style to its single-precision floating-point number equivalent. - A string that contains a number to convert. - A bitwise combination of enumeration values that indicates the style elements that can be present in s. A typical value to specify is combined with . - A single-precision floating-point number that is equivalent to the numeric value or symbol specified in s. - s is null. - s is not a number in a valid format. - s represents a number that is less than or greater than . - style is not a value. -or- style includes the value. - - - Represents positive infinity. This field is constant. - - - - Converts the numeric value of this instance to its equivalent string representation using the specified format and culture-specific format information. - A numeric format string. - An object that supplies culture-specific formatting information. - The string representation of the value of this instance as specified by format and provider. - - - Converts the numeric value of this instance to its equivalent string representation, using the specified format. - A numeric format string. - The string representation of the value of this instance as specified by format. - format is invalid. - - - Converts the numeric value of this instance to its equivalent string representation using the specified culture-specific format information. - An object that supplies culture-specific formatting information. - The string representation of the value of this instance as specified by provider. - - - Converts the numeric value of this instance to its equivalent string representation. - The string representation of the value of this instance. - - - Converts the string representation of a number in a specified style and culture-specific format to its single-precision floating-point number equivalent. A return value indicates whether the conversion succeeded or failed. - A string representing a number to convert. - A bitwise combination of enumeration values that indicates the permitted format of s. A typical value to specify is combined with . - An object that supplies culture-specific formatting information about s. - When this method returns, contains the single-precision floating-point number equivalent to the numeric value or symbol contained in s, if the conversion succeeded, or zero if the conversion failed. The conversion fails if the s parameter is null or , is not in a format compliant with style, represents a number less than or greater than , or if style is not a valid combination of enumerated constants. This parameter is passed uninitialized; any value originally supplied in result will be overwritten. - true if s was converted successfully; otherwise, false. - style is not a value. -or- style is the value. - - - Converts the string representation of a number to its single-precision floating-point number equivalent. A return value indicates whether the conversion succeeded or failed. - A string representing a number to convert. - When this method returns, contains single-precision floating-point number equivalent to the numeric value or symbol contained in s, if the conversion succeeded, or zero if the conversion failed. The conversion fails if the s parameter is null or , is not a number in a valid format, or represents a number less than or greater than . This parameter is passed uninitialized; any value originally supplied in result will be overwritten. - true if s was converted successfully; otherwise, false. - - - For a description of this member, see . - This parameter is ignored. - true if the value of the current instance is not zero; otherwise, false. - - - For a description of this member, see . - This parameter is ignored. - The value of the current instance, converted to a . - - - This conversion is not supported. Attempting to use this method throws an . - This parameter is ignored. - This conversion is not supported. No value is returned. - In all cases. - - - This conversion is not supported. Attempting to use this method throws an . - This parameter is ignored. - This conversion is not supported. No value is returned. - In all cases. - - - For a description of this member, see . - This parameter is ignored. - The value of the current instance, converted to a . - - - For a description of this member, see . - This parameter is ignored. - The value of the current instance, converted to a . - - - For a description of this member, see . - This parameter is ignored. - The value of the current instance, converted to an . - - - For a description of this member, see . - This parameter is ignored. - The value of the current instance, converted to an . - - - For a description of this member, see . - This parameter is ignored. - The value of the current instance, converted to an . - - - For a description of this member, see . - This parameter is ignored. - The value of the current instance, converted to an . - - - For a description of this member, see . - This parameter is ignored. - The value of the current instance, unchanged. - - - For a description of this member, see . - The type to which to convert this value. - An object that supplies information about the format of the returned value. - The value of the current instance, converted to type. - - - For a description of this member, see . - This parameter is ignored. - The value of the current instance, converted to a . - - - For a description of this member, see . - This parameter is ignored. - The value of the current instance, converted to a . - - - For a description of this member, see . - This parameter is ignored. - The value of the current instance, converted to a . - - - Represents one or more errors that occur during application execution. - - - Initializes a new instance of the class with a system-supplied message that describes the error. - - - Initializes a new instance of the class with references to the inner exceptions that are the cause of this exception. - The exceptions that are the cause of the current exception. - The innerExceptions argument is null. - An element of innerExceptions is null. - - - Initializes a new instance of the class with references to the inner exceptions that are the cause of this exception. - The exceptions that are the cause of the current exception. - The innerExceptions argument is null. - An element of innerExceptions is null. - - - Initializes a new instance of the class with a specified message that describes the error. - The message that describes the exception. The caller of this constructor is required to ensure that this string has been localized for the current system culture. - - - Initializes a new instance of the class with serialized data. - The object that holds the serialized object data. - The contextual information about the source or destination. - The info argument is null. - The exception could not be deserialized correctly. - - - Initializes a new instance of the class with a specified error message and references to the inner exceptions that are the cause of this exception. - The error message that explains the reason for the exception. - The exceptions that are the cause of the current exception. - The innerExceptions argument is null. - An element of innerExceptions is null. - - - Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. - The message that describes the exception. The caller of this constructor is required to ensure that this string has been localized for the current system culture. - The exception that is the cause of the current exception. If the innerException parameter is not null, the current exception is raised in a catch block that handles the inner exception. - The innerException argument is null. - - - Initializes a new instance of the class with a specified error message and references to the inner exceptions that are the cause of this exception. - The error message that explains the reason for the exception. - The exceptions that are the cause of the current exception. - The innerExceptions argument is null. - An element of innerExceptions is null. - - - Flattens an instances into a single, new instance. - A new, flattened . - - - Returns the that is the root cause of this exception. - Returns the that is the root cause of this exception. - - - Initializes a new instance of the class with serialized data. - The object that holds the serialized object data. - The contextual information about the source or destination. - The info argument is null. - - - Invokes a handler on each contained by this . - The predicate to execute for each exception. The predicate accepts as an argument the to be processed and returns a Boolean to indicate whether the exception was handled. - The predicate argument is null. - An exception contained by this was not handled. - - - Gets a read-only collection of the instances that caused the current exception. - Returns a read-only collection of the instances that caused the current exception. - - - Creates and returns a string representation of the current . - A string representation of the current exception. - - - Provides members for setting and retrieving data about an application's context. - - - Gets the pathname of the base directory that the assembly resolver uses to probe for assemblies. - the pathname of the base directory that the assembly resolver uses to probe for assemblies. - - - Returns the value of the named data element assigned to the current application domain. - The name of the data element. - The value of name, if name identifies a named value; otherwise, null. - - - Sets the value of a switch. - The name of the switch. - The value of the switch. - switchName is null. - switchName is . - - - Gets the name of the framework version targeted by the current application. - The name of the framework version targeted by the current application. - - - Tries to get the value of a switch. - The name of the switch. - When this method returns, contains the value of switchName if switchName was found, or false if switchName was not found. This parameter is passed uninitialized. - true if switchName was set and the isEnabled argument contains the value of the switch; otherwise, false. - switchName is null. - switchName is . - - - Represents an application domain, which is an isolated environment where applications execute. This class cannot be inherited. - - - Appends the specified directory name to the private path list. - The name of the directory to be appended to the private path. - The operation is attempted on an unloaded application domain. - - - Returns the assembly display name after policy has been applied. - The assembly display name, in the form provided by the property. - A string containing the assembly display name after policy has been applied. - - - Occurs when an assembly is loaded. - - - - Occurs when the resolution of an assembly fails. - - - - Gets the base directory that the assembly resolver uses to probe for assemblies. - The base directory that the assembly resolver uses to probe for assemblies. - The operation is attempted on an unloaded application domain. - - - Resets the path that specifies the location of private assemblies to the empty string (""). - The operation is attempted on an unloaded application domain. - - - Resets the list of directories containing shadow copied assemblies to the empty string (""). - The operation is attempted on an unloaded application domain. - - - Creates a new application domain with the specified name. - The friendly name of the domain. - The newly created application domain. - friendlyName is null. - - - Gets the current application domain for the current . - The current application domain. - - - Occurs when an is about to be unloaded. - - - - Gets the directory that the assembly resolver uses to probe for dynamically created assemblies. - The directory that the assembly resolver uses to probe for dynamically created assemblies. - The operation is attempted on an unloaded application domain. - - - Executes the assembly contained in the specified file, using the specified arguments, hash value, and hash algorithm. - The name of the file that contains the assembly to execute. - The arguments to the entry point of the assembly. - Represents the value of the computed hash code. - Represents the hash algorithm used by the assembly manifest. - The value that is returned by the entry point of the assembly. - assemblyFile is null. - assemblyFile is not found. - assemblyFile is not a valid assembly. -or- assemblyFile was compiled with a later version of the common language runtime than the version that is currently loaded. - The operation is attempted on an unloaded application domain. - An assembly or module was loaded twice with two different evidences. - The specified assembly has no entry point. - - - Executes the assembly contained in the specified file, using the specified arguments. - The name of the file that contains the assembly to execute. - The arguments to the entry point of the assembly. - The value that is returned by the entry point of the assembly. - assemblyFile is null. - assemblyFile is not found. - assemblyFile is not a valid assembly. -or- assemblyFile was compiled with a later version of the common language runtime than the version that is currently loaded. - The operation is attempted on an unloaded application domain. - An assembly or module was loaded twice with two different evidences. - The specified assembly has no entry point. - - - Executes the assembly contained in the specified file. - The name of the file that contains the assembly to execute. - The value returned by the entry point of the assembly. - assemblyFile is null. - assemblyFile is not found. - assemblyFile is not a valid assembly. -or- Version 2.0 or later of the common language runtime is currently loaded and assemblyFile was compiled with a later version. - The operation is attempted on an unloaded application domain. - An assembly or module was loaded twice with two different evidences. - The specified assembly has no entry point. - - - Executes an assembly given its display name. - The display name of the assembly. See . - The value returned by the entry point of the assembly. - assemblyName is null. - The assembly specified by assemblyName is not found. - The assembly specified by assemblyName is not a valid assembly. -or- Version 2.0 or later of the common language runtime is currently loaded and assemblyName was compiled with a later version. - The operation is attempted on an unloaded application domain. - The assembly specified by assemblyName was found, but could not be loaded. - The specified assembly has no entry point. - - - Executes the assembly given an , using the specified arguments. - An object representing the name of the assembly. - Command-line arguments to pass when starting the process. - The value that is returned by the entry point of the assembly. - The assembly specified by assemblyName is not found. - The assembly specified by assemblyName was found, but could not be loaded. - The assembly specified by assemblyName is not a valid assembly. -or- assemblyName was compiled with a later version of the common language runtime than the version that is currently loaded. - The operation is attempted on an unloaded application domain. - The specified assembly has no entry point. - - - Executes the assembly given its display name, using the specified arguments. - The display name of the assembly. See . - Command-line arguments to pass when starting the process. - The value that is returned by the entry point of the assembly. - assemblyName is null. - The assembly specified by assemblyName is not found. - The assembly specified by assemblyName was found, but could not be loaded. - The assembly specified by assemblyName is not a valid assembly. -or- assemblyName was compiled with a later version of the common language runtime than the version that is currently loaded. - The operation is attempted on an unloaded application domain. - The specified assembly has no entry point. - - - Occurs when an exception is thrown in managed code, before the runtime searches the call stack for an exception handler in the application domain. - - - - Gets the friendly name of this application domain. - The friendly name of this application domain. - The operation is attempted on an unloaded application domain. - - - Gets the assemblies that have been loaded into the execution context of this application domain. - An array of assemblies in this application domain. - The operation is attempted on an unloaded application domain. - - - Gets the current thread identifier. - A 32-bit signed integer that is the identifier of the current thread. - - - Gets the value stored in the current application domain for the specified name. - The name of a predefined application domain property, or the name of an application domain property you have defined. - The value of the name property, or null if the property does not exist. - name is null. - The operation is attempted on an unloaded application domain. - - - Gets the type of the current instance. - The type of the current instance. - - - Gets an integer that uniquely identifies the application domain within the process. - An integer that identifies the application domain. - - - Gives the an infinite lifetime by preventing a lease from being created. - Always null. - The operation is attempted on an unloaded application domain. - - - Gets a nullable Boolean value that indicates whether any compatibility switches are set, and if so, whether the specified compatibility switch is set. - The compatibility switch to test. - A null reference (Nothing in Visual Basic) if no compatibility switches are set; otherwise, a Boolean value that indicates whether the compatibility switch that is specified by value is set. - - - Returns a value that indicates whether the application domain is the default application domain for the process. - true if the current object represents the default application domain for the process; otherwise, false. - - - Indicates whether this application domain is unloading, and the objects it contains are being finalized by the common language runtime. - true if this application domain is unloading and the common language runtime has started invoking finalizers; otherwise, false. - - - Gets a value that indicates whether assemblies that are loaded into the current application domain execute with full trust. - true if assemblies that are loaded into the current application domain execute with full trust; otherwise, false. - - - Gets a value that indicates whether the current application domain has a set of permissions that is granted to all assemblies that are loaded into the application domain. - true if the current application domain has a homogenous set of permissions; otherwise, false. - - - Loads the with a common object file format (COFF) based image containing an emitted . - An array of type byte that is a COFF-based image containing an emitted assembly. - The loaded assembly. - rawAssembly is null. - rawAssembly is not a valid assembly. -or- Version 2.0 or later of the common language runtime is currently loaded and rawAssembly was compiled with a later version. - The operation is attempted on an unloaded application domain. - An assembly or module was loaded twice with two different evidences. - - - Loads an given its . - An object that describes the assembly to load. - The loaded assembly. - assemblyRef is null. - assemblyRef is not found. - assemblyRef is not a valid assembly. -or- Version 2.0 or later of the common language runtime is currently loaded and assemblyRef was compiled with a later version. - The operation is attempted on an unloaded application domain. - An assembly or module was loaded twice with two different evidences. - - - Loads an given its display name. - The display name of the assembly. See . - The loaded assembly. - assemblyString is null - assemblyString is not found. - assemblyString is not a valid assembly. -or- Version 2.0 or later of the common language runtime is currently loaded and assemblyString was compiled with a later version. - The operation is attempted on an unloaded application domain. - An assembly or module was loaded twice with two different evidences. - - - Loads the with a common object file format (COFF) based image containing an emitted . The raw bytes representing the symbols for the are also loaded. - An array of type byte that is a COFF-based image containing an emitted assembly. - An array of type byte containing the raw bytes representing the symbols for the assembly. - The loaded assembly. - rawAssembly is null. - rawAssembly is not a valid assembly. -or- Version 2.0 or later of the common language runtime is currently loaded and rawAssembly was compiled with a later version. - The operation is attempted on an unloaded application domain. - An assembly or module was loaded twice with two different evidences. - - - Gets or sets a value that indicates whether CPU and memory monitoring of application domains is enabled for the current process. Once monitoring is enabled for a process, it cannot be disabled. - true if monitoring is enabled; otherwise false. - The current process attempted to assign the value false to this property. - - - Gets the number of bytes that survived the last collection and that are known to be referenced by the current application domain. - The number of surviving bytes. - The static (Shared in Visual Basic) property is set to false. - - - Gets the total bytes that survived from the last collection for all application domains in the process. - The total number of surviving bytes for the process. - The static (Shared in Visual Basic) property is set to false. - - - Gets the total size, in bytes, of all memory allocations that have been made by the application domain since it was created, without subtracting memory that has been collected. - The total size of all memory allocations. - The static (Shared in Visual Basic) property is set to false. - - - Gets the total processor time that has been used by all threads while executing in the current application domain, since the process started. - Total processor time for the current application domain. - The static (Shared in Visual Basic) property is set to false. - - - Occurs when the default application domain's parent process exits. - - - - Occurs when the resolution of an assembly fails in the reflection-only context. - - - - Returns the assemblies that have been loaded into the reflection-only context of the application domain. - An array of objects that represent the assemblies loaded into the reflection-only context of the application domain. - An operation is attempted on an unloaded application domain. - - - Gets the path under the base directory where the assembly resolver should probe for private assemblies. - The path under the base directory where the assembly resolver should probe for private assemblies. - The operation is attempted on an unloaded application domain. - - - Occurs when the resolution of a resource fails because the resource is not a valid linked or embedded resource in the assembly. - - - - Establishes the specified directory path as the location where assemblies are shadow copied. - The fully qualified path to the shadow copy location. - The operation is attempted on an unloaded application domain. - - - Assigns the specified value to the specified application domain property. - The name of a user-defined application domain property to create or change. - The value of the property. - The operation is attempted on an unloaded application domain. - - - Establishes the specified directory path as the base directory for subdirectories where dynamically generated files are stored and accessed. - The fully qualified path that is the base directory for subdirectories where dynamic assemblies are stored. - The operation is attempted on an unloaded application domain. - - - Specifies how principal and identity objects should be attached to a thread if the thread attempts to bind to a principal while executing in this application domain. - One of the values that specifies the type of the principal object to attach to threads. - The operation is attempted on an unloaded application domain. - - - Turns on shadow copying. - The operation is attempted on an unloaded application domain. - - - Establishes the specified directory path as the location of assemblies to be shadow copied. - A list of directory names, where each name is separated by a semicolon. - The operation is attempted on an unloaded application domain. - - - Sets the default principal object to be attached to threads if they attempt to bind to a principal while executing in this application domain. - The principal object to attach to threads. - principal is null. - The thread principal has already been set. - The operation is attempted on an unloaded application domain. - - - Gets an indication whether the application domain is configured to shadow copy files. - true if the application domain is configured to shadow copy files; otherwise, false. - The operation is attempted on an unloaded application domain. - - - Obtains a string representation that includes the friendly name of the application domain and any context policies. - A string formed by concatenating the literal string "Name:", the friendly name of the application domain, and either string representations of the context policies or the string "There are no context policies." - The application domain represented by the current has been unloaded. - - - Occurs when the resolution of a type fails. - - - - Occurs when an exception is not caught. - - - - Unloads the specified application domain. - An application domain to unload. - domain is null. - domain could not be unloaded. - An error occurred during the unload process. - - - Supports the structural comparison of collection objects. - - - Determines whether the current collection object precedes, occurs in the same position as, or follows another object in the sort order. - The object to compare with the current instance. - An object that compares members of the current collection object with the corresponding members of other. -

An integer that indicates the relationship of the current collection object to other, as shown in the following table.

-
Return value

-

Description

-

-1

-

The current instance precedes other.

-

0

-

The current instance and other are equal.

-

1

-

The current instance follows other.

-

-
- This instance and other are not the same type. -
- - Defines methods to support the comparison of objects for structural equality. - - - Determines whether an object is structurally equal to the current instance. - The object to compare with the current instance. - An object that determines whether the current instance and other are equal. - true if the two objects are equal; otherwise, false. - - - Returns a hash code for the current instance. - An object that computes the hash code of the current object. - The hash code for the current instance. - - - Provides the base class for a generic collection. - The type of elements in the collection. - - - Initializes a new instance of the class that is empty. - - - Initializes a new instance of the class as a wrapper for the specified list. - The list that is wrapped by the new collection. - list is null. - - - Adds an object to the end of the . - The object to be added to the end of the . The value can be null for reference types. - - - Removes all elements from the . - - - Removes all elements from the . - - - Determines whether an element is in the . - The object to locate in the . The value can be null for reference types. - true if item is found in the ; otherwise, false. - - - Copies the entire to a compatible one-dimensional , starting at the specified index of the target array. - The one-dimensional that is the destination of the elements copied from . The must have zero-based indexing. - The zero-based index in array at which copying begins. - array is null. - index is less than zero. - The number of elements in the source is greater than the available space from index to the end of the destination array. - - - Gets the number of elements actually contained in the . - The number of elements actually contained in the . - - - Returns an enumerator that iterates through the . - An for the . - - - Searches for the specified object and returns the zero-based index of the first occurrence within the entire . - The object to locate in the . The value can be null for reference types. - The zero-based index of the first occurrence of item within the entire , if found; otherwise, -1. - - - Inserts an element into the at the specified index. - The zero-based index at which item should be inserted. - The object to insert. The value can be null for reference types. - index is less than zero. -or- index is greater than . - - - Inserts an element into the at the specified index. - The zero-based index at which item should be inserted. - The object to insert. The value can be null for reference types. - index is less than zero. -or- index is greater than . - - - Gets or sets the element at the specified index. - The zero-based index of the element to get or set. - The element at the specified index. - index is less than zero. -or- index is equal to or greater than . - - - Gets a wrapper around the . - A wrapper around the . - - - Removes the first occurrence of a specific object from the . - The object to remove from the . The value can be null for reference types. - true if item is successfully removed; otherwise, false. This method also returns false if item was not found in the original . - - - Removes the element at the specified index of the . - The zero-based index of the element to remove. - index is less than zero. -or- index is equal to or greater than . - - - Removes the element at the specified index of the . - The zero-based index of the element to remove. - index is less than zero. -or- index is equal to or greater than . - - - Replaces the element at the specified index. - The zero-based index of the element to replace. - The new value for the element at the specified index. The value can be null for reference types. - index is less than zero. -or- index is greater than . - - - Gets a value indicating whether the is read-only. - true if the is read-only; otherwise, false. In the default implementation of , this property always returns false. - - - Copies the elements of the to an , starting at a particular index. - The one-dimensional that is the destination of the elements copied from . The must have zero-based indexing. - The zero-based index in array at which copying begins. - array is null. - index is less than zero. - array is multidimensional. -or- array does not have zero-based indexing. -or- The number of elements in the source is greater than the available space from index to the end of the destination array. -or- The type of the source cannot be cast automatically to the type of the destination array. - - - Gets a value indicating whether access to the is synchronized (thread safe). - true if access to the is synchronized (thread safe); otherwise, false. In the default implementation of , this property always returns false. - - - Gets an object that can be used to synchronize access to the . - An object that can be used to synchronize access to the . In the default implementation of , this property always returns the current instance. - - - Returns an enumerator that iterates through a collection. - An that can be used to iterate through the collection. - - - Adds an item to the . - The to add to the . - The position into which the new element was inserted. - value is of a type that is not assignable to the . - - - Determines whether the contains a specific value. - The to locate in the . - true if the is found in the ; otherwise, false. - value is of a type that is not assignable to the . - - - Determines the index of a specific item in the . - The to locate in the . - The index of value if found in the list; otherwise, -1. - value is of a type that is not assignable to the . - - - Inserts an item into the at the specified index. - The zero-based index at which value should be inserted. - The to insert into the . - index is not a valid index in the . - value is of a type that is not assignable to the . - - - Gets a value indicating whether the has a fixed size. - true if the has a fixed size; otherwise, false. In the default implementation of , this property always returns false. - - - Gets a value indicating whether the is read-only. - true if the is read-only; otherwise, false. In the default implementation of , this property always returns false. - - - Gets or sets the element at the specified index. - The zero-based index of the element to get or set. - The element at the specified index. - index is not a valid index in the . - The property is set and value is of a type that is not assignable to the . - - - Removes the first occurrence of a specific object from the . - The to remove from the . - value is of a type that is not assignable to the . - - - Provides the abstract base class for a collection whose keys are embedded in the values. - The type of keys in the collection. - The type of items in the collection. - - - Initializes a new instance of the class that uses the default equality comparer. - - - Initializes a new instance of the class that uses the specified equality comparer. - The implementation of the generic interface to use when comparing keys, or null to use the default equality comparer for the type of the key, obtained from . - - - Initializes a new instance of the class that uses the specified equality comparer and creates a lookup dictionary when the specified threshold is exceeded. - The implementation of the generic interface to use when comparing keys, or null to use the default equality comparer for the type of the key, obtained from . - The number of elements the collection can hold without creating a lookup dictionary (0 creates the lookup dictionary when the first item is added), or –1 to specify that a lookup dictionary is never created. - dictionaryCreationThreshold is less than –1. - - - Changes the key associated with the specified element in the lookup dictionary. - The element to change the key of. - The new key for item. - item is null. -or- key is null. - item is not found. -or- key already exists in the . - - - Removes all elements from the . - - - Gets the generic equality comparer that is used to determine equality of keys in the collection. - The implementation of the generic interface that is used to determine equality of keys in the collection. - - - Determines whether the collection contains an element with the specified key. - The key to locate in the . - true if the contains an element with the specified key; otherwise, false. - key is null. - - - Gets the lookup dictionary of the . - The lookup dictionary of the , if it exists; otherwise, null. - - - When implemented in a derived class, extracts the key from the specified element. - The element from which to extract the key. - The key for the specified element. - - - Inserts an element into the at the specified index. - The zero-based index at which item should be inserted. - The object to insert. - index is less than 0. -or- index is greater than . - - - Gets the element with the specified key. - The key of the element to get. - The element with the specified key. If an element with the specified key is not found, an exception is thrown. - key is null. - An element with the specified key does not exist in the collection. - - - Removes the element with the specified key from the . - The key of the element to remove. - true if the element is successfully removed; otherwise, false. This method also returns false if key is not found in the . - key is null. - - - Removes the element at the specified index of the . - The index of the element to remove. - - - Replaces the item at the specified index with the specified item. - The zero-based index of the item to be replaced. - The new item. - - - Represents a dynamic data collection that provides notifications when items get added, removed, or when the whole list is refreshed. - The type of elements in the collection. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class that contains elements copied from the specified collection. - The collection from which the elements are copied. - The collection parameter cannot be null. - - - Initializes a new instance of the class that contains elements copied from the specified list. - The list from which the elements are copied. - The list parameter cannot be null. - - - Disallows reentrant attempts to change this collection. - An object that can be used to dispose of the object. - - - Checks for reentrant attempts to change this collection. - If there was a call to of which the return value has not yet been disposed of. Typically, this means when there are additional attempts to change this collection during a event. However, it depends on when derived classes choose to call . - - - Removes all items from the collection. - - - Occurs when an item is added, removed, changed, moved, or the entire list is refreshed. - - - - Inserts an item into the collection at the specified index. - The zero-based index at which item should be inserted. - The object to insert. - - - Moves the item at the specified index to a new location in the collection. - The zero-based index specifying the location of the item to be moved. - The zero-based index specifying the new location of the item. - - - Moves the item at the specified index to a new location in the collection. - The zero-based index specifying the location of the item to be moved. - The zero-based index specifying the new location of the item. - - - Raises the event with the provided arguments. - Arguments of the event being raised. - - - Raises the event with the provided arguments. - Arguments of the event being raised. - - - Occurs when a property value changes. - - - - Removes the item at the specified index of the collection. - The zero-based index of the element to remove. - - - Replaces the element at the specified index. - The zero-based index of the element to replace. - The new value for the element at the specified index. - - - Provides the base class for a generic read-only collection. - The type of elements in the collection. - - - Initializes a new instance of the class that is a read-only wrapper around the specified list. - The list to wrap. - list is null. - - - Determines whether an element is in the . - The object to locate in the . The value can be null for reference types. - true if value is found in the ; otherwise, false. - - - Copies the entire to a compatible one-dimensional , starting at the specified index of the target array. - The one-dimensional that is the destination of the elements copied from . The must have zero-based indexing. - The zero-based index in array at which copying begins. - array is null. - index is less than zero. - The number of elements in the source is greater than the available space from index to the end of the destination array. - - - Gets the number of elements contained in the instance. - The number of elements contained in the instance. - - - Returns an enumerator that iterates through the . - An for the . - - - Searches for the specified object and returns the zero-based index of the first occurrence within the entire . - The object to locate in the . The value can be null for reference types. - The zero-based index of the first occurrence of item within the entire , if found; otherwise, -1. - - - Gets the element at the specified index. - The zero-based index of the element to get. - The element at the specified index. - index is less than zero. -or- index is equal to or greater than . - - - Returns the that the wraps. - The that the wraps. - - - Adds an item to the . This implementation always throws . - The object to add to the . - Always thrown. - - - Removes all items from the . This implementation always throws . - Always thrown. - - - Gets a value indicating whether the is read-only. - true if the is read-only; otherwise, false. In the default implementation of , this property always returns true. - - - Removes the first occurrence of a specific object from the . This implementation always throws . - The object to remove from the . - true if value was successfully removed from the ; otherwise, false. - Always thrown. - - - Inserts an item to the at the specified index. This implementation always throws . - The zero-based index at which value should be inserted. - The object to insert into the . - Always thrown. - - - Gets the element at the specified index. An occurs if you try to set the item at the specified index. - The zero-based index of the element to get. - The element at the specified index. - Always thrown if the property is set. - - - Removes the item at the specified index. This implementation always throws . - The zero-based index of the item to remove. - Always thrown. - - - Copies the elements of the to an , starting at a particular index. - The one-dimensional that is the destination of the elements copied from . The must have zero-based indexing. - The zero-based index in array at which copying begins. - array is null. - index is less than zero. - array is multidimensional. -or- array does not have zero-based indexing. -or- The number of elements in the source is greater than the available space from index to the end of the destination array. -or- The type of the source cannot be cast automatically to the type of the destination array. - - - Gets a value indicating whether access to the is synchronized (thread safe). - true if access to the is synchronized (thread safe); otherwise, false. In the default implementation of , this property always returns false. - - - Gets an object that can be used to synchronize access to the . - An object that can be used to synchronize access to the . In the default implementation of , this property always returns the current instance. - - - Returns an enumerator that iterates through a collection. - An that can be used to iterate through the collection. - - - Adds an item to the . This implementation always throws . - The to add to the . - The position into which the new element was inserted. - Always thrown. - - - Removes all items from the . This implementation always throws . - Always thrown. - - - Determines whether the contains a specific value. - The to locate in the . - true if the is found in the ; otherwise, false. - value is not of the type specified for the generic type parameter T. - - - Determines the index of a specific item in the . - The to locate in the . - The index of value if found in the list; otherwise, -1. - value is not of the type specified for the generic type parameter T. - - - Inserts an item to the at the specified index. This implementation always throws . - The zero-based index at which value should be inserted. - The to insert into the . - Always thrown. - - - Gets a value indicating whether the has a fixed size. - true if the has a fixed size; otherwise, false. In the default implementation of , this property always returns true. - - - Gets a value indicating whether the is read-only. - true if the is read-only; otherwise, false. In the default implementation of , this property always returns true. - - - Gets the element at the specified index. A occurs if you try to set the item at the specified index. - The zero-based index of the element to get. - The element at the specified index. - index is not a valid index in the . - Always thrown if the property is set. - - - Removes the first occurrence of a specific object from the . This implementation always throws . - The to remove from the . - Always thrown. - - - Removes the item at the specified index. This implementation always throws . - The zero-based index of the item to remove. - Always thrown. - - - Represents a read-only collection of the keys of a object. - - - - - Copies the elements of the collection to an array, starting at a specific array index. - The one-dimensional array that is the destination of the elements copied from the collection. The array must have zero-based indexing. - The zero-based index in array at which copying begins. - array is null. - arrayIndex is less than 0. - array is multidimensional. -or- The number of elements in the source collection is greater than the available space from arrayIndex to the end of the destination array. -or- Type T cannot be cast automatically to the type of the destination array. - - - Gets the number of elements in the collection. - The number of elements in the collection. - - - Returns an enumerator that iterates through the collection. - An enumerator that can be used to iterate through the collection. - - - Throws a exception in all cases. - The object to add to the collection. - In all cases. - - - Throws a exception in all cases. - In all cases. - - - Determines whether the collection contains a specific value. - The object to locate in the collection. - true if item is found in the collection; otherwise, false. - - - Gets a value that indicates whether the dictionary is read-only. - true in all cases. - - - Throws a exception in all cases. - The object to remove from the collection. - true if item was successfully removed from the collection; otherwise, false. This method also returns false if item is not found in the original collection. - In all cases. - - - Copies the elements of the collection to an array, starting at a specific array index. - The one-dimensional array that is the destination of the elements copied from the collection. The array must have zero-based indexing. - The zero-based index in array at which copying begins. - array is null. - index is less than 0. - array is multidimensional. -or- The number of elements in the source collection is greater than the available space from index to the end of the destination array. - - - Gets a value that indicates whether access to the collection is synchronized (thread safe). - true if access to the collection is synchronized (thread safe); otherwise, false. - - - Gets an object that can be used to synchronize access to the collection. - An object that can be used to synchronize access to the collection. - - - Returns an enumerator that iterates through the collection. - An enumerator that can be used to iterate through the collection. - - - Represents a read-only collection of the values of a object. - - - - - Copies the elements of the collection to an array, starting at a specific array index. - The one-dimensional array that is the destination of the elements copied from the collection. The array must have zero-based indexing. - The zero-based index in array at which copying begins. - array is null. - arrayIndex is less than 0. - array is multidimensional. -or- The number of elements in the source collection is greater than the available space from arrayIndex to the end of the destination array. -or- Type T cannot be cast automatically to the type of the destination array. - - - Gets the number of elements in the collection. - The number of elements in the collection. - - - Returns an enumerator that iterates through the collection. - An enumerator that can be used to iterate through the collection. - - - Throws a exception in all cases. - The object to add to the collection. - In all cases. - - - Throws a exception in all cases. - In all cases. - - - Determines whether the collection contains a specific value. - The object to locate in the collection. - true if item is found in the collection; otherwise, false. - - - Gets a value that indicates whether the collection is read-only. - true in all cases. - - - Throws a exception in all cases. - The object to remove from the collection. - true if item was successfully removed from the collection; otherwise, false. This method also returns false if item is not found in the original collection. - In all cases. - - - Copies the elements of the collection to an array, starting at a specific array index. - The one-dimensional array that is the destination of the elements copied from the collection. The array must have zero-based indexing. - The zero-based index in array at which copying begins. - array is null. - index is less than 0. - array is multidimensional. -or- The number of elements in the source collection is greater than the available space from index to the end of the destination array. - - - Gets a value that indicates whether access to the collection is synchronized (thread safe). - true if access to the collection is synchronized (thread safe); otherwise, false. - - - Gets an object that can be used to synchronize access to the collection. - An object that can be used to synchronize access to the collection. - - - Returns an enumerator that iterates through the collection. - An enumerator that can be used to iterate through the collection. - - - Represents a read-only, generic collection of key/value pairs. - The type of keys in the dictionary. - The type of values in the dictionary. - - - Initializes a new instance of the class that is a wrapper around the specified dictionary. - The dictionary to wrap. - - - Determines whether the dictionary contains an element that has the specified key. - The key to locate in the dictionary. - true if the dictionary contains an element that has the specified key; otherwise, false. - - - Gets the number of items in the dictionary. - The number of items in the dictionary. - - - Gets the dictionary that is wrapped by this object. - The dictionary that is wrapped by this object. - - - Returns an enumerator that iterates through the . - An enumerator that can be used to iterate through the collection. - - - Gets the element that has the specified key. - The key of the element to get. - The element that has the specified key. - key is null. - The property is retrieved and key is not found. - - - Gets a key collection that contains the keys of the dictionary. - A key collection that contains the keys of the dictionary. - - - Retrieves the value that is associated with the specified key. - The key whose value will be retrieved. - When this method returns, the value associated with the specified key, if the key is found; otherwise, the default value for the type of the value parameter. This parameter is passed uninitialized. - true if the object that implements contains an element with the specified key; otherwise, false. - - - Gets a collection that contains the values in the dictionary. - A collection that contains the values in the object that implements . - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Copies the elements of the dictionary to an array, starting at the specified array index. - The one-dimensional array that is the destination of the elements copied from the dictionary. The array must have zero-based indexing. - The zero-based index in array at which copying begins. - array is null. - index is less than zero. - array is multidimensional. -or- The number of elements in the source dictionary is greater than the available space from index to the end of the destination array. -or- The type of the source dictionary cannot be cast automatically to the type of the destination array. - - - Gets a value that indicates whether access to the dictionary is synchronized (thread safe). - true if access to the dictionary is synchronized (thread safe); otherwise, false. - - - Gets an object that can be used to synchronize access to the dictionary. - An object that can be used to synchronize access to the dictionary. - - - Throws a exception in all cases. - The key of the element to add. - The value of the element to add. - In all cases. - - - Throws a exception in all cases. - In all cases. - - - Determines whether the dictionary contains an element that has the specified key. - The key to locate in the dictionary. - true if the dictionary contains an element that has the specified key; otherwise, false. - key is null. - - - Returns an enumerator for the dictionary. - An enumerator for the dictionary. - - - Gets a value that indicates whether the dictionary has a fixed size. - true if the dictionary has a fixed size; otherwise, false. - - - Gets a value that indicates whether the dictionary is read-only. - true in all cases. - - - Gets the element that has the specified key. - The key of the element to get or set. - The element that has the specified key. - key is null. - The property is set. -or- The property is set, key does not exist in the collection, and the dictionary has a fixed size. - - - Gets a collection that contains the keys of the dictionary. - A collection that contains the keys of the dictionary. - - - Throws a exception in all cases. - The key of the element to remove. - In all cases. - - - Gets a collection that contains the values in the dictionary. - A collection that contains the values in the dictionary. - - - Returns an enumerator that iterates through a collection. - An enumerator that can be used to iterate through the collection. - - - Represents a read-only . - The type of elements in the collection. - - - Initializes a new instance of the class that serves as a wrapper around the specified . - The with which to create this instance of the class. - list is null. - - - Occurs when an item is added or removed. - - - - Raises the event using the provided arguments. - Arguments of the event being raised. - - - Raises the event using the provided arguments. - Arguments of the event being raised. - - - Occurs when a property value changes. - - - - Represents a first-in, first-out collection of objects. - - - Initializes a new instance of the class that is empty, has the default initial capacity, and uses the default growth factor. - - - Initializes a new instance of the class that contains elements copied from the specified collection, has the same initial capacity as the number of elements copied, and uses the default growth factor. - The to copy elements from. - col is null. - - - Initializes a new instance of the class that is empty, has the specified initial capacity, and uses the default growth factor. - The initial number of elements that the can contain. - capacity is less than zero. - - - Initializes a new instance of the class that is empty, has the specified initial capacity, and uses the specified growth factor. - The initial number of elements that the can contain. - The factor by which the capacity of the is expanded. - capacity is less than zero. -or- growFactor is less than 1.0 or greater than 10.0. - - - Removes all objects from the . - - - Creates a shallow copy of the . - A shallow copy of the . - - - Determines whether an element is in the . - The to locate in the . The value can be null. - true if obj is found in the ; otherwise, false. - - - Copies the elements to an existing one-dimensional , starting at the specified array index. - The one-dimensional that is the destination of the elements copied from . The must have zero-based indexing. - The zero-based index in array at which copying begins. - array is null. - index is less than zero. - array is multidimensional. -or- The number of elements in the source is greater than the available space from index to the end of the destination array. - The type of the source cannot be cast automatically to the type of the destination array. - - - Gets the number of elements contained in the . - The number of elements contained in the . - - - Removes and returns the object at the beginning of the . - The object that is removed from the beginning of the . - The is empty. - - - Adds an object to the end of the . - The object to add to the . The value can be null. - - - Returns an enumerator that iterates through the . - An for the . - - - Gets a value indicating whether access to the is synchronized (thread safe). - true if access to the is synchronized (thread safe); otherwise, false. The default is false. - - - Returns the object at the beginning of the without removing it. - The object at the beginning of the . - The is empty. - - - Returns a new that wraps the original queue, and is thread safe. - The to synchronize. - A wrapper that is synchronized (thread safe). - queue is null. - - - Gets an object that can be used to synchronize access to the . - An object that can be used to synchronize access to the . - - - Copies the elements to a new array. - A new array containing elements copied from the . - - - Sets the capacity to the actual number of elements in the . - The is read-only. - - - Provides the abstract base class for a strongly typed non-generic read-only collection. - - - Initializes a new instance of the class. - - - Gets the number of elements contained in the instance. - The number of elements contained in the instance. Retrieving the value of this property is an O(1) operation. - - - Returns an enumerator that iterates through the instance. - An for the instance. - - - Gets the list of elements contained in the instance. - An representing the instance itself. - - - Copies the entire to a compatible one-dimensional , starting at the specified index of the target array. - The one-dimensional that is the destination of the elements copied from . The must have zero-based indexing. - The zero-based index in array at which copying begins. - array is null. - index is less than zero. - array is multidimensional. -or- The number of elements in the source is greater than the available space from index to the end of the destination array. - The type of the source cannot be cast automatically to the type of the destination array. - - - Gets a value indicating whether access to a object is synchronized (thread safe). - true if access to the object is synchronized (thread safe); otherwise, false. The default is false. - - - Gets an object that can be used to synchronize access to a object. - An object that can be used to synchronize access to the object. - - - Represents a collection of key/value pairs that are sorted by the keys and are accessible by key and by index. - - - Initializes a new instance of the class that is empty, has the default initial capacity, and is sorted according to the interface implemented by each key added to the object. - - - Initializes a new instance of the class that is empty, has the default initial capacity, and is sorted according to the specified interface. - The implementation to use when comparing keys. -or- null to use the implementation of each key. - - - Initializes a new instance of the class that contains elements copied from the specified dictionary, has the same initial capacity as the number of elements copied, and is sorted according to the interface implemented by each key. - The implementation to copy to a new object. - d is null. - One or more elements in d do not implement the interface. - - - Initializes a new instance of the class that is empty, has the specified initial capacity, and is sorted according to the interface implemented by each key added to the object. - The initial number of elements that the object can contain. - initialCapacity is less than zero. - There is not enough available memory to create a object with the specified initialCapacity. - - - Initializes a new instance of the class that is empty, has the specified initial capacity, and is sorted according to the specified interface. - The implementation to use when comparing keys. -or- null to use the implementation of each key. - The initial number of elements that the object can contain. - capacity is less than zero. - There is not enough available memory to create a object with the specified capacity. - - - Initializes a new instance of the class that contains elements copied from the specified dictionary, has the same initial capacity as the number of elements copied, and is sorted according to the specified interface. - The implementation to copy to a new object. - The implementation to use when comparing keys. -or- null to use the implementation of each key. - d is null. - comparer is null, and one or more elements in d do not implement the interface. - - - Adds an element with the specified key and value to a object. - The key of the element to add. - The value of the element to add. The value can be null. - key is null. - An element with the specified key already exists in the object. -or- The is set to use the interface, and key does not implement the interface. - The is read-only. -or- The has a fixed size. - There is not enough available memory to add the element to the . - The comparer throws an exception. - - - Gets or sets the capacity of a object. - The number of elements that the object can contain. - The value assigned is less than the current number of elements in the object. - There is not enough memory available on the system. - - - Removes all elements from a object. - The object is read-only. -or- The has a fixed size. - - - Creates a shallow copy of a object. - A shallow copy of the object. - - - Determines whether a object contains a specific key. - The key to locate in the object. - true if the object contains an element with the specified key; otherwise, false. - key is null. - The comparer throws an exception. - - - Determines whether a object contains a specific key. - The key to locate in the object. - true if the object contains an element with the specified key; otherwise, false. - key is null. - The comparer throws an exception. - - - Determines whether a object contains a specific value. - The value to locate in the object. The value can be null. - true if the object contains an element with the specified value; otherwise, false. - - - Copies elements to a one-dimensional object, starting at the specified index in the array. - The one-dimensional object that is the destination of the objects copied from . The must have zero-based indexing. - The zero-based index in array at which copying begins. - array is null. - arrayIndex is less than zero. - array is multidimensional. -or- The number of elements in the source object is greater than the available space from arrayIndex to the end of the destination array. - The type of the source cannot be cast automatically to the type of the destination array. - - - Gets the number of elements contained in a object. - The number of elements contained in the object. - - - Gets the value at the specified index of a object. - The zero-based index of the value to get. - The value at the specified index of the object. - index is outside the range of valid indexes for the object. - - - Returns an object that iterates through a object. - An object for the object. - - - Gets the key at the specified index of a object. - The zero-based index of the key to get. - The key at the specified index of the object. - index is outside the range of valid indexes for the object. - - - Gets the keys in a object. - An object containing the keys in the object. - - - Gets the values in a object. - An object containing the values in the object. - - - Returns the zero-based index of the specified key in a object. - The key to locate in the object. - The zero-based index of the key parameter, if key is found in the object; otherwise, -1. - key is null. - The comparer throws an exception. - - - Returns the zero-based index of the first occurrence of the specified value in a object. - The value to locate in the object. The value can be null. - The zero-based index of the first occurrence of the value parameter, if value is found in the object; otherwise, -1. - - - Gets a value indicating whether a object has a fixed size. - true if the object has a fixed size; otherwise, false. The default is false. - - - Gets a value indicating whether a object is read-only. - true if the object is read-only; otherwise, false. The default is false. - - - Gets a value indicating whether access to a object is synchronized (thread safe). - true if access to the object is synchronized (thread safe); otherwise, false. The default is false. - - - Gets and sets the value associated with a specific key in a object. - The key associated with the value to get or set. - The value associated with the key parameter in the object, if key is found; otherwise, null. - key is null. - The property is set and the object is read-only. -or- The property is set, key does not exist in the collection, and the has a fixed size. - There is not enough available memory to add the element to the . - The comparer throws an exception. - - - Gets the keys in a object. - An object containing the keys in the object. - - - Removes the element with the specified key from a object. - The key of the element to remove. - key is null. - The object is read-only. -or- The has a fixed size. - - - Removes the element at the specified index of a object. - The zero-based index of the element to remove. - index is outside the range of valid indexes for the object. - The is read-only. -or- The has a fixed size. - - - Replaces the value at a specific index in a object. - The zero-based index at which to save value. - The to save into the object. The value can be null. - index is outside the range of valid indexes for the object. - - - Returns a synchronized (thread-safe) wrapper for a object. - The object to synchronize. - A synchronized (thread-safe) wrapper for the object. - list is null. - - - Gets an object that can be used to synchronize access to a object. - An object that can be used to synchronize access to the object. - - - Sets the capacity to the actual number of elements in a object. - The object is read-only. -or- The has a fixed size. - - - Gets the values in a object. - An object containing the values in the object. - - - Returns an that iterates through the . - An for the . - - - Represents a section of the vector that can contain an integer number. - - - Determines whether the specified object is the same as the current object. - The object to compare with the current object. - true if the obj parameter is the same as the current object; otherwise false. - - - Determines whether the specified object is the same as the current object. - The object to compare with the current . - true if the specified object is the same as the current object; otherwise, false. - - - Serves as a hash function for the current , suitable for hashing algorithms and data structures, such as a hash table. - A hash code for the current . - - - Gets a mask that isolates this section within the . - A mask that isolates this section within the . - - - Gets the offset of this section from the start of the . - The offset of this section from the start of the . - - - Determines whether two specified objects are equal. - A object. - A object. - true if the a and b parameters represent the same object, otherwise, false. - - - Determines whether two objects have different values. - A object. - A object. - true if the a and b parameters represent different objects; otherwise, false. - - - - - - Returns a string that represents the specified . - The to represent. - A string that represents the specified . - - - Provides a simple structure that stores Boolean values and small integers in 32 bits of memory. - - - Initializes a new instance of the structure containing the data represented in an existing structure. - A structure that contains the data to copy. - - - Initializes a new instance of the structure containing the data represented in an integer. - An integer representing the data of the new . - - - Creates the first mask in a series of masks that can be used to retrieve individual bits in a that is set up as bit flags. - A mask that isolates the first bit flag in the . - - - Creates an additional mask following the specified mask in a series of masks that can be used to retrieve individual bits in a that is set up as bit flags. - The mask that indicates the previous bit flag. - A mask that isolates the bit flag following the one that previous points to in . - previous indicates the last bit flag in the . - - - Creates the first in a series of sections that contain small integers. - A 16-bit signed integer that specifies the maximum value for the new . - A that can hold a number from zero to maxValue. - maxValue is less than 1. - - - Creates a new following the specified in a series of sections that contain small integers. - A 16-bit signed integer that specifies the maximum value for the new . - The previous in the . - A that can hold a number from zero to maxValue. - maxValue is less than 1. - previous includes the final bit in the . -or- maxValue is greater than the highest value that can be represented by the number of bits after previous. - - - Gets the value of the as an integer. - The value of the as an integer. - - - Determines whether the specified object is equal to the . - The object to compare with the current . - true if the specified object is equal to the ; otherwise, false. - - - Serves as a hash function for the . - A hash code for the . - - - Gets or sets the value stored in the specified . - A that contains the value to get or set. - The value stored in the specified . - - - Gets or sets the state of the bit flag indicated by the specified mask. - A mask that indicates the bit to get or set. - true if the specified bit flag is on (1); otherwise, false. - - - Returns a string that represents the current . - A string that represents the current . - - - Returns a string that represents the specified . - The to represent. - A string that represents the specified . - - - Specifies a description for a property or event. - - - Initializes a new instance of the class with no parameters. - - - Initializes a new instance of the class with a description. - The description text. - - - Specifies the default value for the , which is an empty string (""). This static field is read-only. - - - - Gets the description stored in this attribute. - The description stored in this attribute. - - - Gets or sets the string stored as the description. - The string stored as the description. The default value is an empty string (""). - - - Returns whether the value of the given object is equal to the current . - The object to test the value equality of. - true if the value of the given object is equal to that of the current; otherwise, false. - - - Returns the hash code for this instance. - A 32-bit signed integer hash code. - - - Returns a value indicating whether this is the default instance. - true, if this is the default instance; otherwise, false. - - - Provides data for the event. - - - Initializes a new instance of the class. - The document that is losing activation. - The document that is gaining activation. - - - Gets the document that is gaining activation. - An that represents the document gaining activation. - - - Gets the document that is losing activation. - An that represents the document losing activation. - - - Represents the method that will handle the event. - The source of the event. - An that contains the event data. - - - The exception that is thrown when an attempt to check out a file that is checked into a source code management program is canceled or fails. - - - Initializes a new instance of the class with no associated message or error code. - - - Initializes a new instance of the class with the specified message. - A message describing the exception. - - - Initializes a new instance of the class using the specified serialization data and context. - The to be used for deserialization. - The destination to be used for deserialization. - - - Initializes a new instance of the class with the specified detailed description and the specified exception. - A detailed description of the error. - A reference to the inner exception that is the cause of this exception. - - - Initializes a new instance of the class with the specified message and error code. - A message describing the exception. - The error code to pass. - - - Initializes a new instance of the class that specifies that the check out was canceled. This field is read-only. - - - - Represents a unique command identifier that consists of a numeric command ID and a GUID menu group identifier. - - - Initializes a new instance of the class using the specified menu group GUID and command ID number. - The GUID of the group that this menu command belongs to. - The numeric identifier of this menu command. - - - Determines whether two instances are equal. - The object to compare. - true if the specified object is equivalent to this one; otherwise, false. - - - Serves as a hash function for a particular type. - A hash code for the current . - - - Gets the GUID of the menu group that the menu command identified by this belongs to. - The GUID of the command group for this command. - - - Gets the numeric command ID. - The command ID number. - - - Returns a that represents the current object. - A string that contains the command ID information, both the GUID and integer identifier. - - - Provides data for the event. This class cannot be inherited. - - - Initializes a new instance of the class. - The component that was changed. - A that represents the member that was changed. - The old value of the changed member. - The new value of the changed member. - - - Gets the component that was modified. - An that represents the component that was modified. - - - Gets the member that has been changed. - A that indicates the member that has been changed. - - - Gets the new value of the changed member. - The new value of the changed member. This property can be null. - - - Gets the old value of the changed member. - The old value of the changed member. This property can be null. - - - Represents the method that will handle a event. - The source of the event. - A that contains the event data. - - - Provides data for the event. This class cannot be inherited. - - - Initializes a new instance of the class. - The component that is about to be changed. - A indicating the member of the component that is about to be changed. - - - Gets the component that is about to be changed or the component that is the parent container of the member that is about to be changed. - The component that is about to have a member changed. - - - Gets the member that is about to be changed. - A indicating the member that is about to be changed, if known, or null otherwise. - - - Represents the method that will handle a event. - The source of the event. - A event that contains the event data. - - - Provides data for the , , , and events. - - - Initializes a new instance of the class. - The component that is the source of the event. - - - Gets the component associated with the event. - The component associated with the event. - - - Represents the method that will handle the , , , and events raised for component-level events. - The source of the event. - A that contains the event data. - - - Provides data for the event. - - - Initializes a new instance of the class. - The component to be renamed. - The old name of the component. - The new name of the component. - - - Gets the component that is being renamed. - The component that is being renamed. - - - Gets the name of the component after the rename event. - The name of the component after the rename event. - - - Gets the name of the component before the rename event. - The previous name of the component. - - - Represents the method that will handle a event. - The source of the event. - A that contains the event data. - - - Specifies which event is raised on initialization. This class cannot be inherited. - - - Initializes a new instance of the class. - The name of the initialization event. - - - Gets the name of the initialization event. - The name of the initialization event. - - - Defines members that data entity classes can implement to provide custom synchronous and asynchronous validation support. - - - Occurs when the validation errors have changed for a property or for the entire entity. - - - - Gets the validation errors for a specified property or for the entire entity. - The name of the property to retrieve validation errors for; or null or , to retrieve entity-level errors. - The validation errors for the property or entity. - - - Gets a value that indicates whether the entity has validation errors. - true if the entity currently has validation errors; otherwise, false. - - - Notifies clients that a property value has changed. - - - Occurs when a property value changes. - - - - Notifies clients that a property value is changing. - - - Occurs when a property value is changing. - - - - Specifies the installer for a type that installs components. - - - Initializes a new instance of the class with the name of the component's installer type. - The name of a that represents the installer for the component this attribute is bound to. This class must implement . - - - Initializes a new instance of the class, when given a that represents the installer for a component. - A that represents the installer for the component this attribute is bound to. This class must implement . - - - Returns whether the value of the given object is equal to the current . - The object to test the value equality of. - true if the value of the given object is equal to that of the current; otherwise, false. - - - Returns the hashcode for this object. - A hash code for the current . - - - Gets the type of installer associated with this attribute. - A that represents the type of installer associated with this attribute, or null if an installer does not exist. - - - Creates an instance of a particular type of property from a drop-down box within the . - - - Initializes a new instance of the class. - - - When overridden in a derived class, returns an instance of the specified type. - The context information. - The specified type. - An instance of the specified type or null. - - - Gets the specified text. - The specified text. - - - Provides a type converter to convert 16-bit signed integer objects to and from other representations. - - - Initializes a new instance of the class. - - - Provides a type converter to convert 32-bit signed integer objects to and from other representations. - - - Initializes a new instance of the class. - - - Provides a type converter to convert 64-bit signed integer objects to and from various other representations. - - - Initializes a new instance of the class. - - - Thrown when a thread on which an operation should execute no longer exists or has no message loop. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with the specified detailed description. - A detailed description of the error. - - - Initializes a new instance of the class with the given and . - The to be used for deserialization. - The destination to be used for deserialization. - - - Initializes a new instance of the class with the specified detailed description and the specified exception. - A detailed description of the error. - A reference to the inner exception that is the cause of this exception. - - - The exception thrown when using invalid arguments that are enumerators. - - - Initializes a new instance of the class without a message. - - - Initializes a new instance of the class with the specified message. - The message to display with this exception. - - - Initializes a new instance of the class using the specified serialization data and context. - The to be used for deserialization. - The destination to be used for deserialization. - - - Initializes a new instance of the class with the specified detailed description and the specified exception. - A detailed description of the error. - A reference to the inner exception that is the cause of this exception. - - - Initializes a new instance of the class with a message generated from the argument, the invalid value, and an enumeration class. - The name of the argument that caused the exception. - The value of the argument that failed. - A that represents the enumeration class with the valid values. - - - Indicates whether a class converts property change events to events. - - - Gets a value indicating whether the object raises events. - true if the object raises events when one of its property values changes; otherwise, false. - - - Provides support for rolling back the changes - - - Resets the object’s state to unchanged by rejecting the modifications. - - - Provides functionality required by sites. - - - Gets the component associated with the when implemented by a class. - The instance associated with the . - - - Gets the associated with the when implemented by a class. - The instance associated with the . - - - Determines whether the component is in design mode when implemented by a class. - true if the component is in design mode; otherwise, false. - - - Gets or sets the name of the component associated with the when implemented by a class. - The name of the component associated with the ; or null, if no name is assigned to the component. - - - Specifies that this object supports a simple, transacted notification for batch initialization. - - - Signals the object that initialization is starting. - - - Signals the object that initialization is complete. - - - Allows coordination of initialization for a component and its dependent properties. - - - Occurs when initialization of the component is completed. - - - - Gets a value indicating whether the component is initialized. - true to indicate the component has completed initialization; otherwise, false. - - - Provides a way to synchronously or asynchronously execute a delegate. - - - Asynchronously executes the delegate on the thread that created this object. - A to a method that takes parameters of the same number and type that are contained in args. - An array of type to pass as arguments to the given method. This can be null if no arguments are needed. - An interface that represents the asynchronous operation started by calling this method. - - - Waits until the process started by calling completes, and then returns the value generated by the process. - An interface that represents the asynchronous operation started by calling . - An that represents the return value generated by the asynchronous operation. - - - Synchronously executes the delegate on the thread that created this object and marshals the call to the creating thread. - A that contains a method to call, in the context of the thread for the control. - An array of type that represents the arguments to pass to the given method. This can be null if no arguments are needed. - An that represents the return value from the delegate being invoked, or null if the delegate has no return value. - - - Gets a value indicating whether the caller must call when calling an object that implements this interface. - true if the caller must call ; otherwise, false. - - - Provides contextual information about a component, such as its container and property descriptor. - - - Gets the container representing this request. - An with the set of objects for this ; otherwise, null if there is no container or if the does not use outside objects. - - - Gets the object that is connected with this type descriptor request. - The object that invokes the method on the ; otherwise, null if there is no object responsible for the call. - - - Raises the event. - - - Raises the event. - true if this object can be changed; otherwise, false. - - - Gets the that is associated with the given context item. - The that describes the given context item; otherwise, null if there is no responsible for the call. - - - Provides functionality to discover the schema for a bindable list, where the properties available for binding differ from the public properties of the object to bind to. - - - Returns the that represents the properties on each item used to bind data. - An array of objects to find in the collection as bindable. This can be null. - The that represents the properties on each item used to bind data. - - - Returns the name of the list. - An array of objects, for which the list name is returned. This can be null. - The name of the list. - - - Provides the abstract base class for all licenses. A license is granted to a specific instance of a component. - - - Initializes a new instance of the class. - - - When overridden in a derived class, disposes of the resources used by the license. - - - When overridden in a derived class, gets the license key granted to this component. - A license key granted to this component. - - - Specifies when you can use a licensed object and provides a way of obtaining additional services needed to support licenses running within its domain. - - - Initializes a new instance of the class. - - - When overridden in a derived class, returns a saved license key for the specified type, from the specified resource assembly. - A that represents the type of component. - An with the license key. - The for the specified type. This method returns null unless you override it. - - - Gets the requested service, if it is available. - The type of service to retrieve. - An instance of the service, or null if the service cannot be found. - - - When overridden in a derived class, sets a license key for the specified type. - A that represents the component associated with the license key. - The to save for the type of component. - - - When overridden in a derived class, gets a value that specifies when you can use a license. - One of the values that specifies when you can use a license. The default is . - - - Represents the exception thrown when a component cannot be granted a license. - - - Initializes a new instance of the class for the type of component that was denied a license. - A that represents the type of component that was not granted a license. - - - Initializes a new instance of the class with the given and . - The to be used for deserialization. - The destination to be used for deserialization. - - - Initializes a new instance of the class for the type and the instance of the component that was denied a license. - A that represents the type of component that was not granted a license. - The instance of the component that was not granted a license. - - - Initializes a new instance of the class for the type and the instance of the component that was denied a license, along with a message to display. - A that represents the type of component that was not granted a license. - The instance of the component that was not granted a license. - The exception message to display. - - - Initializes a new instance of the class for the type and the instance of the component that was denied a license, along with a message to display and the original exception thrown. - A that represents the type of component that was not granted a license. - The instance of the component that was not granted a license. - The exception message to display. - An that represents the original exception. - - - Sets the with information about the exception. - The to be used for deserialization. - The destination to be used for deserialization. - info is null. - - - Gets the type of the component that was not granted a license. - A that represents the type of component that was not granted a license. - - - Provides properties and methods to add a license to a component and to manage a . This class cannot be inherited. - - - Creates an instance of the specified type, given a context in which you can use the licensed instance. - A that represents the type to create. - A that specifies when you can use the licensed instance. - An instance of the specified type. - - - Creates an instance of the specified type with the specified arguments, given a context in which you can use the licensed instance. - A that represents the type to create. - A that specifies when you can use the licensed instance. - An array of type that represents the arguments for the type. - An instance of the specified type with the given array of arguments. - - - Gets or sets the current , which specifies when you can use the licensed object. - A that specifies when you can use the licensed object. - The property is currently locked and cannot be changed. - - - Returns whether the given type has a valid license. - The to find a valid license for. - true if the given type is licensed; otherwise, false. - - - Determines whether a valid license can be granted for the specified type. - A that represents the type of object that requests the . - true if a valid license can be granted; otherwise, false. - - - Determines whether a valid license can be granted for the specified instance of the type. This method creates a valid . - A that represents the type of object that requests the license. - An object of the specified type or a type derived from the specified type. - A that is a valid license, or null if a valid license cannot be granted. - true if a valid can be granted; otherwise, false. - - - Prevents changes being made to the current of the given object. - The object whose current context you want to lock. - The context is already locked. - - - Allows changes to be made to the current of the given object. - The object whose current context you want to unlock. - contextUser represents a different user than the one specified in a previous call to . - - - Gets the which specifies when you can use the licensed object for the . - One of the values, as specified in the property. - - - Determines whether a license can be granted for the specified type. - A that represents the type of object that requests the license. - A cannot be granted. - - - Determines whether a license can be granted for the instance of the specified type. - A that represents the type of object that requests the license. - An of the specified type or a type derived from the specified type. - A valid . - The type is licensed, but a cannot be granted. - - - Provides the abstract base class for implementing a license provider. - - - Initializes a new instance of the class. - - - When overridden in a derived class, gets a license for an instance or type of component, when given a context and whether the denial of a license throws an exception. - A that specifies where you can use the licensed object. - A that represents the component requesting the license. - An object that is requesting the license. - true if a should be thrown when the component cannot be granted a license; otherwise, false. - A valid . - - - Specifies the to use with a class. This class cannot be inherited. - - - Initializes a new instance of the class without a license provider. - - - Initializes a new instance of the class with the specified type. - The fully qualified name of the license provider class. - - - Initializes a new instance of the class with the specified type of license provider. - A that represents the type of the license provider class. - - - Specifies the default value, which is no provider. This static field is read-only. - - - - Indicates whether this instance and a specified object are equal. - Another object to compare to. - true if value is equal to this instance; otherwise, false. - - - Returns the hash code for this instance. - A hash code for the current . - - - Gets the license provider that must be used with the associated class. - A that represents the type of the license provider. The default value is null. - - - Indicates a unique ID for this attribute type. - A unique ID for this attribute type. - - - Specifies when the can be used. - - - Used during design time by a visual designer or the compiler. - - - - Used during runtime. - - - - Provides an implementation of a . The provider works in a similar fashion to the Microsoft .NET Framework standard licensing model. - - - Initializes a new instance of the class. - - - Returns a key for the specified type. - The object type to return the key. - A confirmation that the type parameter is licensed. - - - Returns a license for the instance of the component, if one is available. - A that specifies where you can use the licensed object. - A that represents the component requesting the . - An object that requests the . - true if a should be thrown when a component cannot be granted a license; otherwise, false. - A valid . If this method cannot find a valid or a valid context parameter, it returns null. - - - Determines whether the key that the method retrieves is valid for the specified type. - The to check. - A that represents the component requesting the . - true if the key is a valid for the specified type; otherwise, false. - - - Specifies that a list can be used as a data source. A visual designer should use this attribute to determine whether to display a particular list in a data-binding picker. This class cannot be inherited. - - - Initializes a new instance of the class using a value to indicate whether the list is bindable. - true if the list is bindable; otherwise, false. - - - Initializes a new instance of the class using to indicate whether the list is bindable. - A that indicates whether the list is bindable. - - - Represents the default value for . - - - - Returns whether the object passed is equal to this . - The object to test equality with. - true if the object passed is equal to this ; otherwise, false. - - - Returns the hash code for this instance. - A hash code for the current . - - - Returns whether is set to the default value. - true if is set to the default value; otherwise, false. - - - Gets whether the list is bindable. - true if the list is bindable; otherwise, false. - - - Specifies that the list is not bindable. This static field is read-only. - - - - Specifies that the list is bindable. This static field is read-only. - - - - Provides data for the event. - - - Initializes a new instance of the class given the type of change and the affected. - A value indicating the type of change. - The that was added, removed, or changed. - - - Initializes a new instance of the class given the type of change and the index of the affected item. - A value indicating the type of change. - The index of the item that was added, changed, or removed. - - - Initializes a new instance of the class given the type of change, the index of the affected item, and a describing the affected item. - A value indicating the type of change. - The index of the item that was added or changed. - The describing the item. - - - Initializes a new instance of the class given the type of change and the old and new index of the item that was moved. - A value indicating the type of change. - The new index of the item that was moved. - The old index of the item that was moved. - - - Gets the type of change. - A value indicating the type of change. - - - Gets the index of the item affected by the change. - The index of the affected by the change. - - - Gets the old index of an item that has been moved. - The old index of the moved item. - - - Gets the that was added, changed, or deleted. - The affected by the change. - - - Represents the method that will handle the event of the class. - The source of the event. - A that contains the event data. - - - Specifies how the list changed. - - - An item added to the list. contains the index of the item that was added. - - - - An item changed in the list. contains the index of the item that was changed. - - - - An item deleted from the list. contains the index of the item that was deleted. - - - - An item moved within the list. contains the previous index for the item, whereas contains the new index for the item. - - - - A was added, which changed the schema. - - - - A was changed, which changed the schema. - - - - A was deleted, which changed the schema. - - - - Much of the list has changed. Any listening controls should refresh all their data from the list. - - - - Gets the state of a object. - - - The row has been added to a , and has not been called. - - - - The row was deleted using the method of the . - - - - The row has been created but is not part of any . A is in this state immediately after it has been created and before it is added to a collection, or if it has been removed from a collection. - - - - The row has been modified and has not been called. - - - - The row has not changed since was last called. - - - - Describes the version of a . - - - The row contains current values. - - - - The default version of . For a DataRowState value of Added, Modified or Deleted, the default version is Current. For a value of Detached, the version is Proposed. - - - - The row contains its original values. - - - - The row contains a proposed value. - - - - Represents a customized view of a . - - - Begins an edit procedure. - - - Cancels an edit procedure. - - - Returns a for the child with the specified child . - The object. - a for the child . - - - Returns a for the child with the specified child name. - A string containing the name. - a for the child . - - - Returns a for the child with the specified and parent.. - The object. - The parent object. - A for the child . - - - Returns a for the child with the specified name and parent. - A string containing the name. - The parent - a for the child . - - - Gets the to which this row belongs. - The DataView to which this row belongs. - - - Deletes a row. - - - Commits changes to the underlying and ends the editing session that was begun with . Use to discard the changes made to the . - - - Gets a value indicating whether the current is identical to the specified object. - An to be compared. - true if object is a and it returns the same row as the current ; otherwise false. - - - Returns the hash code of the object. - A 32-bit signed integer hash code 1, which represents Boolean true if the value of this instance is nonzero; otherwise the integer zero, which represents Boolean false. - - - Indicates whether the row is in edit mode. - true if the row is in edit mode; otherwise false. - - - Indicates whether a is new. - true if the row is new; otherwise false. - - - Gets or sets a value in a specified column. - The specified column. - The value of the column. - - - Gets or sets a value in a specified column. - String that contains the specified column. - The value of the column. - - - Event that is raised when a property is changed. - - - - Gets the being viewed. - The being viewed by the . - - - Gets the current version description of the . - One of the values. Possible values for the property are Default, Original, Current, and Proposed. - - - Returns a collection of custom attributes for this instance of a component. - An AttributeCollection containing the attributes for this object. - - - Returns the class name of this instance of a component. - The class name of this instance of a component. - - - Returns the name of this instance of a component. - The name of this instance of a component. - - - Returns a type converter for this instance of a component. - The type converter for this instance of a component. - - - Returns the default event for this instance of a component. - The default event for this instance of a component. - - - Returns the default property for this instance of a component. - The default property for this instance of a component. - - - Returns an editor of the specified type for this instance of a component. - A that represents the editor for this object. - An of the specified type that is the editor for this object, or null if the editor cannot be found. - - - Returns the events for this instance of a component. - The events for this instance of a component. - - - Returns the events for this instance of a component with specified attributes. - The attributes - The events for this instance of a component. - - - Returns the properties for this instance of a component. - The properties for this instance of a component. - - - Returns the properties for this instance of a component with specified attributes. - The attributes. - The properties for this instance of a component. - - - Returns an object that contains the property described by the specified property descriptor. - A that represents the property whose owner is to be found. - An that represents the owner of the specified property. - - - Gets a message that describes any validation errors for the object. - The validation error on the object. - - - Gets the error message for the property with the given name. - The name of the property whose error message to get. - The error message for the property. The default is an empty string (""). - - - Represents an in-memory cache of data. - - - Initializes a new instance of the class. - - - Initializes a new instance of a class with the given name. - The name of the . - - - Initializes a new instance of a class that has the given serialization information and context. - The data needed to serialize or deserialize an object. - The source and destination of a given serialized stream. - - - Initializes a new instance of the class. - The object. - The object. - The boolean value. - - - Commits all the changes made to this since it was loaded or since the last time was called. - - - Begins the initialization of a that is used on a form or used by another component. The initialization occurs at run time. - - - Gets or sets a value indicating whether string comparisons within objects are case-sensitive. - true if string comparisons are case-sensitive; otherwise false. The default is false. - - - Clears the of any data by removing all rows in all tables. - - - Copies the structure of the , including all schemas, relations, and constraints. Does not copy any data. - A new with the same schema as the current , but none of the data. - - - Copies both the structure and data for this . -

A new with the same structure (table schemas, relations, and constraints) and data as this .

-


If these classes have been subclassed, the copy will also be of the same subclasses.

-

-
-
- - Returns a with one result set per . - An array of DataTables providing the order of the result sets to be returned in the . - A containing one or more result sets, corresponding to the instances contained within the source . The returned result sets are in the order specified by the dataTables parameter. - - - Returns a with one result set per , in the same sequence as the tables appear in the collection. - A containing one or more result sets, corresponding to the instances contained within the source . - - - Gets or sets the name of the current . - The name of the . - - - Gets a custom view of the data contained in the to allow filtering, searching, and navigating using a custom . - A object. - - - Determines the for a . - The instance that is passed during deserialization of the . - An enumeration indicating whether schema information has been omitted from the payload. - - - Determines the for a . - The that a DataSet’s protected constructor is invoked with during deserialization in remoting scenarios. - The that a DataSet’s protected constructor is invoked with during deserialization in remoting scenarios. - An enumeration indicating whether schema information has been omitted from the payload. - - - Ends the initialization of a that is used on a form or used by another component. The initialization occurs at run time. - - - Gets or sets a value indicating whether constraint rules are followed when attempting any update operation. - true if rules are enforced; otherwise false. The default is true. - One or more constraints cannot be enforced. - - - Gets the collection of customized user information associated with the DataSet. - A with all custom user information. - - - Gets a copy of the that contains all changes made to it since it was loaded or since was last called. - A copy of the changes from this that can have actions performed on it and later be merged back in using . If no changed rows are found, the method returns null. - - - Gets a copy of the containing all changes made to it since it was last loaded, or since was called, filtered by . - One of the values. - A filtered copy of the that can have actions performed on it, and subsequently be merged back in using . If no rows of the desired are found, the method returns null. - - - Gets a copy of for the DataSet. - The specified schema set. - A copy of . - - - Populates a serialization information object with the data needed to serialize the . - A that holds the serialized data associated with the . - A that contains the source and destination of the serialized stream associated with the . - The info parameter is null. - - - Returns a serializable instance. - The instance. - - - Deserializes the table data from the binary or XML stream. - The instance. - The streaming context. - - - Returns the XML representation of the data stored in the . - A string that is a representation of the data stored in the . - - - Returns the XML Schema for the XML representation of the data stored in the . - String that is the XML Schema for the XML representation of the data stored in the . - - - Gets a value indicating whether the has changes, including new, deleted, or modified rows. - true if the has changes; otherwise false. - - - Gets a value indicating whether the has changes, including new, deleted, or modified rows, filtered by . - One of the values. - true if the has changes; otherwise false. - - - Gets a value indicating whether there are errors in any of the objects within this . - true if any table contains an error;otherwise false. - - - Applies the XML schema from the specified to the . - The Stream from which to read the schema. - An array of namespace Uniform Resource Identifier (URI) strings to be excluded from schema inference. - - - Applies the XML schema from the specified to the . - The TextReader from which to read the schema. - An array of namespace Uniform Resource Identifier (URI) strings to be excluded from schema inference. - - - Applies the XML schema from the specified file to the . - The name of the file (including the path) from which to read the schema. - An array of namespace Uniform Resource Identifier (URI) strings to be excluded from schema inference. - is not set to . - - - Applies the XML schema from the specified to the . - The XMLReader from which to read the schema. - An array of namespace Uniform Resource Identifier (URI) strings to be excluded from schema inference. - - - Occurs after the is initialized. - - - - Deserialize all of the tables data of the DataSet from the binary or XML stream. - - - Inspects the format of the serialized representation of the DataSet. - The object. - The object. - true if the specified represents a DataSet serialized in its binary format, false otherwise. - - - Gets a value that indicates whether the is initialized. - true to indicate the component has completed initialization; otherwise false. - - - Fills a with values from a data source using the supplied , using an array of instances to supply the schema and namespace information. - An that provides one or more result sets. - A value from the enumeration that indicates how rows already in the instances within the will be combined with incoming rows that share the same primary key. - An array of instances, from which the method retrieves name and namespace information. Each of these tables must be a member of the contained by this . - - - Fills a with values from a data source using the supplied , using an array of strings to supply the names for the tables within the DataSet. - An that provides one or more result sets. - A value from the enumeration that indicates how rows already in the instances within the DataSet will be combined with incoming rows that share the same primary key. - An array of strings, from which the Load method retrieves table name information. - - - Fills a with values from a data source using the supplied , using an array of instances to supply the schema and namespace information. - An that provides one or more result sets. - A value from the enumeration that indicates how rows already in the instances within the will be combined with incoming rows that share the same primary key. - A delegate to call when an error occurs while loading data. - An array of instances, from which the method retrieves name and namespace information. - - - Gets or sets the locale information used to compare strings within the table. - A that contains data about the user's machine locale. The default is null. - - - Merges an array of objects into the current . - The array of DataRow objects to be merged into the DataSet. - - - Merges a specified and its schema into the current DataSet. - The DataSet whose data and schema will be merged. - One or more constraints cannot be enabled. - The dataSet is null. - - - Merges a specified and its schema into the current . - The whose data and schema will be merged. - The table is null. - - - Merges a specified and its schema into the current DataSet, preserving or discarding any changes in this DataSet according to the given argument. - The DataSet whose data and schema will be merged. - true to preserve changes in the current DataSet; otherwise false. - - - Merges an array of objects into the current , preserving or discarding changes in the DataSet and handling an incompatible schema according to the given arguments. - The array of objects to be merged into the DataSet. - true to preserve changes in the DataSet; otherwise false. - One of the values. - - - Merges a specified and its schema with the current DataSet, preserving or discarding changes in the current DataSet and handling an incompatible schema according to the given arguments. - The DataSet whose data and schema will be merged. - true to preserve changes in the current DataSet; otherwise false. - One of the values. - The dataSet is null. - - - Merges a specified and its schema into the current DataSet, preserving or discarding changes in the DataSet and handling an incompatible schema according to the given arguments. - The DataTable whose data and schema will be merged. - One of the values. - true to preserve changes in the DataSet; otherwise false. - The dataSet is null. - - - Occurs when a target and source have the same primary key value, and is set to true. - - - - Gets or sets the namespace of the . - The namespace of the . - The namespace already has data. - - - Raises the event. - A that contains the event data. - - - Occurs when a object is removed from a . - The being removed. - - - Occurs when a is removed from a . - The being removed. - - - Gets or sets an XML prefix that aliases the namespace of the . - The XML prefix for the namespace. - - - Sends a notification that the specified property is about to change. - The name of the property that is about to change. - - - Reads XML schema and data into the using the specified and . - The from which to read. - One of the values. - The XmlReadMode used to read the data. - - - Reads XML schema and data into the using the specified file and . - The filename (including the path) from which to read. - One of the values. - The XmlReadMode used to read the data. - is not set to . - - - Reads XML schema and data into the using the specified and . - The from which to read. - One of the values. - The XmlReadMode used to read the data. - - - Reads XML schema and data into the using the specified and . - The from which to read. - One of the values. - The XmlReadMode used to read the data. - - - Reads XML schema and data into the using the specified file. - The filename (including the path) from which to read. - The XmlReadMode used to read the data. - is not set to . - - - Reads XML schema and data into the using the specified . - The TextReader from which to read the schema and data. - The used to read the data. - - - Reads XML schema and data into the using the specified . - An object that derives from . - The used to read the data. - - - Reads XML schema and data into the using the specified . - The from which to read. - The XmlReadMode used to read the data. - - - Reads the XML schema from the specified into the . - The from which to read. - - - Reads the XML schema from the specified into the . - The from which to read. - - - Reads the XML schema from the specified file into the . - The file name (including the path) from which to read. - is not set to . - - - Reads the XML schema from the specified into the . - The from which to read. - - - Ignores attributes and returns an empty DataSet. - The specified XML reader. - - - Rolls back all the changes made to the since it was created, or since the last time was called. - - - Get the collection of relations that link tables and allow navigation from parent tables to child tables. - A that contains a collection of objects. An empty collection is returned if no objects exist. - - - Gets or sets a for the used during remoting. - A object. - - - Clears all tables and removes all relations, foreign constraints, and tables from the . Subclasses should override to restore a to its original state. - - - Gets or sets a for a . - Gets or sets a for a . - - - Gets a value indicating whether property should be persisted. - true if the property value has been changed from its default; otherwise false. - - - Gets a value indicating whether property should be persisted. - true if the property value has been changed from its default; otherwise false. - - - Gets or sets an for the . - An for the . - - - Gets the collection of tables contained in the . - The contained by this . An empty collection is returned if no objects exist. - - - Writes the current data, and optionally the schema, for the using the specified and . To write the schema, set the value for the mode parameter to WriteSchema. - The with which to write. - One of the values. - - - Writes the current data, and optionally the schema, for the to the specified file using the specified . To write the schema, set the value for the mode parameter to WriteSchema. - The file name (including the path) to which to write. - One of the values. - is not set to . - - - Writes the current data, and optionally the schema, for the using the specified and . To write the schema, set the value for the mode parameter to WriteSchema. - A object used to write the document. - One of the values. - - - Writes the current data, and optionally the schema, for the using the specified and . To write the schema, set the value for the mode parameter to WriteSchema. - A object used to write to a file. - One of the values. - - - Writes the current data for the to the specified file. - The file name (including the path) to which to write. - is not set to . - - - Writes the current data for the using the specified . - The object with which to write. - - - Writes the current data for the to the specified . - The with which to write. - - - Writes the current data for the using the specified . - A object used to write to a file. - - - Writes the structure as an XML schema to a file. - The name of the file to write to. - A delegate used to convert to string. - - - Writes the structure as an XML schema to the specified object. - A object used to write to a file. - - - Writes the structure as an XML schema to the specified object. - The object with which to write. - - - Writes the structure as an XML schema to a file. - The file name (including the path) to which to write. - is not set to . - - - Writes the structure as an XML schema to an object. - The to write to. - - - Writes the structure as an XML schema to the specified object. - A object to write to. - A delegate used to convert to string. - - - Writes the structure as an XML schema to the specified . - A object to write to. - A delegate used to convert to string. - - - Writes the structure as an XML schema to the specified . - A object to write to. - A delegate used to convert to string. - - - For a description of this member, see . - For a description of this member, see . - - - For a description of this member, see . - For a description of this member, see . - - - For a description of this member, see . - For a description of this member, see . - - - For a description of this member, see . - A . - - - For a description of this member, see . - A . - - - Describes the serialization format for columns in a . - - - DateTime is always stored in Local. If or is assigned to a column in this mode, it is first converted into Local. Serialization in this mode is always performed in Local. There is an offset during serialization. - - - - DateTime is always stored in Unspecified. If or is assigned to a column in this mode, it is first converted into . Serialization in this mode does not cause an offset. - - - - DateTime is stored in Unspecified. If or is assigned to a column in this mode, it is first converted into . Serialization in this mode causes offset. This is the default behavior and is backward compatible. This option should be thought of as being Unspecified in storage but applying an offset that is similar to during serialization. - - - - DateTime is stored in Universal Coordinated Time (UTC). If or is assigned to a column in this mode, it is first converted into Utc format. Serialization in this mode is always performed in Utc. There is no offset during serialization. - - - - Marks a property, event, or extender with a description. Visual designers can display this description when referencing the member. - - - Initializes a new instance of the class using the specified description string. - The description string. - - - Gets the text for the description. - The description string. - - - Represents one table of in-memory data. - - - Initializes a new instance of the class with no arguments. - - - Initializes a new instance of the class with the specified table name. - The name to give the table. If tableName is null or an empty string, a default name is given when added to the . - - - Initializes a new instance of the class with the and the . - The data needed to serialize or deserialize an object. - The source and destination of a given serialized stream. - - - Initializes a new instance of the class using the specified table name and namespace. - The name to give the table. If tableName is null or an empty string, a default name is given when added to the . - The namespace for the XML representation of the data stored in the DataTable. - - - Commits all the changes made to this table since the last time was called. - - - Begins the initialization of a that is used on a form or used by another component. The initialization occurs at run time. - - - Turns off notifications, index maintenance, and constraints while loading data. - - - Indicates whether string comparisons within the table are case-sensitive. - true if the comparison is case-sensitive; otherwise false. The default is set to the parent object's property, or false if the was created independently of a . - - - Gets the collection of child relations for this . - A that contains the child relations for the table. An empty collection is returned if no objects exist. - - - Clears the of all data. - - - Clones the structure of the , including all schemas and constraints. - A new with the same schema as the current . - - - Occurs after a value has been changed for the specified in a . - - - - Occurs when a value is being changed for the specified in a . - - - - Gets the collection of columns that belong to this table. - A that contains the collection of objects for the table. An empty collection is returned if no objects exist. - - - Computes the given expression on the current rows that pass the filter criteria. - The expression to compute. - The filter to limit the rows that evaluate in the expression. - An , set to the result of the computation. If the expression evaluates to null, the return value will be . - - - Gets the collection of constraints maintained by this table. - A that contains the collection of objects for the table. An empty collection is returned if no objects exist. - - - Copies both the structure and data for this . - A new with the same structure (table schemas and constraints) and data as this . If these classes have been derived, the copy will also be of the same derived classes. creates a new with the same structure and data as the original . To copy the structure to a new , but not the data, use . - - - Returns a corresponding to the data within this . - A containing one result set, corresponding to the source instance. - - - Creates a new instance of . - The new expression. - - - Gets the to which this table belongs. - The to which this table belongs. - - - Gets a customized view of the table that may include a filtered view, or a cursor position. - The associated with the . - - - Gets or sets the expression that returns a value used to represent this table in the user interface. The DisplayExpression property lets you display the name of this table in a user interface. - A display string. - - - Ends the initialization of a that is used on a form or used by another component. The initialization occurs at run time. - - - Turns on notifications, index maintenance, and constraints after loading data. - - - Gets the collection of customized user information. - A that contains custom user information. - - - Checks whether initialization is in progress. The initialization occurs at run time. - - - - Gets a copy of the that contains all changes made to it since it was loaded or was last called. - A copy of the changes from this , or null if no changes are found. - - - Gets a copy of the containing all changes made to it since it was last loaded, or since was called, filtered by . - One of the values. - A filtered copy of the that can have actions performed on it, and later be merged back in the using . If no rows of the desired are found, the method returns null. - - - This method returns an instance containing the Web Services Description Language (WSDL) that describes the for Web Services. - An instance. - The instance. - - - Gets an array of objects that contain errors. - An array of objects that have errors. - - - Populates a serialization information object with the data needed to serialize the . - A object that holds the serialized data associated with the . - A object that contains the source and destination of the serialized stream associated with the . - The info parameter is a null reference (Nothing in Visual Basic). - - - Gets the row type. - Returns the type of the . - - - For a description of this member, see . - An that describes the XML representation of the object that is produced by the method and consumed by the method. - - - Gets a value indicating whether there are errors in any of the rows in any of the tables of the to which the table belongs. - true if errors exist; otherwise false. - - - Copies a into a , preserving any property settings, as well as original and current values. - The to be imported. - - - Occurs after the is initialized. - - - - Gets a value that indicates whether the is initialized. - true to indicate the component has completed initialization; otherwise false. - - - Fills a with values from a data source using the supplied . If the already contains rows, the incoming data from the data source is merged with the existing rows. - An that provides a result set. - - - Fills a with values from a data source using the supplied . If the DataTable already contains rows, the incoming data from the data source is merged with the existing rows according to the value of the loadOption parameter. - An that provides one or more result sets. - A value from the enumeration that indicates how rows already in the are combined with incoming rows that share the same primary key. - - - Fills a with values from a data source using the supplied using an error-handling delegate. - A that provides a result set. - A value from the enumeration that indicates how rows already in the are combined with incoming rows that share the same primary key. - A delegate to call when an error occurs while loading data. - - - Finds and updates a specific row. If no matching row is found, a new row is created using the given values. - An array of values used to create the new row. - true to accept changes; otherwise false. - The new . - The array is larger than the number of columns in the table. - A value doesn't match its respective column type. - Adding the row invalidates a constraint. - Attempting to put a null in a column where is false. - - - Finds and updates a specific row. If no matching row is found, a new row is created using the given values. - An array of values used to create the new row. - Used to determine how the array values are applied to the corresponding values in an existing row. - The new . - - - Gets or sets the locale information used to compare strings within the table. - A that contains data about the user's machine locale. The default is the object's (returned by the property) to which the belongs; if the table doesn't belong to a , the default is the current system . - - - Merge the specified with the current DataTable, indicating whether to preserve changes and how to handle missing schema in the current DataTable. - The to be merged with the current . - true, to preserve changes in the current ; otherwise false. - One of the values. - - - Merge the specified with the current DataTable, indicating whether to preserve changes in the current DataTable. - The DataTable to be merged with the current DataTable. - true, to preserve changes in the current DataTable; otherwise false.`` - - - Merge the specified with the current . - The to be merged with the current . - - - Gets or sets the initial starting size for this table. - The initial starting size in rows of this table. The default is 50. - - - Gets or sets the namespace for the XML representation of the data stored in the . - The namespace of the . - - - Creates a new with the same schema as the table. - A with the same schema as the . - - - Returns an array of . - A value that describes the size of the array. - The new array. - - - Creates a new row from an existing row. - A object. - A derived class. - - - Raises the event. - A that contains the event data. - - - Raises the event. - A that contains the event data. - - - Raises the event. - A that contains the event data. - - - Notifies the that a is being removed. - The being removed. - - - Raises the event. - A that contains the event data. - - - Raises the event. - A that contains the event data. - - - Raises the event. - A that contains the event data. - - - Raises the event. - A that contains the event data. - - - Raises the event. - A that contains the event data. - - - Raises the event. - A that contains the event data. - - - Raises the event. - A that contains the event data. - - - Gets the collection of parent relations for this . - A that contains the parent relations for the table. An empty collection is returned if no objects exist. - - - Gets or sets the namespace for the XML representation of the data stored in the . - The prefix of the . - - - Gets or sets an array of columns that function as primary keys for the data table. - An array of objects. - The key is a foreign key. - - - Reads XML schema and data into the using the specified . - An object that derives from - The used to read the data. - - - Reads XML schema and data into the using the specified . - The that will be used to read the data. - The used to read the data. - - - Reads XML schema and data into the from the specified file. - The name of the file from which to read the data. - The used to read the data. - - - Reads XML Schema and Data into the using the specified . - The that will be used to read the data. - The used to read the data. - - - Reads an XML schema into the using the specified stream. - The stream used to read the schema. - - - Reads an XML schema into the using the specified . - The used to read the schema information. - - - Reads an XML schema into the from the specified file. - The name of the file from which to read the schema information. - - - Reads an XML schema into the using the specified . - The used to read the schema information. - - - Reads from an XML stream. - A object. - - - Rolls back all changes that have been made to the table since it was loaded, or the last time was called. - - - Gets or sets the serialization format. - A enumeration specifying either Binary or Xml serialization. - - - Resets the to its original state. Reset removes all data, indexes, relations, and columns of the table. If a DataSet includes a DataTable, the table will still be part of the DataSet after the table is reset. - - - Occurs after a has been changed successfully. - - - - Occurs when a is changing. - - - - Occurs after a row in the table has been deleted. - - - - Occurs before a row in the table is about to be deleted. - - - - Gets the collection of rows that belong to this table. - A that contains objects; otherwise a null value if no objects exist. - - - Gets an array of all objects. - An array of objects. - - - Gets an array of all objects that match the filter criteria. - The criteria to use to filter the rows. For examples on how to filter rows, see DataView RowFilter Syntax [C#]. - An array of objects. - - - Gets an array of all objects that match the filter criteria, in the specified sort order. - The criteria to use to filter the rows. For examples on how to filter rows, see DataView RowFilter Syntax [C#]. - A string specifying the column and sort direction. - An array of objects matching the filter expression. - - - Gets an array of all objects that match the filter in the order of the sort that match the specified state. - The criteria to use to filter the rows. For examples on how to filter rows, see DataView RowFilter Syntax [C#]. - A string specifying the column and sort direction. - One of the values. - An array of objects. - - - Gets or sets an for the . - An for the . - - - Occurs after a is cleared. - - - - Occurs when a is cleared. - - - - Gets or sets the name of the . - The name of the . - null or empty string ("") is passed in and this table belongs to a collection. - The table belongs to a collection that already has a table with the same name. (Comparison is case-sensitive). - - - Occurs when a new is inserted. - - - - Gets the and , if there is one as a concatenated string. - A string consisting of the and the values. - - - Writes the current contents of the as XML using the specified file. - The file to which to write the XML data. - - - Writes the current data, and optionally the schema, for the using the specified and . To write the schema, set the value for the mode parameter to WriteSchema. To save the data for the table and all its descendants, set the writeHierarchy parameter to true. - The used to write the document. - One of the values. - If true, write the contents of the current table and all its descendants. If false (the default value), write the data for the current table only. - - - Writes the current data, and optionally the schema, for the to the specified file using the specified . To write the schema, set the value for the mode parameter to WriteSchema. To save the data for the table and all its descendants, set the writeHierarchy parameter to true. - The stream to which the data will be written. - One of the values. - If true, write the contents of the current table and all its descendants. If false (the default value), write the data for the current table only. - - - Writes the current data, and optionally the schema, for the using the specified and . To write the schema, set the value for the mode parameter to WriteSchema. - The used to write the document. - One of the values. - - - Writes the current contents of the as XML using the specified . - The with which to write the contents. - If true, write the contents of the current table and all its descendants. If false (the default value), write the data for the current table only. - - - Writes the current data, and optionally the schema, for the using the specified file and . To write the schema, set the value for the mode parameter to WriteSchema. - The name of the file to which the data will be written. - One of the values. - - - Writes the current contents of the as XML using the specified file. To save the data for the table and all its descendants, set the writeHierarchy parameter to true. - The file to which to write the XML data. - If true, write the contents of the current table and all its descendants. If false (the default value), write the data for the current table only. - - - Writes the current data, and optionally the schema, for the using the specified and . To write the schema, set the value for the mode parameter to WriteSchema. - The used to write the document. - One of the values. - - - Writes the current contents of the as XML using the specified . To save the data for the table and all its descendants, set the writeHierarchy parameter to true. - The with which to write the content. - If true, write the contents of the current table and all its descendants. If false (the default value), write the data for the current table only. - - - Writes the current data, and optionally the schema, for the to the specified file using the specified . To write the schema, set the value for the mode parameter to WriteSchema. - The stream to which the data will be written. - One of the values. - - - Writes the current data, and optionally the schema, for the using the specified and . To write the schema, set the value for the mode parameter to WriteSchema. To save the data for the table and all its descendants, set the writeHierarchy parameter to true. - The used to write the document. - One of the values. - If true, write the contents of the current table and all its descendants. If false (the default value), write the data for the current table only. - - - Writes the current contents of the as XML using the specified . - The with which to write the contents. - - - Writes the current data, and optionally the schema, for the using the specified file and . To write the schema, set the value for the mode parameter to WriteSchema. To save the data for the table and all its descendants, set the writeHierarchy parameter to true. - The name of the file to which the data will be written. - One of the values. - If true, write the contents of the current table and all its descendants. If false (the default value), write the data for the current table only. - - - Writes the current contents of the as XML using the specified . - The with which to write the content. - - - Writes the current contents of the as XML using the specified . - The stream to which the data will be written. - - - Writes the current contents of the as XML using the specified . To save the data for the table and all its descendants, set the writeHierarchy parameter to true. - The stream to which the data will be written. - If true, write the contents of the current table and all its descendants. If false (the default value), write the data for the current table only. - - - Writes the current data structure of the as an XML schema using the specified . - The with which to write. - - - Writes the current data structure of the as an XML schema to the specified file. - The name of the file to use. - - - Writes the current data structure of the as an XML schema using the specified . - The to use. - - - Writes the current data structure of the as an XML schema to the specified stream. To save the schema for the table and all its descendants, set the writeHierarchy parameter to true. - The stream to which the XML schema will be written. - If true, write the schema of the current table and all its descendants. If false (the default value), write the schema for the current table only. - - - Writes the current data structure of the as an XML schema using the specified . To save the schema for the table and all its descendants, set the writeHierarchy parameter to true. - The with which to write. - If true, write the schema of the current table and all its descendants. If false (the default value), write the schema for the current table only. - - - Writes the current data structure of the as an XML schema using the specified . To save the schema for the table and all its descendants, set the writeHierarchy parameter to true. - The used to write the document. - If true, write the schema of the current table and all its descendants. If false (the default value), write the schema for the current table only. - - - Writes the current data structure of the as an XML schema to the specified file. To save the schema for the table and all its descendants, set the writeHierarchy parameter to true. - The name of the file to use. - If true, write the schema of the current table and all its descendants. If false (the default value), write the schema for the current table only. - - - Writes the current data structure of the as an XML schema to the specified stream. - The stream to which the XML schema will be written. - - - For a description of this member, see . - true if the collection is a collection of objects; otherwise, false. - - - For a description of this member, see . - An that can be bound to a data source from the object. - - - For a description of this member, see . - An that describes the XML representation of the object that is produced by the method and consumed by the method. - - - For a description of this member, see . - An XmlReader. - - - For a description of this member, see . - An XmlWriter. - - - Provides data for the method. - - - Initializes a new instance of the class. - The whose rows are being cleared. - - - Gets the table whose rows are being cleared. - The whose rows are being cleared. - - - Gets the table name whose rows are being cleared. - A indicating the table name. - - - Gets the namespace of the table whose rows are being cleared. - A indicating the namespace name. - - - Represents the method that handles the method. - The source of the event. - A that contains the event data. - - - Represents the collection of tables for the . - - - Creates a new object by using a default name and adds it to the collection. - The newly created . - - - Adds the specified DataTable to the collection. - The DataTable object to add. - The value specified for the table is null. - The table already belongs to this collection, or belongs to another collection. - A table in the collection has the same name. The comparison is not case sensitive. - - - Creates a object by using the specified name and adds it to the collection. - The name to give the created . - The newly created . - A table in the collection has the same name. (The comparison is not case sensitive.) - - - Creates a object by using the specified name and adds it to the collection. - The name to give the created . - The namespace to give the created . - The newly created . - A table in the collection has the same name. (The comparison is not case sensitive.) - - - Copies the elements of the specified array to the end of the collection. - The array of objects to add to the collection. - - - Verifies whether the specified object can be removed from the collection. - The DataTable in the collection to perform the check against. - true if the table can be removed; otherwise false. - - - Clears the collection of all objects. - - - Occurs after the is changed because of objects being added or removed. - - - - Occurs while the is changing because of objects being added or removed. - - - - Gets a value that indicates whether a object with the specified name exists in the collection. - The name of the to find. - true if the specified table exists; otherwise false. - - - Gets a value that indicates whether a object with the specified name and table namespace exists in the collection. - The name of the to find. - The name of the namespace to look in. - true if the specified table exists; otherwise false. - - - Copies all the elements of the current to a one-dimensional , starting at the specified destination array index. - The one-dimensional to copy the current object's elements into. - The destination index to start copying into. - - - Gets the index of the specified object. - The DataTable to search for. - The zero-based index of the table, or -1 if the table is not found in the collection. - - - Gets the index in the collection of the object with the specified name. - The name of the DataTable object to look for. -

The zero-based index of the DataTable with the specified name, or -1 if the table does not exist in the collection.

-


Returns -1 when two or more tables have the same name but different namespaces. The call does not succeed if there is any ambiguity when matching a table name to exactly one table.

-

-
-
- - Gets the index in the collection of the specified object. - The name of the object to look for. - The name of the namespace to look in. - The zero-based index of the with the specified name, or -1 if the table does not exist in the collection. - - - Gets the object at the specified index. - The zero-based index of the to find. - A with the specified index; otherwise null if the does not exist. - The index value is greater than the number of items in the collection. - - - Gets the object with the specified name. - The name of the DataTable to find. - A with the specified name; otherwise null if the does not exist. - - - Gets the object with the specified name in the specified namespace. - The name of the DataTable to find. - The name of the namespace to look in. - A with the specified name; otherwise null if the does not exist. - - - Removes the specified object from the collection. - The DataTable to remove. - The value specified for the table is null. - The table does not belong to this collection. -or- The table is part of a relationship. - - - Removes the object with the specified name from the collection. - The name of the object to remove. - The collection does not have a table with the specified name. - - - Removes the object with the specified name from the collection. - The name of the object to remove. - The name of the namespace to look in. - The collection does not have a table with the specified name. - - - Removes the object at the specified index from the collection. - The index of the DataTable to remove. - The collection does not have a table at the specified index. - - - Provides data for the method. - - - Initializes a new instance of . - The being added. - - - Gets the row that is being added. - The that is being added. - - - Represents the method that handles the method. - The source of the event. - A that contains the event data. - - - The obtains the contents of one or more objects in the form of one or more read-only, forward-only result sets. - - - Initializes a new instance of the class by using data from the supplied . - The from which the new obtains its result set. - - - Initializes a new instance of the class using the supplied array of objects. - The array of objects that supplies the results for the new object. - - - Closes the current . - - - The depth of nesting for the current row of the . - The depth of nesting for the current row; always zero. - - - Returns the number of columns in the current row. - When not positioned in a valid result set, 0; otherwise the number of columns in the current row. - An attempt was made to retrieve the field count in a closed . - - - Gets the value of the specified column as a . - The zero-based column ordinal. - The value of the specified column. - The index passed was outside the range of 0 to - 1. - An attempt was made to retrieve data from a deleted row. - An attempt was made to read or access a column in a closed . - The specified column does not contain a Boolean. - - - Gets the value of the specified column as a byte. - The zero-based column ordinal. - The value of the specified column. - The index passed was outside the range of 0 to - 1. - An attempt was made to retrieve data from a deleted row. - An attempt was made to read or access a column in a closed DataTableReader. - The specified column does not contain a byte. - - - Reads a stream of bytes starting at the specified column offset into the buffer as an array starting at the specified buffer offset. - The zero-based column ordinal. - The index within the field from which to start the read operation. - The buffer into which to read the stream of bytes. - The index within the buffer at which to start placing the data. - The maximum length to copy into the buffer. - The actual number of bytes read. - The index passed was outside the range of 0 to - 1. - An attempt was made to retrieve data from a deleted row. - An attempt was made to read or access a column in a closed DataTableReader. - The specified column does not contain a byte array. - - - Gets the value of the specified column as a character. - The zero-based column ordinal. - The value of the column. - The index passed was outside the range of 0 to - 1. - An attempt was made to retrieve data from a deleted row. - An attempt was made to read or access a column in a closed DataTableReader. - The specified field does not contain a character. - - - Returns the value of the specified column as a character array. - The zero-based column ordinal. - The index within the field from which to start the read operation. - The buffer into which to read the stream of chars. - The index within the buffer at which to start placing the data. - The maximum length to copy into the buffer. - The actual number of characters read. - The index passed was outside the range of 0 to - 1. - An attempt was made to retrieve data from a deleted row. - An attempt was made to read or access a column in a closed DataTableReader. - The specified column does not contain a character array. - - - Gets a string representing the data type of the specified column. - The zero-based column ordinal. - A string representing the column's data type. - The index passed was outside the range of 0 to - 1. - An attempt was made to read or access a column in a closed . - - - Gets the value of the specified column as a object. - The zero-based column ordinal. - The value of the specified column. - The index passed was outside the range of 0 to - 1. - An attempt was made to retrieve data from a deleted row. - An attempt was made to read or access a column in a closed DataTableReader. - The specified column does not contain a DateTime value. - - - Gets the value of the specified column as a . - The zero-based column ordinal. - The value of the specified column. - The index passed was outside the range of 0 to - 1. - An attempt was made to retrieve data from a deleted row. - An attempt was made to read or access a column in a closed DataTableReader. - The specified column does not contain a Decimal value. - - - Gets the value of the column as a double-precision floating point number. - The zero-based ordinal of the column. - The value of the specified column. - The index passed was outside the range of 0 to - 1. - An attempt was made to retrieve data from a deleted row. - An attempt was made to read or access a column in a closed DataTableReader. - The specified column does not contain a double-precision floating point number. - - - Returns an enumerator that can be used to iterate through the item collection. - An object that represents the item collection. - An attempt was made to read or access a column in a closed . - - - Gets the that is the data type of the object. - The zero-based column ordinal. - The that is the data type of the object. - The index passed was outside the range of 0 to - 1. - An attempt was made to read or access a column in a closed . - - - Gets the value of the specified column as a single-precision floating point number. - The zero-based column ordinal. - The value of the column. - The index passed was outside the range of 0 to - 1. - An attempt was made to retrieve data from a deleted row. - An attempt was made to read or access a column in a closed . - The specified column does not contain a single-precision floating point number. - - - Gets the value of the specified column as a globally-unique identifier (GUID). - The zero-based column ordinal. - The value of the specified column. - The index passed was outside the range of 0 to - 1. - An attempt was made to retrieve data from a deleted row. - An attempt was made to read or access a column in a closed . - The specified column does not contain a GUID. - - - Gets the value of the specified column as a 16-bit signed integer. - The zero-based column ordinal - The value of the specified column. - The index passed was outside the range of 0 to - 1. - An attempt was made to retrieve data from a deleted row. - An attempt was made to read or access a column in a closed . - The specified column does not contain a 16-bit signed integer. - - - Gets the value of the specified column as a 32-bit signed integer. - The zero-based column ordinal - The value of the specified column. - The index passed was outside the range of 0 to - 1. - An attempt was made to retrieve data from a deleted row. - An attempt was made to read or access a column in a closed . - The specified column does not contain a 32-bit signed integer value. - - - Gets the value of the specified column as a 64-bit signed integer. - The zero-based column ordinal - The value of the specified column. - The index passed was outside the range of 0 to - 1. - An attempt was made to retrieve data from a deleted row. - An attempt was made to read or access a column in a closed . - The specified column does not contain a 64-bit signed integer value. - - - Gets the value of the specified column as a . - The zero-based column ordinal - The name of the specified column. - The index passed was outside the range of 0 to - 1. - An attempt was made to read or access a column in a closed . - - - Gets the column ordinal, given the name of the column. - The name of the column. - The zero-based column ordinal. - An attempt was made to read or access a column in a closed . - The name specified is not a valid column name. - - - Gets the type of the specified column in provider-specific format. - The zero-based column ordinal. - The that is the data type of the object. - The index passed was outside the range of 0 to - 1. - An attempt was made to read or access a column in a closed . - - - Gets the value of the specified column in provider-specific format. - The zero-based number of the column whose value is retrieved. - The value of the specified column in provider-specific format. - The index passed was outside the range of 0 to - 1. - An attempt was made to retrieve data from a deleted row. - An attempt was made to read or access a column in a closed - - - Fills the supplied array with provider-specific type information for all the columns in the . - An array of objects to be filled in with type information for the columns in the . - The number of column values copied into the array. - An attempt was made to retrieve data from a deleted row. - An attempt was made to read or access a column in a closed . - - - Returns a that describes the column metadata of the . - A that describes the column metadata. - The is closed. - - - Gets the value of the specified column as a string. - The zero-based column ordinal - The value of the specified column. - The index passed was outside the range of 0 to - 1. - An attempt was made to retrieve data from a deleted row. - An attempt was made to read or access a column in a closed . - The specified column does not contain a string. - - - Gets the value of the specified column in its native format. - The zero-based column ordinal - The value of the specified column. This method returns DBNull for null columns. - The index passed was outside the range of 0 to - 1. - An attempt was made to retrieve data from a deleted row. - An attempt was made to read or access columns in a closed . - - - Populates an array of objects with the column values of the current row. - An array of into which to copy the column values from the . - The number of column values copied into the array. - The index passed was outside the range of 0 to - 1. - An attempt was made to retrieve data from a deleted row. - An attempt was made to read or access a column in a closed . - - - Gets a value that indicates whether the contains one or more rows. - true if the contains one or more rows; otherwise false. - An attempt was made to retrieve information about a closed . - - - Gets a value that indicates whether the is closed. - Returns true if the is closed; otherwise, false. - - - Gets a value that indicates whether the column contains non-existent or missing values. - The zero-based column ordinal - true if the specified column value is equivalent to ; otherwise, false. - The index passed was outside the range of 0 to - 1. - An attempt was made to retrieve data from a deleted row. - An attempt was made to read or access a column in a closed . - - - Gets the value of the specified column in its native format given the column ordinal. - The zero-based column ordinal. - The value of the specified column in its native format. - The index passed was outside the range of 0 to - 1. - - - Gets the value of the specified column in its native format given the column name. - The name of the column. - The value of the specified column in its native format. - The name specified is not a valid column name. - An attempt was made to retrieve data from a deleted row. - An attempt was made to read or access a column in a closed . - - - Advances the to the next result set, if any. - true if there was another result set; otherwise false. - An attempt was made to navigate within a closed . - - - Advances the to the next record. - true if there was another row to read; otherwise false. - An attempt was made to read or access a column in a closed . - - - Gets the number of rows inserted, changed, or deleted by execution of the SQL statement. - The does not support this property and always returns 0. - - - Represents a databindable, customized view of a for sorting, filtering, searching, editing, and navigation. The does not store data, but instead represents a connected view of its corresponding . Changes to the ’s data will affect the . Changes to the ’s data will affect all s associated with it. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with the specified . - A to add to the . - - - Initializes a new instance of the class with the specified , , , and . - A to add to the . - A to apply to the . - A to apply to the . - A to apply to the . - - - Adds a new row to the . - A new object. - - - Sets or gets a value that indicates whether deletes are allowed. - true, if deletes are allowed; otherwise, false. - - - Gets or sets a value that indicates whether edits are allowed. - true, if edits are allowed; otherwise, false. - - - Gets or sets a value that indicates whether the new rows can be added by using the method. - true, if new rows can be added; otherwise, false. - - - Gets or sets a value that indicates whether to use the default sort. The default sort is (ascending) by all primary keys as specified by . - true, if the default sort is used; otherwise, false. - - - Starts the initialization of a that is used on a form or used by another component. The initialization occurs at runtime. - - - Closes the . - - - Occurs after a has been changed successfully. - The source of the event. - A that contains the event data. - - - Copies items into an array. Only for Web Forms Interfaces. - array to copy into. - index to start at. - - - Gets the number of records in the after and have been applied. - The number of records in the . - - - Gets the associated with this view. - The DataViewManager that created this view. If this is the default for a , the DataViewManager property returns the default DataViewManager for the DataSet. Otherwise, if the DataView was created without a DataViewManager, this property is null. - - - Deletes a row at the specified index. - The index of the row to delete. - - - Disposes of the resources (other than memory) used by the object. - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - Ends the initialization of a that is used on a form or used by another component. The initialization occurs at runtime. - - - Determines whether the specified instances are considered equal. - The to be compared. - true if the two instances are equal; otherwise, false. - - - Finds a row in the by the specified sort key values. - An array of values, typed as . - The index of the position of the first row in the that matches the sort key values specified; otherwise -1 if there are no matching sort key values. - - - Finds a row in the by the specified sort key value. - The object to search for. - The index of the row in the that contains the sort key value specified; otherwise -1 if the sort key value does not exist. - - - Returns an array of objects whose columns match the specified sort key value. - The column value, typed as , to search for. - An array of DataRowView objects whose columns match the specified sort key value; or, if no rows contain the specified sort key values, an empty DataRowView array. - - - Returns an array of objects whose columns match the specified sort key value. - An array of column values, typed as , to search for. - An array of DataRowView objects whose columns match the specified sort key value; or, if no rows contain the specified sort key values, an empty DataRowView array. - - - Gets an enumerator for this . - An for navigating through the list. - - - Occurs after a has been changed successfully. - The source of the event. - A that contains the event data. - - - Occurs when initialization of the is completed. - - - - Gets a value that indicates whether the component is initialized. - true to indicate the component has completed initialization; otherwise, false. - - - Gets a value that indicates whether the data source is currently open and projecting views of data on the . - true, if the source is open; otherwise, false. - - - Gets a row of data from a specified table. - The index of a record in the . - A of the row that you want. - - - Occurs when the list managed by the changes. - - - - Raises the event. - A that contains the event data. - - - Opens a . - - - Reserved for internal use only. - - - Gets or sets the expression used to filter which rows are viewed in the . - A string that specifies how rows are to be filtered. - - - Gets or sets the row state filter used in the . - One of the values. - - - Gets or sets the sort column or columns, and sort order for the . - A string that contains the column name followed by "ASC" (ascending) or "DESC" (descending). Columns are sorted ascending by default. Multiple columns can be separated by commas. - - - Gets or sets the source . - A that provides the data for this view. - - - Creates and returns a new based on rows in an existing . - If true, the returned contains rows that have distinct values for all its columns. The default value is false. - A string array that contains a list of the column names to be included in the returned . The contains the specified columns in the order they appear within this array. - A new instance that contains the requested rows and columns. - - - Creates and returns a new based on rows in an existing . - The name of the returned . - A new instance that contains the requested rows and columns. - - - Creates and returns a new based on rows in an existing . - The name of the returned . - If true, the returned contains rows that have distinct values for all its columns. The default value is false. - A string array that contains a list of the column names to be included in the returned . The DataTable contains the specified columns in the order they appear within this array. - A new instance that contains the requested rows and columns. - - - Creates and returns a new based on rows in an existing . - A new instance that contains the requested rows and columns. - - - Reserved for internal use only. - Reserved for internal use only. - - - Reserved for internal use only. - - - For a description of this member, see . - For a description of this member, see . - - - For a description of this member, see . - For a description of this member, see . - - - For a description of this member, see . - A value. - For a description of this member, see . - - - For a description of this member, see . - - - For a description of this member, see . - A value. - For a description of this member, see . - - - For a description of this member, see . - A value. - For a description of this member, see . - - - For a description of this member, see . - A value. - A value to be inserted. - - - For a description of this member, see . - For a description of this member, see . - - - For a description of this member, see . - For a description of this member, see . - - - For a description of this member, see . - A value. - For a description of this member, see . - - - For a description of this member, see . - A value. - - - For a description of this member, see . - A value. - - - For a description of this member, see . - A object. - - - For a description of this member, see . - The item added to the list. - - - For a description of this member, see . - For a description of this member, see . - - - For a description of this member, see . - For a description of this member, see . - - - For a description of this member, see . - For a description of this member, see . - - - For a description of this member, see . - A object. - A object. - - - For a description of this member, see . - A object. - A value. - For a description of this member, see . - - - For a description of this member, see . - For a description of this member, see . - - - For a description of this member, see . - A object. - - - For a description of this member, see . - - - For a description of this member, see . - For a description of this member, see . - - - For a description of this member, see . - For a description of this member, see . - - - For a description of this member, see . - For a description of this member, see . - - - For a description of this member, see . - For a description of this member, see . - - - For a description of this member, see . - For a description of this member, see . - - - For a description of this member, see . - A object. - - - For a description of this member, see . - For a description of this member, see . - - - For a description of this member, see . - - - For a description of this member, see . - For a description of this member, see . - - - For a description of this member, see . - For a description of this member, see . - - - For a description of this member, see . - For a description of this member, see . - - - For a description of this member, see . - - - - - For a description of this member, see . - An array of objects. - For a description of this member, see . - - - Contains a default for each in a . - - - Initializes a new instance of the class. - - - Initializes a new instance of the class for the specified . - The name of the to use. - - - Creates a for the specified . - The name of the to use in the . - A object. - - - Gets or sets the to use with the . - The to use. - - - Gets or sets a value that is used for code persistence. - A value that is used for code persistence. - - - Gets the for each in the . - A for each DataTable. - - - Occurs after a row is added to or deleted from a . - - - - Raises the event. - A that contains the event data. - - - Raises a event when a is added to or removed from the . - The source of the event. - A that contains the event data. - - - Raises a event when a is added to or removed from the . - The source of the event. - A that contains the event data. - - - Copies the elements of the to an , starting at a particular index. - The one-dimensional that is the destination of the elements copied from . The must have zero-based indexing. - The zero-based index in array at which copying begins. - - - For a description of this member, see . - For a description of this member, see . - - - For a description of this member, see . - true if access to the is synchronized (thread safe); otherwise, false. - - - For a description of this member, see . - An object that can be used to synchronize access to the . - - - For a description of this member, see . - For a description of this member, see . - - - Adds an item to the . - The to add to the . - The position into which the new element was inserted. - - - For a description of this member, see . - - - Determines whether the contains a specific value. - The to locate in the . - true if the is found in the ; otherwise, false. - - - Determines the index of a specific item in the . - The to locate in the . - The index of value if found in the list; otherwise, -1. - - - Inserts an item to the at the specified index. - The zero-based index at which value should be inserted. - The to insert into the . - - - For a description of this member, see . - true if the has a fixed size; otherwise, false. - - - For a description of this member, see . - For a description of this member, see . - - - Gets or sets the element at the specified index. - The zero-based index of the element to get or set. - The element at the specified index. - - - Removes the first occurrence of a specific object from the . - The to remove from the . - - - Removes the item at the specified index. - The zero-based index of the item to remove. - - - Adds the to the indexes used for searching. - The to add to the indexes used for searching. - - - For a description of this member, see . - For a description of this member, see . - - - For a description of this member, see . - For a description of this member, see . - - - For a description of this member, see . - For a description of this member, see . - - - For a description of this member, see . - For a description of this member, see . - - - Sorts the list based on a and a . - The to sort by. - One of the values. - - - Returns the index of the row that has the given . - The to search on. - The value of the property parameter to search for. - The index of the row that has the given . - - - For a description of this member, see . - For a description of this member, see . - - - Removes the from the indexes used for searching. - The to remove from the indexes used for searching. - - - Removes any sort applied using . - - - For a description of this member, see . - For a description of this member, see . - - - For a description of this member, see . - For a description of this member, see . - - - For a description of this member, see . - For a description of this member, see . - - - For a description of this member, see . - For a description of this member, see . - - - For a description of this member, see . - For a description of this member, see . - - - Returns the that represents the properties on each item used to bind data. - An array of objects to find in the collection as bindable. This can be null. - The that represents the properties on each item used to bind data. - - - Returns the name of the list. - An array of objects, for which the list name is returned. This can be null. - The name of the list. - - - Describes the version of data in a . - - - A new row. - - - - Current rows including unchanged, new, and modified rows. By default, is set to CurrentRows. - - - - A deleted row. - - - - A current version of original data that has been modified (see ModifiedOriginal). - - - - The original version of the data that was modified. (Although the data has since been modified, it is available as ModifiedCurrent). - - - - None. - - - - Original rows including unchanged and deleted rows. - - - - An unchanged row. - - - - Represents the default settings for , , , , , and for DataViews created from the . - - - Gets or sets a value indicating whether to use the default sort. - true if the default sort is used; otherwise false. - - - Gets the that contains this . - A object. - - - Gets or sets the filter to apply in the . See for a code sample using RowFilter. - A string that contains the filter to apply. - - - Gets or sets a value indicating whether to display Current, Deleted, Modified Current, ModifiedOriginal, New, Original, Unchanged, or no rows in the . - A value that indicates which rows to display. - - - Gets or sets a value indicating the sort to apply in the . - The sort to apply in the . - - - Gets the to which the properties apply. - A object. - - - Contains a read-only collection of objects for each in a . - - - Copies the collection objects to a one-dimensional instance starting at the specified index. - The one-dimensional that is the destination of the values copied from the collection. - The index of the array at which to start inserting. - - - Copies the collection objects to a one-dimensional instance starting at the specified index. - The one-dimensional that is the destination of the values copied from the collection. - The index of the array at which to start inserting. - - - Gets the number of objects in the . - The number of objects in the collection. - - - Gets an for the collection. - An object. - - - Gets a value that indicates whether the is read-only. - Returns true. - - - Gets a value that indicates whether access to the is synchronized (thread-safe). - This property is always false, unless overridden by a derived class. - - - Gets the objects of the specified from the collection. - The to find. - A collection of objects. - - - Gets the objects of the specified by its index. - The zero-based index of the to find. - A collection of objects. - - - Gets the of the specified by its name. - The name of the to find. - A collection of objects. - - - Gets an object that can be used to synchronize access to the . - An object that can be used to synchronize access to the . - - - The exception that is thrown by the during an insert, update, or delete operation if the number of rows affected equals zero. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. - The text string describing the details of the exception. - - - Initializes a new instance of the class. - The text string describing the details of the exception. - A reference to an inner exception. - - - Initializes a new instance of the class. - The error message that explains the reason for this exception. - The exception that is the cause of the current exception, or a null reference (Nothing in Visual Basic) if no inner exception is specified. - An array containing the objects whose update failure generated this exception. - - - Copies the objects whose update failure generated this exception, to the specified array of objects. - The one-dimensional array of objects to copy the objects into. - - - Copies the objects whose update failure generated this exception, to the specified array of objects, starting at the specified destination array index. - The one-dimensional array of objects to copy the objects into. - The destination array index to start copying into. - - - Populates the aprcified serialization information object with the data needed to serialize the . - A that holds the serialized data associated with the . - A that contains the source and destination of the serialized stream associated with the . - The info parameter is a null reference (Nothing in Visual Basic). - - - Gets or sets the value of the that generated the . - The value of the . - - - Gets the number of rows whose update failed, generating this exception. - An integer containing a count of the number of rows whose update failed. - - - Specifies the data type of a field, a property, or a Parameter object of a .NET Framework data provider. - - - A variable-length stream of non-Unicode characters ranging between 1 and 8,000 characters. - - - - A fixed-length stream of non-Unicode characters. - - - - A variable-length stream of binary data ranging between 1 and 8,000 bytes. - - - - A simple type representing Boolean values of true or false. - - - - An 8-bit unsigned integer ranging in value from 0 to 255. - - - - A currency value ranging from -2 63 (or -922,337,203,685,477.5808) to 2 63 -1 (or +922,337,203,685,477.5807) with an accuracy to a ten-thousandth of a currency unit. - - - - A type representing a date value. - - - - A type representing a date and time value. - - - - Date and time data. Date value range is from January 1,1 AD through December 31, 9999 AD. Time value range is 00:00:00 through 23:59:59.9999999 with an accuracy of 100 nanoseconds. - - - - Date and time data with time zone awareness. Date value range is from January 1,1 AD through December 31, 9999 AD. Time value range is 00:00:00 through 23:59:59.9999999 with an accuracy of 100 nanoseconds. Time zone value range is -14:00 through +14:00. - - - - A simple type representing values ranging from 1.0 x 10 -28 to approximately 7.9 x 10 28 with 28-29 significant digits. - - - - A floating point type representing values ranging from approximately 5.0 x 10 -324 to 1.7 x 10 308 with a precision of 15-16 digits. - - - - A globally unique identifier (or GUID). - - - - An integral type representing signed 16-bit integers with values between -32768 and 32767. - - - - An integral type representing signed 32-bit integers with values between -2147483648 and 2147483647. - - - - An integral type representing signed 64-bit integers with values between -9223372036854775808 and 9223372036854775807. - - - - A general type representing any reference or value type not explicitly represented by another DbType value. - - - - An integral type representing signed 8-bit integers with values between -128 and 127. - - - - A floating point type representing values ranging from approximately 1.5 x 10 -45 to 3.4 x 10 38 with a precision of 7 digits. - - - - A type representing Unicode character strings. - - - - A fixed-length string of Unicode characters. - - - - A type representing a SQL Server DateTime value. If you want to use a SQL Server time value, use . - - - - An integral type representing unsigned 16-bit integers with values between 0 and 65535. - - - - An integral type representing unsigned 32-bit integers with values between 0 and 4294967295. - - - - An integral type representing unsigned 64-bit integers with values between 0 and 18446744073709551615. - - - - A variable-length numeric value. - - - - A parsed representation of an XML document or fragment. - - - - Represents the exception that is thrown when an action is tried on a that has been deleted. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with the specified string. - The string to display when the exception is thrown. - - - Initializes a new instance of the class with serialization information. - The data that is required to serialize or deserialize an object. - Description of the source and destination of the specified serialized stream. - - - Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. - The error message that explains the reason for the exception. - The exception that is the cause of the current exception, or a null reference (Nothing in Visual Basic) if no inner exception is specified. - - - Determines the action that occurs when a mapping is missing from a source table or a source column. - - - An is generated if the specified column mapping is missing. - - - - The column or table not having a mapping is ignored. Returns null. - - - - The source column or source table is created and added to the using its original name. - - - - Represents the exception that is thrown when you try to access a row in a table that has no primary key. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with the specified string. - The string to display when the exception is thrown. - - - Initializes a new instance of the class with serialization information. - The data that is required to serialize or deserialize an object. - A description of the source and destination of the specified serialized stream. - - - Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. - The error message that explains the reason for the exception. - The exception that is the cause of the current exception, or a null reference (Nothing in Visual Basic) if no inner exception is specified. - - - Specifies the action to take when adding data to the and the required or is missing. - - - Adds the necessary columns to complete the schema. - - - - Adds the necessary columns and primary key information to complete the schema. For more information about how primary key information is added to a , see .To function properly with the .NET Framework Data Provider for OLE DB, AddWithKey requires that the native OLE DB provider obtains necessary primary key information by setting the DBPROP_UNIQUEROWS property, and then determines which columns are primary key columns by examining DBCOLUMN_KEYCOLUMN in the IColumnsRowset. As an alternative, the user may explicitly set the primary key constraints on each . This ensures that incoming records that match existing records are updated instead of appended. When using AddWithKey, the .NET Framework Data Provider for SQL Server appends a FOR BROWSE clause to the statement being executed. The user should be aware of potential side effects, such as interference with the use of SET FMTONLY ON statements. See SQL Server Books Online for more information. - - - - An is generated if the specified column mapping is missing. - - - - Ignores the extra columns. - - - - Represents the exception that is thrown when you try to insert a null value into a column where is set to false. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with the specified string. - The string to display when the exception is thrown. - - - Initializes a new instance of the class with serialization information. - The data that is required to serialize or deserialize an object. - Description of the source and destination of the specified serialized stream. - - - Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. - The error message that explains the reason for the exception. - The exception that is the cause of the current exception, or a null reference (Nothing in Visual Basic) if no inner exception is specified. - - - All the objects and structures implement the INullable interface. - - - Indicates whether a structure is null. This property is read-only. - true if the value of this object is null. Otherwise, false. - - - The class is not intended for use as a stand-alone component, but as a class from which other classes derive standard functionality. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. - The string to display when the exception is thrown. - - - Initializes a new instance of the class. - The string to display when the exception is thrown. - A reference to an inner exception. - - - Represents a variable-length stream of binary data to be stored in or retrieved from a database. - - - Initializes a new instance of the structure, setting the property to the contents of the supplied byte array. - The byte array to be stored or retrieved. - - - Concatenates two specified values to create a new structure. - A . - A . - A that is the concatenated value of x and y. - - - Compares this object to the supplied object and returns an indication of their relative values. - The object to be compared to this structure. -

A signed number that indicates the relative values of this structure and the object.

-
Return value

-

Condition

-

Less than zero

-

The value of this object is less than the object.

-

Zero

-

This object is the same as object.

-

Greater than zero

-

This object is greater than object.

-

-or-

-

The object is a null reference.

-

-
-
- - Compares this object to the supplied object and returns an indication of their relative values. - The object to be compared to this structure. -

A signed number that indicates the relative values of this structure and the object.

-
Return value

-

Condition

-

Less than zero

-

The value of this object is less than the object.

-

Zero

-

This object is the same as object.

-

Greater than zero

-

This object is greater than object.

-

-or-

-

The object is a null reference.

-

-
-
- - Concatenates two structures to create a new structure. - A structure. - A structure. - The concatenated values of the x and y parameters. - - - Compares the supplied object parameter to the property of the object. - The object to be compared. - true if object is an instance of and the two are equal; otherwise false. - - - Compares two structures to determine whether they are equal. - A structure. - A structure. - true if the two values are equal. Otherwise, false. If either instance is null, then the SqlBinary will be null. - - - Returns the hash code for this structure. - A 32-bit signed integer hash code. - - - Returns the XML Schema definition language (XSD) of the specified . - An . - A string that indicates the XSD of the specified . - - - Compares two structures to determine whether the first is greater than the second. - A structure. - A structure. - A that is if the first instance is greater than the second instance. Otherwise . If either instance of is null, the of the will be . - - - Compares two structures to determine whether the first is greater than or equal to the second. - A structure. - A structure. - A that is if the first instance is greater than or equal to the second instance. Otherwise . If either instance of is null, the of the will be . - - - Indicates whether this structure is null. This property is read-only. - true if null; otherwise, false. - - - Gets the single byte from the property located at the position indicated by the integer parameter, index. If index indicates a position beyond the end of the byte array, a will be raised. This property is read-only. - The position of the byte to be retrieved. - The byte located at the position indicated by the integer parameter. - The property is read when the property contains - or - The index parameter indicates a position byond the length of the byte array as indicated by the property. - - - Gets the length in bytes of the property. This property is read-only. - The length of the binary data in the property. - The property is read when the property contains . - - - Compares two structures to determine whether the first is less than the second. - A structure. - A structure. - A that is if the first instance is less than the second instance. Otherwise . If either instance of is null, the of the will be . - - - Compares two structures to determine whether the first is less than or equal to the second. - A structure. - A structure. - A that is if the first instance is less than or equal to the second instance. Otherwise . If either instance of is null, the of the will be . - - - Compares two structures to determine whether they are not equal. - A structure. - A structure. - A that is if the two instances are not equal or if the two instances are equal. If either instance of is null, the of the will be . - - - Represents a that can be assigned to this instance of the structure. - - - - Concatenates the two parameters to create a new structure. - A object. - A object. - The concatenated values of the x and y parameters. - - - Compares two structures to determine whether they are equal. - A object. - A object. - A that is if the two instances are equal or if the two instances are not equal. If either instance of is null, the of the will be . - - - - - - - - - - - Compares two structures to determine whether the first is greater than the second. - A object. - A object. - A that is if the first instance is greater than the second instance. Otherwise . If either instance of is null, the of the will be . - - - Compares two structues to determine whether the first is greater than or equal to the second. - A object. - A object. - A that is if the first instance is greater than or equal to the second instance. Otherwise . If either instance of is null, the of the will be . - - - - - - - Compares two structures to determine whether they are not equal. - A object. - A object. - A that is if the two instances are not equal or if the two instances are equal. If either instance of is null, the of the will be . - - - Compares two structures to determine whether the first is less than the second. - A object. - A object. - A that is if the first instance is less than the second instance. Otherwise . If either instance of is null, the of the will be . - - - Compares two structures to determine whether the first is less than or equal to the second. - A object. - A object. - A that is if the first instance is less than or equal to the second instance. Otherwise . If either instance of is null, the of the will be . - - - Converts this instance of to . - A structure. - - - Converts this object to a string. - A string that contains the of the . If the is null the string will contain "null". - - - Gets the value of the structure. This property is read-only. - The value of the structure. - The property is read when the property contains . - - - For a description of this member, see . - An instance. - - - For a description of this member, see . - A . - - - For a description of this member, see . - A . - - - Represents an integer value that is either 1 or 0 to be stored in or retrieved from a database. - - - Initializes a new instance of the structure using the supplied Boolean value. - The value for the new structure; either true or false. - - - Initializes a new instance of the structure using the specified integer value. - The integer whose value is to be used for the new structure. - - - Computes the bitwise AND operation of two specified structures. - A structure. - A structure. - The result of the logical AND operation. - - - Gets the value of the structure as a byte. - A byte representing the value of the structure. - - - Compares this object to the supplied object and returns an indication of their relative values. - A object to compare, or a null reference (Nothing in Visual Basic). -

A signed number that indicates the relative values of the instance and value.

-
Value

-

Description

-

A negative integer

-

This instance is less than value.

-

Zero

-

This instance is equal to value.

-

A positive integer

-

This instance is greater than value.

-

-or-

-

value is a null reference (Nothing in Visual Basic).

-

-
-
- - Compares this structure to a specified object and returns an indication of their relative values. - An object to compare, or a null reference (Nothing in Visual Basic). -

A signed number that indicates the relative values of the instance and value.

-
Value

-

Description

-

A negative integer

-

This instance is less than value.

-

Zero

-

This instance is equal to value.

-

A positive integer

-

This instance is greater than value.

-

-or-

-

value is a null reference (Nothing in Visual Basic).

-

-
-
- - Compares the supplied object parameter to the . - The object to be compared. - true if object is an instance of and the two are equal; otherwise, false. - - - Compares two structures to determine whether they are equal. - A structure. - A structure. - A that is if the two instances are equal or if the two instances are not equal. If either instance of is null, the of the will be . - - - Represents a false value that can be assigned to the property of an instance of the structure. - - - - Returns the hash code for this instance. - A 32-bit signed integer hash code. - - - Returns the XML Schema definition language (XSD) of the specified . - A . - A string value that indicates the XSD of the specified . - - - Compares two instances of to determine whether the first is greater than the second. - A structure. - A structure. - A that is true if the first instance is greater than the second instance; otherwise false. - - - Compares two instances of to determine whether the first is greater than or equal to the second. - A structure. - A structure. - A that is true if the first instance is greater than or equal to the second instance; otherwise false. - - - Indicates whether the current is . - true if Value is False; otherwise, false. - - - Indicates whether this structure is null. - true if the structure is null; otherwise false. - - - Indicates whether the current is . - true if Value is True; otherwise, false. - - - Compares two instances of to determine whether the first is less than the second. - A structure. - A structure. - A that is true if the first instance is less than the second instance; otherwise, false. - - - Compares two instances of to determine whether the first is less than or equal to the second. - A structure. - A structure. - A that is true if the first instance is less than or equal to the second instance; otherwise, false. - - - Compares two instances of for equality. - A structure. - A structure. - A that is if the two instances are not equal or if the two instances are equal. If either instance of is null, the of the will be . - - - Represents that can be assigned to this instance of the structure. - - - - Represents a one value that can be assigned to the property of an instance of the structure. - - - - Performs a one's complement operation on the supplied structures. - A structure. - The one's complement of the supplied . - - - Computes the bitwise AND operation of two specified structures. - A structure. - A structure. - The result of the logical AND operation. - - - Computes the bitwise OR of its operands. - A structure. - A structure. - The results of the logical OR operation. - - - Compares two instances of for equality. - A . - A . - A that is if the two instances are equal or if the two instances are not equal. If either instance of is null, the of the will be . - - - Performs a bitwise exclusive-OR (XOR) operation on the supplied parameters. - A structure. - A structure. - The result of the logical XOR operation. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - The false operator can be used to test the of the to determine whether it is false. - The structure to be tested. - Returns true if the supplied parameter is is false, false otherwise. - - - Compares two structures to determine whether the first is greater than the second. - A object. - A object. - A that is true if the first instance is greater than the second instance; otherwise, false. - - - Compares two structures to determine whether the first is greater than or equal to the second. - A structure. - A structure. - A that is true if the first instance is greater than or equal to the second instance; otherwise, false. - - - - - - - Compares two instances of to determine whether they are not equal. - A . - A . - A that is if the two instances are not equal or if the two instances are equal. If either instance of is null, the of the will be . - - - Compares two instances of to determine whether the first is less than the second. - A structure. - A structure. - A that is true if the first instance is less than the second instance; otherwise, false. - - - Compares two instances of to determine whether the first is less than or equal to the second. - A structure. - A structure. - A that is true if the first instance is less than or equal to the second instance; otherwise, false. - - - Performs a NOT operation on a . - The on which the NOT operation will be performed. - A with the if argument was true, if argument was null, and otherwise. - - - Performs a one's complement operation on the supplied structures. - A structure. - The one's complement of the supplied . - - - The true operator can be used to test the of the to determine whether it is true. - The structure to be tested. - Returns true if the supplied parameter is is true, false otherwise. - - - Performs a bitwise OR operation on the two specified structures. - A structure. - A structure. - A new structure whose Value is the result of the bitwise OR operation. - - - Converts the specified representation of a logical value to its equivalent. - The to be converted. - A structure that contains the parsed value. - - - Converts this structure to . - A new structure whose value is 1 or 0. If the structure's value equals true, the new structure's value is 1. Otherwise, the new structure's value is 0. - - - Converts this structure to . - A new structure whose value is 1 or 0. If the structure's value equals true then the new structure's value is 1. Otherwise, the new structure's value is 0. - - - Converts this structure to . - A new structure whose value is 1 or 0. If the structure's value equals true then the new structure's value is 1. Otherwise, the new structure's value is 0. - - - Converts this structure to . - A new SqlInt16 structure whose value is 1 or 0. If the structure's value equals true then the new structure's value is 1. Otherwise, the new SqlInt16 structure's value is 0. - - - Converts this structure to . - A new SqlInt32 structure whose value is 1 or 0. If the structure's value equals true, the new structure's value is 1. Otherwise, the new SqlInt32 structure's value is 0. - - - Converts this structure to . - A new SqlInt64 structure whose value is 1 or 0. If the structure's value equals true, the new structure's value is 1. Otherwise, the new SqlInt64 structure's value is 0. - - - Converts this structure to . - A new structure whose value is 1 or 0. If the structure's value equals true, the new value is 1. If the structure's value equals false, the new value is 0. If structure's value is neither 1 nor 0, the new value is . - - - Converts this structure to . - A new structure whose value is 1 or 0. If the structure's value equals true, the new structure's value is 1; otherwise the new structure's value is 0. - - - Converts this structure to . - A new structure whose value is 1 or 0. If the structure's value equals true then structure's value is 1. Otherwise, the new structure's value is 0. - - - Converts this structure to a string. - A string that contains the value of the . If the value is null, the string will contain "null". - - - Represents a true value that can be assigned to the property of an instance of the structure. - - - - Gets the structure's value. This property is read-only. - true if the is ; otherwise false. - The property is set to null. - - - Performs a bitwise exclusive-OR operation on the supplied parameters. - A structure. - A structure. - The result of the logical XOR operation. - - - Represents a zero value that can be assigned to the property of an instance of the structure. - - - - This member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - An XmlSchema. - - - This member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - XmlReader - - - This member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - XmlWriter - - - Represents an 8-bit unsigned integer, in the range of 0 through 255, to be stored in or retrieved from a database. - - - Initializes a new instance of the structure using the specified byte value. - A byte value to be stored in the property of the new structure. - - - Computes the sum of the two specified structures. - A structure. - A structure. - A structure whose Value property contains the results of the addition. - - - Computes the bitwise AND of its operands. - A structure. - A structure. - The results of the bitwise AND operation. - - - Computes the bitwise OR of its two operands. - A structure. - A structure. - The results of the bitwise OR operation. - - - Compares this instance to the supplied object and returns an indication of their relative values. - The object to be compared. -

A signed number that indicates the relative values of the instance and the object.

-
Return Value

-

Condition

-

Less than zero

-

This instance is less than the object.

-

Zero

-

This instance is the same as the object.

-

Greater than zero

-

This instance is greater than the object

-

-or-

-

The object is a null reference (Nothing in Visual Basic)

-

-
-
- - Compares this instance to the supplied and returns an indication of their relative values. - The to be compared. -

A signed number that indicates the relative values of the instance and the object.

-
Return Value

-

Condition

-

Less than zero

-

This instance is less than the object.

-

Zero

-

This instance is the same as the object.

-

Greater than zero

-

This instance is greater than the object

-

-or-

-

The object is a null reference (Nothing in Visual Basic)

-

-
-
- - Divides its first operand by its second. - A structure. - A structure. - A new structure whose property contains the results of the division. - - - Performs a logical comparison of two structures to determine whether they are equal. - A structure. - A structure. - true if the two values are equal. Otherwise, false. If either instance is null, then the SqlByte will be null. - - - Compares the supplied parameter to the property of the object. - The to be compared. - true if object is an instance of and the two are equal; otherwise false. - - - Returns the hash code for this instance. - A 32-bit signed integer hash code. - - - Returns the XML Schema definition language (XSD) of the specified . - A . - A string value that indicates the XSD of the specified . - - - Compares two instances of to determine whether the first is greater than the second. - A structure. - A structure. - A that is if the first instance is greater than the second instance. Otherwise, . If either instance of is null, the of the will be . - - - Compares two structures to determine whether the first is greater than or equal to the second. - A structure. - A structure. - A that is if the first instance is greater than or equal to the second instance. Otherwise, . If either instance of is null, the of the will be . - - - Gets a Boolean value that indicates whether this structure is null. - true if null. Otherwise, false. - - - Compares two instances of to determine whether the first is less than the second. - A structure. - A structure. - A that is if the first instance is less than the second instance. Otherwise, . If either instance of is null, the of the will be . - - - Compares two instances of to determine whether the first is less than or equal to the second. - A structure. - A structure. - A that is if the first instance is less than or equal to the second instance. Otherwise, . If either instance of is null, the of the will be . - - - A constant representing the largest possible value of a . - - - - A constant representing the smallest possible value of a . - - - - Computes the remainder after dividing its first operand by its second. - A structure. - A structure. - A structure whose contains the remainder. - - - Divides two values and returns the remainder. - A . - A . - The remainder left after division is performed on x and y. - - - Computes the product of the two operands. - A structure. - A structure. - A new structure whose property contains the product of the multiplication. - - - Compares two instances of to determine whether they are not equal. - A structure. - A structure. - A that is if the two instances are not equal or if the two instances are equal. If either instance of is null, the of the will be . - - - Represents a that can be assigned to this instance of the structure. - - - - The ones complement operator performs a bitwise one's complement operation on its operand. - A structure. - A structure whose property contains the ones complement of the parameter. - - - Computes the sum of the two specified structures. - A structure. - A structure. - A whose property contains the sum of the two operands. - - - Computes the bitwise AND of its operands. - A structure. - A structure. - The results of the bitwise AND operation. - - - Computes the bitwise OR of its two operands. - A structure. - A structure. - The results of the bitwise OR operation. - - - Divides its first operand by its second. - A structure. - A structure. - A new structure whose property contains the results of the division. - - - Performs a logical comparison of two structures to determine whether they are equal. - A structure. - A structure. - A that is if the two instances are equal or if the two instances are not equal. If either instance of is null, the of the will be . - - - Performs a bitwise exclusive-OR operation on the supplied parameters. - A structure. - A structure. - The results of the bitwise XOR operation. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Compares two instances of to determine whether the first is greater than the second. - A structure. - A structure. - A that is if the first instance is greater than the second instance. Otherwise, . If either instance of is null, the of the will be . - - - Compares two instances of to determine whether the first is greater than or equal to the second. - A structure. - A structure. - A that is if the first instance is greater than or equal to the second instance. Otherwise, . If either instance of is null, the of the SqlBoolean will be . - - - - - - - Compares two instances of to determine whether they are not equal. - A structure. - A structure. - A that is if the two instances are not equal or if the two instances are equal. If either instance of is null, the of the will be . - - - Compares two instances of to determine whether the first is less than the second. - A structure. - A structure. - A that is if the first instance is less than the second instance. Otherwise, . If either instance of is null, the of the will be . - - - Compares two instances of to determine whether the first is less than or equal to the second. - A structure. - A structure. - A that is if the first instance is less than or equal to the second instance. Otherwise, . If either instance of is null, the of the will be . - - - Computes the remainder after dividing its first operand by its second. - A structure. - A structure. - A structure whose contains the remainder. - - - Computes the product of the two operands. - A structure. - A structure. - A new structure whose property contains the product of the multiplication. - - - The ones complement operator performs a bitwise one's complement operation on its operand. - A structure. - A structure whose property contains the ones complement of the parameter. - - - Subtracts the second operand from the first. - A structure. - A structure. - The results of subtracting the second operand from the first. - - - Converts the representation of a number to its 8-bit unsigned integer equivalent. - The String to be parsed. - A structure that contains the 8-bit number represented by the String parameter. - - - Subtracts the second operand from the first. - A structure. - A structure. - The results of subtracting the second operand from the first. - - - Converts this structure to . - true if the is non-zero; false if zero; otherwise Null. - - - Converts this structure to . - A SqlDecimal structure whose equals the of this structure. - - - Converts this structure to . - A SqlDouble structure with the same value as this . - - - Converts this structure to . - A SqlInt16 structure with the same value as this . - - - Converts this to . - A SqlInt32 structure with the same value as this . - - - Converts this structure to . - A SqlInt64 structure who equals the of this . - - - Converts this structure to . - A SqlMoney structure whose equals the of this structure. - - - Converts this structure to . - A SqlSingle structure that has the same as this structure. - - - Converts this instance of to . - A SqlString that contains the string representation of the structure's . - - - Converts this structure to a . - A string that contains the of the . If the Value is null, the String will be a null string. - - - Gets the value of the structure. This property is read-only - The value of the structure. - - - Performs a bitwise exclusive-OR operation on the supplied parameters. - A structure. - A structure. - The results of the XOR operation. - - - Represents a zero value that can be assigned to the property of an instance of the structure. - - - - This member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - An XmlSchema. - - - This member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - XmlReader - - - This member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - XmlWriter - - - Represents a mutable reference type that wraps either a or a . - - - Initializes a new instance of the class. - - - Initializes a new instance of the class based on the specified byte array. - The array of unsigned bytes. - - - Initializes a new instance of the class based on the specified value. - A value. - - - Initializes a new instance of the class based on the specified value. - A . - - - Returns a reference to the internal buffer. - Returns a reference to the internal buffer. For instances created on top of unmanaged pointers, it returns a managed copy of the internal buffer. - - - Returns the XML Schema definition language (XSD) of the specified . - A . - A string that indicates the XSD of the specified XmlSchemaSet. - - - Gets a Boolean value that indicates whether this is null. - true if the is null, false otherwise. - - - Gets or sets the instance at the specified index. - A value. - A value. - - - Gets the length of the value that is contained in the instance. - A value representing the length of the value that is contained in the instance. Returns -1 if no buffer is available to the instance or if the value is null. Returns a for a stream-wrapped instance. - - - Gets the maximum length of the value of the internal buffer of this . - A long representing the maximum length of the value of the internal buffer. Returns -1 for a stream-wrapped . - - - Returns a null instance of this . - Returns an instance in such a way that returns true. - - - - - - - - - - - Copies bytes from this instance to the passed-in buffer and returns the number of copied bytes. - An long value offset into the value that is contained in the instance. - The byte array buffer to copy into. - An integer offset into the buffer to start copying into. - An integer representing the number of bytes to copy. - An long value representing the number of copied bytes. - - - Sets the length of this instance. - The long value representing the length. - - - Sets this instance to null. - - - Returns information about the storage state of this instance. - A enumeration. - - - Gets or sets the data of this as a stream. - The stream that contains the SqlBytes data. - - - Constructs and returns a from this instance. - A from this instance. - - - Returns a managed copy of the value held by this . - The value of this as an array of bytes. - - - Copies bytes from the passed-in buffer to this instance. - An long value offset into the value that is contained in the instance. - The byte array buffer to copy into. - An integer offset into the buffer to start copying into. - An integer representing the number of bytes to copy. - - - Gets serialization information with all the data needed to reinstantiate this instance. - The object to be populated with serialization information. - The destination context of the serialization. - - - This member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - This member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - XmlReader - - - This member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - XmlWriter - - - is a mutable reference type that wraps a array or a instance. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class based on the specified character array. - A array. - - - Initializes a new instance of the class based on the specified value. - A . - - - Returns a reference to the internal buffer. - Returns a reference to the internal buffer. For instances created on top of unmanaged pointers, it returns a managed copy of the internal buffer. - - - Returns the XML Schema definition language (XSD) of the specified . - A . - A string value that indicates the XSD of the specified . - - - Gets a Boolean value that indicates whether this is null. - true if the is null. Otherwise, false. - - - Gets or sets the instance at the specified index. - An value. - A value. - - - Gets the length of the value that is contained in the instance. - A value that indicates the length in characters of the value that is contained in the instance. Returns -1 if no buffer is available to the instance, or if the value is null. Returns a for a stream-wrapped instance. - - - Gets the maximum length in two-byte characters of the value the internal buffer can hold. - An value representing the maximum length in two-byte characters of the value of the internal buffer. Returns -1 for a stream-wrapped . - - - Returns a null instance of this . - Returns an instance in such a way that returns true. For more information, see Handling Null Values. - - - - - - - - - - - Copies characters from this instance to the passed-in buffer and returns the number of copied characters. - An long value offset into the value that is contained in the instance. - The character array buffer to copy into. - An integer offset into the buffer to start copying into. - An integer value representing the number of characters to copy. - An long value representing the number of copied bytes. - - - Sets the length of this instance. - The long value representing the length. - - - Sets this instance to null. - - - Returns information about the storage state of this instance. - A enumeration. - - - Converts this instance to its equivalent representation. - A representation of this type. - - - Returns a managed copy of the value held by this . - The value of this as an array of characters. - - - Copies characters from the passed-in buffer to this instance. - A long value offset into the value that is contained in the instance. - The character array buffer to copy into. - An integer offset into the buffer to start copying into. - An integer representing the number of characters to copy. - - - Gets serialization information with all the data needed to reinstantiate this instance. - The object to be populated with serialization information. - The destination context of the serialization. - - - This member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - This member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - XmlReader - - - This member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - XmlWriter - - - Specifies the compare option values for a structure. - - - Specifies that sorts should be based on a characters numeric value instead of its alphabetical value. - - - - Performs a binary sort. - - - - Specifies that comparisons must ignore case. - - - - Specifies that comparisons must ignore the Kana type. Kana type refers to Japanese hiragana and katakana characters that represent phonetic sounds in the Japanese language. Hiragana is used for native Japanese expressions and words, while katakana is used for words borrowed from other languages, such as "computer" or "Internet". A phonetic sound can be expressed in both hiragana and katakana. If this value is selected, the hiragana character for one sound is considered equal to the katakana character for the same sound. - - - - Specifies that comparisons must ignore nonspace combining characters, such as diacritics. The Unicode Standard defines combining characters as characters that are combined with base characters to produce a new character. Non-space combining characters do not use character space by themselves when rendered. For more information about non-space combining characters, see the Unicode Standard at http://www.unicode.org. - - - - Specifies that comparisons must ignore the character width. For example, Japanese katakana characters can be written as full-width or half-width and, if this value is selected, the katakana characters written as full-width are considered equal to the same characters written in half-width. - - - - Specifies the default option settings for comparisons. - - - - Represents the date and time data ranging in value from January 1, 1753 to December 31, 9999 to an accuracy of 3.33 milliseconds to be stored in or retrieved from a database. The structure has a different underlying data structure from its corresponding .NET Framework type, , which can represent any time between 12:00:00 AM 1/1/0001 and 11:59:59 PM 12/31/9999, to the accuracy of 100 nanoseconds. actually stores the relative difference to 00:00:00 AM 1/1/1900. Therefore, a conversion from "00:00:00 AM 1/1/1900" to an integer will return 0. - - - Initializes a new instance of the structure using the specified value. - A DateTime structure. - - - Initializes a new instance of the structure using the supplied parameters. - An integer value that represents the date as ticks. - An integer value that represents the time as ticks. - - - Initializes a new instance of the structure using the supplied parameters to initialize the year, month, day. - An integer representing the year of the of the new structure. - An integer value representing the month of the new structure. - An integer value representing the day number of the new structure. - - - Initializes a new instance of the structure using the supplied parameters to initialize the year, month, day, hour, minute, and second of the new structure. - An integer value representing the year of the new structure. - An integer value representing the month of the new structure. - An integer value representing the day of the month of the new structure. - An integer value representing the hour of the new structure. - An integer value representing the minute of the new structure. - An integer value representing the second of the new structure. - - - Initializes a new instance of the structure using the supplied parameters to initialize the year, month, day, hour, minute, second, and millisecond of the new structure. - An integer value representing the year of the new structure. - An integer value representing the month of the new structure. - An integer value representing the day of the month of the new structure. - An integer value representing the hour of the new structure. - An integer value representing the minute of the new structure. - An integer value representing the second of the new structure. - An double value representing the millisecond of the new structure. - - - Initializes a new instance of the structure using the supplied parameters to initialize the year, month, day, hour, minute, second, and billisecond of the new structure. - An integer value representing the year of the new structure. - An integer value representing the month of the new structure. - An integer value representing the day of the new structure. - An integer value representing the hour of the new structure. - An integer value representing the minute of the new structure. - An integer value representing the second of the new structure. - An integer value representing the bilisecond (billionth of a second) of the new structure. - - - Adds a to the specified TimeSpan. - A value. - A Timespan value. - A value. - - - Compares this structure to the supplied structure and returns an indication of their relative values. - The structure to be compared. -

A signed number that indicates the relative values of the instance and the object.

-
Return value

-

Condition

-

Less than zero

-

This instance is less than .

-

Zero

-

This instance is the same as .

-

Greater than zero

-

This instance is greater than

-

-or-

-

is a null reference (Nothing in Visual Basic)

-

-
-
- - Compares this structure to the supplied and returns an indication of their relative values. - The to be compared. -

A signed number that indicates the relative values of the instance and the object.

-
Return value

-

Condition

-

Less than zero

-

This instance is less than the object.

-

Zero

-

This instance is the same as the object.

-

Greater than zero

-

This instance is greater than the object

-

-or-

-

The object is a null reference (Nothing as Visual Basic).

-

-
-
- - Gets the number of ticks representing the date of this structure. - The number of ticks representing the date that is contained in the property of this structure. - The exception that is thrown when the Value property of a structure is set to null. - - - Performs a logical comparison of two structures to determine whether they are equal. - A structure. - A structure. - true if the two values are equal. Otherwise, false. - - - Compares the supplied object parameter to the property of the object. - The object to be compared. - true if the object is an instance of and the two are equal; otherwise false. - - - Gets the hash code for this instance. - A 32-bit signed integer hash code. - - - Returns the XML Schema definition language (XSD) of the specified . - A . - A string value that indicates the XSD of the specified . - - - Compares two instances of to determine whether the first is greater than the second. - A structure. - A structure. - A that is if the first instance is greater than the second instance. Otherwise, . If either instance of is null, the of the will be . - - - Compares two instances of to determine whether the first is greater than or equal to the second. - A structure. - A structure. - A that is if the first instance is greater than or equal to the second instance. Otherwise, . If either instance of is null, the of the will be . - - - Indicates whether this structure is null. - true if null. Otherwise, false. - - - Compares two instances of to determine whether the first is less than the second. - A structure. - A structure. - A that is if the first instance is less than the second instance. Otherwise, . If either instance of is null, the of the will be . - - - Compares two instances of to determine whether the first is less than or equal to the second. - A structure. - A structure. - A that is if the first instance is less than or equal to the second instance. Otherwise, . If either instance of is null, the of the will be . - - - Represents the maximum valid date value for a structure. - - - - Represents the minimum valid date value for a structure. - - - - Performs a logical comparison of two instances of to determine whether they are not equal. - A structure. - A structure. - A that is if the two instances are not equal or if the two instances are equal. If either instance of is null, the of the will be . - - - Represents a that can be assigned to this instance of the structure. - - - - Adds the period of time indicated by the supplied parameter, t, to the supplied structure. - A structure. - A structure. - A new . If either argument is , the new is . - - - Performs a logical comparison of two structures to determine whether they are equal. - A structure. - A structure. - true if the two values are equal. Otherwise, false. - - - - - - - - - - - Compares two instances of to determine whether the first is greater than the second. - A structure. - A structure. - A that is if the first instance is greater than the second instance. Otherwise, . If either instance of is null, the of the will be . - - - Compares two instances of to determine whether the first is greater than or equal to the second. - A structure. - A structure. - A that is if the first instance is greater than or equal to the second instance. Otherwise, . If either instance of is null, the of the will be . - - - - - - - Performs a logical comparison of two instances of to determine whether they are not equal. - A structure. - A structure. - A that is if the two instances are not equal or if the two instances are equal. If either instance of is null, the of the will be . - - - Compares two instances of to determine whether the first is less than the second. - A structure. - A structure. - A that is if the first instance is less than the second instance. Otherwise, . If either instance of is null, the of the will be . - - - Compares two instances of to determine whether the first is less than or equal to the second. - A structure. - A structure. - A that is if the first instance is less than or equal to the second instance. Otherwise, . If either instance of is null, the of the will be . - - - Subtracts the supplied structure, t, from the supplied structure. - A structure. - A structure. - A structure representing the results of the subtraction. - - - Converts the specified representation of a date and time to its equivalent. - The string to be parsed. - A structure equal to the date and time represented by the specified string. - - - A constant whose value is the number of ticks equivalent to one hour. - - - - A constant whose value is the number of ticks equivalent to one minute. - - - - A constant whose value is the number of ticks equivalent to one second. - - - - Subtracts the specified Timespan from this instance. - A value. - A Timespan value. - A value. - - - Gets the number of ticks representing the time of this structure. - The number of ticks representing the time of this structure. - - - Converts this structure to . - A SqlString structure whose value is a string representing the date and time that is contained in this structure. - - - Converts this structure to a . - A String representing the property of this structure. - - - Gets the value of the structure. This property is read-only. - The value of this structure. - The exception that is thrown when the Value property of a structure is set to null. - - - This member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - An XmlSchema. - - - This member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - XmlReader - - - This member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - XmlWriter - - - Represents a numeric value between - 10^38 +1 and 10^38 - 1, with fixed precision and scale. - - - Initializes a new instance of the structure using the supplied value. - The value to be stored as a structure. - - - Initializes a new instance of the structure using the supplied double parameter. - A double, representing the value for the new structure. - - - Initializes a new instance of the structure using the supplied integer value. - The supplied integer value which will the used as the value of the new structure. - - - Initializes a new instance of the structure using the supplied long integer value. - The supplied long integer value which will the used as the value of the new structure. - - - Initializes a new instance of the structure using the supplied parameters. - The maximum number of digits that can be used to represent the property of the new structure. - The number of decimal places to which the property will be resolved for the new structure. - A Boolean value that indicates whether the new structure represents a positive or negative number. - The 128-bit unsigned integer that provides the value of the new . - - - Initializes a new instance of the structure using the supplied parameters. - The maximum number of digits that can be used to represent the property of the new structure. - The number of decimal places to which the property will be resolved for the new structure. - A Boolean value that indicates whether the new structure represents a positive or negative number. - An 32-bit unsigned integer which will be combined with data2, data3, and data4 to make up the 128-bit unsigned integer that represents the new structures value. - An 32-bit unsigned integer which will be combined with data1, data3, and data4 to make up the 128-bit unsigned integer that represents the new structures value. - An 32-bit unsigned integer which will be combined with data1, data2, and data4 to make up the 128-bit unsigned integer that represents the new structures value. - An 32-bit unsigned integer which will be combined with data1, data2, and data3 to make up the 128-bit unsigned integer that represents the new structures value. - - - The Abs method gets the absolute value of the parameter. - A structure. - A structure whose property contains the unsigned number representing the absolute value of the parameter. - - - Calculates the sum of the two operators. - A structure. - A structure. - A new structure whose property contains the sum. - - - The scale of the operand will be adjusted to the number of digits indicated by the digits parameter. Depending on the value of the fRound parameter, the value will either be rounded to the appropriate number of digits or truncated. - The structure to be adjusted. - The number of digits in the adjusted structure. - If this parameter is true, the new Value will be rounded, if false, the value will be truncated. - A new structure whose property contains the adjusted number. - - - Get the binary representation of the value of this structure as an array of bytes. - An array of bytes that contains the binary representation of the structure's value. - - - Returns the smallest whole number greater than or equal to the specified structure. - The structure for which the ceiling value is to be calculated. - A representing the smallest whole number greater than or equal to the specified structure. - - - Compares this instance to the supplied object and returns an indication of their relative values. - The to be compared. -

A signed number that indicates the relative values of the instance and the object.

-
Return value

-

Condition

-

Less than zero

-

This instance is less than the object.

-

Zero

-

This instance is the same as the object.

-

Greater than zero

-

This instance is greater than the object

-

-or-

-

The object is a null reference (Nothing in Visual Basic)

-

-
-
- - Compares this instance to the supplied and returns an indication of their relative values. - The to be compared. -

A signed number that indicates the relative values of the instance and the object.

-
Return Value

-

Condition

-

Less than zero

-

This instance is less than the object.

-

Zero

-

This instance is the same as the object.

-

Greater than zero

-

This instance is greater than the object

-

-or-

-

The object is a null reference (Nothing in Visual Basic)

-

-
-
- - Adjusts the value of the operand to the indicated precision and scale. - The structure whose value is to be adjusted. - The precision for the new structure. - The scale for the new structure. - A new structure whose Value has been adjusted to the precision and scale indicated in the parameters. - - - Gets the binary representation of this structure as an array of integers. - An array of integers that contains the binary representation of this structure. - - - The division operator calculates the results of dividing the first operand by the second. - A structure. - A structure. - A new structure whose property contains the results of the division. - - - Compares the supplied parameter to the property of the instance. - The to be compared. - true if object is an instance of and the two are equal. Otherwise, false. - - - Performs a logical comparison of the two operands to determine whether they are equal. - A structure. - A structure. - true if the two values are equal. Otherwise, false. If either instance is null, the value of the SqlDecimal will be null. - - - Rounds a specified number to the next lower whole number. - The structure for which the floor value is to be calculated. - A structure that contains the whole number part of this structure. - - - Returns the hash code for this instance. - A 32-bit signed integer hash code. - - - Returns the XML Schema definition language (XSD) of the specified . - A . - A string value that indicates the XSD of the specified . - - - Performs a logical comparison of two structures to determine whether the first is greater than the second. - A structure. - A structure. - A that is if the first instance is less than the second instance. Otherwise, . If either instance of is null, the of the will be . - - - Performs a logical comparison of the two parameters to determine whether the first is greater than or equal to the second. - A structure. - A structure. - A that is if the first instance is greater than or equal to the second instance. Otherwise, . If either instance of is null, the of the will be . - - - Indicates whether this structure is null. - true if this structure is null. Otherwise, false. - - - Indicates whether the of this structure is greater than zero. - true if the is assigned to null. Otherwise, false. - - - Performs a logical comparison of two structures to determine whether the first is less than the second. - A structure. - A structure. - A that is if the first instance is less than the second instance. Otherwise, . If either instance of is null, the of the will be . - - - Performs a logical comparison of the two parameters to determine whether the first is less than or equal to the second. - A structure. - A structure. - A that is if the first instance is less than or equal to the second instance. Otherwise, . If either instance of is null, the of the will be . - - - A constant representing the largest possible value for the property. - - - - A constant representing the maximum value for the property. - - - - A constant representing the maximum value of a structure. - - - - A constant representing the minimum value for a structure. - - - - The multiplication operator computes the product of the two parameters. - A structure. - A structure. - A new structure whose property contains the product of the multiplication. - - - Performs a logical comparison of the two parameters to determine whether they are not equal. - A structure. - A structure. - A that is if the two instances are not equal or if the two instances are equal. If either instance of is null, the of the will be . - - - Represents a that can be assigned to this instance of the class. - - - - Calculates the sum of the two operators. - A structure. - A structure. - A new structure whose property contains the sum. - - - The division operator calculates the results of dividing the first operand by the second. - A structure. - A structure. - A new structure whose property contains the results of the division. - - - Performs a logical comparison of the two operands to determine whether they are equal. - A structure. - A structure. - A that is if the two instances are equal or if the two instances are not equal. If either instance of is null, the of the will be . - - - - - - - - - - - - - - - - - - - - - - - - - - - Performs a logical comparison of two structures to determine whether the first is greater than the second. - A structure. - A structure. - A that is if the first instance is less than the second instance. Otherwise, . If either instance of is null, the of the will be . - - - Performs a logical comparison of the two parameters to determine whether the first is greater than or equal to the second. - A structure. - A structure. - A that is if the first instance is greater than or equal to the second instance. Otherwise, . If either instance of is null, the of the will be . - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Performs a logical comparison of the two parameters to determine whether they are not equal. - A structure. - A structure. - A that is if the two instances are not equal or if the two instances are equal. If either instance of is null, the of the will be . - - - Performs a logical comparison of two structures to determine whether the first is less than the second. - A structure. - A structure. - A that is if the first instance is less than the second instance. Otherwise, . If either instance of is null, the of the will be . - - - Performs a logical comparison of the two parameters to determine whether the first is less than or equal to the second. - A structure. - A structure. - A that is if the first instance is less than or equal to the second instance. Otherwise, . If either instance of is null, the of the will be . - - - The multiplication operator computes the product of the two parameters. - A structure. - A structure. - A new structure whose property contains the product of the multiplication. - - - Calculates the results of subtracting the second operand from the first. - A structure. - A structure. - A new structure whose Value property contains the results of the subtraction. - - - The unary minus operator negates the parameter. - The structure to be negated. - A new structure whose value contains the results of the negation. - - - Converts the representation of a number to its equivalent. - The String to be parsed. - A equivalent to the value that is contained in the specified . - - - Raises the value of the specified structure to the specified exponential power. - The structure to be raised to a power. - A double value that indicates the power to which the number should be raised. - A structure that contains the results. - - - Gets the maximum number of digits used to represent the property. - The maximum number of digits used to represent the Value of this structure. - - - Gets the number nearest the specified structure's value with the specified precision. - The structure to be rounded. - The number of significant fractional digits (precision) in the return value. - A structure that contains the results of the rounding operation. - - - Gets the number of decimal places to which is resolved. - The number of decimal places to which the Value property is resolved. - - - Gets a value that indicates the sign of a structure's property. - The structure whose sign is to be evaluated. - A number that indicates the sign of the structure. - - - Calculates the results of subtracting the second operand from the first. - A structure. - A structure. - A new structure whose Value property contains the results of the subtraction. - - - Returns the a double equal to the contents of the property of this instance. - The decimal representation of the property. - - - Converts this structure to . - true if the is non-zero; false if zero; otherwise Null. - - - Converts this structure to . - A structure whose Value equals the Value of this structure. If the structure's Value is true, the structure's Value will be 1. Otherwise, the structure's Value will be 0. - - - Converts this structure to . - A structure with the same value as this instance of . - - - Converts this structure to . - A structure with the same value as this instance of . - - - Converts this structure to . - A structure with the same value as this instance of . - - - Converts this structure to . - A structure with the same value as this instance of . - - - Converts this structure to . - A structure with the same value as this instance of . - - - Converts this structure to . - A structure with the same value as this instance of . - - - Converts this structure to . - A structure whose value is a string representing the value contained in this structure. - - - Converts this structure to . - A new object that contains the string representation of the structure's property. - - - Truncates the specified structure's value to the that you want position. - The structure to be truncated. - The decimal position to which the number will be truncated. - Supply a negative value for the position parameter in order to truncate the value to the corresponding position to the left of the decimal point. - - - Gets the value of the structure. This property is read-only. - A number in the range -79,228,162,514,264,337,593,543,950,335 through 79,228,162,514,162,514,264,337,593,543,950,335. - - - This member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - An XmlSchema. - - - This member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - XmlReader - - - This member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - XmlWriter - - - Represents a floating-point number within the range of -1.79E +308 through 1.79E +308 to be stored in or retrieved from a database. - - - Initializes a new instance of the structure using the supplied double parameter to set the new structure's property. - A double whose value will be used for the new . - - - The addition operator computes the sum of the two operands. - A structure. - A structure. - The sum of the two operands. - - - Compares this instance to the supplied and returns an indication of their relative values. - The to be compared. -

A signed number that indicates the relative values of the instance and the object.

-
Return value

-

Condition

-

Less than zero

-

This instance is less than the object.

-

Zero

-

This instance is the same as the object.

-

Greater than zero

-

This instance is greater than the object

-

-or-

-

The object is a null reference (Nothing in Visual Basic)

-

-
-
- - Compares this instance to the supplied and returns an indication of their relative values. - The to compare. -

A signed number that indicates the relative values of the instance and the object.

-
Return value

-

Condition

-

Less than zero

-

This instance is less than the object.

-

Zero

-

This instance is the same as the object.

-

Greater than zero

-

This instance is greater than the object

-

-or-

-

The object is a null reference (Nothing in Visual Basic).

-

-
-
- - The division operator divides the first operand by the second. - A structure. - A structure. - A structure that contains the results of the division operation. - - - Compares the supplied object parameter to the property of the object. - The object to be compared. - true if the two values are equal. Otherwise, false. - - - Performs a logical comparison on two instances of to determine whether they are equal. - A structure. - A structure. - true if the two values are equal. Otherwise, false. - - - Returns the hash code for this structre. - A 32-bit signed integer hash code. - - - Returns the XML Schema definition language (XSD) of the specified . - An . - A string value that indicates the XSD of the specified . - - - Compares two instances of to determine whether the first is greater than the second. - A structure. - A structure. - A that is if the first instance is greater than the second instance. Otherwise, . If either instance of is null, the of the will be . - - - Compares two instances of to determine whether the first is greater than or equal to the second. - A structure. - A structure. - A that is if the first instance is greater than or equal to the second instance. Otherwise, . If either instance of is null, the of the will be . - - - Returns a Boolean value that indicates whether this instance is null. - true if is null. Otherwise, false. - - - Compares two instances of to determine whether the first is less than the second. - A structure. - A structure. - A that is if the first instance is less than the second instance. Otherwise, . If either instance of is null, the of the will be . - - - Compares two instances of to determine whether the first is less than or equal to the second. - A structure. - A structure. - A that is if the first instance is less than or equal to the second instance. Otherwise, . If either instance of is null, the of the will be . - - - A constant representing the maximum value for a structure. - - - - A constant representing the minimum possible value of . - - - - The multiplication operator computes the product of the two operands. - A structure. - A structure. - The product of the two operands. - - - Compares two instances of to determine whether they are notequal. - A structure. - A structure. - A that is if the two instances are not equal or if the two instances are equal. If either instance of is null, the of the will be . - - - Represents a that can be assigned to this instance of the structure. - - - - The addition operator computes the sum of the two operands. - A structure. - A structure. - The sum of the two operands. - - - The division operator divides the first operand by the second. - A structure. - A structure. - A structure that contains the results of the division operation. - - - Performs a logical comparison on two instances of to determine whether they are equal. - A structure. - A structure. - true if the two values are equal. Otherwise, false. - - - - - - - - - - - - - - - Compares two instances of to determine whether the first is greater than the second. - A structure. - A structure. - A that is if the first instance is greater than the second instance. Otherwise, . If either instance of is null, the of the will be . - - - Compares two instances of to determine whether the first is greater than or equal to the second. - A structure. - A structure. - A that is if the first instance is greater than or equal to the second instance. Otherwise, . If either instance of is null, the of the will be . - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Compares two instances of to determine whether they are not equal. - A structure. - A structure. - A that is if the two instances are not equal or if the two instances are equal. If either instance of is null, the of the will be . - - - Compares two instances of to determine whether the first is less than the second. - A structure. - A structure. - A that is if the first instance is less than the second instance. Otherwise, . If either instance of is null, the of the will be . - - - Compares two instances of to determine whether the first is less than or equal to the second. - A structure. - A structure. - A that is if the first instance is less than or equal to the second instance. Otherwise, . If either instance of is null, the of the will be . - - - The multiplication operator computes the product of the two operands. - A structure. - A structure. - The product of the two operands. - - - The subtraction operator the second operand from the first. - A structure. - A structure. - The results of the subtraction operation. - - - Returns the negated value of the specified structure. - A structure. - A structure that contains the negated value. - - - Converts the representation of a number to its double-precision floating point number equivalent. - The String to be parsed. - A that contains the value represented by the String. - - - The subtraction operator the second operand from the first. - A structure. - A structure. - The results of the subtraction operation. - - - Converts this structure to . - A SqlBoolean structure whose will be if the structure's is non-zero, if the is zero and if the structure is . - - - Converts this structure to . - A SqlByte structure whose Value equals the Value of this structure. - - - Converts this structure to . - A new SqlDecimal structure whose converted value equals the rounded value of this SqlDouble. - - - Converts this structure to . - A new structure whose Value equals the integer part of the structure's value. - - - Converts this structure to . - A new structure whose Value equals the integer part of the structure's value. - - - Converts this structure to . - A new structure whose Value equals the integer part of the structure's value. - - - Converts this structure to . - A new SqlMoney structure whose is equal to the value of this . - - - Converts this structure to . - A new SqlSingle structure whose is equal to the of this . - - - Converts this structure to . - A SqlString representing the of this . - - - Converts this structure to a string. - A string representing the of this . - - - Gets the value of the structure. This property is read-only. - The value of the structure. - - - Represents a zero value that can be assigned to the property of an instance of the structure. - - - - This member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - An XML schema consumed by .NET Framework. - - - This member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - A . - - - This member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - A . - - - Represents a GUID to be stored in or retrieved from a database. - - - Initializes a new instance of the structure using the supplied byte array parameter. - A byte array. - - - Initializes a new instance of the structure using the specified parameter. - A - - - Initializes a new instance of the structure using the specified parameter. - A object. - - - Initializes a new instance of the structure using the specified values. - The first four bytes of the . - The next two bytes of the . - The next two bytes of the . - The next byte of the . - The next byte of the . - The next byte of the . - The next byte of the . - The next byte of the . - The next byte of the . - The next byte of the . - The next byte of the . - - - Compares this structure to the supplied and returns an indication of their relative values. Compares more than the last 6 bytes, but treats the last 6 bytes as the most significant ones in comparisons. - The to be compared. -

A signed number that indicates the relative values of the instance and the object.

-
Return Value

-

Condition

-

Less than zero

-

This instance is less than object.

-

Zero

-

This instance is the same as object.

-

Greater than zero

-

This instance is greater than object

-

-or-

-

object is a null reference (Nothing).

-

-
-
- - Compares this structure to the supplied object and returns an indication of their relative values. Compares more than the last 6 bytes, but treats the last 6 bytes as the most significant ones in comparisons. - The to be compared. -

A signed number that indicates the relative values of the instance and the object.

-
Return Value

-

Condition

-

Less than zero

-

This instance is less than object.

-

Zero

-

This instance is the same as object.

-

Greater than zero

-

This instance is greater than object

-

-or-

-

object is a null reference (Nothing)

-

-
-
- - Compares the supplied object parameter to the property of the object. - The object to be compared. - true if object is an instance of and the two are equal; otherwise false. - - - Performs a logical comparison of two structures to determine whether they are equal. - A structure. - A structure. - true if the two values are equal. Otherwise, false. If either instance is null, then the SqlGuid will be null. - - - Returns the hash code of this structure. - A 32-bit signed integer hash code. - - - Returns the XML Schema definition language (XSD) of the specified . - A . - A string value that indicates the XSD of the specified . - - - Compares two instances of to determine whether the first is greater than the second. - A structure. - A structure. - A that is if the first instance is greater than the second instance. Otherwise, . If either instance of is null, the of the will be . - - - Compares two instances of to determine whether the first is greater than or equal to the second. - A structure. - A structure. - A that is if the first instance is greater than or equal to the second instance. Otherwise, . If either instance of is null, the of the will be . - - - Gets a Boolean value that indicates whether this structure is null. - true if null. Otherwise, false. - - - Compares two instances of to determine whether the first is less than the second. - A structure. - A structure. - A that is if the first instance is less than the second instance. Otherwise, . If either instance of is null, the of the will be . - - - Compares two instances of to determine whether the first is less than or equal to the second. - A structure. - A structure. - A that is if the first instance is less than or equal to the second instance. Otherwise, . If either instance of is null, the of the will be . - - - Performs a logical comparison on two structures to determine whether they are not equal. - A structure. - A structure. - A that is if the two instances are not equal or if the two instances are equal. If either instance of is null, the of the will be . - - - Represents a that can be assigned to this instance of the structure. - - - - Performs a logical comparison of two structures to determine whether they are equal. - A structure. - A structure. - A that is if the two instances are equal or if the two instances are not equal. If either instance of is null, the of the will be . - - - - - - - - - - - - - - - Compares two instances of to determine whether the first is greater than the second. - A structure. - A structure. - A that is if the first instance is greater than the second instance. Otherwise, . If either instance of is null, the of the will be . - - - Compares two instances of to determine whether the first is greater than or equal to the second. - A structure. - A structure. - A that is if the first instance is greater than or equal to the second instance. Otherwise, . If either instance of is null, the of the will be . - - - - - - - Performs a logical comparison on two structures to determine whether they are not equal. - A structure. - A structure. - A that is if the two instances are not equal or if the two instances are equal. If either instance of is null, the of the will be . - - - Compares two instances of to determine whether the first is less than the second. - A structure. - A structure. - A that is if the first instance is less than the second instance. Otherwise, . If either instance of is null, the of the will be . - - - Compares two instances of to determine whether the first is less than or equal to the second. - A structure. - A structure. - A that is if the first instance is less than or equal to the second instance. Otherwise, . If either instance of is null, the of the will be . - - - Converts the specified structure to . - The String to be parsed. - A equivalent to the value that is contained in the specified . - - - Converts this structure to a byte array. - An array of bytes representing the of this structure. - - - Converts this structure to . - A SqlBinary structure that contains the bytes in the structure. - - - Converts this structure to . - A structure that contains the string representation of the structure. - - - Converts this structure to a . - A that contains the string representation of the structure. - - - Gets the value of the structure. This property is read-only. - A structure. - - - This member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - An XmlSchema. - - - This member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - XmlReader - - - This member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - XmlWriter - - - Represents a 16-bit signed integer to be stored in or retrieved from a database. - - - Initializes a new instance of the structure using the supplied short integer parameter. - A short integer. - - - Computes the sum of the two operands. - A structure. - A structure. - A structure whose property contains the sum of the two operands. - - - Computes the bitwise AND of its operands. - A structure. - A structure. - A structure whose property contains the results of the bitwise AND. - - - Computes the bitwise OR of its two operands. - A structure. - A structure. - A structure whose property contains the results of the bitwise OR. - - - Compares this instance to the supplied and returns an indication of their relative values. - The to be compared. -

A signed number that indicates the relative values of the instance and the object.

-
Return value

-

Condition

-

Less than zero

-

This instance is less than the object.

-

Zero

-

This instance is the same as the object.

-

Greater than zero

-

This instance is greater than the object

-

-or-

-

The object is a null reference (Nothing in Visual Basic)

-

-
-
- - Compares this instance to the supplied and returns an indication of their relative values. - The to be compared. -

A signed number that indicates the relative values of the instance and the object.

-
Return value

-

Condition

-

Less than zero

-

This instance is less than the object.

-

Zero

-

This instance is the same as the object.

-

Greater than zero

-

This instance is greater than the object

-

-or-

-

object is a null reference (Nothing in Visual Basic)

-

-
-
- - Divides the first operand by the second. - A structure. - A structure. - A whose property contains the results of the division. - - - Compares the specified object to the property of the object. - The object to be compared. - true if object is an instance of and the two are equal; otherwise false. - - - Performs a logical comparison of two structures to determine whether they are equal. - A structure. - A structure. - true if the two values are equal. Otherwise, false. If either instance is null, then the SqlInt16 will be null. - - - Returns the hash code for this instance. - A 32-bit signed integer hash code. - - - Returns the XML Schema definition language (XSD) of the specified . - An . - A value that indicates the XSD of the specified . - - - Compares two instances of to determine whether the first is greater than the second. - A structure. - A structure. - A that is if the first instance is greater than the second instance. Otherwise, . If either instance of is null, the of the will be . - - - Compares two structures to determine whether the first is greater than or equal to the second. - A structure. - A structure. - A that is if the first instance is greater than or equal to the second instance. Otherwise, . If either instance of is null, the of the will be . - - - Indicates whether this structure is null. - true if null. Otherwise, false. For more information, see Handling Null Values. - - - Compares two instances of to determine whether the first is less than the second. - A structure. - A structure. - A that is if the first instance is less than the second instance. Otherwise, . If either instance of is null, the of the will be . - - - Compares two structures to determine whether the first is less than or equal to the second. - A structure. - A structure. - A that is if the first instance is less than or equal to the second instance. Otherwise, . If either instance of is null, the of the will be . - - - A constant representing the largest possible value of a . - - - - A constant representing the smallest possible value of a . - - - - Computes the remainder after dividing its first operand by its second. - A structure. - A structure. - A structure whose contains the remainder. - - - Divides two values and returns the remainder. - A value. - A value. - The remainder left after division is performed on x and y. - - - Computes the product of the two parameters. - A structure. - A structure. - A structure whose contains the product of the two parameters. - - - Performs a logical comparison of two structures to determine whether they are not equal. - A structure. - A structure. - A that is if the two instances are not equal or if the two instances are equal. If either instance of is null, the of the will be . - - - Represents a that can be assigned to this instance of the structure. - - - - The ~ operator performs a bitwise one's complement operation on its operand. - A structure. - A structure whose property contains the complement of the specified structure. - - - Computes the sum of the two operands. - A structure. - A structure. - A structure whose property contains the sum of the two operands. - - - Computes the bitwise AND of its operands. - A structure. - A structure. - A structure whose property contains the results of the bitwise AND. - - - Computes the bitwise OR of its two operands. - A structure. - A structure. - A structure whose property contains the results of the bitwise OR. - - - Divides the first operand by the second. - A structure. - A structure. - A whose property contains the results of the division. - - - Performs a logical comparison of two structures to determine whether they are equal. - A structure. - A structure. - A that is if the two instances are equal or if the two instances are not equal. If either instance of is null, the of the will be . - - - Performs a bitwise exclusive-OR operation on the supplied parameters. - A structure. - A structure. - A structure whose property contains the results of the bitwise XOR. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Compares two instances of to determine whether the first is greater than the second. - A structure. - A structure. - A that is if the first instance is greater than the second instance. Otherwise, . If either instance of is null, the of the will be . - - - Compares two structures to determine whether the first is greater than or equal to the second. - A structure. - A structure. - A that is if the first instance is greater than or equal to the second instance. Otherwise, . If either instance of is null, the of the will be . - - - - - - - - - - - Performs a logical comparison of two structures to determine whether they are not equal. - A structure. - A structure. - A that is if the two instances are not equal or if the two instances are equal. If either instance of is null, the of the will be . - - - Compares two instances of to determine whether the first is less than the second. - A structure. - A structure. - A that is if the first instance is less than the second instance. Otherwise, . If either instance of is null, the of the will be . - - - Compares two structures to determine whether the first is less than or equal to the second. - A structure. - A structure. - A that is if the first instance is less than or equal to the second instance. Otherwise, . If either instance of is null, the of the will be . - - - Computes the remainder after dividing its first operand by its second. - A structure. - A structure. - A structure whose contains the remainder. - - - Computes the product of the two parameters. - A structure. - A structure. - A structure whose contains the product of the two parameters. - - - The ~ operator performs a bitwise one's complement operation on its operand. - A structure. - A structure whose property contains the complement of the specified structure. - - - Subtracts the second parameter from the first. - A structure. - A structure. - A structure whose property contains the results of the subtraction. - - - The unary minus operator negates the of the operand. - A structure. - A structure that contains the negated value. - - - Converts the representation of a number to its 16-bit signed integer equivalent. - The String to be parsed. - A 16-bit signed integer equivalent to the value that is contained in the specified . - - - Subtracts the second parameter from the first. - A structure. - A structure. - A structure whose property contains the results of the subtraction. - - - Converts this structure to . - true if the is non-zero; false if zero; otherwise Null. - - - Converts this structure to . - A structure whose equals the of this structure. If the value of the is less than 0 or greater than 255, an occurs. - - - Converts this structure to . - A new structure whose Value equals the value of this structure. - - - Converts this structure to . - A new structure whose Value equals the value of this structure. - - - Converts this structure to . - A new structure whose Value equals the value of this structure. - - - Converts this structure to . - A new structure whose Value equals the value of this structure. - - - Converts this structure to . - A new structure whose Value equals the value of this structure. - - - Converts this structure to . - A new structure whose Value equals the value of this structure. - - - Converts this structure to . - A representing the of this instance of . - - - Converts a structure to . - A object representing the of this instance of . - - - Gets the value of this instance of structure. This property is read-only. - A short integer representing the value of this structure. - - - Performs a bitwise exclusive-OR operation on the supplied parameters. - A structure. - A structure. - A structure that contains the results of the XOR operation. - - - Represents a zero value that can be assigned to the property of an instance of the structure. - - - - This member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - An XML schema consumed by .NET Framework. - - - This member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - XmlReader - - - This member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - XmlWriter - - - Represents a 32-bit signed integer to be stored in or retrieved from a database. - - - Initializes a new instance of the structure using the supplied integer value. - The integer to be converted. - - - Computes the sum of the two specified structures. - A structure. - A structure. - A structure whose property contains the sum of the specified structures. - - - Computes the bitwise AND of its operands. - A structure. - A structure. - A structure that contains the results of the bitwise AND operation. - - - Computes the bitwise OR of the specified structures. - A structure. - A structure. - A structure that contains the results of the bitwise OR operation. - - - Compares this instance to the supplied and returns an indication of their relative values. - The to be compared. -

A signed number that indicates the relative values of the instance and the object.

-
Return value

-

Condition

-

Less than zero

-

This instance is less than the object.

-

Zero

-

This instance is the same as the object.

-

Greater than zero

-

This instance is greater than the object

-

-or-

-

The object is a null reference (Nothing in Visual Basic)

-

-
-
- - Compares this instance to the supplied and returns an indication of their relative values. - The to be compared. -

A signed number that indicates the relative values of the instance and the object.

-
Return value

-

Condition

-

Less than zero

-

This instance is less than the object.

-

Zero

-

This instance is the same as the object.

-

Greater than zero

-

This instance is greater than the object

-

-or-

-

The object is a null reference (Nothing in Visual Basic).

-

-
-
- - Divides the first parameter from the second. - A structure. - A structure. - A whose property contains the results of the division. - - - Compares the supplied object parameter to the property of the object. - The object to be compared. - true if object is an instance of and the two are equal; otherwise false. - - - Performs a logical comparison of the two parameters to determine whether they are equal. - A structure. - A structure. - true if the two values are equal. Otherwise, false. If either instance is null, then the SqlInt32 will be null. - - - Returns the hash code for this instance. - A 32-bit signed integer hash code. - - - Returns the XML Schema definition language (XSD) of the specified . - An . - A string value that indicates the XSD of the specified . - - - Compares the two parameters to determine whether the first is greater than the second. - A structure. - A structure. - A that is if the first instance is greater than the second instance. Otherwise, . If either instance of is null, the of the will be . - - - Compares the two parameters to determine whether the first is greater than or equal to the second. - A structure. - A structure. - A that is if the first instance is greater than or equal to the second instance. Otherwise, . If either instance of is null, the of the will be . - - - Indicates whether this structure is null. - This property is true if is null. Otherwise, false. - - - Compares the two parameters to determine whether the first is less than the second. - A structure. - A structure. - A that is if the first instance is less than the second instance. Otherwise, . If either instance of is null, the of the will be . - - - Compares the two parameters to determine whether the first is less than or equal to the second. - A structure. - A structure. - A that is if the first instance is less than or equal to the second instance. Otherwise, . If either instance of is null, the of the will be . - - - A constant representing the largest possible value of a . - - - - A constant representing the smallest possible value of a . - - - - Computes the remainder after dividing the first parameter by the second. - A structure. - A structure. - A structure whose contains the remainder. - - - Divides two values and returns the remainder. - A value. - A value. - The remainder left after division is performed on x and y. - - - Computes the product of the two parameters. - A structure. - A structure. - A structure whose contains the product of the two parameters. - - - Performs a logical comparison of the two parameters to determine whether they are not equal. - A structure. - A structure. - A that is if the two instances are not equal or if the two instances are equal. If either instance of is null, the of the will be . - - - Represents a that can be assigned to this instance of the class. - - - - Performs a bitwise one's complement operation on the specified structure. - A structure. - A structure that contains the results of the one's complement operation. - - - Computes the sum of the two specified structures. - A structure. - A structure. - A structure whose property contains the sum of the specified structures. - - - Computes the bitwise AND of its operands. - A structure. - A structure. - A structure that contains the results of the bitwise AND operation. - - - Computes the bitwise OR of the specified structures. - A structure. - A structure. - A structure that contains the results of the bitwise OR operation. - - - Divides the first parameter from the second. - A structure. - A structure. - A whose property contains the results of the division. - - - Performs a logical comparison of the two parameters to determine whether they are equal. - A structure. - A structure. - A that is if the two instances are equal or if the two instances are not equal. If either instance of is null, the of the will be . - - - Performs a bitwise exclusive-OR operation on the specified structures. - A structure. - A structure. - A structure that contains the results of the bitwise XOR operation. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Compares the two parameters to determine whether the first is greater than the second. - A structure. - A structure. - A that is if the first instance is greater than the second instance. Otherwise, . If either instance of is null, the of the will be . - - - Compares the two parameters to determine whether the first is greater than or equal to the second. - A structure. - A structure. - A that is if the first instance is greater than or equal to the second instance. Otherwise, . If either instance of is null, the of the will be . - - - - - - - - - - - - - - - Performa a logical comparison of the two parameters to determine whether they are not equal. - A structure. - A structure. - A that is if the two instances are not equal or if the two instances are equal. If either instance of is null, the of the will be . - - - Compares the two parameters to determine whether the first is less than the second. - A structure. - A structure. - A that is if the first instance is less than the second instance. Otherwise, . If either instance of is null, the of the will be . - - - Compares the two parameters to determine whether the first is less than or equal to the second. - A structure. - A structure. - A that is if the first instance is less than or equal to the second instance. Otherwise, . If either instance of is null, the of the will be . - - - Computes the remainder after dividing the first parameter by the second. - A structure. - A structure. - A structure whose contains the remainder. - - - Computes the product of the two parameters. - A structure. - A structure. - A structure whose contains the product of the two parameters. - - - Performs a bitwise one's complement operation on the specified structure. - A structure. - A structure that contains the results of the one's complement operation. - - - Subtracts the second parameter from the first. - A structure. - A structure. - A structure whose property contains the results of the subtraction. - - - Negates the of the operand. - A structure. - A structure that contains the negated value. - - - Converts the representation of a number to its 32-bit signed integer equivalent. - The to be parsed. - A 32-bit signed integer equivalent to the value that is contained in the specified . - - - Subtracts the second parameter from the first. - A structure. - A structure. - A structure whose property contains the results of the subtraction. - - - Converts this structure to . - true if the is non-zero; false if zero; otherwise Null. - - - Converts this structure to . - A structure whose Value equals the Value of this structure. If the value of the SqlInt32 is less than 0 or greater than 255, an occurs. - - - Converts this structure to . - A new structure equal to the value of this . - - - Converts this structure to . - A new structure equal to the value of this . - - - Converts this structure to . - A new structure equal to the value of this . - - - Converts this structure to . - A new structure equal to the value of this . - - - Converts this structure to . - A new structure equal to the value of this . - - - Converts this structure to . - A new structure equal to the value of this . - - - Converts this structure to . - A new structure equal to the value of this . - - - Converts a structure to a . - A structure equal to the value of this . - - - Gets the value of this structure. This property is read-only. - An integer representing the value of this structure. - The property contains . - - - Performs a bitwise exclusive-OR operation on the specified structures. - A structure. - A structure. - A structure that contains the results of the bitwise XOR operation. - - - Represents a zero value that can be assigned to the property of an instance of the structure. - - - - This member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - An XmlSchema. - - - This member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - XmlReader - - - This member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - XmlWriter - - - Represents a 64-bit signed integer to be stored in or retrieved from a database. - - - Initializes a new instance of the structure using the supplied long integer. - A long integer. - - - Computes the sum of the two parameters. - A structure. - A structure. - A new structure whose is equal to the sum of the two parameters. - - - Computes the bitwise AND of its operands. - A structure. - A structure. - A structure that contains the results of the bitwise AND operation. - - - Computes the bitwise OR of its two operands. - A structure. - A structure. - A structure that contains the results of the bitwise OR operation. - - - Compares this instance to the supplied and returns an indication of their relative values. - The to be compared. -

A signed number that indicates the relative values of the instance and the object.

-
Return value

-

Condition

-

Less than zero

-

This instance is less than the object.

-

Zero

-

This instance is the same as the object.

-

Greater than zero

-

This instance is greater than the object

-

-or-

-

The object is a null reference (Nothing in Visual Basic).

-

-
-
- - Compares this instance to the supplied and returns an indication of their relative values. - The to be compared. -

A signed number that indicates the relative values of the instance and the object.

-
Return value

-

Condition

-

Less than zero

-

This instance is less than the object.

-

Zero

-

This instance is the same as the object.

-

Greater than zero

-

This instance is greater than the object

-

-or-

-

The object is a null reference (Nothing in Visual Basic).

-

-
-
- - Divides the first parameter by the second. - A structure. - A structure. - A new structure whose property contains the results of the division operation. - - - Compares the supplied object parameter to the property of the object. - The object to be compared. - true if object is an instance of and the two are equal; otherwise false. - - - Performs a logical comparison of the two parameters to determine whether they are equal. - A structure. - A structure. - true if the two values are equal. Otherwise, false. If either instance is null, then the SqlInt64 will be null. - - - Returns the hash code for this instance. - A 32-bit signed integer hash code. - - - Returns the XML Schema definition language (XSD) of the specified . - An . - A string that indicates the XSD of the specified . - - - Performs a logical comparison of the two parameters to determine whether the first is greater than the second. - A structure. - A structure. - A that is if the first instance is greater than the second instance. Otherwise, . If either instance of is null, the of the will be . - - - Performs a logical comparison of the two parameters to determine whether the first is greater than or equal to the second. - A structure. - A structure. - A that is if the first instance is greater than or equal to the second instance. Otherwise, . If either instance of is null, the of the will be . - - - Gets a Boolean value that indicates whether this structure is null. - true if null. Otherwise, false. - - - Performs a logical comparison on the two parameters to determine whether the first is less than the second. - A structure. - A structure. - A that is if the first instance is less than the second instance. Otherwise, . If either instance of is null, the of the will be . - - - Performs a logical comparison on the two parameters to determine whether the first is less than or equal to the second. - A structure. - A structure. - A that is if the first instance is less than or equal to the second instance. Otherwise, . If either instance of is null, the of the will be . - - - A constant representing the largest possible value for a structure. - - - - A constant representing the smallest possible value for a structure. - - - - Computes the remainder after dividing the first parameter by the second. - A structure. - A structure. - A new structure whose property contains the remainder. - - - Divides two values and returns the remainder. - A value. - A value. - The remainder left after division is performed on x and y. - - - Computes the product of the two parameters. - A structure. - A structure. - A new structure whose is equal to the product of the two parameters. - - - Performs a logical comparison on the two SqlInt64 parameters to determine whether they are not equal. - A structure. - A structure. - A that is if the two instances are not equal or if the two instances are equal. If either instance of is null, the of the will be . - - - Represents a that can be assigned to this instance of the structure. - - - - Performs a bitwise one's complement operation on its operand. - A structure. - A new structure whose is equal to the ones complement of the parameter. - - - Computes the sum of the two parameters. - A structure. - A structure. - A new structure whose is equal to the sum of the two parameters. - - - Computes the bitwise AND of its operands. - A structure. - A structure. - A structure that contains the results of the bitwise AND operation. - - - Computes the bitwise OR of its two operands. - A structure. - A structure. - A structure that contains the results of the bitwise OR operation. - - - Divides the first parameter by the second. - A structure. - A structure. - A new structure whose property contains the results of the division operation. - - - Performs a logical comparison of the two parameters to determine whether they are equal. - A structure. - A structure. - A that is if the two instances are equal or if the two instances are not equal. If either instance of is null, the of the will be . - - - Performs a bitwise exclusive-OR operation on the supplied parameters. - A structure. - A structure. - A structure that contains the results of the bitwise XOR operation. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Performs a logical comparison of the two parameters to determine whether the first is greater than the second. - A structure. - A structure. - A that is if the first instance is greater than the second instance. Otherwise, . If either instance of is null, the of the will be . - - - Performs a logical comparison of the two parameters to determine whether the first is greater than or equal to the second. - A structure. - A structure. - A that is if the first instance is greater than or equal to the second instance. Otherwise, . If either instance of is null, the of the will be . - - - - - - - - - - - - - - - - - - - Performs a logical comparison on the two SqlInt64 parameters to determine whether they are not equal. - A structure. - A structure. - A that is if the two instances are not equal or if the two instances are equal. If either instance of is null, the of the will be . - - - Performs a logical comparison on the two parameters to determine whether the first is less than the second. - A structure. - A structure. - A that is if the first instance is less than the second instance. Otherwise, . If either instance of is null, the of the will be . - - - Performs a logical comparison on the two parameters to determine whether the first is less than or equal to the second. - A structure. - A structure. - A that is if the first instance is less than or equal to the second instance. Otherwise, . If either instance of is null, the of the will be . - - - Computes the remainder after dividing the first parameter by the second. - A structure. - A structure. - A new structure whose property contains the remainder. - - - Computes the product of the two parameters. - A structure. - A structure. - A new structure whose is equal to the product of the two parameters. - - - Performs a bitwise one's complement operation on its operand. - A structure. - A new structure whose is equal to the ones complement of the parameter. - - - Subtracts the second parameter from the first. - A structure. - A structure. - A new structure whose property equals the results of the subtraction operation. - - - The unary minus operator negates the of the operand. - A structure. - A structure whose is equal to the negated of the parameter. - - - Converts the representation of a number to its 64-bit signed integer equivalent. - The to be parsed. - A 64-bit signed integer equivalent to the value that is contained in the specified . - - - Subtracts the second parameter from the first. - A structure. - A structure. - A new structure whose property equals the results of the subtraction operation. - - - Converts this structure to . - true if the is non-zero; false if zero; otherwise Null. - - - Converts this structure to . - A structure whose Value equals the Value of this structure. - - - Converts this structure to . - A new equal to the value of this . - - - Converts this structure to . - A new equal to the value of this . - - - Converts this structure to . - A new equal to the value of this . - - - Converts this structure to . - A new equal to the value of this . - - - Converts this structure to . - A new equal to the value of this . - - - Converts this structure to . - A new equal to the value of this . - - - Converts this structure to . - A representing the value of this . - - - Converts this instance of to . - A representing the value of this . - - - Gets the value of this structure. This property is read-only. - A long integer representing the value of this structure. - - - Performs a bitwise exclusive-OR operation on the supplied parameters. - A structure. - A structure. - A structure that contains the results of the bitwise XOR operation. - - - Represents a zero value that can be assigned to the property of an instance of the structure. - - - - This member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - An XmlSchema. - - - This member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - XmlReader - - - This member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - XmlWriter - - - Represents a currency value ranging from -2 63 (or -922,337,203,685,477.5808) to 2 63 -1 (or +922,337,203,685,477.5807) with an accuracy to a ten-thousandth of currency unit to be stored in or retrieved from a database. - - - Initializes a new instance of the class with the specified value. - The monetary value to initialize. - - - Initializes a new instance of the class with specified double value. - The monetary value to initialize. - - - Initializes a new instance of the class with the specified integer value. - The monetary value to initialize. - - - Initializes a new instance of the class with the specified long integer value. - The monetary value to initialize. - - - Calculates the sum of the two parameters. - A structure. - A structure. - A new stucture whose contains the sum of the two parameters. - - - Compares this instance to the supplied and returns an indication of their relative values. - The to be compared. -

A signed number that indicates the relative values of the instance and the object.

-
Return value

-

Condition

-

Less than zero

-

This instance is less than the object.

-

Zero

-

This instance is the same as the object.

-

Greater than zero

-

This instance is greater than the object

-

-or-

-

The object is a null reference (Nothing in Visual Basic)

-

-
-
- - Compares this instance to the supplied and returns an indication of their relative values. - The to be compared. -

A signed number that indicates the relative values of the instance and the object.

-
Return value

-

Condition

-

Less than zero

-

This instance is less than the object.

-

Zero

-

This instance is the same as the object.

-

Greater than zero

-

This instance is greater than the object

-

-or-

-

The object is a null reference (Nothing in Visual Basic)

-

-
-
- - The division operator divides the first parameter by the second. - A structure. - A structure. - A new structure whose contains the results of the division. - - - Compares the supplied object parameter to the property of the object. - The object to be compared. - Equals will return true if the object is an instance of and the two are equal; otherwise false. - - - Performs a logical comparison of the two parameters to determine whether they are equal. - A structure. - A structure. - true if the two values are equal. Otherwise, false. If either instance is null, then the SqlMoney will be null. - - - Gets the hash code for this instance. - A 32-bit signed integer hash code. - - - Returns the XML Schema definition language (XSD) of the specified . - An . - A string that indicates the XSD of the specified . - - - Performs a logical comparison of the two parameters to determine whether the first is greater than the second. - A structure. - A structure. - A that is if the first instance is greater than the second instance. Otherwise, . If either instance of is null, the of the will be . - - - Performs a logical comparison of the two parameters to determine whether the first is greater than or equal to the second. - A structure. - A structure. - A that is if the first instance is greater than or equal to the second instance. Otherwise, . If either instance of is null, the of the will be . - - - Returns a Boolean value that indicates whether this structure is null. - true if null. Otherwise, false. - - - Performs a logical comparison of the two parameters to determine whether the first is less than the second. - A structure. - A structure. - A that is if the first instance is less than the second instance. Otherwise, . If either instance of is null, the of the will be . - - - Performs a logical comparison of the two parameters to determine whether the first is less than or equal to the second. - A structure. - A structure. - A that is if the first instance is less than or equal to the second instance. Otherwise, . If either instance of is null, the of the will be . - - - Represents the maximum value that can be assigned to the property of an instance of the class. - - - - Represents the minimum value that can be assigned to property of an instance of the class. - - - - The multiplicaion operator calculates the product of the two parameters. - A structure. - A structure. - A new structure whose contains the product of the multiplication. - - - Performs a logical comparison of the two parameters to determine whether they are not equal. - A structure. - A structure. - A that is if the two instances are not equal or if the two instances are equal. If either instance of is null, the of the will be . - - - Represents a that can be assigned to this instance of the class. - - - - Calculates the sum of the two parameters. - A structure. - A structure. - A new stucture whose contains the sum of the two parameters. - - - The division operator divides the first parameter by the second. - A structure. - A structure. - A new structure whose contains the results of the division. - - - Performs a logical comparison of the two parameters to determine whether they are equal. - A structure. - A structure. - A that is if the two instances are equal or if the two instances are not equal. If either instance of is null, the of the will be . - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Performs a logical comparison of the two parameters to determine whether the first is greater than the second. - A structure. - A structure. - A that is if the first instance is greater than the second instance. Otherwise, . If either instance of is null, the of the will be . - - - Performs a logical comparison of the two parameters to determine whether the first is greater than or equal to the second. - A structure. - A structure. - A that is if the first instance is greater than or equal to the second instance. Otherwise, . If either instance of is null, the of the will be . - - - - - - - - - - - - - - - - - - - - - - - - - - - Performs a logical comparison of the two parameters to determine whether they are not equal. - A structure. - A structure. - A that is if the two instances are not equal or if the two instances are equal. If either instance of is null, the of the will be . - - - Performs a logical comparison of the two parameters to determine whether the first is less than the second. - A structure. - A structure. - A that is if the first instance is less than the second instance. Otherwise, . If either instance of is null, the of the will be . - - - Performs a logical comparison of the two parameters to determine whether the first is less than or equal to the second. - A structure. - A structure. - A that is if the first instance is less than or equal to the second instance. Otherwise, . If either instance of is null, the of the will be . - - - The multiplicaion operator calculates the product of the two parameters. - A structure. - A structure. - A new structure whose contains the product of the multiplication. - - - The subtraction operator subtracts the second parameter from the first. - A structure. - A structure. - A new structure that contains the results of the subtraction. - - - The unary minus operator negates the parameter. - The structure to be negated. - A structure whose contains the results of the negation. - - - Converts the representation of a number to its equivalent. - The String to be parsed. - A equivalent to the value that is contained in the specified . - - - The subtraction operator subtracts the second parameter from the first. - A structure. - A structure. - A new structure that contains the results of the subtraction. - - - Converts the Value of this instance of as a structure. - A structure whose value equals the property of this structure. - - - Converts this structure to a . - A double with a value equal to this structure. - - - Converts this structure to an . - A 32-bit integer whose value equals the integer part of this structure. - - - Converts the Value of this structure to an . - A 64-bit integer whose value equals the integer part of this structure. - - - Converts this structure to . - A structure. If the value of the structure is zero, the structure's value will be . Otherwise, . - - - Converts this structure to . - A equal to the value of this . - - - Converts this structure to . - A new equal to the value of this . - - - Converts this structure to . - A new equal to the value of this . - - - Converts this structure to . - A new equal to the value of this . - - - Converts this structure to . - A new equal to the value of this . - - - Converts this structure to . - A new equal to the value of this . - - - Converts this structure to . - A new equal to the value of this . - - - Converts this structure to . - A structure whose value is a string representing the value of this . - - - Converts this instance of to string. - A string whose value is the string representation of the value of this . - - - Gets the monetary value of an instance of the structure. This property is read-only. - The monetary value of an instance of the structure. - The property is set to null. - - - Represents the zero value that can be assigned to the property of an instance of the class. - - - - This member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - An XmlSchema. - - - This member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - XmlReader - - - This member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - XmlWriter - - - The class is not intended for use as a stand-alone component, but as a class from which other classes derive standard functionality. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. - The string to display when the exception is thrown. - - - Initializes a new instance of the class. - The string to display when the exception is thrown. - A reference to an inner exception. - - - The exception that is thrown when the Value property of a structure is set to null. - - - Initializes a new instance of the class with a system-supplied message that describes the error. - - - Initializes a new instance of the class with a specified message that describes the error. - The message that describes the exception. The caller of this constructor is required to ensure that this string has been localized for the current system culture. - - - Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. - The message that describes the exception. The caller of this constructor is required to ensure that this string has been localized for the current system culture. - The exception that is the cause of the current exception. If the innerException parameter is not null, the current exception is raised in a catch block that handles the inner exception. - - - Represents a floating point number within the range of -3.40E +38 through 3.40E +38 to be stored in or retrieved from a database. - - - Initializes a new instance of the structure using the supplied double parameter. - A double value which will be used as the of the new structure. - - - Initializes a new instance of the structure. - A floating point number which will be used as the of the new structure. - - - Computes the sum of the two specified structures. - A structure. - A structure. - A structure that contains the sum of the two specified structures. - - - Compares this instance to the supplied and returns an indication of their relative values. - The to be compared. -

A signed number that indicates the relative values of the instance and the object.

-
Return Value

-

Condition

-

Less than zero

-

This instance is less than the object.

-

Zero

-

This instance is the same as the object.

-

Greater than zero

-

This instance is greater than the object

-

-or-

-

The object is a null reference (Nothing in Visual Basic)

-

-
-
- - Compares this instance to the supplied and returns an indication of their relative values. - The to be compared. -

A signed number that indicates the relative values of the instance and the object.

-
Return value

-

Condition

-

Less than zero

-

This instance is less than the object.

-

Zero

-

This instance is the same as the object.

-

Greater than zero

-

This instance is greater than the object

-

-or-

-

The object is a null reference (Nothing in Visual Basic)

-

-
-
- - Divides the first structure by the second. - A structure. - A structure. - A SqlInt64 structure that contains the results of the division. - - - Compares the supplied object parameter to the property of the object. - The object to be compared. - true if the object is an instance of and the two are equal. Otherwise, false. - - - Performs a logical comparison of the two parameters to determine whether they are equal. - A structure. - A structure. - true if the two values are equal. Otherwise, false. If either instance is null, then the SqlSingle will be null. - - - Gets the hash code for this instance. - A 32-bit signed integer hash code. - - - Returns the XML Schema definition language (XSD) of the specified . - A . - A string value that indicates the XSD of the specified . - - - Performs a logical comparison of the two operands to determine whether the first is greater than the second. - A structure. - A structure. - A that is if the first instance is greater than the second instance. Otherwise, . If either instance of is null, the of the will be . - - - Performs a logical comparison of two structures to determine whether the first is greater than or equal to the second. - A structure. - A structure. - A that is if the first instance is greater than or equal to the second instance. Otherwise, . If either instance of is null, the of the will be . - - - Indicates whether this structure is null. - true if null. Otherwise, false. - - - Performs a logical comparison of the two parameters to determine whether the first is less than the second. - A structure. - A structure. - A that is if the first instance is less than the second instance. Otherwise, . If either instance of is null, the of the will be . - - - Performs a logical comparison of the two parameters to determine whether the first is less than or equal to the second. - A structure. - A structure. - A that is if the first instance is less than or equal to the second instance. Otherwise, . If either instance of is null, the of the will be . - - - Represents the maximum value that can be assigned to the property of an instance of the class. - - - - Represents the minimum value that can be assigned to property of an instance of the class. - - - - Computes the product of the two specified structures. - A structure. - A structure. - A structure that contains the product of the multiplication. - - - Performs a logical comparison of the two parameters to determine whether they are not equal. - A structure. - A structure. - A that is if the two instances are not equal or if the two instances are equal. If either instance of is null, the of the will be . - - - Represents a that can be assigned to this instance of the structure. - - - - Computes the sum of the two specified structures. - A structure. - A structure. - A structure that contains the sum of the two specified structures. - - - Divides the first structure by the second. - A structure. - A structure. - A structure that contains the results of the division. - - - Performs a logical comparison of the two SqlSingle parameters to determine whether they are equal. - A structure. - A structure. - A that is if the two instances are equal or if the two instances are not equal. If either instance of is null, the of the will be . - - - - - - - - - - - - - - - - - - - Performs a logical comparison of the two operands to determine whether the first is greater than the second. - A structure. - A structure. - A that is if the first instance is greater than the second instance. Otherwise, . If either instance of is null, the of the will be . - - - Performs a logical comparison of two structures to determine whether the first is greater than or equl to the second. - A structure. - A structure. - A that is if the first instance is greater than or equal to the second instance. Otherwise, . If either instance of is null, the of the will be . - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Performs a logical comparison of the two parameters to determine whether they are not equal. - A structure. - A structure. - A that is if the two instances are not equal or if the two instances are equal. If either instance of is null, the of the will be . - - - Performs a logical comparison of the two parameters to determine whether the first is less than the second. - A structure. - A structure. - A that is if the first instance is less than the second instance. Otherwise, . If either instance of is null, the of the will be . - - - Performs a logical comparison of the two parameters to determine whether the first is less than or equal to the second. - A structure. - A structure. - A that is if the first instance is less than or equal to the second instance. Otherwise, . If either instance of is null, the of the will be . - - - Computes the product of the two specified structures. - A structure. - A structure. - A structure that contains the product of the multiplication. - - - Subtracts the second structure from the first. - A structure. - A structure. - A structure that contains the results of the subtraction. - - - Negates the of the specified structure. - A structure. - A structure that contains the negated value. - - - Converts the specified to a structure. - The to be parsed. - A equivalent to the value that is contained in the specified . - - - Subtracts the second structure from the first. - A structure. - A structure. - A structure that contains the results of the subtraction. - - - Converts this structure to . - true if the is non-zero; false if zero; otherwise Null. - - - Converts this structure to . - A structure whose Value equals the Value of this structure. If the structure's Value is true, the structure's Value will be 1. Otherwise, the structure's Value will be 0. - - - Converts this structure to . - A new SqlDecimal equal to the value of this . - - - Converts this structure to . - A new SqlDouble equal to the value of this . - - - Converts this structure to . - A new SqlInt16 equal to the value of this . - - - Converts this structure to . - A new equal to the value of this . - - - Converts this structure to . - A new equal to the value of this . - - - Converts this structure to . - A equal to the value of this . - - - Converts this structure to . - A representing the value of this . - - - Converts this structure to . - A String object representing the value of this . - - - Gets the value of this structure. This property is read-only. - A floating point value in the range -3.40E+38 through 3.40E+38. - - - Represents the zero value that can be assigned to the property of an instance of the class. - - - - This member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - An XmlSchema. - - - This member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - XmlReader - - - This member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - XmlWriter - - - Represents a variable-length stream of characters to be stored in or retrieved from the database. has a different underlying data structure from its corresponding .NET Framework data type. - - - Initializes a new instance of the structure using the specified string. - The string to store. - - - Initializes a new instance of the structure using the specified string and locale id values. - The string to store. - Specifies the geographical locale and language for the new structure. - - - Initializes a new instance of the structure using the specified locale id, compare options, and data. - Specifies the geographical locale and language for the new structure. - Specifies the compare options for the new structure. - The data array to store. - - - Initializes a new instance of the structure using the specified string, locale id, and compare option values. - The string to store. - Specifies the geographical locale and language for the new structure. - Specifies the compare options for the new structure. - - - Initializes a new instance of the class. - Specifies the geographical locale and language for the new structure. - Specifies the compare options for the new structure. - The data array to store. - true if Unicode encoded. Otherwise, false. - - - Initializes a new instance of the class. - Specifies the geographical locale and language for the new structure. - Specifies the compare options for the new structure. - The data array to store. - The starting index within the array. - The number of characters from index to copy. - - - Initializes a new instance of the class. - Specifies the geographical locale and language for the new structure. - Specifies the compare options for the new structure. - The data array to store. - The starting index within the array. - The number of characters from index to copy. - true if Unicode encoded. Otherwise, false. - - - Concatenates two specified values to create a new structure. - A . - A . - A that is the concatenated value of x and y. - - - Specifies that sorts should be based on a characters numeric value instead of its alphabetical value. - - - - Specifies that sorts should be based on a character's numeric value instead of its alphabetical value. - - - - Creates a copy of this object. - A new object in which all property values are the same as the original. - - - Gets the object that defines how string comparisons should be performed for this structure. - A CompareInfo object that defines string comparison for this structure. - - - Gets the enumeration equilvalent of the specified value. - A value that describes the comparison options for this structure. - A CompareOptions value that corresponds to the SqlCompareOptions for this structure. - - - Compares this instance to the supplied and returns an indication of their relative values. - The to be compared. -

A signed number that indicates the relative values of the instance and the object.

-
Return value

-

Condition

-

Less than zero

-

This instance is less than the object.

-

Zero

-

This instance is the same as the object.

-

Greater than zero

-

This instance is greater than the object

-

-or-

-

The object is a null reference (Nothing in Visual Basic).

-

-
-
- - Compares this object to the supplied and returns an indication of their relative values. - The to be compared. -

A signed number that indicates the relative values of the instance and the object.

-
Return Value

-

Condition

-

Less than zero

-

This instance is less than the object.

-

Zero

-

This instance is the same as the object.

-

Greater than zero

-

This instance is greater than the object

-

-or-

-

The object is a null reference (Nothing in Visual Basic)

-

-
-
- - Concatenates the two specified structures. - A . - A . - A that contains the newly concatenated value representing the contents of the two parameters. - - - Gets the structure that represents information about the culture of this object. - A structure that describes information about the culture of this SqlString structure including the names of the culture, the writing system, and the calendar used, and also access to culture-specific objects that provide methods for common operations, such as formatting dates and sorting strings. - - - Performs a logical comparison of the two operands to determine whether they are equal. - A . - A . - true if the two values are equal. Otherwise, false. If either instance is null, then the SqlString will be null. - - - Compares the supplied object parameter to the property of the object. - The object to be compared. - Equals will return true if the object is an instance of and the two are equal; otherwise false. - - - Gets the hash code for this instance. - A 32-bit signed integer hash code. - - - Gets an array of bytes, that contains the contents of the in ANSI format. - An byte array, that contains the contents of the in ANSI format. - - - Gets an array of bytes, that contains the contents of the in Unicode format. - An byte array, that contains the contents of the in Unicode format. - - - Returns the XML Schema definition language (XSD) of the specified . - A . - A string value that indicates the XSD of the specified . - - - Performs a logical comparison of the two operands to determine whether the first is greater than the second. - A . - A . - A that is if the first instance is greater than the second instance. Otherwise, . If either instance of is null, the of the will be . - - - Performs a logical comparison of the two operands to determine whether the first is greater than or equal to the second. - A . - A . - A that is if the first instance is greater than or equal to the second instance. Otherwise, . If either instance of is null, the of the will be . - - - Specifies that comparisons should ignore case. - - - - Specifies that the string comparison must ignore the Kana type. - - - - Specifies that the string comparison must ignore non-space combining characters, such as diacritics. - - - - Specifies that the string comparison must ignore the character width. - - - - Indicates whether this structure is null. - true if is . Otherwise, false. - - - Specifies the geographical locale and language for the structure. - The locale id for the string stored in the property. - - - Performs a logical comparison of the two operands to determine whether the first is less than the second. - A . - A . - A that is if the first instance is less than the second instance. Otherwise, . If either instance of is null, the of the will be . - - - Performs a logical comparison of the two operands to determine whether the first is less than or equal to the second. - A . - A . - A that is if the first instance is less than or equal to the second instance. Otherwise, . If either instance of is null, the of the will be . - - - Performs a logical comparison of the two operands to determine whether they are not equal. - A . - A . - A that is if the two instances are not equal or if the two instances are equal. If either instance of is null, the of the will be . - - - Represents a that can be assigned to this instance of the structure. - - - - Concatenates the two specified structures. - A . - A . - A that contains the newly concatenated value representing the contents of the two parameters. - - - Performs a logical comparison of the two operands to determine whether they are equal. - A . - A . - A that is if the two instances are equal or if the two instances are not equal. If either instance of is null, the of the will be . - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Performs a logical comparison of the two operands to determine whether the first is greater than the second. - A . - A . - A that is if the first instance is greater than the second instance. Otherwise, . If either instance of is null, the of the will be . - - - Performs a logical comparison of the two operands to determine whether the first is greater than or equal to the second. - A . - A . - A that is if the first instance is greater than or equal to the second instance. Otherwise, . If either instance of is null, the of the will be . - - - - - - - Performs a logical comparison of the two operands to determine whether they are not equal. - A . - A . - A that is if the two instances are not equal or if the two instances are equal. If either instance of is null, the of the will be . - - - Performs a logical comparison of the two operands to determine whether the first is less than the second. - A . - A . - A that is if the first instance is less than the second instance. Otherwise, . If either instance of is null, the of the will be . - - - Performs a logical comparison of the two operands to determine whether the first is less than or equal to the second. - A . - A . - A that is if the first instance is less than or equal to the second instance. Otherwise, . If either instance of is null, the of the will be . - - - A combination of one or more of the enumeration values that represent the way in which this should be compared to other structures. - A value specifying how this should be compared to other structures. - - - Converts this structure to . - true if the is non-zero; false if zero; otherwise Null. - - - Converts this structure to . - A new SqlByte structure whose equals the number represented by this structure. - - - Converts this structure to . - A new SqlDateTime structure that contains the date value represented by this . - - - Converts this structure to . - A new that contains the value of this . - - - Converts this structure to . - A new that is equal to the numeric value of this . - - - Converts this structure to . - A new structure whose is the Guid represented by this structure. - - - Converts this structure to . - A new that is equal to the numeric value of this . - - - Converts this structure to . - A new that is equal to the numeric value of this . - - - Converts this structure to . - A new that is equal to the numeric value of this . - - - Converts this structure to . - A new that is equal to the numeric value of this . - - - Converts this structure to . - A new that is equal to the numeric value of this .. - - - Converts a object to a . - A with the same value as this structure. - - - Gets the string that is stored in this structure. This property is read-only. - The string that is stored. - The value of the string is . - - - This member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - An XmlSchema. - - - This member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - XmlReader - - - This member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - XmlWriter - - - The exception that is thrown when you set a value into a structure would truncate that value. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with a specified error message. - The error message that explains the reason for the exception. - - - Initializes a new instance of the class with a specified error message and a reference to the . - The error message that explains the reason for the exception. - A reference to an inner . - - - The base exception class for the . - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with a specified error message. - The error message that explains the reason for the exception. - - - Initializes a new instance of the class with serialized data. - The object that holds the serialized object data. - The contextual information about the source or destination. - - - Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. - The message that describes the exception. The caller of this constructor is required to ensure that this string has been localized for the current system culture. - The exception that is the cause of the current exception. If the innerException parameter is not null, the current exception is raised in a catch block that handles the inner exception. - - - Represents XML data stored in or retrieved from a server. - - - Creates a new instance. - - - Creates a new instance, supplying the XML value from the supplied -derived instance. - A -derived instance (such as ) from which to load the instance's Xml content. - - - Creates a new instance and associates it with the content of the supplied . - An -derived class instance to be used as the value of the new instance. - - - Gets the value of the XML content of this as a . - A -derived instance that contains the XML content. The actual type may vary (for example, the return value might be ) depending on how the information is represented internally, on the server. - Attempt was made to access this property on a null instance of . - - - Returns the XML Schema definition language (XSD) of the specified . - An . - A string that indicates the XSD of the specified . - - - Indicates whether this instance represents a null value. - true if Value is null. Otherwise, false. - - - Represents a null instance of the type. - A null instance of the type. - - - Gets the string representation of the XML content of this instance. - The string representation of the XML content. - - - For a description of this member, see . - An that describes the XML representation of the object that is produced by the method and consumed by the method. - - - For a description of this member, see . - An XmlReader. - - - For a description of this member, see . - An XmlWriter - - - The enumeration is not intended for use as a stand-alone component, but as an enumeration from which other classes derive standard functionality. - - - Buffer size. - - - - Stream. - - - - Unmanaged buffer. - - - - The structure is an object representation of a token that represents symbolic information. - - - Initializes a new instance of the structure when given a value. - The value to be used for the token. - - - Determines whether obj is equal to this instance. - The to check. - true if obj is equal to this instance; otherwise, false. - - - Determines whether obj is an instance of and is equal to this instance. - The object to check. - true if obj is an instance of and is equal to this instance; otherwise, false. - - - Generates the hash code for the current token. - The hash code for the current token. - - - Gets the value of the current token. - The value of the current token. - - - Returns a value indicating whether two objects are equal. - A structure. - A structure. - true if a and b are equal; otherwise, false. - - - Returns a value indicating whether two objects are not equal. - A structure. - A structure. - true if a and b are not equal; otherwise, false. - - - Holds the public GUIDs for document types to be used with the symbol store. - - - Initializes a new instance of the class. - - - Specifies the GUID of the document type to be used with the symbol store. - - - - Holds the public GUIDs for language types to be used with the symbol store. - - - Initializes a new instance of the class. - - - Specifies the GUID of the Basic language type to be used with the symbol store. - - - - Specifies the GUID of the C language type to be used with the symbol store. - - - - Specifies the GUID of the Cobol language type to be used with the symbol store. - - - - Specifies the GUID of the C++ language type to be used with the symbol store. - - - - Specifies the GUID of the C# language type to be used with the symbol store. - - - - Specifies the GUID of the ILAssembly language type to be used with the symbol store. - - - - Specifies the GUID of the Java language type to be used with the symbol store. - - - - Specifies the GUID of the JScript language type to be used with the symbol store. - - - - Specifies the GUID of the C++ language type to be used with the symbol store. - - - - Specifies the GUID of the Pascal language type to be used with the symbol store. - - - - Specifies the GUID of the SMC language type to be used with the symbol store. - - - - Holds the public GUIDs for language vendors to be used with the symbol store. - - - Initializes a new instance of the class. - - - Specifies the GUID of the Microsoft language vendor. - - - - Directs tracing or debugging output to a or to a , such as . - - - Initializes a new instance of the class with as the output recipient. - - - Initializes a new instance of the class, using the stream as the recipient of the debugging and tracing output. - A that represents the stream the writes to. - The stream is null. - - - Initializes a new instance of the class using the specified writer as recipient of the tracing or debugging output. - A that receives the output from the . - The writer is null. - - - Initializes a new instance of the class, using the file as the recipient of the debugging and tracing output. - The name of the file the writes to. - The file is null. - - - Initializes a new instance of the class with the specified name, using the stream as the recipient of the debugging and tracing output. - A that represents the stream the writes to. - The name of the new instance. - The stream is null. - - - Initializes a new instance of the class with the specified name, using the specified writer as recipient of the tracing or debugging output. - A that receives the output from the . - The name of the new instance. - The writer is null. - - - Initializes a new instance of the class with the specified name, using the file as the recipient of the debugging and tracing output. - The name of the file the writes to. - The name of the new instance. - The stream is null. - - - Closes the so that it no longer receives tracing or debugging output. - - - Disposes this object. - true to release managed resources; if false, has no effect. - - - Flushes the output buffer for the . - - - Writes a message to this instance's . - A message to write. - - - Writes a message to this instance's followed by a line terminator. The default line terminator is a carriage return followed by a line feed (\r\n). - A message to write. - - - Gets or sets the text writer that receives the tracing or debugging output. - A that represents the writer that receives the tracing or debugging output. - - - Specifies the priority level of a thread. - - - Specifies one step above the normal priority for the associated . - - - - Specifies one step below the normal priority for the associated . - - - - Specifies highest priority. This is two steps above the normal priority for the associated . - - - - Specifies idle priority. This is the lowest possible priority value of all threads, independent of the value of the associated . - - - - Specifies lowest priority. This is two steps below the normal priority for the associated . - - - - Specifies normal priority for the associated . - - - - Specifies time-critical priority. This is the highest priority of all threads, independent of the value of the associated . - - - - Specifies the current execution state of the thread. - - - A state that indicates the thread has been initialized, but has not yet started. - - - - A state that indicates the thread is waiting to use a processor because no processor is free. The thread is prepared to run on the next available processor. - - - - A state that indicates the thread is currently using a processor. - - - - A state that indicates the thread is about to use a processor. Only one thread can be in this state at a time. - - - - A state that indicates the thread has finished executing and has exited. - - - - A state that indicates the thread is waiting for a resource, other than the processor, before it can execute. For example, it might be waiting for its execution stack to be paged in from disk. - - - - The state of the thread is unknown. - - - - A state that indicates the thread is not ready to use the processor because it is waiting for a peripheral operation to complete or a resource to become free. When the thread is ready, it will be rescheduled. - - - - Specifies the reason a thread is waiting. - - - The thread is waiting for event pair high. - - - - The thread is waiting for event pair low. - - - - Thread execution is delayed. - - - - The thread is waiting for the scheduler. - - - - The thread is waiting for a free virtual memory page. - - - - The thread is waiting for a local procedure call to arrive. - - - - The thread is waiting for reply to a local procedure call to arrive. - - - - The thread is waiting for a virtual memory page to arrive in memory. - - - - The thread is waiting for a virtual memory page to be written to disk. - - - - Thread execution is suspended. - - - - The thread is waiting for system allocation. - - - - The thread is waiting for an unknown reason. - - - - The thread is waiting for a user request. - - - - The thread is waiting for the system to allocate virtual memory. - - - - Provides a set of methods and properties that help you trace the execution of your code. This class cannot be inherited. - - - Checks for a condition; if the condition is false, displays a message box that shows the call stack. - The conditional expression to evaluate. If the condition is true, a failure message is not sent and the message box is not displayed. - - - Checks for a condition; if the condition is false, outputs a specified message and displays a message box that shows the call stack. - The conditional expression to evaluate. If the condition is true, the specified message is not sent and the message box is not displayed. - The message to send to the collection. - - - Checks for a condition; if the condition is false, outputs two specified messages and displays a message box that shows the call stack. - The conditional expression to evaluate. If the condition is true, the specified messages are not sent and the message box is not displayed. - The message to send to the collection. - The detailed message to send to the collection. - - - Gets or sets whether should be called on the after every write. - true if is called on the after every write; otherwise, false. - - - Flushes the output buffer, and then closes the . - - - Gets the correlation manager for the thread for this trace. - The object associated with the thread for this trace. - - - Emits the specified error message. - A message to emit. - - - Emits an error message, and a detailed error message. - A message to emit. - A detailed message to emit. - - - Flushes the output buffer, and causes buffered data to be written to the . - - - Increases the current by one. - - - Gets or sets the indent level. - The indent level. The default is zero. - - - Gets or sets the number of spaces in an indent. - The number of spaces in an indent. The default is four. - - - Gets the collection of listeners that is monitoring the trace output. - A that represents a collection of type monitoring the trace output. - - - Refreshes the trace configuration data. - - - Writes an error message to the trace listeners in the collection using the specified message. - The informative message to write. - - - Writes an error message to the trace listeners in the collection using the specified array of objects and formatting information. - A format string that contains zero or more format items, which correspond to objects in the args array. - An object array containing zero or more objects to format. - - - Writes an informational message to the trace listeners in the collection using the specified message. - The informative message to write. - - - Writes an informational message to the trace listeners in the collection using the specified array of objects and formatting information. - A format string that contains zero or more format items, which correspond to objects in the args array. - An object array containing zero or more objects to format. - - - Writes a warning message to the trace listeners in the collection using the specified array of objects and formatting information. - A format string that contains zero or more format items, which correspond to objects in the args array. - An object array containing zero or more objects to format. - - - Writes a warning message to the trace listeners in the collection using the specified message. - The informative message to write. - - - Decreases the current by one. - - - Gets or sets a value indicating whether the global lock should be used. - true if the global lock is to be used; otherwise, false. The default is true. - - - Writes the value of the object's method to the trace listeners in the collection. - An whose name is sent to the . - - - Writes a message to the trace listeners in the collection. - A message to write. - - - Writes a category name and the value of the object's method to the trace listeners in the collection. - An name is sent to the . - A category name used to organize the output. - - - Writes a category name and a message to the trace listeners in the collection. - A message to write. - A category name used to organize the output. - - - Writes a category name and message to the trace listeners in the collection if a condition is true. - true to cause a message to be written; otherwise, false. - A message to write. - A category name used to organize the output. - - - Writes a category name and the value of the object's method to the trace listeners in the collection if a condition is true. - true to cause a message to be written; otherwise, false. - An whose name is sent to the . - A category name used to organize the output. - - - Writes the value of the object's method to the trace listeners in the collection if a condition is true. - true to cause a message to be written; otherwise, false. - An whose name is sent to the . - - - Writes a message to the trace listeners in the collection if a condition is true. - true to cause a message to be written; otherwise, false. - A message to write. - - - Writes the value of the object's method to the trace listeners in the collection. - An whose name is sent to the . - - - Writes a message to the trace listeners in the collection. - A message to write. - - - Writes a category name and the value of the object's method to the trace listeners in the collection. - An whose name is sent to the . - A category name used to organize the output. - - - Writes a category name and message to the trace listeners in the collection. - A message to write. - A category name used to organize the output. - - - Writes a category name and the value of the object's method to the trace listeners in the collection if a condition is true. - true to cause a message to be written; otherwise, false. - An whose name is sent to the . - A category name used to organize the output. - - - Writes the value of the object's method to the trace listeners in the collection if a condition is true. - true to cause a message to be written; otherwise, false. - An whose name is sent to the . - - - Writes a message to the trace listeners in the collection if a condition is true. - true to cause a message to be written; otherwise, false. - A message to write. - - - Writes a category name and message to the trace listeners in the collection if a condition is true. - true to cause a message to be written; otherwise, false. - A message to write. - A category name used to organize the output. - - - Provides trace event data specific to a thread and a process. - - - Initializes a new instance of the class. - - - Gets the call stack for the current thread. - A string containing stack trace information. This value can be an empty string (""). - - - Gets the date and time at which the event trace occurred. - A structure whose value is a date and time expressed in Coordinated Universal Time (UTC). - - - Gets the correlation data, contained in a stack. - A containing correlation data. - - - Gets the unique identifier of the current process. - The system-generated unique identifier of the current process. - - - Gets a unique identifier for the current managed thread. - A string that represents a unique integer identifier for this managed thread. - - - Gets the current number of ticks in the timer mechanism. - The tick counter value of the underlying timer mechanism. - - - Identifies the type of event that has caused the trace. - - - Fatal error or application crash. - - - - Recoverable error. - - - - Informational message. - - - - Resumption of a logical operation. - - - - Starting of a logical operation. - - - - Stopping of a logical operation. - - - - Suspension of a logical operation. - - - - Changing of correlation identity. - - - - Debugging trace. - - - - Noncritical problem. - - - - Provides the base class for trace filter implementations. - - - Initializes a new instance of the class. - - - When overridden in a derived class, determines whether the trace listener should trace the event. - The that contains information for the trace event. - The name of the source. - One of the values specifying the type of event that has caused the trace. - A trace identifier number. - Either the format to use for writing an array of arguments specified by the args parameter, or a message to write. - An array of argument objects. - A trace data object. - An array of trace data objects. - true to trace the specified event; otherwise, false. - - - Specifies what messages to output for the , and classes. - - - Output error-handling messages. - - - - Output informational messages, warnings, and error-handling messages. - - - - Output no tracing and debugging messages. - - - - Output all debugging and tracing messages. - - - - Output warnings and error-handling messages. - - - - Provides the abstract base class for the listeners who monitor trace and debug output. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class using the specified name as the listener. - The name of the . - - - Gets the custom trace listener attributes defined in the application configuration file. - A containing the custom attributes for the trace listener. - - - When overridden in a derived class, closes the output stream so it no longer receives tracing or debugging output. - - - Releases all resources used by the . - - - Releases the unmanaged resources used by the and optionally releases the managed resources. - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - Emits an error message to the listener you create when you implement the class. - A message to emit. - - - Emits an error message and a detailed error message to the listener you create when you implement the class. - A message to emit. - A detailed message to emit. - - - Gets and sets the trace filter for the trace listener. - An object derived from the base class. - - - When overridden in a derived class, flushes the output buffer. - - - Gets the custom attributes supported by the trace listener. - A string array naming the custom attributes supported by the trace listener, or null if there are no custom attributes. - - - Gets or sets the indent level. - The indent level. The default is zero. - - - Gets or sets the number of spaces in an indent. - The number of spaces in an indent. The default is four spaces. - Set operation failed because the value is less than zero. - - - Gets a value indicating whether the trace listener is thread safe. - true if the trace listener is thread safe; otherwise, false. The default is false. - - - Gets or sets a name for this . - A name for this . The default is an empty string (""). - - - Gets or sets a value indicating whether to indent the output. - true if the output should be indented; otherwise, false. - - - Writes trace information, a data object and event information to the listener specific output. - A object that contains the current process ID, thread ID, and stack trace information. - A name used to identify the output, typically the name of the application that generated the trace event. - One of the values specifying the type of event that has caused the trace. - A numeric identifier for the event. - The trace data to emit. - - - Writes trace information, an array of data objects and event information to the listener specific output. - A object that contains the current process ID, thread ID, and stack trace information. - A name used to identify the output, typically the name of the application that generated the trace event. - One of the values specifying the type of event that has caused the trace. - A numeric identifier for the event. - An array of objects to emit as data. - - - Writes trace and event information to the listener specific output. - A object that contains the current process ID, thread ID, and stack trace information. - A name used to identify the output, typically the name of the application that generated the trace event. - One of the values specifying the type of event that has caused the trace. - A numeric identifier for the event. - - - Writes trace information, a message, and event information to the listener specific output. - A object that contains the current process ID, thread ID, and stack trace information. - A name used to identify the output, typically the name of the application that generated the trace event. - One of the values specifying the type of event that has caused the trace. - A numeric identifier for the event. - A message to write. - - - Writes trace information, a formatted array of objects and event information to the listener specific output. - A object that contains the current process ID, thread ID, and stack trace information. - A name used to identify the output, typically the name of the application that generated the trace event. - One of the values specifying the type of event that has caused the trace. - A numeric identifier for the event. - A format string that contains zero or more format items, which correspond to objects in the args array. - An object array containing zero or more objects to format. - - - Gets or sets the trace output options. - A bitwise combination of the enumeration values. The default is . - Set operation failed because the value is invalid. - - - Writes trace information, a message, a related activity identity and event information to the listener specific output. - A object that contains the current process ID, thread ID, and stack trace information. - A name used to identify the output, typically the name of the application that generated the trace event. - A numeric identifier for the event. - A message to write. - A object identifying a related activity. - - - Writes the value of the object's method to the listener you create when you implement the class. - An whose fully qualified class name you want to write. - - - When overridden in a derived class, writes the specified message to the listener you create in the derived class. - A message to write. - - - Writes a category name and the value of the object's method to the listener you create when you implement the class. - An whose fully qualified class name you want to write. - A category name used to organize the output. - - - Writes a category name and a message to the listener you create when you implement the class. - A message to write. - A category name used to organize the output. - - - Writes the indent to the listener you create when you implement this class, and resets the property to false. - - - Writes the value of the object's method to the listener you create when you implement the class, followed by a line terminator. - An whose fully qualified class name you want to write. - - - When overridden in a derived class, writes a message to the listener you create in the derived class, followed by a line terminator. - A message to write. - - - Writes a category name and the value of the object's method to the listener you create when you implement the class, followed by a line terminator. - An whose fully qualified class name you want to write. - A category name used to organize the output. - - - Writes a category name and a message to the listener you create when you implement the class, followed by a line terminator. - A message to write. - A category name used to organize the output. - - - Provides a thread-safe list of objects. - - - Adds a to the list. - A to add to the list. - The position at which the new listener was inserted. - - - Adds an array of objects to the list. - An array of objects to add to the list. - value is null. - - - Adds the contents of another to the list. - Another whose contents are added to the list. - value is null. - - - Clears all the listeners from the list. - - - Checks whether the list contains the specified listener. - A to find in the list. - true if the listener is in the list; otherwise, false. - - - Copies a section of the current list to the specified array at the specified index. - An array of type to copy the elements into. - The starting index number in the current list to copy from. - - - Gets the number of listeners in the list. - The number of listeners in the list. - - - Gets an enumerator for this list. - An enumerator of type . - - - Gets the index of the specified listener. - A to find in the list. - The index of the listener, if it can be found in the list; otherwise, -1. - - - Inserts the listener at the specified index. - The position in the list to insert the new . - A to insert in the list. - The index is not a valid index in the list. - listener is null. - - - Gets or sets the at the specified index. - The zero-based index of the to get from the list. - A with the specified index. - The value is null. - - - Gets the first in the list with the specified name. - The name of the to get from the list. - The first in the list with the given . This item returns null if no with the given name can be found. - - - Removes from the collection the first with the specified name. - The name of the to remove from the list. - - - Removes from the collection the specified . - A to remove from the list. - - - Removes from the collection the at the specified index. - The zero-based index of the to remove from the list. - The index is not a valid index in the list. - - - Copies a section of the current to the specified array of objects. - The one-dimensional array of objects that is the destination of the elements copied from the . The array must have zero-based indexing. - The zero-based index in array at which copying begins. - - - Gets a value indicating whether access to the is synchronized (thread safe). - Always true. - - - Gets an object that can be used to synchronize access to the . - The current object. - - - Adds a trace listener to the . - The object to add to the . - The position into which the new trace listener was inserted. - value is null. -or- value is not a . - - - Determines whether the contains a specific object. - The object to locate in the . - true if the is found in the ; otherwise, false. - - - Determines the index of a specific object in the . - The object to locate in the . - The index of value if found in the ; otherwise, -1. - - - Inserts a object at the specified position in the . - The zero-based index at which value should be inserted. - The object to insert into the . - value is not a object. - - - Gets a value indicating whether the has a fixed size. - Always false. - - - Gets a value indicating whether the is read-only - Always false. - - - Gets or sets the at the specified index in the . - The zero-based index of the value to get. - The at the specified index. - - - Removes an object from the . - The object to remove from the . - - - Specifies trace data options to be written to the trace output. - - - Write the call stack, which is represented by the return value of the property. - - - - Write the date and time. - - - - Write the logical operation stack, which is represented by the return value of the property. - - - - Do not write any elements. - - - - Write the process identity, which is represented by the return value of the property. - - - - Write the thread identity, which is represented by the return value of the property for the current thread. - - - - Write the timestamp, which is represented by the return value of the method. - - - - Provides a set of methods and properties that enable applications to trace the execution of code and associate trace messages with their source. - - - Initializes a new instance of the class, using the specified name for the source. - The name of the source (typically, the name of the application). - name is null. - name is an empty string (""). - - - Initializes a new instance of the class, using the specified name for the source and the default source level at which tracing is to occur. - The name of the source, typically the name of the application. - A bitwise combination of the enumeration values that specifies the default source level at which to trace. - name is null. - name is an empty string (""). - - - Gets the custom switch attributes defined in the application configuration file. - A containing the custom attributes for the trace switch. - - - Closes all the trace listeners in the trace listener collection. - - - Flushes all the trace listeners in the trace listener collection. - An attempt was made to trace an event during finalization. - - - Gets the custom attributes supported by the trace source. - A string array naming the custom attributes supported by the trace source, or null if there are no custom attributes. - - - Gets the collection of trace listeners for the trace source. - A that contains the active trace listeners associated with the source. - - - Gets the name of the trace source. - The name of the trace source. - - - Gets or sets the source switch value. - A object representing the source switch value. - is set to null. - - - Writes trace data to the trace listeners in the collection using the specified event type, event identifier, and trace data. - One of the enumeration values that specifies the event type of the trace data. - A numeric identifier for the event. - The trace data. - An attempt was made to trace an event during finalization. - - - Writes trace data to the trace listeners in the collection using the specified event type, event identifier, and trace data array. - One of the enumeration values that specifies the event type of the trace data. - A numeric identifier for the event. - An object array containing the trace data. - An attempt was made to trace an event during finalization. - - - Writes a trace event message to the trace listeners in the collection using the specified event type and event identifier. - One of the enumeration values that specifies the event type of the trace data. - A numeric identifier for the event. - An attempt was made to trace an event during finalization. - - - Writes a trace event message to the trace listeners in the collection using the specified event type, event identifier, and message. - One of the enumeration values that specifies the event type of the trace data. - A numeric identifier for the event. - The trace message to write. - An attempt was made to trace an event during finalization. - - - Writes a trace event to the trace listeners in the collection using the specified event type, event identifier, and argument array and format. - One of the enumeration values that specifies the event type of the trace data. - A numeric identifier for the event. - A composite format string that contains text intermixed with zero or more format items, which correspond to objects in the args array. - An object array containing zero or more objects to format. - format is null. - format is invalid. -or- The number that indicates an argument to format is less than zero, or greater than or equal to the number of specified objects to format. - An attempt was made to trace an event during finalization. - - - Writes an informational message to the trace listeners in the collection using the specified message. - The informative message to write. - An attempt was made to trace an event during finalization. - - - Writes an informational message to the trace listeners in the collection using the specified object array and formatting information. - A composite format string that contains text intermixed with zero or more format items, which correspond to objects in the args array. - An array containing zero or more objects to format. - format is null. - format is invalid. -or- The number that indicates an argument to format is less than zero, or greater than or equal to the number of specified objects to format. - An attempt was made to trace an event during finalization. - - - Writes a trace transfer message to the trace listeners in the collection using the specified numeric identifier, message, and related activity identifier. - A numeric identifier for the event. - The trace message to write. - A structure that identifies the related activity. - - - Provides a multilevel switch to control tracing and debug output without recompiling your code. - - - Initializes a new instance of the class, using the specified display name and description. - The name to display on a user interface. - The description of the switch. - - - Initializes a new instance of the class, using the specified display name, description, and default value for the switch. - The name to display on a user interface. - The description of the switch. - The default value of the switch. - - - Gets or sets the trace level that determines the messages the switch allows. - One of the values that that specifies the level of messages that are allowed by the switch. - is set to a value that is not one of the values. - - - Updates and corrects the level for this switch. - - - Sets the property to the integer equivalent of the property. - - - Gets a value indicating whether the switch allows error-handling messages. - true if the property is set to , , , or ; otherwise, false. - - - Gets a value indicating whether the switch allows informational messages. - true if the property is set to or ; otherwise, false. - - - Gets a value indicating whether the switch allows all messages. - true if the property is set to ; otherwise, false. - - - Gets a value indicating whether the switch allows warning messages. - true if the property is set to , , or ; otherwise, false. - - - Specifies the tracking of activity start and stop events. - - - Allow overlapping activities. By default, activity starts and stops must be property nested. That is, a sequence of Start A, Start B, Stop A, Stop B is not allowed will result in B stopping at the same time as A. - - - - Turn off start and stop tracking. - - - - Use the default behavior for start and stop tracking. - - - - Allow recursive activity starts. By default, an activity cannot be recursive. That is, a sequence of Start A, Start A, Stop A, Stop A is not allowed. Unintentional recursive activities can occur if the app executes and for some the stop is not reached before another start is called. - - - - Specifies additional event schema information for an event. - - - Initializes a new instance of the class with the specified event identifier. - The event identifier for the event. - - - Specifies the behavior of the start and stop events of an activity. An activity is the region of time in an app between the start and the stop. - Returns . - - - Gets or sets an additional event log where the event should be written. - An additional event log where the event should be written. - - - Gets or sets the identifier for the event. - The event identifier. This value should be between 0 and 65535. - - - Gets or sets the keywords for the event. - A bitwise combination of the enumeration values. - - - Gets or sets the level for the event. - One of the enumeration values that specifies the level for the event. - - - Gets or sets the message for the event. - The message for the event. - - - Gets or sets the operation code for the event. - One of the enumeration values that specifies the operation code. - - - Gets and sets the value for this object. An event tag is a user-defined value that is passed through when the event is logged. - Returns the value. - - - Gets or sets the task for the event. - The task for the event. - - - Gets or sets the version of the event. - The version of the event. - - - Specifies the event log channel for the event. - - - The administrator log channel. - - - - The analytic channel. - - - - The debug channel. - - - - No channel specified. - - - - The operational channel. - - - - Describes the command ( property) that is passed to the callback. - - - Disable the event. - - - - Enable the event. - - - - Send the manifest. - - - - Update the event. - - - - Provides the arguments for the callback. - - - Gets the array of arguments for the callback. - An array of callback arguments. - - - Gets the command for the callback. - The callback command. - - - Disables the event that have the specified identifier. - The identifier of the event to disable. - true if eventId is in range; otherwise, false. - - - Enables the event that has the specified identifier. - The identifier of the event to enable. - true if eventId is in range; otherwise, false. - - - - - - - - - - - - - Specifies a type to be passed to the method. - - - Initializes a new instance of the class. - - - Gets or set the name to apply to an event if the event type or property is not explicitly named. - The name to apply to the event or property. - - - The is placed on fields of user-defined types that are passed as payloads. - - - Initializes a new instance of the class. - - - Gets and sets the value that specifies how to format the value of a user-defined type. - Returns a value. - - - Gets and sets the user-defined value that is required for fields that contain data that isn't one of the supported types. - Returns . - - - Specifies how to format the value of a user-defined type and can be used to override the default formatting for a field. - - - Boolean - - - - Default. - - - - Hexadecimal. - - - - HResult. - - - - JSON. - - - - String. - - - - XML. - - - - Specifies the user-defined tag that is placed on fields of user-defined types that are passed as payloads through the . - - - Specifies no tag and is equal to zero. - - - - Specifies a property should be ignored when writing an event type with the method. - - - Initializes a new instance of the class. - - - Defines the standard keywords that apply to events. - - - All the bits are set to 1, representing every possible group of events. - - - - Attached to all failed security audit events. Use this keyword only for events in the security log. - - - - Attached to all successful security audit events. Use this keyword only for events in the security log. - - - - Attached to transfer events where the related activity ID (correlation ID) is a computed value and is not guaranteed to be unique (that is, it is not a real GUID). - - - - Attached to events that are raised by using the RaiseEvent function. - - - - Attached to all Microsoft telemetry events. - - - - No filtering on keywords is performed when the event is published. - - - - Attached to all Service Quality Mechanism (SQM) events. - - - - Attached to all Windows Diagnostics Infrastructure (WDI) context events. - - - - Attached to all Windows Diagnostics Infrastructure (WDI) diagnostic events. - - - - Identifies the level of an event. - - - This level corresponds to a critical error, which is a serious error that has caused a major failure. - - - - This level adds standard errors that signify a problem. - - - - This level adds informational events or messages that are not errors. These events can help trace the progress or state of an application. - - - - No level filtering is done on the event. - - - - This level adds lengthy events or messages. It causes all events to be logged. - - - - This level adds warning events (for example, events that are published because a disk is nearing full capacity). - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Specifies how the ETW manifest for the event source is generated. - - - Generates a resources node under the localization folder for every satellite assembly provided. - - - - Overrides the default behavior that the current must be the base class of the user-defined type passed to the write method. This enables the validation of .NET event sources. - - - - No options are specified. - - - - A manifest is generated only the event source must be registered on the host computer. - - - - Causes an exception to be raised if any inconsistencies occur when writing the manifest file. - - - - Defines the standard operation codes that the event source attaches to events. - - - A trace collection start event. - - - - A trace collection stop event. - - - - An extension event. - - - - An informational event. - - - - An event that is published when one activity in an application receives data. - - - - An event that is published after an activity in an application replies to an event. - - - - An event that is published after an activity in an application resumes from a suspended state. The event should follow an event that has the operation code. - - - - An event that is published when one activity in an application transfers data or system resources to another activity. - - - - An event that is published when an application starts a new transaction or activity. This operation code can be embedded within another transaction or activity when multiple events that have the code follow each other without an intervening event that has a code. - - - - An event that is published when an activity or a transaction in an application ends. The event corresponds to the last unpaired event that has a operation code. - - - - An event that is published when an activity in an application is suspended. - - - - Provides the event data for creating fast overloads by using the method. - - - Gets or sets the pointer to the data for the new overload. - The pointer to the data. - - - Gets or sets the number of payload items in the new overload. - The number of payload items in the new overload. - - - Provides the ability to create events for event tracing for Windows (ETW). - - - Creates a new instance of the class. - - - Creates a new instance of the class and specifies whether to throw an exception when an error occurs in the underlying Windows code. - true to throw an exception when an error occurs in the underlying Windows code; otherwise, false. - - - Creates a new instance of the class with the specified configuration settings. - A bitwise combination of the enumeration values that specify the configuration settings to apply to the event source. - - - Creates a new instance of the class with the specified name. - The name to apply to the event source. Must not be null. - eventSourceName is null. - - - Initializes a new instance of the to be used with non-contract events that contains the specified settings and traits. - A bitwise combination of the enumeration values that specify the configuration settings to apply to the event source. - The key-value pairs that specify traits for the event source. - traits is not specified in key-value pairs. - - - Creates a new instance of the class with the specified name and settings. - The name to apply to the event source. Must not be null. - A bitwise combination of the enumeration values that specify the configuration settings to apply to the event source. - eventSourceName is null. - - - Creates a new instance of the class with the specified configuration settings. - The name to apply to the event source. Must not be null. - A bitwise combination of the enumeration values that specify the configuration settings to apply to the event source. - The key-value pairs that specify traits for the event source. - eventSourceName is null. - traits is not specified in key-value pairs. - - - [Supported in the .NET Framework 4.5.1 and later versions] Gets any exception that was thrown during the construction of the event source. - The exception that was thrown during the construction of the event source, or null if no exception was thrown. - - - [Supported in the .NET Framework 4.5.1 and later versions] Gets the activity ID of the current thread. - The activity ID of the current thread. - - - Releases all resources used by the current instance of the class. - - - Releases the unmanaged resources used by the class and optionally releases the managed resources. - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - Occurs when a command comes from an event listener. - - - - Allows the object to attempt to free resources and perform other cleanup operations before the object is reclaimed by garbage collection. - - - Returns a string of the XML manifest that is associated with the current event source. - The type of the event source. - The path to the assembly file (.dll) file to include in the provider element of the manifest. - A bitwise combination of the enumeration values that specify how the manifest is generated. - The XML data string or null. - - - Returns a string of the XML manifest that is associated with the current event source. - The type of the event source. - The path to the assembly file (.dll) to include in the provider element of the manifest. - The XML data string. - - - Gets the unique identifier for this implementation of the event source. - The type of the event source. - A unique identifier for this event source type. - - - Gets the friendly name of the event source. - The type of the event source. - The friendly name of the event source. The default is the simple name of the class. - - - Gets a snapshot of all the event sources for the application domain. - An enumeration of all the event sources in the application domain. - - - Gets the trait value associated with the specified key. - The key of the trait to get. - The trait value associated with the specified key. If the key is not found, returns null. - - - The unique identifier for the event source. - A unique identifier for the event source. - - - Determines whether the current event source is enabled. - true if the current event source is enabled; otherwise, false. - - - Determines whether the current event source that has the specified level and keyword is enabled. - The level of the event source. - The keyword of the event source. - true if the event source is enabled; otherwise, false. - - - Determines whether the current event source is enabled for events with the specified level, keywords and channel. - The event level to check. An event source will be considered enabled when its level is greater than or equal to level. - The event keywords to check. - The event channel to check. - true if the event source is enabled for the specified event level, keywords and channel; otherwise, false. The result of this method is only an approximation of whether a particular event is active. Use it to avoid expensive computation for logging when logging is disabled. Event sources may have additional filtering that determines their activity.. - - - The friendly name of the class that is derived from the event source. - The friendly name of the derived class. The default is the simple name of the class. - - - Called when the current event source is updated by the controller. - The arguments for the event. - - - Sends a command to a specified event source. - The event source to send the command to. - The event command to send. - The arguments for the event command. - - - [Supported in the .NET Framework 4.5.1 and later versions] Sets the activity ID on the current thread. - The current thread's new activity ID, or to indicate that work on the current thread is not associated with any activity. - - - [Supported in the .NET Framework 4.5.1 and later versions] Sets the activity ID on the current thread, and returns the previous activity ID. - The current thread's new activity ID, or to indicate that work on the current thread is not associated with any activity. - When this method returns, contains the previous activity ID on the current thread. - - - Gets the settings applied to this event source. - The settings applied to this event source. - - - Obtains a string representation of the current event source instance. - The name and unique identifier that identify the current event source. - - - Writes an event without fields, but with the specified name and default options. - The name of the event to write. - eventName is null. - - - Writes an event without fields, but with the specified name and options. - The name of the event to write. - The options such as level, keywords and operation code for the event. - eventName is null. - - - Writes an event with the specified name and data. - The name of the event. - The event data. This type must be an anonymous type or marked with the attribute. - The type that defines the event and its associated data. This type must be an anonymous type or marked with the attribute. - - - Writes an event with the specified name, event data and options. - The name of the event. - The event options. - The event data. This type must be an anonymous type or marked with the attribute. - The type that defines the event and its associated data. This type must be an anonymous type or marked with the attribute. - - - Writes an event with the specified name, options and event data. - The name of the event. - The event options. - The event data. This type must be an anonymous type or marked with the attribute. - The type that defines the event and its associated data. This type must be an anonymous type or marked with the attribute. - - - Writes an event with the specified name, options, related activity and event data. - The name of the event. - The event options. - The ID of the activity associated with the event. - The ID of an associated activity, or if there is no associated activity. - The event data. This type must be an anonymous type or marked with the attribute. - The type that defines the event and its associated data. This type must be an anonymous type or marked with the attribute. - - - Writes an event by using the provided event identifier and string arguments. - The event identifier. This value should be between 0 and 65535. - A string argument. - A string argument. - A string argument. - - - Writes an event by using the provided event identifier and arguments. - The event identifier. This value should be between 0 and 65535. - A string argument. - A 32 bit integer argument. - A 32 bit integer argument. - - - Writes an event by using the provided event identifier and 64-bit arguments. - The event identifier. This value should be between 0 and 65535. - A 64 bit integer argument. - A 64 bit integer argument. - A 64 bit integer argument. - - - Writes an event by using the provided event identifier and 32-bit integer arguments. - The event identifier. This value should be between 0 and 65535. - An integer argument. - An integer argument. - An integer argument. - - - Writes an event by using the provided event identifier and string arguments. - The event identifier. This value should be between 0 and 65535. - A string argument. - A string argument. - - - Writes an event by using the provided event identifier and arguments. - The event identifier. This value should be between 0 and 65535. - A string argument. - A 64 bit integer argument. - - - Writes an event by using the provided event identifier and arguments. - The event identifier. This value should be between 0 and 65535. - A string argument. - A 32 bit integer argument. - - - Writes an event by using the provided event identifier and 64-bit integer, and string arguments. - The event identifier. This value should be between 0 and 65535. - A 64-bit integer argument. - A string argument. - - - Writes an event by using the provided event identifier and 64-bit arguments. - The event identifier. This value should be between 0 and 65535. - A 64 bit integer argument. - A 64 bit integer argument. - - - Writes an event by using the provided event identifier and 32-bit integer arguments. - The event identifier. This value should be between 0 and 65535. - An integer argument. - An integer argument. - - - Writes an event by using the provided event identifier and 32-bit integer and string arguments. - The event identifier. This value should be between 0 and 65535. - A 32-bit integer argument. - A string argument. - - - Writes an event by using the provided event identifier and string argument. - The event identifier. This value should be between 0 and 65535. - A string argument. - - - Writes an event by using the provided event identifier and array of arguments. - The event identifier. This value should be between 0 and 65535. - An array of objects. - - - Writes an event by using the provided event identifier and 64-bit integer argument. - The event identifier. This value should be between 0 and 65535. - A 64 bit integer argument. - - - Writes an event by using the provided event identifier and 32-bit integer argument. - The event identifier. This value should be between 0 and 65535. - An integer argument. - - - Writes an event by using the provided event identifier and byte array argument. - The event identifier. This value should be between 0 and 65535. - A byte array argument. - - - Writes an event by using the provided event identifier. - The event identifier. This value should be between 0 and 65535. - - - Writes the event data using the specified indentifier and 64-bit integer and byte array arguments. - The event identifier. This value should be between 0 and 65535. - A 64-bit integer argument. - A byte array argument. - - - Creates a new overload by using the provided event identifier and event data. - The event identifier. - The number of event data items. - The structure that contains the event data. - - - [Supported in the .NET Framework 4.5.1 and later versions] Writes an event that indicates that the current activity is related to another activity. - An identifier that uniquely identifies this event within the . - The related activity identifier. - An array of objects that contain data about the event. - - - [Supported in the .NET Framework 4.5.1 and later versions] Writes an event that indicates that the current activity is related to another activity. - An identifier that uniquely identifies this event within the . - A pointer to the GUID of the related activity ID. - The number of items in the data field. - A pointer to the first item in the event data field. - - - Allows the event tracing for Windows (ETW) name to be defined independently of the name of the event source class. - - - Initializes a new instance of the class. - - - Gets or sets the event source identifier. - The event source identifier. - - - Gets or sets the name of the localization resource file. - The name of the localization resource file, or null if the localization resource file does not exist. - - - Gets or sets the name of the event source. - The name of the event source. - - - The exception that is thrown when an error occurs during event tracing for Windows (ETW). - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with a specified error message. - The message that describes the error. - - - Initializes a new instance of the class with serialized data. - The object that holds the serialized object data. - The contextual information about the source or destination. - - - Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. - The error message that explains the reason for the exception. - The exception that is the cause of the current exception, or null if no inner exception is specified. - - - Specifies overrides of default event settings such as the log level, keywords and operation code when the method is called. - - - The activity options defined for this event source. - Returns . - - - Gets or sets the keywords applied to the event. If this property is not set, the event’s keywords will be None. - The keywords applied to the event, or None if no keywords are set. - - - Gets or sets the event level applied to the event. - The event level for the event. If not set, the default is Verbose (5). - - - Gets or sets the operation code to use for the specified event. - The operation code to use for the specified event. If not set, the default is Info (0). - - - The event tags defined for this event source. - Returns . - - - Specifies configuration options for an event source. - - - None of the special configuration options are enabled. - - - - The ETW listener should use a manifest-based format when raising events. Setting this option is a directive to the ETW listener should use manifest-based format when raising events. This is the default option when defining a type derived from using one of the protected constructors. - - - - The ETW listener should use self-describing event format. This is the default option when creating a new instance of the using one of the public constructors. - - - - The event source throws an exception when an error occurs. - - - - Specifies the tracking of activity start and stop events. You should only use the lower 24 bits. For more information, see and . - - - Specifies no tag and is equal to zero. - - - - Defines the tasks that apply to events. - - - Undefined task. - - - - Provides data for the callback. - - - [Supported in the .NET Framework 4.5.1 and later versions] Gets the activity ID on the thread that the event was written to. - The activity ID on the thread that the event was written to. - - - Gets the channel for the event. - The channel for the event. - - - Gets the event identifier. - The event identifier. - - - Gets the name of the event. - The name of the event. - - - Gets the event source object. - The event source object. - - - Gets the keywords for the event. - The keywords for the event. - - - Gets the level of the event. - The level of the event. - - - Gets the message for the event. - The message for the event. - - - Gets the operation code for the event. - The operation code for the event. - - - Gets the payload for the event. - The payload for the event. - - - Returns a list of strings that represent the property names of the event. - Returns . - - - [Supported in the .NET Framework 4.5.1 and later versions] Gets the identifier of an activity that is related to the activity represented by the current instance. - The identifier of the related activity, or if there is no related activity. - - - Returns the tags specified in the call to the method. - Returns . - - - Gets the task for the event. - The task for the event. - - - Gets the version of the event. - The version of the event. - - - Identifies a method that is not generating an event. - - - Creates a new instance of the class. - - - Stores a set of four integers that represent the location and size of a rectangle - - - Initializes a new instance of the class with the specified location and size. - A that represents the upper-left corner of the rectangular region. - A that represents the width and height of the rectangular region. - - - Initializes a new instance of the class with the specified location and size. - The x-coordinate of the upper-left corner of the rectangle. - The y-coordinate of the upper-left corner of the rectangle. - The width of the rectangle. - The height of the rectangle. - - - Gets the y-coordinate that is the sum of the and property values of this structure. - The y-coordinate that is the sum of and of this . - - - Converts the specified structure to a structure by rounding the values to the next higher integer values. - The structure to be converted. - Returns a . - - - Determines if the specified point is contained within this structure. - The to test. - This method returns true if the point represented by pt is contained within this structure; otherwise false. - - - Determines if the rectangular region represented by rect is entirely contained within this structure. - The to test. - This method returns true if the rectangular region represented by rect is entirely contained within this structure; otherwise false. - - - Determines if the specified point is contained within this structure. - The x-coordinate of the point to test. - The y-coordinate of the point to test. - This method returns true if the point defined by x and y is contained within this structure; otherwise false. - - - Represents a structure with its properties left uninitialized. - - - - Tests whether obj is a structure with the same location and size of this structure. - The to test. - This method returns true if obj is a structure and its , , , and properties are equal to the corresponding properties of this structure; otherwise, false. - - - Creates a structure with the specified edge locations. - The x-coordinate of the upper-left corner of this structure. - The y-coordinate of the upper-left corner of this structure. - The x-coordinate of the lower-right corner of this structure. - The y-coordinate of the lower-right corner of this structure. - The new that this method creates. - - - Returns the hash code for this structure. For information about the use of hash codes, see . - An integer that represents the hash code for this rectangle. - - - Gets or sets the height of this structure. - The height of this structure. The default is 0. - - - Enlarges this by the specified amount. - The amount to inflate this rectangle. - - - Enlarges this by the specified amount. - The amount to inflate this horizontally. - The amount to inflate this vertically. - - - Creates and returns an enlarged copy of the specified structure. The copy is enlarged by the specified amount. The original structure remains unmodified. - The with which to start. This rectangle is not modified. - The amount to inflate this horizontally. - The amount to inflate this vertically. - The enlarged . - - - Returns a third structure that represents the intersection of two other structures. If there is no intersection, an empty is returned. - A rectangle to intersect. - A rectangle to intersect. - A that represents the intersection of a and b. - - - Replaces this with the intersection of itself and the specified . - The with which to intersect. - - - Determines if this rectangle intersects with rect. - The rectangle to test. - This method returns true if there is any intersection, otherwise false. - - - Tests whether all numeric properties of this have values of zero. - This property returns true if the , , , and properties of this all have values of zero; otherwise, false. - - - Gets the x-coordinate of the left edge of this structure. - The x-coordinate of the left edge of this structure. - - - Gets or sets the coordinates of the upper-left corner of this structure. - A that represents the upper-left corner of this structure. - - - Adjusts the location of this rectangle by the specified amount. - Amount to offset the location. - - - Adjusts the location of this rectangle by the specified amount. - The horizontal offset. - The vertical offset. - - - Tests whether two structures have equal location and size. - The structure that is to the left of the equality operator. - The structure that is to the right of the equality operator. - This operator returns true if the two structures have equal , , , and properties. - - - Tests whether two structures differ in location or size. - The structure that is to the left of the inequality operator. - The structure that is to the right of the inequality operator. - This operator returns true if any of the , , or properties of the two structures are unequal; otherwise false. - - - Gets the x-coordinate that is the sum of and property values of this structure. - The x-coordinate that is the sum of and of this . - - - Converts the specified to a by rounding the values to the nearest integer values. - The to be converted. - The rounded interger value of the . - - - Gets or sets the size of this . - A that represents the width and height of this structure. - - - Gets the y-coordinate of the top edge of this structure. - The y-coordinate of the top edge of this structure. - - - Converts the attributes of this to a human-readable string. - A string that contains the position, width, and height of this structure ¾ for example, {X=20, Y=20, Width=100, Height=50} - - - Converts the specified to a by truncating the values. - The to be converted. - The truncated value of the . - - - Gets a structure that contains the union of two structures. - A rectangle to union. - A rectangle to union. - A structure that bounds the union of the two structures. - - - Gets or sets the width of this structure. - The width of this structure. The default is 0. - - - Gets or sets the x-coordinate of the upper-left corner of this structure. - The x-coordinate of the upper-left corner of this structure. The default is 0. - - - Gets or sets the y-coordinate of the upper-left corner of this structure. - The y-coordinate of the upper-left corner of this structure. The default is 0. - - - Stores a set of four floating-point numbers that represent the location and size of a rectangle. For more advanced region functions, use a object. - - - Initializes a new instance of the class with the specified location and size. - A that represents the upper-left corner of the rectangular region. - A that represents the width and height of the rectangular region. - - - Initializes a new instance of the class with the specified location and size. - The x-coordinate of the upper-left corner of the rectangle. - The y-coordinate of the upper-left corner of the rectangle. - The width of the rectangle. - The height of the rectangle. - - - Gets the y-coordinate that is the sum of and of this structure. - The y-coordinate that is the sum of and of this structure. - - - Determines if the specified point is contained within this structure. - The to test. - This method returns true if the point represented by the pt parameter is contained within this structure; otherwise false. - - - Determines if the rectangular region represented by rect is entirely contained within this structure. - The to test. - This method returns true if the rectangular region represented by rect is entirely contained within the rectangular region represented by this ; otherwise false. - - - Determines if the specified point is contained within this structure. - The x-coordinate of the point to test. - The y-coordinate of the point to test. - This method returns true if the point defined by x and y is contained within this structure; otherwise false. - - - Represents an instance of the class with its members uninitialized. - - - - Tests whether obj is a with the same location and size of this . - The to test. - This method returns true if obj is a and its X, Y, Width, and Height properties are equal to the corresponding properties of this ; otherwise, false. - - - Creates a structure with upper-left corner and lower-right corner at the specified locations. - The x-coordinate of the upper-left corner of the rectangular region. - The y-coordinate of the upper-left corner of the rectangular region. - The x-coordinate of the lower-right corner of the rectangular region. - The y-coordinate of the lower-right corner of the rectangular region. - The new that this method creates. - - - Gets the hash code for this structure. For information about the use of hash codes, see Object.GetHashCode. - The hash code for this . - - - Gets or sets the height of this structure. - The height of this structure. The default is 0. - - - Enlarges this by the specified amount. - The amount to inflate this rectangle. - - - Enlarges this structure by the specified amount. - The amount to inflate this structure horizontally. - The amount to inflate this structure vertically. - - - Creates and returns an enlarged copy of the specified structure. The copy is enlarged by the specified amount and the original rectangle remains unmodified. - The to be copied. This rectangle is not modified. - The amount to enlarge the copy of the rectangle horizontally. - The amount to enlarge the copy of the rectangle vertically. - The enlarged . - - - Returns a structure that represents the intersection of two rectangles. If there is no intersection, and empty is returned. - A rectangle to intersect. - A rectangle to intersect. - A third structure the size of which represents the overlapped area of the two specified rectangles. - - - Replaces this structure with the intersection of itself and the specified structure. - The rectangle to intersect. - - - Determines if this rectangle intersects with rect. - The rectangle to test. - This method returns true if there is any intersection. - - - Tests whether the or property of this has a value of zero. - This property returns true if the or property of this has a value of zero; otherwise, false. - - - Gets the x-coordinate of the left edge of this structure. - The x-coordinate of the left edge of this structure. - - - Gets or sets the coordinates of the upper-left corner of this structure. - A that represents the upper-left corner of this structure. - - - Adjusts the location of this rectangle by the specified amount. - The amount to offset the location. - - - Adjusts the location of this rectangle by the specified amount. - The amount to offset the location horizontally. - The amount to offset the location vertically. - - - Tests whether two structures have equal location and size. - The structure that is to the left of the equality operator. - The structure that is to the right of the equality operator. - This operator returns true if the two specified structures have equal , , , and properties. - - - - - - - Tests whether two structures differ in location or size. - The structure that is to the left of the inequality operator. - The structure that is to the right of the inequality operator. - This operator returns true if any of the , , , or properties of the two structures are unequal; otherwise false. - - - Gets the x-coordinate that is the sum of and of this structure. - The x-coordinate that is the sum of and of this structure. - - - Gets or sets the size of this . - A that represents the width and height of this structure. - - - Gets the y-coordinate of the top edge of this structure. - The y-coordinate of the top edge of this structure. - - - Converts the Location and of this to a human-readable string. - A string that contains the position, width, and height of this structure. For example, "{X=20, Y=20, Width=100, Height=50}". - - - Creates the smallest possible third rectangle that can contain both of two rectangles that form a union. - A rectangle to union. - A rectangle to union. - A third structure that contains both of the two rectangles that form the union. - - - Gets or sets the width of this structure. - The width of this structure. The default is 0. - - - Gets or sets the x-coordinate of the upper-left corner of this structure. - The x-coordinate of the upper-left corner of this structure. The default is 0. - - - Gets or sets the y-coordinate of the upper-left corner of this structure. - The y-coordinate of the upper-left corner of this structure. The default is 0. - - - Stores an ordered pair of integers, which specify a and . - - - Initializes a new instance of the structure from the specified structure. - The structure from which to initialize this structure. - - - Initializes a new instance of the structure from the specified dimensions. - The width component of the new . - The height component of the new . - - - Adds the width and height of one structure to the width and height of another structure. - The first structure to add. - The second structure to add. - A structure that is the result of the addition operation. - - - Converts the specified structure to a structure by rounding the values of the structure to the next higher integer values. - The structure to convert. - The structure this method converts to. - - - Gets a structure that has a and value of 0. - - - - Tests to see whether the specified object is a structure with the same dimensions as this structure. - The to test. - true if obj is a and has the same width and height as this ; otherwise, false. - - - Returns a hash code for this structure. - An integer value that specifies a hash value for this structure. - - - Gets or sets the vertical component of this structure. - The vertical component of this structure, typically measured in pixels. - - - Tests whether this structure has width and height of 0. - This property returns true when this structure has both a width and height of 0; otherwise, false. - - - Adds the width and height of one structure to the width and height of another structure. - The first to add. - The second to add. - A structure that is the result of the addition operation. - - - Tests whether two structures are equal. - The structure on the left side of the equality operator. - The structure on the right of the equality operator. - true if sz1 and sz2 have equal width and height; otherwise, false. - - - - - - - - - - - Tests whether two structures are different. - The structure on the left of the inequality operator. - The structure on the right of the inequality operator. - true if sz1 and sz2 differ either in width or height; false if sz1 and sz2 are equal. - - - Subtracts the width and height of one structure from the width and height of another structure. - The structure on the left side of the subtraction operator. - The structure on the right side of the subtraction operator. - A structure that is the result of the subtraction operation. - - - Converts the specified structure to a structure by rounding the values of the structure to the nearest integer values. - The structure to convert. - The structure this method converts to. - - - Subtracts the width and height of one structure from the width and height of another structure. - The structure on the left side of the subtraction operator. - The structure on the right side of the subtraction operator. - A structure that is a result of the subtraction operation. - - - Creates a human-readable string that represents this structure. - A string that represents this . - - - Converts the specified structure to a structure by truncating the values of the structure to the next lower integer values. - The structure to convert. - The structure this method converts to. - - - Gets or sets the horizontal component of this structure. - The horizontal component of this structure, typically measured in pixels. - - - Stores an ordered pair of floating-point numbers, typically the width and height of a rectangle. - - - Initializes a new instance of the structure from the specified structure. - The structure from which to initialize this structure. - - - Initializes a new instance of the structure from the specified existing structure. - The structure from which to create the new structure. - - - Initializes a new instance of the structure from the specified dimensions. - The width component of the new structure. - The height component of the new structure. - - - Adds the width and height of one structure to the width and height of another structure. - The first structure to add. - The second structure to add. - A structure that is the result of the addition operation. - - - Gets a structure that has a and value of 0. - - - - Tests to see whether the specified object is a structure with the same dimensions as this structure. - The to test. - This method returns true if obj is a and has the same width and height as this ; otherwise, false. - - - Returns a hash code for this structure. - An integer value that specifies a hash value for this structure. - - - Gets or sets the vertical component of this structure. - The vertical component of this structure, typically measured in pixels. - - - Gets a value that indicates whether this structure has zero width and height. - This property returns true when this structure has both a width and height of zero; otherwise, false. - - - Adds the width and height of one structure to the width and height of another structure. - The first structure to add. - The second structure to add. - A structure that is the result of the addition operation. - - - Tests whether two structures are equal. - The structure on the left side of the equality operator. - The structure on the right of the equality operator. - This operator returns true if sz1 and sz2 have equal width and height; otherwise, false. - - - - - - - Tests whether two structures are different. - The structure on the left of the inequality operator. - The structure on the right of the inequality operator. - This operator returns true if sz1 and sz2 differ either in width or height; false if sz1 and sz2 are equal. - - - Subtracts the width and height of one structure from the width and height of another structure. - The structure on the left side of the subtraction operator. - The structure on the right side of the subtraction operator. - A that is the result of the subtraction operation. - - - Subtracts the width and height of one structure from the width and height of another structure. - The structure on the left side of the subtraction operator. - The structure on the right side of the subtraction operator. - A structure that is a result of the subtraction operation. - - - Converts a structure to a structure. - Returns a structure. - - - Converts a structure to a structure. - Returns a structure. - - - Creates a human-readable string that represents this structure. - A string that represents this structure. - - - Gets or sets the horizontal component of this structure. - The horizontal component of this structure, typically measured in pixels. - - - The exception that is thrown when an object appears more than once in an array of synchronization objects. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with the name of the parameter that causes this exception. - The name of the parameter that caused the exception. - - - Initializes a new instance of the class with serialized data. - The object that holds the serialized object data. - The contextual information about the source or destination. - - - Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. - The error message that explains the reason for the exception. - The exception that is the cause of the current exception. If the innerException parameter is not null, the current exception is raised in a catch block that handles the inner exception. - - - Initializes a new instance of the class with a specified error message and the name of the parameter that causes this exception. - The name of the parameter that caused the exception. - The message that describes the error. - - - Represents the binary dynamic operation at the call site, providing the binding semantic and the details about the operation. - - - Initializes a new instance of the class. - The binary operation kind. - - - Performs the binding of the dynamic binary operation. - The target of the dynamic operation. - An array of arguments of the dynamic operation. - The representing the result of the binding. - - - Performs the binding of the binary dynamic operation if the target dynamic object cannot bind. - The target of the dynamic binary operation. - The right hand side operand of the dynamic binary operation. - The representing the result of the binding. - - - When overridden in the derived class, performs the binding of the binary dynamic operation if the target dynamic object cannot bind. - The target of the dynamic binary operation. - The right hand side operand of the dynamic binary operation. - The binding result if the binding fails, or null. - The representing the result of the binding. - - - The binary operation kind. - The object representing the kind of binary operation. - - - The result type of the operation. - The result type of the operation. - - - Represents a set of binding restrictions on the under which the dynamic binding is valid. - - - Combines binding restrictions from the list of instances into one set of restrictions. - The list of instances from which to combine restrictions. - The new set of binding restrictions. - - - Represents an empty set of binding restrictions. This field is read only. - - - - Creates the binding restriction that checks the expression for arbitrary immutable properties. - The expression representing the restrictions. - The new binding restrictions. - - - Creates the binding restriction that checks the expression for object instance identity. - The expression to test. - The exact object instance to test. - The new binding restrictions. - - - Creates the binding restriction that check the expression for runtime type identity. - The expression to test. - The exact type to test. - The new binding restrictions. - - - Merges the set of binding restrictions with the current binding restrictions. - The set of restrictions with which to merge the current binding restrictions. - The new set of binding restrictions. - - - Creates the representing the binding restrictions. - The expression tree representing the restrictions. - - - Describes arguments in the dynamic binding process. - - - Creates a new CallInfo that represents arguments in the dynamic binding process. - The number of arguments. - The argument names. - - - Creates a new PositionalArgumentInfo. - The number of arguments. - The argument names. - - - The number of arguments. - The number of arguments. - - - The argument names. - The read-only collection of argument names. - - - Determines whether the specified CallInfo instance is considered equal to the current. - The instance of to compare with the current instance. - true if the specified instance is equal to the current one otherwise, false. - - - Serves as a hash function for the current . - A hash code for the current . - - - Represents the convert dynamic operation at the call site, providing the binding semantic and the details about the operation. - - - Initializes a new instance of the . - The type to convert to. - Is true if the conversion should consider explicit conversions; otherwise, false. - - - Performs the binding of the dynamic convert operation. - The target of the dynamic convert operation. - An array of arguments of the dynamic convert operation. - The representing the result of the binding. - - - Gets the value indicating if the conversion should consider explicit conversions. - True if there is an explicit conversion, otherwise false. - - - Performs the binding of the dynamic convert operation if the target dynamic object cannot bind. - The target of the dynamic convert operation. - The representing the result of the binding. - - - When overridden in the derived class, performs the binding of the dynamic convert operation if the target dynamic object cannot bind. - The target of the dynamic convert operation. - The binding result to use if binding fails, or null. - The representing the result of the binding. - - - The result type of the operation. - The object representing the result type of the operation. - - - The type to convert to. - The object that represents the type to convert to. - - - Represents the dynamic create operation at the call site, providing the binding semantic and the details about the operation. - - - Initializes a new intsance of the . - The signature of the arguments at the call site. - - - Performs the binding of the dynamic create operation. - The target of the dynamic create operation. - An array of arguments of the dynamic create operation. - The representing the result of the binding. - - - Gets the signature of the arguments at the call site. - The signature of the arguments at the call site. - - - Performs the binding of the dynamic create operation if the target dynamic object cannot bind. - The target of the dynamic create operation. - The arguments of the dynamic create operation. - The representing the result of the binding. - - - When overridden in the derived class, performs the binding of the dynamic create operation if the target dynamic object cannot bind. - The target of the dynamic create operation. - The arguments of the dynamic create operation. - The binding result to use if binding fails, or null. - The representing the result of the binding. - - - The result type of the operation. - The object representing the result type of the operation. - - - Represents the dynamic delete index operation at the call site, providing the binding semantic and the details about the operation. - - - Initializes a new instance of the . - The signature of the arguments at the call site. - - - Performs the binding of the dynamic delete index operation. - The target of the dynamic delete index operation. - An array of arguments of the dynamic delete index operation. - The representing the result of the binding. - - - Gets the signature of the arguments at the call site. - The signature of the arguments at the call site. - - - Performs the binding of the dynamic delete index operation if the target dynamic object cannot bind. - The target of the dynamic delete index operation. - The arguments of the dynamic delete index operation. - The representing the result of the binding. - - - When overridden in the derived class, performs the binding of the dynamic delete index operation if the target dynamic object cannot bind. - The target of the dynamic delete index operation. - The arguments of the dynamic delete index operation. - The binding result to use if binding fails, or null. - The representing the result of the binding. - - - The result type of the operation. - The object representing the result type of the operation. - - - Represents the dynamic delete member operation at the call site, providing the binding semantic and the details about the operation. - - - Initializes a new instance of the . - The name of the member to delete. - Is true if the name should be matched ignoring case; false otherwise. - - - Performs the binding of the dynamic delete member operation. - The target of the dynamic delete member operation. - An array of arguments of the dynamic delete member operation. - The representing the result of the binding. - - - Performs the binding of the dynamic delete member operation if the target dynamic object cannot bind. - The target of the dynamic delete member operation. - The representing the result of the binding. - - - When overridden in the derived class, performs the binding of the dynamic delete member operation if the target dynamic object cannot bind. - The target of the dynamic delete member operation. - The binding result to use if binding fails, or null. - The representing the result of the binding. - - - Gets the value indicating if the string comparison should ignore the case of the member name. - True if the string comparison should ignore the case, otherwise false. - - - Gets the name of the member to delete. - The name of the member to delete. - - - The result type of the operation. - The object representing the result type of the operation. - - - Represents the dynamic binding and a binding logic of an object participating in the dynamic binding. - - - Initializes a new instance of the class. - The expression representing this during the dynamic binding process. - The set of binding restrictions under which the binding is valid. - - - Initializes a new instance of the class. - The expression representing this during the dynamic binding process. - The set of binding restrictions under which the binding is valid. - The runtime value represented by the . - - - Performs the binding of the dynamic binary operation. - An instance of the that represents the details of the dynamic operation. - An instance of the representing the right hand side of the binary operation. - The new representing the result of the binding. - - - Performs the binding of the dynamic conversion operation. - An instance of the that represents the details of the dynamic operation. - The new representing the result of the binding. - - - Performs the binding of the dynamic create instance operation. - An instance of the that represents the details of the dynamic operation. - An array of instances - arguments to the create instance operation. - The new representing the result of the binding. - - - Performs the binding of the dynamic delete index operation. - An instance of the that represents the details of the dynamic operation. - An array of instances - indexes for the delete index operation. - The new representing the result of the binding. - - - Performs the binding of the dynamic delete member operation. - An instance of the that represents the details of the dynamic operation. - The new representing the result of the binding. - - - Performs the binding of the dynamic get index operation. - An instance of the that represents the details of the dynamic operation. - An array of instances - indexes for the get index operation. - The new representing the result of the binding. - - - Performs the binding of the dynamic get member operation. - An instance of the that represents the details of the dynamic operation. - The new representing the result of the binding. - - - Performs the binding of the dynamic invoke operation. - An instance of the that represents the details of the dynamic operation. - An array of instances - arguments to the invoke operation. - The new representing the result of the binding. - - - Performs the binding of the dynamic invoke member operation. - An instance of the that represents the details of the dynamic operation. - An array of instances - arguments to the invoke member operation. - The new representing the result of the binding. - - - Performs the binding of the dynamic set index operation. - An instance of the that represents the details of the dynamic operation. - An array of instances - indexes for the set index operation. - The representing the value for the set index operation. - The new representing the result of the binding. - - - Performs the binding of the dynamic set member operation. - An instance of the that represents the details of the dynamic operation. - The representing the value for the set member operation. - The new representing the result of the binding. - - - Performs the binding of the dynamic unary operation. - An instance of the that represents the details of the dynamic operation. - The new representing the result of the binding. - - - Creates a meta-object for the specified object. - The object to get a meta-object for. - The expression representing this during the dynamic binding process. - If the given object implements and is not a remote object from outside the current AppDomain, returns the object's specific meta-object returned by . Otherwise a plain new meta-object with no restrictions is created and returned. - - - Represents an empty array of type . This field is read only. - - - - The expression representing the during the dynamic binding process. - The expression representing the during the dynamic binding process. - - - Returns the enumeration of all dynamic member names. - The list of dynamic member names. - - - Gets a value indicating whether the has the runtime value. - True if the has the runtime value, otherwise false. - - - Gets the limit type of the . - if runtime value is available, a type of the otherwise. - - - The set of binding restrictions under which the binding is valid. - The set of binding restrictions. - - - Gets the of the runtime value or null if the has no value associated with it. - The of the runtime value or null. - - - The runtime value represented by this . - The runtime value represented by this . - - - The dynamic call site binder that participates in the binding protocol. - - - Initializes a new instance of the class. - - - When overridden in the derived class, performs the binding of the dynamic operation. - The target of the dynamic operation. - An array of arguments of the dynamic operation. - The representing the result of the binding. - - - Performs the runtime binding of the dynamic operation on a set of arguments. - An array of arguments to the dynamic operation. - The array of instances that represent the parameters of the call site in the binding process. - A LabelTarget used to return the result of the dynamic binding. - An Expression that performs tests on the dynamic operation arguments, and performs the dynamic operation if the tests are valid. If the tests fail on subsequent occurrences of the dynamic operation, Bind will be called again to produce a new for the new argument types. - - - Defers the binding of the operation until later time when the runtime values of all dynamic operation arguments have been computed. - An array of arguments of the dynamic operation. - The representing the result of the binding. - - - Defers the binding of the operation until later time when the runtime values of all dynamic operation arguments have been computed. - The target of the dynamic operation. - An array of arguments of the dynamic operation. - The representing the result of the binding. - - - Gets an expression that will cause the binding to be updated. It indicates that the expression's binding is no longer valid. This is typically used when the "version" of a dynamic object has changed. - The property of the resulting expression; any type is allowed. - The update expression. - - - The result type of the operation. - The object representing the result type of the operation. - - - Provides a base class for specifying dynamic behavior at run time. This class must be inherited from; you cannot instantiate it directly. - - - Enables derived types to initialize a new instance of the type. - - - Returns the enumeration of all dynamic member names. - A sequence that contains dynamic member names. - - - Provides a that dispatches to the dynamic virtual methods. The object can be encapsulated inside another to provide custom behavior for individual actions. This method supports the Dynamic Language Runtime infrastructure for language implementers and it is not intended to be used directly from your code. - The expression that represents to dispatch to the dynamic virtual methods. - An object of the type. - - - Provides implementation for binary operations. Classes derived from the class can override this method to specify dynamic behavior for operations such as addition and multiplication. - Provides information about the binary operation. The binder.Operation property returns an object. For example, for the sum = first + second statement, where first and second are derived from the DynamicObject class, binder.Operation returns ExpressionType.Add. - The right operand for the binary operation. For example, for the sum = first + second statement, where first and second are derived from the DynamicObject class, arg is equal to second. - The result of the binary operation. - true if the operation is successful; otherwise, false. If this method returns false, the run-time binder of the language determines the behavior. (In most cases, a language-specific run-time exception is thrown.) - - - Provides implementation for type conversion operations. Classes derived from the class can override this method to specify dynamic behavior for operations that convert an object from one type to another. - Provides information about the conversion operation. The binder.Type property provides the type to which the object must be converted. For example, for the statement (String)sampleObject in C# (CType(sampleObject, Type) in Visual Basic), where sampleObject is an instance of the class derived from the class, binder.Type returns the type. The binder.Explicit property provides information about the kind of conversion that occurs. It returns true for explicit conversion and false for implicit conversion. - The result of the type conversion operation. - true if the operation is successful; otherwise, false. If this method returns false, the run-time binder of the language determines the behavior. (In most cases, a language-specific run-time exception is thrown.) - - - Provides the implementation for operations that initialize a new instance of a dynamic object. This method is not intended for use in C# or Visual Basic. - Provides information about the initialization operation. - The arguments that are passed to the object during initialization. For example, for the new SampleType(100) operation, where SampleType is the type derived from the class, args[0] is equal to 100. - The result of the initialization. - true if the operation is successful; otherwise, false. If this method returns false, the run-time binder of the language determines the behavior. (In most cases, a language-specific run-time exception is thrown.) - - - Provides the implementation for operations that delete an object by index. This method is not intended for use in C# or Visual Basic. - Provides information about the deletion. - The indexes to be deleted. - true if the operation is successful; otherwise, false. If this method returns false, the run-time binder of the language determines the behavior. (In most cases, a language-specific run-time exception is thrown.) - - - Provides the implementation for operations that delete an object member. This method is not intended for use in C# or Visual Basic. - Provides information about the deletion. - true if the operation is successful; otherwise, false. If this method returns false, the run-time binder of the language determines the behavior. (In most cases, a language-specific run-time exception is thrown.) - - - Provides the implementation for operations that get a value by index. Classes derived from the class can override this method to specify dynamic behavior for indexing operations. - Provides information about the operation. - The indexes that are used in the operation. For example, for the sampleObject[3] operation in C# (sampleObject(3) in Visual Basic), where sampleObject is derived from the DynamicObject class, indexes[0] is equal to 3. - The result of the index operation. - true if the operation is successful; otherwise, false. If this method returns false, the run-time binder of the language determines the behavior. (In most cases, a run-time exception is thrown.) - - - Provides the implementation for operations that get member values. Classes derived from the class can override this method to specify dynamic behavior for operations such as getting a value for a property. - Provides information about the object that called the dynamic operation. The binder.Name property provides the name of the member on which the dynamic operation is performed. For example, for the Console.WriteLine(sampleObject.SampleProperty) statement, where sampleObject is an instance of the class derived from the class, binder.Name returns "SampleProperty". The binder.IgnoreCase property specifies whether the member name is case-sensitive. - The result of the get operation. For example, if the method is called for a property, you can assign the property value to result. - true if the operation is successful; otherwise, false. If this method returns false, the run-time binder of the language determines the behavior. (In most cases, a run-time exception is thrown.) - - - Provides the implementation for operations that invoke an object. Classes derived from the class can override this method to specify dynamic behavior for operations such as invoking an object or a delegate. - Provides information about the invoke operation. - The arguments that are passed to the object during the invoke operation. For example, for the sampleObject(100) operation, where sampleObject is derived from the class, args[0] is equal to 100. - The result of the object invocation. - true if the operation is successful; otherwise, false. If this method returns false, the run-time binder of the language determines the behavior. (In most cases, a language-specific run-time exception is thrown. - - - Provides the implementation for operations that invoke a member. Classes derived from the class can override this method to specify dynamic behavior for operations such as calling a method. - Provides information about the dynamic operation. The binder.Name property provides the name of the member on which the dynamic operation is performed. For example, for the statement sampleObject.SampleMethod(100), where sampleObject is an instance of the class derived from the class, binder.Name returns "SampleMethod". The binder.IgnoreCase property specifies whether the member name is case-sensitive. - The arguments that are passed to the object member during the invoke operation. For example, for the statement sampleObject.SampleMethod(100), where sampleObject is derived from the class, args[0] is equal to 100. - The result of the member invocation. - true if the operation is successful; otherwise, false. If this method returns false, the run-time binder of the language determines the behavior. (In most cases, a language-specific run-time exception is thrown.) - - - Provides the implementation for operations that set a value by index. Classes derived from the class can override this method to specify dynamic behavior for operations that access objects by a specified index. - Provides information about the operation. - The indexes that are used in the operation. For example, for the sampleObject[3] = 10 operation in C# (sampleObject(3) = 10 in Visual Basic), where sampleObject is derived from the class, indexes[0] is equal to 3. - The value to set to the object that has the specified index. For example, for the sampleObject[3] = 10 operation in C# (sampleObject(3) = 10 in Visual Basic), where sampleObject is derived from the class, value is equal to 10. - true if the operation is successful; otherwise, false. If this method returns false, the run-time binder of the language determines the behavior. (In most cases, a language-specific run-time exception is thrown. - - - Provides the implementation for operations that set member values. Classes derived from the class can override this method to specify dynamic behavior for operations such as setting a value for a property. - Provides information about the object that called the dynamic operation. The binder.Name property provides the name of the member to which the value is being assigned. For example, for the statement sampleObject.SampleProperty = "Test", where sampleObject is an instance of the class derived from the class, binder.Name returns "SampleProperty". The binder.IgnoreCase property specifies whether the member name is case-sensitive. - The value to set to the member. For example, for sampleObject.SampleProperty = "Test", where sampleObject is an instance of the class derived from the class, the value is "Test". - true if the operation is successful; otherwise, false. If this method returns false, the run-time binder of the language determines the behavior. (In most cases, a language-specific run-time exception is thrown.) - - - Provides implementation for unary operations. Classes derived from the class can override this method to specify dynamic behavior for operations such as negation, increment, or decrement. - Provides information about the unary operation. The binder.Operation property returns an object. For example, for the negativeNumber = -number statement, where number is derived from the DynamicObject class, binder.Operation returns "Negate". - The result of the unary operation. - true if the operation is successful; otherwise, false. If this method returns false, the run-time binder of the language determines the behavior. (In most cases, a language-specific run-time exception is thrown.) - - - Represents an object whose members can be dynamically added and removed at run time. - - - Initializes a new ExpandoObject that does not have members. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Returns an enumerator that iterates through the collection. - An that can be used to iterate through the collection. - - - The provided MetaObject will dispatch to the dynamic virtual methods. The object can be encapsulated inside another MetaObject to provide custom behavior for individual actions. - The expression that represents the MetaObject to dispatch to the Dynamic virtual methods. - The object of the type. - - - Represents the dynamic get index operation at the call site, providing the binding semantic and the details about the operation. - - - Initializes a new instance of the . - The signature of the arguments at the call site. - - - Performs the binding of the dynamic get index operation. - The target of the dynamic get index operation. - An array of arguments of the dynamic get index operation. - The representing the result of the binding. - - - Gets the signature of the arguments at the call site. - The signature of the arguments at the call site. - - - Performs the binding of the dynamic get index operation if the target dynamic object cannot bind. - The target of the dynamic get index operation. - The arguments of the dynamic get index operation. - The representing the result of the binding. - - - When overridden in the derived class, performs the binding of the dynamic get index operation if the target dynamic object cannot bind. - The target of the dynamic get index operation. - The arguments of the dynamic get index operation. - The binding result to use if binding fails, or null. - The representing the result of the binding. - - - The result type of the operation. - The object representing the result type of the operation. - - - Represents the dynamic get member operation at the call site, providing the binding semantic and the details about the operation. - - - Initializes a new instance of the . - The name of the member to obtain. - Is true if the name should be matched ignoring case; false otherwise. - - - Performs the binding of the dynamic get member operation. - The target of the dynamic get member operation. - An array of arguments of the dynamic get member operation. - The representing the result of the binding. - - - Performs the binding of the dynamic get member operation if the target dynamic object cannot bind. - The target of the dynamic get member operation. - The representing the result of the binding. - - - When overridden in the derived class, performs the binding of the dynamic get member operation if the target dynamic object cannot bind. - The target of the dynamic get member operation. - The binding result to use if binding fails, or null. - The representing the result of the binding. - - - Gets the value indicating if the string comparison should ignore the case of the member name. - True if the case is ignored, otherwise false. - - - Gets the name of the member to obtain. - The name of the member to obtain. - - - The result type of the operation. - The object representing the result type of the operation. - - - Represents a dynamic object, that can have its operations bound at runtime. - - - Returns the responsible for binding operations performed on this object. - The expression tree representation of the runtime value. - The to bind this object. - - - Represents information about a dynamic get member operation that indicates if the get member should invoke properties when they perform the get operation. - - - Gets the value indicating if this get member operation should invoke properties when they perform the get operation. The default value when this interface is not present is true. - True if this get member operation should invoke properties when they perform the get operation; otherwise false. - - - Represents the invoke dynamic operation at the call site, providing the binding semantic and the details about the operation. - - - Initializes a new instance of the . - The signature of the arguments at the call site. - - - Performs the binding of the dynamic invoke operation. - The target of the dynamic invoke operation. - An array of arguments of the dynamic invoke operation. - The representing the result of the binding. - - - Gets the signature of the arguments at the call site. - The signature of the arguments at the call site. - - - Performs the binding of the dynamic invoke operation if the target dynamic object cannot bind. - The target of the dynamic invoke operation. - The arguments of the dynamic invoke operation. - The representing the result of the binding. - - - Performs the binding of the dynamic invoke operation if the target dynamic object cannot bind. - The target of the dynamic invoke operation. - The arguments of the dynamic invoke operation. - The binding result to use if binding fails, or null. - The representing the result of the binding. - - - The result type of the operation. - The object representing the result type of the operation. - - - Represents the invoke member dynamic operation at the call site, providing the binding semantic and the details about the operation. - - - Initializes a new instance of the . - The name of the member to invoke. - true if the name should be matched ignoring case; false otherwise. - The signature of the arguments at the call site. - - - Performs the binding of the dynamic invoke member operation. - The target of the dynamic invoke member operation. - An array of arguments of the dynamic invoke member operation. - The representing the result of the binding. - - - Gets the signature of the arguments at the call site. - The signature of the arguments at the call site. - - - When overridden in the derived class, performs the binding of the dynamic invoke operation if the target dynamic object cannot bind. - The target of the dynamic invoke operation. - The arguments of the dynamic invoke operation. - The binding result to use if binding fails, or null. - The representing the result of the binding. - - - Performs the binding of the dynamic invoke member operation if the target dynamic object cannot bind. - The target of the dynamic invoke member operation. - The arguments of the dynamic invoke member operation. - The representing the result of the binding. - - - When overridden in the derived class, performs the binding of the dynamic invoke member operation if the target dynamic object cannot bind. - The target of the dynamic invoke member operation. - The arguments of the dynamic invoke member operation. - The binding result to use if binding fails, or null. - The representing the result of the binding. - - - Gets the value indicating if the string comparison should ignore the case of the member name. - True if the case is ignored, otherwise false. - - - Gets the name of the member to invoke. - The name of the member to invoke. - - - The result type of the operation. - The object representing the result type of the operation. - - - Represents the dynamic set index operation at the call site, providing the binding semantic and the details about the operation. - - - Initializes a new instance of the . - The signature of the arguments at the call site. - - - Performs the binding of the dynamic set index operation. - The target of the dynamic set index operation. - An array of arguments of the dynamic set index operation. - The representing the result of the binding. - - - Gets the signature of the arguments at the call site. - The signature of the arguments at the call site. - - - Performs the binding of the dynamic set index operation if the target dynamic object cannot bind. - The target of the dynamic set index operation. - The arguments of the dynamic set index operation. - The value to set to the collection. - The representing the result of the binding. - - - When overridden in the derived class, performs the binding of the dynamic set index operation if the target dynamic object cannot bind. - The target of the dynamic set index operation. - The arguments of the dynamic set index operation. - The value to set to the collection. - The binding result to use if binding fails, or null. - The representing the result of the binding. - - - The result type of the operation. - The object representing the result type of the operation. - - - Represents the dynamic set member operation at the call site, providing the binding semantic and the details about the operation. - - - Initializes a new instance of the . - The name of the member to obtain. - Is true if the name should be matched ignoring case; false otherwise. - - - Performs the binding of the dynamic set member operation. - The target of the dynamic set member operation. - An array of arguments of the dynamic set member operation. - The representing the result of the binding. - - - Performs the binding of the dynamic set member operation if the target dynamic object cannot bind. - The target of the dynamic set member operation. - The value to set to the member. - The representing the result of the binding. - - - Performs the binding of the dynamic set member operation if the target dynamic object cannot bind. - The target of the dynamic set member operation. - The value to set to the member. - The binding result to use if binding fails, or null. - The representing the result of the binding. - - - Gets the value indicating if the string comparison should ignore the case of the member name. - True if the case is ignored, otherwise false. - - - Gets the name of the member to obtain. - The name of the member to obtain. - - - The result type of the operation. - The object representing the result type of the operation. - - - Represents the unary dynamic operation at the call site, providing the binding semantic and the details about the operation. - - - Initializes a new instance of the class. - The unary operation kind. - - - Performs the binding of the dynamic unary operation. - The target of the dynamic operation. - An array of arguments of the dynamic operation. - The representing the result of the binding. - - - Performs the binding of the unary dynamic operation if the target dynamic object cannot bind. - The target of the dynamic unary operation. - The representing the result of the binding. - - - Performs the binding of the unary dynamic operation if the target dynamic object cannot bind. - The target of the dynamic unary operation. - The binding result in case the binding fails, or null. - The representing the result of the binding. - - - The unary operation kind. - The object of the that represents the unary operation kind. - - - The result type of the operation. - The object representing the result type of the operation. - - - Enables access to objects across application domain boundaries in applications that support remoting. - - - Initializes a new instance of the class. - - - Retrieves the current lifetime service object that controls the lifetime policy for this instance. - An object of type used to control the lifetime policy for this instance. - The immediate caller does not have infrastructure permission. - - - Obtains a lifetime service object to control the lifetime policy for this instance. - An object of type used to control the lifetime policy for this instance. This is the current lifetime service object for this instance if one exists; otherwise, a new lifetime service object initialized to the value of the property. - The immediate caller does not have infrastructure permission. - - - Creates a shallow copy of the current object. - false to delete the current object's identity, which will cause the object to be assigned a new identity when it is marshaled across a remoting boundary. A value of false is usually appropriate. true to copy the current object's identity to its clone, which will cause remoting client calls to be routed to the remote server object. - A shallow copy of the current object. - - - Provides constants and static methods for trigonometric, logarithmic, and other common mathematical functions. - - - Returns the absolute value of a number. - A number that is greater than or equal to , but less than or equal to . - A decimal number, x, such that 0 ≤ x ≤. - - - Returns the absolute value of a double-precision floating-point number. - A number that is greater than or equal to , but less than or equal to . - A double-precision floating-point number, x, such that 0 ≤ x ≤. - - - Returns the absolute value of a 16-bit signed integer. - A number that is greater than , but less than or equal to . - A 16-bit signed integer, x, such that 0 ≤ x ≤. - value equals . - - - Returns the absolute value of a 32-bit signed integer. - A number that is greater than , but less than or equal to . - A 32-bit signed integer, x, such that 0 ≤ x ≤. - value equals . - - - Returns the absolute value of a 64-bit signed integer. - A number that is greater than , but less than or equal to . - A 64-bit signed integer, x, such that 0 ≤ x ≤. - value equals . - - - Returns the absolute value of an 8-bit signed integer. - A number that is greater than , but less than or equal to . - An 8-bit signed integer, x, such that 0 ≤ x ≤. - value equals . - - - Returns the absolute value of a single-precision floating-point number. - A number that is greater than or equal to , but less than or equal to . - A single-precision floating-point number, x, such that 0 ≤ x ≤. - - - Returns the angle whose cosine is the specified number. - A number representing a cosine, where d must be greater than or equal to -1, but less than or equal to 1. - An angle, θ, measured in radians, such that 0 ≤θ≤π -or- if d < -1 or d > 1 or d equals . - - - Returns the angle whose sine is the specified number. - A number representing a sine, where d must be greater than or equal to -1, but less than or equal to 1. - An angle, θ, measured in radians, such that -π/2 ≤θ≤π/2 -or- if d < -1 or d > 1 or d equals . - - - Returns the angle whose tangent is the specified number. - A number representing a tangent. - An angle, θ, measured in radians, such that -π/2 ≤θ≤π/2. -or- if d equals , -π/2 rounded to double precision (-1.5707963267949) if d equals , or π/2 rounded to double precision (1.5707963267949) if d equals . - - - Returns the angle whose tangent is the quotient of two specified numbers. - The y coordinate of a point. - The x coordinate of a point. - An angle, θ, measured in radians, such that -π≤θ≤π, and tan(θ) = y / x, where (x, y) is a point in the Cartesian plane. Observe the following: For (x, y) in quadrant 1, 0 < θ < π/2. For (x, y) in quadrant 2, π/2 < θ≤π. For (x, y) in quadrant 3, -π < θ < -π/2. For (x, y) in quadrant 4, -π/2 < θ < 0. For points on the boundaries of the quadrants, the return value is the following: If y is 0 and x is not negative, θ = 0. If y is 0 and x is negative, θ = π. If y is positive and x is 0, θ = π/2. If y is negative and x is 0, θ = -π/2. If y is 0 and x is 0, θ = 0. If x or y is , or if x and y are either or , the method returns . - - - Produces the full product of two 32-bit numbers. - The first number to multiply. - The second number to multiply. - The number containing the product of the specified numbers. - - - Returns the smallest integral value that is greater than or equal to the specified decimal number. - A decimal number. - The smallest integral value that is greater than or equal to d. Note that this method returns a instead of an integral type. - - - Returns the smallest integral value that is greater than or equal to the specified double-precision floating-point number. - A double-precision floating-point number. - The smallest integral value that is greater than or equal to a. If a is equal to , , or , that value is returned. Note that this method returns a instead of an integral type. - - - Returns the cosine of the specified angle. - An angle, measured in radians. - The cosine of d. If d is equal to , , or , this method returns . - - - Returns the hyperbolic cosine of the specified angle. - An angle, measured in radians. - The hyperbolic cosine of value. If value is equal to or , is returned. If value is equal to , is returned. - - - Calculates the quotient of two 64-bit signed integers and also returns the remainder in an output parameter. - The dividend. - The divisor. - The remainder. - The quotient of the specified numbers. - b is zero. - - - Calculates the quotient of two 32-bit signed integers and also returns the remainder in an output parameter. - The dividend. - The divisor. - The remainder. - The quotient of the specified numbers. - b is zero. - - - Represents the natural logarithmic base, specified by the constant, e. - - - - Returns e raised to the specified power. - A number specifying a power. - The number e raised to the power d. If d equals or , that value is returned. If d equals , 0 is returned. - - - Returns the largest integer less than or equal to the specified decimal number. - A decimal number. - The largest integer less than or equal to d. Note that the method returns an integral value of type . - - - Returns the largest integer less than or equal to the specified double-precision floating-point number. - A double-precision floating-point number. - The largest integer less than or equal to d. If d is equal to , , or , that value is returned. - - - Returns the remainder resulting from the division of a specified number by another specified number. - A dividend. - A divisor. - A number equal to x - (y Q), where Q is the quotient of x / y rounded to the nearest integer (if x / y falls halfway between two integers, the even integer is returned). If x - (y Q) is zero, the value +0 is returned if x is positive, or -0 if x is negative. If y = 0, is returned. - - - Returns the natural (base e) logarithm of a specified number. - The number whose logarithm is to be found. -

One of the values in the following table.

-
d parameter

-

Return value

-

Positive

-

The natural logarithm of d; that is, ln d, or log e d
Zero

-

Negative

-

Equal to
Equal to

-
-
- - Returns the logarithm of a specified number in a specified base. - The number whose logarithm is to be found. - The base of the logarithm. -

One of the values in the following table. (+Infinity denotes , -Infinity denotes , and NaN denotes .)

-
anewBase Return value

-

a> 0

-

(0 <newBase< 1) -or-(newBase> 1)

-

lognewBase(a)

-

a< 0

-

(any value)

-

NaN

-

(any value)

-

newBase< 0

-

NaN

-

a != 1

-

newBase = 0

-

NaN

-

a != 1

-

newBase = +Infinity

-

NaN

-

a = NaN

-

(any value)

-

NaN

-

(any value)

-

newBase = NaN

-

NaN

-

(any value)

-

newBase = 1

-

NaN

-

a = 0

-

0 <newBase< 1

-

+Infinity

-

a = 0

-

newBase> 1

-

-Infinity

-

a = +Infinity

-

0 <newBase< 1

-

-Infinity

-

a = +Infinity

-

newBase> 1

-

+Infinity

-

a = 1

-

newBase = 0

-

0

-

a = 1

-

newBase = +Infinity

-

0

-

-
-
- - Returns the base 10 logarithm of a specified number. - A number whose logarithm is to be found. -

One of the values in the following table.

-
d parameter

-

Return value

-

Positive

-

The base 10 log of d; that is, log 10d.

-

Zero

-

Negative

-

Equal to
Equal to

-
-
- - Returns the larger of two 16-bit unsigned integers. - The first of two 16-bit unsigned integers to compare. - The second of two 16-bit unsigned integers to compare. - Parameter val1 or val2, whichever is larger. - - - Returns the larger of two single-precision floating-point numbers. - The first of two single-precision floating-point numbers to compare. - The second of two single-precision floating-point numbers to compare. - Parameter val1 or val2, whichever is larger. If val1, or val2, or both val1 and val2 are equal to , is returned. - - - Returns the larger of two 64-bit unsigned integers. - The first of two 64-bit unsigned integers to compare. - The second of two 64-bit unsigned integers to compare. - Parameter val1 or val2, whichever is larger. - - - Returns the larger of two 32-bit unsigned integers. - The first of two 32-bit unsigned integers to compare. - The second of two 32-bit unsigned integers to compare. - Parameter val1 or val2, whichever is larger. - - - Returns the larger of two 8-bit signed integers. - The first of two 8-bit signed integers to compare. - The second of two 8-bit signed integers to compare. - Parameter val1 or val2, whichever is larger. - - - Returns the larger of two 32-bit signed integers. - The first of two 32-bit signed integers to compare. - The second of two 32-bit signed integers to compare. - Parameter val1 or val2, whichever is larger. - - - Returns the larger of two 16-bit signed integers. - The first of two 16-bit signed integers to compare. - The second of two 16-bit signed integers to compare. - Parameter val1 or val2, whichever is larger. - - - Returns the larger of two double-precision floating-point numbers. - The first of two double-precision floating-point numbers to compare. - The second of two double-precision floating-point numbers to compare. - Parameter val1 or val2, whichever is larger. If val1, val2, or both val1 and val2 are equal to , is returned. - - - Returns the larger of two decimal numbers. - The first of two decimal numbers to compare. - The second of two decimal numbers to compare. - Parameter val1 or val2, whichever is larger. - - - Returns the larger of two 8-bit unsigned integers. - The first of two 8-bit unsigned integers to compare. - The second of two 8-bit unsigned integers to compare. - Parameter val1 or val2, whichever is larger. - - - Returns the larger of two 64-bit signed integers. - The first of two 64-bit signed integers to compare. - The second of two 64-bit signed integers to compare. - Parameter val1 or val2, whichever is larger. - - - Returns the smaller of two 64-bit signed integers. - The first of two 64-bit signed integers to compare. - The second of two 64-bit signed integers to compare. - Parameter val1 or val2, whichever is smaller. - - - Returns the smaller of two 64-bit unsigned integers. - The first of two 64-bit unsigned integers to compare. - The second of two 64-bit unsigned integers to compare. - Parameter val1 or val2, whichever is smaller. - - - Returns the smaller of two 32-bit unsigned integers. - The first of two 32-bit unsigned integers to compare. - The second of two 32-bit unsigned integers to compare. - Parameter val1 or val2, whichever is smaller. - - - Returns the smaller of two 16-bit unsigned integers. - The first of two 16-bit unsigned integers to compare. - The second of two 16-bit unsigned integers to compare. - Parameter val1 or val2, whichever is smaller. - - - Returns the smaller of two single-precision floating-point numbers. - The first of two single-precision floating-point numbers to compare. - The second of two single-precision floating-point numbers to compare. - Parameter val1 or val2, whichever is smaller. If val1, val2, or both val1 and val2 are equal to , is returned. - - - Returns the smaller of two 8-bit signed integers. - The first of two 8-bit signed integers to compare. - The second of two 8-bit signed integers to compare. - Parameter val1 or val2, whichever is smaller. - - - Returns the smaller of two 16-bit signed integers. - The first of two 16-bit signed integers to compare. - The second of two 16-bit signed integers to compare. - Parameter val1 or val2, whichever is smaller. - - - Returns the smaller of two double-precision floating-point numbers. - The first of two double-precision floating-point numbers to compare. - The second of two double-precision floating-point numbers to compare. - Parameter val1 or val2, whichever is smaller. If val1, val2, or both val1 and val2 are equal to , is returned. - - - Returns the smaller of two decimal numbers. - The first of two decimal numbers to compare. - The second of two decimal numbers to compare. - Parameter val1 or val2, whichever is smaller. - - - Returns the smaller of two 8-bit unsigned integers. - The first of two 8-bit unsigned integers to compare. - The second of two 8-bit unsigned integers to compare. - Parameter val1 or val2, whichever is smaller. - - - Returns the smaller of two 32-bit signed integers. - The first of two 32-bit signed integers to compare. - The second of two 32-bit signed integers to compare. - Parameter val1 or val2, whichever is smaller. - - - Represents the ratio of the circumference of a circle to its diameter, specified by the constant, π. - - - - Returns a specified number raised to the specified power. - A double-precision floating-point number to be raised to a power. - A double-precision floating-point number that specifies a power. - The number x raised to the power y. - - - Rounds a double-precision floating-point value to the nearest integral value. - A double-precision floating-point number to be rounded. - The integer nearest a. If the fractional component of a is halfway between two integers, one of which is even and the other odd, then the even number is returned. Note that this method returns a instead of an integral type. - - - Rounds a decimal value to a specified number of fractional digits. A parameter specifies how to round the value if it is midway between two numbers. - A decimal number to be rounded. - The number of decimal places in the return value. - Specification for how to round d if it is midway between two other numbers. - The number nearest to d that contains a number of fractional digits equal to decimals. If d has fewer fractional digits than decimals, d is returned unchanged. - decimals is less than 0 or greater than 28. - mode is not a valid value of . - The result is outside the range of a . - - - Rounds a double-precision floating-point value to a specified number of fractional digits. A parameter specifies how to round the value if it is midway between two numbers. - A double-precision floating-point number to be rounded. - The number of fractional digits in the return value. - Specification for how to round value if it is midway between two other numbers. - The number nearest to value that has a number of fractional digits equal to digits. If value has fewer fractional digits than digits, value is returned unchanged. - digits is less than 0 or greater than 15. - mode is not a valid value of . - - - Rounds a double-precision floating-point value to the nearest integer. A parameter specifies how to round the value if it is midway between two numbers. - A double-precision floating-point number to be rounded. - Specification for how to round value if it is midway between two other numbers. - The integer nearest value. If value is halfway between two integers, one of which is even and the other odd, then mode determines which of the two is returned. - mode is not a valid value of . - - - Rounds a decimal value to the nearest integral value. - A decimal number to be rounded. - The integer nearest parameter d. If the fractional component of d is halfway between two integers, one of which is even and the other odd, the even number is returned. Note that this method returns a instead of an integral type. - The result is outside the range of a . - - - Rounds a decimal value to the nearest integer. A parameter specifies how to round the value if it is midway between two numbers. - A decimal number to be rounded. - Specification for how to round d if it is midway between two other numbers. - The integer nearest d. If d is halfway between two numbers, one of which is even and the other odd, then mode determines which of the two is returned. - mode is not a valid value of . - The result is outside the range of a . - - - Rounds a decimal value to a specified number of fractional digits. - A decimal number to be rounded. - The number of decimal places in the return value. - The number nearest to d that contains a number of fractional digits equal to decimals. - decimals is less than 0 or greater than 28. - The result is outside the range of a . - - - Rounds a double-precision floating-point value to a specified number of fractional digits. - A double-precision floating-point number to be rounded. - The number of fractional digits in the return value. - The number nearest to value that contains a number of fractional digits equal to digits. - digits is less than 0 or greater than 15. - - - Returns an integer that indicates the sign of a decimal number. - A signed decimal number. -

A number that indicates the sign of value, as shown in the following table.

-
Return value

-

Meaning

-

-1

-

value is less than zero.

-

0

-

value is equal to zero.

-

1

-

value is greater than zero.

-

-
-
- - Returns an integer that indicates the sign of a double-precision floating-point number. - A signed number. -

A number that indicates the sign of value, as shown in the following table.

-
Return value

-

Meaning

-

-1

-

value is less than zero.

-

0

-

value is equal to zero.

-

1

-

value is greater than zero.

-

-
- value is equal to . -
- - Returns an integer that indicates the sign of a 16-bit signed integer. - A signed number. -

A number that indicates the sign of value, as shown in the following table.

-
Return value

-

Meaning

-

-1

-

value is less than zero.

-

0

-

value is equal to zero.

-

1

-

value is greater than zero.

-

-
-
- - Returns an integer that indicates the sign of a 32-bit signed integer. - A signed number. -

A number that indicates the sign of value, as shown in the following table.

-
Return value

-

Meaning

-

-1

-

value is less than zero.

-

0

-

value is equal to zero.

-

1

-

value is greater than zero.

-

-
-
- - Returns an integer that indicates the sign of a 64-bit signed integer. - A signed number. -

A number that indicates the sign of value, as shown in the following table.

-
Return value

-

Meaning

-

-1

-

value is less than zero.

-

0

-

value is equal to zero.

-

1

-

value is greater than zero.

-

-
-
- - Returns an integer that indicates the sign of an 8-bit signed integer. - A signed number. -

A number that indicates the sign of value, as shown in the following table.

-
Return value

-

Meaning

-

-1

-

value is less than zero.

-

0

-

value is equal to zero.

-

1

-

value is greater than zero.

-

-
-
- - Returns an integer that indicates the sign of a single-precision floating-point number. - A signed number. -

A number that indicates the sign of value, as shown in the following table.

-
Return value

-

Meaning

-

-1

-

value is less than zero.

-

0

-

value is equal to zero.

-

1

-

value is greater than zero.

-

-
- value is equal to . -
- - Returns the sine of the specified angle. - An angle, measured in radians. - The sine of a. If a is equal to , , or , this method returns . - - - Returns the hyperbolic sine of the specified angle. - An angle, measured in radians. - The hyperbolic sine of value. If value is equal to , , or , this method returns a equal to value. - - - Returns the square root of a specified number. - The number whose square root is to be found. -

One of the values in the following table.

-
d parameter

-

Return value

-

Zero or positive

-

The positive square root of d.

-

Negative

-

Equals
Equals

-
-
- - Returns the tangent of the specified angle. - An angle, measured in radians. - The tangent of a. If a is equal to , , or , this method returns . - - - Returns the hyperbolic tangent of the specified angle. - An angle, measured in radians. - The hyperbolic tangent of value. If value is equal to , this method returns -1. If value is equal to , this method returns 1. If value is equal to , this method returns . - - - Calculates the integral part of a specified decimal number. - A number to truncate. - The integral part of d; that is, the number that remains after any fractional digits have been discarded. - - - Calculates the integral part of a specified double-precision floating-point number. - A number to truncate. -

The integral part of d; that is, the number that remains after any fractional digits have been discarded, or one of the values listed in the following table.

-
d Return value

-

-
-
- - The exception that is thrown when an attempt to access a class member fails. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with a specified error message. - The message that describes the error. - - - Initializes a new instance of the class with serialized data. - The object that holds the serialized object data. - The contextual information about the source or destination. - - - Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. - The error message that explains the reason for the exception. - The exception that is the cause of the current exception. If the inner parameter is not a null reference (Nothing in Visual Basic), the current exception is raised in a catch block that handles the inner exception. - - - Provides an that invokes callbacks for each reported progress value. - Specifies the type of the progress report value. - - - Initializes the object. - - - Initializes the object with the specified callback. - A handler to invoke for each reported progress value. This handler will be invoked in addition to any delegates registered with the event. Depending on the instance captured by the at construction, it is possible that this handler instance could be invoked concurrently with itself. - - - Reports a progress change. - The value of the updated progress. - - - Raised for each reported progress value. - - - - Reports a progress change. - The value of the updated progress. - - - Represents a pseudo-random number generator, which is a device that produces a sequence of numbers that meet certain statistical requirements for randomness. - - - Initializes a new instance of the class, using a time-dependent default seed value. - - - Initializes a new instance of the class, using the specified seed value. - A number used to calculate a starting value for the pseudo-random number sequence. If a negative number is specified, the absolute value of the number is used. - - - Returns a non-negative random integer. - A 32-bit signed integer that is greater than or equal to 0 and less than . - - - Returns a non-negative random integer that is less than the specified maximum. - The exclusive upper bound of the random number to be generated. maxValue must be greater than or equal to 0. - A 32-bit signed integer that is greater than or equal to 0, and less than maxValue; that is, the range of return values ordinarily includes 0 but not maxValue. However, if maxValue equals 0, maxValue is returned. - maxValue is less than 0. - - - Returns a random integer that is within a specified range. - The inclusive lower bound of the random number returned. - The exclusive upper bound of the random number returned. maxValue must be greater than or equal to minValue. - A 32-bit signed integer greater than or equal to minValue and less than maxValue; that is, the range of return values includes minValue but not maxValue. If minValue equals maxValue, minValue is returned. - minValue is greater than maxValue. - - - Fills the elements of a specified array of bytes with random numbers. - An array of bytes to contain random numbers. - buffer is null. - - - Returns a random floating-point number that is greater than or equal to 0.0, and less than 1.0. - A double-precision floating point number that is greater than or equal to 0.0, and less than 1.0. - - - Returns a random floating-point number between 0.0 and 1.0. - A double-precision floating point number that is greater than or equal to 0.0, and less than 1.0. - - - Specifies flags for method attributes. These flags are defined in the corhdr.h file. - - - Indicates that the class does not provide an implementation of this method. - - - - Indicates that the method is accessible to any class of this assembly. - - - - Indicates that the method can only be overridden when it is also accessible. - - - - Indicates that the method is accessible to members of this type and its derived types that are in this assembly only. - - - - Indicates that the method is accessible only to members of this class and its derived classes. - - - - Indicates that the method is accessible to derived classes anywhere, as well as to any class in the assembly. - - - - Indicates that the method cannot be overridden. - - - - Indicates that the method has security associated with it. Reserved flag for runtime use only. - - - - Indicates that the method hides by name and signature; otherwise, by name only. - - - - Retrieves accessibility information. - - - - Indicates that the method always gets a new slot in the vtable. - - - - Indicates that the method implementation is forwarded through PInvoke (Platform Invocation Services). - - - - Indicates that the method is accessible only to the current class. - - - - Indicates that the member cannot be referenced. - - - - Indicates that the method is accessible to any object for which this object is in scope. - - - - Indicates that the method calls another method containing security code. Reserved flag for runtime use only. - - - - Indicates a reserved flag for runtime use only. - - - - Indicates that the method will reuse an existing slot in the vtable. This is the default behavior. - - - - Indicates that the common language runtime checks the name encoding. - - - - Indicates that the method is special. The name describes how this method is special. - - - - Indicates that the method is defined on the type; otherwise, it is defined per instance. - - - - Indicates that the managed method is exported by thunk to unmanaged code. - - - - Indicates that the method is virtual. - - - - Retrieves vtable attributes. - - - - Provides information about methods and constructors. - - - Initializes a new instance of the class. - - - Gets the attributes associated with this method. - One of the values. - - - Gets a value indicating the calling conventions for this method. - The for this method. - - - Gets a value indicating whether the generic method contains unassigned generic type parameters. - true if the current object represents a generic method that contains unassigned generic type parameters; otherwise, false. - - - Returns a value that indicates whether this instance is equal to a specified object. - An object to compare with this instance, or null. - true if obj equals the type and value of this instance; otherwise, false. - - - Returns a MethodBase object representing the currently executing method. - is a static method that is called from within an executing method and that returns information about that method. A MethodBase object representing the currently executing method. - This member was invoked with a late-binding mechanism. - - - Returns an array of objects that represent the type arguments of a generic method or the type parameters of a generic method definition. - An array of objects that represent the type arguments of a generic method or the type parameters of a generic method definition. Returns an empty array if the current method is not a generic method. - The current object is a . Generic constructors are not supported in the .NET Framework version 2.0. This exception is the default behavior if this method is not overridden in a derived class. - - - Returns the hash code for this instance. - A 32-bit signed integer hash code. - - - When overridden in a derived class, gets a object that provides access to the MSIL stream, local variables, and exceptions for the current method. - A object that provides access to the MSIL stream, local variables, and exceptions for the current method. - This method is invalid unless overridden in a derived class. - - - Gets method information by using the method's internal metadata representation (handle). - The method's handle. - A MethodBase containing information about the method. - handle is invalid. - - - Gets a object for the constructor or method represented by the specified handle, for the specified generic type. - A handle to the internal metadata representation of a constructor or method. - A handle to the generic type that defines the constructor or method. - A object representing the method or constructor specified by handle, in the generic type specified by declaringType. - handle is invalid. - - - When overridden in a derived class, returns the flags. - The MethodImplAttributes flags. - - - When overridden in a derived class, gets the parameters of the specified method or constructor. - An array of type ParameterInfo containing information that matches the signature of the method (or constructor) reflected by this MethodBase instance. - - - When overridden in a derived class, invokes the reflected method or constructor with the given parameters. - The object on which to invoke the method or constructor. If a method is static, this argument is ignored. If a constructor is static, this argument must be null or an instance of the class that defines the constructor. - A bitmask that is a combination of 0 or more bit flags from . If binder is null, this parameter is assigned the value ; thus, whatever you pass in is ignored. - An object that enables the binding, coercion of argument types, invocation of members, and retrieval of MemberInfo objects via reflection. If binder is null, the default binder is used. - An argument list for the invoked method or constructor. This is an array of objects with the same number, order, and type as the parameters of the method or constructor to be invoked. If there are no parameters, this should be null. If the method or constructor represented by this instance takes a ByRef parameter, there is no special attribute required for that parameter in order to invoke the method or constructor using this function. Any object in this array that is not explicitly initialized with a value will contain the default value for that object type. For reference-type elements, this value is null. For value-type elements, this value is 0, 0.0, or false, depending on the specific element type. - An instance of CultureInfo used to govern the coercion of types. If this is null, the CultureInfo for the current thread is used. (This is necessary to convert a String that represents 1000 to a Double value, for example, since 1000 is represented differently by different cultures.) - An Object containing the return value of the invoked method, or null in the case of a constructor, or null if the method's return type is void. Before calling the method or constructor, Invoke checks to see if the user has access permission and verifies that the parameters are valid. - The obj parameter is null and the method is not static. -or- The method is not declared or inherited by the class of obj. -or- A static constructor is invoked, and obj is neither null nor an instance of the class that declared the constructor. - The type of the parameters parameter does not match the signature of the method or constructor reflected by this instance. - The parameters array does not have the correct number of arguments. - The invoked method or constructor throws an exception. - The caller does not have permission to execute the method or constructor that is represented by the current instance. - The type that declares the method is an open generic type. That is, the property returns true for the declaring type. - - - Invokes the method or constructor represented by the current instance, using the specified parameters. - The object on which to invoke the method or constructor. If a method is static, this argument is ignored. If a constructor is static, this argument must be null or an instance of the class that defines the constructor. - An argument list for the invoked method or constructor. This is an array of objects with the same number, order, and type as the parameters of the method or constructor to be invoked. If there are no parameters, parameters should be null. If the method or constructor represented by this instance takes a ref parameter (ByRef in Visual Basic), no special attribute is required for that parameter in order to invoke the method or constructor using this function. Any object in this array that is not explicitly initialized with a value will contain the default value for that object type. For reference-type elements, this value is null. For value-type elements, this value is 0, 0.0, or false, depending on the specific element type. - An object containing the return value of the invoked method, or null in the case of a constructor. - - In the [.NET for Windows Store apps](http://go.microsoft.com/fwlink/?LinkID=247912) or the [Portable Class Library](~/docs/standard/cross-platform/cross-platform-development-with-the-portable-class-library.md), catch instead. - - The obj parameter is null and the method is not static. -or- The method is not declared or inherited by the class of obj. -or- A static constructor is invoked, and obj is neither null nor an instance of the class that declared the constructor. - The elements of the parameters array do not match the signature of the method or constructor reflected by this instance. - The invoked method or constructor throws an exception. -or- The current instance is a that contains unverifiable code. See the "Verification" section in Remarks for . - The parameters array does not have the correct number of arguments. - - In the [.NET for Windows Store apps](http://go.microsoft.com/fwlink/?LinkID=247912) or the [Portable Class Library](~/docs/standard/cross-platform/cross-platform-development-with-the-portable-class-library.md), catch the base class exception, , instead. - - The caller does not have permission to execute the method or constructor that is represented by the current instance. - The type that declares the method is an open generic type. That is, the property returns true for the declaring type. - The current instance is a . - - - Gets a value indicating whether the method is abstract. - true if the method is abstract; otherwise, false. - - - Gets a value indicating whether the potential visibility of this method or constructor is described by ; that is, the method or constructor is visible at most to other types in the same assembly, and is not visible to derived types outside the assembly. - true if the visibility of this method or constructor is exactly described by ; otherwise, false. - - - Gets a value indicating whether the method is a constructor. - true if this method is a constructor represented by a object (see note in Remarks about objects); otherwise, false. - - - Gets a value indicating whether the visibility of this method or constructor is described by ; that is, the method or constructor is visible only within its class and derived classes. - true if access to this method or constructor is exactly described by ; otherwise, false. - - - Gets a value indicating whether the visibility of this method or constructor is described by ; that is, the method or constructor can be called by derived classes, but only if they are in the same assembly. - true if access to this method or constructor is exactly described by ; otherwise, false. - - - Gets a value indicating whether the potential visibility of this method or constructor is described by ; that is, the method or constructor can be called by derived classes wherever they are, and by classes in the same assembly. - true if access to this method or constructor is exactly described by ; otherwise, false. - - - Gets a value indicating whether this method is final. - true if this method is final; otherwise, false. - - - Gets a value indicating whether the method is generic. - true if the current represents a generic method; otherwise, false. - - - Gets a value indicating whether the method is a generic method definition. - true if the current object represents the definition of a generic method; otherwise, false. - - - Gets a value indicating whether only a member of the same kind with exactly the same signature is hidden in the derived class. - true if the member is hidden by signature; otherwise, false. - - - Gets a value indicating whether this member is private. - true if access to this method is restricted to other members of the class itself; otherwise, false. - - - Gets a value indicating whether this is a public method. - true if this method is public; otherwise, false. - - - Gets a value that indicates whether the current method or constructor is security-critical or security-safe-critical at the current trust level, and therefore can perform critical operations. - true if the current method or constructor is security-critical or security-safe-critical at the current trust level; false if it is transparent. - - - Gets a value that indicates whether the current method or constructor is security-safe-critical at the current trust level; that is, whether it can perform critical operations and can be accessed by transparent code. - true if the method or constructor is security-safe-critical at the current trust level; false if it is security-critical or transparent. - - - Gets a value that indicates whether the current method or constructor is transparent at the current trust level, and therefore cannot perform critical operations. - true if the method or constructor is security-transparent at the current trust level; otherwise, false. - - - Gets a value indicating whether this method has a special name. - true if this method has a special name; otherwise, false. - - - Gets a value indicating whether the method is static. - true if this method is static; otherwise, false. - - - Gets a value indicating whether the method is virtual. - true if this method is virtual; otherwise, false. - - - Gets a handle to the internal metadata representation of a method. - A object. - - - Gets the flags that specify the attributes of a method implementation. - The method implementation flags. - - - Indicates whether two objects are equal. - The first object to compare. - The second object to compare. - true if left is equal to right; otherwise, false. - - - Indicates whether two objects are not equal. - The first object to compare. - The second object to compare. - true if left is not equal to right; otherwise, false. - - - Provides access to the metadata and MSIL for the body of a method. - - - Initializes a new instance of the class. - - - Gets a list that includes all the exception-handling clauses in the method body. - An of objects representing the exception-handling clauses in the body of the method. - - - Returns the MSIL for the method body, as an array of bytes. - An array of type that contains the MSIL for the method body. - - - Gets a value indicating whether local variables in the method body are initialized to the default values for their types. - true if the method body contains code to initialize local variables to null for reference types, or to the zero-initialized value for value types; otherwise, false. - - - Gets a metadata token for the signature that describes the local variables for the method in metadata. - An integer that represents the metadata token. - - - Gets the list of local variables declared in the method body. - An of objects that describe the local variables declared in the method body. - - - Gets the maximum number of items on the operand stack when the method is executing. - The maximum number of items on the operand stack when the method is executing. - - - Specifies flags for the attributes of a method implementation. - - - Specifies that the method should be inlined wherever possible. - - - - Specifies flags about code type. - - - - Specifies that the method is not defined. - - - - Specifies that the method implementation is in Microsoft intermediate language (MSIL). - - - - Specifies an internal call. - - - - Specifies that the method is implemented in managed code. - - - - Specifies whether the method is implemented in managed or unmanaged code. - - - - Specifies a range check value. - - - - Specifies that the method implementation is native. - - - - Specifies that the method cannot be inlined. - - - - Specifies that the method is not optimized by the just-in-time (JIT) compiler or by native code generation (see Ngen.exe) when debugging possible code generation problems. - - - - Specifies that the method implementation is in Optimized Intermediate Language (OPTIL). - - - - Specifies that the method signature is exported exactly as declared. - - - - Specifies that the method implementation is provided by the runtime. - - - - Specifies that the method is single-threaded through the body. Static methods (Shared in Visual Basic) lock on the type, whereas instance methods lock on the instance. You can also use the C# lock statement or the Visual Basic SyncLock statement for this purpose. - - - - Specifies that the method is implemented in unmanaged code. - - - - Discovers the attributes of a method and provides access to method metadata. - - - Initializes a new instance of the class. - - - Creates a delegate of the specified type from this method. - The type of the delegate to create. - The delegate for this method. - - - Creates a delegate of the specified type with the specified target from this method. - The type of the delegate to create. - The object targeted by the delegate. - The delegate for this method. - - - Returns a value that indicates whether this instance is equal to a specified object. - An object to compare with this instance, or null. - true if obj equals the type and value of this instance; otherwise, false. - - - When overridden in a derived class, returns the object for the method on the direct or indirect base class in which the method represented by this instance was first declared. - A object for the first implementation of this method. - - - Returns an array of objects that represent the type arguments of a generic method or the type parameters of a generic method definition. - An array of objects that represent the type arguments of a generic method or the type parameters of a generic method definition. Returns an empty array if the current method is not a generic method. - This method is not supported. - - - Returns a object that represents a generic method definition from which the current method can be constructed. - A object representing a generic method definition from which the current method can be constructed. - The current method is not a generic method. That is, returns false. - This method is not supported. - - - Returns the hash code for this instance. - A 32-bit signed integer hash code. - - - Substitutes the elements of an array of types for the type parameters of the current generic method definition, and returns a object representing the resulting constructed method. - An array of types to be substituted for the type parameters of the current generic method definition. - A object that represents the constructed method formed by substituting the elements of typeArguments for the type parameters of the current generic method definition. - The current does not represent a generic method definition. That is, returns false. - typeArguments is null. -or- Any element of typeArguments is null. - The number of elements in typeArguments is not the same as the number of type parameters of the current generic method definition. -or- An element of typeArguments does not satisfy the constraints specified for the corresponding type parameter of the current generic method definition. - This method is not supported. - - - Gets a value indicating that this member is a method. - A value indicating that this member is a method. - - - Indicates whether two objects are equal. - The first object to compare. - The second object to compare. - true if left is equal to right; otherwise, false. - - - Indicates whether two objects are not equal. - The first object to compare. - The second object to compare. - true if left is not equal to right; otherwise, false. - - - Gets a object that contains information about the return type of the method, such as whether the return type has custom modifiers. - A object that contains information about the return type. - This method is not implemented. - - - Gets the return type of this method. - The return type of this method. - - - Gets the custom attributes for the return type. - An ICustomAttributeProvider object representing the custom attributes for the return type. - - - Represents a missing . This class cannot be inherited. - - - Represents the sole instance of the class. - - - - Sets a object with the logical context information needed to recreate the sole instance of the object. - The object to be populated with serialization information. - The object representing the destination context of the serialization. - info is null. - - - Performs reflection on a module. - - - Initializes a new instance of the class. - - - Gets the appropriate for this instance of . - An Assembly object. - - - Gets a collection that contains this module's custom attributes. - A collection that contains this module's custom attributes. - - - Determines whether this module and the specified object are equal. - The object to compare with this instance. - true if o is equal to this instance; otherwise, false. - - - A TypeFilter object that filters the list of types defined in this module based upon the name. This field is case-sensitive and read-only. - - - - A TypeFilter object that filters the list of types defined in this module based upon the name. This field is case-insensitive and read-only. - - - - Returns an array of classes accepted by the given filter and filter criteria. - The delegate used to filter the classes. - An Object used to filter the classes. - An array of type Type containing classes that were accepted by the filter. - One or more classes in a module could not be loaded. - - - Gets a string representing the fully qualified name and path to this module. - The fully qualified module name. - The caller does not have the required permissions. - - - Returns all custom attributes. - This argument is ignored for objects of this type. - An array of type Object containing all custom attributes. - - - Gets custom attributes of the specified type. - The type of attribute to get. - This argument is ignored for objects of this type. - An array of type Object containing all custom attributes of the specified type. - attributeType is null. - attributeType is not a object supplied by the runtime. For example, attributeType is a object. - - - Returns a list of objects for the current module, which can be used in the reflection-only context. - A generic list of objects representing data about the attributes that have been applied to the current module. - - - Returns a field having the specified name. - The field name. - A FieldInfo object having the specified name, or null if the field does not exist. - The name parameter is null. - - - Returns a field having the specified name and binding attributes. - The field name. - One of the BindingFlags bit flags used to control the search. - A FieldInfo object having the specified name and binding attributes, or null if the field does not exist. - The name parameter is null. - - - Returns the global fields defined on the module that match the specified binding flags. - A bitwise combination of values that limit the search. - An array of type representing the global fields defined on the module that match the specified binding flags; if no global fields match the binding flags, an empty array is returned. - - - Returns the global fields defined on the module. - An array of objects representing the global fields defined on the module; if there are no global fields, an empty array is returned. - - - Returns the hash code for this instance. - A 32-bit signed integer hash code. - - - Returns a method having the specified name. - The method name. - A MethodInfo object having the specified name, or null if the method does not exist. - name is null. - - - Returns a method having the specified name and parameter types. - The method name. - The parameter types to search for. - A MethodInfo object in accordance with the specified criteria, or null if the method does not exist. - name is null, types is null, or types (i) is null. - - - Returns a method having the specified name, binding information, calling convention, and parameter types and modifiers. - The method name. - One of the BindingFlags bit flags used to control the search. - An object that implements Binder, containing properties related to this method. - The calling convention for the method. - The parameter types to search for. - An array of parameter modifiers used to make binding work with parameter signatures in which the types have been modified. - A MethodInfo object in accordance with the specified criteria, or null if the method does not exist. - name is null, types is null, or types (i) is null. - - - Returns the method implementation in accordance with the specified criteria. - The method name. - One of the BindingFlags bit flags used to control the search. - An object that implements Binder, containing properties related to this method. - The calling convention for the method. - The parameter types to search for. - An array of parameter modifiers used to make binding work with parameter signatures in which the types have been modified. - A MethodInfo object containing implementation information as specified, or null if the method does not exist. - types is null. - - - Returns the global methods defined on the module. - An array of objects representing all the global methods defined on the module; if there are no global methods, an empty array is returned. - - - Returns the global methods defined on the module that match the specified binding flags. - A bitwise combination of values that limit the search. - An array of type representing the global methods defined on the module that match the specified binding flags; if no global methods match the binding flags, an empty array is returned. - - - Provides an implementation for serialized objects. - The information and data needed to serialize or deserialize an object. - The context for the serialization. - info is null. - - - Gets a pair of values indicating the nature of the code in a module and the platform targeted by the module. - When this method returns, a combination of the values indicating the nature of the code in the module. - When this method returns, one of the values indicating the platform targeted by the module. - - - Returns the specified type, performing a case-sensitive search. - The name of the type to locate. The name must be fully qualified with the namespace. - A Type object representing the given type, if the type is in this module; otherwise, null. - className is null. - The class initializers are invoked and an exception is thrown. - className is a zero-length string. - className requires a dependent assembly that could not be found. - className requires a dependent assembly that was found but could not be loaded. -or- The current assembly was loaded into the reflection-only context, and className requires a dependent assembly that was not preloaded. - className requires a dependent assembly, but the file is not a valid assembly. -or- className requires a dependent assembly which was compiled for a version of the runtime later than the currently loaded version. - - - Returns the specified type, searching the module with the specified case sensitivity. - The name of the type to locate. The name must be fully qualified with the namespace. - true for case-insensitive search; otherwise, false. - A Type object representing the given type, if the type is in this module; otherwise, null. - className is null. - The class initializers are invoked and an exception is thrown. - className is a zero-length string. - className requires a dependent assembly that could not be found. - className requires a dependent assembly that was found but could not be loaded. -or- The current assembly was loaded into the reflection-only context, and className requires a dependent assembly that was not preloaded. - className requires a dependent assembly, but the file is not a valid assembly. -or- className requires a dependent assembly which was compiled for a version of the runtime later than the currently loaded version. - - - Returns the specified type, specifying whether to make a case-sensitive search of the module and whether to throw an exception if the type cannot be found. - The name of the type to locate. The name must be fully qualified with the namespace. - true to throw an exception if the type cannot be found; false to return null. - true for case-insensitive search; otherwise, false. - A object representing the specified type, if the type is declared in this module; otherwise, null. - className is null. - The class initializers are invoked and an exception is thrown. - className is a zero-length string. - throwOnError is true, and the type cannot be found. - className requires a dependent assembly that could not be found. - className requires a dependent assembly that was found but could not be loaded. -or- The current assembly was loaded into the reflection-only context, and className requires a dependent assembly that was not preloaded. - className requires a dependent assembly, but the file is not a valid assembly. -or- className requires a dependent assembly which was compiled for a version of the runtime later than the currently loaded version. - - - Returns all the types defined within this module. - An array of type Type containing types defined within the module that is reflected by this instance. - One or more classes in a module could not be loaded. - The caller does not have the required permission. - - - Returns a value that indicates whether the specified attribute type has been applied to this module. - The type of custom attribute to test for. - This argument is ignored for objects of this type. - true if one or more instances of attributeType have been applied to this module; otherwise, false. - attributeType is null. - attributeType is not a object supplied by the runtime. For example, attributeType is a object. - - - Gets a value indicating whether the object is a resource. - true if the object is a resource; otherwise, false. - - - Gets the metadata stream version. - A 32-bit integer representing the metadata stream version. The high-order two bytes represent the major version number, and the low-order two bytes represent the minor version number. - - - Gets a token that identifies the module in metadata. - An integer token that identifies the current module in metadata. - - - Gets a handle for the module. - A structure for the current module. - - - Gets a universally unique identifier (UUID) that can be used to distinguish between two versions of a module. - A that can be used to distinguish between two versions of a module. - - - Gets a String representing the name of the module with the path removed. - The module name with no path. - - - Indicates whether two objects are equal. - The first object to compare. - The second object to compare. - true if left is equal to right; otherwise, false. - - - Indicates whether two objects are not equal. - The first object to compare. - The second object to compare. - true if left is not equal to right; otherwise, false. - - - Returns the field identified by the specified metadata token. - A metadata token that identifies a field in the module. - A object representing the field that is identified by the specified metadata token. - metadataToken is not a token for a field in the scope of the current module. -or- metadataToken identifies a field whose parent TypeSpec has a signature containing element type var (a type parameter of a generic type) or mvar (a type parameter of a generic method). - metadataToken is not a valid token in the scope of the current module. - - - Returns the field identified by the specified metadata token, in the context defined by the specified generic type parameters. - A metadata token that identifies a field in the module. - An array of objects representing the generic type arguments of the type where the token is in scope, or null if that type is not generic. - An array of objects representing the generic type arguments of the method where the token is in scope, or null if that method is not generic. - A object representing the field that is identified by the specified metadata token. - metadataToken is not a token for a field in the scope of the current module. -or- metadataToken identifies a field whose parent TypeSpec has a signature containing element type var (a type parameter of a generic type) or mvar (a type parameter of a generic method), and the necessary generic type arguments were not supplied for either or both of genericTypeArguments and genericMethodArguments. - metadataToken is not a valid token in the scope of the current module. - - - Returns the type or member identified by the specified metadata token. - A metadata token that identifies a type or member in the module. - A object representing the type or member that is identified by the specified metadata token. - metadataToken is not a token for a type or member in the scope of the current module. -or- metadataToken is a MethodSpec or TypeSpec whose signature contains element type var (a type parameter of a generic type) or mvar (a type parameter of a generic method). -or- metadataToken identifies a property or event. - metadataToken is not a valid token in the scope of the current module. - - - Returns the type or member identified by the specified metadata token, in the context defined by the specified generic type parameters. - A metadata token that identifies a type or member in the module. - An array of objects representing the generic type arguments of the type where the token is in scope, or null if that type is not generic. - An array of objects representing the generic type arguments of the method where the token is in scope, or null if that method is not generic. - A object representing the type or member that is identified by the specified metadata token. - metadataToken is not a token for a type or member in the scope of the current module. -or- metadataToken is a MethodSpec or TypeSpec whose signature contains element type var (a type parameter of a generic type) or mvar (a type parameter of a generic method), and the necessary generic type arguments were not supplied for either or both of genericTypeArguments and genericMethodArguments. -or- metadataToken identifies a property or event. - metadataToken is not a valid token in the scope of the current module. - - - Returns the method or constructor identified by the specified metadata token, in the context defined by the specified generic type parameters. - A metadata token that identifies a method or constructor in the module. - An array of objects representing the generic type arguments of the type where the token is in scope, or null if that type is not generic. - An array of objects representing the generic type arguments of the method where the token is in scope, or null if that method is not generic. - A object representing the method that is identified by the specified metadata token. - metadataToken is not a token for a method or constructor in the scope of the current module. -or- metadataToken is a MethodSpec whose signature contains element type var (a type parameter of a generic type) or mvar (a type parameter of a generic method), and the necessary generic type arguments were not supplied for either or both of genericTypeArguments and genericMethodArguments. - metadataToken is not a valid token in the scope of the current module. - - - Returns the method or constructor identified by the specified metadata token. - A metadata token that identifies a method or constructor in the module. - A object representing the method or constructor that is identified by the specified metadata token. - metadataToken is not a token for a method or constructor in the scope of the current module. -or- metadataToken is a MethodSpec whose signature contains element type var (a type parameter of a generic type) or mvar (a type parameter of a generic method). - metadataToken is not a valid token in the scope of the current module. - - - Returns the signature blob identified by a metadata token. - A metadata token that identifies a signature in the module. - An array of bytes representing the signature blob. - metadataToken is not a valid MemberRef, MethodDef, TypeSpec, signature, or FieldDef token in the scope of the current module. - metadataToken is not a valid token in the scope of the current module. - - - Returns the string identified by the specified metadata token. - A metadata token that identifies a string in the string heap of the module. - A containing a string value from the metadata string heap. - metadataToken is not a token for a string in the scope of the current module. - metadataToken is not a valid token in the scope of the current module. - - - Returns the type identified by the specified metadata token. - A metadata token that identifies a type in the module. - A object representing the type that is identified by the specified metadata token. - metadataToken is not a token for a type in the scope of the current module. -or- metadataToken is a TypeSpec whose signature contains element type var (a type parameter of a generic type) or mvar (a type parameter of a generic method). - metadataToken is not a valid token in the scope of the current module. - - - Returns the type identified by the specified metadata token, in the context defined by the specified generic type parameters. - A metadata token that identifies a type in the module. - An array of objects representing the generic type arguments of the type where the token is in scope, or null if that type is not generic. - An array of objects representing the generic type arguments of the method where the token is in scope, or null if that method is not generic. - A object representing the type that is identified by the specified metadata token. - metadataToken is not a token for a type in the scope of the current module. -or- metadataToken is a TypeSpec whose signature contains element type var (a type parameter of a generic type) or mvar (a type parameter of a generic method), and the necessary generic type arguments were not supplied for either or both of genericTypeArguments and genericMethodArguments. - metadataToken is not a valid token in the scope of the current module. - - - Gets a string representing the name of the module. - The module name. - - - Returns the name of the module. - A String representing the name of this module. - - - Represents the method that will handle the event of an . - The assembly that was the source of the event. - The arguments supplied by the object describing the event. - - - - Instructs obfuscation tools to use their standard obfuscation rules for the appropriate assembly type. - - - Initializes a new instance of the class, specifying whether the assembly to be obfuscated is public or private. - true if the assembly is used within the scope of one application; otherwise, false. - - - Gets a value indicating whether the assembly was marked private. - true if the assembly was marked private; otherwise, false. - - - Gets or sets a value indicating whether the obfuscation tool should remove the attribute after processing. - true if the obfuscation tool should remove the attribute after processing; otherwise, false. The default value for this property is true. - - - Instructs obfuscation tools to take the specified actions for an assembly, type, or member. - - - Initializes a new instance of the class. - - - Gets or sets a value indicating whether the attribute of a type is to apply to the members of the type. - true if the attribute is to apply to the members of the type; otherwise, false. The default is true. - - - Gets or sets a value indicating whether the obfuscation tool should exclude the type or member from obfuscation. - true if the type or member to which this attribute is applied should be excluded from obfuscation; otherwise, false. The default is true. - - - Gets or sets a string value that is recognized by the obfuscation tool, and which specifies processing options. - A string value that is recognized by the obfuscation tool, and which specifies processing options. The default is "all". - - - Gets or sets a value indicating whether the obfuscation tool should remove this attribute after processing. - true if an obfuscation tool should remove the attribute after processing; otherwise, false. The default is true. - - - Defines the attributes that can be associated with a parameter. These are defined in CorHdr.h. - - - Specifies that the parameter has a default value. - - - - Specifies that the parameter has field marshaling information. - - - - Specifies that the parameter is an input parameter. - - - - Specifies that the parameter is a locale identifier (lcid). - - - - Specifies that there is no parameter attribute. - - - - Specifies that the parameter is optional. - - - - Specifies that the parameter is an output parameter. - - - - Reserved. - - - - Reserved. - - - - Specifies that the parameter is reserved. - - - - Specifies that the parameter is a return value. - - - - Discovers the attributes of a parameter and provides access to parameter metadata. - - - Initializes a new instance of the ParameterInfo class. - - - Gets the attributes for this parameter. - A ParameterAttributes object representing the attributes for this parameter. - - - The attributes of the parameter. - - - - The Type of the parameter. - - - - Gets a collection that contains this parameter's custom attributes. - A collection that contains this parameter's custom attributes. - - - Gets a value indicating the default value if the parameter has a default value. - The default value of the parameter, or if the parameter has no default value. - - - The default value of the parameter. - - - - Gets the custom attributes of the specified type or its derived types that are applied to this parameter. - The custom attributes identified by type. - This argument is ignored for objects of this type. - An array that contains the custom attributes of the specified type or its derived types. - The type must be a type provided by the underlying runtime system. - attributeType is null. - A custom attribute type could not be loaded. - - - Gets all the custom attributes defined on this parameter. - This argument is ignored for objects of this type. - An array that contains all the custom attributes applied to this parameter. - A custom attribute type could not be loaded. - - - Returns a list of objects for the current parameter, which can be used in the reflection-only context. - A generic list of objects representing data about the attributes that have been applied to the current parameter. - - - Gets the optional custom modifiers of the parameter. - An array of objects that identify the optional custom modifiers of the current parameter, such as or . - - - Returns the real object that should be deserialized instead of the object that the serialized stream specifies. - The serialized stream from which the current object is deserialized. - The actual object that is put into the graph. - The parameter's position in the parameter list of its associated member is not valid for that member's type. - - - Gets the required custom modifiers of the parameter. - An array of objects that identify the required custom modifiers of the current parameter, such as or . - - - Gets a value that indicates whether this parameter has a default value. - true if this parameter has a default value; otherwise, false. - - - Determines whether the custom attribute of the specified type or its derived types is applied to this parameter. - The Type object to search for. - This argument is ignored for objects of this type. - true if one or more instances of attributeType or its derived types are applied to this parameter; otherwise, false. - attributeType is null. - attributeType is not a object supplied by the common language runtime. - - - Gets a value indicating whether this is an input parameter. - true if the parameter is an input parameter; otherwise, false. - - - Gets a value indicating whether this parameter is a locale identifier (lcid). - true if the parameter is a locale identifier; otherwise, false. - - - Gets a value indicating whether this parameter is optional. - true if the parameter is optional; otherwise, false. - - - Gets a value indicating whether this is an output parameter. - true if the parameter is an output parameter; otherwise, false. - - - Gets a value indicating whether this is a Retval parameter. - true if the parameter is a Retval; otherwise, false. - - - Gets a value indicating the member in which the parameter is implemented. - The member which implanted the parameter represented by this . - - - The member in which the field is implemented. - - - - Gets a value that identifies this parameter in metadata. - A value which, in combination with the module, uniquely identifies this parameter in metadata. - - - Gets the name of the parameter. - The simple name of this parameter. - - - The name of the parameter. - - - - Gets the Type of this parameter. - The Type object that represents the Type of this parameter. - - - Gets the zero-based position of the parameter in the formal parameter list. - An integer representing the position this parameter occupies in the parameter list. - - - The zero-based position of the parameter in the parameter list. - - - - Gets a value indicating the default value if the parameter has a default value. - The default value of the parameter, or if the parameter has no default value. - - - Gets the parameter type and name represented as a string. - A string containing the type and the name of the parameter. - - - Attaches a modifier to parameters so that binding can work with parameter signatures in which the types have been modified. - - - Initializes a new instance of the structure representing the specified number of parameters. - The number of parameters. - parameterCount is negative. - - - Gets or sets a value that specifies whether the parameter at the specified index position is to be modified by the current . - The index position of the parameter whose modification status is being examined or set. - true if the parameter at this index position is to be modified by this ; otherwise, false. - - - Provides a wrapper class for pointers. - - - Boxes the supplied unmanaged memory pointer and the type associated with that pointer into a managed wrapper object. The value and the type are saved so they can be accessed from the native code during an invocation. - The supplied unmanaged memory pointer. - The type associated with the ptr parameter. - A pointer object. - type is not a pointer. - type is null. - - - Returns the stored pointer. - The stored pointer. - This method returns void. - ptr is not a pointer. - - - Sets the object with the file name, fusion log, and additional exception information. - The that holds the serialized object data about the exception being thrown. - The that contains contextual information about the source or destination. - - - Marshals data of type VT_VARIANT | VT_BYREF from managed to unmanaged code. This class cannot be inherited. - - - Initializes a new instance of the class for the specified parameter. - The object to marshal. - - - Gets the object wrapped by the object. - The object wrapped by the object. - - - Checks for sufficient memory resources before executing an operation. This class cannot be inherited. - - - Initializes a new instance of the class, specifying the amount of memory required for successful execution. - The required memory size, in megabytes. This must be a positive value. - The specified memory size is negative. - There is insufficient memory to begin execution of the code protected by the gate. - - - Releases all resources used by the . - - - Computes masks according to PKCS #1 for use by key exchange algorithms. - - - Initializes a new instance of the class. - - - Generates and returns a mask from the specified random seed of the specified length. - The random seed to use for computing the mask. - The length of the generated mask in bytes. - A randomly generated mask whose length is equal to the cbReturn parameter. - - - Gets or sets the name of the hash algorithm type to use for generating the mask. - The name of the type that implements the hash algorithm to use for computing the mask. - - - Represents the abstract class from which all implementations of cryptographic random number generators derive. - - - Initializes a new instance of . - - - Creates an instance of the default implementation of a cryptographic random number generator that can be used to generate random data. - A new instance of a cryptographic random number generator. - - - Creates an instance of the specified implementation of a cryptographic random number generator. - The name of the random number generator implementation to use. - A new instance of a cryptographic random number generator. - - - When overridden in a derived class, releases all resources used by the current instance of the class. - - - When overridden in a derived class, releases the unmanaged resources used by the and optionally releases the managed resources. - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - When overridden in a derived class, fills an array of bytes with a cryptographically strong random sequence of values. - The array to fill with cryptographically strong random bytes. - - - Fills the specified byte array with a cryptographically strong random sequence of values. - The array to fill with cryptographically strong random bytes. - The index of the array to start the fill operation. - The number of bytes to fill. - data is null. - offset or count is less than 0 - offset plus count exceeds the length of data. - - - When overridden in a derived class, fills an array of bytes with a cryptographically strong random sequence of nonzero values. - The array to fill with cryptographically strong random nonzero bytes. - - - Represents the base class from which all implementations of the algorithm must derive. - - - Initializes a new instance of . - - - Creates an instance of a cryptographic object to perform the algorithm. - An instance of a cryptographic object. - The algorithm was used with Federal Information Processing Standards (FIPS) mode enabled, but is not FIPS compatible. - - - Creates an instance of a cryptographic object to perform the specified implementation of the algorithm. - The name of the specific implementation of to use. - An instance of a cryptographic object. - The algorithm described by the algName parameter was used with Federal Information Processing Standards (FIPS) mode enabled, but is not FIPS compatible. - - - Gets or sets the effective size of the secret key used by the algorithm in bits. - The effective key size used by the algorithm. - The effective key size is invalid. - - - Represents the effective size of the secret key used by the algorithm in bits. - - - - Gets or sets the size of the secret key used by the algorithm in bits. - The size of the secret key used by the algorithm. - The value for the RC2 key size is less than the effective key size value. - - - Defines a wrapper object to access the cryptographic service provider (CSP) implementation of the algorithm. This class cannot be inherited. - - - Initializes a new instance of the class. - The cryptographic service provider (CSP) cannot be acquired. - A non-compliant FIPS algorithm was found. - - - Creates a symmetric decryptor object with the specified key ()and initialization vector (). - The secret key to use for the symmetric algorithm. - The initialization vector to use for the symmetric algorithm. - A symmetric decryptor object. - An cipher mode was used. -or- A cipher mode with a feedback size other than 8 bits was used. -or- An invalid key size was used. -or- The algorithm key size was not available. - - - Creates a symmetric encryptor object with the specified key () and initialization vector (). - The secret key to use for the symmetric algorithm. - The initialization vector to use for the symmetric algorithm. - A symmetric encryptor object. - An cipher mode was used. -or- A cipher mode with a feedback size other than 8 bits was used. -or- An invalid key size was used. -or- The algorithm key size was not available. - - - Gets or sets the effective size, in bits, of the secret key used by the algorithm. - The effective key size, in bits, used by the algorithm. - The property was set to a value other than the property. - - - Generates a random initialization vector () to use for the algorithm. - - - Generates a random key () to be used for the algorithm. - - - Gets or sets a value that determines whether to create a key with an 11-byte-long, zero-value salt. - true if the key should be created with an 11-byte-long, zero-value salt; otherwise, false. The default is false. - - - Implements password-based key derivation functionality, PBKDF2, by using a pseudo-random number generator based on . - - - Initializes a new instance of the class using a password and salt to derive the key. - The password used to derive the key. - The key salt used to derive the key. - The specified salt size is smaller than 8 bytes or the iteration count is less than 1. - The password or salt is null. - - - Initializes a new instance of the class using the password and salt size to derive the key. - The password used to derive the key. - The size of the random salt that you want the class to generate. - The specified salt size is smaller than 8 bytes. - The password or salt is null. - - - Initializes a new instance of the class using a password, a salt, and number of iterations to derive the key. - The password used to derive the key. - The key salt used to derive the key. - The number of iterations for the operation. - The specified salt size is smaller than 8 bytes or the iteration count is less than 1. - The password or salt is null. - - - Initializes a new instance of the class using a password, a salt, and number of iterations to derive the key. - The password used to derive the key. - The key salt used to derive the key. - The number of iterations for the operation. - The specified salt size is smaller than 8 bytes or the iteration count is less than 1. - The password or salt is null. - - - Initializes a new instance of the class using a password, a salt size, and number of iterations to derive the key. - The password used to derive the key. - The size of the random salt that you want the class to generate. - The number of iterations for the operation. - The specified salt size is smaller than 8 bytes or the iteration count is less than 1. - The password or salt is null. - iterations is out of range. This parameter requires a non-negative number. - - - Derives a cryptographic key from the object. - The algorithm name for which to derive the key. - The hash algorithm name to use to derive the key. - The size of the key, in bits, to derive. - The initialization vector (IV) to use to derive the key. - The derived key. - The keySize parameter is incorrect. -or- The cryptographic service provider (CSP) cannot be acquired. -or- The algname parameter is not a valid algorithm name. -or- The alghashname parameter is not a valid hash algorithm name. - - - Releases the unmanaged resources used by the class and optionally releases the managed resources. - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - Returns the pseudo-random key for this object. - The number of pseudo-random key bytes to generate. - A byte array filled with pseudo-random key bytes. - cb is out of range. This parameter requires a non-negative number. - - - Gets or sets the number of iterations for the operation. - The number of iterations for the operation. - The number of iterations is less than 1. - - - Resets the state of the operation. - - - Gets or sets the key salt value for the operation. - The key salt value for the operation. - The specified salt size is smaller than 8 bytes. - The salt is null. - - - Represents the base class from which all implementations of the symmetric encryption algorithm must inherit. - - - Initializes a new instance of . - - - Creates a cryptographic object to perform the algorithm. - A cryptographic object. - The algorithm was used with Federal Information Processing Standards (FIPS) mode enabled, but is not FIPS compatible. - - - Creates a cryptographic object to perform the specified implementation of the algorithm. - The name of the specific implementation of to create. - A cryptographic object. - The algorithm described by the algName parameter was used with Federal Information Processing Standards (FIPS) mode enabled, but is not FIPS compatible. - - - Accesses the managed version of the algorithm. This class cannot be inherited. - - - Initializes a new instance of the class. - This class is not compliant with the FIPS algorithm. - - - Creates a symmetric decryptor object with the specified and initialization vector (). - The secret key to be used for the symmetric algorithm. The key size must be 128, 192, or 256 bits. - The IV to be used for the symmetric algorithm. - A symmetric decryptor object. - The rgbKey parameter is null. -or- The rgbIV parameter is null. - The value of the property is not , , or . - - - Creates a symmetric encryptor object with the specified and initialization vector (). - The secret key to be used for the symmetric algorithm. The key size must be 128, 192, or 256 bits. - The IV to be used for the symmetric algorithm. - A symmetric encryptor object. - The rgbKey parameter is null. -or- The rgbIV parameter is null. - The value of the property is not , , or . - - - Generates a random initialization vector () to be used for the algorithm. - - - Generates a random to be used for the algorithm. - - - Implements a cryptographic Random Number Generator (RNG) using the implementation provided by the cryptographic service provider (CSP). This class cannot be inherited. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. - A byte array. This value is ignored. - - - Initializes a new instance of the class with the specified parameters. - The parameters to pass to the cryptographic service provider (CSP). - - - Initializes a new instance of the class. - The string input. This parameter is ignored. - - - Fills an array of bytes with a cryptographically strong sequence of random values. - The array to fill with a cryptographically strong sequence of random values. - The cryptographic service provider (CSP) cannot be acquired. - data is null. - - - Fills an array of bytes with a cryptographically strong sequence of random nonzero values. - The array to fill with a cryptographically strong sequence of random nonzero values. - The cryptographic service provider (CSP) cannot be acquired. - data is null. - - - Represents the base class from which all implementations of the algorithm inherit. - - - Initializes a new instance of the class. - - - Creates an instance of the default implementation of the algorithm. - A new instance of the default implementation of . - - - Creates an instance of the specified implementation of . - The name of the implementation of to use. - A new instance of the specified implementation of . - - - When overridden in a derived class, decrypts the input data using the specified padding mode. - The data to decrypt. - The padding mode. - The decrypted data. - A derived class must override this method. - - - When overridden in a derived class, decrypts the input data using the private key. - The cipher text to be decrypted. - The resulting decryption of the rgb parameter in plain text. - This method call is not supported. This exception is thrown starting with the .NET Framework 4.6. - - - When overridden in a derived class, encrypts the input data using the specified padding mode. - The data to encrypt. - The padding mode. - The encrypted data. - A derived class must override this method. - - - When overridden in a derived class, encrypts the input data using the public key. - The plain text to be encrypted. - The resulting encryption of the rgb parameter as cipher text. - This method call is not supported. This exception is thrown starting with the .NET Framework 4.6. - - - When overridden in a derived class, exports the . - true to include private parameters; otherwise, false. - The parameters for . - - - Initializes an object from the key information from an XML string. - The XML string containing key information. - The xmlString parameter is null. - The format of the xmlString parameter is not valid. - - - When overridden in a derived class, computes the hash value of a specified portion of a byte array by using a specified hashing algorithm. - The data to be hashed. - The index of the first byte in data that is to be hashed. - The number of bytes to hash. - The algorithm to use in hash the data. - The hashed data. - A derived class must override this method. - - - When overridden in a derived class, computes the hash value of a specified binary stream by using a specified hashing algorithm. - The binary stream to hash. - The hash algorithm. - The hashed data. - A derived class must override this method. - - - When overridden in a derived class, imports the specified . - The parameters for . - - - Gets the name of the key exchange algorithm available with this implementation of . - Returns "RSA". - - - Gets the name of the signature algorithm available with this implementation of . - Returns "RSA". - - - Computes the hash value of the specified byte array using the specified hash algorithm and padding mode, and signs the resulting hash value. - The input data for which to compute the hash. - The hash algorithm to use to create the hash value. - The padding mode. - The RSA signature for the specified data. - data is null. -or- padding is null. - hashAlgorithm. is null or . - - - Computes the hash value of the specified stream using the specified hash algorithm and padding mode, and signs the resulting hash value. - The input stream for which to compute the hash. - The hash algorithm to use to create the hash value. - The padding mode. - The RSA signature for the specified data. - data is null. -or- padding is null. - hashAlgorithm. is null or . - - - Computes the hash value of a portion of the specified byte array using the specified hash algorithm and padding mode, and signs the resulting hash value. - The input data for which to compute the hash. - The offset into the array at which to begin using data. - The number of bytes in the array to use as data. - The hash algorithm to use to create the hash value. - The padding mode. - The RSA signature for the specified data. - data is null. -or- padding is null. - hashAlgorithm. is null or . - offset is less than zero. -or- count is less than zero. -or- offset + count – 1 results in an index that is beyond the upper bound of data. - - - When overridden in a derived class, computes the signature for the specified hash value by encrypting it with the private key using the specified padding. - The hash value of the data to be signed. - The hash algorithm used to create the hash value of the data. - The padding. - The RSA signature for the specified hash value. - A derived class must override this method. - - - Creates and returns an XML string containing the key of the current object. - true to include a public and private RSA key; false to include only the public key. - An XML string containing the key of the current object. - - - Verifies that a digital signature is valid by calculating the hash value of the data in a portion of a byte array using the specified hash algorithm and padding, and comparing it to the provided signature. - The signed data. - The starting index at which to compute the hash. - The number of bytes to hash. - The signature data to be verified. - The hash algorithm used to create the hash value of the data. - The padding mode. - true if the signature is valid; otherwise, false. - data is null. -or- signature is null. -or- padding is null. - hashAlgorithm. is null or . - offset is less than zero. -or- count is less than zero. -or- offset + count – 1 results in an index that is beyond the upper bound of data. - - - Verifies that a digital signature is valid by calculating the hash value of the specified data using the specified hash algorithm and padding, and comparing it to the provided signature. - The signed data. - The signature data to be verified. - The hash algorithm used to create the hash value of the data. - The padding mode. - true if the signature is valid; otherwise, false. - data is null. -or- signature is null. -or- padding is null. - hashAlgorithm. is null or . - - - Verifies that a digital signature is valid by calculating the hash value of the specified stream using the specified hash algorithm and padding, and comparing it to the provided signature. - The signed data. - The signature data to be verified. - The hash algorithm used to create the hash value of the data. - The padding mode. - true if the signature is valid; otherwise, false. - data is null. -or- signature is null. -or- padding is null. - hashAlgorithm. is null or . - - - Verifies that a digital signature is valid by determining the hash value in the signature using the specified hash algorithm and padding, and comparing it to the provided hash value. - The hash value of the signed data. - The signature data to be verified. - The hash algorithm used to create the hash value. - The padding mode. - true if the signature is valid; otherwise, false. - A derived class must override this method. - - - Performs asymmetric encryption and decryption using the implementation of the algorithm provided by the cryptographic service provider (CSP). This class cannot be inherited. - - - Initializes a new instance of the class using the default key. - The cryptographic service provider (CSP) cannot be acquired. - - - Initializes a new instance of the class with the specified key size. - The size of the key to use in bits. - The cryptographic service provider (CSP) cannot be acquired. - - - Initializes a new instance of the class with the specified parameters. - The parameters to be passed to the cryptographic service provider (CSP). - The CSP cannot be acquired. - - - Initializes a new instance of the class with the specified key size and parameters. - The size of the key to use in bits. - The parameters to be passed to the cryptographic service provider (CSP). - The CSP cannot be acquired. -or- The key cannot be created. - - - Gets a object that describes additional information about a cryptographic key pair. - A object that describes additional information about a cryptographic key pair. - - - Decrypts data with the algorithm. - The data to be decrypted. - true to perform direct decryption using OAEP padding (only available on a computer running Microsoft Windows XP or later); otherwise, false to use PKCS#1 v1.5 padding. - The decrypted data, which is the original plain text before encryption. - The cryptographic service provider (CSP) cannot be acquired. -or- The fOAEP parameter is true and the length of the rgb parameter is greater than . -or- The fOAEP parameter is true and OAEP is not supported. -or- The key does not match the encrypted data. However, the exception wording may not be accurate. For example, it may say Not enough storage is available to process this command. - rgb is null. - - - Decrypts data that was previously encrypted with the algorithm by using the specified padding. - The data to decrypt. - The padding. - The decrypted data. - data is null. -or- padding is null. - The padding mode is not supported. - - - This method is not supported in the current version. - The data to be decrypted. - The decrypted data, which is the original plain text before encryption. - This method is not supported in the current version. - - - Encrypts data with the algorithm. - The data to be encrypted. - true to perform direct encryption using OAEP padding (only available on a computer running Windows XP or later); otherwise, false to use PKCS#1 v1.5 padding. - The encrypted data. - The cryptographic service provider (CSP) cannot be acquired. -or- The length of the rgb parameter is greater than the maximum allowed length. -or- The fOAEP parameter is true and OAEP padding is not supported. - rgb is null. - - - Encrypts data with the algorithm using the specified padding. - The data to encrypt. - The padding. - The encrypted data. - data is null. -or- padding is null. - The padding mode is not supported. - - - This method is not supported in the current version. - The data to be encrypted. - The encrypted data. - This method is not supported in the current version. - - - Exports a blob containing the key information associated with an object. - true to include the private key; otherwise, false. - A byte array containing the key information associated with an object. - - - Exports the . - true to include private parameters; otherwise, false. - The parameters for . - The key cannot be exported. - - - Imports a blob that represents RSA key information. - A byte array that represents an RSA key blob. - - - Imports the specified . - The parameters for . - The cryptographic service provider (CSP) cannot be acquired. -or- The parameters parameter has missing fields. - - - Gets the name of the key exchange algorithm available with this implementation of . - The name of the key exchange algorithm if it exists; otherwise, null. - - - Gets the size of the current key. - The size of the key in bits. - - - Gets or sets a value indicating whether the key should be persisted in the cryptographic service provider (CSP). - true if the key should be persisted in the CSP; otherwise, false. - - - Gets a value that indicates whether the object contains only a public key. - true if the object contains only a public key; otherwise, false. - - - Gets the name of the signature algorithm available with this implementation of . - The name of the signature algorithm. - - - Computes the hash value of the specified byte array using the specified hash algorithm, and signs the resulting hash value. - The input data for which to compute the hash. - The hash algorithm to use to create the hash value. - The signature for the specified data. - The halg parameter is null. - The halg parameter is not a valid type. - - - Computes the hash value of the specified input stream using the specified hash algorithm, and signs the resulting hash value. - The input data for which to compute the hash. - The hash algorithm to use to create the hash value. - The signature for the specified data. - The halg parameter is null. - The halg parameter is not a valid type. - - - Computes the hash value of a subset of the specified byte array using the specified hash algorithm, and signs the resulting hash value. - The input data for which to compute the hash. - The offset into the array from which to begin using data. - The number of bytes in the array to use as data. - The hash algorithm to use to create the hash value. - The signature for the specified data. - The halg parameter is null. - The halg parameter is not a valid type. - - - Computes the signature for the specified hash value by encrypting it with the private key. - The hash value of the data to be signed. - The hash algorithm identifier (OID) used to create the hash value of the data. - The signature for the specified hash value. - The rgbHash parameter is null. - The cryptographic service provider (CSP) cannot be acquired. -or- There is no private key. - - - Computes the signature for the specified hash value by encrypting it with the private key using the specified padding. - The hash value of the data to be signed. - The hash algorithm name used to create the hash value of the data. - The padding. - The signature for the specified hash value. - hashAlgorithm is null or . - hash is null. -or- padding is null. - padding does not equal . - - - Gets or sets a value indicating whether the key should be persisted in the computer's key store instead of the user profile store. - true if the key should be persisted in the computer key store; otherwise, false. - - - Verifies that a digital signature is valid by determining the hash value in the signature using the provided public key and comparing it to the hash value of the provided data. - The data that was signed. - The name of the hash algorithm used to create the hash value of the data. - The signature data to be verified. - true if the signature is valid; otherwise, false. - The halg parameter is null. - The halg parameter is not a valid type. - - - Verifies that a digital signature is valid by determining the hash value in the signature using the provided public key and comparing it to the provided hash value. - The hash value of the signed data. - The hash algorithm identifier (OID) used to create the hash value of the data. - The signature data to be verified. - true if the signature is valid; otherwise, false. - The rgbHash parameter is null. -or- The rgbSignature parameter is null. - The cryptographic service provider (CSP) cannot be acquired. -or- The signature cannot be verified. - - - Verifies that a digital signature is valid by determining the hash value in the signature using the specified hashing algorithm and padding, and comparing it to the provided hash value. - The hash value of the signed data. - The signature data to be verified. - The hash algorithm name used to create the hash value. - The padding. - true if the signature is valid; otherwise, false. - hashAlgorithm is null or . - hash is null. -or- padding is null. - padding does not equal . - - - Specifies the padding mode and parameters to use with RSA encryption or decryption operations. - - - Creates a new instance whose is with the given hash algorithm. - The hash algorithm. - An object whose mode is is with the hash algorithm specified by hashAlgorithm. . - The property of hashAlgorithm is either null or . - - - Determines whether the current instance is equal to the specified object. - The object to compare. - true if obj is equal to the current instance; otherwise, false. - - - Determines whether the current instance is equal to the specified object. - The object to compare. - true if other is equal to the current instance; otherwise, false. - - - Returns the hash code of this object. - The hash code of this instance. - - - Gets the padding mode represented by this instance. - A padding mode. - - - Gets the hash algorithm used in conjunction with the padding mode. If the value of the property is not , is null. - The hash algorithm. - - - Gets an object that represents the Optimal Asymmetric Encryption Padding (OAEP) encryption standard with a SHA1 hash algorithm. - An object that represents the OAEP encryption standard with a SHA1 hash algorithm. - - - Gets an object that represents the Optimal Asymmetric Encryption Padding (OAEP) encryption standard with a SHA256 hash algorithm. - An object that represents the OAEP encryption standard with a SHA256 hash algorithm. - - - Gets an object that represents the Optimal Asymmetric Encryption Padding (OAEP) encryption standard with a SHA-384 hash algorithm. - An object that represents the OAEP encryption standard with a SHA384 hash algorithm. - - - Gets an object that represents the Optimal Asymmetric Encryption Padding (OAEP) encryption standard with a SHA512 hash algorithm. - An object that represents the OAEP encryption standard with a SHA512 hash algorithm. - - - Indicates whether two specified objects are equal. - The first object to compare. - The second object to compare. - true if left and right are equal; otherwise, false. - - - Indicates whether two specified objects are unequal. - The first object to compare. - The second object to compare. - true if left and right are not equal; otherwise, false. - - - Gets an object that represents the PKCS #1 encryption standard. - An object that represents the PKCS #1 encryption standard. - - - Returns the string representation of the current instance. - The string representation of the current object. - - - Specifies the padding mode to use with RSA encryption or decryption operations. - - - Optimal Asymmetric Encryption Padding. - - - - PKCS #1 v1.5. - - - - Decrypts Optimal Asymmetric Encryption Padding (OAEP) key exchange data. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with the specified key. - The instance of the algorithm that holds the private key. - key is null. - - - Extracts secret information from the encrypted key exchange data. - The key exchange data within which the secret information is hidden. - The secret information derived from the key exchange data. - The key exchange data verification has failed. - The key is missing. - - - Gets the parameters for the Optimal Asymmetric Encryption Padding (OAEP) key exchange. - An XML string containing the parameters of the OAEP key exchange operation. - - - Sets the private key to use for decrypting the secret information. - The instance of the algorithm that holds the private key. - key is null. - - - Creates Optimal Asymmetric Encryption Padding (OAEP) key exchange data using . - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with the specified key. - The instance of the algorithm that holds the public key. - key is null. - - - Creates the encrypted key exchange data from the specified input data. - The secret information to be passed in the key exchange. - The encrypted key exchange data to be sent to the intended recipient. - The key is missing. - - - Creates the encrypted key exchange data from the specified input data. - The secret information to be passed in the key exchange. - This parameter is not used in the current version. - The encrypted key exchange data to be sent to the intended recipient. - - - Gets or sets the parameter used to create padding in the key exchange creation process. - The parameter value. - - - Gets the parameters for the Optimal Asymmetric Encryption Padding (OAEP) key exchange. - An XML string containing the parameters of the OAEP key exchange operation. - - - Gets or sets the random number generator algorithm to use in the creation of the key exchange. - The instance of a random number generator algorithm to use. - - - Sets the public key to use for encrypting the key exchange data. - The instance of the algorithm that holds the public key. - key is null. - - - Represents the standard parameters for the algorithm. - - - Represents the D parameter for the algorithm. - - - - Represents the DP parameter for the algorithm. - - - - Represents the DQ parameter for the algorithm. - - - - Represents the Exponent parameter for the algorithm. - - - - Represents the InverseQ parameter for the algorithm. - - - - Represents the Modulus parameter for the algorithm. - - - - Represents the P parameter for the algorithm. - - - - Represents the Q parameter for the algorithm. - - - - Decrypts the PKCS #1 key exchange data. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with the specified key. - The instance of the algorithm that holds the private key. - key is null. - - - Extracts secret information from the encrypted key exchange data. - The key exchange data within which the secret information is hidden. - The secret information derived from the key exchange data. - The key is missing. - - - Gets the parameters for the PKCS #1 key exchange. - An XML string containing the parameters of the PKCS #1 key exchange operation. - - - Gets or sets the random number generator algorithm to use in the creation of the key exchange. - The instance of a random number generator algorithm to use. - - - Sets the private key to use for decrypting the secret information. - The instance of the algorithm that holds the private key. - key is null. - - - Creates the PKCS#1 key exchange data using . - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with the specified key. - The instance of the algorithm that holds the public key. - key is null. - - - Creates the encrypted key exchange data from the specified input data. - The secret information to be passed in the key exchange. - The encrypted key exchange data to be sent to the intended recipient. - rgbData is too big. - The key is null. - - - Creates the encrypted key exchange data from the specified input data. - The secret information to be passed in the key exchange. - This parameter is not used in the current version. - The encrypted key exchange data to be sent to the intended recipient. - - - Gets the parameters for the PKCS #1 key exchange. - An XML string containing the parameters of the PKCS #1 key exchange operation. - - - Gets or sets the random number generator algorithm to use in the creation of the key exchange. - The instance of a random number generator algorithm to use. - - - Sets the public key to use for encrypting the key exchange data. - The instance of the algorithm that holds the public key. - key is null. - - - Verifies an PKCS #1 version 1.5 signature. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with the specified key. - The instance of that holds the public key. - key is null. - - - Sets the hash algorithm to use for verifying the signature. - The name of the hash algorithm to use for verifying the signature. - - - Sets the public key to use for verifying the signature. - The instance of that holds the public key. - key is null. - - - Verifies the PKCS#1 signature for the specified data. - The data signed with rgbSignature. - The signature to be verified for rgbHash. - true if rgbSignature matches the signature computed using the specified hash algorithm and key on rgbHash; otherwise, false. - The key is null. -or- The hash algorithm is null. - The rgbHash parameter is null. -or- The rgbSignature parameter is null. - - - Creates an PKCS #1 version 1.5 signature. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with the specified key. - The instance of the algorithm that holds the private key. - key is null. - - - Creates the PKCS #1 signature for the specified data. - The data to be signed. - The digital signature for rgbHash. - The key is null. -or- The hash algorithm is null. - The rgbHash parameter is null. - - - Sets the hash algorithm to use for creating the signature. - The name of the hash algorithm to use for creating the signature. - - - Sets the private key to use for creating the signature. - The instance of the algorithm that holds the private key. - key is null. - - - Specifies the padding mode and parameters to use with RSA signature creation or verification operations. - - - Returns a value that indicates whether this instance is equal to a specified object. - The object to compare with the current instance. - true if the specified object is equal to the current object; otherwise, false. - - - Returns a value that indicates whether this instance is equal to a specified object. - The object to compare with the current instance. - true if the specified object is equal to the current object; otherwise, false. - - - Returns the hash code for this instance. - The hash code for this instance. - - - Gets the padding mode of this instance. - The padding mode (either or ) of this instance. - - - Indicates whether two specified objects are equal. - The first object to compare. - The second object to compare. - true if left and right are equal; otherwise, false. - - - Indicates whether two specified objects are unequal. - The first object to compare. - The second object to compare. - true if left and right are unequal; otherwise, false. - - - Gets an object that uses the PKCS #1 v1.5 padding mode. - An object that uses the padding mode. - - - Gets an object that uses PSS padding mode. - An object that uses the padding mode with the number of salt bytes equal to the size of the hash. - - - Returns the string representation of the current instance. - The string representation of the current object. - - - Specifies the padding mode to use with RSA signature creation or verification operations. - - - PKCS #1 v1.5 - - - - Probabilistic Signature Scheme - - - - Computes the hash for the input data. - - - Initializes a new instance of . - The policy on this object is not compliant with the FIPS algorithm. - - - Creates an instance of the default implementation of . - A new instance of . - - - Creates an instance of the specified implementation of . - The name of the specific implementation of to be used. - A new instance of using the specified implementation. - - - Computes the hash value for the input data using the implementation provided by the cryptographic service provider (CSP). This class cannot be inherited. - - - Initializes a new instance of the class. - - - Initializes an instance of . - - - Computes the hash for the input data using the managed library. - - - Initializes a new instance of the class. - This class is not compliant with the FIPS algorithm. - - - Routes data written to the object into the hash algorithm for computing the hash. - The input data. - The offset into the byte array from which to begin using data. - The number of bytes in the array to use as data. - - - Returns the computed hash value after all data has been written to the object. - The computed hash code. - - - Initializes an instance of . - - - Computes the hash for the input data. - - - Initializes a new instance of . - - - Creates an instance of the default implementation of . - A new instance of . - The algorithm was used with Federal Information Processing Standards (FIPS) mode enabled, but is not FIPS compatible. - - - Creates an instance of a specified implementation of . - The name of the specific implementation of to be used. - A new instance of using the specified implementation. - The algorithm described by the hashName parameter was used with Federal Information Processing Standards (FIPS) mode enabled, but is not FIPS compatible. - - - Defines a wrapper object to access the cryptographic service provider (CSP) implementation of the algorithm. - - - Initializes a new instance of the class. - - - Initializes, or reinitializes, an instance of a hash algorithm. - - - Computes the hash for the input data using the managed library. - - - Initializes a new instance of the class using the managed library. - The Federal Information Processing Standards (FIPS) security setting is enabled. This implementation is not part of the Windows Platform FIPS-validated cryptographic algorithms. - - - When overridden in a derived class, routes data written to the object into the hash algorithm for computing the hash. - The input data. - The offset into the byte array from which to begin using data. - The number of bytes in the array to use as data. - - - When overridden in a derived class, finalizes the hash computation after the last data is processed by the cryptographic stream object. - The computed hash code. - - - Initializes an instance of . - - - Computes the hash for the input data. - - - Initializes a new instance of . - - - Creates an instance of the default implementation of . - A new instance of . - The algorithm was used with Federal Information Processing Standards (FIPS) mode enabled, but is not FIPS compatible. - - - Creates an instance of a specified implementation of . - The name of the specific implementation of to be used. - A new instance of using the specified implementation. - The algorithm described by the hashName parameter was used with Federal Information Processing Standards (FIPS) mode enabled, but is not FIPS compatible. - - - Defines a wrapper object to access the cryptographic service provider (CSP) implementation of the algorithm. - - - Initializes a new instance of the class. - - - Initializes, or reinitializes, an instance of a hash algorithm. - - - Computes the hash for the input data using the managed library. - - - Initializes a new instance of the class. - The Federal Information Processing Standards (FIPS) security setting is enabled. This implementation is not part of the Windows Platform FIPS-validated cryptographic algorithms. - - - When overridden in a derived class, routes data written to the object into the hash algorithm for computing the hash. - The input data. - The offset into the byte array from which to begin using data. - The number of bytes in the array to use as data. - - - When overridden in a derived class, finalizes the hash computation after the last data is processed by the cryptographic stream object. - The computed hash code. - - - Initializes an instance of . - - - Computes the hash for the input data. - - - Initializes a new instance of . - - - Creates an instance of the default implementation of . - A new instance of . - The algorithm was used with Federal Information Processing Standards (FIPS) mode enabled, but is not FIPS compatible. - - - Creates an instance of a specified implementation of . - The name of the specific implementation of to be used. - A new instance of using the specified implementation. - The algorithm described by the hashName parameter was used with Federal Information Processing Standards (FIPS) mode enabled, but is not FIPS compatible. - - - Defines a wrapper object to access the cryptographic service provider (CSP) implementation of the algorithm. - - - Initializes a new instance of the class. - - - Initializes, or reinitializes, an instance of a hash algorithm. - - - Computes the hash algorithm for the input data using the managed library. - - - Initializes a new instance of the class. - The Federal Information Processing Standards (FIPS) security setting is enabled. This implementation is not part of the Windows Platform FIPS-validated cryptographic algorithms. - - - When overridden in a derived class, routes data written to the object into the hash algorithm for computing the hash. - The input data. - The offset into the byte array from which to begin using data. - The number of bytes in the array to use as data. - - - When overridden in a derived class, finalizes the hash computation after the last data is processed by the cryptographic stream object. - The computed hash code. - - - Initializes an instance of the class using the managed library. - - - Contains information about the properties of a digital signature. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class from the specified . - The from which to get the algorithms for the signature description. - The el parameter is null. - - - Creates an instance with the specified key using the property. - The key to use in the . - The newly created instance. - - - Creates a instance using the property. - The newly created instance. - - - Creates an instance with the specified key using the property. - The key to use in the . - The newly created instance. - - - Gets or sets the deformatter algorithm for the signature description. - The deformatter algorithm for the signature description. - - - Gets or sets the digest algorithm for the signature description. - The digest algorithm for the signature description. - - - Gets or sets the formatter algorithm for the signature description. - The formatter algorithm for the signature description. - - - Gets or sets the key algorithm for the signature description. - The key algorithm for the signature description. - - - Represents the abstract base class from which all implementations of symmetric algorithms must inherit. - - - Initializes a new instance of the class. - The implementation of the class derived from the symmetric algorithm is not valid. - - - Gets or sets the block size, in bits, of the cryptographic operation. - The block size, in bits. - The block size is invalid. - - - Represents the block size, in bits, of the cryptographic operation. - - - - Releases all resources used by the class. - - - Creates a default cryptographic object used to perform the symmetric algorithm. - A default cryptographic object used to perform the symmetric algorithm. - - - Creates the specified cryptographic object used to perform the symmetric algorithm. - The name of the specific implementation of the class to use. - A cryptographic object used to perform the symmetric algorithm. - - - Creates a symmetric decryptor object with the current property and initialization vector (). - A symmetric decryptor object. - - - When overridden in a derived class, creates a symmetric decryptor object with the specified property and initialization vector (). - The secret key to use for the symmetric algorithm. - The initialization vector to use for the symmetric algorithm. - A symmetric decryptor object. - - - Creates a symmetric encryptor object with the current property and initialization vector (). - A symmetric encryptor object. - - - When overridden in a derived class, creates a symmetric encryptor object with the specified property and initialization vector (). - The secret key to use for the symmetric algorithm. - The initialization vector to use for the symmetric algorithm. - A symmetric encryptor object. - - - Releases all resources used by the current instance of the class. - - - Releases the unmanaged resources used by the and optionally releases the managed resources. - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - Gets or sets the feedback size, in bits, of the cryptographic operation. - The feedback size in bits. - The feedback size is larger than the block size. - - - Represents the feedback size, in bits, of the cryptographic operation. - - - - When overridden in a derived class, generates a random initialization vector () to use for the algorithm. - - - When overridden in a derived class, generates a random key () to use for the algorithm. - - - Gets or sets the initialization vector () for the symmetric algorithm. - The initialization vector. - An attempt was made to set the initialization vector to null. - An attempt was made to set the initialization vector to an invalid size. - - - Represents the initialization vector () for the symmetric algorithm. - - - - Gets or sets the secret key for the symmetric algorithm. - The secret key to use for the symmetric algorithm. - An attempt was made to set the key to null. - The key size is invalid. - - - Gets or sets the size, in bits, of the secret key used by the symmetric algorithm. - The size, in bits, of the secret key used by the symmetric algorithm. - The key size is not valid. - - - Represents the size, in bits, of the secret key used by the symmetric algorithm. - - - - Represents the secret key for the symmetric algorithm. - - - - Gets the block sizes, in bits, that are supported by the symmetric algorithm. - An array that contains the block sizes supported by the algorithm. - - - Specifies the block sizes, in bits, that are supported by the symmetric algorithm. - - - - Gets the key sizes, in bits, that are supported by the symmetric algorithm. - An array that contains the key sizes supported by the algorithm. - - - Specifies the key sizes, in bits, that are supported by the symmetric algorithm. - - - - Gets or sets the mode for operation of the symmetric algorithm. - The mode for operation of the symmetric algorithm. The default is . - The cipher mode is not one of the values. - - - Represents the cipher mode used in the symmetric algorithm. - - - - Gets or sets the padding mode used in the symmetric algorithm. - The padding mode used in the symmetric algorithm. The default is . - The padding mode is not one of the values. - - - Represents the padding mode used in the symmetric algorithm. - - - - Determines whether the specified key size is valid for the current algorithm. - The length, in bits, to check for a valid key size. - true if the specified key size is valid for the current algorithm; otherwise, false. - - - Converts a to base 64. - - - Initializes a new instance of the class. - - - Gets a value indicating whether the current transform can be reused. - Always true. - - - Gets a value that indicates whether multiple blocks can be transformed. - Always false. - - - Releases all resources used by the . - - - Releases all resources used by the current instance of the class. - - - Releases the unmanaged resources used by the and optionally releases the managed resources. - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - Releases the unmanaged resources used by the . - - - Gets the input block size. - The size of the input data blocks in bytes. - - - Gets the output block size. - The size of the output data blocks in bytes. - - - Converts the specified region of the input byte array to base 64 and copies the result to the specified region of the output byte array. - The input to compute to base 64. - The offset into the input byte array from which to begin using data. - The number of bytes in the input byte array to use as data. - The output to which to write the result. - The offset into the output byte array from which to begin writing data. - The number of bytes written. - The current object has already been disposed. - The data size is not valid. - The inputBuffer parameter contains an invalid offset length. -or- The inputCount parameter contains an invalid value. - The inputBuffer parameter is null. - The inputBuffer parameter requires a non-negative number. - - - Converts the specified region of the specified byte array to base 64. - The input to convert to base 64. - The offset into the byte array from which to begin using data. - The number of bytes in the byte array to use as data. - The computed base 64 conversion. - The current object has already been disposed. - The inputBuffer parameter contains an invalid offset length. -or- The inputCount parameter contains an invalid value. - The inputBuffer parameter is null. - The inputBuffer parameter requires a non-negative number. - - - Represents the base class for Triple Data Encryption Standard algorithms from which all implementations must derive. - - - Initializes a new instance of the class. - - - Creates an instance of a cryptographic object to perform the algorithm. - An instance of a cryptographic object. - - - Creates an instance of a cryptographic object to perform the specified implementation of the algorithm. - The name of the specific implementation of to use. - An instance of a cryptographic object. - - - Determines whether the specified key is weak. - The secret key to test for weakness. - true if the key is weak; otherwise, false. - The size of the rgbKey parameter is not valid. - - - Gets or sets the secret key for the algorithm. - The secret key for the algorithm. - An attempt was made to set the key to null. - An attempt was made to set a key whose length is invalid. -or- An attempt was made to set a weak key (see ). - - - Defines a wrapper object to access the cryptographic service provider (CSP) version of the algorithm. This class cannot be inherited. - - - Initializes a new instance of the class. - The cryptographic service provider is not available. - - - Creates a symmetric decryptor object with the specified key () and initialization vector (). - The secret key to use for the symmetric algorithm. - The initialization vector to use for the symmetric algorithm. - A symmetric decryptor object. - The value of the property is . -or- The value of the property is and the value of the property is not 8. -or- An invalid key size was used. -or- The algorithm key size was not available. - - - Creates a symmetric encryptor object with the specified key () and initialization vector (). - The secret key to use for the symmetric algorithm. -

The initialization vector to use for the symmetric algorithm.

-


The initialization vector must be 8 bytes long. If it is longer than 8 bytes, it is truncated and an exception is not thrown. Before you call , check the length of the initialization vector and throw an exception if it is too long.

-

- - A symmetric encryptor object. - The value of the property is . -or- The value of the property is and the value of the property is not 8. -or- An invalid key size was used. -or- The algorithm key size was not available. -
- - Generates a random initialization vector () to use for the algorithm. - - - Generates a random to be used for the algorithm. - - - Provides extension methods for retrieving implementations for the public and private keys of a certificate. - - - Gets the private key from the certificate. - The certificate. - The private key, or null if the certificate does not have an ECDsa private key. - certificate is null. - - - Gets the public key from the certificate. - The certificate. - The public key, or null if the certificate does not have an ECDsa public key. - certificate is null. - The handle is invalid. - - - Specifies the way to open the X.509 certificate store. - - - Open the X.509 certificate store and include archived certificates. - - - - Open the X.509 certificate store for the highest access allowed. - - - - Opens only existing stores; if no store exists, the method will not create a new store. - - - - Open the X.509 certificate store for reading only. - - - - Open the X.509 certificate store for both reading and writing. - - - - Represents a certificate's public key information. This class cannot be inherited. - - - Initializes a new instance of the class using an object identifier (OID) object of the public key, an ASN.1-encoded representation of the public key parameters, and an ASN.1-encoded representation of the public key value. - An object identifier (OID) object that represents the public key. - An ASN.1-encoded representation of the public key parameters. - An ASN.1-encoded representation of the public key value. - - - Gets the ASN.1-encoded representation of the public key value. - The ASN.1-encoded representation of the public key value. - - - Gets the ASN.1-encoded representation of the public key parameters. - The ASN.1-encoded representation of the public key parameters. - - - Gets an or object representing the public key. - An object representing the public key. - The key algorithm is not supported. - - - Gets an object identifier (OID) object of the public key. - An object identifier (OID) object of the public key. - - - Represents the results from a single capturing group. - - - Gets a collection of all the captures matched by the capturing group, in innermost-leftmost-first order (or innermost-rightmost-first order if the regular expression is modified with the option). The collection may have zero or more items. - The collection of substrings matched by the group. - - - Gets a value indicating whether the match is successful. - true if the match is successful; otherwise, false. - - - Returns a Group object equivalent to the one supplied that is safe to share between multiple threads. - The input object. - A regular expression Group object. - inner is null. - - - Returns the set of captured groups in a single match. - - - Copies all the elements of the collection to the given array beginning at the given index. - The array the collection is to be copied into. - The position in the destination array where the copying is to begin. - array is null. - arrayIndex is outside the bounds of array. -or- arrayIndex plus is outside the bounds of array. - - - Returns the number of groups in the collection. - The number of groups in the collection. - - - Provides an enumerator that iterates through the collection. - An enumerator that contains all objects in the . - - - Gets a value that indicates whether the collection is read-only. - true in all cases. - - - Gets a value that indicates whether access to the is synchronized (thread-safe). - false in all cases. - - - Enables access to a member of the collection by integer index. - The zero-based index of the collection member to be retrieved. - The member of the collection specified by groupnum. - - - Enables access to a member of the collection by string index. - The name of a capturing group. - The member of the collection specified by groupname. - - - Gets an object that can be used to synchronize access to the . - A copy of the object to synchronize. - - - Represents the results from a single regular expression match. - - - Gets the empty group. All failed matches return this empty match. - An empty match. - - - Gets a collection of groups matched by the regular expression. - The character groups matched by the pattern. - - - Returns a new object with the results for the next match, starting at the position at which the last match ended (at the character after the last matched character). - The next regular expression match. - A time-out occurred. - - - Returns the expansion of the specified replacement pattern. - The replacement pattern to use. - The expanded version of the replacement parameter. - replacement is null. - Expansion is not allowed for this pattern. - - - Returns a instance equivalent to the one supplied that is suitable to share between multiple threads. - A regular expression match equivalent to the one expected. - A regular expression match that is suitable to share between multiple threads. - inner is null. - - - Represents the set of successful matches found by iteratively applying a regular expression pattern to the input string. - - - Copies all the elements of the collection to the given array starting at the given index. - The array the collection is to be copied into. - The position in the array where copying is to begin. - array is a multi-dimensional array. - arrayIndex is outside the bounds of array. -or- arrayIndex plus is outside the bounds of array. - A time-out occurred. - - - Gets the number of matches. - The number of matches. - A time-out occurred. - - - Provides an enumerator that iterates through the collection. - An object that contains all objects within the . - A time-out occurred. - - - Gets a value that indicates whether the collection is read only. - true in all cases. - - - Gets a value indicating whether access to the collection is synchronized (thread-safe). - false in all cases. - - - Gets an individual member of the collection. - Index into the collection. - The captured substring at position i in the collection. - i is less than 0 or greater than or equal to . - A time-out occurred. - - - Gets an object that can be used to synchronize access to the collection. - An object that can be used to synchronize access to the collection. This property always returns the object itself. - - - Represents the method that is called each time a regular expression match is found during a method operation. - The object that represents a single regular expression match during a method operation. - - - - Represents an immutable regular expression. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class for the specified regular expression. - The regular expression pattern to match. - A regular expression parsing error occurred. - pattern is null. - - - Initializes a new instance of the class by using serialized data. - The object that contains a serialized pattern and information. - The destination for this serialization. (This parameter is not used; specify null.) - A regular expression parsing error occurred. - The pattern that info contains is null. - info contains an invalid flag. - - - Initializes a new instance of the class for the specified regular expression, with options that modify the pattern. - The regular expression pattern to match. - A bitwise combination of the enumeration values that modify the regular expression. - A regular expression parsing error occurred. - pattern is null. - options contains an invalid flag. - - - Initializes a new instance of the class for the specified regular expression, with options that modify the pattern and a value that specifies how long a pattern matching method should attempt a match before it times out. - The regular expression pattern to match. - A bitwise combination of the enumeration values that modify the regular expression. - A time-out interval, or to indicate that the method should not time out. - A regular expression parsing error occurred. - pattern is null. - options is not a valid value. -or- matchTimeout is negative, zero, or greater than approximately 24 days. - - - Gets or sets the maximum number of entries in the current static cache of compiled regular expressions. - The maximum number of entries in the static cache. - The value in a set operation is less than zero. - - - Used by a object generated by the method. - - - - - - - Used by a object generated by the method. - - - - - - - Used by a object generated by the method. - - - - Used by a object generated by the method. - - - - Escapes a minimal set of characters (\, *, +, ?, |, {, [, (,), ^, $,., #, and white space) by replacing them with their escape codes. This instructs the regular expression engine to interpret these characters literally rather than as metacharacters. - The input string that contains the text to convert. - A string of characters with metacharacters converted to their escaped form. - str is null. - - - Used by a object generated by the method. - - - - Returns an array of capturing group names for the regular expression. - A string array of group names. - - - Returns an array of capturing group numbers that correspond to group names in an array. - An integer array of group numbers. - - - Gets the group name that corresponds to the specified group number. - The group number to convert to the corresponding group name. - A string that contains the group name associated with the specified group number. If there is no group name that corresponds to i, the method returns . - - - Returns the group number that corresponds to the specified group name. - The group name to convert to the corresponding group number. - The group number that corresponds to the specified group name, or -1 if name is not a valid group name. - name is null. - - - Specifies that a pattern-matching operation should not time out. - - - - Used by a object generated by the method. - References have already been initialized. - - - The maximum amount of time that can elapse in a pattern-matching operation before the operation times out. - - - - Indicates whether the regular expression specified in the constructor finds a match in a specified input string. - The string to search for a match. - true if the regular expression finds a match; otherwise, false. - input is null. - A time-out occurred. For more information about time-outs, see the Remarks section. - - - Indicates whether the regular expression specified in the constructor finds a match in the specified input string, beginning at the specified starting position in the string. - The string to search for a match. - The character position at which to start the search. - true if the regular expression finds a match; otherwise, false. - input is null. - startat is less than zero or greater than the length of input. - A time-out occurred. For more information about time-outs, see the Remarks section. - - - Indicates whether the specified regular expression finds a match in the specified input string. - The string to search for a match. - The regular expression pattern to match. - true if the regular expression finds a match; otherwise, false. - A regular expression parsing error occurred. - input or pattern is null. - A time-out occurred. For more information about time-outs, see the Remarks section. - - - Indicates whether the specified regular expression finds a match in the specified input string, using the specified matching options. - The string to search for a match. - The regular expression pattern to match. - A bitwise combination of the enumeration values that provide options for matching. - true if the regular expression finds a match; otherwise, false. - A regular expression parsing error occurred. - input or pattern is null. - options is not a valid value. - A time-out occurred. For more information about time-outs, see the Remarks section. - - - Indicates whether the specified regular expression finds a match in the specified input string, using the specified matching options and time-out interval. - The string to search for a match. - The regular expression pattern to match. - A bitwise combination of the enumeration values that provide options for matching. - A time-out interval, or to indicate that the method should not time out. - true if the regular expression finds a match; otherwise, false. - A regular expression parsing error occurred. - input or pattern is null. - options is not a valid value. -or- matchTimeout is negative, zero, or greater than approximately 24 days. - A time-out occurred. - - - Searches the input string for the first occurrence of the specified regular expression, using the specified matching options. - The string to search for a match. - The regular expression pattern to match. - A bitwise combination of the enumeration values that provide options for matching. - An object that contains information about the match. - A regular expression parsing error occurred. - input or pattern is null. - options is not a valid bitwise combination of values. - A time-out occurred. For more information about time-outs, see the Remarks section. - - - Searches the input string for the first occurrence of a regular expression, beginning at the specified starting position and searching only the specified number of characters. - The string to search for a match. - The zero-based character position in the input string that defines the leftmost position to be searched. - The number of characters in the substring to include in the search. - An object that contains information about the match. - input is null. - beginning is less than zero or greater than the length of input. -or- length is less than zero or greater than the length of input. -or- beginning+length–1 identifies a position that is outside the range of input. - A time-out occurred. For more information about time-outs, see the Remarks section. - - - Searches the input string for the first occurrence of the specified regular expression, using the specified matching options and time-out interval. - The string to search for a match. - The regular expression pattern to match. - A bitwise combination of the enumeration values that provide options for matching. - A time-out interval, or to indicate that the method should not time out. - An object that contains information about the match. - A regular expression parsing error occurred. - input or pattern is null. - options is not a valid bitwise combination of values. -or- matchTimeout is negative, zero, or greater than approximately 24 days. - A time-out occurred. For more information about time-outs, see the Remarks section. - - - Searches the input string for the first occurrence of a regular expression, beginning at the specified starting position in the string. - The string to search for a match. - The zero-based character position at which to start the search. - An object that contains information about the match. - input is null. - startat is less than zero or greater than the length of input. - A time-out occurred. For more information about time-outs, see the Remarks section. - - - Searches the specified input string for the first occurrence of the regular expression specified in the constructor. - The string to search for a match. - An object that contains information about the match. - input is null. - A time-out occurred. For more information about time-outs, see the Remarks section. - - - Searches the specified input string for the first occurrence of the specified regular expression. - The string to search for a match. - The regular expression pattern to match. - An object that contains information about the match. - A regular expression parsing error occurred. - input or pattern is null. - A time-out occurred. For more information about time-outs, see the Remarks section. - - - Searches the specified input string for all occurrences of a regular expression. - The string to search for a match. - A collection of the objects found by the search. If no matches are found, the method returns an empty collection object. - input is null. - - - Searches the specified input string for all occurrences of a regular expression, beginning at the specified starting position in the string. - The string to search for a match. - The character position in the input string at which to start the search. - A collection of the objects found by the search. If no matches are found, the method returns an empty collection object. - input is null. - startat is less than zero or greater than the length of input. - - - Searches the specified input string for all occurrences of a specified regular expression. - The string to search for a match. - The regular expression pattern to match. - A collection of the objects found by the search. If no matches are found, the method returns an empty collection object. - A regular expression parsing error occurred. - input or pattern is null. - - - Searches the specified input string for all occurrences of a specified regular expression, using the specified matching options. - The string to search for a match. - The regular expression pattern to match. - A bitwise combination of the enumeration values that specify options for matching. - A collection of the objects found by the search. If no matches are found, the method returns an empty collection object. - A regular expression parsing error occurred. - input or pattern is null. - options is not a valid bitwise combination of values. - - - Searches the specified input string for all occurrences of a specified regular expression, using the specified matching options and time-out interval. - The string to search for a match. - The regular expression pattern to match. - A bitwise combination of the enumeration values that specify options for matching. - A time-out interval, or to indicate that the method should not time out. - A collection of the objects found by the search. If no matches are found, the method returns an empty collection object. - A regular expression parsing error occurred. - input or pattern is null. - options is not a valid bitwise combination of values. -or- matchTimeout is negative, zero, or greater than approximately 24 days. - - - Gets the time-out interval of the current instance. - The maximum time interval that can elapse in a pattern-matching operation before a is thrown, or if time-outs are disabled. - - - Gets the options that were passed into the constructor. - One or more members of the enumeration that represent options that were passed to the constructor - - - Used by a object generated by the method. - - - - In a specified input string, replaces all substrings that match a specified regular expression with a string returned by a delegate. Additional parameters specify options that modify the matching operation and a time-out interval if no match is found. - The string to search for a match. - The regular expression pattern to match. - A custom method that examines each match and returns either the original matched string or a replacement string. - A bitwise combination of enumeration values that provide options for matching. - A time-out interval, or to indicate that the method should not time out. - A new string that is identical to the input string, except that the replacement string takes the place of each matched string. If pattern is not matched in the current instance, the method returns the current instance unchanged. - A regular expression parsing error occurred. - input, pattern, or evaluator is null. - options is not a valid bitwise combination of values. -or- matchTimeout is negative, zero, or greater than approximately 24 days. - A time-out occurred. For more information about time-outs, see the Remarks section. - - - In a specified input string, replaces all strings that match a specified regular expression with a specified replacement string. Additional parameters specify options that modify the matching operation and a time-out interval if no match is found. - The string to search for a match. - The regular expression pattern to match. - The replacement string. - A bitwise combination of the enumeration values that provide options for matching. - A time-out interval, or to indicate that the method should not time out. - A new string that is identical to the input string, except that the replacement string takes the place of each matched string. If pattern is not matched in the current instance, the method returns the current instance unchanged. - A regular expression parsing error occurred. - input, pattern, or replacement is null. - options is not a valid bitwise combination of values. -or- matchTimeout is negative, zero, or greater than approximately 24 days. - A time-out occurred. For more information about time-outs, see the Remarks section. - - - In a specified input substring, replaces a specified maximum number of strings that match a regular expression pattern with a string returned by a delegate. - The string to search for a match. - A custom method that examines each match and returns either the original matched string or a replacement string. - The maximum number of times the replacement will occur. - The character position in the input string where the search begins. - A new string that is identical to the input string, except that a replacement string takes the place of each matched string. If the regular expression pattern is not matched in the current instance, the method returns the current instance unchanged. - input or evaluator is null. - startat is less than zero or greater than the length of input. - A time-out occurred. For more information about time-outs, see the Remarks section. - - - In a specified input string, replaces all strings that match a specified regular expression with a string returned by a delegate. Specified options modify the matching operation. - The string to search for a match. - The regular expression pattern to match. - A custom method that examines each match and returns either the original matched string or a replacement string. - A bitwise combination of the enumeration values that provide options for matching. - A new string that is identical to the input string, except that a replacement string takes the place of each matched string. If pattern is not matched in the current instance, the method returns the current instance unchanged. - A regular expression parsing error occurred. - input, pattern, or evaluator is null. - options is not a valid bitwise combination of values. - A time-out occurred. For more information about time-outs, see the Remarks section. - - - In a specified input substring, replaces a specified maximum number of strings that match a regular expression pattern with a specified replacement string. - The string to search for a match. - The replacement string. - Maximum number of times the replacement can occur. - The character position in the input string where the search begins. - A new string that is identical to the input string, except that the replacement string takes the place of each matched string. If the regular expression pattern is not matched in the current instance, the method returns the current instance unchanged. - input or replacement is null. - startat is less than zero or greater than the length of input. - A time-out occurred. For more information about time-outs, see the Remarks section. - - - In a specified input string, replaces all strings that match a specified regular expression with a specified replacement string. Specified options modify the matching operation. - The string to search for a match. - The regular expression pattern to match. - The replacement string. - A bitwise combination of the enumeration values that provide options for matching. - A new string that is identical to the input string, except that the replacement string takes the place of each matched string. If pattern is not matched in the current instance, the method returns the current instance unchanged. - A regular expression parsing error occurred. - input, pattern, or replacement is null. - options is not a valid bitwise combination of values. - A time-out occurred. For more information about time-outs, see the Remarks section. - - - In a specified input string, replaces all strings that match a specified regular expression with a string returned by a delegate. - The string to search for a match. - The regular expression pattern to match. - A custom method that examines each match and returns either the original matched string or a replacement string. - A new string that is identical to the input string, except that a replacement string takes the place of each matched string. If pattern is not matched in the current instance, the method returns the current instance unchanged. - A regular expression parsing error occurred. - input, pattern, or evaluator is null. - A time-out occurred. For more information about time-outs, see the Remarks section. - - - In a specified input string, replaces all strings that match a specified regular expression with a specified replacement string. - The string to search for a match. - The regular expression pattern to match. - The replacement string. - A new string that is identical to the input string, except that the replacement string takes the place of each matched string. If pattern is not matched in the current instance, the method returns the current instance unchanged. - A regular expression parsing error occurred. - input, pattern, or replacement is null. - A time-out occurred. For more information about time-outs, see the Remarks section. - - - In a specified input string, replaces a specified maximum number of strings that match a regular expression pattern with a specified replacement string. - The string to search for a match. - The replacement string. - The maximum number of times the replacement can occur. - A new string that is identical to the input string, except that the replacement string takes the place of each matched string. If the regular expression pattern is not matched in the current instance, the method returns the current instance unchanged. - input or replacement is null. - A time-out occurred. For more information about time-outs, see the Remarks section. - - - In a specified input string, replaces all strings that match a specified regular expression with a string returned by a delegate. - The string to search for a match. - A custom method that examines each match and returns either the original matched string or a replacement string. - A new string that is identical to the input string, except that a replacement string takes the place of each matched string. If the regular expression pattern is not matched in the current instance, the method returns the current instance unchanged. - input or evaluator is null. - A time-out occurred. For more information about time-outs, see the Remarks section. - - - In a specified input string, replaces all strings that match a regular expression pattern with a specified replacement string. - The string to search for a match. - The replacement string. - A new string that is identical to the input string, except that the replacement string takes the place of each matched string. If the regular expression pattern is not matched in the current instance, the method returns the current instance unchanged. - input or replacement is null. - A time-out occurred. For more information about time-outs, see the Remarks section. - - - In a specified input string, replaces a specified maximum number of strings that match a regular expression pattern with a string returned by a delegate. - The string to search for a match. - A custom method that examines each match and returns either the original matched string or a replacement string. - The maximum number of times the replacement will occur. - A new string that is identical to the input string, except that a replacement string takes the place of each matched string. If the regular expression pattern is not matched in the current instance, the method returns the current instance unchanged. - input or evaluator is null. - A time-out occurred. For more information about time-outs, see the Remarks section. - - - Gets a value that indicates whether the regular expression searches from right to left. - true if the regular expression searches from right to left; otherwise, false. - - - Used by a object generated by the method. - - - - Splits an input string into an array of substrings at the positions defined by a specified regular expression pattern. Additional parameters specify options that modify the matching operation and a time-out interval if no match is found. - The string to split. - The regular expression pattern to match. - A bitwise combination of the enumeration values that provide options for matching. - A time-out interval, or to indicate that the method should not time out. - A string array. - A regular expression parsing error occurred. - input or pattern is null. - options is not a valid bitwise combination of values. -or- matchTimeout is negative, zero, or greater than approximately 24 days. - A time-out occurred. For more information about time-outs, see the Remarks section. - - - Splits an input string into an array of substrings at the positions defined by a specified regular expression pattern. Specified options modify the matching operation. - The string to split. - The regular expression pattern to match. - A bitwise combination of the enumeration values that provide options for matching. - An array of strings. - A regular expression parsing error occurred. - input or pattern is null. - options is not a valid bitwise combination of values. - A time-out occurred. For more information about time-outs, see the Remarks section. - - - Splits an input string a specified maximum number of times into an array of substrings, at the positions defined by a regular expression specified in the constructor. The search for the regular expression pattern starts at a specified character position in the input string. - The string to be split. - The maximum number of times the split can occur. - The character position in the input string where the search will begin. - An array of strings. - input is null. - startat is less than zero or greater than the length of input. - A time-out occurred. For more information about time-outs, see the Remarks section. - - - Splits an input string a specified maximum number of times into an array of substrings, at the positions defined by a regular expression specified in the constructor. - The string to be split. - The maximum number of times the split can occur. - An array of strings. - input is null. - A time-out occurred. For more information about time-outs, see the Remarks section. - - - Splits an input string into an array of substrings at the positions defined by a regular expression pattern specified in the constructor. - The string to split. - An array of strings. - input is null. - A time-out occurred. For more information about time-outs, see the Remarks section. - - - Splits an input string into an array of substrings at the positions defined by a regular expression pattern. - The string to split. - The regular expression pattern to match. - An array of strings. - A regular expression parsing error occurred. - input or pattern is null. - A time-out occurred. For more information about time-outs, see the Remarks section. - - - Returns the regular expression pattern that was passed into the Regex constructor. - The pattern parameter that was passed into the Regex constructor. - - - Converts any escaped characters in the input string. - The input string containing the text to convert. - A string of characters with any escaped characters converted to their unescaped form. - str includes an unrecognized escape sequence. - str is null. - - - Used by a object generated by the method. - true if the property contains the option; otherwise, false. - - - Used by a object generated by the method. - true if the property contains the option; otherwise, false. - - - Checks whether a time-out interval is within an acceptable range. - The time-out interval to check. - - - Populates a object with the data necessary to deserialize the current object. - The object to populate with serialization information. - The place to store and retrieve serialized data. This parameter is reserved for future use. - - - The exception that is thrown when the execution time of a regular expression pattern-matching method exceeds its time-out interval. - - - Initializes a new instance of the class with a system-supplied message. - - - Initializes a new instance of the class with the specified message string. - A string that describes the exception. - - - Initializes a new instance of the class with serialized data. - The object that contains the serialized data. - The stream that contains the serialized data. - - - Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. - A string that describes the exception. - The exception that is the cause of the current exception. - - - Initializes a new instance of the class with information about the regular expression pattern, the input text, and the time-out interval. - The input text processed by the regular expression engine when the time-out occurred. - The pattern used by the regular expression engine when the time-out occurred. - The time-out interval. - - - Gets the input text that the regular expression engine was processing when the time-out occurred. - The regular expression input text. - - - Gets the time-out interval for a regular expression match. - The time-out interval. - - - Gets the regular expression pattern that was used in the matching operation when the time-out occurred. - The regular expression pattern. - - - Populates a object with the data needed to serialize a object. - The object to populate with data. - The destination for this serialization. - - - Provides enumerated values to use to set regular expression options. - - - Specifies that the regular expression is compiled to an assembly. This yields faster execution but increases startup time. This value should not be assigned to the property when calling the method. For more information, see the "Compiled Regular Expressions" section in the Regular Expression Options topic. - - - - Specifies that cultural differences in language is ignored. For more information, see the "Comparison Using the Invariant Culture" section in the Regular Expression Options topic. - - - - Enables ECMAScript-compliant behavior for the expression. This value can be used only in conjunction with the , , and values. The use of this value with any other values results in an exception. For more information on the option, see the "ECMAScript Matching Behavior" section in the Regular Expression Options topic. - - - -

Specifies that the only valid captures are explicitly named or numbered groups of the form (?…). This allows unnamed parentheses to act as noncapturing groups without the syntactic clumsiness of the expression (?:…). For more information, see the "Explicit Captures Only" section in the Regular Expression Options topic.

-

-
- -
- - Specifies case-insensitive matching. For more information, see the "Case-Insensitive Matching " section in the Regular Expression Options topic. - - - - Eliminates unescaped white space from the pattern and enables comments marked with #. However, this value does not affect or eliminate white space in character classes, numeric quantifiers, or tokens that mark the beginning of individual regular expression language elements. For more information, see the "Ignore White Space" section of the Regular Expression Options topic. - - - - Multiline mode. Changes the meaning of ^ and $ so they match at the beginning and end, respectively, of any line, and not just the beginning and end of the entire string. For more information, see the "Multiline Mode" section in the Regular Expression Options topic. - - - - Specifies that no options are set. For more information about the default behavior of the regular expression engine, see the "Default Options" section in the Regular Expression Options topic. - - - - Specifies that the search will be from right to left instead of from left to right. For more information, see the "Right-to-Left Mode" section in the Regular Expression Options topic. - - - - Specifies single-line mode. Changes the meaning of the dot (.) so it matches every character (instead of every character except \n). For more information, see the "Single-line Mode" section in the Regular Expression Options topic. - - - - The class is the base class for compiled regular expressions. - - - Initializes a new instance of the class. - - - Used by a object generated by the method. - A capture number. - The starting position of the capture. - The ending position of the capture. - - - Used by a object generated by the method. Determines whether a character is in a character class. - A character to test. - The internal name of a character class. - true if the ch parameter is in the character class specified by the charClass parameter. - - - Used by a object generated by the method. - A character. - The character set. - The character category. - Returns . - - - Used by a object generated by the method. - - - Used by a object generated by the method. - A number to save. - - - Used by a object generated by the method. - Returns . - - - Used by a object generated by the method. - - - Used by a object generated by the method. - - - Used by a object generated by the method. - - - Used by a object generated by the method. - - - Used by a object generated by the method. - Returns . - - - Used by a object generated by the method. - - - Used by a object generated by the method. - - - Used by a object generated by the method. - The possible boundary position. - The starting position. - The ending position. - Returns . - - - Used by a object generated by the method. - The possible ECMA boundary position. - The starting position. - The ending position. - Returns . - - - Used by a object generated by the method. - The capture number. - Returns . - - - Used by a object generated by the method. - The capture number. - Returns . - - - Used by a object generated by the method. - The capture number. - Returns . - - - Used by a object generated by the method. - Returns . - - - Used by a object generated by the method. - - - - Used by a object generated by the method. - - - - Used by a object generated by the method. - - - - Used by a object generated by the method. - - - - Used by a object generated by the method. - - - - Used by a object generated by the method. - - - - Used by a object generated by the method. - - - - Used by a object generated by the method. - - - - Used by a object generated by the method. - - - - Used by a object generated by the method. - - - - Used by a object generated by the method. - - - - Used by a object generated by the method. - - - - Used by a object generated by the method. - - - - Used by a object generated by the method. - - - - Used by a object generated by the method. - An instance of the regular expression engine. - The text to scan for a pattern match. - The zero-based starting position in text at which the regular expression engine scans for a match. - The zero-based ending position in text at which the regular expression engine scans for a match. - The zero-based starting position to scan for this match. - The number of characters in the previous match. - true to search for a match in quick mode; otherwise, false. - A match. - - - Used by a object generated by the method. - An instance of the regular expression engine. - The text to scan for a pattern match. - The zero-based starting position in text at which the regular expression engine scans for a match. - The zero-based ending position in text at which the regular expression engine scans for a match. - The zero-based starting position to scan for this match. - The number of characters in the previous match. - true to search for a match in quick mode; otherwise, false. - The timeout interval. - A match. - - - Used by a object generated by the method. - A capture number. - A saved capture number. - The starting position. - The ending position. - - - Used by a object generated by the method. - - - Creates a class for a compiled regular expression. - - - Initializes a new instance of the class. - - - When overridden in a derived class, creates a object for a specific compiled regular expression. - A object designed to execute a specific compiled regular expression. - - - Represents a mutable string of characters. This class cannot be inherited. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class using the specified capacity. - The suggested starting size of this instance. - capacity is less than zero. - - - Initializes a new instance of the class using the specified string. - The string used to initialize the value of the instance. If value is null, the new will contain the empty string (that is, it contains ). - - - Initializes a new instance of the class that starts with a specified capacity and can grow to a specified maximum. - The suggested starting size of the . - The maximum number of characters the current string can contain. - maxCapacity is less than one, capacity is less than zero, or capacity is greater than maxCapacity. - - - Initializes a new instance of the class using the specified string and capacity. - The string used to initialize the value of the instance. If value is null, the new will contain the empty string (that is, it contains ). - The suggested starting size of the . - capacity is less than zero. - - - Initializes a new instance of the class from the specified substring and capacity. - The string that contains the substring used to initialize the value of this instance. If value is null, the new will contain the empty string (that is, it contains ). - The position within value where the substring begins. - The number of characters in the substring. - The suggested starting size of the . - capacity is less than zero. -or- startIndex plus length is not a position within value. - - - Appends a copy of a specified substring to this instance. - The string that contains the substring to append. - The starting position of the substring within value. - The number of characters in value to append. - A reference to this instance after the append operation has completed. - value is null, and startIndex and count are not zero. - count less than zero. -or- startIndex less than zero. -or- startIndex + count is greater than the length of value. -or- Enlarging the value of this instance would exceed . - - - Appends the string representation of a specified subarray of Unicode characters to this instance. - A character array. - The starting position in value. - The number of characters to append. - A reference to this instance after the append operation has completed. - value is null, and startIndex and charCount are not zero. - charCount is less than zero. -or- startIndex is less than zero. -or- startIndex + charCount is greater than the length of value. -or- Enlarging the value of this instance would exceed . - - - Appends an array of Unicode characters starting at a specified address to this instance. - A pointer to an array of characters. - The number of characters in the array. - A reference to this instance after the append operation has completed. - valueCount is less than zero. -or- Enlarging the value of this instance would exceed . - value is a null pointer. - - - Appends a specified number of copies of the string representation of a Unicode character to this instance. - The character to append. - The number of times to append value. - A reference to this instance after the append operation has completed. - repeatCount is less than zero. -or- Enlarging the value of this instance would exceed . - Out of memory. - - - Appends the string representation of a specified 64-bit unsigned integer to this instance. - The value to append. - A reference to this instance after the append operation has completed. - Enlarging the value of this instance would exceed . - - - Appends the string representation of a specified 32-bit unsigned integer to this instance. - The value to append. - A reference to this instance after the append operation has completed. - Enlarging the value of this instance would exceed . - - - Appends the string representation of a specified 16-bit unsigned integer to this instance. - The value to append. - A reference to this instance after the append operation has completed. - Enlarging the value of this instance would exceed . - - - Appends a copy of the specified string to this instance. - The string to append. - A reference to this instance after the append operation has completed. - Enlarging the value of this instance would exceed . - - - Appends the string representation of a specified 8-bit signed integer to this instance. - The value to append. - A reference to this instance after the append operation has completed. - Enlarging the value of this instance would exceed . - - - Appends the string representation of a specified single-precision floating-point number to this instance. - The value to append. - A reference to this instance after the append operation has completed. - Enlarging the value of this instance would exceed . - - - Appends the string representation of a specified 64-bit signed integer to this instance. - The value to append. - A reference to this instance after the append operation has completed. - Enlarging the value of this instance would exceed . - - - Appends the string representation of a specified object to this instance. - The object to append. - A reference to this instance after the append operation has completed. - Enlarging the value of this instance would exceed . - - - Appends the string representation of a specified 8-bit unsigned integer to this instance. - The value to append. - A reference to this instance after the append operation has completed. - Enlarging the value of this instance would exceed . - - - Appends the string representation of a specified object to this instance. - The UTF-16-encoded code unit to append. - A reference to this instance after the append operation has completed. - Enlarging the value of this instance would exceed . - - - Appends the string representation of the Unicode characters in a specified array to this instance. - The array of characters to append. - A reference to this instance after the append operation has completed. - Enlarging the value of this instance would exceed . - - - Appends the string representation of a specified Boolean value to this instance. - The Boolean value to append. - A reference to this instance after the append operation has completed. - Enlarging the value of this instance would exceed . - - - Appends the string representation of a specified double-precision floating-point number to this instance. - The value to append. - A reference to this instance after the append operation has completed. - Enlarging the value of this instance would exceed . - - - Appends the string representation of a specified 16-bit signed integer to this instance. - The value to append. - A reference to this instance after the append operation has completed. - Enlarging the value of this instance would exceed . - - - Appends the string representation of a specified 32-bit signed integer to this instance. - The value to append. - A reference to this instance after the append operation has completed. - Enlarging the value of this instance would exceed . - - - Appends the string representation of a specified decimal number to this instance. - The value to append. - A reference to this instance after the append operation has completed. - Enlarging the value of this instance would exceed . - - - Appends the string returned by processing a composite format string, which contains zero or more format items, to this instance. Each format item is replaced by the string representation of either of three arguments using a specified format provider. - An object that supplies culture-specific formatting information. - A composite format string. - The first object to format. - The second object to format. - The third object to format. - A reference to this instance after the append operation has completed. After the append operation, this instance contains any data that existed before the operation, suffixed by a copy of format where any format specification is replaced by the string representation of the corresponding object argument. - format is null. - format is invalid. -or- The index of a format item is less than 0 (zero), or greater than or equal to 3 (three). - The length of the expanded string would exceed . - - - Appends the string returned by processing a composite format string, which contains zero or more format items, to this instance. Each format item is replaced by the string representation of a single argument. - A composite format string. - An object to format. - A reference to this instance with format appended. Each format item in format is replaced by the string representation of arg0. - format is null. - format is invalid. -or- The index of a format item is less than 0 (zero), or greater than or equal to 1. - The length of the expanded string would exceed . - - - Appends the string returned by processing a composite format string, which contains zero or more format items, to this instance. Each format item is replaced by the string representation of a corresponding argument in a parameter array. - A composite format string. - An array of objects to format. - A reference to this instance with format appended. Each format item in format is replaced by the string representation of the corresponding object argument. - format or args is null. - format is invalid. -or- The index of a format item is less than 0 (zero), or greater than or equal to the length of the args array. - The length of the expanded string would exceed . - - - Appends the string returned by processing a composite format string, which contains zero or more format items, to this instance. Each format item is replaced by the string representation of a single argument using a specified format provider. - An object that supplies culture-specific formatting information. - A composite format string. - The object to format. - A reference to this instance after the append operation has completed. After the append operation, this instance contains any data that existed before the operation, suffixed by a copy of format in which any format specification is replaced by the string representation of arg0. - format is null. - format is invalid. -or- The index of a format item is less than 0 (zero), or greater than or equal to one (1). - The length of the expanded string would exceed . - - - Appends the string returned by processing a composite format string, which contains zero or more format items, to this instance. Each format item is replaced by the string representation of a corresponding argument in a parameter array using a specified format provider. - An object that supplies culture-specific formatting information. - A composite format string. - An array of objects to format. - A reference to this instance after the append operation has completed. After the append operation, this instance contains any data that existed before the operation, suffixed by a copy of format where any format specification is replaced by the string representation of the corresponding object argument. - format is null. - format is invalid. -or- The index of a format item is less than 0 (zero), or greater than or equal to the length of the args array. - The length of the expanded string would exceed . - - - Appends the string returned by processing a composite format string, which contains zero or more format items, to this instance. Each format item is replaced by the string representation of either of two arguments. - A composite format string. - The first object to format. - The second object to format. - A reference to this instance with format appended. Each format item in format is replaced by the string representation of the corresponding object argument. - format is null. - format is invalid. -or- The index of a format item is less than 0 (zero), or greater than or equal to 2. - The length of the expanded string would exceed . - - - Appends the string returned by processing a composite format string, which contains zero or more format items, to this instance. Each format item is replaced by the string representation of either of two arguments using a specified format provider. - An object that supplies culture-specific formatting information. - A composite format string. - The first object to format. - The second object to format. - A reference to this instance after the append operation has completed. After the append operation, this instance contains any data that existed before the operation, suffixed by a copy of format where any format specification is replaced by the string representation of the corresponding object argument. - format is null. - format is invalid. -or- The index of a format item is less than 0 (zero), or greater than or equal to 2 (two). - The length of the expanded string would exceed . - - - Appends the string returned by processing a composite format string, which contains zero or more format items, to this instance. Each format item is replaced by the string representation of either of three arguments. - A composite format string. - The first object to format. - The second object to format. - The third object to format. - A reference to this instance with format appended. Each format item in format is replaced by the string representation of the corresponding object argument. - format is null. - format is invalid. -or- The index of a format item is less than 0 (zero), or greater than or equal to 3. - The length of the expanded string would exceed . - - - Appends the default line terminator to the end of the current object. - A reference to this instance after the append operation has completed. - Enlarging the value of this instance would exceed . - - - Appends a copy of the specified string followed by the default line terminator to the end of the current object. - The string to append. - A reference to this instance after the append operation has completed. - Enlarging the value of this instance would exceed . - - - Gets or sets the maximum number of characters that can be contained in the memory allocated by the current instance. - The maximum number of characters that can be contained in the memory allocated by the current instance. Its value can range from to . - The value specified for a set operation is less than the current length of this instance. -or- The value specified for a set operation is greater than the maximum capacity. - - - Gets or sets the character at the specified character position in this instance. - The position of the character. - The Unicode character at position index. - index is outside the bounds of this instance while setting a character. - index is outside the bounds of this instance while getting a character. - - - Removes all characters from the current instance. - An object whose is 0 (zero). - - - Copies the characters from a specified segment of this instance to a specified segment of a destination array. - The starting position in this instance where characters will be copied from. The index is zero-based. - The array where characters will be copied. - The starting position in destination where characters will be copied. The index is zero-based. - The number of characters to be copied. - destination is null. - sourceIndex, destinationIndex, or count, is less than zero. -or- sourceIndex is greater than the length of this instance. - sourceIndex + count is greater than the length of this instance. -or- destinationIndex + count is greater than the length of destination. - - - Ensures that the capacity of this instance of is at least the specified value. - The minimum capacity to ensure. - The new capacity of this instance. - capacity is less than zero. -or- Enlarging the value of this instance would exceed . - - - Returns a value indicating whether this instance is equal to a specified object. - An object to compare with this instance, or null. - true if this instance and sb have equal string, , and values; otherwise, false. - - - Inserts one or more copies of a specified string into this instance at the specified character position. - The position in this instance where insertion begins. - The string to insert. - The number of times to insert value. - A reference to this instance after insertion has completed. - index is less than zero or greater than the current length of this instance. -or- count is less than zero. - The current length of this object plus the length of value times count exceeds . - - - Inserts the string representation of a 64-bit unsigned integer into this instance at the specified character position. - The position in this instance where insertion begins. - The value to insert. - A reference to this instance after the insert operation has completed. - index is less than zero or greater than the length of this instance. - Enlarging the value of this instance would exceed . - - - Inserts the string representation of a 32-bit unsigned integer into this instance at the specified character position. - The position in this instance where insertion begins. - The value to insert. - A reference to this instance after the insert operation has completed. - index is less than zero or greater than the length of this instance. - Enlarging the value of this instance would exceed . - - - Inserts the string representation of a 16-bit unsigned integer into this instance at the specified character position. - The position in this instance where insertion begins. - The value to insert. - A reference to this instance after the insert operation has completed. - index is less than zero or greater than the length of this instance. - Enlarging the value of this instance would exceed . - - - Inserts a string into this instance at the specified character position. - The position in this instance where insertion begins. - The string to insert. - A reference to this instance after the insert operation has completed. - index is less than zero or greater than the current length of this instance. -or- The current length of this object plus the length of value exceeds . - - - Inserts the string representation of a single-precision floating point number into this instance at the specified character position. - The position in this instance where insertion begins. - The value to insert. - A reference to this instance after the insert operation has completed. - index is less than zero or greater than the length of this instance. - Enlarging the value of this instance would exceed . - - - Inserts the string representation of a specified 8-bit signed integer into this instance at the specified character position. - The position in this instance where insertion begins. - The value to insert. - A reference to this instance after the insert operation has completed. - index is less than zero or greater than the length of this instance. - Enlarging the value of this instance would exceed . - - - Inserts the string representation of a specified subarray of Unicode characters into this instance at the specified character position. - The position in this instance where insertion begins. - A character array. - The starting index within value. - The number of characters to insert. - A reference to this instance after the insert operation has completed. - value is null, and startIndex and charCount are not zero. - index, startIndex, or charCount is less than zero. -or- index is greater than the length of this instance. -or- startIndex plus charCount is not a position within value. -or- Enlarging the value of this instance would exceed . - - - Inserts the string representation of an object into this instance at the specified character position. - The position in this instance where insertion begins. - The object to insert, or null. - A reference to this instance after the insert operation has completed. - index is less than zero or greater than the length of this instance. - Enlarging the value of this instance would exceed . - - - Inserts the string representation of a specified 32-bit signed integer into this instance at the specified character position. - The position in this instance where insertion begins. - The value to insert. - A reference to this instance after the insert operation has completed. - index is less than zero or greater than the length of this instance. - Enlarging the value of this instance would exceed . - - - Inserts the string representation of a specified 16-bit signed integer into this instance at the specified character position. - The position in this instance where insertion begins. - The value to insert. - A reference to this instance after the insert operation has completed. - index is less than zero or greater than the length of this instance. - Enlarging the value of this instance would exceed . - - - Inserts the string representation of a double-precision floating-point number into this instance at the specified character position. - The position in this instance where insertion begins. - The value to insert. - A reference to this instance after the insert operation has completed. - index is less than zero or greater than the length of this instance. - Enlarging the value of this instance would exceed . - - - Inserts the string representation of a decimal number into this instance at the specified character position. - The position in this instance where insertion begins. - The value to insert. - A reference to this instance after the insert operation has completed. - index is less than zero or greater than the length of this instance. - Enlarging the value of this instance would exceed . - - - Inserts the string representation of a specified array of Unicode characters into this instance at the specified character position. - The position in this instance where insertion begins. - The character array to insert. - A reference to this instance after the insert operation has completed. - index is less than zero or greater than the length of this instance. -or- Enlarging the value of this instance would exceed . - - - Inserts the string representation of a specified Unicode character into this instance at the specified character position. - The position in this instance where insertion begins. - The value to insert. - A reference to this instance after the insert operation has completed. - index is less than zero or greater than the length of this instance. -or- Enlarging the value of this instance would exceed . - - - Inserts the string representation of a specified 8-bit unsigned integer into this instance at the specified character position. - The position in this instance where insertion begins. - The value to insert. - A reference to this instance after the insert operation has completed. - index is less than zero or greater than the length of this instance. - Enlarging the value of this instance would exceed . - - - Inserts the string representation of a Boolean value into this instance at the specified character position. - The position in this instance where insertion begins. - The value to insert. - A reference to this instance after the insert operation has completed. - index is less than zero or greater than the length of this instance. - Enlarging the value of this instance would exceed . - - - Inserts the string representation of a 64-bit signed integer into this instance at the specified character position. - The position in this instance where insertion begins. - The value to insert. - A reference to this instance after the insert operation has completed. - index is less than zero or greater than the length of this instance. - Enlarging the value of this instance would exceed . - - - Gets or sets the length of the current object. - The length of this instance. - The value specified for a set operation is less than zero or greater than . - - - Gets the maximum capacity of this instance. - The maximum number of characters this instance can hold. - - - Removes the specified range of characters from this instance. - - The number of characters to remove. - A reference to this instance after the excise operation has completed. - If startIndex or length is less than zero, or startIndex + length is greater than the length of this instance. - - - Replaces all occurrences of a specified character in this instance with another specified character. - The character to replace. - The character that replaces oldChar. - A reference to this instance with oldChar replaced by newChar. - - - Replaces all occurrences of a specified string in this instance with another specified string. - The string to replace. - The string that replaces oldValue, or null. - A reference to this instance with all instances of oldValue replaced by newValue. - oldValue is null. - The length of oldValue is zero. - Enlarging the value of this instance would exceed . - - - Replaces, within a substring of this instance, all occurrences of a specified character with another specified character. - The character to replace. - The character that replaces oldChar. - The position in this instance where the substring begins. - The length of the substring. - A reference to this instance with oldChar replaced by newChar in the range from startIndex to startIndex + count -1. - startIndex + count is greater than the length of the value of this instance. -or- startIndex or count is less than zero. - - - Replaces, within a substring of this instance, all occurrences of a specified string with another specified string. - The string to replace. - The string that replaces oldValue, or null. - The position in this instance where the substring begins. - The length of the substring. - A reference to this instance with all instances of oldValue replaced by newValue in the range from startIndex to startIndex + count - 1. - oldValue is null. - The length of oldValue is zero. - startIndex or count is less than zero. -or- startIndex plus count indicates a character position not within this instance. -or- Enlarging the value of this instance would exceed . - - - Converts the value of this instance to a . - A string whose value is the same as this instance. - - - Converts the value of a substring of this instance to a . - The starting position of the substring in this instance. - The length of the substring. - A string whose value is the same as the specified substring of this instance. - startIndex or length is less than zero. -or- The sum of startIndex and length is greater than the length of the current instance. - - - Populates a object with the data necessary to deserialize the current object. - The object to populate with serialization information. - The place to store and retrieve serialized data. Reserved for future use. - info is null. - - - Represents a UTF-16 encoding of Unicode characters. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. Parameters specify whether to use the big endian byte order and whether the method returns a Unicode byte order mark. - true to use the big endian byte order (most significant byte first), or false to use the little endian byte order (least significant byte first). - true to specify that the method returns a Unicode byte order mark; otherwise, false. - - - Initializes a new instance of the class. Parameters specify whether to use the big endian byte order, whether to provide a Unicode byte order mark, and whether to throw an exception when an invalid encoding is detected. - true to use the big endian byte order (most significant byte first); false to use the little endian byte order (least significant byte first). - true to specify that the method returns a Unicode byte order mark; otherwise, false. - true to specify that an exception should be thrown when an invalid encoding is detected; otherwise, false. - - - Represents the Unicode character size in bytes. This field is a constant. - - - - Determines whether the specified is equal to the current object. - The object to compare with the current object. - true if value is an instance of and is equal to the current object; otherwise, false. - - - Calculates the number of bytes produced by encoding the characters in the specified string. - The string that contains the set of characters to encode. - The number of bytes produced by encoding the specified characters. - s is null. - The resulting number of bytes is greater than the maximum number that can be returned as an integer. - Error detection is enabled, and s contains an invalid sequence of characters. - A fallback occurred (see Character Encoding in the .NET Framework for fuller explanation) -and- is set to . - - - Calculates the number of bytes produced by encoding a set of characters starting at the specified character pointer. - A pointer to the first character to encode. - The number of characters to encode. - The number of bytes produced by encoding the specified characters. - chars is null. - count is less than zero. -or- The resulting number of bytes is greater than the maximum number that can be returned as an integer. - Error detection is enabled and chars contains an invalid sequence of characters. - A fallback occurred (see Character Encoding in the .NET Framework for fuller explanation) -and- is set to . - - - Calculates the number of bytes produced by encoding a set of characters from the specified character array. - The character array containing the set of characters to encode. - The index of the first character to encode. - The number of characters to encode. - The number of bytes produced by encoding the specified characters. - chars is null (Nothing). - index or count is less than zero. -or- index and count do not denote a valid range in chars. -or- The resulting number of bytes is greater than the maximum number that can be returned as an integer. - Error detection is enabled, and chars contains an invalid sequence of characters. - A fallback occurred (see Character Encoding in the .NET Framework for fuller explanation) -and- is set to . - - - Encodes a set of characters from the specified character array into the specified byte array. - The character array containing the set of characters to encode. - The index of the first character to encode. - The number of characters to encode. - The byte array to contain the resulting sequence of bytes. - The index at which to start writing the resulting sequence of bytes. - The actual number of bytes written into bytes. - chars is null (Nothing). -or- bytes is null (Nothing). - charIndex or charCount or byteIndex is less than zero. -or- charIndex and charCount do not denote a valid range in chars. -or- byteIndex is not a valid index in bytes. - Error detection is enabled, and chars contains an invalid sequence of characters. -or- bytes does not have enough capacity from byteIndex to the end of the array to accommodate the resulting bytes. - A fallback occurred (see Character Encoding in the .NET Framework for fuller explanation) -and- is set to . - - - Encodes a set of characters from the specified into the specified byte array. - The string containing the set of characters to encode. - The index of the first character to encode. - The number of characters to encode. - The byte array to contain the resulting sequence of bytes. - The index at which to start writing the resulting sequence of bytes. - The actual number of bytes written into bytes. - s is null. -or- bytes is null (Nothing). - charIndex or charCount or byteIndex is less than zero. -or- charIndex and charCount do not denote a valid range in chars. -or- byteIndex is not a valid index in bytes. - Error detection is enabled, and s contains an invalid sequence of characters. -or- bytes does not have enough capacity from byteIndex to the end of the array to accommodate the resulting bytes. - A fallback occurred (see Character Encoding in the .NET Framework for fuller explanation) -and- is set to . - - - Encodes a set of characters starting at the specified character pointer into a sequence of bytes that are stored starting at the specified byte pointer. - A pointer to the first character to encode. - The number of characters to encode. - A pointer to the location at which to start writing the resulting sequence of bytes. - The maximum number of bytes to write. - The actual number of bytes written at the location indicated by the bytes parameter. - chars is null (Nothing). -or- bytes is null (Nothing). - charCount or byteCount is less than zero. - Error detection is enabled, and chars contains an invalid sequence of characters. -or- byteCount is less than the resulting number of bytes. - A fallback occurred (see Character Encoding in the .NET Framework for fuller explanation) -and- is set to . - - - Calculates the number of characters produced by decoding a sequence of bytes starting at the specified byte pointer. - A pointer to the first byte to decode. - The number of bytes to decode. - The number of characters produced by decoding the specified sequence of bytes. - bytes is null (Nothing). - count is less than zero. -or- The resulting number of bytes is greater than the maximum number that can be returned as an integer. - Error detection is enabled, and bytes contains an invalid sequence of bytes. - A fallback occurred (see Character Encoding in the .NET Framework for fuller explanation) -and- is set to . - - - Calculates the number of characters produced by decoding a sequence of bytes from the specified byte array. - The byte array containing the sequence of bytes to decode. - The index of the first byte to decode. - The number of bytes to decode. - The number of characters produced by decoding the specified sequence of bytes. - bytes is null (Nothing). - index or count is less than zero. -or- index and count do not denote a valid range in bytes. -or- The resulting number of bytes is greater than the maximum number that can be returned as an integer. - Error detection is enabled, and bytes contains an invalid sequence of bytes. - A fallback occurred (see Character Encoding in the .NET Framework for fuller explanation) -and- is set to . - - - Decodes a sequence of bytes starting at the specified byte pointer into a set of characters that are stored starting at the specified character pointer. - A pointer to the first byte to decode. - The number of bytes to decode. - A pointer to the location at which to start writing the resulting set of characters. - The maximum number of characters to write. - The actual number of characters written at the location indicated by the chars parameter. - bytes is null (Nothing). -or- chars is null (Nothing). - byteCount or charCount is less than zero. - Error detection is enabled, and bytes contains an invalid sequence of bytes. -or- charCount is less than the resulting number of characters. - A fallback occurred (see Character Encoding in the .NET Framework for fuller explanation) -and- is set to . - - - Decodes a sequence of bytes from the specified byte array into the specified character array. - The byte array containing the sequence of bytes to decode. - The index of the first byte to decode. - The number of bytes to decode. - The character array to contain the resulting set of characters. - The index at which to start writing the resulting set of characters. - The actual number of characters written into chars. - bytes is null (Nothing). -or- chars is null (Nothing). - byteIndex or byteCount or charIndex is less than zero. -or- byteindex and byteCount do not denote a valid range in bytes. -or- charIndex is not a valid index in chars. - Error detection is enabled, and bytes contains an invalid sequence of bytes. -or- chars does not have enough capacity from charIndex to the end of the array to accommodate the resulting characters. - A fallback occurred (see Character Encoding in the .NET Framework for fuller explanation) -and- is set to . - - - Obtains a decoder that converts a UTF-16 encoded sequence of bytes into a sequence of Unicode characters. - A that converts a UTF-16 encoded sequence of bytes into a sequence of Unicode characters. - - - Obtains an encoder that converts a sequence of Unicode characters into a UTF-16 encoded sequence of bytes. - A object that converts a sequence of Unicode characters into a UTF-16 encoded sequence of bytes. - - - Returns the hash code for the current instance. - The hash code for the current object. - - - Calculates the maximum number of bytes produced by encoding the specified number of characters. - The number of characters to encode. - The maximum number of bytes produced by encoding the specified number of characters. - charCount is less than zero. -or- The resulting number of bytes is greater than the maximum number that can be returned as an integer. - A fallback occurred (see Character Encoding in the .NET Framework for fuller explanation) -and- is set to . - - - Calculates the maximum number of characters produced by decoding the specified number of bytes. - The number of bytes to decode. - The maximum number of characters produced by decoding the specified number of bytes. - byteCount is less than zero. -or- The resulting number of bytes is greater than the maximum number that can be returned as an integer. - A fallback occurred (see Character Encoding in the .NET Framework for fuller explanation) -and- is set to . - - - Returns a Unicode byte order mark encoded in UTF-16 format, if the constructor for this instance requests a byte order mark. - A byte array containing the Unicode byte order mark, if the object is configured to supply one. Otherwise, this method returns a zero-length byte array. - - - Decodes a range of bytes from a byte array into a string. - The byte array containing the sequence of bytes to decode. - The index of the first byte to decode. - The number of bytes to decode. - A object containing the results of decoding the specified sequence of bytes. - bytes is null (Nothing). - index or count is less than zero. -or- index and count do not denote a valid range in bytes. - Error detection is enabled, and bytes contains an invalid sequence of bytes. - A fallback occurred (see Character Encoding in the .NET Framework for fuller explanation) -and- is set to . - - - Represents a UTF-32 encoding of Unicode characters. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. Parameters specify whether to use the big endian byte order and whether the method returns a Unicode Unicode byte order mark. - true to use the big endian byte order (most significant byte first), or false to use the little endian byte order (least significant byte first). - true to specify that a Unicode byte order mark is provided; otherwise, false. - - - Initializes a new instance of the class. Parameters specify whether to use the big endian byte order, whether to provide a Unicode byte order mark, and whether to throw an exception when an invalid encoding is detected. - true to use the big endian byte order (most significant byte first), or false to use the little endian byte order (least significant byte first). - true to specify that a Unicode byte order mark is provided; otherwise, false. - true to specify that an exception should be thrown when an invalid encoding is detected; otherwise, false. - - - Determines whether the specified is equal to the current object. - The to compare with the current object. - true if value is an instance of and is equal to the current object; otherwise, false. - - - Calculates the number of bytes produced by encoding the characters in the specified . - The containing the set of characters to encode. - The number of bytes produced by encoding the specified characters. - s is null. - The resulting number of bytes is greater than the maximum number that can be returned as an integer. - Error detection is enabled, and s contains an invalid sequence of characters. - A fallback occurred (see Character Encoding in the .NET Framework for complete explanation) -and- is set to . - - - Calculates the number of bytes produced by encoding a set of characters starting at the specified character pointer. - A pointer to the first character to encode. - The number of characters to encode. - The number of bytes produced by encoding the specified characters. - chars is null. - count is less than zero. -or- The resulting number of bytes is greater than the maximum number that can be returned as an integer. - Error detection is enabled, and chars contains an invalid sequence of characters. - A fallback occurred (see Character Encoding in the .NET Framework for complete explanation) -and- is set to . - - - Calculates the number of bytes produced by encoding a set of characters from the specified character array. - The character array containing the set of characters to encode. - The index of the first character to encode. - The number of characters to encode. - The number of bytes produced by encoding the specified characters. - chars is null. - index or count is less than zero. -or- index and count do not denote a valid range in chars. -or- The resulting number of bytes is greater than the maximum number that can be returned as an integer. - Error detection is enabled, and chars contains an invalid sequence of characters. - A fallback occurred (see Character Encoding in the .NET Framework for complete explanation) -and- is set to . - - - Encodes a set of characters starting at the specified character pointer into a sequence of bytes that are stored starting at the specified byte pointer. - A pointer to the first character to encode. - The number of characters to encode. - A pointer to the location at which to start writing the resulting sequence of bytes. - The maximum number of bytes to write. - The actual number of bytes written at the location indicated by the bytes parameter. - chars is null. -or- bytes is null. - charCount or byteCount is less than zero. - Error detection is enabled, and chars contains an invalid sequence of characters. -or- byteCount is less than the resulting number of bytes. - A fallback occurred (see Character Encoding in the .NET Framework for complete explanation) -and- is set to . - - - Encodes a set of characters from the specified character array into the specified byte array. - The character array containing the set of characters to encode. - The index of the first character to encode. - The number of characters to encode. - The byte array to contain the resulting sequence of bytes. - The index at which to start writing the resulting sequence of bytes. - The actual number of bytes written into bytes. - chars is null. -or- bytes is null. - charIndex or charCount or byteIndex is less than zero. -or- charIndex and charCount do not denote a valid range in chars. -or- byteIndex is not a valid index in bytes. - Error detection is enabled, and chars contains an invalid sequence of characters. -or- bytes does not have enough capacity from byteIndex to the end of the array to accommodate the resulting bytes. - A fallback occurred (see Character Encoding in the .NET Framework for complete explanation) -and- is set to . - - - Encodes a set of characters from the specified into the specified byte array. - The containing the set of characters to encode. - The index of the first character to encode. - The number of characters to encode. - The byte array to contain the resulting sequence of bytes. - The index at which to start writing the resulting sequence of bytes. - The actual number of bytes written into bytes. - s is null. -or- bytes is null. - charIndex or charCount or byteIndex is less than zero. -or- charIndex and charCount do not denote a valid range in chars. -or- byteIndex is not a valid index in bytes. - Error detection is enabled, and s contains an invalid sequence of characters. -or- bytes does not have enough capacity from byteIndex to the end of the array to accommodate the resulting bytes. - A fallback occurred (see Character Encoding in the .NET Framework for complete explanation) -and- is set to . - - - Calculates the number of characters produced by decoding a sequence of bytes from the specified byte array. - The byte array containing the sequence of bytes to decode. - The index of the first byte to decode. - The number of bytes to decode. - The number of characters produced by decoding the specified sequence of bytes. - bytes is null. - index or count is less than zero. -or- index and count do not denote a valid range in bytes. -or- The resulting number of bytes is greater than the maximum number that can be returned as an integer. - Error detection is enabled, and bytes contains an invalid sequence of bytes. - A fallback occurred (see Character Encoding in the .NET Framework for complete explanation) -and- is set to . - - - Calculates the number of characters produced by decoding a sequence of bytes starting at the specified byte pointer. - A pointer to the first byte to decode. - The number of bytes to decode. - The number of characters produced by decoding the specified sequence of bytes. - bytes is null. - count is less than zero. -or- The resulting number of bytes is greater than the maximum number that can be returned as an integer. - Error detection is enabled, and bytes contains an invalid sequence of bytes. - A fallback occurred (see Character Encoding in the .NET Framework for complete explanation) -and- is set to . - - - Decodes a sequence of bytes starting at the specified byte pointer into a set of characters that are stored starting at the specified character pointer. - A pointer to the first byte to decode. - The number of bytes to decode. - A pointer to the location at which to start writing the resulting set of characters. - The maximum number of characters to write. - The actual number of characters written at the location indicated by chars. - bytes is null. -or- chars is null. - byteCount or charCount is less than zero. - Error detection is enabled, and bytes contains an invalid sequence of bytes. -or- charCount is less than the resulting number of characters. - A fallback occurred (see Character Encoding in the .NET Framework for complete explanation) -and- is set to . - - - Decodes a sequence of bytes from the specified byte array into the specified character array. - The byte array containing the sequence of bytes to decode. - The index of the first byte to decode. - The number of bytes to decode. - The character array to contain the resulting set of characters. - The index at which to start writing the resulting set of characters. - The actual number of characters written into chars. - bytes is null. -or- chars is null. - byteIndex or byteCount or charIndex is less than zero. -or- byteindex and byteCount do not denote a valid range in bytes. -or- charIndex is not a valid index in chars. - Error detection is enabled, and bytes contains an invalid sequence of bytes. -or- chars does not have enough capacity from charIndex to the end of the array to accommodate the resulting characters. - A fallback occurred (see Character Encoding in the .NET Framework for complete explanation) -and- is set to . - - - Obtains a decoder that converts a UTF-32 encoded sequence of bytes into a sequence of Unicode characters. - A that converts a UTF-32 encoded sequence of bytes into a sequence of Unicode characters. - - - Obtains an encoder that converts a sequence of Unicode characters into a UTF-32 encoded sequence of bytes. - A that converts a sequence of Unicode characters into a UTF-32 encoded sequence of bytes. - - - Returns the hash code for the current instance. - The hash code for the current object. - - - Calculates the maximum number of bytes produced by encoding the specified number of characters. - The number of characters to encode. - The maximum number of bytes produced by encoding the specified number of characters. - charCount is less than zero. -or- The resulting number of bytes is greater than the maximum number that can be returned as an integer. - A fallback occurred (see Character Encoding in the .NET Framework for complete explanation) -and- is set to . - - - Calculates the maximum number of characters produced by decoding the specified number of bytes. - The number of bytes to decode. - The maximum number of characters produced by decoding the specified number of bytes. - byteCount is less than zero. -or- The resulting number of bytes is greater than the maximum number that can be returned as an integer. - A fallback occurred (see Character Encoding in the .NET Framework for complete explanation) -and- is set to . - - - Returns a Unicode byte order mark encoded in UTF-32 format, if the object is configured to supply one. - A byte array containing the Unicode byte order mark, if the object is configured to supply one. Otherwise, this method returns a zero-length byte array. - - - Decodes a range of bytes from a byte array into a string. - The byte array containing the sequence of bytes to decode. - The index of the first byte to decode. - The number of bytes to decode. - A string that contains the results of decoding the specified sequence of bytes. - bytes is null. - index or count is less than zero. -or- index and count do not denote a valid range in bytes. - Error detection is enabled, and bytes contains an invalid sequence of bytes. - A fallback occurred (see Character Encoding in the .NET Framework for a complete explanation) -and- is set to . - - - Represents a UTF-7 encoding of Unicode characters. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. A parameter specifies whether to allow optional characters. - true to specify that optional characters are allowed; otherwise, false. - - - Gets a value indicating whether the specified object is equal to the current object. - An object to compare to the current object. - true if value is a object and is equal to the current object; otherwise, false. - - - Calculates the number of bytes produced by encoding the characters in the specified object. - The object containing the set of characters to encode. - The number of bytes produced by encoding the specified characters. - s is null (Nothing). - The resulting number of bytes is greater than the maximum number that can be returned as an int. - A fallback occurred (see Character Encoding in the .NET Framework for fuller explanation) -and- is set to . - - - Calculates the number of bytes produced by encoding a set of characters starting at the specified character pointer. - A pointer to the first character to encode. - The number of characters to encode. - The number of bytes produced by encoding the specified characters. - chars is null (Nothing in Visual Basic .NET). - count is less than zero. -or- The resulting number of bytes is greater than the maximum number that can be returned as an int. - A fallback occurred (see Character Encoding in the .NET Framework for complete explanation) -and- is set to . - - - Calculates the number of bytes produced by encoding a set of characters from the specified character array. - The character array containing the set of characters to encode. - The index of the first character to encode. - The number of characters to encode. - The number of bytes produced by encoding the specified characters. - chars is null (Nothing). - index or count is less than zero. -or- index and count do not denote a valid range in chars. -or- The resulting number of bytes is greater than the maximum number that can be returned as an int. - A fallback occurred (see Character Encoding in the .NET Framework for complete explanation) -and- is set to . - - - Encodes a set of characters starting at the specified character pointer into a sequence of bytes that are stored starting at the specified byte pointer. - A pointer to the first character to encode. - The number of characters to encode. - A pointer to the location at which to start writing the resulting sequence of bytes. - The maximum number of bytes to write. - The actual number of bytes written at the location indicated by bytes. - chars is null (Nothing). -or- bytes is null (Nothing). - charCount or byteCount is less than zero. - byteCount is less than the resulting number of bytes. - A fallback occurred (see Character Encoding in the .NET Framework for fuller explanation) -and- is set to . - - - Encodes a set of characters from the specified character array into the specified byte array. - The character array containing the set of characters to encode. - The index of the first character to encode. - The number of characters to encode. - The byte array to contain the resulting sequence of bytes. - The index at which to start writing the resulting sequence of bytes. - The actual number of bytes written into bytes. - chars is null (Nothing). -or- bytes is null (Nothing). - charIndex or charCount or byteIndex is less than zero. -or- charIndex and charCount do not denote a valid range in chars. -or- byteIndex is not a valid index in bytes. - bytes does not have enough capacity from byteIndex to the end of the array to accommodate the resulting bytes. - A fallback occurred (see Character Encoding in the .NET Framework for fuller explanation) -and- is set to . - - - Encodes a set of characters from the specified into the specified byte array. - The containing the set of characters to encode. - The index of the first character to encode. - The number of characters to encode. - The byte array to contain the resulting sequence of bytes. - The index at which to start writing the resulting sequence of bytes. - The actual number of bytes written into bytes. - s is null (Nothing). -or- bytes is null (Nothing). - charIndex or charCount or byteIndex is less than zero. -or- charIndex and charCount do not denote a valid range in chars. -or- byteIndex is not a valid index in bytes. - bytes does not have enough capacity from byteIndex to the end of the array to accommodate the resulting bytes. - A fallback occurred (see Character Encoding in the .NET Framework for fuller explanation) -and- is set to . - - - Calculates the number of characters produced by decoding a sequence of bytes from the specified byte array. - The byte array containing the sequence of bytes to decode. - The index of the first byte to decode. - The number of bytes to decode. - The number of characters produced by decoding the specified sequence of bytes. - bytes is null (Nothing). - index or count is less than zero. -or- index and count do not denote a valid range in bytes. -or- The resulting number of characters is greater than the maximum number that can be returned as an int. - A fallback occurred (see Character Encoding in the .NET Framework for complete explanation) -and- is set to . - - - Calculates the number of characters produced by decoding a sequence of bytes starting at the specified byte pointer. - A pointer to the first byte to decode. - The number of bytes to decode. - The number of characters produced by decoding the specified sequence of bytes. - bytes is null (Nothing). - count is less than zero. -or- The resulting number of characters is greater than the maximum number that can be returned as an int. - A fallback occurred (see Character Encoding in the .NET Framework for fuller explanation) -and- is set to . - - - Decodes a sequence of bytes starting at the specified byte pointer into a set of characters that are stored starting at the specified character pointer. - A pointer to the first byte to decode. - The number of bytes to decode. - A pointer to the location at which to start writing the resulting set of characters. - The maximum number of characters to write. - The actual number of characters written at the location indicated by chars. - bytes is null (Nothing). -or- chars is null (Nothing). - byteCount or charCount is less than zero. - charCount is less than the resulting number of characters. - A fallback occurred (see Character Encoding in the .NET Framework for complete explanation) -and- is set to . - - - Decodes a sequence of bytes from the specified byte array into the specified character array. - The byte array containing the sequence of bytes to decode. - The index of the first byte to decode. - The number of bytes to decode. - The character array to contain the resulting set of characters. - The index at which to start writing the resulting set of characters. - The actual number of characters written into chars. - bytes is null (Nothing). -or- chars is null (Nothing). - byteIndex or byteCount or charIndex is less than zero. -or- byteindex and byteCount do not denote a valid range in bytes. -or- charIndex is not a valid index in chars. - chars does not have enough capacity from charIndex to the end of the array to accommodate the resulting characters. - A fallback occurred (see Character Encoding in the .NET Framework for complete explanation) -and- is set to . - - - Obtains a decoder that converts a UTF-7 encoded sequence of bytes into a sequence of Unicode characters. - A that converts a UTF-7 encoded sequence of bytes into a sequence of Unicode characters. - - - Obtains an encoder that converts a sequence of Unicode characters into a UTF-7 encoded sequence of bytes. - A that converts a sequence of Unicode characters into a UTF-7 encoded sequence of bytes. - - - Returns the hash code for the current object. - A 32-bit signed integer hash code. - - - Calculates the maximum number of bytes produced by encoding the specified number of characters. - The number of characters to encode. - The maximum number of bytes produced by encoding the specified number of characters. - charCount is less than zero. -or- The resulting number of bytes is greater than the maximum number that can be returned as an int. - A fallback occurred (see Character Encoding in the .NET Framework for complete explanation) -and- is set to . - - - Calculates the maximum number of characters produced by decoding the specified number of bytes. - The number of bytes to decode. - The maximum number of characters produced by decoding the specified number of bytes. - byteCount is less than zero. -or- The resulting number of characters is greater than the maximum number that can be returned as an int. - A fallback occurred (see Character Encoding in the .NET Framework for complete explanation) -and- is set to . - - - Decodes a range of bytes from a byte array into a string. - The byte array containing the sequence of bytes to decode. - The index of the first byte to decode. - The number of bytes to decode. - A containing the results of decoding the specified sequence of bytes. - bytes is null (Nothing). - index or count is less than zero. -or- index and count do not denote a valid range in bytes. - A fallback occurred (see Character Encoding in the .NET Framework for fuller explanation) -and- is set to . - - - Represents a UTF-8 encoding of Unicode characters. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. A parameter specifies whether to provide a Unicode byte order mark. - true to specify that the method returns a Unicode byte order mark; otherwise, false. - - - Initializes a new instance of the class. Parameters specify whether to provide a Unicode byte order mark and whether to throw an exception when an invalid encoding is detected. - true to specify that the method should return a Unicode byte order mark; otherwise, false. - true to throw an exception when an invalid encoding is detected; otherwise, false. - - - Determines whether the specified object is equal to the current object. - The object to compare with the current instance. - true if value is an instance of and is equal to the current object; otherwise, false. - - - Calculates the number of bytes produced by encoding the characters in the specified . - The containing the set of characters to encode. - The number of bytes produced by encoding the specified characters. - chars is null. - The resulting number of bytes is greater than the maximum number that can be returned as an integer. - Error detection is enabled, and chars contains an invalid sequence of characters. - A fallback occurred (see Character Encoding in the .NET Framework for complete explanation) -and- is set to . - - - Calculates the number of bytes produced by encoding a set of characters starting at the specified character pointer. - A pointer to the first character to encode. - The number of characters to encode. - The number of bytes produced by encoding the specified characters. - chars is null. - count is less than zero. -or- The resulting number of bytes is greater than the maximum number that can be returned as an integer. - Error detection is enabled, and chars contains an invalid sequence of characters. - A fallback occurred (see Character Encoding in the .NET Framework for a complete explanation) -and- is set to . - - - Calculates the number of bytes produced by encoding a set of characters from the specified character array. - The character array containing the set of characters to encode. - The index of the first character to encode. - The number of characters to encode. - The number of bytes produced by encoding the specified characters. - chars is null. - index or count is less than zero. -or- index and count do not denote a valid range in chars. -or- The resulting number of bytes is greater than the maximum number that can be returned as an integer. - Error detection is enabled, and chars contains an invalid sequence of characters. - A fallback occurred (see Character Encoding in the .NET Framework for complete explanation) -and- The property is set to . - - - Encodes a set of characters starting at the specified character pointer into a sequence of bytes that are stored starting at the specified byte pointer. - A pointer to the first character to encode. - The number of characters to encode. - A pointer to the location at which to start writing the resulting sequence of bytes. - The maximum number of bytes to write. - The actual number of bytes written at the location indicated by bytes. - chars is null. -or- bytes is null. - charCount or byteCount is less than zero. - Error detection is enabled, and chars contains an invalid sequence of characters. -or- byteCount is less than the resulting number of bytes. - A fallback occurred (see Character Encoding in the .NET Framework for complete explanation) -and- is set to . - - - Encodes a set of characters from the specified character array into the specified byte array. - The character array containing the set of characters to encode. - The index of the first character to encode. - The number of characters to encode. - The byte array to contain the resulting sequence of bytes. - The index at which to start writing the resulting sequence of bytes. - The actual number of bytes written into bytes. - chars is null. -or- bytes is null. - charIndex or charCount or byteIndex is less than zero. -or- charIndex and charCount do not denote a valid range in chars. -or- byteIndex is not a valid index in bytes. - Error detection is enabled, and chars contains an invalid sequence of characters. -or- bytes does not have enough capacity from byteIndex to the end of the array to accommodate the resulting bytes. - A fallback occurred (see Character Encoding in the .NET Framework for complete explanation) -and- is set to . - - - Encodes a set of characters from the specified into the specified byte array. - The containing the set of characters to encode. - The index of the first character to encode. - The number of characters to encode. - The byte array to contain the resulting sequence of bytes. - The index at which to start writing the resulting sequence of bytes. - The actual number of bytes written into bytes. - s is null. -or- bytes is null. - charIndex or charCount or byteIndex is less than zero. -or- charIndex and charCount do not denote a valid range in chars. -or- byteIndex is not a valid index in bytes. - Error detection is enabled, and s contains an invalid sequence of characters. -or- bytes does not have enough capacity from byteIndex to the end of the array to accommodate the resulting bytes. - A fallback occurred (see Character Encoding in the .NET Framework for complete explanation) -and- is set to . - - - Calculates the number of characters produced by decoding a sequence of bytes from the specified byte array. - The byte array containing the sequence of bytes to decode. - The index of the first byte to decode. - The number of bytes to decode. - The number of characters produced by decoding the specified sequence of bytes. - bytes is null. - index or count is less than zero. -or- index and count do not denote a valid range in bytes. -or- The resulting number of bytes is greater than the maximum number that can be returned as an integer. - Error detection is enabled, and bytes contains an invalid sequence of bytes. - A fallback occurred (see Character Encoding in the .NET Framework for complete explanation) -and- is set to . - - - Calculates the number of characters produced by decoding a sequence of bytes starting at the specified byte pointer. - A pointer to the first byte to decode. - The number of bytes to decode. - The number of characters produced by decoding the specified sequence of bytes. - bytes is null. - count is less than zero. -or- The resulting number of bytes is greater than the maximum number that can be returned as an integer. - Error detection is enabled, and bytes contains an invalid sequence of bytes. - A fallback occurred (see Character Encoding in the .NET Framework for complete explanation) -and- is set to . - - - Decodes a sequence of bytes starting at the specified byte pointer into a set of characters that are stored starting at the specified character pointer. - A pointer to the first byte to decode. - The number of bytes to decode. - A pointer to the location at which to start writing the resulting set of characters. - The maximum number of characters to write. - The actual number of characters written at the location indicated by chars. - bytes is null. -or- chars is null. - byteCount or charCount is less than zero. - Error detection is enabled, and bytes contains an invalid sequence of bytes. -or- charCount is less than the resulting number of characters. - A fallback occurred (see Character Encoding in the .NET Framework for complete explanation) -and- is set to . - - - Decodes a sequence of bytes from the specified byte array into the specified character array. - The byte array containing the sequence of bytes to decode. - The index of the first byte to decode. - The number of bytes to decode. - The character array to contain the resulting set of characters. - The index at which to start writing the resulting set of characters. - The actual number of characters written into chars. - bytes is null. -or- chars is null. - byteIndex or byteCount or charIndex is less than zero. -or- byteindex and byteCount do not denote a valid range in bytes. -or- charIndex is not a valid index in chars. - Error detection is enabled, and bytes contains an invalid sequence of bytes. -or- chars does not have enough capacity from charIndex to the end of the array to accommodate the resulting characters. - A fallback occurred (see Character Encoding in the .NET Framework for complete explanation) -and- is set to . - - - Obtains a decoder that converts a UTF-8 encoded sequence of bytes into a sequence of Unicode characters. - A decoder that converts a UTF-8 encoded sequence of bytes into a sequence of Unicode characters. - - - Obtains an encoder that converts a sequence of Unicode characters into a UTF-8 encoded sequence of bytes. - A that converts a sequence of Unicode characters into a UTF-8 encoded sequence of bytes. - - - Returns the hash code for the current instance. - The hash code for the current instance. - - - Calculates the maximum number of bytes produced by encoding the specified number of characters. - The number of characters to encode. - The maximum number of bytes produced by encoding the specified number of characters. - charCount is less than zero. -or- The resulting number of bytes is greater than the maximum number that can be returned as an integer. - A fallback occurred (see Character Encoding in the .NET Framework for complete explanation) -and- is set to . - - - Calculates the maximum number of characters produced by decoding the specified number of bytes. - The number of bytes to decode. - The maximum number of characters produced by decoding the specified number of bytes. - byteCount is less than zero. -or- The resulting number of bytes is greater than the maximum number that can be returned as an integer. - A fallback occurred (see Character Encoding in the .NET Framework for complete explanation) -and- is set to . - - - Returns a Unicode byte order mark encoded in UTF-8 format, if the encoding object is configured to supply one. - A byte array containing the Unicode byte order mark, if the encoding object is configured to supply one. Otherwise, this method returns a zero-length byte array. - - - Decodes a range of bytes from a byte array into a string. - The byte array containing the sequence of bytes to decode. - The index of the first byte to decode. - The number of bytes to decode. - A containing the results of decoding the specified sequence of bytes. - bytes is null. - index or count is less than zero. -or- index and count do not denote a valid range in bytes. - Error detection is enabled, and bytes contains an invalid sequence of bytes. - A fallback occurred (see Character Encoding in the .NET Framework for complete explanation) -and- is set to . - - - The exception that is thrown when one thread acquires a object that another thread has abandoned by exiting without releasing it. - - - Initializes a new instance of the class with default values. - - - Initializes a new instance of the class with a specified error message. - An error message that explains the reason for the exception. - - - Initializes a new instance of the class with a specified index for the abandoned mutex, if applicable, and a object that represents the mutex. - The index of the abandoned mutex in the array of wait handles if the exception is thrown for the method, or –1 if the exception is thrown for the or methods. - A object that represents the abandoned mutex. - - - Initializes a new instance of the class with serialized data. - The object that holds the serialized object data about the exception being thrown. - The object that contains contextual information about the source or destination. - - - Initializes a new instance of the class with a specified error message and inner exception. - An error message that explains the reason for the exception. - The exception that is the cause of the current exception. If the inner parameter is not null, the current exception is raised in a catch block that handles the inner exception. - - - Initializes a new instance of the class with a specified error message, the index of the abandoned mutex, if applicable, and the abandoned mutex. - An error message that explains the reason for the exception. - The index of the abandoned mutex in the array of wait handles if the exception is thrown for the method, or –1 if the exception is thrown for the or methods. - A object that represents the abandoned mutex. - - - Initializes a new instance of the class with a specified error message, the inner exception, the index for the abandoned mutex, if applicable, and a object that represents the mutex. - An error message that explains the reason for the exception. - The exception that is the cause of the current exception. If the inner parameter is not null, the current exception is raised in a catch block that handles the inner exception. - The index of the abandoned mutex in the array of wait handles if the exception is thrown for the method, or –1 if the exception is thrown for the or methods. - A object that represents the abandoned mutex. - - - Gets the abandoned mutex that caused the exception, if known. - A object that represents the abandoned mutex, or null if the abandoned mutex could not be identified. - - - Gets the index of the abandoned mutex that caused the exception, if known. - The index, in the array of wait handles passed to the method, of the object that represents the abandoned mutex, or –1 if the index of the abandoned mutex could not be determined. - - - Specifies the apartment state of a . - - - The will create and enter a multithreaded apartment. - - - - The will create and enter a single-threaded apartment. - - - - The property has not been set. - - - - Provides the functionality to restore the migration, or flow, of the execution context between threads. - - - Releases all resources used by the current instance of the class. - The structure is not used on the thread where it was created. -or- The structure has already been used to call or . - - - Determines whether the specified object is equal to the current structure. - An object to compare with the current structure. - true if obj is an structure and is equal to the current structure; otherwise, false. - - - Determines whether the specified structure is equal to the current structure. - An structure to compare with the current structure. - true if obj is equal to the current structure; otherwise, false. - - - Gets a hash code for the current structure. - A hash code for the current structure. - - - Compares two structures to determine whether they are equal. - An structure. - An structure. - true if the two structures are equal; otherwise, false. - - - Compares two structures to determine whether they are not equal. - An structure. - An structure. - true if the structures are not equal; otherwise, false. - - - Restores the flow of the execution context between threads. - The structure is not used on the thread where it was created. -or- The structure has already been used to call or . - - - Represents ambient data that is local to a given asynchronous control flow, such as an asynchronous method. - The type of the ambient data. - - - Instantiates an instance that does not receive change notifications. - - - Instantiates an local instance that receives change notifications. - The delegate that is called whenever the current value changes on any thread. - - - Gets or sets the value of the ambient data. - The value of the ambient data. - - - The class that provides data change information to instances that register for change notifications. - The type of the data. - - - Gets the data's current value. - The data's current value. - - - Gets the data's previous value. - The data's previous value. - - - Returns a value that indicates whether the value changes because of a change of execution context. - true if the value changed because of a change of execution context; otherwise, false. - - - Notifies a waiting thread that an event has occurred. This class cannot be inherited. - - - Initializes a new instance of the class with a Boolean value indicating whether to set the initial state to signaled. - true to set the initial state to signaled; false to set the initial state to non-signaled. - - - Enables multiple tasks to cooperatively work on an algorithm in parallel through multiple phases. - - - Initializes a new instance of the class. - The number of participating threads. - participantCount is less than 0 or greater than 32,767. - - - Initializes a new instance of the class. - The number of participating threads. - The to be executed after each phase. null (Nothing in Visual Basic) may be passed to indicate no action is taken. - participantCount is less than 0 or greater than 32,767. - - - Notifies the that there will be an additional participant. - The phase number of the barrier in which the new participants will first participate. - The current instance has already been disposed. - Adding a participant would cause the barrier's participant count to exceed 32,767. -or- The method was invoked from within a post-phase action. - - - Notifies the that there will be additional participants. - The number of additional participants to add to the barrier. - The phase number of the barrier in which the new participants will first participate. - The current instance has already been disposed. - participantCount is less than 0. -or- Adding participantCount participants would cause the barrier's participant count to exceed 32,767. - The method was invoked from within a post-phase action. - - - Gets the number of the barrier's current phase. - Returns the number of the barrier's current phase. - - - Releases all resources used by the current instance of the class. - The method was invoked from within a post-phase action. - - - Releases the unmanaged resources used by the , and optionally releases the managed resources. - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - Gets the total number of participants in the barrier. - Returns the total number of participants in the barrier. - - - Gets the number of participants in the barrier that haven’t yet signaled in the current phase. - Returns the number of participants in the barrier that haven’t yet signaled in the current phase. - - - Notifies the that there will be one less participant. - The current instance has already been disposed. - The barrier already has 0 participants. -or- The method was invoked from within a post-phase action. - - - Notifies the that there will be fewer participants. - The number of additional participants to remove from the barrier. - The current instance has already been disposed. - The total participant count is less than the specified participantCount - The barrier already has 0 participants. -or- The method was invoked from within a post-phase action. -or- current participant count is less than the specified participantCount - - - Signals that a participant has reached the barrier and waits for all other participants to reach the barrier as well. - The current instance has already been disposed. - The method was invoked from within a post-phase action, the barrier currently has 0 participants, or the barrier is signaled by more threads than are registered as participants. - If an exception is thrown from the post phase action of a Barrier after all participating threads have called SignalAndWait, the exception will be wrapped in a BarrierPostPhaseException and be thrown on all participating threads. - - - Signals that a participant has reached the barrier and waits for all other participants to reach the barrier as well, using a 32-bit signed integer to measure the timeout. - The number of milliseconds to wait, or (-1) to wait indefinitely. - if all participants reached the barrier within the specified time; otherwise false. - The current instance has already been disposed. - millisecondsTimeout is a negative number other than -1, which represents an infinite time-out. - The method was invoked from within a post-phase action, the barrier currently has 0 participants, or the barrier is signaled by more threads than are registered as participants. - If an exception is thrown from the post phase action of a Barrier after all participating threads have called SignalAndWait, the exception will be wrapped in a BarrierPostPhaseException and be thrown on all participating threads. - - - Signals that a participant has reached the barrier and waits for all other participants to reach the barrier, while observing a cancellation token. - The to observe. - cancellationToken has been canceled. - The current instance has already been disposed. - The method was invoked from within a post-phase action, the barrier currently has 0 participants, or the barrier is signaled by more threads than are registered as participants. - - - Signals that a participant has reached the barrier and waits for all other participants to reach the barrier as well, using a object to measure the time interval. - A that represents the number of milliseconds to wait, or a that represents -1 milliseconds to wait indefinitely. - true if all other participants reached the barrier; otherwise, false. - The current instance has already been disposed. - timeout is a negative number other than -1 milliseconds, which represents an infinite time-out, or it is greater than 32,767. - The method was invoked from within a post-phase action, the barrier currently has 0 participants, or the barrier is signaled by more threads than are registered as participants. - - - Signals that a participant has reached the barrier and waits for all other participants to reach the barrier as well, using a 32-bit signed integer to measure the timeout, while observing a cancellation token. - The number of milliseconds to wait, or (-1) to wait indefinitely. - The to observe. - if all participants reached the barrier within the specified time; otherwise false - cancellationToken has been canceled. - The current instance has already been disposed. - millisecondsTimeout is a negative number other than -1, which represents an infinite time-out. - The method was invoked from within a post-phase action, the barrier currently has 0 participants, or the barrier is signaled by more threads than are registered as participants. - - - Signals that a participant has reached the barrier and waits for all other participants to reach the barrier as well, using a object to measure the time interval, while observing a cancellation token. - A that represents the number of milliseconds to wait, or a that represents -1 milliseconds to wait indefinitely. - The to observe. - true if all other participants reached the barrier; otherwise, false. - cancellationToken has been canceled. - The current instance has already been disposed. - timeout is a negative number other than -1 milliseconds, which represents an infinite time-out. - The method was invoked from within a post-phase action, the barrier currently has 0 participants, or the barrier is signaled by more threads than are registered as participants. - - - The exception that is thrown when the post-phase action of a fails - - - Initializes a new instance of the class with a system-supplied message that describes the error. - - - Initializes a new instance of the class with the specified inner exception. - The exception that is the cause of the current exception. - - - Initializes a new instance of the class with a specified message that describes the error. - The message that describes the exception. The caller of this constructor is required to ensure that this string has been localized for the current system culture. - - - Initializes a new instance of the class with serialized data. - The object that holds the serialized object data. - The contextual information about the source or destination. - - - Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. - The message that describes the exception. The caller of this constructor is required to ensure that this string has been localized for the current system culture. - The exception that is the cause of the current exception. If the innerException parameter is not null, the current exception is raised in a catch block that handles the inner exception. - - - Propagates notification that operations should be canceled. - - - Initializes the . - The canceled state for the token. - - - Gets whether this token is capable of being in the canceled state. - true if this token is capable of being in the canceled state; otherwise, false. - - - Determines whether the current instance is equal to the specified . - The other object to which to compare this instance. - true if other is a and if the two instances are equal; otherwise, false. Two tokens are equal if they are associated with the same or if they were both constructed from public constructors and their values are equal. - An associated has been disposed. - - - Determines whether the current instance is equal to the specified token. - The other to which to compare this instance. - true if the instances are equal; otherwise, false. Two tokens are equal if they are associated with the same or if they were both constructed from public constructors and their values are equal. - - - Serves as a hash function for a . - A hash code for the current instance. - - - Gets whether cancellation has been requested for this token. - true if cancellation has been requested for this token; otherwise, false. - - - Returns an empty value. - An empty cancellation token. - - - Determines whether two instances are equal. - The first instance. - The second instance. - true if the instances are equal; otherwise, false. - An associated has been disposed. - - - Determines whether two instances are not equal. - The first instance. - The second instance. - true if the instances are not equal; otherwise, false. - An associated has been disposed. - - - Registers a delegate that will be called when this is canceled. - The delegate to be executed when the is canceled. - The instance that can be used to deregister the callback. - The associated has been disposed. - callback is null. - - - Registers a delegate that will be called when this is canceled. - The delegate to be executed when the is canceled. - A value that indicates whether to capture the current and use it when invoking the callback. - The instance that can be used to deregister the callback. - The associated has been disposed. - callback is null. - - - Registers a delegate that will be called when this is canceled. - The delegate to be executed when the is canceled. - The state to pass to the callback when the delegate is invoked. This may be null. - The instance that can be used to deregister the callback. - The associated has been disposed. - callback is null. - - - Registers a delegate that will be called when this is canceled. - The delegate to be executed when the is canceled. - The state to pass to the callback when the delegate is invoked. This may be null. - A Boolean value that indicates whether to capture the current and use it when invoking the callback. - The instance that can be used to deregister the callback. - The associated has been disposed. - callback is null. - - - Throws a if this token has had cancellation requested. - The token has had cancellation requested. - The associated has been disposed. - - - Gets a that is signaled when the token is canceled. - A that is signaled when the token is canceled. - The associated has been disposed. - - - Represents a callback delegate that has been registered with a . - - - Releases all resources used by the current instance of the class. - - - Determines whether the current instance is equal to the specified . - The other object to which to compare this instance. - True, if both this and obj are equal. False, otherwise. Two instances are equal if they both refer to the output of a single call to the same Register method of a . - - - Determines whether the current instance is equal to the specified . - The other to which to compare this instance. - True, if both this and other are equal. False, otherwise. Two instances are equal if they both refer to the output of a single call to the same Register method of a . - - - Serves as a hash function for a . - A hash code for the current instance. - - - Determines whether two instances are equal. - The first instance. - The second instance. - True if the instances are equal; otherwise, false. - - - Determines whether two instances are not equal. - The first instance. - The second instance. - True if the instances are not equal; otherwise, false. - - - Signals to a that it should be canceled. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class that will be canceled after the specified delay in milliseconds. - The time interval in milliseconds to wait before canceling this . - millisecondsDelay is less than -1. - - - Initializes a new instance of the class that will be canceled after the specified time span. - The time interval to wait before canceling this . - delay. is less than -1 or greater than . - - - Communicates a request for cancellation. - This has been disposed. - An aggregate exception containing all the exceptions thrown by the registered callbacks on the associated . - - - Communicates a request for cancellation, and specifies whether remaining callbacks and cancelable operations should be processed. - true if exceptions should immediately propagate; otherwise, false. - This has been disposed. - An aggregate exception containing all the exceptions thrown by the registered callbacks on the associated . - - - Schedules a cancel operation on this after the specified number of milliseconds. - The time span to wait before canceling this . - The exception thrown when this has been disposed. - The exception thrown when millisecondsDelay is less than -1. - - - Schedules a cancel operation on this after the specified time span. - The time span to wait before canceling this . - The exception thrown when this has been disposed. - The exception that is thrown when delay is less than -1 or greater than Int32.MaxValue. - - - Creates a that will be in the canceled state when any of the source tokens in the specified array are in the canceled state. - An array that contains the cancellation token instances to observe. - A that is linked to the source tokens. - A associated with one of the source tokens has been disposed. - tokens is null. - tokens is empty. - - - Creates a that will be in the canceled state when any of the source tokens are in the canceled state. - The first cancellation token to observe. - The second cancellation token to observe. - A that is linked to the source tokens. - A associated with one of the source tokens has been disposed. - - - Releases all resources used by the current instance of the class. - - - Releases the unmanaged resources used by the class and optionally releases the managed resources. - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - Gets whether cancellation has been requested for this . - true if cancellation has been requested for this ; otherwise, false. - - - Gets the associated with this . - The associated with this . - The token source has been disposed. - - - Provides methods for setting and capturing the compressed stack on the current thread. This class cannot be inherited. - - - Captures the compressed stack from the current thread. - A object. - - - Creates a copy of the current compressed stack. - A object representing the current compressed stack. - - - Gets the compressed stack for the current thread. - A for the current thread. - A caller in the call chain does not have permission to access unmanaged code. -or- The request for failed. - - - Sets the object with the logical context information needed to recreate an instance of this execution context. - The object to be populated with serialization information. - The structure representing the destination context of the serialization. - info is null. - - - Runs a method in the specified compressed stack on the current thread. - The to set. - A that represents the method to be run in the specified security context. - The object to be passed to the callback method. - compressedStack is null. - - - Represents a method to be called within a new context. - An object containing information to be used by the callback method each time it executes. - - - Represents a synchronization primitive that is signaled when its count reaches zero. - - - Initializes a new instance of class with the specified count. - The number of signals initially required to set the . - initialCount is less than 0. - - - Increments the 's current count by one. - The current instance has already been disposed. - The current instance is already set. -or- is equal to or greater than . - - - Increments the 's current count by a specified value. - The value by which to increase . - The current instance has already been disposed. - signalCount is less than or equal to 0. - The current instance is already set. -or- is equal to or greater than after count is incremented by signalCount. - - - Gets the number of remaining signals required to set the event. - The number of remaining signals required to set the event. - - - Releases all resources used by the current instance of the class. - - - Releases the unmanaged resources used by the , and optionally releases the managed resources. - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - Gets the numbers of signals initially required to set the event. - The number of signals initially required to set the event. - - - Indicates whether the object's current count has reached zero.. - true if the current count is zero; otherwise, false. - - - Resets the to the value of . - The current instance has already been disposed.. - - - Resets the property to a specified value. - The number of signals required to set the . - The current instance has alread been disposed. - count is less than 0. - - - Registers multiple signals with the , decrementing the value of by the specified amount. - The number of signals to register. - true if the signals caused the count to reach zero and the event was set; otherwise, false. - The current instance has already been disposed. - signalCount is less than 1. - The current instance is already set. -or- Or signalCount is greater than . - - - Registers a signal with the , decrementing the value of . - true if the signal caused the count to reach zero and the event was set; otherwise, false. - The current instance has already been disposed. - The current instance is already set. - - - Attempts to increment by one. - true if the increment succeeded; otherwise, false. If is already at zero, this method will return false. - The current instance has already been disposed. - is equal to . - - - Attempts to increment by a specified value. - The value by which to increase . - true if the increment succeeded; otherwise, false. If is already at zero this will return false. - The current instance has already been disposed. - signalCount is less than or equal to 0. - The current instance is already set. -or- + signalCount is equal to or greater than . - - - Blocks the current thread until the is set. - The current instance has already been disposed. - - - Blocks the current thread until the is set, using a 32-bit signed integer to measure the timeout. - The number of milliseconds to wait, or (-1) to wait indefinitely. - true if the was set; otherwise, false. - The current instance has already been disposed. - millisecondsTimeout is a negative number other than -1, which represents an infinite time-out. - - - Blocks the current thread until the is set, while observing a . - The to observe. - cancellationToken has been canceled. - The current instance has already been disposed. -or- The that created cancellationToken has already been disposed. - - - Blocks the current thread until the is set, using a to measure the timeout. - A that represents the number of milliseconds to wait, or a that represents -1 milliseconds to wait indefinitely. - true if the was set; otherwise, false. - The current instance has already been disposed. - timeout is a negative number other than -1 milliseconds, which represents an infinite time-out -or- timeout is greater than . - - - Blocks the current thread until the is set, using a 32-bit signed integer to measure the timeout, while observing a . - The number of milliseconds to wait, or (-1) to wait indefinitely. - The to observe. - true if the was set; otherwise, false. - cancellationToken has been canceled. - The current instance has already been disposed. -or- The that created cancellationToken has already been disposed. - millisecondsTimeout is a negative number other than -1, which represents an infinite time-out. - - - Blocks the current thread until the is set, using a to measure the timeout, while observing a . - A that represents the number of milliseconds to wait, or a that represents -1 milliseconds to wait indefinitely. - The to observe. - true if the was set; otherwise, false. - cancellationToken has been canceled. - The current instance has already been disposed. -or- The that created cancellationToken has already been disposed. - timeout is a negative number other than -1 milliseconds, which represents an infinite time-out -or- timeout is greater than . - - - Gets a that is used to wait for the event to be set. - A that is used to wait for the event to be set. - The current instance has already been disposed. - - - Indicates whether an is reset automatically or manually after receiving a signal. - - - When signaled, the resets automatically after releasing a single thread. If no threads are waiting, the remains signaled until a thread blocks, and resets after releasing the thread. - - - - When signaled, the releases all waiting threads and remains signaled until it is manually reset. - - - - Represents a thread synchronization event. - - - Initializes a new instance of the class, specifying whether the wait handle is initially signaled, and whether it resets automatically or manually. - true to set the initial state to signaled; false to set it to nonsignaled. - One of the values that determines whether the event resets automatically or manually. - - - Initializes a new instance of the class, specifying whether the wait handle is initially signaled if created as a result of this call, whether it resets automatically or manually, and the name of a system synchronization event. - true to set the initial state to signaled if the named event is created as a result of this call; false to set it to nonsignaled. - One of the values that determines whether the event resets automatically or manually. - The name of a system-wide synchronization event. - A Win32 error occurred. - The named event exists and has access control security, but the user does not have . - The named event cannot be created, perhaps because a wait handle of a different type has the same name. - name is longer than 260 characters. - - - Initializes a new instance of the class, specifying whether the wait handle is initially signaled if created as a result of this call, whether it resets automatically or manually, the name of a system synchronization event, and a Boolean variable whose value after the call indicates whether the named system event was created. - true to set the initial state to signaled if the named event is created as a result of this call; false to set it to nonsignaled. - One of the values that determines whether the event resets automatically or manually. - The name of a system-wide synchronization event. - When this method returns, contains true if a local event was created (that is, if name is null or an empty string) or if the specified named system event was created; false if the specified named system event already existed. This parameter is passed uninitialized. - A Win32 error occurred. - The named event exists and has access control security, but the user does not have . - The named event cannot be created, perhaps because a wait handle of a different type has the same name. - name is longer than 260 characters. - - - Opens the specified named synchronization event, if it already exists. - The name of the system synchronization event to open. - An object that represents the named system event. - name is an empty string. -or- name is longer than 260 characters. - name is null. - The named system event does not exist. - A Win32 error occurred. - The named event exists, but the user does not have the security access required to use it. - - - Sets the state of the event to nonsignaled, causing threads to block. - true if the operation succeeds; otherwise, false. - The method was previously called on this . - - - Sets the state of the event to signaled, allowing one or more waiting threads to proceed. - true if the operation succeeds; otherwise, false. - The method was previously called on this . - - - Opens the specified named synchronization event, if it already exists, and returns a value that indicates whether the operation succeeded. - The name of the system synchronization event to open. - When this method returns, contains a object that represents the named synchronization event if the call succeeded, or null if the call failed. This parameter is treated as uninitialized. - true if the named synchronization event was opened successfully; otherwise, false. - name is an empty string. -or- name is longer than 260 characters. - name is null. - A Win32 error occurred. - The named event exists, but the user does not have the desired security access. - - - Manages the execution context for the current thread. This class cannot be inherited. - - - Captures the execution context from the current thread. - An object representing the execution context for the current thread. - - - Creates a copy of the current execution context. - An object representing the current execution context. - This context cannot be copied because it is used. Only newly captured contexts can be copied. - - - Releases all resources used by the current instance of the class. - - - Sets the specified object with the logical context information needed to recreate an instance of the current execution context. - The object to be populated with serialization information. - The structure representing the destination context of the serialization. - info is null. - - - Indicates whether the flow of the execution context is currently suppressed. - true if the flow is suppressed; otherwise, false. - - - Restores the flow of the execution context across asynchronous threads. - The context flow cannot be restored because it is not being suppressed. - - - Runs a method in a specified execution context on the current thread. - The to set. - A delegate that represents the method to be run in the provided execution context. - The object to pass to the callback method. - executionContext is null. -or- executionContext was not acquired through a capture operation. -or- executionContext has already been used as the argument to a call. - - - Suppresses the flow of the execution context across asynchronous threads. - An structure for restoring the flow. - The context flow is already suppressed. - - - Encapsulates and propagates the host execution context across threads. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class using the specified state. - An object representing the host execution context state. - - - Creates a copy of the current host execution context. - A object representing the host context for the current thread. - - - Releases all resources used by the current instance of the class. - - - When overridden in a derived class, releases the unmanaged resources used by the , and optionally releases the managed resources. - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - Gets or sets the state of the host execution context. - An object representing the host execution context state. - - - Provides the functionality that allows a common language runtime host to participate in the flow, or migration, of the execution context. - - - Initializes a new instance of the class. - - - Captures the host execution context from the current thread. - A object representing the host execution context of the current thread. - - - Restores the host execution context to its prior state. - The previous context state to revert to. - previousState is null. -or- previousState was not created on the current thread. -or- previousState is not the last state for the . - - - Sets the current host execution context to the specified host execution context. - The to be set. - An object for restoring the to its previous state. - hostExecutionContext was not acquired through a capture operation. -or- hostExecutionContext has been the argument to a previous method call. - - - Provides atomic operations for variables that are shared by multiple threads. - - - Adds two 32-bit integers and replaces the first integer with the sum, as an atomic operation. - A variable containing the first value to be added. The sum of the two values is stored in location1. - The value to be added to the integer at location1. - The new value stored at location1. - The address of location1 is a null pointer. - - - Adds two 64-bit integers and replaces the first integer with the sum, as an atomic operation. - A variable containing the first value to be added. The sum of the two values is stored in location1. - The value to be added to the integer at location1. - The new value stored at location1. - The address of location1 is a null pointer. - - - Compares two double-precision floating point numbers for equality and, if they are equal, replaces the first value. - The destination, whose value is compared with comparand and possibly replaced. - The value that replaces the destination value if the comparison results in equality. - The value that is compared to the value at location1. - The original value in location1. - The address of location1 is a null pointer. - - - Compares two 32-bit signed integers for equality and, if they are equal, replaces the first value. - The destination, whose value is compared with comparand and possibly replaced. - The value that replaces the destination value if the comparison results in equality. - The value that is compared to the value at location1. - The original value in location1. - The address of location1 is a null pointer. - - - Compares two 64-bit signed integers for equality and, if they are equal, replaces the first value. - The destination, whose value is compared with comparand and possibly replaced. - The value that replaces the destination value if the comparison results in equality. - The value that is compared to the value at location1. - The original value in location1. - The address of location1 is a null pointer. - - - Compares two platform-specific handles or pointers for equality and, if they are equal, replaces the first one. - The destination , whose value is compared with the value of comparand and possibly replaced by value. - The that replaces the destination value if the comparison results in equality. - The that is compared to the value at location1. - The original value in location1. - The address of location1 is a null pointer. - - - Compares two objects for reference equality and, if they are equal, replaces the first object. - The destination object that is compared with comparand and possibly replaced. - The object that replaces the destination object if the comparison results in equality. - The object that is compared to the object at location1. - The original value in location1. - The address of location1 is a null pointer. - - - Compares two single-precision floating point numbers for equality and, if they are equal, replaces the first value. - The destination, whose value is compared with comparand and possibly replaced. - The value that replaces the destination value if the comparison results in equality. - The value that is compared to the value at location1. - The original value in location1. - The address of location1 is a null pointer. - - - Compares two instances of the specified reference type T for equality and, if they are equal, replaces the first one. - The destination, whose value is compared with comparand and possibly replaced. This is a reference parameter (ref in C#, ByRef in Visual Basic). - The value that replaces the destination value if the comparison results in equality. - The value that is compared to the value at location1. - The type to be used for location1, value, and comparand. This type must be a reference type. - The original value in location1. - The address of location1 is a null pointer. - - - Decrements a specified variable and stores the result, as an atomic operation. - The variable whose value is to be decremented. - The decremented value. - The address of location is a null pointer. - - - Decrements the specified variable and stores the result, as an atomic operation. - The variable whose value is to be decremented. - The decremented value. - The address of location is a null pointer. - - - Sets a single-precision floating point number to a specified value and returns the original value, as an atomic operation. - The variable to set to the specified value. - The value to which the location1 parameter is set. - The original value of location1. - The address of location1 is a null pointer. - - - Sets an object to a specified value and returns a reference to the original object, as an atomic operation. - The variable to set to the specified value. - The value to which the location1 parameter is set. - The original value of location1. - The address of location1 is a null pointer. - - - Sets a platform-specific handle or pointer to a specified value and returns the original value, as an atomic operation. - The variable to set to the specified value. - The value to which the location1 parameter is set. - The original value of location1. - The address of location1 is a null pointer. - - - Sets a double-precision floating point number to a specified value and returns the original value, as an atomic operation. - The variable to set to the specified value. - The value to which the location1 parameter is set. - The original value of location1. - The address of location1 is a null pointer. - - - Sets a 32-bit signed integer to a specified value and returns the original value, as an atomic operation. - The variable to set to the specified value. - The value to which the location1 parameter is set. - The original value of location1. - The address of location1 is a null pointer. - - - Sets a 64-bit signed integer to a specified value and returns the original value, as an atomic operation. - The variable to set to the specified value. - The value to which the location1 parameter is set. - The original value of location1. - The address of location1 is a null pointer. - - - Sets a variable of the specified type T to a specified value and returns the original value, as an atomic operation. - The variable to set to the specified value. This is a reference parameter (ref in C#, ByRef in Visual Basic). - The value to which the location1 parameter is set. - The type to be used for location1 and value. This type must be a reference type. - The original value of location1. - The address of location1 is a null pointer. - - - Increments a specified variable and stores the result, as an atomic operation. - The variable whose value is to be incremented. - The incremented value. - The address of location is a null pointer. - - - Increments a specified variable and stores the result, as an atomic operation. - The variable whose value is to be incremented. - The incremented value. - The address of location is a null pointer. - - - Synchronizes memory access as follows: The processor that executes the current thread cannot reorder instructions in such a way that memory accesses before the call to execute after memory accesses that follow the call to . - - - Returns a 64-bit value, loaded as an atomic operation. - The 64-bit value to be loaded. - The loaded value. - - - Receives the error code, number of bytes, and overlapped value type when an I/O operation completes on the thread pool. - The error code. - The number of bytes that are transferred. - A representing an unmanaged pointer to the native overlapped value type. - - - Provides lazy initialization routines. - - - Initializes a target reference type with the type's default constructor if it hasn't already been initialized. - A reference of type T to initialize if it has not already been initialized. - The type of the reference to be initialized. - The initialized reference of type T. - Permissions to access the constructor of type T were missing. - Type T does not have a default constructor. - - - Initializes a target reference type by using a specified function if it hasn't already been initialized. - The reference of type T to initialize if it hasn't already been initialized. - The function that is called to initialize the reference. - The reference type of the reference to be initialized. - The initialized value of type T. - Type T does not have a default constructor. - valueFactory returned null (Nothing in Visual Basic). - - - Initializes a target reference or value type with its default constructor if it hasn't already been initialized. - A reference or value of type T to initialize if it hasn't already been initialized. - A reference to a Boolean value that determines whether the target has already been initialized. - A reference to an object used as the mutually exclusive lock for initializing target. If syncLock is null, a new object will be instantiated. - The type of the reference to be initialized. - The initialized value of type T. - Permissions to access the constructor of type T were missing. - Type T does not have a default constructor. - - - Initializes a target reference or value type by using a specified function if it hasn't already been initialized. - A reference or value of type T to initialize if it hasn't already been initialized. - A reference to a Boolean value that determines whether the target has already been initialized. - A reference to an object used as the mutually exclusive lock for initializing target. If syncLock is null, a new object will be instantiated. - The function that is called to initialize the reference or value. - The type of the reference to be initialized. - The initialized value of type T. - Permissions to access the constructor of type T were missing. - Type T does not have a default constructor. - - - Specifies how a instance synchronizes access among multiple threads. - - - Locks are used to ensure that only a single thread can initialize a instance in a thread-safe manner. If the initialization method (or the default constructor, if there is no initialization method) uses locks internally, deadlocks can occur. If you use a constructor that specifies an initialization method (valueFactory parameter), and if that initialization method throws an exception (or fails to handle an exception) the first time you call the property, then the exception is cached and thrown again on subsequent calls to the property. If you use a constructor that does not specify an initialization method, exceptions that are thrown by the default constructor for T are not cached. In that case, a subsequent call to the property might successfully initialize the instance. If the initialization method recursively accesses the property of the instance, an is thrown. - - - - The instance is not thread safe; if the instance is accessed from multiple threads, its behavior is undefined. Use this mode only when high performance is crucial and the instance is guaranteed never to be initialized from more than one thread. If you use a constructor that specifies an initialization method (valueFactory parameter), and if that initialization method throws an exception (or fails to handle an exception) the first time you call the property, then the exception is cached and thrown again on subsequent calls to the property. If you use a constructor that does not specify an initialization method, exceptions that are thrown by the default constructor for T are not cached. In that case, a subsequent call to the property might successfully initialize the instance. If the initialization method recursively accesses the property of the instance, an is thrown. - - - - When multiple threads try to initialize a instance simultaneously, all threads are allowed to run the initialization method (or the default constructor, if there is no initialization method). The first thread to complete initialization sets the value of the instance. That value is returned to any other threads that were simultaneously running the initialization method, unless the initialization method throws exceptions on those threads. Any instances of T that were created by the competing threads are discarded. If the initialization method throws an exception on any thread, the exception is propagated out of the property on that thread. The exception is not cached. The value of the property remains false, and subsequent calls to the property, either by the thread where the exception was thrown or by other threads, cause the initialization method to run again. If the initialization method recursively accesses the property of the instance, no exception is thrown. - - - - Defines the lock that implements single-writer/multiple-reader semantics. This is a value type. - - - Indicates whether a specified object is a and is equal to the current instance. - The object to compare to the current instance. - true if the value of obj is equal to the value of the current instance; otherwise, false. - - - Indicates whether the current instance is equal to the specified . - The to compare to the current instance. - true if obj is equal to the value of the current instance; otherwise, false. - - - Returns the hash code for this instance. - A 32-bit signed integer hash code. - - - Indicates whether two structures are equal. - The to compare to b. - The to compare to a. - true if a is equal to b; otherwise, false. - - - Indicates whether two structures are not equal. - The to compare to b. - The to compare to a. - true if a is not equal to b; otherwise, false. - - - The exception that is thrown when recursive entry into a lock is not compatible with the recursion policy for the lock. - - - Initializes a new instance of the class with a system-supplied message that describes the error. - - - Initializes a new instance of the class with a specified message that describes the error. - The message that describes the exception. The caller of this constructor must make sure that this string has been localized for the current system culture. - - - Initializes a new instance of the class with serialized data. - The object that holds the serialized object data. - The contextual information about the source or destination. - - - Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. - The message that describes the exception. The caller of this constructor must make sure that this string has been localized for the current system culture. - The exception that caused the current exception. If the innerException parameter is not null, the current exception is raised in a catch block that handles the inner exception. - - - Specifies whether a lock can be entered multiple times by the same thread. - - - If a thread tries to enter a lock recursively, an exception is thrown. Some classes may allow certain recursions when this setting is in effect. - - - - A thread can enter a lock recursively. Some classes may restrict this capability. - - - - Notifies one or more waiting threads that an event has occurred. This class cannot be inherited. - - - Initializes a new instance of the class with a Boolean value indicating whether to set the initial state to signaled. - true to set the initial state signaled; false to set the initial state to nonsignaled. - - - Provides a slimmed down version of . - - - Initializes a new instance of the class with an initial state of nonsignaled. - - - Initializes a new instance of the class with a Boolean value indicating whether to set the intial state to signaled. - true to set the initial state signaled; false to set the initial state to nonsignaled. - - - Initializes a new instance of the class with a Boolean value indicating whether to set the intial state to signaled and a specified spin count. - true to set the initial state to signaled; false to set the initial state to nonsignaled. - The number of spin waits that will occur before falling back to a kernel-based wait operation. - spinCount is less than 0 or greater than the maximum allowed value. - - - Releases all resources used by the current instance of the class. - - - Releases the unmanaged resources used by the , and optionally releases the managed resources. - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - Gets whether the event is set. - true if the event has is set; otherwise, false. - - - Sets the state of the event to nonsignaled, which causes threads to block. - The object has already been disposed. - - - Sets the state of the event to signaled, which allows one or more threads waiting on the event to proceed. - - - Gets the number of spin waits that will occur before falling back to a kernel-based wait operation. - Returns the number of spin waits that will occur before falling back to a kernel-based wait operation. - - - Blocks the current thread until the current is set. - The maximum number of waiters has been exceeded. - The object has already been disposed. - - - Blocks the current thread until the current is set, using a 32-bit signed integer to measure the time interval. - The number of milliseconds to wait, or (-1) to wait indefinitely. - true if the was set; otherwise, false. - millisecondsTimeout is a negative number other than -1, which represents an infinite time-out. - The maximum number of waiters has been exceeded. - The object has already been disposed. - - - Blocks the current thread until the current receives a signal, while observing a . - The to observe. - The maximum number of waiters has been exceeded. - cancellationToken was canceled. - The object has already been disposed or the that created cancellationToken has been disposed. - - - Blocks the current thread until the current is set, using a to measure the time interval. - A that represents the number of milliseconds to wait, or a that represents -1 milliseconds to wait indefinitely. - true if the was set; otherwise, false. - timeout is a negative number other than -1 milliseconds, which represents an infinite time-out. -or- The number of milliseconds in timeout is greater than . - The maximum number of waiters has been exceeded. - The object has already been disposed. - - - Blocks the current thread until the current is set, using a 32-bit signed integer to measure the time interval, while observing a . - The number of milliseconds to wait, or (-1) to wait indefinitely. - The to observe. - true if the was set; otherwise, false. - cancellationToken was canceled. - millisecondsTimeout is a negative number other than -1, which represents an infinite time-out. - The maximum number of waiters has been exceeded. - The object has already been disposed or the that created cancellationToken has been disposed. - - - Blocks the current thread until the current is set, using a to measure the time interval, while observing a . - A that represents the number of milliseconds to wait, or a that represents -1 milliseconds to wait indefinitely. - The to observe. - true if the was set; otherwise, false. - cancellationToken was canceled. - timeout is a negative number other than -1 milliseconds, which represents an infinite time-out. -or- The number of milliseconds in timeout is greater than . - The maximum number of waiters has been exceeded. - The object has already been disposed or the that created cancellationToken has been disposed. - - - Gets the underlying object for this . - The underlying event object fore this . - - - Provides a mechanism that synchronizes access to objects. - - - Acquires an exclusive lock on the specified object. - The object on which to acquire the monitor lock. - The obj parameter is null. - - - Acquires an exclusive lock on the specified object, and atomically sets a value that indicates whether the lock was taken. - The object on which to wait. - The result of the attempt to acquire the lock, passed by reference. The input must be false. The output is true if the lock is acquired; otherwise, the output is false. The output is set even if an exception occurs during the attempt to acquire the lock. Note If no exception occurs, the output of this method is always true. - The input to lockTaken is true. - The obj parameter is null. - - - Releases an exclusive lock on the specified object. - The object on which to release the lock. - The obj parameter is null. - The current thread does not own the lock for the specified object. - - - Determines whether the current thread holds the lock on the specified object. - The object to test. - true if the current thread holds the lock on obj; otherwise, false. - obj is null. - - - Notifies a thread in the waiting queue of a change in the locked object's state. - The object a thread is waiting for. - The obj parameter is null. - The calling thread does not own the lock for the specified object. - - - Notifies all waiting threads of a change in the object's state. - The object that sends the pulse. - The obj parameter is null. - The calling thread does not own the lock for the specified object. - - - Attempts, for the specified amount of time, to acquire an exclusive lock on the specified object, and atomically sets a value that indicates whether the lock was taken. - The object on which to acquire the lock. - The amount of time to wait for the lock. A value of –1 millisecond specifies an infinite wait. - The result of the attempt to acquire the lock, passed by reference. The input must be false. The output is true if the lock is acquired; otherwise, the output is false. The output is set even if an exception occurs during the attempt to acquire the lock. - The input to lockTaken is true. - The obj parameter is null. - The value of timeout in milliseconds is negative and is not equal to (–1 millisecond), or is greater than . - - - Attempts, for the specified number of milliseconds, to acquire an exclusive lock on the specified object, and atomically sets a value that indicates whether the lock was taken. - The object on which to acquire the lock. - The number of milliseconds to wait for the lock. - The result of the attempt to acquire the lock, passed by reference. The input must be false. The output is true if the lock is acquired; otherwise, the output is false. The output is set even if an exception occurs during the attempt to acquire the lock. - The input to lockTaken is true. - The obj parameter is null. - millisecondsTimeout is negative, and not equal to . - - - Attempts, for the specified amount of time, to acquire an exclusive lock on the specified object. - The object on which to acquire the lock. - A representing the amount of time to wait for the lock. A value of –1 millisecond specifies an infinite wait. - true if the current thread acquires the lock; otherwise, false. - The obj parameter is null. - The value of timeout in milliseconds is negative and is not equal to (–1 millisecond), or is greater than . - - - Attempts, for the specified number of milliseconds, to acquire an exclusive lock on the specified object. - The object on which to acquire the lock. - The number of milliseconds to wait for the lock. - true if the current thread acquires the lock; otherwise, false. - The obj parameter is null. - millisecondsTimeout is negative, and not equal to . - - - Attempts to acquire an exclusive lock on the specified object, and atomically sets a value that indicates whether the lock was taken. - The object on which to acquire the lock. - The result of the attempt to acquire the lock, passed by reference. The input must be false. The output is true if the lock is acquired; otherwise, the output is false. The output is set even if an exception occurs during the attempt to acquire the lock. - The input to lockTaken is true. - The obj parameter is null. - - - Attempts to acquire an exclusive lock on the specified object. - The object on which to acquire the lock. - true if the current thread acquires the lock; otherwise, false. - The obj parameter is null. - - - Releases the lock on an object and blocks the current thread until it reacquires the lock. - The object on which to wait. - true if the call returned because the caller reacquired the lock for the specified object. This method does not return if the lock is not reacquired. - The obj parameter is null. - The calling thread does not own the lock for the specified object. - The thread that invokes Wait is later interrupted from the waiting state. This happens when another thread calls this thread's method. - - - Releases the lock on an object and blocks the current thread until it reacquires the lock. If the specified time-out interval elapses, the thread enters the ready queue. - The object on which to wait. - The number of milliseconds to wait before the thread enters the ready queue. - true if the lock was reacquired before the specified time elapsed; false if the lock was reacquired after the specified time elapsed. The method does not return until the lock is reacquired. - The obj parameter is null. - The calling thread does not own the lock for the specified object. - The thread that invokes Wait is later interrupted from the waiting state. This happens when another thread calls this thread's method. - The value of the millisecondsTimeout parameter is negative, and is not equal to . - - - Releases the lock on an object and blocks the current thread until it reacquires the lock. If the specified time-out interval elapses, the thread enters the ready queue. - The object on which to wait. - A representing the amount of time to wait before the thread enters the ready queue. - true if the lock was reacquired before the specified time elapsed; false if the lock was reacquired after the specified time elapsed. The method does not return until the lock is reacquired. - The obj parameter is null. - The calling thread does not own the lock for the specified object. - The thread that invokes Wait is later interrupted from the waiting state. This happens when another thread calls this thread's method. - The value of the timeout parameter in milliseconds is negative and does not represent (–1 millisecond), or is greater than . - - - Releases the lock on an object and blocks the current thread until it reacquires the lock. If the specified time-out interval elapses, the thread enters the ready queue. This method also specifies whether the synchronization domain for the context (if in a synchronized context) is exited before the wait and reacquired afterward. - The object on which to wait. - The number of milliseconds to wait before the thread enters the ready queue. - true to exit and reacquire the synchronization domain for the context (if in a synchronized context) before the wait; otherwise, false. - true if the lock was reacquired before the specified time elapsed; false if the lock was reacquired after the specified time elapsed. The method does not return until the lock is reacquired. - The obj parameter is null. - Wait is not invoked from within a synchronized block of code. - The thread that invokes Wait is later interrupted from the waiting state. This happens when another thread calls this thread's method. - The value of the millisecondsTimeout parameter is negative, and is not equal to . - - - Releases the lock on an object and blocks the current thread until it reacquires the lock. If the specified time-out interval elapses, the thread enters the ready queue. Optionally exits the synchronization domain for the synchronized context before the wait and reacquires the domain afterward. - The object on which to wait. - A representing the amount of time to wait before the thread enters the ready queue. - true to exit and reacquire the synchronization domain for the context (if in a synchronized context) before the wait; otherwise, false. - true if the lock was reacquired before the specified time elapsed; false if the lock was reacquired after the specified time elapsed. The method does not return until the lock is reacquired. - The obj parameter is null. - Wait is not invoked from within a synchronized block of code. - The thread that invokes Wait is later interrupted from the waiting state. This happens when another thread calls this thread's method. - The timeout parameter is negative and does not represent (–1 millisecond), or is greater than . - - - A synchronization primitive that can also be used for interprocess synchronization. - - - Initializes a new instance of the class with default properties. - - - Initializes a new instance of the class with a Boolean value that indicates whether the calling thread should have initial ownership of the mutex. - true to give the calling thread initial ownership of the mutex; otherwise, false. - - - Initializes a new instance of the class with a Boolean value that indicates whether the calling thread should have initial ownership of the mutex, and a string that is the name of the mutex. - true to give the calling thread initial ownership of the named system mutex if the named system mutex is created as a result of this call; otherwise, false. - The name of the . If the value is null, the is unnamed. - The named mutex exists and has access control security, but the user does not have . - A Win32 error occurred. - The named mutex cannot be created, perhaps because a wait handle of a different type has the same name. - name is longer than 260 characters. - - - Initializes a new instance of the class with a Boolean value that indicates whether the calling thread should have initial ownership of the mutex, a string that is the name of the mutex, and a Boolean value that, when the method returns, indicates whether the calling thread was granted initial ownership of the mutex. - true to give the calling thread initial ownership of the named system mutex if the named system mutex is created as a result of this call; otherwise, false. - The name of the . If the value is null, the is unnamed. - When this method returns, contains a Boolean that is true if a local mutex was created (that is, if name is null or an empty string) or if the specified named system mutex was created; false if the specified named system mutex already existed. This parameter is passed uninitialized. - The named mutex exists and has access control security, but the user does not have . - A Win32 error occurred. - The named mutex cannot be created, perhaps because a wait handle of a different type has the same name. - name is longer than 260 characters. - - - Opens the specified named mutex, if it already exists. - The name of the system mutex to open. - An object that represents the named system mutex. - name is an empty string. -or- name is longer than 260 characters. - name is null. - The named mutex does not exist. - A Win32 error occurred. - The named mutex exists, but the user does not have the security access required to use it. - - - Releases the once. - The calling thread does not own the mutex. - The current instance has already been disposed. - - - Opens the specified named mutex, if it already exists, and returns a value that indicates whether the operation succeeded. - The name of the system mutex to open. - When this method returns, contains a object that represents the named mutex if the call succeeded, or null if the call failed. This parameter is treated as uninitialized. - true if the named mutex was opened successfully; otherwise, false. - name is an empty string. -or- name is longer than 260 characters. - name is null. - A Win32 error occurred. - The named mutex exists, but the user does not have the security access required to use it. - - - Provides an explicit layout that is visible from unmanaged code and that will have the same layout as the Win32 OVERLAPPED structure with additional reserved fields at the end. - - - Specifies the handle to an event set to the signaled state when the operation is complete. The calling process must set this member either to zero or to a valid event handle before calling any overlapped functions. - - - - Specifies the length of the data transferred. Reserved for operating system use. - - - - Specifies a system-dependent status. Reserved for operating system use. - - - - Specifies the high word of the byte offset at which to start the transfer. - - - - Specifies a file position at which to start the transfer. - - - - Provides a managed representation of a Win32 OVERLAPPED structure, including methods to transfer information from an instance to a structure. - - - Initializes a new, empty instance of the class. - - - Initializes a new instance of the class with the specified file position, the 32-bit integer handle to an event that is signaled when the I/O operation is complete, and an interface through which to return the results of the operation. - The low word of the file position at which to start the transfer. - The high word of the file position at which to start the transfer. - The handle to an event that is signaled when the I/O operation is complete. - An object that implements the interface and provides status information on the I/O operation. - - - Initializes a new instance of the class with the specified file position, the handle to an event that is signaled when the I/O operation is complete, and an interface through which to return the results of the operation. - The low word of the file position at which to start the transfer. - The high word of the file position at which to start the transfer. - The handle to an event that is signaled when the I/O operation is complete. - An object that implements the interface and provides status information on the I/O operation. - - - Gets or sets the object that provides status information on the I/O operation. - An object that implements the interface. - - - Gets or sets the 32-bit integer handle to a synchronization event that is signaled when the I/O operation is complete. - An value representing the handle of the synchronization event. - - - Gets or sets the handle to the synchronization event that is signaled when the I/O operation is complete. - An representing the handle of the event. - - - Frees the unmanaged memory associated with a native overlapped structure allocated by the method. - A pointer to the structure to be freed. - nativeOverlappedPtr is null. - - - Gets or sets the high-order word of the file position at which to start the transfer. The file position is a byte offset from the start of the file. - An value representing the high word of the file position. - - - Gets or sets the low-order word of the file position at which to start the transfer. The file position is a byte offset from the start of the file. - An value representing the low word of the file position. - - - Packs the current instance into a structure, specifying the delegate to be invoked when the asynchronous I/O operation is complete. - An delegate that represents the callback method invoked when the asynchronous I/O operation completes. - An unmanaged pointer to a structure. - The current has already been packed. - - - Packs the current instance into a structure, specifying a delegate that is invoked when the asynchronous I/O operation is complete and a managed object that serves as a buffer. - An delegate that represents the callback method invoked when the asynchronous I/O operation completes. - An object or array of objects representing the input or output buffer for the operation. Each object represents a buffer, for example an array of bytes. - An unmanaged pointer to a structure. - The current has already been packed. - - - Unpacks the specified unmanaged structure into a managed object. - An unmanaged pointer to a structure. - An object containing the information unpacked from the native structure. - nativeOverlappedPtr is null. - - - Packs the current instance into a structure specifying the delegate to invoke when the asynchronous I/O operation is complete. Does not propagate the calling stack. - An delegate that represents the callback method invoked when the asynchronous I/O operation completes. - An unmanaged pointer to a structure. - The current has already been packed. - - - Packs the current instance into a structure, specifying the delegate to invoke when the asynchronous I/O operation is complete and the managed object that serves as a buffer. Does not propagate the calling stack. - An delegate that represents the callback method invoked when the asynchronous I/O operation completes. - An object or array of objects representing the input or output buffer for the operation. Each object represents a buffer, for example an array of bytes. - An unmanaged pointer to a structure. - The caller does not have the required permission. - The current is already packed. - - - Represents the method that executes on a . - An object that contains data for the thread procedure. - - - - - - - - - - - - - - Defines a lock that supports single writers and multiple readers. - - - Initializes a new instance of the class. - - - Acquires a reader lock, using an value for the time-out. - The time-out in milliseconds. - millisecondsTimeout expires before the lock request is granted. - - - Acquires a reader lock, using a value for the time-out. - A TimeSpan specifying the time-out period. - timeout expires before the lock request is granted. - timeout specifies a negative value other than -1 milliseconds. - - - Acquires the writer lock, using an value for the time-out. - The time-out in milliseconds. - timeout expires before the lock request is granted. - - - Acquires the writer lock, using a value for the time-out. - The TimeSpan specifying the time-out period. - timeout expires before the lock request is granted. - timeout specifies a negative value other than -1 milliseconds. - - - Indicates whether the writer lock has been granted to any thread since the sequence number was obtained. - The sequence number. - true if the writer lock has been granted to any thread since the sequence number was obtained; otherwise, false. - - - Restores the lock status of the thread to what it was before was called. - A returned by . - The thread does not have the writer lock. - The address of lockCookie is a null pointer. - - - Gets a value indicating whether the current thread holds a reader lock. - true if the current thread holds a reader lock; otherwise, false. - - - Gets a value indicating whether the current thread holds the writer lock. - true if the current thread holds the writer lock; otherwise, false. - - - Releases the lock, regardless of the number of times the thread acquired the lock. - A value representing the released lock. - - - Decrements the lock count. - The thread does not have any reader or writer locks. - - - Decrements the lock count on the writer lock. - The thread does not have the writer lock. - - - Restores the lock status of the thread to what it was before calling . - A returned by . - The address of lockCookie is a null pointer. - - - Upgrades a reader lock to the writer lock, using an Int32 value for the time-out. - The time-out in milliseconds. - A value. - millisecondsTimeout expires before the lock request is granted. - - - Upgrades a reader lock to the writer lock, using a TimeSpan value for the time-out. - The TimeSpan specifying the time-out period. - A value. - timeout expires before the lock request is granted. - timeout specifies a negative value other than -1 milliseconds. - - - Gets the current sequence number. - The current sequence number. - - - Represents a lock that is used to manage access to a resource, allowing multiple threads for reading or exclusive access for writing. - - - Initializes a new instance of the class with default property values. - - - Initializes a new instance of the class, specifying the lock recursion policy. - One of the enumeration values that specifies the lock recursion policy. - - - Gets the total number of unique threads that have entered the lock in read mode. - The number of unique threads that have entered the lock in read mode. - - - Releases all resources used by the current instance of the class. - is greater than zero. -or- is greater than zero. -or- is greater than zero. - - - Tries to enter the lock in read mode. - The current thread cannot acquire the write lock when it holds the read lock. -or- The property is , and the current thread has attempted to acquire the read lock when it already holds the read lock. -or- The property is , and the current thread has attempted to acquire the read lock when it already holds the write lock. -or- The recursion number would exceed the capacity of the counter. This limit is so large that applications should never encounter this exception. - The object has been disposed. - - - Tries to enter the lock in upgradeable mode. - The property is and the current thread has already entered the lock in any mode. -or- The current thread has entered read mode, so trying to enter upgradeable mode would create the possibility of a deadlock. -or- The recursion number would exceed the capacity of the counter. The limit is so large that applications should never encounter it. - The object has been disposed. - - - Tries to enter the lock in write mode. - The property is and the current thread has already entered the lock in any mode. -or- The current thread has entered read mode, so trying to enter the lock in write mode would create the possibility of a deadlock. -or- The recursion number would exceed the capacity of the counter. The limit is so large that applications should never encounter it. - The object has been disposed. - - - Reduces the recursion count for read mode, and exits read mode if the resulting count is 0 (zero). - The current thread has not entered the lock in read mode. - - - Reduces the recursion count for upgradeable mode, and exits upgradeable mode if the resulting count is 0 (zero). - The current thread has not entered the lock in upgradeable mode. - - - Reduces the recursion count for write mode, and exits write mode if the resulting count is 0 (zero). - The current thread has not entered the lock in write mode. - - - Gets a value that indicates whether the current thread has entered the lock in read mode. - true if the current thread has entered read mode; otherwise, false. - - - Gets a value that indicates whether the current thread has entered the lock in upgradeable mode. - true if the current thread has entered upgradeable mode; otherwise, false. - - - Gets a value that indicates whether the current thread has entered the lock in write mode. - true if the current thread has entered write mode; otherwise, false. - - - Gets a value that indicates the recursion policy for the current object. - One of the enumeration values that specifies the lock recursion policy. - - - Gets the number of times the current thread has entered the lock in read mode, as an indication of recursion. - 0 (zero) if the current thread has not entered read mode, 1 if the thread has entered read mode but has not entered it recursively, or n if the thread has entered the lock recursively n - 1 times. - - - Gets the number of times the current thread has entered the lock in upgradeable mode, as an indication of recursion. - 0 if the current thread has not entered upgradeable mode, 1 if the thread has entered upgradeable mode but has not entered it recursively, or n if the thread has entered upgradeable mode recursively n - 1 times. - - - Gets the number of times the current thread has entered the lock in write mode, as an indication of recursion. - 0 if the current thread has not entered write mode, 1 if the thread has entered write mode but has not entered it recursively, or n if the thread has entered write mode recursively n - 1 times. - - - Tries to enter the lock in read mode, with an optional integer time-out. - The number of milliseconds to wait, or -1 () to wait indefinitely. - true if the calling thread entered read mode, otherwise, false. - The property is and the current thread has already entered the lock. -or- The recursion number would exceed the capacity of the counter. The limit is so large that applications should never encounter it. - The value of millisecondsTimeout is negative, but it is not equal to (-1), which is the only negative value allowed. - The object has been disposed. - - - Tries to enter the lock in read mode, with an optional time-out. - The interval to wait, or -1 milliseconds to wait indefinitely. - true if the calling thread entered read mode, otherwise, false. - The property is and the current thread has already entered the lock. -or- The recursion number would exceed the capacity of the counter. The limit is so large that applications should never encounter it. - The value of timeout is negative, but it is not equal to -1 milliseconds, which is the only negative value allowed. -or- The value of timeout is greater than milliseconds. - The object has been disposed. - - - Tries to enter the lock in upgradeable mode, with an optional time-out. - The number of milliseconds to wait, or -1 () to wait indefinitely. - true if the calling thread entered upgradeable mode, otherwise, false. - The property is and the current thread has already entered the lock. -or- The current thread initially entered the lock in read mode, and therefore trying to enter upgradeable mode would create the possibility of a deadlock. -or- The recursion number would exceed the capacity of the counter. The limit is so large that applications should never encounter it. - The value of millisecondsTimeout is negative, but it is not equal to (-1), which is the only negative value allowed. - The object has been disposed. - - - Tries to enter the lock in upgradeable mode, with an optional time-out. - The interval to wait, or -1 milliseconds to wait indefinitely. - true if the calling thread entered upgradeable mode, otherwise, false. - The property is and the current thread has already entered the lock. -or- The current thread initially entered the lock in read mode, and therefore trying to enter upgradeable mode would create the possibility of a deadlock. -or- The recursion number would exceed the capacity of the counter. The limit is so large that applications should never encounter it. - The value of timeout is negative, but it is not equal to -1 milliseconds, which is the only negative value allowed. -or- The value of timeout is greater than milliseconds. - The object has been disposed. - - - Tries to enter the lock in write mode, with an optional time-out. - The number of milliseconds to wait, or -1 () to wait indefinitely. - true if the calling thread entered write mode, otherwise, false. - The property is and the current thread has already entered the lock. -or- The current thread initially entered the lock in read mode, and therefore trying to enter write mode would create the possibility of a deadlock. -or- The recursion number would exceed the capacity of the counter. The limit is so large that applications should never encounter it. - The value of millisecondsTimeout is negative, but it is not equal to (-1), which is the only negative value allowed. - The object has been disposed. - - - Tries to enter the lock in write mode, with an optional time-out. - The interval to wait, or -1 milliseconds to wait indefinitely. - true if the calling thread entered write mode, otherwise, false. - The property is and the current thread has already entered the lock. -or- The current thread initially entered the lock in read mode, and therefore trying to enter write mode would create the possibility of a deadlock. -or- The recursion number would exceed the capacity of the counter. The limit is so large that applications should never encounter it. - The value of timeout is negative, but it is not equal to -1 milliseconds, which is the only negative value allowed. -or- The value of timeout is greater than milliseconds. - The object has been disposed. - - - Gets the total number of threads that are waiting to enter the lock in read mode. - The total number of threads that are waiting to enter read mode. - - - Gets the total number of threads that are waiting to enter the lock in upgradeable mode. - The total number of threads that are waiting to enter upgradeable mode. - - - Gets the total number of threads that are waiting to enter the lock in write mode. - The total number of threads that are waiting to enter write mode. - - - Represents a handle that has been registered when calling . This class cannot be inherited. - - - Cancels a registered wait operation issued by the method. - The to be signaled. - true if the function succeeds; otherwise, false. - - - Limits the number of threads that can access a resource or pool of resources concurrently. - - - Initializes a new instance of the class, specifying the initial number of entries and the maximum number of concurrent entries. - The initial number of requests for the semaphore that can be granted concurrently. - The maximum number of requests for the semaphore that can be granted concurrently. - initialCount is greater than maximumCount. - maximumCount is less than 1. -or- initialCount is less than 0. - - - Initializes a new instance of the class, specifying the initial number of entries and the maximum number of concurrent entries, and optionally specifying the name of a system semaphore object. - The initial number of requests for the semaphore that can be granted concurrently. - The maximum number of requests for the semaphore that can be granted concurrently. - The name of a named system semaphore object. - initialCount is greater than maximumCount. -or- name is longer than 260 characters. - maximumCount is less than 1. -or- initialCount is less than 0. - A Win32 error occurred. - The named semaphore exists and has access control security, and the user does not have . - The named semaphore cannot be created, perhaps because a wait handle of a different type has the same name. - - - Initializes a new instance of the class, specifying the initial number of entries and the maximum number of concurrent entries, optionally specifying the name of a system semaphore object, and specifying a variable that receives a value indicating whether a new system semaphore was created. - The initial number of requests for the semaphore that can be satisfied concurrently. - The maximum number of requests for the semaphore that can be satisfied concurrently. - The name of a named system semaphore object. - When this method returns, contains true if a local semaphore was created (that is, if name is null or an empty string) or if the specified named system semaphore was created; false if the specified named system semaphore already existed. This parameter is passed uninitialized. - initialCount is greater than maximumCount. -or- name is longer than 260 characters. - maximumCount is less than 1. -or- initialCount is less than 0. - A Win32 error occurred. - The named semaphore exists and has access control security, and the user does not have . - The named semaphore cannot be created, perhaps because a wait handle of a different type has the same name. - - - Opens the specified named semaphore, if it already exists. - The name of the system semaphore to open. - An object that represents the named system semaphore. - name is an empty string. -or- name is longer than 260 characters. - name is null. - The named semaphore does not exist. - A Win32 error occurred. - The named semaphore exists, but the user does not have the security access required to use it. - - - Exits the semaphore and returns the previous count. - The count on the semaphore before the method was called. - The semaphore count is already at the maximum value. - A Win32 error occurred with a named semaphore. - The current semaphore represents a named system semaphore, but the user does not have . -or- The current semaphore represents a named system semaphore, but it was not opened with . - - - Exits the semaphore a specified number of times and returns the previous count. - The number of times to exit the semaphore. - The count on the semaphore before the method was called. - releaseCount is less than 1. - The semaphore count is already at the maximum value. - A Win32 error occurred with a named semaphore. - The current semaphore represents a named system semaphore, but the user does not have rights. -or- The current semaphore represents a named system semaphore, but it was not opened with rights. - - - Opens the specified named semaphore, if it already exists, and returns a value that indicates whether the operation succeeded. - The name of the system semaphore to open. - When this method returns, contains a object that represents the named semaphore if the call succeeded, or null if the call failed. This parameter is treated as uninitialized. - true if the named semaphore was opened successfully; otherwise, false. - name is an empty string. -or- name is longer than 260 characters. - name is null. - A Win32 error occurred. - The named semaphore exists, but the user does not have the security access required to use it. - - - The exception that is thrown when the method is called on a semaphore whose count is already at the maximum. - - - Initializes a new instance of the class with default values. - - - Initializes a new instance of the class with a specified error message. - The error message that explains the reason for the exception. - - - Initializes a new instance of the class with serialized data. - The object that holds the serialized object data about the exception being thrown. - The object that contains contextual information about the source or destination. - - - Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. - The error message that explains the reason for the exception. - The exception that is the cause of the current exception. If the innerException parameter is not null, the current exception is raised in a catch block that handles the inner exception. - - - Represents a lightweight alternative to that limits the number of threads that can access a resource or pool of resources concurrently. - - - Initializes a new instance of the class, specifying the initial number of requests that can be granted concurrently. - The initial number of requests for the semaphore that can be granted concurrently. - initialCount is less than 0. - - - Initializes a new instance of the class, specifying the initial and maximum number of requests that can be granted concurrently. - The initial number of requests for the semaphore that can be granted concurrently. - The maximum number of requests for the semaphore that can be granted concurrently. - initialCount is less than 0, or initialCount is greater than maxCount, or maxCount is equal to or less than 0. - - - Returns a that can be used to wait on the semaphore. - A that can be used to wait on the semaphore. - The has been disposed. - - - Gets the number of remaining threads that can enter the object. - The number of remaining threads that can enter the semaphore. - - - Releases all resources used by the current instance of the class. - - - Releases the unmanaged resources used by the , and optionally releases the managed resources. - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - Releases the object once. - The previous count of the . - The current instance has already been disposed. - The has already reached its maximum size. - - - Releases the object a specified number of times. - The number of times to exit the semaphore. - The previous count of the . - The current instance has already been disposed. - releaseCount is less than 1. - The has already reached its maximum size. - - - Blocks the current thread until it can enter the , using a that specifies the timeout, while observing a . - A that represents the number of milliseconds to wait, a that represents -1 milliseconds to wait indefinitely, or a that represents 0 milliseconds to test the wait handle and return immediately. - The to observe. - true if the current thread successfully entered the ; otherwise, false. - cancellationToken was canceled. - timeout is a negative number other than -1, which represents an infinite timeout -or- timeout is greater than . - The semaphoreSlim instance has been disposed .-or- The that created cancellationToken has already been disposed. - - - Blocks the current thread until it can enter the , using a 32-bit signed integer that specifies the timeout, while observing a . - The number of milliseconds to wait, (-1) to wait indefinitely, or zero to test the state of the wait handle and return immediately. - The to observe. - true if the current thread successfully entered the ; otherwise, false. - cancellationToken was canceled. - millisecondsTimeout is a negative number other than -1, which represents an infinite timeout -or- timeout is greater than . - The instance has been disposed, or the that created cancellationToken has been disposed. - - - Blocks the current thread until it can enter the , using a to specify the timeout. - A that represents the number of milliseconds to wait, a that represents -1 milliseconds to wait indefinitely, or a that represents 0 milliseconds to test the wait handle and return immediately. - true if the current thread successfully entered the ; otherwise, false. - timeout is a negative number other than -1, which represents an infinite timeout -or- timeout is greater than . - The semaphoreSlim instance has been disposed . - - - Blocks the current thread until it can enter the , using a 32-bit signed integer that specifies the timeout. - The number of milliseconds to wait, (-1) to wait indefinitely, or zero to test the state of the wait handle and return immediately. - true if the current thread successfully entered the ; otherwise, false. - millisecondsTimeout is a negative number other than -1, which represents an infinite timeout -or- timeout is greater than . - - - Blocks the current thread until it can enter the . - The current instance has already been disposed. - - - Blocks the current thread until it can enter the , while observing a . - The token to observe. - cancellationToken was canceled. - The current instance has already been disposed. -or- The that created cancellationToken has already been disposed. - - - Asynchronously waits to enter the , using a 32-bit signed integer to measure the time interval, while observing a . - The number of milliseconds to wait, (-1) to wait indefinitely, or zero to test the state of the wait handle and return immediately. - The to observe. - A task that will complete with a result of true if the current thread successfully entered the , otherwise with a result of false. - millisecondsTimeout is a number other than -1, which represents an infinite timeout -or- timeout is greater than . - The current instance has already been disposed. - cancellationToken was canceled. - - - Asynchronously waits to enter the . - A task that will complete when the semaphore has been entered. - - - Asynchronously waits to enter the , using a 32-bit signed integer to measure the time interval. - The number of milliseconds to wait, (-1) to wait indefinitely, or zero to test the state of the wait handle and return immediately. - A task that will complete with a result of true if the current thread successfully entered the , otherwise with a result of false. - The current instance has already been disposed. - millisecondsTimeout is a negative number other than -1, which represents an infinite timeout -or- timeout is greater than . - - - Asynchronously waits to enter the , while observing a . - The token to observe. - A task that will complete when the semaphore has been entered. - The current instance has already been disposed. - cancellationToken was canceled. - - - Asynchronously waits to enter the , using a to measure the time interval. - A that represents the number of milliseconds to wait, a that represents -1 milliseconds to wait indefinitely, or a that represents 0 milliseconds to test the wait handle and return immediately. - A task that will complete with a result of true if the current thread successfully entered the , otherwise with a result of false. - The current instance has already been disposed. - millisecondsTimeout is a negative number other than -1, which represents an infinite timeout -or- timeout is greater than . - - - Asynchronously waits to enter the , using a to measure the time interval, while observing a . - A that represents the number of milliseconds to wait, a that represents -1 milliseconds to wait indefinitely, or a that represents 0 milliseconds to test the wait handle and return immediately. - The token to observe. - A task that will complete with a result of true if the current thread successfully entered the , otherwise with a result of false. - millisecondsTimeout is a negative number other than -1, which represents an infinite timeout -or- timeout is greater than . - cancellationToken was canceled. - - - Represents a method to be called when a message is to be dispatched to a synchronization context. - The object passed to the delegate. - - - Provides a mutual exclusion lock primitive where a thread trying to acquire the lock waits in a loop repeatedly checking until the lock becomes available. - - - Initializes a new instance of the structure with the option to track thread IDs to improve debugging. - Whether to capture and use thread IDs for debugging purposes. - - - Acquires the lock in a reliable manner, such that even if an exception occurs within the method call, lockTaken can be examined reliably to determine whether the lock was acquired. - True if the lock is acquired; otherwise, false. lockTaken must be initialized to false prior to calling this method. - The lockTaken argument must be initialized to false prior to calling Enter. - Thread ownership tracking is enabled, and the current thread has already acquired this lock. - - - Releases the lock. - Thread ownership tracking is enabled, and the current thread is not the owner of this lock. - - - Releases the lock. - A Boolean value that indicates whether a memory fence should be issued in order to immediately publish the exit operation to other threads. - Thread ownership tracking is enabled, and the current thread is not the owner of this lock. - - - Gets whether the lock is currently held by any thread. - true if the lock is currently held by any thread; otherwise false. - - - Gets whether the lock is held by the current thread. - true if the lock is held by the current thread; otherwise false. - Thread ownership tracking is disabled. - - - Gets whether thread ownership tracking is enabled for this instance. - true if thread ownership tracking is enabled for this instance; otherwise false. - - - Attempts to acquire the lock in a reliable manner, such that even if an exception occurs within the method call, lockTaken can be examined reliably to determine whether the lock was acquired. - True if the lock is acquired; otherwise, false. lockTaken must be initialized to false prior to calling this method. - The lockTaken argument must be initialized to false prior to calling TryEnter. - Thread ownership tracking is enabled, and the current thread has already acquired this lock. - - - Attempts to acquire the lock in a reliable manner, such that even if an exception occurs within the method call, lockTaken can be examined reliably to determine whether the lock was acquired. - The number of milliseconds to wait, or (-1) to wait indefinitely. - True if the lock is acquired; otherwise, false. lockTaken must be initialized to false prior to calling this method. - millisecondsTimeout is a negative number other than -1, which represents an infinite time-out. - The lockTaken argument must be initialized to false prior to calling TryEnter. - Thread ownership tracking is enabled, and the current thread has already acquired this lock. - - - Attempts to acquire the lock in a reliable manner, such that even if an exception occurs within the method call, lockTaken can be examined reliably to determine whether the lock was acquired. - A that represents the number of milliseconds to wait, or a that represents -1 milliseconds to wait indefinitely. - True if the lock is acquired; otherwise, false. lockTaken must be initialized to false prior to calling this method. - timeout is a negative number other than -1 milliseconds, which represents an infinite time-out -or- timeout is greater than milliseconds. - The lockTaken argument must be initialized to false prior to calling TryEnter. - Thread ownership tracking is enabled, and the current thread has already acquired this lock. - - - Provides support for spin-based waiting. - - - Gets the number of times has been called on this instance. - Returns an integer that represents the number of times has been called on this instance. - - - Gets whether the next call to will yield the processor, triggering a forced context switch. - Whether the next call to will yield the processor, triggering a forced context switch. - - - Resets the spin counter. - - - Performs a single spin. - - - Spins until the specified condition is satisfied. - A delegate to be executed over and over until it returns true. - The condition argument is null. - - - Spins until the specified condition is satisfied or until the specified timeout is expired. - A delegate to be executed over and over until it returns true. - The number of milliseconds to wait, or (-1) to wait indefinitely. - True if the condition is satisfied within the timeout; otherwise, false - The condition argument is null. - millisecondsTimeout is a negative number other than -1, which represents an infinite time-out. - - - Spins until the specified condition is satisfied or until the specified timeout is expired. - A delegate to be executed over and over until it returns true. - A that represents the number of milliseconds to wait, or a TimeSpan that represents -1 milliseconds to wait indefinitely. - True if the condition is satisfied within the timeout; otherwise, false - The condition argument is null. - timeout is a negative number other than -1 milliseconds, which represents an infinite time-out -or- timeout is greater than . - - - Represents an XML comment. - - - Initializes a new instance of the class with the specified string content. - A string that contains the contents of the new object. - The value parameter is null. - - - Initializes a new instance of the class from an existing comment node. - The node to copy from. - The other parameter is null. - - - Gets the node type for this node. - The node type. For objects, this value is . - - - Gets or sets the string value of this comment. - A that contains the string value of this comment. - The value is null. - - - Write this comment to an . - An into which this method will write. - - - Represents a node that can contain other nodes. - - - Adds the specified content as children of this . - A content object containing simple content or a collection of content objects to be added. - - - Adds the specified content as children of this . - A parameter list of content objects. - - - Adds the specified content as the first children of this document or element. - A content object containing simple content or a collection of content objects to be added. - - - Adds the specified content as the first children of this document or element. - A parameter list of content objects. - The parent is null. - - - Creates an that can be used to add nodes to the . - An that is ready to have content written to it. - - - Returns a collection of the descendant nodes for this document or element, in document order. - An of containing the descendant nodes of the , in document order. - - - Returns a collection of the descendant elements for this document or element, in document order. - An of containing the descendant elements of the . - - - Returns a filtered collection of the descendant elements for this document or element, in document order. Only elements that have a matching are included in the collection. - The to match. - An of containing the descendant elements of the that match the specified . - - - Gets the first (in document order) child element with the specified . - The to match. - A that matches the specified , or null. - - - Returns a collection of the child elements of this element or document, in document order. - An of containing the child elements of this , in document order. - - - Returns a filtered collection of the child elements of this element or document, in document order. Only elements that have a matching are included in the collection. - The to match. - An of containing the children of the that have a matching , in document order. - - - Get the first child node of this node. - An containing the first child node of the . - - - Get the last child node of this node. - An containing the last child node of the . - - - Returns a collection of the child nodes of this element or document, in document order. - An of containing the contents of this , in document order. - - - Removes the child nodes from this document or element. - - - Replaces the children nodes of this document or element with the specified content. - A content object containing simple content or a collection of content objects that replace the children nodes. - - - Replaces the children nodes of this document or element with the specified content. - A parameter list of content objects. - - - Represents an XML declaration. - - - Initializes a new instance of the class from another object. - The used to initialize this object. - - - Initializes a new instance of the class with the specified version, encoding, and standalone status. - The version of the XML, usually "1.0". - The encoding for the XML document. - A string containing "yes" or "no" that specifies whether the XML is standalone or requires external entities to be resolved. - - - Gets or sets the encoding for this document. - A containing the code page name for this document. - - - Gets or sets the standalone property for this document. - A containing the standalone property for this document. - - - Provides the declaration as a formatted string. - A that contains the formatted XML string. - - - Gets or sets the version property for this document. - A containing the version property for this document. - - - Represents an XML document. For the components and usage of an object, see XDocument Class Overview. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with the specified content. - A parameter list of content objects to add to this document. - - - Initializes a new instance of the class from an existing object. - The object that will be copied. - - - Initializes a new instance of the class with the specified and content. - An for the document. - The content of the document. - - - Gets or sets the XML declaration for this document. - An that contains the XML declaration for this document. - - - Gets the Document Type Definition (DTD) for this document. - A that contains the DTD for this document. - - - Creates a new instance by using the specified stream. - The stream that contains the XML data. - An object that reads the data that is contained in the stream. - - - Creates a new from a . - A that contains the content for the . - An that contains the contents of the specified . - - - Creates a new from a file. - A URI string that references the file to load into a new . - An that contains the contents of the specified file. - - - Creates a new from an . - A that contains the content for the . - An that contains the contents of the specified . - - - Creates a new instance by using the specified stream, optionally preserving white space, setting the base URI, and retaining line information. - The stream containing the XML data. - A that specifies whether to load base URI and line information. - An object that reads the data that is contained in the stream. - - - Creates a new from a , optionally preserving white space, setting the base URI, and retaining line information. - A that contains the content for the . - A that specifies white space behavior, and whether to load base URI and line information. - An that contains the XML that was read from the specified . - - - Creates a new from a file, optionally preserving white space, setting the base URI, and retaining line information. - A URI string that references the file to load into a new . - A that specifies white space behavior, and whether to load base URI and line information. - An that contains the contents of the specified file. - - - Loads an from an , optionally setting the base URI, and retaining line information. - A that will be read for the content of the . - A that specifies whether to load base URI and line information. - An that contains the XML that was read from the specified . - - - Gets the node type for this node. - The node type. For objects, this value is . - - - Creates a new from a string. - A string that contains XML. - An populated from the string that contains XML. - - - Creates a new from a string, optionally preserving white space, setting the base URI, and retaining line information. - A string that contains XML. - A that specifies white space behavior, and whether to load base URI and line information. - An populated from the string that contains XML. - - - Gets the root element of the XML Tree for this document. - The root of the XML tree. - - - Serialize this to an . - A that the will be written to. - - - Outputs this to the specified . - The stream to output this to. - - - Serialize this to a . - A that the will be written to. - - - Serialize this to a file, overwriting an existing file, if it exists. - A string that contains the name of the file. - - - Outputs this to the specified , optionally specifying formatting behavior. - The stream to output this to. - A that specifies formatting behavior. - - - Serialize this to a , optionally disabling formatting. - The to output the XML to. - A that specifies formatting behavior. - - - Serialize this to a file, optionally disabling formatting. - A string that contains the name of the file. - A that specifies formatting behavior. - - - Write this document to an . - An into which this method will write. - - - Represents an XML Document Type Definition (DTD). - - - Initializes an instance of the class from another object. - An object to copy from. - - - Initializes an instance of the class. - A that contains the qualified name of the DTD, which is the same as the qualified name of the root element of the XML document. - A that contains the public identifier of an external public DTD. - A that contains the system identifier of an external private DTD. - A that contains the internal subset for an internal DTD. - - - Gets or sets the internal subset for this Document Type Definition (DTD). - A that contains the internal subset for this Document Type Definition (DTD). - - - Gets or sets the name for this Document Type Definition (DTD). - A that contains the name for this Document Type Definition (DTD). - - - Gets the node type for this node. - The node type. For objects, this value is . - - - Gets or sets the public identifier for this Document Type Definition (DTD). - A that contains the public identifier for this Document Type Definition (DTD). - - - Gets or sets the system identifier for this Document Type Definition (DTD). - A that contains the system identifier for this Document Type Definition (DTD). - - - Write this to an . - An into which this method will write. - - - Represents an XML element. See XElement Class Overview and the Remarks section on this page for usage information and examples. - - - Initializes a new instance of the class from another object. - An object to copy from. - - - Initializes a new instance of the class with the specified name. - An that contains the name of the element. - - - Initializes a new instance of the class from an object. - An that contains unevaluated queries that will be iterated for the contents of this . - - - Initializes a new instance of the class with the specified name and content. - An that contains the element name. - The contents of the element. - - - Initializes a new instance of the class with the specified name and content. - An that contains the element name. - The initial content of the element. - - - Returns a collection of elements that contain this element, and the ancestors of this element. - An of of elements that contain this element, and the ancestors of this element. - - - Returns a filtered collection of elements that contain this element, and the ancestors of this element. Only elements that have a matching are included in the collection. - The to match. - An of that contain this element, and the ancestors of this element. Only elements that have a matching are included in the collection. - - - Returns the of this that has the specified . - The of the to get. - An that has the specified ; null if there is no attribute with the specified name. - - - Returns a collection of attributes of this element. - An of of attributes of this element. - - - Returns a filtered collection of attributes of this element. Only elements that have a matching are included in the collection. - The to match. - An of that contains the attributes of this element. Only elements that have a matching are included in the collection. - - - Returns a collection of nodes that contain this element, and all descendant nodes of this element, in document order. - An of that contain this element, and all descendant nodes of this element, in document order. - - - Returns a filtered collection of elements that contain this element, and all descendant elements of this element, in document order. Only elements that have a matching are included in the collection. - The to match. - An of that contain this element, and all descendant elements of this element, in document order. Only elements that have a matching are included in the collection. - - - Returns a collection of elements that contain this element, and all descendant elements of this element, in document order. - An of of elements that contain this element, and all descendant elements of this element, in document order. - - - Gets an empty collection of elements. - An of that contains an empty collection. - - - Gets the first attribute of this element. - An that contains the first attribute of this element. - - - Gets the default of this . - An that contains the default namespace of this . - - - Gets the namespace associated with a particular prefix for this . - A string that contains the namespace prefix to look up. - An for the namespace associated with the prefix for this . - - - Gets the prefix associated with a namespace for this . - An to look up. - A that contains the namespace prefix. - - - Gets a value indicating whether this element has at least one attribute. - true if this element has at least one attribute; otherwise false. - - - Gets a value indicating whether this element has at least one child element. - true if this element has at least one child element; otherwise false. - - - Gets a value indicating whether this element contains no content. - true if this element contains no content; otherwise false. - - - Gets the last attribute of this element. - An that contains the last attribute of this element. - - - Loads an from a , optionally preserving white space and retaining line information. - A that will be read for the content. - A that specifies white space behavior, and whether to load base URI and line information. - An that contains the XML that was read from the specified . - - - Loads an from an , optionally preserving white space, setting the base URI, and retaining line information. - A that will be read for the content of the . - A that specifies white space behavior, and whether to load base URI and line information. - An that contains the XML that was read from the specified . - - - Loads an from a file, optionally preserving white space, setting the base URI, and retaining line information. - A URI string referencing the file to load into an . - A that specifies white space behavior, and whether to load base URI and line information. - An that contains the contents of the specified file. - - - Creates a new instance by using the specified stream, optionally preserving white space, setting the base URI, and retaining line information. - The stream containing the XML data. - A object that specifies whether to load base URI and line information. - An object used to read the data that the stream contains. - - - Loads an from a . - A that will be read for the content. - An that contains the XML that was read from the specified . - - - Loads an from a file. - A URI string referencing the file to load into a new . - An that contains the contents of the specified file. - - - Creates a new instance by using the specified stream. - The stream that contains the XML data. - An object used to read the data that is contained in the stream. - - - Loads an from an . - A that will be read for the content of the . - An that contains the XML that was read from the specified . - - - Gets or sets the name of this element. - An that contains the name of this element. - - - Gets the node type for this node. - The node type. For objects, this value is . - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Load an from a string that contains XML. - A that contains XML. - An populated from the string that contains XML. - - - Load an from a string that contains XML, optionally preserving white space and retaining line information. - A that contains XML. - A that specifies white space behavior, and whether to load base URI and line information. - An populated from the string that contains XML. - - - Removes nodes and attributes from this . - - - Removes the attributes of this . - - - Replaces the child nodes and the attributes of this element with the specified content. - The content that will replace the child nodes and attributes of this element. - - - Replaces the child nodes and the attributes of this element with the specified content. - A parameter list of content objects. - - - Replaces the attributes of this element with the specified content. - A parameter list of content objects. - - - Replaces the attributes of this element with the specified content. - The content that will replace the attributes of this element. - - - Outputs this to the specified . - The stream to output this to. - - - Serialize this element to a . - A that the will be written to. - - - Serialize this element to a file. - A that contains the name of the file. - - - Serialize this element to an . - A that the will be written to. - - - Outputs this to the specified , optionally specifying formatting behavior. - The stream to output this to. - A object that specifies formatting behavior. - - - Serialize this element to a , optionally disabling formatting. - The to output the XML to. - A that specifies formatting behavior. - - - Serialize this element to a file, optionally disabling formatting. - A that contains the name of the file. - A that specifies formatting behavior. - - - Sets the value of an attribute, adds an attribute, or removes an attribute. - An that contains the name of the attribute to change. - The value to assign to the attribute. The attribute is removed if the value is null. Otherwise, the value is converted to its string representation and assigned to the property of the attribute. - The value is an instance of . - - - Sets the value of a child element, adds a child element, or removes a child element. - An that contains the name of the child element to change. - The value to assign to the child element. The child element is removed if the value is null. Otherwise, the value is converted to its string representation and assigned to the property of the child element. - The value is an instance of . - - - Sets the value of this element. - The value to assign to this element. The value is converted to its string representation and assigned to the property. - The value is null. - The value is an . - - - Gets or sets the concatenated text contents of this element. - A that contains all of the text content of this element. If there are multiple text nodes, they will be concatenated. - - - Write this element to an . - An into which this method will write. - - - Gets an XML schema definition that describes the XML representation of this object. - An that describes the XML representation of the object that is produced by the method and consumed by the method. - - - Generates an object from its XML representation. - The from which the object is deserialized. - - - Converts an object into its XML representation. - The to which this object is serialized. - - - Represents a name of an XML element or attribute. - - - Determines whether the specified is equal to this . - The to compare to the current . - true if the specified is equal to the current ; otherwise false. - - - Gets an object from an expanded name. - A that contains an expanded XML name in the format {namespace}localname. - An object constructed from the expanded name. - - - Gets an object from a local name and a namespace. - A local (unqualified) name. - An XML namespace. - An object created from the specified local name and namespace. - - - Gets a hash code for this . - An that contains the hash code for the . - - - Gets the local (unqualified) part of the name. - A that contains the local (unqualified) part of the name. - - - Gets the namespace part of the fully qualified name. - An that contains the namespace part of the name. - - - Returns the URI of the for this . - The URI of the for this . - - - Returns a value indicating whether two instances of are equal. - The first to compare. - The second to compare. - true if left and right are equal; otherwise false. - - - - - - - Returns a value indicating whether two instances of are not equal. - The first to compare. - The second to compare. - true if left and right are not equal; otherwise false. - - - Returns the expanded XML name in the format {namespace}localname. - A that contains the expanded XML name in the format {namespace}localname. - - - Indicates whether the current is equal to the specified . - The to compare with this . - true if this is equal to the specified , otherwise false. - - - Populates a with the data required to serialize the target object. - The to populate with data. - The destination (see ) for this serialization. - - - Represents an XML namespace. This class cannot be inherited. - - - Determines whether the specified is equal to the current . - The to compare to the current . - A that indicates whether the specified is equal to the current . - - - Gets an for the specified Uniform Resource Identifier (URI). - A that contains a namespace URI. - An created from the specified URI. - - - Gets a hash code for this . - An that contains the hash code for the . - - - Returns an object created from this and the specified local name. - A that contains a local name. - An created from this and the specified local name. - - - Gets the Uniform Resource Identifier (URI) of this namespace. - A that contains the URI of the namespace. - - - Gets the object that corresponds to no namespace. - The that corresponds to no namespace. - - - Combines an object with a local name to create an . - An that contains the namespace. - A that contains the local name. - The new constructed from the namespace and local name. - - - Returns a value indicating whether two instances of are equal. - The first to compare. - The second to compare. - A that indicates whether left and right are equal. - - - - - - - Returns a value indicating whether two instances of are not equal. - The first to compare. - The second to compare. - A that indicates whether left and right are not equal. - - - Returns the URI of this . - The URI of this . - - - Gets the object that corresponds to the XML URI (http://www.w3.org/XML/1998/namespace). - The that corresponds to the XML URI (http://www.w3.org/XML/1998/namespace). - - - Gets the object that corresponds to the xmlns URI (http://www.w3.org/2000/xmlns/). - The that corresponds to the xmlns URI (http://www.w3.org/2000/xmlns/). - - - Represents the abstract concept of a node (element, comment, document type, processing instruction, or text node) in the XML tree. - - - Adds the specified content immediately after this node. - A content object that contains simple content or a collection of content objects to be added after this node. - The parent is null. - - - Adds the specified content immediately after this node. - A parameter list of content objects. - The parent is null. - - - Adds the specified content immediately before this node. - A content object that contains simple content or a collection of content objects to be added before this node. - The parent is null. - - - Adds the specified content immediately before this node. - A parameter list of content objects. - The parent is null. - - - Returns a collection of the ancestor elements of this node. - An of of the ancestor elements of this node. - - - Returns a filtered collection of the ancestor elements of this node. Only elements that have a matching are included in the collection. - The to match. - An of of the ancestor elements of this node. Only elements that have a matching are included in the collection. The nodes in the returned collection are in reverse document order. This method uses deferred execution. - - - Compares two nodes to determine their relative XML document order. - First to compare. - Second to compare. - An int containing 0 if the nodes are equal; -1 if n1 is before n2; 1 if n1 is after n2. - The two nodes do not share a common ancestor. - - - Creates an for this node. - An that can be used to read this node and its descendants. - - - Creates an with the options specified by the readerOptions parameter. - A object that specifies whether to omit duplicate namespaces. - An object. - - - Compares the values of two nodes, including the values of all descendant nodes. - The first to compare. - The second to compare. - true if the nodes are equal; otherwise false. - - - Gets a comparer that can compare the relative position of two nodes. - An that can compare the relative position of two nodes. - - - Returns a collection of the sibling elements after this node, in document order. - An of of the sibling elements after this node, in document order. - - - Returns a filtered collection of the sibling elements after this node, in document order. Only elements that have a matching are included in the collection. - The to match. - An of of the sibling elements after this node, in document order. Only elements that have a matching are included in the collection. - - - Returns a collection of the sibling elements before this node, in document order. - An of of the sibling elements before this node, in document order. - - - Returns a filtered collection of the sibling elements before this node, in document order. Only elements that have a matching are included in the collection. - The to match. - An of of the sibling elements before this node, in document order. Only elements that have a matching are included in the collection. - - - Gets a comparer that can compare two nodes for value equality. - A that can compare two nodes for value equality. - - - Determines if the current node appears after a specified node in terms of document order. - The to compare for document order. - true if this node appears after the specified node; otherwise false. - - - Determines if the current node appears before a specified node in terms of document order. - The to compare for document order. - true if this node appears before the specified node; otherwise false. - - - Gets the next sibling node of this node. - The that contains the next sibling node. - - - Returns a collection of the sibling nodes after this node, in document order. - An of of the sibling nodes after this node, in document order. - - - Returns a collection of the sibling nodes before this node, in document order. - An of of the sibling nodes before this node, in document order. - - - Gets the previous sibling node of this node. - The that contains the previous sibling node. - - - Creates an from an . - An positioned at the node to read into this . - An that contains the node and its descendant nodes that were read from the reader. The runtime type of the node is determined by the node type () of the first node encountered in the reader. - The is not positioned on a recognized node type. - The underlying throws an exception. - - - Removes this node from its parent. - The parent is null. - - - Replaces this node with the specified content. - Content that replaces this node. - - - Replaces this node with the specified content. - A parameter list of the new content. - - - Returns the indented XML for this node. - A containing the indented XML. - - - Returns the XML for this node, optionally disabling formatting. - A that specifies formatting behavior. - A containing the XML. - - - Writes this node to an . - An into which this method will write. - - - Contains functionality to compare nodes for their document order. This class cannot be inherited. - - - Initializes a new instance of the class. - - - Compares two nodes to determine their relative document order. - The first to compare. - The second to compare. - An that contains 0 if the nodes are equal; -1 if x is before y; 1 if x is after y. - The two nodes do not share a common ancestor. - - - Compares two nodes to determine their relative document order. - The first to compare. - The second to compare. - An that contains 0 if the nodes are equal; -1 if x is before y; 1 if x is after y. - The two nodes do not share a common ancestor. - The two nodes are not derived from . - - - Compares nodes to determine whether they are equal. This class cannot be inherited. - - - Initializes a new instance of the class. - - - Compares the values of two nodes. - The first to compare. - The second to compare. - A indicating if the nodes are equal. - - - Returns a hash code based on an . - The to hash. - A that contains a value-based hash code for the node. - - - Compares the values of two nodes. - The first to compare. - The second to compare. - true if the nodes are equal; otherwise false. - - - Returns a hash code based on the value of a node. - The node to hash. - A that contains a value-based hash code for the node. - - - Represents a node or an attribute in an XML tree. - - - Adds an object to the annotation list of this . - An that contains the annotation to add. - - - Gets the first annotation object of the specified type from this . - The of the annotation to retrieve. - The that contains the first annotation object that matches the specified type, or null if no annotation is of the specified type. - - - Get the first annotation object of the specified type from this . - The type of the annotation to retrieve. - The first annotation object that matches the specified type, or null if no annotation is of the specified type. - - - Gets a collection of annotations of the specified type for this . - The of the annotations to retrieve. - An of that contains the annotations that match the specified type for this . - - - Gets a collection of annotations of the specified type for this . - The type of the annotations to retrieve. - An that contains the annotations for this . - - - Gets the base URI for this . - A that contains the base URI for this . - - - Raised when this or any of its descendants have changed. - - - - Raised when this or any of its descendants are about to change. - - - - Gets the for this . - The for this . - - - Gets the node type for this . - The node type for this . - - - Gets the parent of this . - The parent of this . - - - Removes the annotations of the specified type from this . - The of annotations to remove. - - - Removes the annotations of the specified type from this . - The type of annotations to remove. - - - Gets a value indicating whether or not this has line information. - true if the has line information, otherwise false. - - - Gets the line number that the underlying reported for this . - An that contains the line number reported by the for this . - - - Gets the line position that the underlying reported for this . - An that contains the line position reported by the for this . - - - Specifies the event type when an event is raised for an . - - - An has been or will be added to an . - - - - An has been or will be renamed. - - - - An has been or will be removed from an . - - - - The value of an has been or will be changed. In addition, a change in the serialization of an empty element (either from an empty tag to start/end tag pair or vice versa) raises this event. - - - - Provides data for the and events. - - - Initializes a new instance of the class. - An that contains the event arguments for LINQ to XML events. - - - Event argument for an change event. - - - - Event argument for a change event. - - - - Gets the type of change. - An that contains the type of change. - - - Event argument for a change event. - - - - Event argument for a change event. - - - - Represents an XML processing instruction. - - - Initializes a new instance of the class. - The node to copy from. - - - Initializes a new instance of the class. - A containing the target application for this . - The string data for this . - The target or data parameter is null. - The target does not follow the constraints of an XML name. - - - Gets or sets the string value of this processing instruction. - A that contains the string value of this processing instruction. - The string value is null. - - - Gets the node type for this node. - The node type. For objects, this value is . - - - Gets or sets a string containing the target application for this processing instruction. - A containing the target application for this processing instruction. - The string value is null. - The target does not follow the constraints of an XML name. - - - Writes this processing instruction to an . - The to write this processing instruction to. - - - Represents elements in an XML tree that supports deferred streaming output. - - - Initializes a new instance of the class from the specified . - An that contains the name of the element. - - - Initializes a new instance of the class with the specified name and content. - An that contains the element name. - The contents of the element. - - - Initializes a new instance of the class with the specified name and content. - An that contains the element name. - The contents of the element. - - - Adds the specified content as children to this . - Content to be added to the streaming element. - - - Adds the specified content as children to this . - Content to be added to the streaming element. - - - Gets or sets the name of this streaming element. - An that contains the name of this streaming element. - - - Outputs this to the specified . - The stream to output this to. - - - Serialize this streaming element to a . - A that the will be written to. - - - Serialize this streaming element to a file. - A that contains the name of the file. - - - Serialize this streaming element to an . - A that the will be written to. - - - Outputs this to the specified , optionally specifying formatting behavior. - The stream to output this to. - A object that specifies formatting behavior. - - - Serialize this streaming element to a , optionally disabling formatting. - The to output the XML to. - A that specifies formatting behavior. - - - Serialize this streaming element to a file, optionally disabling formatting. - A that contains the name of the file. - A object that specifies formatting behavior. - - - Returns the formatted (indented) XML for this streaming element. - A containing the indented XML. - - - Returns the XML for this streaming element, optionally disabling formatting. - A that specifies formatting behavior. - A containing the XML. - - - Writes this streaming element to an . - An into which this method will write. - - - Represents a text node. - - - Initializes a new instance of the class. - The that contains the value of the node. - - - Initializes a new instance of the class from another object. - The node to copy from. - - - Gets the node type for this node. - The node type. For objects, this value is . - - - Gets or sets the value of this node. - A that contains the value of this node. - - - Writes this node to an . - An into which this method will write. - - - Specifies whether to remove duplicate namespace declarations in the . - - - Specifies that duplicate namespace declarations will not be removed. - - - - Specifies that duplicate namespace declarations will be removed. For the duplicate namespace to be removed, the prefix and the namespace must match. - - - - Implements a single-threaded . - - - Initializes a new instance of the NameTable class. - - - Atomizes the specified string and adds it to the NameTable. - The string to add. - The atomized string or the existing string if it already exists in the NameTable. - key is null. - - - Atomizes the specified string and adds it to the NameTable. - The character array containing the string to add. - The zero-based index into the array specifying the first character of the string. - The number of characters in the string. - The atomized string or the existing string if one already exists in the NameTable. If len is zero, String.Empty is returned. - 0 > start -or- start >= key.Length -or- len >= key.Length The above conditions do not cause an exception to be thrown if len =0. - len < 0. - - - Gets the atomized string with the specified value. - The name to find. - The atomized string object or null if the string has not already been atomized. - value is null. - - - Gets the atomized string containing the same characters as the specified range of characters in the given array. - The character array containing the name to find. - The zero-based index into the array specifying the first character of the name. - The number of characters in the name. - The atomized string or null if the string has not already been atomized. If len is zero, String.Empty is returned. - 0 > start -or- start >= key.Length -or- len >= key.Length The above conditions do not cause an exception to be thrown if len =0. - len < 0. - - - Specifies how to handle line breaks. - - - New line characters are entitized. This setting preserves all characters when the output is read by a normalizing . - - - - The new line characters are unchanged. The output is the same as the input. - - - - New line characters are replaced to match the character specified in the property. - - - - delegate for a callback method when closing the reader. - The that fires the OnClose event. - - - Specifies the state of the reader. - - - The method has been called. - - - - The end of the file has been reached successfully. - - - - An error occurred that prevents the read operation from continuing. - - - - The Read method has not been called. - - - - The Read method has been called. Additional methods may be called on the reader. - - - - The enumeration is used by the and defines which well-known DTDs that the recognizes. - - - Specifies that the will recognize all currently supported DTDs. This is the default behavior. - - - - Specifies that the will not recognize any of the predefined DTDs. - - - - Specifies that the will recognize DTDs and entities that are defined in RSS 0.91. - - - - Specifies that the will recognize DTDs and entities that are defined in XHTML 1.0. - - - - Represents a class that is used to prepopulate the cache with DTDs or XML streams. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with the specified preloaded well-known DTDs. - The well-known DTDs that should be prepopulated into the cache. - - - Initializes a new instance of the class with the specified fallback resolver. - The XmlResolver, XmlXapResolver, or your own resolver. - - - Initializes a new instance of the class with the specified fallback resolver and preloaded well-known DTDs. - The XmlResolver, XmlXapResolver, or your own resolver. - The well-known DTDs that should be prepopulated into the cache. - - - Initializes a new instance of the class with the specified fallback resolver, preloaded well-known DTDs, and URI equality comparer. - The XmlResolver, XmlXapResolver, or your own resolver. - The well-known DTDs that should be prepopulated into cache. - The implementation of the generic interface to use when you compare URIs. - - - Adds a byte array to the store and maps it to a URI. If the store already contains a mapping for the same URI, the existing mapping is overridden. - The URI of the data that is being added to the store. - A byte array with the data that corresponds to the provided URI. - uri or value is null. - - - Adds a to the store and maps it to a URI. If the store already contains a mapping for the same URI, the existing mapping is overridden. - The URI of the data that is being added to the store. - A with the data that corresponds to the provided URI. - uri or value is null. - - - Adds a string with preloaded data to the store and maps it to a URI. If the store already contains a mapping for the same URI, the existing mapping is overridden. - The URI of the data that is being added to the store. - A String with the data that corresponds to the provided URI. - uri or value is null. - - - Adds a byte array to the store and maps it to a URI. If the store already contains a mapping for the same URI, the existing mapping is overridden. - The URI of the data that is being added to the store. - A byte array with the data that corresponds to the provided URI. - The offset in the provided byte array where the data starts. - The number of bytes to read from the byte array, starting at the provided offset. - uri or value is null. - offset or count is less than 0. -or- The length of the value minus offset is less than count. - - - Sets the credentials that are used to authenticate the underlying . - The credentials that are used to authenticate the underlying web request. - - - Maps a URI to an object that contains the actual resource. - The URI returned from . - The current version of the .NET Framework for Silverlight does not use this parameter when resolving URIs. This parameter is provided for future extensibility purposes. For example, this parameter can be mapped to the xlink:role and used as an implementation-specific argument in other scenarios. - The type of object to return. The supports objects and objects for URIs that were added as String. If the requested type is not supported by the resolver, an exception will be thrown. Use the method to determine whether a certain Type is supported by this resolver. - A or object that corresponds to the actual source. - absoluteUri is null. - Cannot resolve URI passed in absoluteUri. -or- ofObjectToReturn is not of a supported type. - - - Asynchronously maps a URI to an object that contains the actual resource. - The URI returned from . - The current version of the .NET Framework for Silverlight does not use this parameter when resolving URIs. This parameter is provided for future extensibility purposes. For example, this parameter can be mapped to the xlink:role and used as an implementation-specific argument in other scenarios. - The type of object to return. The supports objects and objects for URIs that were added as String. If the requested type is not supported by the resolver, an exception will be thrown. Use the method to determine whether a certain Type is supported by this resolver. - A or object that corresponds to the actual source. - - - Gets a collection of preloaded URIs. - The collection of preloaded URIs. - - - Removes the data that corresponds to the URI from the . - The URI of the data that should be removed from the store. - uri is null. - - - Resolves the absolute URI from the base and relative URIs. - The base URI used to resolve the relative URI. - The URI to resolve. The URI can be absolute or relative. If absolute, this value effectively replaces the baseUri value. If relative, it combines with the baseUri to make an absolute URI. - The representing the absolute URI or null if the relative URI cannot be resolved. - uri is null. - - - Determines whether the resolver supports other s than just . - The absolute URI to check. - The to return. - true if the is supported; otherwise, false. - uri is null. - - - This class contains the LINQ to XML extension methods for XSD validation. - - - Gets the post-schema-validation infoset (PSVI) of a validated attribute. - An that has been previously validated. - A that contains the post-schema-validation infoset for an . - - - Gets the post-schema-validation infoset (PSVI) of a validated element. - An that has been previously validated. - A that contains the post-schema-validation infoset (PSVI) for an . - - - This method validates that an conforms to an XSD in an . - The to validate. - An to validate against. - A for an event that occurs when the reader encounters validation errors. If null, throws an exception upon validation errors. - Thrown for XML Schema Definition Language (XSD) validation errors. - - - This method validates that an conforms to a specified and an . - The to validate. - An that specifies the sub-tree to validate. - An to validate against. - A for an event that occurs when the reader encounters validation errors. If null, throws an exception upon validation errors. - Thrown for XML Schema Definition Language (XSD) validation errors. - - - Validates that an conforms to an XSD in an , optionally populating the XML tree with the post-schema-validation infoset (PSVI). - The to validate. - An to validate against. - A for an event that occurs when the reader encounters validation errors. If null, throws an exception upon validation errors. - A indicating whether to populate the post-schema-validation infoset (PSVI). - Thrown for XML Schema Definition Language (XSD) validation errors. - - - This method validates that an sub-tree conforms to a specified and an . - The to validate. - An that specifies the sub-tree to validate. - An to validate against. - A for an event that occurs when the reader encounters validation errors. If null, throws an exception upon validation errors. - Thrown for XML Schema Definition Language (XSD) validation errors. - - - Validates that an conforms to a specified and an , optionally populating the XML tree with the post-schema-validation infoset (PSVI). - The to validate. - An that specifies the sub-tree to validate. - An to validate against. - A for an event that occurs when the reader encounters validation errors. If null, throws an exception upon validation errors. - A indicating whether to populate the post-schema-validation infoset (PSVI). - Thrown for XML Schema Definition Language (XSD) validation errors. - - - Validates that an sub-tree conforms to a specified and an , optionally populating the XML tree with the post-schema-validation infoset (PSVI). - The to validate. - An that specifies the sub-tree to validate. - An to validate against. - A for an event that occurs when the reader encounters validation errors. If null, throws an exception upon validation errors. - A indicating whether to populate the post-schema-validation infoset (PSVI). - Thrown for XML Schema Definition Language (XSD) validation errors. - - - Defines the post-schema-validation infoset of a validated XML node. - - - Gets a value indicating if this validated XML node was set as the result of a default being applied during XML Schema Definition Language (XSD) schema validation. - true if this validated XML node was set as the result of a default being applied during schema validation; otherwise, false. - - - Gets a value indicating if the value for this validated XML node is nil. - true if the value for this validated XML node is nil; otherwise, false. - - - Gets the dynamic schema type for this validated XML node. - An object that represents the dynamic schema type for this validated XML node. - - - Gets the compiled that corresponds to this validated XML node. - An that corresponds to this validated XML node. - - - Gets the compiled that corresponds to this validated XML node. - An that corresponds to this validated XML node. - - - Gets the static XML Schema Definition Language (XSD) schema type of this validated XML node. - An of this validated XML node. - - - Gets the value of this validated XML node. - An value of this validated XML node. - - - Returns detailed information related to the ValidationEventHandler. - - - Gets the associated with the validation event. - The XmlSchemaException associated with the validation event. - - - Gets the text description corresponding to the validation event. - The text description. - - - Gets the severity of the validation event. - An value representing the severity of the validation event. - - - Represents the callback method that will handle XML schema validation events and the . - The source of the event. Note Determine the type of a sender before using it in your code. You cannot assume that the sender is an instance of a particular type. The sender is also not guaranteed to not be null. Always surround your casts with failure handling logic. - The event data. - - - Represents the typed value of a validated XML element or attribute. The class cannot be inherited. - - - Returns a copy of this object. - An object copy of this object. - - - Gets a value indicating whether the validated XML element or attribute is an XPath node or an atomic value. - true if the validated XML element or attribute is an XPath node; false if the validated XML element or attribute is an atomic value. - - - Gets the string value of the validated XML element or attribute. - The string value of the validated XML element or attribute. - - - Gets the current validated XML element or attribute as a boxed object of the most appropriate Microsoft .NET Framework type according to its schema type. - The current validated XML element or attribute as a boxed object of the most appropriate .NET Framework type. - - - Gets the string value of the validated XML element or attribute. - The string value of the validated XML element or attribute. - - - Returns the validated XML element or attribute's value as the type specified using the object specified to resolve namespace prefixes. - The type to return the validated XML element or attribute's value as. - The object used to resolve namespace prefixes. - The value of the validated XML element or attribute as the type requested. - The validated XML element or attribute's value is not in the correct format for the target type. - The attempted cast is not valid. - The attempted cast resulted in an overflow. - - - Gets the validated XML element or attribute's value as a . - The validated XML element or attribute's value as a . - The validated XML element or attribute's value is not in the correct format for the type. - The attempted cast to is not valid. - - - Gets the validated XML element or attribute's value as a . - The validated XML element or attribute's value as a . - The validated XML element or attribute's value is not in the correct format for the type. - The attempted cast to is not valid. - - - Gets the validated XML element or attribute's value as a . - The validated XML element or attribute's value as a . - The validated XML element or attribute's value is not in the correct format for the type. - The attempted cast to is not valid. - The attempted cast resulted in an overflow. - - - Gets the validated XML element or attribute's value as an . - The validated XML element or attribute's value as an . - The validated XML element or attribute's value is not in the correct format for the type. - The attempted cast to is not valid. - The attempted cast resulted in an overflow. - - - Gets the validated XML element or attribute's value as an . - The validated XML element or attribute's value as an . - The validated XML element or attribute's value is not in the correct format for the type. - The attempted cast to is not valid. - The attempted cast resulted in an overflow. - - - Gets the Microsoft .NET Framework type of the validated XML element or attribute. - The .NET Framework type of the validated XML element or attribute. The default value is . - - - Gets the for the validated XML element or attribute. - The for the validated XML element or attribute. - - - For a description of this member, see . - Returns a copy of this object. - - - An in-memory representation of an XML Schema, as specified in the World Wide Web Consortium (W3C) XML Schema Part 1: Structures and XML Schema Part 2: Datatypes specifications. - - - Initializes a new instance of the class. - - - Gets or sets the form for attributes declared in the target namespace of the schema. - The value that indicates if attributes from the target namespace are required to be qualified with the namespace prefix. The default is . - - - Gets the post-schema-compilation value of all the global attribute groups in the schema. - An collection of all the global attribute groups in the schema. - - - Gets the post-schema-compilation value for all the attributes in the schema. - An collection of all the attributes in the schema. - - - Gets or sets the blockDefault attribute which sets the default value of the block attribute on element and complex types in the targetNamespace of the schema. - An value representing the different methods for preventing derivation. The default value is XmlSchemaDerivationMethod.None. - - - Compiles the XML Schema Object Model (SOM) into schema information for validation. Used to check the syntactic and semantic structure of the programmatically built SOM. Semantic validation checking is performed during compilation. - The validation event handler that receives information about XML Schema validation errors. - - - Compiles the XML Schema Object Model (SOM) into schema information for validation. Used to check the syntactic and semantic structure of the programmatically built SOM. Semantic validation checking is performed during compilation. - The validation event handler that receives information about the XML Schema validation errors. - The XmlResolver used to resolve namespaces referenced in include and import elements. - - - Gets or sets the form for elements declared in the target namespace of the schema. - The value that indicates if elements from the target namespace are required to be qualified with the namespace prefix. The default is . - - - Gets the post-schema-compilation value for all the elements in the schema. - An collection of all the elements in the schema. - - - Gets or sets the finalDefault attribute which sets the default value of the final attribute on elements and complex types in the target namespace of the schema. - An value representing the different methods for preventing derivation. The default value is XmlSchemaDerivationMethod.None. - - - Gets the post-schema-compilation value of all the groups in the schema. - An collection of all the groups in the schema. - - - Gets or sets the string ID. - The ID of the string. The default value is String.Empty. - - - Gets the collection of included and imported schemas. - An of the included and imported schemas. - - - The XML schema instance namespace. This field is constant. - - - - Indicates if the schema has been compiled. - true if schema has been compiled, otherwise, false. The default value is false. - - - Gets the collection of schema elements in the schema and is used to add new element types at the schema element level. - An of schema elements in the schema. - - - The XML schema namespace. This field is constant. - - - - Gets the post-schema-compilation value for all notations in the schema. - An collection of all notations in the schema. - - - Reads an XML Schema from the supplied stream. - The supplied data stream. - The validation event handler that receives information about XML Schema syntax errors. - The object representing the XML Schema. - An is raised if no is specified. - - - Reads an XML Schema from the supplied . - The TextReader containing the XML Schema to read. - The validation event handler that receives information about the XML Schema syntax errors. - The object representing the XML Schema. - An is raised if no is specified. - - - Reads an XML Schema from the supplied . - The XmlReader containing the XML Schema to read. - The validation event handler that receives information about the XML Schema syntax errors. - The object representing the XML Schema. - An is raised if no is specified. - - - Gets the post-schema-compilation value of all schema types in the schema. - An of all schema types in the schema. - - - Gets or sets the Uniform Resource Identifier (URI) of the schema target namespace. - The schema target namespace. - - - Gets and sets the qualified attributes which do not belong to the schema target namespace. - An array of qualified objects that do not belong to the schema target namespace. - - - Gets or sets the version of the schema. - The version of the schema. The default value is String.Empty. - - - Writes the XML Schema to the supplied data stream. - The supplied data stream. - - - Writes the XML Schema to the supplied . - The to write to. - - - Writes the XML Schema to the supplied . - The to write to. - The writer parameter is null. - - - Writes the XML Schema to the supplied using the specified. - The supplied data stream. - The . - - - Writes the XML Schema to the supplied . - The to write to. - The . - - - Writes the XML Schema to the supplied . - The to write to. - The . - - - Represents the World Wide Web Consortium (W3C) all element (compositor). - - - Initializes a new instance of the class. - - - Gets the collection of XmlSchemaElement elements contained within the all compositor. - The collection of elements contained in XmlSchemaAll. - - - The base class for any element that can contain annotation elements. - - - Initializes a new instance of the class. - - - Gets or sets the annotation property. - An representing the annotation property. - - - Gets or sets the string id. - The string id. The default is String.Empty. Optional. - - - Gets or sets the qualified attributes that do not belong to the current schema's target namespace. - An array of qualified objects that do not belong to the schema's target namespace. - - - Represents the World Wide Web Consortium (W3C) annotation element. - - - Initializes a new instance of the class. - - - Gets or sets the string id. - The string id. The default is String.Empty. Optional. - - - Gets the Items collection that is used to store the appinfo and documentation child elements. - An of appinfo and documentation child elements. - - - Gets or sets the qualified attributes that do not belong to the schema's target namespace. - An array of objects that do not belong to the schema's target namespace. - - - Represents the World Wide Web Consortium (W3C) any element. - - - Initializes a new instance of the class. - - - Gets or sets the namespaces containing the elements that can be used. - Namespaces for elements that are available for use. The default is ##any. Optional. - - - Gets or sets information about how an application or XML processor should handle the validation of XML documents for the elements specified by the any element. - One of the values. If no processContents attribute is specified, the default is Strict. - - - Represents the World Wide Web Consortium (W3C) anyAttribute element. - - - Initializes a new instance of the class. - - - Gets or sets the namespaces containing the attributes that can be used. - Namespaces for attributes that are available for use. The default is ##any. Optional. - - - Gets or sets information about how an application or XML processor should handle the validation of XML documents for the attributes specified by the anyAttribute element. - One of the values. If no processContents attribute is specified, the default is Strict. - - - Represents the World Wide Web Consortium (W3C) appinfo element. - - - Initializes a new instance of the class. - - - Gets or sets an array of objects that represents the appinfo child nodes. - An array of objects that represents the appinfo child nodes. - - - Gets or sets the source of the application information. - A Uniform Resource Identifier (URI) reference. The default is String.Empty. Optional. - - - Represents the attribute element from the XML Schema as specified by the World Wide Web Consortium (W3C). Attributes provide additional information for other document elements. The attribute tag is nested between the tags of a document's element for the schema. The XML document displays attributes as named items in the opening tag of an element. - - - Initializes a new instance of the class. - - - Gets an object representing the type of the attribute based on the or of the attribute. - An object. - - - Gets the common language runtime (CLR) object based on the or of the attribute that holds the post-compilation value of the AttributeType property. - The common runtime library (CLR) object that holds the post-compilation value of the AttributeType property. - - - Gets or sets the default value for the attribute. - The default value for the attribute. The default is a null reference. Optional. - - - Gets or sets the fixed value for the attribute. - The fixed value for the attribute. The default is null. Optional. - - - Gets or sets the form for the attribute. - One of the values. The default is the value of the of the schema element containing the attribute. Optional. - - - Gets or sets the name of the attribute. - The name of the attribute. - - - Gets the qualified name for the attribute. - The post-compilation value of the QualifiedName property. - - - Gets or sets the name of an attribute declared in this schema (or another schema indicated by the specified namespace). - The name of the attribute declared. - - - Gets or sets the attribute type to a simple type. - The simple type defined in this schema. - - - Gets or sets the name of the simple type defined in this schema (or another schema indicated by the specified namespace). - The name of the simple type. - - - Gets or sets information about how the attribute is used. - One of the following values: None, Prohibited, Optional, or Required. The default is Optional. Optional. - - - Represents the attributeGroup element from the XML Schema as specified by the World Wide Web Consortium (W3C). AttributesGroups provides a mechanism to group a set of attribute declarations so that they can be incorporated as a group into complex type definitions. - - - Initializes a new instance of the class. - - - Gets or sets the component of the attribute group. - The World Wide Web Consortium (W3C) anyAttribute element. - - - Gets the collection of attributes for the attribute group. Contains XmlSchemaAttribute and XmlSchemaAttributeGroupRef elements. - The collection of attributes for the attribute group. - - - Gets or sets the name of the attribute group. - The name of the attribute group. - - - Gets the qualified name of the attribute group. - The qualified name of the attribute group. - - - Gets the redefined attribute group property from the XML Schema. - The redefined attribute group property. - - - Represents the attributeGroup element with the ref attribute from the XML Schema as specified by the World Wide Web Consortium (W3C). AttributesGroupRef is the reference for an attributeGroup, name property contains the attribute group being referenced. - - - Initializes a new instance of the class. - - - Gets or sets the name of the referenced attributeGroup element. - The name of the referenced attribute group. The value must be a QName. - - - Represents the choice element (compositor) from the XML Schema as specified by the World Wide Web Consortium (W3C). The choice allows only one of its children to appear in an instance. - - - Initializes a new instance of the class. - - - Gets the collection of the elements contained with the compositor (choice): XmlSchemaElement, XmlSchemaGroupRef, XmlSchemaChoice, XmlSchemaSequence, or XmlSchemaAny. - The collection of elements contained within XmlSchemaChoice. - - - Contains a cache of XML Schema definition language (XSD) and XML-Data Reduced (XDR) schemas. The class class is obsolete. Use instead. - - - Initializes a new instance of the XmlSchemaCollection class. - - - Initializes a new instance of the XmlSchemaCollection class with the specified . The XmlNameTable is used when loading schemas. - The XmlNameTable to use. - - - Adds the to the collection. - The XmlSchema to add to the collection. - The XmlSchema object. - - - Adds all the namespaces defined in the given collection (including their associated schemas) to this collection. - The XmlSchemaCollection you want to add to this collection. - - - Adds the schema located by the given URL into the schema collection. - The namespace URI associated with the schema. For XML Schemas, this will typically be the targetNamespace. - The URL that specifies the schema to load. - The added to the schema collection; null if the schema being added is an XDR schema or if there are compilation errors in the schema. - The schema is not a valid schema. - - - Adds the schema contained in the to the schema collection. - The namespace URI associated with the schema. For XML Schemas, this will typically be the targetNamespace. - containing the schema to add. - The added to the schema collection; null if the schema being added is an XDR schema or if there are compilation errors in the schema. - The schema is not a valid schema. - - - Adds the to the collection. The specified is used to resolve any external references. - The XmlSchema to add to the collection. - The used to resolve namespaces referenced in include and import elements. If this is null, external references are not resolved. - The XmlSchema added to the schema collection. - The schema is not a valid schema. - - - Adds the schema contained in the to the schema collection. The specified is used to resolve any external resources. - The namespace URI associated with the schema. For XML Schemas, this will typically be the targetNamespace. - containing the schema to add. - The used to resolve namespaces referenced in include and import elements or x-schema attribute (XDR schemas). If this is null, external references are not resolved. - The added to the schema collection; null if the schema being added is an XDR schema or if there are compilation errors in the schema. - The schema is not a valid schema. - - - Gets a value indicating whether a schema with the specified namespace is in the collection. - The namespace URI associated with the schema. For XML Schemas, this will typically be the target namespace. - true if a schema with the specified namespace is in the collection; otherwise, false. - - - Gets a value indicating whether the targetNamespace of the specified is in the collection. - The XmlSchema object. - true if there is a schema in the collection with the same targetNamespace; otherwise, false. - - - Copies all the XmlSchema objects from this collection into the given array starting at the given index. - The array to copy the objects to. - The index in array where copying will begin. - - - Gets the number of namespaces defined in this collection. - The number of namespaces defined in this collection. - - - Provides support for the "for each" style iteration over the collection of schemas. - An enumerator for iterating over all schemas in the current collection. - - - Gets the associated with the given namespace URI. - The namespace URI associated with the schema you want to return. This will typically be the targetNamespace of the schema. - The XmlSchema associated with the namespace URI; null if there is no loaded schema associated with the given namespace or if the namespace is associated with an XDR schema. - - - Gets the default XmlNameTable used by the XmlSchemaCollection when loading new schemas. - An XmlNameTable. - - - Sets an event handler for receiving information about the XDR and XML schema validation errors. - - - - For a description of this member, see . - The array to copy the objects to. - The index in array where copying will begin. - - - For a description of this member, see . - Returns the count of the items in the collection. - - - For a description of this member, see . - Returns true if the collection is synchronized, otherwise false. - - - For a description of this member, see . - Returns a object that can be used to synchronize access to the collection. - - - For a description of this member, see . - Returns the for the collection. - - - Supports a simple iteration over a collection. This class cannot be inherited. - - - Gets the current in the collection. - The current XmlSchema in the collection. - - - Advances the enumerator to the next schema in the collection. - true if the move was successful; false if the enumerator has passed the end of the collection. - - - For a description of this member, see . - Returns the current node. - - - For a description of this member, see . - Returns the next node. - - - For a description of this member, see . - - - Provides schema compilation options for the class This class cannot be inherited. - - - Initializes a new instance of the class. - - - Gets or sets a value indicating whether the should check for Unique Particle Attribution (UPA) violations. - true if the should check for Unique Particle Attribution (UPA) violations; otherwise, false. The default is true. - - - Represents the complexContent element from XML Schema as specified by the World Wide Web Consortium (W3C). This class represents the complex content model for complex types. It contains extensions or restrictions on a complex type that has either only elements or mixed content. - - - Initializes a new instance of the class. - - - Gets or sets the content. - One of either the or classes. - - - Gets or sets information that determines if the type has a mixed content model. - If this property is true, character data is allowed to appear between the child elements of the complex type (mixed content model). The default is false. Optional. - - - Represents the extension element from XML Schema as specified by the World Wide Web Consortium (W3C). This class is for complex types with complex content model derived by extension. It extends the complex type by adding attributes or elements. - - - Initializes a new instance of the class. - - - Gets or sets the component of the complex content model. - The component of the complex content model. - - - Gets the collection of attributes for the complex content. Contains and elements. - The collection of attributes for the complex content. - - - Gets or sets the name of the complex type from which this type is derived by extension. - The name of the complex type from which this type is derived by extension. - - - Gets or sets one of the , , , or classes. - One of the , , , or classes. - - - Represents the restriction element from XML Schema as specified by the World Wide Web Consortium (W3C). This class is for complex types with a complex content model derived by restriction. It restricts the contents of the complex type to a subset of the inherited complex type. - - - Initializes a new instance of the class. - - - Gets or sets the component of the complex content model. - The component of the complex content model. - - - Gets the collection of attributes for the complex type. Contains the and elements. - The collection of attributes for the complex type. - - - Gets or sets the name of a complex type from which this type is derived by restriction. - The name of the complex type from which this type is derived by restriction. - - - Gets or sets one of the , , , or classes. - One of the , , , or classes. - - - Represents the complexType element from XML Schema as specified by the World Wide Web Consortium (W3C). This class defines a complex type that determines the set of attributes and content of an element. - - - Initializes a new instance of the class. - - - Gets or sets the value for the component of the complex type. - The component of the complex type. - - - Gets the collection of attributes for the complex type. - Contains and classes. - - - Gets the collection of all the complied attributes of this complex type and its base types. - The collection of all the attributes from this complex type and its base types. The post-compilation value of the AttributeUses property. - - - Gets the post-compilation value for anyAttribute for this complex type and its base type(s). - The post-compilation value of the anyAttribute element. - - - Gets or sets the block attribute. - The block attribute prevents a complex type from being used in the specified type of derivation. The default is XmlSchemaDerivationMethod.None. Optional. - - - Gets the value after the type has been compiled to the post-schema-validation information set (infoset). This value indicates how the type is enforced when xsi:type is used in the instance document. - The post-schema-validated infoset value. The default is BlockDefault value on the schema element. - - - Gets or sets the post-compilation of this complex type. - The content model type that is one of the or classes. - - - Gets the content model of the complex type which holds the post-compilation value. - The post-compilation value of the content model for the complex type. - - - Gets the particle that holds the post-compilation value of the particle. - The particle for the content type. The post-compilation value of the particle. - - - Gets or sets the information that determines if the complexType element can be used in the instance document. - If true, an element cannot use this complexType element directly and must use a complex type that is derived from this complexType element. The default is false. Optional. - - - Gets or sets information that determines if the complex type has a mixed content model (markup within the content). - true, if character data can appear between child elements of this complex type; otherwise, false. The default is false. Optional. - - - Gets or sets the compositor type as one of the , , , or classes. - The compositor type. - - - An abstract class for schema content. - - - Initializes a new instance of the class. - - - Specifies the order and structure of the child elements of a type. - - - Initializes a new instance of the class. - - - Gets or sets the content of the type. - Provides the content of the type. - - - Provides information about the validation mode of any and anyAttribute element replacements. - - - If the associated schema is found, the document items will be validated. No errors will be thrown otherwise. - - - - Document items are not validated. - - - - Document items must consist of well-formed XML and are not validated by the schema. - - - - The schema processor must find a schema associated with the indicated namespace to validate the document items. - - - - Enumerations for the content model of the complex type. This represents the content in the post-schema-validation information set (infoset). - - - Element-only content. - - - - Empty content. - - - - Mixed content. - - - - Text-only content. - - - - The class is an abstract class for mapping XML Schema definition language (XSD) types to Common Language Runtime (CLR) types. - - - Initializes a new instance of the class. - - - Converts the value specified, whose type is one of the valid Common Language Runtime (CLR) representations of the XML schema type represented by the , to the CLR type specified. - The input value to convert to the specified type. - The target type to convert the input value to. - The converted input value. - The or parameter is null. - The type represented by the does not support a conversion from type of the value specified to the type specified. - - - Converts the value specified, whose type is one of the valid Common Language Runtime (CLR) representations of the XML schema type represented by the , to the CLR type specified using the if the represents the xs:QName type or a type derived from it. - The input value to convert to the specified type. - The target type to convert the input value to. - An used for resolving namespace prefixes. This is only of use if the represents the xs:QName type or a type derived from it. - The converted input value. - The or parameter is null. - The type represented by the does not support a conversion from type of the value specified to the type specified. - - - The method always returns false. - The . - Always returns false. - - - When overridden in a derived class, validates the string specified against a built-in or user-defined simple type. - The string to validate against the simple type. - The to use for atomization while parsing the string if this object represents the xs:NCName type. - The object to use while parsing the string if this object represents the xs:QName type. - An that can be cast safely to the type returned by the property. - The input value is not a valid instance of this W3C XML Schema type. - The value to parse cannot be null. - - - When overridden in a derived class, gets the type for the string as specified in the World Wide Web Consortium (W3C) XML 1.0 specification. - An value for the string. - - - Gets the value for the simple type. - The value for the simple type. - - - When overridden in a derived class, gets the Common Language Runtime (CLR) type of the item. - The Common Language Runtime (CLR) type of the item. - - - Gets the value for the simple type. - The value for the simple type. - - - Specifies the W3C XML schema data type variety of the type. - - - A W3C XML schema atomic type. - - - - A W3C XML schema list type. - - - - A W3C XML schema union type. - - - - Provides different methods for preventing derivation. - - - #all. Refers to all derivation methods. - - - - Override default derivation method to allow any derivation. - - - - Refers to derivations by Extension. - - - - Refers to derivations by List. - - - - Accepts the default derivation method. - - - - Refers to derivations by Restriction. - - - - Refers to derivations by Substitution. - - - - Refers to derivations by Union. - - - - Represents the documentation element from XML Schema as specified by the World Wide Web Consortium (W3C). This class specifies information to be read or used by humans within an annotation. - - - Initializes a new instance of the class. - - - Gets or sets the xml:lang attribute. This serves as an indicator of the language used in the contents. - The xml:lang attribute. Optional. - - - Gets or sets an array of XmlNodes that represents the documentation child nodes. - The array that represents the documentation child nodes. - - - Gets or sets the Uniform Resource Identifier (URI) source of the information. - A URI reference. The default is String.Empty. Optional. - - - Represents the element element from XML Schema as specified by the World Wide Web Consortium (W3C). This class is the base class for all particle types and is used to describe an element in an XML document. - - - Initializes a new instance of the class. - - - Gets or sets a Block derivation. - The attribute used to block a type derivation. Default value is XmlSchemaDerivationMethod.None. Optional. - - - Gets the post-compilation value of the Block property. - The post-compilation value of the Block property. The default is the BlockDefault value on the schema element. - - - Gets the collection of constraints on the element. - The collection of constraints. - - - Gets or sets the default value of the element if its content is a simple type or content of the element is textOnly. - The default value for the element. The default is a null reference. Optional. - - - Gets an object representing the type of the element based on the or values of the element. - An object. - - - Gets a common language runtime (CLR) object based on the or of the element, which holds the post-compilation value of the ElementType property. - The common language runtime object. The post-compilation value of the ElementType property. - - - Gets or sets the Final property to indicate that no further derivations are allowed. - The Final property. The default is XmlSchemaDerivationMethod.None. Optional. - - - Gets the post-compilation value of the Final property. - The post-compilation value of the Final property. Default value is the FinalDefault value on the schema element. - - - Gets or sets the fixed value. - The fixed value that is predetermined and unchangeable. The default is a null reference. Optional. - - - Gets or sets the form for the element. - The form for the element. The default is the value. Optional. - - - Gets or sets information to indicate if the element can be used in an instance document. - If true, the element cannot appear in the instance document. The default is false. Optional. - - - Gets or sets information that indicates if xsi:nil can occur in the instance data. Indicates if an explicit nil value can be assigned to the element. - If nillable is true, this enables an instance of the element to have the nil attribute set to true. The nil attribute is defined as part of the XML Schema namespace for instances. The default is false. Optional. - - - Gets or sets the name of the element. - The name of the element. The default is String.Empty. - - - Gets the actual qualified name for the given element. - The qualified name of the element. The post-compilation value of the QualifiedName property. - - - Gets or sets the reference name of an element declared in this schema (or another schema indicated by the specified namespace). - The reference name of the element. - - - Gets or sets the type of the element. This can either be a complex type or a simple type. - The type of the element. - - - Gets or sets the name of a built-in data type defined in this schema or another schema indicated by the specified namespace. - The name of the built-in data type. - - - Gets or sets the name of an element that is being substituted by this element. - The qualified name of an element that is being substituted by this element. Optional. - - - Represents the enumeration facet from XML Schema as specified by the World Wide Web Consortium (W3C). This class specifies a list of valid values for a simpleType element. Declaration is contained within a restriction declaration. - - - Initializes a new instance of the class. - - - Returns detailed information about the schema exception. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with the exception message specified. - A string description of the error condition. - - - Constructs a new XmlSchemaException object with the given SerializationInfo and StreamingContext information that contains all the properties of the XmlSchemaException. - SerializationInfo. - StreamingContext. - - - Initializes a new instance of the class with the exception message and original object that caused this exception specified. - A string description of the error condition. - The original T:System.Exception object that caused this exception. - - - Initializes a new instance of the class with the exception message specified, and the original object, line number, and line position of the XML that cause this exception specified. - A string description of the error condition. - The original T:System.Exception object that caused this exception. - The line number of the XML that caused this exception. - The line position of the XML that caused this exception. - - - Streams all the XmlSchemaException properties into the SerializationInfo class for the given StreamingContext. - The SerializationInfo. - The StreamingContext information. - - - Gets the line number indicating where the error occurred. - The line number indicating where the error occurred. - - - Gets the line position indicating where the error occurred. - The line position indicating where the error occurred. - - - Gets the description of the error condition of this exception. - The description of the error condition of this exception. - - - The XmlSchemaObject that produced the XmlSchemaException. - A valid object instance represents a structural validation error in the XML Schema Object Model (SOM). - - - Gets the Uniform Resource Identifier (URI) location of the schema that caused the exception. - The URI location of the schema that caused the exception. - - - An abstract class. Provides information about the included schema. - - - Initializes a new instance of the class. - - - Gets or sets the string id. - The string id. The default is String.Empty. Optional. - - - Gets or sets the XmlSchema for the referenced schema. - The XmlSchema for the referenced schema. - - - Gets or sets the Uniform Resource Identifier (URI) location for the schema, which tells the schema processor where the schema physically resides. - The URI location for the schema. Optional for imported schemas. - - - Gets and sets the qualified attributes, which do not belong to the schema target namespace. - Qualified attributes that belong to another target namespace. - - - Abstract class for all facets that are used when simple types are derived by restriction. - - - Initializes a new instance of the class. - - - Gets or sets information that indicates that this facet is fixed. - If true, value is fixed; otherwise, false. The default is false. Optional. - - - Gets or sets the value attribute of the facet. - The value attribute. - - - Indicates if attributes or elements need to be qualified with a namespace prefix. - - - Element and attribute form is not specified in the schema. - - - - Elements and attributes must be qualified with a namespace prefix. - - - - Elements and attributes are not required to be qualified with a namespace prefix. - - - - Specifies a restriction on the number of digits that can be entered for the fraction value of a simpleType element. The value of fractionDigits must be a positive integer. Represents the World Wide Web Consortium (W3C) fractionDigits facet. - - - Initializes a new instance of the class. - - - Transforms XML data using an XSLT style sheet. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with the specified debug setting. - true to generate debug information; otherwise false. Setting this to true enables you to debug the style sheet with the Microsoft Visual Studio Debugger. - - - Compiles the XSLT style sheet contained in the . The resolves any XSLT import or include elements and the XSLT settings determine the permissions for the style sheet. - An object implementing the interface. In the Microsoft .NET Framework, this can be either an (typically an ), or an containing the style sheet. - The to apply to the style sheet. If this is null, the setting is applied. - The used to resolve any style sheets referenced in XSLT import and include elements. If this is null, external resources are not resolved. - The stylesheet value is null. - The style sheet contains an error. - - - Loads and compiles the XSLT style sheet specified by the URI. The resolves any XSLT import or include elements and the XSLT settings determine the permissions for the style sheet. - The URI of the style sheet. - The to apply to the style sheet. If this is null, the setting is applied. - The used to resolve the style sheet URI and any style sheets referenced in XSLT import and include elements. - The stylesheetUri or stylesheetResolver value is null. - The style sheet contains an error. - The style sheet cannot be found. - The stylesheetUri value includes a filename or directory that cannot be found. - The stylesheetUri value cannot be resolved. -or- An error occurred while processing the request. - stylesheetUri is not a valid URI. - There was a parsing error loading the style sheet. - - - Loads a method from a style sheet compiled using the XSLTC.exe utility. - A object representing the compiler-generated execute method of the compiled style sheet. - A byte array of serialized data structures in the staticData field of the compiled style sheet as generated by the method. - An array of types stored in the compiler-generated ebTypes field of the compiled style sheet. - - - Compiles the XSLT style sheet contained in the . The resolves any XSLT import or include elements and the XSLT settings determine the permissions for the style sheet. - The containing the style sheet. - The to apply to the style sheet. If this is null, the setting is applied. - The used to resolve any style sheets referenced in XSLT import and include elements. If this is null, external resources are not resolved. - The stylesheet value is null. - The style sheet contains an error. - - - Compiles the style sheet contained in the . - An containing the style sheet. - The stylesheet value is null. - The style sheet contains an error. - - - Loads the compiled style sheet that was created using the XSLT Compiler (xsltc.exe). - The name of the class that contains the compiled style sheet. This is usually the name of the style sheet. Unless otherwise specified, the xsltc.exe tool uses the name of the style sheet for the class and assembly names. - - - Loads and compiles the style sheet located at the specified URI. - The URI of the style sheet. - The stylesheetUri value is null. - The style sheet contains an error. - The style sheet cannot be found. - The stylesheetUri value includes a filename or directory that cannot be found. - The stylesheetUri value cannot be resolved. -or- An error occurred while processing the request. - stylesheetUri is not a valid URI. - There was a parsing error loading the style sheet. - - - Compiles the style sheet contained in the object. - An object implementing the interface. In the Microsoft .NET Framework, this can be either an (typically an ), or an containing the style sheet. - The stylesheet value is null. - The style sheet contains an error. - - - Gets an object that contains the output information derived from the xsl:output element of the style sheet. - A read-only object that contains the output information derived from the xsl:output element of the style sheet. This value can be null. - - - Executes the transform using the input document specified by the object and outputs the results to a . The provides additional run-time arguments. - An containing the input document. - An containing the namespace-qualified arguments used as input to the transform. This value can be null. - The to which you want to output. - The input or results value is null. - There was an error executing the XSLT transform. - - - Executes the transform using the input document specified by the object and outputs the results to an . The provides additional run-time arguments. - An object implementing the interface. In the Microsoft .NET Framework, this can be either an (typically an ), or an containing the data to be transformed. - An containing the namespace-qualified arguments used as input to the transform. This value can be null. - The to which you want to output. If the style sheet contains an xsl:output element, you should create the using the object returned from the property. This ensures that the has the correct output settings. - The input or results value is null. - There was an error executing the XSLT transform. - - - Executes the transform using the input document specified by the object and outputs the results to an . The provides additional run-time arguments. - An object implementing the interface. In the Microsoft .NET Framework, this can be either an (typically an ), or an containing the data to be transformed. - An containing the namespace-qualified arguments used as input to the transform. This value can be null. - The to which you want to output. - The input or results value is null. - There was an error executing the XSLT transform. - - - Executes the transform using the input document specified by the object and outputs the results to a stream. The provides additional runtime arguments. - An object implementing the interface. In the Microsoft .NET Framework, this can be either an (typically an ), or an containing the data to be transformed. - An containing the namespace-qualified arguments used as input to the transform. This value can be null. - The stream to which you want to output. - The input or results value is null. - There was an error executing the XSLT transform. - - - Executes the transform using the input document specified by the object and outputs the results to an . The provides additional run-time arguments. - An containing the input document. - An containing the namespace-qualified arguments used as input to the transform. This value can be null. - The to which you want to output. If the style sheet contains an xsl:output element, you should create the using the object returned from the property. This ensures that the has the correct output settings. - The input or results value is null. - There was an error executing the XSLT transform. - - - Executes the transform using the input document specified by the object and outputs the results to a stream. The provides additional run-time arguments. - An containing the input document. - An containing the namespace-qualified arguments used as input to the transform. This value can be null. - The stream to which you want to output. - The input or results value is null. - There was an error executing the XSLT transform. - - - Executes the transform using the input document specified by the URI and outputs the results to a file. - The URI of the input document. - The URI of the output file. - The inputUri or resultsFile value is null. - There was an error executing the XSLT transform. - The input document cannot be found. - The inputUri or resultsFile value includes a filename or directory cannot be found. - The inputUri or resultsFile value cannot be resolved. -or- An error occurred while processing the request - inputUri or resultsFile is not a valid URI. - There was a parsing error loading the input document. - - - Executes the transform using the input document specified by the URI and outputs the results to a . - The URI of the input document. - An containing the namespace-qualified arguments used as input to the transform. This value can be null. - The to which you want to output. - The inputUri or results value is null. - There was an error executing the XSLT transform. - The inputUri value includes a filename or directory cannot be found. - The inputUri value cannot be resolved. -or- An error occurred while processing the request - inputUri is not a valid URI. - There was a parsing error loading the input document. - - - Executes the transform using the input document specified by the URI and outputs the results to stream. The provides additional run-time arguments. - The URI of the input document. - An containing the namespace-qualified arguments used as input to the transform. This value can be null. - The stream to which you want to output. - The inputUri or results value is null. - There was an error executing the XSLT transform. - The inputUri value includes a filename or directory cannot be found. - The inputUri value cannot be resolved. -or- An error occurred while processing the request - inputUri is not a valid URI. - There was a parsing error loading the input document. - - - Executes the transform using the input document specified by the object and outputs the results to an . - An object implementing the interface. In the Microsoft .NET Framework, this can be either an (typically an ), or an containing the data to be transformed. - The to which you want to output. If the style sheet contains an xsl:output element, you should create the using the object returned from the property. This ensures that the has the correct output settings. - The input or results value is null. - There was an error executing the XSLT transform. - - - Executes the transform using the input document specified by the object and outputs the results to an . - The containing the input document. - The to which you want to output. If the style sheet contains an xsl:output element, you should create the using the object returned from the property. This ensures that the has the correct output settings. - The input or results value is null. - There was an error executing the XSLT transform. - - - Executes the transform using the input document specified by the URI and outputs the results to an . - The URI of the input document. - The to which you want to output. If the style sheet contains an xsl:output element, you should create the using the object returned from the property. This ensures that the has the correct output settings. - The inputUri or results value is null. - There was an error executing the XSLT transform. - The inputUri value includes a filename or directory cannot be found. - The inputUri value cannot be resolved. -or- An error occurred while processing the request. - inputUri is not a valid URI. - There was a parsing error loading the input document. - - - Executes the transform using the input document specified by the object and outputs the results to an . The provides additional run-time arguments and the XmlResolver resolves the XSLT document() function. - An containing the input document. - An containing the namespace-qualified arguments used as input to the transform. This value can be null. - The to which you want to output. If the style sheet contains an xsl:output element, you should create the using the object returned from the property. This ensures that the has the correct output settings. - The used to resolve the XSLT document() function. If this is null, the document() function is not resolved. - The input or results value is null. - There was an error executing the XSLT transform. - - - Executes the transform using the input document specified by the URI and outputs the results to an . The provides additional run-time arguments. - The URI of the input document. - An containing the namespace-qualified arguments used as input to the transform. This value can be null. - The to which you want to output. If the style sheet contains an xsl:output element, you should create the using the object returned from the property. This ensures that the has the correct output settings. - The inputUri or results value is null. - There was an error executing the XSLT transform. - The inputtUri value includes a filename or directory cannot be found. - The inputUri value cannot be resolved. -or- An error occurred while processing the request. - inputUri is not a valid URI. - There was a parsing error loading the input document. - - - Executes the transform by using the input document that is specified by the object and outputs the results to an . The provides additional run-time arguments and the resolves the XSLT document() function. - The document to transform that is specified by the object. - Argument list as . - The to which you want to output. If the style sheet contains an xsl:output element, you should create the by using the object that is returned from the property. This ensures that the has the correct output settings. - The used to resolve the XSLT document() function. If this is null, the document() function is not resolved. - - - Contains a variable number of arguments which are either XSLT parameters or extension objects. - - - Implements a new instance of the . - - - Adds a new object to the and associates it with the namespace URI. - The namespace URI to associate with the object. To use the default namespace, specify an empty string. - The object to add to the list. - The namespaceUri is either null or http://www.w3.org/1999/XSL/Transform The namespaceUri already has an extension object associated with it. - The caller does not have sufficient permissions to call this method. - - - Adds a parameter to the and associates it with the namespace qualified name. - The name to associate with the parameter. - The namespace URI to associate with the parameter. To use the default namespace, specify an empty string. - The parameter value or object to add to the list. - The namespaceUri is either null or http://www.w3.org/1999/XSL/Transform. The name is not a valid name according to the W3C XML specification. The namespaceUri already has a parameter associated with it. - - - Removes all parameters and extension objects from the . - - - Gets the object associated with the given namespace. - The namespace URI of the object. - The namespace URI object or null if one was not found. - - - Gets the parameter associated with the namespace qualified name. - The name of the parameter. does not check to ensure the name passed is a valid local name; however, the name cannot be null. - The namespace URI associated with the parameter. - The parameter object or null if one was not found. - - - Removes the object with the namespace URI from the . - The namespace URI associated with the object to remove. - The object with the namespace URI or null if one was not found. - - - Removes the parameter from the . - The name of the parameter to remove. does not check to ensure the name passed is a valid local name; however, the name cannot be null. - The namespace URI of the parameter to remove. - The parameter object or null if one was not found. - - - Occurs when a message is specified in the style sheet by the xsl:message element. - - - - The exception that is thrown by the Load method when an error is found in the XSLT style sheet. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with a specified error message. - The message that describes the error. - - - Initializes a new instance of the XsltCompileException class using the information in the and objects. - The SerializationInfo object containing all the properties of an XsltCompileException. - The StreamingContext object containing the context information. - - - Initializes a new instance of the class specified error message and a reference to the inner exception that is the cause of this exception. - The message that describes the error. - The exception that is the cause of the current exception, or null if no inner exception is specified. - - - Initializes a new instance of the XsltCompileException class. - The that threw the XsltCompileException. - The location path of the style sheet. - The line number indicating where the error occurred in the style sheet. - The line position indicating where the error occurred in the style sheet. - - - Streams all the XsltCompileException properties into the class for the given . - The SerializationInfo object. - The StreamingContext object. - - - Encapsulates the current execution context of the Extensible Stylesheet Language for Transformations (XSLT) processor allowing XML Path Language (XPath) to resolve functions, parameters, and namespaces within XPath expressions. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with the specified . - The to use. - - - When overridden in a derived class, compares the base Uniform Resource Identifiers (URIs) of two documents based upon the order the documents were loaded by the XSLT processor (that is, the class). - The base URI of the first document to compare. - The base URI of the second document to compare. - An integer value describing the relative order of the two base URIs: -1 if baseUri occurs before nextbaseUri; 0 if the two base URIs are identical; and 1 if baseUri occurs after nextbaseUri. - - - When overridden in a derived class, evaluates whether to preserve white space nodes or strip them for the given context. - The white space node that is to be preserved or stripped in the current context. - Returns true if the white space is to be preserved or false if the white space is to be stripped. - - - When overridden in a derived class, resolves a function reference and returns an representing the function. The is used at execution time to get the return value of the function. - The prefix of the function as it appears in the XPath expression. - The name of the function. - An array of argument types for the function being resolved. This allows you to select between methods with the same name (for example, overloaded methods). - An representing the function. - - - When overridden in a derived class, resolves a variable reference and returns an representing the variable. - The prefix of the variable as it appears in the XPath expression. - The name of the variable. - An representing the variable at runtime. - - - When overridden in a derived class, gets a value indicating whether to include white space nodes in the output. - true to check white space nodes in the source document for inclusion in the output; false to not evaluate white space nodes. The default is true. - - - The exception that is thrown when an error occurs while processing an XSLT transformation. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with a specified error message. - The message that describes the error. - - - Initializes a new instance of the XsltException class using the information in the and objects. - The SerializationInfo object containing all the properties of an XsltException. - The StreamingContext object. - - - Initializes a new instance of the XsltException class. - The description of the error condition. - The which threw the XsltException, if any. This value can be null. - - - Streams all the XsltException properties into the class for the given . - The SerializationInfo object. - The StreamingContext object. - - - Gets the line number indicating where the error occurred in the style sheet. - The line number indicating where the error occurred in the style sheet. - - - Gets the line position indicating where the error occurred in the style sheet. - The line position indicating where the error occurred in the style sheet. - - - Gets the formatted error message describing the current exception. - The formatted error message describing the current exception. - - - Gets the location path of the style sheet. - The location path of the style sheet. - - - Provides data for the event. - - - Initializes a new instance of the class. - - - Gets the contents of the xsl:message element. - The contents of the xsl:message element. - - - Represents the method that will handle the event. - The source of the event. - The containing the event data. - - - Transforms XML data using an Extensible Stylesheet Language for Transformations (XSLT) style sheet. - - - Initializes a new instance of the class. - - - Loads the XSLT style sheet contained in the . - An object that contains the XSLT style sheet. - The used to load any style sheets referenced in xsl:import and xsl:include elements. If this is null, external resources are not resolved. The is not cached after the method completes. - The current node does not conform to a valid style sheet. - The style sheet contains embedded scripts, and the caller does not have UnmanagedCode permission. - - - Loads the XSLT style sheet contained in the . - An object implementing the interface. In the .NET Framework, this can be either an (typically an ), or an containing the XSLT style sheet. - The used to load any style sheets referenced in xsl:import and xsl:include elements. If this is null, external resources are not resolved. The is not cached after the method completes. - The loaded resource is not a valid style sheet. - The style sheet contains embedded scripts, and the caller does not have UnmanagedCode permission. - - - Loads the XSLT style sheet contained in the . - An object that contains the XSLT style sheet. - The used to load any style sheets referenced in xsl:import and xsl:include elements. If this is null, external resources are not resolved. The is not cached after the method completes. - The current node does not conform to a valid style sheet. - The style sheet contains embedded scripts, and the caller does not have UnmanagedCode permission. - - - Loads the XSLT style sheet contained in the . - An object that contains the XSLT style sheet. - The current node does not conform to a valid style sheet. - The style sheet contains embedded scripts, and the caller does not have UnmanagedCode permission. - - - Loads the XSLT style sheet contained in the . - An object implementing the interface. In the .NET Framework, this can be either an (typically an ), or an containing the XSLT style sheet. - The loaded resource is not a valid style sheet. - The style sheet contains embedded scripts, and the caller does not have UnmanagedCode permission. - - - Loads the XSLT style sheet contained in the . - An object that contains the XSLT style sheet. - The current node does not conform to a valid style sheet. - The style sheet contains embedded scripts, and the caller does not have UnmanagedCode permission. - - - Loads the XSLT style sheet specified by a URL. - The URL that specifies the XSLT style sheet to load. - The loaded resource is not a valid style sheet. - The style sheet contains embedded script, and the caller does not have UnmanagedCode permission. - - - Loads the XSLT style sheet specified by a URL. - The URL that specifies the XSLT style sheet to load. - The to use to load the style sheet and any style sheet(s) referenced in xsl:import and xsl:include elements. If this is null, a default with no user credentials is used to open the style sheet. The default is not used to resolve any external resources in the style sheet, so xsl:import and xsl:include elements are not resolved. The is not cached after the method completes. - The loaded resource is not a valid style sheet. - The style sheet contains embedded script, and the caller does not have UnmanagedCode permission. - - - Transforms the XML data in the using the specified args and outputs the result to an . - An containing the data to be transformed. - An containing the namespace-qualified arguments used as input to the transformation. - The used to resolve the XSLT document() function. If this is null, the document() function is not resolved. The is not cached after the method completes. - An containing the results of the transformation. - There was an error processing the XSLT transformation. Note: This is a change in behavior from earlier versions. An is thrown if you are using Microsoft .NET Framework version 1.1 or earlier. - - - Transforms the XML data in the using the specified args and outputs the result to a . - An containing the data to be transformed. - An containing the namespace-qualified arguments used as input to the transformation. - The to which you want to output. - The used to resolve the XSLT document() function. If this is null, the document() function is not resolved. The is not cached after the method completes. - There was an error processing the XSLT transformation. Note: This is a change in behavior from earlier versions. An is thrown if you are using Microsoft .NET Framework version 1.1 or earlier. - - - Transforms the XML data in the using the specified args and outputs the result to a . - An containing the data to be transformed. - An containing the namespace-qualified arguments used as input to the transformation. - The stream to which you want to output. - The used to resolve the XSLT document() function. If this is null, the document() function is not resolved. The is not cached after the method completes. - There was an error processing the XSLT transformation. Note: This is a change in behavior from earlier versions. An is thrown if you are using Microsoft .NET Framework version 1.1 or earlier. - - - Transforms the XML data in the using the specified args and outputs the result to an . - An object implementing the interface. In the .NET Framework, this can be either an (typically an ), or an containing the data to be transformed. - An containing the namespace-qualified arguments used as input to the transformation. - The to which you want to output. - The used to resolve the XSLT document() function. If this is null, the document() function is not resolved. The is not cached after the method completes. - There was an error processing the XSLT transformation. Note: This is a change in behavior from earlier versions. An is thrown if you are using Microsoft .NET Framework version 1.1 or earlier. - - - Transforms the XML data in the using the specified args and outputs the result to a . - An object implementing the interface. In the .NET Framework, this can be either an (typically an ), or an containing the data to be transformed. - An containing the namespace-qualified arguments used as input to the transformation. - The to which you want to output. - The used to resolve the XSLT document() function. If this is null, the document() function is not resolved. The is not cached after the method completes. - There was an error processing the XSLT transformation. Note: This is a change in behavior from earlier versions. An is thrown if you are using Microsoft .NET Framework version 1.1 or earlier. - - - Transforms the XML data in the using the specified args and outputs the result to a . - An object implementing the interface. In the .NET Framework, this can be either an (typically an ), or an containing the data to be transformed. - An containing the namespace-qualified arguments used as input to the transformation. - The stream to which you want to output. - The used to resolve the XSLT document() function. If this is null, the document() function is not resolved. The is not cached after the method completes. - There was an error processing the XSLT transformation. Note: This is a change in behavior from earlier versions. An is thrown if you are using Microsoft .NET Framework version 1.1 or earlier. - - - Transforms the XML data in the using the specified args and outputs the result to an . - An containing the data to be transformed. - An containing the namespace-qualified arguments used as input to the transformation. - The to which you want to output. - There was an error processing the XSLT transformation. Note: This is a change in behavior from earlier versions. An is thrown if you are using Microsoft .NET Framework version 1.1 or earlier. - - - Transforms the XML data in the using the specified args and outputs the result to a . - An containing the data to be transformed. - An containing the namespace-qualified arguments used as input to the transformation. - The to which you want to output. - There was an error processing the XSLT transformation. Note: This is a change in behavior from earlier versions. An is thrown if you are using Microsoft .NET Framework version 1.1 or earlier. - - - Transforms the XML data in the input file and outputs the result to an output file. - The URL of the source document to be transformed. - The URL of the output file. - The used to resolve the XSLT document() function. If this is null, the document() function is not resolved. The is not cached after the method completes. - - - Transforms the XML data in the using the specified args and outputs the result to an . - An object implementing the interface. In the .NET Framework, this can be either an (typically an ), or an containing the data to be transformed. - An containing the namespace-qualified arguments used as input to the transformation. - The to which you want to output. - There was an error processing the XSLT transformation. Note: This is a change in behavior from earlier versions. An is thrown if you are using Microsoft .NET Framework version 1.1 or earlier. - - - Transforms the XML data in the using the specified args and outputs the result to an . - An object implementing the interface. In the .NET Framework, this can be either an (typically an ), or an containing the data to be transformed. - An containing the namespace-qualified arguments used as input to the transformation. - The used to resolve the XSLT document() function. If this is null, the document() function is not resolved. The is not cached after the method completes. - An containing the results of the transformation. - - - Transforms the XML data in the using the specified args and outputs the result to a . - An object implementing the interface. In the .NET Framework, this can be either an (typically an ), or an containing the data to be transformed. - An containing the namespace-qualified arguments used as input to the transformation. - The to which you want to output. - There was an error processing the XSLT transformation. Note: This is a change in behavior from earlier versions. An is thrown if you are using Microsoft .NET Framework version 1.1 or earlier. - - - Transforms the XML data in the using the specified args and outputs the result to a . - An object implementing the interface. In the .NET Framework, this can be either an (typically an ), or an containing the data to be transformed. - An containing the namespace-qualified arguments used as input to the transformation. - The stream to which you want to output. - There was an error processing the XSLT transformation. Note: This is a change in behavior from earlier versions. An is thrown if you are using Microsoft .NET Framework version 1.1 or earlier. - - - Transforms the XML data in the using the specified args and outputs the result to an . - An containing the data to be transformed. - An containing the namespace-qualified arguments used as input to the transformation. - The to which you want to output. - The used to resolve the XSLT document() function. If this is null, the document() function is not resolved. The is not cached after the method completes. - There was an error processing the XSLT transformation. Note: This is a change in behavior from earlier versions. An is thrown if you are using Microsoft .NET Framework version 1.1 or earlier. - - - Transforms the XML data in the using the specified args and outputs the result to an . - An containing the data to be transformed. - An containing the namespace-qualified arguments used as input to the transformation. - An containing the results of the transformation. - There was an error processing the XSLT transformation. Note: This is a change in behavior from earlier versions. An is thrown if you are using Microsoft .NET Framework version 1.1 or earlier. - - - Transforms the XML data in the using the specified args and outputs the result to an . - An object implementing the interface. In the .NET Framework, this can be either an (typically an ), or an containing the data to be transformed. - An containing the namespace-qualified arguments used as input to the transformation. - An containing the results of the transformation. - - - Transforms the XML data in the input file and outputs the result to an output file. - The URL of the source document to be transformed. - The URL of the output file. - - - Transforms the XML data in the using the specified args and outputs the result to a . - An containing the data to be transformed. - An containing the namespace-qualified arguments used as input to the transformation. - The stream to which you want to output. - There was an error processing the XSLT transformation. Note: This is a change in behavior from earlier versions. An is thrown if you are using Microsoft .NET Framework version 1.1 or earlier. - - - Sets the used to resolve external resources when the method is called. - The to use during transformation. If set to null, the XSLT document() function is not resolved. - - - Specifies the XSLT features to support during execution of the XSLT style sheet. - - - Initializes a new instance of the class with default settings. - - - Initializes a new instance of the class with the specified settings. - true to enable support for the XSLT document() function; otherwise, false. - true to enable support for embedded scripts blocks; otherwise, false. - - - Gets an object with default settings. Support for the XSLT document() function and embedded script blocks is disabled. - An object with the and properties set to false. - - - Gets or sets a value indicating whether to enable support for the XSLT document() function. - true to support the XSLT document() function; otherwise, false. The default is false. - - - Gets or sets a value indicating whether to enable support for embedded script blocks. - true to support script blocks in XSLT style sheets; otherwise, false. The default is false. - - - Gets an object that enables support for the XSLT document() function and embedded script blocks. - An object with the and properties set to true. - - - Provides a base class for Win32 critical handle implementations in which the value of -1 indicates an invalid handle. - - - Initializes a new instance of the class. - - - Gets a value that indicates whether the handle is invalid. - true if the handle is not valid; otherwise, false. - - - Provides a base class for Win32 critical handle implementations in which the value of either 0 or -1 indicates an invalid handle. - - - Initializes a new instance of the class. - - - Gets a value that indicates whether the handle is invalid. - true if the handle is not valid; otherwise, false. - - - Represents a wrapper class for a file handle. - - - Initializes a new instance of the class. - An object that represents the pre-existing handle to use. - true to reliably release the handle during the finalization phase; false to prevent reliable release (not recommended). - - - Provides a base class for Win32 safe handle implementations in which the value of -1 indicates an invalid handle. - - - Initializes a new instance of the class, specifying whether the handle is to be reliably released. - true to reliably release the handle during the finalization phase; false to prevent reliable release (not recommended). - - - Gets a value that indicates whether the handle is invalid. - true if the handle is not valid; otherwise, false. - - - Provides a base class for Win32 safe handle implementations in which the value of either 0 or -1 indicates an invalid handle. - - - Initializes a new instance of the class, specifying whether the handle is to be reliably released. - true to reliably release the handle during the finalization phase; false to prevent reliable release (not recommended). - - - Gets a value that indicates whether the handle is invalid. - true if the handle is not valid; otherwise, false. - - - Provides a safe handle that represents a memory-mapped file for sequential access. - - - Provides a safe handle that represents a view of a block of unmanaged memory for random access. - - - Represents a wrapper class for a pipe handle. - - - Initializes a new instance of the class. - An object that represents the pre-existing handle to use. - true to reliably release the handle during the finalization phase; false to prevent reliable release (not recommended). - - - Supports iterating over a object and reading its individual characters. This class cannot be inherited. - - - Creates a copy of the current object. - An that is a copy of the current object. - - - Gets the currently referenced character in the string enumerated by this object. - The Unicode character currently referenced by this object. - The index is invalid; that is, it is before the first or after the last character of the enumerated string. - - - Releases all resources used by the current instance of the class. - - - Increments the internal index of the current object to the next character of the enumerated string. - true if the index is successfully incremented and within the enumerated string; otherwise, false. - - - Initializes the index to a position logically before the first character of the enumerated string. - - - Gets the currently referenced character in the string enumerated by this object. For a description of this member, see . - The boxed Unicode character currently referenced by this object. - Enumeration has not started. -or- Enumeration has ended. - - - Indicates whether a program element is compliant with the Common Language Specification (CLS). This class cannot be inherited. - - - Initializes an instance of the class with a Boolean value indicating whether the indicated program element is CLS-compliant. - true if CLS-compliant; otherwise, false. - - - Gets the Boolean value indicating whether the indicated program element is CLS-compliant. - true if the program element is CLS-compliant; otherwise, false. - - - Provides the base class for serializing a set of components or serializable objects into a serialization store. - - - Initializes a new instance of the class. - - - Creates a new . - A new created serialization store. - - - Deserializes the given store to produce a collection of objects. - The to deserialize. - A collection of objects created according to the stored state. - store is null. - store does not contain data in a format the serialization container can process. - - - Deserializes the given store and populates the given with deserialized objects. - The to deserialize. - The to which objects will be added. - A collection of objects created according to the stored state. - store or container is null. - store does not contain data in a format the serialization container can process. - - - Deserializes the given to the given container. - The to deserialize. - The container to which objects will be added. - store or container is null. - store does not contain data in a format the serialization container can process. - - - Deserializes the given to the given container, optionally validating recycled types. - The to deserialize. - The container to which objects will be added. - true to guarantee that the deserialization will only work if applied to an object of the same type. - store or container is null. - store does not contain data in a format the serialization container can process. - - - Deserializes the given to the given container, optionally applying default property values. - The to deserialize. - The container to which objects will be added. - true to guarantee that the deserialization will only work if applied to an object of the same type. - true to indicate that the default property values should be applied. - store or container is null. - store does not contain data in a format the serialization container can process. - - - Loads a from a stream. - The from which the store will be loaded. - A new instance. - stream is null. - stream does not contain data saved by a previous call to . - - - Serializes the given object to the given . - The to which the state of value will be written. - The object to serialize. - store or value is null. - store is closed, or store is not a supported type of serialization store. Use a store returned by . - - - Serializes the given object, accounting for default property values. - The to which the state of value will be serialized. - The object to serialize. - store or value is null. - store is closed, or store is not a supported type of serialization store. Use a store returned by . - - - Serializes the given member on the given object. - The to which the state of member will be serialized. - The object to which member is attached. - A specifying the member to serialize. - store or value is null. - store is closed, or store is not a supported type of serialization store. Use a store returned by . - - - Serializes the given member on the given object, accounting for the default property value. - The to which the state of member will be serialized. - The object to which member is attached. - The member to serialize. - store or value is null. - store is closed, or store is not a supported type of serialization store. Use a store returned by . - - - Provides a stack object that can be used by a serializer to make information available to nested serializers. - - - Initializes a new instance of the class. - - - Appends an object to the end of the stack, rather than pushing it onto the top of the stack. - A context object to append to the stack. - context is null. - - - Gets the current object on the stack. - The current object on the stack, or null if no objects were pushed. - - - Gets the object on the stack at the specified level. - The level of the object to retrieve on the stack. Level 0 is the top of the stack, level 1 is the next down, and so on. This level must be 0 or greater. If level is greater than the number of levels on the stack, it returns null. - The object on the stack at the specified level, or null if no object exists at that level. - level is less than 0. - - - Gets the first object on the stack that inherits from or implements the specified type. - A type to retrieve from the context stack. - The first object on the stack that inherits from or implements the specified type, or null if no object on the stack implements the type. - type is null. - - - Removes the current object off of the stack, returning its value. - The object removed from the stack; null if no objects are on the stack. - - - Pushes, or places, the specified object onto the stack. - The context object to push onto the stack. - context is null. - - - The attribute is placed on a serializer to indicate the class to use as a default provider of that type of serializer. - - - Initializes a new instance of the class with the named provider type. - The name of the serialization provider type. - providerTypeName is null. - - - Initializes a new instance of the class with the given provider type. - The of the serialization provider. - providerType is null. - - - Gets the type name of the serialization provider. - A string containing the name of the provider. - - - Provides a basic designer loader interface that can be used to implement a custom designer loader. - - - Initializes a new instance of the class. - - - Begins loading a designer. - The loader host through which this loader loads components. - - - Releases all resources used by the . - - - Writes cached changes to the location that the designer was loaded from. - - - Gets a value indicating whether the loader is currently loading a document. - true if the loader is currently loading a document; otherwise, false. - - - Indicates a serializer for the serialization manager to use to serialize the values of the type this attribute is applied to. This class cannot be inherited. - - - Initializes a new instance of the class. - The fully qualified name of the data type of the serializer. - The fully qualified name of the base data type of the serializer. Multiple serializers can be supplied for a class as long as the serializers have different base types. - - - Initializes a new instance of the class. - The fully qualified name of the data type of the serializer. - The base data type of the serializer. Multiple serializers can be supplied for a class as long as the serializers have different base types. - - - Initializes a new instance of the class. - The data type of the serializer. - The base data type of the serializer. Multiple serializers can be supplied for a class as long as the serializers have different base types. - - - Gets the fully qualified type name of the serializer base type. - The fully qualified type name of the serializer base type. - - - Gets the fully qualified type name of the serializer. - The fully qualified type name of the serializer. - - - Indicates a unique ID for this attribute type. - A unique ID for this attribute type. - - - Provides an interface that can extend a designer host to support loading from a serialized state. - - - Ends the designer loading operation. - The fully qualified name of the base class of the document that this designer is designing. - true if the designer is successfully loaded; otherwise, false. - A collection containing the errors encountered during load, if any. If no errors were encountered, pass either an empty collection or null. - - - Reloads the design document. - - - Provides an interface that extends to specify whether errors are tolerated while loading a design document. - - - Gets or sets a value indicating whether it is possible to reload with errors. - true if the designer loader can reload the design document when errors are detected; otherwise, false. The default is false. - - - Gets or sets a value indicating whether errors should be ignored when is called. - true if the designer loader will ignore errors when it reloads; otherwise, false. The default is false. - - - Provides an interface that can extend a designer loader to support asynchronous loading of external components. - - - Registers an external component as part of the load process managed by this interface. - - - Signals that a dependent load has finished. - true if the load of the designer is successful; false if errors prevented the load from finishing. - A collection of errors that occurred during the load, if any. If no errors occurred, pass either an empty collection or null. - - - Reloads the design document. - true if the reload request is accepted, or false if the loader does not allow the reload. - - - Provides an interface that can manage design-time serialization. - - - Adds the specified serialization provider to the serialization manager. - The serialization provider to add. - - - Gets a stack-based, user-defined storage area that is useful for communication between serializers. - A that stores data. - - - Creates an instance of the specified type and adds it to a collection of named instances. - The data type to create. - The arguments to pass to the constructor for this type. - The name of the object. This name can be used to access the object later through . If null is passed, the object is still created but cannot be accessed by name. - If true, this object is added to the design container. The object must implement for this to have any effect. - The newly created object instance. - - - Gets an instance of a created object of the specified name, or null if that object does not exist. - The name of the object to retrieve. - An instance of the object with the given name, or null if no object by that name can be found. - - - Gets the name of the specified object, or null if the object has no name. - The object to retrieve the name for. - The name of the object, or null if the object is unnamed. - - - Gets a serializer of the requested type for the specified object type. - The type of the object to get the serializer for. - The type of the serializer to retrieve. - An instance of the requested serializer, or null if no appropriate serializer can be located. - - - Gets a type of the specified name. - The fully qualified name of the type to load. - An instance of the type, or null if the type cannot be loaded. - - - Indicates custom properties that can be serializable with available serializers. - A containing the properties to be serialized. - - - Removes a custom serialization provider from the serialization manager. - The provider to remove. This object must have been added using . - - - Reports an error in serialization. - The error to report. This information object can be of any object type. If it is an exception, the message of the exception is extracted and reported to the user. If it is any other type, is called to display the information to the user. - - - Occurs when cannot locate the specified name in the serialization manager's name table. - - - - Occurs when serialization is complete. - - - - Sets the name of the specified existing object. - The object instance to name. - The name to give the instance. - - - Provides an interface that enables access to a serializer. - - - Gets a serializer using the specified attributes. - The serialization manager requesting the serializer. - An instance of the current serializer of the specified type. This can be null if no serializer of the specified type exists. - The data type of the object to serialize. - The data type of the serializer to create. - An instance of a serializer of the type requested, or null if the request cannot be satisfied. - - - Provides an interface that can invoke serialization and deserialization. - - - Deserializes the specified serialization data object and returns a collection of objects represented by that data. - An object consisting of serialized data. - An of objects rebuilt from the specified serialization data object. - - - Serializes the specified collection of objects and stores them in a serialization data object. - A collection of objects to serialize. - An object that contains the serialized state of the specified collection of objects. - - - Provides a service that can generate unique names for objects. - - - Creates a new name that is unique to all components in the specified container. - The container where the new object is added. - The data type of the object that receives the name. - A unique name for the data type. - - - Gets a value indicating whether the specified name is valid. - The name to validate. - true if the name is valid; otherwise, false. - - - Gets a value indicating whether the specified name is valid. - The name to validate. - - - Provides the information necessary to create an instance of an object. This class cannot be inherited. - - - Initializes a new instance of the class using the specified member information and arguments. - The member information for the descriptor. This can be a , , , or . If this is a , , or , it must represent a static member. - The collection of arguments to pass to the member. This parameter can be null or an empty collection if there are no arguments. The collection can also consist of other instances of . - member is of type , , or , and it does not represent a static member. member is of type and is not readable. member is of type or , and the number of arguments in arguments does not match the signature of member.member is of type and represents a static member. member is of type , and the number of arguments in arguments is not zero. - - - Initializes a new instance of the class using the specified member information, arguments, and value indicating whether the specified information completely describes the instance. - The member information for the descriptor. This can be a , , , or . If this is a , , or , it must represent a static member. - The collection of arguments to pass to the member. This parameter can be null or an empty collection if there are no arguments. The collection can also consist of other instances of . - true if the specified information completely describes the instance; otherwise, false. - member is of type , , or , and it does not represent a static member member is of type and is not readable. member is of type or and the number of arguments in arguments does not match the signature of member. member is of type and represents a static member member is of type , and the number of arguments in arguments is not zero. - - - Gets the collection of arguments that can be used to reconstruct an instance of the object that this instance descriptor represents. - An of arguments that can be used to create the object. - - - Invokes this instance descriptor and returns the object the descriptor describes. - The object this instance descriptor describes. - - - Gets a value indicating whether the contents of this completely identify the instance. - true if the instance is completely described; otherwise, false. - - - Gets the member information that describes the instance this descriptor is associated with. - A that describes the instance that this object is associated with. - - - Represents a single relationship between an object and a member. - - - Initializes a new instance of the class. - The object that owns member. - The member which is to be related to owner. - owner or member is null. - - - Represents the empty member relationship. This field is read-only. - - - - Determines whether two instances are equal. - The to compare with the current . - true if the specified is equal to the current ; otherwise, false. - - - Returns the hash code for this instance. - A hash code for the current . - - - Gets a value indicating whether this relationship is equal to the relationship. - true if this relationship is equal to the relationship; otherwise, false. - - - Gets the related member. - The member that is passed in to the . - - - Tests whether two specified structures are equivalent. - The structure that is to the left of the equality operator. - The structure that is to the right of the equality operator. - This operator returns true if the two structures are equal; otherwise, false. - - - Tests whether two specified structures are different. - The structure that is to the left of the inequality operator. - The structure that is to the right of the inequality operator. - This operator returns true if the two structures are different; otherwise, false. - - - Gets the owning object. - The owning object that is passed in to the . - - - Provides the base class for relating one member to another. - - - Initializes a new instance of the class. - - - Gets a relationship to the given source relationship. - The source relationship. - A relationship to source, or if no relationship exists. - - - Establishes a relationship between a source and target object. - The source relationship. This is the left-hand side of a relationship assignment. - The current relationship associated with source, or if there is no relationship. - source is null. - source is empty, or the relationship is not supported by the service. - - - Establishes a relationship between a source and target object. - The owner of a source relationship. - The member of a source relationship. - A structure encapsulating the relationship between a source and target object, or null if there is no relationship. - sourceOwner or sourceMember is null. - sourceOwner or sourceMember is empty, or the relationship is not supported by the service. - - - Creates a relationship between the source object and target relationship. - The source relationship. - The relationship to set into the source. - The relationship is not supported by the service. - - - Gets a value indicating whether the given relationship is supported. - The source relationship. - The relationship to set into the source. - true if a relationship between the given two objects is supported; otherwise, false. - - - Provides data for the event. - - - Initializes a new instance of the class. - The name to resolve. - - - Gets the name of the object to resolve. - The name of the object to resolve. - - - Gets or sets the object that matches the name. - The object that the name is associated with. - - - Represents the method that handles the event of a serialization manager. - The source of the event. - A that contains the event data. - - - A collection of objects. This class cannot be inherited. - - - Initializes a new instance of the class. This new instance is empty, that is, it does not yet contain any objects. - - - Adds an that is a table mapping to the collection. - A DataTableMapping object to add to the collection. - The index of the DataTableMapping object added to the collection. - The object passed in was not a object. - - - Adds a object to the collection when given a source table name and a table name. - The case-sensitive name of the source table to map from. - The name, which is not case-sensitive, of the table to map to. - The object that was added to the collection. - - - Copies the elements of the specified to the end of the collection. - An of values to add to the collection. - - - Copies the elements of the specified array to the end of the collection. - The array of objects to add to the collection. - - - Removes all objects from the collection. - - - Gets a value indicating whether the given object exists in the collection. - An that is the . - true if this collection contains the specified ; otherwise false. - - - Gets a value indicating whether a object with the specified source table name exists in the collection. - The case-sensitive source table name containing the object. - true if the collection contains a object with this source table name; otherwise false. - - - Copies the elements of the to the specified array. - An to which to copy the elements. - The starting index of the array. - - - Copies the elements of the to the specified array. - A to which to copy the elements. - The starting index of the array. - - - Gets the number of objects in the collection. - The number of DataTableMapping objects in the collection. - - - Gets the object with the specified table name. - The name, which is not case-sensitive, of the table to find. - The object with the specified table name. - - - Gets an enumerator that can iterate through the collection. - An that can be used to iterate through the collection. - - - Gets a object with the specified source table name and table name, using the given . - The collection to search. - The case-sensitive name of the mapped source table. - The name, which is not case-sensitive, of the mapped table. - One of the values. - A object. - The mappingAction parameter was set to Error, and no mapping was specified. - - - Gets the location of the specified object within the collection. - An that is the object to find. - The zero-based location of the specified object within the collection. - - - Gets the location of the object with the specified source table name. - The case-sensitive name of the source table. - The zero-based location of the object with the specified source table name. - - - Gets the location of the object with the specified table name. - The name, which is not case-sensitive, of the DataSet table to find. - The zero-based location of the object with the given table name, or -1 if the object does not exist in the collection. - - - Inserts a object into the at the specified index. - The zero-based index of the object to insert. - The object to insert. - - - Inserts a object into the at the specified index. - The zero-based index of the object to insert. - The object to insert. - - - Gets or sets the object at the specified index. - The zero-based index of the object to return. - The object at the specified index. - - - Gets or sets the object with the specified source table name. - The case-sensitive name of the source table. - The object with the specified source table name. - - - Removes the specified object from the collection. - The object to remove. - - - Removes the specified object from the collection. - The object to remove. - The object specified was not a object. - The object specified is not in the collection. - - - Removes the object located at the specified index from the collection. - The zero-based index of the object to remove. - A object does not exist with the specified index. - - - Removes the object with the specified source table name from the collection. - The case-sensitive source table name to find. - A object does not exist with the specified source table name. - - - Gets a value indicating whether access to the is synchronized (thread safe). - true if access to the is synchronized (thread safe); otherwise, false. - - - Gets an object that can be used to synchronize access to the . - An object that can be used to synchronize access to the . - - - Gets a value indicating whether the has a fixed size. - true if the has a fixed size; otherwise, false. - - - Gets a value indicating whether the is read-only. - true if the is read-only; otherwise, false. - - - Gets or sets an item from the collection at a specified index. - The zero-based index of the item to get or set. - The element at the specified index. - - - Adds a table mapping to the collection. - The case-sensitive name of the source table. - The name of the table. - A reference to the newly-mapped object. - - - Gets the TableMapping object with the specified table name. - The name of the DataSet table within the collection. - The TableMapping object with the specified DataSet table name. - - - Gets or sets the instance of with the specified name. - The SourceTable name of the . - The instance of with the specified SourceTable name. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Represents an SQL statement or stored procedure to execute against a data source. Provides a base class for database-specific classes that represent commands. - - - Constructs an instance of the object. - - - Attempts to cancels the execution of a . - - - Gets or sets the text command to run against the data source. - The text command to execute. The default value is an empty string (""). - - - Gets or sets the wait time before terminating the attempt to execute a command and generating an error. - The time in seconds to wait for the command to execute. - - - Indicates or specifies how the property is interpreted. - One of the values. The default is Text. - - - Gets or sets the used by this . - The connection to the data source. - - - Creates a new instance of a object. - A object. - - - Creates a new instance of a object. - A object. - - - Gets or sets the used by this . - The connection to the data source. - - - Gets the collection of objects. - The parameters of the SQL statement or stored procedure. - - - Gets or sets the within which this object executes. - The transaction within which a Command object of a .NET Framework data provider executes. The default value is a null reference (Nothing in Visual Basic). - - - Gets or sets a value indicating whether the command object should be visible in a customized interface control. - true, if the command object should be visible in a control; otherwise false. The default is true. - - - Executes the command text against the connection. - An instance of . - A task representing the operation. - An error occurred while executing the command text. - An invalid value. - - - Providers should implement this method to provide a non-default implementation for overloads. The default implementation invokes the synchronous method and returns a completed task, blocking the calling thread. The default implementation will return a cancelled task if passed an already cancelled cancellation token. Exceptions thrown by ExecuteReader will be communicated via the returned Task Exception property. This method accepts a cancellation token that can be used to request the operation to be cancelled early. Implementations may ignore this request. - Options for statement execution and data retrieval. - The token to monitor for cancellation requests. - A task representing the asynchronous operation. - An error occurred while executing the command text. - An invalid value. - - - Executes a SQL statement against a connection object. - The number of rows affected. - - - This is the asynchronous version of . Providers should override with an appropriate implementation. The cancellation token may optionally be ignored. The default implementation invokes the synchronous method and returns a completed task, blocking the calling thread. The default implementation will return a cancelled task if passed an already cancelled cancellation token. Exceptions thrown by will be communicated via the returned Task Exception property. Do not invoke other methods and properties of the DbCommand object until the returned Task is complete. - The token to monitor for cancellation requests. - A task representing the asynchronous operation. - An error occurred while executing the command text. - - - An asynchronous version of , which executes a SQL statement against a connection object. Invokes with CancellationToken.None. - A task representing the asynchronous operation. - An error occurred while executing the command text. - - - Executes the against the , and returns an . - A object. - - - Executes the against the , and returns an using one of the values. - One of the values. - An object. - - - An asynchronous version of , which executes the against the and returns a . Invokes with CancellationToken.None. - A task representing the asynchronous operation. - An error occurred while executing the command text. - An invalid value. - - - An asynchronous version of , which executes the against the and returns a . Invokes . - One of the values. - A task representing the asynchronous operation. - An error occurred while executing the command text. - An invalid value. - - - An asynchronous version of , which executes the against the and returns a . This method propagates a notification that operations should be canceled. Invokes . - The token to monitor for cancellation requests. - A task representing the asynchronous operation. - An error occurred while executing the command text. - An invalid value. - - - Invokes . - One of the values. - The token to monitor for cancellation requests. - A task representing the asynchronous operation. - An error occurred while executing the command text. - An invalid value. - - - Executes the query and returns the first column of the first row in the result set returned by the query. All other columns and rows are ignored. - The first column of the first row in the result set. - - - This is the asynchronous version of . Providers should override with an appropriate implementation. The cancellation token may optionally be ignored. The default implementation invokes the synchronous method and returns a completed task, blocking the calling thread. The default implementation will return a cancelled task if passed an already cancelled cancellation token. Exceptions thrown by ExecuteScalar will be communicated via the returned Task Exception property. Do not invoke other methods and properties of the DbCommand object until the returned Task is complete. - The token to monitor for cancellation requests. - A task representing the asynchronous operation. - An error occurred while executing the command text. - - - An asynchronous version of , which executes the query and returns the first column of the first row in the result set returned by the query. All other columns and rows are ignored. Invokes with CancellationToken.None. - A task representing the asynchronous operation. - An error occurred while executing the command text. - - - Gets the collection of objects. For more information on parameters, see Configuring Parameters and Parameter Data Types. - The parameters of the SQL statement or stored procedure. - - - Creates a prepared (or compiled) version of the command on the data source. - - - Gets or sets the within which this object executes. - The transaction within which a Command object of a .NET Framework data provider executes. The default value is a null reference (Nothing in Visual Basic). - - - Gets or sets how command results are applied to the when used by the Update method of a . - One of the values. The default is Both unless the command is automatically generated. Then the default is None. - - - Gets or sets the used by this instance of the . - The connection to the data source. - - - Creates a new instance of an object. - An IDbDataParameter object. - - - Executes the against the and builds an . - An object. - - - Executes the against the , and builds an using one of the values. - One of the values. - An object. - - - Gets the . - The parameters of the SQL statement or stored procedure. - - - Gets or sets the within which this object executes. - The transaction within which a Command object of a .NET Framework data provider executes. The default value is a null reference (Nothing in Visual Basic). - - - Automatically generates single-table commands used to reconcile changes made to a with the associated database. This is an abstract class that can only be inherited. - - - Initializes a new instance of a class that inherits from the class. - - - Allows the provider implementation of the class to handle additional parameter properties. - A to which the additional modifications are applied. - The from the schema table provided by . - The type of command being generated; INSERT, UPDATE or DELETE. - true if the parameter is part of the update or delete WHERE clause, false if it is part of the insert or update values. - - - Sets or gets the for an instance of the class. - A object. - - - Sets or gets a string used as the catalog separator for an instance of the class. - A string indicating the catalog separator for use with an instance of the class. - - - Specifies which is to be used by the . - Returns one of the values describing the behavior of this . - - - Gets or sets a object for which Transact-SQL statements are automatically generated. - A object. - - - Releases the unmanaged resources used by the and optionally releases the managed resources. - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - Gets the automatically generated object required to perform deletions at the data source. - The automatically generated object required to perform deletions. - - - Gets the automatically generated object required to perform deletions at the data source, optionally using columns for parameter names. - If true, generate parameter names matching column names, if possible. If false, generate , , and so on. - The automatically generated object required to perform deletions. - - - Gets the automatically generated object required to perform insertions at the data source. - The automatically generated object required to perform insertions. - - - Gets the automatically generated object required to perform insertions at the data source, optionally using columns for parameter names. - If true, generate parameter names matching column names, if possible. If false, generate , , and so on. - The automatically generated object required to perform insertions. - - - Returns the name of the specified parameter in the format of . Use when building a custom command builder. - The number to be included as part of the parameter's name.. - The name of the parameter with the specified number appended as part of the parameter name. - - - Returns the full parameter name, given the partial parameter name. - The partial name of the parameter. - The full parameter name corresponding to the partial parameter name requested. - - - Returns the placeholder for the parameter in the associated SQL statement. - The number to be included as part of the parameter's name. - The name of the parameter with the specified number appended. - - - Returns the schema table for the . - The for which to retrieve the corresponding schema table. - A that represents the schema for the specific . - - - Gets the automatically generated object required to perform updates at the data source. - The automatically generated object required to perform updates. - - - Gets the automatically generated object required to perform updates at the data source, optionally using columns for parameter names. - If true, generate parameter names matching column names, if possible. If false, generate , , and so on. - The automatically generated object required to perform updates. - - - Resets the , , , and properties on the . - The to be used by the command builder for the corresponding insert, update, or delete command. - A instance to use for each insert, update, or delete operation. Passing a null value allows the method to create a object based on the Select command associated with the . - - - Given an unquoted identifier in the correct catalog case, returns the correct quoted form of that identifier, including properly escaping any embedded quotes in the identifier. - The original unquoted identifier. - The quoted version of the identifier. Embedded quotes within the identifier are properly escaped. - - - Gets or sets the beginning character or characters to use when specifying database objects (for example, tables or columns) whose names contain characters such as spaces or reserved tokens. - The beginning character or characters to use. The default is an empty string. - This property cannot be changed after an insert, update, or delete command has been generated. - - - Gets or sets the ending character or characters to use when specifying database objects (for example, tables or columns) whose names contain characters such as spaces or reserved tokens. - The ending character or characters to use. The default is an empty string. - - - Clears the commands associated with this . - - - Adds an event handler for the event. - A instance containing information about the event. - - - Gets or sets the character to be used for the separator between the schema identifier and any other identifiers. - The character to be used as the schema separator. - - - Specifies whether all column values in an update statement are included or only changed ones. - true if the UPDATE statement generated by the includes all columns; false if it includes only changed columns. - - - Registers the to handle the event for a . - The to be used for the update. - - - Given a quoted identifier, returns the correct unquoted form of that identifier, including properly un-escaping any embedded quotes in the identifier. - The identifier that will have its embedded quotes removed. - The unquoted identifier, with embedded quotes properly un-escaped. - - - Represents a connection to a database. - - - Initializes a new instance of the class. - - - Starts a database transaction. - Specifies the isolation level for the transaction. - An object representing the new transaction. - - - Starts a database transaction. - An object representing the new transaction. - - - Starts a database transaction with the specified isolation level. - Specifies the isolation level for the transaction. - An object representing the new transaction. - - - Changes the current database for an open connection. - Specifies the name of the database for the connection to use. - - - Closes the connection to the database. This is the preferred method of closing any open connection. - The connection-level error that occurred while opening the connection. - - - Gets or sets the string used to open the connection. - The connection string used to establish the initial connection. The exact contents of the connection string depend on the specific data source for this connection. The default value is an empty string. - - - Gets the time to wait while establishing a connection before terminating the attempt and generating an error. - The time (in seconds) to wait for a connection to open. The default value is determined by the specific type of connection that you are using. - - - Creates and returns a object associated with the current connection. - A object. - - - Creates and returns a object associated with the current connection. - A object. - - - Gets the name of the current database after a connection is opened, or the database name specified in the connection string before the connection is opened. - The name of the current database or the name of the database to be used after a connection is opened. The default value is an empty string. - - - Gets the name of the database server to which to connect. - The name of the database server to which to connect. The default value is an empty string. - - - Gets the for this . - A set of methods for creating instances of a provider's implementation of the data source classes. - - - Enlists in the specified transaction. - A reference to an existing in which to enlist. - - - Returns schema information for the data source of this . - A that contains schema information. - - - Returns schema information for the data source of this using the specified string for the schema name. - Specifies the name of the schema to return. - A that contains schema information. - collectionName is specified as null. - - - Returns schema information for the data source of this using the specified string for the schema name and the specified string array for the restriction values. - Specifies the name of the schema to return. - Specifies a set of restriction values for the requested schema. - A that contains schema information. - collectionName is specified as null. - - - Raises the event. - A that contains the event data. - - - Opens a database connection with the settings specified by the . - - - An asynchronous version of , which opens a database connection with the settings specified by the . This method invokes the virtual method with CancellationToken.None. - A task representing the asynchronous operation. - - - This is the asynchronous version of . Providers should override with an appropriate implementation. The cancellation token can optionally be honored. The default implementation invokes the synchronous call and returns a completed task. The default implementation will return a cancelled task if passed an already cancelled cancellationToken. Exceptions thrown by Open will be communicated via the returned Task Exception property. Do not invoke other methods and properties of the DbConnection object until the returned Task is complete. - The cancellation instruction. - A task representing the asynchronous operation. - - - Gets a string that represents the version of the server to which the object is connected. - The version of the database. The format of the string returned depends on the specific type of connection you are using. - was called while the returned Task was not completed and the connection was not opened after a call to . - - - Gets a string that describes the state of the connection. - The state of the connection. The format of the string returned depends on the specific type of connection you are using. - - - Occurs when the state of the event changes. - - - - Begins a database transaction with the specified value. - One of the values. - An object that represents the new transaction. - - - Begins a database transaction. - An object that represents the new transaction. - - - Creates and returns a object that is associated with the current connection. - A object that is associated with the connection. - - - Provides a base class for strongly typed connection string builders. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class, optionally using ODBC rules for quoting values. - true to use {} to delimit fields; false to use quotation marks. - - - Adds an entry with the specified key and value into the . - The key to add to the . - The value for the specified key. - keyword is a null reference (Nothing in Visual Basic). - The is read-only. -or- The has a fixed size. - - - Provides an efficient and safe way to append a key and value to an existing object. - The to which to add the key/value pair. - The key to be added. - The value for the supplied key. - - - Provides an efficient and safe way to append a key and value to an existing object. - The to which to add the key/value pair. - The key to be added. - The value for the supplied key. - true to use {} to delimit fields, false to use quotation marks. - - - Gets or sets a value that indicates whether the property is visible in Visual Studio designers. - true if the connection string is visible within designers; false otherwise. The default is true. - - - Clears the contents of the instance. - The is read-only. - - - Clears the collection of objects on the associated . - - - Gets or sets the connection string associated with the . - The current connection string, created from the key/value pairs that are contained within the . The default value is an empty string. - An invalid connection string argument has been supplied. - - - Determines whether the contains a specific key. - The key to locate in the . - true if the contains an entry with the specified key; otherwise false. - keyword is a null reference (Nothing in Visual Basic). - - - Gets the current number of keys that are contained within the property. - The number of keys that are contained within the connection string maintained by the instance. - - - Compares the connection information in this object with the connection information in the supplied object. - The to be compared with this object. - true if the connection information in both of the objects causes an equivalent connection string; otherwise false. - - - Fills a supplied with information about all the properties of this . - The to be filled with information about this . - - - Gets a value that indicates whether the has a fixed size. - true if the has a fixed size; otherwise false. - - - Gets a value that indicates whether the is read-only. - true if the is read-only; otherwise false. The default is false. - - - Gets or sets the value associated with the specified key. - The key of the item to get or set. - The value associated with the specified key. If the specified key is not found, trying to get it returns a null reference (Nothing in Visual Basic), and trying to set it creates a new element using the specified key. Passing a null (Nothing in Visual Basic) key throws an . Assigning a null value removes the key/value pair. - keyword is a null reference (Nothing in Visual Basic). - The property is set, and the is read-only. -or- The property is set, keyword does not exist in the collection, and the has a fixed size. - - - Gets an that contains the keys in the . - An that contains the keys in the . - - - Removes the entry with the specified key from the instance. - The key of the key/value pair to be removed from the connection string in this . - true if the key existed within the connection string and was removed; false if the key did not exist. - keyword is null (Nothing in Visual Basic) - The is read-only, or the has a fixed size. - - - Indicates whether the specified key exists in this instance. - The key to locate in the . - true if the contains an entry with the specified key; otherwise false. - - - Returns the connection string associated with this . - The current property. - - - Retrieves a value corresponding to the supplied key from this . - The key of the item to retrieve. - The value corresponding to the key. - true if keyword was found within the connection string, false otherwise. - keyword contains a null value (Nothing in Visual Basic). - - - Gets an that contains the values in the . - An that contains the values in the . - - - Copies the elements of the to an , starting at a particular index. - The one-dimensional that is the destination of the elements copied from . The must have zero-based indexing. - The zero-based index in array at which copying begins. - - - Gets a value indicating whether access to the is synchronized (thread safe). - true if access to the is synchronized (thread safe); otherwise, false. - - - Gets an object that can be used to synchronize access to the . - An object that can be used to synchronize access to the . - - - Adds an element with the provided key and value to the object. - The to use as the key of the element to add. - The to use as the value of the element to add. - - - Determines whether the object contains an element with the specified key. - The key to locate in the object. - true if the contains an element with the key; otherwise, false. - - - Returns an object for the object. - An object for the object. - - - Gets or sets the element with the specified key. - The key of the element to get or set. - The element with the specified key. - - - Removes the element with the specified key from the object. - The key of the element to remove. - - - Returns an enumerator that iterates through a collection. - An object that can be used to iterate through the collection. - - - Returns a collection of custom attributes for this instance of a component. - An containing the attributes for this object. - - - Returns the class name of this instance of a component. - The class name of the object, or null if the class does not have a name. - - - Returns the name of this instance of a component. - The name of the object, or null if the object does not have a name. - - - Returns a type converter for this instance of a component. - A that is the converter for this object, or null if there is no for this object. - - - Returns the default event for this instance of a component. - An that represents the default event for this object, or null if this object does not have events. - - - Returns the default property for this instance of a component. - A that represents the default property for this object, or null if this object does not have properties. - - - Returns an editor of the specified type for this instance of a component. - A that represents the editor for this object. - An of the specified type that is the editor for this object, or null if the editor cannot be found. - - - Returns the events for this instance of a component. - An that represents the events for this component instance. - - - Returns the events for this instance of a component using the specified attribute array as a filter. - An array of type that is used as a filter. - An that represents the filtered events for this component instance. - - - Returns the properties for this instance of a component. - A that represents the properties for this component instance. - - - Returns the properties for this instance of a component using the attribute array as a filter. - An array of type that is used as a filter. - A that represents the filtered properties for this component instance. - - - Returns an object that contains the property described by the specified property descriptor. - A that represents the property whose owner is to be found. - An that represents the owner of the specified property. - - - Aids implementation of the interface. Inheritors of implement a set of functions to provide strong typing, but inherit most of the functionality needed to fully implement a DataAdapter. - - - Initializes a new instance of a DataAdapter class. - - - Initializes a new instance of a DataAdapter class from an existing object of the same type. - A DataAdapter object used to create the new DataAdapter. - - - Adds a to the current batch. - The to add to the batch. - The number of commands in the batch before adding the . - The adapter does not support batches. - - - Removes all objects from the batch. - The adapter does not support batches. - - - Initializes a new instance of the class. - The used to update the data source. - The executed during the . - Whether the command is an UPDATE, INSERT, DELETE, or SELECT statement. - A object. - A new instance of the class. - - - Initializes a new instance of the class. - The that updates the data source. - The to execute during the . - Whether the command is an UPDATE, INSERT, DELETE, or SELECT statement. - A object. - A new instance of the class. - - - The default name used by the object for table mappings. - - - - Gets or sets a command for deleting records from the data set. - An used during to delete records in the data source for deleted rows in the data set. - - - Releases the unmanaged resources used by the and optionally releases the managed resources. - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - Executes the current batch. - The return value from the last command in the batch. - - - Adds or refreshes rows in a specified range in the to match those in the data source using the and source table names, command string, and command behavior. - A to fill with records and, if necessary, schema. - The zero-based record number to start with. - The maximum number of records to retrieve. - The name of the source table to use for table mapping. - The SQL SELECT statement used to retrieve rows from the data source. - One of the values. - The number of rows successfully added to or refreshed in the . This does not include rows affected by statements that do not return rows. - The source table is invalid. - The startRecord parameter is less than 0. -or- The maxRecords parameter is less than 0. - - - Adds or refreshes rows in a specified range in the to match those in the data source using the and names. - The objects to fill from the data source. - The zero-based record number to start with. - The maximum number of records to retrieve. - The executed to fill the objects. - One of the values. - The number of rows added to or refreshed in the data tables. - The is invalid. - The source table is invalid. -or- The connection is invalid. - The connection could not be found. - The startRecord parameter is less than 0. -or- The maxRecords parameter is less than 0. - - - Adds or refreshes rows in a specified range in the to match those in the data source using the and names. - A to fill with records and, if necessary, schema. - The zero-based record number to start with. - The maximum number of records to retrieve. - The name of the source table to use for table mapping. - The number of rows successfully added to or refreshed in the . This does not include rows affected by statements that do not return rows. - The is invalid. - The source table is invalid. -or- The connection is invalid. - The connection could not be found. - The startRecord parameter is less than 0. -or- The maxRecords parameter is less than 0. - - - Adds or refreshes rows in a to match those in the data source starting at the specified record and retrieving up to the specified maximum number of records. - The zero-based record number to start with. - The maximum number of records to retrieve. - The objects to fill from the data source. - The number of rows successfully added to or refreshed in the . This value does not include rows affected by statements that do not return rows. - - - Adds or refreshes rows in the . - A to fill with records and, if necessary, schema. - The number of rows successfully added to or refreshed in the . This does not include rows affected by statements that do not return rows. - - - Adds or refreshes rows in the to match those in the data source using the and names. - A to fill with records and, if necessary, schema. - The name of the source table to use for table mapping. - The number of rows successfully added to or refreshed in the . This does not include rows affected by statements that do not return rows. - The source table is invalid. - - - Adds or refreshes rows in a specified range in the to match those in the data source using the name. - The name of the to use for table mapping. - The number of rows successfully added to or refreshed in the . This does not include rows affected by statements that do not return rows. - The source table is invalid. - - - Adds or refreshes rows in a to match those in the data source using the specified , and . - A to fill with records and, if necessary, schema. - The SQL SELECT statement used to retrieve rows from the data source. - One of the values. - The number of rows successfully added to or refreshed in the . This does not include rows affected by statements that do not return rows. - - - Gets or sets the behavior of the command used to fill the data adapter. - The of the command used to fill the data adapter. - - - Adds a to the specified and configures the schema to match that in the data source based on the specified . - The to be filled with the schema from the data source. - One of the values. - The SQL SELECT statement used to retrieve rows from the data source. - The name of the source table to use for table mapping. - One of the values. - An array of objects that contain schema information returned from the data source. - - - Adds a to the specified and configures the schema to match that in the data source based upon the specified and . - A to insert the schema in. - One of the values that specify how to insert the schema. - The name of the source table to use for table mapping. - A reference to a collection of objects that were added to the . - A source table from which to get the schema could not be found. - - - Configures the schema of the specified based on the specified , command string, and values. - The to be filled with the schema from the data source. - One of the values. - The SQL SELECT statement used to retrieve rows from the data source. - One of the values. - A of object that contains schema information returned from the data source. - - - Adds a named "Table" to the specified and configures the schema to match that in the data source based on the specified . - A to insert the schema in. - One of the values that specify how to insert the schema. - A reference to a collection of objects that were added to the . - - - Configures the schema of the specified based on the specified . - The to be filled with the schema from the data source. - One of the values. - A that contains schema information returned from the data source. - - - Returns a from one of the commands in the current batch. - The index of the command to retrieve the parameter from. - The index of the parameter within the command. - The specified. - The adapter does not support batches. - - - Returns information about an individual update attempt within a larger batched update. - The zero-based column ordinal of the individual command within the batch. - The number of rows affected in the data store by the specified command within the batch. - An thrown during execution of the specified command. Returns null (Nothing in Visual Basic) if no exception is thrown. - Information about an individual update attempt within a larger batched update. - - - Gets the parameters set by the user when executing an SQL SELECT statement. - An array of objects that contains the parameters set by the user. - - - Initializes batching for the . - The adapter does not support batches. - - - Gets or sets a command used to insert new records into the data source. - A used during to insert records in the data source for new rows in the data set. - - - Raises the RowUpdated event of a .NET Framework data provider. - A that contains the event data. - - - Raises the RowUpdating event of a .NET Framework data provider. - An that contains the event data. - - - Gets or sets a command used to select records in the data source. - A that is used during to select records from data source for placement in the data set. - - - Ends batching for the . - The adapter does not support batches. - - - Updates the values in the database by executing the respective INSERT, UPDATE, or DELETE statements for each inserted, updated, or deleted row in the specified . - The used to update the data source. - The number of rows successfully updated from the . - The source table is invalid. - An attempt to execute an INSERT, UPDATE, or DELETE statement resulted in zero records affected. - - - Updates the values in the database by executing the respective INSERT, UPDATE, or DELETE statements for each inserted, updated, or deleted row in the specified . - The used to update the data source. - The number of rows successfully updated from the . - The is invalid. - The source table is invalid. - No exists to update. -or- No exists to update. -or- No exists to use as a source. - An attempt to execute an INSERT, UPDATE, or DELETE statement resulted in zero records affected. - - - Updates the values in the database by executing the respective INSERT, UPDATE, or DELETE statements for each inserted, updated, or deleted row in the specified array in the . - An array of objects used to update the data source. - The number of rows successfully updated from the . - The is invalid. - The source table is invalid. - No exists to update. -or- No exists to update. -or- No exists to use as a source. - An attempt to execute an INSERT, UPDATE, or DELETE statement resulted in zero records affected. - - - Updates the values in the database by executing the respective INSERT, UPDATE, or DELETE statements for each inserted, updated, or deleted row in the with the specified name. - The to use to update the data source. - The name of the source table to use for table mapping. - The number of rows successfully updated from the . - The is invalid. - The source table is invalid. - An attempt to execute an INSERT, UPDATE, or DELETE statement resulted in zero records affected. - - - Updates the values in the database by executing the respective INSERT, UPDATE, or DELETE statements for each inserted, updated, or deleted row in the specified array of objects. - An array of objects used to update the data source. - The collection to use. - The number of rows successfully updated from the . - The is invalid. - The source table is invalid. - No exists to update. -or- No exists to update. -or- No exists to use as a source. - An attempt to execute an INSERT, UPDATE, or DELETE statement resulted in zero records affected. - - - Gets or sets a value that enables or disables batch processing support, and specifies the number of commands that can be executed in a batch. - The number of rows to process per batch. Value is - - Effect - - 0 - - There is no limit on the batch size. - - 1 - - Disables batch updating. - - > 1 - - Changes are sent using batches of operations at a time. - - When setting this to a value other than 1 ,all the commands associated with the must have their property set to None or OutputParameters. An exception will be thrown otherwise. - - - Gets or sets a command used to update records in the data source. - A used during to update records in the data source for modified rows in the data set. - - - Gets or sets an SQL statement for deleting records from the data set. - An used during to delete records in the data source for deleted rows in the data set. - - - Gets or sets an SQL statement used to insert new records into the data source. - An used during to insert records in the data source for new rows in the data set. - - - Gets or sets an SQL statement used to select records in the data source. - An that is used during to select records from data source for placement in the data set. - - - Gets or sets an SQL statement used to update records in the data source. - An used during to update records in the data source for modified rows in the data set. - - - Creates a new object that is a copy of the current instance. - A new object that is a copy of this instance. - - - Reads a forward-only stream of rows from a data source. - - - Initializes a new instance of the class. - - - Closes the object. - - - Gets a value indicating the depth of nesting for the current row. - The depth of nesting for the current row. - - - Releases all resources used by the current instance of the class. - - - Releases the managed resources used by the and optionally releases the unmanaged resources. - true to release managed and unmanaged resources; false to release only unmanaged resources. - - - Gets the number of columns in the current row. - The number of columns in the current row. - There is no current connection to an instance of SQL Server. - - - Gets the value of the specified column as a Boolean. - The zero-based column ordinal. - The value of the specified column. - The specified cast is not valid. - - - Gets the value of the specified column as a byte. - The zero-based column ordinal. - The value of the specified column. - The specified cast is not valid. - - - Reads a stream of bytes from the specified column, starting at location indicated by dataOffset, into the buffer, starting at the location indicated by bufferOffset. - The zero-based column ordinal. - The index within the row from which to begin the read operation. - The buffer into which to copy the data. - The index with the buffer to which the data will be copied. - The maximum number of characters to read. - The actual number of bytes read. - The specified cast is not valid. - - - Gets the value of the specified column as a single character. - The zero-based column ordinal. - The value of the specified column. - The specified cast is not valid. - - - Reads a stream of characters from the specified column, starting at location indicated by dataOffset, into the buffer, starting at the location indicated by bufferOffset. - The zero-based column ordinal. - The index within the row from which to begin the read operation. - The buffer into which to copy the data. - The index with the buffer to which the data will be copied. - The maximum number of characters to read. - The actual number of characters read. - - - Returns a object for the requested column ordinal. - The zero-based column ordinal. - A object. - - - Gets name of the data type of the specified column. - The zero-based column ordinal. - A string representing the name of the data type. - The specified cast is not valid. - - - Gets the value of the specified column as a object. - The zero-based column ordinal. - The value of the specified column. - The specified cast is not valid. - - - Returns a object for the requested column ordinal that can be overridden with a provider-specific implementation. - The zero-based column ordinal. - A object. - - - Gets the value of the specified column as a object. - The zero-based column ordinal. - The value of the specified column. - The specified cast is not valid. - - - Gets the value of the specified column as a double-precision floating point number. - The zero-based column ordinal. - The value of the specified column. - The specified cast is not valid. - - - Returns an that can be used to iterate through the rows in the data reader. - An that can be used to iterate through the rows in the data reader. - - - Gets the data type of the specified column. - The zero-based column ordinal. - The data type of the specified column. - The specified cast is not valid. - - - Synchronously gets the value of the specified column as a type. - The column to be retrieved. - Synchronously gets the value of the specified column as a type. - The column to be retrieved. - The connection drops or is closed during the data retrieval. The is closed during the data retrieval. There is no data ready to be read (for example, the first hasn't been called, or returned false). Tried to read a previously-read column in sequential mode. There was an asynchronous operation in progress. This applies to all Get* methods when running in sequential mode, as they could be called while reading a stream. - Trying to read a column that does not exist. - T doesn’t match the type returned by SQL Server or cannot be cast. - - - Asynchronously gets the value of the specified column as a type. - The type of the value to be returned. - The type of the value to be returned. - The type of the value to be returned. - The connection drops or is closed during the data retrieval. The is closed during the data retrieval. There is no data ready to be read (for example, the first hasn't been called, or returned false). Tried to read a previously-read column in sequential mode. There was an asynchronous operation in progress. This applies to all Get* methods when running in sequential mode, as they could be called while reading a stream. - Trying to read a column that does not exist. - T doesn’t match the type returned by the data source or cannot be cast. - - - Asynchronously gets the value of the specified column as a type. - The type of the value to be returned. - The cancellation instruction, which propagates a notification that operations should be canceled. This does not guarantee the cancellation. A setting of CancellationToken.None makes this method equivalent to . The returned task must be marked as cancelled. - The type of the value to be returned. - The type of the value to be returned. - The connection drops or is closed during the data retrieval. The is closed during the data retrieval. There is no data ready to be read (for example, the first hasn't been called, or returned false). Tried to read a previously-read column in sequential mode. There was an asynchronous operation in progress. This applies to all Get* methods when running in sequential mode, as they could be called while reading a stream. - Trying to read a column that does not exist. - T doesn’t match the type returned by the data source or cannot be cast. - - - Gets the value of the specified column as a single-precision floating point number. - The zero-based column ordinal. - The value of the specified column. - The specified cast is not valid. - - - Gets the value of the specified column as a globally-unique identifier (GUID). - The zero-based column ordinal. - The value of the specified column. - The specified cast is not valid. - - - Gets the value of the specified column as a 16-bit signed integer. - The zero-based column ordinal. - The value of the specified column. - The specified cast is not valid. - - - Gets the value of the specified column as a 32-bit signed integer. - The zero-based column ordinal. - The value of the specified column. - The specified cast is not valid. - - - Gets the value of the specified column as a 64-bit signed integer. - The zero-based column ordinal. - The value of the specified column. - The specified cast is not valid. - - - Gets the name of the column, given the zero-based column ordinal. - The zero-based column ordinal. - The name of the specified column. - - - Gets the column ordinal given the name of the column. - The name of the column. - The zero-based column ordinal. - The name specified is not a valid column name. - - - Returns the provider-specific field type of the specified column. - The zero-based column ordinal. - The object that describes the data type of the specified column. - - - Gets the value of the specified column as an instance of . - The zero-based column ordinal. - The value of the specified column. - - - Gets all provider-specific attribute columns in the collection for the current row. - An array of into which to copy the attribute columns. - The number of instances of in the array. - - - Returns a that describes the column metadata of the . - A that describes the column metadata. - The is closed. - - - Retrieves data as a . - Retrieves data as a . - The returned object. - The connection drops or is closed during the data retrieval. The is closed during the data retrieval. There is no data ready to be read (for example, the first hasn't been called, or returned false). Tried to read a previously-read column in sequential mode. There was an asynchronous operation in progress. This applies to all Get* methods when running in sequential mode, as they could be called while reading a stream. - Trying to read a column that does not exist. - The returned type was not one of the types below: binary image varbinary udt - - - Gets the value of the specified column as an instance of . - The zero-based column ordinal. - The value of the specified column. - The specified cast is not valid. - - - Retrieves data as a . - Retrieves data as a . - The returned object. - The connection drops or is closed during the data retrieval. The is closed during the data retrieval. There is no data ready to be read (for example, the first hasn't been called, or returned false). Tried to read a previously-read column in sequential mode. There was an asynchronous operation in progress. This applies to all Get* methods when running in sequential mode, as they could be called while reading a stream. - Trying to read a column that does not exist. - The returned type was not one of the types below: char nchar ntext nvarchar text varchar - - - Gets the value of the specified column as an instance of . - The zero-based column ordinal. - The value of the specified column. - - - Populates an array of objects with the column values of the current row. - An array of into which to copy the attribute columns. - The number of instances of in the array. - - - Gets a value that indicates whether this contains one or more rows. - true if the contains one or more rows; otherwise false. - - - Gets a value indicating whether the is closed. - true if the is closed; otherwise false. - The is closed. - - - Gets a value that indicates whether the column contains nonexistent or missing values. - The zero-based column ordinal. - true if the specified column is equivalent to ; otherwise false. - - - An asynchronous version of , which gets a value that indicates whether the column contains non-existent or missing values. Optionally, sends a notification that operations should be cancelled. - The zero-based column to be retrieved. - The cancellation instruction, which propagates a notification that operations should be canceled. This does not guarantee the cancellation. A setting of CancellationToken.None makes this method equivalent to . The returned task must be marked as cancelled. - true if the specified column value is equivalent to DBNull otherwise false. - The connection drops or is closed during the data retrieval. The is closed during the data retrieval. There is no data ready to be read (for example, the first hasn't been called, or returned false). Trying to read a previously read column in sequential mode. There was an asynchronous operation in progress. This applies to all Get* methods when running in sequential mode, as they could be called while reading a stream. - Trying to read a column that does not exist. - - - An asynchronous version of , which gets a value that indicates whether the column contains non-existent or missing values. - The zero-based column to be retrieved. - true if the specified column value is equivalent to DBNull otherwise false. - The connection drops or is closed during the data retrieval. The is closed during the data retrieval. There is no data ready to be read (for example, the first hasn't been called, or returned false). Trying to read a previously read column in sequential mode. There was an asynchronous operation in progress. This applies to all Get* methods when running in sequential mode, as they could be called while reading a stream. - Trying to read a column that does not exist. - - - Gets the value of the specified column as an instance of . - The zero-based column ordinal. - The value of the specified column. - The index passed was outside the range of 0 through . - - - Gets the value of the specified column as an instance of . - The name of the column. - The value of the specified column. - No column with the specified name was found. - - - Advances the reader to the next result when reading the results of a batch of statements. - true if there are more result sets; otherwise false. - - - An asynchronous version of , which advances the reader to the next result when reading the results of a batch of statements. Invokes with CancellationToken.None. - A task representing the asynchronous operation. - An error occurred while executing the command text. - - - This is the asynchronous version of . Providers should override with an appropriate implementation. The cancellationToken may optionally be ignored. The default implementation invokes the synchronous method and returns a completed task, blocking the calling thread. The default implementation will return a cancelled task if passed an already cancelled cancellationToken. Exceptions thrown by will be communicated via the returned Task Exception property. Other methods and properties of the DbDataReader object should not be invoked while the returned Task is not yet completed. - The cancellation instruction. - A task representing the asynchronous operation. - An error occurred while executing the command text. - - - Advances the reader to the next record in a result set. - true if there are more rows; otherwise false. - - - An asynchronous version of , which advances the reader to the next record in a result set. This method invokes with CancellationToken.None. - A task representing the asynchronous operation. - An error occurred while executing the command text. - - - This is the asynchronous version of . Providers should override with an appropriate implementation. The cancellationToken may optionally be ignored. The default implementation invokes the synchronous method and returns a completed task, blocking the calling thread. The default implementation will return a cancelled task if passed an already cancelled cancellationToken. Exceptions thrown by Read will be communicated via the returned Task Exception property. Do not invoke other methods and properties of the DbDataReader object until the returned Task is complete. - The cancellation instruction. - A task representing the asynchronous operation. - An error occurred while executing the command text. - - - Gets the number of rows changed, inserted, or deleted by execution of the SQL statement. - The number of rows changed, inserted, or deleted. -1 for SELECT statements; 0 if no rows were affected or the statement failed. - - - Gets the number of fields in the that are not hidden. - The number of fields that are not hidden. - - - For a description of this member, see . - The zero-based column ordinal. - An instance of to be used when the field points to more remote structured data. - - - - - - - - - - - - - - Implements and , and provides data binding support for . - - - Initializes a new instance of the class. - - - Indicates the number of fields within the current record. This property is read-only. - The number of fields within the current record. - Not connected to a data source to read from. - - - Returns the value of the specified column as a Boolean. - The column ordinal. - true if the Boolean is true; otherwise false. - - - Returns the value of the specified column as a byte. - The column ordinal. - The value of the specified column. - - - Returns the value of the specified column as a byte array. - The zero-based column ordinal. - The index within the field from which to start the read operation. - The buffer into which to read the stream of bytes. - The index for buffer to start the read operation. - The number of bytes to read. - The value of the specified column. - - - Returns the value of the specified column as a character. - The column ordinal. - The value of the specified column. - - - Returns the value of the specified column as a character array. - Column ordinal. - Buffer to copy data into. - Maximum length to copy into the buffer. - Point to start from within the buffer. - Point to start from within the source data. - The value of the specified column. - - - Not currently supported. - Not currently supported. - Not currently supported. - - - Returns the name of the back-end data type. - The column ordinal. - The name of the back-end data type. - - - Returns the value of the specified column as a object. - The column ordinal. - The value of the specified column. - - - Returns a object for the requested column ordinal that can be overridden with a provider-specific implementation. - The zero-based column ordinal. - A object. - - - Returns the value of the specified column as a object. - The column ordinal. - The value of the specified column. - - - Returns the value of the specified column as a double-precision floating-point number. - The column ordinal. - The value of the specified column. - - - Returns the that is the data type of the object. - The column ordinal. - The that is the data type of the object. - - - Returns the value of the specified column as a single-precision floating-point number. - The column ordinal. - The value of the specified column. - - - Returns the GUID value of the specified field. - The index of the field to return. - The GUID value of the specified field. - The index passed was outside the range of 0 through . - - - Returns the value of the specified column as a 16-bit signed integer. - The column ordinal. - The value of the specified column. - - - Returns the value of the specified column as a 32-bit signed integer. - The column ordinal. - The value of the specified column. - - - Returns the value of the specified column as a 64-bit signed integer. - The column ordinal. - The value of the specified column. - - - Returns the name of the specified column. - The column ordinal. - The name of the specified column. - - - Returns the column ordinal, given the name of the column. - The name of the column. - The column ordinal. - - - Returns the value of the specified column as a string. - The column ordinal. - The value of the specified column. - - - Returns the value at the specified column in its native format. - The column ordinal. - The value to return. - - - Populates an array of objects with the column values of the current record. - An array of to copy the attribute fields into. - The number of instances of in the array. - - - Used to indicate nonexistent values. - The column ordinal. - true if the specified column is equivalent to ; otherwise false. - - - Indicates the value at the specified column in its native format given the column ordinal. This property is read-only. - The column ordinal. - The value at the specified column in its native format. - - - Indicates the value at the specified column in its native format given the column name. This property is read-only. - The column name. - The value at the specified column in its native format. - - - Returns a collection of custom attributes for this instance of a component. - An that contains the attributes for this object. - - - Returns the class name of this instance of a component. - The class name of the object, or null if the class does not have a name. - - - Returns the name of this instance of a component. - The name of the object, or null if the object does not have a name. - - - Returns a type converter for this instance of a component. - A that is the converter for this object, or null if there is no for this object. - - - Returns the default event for this instance of a component. - An that represents the default event for this object, or null if this object does not have events. - - - Returns the default property for this instance of a component. - A that represents the default property for this object, or null if this object does not have properties. - - - Returns an editor of the specified type for this instance of a component. - A that represents the editor for this object. - An of the specified type that is the editor for this object, or null if the editor cannot be found. - - - Returns the events for this instance of a component. - An that represents the events for this component instance. - - - Returns the events for this instance of a component using the specified attribute array as a filter. - An array of type that is used as a filter. - An that represents the filtered events for this component instance. - - - Returns the properties for this instance of a component. - A that represents the properties for this component instance. - - - Returns the properties for this instance of a component using the attribute array as a filter. - An array of type that is used as a filter. - A that represents the filtered properties for this component instance. - - - Returns an object that contains the property described by the specified property descriptor. - A that represents the property whose owner is to be found. - An that represents the owner of the specified property. - - - Provides a mechanism for enumerating all available instances of database servers within the local network. - - - Creates a new instance of the class. - - - Retrieves a containing information about all visible instances of the server represented by the strongly typed instance of this class. - Returns a containing information about the visible instances of the associated data source. - - - Exposes the method, which supports a simple iteration over a collection by a .NET Framework data provider. - - - Initializes a new instance of the class with the give n data reader. - The DataReader through which to iterate. - - - Initializes a new instance of the class using the specified DataReader. - The DataReader through which to iterate. - - - Initializes a new instance of the class using the specified reader and indicates whether to automatically close the reader after iterating through its data. - The DataReader through which to iterate. - true to automatically close the DataReader after iterating through its data; otherwise, false. - - - Initializes a new instance of the class using the specified DataReader, and indicates whether to automatically close the DataReader after iterating through its data. - The DataReader through which to iterate. - true to automatically close the DataReader after iterating through its data; otherwise, false. - - - Gets the current element in the collection. - The current element in the collection. - The enumerator is positioned before the first element of the collection or after the last element. - - - Advances the enumerator to the next element of the collection. - true if the enumerator was successfully advanced to the next element; false if the enumerator has passed the end of the collection. - The collection was modified after the enumerator was created. - - - Sets the enumerator to its initial position, which is before the first element in the collection. - The collection was modified after the enumerator was created. - - - The base class for all exceptions thrown on behalf of the data source. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with the specified error message. - The message to display for this exception. - - - Initializes a new instance of the class with the specified serialization information and context. - The that holds the serialized object data about the exception being thrown. - The that contains contextual information about the source or destination. - - - Initializes a new instance of the class with the specified error message and a reference to the inner exception that is the cause of this exception. - The error message string. - The inner exception reference. - - - Initializes a new instance of the class with the specified error message and error code. - The error message that explains the reason for the exception. - The error code for the exception. - - - Provides a list of constants for the well-known MetaDataCollections: DataSourceInformation, DataTypes, MetaDataCollections, ReservedWords, and Restrictions. - - - A constant for use with the method that represents the DataSourceInformation collection. - - - - A constant for use with the method that represents the DataTypes collection. - - - - A constant for use with the method that represents the MetaDataCollections collection. - - - - A constant for use with the method that represents the ReservedWords collection. - - - - A constant for use with the method that represents the Restrictions collection. - - - - Provides static values that are used for the column names in the MetaDataCollection objects contained in the . The is created by the GetSchema method. - - - Used by the GetSchema method to create the CollectionName column in the DataTypes collection. - - - - Used by the GetSchema method to create the ColumnSize column in the DataTypes collection. - - - - Used by the GetSchema method to create the CompositeIdentifierSeparatorPattern column in the DataSourceInformation collection. - - - - Used by the GetSchema method to create the CreateFormat column in the DataTypes collection. - - - - Used by the GetSchema method to create the CreateParameters column in the DataTypes collection. - - - - Used by the GetSchema method to create the DataSourceProductName column in the DataSourceInformation collection. - - - - Used by the GetSchema method to create the DataSourceProductVersion column in the DataSourceInformation collection. - - - - Used by the GetSchema method to create the DataSourceProductVersionNormalized column in the DataSourceInformation collection. - - - - Used by the GetSchema method to create the DataType column in the DataTypes collection. - - - - Used by the GetSchema method to create the GroupByBehavior column in the DataSourceInformation collection. - - - - Used by the GetSchema method to create the IdentifierCase column in the DataSourceInformation collection. - - - - Used by the GetSchema method to create the IdentifierPattern column in the DataSourceInformation collection. - - - - Used by the GetSchema method to create the IsAutoIncrementable column in the DataTypes collection. - - - - Used by the GetSchema method to create the IsBestMatch column in the DataTypes collection. - - - - Used by the GetSchema method to create the IsCaseSensitive column in the DataTypes collection. - - - - Used by the GetSchema method to create the IsConcurrencyType column in the DataTypes collection. - - - - Used by the GetSchema method to create the IsFixedLength column in the DataTypes collection. - - - - Used by the GetSchema method to create the IsFixedPrecisionScale column in the DataTypes collection. - - - - Used by the GetSchema method to create the IsLiteralSupported column in the DataTypes collection. - - - - Used by the GetSchema method to create the IsLong column in the DataTypes collection. - - - - Used by the GetSchema method to create the IsNullable column in the DataTypes collection. - - - - Used by the GetSchema method to create the IsSearchable column in the DataTypes collection. - - - - Used by the GetSchema method to create the IsSearchableWithLike column in the DataTypes collection. - - - - Used by the GetSchema method to create the IsUnsigned column in the DataTypes collection. - - - - Used by the GetSchema method to create the LiteralPrefix column in the DataTypes collection. - - - - Used by the GetSchema method to create the LiteralSuffix column in the DataTypes collection. - - - - Used by the GetSchema method to create the MaximumScale column in the DataTypes collection. - - - - Used by the GetSchema method to create the MinimumScale column in the DataTypes collection. - - - - Used by the GetSchema method to create the NumberOfIdentifierParts column in the MetaDataCollections collection. - - - - Used by the GetSchema method to create the NumberOfRestrictions column in the MetaDataCollections collection. - - - - Used by the GetSchema method to create the OrderByColumnsInSelect column in the DataSourceInformation collection. - - - - Used by the GetSchema method to create the ParameterMarkerFormat column in the DataSourceInformation collection. - - - - Used by the GetSchema method to create the ParameterMarkerPattern column in the DataSourceInformation collection. - - - - Used by the GetSchema method to create the ParameterNameMaxLength column in the DataSourceInformation collection. - - - - Used by the GetSchema method to create the ParameterNamePattern column in the DataSourceInformation collection. - - - - Used by the GetSchema method to create the ProviderDbType column in the DataTypes collection. - - - - Used by the GetSchema method to create the QuotedIdentifierCase column in the DataSourceInformation collection. - - - - Used by the GetSchema method to create the QuotedIdentifierPattern column in the DataSourceInformation collection. - - - - Used by the GetSchema method to create the ReservedWord column in the ReservedWords collection. - - - - Used by the GetSchema method to create the StatementSeparatorPattern column in the DataSourceInformation collection. - - - - Used by the GetSchema method to create the StringLiteralPattern column in the DataSourceInformation collection. - - - - Used by the GetSchema method to create the SupportedJoinOperators column in the DataSourceInformation collection. - - - - Used by the GetSchema method to create the TypeName column in the DataTypes collection. - - - - Represents a parameter to a and optionally, its mapping to a column. For more information on parameters, see Configuring Parameters and Parameter Data Types. - - - Initializes a new instance of the class. - - - Gets or sets the of the parameter. - One of the values. The default is . - The property is not set to a valid . - - - Gets or sets a value that indicates whether the parameter is input-only, output-only, bidirectional, or a stored procedure return value parameter. - One of the values. The default is Input. - The property is not set to one of the valid values. - - - Gets or sets a value that indicates whether the parameter accepts null values. - true if null values are accepted; otherwise false. The default is false. - - - Gets or sets the name of the . - The name of the . The default is an empty string (""). - - - [Supported in the .NET Framework 4.5.1 and later versions] Gets or sets the maximum number of digits used to represent the property. - The maximum number of digits used to represent the property. - - - Resets the DbType property to its original settings. - - - Gets or sets the number of decimal places to which is resolved. - The number of decimal places to which is resolved. - - - Gets or sets the maximum size, in bytes, of the data within the column. - The maximum size, in bytes, of the data within the column. The default value is inferred from the parameter value. - - - Gets or sets the name of the source column mapped to the and used for loading or returning the . - The name of the source column mapped to the . The default is an empty string. - - - Sets or gets a value which indicates whether the source column is nullable. This allows to correctly generate Update statements for nullable columns. - true if the source column is nullable; false if it is not. - - - Gets or sets the to use when you load . - One of the values. The default is Current. - The property is not set to one of the values. - - - Gets or sets the value of the parameter. - An that is the value of the parameter. The default value is null. - - - Indicates the precision of numeric parameters. - The maximum number of digits used to represent the Value property of a data provider Parameter object. The default value is 0, which indicates that a data provider sets the precision for Value. - - - For a description of this member, see . - The number of decimal places to which is resolved. The default is 0. - - - The base class for a collection of parameters relevant to a . - - - Initializes a new instance of the class. - - - Adds the specified object to the . - The of the to add to the collection. - The index of the object in the collection. - - - Adds an array of items with the specified values to the . - An array of values of type to add to the collection. - - - Removes all values from the . - - - Indicates whether a with the specified is contained in the collection. - The of the to look for in the collection. - true if the is in the collection; otherwise false. - - - Indicates whether a with the specified name exists in the collection. - The name of the to look for in the collection. - true if the is in the collection; otherwise false. - - - Copies an array of items to the collection starting at the specified index. - The array of items to copy to the collection. - The index in the collection to copy the items. - - - Specifies the number of items in the collection. - The number of items in the collection. - - - Exposes the method, which supports a simple iteration over a collection by a .NET Framework data provider. - An that can be used to iterate through the collection. - - - Returns the object at the specified index in the collection. - The index of the in the collection. - The object at the specified index in the collection. - - - Returns the object with the specified name. - The name of the in the collection. - The the object with the specified name. - - - Returns the index of the specified object. - The object in the collection. - The index of the specified object. - - - Returns the index of the object with the specified name. - The name of the object in the collection. - The index of the object with the specified name. - - - Inserts the specified index of the object with the specified name into the collection at the specified index. - The index at which to insert the object. - The object to insert into the collection. - - - Specifies whether the collection is a fixed size. - true if the collection is a fixed size; otherwise false. - - - Specifies whether the collection is read-only. - true if the collection is read-only; otherwise false. - - - Specifies whether the collection is synchronized. - true if the collection is synchronized; otherwise false. - - - Gets and sets the at the specified index. - The zero-based index of the parameter. - The at the specified index. - The specified index does not exist. - - - Gets and sets the with the specified name. - The name of the parameter. - The with the specified name. - The specified index does not exist. - - - Removes the specified object from the collection. - The object to remove. - - - Removes the object at the specified from the collection. - The index where the object is located. - - - Removes the object with the specified name from the collection. - The name of the object to remove. - - - Sets the object at the specified index to a new value. - The index where the object is located. - The new value. - - - Sets the object with the specified name to a new value. - The name of the object in the collection. - The new value. - - - Specifies the to be used to synchronize access to the collection. - A to be used to synchronize access to the . - - - Gets or sets the element at the specified index. - The zero-based index of the element to get or set. - The element at the specified index. - - - Gets or sets the parameter at the specified index. - The name of the parameter to retrieve. - An at the specified index. - - - Represents a set of methods for creating instances of a provider's implementation of the data source classes. - - - Initializes a new instance of a class. - - - Specifies whether the specific supports the class. - true if the instance of the supports the class; otherwise false. - - - Returns a new instance of the provider's class that implements the class. - A new instance of . - - - Returns a new instance of the provider's class that implements the class. - A new instance of . - - - Returns a new instance of the provider's class that implements the class. - A new instance of . - - - Returns a new instance of the provider's class that implements the class. - A new instance of . - - - Returns a new instance of the provider's class that implements the class. - A new instance of . - - - Returns a new instance of the provider's class that implements the class. - A new instance of . - - - Returns a new instance of the provider's class that implements the class. - A new instance of . - - - Identifies which provider-specific property in the strongly typed parameter classes is to be used when setting a provider-specific type. - - - Initializes a new instance of a class. - Specifies whether this property is a provider-specific property. - - - Indicates whether the attributed property is a provider-specific type. - true if the property that this attribute is applied to is a provider-specific type property; otherwise false. - - - The base class for a transaction. - - - Initializes a new object. - - - Commits the database transaction. - - - Specifies the object associated with the transaction. - The object associated with the transaction. - - - Specifies the object associated with the transaction. - The object associated with the transaction. - - - Releases the unmanaged resources used by the . - - - Releases the unmanaged resources used by the and optionally releases the managed resources. - If true, this method releases all resources held by any managed objects that this references. - - - Specifies the for this transaction. - The for this transaction. - - - Rolls back a transaction from a pending state. - - - Gets the object associated with the transaction, or a null reference if the transaction is no longer valid. - The object associated with the transaction. - - - Specifies the action to take with regard to the current and remaining rows during an . - - - The is to continue proccessing rows. - - - - The event handler reports that the update should be treated as an error. - - - - The current row and all remaining rows are not to be updated. - - - - The current row is not to be updated. - - - - Represents the exception that is thrown when you try to return a version of a that has been deleted. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with the specified string. - The string to display when the exception is thrown. - - - Initializes a new instance of the class with serialization information. - The data that is required to serialize or deserialize an object. - Description of the source and destination of the specified serialized stream. - - - Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. - The error message that explains the reason for the exception. - The exception that is the cause of the current exception, or a null reference (Nothing in Visual Basic) if no inner exception is specified. - - - Specifies how to read XML data and a relational schema into a . - - - Default. - - - - Reads a DiffGram, applying changes from the DiffGram to the . The semantics are identical to those of a operation. As with the operation, values are preserved. Input to with DiffGrams should only be obtained using the output from as a DiffGram. - - - - Reads XML fragments, such as those generated by executing FOR XML queries, against an instance of SQL Server. When is set to Fragment, the default namespace is read as the inline schema. - - - - Ignores any inline schema and reads data into the existing schema. If any data does not match the existing schema, it is discarded (including data from differing namespaces defined for the ). If the data is a DiffGram, IgnoreSchema has the same functionality as DiffGram. - - - - Ignores any inline schema, infers schema from the data and loads the data. If the already contains a schema, the current schema is extended by adding new tables or adding columns to existing tables. An exception is thrown if the inferred table already exists but with a different namespace, or if any of the inferred columns conflict with existing columns. - - - - Ignores any inline schema, infers a strongly typed schema from the data, and loads the data. If the type cannot be inferred from the data, it is interpreted as string data. If the already contains a schema, the current schema is extended, either by adding new tables or by adding columns to existing tables. An exception is thrown if the inferred table already exists but with a different namespace, or if any of the inferred columns conflict with existing columns. - - - - Reads any inline schema and loads the data. If the already contains schema, new tables may be added to the schema, but an exception is thrown if any tables in the inline schema already exist in the . - - - - Specifies how to write XML data and a relational schema from a . - - - Writes the entire as a DiffGram, including original and current values. To generate a DiffGram containing only changed values, call , and then call as a DiffGram on the returned . - - - - Writes the current contents of the as XML data, without an XSD schema. If no data is loaded into the , nothing is written. - - - - Writes the current contents of the as XML data with the relational structure as inline XSD schema. If the has only a schema with no data, only the inline schema is written. If the does not have a current schema, nothing is written. - - - - The exception that is thrown when a unit of data is read from or written to an address that is not a multiple of the data size. This class cannot be inherited. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class using the specified error message. - A object that describes the error. The content of message is intended to be understood by humans. The caller of this constructor is required to ensure that this string has been localized for the current system culture. - - - Initializes a new instance of the class using the specified error message and underlying exception. - A object that describes the error. The content of message is intended to be understood by humans. The caller of this constructor is required to ensure that this string has been localized for the current system culture. - The exception that is the cause of the current . If the innerException parameter is not null, the current exception is raised in a catch block that handles the inner exception. - - - Represents an instant in time, typically expressed as a date and time of day. - - - Initializes a new instance of the structure to a specified number of ticks. - A date and time expressed in the number of 100-nanosecond intervals that have elapsed since January 1, 0001 at 00:00:00.000 in the Gregorian calendar. - ticks is less than or greater than . - - - Initializes a new instance of the structure to a specified number of ticks and to Coordinated Universal Time (UTC) or local time. - A date and time expressed in the number of 100-nanosecond intervals that have elapsed since January 1, 0001 at 00:00:00.000 in the Gregorian calendar. - One of the enumeration values that indicates whether ticks specifies a local time, Coordinated Universal Time (UTC), or neither. - ticks is less than or greater than . - kind is not one of the values. - - - Initializes a new instance of the structure to the specified year, month, and day. - The year (1 through 9999). - The month (1 through 12). - The day (1 through the number of days in month). - year is less than 1 or greater than 9999. -or- month is less than 1 or greater than 12. -or- day is less than 1 or greater than the number of days in month. - - - Initializes a new instance of the structure to the specified year, month, and day for the specified calendar. - The year (1 through the number of years in calendar). - The month (1 through the number of months in calendar). - The day (1 through the number of days in month). - The calendar that is used to interpret year, month, and day. - calendar is null. - year is not in the range supported by calendar. -or- month is less than 1 or greater than the number of months in calendar. -or- day is less than 1 or greater than the number of days in month. - - - Initializes a new instance of the structure to the specified year, month, day, hour, minute, and second. - The year (1 through 9999). - The month (1 through 12). - The day (1 through the number of days in month). - The hours (0 through 23). - The minutes (0 through 59). - The seconds (0 through 59). - year is less than 1 or greater than 9999. -or- month is less than 1 or greater than 12. -or- day is less than 1 or greater than the number of days in month. -or- hour is less than 0 or greater than 23. -or- minute is less than 0 or greater than 59. -or- second is less than 0 or greater than 59. - - - Initializes a new instance of the structure to the specified year, month, day, hour, minute, second, and Coordinated Universal Time (UTC) or local time. - The year (1 through 9999). - The month (1 through 12). - The day (1 through the number of days in month). - The hours (0 through 23). - The minutes (0 through 59). - The seconds (0 through 59). - One of the enumeration values that indicates whether year, month, day, hour, minute and second specify a local time, Coordinated Universal Time (UTC), or neither. - year is less than 1 or greater than 9999. -or- month is less than 1 or greater than 12. -or- day is less than 1 or greater than the number of days in month. -or- hour is less than 0 or greater than 23. -or- minute is less than 0 or greater than 59. -or- second is less than 0 or greater than 59. - kind is not one of the values. - - - Initializes a new instance of the structure to the specified year, month, day, hour, minute, and second for the specified calendar. - The year (1 through the number of years in calendar). - The month (1 through the number of months in calendar). - The day (1 through the number of days in month). - The hours (0 through 23). - The minutes (0 through 59). - The seconds (0 through 59). - The calendar that is used to interpret year, month, and day. - calendar is null. - year is not in the range supported by calendar. -or- month is less than 1 or greater than the number of months in calendar. -or- day is less than 1 or greater than the number of days in month. -or- hour is less than 0 or greater than 23 -or- minute is less than 0 or greater than 59. -or- second is less than 0 or greater than 59. - - - Initializes a new instance of the structure to the specified year, month, day, hour, minute, second, and millisecond. - The year (1 through 9999). - The month (1 through 12). - The day (1 through the number of days in month). - The hours (0 through 23). - The minutes (0 through 59). - The seconds (0 through 59). - The milliseconds (0 through 999). - year is less than 1 or greater than 9999. -or- month is less than 1 or greater than 12. -or- day is less than 1 or greater than the number of days in month. -or- hour is less than 0 or greater than 23. -or- minute is less than 0 or greater than 59. -or- second is less than 0 or greater than 59. -or- millisecond is less than 0 or greater than 999. - - - Initializes a new instance of the structure to the specified year, month, day, hour, minute, second, millisecond, and Coordinated Universal Time (UTC) or local time. - The year (1 through 9999). - The month (1 through 12). - The day (1 through the number of days in month). - The hours (0 through 23). - The minutes (0 through 59). - The seconds (0 through 59). - The milliseconds (0 through 999). - One of the enumeration values that indicates whether year, month, day, hour, minute, second, and millisecond specify a local time, Coordinated Universal Time (UTC), or neither. - year is less than 1 or greater than 9999. -or- month is less than 1 or greater than 12. -or- day is less than 1 or greater than the number of days in month. -or- hour is less than 0 or greater than 23. -or- minute is less than 0 or greater than 59. -or- second is less than 0 or greater than 59. -or- millisecond is less than 0 or greater than 999. - kind is not one of the values. - - - Initializes a new instance of the structure to the specified year, month, day, hour, minute, second, and millisecond for the specified calendar. - The year (1 through the number of years in calendar). - The month (1 through the number of months in calendar). - The day (1 through the number of days in month). - The hours (0 through 23). - The minutes (0 through 59). - The seconds (0 through 59). - The milliseconds (0 through 999). - The calendar that is used to interpret year, month, and day. - calendar is null. - year is not in the range supported by calendar. -or- month is less than 1 or greater than the number of months in calendar. -or- day is less than 1 or greater than the number of days in month. -or- hour is less than 0 or greater than 23. -or- minute is less than 0 or greater than 59. -or- second is less than 0 or greater than 59. -or- millisecond is less than 0 or greater than 999. - - - Initializes a new instance of the structure to the specified year, month, day, hour, minute, second, millisecond, and Coordinated Universal Time (UTC) or local time for the specified calendar. - The year (1 through the number of years in calendar). - The month (1 through the number of months in calendar). - The day (1 through the number of days in month). - The hours (0 through 23). - The minutes (0 through 59). - The seconds (0 through 59). - The milliseconds (0 through 999). - The calendar that is used to interpret year, month, and day. - One of the enumeration values that indicates whether year, month, day, hour, minute, second, and millisecond specify a local time, Coordinated Universal Time (UTC), or neither. - calendar is null. - year is not in the range supported by calendar. -or- month is less than 1 or greater than the number of months in calendar. -or- day is less than 1 or greater than the number of days in month. -or- hour is less than 0 or greater than 23. -or- minute is less than 0 or greater than 59. -or- second is less than 0 or greater than 59. -or- millisecond is less than 0 or greater than 999. - kind is not one of the values. - - - Returns a new that adds the value of the specified to the value of this instance. - A positive or negative time interval. - An object whose value is the sum of the date and time represented by this instance and the time interval represented by value. - The resulting is less than or greater than . - - - Returns a new that adds the specified number of days to the value of this instance. - A number of whole and fractional days. The value parameter can be negative or positive. - An object whose value is the sum of the date and time represented by this instance and the number of days represented by value. - The resulting is less than or greater than . - - - Returns a new that adds the specified number of hours to the value of this instance. - A number of whole and fractional hours. The value parameter can be negative or positive. - An object whose value is the sum of the date and time represented by this instance and the number of hours represented by value. - The resulting is less than or greater than . - - - Returns a new that adds the specified number of milliseconds to the value of this instance. - A number of whole and fractional milliseconds. The value parameter can be negative or positive. Note that this value is rounded to the nearest integer. - An object whose value is the sum of the date and time represented by this instance and the number of milliseconds represented by value. - The resulting is less than or greater than . - - - Returns a new that adds the specified number of minutes to the value of this instance. - A number of whole and fractional minutes. The value parameter can be negative or positive. - An object whose value is the sum of the date and time represented by this instance and the number of minutes represented by value. - The resulting is less than or greater than . - - - Returns a new that adds the specified number of months to the value of this instance. - A number of months. The months parameter can be negative or positive. - An object whose value is the sum of the date and time represented by this instance and months. - The resulting is less than or greater than . -or- months is less than -120,000 or greater than 120,000. - - - Returns a new that adds the specified number of seconds to the value of this instance. - A number of whole and fractional seconds. The value parameter can be negative or positive. - An object whose value is the sum of the date and time represented by this instance and the number of seconds represented by value. - The resulting is less than or greater than . - - - Returns a new that adds the specified number of ticks to the value of this instance. - A number of 100-nanosecond ticks. The value parameter can be positive or negative. - An object whose value is the sum of the date and time represented by this instance and the time represented by value. - The resulting is less than or greater than . - - - Returns a new that adds the specified number of years to the value of this instance. - A number of years. The value parameter can be negative or positive. - An object whose value is the sum of the date and time represented by this instance and the number of years represented by value. - value or the resulting is less than or greater than . - - - Compares two instances of and returns an integer that indicates whether the first instance is earlier than, the same as, or later than the second instance. - The first object to compare. - The second object to compare. -

A signed number indicating the relative values of t1 and t2.

-
Value Type

-

Condition

-

Less than zero

-

t1 is earlier than t2.

-

Zero

-

t1 is the same as t2.

-

Greater than zero

-

t1 is later than t2.

-

-
-
- - Compares the value of this instance to a specified value and returns an integer that indicates whether this instance is earlier than, the same as, or later than the specified value. - The object to compare to the current instance. -

A signed number indicating the relative values of this instance and the value parameter.

-
Value

-

Description

-

Less than zero

-

This instance is earlier than value.

-

Zero

-

This instance is the same as value.

-

Greater than zero

-

This instance is later than value.

-

-
-
- - Compares the value of this instance to a specified object that contains a specified value, and returns an integer that indicates whether this instance is earlier than, the same as, or later than the specified value. - A boxed object to compare, or null. -

A signed number indicating the relative values of this instance and value.

-
Value

-

Description

-

Less than zero

-

This instance is earlier than value.

-

Zero

-

This instance is the same as value.

-

Greater than zero

-

This instance is later than value, or value is null.

-

-
- value is not a . -
- - Gets the date component of this instance. - A new object with the same date as this instance, and the time value set to 12:00:00 midnight (00:00:00). - - - Gets the day of the month represented by this instance. - The day component, expressed as a value between 1 and 31. - - - Gets the day of the week represented by this instance. - An enumerated constant that indicates the day of the week of this value. - - - Gets the day of the year represented by this instance. - The day of the year, expressed as a value between 1 and 366. - - - Returns the number of days in the specified month and year. - The year. - The month (a number ranging from 1 to 12). - The number of days in month for the specified year. For example, if month equals 2 for February, the return value is 28 or 29 depending upon whether year is a leap year. - month is less than 1 or greater than 12. -or- year is less than 1 or greater than 9999. - - - Returns a value indicating whether the value of this instance is equal to the value of the specified instance. - The object to compare to this instance. - true if the value parameter equals the value of this instance; otherwise, false. - - - Returns a value indicating whether this instance is equal to a specified object. - The object to compare to this instance. - true if value is an instance of and equals the value of this instance; otherwise, false. - - - Returns a value indicating whether two instances have the same date and time value. - The first object to compare. - The second object to compare. - true if the two values are equal; otherwise, false. - - - Deserializes a 64-bit binary value and recreates an original serialized object. - A 64-bit signed integer that encodes the property in a 2-bit field and the property in a 62-bit field. - An object that is equivalent to the object that was serialized by the method. - dateData is less than or greater than . - - - Converts the specified Windows file time to an equivalent local time. - A Windows file time expressed in ticks. - An object that represents the local time equivalent of the date and time represented by the fileTime parameter. - fileTime is less than 0 or represents a time greater than . - - - Converts the specified Windows file time to an equivalent UTC time. - A Windows file time expressed in ticks. - An object that represents the UTC time equivalent of the date and time represented by the fileTime parameter. - fileTime is less than 0 or represents a time greater than . - - - Returns a equivalent to the specified OLE Automation Date. - An OLE Automation Date value. - An object that represents the same date and time as d. - The date is not a valid OLE Automation Date value. - - - Converts the value of this instance to all the string representations supported by the standard date and time format specifiers. - A string array where each element is the representation of the value of this instance formatted with one of the standard date and time format specifiers. - - - Converts the value of this instance to all the string representations supported by the specified standard date and time format specifier. - A standard date and time format string. - A string array where each element is the representation of the value of this instance formatted with the format standard date and time format specifier. - format is not a valid standard date and time format specifier character. - - - Converts the value of this instance to all the string representations supported by the standard date and time format specifiers and the specified culture-specific formatting information. - An object that supplies culture-specific formatting information about this instance. - A string array where each element is the representation of the value of this instance formatted with one of the standard date and time format specifiers. - - - Converts the value of this instance to all the string representations supported by the specified standard date and time format specifier and culture-specific formatting information. - A date and time format string. - An object that supplies culture-specific formatting information about this instance. - A string array where each element is the representation of the value of this instance formatted with one of the standard date and time format specifiers. - format is not a valid standard date and time format specifier character. - - - Returns the hash code for this instance. - A 32-bit signed integer hash code. - - - Returns the for value type . - The enumerated constant, . - - - Gets the hour component of the date represented by this instance. - The hour component, expressed as a value between 0 and 23. - - - Indicates whether this instance of is within the daylight saving time range for the current time zone. - true if the value of the property is or and the value of this instance of is within the daylight saving time range for the local time zone; false if is . - - - Returns an indication whether the specified year is a leap year. - A 4-digit year. - true if year is a leap year; otherwise, false. - year is less than 1 or greater than 9999. - - - Gets a value that indicates whether the time represented by this instance is based on local time, Coordinated Universal Time (UTC), or neither. - One of the enumeration values that indicates what the current time represents. The default is . - - - Represents the largest possible value of . This field is read-only. - - - - Gets the milliseconds component of the date represented by this instance. - The milliseconds component, expressed as a value between 0 and 999. - - - Gets the minute component of the date represented by this instance. - The minute component, expressed as a value between 0 and 59. - - - Represents the smallest possible value of . This field is read-only. - - - - Gets the month component of the date represented by this instance. - The month component, expressed as a value between 1 and 12. - - - Gets a object that is set to the current date and time on this computer, expressed as the local time. - An object whose value is the current local date and time. - - - Adds a specified time interval to a specified date and time, yielding a new date and time. - The date and time value to add. - The time interval to add. - An object that is the sum of the values of d and t. - The resulting is less than or greater than . - - - Determines whether two specified instances of are equal. - The first object to compare. - The second object to compare. - true if d1 and d2 represent the same date and time; otherwise, false. - - - Determines whether one specified is later than another specified . - The first object to compare. - The second object to compare. - true if t1 is later than t2; otherwise, false. - - - Determines whether one specified represents a date and time that is the same as or later than another specified . - The first object to compare. - The second object to compare. - true if t1 is the same as or later than t2; otherwise, false. - - - Determines whether two specified instances of are not equal. - The first object to compare. - The second object to compare. - true if d1 and d2 do not represent the same date and time; otherwise, false. - - - Determines whether one specified is earlier than another specified . - The first object to compare. - The second object to compare. - true if t1 is earlier than t2; otherwise, false. - - - Determines whether one specified represents a date and time that is the same as or earlier than another specified . - The first object to compare. - The second object to compare. - true if t1 is the same as or earlier than t2; otherwise, false. - - - Subtracts a specified date and time from another specified date and time and returns a time interval. - The date and time value to subtract from (the minuend). - The date and time value to subtract (the subtrahend). - The time interval between d1 and d2; that is, d1 minus d2. - - - Subtracts a specified time interval from a specified date and time and returns a new date and time. - The date and time value to subtract from. - The time interval to subtract. - An object whose value is the value of d minus the value of t. - The resulting is less than or greater than . - - - Converts the string representation of a date and time to its equivalent. - A string that contains a date and time to convert. - An object that is equivalent to the date and time contained in s. - s is null. - s does not contain a valid string representation of a date and time. - - - Converts the string representation of a date and time to its equivalent by using culture-specific format information. - A string that contains a date and time to convert. - An object that supplies culture-specific format information about s. - An object that is equivalent to the date and time contained in s as specified by provider. - s is null. - s does not contain a valid string representation of a date and time. - - - Converts the string representation of a date and time to its equivalent by using culture-specific format information and formatting style. - A string that contains a date and time to convert. - An object that supplies culture-specific formatting information about s. - A bitwise combination of the enumeration values that indicates the style elements that can be present in s for the parse operation to succeed, and that defines how to interpret the parsed date in relation to the current time zone or the current date. A typical value to specify is . - An object that is equivalent to the date and time contained in s, as specified by provider and styles. - s is null. - s does not contain a valid string representation of a date and time. - styles contains an invalid combination of values. For example, both and . - - - Converts the specified string representation of a date and time to its equivalent using the specified array of formats, culture-specific format information, and style. The format of the string representation must match at least one of the specified formats exactly or an exception is thrown. - A string that contains a date and time to convert. - An array of allowable formats of s. For more information, see the Remarks section. - An object that supplies culture-specific format information about s. - A bitwise combination of enumeration values that indicates the permitted format of s. A typical value to specify is . - An object that is equivalent to the date and time contained in s, as specified by formats, provider, and style. - s or formats is null. - s is an empty string. -or- an element of formats is an empty string. -or- s does not contain a date and time that corresponds to any element of formats. -or- The hour component and the AM/PM designator in s do not agree. - style contains an invalid combination of values. For example, both and . - - - Converts the specified string representation of a date and time to its equivalent using the specified format, culture-specific format information, and style. The format of the string representation must match the specified format exactly or an exception is thrown. - A string containing a date and time to convert. - A format specifier that defines the required format of s. For more information, see the Remarks section. - An object that supplies culture-specific formatting information about s. - A bitwise combination of the enumeration values that provides additional information about s, about style elements that may be present in s, or about the conversion from s to a value. A typical value to specify is . - An object that is equivalent to the date and time contained in s, as specified by format, provider, and style. - s or format is null. - s or format is an empty string. -or- s does not contain a date and time that corresponds to the pattern specified in format. -or- The hour component and the AM/PM designator in s do not agree. - style contains an invalid combination of values. For example, both and . - - - Converts the specified string representation of a date and time to its equivalent using the specified format and culture-specific format information. The format of the string representation must match the specified format exactly. - A string that contains a date and time to convert. - A format specifier that defines the required format of s. For more information, see the Remarks section. - An object that supplies culture-specific format information about s. - An object that is equivalent to the date and time contained in s, as specified by format and provider. - s or format is null. - s or format is an empty string. -or- s does not contain a date and time that corresponds to the pattern specified in format. -or- The hour component and the AM/PM designator in s do not agree. - - - Gets the seconds component of the date represented by this instance. - The seconds component, expressed as a value between 0 and 59. - - - Creates a new object that has the same number of ticks as the specified , but is designated as either local time, Coordinated Universal Time (UTC), or neither, as indicated by the specified value. - A date and time. - One of the enumeration values that indicates whether the new object represents local time, UTC, or neither. - A new object that has the same number of ticks as the object represented by the value parameter and the value specified by the kind parameter. - - - Subtracts the specified date and time from this instance. - The date and time value to subtract. - A time interval that is equal to the date and time represented by this instance minus the date and time represented by value. - The result is less than or greater than . - - - Subtracts the specified duration from this instance. - The time interval to subtract. - An object that is equal to the date and time represented by this instance minus the time interval represented by value. - The result is less than or greater than . - - - Gets the number of ticks that represent the date and time of this instance. - The number of ticks that represent the date and time of this instance. The value is between DateTime.MinValue.Ticks and DateTime.MaxValue.Ticks. - - - Gets the time of day for this instance. - A time interval that represents the fraction of the day that has elapsed since midnight. - - - Serializes the current object to a 64-bit binary value that subsequently can be used to recreate the object. - A 64-bit signed integer that encodes the and properties. - - - Gets the current date. - An object that is set to today's date, with the time component set to 00:00:00. - - - Converts the value of the current object to a Windows file time. - The value of the current object expressed as a Windows file time. - The resulting file time would represent a date and time before 12:00 midnight January 1, 1601 C.E. UTC. - - - Converts the value of the current object to a Windows file time. - The value of the current object expressed as a Windows file time. - The resulting file time would represent a date and time before 12:00 midnight January 1, 1601 C.E. UTC. - - - Converts the value of the current object to local time. - An object whose property is , and whose value is the local time equivalent to the value of the current object, or if the converted value is too large to be represented by a object, or if the converted value is too small to be represented as a object. - - - Converts the value of the current object to its equivalent long date string representation. - A string that contains the long date string representation of the current object. - - - Converts the value of the current object to its equivalent long time string representation. - A string that contains the long time string representation of the current object. - - - Converts the value of this instance to the equivalent OLE Automation date. - A double-precision floating-point number that contains an OLE Automation date equivalent to the value of this instance. - The value of this instance cannot be represented as an OLE Automation Date. - - - Converts the value of the current object to its equivalent short date string representation. - A string that contains the short date string representation of the current object. - - - Converts the value of the current object to its equivalent short time string representation. - A string that contains the short time string representation of the current object. - - - Converts the value of the current object to its equivalent string representation using the specified format and culture-specific format information. - A standard or custom date and time format string. - An object that supplies culture-specific formatting information. - A string representation of value of the current object as specified by format and provider. - The length of format is 1, and it is not one of the format specifier characters defined for . -or- format does not contain a valid custom format pattern. - The date and time is outside the range of dates supported by the calendar used by provider. - - - Converts the value of the current object to its equivalent string representation using the specified format and the formatting conventions of the current culture. - A standard or custom date and time format string. - A string representation of value of the current object as specified by format. - The length of format is 1, and it is not one of the format specifier characters defined for . -or- format does not contain a valid custom format pattern. - The date and time is outside the range of dates supported by the calendar used by the current culture. - - - Converts the value of the current object to its equivalent string representation using the specified culture-specific format information. - An object that supplies culture-specific formatting information. - A string representation of value of the current object as specified by provider. - The date and time is outside the range of dates supported by the calendar used by provider. - - - Converts the value of the current object to its equivalent string representation using the formatting conventions of the current culture. - A string representation of the value of the current object. - The date and time is outside the range of dates supported by the calendar used by the current culture. - - - Converts the value of the current object to Coordinated Universal Time (UTC). - An object whose property is , and whose value is the UTC equivalent to the value of the current object, or if the converted value is too large to be represented by a object, or if the converted value is too small to be represented by a object. - - - Converts the specified string representation of a date and time to its equivalent using the specified culture-specific format information and formatting style, and returns a value that indicates whether the conversion succeeded. - A string containing a date and time to convert. - An object that supplies culture-specific formatting information about s. - A bitwise combination of enumeration values that defines how to interpret the parsed date in relation to the current time zone or the current date. A typical value to specify is . - When this method returns, contains the value equivalent to the date and time contained in s, if the conversion succeeded, or if the conversion failed. The conversion fails if the s parameter is null, is an empty string (""), or does not contain a valid string representation of a date and time. This parameter is passed uninitialized. - true if the s parameter was converted successfully; otherwise, false. - styles is not a valid value. -or- styles contains an invalid combination of values (for example, both and ). - provider is a neutral culture and cannot be used in a parsing operation. - - - Converts the specified string representation of a date and time to its equivalent and returns a value that indicates whether the conversion succeeded. - A string containing a date and time to convert. - When this method returns, contains the value equivalent to the date and time contained in s, if the conversion succeeded, or if the conversion failed. The conversion fails if the s parameter is null, is an empty string (""), or does not contain a valid string representation of a date and time. This parameter is passed uninitialized. - true if the s parameter was converted successfully; otherwise, false. - - - Converts the specified string representation of a date and time to its equivalent using the specified format, culture-specific format information, and style. The format of the string representation must match the specified format exactly. The method returns a value that indicates whether the conversion succeeded. - A string containing a date and time to convert. - The required format of s. - An object that supplies culture-specific formatting information about s. - A bitwise combination of one or more enumeration values that indicate the permitted format of s. - When this method returns, contains the value equivalent to the date and time contained in s, if the conversion succeeded, or if the conversion failed. The conversion fails if either the s or format parameter is null, is an empty string, or does not contain a date and time that correspond to the pattern specified in format. This parameter is passed uninitialized. - true if s was converted successfully; otherwise, false. - styles is not a valid value. -or- styles contains an invalid combination of values (for example, both and ). - - - Converts the specified string representation of a date and time to its equivalent using the specified array of formats, culture-specific format information, and style. The format of the string representation must match at least one of the specified formats exactly. The method returns a value that indicates whether the conversion succeeded. - A string that contains a date and time to convert. - An array of allowable formats of s. - An object that supplies culture-specific format information about s. - A bitwise combination of enumeration values that indicates the permitted format of s. A typical value to specify is . - When this method returns, contains the value equivalent to the date and time contained in s, if the conversion succeeded, or if the conversion failed. The conversion fails if s or formats is null, s or an element of formats is an empty string, or the format of s is not exactly as specified by at least one of the format patterns in formats. This parameter is passed uninitialized. - true if the s parameter was converted successfully; otherwise, false. - styles is not a valid value. -or- styles contains an invalid combination of values (for example, both and ). - - - Gets a object that is set to the current date and time on this computer, expressed as the Coordinated Universal Time (UTC). - An object whose value is the current UTC date and time. - - - Gets the year component of the date represented by this instance. - The year, between 1 and 9999. - - - This conversion is not supported. Attempting to use this method throws an . - An object that implements the interface. (This parameter is not used; specify null.) - The return value for this member is not used. - In all cases. - - - This conversion is not supported. Attempting to use this method throws an . - An object that implements the interface. (This parameter is not used; specify null.) - The return value for this member is not used. - In all cases. - - - This conversion is not supported. Attempting to use this method throws an . - An object that implements the interface. (This parameter is not used; specify null.) - The return value for this member is not used. - In all cases. - - - Returns the current object. - An object that implements the interface. (This parameter is not used; specify null.) - The current object. - - - This conversion is not supported. Attempting to use this method throws an . - An object that implements the interface. (This parameter is not used; specify null.) - The return value for this member is not used. - In all cases. - - - This conversion is not supported. Attempting to use this method throws an . - An object that implements the interface. (This parameter is not used; specify null.) - The return value for this member is not used. - In all cases. - - - This conversion is not supported. Attempting to use this method throws an . - An object that implements the interface. (This parameter is not used; specify null.) - The return value for this member is not used. - In all cases. - - - This conversion is not supported. Attempting to use this method throws an . - An object that implements the interface. (This parameter is not used; specify null.) - The return value for this member is not used. - In all cases. - - - This conversion is not supported. Attempting to use this method throws an . - An object that implements the interface. (This parameter is not used; specify null.) - The return value for this member is not used. - In all cases. - - - This conversion is not supported. Attempting to use this method throws an . - An object that implements the interface. (This parameter is not used; specify null.) - The return value for this member is not used. - In all cases. - - - This conversion is not supported. Attempting to use this method throws an . - An object that implements the interface. (This parameter is not used; specify null.) - The return value for this member is not used. - In all cases. - - - Converts the current object to an object of a specified type. - The desired type. - An object that implements the interface. (This parameter is not used; specify null.) - An object of the type specified by the type parameter, with a value equivalent to the current object. - type is null. - This conversion is not supported for the type. - - - This conversion is not supported. Attempting to use this method throws an . - An object that implements the interface. (This parameter is not used; specify null.) - The return value for this member is not used. - In all cases. - - - This conversion is not supported. Attempting to use this method throws an . - An object that implements the interface. (This parameter is not used; specify null.) - The return value for this member is not used. - In all cases. - - - This conversion is not supported. Attempting to use this method throws an . - An object that implements the interface. (This parameter is not used; specify null.) - The return value for this member is not used. - In all cases. - - - Populates a object with the data needed to serialize the current object. - The object to populate with data. - The destination for this serialization. (This parameter is not used; specify null.) - info is null. - - - Specifies whether a object represents a local time, a Coordinated Universal Time (UTC), or is not specified as either local time or UTC. - - - The time represented is local time. - - - - The time represented is not specified as either local time or Coordinated Universal Time (UTC). - - - - The time represented is UTC. - - - - Represents a point in time, typically expressed as a date and time of day, relative to Coordinated Universal Time (UTC). - - - Initializes a new instance of the structure using the specified value. - A date and time. - The Coordinated Universal Time (UTC) date and time that results from applying the offset is earlier than . -or- The UTC date and time that results from applying the offset is later than . - - - Initializes a new instance of the structure using the specified value and offset. - A date and time. - The time's offset from Coordinated Universal Time (UTC). - dateTime.Kind equals and offset does not equal zero. -or- dateTime.Kind equals and offset does not equal the offset of the system's local time zone. -or- offset is not specified in whole minutes. - offset is less than -14 hours or greater than 14 hours. -or- is less than or greater than . - - - Initializes a new instance of the structure using the specified number of ticks and offset. - A date and time expressed as the number of 100-nanosecond intervals that have elapsed since 12:00:00 midnight on January 1, 0001. - The time's offset from Coordinated Universal Time (UTC). - offset is not specified in whole minutes. - The property is earlier than or later than . -or- ticks is less than DateTimeOffset.MinValue.Ticks or greater than DateTimeOffset.MaxValue.Ticks. -or- Offset s less than -14 hours or greater than 14 hours. - - - Initializes a new instance of the structure using the specified year, month, day, hour, minute, second, and offset. - The year (1 through 9999). - The month (1 through 12). - The day (1 through the number of days in month). - The hours (0 through 23). - The minutes (0 through 59). - The seconds (0 through 59). - The time's offset from Coordinated Universal Time (UTC). - offset does not represent whole minutes. - year is less than one or greater than 9999. -or- month is less than one or greater than 12. -or- day is less than one or greater than the number of days in month. -or- hour is less than zero or greater than 23. -or- minute is less than 0 or greater than 59. -or- second is less than 0 or greater than 59. -or- offset is less than -14 hours or greater than 14 hours. -or- The property is earlier than or later than . - - - Initializes a new instance of the structure using the specified year, month, day, hour, minute, second, millisecond, and offset. - The year (1 through 9999). - The month (1 through 12). - The day (1 through the number of days in month). - The hours (0 through 23). - The minutes (0 through 59). - The seconds (0 through 59). - The milliseconds (0 through 999). - The time's offset from Coordinated Universal Time (UTC). - offset does not represent whole minutes. - year is less than one or greater than 9999. -or- month is less than one or greater than 12. -or- day is less than one or greater than the number of days in month. -or- hour is less than zero or greater than 23. -or- minute is less than 0 or greater than 59. -or- second is less than 0 or greater than 59. -or- millisecond is less than 0 or greater than 999. -or- offset is less than -14 or greater than 14. -or- The property is earlier than or later than . - - - Initializes a new instance of the structure using the specified year, month, day, hour, minute, second, millisecond, and offset of a specified calendar. - The year. - The month (1 through 12). - The day (1 through the number of days in month). - The hours (0 through 23). - The minutes (0 through 59). - The seconds (0 through 59). - The milliseconds (0 through 999). - The calendar that is used to interpret year, month, and day. - The time's offset from Coordinated Universal Time (UTC). - offset does not represent whole minutes. - calendar cannot be null. - year is less than the calendar parameter's MinSupportedDateTime.Year or greater than MaxSupportedDateTime.Year. -or- month is either less than or greater than the number of months in year in the calendar. -or- day is less than one or greater than the number of days in month. -or- hour is less than zero or greater than 23. -or- minute is less than 0 or greater than 59. -or- second is less than 0 or greater than 59. -or- millisecond is less than 0 or greater than 999. -or- offset is less than -14 hours or greater than 14 hours. -or- The year, month, and day parameters cannot be represented as a date and time value. -or- The property is earlier than or later than . - - - Returns a new object that adds a specified time interval to the value of this instance. - A object that represents a positive or a negative time interval. - An object whose value is the sum of the date and time represented by the current object and the time interval represented by timeSpan. - The resulting value is less than . -or- The resulting value is greater than . - - - Returns a new object that adds a specified number of whole and fractional days to the value of this instance. - A number of whole and fractional days. The number can be negative or positive. - An object whose value is the sum of the date and time represented by the current object and the number of days represented by days. - The resulting value is less than . -or- The resulting value is greater than . - - - Returns a new object that adds a specified number of whole and fractional hours to the value of this instance. - A number of whole and fractional hours. The number can be negative or positive. - An object whose value is the sum of the date and time represented by the current object and the number of hours represented by hours. - The resulting value is less than . -or- The resulting value is greater than . - - - Returns a new object that adds a specified number of milliseconds to the value of this instance. - A number of whole and fractional milliseconds. The number can be negative or positive. - An object whose value is the sum of the date and time represented by the current object and the number of whole milliseconds represented by milliseconds. - The resulting value is less than . -or- The resulting value is greater than . - - - Returns a new object that adds a specified number of whole and fractional minutes to the value of this instance. - A number of whole and fractional minutes. The number can be negative or positive. - An object whose value is the sum of the date and time represented by the current object and the number of minutes represented by minutes. - The resulting value is less than . -or- The resulting value is greater than . - - - Returns a new object that adds a specified number of months to the value of this instance. - A number of whole months. The number can be negative or positive. - An object whose value is the sum of the date and time represented by the current object and the number of months represented by months. - The resulting value is less than . -or- The resulting value is greater than . - - - Returns a new object that adds a specified number of whole and fractional seconds to the value of this instance. - A number of whole and fractional seconds. The number can be negative or positive. - An object whose value is the sum of the date and time represented by the current object and the number of seconds represented by seconds. - The resulting value is less than . -or- The resulting value is greater than . - - - Returns a new object that adds a specified number of ticks to the value of this instance. - A number of 100-nanosecond ticks. The number can be negative or positive. - An object whose value is the sum of the date and time represented by the current object and the number of ticks represented by ticks. - The resulting value is less than . -or- The resulting value is greater than . - - - Returns a new object that adds a specified number of years to the value of this instance. - A number of years. The number can be negative or positive. - An object whose value is the sum of the date and time represented by the current object and the number of years represented by years. - The resulting value is less than . -or- The resulting value is greater than . - - - Compares two objects and indicates whether the first is earlier than the second, equal to the second, or later than the second. - The first object to compare. - The second object to compare. -

A signed integer that indicates whether the value of the first parameter is earlier than, later than, or the same time as the value of the second parameter, as the following table shows.

-
Return value

-

Meaning

-

Less than zero

-

first is earlier than second.

-

Zero

-

first is equal to second.

-

Greater than zero

-

first is later than second.

-

-
-
- - Compares the current object to a specified object and indicates whether the current object is earlier than, the same as, or later than the second object. - An object to compare with the current object. -

A signed integer that indicates the relationship between the current object and other, as the following table shows.

-
Return Value

-

Description

-

Less than zero

-

The current object is earlier than other.

-

Zero

-

The current object is the same as other.

-

Greater than zero.

-

The current object is later than other.

-

-
-
- - Gets a value that represents the date component of the current object. - A value that represents the date component of the current object. - - - Gets a value that represents the date and time of the current object. - The date and time of the current object. - - - Gets the day of the month represented by the current object. - The day component of the current object, expressed as a value between 1 and 31. - - - Gets the day of the week represented by the current object. - One of the enumeration values that indicates the day of the week of the current object. - - - Gets the day of the year represented by the current object. - The day of the year of the current object, expressed as a value between 1 and 366. - - - Determines whether the current object represents the same point in time as a specified object. - An object to compare to the current object. - true if both objects have the same value; otherwise, false. - - - Determines whether a object represents the same point in time as a specified object. - The object to compare to the current object. - true if the obj parameter is a object and represents the same point in time as the current object; otherwise, false. - - - Determines whether two specified objects represent the same point in time. - The first object to compare. - The second object to compare. - true if the two objects have the same value; otherwise, false. - - - Determines whether the current object represents the same time and has the same offset as a specified object. - The object to compare to the current object. - true if the current object and other have the same date and time value and the same value; otherwise, false. - - - Converts the specified Windows file time to an equivalent local time. - A Windows file time, expressed in ticks. - An object that represents the date and time of fileTime with the offset set to the local time offset. - filetime is less than zero. -or- filetime is greater than DateTimeOffset.MaxValue.Ticks. - - - Converts a Unix time expressed as the number of milliseconds that have elapsed since 1970-01-01T00:00:00Z to a value. - A Unix time, expressed as the number of milliseconds that have elapsed since 1970-01-01T00:00:00Z (January 1, 1970, at 12:00 AM UTC). For Unix times before this date, its value is negative. - A date and time value that represents the same moment in time as the Unix time. - milliseconds is less than -62,135,596,800,000. -or- milliseconds is greater than 253,402,300,799,999. - - - Converts a Unix time expressed as the number of seconds that have elapsed since 1970-01-01T00:00:00Z to a value. - A Unix time, expressed as the number of seconds that have elapsed since 1970-01-01T00:00:00Z (January 1, 1970, at 12:00 AM UTC). For Unix times before this date, its value is negative. - A date and time value that represents the same moment in time as the Unix time. - seconds is less than -62,135,596,800. -or- seconds is greater than 253,402,300,799. - - - Returns the hash code for the current object. - A 32-bit signed integer hash code. - - - Gets the hour component of the time represented by the current object. - The hour component of the current object. This property uses a 24-hour clock; the value ranges from 0 to 23. - - - Gets a value that represents the local date and time of the current object. - The local date and time of the current object. - - - Represents the greatest possible value of . This field is read-only. - - is outside the range of the current or specified culture's default calendar. - - - Gets the millisecond component of the time represented by the current object. - The millisecond component of the current object, expressed as an integer between 0 and 999. - - - Gets the minute component of the time represented by the current object. - The minute component of the current object, expressed as an integer between 0 and 59. - - - Represents the earliest possible value. This field is read-only. - - - - Gets the month component of the date represented by the current object. - The month component of the current object, expressed as an integer between 1 and 12. - - - Gets a object that is set to the current date and time on the current computer, with the offset set to the local time's offset from Coordinated Universal Time (UTC). - A object whose date and time is the current local time and whose offset is the local time zone's offset from Coordinated Universal Time (UTC). - - - Gets the time's offset from Coordinated Universal Time (UTC). - The difference between the current object's time value and Coordinated Universal Time (UTC). - - - Adds a specified time interval to a object that has a specified date and time, and yields a object that has new a date and time. - The object to add the time interval to. - The time interval to add. - An object whose value is the sum of the values of dateTimeTz and timeSpan. - The resulting value is less than . -or- The resulting value is greater than . - - - Determines whether two specified objects represent the same point in time. - The first object to compare. - The second object to compare. - true if both objects have the same value; otherwise, false. - - - Determines whether one specified object is greater than (or later than) a second specified object. - The first object to compare. - The second object to compare. - true if the value of left is later than the value of right; otherwise, false. - - - Determines whether one specified object is greater than or equal to a second specified object. - The first object to compare. - The second object to compare. - true if the value of left is the same as or later than the value of right; otherwise, false. - - - - - - - Determines whether two specified objects refer to different points in time. - The first object to compare. - The second object to compare. - true if left and right do not have the same value; otherwise, false. - - - Determines whether one specified object is less than a second specified object. - The first object to compare. - The second object to compare. - true if the value of left is earlier than the value of right; otherwise, false. - - - Determines whether one specified object is less than a second specified object. - The first object to compare. - The second object to compare. - true if the value of left is earlier than the value of right; otherwise, false. - - - Subtracts one object from another and yields a time interval. - The minuend. - The subtrahend. - An object that represents the difference between left and right. - - - Subtracts a specified time interval from a specified date and time, and yields a new date and time. - The date and time object to subtract from. - The time interval to subtract. - An object that is equal to the value of dateTimeOffset minus timeSpan. - The resulting value is less than or greater than . - - - Converts the specified string representation of a date, time, and offset to its equivalent. - A string that contains a date and time to convert. - An object that is equivalent to the date and time that is contained in input. - The offset is greater than 14 hours or less than -14 hours. - input is null. - input does not contain a valid string representation of a date and time. -or- input contains the string representation of an offset value without a date or time. - - - Converts the specified string representation of a date and time to its equivalent using the specified culture-specific format information. - A string that contains a date and time to convert. - An object that provides culture-specific format information about input. - An object that is equivalent to the date and time that is contained in input, as specified by formatProvider. - The offset is greater than 14 hours or less than -14 hours. - input is null. - input does not contain a valid string representation of a date and time. -or- input contains the string representation of an offset value without a date or time. - - - Converts the specified string representation of a date and time to its equivalent using the specified culture-specific format information and formatting style. - A string that contains a date and time to convert. - An object that provides culture-specific format information about input. - A bitwise combination of enumeration values that indicates the permitted format of input. A typical value to specify is . - An object that is equivalent to the date and time that is contained in input as specified by formatProvider and styles. - The offset is greater than 14 hours or less than -14 hours. -or- styles is not a valid value. -or- styles includes an unsupported value. -or- styles includes values that cannot be used together. - input is null. - input does not contain a valid string representation of a date and time. -or- input contains the string representation of an offset value without a date or time. - - - Converts the specified string representation of a date and time to its equivalent using the specified format and culture-specific format information. The format of the string representation must match the specified format exactly. - A string that contains a date and time to convert. - A format specifier that defines the expected format of input. - An object that supplies culture-specific formatting information about input. - An object that is equivalent to the date and time that is contained in input as specified by format and formatProvider. - The offset is greater than 14 hours or less than -14 hours. - input is null. -or- format is null. - input is an empty string (""). -or- input does not contain a valid string representation of a date and time. -or- format is an empty string. -or- The hour component and the AM/PM designator in input do not agree. - - - Converts the specified string representation of a date and time to its equivalent using the specified format, culture-specific format information, and style. The format of the string representation must match the specified format exactly. - A string that contains a date and time to convert. - A format specifier that defines the expected format of input. - An object that supplies culture-specific formatting information about input. - A bitwise combination of enumeration values that indicates the permitted format of input. - An object that is equivalent to the date and time that is contained in the input parameter, as specified by the format, formatProvider, and styles parameters. - The offset is greater than 14 hours or less than -14 hours. -or- The styles parameter includes an unsupported value. -or- The styles parameter contains values that cannot be used together. - input is null. -or- format is null. - input is an empty string (""). -or- input does not contain a valid string representation of a date and time. -or- format is an empty string. -or- The hour component and the AM/PM designator in input do not agree. - - - Converts the specified string representation of a date and time to its equivalent using the specified formats, culture-specific format information, and style. The format of the string representation must match one of the specified formats exactly. - A string that contains a date and time to convert. - An array of format specifiers that define the expected formats of input. - An object that supplies culture-specific formatting information about input. - A bitwise combination of enumeration values that indicates the permitted format of input. - An object that is equivalent to the date and time that is contained in the input parameter, as specified by the formats, formatProvider, and styles parameters. - The offset is greater than 14 hours or less than -14 hours. -or- styles includes an unsupported value. -or- The styles parameter contains values that cannot be used together. - input is null. - input is an empty string (""). -or- input does not contain a valid string representation of a date and time. -or- No element of formats contains a valid format specifier. -or- The hour component and the AM/PM designator in input do not agree. - - - Gets the second component of the clock time represented by the current object. - The second component of the object, expressed as an integer value between 0 and 59. - - - Subtracts a specified time interval from the current object. - The time interval to subtract. - An object that is equal to the date and time represented by the current object, minus the time interval represented by value. - The resulting value is less than . -or- The resulting value is greater than . - - - Subtracts a value that represents a specific date and time from the current object. - An object that represents the value to subtract. - An object that specifies the interval between the two objects. - - - Gets the number of ticks that represents the date and time of the current object in clock time. - The number of ticks in the object's clock time. - - - Gets the time of day for the current object. - The time interval of the current date that has elapsed since midnight. - - - Converts the value of the current object to a Windows file time. - The value of the current object, expressed as a Windows file time. - The resulting file time would represent a date and time before midnight on January 1, 1601 C.E. Coordinated Universal Time (UTC). - - - Converts the current object to a object that represents the local time. - An object that represents the date and time of the current object converted to local time. - - - Converts the value of the current object to the date and time specified by an offset value. - The offset to convert the value to. - An object that is equal to the original object (that is, their methods return identical points in time) but whose property is set to offset. - The resulting object has a value earlier than . -or- The resulting object has a value later than . - offset is less than -14 hours. -or- offset is greater than 14 hours. - - - Converts the value of the current object to its equivalent string representation. - A string representation of a object that includes the offset appended at the end of the string. - The date and time is outside the range of dates supported by the calendar used by the current culture. - - - Converts the value of the current object to its equivalent string representation using the specified culture-specific formatting information. - An object that supplies culture-specific formatting information. - A string representation of the value of the current object, as specified by formatProvider. - The date and time is outside the range of dates supported by the calendar used by formatProvider. - - - Converts the value of the current object to its equivalent string representation using the specified format. - A format string. - A string representation of the value of the current object, as specified by format. - The length of format is one, and it is not one of the standard format specifier characters defined for . -or- format does not contain a valid custom format pattern. - The date and time is outside the range of dates supported by the calendar used by the current culture. - - - Converts the value of the current object to its equivalent string representation using the specified format and culture-specific format information. - A format string. - An object that supplies culture-specific formatting information. - A string representation of the value of the current object, as specified by format and provider. - The length of format is one, and it is not one of the standard format specifier characters defined for . -or- format does not contain a valid custom format pattern. - The date and time is outside the range of dates supported by the calendar used by formatProvider. - - - Converts the current object to a value that represents the Coordinated Universal Time (UTC). - An object that represents the date and time of the current object converted to Coordinated Universal Time (UTC). - - - Returns the number of milliseconds that have elapsed since 1970-01-01T00:00:00.000Z. - The number of milliseconds that have elapsed since 1970-01-01T00:00:00.000Z. - - - Returns the number of seconds that have elapsed since 1970-01-01T00:00:00Z. - The number of seconds that have elapsed since 1970-01-01T00:00:00Z. - - - Tries to convert a specified string representation of a date and time to its equivalent, and returns a value that indicates whether the conversion succeeded. - A string that contains a date and time to convert. - An object that provides culture-specific formatting information about input. - A bitwise combination of enumeration values that indicates the permitted format of input. - When the method returns, contains the value equivalent to the date and time of input, if the conversion succeeded, or , if the conversion failed. The conversion fails if the input parameter is null or does not contain a valid string representation of a date and time. This parameter is passed uninitialized. - true if the input parameter is successfully converted; otherwise, false. - styles includes an undefined value. -or- is not supported. -or- styles includes mutually exclusive values. - - - Tries to converts a specified string representation of a date and time to its equivalent, and returns a value that indicates whether the conversion succeeded. - A string that contains a date and time to convert. - When the method returns, contains the equivalent to the date and time of input, if the conversion succeeded, or , if the conversion failed. The conversion fails if the input parameter is null or does not contain a valid string representation of a date and time. This parameter is passed uninitialized. - true if the input parameter is successfully converted; otherwise, false. - - - Converts the specified string representation of a date and time to its equivalent using the specified array of formats, culture-specific format information, and style. The format of the string representation must match one of the specified formats exactly. - A string that contains a date and time to convert. - An array that defines the expected formats of input. - An object that supplies culture-specific formatting information about input. - A bitwise combination of enumeration values that indicates the permitted format of input. A typical value to specify is None. - When the method returns, contains the equivalent to the date and time of input, if the conversion succeeded, or , if the conversion failed. The conversion fails if the input does not contain a valid string representation of a date and time, or does not contain the date and time in the expected format defined by format, or if formats is null. This parameter is passed uninitialized. - true if the input parameter is successfully converted; otherwise, false. - styles includes an undefined value. -or- is not supported. -or- styles includes mutually exclusive values. - - - Converts the specified string representation of a date and time to its equivalent using the specified format, culture-specific format information, and style. The format of the string representation must match the specified format exactly. - A string that contains a date and time to convert. - A format specifier that defines the required format of input. - An object that supplies culture-specific formatting information about input. - A bitwise combination of enumeration values that indicates the permitted format of input. A typical value to specify is None. - When the method returns, contains the equivalent to the date and time of input, if the conversion succeeded, or , if the conversion failed. The conversion fails if the input parameter is null, or does not contain a valid string representation of a date and time in the expected format defined by format and provider. This parameter is passed uninitialized. - true if the input parameter is successfully converted; otherwise, false. - styles includes an undefined value. -or- is not supported. -or- styles includes mutually exclusive values. - - - Gets a value that represents the Coordinated Universal Time (UTC) date and time of the current object. - The Coordinated Universal Time (UTC) date and time of the current object. - - - Gets a object whose date and time are set to the current Coordinated Universal Time (UTC) date and time and whose offset is . - An object whose date and time is the current Coordinated Universal Time (UTC) and whose offset is . - - - Gets the number of ticks that represents the date and time of the current object in Coordinated Universal Time (UTC). - The number of ticks in the object's Coordinated Universal Time (UTC). - - - Gets the year component of the date represented by the current object. - The year component of the current object, expressed as an integer value between 0 and 9999. - - - Compares the value of the current object with another object of the same type. - The object to compare with the current object. -

A 32-bit signed integer that indicates whether the current object is less than, equal to, or greater than obj. The return values of the method are interpreted as follows:

-
Return Value

-

Description

-

Less than zero

-

The current object is less than (earlier than) obj.

-

Zero

-

The current object is equal to (the same point in time as) obj.

-

Greater than zero

-

The current object is greater than (later than) obj.

-

-
-
- - Runs when the deserialization of an object has been completed. - The object that initiated the callback. The functionality for this parameter is not currently implemented. - - - Populates a object with the data required to serialize the current object. - The object to populate with data. - The destination for this serialization (see ). - The info parameter is null. - - - Specifies the day of the week. - - - Indicates Friday. - - - - Indicates Monday. - - - - Indicates Saturday. - - - - Indicates Sunday. - - - - Indicates Thursday. - - - - Indicates Tuesday. - - - - Indicates Wednesday. - - - - Represents a nonexistent value. This class cannot be inherited. - - - Implements the interface and returns the data needed to serialize the object. - A object containing information required to serialize the object. - A object containing the source and destination of the serialized stream associated with the object. - info is null. - - - Gets the value for . - The value for , which is . - - - Returns an empty string (). - An empty string (). - - - Returns an empty string using the specified . - The to be used to format the return value. -or- null to obtain the format information from the current locale setting of the operating system. - An empty string (). - - - Represents the sole instance of the class. - - - - This conversion is not supported. Attempting to make this conversion throws an . - An object that implements the interface. (This parameter is not used; specify null.) - None. The return value for this member is not used. - This conversion is not supported for the type. - - - This conversion is not supported. Attempting to make this conversion throws an . - An object that implements the interface. (This parameter is not used; specify null.) - None. The return value for this member is not used. - This conversion is not supported for the type. - - - This conversion is not supported. Attempting to make this conversion throws an . - An object that implements the interface. (This parameter is not used; specify null.) - None. The return value for this member is not used. - This conversion is not supported for the type. - - - This conversion is not supported. Attempting to make this conversion throws an . - An object that implements the interface. (This parameter is not used; specify null.) - None. The return value for this member is not used. - This conversion is not supported for the type. - - - This conversion is not supported. Attempting to make this conversion throws an . - An object that implements the interface. (This parameter is not used; specify null.) - None. The return value for this member is not used. - This conversion is not supported for the type. - - - This conversion is not supported. Attempting to make this conversion throws an . - An object that implements the interface. (This parameter is not used; specify null.) - None. The return value for this member is not used. - This conversion is not supported for the type. - - - This conversion is not supported. Attempting to make this conversion throws an . - An object that implements the interface. (This parameter is not used; specify null.) - None. The return value for this member is not used. - This conversion is not supported for the type. - - - This conversion is not supported. Attempting to make this conversion throws an . - An object that implements the interface. (This parameter is not used; specify null.) - None. The return value for this member is not used. - This conversion is not supported for the type. - - - This conversion is not supported. Attempting to make this conversion throws an . - An object that implements the interface. (This parameter is not used; specify null.) - None. The return value for this member is not used. - This conversion is not supported for the type. - - - This conversion is not supported. Attempting to make this conversion throws an . - An object that implements the interface. (This parameter is not used; specify null.) - None. The return value for this member is not used. - This conversion is not supported for the type. - - - This conversion is not supported. Attempting to make this conversion throws an . - An object that implements the interface. (This parameter is not used; specify null.) - None. The return value for this member is not used. - This conversion is not supported for the type. - - - Converts the current object to the specified type. - The type to convert the current object to. - An object that implements the interface and is used to augment the conversion. If null is specified, format information is obtained from the current culture. - The boxed equivalent of the current object, if that conversion is supported; otherwise, an exception is thrown and no value is returned. - This conversion is not supported for the type. - type is null. - - - This conversion is not supported. Attempting to make this conversion throws an . - An object that implements the interface. (This parameter is not used; specify null.) - None. The return value for this member is not used. - This conversion is not supported for the type. - - - This conversion is not supported. Attempting to make this conversion throws an . - An object that implements the interface. (This parameter is not used; specify null.) - None. The return value for this member is not used. - This conversion is not supported for the type. - - - This conversion is not supported. Attempting to make this conversion throws an . - An object that implements the interface. (This parameter is not used; specify null.) - None. The return value for this member is not used. - This conversion is not supported for the type. - - - Represents a decimal number. - - - Initializes a new instance of to the value of the specified double-precision floating-point number. - The value to represent as a . - value is greater than or less than . -or- value is , , or . - - - Initializes a new instance of to the value of the specified 32-bit signed integer. - The value to represent as a . - - - Initializes a new instance of to a decimal value represented in binary and contained in a specified array. - An array of 32-bit signed integers containing a representation of a decimal value. - bits is null. - The length of the bits is not 4. -or- The representation of the decimal value in bits is not valid. - - - Initializes a new instance of to the value of the specified 64-bit signed integer. - The value to represent as a . - - - Initializes a new instance of to the value of the specified single-precision floating-point number. - The value to represent as a . - value is greater than or less than . -or- value is , , or . - - - Initializes a new instance of to the value of the specified 32-bit unsigned integer. - The value to represent as a . - - - Initializes a new instance of to the value of the specified 64-bit unsigned integer. - The value to represent as a . - - - Initializes a new instance of from parameters specifying the instance's constituent parts. - The low 32 bits of a 96-bit integer. - The middle 32 bits of a 96-bit integer. - The high 32 bits of a 96-bit integer. - true to indicate a negative number; false to indicate a positive number. - A power of 10 ranging from 0 to 28. - scale is greater than 28. - - - Adds two specified values. - The first value to add. - The second value to add. - The sum of d1 and d2. - The sum of d1 and d2 is less than or greater than . - - - Returns the smallest integral value that is greater than or equal to the specified decimal number. - A decimal number. - The smallest integral value that is greater than or equal to the d parameter. Note that this method returns a instead of an integral type. - - - Compares two specified values. - The first value to compare. - The second value to compare. -

A signed number indicating the relative values of d1 and d2.

-
Return value

-

Meaning

-

Less than zero

-

d1 is less than d2.

-

Zero

-

d1 and d2 are equal.

-

Greater than zero

-

d1 is greater than d2.

-

-
-
- - Compares this instance to a specified object and returns a comparison of their relative values. - The object to compare with this instance, or null. -

A signed number indicating the relative values of this instance and value.

-
Return value

-

Meaning

-

Less than zero

-

This instance is less than value.

-

Zero

-

This instance is equal to value.

-

Greater than zero

-

This instance is greater than value.

-

-or-

-

value is null.

-

-
- value is not a . -
- - Compares this instance to a specified object and returns a comparison of their relative values. - The object to compare with this instance. -

A signed number indicating the relative values of this instance and value.

-
Return value

-

Meaning

-

Less than zero

-

This instance is less than value.

-

Zero

-

This instance is equal to value.

-

Greater than zero

-

This instance is greater than value.

-

-
-
- - Divides two specified values. - The dividend. - The divisor. - The result of dividing d1 by d2. - d2 is zero. - The return value (that is, the quotient) is less than or greater than . - - - Returns a value indicating whether this instance and a specified object represent the same value. - An object to compare to this instance. - true if value is equal to this instance; otherwise, false. - - - Returns a value indicating whether this instance and a specified represent the same type and value. - The object to compare with this instance. - true if value is a and equal to this instance; otherwise, false. - - - Returns a value indicating whether two specified instances of represent the same value. - The first value to compare. - The second value to compare. - true if d1 and d2 are equal; otherwise, false. - - - Rounds a specified number to the closest integer toward negative infinity. - The value to round. - If d has a fractional part, the next whole number toward negative infinity that is less than d. -or- If d doesn't have a fractional part, d is returned unchanged. Note that the method returns an integral value of type . - - - Converts the specified 64-bit signed integer, which contains an OLE Automation Currency value, to the equivalent value. - An OLE Automation Currency value. - A that contains the equivalent of cy. - - - Converts the value of a specified instance of to its equivalent binary representation. - The value to convert. - A 32-bit signed integer array with four elements that contain the binary representation of d. - - - Returns the hash code for this instance. - A 32-bit signed integer hash code. - - - Returns the for value type . - The enumerated constant . - - - Represents the largest possible value of . This field is constant and read-only. - - - - Represents the number negative one (-1). - - - - Represents the smallest possible value of . This field is constant and read-only. - - - - Multiplies two specified values. - The multiplicand. - The multiplier. - The result of multiplying d1 and d2. - The return value is less than or greater than . - - - Returns the result of multiplying the specified value by negative one. - The value to negate. - A decimal number with the value of d, but the opposite sign. -or- Zero, if d is zero. - - - Represents the number one (1). - - - - Adds two specified values. - The first value to add. - The second value to add. - The result of adding d1 and d2. - The return value is less than or greater than . - - - Decrements the operand by one. - The value to decrement. - The value of d decremented by 1. - The return value is less than or greater than . - - - Divides two specified values. - The dividend. - The divisor. - The result of dividing d1 by d2. - d2 is zero. - The return value is less than or greater than . - - - Returns a value that indicates whether two values are equal. - The first value to compare. - The second value to compare. - true if d1 and d2 are equal; otherwise, false. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Returns a value indicating whether a specified is greater than another specified . - The first value to compare. - The second value to compare. - true if d1 is greater than d2; otherwise, false. - - - Returns a value indicating whether a specified is greater than or equal to another specified . - The first value to compare. - The second value to compare. - true if d1 is greater than or equal to d2; otherwise, false. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Increments the operand by 1. - The value to increment. - The value of d incremented by 1. - The return value is less than or greater than . - - - Returns a value that indicates whether two objects have different values. - The first value to compare. - The second value to compare. - true if d1 and d2 are not equal; otherwise, false. - - - Returns a value indicating whether a specified is less than another specified . - The first value to compare. - The second value to compare. - true if d1 is less than d2; otherwise, false. - - - Returns a value indicating whether a specified is less than or equal to another specified . - The first value to compare. - The second value to compare. - true if d1 is less than or equal to d2; otherwise, false. - - - Returns the remainder resulting from dividing two specified values. - The dividend. - The divisor. - The remainder resulting from dividing d1 by d2. - d2 is zero. - The return value is less than or greater than . - - - Multiplies two specified values. - The first value to multiply. - The second value to multiply. - The result of multiplying d1 by d2. - The return value is less than or greater than . - - - Subtracts two specified values. - The minuend. - The subtrahend. - The result of subtracting d2 from d1. - The return value is less than or greater than . - - - Negates the value of the specified operand. - The value to negate. - The result of d multiplied by negative one (-1). - - - Returns the value of the operand (the sign of the operand is unchanged). - The operand to return. - The value of the operand, d. - - - Converts the string representation of a number to its equivalent. - The string representation of the number to convert. - The equivalent to the number contained in s. - s is null. - s is not in the correct format. - s represents a number less than or greater than . - - - Converts the string representation of a number in a specified style to its equivalent. - The string representation of the number to convert. - A bitwise combination of values that indicates the style elements that can be present in s. A typical value to specify is . - The number equivalent to the number contained in s as specified by style. - s is null. - style is not a value. -or- style is the value. - s is not in the correct format. - s represents a number less than or greater than - - - Converts the string representation of a number to its equivalent using the specified culture-specific format information. - The string representation of the number to convert. - An that supplies culture-specific parsing information about s. - The number equivalent to the number contained in s as specified by provider. - s is null. - s is not of the correct format - s represents a number less than or greater than - - - Converts the string representation of a number to its equivalent using the specified style and culture-specific format. - The string representation of the number to convert. - A bitwise combination of values that indicates the style elements that can be present in s. A typical value to specify is . - An object that supplies culture-specific information about the format of s. - The number equivalent to the number contained in s as specified by style and provider. - s is not in the correct format. - s represents a number less than or greater than . - s is null. - style is not a value. -or- style is the value. - - - Computes the remainder after dividing two values. - The dividend. - The divisor. - The remainder after dividing d1 by d2. - d2 is zero. - The return value is less than or greater than . - - - Rounds a decimal value to a specified precision. A parameter specifies how to round the value if it is midway between two other numbers. - A decimal number to round. - The number of significant decimal places (precision) in the return value. - A value that specifies how to round d if it is midway between two other numbers. - The number that is nearest to the d parameter with a precision equal to the decimals parameter. If d is halfway between two numbers, one of which is even and the other odd, the mode parameter determines which of the two numbers is returned. If the precision of d is less than decimals, d is returned unchanged. - decimals is less than 0 or greater than 28. - mode is not a value. - The result is outside the range of a object. - - - Rounds a decimal value to the nearest integer. A parameter specifies how to round the value if it is midway between two other numbers. - A decimal number to round. - A value that specifies how to round d if it is midway between two other numbers. - The integer that is nearest to the d parameter. If d is halfway between two numbers, one of which is even and the other odd, the mode parameter determines which of the two numbers is returned. - mode is not a value. - The result is outside the range of a object. - - - Rounds a decimal value to the nearest integer. - A decimal number to round. - The integer that is nearest to the d parameter. If d is halfway between two integers, one of which is even and the other odd, the even number is returned. - The result is outside the range of a value. - - - Rounds a value to a specified number of decimal places. - A decimal number to round. - A value from 0 to 28 that specifies the number of decimal places to round to. - The decimal number equivalent to d rounded to decimals number of decimal places. - decimals is not a value from 0 to 28. - - - Subtracts one specified value from another. - The minuend. - The subtrahend. - The result of subtracting d2 from d1. - The return value is less than or greater than . - - - Converts the value of the specified to the equivalent 8-bit unsigned integer. - The decimal number to convert. - An 8-bit unsigned integer equivalent to value. - value is less than or greater than . - - - Converts the value of the specified to the equivalent double-precision floating-point number. - The decimal number to convert. - A double-precision floating-point number equivalent to d. - - - Converts the value of the specified to the equivalent 16-bit signed integer. - The decimal number to convert. - A 16-bit signed integer equivalent to value. - value is less than or greater than . - - - Converts the value of the specified to the equivalent 32-bit signed integer. - The decimal number to convert. - A 32-bit signed integer equivalent to the value of d. - d is less than or greater than . - - - Converts the value of the specified to the equivalent 64-bit signed integer. - The decimal number to convert. - A 64-bit signed integer equivalent to the value of d. - d is less than or greater than . - - - Converts the specified value to the equivalent OLE Automation Currency value, which is contained in a 64-bit signed integer. - The decimal number to convert. - A 64-bit signed integer that contains the OLE Automation equivalent of value. - - - Converts the value of the specified to the equivalent 8-bit signed integer. - The decimal number to convert. - An 8-bit signed integer equivalent to value. - value is less than or greater than . - - - Converts the value of the specified to the equivalent single-precision floating-point number. - The decimal number to convert. - A single-precision floating-point number equivalent to the value of d. - - - Converts the numeric value of this instance to its equivalent string representation using the specified format and culture-specific format information. - A numeric format string. - An object that supplies culture-specific formatting information. - The string representation of the value of this instance as specified by format and provider. - format is invalid. - - - Converts the numeric value of this instance to its equivalent string representation using the specified culture-specific format information. - An object that supplies culture-specific formatting information. - The string representation of the value of this instance as specified by provider. - - - Converts the numeric value of this instance to its equivalent string representation. - A string that represents the value of this instance. - - - Converts the numeric value of this instance to its equivalent string representation, using the specified format. - A standard or custom numeric format string. - The string representation of the value of this instance as specified by format. - format is invalid. - - - Converts the value of the specified to the equivalent 16-bit unsigned integer. - The decimal number to convert. - A 16-bit unsigned integer equivalent to the value of value. - value is greater than or less than . - - - Converts the value of the specified to the equivalent 32-bit unsigned integer. - The decimal number to convert. - A 32-bit unsigned integer equivalent to the value of d. - d is negative or greater than . - - - Converts the value of the specified to the equivalent 64-bit unsigned integer. - The decimal number to convert. - A 64-bit unsigned integer equivalent to the value of d. - d is negative or greater than . - - - Returns the integral digits of the specified ; any fractional digits are discarded. - The decimal number to truncate. - The result of d rounded toward zero, to the nearest whole number. - - - Converts the string representation of a number to its equivalent using the specified style and culture-specific format. A return value indicates whether the conversion succeeded or failed. - The string representation of the number to convert. - A bitwise combination of enumeration values that indicates the permitted format of s. A typical value to specify is . - An object that supplies culture-specific parsing information about s. - - true if s was converted successfully; otherwise, false. - style is not a value. -or- style is the value. - - - Converts the string representation of a number to its equivalent. A return value indicates whether the conversion succeeded or failed. - The string representation of the number to convert. - - true if s was converted successfully; otherwise, false. - - - Represents the number zero (0). - - - - For a description of this member, see . - This parameter is ignored. - true if the value of the current instance is not zero; otherwise, false. - - - For a description of this member, see . - This parameter is ignored. - The value of the current instance, converted to a . - The resulting integer value is less than or greater than . - - - This conversion is not supported. Attempting to use this method throws an . - This parameter is ignored. - None. This conversion is not supported. - In all cases. - - - This conversion is not supported. Attempting to use this method throws an . - This parameter is ignored. - None. This conversion is not supported. - In all cases. - - - For a description of this member, see . - This parameter is ignored. - The value of the current instance, unchanged. - - - For a description of this member, see . - This parameter is ignored. - The value of the current instance, converted to a . - - - For a description of this member, see . - This parameter is ignored. - The value of the current instance, converted to a . - The resulting integer value is less than or greater than . - - - For a description of this member, see . - The parameter is ignored. - The value of the current instance, converted to a . - The resulting integer value is less than or greater than . - - - For a description of this member, see . - This parameter is ignored. - The value of the current instance, converted to a . - The resulting integer value is less than or greater than . - - - For a description of this member, see . - This parameter is ignored. - The value of the current instance, converted to a . - The resulting integer value is less than or greater than . - - - For a description of this member, see . - This parameter is ignored. - The value of the current instance, converted to a . - - - For a description of this member, see . - The type to which to convert the value of this instance. - An implementation that supplies culture-specific information about the format of the returned value. - The value of the current instance, converted to a type. - type is null. - The requested type conversion is not supported. - - - For a description of this member, see . - This parameter is ignored. - The value of the current instance, converted to a . - The resulting integer value is less than or greater than . - - - For a description of this member, see . - This parameter is ignored. - The value of the current instance, converted to a . - The resulting integer value is less than or greater than . - - - For a description of this member, see . - This parameter is ignored. - The value of the current instance, converted to a . - The resulting integer value is less than or greater than . - - - Runs when the deserialization of an object has been completed. - The object that initiated the callback. The functionality for this parameter is not currently implemented. - The object contains invalid or corrupted data. - - - Represents a delegate, which is a data structure that refers to a static method or to a class instance and an instance method of that class. - - - Initializes a delegate that invokes the specified instance method on the specified class instance. - The class instance on which the delegate invokes method. - The name of the instance method that the delegate represents. - target is null. -or- method is null. - There was an error binding to the target method. - - - Initializes a delegate that invokes the specified static method from the specified class. - The representing the class that defines method. - The name of the static method that the delegate represents. - target is null. -or- method is null. - target is not a RuntimeType. See Runtime Types in Reflection. -or- target represents an open generic type. - - - Creates a shallow copy of the delegate. - A shallow copy of the delegate. - - - Concatenates the invocation lists of an array of delegates. - The array of delegates to combine. - A new delegate with an invocation list that concatenates the invocation lists of the delegates in the delegates array. Returns null if delegates is null, if delegates contains zero elements, or if every entry in delegates is null. - Not all the non-null entries in delegates are instances of the same delegate type. - - - Concatenates the invocation lists of two delegates. - The delegate whose invocation list comes first. - The delegate whose invocation list comes last. - A new delegate with an invocation list that concatenates the invocation lists of a and b in that order. Returns a if b is null, returns b if a is a null reference, and returns a null reference if both a and b are null references. - Both a and b are not null, and a and b are not instances of the same delegate type. - - - Concatenates the invocation lists of the specified multicast (combinable) delegate and the current multicast (combinable) delegate. - The multicast (combinable) delegate whose invocation list to append to the end of the invocation list of the current multicast (combinable) delegate. - A new multicast (combinable) delegate with an invocation list that concatenates the invocation list of the current multicast (combinable) delegate and the invocation list of d, or the current multicast (combinable) delegate if d is null. - Always thrown. - - - Creates a delegate of the specified type that represents the specified static method of the specified class, with the specified case-sensitivity and the specified behavior on failure to bind. - The of delegate to create. - The representing the class that implements method. - The name of the static method that the delegate is to represent. - A Boolean indicating whether to ignore the case when comparing the name of the method. - true to throw an exception if method cannot be bound; otherwise, false. - A delegate of the specified type that represents the specified static method of the specified class. - type is null. -or- target is null. -or- method is null. - type does not inherit . -or- type is not a RuntimeType. See Runtime Types in Reflection. -or- target is not a RuntimeType. -or- target is an open generic type. That is, its property is true. -or- method is not a static method (Shared method in Visual Basic). -or- method cannot be bound, for example because it cannot be found, and throwOnBindFailure is true. - The Invoke method of type is not found. - The caller does not have the permissions necessary to access method. - - - Creates a delegate of the specified type that represents the specified static method of the specified class, with the specified case-sensitivity. - The of delegate to create. - The representing the class that implements method. - The name of the static method that the delegate is to represent. - A Boolean indicating whether to ignore the case when comparing the name of the method. - A delegate of the specified type that represents the specified static method of the specified class. - type is null. -or- target is null. -or- method is null. - type does not inherit . -or- type is not a RuntimeType. See Runtime Types in Reflection. -or- target is not a RuntimeType. -or- target is an open generic type. That is, its property is true. -or- method is not a static method (Shared method in Visual Basic). -or- method cannot be bound, for example because it cannot be found. - The Invoke method of type is not found. - The caller does not have the permissions necessary to access method. - - - Creates a delegate of the specified type that represents the specified instance method to invoke on the specified class instance with the specified case-sensitivity. - The of delegate to create. - The class instance on which method is invoked. - The name of the instance method that the delegate is to represent. - A Boolean indicating whether to ignore the case when comparing the name of the method. - A delegate of the specified type that represents the specified instance method to invoke on the specified class instance. - type is null. -or- target is null. -or- method is null. - type does not inherit . -or- type is not a RuntimeType. See Runtime Types in Reflection. -or- method is not an instance method. -or- method cannot be bound, for example because it cannot be found. - The Invoke method of type is not found. - The caller does not have the permissions necessary to access method. - - - Creates a delegate of the specified type that represents the specified static or instance method, with the specified first argument and the specified behavior on failure to bind. - A representing the type of delegate to create. - An that is the first argument of the method the delegate represents. For instance methods, it must be compatible with the instance type. - The describing the static or instance method the delegate is to represent. - true to throw an exception if method cannot be bound; otherwise, false. - A delegate of the specified type that represents the specified static or instance method, or null if throwOnBindFailure is false and the delegate cannot be bound to method. - type is null. -or- method is null. - type does not inherit . -or- type is not a RuntimeType. See Runtime Types in Reflection. -or- method cannot be bound, and throwOnBindFailure is true. -or- method is not a RuntimeMethodInfo. See Runtime Types in Reflection. - The Invoke method of type is not found. - The caller does not have the permissions necessary to access method. - - - Creates a delegate of the specified type that represents the specified instance method to invoke on the specified class instance, with the specified case-sensitivity and the specified behavior on failure to bind. - The of delegate to create. - The class instance on which method is invoked. - The name of the instance method that the delegate is to represent. - A Boolean indicating whether to ignore the case when comparing the name of the method. - true to throw an exception if method cannot be bound; otherwise, false. - A delegate of the specified type that represents the specified instance method to invoke on the specified class instance. - type is null. -or- target is null. -or- method is null. - type does not inherit . -or- type is not a RuntimeType. See Runtime Types in Reflection. -or- method is not an instance method. -or- method cannot be bound, for example because it cannot be found, and throwOnBindFailure is true. - The Invoke method of type is not found. - The caller does not have the permissions necessary to access method. - - - Creates a delegate of the specified type to represent the specified static method, with the specified behavior on failure to bind. - The of delegate to create. - The describing the static or instance method the delegate is to represent. - true to throw an exception if method cannot be bound; otherwise, false. - A delegate of the specified type to represent the specified static method. - type is null. -or- method is null. - type does not inherit . -or- type is not a RuntimeType. See Runtime Types in Reflection. -or- method cannot be bound, and throwOnBindFailure is true. -or- method is not a RuntimeMethodInfo. See Runtime Types in Reflection. - The Invoke method of type is not found. - The caller does not have the permissions necessary to access method. - - - Creates a delegate of the specified type that represents the specified instance method to invoke on the specified class instance. - The of delegate to create. - The class instance on which method is invoked. - The name of the instance method that the delegate is to represent. - A delegate of the specified type that represents the specified instance method to invoke on the specified class instance. - type is null. -or- target is null. -or- method is null. - type does not inherit . -or- type is not a RuntimeType. See Runtime Types in Reflection. -or- method is not an instance method. -or- method cannot be bound, for example because it cannot be found. - The Invoke method of type is not found. - The caller does not have the permissions necessary to access method. - - - Creates a delegate of the specified type that represents the specified static or instance method, with the specified first argument. - The of delegate to create. - The object to which the delegate is bound, or null to treat method as static (Shared in Visual Basic). - The describing the static or instance method the delegate is to represent. - A delegate of the specified type that represents the specified static or instance method. - type is null. -or- method is null. - type does not inherit . -or- type is not a RuntimeType. See Runtime Types in Reflection. -or- method cannot be bound. -or- method is not a RuntimeMethodInfo. See Runtime Types in Reflection. - The Invoke method of type is not found. - The caller does not have the permissions necessary to access method. - - - Creates a delegate of the specified type that represents the specified static method of the specified class. - The of delegate to create. - The representing the class that implements method. - The name of the static method that the delegate is to represent. - A delegate of the specified type that represents the specified static method of the specified class. - type is null. -or- target is null. -or- method is null. - type does not inherit . -or- type is not a RuntimeType. See Runtime Types in Reflection. -or- target is not a RuntimeType. -or- target is an open generic type. That is, its property is true. -or- method is not a static method (Shared method in Visual Basic). -or- method cannot be bound, for example because it cannot be found, and throwOnBindFailure is true. - The Invoke method of type is not found. - The caller does not have the permissions necessary to access method. - - - Creates a delegate of the specified type to represent the specified static method. - The of delegate to create. - The describing the static or instance method the delegate is to represent. Only static methods are supported in the .NET Framework version 1.0 and 1.1. - A delegate of the specified type to represent the specified static method. - type is null. -or- method is null. - type does not inherit . -or- type is not a RuntimeType. See Runtime Types in Reflection. -or- method is not a static method, and the .NET Framework version is 1.0 or 1.1. -or- method cannot be bound. -or- method is not a RuntimeMethodInfo. See Runtime Types in Reflection. - The Invoke method of type is not found. - The caller does not have the permissions necessary to access method. - - - Dynamically invokes (late-bound) the method represented by the current delegate. - An array of objects that are the arguments to pass to the method represented by the current delegate. -or- null, if the method represented by the current delegate does not require arguments. - The object returned by the method represented by the delegate. - The caller does not have access to the method represented by the delegate (for example, if the method is private). -or- The number, order, or type of parameters listed in args is invalid. - The method represented by the delegate is invoked on an object or a class that does not support it. - The method represented by the delegate is an instance method and the target object is null. -or- One of the encapsulated methods throws an exception. - - - Dynamically invokes (late-bound) the method represented by the current delegate. - An array of objects that are the arguments to pass to the method represented by the current delegate. -or- null, if the method represented by the current delegate does not require arguments. - The object returned by the method represented by the delegate. - The caller does not have access to the method represented by the delegate (for example, if the method is private). -or- The number, order, or type of parameters listed in args is invalid. - The method represented by the delegate is invoked on an object or a class that does not support it. - The method represented by the delegate is an instance method and the target object is null. -or- One of the encapsulated methods throws an exception. - - - Determines whether the specified object and the current delegate are of the same type and share the same targets, methods, and invocation list. - The object to compare with the current delegate. - true if obj and the current delegate have the same targets, methods, and invocation list; otherwise, false. - The caller does not have access to the method represented by the delegate (for example, if the method is private). - - - Returns a hash code for the delegate. - A hash code for the delegate. - - - Returns the invocation list of the delegate. - An array of delegates representing the invocation list of the current delegate. - - - Gets the static method represented by the current delegate. - A describing the static method represented by the current delegate. - The caller does not have access to the method represented by the delegate (for example, if the method is private). - - - Not supported. - Not supported. - Not supported. - This method is not supported. - - - Gets the method represented by the delegate. - A describing the method represented by the delegate. - The caller does not have access to the method represented by the delegate (for example, if the method is private). - - - Determines whether the specified delegates are equal. - The first delegate to compare. - The second delegate to compare. - true if d1 is equal to d2; otherwise, false. - - - Determines whether the specified delegates are not equal. - The first delegate to compare. - The second delegate to compare. - true if d1 is not equal to d2; otherwise, false. - - - Removes the last occurrence of the invocation list of a delegate from the invocation list of another delegate. - The delegate from which to remove the invocation list of value. - The delegate that supplies the invocation list to remove from the invocation list of source. - A new delegate with an invocation list formed by taking the invocation list of source and removing the last occurrence of the invocation list of value, if the invocation list of value is found within the invocation list of source. Returns source if value is null or if the invocation list of value is not found within the invocation list of source. Returns a null reference if the invocation list of value is equal to the invocation list of source or if source is a null reference. - The caller does not have access to the method represented by the delegate (for example, if the method is private). - The delegate types do not match. - - - Removes all occurrences of the invocation list of a delegate from the invocation list of another delegate. - The delegate from which to remove the invocation list of value. - The delegate that supplies the invocation list to remove from the invocation list of source. - A new delegate with an invocation list formed by taking the invocation list of source and removing all occurrences of the invocation list of value, if the invocation list of value is found within the invocation list of source. Returns source if value is null or if the invocation list of value is not found within the invocation list of source. Returns a null reference if the invocation list of value is equal to the invocation list of source, if source contains only a series of invocation lists that are equal to the invocation list of value, or if source is a null reference. - The caller does not have access to the method represented by the delegate (for example, if the method is private). - The delegate types do not match. - - - Removes the invocation list of a delegate from the invocation list of another delegate. - The delegate that supplies the invocation list to remove from the invocation list of the current delegate. - A new delegate with an invocation list formed by taking the invocation list of the current delegate and removing the invocation list of value, if the invocation list of value is found within the current delegate's invocation list. Returns the current delegate if value is null or if the invocation list of value is not found within the current delegate's invocation list. Returns null if the invocation list of value is equal to the current delegate's invocation list. - The caller does not have access to the method represented by the delegate (for example, if the method is private). - - - Gets the class instance on which the current delegate invokes the instance method. - The object on which the current delegate invokes the instance method, if the delegate represents an instance method; null if the delegate represents a static method. - - - Represents the result of a sorting operation. - The type of the content of the data source. - - - Represents the result of a sorting operation. - - - Provides functionality to evaluate queries against a specific data source wherein the type of the data is known. - The type of the data in the data source. - - - Provides functionality to evaluate queries against a specific data source wherein the type of the data is not specified. - - - Gets the type of the element(s) that are returned when the expression tree associated with this instance of is executed. - A that represents the type of the element(s) that are returned when the expression tree associated with this object is executed. - - - Gets the expression tree that is associated with the instance of . - The that is associated with this instance of . - - - Gets the query provider that is associated with this data source. - The that is associated with this data source. - - - Defines methods to create and execute queries that are described by an object. - - - Constructs an object that can evaluate the query represented by a specified expression tree. - An expression tree that represents a LINQ query. - An that can evaluate the query represented by the specified expression tree. - - - Constructs an object that can evaluate the query represented by a specified expression tree. - An expression tree that represents a LINQ query. - The type of the elements of the that is returned. - An that can evaluate the query represented by the specified expression tree. - - - Executes the query represented by a specified expression tree. - An expression tree that represents a LINQ query. - The value that results from executing the specified query. - - - Executes the strongly-typed query represented by a specified expression tree. - An expression tree that represents a LINQ query. - The type of the value that results from executing the query. - The value that results from executing the specified query. - - - Represents a collection of keys each mapped to one or more values. - The type of the keys in the . - The type of the elements of each value in the . - - - Applies a transform function to each key and its associated values and returns the results. - A function to project a result value from each key and its associated values. - The type of the result values produced by resultSelector. - A collection that contains one value for each key/value collection pair in the . - - - Determines whether a specified key is in the . - The key to find in the . - true if key is in the ; otherwise, false. - - - Gets the number of key/value collection pairs in the . - The number of key/value collection pairs in the . - - - Returns a generic enumerator that iterates through the . - An enumerator for the . - - - Gets the collection of values indexed by the specified key. - The key of the desired collection of values. - The collection of values indexed by the specified key. - - - Returns an enumerator that iterates through the . This class cannot be inherited. - An enumerator for the . - - - Represents a sorted, parallel sequence. - The type of elements in the source collection. - - - Returns an enumerator that iterates through the sequence. - An enumerator that iterates through the sequence. - - - Provides a set of methods for querying objects that implement ParallelQuery{TSource}. This is the parallel equivalent of . - - - Applies in parallel an accumulator function over a sequence. The specified seed value is used as the initial accumulator value, and the specified function is used to select the result value. - A sequence to aggregate over. - The initial accumulator value. - An accumulator function to be invoked on each element. - A function to transform the final accumulator value into the result value. - The type of the elements of source. - The type of the accumulator value. - The type of the resulting value. - The transformed final accumulator value. - The query was canceled with the token passed in through WithCancellation. - source or func or resultSelector is a null reference (Nothing in Visual Basic). - One or more exceptions occurred during the evaluation of the query. - source contains no elements. - - - Applies in parallel an accumulator function over a sequence. This overload is not available in the sequential implementation. - A sequence to aggregate over. - A function that returns the initial accumulator value. - An accumulator function to be invoked on each element in a partition. - An accumulator function to be invoked on the yielded accumulator result from each partition. - A function to transform the final accumulator value into the result value. - The type of the elements of source. - The type of the accumulator value. - The type of the resulting value. - The transformed final accumulator value. - The query was canceled with the token passed in through WithCancellation. - source or seedFactory or updateAccumulatorFunc or combineAccumulatorsFunc or resultSelector is a null reference (Nothing in Visual Basic). - One or more exceptions occurred during the evaluation of the query. - source contains no elements. - - - Applies in parallel an accumulator function over a sequence. This overload is not available in the sequential implementation. - A sequence to aggregate over. - The initial accumulator value. - An accumulator function to be invoked on each element in a partition. - An accumulator function to be invoked on the yielded accumulator result from each partition. - A function to transform the final accumulator value into the result value. - The type of the elements of source. - The type of the accumulator value. - The type of the resulting value. - The transformed final accumulator value. - The query was canceled with the token passed in through WithCancellation. - source or updateAccumulatorFunc or combineAccumulatorsFunc or resultSelector is a null reference (Nothing in Visual Basic). - One or more exceptions occurred during the evaluation of the query. - source contains no elements. - - - Applies in parallel an accumulator function over a sequence. The specified seed value is used as the initial accumulator value. - A sequence to aggregate over. - The initial accumulator value. - An accumulator function to be invoked on each element. - The type of the elements of source. - The type of the accumulator value. - The final accumulator value. - The query was canceled with the token passed in through WithCancellation. - source or func is a null reference (Nothing in Visual Basic). - One or more exceptions occurred during the evaluation of the query. - source contains no elements. - - - Applies in parallel an accumulator function over a sequence. - A sequence to aggregate over. - An accumulator function to be invoked on each element. - The type of the elements of source. - The final accumulator value. - The query was canceled with the token passed in through WithCancellation. - source or func is a null reference (Nothing in Visual Basic). - One or more exceptions occurred during the evaluation of the query. - source contains no elements. - - - Determines in parallel whether all elements of a sequence satisfy a condition. - A sequence whose elements to apply the predicate to. - A function to test each element for a condition. - The type of elements of source. - true if every element of the source sequence passes the test in the specified predicate, or if the sequence is empty; otherwise, false.. - The query was canceled with the token passed in through WithCancellation. - source or predicate is a null reference (Nothing in Visual Basic). - One or more exceptions occurred during the evaluation of the query. - - - Determines whether a parallel sequence contains any elements. - The sequence to check for emptiness. - The type of elements of source. - true if the source sequence contains any elements; otherwise, false. - The query was canceled with the token passed in through WithCancellation. - source is a null reference (Nothing in Visual Basic). - One or more exceptions occurred during the evaluation of the query. - - - Determines in parallel whether any element of a sequence satisfies a condition. - A sequence to whose elements the predicate will be applied. - A function to test each element for a condition. - The type of elements of source. - true if any elements in the source sequence pass the test in the specified predicate; otherwise, false. - The query was canceled with the token passed in through WithCancellation. - source or predicate is a null reference (Nothing in Visual Basic). - One or more exceptions occurred during the evaluation of the query. - - - Converts a into an to force sequential evaluation of the query. - The sequence to cast as . - The type of the elements of source. - The input sequence typed as . - source is a null reference (Nothing in Visual Basic). - - - Enables treatment of a data source as if it were ordered, overriding the default of unordered. AsOrdered may only be invoked on non-generic sequences returned by AsParallel, ParallelEnumerable.Range, and ParallelEnumerable.Repeat. - The input sequence. - The source sequence which will maintain the original ordering in the subsequent query operators. - source is a null reference (Nothing in Visual Basic). - thrown if source contains no elements -or- if AsOrdered is called midway through a query. It is allowed to be called immediately after , or . - - - Enables treatment of a data source as if it were ordered, overriding the default of unordered. AsOrdered may only be invoked on generic sequences returned by AsParallel, ParallelEnumerable.Range, and ParallelEnumerable.Repeat. - The input sequence. - The type of elements of source. - The source sequence which will maintain the original ordering in the subsequent query operators. - source is a null reference (Nothing in Visual Basic). - Thrown if source contains no elements -or- if source is not one of AsParallel, ParallelEnumerable.Range, or ParallelEnumerable.Repeat. - - - Enables parallelization of a query. - An to convert to a . - The source as a ParallelQuery to bind to ParallelEnumerable extension methods. - source is a null reference (Nothing in Visual Basic). - - - Enables parallelization of a query, as sourced by a custom partitioner that is responsible for splitting the input sequence into partitions. - A partitioner over the input sequence. - The type of elements of source. - The source as a ParallelQuery to bind to ParallelEnumerable extension methods. - source is a null reference (Nothing in Visual Basic). - - - Enables parallelization of a query. - An to convert to a . - The type of elements of source. - The source as a to bind to ParallelEnumerable extension methods. - source is a null reference (Nothing in Visual Basic). - - - Converts a into an to force sequential evaluation of the query. - A to convert to an . - The type of elements of source. - The source as an to bind to sequential extension methods. - source is a null reference (Nothing in Visual Basic). - - - Allows an intermediate query to be treated as if no ordering is implied among the elements. - The input sequence. - The type of elements of source. - The source sequence with arbitrary order. - source is a null reference (Nothing in Visual Basic). - - - Computes in parallel the average of a sequence of values. - A sequence of values that are used to calculate an average. - The average of the sequence of values. - The query was canceled with the token passed in through WithCancellation. - source is a null reference (Nothing in Visual Basic). - One or more exceptions occurred during the evaluation of the query. - source contains no elements. - - - Computes in parallel the average of a sequence of values. - A sequence of values that are used to calculate an average. - The average of the sequence of values. - The query was canceled with the token passed in through WithCancellation. - source is a null reference (Nothing in Visual Basic). - The sum or count of the elements in the sequence is larger than . -or- One or more exceptions occurred during the evaluation of the query. - source contains no elements. - - - Computes in parallel the average of a sequence of values. - A sequence of values that are used to calculate an average. - The average of the sequence of values. - The query was canceled with the token passed in through WithCancellation. - source is a null reference (Nothing in Visual Basic). - The sum or count of the elements in the sequence is larger than . -or- One or more exceptions occurred during the evaluation of the query. - source contains no elements. - - - Computes in parallel the average of a sequence of values. - The source sequence. - Returns the average of the sequence of values. - The query was canceled with the token passed in through WithCancellation. - A sequence of values that are used to calculate an average.The average of the sequence of values.source is a null reference (Nothing in Visual Basic). - One or more exceptions occurred during the evaluation of the query. - source contains no elements. - - - Computes in parallel the average of a sequence of values. - A sequence of values that are used to calculate an average. - The average of the sequence of values. - The query was canceled with the token passed in through WithCancellation. - source is a null reference (Nothing in Visual Basic). - One or more exceptions occurred during the evaluation of the query. - source contains no elements. - - - Computes in parallel the average of a sequence of values. - A sequence of values that are used to calculate an average. - The average of the sequence of values. - The query was canceled with the token passed in through WithCancellation. - source is a null reference (Nothing in Visual Basic). - The sum or count of the elements in the sequence is larger than . -or- One or more exceptions occurred during the evaluation of the query. - source contains no elements. - - - Computes in parallel the average of a sequence of values. - A sequence of values that are used to calculate an average. - The average of the sequence of values. - The query was canceled with the token passed in through WithCancellation. - source is a null reference (Nothing in Visual Basic). - The sum or count of the elements in the sequence is larger than . -or- One or more exceptions occurred during the evaluation of the query. - source contains no elements. - - - Computes in parallel the average of a sequence of values. - A sequence of values that are used to calculate an average. - The average of the sequence of values. - The query was canceled with the token passed in through WithCancellation. - source is a null reference (Nothing in Visual Basic). - One or more exceptions occurred during the evaluation of the query. - source contains no elements. - - - Computes in parallel the average of a sequence of values. - A sequence of values that are used to calculate an average. - The average of the sequence of values. - The query was canceled with the token passed in through WithCancellation. - source is a null reference (Nothing in Visual Basic). - One or more exceptions occurred during the evaluation of the query. - source contains no elements. - - - Computes in parallel the average of a sequence of values. - A sequence of values that are used to calculate an average. - The average of the sequence of values. - The query was canceled with the token passed in through WithCancellation. - source is a null reference (Nothing in Visual Basic). - One or more exceptions occurred during the evaluation of the query. - source contains no elements. - - - Computes in parallel the average of a sequence of values that are obtained by invoking a transform function on each element of the input sequence. - A sequence of values that are used to calculate an average. - A transform function to apply to each element. - The type of elements of source. - The average of the sequence of values. - The query was canceled with the token passed in through WithCancellation. - source or selector is a null reference (Nothing in Visual Basic). - One or more exceptions occurred during the evaluation of the query. - source contains no elements. - (Thrown as inner exception in an ). The selector function returns a value greater than MaxValue for the element type. - - - Computes in parallel the average of a sequence of values that are obtained by invoking a transform function on each element of the input sequence. - A sequence of values that are used to calculate an average. - A transform function to apply to each element. - The type of elements of source. - The average of the sequence of values. - The query was canceled with the token passed in through WithCancellation. - source or selector is a null reference (Nothing in Visual Basic). - The sum or count of the elements in the sequence is larger than . -or- One or more exceptions occurred during the evaluation of the query. - source contains no elements. - (Thrown as inner exception in an ). The selector function returns a value greater than MaxValue for the element type. - - - Computes in parallel the average of a sequence of values that are obtained by invoking a transform function on each element of the input sequence. - A sequence of values that are used to calculate an average. - A transform function to apply to each element. - The type of elements of source. - The average of the sequence of values. - The query was canceled with the token passed in through WithCancellation. - source or selector is a null reference (Nothing in Visual Basic). - The sum or count of the elements in the sequence is larger than . -or- One or more exceptions occurred during the evaluation of the query. - source contains no elements. - (Thrown as inner exception in an ). The selector function returns a value greater than MaxValue for the element type. - - - Computes in parallel the average of a sequence of values that are obtained by invoking a transform function on each element of the input sequence. - A sequence of values that are used to calculate an average. - A transform function to apply to each element. - The type of elements of source. - The average of the sequence of values. - The query was canceled with the token passed in through WithCancellation. - source or selector is a null reference (Nothing in Visual Basic). - One or more exceptions occurred during the evaluation of the query. - source contains no elements. - (Thrown as inner exception in an ). The selector function returns a value greater than MaxValue for the element type. - - - Computes in parallel the average of a sequence of values that are obtained by invoking a transform function on each element of the input sequence. - A sequence of values that are used to calculate an average. - A transform function to apply to each element. - The type of elements of source. - The average of the sequence of values. - The query was canceled with the token passed in through WithCancellation. - source or selector is a null reference (Nothing in Visual Basic). - One or more exceptions occurred during the evaluation of the query. - source contains no elements. - (Thrown as inner exception in an ). The selector function returns a value greater than MaxValue for the element type. - - - Computes in parallel the average of a sequence of values that are obtained by invoking a transform function on each element of the input sequence. - A sequence of values that are used to calculate an average. - A transform function to apply to each element. - The type of elements of source. - The average of the sequence of values. - The query was canceled with the token passed in through WithCancellation. - source or selector is a null reference (Nothing in Visual Basic). - The sum or count of the elements in the sequence is larger than . -or- One or more exceptions occurred during the evaluation of the query. - source contains no elements. - (Thrown as inner exception in an ). The selector function returns a value greater than MaxValue for the element type. - - - Computes in parallel the average of a sequence of values that are obtained by invoking a transform function on each element of the input sequence. - A sequence of values that are used to calculate an average. - A transform function to apply to each element. - The type of elements of source. - The average of the sequence of values. - The query was canceled with the token passed in through WithCancellation. - source or selector is a null reference (Nothing in Visual Basic). - The sum or count of the elements in the sequence is larger than . -or- One or more exceptions occurred during the evaluation of the query. - source contains no elements. - (Thrown as inner exception in an ). The selector function returns a value greater than MaxValue for the element type. - - - Computes in parallel the average of a sequence of values that are obtained by invoking a transform function on each element of the input sequence. - A sequence of values that are used to calculate an average. - A transform function to apply to each element. - The type of elements of source. - The average of the sequence of values. - The query was canceled with the token passed in through WithCancellation. - source or selector is a null reference (Nothing in Visual Basic). - One or more exceptions occurred during the evaluation of the query. - source contains no elements. - (Thrown as inner exception in an ). The selector function returns a value greater than MaxValue for the element type. - - - Computes in parallel the average of a sequence of values that are obtained by invoking a transform function on each element of the input sequence. - A sequence of values that are used to calculate an average. - A transform function to apply to each element. - The type of elements of source. - The average of the sequence of values. - The query was canceled with the token passed in through WithCancellation. - source or selector is a null reference (Nothing in Visual Basic). - One or more exceptions occurred during the evaluation of the query. - source contains no elements. - (Thrown as inner exception in an ). The selector function returns a value greater than MaxValue for the element type. - - - Computes in parallel the average of a sequence of values that are obtained by invoking a transform function on each element of the input sequence. - A sequence of values that are used to calculate an average. - A transform function to apply to each element. - The type of elements of source. - The average of the sequence of values. - The query was canceled with the token passed in through WithCancellation. - source or selector is a null reference (Nothing in Visual Basic). - One or more exceptions occurred during the evaluation of the query. - source contains no elements. - (Thrown as inner exception in an ). The selector function returns a value greater than MaxValue for the element type. - - - Converts the elements of a ParallelQuery to the specified type. - The sequence that contains the elements to be converted. - The type to convert the elements of source to. - A sequence that contains each element of the source sequence converted to the specified type. - source is a null reference (Nothing in Visual Basic). - The type of the source sequence could not be converted to TResult. - - - This Concat overload should never be called. This method is marked as obsolete and always throws when called. - This parameter is not used. - This parameter is not used. - This type parameter is not used. - This overload always throws a . - The exception that occurs when this method is called. - - - Concatenates two parallel sequences. - The first sequence to concatenate. - The sequence to concatenate to the first sequence. - The type of the elements of the input sequences. - A sequence that contains the concatenated elements of the two input sequences. - first or second is a null reference (Nothing in Visual Basic). - - - Determines in parallel whether a sequence contains a specified element by using a specified . - A sequence in which to locate a value. - The value to locate in the sequence. - An equality comparer to compare values. - The type of elements of source. - true if the source sequence contains an element that has the specified value; otherwise, false. - The query was canceled with the token passed in through WithCancellation. - source is a null reference (Nothing in Visual Basic). - One or more exceptions occurred during the evaluation of the query. - - - Determines in parallel whether a sequence contains a specified element by using the default equality comparer. - A sequence in which to locate a value. - The value to locate in the sequence. - The type of elements of source. - true if the source sequence contains an element that has the specified value; otherwise, false. - The query was canceled with the token passed in through WithCancellation. - source is a null reference (Nothing in Visual Basic). - One or more exceptions occurred during the evaluation of the query. - - - Returns the number of elements in a parallel sequence. - A sequence that contains elements to be counted. - The type of the elements of source. - The number of elements in the input sequence. - The query was canceled with the token passed in through WithCancellation. - source is a null reference (Nothing in Visual Basic). - The number of elements in source is larger than . (In this case the InnerException is ) -or- One or more exceptions occurred during the evaluation of the query. - - - Returns a number that represents how many elements in the specified parallel sequence satisfy a condition. - A sequence that contains elements to be counted. - A function to test each element for a condition. - The type of the elements of source. - A number that represents how many elements in the sequence satisfy the condition in the predicate function. - The query was canceled with the token passed in through WithCancellation. - source or predicate is a null reference (Nothing in Visual Basic). - The number of elements in source is larger than . (In this case the InnerException is ) -or- One or more exceptions occurred during the evaluation of the query. - - - Returns the elements of the specified parallel sequence or the type parameter's default value in a singleton collection if the sequence is empty. - The sequence to return a default value for if it is empty. - The type of the elements of source. - A sequence that contains default(TSource) if source is empty; otherwise, source. - source is a null reference (Nothing in Visual Basic). - The query was canceled with the token passed in through WithCancellation. - One or more exceptions occurred during the evaluation of the query. - - - Returns the elements of the specified parallel sequence or the specified value in a singleton collection if the sequence is empty. - The sequence to return the specified value for if it is empty. - The value to return if the sequence is empty. - The type of the elements of source. - A sequence that contains defaultValue if source is empty; otherwise, source. - source is a null reference (Nothing in Visual Basic). - The query was canceled with the token passed in through WithCancellation. - One or more exceptions occurred during the evaluation of the query. - - - Returns distinct elements from a parallel sequence by using the default equality comparer to compare values. - The sequence to remove duplicate elements from. - The type of the elements of source. - A sequence that contains distinct elements from the source sequence. - source is a null reference (Nothing in Visual Basic). - The query was canceled with the token passed in through WithCancellation. - One or more exceptions occurred during the evaluation of the query. - - - Returns distinct elements from a parallel sequence by using a specified to compare values. - The sequence to remove duplicate elements from. - An to compare values. - The type of the elements of source. - A sequence that contains distinct elements from the source sequence. - source is a null reference (Nothing in Visual Basic). - One or more exceptions occurred during the evaluation of the query. - - - Returns the element at a specified index in a parallel sequence. - A sequence to return an element from. - The zero-based index of the element to retrieve. - The type of the elements of source. - The element at the specified position in the source sequence. - The query was canceled with the token passed in through WithCancellation. - source is a null reference (Nothing in Visual Basic). - index is less than 0 or greater than or equal to the number of elements in source. - One or more exceptions occurred during the evaluation of the query. - - - Returns the element at a specified index in a parallel sequence or a default value if the index is out of range. - A sequence to return an element from. - The zero-based index of the element to retrieve. - The type of the elements of source. - default(TSource) if the index is outside the bounds of the source sequence; otherwise, the element at the specified position in the source sequence. - The query was canceled with the token passed in through WithCancellation. - source is a null reference (Nothing in Visual Basic). - One or more exceptions occurred during the evaluation of the query. - - - Returns an empty ParallelQuery{TResult} that has the specified type argument. - The type to assign to the type parameter of the returned generic sequence. - An empty sequence whose type argument is TResult. - - - This Except overload should never be called. This method is marked as obsolete and always throws when called. - This parameter is not used. - This parameter is not used. - This type parameter is not used. - This overload always throws a . - The exception that occurs when this method is called. - - - Produces the set difference of two parallel sequences by using the default equality comparer to compare values. - A sequence whose elements that are not also in second will be returned. - A sequence whose elements that also occur in the first sequence will cause those elements to be removed from the returned sequence. - The type of the elements of the input sequences. - A sequence that contains the set difference of the elements of two sequences. - first or second is a null reference (Nothing in Visual Basic). - The query was canceled with the token passed in through WithCancellation. - One or more exceptions occurred during the evaluation of the query. - - - This Except overload should never be called. This method is marked as obsolete and always throws when called. - This parameter is not used. - This parameter is not used. - This parameter is not used. - This type parameter is not used. - This overload always throws a . - The exception that occurs when this method is called. - - - Produces the set difference of two parallel sequences by using the specified to compare values. - A sequence whose elements that are not also in second will be returned. - A sequence whose elements that also occur in the first sequence will cause those elements to be removed from the returned sequence. - to compare values. - The type of the elements of the input sequences. - A sequence that contains the set difference of the elements of two sequences. - first or second is a null reference (Nothing in Visual Basic). - The query was canceled with the token passed in through WithCancellation. - One or more exceptions occurred during the evaluation of the query. - - - Returns the first element of a parallel sequence. - The sequence to return the first element of. - The type of the elements of source. - The first element in the specified sequence. - The query was canceled with the token passed in through WithCancellation. - source is a null reference (Nothing in Visual Basic). - One or more exceptions occurred during the evaluation of the query. - source contains no elements. - - - Returns the first element in a parallel sequence that satisfies a specified condition. - The sequence to return an element from. - A function to test each element for a condition. - The type of the elements of source. - The first element in the sequence that passes the test in the specified predicate function. - The query was canceled with the token passed in through WithCancellation. - source or predicate is a null reference (Nothing in Visual Basic). - One or more exceptions occurred during the evaluation of the query. - No element in source satisfies the condition in predicate. - - - Returns the first element of a parallel sequence, or a default value if the sequence contains no elements. - The sequence to return the first element of. - The type of the elements of source. - default(TSource) if source is empty; otherwise, the first element in source. - The query was canceled with the token passed in through WithCancellation. - source is a null reference (Nothing in Visual Basic). - One or more exceptions occurred during the evaluation of the query. - - - Returns the first element of the parallel sequence that satisfies a condition or a default value if no such element is found. - The sequence to return an element from. - A function to test each element for a condition. - The type of the elements of source. - default(TSource) if source is empty or if no element passes the test specified by predicate; otherwise, the first element in source that passes the test specified by predicate. - The query was canceled with the token passed in through WithCancellation. - source or predicate is a null reference (Nothing in Visual Basic). - One or more exceptions occurred during the evaluation of the query. - - - Invokes in parallel the specified action for each element in the source. - The whose elements will be processed by action. - An Action to invoke on each element. - The type of elements of source. - The query was canceled with the token passed in through WithCancellation. - source or action is a null reference (Nothing in Visual Basic). - One or more exceptions occurred during the evaluation of the query. - - - Groups the elements of a sequence according to a specified key selector function and creates a result value from each group and its key. Key values are compared by using a specified comparer, and the elements of each group are projected by using a specified function. - A sequence whose elements to group. - A function to extract the key for each element. - A function to map each source element to an element in an IGrouping{Key, TElement}. - A function to create a result value from each group. - An to compare keys. - The type of the elements of source. - The type of the key returned by keySelector. - The type of the elements in each IGrouping{TKey, TElement}. - The type of the result value returned by resultSelector. - A sequence of elements of type TResult where each element represents a projection over a group and its key. - The query was canceled with the token passed in through WithCancellation. - source or action is a null reference (Nothing in Visual Basic). - One or more exceptions occurred during the evaluation of the query. - - - Groups in parallel the elements of a sequence according to a specified key selector function and creates a result value from each group and its key. The elements of each group are projected by using a specified function. - A sequence whose elements to group. - A function to extract the key for each element. -

A function to map each source element to an element in an IGrouping<_tkey2c_ telement="">.

-

- - A function to create a result value from each group. - The type of the elements of source. - The type of the key returned by keySelector. - The type of the elements in each IGrouping{TKey, TElement}. - The type of the result value returned by resultSelector. - A sequence of elements of type TResult where each element represents a projection over a group and its key. - The query was canceled with the token passed in through WithCancellation. - source or action is a null reference (Nothing in Visual Basic). - One or more exceptions occurred during the evaluation of the query. -
- - Groups in parallel the elements of a sequence according to a specified key selector function and projects the elements for each group by using a specified function. - An that contains elements to sort. - A function to extract a key from an element. - A function to map each source element to an element in an . - The type of elements of source. - The type of the key returned by keySelector. - The type of the elements in the . - A sequence of groups that are sorted descending according to TKey. - The query was canceled with the token passed in through WithCancellation. - source or action is a null reference (Nothing in Visual Basic). - One or more exceptions occurred during the evaluation of the query. - - - Groups in parallel the elements of a sequence according to a key selector function. The keys are compared by using a comparer and each group's elements are projected by using a specified function. - An OrderedParallelQuery{TSource}that contains elements to sort. - A function to extract a key from an element. - A function to map each source element to an element in an IGrouping. - An IComparer{TSource} to compare keys. - The type of elements of source. - The type of the key returned by keySelector. - The type of the elements in the IGrouping - A sequence of groups that are sorted descending according to TKey. - The query was canceled with the token passed in through WithCancellation. - source or action is a null reference (Nothing in Visual Basic). - One or more exceptions occurred during the evaluation of the query. - - - Groups in parallel the elements of a sequence according to a specified key selector function and creates a result value from each group and its key. - A sequence whose elements to group. - A function to extract the key for each element. - A function to create a result value from each group. - The type of the elements of source. - The type of the key returned by keySelector. - The type of the result value returned by resultSelector. - A sequence of elements of type TResult where each element represents a projection over a group and its key. - The query was canceled with the token passed in through WithCancellation. - source or action is a null reference (Nothing in Visual Basic). - One or more exceptions occurred during the evaluation of the query. - - - Groups in parallel the elements of a sequence according to a specified key selector function and creates a result value from each group and its key. The keys are compared by using a specified comparer. - A sequence whose elements to group. - A function to extract the key for each element. - A function to create a result value from each group. - An to compare keys. - The type of the elements of source. - The type of the key returned by keySelector. - The type of the result value returned by resultSelector. - A sequence of groups. - The query was canceled with the token passed in through WithCancellation. - source or action is a null reference (Nothing in Visual Basic). - One or more exceptions occurred during the evaluation of the query. - - - Groups in parallel the elements of a sequence according to a specified key selector function and compares the keys by using a specified . - An that contains elements to sort. - A function to extract a key from an element. - An to compare keys. - The type of elements of source. - The type of the key returned by keySelector>. - A sequence of groups that are sorted descending according to TKey. - The query was canceled with the token passed in through WithCancellation. - source or action is a null reference (Nothing in Visual Basic). - One or more exceptions occurred during the evaluation of the query. - - - Groups in parallel the elements of a sequence according to a specified key selector function. - An OrderedParallelQuery{TSource}that contains elements to sort. - A function to extract a key from an element. - The type of elements of source. - The type of the key returned by keySelector. - A sequence of groups that are sorted descending according to TKey. - The query was canceled with the token passed in through WithCancellation. - source or action is a null reference (Nothing in Visual Basic). - One or more exceptions occurred during the evaluation of the query. - - - This GroupJoin overload should never be called. This method is marked as obsolete and always throws when called. - This parameter is not used. - This parameter is not used. - This parameter is not used. - This parameter is not used. - This parameter is not used. - This type parameter is not used. - This type parameter is not used. - This type parameter is not used. - This type parameter is not used. - This overload always throws a . - The query was canceled with the token passed in through WithCancellation. - source or action is a null reference (Nothing in Visual Basic). - One or more exceptions occurred during the evaluation of the query. - - - Correlates in parallel the elements of two sequences based on equality of keys and groups the results. The default equality comparer is used to compare keys. - The first sequence to join. - The sequence to join to the first sequence. - A function to extract the join key from each element of the first sequence. - A function to extract the join key from each element of the second sequence. - A function to create a result element from an element from the first sequence and a collection of matching elements from the second sequence. - The type of the elements of the second sequence. - The type of the elements of the first sequence. - The type of the keys returned by the key selector functions. - The type of the result elements. - A sequence that has elements of type TResult that are obtained by performing a grouped join on two sequences. - The query was canceled with the token passed in through WithCancellation. - source or action is a null reference (Nothing in Visual Basic). - One or more exceptions occurred during the evaluation of the query. - - - This GroupJoin overload should never be called. This method is marked as obsolete and always throws when called. - This parameter is not used. - This parameter is not used. - This parameter is not used. - This parameter is not used. - This parameter is not used. - This parameter is not used. - This type parameter is not used. - This type parameter is not used. - This type parameter is not used. - This type parameter is not used. - This overload always throws a . - The exception that occurs when this method is called. - - - Correlates in parallel the elements of two sequences based on key equality and groups the results. A specified is used to compare keys. - The first sequence to join. - The sequence to join to the first sequence. - A function to extract the join key from each element of the first sequence. - A function to extract the join key from each element of the second sequence. - A function to create a result element from an element from the first sequence and a collection of matching elements from the second sequence. - An to hash and compare keys. - The type of the elements of the second sequence. - The type of the elements of the first sequence. - The type of the keys returned by the key selector functions. - The type of the result elements. - A sequence that has elements of type TResult that are obtained by performing a grouped join on two sequences. - The query was canceled with the token passed in through WithCancellation. - source or action is a null reference (Nothing in Visual Basic). - One or more exceptions occurred during the evaluation of the query. - - - This Intersect overload should never be called. This method is marked as obsolete and always throws when called. - This parameter is not used. - This parameter is not used. - This parameter is not used. - This type parameter is not used. - This overload always throws a . - The exception that occurs when this method is called. - - - Produces the set intersection of two parallel sequences by using the specified IEqualityComparer{T} to compare values. - A sequence whose distinct elements that also appear in second will be returned. - A sequence whose distinct elements that also appear in the first sequence will be returned. - An to compare values. - The type of the elements of the input sequences. - A sequence that contains the elements that form the set intersection of two sequences. - The query was canceled with the token passed in through WithCancellation. - source or action is a null reference (Nothing in Visual Basic). - One or more exceptions occurred during the evaluation of the query. - - - This Intersect overload should never be called. This method is marked as obsolete and always throws when called. - This parameter is not used. - This parameter is not used. - This type parameter is not used. - This overload always throws a . - The exception that occurs when this method is called. - - - Produces the set intersection of two parallel sequences by using the default equality comparer to compare values. - A sequence whose distinct elements that also appear in second will be returned. - A sequence whose distinct elements that also appear in the first sequence will be returned. - The type of the elements of the input sequences. - A sequence that contains the elements that form the set intersection of two sequences. - The query was canceled with the token passed in through WithCancellation. - source or action is a null reference (Nothing in Visual Basic). - One or more exceptions occurred during the evaluation of the query. - - - This Join overload should never be called. This method is marked as obsolete and always throws when invoked. - This parameter is not used. - This parameter is not used. - This parameter is not used. - This parameter is not used. - This parameter is not used. - This type parameter is not used. - This type parameter is not used. - This type parameter is not used. - This type parameter is not used. - This overload always throws a . - The query was canceled with the token passed in through WithCancellation. - source or action is a null reference (Nothing in Visual Basic). - One or more exceptions occurred during the evaluation of the query. - - - Correlates in parallel the elements of two sequences based on matching keys. The default equality comparer is used to compare keys. - The first sequence to join. - The sequence to join to the first sequence. - A function to extract the join key from each element of the first sequence. - A function to extract the join key from each element of the second sequence. - A function to create a result element from two matching elements. - The type of the elements of the second sequence. - The type of the elements of the first sequence. - The type of the keys returned by the key selector functions. - The type of the result elements. - A sequence that has elements of type TResult that are obtained by performing an inner join on two sequences. - The query was canceled with the token passed in through WithCancellation. - source or action is a null reference (Nothing in Visual Basic). - One or more exceptions occurred during the evaluation of the query. - - - This Join overload should never be called. This method is marked as obsolete and always throws when invoked. - This parameter is not used. - This parameter is not used. - This parameter is not used. - This parameter is not used. - This parameter is not used. - This parameter is not used. - This type parameter is not used. - This type parameter is not used. - This type parameter is not used. - This type parameter is not used. - This overload always throws a . - The exception that occurs when this method is called. - - - Correlates in parallel the elements of two sequences based on matching keys. A specified is used to compare keys. - The first sequence to join. - The sequence to join to the first sequence. - A function to extract the join key from each element of the first sequence. - A function to extract the join key from each element of the second sequence. - A function to create a result element from two matching elements. - An to hash and compare keys. - The type of the elements of the second sequence. - The type of the elements of the first sequence. - The type of the keys returned by the key selector functions. - The type of the result elements. - A sequence that has elements of type TResult that are obtained by performing an inner join on two sequences. - The query was canceled with the token passed in through WithCancellation. - source or action is a null reference (Nothing in Visual Basic). - One or more exceptions occurred during the evaluation of the query. - - - Returns the last element of a parallel sequence. - The sequence to return the last element from. - The type of the elements of source. - The value at the last position in the source sequence. - The query was canceled with the token passed in through WithCancellation. - source is a null reference (Nothing in Visual Basic). - One or more exceptions occurred during the evaluation of the query. - source contains no elements. - - - Returns the last element of a parallel sequence that satisfies a specified condition. - The sequence to return an element from. - A function to test each element for a condition. - The type of the elements of source. - The last element in the sequence that passes the test in the specified predicate function. - The query was canceled with the token passed in through WithCancellation. - source or predicate is a null reference (Nothing in Visual Basic). - One or more exceptions occurred during the evaluation of the query. - No element in source satisfies the condition in predicate. - - - Returns the last element of a parallel sequence that satisfies a condition, or a default value if no such element is found. - The sequence to return an element from. - A function to test each element for a condition. - The type of the elements of source. - default() if the sequence is empty or if no elements pass the test in the predicate function; otherwise, the last element that passes the test in the predicate function. - The query was canceled with the token passed in through WithCancellation. - source or predicate is a null reference (Nothing in Visual Basic). - One or more exceptions occurred during the evaluation of the query. - - - Returns the last element of a parallel sequence, or a default value if the sequence contains no elements. - The sequence to return an element from. - The type of the elements of source. - default() if the source sequence is empty; otherwise, the last element in the sequence. - The query was canceled with the token passed in through WithCancellation. - source is a null reference (Nothing in Visual Basic). - One or more exceptions occurred during the evaluation of the query. - - - Returns an Int64 that represents the total number of elements in a parallel sequence. - A sequence that contains elements to be counted. - The type of the elements of source. - The number of elements in the input sequence. - The query was canceled with the token passed in through WithCancellation. - source is a null reference (Nothing in Visual Basic). - The number of elements in source is larger than . -or- One or more exceptions occurred during the evaluation of the query. - The computed result is greater than . - - - Returns an Int64 that represents how many elements in a parallel sequence satisfy a condition. - A sequence that contains elements to be counted. - A function to test each element for a condition. - The type of the elements of source. - A number that represents how many elements in the sequence satisfy the condition in the predicate function. - The query was canceled with the token passed in through WithCancellation. - source or predicate is a null reference (Nothing in Visual Basic). - The number of elements in source is larger than . -or- One or more exceptions occurred during the evaluation of the query. - The computed result is greater than . - - - Returns the maximum value in a parallel sequence of values. - A sequence of values to determine the maximum value of. - The maximum value in the sequence. - The query was canceled with the token passed in through WithCancellation. - source is a null reference (Nothing in Visual Basic). - One or more exceptions occurred during the evaluation of the query. - source contains no elements. - - - Returns the maximum value in a parallel sequence of values. - A sequence of values to determine the maximum value of. - The maximum value in the sequence. - The query was canceled with the token passed in through WithCancellation. - source is a null reference (Nothing in Visual Basic). - One or more exceptions occurred during the evaluation of the query. - source contains no elements. - - - Returns the maximum value in a parallel sequence of values. - A sequence of values to determine the maximum value of. - The maximum value in the sequence. - The query was canceled with the token passed in through WithCancellation. - source is a null reference (Nothing in Visual Basic). - One or more exceptions occurred during the evaluation of the query. - source contains no elements. - - - Returns the maximum value in a parallel sequence of values. - A sequence of values to determine the maximum value of. - The maximum value in the sequence. - The query was canceled with the token passed in through WithCancellation. - source is a null reference (Nothing in Visual Basic). - One or more exceptions occurred during the evaluation of the query. - source contains no elements. - - - Returns the maximum value in a parallel sequence of values. - A sequence of values to determine the maximum value of. - The maximum value in the sequence. - The query was canceled with the token passed in through WithCancellation. - source is a null reference (Nothing in Visual Basic). - One or more exceptions occurred during the evaluation of the query. - source contains no elements. - - - Returns the maximum value in a parallel sequence of values. - A sequence of values to determine the maximum value of. - The maximum value in the sequence. - The query was canceled with the token passed in through WithCancellation. - source is a null reference (Nothing in Visual Basic). - One or more exceptions occurred during the evaluation of the query. - source contains no elements. - - - Returns the maximum value in a parallel sequence of values. - A sequence of values to determine the maximum value of. - The maximum value in the sequence. - The query was canceled with the token passed in through WithCancellation. - source is a null reference (Nothing in Visual Basic). - One or more exceptions occurred during the evaluation of the query. - source contains no elements. - - - Returns the maximum value in a parallel sequence of values. - A sequence of values to determine the maximum value of. - The maximum value in the sequence. - The query was canceled with the token passed in through WithCancellation. - source is a null reference (Nothing in Visual Basic). - One or more exceptions occurred during the evaluation of the query. - source contains no elements. - - - Returns the maximum value in a parallel sequence of values. - A sequence of values to determine the maximum value of. - The maximum value in the sequence. - The query was canceled with the token passed in through WithCancellation. - source is a null reference (Nothing in Visual Basic). - One or more exceptions occurred during the evaluation of the query. - source contains no elements. - - - Returns the maximum value in a parallel sequence of values. - A sequence of values to determine the maximum value of. - The maximum value in the sequence. - The query was canceled with the token passed in through WithCancellation. - source is a null reference (Nothing in Visual Basic). - One or more exceptions occurred during the evaluation of the query. - source contains no elements. - - - Invokes in parallel a transform function on each element of a sequence and returns the maximum value. - A sequence of values to determine the maximum value of. - A transform function to apply to each element. - The type of elements of source. - The type of the value returned by selector. - The maximum value in the sequence. - The query was canceled with the token passed in through WithCancellation. - source or selector is a null reference (Nothing in Visual Basic). - One or more exceptions occurred during the evaluation of the query. - source contains no elements and TSource is a non-nullable value type. - - - Invokes in parallel a transform function on each element of a sequence and returns the maximum value. - A sequence of values to determine the maximum value of. - A transform function to apply to each element. - The type of elements of source. - The maximum value in the sequence. - The query was canceled with the token passed in through WithCancellation. - source or selector is a null reference (Nothing in Visual Basic). - One or more exceptions occurred during the evaluation of the query. - source contains no elements. - - - Invokes in parallel a transform function on each element of a sequence and returns the maximum value. - A sequence of values to determine the maximum value of. - A transform function to apply to each element. - The type of elements of source. - The maximum value in the sequence. - The query was canceled with the token passed in through WithCancellation. - source or selector is a null reference (Nothing in Visual Basic). - One or more exceptions occurred during the evaluation of the query. - source contains no elements and TSource is a non-nullable value type. - - - Invokes in parallel a transform function on each element of a sequence and returns the maximum value. - A sequence of values to determine the maximum value of. - A transform function to apply to each element. - The type of elements of source. - The maximum value in the sequence. - The query was canceled with the token passed in through WithCancellation. - source or selector is a null reference (Nothing in Visual Basic). - One or more exceptions occurred during the evaluation of the query. - source contains no elements. - - - Invokes in parallel a transform function on each element of a sequence and returns the maximum value. - A sequence of values to determine the maximum value of. - A transform function to apply to each element. - The type of elements of source. - The maximum value in the sequence. - The query was canceled with the token passed in through WithCancellation. - source or selector is a null reference (Nothing in Visual Basic). - One or more exceptions occurred during the evaluation of the query. - source contains no elements. - - - Invokes in parallel a transform function on each element of a sequence and returns the maximum value. - A sequence of values to determine the maximum value of. - A transform function to apply to each element. - The type of elements of source. - The maximum value in the sequence. - The query was canceled with the token passed in through WithCancellation. - source or selector is a null reference (Nothing in Visual Basic). - One or more exceptions occurred during the evaluation of the query. - source contains no elements. - - - Invokes in parallel a transform function on each element of a sequence and returns the maximum value. - A sequence of values to determine the maximum value of. - A transform function to apply to each element. - The type of elements of source. - The maximum value in the sequence. - The query was canceled with the token passed in through WithCancellation. - source or selector is a null reference (Nothing in Visual Basic). - One or more exceptions occurred during the evaluation of the query. - source contains no elements. - - - Invokes in parallel a transform function on each element of a sequence and returns the maximum value. - A sequence of values to determine the maximum value of. - A transform function to apply to each element. - The type of elements of source. - The maximum value in the sequence. - The query was canceled with the token passed in through WithCancellation. - source or selector is a null reference (Nothing in Visual Basic). - One or more exceptions occurred during the evaluation of the query. - source contains no elements and TSource is a non-nullable value type. - - - Invokes in parallel a transform function on each element of a sequence and returns the maximum value. - A sequence of values to determine the maximum value of. - A transform function to apply to each element. - The type of elements of source. - The maximum value in the sequence. - The query was canceled with the token passed in through WithCancellation. - source or selector is a null reference (Nothing in Visual Basic). - One or more exceptions occurred during the evaluation of the query. - source contains no elements and TSource is a non-nullable value type. - - - Invokes in parallel a transform function on each element of a sequence and returns the maximum value. - A sequence of values to determine the maximum value of. - A transform function to apply to each element. - The type of elements of source. - The maximum value in the sequence. - The query was canceled with the token passed in through WithCancellation. - source or selector is a null reference (Nothing in Visual Basic). - One or more exceptions occurred during the evaluation of the query. - source contains no elements and TSource is a non-nullable value type. - - - Invokes in parallel a transform function on each element of a sequence and returns the maximum value. - A sequence of values to determine the maximum value of. - A transform function to apply to each element. - The type of elements of source. - The maximum value in the sequence. - The query was canceled with the token passed in through WithCancellation. - source or selector is a null reference (Nothing in Visual Basic). - One or more exceptions occurred during the evaluation of the query. - source contains no elements and TSource is a non-nullable value type. - - - Returns the maximum value in a parallel sequence of values. - A sequence of values to determine the maximum value of. - The type of elements in the source sequence. - The maximum value in the sequence. - The query was canceled with the token passed in through WithCancellation. - source is a null reference (Nothing in Visual Basic). - One or more exceptions occurred during the evaluation of the query. - source contains no elements and TSource is a non-nullable value type. - - - Returns the minimum value in a parallel sequence of values. - A sequence of values to determine the minimum value of. - The minimum value in the sequence. - The query was canceled with the token passed in through WithCancellation. - source is a null reference (Nothing in Visual Basic). - One or more exceptions occurred during the evaluation of the query. - source contains no elements and TSource is a non-nullable value type. - - - Returns the minimum value in a parallel sequence of values. - A sequence of values to determine the minimum value of. - The minimum value in the sequence. - The query was canceled with the token passed in through WithCancellation. - source is a null reference (Nothing in Visual Basic). - One or more exceptions occurred during the evaluation of the query. - source contains no elements. - - - Returns the minimum value in a parallel sequence of values. - A sequence of values to determine the minimum value of. - The minimum value in the sequence. - The query was canceled with the token passed in through WithCancellation. - source is a null reference (Nothing in Visual Basic). - One or more exceptions occurred during the evaluation of the query. - source contains no elements. - - - Returns the minimum value in a parallel sequence of values. - A sequence of values to determine the minimum value of. - The minimum value in the sequence. - The query was canceled with the token passed in through WithCancellation. - source is a null reference (Nothing in Visual Basic). - One or more exceptions occurred during the evaluation of the query. - source contains no elements. - - - Returns the minimum value in a parallel sequence of values. - A sequence of values to determine the minimum value of. - The minimum value in the sequence. - The query was canceled with the token passed in through WithCancellation. - source is a null reference (Nothing in Visual Basic). - One or more exceptions occurred during the evaluation of the query. - source contains no elements. - - - Returns the minimum value in a parallel sequence of values. - A sequence of values to determine the minimum value of. - The minimum value in the sequence. - The query was canceled with the token passed in through WithCancellation. - source is a null reference (Nothing in Visual Basic). - One or more exceptions occurred during the evaluation of the query. - source contains no elements. - - - Returns the minimum value in a parallel sequence of values. - A sequence of values to determine the minimum value of. - The minimum value in the sequence. - The query was canceled with the token passed in through WithCancellation. - source is a null reference (Nothing in Visual Basic). - One or more exceptions occurred during the evaluation of the query. - source contains no elements and TSource is a non-nullable value type. - - - Returns the minimum value in a parallel sequence of values. - A sequence of values to determine the minimum value of. - The minimum value in the sequence. - The query was canceled with the token passed in through WithCancellation. - source is a null reference (Nothing in Visual Basic). - One or more exceptions occurred during the evaluation of the query. - source contains no elements and TSource is a non-nullable value type. - - - Returns the minimum value in a parallel sequence of values. - A sequence of values to determine the minimum value of. - The minimum value in the sequence. - The query was canceled with the token passed in through WithCancellation. - source is a null reference (Nothing in Visual Basic). - One or more exceptions occurred during the evaluation of the query. - source contains no elements and TSource is a non-nullable value type. - - - Returns the minimum value in a parallel sequence of values. - A sequence of values to determine the minimum value of. - The minimum value in the sequence. - The query was canceled with the token passed in through WithCancellation. - source is a null reference (Nothing in Visual Basic). - One or more exceptions occurred during the evaluation of the query. - source contains no elements and TSource is a non-nullable value type. - - - Invokes in parallel a transform function on each element of a sequence and returns the minimum value. - A sequence of values to determine the minimum value of. - A transform function to apply to each element. - The type of elements of source. - The type of the value returned by selector. - The minimum value in the sequence. - The query was canceled with the token passed in through WithCancellation. - source or selector is a null reference (Nothing in Visual Basic). - One or more exceptions occurred during the evaluation of the query. - source contains no elements and TSource is a non-nullable value type. - - - Invokes in parallel a transform function on each element of a sequence and returns the minimum value. - A sequence of values to determine the minimum value of. - A transform function to apply to each element. - The type of elements of source. - The minimum value in the sequence. - The query was canceled with the token passed in through WithCancellation. - source or selector is a null reference (Nothing in Visual Basic). - One or more exceptions occurred during the evaluation of the query. - source contains no elements and TSource is a non-nullable value type. - - - Invokes in parallel a transform function on each element of a sequence and returns the minimum value. - A sequence of values to determine the minimum value of. - A transform function to apply to each element. - The type of elements of source. - The minimum value in the sequence. - The query was canceled with the token passed in through WithCancellation. - source or selector is a null reference (Nothing in Visual Basic). - One or more exceptions occurred during the evaluation of the query. - source contains no elements. - - - Invokes in parallel a transform function on each element of a sequence and returns the minimum value. - A sequence of values to determine the minimum value of. - A transform function to apply to each element. - The type of elements of source. - The minimum value in the sequence. - The query was canceled with the token passed in through WithCancellation. - source or selector is a null reference (Nothing in Visual Basic). - One or more exceptions occurred during the evaluation of the query. - source contains no elements. - - - Invokes in parallel a transform function on each element of a sequence and returns the minimum value. - A sequence of values to determine the minimum value of. - A transform function to apply to each element. - The type of elements of source. - The minimum value in the sequence. - The query was canceled with the token passed in through WithCancellation. - source or selector is a null reference (Nothing in Visual Basic). - One or more exceptions occurred during the evaluation of the query. - source contains no elements. - - - Invokes in parallel a transform function on each element of a sequence and returns the minimum value. - A sequence of values to determine the minimum value of. - A transform function to apply to each element. - The type of elements of source. - The minimum value in the sequence. - The query was canceled with the token passed in through WithCancellation. - source or selector is a null reference (Nothing in Visual Basic). - One or more exceptions occurred during the evaluation of the query. - source contains no elements. - - - Invokes in parallel a transform function on each element of a sequence and returns the minimum value. - A sequence of values to determine the minimum value of. - A transform function to apply to each element. - The type of elements of source. - The minimum value in the sequence. - The query was canceled with the token passed in through WithCancellation. - source or selector is a null reference (Nothing in Visual Basic). - One or more exceptions occurred during the evaluation of the query. - source contains no elements and TSource is a non-nullable value type. - - - Invokes in parallel a transform function on each element of a sequence and returns the minimum value. - A sequence of values to determine the minimum value of. - A transform function to apply to each element. - The type of elements of source. - The minimum value in the sequence. - The query was canceled with the token passed in through WithCancellation. - source or selector is a null reference (Nothing in Visual Basic). - One or more exceptions occurred during the evaluation of the query. - source contains no elements and TSource is a non-nullable value type. - - - Invokes in parallel a transform function on each element of a sequence and returns the minimum value. - A sequence of values to determine the minimum value of. - A transform function to apply to each element. - The type of elements of source. - The minimum value in the sequence. - The query was canceled with the token passed in through WithCancellation. - source or selector is a null reference (Nothing in Visual Basic). - One or more exceptions occurred during the evaluation of the query. - source contains no elements. - - - Invokes in parallel a transform function on each element of a sequence and returns the minimum value. - A sequence of values to determine the minimum value of. - A transform function to apply to each element. - The type of elements of source. - The minimum value in the sequence. - The query was canceled with the token passed in through WithCancellation. - source or selector is a null reference (Nothing in Visual Basic). - One or more exceptions occurred during the evaluation of the query. - source contains no elements and TSource is a non-nullable value type. - - - Invokes in parallel a transform function on each element of a sequence and returns the minimum value. - A sequence of values to determine the minimum value of. - A transform function to apply to each element. - The type of elements of source. - The minimum value in the sequence. - The query was canceled with the token passed in through WithCancellation. - source or selector is a null reference (Nothing in Visual Basic). - One or more exceptions occurred during the evaluation of the query. - source contains no elements and TSource is a non-nullable value type. - - - Returns the minimum value in a parallel sequence of values. - A sequence of values to determine the minimum value of. - The type of elements of source. - The minimum value in the sequence. - The query was canceled with the token passed in through WithCancellation. - source is a null reference (Nothing in Visual Basic). - One or more exceptions occurred during the evaluation of the query. - source contains no elements and TSource is a non-nullable value type. - - - Filters the elements of a ParallelQuery based on a specified type. - The sequence whose elements to filter. - The type to filter the elements of the sequence on. - A sequence that contains elements from the input sequence of type . - source is a null reference (Nothing in Visual Basic). - The query was canceled with the token passed in through WithCancellation. - One or more exceptions occurred during the evaluation of the query. - - - Sorts in parallel the elements of a sequence in ascending order according to a key. - A sequence of values to order. - A function to extract a key from an element. - The type of elements of source. - The type of the key returned by keySelector. - An OrderedParallelQuery{TSource} whose elements are sorted according to a key. - source or keySelector is a null reference (Nothing in Visual Basic). - The query was canceled with the token passed in through WithCancellation. - One or more exceptions occurred during the evaluation of the query. - - - Sorts in parallel the elements of a sequence in ascending order by using a specified comparer. - A sequence of values to order. - A function to extract a key from an element. - An IComparer{TKey} to compare keys. - The type of elements of source. - The type of the key returned by keySelector. - An OrderedParallelQuery{TSource} whose elements are sorted according to a key. - source or keySelector is a null reference (Nothing in Visual Basic). - The query was canceled with the token passed in through WithCancellation. - One or more exceptions occurred during the evaluation of the query. - - - Sorts in parallel the elements of a sequence in descending order according to a key. - A sequence of values to order. - A function to extract a key from an element. - The type of elements of source. - The type of the key returned by keySelector. - An OrderedParallelQuery{TSource} whose elements are sorted descending according to a key. - source or keySelector is a null reference (Nothing in Visual Basic). - The query was canceled with the token passed in through WithCancellation. - One or more exceptions occurred during the evaluation of the query. - - - Sorts the elements of a sequence in descending order by using a specified comparer. - A sequence of values to order. - A function to extract a key from an element. - An IComparer{TKey} to compare keys. - The type of elements of source. - The type of the key returned by keySelector. - An OrderedParallelQuery{TSource} whose elements are sorted descending according to a key. - source or KeySelector is a null reference (Nothing in Visual Basic).. - The query was canceled with the token passed in through WithCancellation. - One or more exceptions occurred during the evaluation of the query. - - - Generates a parallel sequence of integral numbers within a specified range. - The value of the first integer in the sequence. - The number of sequential integers to generate. -

An IEnumerable in C# or IEnumerable(Of Int32) in Visual Basic that contains a range of sequential integral numbers.

-

-
- count is less than 0 -or- start + count - 1 is larger than . -
- - Generates a parallel sequence that contains one repeated value. - The value to be repeated. - The number of times to repeat the value in the generated sequence. - The type of the value to be repeated in the result sequence. - A sequence that contains a repeated value. - count is less than 0. - - - Inverts the order of the elements in a parallel sequence. - A sequence of values to reverse. - The type of the elements of source. - A sequence whose elements correspond to those of the input sequence in reverse order. - source is a null reference (Nothing in Visual Basic). - The query was canceled with the token passed in through WithCancellation. - One or more exceptions occurred during the evaluation of the query. - - - Projects in parallel each element of a sequence into a new form by incorporating the element's index. - A sequence of values to invoke a transform function on. - A transform function to apply to each element. - The type of the elements of source. - The type of elements resturned by selector. - A sequence whose elements are the result of invoking the transform function on each element of source, based on the index supplied to selector. - source or selector is a null reference (Nothing in Visual Basic). - The query was canceled with the token passed in through WithCancellation. - One or more exceptions occurred during the evaluation of the query. - More than elements are enumerated by the query. This condition might occur in streaming scenarios. - - - Projects in parallel each element of a sequence into a new form. - A sequence of values to invoke a transform function on. - A transform function to apply to each element. - The type of the elements of source. - The type of elements resturned by selector. - A sequence whose elements are the result of invoking the transform function on each element of source. - source or selector is a null reference (Nothing in Visual Basic). - The query was canceled with the token passed in through WithCancellation. - One or more exceptions occurred during the evaluation of the query. - - - Projects each element of a sequence to an , flattens the resulting sequences into one sequence, and invokes a result selector function on each element therein. - A sequence of values to project. - A transform function to apply to each source element; the second parameter of the function represents the index of the source element. - A function to create a result element from an element from the first sequence and a collection of matching elements from the second sequence. - The type of the intermediate elements collected by collectionSelector. - The type of elements of source. - The type of elements in the result sequence. - A sequence whose elements are the result of invoking the one-to-many transform function collectionSelector on each element of source based on the index supplied to collectionSelector, and then mapping each of those sequence elements and their corresponding source element to a result element. - source or selector is a null reference (Nothing in Visual Basic). - The query was canceled with the token passed in through WithCancellation. - More than elements are enumerated by the query. - One or more exceptions occurred during the evaluation of the query. - - - Projects each element of a sequence to an , flattens the resulting sequences into one sequence, and invokes a result selector function on each element therein. The index of each source element is used in the intermediate projected form of that element. - A sequence of values to project. - A transform function to apply to each source element; the second parameter of the function represents the index of the source element. - A function to create a result element from an element from the first sequence and a collection of matching elements from the second sequence. - The type of the intermediate elements collected by collectionSelector. - The type of elements of source. - The type of elements to return. - A sequence whose elements are the result of invoking the one-to-many transform function collectionSelector on each element of source based on the index supplied to collectionSelector, and then mapping each of those sequence elements and their corresponding source element to a result element. - source or selector is a null reference (Nothing in Visual Basic). - The query was canceled with the token passed in through WithCancellation. - More than elements are enumerated by the query. - One or more exceptions occurred during the evaluation of the query. - - - Projects in parallel each element of a sequence to an and flattens the resulting sequences into one sequence. - A sequence of values to project. - A transform function to apply to each element. - The type of elements of source. - The type of the elements of the sequence returned by selector. - A sequence whose elements are the result of invoking the one-to-many transform function on each element of the input sequence. - source or selector is a null reference (Nothing in Visual Basic). - The query was canceled with the token passed in through WithCancellation. - One or more exceptions occurred during the evaluation of the query. - - - Projects in parallel each element of a sequence to an , and flattens the resulting sequences into one sequence. The index of each source element is used in the projected form of that element. - A sequence of values to project. - A transform function to apply to each element. - The type of elements of source. - The type of the elements of the sequence returned by selector. - A sequence whose elements are the result of invoking the one-to-many transform function on each element of the input sequence. - source or selector is a null reference (Nothing in Visual Basic). - The query was canceled with the token passed in through WithCancellation. - More than elements are enumerated by the query. - One or more exceptions occurred during the evaluation of the query. - - - This SequenceEqual overload should never be called. This method is marked as obsolete and always throws when called. - This parameter is not used. - This parameter is not used. - This type parameter is not used. - This overload always throws a . - Thrown every time this method is called. - - - Determines whether two parallel sequences are equal by comparing the elements by using the default equality comparer for their type. - A sequence to compare to second. - A sequence to compare to the first input sequence. - The type of the elements of the input sequences. - true if the two source sequences are of equal length and their corresponding elements are equal according to the default equality comparer for their type; otherwise, false. - The query was canceled with the token passed in through WithCancellation. - first or second is a null reference (Nothing in Visual Basic). - One or more exceptions occurred during the evaluation of the query. - - - This SequenceEqual overload should never be called. This method is marked as obsolete and always throws when called. - This parameter is not used. - This parameter is not used. - This parameter is not used. - This type parameter is not used. - This overload always throws a . - Thrown every time this method is called. - - - Determines whether two parallel sequences are equal by comparing their elements by using a specified IEqualityComparer{T}. - A sequence to compare to second. - A sequence to compare to the first input sequence. - An to use to compare elements. - The type of the elements of the input sequences. - true if the two source sequences are of equal length and their corresponding elements are equal according to the default equality comparer for their type; otherwise, false. - The query was canceled with the token passed in through WithCancellation. - first or second is a null reference (Nothing in Visual Basic). - One or more exceptions occurred during the evaluation of the query. - - - Returns the only element of a parallel sequence, and throws an exception if there is not exactly one element in the sequence. - The sequence to return the single element of. - The type of the elements of source. - The single element of the input sequence. - The query was canceled with the token passed in through WithCancellation. - source is a null reference (Nothing in Visual Basic). - One or more exceptions occurred during the evaluation of the query. - The input sequence contains more than one element. -or- The input sequence is empty. - - - Returns the only element of a parallel sequence that satisfies a specified condition, and throws an exception if more than one such element exists. - The sequence to return the single element of. - A function to test an element for a condition. - The type of the elements of source. - The single element of the input sequence that satisfies a condition. - The query was canceled with the token passed in through WithCancellation. - source or predicate is a null reference (Nothing in Visual Basic). - One or more exceptions occurred during the evaluation of the query. - No element satisfies the condition in predicate. -or- More than one element satisfies the condition in predicate. - - - Returns the only element of a parallel sequence, or a default value if the sequence is empty; this method throws an exception if there is more than one element in the sequence. - The sequence to return the single element of. - The type of the elements of source. - The single element of the input sequence, or default() if the sequence contains no elements. - The query was canceled with the token passed in through WithCancellation. - source is a null reference (Nothing in Visual Basic). - One or more exceptions occurred during the evaluation of the query. - - - Returns the only element of a parallel sequence that satisfies a specified condition or a default value if no such element exists; this method throws an exception if more than one element satisfies the condition. - The sequence to return the single element of. - A function to test an element for a condition. - The type of the elements of source. - The single element of the input sequence that satisfies the condition, or default() if no such element is found. - The query was canceled with the token passed in through WithCancellation. - source or predicate is a null reference (Nothing in Visual Basic). - One or more exceptions occurred during the evaluation of the query. - source is empty or multiple elements are returned. - - - Bypasses a specified number of elements in a parallel sequence and then returns the remaining elements. - The sequence to return elements from. - The number of elements to skip before returning the remaining elements. - The type of elements of source. - A sequence that contains the elements that occur after the specified index in the input sequence. - source is a null reference (Nothing in Visual Basic). - The query was canceled with the token passed in through WithCancellation. - Count is greater than - One or more exceptions occurred during the evaluation of the query. - - - Bypasses elements in a parallel sequence as long as a specified condition is true and then returns the remaining elements. - The sequence to return elements from. - A function to test each element for a condition. - The type of elements of source. - A sequence that contains the elements from the input sequence starting at the first element in the linear series that does not pass the test specified by predicate. - source or predicate is a null reference (Nothing in Visual Basic). - The query was canceled with the token passed in through WithCancellation. - One or more exceptions occurred during the evaluation of the query. - - - Bypasses elements in a parallel sequence as long as a specified condition is true and then returns the remaining elements. The element's index is used in the logic of the predicate function. - The sequence to return elements from. - A function to test each source element for a condition; the second parameter of the function represents the index of the source element. - The type of elements of source. - A sequence that contains the elements from the input sequence starting at the first element in the linear series that does not pass the test specified by predicate. - source or predicate is a null reference (Nothing in Visual Basic). - The query was canceled with the token passed in through WithCancellation. - More than elements are enumerated by the query. - One or more exceptions occurred during the evaluation of the query. - - - Computes in parallel the sum of a sequence of values. - A sequence of values to calculate the sum of. - The sum of the projected values in the sequence. - The query was canceled with the token passed in through WithCancellation. - source is a null reference (Nothing in Visual Basic). - The sum is larger than . -or- One or more exceptions occurred during the evaluation of the query. - - - Computes in parallel the sum of a sequence of values. - A sequence of values to calculate the sum of. - The sum of the projected values in the sequence. - The query was canceled with the token passed in through WithCancellation. - source is a null reference (Nothing in Visual Basic). - The sum is larger than . -or- One or more exceptions occurred during the evaluation of the query. - - - Computes in parallel the sum of a sequence of values. - A sequence of values to calculate the sum of. - The sum of the projected values in the sequence. - The query was canceled with the token passed in through WithCancellation. - source is a null reference (Nothing in Visual Basic). - The sum is larger than . -or- One or more exceptions occurred during the evaluation of the query. - - - Computes in parallel the sum of a sequence of values. - A sequence of values to calculate the sum of. - The sum of the projected values in the sequence. - The query was canceled with the token passed in through WithCancellation. - source is a null reference (Nothing in Visual Basic). - The sum is larger than . -or- One or more exceptions occurred during the evaluation of the query. - - - Computes in parallel the sum of a sequence of values. - A sequence of values to calculate the sum of. - The sum of the projected values in the sequence. - The query was canceled with the token passed in through WithCancellation. - source is a null reference (Nothing in Visual Basic). - The sum is larger than . -or- One or more exceptions occurred during the evaluation of the query. - - - Computes in parallel the sum of a sequence of values. - A sequence of values to calculate the sum of. - The sum of the projected values in the sequence. - The query was canceled with the token passed in through WithCancellation. - source is a null reference (Nothing in Visual Basic). - The sum is larger than . -or- One or more exceptions occurred during the evaluation of the query. - - - Computes in parallel the sum of a sequence of values. - A sequence of values to calculate the sum of. - The sum of the projected values in the sequence. - The query was canceled with the token passed in through WithCancellation. - source is a null reference (Nothing in Visual Basic). - The sum is larger than . -or- One or more exceptions occurred during the evaluation of the query. - - - Computes in parallel the sum of a sequence of values. - A sequence of values to calculate the sum of. - The sum of the projected values in the sequence. - The query was canceled with the token passed in through WithCancellation. - source is a null reference (Nothing in Visual Basic). - The sum is larger than . -or- One or more exceptions occurred during the evaluation of the query. - - - Computes in parallel the sum of a sequence of values. - A sequence of values to calculate the sum of. - The sum of the projected values in the sequence. - The query was canceled with the token passed in through WithCancellation. - source is a null reference (Nothing in Visual Basic). - The sum is larger than . -or- One or more exceptions occurred during the evaluation of the query. - - - Computes in parallel the sum of a sequence of values. - A sequence of values to calculate the sum of. - The sum of the projected values in the sequence. - The query was canceled with the token passed in through WithCancellation. - source is a null reference (Nothing in Visual Basic). - The sum is larger than . -or- One or more exceptions occurred during the evaluation of the query. - - - Computes in parallel the sum of the sequence of values that are obtained by invoking a transform function on each element of the input sequence. - A sequence of values to calculate the sum of. - A transform function to apply to each element. - The type of elements of source. - The sum of the projected values in the sequence. - The query was canceled with the token passed in through WithCancellation. - source or selector is a null reference (Nothing in Visual Basic). - The sum is larger than . -or- One or more exceptions occurred during the evaluation of the query. - - - Computes in parallel the sum of the sequence of values that are obtained by invoking a transform function on each element of the input sequence. - A sequence of values to calculate the sum of. - A transform function to apply to each element. - The type of elements of source. - The sum of the projected values in the sequence. - The query was canceled with the token passed in through WithCancellation. - source or selector is a null reference (Nothing in Visual Basic). - The sum is larger than . -or- One or more exceptions occurred during the evaluation of the query. - - - Computes in parallel the sum of the sequence of values that are obtained by invoking a transform function on each element of the input sequence. - A sequence of values to calculate the sum of. - A transform function to apply to each element. - The type of elements of source. - The sum of the projected values in the sequence. - The query was canceled with the token passed in through WithCancellation. - source or selector is a null reference (Nothing in Visual Basic). - The sum is larger than . -or- One or more exceptions occurred during the evaluation of the query. - - - Computes in parallel the sum of the sequence of values that are obtained by invoking a transform function on each element of the input sequence. - A sequence of values to calculate the sum of. - A transform function to apply to each element. - The type of elements in the source sequence. - The sum of the projected values in the sequence. - The query was canceled with the token passed in through WithCancellation. - source or selector is a null reference (Nothing in Visual Basic). - The sum is larger than . -or- One or more exceptions occurred during the evaluation of the query. - - - Computes in parallel the sum of the sequence of values that are obtained by invoking a transform function on each element of the input sequence. - A sequence of values to calculate the sum of. - A transform function to apply to each element. - The type of elements of source. - The sum of the projected values in the sequence. - The query was canceled with the token passed in through WithCancellation. - source or selector is a null reference (Nothing in Visual Basic). - The sum is larger than . -or- One or more exceptions occurred during the evaluation of the query. - - - Computes in parallel the sum of the sequence of values that are obtained by invoking a transform function on each element of the input sequence. - A sequence of values to calculate the sum of. - A transform function to apply to each element. - The type of elements of source. - The sum of the projected values in the sequence. - The query was canceled with the token passed in through WithCancellation. - source or selector is a null reference (Nothing in Visual Basic). - The sum is larger than . -or- One or more exceptions occurred during the evaluation of the query. - - - Computes in parallel the sum of the sequence of values that are obtained by invoking a transform function on each element of the input sequence. - A sequence of values to calculate the sum of. - A transform function to apply to each element. - The type of elements of source. - The sum of the projected values in the sequence. - The query was canceled with the token passed in through WithCancellation. - source or selector is a null reference (Nothing in Visual Basic). - The sum is larger than . -or- One or more exceptions occurred during the evaluation of the query. - - - Computes in parallel the sum of the sequence of values that are obtained by invoking a transform function on each element of the input sequence. - A sequence of values to calculate the sum of. - A transform function to apply to each element. - The type of elements of source. - The sum of the projected values in the sequence. - The query was canceled with the token passed in through WithCancellation. - source or selector is a null reference (Nothing in Visual Basic). - The sum is larger than . -or- One or more exceptions occurred during the evaluation of the query. - - - Computes in parallel the sum of the sequence of values that are obtained by invoking a transform function on each element of the input sequence. - A sequence of values to calculate the sum of. - A transform function to apply to each element. - The type of elements of source. - The sum of the projected values in the sequence. - The query was canceled with the token passed in through WithCancellation. - source or selector is a null reference (Nothing in Visual Basic). - The sum is larger than . -or- One or more exceptions occurred during the evaluation of the query. - - - Computes in parallel the sum of the sequence of values that are obtained by invoking a transform function on each element of the input sequence. - A sequence of values to calculate the sum of. - A transform function to apply to each element. - The type of elements of source. - The sum of the projected values in the sequence. - The query was canceled with the token passed in through WithCancellation. - source or selector is a null reference (Nothing in Visual Basic). - The sum is larger than . -or- One or more exceptions occurred during the evaluation of the query. - - - Returns a specified number of contiguous elements from the start of a parallel sequence. - The sequence to return elements from. - The number of elements to return. - The type of elements of source. - A sequence that contains the specified number of elements from the start of the input sequence. - source is a null reference (Nothing in Visual Basic). - The query was canceled with the token passed in through WithCancellation. - One or more exceptions occurred during the evaluation of the query. - - - Returns elements from a parallel sequence as long as a specified condition is true. The element's index is used in the logic of the predicate function. - The sequence to return elements from. - A function to test each source element for a condition; the second parameter of the function represents the index of the source element. - The type of elements of source. - A sequence that contains elements from the input sequence that occur before the element at which the test no longer passes. - source or predicate is a null reference (Nothing in Visual Basic). - The query was canceled with the token passed in through WithCancellation. - More than elements are enumerated by this query. - One or more exceptions occurred during the evaluation of the query. - - - Returns elements from a parallel sequence as long as a specified condition is true. - The sequence to return elements from. - A function to test each element for a condition. - The type of elements of source. - A sequence that contains the elements from the input sequence that occur before the element at which the test no longer passes. - source or predicate is a null reference (Nothing in Visual Basic). - The query was canceled with the token passed in through WithCancellation. - One or more exceptions occurred during the evaluation of the query. - - - Performs in parallel a subsequent ordering of the elements in a sequence in ascending order according to a key. - An OrderedParallelQuery{TSource} that contains elements to sort. - A function to extract a key from an element. - The type of elements of source. - The type of the key returned by keySelector. - An OrderedParallelQuery{TSource} whose elements are sorted according to a key. - source or keySelector is a null reference (Nothing in Visual Basic). - The query was canceled with the token passed in through WithCancellation. - One or more exceptions occurred during the evaluation of the query. - - - Performs in parallel a subsequent ordering of the elements in a sequence in ascending order by using a specified comparer. - An OrderedParallelQuery{TSource} that contains elements to sort. - A function to extract a key from an element. - An IComparer{TKey} to compare keys. - The type of elements of source. - The type of the key returned by keySelector. - An OrderedParallelQuery{TSource} whose elements are sorted according to a key. - source or keySelector is a null reference (Nothing in Visual Basic). - The query was canceled with the token passed in through WithCancellation. - One or more exceptions occurred during the evaluation of the query. - - - Performs in parallel a subsequent ordering of the elements in a sequence in descending order, according to a key. - An OrderedParallelQuery{TSource} that contains elements to sort. - A function to extract a key from an element. - The type of elements of source. - The type of the key returned by keySelector. - A sequence whose elements are sorted descending according to a key. - source or keySelector is a null reference (Nothing in Visual Basic). - The query was canceled with the token passed in through WithCancellation. - One or more exceptions occurred during the evaluation of the query. - - - Performs in parallel a subsequent ordering of the elements in a sequence in descending order by using a specified comparer. - An OrderedParallelQuery{TSource} that contains elements to sort. - A function to extract a key from an element. - An IComparer{TKey} to compare keys. - The type of elements of source. - The type of the key returned by keySelector. - A sequence whose elements are sorted descending according to a key. - source or keySelector is a null reference (Nothing in Visual Basic). - The query was canceled with the token passed in through WithCancellation. - One or more exceptions occurred during the evaluation of the query. - - - Creates an array from a . - A sequence to create an array from. - The type of the elements of source. - An array that contains the elements from the input sequence. - The query was canceled with the token passed in through WithCancellation. - source is a null reference (Nothing in Visual Basic). - One or more exceptions occurred during the evaluation of the query. - - - Creates a from a according to specified key selector and element selector functions. - A sequence to create a from. - A function to extract a key from each element. - A transform function to produce a result element value from each element. - The type of the elements of source. - The type of the key returned by keySelector. - The type of the value returned by elementSelector. - A that contains values of type TElement selected from the input sequence - The query was canceled with the token passed in through WithCancellation. - source or keySelector or elementSelector is a null reference (Nothing in Visual Basic). - keySelector produces a key that is a null reference (Nothing in Visual Basic). -or- keySelector produces duplicate keys for two elements. -or- One or more exceptions occurred during the evaluation of the query. - - - Creates a from a according to a specified key selector function, a comparer, and an element selector function. - A sequence to create a from. - A function to extract a key from each element. - A transform function to produce a result element value from each element. - An to compare keys. - The type of the elements of source. - The type of the key returned by keySelector. - The type of the value returned by elementSelector. - A that contains values of type TElement selected from the input sequence - The query was canceled with the token passed in through WithCancellation. - source or keySelector or elementSelector is a null reference (Nothing in Visual Basic). - keySelector produces a key that is a null reference (Nothing in Visual Basic). -or- keySelector produces duplicate keys for two elements. -or- One or more exceptions occurred during the evaluation of the query. - - - Creates a from a according to a specified key selector function. - A sequence to create a from. - A function to extract a key from each element. - The type of the elements of source. - The type of the key returned by keySelector. - A that contains keys and values. - The query was canceled with the token passed in through WithCancellation. - source or keySelector is a null reference (Nothing in Visual Basic). - keySelector produces a key that is a null reference (Nothing in Visual Basic). -or- keySelector produces duplicate keys for two elements. -or- One or more exceptions occurred during the evaluation of the query. - - - Creates a from a according to a specified key selector function and key comparer. - A sequence to create a from. - A function to extract a key from each element. - An to compare keys. - The type of the elements of source. - The type of the key returned by keySelector. - A that contains keys and values. - The query was canceled with the token passed in through WithCancellation. - source or keySelector is a null reference (Nothing in Visual Basic). - keySelector produces a key that is a null reference (Nothing in Visual Basic). -or- keySelector produces duplicate keys for two elements. -or- One or more exceptions occurred during the evaluation of the query. - - - Creates a from an . - A sequence to create a from. - The type of the elements of source. - A that contains elements from the input sequence. - The query was canceled with the token passed in through WithCancellation. - source is a null reference (Nothing in Visual Basic). - One or more exceptions occurred during the evaluation of the query. - - - Creates an from a according to a specified key selector function, a comparer and an element selector function. - The sequence to create a from. - A function to extract a key from each element. - A transform function to produce a result element value from each element. - An to compare keys. - The type of elements of source. - The type of the key returned by keySelector. - The type of the value returned by elementSelector. - A Lookup<(Of <(TKey, TElement>)>) that contains values of type TElement selected from the input sequence. - The query was canceled with the token passed in through WithCancellation. - source or keySelector or elementSelector is a null reference (Nothing in Visual Basic). - One or more exceptions occurred during the evaluation of the query. - - - Creates an from a according to specified key selector and element selector functions. - The sequence to create a from. - A function to extract a key from each element. - A transform function to produce a result element value from each element. - The type of elements of source. - The type of the key returned by keySelector. - The type of the value returned by elementSelector. - A that contains values of type TElement selected from the input sequence. - The query was canceled with the token passed in through WithCancellation. - source or keySelector or elementSelector is a null reference (Nothing in Visual Basic). - One or more exceptions occurred during the evaluation of the query. - - - Creates an from a according to a specified key selector function and key comparer. - The sequence to create a from. - A function to extract a key from each element. - An to compare keys. - The type of elements of source. - The type of the key returned by keySelector. - A that contains keys and values. - The query was canceled with the token passed in through WithCancellation. - source or keySelector or is a null reference (Nothing in Visual Basic). - One or more exceptions occurred during the evaluation of the query. - - - Creates an from a according to a specified key selector function. - The sequence to create a from. - A function to extract a key from each element. - The type of elements of source. - The type of the key returned by keySelector. - A that contains keys and values. - The query was canceled with the token passed in through WithCancellation. - source or keySelector is a null reference (Nothing in Visual Basic). - One or more exceptions occurred during the evaluation of the query. - - - This Union overload should never be called. This method is marked as obsolete and always throws when called. - This parameter is not used. - This parameter is not used. - This type parameter is not used. - This overload always throws a . - The exception that occurs when this method is called. - The query was canceled with the token passed in through WithCancellation. - One or more exceptions occurred during the evaluation of the query. - - - Produces the set union of two parallel sequences by using the default equality comparer. - A sequence whose distinct elements form the first set for the union. - A sequence whose distinct elements form the second set for the union. - The type of the elements of the input sequences. - A sequence that contains the elements from both input sequences, excluding duplicates. - first or second is a null reference (Nothing in Visual Basic). - The query was canceled with the token passed in through WithCancellation. - One or more exceptions occurred during the evaluation of the query. - - - This Union overload should never be called. This method is marked as obsolete and always throws when called. - This parameter is not used. - This parameter is not used. - This parameter is not used. - This type parameter is not used. - This overload always throws a . - The exception that occurs when this method is called. - The query was canceled with the token passed in through WithCancellation. - One or more exceptions occurred during the evaluation of the query. - - - Produces the set union of two parallel sequences by using a specified IEqualityComparer{T}. - A sequence whose distinct elements form the first set for the union. - A sequence whose distinct elements form the second set for the union. - An to compare values. - The type of the elements of the input sequences. - A sequence that contains the elements from both input sequences, excluding duplicates. - first or second is a null reference (Nothing in Visual Basic). - The query was canceled with the token passed in through WithCancellation. - One or more exceptions occurred during the evaluation of the query. - - - Filters in parallel a sequence of values based on a predicate. - A sequence to filter. - A function to test each element for a condition. - The type of the elements of source. - A sequence that contains elements from the input sequence that satisfy the condition. - source or predicate is a null reference (Nothing in Visual Basic). - The query was canceled with the token passed in through WithCancellation. - One or more exceptions occurred during the evaluation of the query. - - - Filters in parallel a sequence of values based on a predicate. Each element's index is used in the logic of the predicate function. - A sequence to filter. - A function to test each element for a condition. - The type of the elements of source. - A sequence that contains elements from the input sequence that satisfy the condition. - source or predicate is a null reference (Nothing in Visual Basic). - The query was canceled with the token passed in through WithCancellation. - More than elements are enumerated by the query. - One or more exceptions occurred during the evaluation of the query. - - - Sets the to associate with the query. - A ParallelQuery on which to set the option. - A cancellation token. - The type of elements of source. - ParallelQuery representing the same query as source, but with the registered cancellation token. - The associated with the cancellationToken has been disposed. - source is a null reference (Nothing in Visual Basic). - WithCancellation is used multiple times in the query. - - - Sets the degree of parallelism to use in a query. Degree of parallelism is the maximum number of concurrently executing tasks that will be used to process the query. - A ParallelQuery on which to set the limit on the degrees of parallelism. - The degree of parallelism for the query. The default value is Math.Min(, MAX_SUPPORTED_DOP) where MAX_SUPPORTED_DOP is 512. - The type of elements of source. - ParallelQuery representing the same query as source, with the limit on the degrees of parallelism set. - source is a null reference (Nothing in Visual Basic). - degreeOfParallelism is less than 1 or greater than 511. - WithDegreeOfParallelism is used multiple times in the query. - - - Sets the execution mode of the query. - A ParallelQuery on which to set the option. - The mode in which to execute the query. - The type of elements of source. - ParallelQuery representing the same query as source, but with the registered execution mode. - source is a null reference (Nothing in Visual Basic). - executionMode is not a valid value. - WithExecutionMode is used multiple times in the query. - - - Sets the merge options for this query, which specify how the query will buffer output. - A ParallelQuery on which to set the option. - The merge options to set for this query. - The type of elements of source. - ParallelQuery representing the same query as source, but with the registered merge options. - source is a null reference (Nothing in Visual Basic). - mergeOptions is not a valid value. - WithMergeOptions is used multiple times in the query. - - - This Zip overload should never be called. This method is marked as obsolete and always throws when invoked. - This parameter is not used. - This parameter is not used. - This parameter is not used. - This type parameter is not used. - This type parameter is not used. - This type parameter is not used. - This overload always throws a . - The exception that occurs when this method is called. - - - Merges in parallel two sequences by using the specified predicate function. - The first sequence to zip. - The second sequence to zip. - A function to create a result element from two matching elements. - The type of the elements of the first sequence. - The type of the elements of the second sequence. - The type of the return elements. - A sequence that has elements of type TResult that are obtained by performing resultSelector pairwise on two sequences. If the sequence lengths are unequal, this truncates to the length of the shorter sequence. - first or second or resultSelector is a null reference (Nothing in Visual Basic). - The query was canceled with the token passed in through WithCancellation. - One or more exceptions occurred during the evaluation of the query. - - - The query execution mode is a hint that specifies how the system should handle performance trade-offs when parallelizing queries. - - - This is the default setting. PLINQ will examine the query's structure and will only parallelize the query if will likely result in speedup. If the query structure indicates that speedup is not likely to be obtained, then PLINQ will execute the query as an ordinary LINQ to Objects query. - - - - Parallelize the entire query, even if that means using high-overhead algorithms. Use this flag in cases where you know that parallel execution of the query will result in speedup, but PLINQ in the Default mode would execute it as sequential. - - - - Specifies the preferred type of output merge to use in a query. In other words, it indicates how PLINQ should merge the results from the various partitions back into a single result sequence. This is a hint only, and may not be respected by the system when parallelizing all queries. - - - Use a merge with output buffers of a size chosen by the system. Results will accumulate into an output buffer before they are available to the consumer of the query. - - - - Use the default merge type, which is AutoBuffered. - - - - Use a merge with full output buffers. The system will accumulate all of the results before making any of them available to the consumer of the query. - - - - Use a merge without output buffers. As soon as result elements have been computed, make that element available to the consumer of the query. - - - - Represents a parallel sequence. - The type of element in the source sequence. - - - Returns an enumerator that iterates through the sequence. - An enumerator that iterates through the sequence. - - - Represents a parallel sequence. - - - Returns an enumerator that iterates through the sequence. - An enumerator that iterates through the sequence. - - - Provides a set of static (Shared in Visual Basic) methods for querying data structures that implement . - - - Applies an accumulator function over a sequence. The specified seed value is used as the initial accumulator value, and the specified function is used to select the result value. - A sequence to aggregate over. - The initial accumulator value. - An accumulator function to invoke on each element. - A function to transform the final accumulator value into the result value. - The type of the elements of source. - The type of the accumulator value. - The type of the resulting value. - The transformed final accumulator value. - source or func or selector is null. - - - Applies an accumulator function over a sequence. The specified seed value is used as the initial accumulator value. - A sequence to aggregate over. - The initial accumulator value. - An accumulator function to invoke on each element. - The type of the elements of source. - The type of the accumulator value. - The final accumulator value. - source or func is null. - - - Applies an accumulator function over a sequence. - A sequence to aggregate over. - An accumulator function to apply to each element. - The type of the elements of source. - The final accumulator value. - source or func is null. - source contains no elements. - - - Determines whether all the elements of a sequence satisfy a condition. - A sequence whose elements to test for a condition. - A function to test each element for a condition. - The type of the elements of source. - true if every element of the source sequence passes the test in the specified predicate, or if the sequence is empty; otherwise, false. - source or predicate is null. - - - Determines whether a sequence contains any elements. - A sequence to check for being empty. - The type of the elements of source. - true if the source sequence contains any elements; otherwise, false. - source is null. - - - Determines whether any element of a sequence satisfies a condition. - A sequence whose elements to test for a condition. - A function to test each element for a condition. - The type of the elements of source. - true if any elements in the source sequence pass the test in the specified predicate; otherwise, false. - source or predicate is null. - - - Converts an to an . - A sequence to convert. - An that represents the input sequence. - source does not implement for some T. - source is null. - - - Converts a generic to a generic . - A sequence to convert. - The type of the elements of source. - An that represents the input sequence. - source is null. - - - Computes the average of a sequence of values. - A sequence of values to calculate the average of. - The average of the sequence of values. - source is null. - source contains no elements. - - - Computes the average of a sequence of nullable values. - A sequence of nullable values to calculate the average of. - The average of the sequence of values, or null if the source sequence is empty or contains only null values. - source is null. - - - Computes the average of a sequence of nullable values. - A sequence of nullable values to calculate the average of. - The average of the sequence of values, or null if the source sequence is empty or contains only null values. - source is null. - - - Computes the average of a sequence of nullable values. - A sequence of nullable values to calculate the average of. - The average of the sequence of values, or null if the source sequence is empty or contains only null values. - source is null. - - - Computes the average of a sequence of nullable values. - A sequence of nullable values to calculate the average of. - The average of the sequence of values, or null if the source sequence is empty or contains only null values. - source is null. - - - Computes the average of a sequence of values. - A sequence of values to calculate the average of. - The average of the sequence of values. - source is null. - source contains no elements. - - - Computes the average of a sequence of values. - A sequence of values to calculate the average of. - The average of the sequence of values. - source is null. - source contains no elements. - - - Computes the average of a sequence of values. - A sequence of values to calculate the average of. - The average of the sequence of values. - source is null. - source contains no elements. - - - Computes the average of a sequence of values. - A sequence of values to calculate the average of. - The average of the sequence of values. - source is null. - source contains no elements. - - - Computes the average of a sequence of nullable values. - A sequence of nullable values to calculate the average of. - The average of the sequence of values, or null if the source sequence is empty or contains only null values. - source is null. - - - Computes the average of a sequence of values that is obtained by invoking a projection function on each element of the input sequence. - A sequence of values to calculate the average of. - A projection function to apply to each element. - The type of the elements of source. - The average of the sequence of values. - source or selector is null. - source contains no elements. - - - Computes the average of a sequence of nullable values that is obtained by invoking a projection function on each element of the input sequence. - A sequence of values to calculate the average of. - A projection function to apply to each element. - The type of the elements of source. - The average of the sequence of values, or null if the source sequence is empty or contains only null values. - source or selector is null. - - - Computes the average of a sequence of nullable values that is obtained by invoking a projection function on each element of the input sequence. - A sequence of values to calculate the average of. - A projection function to apply to each element. - The type of the elements of source. - The average of the sequence of values, or null if the source sequence is empty or contains only null values. - source or selector is null. - - - Computes the average of a sequence of nullable values that is obtained by invoking a projection function on each element of the input sequence. - A sequence of values to calculate the average of. - A projection function to apply to each element. - The type of the elements of source. - The average of the sequence of values, or null if the source sequence is empty or contains only null values. - source or selector is null. - - - Computes the average of a sequence of nullable values that is obtained by invoking a projection function on each element of the input sequence. - A sequence of values to calculate the average of. - A projection function to apply to each element. - The type of the elements of source. - The average of the sequence of values, or null if the source sequence is empty or contains only null values. - source or selector is null. - - - Computes the average of a sequence of values that is obtained by invoking a projection function on each element of the input sequence. - A sequence of values to calculate the average of. - A projection function to apply to each element. - The type of the elements of source. - The average of the sequence of values. - source or selector is null. - source contains no elements. - - - Computes the average of a sequence of values that is obtained by invoking a projection function on each element of the input sequence. - A sequence of values to calculate the average of. - A projection function to apply to each element. - The type of the elements of source. - The average of the sequence of values. - source or selector is null. - source contains no elements. - - - Computes the average of a sequence of values that is obtained by invoking a projection function on each element of the input sequence. - A sequence of values to calculate the average of. - A projection function to apply to each element. - The type of the elements of source. - The average of the sequence of values. - source or selector is null. - source contains no elements. - - - Computes the average of a sequence of values that is obtained by invoking a projection function on each element of the input sequence. - A sequence of values that are used to calculate an average. - A projection function to apply to each element. - The type of the elements of source. - The average of the sequence of values. - source or selector is null. - source contains no elements. - - - Computes the average of a sequence of nullable values that is obtained by invoking a projection function on each element of the input sequence. - A sequence of values to calculate the average of. - A projection function to apply to each element. - The type of the elements of source. - The average of the sequence of values, or null if the source sequence is empty or contains only null values. - source or selector is null. - - - Converts the elements of an to the specified type. - The that contains the elements to be converted. - The type to convert the elements of source to. - An that contains each element of the source sequence converted to the specified type. - source is null. - An element in the sequence cannot be cast to type TResult. - - - Concatenates two sequences. - The first sequence to concatenate. - The sequence to concatenate to the first sequence. - The type of the elements of the input sequences. - An that contains the concatenated elements of the two input sequences. - source1 or source2 is null. - - - Determines whether a sequence contains a specified element by using a specified . - An in which to locate item. - The object to locate in the sequence. - An to compare values. - The type of the elements of source. - true if the input sequence contains an element that has the specified value; otherwise, false. - source is null. - - - Determines whether a sequence contains a specified element by using the default equality comparer. - An in which to locate item. - The object to locate in the sequence. - The type of the elements of source. - true if the input sequence contains an element that has the specified value; otherwise, false. - source is null. - - - Returns the number of elements in a sequence. - The that contains the elements to be counted. - The type of the elements of source. - The number of elements in the input sequence. - source is null. - The number of elements in source is larger than . - - - Returns the number of elements in the specified sequence that satisfies a condition. - An that contains the elements to be counted. - A function to test each element for a condition. - The type of the elements of source. - The number of elements in the sequence that satisfies the condition in the predicate function. - source or predicate is null. - The number of elements in source is larger than . - - - Returns the elements of the specified sequence or the type parameter's default value in a singleton collection if the sequence is empty. - The to return a default value for if empty. - The type of the elements of source. - An that contains default(TSource) if source is empty; otherwise, source. - source is null. - - - Returns the elements of the specified sequence or the specified value in a singleton collection if the sequence is empty. - The to return the specified value for if empty. - The value to return if the sequence is empty. - The type of the elements of source. - An that contains defaultValue if source is empty; otherwise, source. - source is null. - - - Returns distinct elements from a sequence by using the default equality comparer to compare values. - The to remove duplicates from. - The type of the elements of source. - An that contains distinct elements from source. - source is null. - - - Returns distinct elements from a sequence by using a specified to compare values. - The to remove duplicates from. - An to compare values. - The type of the elements of source. - An that contains distinct elements from source. - source or comparer is null. - - - Returns the element at a specified index in a sequence. - An to return an element from. - The zero-based index of the element to retrieve. - The type of the elements of source. - The element at the specified position in source. - source is null. - index is less than zero. - - - Returns the element at a specified index in a sequence or a default value if the index is out of range. - An to return an element from. - The zero-based index of the element to retrieve. - The type of the elements of source. - default(TSource) if index is outside the bounds of source; otherwise, the element at the specified position in source. - source is null. - - - Produces the set difference of two sequences by using the specified to compare values. - An whose elements that are not also in source2 will be returned. - An whose elements that also occur in the first sequence will not appear in the returned sequence. - An to compare values. - The type of the elements of the input sequences. - An that contains the set difference of the two sequences. - source1 or source2 is null. - - - Produces the set difference of two sequences by using the default equality comparer to compare values. - An whose elements that are not also in source2 will be returned. - An whose elements that also occur in the first sequence will not appear in the returned sequence. - The type of the elements of the input sequences. - An that contains the set difference of the two sequences. - source1 or source2 is null. - - - Returns the first element of a sequence. - The to return the first element of. - The type of the elements of source. - The first element in source. - source is null. - The source sequence is empty. - - - Returns the first element of a sequence that satisfies a specified condition. - An to return an element from. - A function to test each element for a condition. - The type of the elements of source. - The first element in source that passes the test in predicate. - source or predicate is null. - No element satisfies the condition in predicate. -or- The source sequence is empty. - - - Returns the first element of a sequence, or a default value if the sequence contains no elements. - The to return the first element of. - The type of the elements of source. - default(TSource) if source is empty; otherwise, the first element in source. - source is null. - - - Returns the first element of a sequence that satisfies a specified condition or a default value if no such element is found. - An to return an element from. - A function to test each element for a condition. - The type of the elements of source. - default(TSource) if source is empty or if no element passes the test specified by predicate; otherwise, the first element in source that passes the test specified by predicate. - source or predicate is null. - - - Groups the elements of a sequence according to a specified key selector function and creates a result value from each group and its key. Keys are compared by using a specified comparer and the elements of each group are projected by using a specified function. - An whose elements to group. - A function to extract the key for each element. - A function to map each source element to an element in an . - A function to create a result value from each group. - An to compare keys. - The type of the elements of source. - The type of the key returned by the function represented in keySelector. - The type of the elements in each . - The type of the result value returned by resultSelector. - An T:System.Linq.IQueryable`1 that has a type argument of TResult and where each element represents a projection over a group and its key. - source or keySelector or elementSelector or resultSelector or comparer is null. - - - Groups the elements of a sequence according to a specified key selector function and creates a result value from each group and its key. The elements of each group are projected by using a specified function. - An whose elements to group. - A function to extract the key for each element. - A function to map each source element to an element in an . - A function to create a result value from each group. - The type of the elements of source. - The type of the key returned by the function represented in keySelector. - The type of the elements in each . - The type of the result value returned by resultSelector. - An T:System.Linq.IQueryable`1 that has a type argument of TResult and where each element represents a projection over a group and its key. - source or keySelector or elementSelector or resultSelector is null. - - - Groups the elements of a sequence according to a specified key selector function and projects the elements for each group by using a specified function. - An whose elements to group. - A function to extract the key for each element. - A function to map each source element to an element in an . - The type of the elements of source. - The type of the key returned by the function represented in keySelector. - The type of the elements in each . -

An IQueryable<><_tkey2c_ telement="">> in C# or IQueryable(Of IGrouping(Of TKey, TElement)) in Visual Basic where each contains a sequence of objects of type TElement and a key.

-
- source or keySelector or elementSelector is null. -
- - Groups the elements of a sequence and projects the elements for each group by using a specified function. Key values are compared by using a specified comparer. - An whose elements to group. - A function to extract the key for each element. - A function to map each source element to an element in an . - An to compare keys. - The type of the elements of source. - The type of the key returned by the function represented in keySelector. - The type of the elements in each . -

An IQueryable<><_tkey2c_ telement="">> in C# or IQueryable(Of IGrouping(Of TKey, TElement)) in Visual Basic where each contains a sequence of objects of type TElement and a key.

-
- source or keySelector or elementSelector or comparer is null. -
- - Groups the elements of a sequence according to a specified key selector function and creates a result value from each group and its key. - An whose elements to group. - A function to extract the key for each element. - A function to create a result value from each group. - The type of the elements of source. - The type of the key returned by the function represented in keySelector. - The type of the result value returned by resultSelector. - An T:System.Linq.IQueryable`1 that has a type argument of TResult and where each element represents a projection over a group and its key. - source or keySelector or resultSelector is null. - - - Groups the elements of a sequence according to a specified key selector function and creates a result value from each group and its key. Keys are compared by using a specified comparer. - An whose elements to group. - A function to extract the key for each element. - A function to create a result value from each group. - An to compare keys. - The type of the elements of source. - The type of the key returned by the function represented in keySelector. - The type of the result value returned by resultSelector. - An T:System.Linq.IQueryable`1 that has a type argument of TResult and where each element represents a projection over a group and its key. - source or keySelector or resultSelector or comparer is null. - - - Groups the elements of a sequence according to a specified key selector function and compares the keys by using a specified comparer. - An whose elements to group. - A function to extract the key for each element. - An to compare keys. - The type of the elements of source. - The type of the key returned by the function represented in keySelector. -

An IQueryable<><_tkey2c_ tsource="">> in C# or IQueryable(Of IGrouping(Of TKey, TSource)) in Visual Basic where each contains a sequence of objects and a key.

-
- source or keySelector or comparer is null. -
- - Groups the elements of a sequence according to a specified key selector function. - An whose elements to group. - A function to extract the key for each element. - The type of the elements of source. - The type of the key returned by the function represented in keySelector. -

An IQueryable<><_tkey2c_ tsource="">> in C# or IQueryable(Of IGrouping(Of TKey, TSource)) in Visual Basic where each object contains a sequence of objects and a key.

-
- source or keySelector is null. -
- - Correlates the elements of two sequences based on key equality and groups the results. The default equality comparer is used to compare keys. - The first sequence to join. - The sequence to join to the first sequence. - A function to extract the join key from each element of the first sequence. - A function to extract the join key from each element of the second sequence. - A function to create a result element from an element from the first sequence and a collection of matching elements from the second sequence. - The type of the elements of the first sequence. - The type of the elements of the second sequence. - The type of the keys returned by the key selector functions. - The type of the result elements. - An that contains elements of type TResult obtained by performing a grouped join on two sequences. - outer or inner or outerKeySelector or innerKeySelector or resultSelector is null. - - - Correlates the elements of two sequences based on key equality and groups the results. A specified is used to compare keys. - The first sequence to join. - The sequence to join to the first sequence. - A function to extract the join key from each element of the first sequence. - A function to extract the join key from each element of the second sequence. - A function to create a result element from an element from the first sequence and a collection of matching elements from the second sequence. - A comparer to hash and compare keys. - The type of the elements of the first sequence. - The type of the elements of the second sequence. - The type of the keys returned by the key selector functions. - The type of the result elements. - An that contains elements of type TResult obtained by performing a grouped join on two sequences. - outer or inner or outerKeySelector or innerKeySelector or resultSelector is null. - - - Produces the set intersection of two sequences by using the default equality comparer to compare values. - A sequence whose distinct elements that also appear in source2 are returned. - A sequence whose distinct elements that also appear in the first sequence are returned. - The type of the elements of the input sequences. - A sequence that contains the set intersection of the two sequences. - source1 or source2 is null. - - - Produces the set intersection of two sequences by using the specified to compare values. - An whose distinct elements that also appear in source2 are returned. - An whose distinct elements that also appear in the first sequence are returned. - An to compare values. - The type of the elements of the input sequences. - An that contains the set intersection of the two sequences. - source1 or source2 is null. - - - Correlates the elements of two sequences based on matching keys. The default equality comparer is used to compare keys. - The first sequence to join. - The sequence to join to the first sequence. - A function to extract the join key from each element of the first sequence. - A function to extract the join key from each element of the second sequence. - A function to create a result element from two matching elements. - The type of the elements of the first sequence. - The type of the elements of the second sequence. - The type of the keys returned by the key selector functions. - The type of the result elements. - An that has elements of type TResult obtained by performing an inner join on two sequences. - outer or inner or outerKeySelector or innerKeySelector or resultSelector is null. - - - Correlates the elements of two sequences based on matching keys. A specified is used to compare keys. - The first sequence to join. - The sequence to join to the first sequence. - A function to extract the join key from each element of the first sequence. - A function to extract the join key from each element of the second sequence. - A function to create a result element from two matching elements. - An to hash and compare keys. - The type of the elements of the first sequence. - The type of the elements of the second sequence. - The type of the keys returned by the key selector functions. - The type of the result elements. - An that has elements of type TResult obtained by performing an inner join on two sequences. - outer or inner or outerKeySelector or innerKeySelector or resultSelector is null. - - - Returns the last element in a sequence. - An to return the last element of. - The type of the elements of source. - The value at the last position in source. - source is null. - The source sequence is empty. - - - Returns the last element of a sequence that satisfies a specified condition. - An to return an element from. - A function to test each element for a condition. - The type of the elements of source. - The last element in source that passes the test specified by predicate. - source or predicate is null. - No element satisfies the condition in predicate. -or- The source sequence is empty. - - - Returns the last element of a sequence that satisfies a condition or a default value if no such element is found. - An to return an element from. - A function to test each element for a condition. - The type of the elements of source. - default(TSource) if source is empty or if no elements pass the test in the predicate function; otherwise, the last element of source that passes the test in the predicate function. - source or predicate is null. - - - Returns the last element in a sequence, or a default value if the sequence contains no elements. - An to return the last element of. - The type of the elements of source. - default(TSource) if source is empty; otherwise, the last element in source. - source is null. - - - Returns an that represents the total number of elements in a sequence. - An that contains the elements to be counted. - The type of the elements of source. - The number of elements in source. - source is null. - The number of elements exceeds . - - - Returns an that represents the number of elements in a sequence that satisfy a condition. - An that contains the elements to be counted. - A function to test each element for a condition. - The type of the elements of source. - The number of elements in source that satisfy the condition in the predicate function. - source or predicate is null. - The number of matching elements exceeds . - - - Invokes a projection function on each element of a generic and returns the maximum resulting value. - A sequence of values to determine the maximum of. - A projection function to apply to each element. - The type of the elements of source. - The type of the value returned by the function represented by selector. - The maximum value in the sequence. - source or selector is null. - - - Returns the maximum value in a generic . - A sequence of values to determine the maximum of. - The type of the elements of source. - The maximum value in the sequence. - source is null. - - - Invokes a projection function on each element of a generic and returns the minimum resulting value. - A sequence of values to determine the minimum of. - A projection function to apply to each element. - The type of the elements of source. - The type of the value returned by the function represented by selector. - The minimum value in the sequence. - source or selector is null. - - - Returns the minimum value of a generic . - A sequence of values to determine the minimum of. - The type of the elements of source. - The minimum value in the sequence. - source is null. - - - Filters the elements of an based on a specified type. - An whose elements to filter. - The type to filter the elements of the sequence on. - A collection that contains the elements from source that have type TResult. - source is null. - - - Sorts the elements of a sequence in ascending order by using a specified comparer. - A sequence of values to order. - A function to extract a key from an element. - An to compare keys. - The type of the elements of source. - The type of the key returned by the function that is represented by keySelector. - An whose elements are sorted according to a key. - source or keySelector or comparer is null. - - - Sorts the elements of a sequence in ascending order according to a key. - A sequence of values to order. - A function to extract a key from an element. - The type of the elements of source. - The type of the key returned by the function that is represented by keySelector. - An whose elements are sorted according to a key. - source or keySelector is null. - - - Sorts the elements of a sequence in descending order according to a key. - A sequence of values to order. - A function to extract a key from an element. - The type of the elements of source. - The type of the key returned by the function that is represented by keySelector. - An whose elements are sorted in descending order according to a key. - source or keySelector is null. - - - Sorts the elements of a sequence in descending order by using a specified comparer. - A sequence of values to order. - A function to extract a key from an element. - An to compare keys. - The type of the elements of source. - The type of the key returned by the function that is represented by keySelector. - An whose elements are sorted in descending order according to a key. - source or keySelector or comparer is null. - - - Inverts the order of the elements in a sequence. - A sequence of values to reverse. - The type of the elements of source. - An whose elements correspond to those of the input sequence in reverse order. - source is null. - - - Projects each element of a sequence into a new form by incorporating the element's index. - A sequence of values to project. - A projection function to apply to each element. - The type of the elements of source. - The type of the value returned by the function represented by selector. - An whose elements are the result of invoking a projection function on each element of source. - source or selector is null. - - - Projects each element of a sequence into a new form. - A sequence of values to project. - A projection function to apply to each element. - The type of the elements of source. - The type of the value returned by the function represented by selector. - An whose elements are the result of invoking a projection function on each element of source. - source or selector is null. - - - Projects each element of a sequence to an that incorporates the index of the source element that produced it. A result selector function is invoked on each element of each intermediate sequence, and the resulting values are combined into a single, one-dimensional sequence and returned. - A sequence of values to project. - A projection function to apply to each element of the input sequence; the second parameter of this function represents the index of the source element. - A projection function to apply to each element of each intermediate sequence. - The type of the elements of source. - The type of the intermediate elements collected by the function represented by collectionSelector. - The type of the elements of the resulting sequence. - An whose elements are the result of invoking the one-to-many projection function collectionSelector on each element of source and then mapping each of those sequence elements and their corresponding source element to a result element. - source or collectionSelector or resultSelector is null. - - - Projects each element of a sequence to an and invokes a result selector function on each element therein. The resulting values from each intermediate sequence are combined into a single, one-dimensional sequence and returned. - A sequence of values to project. - A projection function to apply to each element of the input sequence. - A projection function to apply to each element of each intermediate sequence. - The type of the elements of source. - The type of the intermediate elements collected by the function represented by collectionSelector. - The type of the elements of the resulting sequence. - An whose elements are the result of invoking the one-to-many projection function collectionSelector on each element of source and then mapping each of those sequence elements and their corresponding source element to a result element. - source or collectionSelector or resultSelector is null. - - - Projects each element of a sequence to an and combines the resulting sequences into one sequence. The index of each source element is used in the projected form of that element. - A sequence of values to project. - A projection function to apply to each element; the second parameter of this function represents the index of the source element. - The type of the elements of source. - The type of the elements of the sequence returned by the function represented by selector. - An whose elements are the result of invoking a one-to-many projection function on each element of the input sequence. - source or selector is null. - - - Projects each element of a sequence to an and combines the resulting sequences into one sequence. - A sequence of values to project. - A projection function to apply to each element. - The type of the elements of source. - The type of the elements of the sequence returned by the function represented by selector. - An whose elements are the result of invoking a one-to-many projection function on each element of the input sequence. - source or selector is null. - - - Determines whether two sequences are equal by using the default equality comparer to compare elements. - An whose elements to compare to those of source2. - An whose elements to compare to those of the first sequence. - The type of the elements of the input sequences. - true if the two source sequences are of equal length and their corresponding elements compare equal; otherwise, false. - source1 or source2 is null. - - - Determines whether two sequences are equal by using a specified to compare elements. - An whose elements to compare to those of source2. - An whose elements to compare to those of the first sequence. - An to use to compare elements. - The type of the elements of the input sequences. - true if the two source sequences are of equal length and their corresponding elements compare equal; otherwise, false. - source1 or source2 is null. - - - Returns the only element of a sequence, and throws an exception if there is not exactly one element in the sequence. - An to return the single element of. - The type of the elements of source. - The single element of the input sequence. - source is null. - source has more than one element. - - - Returns the only element of a sequence that satisfies a specified condition, and throws an exception if more than one such element exists. - An to return a single element from. - A function to test an element for a condition. - The type of the elements of source. - The single element of the input sequence that satisfies the condition in predicate. - source or predicate is null. - No element satisfies the condition in predicate. -or- More than one element satisfies the condition in predicate. -or- The source sequence is empty. - - - Returns the only element of a sequence, or a default value if the sequence is empty; this method throws an exception if there is more than one element in the sequence. - An to return the single element of. - The type of the elements of source. - The single element of the input sequence, or default(TSource) if the sequence contains no elements. - source is null. - source has more than one element. - - - Returns the only element of a sequence that satisfies a specified condition or a default value if no such element exists; this method throws an exception if more than one element satisfies the condition. - An to return a single element from. - A function to test an element for a condition. - The type of the elements of source. - The single element of the input sequence that satisfies the condition in predicate, or default(TSource) if no such element is found. - source or predicate is null. - More than one element satisfies the condition in predicate. - - - Bypasses a specified number of elements in a sequence and then returns the remaining elements. - An to return elements from. - The number of elements to skip before returning the remaining elements. - The type of the elements of source. - An that contains elements that occur after the specified index in the input sequence. - source is null. - - - Bypasses elements in a sequence as long as a specified condition is true and then returns the remaining elements. - An to return elements from. - A function to test each element for a condition. - The type of the elements of source. - An that contains elements from source starting at the first element in the linear series that does not pass the test specified by predicate. - source or predicate is null. - - - Bypasses elements in a sequence as long as a specified condition is true and then returns the remaining elements. The element's index is used in the logic of the predicate function. - An to return elements from. - A function to test each element for a condition; the second parameter of this function represents the index of the source element. - The type of the elements of source. - An that contains elements from source starting at the first element in the linear series that does not pass the test specified by predicate. - source or predicate is null. - - - Computes the sum of a sequence of values. - A sequence of values to calculate the sum of. - The sum of the values in the sequence. - source is null. - - - Computes the sum of a sequence of nullable values. - A sequence of nullable values to calculate the sum of. - The sum of the values in the sequence. - source is null. - - - Computes the sum of a sequence of nullable values. - A sequence of nullable values to calculate the sum of. - The sum of the values in the sequence. - source is null. - The sum is larger than . - - - Computes the sum of a sequence of nullable values. - A sequence of nullable values to calculate the sum of. - The sum of the values in the sequence. - source is null. - The sum is larger than . - - - Computes the sum of a sequence of nullable values. - A sequence of nullable values to calculate the sum of. - The sum of the values in the sequence. - source is null. - - - Computes the sum of a sequence of values. - A sequence of values to calculate the sum of. - The sum of the values in the sequence. - source is null. - - - Computes the sum of a sequence of values. - A sequence of values to calculate the sum of. - The sum of the values in the sequence. - source is null. - The sum is larger than . - - - Computes the sum of a sequence of values. - A sequence of values to calculate the sum of. - The sum of the values in the sequence. - source is null. - The sum is larger than . - - - Computes the sum of a sequence of nullable values. - A sequence of nullable values to calculate the sum of. - The sum of the values in the sequence. - source is null. - The sum is larger than . - - - Computes the sum of a sequence of values. - A sequence of values to calculate the sum of. - The sum of the values in the sequence. - source is null. - The sum is larger than . - - - Computes the sum of the sequence of nullable values that is obtained by invoking a projection function on each element of the input sequence. - A sequence of values of type TSource. - A projection function to apply to each element. - The type of the elements of source. - The sum of the projected values. - source or selector is null. - - - Computes the sum of the sequence of nullable values that is obtained by invoking a projection function on each element of the input sequence. - A sequence of values of type TSource. - A projection function to apply to each element. - The type of the elements of source. - The sum of the projected values. - source or selector is null. - The sum is larger than . - - - Computes the sum of the sequence of nullable values that is obtained by invoking a projection function on each element of the input sequence. - A sequence of values of type TSource. - A projection function to apply to each element. - The type of the elements of source. - The sum of the projected values. - source or selector is null. - The sum is larger than . - - - Computes the sum of the sequence of nullable values that is obtained by invoking a projection function on each element of the input sequence. - A sequence of values of type TSource. - A projection function to apply to each element. - The type of the elements of source. - The sum of the projected values. - source or selector is null. - - - Computes the sum of the sequence of values that is obtained by invoking a projection function on each element of the input sequence. - A sequence of values of type TSource. - A projection function to apply to each element. - The type of the elements of source. - The sum of the projected values. - source or selector is null. - - - Computes the sum of the sequence of values that is obtained by invoking a projection function on each element of the input sequence. - A sequence of values of type TSource. - A projection function to apply to each element. - The type of the elements of source. - The sum of the projected values. - source or selector is null. - The sum is larger than . - - - Computes the sum of the sequence of values that is obtained by invoking a projection function on each element of the input sequence. - A sequence of values of type TSource. - A projection function to apply to each element. - The type of the elements of source. - The sum of the projected values. - source or selector is null. - The sum is larger than . - - - Computes the sum of the sequence of values that is obtained by invoking a projection function on each element of the input sequence. - A sequence of values of type TSource. - A projection function to apply to each element. - The type of the elements of source. - The sum of the projected values. - source or selector is null. - - - Computes the sum of the sequence of values that is obtained by invoking a projection function on each element of the input sequence. - A sequence of values of type TSource. - A projection function to apply to each element. - The type of the elements of source. - The sum of the projected values. - source or selector is null. - The sum is larger than . - - - Computes the sum of the sequence of nullable values that is obtained by invoking a projection function on each element of the input sequence. - A sequence of values of type TSource. - A projection function to apply to each element. - The type of the elements of source. - The sum of the projected values. - source or selector is null. - The sum is larger than . - - - Returns a specified number of contiguous elements from the start of a sequence. - The sequence to return elements from. - The number of elements to return. - The type of the elements of source. - An that contains the specified number of elements from the start of source. - source is null. - - - Returns elements from a sequence as long as a specified condition is true. The element's index is used in the logic of the predicate function. - The sequence to return elements from. - A function to test each element for a condition; the second parameter of the function represents the index of the element in the source sequence. - The type of the elements of source. - An that contains elements from the input sequence occurring before the element at which the test specified by predicate no longer passes. - source or predicate is null. - - - Returns elements from a sequence as long as a specified condition is true. - The sequence to return elements from. - A function to test each element for a condition. - The type of the elements of source. - An that contains elements from the input sequence occurring before the element at which the test specified by predicate no longer passes. - source or predicate is null. - - - Performs a subsequent ordering of the elements in a sequence in ascending order according to a key. - An that contains elements to sort. - A function to extract a key from each element. - The type of the elements of source. - The type of the key returned by the function represented by keySelector. - An whose elements are sorted according to a key. - source or keySelector is null. - - - Performs a subsequent ordering of the elements in a sequence in ascending order by using a specified comparer. - An that contains elements to sort. - A function to extract a key from each element. - An to compare keys. - The type of the elements of source. - The type of the key returned by the function represented by keySelector. - An whose elements are sorted according to a key. - source or keySelector or comparer is null. - - - Performs a subsequent ordering of the elements in a sequence in descending order, according to a key. - An that contains elements to sort. - A function to extract a key from each element. - The type of the elements of source. - The type of the key returned by the function represented by keySelector. - An whose elements are sorted in descending order according to a key. - source or keySelector is null. - - - Performs a subsequent ordering of the elements in a sequence in descending order by using a specified comparer. - An that contains elements to sort. - A function to extract a key from each element. - An to compare keys. - The type of the elements of source. - The type of the key that is returned by the keySelector function. - A collection whose elements are sorted in descending order according to a key. - source or keySelector or comparer is null. - - - Produces the set union of two sequences by using the default equality comparer. - A sequence whose distinct elements form the first set for the union operation. - A sequence whose distinct elements form the second set for the union operation. - The type of the elements of the input sequences. - An that contains the elements from both input sequences, excluding duplicates. - source1 or source2 is null. - - - Produces the set union of two sequences by using a specified . - A sequence whose distinct elements form the first set for the union operation. - A sequence whose distinct elements form the second set for the union operation. - An to compare values. - The type of the elements of the input sequences. - An that contains the elements from both input sequences, excluding duplicates. - source1 or source2 is null. - - - Filters a sequence of values based on a predicate. Each element's index is used in the logic of the predicate function. - An to filter. - A function to test each element for a condition; the second parameter of the function represents the index of the element in the source sequence. - The type of the elements of source. - An that contains elements from the input sequence that satisfy the condition specified by predicate. - source or predicate is null. - - - Filters a sequence of values based on a predicate. - An to filter. - A function to test each element for a condition. - The type of the elements of source. - An that contains elements from the input sequence that satisfy the condition specified by predicate. - source or predicate is null. - - - Merges two sequences by using the specified predicate function. - The first sequence to merge. - The second sequence to merge. - A function that specifies how to merge the elements from the two sequences. - The type of the elements of the first input sequence. - The type of the elements of the second input sequence. - The type of the elements of the result sequence. - An that contains merged elements of two input sequences. - source1 or source2 is null. - - - An enumeration used with the class to specify loader optimizations for an executable. - - - Ignored by the common language runtime. - - - - Do not use. This mask selects the domain-related values, screening out the unused flag. - - - - Indicates that the application will probably have many domains that use the same code, and the loader must share maximal internal resources across application domains. - - - - Indicates that the application will probably host unique code in multiple domains, and the loader must share resources across application domains only for globally available (strong-named) assemblies that have been added to the global assembly cache. - - - - Indicates that no optimizations for sharing internal resources are specified. If the default domain or hosting interface specified an optimization, then the loader uses that; otherwise, the loader uses . - - - - Indicates that the application will probably have a single domain, and loader must not share internal resources across application domains. - - - - Used to set the default loader optimization policy for the main method of an executable application. - - - Initializes a new instance of the class to the specified value. - A value equivalent to a constant. - - - Initializes a new instance of the class to the specified value. - A constant. - - - Gets the current value for this instance. - A constant. - - - Encapsulates a memory slot to store local data. This class cannot be inherited. - - - Represents an element in a array. - - - Initializes a new instance of the class using the specified buffer. - A byte array of data to send using the method. - The buffer parameter cannot be null - - - Initializes a new instance of the class using the specified file. - The filename of the file to be transmitted using the method. - The filepath parameter cannot be null - - - Initializes a new instance of the class using the specified buffer, buffer offset, and count. - A byte array of data to send using the method. - The offset, in bytes, from the beginning of the buffer to the location in the buffer to start sending the data specified in the buffer parameter. - The number of bytes to send starting from the offset parameter. If count is zero, no bytes are sent. - The buffer parameter cannot be null - The offset and count parameters must be greater than or equal to zero. The offset and count must be less than the size of the buffer - - - Initializes a new instance of the class using the specified filename path, offset, and count. - The filename of the file to be transmitted using the method. - The offset, in bytes, from the beginning of the file to the location in the file to start sending the file specified in the filepath parameter. - The number of bytes to send starting from the offset parameter. If count is zero, the entire file is sent. - The filepath parameter cannot be null - The offset and count parameters must be greater than or equal to zero. The offset and count must be less than the size of the file indicated by the filepath parameter. - - - Initializes a new instance of the class using the specified buffer, buffer offset, and count with an option to combine this element with the next element in a single send request from the sockets layer to the transport. - A byte array of data to send using the method. - The offset, in bytes, from the beginning of the buffer to the location in the buffer to start sending the data specified in the buffer parameter. - The number bytes to send starting from the offset parameter. If count is zero, no bytes are sent. - A Boolean value that specifies that this element should not be combined with the next element in a single send request from the sockets layer to the transport. This flag is used for granular control of the content of each message on a datagram or message-oriented socket. - The buffer parameter cannot be null - The offset and count parameters must be greater than or equal to zero. The offset and count must be less than the size of the buffer - - - Initializes a new instance of the class using the specified filename path, buffer offset, and count with an option to combine this element with the next element in a single send request from the sockets layer to the transport. - The filename of the file to be transmitted using the method. - The offset, in bytes, from the beginning of the file to the location in the file to start sending the file specified in the filepath parameter. - The number of bytes to send starting from the offset parameter. If count is zero, the entire file is sent. - A Boolean value that specifies that this element should not be combined with the next element in a single send request from the sockets layer to the transport. This flag is used for granular control of the content of each message on a datagram or message-oriented socket. - The filepath parameter cannot be null - The offset and count parameters must be greater than or equal to zero. The offset and count must be less than the size of the file indicated by the filepath parameter. - - - Gets the buffer to be sent if the class was initialized with a buffer parameter. - The byte buffer to send if the class was initialized with a buffer parameter. - - - Gets the count of bytes to be sent. - The count of bytes to send if the class was initialized with a count parameter. - - - Gets a Boolean value that indicates if this element should not be combined with the next element in a single send request from the sockets layer to the transport. - A Boolean value that indicates if this element should not be combined with the next element in a single send request. - - - Gets the filename of the file to send if the class was initialized with a filepath parameter. - The filename of the file to send if the class was initialized with a filepath parameter. - - - Gets the offset, in bytes, from the beginning of the data buffer or file to the location in the buffer or file to start sending the data. - The offset, in bytes, from the beginning of the data buffer or file to the location in the buffer or file to start sending the data. - - - Implements the Berkeley sockets interface. - - - Initializes a new instance of the class using the specified value returned from . - The socket information returned by . - - - Initializes a new instance of the class using the specified socket type and protocol. - One of the values. - One of the values. - The combination of socketType and protocolType results in an invalid socket. - - - Initializes a new instance of the class using the specified address family, socket type and protocol. - One of the values. - One of the values. - One of the values. - The combination of addressFamily, socketType, and protocolType results in an invalid socket. - - - Creates a new for a newly created connection. - A for a newly created connection. - An error occurred when attempting to access the socket. - The has been closed. - The accepting socket is not listening for connections. You must call and before calling . - - - Begins an asynchronous operation to accept an incoming connection attempt. - The object to use for this asynchronous socket operation. - Returns true if the I/O operation is pending. The event on the e parameter will be raised upon completion of the operation. Returns false if the I/O operation completed synchronously. The event on the e parameter will not be raised and the e object passed as a parameter may be examined immediately after the method call returns to retrieve the result of the operation. - An argument is not valid. This exception occurs if the buffer provided is not large enough. The buffer must be at least 2 * (sizeof(SOCKADDR_STORAGE + 16) bytes. This exception also occurs if multiple buffers are specified, the property is not null. - An argument is out of range. The exception occurs if the is less than 0. - An invalid operation was requested. This exception occurs if the accepting is not listening for connections or the accepted socket is bound. You must call the and method before calling the method. This exception also occurs if the socket is already connected or a socket operation was already in progress using the specified e parameter. - An error occurred when attempting to access the socket. - Windows XP or later is required for this method. - The has been closed. - - - Gets the address family of the . - One of the values. - - - Gets the amount of data that has been received from the network and is available to be read. - The number of bytes of data received from the network and available to be read. - An error occurred when attempting to access the socket. - The has been closed. - - - Begins an asynchronous operation to accept an incoming connection attempt from a specified socket and receives the first block of data sent by the client application. - The accepted object. This value may be null. - The maximum number of bytes to receive. - The delegate. - An object that contains state information for this request. - An object that references the asynchronous object creation. - The object has been closed. - Windows NT is required for this method. - The accepting socket is not listening for connections. You must call and before calling . -or- The accepted socket is bound. - receiveSize is less than 0. - An error occurred when attempting to access the socket. - - - Begins an asynchronous operation to accept an incoming connection attempt and receives the first block of data sent by the client application. - The number of bytes to accept from the sender. - The delegate. - An object that contains state information for this request. - An that references the asynchronous creation. - The object has been closed. - Windows NT is required for this method. - The accepting socket is not listening for connections. You must call and before calling . -or- The accepted socket is bound. - receiveSize is less than 0. - An error occurred when attempting to access the socket. - - - Begins an asynchronous operation to accept an incoming connection attempt. - The delegate. - An object that contains state information for this request. - An that references the asynchronous creation. - The object has been closed. - Windows NT is required for this method. - The accepting socket is not listening for connections. You must call and before calling . -or- The accepted socket is bound. - receiveSize is less than 0. - An error occurred when attempting to access the socket. - - - Begins an asynchronous request for a remote host connection. - - The delegate. - An object that contains state information for this request. - An that references the asynchronous connection. - remoteEP is null. - An error occurred when attempting to access the socket. - The has been closed. - A caller higher in the call stack does not have permission for the requested operation. - The is ing. - - - Begins an asynchronous request for a remote host connection. The host is specified by an and a port number. - The of the remote host. - The port number of the remote host. - - A user-defined object that contains information about the connect operation. This object is passed to the requestCallback delegate when the operation is complete. - An that references the asynchronous connection. - address is null. - An error occurred when attempting to access the socket. - The has been closed. - The is not in the socket family. - The port number is not valid. - The length of address is zero. - The is ing. - - - Begins an asynchronous request for a remote host connection. The host is specified by an array and a port number. - At least one , designating the remote host. - The port number of the remote host. - - A user-defined object that contains information about the connect operation. This object is passed to the requestCallback delegate when the operation is complete. - An that references the asynchronous connections. - addresses is null. - An error occurred when attempting to access the socket. - The has been closed. - This method is valid for sockets that use or . - The port number is not valid. - The length of address is zero. - The is ing. - - - Begins an asynchronous request for a remote host connection. The host is specified by a host name and a port number. - The name of the remote host. - The port number of the remote host. - - A user-defined object that contains information about the connect operation. This object is passed to the requestCallback delegate when the operation is complete. - An that references the asynchronous connection. - host is null. - The has been closed. - This method is valid for sockets in the or families. - The port number is not valid. - The is ing. - - - Begins an asynchronous request to disconnect from a remote endpoint. - true if this socket can be reused after the connection is closed; otherwise, false. - The delegate. - An object that contains state information for this request. - An object that references the asynchronous operation. - The operating system is Windows 2000 or earlier, and this method requires Windows XP. - The object has been closed. - An error occurred when attempting to access the socket. - - - Begins to asynchronously receive data from a connected . - An array of type that is the storage location for the received data. - The location in buffer to store the received data. - The number of bytes to receive. - - - An delegate that references the method to invoke when the operation is complete. - A user-defined object that contains information about the receive operation. This object is passed to the delegate when the operation is complete. - An that references the asynchronous read. - buffer is null. - An error occurred when attempting to access the socket. - has been closed. - offset is less than 0. -or- offset is greater than the length of buffer. -or- size is less than 0. -or- size is greater than the length of buffer minus the value of the offset parameter. - - - Begins to asynchronously receive data from a connected . - An array of type that is the storage location for the received data. - The zero-based position in the buffer parameter at which to store the received data. - The number of bytes to receive. - - An delegate that references the method to invoke when the operation is complete. - A user-defined object that contains information about the receive operation. This object is passed to the delegate when the operation is complete. - An that references the asynchronous read. - buffer is null. - An error occurred when attempting to access the socket. - has been closed. - offset is less than 0. -or- offset is greater than the length of buffer. -or- size is less than 0. -or- size is greater than the length of buffer minus the value of the offset parameter. - - - Begins to asynchronously receive data from a connected . - An array of type that is the storage location for the received data. - A bitwise combination of the values. - An delegate that references the method to invoke when the operation is complete. - A user-defined object that contains information about the receive operation. This object is passed to the delegate when the operation is complete. - An that references the asynchronous read. - buffer is null. - An error occurred when attempting to access the socket. - has been closed. - - - Begins to asynchronously receive data from a connected . - An array of type that is the storage location for the received data. - A bitwise combination of the values. - A object that stores the socket error. - An delegate that references the method to invoke when the operation is complete. - A user-defined object that contains information about the receive operation. This object is passed to the delegate when the operation is complete. - An that references the asynchronous read. - buffer is null. - An error occurred when attempting to access the socket. - has been closed. - - - Begins to asynchronously receive data from a specified network device. - An array of type that is the storage location for the received data. - The zero-based position in the buffer parameter at which to store the data. - The number of bytes to receive. - - - The delegate. - An object that contains state information for this request. - An that references the asynchronous read. - buffer is null. -or- remoteEP is null. - An error occurred when attempting to access the socket. - offset is less than 0. -or- offset is greater than the length of buffer. -or- size is less than 0. -or- size is greater than the length of buffer minus the value of the offset parameter. - The has been closed. - A caller higher in the call stack does not have permission for the requested operation. - - - Begins to asynchronously receive the specified number of bytes of data into the specified location of the data buffer, using the specified , and stores the endpoint and packet information.. - An array of type that is the storage location for the received data. - The zero-based position in the buffer parameter at which to store the data. - The number of bytes to receive. - A bitwise combination of the values. - An that represents the source of the data. - The delegate. - An object that contains state information for this request. - An that references the asynchronous read. - buffer is null. -or- remoteEP is null. - An error occurred when attempting to access the socket. - offset is less than 0. -or- offset is greater than the length of buffer. -or- size is less than 0. -or- size is greater than the length of buffer minus the value of the offset parameter. - The has been closed. - The operating system is Windows 2000 or earlier, and this method requires Windows XP. - - - Sends data asynchronously to a connected . - An array of type that contains the data to send. - A bitwise combination of the values. - The delegate. - An object that contains state information for this request. - An that references the asynchronous send. - buffers is null. - buffers is empty. - An error occurred when attempting to access the socket. See remarks section below. - The has been closed. - - - Sends data asynchronously to a connected . - An array of type that contains the data to send. - A bitwise combination of the values. - A object that stores the socket error. - The delegate. - An object that contains state information for this request. - An that references the asynchronous send. - buffers is null. - buffers is empty. - An error occurred when attempting to access the socket. See remarks section below. - The has been closed. - - - Sends data asynchronously to a connected . - An array of type that contains the data to send. - The zero-based position in the buffer parameter at which to begin sending data. - The number of bytes to send. - - The delegate. - An object that contains state information for this request. - An that references the asynchronous send. - buffer is null. - An error occurred when attempting to access the socket. See remarks section below. - offset is less than 0. -or- offset is less than the length of buffer. -or- size is less than 0. -or- size is greater than the length of buffer minus the value of the offset parameter. - The has been closed. - - - Sends data asynchronously to a connected . - An array of type that contains the data to send. - The zero-based position in the buffer parameter at which to begin sending data. - The number of bytes to send. - A bitwise combination of the values. - A object that stores the socket error. - The delegate. - An object that contains state information for this request. - An that references the asynchronous send. - buffer is null. - An error occurred when attempting to access the socket. See remarks section below. - offset is less than 0. -or- offset is less than the length of buffer. -or- size is less than 0. -or- size is greater than the length of buffer minus the value of the offset parameter. - The has been closed. - - - Sends the file fileName to a connected object using the flag. - A string that contains the path and name of the file to send. This parameter can be null. - The delegate. - An object that contains state information for this request. - An object that represents the asynchronous send. - The object has been closed. - The socket is not connected to a remote host. - The file fileName was not found. - An error occurred when attempting to access the socket. See remarks section below. - - - Sends a file and buffers of data asynchronously to a connected object. - A string that contains the path and name of the file to be sent. This parameter can be null. - A array that contains data to be sent before the file is sent. This parameter can be null. - A array that contains data to be sent after the file is sent. This parameter can be null. - A bitwise combination of values. - An delegate to be invoked when this operation completes. This parameter can be null. - A user-defined object that contains state information for this request. This parameter can be null. - An object that represents the asynchronous operation. - The object has been closed. - An error occurred when attempting to access the socket. See remarks section below. - The operating system is not Windows NT or later. - or - The socket is not connected to a remote host. - The file fileName was not found. - - - Sends data asynchronously to a specific remote host. - An array of type that contains the data to send. - The zero-based position in buffer at which to begin sending data. - The number of bytes to send. - - - The delegate. - An object that contains state information for this request. - An that references the asynchronous send. - buffer is null. -or- remoteEP is null. - An error occurred when attempting to access the socket. - offset is less than 0. -or- offset is greater than the length of buffer. -or- size is less than 0. -or- size is greater than the length of buffer minus the value of the offset parameter. - The has been closed. - A caller higher in the call stack does not have permission for the requested operation. - - - Associates a with a local endpoint. - The local to associate with the . - localEP is null. - An error occurred when attempting to access the socket. - The has been closed. - A caller higher in the call stack does not have permission for the requested operation. - - - Gets or sets a value that indicates whether the is in blocking mode. - true if the will block; otherwise, false. The default is true. - An error occurred when attempting to access the socket. - The has been closed. - - - Cancels an asynchronous request for a remote host connection. - The object used to request the connection to the remote host by calling one of the methods. - The e parameter cannot be null and the cannot be null. - An error occurred when attempting to access the socket. - The has been closed. - A caller higher in the call stack does not have permission for the requested operation. - - - Closes the connection and releases all associated resources with a specified timeout to allow queued data to be sent. - Wait up to timeout seconds to send any remaining data, then close the socket. - - - Closes the connection and releases all associated resources. - - - Establishes a connection to a remote host. - An that represents the remote device. - remoteEP is null. - An error occurred when attempting to access the socket. - The has been closed. - A caller higher in the call stack does not have permission for the requested operation. - The is ing. - - - Establishes a connection to a remote host. The host is specified by an IP address and a port number. - The IP address of the remote host. - The port number of the remote host. - address is null. - The port number is not valid. - An error occurred when attempting to access the socket. - The has been closed. - This method is valid for sockets in the or families. - The length of address is zero. - The is ing. - - - Establishes a connection to a remote host. The host is specified by an array of IP addresses and a port number. - The IP addresses of the remote host. - The port number of the remote host. - addresses is null. - The port number is not valid. - An error occurred when attempting to access the socket. - The has been closed. - This method is valid for sockets in the or families. - The length of address is zero. - The is ing. - - - Establishes a connection to a remote host. The host is specified by a host name and a port number. - The name of the remote host. - The port number of the remote host. - host is null. - The port number is not valid. - An error occurred when attempting to access the socket. - The has been closed. - This method is valid for sockets in the or families. - The is ing. - - - Begins an asynchronous request for a connection to a remote host. - The object to use for this asynchronous socket operation. - Returns true if the I/O operation is pending. The event on the e parameter will be raised upon completion of the operation. Returns false if the I/O operation completed synchronously. In this case, The event on the e parameter will not be raised and the e object passed as a parameter may be examined immediately after the method call returns to retrieve the result of the operation. - An argument is not valid. This exception occurs if multiple buffers are specified, the property is not null. - The e parameter cannot be null and the cannot be null. - The is listening or a socket operation was already in progress using the object specified in the e parameter. - An error occurred when attempting to access the socket. - Windows XP or later is required for this method. This exception also occurs if the local endpoint and the are not the same address family. - The has been closed. - A caller higher in the call stack does not have permission for the requested operation. - - - Begins an asynchronous request for a connection to a remote host. - One of the values. - One of the values. - The object to use for this asynchronous socket operation. - Returns true if the I/O operation is pending. The event on the e parameter will be raised upon completion of the operation. Returns false if the I/O operation completed synchronously. In this case, The event on the e parameter will not be raised and the e object passed as a parameter may be examined immediately after the method call returns to retrieve the result of the operation. - An argument is not valid. This exception occurs if multiple buffers are specified, the property is not null. - The e parameter cannot be null and the cannot be null. - The is listening or a socket operation was already in progress using the object specified in the e parameter. - An error occurred when attempting to access the socket. - Windows XP or later is required for this method. This exception also occurs if the local endpoint and the are not the same address family. - The has been closed. - A caller higher in the call stack does not have permission for the requested operation. - - - Gets a value that indicates whether a is connected to a remote host as of the last or operation. - true if the was connected to a remote resource as of the most recent operation; otherwise, false. - - - Closes the socket connection and allows reuse of the socket. - true if this socket can be reused after the current connection is closed; otherwise, false. - This method requires Windows 2000 or earlier, or the exception will be thrown. - The object has been closed. - An error occurred when attempting to access the socket. - - - Begins an asynchronous request to disconnect from a remote endpoint. - The object to use for this asynchronous socket operation. - Returns true if the I/O operation is pending. The event on the e parameter will be raised upon completion of the operation. Returns false if the I/O operation completed synchronously. In this case, The event on the e parameter will not be raised and the e object passed as a parameter may be examined immediately after the method call returns to retrieve the result of the operation. - The e parameter cannot be null. - A socket operation was already in progress using the object specified in the e parameter. - Windows XP or later is required for this method. - The has been closed. - An error occurred when attempting to access the socket. - - - Releases all resources used by the current instance of the class. - - - Releases the unmanaged resources used by the , and optionally disposes of the managed resources. - true to release both managed and unmanaged resources; false to releases only unmanaged resources. - - - Gets or sets a value that specifies whether the allows Internet Protocol (IP) datagrams to be fragmented. - true if the allows datagram fragmentation; otherwise, false. The default is true. - This property can be set only for sockets in the or families. - An error occurred when attempting to access the socket. - The has been closed. - - - Gets or sets a value that specifies whether the is a dual-mode socket used for both IPv4 and IPv6. - true if the is a dual-mode socket; otherwise, false. The default is false. - - - Duplicates the socket reference for the target process, and closes the socket for this process. - The ID of the target process where a duplicate of the socket reference is created. - The socket reference to be passed to the target process. - targetProcessID is not a valid process id. -or- Duplication of the socket reference failed. - - - Gets or sets a value that specifies whether the can send or receive broadcast packets. - true if the allows broadcast packets; otherwise, false. The default is false. - This option is valid for a datagram socket only. - The has been closed. - - - Asynchronously accepts an incoming connection attempt and creates a new object to handle remote host communication. This method returns a buffer that contains the initial data and the number of bytes transferred. - An array of type that contains the bytes transferred. - The number of bytes transferred. - An object that stores state information for this asynchronous operation as well as any user defined data. - A object to handle communication with the remote host. - Windows NT is required for this method. - The object has been closed. - asyncResult is empty. - asyncResult was not created by a call to . - method was previously called. - An error occurred when attempting to access the . - - - Asynchronously accepts an incoming connection attempt and creates a new to handle remote host communication. - - A to handle communication with the remote host. - result is null. - result was not created by a call to . - An error occurred when attempting to access the socket. See the Remarks section for more information. - The has been closed. - method was previously called. - Windows NT is required for this method. - - - Asynchronously accepts an incoming connection attempt and creates a new object to handle remote host communication. This method returns a buffer that contains the initial data transferred. - An array of type that contains the bytes transferred. - An object that stores state information for this asynchronous operation as well as any user defined data. - A object to handle communication with the remote host. - Windows NT is required for this method. - The object has been closed. - asyncResult is empty. - asyncResult was not created by a call to . - method was previously called. - An error occurred when attempting to access the - - - Ends a pending asynchronous connection request. - - result is null. - result was not returned by a call to the method. - was previously called for the asynchronous connection. - An error occurred when attempting to access the socket. - The has been closed. - - - Ends a pending asynchronous disconnect request. - An object that stores state information and any user-defined data for this asynchronous operation. - The operating system is Windows 2000 or earlier, and this method requires Windows XP. - The object has been closed. - asyncResult is null. - asyncResult was not returned by a call to the method. - was previously called for the asynchronous connection. - An error occurred when attempting to access the socket. - The disconnect request has timed out. - - - Ends a pending asynchronous read. - - The number of bytes received. - result is null. - result was not returned by a call to the method. - was previously called for the asynchronous read. - An error occurred when attempting to access the socket. - The has been closed. - - - Ends a pending asynchronous read. - An that stores state information and any user defined data for this asynchronous operation. - A object that stores the socket error. - The number of bytes received. - asyncResult is null. - asyncResult was not returned by a call to the method. - was previously called for the asynchronous read. - An error occurred when attempting to access the socket. - The has been closed. - - - Ends a pending asynchronous read from a specific endpoint. - - - If successful, the number of bytes received. If unsuccessful, returns 0. - asyncResult is null. - asyncResult was not returned by a call to the method. - was previously called for the asynchronous read. - An error occurred when attempting to access the socket. - The has been closed. - - - Ends a pending asynchronous read from a specific endpoint. This method also reveals more information about the packet than . - An that stores state information and any user defined data for this asynchronous operation. - A bitwise combination of the values for the received packet. - The source . - The and interface of the received packet. - If successful, the number of bytes received. If unsuccessful, returns 0. - asyncResult is null -or- endPoint is null. - asyncResult was not returned by a call to the method. - was previously called for the asynchronous read. - An error occurred when attempting to access the socket. - The has been closed. - - - Ends a pending asynchronous send. - - If successful, the number of bytes sent to the ; otherwise, an invalid error. - result is null. - result was not returned by a call to the method. - was previously called for the asynchronous send. - An error occurred when attempting to access the socket. - The has been closed. - - - Ends a pending asynchronous send. - An that stores state information for this asynchronous operation. - A object that stores the socket error. - If successful, the number of bytes sent to the ; otherwise, an invalid error. - asyncResult is null. - asyncResult was not returned by a call to the method. - was previously called for the asynchronous send. - An error occurred when attempting to access the socket. - The has been closed. - - - Ends a pending asynchronous send of a file. - An object that stores state information for this asynchronous operation. - Windows NT is required for this method. - The object has been closed. - asyncResult is empty. - asyncResult was not returned by a call to the method. - was previously called for the asynchronous . - An error occurred when attempting to access the socket. See remarks section below. - - - Ends a pending asynchronous send to a specific location. - - If successful, the number of bytes sent; otherwise, an invalid error. - result is null. - result was not returned by a call to the method. - was previously called for the asynchronous send. - An error occurred when attempting to access the socket. - The has been closed. - - - Gets or sets a value that specifies whether the allows only one process to bind to a port. - true if the allows only one socket to bind to a specific port; otherwise, false. The default is true for Windows Server 2003 and Windows XP Service Pack 2, and false for all other versions. - An error occurred when attempting to access the socket. - The has been closed. - has been called for this . - - - Frees resources used by the class. - - - Returns the value of the specified option in an array. - One of the values. - One of the values. - The length, in bytes, of the expected return value. - An array of type that contains the value of the socket option. - An error occurred when attempting to access the socket. - or - In .NET Compact Framework applications, the Windows CE default buffer space is set to 32768 bytes. You can change the per socket buffer space by calling . - The has been closed. - - - Returns the specified option setting, represented as a byte array. - One of the values. - One of the values. - An array of type that is to receive the option setting. - An error occurred when attempting to access the socket. - or - In .NET Compact Framework applications, the Windows CE default buffer space is set to 32768 bytes. You can change the per socket buffer space by calling . - The has been closed. - - - Returns the value of a specified option, represented as an object. - One of the values. - One of the values. - An object that represents the value of the option. When the optionName parameter is set to the return value is an instance of the class. When optionName is set to or , the return value is an instance of the class. When optionName is any other value, the return value is an integer. - An error occurred when attempting to access the socket. -or- optionName was set to the unsupported value . - The has been closed. - - - Gets the operating system handle for the . - An that represents the operating system handle for the . - - - Sets low-level operating modes for the using numerical control codes. - An value that specifies the control code of the operation to perform. - A array that contains the input data required by the operation. - A array that contains the output data returned by the operation. - The number of bytes in the optionOutValue parameter. - An error occurred when attempting to access the socket. - The has been closed. - An attempt was made to change the blocking mode without using the property. - A caller in the call stack does not have the required permissions. - - - Sets low-level operating modes for the using the enumeration to specify control codes. - A value that specifies the control code of the operation to perform. - An array of type that contains the input data required by the operation. - An array of type that contains the output data returned by the operation. - The number of bytes in the optionOutValue parameter. - An error occurred when attempting to access the socket. - The has been closed. - An attempt was made to change the blocking mode without using the property. - - - Gets a value that indicates whether the is bound to a specific local port. - true if the is bound to a local port; otherwise, false. - - - Gets or sets a value that specifies whether the will delay closing a socket in an attempt to send all pending data. - A that specifies how to linger while closing a socket. - An error occurred when attempting to access the socket. - The has been closed. - - - Places a in a listening state. - The maximum length of the pending connections queue. - An error occurred when attempting to access the socket. - The has been closed. - - - Gets the local endpoint. - The that the is using for communications. - An error occurred when attempting to access the socket. - The has been closed. - - - Gets or sets a value that specifies whether outgoing multicast packets are delivered to the sending application. - true if the receives outgoing multicast packets; otherwise, false. - An error occurred when attempting to access the socket. - The has been closed. - - - Gets or sets a value that specifies whether the stream is using the Nagle algorithm. - false if the uses the Nagle algorithm; otherwise, true. The default is false. - An error occurred when attempting to access the . - The has been closed. - - - Indicates whether the underlying operating system and network adaptors support Internet Protocol version 4 (IPv4). - true if the operating system and network adaptors support the IPv4 protocol; otherwise, false. - - - Indicates whether the underlying operating system and network adaptors support Internet Protocol version 6 (IPv6). - true if the operating system and network adaptors support the IPv6 protocol; otherwise, false. - - - Determines the status of the . - The time to wait for a response, in microseconds. - One of the values. -

The status of the based on the polling mode value passed in the mode parameter.

-
Mode

-

Return Value

-

true if has been called and a connection is pending;

-

-or-

-

true if data is available for reading;

-

-or-

-

true if the connection has been closed, reset, or terminated;

-

otherwise, returns false.

-

true, if processing a , and the connection has succeeded;

-

-or-

-

true if data can be sent;

-

otherwise, returns false.

-

true if processing a that does not block, and the connection has failed;

-

-or-

-

true if is not set and out-of-band data is available;

-

otherwise, returns false.

-

-
- The mode parameter is not one of the values. - An error occurred when attempting to access the socket. See remarks below. - The has been closed. -
- - Gets the protocol type of the . - One of the values. - - - Receives data from a bound into a receive buffer, using the specified . - An array of type that is the storage location for the received data. - The position in the buffer parameter to store the received data. - The number of bytes to receive. - A bitwise combination of the values. - A object that stores the socket error. - The number of bytes received. - buffer is null. - offset is less than 0. -or- offset is greater than the length of buffer. -or- size is less than 0. -or- size is greater than the length of buffer minus the value of the offset parameter. - socketFlags is not a valid combination of values. -or- The property is not set. -or- An operating system error occurs while accessing the . - The has been closed. - A caller in the call stack does not have the required permissions. - - - Receives the specified number of bytes from a bound into the specified offset position of the receive buffer, using the specified . - An array of type that is the storage location for received data. - The location in buffer to store the received data. - The number of bytes to receive. - A bitwise combination of the values. - The number of bytes received. - buffer is null. - offset is less than 0. -or- offset is greater than the length of buffer. -or- size is less than 0. -or- size is greater than the length of buffer minus the value of the offset parameter. - socketFlags is not a valid combination of values. -or- The property was not set. -or- An operating system error occurs while accessing the . - The has been closed. - A caller in the call stack does not have the required permissions. - - - Receives data from a bound into the list of receive buffers, using the specified . - A list of s of type that contains the received data. - A bitwise combination of the values. - A object that stores the socket error. - The number of bytes received. - buffers is null. -or- buffers.Count is zero. - An error occurred while attempting to access the socket. - The has been closed. - - - Receives the specified number of bytes of data from a bound into a receive buffer, using the specified . - An array of type that is the storage location for the received data. - The number of bytes to receive. - A bitwise combination of the values. - The number of bytes received. - buffer is null. - size exceeds the size of buffer. - An error occurred when attempting to access the socket. - The has been closed. - A caller in the call stack does not have the required permissions. - - - Receives data from a bound into the list of receive buffers. - A list of s of type that contains the received data. - The number of bytes received. - The buffer parameter is null. - An error occurred while attempting to access the socket. - The has been closed. - - - Receives data from a bound into a receive buffer, using the specified . - An array of type that is the storage location for the received data. - A bitwise combination of the values. - The number of bytes received. - buffer is null. - An error occurred when attempting to access the socket. - The has been closed. - A caller in the call stack does not have the required permissions. - - - Receives data from a bound into a receive buffer. - An array of type that is the storage location for the received data. - The number of bytes received. - buffer is null. - An error occurred when attempting to access the socket. - The has been closed. - A caller in the call stack does not have the required permissions. - - - Receives data from a bound into the list of receive buffers, using the specified . - A list of s of type that contains the received data. - A bitwise combination of the values. - The number of bytes received. - buffers is null. -or- buffers.Count is zero. - An error occurred while attempting to access the socket. - The has been closed. - - - Begins an asynchronous request to receive data from a connected object. - The object to use for this asynchronous socket operation. - Returns true if the I/O operation is pending. The event on the e parameter will be raised upon completion of the operation. Returns false if the I/O operation completed synchronously. In this case, The event on the e parameter will not be raised and the e object passed as a parameter may be examined immediately after the method call returns to retrieve the result of the operation. - An argument was invalid. The or properties on the e parameter must reference valid buffers. One or the other of these properties may be set, but not both at the same time. - A socket operation was already in progress using the object specified in the e parameter. - Windows XP or later is required for this method. - The has been closed. - An error occurred when attempting to access the socket. - - - Gets or sets a value that specifies the size of the receive buffer of the . - An that contains the size, in bytes, of the receive buffer. The default is 8192. - An error occurred when attempting to access the socket. - The has been closed. - The value specified for a set operation is less than 0. - - - Receives a datagram into the data buffer and stores the endpoint. - An array of type that is the storage location for received data. - An , passed by reference, that represents the remote server. - The number of bytes received. - buffer is null. -or- remoteEP is null. - An error occurred when attempting to access the socket. - The has been closed. - A caller in the call stack does not have the required permissions. - - - Receives a datagram into the data buffer, using the specified , and stores the endpoint. - An array of type that is the storage location for the received data. - A bitwise combination of the values. - An , passed by reference, that represents the remote server. - The number of bytes received. - buffer is null. -or- remoteEP is null. - An error occurred when attempting to access the socket. - The has been closed. - A caller in the call stack does not have the required permissions. - - - Receives the specified number of bytes into the data buffer, using the specified , and stores the endpoint. - An array of type that is the storage location for received data. - The number of bytes to receive. - A bitwise combination of the values. - An , passed by reference, that represents the remote server. - The number of bytes received. - buffer is null. -or- remoteEP is null. - size is less than 0. -or- size is greater than the length of buffer. - socketFlags is not a valid combination of values. -or- The property was not set. -or- An operating system error occurs while accessing the . - The has been closed. - A caller in the call stack does not have the required permissions. - - - Receives the specified number of bytes of data into the specified location of the data buffer, using the specified , and stores the endpoint. - An array of type that is the storage location for received data. - The position in the buffer parameter to store the received data. - The number of bytes to receive. - A bitwise combination of the values. - An , passed by reference, that represents the remote server. - The number of bytes received. - buffer is null. -or- remoteEP is null. - offset is less than 0. -or- offset is greater than the length of buffer. -or- size is less than 0. -or- size is greater than the length of the buffer minus the value of the offset parameter. - socketFlags is not a valid combination of values. -or- The property was not set. -or- An error occurred when attempting to access the socket. - The has been closed. - - - Begins to asynchronously receive data from a specified network device. - The object to use for this asynchronous socket operation. - Returns true if the I/O operation is pending. The event on the e parameter will be raised upon completion of the operation. Returns false if the I/O operation completed synchronously. In this case, The event on the e parameter will not be raised and the e object passed as a parameter may be examined immediately after the method call returns to retrieve the result of the operation. - The cannot be null. - A socket operation was already in progress using the object specified in the e parameter. - Windows XP or later is required for this method. - The has been closed. - An error occurred when attempting to access the socket. - - - Receives the specified number of bytes of data into the specified location of the data buffer, using the specified , and stores the endpoint and packet information. - An array of type that is the storage location for received data. - The position in the buffer parameter to store the received data. - The number of bytes to receive. - A bitwise combination of the values. - An , passed by reference, that represents the remote server. - An holding address and interface information. - The number of bytes received. - buffer is null. - or- remoteEP is null. - offset is less than 0. -or- offset is greater than the length of buffer. -or- size is less than 0. -or- size is greater than the length of the buffer minus the value of the offset parameter. - socketFlags is not a valid combination of values. -or- The property was not set. -or- The .NET Framework is running on an AMD 64-bit processor. -or- An error occurred when attempting to access the socket. - The has been closed. - The operating system is Windows 2000 or earlier, and this method requires Windows XP. - - - Begins to asynchronously receive the specified number of bytes of data into the specified location in the data buffer, using the specified , and stores the endpoint and packet information. - The object to use for this asynchronous socket operation. - Returns true if the I/O operation is pending. The event on the e parameter will be raised upon completion of the operation. Returns false if the I/O operation completed synchronously. In this case, The event on the e parameter will not be raised and the e object passed as a parameter may be examined immediately after the method call returns to retrieve the result of the operation. - The cannot be null. - Windows XP or later is required for this method. - The has been closed. - An error occurred when attempting to access the socket. - - - Gets or sets a value that specifies the amount of time after which a synchronous call will time out. - The time-out value, in milliseconds. The default value is 0, which indicates an infinite time-out period. Specifying -1 also indicates an infinite time-out period. - An error occurred when attempting to access the socket. - The has been closed. - The value specified for a set operation is less than -1. - - - Gets the remote endpoint. - The with which the is communicating. - An error occurred when attempting to access the socket. - The has been closed. - - - Determines the status of one or more sockets. - An of instances to check for readability. - An of instances to check for writability. - An of instances to check for errors. - The time-out value, in microseconds. A -1 value indicates an infinite time-out. - The checkRead parameter is null or empty. -and- The checkWrite parameter is null or empty -and- The checkError parameter is null or empty. - An error occurred when attempting to access the socket. - - - Sends data to a connected . - An array of type that contains the data to be sent. - The number of bytes sent to the . - buffer is null. - An error occurred when attempting to access the socket. - The has been closed. - - - Sends the set of buffers in the list to a connected . - A list of s of type that contains the data to be sent. - The number of bytes sent to the . - buffers is null. - buffers is empty. - An error occurred when attempting to access the socket. See remarks section below. - The has been closed. - - - Sends data to a connected using the specified . - An array of type that contains the data to be sent. - A bitwise combination of the values. - The number of bytes sent to the . - buffer is null. - An error occurred when attempting to access the socket. - The has been closed. - - - Sends the set of buffers in the list to a connected , using the specified . - A list of s of type that contains the data to be sent. - A bitwise combination of the values. - The number of bytes sent to the . - buffers is null. - buffers is empty. - An error occurred when attempting to access the socket. - The has been closed. - - - Sends the specified number of bytes of data to a connected , using the specified . - An array of type that contains the data to be sent. - The number of bytes to send. - A bitwise combination of the values. - The number of bytes sent to the . - buffer is null. - size is less than 0 or exceeds the size of the buffer. - socketFlags is not a valid combination of values. -or- An operating system error occurs while accessing the socket. - The has been closed. - - - Sends the set of buffers in the list to a connected , using the specified . - A list of s of type that contains the data to be sent. - A bitwise combination of the values. - A object that stores the socket error. - The number of bytes sent to the . - buffers is null. - buffers is empty. - An error occurred when attempting to access the socket. - The has been closed. - - - Sends the specified number of bytes of data to a connected , starting at the specified offset, and using the specified . - An array of type that contains the data to be sent. - The position in the data buffer at which to begin sending data. - The number of bytes to send. - A bitwise combination of the values. - The number of bytes sent to the . - buffer is null. - offset is less than 0. -or- offset is greater than the length of buffer. -or- size is less than 0. -or- size is greater than the length of buffer minus the value of the offset parameter. - socketFlags is not a valid combination of values. -or- An operating system error occurs while accessing the . - The has been closed. - - - Sends the specified number of bytes of data to a connected , starting at the specified offset, and using the specified - An array of type that contains the data to be sent. - The position in the data buffer at which to begin sending data. - The number of bytes to send. - A bitwise combination of the values. - A object that stores the socket error. - The number of bytes sent to the . - buffer is null. - offset is less than 0. -or- offset is greater than the length of buffer. -or- size is less than 0. -or- size is greater than the length of buffer minus the value of the offset parameter. - socketFlags is not a valid combination of values. -or- An operating system error occurs while accessing the . - The has been closed. - - - Sends data asynchronously to a connected object. - The object to use for this asynchronous socket operation. - Returns true if the I/O operation is pending. The event on the e parameter will be raised upon completion of the operation. Returns false if the I/O operation completed synchronously. In this case, The event on the e parameter will not be raised and the e object passed as a parameter may be examined immediately after the method call returns to retrieve the result of the operation. - The or properties on the e parameter must reference valid buffers. One or the other of these properties may be set, but not both at the same time. - A socket operation was already in progress using the object specified in the e parameter. - Windows XP or later is required for this method. - The has been closed. - The is not yet connected or was not obtained via an , ,or , method. - - - Gets or sets a value that specifies the size of the send buffer of the . - An that contains the size, in bytes, of the send buffer. The default is 8192. - An error occurred when attempting to access the socket. - The has been closed. - The value specified for a set operation is less than 0. - - - Sends the file fileName to a connected object with the transmit flag. - A that contains the path and name of the file to be sent. This parameter can be null. - The socket is not connected to a remote host. - The object has been closed. - The object is not in blocking mode and cannot accept this synchronous call. - The file fileName was not found. - An error occurred when attempting to access the socket. - - - Sends the file fileName and buffers of data to a connected object using the specified value. - A that contains the path and name of the file to be sent. This parameter can be null. - A array that contains data to be sent before the file is sent. This parameter can be null. - A array that contains data to be sent after the file is sent. This parameter can be null. - One or more of values. - The operating system is not Windows NT or later. - or - The socket is not connected to a remote host. - The object has been closed. - The object is not in blocking mode and cannot accept this synchronous call. - The file fileName was not found. - An error occurred when attempting to access the socket. - - - Sends a collection of files or in memory data buffers asynchronously to a connected object. - The object to use for this asynchronous socket operation. - Returns true if the I/O operation is pending. The event on the e parameter will be raised upon completion of the operation. Returns false if the I/O operation completed synchronously. In this case, The event on the e parameter will not be raised and the e object passed as a parameter may be examined immediately after the method call returns to retrieve the result of the operation. - The file specified in the property was not found. - A socket operation was already in progress using the object specified in the e parameter. - Windows XP or later is required for this method. This exception also occurs if the is not connected to a remote host. - The has been closed. - A connectionless is being used and the file being sent exceeds the maximum packet size of the underlying transport. - - - Gets or sets a value that specifies the amount of time after which a synchronous call will time out. - The time-out value, in milliseconds. If you set the property with a value between 1 and 499, the value will be changed to 500. The default value is 0, which indicates an infinite time-out period. Specifying -1 also indicates an infinite time-out period. - An error occurred when attempting to access the socket. - The has been closed. - The value specified for a set operation is less than -1. - - - Sends data to the specified endpoint. - An array of type that contains the data to be sent. - The that represents the destination for the data. - The number of bytes sent. - buffer is null. -or- remoteEP is null. - An error occurred when attempting to access the socket. - The has been closed. - - - Sends data to a specific endpoint using the specified . - An array of type that contains the data to be sent. - A bitwise combination of the values. - The that represents the destination location for the data. - The number of bytes sent. - buffer is null. -or- remoteEP is null. - An error occurred when attempting to access the socket. - The has been closed. - - - Sends the specified number of bytes of data to the specified endpoint using the specified . - An array of type that contains the data to be sent. - The number of bytes to send. - A bitwise combination of the values. - The that represents the destination location for the data. - The number of bytes sent. - buffer is null. -or- remoteEP is null. - The specified size exceeds the size of buffer. - An error occurred when attempting to access the socket. - The has been closed. - - - Sends the specified number of bytes of data to the specified endpoint, starting at the specified location in the buffer, and using the specified . - An array of type that contains the data to be sent. - The position in the data buffer at which to begin sending data. - The number of bytes to send. - A bitwise combination of the values. - The that represents the destination location for the data. - The number of bytes sent. - buffer is null. -or- remoteEP is null. - offset is less than 0. -or- offset is greater than the length of buffer. -or- size is less than 0. -or- size is greater than the length of buffer minus the value of the offset parameter. - socketFlags is not a valid combination of values. -or- An operating system error occurs while accessing the . - The has been closed. - A caller in the call stack does not have the required permissions. - - - Sends data asynchronously to a specific remote host. - The object to use for this asynchronous socket operation. - Returns true if the I/O operation is pending. The event on the e parameter will be raised upon completion of the operation. Returns false if the I/O operation completed synchronously. In this case, The event on the e parameter will not be raised and the e object passed as a parameter may be examined immediately after the method call returns to retrieve the result of the operation. - The cannot be null. - A socket operation was already in progress using the object specified in the e parameter. - Windows XP or later is required for this method. - The has been closed. - The protocol specified is connection-oriented, but the is not yet connected. - - - Set the IP protection level on a socket. - The IP protection level to set on this socket. - The level parameter cannot be . The IP protection level cannot be set to unspecified. - The of the socket must be either or . - - - Sets the specified option to the specified value. - One of the values. - One of the values. - The value of the option, represented as a . - The object has been closed. - An error occurred when attempting to access the socket. - - - Sets the specified option to the specified value, represented as a byte array. - One of the values. - One of the values. - An array of type that represents the value of the option. - An error occurred when attempting to access the socket. - The has been closed. - - - Sets the specified option to the specified integer value. - One of the values. - One of the values. - A value of the option. - An error occurred when attempting to access the socket. - The has been closed. - - - Sets the specified option to the specified value, represented as an object. - One of the values. - One of the values. - A or that contains the value of the option. - optionValue is null. - An error occurred when attempting to access the socket. - The has been closed. - - - Disables sends and receives on a . - One of the values that specifies the operation that will no longer be allowed. - An error occurred when attempting to access the socket. - The has been closed. - - - Gets the type of the . - One of the values. - - - Gets a value indicating whether IPv4 support is available and enabled on the current host. - true if the current host supports the IPv4 protocol; otherwise, false. - - - Gets a value that indicates whether the Framework supports IPv6 for certain obsolete members. - true if the Framework supports IPv6 for certain obsolete methods; otherwise, false. - - - Gets or sets a value that specifies the Time To Live (TTL) value of Internet Protocol (IP) packets sent by the . - The TTL value. - The TTL value can't be set to a negative number. - This property can be set only for sockets in the or families. - An error occurred when attempting to access the socket. This error is also returned when an attempt was made to set TTL to a value higher than 255. - The has been closed. - - - Specifies whether the socket should only use Overlapped I/O mode. - true if the uses only overlapped I/O; otherwise, false. The default is false. - The socket has been bound to a completion port. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - The type of asynchronous socket operation most recently performed with this context object. - - - A socket Accept operation. - - - - A socket Connect operation. - - - - A socket Disconnect operation. - - - - None of the socket operations. - - - - A socket Receive operation. - - - - A socket ReceiveFrom operation. - - - - A socket ReceiveMessageFrom operation. - - - - A socket Send operation. - - - - A socket SendPackets operation. - - - - A socket SendTo operation. - - - - Defines error codes for the class. - - - An attempt was made to access a in a way that is forbidden by its access permissions. - - - - Only one use of an address is normally permitted. - - - - The address family specified is not supported. This error is returned if the IPv6 address family was specified and the IPv6 stack is not installed on the local machine. This error is returned if the IPv4 address family was specified and the IPv4 stack is not installed on the local machine. - - - - The selected IP address is not valid in this context. - - - - The nonblocking already has an operation in progress. - - - - The connection was aborted by the .NET Framework or the underlying socket provider. - - - - The remote host is actively refusing a connection. - - - - The connection was reset by the remote peer. - - - - A required address was omitted from an operation on a . - - - - A graceful shutdown is in progress. - - - - An invalid pointer address was detected by the underlying socket provider. - - - - The operation failed because the remote host is down. - - - - No such host is known. The name is not an official host name or alias. - - - - There is no network route to the specified host. - - - - A blocking operation is in progress. - - - - A blocking call was canceled. - - - - An invalid argument was supplied to a member. - - - - The application has initiated an overlapped operation that cannot be completed immediately. - - - - The is already connected. - - - - The datagram is too long. - - - - The network is not available. - - - - The application tried to set on a connection that has already timed out. - - - - No route to the remote host exists. - - - - No free buffer space is available for a operation. - - - - The requested name or IP address was not found on the name server. - - - - The error is unrecoverable or the requested database cannot be located. - - - - The application tried to send or receive data, and the is not connected. - - - - The underlying socket provider has not been initialized. - - - - A operation was attempted on a non-socket. - - - - The overlapped operation was aborted due to the closure of the . - - - - The address family is not supported by the protocol family. - - - - Too many processes are using the underlying socket provider. - - - - The protocol family is not implemented or has not been configured. - - - - The protocol is not implemented or has not been configured. - - - - An unknown, invalid, or unsupported option or level was used with a . - - - - The protocol type is incorrect for this . - - - - A request to send or receive data was disallowed because the has already been closed. - - - - An unspecified error has occurred. - - - - The support for the specified socket type does not exist in this address family. - - - - The operation succeeded. - - - - The network subsystem is unavailable. - - - - The connection attempt timed out, or the connected host has failed to respond. - - - - There are too many open sockets in the underlying socket provider. - - - - The name of the host could not be resolved. Try again later. - - - - The specified class was not found. - - - - The version of the underlying socket provider is out of range. - - - - An operation on a nonblocking socket cannot be completed immediately. - - - - The exception that is thrown when a socket error occurs. - - - Initializes a new instance of the class with the last operating system error code. - - - Initializes a new instance of the class with the specified error code. - The error code that indicates the error that occurred. - - - Initializes a new instance of the class from the specified instances of the and classes. - A instance that contains the information that is required to serialize the new instance. - A that contains the source of the serialized stream that is associated with the new instance. - - - Gets the error code that is associated with this exception. - An integer error code that is associated with this exception. - - - Gets the error message that is associated with this exception. - A string that contains the error message. - - - Gets the error code that is associated with this exception. - An integer error code that is associated with this exception. - - - Specifies socket send and receive behaviors. - - - Indicates a broadcast packet. - - - - Indicates that the control data did not fit into an internal 64-KB buffer and was truncated. - - - - Send without using routing tables. - - - - Indicates a multicast packet. - - - - Use no flags for this call. - - - - Process out-of-band data. - - - - Partial send or receive for message. - - - - Peek at the incoming message. - - - - The message was too large to fit into the specified buffer and was truncated. - - - - Encapsulates the information that is necessary to duplicate a . - - - Gets or sets the options for a . - A instance. - - - Gets or sets the protocol information for a . - An array of type . - - - Describes states for a . - - - The is connected. - - - - The is listening for new connections. - - - - The is nonblocking. - - - - The uses overlapped I/O. - - - - Defines socket option levels for the and methods. - - - options apply only to IP sockets. - - - - options apply only to IPv6 sockets. - - - - options apply to all sockets. - - - - options apply only to TCP sockets. - - - - options apply only to UDP sockets. - - - - Defines configuration option names. - - - The socket is listening. - - - - Add an IP group membership. - - - - Join a source group. - - - - Block data from a source. - - - - Permit sending broadcast messages on the socket. - - - - Use urgent data as defined in RFC-1222. This option can be set only once; after it is set, it cannot be turned off. - - - - Set or get the UDP checksum coverage. - - - - Record debugging information. - - - - Do not fragment IP datagrams. - - - - Close the socket gracefully without lingering. - - - - Do not route; send the packet directly to the interface addresses. - - - - Drop an IP group membership. - - - - Drop a source group. - - - - Get the error status and clear. - - - - Enables a socket to be bound for exclusive access. - - - - Use expedited data as defined in RFC-1222. This option can be set only once; after it is set, it cannot be turned off. - - - - Indicates that the application provides the IP header for outgoing datagrams. - - - - Specifies the maximum number of router hops for an Internet Protocol version 6 (IPv6) packet. This is similar to Time to Live (TTL) for Internet Protocol version 4. - - - - Specifies the IP options to be inserted into outgoing datagrams. - - - - Enables restriction of a IPv6 socket to a specified scope, such as addresses with the same link local or site local prefix.This socket option enables applications to place access restrictions on IPv6 sockets. Such restrictions enable an application running on a private LAN to simply and robustly harden itself against external attacks. This socket option widens or narrows the scope of a listening socket, enabling unrestricted access from public and private users when appropriate, or restricting access only to the same site, as required. This socket option has defined protection levels specified in the enumeration. - - - - Set the IP header Time-to-Live field. - - - - Indicates if a socket created for the AF_INET6 address family is restricted to IPv6 communications only. Sockets created for the AF_INET6 address family may be used for both IPv6 and IPv4 communications. Some applications may want to restrict their use of a socket created for the AF_INET6 address family to IPv6 communications only. When this value is non-zero (the default on Windows), a socket created for the AF_INET6 address family can be used to send and receive IPv6 packets only. When this value is zero, a socket created for the AF_INET6 address family can be used to send and receive packets to and from an IPv6 address or an IPv4 address. Note that the ability to interact with an IPv4 address requires the use of IPv4 mapped addresses. This socket option is supported on Windows Vista or later. - - - - Use keep-alives. - - - - Linger on close if unsent data is present. - - - - Not supported; will throw a if used. - - - - Set the interface for outgoing multicast packets. - - - - An IP multicast loopback. - - - - An IP multicast Time to Live. - - - - Send UDP datagrams with checksum set to zero. - - - - Disables the Nagle algorithm for send coalescing. - - - - Receives out-of-band data in the normal data stream. - - - - Return information about received packets. - - - - Specifies the total per-socket buffer space reserved for receives. This is unrelated to the maximum message size or the size of a TCP window. - - - - Specifies the low water mark for operations. - - - - Receive a time-out. This option applies only to synchronous methods; it has no effect on asynchronous methods such as the method. - - - - Allows the socket to be bound to an address that is already in use. - - - - Indicates that the system should defer ephemeral port allocation for outbound connections. This is equivalent to using the Winsock2 SO_REUSE_UNICASTPORT socket option. - - - - Specifies the total per-socket buffer space reserved for sends. This is unrelated to the maximum message size or the size of a TCP window. - - - - Specifies the low water mark for operations. - - - - Send a time-out. This option applies only to synchronous methods; it has no effect on asynchronous methods such as the method. - - - - Get the socket type. - - - - Change the IP header type of the service field. - - - - Unblock a previously blocked source. - - - - Updates an accepted socket's properties by using those of an existing socket. This is equivalent to using the Winsock2 SO_UPDATE_ACCEPT_CONTEXT socket option and is supported only on connection-oriented sockets. - - - - Updates a connected socket's properties by using those of an existing socket. This is equivalent to using the Winsock2 SO_UPDATE_CONNECT_CONTEXT socket option and is supported only on connection-oriented sockets. - - - - Bypass hardware when possible. - - - - - - - - - - - - - - - - - - - - - - - - - - - - Defines constants that are used by the method. - - - Disables a for both sending and receiving. This field is constant. - - - - Disables a for receiving. This field is constant. - - - - Disables a for sending. This field is constant. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Specifies the type of socket that an instance of the class represents. - - - Supports datagrams, which are connectionless, unreliable messages of a fixed (typically small) maximum length. Messages might be lost or duplicated and might arrive out of order. A of type requires no connection prior to sending and receiving data, and can communicate with multiple peers. uses the Datagram Protocol () and the . - - - - Supports access to the underlying transport protocol. Using the , you can communicate using protocols like Internet Control Message Protocol () and Internet Group Management Protocol (). Your application must provide a complete IP header when sending. Received datagrams return with the IP header and options intact. - - - - Supports connectionless, message-oriented, reliably delivered messages, and preserves message boundaries in data. Rdm (Reliably Delivered Messages) messages arrive unduplicated and in order. Furthermore, the sender is notified if messages are lost. If you initialize a Socket using , you do not require a remote host connection before sending and receiving data. With , you can communicate with multiple peers. - - - - Provides connection-oriented and reliable two-way transfer of ordered byte streams across a network. does not duplicate data, and it preserves boundaries within the data stream. A Socket of type communicates with a single peer and requires a remote host connection before communication can begin. - - - - Supports reliable, two-way, connection-based byte streams without the duplication of data and without preservation of boundaries. A Socket of this type communicates with a single peer and requires a remote host connection before communication can begin. uses the Transmission Control Protocol () and the InterNetwork. - - - - Specifies an unknown Socket type. - - - - Provides client connections for TCP network services. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class and binds it to the specified local endpoint. - The to which you bind the TCP . - The localEP parameter is null. - - - Initializes a new instance of the class with the specified family. - The of the IP protocol. - The family parameter is not equal to AddressFamily.InterNetwork -or- The family parameter is not equal to AddressFamily.InterNetworkV6 - - - Initializes a new instance of the class and connects to the specified port on the specified host. - The DNS name of the remote host to which you intend to connect. - The port number of the remote host to which you intend to connect. - The hostname parameter is null. - The port parameter is not between and . - An error occurred when accessing the socket. - - - Gets or set a value that indicates whether a connection has been made. - true if the connection has been made; otherwise, false. - - - Gets the amount of data that has been received from the network and is available to be read. - The number of bytes of data received from the network and available to be read. - An error occurred when attempting to access the socket. - The has been closed. - - - Begins an asynchronous request for a remote host connection. The remote host is specified by an and a port number (). - The of the remote host. - The port number of the remote host. - An delegate that references the method to invoke when the operation is complete. - A user-defined object that contains information about the connect operation. This object is passed to the requestCallback delegate when the operation is complete. - An object that references the asynchronous connection. - The address parameter is null. - An error occurred when attempting to access the socket. - The has been closed. - A caller higher in the call stack does not have permission for the requested operation. - The port number is not valid. - - - Begins an asynchronous request for a remote host connection. The remote host is specified by an array and a port number (). - At least one that designates the remote hosts. - The port number of the remote hosts. - An delegate that references the method to invoke when the operation is complete. - A user-defined object that contains information about the connect operation. This object is passed to the requestCallback delegate when the operation is complete. - An object that references the asynchronous connection. - The addresses parameter is null. - An error occurred when attempting to access the socket. - The has been closed. - A caller higher in the call stack does not have permission for the requested operation. - The port number is not valid. - - - Begins an asynchronous request for a remote host connection. The remote host is specified by a host name () and a port number (). - The name of the remote host. - The port number of the remote host. - An delegate that references the method to invoke when the operation is complete. - A user-defined object that contains information about the connect operation. This object is passed to the requestCallback delegate when the operation is complete. - An object that references the asynchronous connection. - The host parameter is null. - An error occurred when attempting to access the socket. - The has been closed. - A caller higher in the call stack does not have permission for the requested operation. - The port number is not valid. - - - Gets or sets the underlying . - The underlying network . - - - Disposes this instance and requests that the underlying TCP connection be closed. - - - Connects the client to a remote TCP host using the specified remote network endpoint. - The to which you intend to connect. - The remoteEp parameter is null. - An error occurred when accessing the socket. - The is closed. - - - Connects the client to a remote TCP host using the specified IP address and port number. - The of the host to which you intend to connect. - The port number to which you intend to connect. - The address parameter is null. - The port is not between and . - An error occurred when accessing the socket. - is closed. - - - Connects the client to a remote TCP host using the specified IP addresses and port number. - The array of the host to which you intend to connect. - The port number to which you intend to connect. - The ipAddresses parameter is null. - The port number is not valid. - An error occurred when attempting to access the socket. - The has been closed. - A caller higher in the call stack does not have permission for the requested operation. - This method is valid for sockets that use the flag or the flag. - - - Connects the client to the specified port on the specified host. - The DNS name of the remote host to which you intend to connect. - The port number of the remote host to which you intend to connect. - The hostname parameter is null. - The port parameter is not between and . - An error occurred when accessing the socket. - is closed. - - - Connects the client to the specified TCP port on the specified host as an asynchronous operation. - The DNS name of the remote host to which you intend to connect. - The port number of the remote host to which you intend to connect. - Returns The task object representing the asynchronous operation. - The hostname parameter is null. - The port parameter is not between and . - An error occurred when accessing the socket. - is closed. - - - Connects the client to a remote TCP host using the specified IP address and port number as an asynchronous operation. - The of the host to which you intend to connect. - The port number to which you intend to connect. - Returns The task object representing the asynchronous operation. - The address parameter is null. - The port is not between and . - An error occurred when accessing the socket. - is closed. - - - Connects the client to a remote TCP host using the specified IP addresses and port number as an asynchronous operation. - The array of the host to which you intend to connect. - The port number to which you intend to connect. - Returns The task object representing the asynchronous operation. - The ipAddresses parameter is null. - The port number is not valid. - An error occurred when attempting to access the socket. - The has been closed. - A caller higher in the call stack does not have permission for the requested operation. - This method is valid for sockets that use the flag or the flag. - - - Gets a value indicating whether the underlying for a is connected to a remote host. - true if the socket was connected to a remote resource as of the most recent operation; otherwise, false. - - - Releases the managed and unmanaged resources used by the . - - - Releases the unmanaged resources used by the and optionally releases the managed resources. - Set to true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - Ends a pending asynchronous connection attempt. - An object returned by a call to . - The asyncResult parameter is null. - The asyncResult parameter was not returned by a call to a method. - The method was previously called for the asynchronous connection. - An error occurred when attempting to access the . - The underlying has been closed. - - - Gets or sets a value that specifies whether the allows only one client to use a port. - true if the allows only one client to use a specific port; otherwise, false. The default is true for Windows Server 2003 and Windows XP Service Pack 2 and later, and false for all other versions. - An error occurred when attempting to access the underlying socket. - The underlying has been closed. - - - Frees resources used by the class. - - - Returns the used to send and receive data. - The underlying . - The is not connected to a remote host. - The has been closed. - - - Gets or sets information about the linger state of the associated socket. - A . By default, lingering is disabled. - - - Gets or sets a value that disables a delay when send or receive buffers are not full. - true if the delay is disabled, otherwise false. The default value is false. - - - Gets or sets the size of the receive buffer. - The size of the receive buffer, in bytes. The default value is 8192 bytes. - An error occurred when setting the buffer size. -or- In .NET Compact Framework applications, you cannot set this property. For a workaround, see the Platform Note in Remarks. - - - Gets or sets the amount of time a will wait to receive data once a read operation is initiated. - The time-out value of the connection in milliseconds. The default value is 0. - - - Gets or sets the size of the send buffer. - The size of the send buffer, in bytes. The default value is 8192 bytes. - - - Gets or sets the amount of time a will wait for a send operation to complete successfully. - The send time-out value, in milliseconds. The default is 0. - - - Listens for connections from TCP network clients. - - - Initializes a new instance of the class that listens on the specified port. - The port on which to listen for incoming connection attempts. - port is not between and . - - - Initializes a new instance of the class with the specified local endpoint. - An that represents the local endpoint to which to bind the listener . - localEP is null. - - - Initializes a new instance of the class that listens for incoming connection attempts on the specified local IP address and port number. - An that represents the local IP address. - The port on which to listen for incoming connection attempts. - localaddr is null. - port is not between and . - - - Accepts a pending connection request. - A used to send and receive data. - The listener has not been started with a call to . - - - Accepts a pending connection request as an asynchronous operation. - Returns The task object representing the asynchronous operation. The property on the task object returns a used to send and receive data. - The listener has not been started with a call to . - - - Accepts a pending connection request. - A used to send and receive data. - The listener has not been started with a call to . - Use the property to obtain the specific error code. When you have obtained this code, you can refer to the Windows Sockets version 2 API error code documentation in MSDN for a detailed description of the error. - - - Accepts a pending connection request as an asynchronous operation. - Returns The task object representing the asynchronous operation. The property on the task object returns a used to send and receive data. - The listener has not been started with a call to . - Use the property to obtain the specific error code. When you have obtained this code, you can refer to the Windows Sockets version 2 API error code documentation in MSDN for a detailed description of the error. - - - Gets a value that indicates whether is actively listening for client connections. - true if is actively listening; otherwise, false. - - - Enables or disables Network Address Translation (NAT) traversal on a instance. - A Boolean value that specifies whether to enable or disable NAT traversal. - The method was called after calling the method - - - Begins an asynchronous operation to accept an incoming connection attempt. - An delegate that references the method to invoke when the operation is complete. - A user-defined object containing information about the accept operation. This object is passed to the callback delegate when the operation is complete. - An that references the asynchronous creation of the . - An error occurred while attempting to access the socket. - The has been closed. - - - Begins an asynchronous operation to accept an incoming connection attempt. - An delegate that references the method to invoke when the operation is complete. - A user-defined object containing information about the accept operation. This object is passed to the callback delegate when the operation is complete. - An that references the asynchronous creation of the . - An error occurred while attempting to access the socket. - The has been closed. - - - Creates a new instance to listen on the specified port. - The port on which to listen for incoming connection attempts. - Returns . A new instance to listen on the specified port. - - - Asynchronously accepts an incoming connection attempt and creates a new to handle remote host communication. - An returned by a call to the method. - A . The used to send and receive data. - The underlying has been closed. - The asyncResult parameter is null. - The asyncResult parameter was not created by a call to the method. - The method was previously called. - An error occurred while attempting to access the . - - - Asynchronously accepts an incoming connection attempt and creates a new to handle remote host communication. - An returned by a call to the method. - A . The used to send and receive data. - - - Gets or sets a value that specifies whether the allows only one underlying socket to listen to a specific port. - true if the allows only one to listen to a specific port; otherwise, false. . The default is true for Windows Server 2003 and Windows XP Service Pack 2 and later, and false for all other versions. - The has been started. Call the method and then set the property. - An error occurred when attempting to access the underlying socket. - The underlying has been closed. - - - Gets the underlying of the current . - The to which the is bound. - - - Determines if there are pending connection requests. - true if connections are pending; otherwise, false. - The listener has not been started with a call to . - - - Gets the underlying network . - The underlying . - - - Starts listening for incoming connection requests. - Use the property to obtain the specific error code. When you have obtained this code, you can refer to the Windows Sockets version 2 API error code documentation in MSDN for a detailed description of the error. - - - Starts listening for incoming connection requests with a maximum number of pending connection. - The maximum length of the pending connections queue. - An error occurred while accessing the socket. - The backlog parameter is less than zero or exceeds the maximum number of permitted connections. - The underlying is null. - - - Closes the listener. - Use the property to obtain the specific error code. When you have obtained this code, you can refer to the Windows Sockets version 2 API error code documentation in MSDN for a detailed description of the error. - - - The enumeration defines values used in file transfer requests. - - - Start a transport-level disconnect after all the file data has been queued for transmission. When used with , these flags return the socket to a disconnected, reusable state after the file has been transmitted. - - - - The socket handle may be reused when the request completes. This flag is valid only if is also specified. When used with , these flags return the socket to a disconnected, reusable state after the file has been transmitted. - - - - Use the default thread to process long file transfer requests. - - - - Use kernel asynchronous procedure calls (APCs) instead of worker threads to process long file transfer requests. Long requests are defined as requests that require more than a single read from the file or a cache; the request therefore depends on the size of the file and the specified length of the send packet. - - - - Use system threads to process long file transfer requests. - - - - Complete the file transfer request immediately, without pending. If this flag is specified and the file transfer succeeds, the data has been accepted by the system but not necessarily acknowledged by the remote end. Do not use this flag with the and flags. - - - - Provides User Datagram Protocol (UDP) network services. - - - Initializes a new instance of the class. - An error occurred when accessing the socket. - - - Initializes a new instance of the class and binds it to the local port number provided. - The local port number from which you intend to communicate. - The port parameter is greater than or less than . - An error occurred when accessing the socket. - - - Initializes a new instance of the class and binds it to the specified local endpoint. - An that respresents the local endpoint to which you bind the UDP connection. - localEP is null. - An error occurred when accessing the socket. - - - Initializes a new instance of the class. - One of the values that specifies the addressing scheme of the socket. - family is not or . - An error occurred when accessing the socket. - - - Initializes a new instance of the class and binds it to the local port number provided. - The port on which to listen for incoming connection attempts. - One of the values that specifies the addressing scheme of the socket. - family is not or . - port is greater than or less than . - An error occurred when accessing the socket. - - - Initializes a new instance of the class and establishes a default remote host. - The name of the remote DNS host to which you intend to connect. - The remote port number to which you intend to connect. - hostname is null. - port is not between and . - An error occurred when accessing the socket. - - - Gets or sets a value indicating whether a default remote host has been established. - true if a connection is active; otherwise, false. - - - Enables or disables Network Address Translation (NAT) traversal on a instance. - A Boolean value that specifies whether to enable or disable NAT traversal. - - - Gets the amount of data received from the network that is available to read. - The number of bytes of data received from the network. - An error occurred while attempting to access the socket. - The has been closed. - - - Receives a datagram from a remote host asynchronously. - An delegate that references the method to invoke when the operation is complete. - A user-defined object that contains information about the receive operation. This object is passed to the requestCallback delegate when the operation is complete. - An object that references the asynchronous receive. - - - Sends a datagram to a destination asynchronously. The destination is specified by the host name and port number. - A array that contains the data to be sent. - The number of bytes to send. - The destination host. - The destination port number. - An delegate that references the method to invoke when the operation is complete. - A user-defined object that contains information about the send operation. This object is passed to the requestCallback delegate when the operation is complete. - An object that references the asynchronous send. - - - Sends a datagram to a remote host asynchronously. The destination was specified previously by a call to . - A array that contains the data to be sent. - The number of bytes to send. - An delegate that references the method to invoke when the operation is complete. - A user-defined object that contains information about the send operation. This object is passed to the requestCallback delegate when the operation is complete. - An object that references the asynchronous send. - - - Sends a datagram to a destination asynchronously. The destination is specified by a . - A array that contains the data to be sent. - The number of bytes to send. - The that represents the destination for the data. - An delegate that references the method to invoke when the operation is complete. - A user-defined object that contains information about the send operation. This object is passed to the requestCallback delegate when the operation is complete. - An object that references the asynchronous send. - - - Gets or sets the underlying network . - The underlying Network . - - - Closes the UDP connection. - An error occurred when accessing the socket. - - - Establishes a default remote host using the specified network endpoint. - An that specifies the network endpoint to which you intend to send data. - An error occurred when accessing the socket. - endPoint is null. - The is closed. - - - Establishes a default remote host using the specified IP address and port number. - The of the remote host to which you intend to send data. - The port number to which you intend send data. - is closed. - addr is null. - port is not between and . - An error occurred when accessing the socket. - - - Establishes a default remote host using the specified host name and port number. - The DNS name of the remote host to which you intend send data. - The port number on the remote host to which you intend to send data. - The is closed. - port is not between and . - An error occurred when accessing the socket. - - - Releases the managed and unmanaged resources used by the . - - - Releases the unmanaged resources used by the and optionally releases the managed resources. - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - Gets or sets a value that specifies whether the allows Internet Protocol (IP) datagrams to be fragmented. - true if the allows datagram fragmentation; otherwise, false. The default is true. - This property can be set only for sockets that use the flag or the flag. - - - Leaves a multicast group. - The of the multicast group to leave. - The local address of the multicast group to leave. - The underlying has been closed. - An error occurred when accessing the socket. - The IP address is not compatible with the value that defines the addressing scheme of the socket. - multicastAddr is null. - - - Leaves a multicast group. - The of the multicast group to leave. - The underlying has been closed. - An error occurred when accessing the socket. - The IP address is not compatible with the value that defines the addressing scheme of the socket. - multicastAddr is null. - - - Gets or sets a value that specifies whether the may send or receive broadcast packets. - true if the allows broadcast packets; otherwise, false. The default is false. - - - Ends a pending asynchronous receive. - An object returned by a call to . - The specified remote endpoint. - If successful, the number of bytes received. If unsuccessful, this method returns 0. - asyncResult is null. - asyncResult was not returned by a call to the method. - was previously called for the asynchronous read. - An error occurred when attempting to access the underlying . - The underlying has been closed. - - - Ends a pending asynchronous send. - An object returned by a call to . - If successful, the number of bytes sent to the . - asyncResult is null. - asyncResult was not returned by a call to the method. - was previously called for the asynchronous read. - An error occurred when attempting to access the underlying socket. - The underlying has been closed. - - - Gets or sets a value that specifies whether the allows only one client to use a port. - true if the allows only one client to use a specific port; otherwise, false. The default is true for Windows Server 2003 and Windows XP Service Pack 2 and later, and false for all other versions. - An error occurred when attempting to access the underlying socket. - The underlying has been closed. - - - Adds a to a multicast group. - The multicast of the group you want to join. - The underlying has been closed. - An error occurred when accessing the socket. - The IP address is not compatible with the value that defines the addressing scheme of the socket. - - - Adds a to a multicast group. - The interface index associated with the local IP address on which to join the multicast group. - The multicast of the group you want to join. - The underlying has been closed. - An error occurred when accessing the socket. - - - Adds a to a multicast group with the specified Time to Live (TTL). - The of the multicast group to join. - The Time to Live (TTL), measured in router hops. - The TTL provided is not between 0 and 255 - The underlying has been closed. - An error occurred when accessing the socket. - multicastAddr is null. - The IP address is not compatible with the value that defines the addressing scheme of the socket. - - - Adds a to a multicast group. - The multicast of the group you want to join. - The local . - The underlying has been closed. - An error occurred when accessing the socket. - - - Gets or sets a value that specifies whether outgoing multicast packets are delivered to the sending application. - true if the receives outgoing multicast packets; otherwise, false. - - - Returns a UDP datagram that was sent by a remote host. - An that represents the remote host from which the data was sent. - An array of type that contains datagram data. - The underlying has been closed. - An error occurred when accessing the socket. - - - Returns a UDP datagram asynchronously that was sent by a remote host. - Returns . The task object representing the asynchronous operation. - The underlying has been closed. - An error occurred when accessing the socket. - - - Sends a UDP datagram to a remote host. - An array of type that specifies the UDP datagram that you intend to send represented as an array of bytes. - The number of bytes in the datagram. - The number of bytes sent. - dgram is null. - The has already established a default remote host. - The is closed. - An error occurred when accessing the socket. - - - Sends a UDP datagram to the host at the specified remote endpoint. - An array of type that specifies the UDP datagram that you intend to send, represented as an array of bytes. - The number of bytes in the datagram. - An that represents the host and port to which to send the datagram. - The number of bytes sent. - dgram is null. - has already established a default remote host. - is closed. - An error occurred when accessing the socket. - - - Sends a UDP datagram to a specified port on a specified remote host. - An array of type that specifies the UDP datagram that you intend to send represented as an array of bytes. - The number of bytes in the datagram. - The name of the remote host to which you intend to send the datagram. - The remote port number with which you intend to communicate. - The number of bytes sent. - dgram is null. - The has already established a default remote host. - The is closed. - An error occurred when accessing the socket. - - - Sends a UDP datagram asynchronously to a remote host. - An array of type that specifies the UDP datagram that you intend to send represented as an array of bytes. - The number of bytes in the datagram. - Returns . - dgram is null. - The has already established a default remote host. - The is closed. - An error occurred when accessing the socket. - - - Sends a UDP datagram asynchronously to a remote host. - An array of type that specifies the UDP datagram that you intend to send represented as an array of bytes. - The number of bytes in the datagram. - An that represents the host and port to which to send the datagram. - Returns . - dgram is null. - has already established a default remote host. - is closed. - An error occurred when accessing the socket. - - - Sends a UDP datagram asynchronously to a remote host. - An array of type that specifies the UDP datagram that you intend to send represented as an array of bytes. - The number of bytes in the datagram. - The name of the remote host to which you intend to send the datagram. - The remote port number with which you intend to communicate. - Returns . - dgram is null. - The has already established a default remote host. - The is closed. - An error occurred when accessing the socket. - - - Gets or sets a value that specifies the Time to Live (TTL) value of Internet Protocol (IP) packets sent by the . - The TTL value. - - - Presents UDP receive result information from a call to the method. - - - Initializes a new instance of the class. - A buffer for data to receive in the UDP packet. - The remote endpoint of the UDP packet. - - - Gets a buffer with the data received in the UDP packet. - Returns . A array with the data received in the UDP packet. - - - Returns a value that indicates whether this instance is equal to a specified object. - The object to compare with this instance. - Returns . true if other is an instance of and equals the value of the instance; otherwise, false. - - - Returns a value that indicates whether this instance is equal to a specified object. - The object to compare with this instance. - Returns . true if obj is an instance of and equals the value of the instance; otherwise, false. - - - Returns the hash code for this instance. - Returns . The hash code. - - - Tests whether two specified instances are equivalent. - The instance that is to the left of the equality operator. - The instance that is to the right of the equality operator. - Returns . true if left and right are equal; otherwise, false. - - - Tests whether two specified instances are not equal. - The instance that is to the left of the not equal operator. - The instance that is to the right of the not equal operator. - Returns . true if left and right are unequal; otherwise, false. - - - Gets the remote endpoint from which the UDP packet was received. - Returns . The remote endpoint from which the UDP packet was received. - - - The class provides additional context about the underlying transport layer. - - - Creates a new instance of the class - - - Retrieves the requested channel binding. - The type of channel binding to retrieve. - The requested , or null if the channel binding is not supported by the current transport or by the operating system. - kind is must be for use with the retrieved from the property. - - - Provides data for the event. - - - Gets the server reply to a data upload operation started by calling an method. - A array containing the server reply. - - - Represents the method that will handle the event of a . - The source of the event. - A containing event data. - - - Provides data for the event. - - - Gets the server reply to a data upload operation that is started by calling an method. - A array that contains the server reply. - - - Represents the method that will handle the event of a . - The source of the event. - A that contains event data. - - - Provides data for the event of a . - - - Gets the number of bytes received. - An value that indicates the number of bytes received. - - - Gets the number of bytes sent. - An value that indicates the number of bytes sent. - - - Gets the total number of bytes in a data upload operation. - An value that indicates the number of bytes that will be received. - - - Gets the total number of bytes to send. - An value that indicates the number of bytes that will be sent. - - - Represents the method that will handle the event of a . - The source of the event. - A containing event data. - - - Provides data for the event. - - - Gets the server reply to a string upload operation that is started by calling an method. - A array that contains the server reply. - - - Represents the method that will handle the event of a . - The source of the event. - A containing event data. - - - Provides data for the event. - - - Gets the server reply to a data upload operation started by calling an method. - A array containing the server reply. - - - Represents the method that will handle the event of a . - The source of the event. - A that contains event data. - - - Provides common methods for sending data to and receiving data from a resource identified by a URI. - - - Initializes a new instance of the class. - - - Gets or sets the base URI for requests made by a . - A containing the base URI for requests made by a or if no base address has been specified. - is set to an invalid URI. The inner exception may contain information that will help you locate the error. - - - Gets or sets the application's cache policy for any resources obtained by this WebClient instance using objects. - A object that represents the application's caching requirements. - - - Cancels a pending asynchronous operation. - - - Gets or sets the network credentials that are sent to the host and used to authenticate the request. - An containing the authentication credentials for the request. The default is null. - - - Downloads the resource as a array from the URI specified. - The URI from which to download data. - A array containing the downloaded resource. - The address parameter is null. - The URI formed by combining and address is invalid. -or- An error occurred while downloading data. - The method has been called simultaneously on multiple threads. - - - Downloads the resource as a array from the URI specified. - The URI represented by the object, from which to download data. - A array containing the downloaded resource. - The address parameter is null. - - - Downloads the resource as a array from the URI specified as an asynchronous operation. - A containing the URI to download. - The address parameter is null. - The URI formed by combining and address is invalid. -or- An error occurred while downloading the resource. - - - Downloads the resource as a array from the URI specified as an asynchronous operation. - A containing the URI to download. - A user-defined object that is passed to the method invoked when the asynchronous operation completes. - The address parameter is null. - The URI formed by combining and address is invalid. -or- An error occurred while downloading the resource. - - - Occurs when an asynchronous data download operation completes. - - - - Downloads the resource as a array from the URI specified as an asynchronous operation using a task object. - The URI of the resource to download. - Returns . The task object representing the asynchronous operation. The property on the task object returns a array containing the downloaded resource. - The address parameter is null. - The URI formed by combining and address is invalid. -or- An error occurred while downloading the resource. - - - Downloads the resource as a array from the URI specified as an asynchronous operation using a task object. - The URI of the resource to download. - Returns . The task object representing the asynchronous operation. The property on the task object returns a array containing the downloaded resource. - The address parameter is null. - The URI formed by combining and address is invalid. -or- An error occurred while downloading the resource. - - - Downloads the resource with the specified URI to a local file. - The URI specified as a , from which to download data. - The name of the local file that is to receive the data. - The address parameter is null. -or- The fileName parameter is null. - The URI formed by combining and address is invalid. -or- filename is null or . -or- The file does not exist. -or- An error occurred while downloading data. - The method has been called simultaneously on multiple threads. - - - Downloads the resource with the specified URI to a local file. - The URI from which to download data. - The name of the local file that is to receive the data. - The address parameter is null. - The URI formed by combining and address is invalid. -or- filename is null or . -or- The file does not exist. -or- An error occurred while downloading data. - The method has been called simultaneously on multiple threads. - - - Downloads, to a local file, the resource with the specified URI. This method does not block the calling thread. - The URI of the resource to download. - The name of the file to be placed on the local computer. - The address parameter is null. -or- The fileName parameter is null. - The URI formed by combining and address is invalid. -or- An error occurred while downloading the resource. - The local file specified by fileName is in use by another thread. - - - Downloads, to a local file, the resource with the specified URI. This method does not block the calling thread. - The URI of the resource to download. - The name of the file to be placed on the local computer. - A user-defined object that is passed to the method invoked when the asynchronous operation completes. - The address parameter is null. -or- The fileName parameter is null. - The URI formed by combining and address is invalid. -or- An error occurred while downloading the resource. - The local file specified by fileName is in use by another thread. - - - Occurs when an asynchronous file download operation completes. - - - - Downloads the specified resource to a local file as an asynchronous operation using a task object. - The URI of the resource to download. - The name of the file to be placed on the local computer. - Returns . The task object representing the asynchronous operation. - The address parameter is null. -or- The fileName parameter is null. - The URI formed by combining and address is invalid. -or- An error occurred while downloading the resource. - The local file specified by fileName is in use by another thread. - - - Downloads the specified resource to a local file as an asynchronous operation using a task object. - The URI of the resource to download. - The name of the file to be placed on the local computer. - Returns . The task object representing the asynchronous operation. - The address parameter is null. -or- The fileName parameter is null. - The URI formed by combining and address is invalid. -or- An error occurred while downloading the resource. - The local file specified by fileName is in use by another thread. - - - Occurs when an asynchronous download operation successfully transfers some or all of the data. - - - - Downloads the requested resource as a . The resource to download is specified as a containing the URI. - A containing the URI to download. - A containing the requested resource. - The address parameter is null. - The URI formed by combining and address is invalid. -or- An error occurred while downloading the resource. - The method has been called simultaneously on multiple threads. - - - Downloads the requested resource as a . The resource to download is specified as a . - A object containing the URI to download. - A containing the requested resource. - The address parameter is null. - The URI formed by combining and address is invalid. -or- An error occurred while downloading the resource. - The method has been called simultaneously on multiple threads. - - - Downloads the resource specified as a . This method does not block the calling thread. - A containing the URI to download. - The address parameter is null. - The URI formed by combining and address is invalid. -or- An error occurred while downloading the resource. - - - Downloads the specified string to the specified resource. This method does not block the calling thread. - A containing the URI to download. - A user-defined object that is passed to the method invoked when the asynchronous operation completes. - The address parameter is null. - The URI formed by combining and address is invalid. -or- An error occurred while downloading the resource. - - - Occurs when an asynchronous resource-download operation completes. - - - - Downloads the resource as a from the URI specified as an asynchronous operation using a task object. - The URI of the resource to download. - Returns . The task object representing the asynchronous operation. The property on the task object returns a array containing the downloaded resource. - The address parameter is null. - The URI formed by combining and address is invalid. -or- An error occurred while downloading the resource. - - - Downloads the resource as a from the URI specified as an asynchronous operation using a task object. - The URI of the resource to download. - Returns . The task object representing the asynchronous operation. The property on the task object returns a array containing the downloaded resource. - The address parameter is null. - The URI formed by combining and address is invalid. -or- An error occurred while downloading the resource. - - - Gets and sets the used to upload and download strings. - A that is used to encode strings. The default value of this property is the encoding returned by . - - - Returns a object for the specified resource. - A that identifies the resource to request. - A new object for the specified resource. - - - Returns the for the specified . - A that is used to obtain the response. - A containing the response for the specified . - - - Returns the for the specified using the specified . - A that is used to obtain the response. - An object obtained from a previous call to . - A containing the response for the specified . - - - Gets or sets a collection of header name/value pairs associated with the request. - A containing header name/value pairs associated with this request. - - - Gets whether a Web request is in progress. - true if the Web request is still in progress; otherwise false. - - - Raises the event. - A object that contains event data. - - - Raises the event. - An object containing event data. - - - Raises the event. - A object containing event data. - - - Raises the event. - A object containing event data. - - - Raises the event. - A object containing event data. - - - Raises the event. - A object containing event data. - - - Raises the event. - A object containing event data. - - - Raises the event. - An object containing event data. - - - Raises the event. - An object containing event data. - - - Raises the event. - An object containing event data. - - - Raises the event. - A object containing event data. - - - Opens a readable stream for the data downloaded from a resource with the URI specified as a . - The URI specified as a from which to download data. - A used to read data from a resource. - The address parameter is null. - The URI formed by combining , address is invalid. -or- An error occurred while downloading data. - - - Opens a readable stream for the data downloaded from a resource with the URI specified as a - The URI specified as a from which to download data. - A used to read data from a resource. - The address parameter is null. - The URI formed by combining , address is invalid. -or- An error occurred while downloading data. - - - Opens a readable stream containing the specified resource. This method does not block the calling thread. - The URI of the resource to retrieve. - The address parameter is null. - The URI formed by combining and address is invalid. -or- An error occurred while downloading the resource. -or- An error occurred while opening the stream. - - - Opens a readable stream containing the specified resource. This method does not block the calling thread. - The URI of the resource to retrieve. - A user-defined object that is passed to the method invoked when the asynchronous operation completes. - The address parameter is null. - The URI formed by combining and address is invalid. -or- An error occurred while downloading the resource. -or- An error occurred while opening the stream. - - - Occurs when an asynchronous operation to open a stream containing a resource completes. - - - - Opens a readable stream containing the specified resource as an asynchronous operation using a task object. - The URI of the resource to retrieve. - Returns . The task object representing the asynchronous operation. The property on the task object returns a used to read data from a resource. - The address parameter is null. - The URI formed by combining and address is invalid. -or- An error occurred while downloading the resource. -or- An error occurred while opening the stream. - - - Opens a readable stream containing the specified resource as an asynchronous operation using a task object. - The URI of the resource to retrieve. - Returns . The task object representing the asynchronous operation. The property on the task object returns a used to read data from a resource. - The address parameter is null. - The URI formed by combining and address is invalid. -or- An error occurred while downloading the resource. -or- An error occurred while opening the stream. - - - Opens a stream for writing data to the specified resource. - The URI of the resource to receive the data. - A used to write data to the resource. - The address parameter is null. - The URI formed by combining , and address is invalid. -or- An error occurred while opening the stream. - - - Opens a stream for writing data to the specified resource. - The URI of the resource to receive the data. - A used to write data to the resource. - The address parameter is null. - The URI formed by combining , and address is invalid. -or- An error occurred while opening the stream. - - - Opens a stream for writing data to the specified resource, using the specified method. - The URI of the resource to receive the data. - The method used to send the data to the resource. If null, the default is POST for http and STOR for ftp. - A used to write data to the resource. - The address parameter is null. - The URI formed by combining , and address is invalid. -or- An error occurred while opening the stream. - - - Opens a stream for writing data to the specified resource, by using the specified method. - The URI of the resource to receive the data. - The method used to send the data to the resource. If null, the default is POST for http and STOR for ftp. - A used to write data to the resource. - The address parameter is null. - The URI formed by combining , and address is invalid. -or- An error occurred while opening the stream. - - - Opens a stream for writing data to the specified resource, using the specified method. This method does not block the calling thread. - The URI of the resource to receive the data. - The method used to send the data to the resource. If null, the default is POST for http and STOR for ftp. - A user-defined object that is passed to the method invoked when the asynchronous operation completes - The address parameter is null. - The URI formed by combining and address is invalid. -or- An error occurred while opening the stream. - - - Opens a stream for writing data to the specified resource. This method does not block the calling thread. - The URI of the resource to receive the data. - The method used to send the data to the resource. If null, the default is POST for http and STOR for ftp. - The address parameter is null. - - - Opens a stream for writing data to the specified resource. This method does not block the calling thread. - The URI of the resource to receive the data. - The address parameter is null. - - - Occurs when an asynchronous operation to open a stream to write data to a resource completes. - - - - Opens a stream for writing data to the specified resource as an asynchronous operation using a task object. - The URI of the resource to receive the data. - Returns . The task object representing the asynchronous operation. The property on the task object returns a used to write data to the resource. - The address parameter is null. - The URI formed by combining and address is invalid. -or- An error occurred while opening the stream. - - - Opens a stream for writing data to the specified resource as an asynchronous operation using a task object. - The URI of the resource to receive the data. - Returns . The task object representing the asynchronous operation. The property on the task object returns a used to write data to the resource. - The address parameter is null. - The URI formed by combining and address is invalid. -or- An error occurred while opening the stream. - - - Opens a stream for writing data to the specified resource as an asynchronous operation using a task object. - The URI of the resource to receive the data. - The method used to send the data to the resource. If null, the default is POST for http and STOR for ftp. - Returns . The task object representing the asynchronous operation. The property on the task object returns a used to write data to the resource. - The address parameter is null. - The URI formed by combining and address is invalid. -or- An error occurred while opening the stream. - - - Opens a stream for writing data to the specified resource as an asynchronous operation using a task object. - The URI of the resource to receive the data. - The method used to send the data to the resource. If null, the default is POST for http and STOR for ftp. - Returns . The task object representing the asynchronous operation. The property on the task object returns a used to write data to the resource. - The address parameter is null. - The URI formed by combining and address is invalid. -or- An error occurred while opening the stream. - - - Gets or sets the proxy used by this object. - An instance used to send requests. - is set to null. - - - Gets or sets a collection of query name/value pairs associated with the request. - A that contains query name/value pairs associated with the request. If no pairs are associated with the request, the value is an empty . - - - Gets a collection of header name/value pairs associated with the response. - A containing header name/value pairs associated with the response, or null if no response has been received. - - - Uploads a data buffer to a resource identified by a URI. - The URI of the resource to receive the data. - The data buffer to send to the resource. - A array containing the body of the response from the resource. - The address parameter is null. - The URI formed by combining , and address is invalid. -or- data is null. -or- An error occurred while sending the data. -or- There was no response from the server hosting the resource. - - - Uploads a data buffer to a resource identified by a URI. - The URI of the resource to receive the data. - The data buffer to send to the resource. - A array containing the body of the response from the resource. - The address parameter is null. - The URI formed by combining , and address is invalid. -or- data is null. -or- An error occurred while sending the data. -or- There was no response from the server hosting the resource. - - - Uploads a data buffer to the specified resource, using the specified method. - The URI of the resource to receive the data. - The HTTP method used to send the data to the resource. If null, the default is POST for http and STOR for ftp. - The data buffer to send to the resource. - A array containing the body of the response from the resource. - The address parameter is null. - The URI formed by combining , and address is invalid. -or- data is null. -or- An error occurred while uploading the data. -or- There was no response from the server hosting the resource. - - - Uploads a data buffer to the specified resource, using the specified method. - The URI of the resource to receive the data. - The HTTP method used to send the data to the resource. If null, the default is POST for http and STOR for ftp. - The data buffer to send to the resource. - A array containing the body of the response from the resource. - The address parameter is null. - The URI formed by combining , and address is invalid. -or- data is null. -or- An error occurred while uploading the data. -or- There was no response from the server hosting the resource. - - - Uploads a data buffer to a resource identified by a URI, using the specified method. This method does not block the calling thread. - The URI of the resource to receive the data. - The method used to send the data to the resource. If null, the default is POST for http and STOR for ftp. - The data buffer to send to the resource. - The address parameter is null. - The URI formed by combining and address is invalid. -or- An error occurred while opening the stream. -or- There was no response from the server hosting the resource. - - - Uploads a data buffer to a resource identified by a URI, using the specified method and identifying token. - The URI of the resource to receive the data. - The method used to send the data to the resource. If null, the default is POST for http and STOR for ftp. - The data buffer to send to the resource. - A user-defined object that is passed to the method invoked when the asynchronous operation completes. - The address parameter is null. - The URI formed by combining and address is invalid. -or- An error occurred while opening the stream. -or- There was no response from the server hosting the resource. - - - Uploads a data buffer to a resource identified by a URI, using the POST method. This method does not block the calling thread. - The URI of the resource to receive the data. - The data buffer to send to the resource. - The address parameter is null. - The URI formed by combining and address is invalid. -or- An error occurred while opening the stream. -or- There was no response from the server hosting the resource. - - - Occurs when an asynchronous data-upload operation completes. - - - - Uploads a data buffer that contains a array to the URI specified as an asynchronous operation using a task object. - The URI of the resource to receive the data. - The data buffer to send to the resource. - Returns . The task object representing the asynchronous operation. The property on the task object returns a array containing the body of the response received from the resource when the data buffer was uploaded. - The address parameter is null. - The URI formed by combining and address is invalid. -or- An error occurred while opening the stream. -or- There was no response from the server hosting the resource. - - - Uploads a data buffer that contains a array to the URI specified as an asynchronous operation using a task object. - The URI of the resource to receive the data. - The data buffer to send to the resource. - Returns . The task object representing the asynchronous operation. The property on the task object returns a array containing the body of the response received from the resource when the data buffer was uploaded. - The address parameter is null. - The URI formed by combining and address is invalid. -or- An error occurred while opening the stream. -or- There was no response from the server hosting the resource. - - - Uploads a data buffer that contains a array to the URI specified as an asynchronous operation using a task object. - The URI of the resource to receive the data. - The method used to send the data to the resource. If null, the default is POST for http and STOR for ftp. - The data buffer to send to the resource. - Returns . The task object representing the asynchronous operation. The property on the task object returns a array containing the body of the response received from the resource when the data buffer was uploaded. - The address parameter is null. - The URI formed by combining and address is invalid. -or- An error occurred while opening the stream. -or- There was no response from the server hosting the resource. - - - Uploads a data buffer that contains a array to the URI specified as an asynchronous operation using a task object. - The URI of the resource to receive the data. - The method used to send the data to the resource. If null, the default is POST for http and STOR for ftp. - The data buffer to send to the resource. - Returns . The task object representing the asynchronous operation. The property on the task object returns a array containing the body of the response received from the resource when the data buffer was uploaded. - The address parameter is null. - The URI formed by combining and address is invalid. -or- An error occurred while opening the stream. -or- There was no response from the server hosting the resource. - - - Uploads the specified local file to a resource with the specified URI. - The URI of the resource to receive the file. For example, ftp://localhost/samplefile.txt. - The file to send to the resource. For example, "samplefile.txt". - A array containing the body of the response from the resource. - The address parameter is null. -or- The fileName parameter is null. - The URI formed by combining , and address is invalid. -or- fileName is null, is , contains invalid characters, or does not exist. -or- An error occurred while uploading the file. -or- There was no response from the server hosting the resource. -or- The Content-type header begins with multipart. - - - Uploads the specified local file to a resource with the specified URI. - The URI of the resource to receive the file. For example, ftp://localhost/samplefile.txt. - The file to send to the resource. For example, "samplefile.txt". - A array containing the body of the response from the resource. - The address parameter is null. -or- The fileName parameter is null. - The URI formed by combining , and address is invalid. -or- fileName is null, is , contains invalid characters, or does not exist. -or- An error occurred while uploading the file. -or- There was no response from the server hosting the resource. -or- The Content-type header begins with multipart. - - - Uploads the specified local file to the specified resource, using the specified method. - The URI of the resource to receive the file. - The method used to send the file to the resource. If null, the default is POST for http and STOR for ftp. - The file to send to the resource. - A array containing the body of the response from the resource. - The address parameter is null. -or- The fileName parameter is null. - The URI formed by combining , and address is invalid. -or- fileName is null, is , contains invalid characters, or does not exist. -or- An error occurred while uploading the file. -or- There was no response from the server hosting the resource. -or- The Content-type header begins with multipart. - - - Uploads the specified local file to the specified resource, using the specified method. - The URI of the resource to receive the file. - The method used to send the file to the resource. If null, the default is POST for http and STOR for ftp. - The file to send to the resource. - A array containing the body of the response from the resource. - The address parameter is null. -or- The fileName parameter is null. - The URI formed by combining , and address is invalid. -or- fileName is null, is , contains invalid characters, or does not exist. -or- An error occurred while uploading the file. -or- There was no response from the server hosting the resource. -or- The Content-type header begins with multipart. - - - Uploads the specified local file to the specified resource, using the POST method. This method does not block the calling thread. - The URI of the resource to receive the file. For HTTP resources, this URI must identify a resource that can accept a request sent with the POST method, such as a script or ASP page. - The file to send to the resource. - The address parameter is null. -or- The fileName parameter is null. - The URI formed by combining and address is invalid. -or- fileName is null, is , contains invalid character, or the specified path to the file does not exist. -or- An error occurred while opening the stream. -or- There was no response from the server hosting the resource. -or- The Content-type header begins with multipart. - - - Uploads the specified local file to the specified resource, using the POST method. This method does not block the calling thread. - The URI of the resource to receive the file. For HTTP resources, this URI must identify a resource that can accept a request sent with the POST method, such as a script or ASP page. - The method used to send the data to the resource. If null, the default is POST for http and STOR for ftp. - The file to send to the resource. - The address parameter is null. -or- The fileName parameter is null. - The URI formed by combining and address is invalid. -or- fileName is null, is , contains invalid character, or the specified path to the file does not exist. -or- An error occurred while opening the stream. -or- There was no response from the server hosting the resource. -or- The Content-type header begins with multipart. - - - Uploads the specified local file to the specified resource, using the POST method. This method does not block the calling thread. - The URI of the resource to receive the file. For HTTP resources, this URI must identify a resource that can accept a request sent with the POST method, such as a script or ASP page. - The method used to send the data to the resource. If null, the default is POST for http and STOR for ftp. - The file to send to the resource. - A user-defined object that is passed to the method invoked when the asynchronous operation completes. - The address parameter is null. -or- The fileName parameter is null. - The URI formed by combining and address is invalid. -or- fileName is null, is , contains invalid character, or the specified path to the file does not exist. -or- An error occurred while opening the stream. -or- There was no response from the server hosting the resource. -or- The Content-type header begins with multipart. - - - Occurs when an asynchronous file-upload operation completes. - - - - Uploads the specified local file to a resource as an asynchronous operation using a task object. - The URI of the resource to receive the file. For HTTP resources, this URI must identify a resource that can accept a request sent with the POST method, such as a script or ASP page. - The method used to send the data to the resource. If null, the default is POST for http and STOR for ftp. - The local file to send to the resource. - Returns . The task object representing the asynchronous operation. The property on the task object returns a array containing the body of the response received from the resource when the file was uploaded. - The address parameter is null. -or- The fileName parameter is null. - The URI formed by combining and address is invalid. -or- fileName is null, is , contains invalid character, or the specified path to the file does not exist. -or- An error occurred while opening the stream. -or- There was no response from the server hosting the resource. -or- The Content-type header begins with multipart. - - - Uploads the specified local file to a resource as an asynchronous operation using a task object. - The URI of the resource to receive the file. For HTTP resources, this URI must identify a resource that can accept a request sent with the POST method, such as a script or ASP page. - The method used to send the data to the resource. If null, the default is POST for http and STOR for ftp. - The local file to send to the resource. - Returns . The task object representing the asynchronous operation. The property on the task object returns a array containing the body of the response received from the resource when the file was uploaded. - The address parameter is null. -or- The fileName parameter is null. - The URI formed by combining and address is invalid. -or- fileName is null, is , contains invalid character, or the specified path to the file does not exist. -or- An error occurred while opening the stream. -or- There was no response from the server hosting the resource. -or- The Content-type header begins with multipart. - - - Uploads the specified local file to a resource as an asynchronous operation using a task object. - The URI of the resource to receive the file. For HTTP resources, this URI must identify a resource that can accept a request sent with the POST method, such as a script or ASP page. - The local file to send to the resource. - Returns . The task object representing the asynchronous operation. The property on the task object returns a array containing the body of the response received from the resource when the file was uploaded. - The address parameter is null. -or- The fileName parameter is null. - The URI formed by combining and address is invalid. -or- fileName is null, is , contains invalid character, or the specified path to the file does not exist. -or- An error occurred while opening the stream. -or- There was no response from the server hosting the resource. -or- The Content-type header begins with multipart. - - - Uploads the specified local file to a resource as an asynchronous operation using a task object. - The URI of the resource to receive the file. For HTTP resources, this URI must identify a resource that can accept a request sent with the POST method, such as a script or ASP page. - The local file to send to the resource. - Returns . The task object representing the asynchronous operation. The property on the task object returns a array containing the body of the response received from the resource when the file was uploaded. - The address parameter is null. -or- The fileName parameter is null. - The URI formed by combining and address is invalid. -or- fileName is null, is , contains invalid character, or the specified path to the file does not exist. -or- An error occurred while opening the stream. -or- There was no response from the server hosting the resource. -or- The Content-type header begins with multipart. - - - Occurs when an asynchronous upload operation successfully transfers some or all of the data. - - - - Uploads the specified string to the specified resource, using the POST method. - The URI of the resource to receive the string. For Http resources, this URI must identify a resource that can accept a request sent with the POST method, such as a script or ASP page. - The string to be uploaded. - A containing the response sent by the server. - The address parameter is null. -or- The data parameter is null. - The URI formed by combining and address is invalid. -or- There was no response from the server hosting the resource. - - - Uploads the specified string to the specified resource, using the POST method. - The URI of the resource to receive the string. For Http resources, this URI must identify a resource that can accept a request sent with the POST method, such as a script or ASP page. - The string to be uploaded. - A containing the response sent by the server. - The address parameter is null. -or- The data parameter is null. - The URI formed by combining and address is invalid. -or- There was no response from the server hosting the resource. - - - Uploads the specified string to the specified resource, using the specified method. - The URI of the resource to receive the string. This URI must identify a resource that can accept a request sent with the method method. - The HTTP method used to send the string to the resource. If null, the default is POST for http and STOR for ftp. - The string to be uploaded. - A containing the response sent by the server. - The address parameter is null. -or- The data parameter is null. - The URI formed by combining and address is invalid. -or- There was no response from the server hosting the resource. -or- method cannot be used to send content. - - - Uploads the specified string to the specified resource, using the specified method. - The URI of the resource to receive the string. This URI must identify a resource that can accept a request sent with the method method. - The HTTP method used to send the string to the resource. If null, the default is POST for http and STOR for ftp. - The string to be uploaded. - A containing the response sent by the server. - The address parameter is null. -or- The data parameter is null. - The URI formed by combining and address is invalid. -or- There was no response from the server hosting the resource. -or- method cannot be used to send content. - - - Uploads the specified string to the specified resource. This method does not block the calling thread. - The URI of the resource to receive the string. For HTTP resources, this URI must identify a resource that can accept a request sent with the POST method, such as a script or ASP page. - The string to be uploaded. - The address parameter is null. -or- The data parameter is null. - The URI formed by combining and address is invalid. -or- There was no response from the server hosting the resource. - - - Uploads the specified string to the specified resource. This method does not block the calling thread. - The URI of the resource to receive the string. For HTTP resources, this URI must identify a resource that can accept a request sent with the POST method, such as a script or ASP page. - The HTTP method used to send the file to the resource. If null, the default is POST for http and STOR for ftp. - The string to be uploaded. - The address parameter is null. -or- The data parameter is null. - The URI formed by combining and address is invalid. -or- method cannot be used to send content. -or- There was no response from the server hosting the resource. - - - Uploads the specified string to the specified resource. This method does not block the calling thread. - The URI of the resource to receive the string. For HTTP resources, this URI must identify a resource that can accept a request sent with the POST method, such as a script or ASP page. - The HTTP method used to send the file to the resource. If null, the default is POST for http and STOR for ftp. - The string to be uploaded. - A user-defined object that is passed to the method invoked when the asynchronous operation completes. - The address parameter is null. -or- The data parameter is null. - The URI formed by combining and address is invalid. -or- method cannot be used to send content. -or- There was no response from the server hosting the resource. - - - Occurs when an asynchronous string-upload operation completes. - - - - Uploads the specified string to the specified resource as an asynchronous operation using a task object. - The URI of the resource to receive the string. For HTTP resources, this URI must identify a resource that can accept a request sent with the POST method, such as a script or ASP page. - The HTTP method used to send the file to the resource. If null, the default is POST for http and STOR for ftp. - The string to be uploaded. - Returns . The task object representing the asynchronous operation. The property on the task object returns a containing the response sent by the server. - The address parameter is null. -or- The data parameter is null. - The URI formed by combining and address is invalid. -or- method cannot be used to send content. -or- There was no response from the server hosting the resource. - - - Uploads the specified string to the specified resource as an asynchronous operation using a task object. - The URI of the resource to receive the string. For HTTP resources, this URI must identify a resource that can accept a request sent with the POST method, such as a script or ASP page. - The HTTP method used to send the file to the resource. If null, the default is POST for http and STOR for ftp. - The string to be uploaded. - Returns . The task object representing the asynchronous operation. The property on the task object returns a containing the response sent by the server. - The address parameter is null. -or- The data parameter is null. - The URI formed by combining and address is invalid. -or- method cannot be used to send content. -or- There was no response from the server hosting the resource. - - - Uploads the specified string to the specified resource as an asynchronous operation using a task object. - The URI of the resource to receive the string. For HTTP resources, this URI must identify a resource that can accept a request sent with the POST method, such as a script or ASP page. - The string to be uploaded. - Returns . The task object representing the asynchronous operation. The property on the task object returns a containing the response sent by the server. - The address parameter is null. -or- The data parameter is null. - The URI formed by combining and address is invalid. -or- There was no response from the server hosting the resource. - - - Uploads the specified string to the specified resource as an asynchronous operation using a task object. - The URI of the resource to receive the string. For HTTP resources, this URI must identify a resource that can accept a request sent with the POST method, such as a script or ASP page. - The string to be uploaded. - Returns . The task object representing the asynchronous operation. The property on the task object returns a containing the response sent by the server. - The address parameter is null. -or- The data parameter is null. - The URI formed by combining and address is invalid. -or- There was no response from the server hosting the resource. - - - Uploads the specified name/value collection to the resource identified by the specified URI. - The URI of the resource to receive the collection. - The to send to the resource. - A array containing the body of the response from the resource. - The address parameter is null. -or- The data parameter is null. - The URI formed by combining , and address is invalid. -or- data is null. -or- There was no response from the server hosting the resource. -or- An error occurred while opening the stream. -or- The Content-type header is not null or "application/x-www-form-urlencoded". - - - Uploads the specified name/value collection to the resource identified by the specified URI. - The URI of the resource to receive the collection. - The to send to the resource. - A array containing the body of the response from the resource. - The address parameter is null. -or- The data parameter is null. - The URI formed by combining , and address is invalid. -or- data is null. -or- There was no response from the server hosting the resource. -or- An error occurred while opening the stream. -or- The Content-type header is not null or "application/x-www-form-urlencoded". - - - Uploads the specified name/value collection to the resource identified by the specified URI, using the specified method. - The URI of the resource to receive the collection. - The HTTP method used to send the file to the resource. If null, the default is POST for http and STOR for ftp. - The to send to the resource. - A array containing the body of the response from the resource. - The address parameter is null. -or- The data parameter is null. - The URI formed by combining , and address is invalid. -or- data is null. -or- An error occurred while opening the stream. -or- There was no response from the server hosting the resource. -or- The Content-type header value is not null and is not application/x-www-form-urlencoded. - - - Uploads the specified name/value collection to the resource identified by the specified URI, using the specified method. - The URI of the resource to receive the collection. - The HTTP method used to send the file to the resource. If null, the default is POST for http and STOR for ftp. - The to send to the resource. - A array containing the body of the response from the resource. - The address parameter is null. -or- The data parameter is null. - The URI formed by combining , and address is invalid. -or- data is null. -or- An error occurred while opening the stream. -or- There was no response from the server hosting the resource. -or- The Content-type header value is not null and is not application/x-www-form-urlencoded. - - - Uploads the data in the specified name/value collection to the resource identified by the specified URI. This method does not block the calling thread. - The URI of the resource to receive the collection. This URI must identify a resource that can accept a request sent with the default method. - The to send to the resource. - The address parameter is null. -or- The data parameter is null. - The URI formed by combining and address is invalid. -or- There was no response from the server hosting the resource. - - - Uploads the data in the specified name/value collection to the resource identified by the specified URI, using the specified method. This method does not block the calling thread. - The URI of the resource to receive the collection. This URI must identify a resource that can accept a request sent with the method method. - The method used to send the string to the resource. If null, the default is POST for http and STOR for ftp. - The to send to the resource. - The address parameter is null. -or- The data parameter is null. - The URI formed by combining and address is invalid. -or- There was no response from the server hosting the resource. -or- method cannot be used to send content. - - - Uploads the data in the specified name/value collection to the resource identified by the specified URI, using the specified method. This method does not block the calling thread, and allows the caller to pass an object to the method that is invoked when the operation completes. - The URI of the resource to receive the collection. This URI must identify a resource that can accept a request sent with the method method. - The HTTP method used to send the string to the resource. If null, the default is POST for http and STOR for ftp. - The to send to the resource. - A user-defined object that is passed to the method invoked when the asynchronous operation completes. - The address parameter is null. -or- The data parameter is null. - The URI formed by combining and address is invalid. -or- There was no response from the server hosting the resource. -or- method cannot be used to send content. - - - Occurs when an asynchronous upload of a name/value collection completes. - - - - Uploads the specified name/value collection to the resource identified by the specified URI as an asynchronous operation using a task object. - The URI of the resource to receive the collection. - The HTTP method used to send the collection to the resource. If null, the default is POST for http and STOR for ftp. - The to send to the resource. - Returns . The task object representing the asynchronous operation. The property on the task object returns a array containing the response sent by the server. - The address parameter is null. -or- The data parameter is null. - The URI formed by combining , and address is invalid. -or- method cannot be used to send content. -or- There was no response from the server hosting the resource. -or- An error occurred while opening the stream. -or- The Content-type header is not null or "application/x-www-form-urlencoded". - - - Uploads the specified name/value collection to the resource identified by the specified URI as an asynchronous operation using a task object. - The URI of the resource to receive the collection. - The to send to the resource. - Returns . The task object representing the asynchronous operation. The property on the task object returns a array containing the response sent by the server. - The address parameter is null. -or- The data parameter is null. - The URI formed by combining , and address is invalid. -or- There was no response from the server hosting the resource. -or- An error occurred while opening the stream. -or- The Content-type header is not null or "application/x-www-form-urlencoded". - - - Uploads the specified name/value collection to the resource identified by the specified URI as an asynchronous operation using a task object. - The URI of the resource to receive the collection. - The to send to the resource. - Returns . The task object representing the asynchronous operation. The property on the task object returns a array containing the response sent by the server. - The address parameter is null. -or- The data parameter is null. - The URI formed by combining , and address is invalid. -or- An error occurred while opening the stream. -or- There was no response from the server hosting the resource. -or- The Content-type header value is not null and is not application/x-www-form-urlencoded. - - - Uploads the specified name/value collection to the resource identified by the specified URI as an asynchronous operation using a task object. - The URI of the resource to receive the collection. - The HTTP method used to send the collection to the resource. If null, the default is POST for http and STOR for ftp. - The to send to the resource. - Returns . The task object representing the asynchronous operation. The property on the task object returns a array containing the response sent by the server. - The address parameter is null. -or- The data parameter is null. - The URI formed by combining , and address is invalid. -or- method cannot be used to send content. -or- There was no response from the server hosting the resource. -or- An error occurred while opening the stream. -or- The Content-type header is not null or "application/x-www-form-urlencoded". - - - Gets or sets a value that controls whether the are sent with requests. - true if the default credentials are used; otherwise false. The default value is false. - - - The exception that is thrown when an error occurs while accessing the network through a pluggable protocol. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with the specified error message. - The text of the error message. - - - Initializes a new instance of the class from the specified and instances. - A that contains the information required to serialize the new . - A that contains the source of the serialized stream that is associated with the new . - - - Initializes a new instance of the class with the specified error message and nested exception. - The text of the error message. - A nested exception. - - - Initializes a new instance of the class with the specified error message and status. - The text of the error message. - One of the values. - - - Initializes a new instance of the class with the specified error message, nested exception, status, and response. - The text of the error message. - A nested exception. - One of the values. - A instance that contains the response from the remote host. - - - Populates a instance with the data needed to serialize the . - The to be used. - The to be used. - - - Gets the response that the remote host returned. - If a response is available from the Internet resource, a instance that contains the error response from an Internet resource; otherwise, null. - - - Gets the status of the response. - One of the values. - - - Serializes this instance into the specified object. - The object into which this will be serialized. - The destination of the serialization. - - - Defines status codes for the class. - - - The specified cache entry was not found. - - - - The remote service point could not be contacted at the transport level. - - - - The connection was prematurely closed. - - - - The connection for a request that specifies the Keep-alive header was closed unexpectedly. - - - - A message was received that exceeded the specified limit when sending a request or receiving a response from the server. - - - - The name resolver service could not resolve the host name. - - - - An internal asynchronous request is pending. - - - - The request was a pipelined request and the connection was closed before the response was received. - - - - The response received from the server was complete but indicated a protocol-level error. For example, an HTTP protocol error such as 401 Access Denied would use this status. - - - - The name resolver service could not resolve the proxy host name. - - - - A complete response was not received from the remote server. - - - - The request was canceled, the method was called, or an unclassifiable error occurred. This is the default value for . - - - - The request was not permitted by the cache policy. In general, this occurs when a request is not cacheable and the effective policy prohibits sending the request to the server. You might receive this status if a request method implies the presence of a request body, a request method requires direct interaction with the server, or a request contains a conditional header. - - - - This request was not permitted by the proxy. - - - - An error occurred while establishing a connection using SSL. - - - - A complete request could not be sent to the remote server. - - - - The server response was not a valid HTTP response. - - - - No error was encountered. - - - - No response was received during the time-out period for a request. - - - - A server certificate could not be validated. - - - - An exception of unknown type has occurred. - - - - Contains protocol headers associated with a request or response. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class from the specified instances of the and classes. - A containing the information required to serialize the . - A containing the source of the serialized stream associated with the new . - headerName contains invalid characters. - headerName is a null reference or . - - - Inserts the specified header into the collection. - The header to add, with the name and value separated by a colon. - header is null or . - header does not contain a colon (:) character. The length of value is greater than 65535. -or- The name part of header is or contains invalid characters. -or- header is a restricted header that should be set with a property. -or- The value part of header contains invalid characters. - The length the string after the colon (:) is greater than 65535. - - - Inserts the specified header with the specified value into the collection. - The header to add to the collection. - The content of the header. - The length of value is greater than 65535. - This instance does not allow instances of . - - - Inserts the specified header with the specified value into the collection. - The header to add to the collection. - The content of the header. - The length of value is greater than 65535. - This instance does not allow instances of . - - - Inserts a header with the specified name and value into the collection. - The header to add to the collection. - The content of the header. - name is null, , or contains invalid characters. -or- name is a restricted header that must be set with a property setting. -or- value contains invalid characters. - The length of value is greater than 65535. - - - Inserts a header into the collection without checking whether the header is on the restricted header list. - The header to add to the collection. - The content of the header. - headerName is null, , or contains invalid characters. -or- headerValue contains invalid characters. - headerName is not null and the length of headerValue is too long (greater than 65,535 characters). - - - Gets all header names (keys) in the collection. - An array of type containing all header names in a Web request. - - - Removes all headers from the collection. - - - Gets the number of headers in the collection. - An indicating the number of headers in a request. - - - Gets the value of a particular header in the collection, specified by an index into the collection. - The zero-based index of the key to get from the collection. - A containing the value of the specified header. - index is negative. -or- index exceeds the size of the collection. - - - Gets the value of a particular header in the collection, specified by the name of the header. - The name of the Web header. - A holding the value of the specified header. - - - Returns an enumerator that can iterate through the instance. - An for the . - - - Gets the header name at the specified position in the collection. - The zero-based index of the key to get from the collection. - A holding the header name. - index is negative. -or- index exceeds the size of the collection. - - - Populates a with the data needed to serialize the target object. - The to populate with data. - A that specifies the destination for this serialization. - - - Gets an array of header values stored in a header. - The header to return. - An array of header strings. - - - Gets an array of header values stored in the index position of the header collection. - The header index to return. - An array of header strings. - - - Tests whether the specified HTTP header can be set for the request. - The header to test. - true if the header is restricted; otherwise false. - headerName is null or . - headerName contains invalid characters. - - - Tests whether the specified HTTP header can be set for the request or the response. - The header to test. - Does the Framework test the response or the request? - true if the header is restricted; otherwise, false. - headerName is null or . - headerName contains invalid characters. - - - Gets or sets the specified request header. - The request header value. - A instance containing the specified header value. - This instance does not allow instances of . - - - Gets or sets the specified response header. - The response header value. - A instance containing the specified header. - The length of value is greater than 65535. - This instance does not allow instances of . - - - Gets the collection of header names (keys) in the collection. - A containing all header names in a Web request. - - - Implements the interface and raises the deserialization event when the deserialization is complete. - The source of the deserialization event. - - - Removes the specified header from the collection. - The instance to remove from the collection. - This instance does not allow instances of . - - - Removes the specified header from the collection. - The instance to remove from the collection. - This instance does not allow instances of . - - - Removes the specified header from the collection. - The name of the header to remove from the collection. - name is null. - name is a restricted header. -or- name contains invalid characters. - - - Sets the specified header to the specified value. - The value to set. - The content of the header to set. - The length of value is greater than 65535. - This instance does not allow instances of . - - - Sets the specified header to the specified value. - The value to set. - The content of the header to set. - The length of value is greater than 65535. - This instance does not allow instances of . - - - Sets the specified header to the specified value. - The header to set. - The content of the header to set. - name is null or . - The length of value is greater than 65535. - name is a restricted header. -or- name or value contain invalid characters. - - - Converts the to a byte array.. - A array holding the header collection. - - - This method is obsolete. - The representation of the collection. - - - Serializes this instance into the specified object. - The object into which this will be serialized. - The destination of the serialization. - - - Contains HTTP proxy settings for the class. - - - Initializes an empty instance of the class. - - - Initializes a new instance of the class with the specified URI. - The URI of the proxy server. - Address is an invalid URI. - - - Initializes a new instance of the class from the specified instance. - A instance that contains the address of the proxy server. - - - Initializes an instance of the class using previously serialized content. - The serialization data. - The context for the serialized data. - - - Initializes a new instance of the class with the specified URI and bypass setting. - The URI of the proxy server. - true to bypass the proxy for local addresses; otherwise, false. - Address is an invalid URI. - - - Initializes a new instance of the class with the specified host and port number. - The name of the proxy host. - The port number on Host to use. - The URI formed by combining Host and Port is not a valid URI. - - - Initializes a new instance of the class with the instance and bypass setting. - A instance that contains the address of the proxy server. - true to bypass the proxy for local addresses; otherwise, false. - - - Initializes a new instance of the class with the specified URI, bypass setting, and list of URIs to bypass. - The URI of the proxy server. - true to bypass the proxy for local addresses; otherwise, false. - An array of regular expression strings that contain the URIs of the servers to bypass. - Address is an invalid URI. - - - Initializes a new instance of the class with the specified instance, bypass setting, and list of URIs to bypass. - A instance that contains the address of the proxy server. - true to bypass the proxy for local addresses; otherwise, false. - An array of regular expression strings that contains the URIs of the servers to bypass. - - - Initializes a new instance of the class with the specified URI, bypass setting, list of URIs to bypass, and credentials. - The URI of the proxy server. - true to bypass the proxy for local addresses; otherwise, false. - An array of regular expression strings that contains the URIs of the servers to bypass. - An instance to submit to the proxy server for authentication. - Address is an invalid URI. - - - Initializes a new instance of the class with the specified instance, bypass setting, list of URIs to bypass, and credentials. - A instance that contains the address of the proxy server. - true to bypass the proxy for local addresses; otherwise, false. - An array of regular expression strings that contains the URIs of the servers to bypass. - An instance to submit to the proxy server for authentication. - - - Gets or sets the address of the proxy server. - A instance that contains the address of the proxy server. - - - Gets a list of addresses that do not use the proxy server. - An that contains a list of arrays that represents URIs that do not use the proxy server when accessed. - - - Gets or sets an array of addresses that do not use the proxy server. - An array that contains a list of regular expressions that describe URIs that do not use the proxy server when accessed. - - - Gets or sets a value that indicates whether to bypass the proxy server for local addresses. - true to bypass the proxy server for local addresses; otherwise, false. The default value is false. - - - Gets or sets the credentials to submit to the proxy server for authentication. - An instance that contains the credentials to submit to the proxy server for authentication. - You attempted to set this property when the property was set to true. - - - Reads the Internet Explorer nondynamic proxy settings. - A instance that contains the nondynamic proxy settings from Internet Explorer 5.5 and later. - - - Populates a with the data that is needed to serialize the target object. - The to populate with data. - A that specifies the destination for this serialization. - - - Returns the proxied URI for a request. - The instance of the requested Internet resource. - The instance of the Internet resource, if the resource is on the bypass list; otherwise, the instance of the proxy. - The destination parameter is null. - - - Indicates whether to use the proxy server for the specified host. - The instance of the host to check for proxy use. - true if the proxy server should not be used for host; otherwise, false. - The host parameter is null. - - - Gets or sets a value that controls whether the are sent with requests. - true if the default credentials are used; otherwise, false. The default value is false. - You attempted to set this property when the property contains credentials other than the default credentials. - - - Creates the serialization data and context that are used by the system to serialize a object. - The object to populate with data. - A structure that indicates the destination for this serialization. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Represents the types of file protocol methods that can be used with a FILE request. This class cannot be inherited. - - - Represents the FILE GET protocol method that is used to retrieve a file from a specified location. - - - - Represents the FILE PUT protocol method that is used to copy a file to a specified location. - - - - Represents the types of FTP protocol methods that can be used with an FTP request. This class cannot be inherited. - - - Represents the FTP APPE protocol method that is used to append a file to an existing file on an FTP server. - - - - Represents the FTP DELE protocol method that is used to delete a file on an FTP server. - - - - Represents the FTP RETR protocol method that is used to download a file from an FTP server. - - - - Represents the FTP MDTM protocol method that is used to retrieve the date-time stamp from a file on an FTP server. - - - - Represents the FTP SIZE protocol method that is used to retrieve the size of a file on an FTP server. - - - - Represents the FTP NLIST protocol method that gets a short listing of the files on an FTP server. - - - - Represents the FTP LIST protocol method that gets a detailed listing of the files on an FTP server. - - - - Represents the FTP MKD protocol method creates a directory on an FTP server. - - - - Represents the FTP PWD protocol method that prints the name of the current working directory. - - - - Represents the FTP RMD protocol method that removes a directory. - - - - Represents the FTP RENAME protocol method that renames a directory. - - - - Represents the FTP STOR protocol method that uploads a file to an FTP server. - - - - Represents the FTP STOU protocol that uploads a file with a unique name to an FTP server. - - - - Represents the types of HTTP protocol methods that can be used with an HTTP request. - - - Represents the HTTP CONNECT protocol method that is used with a proxy that can dynamically switch to tunneling, as in the case of SSL tunneling. - - - - Represents an HTTP GET protocol method. - - - - Represents an HTTP HEAD protocol method. The HEAD method is identical to GET except that the server only returns message-headers in the response, without a message-body. - - - - Represents an HTTP MKCOL request that creates a new collection (such as a collection of pages) at the location specified by the request-Uniform Resource Identifier (URI). - - - - Represents an HTTP POST protocol method that is used to post a new entity as an addition to a URI. - - - - Represents an HTTP PUT protocol method that is used to replace an entity identified by a URI. - - - - Container class for , , and classes. This class cannot be inherited - - - Provides a response from a Uniform Resource Identifier (URI). This is an abstract class. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class from the specified instances of the and classes. - An instance of the class that contains the information required to serialize the new instance. - An instance of the class that indicates the source of the serialized stream that is associated with the new instance. - Any attempt is made to access the constructor, when the constructor is not overridden in a descendant class. - - - When overridden by a descendant class, closes the response stream. - Any attempt is made to access the method, when the method is not overridden in a descendant class. - - - When overridden in a descendant class, gets or sets the content length of data being received. - The number of bytes returned from the Internet resource. - Any attempt is made to get or set the property, when the property is not overridden in a descendant class. - - - When overridden in a derived class, gets or sets the content type of the data being received. - A string that contains the content type of the response. - Any attempt is made to get or set the property, when the property is not overridden in a descendant class. - - - Releases the unmanaged resources used by the object. - - - Releases the unmanaged resources used by the object, and optionally disposes of the managed resources. - true to release both managed and unmanaged resources; false to releases only unmanaged resources. - - - Populates a with the data that is needed to serialize the target object. - The to populate with data. - A that specifies the destination for this serialization. - - - When overridden in a descendant class, returns the data stream from the Internet resource. - An instance of the class for reading data from the Internet resource. - Any attempt is made to access the method, when the method is not overridden in a descendant class. - - - When overridden in a derived class, gets a collection of header name-value pairs associated with this request. - An instance of the class that contains header values associated with this response. - Any attempt is made to get or set the property, when the property is not overridden in a descendant class. - - - Gets a value that indicates whether this response was obtained from the cache. - true if the response was taken from the cache; otherwise, false. - - - Gets a value that indicates whether mutual authentication occurred. - true if both client and server were authenticated; otherwise, false. - - - When overridden in a derived class, gets the URI of the Internet resource that actually responded to the request. - An instance of the class that contains the URI of the Internet resource that actually responded to the request. - Any attempt is made to get or set the property, when the property is not overridden in a descendant class. - - - Gets a value that indicates if headers are supported. - Returns . true if headers are supported; otherwise, false. - - - Populates a instance with the data that is needed to serialize . - A that will hold the serialized data for the . - A that contains the destination of the serialized stream that is associated with the new . - - - Provides a client for connecting to WebSocket services. - - - Creates an instance of the class. - - - Aborts the connection and cancels any pending IO operations. - - - Close the instance as an asynchronous operation. - The WebSocket close status. - A description of the close status. - A cancellation token used to propagate notification that this operation should be canceled. - Returns . The task object representing the asynchronous operation. - - - Close the output for the instance as an asynchronous operation. - The WebSocket close status. - A description of the close status. - A cancellation token used to propagate notification that this operation should be canceled. - Returns . The task object representing the asynchronous operation. - - - Gets the reason why the close handshake was initiated on instance. - Returns . The reason why the close handshake was initiated. - - - Gets a description of the reason why the instance was closed. - Returns . The description of the reason why the instance was closed. - - - Connect to a WebSocket server as an asynchronous operation. - The URI of the WebSocket server to connect to. - A cancellation token used to propagate notification that the operation should be canceled. - Returns . The task object representing the asynchronous operation. - - - Releases the unmanaged resources used by the instance. - - - Gets the WebSocket options for the instance. - Returns . The WebSocket options for the instance. - - - Receive data on as an asynchronous operation. - The buffer to receive the response. - A cancellation token used to propagate notification that this operation should be canceled. - Returns . The task object representing the asynchronous operation. - - - Send data on as an asynchronous operation. - The buffer containing the message to be sent. - Specifies whether the buffer is clear text or in a binary format. - Specifies whether this is the final asynchronous send. Set to true if this is the final send; false otherwise. - A cancellation token used to propagate notification that this operation should be canceled. - The task object representing the asynchronous operation. - - - Get the WebSocket state of the instance. - Returns . The WebSocket state of the instance. - - - Gets the supported WebSocket sub-protocol for the instance. - Returns . The supported WebSocket sub-protocol. - - - Options to use with a object. - - - Adds a sub-protocol to be negotiated during the WebSocket connection handshake. - The WebSocket sub-protocol to add. - - - Gets or sets a collection of client side certificates. - Returns . A collection of client side certificates. - - - Gets or sets the cookies associated with the request. - Returns . The cookies associated with the request. - - - Gets or sets the credential information for the client. - Returns . The credential information for the client. - - - Gets or sets the WebSocket protocol keep-alive interval in milliseconds. - Returns . The WebSocket protocol keep-alive interval in milliseconds. - - - Gets or sets the proxy for WebSocket requests. - Returns . The proxy for WebSocket requests. - - - Sets the client buffer parameters. - The size, in bytes, of the client receive buffer. - The size, in bytes, of the client send buffer. - - - Sets client buffer parameters. - The size, in bytes, of the client receive buffer. - The size, in bytes, of the client send buffer. - The receive buffer to use. - - - Creates a HTTP request header and its value. - The name of the HTTP header. - The value of the HTTP header. - - - Gets or sets a value that indicates if default credentials should be used during WebSocket handshake. - Returns . true if default credentials should be used during WebSocket handshake; otherwise false. The default is true. - - - Provides access to information received by the class when accepting WebSocket connections. - - - Gets the cookies received by the object in the WebSocket opening handshake. - Returns . The cookies received by the object. - - - Gets the HTTP headers received by the object in the WebSocket opening handshake. - Returns . The HTTP headers received by the object. - - - Gets a value that indicates if the WebSocket client is authenticated. - Returns . true if the WebSocket client is authenticated; otherwise false. - - - Gets a value that indicates if the WebSocket client connected from the local machine. - Returns . true if the WebSocket client connected from the local machine; otherwise false. - - - Gets a value that indicates if the WebSocket connection is secured using Secure Sockets Layer (SSL). - Returns . true if the WebSocket connection is secured using SSL; otherwise false. - - - Gets the value of the Origin HTTP header included in the WebSocket opening handshake. - Returns . The value of the Origin HTTP header. - - - Gets the URI requested by the WebSocket client. - Returns . The URI requested by the WebSocket client. - - - Gets the value of the SecWebSocketKey HTTP header included in the WebSocket opening handshake. - Returns . The value of the SecWebSocketKey HTTP header. - - - Gets the list of the Secure WebSocket protocols included in the WebSocket opening handshake. - Returns . The list of the Secure WebSocket protocols. - - - Gets the list of sub-protocols requested by the WebSocket client. - Returns . The list of sub-protocols requested by the WebSocket client. - - - Gets an object used to obtain identity, authentication information, and security roles for the WebSocket client. - Returns . The identity, authentication information, and security roles for the WebSocket client. - - - Gets the WebSocket instance used to send and receive data over the WebSocket connection. - Returns . The WebSocket instance. - - - The WebSocket class allows applications to send and receive data after the WebSocket upgrade has completed. - - - Creates an instance of the class. - - - Aborts the WebSocket connection and cancels any pending IO operations. - - - Closes the WebSocket connection as an asynchronous operation using the close handshake defined in the WebSocket protocol specification section 7. - Indicates the reason for closing the WebSocket connection. - Specifies a human readable explanation as to why the connection is closed. - The token that can be used to propagate notification that operations should be canceled. - Returns . The task object representing the asynchronous operation. - - - Initiates or completes the close handshake defined in the WebSocket protocol specification section 7. - Indicates the reason for closing the WebSocket connection. - Allows applications to specify a human readable explanation as to why the connection is closed. - The token that can be used to propagate notification that operations should be canceled. - Returns . The task object representing the asynchronous operation. - - - Indicates the reason why the remote endpoint initiated the close handshake. - Returns . - - - Allows the remote endpoint to describe the reason why the connection was closed. - Returns . - - - Create client buffers to use with this instance. - The size, in bytes, of the client receive buffer. - The size, in bytes, of the send buffer. - Returns . An array with the client buffers. - - - This API supports the .NET Framework infrastructure and is not intended to be used directly from your code. Allows callers to create a client side WebSocket class which will use the WSPC for framing purposes. - The connection to be used for IO operations. - The subprotocol accepted by the client. - The size in bytes of the client WebSocket receive buffer. - The size in bytes of the client WebSocket send buffer. - Determines how regularly a frame is sent over the connection as a keep-alive. Applies only when the connection is idle. - Indicates whether a random key or a static key (just zeros) should be used for the WebSocket masking. - Will be used as the internal buffer in the WPC. The size has to be at least 2 * ReceiveBufferSize + SendBufferSize + 256 + 20 (16 on 32-bit). - Returns . - - - Creates a WebSocket server buffer. - The size, in bytes, of the desired buffer. - Returns . - - - Gets the default WebSocket protocol keep-alive interval in milliseconds. - Returns . The default WebSocket protocol keep-alive interval in milliseconds. The typical value for this interval is 30 seconds. - - - Used to clean up unmanaged resources for ASP.NET and self-hosted implementations. - - - Returns a value that indicates if the state of the WebSocket instance is closed or aborted. - The current state of the WebSocket. - Returns . true if the is closed or aborted; otherwise false. - - - Receives data from the connection asynchronously. - References the application buffer that is the storage location for the received data. - Propagates the notification that operations should be canceled. - Returns . The task object representing the asynchronous operation. The property on the task object returns a array containing the received data. - - - This API supports the .NET Framework infrastructure and is not intended to be used directly from your code. Allows callers to register prefixes for WebSocket requests (ws and wss). - - - Sends data over the connection asynchronously. - The buffer to be sent over the connection. - Indicates whether the application is sending a binary or text message. - Indicates whether the data in "buffer" is the last part of a message. - The token that propagates the notification that operations should be canceled. - The task object representing the asynchronous operation. - - - Returns the current state of the WebSocket connection. - Returns . - - - The subprotocol that was negotiated during the opening handshake. - Returns . - - - Verifies that the connection is in an expected state. - The current state of the WebSocket to be tested against the list of valid states. - List of valid connection states. - - - Represents well known WebSocket close codes as defined in section 11.7 of the WebSocket protocol spec. - - - No error specified. - - - - (1001) Indicates an endpoint is being removed. Either the server or client will become unavailable. - - - - The connection will be closed by the server because of an error on the server. - - - - (1003) The client or server is terminating the connection because it cannot accept the data type it received. - - - - (1007) The client or server is terminating the connection because it has received data inconsistent with the message type. - - - - (1010) The client is terminating the connection because it expected the server to negotiate an extension. - - - - (1004) Reserved for future use. - - - - (1000) The connection has closed after the request was fulfilled. - - - - (1008) The connection will be closed because an endpoint has received a message that violates its policy. - - - - (1002) The client or server is terminating the connection because of a protocol error. - - - - Used for accessing the information in the WebSocket handshake. - - - Creates an instance of the class. - - - The cookies that were passed to the server during the opening handshake. - Returns . - - - The HTTP headers that were sent to the server during the opening handshake. - Returns . - - - Whether the WebSocket client is authenticated. - Returns . - - - Whether the WebSocket client connected from the local machine. - Returns . - - - Whether the WebSocket connection is secured using Secure Sockets Layer (SSL). - Returns . - - - The value of the Origin HTTP header included in the opening handshake. - Returns . - - - The URI requested by the WebSocket client. - Returns . - - - The value of the SecWebSocketKey HTTP header included in the opening handshake. - Returns . - - - The value of the SecWebSocketKey HTTP header included in the opening handshake. - Returns . - - - The list of subprotocols requested by the WebSocket client. - Returns . - - - An object used to obtain identity, authentication information, and security roles for the WebSocket client. - Returns . - - - The WebSocket instance used to interact (send/receive/close/etc) with the WebSocket connection. - Returns . - - - Contains the list of possible WebSocket errors. - - - Indicates that the connection was terminated unexpectedly. - - - - Indicates a general error. - - - - Indicates an error occurred when parsing the HTTP headers during the opening handshake. - - - - Indicates that a WebSocket frame with an unknown opcode was received. - - - - Indicates the WebSocket is an invalid state for the given operation (such as being closed or aborted). - - - - Indicates that an unknown native error occurred. - - - - Indicates that the incoming request was not a valid websocket request. - - - - Indicates that there was no native error information for the exception. - - - - Indicates that the client requested an unsupported WebSocket subprotocol. - - - - Indicates that the client requested an unsupported version of the WebSocket protocol. - - - - Represents an exception that occurred when performing an operation on a WebSocket connection. - - - Creates an instance of the class. - - - Creates an instance of the class. - The error from the WebSocketError enumeration. - The native error code for the exception. - The description of the error. - Indicates the previous exception that led to the current exception. - - - Creates an instance of the class. - The error from the WebSocketError enumeration. - The description of the error. - Indicates the previous exception that led to the current exception. - - - Creates an instance of the class. - The error from the WebSocketError enumeration. - The native error code for the exception. - The description of the error. - - - Creates an instance of the class. - The error from the WebSocketError enumeration. - The native error code for the exception. - Indicates the previous exception that led to the current exception. - - - Creates an instance of the class. - The description of the error. - Indicates the previous exception that led to the current exception. - - - Creates an instance of the class. - The error from the WebSocketError enumeration. - The native error code for the exception. - - - Creates an instance of the class. - The error from the WebSocketError enumeration. - The description of the error. - - - Creates an instance of the class. - The native error code for the exception. - The description of the error. - - - Creates an instance of the class. - The native error code for the exception. - Indicates the previous exception that led to the current exception. - - - Creates an instance of the class. - The description of the error. - - - Creates an instance of the class. - The error from the WebSocketError enumeration. - - - Creates an instance of the class. - The native error code for the exception. - - - Creates an instance of the class. - The error from the WebSocketError enumeration. - Indicates the previous exception that led to the current exception. - - - The native error code for the exception that occurred. - Returns . - - - Sets the SerializationInfo object with the file name and line number where the exception occurred. - A SerializationInfo object. - The contextual information about the source or destination. - - - Returns a WebSocketError indicating the type of error that occurred. - Returns . - - - Indicates the message type. - - - The message is in binary format. - - - - A receive has completed because a close message was received. - - - - The message is clear text. - - - - An instance of this class represents the result of performing a single ReceiveAsync operation on a WebSocket. - - - Creates an instance of the class. - The number of bytes received. - The type of message that was received. - Indicates whether this is the final message. - - - Creates an instance of the class. - The number of bytes received. - The type of message that was received. - Indicates whether this is the final message. - Indicates the of the connection. - The description of closeStatus. - - - Indicates the reason why the remote endpoint initiated the close handshake. - Returns . - - - Returns the optional description that describes why the close handshake has been initiated by the remote endpoint. - Returns . - - - Indicates the number of bytes that the WebSocket received. - Returns . - - - Indicates whether the message has been received completely. - Returns . - - - Indicates whether the current message is a UTF-8 message or a binary message. - Returns . - - - Defines the different states a WebSockets instance can be in. - - - Reserved for future use. - - - - Indicates the WebSocket close handshake completed gracefully. - - - - A close message was received from the remote endpoint. - - - - A close message was sent to the remote endpoint. - - - - The connection is negotiating the handshake with the remote endpoint. - - - - Reserved for future use. - - - - The initial state after the HTTP handshake has been completed. - - - - Identifies the nature of the code in an executable file. - - - The executable contains only Microsoft intermediate language (MSIL), and is therefore neutral with respect to 32-bit or 64-bit platforms. - - - - The file is not in portable executable (PE) file format. - - - - The executable requires a 64-bit platform. - - - - The executable is platform-agnostic but should be run on a 32-bit platform whenever possible. - - - - The executable can be run on a 32-bit platform, or in the 32-bit Windows on Windows (WOW) environment on a 64-bit platform. - - - - The executable contains pure unmanaged code. - - - - Identifies the processor and bits-per-word of the platform targeted by an executable. - - - A 64-bit AMD processor only. - - - - An ARM processor. - - - - A 64-bit Intel processor only. - - - - Neutral with respect to processor and bits-per-word. - - - - An unknown or unspecified combination of processor and bits-per-word. - - - - A 32-bit Intel processor, either native or in the Windows on Windows environment on a 64-bit platform (WOW64). - - - - Defines the attributes that can be associated with a property. These attribute values are defined in corhdr.h. - - - Specifies that the property has a default value. - - - - Specifies that no attributes are associated with a property. - - - - Reserved. - - - - Reserved. - - - - Reserved. - - - - Specifies a flag reserved for runtime use only. - - - - Specifies that the metadata internal APIs check the name encoding. - - - - Specifies that the property is special, with the name describing how the property is special. - - - - Discovers the attributes of a property and provides access to property metadata. - - - Initializes a new instance of the class. - - - Gets the attributes for this property. - The attributes of this property. - - - Gets a value indicating whether the property can be read. - true if this property can be read; otherwise, false. - - - Gets a value indicating whether the property can be written to. - true if this property can be written to; otherwise, false. - - - Returns a value that indicates whether this instance is equal to a specified object. - An object to compare with this instance, or null. - true if obj equals the type and value of this instance; otherwise, false. - - - Returns an array whose elements reflect the public get and set accessors of the property reflected by the current instance. - An array of objects that reflect the public get and set accessors of the property reflected by the current instance, if found; otherwise, this method returns an array with zero (0) elements. - - - Returns an array whose elements reflect the public and, if specified, non-public get and set accessors of the property reflected by the current instance. - Indicates whether non-public methods should be returned in the returned array. true if non-public methods are to be included; otherwise, false. - An array whose elements reflect the get and set accessors of the property reflected by the current instance. If nonPublic is true, this array contains public and non-public get and set accessors. If nonPublic is false, this array contains only public get and set accessors. If no accessors with the specified visibility are found, this method returns an array with zero (0) elements. - - - Returns a literal value associated with the property by a compiler. - An that contains the literal value associated with the property. If the literal value is a class type with an element value of zero, the return value is null. - The Constant table in unmanaged metadata does not contain a constant value for the current property. - The type of the value is not one of the types permitted by the Common Language Specification (CLS). See the ECMA Partition II specification, Metadata. - - - Returns the public get accessor for this property. - A MethodInfo object representing the public get accessor for this property, or null if the get accessor is non-public or does not exist. - - - When overridden in a derived class, returns the public or non-public get accessor for this property. - Indicates whether a non-public get accessor should be returned. true if a non-public accessor is to be returned; otherwise, false. - A MethodInfo object representing the get accessor for this property, if nonPublic is true. Returns null if nonPublic is false and the get accessor is non-public, or if nonPublic is true but no get accessors exist. - The requested method is non-public and the caller does not have to reflect on this non-public method. - - - Returns the hash code for this instance. - A 32-bit signed integer hash code. - - - When overridden in a derived class, returns an array of all the index parameters for the property. - An array of type ParameterInfo containing the parameters for the indexes. If the property is not indexed, the array has 0 (zero) elements. - - - Gets the get accessor for this property. - The get accessor for this property. - - - Returns an array of types representing the optional custom modifiers of the property. - An array of objects that identify the optional custom modifiers of the current property, such as or . - - - Returns a literal value associated with the property by a compiler. - An that contains the literal value associated with the property. If the literal value is a class type with an element value of zero, the return value is null. - The Constant table in unmanaged metadata does not contain a constant value for the current property. - The type of the value is not one of the types permitted by the Common Language Specification (CLS). See the ECMA Partition II specification, Metadata Logical Format: Other Structures, Element Types used in Signatures. - - - Returns an array of types representing the required custom modifiers of the property. - An array of objects that identify the required custom modifiers of the current property, such as or . - - - When overridden in a derived class, returns the set accessor for this property. - Indicates whether the accessor should be returned if it is non-public. true if a non-public accessor is to be returned; otherwise, false. -

This property&#39;s Set method, or null, as shown in the following table.

-
Value

-

Condition

-

The Set method for this property.

-

The set accessor is public.

-

-or-

-

nonPublic is true and the set accessor is non-public.

-

nullnonPublic is true, but the property is read-only.

-

-or-

-

nonPublic is false and the set accessor is non-public.

-

-or-

-

There is no set accessor.

-

-
- The requested method is non-public and the caller does not have to reflect on this non-public method. -
- - Returns the public set accessor for this property. - The MethodInfo object representing the Set method for this property if the set accessor is public, or null if the set accessor is not public. - - - Returns the property value of a specified object. - The object whose property value will be returned. - The property value of the specified object. - - - Returns the property value of a specified object with optional index values for indexed properties. - The object whose property value will be returned. - Optional index values for indexed properties. The indexes of indexed properties are zero-based. This value should be null for non-indexed properties. - The property value of the specified object. - The index array does not contain the type of arguments needed. -or- The property's get accessor is not found. - - In the [.NET for Windows Store apps](http://go.microsoft.com/fwlink/?LinkID=247912) or the [Portable Class Library](~/docs/standard/cross-platform/cross-platform-development-with-the-portable-class-library.md), catch instead. - - The object does not match the target type, or a property is an instance property but obj is null. - The number of parameters in index does not match the number of parameters the indexed property takes. - - In the [.NET for Windows Store apps](http://go.microsoft.com/fwlink/?LinkID=247912) or the [Portable Class Library](~/docs/standard/cross-platform/cross-platform-development-with-the-portable-class-library.md), catch the base class exception, , instead. - - There was an illegal attempt to access a private or protected method inside a class. - An error occurred while retrieving the property value. For example, an index value specified for an indexed property is out of range. The property indicates the reason for the error. - - - When overridden in a derived class, returns the property value of a specified object that has the specified binding, index, and culture-specific information. - The object whose property value will be returned. - A bitwise combination of the following enumeration members that specify the invocation attribute: InvokeMethod, CreateInstance, Static, GetField, SetField, GetProperty, and SetProperty. You must specify a suitable invocation attribute. For example, to invoke a static member, set the Static flag. - An object that enables the binding, coercion of argument types, invocation of members, and retrieval of objects through reflection. If binder is null, the default binder is used. - Optional index values for indexed properties. This value should be null for non-indexed properties. - The culture for which the resource is to be localized. If the resource is not localized for this culture, the property will be called successively in search of a match. If this value is null, the culture-specific information is obtained from the property. - The property value of the specified object. - The index array does not contain the type of arguments needed. -or- The property's get accessor is not found. - The object does not match the target type, or a property is an instance property but obj is null. - The number of parameters in index does not match the number of parameters the indexed property takes. - There was an illegal attempt to access a private or protected method inside a class. - An error occurred while retrieving the property value. For example, an index value specified for an indexed property is out of range. The property indicates the reason for the error. - - - Gets a value indicating whether the property is the special name. - true if this property is the special name; otherwise, false. - - - Gets a value indicating that this member is a property. - A value indicating that this member is a property. - - - Indicates whether two objects are equal. - The first object to compare. - The second object to compare. - true if left is equal to right; otherwise, false. - - - Indicates whether two objects are not equal. - The first object to compare. - The second object to compare. - true if left is not equal to right; otherwise, false. - - - Gets the type of this property. - The type of this property. - - - Gets the set accessor for this property. - The set accessor for this property, or null if the property is read-only. - - - Sets the property value of a specified object. - The object whose property value will be set. - The new property value. - The property's set accessor is not found. -or- value cannot be converted to the type of . - - In the [.NET for Windows Store apps](http://go.microsoft.com/fwlink/?LinkID=247912) or the [Portable Class Library](~/docs/standard/cross-platform/cross-platform-development-with-the-portable-class-library.md), catch instead. - - The type of obj does not match the target type, or a property is an instance property but obj is null. - - In the [.NET for Windows Store apps](http://go.microsoft.com/fwlink/?LinkID=247912) or the [Portable Class Library](~/docs/standard/cross-platform/cross-platform-development-with-the-portable-class-library.md), catch the base class exception, , instead. - - There was an illegal attempt to access a private or protected method inside a class. - An error occurred while setting the property value. The property indicates the reason for the error. - - - Sets the property value of a specified object with optional index values for index properties. - The object whose property value will be set. - The new property value. - Optional index values for indexed properties. This value should be null for non-indexed properties. - The index array does not contain the type of arguments needed. -or- The property's set accessor is not found. -or- value cannot be converted to the type of . - - In the [.NET for Windows Store apps](http://go.microsoft.com/fwlink/?LinkID=247912) or the [Portable Class Library](~/docs/standard/cross-platform/cross-platform-development-with-the-portable-class-library.md), catch instead. - - The object does not match the target type, or a property is an instance property but obj is null. - The number of parameters in index does not match the number of parameters the indexed property takes. - - In the [.NET for Windows Store apps](http://go.microsoft.com/fwlink/?LinkID=247912) or the [Portable Class Library](~/docs/standard/cross-platform/cross-platform-development-with-the-portable-class-library.md), catch the base class exception, , instead. - - There was an illegal attempt to access a private or protected method inside a class. - An error occurred while setting the property value. For example, an index value specified for an indexed property is out of range. The property indicates the reason for the error. - - - When overridden in a derived class, sets the property value for a specified object that has the specified binding, index, and culture-specific information. - The object whose property value will be set. - The new property value. - A bitwise combination of the following enumeration members that specify the invocation attribute: InvokeMethod, CreateInstance, Static, GetField, SetField, GetProperty, or SetProperty. You must specify a suitable invocation attribute. For example, to invoke a static member, set the Static flag. - An object that enables the binding, coercion of argument types, invocation of members, and retrieval of objects through reflection. If binder is null, the default binder is used. - Optional index values for indexed properties. This value should be null for non-indexed properties. - The culture for which the resource is to be localized. If the resource is not localized for this culture, the property will be called successively in search of a match. If this value is null, the culture-specific information is obtained from the property. - The index array does not contain the type of arguments needed. -or- The property's set accessor is not found. -or- value cannot be converted to the type of . - The object does not match the target type, or a property is an instance property but obj is null. - The number of parameters in index does not match the number of parameters the indexed property takes. - There was an illegal attempt to access a private or protected method inside a class. - An error occurred while setting the property value. For example, an index value specified for an indexed property is out of range. The property indicates the reason for the error. - - - Represents a context that can provide reflection objects. - - - Initializes a new instance of the class. - - - Gets the representation of the type of the specified object in this reflection context. - The object to represent. - An object that represents the type of the specified object. - - - Gets the representation, in this reflection context, of an assembly that is represented by an object from another reflection context. - The external representation of the assembly to represent in this context. - The representation of the assembly in this reflection context. - - - Gets the representation, in this reflection context, of a type represented by an object from another reflection context. - The external representation of the type to represent in this context. - The representation of the type in this reflection context.. - - - The exception that is thrown by the method if any of the classes in a module cannot be loaded. This class cannot be inherited. - - - Initializes a new instance of the class with the given classes and their associated exceptions. - An array of type Type containing the classes that were defined in the module and loaded. This array can contain null reference (Nothing in Visual Basic) values. - An array of type Exception containing the exceptions that were thrown by the class loader. The null reference (Nothing in Visual Basic) values in the classes array line up with the exceptions in this exceptions array. - - - Initializes a new instance of the class with the given classes, their associated exceptions, and exception descriptions. - An array of type Type containing the classes that were defined in the module and loaded. This array can contain null reference (Nothing in Visual Basic) values. - An array of type Exception containing the exceptions that were thrown by the class loader. The null reference (Nothing in Visual Basic) values in the classes array line up with the exceptions in this exceptions array. - A String describing the reason the exception was thrown. - - - Provides an implementation for serialized objects. - The information and data needed to serialize or deserialize an object. - The context for the serialization. - info is null. - - - Gets the array of exceptions thrown by the class loader. - An array of type Exception containing the exceptions thrown by the class loader. The null values in the array of this instance line up with the exceptions in this array. - - - Gets the array of classes that were defined in the module and loaded. - An array of type Type containing the classes that were defined in the module and loaded. This array can contain some null values. - - - Specifies the attributes for a manifest resource. - - - A mask used to retrieve private manifest resources. - - - - A mask used to retrieve public manifest resources. - - - - Specifies the resource location. - - - Specifies that the resource is contained in another assembly. - - - - Specifies that the resource is contained in the manifest file. - - - - Specifies an embedded (that is, non-linked) resource. - - - - Provides methods that retrieve information about types at run time. - - - Gets an object that represents the method represented by the specified delegate. - The delegate to examine. - An object that represents the method. - - - Retrieves an object that represents the specified method on the direct or indirect base class where the method was first declared. - The method to retrieve information about. - An object that represents the specified method's initial declaration on a base class. - - - Retrieves an object that represents the specified event. - The type that contains the event. - The name of the event. - An object that represents the specified event, or null if the event is not found. - - - Retrieves a collection that represents all the events defined on a specified type. - The type that contains the events. - A collection of events for the specified type. - - - Retrieves an object that represents a specified field. - The type that contains the field. - The name of the field. - An object that represents the specified field, or null if the field is not found. - - - Retrieves a collection that represents all the fields defined on a specified type. - The type that contains the fields. - A collection of fields for the specified type. - - - Returns an interface mapping for the specified type and the specified interface. - The type to retrieve a mapping for. - The interface to retrieve a mapping for. - An object that represents the interface mapping for the specified interface and type. - - - Retrieves an object that represents a specified method. - The type that contains the method. - The name of the method. - An array that contains the method's parameters. - An object that represents the specified method, or null if the method is not found. - - - Retrieves a collection that represents all methods defined on a specified type. - The type that contains the methods. - A collection of methods for the specified type. - - - Retrieves a collection that represents all the properties defined on a specified type. - The type that contains the properties. - A collection of properties for the specified type. - - - Retrieves an object that represents a specified property. - The type that contains the property. - The name of the property. - An object that represents the specified property, or null if the property is not found. - - - Encapsulates access to a public or private key pair used to sign strong name assemblies. - - - Initializes a new instance of the class, building the key pair from a byte array. - An array of type byte containing the key pair. - keyPairArray is null. - The caller does not have the required permission. - - - Initializes a new instance of the class, building the key pair from a FileStream. - A FileStream containing the key pair. - keyPairFile is null. - The caller does not have the required permission. - - - Initializes a new instance of the class, building the key pair from a String. - A string containing the key pair. - keyPairContainer is null. - The caller does not have the required permission. - - - Initializes a new instance of the class, building the key pair from serialized data. - A object that holds the serialized object data. - A object that contains contextual information about the source or destination. - - - Gets the public part of the public key or public key token of the key pair. - An array of type byte containing the public key or public key token of the key pair. - - - Runs when the entire object graph has been deserialized. - The object that initiated the callback. - - - Sets the object with all the data required to reinstantiate the current object. - The object to be populated with serialization information. - The destination context of the serialization. - info is null. - - - Represents the exception that is thrown when an attempt is made to invoke an invalid target. - - - Initializes a new instance of the class with an empty message and the root cause of the exception. - - - Initializes a new instance of the class with the given message and the root cause exception. - A String describing the reason why the exception occurred. - - - Initializes a new instance of the class with the specified serialization and context information. - The data for serializing or deserializing the object. - The source of and destination for the object. - - - Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. - The error message that explains the reason for the exception. - The exception that is the cause of the current exception. If the inner parameter is not null, the current exception is raised in a catch block that handles the inner exception. - - - The exception that is thrown by methods invoked through reflection. This class cannot be inherited. - - - Initializes a new instance of the class with a reference to the inner exception that is the cause of this exception. - The exception that is the cause of the current exception. If the inner parameter is not null, the current exception is raised in a catch block that handles the inner exception. - - - Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. - The error message that explains the reason for the exception. - The exception that is the cause of the current exception. If the inner parameter is not null, the current exception is raised in a catch block that handles the inner exception. - - - The exception that is thrown when the number of parameters for an invocation does not match the number expected. This class cannot be inherited. - - - Initializes a new instance of the class with an empty message string and the root cause of the exception. - - - Initializes a new instance of the class with its message string set to the given message and the root cause exception. - A String describing the reason this exception was thrown. - - - Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. - The error message that explains the reason for the exception. - The exception that is the cause of the current exception. If the inner parameter is not null, the current exception is raised in a catch block that handles the inner exception. - - - Specifies type attributes. - - - Specifies that the type is abstract. - - - - LPTSTR is interpreted as ANSI. - - - - LPTSTR is interpreted automatically. - - - - Specifies that class fields are automatically laid out by the common language runtime. - - - - Specifies that calling static methods of the type does not force the system to initialize the type. - - - - Specifies that the type is a class. - - - - Specifies class semantics information; the current class is contextful (else agile). - - - - LPSTR is interpreted by some implementation-specific means, which includes the possibility of throwing a . Not used in the Microsoft implementation of the .NET Framework. - - - - Used to retrieve non-standard encoding information for native interop. The meaning of the values of these 2 bits is unspecified. Not used in the Microsoft implementation of the .NET Framework. - - - - Specifies that class fields are laid out at the specified offsets. - - - - Type has security associate with it. - - - - Specifies that the class or interface is imported from another module. - - - - Specifies that the type is an interface. - - - - Specifies class layout information. - - - - Specifies that the class is nested with assembly visibility, and is thus accessible only by methods within its assembly. - - - - Specifies that the class is nested with assembly and family visibility, and is thus accessible only by methods lying in the intersection of its family and assembly. - - - - Specifies that the class is nested with family visibility, and is thus accessible only by methods within its own type and any derived types. - - - - Specifies that the class is nested with family or assembly visibility, and is thus accessible only by methods lying in the union of its family and assembly. - - - - Specifies that the class is nested with private visibility. - - - - Specifies that the class is nested with public visibility. - - - - Specifies that the class is not public. - - - - Specifies that the class is public. - - - - Attributes reserved for runtime use. - - - - Runtime should check name encoding. - - - - Specifies that the class is concrete and cannot be extended. - - - - Specifies that class fields are laid out sequentially, in the order that the fields were emitted to the metadata. - - - - Specifies that the class can be serialized. - - - - Specifies that the class is special in a way denoted by the name. - - - - Used to retrieve string information for native interoperability. - - - - LPTSTR is interpreted as UNICODE. - - - - Specifies type visibility information. - - - - Specifies a Windows Runtime type. - - - - Wraps a object and delegates methods to that Type. - - - Initializes a new instance of the class with default properties. - - - Initializes a new instance of the class specifying the encapsulating instance. - The instance of the class that encapsulates the call to the method of an object. - delegatingType is null. - - - Gets the assembly of the implemented type. - An object representing the assembly of the implemented type. - - - Gets the assembly's fully qualified name. - A String containing the assembly's fully qualified name. - - - Gets the base type for the current type. - The base type for a type. - - - Gets the fully qualified name of the implemented type. - A String containing the type's fully qualified name. - - - Gets the attributes assigned to the TypeDelegator. - A TypeAttributes object representing the implementation attribute flags. - - - Gets the constructor that implemented the TypeDelegator. - A bitmask that affects the way in which the search is conducted. The value is a combination of zero or more bit flags from . - An object that enables the binding, coercion of argument types, invocation of members, and retrieval of MemberInfo objects using reflection. If binder is null, the default binder is used. - The calling conventions. - An array of type Type containing a list of the parameter number, order, and types. Types cannot be null; use an appropriate GetMethod method or an empty array to search for a method without parameters. - An array of type ParameterModifier having the same length as the types array, whose elements represent the attributes associated with the parameters of the method to get. - A ConstructorInfo object for the method that matches the specified criteria, or null if a match cannot be found. - - - Returns an array of objects representing constructors defined for the type wrapped by the current . - A bitmask that affects the way in which the search is conducted. The value is a combination of zero or more bit flags from . - An array of type ConstructorInfo containing the specified constructors defined for this class. If no constructors are defined, an empty array is returned. Depending on the value of a specified parameter, only public constructors or both public and non-public constructors will be returned. - - - Returns all the custom attributes defined for this type, specifying whether to search the type's inheritance chain. - Specifies whether to search this type's inheritance chain to find the attributes. - An array of objects containing all the custom attributes defined for this type. - A custom attribute type cannot be loaded. - - - Returns an array of custom attributes identified by type. - An array of custom attributes identified by type. - Specifies whether to search this type's inheritance chain to find the attributes. - An array of objects containing the custom attributes defined in this type that match the attributeType parameter, specifying whether to search the type's inheritance chain, or null if no custom attributes are defined on this type. - attributeType is null. - A custom attribute type cannot be loaded. - - - Returns the of the object encompassed or referred to by the current array, pointer or ByRef. - The of the object encompassed or referred to by the current array, pointer or ByRef, or null if the current is not an array, a pointer or a ByRef. - - - Returns the specified event. - The name of the event to get. - A bitmask that affects the way in which the search is conducted. The value is a combination of zero or more bit flags from . - An object representing the event declared or inherited by this type with the specified name. This method returns null if no such event is found. - The name parameter is null. - - - Returns an array of objects representing all the public events declared or inherited by the current TypeDelegator. - Returns an array of type EventInfo containing all the events declared or inherited by the current type. If there are no events, an empty array is returned. - - - Returns the events specified in bindingAttr that are declared or inherited by the current TypeDelegator. - A bitmask that affects the way in which the search is conducted. The value is a combination of zero or more bit flags from . - An array of type EventInfo containing the events specified in bindingAttr. If there are no events, an empty array is returned. - - - Returns a object representing the field with the specified name. - The name of the field to find. - A bitmask that affects the way in which the search is conducted. The value is a combination of zero or more bit flags from . - A FieldInfo object representing the field declared or inherited by this TypeDelegator with the specified name. Returns null if no such field is found. - The name parameter is null. - - - Returns an array of objects representing the data fields defined for the type wrapped by the current . - A bitmask that affects the way in which the search is conducted. The value is a combination of zero or more bit flags from . - An array of type FieldInfo containing the fields declared or inherited by the current TypeDelegator. An empty array is returned if there are no matched fields. - - - Returns the specified interface implemented by the type wrapped by the current . - The fully qualified name of the interface implemented by the current class. - true if the case is to be ignored; otherwise, false. - A Type object representing the interface implemented (directly or indirectly) by the current class with the fully qualified name matching the specified name. If no interface that matches name is found, null is returned. - The name parameter is null. - - - Returns an interface mapping for the specified interface type. - The of the interface to retrieve a mapping of. - An object representing the interface mapping for interfaceType. - - - Returns all the interfaces implemented on the current class and its base classes. - An array of type Type containing all the interfaces implemented on the current class and its base classes. If none are defined, an empty array is returned. - - - Returns members (properties, methods, constructors, fields, events, and nested types) specified by the given name, type, and bindingAttr. - The name of the member to get. - A bitmask that affects the way in which the search is conducted. The value is a combination of zero or more bit flags from . - The type of members to get. - An array of type MemberInfo containing all the members of the current class and its base class meeting the specified criteria. - The name parameter is null. - - - Returns members specified by bindingAttr. - A bitmask that affects the way in which the search is conducted. The value is a combination of zero or more bit flags from . - An array of type MemberInfo containing all the members of the current class and its base classes that meet the bindingAttr filter. - - - Searches for the specified method whose parameters match the specified argument types and modifiers, using the specified binding constraints and the specified calling convention. - The method name. - A bitmask that affects the way in which the search is conducted. The value is a combination of zero or more bit flags from . - An object that enables the binding, coercion of argument types, invocation of members, and retrieval of MemberInfo objects using reflection. If binder is null, the default binder is used. - The calling conventions. - An array of type Type containing a list of the parameter number, order, and types. Types cannot be null; use an appropriate GetMethod method or an empty array to search for a method without parameters. - An array of type ParameterModifier having the same length as the types array, whose elements represent the attributes associated with the parameters of the method to get. - A MethodInfoInfo object for the implementation method that matches the specified criteria, or null if a match cannot be found. - - - Returns an array of objects representing specified methods of the type wrapped by the current . - A bitmask that affects the way in which the search is conducted. The value is a combination of zero or more bit flags from . - An array of MethodInfo objects representing the methods defined on this TypeDelegator. - - - Returns a nested type specified by name and in bindingAttr that are declared or inherited by the type represented by the current . - The nested type's name. - A bitmask that affects the way in which the search is conducted. The value is a combination of zero or more bit flags from . - A Type object representing the nested type. - The name parameter is null. - - - Returns the nested types specified in bindingAttr that are declared or inherited by the type wrapped by the current . - A bitmask that affects the way in which the search is conducted. The value is a combination of zero or more bit flags from . - An array of type Type containing the nested types. - - - Returns an array of objects representing properties of the type wrapped by the current . - A bitmask that affects the way in which the search is conducted. The value is a combination of zero or more bit flags from . - An array of PropertyInfo objects representing properties defined on this TypeDelegator. - - - When overridden in a derived class, searches for the specified property whose parameters match the specified argument types and modifiers, using the specified binding constraints. - The property to get. - A bitmask that affects the way in which the search is conducted. The value is a combination of zero or more bit flags from . - An object that enables the binding, coercion of argument types, invocation of members, and retrieval of MemberInfo objects via reflection. If binder is null, the default binder is used. See . - The return type of the property. - A list of parameter types. The list represents the number, order, and types of the parameters. Types cannot be null; use an appropriate GetMethod method or an empty array to search for a method without parameters. - An array of the same length as types with elements that represent the attributes associated with the parameters of the method to get. - A object for the property that matches the specified criteria, or null if a match cannot be found. - - - Gets the GUID (globally unique identifier) of the implemented type. - A GUID. - - - Gets a value indicating whether the current encompasses or refers to another type; that is, whether the current is an array, a pointer or a ByRef. - true if the is an array, a pointer or a ByRef; otherwise, false. - - - Invokes the specified member. The method that is to be invoked must be accessible and provide the most specific match with the specified argument list, under the constraints of the specified binder and invocation attributes. - The name of the member to invoke. This may be a constructor, method, property, or field. If an empty string ("") is passed, the default member is invoked. - The invocation attribute. This must be one of the following : InvokeMethod, CreateInstance, Static, GetField, SetField, GetProperty, or SetProperty. A suitable invocation attribute must be specified. If a static member is to be invoked, the Static flag must be set. - An object that enables the binding, coercion of argument types, invocation of members, and retrieval of MemberInfo objects via reflection. If binder is null, the default binder is used. See . - The object on which to invoke the specified member. - An array of type Object that contains the number, order, and type of the parameters of the member to be invoked. If args contains an uninitialized Object, it is treated as empty, which, with the default binder, can be widened to 0, 0.0 or a string. - An array of type ParameterModifer that is the same length as args, with elements that represent the attributes associated with the arguments of the member to be invoked. A parameter has attributes associated with it in the member's signature. For ByRef, use ParameterModifer.ByRef, and for none, use ParameterModifer.None. The default binder does exact matching on these. Attributes such as In and InOut are not used in binding, and can be viewed using ParameterInfo. - An instance of CultureInfo used to govern the coercion of types. This is necessary, for example, to convert a string that represents 1000 to a Double value, since 1000 is represented differently by different cultures. If culture is null, the CultureInfo for the current thread's CultureInfo is used. - An array of type String containing parameter names that match up, starting at element zero, with the args array. There must be no holes in the array. If args. Length is greater than namedParameters. Length, the remaining parameters are filled in order. - An Object representing the return value of the invoked member. - - - Returns a value that indicates whether the is an array. - true if the is an array; otherwise, false. - - - Returns a value that indicates whether the specified type can be assigned to this type. - The type to check. - true if the specified type can be assigned to this type; otherwise, false. - - - Returns a value that indicates whether the is passed by reference. - true if the is passed by reference; otherwise, false. - - - Returns a value that indicates whether the is a COM object. - true if the is a COM object; otherwise, false. - - - Gets a value that indicates whether this object represents a constructed generic type. - true if this object represents a constructed generic type; otherwise, false. - - - Indicates whether a custom attribute identified by attributeType is defined. - Specifies whether to search this type's inheritance chain to find the attributes. - An array of custom attributes identified by type. - true if a custom attribute identified by attributeType is defined; otherwise, false. - attributeType is null. - The custom attribute type cannot be loaded. - - - Returns a value that indicates whether the is a pointer. - true if the is a pointer; otherwise, false. - - - Returns a value that indicates whether the is one of the primitive types. - true if the is one of the primitive types; otherwise, false. - - - Returns a value that indicates whether the type is a value type; that is, not a class or an interface. - true if the type is a value type; otherwise, false. - - - Gets a value that identifies this entity in metadata. - A value which, in combination with the module, uniquely identifies this entity in metadata. - - - Gets the module that contains the implemented type. - A object representing the module of the implemented type. - - - Gets the name of the implemented type, with the path removed. - A String containing the type's non-qualified name. - - - Gets the namespace of the implemented type. - A String containing the type's namespace. - - - Gets a handle to the internal metadata representation of an implemented type. - A RuntimeTypeHandle object. - - - A value indicating type information. - - - - Gets the underlying that represents the implemented type. - The underlying type. - - - Filters the classes represented in an array of objects. - The Type object to which the filter is applied. - An arbitrary object used to filter the list. - - - - Represents type declarations for class types, interface types, array types, value types, enumeration types, type parameters, generic type definitions, and open or closed constructed generic types. - - - Returns the current type as a object. - The current type. - - - Gets a collection of the constructors declared by the current type. - A collection of the constructors declared by the current type. - - - Gets a collection of the events defined by the current type. - A collection of the events defined by the current type. - - - Gets a collection of the fields defined by the current type. - A collection of the fields defined by the current type. - - - Gets a collection of the members defined by the current type. - A collection of the members defined by the current type. - - - Gets a collection of the methods defined by the current type. - A collection of the methods defined by the current type. - - - Gets a collection of the nested types defined by the current type. - A collection of nested types defined by the current type. - - - Gets a collection of the properties defined by the current type. - A collection of the properties defined by the current type. - - - Gets an array of the generic type parameters of the current instance. - An array that contains the current instance's generic type parameters, or an array of zero if the current instance has no generic type parameters. - - - Returns an object that represents the specified public event declared by the current type. - The name of the event. - An object that represents the specified event, if found; otherwise, null. - name is null. - - - Returns an object that represents the specified public field declared by the current type. - The name of the field. - An object that represents the specified field, if found; otherwise, null. - name is null. - - - Returns an object that represents the specified public method declared by the current type. - The name of the method. - An object that represents the specified method, if found; otherwise, null. - name is null. - - - Returns a collection that contains all public methods declared on the current type that match the specified name. - The method name to search for. - A collection that contains methods that match name. - name is null. - - - Returns an object that represents the specified public nested type declared by the current type. - The name of the nested type. - An object that represents the specified nested type, if found; otherwise, null. - name is null. - - - Returns an object that represents the specified public property declared by the current type. - The name of the property. - An object that represents the specified property, if found; otherwise, null. - name is null. - - - Gets a collection of the interfaces implemented by the current type. - A collection of the interfaces implemented by the current type. - - - Returns a value that indicates whether the specified type can be assigned to the current type. - The type to check. - true if the specified type can be assigned to this type; otherwise, false. - - - Returns a representation of the current type as a object. - A reference to the current type. - - - Provides data for loader resolution events, such as the , , , and events. - - - Initializes a new instance of the class, specifying the name of the item to resolve. - The name of an item to resolve. - - - Initializes a new instance of the class, specifying the name of the item to resolve and the assembly whose dependency is being resolved. - The name of an item to resolve. - The assembly whose dependency is being resolved. - - - Gets the name of the item to resolve. - The name of the item to resolve. - - - Gets the assembly whose dependency is being resolved. - The assembly that requested the item specified by the property. - - - Represents a method that handles the , , or event of an . - The source of the event. - The event data. - - - - Provides the base functionality for reading data from resource files. - - - Closes the resource reader after releasing any resources associated with it. - - - Returns a dictionary enumerator of the resources for this reader. - A dictionary enumerator for the resources for this reader. - - - Provides the base functionality for writing resources to an output file or stream. - - - Adds an 8-bit unsigned integer array as a named resource to the list of resources to be written. - Name of a resource. - Value of a resource as an 8-bit unsigned integer array. - The name parameter is null. - - - Adds a named resource of type to the list of resources to be written. - The name of the resource. - The value of the resource. - The name parameter is null. - - - Adds a named resource of type to the list of resources to be written. - The name of the resource. - The value of the resource. - The name parameter is null. - - - Closes the underlying resource file or stream, ensuring all the data has been written to the file. - - - Writes all the resources added by the method to the output file or stream. - - - The exception that is thrown if the main assembly does not contain the resources for the neutral culture, and an appropriate satellite assembly is missing. - - - Initializes a new instance of the class with default properties. - - - Initializes a new instance of the class with the specified error message. - The error message that explains the reason for the exception. - - - Initializes a new instance of the class from serialized data. - The object that holds the serialized object data. - The contextual information about the source or destination of the exception. - - - Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. - The error message that explains the reason for the exception. - The exception that is the cause of the current exception. If the inner parameter is not null, the current exception is raised in a catch block that handles the inner exception. - - - The exception that is thrown when the satellite assembly for the resources of the default culture is missing. - - - Initializes a new instance of the class with default properties. - - - Initializes a new instance of the class with the specified error message. - The error message that explains the reason for the exception. - - - Initializes a new instance of the class from serialized data. - The object that holds the serialized object data. - The contextual information about the source or destination of the exception. - - - Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. - The error message that explains the reason for the exception. - The exception that is the cause of the current exception. If the inner parameter is not null, the current exception is raised in a catch block that handles the inner exception. - - - Initializes a new instance of the class with a specified error message and the name of a neutral culture. - The error message that explains the reason for the exception. - The name of the neutral culture. - - - Gets the name of the default culture. - The name of the default culture. - - - Informs the resource manager of an app's default culture. This class cannot be inherited. - - - Initializes a new instance of the class. - The name of the culture that the current assembly's neutral resources were written in. - The cultureName parameter is null. - - - Initializes a new instance of the class with the specified ultimate resource fallback location. - The name of the culture that the current assembly's neutral resources were written in. - One of the enumeration values that indicates the location from which to retrieve neutral fallback resources. - cultureName is null. - location is not a member of . - - - Gets the culture name. - The name of the default culture for the main assembly. - - - Gets the location for the class to use to retrieve neutral resources by using the resource fallback process. - One of the enumeration values that indicates the location (main assembly or satellite) from which to retrieve neutral resources. - - - Represents a resource manager that provides convenient access to culture-specific resources at run time. Security Note: Calling methods in this class with untrusted data is a security risk. Call the methods in the class only with trusted data. For more information, see Untrusted Data Security Risks. - - - Initializes a new instance of the class with default values. - - - Initializes a new instance of the class that looks up resources in satellite assemblies based on information from the specified type object. - A type from which the resource manager derives all information for finding .resources files. - The resourceSource parameter is null. - - - Initializes a new instance of the class that looks up resources contained in files with the specified root name in the given assembly. - The root name of the resource file without its extension but including any fully qualified namespace name. For example, the root name for the resource file named MyApplication.MyResource.en-US.resources is MyApplication.MyResource. - The main assembly for the resources. - The baseName or assembly parameter is null. - - - Initializes a new instance of the class that uses a specified class to look up resources contained in files with the specified root name in the given assembly. - The root name of the resource file without its extension but including any fully qualified namespace name. For example, the root name for the resource file named MyApplication.MyResource.en-US.resources is MyApplication.MyResource. - The main assembly for the resources. - The type of the custom to use. If null, the default runtime object is used. - usingResourceset is not a derived class of . - The baseName or assembly parameter is null. - - - Gets the root name of the resource files that the searches for resources. - The root name of the resource files that the searches for resources. - - - Returns a object that searches a specific directory instead of an assembly manifest for resources. - The root name of the resources. For example, the root name for the resource file named "MyResource.en-US.resources" is "MyResource". - The name of the directory to search for the resources. resourceDir can be an absolute path or a relative path from the application directory. - The type of the custom to use. If null, the default runtime object is used. - A new instance of a resource manager that searches the specified directory instead of an assembly manifest for resources. - The baseName or resourceDir parameter is null. - - - Gets or sets the location from which to retrieve default fallback resources. - One of the enumeration values that specifies where the resource manager can look for fallback resources. - - - Returns culture-specific information for the main assembly's default resources by retrieving the value of the attribute on a specified assembly. - The assembly for which to return culture-specific information. - The culture from the attribute, if found; otherwise, the invariant culture. - - - Returns the value of the specified non-string resource. - The name of the resource to get. - The value of the resource localized for the caller's current culture settings. If an appropriate resource set exists but name cannot be found, the method returns null. - The name parameter is null. - No usable set of localized resources has been found, and there are no default culture resources. For information about how to handle this exception, see the "Handling MissingManifestResourceException and MissingSatelliteAssemblyException Exceptions" section in the class topic. - The default culture's resources reside in a satellite assembly that could not be found. For information about how to handle this exception, see the "Handling MissingManifestResourceException and MissingSatelliteAssemblyException Exceptions" section in the class topic. - - - Gets the value of the specified non-string resource localized for the specified culture. - The name of the resource to get. - The culture for which the resource is localized. If the resource is not localized for this culture, the resource manager uses fallback rules to locate an appropriate resource. If this value is null, the object is obtained by using the property. - The value of the resource, localized for the specified culture. If an appropriate resource set exists but name cannot be found, the method returns null. - The name parameter is null. - No usable set of resources have been found, and there are no default culture resources. For information about how to handle this exception, see the "Handling MissingManifestResourceException and MissingSatelliteAssemblyException Exceptions" section in the class topic. - The default culture's resources reside in a satellite assembly that could not be found. For information about how to handle this exception, see the "Handling MissingManifestResourceException and MissingSatelliteAssemblyException Exceptions" section in the class topic. - - - Generates the name of the resource file for the given object. - The culture object for which a resource file name is constructed. - The name that can be used for a resource file for the given object. - - - Retrieves the resource set for a particular culture. - The culture whose resources are to be retrieved. - true to load the resource set, if it has not been loaded yet; otherwise, false. - true to use resource fallback to load an appropriate resource if the resource set cannot be found; false to bypass the resource fallback process. - The resource set for the specified culture. - The culture parameter is null. - tryParents is true, no usable set of resources has been found, and there are no default culture resources. - - - Returns the version specified by the attribute in the given assembly. - The assembly to check for the attribute. - The satellite contract version of the given assembly, or null if no version was found. - The found in the assembly a is invalid. - a is null. - - - Returns an unmanaged memory stream object from the specified resource. - The name of a resource. - An unmanaged memory stream object that represents a resource . - The value of the specified resource is not a object. - name is null. - No usable set of resources is found, and there are no default resources. For information about how to handle this exception, see the "Handling MissingManifestResourceException and MissingSatelliteAssemblyException Exceptions" section in the class topic. - The default culture's resources reside in a satellite assembly that could not be found. For information about how to handle this exception, see the "Handling MissingManifestResourceException and MissingSatelliteAssemblyException Exceptions" section in the class topic. - - - Returns an unmanaged memory stream object from the specified resource, using the specified culture. - The name of a resource. - An object that specifies the culture to use for the resource lookup. If culture is null, the culture for the current thread is used. - An unmanaged memory stream object that represents a resource. - The value of the specified resource is not a object. - name is null. - No usable set of resources is found, and there are no default resources. For information about how to handle this exception, see the "Handling MissingManifestResourceException and MissingSatelliteAssemblyException Exceptions" section in the class topic. - The default culture's resources reside in a satellite assembly that could not be found. For information about how to handle this exception, see the "Handling MissingManifestResourceException and MissingSatelliteAssemblyException Exceptions" section in the class topic. - - - Returns the value of the specified string resource. - The name of the resource to retrieve. - The value of the resource localized for the caller's current UI culture, or null if name cannot be found in a resource set. - The name parameter is null. - The value of the specified resource is not a string. - No usable set of resources has been found, and there are no resources for the default culture. For information about how to handle this exception, see the "Handling MissingManifestResourceException and MissingSatelliteAssemblyException Exceptions" section in the class topic. - The default culture's resources reside in a satellite assembly that could not be found. For information about how to handle this exception, see the "Handling MissingManifestResourceException and MissingSatelliteAssemblyException Exceptions" section in the class topic. - - - Returns the value of the string resource localized for the specified culture. - The name of the resource to retrieve. - An object that represents the culture for which the resource is localized. - The value of the resource localized for the specified culture, or null if name cannot be found in a resource set. - The name parameter is null. - The value of the specified resource is not a string. - No usable set of resources has been found, and there are no resources for a default culture. For information about how to handle this exception, see the "Handling MissingManifestResourceException and MissingSatelliteAssemblyException Exceptions" section in the class topic. - The default culture's resources reside in a satellite assembly that could not be found. For information about how to handle this exception, see the "Handling MissingManifestResourceException and MissingSatelliteAssemblyException Exceptions" section in the class topic. - - - Specifies the version of resource file headers that the current implementation of can interpret and produce. - - - - Gets or sets a value that indicates whether the resource manager allows case-insensitive resource lookups in the and methods. - true to ignore case during resource lookup; otherwise, false. - - - Provides the implementation for finding a resource set. - The culture object to look for. - true to load the resource set, if it has not been loaded yet; otherwise, false. - true to check parent objects if the resource set cannot be loaded; otherwise, false. - The specified resource set. - The main assembly does not contain a .resources file, which is required to look up a resource. - There was an internal error in the runtime. - The satellite assembly associated with culture could not be located. - - - Holds the number used to identify resource files. - - - - Specifies the main assembly that contains the resources. - - - - Tells the resource manager to call the method on all objects and release all resources. - - - Gets the type of the resource set object that the resource manager uses to construct a object. - The type of the resource set object that the resource manager uses to construct a object. - - - Enumerates the resources in a binary resources (.resources) file by reading sequential resource name/value pairs. Security Note: Calling methods in this class with untrusted data is a security risk. Call the methods in the class only with trusted data. For more information, see Untrusted Data Security Risks. - - - Initializes a new instance of the class for the specified stream. - The input stream for reading resources. - The stream parameter is not readable. - The stream parameter is null. - An I/O error has occurred while accessing stream. - - - Initializes a new instance of the class for the specified named resource file. - The path and name of the resource file to read. filename is not case-sensitive. - The fileName parameter is null. - The file cannot be found. - An I/O error has occurred. - The resource file has an invalid format. For example, the length of the file may be zero. - - - Releases all operating system resources associated with this object. - - - Releases all resources used by the current instance of the class. - - - Returns an enumerator for this object. - An enumerator for this object. - The reader has been closed or disposed, and cannot be accessed. - - - Retrieves the type name and data of a named resource from an open resource file or stream. - The name of a resource. - When this method returns, contains a string that represents the type name of the retrieved resource. This parameter is passed uninitialized. - When this method returns, contains a byte array that is the binary representation of the retrieved type. This parameter is passed uninitialized. - resourceName is null. - resourceName does not exist. - resourceName has an invalid type. - The retrieved resource data is corrupt. - The current object is not initialized, probably because it is closed. - - - Returns an enumerator for this object. - An enumerator for this object. - The reader has already been closed and cannot be accessed. - - - Stores all the resources localized for one particular culture, ignoring all other cultures, including any fallback rules. Security Note: Calling methods in this class with untrusted data is a security risk. Call the methods in the class only with trusted data. For more information, see Untrusted Data Security Risks. - - - Initializes a new instance of the class with default properties. - - - Creates a new instance of the class using the system default that reads resources from the given stream. - The of resources to be read. The stream should refer to an existing resources file. - The stream is not readable. - The stream parameter is null. - - - Creates a new instance of the class using the specified resource reader. - The reader that will be used. - The reader parameter is null. - - - Creates a new instance of the class using the system default that opens and reads resources from the given file. - Resource file to read. - The fileName parameter is null. - - - Closes and releases any resources used by this . - - - Disposes of the resources (other than memory) used by the current instance of . - - - Releases resources (other than memory) associated with the current instance, closing internal managed objects if requested. - Indicates whether the objects contained in the current instance should be explicitly closed. - - - Returns the preferred resource reader class for this kind of . - Returns the for the preferred resource reader for this kind of . - - - Returns the preferred resource writer class for this kind of . - Returns the for the preferred resource writer for this kind of . - - - Returns an that can iterate through the . - An for this . - The resource set has been closed or disposed. - - - Searches for a resource object with the specified name. - Case-sensitive name of the resource to search for. - The requested resource. - The name parameter is null. - The object has been closed or disposed. - - - Searches for a resource object with the specified name in a case-insensitive manner, if requested. - Name of the resource to search for. - Indicates whether the case of the specified name should be ignored. - The requested resource. - The name parameter is null. - The object has been closed or disposed. - - - Searches for a resource with the specified name. - Name of the resource to search for. - The value of a resource, if the value is a . - The name parameter is null. - The resource specified by name is not a . - The object has been closed or disposed. - - - Searches for a resource with the specified name in a case-insensitive manner, if requested. - Name of the resource to search for. - Indicates whether the case of the case of the specified name should be ignored. - The value of a resource, if the value is a . - The name parameter is null. - The resource specified by name is not a . - The object has been closed or disposed. - - - Reads all the resources and stores them in a indicated in the property. - - - Returns an object to avoid a race condition with Dispose. This member is not intended to be used directly from your code. - An enumerator for the current object. - - - Writes resources in the system-default format to an output file or an output stream. This class cannot be inherited. - - - Initializes a new instance of the class that writes the resources to the provided stream. - The output stream. - The stream parameter is not writable. - The stream parameter is null. - - - Initializes a new instance of the class that writes the resources to the specified file. - The output file name. - The fileName parameter is null. - - - Adds a named resource specified as a byte array to the list of resources to be written. - The name of the resource. - Value of the resource as an 8-bit unsigned integer array. - name (or a name that varies only by capitalization) has already been added to this . - The name parameter is null. - This has been closed and its hash table is unavailable. - - - Adds a named resource specified as a stream to the list of resources to be written. - The name of the resource to add. - The value of the resource to add. The resource must support the property. - name (or a name that varies only by capitalization) has already been added to this . -or- The stream does not support the property. - name or value is null. - This has been closed. - - - Adds a named resource specified as an object to the list of resources to be written. - The name of the resource. - The value of the resource. - name (or a name that varies only by capitalization) has already been added to this . - The name parameter is null. - This has been closed and its hash table is unavailable. - - - Adds a string resource to the list of resources to be written. - The name of the resource. - The value of the resource. - name (or a name that varies only by capitalization) has already been added to this ResourceWriter. - The name parameter is null. - This has been closed and its hash table is unavailable. - - - Adds a named resource specified as a stream to the list of resources to be written, and specifies whether the stream should be closed after the method is called. - The name of the resource to add. - The value of the resource to add. The resource must support the property. - true to close the stream after the method is called; otherwise, false. - name (or a name that varies only by capitalization) has already been added to this . -or- The stream does not support the property. - name or value is null. - This has been closed. - - - Adds a unit of data as a resource to the list of resources to be written. - A name that identifies the resource that contains the added data. - The type name of the added data. - A byte array that contains the binary representation of the added data. - name, typeName, or serializedData is null. - name (or a name that varies only by capitalization) has already been added to this object. - The current object is not initialized. The probable cause is that the object is closed. - - - Saves the resources to the output stream and then closes it. - An I/O error has occurred. - An error has occurred during serialization of the object. - - - Allows users to close the resource file or stream, explicitly releasing resources. - An I/O error has occurred. - An error has occurred during serialization of the object. - - - Saves all resources to the output stream in the system default format. - An I/O error occurred. - An error occurred during serialization of the object. - This has been closed and its hash table is unavailable. - - - Gets or sets a delegate that enables resource assemblies to be written that target versions of the .NET Framework prior to the .NET Framework 4 by using qualified assembly names. - The type that is encapsulated by the delegate. - - - Instructs a object to ask for a particular version of a satellite assembly. - - - Initializes a new instance of the class. - A string that specifies the version of the satellite assemblies to load. - The version parameter is null. - - - Gets the version of the satellite assemblies with the required resources. - A string that contains the version of the satellite assemblies with the required resources. - - - Specifies whether a object looks for the resources of the app's default culture in the main assembly or in a satellite assembly. - - - Fallback resources are located in the main assembly. - - - - Fallback resources are located in a satellite assembly. - - - - Specifies patch band information for targeted patching of the .NET Framework. - - - Initializes a new instance of the class. - The patch band. - - - Gets the patch band. - The patch band information. - - - When applied to a collection type, enables custom specification of the collection item elements. This attribute can be applied only to types that are recognized by the as valid, serializable collections. - - - Initializes a new instance of the class. - - - Gets whether has been explicitly set. - Returns true if the item name has been explicitly set; otherwise, false. - - - Gets whether has been explicitly set. - Returns true if the key name has been explicitly set; otherwise, false. - - - Gets whether has been explicitly set. - Returns true if the name has been explicitly set; otherwise, false. - - - Gets whether has been explicitly set. - Returns true if the item namespace has been explicitly set; otherwise, false. - - - Gets or sets a value that indicates whether to preserve object reference data. - true to keep object reference data; otherwise, false. The default is false. - - - Gets whether reference has been explicitly set. - Returns true if the reference has been explicitly set; otherwise, false. - - - Gets whether has been explicitly set. - Returns true if the value name has been explicitly set; otherwise, false. - - - Gets or sets a custom name for a collection element. - The name to apply to collection elements. - - - Gets or sets the custom name for a dictionary key name. - The name to use instead of the default dictionary key name. - - - Gets or sets the data contract name for the collection type. - The data contract name for the collection type. - - - Gets or sets the namespace for the data contract. - The namespace of the data contract. - - - Gets or sets the custom name for a dictionary value name. - The name to use instead of the default dictionary value name. - - - Specifies the CLR namespace and XML namespace of the data contract. - - - Initializes a new instance of the class using the supplied namespace. - The namespace of the contract. - - - Gets or sets the CLR namespace of the data contract type. - The CLR-legal namespace of a type. - - - Gets the namespace of the data contract members. - The namespace of the data contract members. - - - Specifies that the type defines or implements a data contract and is serializable by a serializer, such as the . To make their type serializable, type authors must define a data contract for their type. - - - Initializes a new instance of the class. - - - Gets whether has been explicitly set. - Returns true if the name has been explicitly set; otherwise, false. - - - Gets whether has been explicitly set. - Returns true if the namespace has been explicitly set; otherwise, false. - - - Gets or sets a value that indicates whether to preserve object reference data. - true to keep object reference data using standard XML; otherwise, false. The default is false. - - - Gets whether has been explicitly set. - true if the reference has been explicitly set; otherwise, false. - - - Gets or sets the name of the data contract for the type. - The local name of a data contract. The default is the name of the class that the attribute is applied to. - - - Gets or sets the namespace for the data contract for the type. - The namespace of the contract. - - - Provides a mechanism for dynamically mapping types to and from xsi:type representations during serialization and deserialization. - - - Initializes a new instance of the class. - - - Override this method to map the specified xsi:type name and namespace to a data contract type during deserialization. - The xsi:type name to map. - The xsi:type namespace to map. - The type declared in the data contract. - The known type resolver. - The type the xsi:type name and namespace is mapped to. - - - Override this method to map a data contract type to an xsi:type name and namespace during serialization. - The type to map. - The type declared in the data contract. - The known type resolver. - The xsi:type name. - The xsi:type namespace. - true if mapping succeeded; otherwise, false. - - - Serializes and deserializes an instance of a type into an XML stream or document using a supplied data contract. This class cannot be inherited. - - - Initializes a new instance of the class to serialize or deserialize an object of the specified type. - The type of the instances that are serialized or deserialized. - - - Initializes a new instance of the class to serialize or deserialize an object of the specified type. This method also specifies the root XML element and namespace in two string parameters as well as a list of known types that may be present in the object graph. - The type of the instances that are serialized or deserialized. - The root element name of the content. - The namespace of the root element. - An of that contains the types that may be present in the object graph. - - - Initializes a new instance of the class to serialize or deserialize an object of the specified type using the XML root element and namespace specified through the parameters of type . - The type of the instances that are serialized or deserialized. - An that contains the root element name of the content. - An that contains the namespace of the root element. - - - Initializes a new instance of the class to serialize or deserialize an object of the specified type using the supplied XML root element and namespace. - The type of the instances that are serialized or deserialized. - The name of the XML element that encloses the content to serialize or deserialize. - The namespace of the XML element that encloses the content to serialize or deserialize. - - - Initializes a new instance of the class to serialize or deserialize an object of the specified type and settings. - The type of the instance to serialize or deserialize. - The serializer settings. - - - Initializes a new instance of the class to serialize or deserialize an object of the specified type, and a collection of known types that may be present in the object graph. - The type of the instances that are serialized or deserialized. - An of that contains the types that may be present in the object graph. - - - Initializes a new instance of the class to serialize or deserialize an object of the specified type. This method also specifies the root XML element and namespace in two parameters as well as a list of known types that may be present in the object graph. - The type of the instances that are serialized or deserialized. - An that contains the root element name of the content. - An that contains the namespace of the root element. - A of that contains the known types that may be present in the object graph. - - - Gets the component used to dynamically map xsi:type declarations to known contract types. - An implementation of the class. - - - Gets a value that specifies whether to ignore data supplied by an extension of the class when the class is being serialized or deserialized. - true to omit the extension data; otherwise, false. - - - Determines whether the is positioned on an object that can be deserialized. - The used to read the XML stream. - true if the reader is at the start element of the stream to read; otherwise, false. - - - Determines whether the is positioned on an object that can be deserialized. - An used to read the XML stream. - true if the reader is at the start element of the stream to read; otherwise, false. - - - Gets a collection of types that may be present in the object graph serialized using this instance of the . - A that contains the expected types passed in as known types to the constructor. - - - Gets the maximum number of items in an object graph to serialize or deserialize. - The maximum number of items to serialize or deserialize. The default is . - The number of items exceeds the maximum value. - - - Gets a value that specifies whether to use non-standard XML constructs to preserve object reference data. - true to keep the references; otherwise, false. - - - Reads the XML stream with an and returns the deserialized object. - The used to read the XML stream. - The deserialized object. - - - Reads the XML stream with an and returns the deserialized object, and also specifies whether a check is made to verify the object name before reading its value. - The used to read the XML stream. - true to check whether the name of the object corresponds to the root name value supplied in the constructor; otherwise, false. - The deserialized object. - The verifyObjectName parameter is set to true, and the element name and namespace do not correspond to the values set in the constructor. - - - Reads the XML stream with an and returns the deserialized object, and also specifies whether a check is made to verify the object name before reading its value. - The used to read the XML stream. - true to check whether the name of the object corresponds to the root name value supplied in the constructor; otherwise, false. - The deserialized object. - The verifyObjectName parameter is set to true, and the element name and namespace do not correspond to the values set in the constructor. - - - Reads an XML document or document stream and returns the deserialized object. The method includes a parameter to specify whether the object name is verified is validated, and a resolver for mapping xsi:type declarations at runtime. - The XML reader used to read the content. - true to verify the object name; otherwise, false. - An implementation of the to map xsi:type declarations to data contract types. - The deserialized object. - - - Gets a value that specifies whether read-only types are serialized. - true if read-only types are serialized; false if all types are serialized. - - - Writes the closing XML element using an . - The used to write the stream. - The type being serialized does not conform to data contract rules. For example, the attribute has not been applied to the type. - There is a problem with the instance being written. - - - Writes the closing XML element using an . - The used to write the stream. - The type being serialized does not conform to data contract rules. For example, the attribute has not been applied to the type. - There is a problem with the instance being written. - - - Writes all the object data (starting XML element, content, and closing element) to an XML document or stream with an . - The used to write the XML document or stream. - The object that contains the data to write to the stream. - The type being serialized does not conform to data contract rules. For example, the attribute has not been applied to the type. - There is a problem with the instance being written. - - - Writes all the object data (starting XML element, content, and enclosing element) to an XML document or stream using the specified XmlDictionaryWriter. The method includes a resolver for mapping xsi:type declarations at runtime. - An XmlDictionaryWriter used to write the content to the XML document or stream. - The object that contains the content to write. - An implementation of the used to map xsi:type declarations to known data contracts. - - - Writes the XML content using an . - The used to write the stream. - The object to write to the stream. - The type being serialized does not conform to data contract rules. For example, the attribute has not been applied to the type. - There is a problem with the instance being written. - - - Writes the XML content using an . - The used to write the stream. - The object to write to the stream. - The type being serialized does not conform to data contract rules. For example, the attribute has not been applied to the type. - There is a problem with the instance being written. - - - Writes the opening XML element using an . - The used to write the XML start element. - The object to write. - - - Writes the opening XML element using an . - The used to write the XML start element. - The object to write. - - - - - - - - - - - - - - Specifies the security actions that can be performed using declarative security. - - - The calling code can access the resource identified by the current permission object, even if callers higher in the stack have not been granted permission to access the resource (see Using the Assert Method). - - - - All callers higher in the call stack are required to have been granted the permission specified by the current permission object. - - - - The ability to access the resource specified by the current permission object is denied to callers, even if they have been granted permission to access it (see Using the Deny Method). - - - - The derived class inheriting the class or overriding a method is required to have been granted the specified permission.. - - - - The immediate caller is required to have been granted the specified permission. Do not use in the .NET Framework 4. For full trust, use instead; for partial trust, use . - - - - Only the resources specified by this permission object can be accessed, even if the code has been granted permission to access other resources. - - - - The request for the minimum permissions required for code to run. This action can only be used within the scope of the assembly. - - - - The request for additional permissions that are optional (not required to run). This request implicitly refuses all other permissions not specifically requested. This action can only be used within the scope of the assembly. - - - - The request that permissions that might be misused will not be granted to the calling code. This action can only be used within the scope of the assembly. - - - - Specifies the base attribute class for declarative security from which is derived. - - - Initializes a new instance of with the specified . - One of the values. - - - Gets or sets a security action. - One of the values. - - - When overridden in a derived class, creates a permission object that can then be serialized into binary form and persistently stored along with the in an assembly's metadata. - A serializable permission object. - - - Gets or sets a value indicating whether full (unrestricted) permission to the resource protected by the attribute is declared. - true if full permission to the protected resource is declared; otherwise, false. - - - Allows security actions for to be applied to code using declarative security. This class cannot be inherited. - - - Initializes a new instance of the class with the specified . - One of the values. - - - Gets or sets a value indicating whether permission to assert that all this code's callers have the requisite permission for the operation is declared. - true if permission to assert is declared; otherwise, false. - - - Gets or sets a value that indicates whether code has permission to perform binding redirection in the application configuration file. - true if code can perform binding redirects; otherwise, false. - - - Gets or sets a value indicating whether permission to manipulate is declared. - true if permission to manipulate is declared; otherwise, false. - - - Gets or sets a value indicating whether permission to alter or manipulate domain security policy is declared. - true if permission to alter or manipulate security policy in an application domain is declared; otherwise, false. - - - Gets or sets a value indicating whether permission to alter or manipulate evidence is declared. - true if the ability to alter or manipulate evidence is declared; otherwise, false. - - - Gets or sets a value indicating whether permission to view and manipulate security policy is declared. - true if permission to manipulate security policy is declared; otherwise, false. - - - Gets or sets a value indicating whether permission to manipulate the current principal is declared. - true if permission to manipulate the current principal is declared; otherwise, false. - - - Gets or sets a value indicating whether permission to manipulate threads is declared. - true if permission to manipulate threads is declared; otherwise, false. - - - Creates and returns a new . - A that corresponds to this attribute. - - - Gets or sets a value indicating whether permission to execute code is declared. - true if permission to execute code is declared; otherwise, false. - - - Gets or sets all permission flags comprising the permissions. - One or more of the values combined using a bitwise OR. - An attempt is made to set this property to an invalid value. See for the valid values. - - - Gets or sets a value indicating whether code can plug into the common language runtime infrastructure, such as adding Remoting Context Sinks, Envoy Sinks and Dynamic Sinks. - true if code can plug into the common language runtime infrastructure; otherwise, false. - - - Gets or sets a value indicating whether code can configure remoting types and channels. - true if code can configure remoting types and channels; otherwise, false. - - - Gets or sets a value indicating whether code can use a serialization formatter to serialize or deserialize an object. - true if code can use a serialization formatter to serialize or deserialize an object; otherwise, false. - - - Gets or sets a value indicating whether permission to bypass code verification is declared. - true if permission to bypass code verification is declared; otherwise, false. - - - Gets or sets a value indicating whether permission to call unmanaged code is declared. - true if permission to call unmanaged code is declared; otherwise, false. - - - Specifies access flags for the security permission object. - - - The unrestricted state of the permission. - - - - Ability to assert that all this code's callers have the requisite permission for the operation. - - - - Permission to perform explicit binding redirection in the application configuration file. This includes redirection of .NET Framework assemblies that have been unified as well as other assemblies found outside the .NET Framework. - - - - Ability to create and manipulate an . - - - - Ability to specify domain policy. - - - - Ability to provide evidence, including the ability to alter the evidence provided by the common language runtime. - - - - Ability to view and modify policy. - - - - Ability to manipulate the principal object. - - - - Ability to use certain advanced operations on threads. - - - - Permission for the code to run. Without this permission, managed code will not be executed. - - - - Permission to plug code into the common language runtime infrastructure, such as adding Remoting Context Sinks, Envoy Sinks and Dynamic Sinks. - - - - No security access. - - - - Permission to configure Remoting types and channels. - - - - Ability to provide serialization services. Used by serialization formatters. - - - - Ability to skip verification of code in this assembly. Code that is unverifiable can be run if this permission is granted. - - - - Ability to call unmanaged code. - - - - Provides the basic functionality for propagating a synchronization context in various synchronization models. - - - Creates a new instance of the class. - - - When overridden in a derived class, creates a copy of the synchronization context. - A new object. - - - Gets the synchronization context for the current thread. - A object representing the current synchronization context. - - - Determines if wait notification is required. - true if wait notification is required; otherwise, false. - - - When overridden in a derived class, responds to the notification that an operation has completed. - - - When overridden in a derived class, responds to the notification that an operation has started. - - - When overridden in a derived class, dispatches an asynchronous message to a synchronization context. - The delegate to call. - The object passed to the delegate. - - - When overridden in a derived class, dispatches a synchronous message to a synchronization context. - The delegate to call. - The object passed to the delegate. - The method was called in a Windows Store app. The implementation of for Windows Store apps does not support the method. - - - Sets the current synchronization context. - The object to be set. - - - Sets notification that wait notification is required and prepares the callback method so it can be called more reliably when a wait occurs. - - - Waits for any or all the elements in the specified array to receive a signal. - An array of type that contains the native operating system handles. - true to wait for all handles; false to wait for any handle. - The number of milliseconds to wait, or (-1) to wait indefinitely. - The array index of the object that satisfied the wait. - waitHandles is null. - - - Helper function that waits for any or all the elements in the specified array to receive a signal. - An array of type that contains the native operating system handles. - true to wait for all handles; false to wait for any handle. - The number of milliseconds to wait, or (-1) to wait indefinitely. - The array index of the object that satisfied the wait. - - - The exception that is thrown when a method requires the caller to own the lock on a given Monitor, and the method is invoked by a caller that does not own that lock. - - - Initializes a new instance of the class with default properties. - - - Initializes a new instance of the class with a specified error message. - The error message that explains the reason for the exception. - - - Initializes a new instance of the class with serialized data. - The that holds the serialized object data about the exception being thrown. - The that contains contextual information about the source or destination. - - - Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. - The error message that explains the reason for the exception. - The exception that is the cause of the current exception. If the innerException parameter is not null, the current exception is raised in a catch block that handles the inner exception. - - - Provides task schedulers that coordinate to execute tasks while ensuring that concurrent tasks may run concurrently and exclusive tasks never do. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class that targets the specified scheduler. - The target scheduler on which this pair should execute. - - - Initializes a new instance of the class that targets the specified scheduler with a maximum concurrency level. - The target scheduler on which this pair should execute. - The maximum number of tasks to run concurrently. - - - Initializes a new instance of the class that targets the specified scheduler with a maximum concurrency level and a maximum number of scheduled tasks that may be processed as a unit. - The target scheduler on which this pair should execute. - The maximum number of tasks to run concurrently. - The maximum number of tasks to process for each underlying scheduled task used by the pair. - - - Informs the scheduler pair that it should not accept any more tasks. - - - Gets a that will complete when the scheduler has completed processing. - The asynchronous operation that will complete when the scheduler finishes processing. - - - Gets a that can be used to schedule tasks to this pair that may run concurrently with other tasks on this pair. - An object that can be used to schedule tasks concurrently. - - - Gets a that can be used to schedule tasks to this pair that must run exclusively with regards to other tasks on this pair. - An object that can be used to schedule tasks that do not run concurrently with other tasks. - - - Provides support for parallel loops and regions. - - - Executes a for (For in Visual Basic) loop in which iterations may run in parallel and the state of the loop can be monitored and manipulated. - The start index, inclusive. - The end index, exclusive. - The delegate that is invoked once per iteration. - A structure that contains information about which portion of the loop completed. - The body argument is null. - The exception that contains all the individual exceptions thrown on all threads. - - - Executes a for (For in Visual Basic) loop in which iterations may run in parallel. - The start index, inclusive. - The end index, exclusive. - The delegate that is invoked once per iteration. - A structure that contains information about which portion of the loop completed. - The body argument is null. - The exception that contains all the individual exceptions thrown on all threads. - - - Executes a for (For in Visual Basic) loop with 64-bit indexes in which iterations may run in parallel and the state of the loop can be monitored and manipulated. - The start index, inclusive. - The end index, exclusive. - The delegate that is invoked once per iteration. - A structure that contains information on what portion of the loop completed. - The body argument is null. - The exception that contains all the individual exceptions thrown on all threads. - - - Executes a for (For in Visual Basic) loop with 64-bit indexes in which iterations may run in parallel. - The start index, inclusive. - The end index, exclusive. - The delegate that is invoked once per iteration. - A structure that contains information about which portion of the loop completed. - The body argument is null. - The exception that contains all the individual exceptions thrown on all threads. - - - Executes a for (For in Visual Basic) loop in which iterations may run in parallel, loop options can be configured, and the state of the loop can be monitored and manipulated. - The start index, inclusive. - The end index, exclusive. - An object that configures the behavior of this operation. - The delegate that is invoked once per iteration. - A structure that contains information about which portion of the loop completed. - The in the parallelOptions argument is canceled. - The body argument is null. -or- The parallelOptions argument is null. - The exception that contains all the individual exceptions thrown on all threads. - The associated with the in the parallelOptions has been disposed. - - - Executes a for (For in Visual Basic) loop in which iterations may run in parallel and loop options can be configured. - The start index, inclusive. - The end index, exclusive. - An object that configures the behavior of this operation. - The delegate that is invoked once per iteration. - A structure that contains information about which portion of the loop completed. - The in the parallelOptions argument is canceled. - The body argument is null. -or- The parallelOptions argument is null. - The exception that contains all the individual exceptions thrown on all threads. - The associated with the in the parallelOptions has been disposed. - - - Executes a for (For in Visual Basic) loop with 64-bit indexes in which iterations may run in parallel, loop options can be configured, and the state of the loop can be monitored and manipulated. - The start index, inclusive. - The end index, exclusive. - An object that configures the behavior of this operation. - The delegate that is invoked once per iteration. - A structure that contains information about which portion of the loop completed. - The in the parallelOptions argument is canceled. - The body argument is null. -or- The parallelOptions argument is null. - The exception that contains all the individual exceptions thrown on all threads. - The associated with the in the parallelOptions has been disposed. - - - Executes a for (For in Visual Basic) loop with 64-bit indexes in which iterations may run in parallel and loop options can be configured. - The start index, inclusive. - The end index, exclusive. - An object that configures the behavior of this operation. - The delegate that is invoked once per iteration. - A structure that contains information about which portion of the loop completed. - The in the parallelOptions argument is canceled. - The body argument is null. -or- The parallelOptions argument is null. - The exception that contains all the individual exceptions thrown on all threads. - The associated with the in the parallelOptions has been disposed. - - - Executes a for (For in Visual Basic) loop with 64-bit indexes and thread-local data in which iterations may run in parallel, loop options can be configured, and the state of the loop can be monitored and manipulated. - The start index, inclusive. - The end index, exclusive. - An object that configures the behavior of this operation. - The function delegate that returns the initial state of the local data for each thread. - The delegate that is invoked once per iteration. - The delegate that performs a final action on the local state of each thread. - The type of the thread-local data. - A structure that contains information about which portion of the loop completed. - The body argument is null. -or- The localInit argument is null. -or- The localFinally argument is null. -or- The parallelOptions argument is null. - The in the parallelOptions argument is canceled. - The associated with the in the parallelOptions has been disposed. - The exception that contains all the individual exceptions thrown on all threads. - - - Executes a for (For in Visual Basic) loop with thread-local data in which iterations may run in parallel, loop options can be configured, and the state of the loop can be monitored and manipulated. - The start index, inclusive. - The end index, exclusive. - An object that configures the behavior of this operation. - The function delegate that returns the initial state of the local data for each task. - The delegate that is invoked once per iteration. - The delegate that performs a final action on the local state of each task. - The type of the thread-local data. - A structure that contains information about which portion of the loop completed. - The body argument is null. -or- The localInit argument is null. -or- The localFinally argument is null. -or- The parallelOptions argument is null. - The in the parallelOptions argument is canceled. - The associated with the in the parallelOptions has been disposed. - The exception that contains all the individual exceptions thrown on all threads. - - - Executes a for (For in Visual Basic) loop with thread-local data in which iterations may run in parallel, and the state of the loop can be monitored and manipulated. - The start index, inclusive. - The end index, exclusive. - The function delegate that returns the initial state of the local data for each task. - The delegate that is invoked once per iteration. - The delegate that performs a final action on the local state of each task. - The type of the thread-local data. - A structure that contains information about which portion of the loop completed. - The body argument is null. -or- The localInit argument is null. -or- The localFinally argument is null. - The exception that contains all the individual exceptions thrown on all threads. - - - Executes a for (For in Visual Basic) loop with 64-bit indexes and thread-local data in which iterations may run in parallel, and the state of the loop can be monitored and manipulated. - The start index, inclusive. - The end index, exclusive. - The function delegate that returns the initial state of the local data for each task. - The delegate that is invoked once per iteration. - The delegate that performs a final action on the local state of each task. - The type of the thread-local data. - A structure that contains information about which portion of the loop completed. - The body argument is null. -or- The localInit argument is null. -or- The localFinally argument is null. - The exception that contains all the individual exceptions thrown on all threads. - - - Executes a foreach (For Each in Visual Basic) operation with thread-local data on an in which iterations may run in parallel, loop options can be configured, and the state of the loop can be monitored and manipulated.. - An enumerable data source. - An object that configures the behavior of this operation. - The function delegate that returns the initial state of the local data for each task. - The delegate that is invoked once per iteration. - The delegate that performs a final action on the local state of each task. - The type of the data in the source. - The type of the thread-local data. - A structure that contains information about which portion of the loop completed. - The source argument is null. -or- The parallelOptions argument is null. -or- The body argument is null. -or- The localInit argument is null. -or- The localFinally argument is null. - The in the parallelOptions argument is canceled. - The associated with the in the parallelOptions has been disposed. - The exception that contains all the individual exceptions thrown on all threads. - - - Executes a foreach (For Each in Visual Basic) operation with thread-local data and 64-bit indexes on an in which iterations may run in parallel, loop options can be configured, and the state of the loop can be monitored and manipulated. - An enumerable data source. - An object that configures the behavior of this operation. - The function delegate that returns the initial state of the local data for each task. - The delegate that is invoked once per iteration. - The delegate that performs a final action on the local state of each task. - The type of the data in the source. - The type of the thread-local data. - A structure that contains information about which portion of the loop completed. - The source argument is null. -or- The parallelOptions argument is null. -or- The body argument is null. -or- The localInit argument is null. -or- The localFinally argument is null. - The in the parallelOptions argument is canceled. - The associated with the in the parallelOptions has been disposed. - The exception that contains all the individual exceptions thrown on all threads. - - - Executes a foreach (For Each in Visual Basic) operation with thread-local data on a in which iterations may run in parallel, loop options can be configured, and the state of the loop can be monitored and manipulated. - The partitioner that contains the original data source. - An object that configures the behavior of this operation. - The function delegate that returns the initial state of the local data for each task. - The delegate that is invoked once per iteration. - The delegate that performs a final action on the local state of each task. - The type of the elements in source. - The type of the thread-local data. - A structure that contains information about which portion of the loop completed. - The source argument is null. -or- The parallelOptions argument is null. -or- The body argument is null. -or- The localInit argument is null. -or- The localFinally argument is null. - The property in the source returns false or the partitioner returns null partitions. - The exception that contains all the individual exceptions thrown on all threads. - The in the parallelOptions argument is canceled. - The associated with the in the parallelOptions has been disposed. - - - Executes a foreach (For Each in Visual Basic) operation with 64-bit indexes and with thread-local data on a in which iterations may run in parallel , loop options can be configured, and the state of the loop can be monitored and manipulated. - The orderable partitioner that contains the original data source. - An object that configures the behavior of this operation. - The function delegate that returns the initial state of the local data for each task. - The delegate that is invoked once per iteration. - The delegate that performs a final action on the local state of each task. - The type of the elements in source. - The type of the thread-local data. - A structure that contains information about which portion of the loop completed. - The source argument is null. -or- The parallelOptions argument is null. -or- The body argument is null. -or- The localInit or localFinally argument is null. - The property in the source returns false or the partitioner returns null partitions. - The exception that contains all the individual exceptions thrown on all threads. - The in the parallelOptions argument is canceled. - The associated with the in the parallelOptions has been disposed. - - - Executes a foreach (For Each in Visual Basic) operation with thread-local data on an in which iterations may run in parallel, and the state of the loop can be monitored and manipulated. - An enumerable data source. - The function delegate that returns the initial state of the local data for each task. - The delegate that is invoked once per iteration. - The delegate that performs a final action on the local state of each task. - The type of the data in the source. - The type of the thread-local data. - A structure that contains information about which portion of the loop completed. - The source argument is null. -or- The body argument is null. -or- The localInit argument is null. -or- The localFinally argument is null. - The exception that contains all the individual exceptions thrown on all threads. - - - Executes a foreach (For Each in Visual Basic) operation with thread-local data on an in which iterations may run in parallel and the state of the loop can be monitored and manipulated. - An enumerable data source. - The function delegate that returns the initial state of the local data for each task. - The delegate that is invoked once per iteration. - The delegate that performs a final action on the local state of each task. - The type of the data in the source. - The type of the thread-local data. - A structure that contains information about which portion of the loop completed. - The source argument is null. -or- The body argument is null. -or- The localInit argument is null. -or- The localFinally argument is null. - The exception that contains all the individual exceptions thrown on all threads. - - - Executes a foreach (For Each in Visual Basic) operation with thread-local data on a in which iterations may run in parallel and the state of the loop can be monitored and manipulated. - The partitioner that contains the original data source. - The function delegate that returns the initial state of the local data for each task. - The delegate that is invoked once per iteration. - The delegate that performs a final action on the local state of each task. - The type of the elements in source. - The type of the thread-local data. - A structure that contains information about which portion of the loop completed. - The source argument is null. -or- The body argument is null. -or- The localInit argument is null. -or- The localFinally argument is null. - The property in the source returns false or the partitioner returns null partitions. - The exception that contains all the individual exceptions thrown on all threads. - - - Executes a foreach (For Each in Visual Basic) operation with thread-local data on a in which iterations may run in parallel, loop options can be configured, and the state of the loop can be monitored and manipulated. - The orderable partitioner that contains the original data source. - The function delegate that returns the initial state of the local data for each task. - The delegate that is invoked once per iteration. - The delegate that performs a final action on the local state of each task. - The type of the elements in source. - The type of the thread-local data. - A structure that contains information about which portion of the loop completed. - The source argument is null. -or- The body argument is null. -or- The localInit argument is null. -or- The localFinally argument is null. - The property in the source returns false or the partitioner returns null partitions. - The exception that contains all the individual exceptions thrown on all threads. - - - Executes a foreach (For Each in Visual Basic) operation on an in which iterations may run in parallel and loop options can be configured. - An enumerable data source. - An object that configures the behavior of this operation. - The delegate that is invoked once per iteration. - The type of the data in the source. - A structure that contains information about which portion of the loop completed. - The in the parallelOptions argument is canceled - The source argument is null. -or- The parallelOptions argument is null. -or- The body argument is null. - The exception that contains all the individual exceptions thrown on all threads. - The associated with the in the parallelOptions has been disposed. - - - Executes a foreach (For Each in Visual Basic) operation on an in which iterations may run in parallel, loop options can be configured, and the state of the loop can be monitored and manipulated. - An enumerable data source. - An object that configures the behavior of this operation. - The delegate that is invoked once per iteration. - The type of the data in the source. - A structure that contains information about which portion of the loop completed. - The in the parallelOptions argument is canceled - The source argument is null. -or- The parallelOptions argument is null. -or- The body argument is null. - The exception that contains all the individual exceptions thrown on all threads. - The associated with the in the parallelOptions has been disposed. - - - Executes a foreach (For Each in Visual Basic) operation on an in which iterations may run in parallel, and the state of the loop can be monitored and manipulated. - An enumerable data source. - The delegate that is invoked once per iteration. - The type of the data in the source. - A structure that contains information about which portion of the loop completed. - The source argument is null. -or- The body argument is null. - The exception that contains all the individual exceptions thrown on all threads. - - - Executes a foreach (For Each in Visual Basic) operation on a in which iterations may run in parallel and loop options can be configured. - The partitioner that contains the original data source. - An object that configures the behavior of this operation. - The delegate that is invoked once per iteration. - The type of the elements in source. - A structure that contains information about which portion of the loop completed. - The in the parallelOptions argument is canceled. - The associated with the in the parallelOptions has been disposed. - The source argument is null. -or- The parallelOptions argument is null. -or- The body argument is null. - The property in the source partitioner returns false. -or- The exception that is thrown when any methods in the source partitioner return null. - - - Executes a foreach (For Each in Visual Basic) operation on a in which iterations may run in parallel, loop options can be configured, and the state of the loop can be monitored and manipulated. - The partitioner that contains the original data source. - An object that configures the behavior of this operation. - The delegate that is invoked once per iteration. - The type of the elements in source. - A structure that contains information about which portion of the loop completed. - The in the parallelOptions argument is canceled. - The associated with the in the parallelOptions has been disposed. - The source argument is null. -or- The parallelOptions argument is null. -or- The body argument is null. - The property in the source partitioner returns false. -or- The exception that is thrown when any methods in the source partitioner return null. - - - Executes a foreach (For Each in Visual Basic) operation on a in which iterations may run in parallel, loop options can be configured, and the state of the loop can be monitored and manipulated. - The orderable partitioner that contains the original data source. - An object that configures the behavior of this operation. - The delegate that is invoked once per iteration. - The type of the elements in source. - A structure that contains information about which portion of the loop completed. - The in the parallelOptions argument is canceled - The source argument is null. -or- The parallelOptions argument is null. -or- The body argument is null. - The associated with the in the parallelOptions has been disposed. - The property in the source orderable partitioner returns false. -or- The property in the source orderable partitioner returns false. -or- The exception that is thrown when any methods in the source orderable partitioner return null. - - - Executes a foreach (For Each in Visual Basic) operation on an in which iterations may run in parallel. - An enumerable data source. - The delegate that is invoked once per iteration. - The type of the data in the source. - A structure that contains information about which portion of the loop completed. - The source argument is null. -or- The body argument is null. - The exception that contains all the individual exceptions thrown on all threads. - - - Executes a foreach (For Each in Visual Basic) operation with 64-bit indexes on an in which iterations may run in parallel, and the state of the loop can be monitored and manipulated. - An enumerable data source. - The delegate that is invoked once per iteration. - The type of the data in the source. - A structure that contains information about which portion of the loop completed. - The source argument is null. -or- The body argument is null. - The exception that contains all the individual exceptions thrown on all threads. - - - Executes a foreach (For Each in Visual Basic) operation on a in which iterations may run in parallel. - The partitioner that contains the original data source. - The delegate that is invoked once per iteration. - The type of the elements in source. - A structure that contains information about which portion of the loop completed. - The source argument is null. -or- The body argument is null. - The property in the source partitioner returns false. -or- The exception that is thrown when any methods in the source partitioner return null. -or- The method in the source partitioner does not return the correct number of partitions. - - - Executes a foreach (For Each in Visual Basic) operation on a in which iterations may run in parallel, and the state of the loop can be monitored and manipulated. - The partitioner that contains the original data source. - The delegate that is invoked once per iteration. - The type of the elements in source. - A structure that contains information about which portion of the loop completed. - The source argument is null. -or- The body argument is null. - The property in the source partitioner returns false. -or- A method in the source partitioner returns null. -or- The method in the source partitioner does not return the correct number of partitions. - - - Executes a foreach (For Each in Visual Basic) operation on a in which iterations may run in parallel and the state of the loop can be monitored and manipulated. - The orderable partitioner that contains the original data source. - The delegate that is invoked once per iteration. - The type of the elements in source. - A structure that contains information about which portion of the loop completed. - The source argument is null. -or- The body argument is null. - The property in the source orderable partitioner returns false. -or- The property in the source orderable partitioner returns false. -or- Any methods in the source orderable partitioner return null. - - - Executes a foreach (For Each in Visual Basic) operation with 64-bit indexes on an in which iterations may run in parallel, loop options can be configured, and the state of the loop can be monitored and manipulated. - An enumerable data source. - An object that configures the behavior of this operation. - The delegate that is invoked once per iteration. - The type of the data in the source. - A structure that contains information about which portion of the loop completed. - The in the parallelOptions argument is canceled - The source argument is null. -or- The parallelOptions argument is null. -or- The body argument is null. - The exception that contains all the individual exceptions thrown on all threads. - The associated with the in the parallelOptions has been disposed. - - - Executes each of the provided actions, possibly in parallel. - An array of to execute. - The actions argument is null. - The exception that is thrown when any action in the actions array throws an exception. - The actions array contains a null element. - - - Executes each of the provided actions, possibly in parallel, unless the operation is cancelled by the user. - An object that configures the behavior of this operation. - An array of actions to execute. - The in the parallelOptions is set. - The actions argument is null. -or- The parallelOptions argument is null. - The exception that is thrown when any action in the actions array throws an exception. - The actions array contains a null element. - The associated with the in the parallelOptions has been disposed. - - - Provides completion status on the execution of a loop. - - - Gets whether the loop ran to completion, such that all iterations of the loop were executed and the loop didn't receive a request to end prematurely. - true if the loop ran to completion; otherwise false; - - - Gets the index of the lowest iteration from which was called. - Returns an integer that represents the lowest iteration from which the Break statement was called. - - - Enables iterations of parallel loops to interact with other iterations. An instance of this class is provided by the class to each loop; you can not create instances in your code. - - - Communicates that the loop should cease execution of iterations beyond the current iteration at the system's earliest convenience. - The method was previously called. and may not be used in combination by iterations of the same loop. - - - Gets whether any iteration of the loop has thrown an exception that went unhandled by that iteration. - true if an unhandled exception was thrown; otherwise, false. - - - Gets whether any iteration of the loop has called the method. - true if any iteration has stopped the loop by calling the method; otherwise, false. - - - Gets the lowest iteration of the loop from which was called. - The lowest iteration from which was called. In the case of a loop, the value is based on an internally-generated index. - - - Gets whether the current iteration of the loop should exit based on requests made by this or other iterations. - true if the current iteration should exit; otherwise, false. - - - Communicates that the loop should cease execution at the system's earliest convenience. - The method was called previously. and may not be used in combination by iterations of the same loop. - - - Stores options that configure the operation of methods on the class. - - - Initializes a new instance of the class. - - - Gets or sets the associated with this instance. - The token that is associated with this instance. - - - Gets or sets the maximum number of concurrent tasks enabled by this instance. - An integer that represents the maximum degree of parallelism. - The property is being set to zero or to a value that is less than -1. - - - Gets or sets the associated with this instance. Setting this property to null indicates that the current scheduler should be used. - The task scheduler that is associated with this instance. - - - Represents an asynchronous operation that can return a value. - The type of the result produced by this . - - - Initializes a new with the specified function. - The delegate that represents the code to execute in the task. When the function has completed, the task's property will be set to return the result value of the function. - The function argument is null. - - - Initializes a new with the specified function and state. - The delegate that represents the code to execute in the task. When the function has completed, the task's property will be set to return the result value of the function. - An object representing data to be used by the action. - The function argument is null. - - - Initializes a new with the specified function. - The delegate that represents the code to execute in the task. When the function has completed, the task's property will be set to return the result value of the function. - The to be assigned to this task. - The that created cancellationToken has already been disposed. - The function argument is null. - - - Initializes a new with the specified function and creation options. - The delegate that represents the code to execute in the task. When the function has completed, the task's property will be set to return the result value of the function. - The used to customize the task's behavior. - The creationOptions argument specifies an invalid value for . - The function argument is null. - - - Initializes a new with the specified action, state, and options. - The delegate that represents the code to execute in the task. When the function has completed, the task's property will be set to return the result value of the function. - An object representing data to be used by the function. - The to be assigned to the new task. - The that created cancellationToken has already been disposed. - The function argument is null. - - - Initializes a new with the specified action, state, and options. - The delegate that represents the code to execute in the task. When the function has completed, the task's property will be set to return the result value of the function. - An object representing data to be used by the function. - The used to customize the task's behavior. - The creationOptions argument specifies an invalid value for . - The function argument is null. - - - Initializes a new with the specified function and creation options. - The delegate that represents the code to execute in the task. When the function has completed, the task's property will be set to return the result value of the function. - The that will be assigned to the new task. - The used to customize the task's behavior. - The that created cancellationToken has already been disposed. - The creationOptions argument specifies an invalid value for . - The function argument is null. - - - Initializes a new with the specified action, state, and options. - The delegate that represents the code to execute in the task. When the function has completed, the task's property will be set to return the result value of the function. - An object representing data to be used by the function. - The to be assigned to the new task. - The used to customize the task's behavior. - The that created cancellationToken has already been disposed. - The creationOptions argument specifies an invalid value for . - The function argument is null. - - - Configures an awaiter used to await this . - true to attempt to marshal the continuation back to the original context captured; otherwise, false. - An object used to await this task. - - - Creates a continuation that executes when the target completes. - An action to run when the completes. When run, the delegate will be passed the completed task and the caller-supplied state object as arguments. - An object representing data to be used by the continuation action. - The that will be assigned to the new continuation task. - Options for when the continuation is scheduled and how it behaves. This includes criteria, such as , as well as execution options, such as . - The to associate with the continuation task and to use for its execution. - A new continuation . - The scheduler argument is null. - The continuationOptions argument specifies an invalid value for . - The provided has already been disposed. - - - Creates a continuation that executes according the condition specified in continuationOptions. - An action to run according the condition specified in continuationOptions. When run, the delegate will be passed the completed task as an argument. - The that will be assigned to the new continuation task. - Options for when the continuation is scheduled and how it behaves. This includes criteria, such as , as well as execution options, such as . - The to associate with the continuation task and to use for its execution. - A new continuation . - The has been disposed. -or- The that created cancellationToken has already been disposed. - The continuationAction argument is null. -or- The scheduler argument is null. - The continuationOptions argument specifies an invalid value for . - - - Creates a continuation that executes when the target completes. - An action to run when the completes. When run, the delegate will be passed the completed task and the caller-supplied state object as arguments. - An object representing data to be used by the continuation action. - The to associate with the continuation task and to use for its execution. - A new continuation . - The scheduler argument is null. - - - Creates a continuation that executes when the target completes. - An action to run when the completes. When run, the delegate will be passed the completed task and the caller-supplied state object as arguments. - An object representing data to be used by the continuation action. - The that will be assigned to the new continuation task. - A new continuation . - The continuationAction argument is null. - The provided has already been disposed. - - - Creates a continuation that executes when the target completes. - An action to run when the completes. When run, the delegate will be passed the completed task and the caller-supplied state object as arguments. - An object representing data to be used by the continuation action. - Options for when the continuation is scheduled and how it behaves. This includes criteria, such as , as well as execution options, such as . - A new continuation . - The continuationAction argument is null. - The continuationOptions argument specifies an invalid value for . - - - Creates a continuation that executes according the condition specified in continuationOptions. - An action to according the condition specified in continuationOptions. When run, the delegate will be passed the completed task as an argument. - Options for when the continuation is scheduled and how it behaves. This includes criteria, such as , as well as execution options, such as . - A new continuation . - The has been disposed. - The continuationAction argument is null. - The continuationOptions argument specifies an invalid value for . - - - Creates a cancelable continuation that executes asynchronously when the target completes. - An action to run when the completes. When run, the delegate is passed the completed task as an argument. - The cancellation token that is passed to the new continuation task. - A new continuation task. - The has been disposed. -or- The that created cancellationToken has been disposed. - The continuationAction argument is null. - - - Creates a continuation that that is passed state information and that executes when the target completes. - An action to run when the completes. When run, the delegate is passed the completed task and the caller-supplied state object as arguments. - An object representing data to be used by the continuation action. - A new continuation . - The continuationAction argument is null. - - - Creates a continuation that executes asynchronously when the target task completes. - An action to run when the antecedent completes. When run, the delegate will be passed the completed task as an argument. - A new continuation task. - The has been disposed. - The continuationAction argument is null. - - - Creates a continuation that executes asynchronously when the target completes. - An action to run when the completes. When run, the delegate will be passed the completed task as an argument. - The to associate with the continuation task and to use for its execution. - A new continuation . - The has been disposed. - The continuationAction argument is null. -or- The scheduler argument is null. - - - Creates a continuation that executes when the target completes. - A function to run when the completes. When run, the delegate will be passed the completed task and the caller-supplied state object as arguments. - An object representing data to be used by the continuation function. - The that will be assigned to the new task. - Options for when the continuation is scheduled and how it behaves. This includes criteria, such as , as well as execution options, such as . - The to associate with the continuation task and to use for its execution. - The type of the result produced by the continuation. - A new continuation . - The scheduler argument is null. - The continuationOptions argument specifies an invalid value for . - The provided has already been disposed. - - - Creates a continuation that executes according the condition specified in continuationOptions. - A function to run according the condition specified in continuationOptions. When run, the delegate will be passed as an argument this completed task. - The that will be assigned to the new task. - Options for when the continuation is scheduled and how it behaves. This includes criteria, such as , as well as execution options, such as . - The to associate with the continuation task and to use for its execution. - The type of the result produced by the continuation. - A new continuation . - The has been disposed. -or- The that created cancellationToken has already been disposed. - The continuationFunction argument is null. -or- The scheduler argument is null. - The continuationOptions argument specifies an invalid value for . - - - Creates a continuation that executes when the target completes. - A function to run when the completes. When run, the delegate will be passed the completed task and the caller-supplied state object as arguments. - An object representing data to be used by the continuation function. - The to associate with the continuation task and to use for its execution. - The type of the result produced by the continuation. - A new continuation . - The scheduler argument is null. - - - Creates a continuation that executes when the target completes. - A function to run when the completes. When run, the delegate will be passed the completed task and the caller-supplied state object as arguments. - An object representing data to be used by the continuation function. - Options for when the continuation is scheduled and how it behaves. This includes criteria, such as , as well as execution options, such as . - The type of the result produced by the continuation. - A new continuation . - The continuationFunction argument is null. - The continuationOptions argument specifies an invalid value for . - - - Creates a continuation that executes when the target completes. - A function to run when the completes. When run, the delegate will be passed the completed task and the caller-supplied state object as arguments. - An object representing data to be used by the continuation function. - The that will be assigned to the new task. - The type of the result produced by the continuation. - A new continuation . - The continuationFunction argument is null. - The provided has already been disposed. - - - Creates a continuation that executes according the condition specified in continuationOptions. - A function to run according the condition specified in continuationOptions. When run, the delegate will be passed the completed task as an argument. - Options for when the continuation is scheduled and how it behaves. This includes criteria, such as , as well as execution options, such as . - The type of the result produced by the continuation. - A new continuation . - The has been disposed. - The continuationFunction argument is null. - The continuationOptions argument specifies an invalid value for . - - - Creates a continuation that executes asynchronously when the target completes. - A function to run when the completes. When run, the delegate will be passed the completed task as an argument. - The that will be assigned to the new task. - The type of the result produced by the continuation. - A new continuation . - The has been disposed. -or- The that created cancellationToken has already been disposed. - The continuationFunction argument is null. - - - Creates a continuation that executes when the target completes. - A function to run when the completes. When run, the delegate will be passed the completed task and the caller-supplied state object as arguments. - An object representing data to be used by the continuation function. - The type of the result produced by the continuation. - A new continuation . - The continuationFunction argument is null. - - - Creates a continuation that executes asynchronously when the target completes. - A function to run when the completes. When run, the delegate will be passed the completed task as an argument. - The type of the result produced by the continuation. - A new continuation . - The has been disposed. - The continuationFunction argument is null. - - - Creates a continuation that executes asynchronously when the target completes. - A function to run when the completes. When run, the delegate will be passed the completed task as an argument. - The to associate with the continuation task and to use for its execution. - The type of the result produced by the continuation. - A new continuation . - The has been disposed. - The continuationFunction argument is null. -or- The scheduler argument is null. - - - Provides access to factory methods for creating and configuring instances. - A factory object that can create a variety of objects. - - - Gets an awaiter used to await this . - An awaiter instance. - - - Gets the result value of this . - The result value of this , which is the same type as the task's type parameter. - The task was canceled. The collection contains a object. -or- An exception was thrown during the execution of the task. The collection contains information about the exception or exceptions. - - - Represents an asynchronous operation. - - - Initializes a new with the specified action. - The delegate that represents the code to execute in the task. - The action argument is null. - - - Initializes a new with the specified action and . - The delegate that represents the code to execute in the task. - The that the new task will observe. - The provided has already been disposed. - The action argument is null. - - - Initializes a new with the specified action and creation options. - The delegate that represents the code to execute in the task. - The used to customize the task's behavior. - The action argument is null. - The creationOptions argument specifies an invalid value for . - - - Initializes a new with the specified action and state. - The delegate that represents the code to execute in the task. - An object representing data to be used by the action. - The action argument is null. - - - Initializes a new with the specified action and creation options. - The delegate that represents the code to execute in the task. - The that the new task will observe. - The used to customize the task's behavior. - The that created cancellationToken has already been disposed. - The action argument is null. - The creationOptions argument specifies an invalid value for . - - - Initializes a new with the specified action, state, and options. - The delegate that represents the code to execute in the task. - An object representing data to be used by the action. - The that that the new task will observe. - The that created cancellationToken has already been disposed. - The action argument is null. - - - Initializes a new with the specified action, state, and options. - The delegate that represents the code to execute in the task. - An object representing data to be used by the action. - The used to customize the task's behavior. - The action argument is null. - The creationOptions argument specifies an invalid value for . - - - Initializes a new with the specified action, state, and options. - The delegate that represents the code to execute in the task. - An object representing data to be used by the action. - The that that the new task will observe.. - The used to customize the task's behavior. - The that created cancellationToken has already been disposed. - The action argument is null. - The creationOptions argument specifies an invalid value for . - - - Gets the state object supplied when the was created, or null if none was supplied. - An that represents the state data that was passed in to the task when it was created. - - - Gets a task that has already completed successfully. - The successfully completed task. - - - Configures an awaiter used to await this . - true to attempt to marshal the continuation back to the original context captured; otherwise, false. - An object used to await this task. - - - Creates a continuation that receives caller-supplied state information and a cancellation token and that executes when the target completes. The continuation executes based on a set of specified conditions and uses a specified scheduler. - An action to run when the completes. When run, the delegate will be passed the completed task and the caller-supplied state object as arguments. - An object representing data to be used by the continuation action. - The that will be assigned to the new continuation task. - Options for when the continuation is scheduled and how it behaves. This includes criteria, such as , as well as execution options, such as . - The to associate with the continuation task and to use for its execution. - A new continuation . - The scheduler argument is null. - The continuationOptions argument specifies an invalid value for . - The provided has already been disposed. - - - Creates a continuation that executes when the target task competes according to the specified . The continuation receives a cancellation token and uses a specified scheduler. - An action to run according to the specified continuationOptions. When run, the delegate will be passed the completed task as an argument. - The that will be assigned to the new continuation task. - Options for when the continuation is scheduled and how it behaves. This includes criteria, such as , as well as execution options, such as . - The to associate with the continuation task and to use for its execution. - A new continuation . - The that created the token has already been disposed. - The continuationAction argument is null. -or- The scheduler argument is null. - The continuationOptions argument specifies an invalid value for . - - - Creates a continuation that receives caller-supplied state information and executes asynchronously when the target completes. The continuation uses a specified scheduler. - An action to run when the completes. When run, the delegate will be passed the completed task and the caller-supplied state object as arguments. - An object representing data to be used by the continuation action. - The to associate with the continuation task and to use for its execution. - A new continuation . - The scheduler argument is null. - - - Creates a continuation that receives caller-supplied state information and executes when the target completes. The continuation executes based on a set of specified conditions. - An action to run when the completes. When run, the delegate will be passed the completed task and the caller-supplied state object as arguments. - An object representing data to be used by the continuation action. - Options for when the continuation is scheduled and how it behaves. This includes criteria, such as , as well as execution options, such as . - A new continuation . - The continuationAction argument is null. - The continuationOptions argument specifies an invalid value for . - - - Creates a continuation that receives caller-supplied state information and a cancellation token and that executes asynchronously when the target completes. - An action to run when the completes. When run, the delegate will be passed the completed task and the caller-supplied state object as arguments. - An object representing data to be used by the continuation action. - The that will be assigned to the new continuation task. - A new continuation . - The continuationAction argument is null. - The provided has already been disposed. - - - Creates a continuation that receives caller-supplied state information and executes when the target completes. - An action to run when the task completes. When run, the delegate is passed the completed task and a caller-supplied state object as arguments. - An object representing data to be used by the continuation action. - A new continuation task. - The continuationAction argument is null. - - - Creates a continuation that executes when the target task completes according to the specified . - An action to run according to the specified continuationOptions. When run, the delegate will be passed the completed task as an argument. - Options for when the continuation is scheduled and how it behaves. This includes criteria, such as , as well as execution options, such as . - A new continuation . - The continuationAction argument is null. - The continuationOptions argument specifies an invalid value for . - - - Creates a continuation that receives a cancellation token and executes asynchronously when the target completes. - An action to run when the completes. When run, the delegate will be passed the completed task as an argument. - The that will be assigned to the new continuation task. - A new continuation . - The that created the token has already been disposed. - The continuationAction argument is null. - - - Creates a continuation that executes asynchronously when the target completes. - An action to run when the completes. When run, the delegate will be passed the completed task as an argument. - A new continuation . - The continuationAction argument is null. - - - Creates a continuation that executes asynchronously when the target completes. The continuation uses a specified scheduler. - An action to run when the completes. When run, the delegate will be passed the completed task as an argument. - The to associate with the continuation task and to use for its execution. - A new continuation . - The has been disposed. - The continuationAction argument is null. -or- The scheduler argument is null. - - - Creates a continuation that executes based on the specified task continuation options when the target completes. The continuation receives caller-supplied state information. - A function to run when the completes. When run, the delegate will be passed the completed task and the caller-supplied state object as arguments. - An object representing data to be used by the continuation function. - Options for when the continuation is scheduled and how it behaves. This includes criteria, such as , as well as execution options, such as . - The type of the result produced by the continuation. - A new continuation . - The continuationFunction argument is null. - The continuationOptions argument specifies an invalid value for . - - - Creates a continuation that executes based on the specified task continuation options when the target completes and returns a value. The continuation receives caller-supplied state information and a cancellation token and uses the specified scheduler. - A function to run when the completes. When run, the delegate will be passed the completed task and the caller-supplied state object as arguments. - An object representing data to be used by the continuation function. - The that will be assigned to the new continuation task. - Options for when the continuation is scheduled and how it behaves. This includes criteria, such as , as well as execution options, such as . - The to associate with the continuation task and to use for its execution. - The type of the result produced by the continuation. - A new continuation . - The scheduler argument is null. - The continuationOptions argument specifies an invalid value for . - The provided has already been disposed. - - - Creates a continuation that executes according to the specified continuation options and returns a value. The continuation is passed a cancellation token and uses a specified scheduler. - A function to run according to the specified continuationOptions. When run, the delegate will be passed the completed task as an argument. - The that will be assigned to the new continuation task. - Options for when the continuation is scheduled and how it behaves. This includes criteria, such as , as well as execution options, such as . - The to associate with the continuation task and to use for its execution. - The type of the result produced by the continuation. - A new continuation . - The has been disposed. -or- The that created the token has already been disposed. - The continuationFunction argument is null. -or- The scheduler argument is null. - The continuationOptions argument specifies an invalid value for . - - - Creates a continuation that executes asynchronously when the target completes. The continuation receives caller-supplied state information and uses a specified scheduler. - A function to run when the completes. When run, the delegate will be passed the completed task and the caller-supplied state object as arguments. - An object representing data to be used by the continuation function. - The to associate with the continuation task and to use for its execution. - The type of the result produced by the continuation. - A new continuation . - The scheduler argument is null. - - - Creates a continuation that executes asynchronously when the target completes and returns a value. The continuation receives caller-supplied state information and a cancellation token. - A function to run when the completes. When run, the delegate will be passed the completed task and the caller-supplied state object as arguments. - An object representing data to be used by the continuation function. - The that will be assigned to the new continuation task. - The type of the result produced by the continuation. - A new continuation . - The continuationFunction argument is null. - The provided has already been disposed. - - - Creates a continuation that receives caller-supplied state information and executes asynchronously when the target completes and returns a value. - A function to run when the completes. When run, the delegate will be passed the completed task and the caller-supplied state object as arguments. - An object representing data to be used by the continuation function. - The type of the result produced by the continuation. - A new continuation . - The continuationFunction argument is null. - - - Creates a continuation that executes according to the specified continuation options and returns a value. - A function to run according to the condition specified in continuationOptions. When run, the delegate will be passed the completed task as an argument. - Options for when the continuation is scheduled and how it behaves. This includes criteria, such as , as well as execution options, such as . - The type of the result produced by the continuation. - A new continuation . - The has been disposed. - The continuationFunction argument is null. - The continuationOptions argument specifies an invalid value for . - - - Creates a continuation that executes asynchronously when the target completes and returns a value. The continuation receives a cancellation token. - A function to run when the completes. When run, the delegate will be passed the completed task as an argument. - The that will be assigned to the new continuation task. - The type of the result produced by the continuation. - A new continuation . - The has been disposed. -or- The that created the token has already been disposed. - The continuationFunction argument is null. - - - Creates a continuation that executes asynchronously when the target completes and returns a value. - A function to run when the completes. When run, the delegate will be passed the completed task as an argument. - The type of the result produced by the continuation. - A new continuation task. - The has been disposed. - The continuationFunction argument is null. - - - Creates a continuation that executes asynchronously when the target completes and returns a value. The continuation uses a specified scheduler. - A function to run when the completes. When run, the delegate will be passed the completed task as an argument. - The to associate with the continuation task and to use for its execution. - The type of the result produced by the continuation. - A new continuation . - The has been disposed. - The continuationFunction argument is null. -or- The scheduler argument is null. - - - Gets the used to create this task. - The used to create this task. - - - Returns the ID of the currently executing . - An integer that was assigned by the system to the currently-executing task. - - - Creates a cancellable task that completes after a specified time interval. - The time span to wait before completing the returned task, or TimeSpan.FromMilliseconds(-1) to wait indefinitely. - The cancellation token that will be checked prior to completing the returned task. - A task that represents the time delay. - delay represents a negative time interval other than TimeSpan.FromMillseconds(-1). -or- The delay argument's property is greater than . - The task has been canceled. - The provided cancellationToken has already been disposed. - - - Creates a cancellable task that completes after a time delay. - The number of milliseconds to wait before completing the returned task, or -1 to wait indefinitely. - The cancellation token that will be checked prior to completing the returned task. - A task that represents the time delay. - The millisecondsDelay argument is less than -1. - The task has been canceled. - The provided cancellationToken has already been disposed. - - - Creates a task that completes after a time delay. - The number of milliseconds to wait before completing the returned task, or -1 to wait indefinitely. - A task that represents the time delay. - The millisecondsDelay argument is less than -1. - - - Creates a task that completes after a specified time interval. - The time span to wait before completing the returned task, or TimeSpan.FromMilliseconds(-1) to wait indefinitely. - A task that represents the time delay. - delay represents a negative time interval other than TimeSpan.FromMillseconds(-1). -or- The delay argument's property is greater than . - - - Releases all resources used by the current instance of the class. - The task is not in one of the final states: , , or . - - - Disposes the , releasing all of its unmanaged resources. - A Boolean value that indicates whether this method is being called due to a call to . - The task is not in one of the final states: , , or . - - - Gets the that caused the to end prematurely. If the completed successfully or has not yet thrown any exceptions, this will return null. - The that caused the to end prematurely. - - - Provides access to factory methods for creating and configuring and instances. - A factory object that can create a variety of and objects. - - - Creates a that's completed due to cancellation with a specified cancellation token. - The cancellation token with which to complete the task. - The canceled task. - Cancellation has not been requested for cancellationToken; its property is false. - - - Creates a that's completed due to cancellation with a specified cancellation token. - The cancellation token with which to complete the task. - The type of the result returned by the task. - The canceled task. - Cancellation has not been requested for cancellationToken; its property is false. - - - Creates a that has completed with a specified exception. - The exception with which to complete the task. - The faulted task. - - - Creates a that's completed with a specified exception. - The exception with which to complete the task. - The type of the result returned by the task. - The faulted task. - - - Creates a that's completed successfully with the specified result. - The result to store into the completed task. - The type of the result returned by the task. - The successfully completed task. - - - Gets an awaiter used to await this . - An awaiter instance. - - - Gets an ID for this instance. - The identifier that is assigned by the system to this instance. - - - Gets whether this instance has completed execution due to being canceled. - true if the task has completed due to being canceled; otherwise false. - - - Gets whether this has completed. - true if the task has completed; otherwise false. - - - Gets whether the completed due to an unhandled exception. - true if the task has thrown an unhandled exception; otherwise false. - - - Queues the specified work to run on the thread pool and returns a object that represents that work. - The work to execute asynchronously - A task that represents the work queued to execute in the ThreadPool. - The action parameter was null. - - - Queues the specified work to run on the thread pool and returns a proxy for the task returned by function. - The work to execute asynchronously - A task that represents a proxy for the task returned by function. - The function parameter was null. - - - Queues the specified work to run on the thread pool and returns a object that represents that work. A cancellation token allows the work to be cancelled. - The work to execute asynchronously - A cancellation token that can be used to cancel the work - A task that represents the work queued to execute in the thread pool. - The action parameter was null. - The task has been canceled. - The associated with cancellationToken was disposed. - - - Queues the specified work to run on the thread pool and returns a proxy for the task returned by function. - The work to execute asynchronously. - A cancellation token that should be used to cancel the work. - A task that represents a proxy for the task returned by function. - The function parameter was null. - The task has been canceled. - The associated with cancellationToken was disposed. - - - Queues the specified work to run on the thread pool and returns a Task(TResult) object that represents that work. A cancellation token allows the work to be cancelled. - The work to execute asynchronously - A cancellation token that should be used to cancel the work - The result type of the task. - A Task(TResult) that represents the work queued to execute in the thread pool. - The function parameter is null. - The task has been canceled. - The associated with cancellationToken was disposed. - - - Queues the specified work to run on the thread pool and returns a proxy for the Task(TResult) returned by function. - The work to execute asynchronously - A cancellation token that should be used to cancel the work - The type of the result returned by the proxy task. - A Task(TResult) that represents a proxy for the Task(TResult) returned by function. - The function parameter was null. - The task has been canceled. - The associated with cancellationToken was disposed. - - - Queues the specified work to run on the thread pool and returns a proxy for the Task(TResult) returned by function. - The work to execute asynchronously - The type of the result returned by the proxy task. - A Task(TResult) that represents a proxy for the Task(TResult) returned by function. - The function parameter was null. - - - Queues the specified work to run on the thread pool and returns a object that represents that work. - The work to execute asynchronously. - The return type of the task. - A task object that represents the work queued to execute in the thread pool. - The function parameter is null. - - - Runs the synchronously on the current . - The instance has been disposed. - The is not in a valid state to be started. It may have already been started, executed, or canceled, or it may have been created in a manner that doesn't support direct scheduling. - - - Runs the synchronously on the provided. - The scheduler on which to attempt to run this task inline. - The instance has been disposed. - The scheduler argument is null. - The is not in a valid state to be started. It may have already been started, executed, or canceled, or it may have been created in a manner that doesn't support direct scheduling. - - - Starts the , scheduling it for execution to the current . - The instance has been disposed. - The is not in a valid state to be started. It may have already been started, executed, or canceled, or it may have been created in a manner that doesn't support direct scheduling. - - - Starts the , scheduling it for execution to the specified . - The with which to associate and execute this task. - The scheduler argument is null. - The is not in a valid state to be started. It may have already been started, executed, or canceled, or it may have been created in a manner that doesn't support direct scheduling. - The instance has been disposed. - The scheduler was unable to queue this task. - - - Gets the of this task. - The current of this task instance. - - - Waits for the to complete execution within a specified time interval. - A that represents the number of milliseconds to wait, or a that represents -1 milliseconds to wait indefinitely. - true if the completed execution within the allotted time; otherwise, false. - The has been disposed. - timeout is a negative number other than -1 milliseconds, which represents an infinite time-out. -or- timeout is greater than . - The task was canceled. The collection contains a object. -or- An exception was thrown during the execution of the task. The collection contains information about the exception or exceptions. - - - Waits for the to complete execution. The wait terminates if a timeout interval elapses or a cancellation token is canceled before the task completes. - The number of milliseconds to wait, or (-1) to wait indefinitely. - A cancellation token to observe while waiting for the task to complete. - true if the completed execution within the allotted time; otherwise, false. - The cancellationToken was canceled. - The has been disposed. - millisecondsTimeout is a negative number other than -1, which represents an infinite time-out. - The task was canceled. The collection contains a object. -or- An exception was thrown during the execution of the task. The collection contains information about the exception or exceptions. - - - Waits for the to complete execution. The wait terminates if a cancellation token is canceled before the task completes. - A cancellation token to observe while waiting for the task to complete. - The cancellationToken was canceled. - The task has been disposed. - The task was canceled. The collection contains a object. -or- An exception was thrown during the execution of the task. The collection contains information about the exception or exceptions. - - - Waits for the to complete execution within a specified number of milliseconds. - The number of milliseconds to wait, or (-1) to wait indefinitely. - true if the completed execution within the allotted time; otherwise, false. - The has been disposed. - millisecondsTimeout is a negative number other than -1, which represents an infinite time-out. - The task was canceled. The collection contains a object. -or- An exception was thrown during the execution of the task. The collection contains information about the exception or exceptions. - - - Waits for the to complete execution. - The has been disposed. - The task was canceled. The collection contains a object. -or- An exception was thrown during the execution of the task. The collection contains information about the exception or exceptions. - - - Waits for all of the provided objects to complete execution. - An array of instances on which to wait. - One or more of the objects in tasks has been disposed. - The tasks argument is null. - The tasks argument contains a null element. -or- The tasks argument is an empty array. - At least one of the instances was canceled. If a task was canceled, the exception contains an exception in its collection. -or- An exception was thrown during the execution of at least one of the instances. - - - Waits for all of the provided objects to complete execution within a specified number of milliseconds. - An array of instances on which to wait. - The number of milliseconds to wait, or (-1) to wait indefinitely. - true if all of the instances completed execution within the allotted time; otherwise, false. - One or more of the objects in tasks has been disposed. - The tasks argument is null. - At least one of the instances was canceled. If a task was canceled, the contains an in its collection. -or- An exception was thrown during the execution of at least one of the instances. - millisecondsTimeout is a negative number other than -1, which represents an infinite time-out. - The tasks argument contains a null element. -or- The tasks argument is an empty array. - - - Waits for all of the provided objects to complete execution unless the wait is cancelled. - An array of instances on which to wait. - A to observe while waiting for the tasks to complete. - The cancellationToken was canceled. - The tasks argument is null. - At least one of the instances was canceled. If a task was canceled, the contains an in its collection. -or- An exception was thrown during the execution of at least one of the instances. - The tasks argument contains a null element. -or- The tasks argument is an empty array. - One or more of the objects in tasks has been disposed. - - - Waits for all of the provided cancellable objects to complete execution within a specified time interval. - An array of instances on which to wait. - A that represents the number of milliseconds to wait, or a that represents -1 milliseconds to wait indefinitely. - true if all of the instances completed execution within the allotted time; otherwise, false. - One or more of the objects in tasks has been disposed. - The tasks argument is null. - At least one of the instances was canceled. If a task was canceled, the contains an in its collection. -or- An exception was thrown during the execution of at least one of the instances. - timeout is a negative number other than -1 milliseconds, which represents an infinite time-out. -or- timeout is greater than . - The tasks argument contains a null element. -or- The tasks argument is an empty array. - - - Waits for all of the provided objects to complete execution within a specified number of milliseconds or until the wait is cancelled. - An array of instances on which to wait. - The number of milliseconds to wait, or (-1) to wait indefinitely. - A to observe while waiting for the tasks to complete. - true if all of the instances completed execution within the allotted time; otherwise, false. - One or more of the objects in tasks has been disposed. - The tasks argument is null. - At least one of the instances was canceled. If a task was canceled, the contains an in its collection. -or- An exception was thrown during the execution of at least one of the instances. - millisecondsTimeout is a negative number other than -1, which represents an infinite time-out. - The tasks argument contains a null element. -or- The tasks argument is an empty array. - The cancellationToken was canceled. - - - Waits for any of the provided objects to complete execution within a specified number of milliseconds or until a cancellation token is cancelled. - An array of instances on which to wait. - The number of milliseconds to wait, or (-1) to wait indefinitely. - A to observe while waiting for a task to complete. - The index of the completed task in the tasks array argument, or -1 if the timeout occurred. - The has been disposed. - The tasks argument is null. - millisecondsTimeout is a negative number other than -1, which represents an infinite time-out. - The tasks argument contains a null element. - The cancellationToken was canceled. - - - Waits for any of the provided objects to complete execution within a specified time interval. - An array of instances on which to wait. - A that represents the number of milliseconds to wait, or a that represents -1 milliseconds to wait indefinitely. - The index of the completed task in the tasks array argument, or -1 if the timeout occurred. - The has been disposed. - The tasks argument is null. - timeout is a negative number other than -1 milliseconds, which represents an infinite time-out. -or- timeout is greater than . - The tasks argument contains a null element. - - - Waits for any of the provided objects to complete execution within a specified number of milliseconds. - An array of instances on which to wait. - The number of milliseconds to wait, or (-1) to wait indefinitely. - The index of the completed task in the tasks array argument, or -1 if the timeout occurred. - The has been disposed. - The tasks argument is null. - millisecondsTimeout is a negative number other than -1, which represents an infinite time-out. - The tasks argument contains a null element. - - - Waits for any of the provided objects to complete execution unless the wait is cancelled. - An array of instances on which to wait. - A to observe while waiting for a task to complete. - The index of the completed task in the tasks array argument. - The has been disposed. - The tasks argument is null. - The tasks argument contains a null element. - The cancellationToken was canceled. - - - Waits for any of the provided objects to complete execution. - An array of instances on which to wait. - The index of the completed object in the tasks array. - The has been disposed. - The tasks argument is null. - The tasks argument contains a null element. - - - Creates a task that will complete when all of the objects in an enumerable collection have completed. - The tasks to wait on for completion. - A task that represents the completion of all of the supplied tasks. - The tasks argument was null. - The tasks collection contained a null task. - - - Creates a task that will complete when all of the objects in an array have completed. - The tasks to wait on for completion. - A task that represents the completion of all of the supplied tasks. - The tasks argument was null. - The tasks array contained a null task. - - - Creates a task that will complete when all of the objects in an enumerable collection have completed. - The tasks to wait on for completion. - The type of the completed task. - A task that represents the completion of all of the supplied tasks. - The tasks argument was null. - The tasks collection contained a null task. - - - Creates a task that will complete when all of the objects in an array have completed. - The tasks to wait on for completion. - The type of the completed task. - A task that represents the completion of all of the supplied tasks. - The tasks argument was null. - The tasks array contained a null task. - - - Creates a task that will complete when any of the supplied tasks have completed. - The tasks to wait on for completion. - A task that represents the completion of one of the supplied tasks. The return task's Result is the task that completed. - The tasks argument was null. - The tasks array contained a null task, or was empty. - - - Creates a task that will complete when any of the supplied tasks have completed. - The tasks to wait on for completion. - A task that represents the completion of one of the supplied tasks. The return task's Result is the task that completed. - The tasks argument was null. - The tasks array contained a null task, or was empty. - - - Creates a task that will complete when any of the supplied tasks have completed. - The tasks to wait on for completion. - The type of the completed task. - A task that represents the completion of one of the supplied tasks. The return task's Result is the task that completed. - The tasks argument was null. - The tasks array contained a null task, or was empty. - - - Creates a task that will complete when any of the supplied tasks have completed. - The tasks to wait on for completion. - The type of the completed task. - A task that represents the completion of one of the supplied tasks. The return task's Result is the task that completed. - The tasks argument was null. - The tasks array contained a null task, or was empty. - - - Creates an awaitable task that asynchronously yields back to the current context when awaited. - A context that, when awaited, will asynchronously transition back into the current context at the time of the await. If the current is non-null, it is treated as the current context. Otherwise, the task scheduler that is associated with the currently executing task is treated as the current context. - - - Gets a that can be used to wait for the task to complete. - A that can be used to wait for the task to complete. - The has been disposed. - - - Gets an indication of whether the operation completed synchronously. - true if the operation completed synchronously; otherwise, false. - - - Represents an exception used to communicate task cancellation. - - - Initializes a new instance of the class with a system-supplied message that describes the error. - - - Initializes a new instance of the class with a specified message that describes the error. - The message that describes the exception. The caller of this constructor is required to ensure that this string has been localized for the current system culture. - - - Initializes a new instance of the class with a reference to the that has been canceled. - A task that has been canceled. - - - Initializes a new instance of the class with serialized data. - The object that holds the serialized object data. - The contextual information about the source or destination. - - - Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. - The message that describes the exception. The caller of this constructor is required to ensure that this string has been localized for the current system culture. - The exception that is the cause of the current exception. If the innerException parameter is not null, the current exception is raised in a catch block that handles the inner exception. - - - Gets the task associated with this exception. - A reference to the that is associated with this exception. - - - Represents the producer side of a unbound to a delegate, providing access to the consumer side through the property. - The type of the result value assocatied with this . - - - Creates a . - - - Creates a with the specified state. - The state to use as the underlying 's AsyncState. - - - Creates a with the specified options. - The options to use when creating the underlying . - The creationOptions represent options invalid for use with a . - - - Creates a with the specified state and options. - The state to use as the underlying 's AsyncState. - The options to use when creating the underlying . - The creationOptions represent options invalid for use with a . - - - Transitions the underlying into the state. - The underlying is already in one of the three final states: , , or , or if the underlying has already been disposed. - - - Transitions the underlying into the state and binds a collection of exception objects to it. - The collection of exceptions to bind to this . - The was disposed. - The exceptions argument is null. - There are one or more null elements in exceptions. - The underlying is already in one of the three final states: , , or . - - - Transitions the underlying into the state and binds it to a specified exception. - The exception to bind to this . - The was disposed. - The exception argument is null. - The underlying is already in one of the three final states: , , or . - - - Transitions the underlying into the state. - The result value to bind to this . - The was disposed. - The underlying is already in one of the three final states: , , or . - - - Gets the created by this . - Returns the created by this . - - - Attempts to transition the underlying into the state. - True if the operation was successful; false if the operation was unsuccessful or the object has already been disposed. - - - Attempts to transition the underlying into the state and enables a cancellation token to be stored in the canceled task. - A cancellation token. - true if the operation is successful; otherwise, false. - - - Attempts to transition the underlying into the state and binds a collection of exception objects to it. - The collection of exceptions to bind to this . - True if the operation was successful; otherwise, false. - The was disposed. - The exceptions argument is null. - There are one or more null elements in exceptions. -or- The exceptions collection is empty. - - - Attempts to transition the underlying into the state and binds it to a specified exception. - The exception to bind to this . - True if the operation was successful; otherwise, false. - The was disposed. - The exception argument is null. - - - Attempts to transition the underlying into the state. - The result value to bind to this . - True if the operation was successful; otherwise, false. - - - Specifies the behavior for a task that is created by using the or method. - - - Specifies that the continuation, if it is a child task, is attached to a parent in the task hierarchy. The continuation can be a child task only if its antecedent is also a child task. By default, a child task (that is, an inner task created by an outer task) executes independently of its parent. You can use the option so that the parent and child tasks are synchronized. Note that if a parent task is configured with the option, the option in the child task has no effect, and the child task will execute as a detached child task. For more information, see Attached and Detached Child Tasks. - - - - Specifies that any child task (that is, any nested inner task created by this continuation) that is created with the option and attempts to execute as an attached child task will not be able to attach to the parent task and will execute instead as a detached child task. For more information, see Attached and Detached Child Tasks. - - - - Specifies that the continuation task should be executed synchronously. With this option specified, the continuation runs on the same thread that causes the antecedent task to transition into its final state. If the antecedent is already complete when the continuation is created, the continuation will run on the thread that creates the continuation. If the antecedent's is disposed in a finally block (Finally in Visual Basic), a continuation with this option will run in that finally block. Only very short-running continuations should be executed synchronously. Because the task executes synchronously, there is no need to call a method such as to ensure that the calling thread waits for the task to complete. - - - - Specifies that tasks created by the continuation by calling methods such as or see the default scheduler () rather than the scheduler on which this continuation is running as the current scheduler. - - - - In the case of continuation cancellation, prevents completion of the continuation until the antecedent has completed. - - - - Specifies that a continuation will be a long-running, course-grained operation. It provides a hint to the that oversubscription may be warranted. - - - - When no continuation options are specified, specifies that default behavior should be used when executing a continuation. The continuation runs asynchronously when the antecedent task completes, regardless of the antecedent's final property value. It the continuation is a child task, it is created as a detached nested task. - - - - Specifies that the continuation task should not be scheduled if its antecedent was canceled. An antecedent is canceled if its property upon completion is . This option is not valid for multi-task continuations. - - - - Specifies that the continuation task should not be scheduled if its antecedent threw an unhandled exception. An antecedent throws an unhandled exception if its property upon completion is . This option is not valid for multi-task continuations. - - - - Specifies that the continuation task should not be scheduled if its antecedent ran to completion. An antecedent runs to completion if its property upon completion is . This option is not valid for multi-task continuations. - - - - Specifies that the continuation should be scheduled only if its antecedent was canceled. An antecedent is canceled if its property upon completion is . This option is not valid for multi-task continuations. - - - - Specifies that the continuation task should be scheduled only if its antecedent threw an unhandled exception. An antecedent throws an unhandled exception if its property upon completion is . The option guarantees that the property in the antecedent is not null. You can use that property to catch the exception and see which exception caused the task to fault. If you do not access the property, the exception is unhandled. Also, if you attempt to access the property of a task that has been canceled or has faulted, a new exception is thrown. This option is not valid for multi-task continuations. - - - - Specifies that the continuation should be scheduled only if its antecedent ran to completion. An antecedent runs to completion if its property upon completion is . This option is not valid for multi-task continuations. - - - - A hint to a to schedule task in the order in which they were scheduled, so that tasks scheduled sooner are more likely to run sooner, and tasks scheduled later are more likely to run later. - - - - Specifies that the continuation task should be run asynchronously. This option has precedence over . - - - - Specifies flags that control optional behavior for the creation and execution of tasks. - - - Specifies that a task is attached to a parent in the task hierarchy. By default, a child task (that is, an inner task created by an outer task) executes independently of its parent. You can use the option so that the parent and child tasks are synchronized. Note that if a parent task is configured with the option, the option in the child task has no effect, and the child task will execute as a detached child task. For more information, see Attached and Detached Child Tasks. - - - - Specifies that any child task that attempts to execute as an attached child task (that is, it is created with the option) will not be able to attach to the parent task and will execute instead as a detached child task. For more information, see Attached and Detached Child Tasks. - - - - Prevents the ambient scheduler from being seen as the current scheduler in the created task. This means that operations like StartNew or ContinueWith that are performed in the created task will see as the current scheduler. - - - - Specifies that a task will be a long-running, coarse-grained operation involving fewer, larger components than fine-grained systems. It provides a hint to the that oversubscription may be warranted. Oversubscription lets you create more threads than the available number of hardware threads. It also provides a hint to the task scheduler that an additional thread might be required for the task so that it does not block the forward progress of other threads or work items on the local thread-pool queue. - - - - Specifies that the default behavior should be used. - - - - A hint to a to schedule a task in as fair a manner as possible, meaning that tasks scheduled sooner will be more likely to be run sooner, and tasks scheduled later will be more likely to be run later. - - - - Forces continuations added to the current task to be executed asynchronously. Note that the member is available in the enumeration starting with the .NET Framework 4.6. - - - - Provides a set of static (Shared in Visual Basic) methods for working with specific kinds of instances. - - - Creates a proxy that represents the asynchronous operation of a . - The Task<Task> (C#) or Task (Of Task) (Visual Basic) to unwrap. - A Task that represents the asynchronous operation of the provided System.Threading.Tasks.Task(Of Task). - The exception that is thrown if the task argument is null. - - - Creates a proxy that represents the asynchronous operation of a Task<Task<T>> (C#) or Task (Of Task(Of T)) (Visual Basic). - The Task<Task<T>> (C#) or Task (Of Task(Of T)) (Visual Basic) to unwrap. - The type of the task's result. - A that represents the asynchronous operation of the provided Task<Task<T>> (C#) or Task (Of Task(Of T)) (Visual Basic). - The exception that is thrown if the task argument is null. - - - Provides support for creating and scheduling objects. - The return value of the objects that the methods of this class create. - - - Initializes a instance with the default configuration. - - - Initializes a instance with the default configuration. - The default cancellation token that will be assigned to tasks created by this unless another cancellation token is explicitly specified when calling the factory methods. - - - Initializes a instance with the specified configuration. - The scheduler to use to schedule any tasks created with this . A null value indicates that the current should be used. - - - Initializes a instance with the specified configuration. - The default options to use when creating tasks with this . - The default options to use when creating continuation tasks with this . - creationOptions or continuationOptions specifies an invalid value. - - - Initializes a instance with the specified configuration. - The default cancellation token that will be assigned to tasks created by this unless another cancellation token is explicitly specified when calling the factory methods. - The default options to use when creating tasks with this . - The default options to use when creating continuation tasks with this . - The default scheduler to use to schedule any tasks created with this . A null value indicates that should be used. - creationOptions or continuationOptions specifies an invalid value. - - - Gets the default cancellation token for this task factory. - The default cancellation token for this task factory. - - - Gets the enumeration value for this task factory. - One of the enumeration values that specifies the default continuation options for this task factory. - - - Creates a continuation task that will be started upon the completion of a set of provided Tasks. - The array of tasks from which to continue. - The function delegate to execute asynchronously when all tasks in the tasks array have completed. - The cancellation token that will be assigned to the new continuation task. - One of the enumeration values that controls the behavior of the created continuation task. The NotOn* or OnlyOn* values are not valid. - The scheduler that is used to schedule the created continuation task. - The new continuation task. - The tasks array is null. -or- The continuationFunction argument is null. -or- The scheduler argument is null. - The tasks array contains a null value or is empty. - continuationOptions specifies an invalid value. - One of the elements in the tasks array has been disposed. -or- The that created cancellationToken has already been disposed. - - - Creates a continuation task that will be started upon the completion of a set of provided Tasks. - The array of tasks from which to continue. - The function delegate to execute asynchronously when all tasks in the tasks array have completed. - One of the enumeration values that controls the behavior of the created continuation task. The NotOn* or OnlyOn* values are not valid. - The new continuation task. - One of the elements in the tasks array has been disposed. - The tasks array is null. -or- The continuationFunction argument is null. - The continuationOptions argument specifies an invalid value. - The tasks array contains a null value or is empty. - - - Creates a continuation task that will be started upon the completion of a set of provided tasks. - The array of tasks from which to continue. - The function delegate to execute asynchronously when all tasks in the tasks array have completed. - The new continuation task. - One of the elements in the tasks array has been disposed. - tasks array is null. -or- The continuationFunction is null. - The tasks array contains a null value or is empty. - - - Creates a continuation task that will be started upon the completion of a set of provided tasks. - The array of tasks from which to continue. - The function delegate to execute asynchronously when all tasks in the tasks array have completed. - The cancellation token that will be assigned to the new continuation task. - The new continuation task. - One of the elements in the tasks array has been disposed. -or- The that created cancellationToken has already been disposed. - The tasks array is null. -or- continuationFunction is null. - The tasks array contains a null value or is empty. - - - Creates a continuation task that will be started upon the completion of a set of provided tasks. - The array of tasks from which to continue. - The function delegate to execute asynchronously when all tasks in the tasks array have completed. - The type of the result of the antecedent tasks. - The new continuation task. - One of the elements in the tasks array has been disposed. - The tasks array is null. -or- The continuationFunction argument is null. - The tasks array contains a null value or is empty. - - - Creates a continuation task that will be started upon the completion of a set of provided tasks. - The array of tasks from which to continue. - The function delegate to execute asynchronously when all tasks in the tasks array have completed. - The cancellation token that will be assigned to the new continuation task. - The type of the result of the antecedent tasks. - The new continuation task. - One of the elements in the tasks array has been disposed. -or- The that created cancellationToken has already been disposed. - The tasks array is null. -or- The continuationFunction argument is null. - The tasks array contains a null value or is empty. - - - Creates a continuation task that will be started upon the completion of a set of provided tasks. - The array of tasks from which to continue. - The function delegate to execute asynchronously when all tasks in the tasks array have completed. - One of the enumeration values that controls the behavior of the created continuation task. The NotOn* or OnlyOn* values are not valid. - The type of the result of the antecedent tasks. - The new continuation task. - One of the elements in the tasks array has been disposed. - The tasks array is null. -or- The continuationFunction argument is null. - The continuationOptions argument specifies an invalid value. - The tasks array contains a null value or is empty. - - - Creates a continuation task that will be started upon the completion of a set of provided tasks. - The array of tasks from which to continue. - The function delegate to execute asynchronously when all tasks in the tasks array have completed. - The cancellation token that will be assigned to the new continuation task. - One of the enumeration values that controls the behavior of the created continuation task. The NotOn* or OnlyOn* values are not valid. - The scheduler that is used to schedule the created continuation task. - The type of the result of the antecedent tasks. - The new continuation task. - The tasks array is null. -or- The continuationFunction argument is null. -or- The scheduler argument is null. - The tasks array contains a null value or is empty. - The continuationOptions argument specifies an invalid value. - One of the elements in the tasks array has been disposed. -or- The that created cancellationToken has already been disposed. - - - Creates a continuation task that will be started upon the completion of any task in the provided set. - The array of tasks from which to continue when one task completes. - The function delegate to execute asynchronously when one task in the tasks array completes. - The cancellation token that will be assigned to the new continuation task. - One of the enumeration values that controls the behavior of the created continuation task. The NotOn* or OnlyOn* values are not valid. - The task scheduler that is used to schedule the created continuation task. - The new continuation task. - The tasks array is null. -or- The continuationFunction argument is null. -or- The scheduler argument is null. - The tasks array contains a null value. -or- The tasks array is empty. - The continuationOptions argument specifies an invalid value. - One of the elements in the tasks array has been disposed. -or- The that created cancellationToken has already been disposed. - - - Creates a continuation task that will be started upon the completion of any task in the provided set. - The array of tasks from which to continue when one task completes. - The function delegate to execute asynchronously when one task in the tasks array completes. - The new continuation task. - One of the elements in the tasks array has been disposed. - The tasks array is null. -or- The continuationFunction argument is null. - The tasks array contains a null value or is empty. - - - Creates a continuation task that will be started upon the completion of any task in the provided set. - The array of tasks from which to continue when one task completes. - The function delegate to execute asynchronously when one task in the tasks array completes. - The cancellation token that will be assigned to the new continuation task. - The new continuation task. - One of the elements in the tasks array has been disposed. -or- The that created cancellationToken has already been disposed. - The tasks array is null. -or- The continuationFunction argument is null. - The tasks array contains a null value. -or- The tasks array is empty. - - - Creates a continuation task that will be started upon the completion of any task in the provided set. - The array of tasks from which to continue when one task completes. - The function delegate to execute asynchronously when one task in the tasks array completes. - One of the enumeration values that controls the behavior of the created continuation task. The NotOn* or OnlyOn* values are not valid. - The new continuation task. - One of the elements in the tasks array has been disposed. - The tasks array is null. -or- The continuationFunction argument is null. - The continuationOptions argument specifies an invalid enumeration value. - The tasks array contains a null value. -or- The tasks array is empty. - - - Creates a continuation task that will be started upon the completion of any task in the provided set. - The array of tasks from which to continue when one task completes. - The function delegate to execute asynchronously when one task in the tasks array completes. - The cancellation token that will be assigned to the new continuation task. - One of the enumeration values that controls the behavior of the created continuation task. The NotOn* or OnlyOn* values are not valid. - The that is used to schedule the created continuation . - The type of the result of the antecedent tasks. - The new continuation . - The tasks array is null. -or- The continuationFunction argument is null. -or- The scheduler argument is null. - The tasks array contains a null value. -or- The tasks array is empty. - The continuationOptions argument specifies an invalid TaskContinuationOptions value. - One of the elements in the tasks array has been disposed. -or- The that created cancellationToken has already been disposed. - - - Creates a continuation task that will be started upon the completion of any task in the provided set. - The array of tasks from which to continue when one task completes. - The function delegate to execute asynchronously when one task in the tasks array completes. - One of the enumeration values that controls the behavior of the created continuation task. The NotOn* or OnlyOn* values are not valid. - The type of the result of the antecedent tasks. - The new continuation . - One of the elements in the tasks array has been disposed. - The tasks array is null. -or- The continuationFunction argument is null. - The continuationOptions argument specifies an invalid enumeration value. - The tasks array contains a null value. -or- The tasks array is empty. - - - Creates a continuation task that will be started upon the completion of any task in the provided set. - The array of tasks from which to continue when one task completes. - The function delegate to execute asynchronously when one task in the tasks array completes. - The type of the result of the antecedent tasks. - The new continuation . - One of the elements in the tasks array has been disposed. - The tasks array is null. -or- The continuationFunction argument is null. - The tasks array contains a null value. -or- The tasks array is empty. - - - Creates a continuation task that will be started upon the completion of any task in the provided set. - The array of tasks from which to continue when one task completes. - The function delegate to execute asynchronously when one task in the tasks array completes. - The cancellation token that will be assigned to the new continuation task. - The type of the result of the antecedent tasks. - The new continuation task. - One of the elements in the tasks array has been disposed. -or- The that created cancellationToken has already been disposed. - The tasks array is null. -or- The continuationFunction argument is null. - The tasks array contains a null value. -or- The tasks array is empty. - - - Gets the enumeration value for this task factory. - One of the enumeration values that specifies the default creation options for this task factory. - - - Creates a task that executes an end method function when a specified completes. - The whose completion should trigger the processing of the endMethod. - The function delegate that processes the completed asyncResult. - A that represents the asynchronous operation. - The asyncResult argument is null. -or- The endMethod argument is null. - - - Creates a task that represents a pair of begin and end methods that conform to the Asynchronous Programming Model pattern. - The delegate that begins the asynchronous operation. - The delegate that ends the asynchronous operation. - An object containing data to be used by the beginMethod delegate. - The created task that represents the asynchronous operation. - The beginMethod argument is null. -or- The endMethod argument is null. - - - Creates a task that executes an end method function when a specified completes. - The whose completion should trigger the processing of the endMethod. - The function delegate that processes the completed asyncResult. - One of the enumeration values that controls the behavior of the created task. - A task that represents the asynchronous operation. - The asyncResult argument is null. -or- The endMethod argument is null. - The creationOptions argument specifies an invalid value. - - - Creates a task that represents a pair of begin and end methods that conform to the Asynchronous Programming Model pattern. - The delegate that begins the asynchronous operation. - The delegate that ends the asynchronous operation. - An object containing data to be used by the beginMethod delegate. - One of the enumeration values that controls the behavior of the created task. - The created that represents the asynchronous operation. - The beginMethod argument is null. -or- The endMethod argument is null. - The creationOptions argument specifies an invalid value. - - - Creates a task that executes an end method function when a specified completes. - The whose completion should trigger the processing of the endMethod. - The function delegate that processes the completed asyncResult. - One of the enumeration values that controls the behavior of the created task. - The task scheduler that is used to schedule the task that executes the end method. - The created task that represents the asynchronous operation. - The asyncResult argument is null. -or- The endMethod argument is null. -or- The scheduler argument is null. - The creationOptions parameter specifies an invalid value. - - - Creates a task that represents a pair of begin and end methods that conform to the Asynchronous Programming Model pattern. - The delegate that begins the asynchronous operation. - The delegate that ends the asynchronous operation. - The first argument passed to the beginMethod delegate. - The second argument passed to the beginMethod delegate. - The third argument passed to the beginMethod delegate. - An object containing data to be used by the beginMethod delegate. - An object that controls the behavior of the created task. - The type of the second argument passed to beginMethod delegate. - The type of the third argument passed to beginMethod delegate. - The type of the first argument passed to the beginMethod delegate. - The created task that represents the asynchronous operation. - The beginMethod argument is null. -or- The endMethod argument is null. - The creationOptions parameter specifies an invalid value. - - - Creates a task that represents a pair of begin and end methods that conform to the Asynchronous Programming Model pattern. - The delegate that begins the asynchronous operation. - The delegate that ends the asynchronous operation. - The first argument passed to the beginMethod delegate. - The second argument passed to the beginMethod delegate. - The third argument passed to the beginMethod delegate. - An object containing data to be used by the beginMethod delegate. - The type of the second argument passed to beginMethod delegate. - The type of the third argument passed to beginMethod delegate. - The type of the first argument passed to the beginMethod delegate. - The created task that represents the asynchronous operation. - The beginMethod argument is null. -or- The endMethod argument is null. - - - Creates a task that represents a pair of begin and end methods that conform to the Asynchronous Programming Model pattern. - The delegate that begins the asynchronous operation. - The delegate that ends the asynchronous operation. - The first argument passed to the beginMethod delegate. - The second argument passed to the beginMethod delegate. - An object containing data to be used by the beginMethod delegate. - An object that controls the behavior of the created . - The type of the second argument passed to beginMethod delegate. - The type of the first argument passed to the beginMethod delegate. - The created task that represents the asynchronous operation. - The beginMethod argument is null. -or- The endMethod argument is null. - The creationOptions parameter specifies an invalid value. - - - Creates a task that represents a pair of begin and end methods that conform to the Asynchronous Programming Model pattern. - The delegate that begins the asynchronous operation. - The delegate that ends the asynchronous operation. - The first argument passed to the beginMethod delegate. - The second argument passed to the beginMethod delegate. - An object containing data to be used by the beginMethod delegate. - The type of the second argument passed to beginMethod delegate. - The type of the first argument passed to the beginMethod delegate. - The created task that represents the asynchronous operation. - The beginMethod argument is null. -or- The endMethod argument is null. - - - Creates a task that represents a pair of begin and end methods that conform to the Asynchronous Programming Model pattern. - The delegate that begins the asynchronous operation. - The delegate that ends the asynchronous operation. - The first argument passed to the beginMethod delegate. - An object containing data to be used by the beginMethod delegate. - The type of the first argument passed to the beginMethod delegate. - The created task that represents the asynchronous operation. - The beginMethod argument is null. -or- The endMethod argument is null. - - - Creates a task that represents a pair of begin and end methods that conform to the Asynchronous Programming Model pattern. - The delegate that begins the asynchronous operation. - The delegate that ends the asynchronous operation. - The first argument passed to the beginMethod delegate. - An object containing data to be used by the beginMethod delegate. - One of the enumeration values that controls the behavior of the created task. - The type of the first argument passed to the beginMethod delegate. - The created task that represents the asynchronous operation. - The beginMethod argument is null. -or- The endMethod argument is null. - The creationOptions parameter specifies an invalid value. - - - Gets the task scheduler for this task factory. - The task scheduler for this task factory. - - - Creates and starts a task. - A function delegate that returns the future result to be available through the task. - An object that contains data to be used by the function delegate. - The cancellation token that will be assigned to the new task. - The started task. - The cancellation token source that created cancellationToken has already been disposed. - The function argument is null. - - - Creates and starts a task. - A function delegate that returns the future result to be available through the task. - An object that contains data to be used by the function delegate. - One of the enumeration values that controls the behavior of the created task. - The started task. - The function argument is null. - The creationOptions parameter specifies an invalid value. - - - Creates and starts a task. - A function delegate that returns the future result to be available through the task. - One of the enumeration values that controls the behavior of the created task. - The started . - The function argument is null. - The creationOptions parameter specifies an invalid value. - - - Creates and starts a task. - A function delegate that returns the future result to be available through the task. - The cancellation token that will be assigned to the new task. - One of the enumeration values that controls the behavior of the created task. - The task scheduler that is used to schedule the created task. - The started task. - The cancellation token source that created cancellationToken has already been disposed. - The function argument is null. -or- The scheduler argument is null. - The creationOptions parameter specifies an invalid value. - - - Creates and starts a task. - A function delegate that returns the future result to be available through the task. - An object that contains data to be used by the function delegate. - The started task. - The function argument is null. - - - Creates and starts a task. - A function delegate that returns the future result to be available through the task. - The started task. - The function argument is null. - - - Creates and starts a task. - A function delegate that returns the future result to be available through the task. - The cancellation token that will be assigned to the new task. - The started task. - The cancellation token source that created cancellationToken has already been disposed. - The function argument is null. - - - Creates and starts a task. - A function delegate that returns the future result to be available through the task. - An object that contains data to be used by the function delegate. - The cancellation token that will be assigned to the new task. - One of the enumeration values that controls the behavior of the created task. - The task scheduler that is used to schedule the created task. - The started task. - The cancellation token source that created cancellationToken has already been disposed. - The function argument is null. -or- The scheduler argument is null. - The creationOptions parameter specifies an invalid value. - - - Provides support for creating and scheduling objects. - - - Initializes a instance with the default configuration. - - - Initializes a instance with the specified configuration. - The that will be assigned to tasks created by this unless another CancellationToken is explicitly specified while calling the factory methods. - - - Initializes a instance with the specified configuration. - The to use to schedule any tasks created with this TaskFactory. A null value indicates that the current TaskScheduler should be used. - - - Initializes a instance with the specified configuration. - The default to use when creating tasks with this TaskFactory. - The default to use when creating continuation tasks with this TaskFactory. - The creationOptions argument specifies an invalid value. For more information, see the Remarks for . -or- The continuationOptions argument specifies an invalid value. - - - Initializes a instance with the specified configuration. - The default that will be assigned to tasks created by this unless another CancellationToken is explicitly specified while calling the factory methods. - The default to use when creating tasks with this TaskFactory. - The default to use when creating continuation tasks with this TaskFactory. - The default to use to schedule any Tasks created with this TaskFactory. A null value indicates that TaskScheduler.Current should be used. - The creationOptions argument specifies an invalid value. For more information, see the Remarks for . -or- The continuationOptions argument specifies an invalid value. - - - Gets the default cancellation token for this task factory. - The default task cancellation token for this task factory. - - - Gets the default task continuation options for this task factory. - The default task continuation options for this task factory. - - - Creates a continuation task that starts when a set of specified tasks has completed. - The array of tasks from which to continue. - The action delegate to execute when all tasks in the tasks array have completed. - The new continuation task. - An element in the tasks array has been disposed. - The tasks array is null. -or- The continuationAction argument is null. - The tasks array is empty or contains a null value. - - - Creates a continuation task that starts when a set of specified tasks has completed. - The array of tasks from which to continue. - The action delegate to execute when all tasks in the tasks array have completed. - The cancellation token to assign to the new continuation task. - The new continuation task. - An element in the tasks array has been disposed. -or- The that created cancellationToken has already been disposed. - The tasks array is null. -or- The continuationAction argument is null. - The tasks array is empty or contains a null value. - - - Creates a continuation task that starts when a set of specified tasks has completed. - The array of tasks from which to continue. - The action delegate to execute when all tasks in the tasks array have completed. - A bitwise combination of the enumeration values that control the behavior of the new continuation task. The NotOn* and OnlyOn* members are not supported. - The new continuation task. - An element in the tasks array has been disposed. - The tasks array is null. -or- The continuationAction argument is null. - The continuationOptions argument specifies an invalid value. - The tasks array is empty or contains a null value. - - - Creates a continuation task that starts when a set of specified tasks has completed. - The array of tasks from which to continue. - The action delegate to execute when all tasks in the tasks array have completed. - The cancellation token to assign to the new continuation task. - A bitwise combination of the enumeration values that control the behavior of the new continuation task. - The object that is used to schedule the new continuation task. - The new continuation task. - The tasks array is null. -or- The continuationAction argument is null. -or- The scheduler argument is null. - The tasks array is empty or contains a null value. - - - Creates a continuation task that starts when a set of specified tasks has completed. - The array of tasks from which to continue. - The function delegate to execute asynchronously when all tasks in the tasks array have completed. - The cancellation token to assign to the new continuation task. - A bitwise combination of the enumeration values that control the behavior of the new continuation task. The NotOn* and OnlyOn* members are not supported. - The object that is used to schedule the new continuation task. - The type of the result of the antecedent tasks. - The type of the result that is returned by the continuationFunction delegate and associated with the created task. - The new continuation task. - The tasks array is null. -or- The continuationFunction argument is null. -or- The scheduler argument is null. - The tasks array is empty or contains a null value. - The continuationOptions argument specifies an invalid value. - An element in the tasks array has been disposed. -or- The that created cancellationToken has already been disposed. - - - Creates a continuation task that starts when a set of specified tasks has completed. - The array of tasks from which to continue. - The function delegate to execute asynchronously when all tasks in the tasks array have completed. - A bitwise combination of the enumeration values that control the behavior of the new continuation task. The NotOn* and OnlyOn* members are not supported. - The type of the result of the antecedent tasks. - The type of the result that is returned by the continuationFunction delegate and associated with the created task. - The new continuation task. - An element in the tasks array has been disposed. - The tasks array is null. -or- The continuationFunction argument is null. - The continuationOptions argument specifies an invalid value. - The tasks array is empty or contains a null value. - - - Creates a continuation task that starts when a set of specified tasks has completed. - The array of tasks from which to continue. - The function delegate to execute asynchronously when all tasks in the tasks array have completed. - The cancellation token to assign to the new continuation task. - The type of the result of the antecedent tasks. - The type of the result that is returned by the continuationFunction delegate and associated with the created task. - The new continuation task. - An element in the tasks array has been disposed. -or- The that created cancellationToken has already been disposed. - The tasks array is null. -or- The continuationFunction argument is null. - The tasks array is empty or contains a null value. - - - Creates a continuation task that starts when a set of specified tasks has completed. - The array of tasks from which to continue. - The function delegate to execute asynchronously when all tasks in the tasks array have completed. - The type of the result of the antecedent tasks. - The type of the result that is returned by the continuationFunction delegate and associated with the created task. - The new continuation task. - An element in the tasks array has been disposed. - The tasks array is null. -or- The continuationFunction argument is null. - The tasks array is empty or contains a null value. - - - Creates a continuation task that starts when a set of specified tasks has completed. - The array of tasks from which to continue. - The action delegate to execute when all tasks in the tasks array have completed. - The cancellation token to assign to the new continuation task. - A bitwise combination of the enumeration values that control the behavior of the new continuation task. The NotOn* and OnlyOn* members are not supported. - The object that is used to schedule the new continuation task. - The type of the result of the antecedent tasks. - The new continuation task. - The tasks array is null. -or- The continuationAction argument is null. -or- The scheduler argument is null. - The tasks array is empty or contains a null value. - - - Creates a continuation task that starts when a set of specified tasks has completed. - The array of tasks from which to continue. - The action delegate to execute when all tasks in the tasks array have completed. - A bitwise combination of the enumeration values that control the behavior of the new continuation task. The NotOn* and OnlyOn* members are not supported. - The type of the result of the antecedent tasks. - The new continuation task. - An element in the tasks array has been disposed. - The tasks array is null. -or- The continuationAction argument is null. - The continuationOptions argument specifies an invalid value. - The tasks array is empty or contains a null value. - - - Creates a continuation task that starts when a set of specified tasks has completed. - The array of tasks from which to continue. - The action delegate to execute when all tasks in the tasks array have completed. - The cancellation token to assign to the new continuation task. - The type of the result of the antecedent tasks. - The new continuation task. - An element in the tasks array has been disposed. -or- The that created cancellationToken has already been disposed. - The tasks array is null. -or- The continuationAction argument is null. - The tasks array is empty or contains a null value. - - - Creates a continuation task that starts when a set of specified tasks has completed. - The array of tasks from which to continue. - The action delegate to execute when all tasks in the tasks array have completed. - The type of the result of the antecedent tasks. - The new continuation task. - An element in the tasks array has been disposed. - The tasks array is null. -or- The continuationAction argument is null. - The tasks array is empty or contains a null value. - - - Creates a continuation task that starts when a set of specified tasks has completed. - The array of tasks from which to continue. - The function delegate to execute asynchronously when all tasks in the tasks array have completed. - The type of the result that is returned by the continuationFunction delegate and associated with the created task. - The new continuation task. - An element in the tasks array has been disposed. - The tasks array is null. -or- The continuationFunction argument is null. - The tasks array is empty or contains a null value. - - - Creates a continuation task that starts when a set of specified tasks has completed. - The array of tasks from which to continue. - The function delegate to execute asynchronously when all tasks in the tasks array have completed. - The cancellation token to assign to the new continuation task. - The type of the result that is returned by the continuationFunction delegate and associated with the created task. - The new continuation task. - An element in the tasks array has been disposed. -or- The that created cancellationToken has already been disposed. - The tasks array is null. -or- The continuationFunction argument is null. - The tasks array is empty or contains a null value. - - - Creates a continuation task that starts when a set of specified tasks has completed. - The array of tasks from which to continue. - The function delegate to execute asynchronously when all tasks in the tasks array have completed. - A bitwise combination of the enumeration values that control the behavior of the new continuation task. The NotOn* and OnlyOn* members are not supported. - The type of the result that is returned by the continuationFunction delegate and associated with the created task. - The new continuation task. - An element in the tasks array has been disposed. - The tasks array is null. -or- The continuationFunction argument is null. - The continuationOptions argument specifies an invalid value. - The tasks array is empty or contains a null value. - - - Creates a continuation task that starts when a set of specified tasks has completed. - The array of tasks from which to continue. - The function delegate to execute asynchronously when all tasks in the tasks array have completed. - The cancellation token to assign to the new continuation task. - A bitwise combination of the enumeration values that control the behavior of the new continuation task. The NotOn* and OnlyOn* members are not supported. - The object that is used to schedule the new continuation task. - The type of the result that is returned by the continuationFunction delegate and associated with the created task. - The new continuation task. - The tasks array is null. -or- The continuationFunction argument is null. -or- The scheduler argument is null. - The tasks array is empty or contains a null value. - - - Creates a continuation that will be started upon the completion of any Task in the provided set. - The array of tasks from which to continue when one task completes. - The action delegate to execute when one task in the tasks array completes. - The value that controls the behavior of the created continuation . - The new continuation . - The exception that is thrown when one of the elements in the tasks array has been disposed. - The exception that is thrown when the tasks array is null. -or- The exception that is thrown when the continuationAction argument is null. - The exception that is thrown when the continuationOptions argument specifies an invalid TaskContinuationOptions value. - The exception that is thrown when the tasks array contains a null value. -or- The exception that is thrown when the tasks array is empty. - - - Creates a continuation that will be started upon the completion of any Task in the provided set. - The array of tasks from which to continue when one task completes. - The action delegate to execute when one task in the tasks array completes. - The that will be assigned to the new continuation task. - The value that controls the behavior of the created continuation . - The that is used to schedule the created continuation . - The new continuation . - The exception that is thrown when the tasks array is null. -or- The exception that is thrown when the continuationAction argument is null. -or- The exception that is thrown when the scheduler argument is null. - The exception that is thrown when the tasks array contains a null value. -or- The exception that is thrown when the tasks array is empty. - - - Creates a continuation that will be started upon the completion of any Task in the provided set. - The array of tasks from which to continue when one task completes. - The action delegate to execute when one task in the tasks array completes. - The new continuation . - One of the elements in the tasks array has been disposed. - The tasks array is null. -or- The continuationAction argument is null. - The tasks array contains a null value. -or- The tasks array is empty. - - - Creates a continuation that will be started upon the completion of any Task in the provided set. - The array of tasks from which to continue when one task completes. - The action delegate to execute when one task in the tasks array completes. - The that will be assigned to the new continuation task. - The new continuation . - One of the elements in the tasks array has been disposed. -or- cancellationToken has already been disposed. - The tasks array is null. -or- The continuationAction argument is null. - The tasks array contains a null value. -or- The tasks array is empty . - - - Creates a continuation that will be started upon the completion of any Task in the provided set. - The array of tasks from which to continue when one task completes. - The function delegate to execute asynchronously when one task in the tasks array completes. - The value that controls the behavior of the created continuation . - The type of the result of the antecedent tasks. - The type of the result that is returned by the continuationFunction delegate and associated with the created . - The new continuation . - The exception that is thrown when one of the elements in the tasks array has been disposed. - The exception that is thrown when the tasks array is null. -or- The exception that is thrown when the continuationFunction argument is null. - The exception that is thrown when the continuationOptions argument specifies an invalid TaskContinuationOptions value. - The exception that is thrown when the tasks array contains a null value. -or- The exception that is thrown when the tasks array is empty. - - - Creates a continuation that will be started upon the completion of any Task in the provided set. - The array of tasks from which to continue when one task completes. - The function delegate to execute asynchronously when one task in the tasks array completes. - The type of the result of the antecedent tasks. - The type of the result that is returned by the continuationFunction delegate and associated with the created . - The new continuation . - The exception that is thrown when one of the elements in the tasks array has been disposed. - The exception that is thrown when the tasks array is null. -or- The exception that is thrown when the continuationFunction argument is null. - The exception that is thrown when the tasks array contains a null value. -or- The exception that is thrown when the tasks array is empty. - - - Creates a continuation that will be started upon the completion of any Task in the provided set. - The array of tasks from which to continue when one task completes. - The function delegate to execute asynchronously when one task in the tasks array completes. - The that will be assigned to the new continuation task. - The type of the result of the antecedent tasks. - The type of the result that is returned by the continuationFunction delegate and associated with the created . - The new continuation . - The exception that is thrown when one of the elements in the tasks array has been disposed. -or- The provided has already been disposed. - The exception that is thrown when the tasks array is null. -or- The exception that is thrown when the continuationFunction argument is null. - The exception that is thrown when the tasks array contains a null value. -or- The exception that is thrown when the tasks array is empty. - - - Creates a continuation that will be started upon the completion of any Task in the provided set. - The array of tasks from which to continue when one task completes. - The function delegate to execute asynchronously when one task in the tasks array completes. - The that will be assigned to the new continuation task. - The value that controls the behavior of the created continuation . - The that is used to schedule the created continuation . - The type of the result of the antecedent tasks. - The type of the result that is returned by the continuationFunction delegate and associated with the created . - The new continuation . - The exception that is thrown when the tasks array is null. -or- The exception that is thrown when the continuationFunction argument is null. -or- The exception that is thrown when the scheduler argument is null. - The exception that is thrown when the tasks array contains a null value. -or- The exception that is thrown when the tasks array is empty. - - - Creates a continuation that will be started upon the completion of any Task in the provided set. - The array of tasks from which to continue when one task completes. - The action delegate to execute when one task in the tasks array completes. - The type of the result of the antecedent tasks. - The new continuation . - The exception that is thrown when one of the elements in the tasks array has been disposed. - The exception that is thrown when the tasks array is null. -or- The exception that is thrown when the continuationAction argument is null. - The exception that is thrown when the tasks array contains a null value. -or- The exception that is thrown when the tasks array is empty. - - - Creates a continuation that will be started upon the completion of any Task in the provided set. - The array of tasks from which to continue when one task completes. - The action delegate to execute when one task in the tasks array completes. - The that will be assigned to the new continuation task. - The type of the result of the antecedent tasks. - The new continuation . - The exception that is thrown when one of the elements in the tasks array has been disposed. -or- The provided has already been disposed. - The exception that is thrown when the tasks array is null. -or- The exception that is thrown when the continuationAction argument is null. - The exception that is thrown when the tasks array contains a null value. -or- The exception that is thrown when the tasks array is empty. - - - Creates a continuation that will be started upon the completion of any Task in the provided set. - The array of tasks from which to continue when one task completes. - The action delegate to execute when one task in the tasks array completes. - The value that controls the behavior of the created continuation . - The type of the result of the antecedent tasks. - The new continuation . - The exception that is thrown when one of the elements in the tasks array has been disposed. - The exception that is thrown when the tasks array is null. -or- The exception that is thrown when the continuationAction argument is null. - The exception that is thrown when the continuationOptions argument specifies an invalid TaskContinuationOptions value. - The exception that is thrown when the tasks array contains a null value. -or- The exception that is thrown when the tasks array is empty. - - - Creates a continuation that will be started upon the completion of any Task in the provided set. - The array of tasks from which to continue when one task completes. - The action delegate to execute when one task in the tasks array completes. - The that will be assigned to the new continuation task. - The value that controls the behavior of the created continuation . - The that is used to schedule the created continuation . - The type of the result of the antecedent tasks. - The new continuation . - The exception that is thrown when the tasks array is null. -or- The exception that is thrown when the continuationAction argument is null. -or- The exception that is thrown when the scheduler argument is null. - The exception that is thrown when the tasks array contains a null value. -or- The exception that is thrown when the tasks array is empty. - - - Creates a continuation that will be started upon the completion of any Task in the provided set. - The array of tasks from which to continue when one task completes. - The function delegate to execute asynchronously when one task in the tasks array completes. - The type of the result that is returned by the continuationFunction delegate and associated with the created . - The new continuation . - The exception that is thrown when one of the elements in the tasks array has been disposed. - The exception that is thrown when the tasks array is null. -or- The exception that is thrown when the continuationFunction argument is null. - The exception that is thrown when the tasks array contains a null value. -or- The exception that is thrown when the tasks array is empty. - - - Creates a continuation that will be started upon the completion of any Task in the provided set. - The array of tasks from which to continue when one task completes. - The function delegate to execute asynchronously when one task in the tasks array completes. - The that will be assigned to the new continuation task. - The type of the result that is returned by the continuationFunction delegate and associated with the created . - The new continuation . - The exception that is thrown when one of the elements in the tasks array has been disposed. -or- The provided has already been disposed. - The exception that is thrown when the tasks array is null. -or- The exception that is thrown when the continuationFunction argument is null. - The exception that is thrown when the tasks array contains a null value. -or- The exception that is thrown when the tasks array is empty. - - - Creates a continuation that will be started upon the completion of any Task in the provided set. - The array of tasks from which to continue when one task completes. - The function delegate to execute asynchronously when one task in the tasks array completes. - The value that controls the behavior of the created continuation . - The type of the result that is returned by the continuationFunction delegate and associated with the created . - The new continuation . - The exception that is thrown when one of the elements in the tasks array has been disposed. - The exception that is thrown when the tasks array is null. -or- The exception that is thrown when the continuationFunction argument is null. - The exception that is thrown when the continuationOptions argument specifies an invalid TaskContinuationOptions value. - The exception that is thrown when the tasks array contains a null value. -or- The exception that is thrown when the tasks array is empty. - - - Creates a continuation that will be started upon the completion of any Task in the provided set. - The array of tasks from which to continue when one task completes. - The function delegate to execute asynchronously when one task in the tasks array completes. - The that will be assigned to the new continuation task. - The value that controls the behavior of the created continuation . - The that is used to schedule the created continuation . - The type of the result that is returned by the continuationFunction delegate and associated with the created . - The new continuation . - The exception that is thrown when the tasks array is null. -or- The exception that is thrown when the continuationFunction argument is null. -or- The exception that is thrown when the scheduler argument is null. - The exception that is thrown when the tasks array contains a null value. -or- The exception that is thrown when the tasks array is empty. - - - Gets the default task creation options for this task factory. - The default task creation options for this task factory. - - - Creates a that executes an end method action when a specified completes. - The IAsyncResult whose completion should trigger the processing of the endMethod. - The action delegate that processes the completed asyncResult. - A that represents the asynchronous operation. - The exception that is thrown when the asyncResult argument is null. -or- The exception that is thrown when the endMethod argument is null. - - - Creates a that represents a pair of begin and end methods that conform to the Asynchronous Programming Model pattern. - The delegate that begins the asynchronous operation. - The delegate that ends the asynchronous operation. - An object containing data to be used by the beginMethod delegate. - The created that represents the asynchronous operation. - The exception that is thrown when the beginMethod argument is null. -or- The exception that is thrown when the endMethod argument is null. - - - Creates a that executes an end method action when a specified completes. - The IAsyncResult whose completion should trigger the processing of the endMethod. - The action delegate that processes the completed asyncResult. - The TaskCreationOptions value that controls the behavior of the created . - A that represents the asynchronous operation. - The exception that is thrown when the asyncResult argument is null. -or- The exception that is thrown when the endMethod argument is null. - The exception that is thrown when the creationOptions argument specifies an invalid TaskCreationOptions value. For more information, see the Remarks for - - - Creates a that represents a pair of begin and end methods that conform to the Asynchronous Programming Model pattern. - The delegate that begins the asynchronous operation. - The delegate that ends the asynchronous operation. - An object containing data to be used by the beginMethod delegate. - The TaskCreationOptions value that controls the behavior of the created . - The created that represents the asynchronous operation. - The exception that is thrown when the beginMethod argument is null. -or- The exception that is thrown when the endMethod argument is null. - The exception that is thrown when the creationOptions argument specifies an invalid TaskCreationOptions value. - - - Creates a that executes an end method action when a specified completes. - The IAsyncResult whose completion should trigger the processing of the endMethod. - The action delegate that processes the completed asyncResult. - The TaskCreationOptions value that controls the behavior of the created . - The that is used to schedule the task that executes the end method. - The created that represents the asynchronous operation. - The exception that is thrown when the asyncResult argument is null. -or- The exception that is thrown when the endMethod argument is null. -or- The exception that is thrown when the scheduler argument is null. - The exception that is thrown when the creationOptions argument specifies an invalid TaskCreationOptions value. The exception that is thrown when the creationOptions argument specifies an invalid TaskCreationOptions value. For more information, see the Remarks for - - - Creates a that represents a pair of begin and end methods that conform to the Asynchronous Programming Model pattern. - The delegate that begins the asynchronous operation. - The delegate that ends the asynchronous operation. - The first argument passed to the beginMethod delegate. - The second argument passed to the beginMethod delegate. - The third argument passed to the beginMethod delegate. - An object containing data to be used by the beginMethod delegate. - The TaskCreationOptions value that controls the behavior of the created . - The type of the second argument passed to beginMethod delegate. - The type of the third argument passed to beginMethod delegate. - The type of the first argument passed to the beginMethod delegate. - The type of the result available through the . - The created that represents the asynchronous operation. - The exception that is thrown when the beginMethod argument is null. -or- The exception that is thrown when the endMethod argument is null. - The exception that is thrown when the creationOptions argument specifies an invalid TaskCreationOptions value. The exception that is thrown when the creationOptions argument specifies an invalid TaskCreationOptions value. For more information, see the Remarks for - - - Creates a that represents a pair of begin and end methods that conform to the Asynchronous Programming Model pattern. - The delegate that begins the asynchronous operation. - The delegate that ends the asynchronous operation. - The first argument passed to the beginMethod delegate. - The second argument passed to the beginMethod delegate. - The third argument passed to the beginMethod delegate. - An object containing data to be used by the beginMethod delegate. - The type of the second argument passed to beginMethod delegate. - The type of the third argument passed to beginMethod delegate. - The type of the first argument passed to the beginMethod delegate. - The type of the result available through the . - The created that represents the asynchronous operation. - The exception that is thrown when the beginMethod argument is null. -or- The exception that is thrown when the endMethod argument is null. - - - Creates a that represents a pair of begin and end methods that conform to the Asynchronous Programming Model pattern. - The delegate that begins the asynchronous operation. - The delegate that ends the asynchronous operation. - The first argument passed to the beginMethod delegate. - The second argument passed to the beginMethod delegate. - The third argument passed to the beginMethod delegate. - An object containing data to be used by the beginMethod delegate. - The TaskCreationOptions value that controls the behavior of the created . - The type of the second argument passed to beginMethod delegate. - The type of the third argument passed to beginMethod delegate. - The type of the first argument passed to the beginMethod delegate. - The created that represents the asynchronous operation. - The exception that is thrown when the beginMethod argument is null. -or- The exception that is thrown when the endMethod argument is null. - The exception that is thrown when the creationOptions argument specifies an invalid TaskCreationOptions value. The exception that is thrown when the creationOptions argument specifies an invalid TaskCreationOptions value. For more information, see the Remarks for - - - Creates a that represents a pair of begin and end methods that conform to the Asynchronous Programming Model pattern. - The delegate that begins the asynchronous operation. - The delegate that ends the asynchronous operation. - The first argument passed to the beginMethod delegate. - The second argument passed to the beginMethod delegate. - The third argument passed to the beginMethod delegate. - An object containing data to be used by the beginMethod delegate. - The type of the second argument passed to beginMethod delegate. - The type of the third argument passed to beginMethod delegate. - The type of the first argument passed to the beginMethod delegate. - The created that represents the asynchronous operation. - The exception that is thrown when the beginMethod argument is null. -or- The exception that is thrown when the endMethod argument is null. - - - Creates a that represents a pair of begin and end methods that conform to the Asynchronous Programming Model pattern. - The delegate that begins the asynchronous operation. - The delegate that ends the asynchronous operation. - The first argument passed to the beginMethod delegate. - The second argument passed to the beginMethod delegate. - An object containing data to be used by the beginMethod delegate. - The type of the second argument passed to beginMethod delegate. - The type of the first argument passed to the beginMethod delegate. - The type of the result available through the . - The created that represents the asynchronous operation. - The exception that is thrown when the beginMethod argument is null. -or- The exception that is thrown when the endMethod argument is null. - - - Creates a that represents a pair of begin and end methods that conform to the Asynchronous Programming Model pattern. - The delegate that begins the asynchronous operation. - The delegate that ends the asynchronous operation. - The first argument passed to the beginMethod delegate. - The second argument passed to the beginMethod delegate. - An object containing data to be used by the beginMethod delegate. - The TaskCreationOptions value that controls the behavior of the created . - The type of the second argument passed to beginMethod delegate. - The type of the first argument passed to the beginMethod delegate. - The type of the result available through the . - The created that represents the asynchronous operation. - The exception that is thrown when the beginMethod argument is null. -or- The exception that is thrown when the endMethod argument is null. - The exception that is thrown when the creationOptions argument specifies an invalid TaskCreationOptions value. The exception that is thrown when the creationOptions argument specifies an invalid TaskCreationOptions value. For more information, see the Remarks for - - - Creates a that represents a pair of begin and end methods that conform to the Asynchronous Programming Model pattern. - The delegate that begins the asynchronous operation. - The delegate that ends the asynchronous operation. - The first argument passed to the beginMethod delegate. - The second argument passed to the beginMethod delegate. - An object containing data to be used by the beginMethod delegate. - The type of the second argument passed to beginMethod delegate. - The type of the first argument passed to the beginMethod delegate. - The created that represents the asynchronous operation. - The exception that is thrown when the beginMethod argument is null. -or- The exception that is thrown when the endMethod argument is null. - - - Creates a that represents a pair of begin and end methods that conform to the Asynchronous Programming Model pattern. - The delegate that begins the asynchronous operation. - The delegate that ends the asynchronous operation. - The first argument passed to the beginMethod delegate. - The second argument passed to the beginMethod delegate. - An object containing data to be used by the beginMethod delegate. - The TaskCreationOptions value that controls the behavior of the created . - The type of the second argument passed to beginMethod delegate. - The type of the first argument passed to the beginMethod delegate. - The created that represents the asynchronous operation. - The exception that is thrown when the beginMethod argument is null. -or- The exception that is thrown when the endMethod argument is null. - The exception that is thrown when the creationOptions argument specifies an invalid TaskCreationOptions value. The exception that is thrown when the creationOptions argument specifies an invalid TaskCreationOptions value. For more information, see the Remarks for - - - Creates a that represents a pair of begin and end methods that conform to the Asynchronous Programming Model pattern. - The delegate that begins the asynchronous operation. - The delegate that ends the asynchronous operation. - The first argument passed to the beginMethod delegate. - An object containing data to be used by the beginMethod delegate. - The type of the first argument passed to the beginMethod delegate. - The type of the result available through the . - The created that represents the asynchronous operation. - The exception that is thrown when the beginMethod argument is null. -or- The exception that is thrown when the endMethod argument is null. - - - Creates a that represents a pair of begin and end methods that conform to the Asynchronous Programming Model pattern. - The delegate that begins the asynchronous operation. - The delegate that ends the asynchronous operation. - The first argument passed to the beginMethod delegate. - An object containing data to be used by the beginMethod delegate. - The TaskCreationOptions value that controls the behavior of the created . - The type of the first argument passed to the beginMethod delegate. - The type of the result available through the . - The created that represents the asynchronous operation. - The exception that is thrown when the beginMethod argument is null. -or- The exception that is thrown when the endMethod argument is null. - The exception that is thrown when the creationOptions argument specifies an invalid TaskCreationOptions value. The exception that is thrown when the creationOptions argument specifies an invalid TaskCreationOptions value. For more information, see the Remarks for - - - Creates a that represents a pair of begin and end methods that conform to the Asynchronous Programming Model pattern. - The delegate that begins the asynchronous operation. - The delegate that ends the asynchronous operation. - The first argument passed to the beginMethod delegate. - An object containing data to be used by the beginMethod delegate. - The TaskCreationOptions value that controls the behavior of the created . - The type of the first argument passed to the beginMethod delegate. - The created that represents the asynchronous operation. - The exception that is thrown when the beginMethod argument is null. -or- The exception that is thrown when the endMethod argument is null. - The exception that is thrown when the creationOptions argument specifies an invalid TaskCreationOptions value. The exception that is thrown when the creationOptions argument specifies an invalid TaskCreationOptions value. For more information, see the Remarks for - - - Creates a that represents a pair of begin and end methods that conform to the Asynchronous Programming Model pattern. - The delegate that begins the asynchronous operation. - The delegate that ends the asynchronous operation. - The first argument passed to the beginMethod delegate. - An object containing data to be used by the beginMethod delegate. - The type of the first argument passed to the beginMethod delegate. - The created that represents the asynchronous operation. - The exception that is thrown when the beginMethod argument is null. -or- The exception that is thrown when the endMethod argument is null. - - - Creates a that executes an end method function when a specified completes. - The IAsyncResult whose completion should trigger the processing of the endMethod. - The function delegate that processes the completed asyncResult. - The TaskCreationOptions value that controls the behavior of the created . - The that is used to schedule the task that executes the end method. - The type of the result available through the . - A that represents the asynchronous operation. - The exception that is thrown when the asyncResult argument is null. -or- The exception that is thrown when the endMethod argument is null. -or- The exception that is thrown when the scheduler argument is null. - The exception that is thrown when the creationOptions argument specifies an invalid TaskCreationOptions value. The exception that is thrown when the creationOptions argument specifies an invalid TaskCreationOptions value. For more information, see the Remarks for - - - Creates a that executes an end method function when a specified completes. - The IAsyncResult whose completion should trigger the processing of the endMethod. - The function delegate that processes the completed asyncResult. - The TaskCreationOptions value that controls the behavior of the created . - The type of the result available through the . - A that represents the asynchronous operation. - The exception that is thrown when the asyncResult argument is null. -or- The exception that is thrown when the endMethod argument is null. - The exception that is thrown when the creationOptions argument specifies an invalid TaskCreationOptions value. The exception that is thrown when the creationOptions argument specifies an invalid TaskCreationOptions value. For more information, see the Remarks for - - - Creates a that represents a pair of begin and end methods that conform to the Asynchronous Programming Model pattern. - The delegate that begins the asynchronous operation. - The delegate that ends the asynchronous operation. - An object containing data to be used by the beginMethod delegate. - The type of the result available through the . - The created that represents the asynchronous operation. - The exception that is thrown when the beginMethod argument is null. -or- The exception that is thrown when the endMethod argument is null. - - - Creates a that executes an end method function when a specified completes. - The IAsyncResult whose completion should trigger the processing of the endMethod. - The function delegate that processes the completed asyncResult. - The type of the result available through the . - A that represents the asynchronous operation. - The exception that is thrown when the asyncResult argument is null. -or- The exception that is thrown when the endMethod argument is null. - - - Creates a that represents a pair of begin and end methods that conform to the Asynchronous Programming Model pattern. - The delegate that begins the asynchronous operation. - The delegate that ends the asynchronous operation. - An object containing data to be used by the beginMethod delegate. - The TaskCreationOptions value that controls the behavior of the created . - The type of the result available through the . - The created that represents the asynchronous operation. - The exception that is thrown when the beginMethod argument is null. -or- The exception that is thrown when the endMethod argument is null. - The exception that is thrown when the creationOptions argument specifies an invalid TaskCreationOptions value. The exception that is thrown when the creationOptions argument specifies an invalid TaskCreationOptions value. For more information, see the Remarks for - - - Gets the default task scheduler for this task factory. - The default task scheduler for this task factory. - - - Creates and starts a . - The action delegate to execute asynchronously. - An object containing data to be used by the action delegate. - The that will be assigned to the new task. - A TaskCreationOptions value that controls the behavior of the created - The that is used to schedule the created . - The started . - The provided has already been disposed. - The exception that is thrown when the action argument is null. -or- The exception that is thrown when the scheduler argument is null. - The exception that is thrown when the creationOptions argument specifies an invalid TaskCreationOptions value. The exception that is thrown when the creationOptions argument specifies an invalid TaskCreationOptions value. For more information, see the Remarks for - - - Creates and starts a . - The action delegate to execute asynchronously. - The that will be assigned to the new - A TaskCreationOptions value that controls the behavior of the created - The that is used to schedule the created . - The started . - The provided has already been disposed. - The exception that is thrown when the action argument is null. -or- The exception that is thrown when the scheduler argument is null. - The exception that is thrown when the creationOptions argument specifies an invalid TaskCreationOptions value. The exception that is thrown when the creationOptions argument specifies an invalid TaskCreationOptions value. For more information, see the Remarks for - - - Creates and starts a . - The action delegate to execute asynchronously. - An object containing data to be used by the action delegate. - A TaskCreationOptions value that controls the behavior of the created - The started . - The exception that is thrown when the action argument is null. - The exception that is thrown when the creationOptions argument specifies an invalid TaskCreationOptions value. - - - Creates and starts a . - The action delegate to execute asynchronously. - An object containing data to be used by the action delegate. - The that will be assigned to the new - The started . - The provided has already been disposed. - The exception that is thrown when the action argument is null. - - - Creates and starts a . - The action delegate to execute asynchronously. - The that will be assigned to the new task. - The started . - The provided has already been disposed. - The exception that is thrown when the action argument is null. - - - Creates and starts a . - The action delegate to execute asynchronously. - A TaskCreationOptions value that controls the behavior of the created - The started . - The exception that is thrown when the action argument is null. - The exception that is thrown when the creationOptions argument specifies an invalid TaskCreationOptions value. - - - Creates and starts a task. - The action delegate to execute asynchronously. - The started task. - The action argument is null. - - - Creates and starts a . - The action delegate to execute asynchronously. - An object containing data to be used by the action delegate. - The started . - The action argument is null. - - - Creates and starts a . - A function delegate that returns the future result to be available through the . - The that will be assigned to the new task. - A TaskCreationOptions value that controls the behavior of the created . - The that is used to schedule the created . - The type of the result available through the . - The started . - The provided has already been disposed. - The exception that is thrown when the function argument is null. -or- The exception that is thrown when the scheduler argument is null. - The exception that is thrown when the creationOptions argument specifies an invalid TaskCreationOptions value. The exception that is thrown when the creationOptions argument specifies an invalid TaskCreationOptions value. For more information, see the Remarks for - - - Creates and starts a . - A function delegate that returns the future result to be available through the . - The type of the result available through the . - The started . - The function argument is null. - - - Creates and starts a . - A function delegate that returns the future result to be available through the . - An object containing data to be used by the function delegate. - The type of the result available through the . - The started . - The exception that is thrown when the function argument is null. - - - Creates and starts a . - A function delegate that returns the future result to be available through the . - The that will be assigned to the new - The type of the result available through the . - The started . - The provided has already been disposed. - The exception that is thrown when the function argument is null. - - - Creates and starts a . - A function delegate that returns the future result to be available through the . - A TaskCreationOptions value that controls the behavior of the created . - The type of the result available through the . - The started . - The exception that is thrown when the function argument is null. - The exception that is thrown when the creationOptions argument specifies an invalid TaskCreationOptions value. The exception that is thrown when the creationOptions argument specifies an invalid TaskCreationOptions value. For more information, see the Remarks for - - - Creates and starts a . - A function delegate that returns the future result to be available through the . - An object containing data to be used by the function delegate. - The that will be assigned to the new - The type of the result available through the . - The started . - The provided has already been disposed. - The exception that is thrown when the function argument is null. - - - Creates and starts a . - A function delegate that returns the future result to be available through the . - An object containing data to be used by the function delegate. - A TaskCreationOptions value that controls the behavior of the created . - The type of the result available through the . - The started . - The exception that is thrown when the function argument is null. - The exception that is thrown when the creationOptions argument specifies an invalid TaskCreationOptions value. The exception that is thrown when the creationOptions argument specifies an invalid TaskCreationOptions value. For more information, see the Remarks for - - - Creates and starts a . - A function delegate that returns the future result to be available through the . - An object containing data to be used by the function delegate. - The that will be assigned to the new task. - A TaskCreationOptions value that controls the behavior of the created . - The that is used to schedule the created . - The type of the result available through the . - The started . - The provided has already been disposed. - The exception that is thrown when the function argument is null. -or- The exception that is thrown when the scheduler argument is null. - The exception that is thrown when the creationOptions argument specifies an invalid TaskCreationOptions value. The exception that is thrown when the creationOptions argument specifies an invalid TaskCreationOptions value. For more information, see the Remarks for - - - Represents an object that handles the low-level work of queuing tasks onto threads. - - - Initializes the . - - - Gets the associated with the currently executing task. - Returns the associated with the currently executing task. - - - Gets the default instance that is provided by the .NET Framework. - Returns the default instance. - - - Creates a associated with the current . - A associated with the current , as determined by . - The current SynchronizationContext may not be used as a TaskScheduler. - - - For debugger support only, generates an enumerable of instances currently queued to the scheduler waiting to be executed. - An enumerable that allows a debugger to traverse the tasks currently queued to this scheduler. - This scheduler is unable to generate a list of queued tasks at this time. - - - Gets the unique ID for this . - Returns the unique ID for this . - - - Indicates the maximum concurrency level this is able to support. - Returns an integer that represents the maximum concurrency level. The default scheduler returns . - - - Queues a to the scheduler. - The to be queued. - The task argument is null. - - - Attempts to dequeue a that was previously queued to this scheduler. - The to be dequeued. - A Boolean denoting whether the task argument was successfully dequeued. - The task argument is null. - - - Attempts to execute the provided on this scheduler. - A object to be executed. - A Boolean that is true if task was successfully executed, false if it was not. A common reason for execution failure is that the task had previously been executed or is in the process of being executed by another thread. - The task is not associated with this scheduler. - - - Determines whether the provided can be executed synchronously in this call, and if it can, executes it. - The to be executed. - A Boolean denoting whether or not task has previously been queued. If this parameter is True, then the task may have been previously queued (scheduled); if False, then the task is known not to have been queued, and this call is being made in order to execute the task inline without queuing it. - A Boolean value indicating whether the task was executed inline. - The task argument is null. - The task was already executed. - - - Occurs when a faulted task's unobserved exception is about to trigger exception escalation policy, which, by default, would terminate the process. - - - - Represents an exception used to communicate an invalid operation by a . - - - Initializes a new instance of the class with a system-supplied message that describes the error. - - - Initializes a new instance of the class using the default error message and a reference to the inner exception that is the cause of this exception. - The exception that is the cause of the current exception. - - - Initializes a new instance of the class with a specified message that describes the error. - The message that describes the exception. The caller of this constructor is required to ensure that this string has been localized for the current system culture. - - - Initializes a new instance of the class with serialized data. - The object that holds the serialized object data. - The contextual information about the source or destination. - - - Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. - The message that describes the exception. The caller of this constructor is required to ensure that this string has been localized for the current system culture. - The exception that is the cause of the current exception. If the innerException parameter is not null, the current exception is raised in a catch block that handles the inner exception. - - - Represents the current stage in the lifecycle of a . - - - The task acknowledged cancellation by throwing an OperationCanceledException with its own CancellationToken while the token was in signaled state, or the task's CancellationToken was already signaled before the task started executing. For more information, see Task Cancellation. - - - - The task has been initialized but has not yet been scheduled. - - - - The task completed due to an unhandled exception. - - - - The task completed execution successfully. - - - - The task is running but has not yet completed. - - - - The task is waiting to be activated and scheduled internally by the .NET Framework infrastructure. - - - - The task has finished executing and is implicitly waiting for attached child tasks to complete. - - - - The task has been scheduled for execution but has not yet begun executing. - - - - Provides data for the event that is raised when a faulted 's exception goes unobserved. - - - Initializes a new instance of the class with the unobserved exception. - The Exception that has gone unobserved. - - - The Exception that went unobserved. - The Exception that went unobserved. - - - Gets whether this exception has been marked as "observed." - true if this exception has been marked as "observed"; otherwise false. - - - Marks the as "observed," thus preventing it from triggering exception escalation policy which, by default, terminates the process. - - - Creates and controls a thread, sets its priority, and gets its status. - - - Initializes a new instance of the class, specifying a delegate that allows an object to be passed to the thread when the thread is started. - A delegate that represents the methods to be invoked when this thread begins executing. - start is null. - - - Initializes a new instance of the class. - A delegate that represents the methods to be invoked when this thread begins executing. - The start parameter is null. - - - Initializes a new instance of the class, specifying a delegate that allows an object to be passed to the thread when the thread is started and specifying the maximum stack size for the thread. - A delegate that represents the methods to be invoked when this thread begins executing. - The maximum stack size, in bytes, to be used by the thread, or 0 to use the default maximum stack size specified in the header for the executable. Important For partially trusted code, maxStackSize is ignored if it is greater than the default stack size. No exception is thrown. - start is null. - maxStackSize is less than zero. - - - Initializes a new instance of the class, specifying the maximum stack size for the thread. - A delegate that represents the methods to be invoked when this thread begins executing. - The maximum stack size, in bytes, to be used by the thread, or 0 to use the default maximum stack size specified in the header for the executable. Important For partially trusted code, maxStackSize is ignored if it is greater than the default stack size. No exception is thrown. - start is null. - maxStackSize is less than zero. - - - Raises a in the thread on which it is invoked, to begin the process of terminating the thread. Calling this method usually terminates the thread. - The caller does not have the required permission. - The thread that is being aborted is currently suspended. - - - Raises a in the thread on which it is invoked, to begin the process of terminating the thread while also providing exception information about the thread termination. Calling this method usually terminates the thread. - An object that contains application-specific information, such as state, which can be used by the thread being aborted. - The caller does not have the required permission. - The thread that is being aborted is currently suspended. - - - Allocates an unnamed data slot on all the threads. For better performance, use fields that are marked with the attribute instead. - The allocated named data slot on all threads. - - - Allocates a named data slot on all threads. For better performance, use fields that are marked with the attribute instead. - The name of the data slot to be allocated. - The allocated named data slot on all threads. - A named data slot with the specified name already exists. - - - Gets or sets the apartment state of this thread. - One of the values. The initial value is Unknown. - An attempt is made to set this property to a state that is not a valid apartment state (a state other than single-threaded apartment (STA) or multithreaded apartment (MTA)). - - - Notifies a host that execution is about to enter a region of code in which the effects of a thread abort or unhandled exception might jeopardize other tasks in the application domain. - - - Notifies a host that managed code is about to execute instructions that depend on the identity of the current physical operating system thread. - The caller does not have the required permission. - - - Gets or sets the culture for the current thread. - An object that represents the culture for the current thread. - The property is set to null. - - - Gets or sets the thread's current principal (for role-based security). - An value representing the security context. - The caller does not have the permission required to set the principal. - - - Gets the currently running thread. - A that is the representation of the currently running thread. - - - Gets or sets the current culture used by the Resource Manager to look up culture-specific resources at run time. - An object that represents the current culture. - The property is set to null. - The property is set to a culture name that cannot be used to locate a resource file. Resource filenames must include only letters, numbers, hyphens or underscores. - - - Turns off automatic cleanup of runtime callable wrappers (RCW) for the current thread. - - - Notifies a host that execution is about to enter a region of code in which the effects of a thread abort or unhandled exception are limited to the current task. - - - Notifies a host that managed code has finished executing instructions that depend on the identity of the current physical operating system thread. - The caller does not have the required permission. - - - Gets an object that contains information about the various contexts of the current thread. - An object that consolidates context information for the current thread. - - - Eliminates the association between a name and a slot, for all threads in the process. For better performance, use fields that are marked with the attribute instead. - The name of the data slot to be freed. - - - Returns an value indicating the apartment state. - One of the values indicating the apartment state of the managed thread. The default is . - - - Returns a object that can be used to capture the stack for the current thread. - None. - In all cases. - - - Retrieves the value from the specified slot on the current thread, within the current thread's current domain. For better performance, use fields that are marked with the attribute instead. - The from which to get the value. - The retrieved value. - - - Returns the current domain in which the current thread is running. - An representing the current application domain of the running thread. - - - Returns a unique application domain identifier. - A 32-bit signed integer uniquely identifying the application domain. - - - Returns a hash code for the current thread. - An integer hash code value. - - - Looks up a named data slot. For better performance, use fields that are marked with the attribute instead. - The name of the local data slot. - A allocated for this thread. - - - Interrupts a thread that is in the WaitSleepJoin thread state. - The caller does not have the appropriate . - - - Gets a value indicating the execution status of the current thread. - true if this thread has been started and has not terminated normally or aborted; otherwise, false. - - - Gets or sets a value indicating whether or not a thread is a background thread. - true if this thread is or is to become a background thread; otherwise, false. - The thread is dead. - - - Gets a value indicating whether or not a thread belongs to the managed thread pool. - true if this thread belongs to the managed thread pool; otherwise, false. - - - Blocks the calling thread until the thread represented by this instance terminates, while continuing to perform standard COM and SendMessage pumping. - The caller attempted to join a thread that is in the state. - The thread is interrupted while waiting. - - - Blocks the calling thread until the thread represented by this instance terminates or the specified time elapses, while continuing to perform standard COM and SendMessage pumping. - The number of milliseconds to wait for the thread to terminate. - true if the thread has terminated; false if the thread has not terminated after the amount of time specified by the millisecondsTimeout parameter has elapsed. - The value of millisecondsTimeout is negative and is not equal to in milliseconds. - The thread has not been started. - - - Blocks the calling thread until the thread represented by this instance terminates or the specified time elapses, while continuing to perform standard COM and SendMessage pumping. - A set to the amount of time to wait for the thread to terminate. - true if the thread terminated; false if the thread has not terminated after the amount of time specified by the timeout parameter has elapsed. - The value of timeout is negative and is not equal to in milliseconds, or is greater than milliseconds. - The caller attempted to join a thread that is in the state. - - - Gets a unique identifier for the current managed thread. - An integer that represents a unique identifier for this managed thread. - - - Synchronizes memory access as follows: The processor executing the current thread cannot reorder instructions in such a way that memory accesses prior to the call to execute after memory accesses that follow the call to . - - - Gets or sets the name of the thread. - A string containing the name of the thread, or null if no name was set. - A set operation was requested, but the Name property has already been set. - - - Gets or sets a value indicating the scheduling priority of a thread. - One of the values. The default value is . - The thread has reached a final state, such as . - The value specified for a set operation is not a valid value. - - - Cancels an requested for the current thread. - Abort was not invoked on the current thread. - The caller does not have the required security permission for the current thread. - - - Resumes a thread that has been suspended. - The thread has not been started, is dead, or is not in the suspended state. - The caller does not have the appropriate . - - - Sets the apartment state of a thread before it is started. - The new apartment state. - state is not a valid apartment state. - The thread has already been started. - The apartment state has already been initialized. - - - Applies a captured to the current thread. - The object to be applied to the current thread. - In all cases. - - - Sets the data in the specified slot on the currently running thread, for that thread's current domain. For better performance, use fields marked with the attribute instead. - The in which to set the value. - The value to be set. - - - Suspends the current thread for the specified number of milliseconds. - The number of milliseconds for which the thread is suspended. If the value of the millisecondsTimeout argument is zero, the thread relinquishes the remainder of its time slice to any thread of equal priority that is ready to run. If there are no other threads of equal priority that are ready to run, execution of the current thread is not suspended. - The time-out value is negative and is not equal to . - - - Suspends the current thread for the specified amount of time. - The amount of time for which the thread is suspended. If the value of the millisecondsTimeout argument is , the thread relinquishes the remainder of its time slice to any thread of equal priority that is ready to run. If there are no other threads of equal priority that are ready to run, execution of the current thread is not suspended. - The value of timeout is negative and is not equal to in milliseconds, or is greater than milliseconds. - - - Causes a thread to wait the number of times defined by the iterations parameter. - A 32-bit signed integer that defines how long a thread is to wait. - - - Causes the operating system to change the state of the current instance to . - The thread has already been started. - There is not enough memory available to start this thread. - - - Causes the operating system to change the state of the current instance to , and optionally supplies an object containing data to be used by the method the thread executes. - An object that contains data to be used by the method the thread executes. - The thread has already been started. - There is not enough memory available to start this thread. - This thread was created using a delegate instead of a delegate. - - - Either suspends the thread, or if the thread is already suspended, has no effect. - The thread has not been started or is dead. - The caller does not have the appropriate . - - - Gets a value containing the states of the current thread. - One of the values indicating the state of the current thread. The initial value is Unstarted. - - - Sets the apartment state of a thread before it is started. - The new apartment state. - true if the apartment state is set; otherwise, false. - state is not a valid apartment state. - The thread has already been started. - - - Reads the value of a field. The value is the latest written by any processor in a computer, regardless of the number of processors or the state of processor cache. - The field to be read. - The latest value written to the field by any processor. - - - Reads the value of a field. The value is the latest written by any processor in a computer, regardless of the number of processors or the state of processor cache. - The field to be read. - The latest value written to the field by any processor. - - - Reads the value of a field. The value is the latest written by any processor in a computer, regardless of the number of processors or the state of processor cache. - The field to be read. - The latest value written to the field by any processor. - - - Reads the value of a field. The value is the latest written by any processor in a computer, regardless of the number of processors or the state of processor cache. - The field to be read. - The latest value written to the field by any processor. - - - Reads the value of a field. The value is the latest written by any processor in a computer, regardless of the number of processors or the state of processor cache. - The field to be read. - The latest value written to the field by any processor. - - - Reads the value of a field. The value is the latest written by any processor in a computer, regardless of the number of processors or the state of processor cache. - The field to be read. - The latest value written to the field by any processor. - - - Reads the value of a field. The value is the latest written by any processor in a computer, regardless of the number of processors or the state of processor cache. - The field to be read. - The latest value written to the field by any processor. - - - Reads the value of a field. The value is the latest written by any processor in a computer, regardless of the number of processors or the state of processor cache. - The field to be read. - The latest value written to the field by any processor. - - - Reads the value of a field. The value is the latest written by any processor in a computer, regardless of the number of processors or the state of processor cache. - The field to be read. - The latest value written to the field by any processor. - - - Reads the value of a field. The value is the latest written by any processor in a computer, regardless of the number of processors or the state of processor cache. - The field to be read. - The latest value written to the field by any processor. - - - Reads the value of a field. The value is the latest written by any processor in a computer, regardless of the number of processors or the state of processor cache. - The field to be read. - The latest value written to the field by any processor. - - - Reads the value of a field. The value is the latest written by any processor in a computer, regardless of the number of processors or the state of processor cache. - The field to be read. - The latest value written to the field by any processor. - - - Reads the value of a field. The value is the latest written by any processor in a computer, regardless of the number of processors or the state of processor cache. - The field to be read. - The latest value written to the field by any processor. - - - Writes a value to a field immediately, so that the value is visible to all processors in the computer. - The field to which the value is to be written. - The value to be written. - - - Writes a value to a field immediately, so that the value is visible to all processors in the computer. - The field to which the value is to be written. - The value to be written. - - - Writes a value to a field immediately, so that the value is visible to all processors in the computer. - The field to which the value is to be written. - The value to be written. - - - Writes a value to a field immediately, so that the value is visible to all processors in the computer. - The field to which the value is to be written. - The value to be written. - - - Writes a value to a field immediately, so that the value is visible to all processors in the computer. - The field to which the value is to be written. - The value to be written. - - - Writes a value to a field immediately, so that the value is visible to all processors in the computer. - The field to which the value is to be written. - The value to be written. - - - Writes a value to a field immediately, so that the value is visible to all processors in the computer. - The field to which the value is to be written. - The value to be written. - - - Writes a value to a field immediately, so that the value is visible to all processors in the computer. - The field to which the value is to be written. - The value to be written. - - - Writes a value to a field immediately, so that the value is visible to all processors in the computer. - The field to which the value is to be written. - The value to be written. - - - Writes a value to a field immediately, so that the value is visible to all processors in the computer. - The field to which the value is to be written. - The value to be written. - - - Writes a value to a field immediately, so that the value is visible to all processors in the computer. - The field to which the value is to be written. - The value to be written. - - - Writes a value to a field immediately, so that the value is visible to all processors in the computer. - The field to which the value is to be written. - The value to be written. - - - Writes a value to a field immediately, so that the value is visible to all processors in the computer. - The field to which the value is to be written. - The value to be written. - - - Causes the calling thread to yield execution to another thread that is ready to run on the current processor. The operating system selects the thread to yield to. - true if the operating system switched execution to another thread; otherwise, false. - - - The exception that is thrown when a call is made to the method. This class cannot be inherited. - - - Gets an object that contains application-specific information related to the thread abort. - An object containing application-specific information. - - - Provides data for the event. - - - Initializes a new instance of the class. - The that occurred. - - - Gets the that occurred. - The that occurred. - - - Represents the method that will handle the event of an . - The source of the event. - A that contains the event data. - - - The exception that is thrown when a is interrupted while it is in a waiting state. - - - Initializes a new instance of the class with default properties. - - - Initializes a new instance of the class with a specified error message. - The error message that explains the reason for the exception. - - - Initializes a new instance of the class with serialized data. - The that holds the serialized object data about the exception being thrown. - The that contains contextual information about the source or destination. - - - Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. - The error message that explains the reason for the exception. - The exception that is the cause of the current exception. If the innerException parameter is not null, the current exception is raised in a catch block that handles the inner exception. - - - Provides thread-local storage of data. - Specifies the type of data stored per-thread. - - - Initializes the instance. - - - Initializes the instance and specifies whether all values are accessible from any thread. - true to track all values set on the instance and expose them through the property; false otherwise. - - - Initializes the instance with the specified valueFactory function. - The invoked to produce a lazily-initialized value when an attempt is made to retrieve without it having been previously initialized. - valueFactory is a null reference (Nothing in Visual Basic). - - - Initializes the instance with the specified valueFactory function and a flag that indicates whether all values are accessible from any thread. - The invoked to produce a lazily-initialized value when an attempt is made to retrieve without it having been previously initialized. - true to track all values set on the instance and expose them through the property; false otherwise. - valueFactory is a null reference (Nothing in Visual Basic). - - - Releases all resources used by the current instance of the class. - - - Releases the resources used by this instance. - A Boolean value that indicates whether this method is being called due to a call to . - - - Releases the resources used by this instance. - - - Gets whether is initialized on the current thread. - true if is initialized on the current thread; otherwise false. - The instance has been disposed. - - - Creates and returns a string representation of this instance for the current thread. - The result of calling on the . - The instance has been disposed. - The for the current thread is a null reference (Nothing in Visual Basic). - The initialization function attempted to reference recursively. - No default constructor is provided and no value factory is supplied. - - - Gets or sets the value of this instance for the current thread. - Returns an instance of the object that this ThreadLocal is responsible for initializing. - The instance has been disposed. - The initialization function attempted to reference recursively. - No default constructor is provided and no value factory is supplied. - - - Gets a list for all of the values currently stored by all of the threads that have accessed this instance. - A list for all of the values currently stored by all of the threads that have accessed this instance. - Values stored by all threads are not available because this instance was initialized with the trackAllValues argument set to false in the call to a class constructor. - The instance has been disposed. - - - Provides a pool of threads that can be used to execute tasks, post work items, process asynchronous I/O, wait on behalf of other threads, and process timers. - - - Binds an operating system handle to the . - An that holds the handle. The handle must have been opened for overlapped I/O on the unmanaged side. - true if the handle is bound; otherwise, false. - The caller does not have the required permission. - - - Binds an operating system handle to the . - A that holds the operating system handle. The handle must have been opened for overlapped I/O on the unmanaged side. - true if the handle is bound; otherwise, false. - osHandle is null. - - - Retrieves the difference between the maximum number of thread pool threads returned by the method, and the number currently active. - The number of available worker threads. - The number of available asynchronous I/O threads. - - - Retrieves the number of requests to the thread pool that can be active concurrently. All requests above that number remain queued until thread pool threads become available. - The maximum number of worker threads in the thread pool. - The maximum number of asynchronous I/O threads in the thread pool. - - - Retrieves the minimum number of threads the thread pool creates on demand, as new requests are made, before switching to an algorithm for managing thread creation and destruction. - When this method returns, contains the minimum number of worker threads that the thread pool creates on demand. - When this method returns, contains the minimum number of asynchronous I/O threads that the thread pool creates on demand. - - - Queues a method for execution. The method executes when a thread pool thread becomes available. - A that represents the method to be executed. - true if the method is successfully queued; is thrown if the work item could not be queued. - callBack is null. - The common language runtime (CLR) is hosted, and the host does not support this action. - - - Queues a method for execution, and specifies an object containing data to be used by the method. The method executes when a thread pool thread becomes available. - A representing the method to execute. - An object containing data to be used by the method. - true if the method is successfully queued; is thrown if the work item could not be queued. - The common language runtime (CLR) is hosted, and the host does not support this action. - callBack is null. - - - Registers a delegate to wait for a , specifying a 32-bit unsigned integer for the time-out in milliseconds. - The to register. Use a other than . - The delegate to call when the waitObject parameter is signaled. - The object passed to the delegate. - The time-out in milliseconds. If the millisecondsTimeOutInterval parameter is 0 (zero), the function tests the object's state and returns immediately. If millisecondsTimeOutInterval is -1, the function's time-out interval never elapses. - true to indicate that the thread will no longer wait on the waitObject parameter after the delegate has been called; false to indicate that the timer is reset every time the wait operation completes until the wait is unregistered. - The that can be used to cancel the registered wait operation. - The millisecondsTimeOutInterval parameter is less than -1. - - - Registers a delegate to wait for a , specifying a value for the time-out. - The to register. Use a other than . - The delegate to call when the waitObject parameter is signaled. - The object passed to the delegate. - The time-out represented by a . If timeout is 0 (zero), the function tests the object's state and returns immediately. If timeout is -1, the function's time-out interval never elapses. - true to indicate that the thread will no longer wait on the waitObject parameter after the delegate has been called; false to indicate that the timer is reset every time the wait operation completes until the wait is unregistered. - The that encapsulates the native handle. - The timeout parameter is less than -1. - The timeout parameter is greater than . - - - Registers a delegate to wait for a , specifying a 32-bit signed integer for the time-out in milliseconds. - The to register. Use a other than . - The delegate to call when the waitObject parameter is signaled. - The object that is passed to the delegate. - The time-out in milliseconds. If the millisecondsTimeOutInterval parameter is 0 (zero), the function tests the object's state and returns immediately. If millisecondsTimeOutInterval is -1, the function's time-out interval never elapses. - true to indicate that the thread will no longer wait on the waitObject parameter after the delegate has been called; false to indicate that the timer is reset every time the wait operation completes until the wait is unregistered. - The that encapsulates the native handle. - The millisecondsTimeOutInterval parameter is less than -1. - - - Registers a delegate to wait for a , specifying a 64-bit signed integer for the time-out in milliseconds. - The to register. Use a other than . - The delegate to call when the waitObject parameter is signaled. - The object passed to the delegate. - The time-out in milliseconds. If the millisecondsTimeOutInterval parameter is 0 (zero), the function tests the object's state and returns immediately. If millisecondsTimeOutInterval is -1, the function's time-out interval never elapses. - true to indicate that the thread will no longer wait on the waitObject parameter after the delegate has been called; false to indicate that the timer is reset every time the wait operation completes until the wait is unregistered. - The that encapsulates the native handle. - The millisecondsTimeOutInterval parameter is less than -1. - - - Sets the number of requests to the thread pool that can be active concurrently. All requests above that number remain queued until thread pool threads become available. - The maximum number of worker threads in the thread pool. - The maximum number of asynchronous I/O threads in the thread pool. - true if the change is successful; otherwise, false. - - - Sets the minimum number of threads the thread pool creates on demand, as new requests are made, before switching to an algorithm for managing thread creation and destruction. - The minimum number of worker threads that the thread pool creates on demand. - The minimum number of asynchronous I/O threads that the thread pool creates on demand. - true if the change is successful; otherwise, false. - - - Queues an overlapped I/O operation for execution. - The structure to queue. - true if the operation was successfully queued to an I/O completion port; otherwise, false. - - - Queues the specified delegate to the thread pool, but does not propagate the calling stack to the worker thread. - A that represents the delegate to invoke when a thread in the thread pool picks up the work item. - The object that is passed to the delegate when serviced from the thread pool. - true if the method succeeds; is thrown if the work item could not be queued. - The caller does not have the required permission. - An out-of-memory condition was encountered. - The work item could not be queued. - callBack is null. - - - Registers a delegate to wait for a , specifying a value for the time-out. This method does not propagate the calling stack to the worker thread. - The to register. Use a other than . - The delegate to call when the waitObject parameter is signaled. - The object that is passed to the delegate. - The time-out represented by a . If timeout is 0 (zero), the function tests the object's state and returns immediately. If timeout is -1, the function's time-out interval never elapses. - true to indicate that the thread will no longer wait on the waitObject parameter after the delegate has been called; false to indicate that the timer is reset every time the wait operation completes until the wait is unregistered. - The object that can be used to cancel the registered wait operation. - The timeout parameter is less than -1. - The timeout parameter is greater than . - The caller does not have the required permission. - - - Registers a delegate to wait for a , using a 32-bit signed integer for the time-out in milliseconds. This method does not propagate the calling stack to the worker thread. - The to register. Use a other than . - The delegate to call when the waitObject parameter is signaled. - The object that is passed to the delegate. - The time-out in milliseconds. If the millisecondsTimeOutInterval parameter is 0 (zero), the function tests the object's state and returns immediately. If millisecondsTimeOutInterval is -1, the function's time-out interval never elapses. - true to indicate that the thread will no longer wait on the waitObject parameter after the delegate has been called; false to indicate that the timer is reset every time the wait operation completes until the wait is unregistered. - The object that can be used to cancel the registered wait operation. - The millisecondsTimeOutInterval parameter is less than -1. - The caller does not have the required permission. - - - Registers a delegate to wait for a , specifying a 64-bit signed integer for the time-out in milliseconds. This method does not propagate the calling stack to the worker thread. - The to register. Use a other than . - The delegate to call when the waitObject parameter is signaled. - The object that is passed to the delegate. - The time-out in milliseconds. If the millisecondsTimeOutInterval parameter is 0 (zero), the function tests the object's state and returns immediately. If millisecondsTimeOutInterval is -1, the function's time-out interval never elapses. - true to indicate that the thread will no longer wait on the waitObject parameter after the delegate has been called; false to indicate that the timer is reset every time the wait operation completes until the wait is unregistered. - The object that can be used to cancel the registered wait operation. - The millisecondsTimeOutInterval parameter is less than -1. - The caller does not have the required permission. - - - Registers a delegate to wait for a , specifying a 32-bit unsigned integer for the time-out in milliseconds. This method does not propagate the calling stack to the worker thread. - The to register. Use a other than . - The delegate to call when the waitObject parameter is signaled. - The object that is passed to the delegate. - The time-out in milliseconds. If the millisecondsTimeOutInterval parameter is 0 (zero), the function tests the object's state and returns immediately. If millisecondsTimeOutInterval is -1, the function's time-out interval never elapses. - true to indicate that the thread will no longer wait on the waitObject parameter after the delegate has been called; false to indicate that the timer is reset every time the wait operation completes until the wait is unregistered. - The object that can be used to cancel the registered wait operation. - The caller does not have the required permission. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Specifies the scheduling priority of a . - - - The can be scheduled after threads with Highest priority and before those with Normal priority. - - - - The can be scheduled after threads with Normal priority and before those with Lowest priority. - - - - The can be scheduled before threads with any other priority. - - - - The can be scheduled after threads with any other priority. - - - - The can be scheduled after threads with AboveNormal priority and before those with BelowNormal priority. Threads have Normal priority by default. - - - - Represents the method that executes on a . - - - The exception that is thrown when a failure occurs in a managed thread after the underlying operating system thread has been started, but before the thread is ready to execute user code. - - - Specifies the execution states of a . - - - The thread state includes and the thread is now dead, but its state has not yet changed to . - - - - The method has been invoked on the thread, but the thread has not yet received the pending that will attempt to terminate it. - - - - The thread is being executed as a background thread, as opposed to a foreground thread. This state is controlled by setting the property. - - - - The thread has been started, it is not blocked, and there is no pending . - - - - The thread has stopped. - - - - The thread is being requested to stop. This is for internal use only. - - - - The thread has been suspended. - - - - The thread is being requested to suspend. - - - - The method has not been invoked on the thread. - - - - The thread is blocked. This could be the result of calling or , of requesting a lock — for example, by calling or — or of waiting on a thread synchronization object such as . - - - - The exception that is thrown when a is in an invalid for the method call. - - - Initializes a new instance of the class with default properties. - - - Initializes a new instance of the class with a specified error message. - The error message that explains the reason for the exception. - - - Initializes a new instance of the class with serialized data. - The that holds the serialized object data about the exception being thrown. - The that contains contextual information about the source or destination. - - - Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. - The error message that explains the reason for the exception. - The exception that is the cause of the current exception. If the innerException parameter is not null, the current exception is raised in a catch block that handles the inner exception. - - - Contains constants that specify infinite time-out intervals. This class cannot be inherited. - - - A constant used to specify an infinite waiting period, for threading methods that accept an parameter. - - - - A constant used to specify an infinite waiting period, for methods that accept a parameter. - - - - Provides a mechanism for executing a method on a thread pool thread at specified intervals. This class cannot be inherited. - - - Initializes a new instance of the class with an infinite period and an infinite due time, using the newly created object as the state object. - A delegate representing a method to be executed. - - - Initializes a new instance of the Timer class, using a 32-bit signed integer to specify the time interval. - A delegate representing a method to be executed. - An object containing information to be used by the callback method, or null. - The amount of time to delay before callback is invoked, in milliseconds. Specify to prevent the timer from starting. Specify zero (0) to start the timer immediately. - The time interval between invocations of callback, in milliseconds. Specify to disable periodic signaling. - The dueTime or period parameter is negative and is not equal to . - The callback parameter is null. - - - Initializes a new instance of the Timer class, using 64-bit signed integers to measure time intervals. - A delegate representing a method to be executed. - An object containing information to be used by the callback method, or null. - The amount of time to delay before callback is invoked, in milliseconds. Specify to prevent the timer from starting. Specify zero (0) to start the timer immediately. - The time interval between invocations of callback, in milliseconds. Specify to disable periodic signaling. - The dueTime or period parameter is negative and is not equal to . - The dueTime or period parameter is greater than 4294967294. - - - Initializes a new instance of the Timer class, using values to measure time intervals. - A delegate representing a method to be executed. - An object containing information to be used by the callback method, or null. - The amount of time to delay before the callback parameter invokes its methods. Specify negative one (-1) milliseconds to prevent the timer from starting. Specify zero (0) to start the timer immediately. - The time interval between invocations of the methods referenced by callback. Specify negative one (-1) milliseconds to disable periodic signaling. - The number of milliseconds in the value of dueTime or period is negative and not equal to , or is greater than . - The callback parameter is null. - - - Initializes a new instance of the Timer class, using 32-bit unsigned integers to measure time intervals. - A delegate representing a method to be executed. - An object containing information to be used by the callback method, or null. - The amount of time to delay before callback is invoked, in milliseconds. Specify to prevent the timer from starting. Specify zero (0) to start the timer immediately. - The time interval between invocations of callback, in milliseconds. Specify to disable periodic signaling. - The dueTime or period parameter is negative and is not equal to . - The callback parameter is null. - - - Changes the start time and the interval between method invocations for a timer, using 32-bit signed integers to measure time intervals. - The amount of time to delay before the invoking the callback method specified when the was constructed, in milliseconds. Specify to prevent the timer from restarting. Specify zero (0) to restart the timer immediately. - The time interval between invocations of the callback method specified when the was constructed, in milliseconds. Specify to disable periodic signaling. - true if the timer was successfully updated; otherwise, false. - The has already been disposed. - The dueTime or period parameter is negative and is not equal to . - - - Changes the start time and the interval between method invocations for a timer, using 64-bit signed integers to measure time intervals. - The amount of time to delay before the invoking the callback method specified when the was constructed, in milliseconds. Specify to prevent the timer from restarting. Specify zero (0) to restart the timer immediately. - The time interval between invocations of the callback method specified when the was constructed, in milliseconds. Specify to disable periodic signaling. - true if the timer was successfully updated; otherwise, false. - The has already been disposed. - The dueTime or period parameter is less than -1. - The dueTime or period parameter is greater than 4294967294. - - - Changes the start time and the interval between method invocations for a timer, using values to measure time intervals. - A representing the amount of time to delay before invoking the callback method specified when the was constructed. Specify negative one (-1) milliseconds to prevent the timer from restarting. Specify zero (0) to restart the timer immediately. - The time interval between invocations of the callback method specified when the was constructed. Specify negative one (-1) milliseconds to disable periodic signaling. - true if the timer was successfully updated; otherwise, false. - The has already been disposed. - The dueTime or period parameter, in milliseconds, is less than -1. - The dueTime or period parameter, in milliseconds, is greater than 4294967294. - - - Changes the start time and the interval between method invocations for a timer, using 32-bit unsigned integers to measure time intervals. - The amount of time to delay before the invoking the callback method specified when the was constructed, in milliseconds. Specify to prevent the timer from restarting. Specify zero (0) to restart the timer immediately. - The time interval between invocations of the callback method specified when the was constructed, in milliseconds. Specify to disable periodic signaling. - true if the timer was successfully updated; otherwise, false. - The has already been disposed. - - - Releases all resources used by the current instance of . - - - Releases all resources used by the current instance of and signals when the timer has been disposed of. - The to be signaled when the Timer has been disposed of. - true if the function succeeds; otherwise, false. - The notifyObject parameter is null. - - - Represents the method that handles calls from a . - An object containing application-specific information relevant to the method invoked by this delegate, or null. - - - Contains methods for performing volatile memory operations. - - - Reads the value of the specified field. On systems that require it, inserts a memory barrier that prevents the processor from reordering memory operations as follows: If a read or write appears after this method in the code, the processor cannot move it before this method. - The field to read. - The value that was read. This value is the latest written by any processor in the computer, regardless of the number of processors or the state of processor cache. - - - Reads the value of the specified field. On systems that require it, inserts a memory barrier that prevents the processor from reordering memory operations as follows: If a read or write appears after this method in the code, the processor cannot move it before this method. - The field to read. - The value that was read. This value is the latest written by any processor in the computer, regardless of the number of processors or the state of processor cache. - - - Reads the value of the specified field. On systems that require it, inserts a memory barrier that prevents the processor from reordering memory operations as follows: If a read or write appears after this method in the code, the processor cannot move it before this method. - The field to read. - The value that was read. This value is the latest written by any processor in the computer, regardless of the number of processors or the state of processor cache. - - - Reads the value of the specified field. On systems that require it, inserts a memory barrier that prevents the processor from reordering memory operations as follows: If a read or write appears after this method in the code, the processor cannot move it before this method. - The field to read. - The value that was read. This value is the latest written by any processor in the computer, regardless of the number of processors or the state of processor cache. - - - Reads the value of the specified field. On systems that require it, inserts a memory barrier that prevents the processor from reordering memory operations as follows: If a read or write appears after this method in the code, the processor cannot move it before this method. - The field to read. - The value that was read. This value is the latest written by any processor in the computer, regardless of the number of processors or the state of processor cache. - - - Reads the value of the specified field. On systems that require it, inserts a memory barrier that prevents the processor from reordering memory operations as follows: If a read or write appears after this method in the code, the processor cannot move it before this method. - The field to read. - The value that was read. This value is the latest written by any processor in the computer, regardless of the number of processors or the state of processor cache. - - - Reads the value of the specified field. On systems that require it, inserts a memory barrier that prevents the processor from reordering memory operations as follows: If a read or write appears after this method in the code, the processor cannot move it before this method. - The field to read. - The value that was read. This value is the latest written by any processor in the computer, regardless of the number of processors or the state of processor cache. - - - Reads the value of the specified field. On systems that require it, inserts a memory barrier that prevents the processor from reordering memory operations as follows: If a read or write appears after this method in the code, the processor cannot move it before this method. - The field to read. - The value that was read. This value is the latest written by any processor in the computer, regardless of the number of processors or the state of processor cache. - - - Reads the value of the specified field. On systems that require it, inserts a memory barrier that prevents the processor from reordering memory operations as follows: If a read or write appears after this method in the code, the processor cannot move it before this method. - The field to read. - The value that was read. This value is the latest written by any processor in the computer, regardless of the number of processors or the state of processor cache. - - - Reads the value of the specified field. On systems that require it, inserts a memory barrier that prevents the processor from reordering memory operations as follows: If a read or write appears after this method in the code, the processor cannot move it before this method. - The field to read. - The value that was read. This value is the latest written by any processor in the computer, regardless of the number of processors or the state of processor cache. - - - Reads the value of the specified field. On systems that require it, inserts a memory barrier that prevents the processor from reordering memory operations as follows: If a read or write appears after this method in the code, the processor cannot move it before this method. - The field to read. - The value that was read. This value is the latest written by any processor in the computer, regardless of the number of processors or the state of processor cache. - - - Reads the value of the specified field. On systems that require it, inserts a memory barrier that prevents the processor from reordering memory operations as follows: If a read or write appears after this method in the code, the processor cannot move it before this method. - The field to read. - The value that was read. This value is the latest written by any processor in the computer, regardless of the number of processors or the state of processor cache. - - - Reads the value of the specified field. On systems that require it, inserts a memory barrier that prevents the processor from reordering memory operations as follows: If a read or write appears after this method in the code, the processor cannot move it before this method. - The field to read. - The value that was read. This value is the latest written by any processor in the computer, regardless of the number of processors or the state of processor cache. - - - Reads the object reference from the specified field. On systems that require it, inserts a memory barrier that prevents the processor from reordering memory operations as follows: If a read or write appears after this method in the code, the processor cannot move it before this method. - The field to read. - The type of field to read. This must be a reference type, not a value type. - The reference to T that was read. This reference is the latest written by any processor in the computer, regardless of the number of processors or the state of processor cache. - - - Writes the specified value to the specified field. On systems that require it, inserts a memory barrier that prevents the processor from reordering memory operations as follows: If a read or write appears before this method in the code, the processor cannot move it after this method. - The field where the value is written. - The value to write. The value is written immediately so that it is visible to all processors in the computer. - - - Writes the specified value to the specified field. On systems that require it, inserts a memory barrier that prevents the processor from reordering memory operations as follows: If a read or write appears before this method in the code, the processor cannot move it after this method. - The field where the value is written. - The value to write. The value is written immediately so that it is visible to all processors in the computer. - - - Writes the specified value to the specified field. On systems that require it, inserts a memory barrier that prevents the processor from reordering memory operations as follows: If a read or write appears before this method in the code, the processor cannot move it after this method. - The field where the value is written. - The value to write. The value is written immediately so that it is visible to all processors in the computer. - - - Writes the specified value to the specified field. On systems that require it, inserts a memory barrier that prevents the processor from reordering memory operations as follows: If a read or write appears before this method in the code, the processor cannot move it after this method. - The field where the value is written. - The value to write. The value is written immediately so that it is visible to all processors in the computer. - - - Writes the specified value to the specified field. On systems that require it, inserts a memory barrier that prevents the processor from reordering memory operations as follows: If a read or write appears before this method in the code, the processor cannot move it after this method. - The field where the value is written. - The value to write. The value is written immediately so that it is visible to all processors in the computer. - - - Writes the specified value to the specified field. On systems that require it, inserts a memory barrier that prevents the processor from reordering memory operations as follows: If a memory operation appears before this method in the code, the processor cannot move it after this method. - The field where the value is written. - The value to write. The value is written immediately so that it is visible to all processors in the computer. - - - Writes the specified value to the specified field. On systems that require it, inserts a memory barrier that prevents the processor from reordering memory operations as follows: If a read or write appears before this method in the code, the processor cannot move it after this method. - The field where the value is written. - The value to write. The value is written immediately so that it is visible to all processors in the computer. - - - Writes the specified value to the specified field. On systems that require it, inserts a memory barrier that prevents the processor from reordering memory operations as follows: If a read or write appears before this method in the code, the processor cannot move it after this method. - The field where the value is written. - The value to write. The value is written immediately so that it is visible to all processors in the computer. - - - Writes the specified value to the specified field. On systems that require it, inserts a memory barrier that prevents the processor from reordering memory operations as follows: If a read or write appears before this method in the code, the processor cannot move it after this method. - The field where the value is written. - The value to write. The value is written immediately so that it is visible to all processors in the computer. - - - Writes the specified value to the specified field. On systems that require it, inserts a memory barrier that prevents the processor from reordering memory operations as follows: If a read or write appears before this method in the code, the processor cannot move it after this method. - The field where the value is written. - The value to write. The value is written immediately so that it is visible to all processors in the computer. - - - Writes the specified value to the specified field. On systems that require it, inserts a memory barrier that prevents the processor from reordering memory operations as follows: If a read or write appears before this method in the code, the processor cannot move it after this method. - The field where the value is written. - The value to write. The value is written immediately so that it is visible to all processors in the computer. - - - Writes the specified value to the specified field. On systems that require it, inserts a memory barrier that prevents the processor from reordering memory operations as follows: If a read or write appears before this method in the code, the processor cannot move it after this method. - The field where the value is written. - The value to write. The value is written immediately so that it is visible to all processors in the computer. - - - Writes the specified value to the specified field. On systems that require it, inserts a memory barrier that prevents the processor from reordering memory operations as follows: If a read or write appears before this method in the code, the processor cannot move it after this method. - The field where the value is written. - The value to write. The value is written immediately so that it is visible to all processors in the computer. - - - Writes the specified object reference to the specified field. On systems that require it, inserts a memory barrier that prevents the processor from reordering memory operations as follows: If a read or write appears before this method in the code, the processor cannot move it after this method. - The field where the object reference is written. - The object reference to write. The reference is written immediately so that it is visible to all processors in the computer. - The type of field to write. This must be a reference type, not a value type. - - - Represents an XML qualified name. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with the specified name. - The local name to use as the name of the object. - - - Initializes a new instance of the class with the specified name and namespace. - The local name to use as the name of the object. - The namespace for the object. - - - Provides an empty . - - - - Determines whether the specified object is equal to the current object. - The to compare. - true if the two are the same instance object; otherwise, false. - - - Returns the hash code for the . - A hash code for this object. - - - Gets a value indicating whether the is empty. - true if name and namespace are empty strings; otherwise, false. - - - Gets a string representation of the qualified name of the . - A string representation of the qualified name or String.Empty if a name is not defined for the object. - - - Gets a string representation of the namespace of the . - A string representation of the namespace or String.Empty if a namespace is not defined for the object. - - - Compares two objects. - An to compare. - An to compare. - true if the two objects have the same name and namespace values; otherwise, false. - - - Compares two objects. - An to compare. - An to compare. - true if the name and namespace values for the two objects differ; otherwise, false. - - - Returns the string value of the . - The string value of the in the format of namespace:localname. If the object does not have a namespace defined, this method returns just the local name. - - - Returns the string value of the . - The name of the object. - The namespace of the object. - The string value of the in the format of namespace:localname. If the object does not have a namespace defined, this method returns just the local name. - - - Represents a reader that provides fast, noncached, forward-only access to XML data. - - - Initializes a new instance of the XmlReader class. - - - When overridden in a derived class, gets the number of attributes on the current node. - The number of attributes on the current node. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - - - When overridden in a derived class, gets the base URI of the current node. - The base URI of the current node. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - - - Gets a value indicating whether the implements the binary content read methods. - true if the binary content read methods are implemented; otherwise false. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - - - Gets a value indicating whether the implements the method. - true if the implements the method; otherwise false. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - - - Gets a value indicating whether this reader can parse and resolve entities. - true if the reader can parse and resolve entities; otherwise, false. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - - - When overridden in a derived class, changes the to . - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - - - Creates a new instance by using the specified URI, settings, and context information for parsing. - The URI for the file containing the XML data. The object on the object is used to convert the path to a canonical data representation. If is null, a new object is used. - The settings for the new instance. This value can be null. - The context information required to parse the XML fragment. The context information can include the to use, encoding, namespace scope, the current xml:lang and xml:space scope, base URI, and document type definition. This value can be null. - An object that is used to read the XML data in the stream. - The inputUri value is null. - The does not have sufficient permissions to access the location of the XML data. - The and properties both contain values. (Only one of these NameTable properties can be set and used). - The file specified by the URI cannot be found. - The URI format is not correct. - - - Creates a new instance by using the specified text reader, settings, and context information for parsing. - The text reader from which to read the XML data. A text reader returns a stream of Unicode characters, so the encoding specified in the XML declaration isn't used by the XML reader to decode the data stream. - The settings for the new instance. This value can be null. - The context information required to parse the XML fragment. The context information can include the to use, encoding, namespace scope, the current xml:lang and xml:space scope, base URI, and document type definition. This value can be null. - An object that is used to read the XML data in the stream. - The input value is null. - The and properties both contain values. (Only one of these NameTable properties can be set and used). - - - Creates a new instance by using the specified text reader, settings, and base URI. - The text reader from which to read the XML data. A text reader returns a stream of Unicode characters, so the encoding specified in the XML declaration isn't used by the to decode the data stream. - The settings for the new instance. This value can be null. - The base URI for the entity or document being read. This value can be null. Security Note The base URI is used to resolve the relative URI of the XML document. Do not use a base URI from an untrusted source. - An object that is used to read the XML data in the stream. - The input value is null. - - - Creates a new instance using the specified stream, base URI, and settings. - The stream that contains the XML data. The scans the first bytes of the stream looking for a byte order mark or other sign of encoding. When encoding is determined, the encoding is used to continue reading the stream, and processing continues parsing the input as a stream of (Unicode) characters. - The settings for the new instance. This value can be null. - The base URI for the entity or document being read. This value can be null. Security Note The base URI is used to resolve the relative URI of the XML document. Do not use a base URI from an untrusted source. - An object that is used to read the XML data in the stream. - The input value is null. - - - Creates a new instance by using the specified XML reader and settings. - The object that you want to use as the underlying XML reader. - The settings for the new instance. The conformance level of the object must either match the conformance level of the underlying reader, or it must be set to . - An object that is wrapped around the specified object. - The reader value is null. - If the object specifies a conformance level that is not consistent with conformance level of the underlying reader. -or- The underlying is in an or state. - - - Creates a new instance using the specified stream, settings, and context information for parsing. - The stream that contains the XML data. The scans the first bytes of the stream looking for a byte order mark or other sign of encoding. When encoding is determined, the encoding is used to continue reading the stream, and processing continues parsing the input as a stream of (Unicode) characters. - The settings for the new instance. This value can be null. - The context information required to parse the XML fragment. The context information can include the to use, encoding, namespace scope, the current xml:lang and xml:space scope, base URI, and document type definition. This value can be null. - An object that is used to read the XML data in the stream. - The input value is null. - - - Creates a new instance by using the specified text reader and settings. - The text reader from which to read the XML data. A text reader returns a stream of Unicode characters, so the encoding specified in the XML declaration isn't used by the XML reader to decode the data stream. - The settings for the new . This value can be null. - An object that is used to read the XML data in the stream. - The input value is null. - - - Creates a new instance with the specified stream and settings. - The stream that contains the XML data. The scans the first bytes of the stream looking for a byte order mark or other sign of encoding. When encoding is determined, the encoding is used to continue reading the stream, and processing continues parsing the input as a stream of (Unicode) characters. - The settings for the new instance. This value can be null. - An object that is used to read the XML data in the stream. - The input value is null. - - - Creates a new instance by using the specified URI and settings. - The URI for the file containing the XML data. The object on the object is used to convert the path to a canonical data representation. If is null, a new object is used. - The settings for the new instance. This value can be null. - An object that is used to read the XML data in the stream. - The inputUri value is null. - The file specified by the URI cannot be found. - - In the [.NET for Windows Store apps](http://go.microsoft.com/fwlink/?LinkID=247912) or the [Portable Class Library](~/docs/standard/cross-platform/cross-platform-development-with-the-portable-class-library.md), catch the base class exception, , instead. - - The URI format is not correct. - - - Creates a new instance with specified URI. - The URI for the file that contains the XML data. The class is used to convert the path to a canonical data representation. - An object that is used to read the XML data in the stream. - The inputUri value is null. - The does not have sufficient permissions to access the location of the XML data. - The file identified by the URI does not exist. - - In the [.NET for Windows Store apps](http://go.microsoft.com/fwlink/?LinkID=247912) or the [Portable Class Library](~/docs/standard/cross-platform/cross-platform-development-with-the-portable-class-library.md), catch the base class exception, , instead. - - The URI format is not correct. - - - Creates a new instance by using the specified text reader. - The text reader from which to read the XML data. A text reader returns a stream of Unicode characters, so the encoding specified in the XML declaration is not used by the XML reader to decode the data stream. - An object that is used to read the XML data in the stream. - The input value is null. - - - Creates a new instance using the specified stream with default settings. - The stream that contains the XML data. The scans the first bytes of the stream looking for a byte order mark or other sign of encoding. When encoding is determined, the encoding is used to continue reading the stream, and processing continues parsing the input as a stream of (Unicode) characters. - An object that is used to read the XML data in the stream. - The input value is null. - The does not have sufficient permissions to access the location of the XML data. - - - When overridden in a derived class, gets the depth of the current node in the XML document. - The depth of the current node in the XML document. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - - - Releases all resources used by the current instance of the class. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - - - Releases the unmanaged resources used by the and optionally releases the managed resources. - true to release both managed and unmanaged resources; false to release only unmanaged resources. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - - - When overridden in a derived class, gets a value indicating whether the reader is positioned at the end of the stream. - true if the reader is positioned at the end of the stream; otherwise, false. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - - - When overridden in a derived class, gets the value of the attribute with the specified index. - The index of the attribute. The index is zero-based. (The first attribute has index 0.) - The value of the specified attribute. This method does not move the reader. - i is out of range. It must be non-negative and less than the size of the attribute collection. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - - - When overridden in a derived class, gets the value of the attribute with the specified . - The qualified name of the attribute. - The value of the specified attribute. If the attribute is not found or the value is String.Empty, null is returned. - name is null. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - - - When overridden in a derived class, gets the value of the attribute with the specified and . - The local name of the attribute. - The namespace URI of the attribute. - The value of the specified attribute. If the attribute is not found or the value is String.Empty, null is returned. This method does not move the reader. - name is null. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - - - Asynchronously gets the value of the current node. - The value of the current node. - An asynchronous method was called without setting the flag to true. In this case, is thrown with the message "Set XmlReaderSettings.Async to true if you want to use Async Methods." - - - Gets a value indicating whether the current node has any attributes. - true if the current node has attributes; otherwise, false. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - - - When overridden in a derived class, gets a value indicating whether the current node can have a . - true if the node on which the reader is currently positioned can have a Value; otherwise, false. If false, the node has a value of String.Empty. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - - - When overridden in a derived class, gets a value indicating whether the current node is an attribute that was generated from the default value defined in the DTD or schema. - true if the current node is an attribute whose value was generated from the default value defined in the DTD or schema; false if the attribute value was explicitly set. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - - - When overridden in a derived class, gets a value indicating whether the current node is an empty element (for example, ). - true if the current node is an element ( equals XmlNodeType.Element) that ends with />; otherwise, false. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - - - Returns a value indicating whether the string argument is a valid XML name. - The name to validate. - true if the name is valid; otherwise, false. - The str value is null. - - - Returns a value indicating whether or not the string argument is a valid XML name token. - The name token to validate. - true if it is a valid name token; otherwise false. - The str value is null. - - - Calls and tests if the current content node is a start tag or empty element tag. - true if finds a start tag or empty element tag; false if a node type other than XmlNodeType.Element was found. - Incorrect XML is encountered in the input stream. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - - - Calls and tests if the current content node is a start tag or empty element tag and if the property of the element found matches the given argument. - The string matched against the Name property of the element found. - true if the resulting node is an element and the Name property matches the specified string. false if a node type other than XmlNodeType.Element was found or if the element Name property does not match the specified string. - Incorrect XML is encountered in the input stream. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - - - Calls and tests if the current content node is a start tag or empty element tag and if the and properties of the element found match the given strings. - The string to match against the LocalName property of the element found. - The string to match against the NamespaceURI property of the element found. - true if the resulting node is an element. false if a node type other than XmlNodeType.Element was found or if the LocalName and NamespaceURI properties of the element do not match the specified strings. - Incorrect XML is encountered in the input stream. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - - - When overridden in a derived class, gets the value of the attribute with the specified index. - The index of the attribute. - The value of the specified attribute. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - - - When overridden in a derived class, gets the value of the attribute with the specified . - The qualified name of the attribute. - The value of the specified attribute. If the attribute is not found, null is returned. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - - - When overridden in a derived class, gets the value of the attribute with the specified and . - The local name of the attribute. - The namespace URI of the attribute. - The value of the specified attribute. If the attribute is not found, null is returned. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - - - When overridden in a derived class, gets the local name of the current node. - The name of the current node with the prefix removed. For example, LocalName is book for the element <bk:book>. For node types that do not have a name (like Text, Comment, and so on), this property returns String.Empty. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - - - When overridden in a derived class, resolves a namespace prefix in the current element's scope. - The prefix whose namespace URI you want to resolve. To match the default namespace, pass an empty string. - The namespace URI to which the prefix maps or null if no matching prefix is found. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - - - When overridden in a derived class, moves to the attribute with the specified index. - The index of the attribute. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - The parameter has a negative value. - - - When overridden in a derived class, moves to the attribute with the specified . - The qualified name of the attribute. - true if the attribute is found; otherwise, false. If false, the reader's position does not change. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - The parameter is an empty string. - - - When overridden in a derived class, moves to the attribute with the specified and . - The local name of the attribute. - The namespace URI of the attribute. - true if the attribute is found; otherwise, false. If false, the reader's position does not change. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - Both parameter values are null. - - - Checks whether the current node is a content (non-white space text, CDATA, Element, EndElement, EntityReference, or EndEntity) node. If the node is not a content node, the reader skips ahead to the next content node or end of file. It skips over nodes of the following type: ProcessingInstruction, DocumentType, Comment, Whitespace, or SignificantWhitespace. - The of the current node found by the method or XmlNodeType.None if the reader has reached the end of the input stream. - Incorrect XML encountered in the input stream. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - - - Asynchronously checks whether the current node is a content node. If the node is not a content node, the reader skips ahead to the next content node or end of file. - The of the current node found by the method or XmlNodeType.None if the reader has reached the end of the input stream. - An asynchronous method was called without setting the flag to true. In this case, is thrown with the message "Set XmlReaderSettings.Async to true if you want to use Async Methods." - - - When overridden in a derived class, moves to the element that contains the current attribute node. - true if the reader is positioned on an attribute (the reader moves to the element that owns the attribute); false if the reader is not positioned on an attribute (the position of the reader does not change). - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - - - When overridden in a derived class, moves to the first attribute. - true if an attribute exists (the reader moves to the first attribute); otherwise, false (the position of the reader does not change). - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - - - When overridden in a derived class, moves to the next attribute. - true if there is a next attribute; false if there are no more attributes. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - - - When overridden in a derived class, gets the qualified name of the current node. -

The qualified name of the current node. For example, Name is bk:book for the element <bk:book>.

-

The name returned is dependent on the of the node. The following node types return the listed values. All other node types return an empty string.

-
Node type

-

Name

-

Attribute The name of the attribute.

-

DocumentType The document type name.

-

Element The tag name.

-

EntityReference The name of the entity referenced.

-

ProcessingInstruction The target of the processing instruction.

-

XmlDeclaration The literal string xml.

-

-
- An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." -
- - When overridden in a derived class, gets the namespace URI (as defined in the W3C Namespace specification) of the node on which the reader is positioned. - The namespace URI of the current node; otherwise an empty string. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - - - When overridden in a derived class, gets the associated with this implementation. - The XmlNameTable enabling you to get the atomized version of a string within the node. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - - - When overridden in a derived class, gets the type of the current node. - One of the enumeration values that specify the type of the current node. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - - - When overridden in a derived class, gets the namespace prefix associated with the current node. - The namespace prefix associated with the current node. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - - - When overridden in a derived class, gets the quotation mark character used to enclose the value of an attribute node. - The quotation mark character (" or ') used to enclose the value of an attribute node. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - - - When overridden in a derived class, reads the next node from the stream. - true if the next node was read successfully; otherwise, false. - An error occurred while parsing the XML. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - - - Asynchronously reads the next node from the stream. - true if the next node was read successfully; false if there are no more nodes to read. - An asynchronous method was called without setting the flag to true. In this case, is thrown with the message "Set XmlReaderSettings.Async to true if you want to use Async Methods." - - - When overridden in a derived class, parses the attribute value into one or more Text, EntityReference, or EndEntity nodes. - true if there are nodes to return. false if the reader is not positioned on an attribute node when the initial call is made or if all the attribute values have been read. An empty attribute, such as, misc="", returns true with a single node with a value of String.Empty. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - - - Reads the content as an object of the type specified. - The type of the value to be returned. Note With the release of the .NET Framework 3.5, the value of the returnType parameter can now be the type. - An object that is used to resolve any namespace prefixes related to type conversion. For example, this can be used when converting an object to an xs:string. This value can be null. - The concatenated text content or attribute value converted to the requested type. - The content is not in the correct format for the target type. - The attempted cast is not valid. - The returnType value is null. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - Read Decimal.MaxValue. - - - Asynchronously reads the content as an object of the type specified. - The type of the value to be returned. - An object that is used to resolve any namespace prefixes related to type conversion. - The concatenated text content or attribute value converted to the requested type. - An asynchronous method was called without setting the flag to true. In this case, is thrown with the message "Set XmlReaderSettings.Async to true if you want to use Async Methods." - - - Reads the content and returns the Base64 decoded binary bytes. - The buffer into which to copy the resulting text. This value cannot be null. - The offset into the buffer where to start copying the result. - The maximum number of bytes to copy into the buffer. The actual number of bytes copied is returned from this method. - The number of bytes written to the buffer. - The buffer value is null. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - The index into the buffer or index + count is larger than the allocated buffer size. - The implementation does not support this method. - - - Asynchronously reads the content and returns the Base64 decoded binary bytes. - The buffer into which to copy the resulting text. This value cannot be null. - The offset into the buffer where to start copying the result. - The maximum number of bytes to copy into the buffer. The actual number of bytes copied is returned from this method. - The number of bytes written to the buffer. - An asynchronous method was called without setting the flag to true. In this case, is thrown with the message "Set XmlReaderSettings.Async to true if you want to use Async Methods." - - - Reads the content and returns the BinHex decoded binary bytes. - The buffer into which to copy the resulting text. This value cannot be null. - The offset into the buffer where to start copying the result. - The maximum number of bytes to copy into the buffer. The actual number of bytes copied is returned from this method. - The number of bytes written to the buffer. - The buffer value is null. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - The index into the buffer or index + count is larger than the allocated buffer size. - The implementation does not support this method. - - - Asynchronously reads the content and returns the BinHex decoded binary bytes. - The buffer into which to copy the resulting text. This value cannot be null. - The offset into the buffer where to start copying the result. - The maximum number of bytes to copy into the buffer. The actual number of bytes copied is returned from this method. - The number of bytes written to the buffer. - An asynchronous method was called without setting the flag to true. In this case, is thrown with the message "Set XmlReaderSettings.Async to true if you want to use Async Methods." - - - Reads the text content at the current position as a Boolean. - The text content as a object. - The attempted cast is not valid. - The string format is not valid. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - - - Reads the text content at the current position as a object. - The text content as a object. - The attempted cast is not valid. - The string format is not valid. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - - - Reads the text content at the current position as a object. - The text content as a object. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - - - Reads the text content at the current position as a object. - The text content at the current position as a object. - The attempted cast is not valid. - The string format is not valid. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - - - Reads the text content at the current position as a double-precision floating-point number. - The text content as a double-precision floating-point number. - The attempted cast is not valid. - The string format is not valid. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - - - Reads the text content at the current position as a single-precision floating point number. - The text content at the current position as a single-precision floating point number. - The attempted cast is not valid. - The string format is not valid. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - - - Reads the text content at the current position as a 32-bit signed integer. - The text content as a 32-bit signed integer. - The attempted cast is not valid. - The string format is not valid. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - - - Reads the text content at the current position as a 64-bit signed integer. - The text content as a 64-bit signed integer. - The attempted cast is not valid. - The string format is not valid. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - - - Reads the text content at the current position as an . - The text content as the most appropriate common language runtime (CLR) object. - The attempted cast is not valid. - The string format is not valid. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - - - Asynchronously reads the text content at the current position as an . - The text content as the most appropriate common language runtime (CLR) object. - An asynchronous method was called without setting the flag to true. In this case, is thrown with the message "Set XmlReaderSettings.Async to true if you want to use Async Methods." - - - Reads the text content at the current position as a object. - The text content as a object. - The attempted cast is not valid. - The string format is not valid. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - - - Asynchronously reads the text content at the current position as a object. - The text content as a object. - An asynchronous method was called without setting the flag to true. In this case, is thrown with the message "Set XmlReaderSettings.Async to true if you want to use Async Methods." - - - Reads the element content as the requested type. - The type of the value to be returned. Note With the release of the .NET Framework 3.5, the value of the returnType parameter can now be the type. - An object that is used to resolve any namespace prefixes related to type conversion. - The element content converted to the requested typed object. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - The current element contains child elements. -or- The element content cannot be converted to the requested type. - The method is called with null arguments. - Read Decimal.MaxValue. - - - Checks that the specified local name and namespace URI matches that of the current element, then reads the element content as the requested type. - The type of the value to be returned. Note With the release of the .NET Framework 3.5, the value of the returnType parameter can now be the type. - An object that is used to resolve any namespace prefixes related to type conversion. - The local name of the element. - The namespace URI of the element. - The element content converted to the requested typed object. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - The current element contains child elements. -or- The element content cannot be converted to the requested type. - The method is called with null arguments. - The specified local name and namespace URI do not match that of the current element being read. - Read Decimal.MaxValue. - - - Asynchronously reads the element content as the requested type. - The type of the value to be returned. - An object that is used to resolve any namespace prefixes related to type conversion. - The element content converted to the requested typed object. - An asynchronous method was called without setting the flag to true. In this case, is thrown with the message "Set XmlReaderSettings.Async to true if you want to use Async Methods." - - - Reads the element and decodes the Base64 content. - The buffer into which to copy the resulting text. This value cannot be null. - The offset into the buffer where to start copying the result. - The maximum number of bytes to copy into the buffer. The actual number of bytes copied is returned from this method. - The number of bytes written to the buffer. - The buffer value is null. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - The index into the buffer or index + count is larger than the allocated buffer size. - The implementation does not support this method. - The element contains mixed-content. - The content cannot be converted to the requested type. - - - Asynchronously reads the element and decodes the Base64 content. - The buffer into which to copy the resulting text. This value cannot be null. - The offset into the buffer where to start copying the result. - The maximum number of bytes to copy into the buffer. The actual number of bytes copied is returned from this method. - The number of bytes written to the buffer. - An asynchronous method was called without setting the flag to true. In this case, is thrown with the message "Set XmlReaderSettings.Async to true if you want to use Async Methods." - - - Reads the element and decodes the BinHex content. - The buffer into which to copy the resulting text. This value cannot be null. - The offset into the buffer where to start copying the result. - The maximum number of bytes to copy into the buffer. The actual number of bytes copied is returned from this method. - The number of bytes written to the buffer. - The buffer value is null. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - The index into the buffer or index + count is larger than the allocated buffer size. - The implementation does not support this method. - The element contains mixed-content. - The content cannot be converted to the requested type. - - - Asynchronously reads the element and decodes the BinHex content. - The buffer into which to copy the resulting text. This value cannot be null. - The offset into the buffer where to start copying the result. - The maximum number of bytes to copy into the buffer. The actual number of bytes copied is returned from this method. - The number of bytes written to the buffer. - An asynchronous method was called without setting the flag to true. In this case, is thrown with the message "Set XmlReaderSettings.Async to true if you want to use Async Methods." - - - Checks that the specified local name and namespace URI matches that of the current element, then reads the current element and returns the contents as a object. - The local name of the element. - The namespace URI of the element. - The element content as a object. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - The current element contains child elements. -or- The element content cannot be converted to the requested type. - The method is called with null arguments. - The specified local name and namespace URI do not match that of the current element being read. - - - Reads the current element and returns the contents as a object. - The element content as a object. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - The current element contains child elements. -or- The element content cannot be converted to a object. - The method is called with null arguments. - - - Reads the current element and returns the contents as a object. - The element content as a object. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - The current element contains child elements. -or- The element content cannot be converted to a object. - The method is called with null arguments. - - - Checks that the specified local name and namespace URI matches that of the current element, then reads the current element and returns the contents as a object. - The local name of the element. - The namespace URI of the element. - The element contents as a object. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - The current element contains child elements. -or- The element content cannot be converted to the requested type. - The method is called with null arguments. - The specified local name and namespace URI do not match that of the current element being read. - - - Reads the current element and returns the contents as a object. - The element content as a object. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - The current element contains child elements. -or- The element content cannot be converted to a . - The method is called with null arguments. - - - Checks that the specified local name and namespace URI matches that of the current element, then reads the current element and returns the contents as a object. - The local name of the element. - The namespace URI of the element. - The element content as a object. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - The current element contains child elements. -or- The element content cannot be converted to a . - The method is called with null arguments. - The specified local name and namespace URI do not match that of the current element being read. - - - Reads the current element and returns the contents as a double-precision floating-point number. - The element content as a double-precision floating-point number. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - The current element contains child elements. -or- The element content cannot be converted to a double-precision floating-point number. - The method is called with null arguments. - - - Checks that the specified local name and namespace URI matches that of the current element, then reads the current element and returns the contents as a double-precision floating-point number. - The local name of the element. - The namespace URI of the element. - The element content as a double-precision floating-point number. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - The current element contains child elements. -or- The element content cannot be converted to the requested type. - The method is called with null arguments. - The specified local name and namespace URI do not match that of the current element being read. - - - Reads the current element and returns the contents as single-precision floating-point number. - The element content as a single-precision floating point number. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - The current element contains child elements. -or- The element content cannot be converted to a single-precision floating-point number. - The method is called with null arguments. - - - Checks that the specified local name and namespace URI matches that of the current element, then reads the current element and returns the contents as a single-precision floating-point number. - The local name of the element. - The namespace URI of the element. - The element content as a single-precision floating point number. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - The current element contains child elements. -or- The element content cannot be converted to a single-precision floating-point number. - The method is called with null arguments. - The specified local name and namespace URI do not match that of the current element being read. - - - Reads the current element and returns the contents as a 32-bit signed integer. - The element content as a 32-bit signed integer. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - The current element contains child elements. -or- The element content cannot be converted to a 32-bit signed integer. - The method is called with null arguments. - - - Checks that the specified local name and namespace URI matches that of the current element, then reads the current element and returns the contents as a 32-bit signed integer. - The local name of the element. - The namespace URI of the element. - The element content as a 32-bit signed integer. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - The current element contains child elements. -or- The element content cannot be converted to a 32-bit signed integer. - The method is called with null arguments. - The specified local name and namespace URI do not match that of the current element being read. - - - Reads the current element and returns the contents as a 64-bit signed integer. - The element content as a 64-bit signed integer. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - The current element contains child elements. -or- The element content cannot be converted to a 64-bit signed integer. - The method is called with null arguments. - - - Checks that the specified local name and namespace URI matches that of the current element, then reads the current element and returns the contents as a 64-bit signed integer. - The local name of the element. - The namespace URI of the element. - The element content as a 64-bit signed integer. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - The current element contains child elements. -or- The element content cannot be converted to a 64-bit signed integer. - The method is called with null arguments. - The specified local name and namespace URI do not match that of the current element being read. - - - Reads the current element and returns the contents as an . - A boxed common language runtime (CLR) object of the most appropriate type. The property determines the appropriate CLR type. If the content is typed as a list type, this method returns an array of boxed objects of the appropriate type. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - The current element contains child elements. -or- The element content cannot be converted to the requested type - The method is called with null arguments. - - - Checks that the specified local name and namespace URI matches that of the current element, then reads the current element and returns the contents as an . - The local name of the element. - The namespace URI of the element. - A boxed common language runtime (CLR) object of the most appropriate type. The property determines the appropriate CLR type. If the content is typed as a list type, this method returns an array of boxed objects of the appropriate type. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - The current element contains child elements. -or- The element content cannot be converted to the requested type. - The method is called with null arguments. - The specified local name and namespace URI do not match that of the current element being read. - - - Asynchronously reads the current element and returns the contents as an . - A boxed common language runtime (CLR) object of the most appropriate type. The property determines the appropriate CLR type. If the content is typed as a list type, this method returns an array of boxed objects of the appropriate type. - An asynchronous method was called without setting the flag to true. In this case, is thrown with the message "Set XmlReaderSettings.Async to true if you want to use Async Methods." - - - Checks that the specified local name and namespace URI matches that of the current element, then reads the current element and returns the contents as a object. - The local name of the element. - The namespace URI of the element. - The element content as a object. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - The current element contains child elements. -or- The element content cannot be converted to a object. - The method is called with null arguments. - The specified local name and namespace URI do not match that of the current element being read. - - - Reads the current element and returns the contents as a object. - The element content as a object. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - The current element contains child elements. -or- The element content cannot be converted to a object. - The method is called with null arguments. - - - Asynchronously reads the current element and returns the contents as a object. - The element content as a object. - An asynchronous method was called without setting the flag to true. In this case, is thrown with the message "Set XmlReaderSettings.Async to true if you want to use Async Methods." - - - Reads a text-only element. However, we recommend that you use the method instead, because it provides a more straightforward way to handle this operation. - The text contained in the element that was read. An empty string if the element is empty. - The next content node is not a start tag; or the element found does not contain a simple text value. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - - - Checks that the property of the element found matches the given string before reading a text-only element. However, we recommend that you use the method instead, because it provides a more straightforward way to handle this operation. - The name to check. - The text contained in the element that was read. An empty string if the element is empty. - If the next content node is not a start tag; if the element Name does not match the given argument; or if the element found does not contain a simple text value. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - - - Checks that the and properties of the element found matches the given strings before reading a text-only element. However, we recommend that you use the method instead, because it provides a more straightforward way to handle this operation. - The local name to check. - The namespace URI to check. - The text contained in the element that was read. An empty string if the element is empty. - If the next content node is not a start tag; if the element LocalName or NamespaceURI do not match the given arguments; or if the element found does not contain a simple text value. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - - - Checks that the current content node is an end tag and advances the reader to the next node. - The current node is not an end tag or if incorrect XML is encountered in the input stream. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - - - When overridden in a derived class, reads all the content, including markup, as a string. - All the XML content, including markup, in the current node. If the current node has no children, an empty string is returned. If the current node is neither an element nor attribute, an empty string is returned. - The XML was not well-formed, or an error occurred while parsing the XML. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - - - Asynchronously reads all the content, including markup, as a string. - All the XML content, including markup, in the current node. If the current node has no children, an empty string is returned. - An asynchronous method was called without setting the flag to true. In this case, is thrown with the message "Set XmlReaderSettings.Async to true if you want to use Async Methods." - - - When overridden in a derived class, reads the content, including markup, representing this node and all its children. - If the reader is positioned on an element or an attribute node, this method returns all the XML content, including markup, of the current node and all its children; otherwise, it returns an empty string. - The XML was not well-formed, or an error occurred while parsing the XML. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - - - Asynchronously reads the content, including markup, representing this node and all its children. - If the reader is positioned on an element or an attribute node, this method returns all the XML content, including markup, of the current node and all its children; otherwise, it returns an empty string. - An asynchronous method was called without setting the flag to true. In this case, is thrown with the message "Set XmlReaderSettings.Async to true if you want to use Async Methods." - - - Checks that the current node is an element and advances the reader to the next node. - Incorrect XML was encountered in the input stream. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - - - Checks that the current content node is an element with the given and advances the reader to the next node. - The qualified name of the element. - Incorrect XML was encountered in the input stream. -or- The of the element does not match the given name. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - - - Checks that the current content node is an element with the given and and advances the reader to the next node. - The local name of the element. - The namespace URI of the element. - Incorrect XML was encountered in the input stream. -or- The and properties of the element found do not match the given arguments. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - - - When overridden in a derived class, gets the state of the reader. - One of the enumeration values that specifies the state of the reader. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - - - When overridden in a derived class, reads the contents of an element or text node as a string. However, we recommend that you use the method instead, because it provides a more straightforward way to handle this operation. - The contents of the element or an empty string. - An error occurred while parsing the XML. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - - - Returns a new XmlReader instance that can be used to read the current node, and all its descendants. - A new XML reader instance set to . Calling the method positions the new reader on the node that was current before the call to the method. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - - - Advances the to the next descendant element with the specified local name and namespace URI. - The local name of the element you wish to move to. - The namespace URI of the element you wish to move to. - true if a matching descendant element is found; otherwise false. If a matching child element is not found, the is positioned on the end tag ( is XmlNodeType.EndElement) of the element. If the is not positioned on an element when was called, this method returns false and the position of the is not changed. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - Both parameter values are null. - - - Advances the to the next descendant element with the specified qualified name. - The qualified name of the element you wish to move to. - true if a matching descendant element is found; otherwise false. If a matching child element is not found, the is positioned on the end tag ( is XmlNodeType.EndElement) of the element. If the is not positioned on an element when was called, this method returns false and the position of the is not changed. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - The parameter is an empty string. - - - Reads until an element with the specified qualified name is found. - The qualified name of the element. - true if a matching element is found; otherwise false and the is in an end of file state. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - The parameter is an empty string. - - - Reads until an element with the specified local name and namespace URI is found. - The local name of the element. - The namespace URI of the element. - true if a matching element is found; otherwise false and the is in an end of file state. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - Both parameter values are null. - - - Advances the XmlReader to the next sibling element with the specified qualified name. - The qualified name of the sibling element you wish to move to. - true if a matching sibling element is found; otherwise false. If a matching sibling element is not found, the XmlReader is positioned on the end tag ( is XmlNodeType.EndElement) of the parent element. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - The parameter is an empty string. - - - Advances the XmlReader to the next sibling element with the specified local name and namespace URI. - The local name of the sibling element you wish to move to. - The namespace URI of the sibling element you wish to move to. - true if a matching sibling element is found; otherwise, false. If a matching sibling element is not found, the XmlReader is positioned on the end tag ( is XmlNodeType.EndElement) of the parent element. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - Both parameter values are null. - - - Reads large streams of text embedded in an XML document. - The array of characters that serves as the buffer to which the text contents are written. This value cannot be null. - The offset within the buffer where the can start to copy the results. - The maximum number of characters to copy into the buffer. The actual number of characters copied is returned from this method. - The number of characters read into the buffer. The value zero is returned when there is no more text content. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - The buffer value is null. - The index into the buffer, or index + count is larger than the allocated buffer size. - The implementation does not support this method. - The XML data is not well-formed. - - - Asynchronously reads large streams of text embedded in an XML document. - The array of characters that serves as the buffer to which the text contents are written. This value cannot be null. - The offset within the buffer where the can start to copy the results. - The maximum number of characters to copy into the buffer. The actual number of characters copied is returned from this method. - The number of characters read into the buffer. The value zero is returned when there is no more text content. - An asynchronous method was called without setting the flag to true. In this case, is thrown with the message "Set XmlReaderSettings.Async to true if you want to use Async Methods." - - - When overridden in a derived class, resolves the entity reference for EntityReference nodes. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - - - Gets the schema information that has been assigned to the current node as a result of schema validation. -

An object containing the schema information for the current node. Schema information can be set on elements, attributes, or on text nodes with a non-null (typed values).

-

If the current node is not one of the above node types, or if the XmlReader instance does not report schema information, this property returns null.

-

If this property is called from an or an object, this property always returns null. These XmlReader implementations do not expose schema information through the SchemaInfo property.

-


If you have to get the post-schema-validation information set (PSVI) for an element, position the reader on the end tag of the element, rather than on the start tag. You get the PSVI through the SchemaInfo property of a reader. The validating reader that is created through with the property set to has complete PSVI for an element only when the reader is positioned on the end tag of an element.

-

-
- An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." -
- - Gets the object used to create this instance. - The object used to create this reader instance. If this reader was not created using the method, this property returns null. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - - - Skips the children of the current node. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - - - Asynchronously skips the children of the current node. - The current node. - An asynchronous method was called without setting the flag to true. In this case, is thrown with the message "Set XmlReaderSettings.Async to true if you want to use Async Methods." - - - When overridden in a derived class, gets the text value of the current node. -

The value returned depends on the of the node. The following table lists node types that have a value to return. All other node types return String.Empty.

-
Node type

-

Value

-

Attribute The value of the attribute.

-

CDATA The content of the CDATA section.

-

Comment The content of the comment.

-

DocumentType The internal subset.

-

ProcessingInstruction The entire content, excluding the target.

-

SignificantWhitespace The white space between markup in a mixed content model.

-

Text The content of the text node.

-

Whitespace The white space between markup.

-

XmlDeclaration The content of the declaration.

-

-
- An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." -
- - Gets The Common Language Runtime (CLR) type for the current node. - The CLR type that corresponds to the typed value of the node. The default is System.String. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - - - When overridden in a derived class, gets the current xml:lang scope. - The current xml:lang scope. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - - - When overridden in a derived class, gets the current xml:space scope. - One of the values. If no xml:space scope exists, this property defaults to XmlSpace.None. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - - - Specifies a set of features to support on the object created by the method. - - - Initializes a new instance of the class. - - - Gets or sets whether asynchronous methods can be used on a particular instance. - true if asynchronous methods can be used; otherwise, false. - - - Gets or sets a value indicating whether to do character checking. -

true to do character checking; otherwise false. The default is true.

-


If the is processing text data, it always checks that the XML names and text content are valid, regardless of the property setting. Setting to false turns off character checking for character entity references.

-

-
-
- - Creates a copy of the instance. - The cloned object. - - - Gets or sets a value indicating whether the underlying stream or should be closed when the reader is closed. - true to close the underlying stream or when the reader is closed; otherwise false. The default is false. - - - Gets or sets the level of conformance which the will comply. - One of the enumeration values that specifies the level of conformance that the XML reader will enforce. The default is . - - - Gets or sets a value that determines the processing of DTDs. - One of the enumeration values that determines the processing of DTDs. The default is . - - - Gets or sets a value indicating whether to ignore comments. - true to ignore comments; otherwise false. The default is false. - - - Gets or sets a value indicating whether to ignore processing instructions. - true to ignore processing instructions; otherwise false. The default is false. - - - Gets or sets a value indicating whether to ignore insignificant white space. - true to ignore white space; otherwise false. The default is false. - - - Gets or sets line number offset of the object. - The line number offset. The default is 0. - - - Gets or sets line position offset of the object. - The line position offset. The default is 0. - - - Gets or sets a value indicating the maximum allowable number of characters in a document that result from expanding entities. - The maximum allowable number of characters from expanded entities. The default is 0. - - - Gets or sets a value indicating the maximum allowable number of characters in an XML document. A zero (0) value means no limits on the size of the XML document. A non-zero value specifies the maximum size, in characters. - The maximum allowable number of characters in an XML document. The default is 0. - - - Gets or sets the used for atomized string comparisons. - The that stores all the atomized strings used by all instances created using this object. The default is null. The created instance will use a new empty if this value is null. - - - Gets or sets a value indicating whether to prohibit document type definition (DTD) processing. This property is obsolete. Use instead. - true to prohibit DTD processing; otherwise false. The default is true. - - - Resets the members of the settings class to their default values. - - - Gets or sets the to use when performing schema validation. - The to use when performing schema validation. The default is an empty object. - - - Occurs when the reader encounters validation errors. - - - - Gets or sets a value indicating the schema validation settings. This setting applies to objects that validate schemas ( property set to ValidationType.Schema). - A bitwise combination of enumeration values that specify validation options. and are enabled by default. , , and are disabled by default. - - - Gets or sets a value indicating whether the will perform validation or type assignment when reading. - One of the values that indicates whether XmlReader will perform validation or type assignment when reading. The default is ValidationType.None. - - - Sets the used to access external documents. - An used to access external documents. If set to null, an is thrown when the tries to access an external resource. The default is a new with no credentials. Starting with the .NET Framework 4.5.2, this setting has a default value of null. - - - Resolves external XML resources named by a Uniform Resource Identifier (URI). - - - Initializes a new instance of the class. - - - When overridden in a derived class, sets the credentials used to authenticate web requests. - The credentials to be used to authenticate web requests. If this property is not set, the value defaults to null; that is, the XmlResolver has no user credentials. - - - When overridden in a derived class, maps a URI to an object that contains the actual resource. - The URI returned from . - Currently not used. - The type of object to return. The current version only returns System.IO.Stream objects. - A stream object or null if a type other than stream is specified. - ofObjectToReturn is not a Stream type. - The specified URI is not an absolute URI. - absoluteUri is null. - There is a runtime error (for example, an interrupted server connection). - - - Asynchronously maps a URI to an object that contains the actual resource. - The URI returned from . - Currently not used. - The type of object to return. The current version only returns objects. - A stream object or null if a type other than stream is specified. - - - When overridden in a derived class, resolves the absolute URI from the base and relative URIs. - The base URI used to resolve the relative URI. - The URI to resolve. The URI can be absolute or relative. If absolute, this value effectively replaces the baseUri value. If relative, it combines with the baseUri to make an absolute URI. - The absolute URI or null if the relative URI cannot be resolved. - relativeUri is null. - - - Enables the resolver to return types other than . - The URI. - The type to return. - true if the type is supported; otherwise, false. - - - Helps to secure another implementation of by wrapping the object and restricting the resources that the underlying has access to. - - - Initializes a new instance of the class with the and URL provided. - The XML resolver that is wrapped by the . - The URL used to create the that will be applied to the underlying . The calls on the created before calling on the underlying . - - - Sets credentials used to authenticate web requests. - The credentials to be used to authenticate web requests. The sets the given credentials on the underlying . If this property is not set, the value defaults to null; that is, the has no user credentials. - - - Maps a URI to an object that contains the actual resource. This method temporarily sets the created in the constructor by calling before calling GetEntity on the underlying to open the resource. - The URI that is returned from . - Currently not used. - The type of object to return. The current version only returns objects. - The stream returned by calling GetEntity on the underlying . If a type other than is specified, the method returns null. - ofObjectToReturn is neither null nor a type. - The specified URI is not an absolute URI. - absoluteUri is null. - There is a runtime error (for example, an interrupted server connection). - - - Asynchronously maps a URI to an object that contains the actual resource. - The URI returned from . - Currently not used. - The type of object to return. The current version only returns objects. - The stream returned by calling GetEntity on the underlying . If a type other than is specified, the method returns null. - - - Resolves the absolute URI from the base and relative URIs by calling ResolveUri on the underlying . - The base URI used to resolve the relative URI. - The URI to resolve. The URI can be absolute or relative. If absolute, this value effectively replaces the baseUri value. If relative, it combines with the baseUri to make an absolute URI. - The absolute URI or null if the relative URI cannot be resolved (returned by calling ResolveUri on the underlying ). - relativeUri is null. - - - Represents white space between markup in a mixed content node or white space within an xml:space= 'preserve' scope. This is also referred to as significant white space. - - - Initializes a new instance of the class. - The white space characters of the node. - The object. - - - Creates a duplicate of this node. - true to recursively clone the subtree under the specified node; false to clone only the node itself. For significant white space nodes, the cloned node always includes the data value, regardless of the parameter setting. - The cloned node. - - - Gets the local name of the node. - For XmlSignificantWhitespace nodes, this property returns #significant-whitespace. - - - Gets the qualified name of the node. - For XmlSignificantWhitespace nodes, this property returns #significant-whitespace. - - - Gets the type of the current node. - For XmlSignificantWhitespace nodes, this value is XmlNodeType.SignificantWhitespace. - - - Gets the parent of the current node. - The parent node of the current node. - - - Gets the text node that immediately precedes this node. - Returns . - - - Gets or sets the value of the node. - The white space characters found in the node. - Setting Value to invalid white space characters. - - - Saves all the children of the node to the specified . - The XmlWriter to which you want to save. - - - Saves the node to the specified . - The XmlWriter to which you want to save. - - - Specifies the current xml:space scope. - - - The xml:space scope equals default. - - - - No xml:space scope. - - - - The xml:space scope equals preserve. - - - - Represents the text content of an element or attribute. - - - Initializes a new instance of the class. - The content of the node; see the property. - The parent XML document. - - - Creates a duplicate of this node. - true to recursively clone the subtree under the specified node; false to clone only the node itself. - The cloned node. - - - Gets the local name of the node. - For text nodes, this property returns #text. - - - Gets the qualified name of the node. - For text nodes, this property returns #text. - - - Gets the type of the current node. - For text nodes, this value is XmlNodeType.Text. - - - Gets the parent of this node (for nodes that can have parents). - The XmlNode that is the parent of the current node. If a node has just been created and not yet added to the tree, or if it has been removed from the tree, the parent is null. For all other nodes, the value returned depends on the of the node. The following table describes the possible return values for the ParentNode property. - - - Gets the text node that immediately precedes this node. - Returns . - - - Splits the node into two nodes at the specified offset, keeping both in the tree as siblings. - The offset at which to split the node. - The new node. - - - Gets or sets the value of the node. - The content of the text node. - - - Saves all the children of the node to the specified . XmlText nodes do not have children, so this method has no effect. - The XmlWriter to which you want to save. - - - Saves the node to the specified . - The XmlWriter to which you want to save. - - - Represents a reader that provides fast, non-cached, forward-only access to XML data. Starting with the .NET Framework 2.0, we recommend that you use the class instead. - - - Initializes a new instance of the XmlTextReader. - - - Initializes a new instance of the class with the specified string, , and . - The string containing the XML fragment to parse. - The of the XML fragment. This also determines what the fragment string can contain. (See table below.) - The in which the xmlFragment is to be parsed. This includes the to use, encoding, namespace scope, the current xml:lang, and the xml:space scope. - fragType is not an Element, Attribute, or Document``XmlNodeType. - xmlFragment is null. - - - Initializes a new instance of the class with the specified URL, and . - The URL to use for resolving external resources. The is set to this value. If url is null, BaseURI is set to String.Empty. - The TextReader containing the XML data to read. - The XmlNameTable to use. - The nt value is null. - - - Initializes a new instance of the class with the specified URL, stream and . - The URL to use for resolving external resources. The is set to this value. If url is null, BaseURI is set to String.Empty. - The stream containing the XML data to read. - The XmlNameTable to use. - The input or nt value is null. - - - Initializes a new instance of the class with the specified stream, , and . - The stream containing the XML fragment to parse. - The of the XML fragment. This also determines what the fragment can contain. (See table below.) - The in which the xmlFragment is to be parsed. This includes the to use, encoding, namespace scope, the current xml:lang, and the xml:space scope. - fragType is not an Element, Attribute, or Document XmlNodeType. - xmlFragment is null. - - - Initializes a new instance of the class with the specified file and . - The URL for the file containing the XML data to read. - The XmlNameTable to use. - The nt value is null. - The specified file cannot be found. - Part of the filename or directory cannot be found. - url is an empty string. - The remote filename cannot be resolved. -or- An error occurred while processing the request. - url is not a valid URI. - - - Initializes a new instance of the class with the specified URL and stream. - The URL to use for resolving external resources. The is set to this value. - The stream containing the XML data to read. - input is null. - - - Initializes a new instance of the class with the specified URL and . - The URL to use for resolving external resources. The is set to this value. - The TextReader containing the XML data to read. - - - Initializes a new instance of the class with the specified stream and . - The stream containing the XML data to read. - The XmlNameTable to use. - The input or nt value is null. - - - Initializes a new instance of the class with the specified . - The XmlNameTable to use. - - - Initializes a new instance of the class with the specified file. - The URL for the file containing the XML data. The is set to this value. - The specified file cannot be found. - Part of the filename or directory cannot be found. - url is an empty string. - The remote filename cannot be resolved. -or- An error occurred while processing the request. - url is not a valid URI. - - - Initializes a new instance of the class with the specified . - The TextReader containing the XML data to read. - - - Initializes a new instance of the class with the specified stream. - The stream containing the XML data to read. - input is null. - - - Initializes a new instance of the class with the specified and . - The TextReader containing the XML data to read. - The XmlNameTable to use. - The nt value is null. - - - Gets the number of attributes on the current node. - The number of attributes on the current node. - - - Gets the base URI of the current node. - The base URI of the current node. - - - Gets a value indicating whether the implements the binary content read methods. - true if the binary content read methods are implemented; otherwise false. The class always returns true. - - - Gets a value indicating whether the implements the method. - true if the implements the method; otherwise false. The class always returns false. - - - Gets a value indicating whether this reader can parse and resolve entities. - true if the reader can parse and resolve entities; otherwise, false. The XmlTextReader class always returns true. - - - Changes the to Closed. - - - Gets the depth of the current node in the XML document. - The depth of the current node in the XML document. - - - Gets or sets the enumeration. - The enumeration. - - - Gets the encoding of the document. - The encoding value. If no encoding attribute exists, and there is no byte-order mark, this defaults to UTF-8. - - - Gets or sets a value that specifies how the reader handles entities. - One of the values. If no EntityHandling is specified, it defaults to EntityHandling.ExpandCharEntities. - - - Gets a value indicating whether the reader is positioned at the end of the stream. - true if the reader is positioned at the end of the stream; otherwise, false. - - - Gets the value of the attribute with the specified name. - The qualified name of the attribute. - The value of the specified attribute. If the attribute is not found, null is returned. - - - Gets the value of the attribute with the specified local name and namespace URI. - The local name of the attribute. - The namespace URI of the attribute. - The value of the specified attribute. If the attribute is not found, null is returned. This method does not move the reader. - - - Gets the value of the attribute with the specified index. - The index of the attribute. The index is zero-based. (The first attribute has index 0.) - The value of the specified attribute. - The i parameter is less than 0 or greater than or equal to . - - - Gets a collection that contains all namespaces currently in-scope. - An value that specifies the type of namespace nodes to return. - An object that contains all the current in-scope namespaces. If the reader is not positioned on an element, an empty dictionary (no namespaces) is returned. - - - Gets the remainder of the buffered XML. - A containing the remainder of the buffered XML. - - - Gets a value indicating whether the class can return line information. - true if the class can return line information; otherwise, false. - - - Gets a value indicating whether the current node can have a other than String.Empty. - true if the node on which the reader is currently positioned can have a Value; otherwise, false. - - - Gets a value indicating whether the current node is an attribute that was generated from the default value defined in the DTD or schema. - This property always returns false. ( does not expand default attributes.) - - - Gets a value indicating whether the current node is an empty element (for example, ). - true if the current node is an element ( equals XmlNodeType.Element) that ends with />; otherwise, false. - - - Gets the current line number. - The current line number. - - - Gets the current line position. - The current line position. - - - Gets the local name of the current node. - The name of the current node with the prefix removed. For example, LocalName is book for the element <bk:book>. For node types that do not have a name (like Text, Comment, and so on), this property returns String.Empty. - - - Resolves a namespace prefix in the current element's scope. - The prefix whose namespace URI you want to resolve. To match the default namespace, pass an empty string. This string does not have to be atomized. - The namespace URI to which the prefix maps or null if no matching prefix is found. - The property is set to true and the prefix value is null. - - - Moves to the attribute with the specified index. - The index of the attribute. - The i parameter is less than 0 or greater than or equal to . - - - Moves to the attribute with the specified name. - The qualified name of the attribute. - true if the attribute is found; otherwise, false. If false, the reader's position does not change. - - - Moves to the attribute with the specified local name and namespace URI. - The local name of the attribute. - The namespace URI of the attribute. - true if the attribute is found; otherwise, false. If false, the reader's position does not change. - - - Moves to the element that contains the current attribute node. - true if the reader is positioned on an attribute (the reader moves to the element that owns the attribute); false if the reader is not positioned on an attribute (the position of the reader does not change). - - - Moves to the first attribute. - true if an attribute exists (the reader moves to the first attribute); otherwise, false (the position of the reader does not change). - - - Moves to the next attribute. - true if there is a next attribute; false if there are no more attributes. - - - Gets the qualified name of the current node. -

The qualified name of the current node. For example, Name is bk:book for the element <bk:book>.

-

The name returned is dependent on the of the node. The following node types return the listed values. All other node types return an empty string.

-
Node Type

-

Name

-

Attribute The name of the attribute.

-

DocumentType The document type name.

-

Element The tag name.

-

EntityReference The name of the entity referenced.

-

ProcessingInstruction The target of the processing instruction.

-

XmlDeclaration The literal string xml.

-

-
-
- - Gets or sets a value indicating whether to do namespace support. - true to do namespace support; otherwise, false. The default is true. - Setting this property after a read operation has occurred ( is not ReadState.Initial). - - - Gets the namespace URI (as defined in the W3C Namespace specification) of the node on which the reader is positioned. - The namespace URI of the current node; otherwise an empty string. - - - Gets the associated with this implementation. - The XmlNameTable enabling you to get the atomized version of a string within the node. - - - Gets the type of the current node. - One of the values representing the type of the current node. - - - Gets or sets a value indicating whether to normalize white space and attribute values. - true to normalize; otherwise, false. The default is false. - Setting this property when the reader is closed ( is ReadState.Closed). - - - Gets the namespace prefix associated with the current node. - The namespace prefix associated with the current node. - - - Gets or sets a value indicating whether to allow DTD processing. This property is obsolete. Use instead. - true to disallow DTD processing; otherwise false. The default is false. - - - Gets the quotation mark character used to enclose the value of an attribute node. - The quotation mark character (" or ') used to enclose the value of an attribute node. - - - Reads the next node from the stream. - true if the next node was read successfully; false if there are no more nodes to read. - An error occurred while parsing the XML. - - - Parses the attribute value into one or more Text, EntityReference, or EndEntity nodes. - true if there are nodes to return. false if the reader is not positioned on an attribute node when the initial call is made or if all the attribute values have been read. An empty attribute, such as, misc="", returns true with a single node with a value of String.Empty. - - - Decodes Base64 and returns the decoded binary bytes. - The array of characters that serves as the buffer to which the text contents are written. - The zero-based index into the array specifying where the method can begin to write to the buffer. - The number of bytes to write into the buffer. - The number of bytes written to the buffer. - The Base64 sequence is not valid. - The value of array is null. - offset < 0, or len < 0, or len > array.Length- offset. - - - Decodes BinHex and returns the decoded binary bytes. - The byte array that serves as the buffer to which the decoded binary bytes are written. - The zero-based index into the array specifying where the method can begin to write to the buffer. - The number of bytes to write into the buffer. - The number of bytes written to your buffer. - The BinHex sequence is not valid. - The value of array is null. - offset < 0, or len < 0, or len > array.Length- offset. - - - Reads the text contents of an element into a character buffer. This method is designed to read large streams of embedded text by calling it successively. - The array of characters that serves as the buffer to which the text contents are written. - The position within buffer where the method can begin writing text contents. - The number of characters to write into buffer. - The number of characters read. This can be 0 if the reader is not positioned on an element or if there is no more text content to return in the current context. - count is greater than the space specified in the buffer (buffer size - index). - The buffer value is null. - index< 0 or count< 0. - - - Reads the content and returns the Base64 decoded binary bytes. - The buffer into which to copy the resulting text. This value cannot be null. - The offset into the buffer where to start copying the result. - The maximum number of bytes to copy into the buffer. The actual number of bytes copied is returned from this method. - The number of bytes written to the buffer. - The buffer value is null. - is not supported in the current node. - The index into the buffer or index + count is larger than the allocated buffer size. - - - Reads the content and returns the BinHex decoded binary bytes. - The buffer into which to copy the resulting text. This value cannot be null. - The offset into the buffer where to start copying the result. - The maximum number of bytes to copy into the buffer. The actual number of bytes copied is returned from this method. - The number of bytes written to the buffer. - The buffer value is null. - is not supported on the current node. - The index into the buffer or index + count is larger than the allocated buffer size. - The implementation does not support this method. - - - Reads the element and decodes the Base64 content. - The buffer into which to copy the resulting text. This value cannot be null. - The offset into the buffer where to start copying the result. - The maximum number of bytes to copy into the buffer. The actual number of bytes copied is returned from this method. - The number of bytes written to the buffer. - The buffer value is null. - The current node is not an element node. - The index into the buffer or index + count is larger than the allocated buffer size. - The implementation does not support this method. - The element contains mixed-content. - The content cannot be converted to the requested type. - - - Reads the element and decodes the BinHex content. - The buffer into which to copy the resulting text. This value cannot be null. - The offset into the buffer where to start copying the result. - The maximum number of bytes to copy into the buffer. The actual number of bytes copied is returned from this method. - The number of bytes written to the buffer. - The buffer value is null. - The current node is not an element node. - The index into the buffer or index + count is larger than the allocated buffer size. - The implementation does not support this method. - The element contains mixed-content. - The content cannot be converted to the requested type. - - - Gets the state of the reader. - One of the values. - - - Reads the contents of an element or a text node as a string. - The contents of the element or text node. This can be an empty string if the reader is positioned on something other than an element or text node, or if there is no more text content to return in the current context. Note: The text node can be either an element or an attribute text node. - An error occurred while parsing the XML. - An invalid operation was attempted. - - - Resets the state of the reader to ReadState.Initial. - Calling ResetState if the reader was constructed using an . - Documents in a single stream do not share the same encoding. - - - Resolves the entity reference for EntityReference nodes. - - - Skips the children of the current node. - - - Gets the text value of the current node. -

The value returned depends on the of the node. The following table lists node types that have a value to return. All other node types return String.Empty.

-
Node Type

-

Value

-

Attribute The value of the attribute.

-

CDATA The content of the CDATA section.

-

Comment The content of the comment.

-

DocumentType The internal subset.

-

ProcessingInstruction The entire content, excluding the target.

-

SignificantWhitespace The white space within an xml:space= &#39;preserve&#39; scope.

-

Text The content of the text node.

-

Whitespace The white space between markup.

-

XmlDeclaration The content of the declaration.

-

-
-
- - Gets or sets a value that specifies how white space is handled. - One of the values. The default is WhitespaceHandling.All (returns Whitespace and SignificantWhitespace nodes). - Invalid value specified. - Setting this property when the reader is closed ( is ReadState.Closed). - - - Gets the current xml:lang scope. - The current xml:lang scope. - - - Sets the used for resolving DTD references. - The XmlResolver to use. If set to null, external resources are not resolved. In version 1.1 of the .NET Framework, the caller must be fully trusted in order to specify an XmlResolver. - - - Gets the current xml:space scope. - One of the values. If no xml:space scope exists, this property defaults to XmlSpace.None. - - - For a description of this member, see . - An value that specifies the type of namespace nodes to return. - An that contains the current in-scope namespaces. - - - For a description of this member, see . - The prefix whose namespace URI you wish to find. - The namespace URI that is mapped to the prefix; null if the prefix is not mapped to a namespace URI. - - - For a description of this member, see . - The namespace URI whose prefix you wish to find. - The prefix that is mapped to the namespace URI; null if the namespace URI is not mapped to a prefix. - - - Represents a writer that provides a fast, non-cached, forward-only way of generating streams or files containing XML data that conforms to the W3C Extensible Markup Language (XML) 1.0 and the Namespaces in XML recommendations. Starting with the .NET Framework 2.0, we recommend that you use the class instead. - - - Creates an instance of the XmlTextWriter class using the specified . - The TextWriter to write to. It is assumed that the TextWriter is already set to the correct encoding. - - - Creates an instance of the XmlTextWriter class using the specified stream and encoding. - The stream to which you want to write. - The encoding to generate. If encoding is null it writes out the stream as UTF-8 and omits the encoding attribute from the ProcessingInstruction. - The encoding is not supported or the stream cannot be written to. - w is null. - - - Creates an instance of the class using the specified file. - The filename to write to. If the file exists, it truncates it and overwrites it with the new content. - The encoding to generate. If encoding is null it writes the file out as UTF-8, and omits the encoding attribute from the ProcessingInstruction. - The encoding is not supported; the filename is empty, contains only white space, or contains one or more invalid characters. - Access is denied. - The filename is null. - The directory to write to is not found. - The filename includes an incorrect or invalid syntax for file name, directory name, or volume label syntax. - The caller does not have the required permission. - - - Gets the underlying stream object. - The stream to which the XmlTextWriter is writing or null if the XmlTextWriter was constructed using a that does not inherit from the class. - - - Closes this stream and the underlying stream. - - - Flushes whatever is in the buffer to the underlying streams and also flushes the underlying stream. - - - Indicates how the output is formatted. - One of the values. The default is Formatting.None (no special formatting). - - - Gets or sets how many IndentChars to write for each level in the hierarchy when is set to Formatting.Indented. - Number of IndentChars for each level. The default is 2. - Setting this property to a negative value. - - - Gets or sets which character to use for indenting when is set to Formatting.Indented. -

The character to use for indenting. The default is space.

-


The XmlTextWriter allows you to set this property to any character. To ensure valid XML, you must specify a valid white space character, 0x9, 0x10, 0x13 or 0x20.

-

-
-
- - Returns the closest prefix defined in the current namespace scope for the namespace URI. - Namespace URI whose prefix you want to find. - The matching prefix. Or null if no matching namespace URI is found in the current scope. - ns is either null or String.Empty. - - - Gets or sets a value indicating whether to do namespace support. - true to support namespaces; otherwise, false. The default is true. - You can only change this property when in the WriteState.Start state. - - - Gets or sets which character to use to quote attribute values. - The character to use to quote attribute values. This must be a single quote (') or a double quote ("). The default is a double quote. - Setting this property to something other than either a single or double quote. - - - Encodes the specified binary bytes as base64 and writes out the resulting text. - Byte array to encode. - The position within the buffer indicating the start of the bytes to write. - The number of bytes to write. - buffer is null. - The buffer length minus index is less than count. - index or count is less than zero. - The is Closed. - - - Encodes the specified binary bytes as binhex and writes out the resulting text. - Byte array to encode. - The position in the buffer indicating the start of the bytes to write. - The number of bytes to write. - buffer is null. - The buffer length minus index is less than count. - index or count is less than zero. - The is Closed. - - - Writes out a <![CDATA[...]]> block containing the specified text. - Text to place inside the CDATA block. - The text would result in a non-well formed XML document. - The is Closed. - - - Forces the generation of a character entity for the specified Unicode character value. - Unicode character for which to generate a character entity. - The character is in the surrogate pair character range, 0xd800 - 0xdfff; or the text would result in a non-well formed XML document. - The is Closed. - - - Writes text one buffer at a time. - Character array containing the text to write. - The position in the buffer indicating the start of the text to write. - The number of characters to write. - buffer is null. - index or count is less than zero. -or- The buffer length minus index is less than count; the call results in surrogate pair characters being split or an invalid surrogate pair being written. - The is Closed. - - - Writes out a comment <!--...--> containing the specified text. - Text to place inside the comment. - The text would result in a non-well formed XML document - The is Closed. - - - Writes the DOCTYPE declaration with the specified name and optional attributes. - The name of the DOCTYPE. This must be non-empty. - If non-null it also writes PUBLIC "pubid" "sysid" where pubid and sysid are replaced with the value of the given arguments. - If pubid is null and sysid is non-null it writes SYSTEM "sysid" where sysid is replaced with the value of this argument. - If non-null it writes [subset] where subset is replaced with the value of this argument. - This method was called outside the prolog (after the root element). - name is null or String.Empty -or- the value for name would result in invalid XML. - - - Closes the previous call. - - - Closes any open elements or attributes and puts the writer back in the Start state. - The XML document is invalid. - - - Closes one element and pops the corresponding namespace scope. - - - Writes out an entity reference as &name;. - Name of the entity reference. - The text would result in a non-well formed XML document or name is either null or String.Empty. - - - Closes one element and pops the corresponding namespace scope. - - - Writes out the specified name, ensuring it is a valid name according to the W3C XML 1.0 recommendation (http://www.w3.org/TR/1998/REC-xml-19980210#NT-Name). - Name to write. - name is not a valid XML name; or name is either null or String.Empty. - - - Writes out the specified name, ensuring it is a valid NmToken according to the W3C XML 1.0 recommendation (http://www.w3.org/TR/1998/REC-xml-19980210#NT-Name). - Name to write. - name is not a valid NmToken; or name is either null or String.Empty. - - - Writes out a processing instruction with a space between the name and text as follows: <?name text?>. - Name of the processing instruction. - Text to include in the processing instruction. - The text would result in a non-well formed XML document. name is either null or String.Empty. This method is being used to create an XML declaration after has already been called. - - - Writes out the namespace-qualified name. This method looks up the prefix that is in scope for the given namespace. - The local name to write. - The namespace URI to associate with the name. - localName is either null or String.Empty. localName is not a valid name according to the W3C Namespaces spec. - - - Writes raw markup manually from a character buffer. - Character array containing the text to write. - The position within the buffer indicating the start of the text to write. - The number of characters to write. - buffer is null. - index or count is less than zero. -or- The buffer length minus index is less than count. - - - Writes raw markup manually from a string. - String containing the text to write. - - - Writes the start of an attribute. - Namespace prefix of the attribute. - LocalName of the attribute. - NamespaceURI of the attribute - localName is either null or String.Empty. - - - Writes the XML declaration with the version "1.0". - This is not the first write method called after the constructor. - - - Writes the XML declaration with the version "1.0" and the standalone attribute. - If true, it writes "standalone=yes"; if false, it writes "standalone=no". - This is not the first write method called after the constructor. - - - Writes the specified start tag and associates it with the given namespace and prefix. - The namespace prefix of the element. - The local name of the element. - The namespace URI to associate with the element. If this namespace is already in scope and has an associated prefix then the writer automatically writes that prefix also. - The writer is closed. - - - Gets the state of the writer. - One of the values. - - - Writes the given text content. - Text to write. - The text string contains an invalid surrogate pair. - - - Generates and writes the surrogate character entity for the surrogate character pair. - The low surrogate. This must be a value between 0xDC00 and 0xDFFF. - The high surrogate. This must be a value between 0xD800 and 0xDBFF. - An invalid surrogate character pair was passed. - - - Writes out the given white space. - The string of white space characters. - The string contains non-white space characters. - - - Gets the current xml:lang scope. - The current xml:lang or null if there is no xml:lang in the current scope. - - - Gets an representing the current xml:space scope. -

An XmlSpace representing the current xml:space scope.

-
Value

-

Meaning

-

None

-

This is the default if no xml:space scope exists.

-

Default

-

The current scope is xml:space="default".

-

Preserve

-

The current scope is xml:space="preserve".

-

-
-
- - Represents the XML type for the string. This allows the string to be read as a particular XML type, for example a CDATA section type. - - - CDATA type. - - - - ENTITIES type. - - - - ENTITY type. - - - - ENUMERATION type. - - - - ID type. - - - - IDREF type. - - - - IDREFS type. - - - - NCName type. - - - - NMTOKEN type. - - - - NMTOKENS type. - - - - No type. - - - - NOTATION type. - - - - QName type. - - - - Resolves external XML resources named by a Uniform Resource Identifier (URI). - - - Initializes a new instance of the class. - - - Gets or sets the cache policy for the underlying object. - The cache policy for the underlying web request. - - - Sets credentials used to authenticate web requests. - The credentials to be used to authenticate web requests. If this property is not set, the value defaults to null; that is, the XmlUrlResolver has no user credentials. - - - Maps a URI to an object that contains the actual resource. - The URI returned from . - Currently not used. - The type of object to return. The current implementation only returns objects. - A stream object or null if a type other than stream is specified. - ofObjectToReturn is neither null nor a Stream type. - The specified URI is not an absolute URI. - absoluteUri is null. - There is a runtime error (for example, an interrupted server connection). - - - Asynchronously maps a URI to an object that contains the actual resource. - The URI returned from . - Currently not used. - The type of object to return. The current implementation only returns objects. - A stream object or null if a type other than stream is specified. - - - Gets or sets the network proxy for the underlying object. - The to use to access the Internet resource. - - - Resolves the absolute URI from the base and relative URIs. - The base URI used to resolve the relative URI. - The URI to resolve. The URI can be absolute or relative. If absolute, this value effectively replaces the baseUri value. If relative, it combines with the baseUri to make an absolute URI. - The absolute URI, or null if the relative URI cannot be resolved. - baseUri is null or relativeUri is null. - - - Represents a reader that provides document type definition (DTD), XML-Data Reduced (XDR) schema, and XML Schema definition language (XSD) validation. This class is obsolete. Starting with the .NET Framework 2.0, we recommend that you use the class and the method to create a validating XML reader. - - - Initializes a new instance of the XmlValidatingReader class that validates the content returned from the given . - The XmlReader to read from while validating. The current implementation supports only . - The reader specified is not an XmlTextReader. - - - Initializes a new instance of the XmlValidatingReader class with the specified values. - The stream containing the XML fragment to parse. - The of the XML fragment. This determines what the fragment can contain (see table below). - The in which the XML fragment is to be parsed. This includes the to use, encoding, namespace scope, current xml:lang, and xml:space scope. - fragType is not one of the node types listed in the table below. - - - Initializes a new instance of the XmlValidatingReader class with the specified values. - The string containing the XML fragment to parse. - The of the XML fragment. This also determines what the fragment string can contain (see table below). - The in which the XML fragment is to be parsed. This includes the to use, encoding, namespace scope, current xml:lang, and xml:space scope. - fragType is not one of the node types listed in the table below. - - - Gets the number of attributes on the current node. - The number of attributes on the current node. This number includes default attributes. - - - Gets the base URI of the current node. - The base URI of the current node. - - - Gets a value indicating whether the implements the binary content read methods. - true if the binary content read methods are implemented; otherwise false. The class returns true. - - - Gets a value indicating whether this reader can parse and resolve entities. - true if the reader can parse and resolve entities; otherwise, false. XmlValidatingReader always returns true. - - - Changes the to Closed. - - - Gets the depth of the current node in the XML document. - The depth of the current node in the XML document. - - - Gets the encoding attribute for the document. - The encoding value. If no encoding attribute exists, and there is not byte-order mark, this defaults to UTF-8. - - - Gets or sets a value that specifies how the reader handles entities. - One of the values. If no EntityHandling is specified, it defaults to EntityHandling.ExpandEntities. - Invalid value was specified. - - - Gets a value indicating whether the reader is positioned at the end of the stream. - true if the reader is positioned at the end of the stream; otherwise, false. - - - Gets the value of the attribute with the specified local name and namespace Uniform Resource Identifier (URI). - The local name of the attribute. - The namespace URI of the attribute. - The value of the specified attribute. If the attribute is not found, null is returned. This method does not move the reader. - - - Gets the value of the attribute with the specified name. - The qualified name of the attribute. - The value of the specified attribute. If the attribute is not found, null is returned. - - - Gets the value of the attribute with the specified index. - The index of the attribute. The index is zero-based. (The first attribute has index 0.) - The value of the specified attribute. - The i parameter is less than 0 or greater than or equal to . - - - Gets a value indicating whether the class can return line information. - true if the class can return line information; otherwise, false. - - - Gets a value indicating whether the current node can have a other than String.Empty. - true if the node on which the reader is currently positioned can have a Value; otherwise, false. - - - Gets a value indicating whether the current node is an attribute that was generated from the default value defined in the document type definition (DTD) or schema. - true if the current node is an attribute whose value was generated from the default value defined in the DTD or schema; false if the attribute value was explicitly set. - - - Gets a value indicating whether the current node is an empty element (for example, ). - true if the current node is an element ( equals XmlNodeType.Element) that ends with />; otherwise, false. - - - Gets the current line number. - The current line number. The starting value for this property is 1. - - - Gets the current line position. - The current line position. The starting value for this property is 1. - - - Gets the local name of the current node. - The name of the current node with the prefix removed. For example, LocalName is book for the element <bk:book>. For node types that do not have a name (like Text, Comment, and so on), this property returns String.Empty. - - - Resolves a namespace prefix in the current element's scope. - The prefix whose namespace Uniform Resource Identifier (URI) you want to resolve. To match the default namespace, pass an empty string. - The namespace URI to which the prefix maps or null if no matching prefix is found. - - - Moves to the attribute with the specified index. - The index of the attribute. - The i parameter is less than 0 or greater than or equal to . - - - Moves to the attribute with the specified name. - The qualified name of the attribute. - true if the attribute is found; otherwise, false. If false, the position of the reader does not change. - - - Moves to the attribute with the specified local name and namespace Uniform Resource Identifier (URI). - The local name of the attribute. - The namespace URI of the attribute. - true if the attribute is found; otherwise, false. If false, the position of the reader does not change. - - - Moves to the element that contains the current attribute node. - true if the reader is positioned on an attribute (the reader moves to the element that owns the attribute); false if the reader is not positioned on an attribute (the position of the reader does not change). - - - Moves to the first attribute. - true if an attribute exists (the reader moves to the first attribute); otherwise, false (the position of the reader does not change). - - - Moves to the next attribute. - true if there is a next attribute; false if there are no more attributes. - - - Gets the qualified name of the current node. -

The qualified name of the current node. For example, Name is bk:book for the element <bk:book>.

-

The name returned is dependent on the of the node. The following node types return the listed values. All other node types return an empty string.

-
Node Type

-

Name

-

Attribute The name of the attribute.

-

DocumentType The document type name.

-

Element The tag name.

-

EntityReference The name of the entity referenced.

-

ProcessingInstruction The target of the processing instruction.

-

XmlDeclaration The literal string xml.

-

-
-
- - Gets or sets a value indicating whether to do namespace support. - true to do namespace support; otherwise, false. The default is true. - - - Gets the namespace Uniform Resource Identifier (URI) (as defined in the World Wide Web Consortium (W3C) Namespace specification) of the node on which the reader is positioned. - The namespace URI of the current node; otherwise an empty string. - - - Gets the associated with this implementation. - XmlNameTable that enables you to get the atomized version of a string within the node. - - - Gets the type of the current node. - One of the values representing the type of the current node. - - - Gets the namespace prefix associated with the current node. - The namespace prefix associated with the current node. - - - Gets the quotation mark character used to enclose the value of an attribute node. - The quotation mark character (" or ') used to enclose the value of an attribute node. - - - Reads the next node from the stream. - true if the next node was read successfully; false if there are no more nodes to read. - - - Parses the attribute value into one or more Text, EntityReference, or EndEntity nodes. - true if there are nodes to return. false if the reader is not positioned on an attribute node when the initial call is made or if all the attribute values have been read. An empty attribute, such as, misc="", returns true with a single node with a value of String.Empty. - - - Reads the content and returns the Base64 decoded binary bytes. - The buffer into which to copy the resulting text. This value cannot be null. - The offset into the buffer where to start copying the result. - The maximum number of bytes to copy into the buffer. The actual number of bytes copied is returned from this method. - The number of bytes written to the buffer. - The buffer value is null. - is not supported on the current node. - The index into the buffer or index + count is larger than the allocated buffer size. - - - Reads the content and returns the BinHex decoded binary bytes. - The buffer into which to copy the resulting text. This value cannot be null. - The offset into the buffer where to start copying the result. - The maximum number of bytes to copy into the buffer. The actual number of bytes copied is returned from this method. - The number of bytes written to the buffer. - The buffer value is null. - is not supported on the current node. - The index into the buffer or index + count is larger than the allocated buffer size. - The implementation does not support this method. - - - Reads the element and decodes the Base64 content. - The buffer into which to copy the resulting text. This value cannot be null. - The offset into the buffer where to start copying the result. - The maximum number of bytes to copy into the buffer. The actual number of bytes copied is returned from this method. - The number of bytes written to the buffer. - The buffer value is null. - The current node is not an element node. - The index into the buffer or index + count is larger than the allocated buffer size. - The implementation does not support this method. - The element contains mixed-content. - The content cannot be converted to the requested type. - - - Reads the element and decodes the BinHex content. - The buffer into which to copy the resulting text. This value cannot be null. - The offset into the buffer where to start copying the result. - The maximum number of bytes to copy into the buffer. The actual number of bytes copied is returned from this method. - The number of bytes written to the buffer. - The buffer value is null. - The current node is not an element node. - The index into the buffer or index + count is larger than the allocated buffer size. - The implementation does not support this method. - The element contains mixed-content. - The content cannot be converted to the requested type. - - - Gets the used to construct this XmlValidatingReader. - The XmlReader specified in the constructor. - - - Gets the state of the reader. - One of the values. - - - Reads the contents of an element or text node as a string. -

The contents of the element or text node. This can be an empty string if the reader is positioned on something other than an element or text node, or if there is no more text content to return in the current context.

-


The text node can be either an element or an attribute text node.

-

-
-
- - Gets the common language runtime type for the specified XML Schema definition language (XSD) type. - The common language runtime type for the specified XML Schema type. - - - Resolves the entity reference for EntityReference nodes. - The reader is not positioned on an EntityReference node. - - - Gets a to use for validation. - The XmlSchemaCollection to use for validation. - - - Gets a schema type object. - , , or depending whether the node value is a built in XML Schema definition language (XSD) type or a user defined simpleType or complexType; null if the current node has no schema type. - - - Sets an event handler for receiving information about document type definition (DTD), XML-Data Reduced (XDR) schema, and XML Schema definition language (XSD) schema validation errors. - - - - Gets or sets a value indicating the type of validation to perform. - One of the values. If this property is not set, it defaults to ValidationType.Auto. - Setting the property after a Read has been called. - - - Gets the text value of the current node. -

The value returned depends on the of the node. The following table lists node types that have a value to return. All other node types return String.Empty.

-
Node Type

-

Value

-

Attribute The value of the attribute.

-

CDATA The content of the CDATA section.

-

Comment The content of the comment.

-

DocumentType The internal subset.

-

ProcessingInstruction The entire content, excluding the target.

-

SignificantWhitespace The white space between markup in a mixed content model.

-

Text The content of the text node.

-

Whitespace The white space between markup.

-

XmlDeclaration The content of the declaration.

-

-
-
- - Gets the current xml:lang scope. - The current xml:lang scope. - - - Sets the used for resolving external document type definition (DTD) and schema location references. The XmlResolver is also used to handle any import or include elements found in XML Schema definition language (XSD) schemas. - The XmlResolver to use. If set to null, external resources are not resolved. In version 1.1 of the .NET Framework, the caller must be fully trusted to specify an XmlResolver. - - - Gets the current xml:space scope. - One of the values. If no xml:space scope exists, this property defaults to XmlSpace.None. - - - For a description of this member, see . - An object that identifies the scope of the reader. - An T:System.Collections.IDictionary object that identifies the namespaces in scope. - - - For a description of this member, see . - The namespace prefix. - A string value that contains the namespace Uri that is associated with the prefix. - - - For a description of this member, see . - The namespace that is associated with the prefix. - A string value that contains the namespace prefix that is associated with the namespaceName. - - - Represents white space in element content. - - - Initializes a new instance of the class. - The white space characters of the node. - The object. - - - Creates a duplicate of this node. - true to recursively clone the subtree under the specified node; false to clone only the node itself. For white space nodes, the cloned node always includes the data value, regardless of the parameter setting. - The cloned node. - - - Gets the local name of the node. - For XmlWhitespace nodes, this property returns #whitespace. - - - Gets the qualified name of the node. - For XmlWhitespace nodes, this property returns #whitespace. - - - Gets the type of the node. - For XmlWhitespace nodes, the value is . - - - Gets the parent of the current node. - The parent node of the current node. - - - Gets the text node that immediately precedes this node. - Returns . - - - Gets or sets the value of the node. - The white space characters found in the node. - Setting to invalid white space characters. - - - Saves all the children of the node to the specified . - The to which you want to save. - - - Saves the node to the specified . - The to which you want to save. - - - Represents a writer that provides a fast, non-cached, forward-only way to generate streams or files that contain XML data. - - - Initializes a new instance of the class. - - - When overridden in a derived class, closes this stream and the underlying stream. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - - - Creates a new instance using the and objects. - The to which to write to. Content written by the is appended to the . - The object used to configure the new instance. If this is null, a with default settings is used. If the is being used with the method, you should use the property to obtain an object with the correct settings. This ensures that the created object has the correct output settings. - An object. - The builder value is null. - - - Creates a new instance using the filename and object. - The file to which you want to write. The creates a file at the specified path and writes to it in XML 1.0 text syntax. The outputFileName must be a file system path. - The object used to configure the new instance. If this is null, a with default settings is used. If the is being used with the method, you should use the property to obtain an object with the correct settings. This ensures that the created object has the correct output settings. - An object. - The url value is null. - - - Creates a new instance using the and objects. - The to which you want to write. The writes XML 1.0 text syntax and appends it to the specified . - The object used to configure the new instance. If this is null, a with default settings is used. If the is being used with the method, you should use the property to obtain an object with the correct settings. This ensures that the created object has the correct output settings. - An object. - The text value is null. - - - Creates a new instance using the stream and object. - The stream to which you want to write. The writes XML 1.0 text syntax and appends it to the specified stream. - The object used to configure the new instance. If this is null, a with default settings is used. If the is being used with the method, you should use the property to obtain an object with the correct settings. This ensures that the created object has the correct output settings. - An object. - The stream value is null. - - - Creates a new instance using the specified and objects. - The object that you want to use as the underlying writer. - The object used to configure the new instance. If this is null, a with default settings is used. If the is being used with the method, you should use the property to obtain an object with the correct settings. This ensures that the created object has the correct output settings. - An object that is wrapped around the specified object. - The writer value is null. - - - Creates a new instance using the specified . - The to which to write to. Content written by the is appended to the . - An object. - The builder value is null. - - - Creates a new instance using the specified filename. - The file to which you want to write. The creates a file at the specified path and writes to it in XML 1.0 text syntax. The outputFileName must be a file system path. - An object. - The url value is null. - - - Creates a new instance using the specified . - The to which you want to write. The writes XML 1.0 text syntax and appends it to the specified . - An object. - The text value is null. - - - Creates a new instance using the specified stream. - The stream to which you want to write. The writes XML 1.0 text syntax and appends it to the specified stream. - An object. - The stream value is null. - - - Creates a new instance using the specified object. - The object that you want to use as the underlying writer. - An object that is wrapped around the specified object. - The writer value is null. - - - Releases all resources used by the current instance of the class. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - - - Releases the unmanaged resources used by the and optionally releases the managed resources. - true to release both managed and unmanaged resources; false to release only unmanaged resources. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - - - When overridden in a derived class, flushes whatever is in the buffer to the underlying streams and also flushes the underlying stream. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - - - Asynchronously flushes whatever is in the buffer to the underlying streams and also flushes the underlying stream. - The task that represents the asynchronous Flush operation. - An asynchronous method was called without setting the flag to true. In this case, is thrown with the message "Set XmlWriterSettings.Async to true if you want to use Async Methods." - - - When overridden in a derived class, returns the closest prefix defined in the current namespace scope for the namespace URI. - The namespace URI whose prefix you want to find. - The matching prefix or null if no matching namespace URI is found in the current scope. - ns is either null or String.Empty. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - - - Gets the object used to create this instance. - The object used to create this writer instance. If this writer was not created using the method, this property returns null. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - - - When overridden in a derived class, writes out all the attributes found at the current position in the . - The XmlReader from which to copy the attributes. - true to copy the default attributes from the XmlReader; otherwise, false. - reader is null. - The reader is not positioned on an element, attribute or XmlDeclaration node. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - - - Asynchronously writes out all the attributes found at the current position in the . - The XmlReader from which to copy the attributes. - true to copy the default attributes from the XmlReader; otherwise, false. - The task that represents the asynchronous WriteAttributes operation. - An asynchronous method was called without setting the flag to true. In this case, is thrown with the message "Set XmlWriterSettings.Async to true if you want to use Async Methods." - - - When overridden in a derived class, writes out the attribute with the specified local name and value. - The local name of the attribute. - The value of the attribute. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - The xml:space or xml:lang attribute value is invalid. - - - When overridden in a derived class, writes an attribute with the specified local name, namespace URI, and value. - The local name of the attribute. - The namespace URI to associate with the attribute. - The value of the attribute. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - The xml:space or xml:lang attribute value is invalid. - - - When overridden in a derived class, writes out the attribute with the specified prefix, local name, namespace URI, and value. - The namespace prefix of the attribute. - The local name of the attribute. - The namespace URI of the attribute. - The value of the attribute. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - The xml:space or xml:lang attribute value is invalid. - The localName or ns is null. - - - Asynchronously writes out the attribute with the specified prefix, local name, namespace URI, and value. - The namespace prefix of the attribute. - The local name of the attribute. - The namespace URI of the attribute. - The value of the attribute. - The task that represents the asynchronous WriteAttributeString operation. - An asynchronous method was called without setting the flag to true. In this case, is thrown with the message "Set XmlWriterSettings.Async to true if you want to use Async Methods." - - - When overridden in a derived class, encodes the specified binary bytes as Base64 and writes out the resulting text. - Byte array to encode. - The position in the buffer indicating the start of the bytes to write. - The number of bytes to write. - buffer is null. - index or count is less than zero. -or- The buffer length minus index is less than count. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - - - Asynchronously encodes the specified binary bytes as Base64 and writes out the resulting text. - Byte array to encode. - The position in the buffer indicating the start of the bytes to write. - The number of bytes to write. - The task that represents the asynchronous WriteBase64 operation. - An asynchronous method was called without setting the flag to true. In this case, is thrown with the message "Set XmlWriterSettings.Async to true if you want to use Async Methods." - - - When overridden in a derived class, encodes the specified binary bytes as BinHex and writes out the resulting text. - Byte array to encode. - The position in the buffer indicating the start of the bytes to write. - The number of bytes to write. - buffer is null. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - index or count is less than zero. -or- The buffer length minus index is less than count. - - - Asynchronously encodes the specified binary bytes as BinHex and writes out the resulting text. - Byte array to encode. - The position in the buffer indicating the start of the bytes to write. - The number of bytes to write. - The task that represents the asynchronous WriteBinHex operation. - An asynchronous method was called without setting the flag to true. In this case, is thrown with the message "Set XmlWriterSettings.Async to true if you want to use Async Methods." - - - When overridden in a derived class, writes out a <![CDATA[...]]> block containing the specified text. - The text to place inside the CDATA block. - The text would result in a non-well formed XML document. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - - - Asynchronously writes out a <![CDATA[...]]> block containing the specified text. - The text to place inside the CDATA block. - The task that represents the asynchronous WriteCData operation. - An asynchronous method was called without setting the flag to true. In this case, is thrown with the message "Set XmlWriterSettings.Async to true if you want to use Async Methods." - - - When overridden in a derived class, forces the generation of a character entity for the specified Unicode character value. - The Unicode character for which to generate a character entity. - The character is in the surrogate pair character range, 0xd800 - 0xdfff. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - - - Asynchronously forces the generation of a character entity for the specified Unicode character value. - The Unicode character for which to generate a character entity. - The task that represents the asynchronous WriteCharEntity operation. - An asynchronous method was called without setting the flag to true. In this case, is thrown with the message "Set XmlWriterSettings.Async to true if you want to use Async Methods." - - - When overridden in a derived class, writes text one buffer at a time. - Character array containing the text to write. - The position in the buffer indicating the start of the text to write. - The number of characters to write. - buffer is null. - index or count is less than zero. -or- The buffer length minus index is less than count; the call results in surrogate pair characters being split or an invalid surrogate pair being written. - The buffer parameter value is not valid. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - - - Asynchronously writes text one buffer at a time. - Character array containing the text to write. - The position in the buffer indicating the start of the text to write. - The number of characters to write. - The task that represents the asynchronous WriteChars operation. - An asynchronous method was called without setting the flag to true. In this case, is thrown with the message "Set XmlWriterSettings.Async to true if you want to use Async Methods." - - - When overridden in a derived class, writes out a comment <!--...--> containing the specified text. - Text to place inside the comment. - The text would result in a non-well-formed XML document. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - - - Asynchronously writes out a comment <!--...--> containing the specified text. - Text to place inside the comment. - The task that represents the asynchronous WriteComment operation. - An asynchronous method was called without setting the flag to true. In this case, is thrown with the message "Set XmlWriterSettings.Async to true if you want to use Async Methods." - - - When overridden in a derived class, writes the DOCTYPE declaration with the specified name and optional attributes. - The name of the DOCTYPE. This must be non-empty. - If non-null it also writes PUBLIC "pubid" "sysid" where pubid and sysid are replaced with the value of the given arguments. - If pubid is null and sysid is non-null it writes SYSTEM "sysid" where sysid is replaced with the value of this argument. - If non-null it writes [subset] where subset is replaced with the value of this argument. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - The value for name would result in invalid XML. - - - Asynchronously writes the DOCTYPE declaration with the specified name and optional attributes. - The name of the DOCTYPE. This must be non-empty. - If non-null it also writes PUBLIC "pubid" "sysid" where pubid and sysid are replaced with the value of the given arguments. - If pubid is null and sysid is non-null it writes SYSTEM "sysid" where sysid is replaced with the value of this argument. - If non-null it writes [subset] where subset is replaced with the value of this argument. - The task that represents the asynchronous WriteDocType operation. - An asynchronous method was called without setting the flag to true. In this case, is thrown with the message "Set XmlWriterSettings.Async to true if you want to use Async Methods." - - - Writes an element with the specified local name and value. - The local name of the element. - The value of the element. - The localName value is null or an empty string. -or- The parameter values are not valid. - There is a character in the buffer that is a valid XML character but is not valid for the output encoding. For example, if the output encoding is ASCII, you should only use characters from the range of 0 to 127 for element and attribute names. The invalid character might be in the argument of this method or in an argument of previous methods that were writing to the buffer. Such characters are escaped by character entity references when possible (for example, in text nodes or attribute values). However, the character entity reference is not allowed in element and attribute names, comments, processing instructions, or CDATA sections. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - - - Writes an element with the specified local name, namespace URI, and value. - The local name of the element. - The namespace URI to associate with the element. - The value of the element. - The localName value is null or an empty string. -or- The parameter values are not valid. - There is a character in the buffer that is a valid XML character but is not valid for the output encoding. For example, if the output encoding is ASCII, you should only use characters from the range of 0 to 127 for element and attribute names. The invalid character might be in the argument of this method or in an argument of previous methods that were writing to the buffer. Such characters are escaped by character entity references when possible (for example, in text nodes or attribute values). However, the character entity reference is not allowed in element and attribute names, comments, processing instructions, or CDATA sections. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - - - Writes an element with the specified prefix, local name, namespace URI, and value. - The prefix of the element. - The local name of the element. - The namespace URI of the element. - The value of the element. - The localName value is null or an empty string. -or- The parameter values are not valid. - There is a character in the buffer that is a valid XML character but is not valid for the output encoding. For example, if the output encoding is ASCII, you should only use characters from the range of 0 to 127 for element and attribute names. The invalid character might be in the argument of this method or in an argument of previous methods that were writing to the buffer. Such characters are escaped by character entity references when possible (for example, in text nodes or attribute values). However, the character entity reference is not allowed in element and attribute names, comments, processing instructions, or CDATA sections. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - - - Asynchronously writes an element with the specified prefix, local name, namespace URI, and value. - The prefix of the element. - The local name of the element. - The namespace URI of the element. - The value of the element. - The task that represents the asynchronous WriteElementString operation. - An asynchronous method was called without setting the flag to true. In this case, is thrown with the message "Set XmlWriterSettings.Async to true if you want to use Async Methods." - - - When overridden in a derived class, closes the previous call. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - - - Asynchronously closes the previous call. - The task that represents the asynchronous WriteEndAttribute operation. - An asynchronous method was called without setting the flag to true. In this case, is thrown with the message "Set XmlWriterSettings.Async to true if you want to use Async Methods." - - - When overridden in a derived class, closes any open elements or attributes and puts the writer back in the Start state. - The XML document is invalid. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - - - Asynchronously closes any open elements or attributes and puts the writer back in the Start state. - The task that represents the asynchronous WriteEndDocument operation. - An asynchronous method was called without setting the flag to true. In this case, is thrown with the message "Set XmlWriterSettings.Async to true if you want to use Async Methods." - - - When overridden in a derived class, closes one element and pops the corresponding namespace scope. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - - - Asynchronously closes one element and pops the corresponding namespace scope. - The task that represents the asynchronous WriteEndElement operation. - An asynchronous method was called without setting the flag to true. In this case, is thrown with the message "Set XmlWriterSettings.Async to true if you want to use Async Methods." - - - When overridden in a derived class, writes out an entity reference as &name;. - The name of the entity reference. - name is either null or String.Empty. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - - - Asynchronously writes out an entity reference as &name;. - The name of the entity reference. - The task that represents the asynchronous WriteEntityRef operation. - An asynchronous method was called without setting the flag to true. In this case, is thrown with the message "Set XmlWriterSettings.Async to true if you want to use Async Methods." - - - When overridden in a derived class, closes one element and pops the corresponding namespace scope. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - - - Asynchronously closes one element and pops the corresponding namespace scope. - The task that represents the asynchronous WriteFullEndElement operation. - An asynchronous method was called without setting the flag to true. In this case, is thrown with the message "Set XmlWriterSettings.Async to true if you want to use Async Methods." - - - When overridden in a derived class, writes out the specified name, ensuring it is a valid name according to the W3C XML 1.0 recommendation (http://www.w3.org/TR/1998/REC-xml-19980210#NT-Name). - The name to write. - name is not a valid XML name; or name is either null or String.Empty. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - - - Asynchronously writes out the specified name, ensuring it is a valid name according to the W3C XML 1.0 recommendation (http://www.w3.org/TR/1998/REC-xml-19980210#NT-Name). - The name to write. - The task that represents the asynchronous WriteName operation. - An asynchronous method was called without setting the flag to true. In this case, is thrown with the message "Set XmlWriterSettings.Async to true if you want to use Async Methods." - - - When overridden in a derived class, writes out the specified name, ensuring it is a valid NmToken according to the W3C XML 1.0 recommendation (http://www.w3.org/TR/1998/REC-xml-19980210#NT-Name). - The name to write. - name is not a valid NmToken; or name is either null or String.Empty. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - - - Asynchronously writes out the specified name, ensuring it is a valid NmToken according to the W3C XML 1.0 recommendation (http://www.w3.org/TR/1998/REC-xml-19980210#NT-Name). - The name to write. - The task that represents the asynchronous WriteNmToken operation. - An asynchronous method was called without setting the flag to true. In this case, is thrown with the message "Set XmlWriterSettings.Async to true if you want to use Async Methods." - - - When overridden in a derived class, copies everything from the reader to the writer and moves the reader to the start of the next sibling. - The to read from. - true to copy the default attributes from the XmlReader; otherwise, false. - reader is null. - reader contains invalid characters. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - - - Copies everything from the object to the writer. The position of the remains unchanged. - The to copy from. - true to copy the default attributes; otherwise, false. - navigator is null. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - - - Asynchronously copies everything from the reader to the writer and moves the reader to the start of the next sibling. - The to read from. - true to copy the default attributes from the XmlReader; otherwise, false. - The task that represents the asynchronous WriteNode operation. - An asynchronous method was called without setting the flag to true. In this case, is thrown with the message "Set XmlWriterSettings.Async to true if you want to use Async Methods." - - - Asynchronously copies everything from the object to the writer. The position of the remains unchanged. - The to copy from. - true to copy the default attributes; otherwise, false. - The task that represents the asynchronous WriteNode operation. - An asynchronous method was called without setting the flag to true. In this case, is thrown with the message "Set XmlWriterSettings.Async to true if you want to use Async Methods." - - - When overridden in a derived class, writes out a processing instruction with a space between the name and text as follows: <?name text?>. - The name of the processing instruction. - The text to include in the processing instruction. - The text would result in a non-well formed XML document. name is either null or String.Empty. This method is being used to create an XML declaration after has already been called. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - - - Asynchronously writes out a processing instruction with a space between the name and text as follows: <?name text?>. - The name of the processing instruction. - The text to include in the processing instruction. - The task that represents the asynchronous WriteProcessingInstruction operation. - An asynchronous method was called without setting the flag to true. In this case, is thrown with the message "Set XmlWriterSettings.Async to true if you want to use Async Methods." - - - When overridden in a derived class, writes out the namespace-qualified name. This method looks up the prefix that is in scope for the given namespace. - The local name to write. - The namespace URI for the name. - localName is either null or String.Empty. localName is not a valid name. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - - - Asynchronously writes out the namespace-qualified name. This method looks up the prefix that is in scope for the given namespace. - The local name to write. - The namespace URI for the name. - The task that represents the asynchronous WriteQualifiedName operation. - An asynchronous method was called without setting the flag to true. In this case, is thrown with the message "Set XmlWriterSettings.Async to true if you want to use Async Methods." - - - When overridden in a derived class, writes raw markup manually from a string. - String containing the text to write. - data is either null or String.Empty. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - - - When overridden in a derived class, writes raw markup manually from a character buffer. - Character array containing the text to write. - The position within the buffer indicating the start of the text to write. - The number of characters to write. - buffer is null. - index or count is less than zero. -or- The buffer length minus index is less than count. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - - - Asynchronously writes raw markup manually from a string. - String containing the text to write. - The task that represents the asynchronous WriteRaw operation. - An asynchronous method was called without setting the flag to true. In this case, is thrown with the message "Set XmlWriterSettings.Async to true if you want to use Async Methods." - - - Asynchronously writes raw markup manually from a character buffer. - Character array containing the text to write. - The position within the buffer indicating the start of the text to write. - The number of characters to write. - The task that represents the asynchronous WriteRaw operation. - An asynchronous method was called without setting the flag to true. In this case, is thrown with the message "Set XmlWriterSettings.Async to true if you want to use Async Methods." - - - Writes the start of an attribute with the specified local name. - The local name of the attribute. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - There is a character in the buffer that is a valid XML character but is not valid for the output encoding. For example, if the output encoding is ASCII, you should only use characters from the range of 0 to 127 for element and attribute names. The invalid character might be in the argument of this method or in an argument of previous methods that were writing to the buffer. Such characters are escaped by character entity references when possible (for example, in text nodes or attribute values). However, the character entity reference is not allowed in element and attribute names, comments, processing instructions, or CDATA sections. - - - Writes the start of an attribute with the specified local name and namespace URI. - The local name of the attribute. - The namespace URI of the attribute. - There is a character in the buffer that is a valid XML character but is not valid for the output encoding. For example, if the output encoding is ASCII, you should only use characters from the range of 0 to 127 for element and attribute names. The invalid character might be in the argument of this method or in an argument of previous methods that were writing to the buffer. Such characters are escaped by character entity references when possible (for example, in text nodes or attribute values). However, the character entity reference is not allowed in element and attribute names, comments, processing instructions, or CDATA sections. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - - - When overridden in a derived class, writes the start of an attribute with the specified prefix, local name, and namespace URI. - The namespace prefix of the attribute. - The local name of the attribute. - The namespace URI for the attribute. - There is a character in the buffer that is a valid XML character but is not valid for the output encoding. For example, if the output encoding is ASCII, you should only use characters from the range of 0 to 127 for element and attribute names. The invalid character might be in the argument of this method or in an argument of previous methods that were writing to the buffer. Such characters are escaped by character entity references when possible (for example, in text nodes or attribute values). However, the character entity reference is not allowed in element and attribute names, comments, processing instructions, or CDATA sections. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - - - Asynchronously writes the start of an attribute with the specified prefix, local name, and namespace URI. - The namespace prefix of the attribute. - The local name of the attribute. - The namespace URI for the attribute. - The task that represents the asynchronous WriteStartAttribute operation. - An asynchronous method was called without setting the flag to true. In this case, is thrown with the message "Set XmlWriterSettings.Async to true if you want to use Async Methods." - - - When overridden in a derived class, writes the XML declaration with the version "1.0". - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - - - When overridden in a derived class, writes the XML declaration with the version "1.0" and the standalone attribute. - If true, it writes "standalone=yes"; if false, it writes "standalone=no". - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - - - Asynchronously writes the XML declaration with the version "1.0" and the standalone attribute. - If true, it writes "standalone=yes"; if false, it writes "standalone=no". - The task that represents the asynchronous WriteStartDocument operation. - An asynchronous method was called without setting the flag to true. In this case, is thrown with the message "Set XmlWriterSettings.Async to true if you want to use Async Methods." - - - Asynchronously writes the XML declaration with the version "1.0". - The task that represents the asynchronous WriteStartDocument operation. - An asynchronous method was called without setting the flag to true. In this case, is thrown with the message "Set XmlWriterSettings.Async to true if you want to use Async Methods." - - - When overridden in a derived class, writes out a start tag with the specified local name. - The local name of the element. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - There is a character in the buffer that is a valid XML character but is not valid for the output encoding. For example, if the output encoding is ASCII, you should only use characters from the range of 0 to 127 for element and attribute names. The invalid character might be in the argument of this method or in an argument of previous methods that were writing to the buffer. Such characters are escaped by character entity references when possible (for example, in text nodes or attribute values). However, the character entity reference is not allowed in element and attribute names, comments, processing instructions, or CDATA sections. - - - When overridden in a derived class, writes the specified start tag and associates it with the given namespace. - The local name of the element. - The namespace URI to associate with the element. If this namespace is already in scope and has an associated prefix, the writer automatically writes that prefix also. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - There is a character in the buffer that is a valid XML character but is not valid for the output encoding. For example, if the output encoding is ASCII, you should only use characters from the range of 0 to 127 for element and attribute names. The invalid character might be in the argument of this method or in an argument of previous methods that were writing to the buffer. Such characters are escaped by character entity references when possible (for example, in text nodes or attribute values). However, the character entity reference is not allowed in element and attribute names, comments, processing instructions, or CDATA sections. - - - When overridden in a derived class, writes the specified start tag and associates it with the given namespace and prefix. - The namespace prefix of the element. - The local name of the element. - The namespace URI to associate with the element. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - There is a character in the buffer that is a valid XML character but is not valid for the output encoding. For example, if the output encoding is ASCII, you should only use characters from the range of 0 to 127 for element and attribute names. The invalid character might be in the argument of this method or in an argument of previous methods that were writing to the buffer. Such characters are escaped by character entity references when possible (for example, in text nodes or attribute values). However, the character entity reference is not allowed in element and attribute names, comments, processing instructions, or CDATA sections. - - - Asynchronously writes the specified start tag and associates it with the given namespace and prefix. - The namespace prefix of the element. - The local name of the element. - The namespace URI to associate with the element. - The task that represents the asynchronous WriteStartElement operation. - An asynchronous method was called without setting the flag to true. In this case, is thrown with the message "Set XmlWriterSettings.Async to true if you want to use Async Methods." - - - When overridden in a derived class, gets the state of the writer. - One of the values. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - - - When overridden in a derived class, writes the given text content. - The text to write. - The text string contains an invalid surrogate pair. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - - - Asynchronously writes the given text content. - The text to write. - The task that represents the asynchronous WriteString operation. - An asynchronous method was called without setting the flag to true. In this case, is thrown with the message "Set XmlWriterSettings.Async to true if you want to use Async Methods." - - - When overridden in a derived class, generates and writes the surrogate character entity for the surrogate character pair. - The low surrogate. This must be a value between 0xDC00 and 0xDFFF. - The high surrogate. This must be a value between 0xD800 and 0xDBFF. - An invalid surrogate character pair was passed. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - - - Asynchronously generates and writes the surrogate character entity for the surrogate character pair. - The low surrogate. This must be a value between 0xDC00 and 0xDFFF. - The high surrogate. This must be a value between 0xD800 and 0xDBFF. - The task that represents the asynchronous WriteSurrogateCharEntity operation. - An asynchronous method was called without setting the flag to true. In this case, is thrown with the message "Set XmlWriterSettings.Async to true if you want to use Async Methods." - - - Writes a value. - The value to write. - An invalid value was specified. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - - - Writes a single-precision floating-point number. - The single-precision floating-point number to write. - An invalid value was specified. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - - - Writes the object value. - The object value to write. Note With the release of the .NET Framework 3.5, this method accepts as a parameter. - An invalid value was specified. - The value is null. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - - - Writes a value. - The value to write. - An invalid value was specified. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - - - Writes a value. - The value to write. - An invalid value was specified. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - - - Writes a value. - The value to write. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - - - Writes a value. - The value to write. - An invalid value was specified. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - - - Writes a value. - The value to write. - An invalid value was specified. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - - - Writes a value. - The value to write. - An invalid value was specified. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - - - Writes a value. - The value to write. - An invalid value was specified. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - - - When overridden in a derived class, writes out the given white space. - The string of white space characters. - The string contains non-white space characters. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - - - Asynchronously writes out the given white space. - The string of white space characters. - The task that represents the asynchronous WriteWhitespace operation. - An asynchronous method was called without setting the flag to true. In this case, is thrown with the message "Set XmlWriterSettings.Async to true if you want to use Async Methods." - - - When overridden in a derived class, gets the current xml:lang scope. - The current xml:lang scope. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - - - When overridden in a derived class, gets an representing the current xml:space scope. -

An XmlSpace representing the current xml:space scope.

-
Value

-

Meaning

-

None This is the default if no xml:space scope exists.

-

Default The current scope is xml:space="default".

-

Preserve The current scope is xml:space="preserve".

-

-
- An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." -
- - Specifies a set of features to support on the object created by the method. - - - Initializes a new instance of the class. - - - Gets or sets a value that indicates whether asynchronous methods can be used on a particular instance. - true if asynchronous methods can be used; otherwise, false. - - - Gets or sets a value that indicates whether the XML writer should check to ensure that all characters in the document conform to the "2.2 Characters" section of the W3C XML 1.0 Recommendation. - true to do character checking; otherwise, false. The default is true. - - - Creates a copy of the instance. - The cloned object. - - - Gets or sets a value indicating whether the should also close the underlying stream or when the method is called. - true to also close the underlying stream or ; otherwise, false. The default is false. - - - Gets or sets the level of conformance that the XML writer checks the XML output for. - One of the enumeration values that specifies the level of conformance (document, fragment, or automatic detection). The default is . - - - Gets or sets a value that indicates whether the does not escape URI attributes. - true if the do not escape URI attributes; otherwise, false. - - - Gets or sets the type of text encoding to use. - The text encoding to use. The default is Encoding.UTF8. - - - Gets or sets a value indicating whether to indent elements. - true to write individual elements on new lines and indent; otherwise, false. The default is false. - - - Gets or sets the character string to use when indenting. This setting is used when the property is set to true. - The character string to use when indenting. This can be set to any string value. However, to ensure valid XML, you should specify only valid white space characters, such as space characters, tabs, carriage returns, or line feeds. The default is two spaces. - The value assigned to the is null. - - - Gets or sets a value that indicates whether the should remove duplicate namespace declarations when writing XML content. The default behavior is for the writer to output all namespace declarations that are present in the writer's namespace resolver. - The enumeration used to specify whether to remove duplicate namespace declarations in the . - - - Gets or sets the character string to use for line breaks. - The character string to use for line breaks. This can be set to any string value. However, to ensure valid XML, you should specify only valid white space characters, such as space characters, tabs, carriage returns, or line feeds. The default is \r\n (carriage return, new line). - The value assigned to the is null. - - - Gets or sets a value indicating whether to normalize line breaks in the output. - One of the values. The default is . - - - Gets or sets a value indicating whether to write attributes on a new line. - true to write attributes on individual lines; otherwise, false. The default is false. - This setting has no effect when the property value is `false`. - - When is set to true, each attribute is pre-pended with a new line and one extra level of indentation. - - - Gets or sets a value indicating whether to omit an XML declaration. - true to omit the XML declaration; otherwise, false. The default is false, an XML declaration is written. - - - Gets the method used to serialize the output. - One of the values. The default is . - - - Resets the members of the settings class to their default values. - - - Gets or sets a value that indicates whether the will add closing tags to all unclosed element tags when the method is called. - true if all unclosed element tags will be closed out; otherwise, false. The default value is true. - - - This class contains the LINQ to XML extension methods that enable you to evaluate XPath expressions. - - - Creates an for an . - An that can process XPath queries. - An that can process XPath queries. - - - Creates an for an . The enables more efficient XPath expression processing. - An that can process an XPath query. - A to be used by . - An that can process XPath queries. - - - Evaluates an XPath expression. - The on which to evaluate the XPath expression. - A that contains an XPath expression. - An object that can contain a bool, a double, a string, or an . - - - Evaluates an XPath expression, resolving namespace prefixes using the specified . - The on which to evaluate the XPath expression. - A that contains an XPath expression. - A for the namespace prefixes in the XPath expression. - An object that contains the result of evaluating the expression. The object can be a bool, a double, a string, or an . - - - Selects an using a XPath expression. - The on which to evaluate the XPath expression. - A that contains an XPath expression. - An , or null. - - - Selects an using a XPath expression, resolving namespace prefixes using the specified . - The on which to evaluate the XPath expression. - A that contains an XPath expression. - An for the namespace prefixes in the XPath expression. - An , or null. - - - Selects a collection of elements using an XPath expression. - The on which to evaluate the XPath expression. - A that contains an XPath expression. - An of that contains the selected elements. - - - Selects a collection of elements using an XPath expression, resolving namespace prefixes using the specified . - The on which to evaluate the XPath expression. - A that contains an XPath expression. - A for the namespace prefixes in the XPath expression. - An of that contains the selected elements. - - - Provides an accessor to the class. - - - Returns a new object. - An object. - - - - - - - - - - Specifies the sort order for uppercase and lowercase letters. - - - Lowercase letters are sorted before uppercase letters. - - - - Ignore the case. - - - - Uppercase letters are sorted before lowercase letters. - - - - Specifies the data type used to determine sort order. - - - Values are sorted numerically. - - - - Values are sorted alphabetically. - - - - Specifies the sort order. - - - Nodes are sorted in ascending order. For example, if the numbers 1,2,3, and 4 are sorted in ascending order, they appear as 1,2,3,4. - - - - Nodes are sorted in descending order. For example, if the numbers 1,2,3, and 4 are sorted in descending order, they appear as, 4,3,2,1. - - - - Provides a fast, read-only, in-memory representation of an XML document by using the XPath data model. - - - Initializes a new instance of the class from the XML data in the specified object. - The object that contains the XML data. - An error was encountered in the XML data. The remains empty. - The object passed as a parameter is null. - - - Initializes a new instance of the class from the XML data that is contained in the specified object. - The object that contains the XML data. - An error was encountered in the XML data. The remains empty. - The object passed as a parameter is null. - - - Initializes a new instance of the class from the XML data in the specified file. - The path of the file that contains the XML data. - An error was encountered in the XML data. The remains empty. - The file path parameter is null. - - - Initializes a new instance of the class from the XML data that is contained in the specified object. - The object that contains the XML data. - An error was encountered in the XML data. The remains empty. - The object passed as a parameter is null. - - - Initializes a new instance of the class from the XML data in the file specified with the white space handling specified. - The path of the file that contains the XML data. - An object. - An error was encountered in the XML data. The remains empty. - The file path parameter or object parameter is null. - - - Initializes a new instance of the class from the XML data that is contained in the specified object with the specified white space handling. - The object that contains the XML data. - An object. - An error was encountered in the XML data. The remains empty. - The object parameter or object parameter is null. - - - Initializes a read-only object for navigating through nodes in this . - A read-only object. - - - Provides the exception thrown when an error occurs while processing an XPath expression. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with the specified exception message. - The description of the error condition. - - - Uses the information in the and objects to initialize a new instance of the class. - The object that contains all the properties of an . - The object. - - - Initializes a new instance of the class using the specified exception message and object. - The description of the error condition. - The that threw the , if any. This value can be null. - - - Streams all the properties into the class for the specified . - The object. - The object. - - - Gets the description of the error condition for this exception. - The string description of the error condition for this exception. - - - Provides a typed class that represents a compiled XPath expression. - - - When overridden in a derived class, sorts the nodes selected by the XPath expression according to the specified object. - An object representing the sort key. This can be the string value of the node or an object with a compiled XPath expression. - An object that provides the specific data type comparisons for comparing two objects for equivalence. - The or sort key includes a prefix and either an is not provided, or the prefix cannot be found in the supplied . - - - When overridden in a derived class, sorts the nodes selected by the XPath expression according to the supplied parameters. - An object representing the sort key. This can be the string value of the node or an object with a compiled XPath expression. - An value indicating the sort order. - An value indicating how to sort uppercase and lowercase letters. - The language to use for comparison. Uses the class that can be passed to the method for the language types, for example, "us-en" for U.S. English. If an empty string is specified, the system environment is used to determine the . - An value indicating the sort order for the data type. - The or sort key includes a prefix and either an is not provided, or the prefix cannot be found in the supplied . - - - When overridden in a derived class, returns a clone of this . - A new object. - - - Compiles the XPath expression specified and returns an object representing the XPath expression. - An XPath expression. - An object. - The XPath expression parameter is not a valid XPath expression. - The XPath expression is not valid. - - - Compiles the specified XPath expression, with the object specified for namespace resolution, and returns an object that represents the XPath expression. - An XPath expression. - An object that implements the interface for namespace resolution. - An object. - The XPath expression parameter is not a valid XPath expression. - The XPath expression is not valid. - - - When overridden in a derived class, gets a string representation of the . - A string representation of the . - - - When overridden in a derived class, gets the result type of the XPath expression. - An value representing the result type of the XPath expression. - - - When overridden in a derived class, specifies the object to use for namespace resolution. - An object that implements the interface to use for namespace resolution. - The object parameter is not derived from . - - - When overridden in a derived class, specifies the object to use for namespace resolution. - An object to use for namespace resolution. - The object parameter is not derived from the class. - - - Represents an item in the XQuery 1.0 and XPath 2.0 Data Model. - - - Initializes a new instance of the class. - - - When overridden in a derived class, gets a value indicating whether the item represents an XPath node or an atomic value. - true if the item represents an XPath node; false if the item represents an atomic value. - - - When overridden in a derived class, gets the current item as a boxed object of the most appropriate .NET Framework 2.0 type according to its schema type. - The current item as a boxed object of the most appropriate .NET Framework type. - - - When overridden in a derived class, gets the string value of the item. - The string value of the item. - - - Returns the item's value as the specified type. - The type to return the item value as. - The value of the item as the type requested. - The item's value is not in the correct format for the target type. - The attempted cast is not valid. - The attempted cast resulted in an overflow. - - - When overridden in a derived class, returns the item's value as the type specified using the object specified to resolve namespace prefixes. - The type to return the item's value as. - The object used to resolve namespace prefixes. - The value of the item as the type requested. - The item's value is not in the correct format for the target type. - The attempted cast is not valid. - The attempted cast resulted in an overflow. - - - When overridden in a derived class, gets the item's value as a . - The item's value as a . - The item's value is not in the correct format for the type. - The attempted cast to is not valid. - - - When overridden in a derived class, gets the item's value as a . - The item's value as a . - The item's value is not in the correct format for the type. - The attempted cast to is not valid. - - - When overridden in a derived class, gets the item's value as a . - The item's value as a . - The item's value is not in the correct format for the type. - The attempted cast to is not valid. - The attempted cast resulted in an overflow. - - - When overridden in a derived class, gets the item's value as an . - The item's value as an . - The item's value is not in the correct format for the type. - The attempted cast to is not valid. - The attempted cast resulted in an overflow. - - - When overridden in a derived class, gets the item's value as an . - The item's value as an . - The item's value is not in the correct format for the type. - The attempted cast to is not valid. - The attempted cast resulted in an overflow. - - - When overridden in a derived class, gets the .NET Framework 2.0 type of the item. - The .NET Framework type of the item. The default value is . - - - When overridden in a derived class, gets the for the item. - The for the item. - - - Defines the namespace scope. - - - Returns all namespaces defined in the scope of the current node. This includes the xmlns:xml namespace which is always declared implicitly. The order of the namespaces returned is not defined. - - - - Returns all namespaces defined in the scope of the current node, excluding the xmlns:xml namespace. The xmlns:xml namespace is always declared implicitly. The order of the namespaces returned is not defined. - - - - Returns all namespaces that are defined locally at the current node. - - - - Provides a cursor model for navigating and editing XML data. - - - Initializes a new instance of the class. - - - Returns an object used to create one or more new child nodes at the end of the list of child nodes of the current node. - An object used to create new child nodes at the end of the list of child nodes of the current node. - The current node the is positioned on is not the root node or an element node. - The does not support editing. - - - Creates a new child node at the end of the list of child nodes of the current node using the XML data string specified. - The XML data string for the new child node. - The XML data string parameter is null. - The current node the is positioned on is not the root node or an element node. - The does not support editing. - The XML data string parameter is not well-formed. - - - Creates a new child node at the end of the list of child nodes of the current node using the XML contents of the object specified. - An object positioned on the XML data for the new child node. - The object is in an error state or closed. - The object parameter is null. - The current node the is positioned on is not the root node or an element node. - The does not support editing. - The XML contents of the object parameter is not well-formed. - - - Creates a new child node at the end of the list of child nodes of the current node using the nodes in the specified. - An object positioned on the node to add as the new child node. - The object parameter is null. - The current node the is positioned on is not the root node or an element node. - The does not support editing. - - - Creates a new child element node at the end of the list of child nodes of the current node using the namespace prefix, local name and namespace URI specified with the value specified. - The namespace prefix of the new child element node (if any). - The local name of the new child element node (if any). - The namespace URI of the new child element node (if any). and null are equivalent. - The value of the new child element node. If or null are passed, an empty element is created. - The current node the is positioned on is not the root node or an element node. - The does not support editing. - - - When overridden in a derived class, gets the base URI for the current node. - The location from which the node was loaded, or if there is no value. - - - Gets a value indicating whether the can edit the underlying XML data. - true if the can edit the underlying XML data; otherwise false. - - - Verifies that the XML data in the conforms to the XML Schema definition language (XSD) schema provided. - The containing the schemas used to validate the XML data contained in the . - The that receives information about schema validation warnings and errors. - true if no schema validation errors occurred; otherwise, false. - A schema validation error occurred, and no was specified to handle validation errors. - The is positioned on a node that is not an element, attribute, or the root node or there is not type information to perform validation. - The method was called with an parameter when the was not positioned on the root node of the XML data. - - - When overridden in a derived class, creates a new positioned at the same node as this . - A new positioned at the same node as this . - - - Compares the position of the current with the position of the specified. - The to compare against. - An value representing the comparative position of the two objects. - - - Compiles a string representing an XPath expression and returns an object. - A string representing an XPath expression. - An object representing the XPath expression. - The xpath parameter contains an XPath expression that is not valid. - The XPath expression is not valid. - - - Creates an attribute node on the current element node using the namespace prefix, local name and namespace URI specified with the value specified. - The namespace prefix of the new attribute node (if any). - The local name of the new attribute node which cannot or null. - The namespace URI for the new attribute node (if any). - The value of the new attribute node. If or null are passed, an empty attribute node is created. - The is not positioned on an element node. - The does not support editing. - - - Returns an object used to create new attributes on the current element. - An object used to create new attributes on the current element. - The is not positioned on an element node. - The does not support editing. - - - Returns a copy of the . - An copy of this . - - - Deletes a range of sibling nodes from the current node to the node specified. - An positioned on the last sibling node in the range to delete. - The specified is null. - The does not support editing. - The last node to delete specified is not a valid sibling node of the current node. - - - Deletes the current node and its child nodes. - The is positioned on a node that cannot be deleted such as the root node or a namespace node. - The does not support editing. - - - Evaluates the specified XPath expression and returns the typed result. - A string representing an XPath expression that can be evaluated. - The result of the expression (Boolean, number, string, or node set). This maps to , , , or objects respectively. - The return type of the XPath expression is a node set. - The XPath expression is not valid. - - - Evaluates the and returns the typed result. - An that can be evaluated. - The result of the expression (Boolean, number, string, or node set). This maps to , , , or objects respectively. - The return type of the XPath expression is a node set. - The XPath expression is not valid. - - - Evaluates the specified XPath expression and returns the typed result, using the object specified to resolve namespace prefixes in the XPath expression. - A string representing an XPath expression that can be evaluated. - The object used to resolve namespace prefixes in the XPath expression. - The result of the expression (Boolean, number, string, or node set). This maps to , , , or objects respectively. - The return type of the XPath expression is a node set. - The XPath expression is not valid. - - - Uses the supplied context to evaluate the , and returns the typed result. - An that can be evaluated. - An that points to the selected node set that the evaluation is to be performed on. - The result of the expression (Boolean, number, string, or node set). This maps to , , , or objects respectively. - The return type of the XPath expression is a node set. - The XPath expression is not valid. - - - Gets the value of the attribute with the specified local name and namespace URI. - The local name of the attribute. localName is case-sensitive. - The namespace URI of the attribute. - A that contains the value of the specified attribute; if a matching attribute is not found, or if the is not positioned on an element node. - - - Returns the value of the namespace node corresponding to the specified local name. - The local name of the namespace node. - A that contains the value of the namespace node; if a matching namespace node is not found, or if the is not positioned on an element node. - - - Returns the in-scope namespaces of the current node. - An value specifying the namespaces to return. - An collection of namespace names keyed by prefix. - - - Gets a value indicating whether the current node has any attributes. - Returns true if the current node has attributes; returns false if the current node has no attributes, or if the is not positioned on an element node. - - - Gets a value indicating whether the current node has any child nodes. - true if the current node has any child nodes; otherwise, false. - - - Gets or sets the markup representing the child nodes of the current node. - A that contains the markup of the child nodes of the current node. - The property cannot be set. - - - Creates a new sibling node after the currently selected node using the nodes in the object specified. - An object positioned on the node to add as the new sibling node. - The object parameter is null. - The position of the does not allow a new sibling node to be inserted after the current node. - The does not support editing. - - - Creates a new sibling node after the currently selected node using the XML contents of the object specified. - An object positioned on the XML data for the new sibling node. - The object is in an error state or closed. - The object parameter is null. - The position of the does not allow a new sibling node to be inserted after the current node. - The does not support editing. - The XML contents of the object parameter is not well-formed. - - - Returns an object used to create a new sibling node after the currently selected node. - An object used to create a new sibling node after the currently selected node. - The position of the does not allow a new sibling node to be inserted after the current node. - The does not support editing. - - - Creates a new sibling node after the currently selected node using the XML string specified. - The XML data string for the new sibling node. - The XML string parameter is null. - The position of the does not allow a new sibling node to be inserted after the current node. - The does not support editing. - The XML string parameter is not well-formed. - - - Returns an object used to create a new sibling node before the currently selected node. - An object used to create a new sibling node before the currently selected node. - The position of the does not allow a new sibling node to be inserted before the current node. - The does not support editing. - - - Creates a new sibling node before the currently selected node using the XML string specified. - The XML data string for the new sibling node. - The XML string parameter is null. - The position of the does not allow a new sibling node to be inserted before the current node. - The does not support editing. - The XML string parameter is not well-formed. - - - Creates a new sibling node before the currently selected node using the XML contents of the object specified. - An object positioned on the XML data for the new sibling node. - The object is in an error state or closed. - The object parameter is null. - The position of the does not allow a new sibling node to be inserted before the current node. - The does not support editing. - The XML contents of the object parameter is not well-formed. - - - Creates a new sibling node before the currently selected node using the nodes in the specified. - An object positioned on the node to add as the new sibling node. - The object parameter is null. - The position of the does not allow a new sibling node to be inserted before the current node. - The does not support editing. - - - Creates a new sibling element after the current node using the namespace prefix, local name and namespace URI specified, with the value specified. - The namespace prefix of the new child element (if any). - The local name of the new child element (if any). - The namespace URI of the new child element (if any). and null are equivalent. - The value of the new child element. If or null are passed, an empty element is created. - The position of the does not allow a new sibling node to be inserted after the current node. - The does not support editing. - - - Creates a new sibling element before the current node using the namespace prefix, local name, and namespace URI specified, with the value specified. - The namespace prefix of the new child element (if any). - The local name of the new child element (if any). - The namespace URI of the new child element (if any). and null are equivalent. - The value of the new child element. If or null are passed, an empty element is created. - The position of the does not allow a new sibling node to be inserted before the current node. - The does not support editing. - - - Determines whether the specified is a descendant of the current . - The to compare to this . - true if the specified is a descendant of the current ; otherwise, false. - - - When overridden in a derived class, gets a value indicating whether the current node is an empty element without an end element tag. - true if the current node is an empty element; otherwise, false. - - - Gets a value indicating if the current node represents an XPath node. - Always returns true. - - - When overridden in a derived class, determines whether the current is at the same position as the specified . - The to compare to this . - true if the two objects have the same position; otherwise, false. - - - When overridden in a derived class, gets the of the current node without any namespace prefix. - A that contains the local name of the current node, or if the current node does not have a name (for example, text or comment nodes). - - - Gets the namespace URI for the specified prefix. - The prefix whose namespace URI you want to resolve. To match the default namespace, pass . - A that contains the namespace URI assigned to the namespace prefix specified; null if no namespace URI is assigned to the prefix specified. The returned is atomized. - - - Gets the prefix declared for the specified namespace URI. - The namespace URI to resolve for the prefix. - A that contains the namespace prefix assigned to the namespace URI specified; otherwise, if no prefix is assigned to the namespace URI specified. The returned is atomized. - - - Determines whether the current node matches the specified XPath expression. - The XPath expression. - true if the current node matches the specified XPath expression; otherwise, false. - The XPath expression cannot be evaluated. - The XPath expression is not valid. - - - Determines whether the current node matches the specified . - An object containing the compiled XPath expression. - true if the current node matches the ; otherwise, false. - The XPath expression cannot be evaluated. - The XPath expression is not valid. - - - When overridden in a derived class, moves the to the same position as the specified . - The positioned on the node that you want to move to. - Returns true if the is successful moving to the same position as the specified ; otherwise, false. If false, the position of the is unchanged. - - - Moves the to the attribute with the matching local name and namespace URI. - The local name of the attribute. - The namespace URI of the attribute; null for an empty namespace. - Returns true if the is successful moving to the attribute; otherwise, false. If false, the position of the is unchanged. - - - Moves the to the child node of the specified. - The of the child node to move to. - Returns true if the is successful moving to the child node; otherwise, false. If false, the position of the is unchanged. - - - Moves the to the child node with the local name and namespace URI specified. - The local name of the child node to move to. - The namespace URI of the child node to move to. - Returns true if the is successful moving to the child node; otherwise, false. If false, the position of the is unchanged. - - - Moves the to the first sibling node of the current node. - Returns true if the is successful moving to the first sibling node of the current node; false if there is no first sibling, or if the is currently positioned on an attribute node. If the is already positioned on the first sibling, will return true and will not move its position. If returns false because there is no first sibling, or if is currently positioned on an attribute, the position of the is unchanged. - - - When overridden in a derived class, moves the to the first attribute of the current node. - Returns true if the is successful moving to the first attribute of the current node; otherwise, false. If false, the position of the is unchanged. - - - When overridden in a derived class, moves the to the first child node of the current node. - Returns true if the is successful moving to the first child node of the current node; otherwise, false. If false, the position of the is unchanged. - - - When overridden in a derived class, moves the to the first namespace node that matches the specified. - An value describing the namespace scope. - Returns true if the is successful moving to the first namespace node; otherwise, false. If false, the position of the is unchanged. - - - Moves the to first namespace node of the current node. - Returns true if the is successful moving to the first namespace node; otherwise, false. If false, the position of the is unchanged. - - - Moves the to the element with the local name and namespace URI specified, to the boundary specified, in document order. - The local name of the element. - The namespace URI of the element. - The object positioned on the element boundary which the current will not move past while searching for the following element. - true if the moved successfully; otherwise false. - - - Moves the to the following element of the specified, to the boundary specified, in document order. - The of the element. The cannot be or . - The object positioned on the element boundary which the current will not move past while searching for the following element. - true if the moved successfully; otherwise false. - - - Moves the to the element with the local name and namespace URI specified in document order. - The local name of the element. - The namespace URI of the element. - true if the moved successfully; otherwise false. - - - Moves the to the following element of the specified in document order. - The of the element. The cannot be or . - true if the moved successfully; otherwise false. - - - When overridden in a derived class, moves to the node that has an attribute of type ID whose value matches the specified . - A representing the ID value of the node to which you want to move. - true if the is successful moving; otherwise, false. If false, the position of the navigator is unchanged. - - - Moves the to the namespace node with the specified namespace prefix. - The namespace prefix of the namespace node. - true if the is successful moving to the specified namespace; false if a matching namespace node was not found, or if the is not positioned on an element node. If false, the position of the is unchanged. - - - When overridden in a derived class, moves the to the next sibling node of the current node. - true if the is successful moving to the next sibling node; otherwise, false if there are no more siblings or if the is currently positioned on an attribute node. If false, the position of the is unchanged. - - - Moves the to the next sibling node of the current node that matches the specified. - The of the sibling node to move to. - true if the is successful moving to the next sibling node; otherwise, false if there are no more siblings or if the is currently positioned on an attribute node. If false, the position of the is unchanged. - - - Moves the to the next sibling node with the local name and namespace URI specified. - The local name of the next sibling node to move to. - The namespace URI of the next sibling node to move to. - Returns true if the is successful moving to the next sibling node; false if there are no more siblings, or if the is currently positioned on an attribute node. If false, the position of the is unchanged. - - - When overridden in a derived class, moves the to the next attribute. - Returns true if the is successful moving to the next attribute; false if there are no more attributes. If false, the position of the is unchanged. - - - Moves the to the next namespace node. - Returns true if the is successful moving to the next namespace node; otherwise, false. If false, the position of the is unchanged. - - - When overridden in a derived class, moves the to the next namespace node matching the specified. - An value describing the namespace scope. - Returns true if the is successful moving to the next namespace node; otherwise, false. If false, the position of the is unchanged. - - - When overridden in a derived class, moves the to the parent node of the current node. - Returns true if the is successful moving to the parent node of the current node; otherwise, false. If false, the position of the is unchanged. - - - When overridden in a derived class, moves the to the previous sibling node of the current node. - Returns true if the is successful moving to the previous sibling node; otherwise, false if there is no previous sibling node or if the is currently positioned on an attribute node. If false, the position of the is unchanged. - - - Moves the to the root node that the current node belongs to. - - - When overridden in a derived class, gets the qualified name of the current node. - A that contains the qualified of the current node, or if the current node does not have a name (for example, text or comment nodes). - - - When overridden in a derived class, gets the namespace URI of the current node. - A that contains the namespace URI of the current node, or if the current node has no namespace URI. - - - When overridden in a derived class, gets the of the . - An object enabling you to get the atomized version of a within the XML document. - - - Gets an used for equality comparison of objects. - An used for equality comparison of objects. - - - When overridden in a derived class, gets the of the current node. - One of the values representing the current node. - - - Gets or sets the markup representing the opening and closing tags of the current node and its child nodes. - A that contains the markup representing the opening and closing tags of the current node and its child nodes. - - - When overridden in a derived class, gets the namespace prefix associated with the current node. - A that contains the namespace prefix associated with the current node. - - - Returns an object used to create a new child node at the beginning of the list of child nodes of the current node. - An object used to create a new child node at the beginning of the list of child nodes of the current node. - The current node the is positioned on does not allow a new child node to be prepended. - The does not support editing. - - - Creates a new child node at the beginning of the list of child nodes of the current node using the XML string specified. - The XML data string for the new child node. - The XML string parameter is null. - The current node the is positioned on does not allow a new child node to be prepended. - The does not support editing. - The XML string parameter is not well-formed. - - - Creates a new child node at the beginning of the list of child nodes of the current node using the XML contents of the object specified. - An object positioned on the XML data for the new child node. - The object is in an error state or closed. - The object parameter is null. - The current node the is positioned on does not allow a new child node to be prepended. - The does not support editing. - The XML contents of the object parameter is not well-formed. - - - Creates a new child node at the beginning of the list of child nodes of the current node using the nodes in the object specified. - An object positioned on the node to add as the new child node. - The object parameter is null. - The current node the is positioned on does not allow a new child node to be prepended. - The does not support editing. - - - Creates a new child element at the beginning of the list of child nodes of the current node using the namespace prefix, local name, and namespace URI specified with the value specified. - The namespace prefix of the new child element (if any). - The local name of the new child element (if any). - The namespace URI of the new child element (if any). and null are equivalent. - The value of the new child element. If or null are passed, an empty element is created. - The current node the is positioned on does not allow a new child node to be prepended. - The does not support editing. - - - Returns an object that contains the current node and its child nodes. - An object that contains the current node and its child nodes. - The is not positioned on an element node or the root node. - - - Replaces a range of sibling nodes from the current node to the node specified. - An positioned on the last sibling node in the range to replace. - An object used to specify the replacement range. - The specified is null. - The does not support editing. - The last node to replace specified is not a valid sibling node of the current node. - - - Replaces the current node with the contents of the object specified. - An object positioned on the new node. - The object parameter is null. - The is not positioned on an element, text, processing instruction, or comment node. - The does not support editing. - The XML contents of the object parameter is not well-formed. - - - Replaces the current node with the content of the string specified. - The XML data string for the new node. - The XML string parameter is null. - The is not positioned on an element, text, processing instruction, or comment node. - The does not support editing. - The XML string parameter is not well-formed. - - - Replaces the current node with the contents of the object specified. - An object positioned on the XML data for the new node. - The object is in an error state or closed. - The object parameter is null. - The is not positioned on an element, text, processing instruction, or comment node. - The does not support editing. - The XML contents of the object parameter is not well-formed. - - - Gets the schema information that has been assigned to the current node as a result of schema validation. - An object that contains the schema information for the current node. - - - Selects a node set, using the specified XPath expression. - A representing an XPath expression. - An pointing to the selected node set. - The XPath expression contains an error or its return type is not a node set. - The XPath expression is not valid. - - - Selects a node set using the specified . - An object containing the compiled XPath query. - An that points to the selected node set. - The XPath expression contains an error or its return type is not a node set. - The XPath expression is not valid. - - - Selects a node set using the specified XPath expression with the object specified to resolve namespace prefixes. - A representing an XPath expression. - The object used to resolve namespace prefixes. - An that points to the selected node set. - The XPath expression contains an error or its return type is not a node set. - The XPath expression is not valid. - - - Selects all the ancestor nodes of the current node that have a matching . - The of the ancestor nodes. - To include the context node in the selection, true; otherwise, false. - An that contains the selected nodes. The returned nodes are in reverse document order. - - - Selects all the ancestor nodes of the current node that have the specified local name and namespace URI. - The local name of the ancestor nodes. - The namespace URI of the ancestor nodes. - To include the context node in the selection, true; otherwise, false. - An that contains the selected nodes. The returned nodes are in reverse document order. - null cannot be passed as a parameter. - - - Selects all the child nodes of the current node that have the matching . - The of the child nodes. - An that contains the selected nodes. - - - Selects all the child nodes of the current node that have the local name and namespace URI specified. - The local name of the child nodes. - The namespace URI of the child nodes. - An that contains the selected nodes. - null cannot be passed as a parameter. - - - Selects all the descendant nodes of the current node that have a matching . - The of the descendant nodes. - true to include the context node in the selection; otherwise, false. - An that contains the selected nodes. - - - Selects all the descendant nodes of the current node with the local name and namespace URI specified. - The local name of the descendant nodes. - The namespace URI of the descendant nodes. - true to include the context node in the selection; otherwise, false. - An that contains the selected nodes. - null cannot be passed as a parameter. - - - Selects a single node in the object using the specified XPath query with the object specified to resolve namespace prefixes. - A representing an XPath expression. - The object used to resolve namespace prefixes in the XPath query. - An object that contains the first matching node for the XPath query specified; otherwise null if there are no query results. - An error was encountered in the XPath query or the return type of the XPath expression is not a node. - The XPath query is not valid. - - - Selects a single node in the using the specified XPath query. - A representing an XPath expression. - An object that contains the first matching node for the XPath query specified; otherwise, null if there are no query results. - An error was encountered in the XPath query or the return type of the XPath expression is not a node. - The XPath query is not valid. - - - Selects a single node in the using the specified object. - An object containing the compiled XPath query. - An object that contains the first matching node for the XPath query specified; otherwise null if there are no query results. - An error was encountered in the XPath query or the return type of the XPath expression is not a node. - The XPath query is not valid. - - - Sets the typed value of the current node. - The new typed value of the node. - The does not support the type of the object specified. - The value specified cannot be null. - The is not positioned on an element or attribute node. - The does not support editing. - - - Sets the value of the current node. - The new value of the node. - The value parameter is null. - The is positioned on the root node, a namespace node, or the specified value is invalid. - The does not support editing. - - - Gets the text value of the current node. - A string that contains the text value of the current node. - - - Gets the current node as a boxed object of the most appropriate .NET Framework type. - The current node as a boxed object of the most appropriate .NET Framework type. - - - Used by implementations which provide a "virtualized" XML view over a store, to provide access to underlying objects. - The default is null. - - - Gets the current node's value as the specified, using the object specified to resolve namespace prefixes. - The to return the current node's value as. - The object used to resolve namespace prefixes. - The value of the current node as the requested. - The current node's value is not in the correct format for the target type. - The attempted cast is not valid. - - - Gets the current node's value as a . - The current node's value as a . - The current node's string value cannot be converted to a . - The attempted cast to is not valid. - - - Gets the current node's value as a . - The current node's value as a . - The current node's string value cannot be converted to a . - The attempted cast to is not valid. - - - Gets the current node's value as a . - The current node's value as a . - The current node's string value cannot be converted to a . - The attempted cast to is not valid. - - - Gets the current node's value as an . - The current node's value as an . - The current node's string value cannot be converted to a . - The attempted cast to is not valid. - - - Gets the current node's value as an . - The current node's value as an . - The current node's string value cannot be converted to a . - The attempted cast to is not valid. - - - Gets the .NET Framework of the current node. - The .NET Framework of the current node. The default value is . - - - Streams the current node and its child nodes to the object specified. - The object to stream to. - - - Gets the xml:lang scope for the current node. - A that contains the value of the xml:lang scope, or if the current node has no xml:lang scope value to return. - - - Gets the information for the current node. - An object; default is null. - - - Creates a new copy of the object. - A new copy of the object. - - - Provides an iterator over a selected set of nodes. - - - Initializes a new instance of the class. - - - When overridden in a derived class, returns a clone of this object. - A new object clone of this object. - - - Gets the index of the last node in the selected set of nodes. - The index of the last node in the selected set of nodes, or 0 if there are no selected nodes. - - - When overridden in a derived class, gets the object for this , positioned on the current context node. - An object positioned on the context node from which the node set was selected. The method must be called to move the to the first node in the selected set. - - - When overridden in a derived class, gets the index of the current position in the selected set of nodes. - The index of the current position. - - - Returns an object to iterate through the selected node set. - An object to iterate through the selected node set. - - - When overridden in a derived class, moves the object returned by the property to the next node in the selected node set. - true if the object moved to the next node; false if there are no more selected nodes. - - - Creates a new object that is a copy of the current instance. - A new object that is a copy of this instance. - - - Defines the XPath node types that can be returned from the class. - - - Any of the node types. - - - - An attribute, such as id='123'. - - - - A comment, such as <!-- my comment --> - - - - An element, such as . - - - - A namespace, such as xmlns="namespace". - - - - A processing instruction, such as <?pi test?>. This does not include XML declarations, which are not visible to the class. - - - - The root node of the XML document or node tree. - - - - A node with white space characters and xml:space set to preserve. - - - - The text content of a node. Equivalent to the Document Object Model (DOM) Text and CDATA node types. Contains at least one character. - - - - A node with only white space characters and no significant white space. White space characters are #x20, #x9, #xD, or #xA. - - - - Specifies the return type of the XPath expression. - - - Any of the XPath node types. - - - - A true or false value. - - - - The expression does not evaluate to the correct XPath type. - - - - A tree fragment. - - - - A node collection. - - - - A numeric value. - - - - A value. - - - - Provides an interface to a given function defined in the Extensible Stylesheet Language for Transformations (XSLT) style sheet during runtime execution. - - - Gets the supplied XML Path Language (XPath) types for the function's argument list. This information can be used to discover the signature of the function which allows you to differentiate between overloaded functions. - An array of representing the types for the function's argument list. - - - Provides the method to invoke the function with the given arguments in the given context. - The XSLT context for the function call. - The arguments of the function call. Each argument is an element in the array. - The context node for the function call. - An representing the return value of the function. - - - Gets the maximum number of arguments for the function. This enables the user to differentiate between overloaded functions. - The maximum number of arguments for the function. - - - Gets the minimum number of arguments for the function. This enables the user to differentiate between overloaded functions. - The minimum number of arguments for the function. - - - Gets the representing the XPath type returned by the function. - An representing the XPath type returned by the function - - - Provides an interface to a given variable that is defined in the style sheet during runtime execution. - - - Evaluates the variable at runtime and returns an object that represents the value of the variable. - An representing the execution context of the variable. - An representing the value of the variable. Possible return types include number, string, Boolean, document fragment, or node set. - - - Gets a value indicating whether the variable is local. - true if the variable is a local variable in the current context; otherwise, false. - - - Gets a value indicating whether the variable is an Extensible Stylesheet Language Transformations (XSLT) parameter. This can be a parameter to a style sheet or a template. - true if the variable is an XSLT parameter; otherwise, false. - - - Gets the representing the XML Path Language (XPath) type of the variable. - The representing the XPath type of the variable. - - - Supplies a hash code for an object, using a hashing algorithm that ignores the case of strings. - - - Initializes a new instance of the class using the of the current thread. - - - Initializes a new instance of the class using the specified . - The to use for the new . - culture is null. - - - Gets an instance of that is associated with the of the current thread and that is always available. - An instance of that is associated with the of the current thread. - - - Gets an instance of that is associated with and that is always available. - An instance of that is associated with . - - - Returns a hash code for the given object, using a hashing algorithm that ignores the case of strings. - The for which a hash code is to be returned. - A hash code for the given object, using a hashing algorithm that ignores the case of strings. - obj is null. - - - Provides the abstract base class for a strongly typed collection. - - - Initializes a new instance of the class with the default initial capacity. - - - Initializes a new instance of the class with the specified capacity. - The number of elements that the new list can initially store. - - - Gets or sets the number of elements that the can contain. - The number of elements that the can contain. - is set to a value that is less than . - There is not enough memory available on the system. - - - Removes all objects from the instance. This method cannot be overridden. - - - Gets the number of elements contained in the instance. This property cannot be overridden. - The number of elements contained in the instance. Retrieving the value of this property is an O(1) operation. - - - Returns an enumerator that iterates through the instance. - An for the instance. - - - Gets an containing the list of elements in the instance. - An representing the instance itself. Retrieving the value of this property is an O(1) operation. - - - Gets an containing the list of elements in the instance. - An representing the instance itself. - - - Performs additional custom processes when clearing the contents of the instance. - - - Performs additional custom processes after clearing the contents of the instance. - - - Performs additional custom processes before inserting a new element into the instance. - The zero-based index at which to insert value. - The new value of the element at index. - - - Performs additional custom processes after inserting a new element into the instance. - The zero-based index at which to insert value. - The new value of the element at index. - - - Performs additional custom processes when removing an element from the instance. - The zero-based index at which value can be found. - The value of the element to remove from index. - - - Performs additional custom processes after removing an element from the instance. - The zero-based index at which value can be found. - The value of the element to remove from index. - - - Performs additional custom processes before setting a value in the instance. - The zero-based index at which oldValue can be found. - The value to replace with newValue. - The new value of the element at index. - - - Performs additional custom processes after setting a value in the instance. - The zero-based index at which oldValue can be found. - The value to replace with newValue. - The new value of the element at index. - - - Performs additional custom processes when validating a value. - The object to validate. - value is null. - - - Removes the element at the specified index of the instance. This method is not overridable. - The zero-based index of the element to remove. - index is less than zero. -or- index is equal to or greater than . - - - Copies the entire to a compatible one-dimensional , starting at the specified index of the target array. - The one-dimensional that is the destination of the elements copied from . The must have zero-based indexing. - The zero-based index in array at which copying begins. - array is null. - index is less than zero. - array is multidimensional. -or- The number of elements in the source is greater than the available space from index to the end of the destination array. - The type of the source cannot be cast automatically to the type of the destination array. - - - Gets a value indicating whether access to the is synchronized (thread safe). - true if access to the is synchronized (thread safe); otherwise, false. The default is false. - - - Gets an object that can be used to synchronize access to the . - An object that can be used to synchronize access to the . - - - Adds an object to the end of the . - The to be added to the end of the . - The index at which the value has been added. - The is read-only. -or- The has a fixed size. - - - Determines whether the contains a specific element. - The to locate in the . - true if the contains the specified value; otherwise, false. - - - Searches for the specified and returns the zero-based index of the first occurrence within the entire . - The to locate in the . - The zero-based index of the first occurrence of value within the entire , if found; otherwise, -1. - - - Inserts an element into the at the specified index. - The zero-based index at which value should be inserted. - The to insert. - index is less than zero. -or- index is greater than . - The is read-only. -or- The has a fixed size. - - - Gets a value indicating whether the has a fixed size. - true if the has a fixed size; otherwise, false. The default is false. - - - Gets a value indicating whether the is read-only. - true if the is read-only; otherwise, false. The default is false. - - - Gets or sets the element at the specified index. - The zero-based index of the element to get or set. - The element at the specified index. - index is less than zero. -or- index is equal to or greater than . - - - Removes the first occurrence of a specific object from the . - The to remove from the . - The value parameter was not found in the object. - The is read-only. -or- The has a fixed size. - - - Compares two objects for equivalence, where string comparisons are case-sensitive. - - - Initializes a new instance of the class using the specified . - The to use for the new . - culture is null. - - - Performs a case-sensitive comparison of two objects of the same type and returns a value indicating whether one is less than, equal to, or greater than the other. - The first object to compare. - The second object to compare. -

A signed integer that indicates the relative values of a and b, as shown in the following table.

-
Value

-

Meaning

-

Less than zero

-

a is less than b.

-

Zero

-

a equals b.

-

Greater than zero

-

a is greater than b.

-

-
- Neither a nor b implements the interface. -or- a and b are of different types and neither one can handle comparisons with the other. -
- - Represents an instance of that is associated with the of the current thread. This field is read-only. - - - - Represents an instance of that is associated with . This field is read-only. - - - - Populates a object with the data required for serialization. - The object to populate with data. - The context information about the source or destination of the serialization. - info is null. - - - Provides blocking and bounding capabilities for thread-safe collections that implement . - The type of elements in the collection. - - - Initializes a new instance of the class without an upper-bound. - - - Initializes a new instance of the class without an upper-bound and using the provided as its underlying data store. - The collection to use as the underlying data store. - The collection argument is null. - - - Initializes a new instance of the class with the specified upper-bound. - The bounded size of the collection. - The boundedCapacity is not a positive value. - - - Initializes a new instance of the class with the specified upper-bound and using the provided as its underlying data store. - The collection to use as the underlying data store. - The bounded size of the collection. - The collection argument is null. - The boundedCapacity is not a positive value. - The supplied collection contains more values than is permitted by boundedCapacity. - - - Adds the item to the . - The item to be added to the collection. The value can be a null reference. - The has been disposed. - The has been marked as complete with regards to additions. -or- The underlying collection didn't accept the item. - - - Adds the item to the . - The item to be added to the collection. The value can be a null reference. - A cancellation token to observe. - If the is canceled. - The has been disposed or the that owns cancellationToken has been disposed. - The has been marked as complete with regards to additions. -or- The underlying collection didn't accept the item. - - - Adds the specified item to any one of the specified instances. - The array of collections. - The item to be added to one of the collections. - The index of the collection in the collections array to which the item was added. - At least one of the instances has been disposed. - The collections argument is null. - The count of collections is greater than the maximum size of 62 for STA and 63 for MTA. - The collections argument is a 0-length array or contains a null element, or at least one of collections has been marked as complete for adding. - At least one underlying collection didn't accept the item. - - - Adds the specified item to any one of the specified instances. - The array of collections. - The item to be added to one of the collections. - A cancellation token to observe. - The index of the collection in the collections array to which the item was added. - If the is canceled. - At least one underlying collection didn't accept the item. - The collections argument is null. - The count of collections is greater than the maximum size of 62 for STA and 63 for MTA. - The collections argument is a 0-length array or contains a null element, or at least one of collections has been marked as complete for adding. - At least one of the instances has been disposed, or the that created cancellationToken has been disposed. - - - Gets the bounded capacity of this instance. - The bounded capacity of this collection, or int.MaxValue if no bound was supplied. - The has been disposed. - - - Marks the instances as not accepting any more additions. - The has been disposed. - - - Copies all of the items in the instance to a compatible one-dimensional array, starting at the specified index of the target array. - The one-dimensional array that is the destination of the elements copied from the instance. The array must have zero-based indexing. - The zero-based index in array at which copying begins. - The has been disposed. - The array argument is null. - The index argument is less than zero. - The index argument is equal to or greater than the length of the array. The destination array is too small to hold all of the BlockingCcollection elements. The array rank doesn't match. The array type is incompatible with the type of the BlockingCollection elements. - - - Gets the number of items contained in the . - The number of items contained in the . - The has been disposed. - - - Releases all resources used by the current instance of the class. - - - Releases resources used by the instance. - Whether being disposed explicitly (true) or due to a finalizer (false). - - - Provides a consuming for items in the collection. - A cancellation token to observe. - An that removes and returns items from the collection. - If the is canceled. - The has been disposed or the that created cancellationToken has been disposed - - - Provides a consuming for items in the collection. - An that removes and returns items from the collection. - The has been disposed. - - - Gets whether this has been marked as complete for adding. - Whether this collection has been marked as complete for adding. - The has been disposed. - - - Gets whether this has been marked as complete for adding and is empty. - Whether this collection has been marked as complete for adding and is empty. - The has been disposed. - - - Removes an item from the . - The item removed from the collection. - The has been disposed. - The underlying collection was modified outside of this instance, or the is empty and the collection has been marked as complete for adding. - - - Removes an item from the . - Object that can be used to cancel the take operation. - The item removed from the collection. - The is canceled. - The has been disposed or the that created the token was canceled. - The underlying collection was modified outside of this instance or the BlockingCollection is marked as complete for adding, or the is empty. - - - Takes an item from any one of the specified instances. - The array of collections. - The item removed from one of the collections. - The index of the collection in the collections array from which the item was removed. - At least one of the instances has been disposed. - The collections argument is null. - The count of collections is greater than the maximum size of 62 for STA and 63 for MTA. - The collections argument is a 0-length array or contains a null element or has been called on the collection. - At least one of the underlying collections was modified outside of its instance. - - - Takes an item from any one of the specified instances while observing the specified cancellation token. - The array of collections. - The item removed from one of the collections. - A cancellation token to observe. - The index of the collection in the collections array from which the item was removed. - If the is canceled. - At least one of the underlying collections was modified outside of its instance. - The collections argument is null. - The count of collections is greater than the maximum size of 62 for STA and 63 for MTA. - The collections argument is a 0-length array or contains a null element, or has been called on the collection. - At least one of the instances has been disposed. - - - Copies the items from the instance into a new array. - An array containing copies of the elements of the collection. - The has been disposed. - - - Tries to add the specified item to the within the specified time period. - The item to be added to the collection. - The number of milliseconds to wait, or (-1) to wait indefinitely. - true if the item could be added to the collection within the specified time; otherwise, false. If the item is a duplicate, and the underlying collection does not accept duplicate items, then an is thrown. - The has been disposed. - millisecondsTimeout is a negative number other than -1, which represents an infinite time-out. - The has been marked as complete with regards to additions. -or- The underlying collection didn't accept the item. - - - Tries to add the specified item to the within the specified time period, while observing a cancellation token. - The item to be added to the collection. - The number of milliseconds to wait, or (-1) to wait indefinitely. - A cancellation token to observe. - true if the item could be added to the collection within the specified time; otherwise, false. If the item is a duplicate, and the underlying collection does not accept duplicate items, then an is thrown. - If the is canceled. - The has been disposed or the underlying has been disposed. - millisecondsTimeout is a negative number other than -1, which represents an infinite time-out. - The has been marked as complete with regards to additions. -or- The underlying collection didn't accept the item. - - - Tries to add the specified item to the . - The item to be added to the collection. - true if item could be added; otherwise false. If the item is a duplicate, and the underlying collection does not accept duplicate items, then an is thrown. - The has been disposed. - The has been marked as complete with regards to additions. -or- The underlying collection didn't accept the item. - - - Tries to add the specified item to the . - The item to be added to the collection. - A that represents the number of milliseconds to wait, or a that represents -1 milliseconds to wait indefinitely. - true if the item could be added to the collection within the specified time span; otherwise, false. - The has been disposed. - timeout is a negative number other than -1 milliseconds, which represents an infinite time-out -or- timeout is greater than . - The has been marked as complete with regards to additions. -or- The underlying collection didn't accept the item. - - - Tries to add the specified item to any one of the specified instances. - The array of collections. - The item to be added to one of the collections. - The number of milliseconds to wait, or (-1) to wait indefinitely. - A cancellation token to observe. - The index of the collection in the collections array to which the item was added, or -1 if the item could not be added. - If the is canceled. - At least one underlying collection didn't accept the item. - The collections argument is null. - millisecondsTimeout is a negative number other than -1, which represents an infinite time-out. -or- The count of collections is greater than the maximum size of 62 for STA and 63 for MTA. - The collections argument is a 0-length array or contains a null element, or at least one of collections has been marked as complete for adding. - At least one of the instances has been disposed. - - - Tries to add the specified item to any one of the specified instances while observing the specified cancellation token. - The array of collections. - The item to be added to one of the collections. - A that represents the number of milliseconds to wait, or a that represents -1 milliseconds to wait indefinitely. - The index of the collection in the collections array to which the item was added, or -1 if the item could not be added. - At least one of the instances or the that created cancellationToken has been disposed. - The collections argument is null. - timeout is a negative number other than -1 milliseconds, which represents an infinite time-out -or- timeout is greater than . -or- The count of collections is greater than the maximum size of 62 for STA and 63 for MTA. - The collections argument is a 0-length array or contains a null element, or at least one of collections has been marked as complete for adding. - At least one underlying collection didn't accept the item. - - - Tries to add the specified item to any one of the specified instances. - The array of collections. - The item to be added to one of the collections. - The number of milliseconds to wait, or (-1) to wait indefinitely. - The index of the collection in the collections array to which the item was added, or -1 if the item could not be added. - At least one of the instances has been disposed. - The collections argument is null. - millisecondsTimeout is a negative number other than -1, which represents an infinite time-out. -or- The count of collections is greater than the maximum size of 62 for STA and 63 for MTA. - The collections argument is a 0-length array or contains a null element, or at least one of collections has been marked as complete for adding. - At least one underlying collection didn't accept the item. - - - Tries to add the specified item to any one of the specified instances. - The array of collections. - The item to be added to one of the collections. - The index of the collection in the collections array to which the item was added, or -1 if the item could not be added. - At least one of the instances has been disposed. - The collections argument is null. - The count of collections is greater than the maximum size of 62 for STA and 63 for MTA. - The collections argument is a 0-length array or contains a null element, or at least one of collections has been marked as complete for adding. - At least one underlying collection didn't accept the item. - - - Tries to remove an item from the . - The item to be removed from the collection. - true if an item could be removed; otherwise, false. - The has been disposed. - The underlying collection was modified outside of this instance. - - - Tries to remove an item from the in the specified time period. - The item to be removed from the collection. - An object that represents the number of milliseconds to wait, or an object that represents -1 milliseconds to wait indefinitely. - true if an item could be removed from the collection within the specified time; otherwise, false. - The has been disposed. - timeout is a negative number other than -1 milliseconds, which represents an infinite time-out. -or- timeout is greater than . - The underlying collection was modified outside of this instance. - - - Tries to remove an item from the in the specified time period while observing a cancellation token. - The item to be removed from the collection. - The number of milliseconds to wait, or (-1) to wait indefinitely. - A cancellation token to observe. - true if an item could be removed from the collection within the specified time; otherwise, false. - The has been canceled. - The has been disposed or the underlying has been disposed. - millisecondsTimeout is a negative number other than -1, which represents an infinite time-out. - The underlying collection was modified outside this instance. - - - Tries to remove an item from the in the specified time period. - The item to be removed from the collection. - The number of milliseconds to wait, or (-1) to wait indefinitely. - true if an item could be removed from the collection within the specified time; otherwise, false. - The has been disposed. - millisecondsTimeout is a negative number other than -1, which represents an infinite time-out. - The underlying collection was modified outside of this instance. - - - Tries to remove an item from any one of the specified instances. - The array of collections. - The item removed from one of the collections. - The index of the collection in the collections array from which the item was removed, or -1 if an item could not be removed. - At least one of the instances has been disposed. - The collections argument is null. - The count of collections is greater than the maximum size of 62 for STA and 63 for MTA. - The collections argument is a 0-length array or contains a null element. - At least one of the underlying collections was modified outside of its instance. - - - Tries to remove an item from any one of the specified instances. - The array of collections. - The item removed from one of the collections. - The number of milliseconds to wait, or (-1) to wait indefinitely. - The index of the collection in the collections array from which the item was removed, or -1 if an item could not be removed. - At least one of the instances has been disposed. - The collections argument is null. - millisecondsTimeout is a negative number other than -1, which represents an infinite time-out. -or- The count of collections is greater than the maximum size of 62 for STA and 63 for MTA. - The collections argument is a 0-length array or contains a null element. - At least one of the underlying collections was modified outside of its instance. - - - Tries to remove an item from any one of the specified instances. - The array of collections. - The item removed from one of the collections. - The number of milliseconds to wait, or (-1) to wait indefinitely. - A cancellation token to observe. - The index of the collection in the collections array from which the item was removed, or -1 if an item could not be removed. - If the is canceled. - At least one of the underlying collections was modified outside of its instance. - The collections argument is null. - millisecondsTimeout is a negative number other than -1, which represents an infinite time-out. -or- The count of collections is greater than the maximum size of 62 for STA and 63 for MTA. - The collections argument is a 0-length array or contains a null element. - At least one of the instances has been disposed. - - - Tries to remove an item from any one of the specified instances. - The array of collections. - The item removed from one of the collections. - A that represents the number of milliseconds to wait, or a that represents -1 milliseconds to wait indefinitely. - The index of the collection in the collections array from which the item was removed, or -1 if an item could not be removed. - At least one of the instances has been disposed. - The collections argument is null. - timeout is a negative number other than -1 milliseconds, which represents an infinite time-out -or- timeout is greater than . -or- The count of collections is greater than the maximum size of 62 for STA and 63 for MTA. - The collections argument is a 0-length array or contains a null element. - At least one of the underlying collections was modified outside of its instance. - - - Provides an for items in the collection. - An for the items in the collection. - The has been disposed. - - - Copies all of the items in the instance to a compatible one-dimensional array, starting at the specified index of the target array. - The one-dimensional array that is the destination of the elements copied from the instance. The array must have zero-based indexing. - The zero-based index in array at which copying begins. - The has been disposed. - The array argument is null. - The index argument is less than zero. - The index argument is equal to or greater than the length of the array, the array is multidimensional, or the type parameter for the collection cannot be cast automatically to the type of the destination array. - - - Gets a value indicating whether access to the is synchronized. - always returns false. - The has been disposed. - - - Gets an object that can be used to synchronize access to the . This property is not supported. - returns null. - The SyncRoot property is not supported. - - - Provides an for items in the collection. - An for the items in the collection. - The has been disposed. - - - Represents a thread-safe, unordered collection of objects. - The type of the elements to be stored in the collection. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class that contains elements copied from the specified collection. - The collection whose elements are copied to the new . - collection is a null reference (Nothing in Visual Basic). - - - Adds an object to the . - The object to be added to the . The value can be a null reference (Nothing in Visual Basic) for reference types. - - - Copies the elements to an existing one-dimensional , starting at the specified array index. - The one-dimensional that is the destination of the elements copied from the . The must have zero-based indexing. - The zero-based index in array at which copying begins. - array is a null reference (Nothing in Visual Basic). - index is less than zero. - index is equal to or greater than the length of the array -or- the number of elements in the source is greater than the available space from index to the end of the destination array. - - - Gets the number of elements contained in the . - The number of elements contained in the . - - - Returns an enumerator that iterates through the . - An enumerator for the contents of the . - - - Gets a value that indicates whether the is empty. - true if the is empty; otherwise, false. - - - Copies the elements to a new array. - A new array containing a snapshot of elements copied from the . - - - Attempts to return an object from the without removing it. - When this method returns, result contains an object from the or the default value of T if the operation failed. - true if and object was returned successfully; otherwise, false. - - - Attempts to remove and return an object from the . - When this method returns, result contains the object removed from the or the default value of T if the bag is empty. - true if an object was removed successfully; otherwise, false. - - - Attempts to add an object to the . - The object to be added to the . The value can be a null reference (Nothing in Visual Basic) for reference types. - Always returns true - - - Copies the elements of the to an , starting at a particular index. - The one-dimensional that is the destination of the elements copied from the . The must have zero-based indexing. - The zero-based index in array at which copying begins. - array is a null reference (Nothing in Visual Basic). - index is less than zero. - array is multidimensional. -or- array does not have zero-based indexing. -or- index is equal to or greater than the length of the array -or- The number of elements in the source is greater than the available space from index to the end of the destination array. -or- The type of the source cannot be cast automatically to the type of the destination array. - - - Gets a value indicating whether access to the is synchronized with the SyncRoot. - true if access to the is synchronized with the SyncRoot; otherwise, false. For , this property always returns false. - - - Gets an object that can be used to synchronize access to the . This property is not supported. - Returns null (Nothing in Visual Basic). - The SyncRoot property is not supported. - - - Returns an enumerator that iterates through the . - An enumerator for the contents of the . - - - Represents a thread-safe collection of key/value pairs that can be accessed by multiple threads concurrently. - The type of the keys in the dictionary. - The type of the values in the dictionary. - - - Initializes a new instance of the class that is empty, has the default concurrency level, has the default initial capacity, and uses the default comparer for the key type. - - - Initializes a new instance of the class that contains elements copied from the specified , has the default concurrency level, has the default initial capacity, and uses the default comparer for the key type. - The whose elements are copied to the new . - collection or any of its keys is null. - collection contains one or more duplicate keys. - - - Initializes a new instance of the class that is empty, has the default concurrency level and capacity, and uses the specified . - The equality comparison implementation to use when comparing keys. - comparer is null. - - - Initializes a new instance of the class that contains elements copied from the specified has the default concurrency level, has the default initial capacity, and uses the specified . - The whose elements are copied to the new . - The implementation to use when comparing keys. - collection or comparer is null. - - - Initializes a new instance of the class that is empty, has the specified concurrency level and capacity, and uses the default comparer for the key type. - The estimated number of threads that will update the concurrently. - The initial number of elements that the can contain. - concurrencyLevel is less than 1. -or- capacity is less than 0. - - - Initializes a new instance of the class that contains elements copied from the specified , and uses the specified . - The estimated number of threads that will update the concurrently. - The whose elements are copied to the new . - The implementation to use when comparing keys. - collection or comparer is null. - concurrencyLevel is less than 1. - collection contains one or more duplicate keys. - - - Initializes a new instance of the class that is empty, has the specified concurrency level, has the specified initial capacity, and uses the specified . - The estimated number of threads that will update the concurrently. - The initial number of elements that the can contain. - The implementation to use when comparing keys. - comparer is null. - concurrencyLevel or capacity is less than 1. - - - Uses the specified functions to add a key/value pair to the if the key does not already exist, or to update a key/value pair in the if the key already exists. - The key to be added or whose value should be updated - The function used to generate a value for an absent key - The function used to generate a new value for an existing key based on the key's existing value - The new value for the key. This will be either be the result of addValueFactory (if the key was absent) or the result of updateValueFactory (if the key was present). - key, addValueFactory, or updateValueFactory is null. - The dictionary already contains the maximum number of elements (). - - - Adds a key/value pair to the if the key does not already exist, or updates a key/value pair in the by using the specified function if the key already exists. - The key to be added or whose value should be updated - The value to be added for an absent key - The function used to generate a new value for an existing key based on the key's existing value - The new value for the key. This will be either be addValue (if the key was absent) or the result of updateValueFactory (if the key was present). - key or updateValueFactory is null. - The dictionary already contains the maximum number of elements (). - - - Removes all keys and values from the . - - - Determines whether the contains the specified key. - The key to locate in the . - true if the contains an element with the specified key; otherwise, false. - key is null. - - - Gets the number of key/value pairs contained in the . - The number of key/value pairs contained in the . - The dictionary already contains the maximum number of elements (). - - - Returns an enumerator that iterates through the . - An enumerator for the . - - - Adds a key/value pair to the by using the specified function if the key does not already exist, or returns the existing value if the key exists. - The key of the element to add. - The function used to generate a value for the key. - The value for the key. - key or valueFactory is null. - The dictionary already contains the maximum number of elements (). - - - Adds a key/value pair to the if the key does not already exist. - The key of the element to add. - The value to be added, if the key does not already exist. - The value for the key. This will be either the existing value for the key if the key is already in the dictionary, or the new value if the key was not in the dictionary. - key is null. - The dictionary already contains the maximum number of elements (). - - - Gets a value that indicates whether the is empty. - true if the is empty; otherwise, false. - - - Gets or sets the value associated with the specified key. - The key of the value to get or set. - The value of the key/value pair at the specified index. - key is null. - The property is retrieved and key does not exist in the collection. - - - Gets a collection containing the keys in the . - A collection of keys in the . - - - Copies the key and value pairs stored in the to a new array. - A new array containing a snapshot of key and value pairs copied from the . - - - Attempts to add the specified key and value to the . - The key of the element to add. - The value of the element to add. The value can be null for reference types. - true if the key/value pair was added to the successfully; false if the key already exists. - key is null. - The dictionary already contains the maximum number of elements (). - - - Attempts to get the value associated with the specified key from the . - The key of the value to get. - When this method returns, contains the object from the that has the specified key, or the default value of the type if the operation failed. - true if the key was found in the ; otherwise, false. - key is null. - - - Attempts to remove and return the value that has the specified key from the . - The key of the element to remove and return. - When this method returns, contains the object removed from the , or the default value of the TValue type if key does not exist. - true if the object was removed successfully; otherwise, false. - key is null. - - - Compares the existing value for the specified key with a specified value, and if they are equal, updates the key with a third value. - The key whose value is compared with comparisonValue and possibly replaced. - The value that replaces the value of the element that has the specified key if the comparison results in equality. - The value that is compared to the value of the element that has the specified key. - true if the value with key was equal to comparisonValue and was replaced with newValue; otherwise, false. - key is null. - - - Gets a collection that contains the values in the . - A collection that contains the values in the . - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Copies the elements of the to an array, starting at the specified array index. - The one-dimensional array that is the destination of the elements copied from the . The array must have zero-based indexing. - The zero-based index in array at which copying begins. - array is null. - index is less than 0. - index is equal to or greater than the length of the array. -or- The number of elements in the source is greater than the available space from index to the end of the destination array. - - - Gets a value indicating whether access to the is synchronized with the SyncRoot. - true if access to the is synchronized (thread safe); otherwise, false. For this property always returns false. - - - Gets an object that can be used to synchronize access to the . This property is not supported. - Always returns null. - This property is not supported. - - - Adds the specified key and value to the dictionary. - The object to use as the key. - The object to use as the value. - key is null. - key is of a type that is not assignable to the key type of the . -or- value is of a type that is not assignable to the type of values in the . -or- A value with the same key already exists in the . - The dictionary already contains the maximum number of elements (). - - - Gets whether the contains an element with the specified key. - The key to locate in the . - true if the contains an element with the specified key; otherwise, false. - key is null. - - - Provides a for the . - A for the . - - - Gets a value indicating whether the has a fixed size. - true if the has a fixed size; otherwise, false. For , this property always returns false. - - - Gets a value indicating whether the is read-only. - true if the is read-only; otherwise, false. For , this property always returns false. - - - Gets or sets the value associated with the specified key. - The key of the value to get or set. - The value associated with the specified key, or null if key is not in the dictionary or key is of a type that is not assignable to the key type of the . - key is null. - A value is being assigned, and key is of a type that is not assignable to the key type or the value type of the . - - - Gets an that contains the keys of the . - An interface that contains the keys of the . - - - Removes the element with the specified key from the . - The key of the element to remove. - key is null. - - - Gets an that contains the values in the . - An interface that contains the values in the . - - - Returns an enumerator that iterates through the . - An enumerator for the . - - - Represents a thread-safe first in-first out (FIFO) collection. - The type of the elements contained in the queue. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class that contains elements copied from the specified collection - The collection whose elements are copied to the new . - The collection argument is null. - - - Copies the elements to an existing one-dimensional , starting at the specified array index. - The one-dimensional that is the destination of the elements copied from the . The must have zero-based indexing. - The zero-based index in array at which copying begins. - array is a null reference (Nothing in Visual Basic). - index is less than zero. - index is equal to or greater than the length of the array -or- The number of elements in the source is greater than the available space from index to the end of the destination array. - - - Gets the number of elements contained in the . - The number of elements contained in the . - - - Adds an object to the end of the . - The object to add to the end of the . The value can be a null reference (Nothing in Visual Basic) for reference types. - - - Returns an enumerator that iterates through the . - An enumerator for the contents of the . - - - Gets a value that indicates whether the is empty. - true if the is empty; otherwise, false. - - - Copies the elements stored in the to a new array. - A new array containing a snapshot of elements copied from the . - - - Tries to remove and return the object at the beginning of the concurrent queue. - When this method returns, if the operation was successful, result contains the object removed. If no object was available to be removed, the value is unspecified. - true if an element was removed and returned from the beginning of the successfully; otherwise, false. - - - Tries to return an object from the beginning of the without removing it. - When this method returns, result contains an object from the beginning of the or an unspecified value if the operation failed. - true if an object was returned successfully; otherwise, false. - - - Attempts to add an object to the . - The object to add to the . The value can be a null reference (Nothing in Visual Basic) for reference types. - true if the object was added successfully; otherwise, false. - - - Attempts to remove and return an object from the . - When this method returns, if the operation was successful, item contains the object removed. If no object was available to be removed, the value is unspecified. - true if an element was removed and returned succesfully; otherwise, false. - - - Copies the elements of the to an , starting at a particular index. - The one-dimensional that is the destination of the elements copied from the . The must have zero-based indexing. - The zero-based index in array at which copying begins. - array is a null reference (Nothing in Visual Basic). - index is less than zero. - array is multidimensional. -or- array does not have zero-based indexing. -or- index is equal to or greater than the length of the array -or- The number of elements in the source is greater than the available space from index to the end of the destination array. -or- The type of the source cannot be cast automatically to the type of the destination array. - - - Gets a value indicating whether access to the is synchronized with the SyncRoot. - true if access to the is synchronized with the SyncRoot; otherwise, false. For , this property always returns false. - - - Gets an object that can be used to synchronize access to the . This property is not supported. - Returns null (Nothing in Visual Basic). - The SyncRoot property is not supported. - - - Returns an enumerator that iterates through a collection. - An that can be used to iterate through the collection. - - - Represents a thread-safe last in-first out (LIFO) collection. - The type of the elements contained in the stack. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class that contains elements copied from the specified collection - The collection whose elements are copied to the new . - The collection argument is null. - - - Removes all objects from the . - - - Copies the elements to an existing one-dimensional , starting at the specified array index. - The one-dimensional that is the destination of the elements copied from the . The must have zero-based indexing. - The zero-based index in array at which copying begins. - array is a null reference (Nothing in Visual Basic). - index is less than zero. - index is equal to or greater than the length of the array -or- The number of elements in the source is greater than the available space from index to the end of the destination array. - - - Gets the number of elements contained in the . - The number of elements contained in the . - - - Returns an enumerator that iterates through the . - An enumerator for the . - - - Gets a value that indicates whether the is empty. - true if the is empty; otherwise, false. - - - Inserts an object at the top of the . - The object to push onto the . The value can be a null reference (Nothing in Visual Basic) for reference types. - - - Inserts multiple objects at the top of the atomically. - The objects to push onto the . - items is a null reference (Nothing in Visual Basic). - - - Inserts multiple objects at the top of the atomically. - The objects to push onto the . - The zero-based offset in items at which to begin inserting elements onto the top of the . - The number of elements to be inserted onto the top of the . - items is a null reference (Nothing in Visual Basic). - startIndex or count is negative. Or startIndex is greater than or equal to the length of items. - startIndex + count is greater than the length of items. - - - Copies the items stored in the to a new array. - A new array containing a snapshot of elements copied from the . - - - Attempts to return an object from the top of the without removing it. - When this method returns, result contains an object from the top of the or an unspecified value if the operation failed. - true if and object was returned successfully; otherwise, false. - - - Attempts to pop and return the object at the top of the . - When this method returns, if the operation was successful, result contains the object removed. If no object was available to be removed, the value is unspecified. - true if an element was removed and returned from the top of the successfully; otherwise, false. - - - Attempts to pop and return multiple objects from the top of the atomically. - The to which objects popped from the top of the will be added. - The zero-based offset in items at which to begin inserting elements from the top of the . - The number of elements to be popped from top of the and inserted into items. - The number of objects successfully popped from the top of the stack and inserted in items. - items is a null reference (Nothing in Visual Basic). - startIndex or count is negative. Or startIndex is greater than or equal to the length of items. - startIndex + count is greater than the length of items. - - - Attempts to pop and return multiple objects from the top of the atomically. - The to which objects popped from the top of the will be added. - The number of objects successfully popped from the top of the and inserted in items. - items is a null argument (Nothing in Visual Basic). - - - Attempts to add an object to the . - The object to add to the . The value can be a null reference (Nothing in Visual Basic) for reference types. - true if the object was added successfully; otherwise, false. - - - Attempts to remove and return an object from the . - When this method returns, if the operation was successful, item contains the object removed. If no object was available to be removed, the value is unspecified. - true if an element was removed and returned succesfully; otherwise, false. - - - Copies the elements of the to an , starting at a particular index. - The one-dimensional that is the destination of the elements copied from the . The must have zero-based indexing. - The zero-based index in array at which copying begins. - array is a null reference (Nothing in Visual Basic). - index is less than zero. - array is multidimensional. -or- array does not have zero-based indexing. -or- index is equal to or greater than the length of the array -or- The number of elements in the source is greater than the available space from index to the end of the destination array. -or- The type of the source cannot be cast automatically to the type of the destination array. - - - Gets a value indicating whether access to the is synchronized with the SyncRoot. - true if access to the is synchronized with the SyncRoot; otherwise, false. For , this property always returns false. - - - Gets an object that can be used to synchronize access to the . This property is not supported. - Returns null (Nothing in Visual Basic). - The SyncRoot property is not supported - - - Returns an enumerator that iterates through a collection. - An that can be used to iterate through the collection. - - - Specifies options to control the buffering behavior of a partitioner - - - Create a partitioner that takes items from the source enumerable one at a time and does not use intermediate storage that can be accessed more efficiently by multiple threads. This option provides support for low latency (items will be processed as soon as they are available from the source) and provides partial support for dependencies between items (a thread cannot deadlock waiting for an item that the thread itself is responsible for processing). - - - - Use the default behavior, which is to use buffering to achieve optimal performance. - - - - Defines methods to manipulate thread-safe collections intended for producer/consumer usage. This interface provides a unified representation for producer/consumer collections so that higher level abstractions such as can use the collection as the underlying storage mechanism. - Specifies the type of elements in the collection. - - - Copies the elements of the to an , starting at a specified index. - The one-dimensional that is the destination of the elements copied from the . The array must have zero-based indexing. - The zero-based index in array at which copying begins. - array is a null reference (Nothing in Visual Basic). - index is less than zero. - index is equal to or greater than the length of the array -or- The number of elements in the collection is greater than the available space from index to the end of the destination array. - - - Copies the elements contained in the to a new array. - A new array containing the elements copied from the . - - - Attempts to add an object to the . - The object to add to the . - true if the object was added successfully; otherwise, false. - The item was invalid for this collection. - - - Attempts to remove and return an object from the . - When this method returns, if the object was removed and returned successfully, item contains the removed object. If no object was available to be removed, the value is unspecified. - true if an object was removed and returned successfully; otherwise, false. - - - Represents a particular manner of splitting an orderable data source into multiple partitions. - Type of the elements in the collection. - - - Called from constructors in derived classes to initialize the class with the specified constraints on the index keys. - Indicates whether the elements in each partition are yielded in the order of increasing keys. - Indicates whether elements in an earlier partition always come before elements in a later partition. If true, each element in partition 0 has a smaller order key than any element in partition 1, each element in partition 1 has a smaller order key than any element in partition 2, and so on. - Indicates whether keys are normalized. If true, all order keys are distinct integers in the range [0 .. numberOfElements-1]. If false, order keys must still be distinct, but only their relative order is considered, not their absolute values. - - - Creates an object that can partition the underlying collection into a variable number of partitions. - An object that can create partitions over the underlying data source. - Dynamic partitioning is not supported by the base class. It must be implemented in derived classes. - - - Creates an object that can partition the underlying collection into a variable number of partitions. - An object that can create partitions over the underlying data source. - Dynamic partitioning is not supported by this partitioner. - - - Partitions the underlying collection into the specified number of orderable partitions. - The number of partitions to create. - A list containing partitionCount enumerators. - - - Partitions the underlying collection into the given number of ordered partitions. - The number of partitions to create. - A list containing partitionCount enumerators. - - - Gets whether order keys are normalized. - true if the keys are normalized; otherwise false. - - - Gets whether elements in an earlier partition always come before elements in a later partition. - true if the elements in an earlier partition always come before elements in a later partition; otherwise false. - - - Gets whether elements in each partition are yielded in the order of increasing keys. - true if the elements in each partition are yielded in the order of increasing keys; otherwise false. - - - Represents a particular manner of splitting a data source into multiple partitions. - Type of the elements in the collection. - - - Creates a new partitioner instance. - - - Creates an object that can partition the underlying collection into a variable number of partitions. - An object that can create partitions over the underlying data source. - Dynamic partitioning is not supported by the base class. You must implement it in a derived class. - - - Partitions the underlying collection into the given number of partitions. - The number of partitions to create. - A list containing partitionCount enumerators. - - - Gets whether additional partitions can be created dynamically. - true if the can create partitions dynamically as they are requested; false if the can only allocate partitions statically. - - - Provides common partitioning strategies for arrays, lists, and enumerables. - - - Creates a partitioner that chunks the user-specified range. - The lower, inclusive bound of the range. - The upper, exclusive bound of the range. - A partitioner. - The toExclusive argument is less than or equal to the fromInclusive argument. - - - Creates a partitioner that chunks the user-specified range. - The lower, inclusive bound of the range. - The upper, exclusive bound of the range. - A partitioner. - The toExclusive argument is less than or equal to the fromInclusive argument. - - - Creates a partitioner that chunks the user-specified range. - The lower, inclusive bound of the range. - The upper, exclusive bound of the range. - The size of each subrange. - A partitioner. - The toExclusive argument is less than or equal to the fromInclusive argument. -or- The rangeSize argument is less than or equal to 0. - - - Creates a partitioner that chunks the user-specified range. - The lower, inclusive bound of the range. - The upper, exclusive bound of the range. - The size of each subrange. - A partitioner. - The toExclusive argument is less than or equal to the fromInclusive argument. -or- The rangeSize argument is less than or equal to 0. - - - Creates an orderable partitioner from a instance. - The enumerable to be partitioned. - Type of the elements in source enumerable. - An orderable partitioner based on the input array. - - - Creates an orderable partitioner from a instance. - The enumerable to be partitioned. - Options to control the buffering behavior of the partitioner. - Type of the elements in source enumerable. - An orderable partitioner based on the input array. - The partitionerOptions argument specifies an invalid value for . - - - Creates an orderable partitioner from an instance. - The list to be partitioned. - A Boolean value that indicates whether the created partitioner should dynamically load balance between partitions rather than statically partition. - Type of the elements in source list. - An orderable partitioner based on the input list. - - - Creates an orderable partitioner from a instance. - The array to be partitioned. - A Boolean value that indicates whether the created partitioner should dynamically load balance between partitions rather than statically partition. - Type of the elements in source array. - An orderable partitioner based on the input array. - - - Provides the abstract base class for a strongly typed collection of key/value pairs. - - - Initializes a new instance of the class. - - - Clears the contents of the instance. - - - Copies the elements to a one-dimensional at the specified index. - The one-dimensional that is the destination of the objects copied from the instance. The must have zero-based indexing. - The zero-based index in array at which copying begins. - array is null. - index is less than zero. - array is multidimensional. -or- The number of elements in the source is greater than the available space from index to the end of the destination array. - The type of the source cannot be cast automatically to the type of the destination array. - - - Gets the number of elements contained in the instance. - The number of elements contained in the instance. - - - Gets the list of elements contained in the instance. - An representing the instance itself. - - - Returns an that iterates through the instance. - An for the instance. - - - Gets the list of elements contained in the instance. - A representing the instance itself. - - - Performs additional custom processes before clearing the contents of the instance. - - - Performs additional custom processes after clearing the contents of the instance. - - - Gets the element with the specified key and value in the instance. - The key of the element to get. - The current value of the element associated with key. - An containing the element with the specified key and value. - - - Performs additional custom processes before inserting a new element into the instance. - The key of the element to insert. - The value of the element to insert. - - - Performs additional custom processes after inserting a new element into the instance. - The key of the element to insert. - The value of the element to insert. - - - Performs additional custom processes before removing an element from the instance. - The key of the element to remove. - The value of the element to remove. - - - Performs additional custom processes after removing an element from the instance. - The key of the element to remove. - The value of the element to remove. - - - Performs additional custom processes before setting a value in the instance. - The key of the element to locate. - The old value of the element associated with key. - The new value of the element associated with key. - - - Performs additional custom processes after setting a value in the instance. - The key of the element to locate. - The old value of the element associated with key. - The new value of the element associated with key. - - - Performs additional custom processes when validating the element with the specified key and value. - The key of the element to validate. - The value of the element to validate. - - - Gets a value indicating whether access to a object is synchronized (thread safe). - true if access to the object is synchronized (thread safe); otherwise, false. The default is false. - - - Gets an object that can be used to synchronize access to a object. - An object that can be used to synchronize access to the object. - - - Adds an element with the specified key and value into the . - The key of the element to add. - The value of the element to add. - key is null. - An element with the same key already exists in the . - The is read-only. -or- The has a fixed size. - - - Determines whether the contains a specific key. - The key to locate in the . - true if the contains an element with the specified key; otherwise, false. - key is null. - - - Gets a value indicating whether a object has a fixed size. - true if the object has a fixed size; otherwise, false. The default is false. - - - Gets a value indicating whether a object is read-only. - true if the object is read-only; otherwise, false. The default is false. - - - Gets or sets the value associated with the specified key. - The key whose value to get or set. - The value associated with the specified key. If the specified key is not found, attempting to get it returns null, and attempting to set it creates a new element using the specified key. - key is null. - The property is set and the is read-only. -or- The property is set, key does not exist in the collection, and the has a fixed size. - - - Gets an object containing the keys in the object. - An object containing the keys in the object. - - - Removes the element with the specified key from the . - The key of the element to remove. - key is null. - The is read-only. -or- The has a fixed size. - - - Gets an object containing the values in the object. - An object containing the values in the object. - - - Returns an that iterates through the . - An for the . - - - Defines a dictionary key/value pair that can be set or retrieved. - - - Initializes an instance of the type with the specified key and value. - The object defined in each key/value pair. - The definition associated with key. - key is null and the .NET Framework version is 1.0 or 1.1. - - - Gets or sets the key in the key/value pair. - The key in the key/value pair. - - - Gets or sets the value in the key/value pair. - The value in the key/value pair. - - - Provides a base class for implementations of the generic interface. - The type of objects to compare. - - - Initializes a new instance of the class. - - - When overridden in a derived class, performs a comparison of two objects of the same type and returns a value indicating whether one object is less than, equal to, or greater than the other. - The first object to compare. - The second object to compare. -

A signed integer that indicates the relative values of x and y, as shown in the following table.

-
Value

-

Meaning

-

Less than zero

-

x is less than y.

-

Zero

-

x equals y.

-

Greater than zero

-

x is greater than y.

-

-
- Type T does not implement either the generic interface or the interface. -
- - Creates a comparer by using the specified comparison. - The comparison to use. - The new comparer. - - - Returns a default sort order comparer for the type specified by the generic argument. - An object that inherits and serves as a sort order comparer for type T. - - - Compares two objects and returns a value indicating whether one is less than, equal to, or greater than the other. - The first object to compare. - The second object to compare. -

A signed integer that indicates the relative values of x and y, as shown in the following table.

-
Value

-

Meaning

-

Less than zero

-

x is less than y.

-

Zero

-

x equals y.

-

Greater than zero

-

x is greater than y.

-

-
- x or y is of a type that cannot be cast to type T. -or- x and y do not implement either the generic interface or the interface. -
- - Enumerates the elements of a . - - - - - Gets the element at the current position of the enumerator. - The element in the at the current position of the enumerator. - - - Releases all resources used by the . - - - Advances the enumerator to the next element of the . - true if the enumerator was successfully advanced to the next element; false if the enumerator has passed the end of the collection. - The collection was modified after the enumerator was created. - - - Gets the element at the current position of the enumerator. - The element in the dictionary at the current position of the enumerator, as a . - The enumerator is positioned before the first element of the collection or after the last element. - - - Gets the key of the element at the current position of the enumerator. - The key of the element in the dictionary at the current position of the enumerator. - The enumerator is positioned before the first element of the collection or after the last element. - - - Gets the value of the element at the current position of the enumerator. - The value of the element in the dictionary at the current position of the enumerator. - The enumerator is positioned before the first element of the collection or after the last element. - - - Gets the element at the current position of the enumerator. - The element in the collection at the current position of the enumerator, as an . - The enumerator is positioned before the first element of the collection or after the last element. - - - Sets the enumerator to its initial position, which is before the first element in the collection. - The collection was modified after the enumerator was created. - - - Enumerates the elements of a . - - - - - Gets the element at the current position of the enumerator. - The element in the at the current position of the enumerator. - - - Releases all resources used by the . - - - Advances the enumerator to the next element of the . - true if the enumerator was successfully advanced to the next element; false if the enumerator has passed the end of the collection. - The collection was modified after the enumerator was created. - - - Gets the element at the current position of the enumerator. - The element in the collection at the current position of the enumerator. - The enumerator is positioned before the first element of the collection or after the last element. - - - Sets the enumerator to its initial position, which is before the first element in the collection. - The collection was modified after the enumerator was created. - - - Represents the collection of keys in a . This class cannot be inherited. - - - - - Initializes a new instance of the class that reflects the keys in the specified . - The whose keys are reflected in the new . - dictionary is null. - - - Copies the elements to an existing one-dimensional , starting at the specified array index. - The one-dimensional that is the destination of the elements copied from . The must have zero-based indexing. - The zero-based index in array at which copying begins. - array is null. - index is less than zero. - The number of elements in the source is greater than the available space from index to the end of the destination array. - - - Gets the number of elements contained in the . - The number of elements contained in the . Retrieving the value of this property is an O(1) operation. - - - Returns an enumerator that iterates through the . - A for the . - - - Adds an item to the . This implementation always throws . - The object to add to the . - Always thrown. - - - Removes all items from the . This implementation always throws . - Always thrown. - - - Determines whether the contains a specific value. - The object to locate in the . - true if item is found in the ; otherwise, false. - - - Gets a value indicating whether the is read-only. - true if the is read-only; otherwise, false. In the default implementation of , this property always returns true. - - - Removes the first occurrence of a specific object from the . This implementation always throws . - The object to remove from the . - true if item was successfully removed from the ; otherwise, false. This method also returns false if item was not found in the original . - Always thrown. - - - Returns an enumerator that iterates through a collection. - An that can be used to iterate through the collection. - - - Copies the elements of the to an , starting at a particular index. - The one-dimensional that is the destination of the elements copied from . The must have zero-based indexing. - The zero-based index in array at which copying begins. - array is null. - index is less than zero. - array is multidimensional. -or- array does not have zero-based indexing. -or- The number of elements in the source is greater than the available space from index to the end of the destination array. -or- The type of the source cannot be cast automatically to the type of the destination array. - - - Gets a value indicating whether access to the is synchronized (thread safe). - true if access to the is synchronized (thread safe); otherwise, false. In the default implementation of , this property always returns false. - - - Gets an object that can be used to synchronize access to the . - An object that can be used to synchronize access to the . In the default implementation of , this property always returns the current instance. - - - Returns an enumerator that iterates through a collection. - An that can be used to iterate through the collection. - - - Enumerates the elements of a . - - - - - Gets the element at the current position of the enumerator. - The element in the at the current position of the enumerator. - - - Releases all resources used by the . - - - Advances the enumerator to the next element of the . - true if the enumerator was successfully advanced to the next element; false if the enumerator has passed the end of the collection. - The collection was modified after the enumerator was created. - - - Gets the element at the current position of the enumerator. - The element in the collection at the current position of the enumerator. - The enumerator is positioned before the first element of the collection or after the last element. - - - Sets the enumerator to its initial position, which is before the first element in the collection. - The collection was modified after the enumerator was created. - - - Represents the collection of values in a . This class cannot be inherited. - - - - - Initializes a new instance of the class that reflects the values in the specified . - The whose values are reflected in the new . - dictionary is null. - - - Copies the elements to an existing one-dimensional , starting at the specified array index. - The one-dimensional that is the destination of the elements copied from . The must have zero-based indexing. - The zero-based index in array at which copying begins. - array is null. - index is less than zero. - The number of elements in the source is greater than the available space from index to the end of the destination array. - - - Gets the number of elements contained in the . - The number of elements contained in the . - - - Returns an enumerator that iterates through the . - A for the . - - - Adds an item to the . This implementation always throws . - The object to add to the . - Always thrown. - - - Removes all items from the . This implementation always throws . - Always thrown. - - - Determines whether the contains a specific value. - The object to locate in the . - true if item is found in the ; otherwise, false. - - - Gets a value indicating whether the is read-only. - true if the is read-only; otherwise, false. In the default implementation of , this property always returns true. - - - Removes the first occurrence of a specific object from the . This implementation always throws . - The object to remove from the . - true if item was successfully removed from the ; otherwise, false. This method also returns false if item was not found in the original . - Always thrown. - - - Returns an enumerator that iterates through a collection. - An that can be used to iterate through the collection. - - - Copies the elements of the to an , starting at a particular index. - The one-dimensional that is the destination of the elements copied from . The must have zero-based indexing. - The zero-based index in array at which copying begins. - array is null. - index is less than zero. - array is multidimensional. -or- array does not have zero-based indexing. -or- The number of elements in the source is greater than the available space from index to the end of the destination array. -or- The type of the source cannot be cast automatically to the type of the destination array. - - - Gets a value indicating whether access to the is synchronized (thread safe). - true if access to the is synchronized (thread safe); otherwise, false. In the default implementation of , this property always returns false. - - - Gets an object that can be used to synchronize access to the . - An object that can be used to synchronize access to the . In the default implementation of , this property always returns the current instance. - - - Returns an enumerator that iterates through a collection. - An that can be used to iterate through the collection. - - - Represents a collection of keys and values. - The type of the keys in the dictionary. - The type of the values in the dictionary. - - - Initializes a new instance of the class that is empty, has the default initial capacity, and uses the default equality comparer for the key type. - - - Initializes a new instance of the class that contains elements copied from the specified and uses the default equality comparer for the key type. - The whose elements are copied to the new . - dictionary is null. - dictionary contains one or more duplicate keys. - - - Initializes a new instance of the class that is empty, has the default initial capacity, and uses the specified . - The implementation to use when comparing keys, or null to use the default for the type of the key. - - - Initializes a new instance of the class that is empty, has the specified initial capacity, and uses the default equality comparer for the key type. - The initial number of elements that the can contain. - capacity is less than 0. - - - Initializes a new instance of the class that contains elements copied from the specified and uses the specified . - The whose elements are copied to the new . - The implementation to use when comparing keys, or null to use the default for the type of the key. - dictionary is null. - dictionary contains one or more duplicate keys. - - - Initializes a new instance of the class that is empty, has the specified initial capacity, and uses the specified . - The initial number of elements that the can contain. - The implementation to use when comparing keys, or null to use the default for the type of the key. - capacity is less than 0. - - - Initializes a new instance of the class with serialized data. - A object containing the information required to serialize the . - A structure containing the source and destination of the serialized stream associated with the . - - - Adds the specified key and value to the dictionary. - The key of the element to add. - The value of the element to add. The value can be null for reference types. - key is null. - An element with the same key already exists in the . - - - Removes all keys and values from the . - - - Gets the that is used to determine equality of keys for the dictionary. - The generic interface implementation that is used to determine equality of keys for the current and to provide hash values for the keys. - - - Determines whether the contains the specified key. - The key to locate in the . - true if the contains an element with the specified key; otherwise, false. - key is null. - - - Determines whether the contains a specific value. - The value to locate in the . The value can be null for reference types. - true if the contains an element with the specified value; otherwise, false. - - - Gets the number of key/value pairs contained in the . - The number of key/value pairs contained in the . - - - Returns an enumerator that iterates through the . - A structure for the . - - - Implements the interface and returns the data needed to serialize the instance. - A object that contains the information required to serialize the instance. - A structure that contains the source and destination of the serialized stream associated with the instance. - info is null. - - - Gets or sets the value associated with the specified key. - The key of the value to get or set. - The value associated with the specified key. If the specified key is not found, a get operation throws a , and a set operation creates a new element with the specified key. - key is null. - The property is retrieved and key does not exist in the collection. - - - Gets a collection containing the keys in the . - A containing the keys in the . - - - Implements the interface and raises the deserialization event when the deserialization is complete. - The source of the deserialization event. - The object associated with the current instance is invalid. - - - Removes the value with the specified key from the . - The key of the element to remove. - true if the element is successfully found and removed; otherwise, false. This method returns false if key is not found in the . - key is null. - - - Gets the value associated with the specified key. - The key of the value to get. - When this method returns, contains the value associated with the specified key, if the key is found; otherwise, the default value for the type of the value parameter. This parameter is passed uninitialized. - true if the contains an element with the specified key; otherwise, false. - key is null. - - - Gets a collection containing the values in the . - A containing the values in the . - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Copies the elements of the to an array, starting at the specified array index. - The one-dimensional array that is the destination of the elements copied from . The array must have zero-based indexing. - The zero-based index in array at which copying begins. - array is null. - index is less than 0. - array is multidimensional. -or- array does not have zero-based indexing. -or- The number of elements in the source is greater than the available space from index to the end of the destination array. -or- The type of the source cannot be cast automatically to the type of the destination array. - - - Gets a value indicating whether access to the is synchronized (thread safe). - true if access to the is synchronized (thread safe); otherwise, false. In the default implementation of , this property always returns false. - - - Gets an object that can be used to synchronize access to the . - An object that can be used to synchronize access to the . - - - Adds the specified key and value to the dictionary. - The object to use as the key. - The object to use as the value. - key is null. - key is of a type that is not assignable to the key type TKey of the . -or- value is of a type that is not assignable to TValue, the type of values in the . -or- A value with the same key already exists in the . - - - Determines whether the contains an element with the specified key. - The key to locate in the . - true if the contains an element with the specified key; otherwise, false. - key is null. - - - Returns an for the . - An for the . - - - Gets a value indicating whether the has a fixed size. - true if the has a fixed size; otherwise, false. In the default implementation of , this property always returns false. - - - Gets a value indicating whether the is read-only. - true if the is read-only; otherwise, false. In the default implementation of , this property always returns false. - - - Gets or sets the value with the specified key. - The key of the value to get. - The value associated with the specified key, or null if key is not in the dictionary or key is of a type that is not assignable to the key type TKey of the . - key is null. - A value is being assigned, and key is of a type that is not assignable to the key type TKey of the . -or- A value is being assigned, and value is of a type that is not assignable to the value type TValue of the . - - - Gets an containing the keys of the . - An containing the keys of the . - - - Removes the element with the specified key from the . - The key of the element to remove. - key is null. - - - Gets an containing the values in the . - An containing the values in the . - - - Returns an enumerator that iterates through the collection. - An that can be used to iterate through the collection. - - - Provides a base class for implementations of the generic interface. - The type of objects to compare. - - - Initializes a new instance of the class. - - - Returns a default equality comparer for the type specified by the generic argument. - The default instance of the class for type T. - - - When overridden in a derived class, determines whether two objects of type T are equal. - The first object to compare. - The second object to compare. - true if the specified objects are equal; otherwise, false. - - - When overridden in a derived class, serves as a hash function for the specified object for hashing algorithms and data structures, such as a hash table. - The object for which to get a hash code. - A hash code for the specified object. - The type of obj is a reference type and obj is null. - - - Determines whether the specified objects are equal. - The first object to compare. - The second object to compare. - true if the specified objects are equal; otherwise, false. - x or y is of a type that cannot be cast to type T. - - - Returns a hash code for the specified object. - The for which a hash code is to be returned. - A hash code for the specified object. - The type of obj is a reference type and obj is null. -or- obj is of a type that cannot be cast to type T. - - - Enumerates the elements of a object. - - - - Gets the element at the current position of the enumerator. - The element in the collection at the current position of the enumerator. - - - Releases all resources used by a object. - - - Advances the enumerator to the next element of the collection. - true if the enumerator was successfully advanced to the next element; false if the enumerator has passed the end of the collection. - The collection was modified after the enumerator was created. - - - Gets the element at the current position of the enumerator. - The element in the collection at the current position of the enumerator, as an . - The enumerator is positioned before the first element of the collection or after the last element. - - - Sets the enumerator to its initial position, which is before the first element in the collection. - The collection was modified after the enumerator was created. - - - Represents a set of values. - The type of elements in the hash set. - - - Initializes a new instance of the class that is empty and uses the default equality comparer for the set type. - - - Initializes a new instance of the class that uses the default equality comparer for the set type, contains elements copied from the specified collection, and has sufficient capacity to accommodate the number of elements copied. - The collection whose elements are copied to the new set. - collection is null. - - - Initializes a new instance of the class that is empty and uses the specified equality comparer for the set type. - The implementation to use when comparing values in the set, or null to use the default implementation for the set type. - - - Initializes a new instance of the class that uses the specified equality comparer for the set type, contains elements copied from the specified collection, and has sufficient capacity to accommodate the number of elements copied. - The collection whose elements are copied to the new set. - The implementation to use when comparing values in the set, or null to use the default implementation for the set type. - collection is null. - - - Initializes a new instance of the class with serialized data. - A object that contains the information required to serialize the object. - A structure that contains the source and destination of the serialized stream associated with the object. - - - Adds the specified element to a set. - The element to add to the set. - true if the element is added to the object; false if the element is already present. - - - Removes all elements from a object. - - - Gets the object that is used to determine equality for the values in the set. - The object that is used to determine equality for the values in the set. - - - Determines whether a object contains the specified element. - The element to locate in the object. - true if the object contains the specified element; otherwise, false. - - - Copies the elements of a object to an array. - The one-dimensional array that is the destination of the elements copied from the object. The array must have zero-based indexing. - array is null. - - - Copies the elements of a object to an array, starting at the specified array index. - The one-dimensional array that is the destination of the elements copied from the object. The array must have zero-based indexing. - The zero-based index in array at which copying begins. - array is null. - arrayIndex is less than 0. - arrayIndex is greater than the length of the destination array. - - - Copies the specified number of elements of a object to an array, starting at the specified array index. - The one-dimensional array that is the destination of the elements copied from the object. The array must have zero-based indexing. - The zero-based index in array at which copying begins. - The number of elements to copy to array. - array is null. - arrayIndex is less than 0. -or- count is less than 0. - arrayIndex is greater than the length of the destination array. -or- count is greater than the available space from the index to the end of the destination array. - - - Gets the number of elements that are contained in a set. - The number of elements that are contained in the set. - - - Returns an object that can be used for equality testing of a object. - An object that can be used for deep equality testing of the object. - - - Removes all elements in the specified collection from the current object. - The collection of items to remove from the object. - other is null. - - - Returns an enumerator that iterates through a object. - A object for the object. - - - Implements the interface and returns the data needed to serialize a object. - A object that contains the information required to serialize the object. - A structure that contains the source and destination of the serialized stream associated with the object. - info is null. - - - Modifies the current object to contain only elements that are present in that object and in the specified collection. - The collection to compare to the current object. - other is null. - - - Determines whether a object is a proper subset of the specified collection. - The collection to compare to the current object. - true if the object is a proper subset of other; otherwise, false. - other is null. - - - Determines whether a object is a proper superset of the specified collection. - The collection to compare to the current object. - true if the object is a proper superset of other; otherwise, false. - other is null. - - - Determines whether a object is a subset of the specified collection. - The collection to compare to the current object. - true if the object is a subset of other; otherwise, false. - other is null. - - - Determines whether a object is a superset of the specified collection. - The collection to compare to the current object. - true if the object is a superset of other; otherwise, false. - other is null. - - - Implements the interface and raises the deserialization event when the deserialization is complete. - The source of the deserialization event. - The object associated with the current object is invalid. - - - Determines whether the current object and a specified collection share common elements. - The collection to compare to the current object. - true if the object and other share at least one common element; otherwise, false. - other is null. - - - Removes the specified element from a object. - The element to remove. - true if the element is successfully found and removed; otherwise, false. This method returns false if item is not found in the object. - - - Removes all elements that match the conditions defined by the specified predicate from a collection. - The delegate that defines the conditions of the elements to remove. - The number of elements that were removed from the collection. - match is null. - - - Determines whether a object and the specified collection contain the same elements. - The collection to compare to the current object. - true if the object is equal to other; otherwise, false. - other is null. - - - Modifies the current object to contain only elements that are present either in that object or in the specified collection, but not both. - The collection to compare to the current object. - other is null. - - - Sets the capacity of a object to the actual number of elements it contains, rounded up to a nearby, implementation-specific value. - - - Modifies the current object to contain all elements that are present in itself, the specified collection, or both. - The collection to compare to the current object. - other is null. - - - Adds an item to an object. - The object to add to the object. - The is read-only. - - - Gets a value indicating whether a collection is read-only. - true if the collection is read-only; otherwise, false. - - - Returns an enumerator that iterates through a collection. - An object that can be used to iterate through the collection. - - - Returns an enumerator that iterates through a collection. - An object that can be used to iterate through the collection. - - - Defines methods to manipulate generic collections. - The type of the elements in the collection. - - - Adds an item to the . - The object to add to the . - The is read-only. - - - Removes all items from the . - The is read-only. - - - Determines whether the contains a specific value. - The object to locate in the . - true if item is found in the ; otherwise, false. - - - Copies the elements of the to an , starting at a particular index. - The one-dimensional that is the destination of the elements copied from . The must have zero-based indexing. - The zero-based index in array at which copying begins. - array is null. - arrayIndex is less than 0. - The number of elements in the source is greater than the available space from arrayIndex to the end of the destination array. - - - Gets the number of elements contained in the . - The number of elements contained in the . - - - Gets a value indicating whether the is read-only. - true if the is read-only; otherwise, false. - - - Removes the first occurrence of a specific object from the . - The object to remove from the . - true if item was successfully removed from the ; otherwise, false. This method also returns false if item is not found in the original . - The is read-only. - - - Defines a method that a type implements to compare two objects. - The type of objects to compare. - - - Compares two objects and returns a value indicating whether one is less than, equal to, or greater than the other. - The first object to compare. - The second object to compare. -

A signed integer that indicates the relative values of x and y, as shown in the following table.

-
Value

-

Meaning

-

Less than zero

-

x is less than y.

-

Zero

-

x equals y.

-

Greater than zero

-

x is greater than y.

-

-
-
- - Represents a generic collection of key/value pairs. - The type of keys in the dictionary. - The type of values in the dictionary. - - - Adds an element with the provided key and value to the . - The object to use as the key of the element to add. - The object to use as the value of the element to add. - key is null. - An element with the same key already exists in the . - The is read-only. - - - Determines whether the contains an element with the specified key. - The key to locate in the . - true if the contains an element with the key; otherwise, false. - key is null. - - - Gets or sets the element with the specified key. - The key of the element to get or set. - The element with the specified key. - key is null. - The property is retrieved and key is not found. - The property is set and the is read-only. - - - Gets an containing the keys of the . - An containing the keys of the object that implements . - - - Removes the element with the specified key from the . - The key of the element to remove. - true if the element is successfully removed; otherwise, false. This method also returns false if key was not found in the original . - key is null. - The is read-only. - - - Gets the value associated with the specified key. - The key whose value to get. - When this method returns, the value associated with the specified key, if the key is found; otherwise, the default value for the type of the value parameter. This parameter is passed uninitialized. - true if the object that implements contains an element with the specified key; otherwise, false. - key is null. - - - Gets an containing the values in the . - An containing the values in the object that implements . - - - Exposes the enumerator, which supports a simple iteration over a collection of a specified type. - The type of objects to enumerate. - - - Returns an enumerator that iterates through the collection. - An enumerator that can be used to iterate through the collection. - - - Supports a simple iteration over a generic collection. - The type of objects to enumerate. - - - Gets the element in the collection at the current position of the enumerator. - The element in the collection at the current position of the enumerator. - - - Encapsulates zero or more components. - - - Initializes a new instance of the class. - - - Adds the specified to the . The component is unnamed. - The component to add. - component is null. - - - Adds the specified to the and assigns it a name. - The component to add. - The unique, case-insensitive name to assign to the component. -or- null, which leaves the component unnamed. - component is null. - name is not unique. - - - Gets all the components in the . - A collection that contains the components in the . - - - Creates a site for the given and assigns the given name to the site. - The to create a site for. - The name to assign to component, or null to skip the name assignment. - The newly created site. - - - Releases all resources used by the . - - - Releases the unmanaged resources used by the , and optionally releases the managed resources. - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - Releases unmanaged resources and performs other cleanup operations before the is reclaimed by garbage collection. - - - Gets the service object of the specified type, if it is available. - The of the service to retrieve. - An implementing the requested service, or null if the service cannot be resolved. - - - Removes a component from the . - The component to remove. - - - Removes a component from the without setting to null. - The component to remove. - - - Determines whether the component name is unique for this container. - The named component. - The component name to validate. - component is null. - name is not unique. - - - Provides a base class for the container filter service. - - - Initializes a new instance of the class. - - - Filters the component collection. - The component collection to filter. - A that represents a modified collection. - - - Provides a type converter to convert objects to and from various other representations. - - - Initializes a new instance of the class. - - - Gets a value indicating whether this converter can convert an object in the given source type to a using the specified context. - An that provides a format context. - A that represents the type you wish to convert from. - true if this converter can perform the conversion; otherwise, false. - - - Gets a value indicating whether this converter can convert an object to the given destination type using the context. - An that provides a format context. - A that represents the type you wish to convert to. - true if this converter can perform the conversion; otherwise, false. - - - Converts the specified value object to a . - An that provides a format context. - A that specifies the culture to which to convert. - The to convert. - An that represents the converted value. - value specifies a culture that is not valid. - The conversion cannot be performed. - - - Converts the given value object to the specified destination type. - An that provides a format context. - A that specifies the culture to which to convert. - The to convert. - The to convert the value to. - An that represents the converted value. - destinationType is null. - The conversion cannot be performed. - - - Retrieves the name of the specified culture. - A that specifies the culture to get the name for. - The name of the specified culture. - - - Gets a collection of standard values for a object using the specified context. - An that provides a format context. - A containing a standard set of valid values, or null if the data type does not support a standard set of values. - - - Gets a value indicating whether the list of standard values returned from is an exhaustive list. - An that provides a format context. - false because the returned from is not an exhaustive list of possible values (that is, other values are possible). This method never returns true. - - - Gets a value indicating whether this object supports a standard set of values that can be picked from a list using the specified context. - An that provides a format context. - true because should be called to find a common set of values the object supports. This method never returns false. - - - Represents a collection of objects. - - - Initializes a new instance of the class with the given array of objects. - An array of type that provides the events for this collection. - - - Initializes a new instance of the class with the given array of objects. The collection is optionally read-only. - An array of type that provides the events for this collection. - true to specify a read-only collection; otherwise, false. - - - Adds an to the end of the collection. - An to add to the collection. - The position of the within the collection. - The collection is read-only. - - - Removes all objects from the collection. - The collection is read-only. - - - Returns whether the collection contains the given . - The to find within the collection. - true if the collection contains the value parameter given; otherwise, false. - - - Gets the number of event descriptors in the collection. - The number of event descriptors in the collection. - - - Specifies an empty collection to use, rather than creating a new one with no items. This static field is read-only. - - - - Gets the description of the event with the specified name in the collection. - The name of the event to get from the collection. - true if you want to ignore the case of the event; otherwise, false. - The with the specified name, or null if the event does not exist. - - - Gets an enumerator for this . - An enumerator that implements . - - - Returns the index of the given . - The to find within the collection. - The index of the given within the collection. - - - Inserts an to the collection at a specified index. - The index within the collection in which to insert the value parameter. - An to insert into the collection. - The collection is read-only. - - - Sorts the members of this , using the specified . - A comparer to use to sort the objects in this collection. - - - Sorts the members of this . The specified order is applied first, followed by the default sort for this collection, which is usually alphabetical. - An array of strings describing the order in which to sort the objects in this collection. - - - Gets or sets the event with the specified index number. - The zero-based index number of the to get or set. - The with the specified index number. - index is not a valid index for . - - - Gets or sets the event with the specified name. - The name of the to get or set. - The with the specified name, or null if the event does not exist. - - - Removes the specified from the collection. - The to remove from the collection. - The collection is read-only. - - - Removes the at the specified index from the collection. - The index of the to remove. - The collection is read-only. - - - Sorts the members of this , given a specified sort order and an . - An array of strings describing the order in which to sort the objects in the collection. - An to use to sort the objects in this collection. - The new . - - - Sorts the members of this , given a specified sort order. - An array of strings describing the order in which to sort the objects in the collection. - The new . - - - Sorts the members of this , using the default sort for this collection, which is usually alphabetical. - The new . - - - Sorts the members of this , using the specified . - An to use to sort the objects in this collection. - The new . - - - Copies the elements of the collection to an , starting at a particular index. - The one-dimensional that is the destination of the elements copied from collection. The must have zero-based indexing. - The zero-based index in array at which copying begins. - - - Gets the number of elements contained in the collection. - The number of elements contained in the collection. - - - Gets a value indicating whether access to the collection is synchronized. - true if access to the collection is synchronized; otherwise, false. - - - Gets an object that can be used to synchronize access to the collection. - An object that can be used to synchronize access to the collection. - - - Returns an enumerator that iterates through a collection. - An that can be used to iterate through the collection. - - - Adds an item to the collection. - The to add to the collection. - The position into which the new element was inserted. - The collection is read-only. - - - Removes all the items from the collection. - The collection is read-only. - - - Determines whether the collection contains a specific value. - The to locate in the collection. - true if the is found in the collection; otherwise, false. - - - Determines the index of a specific item in the collection. - The to locate in the collection. - The index of value if found in the list; otherwise, -1. - - - Inserts an item to the collection at the specified index. - The zero-based index at which value should be inserted. - The to insert into the collection. - The collection is read-only. - - - Gets a value indicating whether the collection has a fixed size. - true if the collection has a fixed size; otherwise, false. - - - Gets a value indicating whether the collection is read-only. - true if the collection is read-only; otherwise, false. - - - Gets or sets the element at the specified index. - The zero-based index of the element to get or set. - The element at the specified index. - The collection is read-only. - index is less than 0. -or- index is equal to or greater than . - - - Removes the first occurrence of a specific object from the collection. - The to remove from the collection. - The collection is read-only. - - - Removes the item at the specified index. - The zero-based index of the item to remove. - The collection is read-only. - - - Provides a simple list of delegates. This class cannot be inherited. - - - Initializes a new instance of the class. - - - Adds a delegate to the list. - The object that owns the event. - The delegate to add to the list. - - - Adds a list of delegates to the current list. - The list to add. - - - Disposes the delegate list. - - - Gets or sets the delegate for the specified object. - An object to find in the list. - The delegate for the specified key, or null if a delegate does not exist. - - - Removes a delegate from the list. - The object that owns the event. - The delegate to remove from the list. - - - Provides a type converter to convert expandable objects to and from various other representations. - - - Initializes a new instance of the class. - - - Gets a collection of properties for the type of object specified by the value parameter. - An that provides a format context. - An that specifies the type of object to get the properties for. - An array of type that will be used as a filter. - A with the properties that are exposed for the component, or null if there are no properties. - - - Gets a value indicating whether this object supports properties using the specified context. - An that provides a format context. - true because should be called to find the properties of this object. This method never returns false. - - - Specifies a property that is offered by an extender provider. This class cannot be inherited. - - - Initializes a new instance of the class. - - - Returns a value that indicates whether this instance is equal to a specified object. - An to compare with this instance or a null reference (Nothing in Visual Basic). - true if obj equals the type and value of this instance; otherwise, false. - - - Gets the property that is being provided. - A encapsulating the property that is being provided. - - - Returns the hash code for this instance. - A 32-bit signed integer hash code. - - - Provides an indication whether the value of this instance is the default value for the derived class. - true if this instance is the default attribute for the class; otherwise, false. - - - Gets the extender provider that is providing the property. - The that is providing the property. - - - Gets the type of object that can receive the property. - A describing the type of object that can receive the property. - - - Provides a type converter to convert objects to and from various other representations. - - - Initializes a new instance of the class. - - - Gets a value indicating whether this converter can convert an object in the given source type to a GUID object using the context. - An that provides a format context. - A that represents the type you wish to convert from. - true if this converter can perform the conversion; otherwise, false. - - - Gets a value indicating whether this converter can convert an object to the given destination type using the context. - An that provides a format context. - A that represents the type you wish to convert to. - true if this converter can perform the conversion; otherwise, false. - - - Converts the given object to a GUID object. - An that provides a format context. - An optional . If not supplied, the current culture is assumed. - The to convert. - An that represents the converted value. - The conversion cannot be performed. - - - Converts the given object to another type. - A formatter context. - The culture into which value will be converted. - The object to convert. - The type to convert the object to. - The converted object. - destinationType is null. - The conversion cannot be performed. - - - Provides data for events that can be handled completely in an event handler. - - - Initializes a new instance of the class with a default property value of false. - - - Initializes a new instance of the class with the specified default value for the property. - The default value for the property. - - - Gets or sets a value that indicates whether the event handler has completely handled the event or whether the system should continue its own processing. - true if the event has been completely handled; otherwise, false. - - - Represents a method that can handle events which may or may not require further processing after the event handler has returned. - The source of the event. - A that contains the event data. - - - Provides the features required to support both complex and simple scenarios when binding to a data source. - - - Adds the to the indexes used for searching. - The to add to the indexes used for searching. - - - Adds a new item to the list. - The item added to the list. - is false. - - - Gets whether you can update items in the list. - true if you can update the items in the list; otherwise, false. - - - Gets whether you can add items to the list using . - true if you can add items to the list using ; otherwise, false. - - - Gets whether you can remove items from the list, using or . - true if you can remove items from the list; otherwise, false. - - - Sorts the list based on a and a . - The to sort by. - One of the values. - is false. - - - Returns the index of the row that has the given . - The to search on. - The value of the property parameter to search for. - The index of the row that has the given . - is false. - - - Gets whether the items in the list are sorted. - true if has been called and has not been called; otherwise, false. - is false. - - - Occurs when the list changes or an item in the list changes. - - - - Removes the from the indexes used for searching. - The to remove from the indexes used for searching. - - - Removes any sort applied using . - is false. - - - Gets the direction of the sort. - One of the values. - is false. - - - Gets the that is being used for sorting. - The that is being used for sorting. - is false. - - - Gets whether a event is raised when the list changes or an item in the list changes. - true if a event is raised when the list changes or when an item changes; otherwise, false. - - - Gets whether the list supports searching using the method. - true if the list supports searching using the method; otherwise, false. - - - Gets whether the list supports sorting. - true if the list supports sorting; otherwise, false. - - - Extends the interface by providing advanced sorting and filtering capabilities. - - - Sorts the data source based on the given . - The containing the sorts to apply to the data source. - - - Gets or sets the filter to be used to exclude items from the collection of items returned by the data source - The string used to filter items out in the item collection returned by the data source. - - - Removes the current filter applied to the data source. - - - Gets the collection of sort descriptions currently applied to the data source. - The currently applied to the data source. - - - Gets a value indicating whether the data source supports advanced sorting. - true if the data source supports advanced sorting; otherwise, false. - - - Gets a value indicating whether the data source supports filtering. - true if the data source supports filtering; otherwise, false. - - - Adds transactional capability when adding a new item to a collection. - - - Discards a pending new item from the collection. - The index of the item that was previously added to the collection. - - - Commits a pending new item to the collection. - The index of the item that was previously added to the collection. - - - Defines the mechanism for querying the object for changes and resetting of the changed status. - - - Resets the object’s state to unchanged by accepting the modifications. - - - Gets the object's changed status. - true if the object’s content has changed since the last call to ; otherwise, false. - - - Provides a top-level mapping layer between a COM object and a . - - - Gets the attributes for the specified component. - The component to get attributes for. - A collection of attributes for component. - - - Gets the class name for the specified component. - The component to get the class name for. - The name of the class that corresponds with component. - - - Gets the type converter for the specified component. - The component to get the for. - The for component. - - - Gets the default event for the specified component. - The component to get the default event for. - An that represents component's default event. - - - Gets the default property for the specified component. - The component to get the default property for. - A that represents component's default property. - - - Gets the editor for the specified component. - The component to get the editor for. - The base type of the editor for component. - The editor for component. - - - Gets the events for the specified component. - The component to get events for. - A collection of event descriptors for component. - - - Gets the events with the specified attributes for the specified component. - The component to get events for. - The attributes used to filter events. - A collection of event descriptors for component. - - - Gets the name of the specified component. - The component to get the name of. - The name of component. - - - Gets the properties with the specified attributes for the specified component. - The component to get events for. - The attributes used to filter properties. - A collection of property descriptors for component. - - - Gets the value of the property that has the specified dispatch identifier. - The object to which the property belongs. - The dispatch identifier. - A , passed by reference, that represents whether the property was retrieved. - The value of the property that has the specified dispatch identifier. - - - Gets the value of the property that has the specified name. - The object to which the property belongs. - The name of the property. - A , passed by reference, that represents whether the property was retrieved. - The value of the property that has the specified name. - - - Provides functionality required by all components. - - - Represents the method that handles the event of a component. - - - - Gets or sets the associated with the . - The object associated with the component; or null, if the component does not have a site. - - - Provides functionality for containers. Containers are objects that logically contain zero or more components. - - - Adds the specified to the at the end of the list. - The to add. - - - Adds the specified to the at the end of the list, and assigns a name to the component. - The to add. - The unique, case-insensitive name to assign to the component. -or- null that leaves the component unnamed. - - - Gets all the components in the . - A collection of objects that represents all the components in the . - - - Removes a component from the . - The to remove. - - - Provides an interface that supplies dynamic custom type information for an object. - - - Returns a collection of custom attributes for this instance of a component. - An containing the attributes for this object. - - - Returns the class name of this instance of a component. - The class name of the object, or null if the class does not have a name. - - - Returns the name of this instance of a component. - The name of the object, or null if the object does not have a name. - - - Returns a type converter for this instance of a component. - A that is the converter for this object, or null if there is no for this object. - - - Returns the default event for this instance of a component. - An that represents the default event for this object, or null if this object does not have events. - - - Returns the default property for this instance of a component. - A that represents the default property for this object, or null if this object does not have properties. - - - Returns an editor of the specified type for this instance of a component. - A that represents the editor for this object. - An of the specified type that is the editor for this object, or null if the editor cannot be found. - - - Returns the events for this instance of a component. - An that represents the events for this component instance. - - - Returns the events for this instance of a component using the specified attribute array as a filter. - An array of type that is used as a filter. - An that represents the filtered events for this component instance. - - - Returns the properties for this instance of a component. - A that represents the properties for this component instance. - - - Returns the properties for this instance of a component using the attribute array as a filter. - An array of type that is used as a filter. - A that represents the filtered properties for this component instance. - - - Returns an object that contains the property described by the specified property descriptor. - A that represents the property whose owner is to be found. - An that represents the owner of the specified property. - - - Provides the functionality to offer custom error information that a user interface can bind to. - - - Gets an error message indicating what is wrong with this object. - An error message indicating what is wrong with this object. The default is an empty string (""). - - - Gets the error message for the property with the given name. - The name of the property whose error message to get. - The error message for the property. The default is an empty string (""). - - - Provides functionality to commit or rollback changes to an object that is used as a data source. - - - Begins an edit on an object. - - - Discards changes since the last call. - - - Pushes changes since the last or call into the underlying object. - - - Defines the interface for extending properties to other components in a container. - - - Specifies whether this object can provide its extender properties to the specified object. - The to receive the extender properties. - true if this object can provide extender properties to the specified object; otherwise, false. - - - Provides an interface to facilitate the retrieval of the builder's name and to display the builder. - - - Gets a localized name. - A localized name. - - - Shows the builder. - The language service that is calling the builder. - The expression being edited. - The new value. - true if the value should be replaced with newValue; otherwise, false (if the user cancels, for example). - - - Provides functionality to an object to return a list that can be bound to a data source. - - - Gets a value indicating whether the collection is a collection of objects. - true if the collection is a collection of objects; otherwise, false. - - - Returns an that can be bound to a data source from an object that does not implement an itself. - An that can be bound to a data source from the object. - - - Specifies that an object has no subproperties capable of being edited. This class cannot be inherited. - - - Initializes a new instance of the class. - true if the object is immutable; otherwise, false. - - - Represents the default value for . - - - - Returns a value that indicates whether this instance is equal to a specified object. - An to compare with this instance or a null reference (Nothing in Visual Basic). - true if obj equals the type and value of this instance; otherwise, false. - - - Returns the hash code for this instance. - A hash code for the current . - - - Gets whether the object is immutable. - true if the object is immutable; otherwise, false. - - - Indicates whether the value of this instance is the default value. - true if this instance is the default attribute for the class; otherwise, false. - - - Specifies that an object has at least one editable subproperty. This static field is read-only. - - - - Specifies that an object has no subproperties that can be edited. This static field is read-only. - - - - Provides functionality for nested containers, which logically contain zero or more other components and are owned by a parent component. - - - Gets the owning component for the nested container. - The that owns the nested container. - - - Provides the ability to retrieve the full nested name of a component. - - - Gets the full name of the component in this site. - The full name of the component in this site. - - - Indicates whether the component associated with this attribute has been inherited from a base class. This class cannot be inherited. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with the specified inheritance level. - An that indicates the level of inheritance to set this attribute to. - - - Specifies that the default value for is . This field is read-only. - - - - Override to test for equality. - The object to test. - true if the object is the same; otherwise, false. - - - Returns the hashcode for this object. - A hash code for the current . - - - Gets or sets the current inheritance level stored in this attribute. - The stored in this attribute. - - - Specifies that the component is inherited. This field is read-only. - - - - Specifies that the component is inherited and is read-only. This field is read-only. - - - - Gets a value indicating whether the current value of the attribute is the default value for the attribute. - true if the current value of the attribute is the default; otherwise, false. - - - Specifies that the component is not inherited. This field is read-only. - - - - Converts this attribute to a string. - A string that represents this . - - - Defines identifiers for types of inheritance levels. - - - The object is inherited. - - - - The object is inherited, but has read-only access. - - - - The object is not inherited. - - - - Specifies the relationship between the columns in a GROUP BY clause and the non-aggregated columns in the select-list of a SELECT statement. - - - The GROUP BY clause must contain all nonaggregated columns in the select list, and must not contain other columns not in the select list. - - - - The GROUP BY clause must contain all nonaggregated columns in the select list, and can contain other columns not in the select list. - - - - The GROUP BY clause is not supported. - - - - The support for the GROUP BY clause is unknown. - - - - There is no relationship between the columns in the GROUP BY clause and the nonaggregated columns in the SELECT list. You may group by any column. - - - - - - - - - - Specifies how identifiers are treated by the data source when searching the system catalog. - - - The data source ignores identifier case when searching the system catalog. The identifiers "ab" and "AB" will match. - - - - The data source distinguishes identifier case when searching the system catalog. The identifiers "ab" and "AB" will not match. - - - - The data source has ambiguous rules regarding identifier case and cannot discern this information. - - - - Provides data for the RowUpdated event of a .NET Framework data provider. - - - Initializes a new instance of the class. - The sent through an . - The executed when is called. - The type of SQL statement executed. - The sent through an . - - - Gets the executed when is called. - The executed when is called. - - - Copies references to the modified rows into the provided array. - The array of to copy into. - - - Copies references to the modified rows into the provided array. - The array of to copy into. - The index in the array to start copying into. - - - Gets any errors generated by the .NET Framework data provider when the was executed. - The errors generated by the .NET Framework data provider when the was executed. - - - Gets the number of rows changed, inserted, or deleted by execution of the SQL statement. - The number of rows changed, inserted, or deleted; 0 if no rows were affected or the statement failed; and -1 for SELECT statements. - - - Gets the sent through an . - The sent through an . - - - Gets the number of rows processed in a batch of updated records. - int that specifies the number of row processed. - - - Gets the type of SQL statement executed. - The type of SQL statement executed. - - - Gets the of the property. - One of the values. The default is Continue. - - - Gets the sent through an . - The sent through an . - - - Provides the data for the RowUpdating event of a .NET Framework data provider. - - - Initializes a new instance of the class. - The to . - The to execute when is called. - The type of SQL statement to execute. - The to send through an . - - - Gets or sets the object for an instance of this class. - The to execute during the . - - - Gets the to execute during the operation. - The to execute during the . - - - Gets any errors generated by the .NET Framework data provider when the executes. - The errors generated by the .NET Framework data provider when the executes. - - - Gets the that will be sent to the server as part of an insert, update, or delete operation. - The to send through an . - - - Gets the type of SQL statement to execute. - The type of SQL statement to execute. - - - Gets or sets the of the property. - One of the values. The default is Continue. - - - Gets the to send through the . - The to send through the . - - - Describes the column metadata of the schema for a database table. - - - Specifies whether value DBNull is allowed. - - - - Specifies the name of the column in the schema table. - - - - Specifies the name of the schema in the schema table. - - - - Specifies the name of the table in the schema table. - - - - Specifies the name of the column in the schema table. - - - - Specifies the ordinal of the column. - - - - Specifies the size of the column. - - - - Specifies the type of data in the column. - - - - Specifies whether this column is aliased. - - - - Specifies whether this column is an expression. - - - - Specifies whether this column is a key for the table. - - - - Specifies whether this column contains long data. - - - - Specifies whether a unique constraint applies to this column. - - - - Specifies the non-versioned provider-specific data type of the column. - - - - Specifies the precision of the column data, if the data is numeric. - - - - Specifies the scale of the column data, if the data is numeric. - - - - Specifies the provider-specific data type of the column. - - - - Describes optional column metadata of the schema for a database table. - - - Specifies the value at which the series for new identity columns is assigned. - - - - Specifies the increment between values in the identity column. - - - - The name of the catalog associated with the results of the latest query. - - - - The namespace of the column. - - - - The server name of the column. - - - - The namespace for the table that contains the column. - - - - Specifies the mapping for the column. - - - - The default value for the column. - - - - The expression used to compute the column. - - - - Specifies whether the column values in the column are automatically incremented. - - - - Specifies whether this column is hidden. - - - - Specifies whether this column is read-only. - - - - Specifies whether this column contains row version information. - - - - Specifies the provider-specific data type of the column. - - - - Specifies what types of Transact-SQL join statements are supported by the data source. - - - The data source supports full outer joins. - - - - The data source supports inner joins. - - - - The data source supports left outer joins. - - - - The data source does not support join queries. - - - - The data source supports right outer joins. - - - - Specifies how conflicting changes to the data source will be detected and resolved. - - - Update and delete statements will include all searchable columns from the table in the WHERE clause. This is equivalent to specifying CompareAllValuesUpdate | CompareAllValuesDelete. - - - - If any Timestamp columns exist in the table, they are used in the WHERE clause for all generated update statements. This is equivalent to specifying CompareRowVersionUpdate | CompareRowVersionDelete. - - - - All update and delete statements include only columns in the WHERE clause. If no is defined, all searchable columns are included in the WHERE clause. This is equivalent to OverwriteChangesUpdate | OverwriteChangesDelete. - - - - Describes the current state of the connection to a data source. - - - The connection to the data source is broken. This can occur only after the connection has been opened. A connection in this state may be closed and then re-opened. (This value is reserved for future versions of the product.) - - - - The connection is closed. - - - - The connection object is connecting to the data source. - - - - The connection object is executing a command. (This value is reserved for future versions of the product.) - - - - The connection object is retrieving data. (This value is reserved for future versions of the product.) - - - - The connection is open. - - - - Represents a constraint that can be enforced on one or more objects. - - - Initializes a new instance of the class. - - - Gets the to which this constraint belongs. - The to which the constraint belongs. - - - Gets the to which this constraint belongs. - - - The name of a constraint in the . - The name of the . - The name is a null value or empty string. - The already contains a with the same name (The comparison is not case-sensitive.). - - - Gets the collection of user-defined constraint properties. - A of custom information. - - - Sets the constraint's . - The to which this constraint will belong. - - - Gets the to which the constraint applies. - A to which the constraint applies. - - - Gets the , if there is one, as a string. - The string value of the . - - - Represents a collection of constraints for a . - - - Adds the specified object to the collection. - The Constraint to add. - The constraint argument is null. - The constraint already belongs to this collection, or belongs to another collection. - The collection already has a constraint with the same name. (The comparison is not case-sensitive.) - - - Constructs a new with the specified name, , and value that indicates whether the column is a primary key, and adds it to the collection. - The name of the UniqueConstraint. - The to which the constraint applies. - Specifies whether the column should be the primary key. If true, the column will be a primary key column. - A new UniqueConstraint. - The constraint already belongs to this collection. -Or- The constraint belongs to another collection. - The collection already has a constraint with the specified name. (The comparison is not case-sensitive.) - - - Constructs a new with the specified name, parent column, and child column, and adds the constraint to the collection. - The name of the . - The primary key, or parent, . - The foreign key, or child, . - A new ForeignKeyConstraint. - - - Constructs a new with the specified name, array of objects, and value that indicates whether the column is a primary key, and adds it to the collection. - The name of the . - An array of objects to which the constraint applies. - Specifies whether the column should be the primary key. If true, the column will be a primary key column. - A new UniqueConstraint. - The constraint already belongs to this collection. -Or- The constraint belongs to another collection. - The collection already has a constraint with the specified name. (The comparison is not case-sensitive.) - - - Constructs a new , with the specified arrays of parent columns and child columns, and adds the constraint to the collection. - The name of the . - An array of objects that are the primary key, or parent, columns. - An array of objects that are the foreign key, or child, columns. - A new ForeignKeyConstraint. - - - Copies the elements of the specified array to the end of the collection. - An array of objects to add to the collection. - - - Indicates whether a can be removed. - The to be tested for removal from the collection. - true if the can be removed from collection; otherwise, false. - - - Clears the collection of any objects. - - - Occurs whenever the is changed because of objects being added or removed. - - - - Indicates whether the object specified by name exists in the collection. - The of the constraint. - true if the collection contains the specified constraint; otherwise, false. - - - Copies the collection objects to a one-dimensional instance starting at the specified index. - The one-dimensional that is the destination of the values copied from the collection. - The index of the array at which to start inserting. - - - Gets the index of the specified . - The to search for. - The zero-based index of the if it is in the collection; otherwise, -1. - - - Gets the index of the specified by name. - The name of the . - The index of the if it is in the collection; otherwise, -1. - - - Gets the from the collection at the specified index. - The index of the constraint to return. - The at the specified index. - The index value is greater than the number of items in the collection. - - - Gets the from the collection with the specified name. - The of the constraint to return. - The with the specified name; otherwise a null value if the does not exist. - - - Removes the specified from the collection. - The to remove. - The constraint argument is null. - The constraint does not belong to the collection. - - - Removes the object specified by name from the collection. - The name of the to remove. - - - Removes the object at the specified index from the collection. - The index of the to remove. - The collection does not have a constraint at this index. - - - Represents the exception that is thrown when attempting an action that violates a constraint. - - - Initializes a new instance of the class. This is the default constructor. - - - Initializes a new instance of the class with the specified string. - The string to display when the exception is thrown. - - - Initializes a new instance of the class using the specified serialization and stream context. - The data necessary to serialize or deserialize an object. - Description of the source and destination of the specified serialized stream. - - - Initializes a new instance of the class using the specified string and inner exception. - The string to display when the exception is thrown. - Gets the Exception instance that caused the current exception. - - - Represents the schema of a column in a . - - - Initializes a new instance of a class as type string. - - - Initializes a new instance of the class, as type string, using the specified column name. - A string that represents the name of the column to be created. If set to null or an empty string (""), a default name will be specified when added to the columns collection. - - - Initializes a new instance of the class using the specified column name and data type. - A string that represents the name of the column to be created. If set to null or an empty string (""), a default name will be specified when added to the columns collection. - A supported . - No dataType was specified. - - - Initializes a new instance of the class using the specified name, data type, and expression. - A string that represents the name of the column to be created. If set to null or an empty string (""), a default name will be specified when added to the columns collection. - A supported . - The expression used to create this column. For more information, see the property. - No dataType was specified. - - - Initializes a new instance of the class using the specified name, data type, expression, and value that determines whether the column is an attribute. - A string that represents the name of the column to be created. If set to null or an empty string (""), a default name will be specified when added to the columns collection. - A supported . - The expression used to create this column. For more information, see the property. - One of the values. - No dataType was specified. - - - Gets or sets a value that indicates whether null values are allowed in this column for rows that belong to the table. - true if null values values are allowed; otherwise, false. The default is true. - - - Gets or sets a value that indicates whether the column automatically increments the value of the column for new rows added to the table. - true if the value of the column increments automatically; otherwise, false. The default is false. - The column is a computed column. - - - Gets or sets the starting value for a column that has its property set to true. The default is 0. - The starting value for the feature. - - - Gets or sets the increment used by a column with its property set to true. - The number by which the value of the column is automatically incremented. The default is 1. - The value set is zero. - - - Gets or sets the caption for the column. - The caption of the column. If not set, returns the value. - - - This member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - This member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - Gets or sets the of the column. - One of the values. - - - Gets or sets the name of the column in the . - The name of the column. - The property is set to null or an empty string and the column belongs to a collection. - A column with the same name already exists in the collection. The name comparison is not case sensitive. - - - Gets or sets the type of data stored in the column. - A object that represents the column data type. - The column already has data stored. - - - Gets or sets the DateTimeMode for the column. - The for the specified column. - - - Gets or sets the default value for the column when you are creating new rows. - A value appropriate to the column's . - When you are adding a row, the default value is not an instance of the column's data type. - - - Gets or sets the expression used to filter rows, calculate the values in a column, or create an aggregate column. - An expression to calculate the value of a column, or create an aggregate column. The return type of an expression is determined by the of the column. - The or property is set to true. - When you are using the CONVERT function, the expression evaluates to a string, but the string does not contain a representation that can be converted to the type parameter. - When you are using the CONVERT function, the requested cast is not possible. See the Conversion function in the following section for detailed information about possible casts. - When you use the SUBSTRING function, the start argument is out of range. -Or- When you use the SUBSTRING function, the length argument is out of range. - When you use the LEN function or the TRIM function, the expression does not evaluate to a string. This includes expressions that evaluate to . - - - Gets the collection of custom user information associated with a . - A of custom information. - - - Gets or sets the maximum length of a text column. - The maximum length of the column in characters. If the column has no maximum length, the value is –1 (default). - - - Gets or sets the namespace of the . - The namespace of the . - The namespace already has data. - - - This member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - Parameter reference. - - - Gets the (zero-based) position of the column in the collection. - The position of the column. Gets -1 if the column is not a member of a collection. - - - Gets or sets an XML prefix that aliases the namespace of the . - The XML prefix for the namespace. - - - This member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - Parameter reference. - - - Gets or sets a value that indicates whether the column allows for changes as soon as a row has been added to the table. - true if the column is read only; otherwise, false. The default is false. - The property is set to false on a computed column. - - - Changes the ordinal or position of the to the specified ordinal or position. - The specified ordinal. - - - Gets the to which the column belongs to. - The that the belongs to. - - - Gets the of the column, if one exists. - The value, if the property is set; otherwise, the property. - - - Gets or sets a value that indicates whether the values in each row of the column must be unique. - true if the value must be unique; otherwise, false. The default is false. - The column is a calculated column. - - - Provides data for the event. - - - Initializes a new instance of the class. - The of the column with the changing value. - The with the changing value. - The new value. - - - Gets the with a changing value. - The with a changing value. - - - Gets or sets the proposed new value for the column. - The proposed value, of type . - - - Gets the of the column with a changing value. - The of the column with a changing value. - - - Represents the method that will handle the event. - The source of the event. - A that contains the event data. - - - Represents a collection of objects for a . - - - Creates and adds a object to the . - The newly created . - - - Creates and adds the specified object to the . - The to add. - The column parameter is null. - The column already belongs to this collection, or to another collection. - The collection already has a column with the specified name. (The comparison is not case-sensitive.) - The expression is invalid. See the property for more information about how to create expressions. - - - Creates and adds a object that has the specified name to the . - The name of the column. - The newly created . - The collection already has a column with the specified name. (The comparison is not case-sensitive.) - - - Creates and adds a object that has the specified name and type to the . - The to use when you create the column. - The of the new column. - The newly created . - The collection already has a column with the specified name. (The comparison is not case-sensitive.) - The expression is invalid. See the property for more information about how to create expressions. - - - Creates and adds a object that has the specified name, type, and expression to the . - The name to use when you create the column. - The of the new column. - The expression to assign to the property. - The newly created . - The collection already has a column with the specified name. (The comparison is not case-sensitive.) - The expression is invalid. See the property for more information about how to create expressions. - - - Copies the elements of the specified array to the end of the collection. - The array of objects to add to the collection. - - - Checks whether a specific column can be removed from the collection. - A in the collection. - true if the column can be removed. false if, The column parameter is null. The column does not belong to this collection. The column is part of a relationship. Another column's expression depends on this column. - - - Clears the collection of any columns. - - - Occurs when the columns collection changes, either by adding or removing a column. - - - - Checks whether the collection contains a column with the specified name. - The of the column to look for. - true if a column exists with this name; otherwise, false. - - - Copies the entire collection into an existing array, starting at a specified index within the array. - An array of objects to copy the collection into. - The index to start from. - - - Gets the index of a column specified by name. - The name of the column to return. - The index of the column specified by column if it is found; otherwise, -1. - - - Gets the index of the column with the specific name (the name is not case sensitive). - The name of the column to find. - The zero-based index of the column with the specified name, or -1 if the column does not exist in the collection. - - - Gets the from the collection at the specified index. - The zero-based index of the column to return. - The at the specified index. - The index value is greater than the number of items in the collection. - - - Gets the from the collection with the specified name. - The of the column to return. - The in the collection with the specified ; otherwise a null value if the does not exist. - - - Removes the specified object from the collection. - The to remove. - The column parameter is null. - The column does not belong to this collection. -Or- The column is part of a relationship. -Or- Another column's expression depends on this column. - - - Removes the object that has the specified name from the collection. - The name of the column to remove. - The collection does not have a column with the specified name. - - - Removes the column at the specified index from the collection. - The index of the column to remove. - The collection does not have a column at the specified index. - - - Represents the exception that is thrown when errors are generated using ADO.NET components. - - - Initializes a new instance of the class. This is the default constructor. - - - Initializes a new instance of the class with the specified string. - The string to display when the exception is thrown. - - - Initializes a new instance of the class with the specified serialization information and context. - The data necessary to serialize or deserialize an object. - Description of the source and destination of the specified serialized stream. - - - Initializes a new instance of the class with the specified string and inner exception. - The string to display when the exception is thrown. - A reference to an inner exception. - - - Represents a parent/child relationship between two objects. - - - Initializes a new instance of the class using the specified name, and parent and child objects. - The name of the . If null or an empty string (""), a default name will be given when the created object is added to the . - The parent in the relationship. - The child in the relationship. - One or both of the objects contains null. - The columns have different data types -Or- The tables do not belong to the same . - - - Initializes a new instance of the class using the specified name and matched arrays of parent and child objects. - The name of the relation. If null or an empty string (""), a default name will be given when the created object is added to the . - An array of parent objects. - An array of child objects. - One or both of the objects contains null. - The objects have different data types -Or- One or both of the arrays are not composed of distinct columns from the same table. -Or- The tables do not belong to the same . - - - Initializes a new instance of the class using the specified name, parent and child objects, and a value that indicates whether to create constraints. - The name of the relation. If null or an empty string (""), a default name will be given when the created object is added to the . - The parent in the relation. - The child in the relation. - A value that indicates whether constraints are created. true, if constraints are created. Otherwise, false. - One or both of the objects contains null. - The columns have different data types -Or- The tables do not belong to the same . - - - Initializes a new instance of the class using the specified name, matched arrays of parent and child objects, and value that indicates whether to create constraints. - The name of the relation. If null or an empty string (""), a default name will be given when the created object is added to the . - An array of parent objects. - An array of child objects. - A value that indicates whether to create constraints. true, if constraints are created. Otherwise, false. - One or both of the objects is null. - The columns have different data types -Or- The tables do not belong to the same . - - - This constructor is provided for design time support in the Visual Studio environment. - The name of the relation. If null or an empty string (""), a default name will be given when the created object is added to the . - The name of the that is the parent table of the relation. - The name of the that is the child table of the relation. - An array of object names in the parent of the relation. - An array of object names in the child of the relation. - A value that indicates whether relationships are nested. - - - This constructor is provided for design time support in the Visual Studio environment. - The name of the . If null or an empty string (""), a default name will be given when the created object is added to the . - The name of the that is the parent table of the relation. - The name of the parent table namespace. - The name of the that is the child table of the relation. - The name of the child table namespace. - An array of object names in the parent of the relation. - An array of object names in the child of the relation. - A value that indicates whether relationships are nested. - - - This method supports the .NET Framework infrastructure and is not intended to be used directly from your code. - The parent and child tables belong to different objects. -Or- One or more pairs of parent and child objects have mismatched data types. -Or- The parent and child objects are identical. - - - Gets the child objects of this relation. - An array of objects. - - - Gets the for the relation. - A ForeignKeyConstraint. - - - Gets the child table of this relation. - A that is the child table of the relation. - - - Gets the to which the belongs. - A to which the belongs. - - - Gets the collection that stores customized properties. - A that contains customized properties. - - - Gets or sets a value that indicates whether objects are nested. - true, if objects are nested; otherwise, false. - - - This member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - Parameter reference. - - - Gets an array of objects that are the parent columns of this . - An array of objects that are the parent columns of this . - - - Gets the that guarantees that values in the parent column of a are unique. - A that makes sure that values in a parent column are unique. - - - Gets the parent of this . - A that is the parent table of this relation. - - - This member supports the .NET Framework infrastructure and is not intended to be used directly from your code. - Parameter reference. - - - Gets or sets the name used to retrieve a from the . - The name of the a . - null or empty string ("") was passed into a that is a . - The belongs to a collection that already contains a with the same name. - - - Gets the , if one exists. - The value of the property. - - - Represents the collection of objects for this . - - - Initializes a new instance of the class. - - - Adds a to the . - The DataRelation to add to the collection. - The relation parameter is a null value. - The relation already belongs to this collection, or it belongs to another collection. - The collection already has a relation with the specified name. (The comparison is not case sensitive.) - The relation has entered an invalid state since it was created. - - - Creates a with a specified parent and child column, and adds it to the collection. - The parent column of the relation. - The child column of the relation. - The created relation. - - - Creates a with the specified parent and child columns, and adds it to the collection. - The parent columns of the relation. - The child columns of the relation. - The created relation. - The relation argument is a null value. - The relation already belongs to this collection, or it belongs to another collection. - The collection already has a relation with the same name. (The comparison is not case sensitive.) - The relation has entered an invalid state since it was created. - - - Creates a with the specified name, and parent and child columns, and adds it to the collection. - The name of the relation. - The parent column of the relation. - The child column of the relation. - The created relation. - - - Creates a with the specified name and arrays of parent and child columns, and adds it to the collection. - The name of the DataRelation to create. - An array of parent objects. - An array of child DataColumn objects. - The created DataRelation. - The relation name is a null value. - The relation already belongs to this collection, or it belongs to another collection. - The collection already has a relation with the same name. (The comparison is not case sensitive.) - The relation has entered an invalid state since it was created. - - - Creates a with the specified name, parent and child columns, with optional constraints according to the value of the createConstraints parameter, and adds it to the collection. - The name of the relation. - The parent column of the relation. - The child column of the relation. - true to create constraints; otherwise false. (The default is true). - The created relation. - - - Creates a with the specified name, arrays of parent and child columns, and value specifying whether to create a constraint, and adds it to the collection. - The name of the DataRelation to create. - An array of parent objects. - An array of child DataColumn objects. - true to create a constraint; otherwise false. - The created relation. - The relation name is a null value. - The relation already belongs to this collection, or it belongs to another collection. - The collection already has a relation with the same name. (The comparison is not case sensitive.) - The relation has entered an invalid state since it was created. - - - Performs verification on the table. - The relation to check. - The relation is null. - The relation already belongs to this collection, or it belongs to another collection. - The collection already has a relation with the same name. (The comparison is not case sensitive.) - - - Copies the elements of the specified array to the end of the collection. - The array of objects to add to the collection. - - - Verifies whether the specified can be removed from the collection. - The relation to perform the check against. - true if the can be removed; otherwise, false. - - - Clears the collection of any relations. - - - Occurs when the collection has changed. - - - - Verifies whether a with the specific name (case insensitive) exists in the collection. - The name of the relation to find. - true, if a relation with the specified name exists; otherwise false. - - - Copies the collection of objects starting at the specified index. - The array of objects to copy the collection to. - The index to start from. - - - This method supports the .NET Framework infrastructure and is not intended to be used directly from your code. - The referenced DataSet. - - - Gets the index of the specified object. - The relation to search for. - The 0-based index of the relation, or -1 if the relation is not found in the collection. - - - Gets the index of the specified by name. - The name of the relation to find. - The zero-based index of the relation with the specified name, or -1 if the relation does not exist in the collection. - - - Gets the object at the specified index. - The zero-based index to find. - The , or a null value if the specified does not exist. - The index value is greater than the number of items in the collection. - - - Gets the object specified by name. - The name of the relation to find. - The named , or a null value if the specified does not exist. - - - Raises the event. - A that contains the event data. - - - Raises the event. - A that contains the event data. - - - Removes the specified relation from the collection. - The relation to remove. - The relation is a null value. - The relation does not belong to the collection. - - - Removes the relation with the specified name from the collection. - The name of the relation to remove. - The collection does not have a relation with the specified name. - - - Removes the relation at the specified index from the collection. - The index of the relation to remove. - The collection does not have a relation at the specified index. - - - Performs a verification on the specified object. - The DataRelation object to verify. - The collection does not have a relation at the specified index. - The specified relation does not belong to this collection, or it belongs to another collection. - - - Represents a row of data in a . - - - Initializes a new instance of the DataRow. Constructs a row from the builder. Only for internal usage.. - builder - - - Commits all the changes made to this row since the last time was called. - The row does not belong to the table. - - - Starts an edit operation on a object. - The method was called inside the event. - The method was called upon a deleted row. - - - Cancels the current edit on the row. - The method was called inside the event. - - - Clears the errors for the row. This includes the and errors set with . - - - Deletes the . - The has already been deleted. - - - Ends the edit occurring on the row. - The method was called inside the event. - The edit broke a constraint. - The row belongs to the table and the edit tried to change the value of a read-only column. - The edit tried to put a null value into a column where is false. - - - Gets the child rows of this using the specified . - The to use. - An array of objects or an array of length zero. - The relation and row do not belong to the same table. - The relation is null. - The row does not belong to the table. - The row does not have this version of data. - - - Gets the child rows of a using the specified of a . - The of the to use. - An array of objects or an array of length zero. - The relation and row do not belong to the same table. - The row does not belong to the table. - - - Gets the child rows of a using the specified , and . - The to use. - One of the values specifying the version of the data to get. Possible values are Default, Original, Current, and Proposed. - An array of objects. - The relation and row do not belong to the same table. - The relation is null. - The row does not belong to the table. - The row does not have the requested . - - - Gets the child rows of a using the specified of a , and . - The of the to use. - One of the values specifying the version of the data to get. Possible values are Default, Original, Current, and Proposed. - An array of objects or an array of length zero. - The relation and row do not belong to the same table. - The relation is null. - The row does not belong to the table. - The row does not have the requested . - - - Gets the error description for a column, specified by name. - The name of the column. - The text of the error description. - - - Gets the error description of the specified . - A . - The text of the error description. - - - Gets the error description for the column specified by index. - The zero-based index of the column. - The text of the error description. - The columnIndex argument is out of range. - - - Gets an array of columns that have errors. - An array of objects that contain errors. - - - Gets the parent row of a using the specified . - The to use. - The parent of the current row. - The relation does not belong to the . The row is null. - A child row has multiple parents. - This row does not belong to the child table of the object. - The row does not belong to a table. - - - Gets the parent row of a using the specified of a . - The of a . - The parent of the current row. - The relation and row do not belong to the same table. - A child row has multiple parents. - The row does not belong to the table. - - - Gets the parent row of a using the specified , and . - The to use. - One of the values specifying the version of the data to get. - The parent of the current row. - The row is null. The relation does not belong to this table's parent relations. - A child row has multiple parents. - The relation's child table is not the table the row belongs to. - The row does not belong to a table. - The row does not have this version of data. - - - Gets the parent row of a using the specified of a , and . - The of a . - One of the values. - The parent of the current row. - The relation and row do not belong to the same table. - The relation is null. - A child row has multiple parents. - The row does not belong to the table. - The row does not have the requested . - - - Gets the parent rows of a using the specified , and . - The to use. - One of the values specifying the version of the data to get. - An array of objects or an array of length zero. - The does not belong to this row's . - The row is null. - The relation's child table is not the table the row belongs to. - The row does not belong to a . - The row does not have the requested . - - - Gets the parent rows of a using the specified . - The to use. - An array of objects or an array of length zero. - The does not belong to this row's . - The row is null. - The relation's child table is not the table the row belongs to. - The row does not belong to a . - - - Gets the parent rows of a using the specified of a . - The of a . - An array of objects or an array of length zero. - The relation and row do not belong to the same table. - The row does not belong to the table. - - - Gets the parent rows of a using the specified of a , and . - The of a . - One of the values specifying the version of the data to get. Possible values are Default, Original, Current, and Proposed. - An array of objects or an array of length zero. - The relation and row do not belong to the same table. - The relation is null. - The row does not belong to the table. - The row does not have the requested . - - - Gets a value that indicates whether there are errors in a row. - true if the row contains an error; otherwise, false. - - - Gets a value that indicates whether a specified version exists. - One of the values that specifies the row version. - true if the version exists; otherwise, false. - - - Gets a value that indicates whether the specified contains a null value. - A . - true if the column contains a null value; otherwise, false. - - - Gets a value that indicates whether the column at the specified index contains a null value. - The zero-based index of the column. - true if the column contains a null value; otherwise, false. - - - Gets a value that indicates whether the named column contains a null value. - The name of the column. - true if the column contains a null value; otherwise, false. - - - Gets a value that indicates whether the specified and contains a null value. - A . - One of the values that specifies the row version. Possible values are Default, Original, Current, and Proposed. - true if the column contains a null value; otherwise, false. - - - Gets or sets the data stored in the specified . - A that contains the data. - An that contains the data. - The column does not belong to this table. - The column is null. - An attempt was made to set a value on a deleted row. - The data types of the value and the column do not match. - - - Gets or sets the data stored in the column specified by index. - The zero-based index of the column. - An that contains the data. - Occurs when you try to set a value on a deleted row. - The columnIndex argument is out of range. - Occurs when you set the value and the new value's does not match . - - - Gets or sets the data stored in the column specified by name. - The name of the column. - An that contains the data. - The column specified by columnName cannot be found. - Occurs when you try to set a value on a deleted row. - Occurs when you set a value and its does not match . - Occurs when you try to insert a null value into a column where is set to false. - - - Gets the specified version of data stored in the specified . - A that contains information about the column. - One of the values that specifies the row version that you want. Possible values are Default, Original, Current, and Proposed. - An that contains the data. - The column does not belong to the table. - The column argument contains null. - The row does not have this version of data. - - - Gets the data stored in the column, specified by index and version of the data to retrieve. - The zero-based index of the column. - One of the values that specifies the row version that you want. Possible values are Default, Original, Current, and Proposed. - An that contains the data. - The columnIndex argument is out of range. - The data types of the value and the column do not match. - The row does not have this version of data. - An attempt was made to set a value on a deleted row. - - - Gets the specified version of data stored in the named column. - The name of the column. - One of the values that specifies the row version that you want. Possible values are Default, Original, Current, and Proposed. - An that contains the data. - The column specified by columnName cannot be found. - The data types of the value and the column do not match. - The row does not have this version of data. - The row was deleted. - - - Gets or sets all the values for this row through an array. - An array of type . - The array is larger than the number of columns in the table. - A value in the array does not match its in its respective . - An edit broke a constraint. - An edit tried to change the value of a read-only column. - An edit tried to put a null value in a column where of the object is false. - The row has been deleted. - - - Rejects all changes made to the row since was last called. - The row does not belong to the table. - - - Gets or sets the custom error description for a row. - The text describing an error. - - - Gets the current state of the row with regard to its relationship to the . - One of the values. - - - Changes the of a to Added. - - - Sets the error description for a column specified as a . - The to set the error description for. - The error description. - - - Sets the error description for a column specified by index. - The zero-based index of the column. - The error description. - The columnIndex argument is out of range - - - Sets the error description for a column specified by name. - The name of the column. - The error description. - - - Changes the of a to Modified. - - - Sets the value of the specified to a null value. - A . - - - Sets the parent row of a with specified new parent . - The new parent . - - - Sets the parent row of a with specified new parent and . - The new parent . - The relation to use. - One of the rows does not belong to a table - One of the rows is null. - The relation does not belong to the of the object. - The relation's child is not the table this row belongs to. - - - Gets the for which this row has a schema. - The to which this row belongs. - - - Describes an action performed on a . - - - The row has been added to the table. - - - - The row has changed. - - - - The original and the current versions of the row have been changed. - - - - The original version of the row has been changed. - - - - The changes to the row have been committed. - - - - The row was deleted from the table. - - - - The row has not changed. - - - - The most recent change to the row has been rolled back. - - - - The DataRowBuilder type supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - Provides data for the , , , and events. - - - Initializes a new instance of the class. - The upon which an action is occuring. - One of the values. - - - Gets the action that has occurred on a . - One of the values. - - - Gets the row upon which an action has occurred. - The upon which an action has occurred. - - - Represents the method that will handle the , , , and events of a . - The source of the event. - A that contains the event data. - - - Represents a collection of rows for a . - - - Adds the specified to the object. - The to add. - The row is null. - The row either belongs to another table or already belongs to this table. - The addition invalidates a constraint. - The addition tries to put a null in a where is false. - - - Creates a row using specified values and adds it to the . - The array of values that are used to create the new row. - None. - The array is larger than the number of columns in the table. - A value does not match its respective column type. - Adding the row invalidates a constraint. - Trying to put a null in a column where is false. - - - Clears the collection of all rows. - A is enforced on the . - - - Gets a value that indicates whether the primary key of any row in the collection contains the specified value. - The value of the primary key to test for. - true if the collection contains a with the specified primary key value; otherwise, false. - The table does not have a primary key. - - - Gets a value that indicates whether the primary key columns of any row in the collection contain the values specified in the object array. - An array of primary key values to test for. - true if the contains a with the specified key values; otherwise, false. - The table does not have a primary key. - - - Copies all the objects from the collection into the given array, starting at the given destination array index. - The one-dimensional array that is the destination of the elements copied from the DataRowCollection. The array must have zero-based indexing. - The zero-based index in the array at which copying begins. - - - Copies all the objects from the collection into the given array, starting at the given destination array index. - The one-dimensional array that is the destination of the elements copied from the DataRowCollection. The array must have zero-based indexing. - The zero-based index in the array at which copying begins. - - - Gets the total number of objects in this collection. - The total number of objects in this collection. - - - Gets the row specified by the primary key value. - The primary key value of the to find. - A that contains the primary key value specified; otherwise a null value if the primary key value does not exist in the . - The table does not have a primary key. - - - Gets the row that contains the specified primary key values. - An array of primary key values to find. The type of the array is Object. - A object that contains the primary key values specified; otherwise a null value if the primary key value does not exist in the . - No row corresponds to that index value. - The table does not have a primary key. - - - Gets an for this collection. - An for this collection. - - - Gets the index of the specified object. - The DataRow to search for. - The zero-based index of the row, or -1 if the row is not found in the collection. - - - Inserts a new row into the collection at the specified location. - The to add. - The (zero-based) location in the collection where you want to add the DataRow. - - - Gets the row at the specified index. - The zero-based index of the row to return. - The specified . - The index value is greater than the number of items in the collection. - - - Removes the specified from the collection. - The to remove. - - - Removes the row at the specified index from the collection. - The index of the row to remove. - - - Defines abbreviations that you can use in place of the full contract syntax. - - - Initializes a new instance of the class. - - - Enables the factoring of legacy if-then-throw code into separate methods for reuse, and provides full control over thrown exceptions and arguments. - - - Initializes a new instance of the class. - - - Specifies that a separate type contains the code contracts for this type. - - - Initializes a new instance of the class. - The type that contains the code contracts for this type. - - - Gets the type that contains the code contracts for this type. - The type that contains the code contracts for this type. - - - Specifies that a class is a contract for a type. - - - Initializes a new instance of the class, specifying the type the current class is a contract for. - The type the current class is a contract for. - - - Gets the type that this code contract applies to. - The type that this contract applies to. - - - Provides methods and data for the event. - - - Provides data for the event. - One of the enumeration values that specifies the contract that failed. - The message for the event. - The condition for the event. - The exception that caused the event. - - - Gets the condition for the failure of the contract. - The condition for the failure. - - - Gets the type of contract that failed. - One of the enumeration values that specifies the type of contract that failed. - - - Indicates whether the event has been handled. - true if the event has been handled; otherwise, false. - - - Gets the message that describes the event. - The message that describes the event. - - - Gets the original exception that caused the event. - The exception that caused the event. - - - Sets the property to true. - - - Sets the property to true. - - - Indicates whether the code contract escalation policy should be applied. - true to apply the escalation policy; otherwise, false. The default is false. - - - Specifies the type of contract that failed. - - - An contract failed. - - - - An contract failed. - - - - An contract failed. - - - - An contract failed. - - - - An contract failed. - - - - A contract failed. - - - - Marks a method as being the invariant method for a class. - - - Initializes a new instance of the class. - - - Enables you to set contract and tool options at assembly, type, or method granularity. - - - Initializes a new instance of the class by using the provided category, setting, and enable/disable value. - The category for the option to be set. - The option setting. - true to enable the option; false to disable the option. - - - Initializes a new instance of the class by using the provided category, setting, and value. - The category of the option to be set. - The option setting. - The value for the setting. - - - Gets the category of the option. - The category of the option. - - - Determines if an option is enabled. - true if the option is enabled; otherwise, false. - - - Gets the setting for the option. - The setting for the option. - - - Gets the value for the option. - The value for the option. - - - Specifies that a field can be used in method contracts when the field has less visibility than the method. - - - Initializes a new instance of the class. - The property name to apply to the field. - - - Gets the property name to be applied to the field. - The property name to be applied to the field. - - - Specifies that an assembly is a reference assembly that contains contracts. - - - Initializes a new instance of the class. - - - Identifies a member that has no run-time behavior. - - - Initializes a new instance of the class. - - - Instructs analysis tools to assume the correctness of an assembly, type, or member without performing static verification. - - - Initializes a new instance of the class. - true to require verification; otherwise, false. - - - Gets the value that indicates whether to verify the contract of the target. - true if verification is required; otherwise, false. - - - Indicates that a type or method is pure, that is, it does not make any visible state changes. - - - Initializes a new instance of the class. - - - Correlates traces that are part of a logical transaction. - - - Gets or sets the identity for a global activity. - A structure that identifies the global activity. - - - Gets the logical operation stack from the call context. - A object that represents the logical operation stack for the call context. - - - Starts a logical operation on a thread. - - - Starts a logical operation with the specified identity on a thread. - An object identifying the operation. - The operationId parameter is null. - - - Stops the current logical operation. - The property is an empty stack. - - - Provides data for the and events. - - - Gets the line of characters that was written to a redirected output stream. - The line that was written by an associated to its redirected or stream. - - - Represents the method that will handle the event or event of a . - The source of the event. - A that contains the event data. - - - Provides a set of methods and properties that help debug your code. - - - Checks for a condition; if the condition is false, displays a message box that shows the call stack. - The conditional expression to evaluate. If the condition is true, a failure message is not sent and the message box is not displayed. - - - Checks for a condition; if the condition is false, outputs a specified message and displays a message box that shows the call stack. - The conditional expression to evaluate. If the condition is true, the specified message is not sent and the message box is not displayed. - The message to send to the collection. - - - Checks for a condition; if the condition is false, outputs two specified messages and displays a message box that shows the call stack. - The conditional expression to evaluate. If the condition is true, the specified messages are not sent and the message box is not displayed. - The message to send to the collection. - The detailed message to send to the collection. - - - Checks for a condition; if the condition is false, outputs two messages (simple and formatted) and displays a message box that shows the call stack. - The conditional expression to evaluate. If the condition is true, the specified messages are not sent and the message box is not displayed. - The message to send to the collection. - The composite format string to send to the collection. This message contains text intermixed with zero or more format items, which correspond to objects in the args array. - An object array that contains zero or more objects to format. - - - Gets or sets a value indicating whether should be called on the after every write. - true if is called on the after every write; otherwise, false. - - - Flushes the output buffer and then calls the Close method on each of the . - - - Emits the specified error message. - A message to emit. - - - Emits an error message and a detailed error message. - A message to emit. - A detailed message to emit. - - - Flushes the output buffer and causes buffered data to write to the collection. - - - Increases the current by one. - - - Gets or sets the indent level. - The indent level. The default is 0. - - - Gets or sets the number of spaces in an indent. - The number of spaces in an indent. The default is four. - - - Writes a message followed by a line terminator to the trace listeners in the collection. - The message to write. - - - Writes a formatted string followed by a line terminator to the trace listeners in the collection. - A composite format string that contains text intermixed with zero or more format items, which correspond to objects in the args array. - An object array containing zero or more objects to format. - format is null. - format is invalid. -or- The number that indicates an argument to format is less than zero, or greater than or equal to the number of specified objects to format. - - - Decreases the current by one. - - - Writes a category name and message to the trace listeners in the collection. - A message to write. - A category name used to organize the output. - - - Writes a category name and the value of the object's method to the trace listeners in the collection. - An object whose name is sent to the . - A category name used to organize the output. - - - Writes the value of the object's method to the trace listeners in the collection. - An object whose name is sent to the . - - - Writes a message to the trace listeners in the collection. - A message to write. - - - Writes the value of the object's method to the trace listeners in the collection if a condition is true. - The conditional expression to evaluate. If the condition is true, the value is written to the trace listeners in the collection. - An object whose name is sent to the . - - - Writes a message to the trace listeners in the collection if a condition is true. - The conditional expression to evaluate. If the condition is true, the message is written to the trace listeners in the collection. - A message to write. - - - Writes a category name and the value of the object's method to the trace listeners in the collection if a condition is true. - The conditional expression to evaluate. If the condition is true, the category name and value are written to the trace listeners in the collection. - An object whose name is sent to the . - A category name used to organize the output. - - - Writes a category name and message to the trace listeners in the collection if a condition is true. - The conditional expression to evaluate. If the condition is true, the category name and message are written to the trace listeners in the collection. - A message to write. - A category name used to organize the output. - - - Writes the value of the object's method to the trace listeners in the collection. - An object whose name is sent to the . - - - Writes a message followed by a line terminator to the trace listeners in the collection. - A message to write. - - - Writes a category name and the value of the object's method to the trace listeners in the collection. - An object whose name is sent to the . - A category name used to organize the output. - - - Writes a formatted message followed by a line terminator to the trace listeners in the collection. - A composite format string that contains text intermixed with zero or more format items, which correspond to objects in the args array. - An object array that contains zero or more objects to format. - - - Writes a category name and message to the trace listeners in the collection. - A message to write. - A category name used to organize the output. - - - Writes a category name and the value of the object's method to the trace listeners in the collection if a condition is true. - The conditional expression to evaluate. If the condition is true, the category name and value are written to the trace listeners in the collection. - An object whose name is sent to the . - A category name used to organize the output. - - - Writes the value of the object's method to the trace listeners in the collection if a condition is true. - The conditional expression to evaluate. If the condition is true, the value is written to the trace listeners in the collection. - An object whose name is sent to the . - - - Writes a message to the trace listeners in the collection if a condition is true. - The conditional expression to evaluate. If the condition is true, the message is written to the trace listeners in the collection. - A message to write. - - - Writes a category name and message to the trace listeners in the collection if a condition is true. - true to cause a message to be written; otherwise, false. - A message to write. - A category name used to organize the output. - - - Specifies the debugging mode for the just-in-time (JIT) compiler. - - - Instructs the just-in-time (JIT) compiler to use its default behavior, which includes enabling optimizations, disabling Edit and Continue support, and using symbol store sequence points if present. Starting with the .NET Framework version 2.0, JIT tracking information, the Microsoft intermediate language (MSIL) offset to the native-code offset within a method, is always generated. - - - - Disable optimizations performed by the compiler to make your output file smaller, faster, and more efficient. Optimizations result in code rearrangement in the output file, which can make debugging difficult. Typically optimization should be disabled while debugging. In versions 2.0 or later, combine this value with Default (Default | DisableOptimizations) to enable JIT tracking and disable optimizations. - - - - Enable edit and continue. Edit and continue enables you to make changes to your source code while your program is in break mode. The ability to edit and continue is compiler dependent. - - - - Use the implicit MSIL sequence points, not the program database (PDB) sequence points. The symbolic information normally includes at least one Microsoft intermediate language (MSIL) offset for each source line. When the just-in-time (JIT) compiler is about to compile a method, it asks the profiling services for a list of MSIL offsets that should be preserved. These MSIL offsets are called sequence points. - - - - Starting with the .NET Framework version 2.0, JIT tracking information is always generated, and this flag has the same effect as , except that it sets the property to false. However, because JIT tracking is always enabled, the property value is ignored in version 2.0 or later. Note that, unlike the flag, the flag cannot be used to disable JIT optimizations. - - - - Modifies code generation for runtime just-in-time (JIT) debugging. This class cannot be inherited. - - - Initializes a new instance of the class, using the specified debugging modes for the just-in-time (JIT) compiler. - A bitwise combination of the values specifying the debugging mode for the JIT compiler. - - - Initializes a new instance of the class, using the specified tracking and optimization options for the just-in-time (JIT) compiler. - true to enable debugging; otherwise, false. - true to disable the optimizer for execution; otherwise, false. - - - Gets the debugging modes for the attribute. - A bitwise combination of the values describing the debugging mode for the just-in-time (JIT) compiler. The default is . - - - Gets a value that indicates whether the runtime optimizer is disabled. - true if the runtime optimizer is disabled; otherwise, false. - - - Gets a value that indicates whether the runtime will track information during code generation for the debugger. - true if the runtime will track information during code generation for the debugger; otherwise, false. - - - Enables communication with a debugger. This class cannot be inherited. - - - Signals a breakpoint to an attached debugger. - The is not set to break into the debugger. - - - Represents the default category of message with a constant. - - - - Gets a value that indicates whether a debugger is attached to the process. - true if a debugger is attached; otherwise, false. - - - Checks to see if logging is enabled by an attached debugger. - true if a debugger is attached and logging is enabled; otherwise, false. The attached debugger is the registered managed debugger in the DbgManagedDebugger registry key. For more information on this key, see Enabling JIT-Attach Debugging. - - - Launches and attaches a debugger to the process. - true if the startup is successful or if the debugger is already attached; otherwise, false. - The is not set to start the debugger. - - - Posts a message for the attached debugger. - A description of the importance of the message. - The category of the message. - The message to show. - - - Notifies a debugger that execution is about to enter a path that involves a cross-thread dependency. - - - Determines if and how a member is displayed in the debugger variable windows. This class cannot be inherited. - - - Initializes a new instance of the class. - One of the values that specifies how to display the member. - state is not one of the values. - - - Gets the display state for the attribute. - One of the values. - - - Provides display instructions for the debugger. - - - Show the element as collapsed. - - - - Never show the element. - - - - Do not display the root element; display the child elements if the element is a collection or array of items. - - - - Determines how a class or field is displayed in the debugger variable windows. - - - Initializes a new instance of the class. - The string to be displayed in the value column for instances of the type; an empty string ("") causes the value column to be hidden. - - - Gets or sets the name to display in the debugger variable windows. - The name to display in the debugger variable windows. - - - Gets or sets the type of the attribute's target. - The attribute's target type. - is set to null. - - - Gets or sets the type name of the attribute's target. - The name of the attribute's target type. - - - Gets or sets the string to display in the type column of the debugger variable windows. - The string to display in the type column of the debugger variable windows. - - - Gets the string to display in the value column of the debugger variable windows. - The string to display in the value column of the debugger variable. - - - Specifies the . This class cannot be inherited. - - - Initializes a new instance of the class. - - - Identifies a type or member that is not part of the user code for an application. - - - Initializes a new instance of the class. - - - Indicates the code following the attribute is to be executed in run, not step, mode. - - - Initializes a new instance of the class. - - - Instructs the debugger to step through the code instead of stepping into the code. This class cannot be inherited. - - - Initializes a new instance of the class. - - - Specifies the display proxy for a type. - - - Initializes a new instance of the class using the type name of the proxy. - The type name of the proxy type. - - - Initializes a new instance of the class using the type of the proxy. - The proxy type. - type is null. - - - Gets the type name of the proxy type. - The type name of the proxy type. - - - Gets or sets the target type for the attribute. - The target type for the attribute. - is set to null. - - - Gets or sets the name of the target type. - The name of the target type. - - - Specifies that the type has a visualizer. This class cannot be inherited. - - - Initializes a new instance of the class, specifying the type name of the visualizer. - The fully qualified type name of the visualizer. - - - Initializes a new instance of the class, specifying the type of the visualizer. - The type of the visualizer. - visualizer is null. - - - Initializes a new instance of the class, specifying the type name of the visualizer and the type name of the visualizer object source. - The fully qualified type name of the visualizer. - The fully qualified type name of the visualizer object source. - - - Initializes a new instance of the class, specifying the type name of the visualizer and the type of the visualizer object source. - The fully qualified type name of the visualizer. - The type of the visualizer object source. - visualizerObjectSource is null. - - - Initializes a new instance of the class, specifying the type of the visualizer and the type name of the visualizer object source. - The type of the visualizer. - The fully qualified type name of the visualizer object source. - visualizer is null. - - - Initializes a new instance of the class, specifying the type of the visualizer and the type of the visualizer object source. - The type of the visualizer. - The type of the visualizer object source. - visualizerObjectSource is null. - - - Gets or sets the description of the visualizer. - The description of the visualizer. - - - Gets or sets the target type when the attribute is applied at the assembly level. - The type that is the target of the visualizer. - The value cannot be set because it is null. - - - Gets or sets the fully qualified type name when the attribute is applied at the assembly level. - The fully qualified type name of the target type. - - - Gets the fully qualified type name of the visualizer object source. - The fully qualified type name of the visualizer object source. - - - Gets the fully qualified type name of the visualizer. - The fully qualified visualizer type name. - - - Provides the default output methods and behavior for tracing. - - - Initializes a new instance of the class with "Default" as its property value. - - - Gets or sets a value indicating whether the application is running in user-interface mode. - true if user-interface mode is enabled; otherwise, false. - - - Emits or displays a message and a stack trace for an assertion that always fails. - The message to emit or display. - - - Emits or displays detailed messages and a stack trace for an assertion that always fails. - The message to emit or display. - The detailed message to emit or display. - - - Gets or sets the name of a log file to write trace or debug messages to. - The name of a log file to write trace or debug messages to. - - - Writes the output to the OutputDebugString function and to the method. - The message to write to OutputDebugString and . - - - Writes the output to the OutputDebugString function and to the method, followed by a carriage return and line feed (\r\n). - The message to write to OutputDebugString and . - - - Directs tracing or debugging output to a text writer, such as a stream writer, or to a stream, such as a file stream. - - - Initializes a new instance of the class that writes to the specified output stream. - The to receive the output. - stream is null. - - - Initializes a new instance of the class that writes to the specified text writer. - The to receive the output. - writer is null. - - - Initializes a new instance of the class that writes to the specified file. - The name of the file to receive the output. - fileName is null. - - - Initializes a new instance of the class that writes to the specified output stream and has the specified name. - The to receive the output. - The name of the new instance of the trace listener. - stream is null. - - - Initializes a new instance of the class that writes to the specified text writer and has the specified name. - The to receive the output. - The name of the new instance of the trace listener. - writer is null. - - - Initializes a new instance of the class that writes to the specified file and has the specified name. - The name of the file to receive the output. - The name of the new instance of the trace listener. - fileName is null. - - - Gets or sets the delimiter for the delimited list. - The delimiter for the delimited list. - is set to null. - is set to an empty string (""). - - - Returns the custom configuration file attribute supported by the delimited trace listener. - A string array that contains the single value "delimiter". - - - Writes trace information, a data object, and event information to the output file or stream. - A object that contains the current process ID, thread ID, and stack trace information. - A name used to identify the output, typically the name of the application that generated the trace event. - One of the values specifying the type of event that has caused the trace. - A numeric identifier for the event. - A data object to write to the output file or stream. - - - Writes trace information, an array of data objects, and event information to the output file or stream. - A object that contains the current process ID, thread ID, and stack trace information. - A name used to identify the output, typically the name of the application that generated the trace event. - One of the values specifying the type of event that has caused the trace. - A numeric identifier for the event. - An array of data objects to write to the output file or stream. - - - Writes trace information, a message, and event information to the output file or stream. - A object that contains the current process ID, thread ID, and stack trace information. - A name used to identify the output, typically the name of the application that generated the trace event. - One of the values specifying the type of event that has caused the trace. - A numeric identifier for the event. - The trace message to write to the output file or stream. - - - Writes trace information, a formatted array of objects, and event information to the output file or stream. - A object that contains the current process ID, thread ID, and stack trace information. - A name used to identify the output, typically the name of the application that generated the trace event. - One of the values specifying the type of event that has caused the trace. - A numeric identifier for the event. - A format string that contains zero or more format items that correspond to objects in the args array. - An array containing zero or more objects to format. - - - Represents an ordered pair of integer x- and y-coordinates that defines a point in a two-dimensional plane. - - - Initializes a new instance of the class from a . - A that specifies the coordinates for the new . - - - Initializes a new instance of the class using coordinates specified by an integer value. - A 32-bit integer that specifies the coordinates for the new . - - - Initializes a new instance of the class with the specified coordinates. - The horizontal position of the point. - The vertical position of the point. - - - Adds the specified to the specified . - The to add. - The to add - The that is the result of the addition operation. - - - Converts the specified to a by rounding the values of the to the next higher integer values. - The to convert. - The this method converts to. - - - Represents a that has and values set to zero. - - - - Specifies whether this contains the same coordinates as the specified . - The to test. - true if obj is a and has the same coordinates as this . - - - Returns a hash code for this . - An integer value that specifies a hash value for this . - - - Gets a value indicating whether this is empty. - true if both and are 0; otherwise, false. - - - Translates this by the specified amount. - The amount to offset the x-coordinate. - The amount to offset the y-coordinate. - - - Translates this by the specified . - The used offset this . - - - Translates a by a given . - The to translate. - A that specifies the pair of numbers to add to the coordinates of pt. - The translated . - - - Compares two objects. The result specifies whether the values of the and properties of the two objects are equal. - A to compare. - A to compare. - true if the and values of left and right are equal; otherwise, false. - - - - - - - - - - - Compares two objects. The result specifies whether the values of the or properties of the two objects are unequal. - A to compare. - A to compare. - true if the values of either the properties or the properties of left and right differ; otherwise, false. - - - Translates a by the negative of a given . - The to translate. - A that specifies the pair of numbers to subtract from the coordinates of pt. - A structure that is translated by the negative of a given structure. - - - Converts the specified to a object by rounding the values to the nearest integer. - The to convert. - The this method converts to. - - - Returns the result of subtracting specified from the specified . - The to be subtracted from. - The to subtract from the . - The that is the result of the subtraction operation. - - - Converts this to a human-readable string. - A string that represents this . - - - Converts the specified to a by truncating the values of the . - The to convert. - The this method converts to. - - - Gets or sets the x-coordinate of this . - The x-coordinate of this . - - - Gets or sets the y-coordinate of this . - The y-coordinate of this . - - - Represents an ordered pair of floating-point x- and y-coordinates that defines a point in a two-dimensional plane. - - - Initializes a new instance of the class with the specified coordinates. - The horizontal position of the point. - The vertical position of the point. - - - Translates a given by the specified . - The to translate. - The that specifies the numbers to add to the coordinates of pt. - The translated . - - - Translates a given by a specified . - The to translate. - The that specifies the numbers to add to the coordinates of pt. - The translated . - - - Represents a new instance of the class with member data left uninitialized. - - - - Specifies whether this contains the same coordinates as the specified . - The to test. - This method returns true if obj is a and has the same coordinates as this . - - - Returns a hash code for this structure. - An integer value that specifies a hash value for this structure. - - - Gets a value indicating whether this is empty. - true if both and are 0; otherwise, false. - - - Translates the by the specified . - The to translate. - The that specifies the numbers to add to the x- and y-coordinates of the . - The translated . - - - Translates a by a given . - The to translate. - A that specifies the pair of numbers to add to the coordinates of pt. - Returns the translated . - - - Compares two structures. The result specifies whether the values of the and properties of the two structures are equal. - A to compare. - A to compare. - true if the and values of the left and right structures are equal; otherwise, false. - - - Determines whether the coordinates of the specified points are not equal. - A to compare. - A to compare. - true to indicate the and values of left and right are not equal; otherwise, false. - - - Translates a by the negative of a given . - The to translate. - The that specifies the numbers to subtract from the coordinates of pt. - The translated . - - - Translates a by the negative of a specified . - The to translate. - The that specifies the numbers to subtract from the coordinates of pt. - The translated . - - - Translates a by the negative of a specified size. - The to translate. - The that specifies the numbers to subtract from the coordinates of pt. - The translated . - - - Translates a by the negative of a specified size. - The to translate. - The that specifies the numbers to subtract from the coordinates of pt. - The translated . - - - Converts this to a human readable string. - A string that represents this . - - - Gets or sets the x-coordinate of this . - The x-coordinate of this . - - - Gets or sets the y-coordinate of this . - The y-coordinate of this . - - - Specifies the meaning of time values that control caching behavior for resources obtained using objects. - - - Content can be taken from the cache until it is older than the age specified with this value. - - - - and . - - - - and . - - - - Content can be taken from the cache after it has expired, until the time specified with this value elapses. - - - - Content can be taken from the cache if the time remaining before expiration is greater than or equal to the time specified with this value. - - - - For internal use only. The Framework will throw an if you try to use this member. - - - - Specifies caching behavior for resources obtained using the Hypertext Transfer protocol (HTTP). - - - Satisfies a request by using the server. No entries are taken from caches, added to caches, or removed from caches between the client and server. No entries are taken from caches, added to caches, or removed from caches between the client and server. This is the default cache behavior specified in the machine configuration file that ships with the .NET Framework. - - - - Satisfies a request for a resource from the cache if the resource is available; otherwise, sends a request for a resource to the server. If the requested item is available in any cache between the client and the server, the request might be satisfied by the intermediate cache. - - - - Satisfies a request using the locally cached resource; does not send a request for an item that is not in the cache. When this cache policy level is specified, a exception is thrown if the item is not in the client cache. - - - - Satisfies a request for a resource either from the local computer's cache or a remote cache on the local area network. If the request cannot be satisfied, a exception is thrown. In the HTTP caching protocol, this is achieved using the only-if-cached cache control directive. - - - - Satisfies a request for a resource either by using the cached copy of the resource or by sending a request for the resource to the server. The action taken is determined by the current cache policy and the age of the content in the cache. This is the cache level that should be used by most applications. - - - - Never satisfies a request by using resources from the cache and does not cache resources. If the resource is present in the local cache, it is removed. This policy level indicates to intermediate caches that they should remove the resource. In the HTTP caching protocol, this is achieved using the no-cache cache control directive. - - - - Satisfies a request by using the server or a cache other than the local cache. Before the request can be satisfied by an intermediate cache, that cache must revalidate its cached entry with the server. In the HTTP caching protocol, this is achieved using the max-age = 0 cache control directive and the no-cache Pragma header. - - - - Satisfies a request by using the server. The response might be saved in the cache. In the HTTP caching protocol, this is achieved using the no-cache cache control directive and the no-cache Pragma header. - - - - Compares the copy of the resource in the cache with the copy on the server. If the copy on the server is newer, it is used to satisfy the request and replaces the copy in the cache. If the copy in the cache is the same as the server copy, the cached copy is used. In the HTTP caching protocol, this is achieved using a conditional request. - - - - Defines an application's caching requirements for resources obtained by using objects. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class using the specified cache synchronization date. - A object that specifies the time when resources stored in the cache must be revalidated. - - - Initializes a new instance of the class using the specified cache policy. - An value. - - - Initializes a new instance of the class using the specified age control and time values. - One of the following enumeration values: , , or . - A value that specifies an amount of time. - The value specified for the cacheAgeControl parameter cannot be used with this constructor. - - - Initializes a new instance of the class using the specified maximum age, age control value, and time value. - An value. - A value that specifies the maximum age for resources. - A value that specifies an amount of time. - The value specified for the cacheAgeControl parameter is not valid. - - - Initializes a new instance of the class using the specified maximum age, age control value, time value, and cache synchronization date. - An value. - A value that specifies the maximum age for resources. - A value that specifies an amount of time. - A object that specifies the time when resources stored in the cache must be revalidated. - - - Gets the cache synchronization date for this instance. - A value set to the date specified when this instance was created. If no date was specified, this property's value is . - - - Gets the value that was specified when this instance was created. - A value that specifies the cache behavior for resources that were obtained using objects. - - - Gets the maximum age permitted for a resource returned from the cache. - A value that is set to the maximum age value specified when this instance was created. If no date was specified, this property's value is . - - - Gets the maximum staleness value that is permitted for a resource returned from the cache. - A value that is set to the maximum staleness value specified when this instance was created. If no date was specified, this property's value is . - - - Gets the minimum freshness that is permitted for a resource returned from the cache. - A value that specifies the minimum freshness specified when this instance was created. If no date was specified, this property's value is . - - - Returns a string representation of this instance. - A value that contains the property values for this instance. - - - Specifies caching behavior for resources obtained using and its derived classes. - - - Satisfies a request by using the server. No entries are taken from caches, added to caches, or removed from caches between the client and server. This is the default cache behavior specified in the machine configuration file that ships with the .NET Framework. - - - - Satisfies a request for a resource from the cache, if the resource is available; otherwise, sends a request for a resource to the server. If the requested item is available in any cache between the client and the server, the request might be satisfied by the intermediate cache. - - - - Satisfies a request using the locally cached resource; does not send a request for an item that is not in the cache. When this cache policy level is specified, a exception is thrown if the item is not in the client cache. - - - - Satisfies a request for a resource either by using the cached copy of the resource or by sending a request for the resource to the server. The action taken is determined by the current cache policy and the age of the content in the cache. This is the cache level that should be used by most applications. - - - - Never satisfies a request by using resources from the cache and does not cache resources. If the resource is present in the local cache, it is removed. This policy level indicates to intermediate caches that they should remove the resource. In the HTTP caching protocol, this is achieved using the no-cache cache control directive. - - - - Satisfies a request by using the server. The response might be saved in the cache. In the HTTP caching protocol, this is achieved using the no-cache cache control directive and the no-cache Pragma header. - - - - Satisfies a request by using the cached copy of the resource if the timestamp is the same as the timestamp of the resource on the server; otherwise, the resource is downloaded from the server, presented to the caller, and stored in the cache. - - - - Defines an application's caching requirements for resources obtained by using objects. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. using the specified cache policy. - A that specifies the cache behavior for resources obtained using objects. - level is not a valid .value. - - - Gets the value specified when this instance was constructed. - A value that specifies the cache behavior for resources obtained using objects. - - - Returns a string representation of this instance. - A containing the for this instance. - - - Provides a set of properties and methods that are used to manage cookies. This class cannot be inherited. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with a specified and . - The name of a . The following characters must not be used inside name: equal sign, semicolon, comma, newline (\n), return (\r), tab (\t), and space character. The dollar sign character ("$") cannot be the first character. - The value of a . The following characters must not be used inside value: semicolon, comma. - The name parameter is null. -or- The name parameter is of zero length. -or- The name parameter contains an invalid character. -or- The value parameter is null . -or - The value parameter contains a string not enclosed in quotes that contains an invalid character. - - - Initializes a new instance of the class with a specified , , and . - The name of a . The following characters must not be used inside name: equal sign, semicolon, comma, newline (\n), return (\r), tab (\t), and space character. The dollar sign character ("$") cannot be the first character. - The value of a . The following characters must not be used inside value: semicolon, comma. - The subset of URIs on the origin server to which this applies. The default value is "/". - The name parameter is null. -or- The name parameter is of zero length. -or- The name parameter contains an invalid character. -or- The value parameter is null . -or - The value parameter contains a string not enclosed in quotes that contains an invalid character. - - - Initializes a new instance of the class with a specified , , , and . - The name of a . The following characters must not be used inside name: equal sign, semicolon, comma, newline (\n), return (\r), tab (\t), and space character. The dollar sign character ("$") cannot be the first character. - The value of a object. The following characters must not be used inside value: semicolon, comma. - The subset of URIs on the origin server to which this applies. The default value is "/". - The optional internet domain for which this is valid. The default value is the host this has been received from. - The name parameter is null. -or- The name parameter is of zero length. -or- The name parameter contains an invalid character. -or- The value parameter is null . -or - The value parameter contains a string not enclosed in quotes that contains an invalid character. - - - Gets or sets a comment that the server can add to a . - An optional comment to document intended usage for this . - - - Gets or sets a URI comment that the server can provide with a . - An optional comment that represents the intended usage of the URI reference for this . The value must conform to URI format. - - - Gets or sets the discard flag set by the server. - true if the client is to discard the at the end of the current session; otherwise, false. The default is false. - - - Gets or sets the URI for which the is valid. - The URI for which the is valid. - - - Overrides the method. - A reference to a . - Returns true if the is equal to comparand. Two instances are equal if their , , , , and properties are equal. and string comparisons are case-insensitive. - - - Gets or sets the current state of the . - true if the has expired; otherwise, false. The default is false. - - - Gets or sets the expiration date and time for the as a . - The expiration date and time for the as a instance. - - - Overrides the method. - The 32-bit signed integer hash code for this instance. - - - Determines whether a page script or other active content can access this cookie. - Boolean value that determines whether a page script or other active content can access this cookie. - - - Gets or sets the name for the . - The name for the . - The value specified for a set operation is null or the empty string - or - The value specified for a set operation contained an illegal character. The following characters must not be used inside the property: equal sign, semicolon, comma, newline (\n), return (\r), tab (\t), and space character. The dollar sign character ("$") cannot be the first character. - - - Gets or sets the URIs to which the applies. - The URIs to which the applies. - - - Gets or sets a list of TCP ports that the applies to. - The list of TCP ports that the applies to. - The value specified for a set operation could not be parsed or is not enclosed in double quotes. - - - Gets or sets the security level of a . - true if the client is only to return the cookie in subsequent requests if those requests use Secure Hypertext Transfer Protocol (HTTPS); otherwise, false. The default is false. - - - Gets the time when the cookie was issued as a . - The time when the cookie was issued as a . - - - Overrides the method. - Returns a string representation of this object that is suitable for including in a HTTP Cookie: request header. - - - Gets or sets the for the . - The for the . - - - Gets or sets the version of HTTP state maintenance to which the cookie conforms. - The version of HTTP state maintenance to which the cookie conforms. - The value specified for a version is not allowed. - - - Provides a collection container for instances of the class. - - - Initializes a new instance of the class. - - - Adds a to a . - The to be added to a . - cookie is null. - - - Adds the contents of a to the current instance. - The to be added. - cookies is null. - - - Copies the elements of a to an instance of the class, starting at a particular index. - The target to which the will be copied. - The zero-based index in the target where copying begins. - array is null. - index is less than zero. - array is multidimensional. -or- The number of elements in this is greater than the available space from index to the end of the destination array. - The elements in this cannot be cast automatically to the type of the destination array. - - - Copies the elements of this to a array starting at the specified index of the target array. - The target array to which the will be copied. - The zero-based index in the target where copying begins. - array is null. - index is less than zero. - array is multidimensional. -or- The number of elements in this is greater than the available space from index to the end of the destination array. - The elements in this cannot be cast automatically to the type of the destination array. - - - Gets the number of cookies contained in a . - The number of cookies contained in a . - - - Gets an enumerator that can iterate through a . - An instance of an implementation of an interface that can iterate through a . - - - Gets a value that indicates whether a is read-only. - true if this is a read-only ; otherwise, false. The default is true. - - - Gets a value that indicates whether access to a is thread safe. - true if access to the is thread safe; otherwise, false. The default is false. - - - Gets the with a specific index from a . - The zero-based index of the to be found. - A with a specific index from a . - index is less than 0 or index is greater than or equal to . - - - Gets the with a specific name from a . - The name of the to be found. - The with a specific name from a . - name is null. - - - Gets an object to synchronize access to the . - An object to synchronize access to the . - - - Provides a container for a collection of objects. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with a specified value for the number of instances that the container can hold. - The number of instances that the can hold. - capacity is less than or equal to zero. - - - Initializes a new instance of the class with specific properties. - The number of instances that the can hold. - The number of instances per domain. - The maximum size in bytes for any single in a . - perDomainCapacity is not equal to . and (perDomainCapacity is less than or equal to zero or perDomainCapacity is greater than capacity). - maxCookieSize is less than or equal to zero. - - - Adds a to a . This method uses the domain from the to determine which domain collection to associate the with. - The to be added to the . - cookie is null. - The domain for cookie is null or the empty string (""). - cookie is larger than maxCookieSize. -or- the domain for cookie is not a valid URI. - - - Adds the contents of a to the . - The to be added to the . - cookies is null. - - - Adds a to the for a particular URI. - The URI of the to be added to the . - The to be added to the . - uri is null or cookie is null. - cookie is larger than maxCookieSize. -or- The domain for cookie is not a valid URI. - - - Adds the contents of a to the for a particular URI. - The URI of the to be added to the . - The to be added to the . - cookies is null. - The domain for one of the cookies in cookies is null. - One of the cookies in cookies contains an invalid domain. - - - Gets and sets the number of instances that a can hold. - The number of instances that a can hold. This is a hard limit and cannot be exceeded by adding a . - Capacity is less than or equal to zero or (value is less than and is not equal to ). - - - Gets the number of instances that a currently holds. - The number of instances that a currently holds. This is the total of instances in all domains. - - - Represents the default maximum size, in bytes, of the instances that the can hold. This field is constant. - - - - Represents the default maximum number of instances that the can hold. This field is constant. - - - - Represents the default maximum number of instances that the can reference per domain. This field is constant. - - - - Gets the HTTP cookie header that contains the HTTP cookies that represent the instances that are associated with a specific URI. - The URI of the instances desired. - An HTTP cookie header, with strings representing instances delimited by semicolons. - uri is null. - - - Gets a that contains the instances that are associated with a specific URI. - The URI of the instances desired. - A that contains the instances that are associated with a specific URI. - uri is null. - - - Represents the maximum allowed length of a . - The maximum allowed length, in bytes, of a . - MaxCookieSize is less than or equal to zero. - - - Gets and sets the number of instances that a can hold per domain. - The number of instances that are allowed per domain. - PerDomainCapacity is less than or equal to zero. -or- (PerDomainCapacity is greater than the maximum allowable number of cookies instances, 300, and is not equal to ). - - - Adds instances for one or more cookies from an HTTP cookie header to the for a specific URI. - The URI of the . - The contents of an HTTP set-cookie header as returned by a HTTP server, with instances delimited by commas. - cookieHeader is null. - One of the cookies is invalid. -or- An error occurred while adding one of the cookies to the container. - - - The exception that is thrown when an error is made adding a to a . - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with specific values of serializationInfo and streamingContext. - The to be used. - The to be used. - - - Populates a instance with the data needed to serialize the . - The object that holds the serialized object data. The to populate with data. - The contextual information about the source or destination. A that specifies the destination for this serialization. - - - Populates a instance with the data needed to serialize the . - The to be used. - The to be used. - - - Provides storage for multiple credentials. - - - Creates a new instance of the class. - - - Adds a instance to the credential cache for use with protocols other than SMTP and associates it with a Uniform Resource Identifier (URI) prefix and authentication protocol. - A that specifies the URI prefix of the resources that the credential grants access to. - The authentication scheme used by the resource named in uriPrefix. - The to add to the credential cache. - uriPrefix is null. -or- authType is null. - The same credentials are added more than once. - - - Adds a instance for use with SMTP to the credential cache and associates it with a host computer, port, and authentication protocol. Credentials added using this method are valid for SMTP only. This method does not work for HTTP or FTP requests. - A that identifies the host computer. - A that specifies the port to connect to on host. - A that identifies the authentication scheme used when connecting to host using cred. - The to add to the credential cache. - host is null. -or- authType is null. - authType not an accepted value. - port is less than zero. - - - Gets the system credentials of the application. - An that represents the system credentials of the application. - - - Gets the network credentials of the current security context. - An that represents the network credentials of the current user or application. - - - Returns the instance associated with the specified Uniform Resource Identifier (URI) and authentication type. - A that specifies the URI prefix of the resources that the credential grants access to. - The authentication scheme used by the resource named in uriPrefix. - A or, if there is no matching credential in the cache, null. - uriPrefix or authType is null. - - - Returns the instance associated with the specified host, port, and authentication protocol. - A that identifies the host computer. - A that specifies the port to connect to on host. - A that identifies the authentication scheme used when connecting to host. - A or, if there is no matching credential in the cache, null. - host is null. -or- authType is null. - authType not an accepted value. -or- host is equal to the empty string (""). - port is less than zero. - - - Returns an enumerator that can iterate through the instance. - An for the . - - - Deletes a instance from the cache if it is associated with the specified Uniform Resource Identifier (URI) prefix and authentication protocol. - A that specifies the URI prefix of the resources that the credential is used for. - The authentication scheme used by the host named in uriPrefix. - - - Deletes a instance from the cache if it is associated with the specified host, port, and authentication protocol. - A that identifies the host computer. - A that specifies the port to connect to on host. - A that identifies the authentication scheme used when connecting to host. - - - Represents the file compression and decompression encoding format to be used to compress the data received in response to an . - - - Use the deflate compression-decompression algorithm. - - - - Use the gZip compression-decompression algorithm. - - - - Do not use compression. - - - - Provides simple domain name resolution functionality. - - - Asynchronously returns the Internet Protocol (IP) addresses for the specified host. - The host name or IP address to resolve. - An delegate that references the method to invoke when the operation is complete. - A user-defined object that contains information about the operation. This object is passed to the requestCallback delegate when the operation is complete. - An instance that references the asynchronous request. - hostNameOrAddress is null. - The length of hostNameOrAddress is greater than 255 characters. - An error is encountered when resolving hostNameOrAddress. - hostNameOrAddress is an invalid IP address. - - - Begins an asynchronous request for information about the specified DNS host name. - The DNS name of the host. - An delegate that references the method to invoke when the operation is complete. - A user-defined object that contains information about the operation. This object is passed to the requestCallback delegate when the operation is complete. - An instance that references the asynchronous request. - hostName is null. - An error was encountered executing the DNS query. - - - Asynchronously resolves an IP address to an instance. - The IP address to resolve. - An delegate that references the method to invoke when the operation is complete. - A user-defined object that contains information about the operation. This object is passed to the requestCallback delegate when the operation is complete. - An instance that references the asynchronous request. - address is null. - An error is encountered when resolving address. - address is an invalid IP address. - - - Asynchronously resolves a host name or IP address to an instance. - The host name or IP address to resolve. - An delegate that references the method to invoke when the operation is complete. - A user-defined object that contains information about the operation. This object is passed to the requestCallback delegate when the operation is complete. - An instance that references the asynchronous request. - hostNameOrAddress is null. - The length of hostNameOrAddress is greater than 255 characters. - An error is encountered when resolving hostNameOrAddress. - hostNameOrAddress is an invalid IP address. - - - Begins an asynchronous request to resolve a DNS host name or IP address to an instance. - The DNS name of the host. - An delegate that references the method to invoke when the operation is complete. - A user-defined object that contains information about the operation. This object is passed to the requestCallback delegate when the operation is complete. - An instance that references the asynchronous request. - hostName is null. - The caller does not have permission to access DNS information. - - - Ends an asynchronous request for DNS information. - An instance returned by a call to the method. - An array of type that holds the IP addresses for the host specified by the hostNameOrAddress parameter of . - - - Ends an asynchronous request for DNS information. - An instance that is returned by a call to the method. - An object that contains DNS information about a host. - asyncResult is null. - - - Ends an asynchronous request for DNS information. - An instance returned by a call to an method. - An instance that contains address information about the host. - asyncResult is null. - - - Ends an asynchronous request for DNS information. - An instance that is returned by a call to the method. - An object that contains DNS information about a host. - asyncResult is null. - - - Returns the Internet Protocol (IP) addresses for the specified host. - The host name or IP address to resolve. - An array of type that holds the IP addresses for the host that is specified by the hostNameOrAddress parameter. - hostNameOrAddress is null. - The length of hostNameOrAddress is greater than 255 characters. - An error is encountered when resolving hostNameOrAddress. - hostNameOrAddress is an invalid IP address. - - - Returns the Internet Protocol (IP) addresses for the specified host as an asynchronous operation. - The host name or IP address to resolve. - Returns . The task object representing the asynchronous operation. The property on the task object returns an array of type that holds the IP addresses for the host that is specified by the hostNameOrAddress parameter. - hostNameOrAddress is null. - The length of hostNameOrAddress is greater than 255 characters. - An error is encountered when resolving hostNameOrAddress. - hostNameOrAddress is an invalid IP address. - - - Creates an instance from the specified . - An . - An . An instance. - address is null. - An error is encountered when resolving address. - - - Creates an instance from an IP address. - An IP address. - An instance. - address is null. - An error is encountered when resolving address. - address is not a valid IP address. - - - Gets the DNS information for the specified DNS host name. - The DNS name of the host. - An object that contains host information for the address specified in hostName. - hostName is null. - The length of hostName is greater than 255 characters. - An error is encountered when resolving hostName. - - - Resolves an IP address to an instance. - An IP address. - An instance that contains address information about the host specified in address. - address is null. - An error is encountered when resolving address. - address is an invalid IP address. - - - Resolves a host name or IP address to an instance. - The host name or IP address to resolve. - An instance that contains address information about the host specified in hostNameOrAddress. - The hostNameOrAddress parameter is null. - The length of hostNameOrAddress parameter is greater than 255 characters. - An error was encountered when resolving the hostNameOrAddress parameter. - The hostNameOrAddress parameter is an invalid IP address. - - - Resolves an IP address to an instance as an asynchronous operation. - An IP address. - Returns . The task object representing the asynchronous operation. The property on the task object returns an instance that contains address information about the host specified in address. - address is null. - An error is encountered when resolving address. - address is an invalid IP address. - - - Resolves a host name or IP address to an instance as an asynchronous operation. - The host name or IP address to resolve. - Returns . The task object representing the asynchronous operation. The property on the task object returns an instance that contains address information about the host specified in hostNameOrAddress. - The hostNameOrAddress parameter is null. - The length of hostNameOrAddress parameter is greater than 255 characters. - An error was encountered when resolving the hostNameOrAddress parameter. - The hostNameOrAddress parameter is an invalid IP address. - - - Gets the host name of the local computer. - A string that contains the DNS host name of the local computer. - An error is encountered when resolving the local host name. - - - Resolves a DNS host name or IP address to an instance. - A DNS-style host name or IP address. - An instance that contains address information about the host specified in hostName. - hostName is null. - The length of hostName is greater than 255 characters. - An error is encountered when resolving hostName. - - - Represents a network endpoint as a host name or a string representation of an IP address and a port number. - - - Initializes a new instance of the class with the host name or string representation of an IP address and a port number. - The host name or a string representation of the IP address. - The port number associated with the address, or 0 to specify any available port. port is in host order. - The host parameter contains an empty string. - The host parameter is a null. - port is less than . -or- port is greater than . - - - Initializes a new instance of the class with the host name or string representation of an IP address, a port number, and an address family. - The host name or a string representation of the IP address. - The port number associated with the address, or 0 to specify any available port. port is in host order. - One of the values. - The host parameter contains an empty string. -or- addressFamily is . - The host parameter is a null. - port is less than . -or- port is greater than . - - - Gets the Internet Protocol (IP) address family. - One of the values. - - - Compares two objects. - A instance to compare to the current instance. - true if the two instances are equal; otherwise, false. - - - Returns a hash value for a . - An integer hash value for the . - - - Gets the host name or string representation of the Internet Protocol (IP) address of the host. - A host name or string representation of an IP address. - - - Gets the port number of the . - An integer value in the range 0 to 0xffff indicating the port number of the . - - - Returns the host name or string representation of the IP address and port number of the . - A string containing the address family, host name or IP address string, and the port number of the specified . - - - Provides data for the event. - - - Gets the data that is downloaded by a method. - A array that contains the downloaded data. - - - Represents the method that will handle the event of a . - The source of the event. - A containing event data. - - - Provides data for the event of a . - - - Gets the number of bytes received. - An value that indicates the number of bytes received. - - - Gets the total number of bytes in a data download operation. - An value that indicates the number of bytes that will be received. - - - Represents the method that will handle the event of a . - The source of the event. - A containing event data. - - - Provides data for the event. - - - Gets the data that is downloaded by a method. - A that contains the downloaded data. - - - Represents the method that will handle the event of a . - The source of the event. - A that contains event data. - - - Identifies a network address. This is an abstract class. - - - Initializes a new instance of the class. - - - Gets the address family to which the endpoint belongs. - One of the values. - Any attempt is made to get or set the property when the property is not overridden in a descendant class. - - - Creates an instance from a instance. - The socket address that serves as the endpoint for a connection. - A new instance that is initialized from the specified instance. - Any attempt is made to access the method when the method is not overridden in a descendant class. - - - Serializes endpoint information into a instance. - A instance that contains the endpoint information. - Any attempt is made to access the method when the method is not overridden in a descendant class. - - - Provides a file system implementation of the class. - - - Initializes a new instance of the class from the specified instances of the and classes. - A object that contains the information that is required to serialize the new object. - A object that contains the source of the serialized stream that is associated with the new object. - - - Cancels a request to an Internet resource. - - - Begins an asynchronous request for a object to use to write data. - The delegate. - An object that contains state information for this request. - An that references the asynchronous request. - The property is GET and the application writes to the stream. - The stream is being used by a previous call to . - No write stream is available. - The was aborted. - - - Begins an asynchronous request for a file system resource. - The delegate. - An object that contains state information for this request. - An that references the asynchronous request. - The stream is already in use by a previous call to . - The was aborted. - - - Gets or sets the name of the connection group for the request. This property is reserved for future use. - The name of the connection group for the request. - - - Gets or sets the content length of the data being sent. - The number of bytes of request data being sent. - is less than 0. - - - Gets or sets the content type of the data being sent. This property is reserved for future use. - The content type of the data being sent. - - - Gets or sets the credentials that are associated with this request. This property is reserved for future use. - An that contains the authentication credentials that are associated with this request. The default is null. - - - Ends an asynchronous request for a instance that the application uses to write data. - An that references the pending request for a stream. - A object that the application uses to write data. - asyncResult is null. - - - Ends an asynchronous request for a file system resource. - An that references the pending request for a response. - A that contains the response from the file system resource. - asyncResult is null. - - - Populates a with the data needed to serialize the target object. - The to populate with data. - A that specifies the destination for this serialization. - - - Returns a object for writing data to the file system resource. - A for writing data to the file system resource. - The request times out. - - - Returns a response to a file system request. - A that contains the response from the file system resource. - The request timed out. - - - Gets a collection of the name/value pairs that are associated with the request. This property is reserved for future use. - A that contains header name/value pairs associated with this request. - - - Gets or sets the protocol method used for the request. This property is reserved for future use. - The protocol method to use in this request. - The method is invalid. - or - The method is not supported. - or - Multiple methods were specified. - - - Gets or sets a value that indicates whether to preauthenticate a request. This property is reserved for future use. - true to preauthenticate; otherwise, false. - - - Gets or sets the network proxy to use for this request. This property is reserved for future use. - An that indicates the network proxy to use for this request. - - - Gets the Uniform Resource Identifier (URI) of the request. - A that contains the URI of the request. - - - Gets or sets the length of time until the request times out. - The time, in milliseconds, until the request times out, or the value to indicate that the request does not time out. - The value specified is less than or equal to zero and is not . - - - Always throws a . - Always throws a . - Default credentials are not supported for file Uniform Resource Identifiers (URIs). - - - Populates a object with the required data to serialize the . - A that holds the serialized data for the . - A that contains the destination of the serialized stream that is associated with the new . - - - Provides methods for encoding and decoding URLs when processing Web requests. - - - Converts a string that has been HTML-encoded for HTTP transmission into a decoded string. - The string to decode. - A decoded string. - - - Converts a string that has been HTML-encoded into a decoded string, and sends the decoded string to a output stream. - The string to decode. - A stream of output. - The output parameter cannot be null if the value parameter is not null. - - - Converts a string to an HTML-encoded string. - The string to encode. - An encoded string. - - - Converts a string into an HTML-encoded string, and returns the output as a stream of output. - The string to encode. - A output stream. - The output parameter cannot be null if the value parameter is not null. - - - Converts a string that has been encoded for transmission in a URL into a decoded string. - A URL-encoded string to decode. - Returns . A decoded string. - - - Converts an encoded byte array that has been encoded for transmission in a URL into a decoded byte array. - A URL-encoded array to decode. - The offset, in bytes, from the start of the array to decode. - The count, in bytes, to decode from the array. - Returns . A decoded array. - - - Converts a text string into a URL-encoded string. - The text to URL-encode. - Returns . A URL-encoded string. - - - Converts a byte array into a URL-encoded byte array. - The array to URL-encode. - The offset, in bytes, from the start of the array to encode. - The count, in bytes, to encode from the array. - Returns . An encoded array. - - - A parser based on the NetPipe scheme for the "Indigo" system. - - - Create a parser based on the NetPipe scheme for the "Indigo" system. - - - A parser based on the NetTcp scheme for the "Indigo" system. - - - Create a parser based on the NetTcp scheme for the "Indigo" system. - - - A customizable parser based on the news scheme using the Network News Transfer Protocol (NNTP). - - - Create a customizable parser based on the news scheme using the Network News Transfer Protocol (NNTP). - - - Indicates that a field of a serializable class should not be serialized. This class cannot be inherited. - - - Initializes a new instance of the class. - - - The exception that is thrown when a floating-point value is positive infinity, negative infinity, or Not-a-Number (NaN). - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with the invalid number. - The value of the argument that caused the exception. - - - Initializes a new instance of the class with a specified error message. - The message that describes the error. - - - Initializes a new instance of the class with serialized data. - The object that holds the serialized object data. - The contextual information about the source or destination. - - - Initializes a new instance of the class with a specified error message and the invalid number. - The message that describes the error. - The value of the argument that caused the exception. - - - Initializes a new instance of the class with a specified error message and a reference to the inner exception that is root cause of this exception. - The error message that explains the reason for the exception. - The exception that is the cause of the current exception. If the innerException parameter is not a null reference (Nothing in Visual Basic), the current exception is raised in a catch block that handles the inner exception. - - - Initializes a new instance of the class with a specified error message, the invalid number, and a reference to the inner exception that is root cause of this exception. - The error message that explains the reason for the exception. - The value of the argument that caused the exception. - The exception that is the cause of the current exception. If the innerException parameter is not a null reference (Nothing in Visual Basic), the current exception is raised in a catch block that handles the inner exception. - - - Sets the object with the invalid number and additional exception information. - The object that holds the serialized object data. - The contextual information about the source or destination. - The info object is null. - - - Gets the invalid number that is a positive infinity, a negative infinity, or Not-a-Number (NaN). - The invalid number. - - - The exception that is thrown when a requested method or operation is not implemented. - - - Initializes a new instance of the class with default properties. - - - Initializes a new instance of the class with a specified error message. - The error message that explains the reason for the exception. - - - Initializes a new instance of the class with serialized data. - The that holds the serialized object data about the exception being thrown. - The that contains contextual information about the source or destination. - - - Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. - The error message that explains the reason for the exception. - The exception that is the cause of the current exception. If the inner parameter is not null, the current exception is raised in a catch block that handles the inner exception. - - - The exception that is thrown when an invoked method is not supported, or when there is an attempt to read, seek, or write to a stream that does not support the invoked functionality. - - - Initializes a new instance of the class, setting the property of the new instance to a system-supplied message that describes the error. This message takes into account the current system culture. - - - Initializes a new instance of the class with a specified error message. - A that describes the error. The content of message is intended to be understood by humans. The caller of this constructor is required to ensure that this string has been localized for the current system culture. - - - Initializes a new instance of the class with serialized data. - The object that holds the serialized object data. - The contextual information about the source or destination. - - - Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. - The error message that explains the reason for the exception. - The exception that is the cause of the current exception. If the innerException parameter is not a null reference, the current exception is raised in a catch block that handles the inner exception. - - - Represents a value type that can be assigned null. - The underlying value type of the generic type. - - - Initializes a new instance of the structure to the specified value. - A value type. - - - Indicates whether the current object is equal to a specified object. - An object. -

true if the other parameter is equal to the current object; otherwise, false.

-

This table describes how equality is defined for the compared values:

-
Return Value

-

Description

-

true The property is false, and the other parameter is null. That is, two null values are equal by definition.

-

-or-

-

The property is true, and the value returned by the property is equal to the other parameter.

-

false The property for the current structure is true, and the other parameter is null.

-

-or-

-

The property for the current structure is false, and the other parameter is not null.

-

-or-

-

The property for the current structure is true, and the value returned by the property is not equal to the other parameter.

-

-
-
- - Retrieves the hash code of the object returned by the property. - The hash code of the object returned by the property if the property is true, or zero if the property is false. - - - Retrieves the value of the current object, or the object's default value. - The value of the property if the property is true; otherwise, the default value of the current object. The type of the default value is the type argument of the current object, and the value of the default value consists solely of binary zeroes. - - - Retrieves the value of the current object, or the specified default value. - A value to return if the property is false. - The value of the property if the property is true; otherwise, the defaultValue parameter. - - - Gets a value indicating whether the current object has a valid value of its underlying type. - true if the current object has a value; false if the current object has no value. - - - - - - - - - - - Returns the text representation of the value of the current object. - The text representation of the value of the current object if the property is true, or an empty string ("") if the property is false. - - - Gets the value of the current object if it has been assigned a valid underlying value. - The value of the current object if the property is true. An exception is thrown if the property is false. - The property is false. - - - Supports a value type that can be assigned null. This class cannot be inherited. - - - Compares the relative values of two objects. - A object. - A object. - The underlying value type of the n1 and n2 parameters. -

An integer that indicates the relative values of the n1 and n2 parameters.

-
Return Value

-

Description

-

Less than zero

-

The property for n1 is false, and the property for n2 is true.

-

-or-

-

The properties for n1 and n2 are true, and the value of the property for n1 is less than the value of the property for n2.

-

Zero

-

The properties for n1 and n2 are false.

-

-or-

-

The properties for n1 and n2 are true, and the value of the property for n1 is equal to the value of the property for n2.

-

Greater than zero

-

The property for n1 is true, and the property for n2 is false.

-

-or-

-

The properties for n1 and n2 are true, and the value of the property for n1 is greater than the value of the property for n2.

-

-
-
- - Indicates whether two specified objects are equal. - A object. - A object. - The underlying value type of the n1 and n2 parameters. -

true if the n1 parameter is equal to the n2 parameter; otherwise, false.

-

The return value depends on the and properties of the two parameters that are compared.

-
Return Value

-

Description

-

true The properties for n1 and n2 are false.

-

-or-

-

The properties for n1 and n2 are true, and the properties of the parameters are equal.

-

false The property is true for one parameter and false for the other parameter.

-

-or-

-

The properties for n1 and n2 are true, and the properties of the parameters are unequal.

-

-
-
- - Returns the underlying type argument of the specified nullable type. - A object that describes a closed generic nullable type. - The type argument of the nullableType parameter, if the nullableType parameter is a closed generic nullable type; otherwise, null. - nullableType is null. - - - The exception that is thrown when there is an attempt to dereference a null object reference. - - - Initializes a new instance of the class, setting the property of the new instance to a system-supplied message that describes the error, such as "The value 'null' was found where an instance of an object was required." This message takes into account the current system culture. - - - Initializes a new instance of the class with a specified error message. - A that describes the error. The content of message is intended to be understood by humans. The caller of this constructor is required to ensure that this string has been localized for the current system culture. - - - Initializes a new instance of the class with serialized data. - The object that holds the serialized object data. - The contextual information about the source or destination. - - - Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. - The error message that explains the reason for the exception. - The exception that is the cause of the current exception. If the innerException parameter is not null, the current exception is raised in a catch block that handles the inner exception. - - - Represents an arbitrarily large signed integer. - - - Initializes a new instance of the structure using the values in a byte array. - An array of byte values in little-endian order. - value is null. - - - Initializes a new instance of the structure using a value. - A decimal number. - - - Initializes a new instance of the structure using a double-precision floating-point value. - A double-precision floating-point value. - The value of value is . -or- The value of value is . -or- The value of value is . - - - Initializes a new instance of the structure using a 32-bit signed integer value. - A 32-bit signed integer. - - - Initializes a new instance of the structure using a 64-bit signed integer value. - A 64-bit signed integer. - - - Initializes a new instance of the structure using a single-precision floating-point value. - A single-precision floating-point value. - The value of value is . -or- The value of value is . -or- The value of value is . - - - Initializes a new instance of the structure using an unsigned 32-bit integer value. - An unsigned 32-bit integer value. - - - Initializes a new instance of the structure with an unsigned 64-bit integer value. - An unsigned 64-bit integer. - - - Gets the absolute value of a object. - A number. - The absolute value of value. - - - Adds two values and returns the result. - The first value to add. - The second value to add. - The sum of left and right. - - - Compares two values and returns an integer that indicates whether the first value is less than, equal to, or greater than the second value. - The first value to compare. - The second value to compare. -

A signed integer that indicates the relative values of left and right, as shown in the following table.

-
Value

-

Condition

-

Less than zero

-

left is less than right.

-

Zero

-

left equals right.

-

Greater than zero

-

left is greater than right.

-

-
-
- - Compares this instance to an unsigned 64-bit integer and returns an integer that indicates whether the value of this instance is less than, equal to, or greater than the value of the unsigned 64-bit integer. - The unsigned 64-bit integer to compare. -

A signed integer that indicates the relative value of this instance and other, as shown in the following table.

-
Return value

-

Description

-

Less than zero

-

The current instance is less than other.

-

Zero

-

The current instance equals other.

-

Greater than zero

-

The current instance is greater than other.

-

-
-
- - Compares this instance to a specified object and returns an integer that indicates whether the value of this instance is less than, equal to, or greater than the value of the specified object. - The object to compare. -

A signed integer that indicates the relationship of the current instance to the obj parameter, as shown in the following table.

-
Return value

-

Description

-

Less than zero

-

The current instance is less than obj.

-

Zero

-

The current instance equals obj.

-

Greater than zero

-

The current instance is greater than obj, or the obj parameter is null.

-

-
- obj is not a . -
- - Compares this instance to a second and returns an integer that indicates whether the value of this instance is less than, equal to, or greater than the value of the specified object. - The object to compare. -

A signed integer value that indicates the relationship of this instance to other, as shown in the following table.

-
Return value

-

Description

-

Less than zero

-

The current instance is less than other.

-

Zero

-

The current instance equals other.

-

Greater than zero

-

The current instance is greater than other.

-

-
-
- - Compares this instance to a signed 64-bit integer and returns an integer that indicates whether the value of this instance is less than, equal to, or greater than the value of the signed 64-bit integer. - The signed 64-bit integer to compare. -

A signed integer value that indicates the relationship of this instance to other, as shown in the following table.

-
Return value

-

Description

-

Less than zero

-

The current instance is less than other.

-

Zero

-

The current instance equals other.

-

Greater than zero

-

The current instance is greater than other.

-

-
-
- - Divides one value by another and returns the result. - The value to be divided. - The value to divide by. - The quotient of the division. - divisor is 0 (zero). - - - Divides one value by another, returns the result, and returns the remainder in an output parameter. - The value to be divided. - The value to divide by. - When this method returns, contains a value that represents the remainder from the division. This parameter is passed uninitialized. - The quotient of the division. - divisor is 0 (zero). - - - Returns a value that indicates whether the current instance and a signed 64-bit integer have the same value. - The signed 64-bit integer value to compare. - true if the signed 64-bit integer and the current instance have the same value; otherwise, false. - - - Returns a value that indicates whether the current instance and a specified object have the same value. - The object to compare. - true if this object and other have the same value; otherwise, false. - - - Returns a value that indicates whether the current instance and a specified object have the same value. - The object to compare. - true if the obj argument is a object, and its value is equal to the value of the current instance; otherwise, false. - - - Returns a value that indicates whether the current instance and an unsigned 64-bit integer have the same value. - The unsigned 64-bit integer to compare. - true if the current instance and the unsigned 64-bit integer have the same value; otherwise, false. - - - Returns the hash code for the current object. - A 32-bit signed integer hash code. - - - Finds the greatest common divisor of two values. - The first value. - The second value. - The greatest common divisor of left and right. - - - Indicates whether the value of the current object is an even number. - true if the value of the object is an even number; otherwise, false. - - - Indicates whether the value of the current object is . - true if the value of the object is ; otherwise, false. - - - Indicates whether the value of the current object is a power of two. - true if the value of the object is a power of two; otherwise, false. - - - Indicates whether the value of the current object is . - true if the value of the object is ; otherwise, false. - - - Returns the natural (base e) logarithm of a specified number. - The number whose logarithm is to be found. - The natural (base e) logarithm of value, as shown in the table in the Remarks section. - The natural log of value is out of range of the data type. - - - Returns the logarithm of a specified number in a specified base. - A number whose logarithm is to be found. - The base of the logarithm. - The base baseValue logarithm of value, as shown in the table in the Remarks section. - The log of value is out of range of the data type. - - - Returns the base 10 logarithm of a specified number. - A number whose logarithm is to be found. - The base 10 logarithm of value, as shown in the table in the Remarks section. - The base 10 log of value is out of range of the data type. - - - Returns the larger of two values. - The first value to compare. - The second value to compare. - The left or right parameter, whichever is larger. - - - Returns the smaller of two values. - The first value to compare. - The second value to compare. - The left or right parameter, whichever is smaller. - - - Gets a value that represents the number negative one (-1). - An integer whose value is negative one (-1). - - - Performs modulus division on a number raised to the power of another number. - The number to raise to the exponent power. - The exponent to raise value by. - The number by which to divide value raised to the exponent power. - The remainder after dividing valueexponent by modulus. - modulus is zero. - exponent is negative. - - - Returns the product of two values. - The first number to multiply. - The second number to multiply. - The product of the left and right parameters. - - - Negates a specified value. - The value to negate. - The result of the value parameter multiplied by negative one (-1). - - - Gets a value that represents the number one (1). - An object whose value is one (1). - - - Adds the values of two specified objects. - The first value to add. - The second value to add. - The sum of left and right. - - - Performs a bitwise And operation on two values. - The first value. - The second value. - The result of the bitwise And operation. - - - Performs a bitwise Or operation on two values. - The first value. - The second value. - The result of the bitwise Or operation. - - - Decrements a value by 1. - The value to decrement. - The value of the value parameter decremented by 1. - - - Divides a specified value by another specified value by using integer division. - The value to be divided. - The value to divide by. - The integral result of the division. - divisor is 0 (zero). - - - Returns a value that indicates whether a signed long integer value and a value are equal. - The first value to compare. - The second value to compare. - true if the left and right parameters have the same value; otherwise, false. - - - Returns a value that indicates whether a value and a signed long integer value are equal. - The first value to compare. - The second value to compare. - true if the left and right parameters have the same value; otherwise, false. - - - Returns a value that indicates whether the values of two objects are equal. - The first value to compare. - The second value to compare. - true if the left and right parameters have the same value; otherwise, false. - - - Returns a value that indicates whether a value and an unsigned long integer value are equal. - The first value to compare. - The second value to compare. - true if the left and right parameters have the same value; otherwise, false. - - - Returns a value that indicates whether an unsigned long integer value and a value are equal. - The first value to compare. - The second value to compare. - true if the left and right parameters have the same value; otherwise, false. - - - Performs a bitwise exclusive Or (XOr) operation on two values. - The first value. - The second value. - The result of the bitwise Or operation. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Returns a value that indicates whether a 64-bit signed integer is greater than a value. - The first value to compare. - The second value to compare. - true if left is greater than right; otherwise, false. - - - Returns a value that indicates whether a is greater than a 64-bit signed integer value. - The first value to compare. - The second value to compare. - true if left is greater than right; otherwise, false. - - - Returns a value that indicates whether a value is greater than another value. - The first value to compare. - The second value to compare. - true if left is greater than right; otherwise, false. - - - Returns a value that indicates whether a value is greater than a 64-bit unsigned integer. - The first value to compare. - The second value to compare. - true if left is greater than right; otherwise, false. - - - Returns a value that indicates whether a value is greater than a 64-bit unsigned integer. - The first value to compare. - The second value to compare. - true if left is greater than right; otherwise, false. - - - Returns a value that indicates whether a value is greater than or equal to a 64-bit unsigned integer value. - The first value to compare. - The second value to compare. - true if left is greater than right; otherwise, false. - - - Returns a value that indicates whether a value is greater than or equal to another value. - The first value to compare. - The second value to compare. - true if left is greater than right; otherwise, false. - - - Returns a value that indicates whether a 64-bit unsigned integer is greater than or equal to a value. - The first value to compare. - The second value to compare. - true if left is greater than right; otherwise, false. - - - Returns a value that indicates whether a 64-bit signed integer is greater than or equal to a value. - The first value to compare. - The second value to compare. - true if left is greater than right; otherwise, false. - - - Returns a value that indicates whether a value is greater than or equal to a 64-bit signed integer value. - The first value to compare. - The second value to compare. - true if left is greater than right; otherwise, false. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Increments a value by 1. - The value to increment. - The value of the value parameter incremented by 1. - - - Returns a value that indicates whether a 64-bit signed integer and a value are not equal. - The first value to compare. - The second value to compare. - true if left and right are not equal; otherwise, false. - - - Returns a value that indicates whether a value and a 64-bit signed integer are not equal. - The first value to compare. - The second value to compare. - true if left and right are not equal; otherwise, false. - - - Returns a value that indicates whether two objects have different values. - The first value to compare. - The second value to compare. - true if left and right are not equal; otherwise, false. - - - Returns a value that indicates whether a value and a 64-bit unsigned integer are not equal. - The first value to compare. - The second value to compare. - true if left and right are not equal; otherwise, false. - - - Returns a value that indicates whether a 64-bit unsigned integer and a value are not equal. - The first value to compare. - The second value to compare. - true if left and right are not equal; otherwise, false. - - - Shifts a value a specified number of bits to the left. - The value whose bits are to be shifted. - The number of bits to shift value to the left. - A value that has been shifted to the left by the specified number of bits. - - - Returns a value that indicates whether a 64-bit unsigned integer is less than a value. - The first value to compare. - The second value to compare. - true if left is less than right; otherwise, false. - - - Returns a value that indicates whether a value is less than a 64-bit unsigned integer. - The first value to compare. - The second value to compare. - true if left is less than right; otherwise, false. - - - Returns a value that indicates whether a 64-bit signed integer is less than a value. - The first value to compare. - The second value to compare. - true if left is less than right; otherwise, false. - - - Returns a value that indicates whether a value is less than a 64-bit signed integer. - The first value to compare. - The second value to compare. - true if left is less than right; otherwise, false. - - - Returns a value that indicates whether a value is less than another value. - The first value to compare. - The second value to compare. - true if left is less than right; otherwise, false. - - - Returns a value that indicates whether a 64-bit signed integer is less than or equal to a value. - The first value to compare. - The second value to compare. - true if left is less than or equal to right; otherwise, false. - - - Returns a value that indicates whether a value is less than or equal to a 64-bit signed integer. - The first value to compare. - The second value to compare. - true if left is less than or equal to right; otherwise, false. - - - Returns a value that indicates whether a value is less than or equal to another value. - The first value to compare. - The second value to compare. - true if left is less than or equal to right; otherwise, false. - - - Returns a value that indicates whether a value is less than or equal to a 64-bit unsigned integer. - The first value to compare. - The second value to compare. - true if left is less than or equal to right; otherwise, false. - - - Returns a value that indicates whether a 64-bit unsigned integer is less than or equal to a value. - The first value to compare. - The second value to compare. - true if left is less than or equal to right; otherwise, false. - - - Returns the remainder that results from division with two specified values. - The value to be divided. - The value to divide by. - The remainder that results from the division. - divisor is 0 (zero). - - - Multiplies two specified values. - The first value to multiply. - The second value to multiply. - The product of left and right. - - - Returns the bitwise one's complement of a value. - An integer value. - The bitwise one's complement of value. - - - Shifts a value a specified number of bits to the right. - The value whose bits are to be shifted. - The number of bits to shift value to the right. - A value that has been shifted to the right by the specified number of bits. - - - Subtracts a value from another value. - The value to subtract from (the minuend). - The value to subtract (the subtrahend). - The result of subtracting right from left. - - - Negates a specified BigInteger value. - The value to negate. - The result of the value parameter multiplied by negative one (-1). - - - Returns the value of the operand. (The sign of the operand is unchanged.) - An integer value. - The value of the value operand. - - - Converts the string representation of a number in a specified style and culture-specific format to its equivalent. - A string that contains a number to convert. - A bitwise combination of the enumeration values that specify the permitted format of value. - An object that provides culture-specific formatting information about value. - A value that is equivalent to the number specified in the value parameter. - style is not a value. -or- style includes the or flag along with another value. - value is null. - value does not comply with the input pattern specified by style. - - - Converts the string representation of a number in a specified culture-specific format to its equivalent. - A string that contains a number to convert. - An object that provides culture-specific formatting information about value. - A value that is equivalent to the number specified in the value parameter. - value is null. - value is not in the correct format. - - - Converts the string representation of a number in a specified style to its equivalent. - A string that contains a number to convert. - A bitwise combination of the enumeration values that specify the permitted format of value. - A value that is equivalent to the number specified in the value parameter. - style is not a value. -or- style includes the or flag along with another value. - value is null. - value does not comply with the input pattern specified by . - - - Converts the string representation of a number to its equivalent. - A string that contains the number to convert. - A value that is equivalent to the number specified in the value parameter. - value is null. - value is not in the correct format. - - - Raises a value to the power of a specified value. - The number to raise to the exponent power. - The exponent to raise value by. - The result of raising value to the exponent power. - The value of the exponent parameter is negative. - - - Performs integer division on two values and returns the remainder. - The value to be divided. - The value to divide by. - The remainder after dividing dividend by divisor. - divisor is 0 (zero). - - - Gets a number that indicates the sign (negative, positive, or zero) of the current object. -

A number that indicates the sign of the object, as shown in the following table.

-
Number

-

Description

-

-1

-

The value of this object is negative.

-

0

-

The value of this object is 0 (zero).

-

1

-

The value of this object is positive.

-

-
-
- - Subtracts one value from another and returns the result. - The value to subtract from (the minuend). - The value to subtract (the subtrahend). - The result of subtracting right from left. - - - Converts a value to a byte array. - The value of the current object converted to an array of bytes. - - - Converts the numeric value of the current object to its equivalent string representation. - The string representation of the current value. - - - Converts the numeric value of the current object to its equivalent string representation by using the specified culture-specific formatting information. - An object that supplies culture-specific formatting information. - The string representation of the current value in the format specified by the provider parameter. - - - Converts the numeric value of the current object to its equivalent string representation by using the specified format. - A standard or custom numeric format string. - The string representation of the current value in the format specified by the format parameter. - format is not a valid format string. - - - Converts the numeric value of the current object to its equivalent string representation by using the specified format and culture-specific format information. - A standard or custom numeric format string. - An object that supplies culture-specific formatting information. - The string representation of the current value as specified by the format and provider parameters. - format is not a valid format string. - - - Tries to convert the string representation of a number in a specified style and culture-specific format to its equivalent, and returns a value that indicates whether the conversion succeeded. - The string representation of a number. The string is interpreted using the style specified by style. - A bitwise combination of enumeration values that indicates the style elements that can be present in value. A typical value to specify is . - An object that supplies culture-specific formatting information about value. - When this method returns, contains the equivalent to the number that is contained in value, or if the conversion failed. The conversion fails if the value parameter is null or is not in a format that is compliant with style. This parameter is passed uninitialized. - true if the value parameter was converted successfully; otherwise, false. - style is not a value. -or- style includes the or flag along with another value. - - - Tries to convert the string representation of a number to its equivalent, and returns a value that indicates whether the conversion succeeded. - The string representation of a number. - When this method returns, contains the equivalent to the number that is contained in value, or zero (0) if the conversion fails. The conversion fails if the value parameter is null or is not of the correct format. This parameter is passed uninitialized. - true if value was converted successfully; otherwise, false. - value is null. - - - Gets a value that represents the number 0 (zero). - An integer whose value is 0 (zero). - - - Represents a complex number. - - - Initializes a new instance of the structure using the specified real and imaginary values. - The real part of the complex number. - The imaginary part of the complex number. - - - Gets the absolute value (or magnitude) of a complex number. - A complex number. - The absolute value of value. - - - Returns the angle that is the arc cosine of the specified complex number. - A complex number that represents a cosine. - The angle, measured in radians, which is the arc cosine of value. - - - Adds two complex numbers and returns the result. - The first complex number to add. - The second complex number to add. - The sum of left and right. - - - Returns the angle that is the arc sine of the specified complex number. - A complex number. - The angle which is the arc sine of value. - - - Returns the angle that is the arc tangent of the specified complex number. - A complex number. - The angle that is the arc tangent of value. - - - Computes the conjugate of a complex number and returns the result. - A complex number. - The conjugate of value. - - - Returns the cosine of the specified complex number. - A complex number. - The cosine of value. - - - Returns the hyperbolic cosine of the specified complex number. - A complex number. - The hyperbolic cosine of value. - - - Divides one complex number by another and returns the result. - The complex number to be divided. - The complex number to divide by. - The quotient of the division. - - - Returns a value that indicates whether the current instance and a specified complex number have the same value. - The complex number to compare. - true if this complex number and value have the same value; otherwise, false. - - - Returns a value that indicates whether the current instance and a specified object have the same value. - The object to compare. - true if the obj parameter is a object or a type capable of implicit conversion to a object, and its value is equal to the current object; otherwise, false. - - - Returns e raised to the power specified by a complex number. - A complex number that specifies a power. - The number e raised to the power value. - - - Creates a complex number from a point's polar coordinates. - The magnitude, which is the distance from the origin (the intersection of the x-axis and the y-axis) to the number. - The phase, which is the angle from the line to the horizontal axis, measured in radians. - A complex number. - - - Returns the hash code for the current object. - A 32-bit signed integer hash code. - - - Gets the imaginary component of the current object. - The imaginary component of a complex number. - - - Returns a new instance with a real number equal to zero and an imaginary number equal to one. - - - - Returns the natural (base e) logarithm of a specified complex number. - A complex number. - The natural (base e) logarithm of value. - - - Returns the logarithm of a specified complex number in a specified base. - A complex number. - The base of the logarithm. - The logarithm of value in base baseValue. - - - Returns the base-10 logarithm of a specified complex number. - A complex number. - The base-10 logarithm of value. - - - Gets the magnitude (or absolute value) of a complex number. - The magnitude of the current instance. - - - Returns the product of two complex numbers. - The first complex number to multiply. - The second complex number to multiply. - The product of the left and right parameters. - - - Returns the additive inverse of a specified complex number. - A complex number. - The result of the and components of the value parameter multiplied by -1. - - - Returns a new instance with a real number equal to one and an imaginary number equal to zero. - - - - Adds two complex numbers. - The first value to add. - The second value to add. - The sum of left and right. - - - Divides a specified complex number by another specified complex number. - The value to be divided. - The value to divide by. - The result of dividing left by right. - - - Returns a value that indicates whether two complex numbers are equal. - The first complex number to compare. - The second complex number to compare. - true if the left and right parameters have the same value; otherwise, false. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Returns a value that indicates whether two complex numbers are not equal. - The first value to compare. - The second value to compare. - true if left and right are not equal; otherwise, false. - - - Multiplies two specified complex numbers. - The first value to multiply. - The second value to multiply. - The product of left and right. - - - Subtracts a complex number from another complex number. - The value to subtract from (the minuend). - The value to subtract (the subtrahend). - The result of subtracting right from left. - - - Returns the additive inverse of a specified complex number. - The value to negate. - The result of the and components of the value parameter multiplied by -1. - - - Gets the phase of a complex number. - The phase of a complex number, in radians. - - - Returns a specified complex number raised to a power specified by a double-precision floating-point number. - A complex number to be raised to a power. - A double-precision floating-point number that specifies a power. - The complex number value raised to the power power. - - - Returns a specified complex number raised to a power specified by a complex number. - A complex number to be raised to a power. - A complex number that specifies a power. - The complex number value raised to the power power. - - - Gets the real component of the current object. - The real component of a complex number. - - - Returns the multiplicative inverse of a complex number. - A complex number. - The reciprocal of value. - - - Returns the sine of the specified complex number. - A complex number. - The sine of value. - - - Returns the hyperbolic sine of the specified complex number. - A complex number. - The hyperbolic sine of value. - - - Returns the square root of a specified complex number. - A complex number. - The square root of value. - - - Subtracts one complex number from another and returns the result. - The value to subtract from (the minuend). - The value to subtract (the subtrahend). - The result of subtracting right from left. - - - Returns the tangent of the specified complex number. - A complex number. - The tangent of value. - - - Returns the hyperbolic tangent of the specified complex number. - A complex number. - The hyperbolic tangent of value. - - - Converts the value of the current complex number to its equivalent string representation in Cartesian form. - The string representation of the current instance in Cartesian form. - - - Converts the value of the current complex number to its equivalent string representation in Cartesian form by using the specified culture-specific formatting information. - An object that supplies culture-specific formatting information. - The string representation of the current instance in Cartesian form, as specified by provider. - - - Converts the value of the current complex number to its equivalent string representation in Cartesian form by using the specified format for its real and imaginary parts. - A standard or custom numeric format string. - The string representation of the current instance in Cartesian form. - format is not a valid format string. - - - Converts the value of the current complex number to its equivalent string representation in Cartesian form by using the specified format and culture-specific format information for its real and imaginary parts. - A standard or custom numeric format string. - An object that supplies culture-specific formatting information. - The string representation of the current instance in Cartesian form, as specified by format and provider. - format is not a valid format string. - - - Returns a new instance with a real number equal to zero and an imaginary number equal to zero. - - - - Supports all classes in the .NET Framework class hierarchy and provides low-level services to derived classes. This is the ultimate base class of all classes in the .NET Framework; it is the root of the type hierarchy. - - - Initializes a new instance of the class. - - - Determines whether the specified object is equal to the current object. - The object to compare with the current object. - true if the specified object is equal to the current object; otherwise, false. - - - Determines whether the specified object instances are considered equal. - The first object to compare. - The second object to compare. - true if the objects are considered equal; otherwise, false. If both objA and objB are null, the method returns true. - - - Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. - - - Serves as the default hash function. - A hash code for the current object. - - - Gets the of the current instance. - The exact runtime type of the current instance. - - - Creates a shallow copy of the current . - A shallow copy of the current . - - - Determines whether the specified instances are the same instance. - The first object to compare. - The second object to compare. - true if objA is the same instance as objB or if both are null; otherwise, false. - - - Returns a string that represents the current object. - A string that represents the current object. - - - The exception that is thrown when an operation is performed on a disposed object. - - - Initializes a new instance of the class with a string containing the name of the disposed object. - A string containing the name of the disposed object. - - - Initializes a new instance of the class with serialized data. - The that holds the serialized object data about the exception being thrown. - The that contains contextual information about the source or destination. - - - Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. - The error message that explains the reason for the exception. - The exception that is the cause of the current exception. If innerException is not null, the current exception is raised in a catch block that handles the inner exception. - - - Initializes a new instance of the class with the specified object name and message. - The name of the disposed object. - The error message that explains the reason for the exception. - - - Retrieves the object with the parameter name and additional exception information. - The that holds the serialized object data about the exception being thrown. - The that contains contextual information about the source or destination. - - - Gets the message that describes the error. - A string that describes the error. - - - Gets the name of the disposed object. - A string containing the name of the disposed object. - - - Marks the program elements that are no longer in use. This class cannot be inherited. - - - Initializes a new instance of the class with default properties. - - - Initializes a new instance of the class with a specified workaround message. - The text string that describes alternative workarounds. - - - Initializes a new instance of the class with a workaround message and a Boolean value indicating whether the obsolete element usage is considered an error. - The text string that describes alternative workarounds. - true if the obsolete element usage generates a compiler error; false if it generates a compiler warning. - - - Gets a Boolean value indicating whether the compiler will treat usage of the obsolete program element as an error. - true if the obsolete element usage is considered an error; otherwise, false. The default is false. - - - Gets the workaround message, including a description of the alternative program elements. - The workaround text string. - - - Represents information about an operating system, such as the version and platform identifier. This class cannot be inherited. - - - Initializes a new instance of the class, using the specified platform identifier value and version object. - One of the values that indicates the operating system platform. - A object that indicates the version of the operating system. - version is null. - platform is not a enumeration value. - - - Creates an object that is identical to this instance. - An object that is a copy of this instance. - - - Populates a object with the data necessary to deserialize this instance. - The object to populate with serialization information. - The place to store and retrieve serialized data. Reserved for future use. - info is null. - - - Gets a enumeration value that identifies the operating system platform. - One of the values. - - - Gets the service pack version represented by this object. - The service pack version, if service packs are supported and at least one is installed; otherwise, an empty string (""). - - - Converts the value of this object to its equivalent string representation. - The string representation of the values returned by the , , and properties. - - - Gets a object that identifies the operating system. - A object that describes the major version, minor version, build, and revision numbers for the operating system. - - - Gets the concatenated string representation of the platform identifier, version, and service pack that are currently installed on the operating system. - The string representation of the values returned by the , , and properties. - - - The exception that is thrown in a thread upon cancellation of an operation that the thread was executing. - - - Initializes a new instance of the class with a system-supplied error message. - - - Initializes a new instance of the class with a specified error message. - A that describes the error. - - - Initializes a new instance of the class with a cancellation token. - A cancellation token associated with the operation that was canceled. - - - Initializes a new instance of the class with serialized data. - The object that holds the serialized object data. - The contextual information about the source or destination. - - - Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. - The error message that explains the reason for the exception. - The exception that is the cause of the current exception. If the innerException parameter is not null, the current exception is raised in a catch block that handles the inner exception. - - - Initializes a new instance of the class with a specified error message and a cancellation token. - The error message that explains the reason for the exception. - A cancellation token associated with the operation that was canceled. - - - Initializes a new instance of the class with a specified error message, a reference to the inner exception that is the cause of this exception, and a cancellation token. - The error message that explains the reason for the exception. - The exception that is the cause of the current exception. If the innerException parameter is not null, the current exception is raised in a catch block that handles the inner exception. - A cancellation token associated with the operation that was canceled. - - - Gets a token associated with the operation that was canceled. - A token associated with the operation that was canceled, or a default token. - - - The exception that is thrown when there is not enough memory to continue the execution of a program. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with a specified error message. - The message that describes the error. - - - Initializes a new instance of the class with serialized data. - The object that holds the serialized object data. - The contextual information about the source or destination. - - - Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. - The error message that explains the reason for the exception. - The exception that is the cause of the current exception. If the innerException parameter is not a null reference (Nothing in Visual Basic), the current exception is raised in a catch block that handles the inner exception. - - - The exception that is thrown when an arithmetic, casting, or conversion operation in a checked context results in an overflow. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with a specified error message. - The message that describes the error. - - - Initializes a new instance of the class with serialized data. - The object that holds the serialized object data. - The contextual information about the source or destination. - - - Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. - The error message that explains the reason for the exception. - The exception that is the cause of the current exception. If the innerException parameter is not a null reference (Nothing in Visual Basic), the current exception is raised in a catch block that handles the inner exception. - - - Indicates that a method will allow a variable number of arguments in its invocation. This class cannot be inherited. - - - Initializes a new instance of the class with default properties. - - - Identifies the operating system, or platform, supported by an assembly. - - - The operating system is Macintosh. - - - - The operating system is Unix. - - - - The operating system is Windows NT or later. - - - - The operating system is Win32s. Win32s is a layer that runs on 16-bit versions of Windows to provide access to 32-bit applications. - - - - The operating system is Windows 95 or Windows 98. - - - - The operating system is Windows CE. - - - - The development platform is Xbox 360. - - - - The exception that is thrown when a feature does not run on a particular platform. - - - Initializes a new instance of the class with default properties. - - - Initializes a new instance of the class with a specified error message. - The text message that explains the reason for the exception. - - - Initializes a new instance of the class with serialized data. - The that holds the serialized object data about the exception being thrown. - The that contains contextual information about the source or destination. - - - Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. - The error message that explains the reason for the exception. - The exception that is the cause of the current exception. If the inner parameter is not null, the current exception is raised in a catch block that handles the inner exception. - - - Represents the method that defines a set of criteria and determines whether the specified object meets those criteria. - The object to compare against the criteria defined within the method represented by this delegate. - The type of the object to compare. - - - - Specifies that types that are ordinarily visible only within the current assembly are visible to a specified assembly. - - - Initializes a new instance of the class with the name of the specified friend assembly. - The name of a friend assembly. - - - This property is not implemented. - This property does not return a value. - - - Gets the name of the friend assembly to which all types and type members that are marked with the internal keyword are to be made visible. - A string that represents the name of the friend assembly. - - - Represents the values of run-time variables. - - - Gets a count of the run-time variables. - The number of run-time variables. - - - Gets the value of the run-time variable at the specified index. - The zero-based index of the run-time variable whose value is to be returned. - The value of the run-time variable. - - - Indicates that the modified reference type is a boxed value type. This class cannot be inherited. - - - Indicates that a modified method argument should be interpreted as having object passed-by-value semantics. This modifier is applied to reference types. This class cannot be inherited. - - - Indicates that the modified type has a const modifier. This class cannot be inherited. - - - Indicates that any copying of values of this type must use the copy constructor provided by the type. This class cannot be inherited. - - - Indicates that a managed pointer represents a pointer parameter within a method signature. This class cannot be inherited. - - - Indicates that the modified garbage collection reference represents a reference parameter within a method signature. This class cannot be inherited. - - - Indicates that a modified method is an intrinsic value for which the just-in-time (JIT) compiler can perform special code generation. This class cannot be inherited. - - - Indicates that a modified integer is a standard C++ long value. This class cannot be inherited. - - - Indicates that a modified instance is pinned in memory. This class cannot be inherited. - - - Indicates that a modifier is neither signed nor unsigned. This class cannot be inherited. - - - Defines a property for accessing the value that an object references. - - - Gets or sets the value that an object references. - The value that the object references. - - - Indicates that a return type is a user-defined type. This class cannot be inherited. - - - Marks a field as volatile. This class cannot be inherited. - - - Indicates whether a method in Visual Basic is marked with the Iterator modifier. - - - Initializes a new instance of the class. - The type object for the underlying state machine type that's used to implement a state machine method. - - - Indicates that the default value for the attributed field or parameter is an instance of , where the is null. This class cannot be inherited. - - - Initializes a new instance of the class. - - - Gets the IUnknown constant stored in this attribute. - The IUnknown constant stored in this attribute. Only null is allowed for an IUnknown constant value. - - - Specifies the preferred default binding for a dependent assembly. - - - The dependency is always loaded. - - - - No preference specified. - - - - The dependency is sometimes loaded. - - - - Defines how a method is implemented. - - - Specifies that the method implementation is in Microsoft intermediate language (MSIL). - - - - Specifies that the method is implemented in native code. - - - - Specifies that the method implementation is in optimized intermediate language (OPTIL). - - - - Specifies that the method implementation is provided by the runtime. - - - - Specifies the details of how a method is implemented. This class cannot be inherited. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with the specified value. - A bitmask representing the desired value which specifies properties of the attributed method. - - - Initializes a new instance of the class with the specified value. - A value specifying properties of the attributed method. - - - A value indicating what kind of implementation is provided for this method. - - - - Gets the value describing the attributed method. - The value describing the attributed method. - - - Defines the details of how a method is implemented. - - - The method should be inlined if possible. - - - - The method is declared, but its implementation is provided elsewhere. - - - - The call is internal, that is, it calls a method that is implemented within the common language runtime. - - - - The method cannot be inlined. Inlining is an optimization by which a method call is replaced with the method body. - - - - The method is not optimized by the just-in-time (JIT) compiler or by native code generation (see Ngen.exe) when debugging possible code generation problems. - - - - The method signature is exported exactly as declared. - - - - The method can be executed by only one thread at a time. Static methods lock on the type, whereas instance methods lock on the instance. Only one thread can execute in any of the instance functions, and only one thread can execute in any of a class's static functions. - - - - The method is implemented in unmanaged code. - - - - Applies metadata to an assembly that indicates that a type is an unmanaged type. This class cannot be inherited. - - - Initializes a new instance of the class. - - - The builder for read only collection. - The type of the collection element. - - - Constructs a ReadOnlyCollectionBuilder. - - - Constructs a ReadOnlyCollectionBuilder, copying contents of the given collection. - Collection to copy elements from. - - - Constructs a ReadOnlyCollectionBuilder with a given initial capacity. The contents are empty but builder will have reserved room for the given number of elements before any reallocations are required. - Initial capacity. - - - Adds an item to the . - The object to add to the . - - - Gets and sets the capacity of this ReadOnlyCollectionBuilder. - The capacity of this ReadOnlyCollectionBuilder. - - - Removes all items from the . - - - Determines whether the contains a specific value - the object to locate in the . - true if item is found in the ; otherwise, false. - - - Copies the elements of the to an , starting at particular index. - The one-dimensional that is the destination of the elements copied from . - The zero-based index in array at which copying begins. - - - Returns number of elements in the ReadOnlyCollectionBuilder. - The number of elements in the ReadOnlyCollectionBuilder. - - - Returns an enumerator that iterates through the collection. - A that can be used to iterate through the collection. - - - Returns the index of the first occurrence of a given value in the builder. - An item to search for. - The index of the first occurrence of an item. - - - Inserts an item to the at the specified index. - The zero-based index at which item should be inserted. - The object to insert into the . - - - Gets or sets the element at the specified index. - The zero-based index of the element to get or set. - The element at the specified index. - - - Removes the first occurrence of a specific object from the . - The object to remove from the . - true if item was successfully removed from the ; otherwise, false. This method also returns false if item is not found in the original . - - - Removes the item at the specified index. - The zero-based index of the item to remove. - - - Reverses the order of the elements in the specified range. - The zero-based starting index of the range to reverse. - The number of elements in the range to reverse. - - - Reverses the order of the elements in the entire . - - - Copies the elements of the to a new array. - An array containing copies of the elements of the . - - - Creates a containing all of the elements of the , avoiding copying the elements to the new array if possible. Resets the after the has been created. - A new instance of . - - - Gets a value indicating whether the is read-only. - true if the is read-only; otherwise, false. - - - Copies the elements of the to an array, starting at the specified array index. - The one-dimensional array that is the destination of the elements copied from . The array must have zero-based indexing. - The zero-based index in array at which copying begins. - - - Gets a value indicating whether access to the is synchronized (thread safe). - true if access to the is synchronized (thread safe); otherwise, false. - - - Gets an object that can be used to synchronize access to the . - An object that can be used to synchronize access to the . - - - Returns an enumerator that iterates through the collection. - An that can be used to iterate through the collection. - - - Adds an item to the . - The to add to the . - The position into which the new element was inserted. - - - Determines whether the contains a specific value. - The to locate in the . - true if item is found in the ; otherwise, false. - - - Determines the index of a specific item in the . - The object to locate in the . - The index of item if found in the list; otherwise, –1. - - - Inserts an item to the at the specified index. - The zero-based index at which item should be inserted. - The object to insert into the . - - - Gets a value indicating whether the has a fixed size. - true if the has a fixed size; otherwise, false. - - - Gets a value indicating whether the is read-only. - true if the is read-only; otherwise, false. - - - Gets or sets the element at the specified index. - The zero-based index of the element to get or set. - The element at the specified index. - - - Removes the first occurrence of a specific object from the . - The object to remove from the . - - - Identifies an assembly as a reference assembly, which contains metadata but no executable code. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class by using the specified description. - The description of the reference assembly. - - - Gets the description of the reference assembly. - The description of the reference assembly. - - - Specifies that an importing compiler must fully understand the semantics of a type definition, or refuse to use it. This class cannot be inherited. - - - Initializes a new instance of the class. - A type that an importing compiler must fully understand. This parameter is not supported in the .NET Framework version 2.0 and later. - - - Gets a type that an importing compiler must fully understand. - A type that an importing compiler must fully understand. - - - Represents a cache of runtime binding rules. - The delegate type. - - - Specifies whether to wrap exceptions that do not derive from the class with a object. This class cannot be inherited. - - - Initializes a new instance of the class. - - - Gets or sets a value that indicates whether to wrap exceptions that do not derive from the class with a object. - true if exceptions that do not derive from the class should appear wrapped with a object; otherwise, false. - - - Represents a method to run when an exception occurs. - Data to pass to the delegate. - true to express that an exception was thrown; otherwise, false. - - - Represents a delegate to code that should be run in a try block.. - Data to pass to the delegate. - - - Provides a set of static methods and properties that provide support for compilers. This class cannot be inherited. - - - Ensures that the remaining stack space is large enough to execute the average .NET Framework function. - The available stack space is insufficient to execute the average .NET Framework function. - - - Determines whether the specified instances are considered equal. - The first object to compare. - The second object to compare. - true if the o1 parameter is the same instance as the o2 parameter, or if both are null, or if o1.Equals(o2) returns true; otherwise, false. - - - Executes code using a while using another to execute additional code in case of an exception. - A delegate to the code to try. - A delegate to the code to run if an exception occurs. - The data to pass to code and backoutCode. - - - Serves as a hash function for a particular object, and is suitable for use in algorithms and data structures that use hash codes, such as a hash table. - An object to retrieve the hash code for. - A hash code for the object identified by the o parameter. - - - Boxes a value type. - The value type to be boxed. - A boxed copy of obj if it is a value class; otherwise, obj itself. - - - Provides a fast way to initialize an array from data that is stored in a module. - The array to be initialized. - A field handle that specifies the location of the data used to initialize the array. - - - Gets the offset, in bytes, to the data in the given string. - The byte offset, from the start of the object to the first character in the string. - - - Designates a body of code as a constrained execution region (CER). - - - Designates a body of code as a constrained execution region (CER) without performing any probing. - - - Provides a way for applications to dynamically prepare event delegates. - The event delegate to prepare. - - - Indicates that the specified delegate should be prepared for inclusion in a constrained execution region (CER). - The delegate type to prepare. - - - Prepares a method for inclusion in a constrained execution region (CER). - A handle to the method to prepare. - - - Prepares a method for inclusion in a constrained execution region (CER) with the specified instantiation. - A handle to the method to prepare. - The instantiation to pass to the method. - - - Probes for a certain amount of stack space to ensure that a stack overflow cannot happen within a subsequent block of code (assuming that your code uses only a finite and moderate amount of stack space). We recommend that you use a constrained execution region (CER) instead of this method. - - - Runs a specified class constructor method. - A type handle that specifies the class constructor method to run. - The class initializer throws an exception. - - - Runs a specified module constructor method. - A handle that specifies the module constructor method to run. - The module constructor throws an exception. - - - Wraps an exception that does not derive from the class. This class cannot be inherited. - - - Sets the object with information about the exception. - The object that holds the serialized object data about the exception being thrown. - The object that contains contextual information about the source or destination. - The info parameter is null. - - - Gets the object that was wrapped by the object. - The object that was wrapped by the object. - - - Indicates that a native enumeration is not qualified by the enumeration type name. This class cannot be inherited. - - - Initializes a new instance of the class. - - - Indicates that a type or member is treated in a special way by the runtime or tools. This class cannot be inherited. - - - Initializes a new instance of the class. - - - Allows you to determine whether a method is a state machine method. - - - Initializes a new instance of the class. - The type object for the underlying state machine type that was generated by the compiler to implement the state machine method. - - - Returns the type object for the underlying state machine type that was generated by the compiler to implement the state machine method. - Gets the type object for the underlying state machine type that was generated by the compiler to implement the state machine method. - - - Deprecated. Freezes a string literal when creating native images using the Ngen.exe (Native Image Generator). This class cannot be inherited. - - - Initializes a new instance of the class. - - - Holds a reference to a value. - The type of the value that the references. - - - Initializes a new StrongBox which can receive a value when used in a reference call. - - - Initializes a new instance of the class by using the supplied value. - A value that the will reference. - - - Represents the value that the references. - - - - Gets or sets the value that the references. - The value that the references. - - - Prevents the Ildasm.exe (IL Disassembler) from disassembling an assembly. This class cannot be inherited. - - - Initializes a new instance of the class. - - - Represents an object that waits for the completion of an asynchronous task and provides a parameter for the result. - The result for the task. - - - Ends the wait for the completion of the asynchronous task. - The result of the completed task. - The object was not properly initialized. - The task was canceled. - The task completed in a state. - - - Gets a value that indicates whether the asynchronous task has completed. - true if the task has completed; otherwise, false. - The object was not properly initialized. - - - Sets the action to perform when the object stops waiting for the asynchronous task to complete. - The action to perform when the wait operation completes. - continuation is null. - The object was not properly initialized. - - - Schedules the continuation action for the asynchronous task associated with this awaiter. - The action to invoke when the await operation completes. - continuation is null. - The awaiter was not properly initialized. - - - Provides an object that waits for the completion of an asynchronous task. - - - Ends the wait for the completion of the asynchronous task. - The object was not properly initialized. - The task was canceled. - The task completed in a state. - - - Gets a value that indicates whether the asynchronous task has completed. - true if the task has completed; otherwise, false. - The object was not properly initialized. - - - Sets the action to perform when the object stops waiting for the asynchronous task to complete. - The action to perform when the wait operation completes. - continuation is null. - The object was not properly initialized. - - - Schedules the continuation action for the asynchronous task that is associated with this awaiter. - The action to invoke when the await operation completes. - continuation is null. - The awaiter was not properly initialized. - - - Indicates that the use of a value tuple on a member is meant to be treated as a tuple with element names. - - - Initializes a new instance of the class. - A string array that specifies, in a pre-order depth-first traversal of a type's construction, which value tuple occurrences are meant to carry element names. - - - Specifies, in a pre-order depth-first traversal of a type's construction, which value tuple elements are meant to carry element names. - An array that indicates which value tuple elements are meant to carry element names. - - - Specifies a source in another assembly. - - - Initializes a new instance of the class. - The source in another assembly. - assemblyFullName is null or empty. - - - Gets the assembly-qualified name of the source type. - The assembly-qualified name of the source type. - - - Specifies a destination in another assembly. - - - Initializes a new instance of the class specifying a destination . - The destination in another assembly. - - - Gets the destination in another assembly. - The destination in another assembly. - - - Specifies that a type contains an unmanaged array that might potentially overflow. This class cannot be inherited. - - - Initializes a new instance of the class. - - - Provides an awaiter for switching into a target environment. - - - Ends the await operation. - - - Gets a value that indicates whether a yield is not required. - Always false, which indicates that a yield is always required for . - - - Sets the continuation to invoke. - The action to invoke asynchronously. - continuation is null. - - - Posts the continuation back to the current context. - The action to invoke asynchronously. - The continuation argument is null. - - - Provides the context for waiting when asynchronously switching into a target environment. - - - Retrieves a object for this instance of the class. - The object that is used to monitor the completion of an asynchronous operation. - - - Specifies a method's behavior when called within a constrained execution region. - - - In the face of exceptional conditions, the method might fail. In this case, the method will report back to the calling method whether it succeeded or failed. The method must have a CER around the method body to ensure that it can report the return value. - - - - The method, type, or assembly has no concept of a CER. It does not take advantage of CER guarantees. This implies the following: - - - - In the face of exceptional conditions, the method is guaranteed to succeed. You should always construct a CER around the method that is called, even when it is called from within a non-CER region. A method is successful if it accomplishes what is intended. For example, marking with ReliabilityContractAttribute(Cer.Success) implies that when it is run under a CER, it always returns a count of the number of elements in the and it can never leave the internal fields in an undetermined state. - - - - Specifies a reliability contract. - - - In the face of exceptional conditions, the common language runtime (CLR) makes no guarantees regarding state consistency in the current application domain. - - - - In the face of exceptional conditions, the method is guaranteed to limit state corruption to the current instance. - - - - In the face of exceptional conditions, the CLR makes no guarantees regarding state consistency; that is, the condition might corrupt the process. - - - - In the face of exceptional conditions, the method is guaranteed not to corrupt state. - - - - Ensures that all finalization code in derived classes is marked as critical. - - - Initializes a new instance of the class. - - - Releases all the resources used by the class. - - - Instructs the native image generation service to prepare a method for inclusion in a constrained execution region (CER). - - - Initializes a new instance of the class. - - - Defines a contract for reliability between the author of some code, and the developers who have a dependency on that code. - - - Initializes a new instance of the class with the specified guarantee and value. - One of the values. - One of the values. - - - Gets the value that determines the behavior of a method, type, or assembly when called under a Constrained Execution Region (CER). - One of the values. - - - Gets the value of the reliability contract. - One of the values. - - - Provides an abstract base class from which all implementations must inherit. - - - Initializes a new instance of the class. - A byte array that represents an object. - keyBlob is null. - - - Releases all resources used by the current instance of the class. - - - Releases the unmanaged resources used by the class and optionally releases the managed resources. - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - Serializes the key BLOB to a byte array. - A byte array that contains the serialized Elliptic Curve Diffie-Hellman (ECDH) public key. - - - Serializes the public key to an XML string. - An XML string that contains the serialized Elliptic Curve Diffie-Hellman (ECDH) public key. - - - Provides an abstract base class that encapsulates the Elliptic Curve Digital Signature Algorithm (ECDSA). - - - Initializes a new instance of the class. - - - Creates a new instance of the default implementation of the Elliptic Curve Digital Signature Algorithm (ECDSA). - A new instance of the default implementation () of this class. - - - Creates a new instance of the default implementation of the Elliptic Curve Digital Signature Algorithm (ECDSA) with a newly generated key over the specified curve. - The curve to use for key generation. - A new instance of the default implementation () of this class. - - - Creates a new instance of the default implementation of the Elliptic Curve Digital Signature Algorithm (ECDSA) using the specified parameters as the key. - The parameters representing the key to use. - A new instance of the default implementation () of this class. - - - Creates a new instance of the specified implementation of the Elliptic Curve Digital Signature Algorithm (ECDSA). - The name of an ECDSA implementation. The following strings all refer to the same implementation, which is the only implementation currently supported in the .NET Framework: - "ECDsa" - "ECDsaCng" - "System.Security.Cryptography.ECDsaCng" You can also provide the name of a custom ECDSA implementation. - A new instance of the specified implementation of this class. If the specified algorithm name does not map to an ECDSA implementation, this method returns null. - The algorithm parameter is null. - - - When overridden in a derived class, exports the explicit parameters for an elliptic curve. - true to include private parameters; otherwise, false. - The parameters representing the point on the curve for this key, using the explicit curve format. - A derived class must override this method. - - - When overridden in a derived class, exports the named or explicit parameters for an elliptic curve. If the curve has a name, the field contains named curve parameters, otherwise it contains explicit parameters. - true to include private parameters; otherwise, false. - The parameters representing the point on the curve for this key. - A derived class must override this method. - - - When overridden in a derived class, generates a new public/private key pair for the specified curve. - The curve to use. - A derived class must override this method. - - - When overridden in a derived class, computes the hash value of the specified binary stream by using the specified hashing algorithm. - The binary stream to hash. - The algorithm to use to hash the data. - The hashed data. - A derived class must override this method. - - - When overridden in a derived class, computes the hash value of the specified portion of a byte array by using the specified hashing algorithm. - The data to be hashed. - The index of the first byte in data to be hashed. - The number of bytes to hash. - The algorithm to use to hash the data. - The hashed data. - A derived class must override this method. - - - When overridden in a derived class, imports the specified parameters. - The curve parameters. - A derived class must override this method. - - - Gets the name of the key exchange algorithm. - Always null. - - - Gets the name of the signature algorithm. - The string "ECDsa". - - - Computes the hash value of the specified byte array using the specified hash algorithm and signs the resulting hash value. - The input data for which to compute the hash. - The hash algorithm to use to create the hash value. - The ECDSA signature for the specified data. - data is null. - hashAlgorithm. is null or . - - - Computes the hash value of the specified stream using the specified hash algorithm and signs the resulting hash value. - The input stream for which to compute the hash. - The hash algorithm to use to create the hash value. - The ECDSA signature for the specified data. - data is null. - hashAlgorithm. is null or . - - - Computes the hash value of a portion of the specified byte array using the specified hash algorithm and signs the resulting hash value. - The input data for which to compute the hash. - The offset into the array at which to begin using data. - The number of bytes in the array to use as data. - The hash algorithm to use to create the hash value. - The ECDSA signature for the specified data. - data is null. - hashAlgorithm. is null or . - offset is less than zero. -or- count is less than zero. -or- offset + count – 1 results in an index that is beyond the upper bound of data. - - - Generates a digital signature for the specified hash value. - The hash value of the data that is being signed. - A digital signature that consists of the given hash value encrypted with the private key. - The hash parameter is null. - - - Verifies that a digital signature is valid by calculating the hash value of the specified data using the specified hash algorithm and comparing it to the provided signature. - The signed data. - The signature data to be verified. - The hash algorithm used to create the hash value of the data. - true if the signature is valid; otherwise, false. - data is null. -or- signature is null. - hashAlgorithm. is null or . - - - Verifies that a digital signature is valid by calculating the hash value of the specified stream using the specified hash algorithm and comparing it to the provided signature. - The signed data. - The signature data to be verified. - The hash algorithm used to create the hash value of the data. - true if the signature is valid; otherwise, false. - data is null. -or- signature is null. - hashAlgorithm. is null or . - - - Verifies that a digital signature is valid by calculating the hash value of the data in a portion of a byte array using the specified hash algorithm and comparing it to the provided signature. - The signed data. - The starting index at which to compute the hash. - The number of bytes to hash. - The signature data to be verified. - The hash algorithm used to create the hash value of the data. - true if the signature is valid; otherwise, false. - data is null. -or- signature is null. - hashAlgorithm. is null or . - offset is less than zero. -or- count is less than zero. -or- offset + count – 1 results in an index that is beyond the upper bound of data. - - - Verifies a digital signature against the specified hash value. - The hash value of a block of data. - The digital signature to be verified. - true if the hash value equals the decrypted signature; otherwise, false. - - - Represents the standard parameters for the elliptic curve cryptography (ECC) algorithm. - - - Represents the curve associated with the public key () and the optional private key (). - - - - Represents the private key D for the elliptic curve cryptography (ECC) algorithm, stored in big-endian format. - - - - Represents the public key Q for the elliptic curve cryptography (ECC) algorithm. - - - - Validates the current object. - The key or curve parameters are not valid for the current curve type. - - - Represents a (X,Y) coordinate pair for elliptic curve cryptography (ECC) structures. - - - Represents the X coordinate. - - - - Represents the Y coordinate. - - - - Converts a from base 64. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with the specified transformation mode. - One of the values. - - - Gets a value indicating whether the current transform can be reused. - Always true. - - - Gets a value that indicates whether multiple blocks can be transformed. - Always false. - - - Releases all resources used by the . - - - Releases all resources used by the current instance of the class. - - - Releases the unmanaged resources used by the and optionally releases the managed resources. - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - Releases the unmanaged resources used by the . - - - Gets the input block size. - The size of the input data blocks in bytes. - - - Gets the output block size. - The size of the output data blocks in bytes. - - - Converts the specified region of the input byte array from base 64 and copies the result to the specified region of the output byte array. - The input to compute from base 64. - The offset into the input byte array from which to begin using data. - The number of bytes in the input byte array to use as data. - The output to which to write the result. - The offset into the output byte array from which to begin writing data. - The number of bytes written. - The current object has already been disposed. - inputCount uses an invalid value. -or- inputBuffer has an invalid offset length. - inputOffset is out of range. This parameter requires a non-negative number. - inputBuffer is null. - - - Converts the specified region of the specified byte array from base 64. - The input to convert from base 64. - The offset into the byte array from which to begin using data. - The number of bytes in the byte array to use as data. - The computed conversion. - The current object has already been disposed. - inputBuffer has an invalid offset length. -or- inputCount has an invalid value. - inputOffset is out of range. This parameter requires a non-negative number. - inputBuffer is null. - - - Specifies whether white space should be ignored in the base 64 transformation. - - - White space should not be ignored. - - - - White space should be ignored. - - - - Represents the base class from which all implementations of cryptographic hash algorithms must derive. - - - Initializes a new instance of the class. - - - Gets a value indicating whether the current transform can be reused. - Always true. - - - When overridden in a derived class, gets a value indicating whether multiple blocks can be transformed. - true if multiple blocks can be transformed; otherwise, false. - - - Releases all resources used by the class. - - - Computes the hash value for the specified byte array. - The input to compute the hash code for. - The computed hash code. - buffer is null. - The object has already been disposed. - - - Computes the hash value for the specified object. - The input to compute the hash code for. - The computed hash code. - The object has already been disposed. - - - Computes the hash value for the specified region of the specified byte array. - The input to compute the hash code for. - The offset into the byte array from which to begin using data. - The number of bytes in the array to use as data. - The computed hash code. - count is an invalid value. -or- buffer length is invalid. - buffer is null. - offset is out of range. This parameter requires a non-negative number. - The object has already been disposed. - - - Creates an instance of the default implementation of a hash algorithm. - A new instance, unless the default settings have been changed using the . - - - Creates an instance of the specified implementation of a hash algorithm. -

The hash algorithm implementation to use. The following table shows the valid values for the hashName parameter and the algorithms they map to.

-
Parameter value

-

Implements

-

SHA

-

SHA1

-

System.Security.Cryptography.SHA1

-

System.Security.Cryptography.HashAlgorithm

-

MD5

-

System.Security.Cryptography.MD5

-

SHA256

-

SHA-256

-

System.Security.Cryptography.SHA256

-

SHA384

-

SHA-384

-

System.Security.Cryptography.SHA384

-

SHA512

-

SHA-512

-

System.Security.Cryptography.SHA512

-

- - A new instance of the specified hash algorithm, or null if hashName is not a valid hash algorithm. -
- - Releases all resources used by the current instance of the class. - - - Releases the unmanaged resources used by the and optionally releases the managed resources. - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - Gets the value of the computed hash code. - The current value of the computed hash code. - is null. - The object has already been disposed. - - - When overridden in a derived class, routes data written to the object into the hash algorithm for computing the hash. - The input to compute the hash code for. - The offset into the byte array from which to begin using data. - The number of bytes in the byte array to use as data. - - - When overridden in a derived class, finalizes the hash computation after the last data is processed by the cryptographic stream object. - The computed hash code. - - - Gets the size, in bits, of the computed hash code. - The size, in bits, of the computed hash code. - - - Represents the size, in bits, of the computed hash code. - - - - Represents the value of the computed hash code. - - - - Initializes an implementation of the class. - - - When overridden in a derived class, gets the input block size. - The input block size. - - - When overridden in a derived class, gets the output block size. - The output block size. - - - Represents the state of the hash computation. - - - - Computes the hash value for the specified region of the input byte array and copies the specified region of the input byte array to the specified region of the output byte array. - The input to compute the hash code for. - The offset into the input byte array from which to begin using data. - The number of bytes in the input byte array to use as data. - A copy of the part of the input array used to compute the hash code. - The offset into the output byte array from which to begin writing data. - The number of bytes written. - inputCount uses an invalid value. -or- inputBuffer has an invalid length. - inputBuffer is null. - inputOffset is out of range. This parameter requires a non-negative number. - The object has already been disposed. - - - Computes the hash value for the specified region of the specified byte array. - The input to compute the hash code for. - The offset into the byte array from which to begin using data. - The number of bytes in the byte array to use as data. - An array that is a copy of the part of the input that is hashed. - inputCount uses an invalid value. -or- inputBuffer has an invalid offset length. - inputBuffer is null. - inputOffset is out of range. This parameter requires a non-negative number. - The object has already been disposed. - - - Specifies the name of a cryptographic hash algorithm. - - - Initializes a new instance of the structure with a custom name. - The custom hash algorithm name. - - - Returns a value that indicates whether the current instance and a specified object are equal. - The object to compare with the current instance. - true if obj is a object and its property is equal to that of the current instance. The comparison is ordinal and case-sensitive. - - - Returns a value that indicates whether two instances are equal. - The object to compare with the current instance. - true if the property of other is equal to that of the current instance. The comparison is ordinal and case-sensitive. - - - Returns the hash code for the current instance. - The hash code for the current instance, or 0 if no name value was supplied to the constructor. - - - Gets a hash algorithm name that represents "MD5". - A hash algorithm name that represents "MD5". - - - Gets the underlying string representation of the algorithm name. - The string representation of the algorithm name, or null or if no hash algorithm is available. - - - Determines whether two specified objects are equal. - The first object to compare. - The second object to compare. - true if both left and right have the same value; otherwise, false. - - - Determines whether two specified objects are not equal. - The first object to compare. - The second object to compare. - true if both left and right do not have the same value; otherwise, false. - - - Gets a hash algorithm name that represents "SHA1". - A hash algorithm name that represents "SHA1". - - - Gets a hash algorithm name that represents "SHA256". - A hash algorithm name that represents "SHA256". - - - Gets a hash algorithm name that represents "SHA384". - A hash algorithm name that represents "SHA384". - - - Gets a hash algorithm name that represents "SHA512". - A hash algorithm name that represents "SHA512". - - - Returns the string representation of the current instance. - The string representation of the current instance. - - - Represents the abstract class from which all implementations of Hash-based Message Authentication Code (HMAC) must derive. - - - Initializes a new instance of the class. - - - Gets or sets the block size to use in the hash value. - The block size to use in the hash value. - - - Creates an instance of the default implementation of a Hash-based Message Authentication Code (HMAC). - A new SHA-1 instance, unless the default settings have been changed by using the element. - - - Creates an instance of the specified implementation of a Hash-based Message Authentication Code (HMAC). -

The HMAC implementation to use. The following table shows the valid values for the algorithmName parameter and the algorithms they map to.

-
Parameter value

-

Implements

-

System.Security.Cryptography.HMAC

-

System.Security.Cryptography.KeyedHashAlgorithm

-

HMACMD5

-

System.Security.Cryptography.HMACMD5

-

HMACRIPEMD160

-

System.Security.Cryptography.HMACRIPEMD160

-

HMACSHA1

-

System.Security.Cryptography.HMACSHA1

-

HMACSHA256

-

System.Security.Cryptography.HMACSHA256

-

HMACSHA384

-

System.Security.Cryptography.HMACSHA384

-

HMACSHA512

-

System.Security.Cryptography.HMACSHA512

-

MACTripleDES

-

System.Security.Cryptography.MACTripleDES

-

- - A new instance of the specified HMAC implementation. -
- - Releases the unmanaged resources used by the class when a key change is legitimate and optionally releases the managed resources. - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - When overridden in a derived class, routes data written to the object into the default hash algorithm for computing the hash value. - The input data. - The offset into the byte array from which to begin using data. - The number of bytes in the array to use as data. - - - When overridden in a derived class, finalizes the hash computation after the last data is processed by the cryptographic stream object. - The computed hash code in a byte array. - - - Gets or sets the name of the hash algorithm to use for hashing. - The name of the hash algorithm. - The current hash algorithm cannot be changed. - - - Initializes an instance of the default implementation of . - - - Gets or sets the key to use in the hash algorithm. - The key to use in the hash algorithm. - An attempt is made to change the property after hashing has begun. - - - Computes a Hash-based Message Authentication Code (HMAC) by using the hash function. - - - Initializes a new instance of the class by using a randomly generated key. - - - Initializes a new instance of the class by using the specified key. - The secret key for encryption. The key can be any length, but if it is more than 64 bytes long it will be hashed (using SHA-1) to derive a 64-byte key. Therefore, the recommended size of the secret key is 64 bytes. - The key parameter is null. - - - Computes a Hash-based Message Authentication Code (HMAC) using the hash function. - - - Initializes a new instance of the class with a randomly generated key. - - - Initializes a new instance of the class with the specified key data. - The secret key for encryption. The key can be any length, but if it is more than 64 bytes long it is hashed (using SHA-1) to derive a 64-byte key. Therefore, the recommended size of the secret key is 64 bytes. - The key parameter is null. - - - Initializes a new instance of the class with the specified key data and a value that specifies whether to use the managed version of the SHA1 algorithm. - The secret key for encryption. The key can be any length, but if it is more than 64 bytes long, it is hashed (using SHA-1) to derive a 64-byte key. Therefore, the recommended size of the secret key is 64 bytes. - true to use the managed implementation of the SHA1 algorithm (the class); false to use the unmanaged implementation (the class). - - - Computes a Hash-based Message Authentication Code (HMAC) by using the hash function. - - - Initializes a new instance of the class with a randomly generated key. - - - Initializes a new instance of the class with the specified key data. - The secret key for encryption. The key can be any length. However, the recommended size is 64 bytes. If the key is more than 64 bytes long, it is hashed (using SHA-256) to derive a 64-byte key. If it is less than 64 bytes long, it is padded to 64 bytes. - The key parameter is null. - - - Computes a Hash-based Message Authentication Code (HMAC) using the hash function. - - - Initializes a new instance of the class by using a randomly generated key. - - - Initializes a new instance of the class by using the specified key data. - The secret key for encryption. The key can be any length. However, the recommended size is 128 bytes. If the key is more than 128 bytes long, it is hashed (using SHA-384) to derive a 128-byte key. If it is less than 128 bytes long, it is padded to 128 bytes. - The key parameter is null. - - - Provides a workaround for the .NET Framework 2.0 implementation of the algorithm, which is inconsistent with the .NET Framework 2.0 Service Pack 1 implementation of the algorithm. - true to enable .NET Framework 2.0 Service Pack 1 applications to interact with .NET Framework 2.0 applications; otherwise, false. - - - Computes a Hash-based Message Authentication Code (HMAC) using the hash function. - - - Initializes a new instance of the class with a randomly generated key. - - - Initializes a new instance of the class with the specified key data. - The secret key for encryption. The key can be any length. However, the recommended size is 128 bytes. If the key is more than 128 bytes long, it is hashed (using SHA-512) to derive a 128-byte key. If it is less than 128 bytes long, it is padded to 128 bytes. - The key parameter is null. - - - Provides a workaround for the .NET Framework 2.0 implementation of the algorithm, which is inconsistent with the .NET Framework 2.0 Service Pack 1 implementation. - true to enable .NET Framework 2.0 Service Pack 1 applications to interact with .NET Framework 2.0 applications; otherwise, false. - - - Defines the basic operations of cryptographic transformations. - - - Gets a value indicating whether the current transform can be reused. - true if the current transform can be reused; otherwise, false. - - - Gets a value indicating whether multiple blocks can be transformed. - true if multiple blocks can be transformed; otherwise, false. - - - Gets the input block size. - The size of the input data blocks in bytes. - - - Gets the output block size. - The size of the output data blocks in bytes. - - - Transforms the specified region of the input byte array and copies the resulting transform to the specified region of the output byte array. - The input for which to compute the transform. - The offset into the input byte array from which to begin using data. - The number of bytes in the input byte array to use as data. - The output to which to write the transform. - The offset into the output byte array from which to begin writing data. - The number of bytes written. - - - Transforms the specified region of the specified byte array. - The input for which to compute the transform. - The offset into the byte array from which to begin using data. - The number of bytes in the byte array to use as data. - The computed transform. - - - Defines methods that allow an class to enumerate key container information, and import and export Microsoft Cryptographic API (CAPI)–compatible key blobs. - - - Gets a object that describes additional information about a cryptographic key pair. - A object that describes additional information about a cryptographic key pair. - - - Exports a blob that contains the key information associated with an object. - true to include the private key; otherwise, false. - A byte array that contains the key information associated with an object. - - - Imports a blob that represents asymmetric key information. - A byte array that represents an asymmetric key blob. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Represents the abstract class from which all implementations of keyed hash algorithms must derive. - - - Initializes a new instance of the class. - - - Creates an instance of the default implementation of a keyed hash algorithm. - A new instance, unless the default settings have been changed. - - - Creates an instance of the specified implementation of a keyed hash algorithm. -

The keyed hash algorithm implementation to use. The following table shows the valid values for the algName parameter and the algorithms they map to.

-
Parameter value

-

Implements

-

System.Security.Cryptography.HMAC

-

System.Security.Cryptography.KeyedHashAlgorithm

-

HMACMD5

-

System.Security.Cryptography.HMACMD5

-

HMACRIPEMD160

-

System.Security.Cryptography.HMACRIPEMD160

-

HMACSHA1

-

System.Security.Cryptography.HMACSHA1

-

HMACSHA256

-

System.Security.Cryptography.HMACSHA256

-

HMACSHA384

-

System.Security.Cryptography.HMACSHA384

-

HMACSHA512

-

System.Security.Cryptography.HMACSHA512

-

MACTripleDES

-

System.Security.Cryptography.MACTripleDES

-

- - A new instance of the specified keyed hash algorithm. -
- - Releases the unmanaged resources used by the and optionally releases the managed resources. - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - Gets or sets the key to use in the hash algorithm. - The key to use in the hash algorithm. - An attempt was made to change the property after hashing has begun. - - - The key to use in the hash algorithm. - - - - Specifies whether to create an asymmetric signature key or an asymmetric exchange key. - - - An exchange key pair used to encrypt session keys so that they can be safely stored and exchanged with other users. - - - - A signature key pair used for authenticating digitally signed messages or files. - - - - Determines the set of valid key sizes for the symmetric cryptographic algorithms. - - - Initializes a new instance of the class with the specified key values. - The minimum valid key size. - The maximum valid key size. - The interval between valid key sizes. - - - Specifies the maximum key size in bits. - The maximum key size in bits. - - - Specifies the minimum key size in bits. - The minimum key size in bits. - - - Specifies the interval between valid key sizes in bits. - The interval between valid key sizes in bits. - - - Represents the abstract class from which all mask generator algorithms must derive. - - - Initializes a new instance of the class. - - - When overridden in a derived class, generates a mask with the specified length using the specified random seed. - The random seed to use to compute the mask. - The length of the generated mask in bytes. - A randomly generated mask whose length is equal to the cbReturn parameter. - - - Represents the abstract class from which all implementations of the hash algorithm inherit. - - - Initializes a new instance of . - - - Creates an instance of the default implementation of the hash algorithm. - A new instance of the hash algorithm. - The algorithm was used with Federal Information Processing Standards (FIPS) mode enabled, but is not FIPS compatible. - - - Creates an instance of the specified implementation of the hash algorithm. - The name of the specific implementation of to use. - A new instance of the specified implementation of . - The algorithm described by the algName parameter was used with Federal Information Processing Standards (FIPS) mode enabled, but is not FIPS compatible. - - - Computes the hash value for the input data using the implementation provided by the cryptographic service provider (CSP). This class cannot be inherited. - - - Initializes a new instance of the class. - A FIPS-compliant algorithm policy is not being used. - - - Initializes an instance of . - - - Represents a cryptographic object identifier. This class cannot be inherited. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class using the specified object. - The object identifier information to use to create the new object identifier. - oid is null. - - - Initializes a new instance of the class using a string value of an object. - An object identifier. - - - Initializes a new instance of the class using the specified value and friendly name. - The dotted number of the identifier. - The friendly name of the identifier. - - - Gets or sets the friendly name of the identifier. - The friendly name of the identifier. - - - Creates an object from an OID friendly name by searching the specified group. - The friendly name of the identifier. - The group to search in. - An object that represents the specified OID. - friendlyName is null. - The OID was not found. - - - Creates an object by using the specified OID value and group. - The OID value. - The group to search in. - A new instance of an object. - oidValue is null. - The friendly name for the OID value was not found. - - - Gets or sets the dotted number of the identifier. - The dotted number of the identifier. - - - Represents a collection of objects. This class cannot be inherited. - - - Initializes a new instance of the class. - - - Adds an object to the object. - The object to add to the collection. - The index of the added object. - - - Copies the object into an array. - The array to copy the object into. - The location where the copy operation starts. - - - Gets the number of objects in a collection. - The number of objects in a collection. - - - Returns an object that can be used to navigate the object. - An object. - - - Gets a value that indicates whether access to the object is thread safe. - false in all cases. - - - Gets an object from the object. - The location of the object in the collection. - An object. - - - Gets the first object that contains a value of the property or a value of the property that matches the specified string value from the object. - A string that represents a property or a property. - An object. - - - Gets an object that can be used to synchronize access to the object. - An object that can be used to synchronize access to the object. - - - Copies the object into an array. - The array to copy the object to. - The location where the copy operation starts. - array cannot be a multidimensional array. -or- The length of array is an invalid offset length. - array is null. - The value of index is out range. - - - Returns an object that can be used to navigate the object. - An object that can be used to navigate the collection. - - - Provides the ability to navigate through an object. This class cannot be inherited. - - - Gets the current object in an object. - The current object in the collection. - - - Advances to the next object in an object. - true, if the enumerator was successfully advanced to the next element; false, if the enumerator has passed the end of the collection. - The collection was modified after the enumerator was created. - - - Sets an enumerator to its initial position. - The collection was modified after the enumerator was created. - - - Gets the current object in an object. - The current object. - - - Identifies Windows cryptographic object identifier (OID) groups. - - - All the groups. - - - - The Windows group that is represented by CRYPT_RDN_ATTR_OID_GROUP_ID. - - - - The Windows group that is represented by CRYPT_ENCRYPT_ALG_OID_GROUP_ID. - - - - The Windows group that is represented by CRYPT_ENHKEY_USAGE_OID_GROUP_ID. - - - - The Windows group that is represented by CRYPT_EXT_OR_ATTR_OID_GROUP_ID. - - - - The Windows group that is represented by CRYPT_HASH_ALG_OID_GROUP_ID. - - - - The Windows group that is represented by CRYPT_KDF_OID_GROUP_ID. - - - - The Windows group that is represented by CRYPT_POLICY_OID_GROUP_ID. - - - - The Windows group that is represented by CRYPT_PUBKEY_ALG_OID_GROUP_ID. - - - - The Windows group that is represented by CRYPT_SIGN_ALG_OID_GROUP_ID. - - - - The Windows group that is represented by CRYPT_TEMPLATE_OID_GROUP_ID. - - - - Specifies the type of padding to apply when the message data block is shorter than the full number of bytes needed for a cryptographic operation. - - - The ANSIX923 padding string consists of a sequence of bytes filled with zeros before the length. - - - - The ISO10126 padding string consists of random data before the length. - - - - No padding is done. - - - - The PKCS #7 padding string consists of a sequence of bytes, each of which is equal to the total number of padding bytes added. - - - - The padding string consists of bytes set to zero. - - - - Derives a key from a password using an extension of the PBKDF1 algorithm. - - - Initializes a new instance of the class specifying the password and key salt to use to derive the key. - The password to derive the key for. - The key salt to use to derive the key. - - - Initializes a new instance of the class with the password and key salt to use to derive the key. - The password for which to derive the key. - The key salt to use to derive the key. - - - Initializes a new instance of the class specifying the password, key salt, and cryptographic service provider (CSP) to use to derive the key. - The password to derive the key for. - The key salt to use to derive the key. - The cryptographic service provider (CSP) parameters for the operation. - - - Initializes a new instance of the class with the password, key salt, and cryptographic service provider (CSP) parameters to use to derive the key. - The password for which to derive the key. - The key salt to use to derive the key. - The CSP parameters for the operation. - - - Initializes a new instance of the class specifying the password, key salt, hash name, and iterations to use to derive the key. - The password to derive the key for. - The key salt to use to derive the key. - The hash algorithm to use to derive the key. - The iteration count to use to derive the key. - - - Initializes a new instance of the class with the password, key salt, hash name, and number of iterations to use to derive the key. - The password for which to derive the key. - The key salt to use to derive the key. - The name of the hash algorithm for the operation. - The number of iterations for the operation. - - - Initializes a new instance of the class specifying the password, key salt, hash name, iterations, and cryptographic service provider (CSP) to use to derive the key. - The password to derive the key for. - The key salt to use to derive the key. - The hash algorithm to use to derive the key. - The iteration count to use to derive the key. - The cryptographic service provider (CSP) parameters for the operation. - - - Initializes a new instance of the class with the password, key salt, hash name, number of iterations, and cryptographic service provider (CSP) parameters to use to derive the key. - The password for which to derive the key. - The key salt to use to derive the key. - The name of the hash algorithm for the operation. - The number of iterations for the operation. - The CSP parameters for the operation. - - - Derives a cryptographic key from the object. - The algorithm name for which to derive the key. - The hash algorithm name to use to derive the key. - The size of the key, in bits, to derive. - The initialization vector (IV) to use to derive the key. - The derived key. - The keySize parameter is incorrect. -or- The cryptographic service provider (CSP) cannot be acquired. -or- The algname parameter is not a valid algorithm name. -or- The alghashname parameter is not a valid hash algorithm name. - - - Releases the unmanaged resources used by the class and optionally releases the managed resources. - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - Returns pseudo-random key bytes. - The number of pseudo-random key bytes to generate. - A byte array filled with pseudo-random key bytes. - - - Gets or sets the name of the hash algorithm for the operation. - The name of the hash algorithm for the operation. - The name of the hash value is fixed and an attempt is made to change this value. - - - Gets or sets the number of iterations for the operation. - The number of iterations for the operation. - The number of iterations is fixed and an attempt is made to change this value. - The property cannot be set because its value is out of range. This property requires a non-negative number. - - - Resets the state of the operation. - - - Gets or sets the key salt value for the operation. - The key salt value for the operation. - The key salt value is fixed and an attempt is made to change this value. - - - Represents a callback method to be executed by a thread pool thread. - An object containing information to be used by the callback method. - - - Encapsulates operating system–specific objects that wait for exclusive access to shared resources. - - - Initializes a new instance of the class. - - - Releases all resources held by the current . - - - Releases all resources used by the current instance of the class. - - - When overridden in a derived class, releases the unmanaged resources used by the , and optionally releases the managed resources. - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - Gets or sets the native operating system handle. - An IntPtr representing the native operating system handle. The default is the value of the field. - - - Represents an invalid native operating system handle. This field is read-only. - - - - Gets or sets the native operating system handle. - A representing the native operating system handle. - - - Signals one and waits on another. - The to signal. - The to wait on. - true if both the signal and the wait complete successfully; if the wait does not complete, the method does not return. - toSignal is null. -or- toWaitOn is null. - The method was called on a thread that has . - This method is not supported on Windows 98 or Windows Millennium Edition. - toSignal is a semaphore, and it already has a full count. - The wait completed because a thread exited without releasing a mutex. This exception is not thrown on Windows 98 or Windows Millennium Edition. - - - Signals one and waits on another, specifying a time-out interval as a 32-bit signed integer and specifying whether to exit the synchronization domain for the context before entering the wait. - The to signal. - The to wait on. - An integer that represents the interval to wait. If the value is , that is, -1, the wait is infinite. - true to exit the synchronization domain for the context before the wait (if in a synchronized context), and reacquire it afterward; otherwise, false. - true if both the signal and the wait completed successfully, or false if the signal completed but the wait timed out. - toSignal is null. -or- toWaitOn is null. - The method is called on a thread that has . - This method is not supported on Windows 98 or Windows Millennium Edition. - The cannot be signaled because it would exceed its maximum count. - millisecondsTimeout is a negative number other than -1, which represents an infinite time-out. - The wait completed because a thread exited without releasing a mutex. This exception is not thrown on Windows 98 or Windows Millennium Edition. - - - Signals one and waits on another, specifying the time-out interval as a and specifying whether to exit the synchronization domain for the context before entering the wait. - The to signal. - The to wait on. - A that represents the interval to wait. If the value is -1, the wait is infinite. - true to exit the synchronization domain for the context before the wait (if in a synchronized context), and reacquire it afterward; otherwise, false. - true if both the signal and the wait completed successfully, or false if the signal completed but the wait timed out. - toSignal is null. -or- toWaitOn is null. - The method was called on a thread that has . - This method is not supported on Windows 98 or Windows Millennium Edition. - toSignal is a semaphore, and it already has a full count. - timeout evaluates to a negative number of milliseconds other than -1. -or- timeout is greater than . - The wait completed because a thread exited without releasing a mutex. This exception is not thrown on Windows 98 or Windows Millennium Edition. - - - Waits for all the elements in the specified array to receive a signal, using a value to specify the time interval, and specifying whether to exit the synchronization domain before the wait. - A WaitHandle array containing the objects for which the current instance will wait. This array cannot contain multiple references to the same object. - A that represents the number of milliseconds to wait, or a that represents -1 milliseconds, to wait indefinitely. - true to exit the synchronization domain for the context before the wait (if in a synchronized context), and reacquire it afterward; otherwise, false. - true when every element in waitHandles has received a signal; otherwise false. - The waitHandles parameter is null. -or- One or more of the objects in the waitHandles array is null. -or- waitHandles is an array with no elements and the .NET Framework version is 2.0 or later. - The waitHandles array contains elements that are duplicates. - The number of objects in waitHandles is greater than the system permits. -or- The attribute is applied to the thread procedure for the current thread, and waitHandles contains more than one element. - waitHandles is an array with no elements and the .NET Framework version is 1.0 or 1.1. - timeout is a negative number other than -1 milliseconds, which represents an infinite time-out. -or- timeout is greater than . - The wait terminated because a thread exited without releasing a mutex. This exception is not thrown on Windows 98 or Windows Millennium Edition. - The waitHandles array contains a transparent proxy for a in another application domain. - - - Waits for all the elements in the specified array to receive a signal, using an value to specify the time interval and specifying whether to exit the synchronization domain before the wait. - A WaitHandle array containing the objects for which the current instance will wait. This array cannot contain multiple references to the same object (duplicates). - The number of milliseconds to wait, or (-1) to wait indefinitely. - true to exit the synchronization domain for the context before the wait (if in a synchronized context), and reacquire it afterward; otherwise, false. - true when every element in waitHandles has received a signal; otherwise, false. - The waitHandles parameter is null. -or- One or more of the objects in the waitHandles array is null. -or- waitHandles is an array with no elements and the .NET Framework version is 2.0 or later. - The waitHandles array contains elements that are duplicates. - The number of objects in waitHandles is greater than the system permits. -or- The attribute is applied to the thread procedure for the current thread, and waitHandles contains more than one element. - waitHandles is an array with no elements and the .NET Framework version is 1.0 or 1.1. - millisecondsTimeout is a negative number other than -1, which represents an infinite time-out. - The wait completed because a thread exited without releasing a mutex. This exception is not thrown on Windows 98 or Windows Millennium Edition. - The waitHandles array contains a transparent proxy for a in another application domain. - - - Waits for all the elements in the specified array to receive a signal, using a value to specify the time interval. - A WaitHandle array containing the objects for which the current instance will wait. This array cannot contain multiple references to the same object. - A that represents the number of milliseconds to wait, or a that represents -1 milliseconds, to wait indefinitely. - true when every element in waitHandles has received a signal; otherwise, false. - The waitHandles parameter is null. -or- One or more of the objects in the waitHandles array is null. -or- waitHandles is an array with no elements. - - In the [.NET for Windows Store apps](http://go.microsoft.com/fwlink/?LinkID=247912) or the [Portable Class Library](~/docs/standard/cross-platform/cross-platform-development-with-the-portable-class-library.md), catch the base class exception, , instead. - - The waitHandles array contains elements that are duplicates. - The number of objects in waitHandles is greater than the system permits. -or- The attribute is applied to the thread procedure for the current thread, and waitHandles contains more than one element. - timeout is a negative number other than -1 milliseconds, which represents an infinite time-out. -or- timeout is greater than . - The wait terminated because a thread exited without releasing a mutex. This exception is not thrown on Windows 98 or Windows Millennium Edition. - The waitHandles array contains a transparent proxy for a in another application domain. - - - Waits for all the elements in the specified array to receive a signal, using an value to specify the time interval. - A WaitHandle array containing the objects for which the current instance will wait. This array cannot contain multiple references to the same object (duplicates). - The number of milliseconds to wait, or (-1) to wait indefinitely. - true when every element in waitHandles has received a signal; otherwise, false. - The waitHandles parameter is null. -or- One or more of the objects in the waitHandles array is null. -or- waitHandles is an array with no elements. - - In the [.NET for Windows Store apps](http://go.microsoft.com/fwlink/?LinkID=247912) or the [Portable Class Library](~/docs/standard/cross-platform/cross-platform-development-with-the-portable-class-library.md), catch the base class exception, , instead. - - The waitHandles array contains elements that are duplicates. - The number of objects in waitHandles is greater than the system permits. -or- The attribute is applied to the thread procedure for the current thread, and waitHandles contains more than one element. - millisecondsTimeout is a negative number other than -1, which represents an infinite time-out. - The wait completed because a thread exited without releasing a mutex. This exception is not thrown on Windows 98 or Windows Millennium Edition. - The waitHandles array contains a transparent proxy for a in another application domain. - - - Waits for all the elements in the specified array to receive a signal. - A WaitHandle array containing the objects for which the current instance will wait. This array cannot contain multiple references to the same object. - true when every element in waitHandles has received a signal; otherwise the method never returns. - The waitHandles parameter is null. -or- One or more of the objects in the waitHandles array are null. -or- waitHandles is an array with no elements and the .NET Framework version is 2.0 or later. - - In the [.NET for Windows Store apps](http://go.microsoft.com/fwlink/?LinkID=247912) or the [Portable Class Library](~/docs/standard/cross-platform/cross-platform-development-with-the-portable-class-library.md), catch the base class exception, , instead. - - The waitHandles array contains elements that are duplicates. - The number of objects in waitHandles is greater than the system permits. -or- The attribute is applied to the thread procedure for the current thread, and waitHandles contains more than one element. - waitHandles is an array with no elements and the .NET Framework version is 1.0 or 1.1. - The wait terminated because a thread exited without releasing a mutex. This exception is not thrown on Windows 98 or Windows Millennium Edition. - The waitHandles array contains a transparent proxy for a in another application domain. - - - Waits for any of the elements in the specified array to receive a signal. - A WaitHandle array containing the objects for which the current instance will wait. - The array index of the object that satisfied the wait. - The waitHandles parameter is null. -or- One or more of the objects in the waitHandles array is null. - The number of objects in waitHandles is greater than the system permits. - waitHandles is an array with no elements, and the .NET Framework version is 1.0 or 1.1. - The wait completed because a thread exited without releasing a mutex. This exception is not thrown on Windows 98 or Windows Millennium Edition. - waitHandles is an array with no elements, and the .NET Framework version is 2.0 or later. - The waitHandles array contains a transparent proxy for a in another application domain. - - - Waits for any of the elements in the specified array to receive a signal, using a 32-bit signed integer to specify the time interval. - A WaitHandle array containing the objects for which the current instance will wait. - The number of milliseconds to wait, or (-1) to wait indefinitely. - The array index of the object that satisfied the wait, or if no object satisfied the wait and a time interval equivalent to millisecondsTimeout has passed. - The waitHandles parameter is null. -or- One or more of the objects in the waitHandles array is null. - The number of objects in waitHandles is greater than the system permits. - millisecondsTimeout is a negative number other than -1, which represents an infinite time-out. - The wait completed because a thread exited without releasing a mutex. This exception is not thrown on Windows 98 or Windows Millennium Edition. - waitHandles is an array with no elements. - The waitHandles array contains a transparent proxy for a in another application domain. - - - Waits for any of the elements in the specified array to receive a signal, using a to specify the time interval. - A WaitHandle array containing the objects for which the current instance will wait. - A that represents the number of milliseconds to wait, or a that represents -1 milliseconds to wait indefinitely. - The array index of the object that satisfied the wait, or if no object satisfied the wait and a time interval equivalent to timeout has passed. - The waitHandles parameter is null. -or- One or more of the objects in the waitHandles array is null. - The number of objects in waitHandles is greater than the system permits. - timeout is a negative number other than -1 milliseconds, which represents an infinite time-out. -or- timeout is greater than . - The wait completed because a thread exited without releasing a mutex. This exception is not thrown on Windows 98 or Windows Millennium Edition. - waitHandles is an array with no elements. - The waitHandles array contains a transparent proxy for a in another application domain. - - - Waits for any of the elements in the specified array to receive a signal, using a 32-bit signed integer to specify the time interval, and specifying whether to exit the synchronization domain before the wait. - A WaitHandle array containing the objects for which the current instance will wait. - The number of milliseconds to wait, or (-1) to wait indefinitely. - true to exit the synchronization domain for the context before the wait (if in a synchronized context), and reacquire it afterward; otherwise, false. - The array index of the object that satisfied the wait, or if no object satisfied the wait and a time interval equivalent to millisecondsTimeout has passed. - The waitHandles parameter is null. -or- One or more of the objects in the waitHandles array is null. - The number of objects in waitHandles is greater than the system permits. - waitHandles is an array with no elements, and the .NET Framework version is 1.0 or 1.1. - millisecondsTimeout is a negative number other than -1, which represents an infinite time-out. - The wait completed because a thread exited without releasing a mutex. This exception is not thrown on Windows 98 or Windows Millennium Edition. - waitHandles is an array with no elements, and the .NET Framework version is 2.0 or later. - The waitHandles array contains a transparent proxy for a in another application domain. - - - Waits for any of the elements in the specified array to receive a signal, using a to specify the time interval and specifying whether to exit the synchronization domain before the wait. - A WaitHandle array containing the objects for which the current instance will wait. - A that represents the number of milliseconds to wait, or a that represents -1 milliseconds to wait indefinitely. - true to exit the synchronization domain for the context before the wait (if in a synchronized context), and reacquire it afterward; otherwise, false. - The array index of the object that satisfied the wait, or if no object satisfied the wait and a time interval equivalent to timeout has passed. - The waitHandles parameter is null. -or- One or more of the objects in the waitHandles array is null. - The number of objects in waitHandles is greater than the system permits. - waitHandles is an array with no elements, and the .NET Framework version is 1.0 or 1.1. - timeout is a negative number other than -1 milliseconds, which represents an infinite time-out. -or- timeout is greater than . - The wait completed because a thread exited without releasing a mutex. This exception is not thrown on Windows 98 or Windows Millennium Edition. - waitHandles is an array with no elements, and the .NET Framework version is 2.0 or later. - The waitHandles array contains a transparent proxy for a in another application domain. - - - Blocks the current thread until the current receives a signal. - true if the current instance receives a signal. If the current instance is never signaled, never returns. - The current instance has already been disposed. - The wait completed because a thread exited without releasing a mutex. This exception is not thrown on Windows 98 or Windows Millennium Edition. - The current instance is a transparent proxy for a in another application domain. - - - Blocks the current thread until the current receives a signal, using a 32-bit signed integer to specify the time interval in milliseconds. - The number of milliseconds to wait, or (-1) to wait indefinitely. - true if the current instance receives a signal; otherwise, false. - The current instance has already been disposed. - millisecondsTimeout is a negative number other than -1, which represents an infinite time-out. - The wait completed because a thread exited without releasing a mutex. This exception is not thrown on Windows 98 or Windows Millennium Edition. - The current instance is a transparent proxy for a in another application domain. - - - Blocks the current thread until the current instance receives a signal, using a to specify the time interval. - A that represents the number of milliseconds to wait, or a that represents -1 milliseconds to wait indefinitely. - true if the current instance receives a signal; otherwise, false. - The current instance has already been disposed. - timeout is a negative number other than -1 milliseconds, which represents an infinite time-out. -or- timeout is greater than . - The wait completed because a thread exited without releasing a mutex. This exception is not thrown on Windows 98 or Windows Millennium Edition. - The current instance is a transparent proxy for a in another application domain. - - - Blocks the current thread until the current receives a signal, using a 32-bit signed integer to specify the time interval and specifying whether to exit the synchronization domain before the wait. - The number of milliseconds to wait, or (-1) to wait indefinitely. - true to exit the synchronization domain for the context before the wait (if in a synchronized context), and reacquire it afterward; otherwise, false. - true if the current instance receives a signal; otherwise, false. - The current instance has already been disposed. - millisecondsTimeout is a negative number other than -1, which represents an infinite time-out. - The wait completed because a thread exited without releasing a mutex. This exception is not thrown on Windows 98 or Windows Millennium Edition. - The current instance is a transparent proxy for a in another application domain. - - - Blocks the current thread until the current instance receives a signal, using a to specify the time interval and specifying whether to exit the synchronization domain before the wait. - A that represents the number of milliseconds to wait, or a that represents -1 milliseconds to wait indefinitely. - true to exit the synchronization domain for the context before the wait (if in a synchronized context), and reacquire it afterward; otherwise, false. - true if the current instance receives a signal; otherwise, false. - The current instance has already been disposed. - timeout is a negative number other than -1 milliseconds, which represents an infinite time-out. -or- timeout is greater than . - The wait completed because a thread exited without releasing a mutex. This exception is not thrown on Windows 98 or Windows Millennium Edition. - The current instance is a transparent proxy for a in another application domain. - - - Indicates that a operation timed out before any of the wait handles were signaled. This field is constant. - - - - The exception that is thrown when an attempt is made to open a system mutex, semaphore, or event wait handle that does not exist. - - - Initializes a new instance of the class with default values. - - - Initializes a new instance of the class with a specified error message. - The error message that explains the reason for the exception. - - - Initializes a new instance of the class with serialized data. - The object that holds the serialized object data about the exception being thrown. - The object that contains contextual information about the source or destination. - - - Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. - The error message that explains the reason for the exception. - The exception that is the cause of the current exception. If the innerException parameter is not null, the current exception is raised in a catch block that handles the inner exception. - - - Provides convenience methods to for working with a safe handle for a wait handle. - - - Gets the safe handle for a native operating system wait handle. - A native operating system handle. - The safe wait handle that wraps the native operating system wait handle. - waitHandle is null. - - - Sets a safe handle for a native operating system wait handle. - A wait handle that encapsulates an operating system-specific object that waits for exclusive access to a shared resource. - The safe handle to wrap the operating system handle. - waitHandle is null. - - - Represents a method to be called when a is signaled or times out. - An object containing information to be used by the callback method each time it executes. - true if the timed out; false if it was signaled. - - - Indicates that the value of a static field is unique for each thread. - - - Initializes a new instance of the class. - - - The exception that is thrown when the time allotted for a process or operation has expired. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with the specified error message. - The message that describes the error. - - - Initializes a new instance of the class with serialized data. - The object that contains serialized object data about the exception being thrown. - The object that contains contextual information about the source or destination. The context parameter is reserved for future use, and can be specified as null. - The info parameter is null. - The class name is null, or is zero (0). - - - Initializes a new instance of the class with the specified error message and inner exception. - The message that describes the error. - The exception that is the cause of the current exception. If the innerException parameter is not null, the current exception is raised in a catch block that handles the inner exception. - - - Provides data for the event. - - - Gets the date/time when the event was raised. - The time the event was raised. - - - Represents the method that will handle the event of a . - The source of the event. - An object that contains the event data. - - - Generates an event after a set interval, with an option to generate recurring events. - - - Initializes a new instance of the class, and sets all the properties to their initial values. - - - Initializes a new instance of the class, and sets the property to the specified number of milliseconds. - The time, in milliseconds, between events. The value must be greater than zero and less than or equal to . - The value of the interval parameter is less than or equal to zero, or greater than . - - - Gets or sets a Boolean indicating whether the should raise the event only once (false) or repeatedly (true). - true if the should raise the event each time the interval elapses; false if it should raise the event only once, after the first time the interval elapses. The default is true. - - - Begins the run-time initialization of a that is used on a form or by another component. - - - Releases the resources used by the . - - - Releases all resources used by the current . - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - Occurs when the interval elapses. - - - - Gets or sets a value indicating whether the should raise the event. - true if the should raise the event; otherwise, false. The default is false. - This property cannot be set because the timer has been disposed. - The property was set to a value greater than before the timer was enabled. - - - Ends the run-time initialization of a that is used on a form or by another component. - - - Gets or sets the interval, expressed in milliseconds, at which to raise the event. - The time, in milliseconds, between events. The value must be greater than zero, and less than or equal to . The default is 100 milliseconds. - The interval is less than or equal to zero. -or- The interval is greater than , and the timer is currently enabled. (If the timer is not currently enabled, no exception is thrown until it becomes enabled.) - - - Gets or sets the site that binds the to its container in design mode. - An interface representing the site that binds the object to its container. - - - Starts raising the event by setting to true. - The is created with an interval equal to or greater than + 1, or set to an interval less than zero. - - - Stops raising the event by setting to false. - - - Gets or sets the object used to marshal event-handler calls that are issued when an interval has elapsed. - The representing the object used to marshal the event-handler calls that are issued when an interval has elapsed. The default is null. - - - Sets the description that visual designers can display when referencing an event, extender, or property. - - - Initializes a new instance of the class. - The description to use. - - - Gets the description that visual designers can display when referencing an event, extender, or property. - The description for the event, extender, or property. - - - Represents a time interval. - - - Initializes a new instance of the structure to the specified number of ticks. - A time period expressed in 100-nanosecond units. - - - Initializes a new instance of the structure to a specified number of hours, minutes, and seconds. - Number of hours. - Number of minutes. - Number of seconds. - The parameters specify a value less than or greater than . - - - Initializes a new instance of the structure to a specified number of days, hours, minutes, and seconds. - Number of days. - Number of hours. - Number of minutes. - Number of seconds. - The parameters specify a value less than or greater than . - - - Initializes a new instance of the structure to a specified number of days, hours, minutes, seconds, and milliseconds. - Number of days. - Number of hours. - Number of minutes. - Number of seconds. - Number of milliseconds. - The parameters specify a value less than or greater than . - - - Returns a new object whose value is the sum of the specified object and this instance. - The time interval to add. - A new object that represents the value of this instance plus the value of ts. - The resulting is less than or greater than . - - - Compares two values and returns an integer that indicates whether the first value is shorter than, equal to, or longer than the second value. - The first time interval to compare. - The second time interval to compare. -

One of the following values.

-
Value

-

Description

-

-1

-

t1 is shorter than t2.

-

0

-

t1 is equal to t2.

-

1

-

t1 is longer than t2.

-

-
-
- - Compares this instance to a specified object and returns an integer that indicates whether this instance is shorter than, equal to, or longer than the specified object. - An object to compare, or null. -

One of the following values.

-
Value

-

Description

-

-1

-

This instance is shorter than value.

-

0

-

This instance is equal to value.

-

1

-

This instance is longer than value.

-

-or-

-

value is null.

-

-
- value is not a . -
- - Compares this instance to a specified object and returns an integer that indicates whether this instance is shorter than, equal to, or longer than the object. - An object to compare to this instance. -

A signed number indicating the relative values of this instance and value.

-
Value

-

Description

-

A negative integer

-

This instance is shorter than value.

-

Zero

-

This instance is equal to value.

-

A positive integer

-

This instance is longer than value.

-

-
-
- - Gets the days component of the time interval represented by the current structure. - The day component of this instance. The return value can be positive or negative. - - - Returns a new object whose value is the absolute value of the current object. - A new object whose value is the absolute value of the current object. - The value of this instance is . - - - Returns a value indicating whether this instance is equal to a specified object. - An object to compare with this instance. - true if value is a object that represents the same time interval as the current structure; otherwise, false. - - - Returns a value indicating whether this instance is equal to a specified object. - An object to compare with this instance. - true if obj represents the same time interval as this instance; otherwise, false. - - - Returns a value that indicates whether two specified instances of are equal. - The first time interval to compare. - The second time interval to compare. - true if the values of t1 and t2 are equal; otherwise, false. - - - Returns a that represents a specified number of days, where the specification is accurate to the nearest millisecond. - A number of days, accurate to the nearest millisecond. - An object that represents value. - value is less than or greater than . -or- value is . -or- value is . - value is equal to . - - - Returns a that represents a specified number of hours, where the specification is accurate to the nearest millisecond. - A number of hours accurate to the nearest millisecond. - An object that represents value. - value is less than or greater than . -or- value is . -or- value is . - value is equal to . - - - Returns a that represents a specified number of milliseconds. - A number of milliseconds. - An object that represents value. - value is less than or greater than . -or- value is . -or- value is . - value is equal to . - - - Returns a that represents a specified number of minutes, where the specification is accurate to the nearest millisecond. - A number of minutes, accurate to the nearest millisecond. - An object that represents value. - value is less than or greater than . -or- value is . -or- value is . - value is equal to . - - - Returns a that represents a specified number of seconds, where the specification is accurate to the nearest millisecond. - A number of seconds, accurate to the nearest millisecond. - An object that represents value. - value is less than or greater than . -or- value is . -or- value is . - value is equal to . - - - Returns a that represents a specified time, where the specification is in units of ticks. - A number of ticks that represent a time. - An object that represents value. - - - Returns a hash code for this instance. - A 32-bit signed integer hash code. - - - Gets the hours component of the time interval represented by the current structure. - The hour component of the current structure. The return value ranges from -23 through 23. - - - Represents the maximum value. This field is read-only. - - - - Gets the milliseconds component of the time interval represented by the current structure. - The millisecond component of the current structure. The return value ranges from -999 through 999. - - - Gets the minutes component of the time interval represented by the current structure. - The minute component of the current structure. The return value ranges from -59 through 59. - - - Represents the minimum value. This field is read-only. - - - - Returns a new object whose value is the negated value of this instance. - A new object with the same numeric value as this instance, but with the opposite sign. - The negated value of this instance cannot be represented by a ; that is, the value of this instance is . - - - Adds two specified instances. - The first time interval to add. - The second time interval to add. - An object whose value is the sum of the values of t1 and t2. - The resulting is less than or greater than . - - - Indicates whether two instances are equal. - The first time interval to compare. - The second time interval to compare. - true if the values of t1 and t2 are equal; otherwise, false. - - - Indicates whether a specified is greater than another specified . - The first time interval to compare. - The second time interval to compare. - true if the value of t1 is greater than the value of t2; otherwise, false. - - - Indicates whether a specified is greater than or equal to another specified . - The first time interval to compare. - The second time interval to compare. - true if the value of t1 is greater than or equal to the value of t2; otherwise, false. - - - Indicates whether two instances are not equal. - The first time interval to compare. - The second time interval to compare. - true if the values of t1 and t2 are not equal; otherwise, false. - - - Indicates whether a specified is less than another specified . - The first time interval to compare. - The second time interval to compare. - true if the value of t1 is less than the value of t2; otherwise, false. - - - Indicates whether a specified is less than or equal to another specified . - The first time interval to compare. - The second time interval to compare. - true if the value of t1 is less than or equal to the value of t2; otherwise, false. - - - Subtracts a specified from another specified . - The minuend. - The subtrahend. - An object whose value is the result of the value of t1 minus the value of t2. - The return value is less than or greater than . - - - Returns a whose value is the negated value of the specified instance. - The time interval to be negated. - An object that has the same numeric value as this instance, but the opposite sign. - The negated value of this instance cannot be represented by a ; that is, the value of this instance is . - - - Returns the specified instance of . - The time interval to return. - The time interval specified by t. - - - Converts the string representation of a time interval to its equivalent. - A string that specifies the time interval to convert. - A time interval that corresponds to s. - s is null. - s has an invalid format. - s represents a number that is less than or greater than . -or- At least one of the days, hours, minutes, or seconds components is outside its valid range. - - - Converts the string representation of a time interval to its equivalent by using the specified culture-specific format information. - A string that specifies the time interval to convert. - An object that supplies culture-specific formatting information. - A time interval that corresponds to input, as specified by formatProvider. - input is null. - input has an invalid format. - input represents a number that is less than or greater than . -or- At least one of the days, hours, minutes, or seconds components in input is outside its valid range. - - - Converts the string representation of a time interval to its equivalent by using the specified format and culture-specific format information. The format of the string representation must match the specified format exactly. - A string that specifies the time interval to convert. - A standard or custom format string that defines the required format of input. - An object that provides culture-specific formatting information. - A time interval that corresponds to input, as specified by format and formatProvider. - input is null. - input has an invalid format. - input represents a number that is less than or greater than . -or- At least one of the days, hours, minutes, or seconds components in input is outside its valid range. - - - Converts the string representation of a time interval to its equivalent by using the specified array of format strings and culture-specific format information. The format of the string representation must match one of the specified formats exactly. - A string that specifies the time interval to convert. - A array of standard or custom format strings that defines the required format of input. - An object that provides culture-specific formatting information. - A time interval that corresponds to input, as specified by formats and formatProvider. - input is null. - input has an invalid format. - input represents a number that is less than or greater than . -or- At least one of the days, hours, minutes, or seconds components in input is outside its valid range. - - - Converts the string representation of a time interval to its equivalent by using the specified format, culture-specific format information, and styles. The format of the string representation must match the specified format exactly. - A string that specifies the time interval to convert. - A standard or custom format string that defines the required format of input. - An object that provides culture-specific formatting information. - A bitwise combination of enumeration values that defines the style elements that may be present in input. - A time interval that corresponds to input, as specified by format, formatProvider, and styles. - styles is an invalid value. - input is null. - input has an invalid format. - input represents a number that is less than or greater than . -or- At least one of the days, hours, minutes, or seconds components in input is outside its valid range. - - - Converts the string representation of a time interval to its equivalent by using the specified formats, culture-specific format information, and styles. The format of the string representation must match one of the specified formats exactly. - A string that specifies the time interval to convert. - A array of standard or custom format strings that define the required format of input. - An object that provides culture-specific formatting information. - A bitwise combination of enumeration values that defines the style elements that may be present in input. - A time interval that corresponds to input, as specified by formats, formatProvider, and styles. - styles is an invalid value. - input is null. - input has an invalid format. - input represents a number that is less than or greater than . -or- At least one of the days, hours, minutes, or seconds components in input is outside its valid range. - - - Gets the seconds component of the time interval represented by the current structure. - The second component of the current structure. The return value ranges from -59 through 59. - - - Returns a new object whose value is the difference between the specified object and this instance. - The time interval to be subtracted. - A new time interval whose value is the result of the value of this instance minus the value of ts. - The return value is less than or greater than . - - - Gets the number of ticks that represent the value of the current structure. - The number of ticks contained in this instance. - - - Represents the number of ticks in 1 day. This field is constant. - - - - Represents the number of ticks in 1 hour. This field is constant. - - - - Represents the number of ticks in 1 millisecond. This field is constant. - - - - Represents the number of ticks in 1 minute. This field is constant. - - - - Represents the number of ticks in 1 second. - - - - Converts the value of the current object to its equivalent string representation. - The string representation of the current value. - - - Converts the value of the current object to its equivalent string representation by using the specified format. - A standard or custom format string. - The string representation of the current value in the format specified by the format parameter. - The format parameter is not recognized or is not supported. - - - Converts the value of the current object to its equivalent string representation by using the specified format and culture-specific formatting information. - A standard or custom format string. - An object that supplies culture-specific formatting information. - The string representation of the current value, as specified by format and formatProvider. - The format parameter is not recognized or is not supported. - - - Gets the value of the current structure expressed in whole and fractional days. - The total number of days represented by this instance. - - - Gets the value of the current structure expressed in whole and fractional hours. - The total number of hours represented by this instance. - - - Gets the value of the current structure expressed in whole and fractional milliseconds. - The total number of milliseconds represented by this instance. - - - Gets the value of the current structure expressed in whole and fractional minutes. - The total number of minutes represented by this instance. - - - Gets the value of the current structure expressed in whole and fractional seconds. - The total number of seconds represented by this instance. - - - Converts the string representation of a time interval to its equivalent and returns a value that indicates whether the conversion succeeded. - A string that specifies the time interval to convert. - When this method returns, contains an object that represents the time interval specified by s, or if the conversion failed. This parameter is passed uninitialized. - true if s was converted successfully; otherwise, false. This operation returns false if the s parameter is null or , has an invalid format, represents a time interval that is less than or greater than , or has at least one days, hours, minutes, or seconds component outside its valid range. - - - Converts the string representation of a time interval to its equivalent by using the specified culture-specific formatting information, and returns a value that indicates whether the conversion succeeded. - A string that specifies the time interval to convert. - An object that supplies culture-specific formatting information. - When this method returns, contains an object that represents the time interval specified by input, or if the conversion failed. This parameter is passed uninitialized. - true if input was converted successfully; otherwise, false. This operation returns false if the input parameter is null or , has an invalid format, represents a time interval that is less than or greater than , or has at least one days, hours, minutes, or seconds component outside its valid range. - - - Converts the string representation of a time interval to its equivalent by using the specified format, culture-specific format information, and styles, and returns a value that indicates whether the conversion succeeded. The format of the string representation must match the specified format exactly. - A string that specifies the time interval to convert. - A standard or custom format string that defines the required format of input. - An object that provides culture-specific formatting information. - One or more enumeration values that indicate the style of input. - When this method returns, contains an object that represents the time interval specified by input, or if the conversion failed. This parameter is passed uninitialized. - true if input was converted successfully; otherwise, false. - - - Converts the specified string representation of a time interval to its equivalent by using the specified formats and culture-specific format information, and returns a value that indicates whether the conversion succeeded. The format of the string representation must match one of the specified formats exactly. - A string that specifies the time interval to convert. - A array of standard or custom format strings that define the acceptable formats of input. - An object that provides culture-specific formatting information. - When this method returns, contains an object that represents the time interval specified by input, or if the conversion failed. This parameter is passed uninitialized. - true if input was converted successfully; otherwise, false. - - - Converts the specified string representation of a time interval to its equivalent by using the specified formats, culture-specific format information, and styles, and returns a value that indicates whether the conversion succeeded. The format of the string representation must match one of the specified formats exactly. - A string that specifies the time interval to convert. - A array of standard or custom format strings that define the acceptable formats of input. - An object that supplies culture-specific formatting information. - One or more enumeration values that indicate the style of input. - When this method returns, contains an object that represents the time interval specified by input, or if the conversion failed. This parameter is passed uninitialized. - true if input was converted successfully; otherwise, false. - - - Converts the string representation of a time interval to its equivalent by using the specified format and culture-specific format information, and returns a value that indicates whether the conversion succeeded. The format of the string representation must match the specified format exactly. - A string that specifies the time interval to convert. - A standard or custom format string that defines the required format of input. - An object that supplies culture-specific formatting information. - When this method returns, contains an object that represents the time interval specified by input, or if the conversion failed. This parameter is passed uninitialized. - true if input was converted successfully; otherwise, false. - - - Represents the zero value. This field is read-only. - - - - Represents a time zone. - - - Initializes a new instance of the class. - - - Gets the time zone of the current computer. - A object that represents the current local time zone. - - - Gets the daylight saving time zone name. - The daylight saving time zone name. - - - Returns the daylight saving time period for a particular year. - The year that the daylight saving time period applies to. - A object that contains the start and end date for daylight saving time in year. - year is less than 1 or greater than 9999. - - - Returns the Coordinated Universal Time (UTC) offset for the specified local time. - A date and time value. - The Coordinated Universal Time (UTC) offset from time. - - - Returns a value indicating whether the specified date and time is within a daylight saving time period. - A date and time. - true if time is in a daylight saving time period; otherwise, false. - - - Returns a value indicating whether the specified date and time is within the specified daylight saving time period. - A date and time. - - true if time is in daylightTimes; otherwise, false. - daylightTimes is null. - - - Gets the standard time zone name. - The standard time zone name. - An attempt was made to set this property to null. - - - Returns the local time that corresponds to a specified date and time value. - A Coordinated Universal Time (UTC) time. - A object whose value is the local time that corresponds to time. - - - Returns the Coordinated Universal Time (UTC) that corresponds to a specified time. - A date and time. - A object whose value is the Coordinated Universal Time (UTC) that corresponds to time. - - - Provides information about a time zone adjustment, such as the transition to and from daylight saving time. - - - Creates a new adjustment rule for a particular time zone. - The effective date of the adjustment rule. If the value of the dateStart parameter is DateTime.MinValue.Date, this is the first adjustment rule in effect for a time zone. - The last date that the adjustment rule is in force. If the value of the dateEnd parameter is DateTime.MaxValue.Date, the adjustment rule has no end date. - The time change that results from the adjustment. This value is added to the time zone's property to obtain the correct daylight offset from Coordinated Universal Time (UTC). This value can range from -14 to 14. - An object that defines the start of daylight saving time. - An object that defines the end of daylight saving time. - An object that represents the new adjustment rule. - The property of the dateStart or dateEnd parameter does not equal . -or- The daylightTransitionStart parameter is equal to the daylightTransitionEnd parameter. -or- The dateStart or dateEnd parameter includes a time of day value. - dateEnd is earlier than dateStart. -or- daylightDelta is less than -14 or greater than 14. -or- The property of the daylightDelta parameter is not equal to 0. -or- The property of the daylightDelta parameter does not equal a whole number of seconds. - - - Gets the date when the adjustment rule ceases to be in effect. - A value that indicates the end date of the adjustment rule. - - - Gets the date when the adjustment rule takes effect. - A value that indicates when the adjustment rule takes effect. - - - Gets the amount of time that is required to form the time zone's daylight saving time. This amount of time is added to the time zone's offset from Coordinated Universal Time (UTC). - A object that indicates the amount of time to add to the standard time changes as a result of the adjustment rule. - - - Gets information about the annual transition from daylight saving time back to standard time. - A object that defines the annual transition from daylight saving time back to the time zone's standard time. - - - Gets information about the annual transition from standard time to daylight saving time. - A object that defines the annual transition from a time zone's standard time to daylight saving time. - - - Determines whether the current object is equal to a second object. - The object to compare with the current object. - true if both objects have equal values; otherwise, false. - - - Serves as a hash function for hashing algorithms and data structures such as hash tables. - A 32-bit signed integer that serves as the hash code for the current object. - - - Runs when the deserialization of a object is completed. - The object that initiated the callback. The functionality for this parameter is not currently implemented. - - - Populates a object with the data that is required to serialize this object. - The object to populate with data. - The destination for this serialization (see ). - - - Provides information about a specific time change, such as the change from daylight saving time to standard time or vice versa, in a particular time zone. - - - Defines a time change that uses a fixed-date rule (that is, a time change that occurs on a specific day of a specific month). - The time at which the time change occurs. This parameter corresponds to the property. - The month in which the time change occurs. This parameter corresponds to the property. - The day of the month on which the time change occurs. This parameter corresponds to the property. - Data about the time change. - The timeOfDay parameter has a non-default date component. -or- The timeOfDay parameter's property is not . -or- The timeOfDay parameter does not represent a whole number of milliseconds. - The month parameter is less than 1 or greater than 12. -or- The day parameter is less than 1 or greater than 31. - - - Defines a time change that uses a floating-date rule (that is, a time change that occurs on a specific day of a specific week of a specific month). - The time at which the time change occurs. This parameter corresponds to the property. - The month in which the time change occurs. This parameter corresponds to the property. - The week of the month in which the time change occurs. Its value can range from 1 to 5, with 5 representing the last week of the month. This parameter corresponds to the property. - The day of the week on which the time change occurs. This parameter corresponds to the property. - Data about the time change. - The timeOfDay parameter has a non-default date component. -or- The timeOfDay parameter does not represent a whole number of milliseconds. -or- The timeOfDay parameter's property is not . - month is less than 1 or greater than 12. -or- week is less than 1 or greater than 5. -or- The dayOfWeek parameter is not a member of the enumeration. - - - Gets the day on which the time change occurs. - The day on which the time change occurs. - - - Gets the day of the week on which the time change occurs. - The day of the week on which the time change occurs. - - - Determines whether an object has identical values to the current object. - An object to compare with the current object. - true if the two objects are equal; otherwise, false. - - - Determines whether the current object has identical values to a second object. - An object to compare to the current instance. - true if the two objects have identical property values; otherwise, false. - - - Serves as a hash function for hashing algorithms and data structures such as hash tables. - A 32-bit signed integer that serves as the hash code for this object. - - - Gets a value indicating whether the time change occurs at a fixed date and time (such as November 1) or a floating date and time (such as the last Sunday of October). - true if the time change rule is fixed-date; false if the time change rule is floating-date. - - - Gets the month in which the time change occurs. - The month in which the time change occurs. - - - Determines whether two specified objects are equal. - The first object to compare. - The second object to compare. - true if t1 and t2 have identical values; otherwise, false. - - - Determines whether two specified objects are not equal. - The first object to compare. - The second object to compare. - true if t1 and t2 have any different member values; otherwise, false. - - - Gets the hour, minute, and second at which the time change occurs. - The time of day at which the time change occurs. - - - Gets the week of the month in which a time change occurs. - The week of the month in which the time change occurs. - - - Runs when the deserialization of an object has been completed. - The object that initiated the callback. The functionality for this parameter is not currently implemented. - - - Populates a object with the data that is required to serialize this object. - The object to populate with data. - The destination for this serialization (see ). - - - Represents any time zone in the world. - - - Gets the time difference between the current time zone's standard time and Coordinated Universal Time (UTC). - An object that indicates the time difference between the current time zone's standard time and Coordinated Universal Time (UTC). - - - Clears cached time zone data. - - - Converts a time to the time in a particular time zone. - The date and time to convert. - The time zone to convert dateTime to. - The date and time in the destination time zone. - The value of the dateTime parameter represents an invalid time. - The value of the destinationTimeZone parameter is null. - - - Converts a time to the time in a particular time zone. - The date and time to convert. - The time zone to convert dateTime to. - The date and time in the destination time zone. - The value of the destinationTimeZone parameter is null. - - - Converts a time from one time zone to another. - The date and time to convert. - The time zone of dateTime. - The time zone to convert dateTime to. - The date and time in the destination time zone that corresponds to the dateTime parameter in the source time zone. - The property of the dateTime parameter is , but the sourceTimeZone parameter does not equal . -or- The property of the dateTime parameter is , but the sourceTimeZone parameter does not equal . -or- The dateTime parameter is an invalid time (that is, it represents a time that does not exist because of a time zone's adjustment rules). - The sourceTimeZone parameter is null. -or- The destinationTimeZone parameter is null. - - - Converts a time to the time in another time zone based on the time zone's identifier. - The date and time to convert. - The identifier of the destination time zone. - The date and time in the destination time zone. - destinationTimeZoneId is null. - The time zone identifier was found, but the registry data is corrupted. - The process does not have the permissions required to read from the registry key that contains the time zone information. - The destinationTimeZoneId identifier was not found on the local system. - - - Converts a time to the time in another time zone based on the time zone's identifier. - The date and time to convert. - The identifier of the destination time zone. - The date and time in the destination time zone. - destinationTimeZoneId is null. - The time zone identifier was found but the registry data is corrupted. - The process does not have the permissions required to read from the registry key that contains the time zone information. - The destinationTimeZoneId identifier was not found on the local system. - - - Converts a time from one time zone to another based on time zone identifiers. - The date and time to convert. - The identifier of the source time zone. - The identifier of the destination time zone. - The date and time in the destination time zone that corresponds to the dateTime parameter in the source time zone. - The property of the dateTime parameter does not correspond to the source time zone. -or- dateTime is an invalid time in the source time zone. - sourceTimeZoneId is null. -or- destinationTimeZoneId is null. - The time zone identifiers were found, but the registry data is corrupted. - The user does not have the permissions required to read from the registry keys that hold time zone data. - The sourceTimeZoneId identifier was not found on the local system. -or- The destinationTimeZoneId identifier was not found on the local system. - - - Converts a Coordinated Universal Time (UTC) to the time in a specified time zone. - The Coordinated Universal Time (UTC). - The time zone to convert dateTime to. - The date and time in the destination time zone. Its property is if destinationTimeZone is ; otherwise, its property is . - The property of dateTime is . - destinationTimeZone is null. - - - Converts the time in a specified time zone to Coordinated Universal Time (UTC). - The date and time to convert. - The time zone of dateTime. - The Coordinated Universal Time (UTC) that corresponds to the dateTime parameter. The object's property is always set to . - dateTime.Kind is and sourceTimeZone does not equal . -or- dateTime.Kind is and sourceTimeZone does not equal . -or- sourceTimeZone.IsInvalidDateTime(dateTime) returns true. - sourceTimeZone is null. - - - Converts the specified date and time to Coordinated Universal Time (UTC). - The date and time to convert. - The Coordinated Universal Time (UTC) that corresponds to the dateTime parameter. The value's property is always set to . - TimeZoneInfo.Local.IsInvalidDateTime(dateTime) returns true. - - - Creates a custom time zone with a specified identifier, an offset from Coordinated Universal Time (UTC), a display name, and a standard time display name. - The time zone's identifier. - An object that represents the time difference between this time zone and Coordinated Universal Time (UTC). - The display name of the new time zone. - The name of the new time zone's standard time. - The new time zone. - The id parameter is null. - The id parameter is an empty string (""). -or- The baseUtcOffset parameter does not represent a whole number of minutes. - The baseUtcOffset parameter is greater than 14 hours or less than -14 hours. - - - Creates a custom time zone with a specified identifier, an offset from Coordinated Universal Time (UTC), a display name, a standard time name, a daylight saving time name, and daylight saving time rules. - The time zone's identifier. - An object that represents the time difference between this time zone and Coordinated Universal Time (UTC). - The display name of the new time zone. - The new time zone's standard time name. - The daylight saving time name of the new time zone. - An array that augments the base UTC offset for a particular period. - A object that represents the new time zone. - The id parameter is null. - The id parameter is an empty string (""). -or- The baseUtcOffset parameter does not represent a whole number of minutes. - The baseUtcOffset parameter is greater than 14 hours or less than -14 hours. - The adjustment rules specified in the adjustmentRules parameter overlap. -or- The adjustment rules specified in the adjustmentRules parameter are not in chronological order. -or- One or more elements in adjustmentRules are null. -or- A date can have multiple adjustment rules applied to it. -or- The sum of the baseUtcOffset parameter and the value of one or more objects in the adjustmentRules array is greater than 14 hours or less than -14 hours. - - - Creates a custom time zone with a specified identifier, an offset from Coordinated Universal Time (UTC), a display name, a standard time name, a daylight saving time name, daylight saving time rules, and a value that indicates whether the returned object reflects daylight saving time information. - The time zone's identifier. - A object that represents the time difference between this time zone and Coordinated Universal Time (UTC). - The display name of the new time zone. - The standard time name of the new time zone. - The daylight saving time name of the new time zone. - An array of objects that augment the base UTC offset for a particular period. - true to discard any daylight saving time-related information present in adjustmentRules with the new object; otherwise, false. - The new time zone. If the disableDaylightSavingTime parameter is true, the returned object has no daylight saving time data. - The id parameter is null. - The id parameter is an empty string (""). -or- The baseUtcOffset parameter does not represent a whole number of minutes. - The baseUtcOffset parameter is greater than 14 hours or less than -14 hours. - The adjustment rules specified in the adjustmentRules parameter overlap. -or- The adjustment rules specified in the adjustmentRules parameter are not in chronological order. -or- One or more elements in adjustmentRules are null. -or- A date can have multiple adjustment rules applied to it. -or- The sum of the baseUtcOffset parameter and the value of one or more objects in the adjustmentRules array is greater than 14 hours or less than -14 hours. - - - Gets the display name for the current time zone's daylight saving time. - The display name for the time zone's daylight saving time. - - - Gets the general display name that represents the time zone. - The time zone's general display name. - - - Determines whether the current object and another object are equal. - A second object to compare with the current object. - true if obj is a object that is equal to the current instance; otherwise, false. - - - Determines whether the current object and another object are equal. - A second object to compare with the current object. - true if the two objects are equal; otherwise, false. - - - Retrieves a object from the registry based on its identifier. - The time zone identifier, which corresponds to the property. - An object whose identifier is the value of the id parameter. - The system does not have enough memory to hold information about the time zone. - The id parameter is null. - The time zone identifier specified by id was not found. This means that a registry key whose name matches id does not exist, or that the key exists but does not contain any time zone data. - The process does not have the permissions required to read from the registry key that contains the time zone information. - The time zone identifier was found, but the registry data is corrupted. - - - Deserializes a string to re-create an original serialized object. - The string representation of the serialized object. - The original serialized object. - The source parameter is . - The source parameter is a null string. - The source parameter cannot be deserialized back into a object. - - - Retrieves an array of objects that apply to the current object. - An array of objects for this time zone. - The system does not have enough memory to make an in-memory copy of the adjustment rules. - - - Returns information about the possible dates and times that an ambiguous date and time can be mapped to. - A date and time. - An array of objects that represents possible Coordinated Universal Time (UTC) offsets that a particular date and time can be mapped to. - dateTime is not an ambiguous time. - - - Returns information about the possible dates and times that an ambiguous date and time can be mapped to. - A date and time. - An array of objects that represents possible Coordinated Universal Time (UTC) offsets that a particular date and time can be mapped to. - dateTimeOffset is not an ambiguous time. - - - Serves as a hash function for hashing algorithms and data structures such as hash tables. - A 32-bit signed integer that serves as the hash code for this object. - - - Returns a sorted collection of all the time zones about which information is available on the local system. - A read-only collection of objects. - There is insufficient memory to store all time zone information. - The user does not have permission to read from the registry keys that contain time zone information. - - - Calculates the offset or difference between the time in this time zone and Coordinated Universal Time (UTC) for a particular date and time. - The date and time to determine the offset for. - An object that indicates the time difference between the two time zones. - - - Calculates the offset or difference between the time in this time zone and Coordinated Universal Time (UTC) for a particular date and time. - The date and time to determine the offset for. - An object that indicates the time difference between Coordinated Universal Time (UTC) and the current time zone. - - - Indicates whether the current object and another object have the same adjustment rules. - A second object to compare with the current object. - true if the two time zones have identical adjustment rules and an identical base offset; otherwise, false. - The other parameter is null. - - - Gets the time zone identifier. - The time zone identifier. - - - Determines whether a particular date and time in a particular time zone is ambiguous and can be mapped to two or more Coordinated Universal Time (UTC) times. - A date and time value. - true if the dateTime parameter is ambiguous; otherwise, false. - The property of the dateTime value is and dateTime is an invalid time. - - - Determines whether a particular date and time in a particular time zone is ambiguous and can be mapped to two or more Coordinated Universal Time (UTC) times. - A date and time. - true if the dateTimeOffset parameter is ambiguous in the current time zone; otherwise, false. - - - Indicates whether a specified date and time falls in the range of daylight saving time for the time zone of the current object. - A date and time value. - true if the dateTimeOffset parameter is a daylight saving time; otherwise, false. - - - Indicates whether a specified date and time falls in the range of daylight saving time for the time zone of the current object. - A date and time value. - true if the dateTime parameter is a daylight saving time; otherwise, false. - The property of the dateTime value is and dateTime is an invalid time. - - - Indicates whether a particular date and time is invalid. - A date and time value. - true if dateTime is invalid; otherwise, false. - - - Gets a object that represents the local time zone. - An object that represents the local time zone. - - - Gets the display name for the time zone's standard time. - The display name of the time zone's standard time. - - - Gets a value indicating whether the time zone has any daylight saving time rules. - true if the time zone supports daylight saving time; otherwise, false. - - - Converts the current object to a serialized string. - A string that represents the current object. - - - Returns the current object's display name. - The value of the property of the current object. - - - Gets a object that represents the Coordinated Universal Time (UTC) zone. - An object that represents the Coordinated Universal Time (UTC) zone. - - - Runs when the deserialization of an object has been completed. - The object that initiated the callback. The functionality for this parameter is not currently implemented. - The object contains invalid or corrupted data. - - - Populates a object with the data needed to serialize the current object. - The object to populate with data. - The destination for this serialization (see ). - The info parameter is null. - - - The exception that is thrown when a time zone cannot be found. - - - Initializes a new instance of the class with a system-supplied message. - - - Initializes a new instance of the class with the specified message string. - A string that describes the exception. - - - Initializes a new instance of the class from serialized data. - The object that contains the serialized data. - The stream that contains the serialized data. - The info parameter is null. -or- The context parameter is null. - - - Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. - A string that describes the exception. - The exception that is the cause of the current exception. - - - Describes a committable transaction. - - - Initializes a new instance of the class. - An attempt to create a transaction under Windows 98, Windows 98 Second Edition or Windows Millennium Edition. - - - Initializes a new instance of the class with the specified timeout value. - The maximum amount of time the transaction can exist, before it is aborted. - An attempt to create a transaction under Windows 98, Windows 98 Second Edition or Windows Millennium Edition. - - - Initializes a new instance of the class with the specified transaction options. - A structure that describes the transaction options to use for the new transaction. - An attempt to create a transaction under Windows 98, Windows 98 Second Edition or Windows Millennium Edition. - options is invalid. - - - Begins an attempt to commit the transaction asynchronously. - - - An interface that can be used by the caller to check the status of the asynchronous operation, or to wait for the operation to complete. - - - Attempts to commit the transaction. - is called on a transaction and the transaction becomes . - is called and the transaction rolls back for the first time. - - - Ends an attempt to commit the transaction asynchronously. - - is called and the transaction rolls back for the first time. - - - Gets the object provided as the last parameter of the method call. - The object provided as the last parameter of the method call. - - - Gets a that is used to wait for an asynchronous operation to complete. - A that is used to wait for an asynchronous operation to complete. - - - Gets an indication of whether the asynchronous commit operation completed synchronously. - true if the asynchronous commit operation completed synchronously; otherwise, false. This property always returns false even if the operation completed synchronously. - - - Gets an indication whether the asynchronous commit operation has completed. - true if the operation is complete; otherwise, false. - - - Controls what kind of dependent transaction to create. - - - The dependent transaction blocks the commit process of the transaction until the parent transaction times out, or is called. In this case, additional work can be done on the transaction and new enlistments can be created. - - - - The dependent transaction automatically aborts the transaction if Commit is called on the parent transaction before is called. - - - - Describes a clone of a transaction providing guarantee that the transaction cannot be committed until the application comes to rest regarding work on the transaction. This class cannot be inherited. - - - Attempts to complete the dependent transaction. - Any attempt for additional work on the transaction after this method is called. These include invoking methods such as , , , , or any serialization operations on the transaction. - - - Facilitates communication between an enlisted transaction participant and the transaction manager during the final phase of the transaction. - - - Indicates that the transaction participant has completed its work. - - - Determines whether the object should be enlisted during the prepare phase. - - - The object must enlist during the initial phase of the commitment process. - - - - The object does not require enlistment during the initial phase of the commitment process. - - - - Specifies how distributed transactions interact with COM+ transactions. - - - Search for an existing COM+ context and synchronize with it if one exists. - - - - The context (which can be retrieved by calling the static method of the class) and the ambient transaction (which can be retrieved by calling the static method of the class) are always synchronized. This introduces a performance penalty because new contexts may need to be created. - - - - There is no synchronization between and . - - - - Provides a mechanism for the hosting environment to supply its own default notion of . - - - - Describes a DTC transaction. - - - Aborts a transaction. - - - - - - Commits a transaction. - - - - - - Retrieves information about a transaction. - - - - Describes an interface that a resource manager should implement to provide two phase commit notification callbacks for the transaction manager upon enlisting for participation. - - - Notifies an enlisted object that a transaction is being committed. - An object used to send a response to the transaction manager. - - - Notifies an enlisted object that the status of a transaction is in doubt. - An object used to send a response to the transaction manager. - - - Notifies an enlisted object that a transaction is being prepared for commitment. - A object used to send a response to the transaction manager. - - - Notifies an enlisted object that a transaction is being rolled back (aborted). - A object used to send a response to the transaction manager. - - - Describes an object that acts as a commit delegate for a non-distributed transaction internal to a resource manager. - - - Notifies a transaction participant that enlistment has completed successfully. - An attempt to enlist or serialize a transaction. - - - Notifies an enlisted object that the transaction is being rolled back. - - - - Notifies an enlisted object that the transaction is being committed. - - - - Represents a transaction that is not a root transaction, but can be escalated to be managed by the MSDTC. - - - Notifies an enlisted object that the transaction is being rolled back. - - - Describes a resource object that supports single phase commit optimization to participate in a transaction. - - - Represents the resource manager's implementation of the callback for the single phase commit optimization. - - - - Specifies the isolation level of a transaction. - - - The pending changes from more highly isolated transactions cannot be overwritten. - - - - Volatile data cannot be read during the transaction, but can be modified. - - - - Volatile data can be read and modified during the transaction. - - - - Volatile data can be read but not modified during the transaction. New data can be added during the transaction. - - - - Volatile data can be read but not modified, and no new data can be added during the transaction. - - - - Volatile data can be read. Before a transaction modifies data, it verifies if another transaction has changed the data after it was initially read. If the data has been updated, an error is raised. This allows a transaction to get to the previously committed value of the data. - - - - A different isolation level than the one specified is being used, but the level cannot be determined. An exception is thrown if this value is set. - - - - Describes a delegated transaction for an existing transaction that can be escalated to be managed by the MSDTC when needed. - - - Notifies an enlisted object that an escalation of the delegated transaction has been requested. - A transmitter/receiver propagation token that marshals a distributed transaction. For more information, see . - - - Facilitates communication between an enlisted transaction participant and the transaction manager during the Prepare phase of the transaction. - - - Indicates that the transaction should be rolled back. - - - Indicates that the transaction should be rolled back. - - - - Indicates that the transaction can be committed. - - - Gets the recovery information of an enlistment. - The recovery information of an enlistment. - An attempt to get recovery information inside a volatile enlistment, which does not generate any recovery information. - - - Provides a set of callbacks that facilitate communication between a participant enlisted for Single Phase Commit and the transaction manager when the notification is received. - - - Represents a callback that is used to indicate to the transaction manager that the transaction should be rolled back. - - - Represents a callback that is used to indicate to the transaction manager that the transaction should be rolled back, and provides an explanation. - An explanation of why a rollback is initiated. - - - Represents a callback that is used to indicate to the transaction manager that the SinglePhaseCommit was successful. - - - Represents a callback that is used to indicate to the transaction manager that the status of the transaction is in doubt. - - - Represents a callback that is used to indicate to the transaction manager that the status of the transaction is in doubt, and provides an explanation. - An explanation of why the transaction is in doubt. - - - Represents a non-rooted transaction that can be delegated. This class cannot be inherited. - - - Initializes a new instance of the class. - - A - - - Represents a transaction. - - - Creates a clone of the transaction. - A that is a copy of the current transaction object. - - - Gets or sets the ambient transaction. - A that describes the current transaction. - - - Creates a dependent clone of the transaction. - - A that represents the dependent clone. - - - Releases the resources that are held by the object. - - - Enlists a durable resource manager that supports two phase commit to participate in a transaction. - - - - An object that describes the enlistment. - - - Enlists a durable resource manager that supports single phase commit optimization to participate in a transaction. - - - - An object that describes the enlistment. - - - Enlists a resource manager that has an internal transaction using a promotable single phase enlistment (PSPE). - - A interface implementation that describes the enlistment. - - - Enlists a resource manager that has an internal transaction using a promotable single phase enlistment (PSPE). - A interface implemented by the participant. - The type of the distributed transaction processor. - A interface implementation that describes the enlistment. - - - Enlists a volatile resource manager that supports two phase commit to participate in a transaction. - - - An object that describes the enlistment. - - - Enlists a volatile resource manager that supports single phase commit optimization to participate in a transaction. - - - An object that describes the enlistment. - - - Determines whether this transaction and the specified object are equal. - The object to compare with this instance. - true if obj and this transaction are identical; otherwise, false. - - - Returns the hash code for this instance. - A 32-bit signed integer hash code. - - - Gets the byte[] returned by the Promote method when the transaction is promoted. - The byte[] returned by the Promote method when the transaction is promoted. - - - Gets the isolation level of the transaction. - One of the values that indicates the isolation level of the transaction. - - - Tests whether two specified instances are equivalent. - The instance that is to the left of the equality operator. - The instance that is to the right of the equality operator. - true if x and y are equal; otherwise, false. - - - Returns a value that indicates whether two instances are not equal. - The instance that is to the left of the inequality operator. - The instance that is to the right of the inequality operator. - true if x and y are not equal; otherwise, false. - - - [Supported in the .NET Framework 4.5.2 and later versions] Promotes and enlists a durable resource manager that supports two phase commit to participate in a transaction. - - An object that acts as a commit delegate for a non-distributed transaction internal to a resource manager. - - - - - - Uniquely identifies the format of the byte[] returned by the Promote method when the transaction is promoted. - A guid that uniquely identifies the format of the byte[] returned by the Promote method when the transaction is promoted. - - - Rolls back (aborts) the transaction. - - - Rolls back (aborts) the transaction. - - - - Sets the distributed transaction identifier generated by the non-MSDTC promoter. - A interface implemented by the participant. - The identifier for the transaction used by the distributed transaction manager. - - - Indicates that the transaction is completed. - - An attempt to subscribe this event on a transaction that has been disposed. - - - Retrieves additional information about a transaction. - A that contains additional information about the transaction. - - - Gets a with the data required to serialize this transaction. - - The destination (see ) for this serialization. - - - The exception that is thrown when an operation is attempted on a transaction that has already been rolled back, or an attempt is made to commit the transaction and the transaction aborts. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with the specified message. - A that contains a message that explains why the exception occurred. - - - Initializes a new instance of the class with the specified serialization and streaming context information. - A object that describes a failed serialization. - A object that describes a failed serialization context. - - - Initializes a new instance of the class with the specified message and inner exception. - A that contains a message that explains why the exception occurred. - Gets the exception instance that causes the current exception. For more information, see the property. - - - Represents the method that handles the event of a class. - The source of the event. - The that contains the event data. - - - Provides data for the following transaction events: , . - - - Initializes a new instance of the class. - - - Gets the transaction for which event status is provided. - A for which event status is provided. - - - The exception that is thrown when you attempt to do work on a transaction that cannot accept new work. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with the specified message. - A that contains a message that explains why the exception occurred. - - - Initializes a new instance of the class with the specified serialization and streaming context information. - A object that describes a failed serialization. - A object that describes a failed serialization context. - - - Initializes a new instance of the class with the specified message and inner exception. - A that contains a message that explains why the exception occurred. - Gets the exception instance that causes the current exception. For more information, see the property. - - - The exception that is thrown when an operation is attempted on a transaction that is in doubt, or an attempt is made to commit the transaction and the transaction becomes InDoubt. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with the specified message. - A that contains a message that explains why the exception occurred. - - - Initializes a new instance of the class with the specified serialization and streaming context information. - A object that describes a failed serialization. - A object that describes a failed serialization context. - - - Initializes a new instance of the class with the specified message and inner exception. - A that contains a message that explains why the exception occurred. - Gets the exception instance that causes the current exception. For more information, see the property. - - - Provides additional information regarding a transaction. - - - Gets the creation time of the transaction. - A that contains the creation time of the transaction. - - - Gets a unique identifier of the escalated transaction. - A that contains the unique identifier of the escalated transaction. - - - Gets a unique identifier of the transaction. - A unique identifier of the transaction. - - - Gets the status of the transaction. - A that contains the status of the transaction. - - - Facilitates interaction between and components that were previously written to interact with MSDTC, COM+, or . This class cannot be inherited. - - - Gets an instance that represents a . - A instance to be marshaled. - An instance that represents a . The instance is compatible with the unmanaged form of ITransaction used by MSDTC and with the Managed form of used by . - - - Transforms a transaction object into an export transaction cookie. - The object to be marshaled. - - An export transaction cookie representing the specified object. - - - Generates a from a specified . - - A instance that represents the given . - - - Generates a from the specified an export cookie. - - A from the specified export cookie. - - - Generates a instance from the specified transmitter propagation token. - - A from the specified transmitter propagation token. - The deserialization of a transaction fails because the transaction manager cannot be contacted. This may be caused by network firewall or security settings. - - - Generates a propagation token for the specified . - A transaction to be marshaled into a propagation token. - This method, together with the method, provide functionality for Transmitter/Receiver propagation, in which the transaction is "pulled" from the remote machine when the latter is called to unmarshal the transaction. For more information on different propagation models, see class. - - - Gets the Whereabouts of the distributed transaction manager that uses. - The Whereabouts of the distributed transaction manager that uses. - - - The type of the distributed transaction processor. - - - - Contains methods used for transaction management. This class cannot be inherited. - - - Gets the default timeout interval for new transactions. - A value that specifies the timeout interval for new transactions. - - - Indicates that a distributed transaction has started. - - - - Gets or sets a custom transaction factory. - A that contains a custom transaction factory. - - - Gets the default maximum timeout interval for new transactions. - A value that specifies the maximum timeout interval that is allowed when creating new transactions. - - - Notifies the transaction manager that a resource manager recovering from failure has finished reenlisting in all unresolved transactions. - - The manager parameter is null. - - - Reenlists a durable participant in a transaction. - - - - An that describes the enlistment. - recoveryInformation is invalid. -or- Transaction Manager information in recoveryInformation does not match the configured transaction manager. -or- RecoveryInformation is not recognized by . - has already been called for the specified resourceManagerIdentifier. The reenlistment is rejected. - The resourceManagerIdentifier does not match the content of the specified recovery information in recoveryInformation. - - - The exception that is thrown when a resource manager cannot communicate with the transaction manager. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with the specified message. - A that contains a message that explains why the exception occurred. - - - Initializes a new instance of the class with the specified serialization and streaming context information. - A object that describes a failed serialization. - A object that describes a failed serialization context. - - - Initializes a new instance of the class with the specified message and inner exception. - A that contains a message that explains why the exception occurred. - Gets the exception instance that causes the current exception. For more information, see the property. - - - Contains additional information that specifies transaction behaviors. - - - Determines whether this instance and the specified object are equal. - The object to compare with this instance. - true if obj and this instance are identical; otherwise, false. - - - Returns the hash code for this instance. - A 32-bit signed integer hash code. - - - Gets or sets the isolation level of the transaction. - A enumeration that specifies the isolation level of the transaction. - - - Tests whether two specified instances are equivalent. - - - true if x and y are equal; otherwise, false. - - - Returns a value that indicates whether two instances are not equal. - - - true if x and y are not equal; otherwise, false. - - - Gets or sets the timeout period for the transaction. - A value that specifies the timeout period for the transaction. - - - The exception that is thrown when a promotion fails. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with the specified message. - A that contains a message that explains why the exception occurred. - - - Initializes a new instance of the class with the specified serialization and streaming context information. - A object that describes a failed serialization. - A object that describes a failed serialization context. - - - Initializes a new instance of the class with the specified message and inner exception. - A that contains a message that explains why the exception occurred. - Gets the exception instance that causes the current exception. For more information, see the property. - - - Makes a code block transactional. This class cannot be inherited. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class and sets the specified transaction as the ambient transaction, so that transactional work done inside the scope uses this transaction. - - - - [Supported in the .NET Framework 4.5.1 and later versions] Initializes a new instance of the class with the specified asynchronous flow option. - - - - Initializes a new instance of the class with the specified requirements. - - - - Initializes a new instance of the class with the specified timeout value, and sets the specified transaction as the ambient transaction, so that transactional work done inside the scope uses this transaction. - - - - - [Supported in the .NET Framework 4.5.1 and later versions] Initializes a new instance of the class and sets the specified transaction as the ambient transaction, so that transactional work done inside the scope uses this transaction. - The transaction to be set as the ambient transaction, so that transactional work done inside the scope uses this transaction. - An instance of the enumeration that describes whether the ambient transaction associated with the transaction scope will flow across thread continuations when using Task or async/await .NET async programming patterns. - - - Initializes a new instance of the class with the specified timeout value and requirements. - - - - - Initializes a new instance of the class with the specified requirements. - An instance of the enumeration that describes the transaction requirements associated with this transaction scope. - - - - [Supported in the .NET Framework 4.5.1 and later versions] Initializes a new instance of the class with the specified requirements and asynchronous flow option. - - - - - Initializes a new instance of the class with the specified timeout value and COM+ interoperability requirements, and sets the specified transaction as the ambient transaction, so that transactional work done inside the scope uses this transaction. - - - - - - [Supported in the .NET Framework 4.5.1 and later versions] Initializes a new instance of the class with the specified timeout value, and sets the specified transaction as the ambient transaction, so that transactional work done inside the scope uses this transaction. - The transaction to be set as the ambient transaction, so that transactional work done inside the scope uses this transaction. - The after which the transaction scope times out and aborts the transaction. - An instance of the enumeration that describes whether the ambient transaction associated with the transaction scope will flow across thread continuations when using Task or async/await .NET async programming patterns. - - - [Supported in the .NET Framework 4.5.1 and later versions] Initializes a new instance of the class with the specified timeout value, requirements, and asynchronous flow option. - - - - - - Initializes a new instance of the class with the specified scope and COM+ interoperability requirements, and transaction options. - An instance of the enumeration that describes the transaction requirements associated with this transaction scope. - - - - - [Supported in the .NET Framework 4.5.1 and later versions] Initializes a new instance of the class with the specified requirements and asynchronous flow option. - An instance of the enumeration that describes the transaction requirements associated with this transaction scope. - A structure that describes the transaction options to use if a new transaction is created. If an existing transaction is used, the timeout value in this parameter applies to the transaction scope. If that time expires before the scope is disposed, the transaction is aborted. - An instance of the enumeration that describes whether the ambient transaction associated with the transaction scope will flow across thread continuations when using Task or async/await .NET async programming patterns. - - - Indicates that all operations within the scope are completed successfully. - This method has already been called once. - - - Ends the transaction scope. - - - [Supported in the .NET Framework 4.5.1 and later versions] Specifies whether transaction flow across thread continuations is enabled for . - - - Specifies that transaction flow across thread continuations is enabled. - - - - Specifies that transaction flow across thread continuations is suppressed. - - - - Provides additional options for creating a transaction scope. - - - A transaction is required by the scope. It uses an ambient transaction if one already exists. Otherwise, it creates a new transaction before entering the scope. This is the default value. - - - - A new transaction is always created for the scope. - - - - The ambient transaction context is suppressed when creating the scope. All operations within the scope are done without an ambient transaction context. - - - - Represents the method that will handle the event of a class. - The source of the event. - The that contains the transaction from which transaction information can be retrieved. - - - Describes the current status of a distributed transaction. - - - The transaction has been rolled back. - - - - The status of the transaction is unknown, because some participants must still be polled. - - - - The transaction has been committed. - - - - The status of the transaction is unknown. - - - - Represents a 1-tuple, or singleton. - The type of the tuple's only component. - - - Initializes a new instance of the class. - The value of the tuple's only component. - - - Returns a value that indicates whether the current object is equal to a specified object. - The object to compare with this instance. - true if the current instance is equal to the specified object; otherwise, false. - - - Returns the hash code for the current object. - A 32-bit signed integer hash code. - - - Gets the value of the object's single component. - The value of the current object's single component. - - - Returns a string that represents the value of this instance. - The string representation of this object. - - - Compares the current object to a specified object by using a specified comparer, and returns an integer that indicates whether the current object is before, after, or in the same position as the specified object in the sort order. - An object to compare with the current instance. - An object that provides custom rules for comparison. -

A signed integer that indicates the relative position of this instance and other in the sort order, as shown in the following table.

-
Value

-

Description

-

A negative integer

-

This instance precedes other.

-

Zero

-

This instance and other have the same position in the sort order.

-

A positive integer

-

This instance follows other.

-

-
- other is not a object. -
- - Returns a value that indicates whether the current object is equal to a specified object based on a specified comparison method. - The object to compare with this instance. - An object that defines the method to use to evaluate whether the two objects are equal. - true if the current instance is equal to the specified object; otherwise, false. - - - Calculates the hash code for the current object by using a specified computation method. - An object whose method calculates the hash code of the current object. - A 32-bit signed integer hash code. - - - Compares the current object to a specified object, and returns an integer that indicates whether the current object is before, after, or in the same position as the specified object in the sort order. - An object to compare with the current instance. -

A signed integer that indicates the relative position of this instance and obj in the sort order, as shown in the following table.

-
Value

-

Description

-

A negative integer

-

This instance precedes obj.

-

Zero

-

This instance and obj have the same position in the sort order.

-

A positive integer

-

This instance follows obj.

-

-
- obj is not a object. -
- - Represents a 2-tuple, or pair. - The type of the tuple's first component. - The type of the tuple's second component. - - - Initializes a new instance of the class. - The value of the tuple's first component. - The value of the tuple's second component. - - - Returns a value that indicates whether the current object is equal to a specified object. - The object to compare with this instance. - true if the current instance is equal to the specified object; otherwise, false. - - - Returns the hash code for the current object. - A 32-bit signed integer hash code. - - - Gets the value of the current object's first component. - The value of the current object's first component. - - - Gets the value of the current object's second component. - The value of the current object's second component. - - - Returns a string that represents the value of this instance. - The string representation of this object. - - - Compares the current object to a specified object by using a specified comparer, and returns an integer that indicates whether the current object is before, after, or in the same position as the specified object in the sort order. - An object to compare with the current instance. - An object that provides custom rules for comparison. -

A signed integer that indicates the relative position of this instance and other in the sort order, as shown in the following table.

-
Value

-

Description

-

A negative integer

-

This instance precedes other.

-

Zero

-

This instance and other have the same position in the sort order.

-

A positive integer

-

This instance follows other.

-

-
- other is not a object. -
- - Returns a value that indicates whether the current object is equal to a specified object based on a specified comparison method. - The object to compare with this instance. - An object that defines the method to use to evaluate whether the two objects are equal. - true if the current instance is equal to the specified object; otherwise, false. - - - Calculates the hash code for the current object by using a specified computation method. - An object whose method calculates the hash code of the current object. - A 32-bit signed integer hash code. - - - Compares the current object to a specified object and returns an integer that indicates whether the current object is before, after, or in the same position as the specified object in the sort order. - An object to compare with the current instance. -

A signed integer that indicates the relative position of this instance and obj in the sort order, as shown in the following table.

-
Value

-

Description

-

A negative integer

-

This instance precedes obj.

-

Zero

-

This instance and obj have the same position in the sort order.

-

A positive integer

-

This instance follows obj.

-

-
- obj is not a object. -
- - Represents a 3-tuple, or triple. - The type of the tuple's first component. - The type of the tuple's second component. - The type of the tuple's third component. - - - Initializes a new instance of the class. - The value of the tuple's first component. - The value of the tuple's second component. - The value of the tuple's third component. - - - Returns a value that indicates whether the current object is equal to a specified object. - The object to compare with this instance. - true if the current instance is equal to the specified object; otherwise, false. - - - Returns the hash code for the current object. - A 32-bit signed integer hash code. - - - Gets the value of the current object's first component. - The value of the current object's first component. - - - Gets the value of the current object's second component. - The value of the current object's second component. - - - Gets the value of the current object's third component. - The value of the current object's third component. - - - Returns a string that represents the value of this instance. - The string representation of this object. - - - Compares the current object to a specified object by using a specified comparer, and returns an integer that indicates whether the current object is before, after, or in the same position as the specified object in the sort order. - An object to compare with the current instance. - An object that provides custom rules for comparison. -

A signed integer that indicates the relative position of this instance and other in the sort order, as shown in the following table.

-
Value

-

Description

-

A negative integer

-

This instance precedes other.

-

Zero

-

This instance and other have the same position in the sort order.

-

A positive integer

-

This instance follows other.

-

-
- other is not a object. -
- - Returns a value that indicates whether the current object is equal to a specified object based on a specified comparison method. - The object to compare with this instance. - An object that defines the method to use to evaluate whether the two objects are equal. - true if the current instance is equal to the specified object; otherwise, false. - - - Calculates the hash code for the current object by using a specified computation method. - An object whose method calculates the hash code of the current object. - A 32-bit signed integer hash code. - - - Compares the current object to a specified object and returns an integer that indicates whether the current object is before, after, or in the same position as the specified object in the sort order. - An object to compare with the current instance. -

A signed integer that indicates the relative position of this instance and obj in the sort order, as shown in the following table.

-
Value

-

Description

-

A negative integer

-

This instance precedes obj.

-

Zero

-

This instance and obj have the same position in the sort order.

-

A positive integer

-

This instance follows obj.

-

-
- obj is not a object. -
- - Represents a 4-tuple, or quadruple. - The type of the tuple's first component. - The type of the tuple's second component. - The type of the tuple's third component. - The type of the tuple's fourth component. - - - Initializes a new instance of the class. - The value of the tuple's first component. - The value of the tuple's second component. - The value of the tuple's third component. - The value of the tuple's fourth component - - - Returns a value that indicates whether the current object is equal to a specified object. - The object to compare with this instance. - true if the current instance is equal to the specified object; otherwise, false. - - - Returns the hash code for the current object. - A 32-bit signed integer hash code. - - - Gets the value of the current object's first component. - The value of the current object's first component. - - - Gets the value of the current object's second component. - The value of the current object's second component. - - - Gets the value of the current object's third component. - The value of the current object's third component. - - - Gets the value of the current object's fourth component. - The value of the current object's fourth component. - - - Returns a string that represents the value of this instance. - The string representation of this object. - - - Compares the current object to a specified object by using a specified comparer and returns an integer that indicates whether the current object is before, after, or in the same position as the specified object in the sort order. - An object to compare with the current instance. - An object that provides custom rules for comparison. -

A signed integer that indicates the relative position of this instance and other in the sort order, as shown in the following table.

-
Value

-

Description

-

A negative integer

-

This instance precedes other.

-

Zero

-

This instance and other have the same position in the sort order.

-

A positive integer

-

This instance follows other.

-

-
- other is not a object. -
- - Returns a value that indicates whether the current object is equal to a specified object based on a specified comparison method. - The object to compare with this instance. - An object that defines the method to use to evaluate whether the two objects are equal. - true if the current instance is equal to the specified object; otherwise, false. - - - Calculates the hash code for the current object by using a specified computation method. - An object whose method calculates the hash code of the current object. - A 32-bit signed integer hash code. - - - Compares the current object to a specified object and returns an integer that indicates whether the current object is before, after, or in the same position as the specified object in the sort order. - An object to compare with the current instance. -

A signed integer that indicates the relative position of this instance and obj in the sort order, as shown in the following table.

-
Value

-

Description

-

A negative integer

-

This instance precedes obj.

-

Zero

-

This instance and obj have the same position in the sort order.

-

A positive integer

-

This instance follows obj.

-

-
- obj is not a object. -
- - Holds an delegate instance, plus the method's inputs; also serves as the parameter for the method. - - - Initializes a new instance of the class. - The object that contains other objects whose values get filled in by the callback implementation. - A method that instantiates the delegate. - The size of the string array obtained through the property. - - - Initializes a new instance of the class. - The object that contains other objects whose values get filled in by the callback implementation. - A method that instantiates the delegate. - The string array obtained through the property. - - - Gets the callback method that creates an instance of the delegate. - The callback method that creates an instance of the delegate. - - - Gets or sets an array of keys for the objects that belong to the property whose values get filled in by the callback implementation. - The array of keys. - - - Gets or sets the object that contains other objects whose values get filled in by the callback implementation. - The source containing objects with values to fill. - - - Controls deserialization by the class. - - - Initializes a new instance of the class. - - - Stores an object that contains a callback method that will be called, as necessary, to fill in .NET Framework collections or enumerations that map to SOAP-encoded arrays or SOAP-encoded, multi-referenced elements. - A delegate and the callback method's input data. - - - Stores an object that contains a callback method instance that will be called, as necessary, to fill in the objects in a SOAP-encoded array. - An delegate and the callback method's input data. - - - Stores an implementation of the delegate and its input data for a later invocation. - The name of the .NET Framework type that is being deserialized. - The namespace of the .NET Framework type that is being deserialized. - The to be deserialized. - An delegate. - - - Stores an object that is being deserialized from a SOAP-encoded multiRef element for later access through the method. - The value of the id attribute of a multiRef element that identifies the element. - The object that is deserialized from the XML element. - - - Checks whether the deserializer has advanced. - The current count in a while loop. - The current . - The has not advanced. - - - Removes all occurrences of white space characters from the beginning and end of the specified string. - The string that will have its white space trimmed. - The trimmed string. - - - Creates an that indicates that an object being deserialized should be abstract. - The name of the abstract type. - The .NET Framework namespace of the abstract type. - An exception. - - - Populates an object from its XML representation at the current location of the , with an option to read the inner element. - The local name of the derived XML Schema data type. - The namespace of the derived XML Schema data type. - The local name of the base XML Schema data type. - The namespace of the base XML Schema data type. - The namespace of the derived .NET Framework type. - The name of the base .NET Framework type. - An exception. - - - Creates an that indicates that an object being deserialized cannot be instantiated because the constructor throws a security exception. - The name of the type. - An exception. - - - Creates an that indicates that an object being deserialized cannot be instantiated because there is no constructor available. - The name of the type. - An exception. - - - Creates an that indicates that an explicit reference conversion failed. - The that an object cannot be cast to. This type is incorporated into the exception message. - The object that cannot be cast. This object is incorporated into the exception message. - An exception. - - - Creates an that indicates that an explicit reference conversion failed. - The that an object cannot be cast to. This type is incorporated into the exception message. - The object that cannot be cast. This object is incorporated into the exception message. - A string identifier. - An exception. - - - Creates an that indicates that a derived type that is mapped to an XML Schema data type cannot be located. - The local name of the XML Schema data type that is mapped to the unavailable derived type. - The namespace of the XML Schema data type that is mapped to the unavailable derived type. - The full name of the .NET Framework base type for which a derived type cannot be located. - An exception. - - - Creates an that indicates that a SOAP-encoded collection type cannot be modified and its values cannot be filled in. - The fully qualified name of the .NET Framework type for which there is a mapping. - An exception. - - - Creates an that indicates that an enumeration value is not valid. - The enumeration value that is not valid. - The enumeration type. - An exception. - - - Creates an that indicates that the current position of represents an unknown XML node. - An exception. - - - Creates an that indicates that a type is unknown. - An that represents the name of the unknown type. - An exception. - - - Gets or sets a value that determines whether XML strings are translated into valid .NET Framework type names. - true if XML strings are decoded into valid .NET Framework type names; otherwise, false. - - - Gets the XML document object into which the XML document is being deserialized. - An that represents the deserialized data. - - - Ensures that a given array, or a copy, is large enough to contain a specified index. - The that is being checked. - The required index. - The of the array's elements. - The existing , if it is already large enough; otherwise, a new, larger array that contains the original array's elements. - - - Fills in the values of a SOAP-encoded array whose data type maps to a .NET Framework reference type. - An object that contains the array whose values are filled in. - - - Gets the length of the SOAP-encoded array where the is currently positioned. - The local name that the array should have. - The namespace that the array should have. - The length of the SOAP array. - - - Determines whether the XML element where the is currently positioned has a null attribute set to the value true. - true if is currently positioned over a null attribute with the value true; otherwise, false. - - - Gets an object that is being deserialized from a SOAP-encoded multiRef element and that was stored earlier by . - The value of the id attribute of a multiRef element that identifies the element. - An object to be deserialized from a SOAP-encoded multiRef element. - - - Gets the value of the xsi:type attribute for the XML element at the current location of the . - An XML qualified name that indicates the data type of an XML element. - - - Initializes callback methods that populate objects that map to SOAP-encoded XML data. - - - Stores element and attribute names in a object. - - - Gets or sets a value that should be true for a SOAP 1.1 return value. - true, if the value is a return value. - - - Determines whether an XML attribute name indicates an XML namespace. - The name of an XML attribute. - true if the XML attribute name indicates an XML namespace; otherwise, false. - - - Sets the value of the XML attribute if it is of type arrayType from the Web Services Description Language (WSDL) namespace. - An that may have the type wsdl:array. - - - Makes the read the fully qualified name of the element where it is currently positioned. - The fully qualified name of the current XML element. - - - Makes the read an XML end tag. - - - Gets the object that is being used by . - The that is being used by the . - - - Gets the current count of the . - The current count of an . - - - Instructs the to read the current XML element if the element has a null attribute with the value true. - true if the element has a null="true" attribute value and has been read; otherwise, false. - - - Instructs the to read the fully qualified name of the element where it is currently positioned. - A that represents the fully qualified name of the current XML element; otherwise, null if a null="true" attribute value is present. - - - Instructs the to read a simple, text-only XML element that could be null. - The string value; otherwise, null. - - - Reads the value of the href attribute (ref attribute for SOAP 1.2) that is used to refer to an XML element in SOAP encoding. - An output string into which the href attribute value is read. - true if the value was read; otherwise, false. - - - Deserializes an object from a SOAP-encoded multiRef XML element. - The value of the referenced element in the document. - - - Deserializes an object from a SOAP-encoded multiRef XML element. - The local name of the element's XML Schema data type. - The namespace of the element's XML Schema data type. - The value of the referenced element in the document. - - - Deserializes objects from the SOAP-encoded multiRef elements in a SOAP message. - - - Deserializes an object from an XML element in a SOAP message that contains a reference to a multiRef element. - An output string into which the href attribute value is read. - The deserialized object. - - - Deserializes an object from an XML element in a SOAP message that contains a reference to a multiRef element. - The local name of the element's XML Schema data type. - The namespace of the element's XML Schema data type. - An output string into which the href attribute value is read. - The deserialized object. - - - Deserializes an object from an XML element in a SOAP message that contains a reference to a multiRef element. - The local name of the element's XML Schema data type. - The namespace of the element's XML Schema data type. - true if the element name is also the XML Schema data type name; otherwise, false. - An output string into which the value of the href attribute is read. - The deserialized object. - - - Populates an object from its XML representation at the current location of the . - An that corresponds to the current position of the . - An object that implements the interface with its members populated from the location of the . - - - This method supports the .NET Framework infrastructure and is not intended to be used directly from your code. - An IXmlSerializable object that corresponds to the current position of the XMLReader. - Specifies whether the serializable object is wrapped. - An object that implements the IXmlSerializable interface with its members populated from the location of the XmlReader. - - - Returns the result of a call to the method of the class, trimmed of white space if needed, and appended to the input value. - A string that will be appended to. - true if the result of the read operation should be trimmed; otherwise, false. - The result of the read operation appended to the input value. - - - Produces the result of a call to the method appended to the input value. - A string to prefix to the result of a call to the method. - The result of call to the method appended to the input value. - - - Reads an XML element that allows null values (xsi:nil = 'true') and returns a generic value. - The that represents the simple data type for the current location of the . - A generic that represents a null XML value. - - - Gets the value of the XML node at which the is currently positioned. - The that represents the simple data type for the current location of the . - The value of the node as a .NET Framework value type, if the value is a simple XML Schema data type. - - - Instructs the to read an XML document root element at its current position. - true if the method should read content only after reading the element's start element; otherwise, false. - An that contains the root element that has been read. - - - Instructs the to read the XML node at its current position. - true to read content only after reading the element's start element; otherwise, false. - An that represents the XML node that has been read. - - - Stores an object to be deserialized from a SOAP-encoded multiRef element. - The object to be deserialized. - - - Gets a dynamically generated assembly by name. - The full name of the assembly. - A dynamically generated . - - - Ensures that a given array, or a copy, is no larger than a specified length. - The array that is being checked. - The maximum length of the array. - The of the array's elements. - true if null for the array, if present for the input array, can be returned; otherwise, a new, smaller array. - The existing , if it is already small enough; otherwise, a new, smaller array that contains the original array's elements up to the size of length. - - - Produces a base-64 byte array from an input string. - A string to translate into a base-64 byte array. - A base-64 byte array. - - - Instructs the to read the string value at its current position and return it as a base-64 byte array. - true to return null; false to return a base-64 byte array. - A base-64 byte array; otherwise, null if the value of the isNull parameter is true. - - - Instructs the to read the string value at its current position and return it as a hexadecimal byte array. - true to return null; false to return a hexadecimal byte array. - A hexadecimal byte array; otherwise, null if the value of the isNull parameter is true. - - - Produces a hexadecimal byte array from an input string. - A string to translate into a hexadecimal byte array. - A hexadecimal byte array. - - - Produces a object from an input string. - A string to translate into a object. - A object. - - - Produces a object from an input string. - A string to translate into a class object. - A object. - - - Produces a object from an input string. - A string to translate into a object. - A object. - - - Produces a numeric enumeration value from a string that consists of delimited identifiers that represent constants from the enumerator list. - A string that consists of delimited identifiers where each identifier represents a constant from the set enumerator list. - A that consists of the identifiers as keys and the constants as integral numbers. - The name of the enumeration type. - A long value that consists of the enumeration value as a series of bitwise OR operations. - - - Produces a from a string that represents the time. - A string to translate into a object. - A object. - - - Decodes an XML name. - An XML name to be decoded. - A decoded string. - - - Decodes an XML name. - An XML name to be decoded. - A decoded string. - - - Decodes an XML name. - An XML name to be decoded. - A decoded string. - - - Decodes an XML name. - An XML name to be decoded. - A decoded string. - - - Obtains an from a name that may contain a prefix. - A name that may contain a prefix. - An that represents a namespace-qualified XML name. - - - Raises an event for the current position of the . - An object that the is attempting to deserialize, subsequently accessible through the property. - An that represents the attribute in question. - - - Raises an event for the current position of the . - An object that the is attempting to deserialize, subsequently accessible through the property. - A that represents the attribute in question. - A comma-delimited list of XML qualified names. - - - Raises an event for the current position of the . - The that is being deserialized. - The for which an event is raised. - - - Raises an event for the current position of the . - An object that the is attempting to deserialize, subsequently accessible through the property. - The for which an event is raised. - A comma-delimited list of XML qualified names. - - - Raises an event for the current position of the . - The object being deserialized. - A comma-delimited list of XML qualified names. - - - Raises an event for the current position of the . - The object that is being deserialized. - - - Raises an event for the current position of the . - A unique string that is used to identify the unreferenced object, subsequently accessible through the property. - An object that the is attempting to deserialize, subsequently accessible through the property. - - - Delegate that is used by the class for serialization of types from SOAP-encoded, non-root XML data. - The object being serialized. - - - Represents an abstract class used for controlling serialization by the class. - - - Initializes a new instance of the class. - - - Stores an implementation of the delegate and the type it applies to, for a later invocation. - The of objects that are serialized. - The name of the type of objects that are serialized. - The namespace of the type of objects that are serialized. - An instance of the delegate. - - - Creates an that indicates an unexpected name for an element that adheres to an XML Schema choice element declaration. - The name that is not valid. - The choice element declaration that the name belongs to. - The expected local name of an element. - The expected namespace of an element. - The newly created exception. - - - Creates an that indicates the which has been invalidly applied to a member; only members that are of type , or derived from , are valid. - The object that represents the invalid member. - The newly created exception. - - - Creates an that indicates the which has been invalidly applied to a member; only members that are of type , or derived from , are valid. - The that is invalid. - The newly created exception. - - - Creates an that indicates a failure while writing an array where an XML Schema choice element declaration is applied. - The type being serialized. - A name for the choice element declaration. - The newly created exception. - - - Creates an for an invalid enumeration value. - An object that represents the invalid enumeration. - The XML type name. - The newly created exception. - - - Creates an that indicates that a value for an XML element does not match an enumeration type. - The value that is not valid. - The name of the XML element with an invalid value. - The valid value. - The newly created exception. - - - Creates an that indicates that an XML element that should adhere to the XML Schema any element declaration cannot be processed. - The XML element that cannot be processed. - The namespace of the XML element. - The newly created exception. - - - Creates an that indicates that a type being serialized is not being used in a valid manner or is unexpectedly encountered. - The object whose type cannot be serialized. - The newly created exception. - - - Creates an that indicates that a type being serialized is not being used in a valid manner or is unexpectedly encountered. - The type that cannot be serialized. - The newly created exception. - - - Gets or sets a value that indicates whether the method is used to write valid XML. - true if the method returns an encoded name; otherwise, false. - - - Processes a base-64 byte array. - A base-64 array. - The same byte array that was passed in as an argument. - - - Produces a string from an input hexadecimal byte array. - A hexadecimal byte array to translate to a string. - The byte array value converted to a string. - - - Produces a string from an input . - A to translate to a string. - The value converted to a string. - - - Produces a string from a object. - A to translate to a string. - A string representation of the that shows the date but no time. - - - Produces a string from an input . - A to translate to a string. - A string representation of the that shows the date and time. - - - Produces a string that consists of delimited identifiers that represent the enumeration members that have been set. - The enumeration value as a series of bitwise OR operations. - The enumeration's name values. - The enumeration's constant values. - A string that consists of delimited identifiers, where each represents a member from the set enumerator list. - - - Takes a numeric enumeration value and the names and constants from the enumerator list for the enumeration and returns a string that consists of delimited identifiers that represent the enumeration members that have been set. - The enumeration value as a series of bitwise OR operations. - The values of the enumeration. - The constants of the enumeration. - The name of the type - A string that consists of delimited identifiers, where each item is one of the values set by the bitwise operation. - - - Produces a string from a object. - A that is translated to a string. - A string representation of the object that shows the time but no date. - - - Encodes a valid XML name by replacing characters that are not valid with escape sequences. - A string to be used as an XML name. - An encoded string. - - - Encodes a valid XML local name by replacing characters that are not valid with escape sequences. - A string to be used as a local (unqualified) XML name. - An encoded string. - - - Encodes an XML name. - An XML name to be encoded. - An encoded string. - - - Encodes a space-delimited sequence of XML names into a single XML name. - A space-delimited sequence of XML names to be encoded. - An encoded string. - - - Produces a string that can be written as an XML qualified name, with invalid characters replaced by escape sequences. - An that represents the XML to be written. - true to ignore empty spaces in the string; otherwise, false. - An XML qualified name, with invalid characters replaced by escape sequences. - - - Returns an XML qualified name, with invalid characters replaced by escape sequences. - An that represents the XML to be written. - An XML qualified name, with invalid characters replaced by escape sequences. - - - Initializes an instances of the delegate to serialize SOAP-encoded XML data. - - - Gets or sets a list of XML qualified name objects that contain the namespaces and prefixes used to produce qualified names in XML documents. - An that contains the namespaces and prefix pairs. - - - Gets a dynamically generated assembly by name. - The full name of the assembly. - A dynamically generated assembly. - - - Initializes object references only while serializing a SOAP-encoded SOAP message. - - - Instructs an object to write an XML attribute that has no namespace specified for its name. - The local name of the XML attribute. - The value of the XML attribute as a byte array. - - - Instructs the to write an XML attribute that has no namespace specified for its name. - The local name of the XML attribute. - The value of the XML attribute as a string. - - - Instructs an object to write an XML attribute. - The local name of the XML attribute. - The namespace of the XML attribute. - The value of the XML attribute as a byte array. - - - Writes an XML attribute. - The local name of the XML attribute. - The namespace of the XML attribute. - The value of the XML attribute as a string. - - - Writes an XML attribute where the namespace prefix is provided manually. - The namespace prefix to write. - The local name of the XML attribute. - The namespace represented by the prefix. - The value of the XML attribute as a string. - - - Writes an XML node object within the body of a named XML element. - The XML node to write, possibly a child XML element. - The local name of the parent XML element to write. - The namespace of the parent XML element to write. - true to write an xsi:nil='true' attribute if the object to serialize is null; otherwise, false. - true to indicate that the node, if an XML element, adheres to an XML Schema any element declaration; otherwise, false. - - - Instructs an object to write an object within the body of a named XML element. - The XML node to write, possibly a child XML element. - The local name of the parent XML element to write. - The namespace of the parent XML element to write. - true to write an xsi:nil='true' attribute if the object to serialize is null; otherwise, false. - true to indicate that the node, if an XML element, adheres to an XML Schema any element declaration; otherwise, false. - - - Writes an XML element with a specified qualified name in its body. - The local name of the XML element. - The namespace of the XML element. - The name to write, using its prefix if namespace-qualified, in the element text. - The name of the XML Schema data type to be written to the xsi:type attribute. - - - Writes an XML element with a specified qualified name in its body. - The local name of the XML element. - The name to write, using its prefix if namespace-qualified, in the element text. - The name of the XML Schema data type to be written to the xsi:type attribute. - - - Writes an XML element with a specified qualified name in its body. - The local name of the XML element. - The name to write, using its prefix if namespace-qualified, in the element text. - - - Writes an XML element with a specified qualified name in its body. - The local name of the XML element. - The namespace of the XML element. - The name to write, using its prefix if namespace-qualified, in the element text. - - - Writes an XML element with a specified value in its body. - The local name of the XML element to be written without namespace qualification. - The text value of the XML element. - - - Writes an XML element with a specified value in its body. - The local name of the XML element. - The namespace of the XML element. - The text value of the XML element. - - - Writes an XML element with a specified value in its body. - The local name of the XML element. - The text value of the XML element. - The name of the XML Schema data type to be written to the xsi:type attribute. - - - Writes an XML element with a specified value in its body. - The local name of the XML element. - The namespace of the XML element. - The text value of the XML element. - The name of the XML Schema data type to be written to the xsi:type attribute. - - - Writes an XML element with a specified value in its body. - The local name of the XML element. - The text value of the XML element. - The name of the XML Schema data type to be written to the xsi:type attribute. - - - Writes an XML element with a specified value in its body. - The local name of the XML element. - The namespace of the XML element. - The text value of the XML element. - The name of the XML Schema data type to be written to the xsi:type attribute. - - - Writes an XML element with a specified value in its body. - The local name of the XML element. - The namespace of the XML element. - The text value of the XML element. - The name of the XML Schema data type to be written to the xsi:type attribute. - - - Writes an XML element with a specified value in its body. - The local name of the XML element. - The namespace of the XML element. - The text value of the XML element. - - - Writes an XML element with a specified value in its body. - The local name of the XML element. - The text value of the XML element. - The name of the XML Schema data type to be written to the xsi:type attribute. - - - Writes an XML element with a specified value in its body. - The local name of the XML element. - The namespace of the XML element. - The text value of the XML element. - - - Writes an XML element with a specified value in its body. - The local name of the XML element. - The text value of the XML element. - - - Writes an XML element with a specified value in its body. - The local name of the XML element. - The text value of the XML element. - - - Writes an XML element whose body is empty. - The local name of the XML element to write. - - - Writes an XML element whose body is empty. - The local name of the XML element to write. - The namespace of the XML element to write. - - - Writes a <closing> element tag. - - - Writes a <closing> element tag. - The object being serialized. - - - Writes an id attribute that appears in a SOAP-encoded multiRef element. - The object being serialized. - - - Writes the namespace declaration attributes. - The XML namespaces to declare. - - - Writes an XML element whose body contains a valid XML qualified name. inserts an xsi:nil='true' attribute if the string's value is null. - The local name of the XML element to write. - The namespace of the XML element to write. - The XML qualified name to write in the body of the XML element. - The name of the XML Schema data type to be written to the xsi:type attribute. - - - Writes an XML element whose body contains a valid XML qualified name. inserts an xsi:nil='true' attribute if the string's value is null. - The local name of the XML element to write. - The namespace of the XML element to write. - The XML qualified name to write in the body of the XML element. - - - Writes an XML element that contains a string as the body. inserts an xsi:nil='true' attribute if the string's value is null. - The local name of the XML element to write. - The namespace of the XML element to write. - The string to write in the body of the XML element. - The name of the XML Schema data type to be written to the xsi:type attribute. - - - Writes a byte array as the body of an XML element. inserts an xsi:nil='true' attribute if the string's value is null. - The local name of the XML element to write. - The namespace of the XML element to write. - The byte array to write in the body of the XML element. - The name of the XML Schema data type to be written to the xsi:type attribute. - - - Writes an XML element that contains a string as the body. inserts an xsi:nil='true' attribute if the string's value is null. - The local name of the XML element to write. - The namespace of the XML element to write. - The string to write in the body of the XML element. - The name of the XML Schema data type to be written to the xsi:type attribute. - - - Writes an XML element that contains a string as the body. inserts an xsi:nil='true' attribute if the string's value is null. - The local name of the XML element to write. - The namespace of the XML element to write. - The string to write in the body of the XML element. - - - Writes a byte array as the body of an XML element. inserts an xsi:nil='true' attribute if the string's value is null. - The local name of the XML element to write. - The namespace of the XML element to write. - The byte array to write in the body of the XML element. - - - Writes an XML element that contains a string as the body. inserts a xsi:nil='true' attribute if the string's value is null. - The local name of the XML element to write. - The namespace of the XML element to write. - The string to write in the body of the XML element. - - - Writes an XML element with an xsi:nil='true' attribute. - The local name of the XML element to write. - - - Writes an XML element with an xsi:nil='true' attribute. - The local name of the XML element to write. - The namespace of the XML element to write. - - - Writes an XML element with an xsi:nil='true' attribute. - The local name of the XML element to write. - - - Writes an XML element with an xsi:nil='true' attribute. - The local name of the XML element to write. - The namespace of the XML element to write. - - - Writes a SOAP message XML element that can contain a reference to a multiRef XML element for a given object. - The local name of the XML element to write. - The namespace of the XML element to write. - The object being serialized either in the current XML element or a multiRef element that referenced by the current element. - The type stored in the object's type mapping (as opposed to the object's type found directly through the typeof operation). - true to serialize the object directly into the XML element rather than make the element reference another element that contains the data; otherwise, false. - true to write an xsi:nil='true' attribute if the object to serialize is null; otherwise, false. - - - Writes a SOAP message XML element that can contain a reference to a <multiRef> XML element for a given object. - The local name of the XML element to write. - The namespace of the XML element to write. - The object being serialized either in the current XML element or a multiRef element that is referenced by the current element. - The type stored in the object's type mapping (as opposed to the object's type found directly through the typeof operation). - true to serialize the object directly into the XML element rather than make the element reference another element that contains the data; otherwise, false. - - - Writes a SOAP message XML element that can contain a reference to a <multiRef> XML element for a given object. - The local name of the XML element to write. - The namespace of the XML element to write. - The object being serialized either in the current XML element or a multiRef element that referenced by the current element. - The type stored in the object's type mapping (as opposed to the object's type found directly through the typeof operation). - - - Writes a SOAP message XML element that can contain a reference to a <multiRef> XML element for a given object. - The local name of the XML element to write. - The namespace of the XML element to write. - The object being serialized either in the current XML element or a multiRef element that is referenced by the current element. - - - Gets or sets the that is being used by the . - The used by the class instance. - - - Serializes objects into SOAP-encoded multiRef XML elements in a SOAP message. - - - Writes a SOAP message XML element that contains a reference to a multiRef element for a given object. - The local name of the referencing element being written. - The namespace of the referencing element being written. - The object being serialized. - - - Writes a SOAP message XML element that contains a reference to a multiRef element for a given object. - The local name of the referencing element being written. - The namespace of the referencing element being written. - The object being serialized. - true to write an xsi:nil='true' attribute if the object to serialize is null; otherwise, false. - - - Writes a SOAP 1.2 RPC result element with a specified qualified name in its body. - The local name of the result body. - The namespace of the result body. - - - Writes an object that uses custom XML formatting as an XML element. - An object that implements the interface that uses custom XML formatting. - The local name of the XML element to write. - The namespace of the XML element to write. - true to write an xsi:nil='true' attribute if the class object is null; otherwise, false. - - - Instructs to write an object that uses custom XML formatting as an XML element. - An object that implements the interface that uses custom XML formatting. - The local name of the XML element to write. - The namespace of the XML element to write. - true to write an xsi:nil='true' attribute if the object is null; otherwise, false. - true to ignore writing the opening element tag; otherwise, false to write the opening element tag. - - - Writes the XML declaration if the writer is positioned at the start of an XML document. - - - Writes an opening element tag, including any attributes. - The local name of the XML element to write. - - - Writes an opening element tag, including any attributes. - The local name of the XML element to write. - The namespace of the XML element to write. - - - Writes an opening element tag, including any attributes. - The local name of the XML element to write. - The namespace of the XML element to write. - true to write the element name with a prefix if none is available for the specified namespace; otherwise, false. - - - Writes an opening element tag, including any attributes. - The local name of the XML element to write. - The namespace of the XML element to write. - The object being serialized as an XML element. - - - Writes an opening element tag, including any attributes. - The local name of the XML element to write. - The namespace of the XML element to write. - The object being serialized as an XML element. - true to write the element name with a prefix if none is available for the specified namespace; otherwise, false. - - - Writes an opening element tag, including any attributes. - The local name of the XML element to write. - The namespace of the XML element to write. - The object being serialized as an XML element. - true to write the element name with a prefix if none is available for the specified namespace; otherwise, false. - An instance of the class that contains prefix and namespace pairs to be used in the generated XML. - - - Writes an XML element whose text body is a value of a simple XML Schema data type. - The local name of the element to write. - The namespace of the element to write. - The object to be serialized in the element body. - true if the XML element explicitly specifies the text value's type using the xsi:type attribute; otherwise, false. - - - Writes a base-64 byte array. - The byte array to write. - - - Writes a specified string value. - The value of the string to write. - - - Writes the specified object as an XML attribute. - The XML node to write. - An object (or null) used to generate a qualified name value for an arrayType attribute from the Web Services Description Language (WSDL) namespace ("http://schemas.xmlsoap.org/wsdl/"). - - - Writes the specified as an XML attribute. - The XML node to write. - - - Writes an xsi:type attribute for an XML element that is being serialized into a document. - The local name of an XML Schema data type. - The namespace of an XML Schema data type. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Applied to a Web service client proxy, enables you to specify an assembly that contains custom-made serializers. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with the specified assembly name. - The simple, unencrypted name of the assembly. - - - Initializes a new instance of the class with the specified assembly name and location of the assembly. - The simple, unencrypted name of the assembly. - A string that is the URL location of the assembly. - - - Gets or sets the name of the assembly that contains serializers for a specific set of types. - The simple, unencrypted name of the assembly. - - - Gets or sets the location of the assembly that contains the serializers. - A location, such as a path or URI, that points to the assembly. - - - Creates typed versions of the for more efficient serialization. - - - Initializes a new instance of the class. - - - Returns a derivation of the class that is used to serialize the specified type. - The to serialize. - A derivation of the class that is specifically created to serialize the specified type. - - - Returns a derivation of the class using an object that maps one type to another. - An that maps one type to another. - A derivation of the class that is specifically created to serialize the mapped type. - - - Returns a derivation of the class that is used to serialize the specified type and namespace. - The to serialize. - The default namespace to use for all the XML elements. - A derivation of the class that is specifically created to serialize the specified type. - - - Returns a derivation of the class that is used to serialize the specified type. If a property or field returns an array, the extraTypes parameter specifies objects that can be inserted into the array. - The to serialize. - A array of additional object types to serialize. - A derivation of the . - - - Returns a derivation of the class that can serialize objects of the specified type into XML documents, and vice versa. Each object to be serialized can itself contain instances of classes, which this overload can override with other classes. - The to serialize. - An that contains fields that override the default serialization behavior. - A derivation of the . - - - Returns a derivation of the class that can serialize objects of the specified type into XML documents, and vice versa. Specifies the object that represents the XML root element. - The to serialize. - An that represents the XML root element. - A derivation of the . - - - Returns a derivation of the class that can serialize objects of the specified type into XML document instances, and vice versa. Each object to be serialized can itself contain instances of classes, which this overload can override with other classes. This overload also specifies the default namespace for all the XML elements, and the class to use as the XML root element. - The to serialize. - An that contains fields that override the default serialization behavior. - A array of additional object types to serialize. - An that represents the XML root element. - The default namespace of all XML elements in the XML document. - A derivation of the . - - - Returns a derivation of the class that can serialize objects of the specified type into XML document instances, and vice versa. Each object to be serialized can itself contain instances of classes, which this overload can override with other classes. This overload also specifies the default namespace for all the XML elements, and the class to use as the XML root element. - The of the object that this can serialize. - An that extends or overrides the behavior of the class specified in the type parameter. - A array of additional object types to serialize. - An that defines the XML root element properties. - The default namespace of all XML elements in the XML document. - The path that specifies the location of the types. - A derivation of the . - - - Defines the reader, writer, and methods for pre-generated, typed serializers. - - - Initializes a new instance of the class. - - - Gets a value that determines whether a type can be serialized. - The to be serialized. - true if the type can be serialized; otherwise, false. - - - Returns a serializer for the specified type. - The to be serialized. - An instance of a type derived from the class. - - - Gets the XML reader object that is used by the serializer. - An that is used to read an XML document or data stream. - - - Gets the collection of methods that is used to read a data stream. - A that contains the methods. - - - Gets the collection of typed serializers that is found in the assembly. - A that contains the typed serializers. - - - Get the collection of methods that is used to write to a data stream. - A that contains the methods. - - - Gets the XML writer object for the serializer. - An that is used to write to an XML data stream or document. - - - Contains the XML namespaces and prefixes that the uses to generate qualified names in an XML-document instance. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class, using the specified instance of XmlSerializerNamespaces containing the collection of prefix and namespace pairs. - An instance of the containing the namespace and prefix pairs. - - - Initializes a new instance of the class. - An array of objects. - - - Adds a prefix and namespace pair to an object. - The prefix associated with an XML namespace. - An XML namespace. - - - Gets the number of prefix and namespace pairs in the collection. - The number of prefix and namespace pairs in the collection. - - - Gets the array of prefix and namespace pairs in an object. - An array of objects that are used as qualified names in an XML document. - - - Signifies that the code was generated by the serialization infrastructure and can be reused for increased performance, when this attribute is applied to an assembly. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class for the specified type. - The type that is being serialized. - - - Gets or sets the common language runtime (CLR) namespace of the assembly. - A containing the common language runtime (CLR) namespace of the assembly. - - - Gets or sets the identity of the parent assembly. - The version of the parent assembly. - - - Gets or sets the type that the serializer operates on. - The to be serialized. - - - Gets or sets the assembly's version number. - The version of the assembly. - - - Indicates to the that the member must be treated as XML text when the class that contains it is serialized or deserialized. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. - The of the member to be serialized. - - - Gets or sets the XML Schema definition language (XSD) data type of the text generated by the . - An XML Schema (XSD) data type, as defined by the World Wide Web Consortium (www.w3.org) document "XML Schema Part 2: Datatypes". - The XML Schema data type you have specified cannot be mapped to the .NET data type. - The XML Schema data type you have specified is invalid for the property and cannot be converted to the member type. - - - Gets or sets the type of the member. - The of the member. - - - Controls the XML schema that is generated when the attribute target is serialized by the . - - - Initializes a new instance of the class. - - - Initializes a new instance of the class and specifies the name of the XML type. - The name of the XML type that the generates when it serializes the class instance (and recognizes when it deserializes the class instance). - - - Gets or sets a value that determines whether the resulting schema type is an XSD anonymous type. - true, if the resulting schema type is an XSD anonymous type; otherwise, false. - - - Gets or sets a value that indicates whether to include the type in XML schema documents. - true to include the type in XML schema documents; otherwise, false. - - - Gets or sets the namespace of the XML type. - The namespace of the XML type. - - - Gets or sets the name of the XML type. - The name of the XML type. - - - Contains a mapping of one type to another. - - - The fully qualified type name that includes the namespace (or namespaces) and type. - The fully qualified type name. - - - Gets the type name of the mapped object. - The type name of the mapped object. - - - Gets the XML element name of the mapped object. - The XML element name of the mapped object. The default is the class name of the object. - - - Gets the XML namespace of the mapped object. - The XML namespace of the mapped object. The default is an empty string (""). - - - A unique identifier optimized for Guids. - - - Creates a new instance of this class with a new, unique Guid. - - - Creates a new instance of this class using a byte array that represents a . - A byte array that represents a . - guid is null. - guid provides less than 16 valid bytes. - - - Creates a new instance of this class using a . - A . - guid is null. - - - Creates a new instance of this class using a string. - A string used to generate the . - value is null. - Length of value is zero. - - - Creates a new instance of this class starting from an offset within a byte array that represents a . - A byte array that represents a . - Offset position within the byte array that represents a . - guid is null. - offset less than zero or greater than the length of the array. - guid and offset provide less than 16 valid bytes. - - - Creates a new instance of this class starting from an offset within a char using a specified number of entries. - A char array that represents a . - Offset position within the char array that represents a . - Number of array entries to use, starting from offset. - chars is null. - count less than zero or greater than the length of the array minus offset. - count equals zero. - - - Gets the length of the string representation of the . - The length of the string representation of the . - - - Tests whether an object equals this . - The object to compare. - true if the object equals this ; otherwise false. - - - Creates a hash-code representation of this . - An integer hash-code representation of this . - - - Indicates whether the is a . - true if the is a ; otherwise false. - - - Overrides the equality operator to test for equality of two s. - The first . - The second . - true if the two s are equal, or are both null; false if they are not equal, or if only one of them is null. - - - Overrides the equality operator to test for inequality of two s. - The first . - The second . - true if the overridden equality operator returns false; otherwise false. - - - Puts the value into a char array. - The char array. - Position in the char array to start inserting the value. - Number of entries in the char array filled by the value. - chars is null. - offset less than zero or greater than the length of the array. - guid and offset provide less than 16 valid bytes. - - - Displays the value in string format. - A string representation of the value. - - - Tries to get the value of the as a . - The if successful; otherwise . - true if the UniqueId represents a ; otherwise false. - buffer is null. - buffer and offset provide less than 16 valid bytes. - - - Tries to get the value of the as a and store it in the given byte array at the specified offest. - byte array that will contain the . - Position in the byte array to start inserting the value. - true if the value stored in this instance of is a ; otherwise false. - buffer is null. - offset less than zero or greater than the length of the array. - buffer and offset provide less than 16 valid bytes. - - - Specifies the type of validation to perform. - - - Validates if DTD or schema information is found. - - - - Validates according to the DTD. - - - - No validation is performed. This setting creates an XML 1.0 compliant non-validating parser. - - - - Validate according to XML Schema definition language (XSD) schemas, including inline XML Schemas. XML Schemas are associated with namespace URIs either by using the schemaLocation attribute or the provided Schemas property. - - - - Validate according to XML-Data Reduced (XDR) schemas, including inline XDR schemas. XDR schemas are recognized using the x-schema namespace prefix or the property. - - - - Specifies how white space is handled. - - - Return Whitespace and SignificantWhitespace nodes. This is the default. - - - - Return no Whitespace and no SignificantWhitespace nodes. - - - - Return SignificantWhitespace nodes only. - - - - Specifies the state of the . - - - Indicates that an attribute value is being written. - - - - Indicates that the method has been called. - - - - Indicates that element content is being written. - - - - Indicates that an element start tag is being written. - - - - An exception has been thrown, which has left the in an invalid state. You can call the method to put the in the state. Any other method calls results in an . - - - - Indicates that the prolog is being written. - - - - Indicates that a Write method has not yet been called. - - - - Represents an attribute. Valid and default values for the attribute are defined in a document type definition (DTD) or schema. - - - Initializes a new instance of the class. - The namespace prefix. - The local name of the attribute. - The namespace uniform resource identifier (URI). - The parent XML document. - - - Adds the specified node to the end of the list of child nodes, of this node. - The to add. - The added. - This node is of a type that does not allow child nodes of the type of the newChild node. The newChild is an ancestor of this node. - The newChild was created from a different document than the one that created this node. This node is read-only. - - - Gets the base Uniform Resource Identifier (URI) of the node. - The location from which the node was loaded or String.Empty if the node has no base URI. Attribute nodes have the same base URI as their owner element. If an attribute node does not have an owner element, BaseURI returns String.Empty. - - - Creates a duplicate of this node. - true to recursively clone the subtree under the specified node; false to clone only the node itself - The duplicate node. - - - Sets the concatenated values of the node and all its children. - The concatenated values of the node and all its children. For attribute nodes, this property has the same functionality as the property. - - - Sets the value of the attribute. - The attribute value. - The XML specified when setting this property is not well-formed. - - - Inserts the specified node immediately after the specified reference node. - The to insert. - The that is the reference node. The newChild is placed after the refChild. - The inserted. - This node is of a type that does not allow child nodes of the type of the newChild node. The newChild is an ancestor of this node. - The newChild was created from a different document than the one that created this node. The refChild is not a child of this node. This node is read-only. - - - Inserts the specified node immediately before the specified reference node. - The to insert. - The that is the reference node. The newChild is placed before this node. - The inserted. - The current node is of a type that does not allow child nodes of the type of the newChild node. The newChild is an ancestor of this node. - The newChild was created from a different document than the one that created this node. The refChild is not a child of this node. This node is read-only. - - - Gets the local name of the node. -

The name of the attribute node with the prefix removed. In the following example , the LocalName of the attribute is genre.

-

-
-
- - Gets the qualified name of the node. - The qualified name of the attribute node. - - - Gets the namespace URI of this node. - The namespace URI of this node. If the attribute is not explicitly given a namespace, this property returns String.Empty. - - - Gets the type of the current node. - The node type for XmlAttribute nodes is XmlNodeType.Attribute. - - - Gets the to which this node belongs. - An XML document to which this node belongs. - - - Gets the to which the attribute belongs. - The XmlElement that the attribute belongs to or null if this attribute is not part of an XmlElement. - - - Gets the parent of this node. For XmlAttribute nodes, this property always returns null. - For XmlAttribute nodes, this property always returns null. - - - Gets or sets the namespace prefix of this node. - The namespace prefix of this node. If there is no prefix, this property returns String.Empty. - This node is read-only. - The specified prefix contains an invalid character. The specified prefix is malformed. The namespaceURI of this node is null. The specified prefix is "xml", and the namespaceURI of this node is different from "http://www.w3.org/XML/1998/namespace". This node is an attribute, the specified prefix is "xmlns", and the namespaceURI of this node is different from "http://www.w3.org/2000/xmlns/". This node is an attribute, and the qualifiedName of this node is "xmlns" [Namespaces]. - - - Adds the specified node to the beginning of the list of child nodes for this node. - The to add. If it is an , the entire contents of the document fragment are moved into the child list of this node. - The added. - This node is of a type that does not allow child nodes of the type of the newChild node. The newChild is an ancestor of this node. - The newChild was created from a different document than the one that created this node. This node is read-only. - - - Removes the specified child node. - The to remove. - The removed. - The oldChild is not a child of this node. Or this node is read-only. - - - Replaces the child node specified with the new child node specified. - The new child . - The to replace. - The replaced. - This node is of a type that does not allow child nodes of the type of the newChild node. The newChild is an ancestor of this node. - The newChild was created from a different document than the one that created this node. This node is read-only. The oldChild is not a child of this node. - - - Gets the post-schema-validation-infoset that has been assigned to this node as a result of schema validation. - An containing the post-schema-validation-infoset of this node. - - - Gets a value indicating whether the attribute value was explicitly set. - true if this attribute was explicitly given a value in the original instance document; otherwise, false. A value of false indicates that the value of the attribute came from the DTD. - - - Gets or sets the value of the node. - The value returned depends on the of the node. For XmlAttribute nodes, this property is the value of attribute. - The node is read-only and a set operation is called. - - - Saves all the children of the node to the specified . - The XmlWriter to which you want to save. - - - Saves the node to the specified . - The XmlWriter to which you want to save. - - - Represents a collection of attributes that can be accessed by name or index. - - - Inserts the specified attribute as the last node in the collection. - The to insert. - The XmlAttribute to append to the collection. - node was created from a document different from the one that created this collection. - - - Copies all the objects from this collection into the given array. - The array that is the destination of the objects copied from this collection. - The index in the array where copying begins. - - - Inserts the specified attribute immediately after the specified reference attribute. - The to insert. - The that is the reference attribute. newNode is placed after the refNode. - The XmlAttribute to insert into the collection. - The newNode was created from a document different from the one that created this collection. Or the refNode is not a member of this collection. - - - Inserts the specified attribute immediately before the specified reference attribute. - The to insert. - The that is the reference attribute. newNode is placed before the refNode. - The XmlAttribute to insert into the collection. - The newNode was created from a document different from the one that created this collection. Or the refNode is not a member of this collection. - - - Gets the attribute with the specified index. - The index of the attribute. - The at the specified index. - The index being passed in is out of range. - - - Gets the attribute with the specified name. - The qualified name of the attribute. - The with the specified name. If the attribute does not exist, this property returns null. - - - Gets the attribute with the specified local name and namespace Uniform Resource Identifier (URI). - The local name of the attribute. - The namespace URI of the attribute. - The with the specified local name and namespace URI. If the attribute does not exist, this property returns null. - - - Inserts the specified attribute as the first node in the collection. - The to insert. - The XmlAttribute added to the collection. - - - Removes the specified attribute from the collection. - The to remove. - The node removed or null if it is not found in the collection. - - - Removes all attributes from the collection. - - - Removes the attribute corresponding to the specified index from the collection. - The index of the node to remove. The first node has index 0. - Returns null if there is no attribute at the specified index. - - - Adds a using its property - An attribute node to store in this collection. The node will later be accessible using the name of the node. If a node with that name is already present in the collection, it is replaced by the new one; otherwise, the node is appended to the end of the collection. - If the node replaces an existing node with the same name, the old node is returned; otherwise, the added node is returned. - node was created from a different than the one that created this collection. This XmlAttributeCollection is read-only. - node is an that is already an attribute of another object. To re-use attributes in other elements, you must clone the XmlAttribute objects you want to re-use. - - - For a description of this member, see . - The array that is the destination of the objects copied from this collection. - The index in the array where copying begins. - - - For a description of this member, see . - Returns an int that contains the count of the attributes. - - - For a description of this member, see . - Returns true if the collection is synchronized. - - - For a description of this member, see . - Returns the that is the root of the collection. - - - Enables optimized strings to be managed in a dynamic way. - - - Initializes a new instance of the class. - - - Creates an from the input parameters and adds it to an internal collection. - The key value. - The value. - The newly created that is added to an internal collection. - id is less than zero. - value is null. - An entry with key = id already exists. - - - Clears the internal collection of all contents. - - - Checks whether the internal collection contains an entry matching a key. - The key to search on. - When this method returns, contains a string if an entry is found; otherwise, null. This parameter is passed uninitialized. - true if an entry matching the key was found; otherwise, false. - key is null. - - - Checks whether the internal collection contains an entry matching a value. - The value to search for. - When this method returns, contains a string if an entry is found; otherwise, null. This parameter is passed uninitialized. - true if an entry matching the value was found; otherwise, false. - value is null. - - - Checks whether the internal collection contains an entry matching a value. - The value to search for. - When this method returns, contains a string if an entry is found; otherwise, null. This parameter is passed uninitialized. - true if an entry matching the value was found; otherwise, false. - value is null. - - - Enables using a dynamic dictionary to compress common strings that appear in a message and maintain state. - - - Creates an instance of this class. - - - Clears out the internal collections. - - - Tries to add an to the internal collection. - The to add. - The key of the that was successfully added. - true if the string could be added; otherwise, false. - value is null. - An entry with key = key already exists. - - - Represents a CDATA section. - - - Initializes a new instance of the class. - that contains character data. - object. - - - Creates a duplicate of this node. - true to recursively clone the subtree under the specified node; false to clone only the node itself. Because CDATA nodes do not have children, regardless of the parameter setting, the cloned node will always include the data content. - The cloned node. - - - Gets the local name of the node. - For CDATA nodes, the local name is #cdata-section. - - - Gets the qualified name of the node. - For CDATA nodes, the name is #cdata-section. - - - Gets the type of the current node. - The node type. For CDATA nodes, the value is XmlNodeType.CDATA. - - - Gets the parent of this node (for nodes that can have parents). - The XmlNode that is the parent of the current node. If a node has just been created and not yet added to the tree, or if it has been removed from the tree, the parent is null. For all other nodes, the value returned depends on the of the node. The following table describes the possible return values for the ParentNode property. - - - Gets the text node that immediately precedes this node. - Returns . - - - Saves the children of the node to the specified . - The XmlWriter to which you want to save. - - - Saves the node to the specified . - The XmlWriter to which you want to save. - - - Provides text manipulation methods that are used by several classes. - - - Initializes a new instance of the class. - String that contains character data to be added to document. - to contain character data. - - - Appends the specified string to the end of the character data of the node. - The string to insert into the existing string. - - - Contains the data of the node. - The data of the node. - - - Removes a range of characters from the node. - The position within the string to start deleting. - The number of characters to delete. - - - Gets or sets the concatenated values of the node and all the children of the node. - The concatenated values of the node and all the children of the node. - - - Inserts the specified string at the specified character offset. - The position within the string to insert the supplied string data. - The string data that is to be inserted into the existing string. - - - Gets the length of the data, in characters. - The length, in characters, of the string in the property. The length may be zero; that is, CharacterData nodes can be empty. - - - Replaces the specified number of characters starting at the specified offset with the specified string. - The position within the string to start replacing. - The number of characters to replace. - The new data that replaces the old string data. - - - Retrieves a substring of the full string from the specified range. - The position within the string to start retrieving. An offset of zero indicates the starting point is at the start of the data. - The number of characters to retrieve. - The substring corresponding to the specified range. - - - Gets or sets the value of the node. - The value of the node. - Node is read-only. - - - Represents the content of an XML comment. - - - Initializes a new instance of the class. - The content of the comment element. - The parent XML document. - - - Creates a duplicate of this node. - true to recursively clone the subtree under the specified node; false to clone only the node itself. Because comment nodes do not have children, the cloned node always includes the text content, regardless of the parameter setting. - The cloned node. - - - Gets the local name of the node. - For comment nodes, the value is #comment. - - - Gets the qualified name of the node. - For comment nodes, the value is #comment. - - - Gets the type of the current node. - For comment nodes, the value is XmlNodeType.Comment. - - - Saves all the children of the node to the specified . Because comment nodes do not have children, this method has no effect. - The XmlWriter to which you want to save. - - - Saves the node to the specified . - The XmlWriter to which you want to save. - - - Encodes and decodes XML names, and provides methods for converting between common language runtime types and XML Schema definition language (XSD) types. When converting data types, the values returned are locale-independent. - - - Initializes a new instance of the class. - - - Decodes a name. This method does the reverse of the and methods. - The name to be transformed. - The decoded name. - - - Converts the name to a valid XML local name. - The name to be encoded. - The encoded name. - - - Converts the name to a valid XML name. - A name to be translated. - Returns the name with any invalid characters replaced by an escape string. - - - Verifies the name is valid according to the XML specification. - The name to be encoded. - The encoded name. - - - Checks whether the passed-in character is a valid non-colon character type. - The character to verify as a non-colon character. - Returns true if the character is a valid non-colon character type; otherwise, false. - - - Returns the passed-in character instance if the character in the argument is a valid public id character, otherwise null. - object to validate. - Returns the passed-in character if the character is a valid public id character, otherwise null. - - - Checks if the passed-in character is a valid Start Name Character type. - The character to validate. - true if the character is a valid Start Name Character type; otherwise, false. - - - Checks if the passed-in character is a valid XML whitespace character. - The character to validate. - true if the passed in character is a valid XML whitespace character; otherwise false. - - - Checks if the passed-in character is a valid XML character. - The character to validate. - true if the passed in character is a valid XML character; otherwise false. - - - Checks if the passed-in surrogate pair of characters is a valid XML character. - The surrogate character to validate. - The surrogate character to validate. - true if the passed in surrogate pair of characters is a valid XML character; otherwise false. - - - Converts the to a equivalent. - The string to convert. - A Boolean value, that is, true or false. - s is null. - s does not represent a Boolean value. - - - Converts the to a equivalent. - The string to convert. - A Byte equivalent of the string. - s is null. - s is not in the correct format. - s represents a number less than or greater than . - - - Converts the to a equivalent. - The string containing a single character to convert. - A Char representing the single character. - The value of the s parameter is null. - The s parameter contains more than one character. - - - Converts the to a equivalent. - The string to convert. - A DateTime equivalent of the string. - s is null. - s is an empty string or is not in the correct format. - - - Converts the to a equivalent. - The string to convert. - The format structure to apply to the converted DateTime. Valid formats include "yyyy-MM-ddTHH:mm:sszzzzzz" and its subsets. The string is validated against this format. - A DateTime equivalent of the string. - s is null. - s or format is String.Empty -or- s does not contain a date and time that corresponds to format. - - - Converts the to a equivalent. - The string to convert. - An array containing the format structures to apply to the converted DateTime. Valid formats include "yyyy-MM-ddTHH:mm:sszzzzzz" and its subsets. - A DateTime equivalent of the string. - s is null. - s or an element of formats is String.Empty -or- s does not contain a date and time that corresponds to any of the elements of formats. - - - Converts the to a using the specified - The value to convert. - One of the values that specify whether the date should be converted to local time or preserved as Coordinated Universal Time (UTC), if it is a UTC date. - A equivalent of the . - s is null. - The dateTimeOption value is null. - s is an empty string or is not in a valid format. - - - Converts the supplied to a equivalent. - The string to convert. - An array of formats from which s can be converted. Each format in formats can be any subset of the W3C Recommendation for the XML dateTime type. (For more information see http://www.w3.org/TR/xmlschema-2/#dateTime.) The string s is validated against one of these formats. - The equivalent of the supplied string. - - - Converts the supplied to a equivalent. - The string to convert. - The format from which s is converted. The format parameter can be any subset of the W3C Recommendation for the XML dateTime type. (For more information see http://www.w3.org/TR/xmlschema-2/#dateTime.) The string s is validated against this format. - The equivalent of the supplied string. - s is null. - s or format is an empty string or is not in the specified format. - - - Converts the supplied to a equivalent. - The string to convert. Note The string must conform to a subset of the W3C Recommendation for the XML dateTime type. For more information see http://www.w3.org/TR/xmlschema-2/#dateTime. - The equivalent of the supplied string. - s is null. - The argument passed to this method is outside the range of allowable values. For information about allowable values, see . - The argument passed to this method does not conform to a subset of the W3C Recommendations for the XML dateTime type. For more information see http://www.w3.org/TR/xmlschema-2/#dateTime. - - - Converts the to a equivalent. - The string to convert. - A Decimal equivalent of the string. - s is null. - s is not in the correct format. - s represents a number less than or greater than . - - - Converts the to a equivalent. - The string to convert. - A Double equivalent of the string. - s is null. - s is not in the correct format. - s represents a number less than or greater than . - - - Converts the to a equivalent. - The string to convert. - A Guid equivalent of the string. - - - Converts the to a equivalent. - The string to convert. - An Int16 equivalent of the string. - s is null. - s is not in the correct format. - s represents a number less than or greater than . - - - Converts the to a equivalent. - The string to convert. - An Int32 equivalent of the string. - s is null. - s is not in the correct format. - s represents a number less than or greater than . - - - Converts the to a equivalent. - The string to convert. - An Int64 equivalent of the string. - s is null. - s is not in the correct format. - s represents a number less than or greater than . - - - Converts the to a equivalent. - The string to convert. - An SByte equivalent of the string. - s is null. - s is not in the correct format. - s represents a number less than or greater than . - - - Converts the to a equivalent. - The string to convert. - A Single equivalent of the string. - s is null. - s is not in the correct format. - s represents a number less than or greater than . - - - Converts the to a . - The value to convert. - A string representation of the Single. - - - Converts the to a . - The value to convert. - A string representation of the TimeSpan. - - - Converts the to a . - The value to convert. - A string representation of the UInt16. - - - Converts the to a . - The value to convert. - A string representation of the UInt32. - - - Converts the supplied to a in the specified format. - The to be converted. - The format to which s is converted. The format parameter can be any subset of the W3C Recommendation for the XML dateTime type. (For more information see http://www.w3.org/TR/xmlschema-2/#dateTime.) - A representation in the specified format of the supplied . - - - Converts the to a . - The value to convert. - The format structure that defines how to display the converted string. Valid formats include "yyyy-MM-ddTHH:mm:sszzzzzz" and its subsets. - A string representation of the DateTime in the specified format. - - - Converts the to a using the specified. - The value to convert. - One of the values that specify how to treat the value. - A equivalent of the . - The dateTimeOption value is not valid. - The value or dateTimeOption value is null. - - - Converts the to a . - The value to convert. - A string representation of the SByte. - - - Converts the to a . - The value to convert. - A string representation of the UInt64. - - - Converts the to a . - The value to convert. - A string representation of the Int64. - - - Converts the to a . - The value to convert. - A string representation of the Boolean, that is, "true" or "false". - - - Converts the to a . - The value to convert. - A string representation of the Int16. - - - Converts the to a . - The value to convert. - A string representation of the Guid. - - - Converts the to a . - The value to convert. - A string representation of the Double. - - - Converts the to a . - The value to convert. - A string representation of the Decimal. - - - Converts the supplied to a . - The to be converted. - A representation of the supplied . - - - Converts the to a . - The value to convert. - A string representation of the DateTime in the format yyyy-MM-ddTHH:mm:ss where 'T' is a constant literal. - - - Converts the to a . - The value to convert. - A string representation of the Char. - - - Converts the to a . - The value to convert. - A string representation of the Byte. - - - Converts the to a . - The value to convert. - A string representation of the Int32. - - - Converts the to a equivalent. - The string to convert. The string format must conform to the W3C XML Schema Part 2: Datatypes recommendation for duration. - A TimeSpan equivalent of the string. - s is not in correct format to represent a TimeSpan value. - - - Converts the to a equivalent. - The string to convert. - A UInt16 equivalent of the string. - s is null. - s is not in the correct format. - s represents a number less than or greater than . - - - Converts the to a equivalent. - The string to convert. - A UInt32 equivalent of the string. - s is null. - s is not in the correct format. - s represents a number less than or greater than . - - - Converts the to a equivalent. - The string to convert. - A UInt64 equivalent of the string. - s is null. - s is not in the correct format. - s represents a number less than or greater than . - - - Verifies that the name is a valid name according to the W3C Extended Markup Language recommendation. - The name to verify. - The name, if it is a valid XML name. - name is not a valid XML name. - name is null or String.Empty. - - - Verifies that the name is a valid NCName according to the W3C Extended Markup Language recommendation. An NCName is a name that cannot contain a colon. - The name to verify. - The name, if it is a valid NCName. - name is null or String.Empty. - name is not a valid non-colon name. - - - Verifies that the string is a valid NMTOKEN according to the W3C XML Schema Part2: Datatypes recommendation - The string you wish to verify. - The name token, if it is a valid NMTOKEN. - The string is not a valid name token. - name is null. - - - Returns the passed in string instance if all the characters in the string argument are valid public id characters. - that contains the id to validate. - Returns the passed-in string if all the characters in the argument are valid public id characters. - - - Verifies that the string is a valid token according to the W3C XML Schema Part2: Datatypes recommendation. - The string value you wish to verify. - The token, if it is a valid token. - The string value is not a valid token. - - - Returns the passed-in string instance if all the characters in the string argument are valid whitespace characters. - to verify. - Returns the passed-in string instance if all the characters in the string argument are valid whitespace characters, otherwise null. - - - Returns the passed-in string if all the characters and surrogate pair characters in the string argument are valid XML characters, otherwise an XmlException is thrown with information on the first invalid character encountered. - that contains characters to verify. - Returns the passed-in string if all the characters and surrogate-pair characters in the string argument are valid XML characters, otherwise an XmlException is thrown with information on the first invalid character encountered. - - - Specifies how to treat the time value when converting between string and . - - - Treat as local time. If the object represents a Coordinated Universal Time (UTC), it is converted to the local time. - - - - Time zone information should be preserved when converting. - - - - Treat as a local time if a is being converted to a string. - - - - Treat as a UTC. If the object represents a local time, it is converted to a UTC. - - - - Represents the XML declaration node <?xml version='1.0'...?>. - - - Initializes a new instance of the class. - The XML version; see the property. - The encoding scheme; see the property. - Indicates whether the XML document depends on an external DTD; see the property. - The parent XML document. - - - Creates a duplicate of this node. - true to recursively clone the subtree under the specified node; false to clone only the node itself. Because XmlDeclaration nodes do not have children, the cloned node always includes the data value, regardless of the parameter setting. - The cloned node. - - - Gets or sets the encoding level of the XML document. - The valid character encoding name. The most commonly supported character encoding names for XML are the following: Category - - Encoding Names - - Unicode - - UTF-8, UTF-16 - - ISO 10646 - - ISO-10646-UCS-2, ISO-10646-UCS-4 - - ISO 8859 - - ISO-8859-n (where "n" is a digit from 1 to 9) - - JIS X-0208-1997 - - ISO-2022-JP, Shift_JIS, EUC-JP - - This value is optional. If a value is not set, this property returns String.Empty. If an encoding attribute is not included, UTF-8 encoding is assumed when the document is written or saved out. - - - Gets or sets the concatenated values of the XmlDeclaration. - The concatenated values of the XmlDeclaration (that is, everything between <?xml and ?>). - - - Gets the local name of the node. - For XmlDeclaration nodes, the local name is xml. - - - Gets the qualified name of the node. - For XmlDeclaration nodes, the name is xml. - - - Gets the type of the current node. - For XmlDeclaration nodes, this value is XmlNodeType.XmlDeclaration. - - - Gets or sets the value of the standalone attribute. - Valid values are yes if all entity declarations required by the XML document are contained within the document or no if an external document type definition (DTD) is required. If a standalone attribute is not present in the XML declaration, this property returns String.Empty. - - - Gets or sets the value of the XmlDeclaration. - The contents of the XmlDeclaration (that is, everything between <?xml and ?>). - - - Gets the XML version of the document. - The value is always 1.0. - - - Saves the children of the node to the specified . Because XmlDeclaration nodes do not have children, this method has no effect. - The XmlWriter to which you want to save. - - - Saves the node to the specified . - The XmlWriter to which you want to save. - - - Implements a dictionary used to optimize Windows Communication Foundation (WCF)'s XML reader/writer implementations. - - - Creates an empty . - - - Creates a with an initial capacity. - The initial size of the dictionary. - - - Adds a string to the . - String to add to the dictionary. - The that was added. - - - Gets a static empty . - A static empty . - - - Attempts to look up an entry in the dictionary. - Key to look up. - If key is defined, the that is mapped to the key; otherwise null. - true if key is in the dictionary, otherwise false. - - - Checks the dictionary for a specified string value. - String value being checked for. - The corresponding , if found; otherwise null. - true if value is in the dictionary, otherwise false. - value is null. - - - Checks the dictionary for a specified . - The being checked for. - The matching , if found; otherwise null. - true if is in the dictionary, otherwise false. - value is null. - - - An abstract class that the Windows Communication Foundation (WCF) derives from to do serialization and deserialization. - - - Creates an instance of this class. Invoked only by its derived classes. - - - This property always returns false. Its derived classes can override to return true if they support canonicalization. - Returns false. - - - Creates an instance of that can read .NET Binary XML Format. - The buffer from which to read. - The quotas that apply to this operation. - An instance of . - buffer is null. - - - Creates an instance of that can read .NET Binary XML Format. - The stream from which to read. - The quotas that apply to this operation. - An instance of . - stream is null. - - - Creates an instance of that can read .NET Binary XML Format. - The stream from which to read. - to use. - The quotas that apply to this operation. - An instance of . - stream or quotas is null. - - - Creates an instance of that can read .NET Binary XML Format. - The buffer from which to read. - The starting position from which to read in buffer. - The number of bytes that can be read from buffer. - The quotas that apply to this operation. - An instance of . - buffer is null. - count is less than zero or greater than the buffer length minus the offset. - - - Creates an instance of that can read .NET Binary XML Format. - The stream from which to read. - to use. - The quotas that apply to this operation. - to use. - An instance of . - stream is null. - - - Creates an instance of that can read .NET Binary XML Format. - The buffer from which to read. - The starting position from which to read in buffer. - The number of bytes that can be read from buffer. - to use. - The quotas that apply to this operation. - An instance of . - buffer is null. - count is less than zero or greater than the buffer length minus the offset. - - - Creates an instance of that can read .NET Binary XML Format. - The stream from which to read. - to use. - to apply. - to use. - Delegate to be called when the reader is closed. - An instance of . - stream is null. - - - Creates an instance of that can read .NET Binary XML Format. - The buffer from which to read. - The starting position from which to read in buffer. - The number of bytes that can be read from buffer. - The to use. - The to apply. - The to use. - An instance of . - buffer is null. - count is less than zero or greater than the buffer length minus the offset. - - - Creates an instance of that can read .NET Binary XML Format. - The buffer from which to read. - The starting position from which to read in buffer. - The number of bytes that can be read from buffer. - The to use. - The to apply. - The to use. - Delegate to be called when the reader is closed. - An instance of . - buffer is null. - count is less than zero or greater than the buffer length minus the offset. - - - Creates an instance of from an existing . - An instance of . - An instance of . - reader is null. - - - Creates an instance of that reads XML in the MTOM format. - The buffer from which to read. - The starting position from which to read in buffer. - The number of bytes that can be read from buffer. - The possible character encodings of the input. - The Content-Type MIME type of the message. - The to apply to the reader. - The maximum allowed size of the buffer. - The delegate to be called when the reader is closed. - An instance of . - - - Creates an instance of that reads XML in the MTOM format. - The stream from which to read. - The possible character encodings of the stream. - The Content-Type MIME type of the message. - The MIME type of the message. - The to apply to the reader. - The delegate to be called when the reader is closed. - An instance of . - - - Creates an instance of that reads XML in the MTOM format. - The buffer from which to read. - The starting position from which to read in buffer. - The number of bytes that can be read from buffer. - The possible character encodings of the input. - The Content-Type MIME type of the message. - The quotas to apply to this reader. - An instance of . - - - Creates an instance of that reads XML in the MTOM format. - The buffer from which to read. - The starting position from which to read in buffer. - The number of bytes that can be read from buffer. - The possible character encodings of the input. - The quotas to apply to this reader. - An instance of . - - - Creates an instance of that reads XML in the MTOM format. - The stream from which to read. - The possible character encoding of the stream. - The quotas to apply to this reader. - An instance of . - encoding is null. - - - Creates an instance of that reads XML in the MTOM format. - The stream from which to read. - The possible character encodings of the stream. - The Content-Type MIME type of the message. - The quotas to apply to this reader. - An instance of . - - - Creates an instance of that reads XML in the MTOM format. - The stream from which to read. - The possible character encodings of the stream. - The quotas to apply to this reader. - An instance of . - encoding is null. - - - Creates an instance of that reads XML in the MTOM format. - The buffer from which to read. - The starting position from which to read in buffer. - The number of bytes that can be read from buffer. - The possible character encoding of the input. - The quotas to apply to this reader. - An instance of . - encoding is null. - - - Creates an instance of . - The stream from which to read. - The object that specifies the encoding properties to apply. - The to apply. - The delegate to be called when the reader is closed. - An instance of . - - - Creates an instance of . - The buffer from which to read. - The quotas applied to the reader. - An instance of . - buffer is null. - - - Creates an instance of . - The stream from which to read. - The quotas applied to the reader. - An instance of . - - - Creates an instance of . - The buffer from which to read. - The starting position from which to read in buffer. - The number of bytes that can be read from buffer. - The quotas applied to the reader. - An instance of . - - - Creates an instance of . - The buffer from which to read. - The starting position from which to read in buffer. - The number of bytes that can be read from buffer. - The object that specifies the encoding properties to apply. - The to apply. - The delegate to be called when the reader is closed. - An instance of . - - - This method is not yet implemented. - Always. - - - When overridden in a derived class, gets the value of an attribute. - An that represents the local name of the attribute. - An that represents the namespace of the attribute. - The value of the attribute. - - - Gets non-atomized names. - The local name. - The namespace for the local localName. - - - Gets the index of the local name of the current node within an array of names. - The string array of local names to be searched. - The namespace of current node. - The index of the local name of the current node within an array of names. - namespaceUri is null. - - - Gets the index of the local name of the current node within an array of names. - The array of local names to be searched. - The namespace of current node. - The index of the local name of the current node within an array of names. - namespaceUri is null. - - - Checks whether the parameter, localName, is the local name of the current node. - The local name of the current node. - true if localName matches local name of the current node; otherwise false. - - - Checks whether the parameter, localName, is the local name of the current node. - An that represents the local name of the current node. - true if localName matches local name of the current node; otherwise false. - localName is null. - - - Checks whether the parameter, namespaceUri, is the namespace of the current node. - The namespace of current node. - true if namespaceUri matches namespace of the current node; otherwise false. - namespaceUri is null. - - - Checks whether the parameter, namespaceUri, is the namespace of the current node. - Namespace of current node. - true if namespaceUri matches namespace of the current node; otherwise false. - namespaceUri is null. - - - Checks whether the reader is positioned at the start of an array. This class returns false, but derived classes that have the concept of arrays might return true. - Type of the node, if a valid node; otherwise null. - true if the reader is positioned at the start of an array node; otherwise false. - - - Tests whether the first tag is a start tag or empty element tag and if the local name and namespace URI match those of the current node. - An that represents the local name of the attribute. - An that represents the namespace of the attribute. - true if the first tag in the array is a start tag or empty element tag and matches localName and namespaceUri; otherwise false. - - - Tests whether the current node is a text node. - Type of the node being tested. - true if the node type is , , , , or ; otherwise false. - - - Tests whether the current content node is a start element or an empty element and if the and properties of the element matches the given argument. - The local name of the element. - The namespace URI of the element. - - - Tests whether the current content node is a start element or an empty element and if the and properties of the element matches the given arguments. - The local name of the element. - The namespace URI of the element. - - - Tests whether the current content node is a start element or an empty element and if the property of the element matches the given argument. - The property of the element. - - - Tests whether the current content node is a start element or an empty element. - - - Gets the quota values that apply to the current instance of this class. - The that applies to the current instance of this class. - - - Reads repeated occurrences of float numbers into a typed array. - The local name of the element. - The namespace URI of the element. - The array into which the float numbers are put. - The starting index in the array. - The number of float numbers to put in the array. - The number of float numbers put in the array. - array is null. - count is < 0 or > array length minus offset. - - - Reads repeated occurrences of long integers into a typed array. - The local name of the element. - The namespace URI of the element. - The array into which the integers are put. - The starting index in the array. - The number of integers to put in the array. - The number of integers put in the array. - array is null. - count is < 0 or > array length minus offset. - - - Reads repeated occurrences of integers into a typed array. - The local name of the element. - The namespace URI of the element. - The array into which the integers are put. - The starting index in the array. - The number of integers to put in the array. - The number of integers put in the array. - array is null. - count is < 0 or > array length minus offset. - - - Reads repeated occurrences of short integers into a typed array. - The local name of the element. - The namespace URI of the element. - The array into which the integers are put. - The starting index in the array. - The number of integers to put in the array. - The number of integers put in the array. - array is null. - count is < 0 or > array length minus offset. - - - Reads repeated occurrences of nodes into a typed array. - The local name of the element. - The namespace URI of the element. - The array into which the nodes are put. - The starting index in the array. - The number of nodes to put in the array. - The number of nodes put in the array. - array is null. - count is < 0 or > array length minus offset. - - - Reads repeated occurrences of nodes type into a typed array. - The local name of the element. - The namespace URI of the element. - The array into which the nodes are put. - The starting index in the array. - The number of nodes to put in the array. - The number of nodes put in the array. - array is null. - count is < 0 or > array length minus offset. - - - Reads repeated occurrences of nodes into a typed array. - The local name of the element. - The namespace URI of the element. - The array into which the nodes are put. - The starting index in the array. - The number of nodes to put in the array. - The number of nodes put in the array. - array is null. - count is < 0 or > array length minus offset. - - - Reads repeated occurrences of nodes into a typed array. - The local name of the element. - The namespace URI of the element. - The array into which the nodes are put. - The starting index in the array. - The number of nodes to put in the array. - The number of nodes put in the array. - array is null. - count is < 0 or > array length minus offset. - - - Reads repeated occurrences of nodes into a typed array. - The local name of the element. - The namespace URI of the element. - The array into which the nodes are put. - The starting index in the array. - The number of nodes to put in the array. - The number of nodes put in the array. - array is null. - count is < 0 or > array length minus offset. - - - Reads repeated occurrences of nodes into a typed array. - The local name of the element. - The namespace URI of the element. - The array into which the nodes are put. - The starting index in the array. - The number of nodes to put in the array. - The number of nodes put in the array. - array is null. - count is < 0 or > array length minus offset. - - - Reads repeated occurrences of float numbers into a typed array. - The local name of the element. - The namespace URI of the element. - The array into which the float numbers are put. - The starting index in the array. - The number of float numbers to put in the array. - The umber of float numbers put in the array. - array is null. - count is < 0 or > array length minus offset. - - - Reads repeated occurrences of nodes into a typed array. - The local name of the element. - The namespace URI of the element. - The array into which the nodes are put. - The starting index in the array. - The number of nodes to put in the array. - The number of nodes put in the array. - array is null. - count is < 0 or > array length minus offset. - - - Reads repeated occurrences of nodes into a typed array. - The local name of the element. - The namespace URI of the element. - The array into which the nodes are put. - The starting index in the array. - The number of nodes to put in the array. - The number of nodes put in the array. - array is null. - count is < 0 or > array length minus offset. - - - Reads repeated occurrences of nodes into a typed array. - The local name of the element. - The namespace URI of the element. - The array into which the nodes are put. - The starting index in the array. - The number of nodes to put in the array. - The number of nodes put in the array. - array is null. - count is < 0 or > array length minus offset. - - - Reads repeated occurrences of nodes into a typed array. - The local name of the element. - The namespace URI of the element. - The array into which the nodes are put. - The starting index in the array. - The number of nodes to put in the array. - The number of nodes put in the array. - array is null. - count is < 0 or > array length minus offset. - - - Reads repeated occurrences of nodes into a typed array. - The local name of the element. - The local name of the element. - The array into which the nodes are put. - The starting index in the array. - The number of nodes to put in the array. - The number of nodes put in the array. - array is null. - count is < 0 or > array length minus offset. - - - Reads repeated occurrences of short integers into a typed array. - The local name of the element. - The namespace URI of the element. - The array into which the integers are put. - The starting index in the array. - The number of integers to put in the array. - The number of integers put in the array. - array is null. - count is < 0 or > array length minus offset. - - - Reads repeated occurrences of integers into a typed array. - The local name of the element. - The namespace URI of the element. - The array into which the integers are put. - The starting index in the array. - The number of integers to put in the array. - The number of integers put in the array. - array is null. - count is < 0 or > array length minus offset. - - - Reads repeated occurrences of long integers into a typed array. - The local name of the element. - The namespace URI of the element. - The array into which the integers are put. - The starting index in the array. - The number of integers to put in the array. - The number of integers put in the array. - array is null. - count is < 0 or > array length minus offset. - - - Reads repeated occurrences of nodes into a typed array. - The local name of the element. - The namespace URI of the element. - The array into which the nodes are put. - The starting index in the array. - The number of nodes to put in the array. - The number of nodes put in the array. - array is null. - count is < 0 or > array length minus offset. - - - Reads repeated occurrences of nodes into a typed array. - The local name of the element. - The namespace URI of the element. - A array of the nodes. - - - Reads repeated occurrences of nodes into a typed array. - The local name of the element. - The namespace URI of the element. - A array of the nodes. - - - Converts a node's content to a specified type. - The of the value to be returned. - An object that is used to resolve any namespace prefixes related to type conversion. For example, this can be used when converting an object to an xs:string. This value can be a null reference. - The concatenated text content or attribute value converted to the requested type. - - - Reads the content and returns the Base64 decoded binary bytes. - A byte array that contains the Base64 decoded binary bytes. - The array size is greater than the MaxArrayLength quota for this reader. - - - Reads the content and returns the BinHex decoded binary bytes. - The maximum array length. - A byte array that contains the BinHex decoded binary bytes. - The array size is greater than maxByteArrayContentLength. - - - Reads the content and returns the BinHex decoded binary bytes. - A byte array that contains the BinHex decoded binary bytes. - The array size is greater than . - - - Reads the content into a char array. - The array into which the characters are put. - The starting index in the array. - The number of characters to put in the array. - Number of characters read. - - - Converts a node's content to decimal. - The decimal representation of node's content. - - - Converts a node's content to float. - The float representation of node's content. - - - Converts a node's content to guid. - The guid representation of node's content. - - - Converts a node's content to a qualified name representation. - The part of the qualified name (out parameter). - The part of the qualified name (out parameter). - - - Converts a node's content to a string. - The node content in a string representation. - - - Converts a node's content to a string. - The maximum string length. - Node content in string representation. - - - Converts a node's content to a string. - The array of strings to match content against. - The index of the entry in strings that matches the content. - The node content in a string representation. - An entry in strings is null. - - - Converts a node's content to a string. - The array of objects to match content against. - The index of the entry in strings that matches the content. - The node content in a string representation. - An entry in strings is null. - - - Converts a node's content to . - representation of node's content. - - - Converts a node's content to a unique identifier. - The node's content represented as a unique identifier. - - - Converts a node's content to a array. - The local name of the element. - The namespace URI of the element. - The node's content represented as a array. - - - Converts a node's content to a array. - The local name of the element. - The namespace URI of the element. - The node's content represented as a array. - - - Converts a node's content to a array. - The local name of the element. - The namespace URI of the element. - The node's content represented as a array. - - - Converts a node's content to a array. - The local name of the element. - The namespace URI of the element. - The node's content represented as a array. - - - Converts a node's content to a array. - The local name of the element. - The namespace URI of the element. - The node's content represented as a array. - - - Converts a node's content to a array. - The local name of the element. - The namespace URI of the element. - The node's content represented as a array. - - - Converts a node's content to a array of Base64 bytes. - The node's content represented as an array of Base64 bytes. - - - Converts a node's content to an array of BinHex bytes. - The node's content represented as an array of BinHex bytes. - - - Converts an element's content to a . - The node's content represented as a . - - - Converts an element's content to a . - The node's content represented as a . - The element is not in valid format. - The element is not in valid format. - - - Converts an element's content to a . - The node's content represented as a . - - - Converts an element's content to a . - The node's content represented as a . - - - Converts an element's content to a floating point number (). - The node's content represented as a floating point number (). - - - Converts an element's content to a . - The node's content represented as a . - The element is not in valid format. - The element is not in valid format. - - - Converts an element's content to an integer (). - The node's content represented as an integer (). - - - Converts an element's content to a long integer (). - The node's content represented as a long integer (). - - - Converts an element's content to a . - The node's content represented as a . - - - Converts an element's content to a . - The node's content represented as a . - - - Converts an element's content to a unique identifier. - The node's content represented as a unique identifier. - The element is not in valid format. - The element is not in valid format. - - - Checks whether the current node is an element and advances the reader to the next node. - returns false. - - - Checks whether the current node is an element with the given name and advances the reader to the next node. - The qualified name of the element. - returns false. - - - Checks whether the current node is an element with the given localName and namespaceUri and advances the reader to the next node. - The local name of the element. - The namespace URI of the element. - returns false. - - - Checks whether the current node is an element with the given localName and namespaceUri and advances the reader to the next node. - The local name of the element. - The namespace URI of the element. - returns false. - - - Reads the contents of a series of nodes with the given localName and namespaceUri into an array of . - The local name of the element. - The namespace URI of the element. - An array of . - - - Reads the contents of a series of nodes with the given localName and namespaceUri into an array of . - The local name of the element. - The namespace URI of the element. - An array of . - - - Reads the contents of a series of nodes with the given localName and namespaceUri into an array of short integers (). - The local name of the element. - The namespace URI of the element. - An array of short integers (). - - - Reads the contents of a series of nodes with the given localName and namespaceUri into an array of short integers (). - The local name of the element. - The namespace URI of the element. - An array of short integers (). - - - Reads the contents of a series of nodes with the given localName and namespaceUri into an array of integers (). - The local name of the element. - The namespace URI of the element. - An array of integers (). - - - Reads the contents of a series of nodes with the given localName and namespaceUri into an array of integers (). - The local name of the element. - The namespace URI of the element. - An array of integers (). - - - Reads the contents of a series of nodes with the given localName and namespaceUri into an array of long integers (). - The local name of the element. - The namespace URI of the element. - An array of long integers (). - - - Reads the contents of a series of nodes with the given localName and namespaceUri into an array of long integers (). - The local name of the element. - The namespace URI of the element. - An array of long integers (). - - - Reads the contents of a series of nodes with the given localName and namespaceUri into an array of float numbers (). - The local name of the element. - The namespace URI of the element. - An array of float numbers (). - - - Reads the contents of a series of nodes with the given localName and namespaceUri into an array of float numbers (). - The local name of the element. - The namespace URI of the element. - An array of float numbers (). - - - Checks whether the current node is an element with the given localName and namespaceUri and advances the reader to the next node. - The local name of the element. - The namespace URI of the element. - - - Reads the contents of the current node into a string with a given maximum length. - Maximum allowed string length. - A string that contains the contents of the current node. - Unable to read the contents of the current node. - Maximum allowed string length exceeded. - - - Reads the contents of the current node into a string. - A string that contains the contents of the current node. - Unable to read the contents of the current node. - Maximum allowed string length exceeded. - - - Reads the contents of a series of nodes with the given localName and namespaceUri into a array. - The local name of the element. - The namespace URI of the element. - A array. - - - Reads the contents of a series of nodes with the given localName and namespaceUri into a array. - The local name of the element. - The namespace URI of the element. - A array. - - - Not implemented. - The buffer from which to read. - The starting position from which to read in buffer. - The number of bytes that can be read from buffer. - Not implemented. - Always. - - - This method is not yet implemented. - The stream to read from. - Determines whether comments are included. - The prefixes to be included. - Always. - - - Not implemented in this class (it always returns false). May be overridden in derived classes. - Returns 0, unless overridden in a derived class. - false, unless overridden in a derived class. - - - Not implemented in this class (it always returns false). May be overridden in derived classes. - Returns 0, unless overridden in a derived class. - false, unless overridden in a derived class. - - - Not implemented in this class (it always returns false). May be overridden in derived classes. - Returns null, unless overridden in a derived class. . - false, unless overridden in a derived class. - - - Not implemented in this class (it always returns false). May be overridden in derived classes. - Returns null, unless overridden in a derived class. - false, unless overridden in a derived class. - - - Not implemented in this class (it always returns false). May be overridden in derived classes. - Returns null, unless overridden in a derived class. - false, unless overridden in a derived class. - - - Contains configurable quota values for XmlDictionaryReaders. - - - Creates a new instance of this class. - - - Sets the properties on a passed-in quotas instance, based on the values in this instance. - The instance to which to copy values. - Trying to set the value, but quota values are read-only for the passed in instance. - Passed in target quotas is null. - - - Gets an instance of this class with all properties set to maximum values. - An instance of with properties set to . - - - Gets and sets the maximum allowed array length. - The maximum allowed array length. The default is 16384. - Trying to set the value, but quota values are read-only for this instance. - Trying to set the value to less than zero. - - - Gets and sets the maximum allowed bytes returned for each read. - The maximum allowed bytes returned for each read. The default is 4096. - Trying to set the value, but quota values are read-only for this instance. - Trying to set the value to less than zero. - - - Gets and sets the maximum nested node depth. - The maximum nested node depth. The default is 32; - Trying to set the value and quota values are read-only for this instance. - Trying to set the value is less than zero. - - - Gets and sets the maximum characters allowed in a table name. - The maximum characters allowed in a table name. The default is 16384. - Trying to set the value, but quota values are read-only for this instance. - Trying to set the value to less than zero. - - - Gets and sets the maximum string length returned by the reader. - The maximum string length returned by the reader. The default is 8192. - Trying to set the value, but quota values are read-only for this instance. - Trying to set the value to less than zero. - - - Gets the modified quotas for the . - The modified quotas for the . - - - Enumerates the configurable quota values for XmlDictionaryReaders. - - - Specifies the maximum allowed array length. - - - - Specifies the maximum allowed bytes returned for each read. - - - - Specifies the maximum nested node depth. - - - - Specifies the maximum characters allowed in a table name. - - - - Specifies the maximum string length returned by the reader. - - - - Represents an entry stored in a . - - - Creates an instance of this class. - The containing this instance. - The string that is the value of the dictionary entry. - The integer that is the key of the dictionary entry. - value is null. - key is less than 0 or greater than / 4. - - - Represents the passed to the constructor of this instance of . - The for this dictionary entry. - - - Gets an representing the empty string. - An representing the empty string. - - - Gets the integer key for this instance of the class. - The integer key for this instance of the class. - - - Displays a text representation of this object. - The string value for this instance of the class. - - - Gets the string value for this instance of the class. - The string value for this instance of the class. - - - Represents an abstract class that Windows Communication Foundation (WCF) derives from to do serialization and deserialization. - - - Initializes a new instance of the class. - - - This property always returns false. Its derived classes can override to return true if they support canonicalization. - false in all cases. - - - Creates an instance of that writes WCF binary XML format. - The stream to write to. - An instance of . - - - Creates an instance of that writes WCF binary XML format. - The stream to write to. - The to use as the shared dictionary. - An instance of . - - - Creates an instance of that writes WCF binary XML format. - The stream to write to. - The to use as the shared dictionary. - The to use. - An instance of . - - - Creates an instance of that writes WCF binary XML format. - The stream from which to read. - The to use as the shared dictionary. - The to use. - true to indicate that the stream is closed by the writer when done; otherwise false. - An instance of . - - - Creates an instance of from an existing . - An instance of . - An instance of . - writer is null. - - - Creates an instance of that writes XML in the MTOM format. - The stream to write to. - The character encoding of the stream. - The maximum number of bytes that are buffered in the writer. - An attribute in the ContentType SOAP header. - An instance of . - - - Creates an instance of that writes XML in the MTOM format. - The stream to write to. - The character encoding of the stream. - The maximum number of bytes that are buffered in the writer. - The content-type of the MIME part that contains the Infoset. - The MIME boundary in the message. - The content-id URI of the MIME part that contains the Infoset. - true to write message headers. - true to indicate that the stream is closed by the writer when done; otherwise false. - An instance of . - - - Creates an instance of that writes text XML. - The stream to write to. - The character encoding of the output. - An instance of . - - - Creates an instance of that writes text XML. - The stream to write to. - The character encoding of the stream. - true to indicate that the stream is closed by the writer when done; otherwise false. - An instance of . - - - Creates an instance of that writes text XML. - The stream to write to. - An instance of . - - - When implemented by a derived class, it stops the canonicalization started by the matching call. - Method is not implemented yet. - - - When implemented by a derived class, it starts the canonicalization. - The stream to write to. - true to include comments; otherwise, false. - The prefixes to be included. - Method is not implemented yet. - - - Writes nodes from a array. - The namespace prefix. - The local name of the element. - The namespace URI of the element. - The array that contains the nodes. - The starting index in the array. - The number of nodes to get from the array. - array is null. - count is < 0 or > array length minus offset. - - - Writes nodes from a array. - The namespace prefix. - The local name of the element. - The namespace URI of the element. - The array that contains the nodes. - The starting index in the array. - The number of nodes to get from the array. - array is null. - count is < 0 or > array length minus offset. - - - Writes nodes from a array. - The namespace prefix. - The local name of the element. - The namespace URI of the element. - The array that contains the nodes. - The starting index in the array. - The number of nodes to get from the array. - array is null. - count is < 0 or > array length minus offset. - - - Writes nodes from a array. - The namespace prefix. - The local name of the element. - The namespace URI of the element. - The array that contains the nodes. - The starting index in the array. - The number of nodes to get from the array. - array is null. - count is < 0 or > array length minus offset. - - - Writes nodes from a array. - The namespace prefix. - The local name of the element. - The namespace URI of the element. - The array that contains the nodes. - The starting index in the array. - The number of nodes to get from the array. - array is null. - count is < 0 or > array length minus offset. - - - Writes nodes from a array. - The namespace prefix. - The local name of the element. - The namespace URI of the element. - The array that contains the nodes. - The starting index in the array. - The number of nodes to get from the array. - array is null. - count is < 0 or > array length minus offset. - - - Writes nodes from a array. - The namespace prefix. - The local name of the element. - The namespace URI of the element. - The array that contains the nodes. - The starting index in the array. - The number of nodes to get from the array. - array is null. - count is < 0 or > array length minus offset. - - - Writes nodes from a array. - The namespace prefix. - The local name of the element. - The namespace URI of the element. - The array that contains the nodes. - The starting index in the array. - The number of nodes to get from the array. - array is null. - count is < 0 or > array length minus offset. - - - Writes nodes from a array. - The namespace prefix. - The local name of the element. - The namespace URI of the element. - The array that contains the nodes. - The starting index in the array. - The number of nodes to get from the array. - array is null. - count is < 0 or > array length minus offset. - - - Writes nodes from a array. - The namespace prefix. - The local name of the element. - The namespace URI of the element. - The array that contains the nodes. - The starting index in the array. - The number of nodes to get from the array. - array is null. - count is < 0 or > array length minus offset. - - - Writes nodes from a array. - The namespace prefix. - The local name of the element. - The namespace URI of the element. - The array that contains the nodes. - The starting index in the array. - The number of nodes to get from the array. - array is null. - count is < 0 or > array length minus offset. - - - Writes nodes from a array. - The namespace prefix. - The local name of the element. - The namespace URI of the element. - The array that contains the nodes. - The starting index in the array. - The number of nodes to get from the array. - array is null. - count is < 0 or > array length minus offset. - - - Writes nodes from a array. - The namespace prefix. - The local name of the element. - The namespace URI of the element. - The array that contains the nodes. - The starting index in the array. - The number of nodes to get from the array. - array is null. - count is < 0 or > array length minus offset. - - - Writes nodes from a array. - The namespace prefix. - The local name of the element. - The namespace URI of the element. - The array that contains the nodes. - The starting index in the array. - The number of nodes to get from the array. - array is null. - count is < 0 or > array length minus offset. - - - Writes nodes from a array. - The namespace prefix. - The local name of the element. - The namespace URI of the element. - The array that contains the nodes. - The starting index in the array. - The number of nodes to get from the array. - array is null. - count is < 0 or > array length minus offset. - - - Writes nodes from a array. - The namespace prefix. - The local name of the element. - The namespace URI of the element. - The array that contains the nodes. - The starting index in the array. - The number of nodes to get from the array. - array is null. - count is < 0 or > array length minus offset. - - - Writes nodes from a array. - The namespace prefix. - The local name of the element. - The namespace URI of the element. - The array that contains the nodes. - The starting index in the array. - The number of nodes to get from the array. - array is null. - count is < 0 or > array length minus offset. - - - Writes nodes from a array. - The namespace prefix. - The local name of the element. - The namespace URI of the element. - The array that contains the nodes. - The starting index in the array. - The number of nodes to get from the array. - array is null. - count is < 0 or > array length minus offset. - - - Writes nodes from a array. - The namespace prefix. - The local name of the element. - The namespace URI of the element. - The array that contains the nodes. - The starting index in the array. - The number of nodes to get from the array. - array is null. - count is < 0 or > array length minus offset. - - - Writes nodes from a array. - The namespace prefix. - The local name of the element. - The namespace URI of the element. - The array that contains the data. - The starting index in the array. - The number of values to write from the array. - array is null. - count is < 0 or > array length minus offset. - - - Writes an attribute qualified name and value. - The local name of the attribute. - The namespace URI of the attribute. - The attribute. - - - Writes an attribute qualified name and value. - The prefix of the attribute. - The local name of the attribute. - The namespace URI of the attribute. - The attribute. - - - Asynchronously encodes the specified binary bytes as Base64 and writes out the resulting text. - Byte array to encode. - The position in the buffer indicating the start of the bytes to write. - The number of bytes to write. - The task that represents the asynchronous WriteBase64 operation. - An asynchronous method was called without setting the flag to true. In this case, is thrown with the message "Set XmlWriterSettings.Async to true if you want to use Async Methods." - - - Writes an element with a text content. - The local name of the element. - The namespace URI of the element. - The element content. - - - Writes an element with a text content. - The prefix of the element. - The local name of the element. - The namespace URI of the element. - The element content. - - - Writes the current XML node from an . - The . - true to copy the default attributes from the ; otherwise, false. - reader is null. - - - Writes the current XML node from an . - The . - true to copy the default attributes from the XmlReader; otherwise, false. - reader is null. - - - Writes out the namespace-qualified name. This method looks up the prefix that is in scope for the given namespace. - The local name of the qualified name. - The namespace URI of the qualified name. - localName is null. - - - Writes the start of an attribute with the specified local name, and namespace URI. - The local name of the attribute. - The namespace URI of the attribute. - - - Writes the start of an attribute with the specified prefix, local name, and namespace URI. - The namespace prefix. - The local name of the attribute. - The namespace URI of the attribute. - - - Writes the specified start tag and associates it with the given namespace. - The local name of the element. - The namespace URI of the element. - The writer is closed. - - - Writes the specified start tag and associates it with the given namespace and prefix. - The prefix of the element. - The local name of the element. - The namespace URI of the element. - The writer is closed. - - - Writes the given text content. - The text to write. - - - Writes the text node that an is currently positioned on. - The to get the text value from. - true to indicate that the reader is positioned on an attribute value or element content; otherwise, false. - - - Writes a value. - The value to write. - - - Writes a value. - The value to write. - - - Writes a value from an . - The value to write. - value is null. - value returns a null stream object. - An method was called before a previous asynchronous operation finished. In this case, is thrown with the message "An asynchronous operation is already in progress." - - - Writes a Unique Id value. - The Unique Id value to write. - value is null. - - - Writes a value. - The value. - - - Asynchronously writes a value from an . - The value to write. - The task that represents the asynchronous WriteValue operation. - An asynchronous method was called without setting the flag to true. In this case, is thrown with the message "Set XmlWriterSettings.Async to true if you want to use Async Methods." - - - Writes a standard XML attribute in the current node. - The local name of the attribute. - The value of the attribute. - - - Writes an XML attribute in the current node. - The local name of the attribute. - The value of the attribute. - - - Writes a namespace declaration attribute. - The prefix that is bound to the given namespace. - The namespace to which the prefix is bound. - namespaceUri is null. - - - Writes a namespace declaration attribute. - The prefix that is bound to the given namespace. - The namespace to which the prefix is bound. - namespaceUri is null. - - - Represents an XML document. You can use this class to load, validate, edit, add, and position XML in a document. - - - Initializes a new instance of the class. - - - Initializes a new instance of the XmlDocument class with the specified . - The XmlImplementation to use. - - - Initializes a new instance of the XmlDocument class with the specified . - The XmlNameTable to use. - - - Gets the base URI of the current node. - The location from which the node was loaded. - - - Creates a duplicate of this node. - true to recursively clone the subtree under the specified node; false to clone only the node itself. - The cloned XmlDocument node. - - - Creates an with the specified . - The qualified name of the attribute. If the name contains a colon, the property reflects the part of the name preceding the first colon and the property reflects the part of the name following the first colon. The remains empty unless the prefix is a recognized built-in prefix such as xmlns. In this case NamespaceURI has a value of http://www.w3.org/2000/xmlns/. - The new XmlAttribute. - - - Creates an with the specified qualified name and . - The qualified name of the attribute. If the name contains a colon then the property will reflect the part of the name preceding the colon and the property will reflect the part of the name after the colon. - The namespaceURI of the attribute. If the qualified name includes a prefix of xmlns, then this parameter must be http://www.w3.org/2000/xmlns/. - The new XmlAttribute. - - - Creates an with the specified , , and . - The prefix of the attribute (if any). String.Empty and null are equivalent. - The local name of the attribute. - The namespace URI of the attribute (if any). String.Empty and null are equivalent. If prefix is xmlns, then this parameter must be http://www.w3.org/2000/xmlns/; otherwise an exception is thrown. - The new XmlAttribute. - - - Creates an containing the specified data. - The content of the new XmlCDataSection. - The new XmlCDataSection. - - - Creates an containing the specified data. - The content of the new XmlComment. - The new XmlComment. - - - Creates a default attribute with the specified prefix, local name and namespace URI. - The prefix of the attribute (if any). - The local name of the attribute. - The namespace URI of the attribute (if any). - The new . - - - Creates an . - The new XmlDocumentFragment. - - - Returns a new object. - Name of the document type. - The public identifier of the document type or null. You can specify a public URI and also a system identifier to identify the location of the external DTD subset. - The system identifier of the document type or null. Specifies the URL of the file location for the external DTD subset. - The DTD internal subset of the document type or null. - The new XmlDocumentType. - - - Creates an element with the specified name. - The qualified name of the element. If the name contains a colon then the property reflects the part of the name preceding the colon and the property reflects the part of the name after the colon. The qualified name cannot include a prefix of'xmlns'. - The new XmlElement. - - - Creates an with the qualified name and . - The qualified name of the element. If the name contains a colon then the property will reflect the part of the name preceding the colon and the property will reflect the part of the name after the colon. The qualified name cannot include a prefix of'xmlns'. - The namespace URI of the element. - The new XmlElement. - - - Creates an element with the specified , , and . - The prefix of the new element (if any). String.Empty and null are equivalent. - The local name of the new element. - The namespace URI of the new element (if any). String.Empty and null are equivalent. - The new . - - - Creates an with the specified name. - The name of the entity reference. - The new XmlEntityReference. - The name is invalid (for example, names starting with'#' are invalid.) - - - Creates a new object for navigating this document. - An object. - - - Creates an object for navigating this document positioned on the specified. - The you want the navigator initially positioned on. - An object. - - - Creates an with the specified node type, , and . - String version of the of the new node. This parameter must be one of the values listed in the table below. - The qualified name of the new node. If the name contains a colon, it is parsed into and components. - The namespace URI of the new node. - The new XmlNode. - The name was not provided and the XmlNodeType requires a name; or nodeTypeString is not one of the strings listed below. - - - Creates an with the specified , , and . - The XmlNodeType of the new node. - The qualified name of the new node. If the name contains a colon then it is parsed into and components. - The namespace URI of the new node. - The new XmlNode. - The name was not provided and the XmlNodeType requires a name. - - - Creates a with the specified , , , and . - The XmlNodeType of the new node. - The prefix of the new node. - The local name of the new node. - The namespace URI of the new node. - The new XmlNode. - The name was not provided and the XmlNodeType requires a name. - - - Creates an with the specified name and data. - The name of the processing instruction. - The data for the processing instruction. - The new XmlProcessingInstruction. - - - Creates an node. -

The string must contain only the following characters &#20; &#10; &#13; and &#9;

- - A new XmlSignificantWhitespace node. -
- - Creates an with the specified text. - The text for the Text node. - The new XmlText node. - - - Creates an node. -

The string must contain only the following characters &#20; &#10; &#13; and &#9;

- - A new XmlWhitespace node. -
- - Creates an node with the specified values. - The version must be "1.0". - The value of the encoding attribute. This is the encoding that is used when you save the to a file or a stream; therefore, it must be set to a string supported by the class, otherwise fails. If this is null or String.Empty, the Save method does not write an encoding attribute on the XML declaration and therefore the default encoding, UTF-8, is used. Note: If the XmlDocument is saved to either a or an , this encoding value is discarded. Instead, the encoding of the TextWriter or the XmlTextWriter is used. This ensures that the XML written out can be read back using the correct encoding. - The value must be either "yes" or "no". If this is null or String.Empty, the Save method does not write a standalone attribute on the XML declaration. - The new XmlDeclaration node. - The values of version or standalone are something other than the ones specified above. - - - Gets the root for the document. - The XmlElement that represents the root of the XML document tree. If no root exists, null is returned. - - - Gets the node containing the DOCTYPE declaration. - The containing the DocumentType (DOCTYPE declaration). - - - Gets the with the specified ID. - The attribute ID to match. - The XmlElement with the matching ID or null if no matching element is found. - - - Returns an containing a list of all descendant elements that match the specified . - The qualified name to match. It is matched against the Name property of the matching node. The special value "*" matches all tags. - An containing a list of all matching nodes. If no nodes match name, the returned collection will be empty. - - - Returns an containing a list of all descendant elements that match the specified and . - The LocalName to match. The special value "*" matches all tags. - NamespaceURI to match. - An containing a list of all matching nodes. If no nodes match the specified localName and namespaceURI, the returned collection will be empty. - - - Gets the object for the current document. - The XmlImplementation object for the current document. - - - Imports a node from another document to the current document. - The node being imported. - true to perform a deep clone; otherwise, false. - The imported . - Calling this method on a node type which cannot be imported. - - - Throws an in all cases. - The values of the node and all its child nodes. - In all cases. - - - Gets or sets the markup representing the children of the current node. - The markup of the children of the current node. - The XML specified when setting this property is not well-formed. - - - Gets a value indicating whether the current node is read-only. - true if the current node is read-only; otherwise false. XmlDocument nodes always return false. - - - Loads the XML document from the specified stream. - The stream containing the XML document to load. - There is a load or parse error in the XML. In this case, a is raised. - - - Loads the XML document from the specified . - The TextReader used to feed the XML data into the document. - There is a load or parse error in the XML. In this case, the document remains empty. - - - Loads the XML document from the specified URL. - URL for the file containing the XML document to load. The URL can be either a local file or an HTTP URL (a Web address). - There is a load or parse error in the XML. In this case, a is raised. - filename is a zero-length string, contains only white space, or contains one or more invalid characters as defined by . - filename is null. - The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters, and file names must be less than 260 characters. - The specified path is invalid (for example, it is on an unmapped drive). - An I/O error occurred while opening the file. - filename specified a file that is read-only. -or- This operation is not supported on the current platform. -or- filename specified a directory. -or- The caller does not have the required permission. - The file specified in filename was not found. - filename is in an invalid format. - The caller does not have the required permission. - - - Loads the XML document from the specified . - The XmlReader used to feed the XML data into the document. - There is a load or parse error in the XML. In this case, the document remains empty. - - - Loads the XML document from the specified string. - String containing the XML document to load. - There is a load or parse error in the XML. In this case, the document remains empty. - - - Gets the local name of the node. - For XmlDocument nodes, the local name is #document. - - - Gets the qualified name of the node. - For XmlDocument nodes, the name is #document. - - - Gets the associated with this implementation. - An XmlNameTable enabling you to get the atomized version of a string within the document. - - - Occurs when the of a node belonging to this document has been changed. - - - - Occurs when the of a node belonging to this document is about to be changed. - - - - Occurs when a node belonging to this document has been inserted into another node. - - - - Occurs when a node belonging to this document is about to be inserted into another node. - - - - Occurs when a node belonging to this document has been removed from its parent. - - - - Occurs when a node belonging to this document is about to be removed from the document. - - - - Gets the type of the current node. - The node type. For XmlDocument nodes, this value is XmlNodeType.Document. - - - Gets the to which the current node belongs. - For XmlDocument nodes ( equals XmlNodeType.Document), this property always returns null. - - - Gets the parent node of this node (for nodes that can have parents). - Always returns null. - - - Gets or sets a value indicating whether to preserve white space in element content. - true to preserve white space; otherwise false. The default is false. - - - Creates an object based on the information in the . The reader must be positioned on a node or attribute. - The XML source - The new XmlNode or null if no more nodes exist. - The reader is positioned on a node type that does not translate to a valid DOM node (for example, EndElement or EndEntity). - - - Saves the XML document to the specified stream. - The stream to which you want to save. - The operation would not result in a well formed XML document (for example, no document element or duplicate XML declarations). - - - Saves the XML document to the specified . - The TextWriter to which you want to save. - The operation would not result in a well formed XML document (for example, no document element or duplicate XML declarations). - - - Saves the XML document to the specified file. If the specified file exists, this method overwrites it. - The location of the file where you want to save the document. - The operation would not result in a well formed XML document (for example, no document element or duplicate XML declarations). - - - Saves the XML document to the specified . - The XmlWriter to which you want to save. - The operation would not result in a well formed XML document (for example, no document element or duplicate XML declarations). - - - Returns the Post-Schema-Validation-Infoset (PSVI) of the node. - The object representing the PSVI of the node. - - - Gets or sets the object associated with this . - An object containing the XML Schema Definition Language (XSD) schemas associated with this ; otherwise, an empty object. - - - Validates the against the XML Schema Definition Language (XSD) schemas contained in the property. - The object that receives information about schema validation warnings and errors. - A schema validation event occurred and no object was specified. - - - Validates the object specified against the XML Schema Definition Language (XSD) schemas in the property. - The object that receives information about schema validation warnings and errors. - The object created from an to validate. - The object parameter was not created from an . - The object parameter is not an element, attribute, document fragment, or the root node. - A schema validation event occurred and no object was specified. - - - Saves all the children of the XmlDocument node to the specified . - The XmlWriter to which you want to save. - - - Saves the XmlDocument node to the specified . - The XmlWriter to which you want to save. - - - Sets the to use for resolving external resources. - The XmlResolver to use. In version 1.1 of the.NET Framework, the caller must be fully trusted in order to specify an XmlResolver. - This property is set to null and an external DTD or entity is encountered. - - - Represents a lightweight object that is useful for tree insert operations. - - - Initializes a new instance of the class. - The XML document that is the source of the fragment. - - - Creates a duplicate of this node. - true to recursively clone the subtree under the specified node; false to clone only the node itself. - The cloned node. - - - Gets or sets the markup representing the children of this node. - The markup of the children of this node. - The XML specified when setting this property is not well-formed. - - - Gets the local name of the node. - For XmlDocumentFragment nodes, the local name is #document-fragment. - - - Gets the qualified name of the node. - For XmlDocumentFragment, the name is #document-fragment. - - - Gets the type of the current node. - For XmlDocumentFragment nodes, this value is XmlNodeType.DocumentFragment. - - - Gets the to which this node belongs. - The XmlDocument to which this node belongs. - - - Gets the parent of this node (for nodes that can have parents). - The parent of this node. For XmlDocumentFragment nodes, this property is always null. - - - Saves all the children of the node to the specified . - The XmlWriter to which you want to save. - - - Saves the node to the specified . - The XmlWriter to which you want to save. - - - Represents the document type declaration. - - - Initializes a new instance of the class. - The qualified name; see the property. - The public identifier; see the property. - The system identifier; see the property. - The DTD internal subset; see the property. - The parent document. - - - Creates a duplicate of this node. - true to recursively clone the subtree under the specified node; false to clone only the node itself. For document type nodes, the cloned node always includes the subtree, regardless of the parameter setting. - The cloned node. - - - Gets the collection of nodes declared in the document type declaration. - An containing the XmlEntity nodes. The returned XmlNamedNodeMap is read-only. - - - Gets the value of the document type definition (DTD) internal subset on the DOCTYPE declaration. - The DTD internal subset on the DOCTYPE. If there is no DTD internal subset, String.Empty is returned. - - - Gets a value indicating whether the node is read-only. - true if the node is read-only; otherwise false. Because DocumentType nodes are read-only, this property always returns true. - - - Gets the local name of the node. - For DocumentType nodes, this property returns the name of the document type. - - - Gets the qualified name of the node. - For DocumentType nodes, this property returns the name of the document type. - - - Gets the type of the current node. - For DocumentType nodes, this value is XmlNodeType.DocumentType. - - - Gets the collection of nodes present in the document type declaration. - An containing the XmlNotation nodes. The returned XmlNamedNodeMap is read-only. - - - Gets the value of the public identifier on the DOCTYPE declaration. - The public identifier on the DOCTYPE. If there is no public identifier, null is returned. - - - Gets the value of the system identifier on the DOCTYPE declaration. - The system identifier on the DOCTYPE. If there is no system identifier, null is returned. - - - Saves all the children of the node to the specified . For XmlDocumentType nodes, this method has no effect. - The XmlWriter to which you want to save. - - - Saves the node to the specified . - The XmlWriter to which you want to save. - - - Represents an element. - - - Initializes a new instance of the class. - The namespace prefix; see the property. - The local name; see the property. - The namespace URI; see the property. - The parent XML document. - - - Gets an containing the list of attributes for this node. - containing the list of attributes for this node. - - - Creates a duplicate of this node. - true to recursively clone the subtree under the specified node; false to clone only the node itself (and its attributes if the node is an XmlElement). - The cloned node. - - - Returns the value for the attribute with the specified name. - The name of the attribute to retrieve. This is a qualified name. It is matched against the Name property of the matching node. - The value of the specified attribute. An empty string is returned if a matching attribute is not found or if the attribute does not have a specified or default value. - - - Returns the value for the attribute with the specified local name and namespace URI. - The local name of the attribute to retrieve. - The namespace URI of the attribute to retrieve. - The value of the specified attribute. An empty string is returned if a matching attribute is not found or if the attribute does not have a specified or default value. - - - Returns the XmlAttribute with the specified name. - The name of the attribute to retrieve. This is a qualified name. It is matched against the Name property of the matching node. - The specified XmlAttribute or null if a matching attribute was not found. - - - Returns the with the specified local name and namespace URI. - The local name of the attribute. - The namespace URI of the attribute. - The specified XmlAttribute or null if a matching attribute was not found. - - - Returns an containing a list of all descendant elements that match the specified and . - The local name to match. The asterisk (*) is a special value that matches all tags. - The namespace URI to match. - An containing a list of all matching nodes. The list is empty if there are no matching nodes. - - - Returns an containing a list of all descendant elements that match the specified . - The name tag to match. This is a qualified name. It is matched against the Name property of the matching node. The asterisk (*) is a special value that matches all tags. - An containing a list of all matching nodes. The list is empty if there are no matching nodes. - - - Determines whether the current node has an attribute with the specified name. - The name of the attribute to find. This is a qualified name. It is matched against the Name property of the matching node. - true if the current node has the specified attribute; otherwise, false. - - - Determines whether the current node has an attribute with the specified local name and namespace URI. - The local name of the attribute to find. - The namespace URI of the attribute to find. - true if the current node has the specified attribute; otherwise, false. - - - Gets a boolean value indicating whether the current node has any attributes. - true if the current node has attributes; otherwise, false. - - - Gets or sets the concatenated values of the node and all its children. - The concatenated values of the node and all its children. - - - Gets or sets the markup representing just the children of this node. - The markup of the children of this node. - The XML specified when setting this property is not well-formed. - - - Gets or sets the tag format of the element. - Returns true if the element is to be serialized in the short tag format ""; false for the long format "". When setting this property, if set to true, the children of the element are removed and the element is serialized in the short tag format. If set to false, the value of the property is changed (regardless of whether or not the element has content); if the element is empty, it is serialized in the long format. This property is a Microsoft extension to the Document Object Model (DOM). - - - Gets the local name of the current node. - The name of the current node with the prefix removed. For example, LocalName is book for the element <bk:book>. - - - Gets the qualified name of the node. - The qualified name of the node. For XmlElement nodes, this is the tag name of the element. - - - Gets the namespace URI of this node. - The namespace URI of this node. If there is no namespace URI, this property returns String.Empty. - - - Gets the immediately following this element. - The XmlNode immediately following this element. - - - Gets the type of the current node. - The node type. For XmlElement nodes, this value is XmlNodeType.Element. - - - Gets the to which this node belongs. - The XmlDocument to which this element belongs. - - - Gets the parent of this node (for nodes that can have parents). - The XmlNode that is the parent of the current node. If a node has just been created and not yet added to the tree, or if it has been removed from the tree, the parent is null. For all other nodes, the value returned depends on the of the node. The following table describes the possible return values for the ParentNode property. - - - Gets or sets the namespace prefix of this node. - The namespace prefix of this node. If there is no prefix, this property returns String.Empty. - This node is read-only - The specified prefix contains an invalid character. The specified prefix is malformed. The namespaceURI of this node is null. The specified prefix is "xml" and the namespaceURI of this node is different from http://www.w3.org/XML/1998/namespace. - - - Removes all specified attributes and children of the current node. Default attributes are not removed. - - - Removes all specified attributes from the element. Default attributes are not removed. - - - Removes an attribute by name. - The name of the attribute to remove.This is a qualified name. It is matched against the Name property of the matching node. - The node is read-only. - - - Removes an attribute with the specified local name and namespace URI. (If the removed attribute has a default value, it is immediately replaced). - The local name of the attribute to remove. - The namespace URI of the attribute to remove. - The node is read-only. - - - Removes the attribute node with the specified index from the element. (If the removed attribute has a default value, it is immediately replaced). - The index of the node to remove. The first node has index 0. - The attribute node removed or null if there is no node at the given index. - - - Removes the specified . - The XmlAttribute node to remove. If the removed attribute has a default value, it is immediately replaced. - The removed XmlAttribute or null if oldAttr is not an attribute node of the XmlElement. - This node is read-only. - - - Removes the specified by the local name and namespace URI. (If the removed attribute has a default value, it is immediately replaced). - The local name of the attribute. - The namespace URI of the attribute. - The removed XmlAttribute or null if the XmlElement does not have a matching attribute node. - This node is read-only. - - - Gets the post schema validation infoset that has been assigned to this node as a result of schema validation. - An object containing the post schema validation infoset of this node. - - - Sets the value of the attribute with the specified name. - The name of the attribute to create or alter. This is a qualified name. If the name contains a colon it is parsed into prefix and local name components. - The value to set for the attribute. - The specified name contains an invalid character. - The node is read-only. - - - Sets the value of the attribute with the specified local name and namespace URI. - The local name of the attribute. - The namespace URI of the attribute. - The value to set for the attribute. - The attribute value. - - - Adds the specified . - The XmlAttribute node to add to the attribute collection for this element. - If the attribute replaces an existing attribute with the same name, the old XmlAttribute is returned; otherwise, null is returned. - The newAttr was created from a different document than the one that created this node. Or this node is read-only. - The newAttr is already an attribute of another XmlElement object. You must explicitly clone XmlAttribute nodes to re-use them in other XmlElement objects. - - - Adds the specified . - The local name of the attribute. - The namespace URI of the attribute. - The XmlAttribute to add. - - - Saves all the children of the node to the specified . - The XmlWriter to which you want to save. - - - Saves the current node to the specified . - The XmlWriter to which you want to save. - - - Represents an entity declaration, such as <!ENTITY... >. - - - Gets the base Uniform Resource Identifier (URI) of the current node. - The location from which the node was loaded. - - - Creates a duplicate of this node. Entity nodes cannot be cloned. Calling this method on an object throws an exception. - true to recursively clone the subtree under the specified node; false to clone only the node itself. - Returns a copy of the from which the method is called. - Entity nodes cannot be cloned. Calling this method on an object throws an exception. - - - Gets the concatenated values of the entity node and all its children. - The concatenated values of the node and all its children. - Attempting to set the property. - - - Gets the markup representing the children of this node. - For XmlEntity nodes, String.Empty is returned. - Attempting to set the property. - - - Gets a value indicating whether the node is read-only. - true if the node is read-only; otherwise false. Because XmlEntity nodes are read-only, this property always returns true. - - - Gets the name of the node without the namespace prefix. - For XmlEntity nodes, this property returns the name of the entity. - - - Gets the name of the node. - The name of the entity. - - - Gets the type of the node. - The node type. For XmlEntity nodes, the value is XmlNodeType.Entity. - - - Gets the name of the optional NDATA attribute on the entity declaration. - The name of the NDATA attribute. If there is no NDATA, null is returned. - - - Gets the markup representing this node and all its children. - For XmlEntity nodes, String.Empty is returned. - - - Gets the value of the public identifier on the entity declaration. - The public identifier on the entity. If there is no public identifier, null is returned. - - - Gets the value of the system identifier on the entity declaration. - The system identifier on the entity. If there is no system identifier, null is returned. - - - Saves all the children of the node to the specified . For XmlEntity nodes, this method has no effect. - The XmlWriter to which you want to save. - - - Saves the node to the specified . For XmlEntity nodes, this method has no effect. - The XmlWriter to which you want to save. - - - Represents an entity reference node. - - - Initializes a new instance of the class. - The name of the entity reference; see the property. - The parent XML document. - - - Gets the base Uniform Resource Identifier (URI) of the current node. - The location from which the node was loaded. - - - Creates a duplicate of this node. - true to recursively clone the subtree under the specified node; false to clone only the node itself. For XmlEntityReference nodes, this method always returns an entity reference node with no children. The replacement text is set when the node is inserted into a parent. - The cloned node. - - - Gets a value indicating whether the node is read-only. - true if the node is read-only; otherwise false. Because XmlEntityReference nodes are read-only, this property always returns true. - - - Gets the local name of the node. - For XmlEntityReference nodes, this property returns the name of the entity referenced. - - - Gets the name of the node. - The name of the entity referenced. - - - Gets the type of the node. - The node type. For XmlEntityReference nodes, the value is XmlNodeType.EntityReference. - - - Gets or sets the value of the node. - The value of the node. For XmlEntityReference nodes, this property returns null. - Node is read-only. - Setting the property. - - - Saves all the children of the node to the specified . - The XmlWriter to which you want to save. - - - Saves the node to the specified . - The XmlWriter to which you want to save. - - - Returns detailed information about the last exception. - - - Initializes a new instance of the XmlException class. - - - Initializes a new instance of the XmlException class with a specified error message. - The error description. - - - Initializes a new instance of the XmlException class using the information in the and objects. - The SerializationInfo object containing all the properties of an XmlException. - The StreamingContext object containing the context information. - - - Initializes a new instance of the XmlException class. - The description of the error condition. - The that threw the XmlException, if any. This value can be null. - - - Initializes a new instance of the XmlException class with the specified message, inner exception, line number, and line position. - The error description. - The exception that is the cause of the current exception. This value can be null. - The line number indicating where the error occurred. - The line position indicating where the error occurred. - - - Streams all the XmlException properties into the class for the given . - The SerializationInfo object. - The StreamingContext object. - - - Gets the line number indicating where the error occurred. - The line number indicating where the error occurred. - - - Gets the line position indicating where the error occurred. - The line position indicating where the error occurred. - - - Gets a message describing the current exception. - The error message that explains the reason for the exception. - - - Gets the location of the XML file. - The source URI for the XML data. If there is no source URI, this property returns null. - - - Defines the context for a set of objects. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with the specified. - An object. - - - Creates a new . - The new XmlDocument object. - - - Tests if the Document Object Model (DOM) implementation implements a specific feature. - The package name of the feature to test. This name is not case-sensitive. - This is the version number of the package name to test. If the version is not specified (null), supporting any version of the feature causes the method to return true. -

true if the feature is implemented in the specified version; otherwise, false.

-

The following table shows the combinations that cause HasFeature to return true.

-
strFeature

-

strVersion

-

XML

-

1.0

-

XML

-

2.0

-

-
-
- - Gets the node immediately preceding or following this node. - - - Gets the node immediately following this node. - The immediately following this node or null if one does not exist. - - - Gets the node immediately preceding this node. - The preceding or null if one does not exist. - - - Represents a collection of nodes that can be accessed by name or index. - - - Gets the number of nodes in the XmlNamedNodeMap. - The number of nodes. - - - Provides support for the "foreach" style iteration over the collection of nodes in the XmlNamedNodeMap. - An enumerator object. - - - Retrieves an specified by name. - The qualified name of the node to retrieve. It is matched against the property of the matching node. - An XmlNode with the specified name or null if a matching node is not found. - - - Retrieves a node with the matching and . - The local name of the node to retrieve. - The namespace Uniform Resource Identifier (URI) of the node to retrieve. - An with the matching local name and namespace URI or null if a matching node was not found. - - - Retrieves the node at the specified index in the XmlNamedNodeMap. - The index position of the node to retrieve from the XmlNamedNodeMap. The index is zero-based; therefore, the index of the first node is 0 and the index of the last node is -1. - The at the specified index. If index is less than 0 or greater than or equal to the property, null is returned. - - - Removes the node from the XmlNamedNodeMap. - The qualified name of the node to remove. The name is matched against the property of the matching node. - The XmlNode removed from this XmlNamedNodeMap or null if a matching node was not found. - - - Removes a node with the matching and . - The local name of the node to remove. - The namespace URI of the node to remove. - The removed or null if a matching node was not found. - - - Adds an using its property. - An XmlNode to store in the XmlNamedNodeMap. If a node with that name is already present in the map, it is replaced by the new one. - If the node replaces an existing node with the same name, the old node is returned; otherwise, null is returned. - The node was created from a different than the one that created the XmlNamedNodeMap; or the XmlNamedNodeMap is read-only. - - - Resolves, adds, and removes namespaces to a collection and provides scope management for these namespaces. - - - Initializes a new instance of the class with the specified . - The to use. - null is passed to the constructor - - - Adds the given namespace to the collection. - The prefix to associate with the namespace being added. Use String.Empty to add a default namespace. NoteIf the will be used for resolving namespaces in an XML Path Language (XPath) expression, a prefix must be specified. If an XPath expression does not include a prefix, it is assumed that the namespace Uniform Resource Identifier (URI) is the empty namespace. For more information about XPath expressions and the , refer to the and methods. - The namespace to add. - The value for prefix is "xml" or "xmlns". - The value for prefix or uri is null. - - - Gets the namespace URI for the default namespace. - Returns the namespace URI for the default namespace, or String.Empty if there is no default namespace. - - - Returns an enumerator to use to iterate through the namespaces in the . - An containing the prefixes stored by the . - - - Gets a collection of namespace names keyed by prefix which can be used to enumerate the namespaces currently in scope. - An enumeration value that specifies the type of namespace nodes to return. - A collection of namespace and prefix pairs currently in scope. - - - Gets a value indicating whether the supplied prefix has a namespace defined for the current pushed scope. - The prefix of the namespace you want to find. - true if there is a namespace defined; otherwise, false. - - - Gets the namespace URI for the specified prefix. - The prefix whose namespace URI you want to resolve. To match the default namespace, pass String.Empty. - Returns the namespace URI for prefix or null if there is no mapped namespace. The returned string is atomized. For more information on atomized strings, see the class. - - - Finds the prefix declared for the given namespace URI. - The namespace to resolve for the prefix. - The matching prefix. If there is no mapped prefix, the method returns String.Empty. If a null value is supplied, then null is returned. - - - Gets the associated with this object. - The used by this object. - - - Pops a namespace scope off the stack. - true if there are namespace scopes left on the stack; false if there are no more namespaces to pop. - - - Pushes a namespace scope onto the stack. - - - Removes the given namespace for the given prefix. - The prefix for the namespace - The namespace to remove for the given prefix. The namespace removed is from the current namespace scope. Namespaces outside the current scope are ignored. - The value of prefix or uri is null. - - - Defines the namespace scope. - - - All namespaces defined in the scope of the current node. This includes the xmlns:xml namespace which is always declared implicitly. The order of the namespaces returned is not defined. - - - - All namespaces defined in the scope of the current node, excluding the xmlns:xml namespace, which is always declared implicitly. The order of the namespaces returned is not defined. - - - - All namespaces that are defined locally at the current node. - - - - Table of atomized string objects. - - - Initializes a new instance of the class. - - - When overridden in a derived class, atomizes the specified string and adds it to the XmlNameTable. - The name to add. - The new atomized string or the existing one if it already exists. - array is null. - - - When overridden in a derived class, atomizes the specified string and adds it to the XmlNameTable. - The character array containing the name to add. - Zero-based index into the array specifying the first character of the name. - The number of characters in the name. - The new atomized string or the existing one if it already exists. If length is zero, String.Empty is returned. - 0 > offset -or- offset >= array.Length -or- length > array.Length The above conditions do not cause an exception to be thrown if length =0. - length < 0. - - - When overridden in a derived class, gets the atomized string containing the same value as the specified string. - The name to look up. - The atomized string or null if the string has not already been atomized. - array is null. - - - When overridden in a derived class, gets the atomized string containing the same characters as the specified range of characters in the given array. - The character array containing the name to look up. - The zero-based index into the array specifying the first character of the name. - The number of characters in the name. - The atomized string or null if the string has not already been atomized. If length is zero, String.Empty is returned. - 0 > offset -or- offset >= array.Length -or- length > array.Length The above conditions do not cause an exception to be thrown if length =0. - length < 0. - - - Represents a single node in the XML document. - - - Adds the specified node to the end of the list of child nodes, of this node. - The node to add. All the contents of the node to be added are moved into the specified location. - The node added. - This node is of a type that does not allow child nodes of the type of the newChild node. The newChild is an ancestor of this node. - The newChild was created from a different document than the one that created this node. This node is read-only. - - - Gets an containing the attributes of this node. - An XmlAttributeCollection containing the attributes of the node. If the node is of type XmlNodeType.Element, the attributes of the node are returned. Otherwise, this property returns null. - - - Gets the base URI of the current node. - The location from which the node was loaded or String.Empty if the node has no base URI. - - - Gets all the child nodes of the node. - An object that contains all the child nodes of the node. If there are no child nodes, this property returns an empty . - - - Creates a duplicate of this node. - The cloned node. - - - Creates a duplicate of the node, when overridden in a derived class. - true to recursively clone the subtree under the specified node; false to clone only the node itself. - The cloned node. - Calling this method on a node type that cannot be cloned. - - - Creates an for navigating this object. - An XPathNavigator object used to navigate the node. The XPathNavigator is positioned on the node from which the method was called. It is not positioned on the root of the document. - - - Gets the first child of the node. - The first child of the node. If there is no such node, null is returned. - - - Get an enumerator that iterates through the child nodes in the current node. - An object that can be used to iterate through the child nodes in the current node. - - - Looks up the closest xmlns declaration for the given prefix that is in scope for the current node and returns the namespace URI in the declaration. - The prefix whose namespace URI you want to find. - The namespace URI of the specified prefix. - - - Looks up the closest xmlns declaration for the given namespace URI that is in scope for the current node and returns the prefix defined in that declaration. - The namespace URI whose prefix you want to find. - The prefix for the specified namespace URI. - - - Gets a value indicating whether this node has any child nodes. - true if the node has child nodes; otherwise, false. - - - Gets or sets the concatenated values of the node and all its child nodes. - The concatenated values of the node and all its child nodes. - - - Gets or sets the markup representing only the child nodes of this node. -

The markup of the child nodes of this node.

-

InnerXml does not return default attributes.

-

-
- Setting this property on a node that cannot have child nodes. - The XML specified when setting this property is not well-formed. -
- - Inserts the specified node immediately after the specified reference node. - The XmlNode to insert. - The XmlNode that is the reference node. The newNode is placed after the refNode. - The node being inserted. - This node is of a type that does not allow child nodes of the type of the newChild node. The newChild is an ancestor of this node. - The newChild was created from a different document than the one that created this node. The refChild is not a child of this node. This node is read-only. - - - Inserts the specified node immediately before the specified reference node. - The XmlNode to insert. - The XmlNode that is the reference node. The newChild is placed before this node. - The node being inserted. - The current node is of a type that does not allow child nodes of the type of the newChild node. The newChild is an ancestor of this node. - The newChild was created from a different document than the one that created this node. The refChild is not a child of this node. This node is read-only. - - - Gets a value indicating whether the node is read-only. - true if the node is read-only; otherwise false. - - - Gets the first child element with the specified . - The qualified name of the element to retrieve. - The first that matches the specified name. It returns a null reference (Nothing in Visual Basic) if there is no match. - - - Gets the first child element with the specified and . - The local name of the element. - The namespace URI of the element. - The first with the matching localname and ns. . It returns a null reference (Nothing in Visual Basic) if there is no match. - - - Gets the last child of the node. - The last child of the node. If there is no such node, null is returned. - - - Gets the local name of the node, when overridden in a derived class. -

The name of the node with the prefix removed. For example, LocalName is book for the element <bk:book>.

-

The name returned is dependent on the of the node:

-
Type

-

Name

-

Attribute

-

The local name of the attribute.

-

CDATA

-

#cdata-section

-

Comment

-

#comment

-

Document

-

#document

-

DocumentFragment

-

#document-fragment

-

DocumentType

-

The document type name.

-

Element

-

The local name of the element.

-

Entity

-

The name of the entity.

-

EntityReference

-

The name of the entity referenced.

-

Notation

-

The notation name.

-

ProcessingInstruction

-

The target of the processing instruction.

-

Text

-

#text

-

Whitespace

-

#whitespace

-

SignificantWhitespace

-

#significant-whitespace

-

XmlDeclaration

-

#xml-declaration

-

-
-
- - Gets the qualified name of the node, when overridden in a derived class. -

The qualified name of the node. The name returned is dependent on the of the node:

-
Type

-

Name

-

Attribute

-

The qualified name of the attribute.

-

CDATA

-

#cdata-section

-

Comment

-

#comment

-

Document

-

#document

-

DocumentFragment

-

#document-fragment

-

DocumentType

-

The document type name.

-

Element

-

The qualified name of the element.

-

Entity

-

The name of the entity.

-

EntityReference

-

The name of the entity referenced.

-

Notation

-

The notation name.

-

ProcessingInstruction

-

The target of the processing instruction.

-

Text

-

#text

-

Whitespace

-

#whitespace

-

SignificantWhitespace

-

#significant-whitespace

-

XmlDeclaration

-

#xml-declaration

-

-
-
- - Gets the namespace URI of this node. - The namespace URI of this node. If there is no namespace URI, this property returns String.Empty. - - - Gets the node immediately following this node. - The next XmlNode. If there is no next node, null is returned. - - - Gets the type of the current node, when overridden in a derived class. - One of the values. - - - Puts all XmlText nodes in the full depth of the sub-tree underneath this XmlNode into a "normal" form where only markup (that is, tags, comments, processing instructions, CDATA sections, and entity references) separates XmlText nodes, that is, there are no adjacent XmlText nodes. - - - Gets the markup containing this node and all its child nodes. -

The markup containing this node and all its child nodes.

-

OuterXml does not return default attributes.

-

-
-
- - Gets the to which this node belongs. - The to which this node belongs. If the node is an (NodeType equals XmlNodeType.Document), this property returns null. - - - Gets the parent of this node (for nodes that can have parents). -

The XmlNode that is the parent of the current node. If a node has just been created and not yet added to the tree, or if it has been removed from the tree, the parent is null. For all other nodes, the value returned depends on the of the node. The following table describes the possible return values for the ParentNode property.

-
NodeType

-

Return Value of ParentNode

-

Attribute, Document, DocumentFragment, Entity, Notation

-

Returns null; these nodes do not have parents.

-

CDATA

-

Returns the element or entity reference containing the CDATA section.

-

Comment

-

Returns the element, entity reference, document type, or document containing the comment.

-

DocumentType

-

Returns the document node.

-

Element

-

Returns the parent node of the element. If the element is the root node in the tree, the parent is the document node.

-

EntityReference

-

Returns the element, attribute, or entity reference containing the entity reference.

-

ProcessingInstruction

-

Returns the document, element, document type, or entity reference containing the processing instruction.

-

Text

-

Returns the parent element, attribute, or entity reference containing the text node.

-

-
-
- - Gets or sets the namespace prefix of this node. - The namespace prefix of this node. For example, Prefix is bk for the element <bk:book>. If there is no prefix, this property returns String.Empty. - This node is read-only. - The specified prefix contains an invalid character. The specified prefix is malformed. The specified prefix is "xml" and the namespaceURI of this node is different from "http://www.w3.org/XML/1998/namespace". This node is an attribute and the specified prefix is "xmlns" and the namespaceURI of this node is different from "http://www.w3.org/2000/xmlns/ ". This node is an attribute and the qualifiedName of this node is "xmlns". - - - Adds the specified node to the beginning of the list of child nodes for this node. - The node to add. All the contents of the node to be added are moved into the specified location. - The node added. - This node is of a type that does not allow child nodes of the type of the newChild node. The newChild is an ancestor of this node. - The newChild was created from a different document than the one that created this node. This node is read-only. - - - Gets the node immediately preceding this node. - The preceding XmlNode. If there is no preceding node, null is returned. - - - Gets the text node that immediately precedes this node. - Returns . - - - Removes all the child nodes and/or attributes of the current node. - - - Removes specified child node. - The node being removed. - The node removed. - The oldChild is not a child of this node. Or this node is read-only. - - - Replaces the child node oldChild with newChild node. - The new node to put in the child list. - The node being replaced in the list. - The node replaced. - This node is of a type that does not allow child nodes of the type of the newChild node. The newChild is an ancestor of this node. - The newChild was created from a different document than the one that created this node. This node is read-only. The oldChild is not a child of this node. - - - Gets the post schema validation infoset that has been assigned to this node as a result of schema validation. - An object containing the post schema validation infoset of this node. - - - Selects a list of nodes matching the XPath expression. - The XPath expression. - An containing a collection of nodes matching the XPath query. - The XPath expression contains a prefix. See XPath Examples. - - - Selects a list of nodes matching the XPath expression. Any prefixes found in the XPath expression are resolved using the supplied . - The XPath expression. See XPath Examples. - An to use for resolving namespaces for prefixes in the XPath expression. - An containing a collection of nodes matching the XPath query. - The XPath expression contains a prefix which is not defined in the XmlNamespaceManager. - - - Selects the first XmlNode that matches the XPath expression. - The XPath expression. See XPath Examples. - The first XmlNode that matches the XPath query or null if no matching node is found. - The XPath expression contains a prefix. - - - Selects the first XmlNode that matches the XPath expression. Any prefixes found in the XPath expression are resolved using the supplied . - The XPath expression. See XPath Examples. - An to use for resolving namespaces for prefixes in the XPath expression. - The first XmlNode that matches the XPath query or null if no matching node is found. - The XPath expression contains a prefix which is not defined in the XmlNamespaceManager. - - - Tests if the DOM implementation implements a specific feature. - The package name of the feature to test. This name is not case-sensitive. - The version number of the package name to test. If the version is not specified (null), supporting any version of the feature causes the method to return true. -

true if the feature is implemented in the specified version; otherwise, false. The following table describes the combinations that return true.

-
Feature

-

Version

-

XML

-

1.0

-

XML

-

2.0

-

-
-
- - Gets or sets the value of the node. -

The value returned depends on the of the node:

-
Type

-

Value

-

Attribute

-

The value of the attribute.

-

CDATASection

-

The content of the CDATA Section.

-

Comment

-

The content of the comment.

-

Document

-

null.

-

DocumentFragment

-

null.

-

DocumentType

-

null.

-

Element

-

null. You can use the or properties to access the value of the element node.

-

Entity

-

null.

-

EntityReference

-

null.

-

Notation

-

null.

-

ProcessingInstruction

-

The entire content excluding the target.

-

Text

-

The content of the text node.

-

SignificantWhitespace

-

The white space characters. White space can consist of one or more space characters, carriage returns, line feeds, or tabs.

-

Whitespace

-

The white space characters. White space can consist of one or more space characters, carriage returns, line feeds, or tabs.

-

XmlDeclaration

-

The content of the declaration (that is, everything between <?xml and ?>).

-

-
- Setting the value of a node that is read-only. - Setting the value of a node that is not supposed to have a value (for example, an Element node). -
- - Saves all the child nodes of the node to the specified , when overridden in a derived class. - The XmlWriter to which you want to save. - - - Saves the current node to the specified , when overridden in a derived class. - The XmlWriter to which you want to save. - - - For a description of this member, see . - Returns an enumerator for the collection. - - - For a description of this member, see . - A copy of the node from which it is called. - - - Specifies the type of node change. - - - A node value is being changed. - - - - A node is being inserted in the tree. - - - - A node is being removed from the tree. - - - - Provides data for the , , , , and events. - - - Initializes a new instance of the class. - The that generated the event. - The old parent of the that generated the event. - The new parent of the that generated the event. - The old value of the that generated the event. - The new value of the that generated the event. - The . - - - Gets a value indicating what type of node change event is occurring. -

An XmlNodeChangedAction value describing the node change event.

-

XmlNodeChangedAction Value

-

Description

-

Insert

-

A node has been or will be inserted.

-

Remove

-

A node has been or will be removed.

-

Change

-

A node has been or will be changed.

-


The Action value does not differentiate between when the event occurred (before or after). You can create separate event handlers to handle both instances.

-

-
-
- - Gets the value of the after the operation completes. -

The value of the ParentNode after the operation completes. This property returns null if the node is being removed.

-


For attribute nodes this property returns the .

-

-
-
- - Gets the new value of the node. - The new value of the node. This property returns null if the node is neither an attribute nor a text node, or if the node is being removed. If called in a event, NewValue returns the value of the node if the change is successful. If called in a event, NewValue returns the current value of the node. - - - Gets the that is being added, removed or changed. - The XmlNode that is being added, removed or changed; this property never returns null. - - - Gets the value of the before the operation began. -

The value of the ParentNode before the operation began. This property returns null if the node did not have a parent.

-


For attribute nodes this property returns the .

-

-
-
- - Gets the original value of the node. - The original value of the node. This property returns null if the node is neither an attribute nor a text node, or if the node is being inserted. If called in a event, OldValue returns the current value of the node that will be replaced if the change is successful. If called in a event, OldValue returns the value of node prior to the change. - - - Represents the method that handles , , , , and events. - The source of the event. - An containing the event data. - - - Represents an ordered collection of nodes. - - - Initializes a new instance of the class. - - - Gets the number of nodes in the XmlNodeList. - The number of nodes in the XmlNodeList. - - - Gets an enumerator that iterates through the collection of nodes. - An enumerator used to iterate through the collection of nodes. - - - Retrieves a node at the given index. - The zero-based index into the list of nodes. - The with the specified index in the collection. If index is greater than or equal to the number of nodes in the list, this returns null. - - - Gets a node at the given index. - The zero-based index into the list of nodes. - The with the specified index in the collection. If index is greater than or equal to the number of nodes in the list, this returns null. - - - Disposes resources in the node list privately. - - - Releases all resources used by the class. - - - Describes the document order of a node compared to a second node. - - - The current node of this navigator is after the current node of the supplied navigator. - - - - The current node of this navigator is before the current node of the supplied navigator. - - - - The two navigators are positioned on the same node. - - - - The node positions cannot be determined in document order, relative to each other. This could occur if the two nodes reside in different trees. - - - - Represents a reader that provides fast, non-cached forward only access to XML data in an . - - - Creates an instance of the XmlNodeReader class using the specified . - The XmlNode you want to read. - - - Gets the number of attributes on the current node. - The number of attributes on the current node. This number includes default attributes. - - - Gets the base URI of the current node. - The base URI of the current node. - - - Gets a value indicating whether the implements the binary content read methods. - true if the binary content read methods are implemented; otherwise false. The class always returns true. - - - Gets a value indicating whether this reader can parse and resolve entities. - true if the reader can parse and resolve entities; otherwise, false. XmlNodeReader always returns true. - - - Changes the to Closed. - - - Gets the depth of the current node in the XML document. - The depth of the current node in the XML document. - - - Gets a value indicating whether the reader is positioned at the end of the stream. - true if the reader is positioned at the end of the stream; otherwise, false. - - - Gets the value of the attribute with the specified name. - The qualified name of the attribute. - The value of the specified attribute. If the attribute is not found, null is returned. - - - Gets the value of the attribute with the specified local name and namespace URI. - The local name of the attribute. - The namespace URI of the attribute. - The value of the specified attribute. If the attribute is not found, null is returned. - - - Gets the value of the attribute with the specified index. - The index of the attribute. The index is zero-based. (The first attribute has index 0.) - The value of the specified attribute. - The i parameter is less than 0 or greater than or equal to . - - - Gets a value indicating whether the current node has any attributes. - true if the current node has attributes; otherwise, false. - - - Gets a value indicating whether the current node can have a . - true if the node on which the reader is currently positioned can have a Value; otherwise, false. - - - Gets a value indicating whether the current node is an attribute that was generated from the default value defined in the document type definition (DTD) or schema. - true if the current node is an attribute whose value was generated from the default value defined in the DTD or schema; false if the attribute value was explicitly set. - - - Gets a value indicating whether the current node is an empty element (for example, ). - true if the current node is an element ( equals XmlNodeType.Element) and it ends with />; otherwise, false. - - - Gets the local name of the current node. - The name of the current node with the prefix removed. For example, LocalName is book for the element <bk:book>. For node types that do not have a name (like Text, Comment, and so on), this property returns String.Empty. - - - Resolves a namespace prefix in the current element's scope. - The prefix whose namespace URI you want to resolve. To match the default namespace, pass an empty string. This string does not have to be atomized. - The namespace URI to which the prefix maps or null if no matching prefix is found. - - - Moves to the attribute with the specified index. - The index of the attribute. - The i parameter is less than 0 or greater than or equal to . - - - Moves to the attribute with the specified name. - The qualified name of the attribute. - true if the attribute is found; otherwise, false. If false, the reader's position does not change. - - - Moves to the attribute with the specified local name and namespace URI. - The local name of the attribute. - The namespace URI of the attribute. - true if the attribute is found; otherwise, false. If false, the reader's position does not change. - - - Moves to the element that contains the current attribute node. - true if the reader is positioned on an attribute (the reader moves to the element that owns the attribute); false if the reader is not positioned on an attribute (the position of the reader does not change). - - - Moves to the first attribute. - true if an attribute exists (the reader moves to the first attribute); otherwise, false (the position of the reader does not change). - - - Moves to the next attribute. - true if there is a next attribute; false if there are no more attributes. - - - Gets the qualified name of the current node. -

The qualified name of the current node. For example, Name is bk:book for the element <bk:book>.

-

The name returned is dependent on the of the node. The following node types return the listed values. All other node types return an empty string.

-
Node Type

-

Name

-

Attribute The name of the attribute.

-

DocumentType The document type name.

-

Element The tag name.

-

EntityReference The name of the entity referenced.

-

ProcessingInstruction The target of the processing instruction.

-

XmlDeclaration The literal string xml.

-

-
-
- - Gets the namespace URI (as defined in the W3C Namespace specification) of the node on which the reader is positioned. - The namespace URI of the current node; otherwise an empty string. - - - Gets the associated with this implementation. - The XmlNameTable enabling you to get the atomized version of a string within the node. - - - Gets the type of the current node. - One of the values representing the type of the current node. - - - Gets the namespace prefix associated with the current node. - The namespace prefix associated with the current node. - - - Reads the next node from the stream. - true if the next node was read successfully; false if there are no more nodes to read. - - - Parses the attribute value into one or more Text, EntityReference, or EndEntity nodes. - true if there are nodes to return. false if the reader is not positioned on an attribute node when the initial call is made or if all the attribute values have been read. An empty attribute, such as, misc="", returns true with a single node with a value of String.Empty. - - - Reads the content and returns the Base64 decoded binary bytes. - The buffer into which to copy the resulting text. This value cannot be null. - The offset into the buffer where to start copying the result. - The maximum number of bytes to copy into the buffer. The actual number of bytes copied is returned from this method. - The number of bytes written to the buffer. - The buffer value is null. - is not supported on the current node. - The index into the buffer or index + count is larger than the allocated buffer size. - - - Reads the content and returns the BinHex decoded binary bytes. - The buffer into which to copy the resulting text. This value cannot be null. - The offset into the buffer where to start copying the result. - The maximum number of bytes to copy into the buffer. The actual number of bytes copied is returned from this method. - The number of bytes written to the buffer. - The buffer value is null. - is not supported on the current node. - The index into the buffer or index + count is larger than the allocated buffer size. - - - Reads the element and decodes the Base64 content. - The buffer into which to copy the resulting text. This value cannot be null. - The offset into the buffer where to start copying the result. - The maximum number of bytes to copy into the buffer. The actual number of bytes copied is returned from this method. - The number of bytes written to the buffer. - The buffer value is null. - The current node is not an element node. - The index into the buffer or index + count is larger than the allocated buffer size. - The element contains mixed content. - The content cannot be converted to the requested type. - - - Reads the element and decodes the BinHex content. - The buffer into which to copy the resulting text. This value cannot be null. - The offset into the buffer where to start copying the result. - The maximum number of bytes to copy into the buffer. The actual number of bytes copied is returned from this method. - The number of bytes written to the buffer. - The buffer value is null. - The current node is not an element node. - The index into the buffer or index + count is larger than the allocated buffer size. - The element contains mixed content. - The content cannot be converted to the requested type. - - - Gets the state of the reader. - One of the values. - - - Reads the contents of an element or text node as a string. - The contents of the element or text-like node (This can include CDATA, Text nodes, and so on). This can be an empty string if the reader is positioned on something other than an element or text node, or if there is no more text content to return in the current context. Note: The text node can be either an element or an attribute text node. - - - Resolves the entity reference for EntityReference nodes. - The reader is not positioned on an EntityReference node. - - - Gets the schema information that has been assigned to the current node. - An object containing the schema information for the current node. - - - Skips the children of the current node. - - - Gets the text value of the current node. -

The value returned depends on the of the node. The following table lists node types that have a value to return. All other node types return String.Empty.

-
Node Type

-

Value

-

Attribute The value of the attribute.

-

CDATA The content of the CDATA section.

-

Comment The content of the comment.

-

DocumentType The internal subset.

-

ProcessingInstruction The entire content, excluding the target.

-

SignificantWhitespace The white space between markup in a mixed content model.

-

Text The content of the text node.

-

Whitespace The white space between markup.

-

XmlDeclaration The content of the declaration.

-

-
-
- - Gets the current xml:lang scope. - The current xml:lang scope. - - - Gets the current xml:space scope. - One of the values. If no xml:space scope exists, this property defaults to XmlSpace.None. - - - For a description of this member, see . - object. - object that contains the namespaces that are in scope. - - - For a description of this member, see . - that contains the namespace prefix. - that contains the namespace name. - - - For a description of this member, see . - object that identifies the namespace. - object that contains the namespace prefix. - - - Specifies the type of node. - - - An attribute (for example, id='123' ). - - - - A CDATA section (for example, <![CDATA[my escaped text]]> ). - - - - A comment (for example, <!-- my comment --> ). - - - - A document object that, as the root of the document tree, provides access to the entire XML document. - - - - A document fragment. - - - - The document type declaration, indicated by the following tag (for example, <!DOCTYPE...> ). - - - - An element (for example, ). - - - - An end element tag (for example, ). - - - - Returned when XmlReader gets to the end of the entity replacement as a result of a call to . - - - - An entity declaration (for example, <!ENTITY...> ). - - - -

A reference to an entity (for example, &num; ).

-
- -
- - This is returned by the if a Read method has not been called. - - - - A notation in the document type declaration (for example, <!NOTATION...> ). - - - - A processing instruction (for example, <?pi test?> ). - - - - White space between markup in a mixed content model or white space within the xml:space="preserve" scope. - - - - The text content of a node. - - - - White space between markup. - - - - The XML declaration (for example, <?xml version='1.0'?> ). - - - - Represents a notation declaration, such as <!NOTATION... >. - - - Creates a duplicate of this node. Notation nodes cannot be cloned. Calling this method on an object throws an exception. - true to recursively clone the subtree under the specified node; false to clone only the node itself. - Returns a copy of the node from which the method is called. - Notation nodes cannot be cloned. Calling this method on an object throws an exception. - - - Gets the markup representing the children of this node. - For XmlNotation nodes, String.Empty is returned. - Attempting to set the property. - - - Gets a value indicating whether the node is read-only. - true if the node is read-only; otherwise false. Because XmlNotation nodes are read-only, this property always returns true. - - - Gets the name of the current node without the namespace prefix. - For XmlNotation nodes, this property returns the name of the notation. - - - Gets the name of the current node. - The name of the notation. - - - Gets the type of the current node. - The node type. For XmlNotation nodes, the value is XmlNodeType.Notation. - - - Gets the markup representing this node and all its children. - For XmlNotation nodes, String.Empty is returned. - - - Gets the value of the public identifier on the notation declaration. - The public identifier on the notation. If there is no public identifier, null is returned. - - - Gets the value of the system identifier on the notation declaration. - The system identifier on the notation. If there is no system identifier, null is returned. - - - Saves the children of the node to the specified . This method has no effect on XmlNotation nodes. - The XmlWriter to which you want to save. - - - Saves the node to the specified . This method has no effect on XmlNotation nodes. - The XmlWriter to which you want to save. - - - Specifies the method used to serialize the output. - - - Use the XSLT rules to choose between the and output methods at runtime. - - - - Serialize according to the HTML rules specified by XSLT. - - - - Serialize text blocks only. - - - - Serialize according to the XML 1.0 rules. - - - - Provides all the context information required by the to parse an XML fragment. - - - Initializes a new instance of the XmlParserContext class with the specified , , xml:lang, and xml:space values. - The to use to atomize strings. If this is null, the name table used to construct the nsMgr is used instead. For more information about atomized strings, see . - The to use for looking up namespace information, or null. - The xml:lang scope. - An value indicating the xml:space scope. - nt is not the same XmlNameTable used to construct nsMgr. - - - Initializes a new instance of the XmlParserContext class with the specified , , xml:lang, xml:space, and encoding. - The to use to atomize strings. If this is null, the name table used to construct the nsMgr is used instead. For more information on atomized strings, see . - The to use for looking up namespace information, or null. - The xml:lang scope. - An value indicating the xml:space scope. - An object indicating the encoding setting. - nt is not the same XmlNameTable used to construct nsMgr. - - - Initializes a new instance of the XmlParserContext class with the specified , , base URI, xml:lang, xml:space, and document type values. - The to use to atomize strings. If this is null, the name table used to construct the nsMgr is used instead. For more information about atomized strings, see . - The to use for looking up namespace information, or null. - The name of the document type declaration. - The public identifier. - The system identifier. - The internal DTD subset. The DTD subset is used for entity resolution, not for document validation. - The base URI for the XML fragment (the location from which the fragment was loaded). - The xml:lang scope. - An value indicating the xml:space scope. - nt is not the same XmlNameTable used to construct nsMgr. - - - Initializes a new instance of the XmlParserContext class with the specified , , base URI, xml:lang, xml:space, encoding, and document type values. - The to use to atomize strings. If this is null, the name table used to construct the nsMgr is used instead. For more information about atomized strings, see . - The to use for looking up namespace information, or null. - The name of the document type declaration. - The public identifier. - The system identifier. - The internal DTD subset. The DTD is used for entity resolution, not for document validation. - The base URI for the XML fragment (the location from which the fragment was loaded). - The xml:lang scope. - An value indicating the xml:space scope. - An object indicating the encoding setting. - nt is not the same XmlNameTable used to construct nsMgr. - - - Gets or sets the base URI. - The base URI to use to resolve the DTD file. - - - Gets or sets the name of the document type declaration. - The name of the document type declaration. - - - Gets or sets the encoding type. - An object indicating the encoding type. - - - Gets or sets the internal DTD subset. - The internal DTD subset. For example, this property returns everything between the square brackets <!DOCTYPE doc [...]>. - - - Gets or sets the . - The XmlNamespaceManager. - - - Gets the used to atomize strings. For more information on atomized strings, see . - The XmlNameTable. - - - Gets or sets the public identifier. - The public identifier. - - - Gets or sets the system identifier. - The system identifier. - - - Gets or sets the current xml:lang scope. - The current xml:lang scope. If there is no xml:lang in scope, String.Empty is returned. - - - Gets or sets the current xml:space scope. - An value indicating the xml:space scope. - - - Represents a processing instruction, which XML defines to keep processor-specific information in the text of the document. - - - Initializes a new instance of the class. - The target of the processing instruction; see the property. - The content of the instruction; see the property. - The parent XML document. - - - Creates a duplicate of this node. - true to recursively clone the subtree under the specified node; false to clone only the node itself. - The duplicate node. - - - Gets or sets the content of the processing instruction, excluding the target. - The content of the processing instruction, excluding the target. - - - Gets or sets the concatenated values of the node and all its children. - The concatenated values of the node and all its children. - - - Gets the local name of the node. - For processing instruction nodes, this property returns the target of the processing instruction. - - - Gets the qualified name of the node. - For processing instruction nodes, this property returns the target of the processing instruction. - - - Gets the type of the current node. - For XmlProcessingInstruction nodes, this value is XmlNodeType.ProcessingInstruction. - - - Gets the target of the processing instruction. - The target of the processing instruction. - - - Gets or sets the value of the node. - The entire content of the processing instruction, excluding the target. - Node is read-only. - - - Saves all the children of the node to the specified . Because ProcessingInstruction nodes do not have children, this method has no effect. - The XmlWriter to which you want to save. - - - Saves the node to the specified . - The XmlWriter to which you want to save. - - - Provides a managed wrapper for a process handle. - - - Initializes a new instance of the class from the specified handle, indicating whether to release the handle during the finalization phase. - The handle to be wrapped. - true to reliably let release the handle during the finalization phase; otherwise, false. - - - Represents a wrapper class for a wait handle. - - - Initializes a new instance of the class. - An object that represents the pre-existing handle to use. - true to reliably release the handle during the finalization phase; false to prevent reliable release (not recommended). - - - Provides a wrapper class that represents the handle of an X.509 chain object. For more information, see . - - - The exception that is thrown when there is an attempt to read or write protected memory. - - - Initializes a new instance of the class with a system-supplied message that describes the error. - - - Initializes a new instance of the class with a specified message that describes the error. - The message that describes the exception. The caller of this constructor is required to ensure that this string has been localized for the current system culture. - - - Initializes a new instance of the class with serialized data. - The that holds the serialized object data. - The that contains contextual information about the source or destination. - - - Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. - The message that describes the exception. The caller of this constructor is required to ensure that this string has been localized for the current system culture. - The exception that is the cause of the current exception. If the innerException parameter is not null, the current exception is raised in a catch block that handles the inner exception. - - - Encapsulates a method that has a single parameter and does not return a value. - The parameter of the method that this delegate encapsulates. - The type of the parameter of the method that this delegate encapsulates. - - - Encapsulates a method that has 10 parameters and does not return a value. - The first parameter of the method that this delegate encapsulates. - The second parameter of the method that this delegate encapsulates. - The third parameter of the method that this delegate encapsulates. - The fourth parameter of the method that this delegate encapsulates. - The fifth parameter of the method that this delegate encapsulates. - The sixth parameter of the method that this delegate encapsulates. - The seventh parameter of the method that this delegate encapsulates. - The eighth parameter of the method that this delegate encapsulates. - The ninth parameter of the method that this delegate encapsulates. - The tenth parameter of the method that this delegate encapsulates. - The type of the first parameter of the method that this delegate encapsulates. - The type of the second parameter of the method that this delegate encapsulates. - The type of the third parameter of the method that this delegate encapsulates. - The type of the fourth parameter of the method that this delegate encapsulates. - The type of the fifth parameter of the method that this delegate encapsulates. - The type of the sixth parameter of the method that this delegate encapsulates. - The type of the seventh parameter of the method that this delegate encapsulates. - The type of the eighth parameter of the method that this delegate encapsulates. - The type of the ninth parameter of the method that this delegate encapsulates. - The type of the tenth parameter of the method that this delegate encapsulates. - - - Encapsulates a method that has 11 parameters and does not return a value. - The first parameter of the method that this delegate encapsulates. - The second parameter of the method that this delegate encapsulates. - The third parameter of the method that this delegate encapsulates. - The fourth parameter of the method that this delegate encapsulates. - The fifth parameter of the method that this delegate encapsulates. - The sixth parameter of the method that this delegate encapsulates. - The seventh parameter of the method that this delegate encapsulates. - The eighth parameter of the method that this delegate encapsulates. - The ninth parameter of the method that this delegate encapsulates. - The tenth parameter of the method that this delegate encapsulates. - The eleventh parameter of the method that this delegate encapsulates. - The type of the first parameter of the method that this delegate encapsulates. - The type of the second parameter of the method that this delegate encapsulates. - The type of the third parameter of the method that this delegate encapsulates. - The type of the fourth parameter of the method that this delegate encapsulates. - The type of the fifth parameter of the method that this delegate encapsulates. - The type of the sixth parameter of the method that this delegate encapsulates. - The type of the seventh parameter of the method that this delegate encapsulates. - The type of the eighth parameter of the method that this delegate encapsulates. - The type of the ninth parameter of the method that this delegate encapsulates. - The type of the tenth parameter of the method that this delegate encapsulates. - The type of the eleventh parameter of the method that this delegate encapsulates. - - - Encapsulates a method that has 12 parameters and does not return a value. - The first parameter of the method that this delegate encapsulates. - The second parameter of the method that this delegate encapsulates. - The third parameter of the method that this delegate encapsulates. - The fourth parameter of the method that this delegate encapsulates. - The fifth parameter of the method that this delegate encapsulates. - The sixth parameter of the method that this delegate encapsulates. - The seventh parameter of the method that this delegate encapsulates. - The eighth parameter of the method that this delegate encapsulates. - The ninth parameter of the method that this delegate encapsulates. - The tenth parameter of the method that this delegate encapsulates. - The eleventh parameter of the method that this delegate encapsulates. - The twelfth parameter of the method that this delegate encapsulates. - The type of the first parameter of the method that this delegate encapsulates. - The type of the second parameter of the method that this delegate encapsulates. - The type of the third parameter of the method that this delegate encapsulates. - The type of the fourth parameter of the method that this delegate encapsulates. - The type of the fifth parameter of the method that this delegate encapsulates. - The type of the sixth parameter of the method that this delegate encapsulates. - The type of the seventh parameter of the method that this delegate encapsulates. - The type of the eighth parameter of the method that this delegate encapsulates. - The type of the ninth parameter of the method that this delegate encapsulates. - The type of the tenth parameter of the method that this delegate encapsulates. - The type of the eleventh parameter of the method that this delegate encapsulates. - The type of the twelfth parameter of the method that this delegate encapsulates. - - - Encapsulates a method that has 13 parameters and does not return a value. - The first parameter of the method that this delegate encapsulates. - The second parameter of the method that this delegate encapsulates. - The third parameter of the method that this delegate encapsulates. - The fourth parameter of the method that this delegate encapsulates. - The fifth parameter of the method that this delegate encapsulates. - The sixth parameter of the method that this delegate encapsulates. - The seventh parameter of the method that this delegate encapsulates. - The eighth parameter of the method that this delegate encapsulates. - The ninth parameter of the method that this delegate encapsulates. - The tenth parameter of the method that this delegate encapsulates. - The eleventh parameter of the method that this delegate encapsulates. - The twelfth parameter of the method that this delegate encapsulates. - The thirteenth parameter of the method that this delegate encapsulates. - The type of the first parameter of the method that this delegate encapsulates. - The type of the second parameter of the method that this delegate encapsulates. - The type of the third parameter of the method that this delegate encapsulates. - The type of the fourth parameter of the method that this delegate encapsulates. - The type of the fifth parameter of the method that this delegate encapsulates. - The type of the sixth parameter of the method that this delegate encapsulates. - The type of the seventh parameter of the method that this delegate encapsulates. - The type of the eighth parameter of the method that this delegate encapsulates. - The type of the ninth parameter of the method that this delegate encapsulates. - The type of the tenth parameter of the method that this delegate encapsulates. - The type of the eleventh parameter of the method that this delegate encapsulates. - The type of the twelfth parameter of the method that this delegate encapsulates. - The type of the thirteenth parameter of the method that this delegate encapsulates. - - - Specifies whether a member is typically used for binding. This class cannot be inherited. - - - Initializes a new instance of the class with a Boolean value. - true to use property for binding; otherwise, false. - - - Initializes a new instance of the class with one of the values. - One of the values. - - - Initializes a new instance of the class. - true to use property for binding; otherwise, false. - One of the values. - - - Initializes a new instance of the class. - One of the values. - One of the values. - - - Gets a value indicating that a property is typically used for binding. - true if the property is typically used for binding; otherwise, false. - - - Specifies the default value for the , which is . This field is read-only. - - - - Gets a value indicating the direction or directions of this property's data binding. - The direction of this property’s data binding. - - - Determines whether two objects are equal. - The object to compare. - true if the specified is equal to the current ; false if it is not equal. - - - Serves as a hash function for the class. - A hash code for the current . - - - Determines if this attribute is the default. - true if the attribute is the default value for this attribute class; otherwise, false. - - - Specifies that a property is not typically used for binding. This field is read-only. - - - - Specifies that a property is typically used for binding. This field is read-only. - - - - Specifies values to indicate whether a property can be bound to a data element or another property. - - - The property is set to the default. - - - - The property is not bindable at design time. - - - - The property is bindable at design time. - - - - Specifies whether the template can be bound one way or two ways. - - - The template can only accept property values. Used with a generic . - - - - The template can accept and expose property values. Used with an . - - - - Provides a generic collection that supports data binding. - The type of elements in the list. - - - Initializes a new instance of the class using default values. - - - Initializes a new instance of the class with the specified list. - An of items to be contained in the . - - - Occurs before an item is added to the list. - - - - Adds a new item to the collection. - The item added to the list. - The property is set to false. -or- A public default constructor could not be found for the current item type. - - - Adds a new item to the end of the collection. - The item that was added to the collection. - The new item is not the same type as the objects contained in the . - - - Gets or sets a value indicating whether items in the list can be edited. - true if list items can be edited; otherwise, false. The default is true. - - - Gets or sets a value indicating whether you can add items to the list using the method. - true if you can add items to the list with the method; otherwise, false. The default depends on the underlying type contained in the list. - - - Gets or sets a value indicating whether you can remove items from the collection. - true if you can remove items from the list with the method otherwise, false. The default is true. - - - Sorts the items if overridden in a derived class; otherwise, throws a . - A that specifies the property to sort on. - One of the values. - Method is not overridden in a derived class. - - - Discards a pending new item. - The index of the of the new item to be added - - - Removes all elements from the collection. - - - Commits a pending new item to the collection. - The index of the new item to be added. - - - Searches for the index of the item that has the specified property descriptor with the specified value, if searching is implemented in a derived class; otherwise, a . - The to search for. - The value of property to match. - The zero-based index of the item that matches the property descriptor and contains the specified value. - is not overridden in a derived class. - - - Inserts the specified item in the list at the specified index. - The zero-based index where the item is to be inserted. - The item to insert in the list. - - - Gets a value indicating whether the list is sorted. - true if the list is sorted; otherwise, false. The default is false. - - - Occurs when the list or an item in the list changes. - - - - Raises the event. - An that contains the event data. - - - Raises the event. - A that contains the event data. - - - Gets or sets a value indicating whether adding or removing items within the list raises events. - true if adding or removing items raises events; otherwise, false. The default is true. - - - Removes the item at the specified index. - The zero-based index of the item to remove. - You are removing a newly added item and is set to false. - - - Removes any sort applied with if sorting is implemented in a derived class; otherwise, raises . - Method is not overridden in a derived class. - - - Raises a event of type . - - - Raises a event of type for the item at the specified position. - A zero-based index of the item to be reset. - - - Replaces the item at the specified index with the specified item. - The zero-based index of the item to replace. - The new value for the item at the specified index. The value can be null for reference types. - index is less than zero. -or- index is greater than . - - - Gets the direction the list is sorted. - One of the values. The default is . - - - Gets the property descriptor that is used for sorting the list if sorting is implemented in a derived class; otherwise, returns null. - The used for sorting the list. - - - Gets a value indicating whether events are enabled. - true if events are supported; otherwise, false. The default is true. - - - Gets a value indicating whether the list supports searching. - true if the list supports searching; otherwise, false. The default is false. - - - Gets a value indicating whether the list supports sorting. - true if the list supports sorting; otherwise, false. The default is false. - - - For a description of this member, see . - The to add as a search criteria. - - - Adds a new item to the list. For more information, see . - The item added to the list. - This method is not supported. - - - Gets a value indicating whether items in the list can be edited. - true if list items can be edited; otherwise, false. The default is true. - - - Gets a value indicating whether new items can be added to the list using the method. - true if you can add items to the list with the method; otherwise, false. The default depends on the underlying type contained in the list. - - - Gets a value indicating whether items can be removed from the list. - true if you can remove items from the list with the method; otherwise, false. The default is true. - - - Sorts the list based on a and a . For a complete description of this member, see . - The to sort by. - One of the values. - - - For a description of this member, see . - The to search on. - The value of the property parameter to search for. - The index of the row that has the given . - - - For a description of this member, see . - true if has been called and has not been called; otherwise, false. - - - For a description of this member, see . - A to remove from the indexes used for searching. - - - For a description of this member, see - - - For a description of this member, see . - One of the values. - - - For a description of this member, see . - The that is being used for sorting. - - - For a description of this member, see . - true if a event is raised when the list changes or when an item changes; otherwise, false. - - - For a description of this member, see . - true if the list supports searching using the method; otherwise, false. - - - For a description of this member, see . - true if the list supports sorting; otherwise, false. - - - Gets a value indicating whether item property value changes raise events of type . This member cannot be overridden in a derived class. - true if the list type implements , otherwise, false. The default is false. - - - Provides a type converter to convert objects to and from various other representations. - - - Initializes a new instance of the class. - - - Gets a value indicating whether this converter can convert an object in the given source type to a Boolean object using the specified context. - An that provides a format context. - A that represents the type you wish to convert from. - true if this object can perform the conversion; otherwise, false. - - - Converts the given value object to a Boolean object. - An that provides a format context. - A that specifies the culture to which to convert. - The to convert. - An that represents the converted value. - value is not a valid value for the target type. - The conversion cannot be performed. - - - Gets a collection of standard values for the Boolean data type. - An that provides a format context. - A that holds a standard set of valid values. - - - Gets a value indicating whether the list of standard values returned from the method is an exclusive list. - An that provides a format context. - true because the returned from is an exhaustive list of possible values. This method never returns false. - - - Gets a value indicating whether this object supports a standard set of values that can be picked from a list. - An that provides a format context. - true because can be called to find a common set of values the object supports. This method never returns false. - - - Specifies whether a property or event should be displayed in a Properties window. - - - Initializes a new instance of the class. - true if a property or event can be modified at design time; otherwise, false. The default is true. - - - Gets a value indicating whether an object is browsable. - true if the object is browsable; otherwise, false. - - - Specifies the default value for the , which is . This static field is read-only. - - - - Indicates whether this instance and a specified object are equal. - Another object to compare to. - true if obj is equal to this instance; otherwise, false. - - - Returns the hash code for this instance. - A 32-bit signed integer hash code. - - - Determines if this attribute is the default. - true if the attribute is the default value for this attribute class; otherwise, false. - - - Specifies that a property or event cannot be modified at design time. This static field is read-only. - - - - Specifies that a property or event can be modified at design time. This static field is read-only. - - - - Provides a type converter to convert 8-bit unsigned integer objects to and from various other representations. - - - Initializes a new instance of the class. - - - Provides data for a cancelable event. - - - Initializes a new instance of the class with the property set to false. - - - Initializes a new instance of the class with the property set to the given value. - true to cancel the event; otherwise, false. - - - Gets or sets a value indicating whether the event should be canceled. - true if the event should be canceled; otherwise, false. - - - Represents the method that handles a cancelable event. - The source of the event. - A that contains the event data. - - - Specifies the name of the category in which to group the property or event when displayed in a control set to Categorized mode. - - - Initializes a new instance of the class using the category name Default. - - - Initializes a new instance of the class using the specified category name. - The name of the category. - - - Gets a representing the Action category. - A for the action category. - - - Gets a representing the Appearance category. - A for the appearance category. - - - Gets a representing the Asynchronous category. - A for the asynchronous category. - - - Gets a representing the Behavior category. - A for the behavior category. - - - Gets the name of the category for the property or event that this attribute is applied to. - The name of the category for the property or event that this attribute is applied to. - - - Gets a representing the Data category. - A for the data category. - - - Gets a representing the Default category. - A for the default category. - - - Gets a representing the Design category. - A for the design category. - - - Gets a representing the DragDrop category. - A for the drag-and-drop category. - - - Returns whether the value of the given object is equal to the current .. - The object to test the value equality of. - true if the value of the given object is equal to that of the current; otherwise, false. - - - Gets a representing the Focus category. - A for the focus category. - - - Gets a representing the Format category. - A for the format category. - - - Returns the hash code for this attribute. - A 32-bit signed integer hash code. - - - Looks up the localized name of the specified category. - The identifer for the category to look up. - The localized name of the category, or null if a localized name does not exist. - - - Determines if this attribute is the default. - true if the attribute is the default value for this attribute class; otherwise, false. - - - Gets a representing the Key category. - A for the key category. - - - Gets a representing the Layout category. - A for the layout category. - - - Gets a representing the Mouse category. - A for the mouse category. - - - Gets a representing the WindowStyle category. - A for the window style category. - - - Provides a type converter to convert Unicode character objects to and from various other representations. - - - Initializes a new instance of the class. - - - Gets a value indicating whether this converter can convert an object in the given source type to a Unicode character object using the specified context. - An that provides a format context. - A that represents the type you want to convert from. - true if this converter can perform the conversion; otherwise, false. - - - Converts the given object to a Unicode character object. - An that provides a format context. - The culture into which value will be converted. - The to convert. - An that represents the converted value. - value is not a valid value for the target type. - The conversion cannot be performed. - - - Converts the given value object to a Unicode character object using the arguments. - An that provides a format context. - The culture into which value will be converted. - The to convert. - The to convert the value to. - An that represents the converted value. - The conversion cannot be performed. - - - Specifies how the collection is changed. - - - Specifies that an element was added to the collection. - - - - Specifies that the entire collection has changed. This is caused by using methods that manipulate the entire collection, such as . - - - - Specifies that an element was removed from the collection. - - - - Provides data for the event. - - - Initializes a new instance of the class. - One of the values that specifies how the collection changed. - An that specifies the instance of the collection where the change occurred. - - - Gets an action that specifies how the collection changed. - One of the values. - - - Gets the instance of the collection with the change. - An that represents the instance of the collection with the change, or null if you refresh the collection. - - - Represents the method that handles the event raised when adding elements to or removing elements from a collection. - The source of the event. - A that contains the event data. - - - Provides a type converter to convert collection objects to and from various other representations. - - - Initializes a new instance of the class. - - - Converts the given value object to the specified destination type. - An that provides a format context. - The culture to which value will be converted. - The to convert. This parameter must inherit from . - The to convert the value to. - An that represents the converted value. - destinationType is null. - The conversion cannot be performed. - - - Gets a collection of properties for the type of array specified by the value parameter using the specified context and attributes. - An that provides a format context. - An that specifies the type of array to get the properties for. - An array of type that will be used as a filter. - A with the properties that are exposed for this data type, or null if there are no properties. This method always returns null. - - - Gets a value indicating whether this object supports properties. - An that provides a format context. - false because should not be called to find the properties of this object. This method never returns true. - - - Specifies the data source and data member properties for a component that supports complex data binding. This class cannot be inherited. - - - Initializes a new instance of the class using no parameters. - - - Initializes a new instance of the class using the specified data source. - The name of the property to be used as the data source. - - - Initializes a new instance of the class using the specified data source and data member. - The name of the property to be used as the data source. - The name of the property to be used as the source for data. - - - Gets the name of the data member property for the component to which the is bound. - The name of the data member property for the component to which is bound - - - Gets the name of the data source property for the component to which the is bound. - The name of the data source property for the component to which is bound. - - - Represents the default value for the class. - - - - Determines whether the specified is equal to the current instance. - The to compare with the current instance - true if the object is equal to the current instance; otherwise, false, indicating they are not equal. - - - Returns the hash code for this instance. - A 32-bit signed integer hash code. - - - Provides the base implementation for the interface and enables object sharing between applications. - - - Initializes a new instance of the class. - - - Gets a value indicating whether the component can raise an event. - true if the component can raise events; otherwise, false. The default is true. - - - Gets the that contains the . - The that contains the , if any, or null if the is not encapsulated in an . - - - Gets a value that indicates whether the is currently in design mode. - true if the is in design mode; otherwise, false. - - - Releases all resources used by the . - - - Releases the unmanaged resources used by the and optionally releases the managed resources. - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - Occurs when the component is disposed by a call to the method. - - - - Gets the list of event handlers that are attached to this . - An that provides the delegates for this component. - - - Releases unmanaged resources and performs other cleanup operations before the is reclaimed by garbage collection. - - - Returns an object that represents a service provided by the or by its . - A service provided by the . - An that represents a service provided by the , or null if the does not provide the specified service. - - - Gets or sets the of the . - The associated with the , or null if the is not encapsulated in an , the does not have an associated with it, or the is removed from its . - - - Returns a containing the name of the , if any. This method should not be overridden. - A containing the name of the , if any, or null if the is unnamed. - - - Provides a read-only container for a collection of objects. - - - Initializes a new instance of the class using the specified array of components. - An array of objects to initialize the collection with. - - - Copies the entire collection to an array, starting writing at the specified array index. - An array to copy the objects in the collection to. - The index of the array at which copying to should begin. - - - Gets the in the collection at the specified collection index. - The collection index of the to get. - The at the specified index. - If the specified index is not within the index range of the collection. - - - Gets any component in the collection matching the specified name. - The name of the to get. - A component with a name matching the name specified by the name parameter, or null if the named component cannot be found in the collection. - - - Provides a type converter to convert components to and from various other representations. - - - Initializes a new instance of the class. - A that represents the type to associate with this component converter. - - - Gets a collection of properties for the type of component specified by the value parameter. - An that provides a format context. - An that specifies the type of component to get the properties for. - An array of type that will be used as a filter. - A with the properties that are exposed for the component, or null if there are no properties. - - - Gets a value indicating whether this object supports properties using the specified context. - An that provides a format context. - true because should be called to find the properties of this object. This method never returns false. - - - Provides the base class for a custom component editor. - - - Initializes a new instance of the class. - - - Edits the component and returns a value indicating whether the component was modified. - The component to be edited. - true if the component was modified; otherwise, false. - - - Edits the component and returns a value indicating whether the component was modified based upon a given context. - An optional context object that can be used to obtain further information about the edit. - The component to be edited. - true if the component was modified; otherwise, false. - - - Provides simple functionality for enumerating resources for a component or object. The class is a . - - - Initializes a new instance of the class with default values. - - - Creates a that looks up resources in satellite assemblies based on information from the specified . - A from which the derives all information for finding resource files. - - - Applies a resource's value to the corresponding property of the object. - An that contains the property value to be applied. - A that contains the name of the object to look up in the resources. - value or objectName is null. - - - Applies a resource's value to the corresponding property of the object. - An that contains the property value to be applied. - A that contains the name of the object to look up in the resources. - The culture for which to apply resources. - value or objectName is null. - - - Provides a base class for getting and setting option values for a designer. - - - Initializes a new instance of the class. - - - Creates a new with the given name and adds it to the given parent. - The parent designer option collection. All collections have a parent except the root object collection. - The name of this collection. - The object providing properties for this collection. Can be null if the collection should not provide any properties. - A new with the given name. - parent or name is null. - name is an empty string. - - - Gets the options collection for this service. - A populated with available designer options. - - - Populates a . - The collection to populate. - - - Shows the options dialog box for the given object. - The options collection containing the object to be invoked. - The actual options object. - true if the dialog box is shown; otherwise, false. - - - Gets the value of an option defined in this package. - The page to which the option is bound. - The name of the option value. - The value of the option named valueName. - pageName or valueName is null. - - - Sets the value of an option defined in this package. - The page to which the option is bound - The name of the option value. - The value of the option. - pageName or valueName is null. - - - Provides a way to group a series of design-time actions to improve performance and enable most types of changes to be undone. - - - Initializes a new instance of the class with no description. - - - Initializes a new instance of the class using the specified transaction description. - A description for this transaction. - - - Cancels the transaction and attempts to roll back the changes made by the events of the transaction. - - - Gets a value indicating whether the transaction was canceled. - true if the transaction was canceled; otherwise, false. - - - Commits this transaction. - - - Gets a value indicating whether the transaction was committed. - true if the transaction was committed; otherwise, false. - - - Gets a description for the transaction. - A description for the transaction. - - - Releases the unmanaged resources used by the and optionally releases the managed resources. - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - Releases the resources associated with this object. This override commits this transaction if it was not already committed. - - - Raises the Cancel event. - - - Performs the actual work of committing a transaction. - - - Releases all resources used by the . - - - Provides data for the and events. - - - Initializes a new instance of the class, using the specified value that indicates whether the designer called on the transaction. - A value indicating whether the transaction was committed. - - - Initializes a new instance of the class. - A value indicating whether the transaction was committed. - true if this is the last transaction to close; otherwise, false. - - - Gets a value indicating whether this is the last transaction to close. - true, if this is the last transaction to close; otherwise, false. - - - Indicates whether the designer called on the transaction. - true if the designer called on the transaction; otherwise, false. - - - Represents the method that handles the and events of a designer. - The source of the event. - A that contains the event data. - - - Represents a verb that can be invoked from a designer. - - - Initializes a new instance of the class. - The text of the menu command that is shown to the user. - The event handler that performs the actions of the verb. - - - Initializes a new instance of the class. - The text of the menu command that is shown to the user. - The event handler that performs the actions of the verb. - The starting command ID for this verb. By default, the designer architecture sets aside a range of command IDs for verbs. You can override this by providing a custom command ID. - - - Gets or sets the description of the menu item for the verb. - A string describing the menu item. - - - Gets the text description for the verb command on the menu. - A description for the verb command. - - - Overrides . - The verb's text, or an empty string ("") if the text field is empty. - - - Represents a collection of objects. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class using the specified array of objects. - A array that indicates the verbs to contain within the collection. - value is null. - - - Adds the specified to the collection. - The to add to the collection. - The index in the collection at which the verb was added. - - - Adds the specified set of designer verbs to the collection. - An array of objects to add to the collection. - value is null. - - - Adds the specified collection of designer verbs to the collection. - A to add to the collection. - value is null. - - - Gets a value indicating whether the specified exists in the collection. - The to search for in the collection. - true if the specified object exists in the collection; otherwise, false. - - - Copies the collection members to the specified array beginning at the specified destination index. - The array to copy collection members to. - The destination index to begin copying to. - - - Gets the index of the specified . - The whose index to get in the collection. - The index of the specified object if it is found in the list; otherwise, -1. - - - Inserts the specified at the specified index. - The index in the collection at which to insert the verb. - The to insert in the collection. - - - Gets or sets the at the specified index. - The index at which to get or set the . - A at each valid index in the collection. - - - Raises the Clear event. - - - Raises the Insert event. - The index at which to insert an item. - The object to insert. - - - Raises the Remove event. - The index at which to remove the item. - The object to remove. - - - Raises the Set event. - The index at which to set the item. - The old object. - The new object. - - - Raises the Validate event. - The object to validate. - - - Removes the specified from the collection. - The to remove from the collection. - - - Represents a design-time license context that can support a license provider at design time. - - - Initializes a new instance of the class. - - - Gets a saved license key. - The type of the license key. - The assembly to get the key from. - The saved license key that matches the specified type. - - - Sets a saved license key. - The type of the license key. - The license key. - - - Gets the license usage mode. - A indicating the licensing mode for the context. - - - Provides support for design-time license context serialization. - - - Serializes the licenses within the specified design-time license context using the specified key and output stream. - The stream to output to. - The key to use for encryption. - A indicating the license context. - - - Defines identifiers that indicate information about the context in which a request for Help information originated. - - - A general context. - - - - A selection. - - - - A tool window selection. - - - - A window. - - - - Specifies the context keyword for a class or member. This class cannot be inherited. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. - The Help keyword value. - keyword is null. - - - Initializes a new instance of the class from the given type. - The type from which the Help keyword will be taken. - t is null. - - - Represents the default value for . This field is read-only. - - - - Determines whether two instances are equal. - The to compare with the current . - true if the specified is equal to the current ; otherwise, false. - - - Returns the hash code for this instance. - A hash code for the current . - - - Gets the Help keyword supplied by this attribute. - The Help keyword supplied by this attribute. - - - Determines whether the Help keyword is null. - true if the Help keyword is null; otherwise, false. - - - Defines identifiers that indicate the type of a Help keyword. - - - A keyword that F1 was pressed to request help about. - - - - A filter keyword. - - - - A general keyword. - - - - Provides an interface to add and remove the event handlers for events that add, change, remove or rename components, and provides methods to raise a or event. - - - Occurs when a component has been added. - - - - Occurs when a component is in the process of being added. - - - - Occurs when a component has been changed. - - - - Occurs when a component is in the process of being changed. - - - - Occurs when a component has been removed. - - - - Occurs when a component is in the process of being removed. - - - - Occurs when a component is renamed. - - - - Announces to the component change service that a particular component has changed. - The component that has changed. - The member that has changed. This is null if this change is not related to a single member. - The old value of the member. This is valid only if the member is not null. - The new value of the member. This is valid only if the member is not null. - - - Announces to the component change service that a particular component is changing. - The component that is about to change. - The member that is changing. This is null if this change is not related to a single member. - - - Enables enumeration of components at design time. - - - Gets the list of available component types. - The designer host providing design-time services. Can be null. - The base type specifying the components to retrieve. Can be null. - The list of available component types. - - - Provides a set of recommended default values during component creation. - - - Restores an instance of a component to its default state. - A dictionary of default property values, which are name/value pairs, with which to reset the component's state. - - - Initializes a new component using a set of recommended values. - A dictionary of default property values, which are name/value pairs, with which to initialize the component's state. - - - Provides the basic framework for building a custom designer. - - - Gets the base component that this designer is designing. - An indicating the base component that this designer is designing. - - - Performs the default action for this designer. - - - Initializes the designer with the specified component. - The component to associate with this designer. - - - Gets a collection of the design-time verbs supported by the designer. - A that contains the verbs supported by the designer, or null if the component has no verbs. - - - Provides event notifications when root designers are added and removed, when a selected component changes, and when the current root designer changes. - - - Gets the root designer for the currently active document. - The currently active document, or null if there is no active document. - - - Occurs when the current root designer changes. - - - - Occurs when a root designer is created. - - - - Occurs when a root designer for a document is disposed. - - - - Gets a collection of root designers for design documents that are currently active in the development environment. - A containing the root designers that have been created and not yet disposed. - - - Occurs when the current design-view selection changes. - - - - Provides an interface that enables a designer to access and filter the dictionaries of a that stores the property, attribute, and event descriptors that a component designer can expose to the design-time environment. - - - When overridden in a derived class, allows a designer to change or remove items from the set of attributes that it exposes through a . - The objects for the class of the component. The keys in the dictionary of attributes are the values of the attributes. - - - When overridden in a derived class, allows a designer to change or remove items from the set of events that it exposes through a . - The objects that represent the events of the class of the component. The keys in the dictionary of events are event names. - - - When overridden in a derived class, allows a designer to change or remove items from the set of properties that it exposes through a . - The objects that represent the properties of the class of the component. The keys in the dictionary of properties are property names. - - - When overridden in a derived class, allows a designer to add items to the set of attributes that it exposes through a . - The objects for the class of the component. The keys in the dictionary of attributes are the values of the attributes. - - - When overridden in a derived class, allows a designer to add items to the set of events that it exposes through a . - The objects that represent the events of the class of the component. The keys in the dictionary of events are event names. - - - When overridden in a derived class, allows a designer to add items to the set of properties that it exposes through a . - The objects that represent the properties of the class of the component. The keys in the dictionary of properties are property names. - - - Provides an interface for managing designer transactions and components. - - - Activates the designer that this host is hosting. - - - Occurs when this designer is activated. - - - - Gets the container for this designer host. - The for this host. - - - Creates a component of the specified type and adds it to the design document. - The type of the component to create. - The newly created component. - - - Creates a component of the specified type and name, and adds it to the design document. - The type of the component to create. - The name for the component. - The newly created component. - - - Creates a that can encapsulate event sequences to improve performance and enable undo and redo support functionality. - A new instance of . When you complete the steps in your transaction, you should call on this object. - - - Creates a that can encapsulate event sequences to improve performance and enable undo and redo support functionality, using the specified transaction description. - A title or description for the newly created transaction. - A new . When you have completed the steps in your transaction, you should call on this object. - - - Occurs when this designer is deactivated. - - - - Destroys the specified component and removes it from the designer container. - The component to destroy. - - - Gets the designer instance that contains the specified component. - The to retrieve the designer for. - An , or null if there is no designer for the specified component. - - - Gets an instance of the specified, fully qualified type name. - The name of the type to load. - The type object for the specified type name, or null if the type cannot be found. - - - Gets a value indicating whether the designer host is currently in a transaction. - true if a transaction is in progress; otherwise, false. - - - Occurs when this designer completes loading its document. - - - - Gets a value indicating whether the designer host is currently loading the document. - true if the designer host is currently loading the document; otherwise, false. - - - Gets the instance of the base class used as the root component for the current design. - The instance of the root component class. - - - Gets the fully qualified name of the class being designed. - The fully qualified name of the base component class. - - - Adds an event handler for the event. - - - - Adds an event handler for the event. - - - - Gets the description of the current transaction. - A description of the current transaction. - - - Adds an event handler for the event. - - - - Adds an event handler for the event. - - - - Specifies methods for the designer host to report on the state of transactions. - - - Gets a value indicating whether the designer host is closing a transaction. - true if the designer is closing a transaction; otherwise, false. - - - Provides access to the designer options located on the Tools menu under the Options command in the Visual Studio development environment. - - - Gets the value of the specified Windows Forms Designer option. - The name of the page that defines the option. - The name of the option property. - The value of the specified option. - - - Sets the value of the specified Windows Forms Designer option. - The name of the page that defines the option. - The name of the option property. - The new value. - - - Provides a basic, component site-specific, key-value pair dictionary through a service that a designer can use to store user-defined data. - - - Gets the key corresponding to the specified value. - The value to look up in the dictionary. - The associated key, or null if no key exists. - - - Gets the value corresponding to the specified key. - The key to look up the value for. - The associated value, or null if no value exists. - - - Sets the specified key-value pair. - An object to use as the key to associate the value with. - The value to store. - - - Specifies all the hash algorithms used for hashing files and for generating the strong name. - - - Retrieves the MD5 message-digest algorithm. MD5 was developed by Rivest in 1991. It is basically MD4 with safety-belts and while it is slightly slower than MD4, it helps provide more security. The algorithm consists of four distinct rounds, which has a slightly different design from that of MD4. Message-digest size, as well as padding requirements, remain the same. - - - - A mask indicating that there is no hash algorithm. If you specify None for a multi-module assembly, the common language runtime defaults to the SHA1 algorithm, since multi-module assemblies need to generate a hash. - - - - A mask used to retrieve a revision of the Secure Hash Algorithm that corrects an unpublished flaw in SHA. - - - - A mask used to retrieve a version of the Secure Hash Algorithm with a hash size of 256 bits. - - - - A mask used to retrieve a version of the Secure Hash Algorithm with a hash size of 384 bits. - - - - A mask used to retrieve a version of the Secure Hash Algorithm with a hash size of 512 bits. - - - - Defines the different types of assembly version compatibility. This feature is not available in version 1.0 of the .NET Framework. - - - The assembly cannot execute with other versions if they are executing in the same application domain. - - - - The assembly cannot execute with other versions if they are executing on the same machine. - - - - The assembly cannot execute with other versions if they are executing in the same process. - - - - Represents a set of SQL commands and a database connection that are used to fill the and update the data source. - - - Initializes a new instance of a class. - - - Initializes a new instance of a class from an existing object of the same type. - A object used to create the new . - - - Gets or sets a value indicating whether is called on a after it is added to the during any of the Fill operations. - true if is called on the ; otherwise false. The default is true. - - - Gets or sets whether is called during a . - true if is called during an ; otherwise false. The default is true. - - - Creates a copy of this instance of . - The cloned instance of . - - - Gets or sets a value that specifies whether to generate an exception when an error is encountered during a row update. - true to continue the update without generating an exception; otherwise false. The default is false. - - - Creates a new . - A new table mapping collection. - - - Releases the unmanaged resources used by the and optionally releases the managed resources. - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - Adds or refreshes rows in the to match those in the data source. - A to fill with records and, if necessary, schema. - The number of rows successfully added to or refreshed in the . This does not include rows affected by statements that do not return rows. - - - Adds or refreshes rows in the to match those in the data source using the name and the specified . - A to fill with records. - An instance of . - The number of rows successfully added to or refreshed in the . This does not include rows affected by statements that do not return rows. - - - Adds or refreshes rows in a specified range in the collection of objects to match those in the data source. - A collection of objects to fill with records. - An instance of . - The zero-based index of the starting record. - An integer indicating the maximum number of records. - The number of rows successfully added to or refreshed in the . This does not include rows affected by statements that do not return rows. - - - Adds or refreshes rows in a specified range in the to match those in the data source using the and names. - A to fill with records. - A string indicating the name of the source table. - An instance of . - The zero-based index of the starting record. - An integer indicating the maximum number of records. - The number of rows successfully added to or refreshed in the . This does not include rows affected by statements that do not return rows. - - - Returned when an error occurs during a fill operation. - - - - Gets or sets the that determines how the adapter fills the from the . - A value. - - - Adds a to the specified . - The to be filled from the . - One of the values. - The name of the source table to use for table mapping. - The to be used as the data source when filling the . - A reference to a collection of objects that were added to the . - - - Adds a to the specified and configures the schema to match that in the data source based on the specified . - The to be filled with the schema from the data source. - One of the values. - A object that contains schema information returned from the data source. - - - Adds a to the specified . - The to be filled from the . - One of the values. - The to be used as the data source when filling the . - A object that contains schema information returned from the data source. - - - Gets the parameters set by the user when executing an SQL SELECT statement. - An array of objects that contains the parameters set by the user. - - - Indicates whether a has been created. - true if a has been created; otherwise false. - - - Determines the action to take when incoming data does not have a matching table or column. - One of the values. The default is Passthrough. - The value set is not one of the values. - - - Determines the action to take when existing schema does not match incoming data. - One of the values. The default is Add. - The value set is not one of the values. - - - Invoked when an error occurs during a Fill. - A object. - - - Resets to its default state and causes to honor . - - - Gets or sets whether the Fill method should return provider-specific values or common CLS-compliant values. - true if the Fill method should return provider-specific values; otherwise false to return common CLS-compliant values. - - - Determines whether the property should be persisted. - true if the property is persisted; otherwise false. - - - Determines whether the property should be persisted. - true if the property is persisted; otherwise false. - - - Determines whether one or more objects exist and they should be persisted. - true if one or more objects exist; otherwise false. - - - Gets a collection that provides the master mapping between a source table and a . - A collection that provides the master mapping between the returned records and the . The default value is an empty collection. - - - Calls the respective INSERT, UPDATE, or DELETE statements for each inserted, updated, or deleted row in the specified from a named "Table." - The used to update the data source. - The number of rows successfully updated from the . - The source table is invalid. - An attempt to execute an INSERT, UPDATE, or DELETE statement resulted in zero records affected. - - - Indicates how a source table is mapped to a dataset table. - A collection that provides the master mapping between the returned records and the . The default value is an empty collection. - - - Contains a generic column mapping for an object that inherits from . This class cannot be inherited. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with the specified source column name and column name to map to. - The case-sensitive column name from a data source. - The column name, which is not case sensitive, from a to map to. - - - Gets or sets the name of the column within the to map to. - The name of the column within the to map to. The name is not case sensitive. - - - Gets a from the given using the and the property. - The to get the column from. - The of the data column. - One of the values. - A data column. - - - A static version of that can be called without instantiating a object. - The case-sensitive column name from a data source. - The column name, which is not case sensitive, from a to map to. - An instance of . - The data type for the column being mapped. - Determines the action to take when existing schema does not match incoming data. - A object. - - - Gets or sets the name of the column within the data source to map from. The name is case-sensitive. - The case-sensitive name of the column in the data source. - - - Converts the current name to a string. - The current name as a string. - - - Creates a new object that is a copy of the current instance. - A copy of the current object. - - - Contains a collection of objects. - - - Creates an empty . - - - Adds a object to the collection. - A DataColumnMapping object to add to the collection. - The index of the DataColumnMapping object that was added to the collection. - The object passed in was not a object. - - - Adds a object to the collection when given a source column name and a column name. - The case-sensitive name of the source column to map to. - The name, which is not case-sensitive, of the column to map to. - The DataColumnMapping object that was added to the collection. - - - Copies the elements of the specified to the end of the collection. - The to add to the collection. - - - Copies the elements of the specified array to the end of the collection. - The array of objects to add to the collection. - - - Removes all objects from the collection. - - - Gets a value indicating whether a object with the given exists in the collection. - An that is the . - true if the collection contains the specified object; otherwise, false. - The object passed in was not a object. - - - Gets a value indicating whether a object with the given source column name exists in the collection. - The case-sensitive source column name of the object. - true if collection contains a object with the specified source column name; otherwise, false. - - - Copies the elements of the to the specified array. - An to which to copy elements. - The starting index of the array. - - - Copies the elements of the to the specified array. - A array to which to copy the elements. - The zero-based index in the array at which copying begins. - - - Gets the number of objects in the collection. - The number of items in the collection. - - - Gets the object with the specified column name. - The name, which is not case-sensitive, of the column to find. - The object with the specified column name. - - - Gets a for the specified , source column name, and . - The . - The case-sensitive source column name to find. - One of the values. - A object. - The mappingAction parameter was set to Error, and no mapping was specified. - - - A static method that returns a object without instantiating a object. - The . - The case-sensitive column name from a data source. - The data type for the column being mapped. - An instance of . - One of the values. - Determines the action to take when the existing schema does not match incoming data. - A object. - - - Gets an enumerator that can iterate through the collection. - An that can be used to iterate through the collection. - - - Gets the location of the with the specified source column name. - The case-sensitive name of the source column. - The zero-based location of the with the specified case-sensitive source column name. - - - Gets the location of the specified that is a within the collection. - An that is the to find. - The zero-based location of the specified that is a within the collection. - - - Gets the location of the specified with the given column name. - The name, which is not case-sensitive, of the data set column to find. - The zero-based location of the specified with the given DataSet column name, or -1 if the DataColumnMapping object does not exist in the collection. - - - Inserts a object into the at the specified index. - The zero-based index of the object to insert. - The object. - - - Inserts a object into the at the specified index. - The zero-based index of the object to insert. - The object. - - - Gets or sets the object at the specified index. - The zero-based index of the object to find. - The object at the specified index. - - - Gets or sets the object with the specified source column name. - The case-sensitive name of the source column. - The object with the specified source column name. - - - Removes the specified from the collection. - The to remove. - - - Removes the that is a from the collection. - The that is the to remove. - The object specified was not a object. - The object specified is not in the collection. - - - Removes the object with the specified index from the collection. - The zero-based index of the object to remove. - There is no object with the specified index. - - - Removes the object with the specified source column name from the collection. - The case-sensitive source column name. - There is no object with the specified source column name. - - - Gets a value that indicates whether access to the is synchronized (thread safe). - true if access to the is synchronized (thread safe); otherwise, false. - - - Gets an object that can be used to synchronize access to the . - An object that can be used to synchronize access to the . - - - Gets a value that indicates whether the has a fixed size. - true if the has a fixed size; otherwise, false. - - - Gets a value that indicates whether the is read-only. - true if the is read-only; otherwise, false. - - - Gets or sets the element at the specified index. - The zero-based index of the element to get or set. - The element at the specified index. - - - Adds a object to the by using the source column and column names. - The case-sensitive name of the source column. - The name of the column. - The ColumnMapping object that was added to the collection. - - - Gets the object that has the specified column name. - The name, which is not case-sensitive, of the column to find. - The object that has the specified column name. - - - Gets or sets the object with the specified SourceColumn name. - Index of the element. - The IColumnMapping object with the specified SourceColumn name. - - - Contains a description of a mapped relationship between a source table and a . This class is used by a when populating a . - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with a source when given a source table name and a name. - The case-sensitive source table name from a data source. - The table name from a to map to. - - - Initializes a new instance of the class when given a source table name, a name, and an array of objects. - The case-sensitive source table name from a data source. - The table name from a to map to. - An array of objects. - - - Gets the for the . - A data column mapping collection. - - - Gets or sets the table name from a . - The table name from a . - - - Gets a from the specified using the specified value and the name of the . - The name of the . - One of the values. - A data column. - The mappingAction parameter was set to Error, and no mapping was specified. - - - Returns a object for a given column name. - The name of the . - The data type for sourceColumn. - The table name from a to map to. - One of the values. - One of the values. - A object. - - - Gets the current for the specified using the specified value. - The from which to get the . - One of the values. - A data table. - - - Gets or sets the case-sensitive source table name from a data source. - The case-sensitive source table name from a data source. - - - Converts the current name to a string. - The current name, as a string. - - - Gets the derived for the . - A data column mapping collection. - - - Creates a new object that is a copy of the current instance. - A new object that is a copy of the current instance. - - - Controls how the values from the data source will be applied to existing rows when using the or method. - - - The incoming values for this row will be written to both the current value and the original value versions of the data for each column. - - - - The incoming values for this row will be written to the original value version of each column. The current version of the data in each column will not be changed. This is the default. - - - - The incoming values for this row will be written to the current version of each column. The original version of each column's data will not be changed. - - - - Specifies how a is mapped. - - - The column is mapped to an XML attribute. - - - - The column is mapped to an XML element. - - - - The column is mapped to an internal structure. - - - - The column is mapped to an node. - - - - Occurs when a target and source DataRow have the same primary key value, and the property is set to true. - - - Initializes a new instance of a class with the and a description of the merge conflict. - The object. - A description of the merge conflict. - - - Returns a description of the merge conflict. - A description of the merge conflict. - - - Returns the object. - The object. - - - Represents the method that will handle the event. - The source of the event. - The data for the event. - - - Represents the exception that is thrown when you try to perform an operation on a that is not in a . - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with the specified string. - The string to display when the exception is thrown. - - - Initializes a new instance of the class with serialization information. - The data that is required to serialize or deserialize an object. - Description of the source and destination of the specified serialized stream. - - - Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. - The error message that explains the reason for the exception. - The exception that is the cause of the current exception, or a null reference (Nothing in Visual Basic) if no inner exception is specified. - - - Indicates the action that occurs when a is enforced. - - - Delete or update related rows. This is the default. - - - - No action taken on related rows. - - - - Set values in related rows to the value contained in the property. - - - - Set values in related rows to DBNull. - - - - Indicates the schema serialization mode for a typed . - - - Skips schema serialization for a typed . - - - - Includes schema serialization for a typed . The default. - - - - Specifies how to handle existing schema mappings when performing a operation. - - - Apply any existing table mappings to the incoming schema. Configure the with the transformed schema. - - - - Ignore any table mappings on the DataAdapter. Configure the using the incoming schema without applying any transformations. - - - - Determines the serialization format for a . - - - Serialize as binary content. Available in ADO.NET 2.0 only. - - - - Serialize as XML content. The default. - - - - Provides a simple on/off switch that controls debugging and tracing output. - - - Initializes a new instance of the class with the specified display name and description. - The name to display on a user interface. - The description of the switch. - - - Initializes a new instance of the class with the specified display name, description, and default switch value. - The name to display on the user interface. - The description of the switch. - The default value of the switch. - - - Gets or sets a value indicating whether the switch is enabled or disabled. - true if the switch is enabled; otherwise, false. The default is false. - The caller does not have the correct permission. - - - Determines whether the new value of the property can be parsed as a Boolean value. - - - Specifies that the attributed code should be excluded from code coverage information. - - - Initializes a new instance of the class. - - - Suppresses reporting of a specific static analysis tool rule violation, allowing multiple suppressions on a single code artifact. - - - Initializes a new instance of the class, specifying the category of the static analysis tool and the identifier for an analysis rule. - The category for the attribute. - The identifier of the analysis tool rule the attribute applies to. - - - Gets the category identifying the classification of the attribute. - The category identifying the attribute. - - - Gets the identifier of the static analysis tool rule to be suppressed. - The identifier of the static analysis tool rule to be suppressed. - - - Gets or sets the justification for suppressing the code analysis message. - The justification for suppressing the message. - - - Gets or sets an optional argument expanding on exclusion criteria. - A string containing the expanded exclusion criteria. - - - Gets or sets the scope of the code that is relevant for the attribute. - The scope of the code that is relevant for the attribute. - - - Gets or sets a fully qualified path that represents the target of the attribute. - A fully qualified path that represents the target of the attribute. - - - Indicates to compilers that a method call or attribute should be ignored unless a specified conditional compilation symbol is defined. - - - Initializes a new instance of the class. - A string that specifies the case-sensitive conditional compilation symbol that is associated with the attribute. - - - Gets the conditional compilation symbol that is associated with the attribute. - A string that specifies the case-sensitive conditional compilation symbol that is associated with the attribute. - - - Contains static methods for representing program contracts such as preconditions, postconditions, and object invariants. - - - Checks for a condition; if the condition is false, follows the escalation policy set for the analyzer. - The conditional expression to test. - - - Checks for a condition; if the condition is false, follows the escalation policy set by the analyzer and displays the specified message. - The conditional expression to test. - A message to display if the condition is not met. - - - Instructs code analysis tools to assume that the specified condition is true, even if it cannot be statically proven to always be true. - The conditional expression to assume true. - - - Instructs code analysis tools to assume that a condition is true, even if it cannot be statically proven to always be true, and displays a message if the assumption fails. - The conditional expression to assume true. - The message to post if the assumption fails. - - - Occurs when a contract fails. - - - - Marks the end of the contract section when a method's contracts contain only preconditions in the if-then-throw form. - - - Specifies a postcondition contract for the enclosing method or property. - The conditional expression to test. The expression may include , , and values. - - - Specifies a postcondition contract for a provided exit condition and a message to display if the condition is false. - The conditional expression to test. The expression may include and values. - The message to display if the expression is not true. - - - Specifies a postcondition contract for the enclosing method or property, based on the provided exception and condition. - The conditional expression to test. - The type of exception that invokes the postcondition check. - - - Specifies a postcondition contract and a message to display if the condition is false for the enclosing method or property, based on the provided exception and condition. - The conditional expression to test. - The message to display if the expression is false. - The type of exception that invokes the postcondition check. - - - Determines whether a specified test is true for any integer within a range of integers. - The first integer to pass to predicate. - One more than the last integer to pass to predicate. - The function to evaluate for any value of the integer in the specified range. - true if predicate returns true for any integer starting from fromInclusive to toExclusive - 1. - predicate is null. - toExclusive is less than fromInclusive. - - - Determines whether an element within a collection of elements exists within a function. - The collection from which elements of type T will be drawn to pass to predicate. - The function to evaluate for an element in collection. - The type that is contained in collection. - true if and only if predicate returns true for any element of type T in collection. - collection or predicate is null. - - - Determines whether a particular condition is valid for all integers in a specified range. - The first integer to pass to predicate. - One more than the last integer to pass to predicate. - The function to evaluate for the existence of the integers in the specified range. - true if predicate returns true for all integers starting from fromInclusive to toExclusive - 1. - predicate is null. - toExclusive is less than fromInclusive. - - - Determines whether all the elements in a collection exist within a function. - The collection from which elements of type T will be drawn to pass to predicate. - The function to evaluate for the existence of all the elements in collection. - The type that is contained in collection. - true if and only if predicate returns true for all elements of type T in collection. - collection or predicate is null. - - - Specifies an invariant contract for the enclosing method or property. - The conditional expression to test. - - - Specifies an invariant contract for the enclosing method or property, and displays a message if the condition for the contract fails. - The conditional expression to test. - The message to display if the condition is false. - - - Represents values as they were at the start of a method or property. - The value to represent (field or parameter). - The type of value. - The value of the parameter or field at the start of a method or property. - - - Specifies a precondition contract for the enclosing method or property. - The conditional expression to test. - - - Specifies a precondition contract for the enclosing method or property, and displays a message if the condition for the contract fails. - The conditional expression to test. - The message to display if the condition is false. - - - Specifies a precondition contract for the enclosing method or property, and throws an exception if the condition for the contract fails. - The conditional expression to test. - The exception to throw if the condition is false. - - - Specifies a precondition contract for the enclosing method or property, and throws an exception with the provided message if the condition for the contract fails. - The conditional expression to test. - The message to display if the condition is false. - The exception to throw if the condition is false. - - - Represents the return value of a method or property. - Type of return value of the enclosing method or property. - Return value of the enclosing method or property. - - - Represents the final (output) value of an out parameter when returning from a method. - The out parameter. - The type of the out parameter. - The output value of the out parameter. - - - The exception that is thrown when there is an attempt to divide an integral or value by zero. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with a specified error message. - A that describes the error. - - - Initializes a new instance of the class with serialized data. - The object that holds the serialized object data. - The contextual information about the source or destination. - - - Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. - The error message that explains the reason for the exception. - The exception that is the cause of the current exception. If the innerException parameter is not null, the current exception is raised in a catch block that handles the inner exception. - - - The exception that is thrown when a DLL specified in a DLL import cannot be found. - - - Initializes a new instance of the class with default properties. - - - Initializes a new instance of the class with a specified error message. - The error message that explains the reason for the exception. - - - Initializes a new instance of the class with serialized data. - The that holds the serialized object data about the exception being thrown. - The that contains contextual information about the source or destination. - - - Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. - The error message that explains the reason for the exception. - The exception that is the cause of the current exception. If the inner parameter is not null, the current exception is raised in a catch block that handles the inner exception. - - - Represents a double-precision floating-point number. - - - Compares this instance to a specified double-precision floating-point number and returns an integer that indicates whether the value of this instance is less than, equal to, or greater than the value of the specified double-precision floating-point number. - A double-precision floating-point number to compare. -

A signed number indicating the relative values of this instance and value.

-
Return Value

-

Description

-

Less than zero

-

This instance is less than value.

-

-or-

-

This instance is not a number () and value is a number.

-

Zero

-

This instance is equal to value.

-

-or-

-

Both this instance and value are not a number (), , or .

-

Greater than zero

-

This instance is greater than value.

-

-or-

-

This instance is a number and value is not a number ().

-

-
-
- - Compares this instance to a specified object and returns an integer that indicates whether the value of this instance is less than, equal to, or greater than the value of the specified object. - An object to compare, or null. -

A signed number indicating the relative values of this instance and value.

-
Value

-

Description

-

A negative integer

-

This instance is less than value.

-

-or-

-

This instance is not a number () and value is a number.

-

Zero

-

This instance is equal to value.

-

-or-

-

This instance and value are both Double.NaN, , or

A positive integer

-

This instance is greater than value.

-

-or-

-

This instance is a number and value is not a number ().

-

-or-

-

value is null.

-

-
- value is not a . -
- - Represents the smallest positive value that is greater than zero. This field is constant. - - - - Returns a value indicating whether this instance and a specified object represent the same value. - A object to compare to this instance. - true if obj is equal to this instance; otherwise, false. - - - Returns a value indicating whether this instance is equal to a specified object. - An object to compare with this instance. - true if obj is an instance of and equals the value of this instance; otherwise, false. - - - Returns the hash code for this instance. - A 32-bit signed integer hash code. - - - Returns the for value type . - The enumerated constant, . - - - Returns a value indicating whether the specified number evaluates to negative or positive infinity - A double-precision floating-point number. - true if d evaluates to or ; otherwise, false. - - - Returns a value that indicates whether the specified value is not a number (). - A double-precision floating-point number. - true if d evaluates to ; otherwise, false. - - - Returns a value indicating whether the specified number evaluates to negative infinity. - A double-precision floating-point number. - true if d evaluates to ; otherwise, false. - - - Returns a value indicating whether the specified number evaluates to positive infinity. - A double-precision floating-point number. - true if d evaluates to ; otherwise, false. - - - Represents the largest possible value of a . This field is constant. - - - - Represents the smallest possible value of a . This field is constant. - - - - Represents a value that is not a number (NaN). This field is constant. - - - - Represents negative infinity. This field is constant. - - - - Returns a value that indicates whether two specified values are equal. - The first value to compare. - The second value to compare. - true if left and right are equal; otherwise, false. - - - Returns a value that indicates whether a specified value is greater than another specified value. - The first value to compare. - The second value to compare. - true if left is greater than right; otherwise, false. - - - Returns a value that indicates whether a specified value is greater than or equal to another specified value. - The first value to compare. - The second value to compare. - true if left is greater than or equal to right; otherwise, false. - - - Returns a value that indicates whether two specified values are not equal. - The first value to compare. - The second value to compare. - true if left and right are not equal; otherwise, false. - - - Returns a value that indicates whether a specified value is less than another specified value. - The first value to compare. - The second value to compare. - true if left is less than right; otherwise, false. - - - Returns a value that indicates whether a specified value is less than or equal to another specified value. - The first value to compare. - The second value to compare. - true if left is less than or equal to right; otherwise, false. - - - Converts the string representation of a number in a specified culture-specific format to its double-precision floating-point number equivalent. - A string that contains a number to convert. - An object that supplies culture-specific formatting information about s. - A double-precision floating-point number that is equivalent to the numeric value or symbol specified in s. - s is null. - s does not represent a number in a valid format. - s represents a number that is less than or greater than . - - - Converts the string representation of a number in a specified style and culture-specific format to its double-precision floating-point number equivalent. - A string that contains a number to convert. - A bitwise combination of enumeration values that indicate the style elements that can be present in s. A typical value to specify is combined with . - An object that supplies culture-specific formatting information about s. - A double-precision floating-point number that is equivalent to the numeric value or symbol specified in s. - s is null. - s does not represent a numeric value. - style is not a value. -or- style is the value. - s represents a number that is less than or greater than . - - - Converts the string representation of a number to its double-precision floating-point number equivalent. - A string that contains a number to convert. - A double-precision floating-point number that is equivalent to the numeric value or symbol specified in s. - s is null. - s does not represent a number in a valid format. - s represents a number that is less than or greater than . - - - Converts the string representation of a number in a specified style to its double-precision floating-point number equivalent. - A string that contains a number to convert. - A bitwise combination of enumeration values that indicate the style elements that can be present in s. A typical value to specify is a combination of combined with . - A double-precision floating-point number that is equivalent to the numeric value or symbol specified in s. - s is null. - s does not represent a number in a valid format. - s represents a number that is less than or greater than . - style is not a value. -or- style includes the value. - - - Represents positive infinity. This field is constant. - - - - Converts the numeric value of this instance to its equivalent string representation using the specified format and culture-specific format information. - A numeric format string. - An object that supplies culture-specific formatting information. - The string representation of the value of this instance as specified by format and provider. - - - Converts the numeric value of this instance to its equivalent string representation, using the specified format. - A numeric format string. - The string representation of the value of this instance as specified by format. - format is invalid. - - - Converts the numeric value of this instance to its equivalent string representation using the specified culture-specific format information. - An object that supplies culture-specific formatting information. - The string representation of the value of this instance as specified by provider. - - - Converts the numeric value of this instance to its equivalent string representation. - The string representation of the value of this instance. - - - Converts the string representation of a number in a specified style and culture-specific format to its double-precision floating-point number equivalent. A return value indicates whether the conversion succeeded or failed. - A string containing a number to convert. - A bitwise combination of values that indicates the permitted format of s. A typical value to specify is combined with . - An that supplies culture-specific formatting information about s. - When this method returns, contains a double-precision floating-point number equivalent of the numeric value or symbol contained in s, if the conversion succeeded, or zero if the conversion failed. The conversion fails if the s parameter is null or , is not in a format compliant with style, represents a number less than or greater than , or if style is not a valid combination of enumerated constants. This parameter is passed uninitialized; any value originally supplied in result will be overwritten. - true if s was converted successfully; otherwise, false. - style is not a value. -or- style includes the value. - - - Converts the string representation of a number to its double-precision floating-point number equivalent. A return value indicates whether the conversion succeeded or failed. - A string containing a number to convert. - When this method returns, contains the double-precision floating-point number equivalent of the s parameter, if the conversion succeeded, or zero if the conversion failed. The conversion fails if the s parameter is null or , is not a number in a valid format, or represents a number less than or greater than . This parameter is passed uninitialized; any value originally supplied in result will be overwritten. - true if s was converted successfully; otherwise, false. - - - For a description of this member, see . - This parameter is ignored. - true if the value of the current instance is not zero; otherwise, false. - - - For a description of this member, see . - This parameter is ignored. - The value of the current instance, converted to a . - - - This conversion is not supported. Attempting to use this method throws an . - This parameter is ignored. - This conversion is not supported. No value is returned. - In all cases. - - - This conversion is not supported. Attempting to use this method throws an - This parameter is ignored. - This conversion is not supported. No value is returned. - In all cases. - - - For a description of this member, see . - This parameter is ignored. - The value of the current instance, converted to a . - - - For a description of this member, see . - This parameter is ignored. - The value of the current instance, unchanged. - - - For a description of this member, see . - This parameter is ignored. - The value of the current instance, converted to an . - - - For a description of this member, see . - This parameter is ignored. - The value of the current instance, converted to an . - - - For a description of this member, see . - This parameter is ignored. - The value of the current instance, converted to an . - - - For a description of this member, see . - This parameter is ignored. - The value of the current instance, converted to an . - - - For a description of this member, see . - This parameter is ignored. - The value of the current instance, converted to a . - - - For a description of this member, see . - The type to which to convert this value. - An implementation that supplies culture-specific information about the format of the returned value. - The value of the current instance, converted to type. - - - For a description of this member, see . - This parameter is ignored. - The value of the current instance, converted to a . - - - For a description of this member, see . - This parameter is ignored. - The value of the current instance, converted to a . - - - For a description of this member, see . - This parameter is ignored. - The value of the current instance, converted to a . - - - Represents an ARGB (alpha, red, green, blue) color. - - - Gets the alpha component value of this structure. - The alpha component value of this . - - - Gets a system-defined color that has an ARGB value of #FFF0F8FF. - A representing a system-defined color. - - - Gets a system-defined color that has an ARGB value of #FFFAEBD7. - A representing a system-defined color. - - - Gets a system-defined color that has an ARGB value of #FF00FFFF. - A representing a system-defined color. - - - Gets a system-defined color that has an ARGB value of #FF7FFFD4. - A representing a system-defined color. - - - Gets a system-defined color that has an ARGB value of #FFF0FFFF. - A representing a system-defined color. - - - Gets the blue component value of this structure. - The blue component value of this . - - - Gets a system-defined color that has an ARGB value of #FFF5F5DC. - A representing a system-defined color. - - - Gets a system-defined color that has an ARGB value of #FFFFE4C4. - A representing a system-defined color. - - - Gets a system-defined color that has an ARGB value of #FF000000. - A representing a system-defined color. - - - Gets a system-defined color that has an ARGB value of #FFFFEBCD. - A representing a system-defined color. - - - Gets a system-defined color that has an ARGB value of #FF0000FF. - A representing a system-defined color. - - - Gets a system-defined color that has an ARGB value of #FF8A2BE2. - A representing a system-defined color. - - - Gets a system-defined color that has an ARGB value of #FFA52A2A. - A representing a system-defined color. - - - Gets a system-defined color that has an ARGB value of #FFDEB887. - A representing a system-defined color. - - - Gets a system-defined color that has an ARGB value of #FF5F9EA0. - A representing a system-defined color. - - - Gets a system-defined color that has an ARGB value of #FF7FFF00. - A representing a system-defined color. - - - Gets a system-defined color that has an ARGB value of #FFD2691E. - A representing a system-defined color. - - - Gets a system-defined color that has an ARGB value of #FFFF7F50. - A representing a system-defined color. - - - Gets a system-defined color that has an ARGB value of #FF6495ED. - A representing a system-defined color. - - - Gets a system-defined color that has an ARGB value of #FFFFF8DC. - A representing a system-defined color. - - - Gets a system-defined color that has an ARGB value of #FFDC143C. - A representing a system-defined color. - - - Gets a system-defined color that has an ARGB value of #FF00FFFF. - A representing a system-defined color. - - - Gets a system-defined color that has an ARGB value of #FF00008B. - A representing a system-defined color. - - - Gets a system-defined color that has an ARGB value of #FF008B8B. - A representing a system-defined color. - - - Gets a system-defined color that has an ARGB value of #FFB8860B. - A representing a system-defined color. - - - Gets a system-defined color that has an ARGB value of #FFA9A9A9. - A representing a system-defined color. - - - Gets a system-defined color that has an ARGB value of #FF006400. - A representing a system-defined color. - - - Gets a system-defined color that has an ARGB value of #FFBDB76B. - A representing a system-defined color. - - - Gets a system-defined color that has an ARGB value of #FF8B008B. - A representing a system-defined color. - - - Gets a system-defined color that has an ARGB value of #FF556B2F. - A representing a system-defined color. - - - Gets a system-defined color that has an ARGB value of #FFFF8C00. - A representing a system-defined color. - - - Gets a system-defined color that has an ARGB value of #FF9932CC. - A representing a system-defined color. - - - Gets a system-defined color that has an ARGB value of #FF8B0000. - A representing a system-defined color. - - - Gets a system-defined color that has an ARGB value of #FFE9967A. - A representing a system-defined color. - - - Gets a system-defined color that has an ARGB value of #FF8FBC8F. - A representing a system-defined color. - - - Gets a system-defined color that has an ARGB value of #FF483D8B. - A representing a system-defined color. - - - Gets a system-defined color that has an ARGB value of #FF2F4F4F. - A representing a system-defined color. - - - Gets a system-defined color that has an ARGB value of #FF00CED1. - A representing a system-defined color. - - - Gets a system-defined color that has an ARGB value of #FF9400D3. - A representing a system-defined color. - - - Gets a system-defined color that has an ARGB value of #FFFF1493. - A representing a system-defined color. - - - Gets a system-defined color that has an ARGB value of #FF00BFFF. - A representing a system-defined color. - - - Gets a system-defined color that has an ARGB value of #FF696969. - A representing a system-defined color. - - - Gets a system-defined color that has an ARGB value of #FF1E90FF. - A representing a system-defined color. - - - Represents a color that is null. - - - - Tests whether the specified object is a structure and is equivalent to this structure. - The object to test. - true if obj is a structure equivalent to this structure; otherwise, false. - - - Gets a system-defined color that has an ARGB value of #FFB22222. - A representing a system-defined color. - - - Gets a system-defined color that has an ARGB value of #FFFFFAF0. - A representing a system-defined color. - - - Gets a system-defined color that has an ARGB value of #FF228B22. - A representing a system-defined color. - - - Creates a structure from the four ARGB component (alpha, red, green, and blue) values. Although this method allows a 32-bit value to be passed for each component, the value of each component is limited to 8 bits. - The alpha component. Valid values are 0 through 255. - The red component. Valid values are 0 through 255. - The green component. Valid values are 0 through 255. - The blue component. Valid values are 0 through 255. - The that this method creates. - alpha, red, green, or blue is less than 0 or greater than 255. - - - Creates a structure from the specified 8-bit color values (red, green, and blue). The alpha value is implicitly 255 (fully opaque). Although this method allows a 32-bit value to be passed for each color component, the value of each component is limited to 8 bits. - The red component value for the new . Valid values are 0 through 255. - The green component value for the new . Valid values are 0 through 255. - The blue component value for the new . Valid values are 0 through 255. - The that this method creates. - red, green, or blue is less than 0 or greater than 255. - - - Creates a structure from the specified structure, but with the new specified alpha value. Although this method allows a 32-bit value to be passed for the alpha value, the value is limited to 8 bits. - The alpha value for the new . Valid values are 0 through 255. - The from which to create the new . - The that this method creates. - alpha is less than 0 or greater than 255. - - - Creates a structure from a 32-bit ARGB value. - A value specifying the 32-bit ARGB value. - The structure that this method creates. - - - Creates a structure from the specified predefined color. - An element of the enumeration. - The that this method creates. - - - Creates a structure from the specified name of a predefined color. - A string that is the name of a predefined color. Valid names are the same as the names of the elements of the enumeration. - The that this method creates. - - - Gets a system-defined color that has an ARGB value of #FFFF00FF. - A representing a system-defined color. - - - Gets the green component value of this structure. - The green component value of this . - - - Gets a system-defined color that has an ARGB value of #FFDCDCDC. - A representing a system-defined color. - - - Gets the hue-saturation-brightness (HSB) brightness value for this structure. - The brightness of this . The brightness ranges from 0.0 through 1.0, where 0.0 represents black and 1.0 represents white. - - - Returns a hash code for this structure. - An integer value that specifies the hash code for this . - - - Gets the hue-saturation-brightness (HSB) hue value, in degrees, for this structure. - The hue, in degrees, of this . The hue is measured in degrees, ranging from 0.0 through 360.0, in HSB color space. - - - Gets the hue-saturation-brightness (HSB) saturation value for this structure. - The saturation of this . The saturation ranges from 0.0 through 1.0, where 0.0 is grayscale and 1.0 is the most saturated. - - - Gets a system-defined color that has an ARGB value of #FFF8F8FF. - A representing a system-defined color. - - - Gets a system-defined color that has an ARGB value of #FFFFD700. - A representing a system-defined color. - - - Gets a system-defined color that has an ARGB value of #FFDAA520. - A representing a system-defined color. - - - Gets a system-defined color that has an ARGB value of #FF808080. - A strcture representing a system-defined color. - - - Gets a system-defined color that has an ARGB value of #FF008000. - A representing a system-defined color. - - - Gets a system-defined color that has an ARGB value of #FFADFF2F. - A representing a system-defined color. - - - Gets a system-defined color that has an ARGB value of #FFF0FFF0. - A representing a system-defined color. - - - Gets a system-defined color that has an ARGB value of #FFFF69B4. - A representing a system-defined color. - - - Gets a system-defined color that has an ARGB value of #FFCD5C5C. - A representing a system-defined color. - - - Gets a system-defined color that has an ARGB value of #FF4B0082. - A representing a system-defined color. - - - Specifies whether this structure is uninitialized. - This property returns true if this color is uninitialized; otherwise, false. - - - Gets a value indicating whether this structure is a predefined color. Predefined colors are represented by the elements of the enumeration. - true if this was created from a predefined color by using either the method or the method; otherwise, false. - - - Gets a value indicating whether this structure is a named color or a member of the enumeration. - true if this was created by using either the method or the method; otherwise, false. - - - Gets a value indicating whether this structure is a system color. A system color is a color that is used in a Windows display element. System colors are represented by elements of the enumeration. - true if this was created from a system color by using either the method or the method; otherwise, false. - - - Gets a system-defined color that has an ARGB value of #FFFFFFF0. - A representing a system-defined color. - - - Gets a system-defined color that has an ARGB value of #FFF0E68C. - A representing a system-defined color. - - - Gets a system-defined color that has an ARGB value of #FFE6E6FA. - A representing a system-defined color. - - - Gets a system-defined color that has an ARGB value of #FFFFF0F5. - A representing a system-defined color. - - - Gets a system-defined color that has an ARGB value of #FF7CFC00. - A representing a system-defined color. - - - Gets a system-defined color that has an ARGB value of #FFFFFACD. - A representing a system-defined color. - - - Gets a system-defined color that has an ARGB value of #FFADD8E6. - A representing a system-defined color. - - - Gets a system-defined color that has an ARGB value of #FFF08080. - A representing a system-defined color. - - - Gets a system-defined color that has an ARGB value of #FFE0FFFF. - A representing a system-defined color. - - - Gets a system-defined color that has an ARGB value of #FFFAFAD2. - A representing a system-defined color. - - - Gets a system-defined color that has an ARGB value of #FFD3D3D3. - A representing a system-defined color. - - - Gets a system-defined color that has an ARGB value of #FF90EE90. - A representing a system-defined color. - - - Gets a system-defined color that has an ARGB value of #FFFFB6C1. - A representing a system-defined color. - - - Gets a system-defined color that has an ARGB value of #FFFFA07A. - A representing a system-defined color. - - - Gets a system-defined color that has an ARGB value of #FF20B2AA. - A representing a system-defined color. - - - Gets a system-defined color that has an ARGB value of #FF87CEFA. - A representing a system-defined color. - - - Gets a system-defined color that has an ARGB value of #FF778899. - A representing a system-defined color. - - - Gets a system-defined color that has an ARGB value of #FFB0C4DE. - A representing a system-defined color. - - - Gets a system-defined color that has an ARGB value of #FFFFFFE0. - A representing a system-defined color. - - - Gets a system-defined color that has an ARGB value of #FF00FF00. - A representing a system-defined color. - - - Gets a system-defined color that has an ARGB value of #FF32CD32. - A representing a system-defined color. - - - Gets a system-defined color that has an ARGB value of #FFFAF0E6. - A representing a system-defined color. - - - Gets a system-defined color that has an ARGB value of #FFFF00FF. - A representing a system-defined color. - - - Gets a system-defined color that has an ARGB value of #FF800000. - A representing a system-defined color. - - - Gets a system-defined color that has an ARGB value of #FF66CDAA. - A representing a system-defined color. - - - Gets a system-defined color that has an ARGB value of #FF0000CD. - A representing a system-defined color. - - - Gets a system-defined color that has an ARGB value of #FFBA55D3. - A representing a system-defined color. - - - Gets a system-defined color that has an ARGB value of #FF9370DB. - A representing a system-defined color. - - - Gets a system-defined color that has an ARGB value of #FF3CB371. - A representing a system-defined color. - - - Gets a system-defined color that has an ARGB value of #FF7B68EE. - A representing a system-defined color. - - - Gets a system-defined color that has an ARGB value of #FF00FA9A. - A representing a system-defined color. - - - Gets a system-defined color that has an ARGB value of #FF48D1CC. - A representing a system-defined color. - - - Gets a system-defined color that has an ARGB value of #FFC71585. - A representing a system-defined color. - - - Gets a system-defined color that has an ARGB value of #FF191970. - A representing a system-defined color. - - - Gets a system-defined color that has an ARGB value of #FFF5FFFA. - A representing a system-defined color. - - - Gets a system-defined color that has an ARGB value of #FFFFE4E1. - A representing a system-defined color. - - - Gets a system-defined color that has an ARGB value of #FFFFE4B5. - A representing a system-defined color. - - - Gets the name of this . - The name of this . - - - Gets a system-defined color that has an ARGB value of #FFFFDEAD. - A representing a system-defined color. - - - Gets a system-defined color that has an ARGB value of #FF000080. - A representing a system-defined color. - - - Gets a system-defined color that has an ARGB value of #FFFDF5E6. - A representing a system-defined color. - - - Gets a system-defined color that has an ARGB value of #FF808000. - A representing a system-defined color. - - - Gets a system-defined color that has an ARGB value of #FF6B8E23. - A representing a system-defined color. - - - Tests whether two specified structures are equivalent. - The that is to the left of the equality operator. - The that is to the right of the equality operator. - true if the two structures are equal; otherwise, false. - - - Tests whether two specified structures are different. - The that is to the left of the inequality operator. - The that is to the right of the inequality operator. - true if the two structures are different; otherwise, false. - - - Gets a system-defined color that has an ARGB value of #FFFFA500. - A representing a system-defined color. - - - Gets a system-defined color that has an ARGB value of #FFFF4500. - A representing a system-defined color. - - - Gets a system-defined color that has an ARGB value of #FFDA70D6. - A representing a system-defined color. - - - Gets a system-defined color that has an ARGB value of #FFEEE8AA. - A representing a system-defined color. - - - Gets a system-defined color that has an ARGB value of #FF98FB98. - A representing a system-defined color. - - - Gets a system-defined color that has an ARGB value of #FFAFEEEE. - A representing a system-defined color. - - - Gets a system-defined color that has an ARGB value of #FFDB7093. - A representing a system-defined color. - - - Gets a system-defined color that has an ARGB value of #FFFFEFD5. - A representing a system-defined color. - - - Gets a system-defined color that has an ARGB value of #FFFFDAB9. - A representing a system-defined color. - - - Gets a system-defined color that has an ARGB value of #FFCD853F. - A representing a system-defined color. - - - Gets a system-defined color that has an ARGB value of #FFFFC0CB. - A representing a system-defined color. - - - Gets a system-defined color that has an ARGB value of #FFDDA0DD. - A representing a system-defined color. - - - Gets a system-defined color that has an ARGB value of #FFB0E0E6. - A representing a system-defined color. - - - Gets a system-defined color that has an ARGB value of #FF800080. - A representing a system-defined color. - - - Gets the red component value of this structure. - The red component value of this . - - - Gets a system-defined color that has an ARGB value of #FFFF0000. - A representing a system-defined color. - - - Gets a system-defined color that has an ARGB value of #FFBC8F8F. - A representing a system-defined color. - - - Gets a system-defined color that has an ARGB value of #FF4169E1. - A representing a system-defined color. - - - Gets a system-defined color that has an ARGB value of #FF8B4513. - A representing a system-defined color. - - - Gets a system-defined color that has an ARGB value of #FFFA8072. - A representing a system-defined color. - - - Gets a system-defined color that has an ARGB value of #FFF4A460. - A representing a system-defined color. - - - Gets a system-defined color that has an ARGB value of #FF2E8B57. - A representing a system-defined color. - - - Gets a system-defined color that has an ARGB value of #FFFFF5EE. - A representing a system-defined color. - - - Gets a system-defined color that has an ARGB value of #FFA0522D. - A representing a system-defined color. - - - Gets a system-defined color that has an ARGB value of #FFC0C0C0. - A representing a system-defined color. - - - Gets a system-defined color that has an ARGB value of #FF87CEEB. - A representing a system-defined color. - - - Gets a system-defined color that has an ARGB value of #FF6A5ACD. - A representing a system-defined color. - - - Gets a system-defined color that has an ARGB value of #FF708090. - A representing a system-defined color. - - - Gets a system-defined color that has an ARGB value of #FFFFFAFA. - A representing a system-defined color. - - - Gets a system-defined color that has an ARGB value of #FF00FF7F. - A representing a system-defined color. - - - Gets a system-defined color that has an ARGB value of #FF4682B4. - A representing a system-defined color. - - - Gets a system-defined color that has an ARGB value of #FFD2B48C. - A representing a system-defined color. - - - Gets a system-defined color that has an ARGB value of #FF008080. - A representing a system-defined color. - - - Gets a system-defined color that has an ARGB value of #FFD8BFD8. - A representing a system-defined color. - - - Gets the 32-bit ARGB value of this structure. - The 32-bit ARGB value of this . - - - Gets the value of this structure. - An element of the enumeration, if the is created from a predefined color by using either the method or the method; otherwise, 0. - - - Gets a system-defined color that has an ARGB value of #FFFF6347. - A representing a system-defined color. - - - Converts this structure to a human-readable string. - A string that is the name of this , if the is created from a predefined color by using either the method or the method; otherwise, a string that consists of the ARGB component names and their values. - - - Gets a system-defined color. - A representing a system-defined color. - - - Gets a system-defined color that has an ARGB value of #FF40E0D0. - A representing a system-defined color. - - - Gets a system-defined color that has an ARGB value of #FFEE82EE. - A representing a system-defined color. - - - Gets a system-defined color that has an ARGB value of #FFF5DEB3. - A representing a system-defined color. - - - Gets a system-defined color that has an ARGB value of #FFFFFFFF. - A representing a system-defined color. - - - Gets a system-defined color that has an ARGB value of #FFF5F5F5. - A representing a system-defined color. - - - Gets a system-defined color that has an ARGB value of #FFFFFF00. - A representing a system-defined color. - - - Gets a system-defined color that has an ARGB value of #FF9ACD32. - A representing a system-defined color. - - - Defines a generalized type-specific comparison method that a value type or class implements to order or sort its instances. - - - Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object. - An object to compare with this instance. -

A value that indicates the relative order of the objects being compared. The return value has these meanings:

-
Value

-

Meaning

-

Less than zero

-

This instance precedes obj in the sort order.

-

Zero

-

This instance occurs in the same position in the sort order as obj.

-

Greater than zero

-

This instance follows obj in the sort order.

-

-
- obj is not the same type as this instance. -
- - Defines methods that convert the value of the implementing reference or value type to a common language runtime type that has an equivalent value. - - - Returns the for this instance. - The enumerated constant that is the of the class or value type that implements this interface. - - - Converts the value of this instance to an equivalent Boolean value using the specified culture-specific formatting information. - An interface implementation that supplies culture-specific formatting information. - A Boolean value equivalent to the value of this instance. - - - Converts the value of this instance to an equivalent 8-bit unsigned integer using the specified culture-specific formatting information. - An interface implementation that supplies culture-specific formatting information. - An 8-bit unsigned integer equivalent to the value of this instance. - - - Converts the value of this instance to an equivalent Unicode character using the specified culture-specific formatting information. - An interface implementation that supplies culture-specific formatting information. - A Unicode character equivalent to the value of this instance. - - - Converts the value of this instance to an equivalent using the specified culture-specific formatting information. - An interface implementation that supplies culture-specific formatting information. - A instance equivalent to the value of this instance. - - - Converts the value of this instance to an equivalent number using the specified culture-specific formatting information. - An interface implementation that supplies culture-specific formatting information. - A number equivalent to the value of this instance. - - - Converts the value of this instance to an equivalent double-precision floating-point number using the specified culture-specific formatting information. - An interface implementation that supplies culture-specific formatting information. - A double-precision floating-point number equivalent to the value of this instance. - - - Converts the value of this instance to an equivalent 16-bit signed integer using the specified culture-specific formatting information. - An interface implementation that supplies culture-specific formatting information. - An 16-bit signed integer equivalent to the value of this instance. - - - Converts the value of this instance to an equivalent 32-bit signed integer using the specified culture-specific formatting information. - An interface implementation that supplies culture-specific formatting information. - An 32-bit signed integer equivalent to the value of this instance. - - - Converts the value of this instance to an equivalent 64-bit signed integer using the specified culture-specific formatting information. - An interface implementation that supplies culture-specific formatting information. - An 64-bit signed integer equivalent to the value of this instance. - - - Converts the value of this instance to an equivalent 8-bit signed integer using the specified culture-specific formatting information. - An interface implementation that supplies culture-specific formatting information. - An 8-bit signed integer equivalent to the value of this instance. - - - Converts the value of this instance to an equivalent single-precision floating-point number using the specified culture-specific formatting information. - An interface implementation that supplies culture-specific formatting information. - A single-precision floating-point number equivalent to the value of this instance. - - - Converts the value of this instance to an equivalent using the specified culture-specific formatting information. - An interface implementation that supplies culture-specific formatting information. - A instance equivalent to the value of this instance. - - - Converts the value of this instance to an of the specified that has an equivalent value, using the specified culture-specific formatting information. - The to which the value of this instance is converted. - An interface implementation that supplies culture-specific formatting information. - An instance of type conversionType whose value is equivalent to the value of this instance. - - - Converts the value of this instance to an equivalent 16-bit unsigned integer using the specified culture-specific formatting information. - An interface implementation that supplies culture-specific formatting information. - An 16-bit unsigned integer equivalent to the value of this instance. - - - Converts the value of this instance to an equivalent 32-bit unsigned integer using the specified culture-specific formatting information. - An interface implementation that supplies culture-specific formatting information. - An 32-bit unsigned integer equivalent to the value of this instance. - - - Converts the value of this instance to an equivalent 64-bit unsigned integer using the specified culture-specific formatting information. - An interface implementation that supplies culture-specific formatting information. - An 64-bit unsigned integer equivalent to the value of this instance. - - - Defines a method that supports custom formatting of the value of an object. - - - Converts the value of a specified object to an equivalent string representation using specified format and culture-specific formatting information. - A format string containing formatting specifications. - An object to format. - An object that supplies format information about the current instance. - The string representation of the value of arg, formatted as specified by format and formatProvider. - - - Defines a provider for progress updates. - The type of progress update value. - - - Reports a progress update. - The value of the updated progress. - - - Defines a mechanism for retrieving a service object; that is, an object that provides custom support to other objects. - - - Gets the service object of the specified type. - An object that specifies the type of service object to get. - A service object of type serviceType. -or- null if there is no service object of type serviceType. - - - Provides support for lazy initialization. - The type of object that is being lazily initialized. - - - Initializes a new instance of the class. When lazy initialization occurs, the default constructor of the target type is used. - - - Initializes a new instance of the class. When lazy initialization occurs, the default constructor of the target type and the specified initialization mode are used. - true to make this instance usable concurrently by multiple threads; false to make the instance usable by only one thread at a time. - - - Initializes a new instance of the class. When lazy initialization occurs, the specified initialization function is used. - The delegate that is invoked to produce the lazily initialized value when it is needed. - valueFactory is null. - - - Initializes a new instance of the class that uses the default constructor of T and the specified thread-safety mode. - One of the enumeration values that specifies the thread safety mode. - mode contains an invalid value. - - - Initializes a new instance of the class. When lazy initialization occurs, the specified initialization function and initialization mode are used. - The delegate that is invoked to produce the lazily initialized value when it is needed. - true to make this instance usable concurrently by multiple threads; false to make this instance usable by only one thread at a time. - valueFactory is null. - - - Initializes a new instance of the class that uses the specified initialization function and thread-safety mode. - The delegate that is invoked to produce the lazily initialized value when it is needed. - One of the enumeration values that specifies the thread safety mode. - mode contains an invalid value. - valueFactory is null. - - - Gets a value that indicates whether a value has been created for this instance. - true if a value has been created for this instance; otherwise, false. - - - Creates and returns a string representation of the property for this instance. - The result of calling the method on the property for this instance, if the value has been created (that is, if the property returns true). Otherwise, a string indicating that the value has not been created. - The property is null. - - - Gets the lazily initialized value of the current instance. - The lazily initialized value of the current instance. - The instance is initialized to use the default constructor of the type that is being lazily initialized, and permissions to access the constructor are missing. - The instance is initialized to use the default constructor of the type that is being lazily initialized, and that type does not have a public, parameterless constructor. - The initialization function tries to access on this instance. - - - Provides a lazy indirect reference to an object and its associated metadata for use by the Managed Extensibility Framework. - The type of the object referenced. - The type of the metadata. - - - Initializes a new instance of the class with the specified metadata. - The metadata associated with the referenced object. - - - Initializes a new instance of the class with the specified metadata that uses the specified function to get the referenced object. - A function that returns the referenced object. - The metadata associated with the referenced object. - - - Initializes a new instance of the class with the specified metadata and thread safety value. - The metadata associated with the referenced object. - Indicates whether the object that is created will be thread-safe. - - - Initializes a new instance of the class with the specified metadata and thread synchronization mode. - The metadata associated with the referenced object. - The thread synchronization mode. - - - Initializes a new instance of the class with the specified metadata and thread safety value that uses the specified function to get the referenced object. - A function that returns the referenced object. - The metadata associated with the referenced object. - Indicates whether the object that is created will be thread-safe. - - - Initializes a new instance of the class with the specified metadata and thread synchronization mode that uses the specified function to get the referenced object. - A function that returns the referenced object - The metadata associated with the referenced object. - The thread synchronization mode - - - Gets the metadata associated with the referenced object. - The metadata associated with the referenced object. - - - A customizable parser based on the Lightweight Directory Access Protocol (LDAP) scheme. - - - Creates a customizable parser based on the Lightweight Directory Access Protocol (LDAP) scheme. - - - Provides a set of static (Shared in Visual Basic) methods for querying objects that implement . - - - Applies an accumulator function over a sequence. The specified seed value is used as the initial accumulator value, and the specified function is used to select the result value. - An to aggregate over. - The initial accumulator value. - An accumulator function to be invoked on each element. - A function to transform the final accumulator value into the result value. - The type of the elements of source. - The type of the accumulator value. - The type of the resulting value. - The transformed final accumulator value. - source or func or resultSelector is null. - - - Applies an accumulator function over a sequence. The specified seed value is used as the initial accumulator value. - An to aggregate over. - The initial accumulator value. - An accumulator function to be invoked on each element. - The type of the elements of source. - The type of the accumulator value. - The final accumulator value. - source or func is null. - - - Applies an accumulator function over a sequence. - An to aggregate over. - An accumulator function to be invoked on each element. - The type of the elements of source. - The final accumulator value. - source or func is null. - source contains no elements. - - - Determines whether all elements of a sequence satisfy a condition. - An that contains the elements to apply the predicate to. - A function to test each element for a condition. - The type of the elements of source. - true if every element of the source sequence passes the test in the specified predicate, or if the sequence is empty; otherwise, false. - source or predicate is null. - - - Determines whether a sequence contains any elements. - The to check for emptiness. - The type of the elements of source. - true if the source sequence contains any elements; otherwise, false. - source is null. - - - Determines whether any element of a sequence satisfies a condition. - An whose elements to apply the predicate to. - A function to test each element for a condition. - The type of the elements of source. - true if any elements in the source sequence pass the test in the specified predicate; otherwise, false. - source or predicate is null. - - - - - - - - - Returns the input typed as . - The sequence to type as . - The type of the elements of source. - The input sequence typed as . - - - Computes the average of a sequence of values. - A sequence of values to calculate the average of. - The average of the sequence of values. - source is null. - source contains no elements. - - - Computes the average of a sequence of nullable values. - A sequence of nullable values to calculate the average of. - The average of the sequence of values, or null if the source sequence is empty or contains only values that are null. - source is null. - - - Computes the average of a sequence of nullable values. - A sequence of nullable values to calculate the average of. - The average of the sequence of values, or null if the source sequence is empty or contains only values that are null. - source is null. - The sum of the elements in the sequence is larger than . - - - Computes the average of a sequence of nullable values. - A sequence of nullable values to calculate the average of. - The average of the sequence of values, or null if the source sequence is empty or contains only values that are null. - source is null. - The sum of the elements in the sequence is larger than . - - - Computes the average of a sequence of nullable values. - A sequence of nullable values to calculate the average of. - The average of the sequence of values, or null if the source sequence is empty or contains only values that are null. - source is null. - - - Computes the average of a sequence of values. - A sequence of values to calculate the average of. - The average of the sequence of values. - source is null. - source contains no elements. - - - Computes the average of a sequence of values. - A sequence of values to calculate the average of. - The average of the sequence of values. - source is null. - source contains no elements. - - - Computes the average of a sequence of values. - A sequence of values to calculate the average of. - The average of the sequence of values. - source is null. - source contains no elements. - - - Computes the average of a sequence of values. - A sequence of values to calculate the average of. - The average of the sequence of values. - source is null. - source contains no elements. - - - Computes the average of a sequence of nullable values. - A sequence of nullable values to calculate the average of. - The average of the sequence of values, or null if the source sequence is empty or contains only values that are null. - source is null. - The sum of the elements in the sequence is larger than . - - - Computes the average of a sequence of nullable values that are obtained by invoking a transform function on each element of the input sequence. - A sequence of values to calculate the average of. - A transform function to apply to each element. - The type of the elements of source. - The average of the sequence of values, or null if the source sequence is empty or contains only values that are null. - source or selector is null. - The sum of the elements in the sequence is larger than . - - - Computes the average of a sequence of values that are obtained by invoking a transform function on each element of the input sequence. - A sequence of values to calculate the average of. - A transform function to apply to each element. - The type of the elements of source. - The average of the sequence of values. - source or selector is null. - source contains no elements. - - - Computes the average of a sequence of nullable values that are obtained by invoking a transform function on each element of the input sequence. - A sequence of values to calculate the average of. - A transform function to apply to each element. - The type of the elements of source. - The average of the sequence of values, or null if the source sequence is empty or contains only values that are null. - source or selector is null. - - - Computes the average of a sequence of nullable values that are obtained by invoking a transform function on each element of the input sequence. - A sequence of values to calculate the average of. - A transform function to apply to each element. - The type of the elements of source. - The average of the sequence of values, or null if the source sequence is empty or contains only values that are null. - - - Computes the average of a sequence of nullable values that are obtained by invoking a transform function on each element of the input sequence. - A sequence of values to calculate the average of. - A transform function to apply to each element. - The type of the elements of source. - The average of the sequence of values, or null if the source sequence is empty or contains only values that are null. - source or selector is null. - - - Computes the average of a sequence of nullable values that are obtained by invoking a transform function on each element of the input sequence. - A sequence of values to calculate the average of. - A transform function to apply to each element. - The type of the elements of source. - The average of the sequence of values, or null if the source sequence is empty or contains only values that are null. - source or selector is null. - The sum of the elements in the sequence is larger than . - - - Computes the average of a sequence of values that are obtained by invoking a transform function on each element of the input sequence. - A sequence of values to calculate the average of. - A transform function to apply to each element. - The type of the elements of source. - The average of the sequence of values. - source or selector is null. - source contains no elements. - The sum of the elements in the sequence is larger than . - - - Computes the average of a sequence of values that are obtained by invoking a transform function on each element of the input sequence. - A sequence of values to calculate the average of. - A transform function to apply to each element. - The type of the elements of source. - The average of the sequence of values. - source or selector is null. - source contains no elements. - The sum of the elements in the sequence is larger than . - - - Computes the average of a sequence of values that are obtained by invoking a transform function on each element of the input sequence. - A sequence of values to calculate the average of. - A transform function to apply to each element. - The type of the elements of source. - The average of the sequence of values. - source or selector is null. - source contains no elements. - - - Computes the average of a sequence of values that are obtained by invoking a transform function on each element of the input sequence. - A sequence of values that are used to calculate an average. - A transform function to apply to each element. - The type of the elements of source. - The average of the sequence of values. - source or selector is null. - source contains no elements. - The sum of the elements in the sequence is larger than . - - - Casts the elements of an to the specified type. - The that contains the elements to be cast to type TResult. - The type to cast the elements of source to. - An that contains each element of the source sequence cast to the specified type. - source is null. - An element in the sequence cannot be cast to type TResult. - - - Concatenates two sequences. - The first sequence to concatenate. - The sequence to concatenate to the first sequence. - The type of the elements of the input sequences. - An that contains the concatenated elements of the two input sequences. - first or second is null. - - - Determines whether a sequence contains a specified element by using the default equality comparer. - A sequence in which to locate a value. - The value to locate in the sequence. - The type of the elements of source. - true if the source sequence contains an element that has the specified value; otherwise, false. - source is null. - - - Determines whether a sequence contains a specified element by using a specified . - A sequence in which to locate a value. - The value to locate in the sequence. - An equality comparer to compare values. - The type of the elements of source. - true if the source sequence contains an element that has the specified value; otherwise, false. - source is null. - - - Returns the number of elements in a sequence. - A sequence that contains elements to be counted. - The type of the elements of source. - The number of elements in the input sequence. - source is null. - The number of elements in source is larger than . - - - Returns a number that represents how many elements in the specified sequence satisfy a condition. - A sequence that contains elements to be tested and counted. - A function to test each element for a condition. - The type of the elements of source. - A number that represents how many elements in the sequence satisfy the condition in the predicate function. - source or predicate is null. - The number of elements in source is larger than . - - - Returns the elements of the specified sequence or the specified value in a singleton collection if the sequence is empty. - The sequence to return the specified value for if it is empty. - The value to return if the sequence is empty. - The type of the elements of source. - An that contains defaultValue if source is empty; otherwise, source. - - - Returns the elements of the specified sequence or the type parameter's default value in a singleton collection if the sequence is empty. - The sequence to return a default value for if it is empty. - The type of the elements of source. - An object that contains the default value for the TSource type if source is empty; otherwise, source. - source is null. - - - Returns distinct elements from a sequence by using the default equality comparer to compare values. - The sequence to remove duplicate elements from. - The type of the elements of source. - An that contains distinct elements from the source sequence. - source is null. - - - Returns distinct elements from a sequence by using a specified to compare values. - The sequence to remove duplicate elements from. - An to compare values. - The type of the elements of source. - An that contains distinct elements from the source sequence. - source is null. - - - Returns the element at a specified index in a sequence. - An to return an element from. - The zero-based index of the element to retrieve. - The type of the elements of source. - The element at the specified position in the source sequence. - source is null. - index is less than 0 or greater than or equal to the number of elements in source. - - - Returns the element at a specified index in a sequence or a default value if the index is out of range. - An to return an element from. - The zero-based index of the element to retrieve. - The type of the elements of source. - default(TSource) if the index is outside the bounds of the source sequence; otherwise, the element at the specified position in the source sequence. - source is null. - - - Returns an empty that has the specified type argument. - The type to assign to the type parameter of the returned generic . - An empty whose type argument is TResult. - - - Produces the set difference of two sequences by using the default equality comparer to compare values. - An whose elements that are not also in second will be returned. - An whose elements that also occur in the first sequence will cause those elements to be removed from the returned sequence. - The type of the elements of the input sequences. - A sequence that contains the set difference of the elements of two sequences. - first or second is null. - - - Produces the set difference of two sequences by using the specified to compare values. - An whose elements that are not also in second will be returned. - An whose elements that also occur in the first sequence will cause those elements to be removed from the returned sequence. - An to compare values. - The type of the elements of the input sequences. - A sequence that contains the set difference of the elements of two sequences. - first or second is null. - - - Returns the first element of a sequence. - The to return the first element of. - The type of the elements of source. - The first element in the specified sequence. - source is null. - The source sequence is empty. - - - Returns the first element in a sequence that satisfies a specified condition. - An to return an element from. - A function to test each element for a condition. - The type of the elements of source. - The first element in the sequence that passes the test in the specified predicate function. - source or predicate is null. - No element satisfies the condition in predicate. -or- The source sequence is empty. - - - Returns the first element of the sequence that satisfies a condition or a default value if no such element is found. - An to return an element from. - A function to test each element for a condition. - The type of the elements of source. - default(TSource) if source is empty or if no element passes the test specified by predicate; otherwise, the first element in source that passes the test specified by predicate. - source or predicate is null. - - - Returns the first element of a sequence, or a default value if the sequence contains no elements. - The to return the first element of. - The type of the elements of source. - default(TSource) if source is empty; otherwise, the first element in source. - source is null. - - - Groups the elements of a sequence according to a specified key selector function and creates a result value from each group and its key. The elements of each group are projected by using a specified function. - An whose elements to group. - A function to extract the key for each element. - A function to map each source element to an element in an . - A function to create a result value from each group. - The type of the elements of source. - The type of the key returned by keySelector. - The type of the elements in each . - The type of the result value returned by resultSelector. - A collection of elements of type TResult where each element represents a projection over a group and its key. - - - Groups the elements of a sequence according to a specified key selector function and creates a result value from each group and its key. Key values are compared by using a specified comparer, and the elements of each group are projected by using a specified function. - An whose elements to group. - A function to extract the key for each element. - A function to map each source element to an element in an . - A function to create a result value from each group. - An to compare keys with. - The type of the elements of source. - The type of the key returned by keySelector. - The type of the elements in each . - The type of the result value returned by resultSelector. - A collection of elements of type TResult where each element represents a projection over a group and its key. - - - Groups the elements of a sequence according to a specified key selector function and projects the elements for each group by using a specified function. - An whose elements to group. - A function to extract the key for each element. - A function to map each source element to an element in the . - The type of the elements of source. - The type of the key returned by keySelector. - The type of the elements in the . -

An IEnumerable<><_tkey2c_ telement="">> in C# or IEnumerable(Of IGrouping(Of TKey, TElement)) in Visual Basic where each object contains a collection of objects of type TElement and a key.

-
- source or keySelector or elementSelector is null. -
- - Groups the elements of a sequence according to a key selector function. The keys are compared by using a comparer and each group's elements are projected by using a specified function. - An whose elements to group. - A function to extract the key for each element. - A function to map each source element to an element in an . - An to compare keys. - The type of the elements of source. - The type of the key returned by keySelector. - The type of the elements in the . -

An IEnumerable<><_tkey2c_ telement="">> in C# or IEnumerable(Of IGrouping(Of TKey, TElement)) in Visual Basic where each object contains a collection of objects of type TElement and a key.

-
- source or keySelector or elementSelector is null. -
- - Groups the elements of a sequence according to a specified key selector function and creates a result value from each group and its key. - An whose elements to group. - A function to extract the key for each element. - A function to create a result value from each group. - The type of the elements of source. - The type of the key returned by keySelector. - The type of the result value returned by resultSelector. - A collection of elements of type TResult where each element represents a projection over a group and its key. - - - Groups the elements of a sequence according to a specified key selector function and creates a result value from each group and its key. The keys are compared by using a specified comparer. - An whose elements to group. - A function to extract the key for each element. - A function to create a result value from each group. - An to compare keys with. - The type of the elements of source. - The type of the key returned by keySelector. - The type of the result value returned by resultSelector. - A collection of elements of type TResult where each element represents a projection over a group and its key. - - - Groups the elements of a sequence according to a specified key selector function. - An whose elements to group. - A function to extract the key for each element. - The type of the elements of source. - The type of the key returned by keySelector. -

An IEnumerable<><_tkey2c_ tsource="">> in C# or IEnumerable(Of IGrouping(Of TKey, TSource)) in Visual Basic where each object contains a sequence of objects and a key.

-
- source or keySelector is null. -
- - Groups the elements of a sequence according to a specified key selector function and compares the keys by using a specified comparer. - An whose elements to group. - A function to extract the key for each element. - An to compare keys. - The type of the elements of source. - The type of the key returned by keySelector. -

An IEnumerable<><_tkey2c_ tsource="">> in C# or IEnumerable(Of IGrouping(Of TKey, TSource)) in Visual Basic where each object contains a collection of objects and a key.

-
- source or keySelector is null. -
- - Correlates the elements of two sequences based on key equality and groups the results. A specified is used to compare keys. - The first sequence to join. - The sequence to join to the first sequence. - A function to extract the join key from each element of the first sequence. - A function to extract the join key from each element of the second sequence. - A function to create a result element from an element from the first sequence and a collection of matching elements from the second sequence. - An to hash and compare keys. - The type of the elements of the first sequence. - The type of the elements of the second sequence. - The type of the keys returned by the key selector functions. - The type of the result elements. - An that contains elements of type TResult that are obtained by performing a grouped join on two sequences. - outer or inner or outerKeySelector or innerKeySelector or resultSelector is null. - - - Correlates the elements of two sequences based on equality of keys and groups the results. The default equality comparer is used to compare keys. - The first sequence to join. - The sequence to join to the first sequence. - A function to extract the join key from each element of the first sequence. - A function to extract the join key from each element of the second sequence. - A function to create a result element from an element from the first sequence and a collection of matching elements from the second sequence. - The type of the elements of the first sequence. - The type of the elements of the second sequence. - The type of the keys returned by the key selector functions. - The type of the result elements. - An that contains elements of type TResult that are obtained by performing a grouped join on two sequences. - outer or inner or outerKeySelector or innerKeySelector or resultSelector is null. - - - Produces the set intersection of two sequences by using the specified to compare values. - An whose distinct elements that also appear in second will be returned. - An whose distinct elements that also appear in the first sequence will be returned. - An to compare values. - The type of the elements of the input sequences. - A sequence that contains the elements that form the set intersection of two sequences. - first or second is null. - - - Produces the set intersection of two sequences by using the default equality comparer to compare values. - An whose distinct elements that also appear in second will be returned. - An whose distinct elements that also appear in the first sequence will be returned. - The type of the elements of the input sequences. - A sequence that contains the elements that form the set intersection of two sequences. - first or second is null. - - - Correlates the elements of two sequences based on matching keys. The default equality comparer is used to compare keys. - The first sequence to join. - The sequence to join to the first sequence. - A function to extract the join key from each element of the first sequence. - A function to extract the join key from each element of the second sequence. - A function to create a result element from two matching elements. - The type of the elements of the first sequence. - The type of the elements of the second sequence. - The type of the keys returned by the key selector functions. - The type of the result elements. - An that has elements of type TResult that are obtained by performing an inner join on two sequences. - outer or inner or outerKeySelector or innerKeySelector or resultSelector is null. - - - Correlates the elements of two sequences based on matching keys. A specified is used to compare keys. - The first sequence to join. - The sequence to join to the first sequence. - A function to extract the join key from each element of the first sequence. - A function to extract the join key from each element of the second sequence. - A function to create a result element from two matching elements. - An to hash and compare keys. - The type of the elements of the first sequence. - The type of the elements of the second sequence. - The type of the keys returned by the key selector functions. - The type of the result elements. - An that has elements of type TResult that are obtained by performing an inner join on two sequences. - outer or inner or outerKeySelector or innerKeySelector or resultSelector is null. - - - Returns the last element of a sequence. - An to return the last element of. - The type of the elements of source. - The value at the last position in the source sequence. - source is null. - The source sequence is empty. - - - Returns the last element of a sequence that satisfies a specified condition. - An to return an element from. - A function to test each element for a condition. - The type of the elements of source. - The last element in the sequence that passes the test in the specified predicate function. - source or predicate is null. - No element satisfies the condition in predicate. -or- The source sequence is empty. - - - Returns the last element of a sequence, or a default value if the sequence contains no elements. - An to return the last element of. - The type of the elements of source. - default(TSource) if the source sequence is empty; otherwise, the last element in the . - source is null. - - - Returns the last element of a sequence that satisfies a condition or a default value if no such element is found. - An to return an element from. - A function to test each element for a condition. - The type of the elements of source. - default(TSource) if the sequence is empty or if no elements pass the test in the predicate function; otherwise, the last element that passes the test in the predicate function. - source or predicate is null. - - - Returns an that represents how many elements in a sequence satisfy a condition. - An that contains the elements to be counted. - A function to test each element for a condition. - The type of the elements of source. - A number that represents how many elements in the sequence satisfy the condition in the predicate function. - source or predicate is null. - The number of matching elements exceeds . - - - Returns an that represents the total number of elements in a sequence. - An that contains the elements to be counted. - The type of the elements of source. - The number of elements in the source sequence. - source is null. - The number of elements exceeds . - - - Returns the maximum value in a sequence of nullable values. - A sequence of nullable values to determine the maximum value of. - A value of type Nullable in C# or Nullable(Of Single) in Visual Basic that corresponds to the maximum value in the sequence. - source is null. - - - Returns the maximum value in a sequence of values. - A sequence of values to determine the maximum value of. - The maximum value in the sequence. - source is null. - source contains no elements. - - - Returns the maximum value in a sequence of nullable values. - A sequence of nullable values to determine the maximum value of. - A value of type Nullable in C# or Nullable(Of Int64) in Visual Basic that corresponds to the maximum value in the sequence. - source is null. - - - Returns the maximum value in a sequence of values. - A sequence of values to determine the maximum value of. - The maximum value in the sequence. - source is null. - source contains no elements. - - - Returns the maximum value in a sequence of nullable values. - A sequence of nullable values to determine the maximum value of. - A value of type Nullable in C# or Nullable(Of Int32) in Visual Basic that corresponds to the maximum value in the sequence. - source is null. - - - Returns the maximum value in a sequence of values. - A sequence of values to determine the maximum value of. - The maximum value in the sequence. - source is null. - source contains no elements. - - - Returns the maximum value in a sequence of nullable values. - A sequence of nullable values to determine the maximum value of. - A value of type Nullable in C# or Nullable(Of Decimal) in Visual Basic that corresponds to the maximum value in the sequence. - source is null. - - - Returns the maximum value in a sequence of values. - A sequence of values to determine the maximum value of. - The maximum value in the sequence. - source is null. - source contains no elements. - - - Returns the maximum value in a sequence of values. - A sequence of values to determine the maximum value of. - The maximum value in the sequence. - source is null. - source contains no elements. - - - Returns the maximum value in a sequence of nullable values. - A sequence of nullable values to determine the maximum value of. - A value of type Nullable in C# or Nullable(Of Double) in Visual Basic that corresponds to the maximum value in the sequence. - source is null. - - - Invokes a transform function on each element of a generic sequence and returns the maximum resulting value. - A sequence of values to determine the maximum value of. - A transform function to apply to each element. - The type of the elements of source. - The type of the value returned by selector. - The maximum value in the sequence. - source or selector is null. - - - Invokes a transform function on each element of a sequence and returns the maximum value. - A sequence of values to determine the maximum value of. - A transform function to apply to each element. - The type of the elements of source. - The maximum value in the sequence. - source or selector is null. - source contains no elements. - - - Invokes a transform function on each element of a sequence and returns the maximum nullable value. - A sequence of values to determine the maximum value of. - A transform function to apply to each element. - The type of the elements of source. - The value of type Nullable in C# or Nullable(Of Single) in Visual Basic that corresponds to the maximum value in the sequence. - source or selector is null. - - - Invokes a transform function on each element of a sequence and returns the maximum nullable value. - A sequence of values to determine the maximum value of. - A transform function to apply to each element. - The type of the elements of source. - The value of type Nullable in C# or Nullable(Of Int64) in Visual Basic that corresponds to the maximum value in the sequence. - source or selector is null. - - - Invokes a transform function on each element of a sequence and returns the maximum nullable value. - A sequence of values to determine the maximum value of. - A transform function to apply to each element. - The type of the elements of source. - The value of type Nullable in C# or Nullable(Of Int32) in Visual Basic that corresponds to the maximum value in the sequence. - source or selector is null. - - - Invokes a transform function on each element of a sequence and returns the maximum nullable value. - A sequence of values to determine the maximum value of. - A transform function to apply to each element. - The type of the elements of source. - The value of type Nullable in C# or Nullable(Of Double) in Visual Basic that corresponds to the maximum value in the sequence. - source or selector is null. - - - Invokes a transform function on each element of a sequence and returns the maximum value. - A sequence of values to determine the maximum value of. - A transform function to apply to each element. - The type of the elements of source. - The maximum value in the sequence. - source or selector is null. - source contains no elements. - - - Invokes a transform function on each element of a sequence and returns the maximum value. - A sequence of values to determine the maximum value of. - A transform function to apply to each element. - The type of the elements of source. - The maximum value in the sequence. - source or selector is null. - source contains no elements. - - - Invokes a transform function on each element of a sequence and returns the maximum value. - A sequence of values to determine the maximum value of. - A transform function to apply to each element. - The type of the elements of source. - The maximum value in the sequence. - source or selector is null. - source contains no elements. - - - Invokes a transform function on each element of a sequence and returns the maximum value. - A sequence of values to determine the maximum value of. - A transform function to apply to each element. - The type of the elements of source. - The maximum value in the sequence. - source or selector is null. - source contains no elements. - - - Returns the maximum value in a generic sequence. - A sequence of values to determine the maximum value of. - The type of the elements of source. - The maximum value in the sequence. - source is null. - - - Invokes a transform function on each element of a sequence and returns the maximum nullable value. - A sequence of values to determine the maximum value of. - A transform function to apply to each element. - The type of the elements of source. - The value of type Nullable in C# or Nullable(Of Decimal) in Visual Basic that corresponds to the maximum value in the sequence. - source or selector is null. - - - Returns the minimum value in a sequence of nullable values. - A sequence of nullable values to determine the minimum value of. - A value of type Nullable in C# or Nullable(Of Int64) in Visual Basic that corresponds to the minimum value in the sequence. - source is null. - - - Returns the minimum value in a sequence of nullable values. - A sequence of nullable values to determine the minimum value of. - A value of type Nullable in C# or Nullable(Of Int32) in Visual Basic that corresponds to the minimum value in the sequence. - source is null. - - - Returns the minimum value in a sequence of values. - A sequence of values to determine the minimum value of. - The minimum value in the sequence. - source is null. - source contains no elements. - - - Returns the minimum value in a sequence of nullable values. - A sequence of nullable values to determine the minimum value of. - A value of type Nullable in C# or Nullable(Of Single) in Visual Basic that corresponds to the minimum value in the sequence. - source is null. - - - Returns the minimum value in a sequence of nullable values. - A sequence of nullable values to determine the minimum value of. - A value of type Nullable in C# or Nullable(Of Double) in Visual Basic that corresponds to the minimum value in the sequence. - source is null. - - - Returns the minimum value in a sequence of values. - A sequence of values to determine the minimum value of. - The minimum value in the sequence. - source is null. - source contains no elements. - - - Returns the minimum value in a sequence of values. - A sequence of values to determine the minimum value of. - The minimum value in the sequence. - source is null. - source contains no elements. - - - Returns the minimum value in a sequence of values. - A sequence of values to determine the minimum value of. - The minimum value in the sequence. - source is null. - source contains no elements. - - - Returns the minimum value in a sequence of nullable values. - A sequence of nullable values to determine the minimum value of. - A value of type Nullable in C# or Nullable(Of Decimal) in Visual Basic that corresponds to the minimum value in the sequence. - source is null. - - - Returns the minimum value in a sequence of values. - A sequence of values to determine the minimum value of. - The minimum value in the sequence. - source is null. - source contains no elements. - - - Invokes a transform function on each element of a generic sequence and returns the minimum resulting value. - A sequence of values to determine the minimum value of. - A transform function to apply to each element. - The type of the elements of source. - The type of the value returned by selector. - The minimum value in the sequence. - source or selector is null. - - - Invokes a transform function on each element of a sequence and returns the minimum value. - A sequence of values to determine the minimum value of. - A transform function to apply to each element. - The type of the elements of source. - The minimum value in the sequence. - source or selector is null. - source contains no elements. - - - Invokes a transform function on each element of a sequence and returns the minimum nullable value. - A sequence of values to determine the minimum value of. - A transform function to apply to each element. - The type of the elements of source. - The value of type Nullable in C# or Nullable(Of Single) in Visual Basic that corresponds to the minimum value in the sequence. - source or selector is null. - - - Invokes a transform function on each element of a sequence and returns the minimum nullable value. - A sequence of values to determine the minimum value of. - A transform function to apply to each element. - The type of the elements of source. - The value of type Nullable in C# or Nullable(Of Int64) in Visual Basic that corresponds to the minimum value in the sequence. - source or selector is null. - - - Invokes a transform function on each element of a sequence and returns the minimum nullable value. - A sequence of values to determine the minimum value of. - A transform function to apply to each element. - The type of the elements of source. - The value of type Nullable in C# or Nullable(Of Int32) in Visual Basic that corresponds to the minimum value in the sequence. - source or selector is null. - - - Invokes a transform function on each element of a sequence and returns the minimum nullable value. - A sequence of values to determine the minimum value of. - A transform function to apply to each element. - The type of the elements of source. - The value of type Nullable in C# or Nullable(Of Double) in Visual Basic that corresponds to the minimum value in the sequence. - source or selector is null. - - - Invokes a transform function on each element of a sequence and returns the minimum value. - A sequence of values to determine the minimum value of. - A transform function to apply to each element. - The type of the elements of source. - The minimum value in the sequence. - source or selector is null. - source contains no elements. - - - Invokes a transform function on each element of a sequence and returns the minimum value. - A sequence of values to determine the minimum value of. - A transform function to apply to each element. - The type of the elements of source. - The minimum value in the sequence. - source or selector is null. - source contains no elements. - - - Invokes a transform function on each element of a sequence and returns the minimum value. - A sequence of values to determine the minimum value of. - A transform function to apply to each element. - The type of the elements of source. - The minimum value in the sequence. - source or selector is null. - source contains no elements. - - - Invokes a transform function on each element of a sequence and returns the minimum value. - A sequence of values to determine the minimum value of. - A transform function to apply to each element. - The type of the elements of source. - The minimum value in the sequence. - source or selector is null. - source contains no elements. - - - Returns the minimum value in a generic sequence. - A sequence of values to determine the minimum value of. - The type of the elements of source. - The minimum value in the sequence. - source is null. - - - Invokes a transform function on each element of a sequence and returns the minimum nullable value. - A sequence of values to determine the minimum value of. - A transform function to apply to each element. - The type of the elements of source. - The value of type Nullable in C# or Nullable(Of Decimal) in Visual Basic that corresponds to the minimum value in the sequence. - source or selector is null. - - - Filters the elements of an based on a specified type. - The whose elements to filter. - The type to filter the elements of the sequence on. - An that contains elements from the input sequence of type TResult. - source is null. - - - Sorts the elements of a sequence in ascending order according to a key. - A sequence of values to order. - A function to extract a key from an element. - The type of the elements of source. - The type of the key returned by keySelector. - An whose elements are sorted according to a key. - source or keySelector is null. - - - Sorts the elements of a sequence in ascending order by using a specified comparer. - A sequence of values to order. - A function to extract a key from an element. - An to compare keys. - The type of the elements of source. - The type of the key returned by keySelector. - An whose elements are sorted according to a key. - source or keySelector is null. - - - Sorts the elements of a sequence in descending order by using a specified comparer. - A sequence of values to order. - A function to extract a key from an element. - An to compare keys. - The type of the elements of source. - The type of the key returned by keySelector. - An whose elements are sorted in descending order according to a key. - source or keySelector is null. - - - Sorts the elements of a sequence in descending order according to a key. - A sequence of values to order. - A function to extract a key from an element. - The type of the elements of source. - The type of the key returned by keySelector. - An whose elements are sorted in descending order according to a key. - source or keySelector is null. - - - - - - - - - Generates a sequence of integral numbers within a specified range. - The value of the first integer in the sequence. - The number of sequential integers to generate. - An IEnumerable in C# or IEnumerable(Of Int32) in Visual Basic that contains a range of sequential integral numbers. - count is less than 0. -or- start + count -1 is larger than . - - - Generates a sequence that contains one repeated value. - The value to be repeated. - The number of times to repeat the value in the generated sequence. - The type of the value to be repeated in the result sequence. - An that contains a repeated value. - count is less than 0. - - - Inverts the order of the elements in a sequence. - A sequence of values to reverse. - The type of the elements of source. - A sequence whose elements correspond to those of the input sequence in reverse order. - source is null. - - - Projects each element of a sequence into a new form by incorporating the element's index. - A sequence of values to invoke a transform function on. - A transform function to apply to each source element; the second parameter of the function represents the index of the source element. - The type of the elements of source. - The type of the value returned by selector. - An whose elements are the result of invoking the transform function on each element of source. - source or selector is null. - - - Projects each element of a sequence into a new form. - A sequence of values to invoke a transform function on. - A transform function to apply to each element. - The type of the elements of source. - The type of the value returned by selector. - An whose elements are the result of invoking the transform function on each element of source. - source or selector is null. - - - Projects each element of a sequence to an , flattens the resulting sequences into one sequence, and invokes a result selector function on each element therein. - A sequence of values to project. - A transform function to apply to each element of the input sequence. - A transform function to apply to each element of the intermediate sequence. - The type of the elements of source. - The type of the intermediate elements collected by collectionSelector. - The type of the elements of the resulting sequence. - An whose elements are the result of invoking the one-to-many transform function collectionSelector on each element of source and then mapping each of those sequence elements and their corresponding source element to a result element. - source or collectionSelector or resultSelector is null. - - - Projects each element of a sequence to an , flattens the resulting sequences into one sequence, and invokes a result selector function on each element therein. The index of each source element is used in the intermediate projected form of that element. - A sequence of values to project. - A transform function to apply to each source element; the second parameter of the function represents the index of the source element. - A transform function to apply to each element of the intermediate sequence. - The type of the elements of source. - The type of the intermediate elements collected by collectionSelector. - The type of the elements of the resulting sequence. - An whose elements are the result of invoking the one-to-many transform function collectionSelector on each element of source and then mapping each of those sequence elements and their corresponding source element to a result element. - source or collectionSelector or resultSelector is null. - - - Projects each element of a sequence to an and flattens the resulting sequences into one sequence. - A sequence of values to project. - A transform function to apply to each element. - The type of the elements of source. - The type of the elements of the sequence returned by selector. - An whose elements are the result of invoking the one-to-many transform function on each element of the input sequence. - source or selector is null. - - - Projects each element of a sequence to an , and flattens the resulting sequences into one sequence. The index of each source element is used in the projected form of that element. - A sequence of values to project. - A transform function to apply to each source element; the second parameter of the function represents the index of the source element. - The type of the elements of source. - The type of the elements of the sequence returned by selector. - An whose elements are the result of invoking the one-to-many transform function on each element of an input sequence. - source or selector is null. - - - Determines whether two sequences are equal by comparing the elements by using the default equality comparer for their type. - An to compare to second. - An to compare to the first sequence. - The type of the elements of the input sequences. - true if the two source sequences are of equal length and their corresponding elements are equal according to the default equality comparer for their type; otherwise, false. - first or second is null. - - - Determines whether two sequences are equal by comparing their elements by using a specified . - An to compare to second. - An to compare to the first sequence. - An to use to compare elements. - The type of the elements of the input sequences. - true if the two source sequences are of equal length and their corresponding elements compare equal according to comparer; otherwise, false. - first or second is null. - - - Returns the only element of a sequence that satisfies a specified condition, and throws an exception if more than one such element exists. - An to return a single element from. - A function to test an element for a condition. - The type of the elements of source. - The single element of the input sequence that satisfies a condition. - source or predicate is null. - No element satisfies the condition in predicate. -or- More than one element satisfies the condition in predicate. -or- The source sequence is empty. - - - Returns the only element of a sequence, and throws an exception if there is not exactly one element in the sequence. - An to return the single element of. - The type of the elements of source. - The single element of the input sequence. - source is null. - The input sequence contains more than one element. -or- The input sequence is empty. - - - Returns the only element of a sequence, or a default value if the sequence is empty; this method throws an exception if there is more than one element in the sequence. - An to return the single element of. - The type of the elements of source. - The single element of the input sequence, or default(TSource) if the sequence contains no elements. - source is null. - The input sequence contains more than one element. - - - Returns the only element of a sequence that satisfies a specified condition or a default value if no such element exists; this method throws an exception if more than one element satisfies the condition. - An to return a single element from. - A function to test an element for a condition. - The type of the elements of source. - The single element of the input sequence that satisfies the condition, or default(TSource) if no such element is found. - source or predicate is null. - - - Bypasses a specified number of elements in a sequence and then returns the remaining elements. - An to return elements from. - The number of elements to skip before returning the remaining elements. - The type of the elements of source. - An that contains the elements that occur after the specified index in the input sequence. - source is null. - - - Bypasses elements in a sequence as long as a specified condition is true and then returns the remaining elements. - An to return elements from. - A function to test each element for a condition. - The type of the elements of source. - An that contains the elements from the input sequence starting at the first element in the linear series that does not pass the test specified by predicate. - source or predicate is null. - - - Bypasses elements in a sequence as long as a specified condition is true and then returns the remaining elements. The element's index is used in the logic of the predicate function. - An to return elements from. - A function to test each source element for a condition; the second parameter of the function represents the index of the source element. - The type of the elements of source. - An that contains the elements from the input sequence starting at the first element in the linear series that does not pass the test specified by predicate. - source or predicate is null. - - - Computes the sum of a sequence of nullable values. - A sequence of nullable values to calculate the sum of. - The sum of the values in the sequence. - source is null. - The sum is larger than . - - - Computes the sum of a sequence of nullable values. - A sequence of nullable values to calculate the sum of. - The sum of the values in the sequence. - source is null. - - - Computes the sum of a sequence of values. - A sequence of values to calculate the sum of. - The sum of the values in the sequence. - source is null. - - - Computes the sum of a sequence of nullable values. - A sequence of nullable values to calculate the sum of. - The sum of the values in the sequence. - source is null. - The sum is larger than . - - - Computes the sum of a sequence of nullable values. - A sequence of nullable values to calculate the sum of. - The sum of the values in the sequence. - source is null. - - - Computes the sum of a sequence of values. - A sequence of values to calculate the sum of. - The sum of the values in the sequence. - source is null. - - - Computes the sum of a sequence of values. - A sequence of values to calculate the sum of. - The sum of the values in the sequence. - source is null. - The sum is larger than . - - - Computes the sum of a sequence of values. - A sequence of values to calculate the sum of. - The sum of the values in the sequence. - source is null. - The sum is larger than . - - - Computes the sum of a sequence of values. - A sequence of values to calculate the sum of. - The sum of the values in the sequence. - source is null. - The sum is larger than . - - - Computes the sum of a sequence of nullable values. - A sequence of nullable values to calculate the sum of. - The sum of the values in the sequence. - source is null. - The sum is larger than . - - - Computes the sum of the sequence of values that are obtained by invoking a transform function on each element of the input sequence. - A sequence of values that are used to calculate a sum. - A transform function to apply to each element. - The type of the elements of source. - The sum of the projected values. - source or selector is null. - - - Computes the sum of the sequence of nullable values that are obtained by invoking a transform function on each element of the input sequence. - A sequence of values that are used to calculate a sum. - A transform function to apply to each element. - The type of the elements of source. - The sum of the projected values. - source or selector is null. - - - Computes the sum of the sequence of nullable values that are obtained by invoking a transform function on each element of the input sequence. - A sequence of values that are used to calculate a sum. - A transform function to apply to each element. - The type of the elements of source. - The sum of the projected values. - source or selector is null. - The sum is larger than . - - - Computes the sum of the sequence of nullable values that are obtained by invoking a transform function on each element of the input sequence. - A sequence of values that are used to calculate a sum. - A transform function to apply to each element. - The type of the elements of source. - The sum of the projected values. - source or selector is null. - The sum is larger than . - - - Computes the sum of the sequence of nullable values that are obtained by invoking a transform function on each element of the input sequence. - A sequence of values that are used to calculate a sum. - A transform function to apply to each element. - The type of the elements of source. - The sum of the projected values. - source or selector is null. - - - Computes the sum of the sequence of nullable values that are obtained by invoking a transform function on each element of the input sequence. - A sequence of values that are used to calculate a sum. - A transform function to apply to each element. - The type of the elements of source. - The sum of the projected values. - source or selector is null. - The sum is larger than . - - - Computes the sum of the sequence of values that are obtained by invoking a transform function on each element of the input sequence. - A sequence of values that are used to calculate a sum. - A transform function to apply to each element. - The type of the elements of source. - The sum of the projected values. - source or selector is null. - The sum is larger than . - - - Computes the sum of the sequence of values that are obtained by invoking a transform function on each element of the input sequence. - A sequence of values that are used to calculate a sum. - A transform function to apply to each element. - The type of the elements of source. - The sum of the projected values. - source or selector is null. - The sum is larger than . - - - Computes the sum of the sequence of values that are obtained by invoking a transform function on each element of the input sequence. - A sequence of values that are used to calculate a sum. - A transform function to apply to each element. - The type of the elements of source. - The sum of the projected values. - source or selector is null. - - - Computes the sum of the sequence of values that are obtained by invoking a transform function on each element of the input sequence. - A sequence of values that are used to calculate a sum. - A transform function to apply to each element. - The type of the elements of source. - The sum of the projected values. - source or selector is null. - The sum is larger than . - - - Returns a specified number of contiguous elements from the start of a sequence. - The sequence to return elements from. - The number of elements to return. - The type of the elements of source. - An that contains the specified number of elements from the start of the input sequence. - source is null. - - - Returns elements from a sequence as long as a specified condition is true. - A sequence to return elements from. - A function to test each element for a condition. - The type of the elements of source. - An that contains the elements from the input sequence that occur before the element at which the test no longer passes. - source or predicate is null. - - - Returns elements from a sequence as long as a specified condition is true. The element's index is used in the logic of the predicate function. - The sequence to return elements from. - A function to test each source element for a condition; the second parameter of the function represents the index of the source element. - The type of the elements of source. - An that contains elements from the input sequence that occur before the element at which the test no longer passes. - source or predicate is null. - - - Performs a subsequent ordering of the elements in a sequence in ascending order by using a specified comparer. - An that contains elements to sort. - A function to extract a key from each element. - An to compare keys. - The type of the elements of source. - The type of the key returned by keySelector. - An whose elements are sorted according to a key. - source or keySelector is null. - - - Performs a subsequent ordering of the elements in a sequence in ascending order according to a key. - An that contains elements to sort. - A function to extract a key from each element. - The type of the elements of source. - The type of the key returned by keySelector. - An whose elements are sorted according to a key. - source or keySelector is null. - - - Performs a subsequent ordering of the elements in a sequence in descending order, according to a key. - An that contains elements to sort. - A function to extract a key from each element. - The type of the elements of source. - The type of the key returned by keySelector. - An whose elements are sorted in descending order according to a key. - source or keySelector is null. - - - Performs a subsequent ordering of the elements in a sequence in descending order by using a specified comparer. - An that contains elements to sort. - A function to extract a key from each element. - An to compare keys. - The type of the elements of source. - The type of the key returned by keySelector. - An whose elements are sorted in descending order according to a key. - source or keySelector is null. - - - Creates an array from a . - An to create an array from. - The type of the elements of source. - An array that contains the elements from the input sequence. - source is null. - - - Creates a from an according to specified key selector and element selector functions. - An to create a from. - A function to extract a key from each element. - A transform function to produce a result element value from each element. - The type of the elements of source. - The type of the key returned by keySelector. - The type of the value returned by elementSelector. - A that contains values of type TElement selected from the input sequence. - source or keySelector or elementSelector is null. -or- keySelector produces a key that is null. - keySelector produces duplicate keys for two elements. - - - Creates a from an according to a specified key selector function, a comparer, and an element selector function. - An to create a from. - A function to extract a key from each element. - A transform function to produce a result element value from each element. - An to compare keys. - The type of the elements of source. - The type of the key returned by keySelector. - The type of the value returned by elementSelector. - A that contains values of type TElement selected from the input sequence. - source or keySelector or elementSelector is null. -or- keySelector produces a key that is null. - keySelector produces duplicate keys for two elements. - - - Creates a from an according to a specified key selector function. - An to create a from. - A function to extract a key from each element. - The type of the elements of source. - The type of the key returned by keySelector. - A that contains keys and values. - source or keySelector is null. -or- keySelector produces a key that is null. - keySelector produces duplicate keys for two elements. - - - Creates a from an according to a specified key selector function and key comparer. - An to create a from. - A function to extract a key from each element. - An to compare keys. - The type of the elements of source. - The type of the keys returned by keySelector. - A that contains keys and values. - source or keySelector is null. -or- keySelector produces a key that is null. - keySelector produces duplicate keys for two elements. - - - Creates a from an . - The to create a from. - The type of the elements of source. - A that contains elements from the input sequence. - source is null. - - - Creates a from an according to specified key selector and element selector functions. - The to create a from. - A function to extract a key from each element. - A transform function to produce a result element value from each element. - The type of the elements of source. - The type of the key returned by keySelector. - The type of the value returned by elementSelector. - A that contains values of type TElement selected from the input sequence. - source or keySelector or elementSelector is null. - - - Creates a from an according to a specified key selector function, a comparer and an element selector function. - The to create a from. - A function to extract a key from each element. - A transform function to produce a result element value from each element. - An to compare keys. - The type of the elements of source. - The type of the key returned by keySelector. - The type of the value returned by elementSelector. - A that contains values of type TElement selected from the input sequence. - source or keySelector or elementSelector is null. - - - Creates a from an according to a specified key selector function. - The to create a from. - A function to extract a key from each element. - The type of the elements of source. - The type of the key returned by keySelector. - A that contains keys and values. - source or keySelector is null. - - - Creates a from an according to a specified key selector function and key comparer. - The to create a from. - A function to extract a key from each element. - An to compare keys. - The type of the elements of source. - The type of the key returned by keySelector. - A that contains keys and values. - source or keySelector is null. - - - Produces the set union of two sequences by using the default equality comparer. - An whose distinct elements form the first set for the union. - An whose distinct elements form the second set for the union. - The type of the elements of the input sequences. - An that contains the elements from both input sequences, excluding duplicates. - first or second is null. - - - Produces the set union of two sequences by using a specified . - An whose distinct elements form the first set for the union. - An whose distinct elements form the second set for the union. - The to compare values. - The type of the elements of the input sequences. - An that contains the elements from both input sequences, excluding duplicates. - first or second is null. - - - Filters a sequence of values based on a predicate. Each element's index is used in the logic of the predicate function. - An to filter. - A function to test each source element for a condition; the second parameter of the function represents the index of the source element. - The type of the elements of source. - An that contains elements from the input sequence that satisfy the condition. - source or predicate is null. - - - Filters a sequence of values based on a predicate. - An to filter. - A function to test each element for a condition. - The type of the elements of source. - An that contains elements from the input sequence that satisfy the condition. - source or predicate is null. - - - Applies a specified function to the corresponding elements of two sequences, producing a sequence of the results. - The first sequence to merge. - The second sequence to merge. - A function that specifies how to merge the elements from the two sequences. - The type of the elements of the first input sequence. - The type of the elements of the second input sequence. - The type of the elements of the result sequence. - An that contains merged elements of two input sequences. - first or second is null. - - - Represents an expression tree and provides functionality to execute the expression tree after rewriting it. - The data type of the value that results from executing the expression tree. - - - Initializes a new instance of the class. - An expression tree to associate with the new instance. - - - Represents an expression tree and provides functionality to execute the expression tree after rewriting it. - - - Initializes a new instance of the class. - - - Represents an collection as an data source. - The type of the data in the collection. - - - Initializes a new instance of the class and associates it with an collection. - A collection to associate with the new instance. - - - Initializes a new instance of the class and associates the instance with an expression tree. - An expression tree to associate with the new instance. - - - Returns a textual representation of the enumerable collection or, if it is null, of the expression tree that is associated with this instance. - A textual representation of the enumerable collection or, if it is null, of the expression tree that is associated with this instance. - - - Returns an enumerator that can iterate through the associated collection, or, if it is null, through the collection that results from rewriting the associated expression tree as a query on an data source and executing it. - An enumerator that can be used to iterate through the associated data source. - - - Returns an enumerator that can iterate through the associated collection, or, if it is null, through the collection that results from rewriting the associated expression tree as a query on an data source and executing it. - An enumerator that can be used to iterate through the associated data source. - - - Gets the type of the data in the collection that this instance represents. - The type of the data in the collection that this instance represents. - - - Gets the expression tree that is associated with or that represents this instance. - The expression tree that is associated with or that represents this instance. - - - Gets the query provider that is associated with this instance. - The query provider that is associated with this instance. - - - Constructs a new object and associates it with a specified expression tree that represents an collection of data. - An expression tree that represents an collection of data. - An object that is associated with expression. - - - Constructs a new object and associates it with a specified expression tree that represents an collection of data. - An expression tree to execute. - The type of the data in the collection that expression represents. - An EnumerableQuery object that is associated with expression. - - - Executes an expression after rewriting it to call methods instead of methods on any enumerable data sources that cannot be queried by methods. - An expression tree to execute. - The value that results from executing expression. - - - Executes an expression after rewriting it to call methods instead of methods on any enumerable data sources that cannot be queried by methods. - An expression tree to execute. - The type of the data in the collection that expression represents. - The value that results from executing expression. - - - Represents an as an data source. - - - Initializes a new instance of the class. - - - Represents an expression that has a binary operator. - - - Dispatches to the specific visit method for this node type. For example, calls the . - The visitor to visit this node with. - The result of visiting this node. - - - Gets a value that indicates whether the expression tree node can be reduced. - True if the expression tree node can be reduced, otherwise false. - - - Gets the type conversion function that is used by a coalescing or compound assignment operation. - A that represents a type conversion function. - - - Gets a value that indicates whether the expression tree node represents a lifted call to an operator. - true if the node represents a lifted call; otherwise, false. - - - Gets a value that indicates whether the expression tree node represents a lifted call to an operator whose return type is lifted to a nullable type. - true if the operator's return type is lifted to a nullable type; otherwise, false. - - - Gets the left operand of the binary operation. - An that represents the left operand of the binary operation. - - - Gets the implementing method for the binary operation. - The that represents the implementing method. - - - Reduces the binary expression node to a simpler expression. - The reduced expression. - - - Gets the right operand of the binary operation. - An that represents the right operand of the binary operation. - - - Creates a new expression that is like this one, but using the supplied children. If all of the children are the same, it will return this expression. - The property of the result. - The property of the result. - The property of the result. - This expression if no children are changed or an expression with the updated children. - - - Represents a block that contains a sequence of expressions where variables can be defined. - - - Dispatches to the specific visit method for this node type. For example, calls the . - The visitor to visit this node with. - The result of visiting this node. - - - Gets the expressions in this block. - The read-only collection containing all the expressions in this block. - - - Returns the node type of this expression. Extension nodes should return when overriding this method. - The of the expression. - - - Gets the last expression in this block. - The object representing the last expression in this block. - - - Gets the static type of the expression that this represents. - The that represents the static type of the expression. - - - Creates a new expression that is like this one, but using the supplied children. If all of the children are the same, it will return this expression. - The property of the result. - The property of the result. - This expression if no children changed, or an expression with the updated children. - - - Gets the variables defined in this block. - The read-only collection containing all the variables defined in this block. - - - Represents a catch statement in a try block. - - - Gets the body of the catch block. - The object representing the catch body. - - - Gets the body of the filter. - The object representing the body of the filter. - - - Gets the type of this handler catches. - The object representing the type of this handler catches. - - - Returns a that represents the current . - A that represents the current . - - - Creates a new expression that is like this one, but using the supplied children. If all of the children are the same, it will return this expression. - The property of the result. - The property of the result. - The property of the result. - This expression if no children are changed or an expression with the updated children. - - - Gets a reference to the object caught by this handler. - The object representing a reference to the object caught by this handler. - - - Represents an expression that has a conditional operator. - - - Dispatches to the specific visit method for this node type. For example, calls the . - The visitor to visit this node with. - The result of visiting this node. - - - Gets the expression to execute if the test evaluates to false. - An that represents the expression to execute if the test is false. - - - Gets the expression to execute if the test evaluates to true. - An that represents the expression to execute if the test is true. - - - Returns the node type of this expression. Extension nodes should return when overriding this method. - The of the expression. - - - Gets the test of the conditional operation. - An that represents the test of the conditional operation. - - - Gets the static type of the expression that this represents. - The that represents the static type of the expression. - - - Creates a new expression that is like this one, but using the supplied children. If all of the children are the same, it will return this expression - The property of the result. - The property of the result. - The property of the result. - This expression if no children changed, or an expression with the updated children. - - - Represents an expression that has a constant value. - - - Dispatches to the specific visit method for this node type. For example, calls the . - The visitor to visit this node with. - The result of visiting this node. - - - Returns the node type of this Expression. Extension nodes should return when overriding this method. - The of the expression. - - - Gets the static type of the expression that this represents. - The that represents the static type of the expression. - - - Gets the value of the constant expression. - An equal to the value of the represented expression. - - - Emits or clears a sequence point for debug information. This allows the debugger to highlight the correct source code when debugging. - - - Dispatches to the specific visit method for this node type. For example, calls the . - The visitor to visit this node with. - The result of visiting this node. - - - Gets the that represents the source file. - The that represents the source file. - - - Gets the end column of this . - The number of the end column of the code that was used to generate the wrapped expression. - - - Gets the end line of this . - The number of the end line of the code that was used to generate the wrapped expression. - - - Gets the value to indicate if the is for clearing a sequence point. - True if the is for clearing a sequence point, otherwise false. - - - Returns the node type of this . - The that represents this expression. - - - Gets the start column of this . - The number of the start column of the code that was used to generate the wrapped expression. - - - Gets the start line of this . - The number of the start line of the code that was used to generate the wrapped expression. - - - Gets the static type of the expression that this represents. - The that represents the static type of the expression. - - - Represents the default value of a type or an empty expression. - - - Returns the node type of this expression. Extension nodes should return when overriding this method. - The of the expression. - - - Gets the static type of the expression that this represents. - The that represents the static type of the expression. - - - Represents a dynamic operation. - - - Dispatches to the specific visit method for this node type. For example, calls the . - The visitor to visit this node with. - The result of visiting this node. - - - Gets the arguments to the dynamic operation. - The read-only collections containing the arguments to the dynamic operation. - - - Gets the , which determines the run-time behavior of the dynamic site. - The , which determines the run-time behavior of the dynamic site. - - - Gets the type of the delegate used by the . - The object representing the type of the delegate used by the . - - - Creates a that represents a dynamic operation bound by the provided . - The runtime binder for the dynamic operation. - The result type of the dynamic expression. - The arguments to the dynamic operation. - A that has equal to , and has the and set to the specified values. - - - Creates a that represents a dynamic operation bound by the provided . - The runtime binder for the dynamic operation. - The result type of the dynamic expression. - The first argument to the dynamic operation. - A that has equal to , and has the and set to the specified values. - - - Creates a that represents a dynamic operation bound by the provided . - The runtime binder for the dynamic operation. - The result type of the dynamic expression. - The arguments to the dynamic operation. - A that has equal to , and has the and set to the specified values. - - - Creates a that represents a dynamic operation bound by the provided . - The runtime binder for the dynamic operation. - The result type of the dynamic expression. - The first argument to the dynamic operation. - The second argument to the dynamic operation. - A that has equal to , and has the and set to the specified values. - - - Creates a that represents a dynamic operation bound by the provided . - The runtime binder for the dynamic operation. - The result type of the dynamic expression. - The first argument to the dynamic operation. - The second argument to the dynamic operation. - The third argument to the dynamic operation. - A that has equal to , and has the and set to the specified values. - - - Creates a that represents a dynamic operation bound by the provided . - The runtime binder for the dynamic operation. - The result type of the dynamic expression. - The first argument to the dynamic operation. - The second argument to the dynamic operation. - The third argument to the dynamic operation. - The fourth argument to the dynamic operation. - A that has equal to , and has the and set to the specified values. - - - Creates a that represents a dynamic operation bound by the provided and four arguments. - The type of the delegate used by the . - The runtime binder for the dynamic operation. - The first argument to the dynamic operation. - The second argument to the dynamic operation. - The third argument to the dynamic operation. - The fourth argument to the dynamic operation. - A that has equal to , and has the , , and set to the specified values. - - - Creates a that represents a dynamic operation bound by the provided and three arguments. - The type of the delegate used by the . - The runtime binder for the dynamic operation. - The first argument to the dynamic operation. - The second argument to the dynamic operation. - The third argument to the dynamic operation. - A that has equal to , and has the , , and set to the specified values. - - - Creates a that represents a dynamic operation bound by the provided and two arguments. - The type of the delegate used by the . - The runtime binder for the dynamic operation. - The first argument to the dynamic operation. - The second argument to the dynamic operation. - A that has equal to , and has the , , and set to the specified values. - - - Creates a that represents a dynamic operation bound by the provided and one argument. - The type of the delegate used by the . - The runtime binder for the dynamic operation. - The argument to the dynamic operation. - A that has equal to , and has the , , and set to the specified values. - - - Creates a that represents a dynamic operation bound by the provided . - The type of the delegate used by the . - The runtime binder for the dynamic operation. - The arguments to the dynamic operation. - A that has equal to , and has the , , and set to the specified values. - - - Creates a that represents a dynamic operation bound by the provided . - The type of the delegate used by the . - The runtime binder for the dynamic operation. - The arguments to the dynamic operation. - A that has equal to , and has the , , and set to the specified values. - - - Returns the node type of this expression. Extension nodes should return when overriding this method. - The of the expression. - - - Gets the static type of the expression that this represents. - The that represents the static type of the expression. - - - Compares the value sent to the parameter, arguments, to the Arguments property of the current instance of DynamicExpression. If the values of the parameter and the property are equal, the current instance is returned. If they are not equal, a new DynamicExpression instance is returned that is identical to the current instance except that the Arguments property is set to the value of parameter arguments. - The property of the result. - This expression if no children are changed or an expression with the updated children. - - - Returns the number of arguments to the expression tree node. You should not use this member. It is only public due to assembly refactoring, and it is used internally for performance optimizations. - Returns . - - - Returns the argument at index, throwing if index is out of bounds. You should not use this member. It is only public due to assembly refactoring, and it is used internally for performance optimizations. - The index of the argument. - Returns . - - - Optionally creates the CallSite and returns the CallSite for the DynamicExpression’s polymorphic inline cache. You should not use this member. It is only public due to assembly refactoring, and it is used internally for performance optimizations. - Returns . - - - Rewrite this node replacing the dynamic expression’s arguments with the provided values. The number of args needs to match the number of the current expression. You should not use this type. It is only public due to assembly refactoring, and it is used internally for performance optimizations. This helper method allows re-writing of nodes to be independent of the specific implementation class deriving from DynamicExpression that is being used at the call site. - The arguments. - Returns , the rewritten expression. - - - Represents a visitor or rewriter for dynamic expression trees. - - - Initializes a new instance of . - - - Visits the children of the . - The expression to visit. - Returns , the modified expression, if it or any subexpression is modified; otherwise, returns the original expression. - - - Represents an initializer for a single element of an collection. - - - Gets the instance method that is used to add an element to an collection. - A that represents an instance method that adds an element to a collection. - - - Gets the collection of arguments that are passed to a method that adds an element to an collection. - A of objects that represent the arguments for a method that adds an element to a collection. - - - Returns a textual representation of an object. - A textual representation of the object. - - - Creates a new expression that is like this one, but using the supplied children. If all of the children are the same, it will return this expression. - The property of the result. - This expression if no children are changed or an expression with the updated children. - - - Returns the number of arguments to the expression tree node. You should not use this member. It is only public due to assembly refactoring, and it is used internally for performance optimizations. - Returns . - - - Returns the argument at index, throwing if index is out of bounds. You should not use this member. It is only public due to assembly refactoring, and it is used internally for performance optimizations. - The index of the argument. - Returns . - - - Represents a strongly typed lambda expression as a data structure in the form of an expression tree. This class cannot be inherited. - The type of the delegate that the represents. - - - Compiles the lambda expression described by the expression tree into executable code and produces a delegate that represents the lambda expression. - A delegate of type TDelegate that represents the compiled lambda expression described by the . - - - - - - - Produces a delegate that represents the lambda expression. - Debugging information generator used by the compiler to mark sequence points and annotate local variables. - A delegate containing the compiled version of the lambda. - - - Creates a new expression that is like this one, but using the supplied children. If all of the children are the same, it will return this expression. - The property of the result. - The property of the result. - This expression if no children are changed or an expression with the updated children. - - - Provides the base class from which the classes that represent expression tree nodes are derived. It also contains static (Shared in Visual Basic) factory methods to create the various node types. This is an abstract class. - - - Constructs a new instance of . - - - Initializes a new instance of the class. - The to set as the node type. - The of this . - - - Dispatches to the specific visit method for this node type. For example, calls the . - The visitor to visit this node with. - The result of visiting this node. - - - Creates a that represents an arithmetic addition operation that does not have overflow checking. - A to set the property equal to. - A to set the property equal to. - A that has the property equal to and the and properties set to the specified values. - left or right is null. - The addition operator is not defined for left.Type and right.Type. - - - Creates a that represents an arithmetic addition operation that does not have overflow checking. The implementing method can be specified. - A to set the property equal to. - A to set the property equal to. - A to set the property equal to. - A that has the property equal to and the , and properties set to the specified values. - left or right is null. - method is not null and the method it represents returns void, is not static (Shared in Visual Basic), or does not take exactly two arguments. - method is null and the addition operator is not defined for left.Type and right.Type. - - - Creates a that represents an addition assignment operation that does not have overflow checking. - An to set the property equal to. - An to set the property equal to. - A that has the property equal to and the and properties set to the specified values. - - - Creates a that represents an addition assignment operation that does not have overflow checking. - An to set the property equal to. - An to set the property equal to. - A to set the property equal to. - A that has the property equal to and the , , and properties set to the specified values. - - - Creates a that represents an addition assignment operation that does not have overflow checking. - An to set the property equal to. - An to set the property equal to. - A to set the property equal to. - A to set the property equal to. - A that has the property equal to and the , , , and properties set to the specified values. - - - Creates a that represents an addition assignment operation that has overflow checking. - An to set the property equal to. - An to set the property equal to. - A that has the property equal to and the and properties set to the specified values. - - - Creates a that represents an addition assignment operation that has overflow checking. - An to set the property equal to. - An to set the property equal to. - A to set the property equal to. - A that has the property equal to and the , , and properties set to the specified values. - - - Creates a that represents an addition assignment operation that has overflow checking. - An to set the property equal to. - An to set the property equal to. - A to set the property equal to. - A to set the property equal to. - A that has the property equal to and the , , , and properties set to the specified values. - - - Creates a that represents an arithmetic addition operation that has overflow checking. - A to set the property equal to. - A to set the property equal to. - A that has the property equal to and the and properties set to the specified values. - left or right is null. - The addition operator is not defined for left.Type and right.Type. - - - Creates a that represents an arithmetic addition operation that has overflow checking. The implementing method can be specified. - A to set the property equal to. - A to set the property equal to. - A to set the property equal to. - A that has the property equal to and the , and properties set to the specified values. - left or right is null. - method is not null and the method it represents returns void, is not static (Shared in Visual Basic), or does not take exactly two arguments. - method is null and the addition operator is not defined for left.Type and right.Type. - - - Creates a that represents a bitwise AND operation. - A to set the property equal to. - A to set the property equal to. - A that has the property equal to and the and properties set to the specified values. - left or right is null. - The bitwise AND operator is not defined for left.Type and right.Type. - - - Creates a that represents a bitwise AND operation. The implementing method can be specified. - An to set the property equal to. - An to set the property equal to. - A to set the property equal to. - A that has the property equal to and the , , and properties set to the specified values. - left or right is null. - method is not null and the method it represents returns void, is not static (Shared in Visual Basic), or does not take exactly two arguments. - method is null and the bitwise AND operator is not defined for left.Type and right.Type. - - - Creates a that represents a conditional AND operation that evaluates the second operand only if the first operand is resolved to true. The implementing method can be specified. - A to set the property equal to. - A to set the property equal to. - A to set the property equal to. - A that has the property equal to and the , , and properties set to the specified values. - left or right is null. - method is not null and the method it represents returns void, is not static (Shared in Visual Basic), or does not take exactly two arguments. - method is null and the bitwise AND operator is not defined for left.Type and right.Type. -or- method is null and left.Type and right.Type are not the same Boolean type. - - - Creates a that represents a conditional AND operation that evaluates the second operand only if the first operand evaluates to true. - A to set the property equal to. - A to set the property equal to. - A that has the property equal to and the and properties set to the specified values. - left or right is null. - The bitwise AND operator is not defined for left.Type and right.Type. -or- left.Type and right.Type are not the same Boolean type. - - - Creates a that represents a bitwise AND assignment operation. - An to set the property equal to. - An to set the property equal to. - A that has the property equal to and the and properties set to the specified values. - - - Creates a that represents a bitwise AND assignment operation. - An to set the property equal to. - An to set the property equal to. - A to set the property equal to. - A that has the property equal to and the , , and properties set to the specified values. - - - Creates a that represents a bitwise AND assignment operation. - An to set the property equal to. - An to set the property equal to. - A to set the property equal to. - A to set the property equal to. - A that has the property equal to and the , , , and properties set to the specified values. - - - Creates an to access a multidimensional array. - An expression that represents the multidimensional array. - An containing expressions used to index the array. - The created . - - - Creates an to access an array. - An expression representing the array to index. - An array that contains expressions used to index the array. - The created . - - - Creates a that represents applying an array index operator to a multidimensional array. - An array of instances - indexes for the array index operation. - An array of objects to use to populate the collection. - A that has the property equal to and the and properties set to the specified values. - array or indexes is null. - array.Type does not represent an array type. -or- The rank of array.Type does not match the number of elements in indexes. -or- The property of one or more elements of indexes does not represent the type. - - - Creates a that represents applying an array index operator to an array of rank more than one. - An to set the property equal to. - An that contains objects to use to populate the collection. - A that has the property equal to and the and properties set to the specified values. - array or indexes is null. - array.Type does not represent an array type. -or- The rank of array.Type does not match the number of elements in indexes. -or- The property of one or more elements of indexes does not represent the type. - - - Creates a that represents applying an array index operator to an array of rank one. - A to set the property equal to. - A to set the property equal to. - A that has the property equal to and the and properties set to the specified values. - array or index is null. - array.Type does not represent an array type. -or- array.Type represents an array type whose rank is not 1. -or- index.Type does not represent the type. - - - Creates a that represents an expression for obtaining the length of a one-dimensional array. - An to set the property equal to. - A that has the property equal to and the property equal to array. - array is null. - array.Type does not represent an array type. - - - Creates a that represents an assignment operation. - An to set the property equal to. - An to set the property equal to. - A that has the property equal to and the and properties set to the specified values. - - - Creates a that represents the initialization of a field or property. - A to set the property equal to. - An to set the property equal to. - A that has equal to and the and properties set to the specified values. - member or expression is null. - member does not represent a field or property. -or- The property represented by member does not have a set accessor. -or- expression.Type is not assignable to the type of the field or property that member represents. - - - Creates a that represents the initialization of a member by using a property accessor method. - A that represents a property accessor method. - An to set the property equal to. - A that has the property equal to , the property set to the that represents the property accessed in propertyAccessor, and the property set to expression. - propertyAccessor or expression is null. - propertyAccessor does not represent a property accessor method. -or- The property accessed by propertyAccessor does not have a set accessor. -or- expression.Type is not assignable to the type of the field or property that member represents. - - - Creates a that contains the given variables and expressions. - The result type of the block. - The variables in the block. - The expressions in the block. - The created . - - - Creates a that contains three expressions and has no variables. - The first expression in the block. - The second expression in the block. - The third expression in the block. - The created . - - - Creates a that contains five expressions and has no variables. - The first expression in the block. - The second expression in the block. - The third expression in the block. - The fourth expression in the block. - The fifth expression in the block. - The created . - - - Creates a that contains the given variables and expressions. - The result type of the block. - The variables in the block. - The expressions in the block. - The created . - - - Creates a that contains the given expressions, has no variables and has specific result type. - The result type of the block. - The expressions in the block. - The created . - - - Creates a that contains four expressions and has no variables. - The first expression in the block. - The second expression in the block. - The third expression in the block. - The fourth expression in the block. - The created . - - - Creates a that contains two expressions and has no variables. - The first expression in the block. - The second expression in the block. - The created . - - - Creates a that contains the given variables and expressions. - The variables in the block. - The expressions in the block. - The created . - - - Creates a that contains the given variables and expressions. - The variables in the block. - The expressions in the block. - The created . - - - Creates a that contains the given expressions and has no variables. - The expressions in the block. - The created . - - - Creates a that contains the given expressions and has no variables. - The expressions in the block. - The created . - - - Creates a that contains the given expressions, has no variables and has specific result type. - The result type of the block. - The expressions in the block. - The created . - - - Creates a representing a break statement. - The that the will jump to. - A with equal to Break, the property set to target, and a null value to be passed to the target label upon jumping. - - - Creates a representing a break statement. The value passed to the label upon jumping can be specified. - The that the will jump to. - The value that will be passed to the associated label upon jumping. - A with equal to Break, the property set to target, and value to be passed to the target label upon jumping. - - - Creates a representing a break statement with the specified type. - The that the will jump to. - An to set the property equal to. - A with equal to Break, the property set to target, and the property set to type. - - - Creates a representing a break statement with the specified type. The value passed to the label upon jumping can be specified. - The that the will jump to. - The value that will be passed to the associated label upon jumping. - An to set the property equal to. - A with equal to Break, the property set to target, the property set to type, and value to be passed to the target label upon jumping. - - - Creates a that represents a call to a static method that takes five arguments. - A to set the property equal to. - The that represents the first argument. - The that represents the second argument. - The that represents the third argument. - The that represents the fourth argument. - The that represents the fifth argument. - A that has the property equal to and the and properties set to the specified values. - method is null. - - - Creates a that represents a call to a method that takes three arguments. - An that specifies the instance for an instance call. (pass null for a static (Shared in Visual Basic) method). - The that represents the target method. - The that represents the first argument. - The that represents the second argument. - The that represents the third argument. - A that has the property equal to and the and properties set to the specified values. - - - Creates a that represents a call to a static (Shared in Visual Basic) method by calling the appropriate factory method. - The that specifies the type that contains the specified static (Shared in Visual Basic) method. - The name of the method. - An array of objects that specify the type parameters of the generic method. This argument should be null when methodName specifies a non-generic method. - An array of objects that represent the arguments to the method. - A that has the property equal to , the property set to the that represents the specified static (Shared in Visual Basic) method, and the property set to the specified arguments. - type or methodName is null. - No method whose name is methodName, whose type parameters match typeArguments, and whose parameter types match arguments is found in type or its base types. -or- More than one method whose name is methodName, whose type parameters match typeArguments, and whose parameter types match arguments is found in type or its base types. - - - Creates a that represents a call to a static method that takes three arguments. - A to set the property equal to. - The that represents the first argument. - The that represents the second argument. - The that represents the third argument. - A that has the property equal to and the and properties set to the specified values. - method is null. - - - Creates a that represents a call to a method by calling the appropriate factory method. - An whose property value will be searched for a specific method. - The name of the method. - An array of objects that specify the type parameters of the generic method. This argument should be null when methodName specifies a non-generic method. - An array of objects that represents the arguments to the method. - A that has the property equal to , the property equal to instance, set to the that represents the specified instance method, and set to the specified arguments. - instance or methodName is null. - No method whose name is methodName, whose type parameters match typeArguments, and whose parameter types match arguments is found in instance.Type or its base types. -or- More than one method whose name is methodName, whose type parameters match typeArguments, and whose parameter types match arguments is found in instance.Type or its base types. - - - Creates a that represents a call to a method that takes two arguments. - An that specifies the instance for an instance call. (pass null for a static (Shared in Visual Basic) method). - The that represents the target method. - The that represents the first argument. - The that represents the second argument. - A that has the property equal to and the and properties set to the specified values. - - - Creates a that represents a call to a static method that takes four arguments. - A to set the property equal to. - The that represents the first argument. - The that represents the second argument. - The that represents the third argument. - The that represents the fourth argument. - A that has the property equal to and the and properties set to the specified values. - method is null. - - - Creates a that represents a call to a method that takes arguments. - An that specifies the instance for an instance method call (pass null for a static (Shared in Visual Basic) method). - A to set the property equal to. - An array of objects to use to populate the collection. - A that has the property equal to and the , , and properties set to the specified values. - method is null. -or- instance is null and method represents an instance method. -or- arguments is not null and one or more of its elements is null. - instance.Type is not assignable to the declaring type of the method represented by method. -or- The number of elements in arguments does not equal the number of parameters for the method represented by method. -or- One or more of the elements of arguments is not assignable to the corresponding parameter for the method represented by method. - - - Creates a that represents a call to a method that takes arguments. - An to set the property equal to (pass null for a static (Shared in Visual Basic) method). - A to set the property equal to. - An that contains objects to use to populate the collection. - A that has the property equal to and the , , and properties set to the specified values. - method is null. -or- instance is null and method represents an instance method. - instance.Type is not assignable to the declaring type of the method represented by method. -or- The number of elements in arguments does not equal the number of parameters for the method represented by method. -or- One or more of the elements of arguments is not assignable to the corresponding parameter for the method represented by method. - - - Creates a that represents a call to a static (Shared in Visual Basic) method that has arguments. - A that represents a static (Shared in Visual Basic) method to set the property equal to. - An array of objects to use to populate the collection. - A that has the property equal to and the and properties set to the specified values. - method is null. - The number of elements in arguments does not equal the number of parameters for the method represented by method. -or- One or more of the elements of arguments is not assignable to the corresponding parameter for the method represented by method. - - - Creates a that represents a call to a static (Shared in Visual Basic) method that takes one argument. - A to set the property equal to. - The that represents the first argument. - A that has the property equal to and the and properties set to the specified values. - method is null. - - - Creates a that represents a call to a static (Shared in Visual Basic) method. - The that represents the target method. - A collection of that represents the call arguments. - A that has the property equal to and the and properties set to the specified values. - - - Creates a that represents a call to a method that takes no arguments. - An that specifies the instance for an instance method call (pass null for a static (Shared in Visual Basic) method). - A to set the property equal to. - A that has the property equal to and the and properties set to the specified values. - method is null. -or- instance is null and method represents an instance method. - instance.Type is not assignable to the declaring type of the method represented by method. - - - Creates a that represents a call to a static method that takes two arguments. - A to set the property equal to. - The that represents the first argument. - The that represents the second argument. - A that has the property equal to and the and properties set to the specified values. - method is null. - - - Indicates that the node can be reduced to a simpler node. If this returns true, Reduce() can be called to produce the reduced form. - True if the node can be reduced, otherwise false. - - - Creates a representing a catch statement with a reference to the caught object for use in the handler body. - A representing a reference to the object caught by this handler. - The body of the catch statement. - The created . - - - Creates a representing a catch statement. - The of this will handle. - The body of the catch statement. - The created . - - - Creates a representing a catch statement with an filter and a reference to the caught object. - A representing a reference to the object caught by this handler. - The body of the catch statement. - The body of the filter. - The created . - - - Creates a representing a catch statement with an filter but no reference to the caught object. - The of this will handle. - The body of the catch statement. - The body of the filter. - The created . - - - Creates a for clearing a sequence point. - The that represents the source file. - An instance of for clearning a sequence point. - - - Creates a that represents a coalescing operation, given a conversion function. - An to set the property equal to. - An to set the property equal to. - A to set the property equal to. - A that has the property equal to and the , and properties set to the specified values. - left or right is null. - left.Type and right.Type are not convertible to each other. -or- conversion is not null and conversion.Type is a delegate type that does not take exactly one argument. - The property of left does not represent a reference type or a nullable value type. -or- The property of left represents a type that is not assignable to the parameter type of the delegate type conversion.Type. -or- The property of right is not equal to the return type of the delegate type conversion.Type. - - - Creates a that represents a coalescing operation. - An to set the property equal to. - An to set the property equal to. - A that has the property equal to and the and properties set to the specified values. - left or right is null. - The property of left does not represent a reference type or a nullable value type. - left.Type and right.Type are not convertible to each other. - - - Creates a that represents a conditional statement. - An to set the property equal to. - An to set the property equal to. - An to set the property equal to. - A that has the property equal to and the , , and properties set to the specified values. - test or ifTrue or ifFalse is null. - test.Type is not . -or- ifTrue.Type is not equal to ifFalse.Type. - - - Creates a that represents a conditional statement. - An to set the property equal to. - An to set the property equal to. - An to set the property equal to. - A to set the property equal to. - A that has the property equal to and the , , and properties set to the specified values. - - - Creates a that has the property set to the specified value. - An to set the property equal to. - A that has the property equal to and the property set to the specified value. - - - Creates a that has the and properties set to the specified values. - An to set the property equal to. - A to set the property equal to. - A that has the property equal to and the and properties set to the specified values. - type is null. - value is not null and type is not assignable from the dynamic type of value. - - - Creates a representing a continue statement. - The that the will jump to. - A with equal to Continue, the property set to target, and a null value to be passed to the target label upon jumping. - - - Creates a representing a continue statement with the specified type. - The that the will jump to. - An to set the property equal to. - A with equal to Continue, the property set to target, the property set to type, and a null value to be passed to the target label upon jumping. - - - Creates a that represents a type conversion operation. - An to set the property equal to. - A to set the property equal to. - A that has the property equal to and the and properties set to the specified values. - expression or type is null. - No conversion operator is defined between expression.Type and type. - - - Creates a that represents a conversion operation for which the implementing method is specified. - An to set the property equal to. - A to set the property equal to. - A to set the property equal to. - A that has the property equal to and the , , and properties set to the specified values. - expression or type is null. - method is not null and the method it represents returns void, is not static (Shared in Visual Basic), or does not take exactly one argument. - No conversion operator is defined between expression.Type and type. -or- expression.Type is not assignable to the argument type of the method represented by method. -or- The return type of the method represented by method is not assignable to type. -or- expression.Type or type is a nullable value type and the corresponding non-nullable value type does not equal the argument type or the return type, respectively, of the method represented by method. - More than one method that matches the method description was found. - - - Creates a that represents a conversion operation that throws an exception if the target type is overflowed. - An to set the property equal to. - A to set the property equal to. - A that has the property equal to and the and properties set to the specified values. - expression or type is null. - No conversion operator is defined between expression.Type and type. - - - Creates a that represents a conversion operation that throws an exception if the target type is overflowed and for which the implementing method is specified. - An to set the property equal to. - A to set the property equal to. - A to set the property equal to. - A that has the property equal to and the , , and properties set to the specified values. - expression or type is null. - method is not null and the method it represents returns void, is not static (Shared in Visual Basic), or does not take exactly one argument. - No conversion operator is defined between expression.Type and type. -or- expression.Type is not assignable to the argument type of the method represented by method. -or- The return type of the method represented by method is not assignable to type. -or- expression.Type or type is a nullable value type and the corresponding non-nullable value type does not equal the argument type or the return type, respectively, of the method represented by method. - More than one method that matches the method description was found. - - - Creates a with the specified span. - The that represents the source file. - The start line of this . Must be greater than 0. - The start column of this . Must be greater than 0. - The end line of this . Must be greater or equal than the start line. - The end column of this . If the end line is the same as the start line, it must be greater or equal than the start column. In any case, must be greater than 0. - An instance of . - - - Creates a that represents the decrementing of the expression by 1. - An to decrement. - A that represents the decremented expression. - - - Creates a that represents the decrementing of the expression by 1. - An to decrement. - A that represents the implementing method. - A that represents the decremented expression. - - - Creates a that has the property set to the specified type. - A to set the property equal to. - A that has the property equal to and the property set to the specified type. - - - Creates a that represents an arithmetic division operation. - An to set the property to. - An to set the property to. - A that has the property equal to and the and properties set to the specified values. - left or right is null. - The division operator is not defined for left.Type and right.Type. - - - Creates a that represents an arithmetic division operation. The implementing method can be specified. - An to set the property equal to. - An to set the property equal to. - A to set the property equal to. - A that has the property equal to and the , , and properties set to the specified values. - left or right is null. - method is not null and the method it represents returns void, is not static (Shared in Visual Basic), or does not take exactly two arguments. - method is null and the division operator is not defined for left.Type and right.Type. - - - Creates a that represents a division assignment operation that does not have overflow checking. - An to set the property equal to. - An to set the property equal to. - A that has the property equal to and the and properties set to the specified values. - - - Creates a that represents a division assignment operation that does not have overflow checking. - An to set the property equal to. - An to set the property equal to. - A to set the property equal to. - A that has the property equal to and the , , and properties set to the specified values. - - - Creates a that represents a division assignment operation that does not have overflow checking. - An to set the property equal to. - An to set the property equal to. - A to set the property equal to. - A to set the property equal to. - A that has the property equal to and the , , , and properties set to the specified values. - - - Creates a that represents a dynamic operation bound by the provided . - The runtime binder for the dynamic operation. - The result type of the dynamic expression. - The first argument to the dynamic operation. - The second argument to the dynamic operation. - The third argument to the dynamic operation. - The fourth argument to the dynamic operation. - A that has equal to and has the and set to the specified values. - - - Creates a that represents a dynamic operation bound by the provided . - The runtime binder for the dynamic operation. - The result type of the dynamic expression. - The first argument to the dynamic operation. - The second argument to the dynamic operation. - A that has equal to and has the and set to the specified values. - - - Creates a that represents a dynamic operation bound by the provided . - The runtime binder for the dynamic operation. - The result type of the dynamic expression. - The first argument to the dynamic operation. - The second argument to the dynamic operation. - The third argument to the dynamic operation. - A that has equal to and has the and set to the specified values. - - - Creates a that represents a dynamic operation bound by the provided . - The runtime binder for the dynamic operation. - The result type of the dynamic expression. - The first argument to the dynamic operation. - A that has equal to and has the and set to the specified values. - - - Creates a that represents a dynamic operation bound by the provided . - The runtime binder for the dynamic operation. - The result type of the dynamic expression. - The arguments to the dynamic operation. - A that has equal to and has the and set to the specified values. - - - Creates a that represents a dynamic operation bound by the provided . - The runtime binder for the dynamic operation. - The result type of the dynamic expression. - The arguments to the dynamic operation. - A that has equal to and has the and set to the specified values. - - - Creates an , given an as the second argument. - A to set the property equal to. - An that contains objects to set the property equal to. - An that has the and properties set to the specified values. - addMethod or arguments is null. - The method that addMethod represents is not named "Add" (case insensitive). -or- The method that addMethod represents is not an instance method. -or- arguments does not contain the same number of elements as the number of parameters for the method that addMethod represents. -or- The property of one or more elements of arguments is not assignable to the type of the corresponding parameter of the method that addMethod represents. - - - Creates an , given an array of values as the second argument. - A to set the property equal to. - An array of objects to set the property equal to. - An that has the and properties set to the specified values. - addMethod or arguments is null. - The method that addMethod represents is not named "Add" (case insensitive). -or- The method that addMethod represents is not an instance method. -or- arguments does not contain the same number of elements as the number of parameters for the method that addMethod represents. -or- The property of one or more elements of arguments is not assignable to the type of the corresponding parameter of the method that addMethod represents. - - - Creates an empty expression that has type. - A that has the property equal to and the property set to . - - - Creates a that represents an equality comparison. - An to set the property equal to. - An to set the property equal to. - A that has the property equal to and the and properties set to the specified values. - left or right is null. - The equality operator is not defined for left.Type and right.Type. - - - Creates a that represents an equality comparison. The implementing method can be specified. - An to set the property equal to. - An to set the property equal to. - true to set to true; false to set to false. - A to set the property equal to. - A that has the property equal to and the , , , and properties set to the specified values. - left or right is null. - method is not null and the method it represents returns void, is not static (Shared in Visual Basic), or does not take exactly two arguments. - method is null and the equality operator is not defined for left.Type and right.Type. - - - Creates a that represents a bitwise XOR operation, using op_ExclusiveOr for user-defined types. The implementing method can be specified. - An to set the property equal to. - An to set the property equal to. - A to set the property equal to. - A that has the property equal to and the , , and properties set to the specified values. - left or right is null. - method is not null and the method it represents returns void, is not static (Shared in Visual Basic), or does not take exactly two arguments. - method is null and the XOR operator is not defined for left.Type and right.Type. - - - Creates a that represents a bitwise XOR operation, using op_ExclusiveOr for user-defined types. - An to set the property equal to. - An to set the property equal to. - A that has the property equal to and the and properties set to the specified values. - left or right is null. - The XOR operator is not defined for left.Type and right.Type. - - - Creates a that represents a bitwise XOR assignment operation, using op_ExclusiveOr for user-defined types. - An to set the property equal to. - An to set the property equal to. - A to set the property equal to. - A to set the property equal to. - A that has the property equal to and the , , , and properties set to the specified values. - - - Creates a that represents a bitwise XOR assignment operation, using op_ExclusiveOr for user-defined types. - An to set the property equal to. - An to set the property equal to. - A to set the property equal to. - A that has the property equal to and the , , and properties set to the specified values. - - - Creates a that represents a bitwise XOR assignment operation, using op_ExclusiveOr for user-defined types. - An to set the property equal to. - An to set the property equal to. - A that has the property equal to and the and properties set to the specified values. - - - Creates a that represents accessing a field. - An to set the property equal to. For static (Shared in Visual Basic), expression must be null. - The to set the property equal to. - A that has the property equal to and the and properties set to the specified values. - field is null. -or- The field represented by field is not static (Shared in Visual Basic) and expression is null. - expression.Type is not assignable to the declaring type of the field represented by field. - - - Creates a that represents accessing a field given the name of the field. - An whose contains a field named fieldName. This can be null for static fields. - The name of a field to be accessed. - A that has the property equal to , the property set to expression, and the property set to the that represents the field denoted by fieldName. - expression or fieldName is null. - No field named fieldName is defined in expression.Type or its base types. - - - Creates a that represents accessing a field. - The containing object of the field. This can be null for static fields. - The that contains the field. - The field to be accessed. - The created . - - - Creates a object that represents a generic System.Action delegate type that has specific type arguments. - An array of up to sixteen objects that specify the type arguments for the System.Action delegate type. - The type of a System.Action delegate that has the specified type arguments. - typeArgs contains more than sixteen elements. - typeArgs is null. - - - Gets a object that represents a generic System.Func or System.Action delegate type that has specific type arguments. - The type arguments of the delegate. - The delegate type. - - - Creates a object that represents a generic System.Func delegate type that has specific type arguments. The last type argument specifies the return type of the created delegate. - An array of one to seventeen objects that specify the type arguments for the System.Func delegate type. - The type of a System.Func delegate that has the specified type arguments. - typeArgs contains fewer than one or more than seventeen elements. - typeArgs is null. - - - Creates a representing a "go to" statement with the specified type. The value passed to the label upon jumping can be specified. - The that the will jump to. - The value that will be passed to the associated label upon jumping. - An to set the property equal to. - A with equal to Goto, the property set to target, the property set to type, and value to be passed to the target label upon jumping. - - - Creates a representing a "go to" statement with the specified type. - The that the will jump to. - An to set the property equal to. - A with equal to Goto, the property set to the specified value, the property set to type, and a null value to be passed to the target label upon jumping. - - - Creates a representing a "go to" statement. - The that the will jump to. - A with equal to Goto, the property set to the specified value, and a null value to be passed to the target label upon jumping. - - - Creates a representing a "go to" statement. The value passed to the label upon jumping can be specified. - The that the will jump to. - The value that will be passed to the associated label upon jumping. - A with equal to Goto, the property set to target, and value to be passed to the target label upon jumping. - - - Creates a that represents a "greater than" numeric comparison. - An to set the property equal to. - An to set the property equal to. - A that has the property equal to and the and properties set to the specified values. - left or right is null. - The "greater than" operator is not defined for left.Type and right.Type. - - - Creates a that represents a "greater than" numeric comparison. The implementing method can be specified. - An to set the property equal to. - An to set the property equal to. - true to set to true; false to set to false. - A to set the property equal to. - A that has the property equal to and the , , , and properties set to the specified values. - left or right is null. - method is not null and the method it represents returns void, is not static (Shared in Visual Basic), or does not take exactly two arguments. - method is null and the "greater than" operator is not defined for left.Type and right.Type. - - - Creates a that represents a "greater than or equal" numeric comparison. - An to set the property equal to. - An to set the property equal to. - A that has the property equal to and the and properties set to the specified values. - left or right is null. - The "greater than or equal" operator is not defined for left.Type and right.Type. - - - Creates a that represents a "greater than or equal" numeric comparison. - An to set the property equal to. - An to set the property equal to. - true to set to true; false to set to false. - A to set the property equal to. - A that has the property equal to and the , , , and properties set to the specified values. - left or right is null. - method is not null and the method it represents returns void, is not static (Shared in Visual Basic), or does not take exactly two arguments. - method is null and the "greater than or equal" operator is not defined for left.Type and right.Type. - - - Creates a that represents a conditional block with an if statement. - An to set the property equal to. - An to set the property equal to. - A that has the property equal to and the , , properties set to the specified values. The property is set to default expression and the type of the resulting returned by this method is . - - - Creates a that represents a conditional block with if and else statements. - An to set the property equal to. - An to set the property equal to. - An to set the property equal to. - A that has the property equal to and the , , and properties set to the specified values. The type of the resulting returned by this method is . - - - Creates a that represents the incrementing of the expression by 1. - An to increment. - A that represents the implementing method. - A that represents the incremented expression. - - - Creates a that represents the incrementing of the expression value by 1. - An to increment. - A that represents the incremented expression. - - - Creates an that applies a delegate or lambda expression to a list of argument expressions. - An that represents the delegate or lambda expression to be applied. - An array of objects that represent the arguments that the delegate or lambda expression is applied to. - An that applies the specified delegate or lambda expression to the provided arguments. - expression is null. - expression.Type does not represent a delegate type or an . -or- The property of an element of arguments is not assignable to the type of the corresponding parameter of the delegate represented by expression. - arguments does not contain the same number of elements as the list of parameters for the delegate represented by expression. - - - Creates an that applies a delegate or lambda expression to a list of argument expressions. - An that represents the delegate or lambda expression to be applied to. - An that contains objects that represent the arguments that the delegate or lambda expression is applied to. - An that applies the specified delegate or lambda expression to the provided arguments. - expression is null. - expression.Type does not represent a delegate type or an . -or- The property of an element of arguments is not assignable to the type of the corresponding parameter of the delegate represented by expression. - arguments does not contain the same number of elements as the list of parameters for the delegate represented by expression. - - - Returns whether the expression evaluates to false. - An to evaluate. - An instance of . - - - Returns whether the expression evaluates to false. - An to evaluate. - A that represents the implementing method. - An instance of . - - - Returns whether the expression evaluates to true. - An to evaluate. - An instance of . - - - Returns whether the expression evaluates to true. - An to evaluate. - A that represents the implementing method. - An instance of . - - - Creates a representing a label with void type and no name. - The new . - - - Creates a representing a label without a default value. - The which this will be associated with. - A without a default value. - - - Creates a representing a label with void type and the given name. - The name of the label. - The new . - - - Creates a representing a label with the given type. - The type of value that is passed when jumping to the label. - The new . - - - Creates a representing a label with the given default value. - The which this will be associated with. - The value of this when the label is reached through regular control flow. - A with the given default value. - - - Creates a representing a label with the given type and name. - The type of value that is passed when jumping to the label. - The name of the label. - The new . - - - Creates a LambdaExpression by first constructing a delegate type. - A representing the delegate signature for the lambda. - An to set the property equal to. - The name for the lambda. Used for emitting debug information. - A that indicates if tail call optimization will be applied when compiling the created expression. - An that contains objects to use to populate the collection. - A that has the property equal to Lambda and the and properties set to the specified values. - - - Creates a LambdaExpression by first constructing a delegate type. - A representing the delegate signature for the lambda. - An to set the property equal to. - The name for the lambda. Used for emitting debug information. - An that contains objects to use to populate the collection. - A that has the property equal to Lambda and the and properties set to the specified values. - - - Creates a LambdaExpression by first constructing a delegate type. - A representing the delegate signature for the lambda. - An to set the property equal to. - A that indicates if tail call optimization will be applied when compiling the created expression. - An that contains objects to use to populate the collection. - A that has the property equal to Lambda and the and properties set to the specified values. - - - Creates a LambdaExpression by first constructing a delegate type. - An to set the property equal to. - The name for the lambda. Used for emitting debug information. - A that indicates if tail call optimization will be applied when compiling the created expression. - An that contains objects to use to populate the collection. - A that has the property equal to Lambda and the and properties set to the specified values. - - - Creates a by first constructing a delegate type. It can be used when the delegate type is not known at compile time. - A that represents a delegate signature for the lambda. - An to set the property equal to. - An array of objects to use to populate the collection. - An object that represents a lambda expression which has the property equal to and the and properties set to the specified values. - delegateType or body is null. -or- One or more elements in parameters are null. - delegateType does not represent a delegate type. -or- body.Type represents a type that is not assignable to the return type of the delegate type represented by delegateType. -or- parameters does not contain the same number of elements as the list of parameters for the delegate type represented by delegateType. -or- The property of an element of parameters is not assignable from the type of the corresponding parameter type of the delegate type represented by delegateType. - - - Creates a LambdaExpression by first constructing a delegate type. - A representing the delegate signature for the lambda. - An to set the property equal to. - A that indicates if tail call optimization will be applied when compiling the created expression. - An array that contains objects to use to populate the collection. - A that has the property equal to Lambda and the and properties set to the specified values. - - - Creates a LambdaExpression by first constructing a delegate type. - An to set the property equal to. - The name for the lambda. Used for emitting debug information. - An that contains objects to use to populate the collection. - A that has the property equal to Lambda and the and properties set to the specified values. - - - Creates a LambdaExpression by first constructing a delegate type. - An to set the property equal to. - A that indicates if tail call optimization will be applied when compiling the created expression. - An array that contains objects to use to populate the collection. - A that has the property equal to Lambda and the and properties set to the specified values. - - - Creates a LambdaExpression by first constructing a delegate type. - An to set the property equal to. - A that indicates if tail call optimization will be applied when compiling the created expression. - An that contains objects to use to populate the collection. - A that has the property equal to Lambda and the and properties set to the specified values. - - - Creates a by first constructing a delegate type. It can be used when the delegate type is not known at compile time. - A that represents a delegate signature for the lambda. - An to set the property equal to. - An that contains objects to use to populate the collection. - An object that represents a lambda expression which has the property equal to and the and properties set to the specified values. - delegateType or body is null. -or- One or more elements in parameters are null. - delegateType does not represent a delegate type. -or- body.Type represents a type that is not assignable to the return type of the delegate type represented by delegateType. -or- parameters does not contain the same number of elements as the list of parameters for the delegate type represented by delegateType. -or- The property of an element of parameters is not assignable from the type of the corresponding parameter type of the delegate type represented by delegateType. - - - Creates a by first constructing a delegate type. - An to set the property equal to. - An array of objects to use to populate the collection. - A that has the property equal to and the and properties set to the specified values. - body is null. -or- One or more elements of parameters are null. - parameters contains more than sixteen elements. - - - Creates a LambdaExpression by first constructing a delegate type. - An to set the property equal to. - An that contains objects to use to populate the collection. - A that has the property equal to Lambda and the and properties set to the specified values. - - - Creates an where the delegate type is known at compile time. - An to set the property equal to. - The name of the lambda. Used for generating debugging information. - An that contains objects to use to populate the collection. - The delegate type. - An that has the property equal to and the and properties set to the specified values. - - - Creates an where the delegate type is known at compile time. - An to set the property equal to. - A that indicates if tail call optimization will be applied when compiling the created expression. - An array that contains objects to use to populate the collection. - The delegate type. - An that has the property equal to and the and properties set to the specified values. - - - Creates an where the delegate type is known at compile time. - An to set the property equal to. - The name of the lambda. Used for generating debugging info. - A that indicates if tail call optimization will be applied when compiling the created expression. - An that contains objects to use to populate the collection. - The delegate type. - An that has the property equal to and the and properties set to the specified values. - - - Creates an where the delegate type is known at compile time. - An to set the property equal to. - An array of objects to use to populate the collection. - A delegate type. - An that has the property equal to and the and properties set to the specified values. - body is null. -or- One or more elements in parameters are null. - TDelegate is not a delegate type. -or- body.Type represents a type that is not assignable to the return type of TDelegate. -or- parameters does not contain the same number of elements as the list of parameters for TDelegate. -or- The property of an element of parameters is not assignable from the type of the corresponding parameter type of TDelegate. - - - Creates an where the delegate type is known at compile time. - An to set the property equal to. - An that contains objects to use to populate the collection. - A delegate type. - An that has the property equal to and the and properties set to the specified values. - body is null. -or- One or more elements in parameters are null. - TDelegate is not a delegate type. -or- body.Type represents a type that is not assignable to the return type of TDelegate. -or- parameters does not contain the same number of elements as the list of parameters for TDelegate. -or- The property of an element of parameters is not assignable from the type of the corresponding parameter type of TDelegate. - - - Creates an where the delegate type is known at compile time. - An to set the property equal to. - A that indicates if tail call optimization will be applied when compiling the created expression. - An that contains objects to use to populate the collection. - The delegate type. - An that has the property equal to and the and properties set to the specified values. - - - Creates a that represents a bitwise left-shift operation. - An to set the property equal to. - An to set the property equal to. - A that has the property equal to and the and properties set to the specified values. - left or right is null. - The left-shift operator is not defined for left.Type and right.Type. - - - Creates a that represents a bitwise left-shift operation. - An to set the property equal to. - An to set the property equal to. - A to set the property equal to. - A that has the property equal to and the , , and properties set to the specified values. - left or right is null. - method is not null and the method it represents returns void, is not static (Shared in Visual Basic), or does not take exactly two arguments. - method is null and the left-shift operator is not defined for left.Type and right.Type. - - - Creates a that represents a bitwise left-shift assignment operation. - An to set the property equal to. - An to set the property equal to. - A that has the property equal to and the and properties set to the specified values. - - - Creates a that represents a bitwise left-shift assignment operation. - An to set the property equal to. - An to set the property equal to. - A to set the property equal to. - A that has the property equal to and the , , and properties set to the specified values. - - - Creates a that represents a bitwise left-shift assignment operation. - An to set the property equal to. - An to set the property equal to. - A to set the property equal to. - A to set the property equal to. - A that has the property equal to and the , , , and properties set to the specified values. - - - Creates a that represents a "less than" numeric comparison. - An to set the property equal to. - An to set the property equal to. - A that has the property equal to and the and properties set to the specified values. - left or right is null. - The "less than" operator is not defined for left.Type and right.Type. - - - Creates a that represents a "less than" numeric comparison. - An to set the property equal to. - An to set the property equal to. - true to set to true; false to set to false. - A to set the property equal to. - A that has the property equal to and the , , , and properties set to the specified values. - left or right is null. - method is not null and the method it represents returns void, is not static (Shared in Visual Basic), or does not take exactly two arguments. - method is null and the "less than" operator is not defined for left.Type and right.Type. - - - Creates a that represents a " less than or equal" numeric comparison. - An to set the property equal to. - An to set the property equal to. - A that has the property equal to and the and properties set to the specified values. - left or right is null. - The "less than or equal" operator is not defined for left.Type and right.Type. - - - Creates a that represents a "less than or equal" numeric comparison. - An to set the property equal to. - An to set the property equal to. - true to set to true; false to set to false. - A to set the property equal to. - A that has the property equal to and the , , , and properties set to the specified values. - left or right is null. - method is not null and the method it represents returns void, is not static (Shared in Visual Basic), or does not take exactly two arguments. - method is null and the "less than or equal" operator is not defined for left.Type and right.Type. - - - Creates a object based on a specified property accessor method. - A that represents a property accessor method. - An array of objects to use to populate the collection. - A that has the property equal to , the property set to the that represents the property accessed in propertyAccessor, and populated with the elements of initializers. - propertyAccessor is null. -or- One or more elements of initializers are null. - propertyAccessor does not represent a property accessor method. -or- The of the property that the method represented by propertyAccessor accesses does not implement . - - - Creates a based on a specified property accessor method. - A that represents a property accessor method. - An that contains objects to use to populate the collection. - A that has the property equal to , the property set to the that represents the property accessed in propertyAccessor, and populated with the elements of initializers. - propertyAccessor is null. -or- One or more elements of initializers are null. - propertyAccessor does not represent a property accessor method. -or- The of the property that the method represented by propertyAccessor accesses does not implement . - - - Creates a where the member is a field or property. - A that represents a field or property to set the property equal to. - An that contains objects to use to populate the collection. - A that has the property equal to and the and properties set to the specified values. - member is null. -or- One or more elements of initializers are null. - member does not represent a field or property. -or- The or of the field or property that member represents does not implement . - - - Creates a where the member is a field or property. - A that represents a field or property to set the property equal to. - An array of objects to use to populate the collection. - A that has the property equal to and the and properties set to the specified values. - member is null. -or- One or more elements of initializers are null. - member does not represent a field or property. -or- The or of the field or property that member represents does not implement . - - - Creates a that uses specified objects to initialize a collection. - A to set the property equal to. - An that contains objects to use to populate the collection. - A that has the property equal to and the and properties set to the specified values. - newExpression or initializers is null. -or- One or more elements of initializers are null. - newExpression.Type does not implement . - - - Creates a that uses a method named "Add" to add elements to a collection. - A to set the property equal to. - An that contains objects to use to populate the collection. - A that has the property equal to and the property set to the specified value. - newExpression or initializers is null. -or- One or more elements of initializers are null. - newExpression.Type does not implement . - There is no instance method named "Add" (case insensitive) declared in newExpression.Type or its base type. -or- The add method on newExpression.Type or its base type does not take exactly one argument. -or- The type represented by the property of the first element of initializers is not assignable to the argument type of the add method on newExpression.Type or its base type. -or- More than one argument-compatible method named "Add" (case-insensitive) exists on newExpression.Type and/or its base type. - - - Creates a that uses specified objects to initialize a collection. - A to set the property equal to. - An array of objects to use to populate the collection. - A that has the property equal to and the and properties set to the specified values. - newExpression or initializers is null. -or- One or more elements of initializers are null. - newExpression.Type does not implement . - - - Creates a that uses a method named "Add" to add elements to a collection. - A to set the property equal to. - An array of objects to use to populate the collection. - A that has the property equal to and the property set to the specified value. - newExpression or initializers is null. -or- One or more elements of initializers are null. - newExpression.Type does not implement . - There is no instance method named "Add" (case insensitive) declared in newExpression.Type or its base type. -or- The add method on newExpression.Type or its base type does not take exactly one argument. -or- The type represented by the property of the first element of initializers is not assignable to the argument type of the add method on newExpression.Type or its base type. -or- More than one argument-compatible method named "Add" (case-insensitive) exists on newExpression.Type and/or its base type. - - - Creates a that uses a specified method to add elements to a collection. - A to set the property equal to. - A that represents an instance method named "Add" (case insensitive), that adds an element to a collection. - An that contains objects to use to populate the collection. - A that has the property equal to and the property set to the specified value. - newExpression or initializers is null. -or- One or more elements of initializers are null. - newExpression.Type does not implement . -or- addMethod is not null and it does not represent an instance method named "Add" (case insensitive) that takes exactly one argument. -or- addMethod is not null and the type represented by the property of one or more elements of initializers is not assignable to the argument type of the method that addMethod represents. - addMethod is null and no instance method named "Add" that takes one type-compatible argument exists on newExpression.Type or its base type. - - - Creates a that uses a specified method to add elements to a collection. - A to set the property equal to. - A that represents an instance method that takes one argument, that adds an element to a collection. - An array of objects to use to populate the collection. - A that has the property equal to and the property set to the specified value. - newExpression or initializers is null. -or- One or more elements of initializers are null. - newExpression.Type does not implement . -or- addMethod is not null and it does not represent an instance method named "Add" (case insensitive) that takes exactly one argument. -or- addMethod is not null and the type represented by the property of one or more elements of initializers is not assignable to the argument type of the method that addMethod represents. - addMethod is null and no instance method named "Add" that takes one type-compatible argument exists on newExpression.Type or its base type. - - - Creates a with the given body. - The body of the loop. - The created . - - - Creates a with the given body and break target. - The body of the loop. - The break target used by the loop body. - The created . - - - Creates a with the given body. - The body of the loop. - The break target used by the loop body. - The continue target used by the loop body. - The created . - - - Creates a , given the left and right operands, by calling an appropriate factory method. - The that specifies the type of binary operation. - An that represents the left operand. - An that represents the right operand. - The that results from calling the appropriate factory method. - binaryType does not correspond to a binary expression node. - left or right is null. - - - Creates a , given the left operand, right operand and implementing method, by calling the appropriate factory method. - The that specifies the type of binary operation. - An that represents the left operand. - An that represents the right operand. - true to set to true; false to set to false. - A that specifies the implementing method. - The that results from calling the appropriate factory method. - binaryType does not correspond to a binary expression node. - left or right is null. - - - Creates a , given the left operand, right operand, implementing method and type conversion function, by calling the appropriate factory method. - The that specifies the type of binary operation. - An that represents the left operand. - An that represents the right operand. - true to set to true; false to set to false. - A that specifies the implementing method. - A that represents a type conversion function. This parameter is used only if binaryType is or compound assignment.. - The that results from calling the appropriate factory method. - binaryType does not correspond to a binary expression node. - left or right is null. - - - Creates a representing a catch statement with the specified elements. - The of this will handle. - A representing a reference to the object caught by this handler. - The body of the catch statement. - The body of the filter. - The created . - - - Creates a that represents a dynamic operation bound by the provided and four arguments. - The type of the delegate used by the . - The runtime binder for the dynamic operation. - The first argument to the dynamic operation. - The second argument to the dynamic operation. - The third argument to the dynamic operation. - The fourth argument to the dynamic operation. - A that has equal to and has the , , and set to the specified values. - - - Creates a that represents a dynamic operation bound by the provided and two arguments. - The type of the delegate used by the . - The runtime binder for the dynamic operation. - The first argument to the dynamic operation. - The second argument to the dynamic operation. - A that has equal to and has the , , and set to the specified values. - - - Creates a that represents a dynamic operation bound by the provided and three arguments. - The type of the delegate used by the . - The runtime binder for the dynamic operation. - The first argument to the dynamic operation. - The second argument to the dynamic operation. - The third argument to the dynamic operation. - A that has equal to and has the , , and set to the specified values. - - - Creates a that represents a dynamic operation bound by the provided and one argument. - The type of the delegate used by the . - The runtime binder for the dynamic operation. - The argument to the dynamic operation. - A that has equal to and has the , , and set to the specified values. - - - Creates a that represents a dynamic operation bound by the provided . - The type of the delegate used by the . - The runtime binder for the dynamic operation. - The arguments to the dynamic operation. - A that has equal to and has the , , and set to the specified values. - - - Creates a that represents a dynamic operation bound by the provided . - The type of the delegate used by the . - The runtime binder for the dynamic operation. - The arguments to the dynamic operation. - A that has equal to and has the , , and set to the specified values. - - - Creates a representing a jump of the specified . The value passed to the label upon jumping can also be specified. - The of the . - The that the will jump to. - The value that will be passed to the associated label upon jumping. - An to set the property equal to. - A with equal to kind, the property set to target, the property set to type, and value to be passed to the target label upon jumping. - - - Creates an that represents accessing an indexed property in an object. - The object to which the property belongs. It should be null if the property is static (shared in Visual Basic). - An representing the property to index. - An IEnumerable (IEnumerable (Of Expression) in Visual Basic) that contains the arguments that will be used to index the property. - The created . - - - Creates a that represents accessing either a field or a property. - An that represents the object that the member belongs to. This can be null for static members. - The that describes the field or property to be accessed. - The that results from calling the appropriate factory method. - member is null. - member does not represent a field or property. - - - Creates a representing a try block with the specified elements. - The result type of the try expression. If null, bodh and all handlers must have identical type. - The body of the try block. - The body of the finally block. Pass null if the try block has no finally block associated with it. - The body of the fault block. Pass null if the try block has no fault block associated with it. - A collection of s representing the catch statements to be associated with the try block. - The created . - - - Creates a , given an operand, by calling the appropriate factory method. - The that specifies the type of unary operation. - An that represents the operand. - The that specifies the type to be converted to (pass null if not applicable). - The that results from calling the appropriate factory method. - operand is null. - unaryType does not correspond to a unary expression node. - - - Creates a , given an operand and implementing method, by calling the appropriate factory method. - The that specifies the type of unary operation. - An that represents the operand. - The that specifies the type to be converted to (pass null if not applicable). - The that represents the implementing method. - The that results from calling the appropriate factory method. - operand is null. - unaryType does not correspond to a unary expression node. - - - Creates a that represents the recursive initialization of members of a member that is accessed by using a property accessor method. - The that represents a property accessor method. - An array of objects to use to populate the collection. - A that has the property equal to , the property set to the that represents the property accessed in propertyAccessor, and properties set to the specified values. - propertyAccessor or bindings is null. - propertyAccessor does not represent a property accessor method. -or- The property of an element of bindings does not represent a member of the type of the property accessed by the method that propertyAccessor represents. - - - Creates a that represents the recursive initialization of members of a member that is accessed by using a property accessor method. - The that represents a property accessor method. - An that contains objects to use to populate the collection. - A that has the property equal to , the property set to the that represents the property accessed in propertyAccessor, and properties set to the specified values. - propertyAccessor or bindings is null. - propertyAccessor does not represent a property accessor method. -or- The property of an element of bindings does not represent a member of the type of the property accessed by the method that propertyAccessor represents. - - - Creates a that represents the recursive initialization of members of a field or property. - The to set the property equal to. - An that contains objects to use to populate the collection. - A that has the property equal to and the and properties set to the specified values. - member or bindings is null. - member does not represent a field or property. -or- The property of an element of bindings does not represent a member of the type of the field or property that member represents. - - - Creates a that represents the recursive initialization of members of a field or property. - The to set the property equal to. - An array of objects to use to populate the collection. - A that has the property equal to and the and properties set to the specified values. - member or bindings is null. - member does not represent a field or property. -or- The property of an element of bindings does not represent a member of the type of the field or property that member represents. - - - Represents an expression that creates a new object and initializes a property of the object. - A to set the property equal to. - An that contains objects to use to populate the collection. - A that has the property equal to and the and properties set to the specified values. - newExpression or bindings is null. - The property of an element of bindings does not represent a member of the type that newExpression.Type represents. - - - Creates a . - A to set the property equal to. - An array of objects to use to populate the collection. - A that has the property equal to and the and properties set to the specified values. - newExpression or bindings is null. - The property of an element of bindings does not represent a member of the type that newExpression.Type represents. - - - Creates a that represents an arithmetic remainder operation. - An to set the property equal to. - An to set the property equal to. - A that has the property equal to and the and properties set to the specified values. - left or right is null. - The modulus operator is not defined for left.Type and right.Type. - - - Creates a that represents an arithmetic remainder operation. - An to set the property equal to. - An to set the property equal to. - A to set the property equal to. - A that has the property equal to and the , , and properties set to the specified values. - left or right is null. - method is not null and the method it represents returns void, is not static (Shared in Visual Basic), or does not take exactly two arguments. - method is null and the modulus operator is not defined for left.Type and right.Type. - - - Creates a that represents a remainder assignment operation. - An to set the property equal to. - An to set the property equal to. - A to set the property equal to. - A that has the property equal to and the , , and properties set to the specified values. - - - Creates a that represents a remainder assignment operation. - An to set the property equal to. - An to set the property equal to. - A that has the property equal to and the and properties set to the specified values. - - - Creates a that represents a remainder assignment operation. - An to set the property equal to. - An to set the property equal to. - A to set the property equal to. - A to set the property equal to. - A that has the property equal to and the , , , and properties set to the specified values. - - - Creates a that represents an arithmetic multiplication operation that does not have overflow checking. - An to set the property equal to. - An to set the property equal to. - A to set the property equal to. - A that has the property equal to and the , , and properties set to the specified values. - left or right is null. - method is not null and the method it represents returns void, is not static (Shared in Visual Basic), or does not take exactly two arguments. - method is null and the multiplication operator is not defined for left.Type and right.Type. - - - Creates a that represents an arithmetic multiplication operation that does not have overflow checking. - An to set the property equal to. - An to set the property equal to. - A that has the property equal to and the and properties set to the specified values. - left or right is null. - The multiplication operator is not defined for left.Type and right.Type. - - - Creates a that represents a multiplication assignment operation that does not have overflow checking. - An to set the property equal to. - An to set the property equal to. - A that has the property equal to and the and properties set to the specified values. - - - Creates a that represents a multiplication assignment operation that does not have overflow checking. - An to set the property equal to. - An to set the property equal to. - A to set the property equal to. - A that has the property equal to and the , , and properties set to the specified values. - - - Creates a that represents a multiplication assignment operation that does not have overflow checking. - An to set the property equal to. - An to set the property equal to. - A to set the property equal to. - A to set the property equal to. - A that has the property equal to and the , , , and properties set to the specified values. - - - Creates a that represents a multiplication assignment operation that has overflow checking. - An to set the property equal to. - An to set the property equal to. - A that has the property equal to and the and properties set to the specified values. - - - Creates a that represents a multiplication assignment operation that has overflow checking. - An to set the property equal to. - An to set the property equal to. - A to set the property equal to. - A that has the property equal to and the , , and properties set to the specified values. - - - Creates a that represents a multiplication assignment operation that has overflow checking. - An to set the property equal to. - An to set the property equal to. - A to set the property equal to. - A to set the property equal to. - A that has the property equal to and the , , , and properties set to the specified values. - - - Creates a that represents an arithmetic multiplication operation that has overflow checking. - An to set the property equal to. - An to set the property equal to. - A that has the property equal to and the and properties set to the specified values. - left or right is null. - The multiplication operator is not defined for left.Type and right.Type. - - - Creates a that represents an arithmetic multiplication operation that has overflow checking. - An to set the property equal to. - An to set the property equal to. - A to set the property equal to. - A that has the property equal to and the , , and properties set to the specified values. - left or right is null. - method is not null and the method it represents returns void, is not static (Shared in Visual Basic), or does not take exactly two arguments. - method is null and the multiplication operator is not defined for left.Type and right.Type. - - - Creates a that represents an arithmetic negation operation. - An to set the property equal to. - A to set the property equal to. - A that has the property equal to and the and properties set to the specified values. - expression is null. - method is not null and the method it represents returns void, is not static (Shared in Visual Basic), or does not take exactly one argument. - method is null and the unary minus operator is not defined for expression.Type. -or- expression.Type (or its corresponding non-nullable type if it is a nullable value type) is not assignable to the argument type of the method represented by method. - - - Creates a that represents an arithmetic negation operation. - An to set the property equal to. - A that has the property equal to and the property set to the specified value. - expression is null. - The unary minus operator is not defined for expression.Type. - - - Creates a that represents an arithmetic negation operation that has overflow checking. - An to set the property equal to. - A that has the property equal to and the property set to the specified value. - expression is null. - The unary minus operator is not defined for expression.Type. - - - Creates a that represents an arithmetic negation operation that has overflow checking. The implementing method can be specified. - An to set the property equal to. - A to set the property equal to. - A that has the property equal to and the and properties set to the specified values. - expression is null. - method is not null and the method it represents returns void, is not static (Shared in Visual Basic), or does not take exactly one argument. - method is null and the unary minus operator is not defined for expression.Type. -or- expression.Type (or its corresponding non-nullable type if it is a nullable value type) is not assignable to the argument type of the method represented by method. - - - Creates a that represents calling the specified constructor that takes no arguments. - The to set the property equal to. - A that has the property equal to and the property set to the specified value. - constructor is null. - The constructor that constructor represents has at least one parameter. - - - Creates a that represents calling the parameterless constructor of the specified type. - A that has a constructor that takes no arguments. - A that has the property equal to and the property set to the that represents the constructor without parameters for the specified type. - type is null. - The type that type represents does not have a constructor without parameters. - - - Creates a that represents calling the specified constructor with the specified arguments. - The to set the property equal to. - An that contains objects to use to populate the collection. - A that has the property equal to and the and properties set to the specified values. - constructor is null. -or- An element of arguments is null. - The arguments parameter does not contain the same number of elements as the number of parameters for the constructor that constructor represents. -or- The property of an element of arguments is not assignable to the type of the corresponding parameter of the constructor that constructor represents. - - - Creates a that represents calling the specified constructor with the specified arguments. - The to set the property equal to. - An array of objects to use to populate the collection. - A that has the property equal to and the and properties set to the specified values. - constructor is null. -or- An element of arguments is null. - The length of arguments does match the number of parameters for the constructor that constructor represents. -or- The property of an element of arguments is not assignable to the type of the corresponding parameter of the constructor that constructor represents. - - - Creates a that represents calling the specified constructor with the specified arguments. The members that access the constructor initialized fields are specified. - The to set the property equal to. - An that contains objects to use to populate the collection. - An that contains objects to use to populate the collection. - A that has the property equal to and the , and properties set to the specified values. - constructor is null. -or- An element of arguments is null. -or- An element of members is null. - The arguments parameter does not contain the same number of elements as the number of parameters for the constructor that constructor represents. -or- The property of an element of arguments is not assignable to the type of the corresponding parameter of the constructor that constructor represents. -or- The members parameter does not have the same number of elements as arguments. -or- An element of arguments has a property that represents a type that is not assignable to the type of the member that is represented by the corresponding element of members. - - - Creates a that represents calling the specified constructor with the specified arguments. The members that access the constructor initialized fields are specified as an array. - The to set the property equal to. - An that contains objects to use to populate the collection. - An array of objects to use to populate the collection. - A that has the property equal to and the , and properties set to the specified values. - constructor is null. -or- An element of arguments is null. -or- An element of members is null. - The arguments parameter does not contain the same number of elements as the number of parameters for the constructor that constructor represents. -or- The property of an element of arguments is not assignable to the type of the corresponding parameter of the constructor that constructor represents. -or- The members parameter does not have the same number of elements as arguments. -or- An element of arguments has a property that represents a type that is not assignable to the type of the member that is represented by the corresponding element of members. - - - Creates a that represents creating an array that has a specified rank. - A that represents the element type of the array. - An array of objects to use to populate the collection. - A that has the property equal to and the property set to the specified value. - type or bounds is null. -or- An element of bounds is null. - The property of an element of bounds does not represent an integral type. - - - Creates a that represents creating an array that has a specified rank. - A that represents the element type of the array. - An that contains objects to use to populate the collection. - A that has the property equal to and the property set to the specified value. - type or bounds is null. -or- An element of bounds is null. - The property of an element of bounds does not represent an integral type. - - - Creates a that represents creating a one-dimensional array and initializing it from a list of elements. - A that represents the element type of the array. - An that contains objects to use to populate the collection. - A that has the property equal to and the property set to the specified value. - type or initializers is null. -or- An element of initializers is null. - The property of an element of initializers represents a type that is not assignable to the type that type represents. - - - Creates a that represents creating a one-dimensional array and initializing it from a list of elements. - A that represents the element type of the array. - An array of objects to use to populate the collection. - A that has the property equal to and the property set to the specified value. - type or initializers is null. -or- An element of initializers is null. - The property of an element of initializers represents a type that is not assignable to the type type. - - - Gets the node type of this . - One of the values. - - - Creates a that represents a bitwise complement operation. - An to set the property equal to. - A that has the property equal to and the property set to the specified value. - expression is null. - The unary not operator is not defined for expression.Type. - - - Creates a that represents a bitwise complement operation. The implementing method can be specified. - An to set the property equal to. - A to set the property equal to. - A that has the property equal to and the and properties set to the specified values. - expression is null. - method is not null and the method it represents returns void, is not static (Shared in Visual Basic), or does not take exactly one argument. - method is null and the unary not operator is not defined for expression.Type. -or- expression.Type (or its corresponding non-nullable type if it is a nullable value type) is not assignable to the argument type of the method represented by method. - - - Creates a that represents an inequality comparison. - An to set the property equal to. - An to set the property equal to. - A that has the property equal to and the and properties set to the specified values. - left or right is null. - The inequality operator is not defined for left.Type and right.Type. - - - Creates a that represents an inequality comparison. - An to set the property equal to. - An to set the property equal to. - true to set to true; false to set to false. - A to set the property equal to. - A that has the property equal to and the , , , and properties set to the specified values. - left or right is null. - method is not null and the method it represents returns void, is not static (Shared in Visual Basic), or does not take exactly two arguments. - method is null and the inequality operator is not defined for left.Type and right.Type. - - - Returns the expression representing the ones complement. - An . - An instance of . - - - Returns the expression representing the ones complement. - An . - A that represents the implementing method. - An instance of . - - - Creates a that represents a bitwise OR operation. - An to set the property equal to. - An to set the property equal to. - A that has the property equal to and the and properties set to the specified values. - left or right is null. - The bitwise OR operator is not defined for left.Type and right.Type. - - - Creates a that represents a bitwise OR operation. - An to set the property equal to. - An to set the property equal to. - A to set the property equal to. - A that has the property equal to and the , , and properties set to the specified values. - left or right is null. - method is not null and the method it represents returns void, is not static (Shared in Visual Basic), or does not take exactly two arguments. - method is null and the bitwise OR operator is not defined for left.Type and right.Type. - - - Creates a that represents a bitwise OR assignment operation. - An to set the property equal to. - An to set the property equal to. - A that has the property equal to and the and properties set to the specified values. - - - Creates a that represents a bitwise OR assignment operation. - An to set the property equal to. - An to set the property equal to. - A to set the property equal to. - A that has the property equal to and the , , and properties set to the specified values. - - - Creates a that represents a bitwise OR assignment operation. - An to set the property equal to. - An to set the property equal to. - A to set the property equal to. - A to set the property equal to. - A that has the property equal to and the , , , and properties set to the specified values. - - - Creates a that represents a conditional OR operation that evaluates the second operand only if the first operand evaluates to false. - An to set the property equal to. - An to set the property equal to. - A that has the property equal to and the and properties set to the specified values. - left or right is null. - The bitwise OR operator is not defined for left.Type and right.Type. -or- left.Type and right.Type are not the same Boolean type. - - - Creates a that represents a conditional OR operation that evaluates the second operand only if the first operand evaluates to false. - An to set the property equal to. - An to set the property equal to. - A to set the property equal to. - A that has the property equal to and the , , and properties set to the specified values. - left or right is null. - method is not null and the method it represents returns void, is not static (Shared in Visual Basic), or does not take exactly two arguments. - method is null and the bitwise OR operator is not defined for left.Type and right.Type. -or- method is null and left.Type and right.Type are not the same Boolean type. - - - Creates a node that can be used to identify a parameter or a variable in an expression tree. - The type of the parameter or variable. - The name of the parameter or variable, used for debugging or printing purpose only. - A that has the property equal to and the and properties set to the specified values. - type is null. - - - Creates a node that can be used to identify a parameter or a variable in an expression tree. - The type of the parameter or variable. - A node with the specified name and type. - - - Creates a that represents the assignment of the expression followed by a subsequent decrement by 1 of the original expression. - An to apply the operations on. - A that represents the implementing method. - A that represents the resultant expression. - - - Creates a that represents the assignment of the expression followed by a subsequent decrement by 1 of the original expression. - An to apply the operations on. - A that represents the resultant expression. - - - Creates a that represents the assignment of the expression followed by a subsequent increment by 1 of the original expression. - An to apply the operations on. - A that represents the resultant expression. - - - Creates a that represents the assignment of the expression followed by a subsequent increment by 1 of the original expression. - An to apply the operations on. - A that represents the implementing method. - A that represents the resultant expression. - - - Creates a that represents raising a number to a power. - An to set the property equal to. - An to set the property equal to. - A that has the property equal to and the and properties set to the specified values. - left or right is null. - The exponentiation operator is not defined for left.Type and right.Type. -or- left.Type and/or right.Type are not . - - - Creates a that represents raising a number to a power. - An to set the property equal to. - An to set the property equal to. - A to set the property equal to. - A that has the property equal to and the , , and properties set to the specified values. - left or right is null. - method is not null and the method it represents returns void, is not static (Shared in Visual Basic), or does not take exactly two arguments. - method is null and the exponentiation operator is not defined for left.Type and right.Type. -or- method is null and left.Type and/or right.Type are not . - - - Creates a that represents raising an expression to a power and assigning the result back to the expression. - An to set the property equal to. - An to set the property equal to. - A that has the property equal to and the and properties set to the specified values. - - - Creates a that represents raising an expression to a power and assigning the result back to the expression. - An to set the property equal to. - An to set the property equal to. - A to set the property equal to. - A that has the property equal to and the , , and properties set to the specified values. - - - Creates a that represents raising an expression to a power and assigning the result back to the expression. - An to set the property equal to. - An to set the property equal to. - A to set the property equal to. - A to set the property equal to. - A that has the property equal to and the , , , and properties set to the specified values. - - - Creates a that decrements the expression by 1 and assigns the result back to the expression. - An to apply the operations on. - A that represents the resultant expression. - - - Creates a that decrements the expression by 1 and assigns the result back to the expression. - An to apply the operations on. - A that represents the implementing method. - A that represents the resultant expression. - - - Creates a that increments the expression by 1 and assigns the result back to the expression. - An to apply the operations on. - A that represents the resultant expression. - - - Creates a that increments the expression by 1 and assigns the result back to the expression. - An to apply the operations on. - A that represents the implementing method. - A that represents the resultant expression. - - - Creates an representing the access to an indexed property. - The object to which the property belongs. If the property is static/shared, it must be null. - The name of the indexer. - An array of objects that are used to index the property. - The created . - - - Creates an representing the access to an indexed property. - The object to which the property belongs. If the property is static/shared, it must be null. - The that represents the property to index. - An array of objects that are used to index the property. - The created . - - - Creates an representing the access to an indexed property. - The object to which the property belongs. If the property is static/shared, it must be null. - The that represents the property to index. - An of objects that are used to index the property. - The created . - - - Creates a accessing a property. - The containing object of the property. This can be null for static properties. - The that contains the property. - The property to be accessed. - The created . - - - Creates a that represents accessing a property. - An to set the property equal to. This can be null for static properties. - The to set the property equal to. - A that has the property equal to and the and properties set to the specified values. - property is null. -or- The property that property represents is not static (Shared in Visual Basic) and expression is null. - expression.Type is not assignable to the declaring type of the property that property represents. - - - Creates a that represents accessing a property by using a property accessor method. - An to set the property equal to. This can be null for static properties. - The that represents a property accessor method. - A that has the property equal to , the property set to expression and the property set to the that represents the property accessed in propertyAccessor. - propertyAccessor is null. -or- The method that propertyAccessor represents is not static (Shared in Visual Basic) and expression is null. - expression.Type is not assignable to the declaring type of the method represented by propertyAccessor. -or- The method that propertyAccessor represents is not a property accessor method. - - - Creates a that represents accessing a property. - An whose contains a property named propertyName. This can be null for static properties. - The name of a property to be accessed. - A that has the property equal to , the property set to expression, and the property set to the that represents the property denoted by propertyName. - expression or propertyName is null. - No property named propertyName is defined in expression.Type or its base types. - - - Creates a that represents accessing a property or field. - An whose contains a property or field named propertyOrFieldName. This can be null for static members. - The name of a property or field to be accessed. - A that has the property equal to , the property set to expression, and the property set to the or that represents the property or field denoted by propertyOrFieldName. - expression or propertyOrFieldName is null. - No property or field named propertyOrFieldName is defined in expression.Type or its base types. - - - Creates a that represents an expression that has a constant value of type . - An to set the property equal to. - A that has the property equal to and the property set to the specified value. - expression is null. - - - Reduces this node to a simpler expression. If CanReduce returns true, this should return a valid expression. This method can return another node which itself must be reduced. - The reduced expression. - - - Reduces this node to a simpler expression. If CanReduce returns true, this should return a valid expression. This method can return another node which itself must be reduced. - The reduced expression. - - - Reduces the expression to a known node type (that is not an Extension node) or just returns the expression if it is already a known type. - The reduced expression. - - - Creates a that represents a reference equality comparison. - An to set the property equal to. - An to set the property equal to. - A that has the property equal to and the and properties set to the specified values. - - - Creates a that represents a reference inequality comparison. - An to set the property equal to. - An to set the property equal to. - A that has the property equal to and the and properties set to the specified values. - - - Creates a that represents a rethrowing of an exception with a given type. - The new of the expression. - A that represents a rethrowing of an exception. - - - Creates a that represents a rethrowing of an exception. - A that represents a rethrowing of an exception. - - - Creates a representing a return statement. - The that the will jump to. - A with equal to Return, the property set to target, and a null value to be passed to the target label upon jumping. - - - Creates a representing a return statement. The value passed to the label upon jumping can be specified. - The that the will jump to. - The value that will be passed to the associated label upon jumping. - A with equal to Continue, the property set to target, and value to be passed to the target label upon jumping. - - - Creates a representing a return statement with the specified type. - The that the will jump to. - An to set the property equal to. - A with equal to Return, the property set to target, the property set to type, and a null value to be passed to the target label upon jumping. - - - Creates a representing a return statement with the specified type. The value passed to the label upon jumping can be specified. - The that the will jump to. - The value that will be passed to the associated label upon jumping. - An to set the property equal to. - A with equal to Continue, the property set to target, the property set to type, and value to be passed to the target label upon jumping. - - - Creates a that represents a bitwise right-shift operation. - An to set the property equal to. - An to set the property equal to. - A that has the property equal to and the and properties set to the specified values. - left or right is null. - The right-shift operator is not defined for left.Type and right.Type. - - - Creates a that represents a bitwise right-shift operation. - An to set the property equal to. - An to set the property equal to. - A to set the property equal to. - A that has the property equal to and the , , and properties set to the specified values. - left or right is null. - method is not null and the method it represents returns void, is not static (Shared in Visual Basic), or does not take exactly two arguments. - method is null and the right-shift operator is not defined for left.Type and right.Type. - - - Creates a that represents a bitwise right-shift assignment operation. - An to set the property equal to. - An to set the property equal to. - A that has the property equal to and the and properties set to the specified values. - - - Creates a that represents a bitwise right-shift assignment operation. - An to set the property equal to. - An to set the property equal to. - A to set the property equal to. - A that has the property equal to and the , , and properties set to the specified values. - - - Creates a that represents a bitwise right-shift assignment operation. - An to set the property equal to. - An to set the property equal to. - A to set the property equal to. - A to set the property equal to. - A that has the property equal to and the , , , and properties set to the specified values. - - - Creates an instance of . - An array of objects to use to populate the collection. - An instance of that has the property equal to and the property set to the specified value. - - - Creates an instance of . - A collection of objects to use to populate the collection. - An instance of that has the property equal to and the property set to the specified value. - - - Creates a that represents an arithmetic subtraction operation that does not have overflow checking. - An to set the property equal to. - A to set the property equal to. - A that has the property equal to and the and properties set to the specified values. - left or right is null. - The subtraction operator is not defined for left.Type and right.Type. - - - Creates a that represents an arithmetic subtraction operation that does not have overflow checking. - A to set the property equal to. - A to set the property equal to. - A to set the property equal to. - A that has the property equal to and the , , and properties set to the specified values. - left or right is null. - method is not null and the method it represents returns void, is not static (Shared in Visual Basic), or does not take exactly two arguments. - method is null and the subtraction operator is not defined for left.Type and right.Type. - - - Creates a that represents a subtraction assignment operation that does not have overflow checking. - An to set the property equal to. - An to set the property equal to. - A that has the property equal to and the and properties set to the specified values. - - - Creates a that represents a subtraction assignment operation that does not have overflow checking. - An to set the property equal to. - An to set the property equal to. - A to set the property equal to. - A that has the property equal to and the , , and properties set to the specified values. - - - Creates a that represents a subtraction assignment operation that does not have overflow checking. - An to set the property equal to. - An to set the property equal to. - A to set the property equal to. - A to set the property equal to. - A that has the property equal to and the , , , and properties set to the specified values. - - - Creates a that represents a subtraction assignment operation that has overflow checking. - An to set the property equal to. - An to set the property equal to. - A to set the property equal to. - A to set the property equal to. - A that has the property equal to and the , , , and properties set to the specified values. - - - Creates a that represents a subtraction assignment operation that has overflow checking. - An to set the property equal to. - An to set the property equal to. - A that has the property equal to and the and properties set to the specified values. - - - Creates a that represents a subtraction assignment operation that has overflow checking. - An to set the property equal to. - An to set the property equal to. - A to set the property equal to. - A that has the property equal to and the , , and properties set to the specified values. - - - Creates a that represents an arithmetic subtraction operation that has overflow checking. - A to set the property equal to. - A to set the property equal to. - A to set the property equal to. - A that has the property equal to and the , , and properties set to the specified values. - left or right is null. - method is not null and the method it represents returns void, is not static (Shared in Visual Basic), or does not take exactly two arguments. - method is null and the subtraction operator is not defined for left.Type and right.Type. - - - Creates a that represents an arithmetic subtraction operation that has overflow checking. - A to set the property equal to. - A to set the property equal to. - A that has the property equal to and the and properties set to the specified values. - left or right is null. - The subtraction operator is not defined for left.Type and right.Type. - - - Creates a that represents a switch statement that has a default case.. - The result type of the switch. - The value to be tested against each case. - The result of the switch if switchValue does not match any of the cases. - The equality comparison method to use. - The set of cases for this switch expression. - The created . - - - Creates a that represents a switch statement without a default case. - The value to be tested against each case. - The set of cases for this switch expression. - The created . - - - Creates a that represents a switch statement that has a default case. - The value to be tested against each case. - The result of the switch if switchValue does not match any of the cases. - The set of cases for this switch expression. - The created . - - - Creates a that represents a switch statement that has a default case. - The value to be tested against each case. - The result of the switch if switchValue does not match any of the cases. - The equality comparison method to use. - The set of cases for this switch expression. - The created . - - - Creates a that represents a switch statement that has a default case. - The value to be tested against each case. - The result of the switch if switchValue does not match any of the cases. - The equality comparison method to use. - The set of cases for this switch expression. - The created . - - - Creates a that represents a switch statement that has a default case. - The result type of the switch. - The value to be tested against each case. - The result of the switch if switchValue does not match any of the cases. - The equality comparison method to use. - The set of cases for this switch expression. - The created . - - - Creates a for use in a . - The body of the case. - The test values of the case. - The created . - - - Creates a object to be used in a object. - The body of the case. - The test values of the case. - The created . - - - Creates an instance of . - A to set the equal to. - A to set the equal to. - A to set the equal to. - A to set the equal to. - A that has the and and and properties set to the specified value. - - - Creates an instance of . - A to set the equal to. - A to set the equal to. - A to set the equal to. - A that has the and and properties set to the specified value. - - - Creates an instance of . - A to set the equal to. - A that has the property set to the specified value. - - - Creates an instance of . - A to set the equal to. - A to set the equal to. - A that has the and properties set to the specified value. - - - Creates a that represents a throwing of an exception. - An . - A that represents the exception. - - - Creates a that represents a throwing of an exception with a given type. - An . - The new of the expression. - A that represents the exception. - - - Returns a textual representation of the . - A textual representation of the . - - - Creates a representing a try block with any number of catch statements and neither a fault nor finally block. - The body of the try block. - The array of zero or more expressions representing the catch statements to be associated with the try block. - The created . - - - Creates a representing a try block with any number of catch statements and a finally block. - The body of the try block. - The body of the finally block. - The array of zero or more expressions representing the catch statements to be associated with the try block. - The created . - - - Creates a representing a try block with a fault block and no catch statements. - The body of the try block. - The body of the fault block. - The created . - - - Creates a representing a try block with a finally block and no catch statements. - The body of the try block. - The body of the finally block. - The created . - - - Creates a object that represents a generic System.Action delegate type that has specific type arguments. - An array of Type objects that specify the type arguments for the System.Action delegate type. - When this method returns, contains the generic System.Action delegate type that has specific type arguments. Contains null if there is no generic System.Action delegate that matches the typeArgs.This parameter is passed uninitialized. - true if generic System.Action delegate type was created for specific typeArgs; false otherwise. - - - Creates a object that represents a generic System.Func delegate type that has specific type arguments. The last type argument specifies the return type of the created delegate. - An array of Type objects that specify the type arguments for the System.Func delegate type. - When this method returns, contains the generic System.Func delegate type that has specific type arguments. Contains null if there is no generic System.Func delegate that matches the typeArgs.This parameter is passed uninitialized. - true if generic System.Func delegate type was created for specific typeArgs; false otherwise. - - - Gets the static type of the expression that this represents. - The that represents the static type of the expression. - - - Creates a that represents an explicit reference or boxing conversion where null is supplied if the conversion fails. - An to set the property equal to. - A to set the property equal to. - A that has the property equal to and the and properties set to the specified values. - expression or type is null. - - - Creates a that compares run-time type identity. - An to set the property equal to. - A to set the property equal to. - A for which the property is equal to and for which the and properties are set to the specified values. - - - Creates a . - An to set the property equal to. - A to set the property equal to. - A for which the property is equal to and for which the and properties are set to the specified values. - expression or type is null. - - - Creates a that represents a unary plus operation. - An to set the property equal to. - A to set the property equal to. - A that has the property equal to and the and properties set to the specified values. - expression is null. - method is not null and the method it represents returns void, is not static (Shared in Visual Basic), or does not take exactly one argument. - method is null and the unary plus operator is not defined for expression.Type. -or- expression.Type (or its corresponding non-nullable type if it is a nullable value type) is not assignable to the argument type of the method represented by method. - - - Creates a that represents a unary plus operation. - An to set the property equal to. - A that has the property equal to and the property set to the specified value. - expression is null. - The unary plus operator is not defined for expression.Type. - - - Creates a that represents an explicit unboxing. - An to unbox. - The new of the expression. - An instance of . - - - Creates a node that can be used to identify a parameter or a variable in an expression tree. - The type of the parameter or variable. - The name of the parameter or variable. This name is used for debugging or printing purpose only. - A node with the specified name and type. - - - Creates a node that can be used to identify a parameter or a variable in an expression tree. - The type of the parameter or variable. - A node with the specified name and type - - - Reduces the node and then calls the visitor delegate on the reduced expression. The method throws an exception if the node is not reducible. - An instance of . - The expression being visited, or an expression which should replace it in the tree. - - - Describes the node types for the nodes of an expression tree. - - - An addition operation, such as a + b, without overflow checking, for numeric operands. - - - - An addition compound assignment operation, such as (a += b), without overflow checking, for numeric operands. - - - - An addition compound assignment operation, such as (a += b), with overflow checking, for numeric operands. - - - - An addition operation, such as (a + b), with overflow checking, for numeric operands. - - - - A bitwise or logical AND operation, such as (a & b) in C# and (a And b) in Visual Basic. - - - - A conditional AND operation that evaluates the second operand only if the first operand evaluates to true. It corresponds to (a && b) in C# and (a AndAlso b) in Visual Basic. - - - - A bitwise or logical AND compound assignment operation, such as (a &= b) in C#. - - - - An indexing operation in a one-dimensional array, such as array[index] in C# or array(index) in Visual Basic. - - - - An operation that obtains the length of a one-dimensional array, such as array.Length. - - - - An assignment operation, such as (a = b). - - - - A block of expressions. - - - - A method call, such as in the obj.sampleMethod() expression. - - - - A node that represents a null coalescing operation, such as (a ?? b) in C# or If(a, b) in Visual Basic. - - - - A conditional operation, such as a > b ? a : b in C# or If(a > b, a, b) in Visual Basic. - - - - A constant value. - - - - A cast or conversion operation, such as (SampleType)obj in C#or CType(obj, SampleType) in Visual Basic. For a numeric conversion, if the converted value is too large for the destination type, no exception is thrown. - - - - A cast or conversion operation, such as (SampleType)obj in C#or CType(obj, SampleType) in Visual Basic. For a numeric conversion, if the converted value does not fit the destination type, an exception is thrown. - - - - Debugging information. - - - - A unary decrement operation, such as (a - 1) in C# and Visual Basic. The object a should not be modified in place. - - - - A default value. - - - - A division operation, such as (a / b), for numeric operands. - - - - An division compound assignment operation, such as (a /= b), for numeric operands. - - - - A dynamic operation. - - - - A node that represents an equality comparison, such as (a == b) in C# or (a = b) in Visual Basic. - - - - A bitwise or logical XOR operation, such as (a ^ b) in C# or (a Xor b) in Visual Basic. - - - - A bitwise or logical XOR compound assignment operation, such as (a ^= b) in C#. - - - - An extension expression. - - - - A "go to" expression, such as goto Label in C# or GoTo Label in Visual Basic. - - - - A "greater than" comparison, such as (a > b). - - - - A "greater than or equal to" comparison, such as (a >= b). - - - - A unary increment operation, such as (a + 1) in C# and Visual Basic. The object a should not be modified in place. - - - - An index operation or an operation that accesses a property that takes arguments. - - - - An operation that invokes a delegate or lambda expression, such as sampleDelegate.Invoke(). - - - - A false condition value. - - - - A true condition value. - - - - A label. - - - - A lambda expression, such as a => a + a in C# or Function(a) a + a in Visual Basic. - - - - A bitwise left-shift operation, such as (a << b). - - - - A bitwise left-shift compound assignment, such as (a <<= b). - - - - A "less than" comparison, such as (a < b). - - - - A "less than or equal to" comparison, such as (a <= b). - - - - An operation that creates a new object and initializes it from a list of elements, such as new List(){ a, b, c } in C# or Dim sampleList = { a, b, c } in Visual Basic. - - - - A loop, such as for or while. - - - - An operation that reads from a field or property, such as obj.SampleProperty. - - - - An operation that creates a new object and initializes one or more of its members, such as new Point { X = 1, Y = 2 } in C# or New Point With {.X = 1, .Y = 2} in Visual Basic. - - - - An arithmetic remainder operation, such as (a % b) in C# or (a Mod b) in Visual Basic. - - - - An arithmetic remainder compound assignment operation, such as (a %= b) in C#. - - - - A multiplication operation, such as (a * b), without overflow checking, for numeric operands. - - - - A multiplication compound assignment operation, such as (a *= b), without overflow checking, for numeric operands. - - - - A multiplication compound assignment operation, such as (a *= b), that has overflow checking, for numeric operands. - - - - An multiplication operation, such as (a * b), that has overflow checking, for numeric operands. - - - - An arithmetic negation operation, such as (-a). The object a should not be modified in place. - - - - An arithmetic negation operation, such as (-a), that has overflow checking. The object a should not be modified in place. - - - - An operation that calls a constructor to create a new object, such as new SampleType(). - - - - An operation that creates a new array, in which the bounds for each dimension are specified, such as new SampleType[dim1, dim2] in C# or New SampleType(dim1, dim2) in Visual Basic. - - - - An operation that creates a new one-dimensional array and initializes it from a list of elements, such as new SampleType[]{a, b, c} in C# or New SampleType(){a, b, c} in Visual Basic. - - - - A bitwise complement or logical negation operation. In C#, it is equivalent to (~a) for integral types and to (!a) for Boolean values. In Visual Basic, it is equivalent to (Not a). The object a should not be modified in place. - - - - An inequality comparison, such as (a != b) in C# or (a <> b) in Visual Basic. - - - - A ones complement operation, such as (~a) in C#. - - - - A bitwise or logical OR operation, such as (a | b) in C# or (a Or b) in Visual Basic. - - - - A bitwise or logical OR compound assignment, such as (a |= b) in C#. - - - - A short-circuiting conditional OR operation, such as (a || b) in C# or (a OrElse b) in Visual Basic. - - - - A reference to a parameter or variable that is defined in the context of the expression. For more information, see . - - - - A unary postfix decrement, such as (a--). The object a should be modified in place. - - - - A unary postfix increment, such as (a++). The object a should be modified in place. - - - - A mathematical operation that raises a number to a power, such as (a ^ b) in Visual Basic. - - - - A compound assignment operation that raises a number to a power, such as (a ^= b) in Visual Basic. - - - - A unary prefix decrement, such as (--a). The object a should be modified in place. - - - - A unary prefix increment, such as (++a). The object a should be modified in place. - - - - An expression that has a constant value of type . A node can contain references to parameters that are defined in the context of the expression it represents. - - - - A bitwise right-shift operation, such as (a >> b). - - - - A bitwise right-shift compound assignment operation, such as (a >>= b). - - - - A list of run-time variables. For more information, see . - - - - A subtraction operation, such as (a - b), without overflow checking, for numeric operands. - - - - A subtraction compound assignment operation, such as (a -= b), without overflow checking, for numeric operands. - - - - A subtraction compound assignment operation, such as (a -= b), that has overflow checking, for numeric operands. - - - - An arithmetic subtraction operation, such as (a - b), that has overflow checking, for numeric operands. - - - - A switch operation, such as switch in C# or Select Case in Visual Basic. - - - - An operation that throws an exception, such as throw new Exception(). - - - - A try-catch expression. - - - - An explicit reference or boxing conversion in which null is supplied if the conversion fails, such as (obj as SampleType) in C# or TryCast(obj, SampleType) in Visual Basic. - - - - An exact type test. - - - - A type test, such as obj is SampleType in C# or TypeOf obj is SampleType in Visual Basic. - - - - A unary plus operation, such as (+a). The result of a predefined unary plus operation is the value of the operand, but user-defined implementations might have unusual results. - - - - An unbox value type operation, such as unbox and unbox.any instructions in MSIL. - - - - Represents a visitor or rewriter for expression trees. - - - Initializes a new instance of . - - - Dispatches the list of expressions to one of the more specialized visit methods in this class. - The expressions to visit. - The modified expression list, if any one of the elements were modified; otherwise, returns the original expression list. - - - Dispatches the expression to one of the more specialized visit methods in this class. - The expression to visit. - The modified expression, if it or any subexpression was modified; otherwise, returns the original expression. - - - Visits all nodes in the collection using a specified element visitor. - The nodes to visit. - A delegate that visits a single element, optionally replacing it with a new element. - The type of the nodes. - The modified node list, if any of the elements were modified; otherwise, returns the original node list. - - - Visits all expressions in the collection, casting the results back to the original expression type. - The expressions to visit. - The name of the calling method; used to report to report a better error message. - The type of the expressions. - The modified expression collection, if any expression was modified; otherwise, returns the original expression collection. - The visit method for one of the expressions returned a different type. - - - Visits an expression, casting the result back to the original expression type. - The expression to visit. - The name of the calling method; used to report to report a better error message. - The type of the expression. - The modified expression, if it or any subexpression was modified; otherwise, returns the original expression. - The visit method for this node returned a different type. - - - Visits the children of the . - The expression to visit. - The modified expression, if it or any subexpression was modified; otherwise, returns the original expression. - - - Visits the children of the . - The expression to visit. - The modified expression, if it or any subexpression was modified; otherwise, returns the original expression. - - - Visits the children of the . - The expression to visit. - The modified expression, if it or any subexpression was modified; otherwise, returns the original expression. - - - Visits the children of the . - The expression to visit. - The modified expression, if it or any subexpression was modified; otherwise, returns the original expression. - - - Visits the . - The expression to visit. - The modified expression, if it or any subexpression was modified; otherwise, returns the original expression. - - - Visits the . - The expression to visit. - The modified expression, if it or any subexpression was modified; otherwise, returns the original expression. - - - Visits the . - The expression to visit. - The modified expression, if it or any subexpression was modified; otherwise, returns the original expression. - - - Visits the children of the . - The expression to visit. - The modified expression, if it or any subexpression was modified; otherwise, returns the original expression. - - - Visits the children of the . - The expression to visit. - The modified expression, if it or any subexpression was modified; otherwise, returns the original expression. - - - Visits the children of the extension expression. - The expression to visit. - The modified expression, if it or any subexpression was modified; otherwise, returns the original expression. - - - Visits the children of the . - The expression to visit. - The modified expression, if it or any subexpression was modified; otherwise, returns the original expression. - - - Visits the children of the . - The expression to visit. - The modified expression, if it or any subexpression was modified; otherwise, returns the original expression. - - - Visits the children of the . - The expression to visit. - The modified expression, if it or any subexpression was modified; otherwise, returns the original expression. - - - Visits the children of the . - The expression to visit. - The modified expression, if it or any subexpression was modified; otherwise, returns the original expression. - - - Visits the . - The expression to visit. - The modified expression, if it or any subexpression was modified; otherwise, returns the original expression. - - - Visits the children of the . - The expression to visit. - The type of the delegate. - The modified expression, if it or any subexpression was modified; otherwise, returns the original expression. - - - Visits the children of the . - The expression to visit. - The modified expression, if it or any subexpression was modified; otherwise, returns the original expression. - - - Visits the children of the . - The expression to visit. - The modified expression, if it or any subexpression was modified; otherwise, returns the original expression. - - - Visits the children of the . - The expression to visit. - The modified expression, if it or any subexpression was modified; otherwise, returns the original expression. - - - Visits the children of the . - The expression to visit. - The modified expression, if it or any subexpression was modified; otherwise, returns the original expression. - - - Visits the children of the . - The expression to visit. - The modified expression, if it or any subexpression was modified; otherwise, returns the original expression. - - - Visits the children of the . - The expression to visit. - The modified expression, if it or any subexpression was modified; otherwise, returns the original expression. - - - Visits the children of the . - The expression to visit. - The modified expression, if it or any subexpression was modified; otherwise, returns the original expression. - - - Visits the children of the . - The expression to visit. - The modified expression, if it or any subexpression was modified; otherwise, returns the original expression. - - - Visits the children of the . - The expression to visit. - The modified expression, if it or any subexpression was modified; otherwise, returns the original expression. - - - Visits the children of the . - The expression to visit. - The modified expression, if it or any subexpression was modified; otherwise, returns the original expression. - - - Visits the children of the . - The expression to visit. - The modified expression, if it or any subexpression was modified; otherwise, returns the original expression. - - - Visits the . - The expression to visit. - The modified expression, if it or any subexpression was modified; otherwise, returns the original expression. - - - Visits the children of the . - The expression to visit. - The modified expression, if it or any subexpression was modified; otherwise, returns the original expression. - - - Visits the children of the . - The expression to visit. - The modified expression, if it or any subexpression was modified; otherwise, returns the original expression. - - - Visits the children of the . - The expression to visit. - The modified expression, if it or any subexpression was modified; otherwise, returns the original expression. - - - Visits the children of the . - The expression to visit. - The modified expression, if it or any subexpression was modified; otherwise, returns the original expression. - - - Visits the children of the . - The expression to visit. - The modified expression, if it or any subexpression was modified; otherwise, returns the original expression. - - - Visits the children of the . - The expression to visit. - The modified expression, if it or any subexpression was modified; otherwise, returns the original expression. - - - Represents an unconditional jump. This includes return statements, break and continue statements, and other jumps. - - - The kind of the "go to" expression. Serves information purposes only. - The object representing the kind of the "go to" expression. - - - Returns the node type of this . - The that represents this expression. - - - The target label where this node jumps to. - The object representing the target label for this node. - - - Gets the static type of the expression that this represents. - The that represents the static type of the expression. - - - Creates a new expression that is like this one, but using the supplied children. If all of the children are the same, it will return this expression. - The property of the result. - The property of the result. - This expression if no children are changed or an expression with the updated children. - - - The value passed to the target, or null if the target is of type System.Void. - The object representing the value passed to the target or null. - - - Specifies what kind of jump this represents. - - - A that represents a break statement. - - - - A that represents a continue statement. - - - - A that represents a jump to some location. - - - - A that represents a return statement. - - - -

Provides an internal interface for accessing the arguments of multiple tree nodes (DynamicExpression, ElementInit, MethodCallExpression, InvocationExpression, NewExpression, and InexExpression). You should not use this API. It is only public due to DLL refactoring and exists only for internal performance optimizations.

-

This enables two optimizations which reduce the size of expression trees. The first enables the tree nodes to hold onto an IList instead of a ReadOnlyCollection. IList saves the cost of allocating the ReadOnlyCollection for each node. The second enables creating specialized subclasses that hold onto a specific number of arguments (for example, Block2, Block3, Block4). Therefore, these nodes avoid allocating both a ReadOnlyCollection and an array for storing their elements, saving 32 bytes per node.

-

The expression tree nodes continue to expose the original LINQ properties of ReadOnlyCollections. The nodes do this by re-using a field for storing both the array or an element that would normally be stored in the array.

-

For the array case, the collection is typed to IList instead of ReadOnlyCollection. When the node is initially constructed it is an array. When the compiler accesses the members it uses this interface. Accessing array elements promotes the array to a ReadOnlyCollection.

-

For the object case we store the first argument in a field typed to object. When the node is initially constructed, the field holds the Expression. The compiler accesses arguments through this interface, and the accessor for the first argument uses Expression.ReturnObject to return the object that handles the Expression or ReadOnlyCollection case. When the user accesses the ReadOnlyCollection, then the object field is updated to hold directly onto the ReadOnlyCollection.

-

It is important that the Expressions consistently return the same ReadOnlyCollection. Otherwise, the re-writer tree walker will break. It is a breaking change from LINQ v1 to return different ReadOnlyCollections form the same Expression node. Currently users can rely on object identity to tell if the node has changed. Storing the ReadOnlyCollection in an overloaded field both reduces memory usage and maintains compatibility for the public API.

-

-
-
- - Returns the number of arguments to the expression tree node. You should not use this type. It is only public due to assembly refactoring, and it is used internally for performance optimizations. - The number of arguments to the expression tree node as . - - - Returns the argument at index, throwing if index is out of bounds. You should not use this type. It is only public due to assembly refactoring, and it is used internally for performance optimizations. - The index of the argument. - The argument at index, throwing if index is out of bounds as . - - - Provides an internal interface for accessing the arguments of DynamicExpression tree nodes as well as CallSite and Rewriting functionality. You should not use this API. It is only public due to DLL refactoring and exists only for internal performance optimizations. - - - Optionally creates the CallSite and returns the CallSite for the DynamicExpression’s polymorphic inline cache. You should not use this type. It is only public due to assembly refactoring, and it is used internally for performance optimizations. - The CallSite for the DynamicExpression’s polymorphic inline cache. - - - Gets the delegate type used by the CallSite, which is the type of the rules used in the dynamic expression’s polymorhphic inline cache. - The delegate type used by the CallSite. - - - Rewrites this node replacing the dynamic expression’s arguments with the provided values. The number of args needs to match the number of the current expression. You should not use this type. It is only public due to assembly refactoring, and it is used internally for performance optimizations. This helper method allows re-writing of nodes to be independent of the specific implementation class deriving from DynamicExpression that is being used at the call site. - The arguments used to replace this node. - The rewritten node, but if no changes were made, then returns the same node. - - - Represents indexing a property or array. - - - Gets the arguments that will be used to index the property or array. - The read-only collection containing the arguments that will be used to index the property or array. - - - Gets the for the property if the expression represents an indexed property, returns null otherwise. - The for the property if the expression represents an indexed property, otherwise null. - - - Returns the node type of this . - The that represents this expression. - - - An object to index. - The representing the object to index. - - - Gets the static type of the expression that this represents. - The that represents the static type of the expression. - - - Creates a new expression that is like this one, but using the supplied children. If all of the children are the same, it will return this expression. - The property of the result. - The property of the result. - This expression if no children are changed or an expression with the updated children. - - - Returns the number of arguments to the expression tree node. You should not use this member. It is only public due to assembly refactoring, and it is used internally for performance optimizations. - Returns . - - - Returns the argument at index, throwing if index is out of bounds. You should not use this member. It is only public due to assembly refactoring, and it is used internally for performance optimizations. - The index of the argument. - Returns . - - - Represents an expression that applies a delegate or lambda expression to a list of argument expressions. - - - Gets the arguments that the delegate or lambda expression is applied to. - A of objects which represent the arguments that the delegate is applied to. - - - Gets the delegate or lambda expression to be applied. - An that represents the delegate to be applied. - - - Returns the node type of this expression. Extension nodes should return when overriding this method. - The of the expression. - - - Gets the static type of the expression that this represents. - The that represents the static type of the expression. - - - Creates a new expression that is like this one, but using the supplied children. If all of the children are the same, it will return this expression. - The property of the result. - The property of the result. - This expression if no children are changed or an expression with the updated children. - - - Returns the number of arguments to the expression tree node. You should not use this member. It is only public due to assembly refactoring, and it is used internally for performance optimizations. - The number of arguments to the expression tree node as . - - - Returns the argument at index, throwing if index is out of bounds. You should not use this member. It is only public due to assembly refactoring, and it is used internally for performance optimizations. - The index of the argument. - The argument at index, throwing if index is out of bounds, as . - - - Represents a label, which can be put in any context. If it is jumped to, it will get the value provided by the corresponding . Otherwise, it receives the value in . If the equals System.Void, no value should be provided. - - - The value of the when the label is reached through regular control flow (for example, is not jumped to). - The Expression object representing the value of the . - - - Returns the node type of this . - The that represents this expression. - - - The which this label is associated with. - The which this label is associated with. - - - Gets the static type of the expression that this represents. - The that represents the static type of the expression. - - - Creates a new expression that is like this one, but using the supplied children. If all of the children are the same, it will return this expression. - The property of the result. - The property of the result - This expression if no children are changed or an expression with the updated children. - - - Used to represent the target of a . - - - Gets the name of the label. - The name of the label. - - - Returns a that represents the current . - A that represents the current . - - - The type of value that is passed when jumping to the label (or if no value should be passed). - The object representing the type of the value that is passed when jumping to the label or if no value should be passed - - - Describes a lambda expression. This captures a block of code that is similar to a .NET method body. - - - Gets the body of the lambda expression. - An that represents the body of the lambda expression. - - - Produces a delegate that represents the lambda expression. - A that contains the compiled version of the lambda expression. - - - - - - - Produces a delegate that represents the lambda expression. - Debugging information generator used by the compiler to mark sequence points and annotate local variables. - A delegate containing the compiled version of the lambda. - - - Gets the name of the lambda expression. - The name of the lambda expression. - - - Returns the node type of this . - The that represents this expression. - - - Gets the parameters of the lambda expression. - A of objects that represent the parameters of the lambda expression. - - - Gets the return type of the lambda expression. - The object representing the type of the lambda expression. - - - Gets the value that indicates if the lambda expression will be compiled with the tail call optimization. - True if the lambda expression will be compiled with the tail call optimization, otherwise false. - - - Gets the static type of the expression that this represents. - The that represents the static type of the expression. - - - Represents a constructor call that has a collection initializer. - - - Gets a value that indicates whether the expression tree node can be reduced. - True if the node can be reduced, otherwise false. - - - Gets the element initializers that are used to initialize a collection. - A of objects which represent the elements that are used to initialize the collection. - - - Gets the expression that contains a call to the constructor of a collection type. - A that represents the call to the constructor of a collection type. - - - Returns the node type of this . - The that represents this expression. - - - Reduces the binary expression node to a simpler expression. - The reduced expression. - - - Gets the static type of the expression that this represents. - The that represents the static type of the expression. - - - Creates a new expression that is like this one, but using the supplied children. If all of the children are the same, it will return this expression. - The property of the result. - The property of the result. - This expression if no children are changed or an expression with the updated children. - - - Represents an infinite loop. It can be exited with "break". - - - Gets the that is the body of the loop. - The that is the body of the loop. - - - Gets the that is used by the loop body as a break statement target. - The that is used by the loop body as a break statement target. - - - Gets the that is used by the loop body as a continue statement target. - The that is used by the loop body as a continue statement target. - - - Returns the node type of this expression. Extension nodes should return when overriding this method. - The of the expression. - - - Gets the static type of the expression that this represents. - The that represents the static type of the expression. - - - Creates a new expression that is like this one, but using the supplied children. If all of the children are the same, it will return this expression. - The property of the result. - The property of the result. - The property of the result. - This expression if no children are changed or an expression with the updated children. - - - Represents assignment operation for a field or property of an object. - - - Gets the expression to assign to the field or property. - The that represents the value to assign to the field or property. - - - Creates a new expression that is like this one, but using the supplied children. If all of the children are the same, it will return this expression. - The property of the result. - This expression if no children are changed or an expression with the updated children. - - - Provides the base class from which the classes that represent bindings that are used to initialize members of a newly created object derive. - - - Initializes a new instance of the class. - The that discriminates the type of binding that is represented. - The that represents a field or property to be initialized. - - - Gets the type of binding that is represented. - One of the values. - - - Gets the field or property to be initialized. - The that represents the field or property to be initialized. - - - Returns a textual representation of the . - A textual representation of the . - - - Describes the binding types that are used in objects. - - - A binding that represents initializing a member with the value of an expression. - - - - A binding that represents initializing a member of type or from a list of elements. - - - - A binding that represents recursively initializing members of a member. - - - - Represents accessing a field or property. - - - Dispatches to the specific visit method for this node type. For example, calls the . - The visitor to visit this node with. - The result of visiting this node. - - - Gets the containing object of the field or property. - An that represents the containing object of the field or property. - - - Gets the field or property to be accessed. - The that represents the field or property to be accessed. - - - Returns the node type of this . - The that represents this expression. - - - Creates a new expression that is like this one, but using the supplied children. If all of the children are the same, it will return this expression. - The property of the result. - This expression if no children are changed or an expression with the updated children. - - - Represents calling a constructor and initializing one or more members of the new object. - - - Gets the bindings that describe how to initialize the members of the newly created object. - A of objects which describe how to initialize the members. - - - Gets a value that indicates whether the expression tree node can be reduced. - True if the node can be reduced, otherwise false. - - - Gets the expression that represents the constructor call. - A that represents the constructor call. - - - Returns the node type of this Expression. Extension nodes should return when overriding this method. - The of the expression. - - - Reduces the to a simpler expression. - The reduced expression. - - - Gets the static type of the expression that this represents. - The that represents the static type of the expression. - - - Creates a new expression that is like this one, but using the supplied children. If all of the children are the same, it will return this expression. - The property of the result. - The property of the result. - This expression if no children are changed or an expression with the updated children. - - - Represents initializing the elements of a collection member of a newly created object. - - - Gets the element initializers for initializing a collection member of a newly created object. - A of objects to initialize a collection member with. - - - Creates a new expression that is like this one, but using the supplied children. If all of the children are the same, it will return this expression. - The property of the result. - This expression if no children are changed or an expression with the updated children. - - - Represents initializing members of a member of a newly created object. - - - Gets the bindings that describe how to initialize the members of a member. - A of objects that describe how to initialize the members of the member. - - - Creates a new expression that is like this one, but using the supplied children. If all of the children are the same, it will return this expression. - The property of the result. - This expression if no children are changed or an expression with the updated children. - - - Represents a call to either static or an instance method. - - - Dispatches to the specific visit method for this node type. For example, calls the . - The visitor to visit this node with. - The result of visiting this node. - - - Gets a collection of expressions that represent arguments of the called method. - A of objects which represent the arguments to the called method. - - - Gets the for the method to be called. - The that represents the called method. - - - Returns the node type of this . - The that represents this expression. - - - Gets the that represents the instance for instance method calls or null for static method calls. - An that represents the receiving object of the method. - - - Gets the static type of the expression that this represents. - The that represents the static type of the expression. - - - Creates a new expression that is like this one, but using the supplied children. If all of the children are the same, it will return this expression. - The property of the result. - The property of the result. - This expression if no children are changed or an expression with the updated children. - - - Returns the number of arguments to the expression tree node. You should not use this member. It is only public due to assembly refactoring, and it is used internally for performance optimizations. - The number of arguments to the expression tree node as . - - - Returns the argument at index, throwing if index is out of bounds. You should not use this member. It is only public due to assembly refactoring, and it is used internally for performance optimizations. - The index of the argument. - Returns . - - - Represents creating a new array and possibly initializing the elements of the new array. - - - Dispatches to the specific visit method for this node type. For example, calls the . - The visitor to visit this node with. - The result of visiting this node. - - - Gets the bounds of the array if the value of the property is , or the values to initialize the elements of the new array if the value of the property is . - A of objects which represent either the bounds of the array or the initialization values. - - - Gets the static type of the expression that this represents. - The that represents the static type of the expression. - - - Creates a new expression that is like this one, but using the supplied children. If all of the children are the same, it will return this expression. - The property of the result. - This expression if no children are changed or an expression with the updated children. - - - Represents a constructor call. - - - Dispatches to the specific visit method for this node type. For example, calls the . - The visitor to visit this node with. - The result of visiting this node. - - - Gets the arguments to the constructor. - A collection of objects that represent the arguments to the constructor. - - - Gets the called constructor. - The that represents the called constructor. - - - Gets the members that can retrieve the values of the fields that were initialized with constructor arguments. - A collection of objects that represent the members that can retrieve the values of the fields that were initialized with constructor arguments. - - - Returns the node type of this . - The that represents this expression. - - - Gets the static type of the expression that this represents. - The that represents the static type of the expression. - - - Creates a new expression that is like this one, but using the supplied children. If all of the children are the same, it will return this expression. - The property of the result. - This expression if no children are changed or an expression with the updated children. - - - Gets the number of arguments to the expression tree node. - The number of arguments to the expression tree node. - - - Returns the argument at index, throwing if index is out of bounds. - The index of the argument. - The argument at index, throwing if index is out of bounds. - - - Represents a named parameter expression. - - - Dispatches to the specific visit method for this node type. For example, calls the . - The visitor to visit this node with. - The result of visiting this node. - - - Indicates that this ParameterExpression is to be treated as a ByRef parameter. - True if this ParameterExpression is a ByRef parameter, otherwise false. - - - Gets the name of the parameter or variable. - A that contains the name of the parameter. - - - Returns the node type of this . - The that represents this expression. - - - Gets the static type of the expression that this represents. - The that represents the static type of the expression. - - - An expression that provides runtime read/write permission for variables. - - - Returns the node type of this Expression. Extension nodes should return when overriding this method. - The of the expression. - - - Gets the static type of the expression that this represents. - The that represents the static type of the expression. - - - Creates a new expression that is like this one, but using the supplied children. If all of the children are the same, it will return this expression. - The property of the result. - This expression if no children are changed or an expression with the updated children. - - - The variables or parameters to which to provide runtime access. - The read-only collection containing parameters that will be provided the runtime access. - - - Represents one case of a . - - - Gets the body of this case. - The object that represents the body of the case block. - - - Gets the values of this case. This case is selected for execution when the matches any of these values. - The read-only collection of the values for this case block. - - - Returns a that represents the current . - A that represents the current . - - - Creates a new expression that is like this one, but using the supplied children. If all of the children are the same, it will return this expression. - The property of the result. - The property of the result. - This expression if no children are changed or an expression with the updated children. - - - Represents a control expression that handles multiple selections by passing control to . - - - Gets the collection of objects for the switch. - The collection of objects. - - - Gets the equality comparison method, if any. - The object representing the equality comparison method. - - - Gets the test for the switch. - The object representing the test for the switch. - - - Returns the node type of this Expression. Extension nodes should return when overriding this method. - The of the expression. - - - Gets the test for the switch. - The object representing the test for the switch. - - - Gets the static type of the expression that this represents. - The that represents the static type of the expression. - - - Creates a new expression that is like this one, but using the supplied children. If all of the children are the same, it will return this expression. - The property of the result. - The property of the result. - The property of the result. - This expression if no children are changed or an expression with the updated children. - - - Stores information necessary to emit debugging symbol information for a source file, in particular the file name and unique language identifier. - - - Returns the document type's unique identifier, if any. Defaults to the GUID for a text file. - The document type's unique identifier. - - - The source file name. - The string representing the source file name. - - - Returns the language's unique identifier, if any. - The language's unique identifier - - - Returns the language vendor's unique identifier, if any. - The language vendor's unique identifier. - - - Represents a try/catch/finally/fault block. - - - Gets the representing the body of the try block. - The representing the body of the try block. - - - Gets the representing the fault block. - The representing the fault block. - - - Gets the representing the finally block. - The representing the finally block. - - - Gets the collection of expressions associated with the try block. - The collection of expressions associated with the try block. - - - Returns the node type of this . - The that represents this expression. - - - Gets the static type of the expression that this represents. - The that represents the static type of the expression. - - - Creates a new expression that is like this one, but using the supplied children. If all of the children are the same, it will return this expression. - The property of the result. - The property of the result. - The property of the result. - The property of the result. - This expression if no children are changed or an expression with the updated children. - - - Represents an operation between an expression and a type. - - - Gets the expression operand of a type test operation. - An that represents the expression operand of a type test operation. - - - Returns the node type of this Expression. Extension nodes should return when overriding this method. - The of the expression. - - - Gets the static type of the expression that this represents. - The that represents the static type of the expression. - - - Gets the type operand of a type test operation. - A that represents the type operand of a type test operation. - - - Creates a new expression that is like this one, but using the supplied children. If all of the children are the same, it will return this expression. - The property of the result. - This expression if no children are changed or an expression with the updated children. - - - Represents an expression that has a unary operator. - - - Gets a value that indicates whether the expression tree node can be reduced. - True if a node can be reduced, otherwise false. - - - Gets a value that indicates whether the expression tree node represents a lifted call to an operator. - true if the node represents a lifted call; otherwise, false. - - - Gets a value that indicates whether the expression tree node represents a lifted call to an operator whose return type is lifted to a nullable type. - true if the operator's return type is lifted to a nullable type; otherwise, false. - - - Gets the implementing method for the unary operation. - The that represents the implementing method. - - - Returns the node type of this . - The that represents this expression. - - - Gets the operand of the unary operation. - An that represents the operand of the unary operation. - - - Reduces the expression node to a simpler expression. - The reduced expression. - - - Gets the static type of the expression that this represents. - The that represents the static type of the expression. - - - Creates a new expression that is like this one, but using the supplied children. If all of the children are the same, it will return this expression. - The property of the result. - This expression if no children are changed or an expression with the updated children. - - - Represents a collection of objects that have a common key. - The type of the key of the . - The type of the values in the . - - - Gets the key of the . - The key of the . - - - Defines an indexer, size property, and Boolean search method for data structures that map keys to sequences of values. - The type of the keys in the . - The type of the elements in the sequences that make up the values in the . - - - Determines whether a specified key exists in the . - The key to search for in the . - true if key is in the ; otherwise, false. - - - Gets the number of key/value collection pairs in the . - The number of key/value collection pairs in the . - - - Gets the sequence of values indexed by a specified key. - The key of the desired sequence of values. - The sequence of values indexed by the specified key. - - - Represents a sorted sequence. - The type of the elements of the sequence. - - - Performs a subsequent ordering on the elements of an according to a key. - The used to extract the key for each element. - The used to compare keys for placement in the returned sequence. - true to sort the elements in descending order; false to sort the elements in ascending order. - The type of the key produced by keySelector. - An whose elements are sorted according to a key. - - - The exception that is thrown when an error is made while using a network protocol. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with the specified message. - The error message string. - - - Initializes a new instance of the class from the specified and instances. - A that contains the information that is required to deserialize the . - A that contains the source of the serialized stream that is associated with the new . - - - Populates a with the data required to serialize the target object. - The to populate with data. - A that specifies the destination for this serialization. - - - Serializes this instance into the specified object. - The object into which this will be serialized. - The destination of the serialization. - - - Provides methods for passing credentials across a stream and requesting or performing authentication for client-server applications. - - - Initializes a new instance of the class. - A object used by the for sending and receiving data. - A that indicates whether closing this object also closes innerStream. - innerStream is null. -or- innerStream is equal to . - - - Releases the unmanaged resources used by the and optionally releases the managed resources. - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - Gets the stream used by this for sending and receiving data. - A object. - - - Gets a value that indicates whether authentication was successful. - true if successful authentication occurred; otherwise, false. - - - Gets a value that indicates whether data sent using this is encrypted. - true if data is encrypted before being transmitted over the network and decrypted when it reaches the remote endpoint; otherwise, false. - - - Gets a value that indicates whether both server and client have been authenticated. - true if the client and server have been authenticated; otherwise, false. - - - Gets a value that indicates whether the local side of the connection was authenticated as the server. - true if the local endpoint was authenticated as the server side of a client-server authenticated connection; false if the local endpoint was authenticated as the client. - - - Gets a value that indicates whether the data sent using this stream is signed. - true if the data is signed before being transmitted; otherwise, false. - - - Gets whether the stream used by this for sending and receiving data has been left open. - true if the inner stream has been left open; otherwise, false. - - - Specifies client requirements for authentication and impersonation when using the class and derived classes to request a resource. - - - The client and server should be authenticated. The request does not fail if the server is not authenticated. To determine whether mutual authentication occurred, check the value of the property. - - - - The client and server should be authenticated. If the server is not authenticated, your application will receive an with a inner exception that indicates that mutual authentication failed - - - - No authentication is required for the client and server. - - - - The EncryptionPolicy to use. - - - Prefer that full encryption be used, but allow a NULL cipher (no encryption) if the server agrees. - - - - Allow no encryption and request that a NULL cipher be used if the other endpoint can handle a NULL cipher. - - - - Require encryption and never allow a NULL cipher. - - - - Selects the local Secure Sockets Layer (SSL) certificate used for authentication. - An object that contains state information for this validation. - The host server specified by the client. - An containing local certificates. - The certificate used to authenticate the remote party. - A array of certificate issuers acceptable to the remote party. - - - - Provides a stream that uses the Negotiate security protocol to authenticate the client, and optionally the server, in client-server communication. - - - Initializes a new instance of the class using the specified . - A object used by the for sending and receiving data. - - - Initializes a new instance of the class using the specified and stream closure behavior. - A object used by the for sending and receiving data. - true to indicate that closing this has no effect on innerstream; false to indicate that closing this also closes innerStream. - innerStream is null. - or - innerStream is equal to . - - - Called by clients to authenticate the client, and optionally the server, in a client-server connection. - The authentication failed. You can use this object to retry the authentication. - The authentication failed. You can use this object to retry the authentication. - This object has been closed. - Authentication has already occurred. - or - This stream was used previously to attempt authentication as the server. You cannot use the stream to retry authentication as the client. - - - Called by clients to authenticate the client, and optionally the server, in a client-server connection. The authentication process uses the specified client credential. - The that is used to establish the identity of the client. - The Service Principal Name (SPN) that uniquely identifies the server to authenticate. - The authentication failed. You can use this object to retry the authentication. - The authentication failed. You can use this object to retry the authentication. - This object has been closed. - Authentication has already occurred. - or - This stream was used previously to attempt authentication as the server. You cannot use the stream to retry authentication as the client. - targetName is null. - - - Called by clients to authenticate the client, and optionally the server, in a client-server connection. The authentication process uses the specified client credential and the channel binding. - The that is used to establish the identity of the client. - The that is used for extended protection. - The Service Principal Name (SPN) that uniquely identifies the server to authenticate. - targetName is null. - or - credential is null. - The authentication failed. You can use this object to retry the authentication. - The authentication failed. You can use this object to retry the authentication. - Authentication has already occurred. - or - This stream was used previously to attempt authentication as the server. You cannot use the stream to retry authentication as the client. - This object has been closed. - - - Called by clients to authenticate the client, and optionally the server, in a client-server connection. The authentication process uses the specified credentials and authentication options. - The that is used to establish the identity of the client. - The Service Principal Name (SPN) that uniquely identifies the server to authenticate. - One of the values, indicating the security services for the stream. - One of the values, indicating how the server can use the client's credentials to access resources. - allowedImpersonationLevel is not a valid value. - targetName is null. - The authentication failed. You can use this object to retry the authentication. - The authentication failed. You can use this object to retry the authentication. - This object has been closed. - Authentication has already occurred. - or - This stream was used previously to attempt authentication as the server. You cannot use the stream to retry authentication as the client. - - - Called by clients to authenticate the client, and optionally the server, in a client-server connection. The authentication process uses the specified credential, authentication options, and channel binding. - The that is used to establish the identity of the client. - The that is used for extended protection. - The Service Principal Name (SPN) that uniquely identifies the server to authenticate. - One of the values, indicating the security services for the stream. - One of the values, indicating how the server can use the client's credentials to access resources. - targetName is null. - or - credential is null. - allowedImpersonationLevel is not a valid value. - The authentication failed. You can use this object to retry the authentication. - The authentication failed. You can use this object to retry the authentication. - Authentication has already occurred. - or - This stream was used previously to attempt authentication as the server. You cannot use the stream to retry authentication as the client. - This object has been closed. - - - Called by clients to authenticate the client, and optionally the server, in a client-server connection as an asynchronous operation. - Returns The task object representing the asynchronous operation. - The authentication failed. You can use this object to retry the authentication. - The authentication failed. You can use this object to retry the authentication. - This object has been closed. - Authentication has already occurred. - or - This stream was used previously to attempt authentication as the server. You cannot use the stream to retry authentication as the client. - - - Called by clients to authenticate the client, and optionally the server, in a client-server connection as an asynchronous operation. The authentication process uses the specified client credential. - The that is used to establish the identity of the client. - The Service Principal Name (SPN) that uniquely identifies the server to authenticate. - Returns The task object representing the asynchronous operation. - The authentication failed. You can use this object to retry the authentication. - The authentication failed. You can use this object to retry the authentication. - This object has been closed. - Authentication has already occurred. - or - This stream was used previously to attempt authentication as the server. You cannot use the stream to retry authentication as the client. - targetName is null. - - - Called by clients to authenticate the client, and optionally the server, in a client-server connection as an asynchronous operation. The authentication process uses the specified client credential and the channel binding. - The that is used to establish the identity of the client. - The that is used for extended protection. - The Service Principal Name (SPN) that uniquely identifies the server to authenticate. - Returns The task object representing the asynchronous operation. - targetName is null. - or - credential is null. - The authentication failed. You can use this object to retry the authentication. - The authentication failed. You can use this object to retry the authentication. - Authentication has already occurred. - or - This stream was used previously to attempt authentication as the server. You cannot use the stream to retry authentication as the client. - This object has been closed. - - - Called by clients to authenticate the client, and optionally the server, in a client-server connection as an asynchronous operation. The authentication process uses the specified credentials and authentication options. - The that is used to establish the identity of the client. - The Service Principal Name (SPN) that uniquely identifies the server to authenticate. - One of the values, indicating the security services for the stream. - One of the values, indicating how the server can use the client's credentials to access resources. - Returns The task object representing the asynchronous operation. - allowedImpersonationLevel is not a valid value. - targetName is null. - The authentication failed. You can use this object to retry the authentication. - The authentication failed. You can use this object to retry the authentication. - This object has been closed. - Authentication has already occurred. - or - This stream was used previously to attempt authentication as the server. You cannot use the stream to retry authentication as the client. - - - Called by clients to authenticate the client, and optionally the server, in a client-server connection as an asynchronous operation. The authentication process uses the specified credential, authentication options, and channel binding. - The that is used to establish the identity of the client. - The that is used for extended protection. - The Service Principal Name (SPN) that uniquely identifies the server to authenticate. - One of the values, indicating the security services for the stream. - One of the values, indicating how the server can use the client's credentials to access resources. - Returns The task object representing the asynchronous operation. - targetName is null. - or - credential is null. - allowedImpersonationLevel is not a valid value. - The authentication failed. You can use this object to retry the authentication. - The authentication failed. You can use this object to retry the authentication. - Authentication has already occurred. - or - This stream was used previously to attempt authentication as the server. You cannot use the stream to retry authentication as the client. - This object has been closed. - - - Called by servers to authenticate the client, and optionally the server, in a client-server connection. The authentication process uses the specified server credentials, authentication options, and extended protection policy. - The that is used to establish the identity of the client. - The that is used for extended protection. - One of the values, indicating the security services for the stream. - One of the values, indicating how the server can use the client's credentials to access resources. - The and on the extended protection policy passed in the policy parameter are both null. - credential is null. - requiredImpersonationLevel must be , , or , - The authentication failed. You can use this object to try to r-authenticate. - The authentication failed. You can use this object to retry the authentication. - Authentication has already occurred. - or - This stream was used previously to attempt authentication as the client. You cannot use the stream to retry authentication as the server. - Windows 95 and Windows 98 are not supported. - This object has been closed. - The policy parameter was set to on a platform that does not support extended protection. - - - Called by servers to authenticate the client, and optionally the server, in a client-server connection. The authentication process uses the specified server credentials and authentication options. - The that is used to establish the identity of the server. - One of the values, indicating the security services for the stream. - One of the values, indicating how the server can use the client's credentials to access resources. - credential is null. - requiredImpersonationLevel must be , , or , - The authentication failed. You can use this object to try to r-authenticate. - The authentication failed. You can use this object to retry the authentication. - This object has been closed. - Authentication has already occurred. - or - This stream was used previously to attempt authentication as the client. You cannot use the stream to retry authentication as the server. - Windows 95 and Windows 98 are not supported. - - - Called by servers to authenticate the client, and optionally the server, in a client-server connection. - The authentication failed. You can use this object to retry the authentication. - The authentication failed. You can use this object to retry the authentication. - This object has been closed. - Windows 95 and Windows 98 are not supported. - - - Called by servers to authenticate the client, and optionally the server, in a client-server connection. The authentication process uses the specified extended protection policy. - The that is used for extended protection. - The and on the extended protection policy passed in the policy parameter are both null. - The authentication failed. You can use this object to retry the authentication. - The authentication failed. You can use this object to retry the authentication. - Windows 95 and Windows 98 are not supported. - This object has been closed. - The policy parameter was set to on a platform that does not support extended protection. - - - Called by servers to authenticate the client, and optionally the server, in a client-server connection as an asynchronous operation. - Returns The task object representing the asynchronous operation. - The authentication failed. You can use this object to retry the authentication. - The authentication failed. You can use this object to retry the authentication. - This object has been closed. - Windows 95 and Windows 98 are not supported. - - - Called by servers to authenticate the client, and optionally the server, in a client-server connection as an asynchronous operation. The authentication process uses the specified extended protection policy. - The that is used for extended protection. - Returns The task object representing the asynchronous operation. - The and on the extended protection policy passed in the policy parameter are both null. - The authentication failed. You can use this object to retry the authentication. - The authentication failed. You can use this object to retry the authentication. - Windows 95 and Windows 98 are not supported. - This object has been closed. - The policy parameter was set to on a platform that does not support extended protection. - - - Called by servers to authenticate the client, and optionally the server, in a client-server connection as an asynchronous operation. The authentication process uses the specified server credentials and authentication options. - The that is used to establish the identity of the server. - One of the values, indicating the security services for the stream. - One of the values, indicating how the server can use the client's credentials to access resources. - Returns The task object representing the asynchronous operation. - credential is null. - requiredImpersonationLevel must be , , or , - The authentication failed. You can use this object to try to r-authenticate. - The authentication failed. You can use this object to retry the authentication. - This object has been closed. - Authentication has already occurred. - or - This stream was used previously to attempt authentication as the client. You cannot use the stream to retry authentication as the server. - Windows 95 and Windows 98 are not supported. - - - Called by servers to authenticate the client, and optionally the server, in a client-server connection as an asynchronous operation. The authentication process uses the specified server credentials, authentication options, and extended protection policy. - The that is used to establish the identity of the client. - The that is used for extended protection. - One of the values, indicating the security services for the stream. - One of the values, indicating how the server can use the client's credentials to access resources. - Returns The task object representing the asynchronous operation. - The and on the extended protection policy passed in the policy parameter are both null. - credential is null. - requiredImpersonationLevel must be , , or , - The authentication failed. You can use this object to try to r-authenticate. - The authentication failed. You can use this object to retry the authentication. - Authentication has already occurred. - or - This stream was used previously to attempt authentication as the client. You cannot use the stream to retry authentication as the server. - Windows 95 and Windows 98 are not supported. - This object has been closed. - The policy parameter was set to on a platform that does not support extended protection. - - - Called by clients to begin an asynchronous operation to authenticate the client, and optionally the server, in a client-server connection. The authentication process uses the specified credentials, authentication options, and channel binding. This method does not block. - The that is used to establish the identity of the client. - The that is used for extended protection. - The Service Principal Name (SPN) that uniquely identifies the server to authenticate. - One of the values, indicating the security services for the stream. - One of the values, indicating how the server can use the client's credentials to access resources. - An delegate that references the method to invoke when the authentication is complete. - A user-defined object containing information about the write operation. This object is passed to the asyncCallback delegate when the operation completes. - An object indicating the status of the asynchronous operation. - credential is null. - or - targetName is null. - The authentication failed. You can use this object to retry the authentication. - The authentication failed. You can use this object to retry the authentication. - Authentication has already occurred. - or - This stream was used previously to attempt authentication as the server. You cannot use the stream to retry authentication as the client. - This object has been closed. - - - Called by clients to begin an asynchronous operation to authenticate the client, and optionally the server, in a client-server connection. This method does not block. - An delegate that references the method to invoke when the authentication is complete. - A user-defined object containing information about the operation. This object is passed to the asyncCallback delegate when the operation completes. - An object indicating the status of the asynchronous operation. - The authentication failed. You can use this object to retry the authentication. - The authentication failed. You can use this object to retry the authentication. - This object has been closed. - Authentication has already occurred. - or - This stream was used previously to attempt authentication as the server. You cannot use the stream to retry authentication as the client. - - - Called by clients to begin an asynchronous operation to authenticate the client, and optionally the server, in a client-server connection. The authentication process uses the specified credentials. This method does not block. - The that is used to establish the identity of the client. - The Service Principal Name (SPN) that uniquely identifies the server to authenticate. - An delegate that references the method to invoke when the authentication is complete. - A user-defined object containing information about the write operation. This object is passed to the asyncCallback delegate when the operation completes. - An object indicating the status of the asynchronous operation. - credential is null. - or - targetName is null. - The authentication failed. You can use this object to retry the authentication. - The authentication failed. You can use this object to retry the authentication. - This object has been closed. - Authentication has already occurred. - or - This stream was used previously to attempt authentication as the server. You cannot use the stream to retry authentication as the client. - - - Called by clients to begin an asynchronous operation to authenticate the client, and optionally the server, in a client-server connection. The authentication process uses the specified credentials and channel binding. This method does not block. - The that is used to establish the identity of the client. - The that is used for extended protection. - The Service Principal Name (SPN) that uniquely identifies the server to authenticate. - An delegate that references the method to invoke when the authentication is complete. - A user-defined object containing information about the write operation. This object is passed to the asyncCallback delegate when the operation completes. - An object indicating the status of the asynchronous operation. - credential is null. - or - targetName is null. - The authentication failed. You can use this object to retry the authentication. - The authentication failed. You can use this object to retry the authentication. - Authentication has already occurred. - or - This stream was used previously to attempt authentication as the server. You cannot use the stream to retry authentication as the client. - This object has been closed. - - - Called by clients to begin an asynchronous operation to authenticate the client, and optionally the server, in a client-server connection. The authentication process uses the specified credentials and authentication options. This method does not block. - The that is used to establish the identity of the client. - The Service Principal Name (SPN) that uniquely identifies the server to authenticate. - One of the values, indicating the security services for the stream. - One of the values, indicating how the server can use the client's credentials to access resources. - An delegate that references the method to invoke when the authentication is complete. - A user-defined object containing information about the write operation. This object is passed to the asyncCallback delegate when the operation completes. - An object indicating the status of the asynchronous operation. - credential is null. - or - targetName is null. - The authentication failed. You can use this object to retry the authentication. - The authentication failed. You can use this object to retry the authentication. - This object has been closed. - Authentication has already occurred. - or - This stream was used previously to attempt authentication as the server. You cannot use the stream to retry authentication as the client. - - - Called by servers to begin an asynchronous operation to authenticate the client, and optionally the server, in a client-server connection. The authentication process uses the specified server credentials and authentication options. This method does not block. - The that is used to establish the identity of the client. - One of the values, indicating the security services for the stream. - One of the values, indicating how the server can use the client's credentials to access resources. - An delegate that references the method to invoke when the authentication is complete. - A user-defined object containing information about the operation. This object is passed to the asyncCallback delegate when the operation completes. - An object indicating the status of the asynchronous operation. - credential is null. - requiredImpersonationLevel must be , , or , - The authentication failed. You can use this object to retry the authentication. - The authentication failed. You can use this object to retry the authentication. - This object has been closed. - Authentication has already occurred. - or - This stream was used previously to attempt authentication as the client. You cannot use the stream to retry authentication as the server. - Windows 95 and Windows 98 are not supported. - - - Called by servers to begin an asynchronous operation to authenticate the client, and optionally the server, in a client-server connection. The authentication process uses the specified server credentials, authentication options, and extended protection policy. This method does not block. - The that is used to establish the identity of the client. - The that is used for extended protection. - One of the values, indicating the security services for the stream. - One of the values, indicating how the server can use the client's credentials to access resources. - An delegate that references the method to invoke when the authentication is complete. - A user-defined object containing information about the write operation. This object is passed to the asyncCallback delegate when the operation completes. - An object indicating the status of the asynchronous operation. - The and on the extended protection policy passed in the policy parameter are both null. - credential is null. - requiredImpersonationLevel must be , , or , - The authentication failed. You can use this object to retry the authentication. - The authentication failed. You can use this object to retry the authentication. - Authentication has already occurred. - or - This stream was used previously to attempt authentication as the client. You cannot use the stream to retry authentication as the server. - Windows 95 and Windows 98 are not supported. - This object has been closed. - The policy parameter was set to on a platform that does not support extended protection. - - - Called by servers to begin an asynchronous operation to authenticate the client, and optionally the server, in a client-server connection. This method does not block. - An delegate that references the method to invoke when the authentication is complete. - A user-defined object containing information about the operation. This object is passed to the asyncCallback delegate when the operation completes. - An object indicating the status of the asynchronous operation. - The authentication failed. You can use this object to retry the authentication. - The authentication failed. You can use this object to retry the authentication. - This object has been closed. - Windows 95 and Windows 98 are not supported. - - - Called by servers to begin an asynchronous operation to authenticate the client, and optionally the server, in a client-server connection. The authentication process uses the specified extended protection policy. This method does not block. - The that is used for extended protection. - An delegate that references the method to invoke when the authentication is complete. - A user-defined object containing information about the write operation. This object is passed to the asyncCallback delegate when the operation completes. - An object indicating the status of the asynchronous operation. - The and on the extended protection policy passed in the policy parameter are both null. - The authentication failed. You can use this object to retry the authentication. - The authentication failed. You can use this object to retry the authentication. - Windows 95 and Windows 98 are not supported. - This object has been closed. - The policy parameter was set to on a platform that does not support extended protection. - - - Begins an asynchronous read operation that reads data from the stream and stores it in the specified array. - A array that receives the bytes read from the stream. - The zero-based location in buffer at which to begin storing the data read from this stream. - The maximum number of bytes to read from the stream. - An delegate that references the method to invoke when the read operation is complete. - A user-defined object containing information about the read operation. This object is passed to the asyncCallback delegate when the operation completes. - An object indicating the status of the asynchronous operation. - buffer is null. - offset is less than 0. - or - offset is greater than the length of buffer. - or - offset plus count is greater than the length of buffer. - The read operation failed. - or - Encryption is in use, but the data could not be decrypted. - There is already a read operation in progress. - This object has been closed. - Authentication has not occurred. - - - Begins an asynchronous write operation that writes s from the specified buffer to the stream. - A array that supplies the bytes to be written to the stream. - The zero-based location in buffer at which to begin reading bytes to be written to the stream. - An value that specifies the number of bytes to read from buffer. - An delegate that references the method to invoke when the write operation is complete. - A user-defined object containing information about the write operation. This object is passed to the asyncCallback delegate when the operation completes. - An object indicating the status of the asynchronous operation. - buffer is null. - offset is less than 0. - or - offset is greater than the length of buffer. - or - offset plus count is greater than the length of buffer. - The write operation failed. - or - Encryption is in use, but the data could not be encrypted. - There is already a write operation in progress. - This object has been closed. - Authentication has not occurred. - - - Gets a value that indicates whether the underlying stream is readable. - true if authentication has occurred and the underlying stream is readable; otherwise, false. - - - Gets a value that indicates whether the underlying stream is seekable. - This property always returns false. - - - Gets a value that indicates whether the underlying stream supports time-outs. - true if the underlying stream supports time-outs; otherwise, false. - - - Gets a value that indicates whether the underlying stream is writable. - true if authentication has occurred and the underlying stream is writable; otherwise, false. - - - Releases the unmanaged resources used by the and optionally releases the managed resources. - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - Ends a pending asynchronous client authentication operation that was started with a call to . - An instance returned by a call to . - asyncResult is null. - asyncResult was not created by a call to . - The authentication failed. You can use this object to retry the authentication. - The authentication failed. You can use this object to retry the authentication. - There is no pending client authentication to complete. - - - Ends a pending asynchronous client authentication operation that was started with a call to . - An instance returned by a call to . - asyncResult is null. - asyncResult was not created by a call to . - The authentication failed. You can use this object to retry the authentication. - The authentication failed. You can use this object to retry the authentication. - There is no pending authentication to complete. - - - Ends an asynchronous read operation that was started with a call to . - An instance returned by a call to - A value that specifies the number of bytes read from the underlying stream. - asyncResult is null. - The asyncResult was not created by a call to . - Authentication has not occurred. - The read operation failed. - - - Ends an asynchronous write operation that was started with a call to . - An instance returned by a call to - asyncResult is null. - The asyncResult was not created by a call to . - Authentication has not occurred. - The write operation failed. - - - Causes any buffered data to be written to the underlying device. - - - Gets a value that indicates how the server can use the client's credentials. - One of the values. - Authentication failed or has not occurred. - - - Gets a value that indicates whether authentication was successful. - true if successful authentication occurred; otherwise, false. - - - Gets a value that indicates whether this uses data encryption. - true if data is encrypted before being transmitted over the network and decrypted when it reaches the remote endpoint; otherwise, false. - - - Gets a value that indicates whether both the server and the client have been authenticated. - true if the server has been authenticated; otherwise, false. - - - Gets a value that indicates whether the local side of the connection used by this was authenticated as the server. - true if the local endpoint was successfully authenticated as the server side of the authenticated connection; otherwise, false. - - - Gets a value that indicates whether the data sent using this stream is signed. - true if the data is signed before being transmitted; otherwise, false. - - - Gets the length of the underlying stream. - A that specifies the length of the underlying stream. - Getting the value of this property is not supported when the underlying stream is a . - - - Gets or sets the current position in the underlying stream. - A that specifies the current position in the underlying stream. - Setting this property is not supported. - or - Getting the value of this property is not supported when the underlying stream is a . - - - Reads data from this stream and stores it in the specified array. - A array that receives the bytes read from the stream. - A containing the zero-based location in buffer at which to begin storing the data read from this stream. - A containing the maximum number of bytes to read from the stream. - A value that specifies the number of bytes read from the underlying stream. When there is no more data to be read, returns 0. - The read operation failed. - Authentication has not occurred. - A operation is already in progress. - - - Gets or sets the amount of time a read operation blocks waiting for data. - A that specifies the amount of time that will elapse before a read operation fails. - - - Gets information about the identity of the remote party sharing this authenticated stream. - An object that describes the identity of the remote endpoint. - Authentication failed or has not occurred. - - - Throws . - This value is ignored. - This value is ignored. - Always throws a . - Seeking is not supported on . - - - Sets the length of the underlying stream. - An value that specifies the length of the stream. - - - Write the specified number of s to the underlying stream using the specified buffer and offset. - A array that supplies the bytes written to the stream. - An containing the zero-based location in buffer at which to begin reading bytes to be written to the stream. - A containing the number of bytes to read from buffer. - buffer is null. - offset is less than 0. - or - offset is greater than the length of buffer. - or - offset plus count is greater than the length of buffer. - The write operation failed. - or - Encryption is in use, but the data could not be encrypted. - There is already a write operation in progress. - This object has been closed. - Authentication has not occurred. - - - Gets or sets the amount of time a write operation blocks waiting for data. - A that specifies the amount of time that will elapse before a write operation fails. - - - Indicates the security services requested for an authenticated stream. - - - Encrypt and sign data to help ensure the confidentiality and integrity of transmitted data. - - - - Authentication only. - - - - Sign data to help ensure the integrity of transmitted data. - - - - Verifies the remote Secure Sockets Layer (SSL) certificate used for authentication. - An object that contains state information for this validation. - The certificate used to authenticate the remote party. - The chain of certificate authorities associated with the remote certificate. - One or more errors associated with the remote certificate. - - - - Enumerates Secure Socket Layer (SSL) policy errors. - - - No SSL policy errors. - - - - has returned a non empty array. - - - - Certificate name mismatch. - - - - Certificate not available. - - - - Provides a stream used for client-server communication that uses the Secure Socket Layer (SSL) security protocol to authenticate the server and optionally the client. - - - Initializes a new instance of the class using the specified . - A object used by the for sending and receiving data. - innerStream is not readable. -or- innerStream is not writable. - innerStream is null. -or- innerStream is equal to . - - - Initializes a new instance of the class using the specified and stream closure behavior. - A object used by the for sending and receiving data. - A Boolean value that indicates the closure behavior of the object used by the for sending and receiving data. This parameter indicates if the inner stream is left open. - innerStream is not readable. -or- innerStream is not writable. - innerStream is null. -or- innerStream is equal to . - - - Initializes a new instance of the class using the specified , stream closure behavior and certificate validation delegate. - A object used by the for sending and receiving data. - A Boolean value that indicates the closure behavior of the object used by the for sending and receiving data. This parameter indicates if the inner stream is left open. - A delegate responsible for validating the certificate supplied by the remote party. - innerStream is not readable. -or- innerStream is not writable. - innerStream is null. -or- innerStream is equal to . - - - Initializes a new instance of the class using the specified , stream closure behavior, certificate validation delegate and certificate selection delegate. - A object used by the for sending and receiving data. - A Boolean value that indicates the closure behavior of the object used by the for sending and receiving data. This parameter indicates if the inner stream is left open. - A delegate responsible for validating the certificate supplied by the remote party. - A delegate responsible for selecting the certificate used for authentication. - innerStream is not readable. -or- innerStream is not writable. - innerStream is null. -or- innerStream is equal to . - - - Initializes a new instance of the class using the specified - A object used by the for sending and receiving data. - A Boolean value that indicates the closure behavior of the object used by the for sending and receiving data. This parameter indicates if the inner stream is left open. - A delegate responsible for validating the certificate supplied by the remote party. - A delegate responsible for selecting the certificate used for authentication. - The to use. - innerStream is not readable. -or- innerStream is not writable. -or- encryptionPolicy is not valid. - innerStream is null. -or- innerStream is equal to . - - - Called by clients to authenticate the server and optionally the client in a client-server connection. - The name of the server that shares this . - targetHost is null. - The authentication failed and left this object in an unusable state. - Authentication has already occurred. -or- Server authentication using this was tried previously. -or- Authentication is already in progress. - This object has been closed. - - - Called by clients to authenticate the server and optionally the client in a client-server connection. The authentication process uses the specified certificate collection and SSL protocol. - The name of the server that will share this . - The that contains client certificates. - The value that represents the protocol used for authentication. - A value that specifies whether the certificate revocation list is checked during authentication. - - - Called by clients to authenticate the server and optionally the client in a client-server connection as an asynchronous operation. - The name of the server that shares this . - Returns The task object representing the asynchronous operation. - targetHost is null. - The authentication failed and left this object in an unusable state. - Authentication has already occurred. -or- Server authentication using this was tried previously. -or- Authentication is already in progress. - This object has been closed. - - - Called by clients to authenticate the server and optionally the client in a client-server connection as an asynchronous operation. The authentication process uses the specified certificate collection and SSL protocol. - The name of the server that will share this . - The that contains client certificates. - The value that represents the protocol used for authentication. - A value that specifies whether the certificate revocation list is checked during authentication. - Returns The task object representing the asynchronous operation. - - - Called by servers to authenticate the server and optionally the client in a client-server connection using the specified certificate. - The certificate used to authenticate the server. - serverCertificate is null. - The authentication failed and left this object in an unusable state. - Authentication has already occurred. -or- Client authentication using this was tried previously. -or- Authentication is already in progress. - This object has been closed. - The method is not supported on Windows 95, Windows 98, or Windows Millennium. - - - Called by servers to authenticate the server and optionally the client in a client-server connection using the specified certificates, requirements and security protocol. - The X509Certificate used to authenticate the server. - A value that specifies whether the client is asked for a certificate for authentication. Note that this is only a request -- if no certificate is provided, the server still accepts the connection request. - The value that represents the protocol used for authentication. - A value that specifies whether the certificate revocation list is checked during authentication. - serverCertificate is null. - enabledSslProtocols is not a valid value. - The authentication failed and left this object in an unusable state. - Authentication has already occurred. -or- Client authentication using this was tried previously. -or- Authentication is already in progress. - This object has been closed. - The method is not supported on Windows 95, Windows 98, or Windows Millennium. - - - Called by servers to authenticate the server and optionally the client in a client-server connection using the specified certificates, requirements and security protocol as an asynchronous operation. - The X509Certificate used to authenticate the server. - A value that specifies whether the client is asked for a certificate for authentication. Note that this is only a request -- if no certificate is provided, the server still accepts the connection request. - The value that represents the protocol used for authentication. - A value that specifies whether the certificate revocation list is checked during authentication. - Returns The task object representing the asynchronous operation. - - - Called by servers to authenticate the server and optionally the client in a client-server connection using the specified certificate as an asynchronous operation. - The certificate used to authenticate the server. - Returns The task object representing the asynchronous operation. - serverCertificate is null. - The authentication failed and left this object in an unusable state. - Authentication has already occurred. -or- Client authentication using this was tried previously. -or- Authentication is already in progress. - This object has been closed. - The method is not supported on Windows 95, Windows 98, or Windows Millennium. - - - Called by clients to begin an asynchronous operation to authenticate the server and optionally the client. - The name of the server that shares this . - An delegate that references the method to invoke when the authentication is complete. - A user-defined object that contains information about the operation. This object is passed to the asyncCallback delegate when the operation completes. - An object that indicates the status of the asynchronous operation. - targetHost is null. - The authentication failed and left this object in an unusable state. - Authentication has already occurred. -or- Server authentication using this was tried previously. -or- Authentication is already in progress. - This object has been closed. - - - Called by clients to begin an asynchronous operation to authenticate the server and optionally the client using the specified certificates and security protocol. - The name of the server that shares this . - The containing client certificates. - The value that represents the protocol used for authentication. - A value that specifies whether the certificate revocation list is checked during authentication. - An delegate that references the method to invoke when the authentication is complete. - A user-defined object that contains information about the operation. This object is passed to the asyncCallback delegate when the operation completes. - An object that indicates the status of the asynchronous operation. - targetHost is null. - enabledSslProtocols is not a valid value. - The authentication failed and left this object in an unusable state. - Authentication has already occurred. -or- Server authentication using this was tried previously. -or- Authentication is already in progress. - This object has been closed. - - - Called by servers to begin an asynchronous operation to authenticate the client and optionally the server in a client-server connection. - The X509Certificate used to authenticate the server. - An delegate that references the method to invoke when the authentication is complete. - A user-defined object that contains information about the operation. This object is passed to the asyncCallback delegate when the operation completes. - An object indicating the status of the asynchronous operation. - serverCertificate is null. - The authentication failed and left this object in an unusable state. - Authentication has already occurred. -or- Client authentication using this was tried previously. -or- Authentication is already in progress. - This object has been closed. - The method is not supported on Windows 95, Windows 98, or Windows Millennium. - - - Called by servers to begin an asynchronous operation to authenticate the server and optionally the client using the specified certificates, requirements and security protocol. - The X509Certificate used to authenticate the server. - A value that specifies whether the client is asked for a certificate for authentication. Note that this is only a request -- if no certificate is provided, the server still accepts the connection request. - The value that represents the protocol used for authentication. - A value that specifies whether the certificate revocation list is checked during authentication. - An delegate that references the method to invoke when the authentication is complete. - A user-defined object that contains information about the operation. This object is passed to the asyncCallback delegate when the operation completes. - An object that indicates the status of the asynchronous operation. - serverCertificate is null. - enabledSslProtocols is not a valid value. - The authentication failed and left this object in an unusable state. - Authentication has already occurred. -or- Server authentication using this was tried previously. -or- Authentication is already in progress. - This object has been closed. - The method is not supported on Windows 95, Windows 98, or Windows Millennium. - - - Begins an asynchronous read operation that reads data from the stream and stores it in the specified array. - A array that receives the bytes read from the stream. - The zero-based location in buffer at which to begin storing the data read from this stream. - The maximum number of bytes to read from the stream. - An delegate that references the method to invoke when the read operation is complete. - A user-defined object that contains information about the read operation. This object is passed to the asyncCallback delegate when the operation completes. - An object that indicates the status of the asynchronous operation. - buffer is null. - offset -< -0. -or-offset > the length of buffer. -or- offset + count > the length of buffer. - The read operation failed. -or- Encryption is in use, but the data could not be decrypted. - There is already a read operation in progress. - This object has been closed. - Authentication has not occurred. - - - Begins an asynchronous write operation that writes s from the specified buffer to the stream. - A array that supplies the bytes to be written to the stream. - The zero-based location in buffer at which to begin reading bytes to be written to the stream. - An value that specifies the number of bytes to read from buffer. - An delegate that references the method to invoke when the write operation is complete. - A user-defined object that contains information about the write operation. This object is passed to the asyncCallback delegate when the operation completes. - An object indicating the status of the asynchronous operation. - buffer is null. - offset -< -0. -or-offset > the length of buffer. -or- offset + count > the length of buffer. - The write operation failed. - There is already a write operation in progress. - This object has been closed. - Authentication has not occurred. - - - Gets a value that indicates whether the underlying stream is readable. - true if authentication has occurred and the underlying stream is readable; otherwise false. - - - Gets a value that indicates whether the underlying stream is seekable. - This property always returns false. - - - Gets a value that indicates whether the underlying stream supports time-outs. - true if the underlying stream supports time-outs; otherwise, false. - - - Gets a value that indicates whether the underlying stream is writable. - true if authentication has occurred and the underlying stream is writable; otherwise false. - - - Gets a value that indicates whether the certificate revocation list is checked during the certificate validation process. - true if the certificate revocation list is checked; otherwise, false. - - - Gets a value that identifies the bulk encryption algorithm used by this . - A value. - The property was accessed before the completion of the authentication process or the authentication process failed. - - - Gets a value that identifies the strength of the cipher algorithm used by this . - An value that specifies the strength of the algorithm, in bits. - - - Releases the unmanaged resources used by the and optionally releases the managed resources. - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - Ends a pending asynchronous server authentication operation started with a previous call to . - An instance returned by a call to . - asyncResult is null. - asyncResult was not created by a call to . - The authentication failed and left this object in an unusable state. - There is no pending server authentication to complete. - - - Ends a pending asynchronous client authentication operation started with a previous call to . - An instance returned by a call to . - asyncResult is null. - asyncResult was not created by a call to . - The authentication failed and left this object in an unusable state. - There is no pending client authentication to complete. - - - Ends an asynchronous read operation started with a previous call to . - An instance returned by a call to - A value that specifies the number of bytes read from the underlying stream. - asyncResult is null. - asyncResult was not created by a call to . - Authentication has not occurred. - The read operation failed. - - - Ends an asynchronous write operation started with a previous call to . - An instance returned by a call to - asyncResult is null. - asyncResult was not created by a call to . - Authentication has not occurred. - The write operation failed. - - - Causes any buffered data to be written to the underlying device. - - - Gets the algorithm used for generating message authentication codes (MACs). - A value. - The property was accessed before the completion of the authentication process or the authentication process failed. - - - Gets a value that identifies the strength of the hash algorithm used by this instance. - An value that specifies the strength of the algorithm, in bits. Valid values are 128 or 160. - - - Gets a value that indicates whether authentication was successful. - true if successful authentication occurred; otherwise, false. - - - Gets a value that indicates whether this uses data encryption. - true if data is encrypted before being transmitted over the network and decrypted when it reaches the remote endpoint; otherwise false. - - - Gets a value that indicates whether both server and client have been authenticated. - true if the server has been authenticated; otherwise false. - - - Gets a value that indicates whether the local side of the connection used by this was authenticated as the server. - true if the local endpoint was successfully authenticated as the server side of the authenticated connection; otherwise false. - - - Gets a value that indicates whether the data sent using this stream is signed. - true if the data is signed before being transmitted; otherwise false. - - - Gets the key exchange algorithm used by this . - An value. - - - Gets a value that identifies the strength of the key exchange algorithm used by this instance. - An value that specifies the strength of the algorithm, in bits. - - - Gets the length of the underlying stream. - A . The length of the underlying stream. - Getting the value of this property is not supported when the underlying stream is a . - - - Gets the certificate used to authenticate the local endpoint. - An X509Certificate object that represents the certificate supplied for authentication or null if no certificate was supplied. - Authentication failed or has not occurred. - - - Gets or sets the current position in the underlying stream. - A . The current position in the underlying stream. - Setting this property is not supported. -or- Getting the value of this property is not supported when the underlying stream is a . - - - Reads data from this stream and stores it in the specified array. - A array that receives the bytes read from this stream. - A that contains the zero-based location in buffer at which to begin storing the data read from this stream. - A that contains the maximum number of bytes to read from this stream. - A value that specifies the number of bytes read. When there is no more data to be read, returns 0. - buffer is null. - offset -< -0. -or-offset > the length of buffer. -or- offset + count > the length of buffer. - The read operation failed. Check the inner exception, if present to determine the cause of the failure. - There is already a read operation in progress. - This object has been closed. - Authentication has not occurred. - - - Gets or sets the amount of time a read operation blocks waiting for data. - A that specifies the amount of time that elapses before a synchronous read operation fails. - - - Gets the certificate used to authenticate the remote endpoint. - An X509Certificate object that represents the certificate supplied for authentication or null if no certificate was supplied. - Authentication failed or has not occurred. - - - Throws a . - This value is ignored. - This value is ignored. - Always throws a . - Seeking is not supported by objects. - - - Sets the length of the underlying stream. - An value that specifies the length of the stream. - - - Gets a value that indicates the security protocol used to authenticate this connection. - The value that represents the protocol used for authentication. - - - Gets the used for authentication using extended protection. - The object that contains the channel binding token (CBT) used for extended protection. - - - Writes the specified data to this stream. - A array that supplies the bytes written to the stream. - buffer is null. - The write operation failed. - There is already a write operation in progress. - This object has been closed. - Authentication has not occurred. - - - Write the specified number of s to the underlying stream using the specified buffer and offset. - A array that supplies the bytes written to the stream. - A that contains the zero-based location in buffer at which to begin reading bytes to be written to the stream. - A that contains the number of bytes to read from buffer. - buffer is null. - offset -< -0. -or-offset > the length of buffer. -or- offset + count > the length of buffer. - The write operation failed. - There is already a write operation in progress. - This object has been closed. - Authentication has not occurred. - - - Gets or sets the amount of time a write operation blocks waiting for data. - A that specifies the amount of time that elapses before a synchronous write operation fails. - - - Specifies the security protocols that are supported by the Schannel security package. - - - Specifies the Secure Socket Layer (SSL) 3.0 security protocol. - - - - Specifies the Transport Layer Security (TLS) 1.0 security protocol. - - - - Specifies the Transport Layer Security (TLS) 1.1 security protocol. - - - - Specifies the Transport Layer Security (TLS) 1.2 security protocol. - - - - Provides connection management for HTTP connections. - - - Gets the Uniform Resource Identifier (URI) of the server that this object connects to. - An instance of the class that contains the URI of the Internet server that this object connects to. - The is in host mode. - - - Specifies the delegate to associate a local with a . - A delegate that forces a to use a particular local Internet Protocol (IP) address and port number. The default value is null. - - - Gets the certificate received for this object. - An instance of the class that contains the security certificate received for this object. - - - Gets the last client certificate sent to the server. - An object that contains the public values of the last client certificate sent to the server. - - - Removes the specified connection group from this object. - The name of the connection group that contains the connections to close and remove from this service point. - A value that indicates whether the connection group was closed. - - - Gets or sets the number of milliseconds after which an active connection is closed. - A that specifies the number of milliseconds that an active connection remains open. The default is -1, which allows an active connection to stay connected indefinitely. Set this property to 0 to force connections to close after servicing a request. - The value specified for a set operation is a negative number less than -1. - - - Gets or sets the maximum number of connections allowed on this object. - The maximum number of connections allowed on this object. - The connection limit is equal to or less than 0. - - - Gets the connection name. - A that represents the connection name. - - - Gets the number of open connections associated with this object. - The number of open connections associated with this object. - - - Gets or sets a value that determines whether 100-Continue behavior is used. - true to expect 100-Continue responses for POST requests; otherwise, false. The default value is true. - - - Gets the date and time that the object was last connected to a host. - A object that contains the date and time at which the object was last connected. - - - Gets or sets the amount of time a connection associated with the object can remain idle before the connection is closed. - The length of time, in milliseconds, that a connection associated with the object can remain idle before it is closed and reused for another connection. - is set to less than or greater than . - - - Gets the version of the HTTP protocol that the object uses. - A object that contains the HTTP protocol version that the object uses. - - - Gets or sets the size of the receiving buffer for the socket used by this . - A that contains the size, in bytes, of the receive buffer. The default is 8192. - The value specified for a set operation is greater than . - - - Enables or disables the keep-alive option on a TCP connection. - If set to true, then the TCP keep-alive option on a TCP connection will be enabled using the specified keepAliveTime and keepAliveInterval values. If set to false, then the TCP keep-alive option is disabled and the remaining parameters are ignored. The default value is false. - Specifies the timeout, in milliseconds, with no activity until the first keep-alive packet is sent. The value must be greater than 0. If a value of less than or equal to zero is passed an is thrown. - Specifies the interval, in milliseconds, between when successive keep-alive packets are sent if no acknowledgement is received. The value must be greater than 0. If a value of less than or equal to zero is passed an is thrown. - The value specified for keepAliveTime or keepAliveInterval parameter is less than or equal to 0. - - - Indicates whether the object supports pipelined connections. - true if the object supports pipelined connections; otherwise, false. - - - Gets or sets a value that determines whether the Nagle algorithm is used on connections managed by this object. - true to use the Nagle algorithm; otherwise, false. The default value is true. - - - Manages the collection of objects. - - - Gets or sets a value that indicates whether the certificate is checked against the certificate authority revocation list. - true if the certificate revocation list is checked; otherwise, false. - - - Gets or sets the maximum number of concurrent connections allowed by a object. - The maximum number of concurrent connections allowed by a object. The default value is 2. When an app is running as an ASP.NET host, it is not possible to alter the value of this property through the config file if the autoConfig property is set to true. However, you can change the value programmatically when the autoConfig property is true. Set your preferred value once, when the AppDomain loads. - is less than or equal to 0. - - - The default number of non-persistent connections (4) allowed on a object connected to an HTTP/1.0 or later server. This field is constant but is no longer used in the .NET Framework 2.0. - - - - The default number of persistent connections (2) allowed on a object connected to an HTTP/1.1 or later server. This field is constant and is used to initialize the property if the value of the property has not been set either directly or through configuration. - - - - Gets or sets a value that indicates how long a Domain Name Service (DNS) resolution is considered valid. - The time-out value, in milliseconds. A value of -1 indicates an infinite time-out period. The default value is 120,000 milliseconds (two minutes). - - - Gets or sets a value that indicates whether a Domain Name Service (DNS) resolution rotates among the applicable Internet Protocol (IP) addresses. - false if a DNS resolution always returns the first IP address for a particular host; otherwise true. The default is false. - - - Gets the for this instance. - The encryption policy to use for this instance. - - - Gets or sets a value that determines whether 100-Continue behavior is used. - true to enable 100-Continue behavior. The default value is true. - - - Finds an existing object or creates a new object to manage communications with the specified object. - A object that contains the address of the Internet resource to contact. - The proxy data for this request. - The object that manages communications for the request. - address is null. - The maximum number of objects defined in has been reached. - - - Finds an existing object or creates a new object to manage communications with the specified object. - The object of the Internet resource to contact. - The object that manages communications for the request. - address is null. - The maximum number of objects defined in has been reached. - - - Finds an existing object or creates a new object to manage communications with the specified Uniform Resource Identifier (URI). - The URI of the Internet resource to be contacted. - The proxy data for this request. - The object that manages communications for the request. - The URI specified in uriString is invalid. - The maximum number of objects defined in has been reached. - - - Gets or sets the maximum idle time of a object. - The maximum idle time, in milliseconds, of a object. The default value is 100,000 milliseconds (100 seconds). - is less than or greater than . - - - Gets or sets the maximum number of objects to maintain at any time. - The maximum number of objects to maintain. The default value is 0, which means there is no limit to the number of objects. - is less than 0 or greater than . - - - Setting this property value to true causes all outbound TCP connections from HttpWebRequest to use the native socket option SO_REUSE_UNICASTPORT on the socket. This causes the underlying outgoing ports to be shared. This is useful for scenarios where a large number of outgoing connections are made in a short time, and the app risks running out of ports. - Returns . - - - Gets or sets the security protocol used by the objects managed by the object. - One of the values defined in the enumeration. - The value specified to set the property is not a valid enumeration value. - - - Gets or sets the callback to validate a server certificate. - A . The default value is null. - - - Enables or disables the keep-alive option on a TCP connection. - If set to true, then the TCP keep-alive option on a TCP connection will be enabled using the specified keepAliveTime and keepAliveInterval values. If set to false, then the TCP keep-alive option is disabled and the remaining parameters are ignored. The default value is false. - Specifies the timeout, in milliseconds, with no activity until the first keep-alive packet is sent. The value must be greater than 0. If a value of less than or equal to zero is passed an is thrown. - Specifies the interval, in milliseconds, between when successive keep-alive packets are sent if no acknowledgement is received. The value must be greater than 0. If a value of less than or equal to zero is passed an is thrown. - The value specified for keepAliveTime or keepAliveInterval parameter is less than or equal to 0. - - - Determines whether the Nagle algorithm is used by the service points managed by this object. - true to use the Nagle algorithm; otherwise, false. The default value is true. - - - Stores serialized information from derived classes. - - - Creates a new instance of the class for the given address family. - An enumerated value. - - - Creates a new instance of the class using the specified address family and buffer size. - An enumerated value. - The number of bytes to allocate for the underlying buffer. - size is less than 2. These 2 bytes are needed to store family. - - - Determines whether the specified Object is equal to the current Object. - The to compare with the current Object. - true if the specified Object is equal to the current Object; otherwise, false. - - - Gets the enumerated value of the current . - One of the enumerated values. - - - Serves as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table. - A hash code for the current . - - - Gets or sets the specified index element in the underlying buffer. - The array index element of the desired information. - The value of the specified index element in the underlying buffer. - The specified index does not exist in the buffer. - - - Gets the underlying buffer size of the . - The underlying buffer size of the . - - - Returns information about the socket address. - A string that contains information about the . - - - Specifies the addressing scheme that an instance of the class can use. - - - AppleTalk address. - - - - Native ATM services address. - - - - Banyan address. - - - - Addresses for CCITT protocols, such as X.25. - - - - Address for MIT CHAOS protocols. - - - - Address for Microsoft cluster products. - - - - Address for Datakit protocols. - - - - Direct data-link interface address. - - - - DECnet address. - - - - European Computer Manufacturers Association (ECMA) address. - - - - FireFox address. - - - - NSC Hyperchannel address. - - - - IEEE 1284.4 workgroup address. - - - - ARPANET IMP address. - - - - Address for IP version 4. - - - - Address for IP version 6. - - - - IPX or SPX address. - - - - IrDA address. - - - - Address for ISO protocols. - - - - LAT address. - - - - MAX address. - - - - NetBios address. - - - - Address for Network Designers OSI gateway-enabled protocols. - - - - Address for Xerox NS protocols. - - - - Address for OSI protocols. - - - - Address for PUP protocols. - - - - IBM SNA address. - - - - Unix local to host address. - - - - Unknown address family. - - - - Unspecified address family. - - - - VoiceView address. - - - - Specifies the IO control codes supported by the method. - - - This value is equal to the Winsock 2 SIO_ABSORB_RTRALERT constant. - - - - Join a multicast group using an interface identified by its index. This control code is supported on Windows 2000 and later operating systems. This value is equal to the Winsock 2 SIO_INDEX_ADD_MCAST constant. - - - - Enable receiving notification when the list of local interfaces for the socket's protocol family changes. This control code is supported on Windows 2000 and later operating systems. This value is equal to the Winsock 2 SIO_ADDRESS_LIST_CHANGE constant. - - - - Return the list of local interfaces that the socket can bind to. This control code is supported on Windows 2000 and later operating systems. This value is equal to the Winsock 2 SIO_ADDRESS_LIST_QUERY constant. - - - - Sort the structure returned by the field and add scope ID information for IPv6 addresses. This control code is supported on Windows XP and later operating systems. This value is equal to the Winsock 2 SIO_ADDRESS_LIST_SORT constant. - - - - Associate this socket with the specified handle of a companion interface. Refer to the appropriate protocol-specific annex in the Winsock 2 reference or documentation for the particular companion interface for additional details. It is recommended that the Component Object Model (COM) be used instead of this IOCTL to discover and track other interfaces that might be supported by a socket. This control code is present for backward compatibility with systems where COM is not available or cannot be used for some other reason. This value is equal to the Winsock 2 SIO_ASSOCIATE_HANDLE constant. - - - - Enable notification for when data is waiting to be received. This value is equal to the Winsock 2 FIOASYNC constant. - - - - Bind the socket to a specified interface index. This control code is supported on Windows 2000 and later operating systems. This value is equal to the Winsock 2 SIO_INDEX_BIND constant. - - - - Return the number of bytes available for reading. This value is equal to the Winsock 2 FIONREAD constant. - - - - Remove the socket from a multicast group. This control code is supported on Windows 2000 and later operating systems. This value is equal to the Winsock 2 SIO_INDEX_ADD_MCAST constant. - - - - Replace the oldest queued datagram with an incoming datagram when the incoming message queues are full. This value is equal to the Winsock 2 SIO_ENABLE_CIRCULAR_QUEUEING constant. - - - - Discard the contents of the sending queue. This value is equal to the Winsock 2 SIO_FLUSH constant. - - - - Return a SOCKADDR structure that contains the broadcast address for the address family of the current socket. The returned address can be used with the method. This value is equal to the Winsock 2 SIO_GET_BROADCAST_ADDRESS constant. This value can be used on User Datagram Protocol (UDP) sockets only. - - - - Obtain provider-specific functions that are not part of the Winsock specification. Functions are specified using their provider-assigned GUID. This value is equal to the Winsock 2 SIO_GET_EXTENSION_FUNCTION_POINTER constant. - - - - Return the Quality of Service (QOS) attributes for the socket group. This value is reserved for future use, and is equal to the Winsock 2 SIO_GET_GROUP_QOS constant. - - - - Retrieve the QOS structure associated with the socket. This control is only supported on platforms that provide a QOS capable transport (Windows Me, Windows 2000, and later.) This value is equal to the Winsock 2 SIO_GET_QOS constant. - - - - Control sending TCP keep-alive packets and the interval at which they are sent. This control code is supported on Windows 2000 and later operating systems. For additional information, see RFC 1122 section 4.2.3.6. This value is equal to the Winsock 2 SIO_KEEPALIVE_VALS constant. - - - - This value is equal to the Winsock 2 SIO_LIMIT_BROADCASTS constant. - - - - Set the interface used for outgoing multicast packets. The interface is identified by its index. This control code is supported on Windows 2000 and later operating systems. This value is equal to the Winsock 2 SIO_INDEX_MCASTIF constant. - - - - Control the number of times a multicast packet can be forwarded by a router, also known as the Time to Live (TTL), or hop count. This value is equal to the Winsock 2 SIO_MULTICAST_SCOPE constant. - - - - Control whether multicast data sent by the socket appears as incoming data in the sockets receive queue. This value is equal to the Winsock 2 SIO_MULTIPOINT_LOOPBACK constant. - - - - Control whether the socket receives notification when a namespace query becomes invalid. This control code is supported on Windows XP and later operating systems. This value is equal to the Winsock 2 SIO_NSP_NOTIFY_CHANGE constant. - - - - Control the blocking behavior of the socket. If the argument specified with this control code is zero, the socket is placed in blocking mode. If the argument is nonzero, the socket is placed in nonblocking mode. This value is equal to the Winsock 2 FIONBIO constant. - - - - Return information about out-of-band data waiting to be received. When using this control code on stream sockets, the return value indicates the number of bytes available. - - - - Retrieve the underlying provider's SOCKET handle. This handle can be used to receive plug-and-play event notification. This control code is supported on Windows 2000 and later operating systems. This value is equal to the Winsock 2 SIO_QUERY_TARGET_PNP_HANDLE constant. - - - - Enable receiving all IPv4 packets on the network. The socket must have address family , the socket type must be , and the protocol type must be . The current user must belong to the Administrators group on the local computer, and the socket must be bound to a specific port. This control code is supported on Windows 2000 and later operating systems. This value is equal to the Winsock 2 SIO_RCVALL constant. - - - - Enable receiving all Internet Group Management Protocol (IGMP) packets on the network. The socket must have address family , the socket type must be , and the protocol type must be . The current user must belong to the Administrators group on the local computer, and the socket must be bound to a specific port. This control code is supported on Windows 2000 and later operating systems. This value is equal to the Winsock 2 SIO_RCVALL_IGMPMCAST constant. - - - - Enable receiving all multicast IPv4 packets on the network. These are packets with destination addresses in the range 224.0.0.0 through 239.255.255.255. The socket must have address family , the socket type must be , and the protocol type must be . The current user must belong to the Administrators group on the local computer, and the socket must be bound to a specific port. This control code is supported on Windows 2000 and later operating systems. This value is equal to the Winsock 2 SIO_RCVALL_MCAST constant. - - - - Enable receiving notification when the local interface used to access a remote endpoint changes. This value is equal to the Winsock 2 SIO_ROUTING_INTERFACE_CHANGE constant. - - - - Return the interface addresses that can be used to connect to the specified remote address. This value is equal to the Winsock 2 SIO_ROUTING_INTERFACE_QUERY constant. - - - - Set the Quality of Service (QOS) attributes for the socket group. This value is reserved for future use and is equal to the Winsock 2 SIO_SET_GROUP_QOS constant. - - - - Set the Quality of Service (QOS) attributes for the socket. QOS defines the bandwidth requirements for the socket. This control code is supported on Windows Me, Windows 2000, and later operating systems. This value is equal to the Winsock 2 SIO_SET_QOS constant. - - - - Return a handle for the socket that is valid in the context of a companion interface. This value is equal to the Winsock 2 SIO_TRANSLATE_HANDLE constant. - - - - Set the interface used for outgoing unicast packets. This value is equal to the Winsock 2 SIO_UCAST_IF constant. - - - - Presents the packet information from a call to or . - - - Gets the origin information of the packet that was received as a result of calling the method or method. - An that indicates the origin information of the packet that was received as a result of calling the method or method. For packets that were sent from a unicast address, the property will return the of the sender; for multicast or broadcast packets, the property will return the multicast or broadcast . - - - Returns a value that indicates whether this instance is equal to a specified object. - The object to compare with this instance. - true if comparand is an instance of and equals the value of the instance; otherwise, false. - - - Returns the hash code for this instance. - An Int32 hash code. - - - Gets the network interface information that is associated with a call to or . - An value, which represents the index of the network interface. You can use this index with to get more information about the relevant interface. - - - Tests whether two specified instances are equivalent. - The instance that is to the left of the equality operator. - The instance that is to the right of the equality operator. - true if packetInformation1 and packetInformation2 are equal; otherwise, false. - - - Tests whether two specified instances are not equal. - The instance that is to the left of the inequality operator. - The instance that is to the right of the inequality operator. - true if packetInformation1 and packetInformation2 are unequal; otherwise, false. - - - A value that enables restriction of an IPv6 socket to a specified scope, such as addresses with the same link local or site local prefix. - - - The IP protection level is edge restricted. This value would be used by applications designed to operate across the Internet. This setting does not allow Network Address Translation (NAT) traversal using the Windows Teredo implementation. These applications may bypass IPv4 firewalls, so applications must be hardened against Internet attacks directed at the opened port. On Windows Server 2003 and Windows XP, the default value for the IP Protection level on a socket is edge restricted. - - - - The IP protection level is restricted. This value would be used by intranet applications that do not implement Internet scenarios. These applications are generally not tested or hardened against Internet-style attacks. This setting will limit the received traffic to link-local only. - - - - The IP protection level is unrestricted. This value would be used by applications designed to operate across the Internet, including applications taking advantage of IPv6 NAT traversal capabilities built into Windows (Teredo, for example). These applications may bypass IPv4 firewalls, so applications must be hardened against Internet attacks directed at the opened port. On Windows Server 2008 R2 and Windows Vista, the default value for the IP Protection level on a socket is unrestricted. - - - - The IP protection level is unspecified. On Windows 7 and Windows Server 2008 R2, the default value for the IP Protection level on a socket is unspecified. - - - - Contains option values for joining an IPv6 multicast group. - - - Initializes a new version of the class for the specified IP multicast group. - The of the multicast group. - group is null. - - - Initializes a new instance of the class with the specified IP multicast group and the local interface address. - The group . - The local interface address. - ifindex is less than 0. -or- ifindex is greater than 0x00000000FFFFFFFF. - group is null. - - - Gets or sets the IP address of a multicast group. - An that contains the Internet address of a multicast group. - group is null. - - - Gets or sets the interface index that is associated with a multicast group. - A value that specifies the address of the interface. - The value that is specified for a set operation is less than 0 or greater than 0x00000000FFFFFFFF. - - - Specifies whether a will remain connected after a call to the or methods and the length of time it will remain connected, if data remains to be sent. - - - Initializes a new instance of the class. - true to remain connected after the method is called; otherwise, false. - The number of seconds to remain connected after the method is called. - - - Gets or sets a value that indicates whether to linger after the is closed. - true if the should linger after is called; otherwise, false. - - - Gets or sets the amount of time to remain connected after calling the method if data remains to be sent. - The amount of time, in seconds, to remain connected after calling . - - - Contains values used to join and drop multicast groups. - - - Initializes a new version of the class for the specified IP multicast group. - The of the multicast group. - group is null. - - - Initializes a new instance of the class with the specified IP multicast group address and interface index. - The of the multicast group. - The index of the interface that is used to send and receive multicast packets. - - - Initializes a new instance of the class with the specified IP multicast group address and local IP address associated with a network interface. - The group . - The local . - group is null. -or- mcint is null. - - - Gets or sets the IP address of a multicast group. - An that contains the Internet address of a multicast group. - - - Gets or sets the index of the interface that is used to send and receive multicast packets. - An integer that represents the index of a array element. - - - Gets or sets the local address associated with a multicast group. - An that contains the local address associated with a multicast group. - - - Provides the underlying stream of data for network access. - - - Creates a new instance of the class for the specified . - The that the will use to send and receive data. - The socket parameter is null. - The socket parameter is not connected. -or- The property of the socket parameter is not . -or- The socket parameter is in a nonblocking state. - - - Initializes a new instance of the class for the specified with the specified ownership. - The that the will use to send and receive data. - Set to true to indicate that the will take ownership of the ; otherwise, false. - The socket parameter is null. - The socket parameter is not connected. -or- the value of the property of the socket parameter is not . -or- the socket parameter is in a nonblocking state. - - - Creates a new instance of the class for the specified with the specified access rights. - The that the will use to send and receive data. - A bitwise combination of the values that specify the type of access given to the over the provided . - The socket parameter is null. - The socket parameter is not connected. -or- the property of the socket parameter is not . -or- the socket parameter is in a nonblocking state. - - - Creates a new instance of the class for the specified with the specified access rights and the specified ownership. - The that the will use to send and receive data. - A bitwise combination of the values that specifies the type of access given to the over the provided . - Set to true to indicate that the will take ownership of the ; otherwise, false. - The socket parameter is null. - The socket parameter is not connected. -or- The property of the socket parameter is not . -or- The socket parameter is in a nonblocking state. - - - Begins an asynchronous read from the . - An array of type that is the location in memory to store data read from the . - The location in buffer to begin storing the data. - The number of bytes to read from the . - The delegate that is executed when completes. - An object that contains any additional user-defined data. - An that represents the asynchronous call. - The buffer parameter is null. - The offset parameter is less than 0. -or- The offset parameter is greater than the length of the buffer paramater. -or- The size is less than 0. -or- The size is greater than the length of buffer minus the value of the offset parameter. - The underlying is closed. -or- There was a failure while reading from the network. -or- An error occurred when accessing the socket. - The is closed. - - - Begins an asynchronous write to a stream. - An array of type that contains the data to write to the . - The location in buffer to begin sending the data. - The number of bytes to write to the . - The delegate that is executed when completes. - An object that contains any additional user-defined data. - An that represents the asynchronous call. - The buffer parameter is null. - The offset parameter is less than 0. -or- The offset parameter is greater than the length of buffer. -or- The size parameter is less than 0. -or- The size parameter is greater than the length of buffer minus the value of the offset parameter. - The underlying is closed. -or- There was a failure while writing to the network. -or- An error occurred when accessing the socket. - The is closed. - - - Gets a value that indicates whether the supports reading. - true if data can be read from the stream; otherwise, false. The default value is true. - - - Gets a value that indicates whether the stream supports seeking. This property is not currently supported.This property always returns false. - false in all cases to indicate that cannot seek a specific location in the stream. - - - Indicates whether timeout properties are usable for . - true in all cases. - - - Gets a value that indicates whether the supports writing. - true if data can be written to the ; otherwise, false. The default value is true. - - - Closes the after waiting the specified time to allow data to be sent. - A 32-bit signed integer that specifies the number of milliseconds to wait to send any remaining data before closing. - The timeout parameter is less than -1. - - - Gets a value that indicates whether data is available on the to be read. - true if data is available on the stream to be read; otherwise, false. - The is closed. - The underlying is closed. - Use the property to obtain the specific error code, and refer to the Windows Sockets version 2 API error code documentation in MSDN for a detailed description of the error. - - - Releases the unmanaged resources used by the and optionally releases the managed resources. - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - Handles the end of an asynchronous read. - An that represents an asynchronous call. - The number of bytes read from the . - The asyncResult parameter is null. - The underlying is closed. -or- An error occurred when accessing the socket. - The is closed. - - - Handles the end of an asynchronous write. - The that represents the asynchronous call. - The asyncResult parameter is null. - The underlying is closed. -or- An error occurred while writing to the network. -or- An error occurred when accessing the socket. - The is closed. - - - Releases all resources used by the . - - - Flushes data from the stream. This method is reserved for future use. - - - Flushes data from the stream as an asynchronous operation. - A cancellation token used to propagate notification that this operation should be canceled. - Returns . The task object representing the asynchronous operation. - - - Gets the length of the data available on the stream. This property is not currently supported and always throws a . - The length of the data available on the stream. - Any use of this property. - - - Gets or sets the current position in the stream. This property is not currently supported and always throws a . - The current position in the stream. - Any use of this property. - - - Reads data from the . - An array of type that is the location in memory to store data read from the . - The location in buffer to begin storing the data to. - The number of bytes to read from the . - The number of bytes read from the , or 0 if the socket is closed. - The buffer parameter is null. - The offset parameter is less than 0. -or- The offset parameter is greater than the length of buffer. -or- The size parameter is less than 0. -or- The size parameter is greater than the length of buffer minus the value of the offset parameter. -or- An error occurred when accessing the socket. - The underlying is closed. - The is closed. -or- There is a failure reading from the network. - - - Gets or sets a value that indicates whether the can be read. - true to indicate that the can be read; otherwise, false. The default value is true. - - - Gets or sets the amount of time that a read operation blocks waiting for data. - A that specifies the amount of time, in milliseconds, that will elapse before a read operation fails. The default value, , specifies that the read operation does not time out. - The value specified is less than or equal to zero and is not . - - - Sets the current position of the stream to the given value. This method is not currently supported and always throws a . - This parameter is not used. - This parameter is not used. - The position in the stream. - Any use of this property. - - - Sets the length of the stream. This method always throws a . - This parameter is not used. - Any use of this property. - - - Gets the underlying . - A that represents the underlying network connection. - - - Writes data to the . - An array of type that contains the data to write to the . - The location in buffer from which to start writing data. - The number of bytes to write to the . - The buffer parameter is null. - The offset parameter is less than 0. -or- The offset parameter is greater than the length of buffer. -or- The size parameter is less than 0. -or- The size parameter is greater than the length of buffer minus the value of the offset parameter. - There was a failure while writing to the network. -or- An error occurred when accessing the socket. - The is closed. -or- There was a failure reading from the network. - - - Gets a value that indicates whether the is writable. - true if data can be written to the stream; otherwise, false. The default value is true. - - - Gets or sets the amount of time that a write operation blocks waiting for data. - A that specifies the amount of time, in milliseconds, that will elapse before a write operation fails. The default value, , specifies that the write operation does not time out. - The value specified is less than or equal to zero and is not . - - - Specifies the type of protocol that an instance of the class can use. - - - AppleTalk protocol. - - - - Native ATM services protocol. - - - - Banyan protocol. - - - - CCITT protocol, such as X.25. - - - - MIT CHAOS protocol. - - - - Microsoft Cluster products protocol. - - - - DataKit protocol. - - - - Direct data link protocol. - - - - DECNet protocol. - - - - European Computer Manufacturers Association (ECMA) protocol. - - - - FireFox protocol. - - - - NSC HyperChannel protocol. - - - - IEEE 1284.4 workgroup protocol. - - - - ARPANET IMP protocol. - - - - IP version 4 protocol. - - - - IP version 6 protocol. - - - - IPX or SPX protocol. - - - - IrDA protocol. - - - - ISO protocol. - - - - LAT protocol. - - - - MAX protocol. - - - - NetBIOS protocol. - - - - Network Designers OSI gateway enabled protocol. - - - - Xerox NS protocol. - - - - OSI protocol. - - - - PUP protocol. - - - - IBM SNA protocol. - - - - Unix local to host protocol. - - - - Unknown protocol. - - - - Unspecified protocol. - - - - VoiceView protocol. - - - - Specifies the protocols that the class supports. - - - Gateway To Gateway Protocol. - - - - Internet Control Message Protocol. - - - - Internet Control Message Protocol for IPv6. - - - - Internet Datagram Protocol. - - - - Internet Group Management Protocol. - - - - Internet Protocol. - - - - IPv6 Authentication header. For details, see RFC 2292 section 2.2.1, available at http://www.ietf.org. - - - - IPv6 Encapsulating Security Payload header. - - - - Internet Protocol version 4. - - - - Internet Protocol version 6 (IPv6). - - - - IPv6 Destination Options header. - - - - IPv6 Fragment header. - - - - IPv6 Hop by Hop Options header. - - - - IPv6 No next header. - - - - IPv6 Routing header. - - - - Internet Packet Exchange Protocol. - - - - Net Disk Protocol (unofficial). - - - - PARC Universal Packet Protocol. - - - - Raw IP packet protocol. - - - - Sequenced Packet Exchange protocol. - - - - Sequenced Packet Exchange version 2 protocol. - - - - Transmission Control Protocol. - - - - User Datagram Protocol. - - - - Unknown protocol. - - - - Unspecified protocol. - - - - Defines the polling modes for the method. - - - Error status mode. - - - - Read status mode. - - - - Write status mode. - - - - Represents a wrapper class for handle resources. - - - Initializes a new instance of the class with the specified invalid handle value. - The value of an invalid handle (usually 0 or -1). - The derived class resides in an assembly without unmanaged code access permission. - - - Marks the handle for releasing and freeing resources. - - - Releases all resources used by the . - - - Releases the unmanaged resources used by the class specifying whether to perform a normal dispose operation. - true for a normal dispose operation; false to finalize the handle. - - - Frees all resources associated with the handle. - - - Specifies the handle to be wrapped. - - - - Gets a value indicating whether the handle is closed. - true if the handle is closed; otherwise, false. - - - When overridden in a derived class, gets a value indicating whether the handle value is invalid. - true if the handle is valid; otherwise, false. - - - When overridden in a derived class, executes the code required to free the handle. - true if the handle is released successfully; otherwise, in the event of a catastrophic failure, false. In this case, it generates a releaseHandleFailed Managed Debugging Assistant. - - - Sets the handle to the specified pre-existing handle. - The pre-existing handle to use. - - - Marks a handle as invalid. - - - Wraps objects the marshaler should marshal as a VT_CY. - - - Initializes a new instance of the class with the Decimal to be wrapped and marshaled as type VT_CY. - The Decimal to be wrapped and marshaled as VT_CY. - - - Initializes a new instance of the class with the object containing the Decimal to be wrapped and marshaled as type VT_CY. - The object containing the Decimal to be wrapped and marshaled as VT_CY. - The obj parameter is not a type. - - - Gets the wrapped object to be marshaled as type VT_CY. - The wrapped object to be marshaled as type VT_CY. - - - Indicates whether the method's IUnknown::QueryInterface calls can use the interface. - - - IUnknown::QueryInterface method calls can use the interface. When you use this value, the method overload functions like the overload. - - - - IUnknown::QueryInterface method calls should ignore the interface. - - - - Provides return values for the method. - - - The interface for a specific interface ID is not available. In this case, the returned interface is null. E_NOINTERFACE is returned to the caller of IUnknown::QueryInterface. - - - - The interface pointer that is returned from the method can be used as the result of IUnknown::QueryInterface. - - - - The custom QueryInterface was not used. Instead, the default implementation of IUnknown::QueryInterface should be used. - - - - Specifies the value of the enumeration. This class cannot be inherited. - - - Initializes a new instance of the class with the specified value. - One of the values. - - - Gets the default value of for any call to . - The default value of for any call to . - - - Specifies the paths that are used to search for DLLs that provide functions for platform invokes. - - - Initializes a new instance of the class, specifying the paths to use when searching for the targets of platform invokes. - A bitwise combination of enumeration values that specify the paths that the LoadLibraryEx function searches during platform invokes. - - - Gets a bitwise combination of enumeration values that specify the paths that the LoadLibraryEx function searches during platform invokes. - A bitwise combination of enumeration values that specify search paths for platform invokes. - - - Sets the default value of a parameter when called from a language that supports default parameters. This class cannot be inherited. - - - Initializes a new instance of the class with the default value of a parameter. - An object that represents the default value of a parameter. - - - Gets the default value of a parameter. - An object that represents the default value of a parameter. - - - Wraps objects the marshaler should marshal as a VT_DISPATCH. - - - Initializes a new instance of the class with the object being wrapped. - The object to be wrapped and converted to . - obj is not a class or an array. -or- obj does not support IDispatch. - The obj parameter was marked with a attribute that was passed a value of false. -or- The obj parameter inherits from a type marked with a attribute that was passed a value of false. - - - Gets the object wrapped by the . - The object wrapped by the . - - - Specifies the COM dispatch identifier (DISPID) of a method, field, or property. - - - Initializes a new instance of the DispIdAttribute class with the specified DISPID. - The DISPID for the member. - - - Gets the DISPID for the member. - The DISPID for the member. - - - Indicates that the attributed method is exposed by an unmanaged dynamic-link library (DLL) as a static entry point. - - - Initializes a new instance of the class with the name of the DLL containing the method to import. - The name of the DLL that contains the unmanaged method. This can include an assembly display name, if the DLL is included in an assembly. - - - Enables or disables best-fit mapping behavior when converting Unicode characters to ANSI characters. - - - - Indicates the calling convention of an entry point. - - - - Indicates how to marshal string parameters to the method and controls name mangling. - - - - Indicates the name or ordinal of the DLL entry point to be called. - - - - Controls whether the field causes the common language runtime to search an unmanaged DLL for entry-point names other than the one specified. - - - - Indicates whether unmanaged methods that have HRESULT or retval return values are directly translated or whether HRESULT or retval return values are automatically converted to exceptions. - - - - Indicates whether the callee calls the SetLastError Win32 API function before returning from the attributed method. - - - - Enables or disables the throwing of an exception on an unmappable Unicode character that is converted to an ANSI "?" character. - - - - Gets the name of the DLL file that contains the entry point. - The name of the DLL file that contains the entry point. - - - Specifies the paths that are used to search for DLLs that provide functions for platform invokes. - - - Include the application directory in the DLL search path. - - - - When searching for assembly dependencies, include the directory that contains the assembly itself, and search that directory first. This value is used by the .NET Framework, before the paths are passed to the Win32 LoadLibraryEx function. - - - - Search the application directory, and then call the Win32 LoadLibraryEx function with the LOAD_WITH_ALTERED_SEARCH_PATH flag. This value is ignored if any other value is specified. Operating systems that do not support the attribute use this value, and ignore other values. - - - - Include the application directory, the %WinDir%\System32 directory, and user directories in the DLL search path. - - - - Include the %WinDir%\System32 directory in the DLL search path. - - - - Search for the dependencies of a DLL in the folder where the DLL is located before searching other folders. - - - - Include any path that was explicitly added to the process-wide search path by using the Win32 AddDllDirectory function. - - - - Wraps objects the marshaler should marshal as a VT_ERROR. - - - Initializes a new instance of the class with the HRESULT that corresponds to the exception supplied. - The exception to be converted to an error code. - - - Initializes a new instance of the class with the HRESULT of the error. - The HRESULT of the error. - - - Initializes a new instance of the class with an object containing the HRESULT of the error. - The object containing the HRESULT of the error. - The errorCode parameter is not an type. - - - Gets the error code of the wrapper. - The HRESULT of the error. - - - The base exception type for all COM interop exceptions and structured exception handling (SEH) exceptions. - - - Initializes a new instance of the ExternalException class with default properties. - - - Initializes a new instance of the ExternalException class with a specified error message. - The error message that specifies the reason for the exception. - - - Initializes a new instance of the ExternalException class from serialization data. - The object that holds the serialized object data. - The contextual information about the source or destination. - info is null. - - - Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. - The error message that explains the reason for the exception. - The exception that is the cause of the current exception. If the inner parameter is not null, the current exception is raised in a catch block that handles the inner exception. - - - Initializes a new instance of the ExternalException class with a specified error message and the HRESULT of the error. - The error message that specifies the reason for the exception. - The HRESULT of the error. - - - Gets the HRESULT of the error. - The HRESULT of the error. - - - Returns a string that contains the HRESULT of the error. - A string that represents the HRESULT. - - - Indicates the physical position of fields within the unmanaged representation of a class or structure. - - - Initializes a new instance of the class with the offset in the structure to the beginning of the field. - The offset in bytes from the beginning of the structure to the beginning of the field. - - - Gets the offset from the beginning of the structure to the beginning of the field. - The offset from the beginning of the structure to the beginning of the field. - - - Provides a way to access a managed object from unmanaged memory. - - - Retrieves the address of an object in a handle. - The address of the pinned object as an . - The handle is any type other than . - - - Allocates a handle for the specified object. - The object that uses the . - A new that protects the object from garbage collection. This must be released with when it is no longer needed. - An instance with nonprimitive (non-blittable) members cannot be pinned. - - - Allocates a handle of the specified type for the specified object. - The object that uses the . - One of the values, indicating the type of to create. - A new of the specified type. This must be released with when it is no longer needed. - An instance with nonprimitive (non-blittable) members cannot be pinned. - - - Determines whether the specified object is equal to the current object. - The object to compare with the current object. - true if the specified object is equal to the current object; otherwise, false. - - - Releases a . - The handle was freed or never initialized. - - - Returns a new object created from a handle to a managed object. - An handle to a managed object to create a object from. - A new object that corresponds to the value parameter. - The value of the value parameter is . - - - Returns an identifier for the current object. - An identifier for the current object. - - - Gets a value indicating whether the handle is allocated. - true if the handle is allocated; otherwise, false. - - - Returns a value indicating whether two objects are equal. - A object to compare with the b parameter. - A object to compare with the a parameter. - true if the a and b parameters are equal; otherwise, false. - - - - - - - - - - - Returns a value indicating whether two objects are not equal. - A object to compare with the b parameter. - A object to compare with the a parameter. - true if the a and b parameters are not equal; otherwise, false. - - - Gets or sets the object this handle represents. - The object this handle represents. - The handle was freed, or never initialized. - - - Returns the internal integer representation of a object. - A object to retrieve an internal integer representation from. - An object that represents a object. - - - Represents the types of handles the class can allocate. - - - This handle type represents an opaque handle, meaning you cannot resolve the address of the pinned object through the handle. You can use this type to track an object and prevent its collection by the garbage collector. This enumeration member is useful when an unmanaged client holds the only reference, which is undetectable from the garbage collector, to a managed object. - - - - This handle type is similar to , but allows the address of the pinned object to be taken. This prevents the garbage collector from moving the object and hence undermines the efficiency of the garbage collector. Use the method to free the allocated handle as soon as possible. - - - - This handle type is used to track an object, but allow it to be collected. When an object is collected, the contents of the are zeroed. Weak references are zeroed before the finalizer runs, so even if the finalizer resurrects the object, the Weak reference is still zeroed. - - - - This handle type is similar to , but the handle is not zeroed if the object is resurrected during finalization. - - - - Supplies an explicit when an automatic GUID is undesirable. - - - Initializes a new instance of the class with the specified GUID. - The to be assigned. - - - Gets the of the class. - The of the class. - - - Tracks outstanding handles and forces a garbage collection when the specified threshold is reached. - - - Initializes a new instance of the class using a name and a threshold at which to begin handle collection. - A name for the collector. This parameter allows you to name collectors that track handle types separately. - A value that specifies the point at which collections should begin. - The initialThreshold parameter is less than 0. - - - Initializes a new instance of the class using a name, a threshold at which to begin handle collection, and a threshold at which handle collection must occur. - A name for the collector. This parameter allows you to name collectors that track handle types separately. - A value that specifies the point at which collections should begin. - A value that specifies the point at which collections must occur. This should be set to the maximum number of available handles. - The initialThreshold parameter is less than 0. -or- The maximumThreshold parameter is less than 0. - The maximumThreshold parameter is less than the initialThreshold parameter. - - - Increments the current handle count. - The property is less than 0. - - - Gets the number of handles collected. - The number of handles collected. - - - Gets a value that specifies the point at which collections should begin. - A value that specifies the point at which collections should begin. - - - Gets a value that specifies the point at which collections must occur. - A value that specifies the point at which collections must occur. - - - Gets the name of a object. - This property allows you to name collectors that track handle types separately. - - - Decrements the current handle count. - The property is less than 0. - - - Wraps a managed object holding a handle to a resource that is passed to unmanaged code using platform invoke. - - - Initializes a new instance of the class with the object to wrap and a handle to the resource used by unmanaged code. - A managed object that should not be finalized until the platform invoke call returns. - An that indicates a handle to a resource. - - - Gets the handle to a resource. - The handle to a resource. - - - - - - - Returns the internal integer representation of a object. - A object to retrieve an internal integer representation from. - An object that represents a object. - - - Gets the object holding the handle to a resource. - The object holding the handle to a resource. - - - Provides a way for clients to access the actual object, rather than the adapter object handed out by a custom marshaler. - - - Provides access to the underlying object wrapped by a custom marshaler. - The object contained by the adapter object. - - - Enables users to write activation code for managed objects that extend . - - - Creates a new instance of the specified type. - The type to activate. - A associated with the specified type. - - - Provides custom wrappers for handling method calls. - - - Performs necessary cleanup of the managed data when it is no longer needed. - The managed object to be destroyed. - - - Performs necessary cleanup of the unmanaged data when it is no longer needed. - A pointer to the unmanaged data to be destroyed. - - - Returns the size of the native data to be marshaled. - The size, in bytes, of the native data. - - - Converts the managed data to unmanaged data. - The managed object to be converted. - A pointer to the COM view of the managed object. - - - Converts the unmanaged data to managed data. - A pointer to the unmanaged data to be wrapped. - An object that represents the managed view of the COM data. - - - Enables developers to provide a custom, managed implementation of the IUnknown::QueryInterface(REFIID riid, void **ppvObject) method. - - - Returns an interface according to a specified interface ID. - The GUID of the requested interface. - A reference to the requested interface, when this method returns. - One of the enumeration values that indicates whether a custom implementation of IUnknown::QueryInterface was used. - - - Indicates that data should be marshaled from the caller to the callee, but not back to the caller. - - - Initializes a new instance of the class. - - - Indicates whether a managed interface is dual, dispatch-only, or IUnknown -only when exposed to COM. - - - Initializes a new instance of the class with the specified enumeration member. - Describes how the interface should be exposed to COM clients. - - - Initializes a new instance of the class with the specified enumeration member. - One of the values that describes how the interface should be exposed to COM clients. - - - Gets the value that describes how the interface should be exposed to COM. - The value that describes how the interface should be exposed to COM. - - - The exception thrown when an invalid COM object is used. - - - Initializes an instance of the InvalidComObjectException with default properties. - - - Initializes an instance of the InvalidComObjectException with a message. - The message that indicates the reason for the exception. - - - Initializes a new instance of the COMException class from serialization data. - The object that holds the serialized object data. - The contextual information about the source or destination. - info is null. - - - Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. - The error message that explains the reason for the exception. - The exception that is the cause of the current exception. If the inner parameter is not null, the current exception is raised in a catch block that handles the inner exception. - - - The exception thrown by the marshaler when it encounters an argument of a variant type that can not be marshaled to managed code. - - - Initializes a new instance of the InvalidOleVariantTypeException class with default values. - - - Initializes a new instance of the InvalidOleVariantTypeException class with a specified message. - The message that indicates the reason for the exception. - - - Initializes a new instance of the InvalidOleVariantTypeException class from serialization data. - The object that holds the serialized object data. - The contextual information about the source or destination. - info is null. - - - Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. - The error message that explains the reason for the exception. - The exception that is the cause of the current exception. If the inner parameter is not null, the current exception is raised in a catch block that handles the inner exception. - - - Controls the layout of an object when exported to unmanaged code. - - - The runtime automatically chooses an appropriate layout for the members of an object in unmanaged memory. Objects defined with this enumeration member cannot be exposed outside of managed code. Attempting to do so generates an exception. - - - - The precise position of each member of an object in unmanaged memory is explicitly controlled, subject to the setting of the field. Each member must use the to indicate the position of that field within the type. - - - - The members of the object are laid out sequentially, in the order in which they appear when exported to unmanaged memory. The members are laid out according to the packing specified in , and can be noncontiguous. - - - - Indicates that a method's unmanaged signature expects a locale identifier (LCID) parameter. - - - Initializes a new instance of the LCIDConversionAttribute class with the position of the LCID in the unmanaged signature. - Indicates the position of the LCID argument in the unmanaged signature, where 0 is the first argument. - - - Gets the position of the LCID argument in the unmanaged signature. - The position of the LCID argument in the unmanaged signature, where 0 is the first argument. - - - Provides a collection of methods for allocating unmanaged memory, copying unmanaged memory blocks, and converting managed to unmanaged types, as well as other miscellaneous methods used when interacting with unmanaged code. - - - Increments the reference count on the specified interface. - The interface reference count to increment. - The new value of the reference count on the pUnk parameter. - - - Allocates a block of memory of specified size from the COM task memory allocator. - The size of the block of memory to be allocated. - An integer representing the address of the block of memory allocated. This memory must be released with . - There is insufficient memory to satisfy the request. - - - Allocates memory from the unmanaged memory of the process by using the specified number of bytes. - The required number of bytes in memory. - A pointer to the newly allocated memory. This memory must be released using the method. - There is insufficient memory to satisfy the request. - - - Allocates memory from the unmanaged memory of the process by using the pointer to the specified number of bytes. - The required number of bytes in memory. - A pointer to the newly allocated memory. This memory must be released using the method. - There is insufficient memory to satisfy the request. - - - Indicates whether runtime callable wrappers (RCWs) from any context are available for cleanup. - true if there are any RCWs available for cleanup; otherwise, false. - - - Gets an interface pointer identified by the specified moniker. - The moniker corresponding to the desired interface pointer. - An object containing a reference to the interface pointer identified by the monikerName parameter. A moniker is a name, and in this case, the moniker is defined by an interface. - An unrecognized HRESULT was returned by the unmanaged BindToMoniker method. - - - Changes the strength of an object's COM Callable Wrapper (CCW) handle. - The object whose CCW holds a reference counted handle. The handle is strong if the reference count on the CCW is greater than zero; otherwise, it is weak. - true to change the strength of the handle on the otp parameter to weak, regardless of its reference count; false to reset the handle strength on otp to be reference counted. - - - Notifies the runtime to clean up all Runtime Callable Wrappers (RCWs) allocated in the current context. - - - Copies data from a one-dimensional, managed single-precision floating-point number array to an unmanaged memory pointer. - The one-dimensional array to copy from. - The zero-based index in the source array where copying should start. - The memory pointer to copy to. - The number of array elements to copy. - startIndex and length are not valid. - source, startIndex, destination, or length is null. - - - Copies data from a one-dimensional, managed array to an unmanaged memory pointer. - The one-dimensional array to copy from. - The zero-based index in the source array where copying should start. - The memory pointer to copy to. - The number of array elements to copy. - source, destination, startIndex, or length is null. - - - Copies data from an unmanaged memory pointer to a managed single-precision floating-point number array. - The memory pointer to copy from. - The array to copy to. - The zero-based index in the destination array where copying should start. - The number of array elements to copy. - source, destination, startIndex, or length is null. - - - Copies data from an unmanaged memory pointer to a managed 64-bit signed integer array. - The memory pointer to copy from. - The array to copy to. - The zero-based index in the destination array where copying should start. - The number of array elements to copy. - source, destination, startIndex, or length is null. - - - Copies data from an unmanaged memory pointer to a managed 32-bit signed integer array. - The memory pointer to copy from. - The array to copy to. - The zero-based index in the destination array where copying should start. - The number of array elements to copy. - source, destination, startIndex, or length is null. - - - Copies data from an unmanaged memory pointer to a managed 16-bit signed integer array. - The memory pointer to copy from. - The array to copy to. - The zero-based index in the destination array where copying should start. - The number of array elements to copy. - source, destination, startIndex, or length is null. - - - Copies data from an unmanaged memory pointer to a managed double-precision floating-point number array. - The memory pointer to copy from. - The array to copy to. - The zero-based index in the destination array where copying should start. - The number of array elements to copy. - source, destination, startIndex, or length is null. - - - Copies data from an unmanaged memory pointer to a managed array. - The memory pointer to copy from. - The array to copy to. - The zero-based index in the destination array where copying should start. - The number of array elements to copy. - source, destination, startIndex, or length is null. - - - Copies data from an unmanaged memory pointer to a managed 8-bit unsigned integer array. - The memory pointer to copy from. - The array to copy to. - The zero-based index in the destination array where copying should start. - The number of array elements to copy. - source, destination, startIndex, or length is null. - - - Copies data from a one-dimensional, managed 64-bit signed integer array to an unmanaged memory pointer. - The one-dimensional array to copy from. - The zero-based index in the source array where copying should start. - The memory pointer to copy to. - The number of array elements to copy. - startIndex and length are not valid. - source, startIndex, destination, or length is null. - - - Copies data from a one-dimensional, managed 32-bit signed integer array to an unmanaged memory pointer. - The one-dimensional array to copy from. - The zero-based index in the source array where copying should start. - The memory pointer to copy to. - The number of array elements to copy. - startIndex and length are not valid. - startIndex or length is null. - - - Copies data from a one-dimensional, managed 16-bit signed integer array to an unmanaged memory pointer. - The one-dimensional array to copy from. - The zero-based index in the source array where copying should start. - The memory pointer to copy to. - The number of array elements to copy. - startIndex and length are not valid. - source, startIndex, destination, or length is null. - - - Copies data from an unmanaged memory pointer to a managed character array. - The memory pointer to copy from. - The array to copy to. - The zero-based index in the destination array where copying should start. - The number of array elements to copy. - source, destination, startIndex, or length is null. - - - Copies data from a one-dimensional, managed double-precision floating-point number array to an unmanaged memory pointer. - The one-dimensional array to copy from. - The zero-based index in the source array where copying should start. - The memory pointer to copy to. - The number of array elements to copy. - startIndex and length are not valid. - source, startIndex, destination, or length is null. - - - Copies data from a one-dimensional, managed character array to an unmanaged memory pointer. - The one-dimensional array to copy from. - The zero-based index in the source array where copying should start. - The memory pointer to copy to. - The number of array elements to copy. - startIndex and length are not valid. - startIndex, destination, or length is null. - - - Copies data from a one-dimensional, managed 8-bit unsigned integer array to an unmanaged memory pointer. - The one-dimensional array to copy from. - The zero-based index in the source array where copying should start. - The memory pointer to copy to. - The number of array elements to copy. - startIndex and length are not valid. - source, startIndex, destination, or length is null. - - - Aggregates a managed object with the specified COM object. - The outer IUnknown pointer. - An object to aggregate. - The inner IUnknown pointer of the managed object. - o is a Windows Runtime object. - - - [Supported in the .NET Framework 4.5.1 and later versions] Aggregates a managed object of the specified type with the specified COM object. - The outer IUnknown pointer. - The managed object to aggregate. - The type of the managed object to aggregate. - The inner IUnknown pointer of the managed object. - o is a Windows Runtime object. - - - Wraps the specified COM object in an object of the specified type. - The object to be wrapped. - The type of wrapper to create. - The newly wrapped object that is an instance of the desired type. - t must derive from __ComObject. -or- t is a Windows Runtime type. - The t parameter is null. - o cannot be converted to the destination type because it does not support all required interfaces. - - - [Supported in the .NET Framework 4.5.1 and later versions] Wraps the specified COM object in an object of the specified type. - The object to be wrapped. - The type of object to wrap. - The type of object to return. - The newly wrapped object. - T must derive from __ComObject. -or- T is a Windows Runtime type. - o cannot be converted to the TWrapper because it does not support all required interfaces. - - - Frees all substructures that the specified unmanaged memory block points to. - A pointer to an unmanaged block of memory. - Type of a formatted class. This provides the layout information necessary to delete the buffer in the ptr parameter. - structureType has an automatic layout. Use sequential or explicit instead. - - - [Supported in the .NET Framework 4.5.1 and later versions] Frees all substructures of a specified type that the specified unmanaged memory block points to. - A pointer to an unmanaged block of memory. - The type of the formatted structure. This provides the layout information necessary to delete the buffer in the ptr parameter. - T has an automatic layout. Use sequential or explicit instead. - - - Releases all references to a Runtime Callable Wrapper (RCW) by setting its reference count to 0. - The RCW to be released. - The new value of the reference count of the RCW associated with the o parameter, which is 0 (zero) if the release is successful. - o is not a valid COM object. - o is null. - - - Frees a BSTR using the COM SysFreeString function. - The address of the BSTR to be freed. - - - Frees a block of memory allocated by the unmanaged COM task memory allocator. - The address of the memory to be freed. - - - Frees memory previously allocated from the unmanaged memory of the process. - The handle returned by the original matching call to . - - - Returns a pointer to an IUnknown interface that represents the specified interface on the specified object. Custom query interface access is enabled by default. - The object that provides the interface. - The type of interface that is requested. - The interface pointer that represents the specified interface for the object. - The T parameter is not an interface. -or- The type is not visible to COM. -or- The T parameter is a generic type. - The o parameter does not support the requested interface. - The o parameter is null. -or- The T parameter is null. - - - Returns a pointer to an IUnknown interface that represents the specified interface on the specified object. Custom query interface access is controlled by the specified customization mode. - The object that provides the interface. - The type of interface that is requested. - One of the enumeration values that indicates whether to apply an IUnknown::QueryInterface customization that is supplied by an . - The interface pointer that represents the interface for the object. - The T parameter is not an interface. -or- The type is not visible to COM. -or- The T parameter is a generic type. - The object o does not support the requested interface. - The o parameter is null. -or- The T parameter is null. - - - [Supported in the .NET Framework 4.5.1 and later versions] Returns a pointer to an IUnknown interface that represents the specified interface on an object of the specified type. Custom query interface access is enabled by default. - The object that provides the interface. - The type of o. - The type of interface to return. - The interface pointer that represents the TInterface interface. - The TInterface parameter is not an interface. -or- The type is not visible to COM. -or- The T parameter is an open generic type. - The o parameter does not support the TInterface interface. - The o parameter is null. - - - Converts an unmanaged function pointer to a delegate. - The unmanaged function pointer to be converted. - The type of the delegate to be returned. - A delegate instance that can be cast to the appropriate delegate type. - The t parameter is not a delegate or is generic. - The ptr parameter is null. -or- The t parameter is null. - - - [Supported in the .NET Framework 4.5.1 and later versions] Converts an unmanaged function pointer to a delegate of a specified type. - The unmanaged function pointer to convert. - The type of the delegate to return. - A instance of the specified delegate type. - The TDelegate generic parameter is not a delegate, or it is an open generic type. - The ptr parameter is null. - - - Retrieves a code that identifies the type of the exception that occurred. - The type of the exception. - - - Converts the specified HRESULT error code to a corresponding object. - The HRESULT to be converted. - An object that represents the converted HRESULT. - - - Converts the specified HRESULT error code to a corresponding object, with additional error information passed in an IErrorInfo interface for the exception object. - The HRESULT to be converted. - A pointer to the IErrorInfo interface that provides more information about the error. You can specify IntPtr(0) to use the current IErrorInfo interface, or IntPtr(-1) to ignore the current IErrorInfo interface and construct the exception just from the error code. - An object that represents the converted HRESULT and information obtained from errorInfo. - - - Converts a delegate into a function pointer that is callable from unmanaged code. - The delegate to be passed to unmanaged code. - A value that can be passed to unmanaged code, which, in turn, can use it to call the underlying managed delegate. - The d parameter is a generic type. - The d parameter is null. - - - [Supported in the .NET Framework 4.5.1 and later versions] Converts a delegate of a specified type to a function pointer that is callable from unmanaged code. - The delegate to be passed to unmanaged code. - The type of delegate to convert. - A value that can be passed to unmanaged code, which, in turn, can use it to call the underlying managed delegate. - The d parameter is null. - - - Converts the specified exception to an HRESULT. - The exception to convert to an HRESULT. - The HRESULT mapped to the supplied exception. - - - Returns the HRESULT corresponding to the last error incurred by Win32 code executed using . - The HRESULT corresponding to the last Win32 error code. - - - Returns an IUnknown interface from a managed object. - The object whose IUnknown interface is requested. - The IUnknown pointer for the o parameter. - - - Returns the error code returned by the last unmanaged function that was called using platform invoke that has the flag set. - The last error code set by a call to the Win32 SetLastError function. - - - Converts an object to a COM VARIANT. - The object for which to get a COM VARIANT. - A pointer to receive the VARIANT that corresponds to the obj parameter. - The obj parameter is a generic type. - - - [Supported in the .NET Framework 4.5.1 and later versions] Converts an object of a specified type to a COM VARIANT. - The object for which to get a COM VARIANT. - A pointer to receive the VARIANT that corresponds to the obj parameter. - The type of the object to convert. - - - Returns an instance of a type that represents a COM object by a pointer to its IUnknown interface. - A pointer to the IUnknown interface. - An object that represents the specified unmanaged COM object. - - - Converts a COM VARIANT to an object. - A pointer to a COM VARIANT. - An object that corresponds to the pSrcNativeVariant parameter. - pSrcNativeVariant is not a valid VARIANT type. - pSrcNativeVariant has an unsupported type. - - - [Supported in the .NET Framework 4.5.1 and later versions] Converts a COM VARIANT to an object of a specified type. - A pointer to a COM VARIANT. - The type to which to convert the COM VARIANT. - An object of the specified type that corresponds to the pSrcNativeVariant parameter. - pSrcNativeVariant is not a valid VARIANT type. - pSrcNativeVariant has an unsupported type. - - - Converts an array of COM VARIANTs to an array of objects. - A pointer to the first element of an array of COM VARIANTs. - The count of COM VARIANTs in aSrcNativeVariant. - An object array that corresponds to aSrcNativeVariant. - cVars is a negative number. - - - [Supported in the .NET Framework 4.5.1 and later versions] Converts an array of COM VARIANTs to an array of a specified type. - A pointer to the first element of an array of COM VARIANTs. - The count of COM VARIANTs in aSrcNativeVariant. - The type of the array to return. - An array of T objects that corresponds to aSrcNativeVariant. - cVars is a negative number. - - - Gets the first slot in the virtual function table (v-table or VTBL) that contains user-defined methods. - A type that represents an interface. - The first VTBL slot that contains user-defined methods. The first slot is 3 if the interface is based on IUnknown, and 7 if the interface is based on IDispatch. - t is not visible from COM. - - - Returns the type associated with the specified class identifier (CLSID). - The CLSID of the type to return. - System.__ComObject regardless of whether the CLSID is valid. - - - Retrieves the name of the type represented by an ITypeInfo object. - An object that represents an ITypeInfo pointer. - The name of the type that the typeInfo parameter points to. - The typeInfo parameter is null. - - - Creates a unique Runtime Callable Wrapper (RCW) object for a given IUnknown interface. - A managed pointer to an IUnknown interface. - A unique RCW for the specified IUnknown interface. - - - Indicates whether a specified object represents a COM object. - The object to check. - true if the o parameter is a COM type; otherwise, false. - o is null. - - - Returns the field offset of the unmanaged form of the managed class. - A value type or formatted reference type that specifies the managed class. You must apply the to the class. - The field within the t parameter. - The offset, in bytes, for the fieldName parameter within the specified class that is declared by platform invoke. - The class cannot be exported as a structure or the field is nonpublic. Beginning with the .NET Framework version 2.0, the field may be private. - The t parameter is null. - - - [Supported in the .NET Framework 4.5.1 and later versions] Returns the field offset of the unmanaged form of a specified managed class. - The name of the field in the T type. - A managed value type or formatted reference type. You must apply the attribute to the class. - The offset, in bytes, for the fieldName parameter within the specified class that is declared by platform invoke. - - - Executes one-time method setup tasks without calling the method. - The method to be checked. - The m parameter is null. - The m parameter is not a object. - - - Performs a pre-link check for all methods on a class. - The class whose methods are to be checked. - The c parameter is null. - - - Copies all characters up to the first null character from an unmanaged ANSI string to a managed , and widens each ANSI character to Unicode. - The address of the first character of the unmanaged string. - A managed string that holds a copy of the unmanaged ANSI string. If ptr is null, the method returns a null string. - - - Allocates a managed , copies a specified number of characters from an unmanaged ANSI string into it, and widens each ANSI character to Unicode. - The address of the first character of the unmanaged string. - The byte count of the input string to copy. - A managed string that holds a copy of the native ANSI string if the value of the ptr parameter is not null; otherwise, this method returns null. - len is less than zero. - - - Allocates a managed and copies all characters up to the first null character from a string stored in unmanaged memory into it. - For Unicode platforms, the address of the first Unicode character. -or- For ANSI plaforms, the address of the first ANSI character. - A managed string that holds a copy of the unmanaged string if the value of the ptr parameter is not null; otherwise, this method returns null. - - - Allocates a managed and copies the specified number of characters from a string stored in unmanaged memory into it. - For Unicode platforms, the address of the first Unicode character. -or- For ANSI plaforms, the address of the first ANSI character. - The number of characters to copy. - A managed string that holds a copy of the native string if the value of the ptr parameter is not null; otherwise, this method returns null. - len is less than zero. - - - Allocates a managed and copies a binary string (BSTR) stored in unmanaged memory into it. - The address of the first character of the unmanaged string. - A managed string that holds a copy of the unmanaged string. - ptr equals . - - - Allocates a managed and copies all characters up to the first null character from an unmanaged Unicode string into it. - The address of the first character of the unmanaged string. - A managed string that holds a copy of the unmanaged string if the value of the ptr parameter is not null; otherwise, this method returns null. - - - Allocates a managed and copies a specified number of characters from an unmanaged Unicode string into it. - The address of the first character of the unmanaged string. - The number of Unicode characters to copy. - A managed string that holds a copy of the unmanaged string if the value of the ptr parameter is not null; otherwise, this method returns null. - - - Marshals data from an unmanaged block of memory to a managed object. - A pointer to an unmanaged block of memory. - The object to which the data is to be copied. This must be an instance of a formatted class. - Structure layout is not sequential or explicit. -or- Structure is a boxed value type. - - - Marshals data from an unmanaged block of memory to a newly allocated managed object of the specified type. - A pointer to an unmanaged block of memory. - The type of object to be created. This object must represent a formatted class or a structure. - A managed object containing the data pointed to by the ptr parameter. - The structureType parameter layout is not sequential or explicit. -or- The structureType parameter is a generic type. - structureType is null. - The class specified by structureType does not have an accessible default constructor. - - - [Supported in the .NET Framework 4.5.1 and later versions] Marshals data from an unmanaged block of memory to a newly allocated managed object of the type specified by a generic type parameter. - A pointer to an unmanaged block of memory. - The type of the object to which the data is to be copied. This must be a formatted class or a structure. - A managed object that contains the data that the ptr parameter points to. - The layout of T is not sequential or explicit. - The class specified by T does not have an accessible default constructor. - - - [Supported in the .NET Framework 4.5.1 and later versions] Marshals data from an unmanaged block of memory to a managed object of the specified type. - A pointer to an unmanaged block of memory. - The object to which the data is to be copied. - The type of structure. This must be a formatted class. - Structure layout is not sequential or explicit. - - - Requests a pointer to a specified interface from a COM object. - The interface to be queried. - The interface identifier (IID) of the requested interface. - When this method returns, contains a reference to the returned interface. - An HRESULT that indicates the success or failure of the call. - - - Reads a single byte at a given offset (or index) from unmanaged memory. - The base address in unmanaged memory from which to read. - An additional byte offset, which is added to the ptr parameter before reading. - The byte read from unmanaged memory at the given offset. - Base address (ptr) plus offset byte (ofs) produces a null or invalid address. - - - Reads a single byte at a given offset (or index) from unmanaged memory. - The base address in unmanaged memory of the source object. - An additional byte offset, which is added to the ptr parameter before reading. - The byte read from unmanaged memory at the given offset. - Base address (ptr) plus offset byte (ofs) produces a null or invalid address. - ptr is an object. This method does not accept parameters. - - - Reads a single byte from unmanaged memory. - The address in unmanaged memory from which to read. - The byte read from unmanaged memory. - ptr is not a recognized format. -or- ptr is null. -or- ptr is invalid. - - - Reads a 16-bit signed integer from unmanaged memory. - The address in unmanaged memory from which to read. - The 16-bit signed integer read from unmanaged memory. - ptr is not a recognized format. -or- ptr is null. -or- ptr is invalid. - - - Reads a 16-bit signed integer at a given offset from unmanaged memory. - The base address in unmanaged memory from which to read. - An additional byte offset, which is added to the ptr parameter before reading. - The 16-bit signed integer read from unmanaged memory at the given offset. - Base address (ptr) plus offset byte (ofs) produces a null or invalid address. - - - Reads a 16-bit signed integer at a given offset from unmanaged memory. - The base address in unmanaged memory of the source object. - An additional byte offset, which is added to the ptr parameter before reading. - The 16-bit signed integer read from unmanaged memory at the given offset. - Base address (ptr) plus offset byte (ofs) produces a null or invalid address. - ptr is an object. This method does not accept parameters. - - - Reads a 32-bit signed integer from unmanaged memory. - The address in unmanaged memory from which to read. - The 32-bit signed integer read from unmanaged memory. - ptr is not a recognized format. -or- ptr is null. -or- ptr is invalid. - - - Reads a 32-bit signed integer at a given offset from unmanaged memory. - The base address in unmanaged memory from which to read. - An additional byte offset, which is added to the ptr parameter before reading. - The 32-bit signed integer read from unmanaged memory. - Base address (ptr) plus offset byte (ofs) produces a null or invalid address. - - - Reads a 32-bit signed integer at a given offset from unmanaged memory. - The base address in unmanaged memory of the source object. - An additional byte offset, which is added to the ptr parameter before reading. - The 32-bit signed integer read from unmanaged memory at the given offset. - Base address (ptr) plus offset byte (ofs) produces a null or invalid address. - ptr is an object. This method does not accept parameters. - - - Reads a 64-bit signed integer from unmanaged memory. - The address in unmanaged memory from which to read. - The 64-bit signed integer read from unmanaged memory. - ptr is not a recognized format. -or- ptr is null. -or- ptr is invalid. - - - Reads a 64-bit signed integer at a given offset from unmanaged memory. - The base address in unmanaged memory from which to read. - An additional byte offset, which is added to the ptr parameter before reading. - The 64-bit signed integer read from unmanaged memory at the given offset. - Base address (ptr) plus offset byte (ofs) produces a null or invalid address. - - - Reads a 64-bit signed integer at a given offset from unmanaged memory. - The base address in unmanaged memory of the source object. - An additional byte offset, which is added to the ptr parameter before reading. - The 64-bit signed integer read from unmanaged memory at the given offset. - Base address (ptr) plus offset byte (ofs) produces a null or invalid address. - ptr is an object. This method does not accept parameters. - - - Reads a processor native sized integer at a given offset from unmanaged memory. - The base address in unmanaged memory from which to read. - An additional byte offset, which is added to the ptr parameter before reading. - The integer read from unmanaged memory at the given offset. - Base address (ptr) plus offset byte (ofs) produces a null or invalid address. - - - Reads a processor native sized integer from unmanaged memory. - The base address in unmanaged memory of the source object. - An additional byte offset, which is added to the ptr parameter before reading. - The integer read from unmanaged memory at the given offset. - Base address (ptr) plus offset byte (ofs) produces a null or invalid address. - ptr is an object. This method does not accept parameters. - - - Reads a processor native-sized integer from unmanaged memory. - The address in unmanaged memory from which to read. - The integer read from unmanaged memory. A 32 bit integer is returned on 32 bit machines and a 64 bit integer is returned on 64 bit machines. - ptr is not a recognized format. -or- ptr is null. -or- ptr is invalid. - - - Resizes a block of memory previously allocated with . - A pointer to memory allocated with . - The new size of the allocated block. - An integer representing the address of the reallocated block of memory. This memory must be released with . - There is insufficient memory to satisfy the request. - - - Resizes a block of memory previously allocated with . - A pointer to memory allocated with . - The new size of the allocated block. This is not a pointer; it is the byte count you are requesting, cast to type . If you pass a pointer, it is treated as a size. - A pointer to the reallocated memory. This memory must be released using . - There is insufficient memory to satisfy the request. - - - Decrements the reference count on the specified interface. - The interface to release. - The new value of the reference count on the interface specified by the pUnk parameter. - - - Decrements the reference count of the Runtime Callable Wrapper (RCW) associated with the specified COM object. - The COM object to release. - The new value of the reference count of the RCW associated with o. This value is typically zero since the RCW keeps just one reference to the wrapped COM object regardless of the number of managed clients calling it. - o is not a valid COM object. - o is null. - - - Allocates an unmanaged binary string (BSTR) and copies the contents of a managed object into it. - The managed object to copy. - The address, in unmanaged memory, where the s parameter was copied to, or 0 if a null object was supplied. - The s parameter is null. - The current computer is not running Windows 2000 Service Pack 3 or later. - There is insufficient memory available. - - - Copies the contents of a managed object to a block of memory allocated from the unmanaged COM task allocator. - The managed object to copy. - The address, in unmanaged memory, where the s parameter was copied to, or 0 if a null object was supplied. - The s parameter is null. - The current computer is not running Windows 2000 Service Pack 3 or later. - There is insufficient memory available. - - - Copies the contents of a managed object to a block of memory allocated from the unmanaged COM task allocator. - The managed object to copy. - The address, in unmanaged memory, where the s parameter was copied to, or 0 if a null object was supplied. - The s parameter is null. - The current computer is not running Windows 2000 Service Pack 3 or later. - There is insufficient memory available. - - - Copies the contents of a managed into unmanaged memory, converting into ANSI format as it copies. - The managed object to copy. - The address, in unmanaged memory, to where the s parameter was copied, or 0 if a null object was supplied. - The s parameter is null. - The current computer is not running Windows 2000 Service Pack 3 or later. - There is insufficient memory available. - - - Copies the contents of a managed object into unmanaged memory. - The managed object to copy. - The address, in unmanaged memory, where s was copied, or 0 if s is a object whose length is 0. - The s parameter is null. - The current computer is not running Windows 2000 Service Pack 3 or later. - There is insufficient memory available. - - - Returns the unmanaged size of an object in bytes. - The object whose size is to be returned. - The size of the specified object in unmanaged code. - The structure parameter is null. - - - Returns the size of an unmanaged type in bytes. - The type whose size is to be returned. - The size of the specified type in unmanaged code. - The t parameter is a generic type. - The t parameter is null. - - - [Supported in the .NET Framework 4.5.1 and later versions] Returns the size of an unmanaged type in bytes. - The type whose size is to be returned. - The size, in bytes, of the type that is specified by the T generic type parameter. - - - [Supported in the .NET Framework 4.5.1 and later versions] Returns the unmanaged size of an object of a specified type in bytes. - The object whose size is to be returned. - The type of the structure parameter. - The size, in bytes, of the specified object in unmanaged code. - The structure parameter is null. - - - Allocates a BSTR and copies the contents of a managed into it. - The managed string to be copied. - An unmanaged pointer to the BSTR, or 0 if s is null. - There is insufficient memory available. - The length for s is out of range. - - - Copies the contents of a managed to a block of memory allocated from the unmanaged COM task allocator. - A managed string to be copied. - An integer representing a pointer to the block of memory allocated for the string, or 0 if s is null. - There is insufficient memory available. - The s parameter exceeds the maximum length allowed by the operating system. - - - Copies the contents of a managed to a block of memory allocated from the unmanaged COM task allocator. - A managed string to be copied. - The allocated memory block, or 0 if s is null. - There is insufficient memory available. - The length for s is out of range. - - - Copies the contents of a managed to a block of memory allocated from the unmanaged COM task allocator. - A managed string to be copied. - An integer representing a pointer to the block of memory allocated for the string, or 0 if s is null. - The s parameter exceeds the maximum length allowed by the operating system. - There is insufficient memory available. - - - Copies the contents of a managed into unmanaged memory, converting into ANSI format as it copies. - A managed string to be copied. - The address, in unmanaged memory, to where s was copied, or 0 if s is null. - There is insufficient memory available. - The s parameter exceeds the maximum length allowed by the operating system. - - - Copies the contents of a managed into unmanaged memory, converting into ANSI format if required. - A managed string to be copied. - The address, in unmanaged memory, to where the string was copied, or 0 if s is null. - There is insufficient memory available. - - - Copies the contents of a managed into unmanaged memory. - A managed string to be copied. - The address, in unmanaged memory, to where the s was copied, or 0 if s is null. - The method could not allocate enough native heap memory. - The s parameter exceeds the maximum length allowed by the operating system. - - - Marshals data from a managed object to an unmanaged block of memory. - A managed object that holds the data to be marshaled. This object must be a structure or an instance of a formatted class. - A pointer to an unmanaged block of memory, which must be allocated before this method is called. - true to call the method on the ptr parameter before this method copies the data. The block must contain valid data. Note that passing false when the memory block already contains data can lead to a memory leak. - structure is a reference type that is not a formatted class. -or- structure is a generic type. - - - [Supported in the .NET Framework 4.5.1 and later versions] Marshals data from a managed object of a specified type to an unmanaged block of memory. - A managed object that holds the data to be marshaled. The object must be a structure or an instance of a formatted class. - A pointer to an unmanaged block of memory, which must be allocated before this method is called. - true to call the method on the ptr parameter before this method copies the data. The block must contain valid data. Note that passing false when the memory block already contains data can lead to a memory leak. - The type of the managed object. - structure is a reference type that is not a formatted class. - - - Represents the default character size on the system; the default is 2 for Unicode systems and 1 for ANSI systems. This field is read-only. - - - - Represents the maximum size of a double byte character set (DBCS) size, in bytes, for the current operating system. This field is read-only. - - - - Throws an exception with a specific failure HRESULT value. - The HRESULT corresponding to the desired exception. - - - Throws an exception with a specific failure HRESULT, based on the specified IErrorInfo interface. - The HRESULT corresponding to the desired exception. - A pointer to the IErrorInfo interface that provides more information about the error. You can specify IntPtr(0) to use the current IErrorInfo interface, or IntPtr(-1) to ignore the current IErrorInfo interface and construct the exception just from the error code. - - - Gets the address of the element at the specified index inside the specified array. - The array that contains the desired element. - The index in the arr parameter of the desired element. - The address of index inside arr. - - - [Supported in the .NET Framework 4.5.1 and later versions] Gets the address of the element at the specified index in an array of a specified type. - The array that contains the desired element. - The index of the desired element in the arr array. - The type of the array. - The address of index in arr. - - - Writes a single byte value to unmanaged memory at a specified offset. - The base address in unmanaged memory of the target object. - An additional byte offset, which is added to the ptr parameter before writing. - The value to write. - Base address (ptr) plus offset byte (ofs) produces a null or invalid address. - ptr is an object. This method does not accept parameters. - - - Writes a single byte value to unmanaged memory at a specified offset. - The base address in unmanaged memory to write to. - An additional byte offset, which is added to the ptr parameter before writing. - The value to write. - Base address (ptr) plus offset byte (ofs) produces a null or invalid address. - - - Writes a single byte value to unmanaged memory. - The address in unmanaged memory to write to. - The value to write. - ptr is not a recognized format. -or- ptr is null. -or- ptr is invalid. - - - Writes a character as a 16-bit integer value to unmanaged memory. - The address in unmanaged memory to write to. - The value to write. - ptr is not a recognized format. -or- ptr is null. -or- ptr is invalid. - - - Writes a 16-bit integer value to unmanaged memory. - The address in unmanaged memory to write to. - The value to write. - ptr is not a recognized format. -or- ptr is null. -or- ptr is invalid. - - - Writes a 16-bit signed integer value to unmanaged memory at a specified offset. - The base address in the native heap to write to. - An additional byte offset, which is added to the ptr parameter before writing. - The value to write. - Base address (ptr) plus offset byte (ofs) produces a null or invalid address. - - - Writes a 16-bit signed integer value into unmanaged memory at a specified offset. - The base address in unmanaged memory to write to. - An additional byte offset, which is added to the ptr parameter before writing. - The value to write. - Base address (ptr) plus offset byte (ofs) produces a null or invalid address. - - - Writes a 16-bit signed integer value to unmanaged memory at a specified offset. - The base address in unmanaged memory of the target object. - An additional byte offset, which is added to the ptr parameter before writing. - The value to write. - Base address (ptr) plus offset byte (ofs) produces a null or invalid address. - ptr is an object. This method does not accept parameters. - - - Writes a 16-bit signed integer value to unmanaged memory at a specified offset. - The base address in unmanaged memory of the target object. - An additional byte offset, which is added to the ptr parameter before writing. - The value to write. - Base address (ptr) plus offset byte (ofs) produces a null or invalid address. - ptr is an object. This method does not accept parameters. - - - Writes a 32-bit signed integer value to unmanaged memory. - The address in unmanaged memory to write to. - The value to write. - ptr is not a recognized format. -or- ptr is null. -or- ptr is invalid. - - - Writes a 32-bit signed integer value into unmanaged memory at a specified offset. - The base address in unmanaged memory to write to. - An additional byte offset, which is added to the ptr parameter before writing. - The value to write. - Base address (ptr) plus offset byte (ofs) produces a null or invalid address. - - - Writes a 32-bit signed integer value to unmanaged memory at a specified offset. - The base address in unmanaged memory of the target object. - An additional byte offset, which is added to the ptr parameter before writing. - The value to write. - Base address (ptr) plus offset byte (ofs) produces a null or invalid address. - ptr is an object. This method does not accept parameters. - - - Writes a 64-bit signed integer value to unmanaged memory at a specified offset. - The base address in unmanaged memory of the target object. - An additional byte offset, which is added to the ptr parameter before writing. - The value to write. - Base address (ptr) plus offset byte (ofs) produces a null or invalid address. - ptr is an object. This method does not accept parameters. - - - Writes a 64-bit signed integer value to unmanaged memory. - The address in unmanaged memory to write to. - The value to write. - ptr is not a recognized format. -or- ptr is null. -or- ptr is invalid. - - - Writes a 64-bit signed integer value to unmanaged memory at a specified offset. - The base address in unmanaged memory to write. - An additional byte offset, which is added to the ptr parameter before writing. - The value to write. - Base address (ptr) plus offset byte (ofs) produces a null or invalid address. - - - Writes a processor native sized integer value into unmanaged memory. - The address in unmanaged memory to write to. - The value to write. - ptr is not a recognized format. -or- ptr is null. -or- ptr is invalid. - - - Writes a processor native-sized integer value to unmanaged memory at a specified offset. - The base address in unmanaged memory to write to. - An additional byte offset, which is added to the ptr parameter before writing. - The value to write. - Base address (ptr) plus offset byte (ofs) produces a null or invalid address. - - - Writes a processor native sized integer value to unmanaged memory. - The base address in unmanaged memory of the target object. - An additional byte offset, which is added to the ptr parameter before writing. - The value to write. - Base address (ptr) plus offset byte (ofs) produces a null or invalid address. - ptr is an object. This method does not accept parameters. - - - Frees a BSTR pointer that was allocated using the method. - The address of the BSTR to free. - - - Frees an unmanaged string pointer that was allocated using the method. - The address of the unmanaged string to free. - - - Frees an unmanaged string pointer that was allocated using the method. - The address of the unmanaged string to free. - - - Frees an unmanaged string pointer that was allocated using the method. - The address of the unmanaged string to free. - - - Frees an unmanaged string pointer that was allocated using the method. - The address of the unmanaged string to free. - - - Allows an assembly to be called by partially trusted code. Without this declaration, only fully trusted callers are able to use the assembly. This class cannot be inherited. - - - Initializes a new instance of the class. - - - Gets or sets the default partial trust visibility for code that is marked with the (APTCA) attribute. - One of the enumeration values. The default is . - - - The exception that is thrown when authentication fails for an authentication stream. - - - Initializes a new instance of the class with no message. - - - Initializes a new instance of the class with the specified message. - A that describes the authentication failure. - - - Initializes a new instance of the class from the specified instances of the and classes. - A instance that contains the information required to deserialize the new instance. - A instance. - - - Initializes a new instance of the class with the specified message and inner exception. - A that describes the authentication failure. - The that is the cause of the current exception. - - - Defines the possible cipher algorithms for the class. - - - The Advanced Encryption Standard (AES) algorithm. - - - - The Advanced Encryption Standard (AES) algorithm with a 128 bit key. - - - - The Advanced Encryption Standard (AES) algorithm with a 192 bit key. - - - - The Advanced Encryption Standard (AES) algorithm with a 256 bit key. - - - - The Data Encryption Standard (DES) algorithm. - - - - No encryption algorithm is used. - - - - No encryption is used with a Null cipher algorithm. - - - - Rivest's Code 2 (RC2) algorithm. - - - - Rivest's Code 4 (RC4) algorithm. - - - - The Triple Data Encryption Standard (3DES) algorithm. - - - - Specifies the algorithm used to create keys shared by the client and server. - - - The Diffie Hellman ephemeral key exchange algorithm. - - - - No key exchange algorithm is used. - - - - The RSA public-key exchange algorithm. - - - - The RSA public-key signature algorithm. - - - - The class encapsulates a pointer to the opaque data used to bind an authenticated transaction to a secure channel. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class. - A Boolean value that indicates if the application owns the safe handle to a native memory region containing the byte data that would be passed to native calls that provide extended protection for integrated windows authentication. - - - The property gets the size, in bytes, of the channel binding token associated with the instance. - The size, in bytes, of the channel binding token in the instance. - - - The enumeration represents the kinds of channel bindings that can be queried from secure channels. - - - A channel binding unique to a given endpoint (a TLS server certificate, for example). - - - - A channel binding completely unique to a given channel (a TLS session key, for example). - - - - An unknown channel binding type. - - - - The class represents the extended protection policy used by the server to validate incoming client connections. - - - Initializes a new instance of the class that specifies when the extended protection policy should be enforced. - A value that indicates when the extended protection policy should be enforced. - - - Initializes a new instance of the class from a object that contains the required data to populate the . - A instance that contains the information that is required to serialize the new instance. - A that contains the source of the serialized stream that is associated with the new instance. - - - Initializes a new instance of the class that specifies when the extended protection policy should be enforced and the channel binding token (CBT) to be used. - A value that indicates when the extended protection policy should be enforced. - A that contains a custom channel binding to use for validation. - policyEnforcement is specified as . - customChannelBinding is null. - - - Initializes a new instance of the class that specifies when the extended protection policy should be enforced, the kind of protection enforced by the policy, and a custom Service Provider Name (SPN) list that is used to match against a client's SPN. - A value that indicates when the extended protection policy should be enforced. - A value that indicates the kind of protection enforced by the policy. - A that contains the custom SPN list that is used to match against a client's SPN. - policyEnforcement is specified as . - customServiceNames is null or an empty list. - - - Initializes a new instance of the class that specifies when the extended protection policy should be enforced, the kind of protection enforced by the policy, and a custom Service Provider Name (SPN) list that is used to match against a client's SPN. - A value that indicates when the extended protection policy should be enforced. - A value that indicates the kind of protection enforced by the policy. - A that contains the custom SPN list that is used to match against a client's SPN. - policyEnforcement is specified as . - customServiceNames is null or an empty list. - - - Gets a custom channel binding token (CBT) to use for validation. - A that contains a custom channel binding to use for validation. - - - Gets the custom Service Provider Name (SPN) list used to match against a client's SPN. - A that contains the custom SPN list that is used to match against a client's SPN. - - - Indicates whether the operating system supports integrated windows authentication with extended protection. - true if the operating system supports integrated windows authentication with extended protection, otherwise false. - - - Gets when the extended protection policy should be enforced. - A value that indicates when the extended protection policy should be enforced. - - - Gets the kind of protection enforced by the extended protection policy. - A value that indicates the kind of protection enforced by the policy. - - - Gets a string representation for the extended protection policy instance. - A instance that contains the representation of the instance. - - - Populates a object with the required data to serialize an object. - A object that holds the serialized data for an object. - A that contains the destination of the serialized stream that is associated with the new . - - - The class represents the type converter for extended protection policy used by the server to validate incoming client connections. - - - Initializes a new instance of the class. - - - Returns whether this converter can convert the object to the specified type. - The object to convert. - A that represents the type you want to convert to. - true if this converter can perform the conversion; otherwise false. - - - Convert the object to the specified type - An that provides a format context. - A object. If null is passed, the current culture is assumed. - The to convert. This should be a object. - The to convert the value parameter to. - An that represents the converted value parameter. - The destinationType parameter is null. - The conversion could not be performed. - - - The enumeration specifies when the should be enforced. - - - The is always enforced. Clients that don’t support extended protection will fail to authenticate. - - - - The is never enforced and extended protection is disabled. - - - - The is enforced only if the client and server supports extended protection. - - - - The enumeration specifies the protection scenario enforced by the policy. - - - The transport will select between a secure and standard protection scenario depending on the type of channel used. For secure protection, integrated Windows authentication is wrapped in a secure channel and has an exactly matching channel binding token with no Service Provider Name (SPN) validation. For standard protection, integrated Windows authentication is optionally wrapped in a secure channel with an optional channel binding token and SPN validation is required. So if the request comes through a secure channel, the channel binding token (CBT) is checked, otherwise the SPN is checked. - - - - Integrated Windows authentication is wrapped in a secure channel terminated by a trusted proxy and has a channel binding token with SPN validation required. This requires the presence of a CBT, but the CBT is not checked while the SPN is checked. - - - - The class is a read-only collection of service principal names. - - - Initializes a new read-only instance of the class based on an existing . - An instance of the class that contains the specified values of service names to be used to initialize the class. - item is null. - item is empty. - - - Returns a value indicating whether the specified string occurs within this instance. - The string to seek. - Returns . true if the searchServiceName parameter occurs within this instance; otherwise, false. - - - Merges the current with the specified values to create a new containing the union. - An instance of the class that contains the specified values of service names to be merged. - A new instance that contains the union of the existing instance merged with the specified values. - serviceNames is null. - serviceNames is empty. - - - Merges the current with the specified values to create a new containing the union. - A string that contains the specified values of service names to be used to initialize the class. - A new instance that contains the union of the existing instance merged with the specified values. - serviceNames is null. - serviceNames is empty. - - - Specifies the algorithm used for generating message authentication codes (MACs). - - - The Message Digest 5 (MD5) hashing algorithm. - - - - No hashing algorithm is used. - - - - The Secure Hashing Algorithm (SHA1). - - - - The exception that is thrown when authentication fails for an authentication stream and cannot be retried. - - - Initializes a new instance of the class with no message. - - - Initializes a new instance of the class with the specified message. - A that describes the authentication failure. - - - Initializes a new instance of the class from the specified instances of the and classes. - A instance that contains the information required to deserialize the new instance. - A instance. - - - Initializes a new instance of the class with the specified message and inner exception. - A that describes the authentication failure. - The that is the cause of the current exception. - - - Defines the possible versions of . - - - Specifies that either Secure Sockets Layer (SSL) 3.0 or Transport Layer Security (TLS) 1.0 are acceptable for secure communications - - - - No SSL protocol is specified. - - - - Specifies the SSL 2.0 protocol. SSL 2.0 has been superseded by the TLS protocol and is provided for backward compatibility only. - - - - Specifies the SSL 3.0 protocol. SSL 3.0 has been superseded by the TLS protocol and is provided for backward compatibility only. - - - - Specifies the TLS 1.0 security protocol. The TLS protocol is defined in IETF RFC 2246. - - - - Specifies the TLS 1.1 security protocol. The TLS protocol is defined in IETF RFC 4346. - - - - Specifies the TLS 1.2 security protocol. The TLS protocol is defined in IETF RFC 5246. - - - - Represents a claim. - - - Initializes an instance of with the specified . - A pointing to a . - reader is null. - - - Initializes a new instance of the class. - The security claim. - - - Initializes a new instance of the class with the specified reader and subject. - The binary reader. - The subject that this claim describes. - - - Initializes a new instance of the class with the specified security claim and subject. - The security claim. - The subject that this claim describes. - - - Initializes a new instance of the class with the specified claim type, and value. - The claim type. - The claim value. - type or value is null. - - - Initializes a new instance of the class with the specified claim type, value, and value type. - The claim type. - The claim value. - The claim value type. If this parameter is null, then is used. - type or value is null. - - - Initializes a new instance of the class with the specified claim type, value, value type, and issuer. - The claim type. - The claim value. - The claim value type. If this parameter is null, then is used. - The claim issuer. If this parameter is empty or null, then is used. - type or value is null. - - - Initializes a new instance of the class with the specified claim type, value, value type, issuer, and original issuer. - The claim type. - The claim value. - The claim value type. If this parameter is null, then is used. - The claim issuer. If this parameter is empty or null, then is used. - The original issuer of the claim. If this parameter is empty or null, then the property is set to the value of the property. - type or value is null. - - - Initializes a new instance of the class with the specified claim type, value, value type, issuer, original issuer and subject. - The claim type. - The claim value. - The claim value type. If this parameter is null, then is used. - The claim issuer. If this parameter is empty or null, then is used. - The original issuer of the claim. If this parameter is empty or null, then the property is set to the value of the property. - The subject that this claim describes. - type or value is null. - - - Returns a new object copied from this object. The subject of the new claim is set to the specified ClaimsIdentity. - The intended subject of the new claim. - The new claim object. - - - Returns a new object copied from this object. The new claim does not have a subject. - The new claim object. - - - Contains any additional data provided by a derived type. - A array representing the additional serialized data. - - - Gets the issuer of the claim. - A name that refers to the issuer of the claim. - - - Gets the original issuer of the claim. - A name that refers to the original issuer of the claim. - - - Gets a dictionary that contains additional properties associated with this claim. - A dictionary that contains additional properties associated with the claim. The properties are represented as name-value pairs. - - - Gets the subject of the claim. - The subject of the claim. - - - Returns a string representation of this object. - The string representation of this object. - - - Gets the claim type of the claim. - The claim type. - - - Gets the value of the claim. - The claim value. - - - Gets the value type of the claim. - The claim value type. - - - Writes this to the writer. - The writer to use for data storage. - writer is null. - - - Writes this to the writer. - The writer to write this claim. - The user data to claim. - - - Represents a claims-based identity. - - - Initializes a new instance of the class with an empty claims collection. - - - Initializes a new instance of the class from the specified using the specified claims, authentication type, name claim type, and role claim type. - The identity from which to base the new claims identity. - The claims with which to populate the new claims identity. - The type of authentication used. - The claim type to use for name claims. - The claim type to use for role claims. - - - Initializes a new instance of the class with the specified claims, authentication type, name claim type, and role claim type. - The claims with which to populate the claims identity. - The type of authentication used. - The claim type to use for name claims. - The claim type to use for role claims. - - - Initializes a new instance of the class with the specified authentication type, name claim type, and role claim type. - The type of authentication used. - The claim type to use for name claims. - The claim type to use for role claims. - - - Initializes a new instance of the class from a serialized stream created by using . - The serialized data. - The context for serialization. - info is null. - - - Initializes a new instance of the class with the specified claims and authentication type. - The claims with which to populate the claims identity. - The type of authentication used. - - - Initializes a new instance of the class using the specified claims and the specified . - The identity from which to base the new claims identity. - The claims with which to populate the claims identity. - - - Initializes a new instance of the class using the name and authentication type from the specified . - The identity from which to base the new claims identity. - - - Initializes a new instance of the class from an existing instance. - The to copy. - other is null. - - - Initializes a new instance of the class from a serialized stream created by using . - The serialized data. - - - Initializes an instance of with the specified . - A pointing to a . - reader is null. - - - Initializes a new instance of the class using an enumerated collection of objects. - The claims with which to populate the claims identity. - - - Initializes a new instance of the class with an empty claims collection and the specified authentication type. - The type of authentication used. - - - Gets or sets the identity of the calling party that was granted delegation rights. - The calling party that was granted delegation rights. - An attempt to set the property to the current instance occurs. - - - Adds a single claim to this claims identity. - The claim to add. - claim is null. - - - Adds a list of claims to this claims identity. - The claims to add. - claims is null. - - - Gets the authentication type. - The authentication type. - - - Gets or sets the token that was used to create this claims identity. - The bootstrap context. - - - Gets the claims associated with this claims identity. - The collection of claims associated with this claims identity. - - - Returns a new copied from this claims identity. - A copy of the current instance. - - - Provides an extensibility point for derived types to create a custom . - The that points to the claim. - A new . - reader is null. - - - Contains any additional data provided by a derived type. Typically set when calling . - A array representing the additional serialized data. - - - The default issuer; "LOCAL AUTHORITY". - - - - The default name claim type; . - - - - The default role claim type; . - - - - Retrieves all of the claims that are matched by the specified predicate. - The function that performs the matching logic. - The matching claims. The list is read-only. - match is null. - - - Retrieves all of the claims that have the specified claim type. - The claim type against which to match claims. - The matching claims. The list is read-only. - type is null. - - - Retrieves the first claim that is matched by the specified predicate. - The function that performs the matching logic. - The first matching claim or null if no match is found. - match is null. - - - Retrieves the first claim with the specified claim type. - The claim type to match. - The first matching claim or null if no match is found. - type is null. - - - Populates the with data needed to serialize the current object. - The object to populate with data. - The destination for this serialization. Can be null. - info is null. - - - Determines whether this claims identity has a claim with the specified claim type and value. - The type of the claim to match. - The value of the claim to match. - true if a match is found; otherwise, false. - type is null. -or- value is null. - - - Determines whether this claims identity has a claim that is matched by the specified predicate. - The function that performs the matching logic. - true if a matching claim exists; otherwise, false. - match is null. - - - Gets a value that indicates whether the identity has been authenticated. - true if the identity has been authenticated; otherwise, false. - - - Gets or sets the label for this claims identity. - The label. - - - Gets the name of this claims identity. - The name or null. - - - Gets the claim type that is used to determine which claims provide the value for the property of this claims identity. - The name claim type. - - - Attempts to remove a claim from the claims identity. - The claim to remove. - The claim cannot be removed. - - - Gets the claim type that will be interpreted as a .NET Framework role among the claims in this claims identity. - The role claim type. - - - Attempts to remove a claim from the claims identity. - The claim to remove. - true if the claim was successfully removed; otherwise, false. - - - Serializes using a . - The writer to use for data storage. - writer is null. - - - Serializes using a . - The writer to use for data storage. - Additional data provided by the derived type. - writer is null. - - - An implementation that supports multiple claims-based identities. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class using the specified claims identities. - The identities from which to initialize the new claims principal. - identities is null. - - - Initializes an instance of with the specified . - A pointing to a . - reader is null. - - - Initializes a new instance of the class from the specified identity. - The identity from which to initialize the new claims principal. - identity is null. - - - Initializes a new instance of the class from the specified principal. - The principal from which to initialize the new claims principal. - principal is null. - - - Initializes a new instance of the class from a serialized stream created by using . - The serialized data. - The context for serialization. - info is null. - - - Adds the specified claims identities to this claims principal. - The claims identities to add. - identities is null. - - - Adds the specified claims identity to this claims principal. - The claims identity to add. - identity is null. - - - Gets a collection that contains all of the claims from all of the claims identities associated with this claims principal. - The claims associated with this principal. - - - Gets and sets the delegate used to select the claims principal returned by the property. - The delegate. The default is null. - - - Returns a copy of this instance. - A new copy of the object. - - - Creates a new claims identity. - The binary reader. - The created claims identity. - - - Gets the current claims principal. - The current claims principal. - - - Contains any additional data provided by a derived type. Typically set when calling . - A array representing the additional serialized data. - - - Retrieves all of the claims that are matched by the specified predicate. - The function that performs the matching logic. - The matching claims. - match is null. - - - Retrieves all or the claims that have the specified claim type. - The claim type against which to match claims. - The matching claims. - type is null. - - - Retrieves the first claim that is matched by the specified predicate. - The function that performs the matching logic. - The first matching claim or null if no match is found. - match is null. - - - Retrieves the first claim with the specified claim type. - The claim type to match. - The first matching claim or null if no match is found. - type is null. - - - Populates the with data needed to serialize the current object. - The object to populate with data. - The destination for this serialization. Can be null. - info is null. - - - Determines whether any of the claims identities associated with this claims principal contains a claim that is matched by the specified predicate. - The function that performs the matching logic. - true if a matching claim exists; otherwise, false. - match is null. - - - Determines whether any of the claims identities associated with this claims principal contains a claim with the specified claim type and value. - The type of the claim to match. - The value of the claim to match. - true if a matching claim exists; otherwise, false. - type is null. -or- value is null. - - - Gets a collection that contains all of the claims identities associated with this claims principal. - The collection of claims identities. - - - Gets the primary claims identity associated with this claims principal. - The primary claims identity associated with this claims principal. - - - Returns a value that indicates whether the entity (user) represented by this claims principal is in the specified role. - The role for which to check. - true if claims principal is in the specified role; otherwise, false. - - - Gets and sets the delegate used to select the claims identity returned by the property. - The delegate. The default is null. - - - Serializes using a . - The writer to use for data storage. - writer is null. - - - Serializes using a . - The writer to use for data storage. - Additional data provided by the derived type. - writer is null. - - - Defines constants for the well-known claim types that can be assigned to a subject. This class cannot be inherited. - - - http://schemas.xmlsoap.org/ws/2009/09/identity/claims/actor. - - - - The URI for a claim that specifies the anonymous user; http://schemas.xmlsoap.org/ws/2005/05/identity/claims/anonymous. - - - - The URI for a claim that specifies details about whether an identity is authenticated, http://schemas.xmlsoap.org/ws/2005/05/identity/claims/authenticated. - - - - The URI for a claim that specifies the instant at which an entity was authenticated; http://schemas.microsoft.com/ws/2008/06/identity/claims/authenticationinstant. - - - - The URI for a claim that specifies the method with which an entity was authenticated; http://schemas.microsoft.com/ws/2008/06/identity/claims/authenticationmethod. - - - - The URI for a claim that specifies an authorization decision on an entity; http://schemas.xmlsoap.org/ws/2005/05/identity/claims/authorizationdecision. - - - - The URI for a claim that specifies the cookie path; http://schemas.microsoft.com/ws/2008/06/identity/claims/cookiepath. - - - - The URI for a claim that specifies the country/region in which an entity resides, http://schemas.xmlsoap.org/ws/2005/05/identity/claims/country. - - - - The URI for a claim that specifies the date of birth of an entity, http://schemas.xmlsoap.org/ws/2005/05/identity/claims/dateofbirth. - - - - The URI for a claim that specifies the deny-only primary group SID on an entity; http://schemas.microsoft.com/ws/2008/06/identity/claims/denyonlyprimarygroupsid. A deny-only SID denies the specified entity to a securable object. - - - - The URI for a claim that specifies the deny-only primary SID on an entity; http://schemas.microsoft.com/ws/2008/06/identity/claims/denyonlyprimarysid. A deny-only SID denies the specified entity to a securable object. - - - - The URI for a claim that specifies a deny-only security identifier (SID) for an entity, http://schemas.xmlsoap.org/ws/2005/05/identity/claims/denyonlysid. A deny-only SID denies the specified entity to a securable object. - - - - http://schemas.microsoft.com/ws/2008/06/identity/claims/denyonlywindowsdevicegroup. - - - - The URI for a claim that specifies the DNS name associated with the computer name or with the alternative name of either the subject or issuer of an X.509 certificate, http://schemas.xmlsoap.org/ws/2005/05/identity/claims/dns. - - - - http://schemas.microsoft.com/ws/2008/06/identity/claims/dsa. - - - - The URI for a claim that specifies the email address of an entity, http://schemas.xmlsoap.org/ws/2005/05/identity/claims/email. - - - - http://schemas.microsoft.com/ws/2008/06/identity/claims/expiration. - - - - http://schemas.microsoft.com/ws/2008/06/identity/claims/expired. - - - - The URI for a claim that specifies the gender of an entity, http://schemas.xmlsoap.org/ws/2005/05/identity/claims/gender. - - - - The URI for a claim that specifies the given name of an entity, http://schemas.xmlsoap.org/ws/2005/05/identity/claims/givenname. - - - - The URI for a claim that specifies the SID for the group of an entity, http://schemas.microsoft.com/ws/2008/06/identity/claims/groupsid. - - - - The URI for a claim that specifies a hash value, http://schemas.xmlsoap.org/ws/2005/05/identity/claims/hash. - - - - The URI for a claim that specifies the home phone number of an entity, http://schemas.xmlsoap.org/ws/2005/05/identity/claims/homephone. - - - - http://schemas.microsoft.com/ws/2008/06/identity/claims/ispersistent. - - - - The URI for a claim that specifies the locale in which an entity resides, http://schemas.xmlsoap.org/ws/2005/05/identity/claims/locality. - - - - The URI for a claim that specifies the mobile phone number of an entity, http://schemas.xmlsoap.org/ws/2005/05/identity/claims/mobilephone. - - - - The URI for a claim that specifies the name of an entity, http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name. - - - - The URI for a claim that specifies the name of an entity, http://schemas.xmlsoap.org/ws/2005/05/identity/claims/nameidentifier. - - - - The URI for a claim that specifies the alternative phone number of an entity, http://schemas.xmlsoap.org/ws/2005/05/identity/claims/otherphone. - - - - The URI for a claim that specifies the postal code of an entity, http://schemas.xmlsoap.org/ws/2005/05/identity/claims/postalcode. - - - - The URI for a claim that specifies the primary group SID of an entity, http://schemas.microsoft.com/ws/2008/06/identity/claims/primarygroupsid. - - - - The URI for a claim that specifies the primary SID of an entity, http://schemas.microsoft.com/ws/2008/06/identity/claims/primarysid. - - - - The URI for a claim that specifies the role of an entity, http://schemas.microsoft.com/ws/2008/06/identity/claims/role. - - - - The URI for a claim that specifies an RSA key, http://schemas.xmlsoap.org/ws/2005/05/identity/claims/rsa. - - - - The URI for a claim that specifies a serial number, http://schemas.microsoft.com/ws/2008/06/identity/claims/serialnumber. - - - - The URI for a claim that specifies a security identifier (SID), http://schemas.xmlsoap.org/ws/2005/05/identity/claims/sid. - - - - The URI for a claim that specifies a service principal name (SPN) claim, http://schemas.xmlsoap.org/ws/2005/05/identity/claims/spn. - - - - The URI for a claim that specifies the state or province in which an entity resides, http://schemas.xmlsoap.org/ws/2005/05/identity/claims/stateorprovince. - - - - The URI for a claim that specifies the street address of an entity, http://schemas.xmlsoap.org/ws/2005/05/identity/claims/streetaddress. - - - - The URI for a claim that specifies the surname of an entity, http://schemas.xmlsoap.org/ws/2005/05/identity/claims/surname. - - - - The URI for a claim that identifies the system entity, http://schemas.xmlsoap.org/ws/2005/05/identity/claims/system. - - - - The URI for a claim that specifies a thumbprint, http://schemas.xmlsoap.org/ws/2005/05/identity/claims/thumbprint. A thumbprint is a globally unique SHA-1 hash of an X.509 certificate. - - - - The URI for a claim that specifies a user principal name (UPN), http://schemas.xmlsoap.org/ws/2005/05/identity/claims/upn. - - - - The URI for a claim that specifies a URI, http://schemas.xmlsoap.org/ws/2005/05/identity/claims/uri. - - - - http://schemas.microsoft.com/ws/2008/06/identity/claims/userdata. - - - - http://schemas.microsoft.com/ws/2008/06/identity/claims/version. - - - - The URI for a claim that specifies the webpage of an entity, http://schemas.xmlsoap.org/ws/2005/05/identity/claims/webpage. - - - - The URI for a claim that specifies the Windows domain account name of an entity, http://schemas.microsoft.com/ws/2008/06/identity/claims/windowsaccountname. - - - - http://schemas.microsoft.com/ws/2008/06/identity/claims/windowsdeviceclaim. - - - - http://schemas.microsoft.com/ws/2008/06/identity/claims/windowsdevicegroup. - - - - http://schemas.microsoft.com/ws/2008/06/identity/claims/windowsfqbnversion. - - - - http://schemas.microsoft.com/ws/2008/06/identity/claims/windowssubauthority. - - - - http://schemas.microsoft.com/ws/2008/06/identity/claims/windowsuserclaim. - - - - The URI for a distinguished name claim of an X.509 certificate, http://schemas.xmlsoap.org/ws/2005/05/identity/claims/x500distinguishedname. The X.500 standard defines the methodology for defining distinguished names that are used by X.509 certificates. - - - - Specifies the scope of a . - - - The attribute applies to all code that follows it. - - - - The attribute applies only to the immediate target. - - - - Represents the XML object model for encoding security objects. This class cannot be inherited. - - - Initializes a new instance of the class with the specified tag. - The tag name of an XML element. - The tag parameter is null. - The tag parameter is invalid in XML. - - - Initializes a new instance of the class with the specified tag and text. - The tag name of the XML element. - The text content within the element. - The tag parameter is null. - The tag parameter or text parameter is invalid in XML. - - - Adds a name/value attribute to an XML element. - The name of the attribute. - The value of the attribute. - The name parameter or value parameter is null. - The name parameter or value parameter is invalid in XML. -or- An attribute with the name specified by the name parameter already exists. - - - Adds a child element to the XML element. - The child element to add. - The child parameter is null. - - - Finds an attribute by name in an XML element. - The name of the attribute for which to search. - The value associated with the named attribute, or null if no attribute with name exists. - The name parameter is null. - - - Gets or sets the attributes of an XML element as name/value pairs. - The object for the attribute values of the XML element. - The name or value of the object is invalid. - The name is not a valid XML attribute name. - - - Gets or sets the array of child elements of the XML element. - The ordered child elements of the XML element as security elements. - A child of the XML parent node is null. - - - Creates and returns an identical copy of the current object. - A copy of the current object. - - - Compares two XML element objects for equality. - An XML element object to which to compare the current XML element object. - true if the tag, attribute names and values, child elements, and text fields in the current XML element are identical to their counterparts in the other parameter; otherwise, false. - - - Replaces invalid XML characters in a string with their valid XML equivalent. - The string within which to escape invalid characters. - The input string with invalid characters replaced. - - - Creates a security element from an XML-encoded string. - The XML-encoded string from which to create the security element. - A created from the XML. - xml contains one or more single quotation mark characters. - xml is null. - - - Determines whether a string is a valid attribute name. - The attribute name to test for validity. - true if the name parameter is a valid XML attribute name; otherwise, false. - - - Determines whether a string is a valid attribute value. - The attribute value to test for validity. - true if the value parameter is a valid XML attribute value; otherwise, false. - - - Determines whether a string is a valid tag. - The tag to test for validity. - true if the tag parameter is a valid XML tag; otherwise, false. - - - Determines whether a string is valid as text within an XML element. - The text to test for validity. - true if the text parameter is a valid XML text element; otherwise, false. - - - Finds a child by its tag name. - The tag for which to search in child elements. - The first child XML element with the specified tag value, or null if no child element with tag exists. - The tag parameter is null. - - - Finds a child by its tag name and returns the contained text. - The tag for which to search in child elements. - The text contents of the first child element with the specified tag value. - tag is null. - - - Gets or sets the tag name of an XML element. - The tag name of an XML element. - The tag is null. - The tag is not valid in XML. - - - Gets or sets the text within an XML element. - The value of the text within an XML element. - The text is not valid in XML. - - - Produces a string representation of an XML element and its constituent attributes, child elements, and text. - The XML element and its contents. - - - The exception that is thrown when a security error is detected. - - - Initializes a new instance of the class with default properties. - - - Initializes a new instance of the class with a specified error message. - The error message that explains the reason for the exception. - - - Initializes a new instance of the class with serialized data. - The object that holds the serialized object data. - The contextual information about the source or destination. - info is null. - - - Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. - The error message that explains the reason for the exception. - The exception that is the cause of the current exception. If the inner parameter is not null, the current exception is raised in a catch block that handles the inner exception. - - - Initializes a new instance of the class with a specified error message and the permission type that caused the exception to be thrown. - The error message that explains the reason for the exception. - The type of the permission that caused the exception to be thrown. - - - Initializes a new instance of the class with a specified error message, the permission type that caused the exception to be thrown, and the permission state. - The error message that explains the reason for the exception. - The type of the permission that caused the exception to be thrown. - The state of the permission that caused the exception to be thrown. - - - Gets or sets the demanded security permission, permission set, or permission set collection that failed. - A permission, permission set, or permission set collection object. - - - Gets or sets the denied security permission, permission set, or permission set collection that caused a demand to fail. - A permission, permission set, or permission set collection object. - - - Gets or sets information about the failed assembly. - An that identifies the failed assembly. - - - Sets the with information about the . - The that holds the serialized object data about the exception being thrown. - The that contains contextual information about the source or destination. - The info parameter is null. - - - Gets or sets the granted permission set of the assembly that caused the . - The XML representation of the granted set of the assembly. - - - Gets or sets the information about the method associated with the exception. - A object describing the method. - - - Gets or sets the state of the permission that threw the exception. - The state of the permission at the time the exception was thrown. - - - Gets or sets the type of the permission that failed. - The type of the permission that failed. - - - Gets or sets the permission, permission set, or permission set collection that is part of the permit-only stack frame that caused a security check to fail. - A permission, permission set, or permission set collection object. - - - Gets or sets the refused permission set of the assembly that caused the . - The XML representation of the refused permission set of the assembly. - - - Returns a representation of the current . - A string representation of the current . - - - Gets or sets the URL of the assembly that caused the exception. - A URL that identifies the location of the assembly. - - - Indicates the set of security rules the common language runtime should enforce for an assembly. - - - Initializes a new instance of the class using the specified rule set value. - One of the enumeration values that specifies the transparency rules set. - - - Gets the rule set to be applied. - One of the enumeration values that specifies the transparency rules to be applied. - - - Determines whether fully trusted transparent code should skip Microsoft intermediate language (MSIL) verification. - true if MSIL verification should be skipped; otherwise, false. The default is false. - - - Identifies the set of security rules the common language runtime should enforce for an assembly. - - - Indicates that the runtime will enforce level 1 (.NET Framework version 2.0) transparency rules. - - - - Indicates that the runtime will enforce level 2 transparency rules. - - - - Unsupported. Using this value results in a being thrown. - - - - Identifies types or members as security-critical and safely accessible by transparent code. - - - Initializes a new instance of the class. - - - Specifies that an assembly cannot cause an elevation of privilege. - - - Initializes a new instance of the class. - - - Identifies which of the nonpublic members are accessible by transparent code within the assembly. - - - Initializes a new instance of the class. - - - Allows managed code to call into unmanaged code without a stack walk. This class cannot be inherited. - - - Initializes a new instance of the class. - - - Marks modules containing unverifiable code. This class cannot be inherited. - - - Initializes a new instance of the class. - - - The exception that is thrown when the security policy requires code to be type safe and the verification process is unable to verify that the code is type safe. - - - Initializes a new instance of the class with default properties. - - - Initializes a new instance of the class with an explanatory message. - A message indicating the reason the exception occurred. - - - Initializes a new instance of the class with serialized data. - The object that holds the serialized object data. - The contextual information about the source or destination. - - - Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. - The error message that explains the reason for the exception. - The exception that is the cause of the current exception. If the innerException parameter is not null, the current exception is raised in a catch block that handles the inner exception. - - - Indicates that a class can be serialized. This class cannot be inherited. - - - Initializes a new instance of the class. - - - Represents the group element from XML Schema as specified by the World Wide Web Consortium (W3C). This class defines groups at the schema level that are referenced from the complex types. It groups a set of element declarations so that they can be incorporated as a group into complex type definitions. - - - Initializes a new instance of the class. - - - Gets or sets the name of the schema group. - The name of the schema group. - - - Gets or sets one of the , , or classes. - One of the , , or classes. - - - Gets the qualified name of the schema group. - An object representing the qualified name of the schema group. - - - An abstract class for , , or . - - - Initializes a new instance of the class. - - - This collection is used to add new elements to the compositor. - An XmlSchemaObjectCollection. - - - Represents the group element with ref attribute from the XML Schema as specified by the World Wide Web Consortium (W3C). This class is used within complex types that reference a group defined at the schema level. - - - Initializes a new instance of the class. - - - Gets one of the , , or classes, which holds the post-compilation value of the Particle property. - The post-compilation value of the Particle property, which is one of the , , or classes. - - - Gets or sets the name of a group defined in this schema (or another schema indicated by the specified namespace). - The name of a group defined in this schema. - - - Class for the identity constraints: key, keyref, and unique elements. - - - Initializes a new instance of the class. - - - Gets the collection of fields that apply as children for the XML Path Language (XPath) expression selector. - The collection of fields. - - - Gets or sets the name of the identity constraint. - The name of the identity constraint. - - - Gets the qualified name of the identity constraint, which holds the post-compilation value of the QualifiedName property. - The post-compilation value of the QualifiedName property. - - - Gets or sets the XPath expression selector element. - The XPath expression selector element. - - - Represents the import element from XML Schema as specified by the World Wide Web Consortium (W3C). This class is used to import schema components from other schemas. - - - Initializes a new instance of the class. - - - Gets or sets the annotation property. - The annotation. - - - Gets or sets the target namespace for the imported schema as a Uniform Resource Identifier (URI) reference. - The target namespace for the imported schema as a URI reference. Optional. - - - Represents the include element from XML Schema as specified by the World Wide Web Consortium (W3C). This class is used to include declarations and definitions from an external schema. The included declarations and definitions are then available for processing in the containing schema. - - - Initializes a new instance of the class. - - - Gets or sets the annotation property. - The annotation. - - - Affects occurrence and type information inferred by the class for elements and attributes in an XML document. - - - Indicates that a less restrictive schema declaration should be inferred for a particular element or attribute. - - - - Indicates that a more restrictive schema declaration should be inferred for a particular element or attribute. - - - - Infers an XML Schema Definition Language (XSD) schema from an XML document. The class cannot be inherited. - - - Initializes a new instance of the class. - - - Infers an XML Schema Definition Language (XSD) schema from the XML document contained in the object specified. - An object containing the XML document to infer a schema from. - An object containing the inferred schemas. - The XML document is not well-formed. - The object is not positioned on the root node or on an element. An error occurs during the schema inference process. - - - Infers an XML Schema Definition Language (XSD) schema from the XML document contained in the object specified, and refines the inferred schema using an existing schema in the object specified with the same target namespace. - An object containing the XML document to infer a schema from. - An object containing an existing schema used to refine the inferred schema. - An object containing the inferred schemas. - The XML document is not well-formed. - The object is not positioned on the root node or on an element. An error occurs during the schema inference process. - - - Gets or sets the value that affects schema occurrence declarations inferred from the XML document. - An object. - - - Gets or sets the value that affects types inferred from the XML document. - An object. - - - Returns information about errors encountered by the class while inferring a schema from an XML document. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with the error message specified. - A description of the error. - - - Initializes a new instance of the class with the and objects specified that contain all the properties of the . - A object. - A object. - - - Initializes a new instance of the class with the error message specified and the original that caused the specified. - A description of the error. - An object containing the original exception that caused the . - - - Initializes a new instance of the class with the error message specified, the original that caused the specified, and the line number and line position of the error in the XML document specified. - A description of the error. - An object containing the original exception that caused the . - The line number in the XML document that caused the . - The line position in the XML document that caused the . - - - Streams all the object properties into the object specified for the object specified. - A object. - A object. - - - Represents the post-schema-validation infoset of a validated XML node. - - - Initializes a new instance of the class. - - - Gets or sets the object that corresponds to the content type of this validated XML node. - An object. - - - Gets or sets a value indicating if this validated XML node was set as the result of a default being applied during XML Schema Definition Language (XSD) schema validation. - A bool value. - - - Gets or sets a value indicating if the value for this validated XML node is nil. - A bool value. - - - Gets or sets the dynamic schema type for this validated XML node. - An object. - - - Gets or sets the compiled object that corresponds to this validated XML node. - An object. - - - Gets or sets the compiled object that corresponds to this validated XML node. - An object. - - - Gets or sets the static XML Schema Definition Language (XSD) schema type of this validated XML node. - An object. - - - Gets or sets the value of this validated XML node. - An value. - - - This class represents the key element from XMLSchema as specified by the World Wide Web Consortium (W3C). - - - Initializes a new instance of the class. - - - This class represents the keyref element from XMLSchema as specified by the World Wide Web Consortium (W3C). - - - Initializes a new instance of the class. - - - Gets or sets the name of the key that this constraint refers to in another simple or complex type. - The QName of the key that this constraint refers to. - - - Represents the length facet from XML Schema as specified by the World Wide Web Consortium (W3C). This class can be used to specify a restriction on the length of a simpleType element on the data type. - - - Initializes a new instance of the class. - - - Represents the maxExclusive element from XML Schema as specified by the World Wide Web Consortium (W3C). This class can be used to specify a restriction on the maximum value of a simpleType element. The element value must be less than the value of the maxExclusive element. - - - Initializes a new instance of the class. - - - Represents the maxInclusive element from XML Schema as specified by the World Wide Web Consortium (W3C). This class can be used to specify a restriction on the maximum value of a simpleType element. The element value must be less than or equal to the value of the maxInclusive element. - - - Initializes a new instance of the class. - - - Represents the maxLength element from XML Schema as specified by the World Wide Web Consortium (W3C). This class can be used to specify a restriction on the maximum length of the data value of a simpleType element. The length must be less than the value of the maxLength element. - - - Initializes a new instance of the class. - - - Represents the minExclusive element from XML Schema as specified by the World Wide Web Consortium (W3C). This class can be used to specify a restriction on the minimum value of a simpleType element. The element value must be greater than the value of the minExclusive element. - - - Initializes a new instance of the class. - - - Represents the minInclusive element from XML Schema as specified by the World Wide Web Consortium (W3C). This class can be used to specify a restriction on the minimum value of a simpleType element. The element value must be greater than or equal to the value of the minInclusive element. - - - Initializes a new instance of the class. - - - Represents the minLength element from XML Schema as specified by the World Wide Web Consortium (W3C). This class can be used to specify a restriction on the minimum length of the data value of a simpleType element. The length must be greater than the value of the minLength element. - - - Initializes a new instance of the class. - - - Represents the notation element from XML Schema as specified by the World Wide Web Consortium (W3C). An XML Schema notation declaration is a reconstruction of XML 1.0 NOTATION declarations. The purpose of notations is to describe the format of non-XML data within an XML document. - - - Initializes a new instance of the class. - - - Gets or sets the name of the notation. - The name of the notation. - - - Gets or sets the public identifier. - The public identifier. The value must be a valid Uniform Resource Identifier (URI). - - - Gets or sets the system identifier. - The system identifier. The value must be a valid URI. - - - Abstract class for defining numeric facets. This class is the base class for numeric facet classes such as - - - Initializes a new instance of the class. - - - Represents the root class for the Xml schema object model hierarchy and serves as a base class for classes such as the class. - - - Initializes a new instance of the class. - - - Gets or sets the line number in the file to which the schema element refers. - The line number. - - - Gets or sets the line position in the file to which the schema element refers. - The line position. - - - Gets or sets the to use with this schema object. - The property for the schema object. - - - Gets or sets the parent of this . - The parent of this . - - - Gets or sets the source location for the file that loaded the schema. - The source location (URI) for the file. - - - A collection of s. - - - Initializes a new instance of the XmlSchemaObjectCollection class. - - - Initializes a new instance of the XmlSchemaObjectCollection class that takes an . - The . - - - Adds an to the XmlSchemaObjectCollection. - The . - The index at which the item has been added. - index is less than zero. -or- index is greater than Count. - The parameter specified is not of type or its derived types , , and . - - - Indicates if the specified is in the XmlSchemaObjectCollection. - The . - true if the specified qualified name is in the collection; otherwise, returns false. If null is supplied, false is returned because there is no qualified name with a null name. - - - Copies all the s from the collection into the given array, starting at the given index. - The one-dimensional array that is the destination of the elements copied from the XmlSchemaObjectCollection. The array must have zero-based indexing. - The zero-based index in the array at which copying begins. - array is a null reference (Nothing in Visual Basic). - index is less than zero. - array is multi-dimensional. - or - index is equal to or greater than the length of array. - or - The number of elements in the source is greater than the available space from index to the end of the destination array. - The type of the source cannot be cast automatically to the type of the destination array. - - - Returns an enumerator for iterating through the XmlSchemaObjects contained in the XmlSchemaObjectCollection. - The iterator returns . - - - Gets the collection index corresponding to the specified . - The whose index you want to return. - The index corresponding to the specified . - - - Inserts an to the XmlSchemaObjectCollection. - The zero-based index at which an item should be inserted. - The to insert. - index is less than zero. -or- index is greater than Count. - - - Gets the at the specified index. - The index of the . - The at the specified index. - - - OnClear is invoked before the standard Clear behavior. For more information, see OnClear method for . - - - OnInsert is invoked before the standard Insert behavior. For more information, see OnInsert method . - The index of . - The item. - - - OnRemove is invoked before the standard Remove behavior. For more information, see the OnRemove method for . - The index of . - The item. - - - OnSet is invoked before the standard Set behavior. For more information, see the OnSet method for . - The index of . - The old value. - The new value. - - - Removes an from the XmlSchemaObjectCollection. - The to remove. - - - Represents the enumerator for the . - - - Gets the current in the collection. - The current . - - - Moves to the next item in the collection. - false at the end of the collection. - - - Resets the enumerator to the start of the collection. - - - For a description of this member, see . - The current . - - - For a description of this member, see . - The next . - - - For a description of this member, see . - - - Provides the collections for contained elements in the class (for example, Attributes, AttributeGroups, Elements, and so on). - - - Determines if the qualified name specified exists in the collection. - The . - true if the qualified name specified exists in the collection; otherwise, false. - - - Gets the number of items contained in the . - The number of items contained in the . - - - Returns an enumerator that can iterate through the . - An that can iterate through . - - - Returns the element in the specified by qualified name. - The of the element to return. - The of the element in the specified by qualified name. - - - Returns a collection of all the named elements in the . - A collection of all the named elements in the . - - - Returns a collection of all the values for all the elements in the . - A collection of all the values for all the elements in the . - - - Abstract class for that is the base class for all particle types (e.g. ). - - - Initializes a new instance of the class. - - - Gets or sets the maximum number of times the particle can occur. - The maximum number of times the particle can occur. The default is 1. - - - Gets or sets the number as a string value. Maximum number of times the particle can occur. - The number as a string value. String.Empty indicates that MaxOccurs is equal to the default value. The default is a null reference. - - - Gets or sets the minimum number of times the particle can occur. - The minimum number of times the particle can occur. The default is 1. - - - Gets or sets the number as a string value. The minimum number of times the particle can occur. - The number as a string value. String.Empty indicates that MinOccurs is equal to the default value. The default is a null reference. - - - Represents the pattern element from XML Schema as specified by the World Wide Web Consortium (W3C). This class can be used to specify a restriction on the value entered for a simpleType element. - - - Initializes a new instance of the class. - - - Represents the redefine element from XML Schema as specified by the World Wide Web Consortium (W3C). This class can be used to allow simple and complex types, groups and attribute groups from external schema files to be redefined in the current schema. This class can also be used to provide versioning for the schema elements. - - - Initializes a new instance of the class. - - - Gets the , for all attributes in the schema, which holds the post-compilation value of the AttributeGroups property. - The for all attributes in the schema. The post-compilation value of the AttributeGroups property. - - - Gets the , for all groups in the schema, which holds the post-compilation value of the Groups property. - The for all groups in the schema. The post-compilation value of the Groups property. - - - Gets the collection of the following classes: , , , , and . - The elements contained within the redefine element. - - - Gets the , for all simple and complex types in the schema, which holds the post-compilation value of the SchemaTypes property. - The for all schema types in the schema. The post-compilation value of the SchemaTypes property. - - - Represents the sequence element (compositor) from the XML Schema as specified by the World Wide Web Consortium (W3C). The sequence requires the elements in the group to appear in the specified sequence within the containing element. - - - Initializes a new instance of the class. - - - The elements contained within the compositor. Collection of , , , , or . - The elements contained within the compositor. - - - Contains a cache of XML Schema definition language (XSD) schemas. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with the specified . - The object to use. - The object passed as a parameter is null. - - - Adds the given to the . - The object to add to the . - An object if the schema is valid. If the schema is not valid and a is specified, then null is returned and the appropriate validation event is raised. Otherwise, an is thrown. - The schema is not valid. - The object passed as a parameter is null. - - - Adds all the XML Schema definition language (XSD) schemas in the given to the . - The object. - A schema in the is not valid. - The object passed as a parameter is null. - - - Adds the XML Schema definition language (XSD) schema at the URL specified to the . - The schema targetNamespace property, or null to use the targetNamespace specified in the schema. - The URL that specifies the schema to load. - An object if the schema is valid. If the schema is not valid and a is specified, then null is returned and the appropriate validation event is raised. Otherwise, an is thrown. - The schema is not valid. - The URL passed as a parameter is null or . - - - Adds the XML Schema definition language (XSD) schema contained in the to the . - The schema targetNamespace property, or null to use the targetNamespace specified in the schema. - The object. - An object if the schema is valid. If the schema is not valid and a is specified, then null is returned and the appropriate validation event is raised. Otherwise, an is thrown. - The schema is not valid. - The object passed as a parameter is null. - - - Gets or sets the for the . - The for the . The default is an instance with the property set to true. - - - Compiles the XML Schema definition language (XSD) schemas added to the into one logical schema. - An error occurred when validating and compiling the schemas in the . - - - Indicates whether an XML Schema definition language (XSD) schema with the specified target namespace URI is in the . - The schema targetNamespace property. - true if a schema with the specified target namespace URI is in the ; otherwise, false. - - - Indicates whether the specified XML Schema definition language (XSD) object is in the . - The object. - true if the object is in the ; otherwise, false. - The passed as a parameter is null. - - - Copies all the objects from the to the given array, starting at the given index. - The array to copy the objects to. - The index in the array where copying will begin. - - - Gets the number of logical XML Schema definition language (XSD) schemas in the . - The number of logical schemas in the . - - - Gets all the global attributes in all the XML Schema definition language (XSD) schemas in the . - The collection of global attributes. - - - Gets all the global elements in all the XML Schema definition language (XSD) schemas in the . - The collection of global elements. - - - Gets all of the global simple and complex types in all the XML Schema definition language (XSD) schemas in the . - The collection of global simple and complex types. - - - Gets a value that indicates whether the XML Schema definition language (XSD) schemas in the have been compiled. - true if the schemas in the have been compiled since the last time a schema was added or removed from the ; otherwise, false. - - - Gets the default used by the when loading new XML Schema definition language (XSD) schemas. - A table of atomized string objects. - - - Removes the specified XML Schema definition language (XSD) schema from the . - The object to remove from the . - The object removed from the or null if the schema was not found in the . - The schema is not a valid schema. - The passed as a parameter is null. - - - Removes the specified XML Schema definition language (XSD) schema and all the schemas it imports from the . - The object to remove from the . - true if the object and all its imports were successfully removed; otherwise, false. - The passed as a parameter is null. - - - Reprocesses an XML Schema definition language (XSD) schema that already exists in the . - The schema to reprocess. - An object if the schema is a valid schema. If the schema is not valid and a is specified, null is returned and the appropriate validation event is raised. Otherwise, an is thrown. - The schema is not valid. - The object passed as a parameter is null. - The object passed as a parameter does not already exist in the . - - - Returns a collection of all the XML Schema definition language (XSD) schemas in the . - An object containing all the schemas that have been added to the . If no schemas have been added to the , an empty object is returned. - - - Returns a collection of all the XML Schema definition language (XSD) schemas in the that belong to the given namespace. - The schema targetNamespace property. - An object containing all the schemas that have been added to the that belong to the given namespace. If no schemas have been added to the , an empty object is returned. - - - Specifies an event handler for receiving information about XML Schema definition language (XSD) schema validation errors. - - - - Sets the used to resolve namespaces or locations referenced in include and import elements of a schema. - The used to resolve namespaces or locations referenced in include and import elements of a schema. - - - Represents the simpleContent element from XML Schema as specified by the World Wide Web Consortium (W3C). This class is for simple and complex types with simple content model. - - - Initializes a new instance of the class. - - - Gets one of the or . - The content contained within the XmlSchemaSimpleContentRestriction or XmlSchemaSimpleContentExtension class. - - - Represents the extension element for simple content from XML Schema as specified by the World Wide Web Consortium (W3C). This class can be used to derive simple types by extension. Such derivations are used to extend the simple type content of the element by adding attributes. - - - Initializes a new instance of the class. - - - Gets or sets the XmlSchemaAnyAttribute to be used for the attribute value. - The XmlSchemaAnyAttribute. Optional. - - - Gets the collection of and . - The collection of attributes for the simpleType element. - - - Gets or sets the name of a built-in data type or simple type from which this type is extended. - The base type name. - - - Represents the restriction element for simple content from XML Schema as specified by the World Wide Web Consortium (W3C). This class can be used to derive simple types by restriction. Such derivations can be used to restrict the range of values for the element to a subset of the values specified in the inherited simple type. - - - Initializes a new instance of the class. - - - Gets or sets an to be used for the attribute value. - The for the attribute value. Optional. - - - Gets the and collection of attributes for the simple type. - The collection of attributes for a simple type. - - - Gets or sets the simple type base value. - The simple type base value. - - - Gets or sets the name of the built-in data type or simple type from which this type is derived. - The name of the base type. - - - Gets or sets an Xml Schema facet. - One of the following facet classes: , , , , , , , , , , , . - - - Represents the simpleType element for simple content from XML Schema as specified by the World Wide Web Consortium (W3C). This class defines a simple type. Simple types can specify information and constraints for the value of attributes or elements with text-only content. - - - Initializes a new instance of the class. - - - Gets or sets one of , , or . - One of XmlSchemaSimpleTypeUnion, XmlSchemaSimpleTypeList, or XmlSchemaSimpleTypeRestriction. - - - Abstract class for simple type content classes. - - - Initializes a new instance of the class. - - - Represents the list element from XML Schema as specified by the World Wide Web Consortium (W3C). This class can be used to define a simpleType element as a list of values of a specified data type. - - - Initializes a new instance of the class. - - - Gets or sets the representing the type of the simpleType element based on the and values of the simple type. - The representing the type of the simpleType element. - - - Gets or sets the simpleType element that is derived from the type specified by the base value. - The item type for the simple type element. - - - Gets or sets the name of a built-in data type or simpleType element defined in this schema (or another schema indicated by the specified namespace). - The type name of the simple type list. - - - Represents the restriction element for simple types from XML Schema as specified by the World Wide Web Consortium (W3C). This class can be used restricting simpleType element. - - - Initializes a new instance of the class. - - - Gets or sets information on the base type. - The base type for the simpleType element. - - - Gets or sets the name of the qualified base type. - The qualified name of the simple type restriction base type. - - - Gets or sets an Xml Schema facet. - One of the following facet classes: , , , , , , , , , , , . - - - Represents the union element for simple types from XML Schema as specified by the World Wide Web Consortium (W3C). A union datatype can be used to specify the content of a simpleType. The value of the simpleType element must be any one of a set of alternative datatypes specified in the union. Union types are always derived types and must comprise at least two alternative datatypes. - - - Initializes a new instance of the class. - - - Gets an array of objects representing the type of the simpleType element based on the and values of the simple type. - An array of objects representing the type of the simpleType element. - - - Gets the collection of base types. - The collection of simple type base values. - - - Gets or sets the array of qualified member names of built-in data types or simpleType elements defined in this schema (or another schema indicated by the specified namespace). - An array that consists of a list of members of built-in data types or simple types. - - - Represents the totalDigits facet from XML Schema as specified by the World Wide Web Consortium (W3C). This class can be used to specify a restriction on the number of digits that can be entered for the value of a simpleType element. That value of totalDigits must be a positive integer. - - - Initializes a new instance of the class. - - - The base class for all simple types and complex types. - - - Initializes a new instance of the class. - - - Gets the post-compilation object type or the built-in XML Schema Definition Language (XSD) data type, simpleType element, or complexType element. This is a post-schema-compilation infoset property. - The built-in XSD data type, simpleType element, or complexType element. - - - Gets the post-compilation value for the base type of this schema type. - An object representing the base type of this schema type. - - - Gets the post-compilation value for the data type of the complex type. - The post-schema-compilation value. - - - Gets the post-compilation information on how this element was derived from its base type. - One of the valid values. - - - Gets or sets the final attribute of the type derivation that indicates if further derivations are allowed. - One of the valid values. The default is . - - - Gets the post-compilation value of the property. - The post-compilation value of the property. The default is the finalDefault attribute value of the schema element. - - - Returns an that represents the built-in complex type of the complex type specified. - One of the values representing the complex type. - The that represents the built-in complex type. - - - Returns an that represents the built-in complex type of the complex type specified by qualified name. - The of the complex type. - The that represents the built-in complex type. - The parameter is null. - - - Returns an that represents the built-in simple type of the specified simple type. - One of the values representing the simple type. - The that represents the built-in simple type. - - - Returns an that represents the built-in simple type of the simple type that is specified by the qualified name. - The of the simple type. - The that represents the built-in simple type. - The parameter is null. - - - Returns a value indicating if the derived schema type specified is derived from the base schema type specified - The derived to test. - The base to test the derived against. - One of the values representing a type derivation method to exclude from testing. - true if the derived type is derived from the base type; otherwise, false. - - - Gets or sets a value indicating if this type has a mixed content model. This property is only valid in a complex type. - true if the type has a mixed content model; otherwise, false. The default is false. - - - Gets or sets the name of the type. - The name of the type. - - - Gets the qualified name for the type built from the Name attribute of this type. This is a post-schema-compilation property. - The for the type built from the Name attribute of this type. - - - Gets the of the type. - One of the values. - - - Represents the unique element from XML Schema as specified by the World Wide Web Consortium (W3C). This class can be used to identify a unique constraint among a set of elements. - - - Initializes a new instance of the class. - - - Indicator of how the attribute is used. - - - Attribute use not specified. - - - - Attribute is optional. - - - - Attribute cannot be used. - - - - Attribute must appear once. - - - - Represents the exception thrown when XML Schema Definition Language (XSD) schema validation errors and warnings are encountered in an XML document being validated. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with the exception message specified. - A string description of the error condition. - - - Initializes a new instance of the class with the and objects specified. - A object. - A object. - - - Initializes a new instance of the class with the exception message and original object that caused this exception specified. - A string description of the error condition. - The original object that caused this exception. - - - Initializes a new instance of the class with the exception message specified, and the original object, line number, and line position of the XML that cause this exception specified. - A string description of the error condition. - The original object that caused this exception. - The line number of the XML that caused this exception. - The line position of the XML that caused this exception. - - - Constructs a new object with the given and information that contains all the properties of the . - - - - - Sets the XML node that causes the error. - The source object. - - - Gets the XML node that caused this . - The XML node that caused this . - - - Specifies schema validation options used by the and classes. - - - Allow xml:* attributes even if they are not defined in the schema. The attributes will be validated based on their data type. - - - - Do not process identity constraints, inline schemas, schema location hints, or report schema validation warnings. - - - - Process identity constraints (xs:ID, xs:IDREF, xs:key, xs:keyref, xs:unique) encountered during validation. - - - - Process inline schemas encountered during validation. - - - - Process schema location hints (xsi:schemaLocation, xsi:noNamespaceSchemaLocation) encountered during validation. - - - - Report schema validation warnings encountered during validation. - - - - Represents an XML Schema Definition Language (XSD) Schema validation engine. The class cannot be inherited. - - - Initializes a new instance of the class. - An object containing element and attribute names as atomized strings. - An object containing the XML Schema Definition Language (XSD) schemas used for validation. - An object used for resolving namespaces encountered during validation. - An value specifying schema validation options. - One or more of the parameters specified are null. - An error occurred while compiling schemas in the parameter. - - - Adds an XML Schema Definition Language (XSD) schema to the set of schemas used for validation. - An object to add to the set of schemas used for validation. - The parameter specified is null. - The target namespace of the parameter matches that of any element or attribute already encountered by the object. - The parameter is invalid. - - - Ends validation and checks identity constraints for the entire XML document. - An identity constraint error was found in the XML document. - - - Returns the expected attributes for the current element context. - An array of objects or an empty array if there are no expected attributes. - - - Returns the expected particles in the current element context. - An array of objects or an empty array if there are no expected particles. - - - Validates identity constraints on the default attributes and populates the specified with objects for any attributes with default values that have not been previously validated using the method in the element context. - An to populate with objects for any attributes not yet encountered during validation in the element context. - - - Initializes the state of the object. - Calling the method is valid immediately after the construction of an object or after a call to only. - - - Initializes the state of the object using the specified for partial validation. - An , , or object used to initialize the validation context of the object for partial validation. - Calling the method is valid immediately after the construction of an object or after a call to only. - The parameter is not an , , or object. - The parameter cannot be null. - - - Gets or sets the line number information for the XML node being validated. - An object. - - - Skips validation of the current element content and prepares the object to validate content in the parent element's context. - An object whose properties are set if the current element content is successfully skipped. This parameter can be null. - The method was not called in the correct sequence. For example, calling after calling . - - - Gets or sets the source URI for the XML node being validated. - A object representing the source URI for the XML node being validated; the default is null. - - - Validates the attribute name, namespace URI, and value in the current element context. - The local name of the attribute to validate. - The namespace URI of the attribute to validate. - An delegate used to pass the attribute's value as a Common Language Runtime (CLR) type compatible with the XML Schema Definition Language (XSD) type of the attribute. - An object whose properties are set on successful validation of the attribute. This parameter and can be null. - The validated attribute's value. - The attribute is not valid in the current element context. - The method was not called in the correct sequence. For example, calling after calling . - One or more of the parameters specified are null. - - - Validates the attribute name, namespace URI, and value in the current element context. - The local name of the attribute to validate. - The namespace URI of the attribute to validate. - The value of the attribute to validate. - An object whose properties are set on successful validation of the attribute. This parameter can be null. - The validated attribute's value. - The attribute is not valid in the current element context. - The method was not called in the correct sequence. For example, calling after calling . - One or more of the parameters specified are null. - - - Validates the element in the current context. - The local name of the element to validate. - The namespace URI of the element to validate. - An object whose properties are set on successful validation of the element's name. This parameter can be null. - The element's name is not valid in the current context. - The method was not called in the correct sequence. For example, the method is called after calling . - - - Validates the element in the current context with the xsi:Type, xsi:Nil, xsi:SchemaLocation, and xsi:NoNamespaceSchemaLocation attribute values specified. - The local name of the element to validate. - The namespace URI of the element to validate. - An object whose properties are set on successful validation of the element's name. This parameter can be null. - The xsi:Type attribute value of the element. This parameter can be null. - The xsi:Nil attribute value of the element. This parameter can be null. - The xsi:SchemaLocation attribute value of the element. This parameter can be null. - The xsi:NoNamespaceSchemaLocation attribute value of the element. This parameter can be null. - The element's name is not valid in the current context. - The method was not called in the correct sequence. For example, the method is called after calling . - - - Verifies if the text content of the element is valid according to its data type for elements with simple content, and verifies if the content of the current element is complete for elements with complex content. - An object whose properties are set on successful validation of the element. This parameter can be null. - The parsed, typed text value of the element if the element has simple content. - The element's content is not valid. - The method was not called in the correct sequence. For example, if the method is called after calling . - - - Verifies if the text content of the element specified is valid according to its data type. - An object whose properties are set on successful validation of the text content of the element. This parameter can be null. - The typed text content of the element. - The parsed, typed simple content of the element. - The element's text content is not valid. - The method was not called in the correct sequence (for example, if the method is called after calling ), calls to the method have been previously made, or the element has complex content. - The typed text content parameter cannot be null. - - - Verifies whether all the required attributes in the element context are present and prepares the object to validate the child content of the element. - An object whose properties are set on successful verification that all the required attributes in the element context are present. This parameter can be null. - One or more of the required attributes in the current element context were not found. - The method was not called in the correct sequence. For example, calling after calling . - One or more of the parameters specified are null. - - - Validates whether the text string specified is allowed in the current element context, and accumulates the text for validation if the current element has simple content. - A text string to validate in the current element context. - The text string specified is not allowed in the current element context. - The method was not called in the correct sequence. For example, the method is called after calling . - The text string parameter cannot be null. - - - Validates whether the text returned by the object specified is allowed in the current element context, and accumulates the text for validation if the current element has simple content. - An delegate used to pass the text value as a Common Language Runtime (CLR) type compatible with the XML Schema Definition Language (XSD) type of the attribute. - The text string specified is not allowed in the current element context. - The method was not called in the correct sequence. For example, the method is called after calling . - The text string parameter cannot be null. - - - Validates whether the white space in the string specified is allowed in the current element context, and accumulates the white space for validation if the current element has simple content. - A white space string to validate in the current element context. - White space is not allowed in the current element context. - The method was not called in the correct sequence. For example, if the method is called after calling . - - - Validates whether the white space returned by the object specified is allowed in the current element context, and accumulates the white space for validation if the current element has simple content. - An delegate used to pass the white space value as a Common Language Runtime (CLR) type compatible with the XML Schema Definition Language (XSD) type of the attribute. - White space is not allowed in the current element context. - The method was not called in the correct sequence. For example, if the method is called after calling . - - - The that receives schema validation warnings and errors encountered during schema validation. - - - - Gets or sets the object sent as the sender object of a validation event. - An ; the default is this object. - - - Sets the object used to resolve xs:import and xs:include elements as well as xsi:schemaLocation and xsi:noNamespaceSchemaLocation attributes. - An object; the default is an object. - - - Represents the validity of an XML item validated by the class. - - - The XML item is invalid. - - - - The validity of the XML item is not known. - - - - The XML item is valid. - - - - Represents the World Wide Web Consortium (W3C) whiteSpace facet. - - - Initializes a new instance of the class. - - - Represents the World Wide Web Consortium (W3C) selector element. - - - Initializes a new instance of the class. - - - Gets or sets the attribute for the XPath expression. - The string attribute value for the XPath expression. - - - Represents the severity of the validation event. - - - Indicates a validation error occurred when validating the instance document. This applies to document type definitions (DTDs) and XML Schema definition language (XSD) schemas. The World Wide Web Consortium (W3C) validity constraints are considered errors. If no validation event handler has been created, errors throw an exception. - - - - Indicates that a validation event occurred that is not an error. A warning is typically issued when there is no DTD, or XML Schema to validate a particular element or attribute against. Unlike errors, warnings do not throw an exception if there is no validation event handler. - - - - Represents the W3C XML Schema Definition Language (XSD) schema types. - - - Any atomic value of a union. - - - - A W3C XML Schema xs:anyURI type. - - - - This value supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - - A W3C XML Schema xs:base64Binary type. - - - - A W3C XML Schema xs:boolean type. - - - - A W3C XML Schema xs:byte type. - - - - This value supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - - A W3C XML Schema xs:date type. - - - - A W3C XML Schema xs:dateTime type. - - - - This value supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - - A W3C XML Schema xs:decimal type. - - - - This value supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - - A W3C XML Schema xs:double type. - - - - A W3C XML Schema xs:Duration type. - - - - This value supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - - A W3C XML Schema xs:ENTITY type. - - - - A W3C XML Schema xs:float type. - - - - A W3C XML Schema xs:gDay type. - - - - A W3C XML Schema xs:gMonth type. - - - - A W3C XML Schema xs:gMonthDay type. - - - - A W3C XML Schema xs:gYear type. - - - - A W3C XML Schema xs:gYearMonth type. - - - - A W3C XML Schema xs:hexBinary type. - - - - A W3C XML Schema xs:ID type. - - - - A W3C XML Schema xs:IDREF type. - - - - A W3C XML Schema xs:int type. - - - - A W3C XML Schema xs:integer type. - - - - An item such as a node or atomic value. - - - - A W3C XML Schema xs:language type. - - - - A W3C XML Schema xs:long type. - - - - A W3C XML Schema xs:Name type. - - - - This value supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - - A W3C XML Schema xs:NCName type. - - - - A W3C XML Schema xs:negativeInteger type. - - - - A W3C XML Schema xs:NMTOKEN type. - - - - This value supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - - No type information. - - - - A W3C XML Schema xs:nonNegativeInteger type. - - - - A W3C XML Schema xs:nonPositiveInteger type. - - - - A W3C XML Schema xs:normalizedString type. - - - - A W3C XML Schema xs:NOTATION type. - - - - A W3C XML Schema xs:positiveInteger type. - - - - This value supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - - A W3C XML Schema xs:QName type. - - - - A W3C XML Schema xs:short type. - - - - A W3C XML Schema xs:string type. - - - - This value supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - - A W3C XML Schema xs:time type. - - - - A W3C XML Schema xs:token type. - - - - A W3C XML Schema xs:unsignedByte type. - - - - A W3C XML Schema xs:unsignedInt type. - - - - A W3C XML Schema xs:unsignedLong type. - - - - A W3C XML Schema xs:unsignedShort type. - - - - An untyped atomic value. - - - - This value supports the .NET Framework infrastructure and is not intended to be used directly from your code. - - - - A delegate used by the class to pass attribute, text, and white space values as a Common Language Runtime (CLR) type compatible with the XML Schema Definition Language (XSD) type of the attribute, text, or white space. - - - - Specifies various options to use when generating .NET Framework types for use with an XML Web Service. - - - Enables data binding. - - - - Creates events for the asynchronous invocation of Web methods. - - - - Creates Begin and End methods for the asynchronous invocation of Web methods. - - - - Generates explicitly ordered serialization code as specified through the Order property of the , , and attributes. - - - - Represents primitive types by properties. - - - - Represents primitive types by fields and primitive types by namespace types. - - - - Provides static methods to convert input text into names for code entities. - - - Initializes a new instance of the class. - - - Produces a camel-case string from an input string. - The name of a code entity, such as a method parameter, typically taken from an XML element or attribute name. - A camel-case version of the parameter string. - - - Produces a Pascal-case string from an input string. - The name of a code entity, such as a method parameter, typically taken from an XML element or attribute name. - A Pascal-case version of the parameter string. - - - Produces a valid code entity name from an input string. - The name of a code entity, such as a method parameter, typically taken from an XML element or attribute name. - A string that can be used as a code identifier, such as the name of a method parameter. - - - Maintains a group of names for related code entities or type mappings that are generated by the .NET Framework's XML serialization infrastructure. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class and determines whether code identifiers are case sensitive. - true if identifiers are case sensitive; otherwise, false. - - - Adds a named code entity or type mapping to the instance's scope. - A name that is used to index the code entity. - The code entity or type mapping information. - - - Prevents a specified name from being used within the instance's scope. - A name that will not be available within the instance's scope. - - - Adds a named code entity or type mapping to the instance's scope, ensuring that the name is unique within the scope. - A candidate name that is used to index the code entity. - The code entity or type mapping information. - The identifier parameter value or a modified string if there is a name collision. - - - Removes all code entities or type mappings, including their names, from the instance's scope. - - - Determines whether a specified name is already being used within the instance's scope. - The name to check for use within the instance's scope. - true if the name is already in use; otherwise, false. - - - Ensures that the input is of the correct case by modifying the name according to the value of the property. - The name to possibly modify. - A string that is the same as the input identifier or has the first letter's case modified. - - - Determines whether the input name conflicts with another name within the instance's scope and, if it does, generates a modified string. - The name to modify if it is not already unique. - The identifier parameter value or a modified string if there is a name collision. - - - Removes from the instance's scope the code entity or type mapping identified by the input name. - The name of the code entity or type mapping information to remove. - - - Removes the input name from the instance's reserved names. - A name that will be made available within the instance's scope. - - - Returns an array of the code entities or type mappings within the instance's scope. - The type of all the code entities or type mappings for the instance. - An array of the code entities or type mappings that is stored by the object. - - - Gets or sets a value that indicates whether the instance uses camel case. - true to indicate that the instance uses camel case; false to indicate that the instance uses Pascal case. - - - Encapsulates a method that has 14 parameters and does not return a value. - The first parameter of the method that this delegate encapsulates. - The second parameter of the method that this delegate encapsulates. - The third parameter of the method that this delegate encapsulates. - The fourth parameter of the method that this delegate encapsulates. - The fifth parameter of the method that this delegate encapsulates. - The sixth parameter of the method that this delegate encapsulates. - The seventh parameter of the method that this delegate encapsulates. - The eighth parameter of the method that this delegate encapsulates. - The ninth parameter of the method that this delegate encapsulates. - The tenth parameter of the method that this delegate encapsulates. - The eleventh parameter of the method that this delegate encapsulates. - The twelfth parameter of the method that this delegate encapsulates. - The thirteenth parameter of the method that this delegate encapsulates. - The fourteenth parameter of the method that this delegate encapsulates. - The type of the first parameter of the method that this delegate encapsulates. - The type of the second parameter of the method that this delegate encapsulates. - The type of the third parameter of the method that this delegate encapsulates. - The type of the fourth parameter of the method that this delegate encapsulates. - The type of the fifth parameter of the method that this delegate encapsulates. - The type of the sixth parameter of the method that this delegate encapsulates. - The type of the seventh parameter of the method that this delegate encapsulates. - The type of the eighth parameter of the method that this delegate encapsulates. - The type of the ninth parameter of the method that this delegate encapsulates. - The type of the tenth parameter of the method that this delegate encapsulates. - The type of the eleventh parameter of the method that this delegate encapsulates. - The type of the twelfth parameter of the method that this delegate encapsulates. - The type of the thirteenth parameter of the method that this delegate encapsulates. - The type of the fourteenth parameter of the method that this delegate encapsulates. - - - Encapsulates a method that has 15 parameters and does not return a value. - The first parameter of the method that this delegate encapsulates. - The second parameter of the method that this delegate encapsulates. - The third parameter of the method that this delegate encapsulates. - The fourth parameter of the method that this delegate encapsulates. - The fifth parameter of the method that this delegate encapsulates. - The sixth parameter of the method that this delegate encapsulates. - The seventh parameter of the method that this delegate encapsulates. - The eighth parameter of the method that this delegate encapsulates. - The ninth parameter of the method that this delegate encapsulates. - The tenth parameter of the method that this delegate encapsulates. - The eleventh parameter of the method that this delegate encapsulates. - The twelfth parameter of the method that this delegate encapsulates. - The thirteenth parameter of the method that this delegate encapsulates. - The fourteenth parameter of the method that this delegate encapsulates. - The fifteenth parameter of the method that this delegate encapsulates. - The type of the first parameter of the method that this delegate encapsulates. - The type of the second parameter of the method that this delegate encapsulates. - The type of the third parameter of the method that this delegate encapsulates. - The type of the fourth parameter of the method that this delegate encapsulates. - The type of the fifth parameter of the method that this delegate encapsulates. - The type of the sixth parameter of the method that this delegate encapsulates. - The type of the seventh parameter of the method that this delegate encapsulates. - The type of the eighth parameter of the method that this delegate encapsulates. - The type of the ninth parameter of the method that this delegate encapsulates. - The type of the tenth parameter of the method that this delegate encapsulates. - The type of the eleventh parameter of the method that this delegate encapsulates. - The type of the twelfth parameter of the method that this delegate encapsulates. - The type of the thirteenth parameter of the method that this delegate encapsulates. - The type of the fourteenth parameter of the method that this delegate encapsulates. - The type of the fifteenth parameter of the method that this delegate encapsulates. - - - Encapsulates a method that has 16 parameters and does not return a value. - The first parameter of the method that this delegate encapsulates. - The second parameter of the method that this delegate encapsulates. - The third parameter of the method that this delegate encapsulates. - The fourth parameter of the method that this delegate encapsulates. - The fifth parameter of the method that this delegate encapsulates. - The sixth parameter of the method that this delegate encapsulates. - The seventh parameter of the method that this delegate encapsulates. - The eighth parameter of the method that this delegate encapsulates. - The ninth parameter of the method that this delegate encapsulates. - The tenth parameter of the method that this delegate encapsulates. - The eleventh parameter of the method that this delegate encapsulates. - The twelfth parameter of the method that this delegate encapsulates. - The thirteenth parameter of the method that this delegate encapsulates. - The fourteenth parameter of the method that this delegate encapsulates. - The fifteenth parameter of the method that this delegate encapsulates. - The sixteenth parameter of the method that this delegate encapsulates. - The type of the first parameter of the method that this delegate encapsulates. - The type of the second parameter of the method that this delegate encapsulates. - The type of the third parameter of the method that this delegate encapsulates. - The type of the fourth parameter of the method that this delegate encapsulates. - The type of the fifth parameter of the method that this delegate encapsulates. - The type of the sixth parameter of the method that this delegate encapsulates. - The type of the seventh parameter of the method that this delegate encapsulates. - The type of the eighth parameter of the method that this delegate encapsulates. - The type of the ninth parameter of the method that this delegate encapsulates. - The type of the tenth parameter of the method that this delegate encapsulates. - The type of the eleventh parameter of the method that this delegate encapsulates. - The type of the twelfth parameter of the method that this delegate encapsulates. - The type of the thirteenth parameter of the method that this delegate encapsulates. - The type of the fourteenth parameter of the method that this delegate encapsulates. - The type of the fifteenth parameter of the method that this delegate encapsulates. - The type of the sixteenth parameter of the method that this delegate encapsulates. - - - Encapsulates a method that has two parameters and does not return a value. - The first parameter of the method that this delegate encapsulates. - The second parameter of the method that this delegate encapsulates. - The type of the first parameter of the method that this delegate encapsulates. - The type of the second parameter of the method that this delegate encapsulates. - - - Encapsulates a method that has three parameters and does not return a value. - The first parameter of the method that this delegate encapsulates. - The second parameter of the method that this delegate encapsulates. - The third parameter of the method that this delegate encapsulates. - The type of the first parameter of the method that this delegate encapsulates. - The type of the second parameter of the method that this delegate encapsulates. - The type of the third parameter of the method that this delegate encapsulates. - - - Encapsulates a method that has four parameters and does not return a value. - The first parameter of the method that this delegate encapsulates. - The second parameter of the method that this delegate encapsulates. - The third parameter of the method that this delegate encapsulates. - The fourth parameter of the method that this delegate encapsulates. - The type of the first parameter of the method that this delegate encapsulates. - The type of the second parameter of the method that this delegate encapsulates. - The type of the third parameter of the method that this delegate encapsulates. - The type of the fourth parameter of the method that this delegate encapsulates. - - - Encapsulates a method that has five parameters and does not return a value. - The first parameter of the method that this delegate encapsulates. - The second parameter of the method that this delegate encapsulates. - The third parameter of the method that this delegate encapsulates. - The fourth parameter of the method that this delegate encapsulates. - The fifth parameter of the method that this delegate encapsulates. - The type of the first parameter of the method that this delegate encapsulates. - The type of the second parameter of the method that this delegate encapsulates. - The type of the third parameter of the method that this delegate encapsulates. - The type of the fourth parameter of the method that this delegate encapsulates. - The type of the fifth parameter of the method that this delegate encapsulates. - - - Encapsulates a method that has six parameters and does not return a value. - The first parameter of the method that this delegate encapsulates. - The second parameter of the method that this delegate encapsulates. - The third parameter of the method that this delegate encapsulates. - The fourth parameter of the method that this delegate encapsulates. - The fifth parameter of the method that this delegate encapsulates. - The sixth parameter of the method that this delegate encapsulates. - The type of the first parameter of the method that this delegate encapsulates. - The type of the second parameter of the method that this delegate encapsulates. - The type of the third parameter of the method that this delegate encapsulates. - The type of the fourth parameter of the method that this delegate encapsulates. - The type of the fifth parameter of the method that this delegate encapsulates. - The type of the sixth parameter of the method that this delegate encapsulates. - - - Encapsulates a method that has seven parameters and does not return a value. - The first parameter of the method that this delegate encapsulates. - The second parameter of the method that this delegate encapsulates. - The third parameter of the method that this delegate encapsulates. - The fourth parameter of the method that this delegate encapsulates. - The fifth parameter of the method that this delegate encapsulates. - The sixth parameter of the method that this delegate encapsulates. - The seventh parameter of the method that this delegate encapsulates. - The type of the first parameter of the method that this delegate encapsulates. - The type of the second parameter of the method that this delegate encapsulates. - The type of the third parameter of the method that this delegate encapsulates. - The type of the fourth parameter of the method that this delegate encapsulates. - The type of the fifth parameter of the method that this delegate encapsulates. - The type of the sixth parameter of the method that this delegate encapsulates. - The type of the seventh parameter of the method that this delegate encapsulates. - - - Encapsulates a method that has eight parameters and does not return a value. - The first parameter of the method that this delegate encapsulates. - The second parameter of the method that this delegate encapsulates. - The third parameter of the method that this delegate encapsulates. - The fourth parameter of the method that this delegate encapsulates. - The fifth parameter of the method that this delegate encapsulates. - The sixth parameter of the method that this delegate encapsulates. - The seventh parameter of the method that this delegate encapsulates. - The eighth parameter of the method that this delegate encapsulates. - The type of the first parameter of the method that this delegate encapsulates. - The type of the second parameter of the method that this delegate encapsulates. - The type of the third parameter of the method that this delegate encapsulates. - The type of the fourth parameter of the method that this delegate encapsulates. - The type of the fifth parameter of the method that this delegate encapsulates. - The type of the sixth parameter of the method that this delegate encapsulates. - The type of the seventh parameter of the method that this delegate encapsulates. - The type of the eighth parameter of the method that this delegate encapsulates. - - - Encapsulates a method that has nine parameters and does not return a value. - The first parameter of the method that this delegate encapsulates. - The second parameter of the method that this delegate encapsulates. - The third parameter of the method that this delegate encapsulates. - The fourth parameter of the method that this delegate encapsulates. - The fifth parameter of the method that this delegate encapsulates. - The sixth parameter of the method that this delegate encapsulates. - The seventh parameter of the method that this delegate encapsulates. - The eighth parameter of the method that this delegate encapsulates. - The ninth parameter of the method that this delegate encapsulates. - The type of the first parameter of the method that this delegate encapsulates. - The type of the second parameter of the method that this delegate encapsulates. - The type of the third parameter of the method that this delegate encapsulates. - The type of the fourth parameter of the method that this delegate encapsulates. - The type of the fifth parameter of the method that this delegate encapsulates. - The type of the sixth parameter of the method that this delegate encapsulates. - The type of the seventh parameter of the method that this delegate encapsulates. - The type of the eighth parameter of the method that this delegate encapsulates. - The type of the ninth parameter of the method that this delegate encapsulates. - - - Encapsulates a method that has no parameters and does not return a value. - - - Contains methods to create types of objects locally or remotely, or obtain references to existing remote objects. This class cannot be inherited. - - - Creates an instance of the specified type using the constructor that best matches the specified parameters. - The type of object to create. - A combination of zero or more bit flags that affect the search for the type constructor. If bindingAttr is zero, a case-sensitive search for public constructors is conducted. - An object that uses bindingAttr and args to seek and identify the type constructor. If binder is null, the default binder is used. - An array of arguments that match in number, order, and type the parameters of the constructor to invoke. If args is an empty array or null, the constructor that takes no parameters (the default constructor) is invoked. - Culture-specific information that governs the coercion of args to the formal types declared for the type constructor. If culture is null, the for the current thread is used. - An array of one or more attributes that can participate in activation. This is typically an array that contains a single object that specifies the URL that is required to activate a remote object. This parameter is related to client-activated objects. Client activation is a legacy technology that is retained for backward compatibility but is not recommended for new development. Distributed applications should instead use Windows Communication Foundation. - A reference to the newly created object. - type is null. - type is not a RuntimeType. -or- type is an open generic type (that is, the property returns true). - type cannot be a . -or- Creation of , , , and types, or arrays of those types, is not supported. -or- activationAttributes is not an empty array, and the type being created does not derive from . -or- The assembly that contains type is a dynamic assembly that was created with . -or- The constructor that best matches args has varargs arguments. - The constructor being called throws an exception. - The caller does not have permission to call this constructor. - Cannot create an instance of an abstract class, or this member was invoked with a late-binding mechanism. - The COM type was not obtained through or . - No matching constructor was found. - type is a COM object but the class identifier used to obtain the type is invalid, or the identified class is not registered. - type is not a valid type. - - - Creates an instance of the specified type using the constructor that best matches the specified parameters. - The type of object to create. - A combination of zero or more bit flags that affect the search for the type constructor. If bindingAttr is zero, a case-sensitive search for public constructors is conducted. - An object that uses bindingAttr and args to seek and identify the type constructor. If binder is null, the default binder is used. - An array of arguments that match in number, order, and type the parameters of the constructor to invoke. If args is an empty array or null, the constructor that takes no parameters (the default constructor) is invoked. - Culture-specific information that governs the coercion of args to the formal types declared for the type constructor. If culture is null, the for the current thread is used. - A reference to the newly created object. - type is null. - type is not a RuntimeType. -or- type is an open generic type (that is, the property returns true). - type cannot be a . -or- Creation of , , , and types, or arrays of those types, is not supported. -or- The assembly that contains type is a dynamic assembly that was created with . -or- The constructor that best matches args has varargs arguments. - The constructor being called throws an exception. - The caller does not have permission to call this constructor. - Cannot create an instance of an abstract class, or this member was invoked with a late-binding mechanism. - The COM type was not obtained through or . - No matching constructor was found. - type is a COM object but the class identifier used to obtain the type is invalid, or the identified class is not registered. - type is not a valid type. - - - Creates an instance of the specified type using the constructor that best matches the specified parameters. - The type of object to create. - An array of arguments that match in number, order, and type the parameters of the constructor to invoke. If args is an empty array or null, the constructor that takes no parameters (the default constructor) is invoked. - An array of one or more attributes that can participate in activation. This is typically an array that contains a single object that specifies the URL that is required to activate a remote object. This parameter is related to client-activated objects. Client activation is a legacy technology that is retained for backward compatibility but is not recommended for new development. Distributed applications should instead use Windows Communication Foundation. - A reference to the newly created object. - type is null. - type is not a RuntimeType. -or- type is an open generic type (that is, the property returns true). - type cannot be a . -or- Creation of , , , and types, or arrays of those types, is not supported. -or- activationAttributes is not an empty array, and the type being created does not derive from . -or- The assembly that contains type is a dynamic assembly that was created with . -or- The constructor that best matches args has varargs arguments. - The constructor being called throws an exception. - The caller does not have permission to call this constructor. - Cannot create an instance of an abstract class, or this member was invoked with a late-binding mechanism. - The COM type was not obtained through or . - No matching public constructor was found. - type is a COM object but the class identifier used to obtain the type is invalid, or the identified class is not registered. - type is not a valid type. - - - Creates an instance of the specified type using the constructor that best matches the specified parameters. - The type of object to create. - An array of arguments that match in number, order, and type the parameters of the constructor to invoke. If args is an empty array or null, the constructor that takes no parameters (the default constructor) is invoked. - A reference to the newly created object. - type is null. - type is not a RuntimeType. -or- type is an open generic type (that is, the property returns true). - type cannot be a . -or- Creation of , , , and types, or arrays of those types, is not supported. -or- The assembly that contains type is a dynamic assembly that was created with . -or- The constructor that best matches args has varargs arguments. - The constructor being called throws an exception. - - In the [.NET for Windows Store apps](http://go.microsoft.com/fwlink/?LinkID=247912) or the [Portable Class Library](~/docs/standard/cross-platform/cross-platform-development-with-the-portable-class-library.md), catch the base class exception, , instead. - - The caller does not have permission to call this constructor. - Cannot create an instance of an abstract class, or this member was invoked with a late-binding mechanism. - The COM type was not obtained through or . - - In the [.NET for Windows Store apps](http://go.microsoft.com/fwlink/?LinkID=247912) or the [Portable Class Library](~/docs/standard/cross-platform/cross-platform-development-with-the-portable-class-library.md), catch the base class exception, , instead. - - No matching public constructor was found. - type is a COM object but the class identifier used to obtain the type is invalid, or the identified class is not registered. - type is not a valid type. - - - Creates an instance of the specified type using that type's default constructor. - The type of object to create. - true if a public or nonpublic default constructor can match; false if only a public default constructor can match. - A reference to the newly created object. - type is null. - type is not a RuntimeType. -or- type is an open generic type (that is, the property returns true). - type cannot be a . -or- Creation of , , , and types, or arrays of those types, is not supported. -or- The assembly that contains type is a dynamic assembly that was created with . - The constructor being called throws an exception. - The caller does not have permission to call this constructor. - Cannot create an instance of an abstract class, or this member was invoked with a late-binding mechanism. - The COM type was not obtained through or . - No matching public constructor was found. - type is a COM object but the class identifier used to obtain the type is invalid, or the identified class is not registered. - type is not a valid type. - - - Creates an instance of the specified type using that type's default constructor. - The type of object to create. - A reference to the newly created object. - type is null. - type is not a RuntimeType. -or- type is an open generic type (that is, the property returns true). - type cannot be a . -or- Creation of , , , and types, or arrays of those types, is not supported. -or- The assembly that contains type is a dynamic assembly that was created with . - The constructor being called throws an exception. - - In the [.NET for Windows Store apps](http://go.microsoft.com/fwlink/?LinkID=247912) or the [Portable Class Library](~/docs/standard/cross-platform/cross-platform-development-with-the-portable-class-library.md), catch the base class exception, , instead. - - The caller does not have permission to call this constructor. - Cannot create an instance of an abstract class, or this member was invoked with a late-binding mechanism. - The COM type was not obtained through or . - - In the [.NET for Windows Store apps](http://go.microsoft.com/fwlink/?LinkID=247912) or the [Portable Class Library](~/docs/standard/cross-platform/cross-platform-development-with-the-portable-class-library.md), catch the base class exception, , instead. - - No matching public constructor was found. - type is a COM object but the class identifier used to obtain the type is invalid, or the identified class is not registered. - type is not a valid type. - - - Creates an instance of the type designated by the specified generic type parameter, using the parameterless constructor. - The type to create. - A reference to the newly created object. - - In the [.NET for Windows Store apps](http://go.microsoft.com/fwlink/?LinkID=247912) or the [Portable Class Library](~/docs/standard/cross-platform/cross-platform-development-with-the-portable-class-library.md), catch the base class exception, , instead. - - The type that is specified for T does not have a parameterless constructor. - - - Defines methods to support the comparison of objects for equality. - The type of objects to compare. - - - Determines whether the specified objects are equal. - The first object of type T to compare. - The second object of type T to compare. - true if the specified objects are equal; otherwise, false. - - - Returns a hash code for the specified object. - The for which a hash code is to be returned. - A hash code for the specified object. - The type of obj is a reference type and obj is null. - - - Represents a collection of objects that can be individually accessed by index. - The type of elements in the list. - - - Determines the index of a specific item in the . - The object to locate in the . - The index of item if found in the list; otherwise, -1. - - - Inserts an item to the at the specified index. - The zero-based index at which item should be inserted. - The object to insert into the . - index is not a valid index in the . - The is read-only. - - - Gets or sets the element at the specified index. - The zero-based index of the element to get or set. - The element at the specified index. - index is not a valid index in the . - The property is set and the is read-only. - - - Removes the item at the specified index. - The zero-based index of the item to remove. - index is not a valid index in the . - The is read-only. - - - Represents a strongly-typed, read-only collection of elements. - The type of the elements. - - - Gets the number of elements in the collection. - The number of elements in the collection. - - - Represents a generic read-only collection of key/value pairs. - The type of keys in the read-only dictionary. - The type of values in the read-only dictionary. - - - Determines whether the read-only dictionary contains an element that has the specified key. - The key to locate. - true if the read-only dictionary contains an element that has the specified key; otherwise, false. - key is null. - - - Gets the element that has the specified key in the read-only dictionary. - The key to locate. - The element that has the specified key in the read-only dictionary. - key is null. - The property is retrieved and key is not found. - - - Gets an enumerable collection that contains the keys in the read-only dictionary. - An enumerable collection that contains the keys in the read-only dictionary. - - - Gets the value that is associated with the specified key. - The key to locate. - When this method returns, the value associated with the specified key, if the key is found; otherwise, the default value for the type of the value parameter. This parameter is passed uninitialized. - true if the object that implements the interface contains an element that has the specified key; otherwise, false. - key is null. - - - Gets an enumerable collection that contains the values in the read-only dictionary. - An enumerable collection that contains the values in the read-only dictionary. - - - Represents a read-only collection of elements that can be accessed by index. - The type of elements in the read-only list. - - - Gets the element at the specified index in the read-only list. - The zero-based index of the element to get. - The element at the specified index in the read-only list. - - - Provides the base interface for the abstraction of sets. - The type of elements in the set. - - - Adds an element to the current set and returns a value to indicate if the element was successfully added. - The element to add to the set. - true if the element is added to the set; false if the element is already in the set. - - - Removes all elements in the specified collection from the current set. - The collection of items to remove from the set. - other is null. - - - Modifies the current set so that it contains only elements that are also in a specified collection. - The collection to compare to the current set. - other is null. - - - Determines whether the current set is a proper (strict) subset of a specified collection. - The collection to compare to the current set. - true if the current set is a proper subset of other; otherwise, false. - other is null. - - - Determines whether the current set is a proper (strict) superset of a specified collection. - The collection to compare to the current set. - true if the current set is a proper superset of other; otherwise, false. - other is null. - - - Determines whether a set is a subset of a specified collection. - The collection to compare to the current set. - true if the current set is a subset of other; otherwise, false. - other is null. - - - Determines whether the current set is a superset of a specified collection. - The collection to compare to the current set. - true if the current set is a superset of other; otherwise, false. - other is null. - - - Determines whether the current set overlaps with the specified collection. - The collection to compare to the current set. - true if the current set and other share at least one common element; otherwise, false. - other is null. - - - Determines whether the current set and the specified collection contain the same elements. - The collection to compare to the current set. - true if the current set is equal to other; otherwise, false. - other is null. - - - Modifies the current set so that it contains only elements that are present either in the current set or in the specified collection, but not both. - The collection to compare to the current set. - other is null. - - - Modifies the current set so that it contains all elements that are present in the current set, in the specified collection, or in both. - The collection to compare to the current set. - other is null. - - - The exception that is thrown when the key specified for accessing an element in a collection does not match any key in the collection. - - - Initializes a new instance of the class using default property values. - - - Initializes a new instance of the class with the specified error message. - The message that describes the error. - - - Initializes a new instance of the class with serialized data. - The that holds the serialized object data about the exception being thrown. - The that contains contextual information about the source or destination. - - - Initializes a new instance of the class with the specified error message and a reference to the inner exception that is the cause of this exception. - The error message that explains the reason for the exception. - The exception that is the cause of the current exception. If the innerException parameter is not null, the current exception is raised in a catch block that handles the inner exception. - - - Defines a key/value pair that can be set or retrieved. - The type of the key. - The type of the value. - - - Initializes a new instance of the structure with the specified key and value. - The object defined in each key/value pair. - The definition associated with key. - - - Gets the key in the key/value pair. - A TKey that is the key of the . - - - Returns a string representation of the , using the string representations of the key and value. - A string representation of the , which includes the string representations of the key and value. - - - Gets the value in the key/value pair. - A TValue that is the value of the . - - - Enumerates the elements of a . - - - - Gets the element at the current position of the enumerator. - The element in the at the current position of the enumerator. - - - Releases all resources used by the . - - - Advances the enumerator to the next element of the . - true if the enumerator was successfully advanced to the next element; false if the enumerator has passed the end of the collection. - The collection was modified after the enumerator was created. - - - Gets the element at the current position of the enumerator. - The element in the collection at the current position of the enumerator. - The enumerator is positioned before the first element of the collection or after the last element. - - - Sets the enumerator to its initial position, which is before the first element in the collection. This class cannot be inherited. - The collection was modified after the enumerator was created. - - - Implements the interface and raises the deserialization event when the deserialization is complete. - The source of the deserialization event. - The object associated with the current instance is invalid. - - - Implements the interface and returns the data needed to serialize the instance. - A object that contains the information required to serialize the instance. - A object that contains the source and destination of the serialized stream associated with the instance. - info is null. - - - Represents a doubly linked list. - Specifies the element type of the linked list. - - - Initializes a new instance of the class that is empty. - - - Initializes a new instance of the class that contains elements copied from the specified and has sufficient capacity to accommodate the number of elements copied. - The whose elements are copied to the new . - collection is null. - - - Initializes a new instance of the class that is serializable with the specified and . - A object containing the information required to serialize the . - A object containing the source and destination of the serialized stream associated with the . - - - Adds the specified new node after the specified existing node in the . - The after which to insert newNode. - The new to add to the . - node is null. -or- newNode is null. - node is not in the current . -or- newNode belongs to another . - - - Adds a new node containing the specified value after the specified existing node in the . - The after which to insert a new containing value. - The value to add to the . - The new containing value. - node is null. - node is not in the current . - - - Adds the specified new node before the specified existing node in the . - The before which to insert newNode. - The new to add to the . - node is null. -or- newNode is null. - node is not in the current . -or- newNode belongs to another . - - - Adds a new node containing the specified value before the specified existing node in the . - The before which to insert a new containing value. - The value to add to the . - The new containing value. - node is null. - node is not in the current . - - - Adds the specified new node at the start of the . - The new to add at the start of the . - node is null. - node belongs to another . - - - Adds a new node containing the specified value at the start of the . - The value to add at the start of the . - The new containing value. - - - Adds the specified new node at the end of the . - The new to add at the end of the . - node is null. - node belongs to another . - - - Adds a new node containing the specified value at the end of the . - The value to add at the end of the . - The new containing value. - - - Removes all nodes from the . - - - Determines whether a value is in the . - The value to locate in the . The value can be null for reference types. - true if value is found in the ; otherwise, false. - - - Copies the entire to a compatible one-dimensional , starting at the specified index of the target array. - The one-dimensional that is the destination of the elements copied from . The must have zero-based indexing. - The zero-based index in array at which copying begins. - array is null. - index is less than zero. - The number of elements in the source is greater than the available space from index to the end of the destination array. - - - Gets the number of nodes actually contained in the . - The number of nodes actually contained in the . - - - Finds the first node that contains the specified value. - The value to locate in the . - The first that contains the specified value, if found; otherwise, null. - - - Finds the last node that contains the specified value. - The value to locate in the . - The last that contains the specified value, if found; otherwise, null. - - - Gets the first node of the . - The first of the . - - - Returns an enumerator that iterates through the . - An for the . - - - Implements the interface and returns the data needed to serialize the instance. - A object that contains the information required to serialize the instance. - A object that contains the source and destination of the serialized stream associated with the instance. - info is null. - - - Gets the last node of the . - The last of the . - - - Implements the interface and raises the deserialization event when the deserialization is complete. - The source of the deserialization event. - The object associated with the current instance is invalid. - - - Removes the specified node from the . - The to remove from the . - node is null. - node is not in the current . - - - Removes the first occurrence of the specified value from the . - The value to remove from the . - true if the element containing value is successfully removed; otherwise, false. This method also returns false if value was not found in the original . - - - Removes the node at the start of the . - The is empty. - - - Removes the node at the end of the . - The is empty. - - - Adds an item at the end of the . - The value to add at the end of the . - - - Gets a value indicating whether the is read-only. - true if the is read-only; otherwise, false. In the default implementation of , this property always returns false. - - - Returns an enumerator that iterates through a collection. - An that can be used to iterate through the collection. - - - Copies the elements of the to an , starting at a particular index. - The one-dimensional that is the destination of the elements copied from . The must have zero-based indexing. - The zero-based index in array at which copying begins. - array is null. - index is less than zero. - array is multidimensional. -or- array does not have zero-based indexing. -or- The number of elements in the source is greater than the available space from index to the end of the destination array. -or- The type of the source cannot be cast automatically to the type of the destination array. - - - Gets a value indicating whether access to the is synchronized (thread safe). - true if access to the is synchronized (thread safe); otherwise, false. In the default implementation of , this property always returns false. - - - Gets an object that can be used to synchronize access to the . - An object that can be used to synchronize access to the . In the default implementation of , this property always returns the current instance. - - - Returns an enumerator that iterates through the linked list as a collection. - An that can be used to iterate through the linked list as a collection. - - - Represents a node in a . This class cannot be inherited. - Specifies the element type of the linked list. - - - Initializes a new instance of the class, containing the specified value. - The value to contain in the . - - - Gets the that the belongs to. - A reference to the that the belongs to, or null if the is not linked. - - - Gets the next node in the . - A reference to the next node in the , or null if the current node is the last element () of the . - - - Gets the previous node in the . - A reference to the previous node in the , or null if the current node is the first element () of the . - - - Gets the value contained in the node. - The value contained in the node. - - - Enumerates the elements of a . - - - - Gets the element at the current position of the enumerator. - The element in the at the current position of the enumerator. - - - Releases all resources used by the . - - - Advances the enumerator to the next element of the . - true if the enumerator was successfully advanced to the next element; false if the enumerator has passed the end of the collection. - The collection was modified after the enumerator was created. - - - Gets the element at the current position of the enumerator. - The element in the at the current position of the enumerator. - The enumerator is positioned before the first element of the collection or after the last element. - - - Sets the enumerator to its initial position, which is before the first element in the collection. - The collection was modified after the enumerator was created. - - - Represents a strongly typed list of objects that can be accessed by index. Provides methods to search, sort, and manipulate lists. - The type of elements in the list. - - - Initializes a new instance of the class that is empty and has the default initial capacity. - - - Initializes a new instance of the class that contains elements copied from the specified collection and has sufficient capacity to accommodate the number of elements copied. - The collection whose elements are copied to the new list. - collection is null. - - - Initializes a new instance of the class that is empty and has the specified initial capacity. - The number of elements that the new list can initially store. - capacity is less than 0. - - - Adds an object to the end of the . - The object to be added to the end of the . The value can be null for reference types. - - - Adds the elements of the specified collection to the end of the . - The collection whose elements should be added to the end of the . The collection itself cannot be null, but it can contain elements that are null, if type T is a reference type. - collection is null. - - - Returns a read-only wrapper for the current collection. - An object that acts as a read-only wrapper around the current . - - - Searches the entire sorted for an element using the default comparer and returns the zero-based index of the element. - The object to locate. The value can be null for reference types. - The zero-based index of item in the sorted , if item is found; otherwise, a negative number that is the bitwise complement of the index of the next element that is larger than item or, if there is no larger element, the bitwise complement of . - The default comparer cannot find an implementation of the generic interface or the interface for type T. - - - Searches the entire sorted for an element using the specified comparer and returns the zero-based index of the element. - The object to locate. The value can be null for reference types. - The implementation to use when comparing elements. -or- null to use the default comparer . - The zero-based index of item in the sorted , if item is found; otherwise, a negative number that is the bitwise complement of the index of the next element that is larger than item or, if there is no larger element, the bitwise complement of . - comparer is null, and the default comparer cannot find an implementation of the generic interface or the interface for type T. - - - Searches a range of elements in the sorted for an element using the specified comparer and returns the zero-based index of the element. - The zero-based starting index of the range to search. - The length of the range to search. - The object to locate. The value can be null for reference types. - The implementation to use when comparing elements, or null to use the default comparer . - The zero-based index of item in the sorted , if item is found; otherwise, a negative number that is the bitwise complement of the index of the next element that is larger than item or, if there is no larger element, the bitwise complement of . - index is less than 0. -or- count is less than 0. - index and count do not denote a valid range in the . - comparer is null, and the default comparer cannot find an implementation of the generic interface or the interface for type T. - - - Gets or sets the total number of elements the internal data structure can hold without resizing. - The number of elements that the can contain before resizing is required. - is set to a value that is less than . - There is not enough memory available on the system. - - - Removes all elements from the . - - - Determines whether an element is in the . - The object to locate in the . The value can be null for reference types. - true if item is found in the ; otherwise, false. - - - Converts the elements in the current to another type, and returns a list containing the converted elements. - A delegate that converts each element from one type to another type. - The type of the elements of the target array. - A of the target type containing the converted elements from the current . - converter is null. - - - Copies the entire to a compatible one-dimensional array, starting at the specified index of the target array. - The one-dimensional that is the destination of the elements copied from . The must have zero-based indexing. - The zero-based index in array at which copying begins. - array is null. - arrayIndex is less than 0. - The number of elements in the source is greater than the available space from arrayIndex to the end of the destination array. - - - Copies a range of elements from the to a compatible one-dimensional array, starting at the specified index of the target array. - The zero-based index in the source at which copying begins. - The one-dimensional that is the destination of the elements copied from . The must have zero-based indexing. - The zero-based index in array at which copying begins. - The number of elements to copy. - array is null. - index is less than 0. -or- arrayIndex is less than 0. -or- count is less than 0. - index is equal to or greater than the of the source . -or- The number of elements from index to the end of the source is greater than the available space from arrayIndex to the end of the destination array. - - - Copies the entire to a compatible one-dimensional array, starting at the beginning of the target array. - The one-dimensional that is the destination of the elements copied from . The must have zero-based indexing. - array is null. - The number of elements in the source is greater than the number of elements that the destination array can contain. - - - Gets the number of elements contained in the . - The number of elements contained in the . - - - Determines whether the contains elements that match the conditions defined by the specified predicate. - The delegate that defines the conditions of the elements to search for. - true if the contains one or more elements that match the conditions defined by the specified predicate; otherwise, false. - match is null. - - - Searches for an element that matches the conditions defined by the specified predicate, and returns the first occurrence within the entire . - The delegate that defines the conditions of the element to search for. - The first element that matches the conditions defined by the specified predicate, if found; otherwise, the default value for type T. - match is null. - - - Retrieves all the elements that match the conditions defined by the specified predicate. - The delegate that defines the conditions of the elements to search for. - A containing all the elements that match the conditions defined by the specified predicate, if found; otherwise, an empty . - match is null. - - - Searches for an element that matches the conditions defined by the specified predicate, and returns the zero-based index of the first occurrence within the entire . - The delegate that defines the conditions of the element to search for. - The zero-based index of the first occurrence of an element that matches the conditions defined by match, if found; otherwise, –1. - match is null. - - - Searches for an element that matches the conditions defined by the specified predicate, and returns the zero-based index of the first occurrence within the range of elements in the that extends from the specified index to the last element. - The zero-based starting index of the search. - The delegate that defines the conditions of the element to search for. - The zero-based index of the first occurrence of an element that matches the conditions defined by match, if found; otherwise, –1. - match is null. - startIndex is outside the range of valid indexes for the . - - - Searches for an element that matches the conditions defined by the specified predicate, and returns the zero-based index of the first occurrence within the range of elements in the that starts at the specified index and contains the specified number of elements. - The zero-based starting index of the search. - The number of elements in the section to search. - The delegate that defines the conditions of the element to search for. - The zero-based index of the first occurrence of an element that matches the conditions defined by match, if found; otherwise, –1. - match is null. - startIndex is outside the range of valid indexes for the . -or- count is less than 0. -or- startIndex and count do not specify a valid section in the . - - - Searches for an element that matches the conditions defined by the specified predicate, and returns the last occurrence within the entire . - The delegate that defines the conditions of the element to search for. - The last element that matches the conditions defined by the specified predicate, if found; otherwise, the default value for type T. - match is null. - - - Searches for an element that matches the conditions defined by the specified predicate, and returns the zero-based index of the last occurrence within the entire . - The delegate that defines the conditions of the element to search for. - The zero-based index of the last occurrence of an element that matches the conditions defined by match, if found; otherwise, –1. - match is null. - - - Searches for an element that matches the conditions defined by the specified predicate, and returns the zero-based index of the last occurrence within the range of elements in the that extends from the first element to the specified index. - The zero-based starting index of the backward search. - The delegate that defines the conditions of the element to search for. - The zero-based index of the last occurrence of an element that matches the conditions defined by match, if found; otherwise, –1. - match is null. - startIndex is outside the range of valid indexes for the . - - - Searches for an element that matches the conditions defined by the specified predicate, and returns the zero-based index of the last occurrence within the range of elements in the that contains the specified number of elements and ends at the specified index. - The zero-based starting index of the backward search. - The number of elements in the section to search. - The delegate that defines the conditions of the element to search for. - The zero-based index of the last occurrence of an element that matches the conditions defined by match, if found; otherwise, –1. - match is null. - startIndex is outside the range of valid indexes for the . -or- count is less than 0. -or- startIndex and count do not specify a valid section in the . - - - Performs the specified action on each element of the . - The delegate to perform on each element of the . - action is null. - An element in the collection has been modified. - - - Returns an enumerator that iterates through the . - A for the . - - - Creates a shallow copy of a range of elements in the source . - The zero-based index at which the range starts. - The number of elements in the range. - A shallow copy of a range of elements in the source . - index is less than 0. -or- count is less than 0. - index and count do not denote a valid range of elements in the . - - - Searches for the specified object and returns the zero-based index of the first occurrence within the range of elements in the that extends from the specified index to the last element. - The object to locate in the . The value can be null for reference types. - The zero-based starting index of the search. 0 (zero) is valid in an empty list. - The zero-based index of the first occurrence of item within the range of elements in the that extends from index to the last element, if found; otherwise, –1. - index is outside the range of valid indexes for the . - - - Searches for the specified object and returns the zero-based index of the first occurrence within the range of elements in the that starts at the specified index and contains the specified number of elements. - The object to locate in the . The value can be null for reference types. - The zero-based starting index of the search. 0 (zero) is valid in an empty list. - The number of elements in the section to search. - The zero-based index of the first occurrence of item within the range of elements in the that starts at index and contains count number of elements, if found; otherwise, –1. - index is outside the range of valid indexes for the . -or- count is less than 0. -or- index and count do not specify a valid section in the . - - - Searches for the specified object and returns the zero-based index of the first occurrence within the entire . - The object to locate in the . The value can be null for reference types. - The zero-based index of the first occurrence of item within the entire , if found; otherwise, –1. - - - Inserts an element into the at the specified index. - The zero-based index at which item should be inserted. - The object to insert. The value can be null for reference types. - index is less than 0. -or- index is greater than . - - - Inserts the elements of a collection into the at the specified index. - The zero-based index at which the new elements should be inserted. - The collection whose elements should be inserted into the . The collection itself cannot be null, but it can contain elements that are null, if type T is a reference type. - collection is null. - index is less than 0. -or- index is greater than . - - - Gets or sets the element at the specified index. - The zero-based index of the element to get or set. - The element at the specified index. - index is less than 0. -or- index is equal to or greater than . - - - Searches for the specified object and returns the zero-based index of the last occurrence within the entire . - The object to locate in the . The value can be null for reference types. - The zero-based index of the last occurrence of item within the entire the , if found; otherwise, –1. - - - Searches for the specified object and returns the zero-based index of the last occurrence within the range of elements in the that extends from the first element to the specified index. - The object to locate in the . The value can be null for reference types. - The zero-based starting index of the backward search. - The zero-based index of the last occurrence of item within the range of elements in the that extends from the first element to index, if found; otherwise, –1. - index is outside the range of valid indexes for the . - - - Searches for the specified object and returns the zero-based index of the last occurrence within the range of elements in the that contains the specified number of elements and ends at the specified index. - The object to locate in the . The value can be null for reference types. - The zero-based starting index of the backward search. - The number of elements in the section to search. - The zero-based index of the last occurrence of item within the range of elements in the that contains count number of elements and ends at index, if found; otherwise, –1. - index is outside the range of valid indexes for the . -or- count is less than 0. -or- index and count do not specify a valid section in the . - - - Removes the first occurrence of a specific object from the . - The object to remove from the . The value can be null for reference types. - true if item is successfully removed; otherwise, false. This method also returns false if item was not found in the . - - - Removes all the elements that match the conditions defined by the specified predicate. - The delegate that defines the conditions of the elements to remove. - The number of elements removed from the . - match is null. - - - Removes the element at the specified index of the . - The zero-based index of the element to remove. - index is less than 0. -or- index is equal to or greater than . - - - Removes a range of elements from the . - The zero-based starting index of the range of elements to remove. - The number of elements to remove. - index is less than 0. -or- count is less than 0. - index and count do not denote a valid range of elements in the . - - - Reverses the order of the elements in the entire . - - - Reverses the order of the elements in the specified range. - The zero-based starting index of the range to reverse. - The number of elements in the range to reverse. - index is less than 0. -or- count is less than 0. - index and count do not denote a valid range of elements in the . - - - Sorts the elements in the entire using the specified . - The to use when comparing elements. - comparison is null. - The implementation of comparison caused an error during the sort. For example, comparison might not return 0 when comparing an item with itself. - - - Sorts the elements in a range of elements in using the specified comparer. - The zero-based starting index of the range to sort. - The length of the range to sort. - The implementation to use when comparing elements, or null to use the default comparer . - index is less than 0. -or- count is less than 0. - index and count do not specify a valid range in the . -or- The implementation of comparer caused an error during the sort. For example, comparer might not return 0 when comparing an item with itself. - comparer is null, and the default comparer cannot find implementation of the generic interface or the interface for type T. - - - Sorts the elements in the entire using the default comparer. - The default comparer cannot find an implementation of the generic interface or the interface for type T. - - - Sorts the elements in the entire using the specified comparer. - The implementation to use when comparing elements, or null to use the default comparer . - comparer is null, and the default comparer cannot find implementation of the generic interface or the interface for type T. - The implementation of comparer caused an error during the sort. For example, comparer might not return 0 when comparing an item with itself. - - - Copies the elements of the to a new array. - An array containing copies of the elements of the . - - - Sets the capacity to the actual number of elements in the , if that number is less than a threshold value. - - - Determines whether every element in the matches the conditions defined by the specified predicate. - The delegate that defines the conditions to check against the elements. - true if every element in the matches the conditions defined by the specified predicate; otherwise, false. If the list has no elements, the return value is true. - match is null. - - - Gets a value indicating whether the is read-only. - true if the is read-only; otherwise, false. In the default implementation of , this property always returns false. - - - Returns an enumerator that iterates through a collection. - An that can be used to iterate through the collection. - - - Copies the elements of the to an , starting at a particular index. - The one-dimensional that is the destination of the elements copied from . The must have zero-based indexing. - The zero-based index in array at which copying begins. - array is null. - arrayIndex is less than 0. - array is multidimensional. -or- array does not have zero-based indexing. -or- The number of elements in the source is greater than the available space from arrayIndex to the end of the destination array. -or- The type of the source cannot be cast automatically to the type of the destination array. - - - Gets a value indicating whether access to the is synchronized (thread safe). - true if access to the is synchronized (thread safe); otherwise, false. In the default implementation of , this property always returns false. - - - Gets an object that can be used to synchronize access to the . - An object that can be used to synchronize access to the . In the default implementation of , this property always returns the current instance. - - - Returns an enumerator that iterates through a collection. - An that can be used to iterate through the collection. - - - Adds an item to the . - The to add to the . - The position into which the new element was inserted. - item is of a type that is not assignable to the . - - - Determines whether the contains a specific value. - The to locate in the . - true if item is found in the ; otherwise, false. - - - Determines the index of a specific item in the . - The object to locate in the . - The index of item if found in the list; otherwise, –1. - item is of a type that is not assignable to the . - - - Inserts an item to the at the specified index. - The zero-based index at which item should be inserted. - The object to insert into the . - index is not a valid index in the . - item is of a type that is not assignable to the . - - - Gets a value indicating whether the has a fixed size. - true if the has a fixed size; otherwise, false. In the default implementation of , this property always returns false. - - - Gets a value indicating whether the is read-only. - true if the is read-only; otherwise, false. In the default implementation of , this property always returns false. - - - Gets or sets the element at the specified index. - The zero-based index of the element to get or set. - The element at the specified index. - index is not a valid index in the . - The property is set and value is of a type that is not assignable to the . - - - Removes the first occurrence of a specific object from the . - The object to remove from the . - item is of a type that is not assignable to the . - - - Enumerates the elements of a . - - - - Gets the element at the current position of the enumerator. - The element in the at the current position of the enumerator. - The enumerator is positioned before the first element of the collection or after the last element. - - - Releases all resources used by the . - - - Advances the enumerator to the next element of the . - true if the enumerator was successfully advanced to the next element; false if the enumerator has passed the end of the collection. - The collection was modified after the enumerator was created. - - - Gets the element at the current position of the enumerator. - The element in the collection at the current position of the enumerator. - The enumerator is positioned before the first element of the collection or after the last element. - - - Sets the enumerator to its initial position, which is before the first element in the collection. - The collection was modified after the enumerator was created. - - - Represents a first-in, first-out collection of objects. - Specifies the type of elements in the queue. - - - Initializes a new instance of the class that is empty and has the default initial capacity. - - - Initializes a new instance of the class that contains elements copied from the specified collection and has sufficient capacity to accommodate the number of elements copied. - The collection whose elements are copied to the new . - collection is null. - - - Initializes a new instance of the class that is empty and has the specified initial capacity. - The initial number of elements that the can contain. - capacity is less than zero. - - - Removes all objects from the . - - - Determines whether an element is in the . - The object to locate in the . The value can be null for reference types. - true if item is found in the ; otherwise, false. - - - Copies the elements to an existing one-dimensional , starting at the specified array index. - The one-dimensional that is the destination of the elements copied from . The must have zero-based indexing. - The zero-based index in array at which copying begins. - array is null. - arrayIndex is less than zero. - The number of elements in the source is greater than the available space from arrayIndex to the end of the destination array. - - - Gets the number of elements contained in the . - The number of elements contained in the . - - - Removes and returns the object at the beginning of the . - The object that is removed from the beginning of the . - The is empty. - - - Adds an object to the end of the . - The object to add to the . The value can be null for reference types. - - - Returns an enumerator that iterates through the . - An for the . - - - Returns the object at the beginning of the without removing it. - The object at the beginning of the . - The is empty. - - - Copies the elements to a new array. - A new array containing elements copied from the . - - - Sets the capacity to the actual number of elements in the , if that number is less than 90 percent of current capacity. - - - Returns an enumerator that iterates through a collection. - An that can be used to iterate through the collection. - - - Copies the elements of the to an , starting at a particular index. - The one-dimensional that is the destination of the elements copied from . The must have zero-based indexing. - The zero-based index in array at which copying begins. - array is null. - index is less than zero. - array is multidimensional. -or- array does not have zero-based indexing. -or- The number of elements in the source is greater than the available space from index to the end of the destination array. -or- The type of the source cannot be cast automatically to the type of the destination array. - - - Gets a value indicating whether access to the is synchronized (thread safe). - true if access to the is synchronized (thread safe); otherwise, false. In the default implementation of , this property always returns false. - - - Gets an object that can be used to synchronize access to the . - An object that can be used to synchronize access to the . In the default implementation of , this property always returns the current instance. - - - Returns an enumerator that iterates through a collection. - An that can be used to iterate through the collection. - - - Enumerates the elements of a . - - - - - Gets the element at the current position of the enumerator. - The element in the at the current position of the enumerator. - - - Releases all resources used by the . - - - Advances the enumerator to the next element of the . - true if the enumerator was successfully advanced to the next element; false if the enumerator has passed the end of the collection. - The collection was modified after the enumerator was created. - - - Gets the element at the current position of the enumerator as a structure. - The element in the collection at the current position of the dictionary, as a structure. - The enumerator is positioned before the first element of the collection or after the last element. - - - Gets the key of the element at the current position of the enumerator. - The key of the element in the collection at the current position of the enumerator. - The enumerator is positioned before the first element of the collection or after the last element. - - - Gets the value of the element at the current position of the enumerator. - The value of the element in the collection at the current position of the enumerator. - The enumerator is positioned before the first element of the collection or after the last element. - - - Gets the element at the current position of the enumerator. - The element in the collection at the current position of the enumerator. - The enumerator is positioned before the first element of the collection or after the last element. - - - Sets the enumerator to its initial position, which is before the first element in the collection. - The collection was modified after the enumerator was created. - - - Enumerates the elements of a . - - - - - Gets the element at the current position of the enumerator. - The element in the at the current position of the enumerator. - - - Releases all resources used by the . - - - Advances the enumerator to the next element of the . - true if the enumerator was successfully advanced to the next element; false if the enumerator has passed the end of the collection. - The collection was modified after the enumerator was created. - - - Gets the element at the current position of the enumerator. - The element in the collection at the current position of the enumerator. - The enumerator is positioned before the first element of the collection or after the last element. - - - Sets the enumerator to its initial position, which is before the first element in the collection. - The collection was modified after the enumerator was created. - - - Represents the collection of keys in a . This class cannot be inherited. - - - - - Initializes a new instance of the class that reflects the keys in the specified . - The whose keys are reflected in the new . - dictionary is null. - - - Copies the elements to an existing one-dimensional array, starting at the specified array index. - The one-dimensional array that is the destination of the elements copied from the . The array must have zero-based indexing. - The zero-based index in array at which copying begins. - array is null. - index is less than 0. - The number of elements in the source is greater than the available space from index to the end of the destination array. - - - Gets the number of elements contained in the . - The number of elements contained in the . - - - Returns an enumerator that iterates through the . - A structure for the . - - - Adds an item to the . This implementation always throws a . - The object to add to the . - Always thrown; the collection is read-only. - - - Removes all items from the . This implementation always throws a . - Always thrown; the collection is read-only. - - - Determines whether the contains the specified value. - The object to locate in the . - true if item is found in the ; otherwise, false. - - - Gets a value indicating whether the is read-only. - true if the is read-only; otherwise, false. In the default implementation of , this property always returns false. - - - Removes the first occurrence of a specific object from the . This implementation always throws a . - The object to remove from the . - true if item is successfully removed from the ; otherwise, false. This method also returns false if item is not found in the . - Always thrown; the collection is read-only. - - - Returns an enumerator that iterates through the collection. - An that can be used to iterate through the collection. - - - Copies the elements of the to an array, starting at a particular array index. - The one-dimensional array that is the destination of the elements copied from the . The array must have zero-based indexing. - The zero-based index in array at which copying begins. - array is null. - index is less than 0. - array is multidimensional. -or- array does not have zero-based indexing. -or- The number of elements in the source is greater than the available space from index to the end of the destination array. -or- The type of the source cannot be cast automatically to the type of the destination array. - - - Gets a value indicating whether access to the is synchronized (thread safe). - true if access to the is synchronized (thread safe); otherwise, false. In the default implementation of , this property always returns false. - - - Gets an object that can be used to synchronize access to the . - An object that can be used to synchronize access to the . In the default implementation of , this property always returns the current instance. - - - Returns an enumerator that iterates through the collection. - An that can be used to iterate through the collection. - - - Enumerates the elements of a . - - - - - Gets the element at the current position of the enumerator. - The element in the at the current position of the enumerator. - - - Releases all resources used by the . - - - Advances the enumerator to the next element of the . - true if the enumerator was successfully advanced to the next element; false if the enumerator has passed the end of the collection. - The collection was modified after the enumerator was created. - - - Gets the element at the current position of the enumerator. - The element in the collection at the current position of the enumerator. - The enumerator is positioned before the first element of the collection or after the last element. - - - Sets the enumerator to its initial position, which is before the first element in the collection. - The collection was modified after the enumerator was created. - - - Represents the collection of values in a . This class cannot be inherited - - - - - Initializes a new instance of the class that reflects the values in the specified . - The whose values are reflected in the new . - dictionary is null. - - - Copies the elements to an existing one-dimensional array, starting at the specified array index. - The one-dimensional array that is the destination of the elements copied from the . The array must have zero-based indexing. - The zero-based index in array at which copying begins. - array is null. - index is less than 0. - The number of elements in the source is greater than the available space from index to the end of the destination array. - - - Gets the number of elements contained in the . - The number of elements contained in the . - - - Returns an enumerator that iterates through the . - A structure for the . - - - Adds an item to the . This implementation always throws a . - The object to add to the . - Always thrown; the collection is read-only. - - - Removes all items from the . This implementation always throws a . - Always thrown; the collection is read-only. - - - Determines whether the contains a specified value. - The object to locate in the . - true if item is found in the ; otherwise, false. - - - Gets a value indicating whether the is read-only. - true if the is read-only; otherwise, false. In the default implementation of , this property always returns false. - - - Removes the first occurrence of a specific object from the . This implementation always throws a . - The object to remove from the . - true if item is successfully removed from the ; otherwise, false. This method also returns false if item is not found in the . - Always thrown; the collection is read-only. - - - Returns an enumerator that iterates through the collection. - An that can be used to iterate through the collection. - - - Copies the elements of the to an array, starting at a particular array index. - The one-dimensional array that is the destination of the elements copied from the . The array must have zero-based indexing. - The zero-based index in array at which copying begins. - array is null. - index is less than 0. - array is multidimensional. -or- array does not have zero-based indexing. -or- The number of elements in the source is greater than the available space from index to the end of the destination array. -or- The type of the source cannot be cast automatically to the type of the destination array. - - - Gets a value indicating whether access to the is synchronized (thread safe). - true if access to the is synchronized (thread safe); otherwise, false. In the default implementation of , this property always returns false. - - - Gets an object that can be used to synchronize access to the . - An object that can be used to synchronize access to the . In the default implementation of , this property always returns the current instance. - - - Returns an enumerator that iterates through the collection. - An that can be used to iterate through the collection. - - - Represents a collection of key/value pairs that are sorted on the key. - The type of the keys in the dictionary. - The type of the values in the dictionary. - - - Initializes a new instance of the class that is empty and uses the default implementation for the key type. - - - Initializes a new instance of the class that is empty and uses the specified implementation to compare keys. - The implementation to use when comparing keys, or null to use the default for the type of the key. - - - Initializes a new instance of the class that contains elements copied from the specified and uses the default implementation for the key type. - The whose elements are copied to the new . - dictionary is null. - dictionary contains one or more duplicate keys. - - - Initializes a new instance of the class that contains elements copied from the specified and uses the specified implementation to compare keys. - The whose elements are copied to the new . - The implementation to use when comparing keys, or null to use the default for the type of the key. - dictionary is null. - dictionary contains one or more duplicate keys. - - - Adds an element with the specified key and value into the . - The key of the element to add. - The value of the element to add. The value can be null for reference types. - key is null. - An element with the same key already exists in the . - - - Removes all elements from the . - - - Gets the used to order the elements of the . - The used to order the elements of the - - - Determines whether the contains an element with the specified key. - The key to locate in the . - true if the contains an element with the specified key; otherwise, false. - key is null. - - - Determines whether the contains an element with the specified value. - The value to locate in the . The value can be null for reference types. - true if the contains an element with the specified value; otherwise, false. - - - Copies the elements of the to the specified array of structures, starting at the specified index. - The one-dimensional array of structures that is the destination of the elements copied from the current The array must have zero-based indexing. - The zero-based index in array at which copying begins. - array is null. - index is less than 0. - The number of elements in the source is greater than the available space from index to the end of the destination array. - - - Gets the number of key/value pairs contained in the . - The number of key/value pairs contained in the . - - - Returns an enumerator that iterates through the . - A for the . - - - Gets or sets the value associated with the specified key. - The key of the value to get or set. - The value associated with the specified key. If the specified key is not found, a get operation throws a , and a set operation creates a new element with the specified key. - key is null. - The property is retrieved and key does not exist in the collection. - - - Gets a collection containing the keys in the . - A containing the keys in the . - - - Removes the element with the specified key from the . - The key of the element to remove. - true if the element is successfully removed; otherwise, false. This method also returns false if key is not found in the . - key is null. - - - Gets the value associated with the specified key. - The key of the value to get. - When this method returns, the value associated with the specified key, if the key is found; otherwise, the default value for the type of the value parameter. - true if the contains an element with the specified key; otherwise, false. - key is null. - - - Gets a collection containing the values in the . - A containing the values in the . - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Copies the elements of the to an array, starting at the specified array index. - The one-dimensional array that is the destination of the elements copied from the . The array must have zero-based indexing. - The zero-based index in array at which copying begins. - array is null. - index is less than 0. - array is multidimensional. -or- array does not have zero-based indexing. -or- The number of elements in the source is greater than the available space from index to the end of the destination array. -or- The type of the source cannot be cast automatically to the type of the destination array. - - - Gets a value indicating whether access to the is synchronized (thread safe). - true if access to the is synchronized (thread safe); otherwise, false. In the default implementation of , this property always returns false. - - - Gets an object that can be used to synchronize access to the . - An object that can be used to synchronize access to the . - - - Adds an element with the provided key and value to the . - The object to use as the key of the element to add. - The object to use as the value of the element to add. - key is null. - key is of a type that is not assignable to the key type TKey of the . -or- value is of a type that is not assignable to the value type TValue of the . -or- An element with the same key already exists in the . - - - Determines whether the contains an element with the specified key. - The key to locate in the . - true if the contains an element with the key; otherwise, false. - key is null. - - - Returns an for the . - An for the . - - - Gets a value indicating whether the has a fixed size. - true if the has a fixed size; otherwise, false. In the default implementation of , this property always returns false. - - - Gets a value indicating whether the is read-only. - true if the is read-only; otherwise, false. In the default implementation of , this property always returns false. - - - Gets or sets the element with the specified key. - The key of the element to get. - The element with the specified key, or null if key is not in the dictionary or key is of a type that is not assignable to the key type TKey of the . - key is null. - A value is being assigned, and key is of a type that is not assignable to the key type TKey of the . -or- A value is being assigned, and value is of a type that is not assignable to the value type TValue of the . - - - Gets an containing the keys of the . - An containing the keys of the . - - - Removes the element with the specified key from the . - The key of the element to remove. - key is null. - - - Gets an containing the values in the . - An containing the values in the . - - - Returns an enumerator that iterates through the collection. - An that can be used to iterate through the collection. - - - Represents a collection of key/value pairs that are sorted by key based on the associated implementation. - The type of keys in the collection. - The type of values in the collection. - - - Initializes a new instance of the class that is empty, has the default initial capacity, and uses the default . - - - Initializes a new instance of the class that is empty, has the default initial capacity, and uses the specified . - The implementation to use when comparing keys. -or- null to use the default for the type of the key. - - - Initializes a new instance of the class that contains elements copied from the specified , has sufficient capacity to accommodate the number of elements copied, and uses the default . - The whose elements are copied to the new . - dictionary is null. - dictionary contains one or more duplicate keys. - - - Initializes a new instance of the class that is empty, has the specified initial capacity, and uses the default . - The initial number of elements that the can contain. - capacity is less than zero. - - - Initializes a new instance of the class that contains elements copied from the specified , has sufficient capacity to accommodate the number of elements copied, and uses the specified . - The whose elements are copied to the new . - The implementation to use when comparing keys. -or- null to use the default for the type of the key. - dictionary is null. - dictionary contains one or more duplicate keys. - - - Initializes a new instance of the class that is empty, has the specified initial capacity, and uses the specified . - The initial number of elements that the can contain. - The implementation to use when comparing keys. -or- null to use the default for the type of the key. - capacity is less than zero. - - - Adds an element with the specified key and value into the . - The key of the element to add. - The value of the element to add. The value can be null for reference types. - key is null. - An element with the same key already exists in the . - - - Gets or sets the number of elements that the can contain. - The number of elements that the can contain. - is set to a value that is less than . - There is not enough memory available on the system. - - - Removes all elements from the . - - - Gets the for the sorted list. - The for the current . - - - Determines whether the contains a specific key. - The key to locate in the . - true if the contains an element with the specified key; otherwise, false. - key is null. - - - Determines whether the contains a specific value. - The value to locate in the . The value can be null for reference types. - true if the contains an element with the specified value; otherwise, false. - - - Gets the number of key/value pairs contained in the . - The number of key/value pairs contained in the . - - - Returns an enumerator that iterates through the . - An of type for the . - - - Searches for the specified key and returns the zero-based index within the entire . - The key to locate in the . - The zero-based index of key within the entire , if found; otherwise, -1. - key is null. - - - Searches for the specified value and returns the zero-based index of the first occurrence within the entire . - The value to locate in the . The value can be null for reference types. - The zero-based index of the first occurrence of value within the entire , if found; otherwise, -1. - - - Gets or sets the value associated with the specified key. - The key whose value to get or set. - The value associated with the specified key. If the specified key is not found, a get operation throws a and a set operation creates a new element using the specified key. - key is null. - The property is retrieved and key does not exist in the collection. - - - Gets a collection containing the keys in the , in sorted order. - A containing the keys in the . - - - Removes the element with the specified key from the . - The key of the element to remove. - true if the element is successfully removed; otherwise, false. This method also returns false if key was not found in the original . - key is null. - - - Removes the element at the specified index of the . - The zero-based index of the element to remove. - index is less than zero. -or- index is equal to or greater than . - - - Sets the capacity to the actual number of elements in the , if that number is less than 90 percent of current capacity. - - - Gets the value associated with the specified key. - The key whose value to get. - When this method returns, the value associated with the specified key, if the key is found; otherwise, the default value for the type of the value parameter. This parameter is passed uninitialized. - true if the contains an element with the specified key; otherwise, false. - key is null. - - - Gets a collection containing the values in the . - A containing the values in the . - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Copies the elements of the to an , starting at a particular index. - The one-dimensional that is the destination of the elements copied from . The must have zero-based indexing. - The zero-based index in array at which copying begins. - array is null. - arrayIndex is less than zero. - array is multidimensional. -or- array does not have zero-based indexing. -or- The number of elements in the source is greater than the available space from arrayIndex to the end of the destination array. -or- The type of the source cannot be cast automatically to the type of the destination array. - - - Gets a value indicating whether access to the is synchronized (thread safe). - true if access to the is synchronized (thread safe); otherwise, false. In the default implementation of , this property always returns false. - - - Gets an object that can be used to synchronize access to the . - An object that can be used to synchronize access to the . In the default implementation of , this property always returns the current instance. - - - Adds an element with the provided key and value to the . - The to use as the key of the element to add. - The to use as the value of the element to add. - key is null. - key is of a type that is not assignable to the key type TKey of the . -or- value is of a type that is not assignable to the value type TValue of the . -or- An element with the same key already exists in the . - - - Determines whether the contains an element with the specified key. - The key to locate in the . - true if the contains an element with the key; otherwise, false. - key is null. - - - Returns an for the . - An for the . - - - Gets a value indicating whether the has a fixed size. - true if the has a fixed size; otherwise, false. In the default implementation of , this property always returns false. - - - Gets a value indicating whether the is read-only. - true if the is read-only; otherwise, false. In the default implementation of , this property always returns false. - - - Gets or sets the element with the specified key. - The key of the element to get or set. - The element with the specified key, or null if key is not in the dictionary or key is of a type that is not assignable to the key type TKey of the . - key is null. - A value is being assigned, and key is of a type that is not assignable to the key type TKey of the . -or- A value is being assigned, and value is of a type that is not assignable to the value type TValue of the . - - - Gets an containing the keys of the . - An containing the keys of the . - - - Removes the element with the specified key from the . - The key of the element to remove. - key is null. - - - Gets an containing the values in the . - An containing the values in the . - - - Returns an enumerator that iterates through a collection. - An that can be used to iterate through the collection. - - - Enumerates the elements of a object. - - - - Gets the element at the current position of the enumerator. - The element in the collection at the current position of the enumerator. - - - Releases all resources used by the . - - - Advances the enumerator to the next element of the collection. - true if the enumerator was successfully advanced to the next element; false if the enumerator has passed the end of the collection. - The collection was modified after the enumerator was created. - - - Gets the element at the current position of the enumerator. - The element in the collection at the current position of the enumerator. - The enumerator is positioned before the first element of the collection or after the last element. - - - Sets the enumerator to its initial position, which is before the first element in the collection. - The collection was modified after the enumerator was created. - - - Implements the interface and raises the deserialization event when the deserialization is complete. - The source of the deserialization event. - The object associated with the current instance is invalid. - - - Implements the interface and returns the data needed to serialize the instance. - A object that contains the information required to serialize the instance. - A object that contains the source and destination of the serialized stream associated with the instance. - info is null. - - - Represents a collection of objects that is maintained in sorted order. - The type of elements in the set. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class that uses a specified comparer. - The default comparer to use for comparing objects. - comparer is null. - - - Initializes a new instance of the class that contains elements copied from a specified enumerable collection. - The enumerable collection to be copied. - - - Initializes a new instance of the class that contains elements copied from a specified enumerable collection and that uses a specified comparer. - The enumerable collection to be copied. - The default comparer to use for comparing objects. - collection is null. - - - Initializes a new instance of the class that contains serialized data. - The object that contains the information that is required to serialize the object. - The structure that contains the source and destination of the serialized stream associated with the object. - - - Adds an element to the set and returns a value that indicates if it was successfully added. - The element to add to the set. - true if item is added to the set; otherwise, false. - - - Removes all elements from the set. - - - Gets the object that is used to order the values in the . - The comparer that is used to order the values in the . - - - Determines whether the set contains a specific element. - The element to locate in the set. - true if the set contains item; otherwise, false. - - - Copies a specified number of elements from to a compatible one-dimensional array, starting at the specified array index. - A one-dimensional array that is the destination of the elements copied from the . The array must have zero-based indexing. - The zero-based index in array at which copying begins. - The number of elements to copy. - The number of elements in the source array is greater than the available space from index to the end of the destination array. - array is null. - index is less than zero. -or- count is less than zero. - - - Copies the complete to a compatible one-dimensional array, starting at the specified array index. - A one-dimensional array that is the destination of the elements copied from the . The array must have zero-based indexing. - The zero-based index in array at which copying begins. - The number of elements in the source array is greater than the available space from index to the end of the destination array. - array is null. - index is less than zero. - - - Copies the complete to a compatible one-dimensional array, starting at the beginning of the target array. - A one-dimensional array that is the destination of the elements copied from the . - The number of elements in the source exceeds the number of elements that the destination array can contain. - array is null. - - - Gets the number of elements in the . - The number of elements in the . - - - Returns an object that can be used to create a collection that contains individual sets. - A comparer for creating a collection of sets. - - - Returns an object, according to a specified comparer, that can be used to create a collection that contains individual sets. - The comparer to use for creating the returned comparer. - A comparer for creating a collection of sets. - - - Removes all elements that are in a specified collection from the current object. - The collection of items to remove from the object. - other is null. - - - Returns an enumerator that iterates through the . - An enumerator that iterates through the in sorted order. - - - Implements the interface and returns the data that you must have to serialize a object. - A object that contains the information that is required to serialize the object. - A structure that contains the source and destination of the serialized stream associated with the object. - info is null. - - - Returns a view of a subset in a . - The lowest desired value in the view. - The highest desired value in the view. - A subset view that contains only the values in the specified range. - lowerValue is more than upperValue according to the comparer. - A tried operation on the view was outside the range specified by lowerValue and upperValue. - - - Modifies the current object so that it contains only elements that are also in a specified collection. - The collection to compare to the current object. - other is null. - - - Determines whether a object is a proper subset of the specified collection. - The collection to compare to the current object. - true if the object is a proper subset of other; otherwise, false. - other is null. - - - Determines whether a object is a proper superset of the specified collection. - The collection to compare to the current object. - true if the object is a proper superset of other; otherwise, false. - other is null. - - - Determines whether a object is a subset of the specified collection. - The collection to compare to the current object. - true if the current object is a subset of other; otherwise, false. - other is null. - - - Determines whether a object is a superset of the specified collection. - The collection to compare to the current object. - true if the object is a superset of other; otherwise, false. - other is null. - - - Gets the maximum value in the , as defined by the comparer. - The maximum value in the set. - - - Gets the minimum value in the , as defined by the comparer. - The minimum value in the set. - - - Implements the interface, and raises the deserialization event when the deserialization is completed. - The source of the deserialization event. - The object associated with the current object is invalid. - - - Determines whether the current object and a specified collection share common elements. - The collection to compare to the current object. - true if the object and other share at least one common element; otherwise, false. - other is null. - - - Removes a specified item from the . - The element to remove. - true if the element is found and successfully removed; otherwise, false. - - - Removes all elements that match the conditions defined by the specified predicate from a . - The delegate that defines the conditions of the elements to remove. - The number of elements that were removed from the collection.. - match is null. - - - Returns an that iterates over the in reverse order. - An enumerator that iterates over the in reverse order. - - - Determines whether the current object and the specified collection contain the same elements. - The collection to compare to the current object. - true if the current object is equal to other; otherwise, false. - other is null. - - - Modifies the current object so that it contains only elements that are present either in the current object or in the specified collection, but not both. - The collection to compare to the current object. - other is null. - - - Modifies the current object so that it contains all elements that are present in either the current object or the specified collection. - The collection to compare to the current object. - other is null. - - - Adds an item to an object. - The object to add to the object. - The is read-only. - - - Gets a value that indicates whether a is read-only. - true if the collection is read-only; otherwise, false. - - - Returns an enumerator that iterates through a collection. - An enumerator that can be used to iterate through the collection. - - - Copies the complete to a compatible one-dimensional array, starting at the specified array index. - A one-dimensional array that is the destination of the elements copied from the . The array must have zero-based indexing. - The zero-based index in array at which copying begins. - The number of elements in the source array is greater than the available space from index to the end of the destination array. - array is null. - index is less than zero. - - - Gets a value that indicates whether access to the is synchronized (thread safe). - true if access to the is synchronized; otherwise, false. - - - Gets an object that can be used to synchronize access to the . - An object that can be used to synchronize access to the . In the default implementation of , this property always returns the current instance. - - - Returns an enumerator that iterates through a collection. - An enumerator that can be used to iterate through the collection. - - - Implements the interface, and raises the deserialization event when the deserialization is completed. - The source of the deserialization event. - The object associated with the current instance is invalid. - - - Implements the interface, and returns the data that you need to serialize the instance. - A object that contains the information that is required to serialize the instance. - A structure that contains the source and destination of the serialized stream associated with the instance. - info is null. - - - Enumerates the elements of a . - - - - Gets the element at the current position of the enumerator. - The element in the at the current position of the enumerator. - The enumerator is positioned before the first element of the collection or after the last element. - - - Releases all resources used by the . - - - Advances the enumerator to the next element of the . - true if the enumerator was successfully advanced to the next element; false if the enumerator has passed the end of the collection. - The collection was modified after the enumerator was created. - - - Gets the element at the current position of the enumerator. - The element in the collection at the current position of the enumerator. - The enumerator is positioned before the first element of the collection or after the last element. - - - Sets the enumerator to its initial position, which is before the first element in the collection. This class cannot be inherited. - The collection was modified after the enumerator was created. - - - Represents a variable size last-in-first-out (LIFO) collection of instances of the same specified type. - Specifies the type of elements in the stack. - - - Initializes a new instance of the class that is empty and has the default initial capacity. - - - Initializes a new instance of the class that contains elements copied from the specified collection and has sufficient capacity to accommodate the number of elements copied. - The collection to copy elements from. - collection is null. - - - Initializes a new instance of the class that is empty and has the specified initial capacity or the default initial capacity, whichever is greater. - The initial number of elements that the can contain. - capacity is less than zero. - - - Removes all objects from the . - - - Determines whether an element is in the . - The object to locate in the . The value can be null for reference types. - true if item is found in the ; otherwise, false. - - - Copies the to an existing one-dimensional , starting at the specified array index. - The one-dimensional that is the destination of the elements copied from . The must have zero-based indexing. - The zero-based index in array at which copying begins. - array is null. - arrayIndex is less than zero. - The number of elements in the source is greater than the available space from arrayIndex to the end of the destination array. - - - Gets the number of elements contained in the . - The number of elements contained in the . - - - Returns an enumerator for the . - An for the . - - - Returns the object at the top of the without removing it. - The object at the top of the . - The is empty. - - - Removes and returns the object at the top of the . - The object removed from the top of the . - The is empty. - - - Inserts an object at the top of the . - The object to push onto the . The value can be null for reference types. - - - Copies the to a new array. - A new array containing copies of the elements of the . - - - Sets the capacity to the actual number of elements in the , if that number is less than 90 percent of current capacity. - - - Returns an enumerator that iterates through the collection. - An that can be used to iterate through the collection. - - - Copies the elements of the to an , starting at a particular index. - The one-dimensional that is the destination of the elements copied from . The must have zero-based indexing. - The zero-based index in array at which copying begins. - array is null. - arrayIndex is less than zero. - array is multidimensional. -or- array does not have zero-based indexing. -or- The number of elements in the source is greater than the available space from arrayIndex to the end of the destination array. -or- The type of the source cannot be cast automatically to the type of the destination array. - - - Gets a value indicating whether access to the is synchronized (thread safe). - true if access to the is synchronized (thread safe); otherwise, false. In the default implementation of , this property always returns false. - - - Gets an object that can be used to synchronize access to the . - An object that can be used to synchronize access to the . In the default implementation of , this property always returns the current instance. - - - Returns an enumerator that iterates through a collection. - An that can be used to iterate through the collection. - - - Provides a service for registering event handlers for component events. - - - Creates a unique name for an event-handler method for the specified component and event. - The component instance the event is connected to. - The event to create a name for. - The recommended name for the event-handler method for this event. - - - Gets a collection of event-handler methods that have a method signature compatible with the specified event. - The event to get the compatible event-handler methods for. - A collection of strings. - - - Gets an for the event that the specified property descriptor represents, if it represents an event. - The property that represents an event. - An for the event that the property represents, or null if the property does not represent an event. - - - Converts a set of event descriptors to a set of property descriptors. - The events to convert to properties. - An array of objects that describe the event set. - - - Converts a single event descriptor to a property descriptor. - The event to convert. - A that describes the event. - - - Displays the user code for the designer. - true if the code is displayed; otherwise, false. - - - Displays the user code for the designer at the specified line. - The line number to place the caret on. - true if the code is displayed; otherwise, false. - - - Displays the user code for the specified event. - The component that the event is connected to. - The event to display. - true if the code is displayed; otherwise, false. - - - Provides an interface that can list extender providers. - - - Gets the set of extender providers for the component. - An array of type that lists the active extender providers. If there are no providers, an empty array is returned. - - - Provides an interface for adding and removing extender providers at design time. - - - Adds the specified extender provider. - The extender provider to add. - - - Removes the specified extender provider. - The extender provider to remove. - - - Provides methods for showing Help topics and adding and removing Help keywords at design time. - - - Adds a context attribute to the document. - The name of the attribute to add. - The value of the attribute. - The type of the keyword, from the enumeration . - - - Removes all existing context attributes from the document. - - - Creates a local to manage subcontexts. - The priority type of the subcontext to add. - The newly created . - - - Removes a previously added context attribute. - The name of the attribute to remove. - The value of the attribute to remove. - - - Removes a context created with . - The local context to remove. - - - Shows the Help topic that corresponds to the specified keyword. - The keyword of the Help topic to display. - - - Shows the Help topic that corresponds to the specified URL. - The URL of the Help topic to display. - - - Provides methods for identifying the components of a component. - - - Searches the specified component for fields that implement the interface and adds each to the specified container, storing the inheritance level of each which can be retrieved using the method. - The to search. Searching begins with this component. - The to add components to. - - - Gets the inheritance attribute for the specified component. - The for which to retrieve the inheritance attribute. - An instance of that describes the level of inheritance of the specified component. - - - Provides methods to manage the global designer verbs and menu commands available in design mode, and to show some types of shortcut menus. - - - Adds the specified standard menu command to the menu. - The to add. - The of the specified is already present on a menu. - - - Adds the specified designer verb to the set of global designer verbs. - The to add. - - - Searches for the specified command ID and returns the menu command associated with it. - The to search for. - The associated with the command ID, or null if no command is found. - - - Invokes a menu or designer verb command matching the specified command ID. - The of the command to search for and execute. - true if the command was found and invoked successfully; otherwise, false. - - - Removes the specified standard menu command from the menu. - The to remove. - - - Removes the specified designer verb from the collection of global designer verbs. - The to remove. - - - Shows the specified shortcut menu at the specified location. - The for the shortcut menu to show. - The x-coordinate at which to display the menu, in screen coordinates. - The y-coordinate at which to display the menu, in screen coordinates. - - - Gets a collection of the designer verbs that are currently available. - A that contains the designer verbs that are currently available. - - - Provides an interface for obtaining references to objects within a project by name or type, obtaining the name of a specified object, and for locating the parent of a specified object within a designer project. - - - Gets the component that contains the specified component. - The object to retrieve the parent component for. - The base that contains the specified object, or null if no parent component exists. - - - Gets the name of the specified component. - The object to return the name of. - The name of the object referenced, or null if the object reference is not valid. - - - Gets a reference to the component whose name matches the specified name. - The name of the component to return a reference to. - An object the specified name refers to, or null if no reference is found. - - - Gets all available references to project components. - An array of all objects with references available to the . - - - Gets all available references to components of the specified type. - The type of object to return references to instances of. - An array of all available objects of the specified type. - - - Provides an interface for designers to access resource readers and writers for specific resource types. - - - Locates the resource reader for the specified culture and returns it. - The of the resource for which to retrieve a resource reader. - An interface that contains the resources for the culture, or null if no resources for the culture exist. - - - Locates the resource writer for the specified culture and returns it. - The of the resource for which to create a resource writer. - An interface for the specified culture. - - - Provides support for root-level designer view technologies. - - - Gets a view object for the specified view technology. - A that indicates a particular view technology. - An object that represents the view for this designer. - The specified view technology is not supported or does not exist. - - - Gets the set of technologies that this designer can support for its display. - An array of supported values. - - - Provides an interface for a designer to select components. - - - Gets a value indicating whether the specified component is currently selected. - The component to test. - true if the component is part of the user's current selection; otherwise, false. - - - Gets a collection of components that are currently selected. - A collection that represents the current set of components that are selected. - - - Gets the object that is currently the primary selected object. - The object that is currently the primary selected object. - - - Occurs when the current selection changes. - - - - Occurs when the current selection is about to change. - - - - Gets the count of selected objects. - The number of selected objects. - - - Selects the specified collection of components. - The collection of components to select. - - - Selects the components from within the specified collection of components that match the specified selection type. - The collection of components to select. - A value from the enumeration. The default is . - - - Provides a container for services. - - - Adds the specified service to the service container. - The type of service to add. - A callback object that is used to create the service. This allows a service to be declared as available, but delays the creation of the object until the service is requested. - - - Adds the specified service to the service container. - The type of service to add. - An instance of the service type to add. This object must implement or inherit from the type indicated by the serviceType parameter. - - - Adds the specified service to the service container, and optionally promotes the service to parent service containers. - The type of service to add. - A callback object that is used to create the service. This allows a service to be declared as available, but delays the creation of the object until the service is requested. - true to promote this request to any parent service containers; otherwise, false. - - - Adds the specified service to the service container, and optionally promotes the service to any parent service containers. - The type of service to add. - An instance of the service type to add. This object must implement or inherit from the type indicated by the serviceType parameter. - true to promote this request to any parent service containers; otherwise, false. - - - Removes the specified service type from the service container. - The type of service to remove. - - - Removes the specified service type from the service container, and optionally promotes the service to parent service containers. - The type of service to remove. - true to promote this request to any parent service containers; otherwise, false. - - - Provides support for building a set of related custom designers. - - - Gets a collection of child designers. - An , containing the collection of child objects of the current designer. - - - Gets the parent designer. - An representing the parent designer, or null if there is no parent. - - - Provides an interface to modify the set of member descriptors for a component in design mode. - - - Filters the attributes that a component exposes through a . - The component to filter the attributes of. - A dictionary of attributes that can be modified. - true if the set of filtered attributes is to be cached; false if the filter service must query again. - - - Filters the events that a component exposes through a . - The component to filter events for. - A dictionary of events that can be modified. - true if the set of filtered events is to be cached; false if the filter service must query again. - - - Filters the properties that a component exposes through a . - The component to filter properties for. - A dictionary of properties that can be modified. - true if the set of filtered properties is to be cached; false if the filter service must query again. - - - Discovers available types at design time. - - - Retrieves the list of available types. - The base type to match. Can be null. - Indicates whether types from all referenced assemblies should be checked. - A collection of types that match the criteria specified by baseType and excludeGlobalTypes. - - - Provides an interface to retrieve an assembly or type by name. - - - Gets the requested assembly. - The name of the assembly to retrieve. - An instance of the requested assembly, or null if no assembly can be located. - - - Gets the requested assembly. - The name of the assembly to retrieve. - true if this method should throw an exception if the assembly cannot be located; otherwise, false, and this method returns null if the assembly cannot be located. - An instance of the requested assembly, or null if no assembly can be located. - - - Gets the path to the file from which the assembly was loaded. - The name of the assembly. - The path to the file from which the assembly was loaded. - - - Loads a type with the specified name. - The name of the type. If the type name is not a fully qualified name that indicates an assembly, this service will search its internal set of referenced assemblies. - An instance of that corresponds to the specified name, or null if no type can be found. - - - Loads a type with the specified name. - The name of the type. If the type name is not a fully qualified name that indicates an assembly, this service will search its internal set of referenced assemblies. - true if this method should throw an exception if the assembly cannot be located; otherwise, false, and this method returns null if the assembly cannot be located. - An instance of that corresponds to the specified name, or null if no type can be found. - - - Loads a type with the specified name. - The name of the type. If the type name is not a fully qualified name that indicates an assembly, this service will search its internal set of referenced assemblies. - true if this method should throw an exception if the assembly cannot be located; otherwise, false, and this method returns null if the assembly cannot be located. - true to ignore case when searching for types; otherwise, false. - An instance of that corresponds to the specified name, or null if no type can be found. - - - Adds a reference to the specified assembly. - An that indicates the assembly to reference. - - - Represents a Windows menu or toolbar command item. - - - Initializes a new instance of the class. - The event to raise when the user selects the menu item or toolbar button. - The unique command ID that links this menu command to the environment's menu. - - - Gets or sets a value indicating whether this menu item is checked. - true if the item is checked; otherwise, false. - - - Occurs when the menu command changes. - - - - Gets the associated with this menu command. - The associated with the menu command. - - - Gets a value indicating whether this menu item is available. - true if the item is enabled; otherwise, false. - - - Invokes the command. - - - Invokes the command with the given parameter. - An optional argument for use by the command. - - - Gets the OLE command status code for this menu item. - An integer containing a mixture of status flags that reflect the state of this menu item. - - - Raises the event. - An that contains the event data. - - - Gets the public properties associated with the . - An containing the public properties of the . - - - Gets or sets a value indicating whether this menu item is supported. - true if the item is supported, which is the default; otherwise, false. - - - Returns a string representation of this menu command. - A string containing the value of the property appended with the names of any flags that are set, separated by pipe bars (|). These flag properties include , , , and . - - - Gets or sets a value indicating whether this menu item is visible. - true if the item is visible; otherwise, false. - - - Defines identifiers that indicate the type of a selection. - - - Represents an add selection that adds the selected components to the current selection, maintaining the current set of selected components. - - - - Represents a regular selection. The selection service responds to the CTRL and SHIFT keys to support adding or removing components to or from the selection. - - - - Represents a selection that occurs when a user clicks a component. If the newly selected component is already selected, it is promoted to be the primary selected component rather than being canceled. - - - - Represents a selection that occurs when the user presses on the mouse button while the mouse pointer is over a component. If the component under the pointer is already selected, it is promoted to become the primary selected component rather than being canceled. - - - - Represents a selection that occurs when the user releases the mouse button immediately after a component has been selected. If the newly selected component is already selected, it is promoted to be the primary selected component rather than being canceled. - - - - Represents a regular selection. The selection service responds to the CTRL and SHIFT keys to support adding or removing components to or from the selection. - - - - Represents a primary selection that occurs when a user clicks on a component. If a component in the selection list is already selected, the component is promoted to be the primary selection. - - - - Represents a remove selection that removes the selected components from the current selection, maintaining the current set of selected components. - - - - Represents a selection that occurs when the content of a selection is replaced. The selection service replaces the current selection with the replacement. - - - - Represents a toggle selection that switches between the current selection and the provided selection. If a component is already selected and is passed into with a selection type of , the component selection will be canceled. - - - - Identifies the valid selection types as , , , , or . - - - - Throws an exception for a Win32 error code. - - - Initializes a new instance of the class with the last Win32 error that occurred. - - - Initializes a new instance of the class with the specified error. - The Win32 error code associated with this exception. - - - Initializes a new instance of the class with the specified detailed description. - A detailed description of the error. - - - Initializes a new instance of the class with the specified error and the specified detailed description. - The Win32 error code associated with this exception. - A detailed description of the error. - - - Initializes a new instance of the class with the specified context and the serialization information. - The associated with this exception. - A that represents the context of this exception. - - - Initializes a new instance of the class with the specified detailed description and the specified exception. - A detailed description of the error. - A reference to the inner exception that is the cause of this exception. - - - Sets the object with the file name and line number at which this occurred. - A . - The contextual information about the source or destination. - info is null. - - - Gets the Win32 error code associated with this exception. - The Win32 error code associated with this exception. - - - Provides access to local and remote processes and enables you to start and stop local system processes. - - - Initializes a new instance of the class. - - - Gets the base priority of the associated process. - The base priority, which is computed from the of the associated process. - The platform is Windows 98 or Windows Millennium Edition (Windows Me); set the property to false to access this property on Windows 98 and Windows Me. - The process has exited. -or- The process has not started, so there is no process ID. - - - Begins asynchronous read operations on the redirected stream of the application. - The property is false. - or - An asynchronous read operation is already in progress on the stream. - or - The stream has been used by a synchronous read operation. - - - Begins asynchronous read operations on the redirected stream of the application. - The property is false. - or - An asynchronous read operation is already in progress on the stream. - or - The stream has been used by a synchronous read operation. - - - Cancels the asynchronous read operation on the redirected stream of an application. - The stream is not enabled for asynchronous read operations. - - - Cancels the asynchronous read operation on the redirected stream of an application. - The stream is not enabled for asynchronous read operations. - - - Frees all the resources that are associated with this component. - - - Closes a process that has a user interface by sending a close message to its main window. - true if the close message was successfully sent; false if the associated process does not have a main window or if the main window is disabled (for example if a modal dialog is being shown). - The platform is Windows 98 or Windows Millennium Edition (Windows Me); set the property to false to access this property on Windows 98 and Windows Me. - The process has already exited. -or- No process is associated with this object. - - - Release all resources used by this process. - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - Gets or sets whether the event should be raised when the process terminates. - true if the event should be raised when the associated process is terminated (through either an exit or a call to ); otherwise, false. The default is false. Note that the event is raised even if the value of is false when the process exits during or before the user performs a check. - - - Puts a component in state to interact with operating system processes that run in a special mode by enabling the native property SeDebugPrivilege on the current thread. - - - Occurs when an application writes to its redirected stream. - - - - Gets the value that the associated process specified when it terminated. - The code that the associated process specified when it terminated. - The process has not exited. -or- The process is not valid. - You are trying to access the property for a process that is running on a remote computer. This property is available only for processes that are running on the local computer. - - - Occurs when a process exits. - - - - Gets the time that the associated process exited. - A that indicates when the associated process was terminated. - The platform is Windows 98 or Windows Millennium Edition (Windows Me), which does not support this property. - You are trying to access the property for a process that is running on a remote computer. This property is available only for processes that are running on the local computer. - - - Gets a new component and associates it with the currently active process. - A new component associated with the process resource that is running the calling application. - - - Returns a new component, given the identifier of a process on the local computer. - The system-unique identifier of a process resource. - A component that is associated with the local process resource identified by the processId parameter. - The process specified by the processId parameter is not running. The identifier might be expired. - The process was not started by this object. - - - Returns a new component, given a process identifier and the name of a computer on the network. - The system-unique identifier of a process resource. - The name of a computer on the network. - A component that is associated with a remote process resource identified by the processId parameter. - The process specified by the processId parameter is not running. The identifier might be expired. -or- The machineName parameter syntax is invalid. The name might have length zero (0). - The machineName parameter is null. - The process was not started by this object. - - - Creates a new component for each process resource on the specified computer. - The computer from which to read the list of processes. - An array of type that represents all the process resources running on the specified computer. - The machineName parameter syntax is invalid. It might have length zero (0). - The machineName parameter is null. - The operating system platform does not support this operation on remote computers. - There are problems accessing the performance counter API's used to get process information. This exception is specific to Windows NT, Windows 2000, and Windows XP. - A problem occurred accessing an underlying system API. - - - Creates a new component for each process resource on the local computer. - An array of type that represents all the process resources running on the local computer. - - - Creates an array of new components and associates them with all the process resources on the local computer that share the specified process name. - The friendly name of the process. - An array of type that represents the process resources running the specified application or file. - There are problems accessing the performance counter API's used to get process information. This exception is specific to Windows NT, Windows 2000, and Windows XP. - - - Creates an array of new components and associates them with all the process resources on a remote computer that share the specified process name. - The friendly name of the process. - The name of a computer on the network. - An array of type that represents the process resources running the specified application or file. - The machineName parameter syntax is invalid. It might have length zero (0). - The machineName parameter is null. - The operating system platform does not support this operation on remote computers. - There are problems accessing the performance counter API's used to get process information. This exception is specific to Windows NT, Windows 2000, and Windows XP. - A problem occurred accessing an underlying system API. - - - Gets the native handle of the associated process. - The handle that the operating system assigned to the associated process when the process was started. The system uses this handle to keep track of process attributes. - The process has not been started or has exited. The property cannot be read because there is no process associated with this instance. -or- The instance has been attached to a running process but you do not have the necessary permissions to get a handle with full access rights. - You are trying to access the property for a process that is running on a remote computer. This property is available only for processes that are running on the local computer. - - - Gets the number of handles opened by the process. - The number of operating system handles the process has opened. - The platform is Windows 98 or Windows Millennium Edition (Windows Me); set the property to false to access this property on Windows 98 and Windows Me. - - - Gets a value indicating whether the associated process has been terminated. - true if the operating system process referenced by the component has terminated; otherwise, false. - There is no process associated with the object. - The exit code for the process could not be retrieved. - You are trying to access the property for a process that is running on a remote computer. This property is available only for processes that are running on the local computer. - - - Gets the unique identifier for the associated process. - The system-generated unique identifier of the process that is referenced by this instance. - The process's property has not been set. -or- There is no process associated with this object. - The platform is Windows 98 or Windows Millennium Edition (Windows Me); set the property to false to access this property on Windows 98 and Windows Me. - - - Immediately stops the associated process. - The associated process could not be terminated. -or- The process is terminating. -or- The associated process is a Win16 executable. - You are attempting to call for a process that is running on a remote computer. The method is available only for processes running on the local computer. - The process has already exited. -or- There is no process associated with this object. - - - Takes a component out of the state that lets it interact with operating system processes that run in a special mode. - - - Gets the name of the computer the associated process is running on. - The name of the computer that the associated process is running on. - There is no process associated with this object. - - - Gets the main module for the associated process. - The that was used to start the process. - You are trying to access the property for a process that is running on a remote computer. This property is available only for processes that are running on the local computer. - A 32-bit process is trying to access the modules of a 64-bit process. - The platform is Windows 98 or Windows Millennium Edition (Windows Me); set to false to access this property on Windows 98 and Windows Me. - The process is not available. -or- The process has exited. - - - Gets the window handle of the main window of the associated process. - The system-generated window handle of the main window of the associated process. - The is not defined because the process has exited. - You are trying to access the property for a process that is running on a remote computer. This property is available only for processes that are running on the local computer. - The platform is Windows 98 or Windows Millennium Edition (Windows Me); set to false to access this property on Windows 98 and Windows Me. - - - Gets the caption of the main window of the process. - The main window title of the process. - The property is not defined because the process has exited. - You are trying to access the property for a process that is running on a remote computer. This property is available only for processes that are running on the local computer. - The platform is Windows 98 or Windows Millennium Edition (Windows Me); set to false to access this property on Windows 98 and Windows Me. - - - Gets or sets the maximum allowable working set size, in bytes, for the associated process. - The maximum working set size that is allowed in memory for the process, in bytes. - The maximum working set size is invalid. It must be greater than or equal to the minimum working set size. - Working set information cannot be retrieved from the associated process resource. -or- The process identifier or process handle is zero because the process has not been started. - You are trying to access the property for a process that is running on a remote computer. This property is available only for processes that are running on the local computer. - The process is not available. -or- The process has exited. - The platform is Windows 98 or Windows Millennium Edition (Windows Me), which does not support this property. - - - Gets or sets the minimum allowable working set size, in bytes, for the associated process. - The minimum working set size that is required in memory for the process, in bytes. - The minimum working set size is invalid. It must be less than or equal to the maximum working set size. - Working set information cannot be retrieved from the associated process resource. -or- The process identifier or process handle is zero because the process has not been started. - You are trying to access the property for a process that is running on a remote computer. This property is available only for processes that are running on the local computer. - The process is not available. -or- The process has exited. - The platform is Windows 98 or Windows Millennium Edition (Windows Me), which does not support this property. - - - Gets the modules that have been loaded by the associated process. - An array of type that represents the modules that have been loaded by the associated process. - You are attempting to access the property for a process that is running on a remote computer. This property is available only for processes that are running on the local computer. - The process is not available. - The platform is Windows 98 or Windows Millennium Edition (Windows Me); set to false to access this property on Windows 98 and Windows Me. - You are attempting to access the property for either the system process or the idle process. These processes do not have modules. - - - Gets the amount of nonpaged system memory, in bytes, allocated for the associated process. - The amount of memory, in bytes, the system has allocated for the associated process that cannot be written to the virtual memory paging file. - The platform is Windows 98 or Windows Millennium Edition (Windows Me), which does not support this property. - - - Gets the amount of nonpaged system memory, in bytes, allocated for the associated process. - The amount of system memory, in bytes, allocated for the associated process that cannot be written to the virtual memory paging file. - The platform is Windows 98 or Windows Millennium Edition (Windows Me), which does not support this property. - - - Raises the event. - - - Occurs each time an application writes a line to its redirected stream. - - - - Gets the amount of paged memory, in bytes, allocated for the associated process. - The amount of memory, in bytes, allocated by the associated process that can be written to the virtual memory paging file. - The platform is Windows 98 or Windows Millennium Edition (Windows Me), which does not support this property. - - - Gets the amount of paged memory, in bytes, allocated for the associated process. - The amount of memory, in bytes, allocated in the virtual memory paging file for the associated process. - The platform is Windows 98 or Windows Millennium Edition (Windows Me), which does not support this property. - - - Gets the amount of pageable system memory, in bytes, allocated for the associated process. - The amount of memory, in bytes, the system has allocated for the associated process that can be written to the virtual memory paging file. - The platform is Windows 98 or Windows Millennium Edition (Windows Me), which does not support this property. - - - Gets the amount of pageable system memory, in bytes, allocated for the associated process. - The amount of system memory, in bytes, allocated for the associated process that can be written to the virtual memory paging file. - The platform is Windows 98 or Windows Millennium Edition (Windows Me), which does not support this property. - - - Gets the maximum amount of memory in the virtual memory paging file, in bytes, used by the associated process. - The maximum amount of memory, in bytes, allocated by the associated process that could be written to the virtual memory paging file. - The platform is Windows 98 or Windows Millennium Edition (Windows Me), which does not support this property. - - - Gets the maximum amount of memory in the virtual memory paging file, in bytes, used by the associated process. - The maximum amount of memory, in bytes, allocated in the virtual memory paging file for the associated process since it was started. - The platform is Windows 98 or Windows Millennium Edition (Windows Me), which does not support this property. - - - Gets the maximum amount of virtual memory, in bytes, used by the associated process. - The maximum amount of virtual memory, in bytes, that the associated process has requested. - The platform is Windows 98 or Windows Millennium Edition (Windows Me), which does not support this property. - - - Gets the maximum amount of virtual memory, in bytes, used by the associated process. - The maximum amount of virtual memory, in bytes, allocated for the associated process since it was started. - The platform is Windows 98 or Windows Millennium Edition (Windows Me), which does not support this property. - - - Gets the peak working set size for the associated process, in bytes. - The maximum amount of physical memory that the associated process has required all at once, in bytes. - The platform is Windows 98 or Windows Millennium Edition (Windows Me), which does not support this property. - - - Gets the maximum amount of physical memory, in bytes, used by the associated process. - The maximum amount of physical memory, in bytes, allocated for the associated process since it was started. - The platform is Windows 98 or Windows Millennium Edition (Windows Me), which does not support this property. - - - Gets or sets a value indicating whether the associated process priority should temporarily be boosted by the operating system when the main window has the focus. - true if dynamic boosting of the process priority should take place for a process when it is taken out of the wait state; otherwise, false. The default is false. - Priority boost information could not be retrieved from the associated process resource. - The platform is Windows 98 or Windows Millennium Edition (Windows Me), which does not support this property. -or- The process identifier or process handle is zero. (The process has not been started.) - You are attempting to access the property for a process that is running on a remote computer. This property is available only for processes that are running on the local computer. - The process is not available. - - - Gets or sets the overall priority category for the associated process. - The priority category for the associated process, from which the of the process is calculated. - Process priority information could not be set or retrieved from the associated process resource. -or- The process identifier or process handle is zero. (The process has not been started.) - You are attempting to access the property for a process that is running on a remote computer. This property is available only for processes that are running on the local computer. - The process is not available. - You have set the to AboveNormal or BelowNormal when using Windows 98 or Windows Millennium Edition (Windows Me). These platforms do not support those values for the priority class. - Priority class cannot be set because it does not use a valid value, as defined in the enumeration. - - - Gets the amount of private memory, in bytes, allocated for the associated process. - The number of bytes allocated by the associated process that cannot be shared with other processes. - The platform is Windows 98 or Windows Millennium Edition (Windows Me), which does not support this property. - - - Gets the amount of private memory, in bytes, allocated for the associated process. - The amount of memory, in bytes, allocated for the associated process that cannot be shared with other processes. - The platform is Windows 98 or Windows Millennium Edition (Windows Me), which does not support this property. - - - Gets the privileged processor time for this process. - A that indicates the amount of time that the process has spent running code inside the operating system core. - The platform is Windows 98 or Windows Millennium Edition (Windows Me), which does not support this property. - You are attempting to access the property for a process that is running on a remote computer. This property is available only for processes that are running on the local computer. - - - Gets the name of the process. - The name that the system uses to identify the process to the user. - The process does not have an identifier, or no process is associated with the . -or- The associated process has exited. - The platform is Windows 98 or Windows Millennium Edition (Windows Me); set to false to access this property on Windows 98 and Windows Me. - The process is not on this computer. - - - Gets or sets the processors on which the threads in this process can be scheduled to run. - A bitmask representing the processors that the threads in the associated process can run on. The default depends on the number of processors on the computer. The default value is 2 n -1, where n is the number of processors. - information could not be set or retrieved from the associated process resource. -or- The process identifier or process handle is zero. (The process has not been started.) - You are attempting to access the property for a process that is running on a remote computer. This property is available only for processes that are running on the local computer. - The process was not available. -or- The process has exited. - - - Discards any information about the associated process that has been cached inside the process component. - - - Gets a value indicating whether the user interface of the process is responding. - true if the user interface of the associated process is responding to the system; otherwise, false. - The platform is Windows 98 or Windows Millennium Edition (Windows Me); set to false to access this property on Windows 98 and Windows Me. - There is no process associated with this object. - You are attempting to access the property for a process that is running on a remote computer. This property is available only for processes that are running on the local computer. - - - Gets the native handle to this process. - The native handle to this process. - - - Gets the Terminal Services session identifier for the associated process. - The Terminal Services session identifier for the associated process. - There is no session associated with this process. - There is no process associated with this session identifier. -or- The associated process is not on this machine. - The property is not supported on Windows 98. - - - Gets a stream used to read the error output of the application. - A that can be used to read the standard error stream of the application. - The stream has not been defined for redirection; ensure is set to true and is set to false. - or - The stream has been opened for asynchronous read operations with . - - - Gets a stream used to write the input of the application. - A that can be used to write the standard input stream of the application. - The stream has not been defined because is set to false. - - - Gets a stream used to read the textual output of the application. - A that can be used to read the standard output stream of the application. - The stream has not been defined for redirection; ensure is set to true and is set to false. - or - The stream has been opened for asynchronous read operations with . - - - Starts (or reuses) the process resource that is specified by the property of this component and associates it with the component. - true if a process resource is started; false if no new process resource is started (for example, if an existing process is reused). - No file name was specified in the component's . -or- The member of the property is true while , , or is true. - There was an error in opening the associated file. - The process object has already been disposed. - - - Starts the process resource that is specified by the parameter containing process start information (for example, the file name of the process to start) and associates the resource with a new component. - The that contains the information that is used to start the process, including the file name and any command-line arguments. - A new that is associated with the process resource, or null if no process resource is started. Note that a new process that’s started alongside already running instances of the same process will be independent from the others. In addition, Start may return a non-null Process with its property already set to true. In this case, the started process may have activated an existing instance of itself and then exited. - No file name was specified in the startInfo parameter's property. -or- The property of the startInfo parameter is true and the , , or property is also true. -or- The property of the startInfo parameter is true and the property is not null or empty or the property is not null. - The startInfo parameter is null. - The process object has already been disposed. - The file specified in the startInfo parameter's property could not be found. - An error occurred when opening the associated file. -or- The sum of the length of the arguments and the length of the full path to the process exceeds 2080. The error message associated with this exception can be one of the following: "The data area passed to a system call is too small." or "Access is denied." - - - Starts a process resource by specifying the name of a document or application file and associates the resource with a new component. - The name of a document or application file to run in the process. - A new that is associated with the process resource, or null if no process resource is started. Note that a new process that’s started alongside already running instances of the same process will be independent from the others. In addition, Start may return a non-null Process with its property already set to true. In this case, the started process may have activated an existing instance of itself and then exited. - An error occurred when opening the associated file. - The process object has already been disposed. - The PATH environment variable has a string containing quotes. - - - Starts a process resource by specifying the name of an application and a set of command-line arguments, and associates the resource with a new component. - The name of an application file to run in the process. - Command-line arguments to pass when starting the process. - A new that is associated with the process resource, or null if no process resource is started. Note that a new process that’s started alongside already running instances of the same process will be independent from the others. In addition, Start may return a non-null Process with its property already set to true. In this case, the started process may have activated an existing instance of itself and then exited. - The fileName or arguments parameter is null. - An error occurred when opening the associated file. -or- The sum of the length of the arguments and the length of the full path to the process exceeds 2080. The error message associated with this exception can be one of the following: "The data area passed to a system call is too small." or "Access is denied." - The process object has already been disposed. - The PATH environment variable has a string containing quotes. - - - Starts a process resource by specifying the name of an application, a user name, a password, and a domain and associates the resource with a new component. - The name of an application file to run in the process. - The user name to use when starting the process. - A that contains the password to use when starting the process. - The domain to use when starting the process. - A new that is associated with the process resource, or null if no process resource is started. Note that a new process that’s started alongside already running instances of the same process will be independent from the others. In addition, Start may return a non-null Process with its property already set to true. In this case, the started process may have activated an existing instance of itself and then exited. - No file name was specified. - There was an error in opening the associated file. - The process object has already been disposed. - - - Starts a process resource by specifying the name of an application, a set of command-line arguments, a user name, a password, and a domain and associates the resource with a new component. - The name of an application file to run in the process. - Command-line arguments to pass when starting the process. - The user name to use when starting the process. - A that contains the password to use when starting the process. - The domain to use when starting the process. - A new that is associated with the process resource, or null if no process resource is started. Note that a new process that’s started alongside already running instances of the same process will be independent from the others. In addition, Start may return a non-null Process with its property already set to true. In this case, the started process may have activated an existing instance of itself and then exited. - No file name was specified. - An error occurred when opening the associated file. -or- The sum of the length of the arguments and the length of the full path to the associated file exceeds 2080. The error message associated with this exception can be one of the following: "The data area passed to a system call is too small." or "Access is denied." - The process object has already been disposed. - - - Gets or sets the properties to pass to the method of the . - The that represents the data with which to start the process. These arguments include the name of the executable file or document used to start the process. - The value that specifies the is null. - - - Gets the time that the associated process was started. - An object that indicates when the process started. An exception is thrown if the process is not running. - The platform is Windows 98 or Windows Millennium Edition (Windows Me), which does not support this property. - You are attempting to access the property for a process that is running on a remote computer. This property is available only for processes that are running on the local computer. - The process has exited. -or- The process has not been started. - An error occurred in the call to the Windows function. - - - Gets or sets the object used to marshal the event handler calls that are issued as a result of a process exit event. - The used to marshal event handler calls that are issued as a result of an event on the process. - - - Gets the set of threads that are running in the associated process. - An array of type representing the operating system threads currently running in the associated process. - The process does not have an , or no process is associated with the instance. -or- The associated process has exited. - The platform is Windows 98 or Windows Millennium Edition (Windows Me); set to false to access this property on Windows 98 and Windows Me. - - - Formats the process's name as a string, combined with the parent component type, if applicable. - The , combined with the base component's return value. - is not supported on Windows 98. - - - Gets the total processor time for this process. - A that indicates the amount of time that the associated process has spent utilizing the CPU. This value is the sum of the and the . - The platform is Windows 98 or Windows Millennium Edition (Windows Me), which does not support this property. - You are attempting to access the property for a process that is running on a remote computer. This property is available only for processes that are running on the local computer. - - - Gets the user processor time for this process. - A that indicates the amount of time that the associated process has spent running code inside the application portion of the process (not inside the operating system core). - The platform is Windows 98 or Windows Millennium Edition (Windows Me), which does not support this property. - You are attempting to access the property for a process that is running on a remote computer. This property is available only for processes that are running on the local computer. - - - Gets the size of the process's virtual memory, in bytes. - The amount of virtual memory, in bytes, that the associated process has requested. - The platform is Windows 98 or Windows Millennium Edition (Windows Me), which does not support this property. - - - Gets the amount of the virtual memory, in bytes, allocated for the associated process. - The amount of virtual memory, in bytes, allocated for the associated process. - The platform is Windows 98 or Windows Millennium Edition (Windows Me), which does not support this property. - - - Instructs the component to wait indefinitely for the associated process to exit. - The wait setting could not be accessed. - No process has been set, and a from which the property can be determined does not exist. -or- There is no process associated with this object. -or- You are attempting to call for a process that is running on a remote computer. This method is available only for processes that are running on the local computer. - - - Instructs the component to wait the specified number of milliseconds for the associated process to exit. - The amount of time, in milliseconds, to wait for the associated process to exit. The maximum is the largest possible value of a 32-bit integer, which represents infinity to the operating system. - true if the associated process has exited; otherwise, false. - The wait setting could not be accessed. - No process has been set, and a from which the property can be determined does not exist. -or- There is no process associated with this object. -or- You are attempting to call for a process that is running on a remote computer. This method is available only for processes that are running on the local computer. - - - Causes the component to wait indefinitely for the associated process to enter an idle state. This overload applies only to processes with a user interface and, therefore, a message loop. - true if the associated process has reached an idle state. - The process does not have a graphical interface. -or- An unknown error occurred. The process failed to enter an idle state. -or- The process has already exited. -or- No process is associated with this object. - - - Causes the component to wait the specified number of milliseconds for the associated process to enter an idle state. This overload applies only to processes with a user interface and, therefore, a message loop. - A value of 1 to that specifies the amount of time, in milliseconds, to wait for the associated process to become idle. A value of 0 specifies an immediate return, and a value of -1 specifies an infinite wait. - true if the associated process has reached an idle state; otherwise, false. - The process does not have a graphical interface. -or- An unknown error occurred. The process failed to enter an idle state. -or- The process has already exited. -or- No process is associated with this object. - - - Gets the associated process's physical memory usage, in bytes. - The total amount of physical memory the associated process is using, in bytes. - The platform is Windows 98 or Windows Millennium Edition (Windows Me), which does not support this property. - - - Gets the amount of physical memory, in bytes, allocated for the associated process. - The amount of physical memory, in bytes, allocated for the associated process. - The platform is Windows 98 or Windows Millennium Edition (Windows Me), which does not support this property. - - - Represents a.dll or .exe file that is loaded into a particular process. - - - Gets the memory address where the module was loaded. - The load address of the module. - - - Gets the memory address for the function that runs when the system loads and runs the module. - The entry point of the module. - - - Gets the full path to the module. - The fully qualified path that defines the location of the module. - - - Gets version information about the module. - A that contains the module's version information. - - - Gets the amount of memory that is required to load the module. - The size, in bytes, of the memory that the module occupies. - - - Gets the name of the process module. - The name of the module. - - - Converts the name of the module to a string. - The value of the property. - - - Provides a strongly typed collection of objects. - - - Initializes a new instance of the class, with no associated instances. - - - Initializes a new instance of the class, using the specified array of instances. - An array of instances with which to initialize this instance. - - - Determines whether the specified process module exists in the collection. - A instance that indicates the module to find in this collection. - true if the module exists in the collection; otherwise, false. - - - Copies an array of instances to the collection, at the specified index. - An array of instances to add to the collection. - The location at which to add the new instances. - - - Provides the location of a specified module within the collection. - The whose index is retrieved. - The zero-based index that defines the location of the module within the . - - - Gets an index for iterating over the set of process modules. - The zero-based index value of the module in the collection. - A that indexes the modules in the collection - - - Indicates the priority that the system associates with a process. This value, together with the priority value of each thread of the process, determines each thread's base priority level. - - - Specifies that the process has priority above Normal but below . - - - - Specifies that the process has priority above Idle but below Normal. - - - - Specifies that the process performs time-critical tasks that must be executed immediately, such as the Task List dialog, which must respond quickly when called by the user, regardless of the load on the operating system. The threads of the process preempt the threads of normal or idle priority class processes. - - - - Specifies that the threads of this process run only when the system is idle, such as a screen saver. The threads of the process are preempted by the threads of any process running in a higher priority class. - - - - Specifies that the process has no special scheduling needs. - - - - Specifies that the process has the highest possible priority. - - - - Specifies a set of values that are used when you start a process. - - - Initializes a new instance of the class without specifying a file name with which to start the process. - - - Initializes a new instance of the class and specifies a file name such as an application or document with which to start the process. - An application or document with which to start a process. - - - Initializes a new instance of the class, specifies an application file name with which to start the process, and specifies a set of command-line arguments to pass to the application. - An application with which to start a process. - Command-line arguments to pass to the application when the process starts. - - - Gets or sets the set of command-line arguments to use when starting the application. - A single string containing the arguments to pass to the target application specified in the property. The default is an empty string (""). On Windows Vista and earlier versions of the Windows operating system, the length of the arguments added to the length of the full path to the process must be less than 2080. On Windows 7 and later versions, the length must be less than 32699. Arguments are parsed and interpreted by the target application, so must align with the expectations of that application. For.NET applications as demonstrated in the Examples below, spaces are interpreted as a separator between multiple arguments. A single argument that includes spaces must be surrounded by quotation marks, but those quotation marks are not carried through to the target application. In include quotation marks in the final parsed argument, triple-escape each mark. - - - Gets or sets a value indicating whether to start the process in a new window. - true if the process should be started without creating a new window to contain it; otherwise, false. The default is false. - - - Gets or sets a value that identifies the domain to use when starting the process. - The Active Directory domain to use when starting the process. The domain property is primarily of interest to users within enterprise environments that use Active Directory. - - - Gets the environment variables that apply to this process and its child processes. - A generic dictionary containing the environment variables that apply to this process and its child processes. The default is null. - - - Gets search paths for files, directories for temporary files, application-specific options, and other similar information. - A string dictionary that provides environment variables that apply to this process and child processes. The default is null. - - - Gets or sets a value indicating whether an error dialog box is displayed to the user if the process cannot be started. - true if an error dialog box should be displayed on the screen if the process cannot be started; otherwise, false. The default is false. - - - Gets or sets the window handle to use when an error dialog box is shown for a process that cannot be started. - A pointer to the handle of the error dialog box that results from a process start failure. - - - Gets or sets the application or document to start. - The name of the application to start, or the name of a document of a file type that is associated with an application and that has a default open action available to it. The default is an empty string (""). - - - Gets or sets a value that indicates whether the Windows user profile is to be loaded from the registry. - true if the Windows user profile should be loaded; otherwise, false. The default is false. - - - Gets or sets a secure string that contains the user password to use when starting the process. - The user password to use when starting the process. - - - Gets or sets the user password in clear text to use when starting the process. - The user password in clear text. - - - Gets or sets a value that indicates whether the error output of an application is written to the stream. - true if error output should be written to ; otherwise, false. The default is false. - - - Gets or sets a value indicating whether the input for an application is read from the stream. - true if input should be read from ; otherwise, false. The default is false. - - - Gets or sets a value that indicates whether the textual output of an application is written to the stream. - true if output should be written to ; otherwise, false. The default is false. - - - Gets or sets the preferred encoding for error output. - An object that represents the preferred encoding for error output. The default is null. - - - Gets or sets the preferred encoding for standard output. - An object that represents the preferred encoding for standard output. The default is null. - - - Gets or sets the user name to be used when starting the process. - The user name to use when starting the process. - - - Gets or sets a value indicating whether to use the operating system shell to start the process. - true if the shell should be used when starting the process; false if the process should be created directly from the executable file. The default is true. - - - Gets or sets the verb to use when opening the application or document specified by the property. - The action to take with the file that the process opens. The default is an empty string (""), which signifies no action. - - - Gets the set of verbs associated with the type of file specified by the property. - The actions that the system can apply to the file indicated by the property. - - - Gets or sets the window state to use when the process is started. - One of the enumeration values that indicates whether the process is started in a window that is maximized, minimized, normal (neither maximized nor minimized), or not visible. The default is Normal. - The window style is not one of the enumeration members. - - - When the property is false, gets or sets the working directory for the process to be started. When is true, gets or sets the directory that contains the process to be started. - When is true, the fully qualified name of the directory that contains the process to be started. When the property is false, the working directory for the process to be started. The default is an empty string (""). - - - Represents an operating system process thread. - - - Gets the base priority of the thread. - The base priority of the thread, which the operating system computes by combining the process priority class with the priority level of the associated thread. - - - Gets the current priority of the thread. - The current priority of the thread, which may deviate from the base priority based on how the operating system is scheduling the thread. The priority may be temporarily boosted for an active thread. - - - Gets the unique identifier of the thread. - The unique identifier associated with a specific thread. - - - Sets the preferred processor for this thread to run on. - The preferred processor for the thread, used when the system schedules threads, to determine which processor to run the thread on. - The system could not set the thread to start on the specified processor. - The platform is Windows 98 or Windows Millennium Edition. - The process is on a remote computer. - - - Gets or sets a value indicating whether the operating system should temporarily boost the priority of the associated thread whenever the main window of the thread's process receives the focus. - true to boost the thread's priority when the user interacts with the process's interface; otherwise, false. The default is false. - The priority boost information could not be retrieved. -or- The priority boost information could not be set. - The platform is Windows 98 or Windows Millennium Edition. - The process is on a remote computer. - - - Gets or sets the priority level of the thread. - One of the values, specifying a range that bounds the thread's priority. - The thread priority level information could not be retrieved. -or- The thread priority level could not be set. - The platform is Windows 98 or Windows Millennium Edition. - The process is on a remote computer. - - - Gets the amount of time that the thread has spent running code inside the operating system core. - A indicating the amount of time that the thread has spent running code inside the operating system core. - The thread time could not be retrieved. - The platform is Windows 98 or Windows Millennium Edition. - The process is on a remote computer. - - - Sets the processors on which the associated thread can run. - An that points to a set of bits, each of which represents a processor that the thread can run on. - The processor affinity could not be set. - The platform is Windows 98 or Windows Millennium Edition. - The process is on a remote computer. - - - Resets the ideal processor for this thread to indicate that there is no single ideal processor. In other words, so that any processor is ideal. - The ideal processor could not be reset. - The platform is Windows 98 or Windows Millennium Edition. - The process is on a remote computer. - - - Gets the memory address of the function that the operating system called that started this thread. - The thread's starting address, which points to the application-defined function that the thread executes. - The platform is Windows 98 or Windows Millennium Edition. - The process is on a remote computer. - - - Gets the time that the operating system started the thread. - A representing the time that was on the system when the operating system started the thread. - The thread time could not be retrieved. - The platform is Windows 98 or Windows Millennium Edition. - The process is on a remote computer. - - - Gets the current state of this thread. - A that indicates the thread's execution, for example, running, waiting, or terminated. - The platform is Windows 98 or Windows Millennium Edition. - The process is on a remote computer. - - - Gets the total amount of time that this thread has spent using the processor. - A that indicates the amount of time that the thread has had control of the processor. - The thread time could not be retrieved. - The platform is Windows 98 or Windows Millennium Edition. - The process is on a remote computer. - - - Gets the amount of time that the associated thread has spent running code inside the application. - A indicating the amount of time that the thread has spent running code inside the application, as opposed to inside the operating system core. - The thread time could not be retrieved. - The platform is Windows 98 or Windows Millennium Edition. - The process is on a remote computer. - - - Gets the reason that the thread is waiting. - A representing the reason that the thread is in the wait state. - The thread is not in the wait state. - The platform is Windows 98 or Windows Millennium Edition. - The process is on a remote computer. - - - Provides a strongly typed collection of objects. - - - Initializes a new instance of the class, with no associated instances. - - - Initializes a new instance of the class, using the specified array of instances. - An array of instances with which to initialize this instance. - - - Appends a process thread to the collection. - The thread to add to the collection. - The zero-based index of the thread in the collection. - - - Determines whether the specified process thread exists in the collection. - A instance that indicates the thread to find in this collection. - true if the thread exists in the collection; otherwise, false. - - - Copies an array of instances to the collection, at the specified index. - An array of instances to add to the collection. - The location at which to add the new instances. - - - Provides the location of a specified thread within the collection. - The whose index is retrieved. - The zero-based index that defines the location of the thread within the . - - - Inserts a process thread at the specified location in the collection. - The zero-based index indicating the location at which to insert the thread. - The thread to insert into the collection. - - - Gets an index for iterating over the set of process threads. - The zero-based index value of the thread in the collection. - A that indexes the threads in the collection. - - - Deletes a process thread from the collection. - The thread to remove from the collection. - - - Specified how a new window should appear when the system starts a process. - - - The hidden window style. A window can be either visible or hidden. The system displays a hidden window by not drawing it. If a window is hidden, it is effectively disabled. A hidden window can process messages from the system or from other windows, but it cannot process input from the user or display output. Frequently, an application may keep a new window hidden while it customizes the window's appearance, and then make the window style Normal. To use , the property must be false. - - - - The maximized window style. By default, the system enlarges a maximized window so that it fills the screen or, in the case of a child window, the parent window's client area. If the window has a title bar, the system automatically moves it to the top of the screen or to the top of the parent window's client area. Also, the system disables the window's sizing border and the window-positioning capability of the title bar so that the user cannot move the window by dragging the title bar. - - - - The minimized window style. By default, the system reduces a minimized window to the size of its taskbar button and moves the minimized window to the taskbar. - - - - The normal, visible window style. The system displays a window with Normal style on the screen, in a default location. If a window is visible, the user can supply input to the window and view the window's output. Frequently, an application may initialize a new window to the Hidden style while it customizes the window's appearance, and then make the window style Normal. - - - - Indicates whether a listener should trace a message based on the source of a trace. - - - Initializes a new instance of the class, specifying the name of the trace source. - The name of the trace source. - - - Determines whether the trace listener should trace the event. - An object that represents the information cache for the trace event. - The name of the source. - One of the enumeration values that identifies the event type. - A trace identifier number. - The format to use for writing an array of arguments or a message to write. - An array of argument objects. - A trace data object. - An array of trace data objects. - true if the trace should be produced; otherwise, false. - source is null. - - - Gets or sets the name of the trace source. - The name of the trace source. - The value is null. - - - Specifies the levels of trace messages filtered by the source switch and event type filter. - - - Allows the , , , , and events through. - - - - Allows all events through. - - - - Allows only events through. - - - - Allows and events through. - - - - Allows , , , and events through. - - - - Does not allow any events through. - - - - Allows , , , , and events through. - - - - Allows , , and events through. - - - - Provides a multilevel switch to control tracing and debug output without recompiling your code. - - - Initializes a new instance of the class, specifying the name of the source. - The name of the source. - - - Initializes a new instance of the class, specifying the display name and the default value for the source switch. - The name of the source switch. - The default value for the switch. - - - Gets or sets the level of the switch. - One of the values that represents the event level of the switch. - - - Invoked when the value of the property changes. - The new value of is not one of the values. - - - Determines if trace listeners should be called, based on the trace event type. - One of the values. - True if the trace listeners should be called; otherwise, false. - - - Provides information about a , which represents a function call on the call stack for the current thread. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class, optionally capturing source information. - true to capture the file name, line number, and column number of the stack frame; otherwise, false. - - - Initializes a new instance of the class that corresponds to a frame above the current stack frame. - The number of frames up the stack to skip. - - - Initializes a new instance of the class that corresponds to a frame above the current stack frame, optionally capturing source information. - The number of frames up the stack to skip. - true to capture the file name, line number, and column number of the stack frame; otherwise, false. - - - Initializes a new instance of the class that contains only the given file name and line number. - The file name. - The line number in the specified file. - - - Initializes a new instance of the class that contains only the given file name, line number, and column number. - The file name. - The line number in the specified file. - The column number in the specified file. - - - Gets the column number in the file that contains the code that is executing. This information is typically extracted from the debugging symbols for the executable. - The file column number, or 0 (zero) if the file column number cannot be determined. - - - Gets the line number in the file that contains the code that is executing. This information is typically extracted from the debugging symbols for the executable. - The file line number, or 0 (zero) if the file line number cannot be determined. - - - Gets the file name that contains the code that is executing. This information is typically extracted from the debugging symbols for the executable. - The file name, or null if the file name cannot be determined. - - - Gets the offset from the start of the Microsoft intermediate language (MSIL) code for the method that is executing. This offset might be an approximation depending on whether or not the just-in-time (JIT) compiler is generating debugging code. The generation of this debugging information is controlled by the . - The offset from the start of the MSIL code for the method that is executing. - - - Gets the method in which the frame is executing. - The method in which the frame is executing. - - - Gets the offset from the start of the native just-in-time (JIT)-compiled code for the method that is being executed. The generation of this debugging information is controlled by the class. - The offset from the start of the JIT-compiled code for the method that is being executed. - - - Defines the value that is returned from the or method when the native or Microsoft intermediate language (MSIL) offset is unknown. This field is constant. - - - - Builds a readable representation of the stack trace. - A readable representation of the stack trace. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Represents a stack trace, which is an ordered collection of one or more stack frames. - - - Initializes a new instance of the class from the caller's frame. - - - Initializes a new instance of the class from the caller's frame, optionally capturing source information. - true to capture the file name, line number, and column number; otherwise, false. - - - Initializes a new instance of the class that contains a single frame. - The frame that the object should contain. - - - Initializes a new instance of the class using the provided exception object. - The exception object from which to construct the stack trace. - The parameter e is null. - - - Initializes a new instance of the class from the caller's frame, skipping the specified number of frames. - The number of frames up the stack from which to start the trace. - The skipFrames parameter is negative. - - - Initializes a new instance of the class, using the provided exception object and optionally capturing source information. - - - The parameter e is null. - - - Initializes a new instance of the class using the provided exception object and skipping the specified number of frames. - The exception object from which to construct the stack trace. - The number of frames up the stack from which to start the trace. - The parameter e is null. - The skipFrames parameter is negative. - - - Initializes a new instance of the class from the caller's frame, skipping the specified number of frames and optionally capturing source information. - The number of frames up the stack from which to start the trace. - true to capture the file name, line number, and column number; otherwise, false. - The skipFrames parameter is negative. - - - Initializes a new instance of the class using the provided exception object, skipping the specified number of frames and optionally capturing source information. - The exception object from which to construct the stack trace. - The number of frames up the stack from which to start the trace. - true to capture the file name, line number, and column number; otherwise, false. - The parameter e is null. - The skipFrames parameter is negative. - - - Gets the number of frames in the stack trace. - The number of frames in the stack trace. - - - Gets the specified stack frame. - The index of the stack frame requested. - The specified stack frame. - - - Returns a copy of all stack frames in the current stack trace. - An array of type representing the function calls in the stack trace. - - - Defines the default for the number of methods to omit from the stack trace. This field is constant. - - - - Builds a readable representation of the stack trace. - A readable representation of the stack trace. - - - Provides a set of methods and properties that you can use to accurately measure elapsed time. - - - Initializes a new instance of the class. - - - Gets the total elapsed time measured by the current instance. - A read-only representing the total elapsed time measured by the current instance. - - - Gets the total elapsed time measured by the current instance, in milliseconds. - A read-only long integer representing the total number of milliseconds measured by the current instance. - - - Gets the total elapsed time measured by the current instance, in timer ticks. - A read-only long integer representing the total number of timer ticks measured by the current instance. - - - Gets the frequency of the timer as the number of ticks per second. This field is read-only. - - - - Gets the current number of ticks in the timer mechanism. - A long integer representing the tick counter value of the underlying timer mechanism. - - - Indicates whether the timer is based on a high-resolution performance counter. This field is read-only. - - - - Gets a value indicating whether the timer is running. - true if the instance is currently running and measuring elapsed time for an interval; otherwise, false. - - - Stops time interval measurement and resets the elapsed time to zero. - - - Stops time interval measurement, resets the elapsed time to zero, and starts measuring elapsed time. - - - Starts, or resumes, measuring elapsed time for an interval. - - - Initializes a new instance, sets the elapsed time property to zero, and starts measuring elapsed time. - A that has just begun measuring elapsed time. - - - Stops measuring elapsed time for an interval. - - - Provides an abstract base class to create new debugging and tracing switches. - - - Initializes a new instance of the class. - The name of the switch. - The description for the switch. - - - Initializes a new instance of the class, specifying the display name, description, and default value for the switch. - The name of the switch. - The description of the switch. - The default value for the switch. - - - Gets the custom switch attributes defined in the application configuration file. - A containing the case-insensitive custom attributes for the trace switch. - - - Gets a description of the switch. - The description of the switch. The default value is an empty string (""). - - - Gets a name used to identify the switch. - The name used to identify the switch. The default value is an empty string (""). - - - Gets the custom attributes supported by the switch. - A string array that contains the names of the custom attributes supported by the switch, or null if there no custom attributes are supported. - - - Invoked when the property is changed. - - - Invoked when the property is changed. - - - Gets or sets the current setting for this switch. - The current setting for this switch. The default is zero. - - - Gets or sets the value of the switch. - A string representing the value of the switch. - The value is null. -or- The value does not consist solely of an optional negative sign followed by a sequence of digits ranging from 0 to 9. -or- The value represents a number less than or greater than . - - - Identifies a switch used in an assembly, class, or member. - - - Initializes a new instance of the class, specifying the name and the type of the switch. - The display name of the switch. - The type of the switch. - - - Returns all switch attributes for the specified assembly. - The assembly to check for switch attributes. - An array that contains all the switch attributes for the assembly. - assembly is null. - - - Gets or sets the description of the switch. - The description of the switch. - - - Gets or sets the display name of the switch. - The display name of the switch. - is set to null. - is set to an empty string. - - - Gets or sets the type of the switch. - The type of the switch. - is set to null. - - - Identifies the level type for a switch. - - - Initializes a new instance of the class, specifying the type that determines whether a trace should be written. - The that determines whether a trace should be written. - - - Gets or sets the type that determines whether a trace should be written. - The that determines whether a trace should be written. - The set operation failed because the value is null. - - - Represents a symbol binder for managed code. - - - Gets the interface of the symbol reader for the current file. - The metadata import interface. - The name of the file for which the reader interface is required. - The search path used to locate the symbol file. - The interface that reads the debugging symbols. - - - Represents a symbol binder for managed code. - - - Gets the interface of the symbol reader for the current file. - An that refers to the metadata import interface. - The name of the file for which the reader interface is required. - The search path used to locate the symbol file. - The interface that reads the debugging symbols. - - - Represents a document referenced by a symbol store. - - - Gets the checksum algorithm identifier. - A GUID identifying the checksum algorithm. The value is all zeros, if there is no checksum. - - - Gets the type of the current document. - The type of the current document. - - - Returns the closest line that is a sequence point, given a line in the current document that might or might not be a sequence point. - The specified line in the document. - The closest line that is a sequence point. - - - Gets the checksum. - The checksum. - - - Gets the embedded document source for the specified range. - The starting line in the current document. - The starting column in the current document. - The ending line in the current document. - The ending column in the current document. - The document source for the specified range. - - - Checks whether the current document is stored in the symbol store. - true if the current document is stored in the symbol store; otherwise, false. - - - Gets the language of the current document. - The language of the current document. - - - Gets the language vendor of the current document. - The language vendor of the current document. - - - Gets the length, in bytes, of the embedded source. - The source length of the current document. - - - Gets the URL of the current document. - The URL of the current document. - - - Represents a document referenced by a symbol store. - - - Sets checksum information. - The GUID representing the algorithm ID. - The checksum. - - - Stores the raw source for a document in the symbol store. - The document source represented as unsigned bytes. - - - Represents a method within a symbol store. - - - Gets the namespace that the current method is defined within. - The namespace that the current method is defined within. - - - Gets the Microsoft intermediate language (MSIL) offset within the method that corresponds to the specified position. - The document for which the offset is requested. - The document line corresponding to the offset. - The document column corresponding to the offset. - The offset within the specified document. - - - Gets the parameters for the current method. - The array of parameters for the current method. - - - Gets an array of start and end offset pairs that correspond to the ranges of Microsoft intermediate language (MSIL) that a given position covers within this method. - The document for which the offset is requested. - The document line corresponding to the ranges. - The document column corresponding to the ranges. - An array of start and end offset pairs. - - - Returns the most enclosing lexical scope when given an offset within a method. - The byte offset within the method of the lexical scope. - The most enclosing lexical scope for the given byte offset within the method. - - - Gets the sequence points for the current method. - The array of byte offsets from the beginning of the method for the sequence points. - The array of documents in which the sequence points are located. - The array of lines in the documents at which the sequence points are located. - The array of columns in the documents at which the sequence points are located. - The array of lines in the documents at which the sequence points end. - The array of columns in the documents at which the sequence points end. - - - Gets the start and end positions for the source of the current method. - The starting and ending source documents. - The starting and ending lines in the corresponding source documents. - The starting and ending columns in the corresponding source documents. - true if the positions were defined; otherwise, false. - - - Gets the root lexical scope for the current method. This scope encloses the entire method. - The root lexical scope that encloses the entire method. - - - Gets a count of the sequence points in the method. - The count of the sequence points in the method. - - - Gets the containing the metadata for the current method. - The metadata token for the current method. - - - Represents a namespace within a symbol store. - - - Gets the child members of the current namespace. - The child members of the current namespace. - - - Gets all the variables defined at global scope within the current namespace. - The variables defined at global scope within the current namespace. - - - Gets the current namespace. - The current namespace. - - - Represents a symbol reader for managed code. - - - Gets a document specified by the language, vendor, and type. - The URL that identifies the document. - The document language. You can specify this parameter as . - The identity of the vendor for the document language. You can specify this parameter as . - The type of the document. You can specify this parameter as . - The specified document. - - - Gets an array of all documents defined in the symbol store. - An array of all documents defined in the symbol store. - - - Gets all global variables in the module. - An array of all variables in the module. - - - Gets a symbol reader method object when given the identifier of a method. - The metadata token of the method. - The symbol reader method object for the specified method identifier. - - - Gets a symbol reader method object when given the identifier of a method and its edit and continue version. - The metadata token of the method. - The edit and continue version of the method. - The symbol reader method object for the specified method identifier. - - - Gets a symbol reader method object that contains a specified position in a document. - The document in which the method is located. - The position of the line within the document. The lines are numbered, beginning with 1. - The position of column within the document. The columns are numbered, beginning with 1. - The reader method object for the specified position in the document. - - - Gets the namespaces that are defined in the global scope within the current symbol store. - The namespaces defined in the global scope within the current symbol store. - - - Gets an attribute value when given the attribute name. - The metadata token for the object for which the attribute is requested. - The attribute name. - The value of the attribute. - - - Gets the variables that are not local when given the parent. - The metadata token for the type for which the variables are requested. - An array of variables for the parent. - - - Gets the metadata token for the method that was specified as the user entry point for the module, if any. - The metadata token for the method that is the user entry point for the module. - - - Represents a lexical scope within , providing access to the start and end offsets of the scope, as well as its child and parent scopes. - - - Gets the end offset of the current lexical scope. - The end offset of the current lexical scope. - - - Gets the child lexical scopes of the current lexical scope. - The child lexical scopes that of the current lexical scope. - - - Gets the local variables within the current lexical scope. - The local variables within the current lexical scope. - - - Gets the namespaces that are used within the current scope. - The namespaces that are used within the current scope. - - - Gets the method that contains the current lexical scope. - The method that contains the current lexical scope. - - - Gets the parent lexical scope of the current scope. - The parent lexical scope of the current scope. - - - Gets the start offset of the current lexical scope. - The start offset of the current lexical scope. - - - Represents a variable within a symbol store. - - - Gets the first address of a variable. - The first address of the variable. - - - Gets the second address of a variable. - The second address of the variable. - - - Gets the third address of a variable. - The third address of the variable. - - - Gets the value describing the type of the address. - The type of the address. One of the values. - - - Gets the attributes of the variable. - The variable attributes. - - - Gets the end offset of a variable within the scope of the variable. - The end offset of the variable. - - - Gets the variable signature. - The variable signature as an opaque blob. - - - Gets the name of the variable. - The name of the variable. - - - Gets the start offset of the variable within the scope of the variable. - The start offset of the variable. - - - Represents a symbol writer for managed code. - - - Closes and commits the symbols to the symbol store. - - - Closes the current method. - - - Closes the most recent namespace. - - - Closes the current lexical scope. - The points past the last instruction in the scope. - - - Defines a source document. - The URL that identifies the document. - The document language. This parameter can be . - The identity of the vendor for the document language. This parameter can be . - The type of the document. This parameter can be . - The object that represents the document. - - - Defines a field in a type or a global field. - The metadata type or method token. - The field name. - A bitwise combination of the field attributes. - The field signature. - The address types for addr1 and addr2. - The first address for the field specification. - The second address for the field specification. - The third address for the field specification. - - - Defines a single global variable. - The global variable name. - A bitwise combination of the global variable attributes. - The global variable signature. - The address types for addr1, addr2, and addr3. - The first address for the global variable specification. - The second address for the global variable specification. - The third address for the global variable specification. - - - Defines a single variable in the current lexical scope. - The local variable name. - A bitwise combination of the local variable attributes. - The local variable signature. - The address types for addr1, addr2, and addr3. - The first address for the local variable specification. - The second address for the local variable specification. - The third address for the local variable specification. - The start offset for the variable. If this parameter is zero, it is ignored and the variable is defined throughout the entire scope. If the parameter is nonzero, the variable falls within the offsets of the current scope. - The end offset for the variable. If this parameter is zero, it is ignored and the variable is defined throughout the entire scope. If the parameter is nonzero, the variable falls within the offsets of the current scope. - - - Defines a single parameter in the current method. The type of each parameter is taken from its position within the signature of the method. - The parameter name. - A bitwise combination of the parameter attributes. - The parameter signature. - The address types for addr1, addr2, and addr3. - The first address for the parameter specification. - The second address for the parameter specification. - The third address for the parameter specification. - - - Defines a group of sequence points within the current method. - The document object for which the sequence points are being defined. - The sequence point offsets measured from the beginning of methods. - The document lines for the sequence points. - The document positions for the sequence points. - The document end lines for the sequence points. - The document end positions for the sequence points. - - - Sets the metadata emitter interface to associate with a writer. - The metadata emitter interface. - The file name for which the debugging symbols are written. Some writers require a file name, and others do not. If a file name is specified for a writer that does not use file names, this parameter is ignored. - true indicates that this is a full rebuild; false indicates that this is an incremental compilation. - - - Opens a method to place symbol information into. - The metadata token for the method to be opened. - - - Opens a new namespace. - The name of the new namespace. - - - Opens a new lexical scope in the current method. - The offset, in bytes, from the beginning of the method to the first instruction in the lexical scope. - An opaque scope identifier that can be used with to define the start and end offsets of a scope at a later time. In this case, the offsets passed to and are ignored. A scope identifier is valid only in the current method. - - - Specifies the true start and end of a method within a source file. Use to specify the extent of a method, independent of the sequence points that exist within the method. - The document that contains the starting position. - The starting line number. - The starting column. - The document that contains the ending position. - The ending line number. - The ending column number. - - - Defines the offset range for the specified lexical scope. - The identifier of the lexical scope. - The byte offset of the beginning of the lexical scope. - The byte offset of the end of the lexical scope. - - - Defines an attribute when given the attribute name and the attribute value. - The metadata token for which the attribute is being defined. - The attribute name. - The attribute value. - - - Sets the underlying ISymUnmanagedWriter (the corresponding unmanaged interface) that a managed uses to emit symbols. - A pointer to code that represents the underlying writer. - - - Identifies the user-defined method as the entry point for the current module. - The metadata token for the method that is the user entry point. - - - Specifies that the given, fully qualified namespace name is used within the open lexical scope. - The fully qualified name of the namespace. - - - Specifies address types for local variables, parameters, and fields in the methods , , and of the interface. - - - A bit field. The addr1 parameter is the position where the field starts, and the addr2 parameter is the field length. - - - - A Microsoft intermediate language (MSIL) offset. The addr1 parameter is the MSIL local variable or parameter index. - - - - A native offset. The addr1 parameter is the offset from the start of the parent. - - - - A native register address. The addr1 parameter is the register in which the variable is stored. - - - - A register-relative address. The addr1 parameter is the low-order register, and the addr2 parameter is the high-order register. - - - - A register-relative address. The addr1 parameter is the register, and the addr2 parameter is the offset. - - - - A register-relative address. The addr1 parameter is the low-order register, the addr2 parameter is the stack register, and the addr3 parameter is the offset from the stack pointer to the high-order part of the value. - - - - A native Relevant Virtual Address (RVA). The addr1 parameter is the RVA in the module. - - - - A native section offset. The addr1 parameter is the section, and the addr2 parameter is the offset. - - - - A register-relative address. The addr1 parameter is the stack register, the addr2 parameter is the offset from the stack pointer to the low-order part of the value, and the addr3 parameter is the high-order register. - - - - Performs operations on instances that contain file or directory path information. These operations are performed in a cross-platform manner. - - - Provides a platform-specific alternate character used to separate directory levels in a path string that reflects a hierarchical file system organization. - - - - Changes the extension of a path string. - The path information to modify. The path cannot contain any of the characters defined in . - The new extension (with or without a leading period). Specify null to remove an existing extension from path. - The modified path information. On Windows-based desktop platforms, if path is null or an empty string (""), the path information is returned unmodified. If extension is null, the returned string contains the specified path with its extension removed. If path has no extension, and extension is not null, the returned path string contains extension appended to the end of path. - path contains one or more of the invalid characters defined in . - - - Combines an array of strings into a path. - An array of parts of the path. - The combined paths. - One of the strings in the array contains one or more of the invalid characters defined in . - One of the strings in the array is null. - - - Combines two strings into a path. - The first path to combine. - The second path to combine. - The combined paths. If one of the specified paths is a zero-length string, this method returns the other path. If path2 contains an absolute path, this method returns path2. - path1 or path2 contains one or more of the invalid characters defined in . - path1 or path2 is null. - - - Combines three strings into a path. - The first path to combine. - The second path to combine. - The third path to combine. - The combined paths. - path1, path2, or path3 contains one or more of the invalid characters defined in . - path1, path2, or path3 is null. - - - Combines four strings into a path. - The first path to combine. - The second path to combine. - The third path to combine. - The fourth path to combine. - The combined paths. - path1, path2, path3, or path4 contains one or more of the invalid characters defined in . - path1, path2, path3, or path4 is null. - - - Provides a platform-specific character used to separate directory levels in a path string that reflects a hierarchical file system organization. - - - - Returns the directory information for the specified path string. - The path of a file or directory. - Directory information for path, or null if path denotes a root directory or is null. Returns if path does not contain directory information. - The path parameter contains invalid characters, is empty, or contains only white spaces. - - In the [.NET for Windows Store apps](http://go.microsoft.com/fwlink/?LinkID=247912) or the [Portable Class Library](~/docs/standard/cross-platform/cross-platform-development-with-the-portable-class-library.md), catch the base class exception, , instead. - - The path parameter is longer than the system-defined maximum length. - - - Returns the extension of the specified path string. - The path string from which to get the extension. - The extension of the specified path (including the period "."), or null, or . If path is null, returns null. If path does not have extension information, returns . - path contains one or more of the invalid characters defined in . - - - Returns the file name and extension of the specified path string. - The path string from which to obtain the file name and extension. - The characters after the last directory character in path. If the last character of path is a directory or volume separator character, this method returns . If path is null, this method returns null. - path contains one or more of the invalid characters defined in . - - - Returns the file name of the specified path string without the extension. - The path of the file. - The string returned by , minus the last period (.) and all characters following it. - path contains one or more of the invalid characters defined in . - - - Returns the absolute path for the specified path string. - The file or directory for which to obtain absolute path information. - The fully qualified location of path, such as "C:\MyFile.txt". - path is a zero-length string, contains only white space, or contains one or more of the invalid characters defined in . -or- The system could not retrieve the absolute path. - The caller does not have the required permissions. - path is null. - path contains a colon (":") that is not part of a volume identifier (for example, "c:\"). - The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must be less than 248 characters, and file names must be less than 260 characters. - - - Gets an array containing the characters that are not allowed in file names. - An array containing the characters that are not allowed in file names. - - - Gets an array containing the characters that are not allowed in path names. - An array containing the characters that are not allowed in path names. - - - Gets the root directory information of the specified path. - The path from which to obtain root directory information. - The root directory of path, such as "C:\", or null if path is null, or an empty string if path does not contain root directory information. - path contains one or more of the invalid characters defined in . -or- was passed to path. - - - Returns a random folder name or file name. - A random folder name or file name. - - - Creates a uniquely named, zero-byte temporary file on disk and returns the full path of that file. - The full path of the temporary file. - An I/O error occurs, such as no unique temporary file name is available. - or - This method was unable to create a temporary file. - - - Returns the path of the current user's temporary folder. - The path to the temporary folder, ending with a backslash. - The caller does not have the required permissions. - - - Determines whether a path includes a file name extension. - The path to search for an extension. - true if the characters that follow the last directory separator (\\ or /) or volume separator (:) in the path include a period (.) followed by one or more characters; otherwise, false. - path contains one or more of the invalid characters defined in . - - - Provides a platform-specific array of characters that cannot be specified in path string arguments passed to members of the class. - - - - Gets a value indicating whether the specified path string contains a root. - The path to test. - true if path contains a root; otherwise, false. - path contains one or more of the invalid characters defined in . - - - A platform-specific separator character used to separate path strings in environment variables. - - - - Provides a platform-specific volume separator character. - - - - The exception that is thrown when a path or fully qualified file name is longer than the system-defined maximum length. - - - Initializes a new instance of the class with its HRESULT set to COR_E_PATHTOOLONG. - - - Initializes a new instance of the class with its message string set to message and its HRESULT set to COR_E_PATHTOOLONG. - A that describes the error. The content of message is intended to be understood by humans. The caller of this constructor is required to ensure that this string has been localized for the current system culture. - - - Initializes a new instance of the class with the specified serialization and context information. - The that holds the serialized object data about the exception being thrown. - The that contains contextual information about the source or destination. - - - Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. - A that describes the error. The content of message is intended to be understood by humans. The caller of this constructor is required to ensure that this string has been localized for the current system culture. - The exception that is the cause of the current exception. If the innerException parameter is not null, the current exception is raised in a catch block that handles the inner exception. - - - Exposes the client side of an anonymous pipe stream, which supports both synchronous and asynchronous read and write operations. - - - Initializes a new instance of the class with the specified string representation of the pipe handle. - A string that represents the pipe handle. - pipeHandleAsString is not a valid pipe handle. - - - Initializes a new instance of the class from the specified handle. - One of the enumeration values that determines the direction of the pipe. Anonymous pipes can only be in one direction, so direction cannot be set to . - A safe handle for the pipe that this object will encapsulate. - safePipeHandle is not a valid handle. - safePipeHandle is null. - direction is set to . - An I/O error, such as a disk error, has occurred. -or- The stream has been closed. - - - Initializes a new instance of the class with the specified pipe direction and a string representation of the pipe handle. - One of the enumeration values that determines the direction of the pipe. Anonymous pipes can only be in one direction, so direction cannot be set to . - A string that represents the pipe handle. - pipeHandleAsString is an invalid handle. - pipeHandleAsString is null. - direction is set to . - - - Sets the reading mode for the object. - The for the object. - The transmission mode is not valid. For anonymous pipes, only is supported. - The transmission mode is . - The connection is broken or another I/O error occurs. - The pipe is closed. - - - Gets the pipe transmission mode supported by the current pipe. - The supported by the current pipe. - - - Exposes a stream around an anonymous pipe, which supports both synchronous and asynchronous read and write operations. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with the specified pipe direction. - One of the enumeration values that determines the direction of the pipe. Anonymous pipes can only be in one direction, so direction cannot be set to . - direction is set to . - - - Initializes a new instance of the class with the specified pipe direction and inheritability mode. - One of the enumeration values that determines the direction of the pipe. Anonymous pipes can only be in one direction, so direction cannot be set to . - One of the enumeration values that determines whether the underlying handle can be inherited by child processes. Must be set to either or . - inheritability is not set to either or . - direction is set to . - - - Initializes a new instance of the class from the specified pipe handles. - One of the enumeration values that determines the direction of the pipe. Anonymous pipes can only be in one direction, so direction cannot be set to . - A safe handle for the pipe that this object will encapsulate. - A safe handle for the object. - serverSafePipeHandle or clientSafePipeHandle is an invalid handle. - serverSafePipeHandle or clientSafePipeHandle is null. - direction is set to . - An I/O error, such as a disk error, has occurred. -or- The stream has been closed. - - - Initializes a new instance of the class with the specified pipe direction, inheritability mode, and buffer size. - One of the enumeration values that determines the direction of the pipe. Anonymous pipes can only be in one direction, so direction cannot be set to . - One of the enumeration values that determines whether the underlying handle can be inherited by child processes. Must be set to either or . - The size of the buffer. This value must be greater than or equal to 0. - inheritability is not set to either or . -or- bufferSize is less than 0. - direction is set to . - - - Gets the safe handle for the object that is currently connected to the object. - A handle for the object that is currently connected to the object. - - - Closes the local copy of the object's handle. - - - Gets the connected object's handle as a string. - A string that represents the connected object's handle. - - - Sets the reading mode for the object. For anonymous pipes, transmission mode must be . - The reading mode for the object. - The transmission mode is not valid. For anonymous pipes, only is supported. - The property is set to , which is not supported for anonymous pipes. - The connection is broken or another I/O error occurs. - The pipe is closed. - - - Gets the pipe transmission mode that is supported by the current pipe. - The that is supported by the current pipe. - - - Exposes a around a named pipe, which supports both synchronous and asynchronous read and write operations. - - - Initializes a new instance of the class with the specified pipe name. - The name of the pipe. - pipeName is null. - pipeName is a zero-length string. - pipeName is set to "anonymous". - - - Initializes a new instance of the class with the specified pipe and server names. - The name of the remote computer to connect to, or "." to specify the local computer. - The name of the pipe. - pipeName or serverName is null. - pipeName or serverName is a zero-length string. - pipeName is set to "anonymous". - - - Initializes a new instance of the class with the specified pipe and server names, and the specified pipe direction. - The name of the remote computer to connect to, or "." to specify the local computer. - The name of the pipe. - One of the enumeration values that determines the direction of the pipe. - pipeName or serverName is null. - pipeName or serverName is a zero-length string. - pipeName is set to "anonymous". -or- direction is not a valid value. - - - Initializes a new instance of the class for the specified pipe handle with the specified pipe direction. - One of the enumeration values that determines the direction of the pipe. - true to indicate that the handle was opened asynchronously; otherwise, false. - true to indicate that the pipe is connected; otherwise, false. - A safe handle for the pipe that this object will encapsulate. - The stream has been closed. - safePipeHandle is not a valid handle. - safePipeHandle is null. - direction is not a valid value. - - - Initializes a new instance of the class with the specified pipe and server names, and the specified pipe direction and pipe options. - The name of the remote computer to connect to, or "." to specify the local computer. - The name of the pipe. - One of the enumeration values that determines the direction of the pipe. - One of the enumeration values that determines how to open or create the pipe. - pipeName or serverName is null. - pipeName or serverName is a zero-length string. - pipeName is set to "anonymous". -or- direction is not a valid value. -or- options is not a valid value. - - - Initializes a new instance of the class with the specified pipe and server names, and the specified pipe direction, pipe options, and security impersonation level. - The name of the remote computer to connect to, or "." to specify the local computer. - The name of the pipe. - One of the enumeration values that determines the direction of the pipe. - One of the enumeration values that determines how to open or create the pipe. - One of the enumeration values that determines the security impersonation level. - pipeName or serverName is null. - pipeName or serverName is a zero-length string. - pipeName is set to "anonymous". -or- direction is not a valid value. -or- options is not a valid value. -or- impersonationLevel is not a valid value. - - - Initializes a new instance of the class with the specified pipe and server names, and the specified pipe direction, pipe options, security impersonation level, and inheritability mode. - The name of the remote computer to connect to, or "." to specify the local computer. - The name of the pipe. - One of the enumeration values that determines the direction of the pipe. - One of the enumeration values that determines how to open or create the pipe. - One of the enumeration values that determines the security impersonation level. - One of the enumeration values that determines whether the underlying handle will be inheritable by child processes. - pipeName or serverName is null. - pipeName or serverName is a zero-length string. - pipeName is set to "anonymous". -or- direction is not a valid value. -or- options is not a valid value. -or- impersonationLevel is not a valid value. -or- inheritability is not a valid value. - - - Connects to a waiting server with an infinite time-out value. - The client is already connected. - - - Connects to a waiting server within the specified time-out period. - The number of milliseconds to wait for the server to respond before the connection times out. - Could not connect to the server within the specified timeout period. - timeout is less than 0 and not set to . - The client is already connected. - The server is connected to another client and the time-out period has expired. - - - Asynchronously connects to a waiting server with an infinite timeout period. - A task that represents the asynchronous connect operation. - - - Asynchronously connects to a waiting server within the specified timeout period. - The number of milliseconds to wait for the server to respond before the connection times out. - A task that represents the asynchronous connect operation. - - - Asynchronously connects to a waiting server and monitors cancellation requests. - The token to monitor for cancellation requests. The default value is . - A task that represents the asynchronous connect operation. - - - Asynchronously connects to a waiting server within the specified timeout period and monitors cancellation requests. - The number of milliseconds to wait for the server to respond before the connection times out. - The token to monitor for cancellation requests. The default value is . - A task that represents the asynchronous connect operation. - - - Gets the number of server instances that share the same pipe name. - The number of server instances that share the same pipe name. - The pipe handle has not been set. -or- The current object has not yet connected to a object. - The pipe is broken or an I/O error occurred. - The underlying pipe handle is closed. - - - Exposes a around a named pipe, supporting both synchronous and asynchronous read and write operations. - - - Initializes a new instance of the class with the specified pipe name. - The name of the pipe. - pipeName is null. - pipeName is a zero-length string. - pipeName is set to "anonymous". - pipeName contains a colon (":"). - The operating system is Windows Millennium Edition, Windows 98, or Windows 95, which are not supported. - The maximum number of server instances has been exceeded. - - - Initializes a new instance of the class with the specified pipe name, pipe direction, maximum number of server instances, transmission mode, pipe options, and recommended in and out buffer sizes. - The name of the pipe. - One of the enumeration values that determines the direction of the pipe. - The maximum number of server instances that share the same name. You can pass for this value. - One of the enumeration values that determines the transmission mode of the pipe. - One of the enumeration values that determines how to open or create the pipe. - A positive value greater than 0 that indicates the input buffer size. - A positive value greater than 0 that indicates the output buffer size. - pipeName is null. - pipeName is a zero-length string. - pipeName is set to "anonymous". -or- direction is not a valid value. -or- maxNumberofServerInstances is less than -1 or greater than 254 (-1 indicates ) -or- options is not a valid value. -or- inBufferSize is negative. - pipeName contains a colon (":"). - The operating system is Windows Millennium Edition, Windows 98, or Windows 95, which are not supported. - The maximum number of server instances has been exceeded. - - - Initializes a new instance of the class with the specified pipe name, pipe direction, maximum number of server instances, transmission mode, and pipe options. - The name of the pipe. - One of the enumeration values that determines the direction of the pipe. - The maximum number of server instances that share the same name. You can pass for this value. - One of the enumeration values that determines the transmission mode of the pipe. - One of the enumeration values that determines how to open or create the pipe. - pipeName is null. - pipeName is a zero-length string. - pipeName is set to "anonymous". -or- direction is not a valid value. -or- maxNumberofServerInstances is less than -1 or greater than 254 (-1 indicates ) -or- options is not a valid value. - pipeName contains a colon (":"). - The operating system is Windows Millennium Edition, Windows 98, or Windows 95, which are not supported. - The maximum number of server instances has been exceeded. - - - Initializes a new instance of the class from the specified pipe handle. - One of the enumeration values that determines the direction of the pipe. - true to indicate that the handle was opened asynchronously; otherwise, false. - true to indicate that the pipe is connected; otherwise, false. - A safe handle for the pipe that this object will encapsulate. - direction is not a valid value. - safePipeHandle is null. - safePipeHandle is an invalid handle. - safePipeHandle is not a valid pipe handle. -or- The maximum number of server instances has been exceeded. - - - Initializes a new instance of the class with the specified pipe name, pipe direction, and maximum number of server instances. - The name of the pipe. - One of the enumeration values that determines the direction of the pipe. - The maximum number of server instances that share the same name. You can pass for this value. - pipeName is null. - pipeName is a zero-length string. - pipeName is set to "anonymous". -or- direction is not a valid value. -or- A non-negative number is required. -or- maxNumberofServerInstances is less than -1 or greater than 254 (-1 indicates ) -or- or is required. -or- Access rights is limited to the , , and flags. - pipeName contains a colon (":"). - The operating system is Windows Millennium Edition, Windows 98, or Windows 95, which are not supported. - The maximum number of server instances has been exceeded. - - - Initializes a new instance of the class with the specified pipe name and pipe direction. - The name of the pipe. - One of the enumeration values that determines the direction of the pipe. - pipeName is null. - pipeName is a zero-length string. - pipeName is set to "anonymous". -or- direction is not a valid value. - pipeName contains a colon (":"). - The operating system is Windows Millennium Edition, Windows 98, or Windows 95, which are not supported. - The maximum number of server instances has been exceeded. - - - Initializes a new instance of the class with the specified pipe name, pipe direction, maximum number of server instances, and transmission mode. - The name of the pipe. - One of the enumeration values that determines the direction of the pipe. - The maximum number of server instances that share the same name. You can pass for this value. - One of the enumeration values that determines the transmission mode of the pipe. - pipeName is null. - pipeName is a zero-length string. - pipeName is set to "anonymous". -or- direction is not a valid value. -or- maxNumberofServerInstances is less than -1 or greater than 254 (-1 indicates ) - pipeName contains a colon (":"). - The operating system is Windows Millennium Edition, Windows 98, or Windows 95, which are not supported. - The maximum number of server instances has been exceeded. - - - Begins an asynchronous operation to wait for a client to connect. - The method to call when a client connects to the object. - A user-provided object that distinguishes this particular asynchronous request from other requests. - An object that references the asynchronous request. - The pipe was not opened asynchronously. -or- A pipe connection has already been established. -or- The pipe handle has not been set. - The pipe connection has been broken. - The pipe is closed. - - - Disconnects the current connection. - No pipe connections have been made yet. -or- The connected pipe has already disconnected. -or- The pipe handle has not been set. - The pipe is closed. - - - Ends an asynchronous operation to wait for a client to connect. - The pending asynchronous request. - asyncResult is null. - The pipe was not opened asynchronously. -or- The pipe handle has not been set. - The pipe connection has been broken. - The pipe is closed. - - - Gets the user name of the client on the other end of the pipe. - The user name of the client on the other end of the pipe. - No pipe connections have been made yet. -or- The connected pipe has already disconnected. -or- The pipe handle has not been set. - The pipe is closed. - The pipe connection has been broken. -or- The user name of the client is longer than 19 characters. - - - Represents the maximum number of server instances that the system resources allow. - - - - Calls a delegate while impersonating the client. - The delegate that specifies a method to call. - No pipe connections have been made yet. -or- The connected pipe has already disconnected. -or- The pipe handle has not been set. - The pipe is closed. - The pipe connection has been broken. -or- An I/O error occurred. - - - Waits for a client to connect to this object. - A pipe connection has already been established. -or- The pipe handle has not been set. - The pipe is closed. - The pipe connection has been broken. - - - Asynchronously waits for a client to connect to this object. - A task that represents the asynchronous wait operation. - - - Asynchronously waits for a client to connect to this object and monitors cancellation requests. - The token to monitor for cancellation requests. - A task that represents the asynchronous wait operation. - - - Specifies the direction of the pipe. - - - Specifies that the pipe direction is in. - - - - Specifies that the pipe direction is two-way. - - - - Specifies that the pipe direction is out. - - - - Provides options for creating a object. This enumeration has a attribute that allows a bitwise combination of its member values. - - - Indicates that the pipe can be used for asynchronous reading and writing. - - - - Indicates that there are no additional parameters. - - - - Indicates that the system should write through any intermediate cache and go directly to the pipe. - - - - Exposes a object around a pipe, which supports both anonymous and named pipes. - - - Initializes a new instance of the class using the specified value and buffer size. - One of the values that indicates the direction of the pipe object. - A positive value greater than or equal to 0 that indicates the buffer size. - direction is not a valid value. -or- bufferSize is less than 0. - - - Initializes a new instance of the class using the specified , , and buffer size. - One of the values that indicates the direction of the pipe object. - One of the values that indicates the transmission mode of the pipe object. - A positive value greater than or equal to 0 that indicates the buffer size. - direction is not a valid value. -or- transmissionMode is not a valid value. -or- bufferSize is less than 0. - - - Begins an asynchronous read operation. - The buffer to read data into. - The byte offset in buffer at which to begin reading. - The maximum number of bytes to read. - The method to call when the asynchronous read operation is completed. - A user-provided object that distinguishes this particular asynchronous read request from other requests. - An object that references the asynchronous read. - buffer is null. - offset is less than 0. -or- count is less than 0. - count is greater than the number of bytes available in buffer. - The pipe is closed. - The pipe does not support read operations. - The pipe is disconnected, waiting to connect, or the handle has not been set. - The pipe is broken or another I/O error occurred. - - - Begins an asynchronous write operation. - The buffer that contains the data to write to the current stream. - The zero-based byte offset in buffer at which to begin copying bytes to the current stream. - The maximum number of bytes to write. - The method to call when the asynchronous write operation is completed. - A user-provided object that distinguishes this particular asynchronous write request from other requests. - An object that references the asynchronous write operation. - buffer is null. - offset is less than 0. -or- count is less than 0. - count is greater than the number of bytes available in buffer. - The pipe is closed. - The pipe does not support write operations. - The pipe is disconnected, waiting to connect, or the handle has not been set. - The pipe is broken or another I/O error occurred. - - - Gets a value indicating whether the current stream supports read operations. - true if the stream supports read operations; otherwise, false. - - - Gets a value indicating whether the current stream supports seek operations. - false in all cases. - - - Gets a value indicating whether the current stream supports write operations. - true if the stream supports write operations; otherwise, false. - - - Verifies that the pipe is in a proper state for getting or setting properties. - - - Verifies that the pipe is in a connected state for read operations. - - - Verifies that the pipe is in a connected state for write operations. - - - Releases the unmanaged resources used by the class and optionally releases the managed resources. - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - Ends a pending asynchronous read request. - The reference to the pending asynchronous request. - The number of bytes that were read. A return value of 0 indicates the end of the stream (the pipe has been closed). - asyncResult is null. - asyncResult did not originate from a method on the current stream. - The stream is closed or an internal error has occurred. - - - Ends a pending asynchronous write request. - The reference to the pending asynchronous request. - asyncResult is null. - asyncResult did not originate from a method on the current stream. - The stream is closed or an internal error has occurred. - - - Clears the buffer for the current stream and causes any buffered data to be written to the underlying device. - The pipe is closed. - The pipe does not support write operations. - The pipe is broken or another I/O error occurred. - - - Gets the size, in bytes, of the inbound buffer for a pipe. - An integer value that represents the inbound buffer size, in bytes. - The stream is unreadable. - The pipe is waiting to connect. - The pipe is broken or another I/O error occurred. - - - Initializes a object from the specified object. - The object of the pipe to initialize. - true to expose the handle; otherwise, false. - true to indicate that the handle was opened asynchronously; otherwise, false. - A handle cannot be bound to the pipe. - - - Gets a value indicating whether a object was opened asynchronously or synchronously. - true if the object was opened asynchronously; otherwise, false. - - - Gets or sets a value indicating whether a object is connected. - true if the object is connected; otherwise, false. - - - Gets a value indicating whether a handle to a object is exposed. - true if a handle to the object is exposed; otherwise, false. - - - Gets a value indicating whether there is more data in the message returned from the most recent read operation. - true if there are no more characters to read in the message; otherwise, false. - The pipe is not connected. -or- The pipe handle has not been set. -or- The pipe's property value is not . - The pipe is closed. - - - Gets the length of a stream, in bytes. - 0 in all cases. - Always thrown. - - - Gets the size, in bytes, of the outbound buffer for a pipe. - The outbound buffer size, in bytes. - The stream is unwriteable. - The pipe is waiting to connect. - The pipe is broken or another I/O error occurred. - - - Gets or sets the current position of the current stream. - 0 in all cases. - Always thrown. - - - Reads a block of bytes from a stream and writes the data to a specified buffer. - When this method returns, contains the specified byte array with the values between offset and (offset + count - 1) replaced by the bytes read from the current source. - The byte offset in the buffer array at which the bytes that are read will be placed. - The maximum number of bytes to read. - The total number of bytes that are read into buffer. This might be less than the number of bytes requested if that number of bytes is not currently available, or 0 if the end of the stream is reached. - buffer is null. - offset is less than 0. -or- count is less than 0. - count is greater than the number of bytes available in buffer. - The pipe is closed. - The pipe does not support read operations. - The pipe is disconnected, waiting to connect, or the handle has not been set. - Any I/O error occurred. - - - Reads a byte from a pipe. - The byte, cast to , or -1 indicates the end of the stream (the pipe has been closed). - The pipe is closed. - The pipe does not support read operations. - The pipe is disconnected, waiting to connect, or the handle has not been set. - Any I/O error occurred. - - - Gets or sets the reading mode for a object. - One of the values that indicates how the object reads from the pipe. - The supplied value is not a valid value. - The supplied value is not a supported value for this pipe stream. - The handle has not been set. -or- The pipe is waiting to connect with a named client. - The pipe is broken or an I/O error occurred with a named client. - - - Gets the safe handle for the local end of the pipe that the current object encapsulates. - A object for the pipe that is encapsulated by the current object. - The pipe handle has not been set. - The pipe is closed. - - - Sets the current position of the current stream to the specified value. - The point, relative to origin, to begin seeking from. - Specifies the beginning, the end, or the current position as a reference point for offset, using a value of type . - The new position in the stream. - - - Sets the length of the current stream to the specified value. - The new length of the stream. - - - Gets the pipe transmission mode supported by the current pipe. - One of the values that indicates the transmission mode supported by the current pipe. - The pipe is closed. - The handle has not been set. -or- The pipe is waiting to connect in an anonymous client/server operation or with a named client. - The pipe is broken or another I/O error occurred. - - - Waits for the other end of the pipe to read all sent bytes. - The pipe is closed. - The pipe does not support write operations. - The pipe is broken or another I/O error occurred. - - - Writes a block of bytes to the current stream using data from a buffer. - The buffer that contains data to write to the pipe. - The zero-based byte offset in buffer at which to begin copying bytes to the current stream. - The maximum number of bytes to write to the current stream. - buffer is null. - offset is less than 0. -or- count is less than 0. - count is greater than the number of bytes available in buffer. - The pipe is closed. - The pipe does not support write operations. - The pipe is broken or another I/O error occurred. - - - Writes a byte to the current stream. - The byte to write to the stream. - The pipe is closed. - The pipe does not support write operations. - The pipe is disconnected, waiting to connect, or the handle has not been set. - The pipe is broken or another I/O error occurred. - - - Represents the method to call as the client. - - - Specifies the transmission mode of the pipe. - - - Indicates that data in the pipe is transmitted and read as a stream of bytes. - - - - Indicates that data in the pipe is transmitted and read as a stream of messages. - - - - Provides data for the event. - - - Initializes a new instance of the class. - One of the values. - The name of the affected file or directory. - The name of the affected file or directory. - The old name of the affected file or directory. - - - Gets the previous fully qualified path of the affected file or directory. - The previous fully qualified path of the affected file or directory. - - - Gets the old name of the affected file or directory. - The previous name of the affected file or directory. - - - Represents the method that will handle the event of a class. - The source of the event. - The that contains the event data. - - - Specifies whether to search the current directory, or the current directory and all subdirectories. - - - Includes the current directory and all its subdirectories in a search operation. This option includes reparse points such as mounted drives and symbolic links in the search. - - - - Includes only the current directory in a search operation. - - - - Specifies the position in a stream to use for seeking. - - - Specifies the beginning of a stream. - - - - Specifies the current position within a stream. - - - - Specifies the end of a stream. - - - - Provides a generic view of a sequence of bytes. This is an abstract class. - - - Initializes a new instance of the class. - - - Begins an asynchronous read operation. (Consider using instead.) - The buffer to read the data into. - The byte offset in buffer at which to begin writing data read from the stream. - The maximum number of bytes to read. - An optional asynchronous callback, to be called when the read is complete. - A user-provided object that distinguishes this particular asynchronous read request from other requests. - An that represents the asynchronous read, which could still be pending. - Attempted an asynchronous read past the end of the stream, or a disk error occurs. - One or more of the arguments is invalid. - Methods were called after the stream was closed. - The current Stream implementation does not support the read operation. - - - Begins an asynchronous write operation. (Consider using instead.) - The buffer to write data from. - The byte offset in buffer from which to begin writing. - The maximum number of bytes to write. - An optional asynchronous callback, to be called when the write is complete. - A user-provided object that distinguishes this particular asynchronous write request from other requests. - An IAsyncResult that represents the asynchronous write, which could still be pending. - Attempted an asynchronous write past the end of the stream, or a disk error occurs. - One or more of the arguments is invalid. - Methods were called after the stream was closed. - The current Stream implementation does not support the write operation. - - - When overridden in a derived class, gets a value indicating whether the current stream supports reading. - true if the stream supports reading; otherwise, false. - - - When overridden in a derived class, gets a value indicating whether the current stream supports seeking. - true if the stream supports seeking; otherwise, false. - - - Gets a value that determines whether the current stream can time out. - A value that determines whether the current stream can time out. - - - When overridden in a derived class, gets a value indicating whether the current stream supports writing. - true if the stream supports writing; otherwise, false. - - - Closes the current stream and releases any resources (such as sockets and file handles) associated with the current stream. Instead of calling this method, ensure that the stream is properly disposed. - - - Reads the bytes from the current stream and writes them to another stream, using a specified buffer size. - The stream to which the contents of the current stream will be copied. - The size of the buffer. This value must be greater than zero. The default size is 81920. - destination is null. - bufferSize is negative or zero. - The current stream does not support reading. -or- destination does not support writing. - Either the current stream or destination were closed before the method was called. - An I/O error occurred. - - - Reads the bytes from the current stream and writes them to another stream. - The stream to which the contents of the current stream will be copied. - destination is null. - The current stream does not support reading. -or- destination does not support writing. - Either the current stream or destination were closed before the method was called. - An I/O error occurred. - - - Asynchronously reads the bytes from the current stream and writes them to another stream. - The stream to which the contents of the current stream will be copied. - A task that represents the asynchronous copy operation. - destination is null. - Either the current stream or the destination stream is disposed. - The current stream does not support reading, or the destination stream does not support writing. - - - Asynchronously reads the bytes from the current stream and writes them to another stream, using a specified buffer size. - The stream to which the contents of the current stream will be copied. - The size, in bytes, of the buffer. This value must be greater than zero. The default size is 81920. - A task that represents the asynchronous copy operation. - destination is null. - buffersize is negative or zero. - Either the current stream or the destination stream is disposed. - The current stream does not support reading, or the destination stream does not support writing. - - - Asynchronously reads the bytes from the current stream and writes them to another stream, using a specified buffer size and cancellation token. - The stream to which the contents of the current stream will be copied. - The size, in bytes, of the buffer. This value must be greater than zero. The default size is 81920. - The token to monitor for cancellation requests. The default value is . - A task that represents the asynchronous copy operation. - destination is null. - buffersize is negative or zero. - Either the current stream or the destination stream is disposed. - The current stream does not support reading, or the destination stream does not support writing. - - - Allocates a object. - A reference to the allocated WaitHandle. - - - Releases all resources used by the . - - - Releases the unmanaged resources used by the and optionally releases the managed resources. - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - Waits for the pending asynchronous read to complete. (Consider using instead.) - The reference to the pending asynchronous request to finish. - The number of bytes read from the stream, between zero (0) and the number of bytes you requested. Streams return zero (0) only at the end of the stream, otherwise, they should block until at least one byte is available. - asyncResult is null. - A handle to the pending read operation is not available. -or- The pending operation does not support reading. - asyncResult did not originate from a method on the current stream. - The stream is closed or an internal error has occurred. - - - Ends an asynchronous write operation. (Consider using instead.) - A reference to the outstanding asynchronous I/O request. - asyncResult is null. - A handle to the pending write operation is not available. -or- The pending operation does not support writing. - asyncResult did not originate from a method on the current stream. - The stream is closed or an internal error has occurred. - - - When overridden in a derived class, clears all buffers for this stream and causes any buffered data to be written to the underlying device. - An I/O error occurs. - - - Asynchronously clears all buffers for this stream and causes any buffered data to be written to the underlying device. - A task that represents the asynchronous flush operation. - The stream has been disposed. - - - Asynchronously clears all buffers for this stream, causes any buffered data to be written to the underlying device, and monitors cancellation requests. - The token to monitor for cancellation requests. The default value is . - A task that represents the asynchronous flush operation. - The stream has been disposed. - - - When overridden in a derived class, gets the length in bytes of the stream. - A long value representing the length of the stream in bytes. - A class derived from Stream does not support seeking. - Methods were called after the stream was closed. - - - A Stream with no backing store. - - - - Provides support for a . - - - When overridden in a derived class, gets or sets the position within the current stream. - The current position within the stream. - An I/O error occurs. - The stream does not support seeking. - Methods were called after the stream was closed. - - - When overridden in a derived class, reads a sequence of bytes from the current stream and advances the position within the stream by the number of bytes read. - An array of bytes. When this method returns, the buffer contains the specified byte array with the values between offset and (offset + count - 1) replaced by the bytes read from the current source. - The zero-based byte offset in buffer at which to begin storing the data read from the current stream. - The maximum number of bytes to be read from the current stream. - The total number of bytes read into the buffer. This can be less than the number of bytes requested if that many bytes are not currently available, or zero (0) if the end of the stream has been reached. - The sum of offset and count is larger than the buffer length. - buffer is null. - offset or count is negative. - An I/O error occurs. - The stream does not support reading. - Methods were called after the stream was closed. - - - Asynchronously reads a sequence of bytes from the current stream and advances the position within the stream by the number of bytes read. - The buffer to write the data into. - The byte offset in buffer at which to begin writing data from the stream. - The maximum number of bytes to read. - A task that represents the asynchronous read operation. The value of the TResult parameter contains the total number of bytes read into the buffer. The result value can be less than the number of bytes requested if the number of bytes currently available is less than the requested number, or it can be 0 (zero) if the end of the stream has been reached. - buffer is null. - offset or count is negative. - The sum of offset and count is larger than the buffer length. - The stream does not support reading. - The stream has been disposed. - The stream is currently in use by a previous read operation. - - - Asynchronously reads a sequence of bytes from the current stream, advances the position within the stream by the number of bytes read, and monitors cancellation requests. - The buffer to write the data into. - The byte offset in buffer at which to begin writing data from the stream. - The maximum number of bytes to read. - The token to monitor for cancellation requests. The default value is . - A task that represents the asynchronous read operation. The value of the TResult parameter contains the total number of bytes read into the buffer. The result value can be less than the number of bytes requested if the number of bytes currently available is less than the requested number, or it can be 0 (zero) if the end of the stream has been reached. - buffer is null. - offset or count is negative. - The sum of offset and count is larger than the buffer length. - The stream does not support reading. - The stream has been disposed. - The stream is currently in use by a previous read operation. - - - Reads a byte from the stream and advances the position within the stream by one byte, or returns -1 if at the end of the stream. - The unsigned byte cast to an Int32, or -1 if at the end of the stream. - The stream does not support reading. - Methods were called after the stream was closed. - - - Gets or sets a value, in miliseconds, that determines how long the stream will attempt to read before timing out. - A value, in miliseconds, that determines how long the stream will attempt to read before timing out. - The method always throws an . - - - When overridden in a derived class, sets the position within the current stream. - A byte offset relative to the origin parameter. - A value of type indicating the reference point used to obtain the new position. - The new position within the current stream. - An I/O error occurs. - The stream does not support seeking, such as if the stream is constructed from a pipe or console output. - Methods were called after the stream was closed. - - - When overridden in a derived class, sets the length of the current stream. - The desired length of the current stream in bytes. - An I/O error occurs. - The stream does not support both writing and seeking, such as if the stream is constructed from a pipe or console output. - Methods were called after the stream was closed. - - - Creates a thread-safe (synchronized) wrapper around the specified object. - The object to synchronize. - A thread-safe object. - stream is null. - - - When overridden in a derived class, writes a sequence of bytes to the current stream and advances the current position within this stream by the number of bytes written. - An array of bytes. This method copies count bytes from buffer to the current stream. - The zero-based byte offset in buffer at which to begin copying bytes to the current stream. - The number of bytes to be written to the current stream. - The sum of offset and count is greater than the buffer length. - buffer is null. - offset or count is negative. - An I/O error occured, such as the specified file cannot be found. - The stream does not support writing. - was called after the stream was closed. - - - Asynchronously writes a sequence of bytes to the current stream and advances the current position within this stream by the number of bytes written. - The buffer to write data from. - The zero-based byte offset in buffer from which to begin copying bytes to the stream. - The maximum number of bytes to write. - A task that represents the asynchronous write operation. - buffer is null. - offset or count is negative. - The sum of offset and count is larger than the buffer length. - The stream does not support writing. - The stream has been disposed. - The stream is currently in use by a previous write operation. - - - Asynchronously writes a sequence of bytes to the current stream, advances the current position within this stream by the number of bytes written, and monitors cancellation requests. - The buffer to write data from. - The zero-based byte offset in buffer from which to begin copying bytes to the stream. - The maximum number of bytes to write. - The token to monitor for cancellation requests. The default value is . - A task that represents the asynchronous write operation. - buffer is null. - offset or count is negative. - The sum of offset and count is larger than the buffer length. - The stream does not support writing. - The stream has been disposed. - The stream is currently in use by a previous write operation. - - - Writes a byte to the current position in the stream and advances the position within the stream by one byte. - The byte to write to the stream. - An I/O error occurs. - The stream does not support writing, or the stream is already closed. - Methods were called after the stream was closed. - - - Gets or sets a value, in miliseconds, that determines how long the stream will attempt to write before timing out. - A value, in miliseconds, that determines how long the stream will attempt to write before timing out. - The method always throws an . - - - Implements a that reads characters from a byte stream in a particular encoding. - - - Initializes a new instance of the class for the specified stream. - The stream to be read. - stream does not support reading. - stream is null. - - - Initializes a new instance of the class for the specified file name. - The complete file path to be read. - path is an empty string (""). - path is null. - The file cannot be found. - The specified path is invalid, such as being on an unmapped drive. - path includes an incorrect or invalid syntax for file name, directory name, or volume label. - - - Initializes a new instance of the class for the specified stream, with the specified byte order mark detection option. - The stream to be read. - Indicates whether to look for byte order marks at the beginning of the file. - stream does not support reading. - stream is null. - - - Initializes a new instance of the class for the specified stream, with the specified character encoding. - The stream to be read. - The character encoding to use. - stream does not support reading. - stream or encoding is null. - - - Initializes a new instance of the class for the specified file name, with the specified byte order mark detection option. - The complete file path to be read. - Indicates whether to look for byte order marks at the beginning of the file. - path is an empty string (""). - path is null. - The file cannot be found. - The specified path is invalid, such as being on an unmapped drive. - path includes an incorrect or invalid syntax for file name, directory name, or volume label. - - - Initializes a new instance of the class for the specified file name, with the specified character encoding. - The complete file path to be read. - The character encoding to use. - path is an empty string (""). - path or encoding is null. - The file cannot be found. - The specified path is invalid, such as being on an unmapped drive. - path includes an incorrect or invalid syntax for file name, directory name, or volume label. - - - Initializes a new instance of the class for the specified stream, with the specified character encoding and byte order mark detection option. - The stream to be read. - The character encoding to use. - Indicates whether to look for byte order marks at the beginning of the file. - stream does not support reading. - stream or encoding is null. - - - Initializes a new instance of the class for the specified file name, with the specified character encoding and byte order mark detection option. - The complete file path to be read. - The character encoding to use. - Indicates whether to look for byte order marks at the beginning of the file. - path is an empty string (""). - path or encoding is null. - The file cannot be found. - The specified path is invalid, such as being on an unmapped drive. - path includes an incorrect or invalid syntax for file name, directory name, or volume label. - - - Initializes a new instance of the class for the specified stream, with the specified character encoding, byte order mark detection option, and buffer size. - The stream to be read. - The character encoding to use. - Indicates whether to look for byte order marks at the beginning of the file. - The minimum buffer size. - The stream does not support reading. - stream or encoding is null. - bufferSize is less than or equal to zero. - - - Initializes a new instance of the class for the specified file name, with the specified character encoding, byte order mark detection option, and buffer size. - The complete file path to be read. - The character encoding to use. - Indicates whether to look for byte order marks at the beginning of the file. - The minimum buffer size, in number of 16-bit characters. - path is an empty string (""). - path or encoding is null. - The file cannot be found. - The specified path is invalid, such as being on an unmapped drive. - path includes an incorrect or invalid syntax for file name, directory name, or volume label. - buffersize is less than or equal to zero. - - - Initializes a new instance of the class for the specified stream based on the specified character encoding, byte order mark detection option, and buffer size, and optionally leaves the stream open. - The stream to read. - The character encoding to use. - true to look for byte order marks at the beginning of the file; otherwise, false. - The minimum buffer size. - true to leave the stream open after the object is disposed; otherwise, false. - - - Returns the underlying stream. - The underlying stream. - - - Closes the object and the underlying stream, and releases any system resources associated with the reader. - - - Gets the current character encoding that the current object is using. - The current character encoding used by the current reader. The value can be different after the first call to any method of , since encoding autodetection is not done until the first call to a method. - - - Clears the internal buffer. - - - Closes the underlying stream, releases the unmanaged resources used by the , and optionally releases the managed resources. - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - Gets a value that indicates whether the current stream position is at the end of the stream. - true if the current stream position is at the end of the stream; otherwise false. - The underlying stream has been disposed. - - - A object around an empty stream. - - - - Returns the next available character but does not consume it. - An integer representing the next character to be read, or -1 if there are no characters to be read or if the stream does not support seeking. - An I/O error occurs. - - - Reads the next character from the input stream and advances the character position by one character. - The next character from the input stream represented as an object, or -1 if no more characters are available. - An I/O error occurs. - - - Reads a specified maximum of characters from the current stream into a buffer, beginning at the specified index. - When this method returns, contains the specified character array with the values between index and (index + count - 1) replaced by the characters read from the current source. - The index of buffer at which to begin writing. - The maximum number of characters to read. - The number of characters that have been read, or 0 if at the end of the stream and no data was read. The number will be less than or equal to the count parameter, depending on whether the data is available within the stream. - The buffer length minus index is less than count. - buffer is null. - index or count is negative. - An I/O error occurs, such as the stream is closed. - - - Reads a specified maximum number of characters from the current stream asynchronously and writes the data to a buffer, beginning at the specified index. - When this method returns, contains the specified character array with the values between index and (index + count - 1) replaced by the characters read from the current source. - The position in buffer at which to begin writing. - The maximum number of characters to read. If the end of the stream is reached before the specified number of characters is written into the buffer, the current method returns. - A task that represents the asynchronous read operation. The value of the TResult parameter contains the total number of characters read into the buffer. The result value can be less than the number of characters requested if the number of characters currently available is less than the requested number, or it can be 0 (zero) if the end of the stream has been reached. - buffer is null. - index or count is negative. - The sum of index and count is larger than the buffer length. - The stream has been disposed. - The reader is currently in use by a previous read operation. - - - Reads a specified maximum number of characters from the current stream and writes the data to a buffer, beginning at the specified index. - When this method returns, contains the specified character array with the values between index and (index + count - 1) replaced by the characters read from the current source. - The position in buffer at which to begin writing. - The maximum number of characters to read. - The number of characters that have been read. The number will be less than or equal to count, depending on whether all input characters have been read. - buffer is null. - The buffer length minus index is less than count. - index or count is negative. - The is closed. - An I/O error occurred. - - - Reads a specified maximum number of characters from the current stream asynchronously and writes the data to a buffer, beginning at the specified index. - When this method returns, contains the specified character array with the values between index and (index + count - 1) replaced by the characters read from the current source. - The position in buffer at which to begin writing. - The maximum number of characters to read. If the end of the stream is reached before the specified number of characters is written into the buffer, the method returns. - A task that represents the asynchronous read operation. The value of the TResult parameter contains the total number of characters read into the buffer. The result value can be less than the number of characters requested if the number of characters currently available is less than the requested number, or it can be 0 (zero) if the end of the stream has been reached. - buffer is null. - index or count is negative. - The sum of index and count is larger than the buffer length. - The stream has been disposed. - The reader is currently in use by a previous read operation. - - - Reads a line of characters from the current stream and returns the data as a string. - The next line from the input stream, or null if the end of the input stream is reached. - There is insufficient memory to allocate a buffer for the returned string. - An I/O error occurs. - - - Reads a line of characters asynchronously from the current stream and returns the data as a string. - A task that represents the asynchronous read operation. The value of the TResult parameter contains the next line from the stream, or is null if all the characters have been read. - The number of characters in the next line is larger than . - The stream has been disposed. - The reader is currently in use by a previous read operation. - - - Reads all characters from the current position to the end of the stream. - The rest of the stream as a string, from the current position to the end. If the current position is at the end of the stream, returns an empty string (""). - There is insufficient memory to allocate a buffer for the returned string. - An I/O error occurs. - - - Reads all characters from the current position to the end of the stream asynchronously and returns them as one string. - A task that represents the asynchronous read operation. The value of the TResult parameter contains a string with the characters from the current position to the end of the stream. - The number of characters is larger than . - The stream has been disposed. - The reader is currently in use by a previous read operation. - - - Implements a for writing characters to a stream in a particular encoding. - - - Initializes a new instance of the class for the specified stream by using UTF-8 encoding and the default buffer size. - The stream to write to. - stream is not writable. - stream is null. - - - Initializes a new instance of the class for the specified file by using the default encoding and buffer size. - The complete file path to write to. path can be a file name. - Access is denied. - path is an empty string (""). -or- path contains the name of a system device (com1, com2, and so on). - path is null. - The specified path is invalid (for example, it is on an unmapped drive). - The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must not exceed 248 characters, and file names must not exceed 260 characters. - path includes an incorrect or invalid syntax for file name, directory name, or volume label syntax. - The caller does not have the required permission. - - - Initializes a new instance of the class for the specified stream by using the specified encoding and the default buffer size. - The stream to write to. - The character encoding to use. - stream or encoding is null. - stream is not writable. - - - Initializes a new instance of the class for the specified file by using the default encoding and buffer size. If the file exists, it can be either overwritten or appended to. If the file does not exist, this constructor creates a new file. - The complete file path to write to. - true to append data to the file; false to overwrite the file. If the specified file does not exist, this parameter has no effect, and the constructor creates a new file. - Access is denied. - path is empty. -or- path contains the name of a system device (com1, com2, and so on). - path is null. - The specified path is invalid (for example, it is on an unmapped drive). - path includes an incorrect or invalid syntax for file name, directory name, or volume label syntax. - The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must not exceed 248 characters, and file names must not exceed 260 characters. - The caller does not have the required permission. - - - Initializes a new instance of the class for the specified stream by using the specified encoding and buffer size. - The stream to write to. - The character encoding to use. - The buffer size, in bytes. - stream or encoding is null. - bufferSize is negative. - stream is not writable. - - - Initializes a new instance of the class for the specified file by using the specified encoding and default buffer size. If the file exists, it can be either overwritten or appended to. If the file does not exist, this constructor creates a new file. - The complete file path to write to. - true to append data to the file; false to overwrite the file. If the specified file does not exist, this parameter has no effect, and the constructor creates a new file. - The character encoding to use. - Access is denied. - path is empty. -or- path contains the name of a system device (com1, com2, and so on). - path is null. - The specified path is invalid (for example, it is on an unmapped drive). - path includes an incorrect or invalid syntax for file name, directory name, or volume label syntax. - The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must not exceed 248 characters, and file names must not exceed 260 characters. - The caller does not have the required permission. - - - Initializes a new instance of the class for the specified stream by using the specified encoding and buffer size, and optionally leaves the stream open. - The stream to write to. - The character encoding to use. - The buffer size, in bytes. - true to leave the stream open after the object is disposed; otherwise, false. - stream or encoding is null. - bufferSize is negative. - stream is not writable. - - - Initializes a new instance of the class for the specified file on the specified path, using the specified encoding and buffer size. If the file exists, it can be either overwritten or appended to. If the file does not exist, this constructor creates a new file. - The complete file path to write to. - true to append data to the file; false to overwrite the file. If the specified file does not exist, this parameter has no effect, and the constructor creates a new file. - The character encoding to use. - The buffer size, in bytes. - path is an empty string (""). -or- path contains the name of a system device (com1, com2, and so on). - path or encoding is null. - bufferSize is negative. - path includes an incorrect or invalid syntax for file name, directory name, or volume label syntax. - The caller does not have the required permission. - Access is denied. - The specified path is invalid (for example, it is on an unmapped drive). - The specified path, file name, or both exceed the system-defined maximum length. For example, on Windows-based platforms, paths must not exceed 248 characters, and file names must not exceed 260 characters. - - - Gets or sets a value indicating whether the will flush its buffer to the underlying stream after every call to . - true to force to flush its buffer; otherwise, false. - - - Gets the underlying stream that interfaces with a backing store. - The stream this StreamWriter is writing to. - - - Closes the current StreamWriter object and the underlying stream. - The current encoding does not support displaying half of a Unicode surrogate pair. - - - Releases the unmanaged resources used by the and optionally releases the managed resources. - true to release both managed and unmanaged resources; false to release only unmanaged resources. - The current encoding does not support displaying half of a Unicode surrogate pair. - - - Gets the in which the output is written. - The specified in the constructor for the current instance, or if an encoding was not specified. - - - Clears all buffers for the current writer and causes any buffered data to be written to the underlying stream. - The current writer is closed. - An I/O error has occurred. - The current encoding does not support displaying half of a Unicode surrogate pair. - - - Clears all buffers for this stream asynchronously and causes any buffered data to be written to the underlying device. - A task that represents the asynchronous flush operation. - The stream has been disposed. - - - Provides a StreamWriter with no backing store that can be written to, but not read from. - - - - Writes a character to the stream. - The character to write to the stream. - An I/O error occurs. - is true or the buffer is full, and current writer is closed. - is true or the buffer is full, and the contents of the buffer cannot be written to the underlying fixed size stream because the is at the end the stream. - - - Writes a character array to the stream. - A character array containing the data to write. If buffer is null, nothing is written. - An I/O error occurs. - is true or the buffer is full, and current writer is closed. - is true or the buffer is full, and the contents of the buffer cannot be written to the underlying fixed size stream because the is at the end the stream. - - - Writes a string to the stream. - The string to write to the stream. If value is null, nothing is written. - is true or the buffer is full, and current writer is closed. - is true or the buffer is full, and the contents of the buffer cannot be written to the underlying fixed size stream because the is at the end the stream. - An I/O error occurs. - - - Writes a subarray of characters to the stream. - A character array that contains the data to write. - The character position in the buffer at which to start reading data. - The maximum number of characters to write. - buffer is null. - The buffer length minus index is less than count. - index or count is negative. - An I/O error occurs. - is true or the buffer is full, and current writer is closed. - is true or the buffer is full, and the contents of the buffer cannot be written to the underlying fixed size stream because the is at the end the stream. - - - Writes a character to the stream asynchronously. - The character to write to the stream. - A task that represents the asynchronous write operation. - The stream writer is disposed. - The stream writer is currently in use by a previous write operation. - - - Writes a string to the stream asynchronously. - The string to write to the stream. If value is null, nothing is written. - A task that represents the asynchronous write operation. - The stream writer is disposed. - The stream writer is currently in use by a previous write operation. - - - Writes a subarray of characters to the stream asynchronously. - A character array that contains the data to write. - The character position in the buffer at which to begin reading data. - The maximum number of characters to write. - A task that represents the asynchronous write operation. - buffer is null. - The index plus count is greater than the buffer length. - index or count is negative. - The stream writer is disposed. - The stream writer is currently in use by a previous write operation. - - - Writes a line terminator asynchronously to the stream. - A task that represents the asynchronous write operation. - The stream writer is disposed. - The stream writer is currently in use by a previous write operation. - - - Writes a character followed by a line terminator asynchronously to the stream. - The character to write to the stream. - A task that represents the asynchronous write operation. - The stream writer is disposed. - The stream writer is currently in use by a previous write operation. - - - Writes a string followed by a line terminator asynchronously to the stream. - The string to write. If the value is null, only a line terminator is written. - A task that represents the asynchronous write operation. - The stream writer is disposed. - The stream writer is currently in use by a previous write operation. - - - Writes a subarray of characters followed by a line terminator asynchronously to the stream. - The character array to write data from. - The character position in the buffer at which to start reading data. - The maximum number of characters to write. - A task that represents the asynchronous write operation. - buffer is null. - The index plus count is greater than the buffer length. - index or count is negative. - The stream writer is disposed. - The stream writer is currently in use by a previous write operation. - - - Implements a that reads from a string. - - - Initializes a new instance of the class that reads from the specified string. - The string to which the should be initialized. - The s parameter is null. - - - Closes the . - - - Releases the unmanaged resources used by the and optionally releases the managed resources. - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - Returns the next available character but does not consume it. - An integer representing the next character to be read, or -1 if no more characters are available or the stream does not support seeking. - The current reader is closed. - - - Reads the next character from the input string and advances the character position by one character. - The next character from the underlying string, or -1 if no more characters are available. - The current reader is closed. - - - Reads a block of characters from the input string and advances the character position by count. - When this method returns, contains the specified character array with the values between index and (index + count - 1) replaced by the characters read from the current source. - The starting index in the buffer. - The number of characters to read. - The total number of characters read into the buffer. This can be less than the number of characters requested if that many characters are not currently available, or zero if the end of the underlying string has been reached. - buffer is null. - The buffer length minus index is less than count. - index or count is negative. - The current reader is closed. - - - Reads a specified maximum number of characters from the current string asynchronously and writes the data to a buffer, beginning at the specified index. - When this method returns, contains the specified character array with the values between index and (index + count - 1) replaced by the characters read from the current source. - The position in buffer at which to begin writing. - The maximum number of characters to read. If the end of the string is reached before the specified number of characters is written into the buffer, the method returns. - A task that represents the asynchronous read operation. The value of the TResult parameter contains the total number of bytes read into the buffer. The result value can be less than the number of bytes requested if the number of bytes currently available is less than the requested number, or it can be 0 (zero) if the end of the string has been reached. - buffer is null. - index or count is negative. - The sum of index and count is larger than the buffer length. - The string reader has been disposed. - The reader is currently in use by a previous read operation. - - - Reads a specified maximum number of characters from the current string asynchronously and writes the data to a buffer, beginning at the specified index. - When this method returns, contains the specified character array with the values between index and (index + count - 1) replaced by the characters read from the current source. - The position in buffer at which to begin writing. - The maximum number of characters to read. If the end of the string is reached before the specified number of characters is written into the buffer, the method returns. - A task that represents the asynchronous read operation. The value of the TResult parameter contains the total number of bytes read into the buffer. The result value can be less than the number of bytes requested if the number of bytes currently available is less than the requested number, or it can be 0 (zero) if the end of the string has been reached. - buffer is null. - index or count is negative. - The sum of index and count is larger than the buffer length. - The string reader has been disposed. - The reader is currently in use by a previous read operation. - - - Reads a line of characters from the current string and returns the data as a string. - The next line from the current string, or null if the end of the string is reached. - The current reader is closed. - There is insufficient memory to allocate a buffer for the returned string. - - - Reads a line of characters asynchronously from the current string and returns the data as a string. - A task that represents the asynchronous read operation. The value of the TResult parameter contains the next line from the string reader, or is null if all the characters have been read. - The number of characters in the next line is larger than . - The string reader has been disposed. - The reader is currently in use by a previous read operation. - - - Reads all characters from the current position to the end of the string and returns them as a single string. - The content from the current position to the end of the underlying string. - There is insufficient memory to allocate a buffer for the returned string. - The current reader is closed. - - - Reads all characters from the current position to the end of the string asynchronously and returns them as a single string. - A task that represents the asynchronous read operation. The value of the TResult parameter contains a string with the characters from the current position to the end of the string. - The number of characters is larger than . - The string reader has been disposed. - The reader is currently in use by a previous read operation. - - - Implements a for writing information to a string. The information is stored in an underlying . - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with the specified format control. - An object that controls formatting. - - - Initializes a new instance of the class that writes to the specified . - The object to write to. - sb is null. - - - Initializes a new instance of the class that writes to the specified and has the specified format provider. - The object to write to. - An object that controls formatting. - sb is null. - - - Closes the current and the underlying stream. - - - Releases the unmanaged resources used by the and optionally releases the managed resources. - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - Gets the in which the output is written. - The Encoding in which the output is written. - - - Asynchronously clears all buffers for the current writer and causes any buffered data to be written to the underlying device. - A task that represents the asynchronous flush operation. - - - Returns the underlying . - The underlying StringBuilder. - - - Returns a string containing the characters written to the current StringWriter so far. - The string containing the characters written to the current StringWriter. - - - Writes a character to the string. - The character to write. - The writer is closed. - - - Writes a string to the current string. - The string to write. - The writer is closed. - - - Writes a subarray of characters to the string. - The character array to write data from. - The position in the buffer at which to start reading data. - The maximum number of characters to write. - buffer is null. - index or count is negative. - (index + count)> buffer. Length. - The writer is closed. - - - Writes a character to the string asynchronously. - The character to write to the string. - A task that represents the asynchronous write operation. - The string writer is disposed. - The string writer is currently in use by a previous write operation. - - - Writes a string to the current string asynchronously. - The string to write. If value is null, nothing is written to the text stream. - A task that represents the asynchronous write operation. - The string writer is disposed. - The string writer is currently in use by a previous write operation. - - - Writes a subarray of characters to the string asynchronously. - The character array to write data from. - The position in the buffer at which to start reading data. - The maximum number of characters to write. - A task that represents the asynchronous write operation. - buffer is null. - The index plus count is greater than the buffer length. - index or count is negative. - The string writer is disposed. - The string writer is currently in use by a previous write operation. - - - Writes a character followed by a line terminator asynchronously to the string. - The character to write to the string. - A task that represents the asynchronous write operation. - The string writer is disposed. - The string writer is currently in use by a previous write operation. - - - Writes a string followed by a line terminator asynchronously to the current string. - The string to write. If the value is null, only a line terminator is written. - A task that represents the asynchronous write operation. - The string writer is disposed. - The string writer is currently in use by a previous write operation. - - - Writes a subarray of characters followed by a line terminator asynchronously to the string. - The character array to write data from. - The position in the buffer at which to start reading data. - The maximum number of characters to write. - A task that represents the asynchronous write operation. - buffer is null. - The index plus count is greater than the buffer length. - index or count is negative. - The string writer is disposed. - The string writer is currently in use by a previous write operation. - - - Represents a reader that can read a sequential series of characters. - - - Initializes a new instance of the class. - - - Closes the and releases any system resources associated with the TextReader. - - - Releases all resources used by the object. - - - Releases the unmanaged resources used by the and optionally releases the managed resources. - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - Provides a TextReader with no data to read from. - - - - Reads the next character without changing the state of the reader or the character source. Returns the next available character without actually reading it from the reader. - An integer representing the next character to be read, or -1 if no more characters are available or the reader does not support seeking. - The is closed. - An I/O error occurs. - - - Reads the next character from the text reader and advances the character position by one character. - The next character from the text reader, or -1 if no more characters are available. The default implementation returns -1. - The is closed. - An I/O error occurs. - - - Reads a specified maximum number of characters from the current reader and writes the data to a buffer, beginning at the specified index. - When this method returns, contains the specified character array with the values between index and (index + count - 1) replaced by the characters read from the current source. - The position in buffer at which to begin writing. - The maximum number of characters to read. If the end of the reader is reached before the specified number of characters is read into the buffer, the method returns. - The number of characters that have been read. The number will be less than or equal to count, depending on whether the data is available within the reader. This method returns 0 (zero) if it is called when no more characters are left to read. - buffer is null. - The buffer length minus index is less than count. - index or count is negative. - The is closed. - An I/O error occurs. - - - Reads a specified maximum number of characters from the current text reader asynchronously and writes the data to a buffer, beginning at the specified index. - When this method returns, contains the specified character array with the values between index and (index + count - 1) replaced by the characters read from the current source. - The position in buffer at which to begin writing. - The maximum number of characters to read. If the end of the text is reached before the specified number of characters is read into the buffer, the current method returns. - A task that represents the asynchronous read operation. The value of the TResult parameter contains the total number of bytes read into the buffer. The result value can be less than the number of bytes requested if the number of bytes currently available is less than the requested number, or it can be 0 (zero) if the end of the text has been reached. - buffer is null. - index or count is negative. - The sum of index and count is larger than the buffer length. - The text reader has been disposed. - The reader is currently in use by a previous read operation. - - - Reads a specified maximum number of characters from the current text reader and writes the data to a buffer, beginning at the specified index. - When this method returns, this parameter contains the specified character array with the values between index and (index + count -1) replaced by the characters read from the current source. - The position in buffer at which to begin writing. - The maximum number of characters to read. - The number of characters that have been read. The number will be less than or equal to count, depending on whether all input characters have been read. - buffer is null. - The buffer length minus index is less than count. - index or count is negative. - The is closed. - An I/O error occurs. - - - Reads a specified maximum number of characters from the current text reader asynchronously and writes the data to a buffer, beginning at the specified index. - When this method returns, contains the specified character array with the values between index and (index + count - 1) replaced by the characters read from the current source. - The position in buffer at which to begin writing. - The maximum number of characters to read. If the end of the text is reached before the specified number of characters is read into the buffer, the current method returns. - A task that represents the asynchronous read operation. The value of the TResult parameter contains the total number of bytes read into the buffer. The result value can be less than the number of bytes requested if the number of bytes currently available is less than the requested number, or it can be 0 (zero) if the end of the text has been reached. - buffer is null. - index or count is negative. - The sum of index and count is larger than the buffer length. - The text reader has been disposed. - The reader is currently in use by a previous read operation. - - - Reads a line of characters from the text reader and returns the data as a string. - The next line from the reader, or null if all characters have been read. - An I/O error occurs. - There is insufficient memory to allocate a buffer for the returned string. - The is closed. - The number of characters in the next line is larger than - - - Reads a line of characters asynchronously and returns the data as a string. - A task that represents the asynchronous read operation. The value of the TResult parameter contains the next line from the text reader, or is null if all of the characters have been read. - The number of characters in the next line is larger than . - The text reader has been disposed. - The reader is currently in use by a previous read operation. - - - Reads all characters from the current position to the end of the text reader and returns them as one string. - A string that contains all characters from the current position to the end of the text reader. - An I/O error occurs. - The is closed. - There is insufficient memory to allocate a buffer for the returned string. - The number of characters in the next line is larger than - - - Reads all characters from the current position to the end of the text reader asynchronously and returns them as one string. - A task that represents the asynchronous read operation. The value of the TResult parameter contains a string with the characters from the current position to the end of the text reader. - The number of characters is larger than . - The text reader has been disposed. - The reader is currently in use by a previous read operation. - - - Creates a thread-safe wrapper around the specified TextReader. - The TextReader to synchronize. - A thread-safe . - reader is null. - - - Represents a writer that can write a sequential series of characters. This class is abstract. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with the specified format provider. - An object that controls formatting. - - - Closes the current writer and releases any system resources associated with the writer. - - - Stores the newline characters used for this TextWriter. - - - - Releases all resources used by the object. - - - Releases the unmanaged resources used by the and optionally releases the managed resources. - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - When overridden in a derived class, returns the character encoding in which the output is written. - The character encoding in which the output is written. - - - Clears all buffers for the current writer and causes any buffered data to be written to the underlying device. - - - Asynchronously clears all buffers for the current writer and causes any buffered data to be written to the underlying device. - A task that represents the asynchronous flush operation. - The text writer is disposed. - The writer is currently in use by a previous write operation. - - - Gets an object that controls formatting. - An object for a specific culture, or the formatting of the current culture if no other culture is specified. - - - Gets or sets the line terminator string used by the current TextWriter. - The line terminator string for the current TextWriter. - - - Provides a TextWriter with no backing store that can be written to, but not read from. - - - - Creates a thread-safe wrapper around the specified TextWriter. - The TextWriter to synchronize. - A thread-safe wrapper. - writer is null. - - - Writes a formatted string to the text string or stream, using the same semantics as the method. - A composite format string. - The first object to format and write. - The second object to format and write. - The third object to format and write. - format is null. - The is closed. - An I/O error occurs. - format is not a valid composite format string. -or- The index of a format item is less than 0 (zero), or greater than or equal to the number of objects to be formatted (which, for this method overload, is three). - - - Writes a subarray of characters to the text string or stream. - The character array to write data from. - The character position in the buffer at which to start retrieving data. - The number of characters to write. - The buffer length minus index is less than count. - The buffer parameter is null. - index or count is negative. - The is closed. - An I/O error occurs. - - - Writes a formatted string to the text string or stream, using the same semantics as the method. - A composite format string. - An object array that contains zero or more objects to format and write. - format or arg is null. - The is closed. - An I/O error occurs. - format is not a valid composite format string. -or- The index of a format item is less than 0 (zero), or greater than or equal to the length of the arg array. - - - Writes a formatted string to the text string or stream, using the same semantics as the method. - A composite format string. - The object to format and write. - format is null. - The is closed. - An I/O error occurs. - format is not a valid composite format string. -or- The index of a format item is less than 0 (zero), or greater than or equal to the number of objects to be formatted (which, for this method overload, is one). - - - Writes the text representation of an 8-byte unsigned integer to the text string or stream. - The 8-byte unsigned integer to write. - The is closed. - An I/O error occurs. - - - Writes the text representation of a 4-byte unsigned integer to the text string or stream. - The 4-byte unsigned integer to write. - The is closed. - An I/O error occurs. - - - Writes a string to the text string or stream. - The string to write. - The is closed. - An I/O error occurs. - - - Writes the text representation of a 4-byte floating-point value to the text string or stream. - The 4-byte floating-point value to write. - The is closed. - An I/O error occurs. - - - Writes a formatted string to the text string or stream, using the same semantics as the method. - A composite format string. - The first object to format and write. - The second object to format and write. - format is null. - The is closed. - An I/O error occurs. - format is not a valid composite format string. -or- The index of a format item is less than 0 (zero) or greater than or equal to the number of objects to be formatted (which, for this method overload, is two). - - - Writes the text representation of an 8-byte signed integer to the text string or stream. - The 8-byte signed integer to write. - The is closed. - An I/O error occurs. - - - Writes the text representation of a 4-byte signed integer to the text string or stream. - The 4-byte signed integer to write. - The is closed. - An I/O error occurs. - - - Writes the text representation of an 8-byte floating-point value to the text string or stream. - The 8-byte floating-point value to write. - The is closed. - An I/O error occurs. - - - Writes the text representation of a decimal value to the text string or stream. - The decimal value to write. - The is closed. - An I/O error occurs. - - - Writes a character array to the text string or stream. - The character array to write to the text stream. - The is closed. - An I/O error occurs. - - - Writes a character to the text string or stream. - The character to write to the text stream. - The is closed. - An I/O error occurs. - - - Writes the text representation of an object to the text string or stream by calling the ToString method on that object. - The object to write. - The is closed. - An I/O error occurs. - - - Writes the text representation of a Boolean value to the text string or stream. - The Boolean value to write. - The is closed. - An I/O error occurs. - - - Writes a subarray of characters to the text string or stream asynchronously. - The character array to write data from. - The character position in the buffer at which to start retrieving data. - The number of characters to write. - A task that represents the asynchronous write operation. - buffer is null. - The index plus count is greater than the buffer length. - index or count is negative. - The text writer is disposed. - The text writer is currently in use by a previous write operation. - - - Writes a string to the text string or stream asynchronously. - The string to write. If value is null, nothing is written to the text stream. - A task that represents the asynchronous write operation. - The text writer is disposed. - The text writer is currently in use by a previous write operation. - - - Writes a character to the text string or stream asynchronously. - The character to write to the text stream. - A task that represents the asynchronous write operation. - The text writer is disposed. - The text writer is currently in use by a previous write operation. - - - Writes a character array to the text string or stream asynchronously. - The character array to write to the text stream. If buffer is null, nothing is written. - A task that represents the asynchronous write operation. - The text writer is disposed. - The text writer is currently in use by a previous write operation. - - - Writes a string followed by a line terminator to the text string or stream. - The string to write. If value is null, only the line terminator is written. - The is closed. - An I/O error occurs. - - - Writes a formatted string and a new line to the text string or stream, using the same semantics as the method. - A composite format string. - The first object to format and write. - The second object to format and write. - format is null. - The is closed. - An I/O error occurs. - format is not a valid composite format string. -or- The index of a format item is less than 0 (zero), or greater than or equal to the number of objects to be formatted (which, for this method overload, is two). - - - Writes a subarray of characters followed by a line terminator to the text string or stream. - The character array from which data is read. - The character position in buffer at which to start reading data. - The maximum number of characters to write. - The buffer length minus index is less than count. - The buffer parameter is null. - index or count is negative. - The is closed. - An I/O error occurs. - - - Writes out a formatted string and a new line, using the same semantics as . - A composite format string. - An object array that contains zero or more objects to format and write. - A string or object is passed in as null. - The is closed. - An I/O error occurs. - format is not a valid composite format string. -or- The index of a format item is less than 0 (zero), or greater than or equal to the length of the arg array. - - - Writes a formatted string and a new line to the text string or stream, using the same semantics as the method. - A composite format string. - The object to format and write. - format is null. - The is closed. - An I/O error occurs. - format is not a valid composite format string. -or- The index of a format item is less than 0 (zero), or greater than or equal to the number of objects to be formatted (which, for this method overload, is one). - - - Writes the text representation of an 8-byte unsigned integer followed by a line terminator to the text string or stream. - The 8-byte unsigned integer to write. - The is closed. - An I/O error occurs. - - - Writes out a formatted string and a new line, using the same semantics as . - A composite format string. - The first object to format and write. - The second object to format and write. - The third object to format and write. - format is null. - The is closed. - An I/O error occurs. - format is not a valid composite format string. -or- The index of a format item is less than 0 (zero), or greater than or equal to the number of objects to be formatted (which, for this method overload, is three). - - - Writes the text representation of a 4-byte unsigned integer followed by a line terminator to the text string or stream. - The 4-byte unsigned integer to write. - The is closed. - An I/O error occurs. - - - Writes the text representation of a 4-byte floating-point value followed by a line terminator to the text string or stream. - The 4-byte floating-point value to write. - The is closed. - An I/O error occurs. - - - Writes the text representation of a 8-byte floating-point value followed by a line terminator to the text string or stream. - The 8-byte floating-point value to write. - The is closed. - An I/O error occurs. - - - Writes the text representation of an 8-byte signed integer followed by a line terminator to the text string or stream. - The 8-byte signed integer to write. - The is closed. - An I/O error occurs. - - - Writes the text representation of a 4-byte signed integer followed by a line terminator to the text string or stream. - The 4-byte signed integer to write. - The is closed. - An I/O error occurs. - - - Writes the text representation of a decimal value followed by a line terminator to the text string or stream. - The decimal value to write. - The is closed. - An I/O error occurs. - - - Writes an array of characters followed by a line terminator to the text string or stream. - The character array from which data is read. - The is closed. - An I/O error occurs. - - - Writes a character followed by a line terminator to the text string or stream. - The character to write to the text stream. - The is closed. - An I/O error occurs. - - - Writes the text representation of a Boolean value followed by a line terminator to the text string or stream. - The Boolean value to write. - The is closed. - An I/O error occurs. - - - Writes a line terminator to the text string or stream. - The is closed. - An I/O error occurs. - - - Writes the text representation of an object by calling the ToString method on that object, followed by a line terminator to the text string or stream. - The object to write. If value is null, only the line terminator is written. - The is closed. - An I/O error occurs. - - - Writes a string followed by a line terminator asynchronously to the text string or stream. - The string to write. If the value is null, only a line terminator is written. - A task that represents the asynchronous write operation. - The text writer is disposed. - The text writer is currently in use by a previous write operation. - - - Writes a line terminator asynchronously to the text string or stream. - A task that represents the asynchronous write operation. - The text writer is disposed. - The text writer is currently in use by a previous write operation. - - - Writes a character followed by a line terminator asynchronously to the text string or stream. - The character to write to the text stream. - A task that represents the asynchronous write operation. - The text writer is disposed. - The text writer is currently in use by a previous write operation. - - - Writes an array of characters followed by a line terminator asynchronously to the text string or stream. - The character array to write to the text stream. If the character array is null, only the line terminator is written. - A task that represents the asynchronous write operation. - The text writer is disposed. - The text writer is currently in use by a previous write operation. - - - Writes a subarray of characters followed by a line terminator asynchronously to the text string or stream. - The character array to write data from. - The character position in the buffer at which to start retrieving data. - The number of characters to write. - A task that represents the asynchronous write operation. - buffer is null. - The index plus count is greater than the buffer length. - index or count is negative. - The text writer is disposed. - The text writer is currently in use by a previous write operation. - - - Provides random access to unmanaged blocks of memory from managed code. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with a specified buffer, offset, and capacity. - The buffer to contain the accessor. - The byte at which to start the accessor. - The size, in bytes, of memory to allocate. - offset plus capacity is greater than buffer. - buffer is null. - offset or capacity is less than zero. - offset plus capacity would wrap around the high end of the address space. - - - Initializes a new instance of the class with a specified buffer, offset, capacity, and access right. - The buffer to contain the accessor. - The byte at which to start the accessor. - The size, in bytes, of memory to allocate. - The type of access allowed to the memory. The default is . - offset plus capacity is greater than buffer. - buffer is null. - offset or capacity is less than zero. -or- access is not a valid enumeration value. - offset plus capacity would wrap around the high end of the address space. - - - Determines whether the accessor is readable. - true if the accessor is readable; otherwise, false. - - - Determines whether the accessory is writable. - true if the accessor is writable; otherwise, false. - - - Gets the capacity of the accessor. - The capacity of the accessor. - - - Releases all resources used by the . - - - Releases the unmanaged resources used by the and optionally releases the managed resources. - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - Sets the initial values for the accessor. - The buffer to contain the accessor. - The byte at which to start the accessor. - The size, in bytes, of memory to allocate. - The type of access allowed to the memory. The default is . - offset plus capacity is greater than buffer. - buffer is null. - offset or capacity is less than zero. -or- access is not a valid enumeration value. - offset plus capacity would wrap around the high end of the address space. - - - Determines whether the accessor is currently open by a process. - true if the accessor is open; otherwise, false. - - - Reads a structure of type T from the accessor into a provided reference. - The position in the accessor at which to begin reading. - The structure to contain the read data. - The type of structure. - There are not enough bytes after position to read in a structure of type T. -or- T is a value type that contains one or more reference types. - position is less than zero or greater than the capacity of the accessor. - The accessor does not support reading. - The accessor has been disposed. - - - Reads structures of type T from the accessor into an array of type T. - The number of bytes in the accessor at which to begin reading. - The array to contain the structures read from the accessor. - The index in array in which to place the first copied structure. - The number of structures of type T to read from the accessor. - The type of structure. - The number of structures read into array. This value can be less than count if there are fewer structures available, or zero if the end of the accessor is reached. - array is not large enough to contain count of structures (starting from position). - array is null. - position is less than zero or greater than the capacity of the accessor. - The accessor does not support reading. - The accessor has been disposed. - - - Reads a Boolean value from the accessor. - The number of bytes into the accessor at which to begin reading. - true or false. - There are not enough bytes after position to read a value. - position is less than zero or greater than the capacity of the accessor. - The accessor does not support reading. - The accessor has been disposed. - - - Reads a byte value from the accessor. - The number of bytes into the accessor at which to begin reading. - The value that was read. - There are not enough bytes after position to read a value. - position is less than zero or greater than the capacity of the accessor. - The accessor does not support reading. - The accessor has been disposed. - - - Reads a character from the accessor. - The number of bytes into the accessor at which to begin reading. - The value that was read. - There are not enough bytes after position to read a value. - position is less than zero or greater than the capacity of the accessor. - The accessor does not support reading. - The accessor has been disposed. - - - Reads a decimal value from the accessor. - The number of bytes into the accessor at which to begin reading. - The value that was read. - There are not enough bytes after position to read a value. -or- The decimal to read is invalid. - position is less than zero or greater than the capacity of the accessor. - The accessor does not support reading. - The accessor has been disposed. - - - Reads a double-precision floating-point value from the accessor. - The number of bytes into the accessor at which to begin reading. - The value that was read. - There are not enough bytes after position to read a value. - position is less than zero or greater than the capacity of the accessor. - The accessor does not support reading. - The accessor has been disposed. - - - Reads a 16-bit integer from the accessor. - The number of bytes into the accessor at which to begin reading. - The value that was read. - There are not enough bytes after position to read a value. - position is less than zero or greater than the capacity of the accessor. - The accessor does not support reading. - The accessor has been disposed. - - - Reads a 32-bit integer from the accessor. - The number of bytes into the accessor at which to begin reading. - The value that was read. - There are not enough bytes after position to read a value. - position is less than zero or greater than the capacity of the accessor. - The accessor does not support reading. - The accessor has been disposed. - - - Reads a 64-bit integer from the accessor. - The number of bytes into the accessor at which to begin reading. - The value that was read. - There are not enough bytes after position to read a value. - position is less than zero or greater than the capacity of the accessor. - The accessor does not support reading. - The accessor has been disposed. - - - Reads an 8-bit signed integer from the accessor. - The number of bytes into the accessor at which to begin reading. - The value that was read. - There are not enough bytes after position to read a value. - position is less than zero or greater than the capacity of the accessor. - The accessor does not support reading. - The accessor has been disposed. - - - Reads a single-precision floating-point value from the accessor. - The number of bytes into the accessor at which to begin reading. - The value that was read. - There are not enough bytes after position to read a value. - position is less than zero or greater than the capacity of the accessor. - The accessor does not support reading. - The accessor has been disposed. - - - Reads an unsigned 16-bit integer from the accessor. - The number of bytes into the accessor at which to begin reading. - The value that was read. - There are not enough bytes after position to read a value. - position is less than zero or greater than the capacity of the accessor. - The accessor does not support reading. - The accessor has been disposed. - - - Reads an unsigned 32-bit integer from the accessor. - The number of bytes into the accessor at which to begin reading. - The value that was read. - There are not enough bytes after position to read a value. - position is less than zero or greater than the capacity of the accessor. - The accessor does not support reading. - The accessor has been disposed. - - - Reads an unsigned 64-bit integer from the accessor. - The number of bytes into the accessor at which to begin reading. - The value that was read. - There are not enough bytes after position to read a value. - position is less than zero or greater than the capacity of the accessor. - The accessor does not support reading. - The accessor has been disposed. - - - Writes an unsigned 64-bit integer into the accessor. - The number of bytes into the accessor at which to begin writing. - The value to write. - There are not enough bytes after position to write a value. - position is less than zero or greater than the capacity of the accessor. - The accessor does not support writing. - The accessor has been disposed. - - - Writes an unsigned 32-bit integer into the accessor. - The number of bytes into the accessor at which to begin writing. - The value to write. - There are not enough bytes after position to write a value. - position is less than zero or greater than the capacity of the accessor. - The accessor does not support writing. - The accessor has been disposed. - - - Writes an unsigned 16-bit integer into the accessor. - The number of bytes into the accessor at which to begin writing. - The value to write. - There are not enough bytes after position to write a value. - position is less than zero or greater than the capacity of the accessor. - The accessor does not support writing. - The accessor has been disposed. - - - Writes a Single into the accessor. - The number of bytes into the accessor at which to begin writing. - The value to write. - There are not enough bytes after position to write a value. - position is less than zero or greater than the capacity of the accessor. - The accessor does not support writing. - The accessor has been disposed. - - - Writes an 8-bit integer into the accessor. - The number of bytes into the accessor at which to begin writing. - The value to write. - There are not enough bytes after position to write a value. - position is less than zero or greater than the capacity of the accessor. - The accessor does not support writing. - The accessor has been disposed. - - - Writes a 64-bit integer into the accessor. - The number of bytes into the accessor at which to begin writing. - The value to write. - There are not enough bytes after position to write a value. - position is less than zero or greater than the capacity of the accessor. - The accessor does not support writing. - The accessor has been disposed. - - - Writes a Double value into the accessor. - The number of bytes into the accessor at which to begin writing. - The value to write. - There are not enough bytes after position to write a value. - position is less than zero or greater than the capacity of the accessor. - The accessor does not support writing. - The accessor has been disposed. - - - Writes a 16-bit integer into the accessor. - The number of bytes into the accessor at which to begin writing. - The value to write. - There are not enough bytes after position to write a value. - position is less than zero or greater than the capacity of the accessor. - The accessor does not support writing. - The accessor has been disposed. - - - Writes a decimal value into the accessor. - The number of bytes into the accessor at which to begin writing. - The value to write. - There are not enough bytes after position to write a value. -or- The decimal is invalid. - position is less than zero or greater than the capacity of the accessor. - The accessor does not support writing. - The accessor has been disposed. - - - Writes a character into the accessor. - The number of bytes into the accessor at which to begin writing. - The value to write. - There are not enough bytes after position to write a value. - position is less than zero or greater than the capacity of the accessor. - The accessor does not support writing. - The accessor has been disposed. - - - Writes a byte value into the accessor. - The number of bytes into the accessor at which to begin writing. - The value to write. - There are not enough bytes after position to write a value. - position is less than zero or greater than the capacity of the accessor. - The accessor does not support writing. - The accessor has been disposed. - - - Writes a Boolean value into the accessor. - The number of bytes into the accessor at which to begin writing. - The value to write. - There are not enough bytes after position to write a value. - position is less than zero or greater than the capacity of the accessor. - The accessor does not support writing. - The accessor has been disposed. - - - Writes a 32-bit integer into the accessor. - The number of bytes into the accessor at which to begin writing. - The value to write. - There are not enough bytes after position to write a value. - position is less than zero or greater than the capacity of the accessor. - The accessor does not support writing. - The accessor has been disposed. - - - Writes a structure into the accessor. - The number of bytes into the accessor at which to begin writing. - The structure to write. - The type of structure. - There are not enough bytes in the accessor after position to write a structure of type T. - position is less than zero or greater than the capacity of the accessor. - The accessor does not support writing. - The accessor has been disposed. - - - Writes structures from an array of type T into the accessor. - The number of bytes into the accessor at which to begin writing. - The array to write into the accessor. - The index in array to start writing from. - The number of structures in array to write. - The type of structure. - There are not enough bytes in the accessor after position to write the number of structures specified by count. - position is less than zero or greater than the capacity of the accessor. -or- offset or count is less than zero. - array is null. - The accessor does not support writing. - The accessor has been disposed. - - - Provides access to unmanaged blocks of memory from managed code. - - - Initializes a new instance of the class. - The user does not have the required permission. - - - Initializes a new instance of the class using the specified location and memory length. - A pointer to an unmanaged memory location. - The length of the memory to use. - The user does not have the required permission. - The pointer value is null. - The length value is less than zero. - or - The length is large enough to cause an overflow. - - - Initializes a new instance of the class in a safe buffer with a specified offset and length. - The buffer to contain the unmanaged memory stream. - The byte position in the buffer at which to start the unmanaged memory stream. - The length of the unmanaged memory stream. - - - Initializes a new instance of the class using the specified location, memory length, total amount of memory, and file access values. - A pointer to an unmanaged memory location. - The length of the memory to use. - The total amount of memory assigned to the stream. - One of the values. - The user does not have the required permission. - The pointer value is null. - The length value is less than zero. - or - The capacity value is less than zero. - or - The length value is greater than the capacity value. - - - Initializes a new instance of the class in a safe buffer with a specified offset, length, and file access. - The buffer to contain the unmanaged memory stream. - The byte position in the buffer at which to start the unmanaged memory stream. - The length of the unmanaged memory stream. - The mode of file access to the unmanaged memory stream. - - - Gets a value indicating whether a stream supports reading. - false if the object was created by a constructor with an access parameter that did not include reading the stream and if the stream is closed; otherwise, true. - - - Gets a value indicating whether a stream supports seeking. - false if the stream is closed; otherwise, true. - - - Gets a value indicating whether a stream supports writing. - false if the object was created by a constructor with an access parameter value that supports writing or was created by a constructor that had no parameters, or if the stream is closed; otherwise, true. - - - Gets the stream length (size) or the total amount of memory assigned to a stream (capacity). - The size or capacity of the stream. - The stream is closed. - - - Releases the unmanaged resources used by the and optionally releases the managed resources. - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - Overrides the method so that no action is performed. - The stream is closed. - - - Overrides the method so that the operation is cancelled if specified, but no other action is performed. Available starting in .NET Framework 4.6 - The token to monitor for cancellation requests. The default value is . - A task that represents the asynchronous flush operation. - - - Initializes a new instance of the class in a safe buffer with a specified offset, length, and file access. - The buffer to contain the unmanaged memory stream. - The byte position in the buffer at which to start the unmanaged memory stream. - The length of the unmanaged memory stream. - The mode of file access to the unmanaged memory stream. - - - Initializes a new instance of the class by using a pointer to an unmanaged memory location. - A pointer to an unmanaged memory location. - The length of the memory to use. - The total amount of memory assigned to the stream. - One of the values. - The user does not have the required permission. - The pointer value is null. - The length value is less than zero. - or - The capacity value is less than zero. - or - The length value is large enough to cause an overflow. - - - Gets the length of the data in a stream. - The length of the data in the stream. - The stream is closed. - - - Gets or sets the current position in a stream. - The current position in the stream. - The stream is closed. - The position is set to a value that is less than zero, or the position is larger than or results in overflow when added to the current pointer. - - - Gets or sets a byte pointer to a stream based on the current position in the stream. - A byte pointer. - The current position is larger than the capacity of the stream. - The position is being set is not a valid position in the current stream. - The pointer is being set to a lower value than the starting position of the stream. - The stream was initialized for use with a . The property is valid only for streams that are initialized with a pointer. - - - Reads the specified number of bytes into the specified array. - When this method returns, contains the specified byte array with the values between offset and (offset + count - 1) replaced by the bytes read from the current source. This parameter is passed uninitialized. - The zero-based byte offset in buffer at which to begin storing the data read from the current stream. - The maximum number of bytes to read from the current stream. - The total number of bytes read into the buffer. This can be less than the number of bytes requested if that many bytes are not currently available, or zero (0) if the end of the stream has been reached. - The stream is closed. - The underlying memory does not support reading. - or - The property is set to false. - The buffer parameter is set to null. - The offset parameter is less than zero. - or - The count parameter is less than zero. - The length of the buffer array minus the offset parameter is less than the count parameter. - - - Asynchronously reads the specified number of bytes into the specified array. Available starting in .NET Framework 4.6 - The buffer to write the data into. - The byte offset in buffer at which to begin writing data from the stream. - The maximum number of bytes to read. - The token to monitor for cancellation requests. The default value is . - A task that represents the asynchronous read operation. The value of the TResult parameter contains the total number of bytes read into the buffer. The result value can be less than the number of bytes requested if the number of bytes currently available is less than the requested number, or it can be 0 (zero) if the end of the stream has been reached. - - - Reads a byte from a stream and advances the position within the stream by one byte, or returns -1 if at the end of the stream. - The unsigned byte cast to an object, or -1 if at the end of the stream. - The stream is closed. - The underlying memory does not support reading. - or - The current position is at the end of the stream. - - - Sets the current position of the current stream to the given value. - The point relative to origin to begin seeking from. - Specifies the beginning, the end, or the current position as a reference point for origin, using a value of type . - The new position in the stream. - An attempt was made to seek before the beginning of the stream. - The offset value is larger than the maximum size of the stream. - loc is invalid. - The stream is closed. - - - Sets the length of a stream to a specified value. - The length of the stream. - An I/O error has occurred. - The stream is closed. - The underlying memory does not support writing. - or - An attempt is made to write to the stream and the property is false. - The specified value exceeds the capacity of the stream. - or - The specified value is negative. - - - Writes a block of bytes to the current stream using data from a buffer. - The byte array from which to copy bytes to the current stream. - The offset in the buffer at which to begin copying bytes to the current stream. - The number of bytes to write to the current stream. - The stream is closed. - The underlying memory does not support writing. - or - An attempt is made to write to the stream and the property is false. - or - The count value is greater than the capacity of the stream. - or - The position is at the end of the stream capacity. - An I/O error occurs. - One of the specified parameters is less than zero. - The offset parameter minus the length of the buffer parameter is less than the count parameter. - The buffer parameter is null. - - - Asynchronously writes a sequence of bytes to the current stream, advances the current position within this stream by the number of bytes written, and monitors cancellation requests. Available starting in .NET Framework 4.6 - The buffer to write data from. - The zero-based byte offset in buffer from which to begin copying bytes to the stream. - The maximum number of bytes to write. - The token to monitor for cancellation requests. The default value is . - A task that represents the asynchronous write operation. - - - Writes a byte to the current position in the file stream. - A byte value written to the stream. - The stream is closed. - The underlying memory does not support writing. - or - An attempt is made to write to the stream and the property is false. - or - The current position is at the end of the capacity of the stream. - The supplied value causes the stream exceed its maximum capacity. - - - Contains information on the change that occurred. - - - Gets or sets the type of change that occurred. - One of the values. - - - Gets or sets the name of the file or directory that changed. - The name of the file or directory that changed. - - - Gets or sets the original name of the file or directory that was renamed. - The original name of the file or directory that was renamed. - - - Gets or sets a value indicating whether the wait operation timed out. - true if the method timed out; otherwise, false. - - - Changes that might occur to a file or directory. - - - The creation, deletion, change, or renaming of a file or folder. - - - - The change of a file or folder. The types of changes include: changes to size, attributes, security settings, last write, and last access time. - - - - The creation of a file or folder. - - - - The deletion of a file or folder. - - - - The renaming of a file or folder. - - - - Defines a provider for push-based notification. - The object that provides notification information. - - - Notifies the provider that an observer is to receive notifications. - The object that is to receive notifications. - A reference to an interface that allows observers to stop receiving notifications before the provider has finished sending them. - - - Provides a mechanism for receiving push-based notifications. - The object that provides notification information. - - - Notifies the observer that the provider has finished sending push-based notifications. - - - Notifies the observer that the provider has experienced an error condition. - An object that provides additional information about the error. - - - Provides the observer with new data. - The current notification information. - - - Stores a set of types. - - - Initializes a new instance of the class. - - - Throws a because this operation is not supported for this collection. - The object to be added to the collection. - - - Throws a because this operation is not supported for this collection. - - - Checks whether the collection contains the specified object. - The object to be searched in the collection. - true if the object exists in the collection; otherwise, false. - - - Copies the elements in this collection to a one-dimensional array of type . - A one-dimensional array that receives a copy of the collection. - The zero-based index in array at which the copy begins. - array is null. - offset is less than zero. - array is multidimensional. -or- The number of elements in this is greater than the available space from offset to the end of the destination array. - The elements in this cannot be cast automatically to the type of the destination array. - - - Gets the number of types in this collection. - An value that contains the number of types in this collection. - - - Returns an object that can be used to iterate through this collection. - An object that implements the interface and provides access to the types in this collection. - - - Gets a value that indicates whether access to this collection is read-only. - true in all cases. - - - Gets the at the specific index of the collection. - The index of interest. - The at the specific index in the collection. - - - Throws a because this operation is not supported for this collection. - The object to be removed. - Always throws a . - - - Returns an object that can be used to iterate through this collection. - An object that implements the interface and provides access to the types in this collection. - - - Provides information about a network interface address. - - - Initializes a new instance of the class. - - - Gets the Internet Protocol (IP) address. - An instance that contains the IP address of an interface. - - - Gets a value that indicates whether the Internet Protocol (IP) address is valid to appear in a Domain Name System (DNS) server database. - true if the address can appear in a DNS database; otherwise, false. - - - Gets a value that indicates whether the Internet Protocol (IP) address is transient (a cluster address). - true if the address is transient; otherwise, false. - - - Stores a set of types. - - - Throws a because this operation is not supported for this collection. - The object to be added to the collection. - - - Throws a because this operation is not supported for this collection. - - - Checks whether the collection contains the specified object. - The object to be searched in the collection. - true if the object exists in the collection; otherwise. false. - - - Copies the collection to the specified array. - A one-dimensional array that receives a copy of the collection. - The zero-based index in array at which the copy begins. - array is null. - offset is less than zero. - array is multidimensional. -or- The number of elements in this is greater than the available space from offset to the end of the destination array. - The elements in this cannot be cast automatically to the type of the destination array. - - - Gets the number of types in this collection. - An value that contains the number of types in this collection. - - - Returns an object that can be used to iterate through this collection. - An object that implements the interface and provides access to the types in this collection. - - - Gets a value that indicates whether access to this collection is read-only. - true in all cases. - - - Gets the at the specified index in the collection. - The zero-based index of the element. - The at the specified location. - - - Throws a because this operation is not supported for this collection. - The object to be removed. - Always throws a . - - - Returns an object that can be used to iterate through this collection. - An object that implements the interface and provides access to the types in this collection. - - - Provides information about the network connectivity of the local computer. - - - Initializes a new instance of the class. - - - Begins an asynchronous request to retrieve the stable unicast IP address table on the local computer. - The delegate. - An object that contains state information for this request. - An that references the asynchronous request. - This method is not implemented on the platform. This method uses the native NotifyStableUnicastIpAddressTable function that is supported on Windows Vista and later. - The call to the native NotifyStableUnicastIpAddressTable function failed. - - - Gets the Dynamic Host Configuration Protocol (DHCP) scope name. - A instance that contains the computer's DHCP scope name. - A Win32 function call failed. - - - Gets the domain in which the local computer is registered. - A instance that contains the computer's domain name. If the computer does not belong to a domain, returns . - A Win32 function call failed. - - - Ends a pending asynchronous request to retrieve the stable unicast IP address table on the local computer. - An that references the asynchronous request. - An that stores state information and any user defined data for this asynchronous operation. - The call to the native GetAdaptersAddresses function failed. - This method is not implemented on the platform. This method uses the native NotifyStableUnicastIpAddressTable function that is supported on Windows Vista and later. - The caller does not have necessary permission. - - - Returns information about the Internet Protocol version 4 (IPv4) and IPv6 Transmission Control Protocol (TCP) connections on the local computer. - A array that contains objects that describe the active TCP connections, or an empty array if no active TCP connections are detected. - The Win32 function GetTcpTable failed. - - - Returns endpoint information about the Internet Protocol version 4 (IPv4) and IPv6 Transmission Control Protocol (TCP) listeners on the local computer. - A array that contains objects that describe the active TCP listeners, or an empty array, if no active TCP listeners are detected. - The Win32 function GetTcpTable failed. - - - Returns information about the Internet Protocol version 4 (IPv4) and IPv6 User Datagram Protocol (UDP) listeners on the local computer. - An array that contains objects that describe the UDP listeners, or an empty array if no UDP listeners are detected. - The call to the Win32 function GetUdpTable failed. - - - Provides Internet Control Message Protocol (ICMP) version 4 statistical data for the local computer. - An object that provides ICMP version 4 traffic statistics for the local computer. - The Win32 function GetIcmpStatistics failed. - - - Provides Internet Control Message Protocol (ICMP) version 6 statistical data for the local computer. - An object that provides ICMP version 6 traffic statistics for the local computer. - The Win32 function GetIcmpStatisticsEx failed. - The local computer's operating system is not Windows XP or later. - - - Gets an object that provides information about the local computer's network connectivity and traffic statistics. - A object that contains information about the local computer. - - - Provides Internet Protocol version 4 (IPv4) statistical data for the local computer. - An object that provides IPv4 traffic statistics for the local computer. - The call to the Win32 function GetIpStatistics failed. - - - Provides Internet Protocol version 6 (IPv6) statistical data for the local computer. - An object that provides IPv6 traffic statistics for the local computer. - The call to the Win32 function GetIpStatistics failed. - The local computer is not running an operating system that supports IPv6. - - - Provides Transmission Control Protocol/Internet Protocol version 4 (TCP/IPv4) statistical data for the local computer. - A object that provides TCP/IPv4 traffic statistics for the local computer. - The call to the Win32 function GetTcpStatistics failed. - - - Provides Transmission Control Protocol/Internet Protocol version 6 (TCP/IPv6) statistical data for the local computer. - A object that provides TCP/IPv6 traffic statistics for the local computer. - The call to the Win32 function GetTcpStatistics failed. - The local computer is not running an operating system that supports IPv6. - - - Provides User Datagram Protocol/Internet Protocol version 4 (UDP/IPv4) statistical data for the local computer. - A object that provides UDP/IPv4 traffic statistics for the local computer. - The call to the Win32 function GetUdpStatistics failed. - - - Provides User Datagram Protocol/Internet Protocol version 6 (UDP/IPv6) statistical data for the local computer. - A object that provides UDP/IPv6 traffic statistics for the local computer. - The call to the Win32 function GetUdpStatistics failed. - The local computer is not running an operating system that supports IPv6. - - - Retrieves the stable unicast IP address table on the local computer. - A that contains a list of stable unicast IP addresses on the local computer. - The call to the native GetAdaptersAddresses function failed. - This method is not implemented on the platform. This method uses the native NotifyStableUnicastIpAddressTable function that is supported on Windows Vista and later. - The caller does not have necessary permission. - The call to the native NotifyStableUnicastIpAddressTable function failed. - - - Retrieves the stable unicast IP address table on the local computer as an asynchronous operation. - Returns . The task object representing the asynchronous operation. - The call to the native GetAdaptersAddresses function failed. - The caller does not have necessary permission. - The call to the native NotifyStableUnicastIpAddressTable function failed. - - - Gets the host name for the local computer. - A instance that contains the computer's NetBIOS name. - A Win32 function call failed. - - - Gets a value that specifies whether the local computer is acting as a Windows Internet Name Service (WINS) proxy. - true if the local computer is a WINS proxy; otherwise, false. - A Win32 function call failed. - - - Gets the Network Basic Input/Output System (NetBIOS) node type of the local computer. - A value. - A Win32 function call failed. - - - Provides Internet Protocol (IP) statistical data. - - - Initializes a new instance of the class. - - - Gets the default time-to-live (TTL) value for Internet Protocol (IP) packets. - An value that specifies the TTL. - - - Gets a value that specifies whether Internet Protocol (IP) packet forwarding is enabled. - A value that specifies whether packet forwarding is enabled. - - - Gets the number of network interfaces. - An value containing the number of network interfaces for the address family used to obtain this instance. - - - Gets the number of Internet Protocol (IP) addresses assigned to the local computer. - An value that indicates the number of IP addresses assigned to the address family (Internet Protocol version 4 or Internet Protocol version 6) described by this object. - - - Gets the number of routes in the Internet Protocol (IP) routing table. - An value that specifies the total number of routes in the routing table. - - - Gets the number of outbound Internet Protocol (IP) packets. - An value that specifies the total number of outgoing packets. - - - Gets the number of routes that have been discarded from the routing table. - An value that specifies the total number of valid routes that have been discarded. - - - Gets the number of transmitted Internet Protocol (IP) packets that have been discarded. - An value that specifies the total number of outgoing packets that have been discarded. - - - Gets the number of Internet Protocol (IP) packets for which the local computer could not determine a route to the destination address. - An value that specifies the number of packets that could not be sent because a route could not be found. - - - Gets the number of Internet Protocol (IP) packets that could not be fragmented. - An value that specifies the total number of packets that required fragmentation but had the "Don't Fragment" bit set. - - - Gets the number of Internet Protocol (IP) packets that required reassembly. - An value that specifies the total number of packet reassemblies required. - - - Gets the number of Internet Protocol (IP) packets that were not successfully reassembled. - An value that specifies the total number of packets that could not be reassembled. - - - Gets the maximum amount of time within which all fragments of an Internet Protocol (IP) packet must arrive. - An value that specifies the maximum number of milliseconds within which all fragments of a packet must arrive to avoid being discarded. - - - Gets the number of Internet Protocol (IP) packets fragmented. - An value that specifies the total number of fragmented packets. - - - Gets the number of Internet Protocol (IP) packets reassembled. - An value that specifies the total number of fragmented packets that have been successfully reassembled. - - - Gets the number of Internet Protocol (IP) packets received. - An value that specifies the total number of IP packets received. - - - Gets the number of Internet Protocol (IP) packets delivered. - An value that specifies the total number of IP packets delivered. - - - Gets the number of Internet Protocol (IP) packets that have been received and discarded. - An value that specifies the total number of incoming packets that have been discarded. - - - Gets the number of Internet Protocol (IP) packets forwarded. - An value that specifies the total number of forwarded packets. - - - Gets the number of Internet Protocol (IP) packets with address errors that were received. - An value that specifies the total number of IP packets received with errors in the address portion of the header. - - - Gets the number of Internet Protocol (IP) packets with header errors that were received. - An value that specifies the total number of IP packets received and discarded due to errors in the header. - - - Gets the number of Internet Protocol (IP) packets received on the local machine with an unknown protocol in the header. - An value that indicates the total number of IP packets received with an unknown protocol. - - - Provides information about network interfaces that support Internet Protocol version 4 (IPv4) or Internet Protocol version 6 (IPv6). - - - Initializes a new instance of the class. - - - Gets the anycast IP addresses assigned to this interface. - An that contains the anycast addresses for this interface. - - - Gets the addresses of Dynamic Host Configuration Protocol (DHCP) servers for this interface. - An that contains the address information for DHCP servers, or an empty array if no servers are found. - - - Gets the addresses of Domain Name System (DNS) servers for this interface. - A that contains the DNS server addresses. - - - Gets the Domain Name System (DNS) suffix associated with this interface. - A that contains the DNS suffix for this interface, or if there is no DNS suffix for the interface. - This property is not valid on computers running operating systems earlier than Windows 2000. - - - Gets the IPv4 network gateway addresses for this interface. - An that contains the address information for network gateways, or an empty array if no gateways are found. - - - Provides Internet Protocol version 4 (IPv4) configuration data for this network interface. - An object that contains IPv4 configuration data, or null if no data is available for the interface. - The interface does not support the IPv4 protocol. - - - Provides Internet Protocol version 6 (IPv6) configuration data for this network interface. - An object that contains IPv6 configuration data. - The interface does not support the IPv6 protocol. - - - Gets a value that indicates whether NetBt is configured to use DNS name resolution on this interface. - true if NetBt is configured to use DNS name resolution on this interface; otherwise, false. - - - Gets a value that indicates whether this interface is configured to automatically register its IP address information with the Domain Name System (DNS). - true if this interface is configured to automatically register a mapping between its dynamic IP address and static domain names; otherwise, false. - - - Gets the multicast addresses assigned to this interface. - An that contains the multicast addresses for this interface. - - - Gets the unicast addresses assigned to this interface. - An that contains the unicast addresses for this interface. - - - Gets the addresses of Windows Internet Name Service (WINS) servers. - An that contains the address information for WINS servers, or an empty array if no servers are found. - - - Provides Internet Protocol (IP) statistical data for an network interface on the local computer. - - - Initializes a new instance of the class. - - - Gets the number of bytes that were received on the interface. - Returns . The total number of bytes that were received on the interface. - - - Gets the number of bytes that were sent on the interface. - Returns . The total number of bytes that were sent on the interface. - - - Gets the number of incoming packets that were discarded. - Returns . The total number of incoming packets that were discarded. - - - Gets the number of incoming packets with errors. - Returns . The total number of incoming packets with errors. - - - Gets the number of incoming packets with an unknown protocol that were received on the interface. - Returns . The total number of incoming packets with an unknown protocol that were received on the interface. - - - Gets the number of non-unicast packets that were received on the interface. - Returns . The total number of incoming non-unicast packets received on the interface. - - - Gets the number of non-unicast packets that were sent on the interface. - Returns . The total number of non-unicast packets that were sent on the interface. - - - Gets the number of outgoing packets that were discarded. - Returns . The total number of outgoing packets that were discarded. - - - Gets the number of outgoing packets with errors. - Returns . The total number of outgoing packets with errors. - - - Gets the length of the output queue. - Returns . The total number of packets in the output queue. - - - Gets the number of unicast packets that were received on the interface. - Returns . The total number of unicast packets that were received on the interface. - - - Gets the number of unicast packets that were sent on the interface. - Returns . The total number of unicast packets that were sent on the interface. - - - Reports the status of sending an Internet Control Message Protocol (ICMP) echo message to a computer. - - - The ICMP echo request failed because the destination IP address cannot receive ICMP echo requests or should never appear in the destination address field of any IP datagram. For example, calling and specifying IP address "000.0.0.0" returns this status. - - - - The ICMP echo request failed because the header is invalid. - - - - The ICMP echo request failed because it contains an invalid option. - - - - The ICMP echo request failed because there is no valid route between the source and destination computers. - - - - The ICMP echo request failed because the destination computer is not reachable. - - - - The ICMP echo request failed because the network that contains the destination computer is not reachable. - - - - The ICMP echo request failed because the port on the destination computer is not available. - - - - The ICMPv6 echo request failed because contact with the destination computer is administratively prohibited. This value applies only to IPv6. - - - - The ICMP echo request failed because the destination computer that is specified in an ICMP echo message is not reachable, because it does not support the packet's protocol. This value applies only to IPv4. This value is described in IETF RFC 1812 as Communication Administratively Prohibited. - - - - The ICMP echo request failed because the source address and destination address that are specified in an ICMP echo message are not in the same scope. This is typically caused by a router forwarding a packet using an interface that is outside the scope of the source address. Address scopes (link-local, site-local, and global scope) determine where on the network an address is valid. - - - - The ICMP echo request failed because the destination computer that is specified in an ICMP echo message is not reachable; the exact cause of problem is unknown. - - - - The ICMP echo request failed because of a hardware error. - - - - The ICMP echo request failed because of an ICMP protocol error. - - - - The ICMP echo request failed because of insufficient network resources. - - - - The ICMP echo request failed because the packet containing the request is larger than the maximum transmission unit (MTU) of a node (router or gateway) located between the source and destination. The MTU defines the maximum size of a transmittable packet. - - - - The ICMP echo request failed because a node (router or gateway) encountered problems while processing the packet header. This is the status if, for example, the header contains invalid field data or an unrecognized option. - - - - The ICMP echo request failed because the packet was discarded. This occurs when the source computer's output queue has insufficient storage space, or when packets arrive at the destination too quickly to be processed. - - - - The ICMP echo request succeeded; an ICMP echo reply was received. When you get this status code, the other properties contain valid data. - - - - The ICMP echo Reply was not received within the allotted time. The default time allowed for replies is 5 seconds. You can change this value using the or methods that take a timeout parameter. - - - - The ICMP echo request failed because its Time to Live (TTL) value reached zero, causing the forwarding node (router or gateway) to discard the packet. - - - - The ICMP echo request failed because its Time to Live (TTL) value reached zero, causing the forwarding node (router or gateway) to discard the packet. - - - - The ICMP echo request failed because the packet was divided into fragments for transmission and all of the fragments were not received within the time allotted for reassembly. RFC 2460 (available at www.ietf.org) specifies 60 seconds as the time limit within which all packet fragments must be received. - - - - The ICMP echo request failed for an unknown reason. - - - - The ICMP echo request failed because the Next Header field does not contain a recognized value. The Next Header field indicates the extension header type (if present) or the protocol above the IP layer, for example, TCP or UDP. - - - - Provides information about network interfaces that support Internet Protocol version 4 (IPv4). - - - Initializes a new instance of the class. - - - Gets the index of the network interface associated with the Internet Protocol version 4 (IPv4) address. - An that contains the index of the IPv4 interface. - - - Gets a value that indicates whether this interface has an automatic private IP addressing (APIPA) address. - true if the interface uses an APIPA address; otherwise, false. - - - Gets a value that indicates whether this interface has automatic private IP addressing (APIPA) enabled. - true if the interface uses APIPA; otherwise, false. - - - Gets a value that indicates whether the interface is configured to use a Dynamic Host Configuration Protocol (DHCP) server to obtain an IP address. - true if the interface is configured to obtain an IP address from a DHCP server; otherwise, false. - - - Gets a value that indicates whether this interface can forward (route) packets. - true if this interface routes packets; otherwise false. - - - Gets the maximum transmission unit (MTU) for this network interface. - An value that specifies the MTU. - - - Gets a value that indicates whether an interface uses Windows Internet Name Service (WINS). - true if the interface uses WINS; otherwise, false. - - - Provides statistical data for a network interface on the local computer. - - - Initializes a new instance of the class. - - - Gets the number of bytes that were received on the interface. - An value that specifies the total number of bytes that were received on the interface. - - - Gets the number of bytes that were sent on the interface. - An value that specifies the total number of bytes that were transmitted on the interface. - - - Gets the number of incoming packets that were discarded. - An value that specifies the total number of discarded incoming packets. - - - Gets the number of incoming packets with errors. - An value that specifies the total number of incoming packets with errors. - - - Gets the number of incoming packets with an unknown protocol that were received on the interface. - An value that specifies the total number of incoming packets with an unknown protocol. - - - Gets the number of non-unicast packets that were received on the interface. - An value that specifies the total number of non-unicast packets that were received on the interface. - - - Gets the number of non-unicast packets that were sent on the interface. - An value that specifies the total number of non-unicast packets that were sent on the interface. - - - Gets the number of outgoing packets that were discarded. - An value that specifies the total number of discarded outgoing packets. - - - Gets the number of outgoing packets with errors. - An value that specifies the total number of outgoing packets with errors. - - - Gets the length of the output queue. - An value that specifies the total number of packets in the output queue. - - - Gets the number of unicast packets that were received on the interface. - An value that specifies the total number of unicast packets that were received on the interface. - - - Gets the number of unicast packets that were sent on the interface. - An value that specifies the total number of unicast packets that were sent on the interface. - - - Provides information about network interfaces that support Internet Protocol version 6 (IPv6). - - - Initializes a new instance of the class. - - - Gets the scope ID of the network interface associated with an Internet Protocol version 6 (IPv6) address. - The scope level. - Returns . The scope ID of the network interface associated with an IPv6 address. - - - Gets the index of the network interface associated with an Internet Protocol version 6 (IPv6) address. - An value that contains the index of the network interface for IPv6 address. - - - Gets the maximum transmission unit (MTU) for this network interface. - An value that specifies the MTU. - - - Provides information about a network interface's multicast address. - - - Initializes a new instance of the class. - - - Gets the number of seconds remaining during which this address is the preferred address. - An value that specifies the number of seconds left for this address to remain preferred. - This property is not valid on computers running operating systems earlier than Windows XP. - - - Gets the number of seconds remaining during which this address is valid. - An value that specifies the number of seconds left for this address to remain assigned. - This property is not valid on computers running operating systems earlier than Windows XP. - - - Specifies the amount of time remaining on the Dynamic Host Configuration Protocol (DHCP) lease for this IP address. - An value that contains the number of seconds remaining before the computer must release the instance. - - - Gets a value that indicates the state of the duplicate address detection algorithm. - One of the values that indicates the progress of the algorithm in determining the uniqueness of this IP address. - This property is not valid on computers running operating systems earlier than Windows XP. - - - Gets a value that identifies the source of a Multicast Internet Protocol (IP) address prefix. - One of the values that identifies how the prefix information was obtained. - This property is not valid on computers running operating systems earlier than Windows XP. - - - Gets a value that identifies the source of a Multicast Internet Protocol (IP) address suffix. - One of the values that identifies how the suffix information was obtained. - This property is not valid on computers running operating systems earlier than Windows XP. - - - Stores a set of types. - - - Initializes a new instance of the class. - - - Throws a because the collection is read-only and elements cannot be added to the collection. - The object to be added to the collection. - - - Throws a because the collection is read-only and elements cannot be removed. - - - Checks whether the collection contains the specified object. - The object to be searched in the collection. - true if the object exists in the collection; otherwise, false. - - - Copies the elements in this collection to a one-dimensional array of type . - A one-dimensional array that receives a copy of the collection. - The zero-based index in array at which the copy begins. - array is null. - count is less than zero. - array is multidimensional. -or- The number of elements in this is greater than the available space from count to the end of the destination array. - The elements in this cannot be cast automatically to the type of the destination array. - - - Gets the number of types in this collection. - An value that contains the number of types in this collection. - - - Returns an object that can be used to iterate through this collection. - An object that implements the interface and provides access to the types in this collection. - - - Gets a value that indicates whether access to this collection is read-only. - true in all cases. - - - Gets the at the specific index of the collection. - The index of interest. - The at the specific index in the collection. - - - Throws a because the collection is read-only and elements cannot be removed. - The object to be removed. - Always throws a . - - - Returns an object that can be used to iterate through this collection. - An object that implements the interface and provides access to the types in this collection. - - - Specifies the Network Basic Input/Output System (NetBIOS) node type. - - - A broadcast node. - - - - A hybrid node. - - - - A mixed node. - - - - A peer-to-peer node. - - - - An unknown node type. - - - - References one or more methods to be called when the address of a network interface changes. - The source of the event. - An object that contains data about the event. - - - References one or more methods to be called when the availability of the network changes. - The source of the event. - An object that contains data about the event. - - - Provides data for the event. - - - Gets the current status of the network connection. - true if the network is available; otherwise, false. - - - - - - - - - - - - The exception that is thrown when an error occurs while retrieving network information. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with the specified error code. - A Win32 error code. - - - Initializes a new instance of the class with serialized data. - A SerializationInfo object that contains the serialized exception data. - A StreamingContext that contains contextual information about the serialized exception. - - - Gets the Win32 error code for this exception. - An value that contains the Win32 error code. - - - Provides configuration and statistical information for a network interface. - - - Initializes a new instance of the class. - - - Gets the description of the interface. - A that describes this interface. - - - Returns objects that describe the network interfaces on the local computer. - A array that contains objects that describe the available network interfaces, or an empty array if no interfaces are detected. - A Windows system function call failed. - - - Returns an object that describes the configuration of this network interface. - An object that describes this network interface. - - - Gets the IP statistics for this instance. - Returns . The IP statistics. - - - Gets the IPv4 statistics for this instance. - An object. - - - Indicates whether any network connection is available. - true if a network connection is available; otherwise, false. - - - Returns the Media Access Control (MAC) or physical address for this adapter. - A object that contains the physical address. - - - Gets the identifier of the network adapter. - A that contains the identifier. - - - Gets the index of the IPv6 loopback interface. - Returns . The index for the IPv6 loopback interface. - - - Gets a value that indicates whether the network interface is set to only receive data packets. - true if the interface only receives network traffic; otherwise, false. - This property is not valid on computers running operating systems earlier than Windows XP. - - - Gets the index of the IPv4 loopback interface. - A that contains the index for the IPv4 loopback interface. - This property is not valid on computers running only Ipv6. - - - Gets the name of the network adapter. - A that contains the adapter name. - - - Gets the interface type. - An value that specifies the network interface type. - - - Gets the current operational state of the network connection. - One of the values. - - - Gets the speed of the network interface. - A value that specifies the speed in bits per second. - - - Gets a value that indicates whether the interface supports the specified protocol. - A value. - true if the specified protocol is supported; otherwise, false. - - - Gets a value that indicates whether the network interface is enabled to receive multicast packets. - true if the interface receives multicast packets; otherwise, false. - This property is not valid on computers running operating systems earlier than Windows XP. - - - Specifies the Internet Protocol versions that are supported by a network interface. - - - Internet Protocol version 4. - - - - Internet Protocol version 6. - - - - Specifies types of network interfaces. - - - The network interface uses an Asymmetric Digital Subscriber Line (ADSL). - - - - The network interface uses asynchronous transfer mode (ATM) for data transmission. - - - - The network interface uses a basic rate interface Integrated Services Digital Network (ISDN) connection. ISDN is a set of standards for data transmission over telephone lines. - - - - The network interface uses an Ethernet connection. Ethernet is defined in IEEE standard 802.3. - - - - The network interface uses an Ethernet 3 megabit/second connection. This version of Ethernet is defined in IETF RFC 895. - - - - The network interface uses a Fast Ethernet connection over optical fiber and provides a data rate of 100 megabits per second. This type of connection is also known as 100Base-FX. - - - - The network interface uses a Fast Ethernet connection over twisted pair and provides a data rate of 100 megabits per second. This type of connection is also known as 100Base-T. - - - - The network interface uses a Fiber Distributed Data Interface (FDDI) connection. FDDI is a set of standards for data transmission on fiber optic lines in a local area network. - - - - The network interface uses a modem. - - - - The network interface uses a gigabit Ethernet connection and provides a data rate of 1,000 megabits per second (1 gigabit per second). - - - - The network interface uses a High Performance Serial Bus. - - - - The network interface uses the Internet Protocol (IP) in combination with asynchronous transfer mode (ATM) for data transmission. - - - - The network interface uses a connection configured for ISDN and the X.25 protocol. X.25 allows computers on public networks to communicate using an intermediary computer. - - - - The network interface is a loopback adapter. Such interfaces are often used for testing; no traffic is sent over the wire. - - - - The network interface uses a Multirate Digital Subscriber Line. - - - - The network interface uses a Point-To-Point protocol (PPP) connection. PPP is a protocol for data transmission using a serial device. - - - - The network interface uses a primary rate interface Integrated Services Digital Network (ISDN) connection. ISDN is a set of standards for data transmission over telephone lines. - - - - The network interface uses a Rate Adaptive Digital Subscriber Line (RADSL). - - - - The network interface uses a Serial Line Internet Protocol (SLIP) connection. SLIP is defined in IETF RFC 1055. - - - - The network interface uses a Symmetric Digital Subscriber Line (SDSL). - - - - The network interface uses a Token-Ring connection. Token-Ring is defined in IEEE standard 802.5. - - - - The network interface uses a tunnel connection. - - - - The interface type is not known. - - - - The network interface uses a Very High Data Rate Digital Subscriber Line (VDSL). - - - - The network interface uses a wireless LAN connection (IEEE 802.11 standard). - - - - The network interface uses a mobile broadband interface for WiMax devices. - - - - The network interface uses a mobile broadband interface for GSM-based devices. - - - - The network interface uses a mobile broadband interface for CDMA-based devices. - - - - Specifies the operational state of a network interface. - - - The network interface is not in a condition to transmit data packets; it is waiting for an external event. - - - - The network interface is unable to transmit data packets. - - - - The network interface is unable to transmit data packets because it runs on top of one or more other interfaces, and at least one of these "lower layer" interfaces is down. - - - - The network interface is unable to transmit data packets because of a missing component, typically a hardware component. - - - - The network interface is running tests. - - - - The network interface status is not known. - - - - The network interface is up; it can transmit data packets. - - - - Provides the Media Access Control (MAC) address for a network interface (adapter). - - - Initializes a new instance of the class. - A array containing the address. - - - Compares two instances. - The to compare to the current instance. - true if this instance and the specified instance contain the same address; otherwise false. - - - Returns the address of the current instance. - A array containing the address. - - - Returns the hash value of a physical address. - An integer hash value. - - - Returns a new instance with a zero length address. This field is read-only. - - - - Parses the specified and stores its contents as the address bytes of the returned by this method. - A containing the address that will be used to initialize the instance returned by this method. - A instance with the specified address. - The address parameter contains an illegal hardware address. This exception also occurs if the address parameter contains a string in the incorrect format. - - - Returns the representation of the address of this instance. - A containing the address contained in this instance. - - - Allows an application to determine whether a remote computer is accessible over the network. - - - Initializes a new instance of the class. - - - Releases the unmanaged resources used by the object, and optionally disposes of the managed resources. - true to release both managed and unmanaged resources; false to releases only unmanaged resources. - - - Raises the event. - A object that contains event data. - - - Occurs when an asynchronous operation to send an Internet Control Message Protocol (ICMP) echo message and receive the corresponding ICMP echo reply message completes or is canceled. - - - - Attempts to send an Internet Control Message Protocol (ICMP) echo message with the specified data buffer to the specified computer, and receive a corresponding ICMP echo reply message from that computer. This overload allows you to specify a time-out value for the operation and control fragmentation and Time-to-Live values for the ICMP packet. - A that identifies the computer that is the destination for the ICMP echo message. The value specified for this parameter can be a host name or a string representation of an IP address. - An value that specifies the maximum number of milliseconds (after sending the echo message) to wait for the ICMP echo reply message. - A array that contains data to be sent with the ICMP echo message and returned in the ICMP echo reply message. The array cannot contain more than 65,500 bytes. - A object used to control fragmentation and Time-to-Live values for the ICMP echo message packet. - A object that provides information about the ICMP echo reply message if one was received, or provides the reason for the failure if no message was received. - The size of buffer exceeds 65500 bytes. - hostNameOrAddress is null or is a zero length string. -or- buffer is null, or the buffer size is greater than 65500 bytes. - timeout is less than zero. - A call to is in progress. - address is an IPv6 address and the local computer is running an operating system earlier than Windows 2000. - An exception was thrown while sending or receiving the ICMP messages. See the inner exception for the exact exception that was thrown. - This object has been disposed. - - - Attempts to send an Internet Control Message Protocol (ICMP) echo message with the specified data buffer to the computer that has the specified and receive a corresponding ICMP echo reply message from that computer. This overload allows you to specify a time-out value for the operation and control fragmentation and Time-to-Live values for the ICMP echo message packet. - An that identifies the computer that is the destination for the ICMP echo message. - An value that specifies the maximum number of milliseconds (after sending the echo message) to wait for the ICMP echo reply message. - A array that contains data to be sent with the ICMP echo message and returned in the ICMP echo reply message. The array cannot contain more than 65,500 bytes. - A object used to control fragmentation and Time-to-Live values for the ICMP echo message packet. - A object that provides information about the ICMP echo reply message, if one was received, or provides the reason for the failure, if no message was received. The method will return if the packet exceeds the Maximum Transmission Unit (MTU). - The size of buffer exceeds 65500 bytes. - address is null. -or- buffer is null, or the buffer size is greater than 65500 bytes. - timeout is less than zero. - A call to is in progress. - address is an IPv6 address and the local computer is running an operating system earlier than Windows 2000. - An exception was thrown while sending or receiving the ICMP messages. See the inner exception for the exact exception that was thrown. - This object has been disposed. - - - Attempts to send an Internet Control Message Protocol (ICMP) echo message with the specified data buffer to the specified computer, and receive a corresponding ICMP echo reply message from that computer. This overload allows you to specify a time-out value for the operation. - A that identifies the computer that is the destination for the ICMP echo message. The value specified for this parameter can be a host name or a string representation of an IP address. - An value that specifies the maximum number of milliseconds (after sending the echo message) to wait for the ICMP echo reply message. - A array that contains data to be sent with the ICMP echo message and returned in the ICMP echo reply message. The array cannot contain more than 65,500 bytes. - A object that provides information about the ICMP echo reply message if one was received, or provides the reason for the failure if no message was received. - The size of buffer exceeds 65500 bytes. - hostNameOrAddress is null or is an empty string (""). -or- buffer is null, or the buffer size is greater than 65500 bytes. - timeout is less than zero. - A call to is in progress. - An exception was thrown while sending or receiving the ICMP messages. See the inner exception for the exact exception that was thrown. - This object has been disposed. - - - Attempts to send an Internet Control Message Protocol (ICMP) echo message with the specified data buffer to the computer that has the specified , and receive a corresponding ICMP echo reply message from that computer. This overload allows you to specify a time-out value for the operation. - An that identifies the computer that is the destination for the ICMP echo message. - An value that specifies the maximum number of milliseconds (after sending the echo message) to wait for the ICMP echo reply message. - A array that contains data to be sent with the ICMP echo message and returned in the ICMP echo reply message. The array cannot contain more than 65,500 bytes. - A object that provides information about the ICMP echo reply message, if one was received, or provides the reason for the failure, if no message was received. The method will return if the packet exceeds the Maximum Transmission Unit (MTU). - The size of buffer exceeds 65500 bytes. - address is null. -or- buffer is null, or the buffer size is greater than 65500 bytes. - timeout is less than zero. - A call to is in progress. - address is an IPv6 address and the local computer is running an operating system earlier than Windows 2000. - An exception was thrown while sending or receiving the ICMP messages. See the inner exception for the exact exception that was thrown. - This object has been disposed. - - - Attempts to send an Internet Control Message Protocol (ICMP) echo message to the specified computer, and receive a corresponding ICMP echo reply message from that computer. This method allows you to specify a time-out value for the operation. - A that identifies the computer that is the destination for the ICMP echo message. The value specified for this parameter can be a host name or a string representation of an IP address. - An value that specifies the maximum number of milliseconds (after sending the echo message) to wait for the ICMP echo reply message. - A object that provides information about the ICMP echo reply message if one was received, or provides the reason for the failure if no message was received. - hostNameOrAddress is null or is an empty string (""). - timeout is less than zero. - A call to is in progress. - An exception was thrown while sending or receiving the ICMP messages. See the inner exception for the exact exception that was thrown. - This object has been disposed. - - - Attempts to send an Internet Control Message Protocol (ICMP) echo message with the specified data buffer to the computer that has the specified , and receive a corresponding ICMP echo reply message from that computer. This method allows you to specify a time-out value for the operation. - An that identifies the computer that is the destination for the ICMP echo message. - An value that specifies the maximum number of milliseconds (after sending the echo message) to wait for the ICMP echo reply message. - A object that provides information about the ICMP echo reply message if one was received, or provides the reason for the failure if no message was received. - address is null. - timeout is less than zero. - A call to is in progress. - address is an IPv6 address and the local computer is running an operating system earlier than Windows 2000. - An exception was thrown while sending or receiving the ICMP messages. See the inner exception for the exact exception that was thrown. - This object has been disposed. - - - Attempts to send an Internet Control Message Protocol (ICMP) echo message to the specified computer, and receive a corresponding ICMP echo reply message from that computer. - A that identifies the computer that is the destination for the ICMP echo message. The value specified for this parameter can be a host name or a string representation of an IP address. - A object that provides information about the ICMP echo reply message, if one was received, or provides the reason for the failure, if no message was received. - hostNameOrAddress is null or is an empty string (""). - A call to is in progress. - address is an IPv6 address and the local computer is running an operating system earlier than Windows 2000. - An exception was thrown while sending or receiving the ICMP messages. See the inner exception for the exact exception that was thrown. - This object has been disposed. - - - Attempts to send an Internet Control Message Protocol (ICMP) echo message to the computer that has the specified , and receive a corresponding ICMP echo reply message from that computer. - An that identifies the computer that is the destination for the ICMP echo message. - A object that provides information about the ICMP echo reply message, if one was received, or describes the reason for the failure if no message was received. - address is null. - A call to is in progress. - address is an IPv6 address and the local computer is running an operating system earlier than Windows 2000. - An exception was thrown while sending or receiving the ICMP messages. See the inner exception for the exact exception that was thrown. - This object has been disposed. - - - Asynchronously attempts to send an Internet Control Message Protocol (ICMP) echo message with the specified data buffer to the specified computer, and receive a corresponding ICMP echo reply message from that computer. This overload allows you to specify a time-out value for the operation and control fragmentation and Time-to-Live values for the ICMP packet. - A that identifies the computer that is the destination for the ICMP echo message. The value specified for this parameter can be a host name or a string representation of an IP address. - A array that contains data to be sent with the ICMP echo message and returned in the ICMP echo reply message. The array cannot contain more than 65,500 bytes. - An value that specifies the maximum number of milliseconds (after sending the echo message) to wait for the ICMP echo reply message. - A object used to control fragmentation and Time-to-Live values for the ICMP echo message packet. - An object that is passed to the method invoked when the asynchronous operation completes. - hostNameOrAddress is null or is an empty string (""). -or- buffer is null. - timeout is less than zero. - A call to is in progress. - address is an IPv6 address and the local computer is running an operating system earlier than Windows 2000. - An exception was thrown while sending or receiving the ICMP messages. See the inner exception for the exact exception that was thrown. - hostNameOrAddress could not be resolved to a valid IP address. - This object has been disposed. - The size of buffer exceeds 65500 bytes. - - - Asynchronously attempts to send an Internet Control Message Protocol (ICMP) echo message with the specified data buffer to the computer that has the specified , and receive a corresponding ICMP echo reply message from that computer. This overload allows you to specify a time-out value for the operation and control fragmentation and Time-to-Live values for the ICMP echo message packet. - An that identifies the computer that is the destination for the ICMP echo message. - An value that specifies the maximum number of milliseconds (after sending the echo message) to wait for the ICMP echo reply message. - A array that contains data to be sent with the ICMP echo message and returned in the ICMP echo reply message. The array cannot contain more than 65,500 bytes. - A object used to control fragmentation and Time-to-Live values for the ICMP echo message packet. - An object that is passed to the method invoked when the asynchronous operation completes. - address is null. -or- buffer is null. - timeout is less than zero. - A call to is in progress. - address is an IPv6 address and the local computer is running an operating system earlier than Windows 2000. - An exception was thrown while sending or receiving the ICMP messages. See the inner exception for the exact exception that was thrown. - address is not a valid IP address. - This object has been disposed. - The size of buffer exceeds 65500 bytes. - - - Asynchronously attempts to send an Internet Control Message Protocol (ICMP) echo message with the specified data buffer to the specified computer, and receive a corresponding ICMP echo reply message from that computer. This overload allows you to specify a time-out value for the operation. - A that identifies the computer that is the destination for the ICMP echo message. The value specified for this parameter can be a host name or a string representation of an IP address. - An value that specifies the maximum number of milliseconds (after sending the echo message) to wait for the ICMP echo reply message. - A array that contains data to be sent with the ICMP echo message and returned in the ICMP echo reply message. The array cannot contain more than 65,500 bytes. - An object that is passed to the method invoked when the asynchronous operation completes. - hostNameOrAddress is null or is an empty string (""). -or- buffer is null. - timeout is less than zero. - A call to is in progress. - hostNameOrAddress is an IPv6 address and the local computer is running an operating system earlier than Windows 2000. - An exception was thrown while sending or receiving the ICMP messages. See the inner exception for the exact exception that was thrown. - hostNameOrAddress could not be resolved to a valid IP address. - This object has been disposed. - The size of buffer exceeds 65500 bytes. - - - Asynchronously attempts to send an Internet Control Message Protocol (ICMP) echo message with the specified data buffer to the computer that has the specified , and receive a corresponding ICMP echo reply message from that computer. This overload allows you to specify a time-out value for the operation. - An that identifies the computer that is the destination for the ICMP echo message. - An value that specifies the maximum number of milliseconds (after sending the echo message) to wait for the ICMP echo reply message. - A array that contains data to be sent with the ICMP echo message and returned in the ICMP echo reply message. The array cannot contain more than 65,500 bytes. - An object that is passed to the method invoked when the asynchronous operation completes. - address is null. -or- buffer is null. - timeout is less than zero. - A call to is in progress. - address is an IPv6 address and the local computer is running an operating system earlier than Windows 2000. - An exception was thrown while sending or receiving the ICMP messages. See the inner exception for the exact exception that was thrown. - address is not a valid IP address. - This object has been disposed. - The size of buffer exceeds 65500 bytes. - - - Asynchronously attempts to send an Internet Control Message Protocol (ICMP) echo message to the computer that has the specified , and receive a corresponding ICMP echo reply message from that computer. This overload allows you to specify a time-out value for the operation. - An that identifies the computer that is the destination for the ICMP echo message. - An value that specifies the maximum number of milliseconds (after sending the echo message) to wait for the ICMP echo reply message. - An object that is passed to the method invoked when the asynchronous operation completes. - address is null. - timeout is less than zero. - A call to method is in progress. - address is an IPv6 address and the local computer is running an operating system earlier than Windows 2000. - An exception was thrown while sending or receiving the ICMP messages. See the inner exception for the exact exception that was thrown. - address is not a valid IP address. - This object has been disposed. - - - Asynchronously attempts to send an Internet Control Message Protocol (ICMP) echo message to the specified computer, and receive a corresponding ICMP echo reply message from that computer. - A that identifies the computer that is the destination for the ICMP echo message. The value specified for this parameter can be a host name or a string representation of an IP address. - An object that is passed to the method invoked when the asynchronous operation completes. - hostNameOrAddress is null or is an empty string (""). - A call to method is in progress. - address is an IPv6 address and the local computer is running an operating system earlier than Windows 2000. - An exception was thrown while sending or receiving the ICMP messages. See the inner exception for the exact exception that was thrown. - hostNameOrAddress could not be resolved to a valid IP address. - This object has been disposed. - - - Asynchronously attempts to send an Internet Control Message Protocol (ICMP) echo message to the computer that has the specified , and receive a corresponding ICMP echo reply message from that computer. - An that identifies the computer that is the destination for the ICMP echo message. - An object that is passed to the method invoked when the asynchronous operation completes. - address is null. - A call to the method is in progress. - address is an IPv6 address and the local computer is running an operating system earlier than Windows 2000. - An exception was thrown while sending or receiving the ICMP messages. See the inner exception for the exact exception that was thrown. - address is not a valid IP address. - This object has been disposed. - - - Asynchronously attempts to send an Internet Control Message Protocol (ICMP) echo message to the specified computer, and receive a corresponding ICMP echo reply message from that computer. This overload allows you to specify a time-out value for the operation. - A that identifies the computer that is the destination for the ICMP echo message. The value specified for this parameter can be a host name or a string representation of an IP address. - An value that specifies the maximum number of milliseconds (after sending the echo message) to wait for the ICMP echo reply message. - An object that is passed to the method invoked when the asynchronous operation completes. - hostNameOrAddress is null or is an empty string (""). - timeout is less than zero. - A call to is in progress. - hostNameOrAddress is an IPv6 address and the local computer is running an operating system earlier than Windows 2000. - An exception was thrown while sending or receiving the ICMP messages. See the inner exception for the exact exception that was thrown. - hostNameOrAddress could not be resolved to a valid IP address. - This object has been disposed. - - - Cancels all pending asynchronous requests to send an Internet Control Message Protocol (ICMP) echo message and receives a corresponding ICMP echo reply message. - - - Sends an Internet Control Message Protocol (ICMP) echo message with the specified data buffer to the specified computer, and receive a corresponding ICMP echo reply message from that computer as an asynchronous operation. This overload allows you to specify a time-out value for the operation, a buffer to use for send and receive, and control fragmentation and Time-to-Live values for the ICMP echo message packet. - The computer that is the destination for the ICMP echo message. The value specified for this parameter can be a host name or a string representation of an IP address. - The maximum number of milliseconds (after sending the echo message) to wait for the ICMP echo reply message. - A array that contains data to be sent with the ICMP echo message and returned in the ICMP echo reply message. The array cannot contain more than 65,500 bytes. - A object used to control fragmentation and Time-to-Live values for the ICMP echo message packet. - Returns . The task object representing the asynchronous operation. - - - Send an Internet Control Message Protocol (ICMP) echo message with the specified data buffer to the computer that has the specified , and receives a corresponding ICMP echo reply message from that computer as an asynchronous operation. - An IP address that identifies the computer that is the destination for the ICMP echo message. - Returns . The task object representing the asynchronous operation. - address is null. - A call to is in progress. - An exception was thrown while sending or receiving the ICMP messages. See the inner exception for the exact exception that was thrown. - address is not a valid IP address. - This object has been disposed. - - - Sends an Internet Control Message Protocol (ICMP) echo message with the specified data buffer to the specified computer, and receive a corresponding ICMP echo reply message from that computer as an asynchronous operation. - The computer that is the destination for the ICMP echo message. The value specified for this parameter can be a host name or a string representation of an IP address. - Returns . The task object representing the asynchronous operation. - - - Send an Internet Control Message Protocol (ICMP) echo message with the specified data buffer to the computer that has the specified , and receives a corresponding ICMP echo reply message from that computer as an asynchronous operation. This overload allows you to specify a time-out value for the operation. - An IP address that identifies the computer that is the destination for the ICMP echo message. - The maximum number of milliseconds (after sending the echo message) to wait for the ICMP echo reply message. - Returns . The task object representing the asynchronous operation. - - - Sends an Internet Control Message Protocol (ICMP) echo message with the specified data buffer to the specified computer, and receive a corresponding ICMP echo reply message from that computer as an asynchronous operation. This overload allows you to specify a time-out value for the operation. - The computer that is the destination for the ICMP echo message. The value specified for this parameter can be a host name or a string representation of an IP address. - The maximum number of milliseconds (after sending the echo message) to wait for the ICMP echo reply message. - Returns . The task object representing the asynchronous operation. - - - Send an Internet Control Message Protocol (ICMP) echo message with the specified data buffer to the computer that has the specified , and receives a corresponding ICMP echo reply message from that computer as an asynchronous operation. This overload allows you to specify a time-out value for the operation and a buffer to use for send and receive. - An IP address that identifies the computer that is the destination for the ICMP echo message. - The maximum number of milliseconds (after sending the echo message) to wait for the ICMP echo reply message. - A array that contains data to be sent with the ICMP echo message and returned in the ICMP echo reply message. The array cannot contain more than 65,500 bytes. - Returns . The task object representing the asynchronous operation. - address is null. -or- buffer is null. - timeout is less than zero. - A call to is in progress. - An exception was thrown while sending or receiving the ICMP messages. See the inner exception for the exact exception that was thrown. - address is not a valid IP address. - This object has been disposed. - The size of buffer exceeds 65,500 bytes. - - - Sends an Internet Control Message Protocol (ICMP) echo message with the specified data buffer to the specified computer, and receive a corresponding ICMP echo reply message from that computer as an asynchronous operation. This overload allows you to specify a time-out value for the operation and a buffer to use for send and receive. - The computer that is the destination for the ICMP echo message. The value specified for this parameter can be a host name or a string representation of an IP address. - The maximum number of milliseconds (after sending the echo message) to wait for the ICMP echo reply message. - A array that contains data to be sent with the ICMP echo message and returned in the ICMP echo reply message. The array cannot contain more than 65,500 bytes. - Returns . The task object representing the asynchronous operation. - - - Send an Internet Control Message Protocol (ICMP) echo message with the specified data buffer to the computer that has the specified , and receives a corresponding ICMP echo reply message from that computer as an asynchronous operation. This overload allows you to specify a time-out value for the operation, a buffer to use for send and receive, and control fragmentation and Time-to-Live values for the ICMP echo message packet. - An IP address that identifies the computer that is the destination for the ICMP echo message. - The maximum number of milliseconds (after sending the echo message) to wait for the ICMP echo reply message. - A array that contains data to be sent with the ICMP echo message and returned in the ICMP echo reply message. The array cannot contain more than 65,500 bytes. - A object used to control fragmentation and Time-to-Live values for the ICMP echo message packet. - Returns . The task object representing the asynchronous operation. - address is null. -or- buffer is null. - timeout is less than zero. - A call to is in progress. - An exception was thrown while sending or receiving the ICMP messages. See the inner exception for the exact exception that was thrown. - address is not a valid IP address. - This object has been disposed. - The size of buffer exceeds 65,500 bytes. - - - Provides data for the event. - - - Gets an object that contains data that describes an attempt to send an Internet Control Message Protocol (ICMP) echo request message and receive a corresponding ICMP echo reply message. - A object that describes the results of the ICMP echo request. - - - Represents the method that will handle the event of a object. - The source of the event. - A object that contains the event data. - - - The exception that is thrown when a or method calls a method that throws an exception. - - - Initializes a new instance of the class using the specified message. - A that describes the error. - - - Initializes a new instance of the class with serialized data. - The object that holds the serialized object data. - A that specifies the contextual information about the source or destination for this serialization. - - - Initializes a new instance of the class using the specified message and inner exception. - A that describes the error. - The exception that causes the current exception. - - - Used to control how data packets are transmitted. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class and sets the Time to Live and fragmentation values. - An value greater than zero that specifies the number of times that the data packets can be forwarded. - true to prevent data sent to the remote host from being fragmented; otherwise, false. - ttl is less than or equal to zero. - - - Gets or sets a value that controls fragmentation of the data sent to the remote host. - true if the data cannot be sent in multiple packets; otherwise false. The default is false. - - - Gets or sets the number of routing nodes that can forward the data before it is discarded. - An value that specifies the number of times the data packets can be forwarded. The default is 128. - The value specified for a set operation is less than or equal to zero. - - - Provides information about the status and data resulting from a or operation. - - - Gets the address of the host that sends the Internet Control Message Protocol (ICMP) echo reply. - An containing the destination for the ICMP echo message. - - - Gets the buffer of data received in an Internet Control Message Protocol (ICMP) echo reply message. - A array containing the data received in an ICMP echo reply message, or an empty array, if no reply was received. - - - Gets the options used to transmit the reply to an Internet Control Message Protocol (ICMP) echo request. - A object that contains the Time to Live (TTL) and the fragmentation directive used for transmitting the reply if is ; otherwise, null. - - - Gets the number of milliseconds taken to send an Internet Control Message Protocol (ICMP) echo request and receive the corresponding ICMP echo reply message. - An that specifies the round trip time, in milliseconds. - - - Gets the status of an attempt to send an Internet Control Message Protocol (ICMP) echo request and receive the corresponding ICMP echo reply message. - An value indicating the result of the request. - - - Specifies how an IP address network prefix was located. - - - The prefix was supplied by a Dynamic Host Configuration Protocol (DHCP) server. - - - - The prefix was manually configured. - - - - The prefix was located using an unspecified source. - - - - The prefix was supplied by a router advertisement. - - - - The prefix is a well-known prefix. Well-known prefixes are specified in standard-track Request for Comments (RFC) documents and assigned by the Internet Assigned Numbers Authority (Iana) or an address registry. Such prefixes are reserved for special purposes. - - - - The scope level for an IPv6 address. - - - The scope is admin-level. - - - - The scope is global. - - - - The scope is interface-level. - - - - The scope is link-level. - - - - The scope level is not specified. - - - - The scope is organization-level. - - - - The scope is site-level. - - - - The scope is subnet-level. - - - - Specifies how an IP address host suffix was located. - - - The suffix is a link-local suffix. - - - - The suffix was manually configured. - - - - The suffix was supplied by a Dynamic Host Configuration Protocol (DHCP) server. - - - - The suffix was located using an unspecified source. - - - - The suffix was randomly assigned. - - - - The suffix is a well-known suffix. Well-known suffixes are specified in standard-track Request for Comments (RFC) documents and assigned by the Internet Assigned Numbers Authority (Iana) or an address registry. Such suffixes are reserved for special purposes. - - - - Provides information about the Transmission Control Protocol (TCP) connections on the local computer. - - - Initializes a new instance of the class. - - - Gets the local endpoint of a Transmission Control Protocol (TCP) connection. - An instance that contains the IP address and port on the local computer. - - - Gets the remote endpoint of a Transmission Control Protocol (TCP) connection. - An instance that contains the IP address and port on the remote computer. - - - Gets the state of this Transmission Control Protocol (TCP) connection. - One of the enumeration values. - - - Specifies the states of a Transmission Control Protocol (TCP) connection. - - - The TCP connection is closed. - - - - The local endpoint of the TCP connection is waiting for a connection termination request from the local user. - - - - The local endpoint of the TCP connection is waiting for an acknowledgement of the connection termination request sent previously. - - - - The transmission control buffer (TCB) for the TCP connection is being deleted. - - - - The TCP handshake is complete. The connection has been established and data can be sent. - - - - The local endpoint of the TCP connection is waiting for a connection termination request from the remote endpoint or for an acknowledgement of the connection termination request sent previously. - - - - The local endpoint of the TCP connection is waiting for a connection termination request from the remote endpoint. - - - - The local endpoint of the TCP connection is waiting for the final acknowledgement of the connection termination request sent previously. - - - - The local endpoint of the TCP connection is listening for a connection request from any remote endpoint. - - - - The local endpoint of the TCP connection has sent and received a connection request and is waiting for an acknowledgment. - - - - The local endpoint of the TCP connection has sent the remote endpoint a segment header with the synchronize (SYN) control bit set and is waiting for a matching connection request. - - - - The local endpoint of the TCP connection is waiting for enough time to pass to ensure that the remote endpoint received the acknowledgement of its connection termination request. - - - - The TCP connection state is unknown. - - - - Provides Transmission Control Protocol (TCP) statistical data. - - - Initializes a new instance of the class. - - - Gets the number of accepted Transmission Control Protocol (TCP) connection requests. - An value that specifies the total number of TCP connection requests accepted. - - - Gets the number of Transmission Control Protocol (TCP) connection requests made by clients. - An value that specifies the total number of TCP connections initiated by clients. - - - Specifies the total number of Transmission Control Protocol (TCP) connections established. - An value that specifies the total number of connections established. - - - Gets the number of current Transmission Control Protocol (TCP) connections. - An value that specifies the total number of current TCP connections. - - - Gets the number of Transmission Control Protocol (TCP) errors received. - An value that specifies the total number of TCP errors received. - - - Gets the number of failed Transmission Control Protocol (TCP) connection attempts. - An value that specifies the total number of failed TCP connection attempts. - - - Gets the maximum number of supported Transmission Control Protocol (TCP) connections. - An value that specifies the total number of TCP connections that can be supported. - - - Gets the maximum retransmission time-out value for Transmission Control Protocol (TCP) segments. - An value that specifies the maximum number of milliseconds permitted by a TCP implementation for the retransmission time-out value. - - - Gets the minimum retransmission time-out value for Transmission Control Protocol (TCP) segments. - An value that specifies the minimum number of milliseconds permitted by a TCP implementation for the retransmission time-out value. - - - Gets the number of RST packets received by Transmission Control Protocol (TCP) connections. - An value that specifies the total number of reset TCP connections. - - - Gets the number of Transmission Control Protocol (TCP) segments sent with the reset flag set. - An value that specifies the total number of TCP segments sent with the reset flag set. - - - Gets the number of Transmission Control Protocol (TCP) segments received. - An value that specifies the total number of TCP segments received. - - - Gets the number of Transmission Control Protocol (TCP) segments re-sent. - An value that specifies the total number of TCP segments retransmitted. - - - Gets the number of Transmission Control Protocol (TCP) segments sent. - An value that specifies the total number of TCP segments sent. - - - Provides User Datagram Protocol (UDP) statistical data. - - - Initializes a new instance of the class. - - - Gets the number of User Datagram Protocol (UDP) datagrams that were received. - An value that specifies the total number of datagrams that were delivered to UDP users. - - - Gets the number of User Datagram Protocol (UDP) datagrams that were sent. - An value that specifies the total number of datagrams that were sent. - - - Gets the number of User Datagram Protocol (UDP) datagrams that were received and discarded because of port errors. - An value that specifies the total number of received UDP datagrams that were discarded because there was no listening application at the destination port. - - - Gets the number of User Datagram Protocol (UDP) datagrams that were received and discarded because of errors other than bad port information. - An value that specifies the total number of received UDP datagrams that could not be delivered for reasons other than the lack of an application at the destination port. - - - Gets the number of local endpoints that are listening for User Datagram Protocol (UDP) datagrams. - An value that specifies the total number of sockets that are listening for UDP datagrams. - - - Provides information about a network interface's unicast address. - - - Initializes a new instance of the class. - - - Gets the number of seconds remaining during which this address is the preferred address. - An value that specifies the number of seconds left for this address to remain preferred. - This property is not valid on computers running operating systems earlier than Windows XP. - - - Gets the number of seconds remaining during which this address is valid. - An value that specifies the number of seconds left for this address to remain assigned. - This property is not valid on computers running operating systems earlier than Windows XP. - - - Specifies the amount of time remaining on the Dynamic Host Configuration Protocol (DHCP) lease for this IP address. - An value that contains the number of seconds remaining before the computer must release the instance. - - - Gets a value that indicates the state of the duplicate address detection algorithm. - One of the values that indicates the progress of the algorithm in determining the uniqueness of this IP address. - This property is not valid on computers running operating systems earlier than Windows XP. - - - Gets the IPv4 mask. - An object that contains the IPv4 mask. - - - Gets the length, in bits, of the prefix or network part of the IP address. - Returns . the length, in bits, of the prefix or network part of the IP address. - - - Gets a value that identifies the source of a unicast Internet Protocol (IP) address prefix. - One of the values that identifies how the prefix information was obtained. - This property is not valid on computers running operating systems earlier than Windows XP. - - - Gets a value that identifies the source of a unicast Internet Protocol (IP) address suffix. - One of the values that identifies how the suffix information was obtained. - This property is not valid on computers running operating systems earlier than Windows XP. - - - Stores a set of types. - - - Initializes a new instance of the class. - - - Throws a because this operation is not supported for this collection. - The object to be added to the collection. - - - Throws a because this operation is not supported for this collection. - - - Checks whether the collection contains the specified object. - The object to be searched in the collection. - true if the object exists in the collection; otherwise, false. - - - Copies the elements in this collection to a one-dimensional array of type . - A one-dimensional array that receives a copy of the collection. - The zero-based index in array at which the copy begins. - array is null. - index is less than zero. - array is multidimensional. -or- The number of elements in this is greater than the available space from offset to the end of the destination array. - The elements in this cannot be cast automatically to the type of the destination array. - - - Gets the number of types in this collection. - An value that contains the number of types in this collection. - - - Returns an object that can be used to iterate through this collection. - An object that implements the interface and provides access to the types in this collection. - - - Gets a value that indicates whether access to this collection is read-only. - true in all cases. - - - Gets the instance at the specified index in the collection. - The zero-based index of the element. - The at the specified location. - - - Throws a because the collection is read-only and elements cannot be removed. - The object to be removed. - Always throws a . - - - Returns an object that can be used to iterate through this collection. - An object that implements the interface and provides access to the types in this collection. - - - Provides data for the event. - - - Gets a readable stream that contains data downloaded by a method. - A that contains the downloaded data. - - - Represents the method that will handle the event of a . - The source of the event. - A containing event data. - - - Provides data for the event. - - - Gets a writable stream that is used to send data to a server. - A where you can write data to be uploaded. - - - Represents the method that will handle the event of a . - The source of the event. - A containing event data. - - - Indicates how to marshal the data between managed and unmanaged code. - - - Initializes a new instance of the class with the specified value. - The value the data is to be marshaled as. - - - Initializes a new instance of the class with the specified enumeration member. - The value the data is to be marshaled as. - - - Specifies the element type of the unmanaged or . - - - - Specifies the parameter index of the unmanaged iid_is attribute used by COM. - - - - Provides additional information to a custom marshaler. - - - - Specifies the fully qualified name of a custom marshaler. - - - - Implements as a type. - - - - Indicates the element type of the . - - - - Indicates the user-defined element type of the . - - - - Indicates the number of elements in the fixed-length array or the number of characters (not bytes) in a string to import. - - - - Indicates the zero-based parameter that contains the count of array elements, similar to size_is in COM. - - - - Gets the value the data is to be marshaled as. - The value the data is to be marshaled as. - - - The exception that is thrown by the marshaler when it encounters a it does not support. - - - Initializes a new instance of the MarshalDirectiveException class with default properties. - - - Initializes a new instance of the MarshalDirectiveException class with a specified error message. - The error message that specifies the reason for the exception. - - - Initializes a new instance of the MarshalDirectiveException class from serialization data. - The object that holds the serialized object data. - The contextual information about the source or destination. - info is null. - - - Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. - The error message that explains the reason for the exception. - The exception that is the cause of the current exception. If the inner parameter is not null, the current exception is raised in a catch block that handles the inner exception. - - - Indicates that a parameter is optional. - - - Initializes a new instance of the OptionalAttribute class with default values. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Indicates that data should be marshaled from callee back to caller. - - - Initializes a new instance of the class. - - - Indicates that the HRESULT or retval signature transformation that takes place during COM interop calls should be suppressed. - - - Initializes a new instance of the class. - - - Indicates that the attributed assembly is a primary interop assembly. - - - Initializes a new instance of the class with the major and minor version numbers of the type library for which this assembly is the primary interop assembly. - The major version of the type library for which this assembly is the primary interop assembly. - The minor version of the type library for which this assembly is the primary interop assembly. - - - Gets the major version number of the type library for which this assembly is the primary interop assembly. - The major version number of the type library for which this assembly is the primary interop assembly. - - - Gets the minor version number of the type library for which this assembly is the primary interop assembly. - The minor version number of the type library for which this assembly is the primary interop assembly. - - - Allows the user to specify the ProgID of a class. - - - Initializes a new instance of the ProgIdAttribute with the specified ProgID. - The ProgID to be assigned to the class. - - - Gets the ProgID of the class. - The ProgID of the class. - - - Provides a collection of static methods that return information about the common language runtime environment. - - - Tests whether the specified assembly is loaded in the global assembly cache. - The assembly to test. - true if the assembly is loaded in the global assembly cache; otherwise, false. - - - Returns the directory where the common language runtime is installed. - A string that contains the path to the directory where the common language runtime is installed. - - - Returns the specified interface on the specified class. - The identifier for the desired class. - The identifier for the desired interface. - An unmanaged pointer to the requested interface. - IUnknown::QueryInterface failure. - - - Returns an instance of a type that represents a COM object by a pointer to its IUnknown interface. - The identifier for the desired class. - The identifier for the desired interface. - An object that represents the specified unmanaged COM object. - IUnknown::QueryInterface failure. - - - Gets the version number of the common language runtime that is running the current process. - A string containing the version number of the common language runtime. - - - Gets the path to the system configuration file. - The path to the system configuration file. - - - - - - - - - - - - - - - - - - - - - - The exception thrown when the rank of an incoming SAFEARRAY does not match the rank specified in the managed signature. - - - Initializes a new instance of the SafeArrayTypeMismatchException class with default values. - - - Initializes a new instance of the SafeArrayRankMismatchException class with the specified message. - The message that indicates the reason for the exception. - - - Initializes a new instance of the SafeArrayTypeMismatchException class from serialization data. - The object that holds the serialized object data. - The contextual information about the source or destination. - info is null. - - - Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. - The error message that explains the reason for the exception. - The exception that is the cause of the current exception. If the inner parameter is not null, the current exception is raised in a catch block that handles the inner exception. - - - The exception thrown when the type of the incoming SAFEARRAY does not match the type specified in the managed signature. - - - Initializes a new instance of the SafeArrayTypeMismatchException class with default values. - - - Initializes a new instance of the SafeArrayTypeMismatchException class with the specified message. - The message that indicates the reason for the exception. - - - Initializes a new instance of the SafeArrayTypeMismatchException class from serialization data. - The object that holds the serialized object data. - The contextual information about the source or destination. - info is null. - - - Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. - The error message that explains the reason for the exception. - The exception that is the cause of the current exception. If the inner parameter is not null, the current exception is raised in a catch block that handles the inner exception. - - - Provides a controlled memory buffer that can be used for reading and writing. Attempts to access memory outside the controlled buffer (underruns and overruns) raise exceptions. - - - Creates a new instance of the class, and specifies whether the buffer handle is to be reliably released. - true to reliably release the handle during the finalization phase; false to prevent reliable release (not recommended). - - - Obtains a pointer from a object for a block of memory. - A byte pointer, passed by reference, to receive the pointer from within the object. You must set this pointer to null before you call this method. - The method has not been called. - - - Gets the size of the buffer, in bytes. - The number of bytes in the memory buffer. - The method has not been called. - - - Defines the allocation size of the memory region in bytes. You must call this method before you use the instance. - The number of bytes in the buffer. - numBytes is less than zero. -or- numBytes is greater than the available address space. - - - Specifies the allocation size of the memory buffer by using the specified number of elements and element size. You must call this method before you use the instance. - The number of elements in the buffer. - The size of each element in the buffer. - numElements is less than zero. -or- sizeOfEachElement is less than zero. -or- numElements multiplied by sizeOfEachElement is greater than the available address space. - - - Defines the allocation size of the memory region by specifying the number of value types. You must call this method before you use the instance. - The number of elements of the value type to allocate memory for. - The value type to allocate memory for. - numElements is less than zero. -or- numElements multiplied by the size of each element is greater than the available address space. - - - Reads a value type from memory at the specified offset. - The location from which to read the value type. You may have to consider alignment issues. - The value type to read. - The value type that was read from memory. - The method has not been called. - - - Reads the specified number of value types from memory starting at the offset, and writes them into an array starting at the index. - The location from which to start reading. - The output array to write to. - The location in the output array to begin writing to. - The number of value types to read from the input array and to write to the output array. - The value type to read. - index is less than zero. -or- count is less than zero. - array is null. - The length of the array minus the index is less than count. - The method has not been called. - - - Releases a pointer that was obtained by the method. - The method has not been called. - - - Writes a value type to memory at the given location. - The location at which to start writing. You may have to consider alignment issues. - The value to write. - The value type to write. - The method has not been called. - - - Writes the specified number of value types to a memory location by reading bytes starting from the specified location in the input array. - The location in memory to write to. - The input array. - The offset in the array to start reading from. - The number of value types to write. - The value type to write. - array is null. - index or count is less than zero. - The length of the input array minus index is less than count. - The method has not been called. - - - Represents a wrapper class for operating system handles. This class must be inherited. - - - Initializes a new instance of the class with the specified invalid handle value. - The value of an invalid handle (usually 0 or -1). Your implementation of should return true for this value. - true to reliably let release the handle during the finalization phase; otherwise, false (not recommended). - The derived class resides in an assembly without unmanaged code access permission. - - - Marks the handle for releasing and freeing resources. - - - Manually increments the reference counter on instances. - true if the reference counter was successfully incremented; otherwise, false. - - - Returns the value of the field. - An IntPtr representing the value of the field. If the handle has been marked invalid with , this method still returns the original handle value, which can be a stale value. - - - Manually decrements the reference counter on a instance. - - - Releases all resources used by the class. - - - Releases the unmanaged resources used by the class specifying whether to perform a normal dispose operation. - true for a normal dispose operation; false to finalize the handle. - - - Frees all resources associated with the handle. - - - Specifies the handle to be wrapped. - - - - Gets a value indicating whether the handle is closed. - true if the handle is closed; otherwise, false. - - - When overridden in a derived class, gets a value indicating whether the handle value is invalid. - true if the handle value is invalid; otherwise, false. - - - When overridden in a derived class, executes the code required to free the handle. - true if the handle is released successfully; otherwise, in the event of a catastrophic failure, false. In this case, it generates a releaseHandleFailed Managed Debugging Assistant. - - - Sets the handle to the specified pre-existing handle. - The pre-existing handle to use. - - - Marks a handle as no longer used. - - - Represents structured exception handling (SEH) errors. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with a specified message. - The message that indicates the reason for the exception. - - - Initializes a new instance of the class from serialization data. - The object that holds the serialized object data. - The contextual information about the source or destination. - info is null. - - - Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. - The error message that explains the reason for the exception. - The exception that is the cause of the current exception. If the inner parameter is not null, the current exception is raised in a catch block that handles the inner exception. - - - Indicates whether the exception can be recovered from, and whether the code can continue from the point at which the exception was thrown. - Always false, because resumable exceptions are not implemented. - - - Lets you control the physical layout of the data fields of a class or structure in memory. - - - Initalizes a new instance of the class with the specified enumeration member. - A 16-bit integer that represents one of the values that specifes how the class or structure should be arranged. - - - Initalizes a new instance of the class with the specified enumeration member. - One of the enumeration values that specifes how the class or structure should be arranged. - - - Indicates whether string data fields within the class should be marshaled as LPWSTR or LPSTR by default. - - - - Controls the alignment of data fields of a class or structure in memory. - - - - Indicates the absolute size of the class or structure. - - - - Gets the value that specifies how the class or structure is arranged. - One of the enumeration values that specifies how the class or structure is arranged. - - - Provides support for type equivalence. - - - Creates a new instance of the class. - - - Creates a new instance of the class with the specified scope and identifier. - The first type equivalence string. - The second type equivalence string. - - - Gets the value of the identifier parameter that was passed to the constructor. - The value of the constructor's identifier parameter. - - - Gets the value of the scope parameter that was passed to the constructor. - The value of the constructor's scope parameter. - - - Wraps objects the marshaler should marshal as a VT_UNKNOWN. - - - Initializes a new instance of the class with the object to be wrapped. - The object being wrapped. - - - Gets the object contained by this wrapper. - The wrapped object. - - - Controls the marshaling behavior of a delegate signature passed as an unmanaged function pointer to or from unmanaged code. This class cannot be inherited. - - - Initializes a new instance of the class with the specified calling convention. - The specified calling convention. - - - Enables or disables best-fit mapping behavior when converting Unicode characters to ANSI characters. - - - - Gets the value of the calling convention. - The value of the calling convention specified by the constructor. - - - Indicates how to marshal string parameters to the method, and controls name mangling. - - - - Indicates whether the callee calls the SetLastError Win32 API function before returning from the attributed method. - - - - Enables or disables the throwing of an exception on an unmappable Unicode character that is converted to an ANSI "?" character. - - - - Identifies how to marshal parameters or fields to unmanaged code. - - - An ANSI character string that is a length-prefixed single byte. You can use this member on the data type. - - - - A dynamic type that determines the type of an object at run time and marshals the object as that type. This member is valid for platform invoke methods only. - - - - A 4-byte Boolean value (true != 0, false = 0). This is the Win32 BOOL type. - - - - A Unicode character string that is a length-prefixed double byte. You can use this member, which is the default string in COM, on the data type. - - - - When the property is set to ByValArray, the field must be set to indicate the number of elements in the array. The field can optionally contain the of the array elements when it is necessary to differentiate among string types. You can use this only on an array that whose elements appear as fields in a structure. - - - - Used for in-line, fixed-length character arrays that appear within a structure. The character type used with is determined by the argument of the attribute applied to the containing structure. Always use the field to indicate the size of the array. - - - - A currency type. Used on a to marshal the decimal value as a COM currency type instead of as a Decimal. - - - - Specifies the custom marshaler class when used with the or field. The field can be used to pass additional information to the custom marshaler. You can use this member on any reference type. This member is valid for parameters and return values only. It cannot be used on fields. - - - - A native type that is associated with an or an and that causes the parameter to be exported as an HRESULT in the exported type library. - - - - An integer that can be used as a C-style function pointer. You can use this member on a data type or on a type that inherits from a . - - - - A Windows Runtime string. You can use this member on the data type. - - - - A 1-byte signed integer. You can use this member to transform a Boolean value into a 1-byte, C-style bool (true = 1, false = 0). - - - - A 2-byte signed integer. - - - - A 4-byte signed integer. - - - - An 8-byte signed integer. - - - - A COM IDispatch pointer (Object in Microsoft Visual Basic 6.0). - - - - A Windows Runtime interface pointer. You can use this member on the data type. - - - - A COM interface pointer. The of the interface is obtained from the class metadata. Use this member to specify the exact interface type or the default interface type if you apply it to a class. This member produces the same behavior as when you apply it to the data type. - - - - A COM IUnknown pointer. You can use this member on the data type. - - - - A pointer to the first element of a C-style array. When marshaling from managed to unmanaged code, the length of the array is determined by the length of the managed array. When marshaling from unmanaged to managed code, the length of the array is determined from the and fields, optionally followed by the unmanaged type of the elements within the array when it is necessary to differentiate among string types. - - - - A single byte, null-terminated ANSI character string. You can use this member on the and data types. - - - - A pointer to a C-style structure that you use to marshal managed formatted classes. This member is valid for platform invoke methods only. - - - - A platform-dependent character string: ANSI on Windows 98, and Unicode on Windows NT and Windows XP. This value is supported only for platform invoke and not for COM interop, because exporting a string of type LPTStr is not supported. - - - - A 2-byte, null-terminated Unicode character string. - - - - A 4-byte floating-point number. - - - - An 8-byte floating-point number. - - - - A SafeArray, which is a self-describing array that carries the type, rank, and bounds of the associated array data. You can use this member with the field to override the default element type. - - - - A VARIANT, which is used to marshal managed formatted classes and value types. - - - - A platform-dependent, signed integer: 4 bytes on 32-bit Windows, 8 bytes on 64-bit Windows. - - - - A platform-dependent, unsigned integer: 4 bytes on 32-bit Windows, 8 bytes on 64-bit Windows. - - - - A length-prefixed, platform-dependent char string: ANSI on Windows 98, Unicode on Windows NT. You rarely use this BSTR-like member. - - - - A 1-byte unsigned integer. - - - - A 2-byte unsigned integer. - - - - A 4-byte unsigned integer. - - - - An 8-byte unsigned integer. - - - - A 2-byte, OLE-defined VARIANT_BOOL type (true = -1, false = 0). - - - - A value that enables Visual Basic to change a string in unmanaged code and have the results reflected in managed code. This value is only supported for platform invoke. - - - - Indicates how to marshal the array elements when an array is marshaled from managed to unmanaged code as a . - - - Indicates a SAFEARRAY pointer. - - - - Indicates length prefixed bytes. - - - - Indicates that a blob contains an object. - - - - Indicates a Boolean value. - - - - Indicates a BSTR string. - - - - Indicates that a value is a reference. - - - - Indicates a C style array. - - - - Indicates the clipboard format. - - - - Indicates a class ID. - - - - Indicates a currency value. - - - - Indicates a DATE value. - - - - Indicates a decimal value. - - - - Indicates an IDispatch pointer. - - - - Indicates that a value was not specified. - - - - Indicates an SCODE. - - - - Indicates a FILETIME value. - - - - Indicates an HRESULT. - - - - Indicates a char value. - - - - Indicates a short integer. - - - - Indicates a long integer. - - - - Indicates a 64-bit integer. - - - - Indicates an integer value. - - - - Indicates a null-terminated string. - - - - Indicates a wide string terminated by null. - - - - Indicates a null value, similar to a null value in SQL. - - - - Indicates a pointer type. - - - - Indicates a float value. - - - - Indicates a double value. - - - - Indicates a user defined type. - - - - Indicates a SAFEARRAY. Not valid in a VARIANT. - - - - Indicates that the name of a storage follows. - - - - Indicates that a storage contains an object. - - - - Indicates that the name of a stream follows. - - - - Indicates that a stream contains an object. - - - - Indicates a byte. - - - - Indicates an unsigned``short. - - - - Indicates an unsigned``long. - - - - Indicates an 64-bit unsigned integer. - - - - Indicates an unsigned integer value. - - - - Indicates an IUnknown pointer. - - - - Indicates a user defined type. - - - - Indicates a VARIANT far pointer. - - - - Indicates a simple, counted array. - - - - Indicates a C style void. - - - - Defines claim value types according to the type URIs defined by W3C and OASIS. This class cannot be inherited. - - - A URI that represents the base64Binary XML data type. - - - - A URI that that represents the base64Octet XML data type. - - - - A URI that represents the boolean XML data type. - - - - A URI that represents the date XML data type. - - - - A URI that represents the dateTime XML data type. - - - - A URI that represents the daytimeDuration XQuery data type. - - - - A URI that represents the dns SOAP data type. - - - - A URI that represents the double XML data type. - - - - A URI that represents the DSAKeyValue XML Signature data type. - - - - A URI that represents the emailaddress SOAP data type. - - - - A URI that represents the fqbn XML data type. - - - - A URI that represents the hexBinary XML data type. - - - - A URI that represents the integer XML data type. - - - - A URI that represents the integer32 XML data type. - - - - A URI that represents the integer64 XML data type. - - - - A URI that represents the KeyInfo XML Signature data type. - - - - A URI that represents the rfc822Name XACML 1.0 data type. - - - - A URI that represents the rsa SOAP data type. - - - - A URI that represents the RSAKeyValue XML Signature data type. - - - - A URI that represents the sid XML data type. - - - - A URI that represents the string XML data type. - - - - A URI that represents the time XML data type. - - - - A URI that represents the uinteger32 XML data type. - - - - A URI that represents the uinteger64 XML data type. - - - - A URI that represents the UPN SOAP data type. - - - - A URI that represents the x500Name XACML 1.0 data type. - - - - A URI that represents the yearMonthDuration XQuery data type. - - - - Represents the abstract base class from which all implementations of the Advanced Encryption Standard (AES) must inherit. - - - Initializes a new instance of the class. - - - Creates a cryptographic object that is used to perform the symmetric algorithm. - A cryptographic object that is used to perform the symmetric algorithm. - - - Creates a cryptographic object that specifies the implementation of AES to use to perform the symmetric algorithm. - The name of the specific implementation of AES to use. - A cryptographic object that is used to perform the symmetric algorithm. - The algorithmName parameter is null. - - - Performs symmetric encryption and decryption using the Cryptographic Application Programming Interfaces (CAPI) implementation of the Advanced Encryption Standard (AES) algorithm. - - - Initializes a new instance of the class. - There is no supported key size for the current platform. - - - Creates a symmetric AES decryptor object using the current key and initialization vector (IV). - A symmetric AES decryptor object. - The current key is invalid or missing. - - - Creates a symmetric AES decryptor object using the specified key and initialization vector (IV). - - - A symmetric AES decryptor object. - key or iv is null. - key is invalid. - - - Creates a symmetric AES encryptor object using the current key and initialization vector (IV). - A symmetric AES encryptor object. - - - Creates a symmetric encryptor object using the specified key and initialization vector (IV). - - - A symmetric AES encryptor object. - The key or iv parameter is null. - key is invalid. - - - Generates a random initialization vector (IV) to use for the algorithm. - The initialization vector (IV) could not be generated. - - - Generates a random key to use for the algorithm. - The key could not be generated. - - - Gets or sets the symmetric key that is used for encryption and decryption. - The symmetric key that is used for encryption and decryption. - The value for the key is null. - The size of the key is invalid. - - - Gets or sets the size, in bits, of the secret key. - The size, in bits, of the key. - - - Provides a managed implementation of the Advanced Encryption Standard (AES) symmetric algorithm. - - - Initializes a new instance of the class. - The Windows security policy setting for FIPS is enabled. - This implementation is not part of the Windows Platform FIPS-validated cryptographic algorithms. - - - Creates a symmetric decryptor object using the current key and initialization vector (IV). - A symmetric decryptor object. - - - Creates a symmetric decryptor object using the specified key and initialization vector (IV). - The secret key to use for the symmetric algorithm. - The initialization vector to use for the symmetric algorithm. - A symmetric decryptor object. - key or iv is null. - key is invalid. - - - Creates a symmetric encryptor object using the current key and initialization vector (IV). - A symmetric encryptor object. - - - Creates a symmetric encryptor object using the specified key and initialization vector (IV). - The secret key to use for the symmetric algorithm. - The initialization vector to use for the symmetric algorithm. - A symmetric encryptor object. - key or iv is null. - key is invalid. - - - Gets or sets the number of bits to use as feedback. - The feedback size, in bits. - - - Generates a random initialization vector (IV) to use for the symmetric algorithm. - - - Generates a random key to use for the symmetric algorithm. - - - Gets or sets the initialization vector (IV) to use for the symmetric algorithm. - The initialization vector to use for the symmetric algorithm - - - Gets or sets the secret key used for the symmetric algorithm. - The key for the symmetric algorithm. - - - Gets or sets the size, in bits, of the secret key used for the symmetric algorithm. - The size, in bits, of the key used by the symmetric algorithm. - - - Gets or sets the mode for operation of the symmetric algorithm. - One of the enumeration values that specifies the block cipher mode to use for encryption. The default is . - is set to or . - - - Gets or sets the padding mode used in the symmetric algorithm. - One of the enumeration values that specifies the type of padding to apply. The default is . - - - Represents Abstract Syntax Notation One (ASN.1)-encoded data. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class using a byte array. - A byte array that contains Abstract Syntax Notation One (ASN.1)-encoded data. - - - Initializes a new instance of the class using an instance of the class. - An instance of the class. - asnEncodedData is null. - - - Initializes a new instance of the class using an object and a byte array. - An object. - A byte array that contains Abstract Syntax Notation One (ASN.1)-encoded data. - - - Initializes a new instance of the class using a byte array. - A string that represents information. - A byte array that contains Abstract Syntax Notation One (ASN.1)-encoded data. - - - Copies information from an object. - The object to base the new object on. - asnEncodedData is null. - - - Returns a formatted version of the Abstract Syntax Notation One (ASN.1)-encoded data as a string. - true if the return string should contain carriage returns; otherwise, false. - A formatted string that represents the Abstract Syntax Notation One (ASN.1)-encoded data. - - - Gets or sets the value for an object. - An object. - - - Gets or sets the Abstract Syntax Notation One (ASN.1)-encoded data represented in a byte array. - A byte array that represents the Abstract Syntax Notation One (ASN.1)-encoded data. - The value is null. - - - Represents a collection of objects. This class cannot be inherited. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class and adds an object to the collection. - The object to add to the collection. - - - Adds an object to the object. - The object to add to the collection. - The index of the added object. - asnEncodedData is null. - One of the OIDs is null and the OIDs do not match. - - - Copies the object into an array. - The array that the object is to be copied into. - The location where the copy operation starts. - - - Gets the number of objects in a collection. - The number of objects. - - - Returns an object that can be used to navigate the object. - An object. - - - Gets a value that indicates whether access to the object is thread safe. - false in all cases. - - - Gets an object from the object. - The location in the collection. - An object. - - - Removes an object from the object. - The object to remove. - asnEncodedData is null. - - - Gets an object that can be used to synchronize access to the object. - An object used to synchronize access to the object. - - - Copies the object into an array. - The array that the object is to be copied into. - The location where the copy operation starts. - The length for index is invalid. - array is null. - The length for index is out of range. - - - Returns an object that can be used to navigate the object. - An object that can be used to navigate the collection. - - - Provides the ability to navigate through an object. This class cannot be inherited. - - - Gets the current object in an object. - The current object in the collection. - - - Advances to the next object in an object. - true, if the enumerator was successfully advanced to the next element; false, if the enumerator has passed the end of the collection. - The collection was modified after the enumerator was created. - - - Sets an enumerator to its initial position. - The collection was modified after the enumerator was created. - - - Gets the current object in an object. - The current object. - - - Represents the abstract base class from which all implementations of asymmetric algorithms must inherit. - - - Initializes a new instance of the class. - The implementation of the derived class is not valid. - - - Releases all resources used by the class. - - - Creates a default cryptographic object used to perform the asymmetric algorithm. - A new instance, unless the default settings have been changed with the element. - - - Creates an instance of the specified implementation of an asymmetric algorithm. -

The asymmetric algorithm implementation to use. The following table shows the valid values for the algName parameter and the algorithms they map to.

-
Parameter value

-

Implements

-

System.Security.Cryptography.AsymmetricAlgorithm

-

RSA

-

System.Security.Cryptography.RSA

-

DSA

-

System.Security.Cryptography.DSA

-

ECDsa

-

ECDsaCng

-

System.Security.Cryptography.ECDsaCng

-

ECDH

-

ECDiffieHellman

-

ECDiffieHellmanCng

-

System.Security.Cryptography.ECDiffieHellmanCng

-

- - A new instance of the specified asymmetric algorithm implementation. -
- - Releases all resources used by the current instance of the class. - - - Releases the unmanaged resources used by the class and optionally releases the managed resources. - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - When overridden in a derived class, reconstructs an object from an XML string. Otherwise, throws a . - The XML string to use to reconstruct the object. - - - When overridden in a derived class, gets the name of the key exchange algorithm. Otherwise, throws an . - The name of the key exchange algorithm. - - - Gets or sets the size, in bits, of the key modulus used by the asymmetric algorithm. - The size, in bits, of the key modulus used by the asymmetric algorithm. - The key modulus size is invalid. - - - Represents the size, in bits, of the key modulus used by the asymmetric algorithm. - - - - Gets the key sizes that are supported by the asymmetric algorithm. - An array that contains the key sizes supported by the asymmetric algorithm. - - - Specifies the key sizes that are supported by the asymmetric algorithm. - - - - When implemented in a derived class, gets the name of the signature algorithm. Otherwise, always throws a . - The name of the signature algorithm. - - - When overridden in a derived class, creates and returns an XML string representation of the current object. Otherwise, throws a . - true to include private parameters; otherwise, false. - An XML string encoding of the current object. - - - Represents the base class from which all asymmetric key exchange deformatters derive. - - - Initializes a new instance of . - - - When overridden in a derived class, extracts secret information from the encrypted key exchange data. - The key exchange data within which the secret information is hidden. - The secret information derived from the key exchange data. - - - When overridden in a derived class, gets or sets the parameters for the asymmetric key exchange. - A string in XML format containing the parameters of the asymmetric key exchange operation. - - - When overridden in a derived class, sets the private key to use for decrypting the secret information. - The instance of the implementation of that holds the private key. - - - Represents the base class from which all asymmetric key exchange formatters derive. - - - Initializes a new instance of . - - - When overridden in a derived class, creates the encrypted key exchange data from the specified input data. - The secret information to be passed in the key exchange. - The encrypted key exchange data to be sent to the intended recipient. - - - When overridden in a derived class, creates the encrypted key exchange data from the specified input data. - The secret information to be passed in the key exchange. - This parameter is not used in the current version. - The encrypted key exchange data to be sent to the intended recipient. - - - When overridden in a derived class, gets the parameters for the asymmetric key exchange. - A string in XML format containing the parameters of the asymmetric key exchange operation. - - - When overridden in a derived class, sets the public key to use for encrypting the secret information. - The instance of the implementation of that holds the public key. - - - Represents the abstract base class from which all implementations of asymmetric signature deformatters derive. - - - Initializes a new instance of . - - - When overridden in a derived class, sets the hash algorithm to use for verifying the signature. - The name of the hash algorithm to use for verifying the signature. - - - When overridden in a derived class, sets the public key to use for verifying the signature. - The instance of an implementation of that holds the public key. - - - When overridden in a derived class, verifies the signature for the specified data. - The data signed with rgbSignature. - The signature to be verified for rgbHash. - true if rgbSignature matches the signature computed using the specified hash algorithm and key on rgbHash; otherwise, false. - - - Verifies the signature from the specified hash value. - The hash algorithm to use to verify the signature. - The signature to be verified. - true if the signature is valid for the hash; otherwise, false. - The hash parameter is null. - - - Represents the base class from which all implementations of asymmetric signature formatters derive. - - - Initializes a new instance of . - - - When overridden in a derived class, creates the signature for the specified data. - The data to be signed. - The digital signature for the rgbHash parameter. - - - Creates the signature from the specified hash value. - The hash algorithm to use to create the signature. - The signature for the specified hash value. - The hash parameter is null. - - - When overridden in a derived class, sets the hash algorithm to use for creating the signature. - The name of the hash algorithm to use for creating the signature. - - - When overridden in a derived class, sets the asymmetric algorithm to use to create the signature. - The instance of the implementation of to use to create the signature. - - - Specifies the block cipher mode to use for encryption. - - - The Cipher Block Chaining (CBC) mode introduces feedback. Before each plain text block is encrypted, it is combined with the cipher text of the previous block by a bitwise exclusive OR operation. This ensures that even if the plain text contains many identical blocks, they will each encrypt to a different cipher text block. The initialization vector is combined with the first plain text block by a bitwise exclusive OR operation before the block is encrypted. If a single bit of the cipher text block is mangled, the corresponding plain text block will also be mangled. In addition, a bit in the subsequent block, in the same position as the original mangled bit, will be mangled. - - - - The Cipher Feedback (CFB) mode processes small increments of plain text into cipher text, instead of processing an entire block at a time. This mode uses a shift register that is one block in length and is divided into sections. For example, if the block size is 8 bytes, with one byte processed at a time, the shift register is divided into eight sections. If a bit in the cipher text is mangled, one plain text bit is mangled and the shift register is corrupted. This results in the next several plain text increments being mangled until the bad bit is shifted out of the shift register. The default feedback size can vary by algorithm, but is typically either 8 bits or the number of bits of the block size. You can alter the number of feedback bits by using the property. Algorithms that support CFB use this property to set the feedback. - - - - The Cipher Text Stealing (CTS) mode handles any length of plain text and produces cipher text whose length matches the plain text length. This mode behaves like the CBC mode for all but the last two blocks of the plain text. - - - - The Electronic Codebook (ECB) mode encrypts each block individually. Any blocks of plain text that are identical and in the same message, or that are in a different message encrypted with the same key, will be transformed into identical cipher text blocks. Important: This mode is not recommended because it opens the door for multiple security exploits. If the plain text to be encrypted contains substantial repetition, it is feasible for the cipher text to be broken one block at a time. It is also possible to use block analysis to determine the encryption key. Also, an active adversary can substitute and exchange individual blocks without detection, which allows blocks to be saved and inserted into the stream at other points without detection. - - - - The Output Feedback (OFB) mode processes small increments of plain text into cipher text instead of processing an entire block at a time. This mode is similar to CFB; the only difference between the two modes is the way that the shift register is filled. If a bit in the cipher text is mangled, the corresponding bit of plain text will be mangled. However, if there are extra or missing bits from the cipher text, the plain text will be mangled from that point on. - - - - Accesses the cryptography configuration information. - - - Initializes a new instance of the class. - - - Adds a set of names to algorithm mappings to be used for the current application domain. - The algorithm to map to. - An array of names to map to the algorithm. - The algorithm or names parameter is null. - algorithm cannot be accessed from outside the assembly. -or- One of the entries in the names parameter is empty or null. - - - Adds a set of names to object identifier (OID) mappings to be used for the current application domain. - The object identifier (OID) to map to. - An array of names to map to the OID. - The oid or names parameter is null. - One of the entries in the names parameter is empty or null. - - - Indicates whether the runtime should enforce the policy to create only Federal Information Processing Standard (FIPS) certified algorithms. - true to enforce the policy; otherwise, false. - - - Creates a new instance of the specified cryptographic object. - The simple name of the cryptographic object of which to create an instance. - A new instance of the specified cryptographic object. - The name parameter is null. - The algorithm described by the name parameter was used with Federal Information Processing Standards (FIPS) mode enabled, but is not FIPS compatible. - - - Creates a new instance of the specified cryptographic object with the specified arguments. - The simple name of the cryptographic object of which to create an instance. - The arguments used to create the specified cryptographic object. - A new instance of the specified cryptographic object. - The name parameter is null. - The algorithm described by the name parameter was used with Federal Information Processing Standards (FIPS) mode enabled, but is not FIPS compatible. - - - Encodes the specified object identifier (OID). - The OID to encode. - A byte array containing the encoded OID. - The str parameter is null. - An error occurred while encoding the OID. - - - Gets the object identifier (OID) of the algorithm corresponding to the specified simple name. - The simple name of the algorithm for which to get the OID. - The OID of the specified algorithm. - The name parameter is null. - - - The exception that is thrown when an error occurs during a cryptographic operation. - - - Initializes a new instance of the class with default properties. - - - Initializes a new instance of the class with the specified HRESULT error code. - The HRESULT error code. - - - Initializes a new instance of the class with a specified error message. - The error message that explains the reason for the exception. - - - Initializes a new instance of the class with serialized data. - The object that holds the serialized object data. - The contextual information about the source or destination. - - - Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. - The error message that explains the reason for the exception. - The exception that is the cause of the current exception. If the inner parameter is not null, the current exception is raised in a catch block that handles the inner exception. - - - Initializes a new instance of the class with a specified error message in the specified format. - The format used to output the error message. - The error message that explains the reason for the exception. - - - The exception that is thrown when an unexpected operation occurs during a cryptographic operation. - - - Initializes a new instance of the class with default properties. - - - Initializes a new instance of the class with a specified error message. - The error message that explains the reason for the exception. - - - Initializes a new instance of the class with serialized data. - The object that holds the serialized object data. - The contextual information about the source or destination. - - - Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. - The error message that explains the reason for the exception. - The exception that is the cause of the current exception. If the inner parameter is not null, the current exception is raised in a catch block that handles the inner exception. - - - Initializes a new instance of the class with a specified error message in the specified format. - The format used to output the error message. - The error message that explains the reason for the exception. - - - Defines a stream that links data streams to cryptographic transformations. - - - Initializes a new instance of the class with a target data stream, the transformation to use, and the mode of the stream. - The stream on which to perform the cryptographic transformation. - The cryptographic transformation that is to be performed on the stream. - One of the values. - stream is invalid. - - - Gets a value indicating whether the current is readable. - true if the current stream is readable; otherwise, false. - - - Gets a value indicating whether you can seek within the current . - Always false. - - - Gets a value indicating whether the current is writable. - true if the current stream is writable; otherwise, false. - - - Releases all resources used by the . - - - Releases the unmanaged resources used by the and optionally releases the managed resources. - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - Clears all buffers for the current stream and causes any buffered data to be written to the underlying device. - - - Clears all buffers for the current stream asynchronously, causes any buffered data to be written to the underlying device, and monitors cancellation requests. - The token to monitor for cancellation requests. The default value is . - A task that represents the asynchronous flush operation. - The stream has been disposed. - - - Updates the underlying data source or repository with the current state of the buffer, then clears the buffer. - The key is corrupt which can cause invalid padding to the stream. - The current stream is not writable. -or- The final block has already been transformed. - - - Gets a value indicating whether the final buffer block has been written to the underlying stream. - true if the final block has been flushed; otherwise, false. - - - Gets the length in bytes of the stream. - This property is not supported. - This property is not supported. - - - Gets or sets the position within the current stream. - This property is not supported. - This property is not supported. - - - Reads a sequence of bytes from the current stream and advances the position within the stream by the number of bytes read. - An array of bytes. A maximum of count bytes are read from the current stream and stored in buffer. - The byte offset in buffer at which to begin storing the data read from the current stream. - The maximum number of bytes to be read from the current stream. - The total number of bytes read into the buffer. This can be less than the number of bytes requested if that many bytes are not currently available, or zero if the end of the stream has been reached. - The associated with current object does not match the underlying stream. For example, this exception is thrown when using with an underlying stream that is write only. - The offset parameter is less than zero. -or- The count parameter is less than zero. - Thesum of the count and offset parameters is longer than the length of the buffer. - - - Reads a sequence of bytes from the current stream asynchronously, advances the position within the stream by the number of bytes read, and monitors cancellation requests. - The buffer to write the data into. - The byte offset in buffer at which to begin writing data from the stream. - The maximum number of bytes to read. - The token to monitor for cancellation requests. The default value is . - A task that represents the asynchronous read operation. The value of the task object's TResult parameter contains the total number of bytes read into the buffer. The result can be less than the number of bytes requested if the number of bytes currently available is less than the requested number, or it can be 0 (zero) if the end of the stream has been reached. - buffer is null. - offset or count is negative. - The sum of offset and count is larger than the buffer length. - The stream does not support reading. - The stream has been disposed. - The stream is currently in use by a previous read operation. - - - Sets the position within the current stream. - A byte offset relative to the origin parameter. - A object indicating the reference point used to obtain the new position. - This method is not supported. - This method is not supported. - - - Sets the length of the current stream. - The desired length of the current stream in bytes. - This property exists only to support inheritance from , and cannot be used. - - - Writes a sequence of bytes to the current and advances the current position within the stream by the number of bytes written. - An array of bytes. This method copies count bytes from buffer to the current stream. - The byte offset in buffer at which to begin copying bytes to the current stream. - The number of bytes to be written to the current stream. - The associated with current object does not match the underlying stream. For example, this exception is thrown when using with an underlying stream that is read only. - The offset parameter is less than zero. -or- The count parameter is less than zero. - The sum of the count and offset parameters is longer than the length of the buffer. - - - Writes a sequence of bytes to the current stream asynchronously, advances the current position within the stream by the number of bytes written, and monitors cancellation requests. - The buffer to write data from. - The zero-based byte offset in buffer from which to begin writing bytes to the stream. - The maximum number of bytes to write. - The token to monitor for cancellation requests. The default value is . - A task that represents the asynchronous write operation. - buffer is null. - offset or count is negative. - The sum of offset and count is larger than the buffer length. - The stream does not support writing. - The stream has been disposed. - The stream is currently in use by a previous write operation. - - - Specifies the mode of a cryptographic stream. - - - Read access to a cryptographic stream. - - - - Write access to a cryptographic stream. - - - - Provides additional information about a cryptographic key pair. This class cannot be inherited. - - - Initializes a new instance of the class using the specified parameters. - A object that provides information about the key. - - - Gets a value indicating whether a key in a key container is accessible. - true if the key is accessible; otherwise, false. - The key type is not supported. - - - Gets a value indicating whether a key can be exported from a key container. - true if the key can be exported; otherwise, false. - The key type is not supported. - The cryptographic service provider cannot be found. -or- The key container was not found. - - - Gets a value indicating whether a key is a hardware key. - true if the key is a hardware key; otherwise, false. - The cryptographic service provider cannot be found. - - - Gets a key container name. - The key container name. - - - Gets a value that describes whether an asymmetric key was created as a signature key or an exchange key. - One of the values that describes whether an asymmetric key was created as a signature key or an exchange key. - - - Gets a value indicating whether a key is from a machine key set. - true if the key is from the machine key set; otherwise, false. - - - Gets a value indicating whether a key pair is protected. - true if the key pair is protected; otherwise, false. - The key type is not supported. - The cryptographic service provider cannot be found. -or- The key container was not found. - - - Gets the provider name of a key. - The provider name. - - - Gets the provider type of a key. - The provider type. The default is 1. - - - Gets a value indicating whether a key container was randomly generated by a managed cryptography class. - true if the key container was randomly generated; otherwise, false. - - - Gets a value indicating whether a key can be removed from a key container. - true if the key is removable; otherwise, false. - The cryptographic service provider (CSP) was not found. - - - Gets a unique key container name. - The unique key container name. - The key type is not supported. - The cryptographic service provider cannot be found. -or- The key container was not found. - - - Contains parameters that are passed to the cryptographic service provider (CSP) that performs cryptographic computations. This class cannot be inherited. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with the specified provider type code. - A provider type code that specifies the kind of provider to create. - - - Initializes a new instance of the class with the specified provider type code and name. - A provider type code that specifies the kind of provider to create. - A provider name. - - - Initializes a new instance of the class with the specified provider type code and name, and the specified container name. - The provider type code that specifies the kind of provider to create. - A provider name. - A container name. - - - Represents the flags for that modify the behavior of the cryptographic service provider (CSP). - An enumeration value, or a bitwise combination of enumeration values. - Value is not a valid enumeration value. - - - Represents the key container name for . - - - - Specifies whether an asymmetric key is created as a signature key or an exchange key. - - - - Gets or sets a password associated with a smart card key. - A password associated with a smart card key. - - - Gets or sets a handle to the unmanaged parent window for a smart card password dialog box. - A handle to the parent window for a smart card password dialog box. - - - Represents the provider name for . - - - - Represents the provider type code for . - - - - Specifies flags that modify the behavior of the cryptographic service providers (CSP). - - - Create a temporary key that is released when the associated Rivest-Shamir-Adleman (RSA) object is closed. Do not use this flag if you want your key to be independent of the RSA object. - - - - Do not specify any settings. - - - - Prevent the CSP from displaying any user interface (UI) for this context. - - - - Allow a key to be exported for archival or recovery. - - - - Use key information from the default key container. - - - - Use key information from the current key. - - - - Use key information from the computer's key store. - - - - Use key information that cannot be exported. - - - - Notify the user through a dialog box or another method when certain actions are attempting to use a key. This flag is not compatible with the flag. - - - - Represents the abstract base class from which all classes that derive byte sequences of a specified length inherit. - - - Initializes a new instance of the class. - - - When overridden in a derived class, releases all resources used by the current instance of the class. - - - When overridden in a derived class, releases the unmanaged resources used by the class and optionally releases the managed resources. - true to release both managed and unmanaged resources; false to release only unmanaged resources. - - - When overridden in a derived class, returns pseudo-random key bytes. - The number of pseudo-random key bytes to generate. - A byte array filled with pseudo-random key bytes. - - - When overridden in a derived class, resets the state of the operation. - - - Represents the base class for the Data Encryption Standard (DES) algorithm from which all implementations must derive. - - - Initializes a new instance of the class. - - - Creates an instance of a cryptographic object to perform the Data Encryption Standard () algorithm. - A cryptographic object. - - - Creates an instance of a cryptographic object to perform the specified implementation of the Data Encryption Standard () algorithm. - The name of the specific implementation of to use. - A cryptographic object. - - - Determines whether the specified key is semi-weak. - The secret key to test for semi-weakness. - true if the key is semi-weak; otherwise, false. - The size of the rgbKey parameter is not valid. - - - Determines whether the specified key is weak. - The secret key to test for weakness. - true if the key is weak; otherwise, false. - The size of the rgbKey parameter is not valid. - - - Gets or sets the secret key for the Data Encryption Standard () algorithm. - The secret key for the algorithm. - An attempt was made to set the key to null. - An attempt was made to set a key whose length is not equal to . - An attempt was made to set a weak key (see ) or a semi-weak key (see ). - - - Defines a wrapper object to access the cryptographic service provider (CSP) version of the Data Encryption Standard () algorithm. This class cannot be inherited. - - - Initializes a new instance of the class. - The Data Encryption Standard () cryptographic service provider is not available. - - - Creates a symmetric Data Encryption Standard () decryptor object with the specified key () and initialization vector (). - The secret key to use for the symmetric algorithm. - The initialization vector to use for the symmetric algorithm. - A symmetric decryptor object. - The value of the property is . -or- The value of the property is and the value of the property is not 8. -or- An invalid key size was used. -or- The algorithm key size was not available. - - - Creates a symmetric Data Encryption Standard () encryptor object with the specified key () and initialization vector (). - The secret key to use for the symmetric algorithm. - The initialization vector to use for the symmetric algorithm. - A symmetric encryptor object. - The value of the property is . -or- The value of the property is and the value of the property is not 8. -or- An invalid key size was used. -or- The algorithm key size was not available. - - - Generates a random initialization vector () to use for the algorithm. - - - Generates a random key () to be used for the algorithm. - - - Represents the abstract base class from which all implementations of the Digital Signature Algorithm () must inherit. - - - Initializes a new instance of the class. - - - Creates the default cryptographic object used to perform the asymmetric algorithm. - A cryptographic object used to perform the asymmetric algorithm. - - - Creates the specified cryptographic object used to perform the asymmetric algorithm. - The name of the specific implementation of to use. - A cryptographic object used to perform the asymmetric algorithm. - - - When overridden in a derived class, creates the signature for the specified data. - The data to be signed. - The digital signature for the specified data. - - - When overridden in a derived class, exports the . - true to include private parameters; otherwise, false. - The parameters for . - - - Reconstructs a object from an XML string. - The XML string to use to reconstruct the object. - The xmlString parameter is null. - The format of the xmlString parameter is not valid. - - - When overridden in a derived class, imports the specified . - The parameters for . - - - Creates and returns an XML string representation of the current object. - true to include private parameters; otherwise, false. - An XML string encoding of the current object. - - - When overridden in a derived class, verifies the signature for the specified data. - The hash of the data signed with rgbSignature. - The signature to be verified for rgbData. - true if rgbSignature matches the signature computed using the specified hash algorithm and key on rgbHash; otherwise, false. - - - Defines a wrapper object to access the cryptographic service provider (CSP) implementation of the algorithm. This class cannot be inherited. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with the specified key size. - The size of the key for the asymmetric algorithm in bits. - - - Initializes a new instance of the class with the specified parameters for the cryptographic service provider (CSP). - The parameters for the CSP. - - - Initializes a new instance of the class with the specified key size and parameters for the cryptographic service provider (CSP). - The size of the key for the cryptographic algorithm in bits. - The parameters for the CSP. - The CSP cannot be acquired. -or- The key cannot be created. - dwKeySize is out of range. - - - Creates the signature for the specified data. - The data to be signed. - The digital signature for the specified data. - - - Gets a object that describes additional information about a cryptographic key pair. - A object that describes additional information about a cryptographic key pair. - - - Exports a blob containing the key information associated with a object. - true to include the private key; otherwise, false. - A byte array containing the key information associated with a object. - - - Exports the . - true to include private parameters; otherwise, false. - The parameters for . - The key cannot be exported. - - - Imports a blob that represents DSA key information. - A byte array that represents a DSA key blob. - - - Imports the specified . - The parameters for . - The cryptographic service provider (CSP) cannot be acquired. -or- The parameters parameter has missing fields. - - - Gets the name of the key exchange algorithm. - The name of the key exchange algorithm. - - - Gets the size of the key used by the asymmetric algorithm in bits. - The size of the key used by the asymmetric algorithm. - - - Gets or sets a value indicating whether the key should be persisted in the cryptographic service provider (CSP). - true if the key should be persisted in the CSP; otherwise, false. - - - Gets a value that indicates whether the object contains only a public key. - true if the object contains only a public key; otherwise, false. - - - Gets the name of the signature algorithm. - The name of the signature algorithm. - - - Computes the hash value of the specified byte array and signs the resulting hash value. - The input data for which to compute the hash. - The signature for the specified data. - - - Computes the hash value of the specified input stream and signs the resulting hash value. - The input data for which to compute the hash. - The signature for the specified data. - - - Signs a byte array from the specified start point to the specified end point. - The input data to sign. - The offset into the array from which to begin using data. - The number of bytes in the array to use as data. - The signature for the specified data. - - - Computes the signature for the specified hash value by encrypting it with the private key. - The hash value of the data to be signed. - The name of the hash algorithm used to create the hash value of the data. - The signature for the specified hash value. - The rgbHash parameter is null. - The cryptographic service provider (CSP) cannot be acquired. -or- There is no private key. - - - Gets or sets a value indicating whether the key should be persisted in the computer's key store instead of the user profile store. - true if the key should be persisted in the computer key store; otherwise, false. - - - Verifies the specified signature data by comparing it to the signature computed for the specified data. - The data that was signed. - The signature data to be verified. - true if the signature verifies as valid; otherwise, false. - - - Verifies the specified signature data by comparing it to the signature computed for the specified hash value. - The hash value of the data to be signed. - The name of the hash algorithm used to create the hash value of the data. - The signature data to be verified. - true if the signature verifies as valid; otherwise, false. - The rgbHash parameter is null. -or- The rgbSignature parameter is null. - The cryptographic service provider (CSP) cannot be acquired. -or- The signature cannot be verified. - - - Verifies the signature for the specified data. - The data signed with rgbSignature. - The signature to be verified for rgbData. - true if rgbSignature matches the signature computed using the specified hash algorithm and key on rgbHash; otherwise, false. - - - Contains the typical parameters for the algorithm. - - - Specifies the counter for the algorithm. - - - - Specifies the G parameter for the algorithm. - - - - Specifies the J parameter for the algorithm. - - - - Specifies the P parameter for the algorithm. - - - - Specifies the Q parameter for the algorithm. - - - - Specifies the seed for the algorithm. - - - - Specifies the X parameter for the algorithm. - - - - Specifies the Y parameter for the algorithm. - - - - Verifies a Digital Signature Algorithm () PKCS#1 v1.5 signature. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with the specified key. - The instance of Digital Signature Algorithm () that holds the key. - key is null. - - - Specifies the hash algorithm for the Digital Signature Algorithm () signature deformatter. - The name of the hash algorithm to use for the signature deformatter. - The strName parameter does not map to the hash algorithm. - - - Specifies the key to be used for the Digital Signature Algorithm () signature deformatter. - The instance of that holds the key. - key is null. - - - Verifies the Digital Signature Algorithm () signature on the data. - The data signed with rgbSignature. - The signature to be verified for rgbHash. - true if the signature is valid for the data; otherwise, false. - rgbHash is null. -or- rgbSignature is null. - The DSA key is missing. - - - Creates a Digital Signature Algorithm () signature. - - - Initializes a new instance of the class. - - - Initializes a new instance of the class with the specified key. - The instance of the Digital Signature Algorithm () that holds the key. - key is null. - - - Creates the Digital Signature Algorithm () PKCS #1 signature for the specified data. - The data to be signed. - The digital signature for the specified data. - rgbHash is null. - The OID is null. -or- The DSA key is null. - - - Specifies the hash algorithm for the Digital Signature Algorithm () signature formatter. - The name of the hash algorithm to use for the signature formatter. - The strName parameter does not map to the hash algorithm. - - - Specifies the key to be used for the Digital Signature Algorithm () signature formatter. - The instance of that holds the key. - key is null. - - - Indicates how to interpret the data contained in an object. - - - The curve parameters represent a characteristic 2 curve. - - - - No curve data is interpreted. The caller is assumed to know what the curve is. - - - - The curve parameters represent a named curve. - - - - The curve parameters represent a prime curve with the formula By^2 = x^3 + A\x^2 + x. - - - - The curve parameters represent a prime curve with the formula y^2 = x^3 + A*x + B in the prime field P. - - - - The curve parameters represent a prime curve with the formula Ax^2 + y^2 = 1 + B\x^2*y^2 in the prime field P. - - - - Represents a factory class for creating named curves. - - - Gets a brainpoolP160r1 named curve. - A brainpoolP160r1 named curve. - - - Gets a brainpoolP160t1 named curve. - A brainpoolP160t1 named curve. - - - Gets a brainpoolP192r1 named curve. - A brainpoolP192r1 named curve. - - - Gets a brainpoolP192t1 named curve. - A brainpoolP192t1 named curve. - - - Gets a brainpoolP224r1 named curve. - A brainpoolP224r1 named curve. - - - Gets a brainpoolP224t1 named curve. - A brainpoolP224t1 named curve. - - - Gets a brainpoolP256r1 named curve. - A brainpoolP256r1 named curve. - - - Gets a brainpoolP256t1 named curve. - A brainpoolP256t1 named curve. - - - Gets a brainpoolP320r1 named curve. - A brainpoolP320r1 named curve. - - - Gets a brainpoolP320t1 named curve. - A brainpoolP320t1 named curve. - - - Gets a brainpoolP384r1 named curve. - A brainpoolP384r1 named curve. - - - Gets a brainpoolP384t1 named curve. - A brainpoolP384t1 named curve. - - - Gets a brainpoolP512r1 named curve. - A brainpoolP512r1 named curve. - - - Gets a brainpoolP512t1 named curve. - A brainpoolP512t1 named curve. - - - Gets a nistP256 named curve. - A nistP256 named curve. - - - Gets a nistP384 named curve. - A nistP384 named curve. - - - Gets a nistP521 named curve. - A nistP521 named curve. - - - Represents an elliptic curve. - - - The first coefficient for an explicit curve. A for short Weierstrass, Montgomery, and Twisted Edwards curves. - - - - The second coefficient for an explicit curve. B for short Weierstrass and d for Twisted Edwards curves. - - - - The cofactor of the curve. - - - - Creates a named curve using the specified friendly name of the identifier. - The friendly name of the identifier. - An object representing the named curve. - oidFriendlyName is null. - - - Creates a named curve using the specified object. - The object identifier to use. - An object representing the named curve. - - - Creates a named curve using the specified dotted-decimal representation of the identifier. - The dotted number of the identifier. - An object representing the named curve. - oidValue is null. - - - Identifies the composition of the object. - - - - The generator, or base point, for operations on the curve. - - - - The name of the hash algorithm which was used to generate the curve coefficients ( and ) from the under the ANSI X9.62 generation algorithm. Applies only to explicit curves. - - - - Gets a value that indicates whether the curve type indicates an explicit characteristic 2 curve. - true if the curve is an explicit characteristic 2 curve; false if the curve is a named characteristic 2, prime, or implicit curve. - - - Gets a value that indicates whether the curve type indicates an explicit curve (either prime or characteristic 2). - true if the curve is an explicit curve (either prime or characteristic 2); false if the curve is a named or implicit curve. - - - Gets a value that indicates whether the curve type indicates a named curve. - true if the curve is a named curve; false if the curve is an implict or an explicit curve (either prime or characteristic 2). - - - Gets a value that indicates whether the curve type indicates an explicit prime curve. - true if the curve is an explicit prime curve; false if the curve is a named prime, characteristic 2 or implicit curves. - - - Gets the identifier of a named curve. - The identifier of a named curve. - - - The order of the curve. Applies only to explicit curves. - - - - The curve polynomial. Applies only to characteristic 2 curves. - - - - The prime specifying the base field. Applies only to prime curves. - - - - The seed value for coefficient generation under the ANSI X9.62 generation algorithm. Applies only to explicit curves. - - - - Validates the integrity of the current curve. Throws a exception if the structure is not valid. - The curve parameters are not valid for the current curve type. - -
-
\ No newline at end of file diff --git a/src/Directory.Build.props b/src/Directory.Build.props deleted file mode 100644 index 0faa38c0b..000000000 --- a/src/Directory.Build.props +++ /dev/null @@ -1,5 +0,0 @@ - - - - - \ No newline at end of file diff --git a/src/ElmSharp.Wearable/ElmSharp.Wearable.csproj b/src/ElmSharp.Wearable/ElmSharp.Wearable.csproj deleted file mode 100644 index da8d3f65e..000000000 --- a/src/ElmSharp.Wearable/ElmSharp.Wearable.csproj +++ /dev/null @@ -1,11 +0,0 @@ - - - - netstandard2.0 - - - - - - - diff --git a/src/ElmSharp.Wearable/ElmSharp.Wearable.sln b/src/ElmSharp.Wearable/ElmSharp.Wearable.sln deleted file mode 100644 index dbf2ebd28..000000000 --- a/src/ElmSharp.Wearable/ElmSharp.Wearable.sln +++ /dev/null @@ -1,43 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26730.8 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ElmSharp.Wearable", "ElmSharp.Wearable.csproj", "{01AE2E3A-C08E-431C-97B3-A18D536FCD52}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ElmSharp", "..\ElmSharp\ElmSharp.csproj", "{393A27E0-A1FF-4BC7-9B44-2B2803080AC2}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ElmSharp.Test", "..\..\test\ElmSharp.Test\ElmSharp.Test.csproj", "{7FD75973-F5CE-4D17-81CB-A5905A62D138}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ElmSharp.Wearable.Test", "..\..\test\ElmSharp.Wearable.Test\ElmSharp.Wearable.Test.csproj", "{DC7126DF-8ED8-448A-B7D8-15C7441B6929}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {01AE2E3A-C08E-431C-97B3-A18D536FCD52}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {01AE2E3A-C08E-431C-97B3-A18D536FCD52}.Debug|Any CPU.Build.0 = Debug|Any CPU - {01AE2E3A-C08E-431C-97B3-A18D536FCD52}.Release|Any CPU.ActiveCfg = Release|Any CPU - {01AE2E3A-C08E-431C-97B3-A18D536FCD52}.Release|Any CPU.Build.0 = Release|Any CPU - {393A27E0-A1FF-4BC7-9B44-2B2803080AC2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {393A27E0-A1FF-4BC7-9B44-2B2803080AC2}.Debug|Any CPU.Build.0 = Debug|Any CPU - {393A27E0-A1FF-4BC7-9B44-2B2803080AC2}.Release|Any CPU.ActiveCfg = Release|Any CPU - {393A27E0-A1FF-4BC7-9B44-2B2803080AC2}.Release|Any CPU.Build.0 = Release|Any CPU - {7FD75973-F5CE-4D17-81CB-A5905A62D138}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7FD75973-F5CE-4D17-81CB-A5905A62D138}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7FD75973-F5CE-4D17-81CB-A5905A62D138}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7FD75973-F5CE-4D17-81CB-A5905A62D138}.Release|Any CPU.Build.0 = Release|Any CPU - {DC7126DF-8ED8-448A-B7D8-15C7441B6929}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {DC7126DF-8ED8-448A-B7D8-15C7441B6929}.Debug|Any CPU.Build.0 = Debug|Any CPU - {DC7126DF-8ED8-448A-B7D8-15C7441B6929}.Release|Any CPU.ActiveCfg = Release|Any CPU - {DC7126DF-8ED8-448A-B7D8-15C7441B6929}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {DCFCB5BF-47F2-4C3E-AB44-B126B259C9AA} - EndGlobalSection -EndGlobal diff --git a/src/ElmSharp.Wearable/ElmSharp.Wearable/CircleDatetimeSelector.cs b/src/ElmSharp.Wearable/ElmSharp.Wearable/CircleDatetimeSelector.cs deleted file mode 100644 index 7834970ac..000000000 --- a/src/ElmSharp.Wearable/ElmSharp.Wearable/CircleDatetimeSelector.cs +++ /dev/null @@ -1,134 +0,0 @@ -/* - * 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 ElmSharp.Wearable -{ - /// - /// The Circle DateTime Selector is a widget to display and handle datetime value by rotary event - /// Inherits - /// - public class CircleDateTimeSelector : DateTimeSelector - { - IntPtr circleHandle; - - /// - /// Creates and initializes a new instance of the Circle DateTime class - /// - /// The parent of new Circle DateTime instance - public CircleDateTimeSelector(EvasObject parent) : base(parent) { } - - /// - /// Sets or gets the disabled state of the Circle DateTime Selector - /// - public bool Disabled - { - get - { - return Interop.Eext.eext_circle_object_disabled_get(circleHandle); - } - set - { - Interop.Eext.eext_circle_object_disabled_set(circleHandle, value); - } - } - - /// - /// Sets or gets the color of the marker - /// - public Color MarkerColor - { - get - { - int r, g, b, 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); - } - } - - /// - /// Sets or gets the line width of the marker - /// - public int MarkerLineWidth - { - get - { - 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); - } - } - - /// - /// Sets or gets the radius at which the center of the marker lies - /// - public double MarkerRadius - { - get - { - return Interop.Eext.eext_circle_object_item_radius_get(circleHandle, "default"); - } - set - { - Interop.Eext.eext_circle_object_item_radius_set(circleHandle, "default", value); - } - } - - protected override IntPtr CreateHandle(EvasObject parent) - { - var handle = base.CreateHandle(parent); - - IntPtr surface = IntPtr.Zero; - - if (parent is Conformant) - { - surface = Interop.Eext.eext_circle_surface_conformant_add(parent); - } - else if (parent is Naviframe) - { - surface = Interop.Eext.eext_circle_surface_naviframe_add(parent.RealHandle); - } - else if (parent is Layout) - { - surface = Interop.Eext.eext_circle_surface_layout_add(parent); - } - - circleHandle = Interop.Eext.eext_circle_object_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); - - return handle; - } - } -} \ No newline at end of file diff --git a/src/ElmSharp.Wearable/ElmSharp.Wearable/CircleGenList.cs b/src/ElmSharp.Wearable/ElmSharp.Wearable/CircleGenList.cs deleted file mode 100644 index c9870099b..000000000 --- a/src/ElmSharp.Wearable/ElmSharp.Wearable/CircleGenList.cs +++ /dev/null @@ -1,204 +0,0 @@ -/* - * 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 ElmSharp.Wearable -{ - /// - /// The Circle GenList Selector is a widget to display and handle genlist items by rotary event - /// Inherits - /// - public class CircleGenList : GenList - { - IntPtr circleHandle; - - /// - /// Creates and initializes a new instance of the Circle GenList class - /// - /// The parent of new Circle GenList instance - public CircleGenList(EvasObject parent) : base(parent) { } - - /// - /// Sets or gets the disabled state of the Circle GenList Selector - /// - public bool Disabled - { - get - { - return Interop.Eext.eext_circle_object_disabled_get(circleHandle); - } - set - { - Interop.Eext.eext_circle_object_disabled_set(circleHandle, value); - } - } - - /// - /// Sets or gets the color of the scroll background - /// - public Color VerticalScrollBackgroundColor - { - 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); - 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); - } - } - - /// - /// Sets or gets the line width of the scroll background - /// - public int VerticalScrollBackgroundLineWidth - { - get - { - 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); - } - } - - /// - /// Sets or gets the redius of the scroll background - /// - public double VerticalScrollBackgroundRadius - { - get - { - 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); - } - } - - /// - /// Sets or gets the color of the scroll bar - /// - public Color VerticalScrollBarColor - { - get - { - int r, g, b, 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); - } - } - - /// - /// Sets or gets the line width of the scroll bar - /// - public int VerticalScrollBarLineWidth - { - get - { - 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); - } - } - - /// - /// Sets or gets the redius of the scroll bar - /// - public double VerticalScrollBarRadius - { - get - { - return Interop.Eext.eext_circle_object_item_radius_get(circleHandle, "default"); - } - set - { - Interop.Eext.eext_circle_object_item_radius_set(circleHandle, "default", value); - } - } - - /// - /// Sets or gets the policy if the scroll bar is visible - /// - /// - /// ScrollBarVisiblePolicy.Auto means the vertical scrollbar is made visible if it is needed, and otherwise kept hidden. - /// ScrollBarVisiblePolicy.Visible turns it on all the time, and ScrollBarVisiblePolicy.Invisible always keeps it off. - /// - public ScrollBarVisiblePolicy VerticalScrollBarVisiblePolicy - { - get - { - int 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); - } - } - - 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); - - return handle; - } - } -} diff --git a/src/ElmSharp.Wearable/ElmSharp.Wearable/CircleProgressBar.cs b/src/ElmSharp.Wearable/ElmSharp.Wearable/CircleProgressBar.cs deleted file mode 100644 index 95fcbae49..000000000 --- a/src/ElmSharp.Wearable/ElmSharp.Wearable/CircleProgressBar.cs +++ /dev/null @@ -1,338 +0,0 @@ -/* - * 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 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 - { - private IntPtr _circleHandle; - - /// - /// Creates and initializes a new instance of the Circle Progressbar class. - /// - /// The parent of new Circle Progressbar instance - public CircleProgressBar(EvasObject parent) : base(parent) - { - } - - - /// - /// Sets or gets the value of ProgressBar. - /// - public double Value - { - get - { - return Interop.Eext.eext_circle_object_value_get(_circleHandle); - } - set - { - Interop.Eext.eext_circle_object_value_set(_circleHandle, value); - } - } - - /// - /// Sets or gets the maximum value of ProgressBar. - /// - public double Maximum - { - get - { - double max = 0; - double min = 0; - 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(_circleHandle, min, value); - } - } - - /// - /// Sets or gets the minimum value of ProgressBar. - /// - public double Minimum - { - get - { - double max = 0; - double min = 0; - 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(_circleHandle, value, max); - } - } - - /// - /// Sets or gets the angle value of ProgressBar. - /// - public double BarAngle - { - get - { - return Interop.Eext.eext_circle_object_angle_get(_circleHandle); - } - set - { - Interop.Eext.eext_circle_object_angle_set(_circleHandle, value); - } - } - - /// - /// Sets or gets the angle value of Background ProgressBar. - /// - public double BackgroundAngle - { - get - { - return Interop.Eext.eext_circle_object_item_angle_get(_circleHandle, "bg"); - } - set - { - Interop.Eext.eext_circle_object_item_angle_set(_circleHandle, "bg", value); - } - } - - /// - /// Sets or gets the angle offset value of ProgressBar. - /// - public double BarAngleOffset - { - get - { - return Interop.Eext.eext_circle_object_angle_offset_get(_circleHandle); - } - set - { - Interop.Eext.eext_circle_object_angle_offset_set(_circleHandle, value); - } - } - - /// - /// Sets or gets the angle offset value of Background ProgressBar. - /// - public double BackgroundAngleOffset - { - get - { - return Interop.Eext.eext_circle_object_item_angle_offset_get(_circleHandle, "bg"); - } - set - { - Interop.Eext.eext_circle_object_item_angle_offset_set(_circleHandle, "bg", value); - } - } - - /// - /// Sets or gets the maximum angle value of ProgressBar. - /// - public double BarAngleMaximum - { - get - { - double max = 0; - double min = 0; - 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(_circleHandle, min, value); - } - } - - /// - /// Sets or gets the minimum angle value of ProgressBar. - /// - public double BarAngleMinimum - { - get - { - double max = 0; - double min = 0; - 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(_circleHandle, value, max); - } - } - - /// - /// Sets or gets disable status of Circle ProgressBar. - /// - public bool Disabled - { - get - { - return Interop.Eext.eext_circle_object_disabled_get(_circleHandle); - } - set - { - Interop.Eext.eext_circle_object_disabled_set(_circleHandle, value); - } - } - - /// - /// Sets or gets color of ProgressBar. - /// - public Color BarColor - { - get - { - int r = 0; - 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); - return Color.FromRgba(r, g, b, a); - } - set - { - 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 - { - get - { - int r = 0; - int g = 0; - int b = 0; - int a = 0; - 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(_circleHandle, "bg", value.R, value.G, value.B, value.A); - } - } - - /// - /// Sets or gets line width of ProgressBar. - /// - public int BarLineWidth - { - get - { - return Interop.Eext.eext_circle_object_line_width_get(_circleHandle); ; - } - set - { - Interop.Eext.eext_circle_object_line_width_set(_circleHandle, value); - } - } - - /// - /// Sets or gets line width of Background ProgressBar. - /// - public int BackgroundLineWidth - { - get - { - return Interop.Eext.eext_circle_object_item_line_width_get(_circleHandle, "bg"); - } - set - { - Interop.Eext.eext_circle_object_item_line_width_set(_circleHandle, "bg", value); - } - } - - /// - /// Sets or gets radius of ProgressBar. - /// - public double BarRadius - { - get - { - return Interop.Eext.eext_circle_object_radius_get(_circleHandle); ; - } - set - { - Interop.Eext.eext_circle_object_radius_set(_circleHandle, value); - } - } - - /// - /// Sets or gets radius of Background ProgressBar. - /// - public double BackgroundRadius - { - get - { - return Interop.Eext.eext_circle_object_item_radius_get(_circleHandle, "bg"); ; - } - set - { - Interop.Eext.eext_circle_object_item_radius_set(_circleHandle, "bg", value); - } - } - - 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); - } - - _circleHandle = 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(_circleHandle, w, h); - } - - Interop.Eext.eext_rotary_object_event_activated_set(_circleHandle, true); - return parent.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 deleted file mode 100644 index c786615ad..000000000 --- a/src/ElmSharp.Wearable/ElmSharp.Wearable/CircleScroller.cs +++ /dev/null @@ -1,328 +0,0 @@ -/* - * 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 ElmSharp.Wearable -{ - /// - /// Circle scroller provides scrollbar with circular movement and is scrolled by rotary event. - /// - public class CircleScroller : Scroller - { - private IntPtr _circleHandle; - - /// - /// 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) - { - } - - /// - /// Sets or gets disabled state of the circle scroller object. - /// - public bool Disabled - { - 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 HorizontalScrollBarVisiblePolicy - /// - /// - /// ScrollBarVisiblePolicy.Auto means the horizontal scrollbar is made visible if it is needed, and otherwise kept hidden. - /// ScrollBarVisiblePolicy.Visible turns it on all the time, and ScrollBarVisiblePolicy.Invisible always keeps it off. - /// - public override ScrollBarVisiblePolicy HorizontalScrollBarVisiblePolicy - { - get - { - int policy; - 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); - } - } - - /// - /// Sets or gets the value of VerticalScrollBarVisiblePolicy - /// - /// - /// ScrollBarVisiblePolicy.Auto means the vertical scrollbar is made visible if it is needed, and otherwise kept hidden. - /// ScrollBarVisiblePolicy.Visible turns it on all the time, and ScrollBarVisiblePolicy.Invisible always keeps it off. - /// - public override ScrollBarVisiblePolicy VerticalScrollBarVisiblePolicy - { - get - { - int 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); - } - } - - /// - /// Sets or gets color of the vertical scroll bar. - /// - public Color VerticalScrollBarColor - { - get - { - int r = 0; - 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); - return Color.FromRgba(r, g, b, a); - } - set - { - Interop.Eext.eext_circle_object_color_set(_circleHandle, value.R, value.G, value.B, value.A); - } - } - - /// - /// Sets or gets color of the horizontal scroll bar. - /// - public Color HorizontalScrollBarColor - { - get - { - int r = 0; - 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); - 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); - } - } - - /// - /// Sets or gets color of the vertical scroll background. - /// - public Color VerticalScrollBackgroundColor - { - get - { - int r = 0; - 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); - 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); - } - } - - /// - /// Sets or gets color of the horizontal scroll background. - /// - public Color HorizontalScrollBackgroundColor - { - get - { - int r = 0; - 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); - 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); - } - } - - /// - /// Sets or gets line width of the vertical scroll bar. - /// - public int VerticalScrollBarLineWidth - { - get - { - return Interop.Eext.eext_circle_object_line_width_get(_circleHandle); ; - } - set - { - Interop.Eext.eext_circle_object_line_width_set(_circleHandle, value); - } - } - - /// - /// Sets or gets line width of the horizontal scroll bar. - /// - public int HorizontalScrollBarLineWidth - { - get - { - 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); - } - } - - /// - /// Sets or gets line width of the vertical scroll background. - /// - public int VerticalScrollBackgroundLineWidth - { - get - { - 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); - } - } - - /// - /// Sets or gets line width of the horizontal scroll background. - /// - public int HorizontalScrollBackgroundLineWidth - { - get - { - 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); - } - } - - /// - /// Sets or gets radius of the vertical scroll bar. - /// - public double VerticalScrollBarRadius - { - get - { - return Interop.Eext.eext_circle_object_radius_get(_circleHandle); ; - } - set - { - Interop.Eext.eext_circle_object_radius_set(_circleHandle, value); - } - } - - /// - /// Sets or gets radius of the horizontal scroll bar. - /// - public double HorizontalScrollBarRadius - { - get - { - 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); - } - } - - /// - /// Sets or gets radius of the vertical scroll background. - /// - public double VerticalScrollBackgroundRadius - { - get - { - 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); - } - } - - /// - /// Sets or gets radius of the horizontal scroll background. - /// - public double HorizontalScrollBackgroundRadius - { - get - { - 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); - } - } - - 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); - return handle; - } - } -} \ No newline at end of file diff --git a/src/ElmSharp.Wearable/ElmSharp.Wearable/CircleSlider.cs b/src/ElmSharp.Wearable/ElmSharp.Wearable/CircleSlider.cs deleted file mode 100755 index 5347948f6..000000000 --- a/src/ElmSharp.Wearable/ElmSharp.Wearable/CircleSlider.cs +++ /dev/null @@ -1,378 +0,0 @@ -/* - * 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 ElmSharp.Wearable -{ - /// - /// Circle slider is circular designed widget to select a value in a range by rotary event. - /// - public class CircleSlider : EvasObject - { - /// - /// Changed will be triggered when the circle slider value changes. - /// - public event EventHandler Changed; - - SmartEvent _changedEvent; - - /// - /// 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) - { - _changedEvent = new SmartEvent(this, "value,changed"); - - _changedEvent.On += (s, e) => Changed?.Invoke(this, EventArgs.Empty); - } - - /// - /// Sets or gets the step by which the circle slider bar moves. - /// - /// - /// This value is used when circle slider value is changed by an drag or rotary event - /// The value of the slider is increased/decreased by the step value. - /// - public double Step - { - get - { - return Interop.Eext.eext_circle_object_slider_step_get(RealHandle); - } - set - { - Interop.Eext.eext_circle_object_slider_step_set(RealHandle, (double)value); - } - } - - /// - /// Sets or gets disabled state of the circle slider object. - /// - public bool Disabled - { - get - { - return Interop.Eext.eext_circle_object_disabled_get(RealHandle); ; - } - set - { - Interop.Eext.eext_circle_object_disabled_set(RealHandle, value); - } - } - - /// - /// Sets or gets color of the circle slider bar. - /// - public Color BarColor - { - get - { - int r = 0; - 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); - return Color.FromRgba(r, g, b, a); - } - set - { - Interop.Eext.eext_circle_object_color_set(RealHandle, value.R, value.G, value.B, value.A); - } - } - - /// - /// Sets or gets color of the circle slider background. - /// - public Color BackgroundColor - { - get - { - int r = 0; - 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); - 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); - } - } - - /// - /// Sets or gets the line with of the circle slider bar. - /// - public int BarLineWidth - { - get - { - return Interop.Eext.eext_circle_object_line_width_get(RealHandle); ; - } - set - { - Interop.Eext.eext_circle_object_line_width_set(RealHandle, value); - } - } - - /// - /// Sets or gets the line with of the circle slider background. - /// - public int BackgroundLineWidth - { - get - { - return Interop.Eext.eext_circle_object_item_line_width_get(RealHandle, "bg"); - } - set - { - Interop.Eext.eext_circle_object_item_line_width_set(RealHandle, "bg", value); - } - } - - /// - /// Sets or gets the angle in degree of the circle slider bar. - /// - public double BarAngle - { - get - { - return Interop.Eext.eext_circle_object_angle_get(RealHandle); ; - } - set - { - Interop.Eext.eext_circle_object_angle_set(RealHandle, value); - } - } - - /// - /// Sets or gets the angle in degree of the circle slider background. - /// - public double BackgroundAngle - { - get - { - return Interop.Eext.eext_circle_object_item_angle_get(RealHandle, "bg"); - } - set - { - Interop.Eext.eext_circle_object_item_angle_set(RealHandle, "bg", value); - } - } - - /// - /// Sets or gets the angle offset for the slider bar. - /// offset value means start position of the slider bar. - /// - public double BarAngleOffset - { - get - { - return Interop.Eext.eext_circle_object_angle_offset_get(RealHandle); ; - } - set - { - Interop.Eext.eext_circle_object_angle_offset_set(RealHandle, value); - } - } - - /// - /// Sets or gets the angle offset for the circle slider background. - /// offset value means start position of the slider background. - /// - public double BackgroundAngleOffset - { - get - { - return Interop.Eext.eext_circle_object_item_angle_offset_get(RealHandle, "bg"); - } - set - { - Interop.Eext.eext_circle_object_item_angle_offset_set(RealHandle, "bg", value); - } - } - - /// - /// Sets or gets the minimum angle of the circle slider bar. - /// - public double BarAngleMinimum - { - get - { - double min; - double max; - Interop.Eext.eext_circle_object_angle_min_max_get(RealHandle, out min, out max); - return min; - } - set - { - double max = BarAngleMaximum; - Interop.Eext.eext_circle_object_angle_min_max_set(RealHandle, (double)value, max); - } - } - - /// - /// Sets or gets the maximum angle of the circle slider bar. - /// - public double BarAngleMaximum - { - get - { - double min; - double max; - Interop.Eext.eext_circle_object_angle_min_max_get(RealHandle, out min, out max); - return max; - } - set - { - double min = BarAngleMinimum; - Interop.Eext.eext_circle_object_angle_min_max_set(RealHandle, min, (double)value); - } - } - - /// - /// Sets or gets the minimum values for the circle slider. - /// - /// - /// This defines the allowed minimum values to be selected by the user. - /// If the actual value is less than min, it is updated to min. - /// Actual value can be obtained with Value.By default, min is equal to 0.0. - /// - public double Minimum - { - get - { - double min; - double max; - Interop.Eext.eext_circle_object_value_min_max_get(RealHandle, out min, out max); - return min; - } - set - { - double max = Maximum; - Interop.Eext.eext_circle_object_value_min_max_set(RealHandle, (double)value, max); - } - } - - /// - /// Sets or gets the maximum values for the circle slider. - /// - /// - /// This defines the allowed maximum values to be selected by the user. - /// If the actual value is bigger then max, it is updated to max. - /// Actual value can be obtained with Value.By default, min is equal to 0.0, and max is equal to 1.0. - /// Maximum must be greater than minimum, otherwise the behavior is undefined. - /// - public double Maximum - { - get - { - double min; - double max; - Interop.Eext.eext_circle_object_value_min_max_get(RealHandle, out min, out max); - return max; - } - set - { - double min = Minimum; - Interop.Eext.eext_circle_object_value_min_max_set(RealHandle, min, (double)value); - } - } - - /// - /// Gets or sets the value displayed by the circle slider. - /// - /// - /// The value must to be between Minimum and Maximum values. - /// - public double Value - { - get - { - return Interop.Eext.eext_circle_object_value_get(RealHandle); - } - set - { - Interop.Eext.eext_circle_object_value_set(RealHandle, (double)value); - } - } - - /// - /// Gets or sets the radius value for the circle slider bar. - /// - public double BarRadius - { - get - { - return Interop.Eext.eext_circle_object_radius_get(RealHandle); ; - } - set - { - Interop.Eext.eext_circle_object_radius_set(RealHandle, value); - } - } - - /// - /// Gets or sets the radius value for the circle slider background. - /// - public double BackgroundRadius - { - get - { - return Interop.Eext.eext_circle_object_item_radius_get(RealHandle, "bg"); ; - } - set - { - Interop.Eext.eext_circle_object_item_radius_set(RealHandle, "bg", value); - } - } - - 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; - } - } -} \ No newline at end of file diff --git a/src/ElmSharp.Wearable/ElmSharp.Wearable/CircleSpinner.cs b/src/ElmSharp.Wearable/ElmSharp.Wearable/CircleSpinner.cs deleted file mode 100644 index e85d58906..000000000 --- a/src/ElmSharp.Wearable/ElmSharp.Wearable/CircleSpinner.cs +++ /dev/null @@ -1,153 +0,0 @@ -/* - * 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 ElmSharp.Wearable -{ - - /// - /// The Circle Spinner is a widget to display and handle spinner value by rotary event - /// Inherits . - /// - public class CircleSpinner : Spinner - { - private IntPtr _circleHandle; - private double _angleRatio = 1.0; - - /// - /// Creates and initializes a new instance of the Circle Spinner class. - /// - /// The parent of new Circle Spinner instance - public CircleSpinner(EvasObject parent) : base(parent) - { - } - - /// - /// Sets or gets the circle spinner angle per each spinner value. - /// - public double AngleRatio - { - get - { - return _angleRatio; - } - set - { - _angleRatio = value; - Interop.Eext.eext_circle_object_spinner_angle_set(_circleHandle, _angleRatio); - } - } - - /// - /// Sets or gets disabled state of the circle spinner object. - /// - public bool Disabled - { - get - { - return Interop.Eext.eext_circle_object_disabled_get(_circleHandle); ; - } - set - { - Interop.Eext.eext_circle_object_disabled_set(_circleHandle, value); - } - } - - /// - /// Sets or gets the line width of the marker - /// - public int MarkerLineWidth - { - get - { - 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); - } - } - - /// - /// Sets or gets the color of the marker - /// - public Color MarkerColor - { - get - { - int r, g, b, 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); - } - } - - /// - /// Sets or gets the radius at which the center of the marker lies - /// - public double MarkerRadius - { - get - { - return Interop.Eext.eext_circle_object_item_radius_get(_circleHandle, "default"); - } - set - { - Interop.Eext.eext_circle_object_item_radius_set(_circleHandle, "default", value); - } - } - - protected override IntPtr CreateHandle(EvasObject parent) - { - IntPtr handle = base.CreateHandle(parent); - - IntPtr surface = IntPtr.Zero; - - if (parent is Conformant) - { - surface = Interop.Eext.eext_circle_surface_conformant_add(parent.Handle); - } - else if (parent is Naviframe) - { - surface = Interop.Eext.eext_circle_surface_naviframe_add(parent.RealHandle); - } - else if (parent is Layout) - { - surface = Interop.Eext.eext_circle_surface_layout_add(parent.Handle); - } - - _circleHandle = Interop.Eext.eext_circle_object_spinner_add(RealHandle, surface); - if (surface == IntPtr.Zero) - { - EvasObject p = parent; - while (!(p is Window)) - { - p = p.Parent; - } - var w = (p as Window).ScreenSize.Width; - var h = (p as Window).ScreenSize.Height; - Interop.Evas.evas_object_resize(_circleHandle, w, h); - } - - Interop.Eext.eext_rotary_object_event_activated_set(_circleHandle, true); - return handle; - } - } -} \ No newline at end of file diff --git a/src/ElmSharp.Wearable/ElmSharp.Wearable/MoreOption.cs b/src/ElmSharp.Wearable/ElmSharp.Wearable/MoreOption.cs deleted file mode 100644 index 002a7a6ff..000000000 --- a/src/ElmSharp.Wearable/ElmSharp.Wearable/MoreOption.cs +++ /dev/null @@ -1,120 +0,0 @@ - -using System; -using System.Collections.Generic; -using System.Linq; - -namespace ElmSharp.Wearable -{ - /// - /// The MoreOption is a widget composed of the toggle(cue button) and more option view, and MoreOption can change a visibility through the toggle. - /// Inherits Layout - /// - public class MoreOption : Layout - { - /// - /// Sets or gets the list of more option item - /// - public IList Items { get; private set; } - - /// - /// Selected will be triggered when the user selects an item. - /// - public event EventHandler Selected; - /// - /// Clicked will be triggered when the user selects the already selected item again or selects a selector. - /// - public event EventHandler Clicked; - /// - /// Opened will be triggered when more option view is shown. - /// - public event EventHandler Opened; - /// - /// Closed will be triggered when more option view is hidden. - /// - public event EventHandler Closed; - - SmartEvent _selectedEvent; - SmartEvent _clickedEvent; - SmartEvent _openedEvent; - SmartEvent _closedEvent; - - /// - /// Creates and initializes a new instance of MoreOption class. - /// - /// The parent is a given container which will be attached by MoreOption as a child. It's type. - public MoreOption(EvasObject parent) : base(parent) - { - Items = new MoreOptionList(this); - - _selectedEvent = new SmartEvent(this, "item,selected", (d, o, info) => new PointerEventArgs { Pointer = info }); - _clickedEvent = new SmartEvent(this, "item,clicked", (d, o, info) => new PointerEventArgs { Pointer = info }); - _openedEvent = new SmartEvent(this, "more,option,opened"); - _closedEvent = new SmartEvent(this, "more,option,closed"); - - _selectedEvent.On += (s, e) => - { - MoreOptionItem selected = Items.FirstOrDefault(i => i.Handle == e.Pointer); - Selected?.Invoke(this, new MoreOptionItemEventArgs() { Item = selected }); - }; - - _clickedEvent.On += (s, e) => - { - MoreOptionItem selected = Items.FirstOrDefault(i => i.Handle == e.Pointer); - Clicked?.Invoke(this, new MoreOptionItemEventArgs() { Item = selected }); - }; - - _openedEvent.On += (s, e) => Opened?.Invoke(this, EventArgs.Empty); - _closedEvent.On += (s, e) => Closed?.Invoke(this, EventArgs.Empty); - - } - - protected override IntPtr CreateHandle(EvasObject parent) - { - return Interop.Eext.eext_more_option_add(parent); - } - - /// - /// Sets or gets the direction of more option. - /// - public MoreOptionDirection Direction - { - get - { - int dir = Interop.Eext.eext_more_option_direction_get(this); - return (MoreOptionDirection)dir; - } - - set - { - Interop.Eext.eext_more_option_direction_set(this, (int)value); - } - } - - /// - /// Sets or gets the visibility of more option view. - /// - public bool IsOpened - { - get - { - return Interop.Eext.eext_more_option_opened_get(this); - } - - set - { - Interop.Eext.eext_more_option_opened_set(this, value); - } - } - } - - /// - /// Enumeration for More Option Direction type. - /// - public enum MoreOptionDirection - { - Top, - Bottom, - Left, - Right - } -} diff --git a/src/ElmSharp.Wearable/ElmSharp.Wearable/MoreOptionItem.cs b/src/ElmSharp.Wearable/ElmSharp.Wearable/MoreOptionItem.cs deleted file mode 100755 index d55c8ad17..000000000 --- a/src/ElmSharp.Wearable/ElmSharp.Wearable/MoreOptionItem.cs +++ /dev/null @@ -1,113 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace ElmSharp.Wearable -{ - /// - /// The MoreOptionItem is a item of MoreOption widget. - /// - public class MoreOptionItem - { - const string MainTextPartName = "selector,main_text"; - const string SubTextPartName = "selector,sub_text"; - const string IconPartName = "item,icon"; - - string _mainText; - string _subText; - Image _icon; - IntPtr _handle; - - /// - /// Sets or gets the more option item handle. - /// - public IntPtr Handle - { - get - { - return _handle; - } - set - { - if (_handle == value) return; - _handle = value; - if (_mainText != null) - Interop.Eext.eext_more_option_item_part_text_set(Handle, MainTextPartName, _mainText); - if (_subText != null) - Interop.Eext.eext_more_option_item_part_text_set(Handle, SubTextPartName, _subText); - if (_icon != null) - Interop.Eext.eext_more_option_item_part_content_set(Handle, IconPartName, _icon); - } - } - - /// - /// Creates and initializes a new instance of MoreOptionItem class. - /// - public MoreOptionItem() - { - _icon = null; - } - - /// - /// Sets or gets the main text of a more option object. - /// - public string MainText - { - set - { - if (_mainText == value) return; - _mainText = value; - if (Handle != IntPtr.Zero) - { - Interop.Eext.eext_more_option_item_part_text_set(Handle, MainTextPartName, _mainText); - } - } - - get - { - return _mainText; - } - } - - /// - /// Sets or gets the sub text of a more option object. - /// - public string SubText - { - set - { - if (_subText == value) return; - _subText = value; - if (Handle != IntPtr.Zero) - { - Interop.Eext.eext_more_option_item_part_text_set(Handle, SubTextPartName, _subText); - } - } - - get - { - return _subText; - } - } - - /// - /// Sets or gets the icon image - /// - public Image Icon - { - set - { - if (_icon == value) return; - _icon = value; - if (Handle != IntPtr.Zero) - { - Interop.Eext.eext_more_option_item_part_content_set(Handle, IconPartName, _icon); - } - } - get - { - return _icon; - } - } - } -} diff --git a/src/ElmSharp.Wearable/ElmSharp.Wearable/MoreOptionItemEventArgs.cs b/src/ElmSharp.Wearable/ElmSharp.Wearable/MoreOptionItemEventArgs.cs deleted file mode 100644 index c1781e48e..000000000 --- a/src/ElmSharp.Wearable/ElmSharp.Wearable/MoreOptionItemEventArgs.cs +++ /dev/null @@ -1,17 +0,0 @@ - -using System; - -namespace ElmSharp.Wearable -{ - /// - /// The MoreOptionItemEventArgs is a event args class for MoreOptionItem. - /// Inherits EventArgs - /// - public class MoreOptionItemEventArgs : EventArgs - { - /// - /// Sets or gets the more option item - /// - public MoreOptionItem Item { get; set; } - } -} diff --git a/src/ElmSharp.Wearable/ElmSharp.Wearable/MoreOptionList.cs b/src/ElmSharp.Wearable/ElmSharp.Wearable/MoreOptionList.cs deleted file mode 100644 index 95510d0a4..000000000 --- a/src/ElmSharp.Wearable/ElmSharp.Wearable/MoreOptionList.cs +++ /dev/null @@ -1,184 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Text; - -namespace ElmSharp.Wearable -{ - class MoreOptionList : IList - { - MoreOption Owner { get; set; } - - List Items { get; set; } - - /// - /// Sets or gets the count of Items - /// - public int Count => Items.Count; - - /// - /// Sets or gets whether it is read only - /// - public bool IsReadOnly => false; - - /// - /// Sets or gets the item with the index - /// - /// the position of item in items - /// - public MoreOptionItem this[int index] - { - get - { - return Items[index]; - } - - set - { - Items[index] = value; - } - } - - /// - /// Creates and initializes a new instance of MoreOptionList class. - /// - /// the object of more option - public MoreOptionList(MoreOption owner) - { - Owner = owner; - Items = new List(); - } - - /// - /// Append a new item to a more option. - /// - /// The more option item - public void Add(MoreOptionItem item) - { - item.Handle = Interop.Eext.eext_more_option_item_append(Owner); - Items.Add(item); - } - - /// - /// add a new item to a more option at the first. - /// - /// The more option item - public void AddFirst(MoreOptionItem item) - { - item.Handle = Interop.Eext.eext_more_option_item_prepend(Owner); - Items.Insert(0, item); - } - - /// - /// add a new item to a more option at the last. - /// - /// The more option item - public void AddLast(MoreOptionItem item) - { - Add(item); - } - - /// - /// Get the index of item - /// - /// The more option item - /// the index of item - public int IndexOf(MoreOptionItem item) - { - return Items.IndexOf(item); - } - - /// - /// Insert a new item into the more option after more option item with the index. - /// - /// the index of item which is insert after - /// The more option item - public void Insert(int index, MoreOptionItem item) - { - if (Items.Count < index + 1 || index < 0) - throw new ArgumentOutOfRangeException("index is not valid in the MoreOption"); - - MoreOptionItem target = Items[index]; - item.Handle = Interop.Eext.eext_more_option_item_insert_after(Owner, target.Handle); - Items.Insert(index, item); - } - - /// - /// Delete an item which is the given item index - /// - /// the item index which will be deleted - public void RemoveAt(int index) - { - if (Items.Count < index + 1 || index < 0) - throw new ArgumentOutOfRangeException("index is not valid in the MoreOptionList"); - - MoreOptionItem item = Items[index]; - Interop.Eext.eext_more_option_item_del(item.Handle); - item.Handle = IntPtr.Zero; - Items.RemoveAt(index); - } - - /// - /// Remove all items from a given more option list object. - /// - public void Clear() - { - Interop.Eext.eext_more_option_items_clear(Owner); - foreach (MoreOptionItem item in Items) - { - item.Handle = IntPtr.Zero; - } - Items.Clear(); - } - - /// - /// Check the item whether is contained - /// - /// The more option item - /// If contain return true, otherwise false - public bool Contains(MoreOptionItem item) - { - return Items.Contains(item); - } - - /// - /// Copy Items - /// - /// the target array - /// which index the item will copy to - public void CopyTo(MoreOptionItem[] array, int arrayIndex) - { - Items.CopyTo(array, arrayIndex); - } - - /// - /// Remove a item - /// - /// the item will be removed - /// if remove success return true, otherwise false - public bool Remove(MoreOptionItem item) - { - if (Items.Contains(item)) - { - Interop.Eext.eext_more_option_item_del(item.Handle); - Items.Remove(item); - return true; - } - return false; - } - - /// - /// Return an enumerator that iterates through IEnumerator - /// - /// - public IEnumerator GetEnumerator() - { - return Items.GetEnumerator(); - } - - IEnumerator IEnumerable.GetEnumerator() - { - return Items.GetEnumerator(); - } - } -} diff --git a/src/ElmSharp.Wearable/ElmSharp.Wearable/PointerEventArgs.cs b/src/ElmSharp.Wearable/ElmSharp.Wearable/PointerEventArgs.cs deleted file mode 100644 index e0bf3c742..000000000 --- a/src/ElmSharp.Wearable/ElmSharp.Wearable/PointerEventArgs.cs +++ /dev/null @@ -1,27 +0,0 @@ -/* - * 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.Collections.Generic; -using System.Text; - -namespace ElmSharp.Wearable -{ - class PointerEventArgs : EventArgs - { - public IntPtr Pointer { get; set; } - } -} diff --git a/src/ElmSharp.Wearable/ElmSharp.Wearable/RotaryEventManager.cs b/src/ElmSharp.Wearable/ElmSharp.Wearable/RotaryEventManager.cs deleted file mode 100644 index d7fb66b6f..000000000 --- a/src/ElmSharp.Wearable/ElmSharp.Wearable/RotaryEventManager.cs +++ /dev/null @@ -1,174 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Runtime.InteropServices; -using System.Text; - -namespace ElmSharp.Wearable -{ - /// - /// RotaryEventManager serve functions for global Rotary event like Galaxy Gear. - /// - public static class RotaryEventManager - { - static Dictionary s_rotaryEventHandlers = new Dictionary(); - - /// - /// Rotated will triggered when rotatable device like Galaxy Gear Bezel is rotated. - /// - public static event RotaryEventHandler Rotated - { - add - { - if (s_rotaryEventHandlers.ContainsKey(value)) return; - - Interop.Eext.Eext_Rotary_Handler_Cb cb = (data, infoPtr) => - { - var info = Interop.Eext.FromIntPtr(infoPtr); - value.Invoke(new RotaryEventArgs - { - IsClockwise = info.Direction == Interop.Eext.Eext_Rotary_Event_Direction.Clockwise, - Timestamp = info.TimeStamp - }); - return true; - }; - Interop.Eext.eext_rotary_event_handler_add(cb, IntPtr.Zero); - s_rotaryEventHandlers[value] = cb; - } - - remove - { - Interop.Eext.Eext_Rotary_Handler_Cb cb; - if (s_rotaryEventHandlers.TryGetValue(value, out cb)) - { - Interop.Eext.eext_rotary_event_handler_del(cb); - s_rotaryEventHandlers.Remove(value); - } - } - } - } - - - /// - /// RotaryEventManager serve extension functions for Rotary event to EvasObject on device like Galaxy Gear. - /// - public static class EvasObjectExtensions - { - static Dictionary s_rotaryObjectEventHandlers = new Dictionary(); - static Dictionary s_rotaryObjectEventMap = new Dictionary(); - - /// - /// Add a handler for Rotary event on specific EvasObject. - /// - /// Target EvasObject - /// Event handler for Rotary event - public static void AddRotaryEventHandler(this EvasObject obj, RotaryEventHandler handler) - { - EnableRotaryEventHandler(obj); - - if (s_rotaryObjectEventHandlers.ContainsKey(obj)) - { - s_rotaryObjectEventHandlers[obj] += handler; - } - else - { - s_rotaryObjectEventHandlers[obj] = handler; - } - } - - /// - /// Remove a handler on specific EvasObject for Rotary event. - /// - /// Target EvasObject - /// Event handler for Rotary event - public static void RemoveRotaryEventHandler(this EvasObject obj, RotaryEventHandler handler) - { - if (s_rotaryObjectEventHandlers.ContainsKey(obj)) - { - s_rotaryObjectEventHandlers[obj] -= handler; - if (s_rotaryObjectEventHandlers[obj] == null) - { - DisableRotaryEventHandler(obj, false); - s_rotaryObjectEventHandlers.Remove(obj); - } - } - } - - /// - /// Activate this object can take Rotary event. - /// - /// Target object - public static void Activate(this EvasObject obj) - { - Interop.Eext.eext_rotary_object_event_activated_set(obj, true); - } - - /// - /// Deactivate this object is blocked from Rotary event. - /// - /// Target object - public static void Deactivate(this EvasObject obj) - { - Interop.Eext.eext_rotary_object_event_activated_set(obj, false); - } - - static void EnableRotaryEventHandler(EvasObject obj) - { - if (!s_rotaryObjectEventMap.ContainsKey(obj)) - { - Interop.Eext.Eext_Rotary_Event_Cb cb = (d, o, i) => - { - RotaryEventHandler events; - if (s_rotaryObjectEventHandlers.TryGetValue(obj, out events)) - { - var info = Interop.Eext.FromIntPtr(i); - events?.Invoke(new RotaryEventArgs - { - IsClockwise = info.Direction == Interop.Eext.Eext_Rotary_Event_Direction.Clockwise, - Timestamp = info.TimeStamp - }); - } - return true; - }; - Interop.Eext.eext_rotary_object_event_callback_add(obj, cb, IntPtr.Zero); - s_rotaryObjectEventMap[obj] = cb; - obj.Deleted += (s, e) => DisableRotaryEventHandler(obj, true); - } - } - - static void DisableRotaryEventHandler(EvasObject obj, bool removeHandler) - { - Interop.Eext.Eext_Rotary_Event_Cb cb; - if (s_rotaryObjectEventMap.TryGetValue(obj, out cb)) - { - Interop.Eext.eext_rotary_object_event_callback_del(obj, cb); - s_rotaryObjectEventMap.Remove(obj); - } - if (removeHandler && s_rotaryObjectEventHandlers.ContainsKey(obj)) - { - s_rotaryObjectEventHandlers.Remove(obj); - } - } - } - - /// - /// Handler for Rotary event - /// - /// Rotary event information - public delegate void RotaryEventHandler(RotaryEventArgs args); - - /// - /// RotaryEventArgs serve information for triggered rotary event. - /// - public class RotaryEventArgs : EventArgs - { - /// - /// IsClockwise is true when Rotary device rotated clockwise direction or false on counter clockwise. - /// - public bool IsClockwise { get; set; } - - /// - /// Timestamp of rotary event - /// - public uint Timestamp { get; set; } - } -} diff --git a/src/ElmSharp.Wearable/ElmSharp.Wearable/RotarySelector.cs b/src/ElmSharp.Wearable/ElmSharp.Wearable/RotarySelector.cs deleted file mode 100644 index 48a2c8052..000000000 --- a/src/ElmSharp.Wearable/ElmSharp.Wearable/RotarySelector.cs +++ /dev/null @@ -1,136 +0,0 @@ -/* - * 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.Collections.Generic; -using System.Linq; -using System.Text; - -namespace ElmSharp.Wearable -{ - /// - /// The Rotary Selector is a widget to display a selector and multiple items surrounding the selector. - /// And an item can be selected by rotary event or user item click. - /// Inherits . - /// - public class RotarySelector : Layout - { - const string IconPartName = "selector,icon"; - const string ContentPartName = "selector,content"; - const string BgPartName = "selector,bg_image"; - - const string ItemSelectedEventName = "item,selected"; - const string ItemClickedEventName = "item,clicked"; - - /// - /// Selected will be triggered when selected an item. - /// - public event EventHandler Selected; - - /// - /// Clicked will be triggered when selecting again the alredy selected item or selecting a selector. - /// - public event EventHandler Clicked; - - SmartEvent _selectedEvent; - SmartEvent _clickedEvent; - Image _normalBgImage; - - /// - /// Gets the rotary selector item list of a rotary selector object. - /// - public IList Items { get; private set; } - - /// - /// Creates and initializes a new instance of the Rotary Selector class. - /// - /// The parent of new Rotary Selector instance - public RotarySelector(EvasObject parent) : base(parent) - { - Items = new RotarySelectorList(this); - - _selectedEvent = new SmartEvent(this, "item,selected", (d, o, info) => new PointerEventArgs { Pointer = info }); - _clickedEvent = new SmartEvent(this, "item,clicked", (d, o, info) => new PointerEventArgs { Pointer = info }); - _selectedEvent.On += (s, e) => - { - RotarySelectorItem selected = Items.FirstOrDefault(i => i.Handle == e.Pointer); - Selected?.Invoke(this, new RotarySelectorItemEventArgs { Item = selected }); - }; - - _clickedEvent.On += (s, e) => - { - RotarySelectorItem selected = Items.FirstOrDefault(i => i.Handle == e.Pointer); - Clicked?.Invoke(this, new RotarySelectorItemEventArgs { Item = selected }); - }; - } - - /// - /// Sets or gets the selected item of a rotary selector object. - /// - public RotarySelectorItem SelectedItem - { - get - { - IntPtr selectedPtr = Interop.Eext.eext_rotary_selector_selected_item_get(this); - if (selectedPtr == IntPtr.Zero) return null; - RotarySelectorItem item = Items.FirstOrDefault(i => i.Handle == selectedPtr); - return item; - } - - set - { - if (!Items.Contains(value)) return; - Interop.Eext.eext_rotary_selector_selected_item_set(this, value.Handle); - } - } - - void setPart(ref Image prop, string partName, State state, Image img) - { - if (prop == img) return; - prop = img; - if (this != null) - { - Interop.Eext.eext_rotary_selector_part_content_set(this, partName, (int)state, prop); - } - } - void setPart(ref Color prop, string partName, State state, Color color) - { - if (prop == color) return; - if (this != null) - { - Interop.Eext.eext_rotary_selector_part_color_set(this, partName, (int)state, color.R, color.G, color.B, color.A); - } - } - - /// - /// Sets or gets the background image of a rotary selector object. - /// - public Image BackgroundImage { set => setPart(ref _normalBgImage, BgPartName, State.Normal, value); get => _normalBgImage; } - - protected override IntPtr CreateHandle(EvasObject parent) - { - IntPtr ptr = Interop.Eext.eext_rotary_selector_add(parent); - Interop.Eext.eext_rotary_object_event_activated_set(ptr, true); - return ptr; - } - - internal enum State - { - Normal, - Pressed - } - } -} diff --git a/src/ElmSharp.Wearable/ElmSharp.Wearable/RotarySelectorItem.cs b/src/ElmSharp.Wearable/ElmSharp.Wearable/RotarySelectorItem.cs deleted file mode 100644 index 38e46cb26..000000000 --- a/src/ElmSharp.Wearable/ElmSharp.Wearable/RotarySelectorItem.cs +++ /dev/null @@ -1,246 +0,0 @@ -/* - * 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.Collections.Generic; -using System.Text; - -namespace ElmSharp.Wearable -{ - /// - /// A instance to the Rotary Selector Item added. And an item can be selected by rotary event or user item click. - /// - public class RotarySelectorItem - { - const string MainTextPartName = "selector,main_text"; - const string SubTextPartName = "selector,sub_text"; - const string IconPartName = "item,icon"; - const string BgPartName = "item,bg_image"; - const string SelectorIconPartName = "selector,icon"; - - string _mainText; - string _subText; - - Color _mainTextColor; - Color _subTextColor; - - Image _normalIconImage; - Image _pressedIconImage; - Image _disabledIconImage; - Image _selectedIconImage; - - Image _normalBgImage; - Image _pressedBgImage; - Image _disabledBgImage; - Image _selectedBgImage; - - Color _normalBgColor; - Color _pressedBgColor; - Color _disabledBgColor; - Color _selectedBgColor; - - Image _selectorIconImage; - - IntPtr _handle; - - /// - /// Sets or gets the handle of a rotary selector item object. - /// - public IntPtr Handle - { - set - { - if (_handle == value) return; - _handle = value; - - if (_handle == null) return; - - setPart(ref _mainText, MainTextPartName); - setPart(ref _subText, SubTextPartName); - setPart(ref _mainTextColor, MainTextPartName, ItemState.Normal); - setPart(ref _subTextColor, SubTextPartName, ItemState.Normal); - - setPart(ref _normalIconImage, IconPartName, ItemState.Normal); - setPart(ref _pressedIconImage, IconPartName, ItemState.Pressed); - setPart(ref _disabledIconImage, IconPartName, ItemState.Disabled); - setPart(ref _selectedIconImage, IconPartName, ItemState.Selected); - - setPart(ref _normalBgImage, BgPartName, ItemState.Normal); - setPart(ref _pressedBgImage, BgPartName, ItemState.Pressed); - setPart(ref _disabledBgImage, BgPartName, ItemState.Disabled); - setPart(ref _selectedBgImage, BgPartName, ItemState.Selected); - - setPart(ref _normalBgColor, BgPartName, ItemState.Normal); - setPart(ref _pressedBgColor, BgPartName, ItemState.Pressed); - setPart(ref _disabledBgColor, BgPartName, ItemState.Disabled); - setPart(ref _selectedBgColor, BgPartName, ItemState.Selected); - - setPart(ref _selectorIconImage, SelectorIconPartName, ItemState.Normal); - } - - get - { - return _handle; - } - } - - void setPart(ref Image prop, string partName, ItemState state) - { - if (prop != null) - { - Interop.Eext.eext_rotary_selector_item_part_content_set(Handle, partName, (int)state, prop); - } - } - void setPart(ref Color prop, string partName, ItemState state) - { - if (prop != default(Color)) - { - Interop.Eext.eext_rotary_selector_item_part_color_set(Handle, partName, (int)state, prop.R, prop.G, prop.B, prop.A); - } - } - - void setPart(ref string prop, string partName) - { - if (prop != null) - { - Interop.Eext.eext_rotary_selector_item_part_text_set(Handle, partName, prop); - } - } - - void setPart(ref Image prop, string partName, ItemState state, Image img) - { - if (prop == img) return; - prop = img; - if (Handle != null) - { - Interop.Eext.eext_rotary_selector_item_part_content_set(Handle, partName, (int)state, img); - } - } - - void setPart(ref Color prop, string partName, ItemState state, Color color) - { - if (prop == color) return; - prop = color; - if (Handle != null) - { - Interop.Eext.eext_rotary_selector_item_part_color_set(Handle, partName, (int)state, color.R, color.G, color.B, color.A); - } - } - - void setPart(ref string prop, string partName, string txt) - { - if (prop == txt) return; - prop = txt; - if (Handle != null) - { - Interop.Eext.eext_rotary_selector_item_part_text_set(Handle, partName, txt); - } - } - - /// - /// Sets or gets the main text of a rotary selector item object. - /// - public string MainText { set => setPart(ref _mainText, MainTextPartName, value); get => _mainText; } - - /// - /// Sets or gets the sub text of a rotary selector item object. - /// - public string SubText { set => setPart(ref _subText, SubTextPartName, value); get => _subText; } - - /// - /// Sets or gets the sub text color of a rotary selector item object. - /// - public Color MainTextColor { set => setPart(ref _mainTextColor, MainTextPartName, ItemState.Normal, value); get => _mainTextColor; } - - /// - /// Sets or gets the sub text color of a rotary selector item object. - /// - public Color SubTextColor { set => setPart(ref _subTextColor, SubTextPartName, ItemState.Normal, value); get => _subTextColor; } - - /// - /// Sets or gets the normal icon image of a rotary selector item object. - /// - public Image NormalIconImage { set => setPart(ref _normalIconImage, IconPartName, ItemState.Normal, value); get => _normalIconImage; } - - /// - /// Sets or gets the press icon image of a rotary selector item object. - /// - public Image PressedIconImage { set => setPart(ref _pressedIconImage, IconPartName, ItemState.Pressed, value); get => _pressedIconImage; } - - /// - /// Sets or gets the disable icon image of a rotary selector item object. - /// - public Image DisabledIconImage { set => setPart(ref _disabledIconImage, IconPartName, ItemState.Disabled, value); get => _disabledIconImage; } - - /// - /// Sets or gets the selected icon image of a rotary selector item object. - /// - public Image SelectedIconImage { set => setPart(ref _selectedIconImage, IconPartName, ItemState.Selected, value); get => _selectedIconImage; } - - /// - /// Sets or gets the normal background image of a rotary selector item object. - /// - public Image NormalBackgroundImage { set => setPart(ref _normalBgImage, BgPartName, ItemState.Normal, value); get => _normalBgImage; } - - /// - /// Sets or gets the pressed background image of a rotary selector item object. - /// - public Image PressedBackgroundImage { set => setPart(ref _pressedBgImage, BgPartName, ItemState.Pressed, value); get => _pressedBgImage; } - - /// - /// Sets or gets the disabled background image of a rotary selector item object. - /// - public Image DisabledBackgroundImage { set => setPart(ref _disabledBgImage, BgPartName, ItemState.Disabled, value); get => _disabledBgImage; } - - /// - /// Sets or gets the selected background image of a rotary selector item object. - /// - public Image SelectedBackgroundImage { set => setPart(ref _selectedBgImage, BgPartName, ItemState.Selected, value); get => _selectedBgImage; } - - /// - /// Sets or gets the normal background color of a rotary selector item object. - /// - public Color NormalBackgroundColor { set => setPart(ref _normalBgColor, BgPartName, ItemState.Normal, value); get => _normalBgColor; } - - /// - /// Sets or gets the pressed background color of a rotary selector item object. - /// - public Color PressedBackgroundColor { set => setPart(ref _pressedBgColor, BgPartName, ItemState.Pressed, value); get => _pressedBgColor; } - - /// - /// Sets or gets the disabled background color of a rotary selector item object. - /// - public Color DisabledBackgroundColor { set => setPart(ref _disabledBgColor, BgPartName, ItemState.Disabled, value); get => _disabledBgColor; } - - /// - /// Sets or gets the selected background color of a rotary selector item object. - /// - public Color SelectedBackgroundColor { set => setPart(ref _selectedBgColor, BgPartName, ItemState.Selected, value); get => _selectedBgColor; } - - /// - /// Sets or gets the selector icon image of a rotary selector item object. - /// - public Image SelectorIconImage { set => setPart(ref _selectorIconImage, SelectorIconPartName, ItemState.Normal, value); get => _selectorIconImage; } - - internal enum ItemState - { - Normal, - Pressed, - Disabled, - Selected - } - } -} diff --git a/src/ElmSharp.Wearable/ElmSharp.Wearable/RotarySelectorItemEventArgs.cs b/src/ElmSharp.Wearable/ElmSharp.Wearable/RotarySelectorItemEventArgs.cs deleted file mode 100755 index 22630d946..000000000 --- a/src/ElmSharp.Wearable/ElmSharp.Wearable/RotarySelectorItemEventArgs.cs +++ /dev/null @@ -1,34 +0,0 @@ -/* - * 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.Collections.Generic; -using System.Text; - -namespace ElmSharp.Wearable -{ - /// - /// and events of RotarySelector contain RotarySelectorItemEventArgs as a parameter. - /// Inherits . - /// - public class RotarySelectorItemEventArgs : EventArgs - { - /// - /// Sets or gets the rotary selector item. - /// - public RotarySelectorItem Item { get; set; } - } -} diff --git a/src/ElmSharp.Wearable/ElmSharp.Wearable/RotarySelectorList.cs b/src/ElmSharp.Wearable/ElmSharp.Wearable/RotarySelectorList.cs deleted file mode 100644 index 39866b8fa..000000000 --- a/src/ElmSharp.Wearable/ElmSharp.Wearable/RotarySelectorList.cs +++ /dev/null @@ -1,112 +0,0 @@ -/* - * 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.Collections; -using System.Collections.Generic; -using System.Text; - -namespace ElmSharp.Wearable -{ - class RotarySelectorList : IList - { - RotarySelector _owner; - List Items { get; set; } - - public RotarySelectorList(RotarySelector owner) - { - this._owner = owner; - Items = new List(); - } - - public RotarySelectorItem this[int index] { get => Items[index]; set => Items[index] = value; } - - public int Count => Items.Count; - - public bool IsReadOnly => false; - - public void Add(RotarySelectorItem item) - { - item.Handle = Interop.Eext.eext_rotary_selector_item_append(_owner); - Items.Add(item); - } - - public void Clear() - { - Interop.Eext.eext_rotary_selector_items_clear(_owner); - } - - public bool Contains(RotarySelectorItem item) - { - return Items.Contains(item); - } - - public void CopyTo(RotarySelectorItem[] array, int arrayIndex) - { - Items.CopyTo(array, arrayIndex); - } - - public IEnumerator GetEnumerator() - { - return Items.GetEnumerator(); - } - - public int IndexOf(RotarySelectorItem item) - { - return Items.IndexOf(item); - } - - public void Insert(int index, RotarySelectorItem item) - { - if (Items.Count <= index || index < 0) - { - throw new ArgumentOutOfRangeException("index is not valid in the RotarySelector"); - } - RotarySelectorItem target = Items[index]; - item.Handle = Interop.Eext.eext_rotary_selector_item_insert_after(_owner, target.Handle); - Items.Insert(index, item); - } - - public bool Remove(RotarySelectorItem item) - { - if (Items.Contains(item)) - { - Interop.Eext.eext_rotary_selector_item_del(item.Handle); - Items.Remove(item); - return true; - } - return false; - } - - public void RemoveAt(int index) - { - if (Items.Count < index + 1 || index < 0) - { - throw new ArgumentOutOfRangeException("index is not valid in the RotarySelector"); - } - - RotarySelectorItem target = Items[index]; - Interop.Eext.eext_rotary_selector_item_del(target.Handle); - target.Handle = IntPtr.Zero; - Items.RemoveAt(index); - } - - IEnumerator IEnumerable.GetEnumerator() - { - return Items.GetEnumerator(); - } - } -} diff --git a/src/ElmSharp.Wearable/Interop/Interop.Eext.CircleDatetime.cs b/src/ElmSharp.Wearable/Interop/Interop.Eext.CircleDatetime.cs deleted file mode 100644 index 4bbd8d9e3..000000000 --- a/src/ElmSharp.Wearable/Interop/Interop.Eext.CircleDatetime.cs +++ /dev/null @@ -1,27 +0,0 @@ -/* - * 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 Eext - { - [DllImport(Libraries.Eext)] - internal static extern IntPtr eext_circle_object_datetime_add(IntPtr datetime, IntPtr surface); - } -} \ No newline at end of file diff --git a/src/ElmSharp.Wearable/Interop/Interop.Eext.CircleGenList.cs b/src/ElmSharp.Wearable/Interop/Interop.Eext.CircleGenList.cs deleted file mode 100644 index b3581cada..000000000 --- a/src/ElmSharp.Wearable/Interop/Interop.Eext.CircleGenList.cs +++ /dev/null @@ -1,40 +0,0 @@ -/* - * 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 Eext - { - [DllImport(Libraries.Eext)] - internal static extern IntPtr eext_circle_object_genlist_add(IntPtr genlist, IntPtr surface); - - [DllImport(Libraries.Eext)] - internal static extern void eext_circle_object_genlist_scroller_policy_set(IntPtr circleGenlist, int policyHorisontal, int policyVertical); - - [DllImport(Libraries.Eext)] - internal static extern void eext_circle_object_genlist_scroller_policy_get(IntPtr circleGenlist, out int policyHorisontal, out int policyVertical); - - [DllImport(Libraries.Eext)] - internal static extern void eext_circle_object_genlist_scroller_policy_get(IntPtr circleGenlist, out int policyHorisontal, IntPtr policyVertical); - - [DllImport(Libraries.Eext)] - internal static extern void eext_circle_object_genlist_scroller_policy_get(IntPtr circleGenlist, IntPtr policyHorisontal, out int policyVertical); - } -} \ No newline at end of file diff --git a/src/ElmSharp.Wearable/Interop/Interop.Eext.CircleObject.cs b/src/ElmSharp.Wearable/Interop/Interop.Eext.CircleObject.cs deleted file mode 100644 index e1940f6f3..000000000 --- a/src/ElmSharp.Wearable/Interop/Interop.Eext.CircleObject.cs +++ /dev/null @@ -1,141 +0,0 @@ -/* - * 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 Eext - { - [DllImport(Libraries.Eext)] - internal static extern IntPtr eext_circle_object_add(IntPtr obj, IntPtr surface); - - [DllImport(Libraries.Eext)] - internal static extern void eext_circle_object_disabled_set(IntPtr obj, bool disabled); - - [DllImport(Libraries.Eext)] - internal static extern bool eext_circle_object_disabled_get(IntPtr obj); - - [DllImport(Libraries.Eext)] - internal static extern void eext_circle_object_line_width_set(IntPtr obj, int lineWidth); - - [DllImport(Libraries.Eext)] - internal static extern int eext_circle_object_line_width_get(IntPtr obj); - - [DllImport(Libraries.Eext)] - internal static extern void eext_circle_object_angle_set(IntPtr obj, double angle); - - [DllImport(Libraries.Eext)] - internal static extern double eext_circle_object_angle_get(IntPtr obj); - - [DllImport(Libraries.Eext)] - internal static extern void eext_circle_object_angle_offset_set(IntPtr obj, double offset); - - [DllImport(Libraries.Eext)] - internal static extern double eext_circle_object_angle_offset_get(IntPtr obj); - - [DllImport(Libraries.Eext)] - internal static extern void eext_circle_object_angle_min_max_set(IntPtr obj, double min, double max); - - [DllImport(Libraries.Eext)] - internal static extern void eext_circle_object_angle_min_max_get(IntPtr obj, out double min, out double max); - - [DllImport(Libraries.Eext)] - internal static extern void eext_circle_object_value_min_max_set(IntPtr obj, double min, double max); - - [DllImport(Libraries.Eext)] - internal static extern void eext_circle_object_value_min_max_get(IntPtr obj, out double min, out double max); - - [DllImport(Libraries.Eext)] - internal static extern void eext_circle_object_value_set(IntPtr obj, double value); - - [DllImport(Libraries.Eext)] - internal static extern double eext_circle_object_value_get(IntPtr obj); - - [DllImport(Libraries.Eext)] - internal static extern void eext_circle_object_color_set(IntPtr obj, int r, int g, int b, int a); - - [DllImport(Libraries.Eext)] - internal static extern void eext_circle_object_color_get(IntPtr obj, out int r, out int g, out int b, out int a); - - [DllImport(Libraries.Eext)] - internal static extern void eext_circle_object_radius_set(IntPtr obj, double radius); - - [DllImport(Libraries.Eext)] - internal static extern double eext_circle_object_radius_get(IntPtr obj); - - [DllImport(Libraries.Eext)] - internal static extern void eext_circle_object_item_line_width_set(IntPtr obj, string item, int lineWidth); - - [DllImport(Libraries.Eext)] - internal static extern int eext_circle_object_item_line_width_get(IntPtr obj, string item); - - [DllImport(Libraries.Eext)] - internal static extern void eext_circle_object_item_angle_set(IntPtr obj, string item, double angle); - - [DllImport(Libraries.Eext)] - internal static extern double eext_circle_object_item_angle_get(IntPtr obj, string item); - - [DllImport(Libraries.Eext)] - internal static extern void eext_circle_object_item_angle_offset_set(IntPtr obj, string item, double offset); - - [DllImport(Libraries.Eext)] - internal static extern double eext_circle_object_item_angle_offset_get(IntPtr obj, string item); - - [DllImport(Libraries.Eext)] - internal static extern void eext_circle_object_item_angle_min_max_set(IntPtr obj, string item, double min, double max); - - [DllImport(Libraries.Eext)] - internal static extern void eext_circle_object_item_angle_min_max_get(IntPtr obj, string item, out double min, out double max); - - [DllImport(Libraries.Eext)] - internal static extern void eext_circle_object_item_angle_min_max_get(IntPtr obj, string item, out double min, IntPtr max); - - [DllImport(Libraries.Eext)] - internal static extern void eext_circle_object_item_angle_min_max_get(IntPtr obj, string item, IntPtr min, out double max); - - [DllImport(Libraries.Eext)] - internal static extern void eext_circle_object_item_value_min_max_set(IntPtr obj, string item, double min, double max); - - [DllImport(Libraries.Eext)] - internal static extern void eext_circle_object_item_value_min_max_get(IntPtr obj, string item, out double min, out double max); - - [DllImport(Libraries.Eext)] - internal static extern void eext_circle_object_item_value_min_max_get(IntPtr obj, string item, out double min, IntPtr max); - - [DllImport(Libraries.Eext)] - internal static extern void eext_circle_object_item_value_min_max_get(IntPtr obj, string item, IntPtr min, out double max); - - [DllImport(Libraries.Eext)] - internal static extern void eext_circle_object_item_value_set(IntPtr obj, string item, double value); - - [DllImport(Libraries.Eext)] - internal static extern double eext_circle_object_item_value_get(IntPtr obj, string item); - - [DllImport(Libraries.Eext)] - internal static extern void eext_circle_object_item_color_set(IntPtr obj, string item, int r, int g, int b, int a); - - [DllImport(Libraries.Eext)] - internal static extern void eext_circle_object_item_color_get(IntPtr obj, string item, out int r, out int g, out int b, out int a); - - [DllImport(Libraries.Eext)] - internal static extern void eext_circle_object_item_radius_set(IntPtr obj, string item, double radius); - - [DllImport(Libraries.Eext)] - internal static extern double eext_circle_object_item_radius_get(IntPtr obj, string item); - } -} \ No newline at end of file diff --git a/src/ElmSharp.Wearable/Interop/Interop.Eext.CircleProgressBar.cs b/src/ElmSharp.Wearable/Interop/Interop.Eext.CircleProgressBar.cs deleted file mode 100644 index 8c60209ff..000000000 --- a/src/ElmSharp.Wearable/Interop/Interop.Eext.CircleProgressBar.cs +++ /dev/null @@ -1,28 +0,0 @@ -/* - * 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 Eext - { - [DllImport(Libraries.Eext)] - internal static extern IntPtr eext_circle_object_progressbar_add(IntPtr parent, IntPtr surface); - - } -} \ No newline at end of file diff --git a/src/ElmSharp.Wearable/Interop/Interop.Eext.CircleScroller.cs b/src/ElmSharp.Wearable/Interop/Interop.Eext.CircleScroller.cs deleted file mode 100644 index 250210026..000000000 --- a/src/ElmSharp.Wearable/Interop/Interop.Eext.CircleScroller.cs +++ /dev/null @@ -1,39 +0,0 @@ -/* - * 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 Eext - { - [DllImport(Libraries.Eext)] - internal static extern IntPtr eext_circle_object_scroller_add(IntPtr scroller, IntPtr surface); - - [DllImport(Libraries.Eext)] - internal static extern void eext_circle_object_scroller_policy_set(IntPtr obj, int policy_h, int policy_v); - - [DllImport(Libraries.Eext)] - internal static extern void eext_circle_object_scroller_policy_get(IntPtr obj, IntPtr policy_h, IntPtr policy_v); - - [DllImport(Libraries.Eext)] - internal static extern void eext_circle_object_scroller_policy_get(IntPtr obj, out int policy_h, IntPtr policy_v); - - [DllImport(Libraries.Eext)] - internal static extern void eext_circle_object_scroller_policy_get(IntPtr obj, IntPtr policy_h, out int policy_v); - } -} \ No newline at end of file diff --git a/src/ElmSharp.Wearable/Interop/Interop.Eext.CircleSlider.cs b/src/ElmSharp.Wearable/Interop/Interop.Eext.CircleSlider.cs deleted file mode 100644 index d2eeef36f..000000000 --- a/src/ElmSharp.Wearable/Interop/Interop.Eext.CircleSlider.cs +++ /dev/null @@ -1,33 +0,0 @@ -/* - * 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 Eext - { - [DllImport(Libraries.Eext)] - internal static extern IntPtr eext_circle_object_slider_add(IntPtr parent, IntPtr surface); - - [DllImport(Libraries.Eext)] - internal static extern void eext_circle_object_slider_step_set(IntPtr obj, double value); - - [DllImport(Libraries.Eext)] - internal static extern double eext_circle_object_slider_step_get(IntPtr obj); - } -} \ No newline at end of file diff --git a/src/ElmSharp.Wearable/Interop/Interop.Eext.CircleSpinner.cs b/src/ElmSharp.Wearable/Interop/Interop.Eext.CircleSpinner.cs deleted file mode 100644 index eb221ebe3..000000000 --- a/src/ElmSharp.Wearable/Interop/Interop.Eext.CircleSpinner.cs +++ /dev/null @@ -1,31 +0,0 @@ -/* - * 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 Eext - { - [DllImport(Libraries.Eext)] - internal static extern IntPtr eext_circle_object_spinner_add(IntPtr spinner, IntPtr surface); - - [DllImport(Libraries.Eext)] - internal static extern IntPtr eext_circle_object_spinner_angle_set(IntPtr spinner, double angle); - - } -} \ No newline at end of file diff --git a/src/ElmSharp.Wearable/Interop/Interop.Eext.CircleSurface.cs b/src/ElmSharp.Wearable/Interop/Interop.Eext.CircleSurface.cs deleted file mode 100644 index 4b5f820a7..000000000 --- a/src/ElmSharp.Wearable/Interop/Interop.Eext.CircleSurface.cs +++ /dev/null @@ -1,37 +0,0 @@ -/* - * 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 Eext - { - [DllImport(Libraries.Eext)] - internal static extern IntPtr eext_circle_surface_conformant_add(IntPtr conformant); - - [DllImport(Libraries.Eext)] - internal static extern IntPtr eext_circle_surface_layout_add(IntPtr layout); - - [DllImport(Libraries.Eext)] - internal static extern IntPtr eext_circle_surface_naviframe_add(IntPtr naviframe); - - [DllImport(Libraries.Eext)] - internal static extern IntPtr eext_circle_surface_del(IntPtr surface); - } -} \ No newline at end of file diff --git a/src/ElmSharp.Wearable/Interop/Interop.Eext.MoreOption.cs b/src/ElmSharp.Wearable/Interop/Interop.Eext.MoreOption.cs deleted file mode 100644 index 95b1de859..000000000 --- a/src/ElmSharp.Wearable/Interop/Interop.Eext.MoreOption.cs +++ /dev/null @@ -1,65 +0,0 @@ -using System; -using System.Runtime.InteropServices; - -internal static partial class Interop -{ - internal static partial class Eext - { - [DllImport(Libraries.Eext)] - internal static extern IntPtr eext_more_option_add(IntPtr parent); - - [DllImport(Libraries.Eext)] - internal static extern void eext_more_option_direction_set(IntPtr obj, int direction); - - [DllImport(Libraries.Eext)] - internal static extern int eext_more_option_direction_get(IntPtr obj); - - [DllImport(Libraries.Eext)] - internal static extern IntPtr eext_more_option_item_append(IntPtr obj); - - [DllImport(Libraries.Eext)] - internal static extern void eext_more_option_item_del(IntPtr obj); - - [DllImport(Libraries.Eext)] - internal static extern void eext_more_option_item_domain_translatable_part_text_set(IntPtr item, string part_name, string domain, string text); - - [DllImport(Libraries.Eext)] - internal static extern IntPtr eext_more_option_item_insert_after(IntPtr obj, IntPtr after); - - [DllImport(Libraries.Eext)] - internal static extern IntPtr eext_more_option_item_insert_before(IntPtr obj, IntPtr before); - - [DllImport(Libraries.Eext)] - internal static extern IntPtr eext_more_option_item_part_content_get(IntPtr obj, string part_name); - - [DllImport(Libraries.Eext)] - internal static extern void eext_more_option_item_part_content_set(IntPtr item, string part_name, IntPtr content); - - [DllImport(Libraries.Eext, EntryPoint = "eext_more_option_item_part_text_get")] - static extern IntPtr _eext_more_option_item_part_text_get(IntPtr item, string part_name); - - internal static string eext_more_option_item_part_text_get(IntPtr item, string part_name) - { - var ptr = _eext_more_option_item_part_text_get(item, part_name); - return Marshal.PtrToStringAnsi(ptr); - } - - [DllImport(Libraries.Eext)] - internal static extern void eext_more_option_item_part_text_set(IntPtr item, string part_name, string text); - - [DllImport(Libraries.Eext)] - internal static extern IntPtr eext_more_option_item_prepend(IntPtr obj); - - [DllImport(Libraries.Eext)] - internal static extern void eext_more_option_items_clear(IntPtr obj); - - [DllImport(Libraries.Eext)] - internal static extern IntPtr eext_more_option_items_get(IntPtr obj); - - [DllImport(Libraries.Eext)] - internal static extern bool eext_more_option_opened_get(IntPtr obj); - - [DllImport(Libraries.Eext)] - internal static extern void eext_more_option_opened_set(IntPtr obj, bool opened); - } -} diff --git a/src/ElmSharp.Wearable/Interop/Interop.Eext.Rotary.cs b/src/ElmSharp.Wearable/Interop/Interop.Eext.Rotary.cs deleted file mode 100644 index aa004b184..000000000 --- a/src/ElmSharp.Wearable/Interop/Interop.Eext.Rotary.cs +++ /dev/null @@ -1,68 +0,0 @@ -/* - * 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 Eext - { - const short EEXT_CALLBACK_PRIORITY_AFTER = 100; - const short EEXT_CALLBACK_PRIORITY_BEFORE = -100; - const short EEXT_CALLBACK_PRIORITY_DEFAULT = 0; - - internal delegate bool Eext_Rotary_Event_Cb(IntPtr data, IntPtr obj, IntPtr info); - internal delegate bool Eext_Rotary_Handler_Cb(IntPtr data, IntPtr info); - - internal enum Eext_Rotary_Event_Direction - { - Clockwise, - CounterClockwise - } - - [StructLayout(LayoutKind.Sequential)] - internal struct Eext_Rotary_Event_Info - { - public Eext_Rotary_Event_Direction Direction; - public uint TimeStamp; - } - - internal static Eext_Rotary_Event_Info FromIntPtr(IntPtr infoPtr) - { - var info = Marshal.PtrToStructure(infoPtr); - return info; - } - - [DllImport(Libraries.Eext)] - internal static extern IntPtr eext_rotary_object_event_activated_set(IntPtr circleObject, bool activated); - - [DllImport(Libraries.Eext)] - internal static extern bool eext_rotary_object_event_callback_add(IntPtr obj, Eext_Rotary_Event_Cb func, IntPtr data); - - [DllImport(Libraries.Eext)] - internal static extern bool eext_rotary_object_event_callback_priority_add(IntPtr obj, short priority, Eext_Rotary_Event_Cb func, IntPtr data); - - [DllImport(Libraries.Eext)] - internal static extern IntPtr eext_rotary_object_event_callback_del(IntPtr obj, Eext_Rotary_Event_Cb func); - - [DllImport(Libraries.Eext)] - internal static extern bool eext_rotary_event_handler_add(Eext_Rotary_Handler_Cb func, IntPtr data); - - [DllImport(Libraries.Eext)] - internal static extern IntPtr eext_rotary_event_handler_del(Eext_Rotary_Handler_Cb func); - } -} \ No newline at end of file diff --git a/src/ElmSharp.Wearable/Interop/Interop.Eext.RotarySelector.cs b/src/ElmSharp.Wearable/Interop/Interop.Eext.RotarySelector.cs deleted file mode 100644 index 457cfbbe7..000000000 --- a/src/ElmSharp.Wearable/Interop/Interop.Eext.RotarySelector.cs +++ /dev/null @@ -1,51 +0,0 @@ -using System; -using System.Runtime.InteropServices; - - -internal static partial class Interop -{ - internal static partial class Eext - { - [DllImport(Libraries.Eext)] - internal static extern IntPtr eext_rotary_selector_add(IntPtr parent); - [DllImport(Libraries.Eext)] - internal static extern IntPtr eext_rotary_selector_item_append(IntPtr obj); - [DllImport(Libraries.Eext)] - internal static extern IntPtr eext_rotary_selector_item_prepend(IntPtr obj); - [DllImport(Libraries.Eext)] - internal static extern IntPtr eext_rotary_selector_item_insert_after(IntPtr obj, IntPtr after); - [DllImport(Libraries.Eext)] - internal static extern IntPtr eext_rotary_selector_item_insert_before(IntPtr obj, IntPtr before); - [DllImport(Libraries.Eext)] - internal static extern void eext_rotary_selector_item_del(IntPtr item); - [DllImport(Libraries.Eext)] - internal static extern void eext_rotary_selector_items_clear(IntPtr obj); - [DllImport(Libraries.Eext)] - internal static extern void eext_rotary_selector_item_part_text_set(IntPtr item, string part_name, string text); - [DllImport(Libraries.Eext)] - internal static extern string eext_rotary_selector_item_part_text_get(IntPtr item, string part_name); - [DllImport(Libraries.Eext)] - internal static extern void eext_rotary_selector_item_domain_translatable_part_text_set(IntPtr item, string part_name, string domain, string text); - [DllImport(Libraries.Eext)] - internal static extern void eext_rotary_selector_item_part_content_set(IntPtr item, string part_name, int state, IntPtr content); - [DllImport(Libraries.Eext)] - internal static extern IntPtr eext_rotary_selector_item_part_content_get(IntPtr item, string part_name, int state); - [DllImport(Libraries.Eext)] - internal static extern void eext_rotary_selector_part_content_set(IntPtr obj, string part_name, int state, IntPtr content); - [DllImport(Libraries.Eext)] - internal static extern IntPtr eext_rotary_selector_part_content_get(IntPtr obj, string part_name, int state); - [DllImport(Libraries.Eext)] - internal static extern void eext_rotary_selector_item_part_color_set(IntPtr item, string part_name, int state, int r, int g, int b, int a); - [DllImport(Libraries.Eext)] - internal static extern void eext_rotary_selector_item_part_color_get(IntPtr item, string part_name, int state, out int r, out int g, out int b, out int a); - [DllImport(Libraries.Eext)] - internal static extern void eext_rotary_selector_part_color_set(IntPtr obj, string part_name, int state, int r, int g, int b, int a); - [DllImport(Libraries.Eext)] - internal static extern void eext_rotary_selector_part_color_get(IntPtr obj, string part_name, int state, out int r, out int g, out int b, out int a); - [DllImport(Libraries.Eext)] - internal static extern void eext_rotary_selector_selected_item_set(IntPtr obj, IntPtr item); - [DllImport(Libraries.Eext)] - internal static extern IntPtr eext_rotary_selector_selected_item_get(IntPtr obj); - - } -} diff --git a/src/ElmSharp.Wearable/Interop/Interop.Evas.cs b/src/ElmSharp.Wearable/Interop/Interop.Evas.cs deleted file mode 100644 index dbe48e82f..000000000 --- a/src/ElmSharp.Wearable/Interop/Interop.Evas.cs +++ /dev/null @@ -1,28 +0,0 @@ -/* - * 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 Evas - { - - [DllImport(Libraries.Evas)] - internal static extern void evas_object_resize(IntPtr obj, int w, int h); - } -} \ No newline at end of file diff --git a/src/ElmSharp.Wearable/Interop/Interop.Libraries.cs b/src/ElmSharp.Wearable/Interop/Interop.Libraries.cs deleted file mode 100644 index 366835873..000000000 --- a/src/ElmSharp.Wearable/Interop/Interop.Libraries.cs +++ /dev/null @@ -1,25 +0,0 @@ -/* - * 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 class Libraries - { - internal const string Elementary = "libelementary.so.1"; - internal const string Eext = "libefl-extension.so.0"; - internal const string Evas = "libevas.so.1"; - } -} diff --git a/src/ElmSharp/ElmSharp.csproj b/src/ElmSharp/ElmSharp.csproj deleted file mode 100644 index dbdcea46b..000000000 --- a/src/ElmSharp/ElmSharp.csproj +++ /dev/null @@ -1,7 +0,0 @@ - - - - netstandard2.0 - - - diff --git a/src/ElmSharp/ElmSharp.sln b/src/ElmSharp/ElmSharp.sln deleted file mode 100755 index a762491c2..000000000 --- a/src/ElmSharp/ElmSharp.sln +++ /dev/null @@ -1,22 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26430.12 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ElmSharp", "ElmSharp.csproj", "{14E1F109-06BC-4BB7-9146-704A71EC2522}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {14E1F109-06BC-4BB7-9146-704A71EC2522}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {14E1F109-06BC-4BB7-9146-704A71EC2522}.Debug|Any CPU.Build.0 = Debug|Any CPU - {14E1F109-06BC-4BB7-9146-704A71EC2522}.Release|Any CPU.ActiveCfg = Release|Any CPU - {14E1F109-06BC-4BB7-9146-704A71EC2522}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/src/ElmSharp/ElmSharp/AccessRole.cs b/src/ElmSharp/ElmSharp/AccessRole.cs deleted file mode 100755 index b49b2a27d..000000000 --- a/src/ElmSharp/ElmSharp/AccessRole.cs +++ /dev/null @@ -1,438 +0,0 @@ -/* - * 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. - */ - - -namespace ElmSharp.Accessible -{ - /// - /// Enumeration for AccessRole. - /// - public enum AccessRole - { - /// - /// Invalid - /// - Invalid, - /// - /// AcceleratorLabel role - /// - AcceleratorLabel, - /// - /// Alert role - /// - Alert, - /// - /// Animation role - /// - Animation, - /// - /// Arrow role - /// - Arrow, - /// - /// Calendar role - /// - Calendar, - /// - /// Canvas role - /// - Canvas, - /// - /// CheckBox role - /// - CheckBox, - /// - /// CheckMenuItem role - /// - CheckMenuItem, - /// - /// ColorChooser role - /// - ColorChooser, - /// - /// ColumnHeader role - /// - ColumnHeader, - /// - /// ComboBox role - /// - ComboBox, - /// - /// DateEditor role - /// - DateEditor, - /// - /// DesktopIcon role - /// - DesktopIcon, - /// - /// DesktopFrame role - /// - DesktopFrame, - /// - /// Dial role - /// - Dial, - /// - /// Dialog role - /// - Dialog, - /// - /// DirectoryPane role - /// - DirectoryPane, - /// - /// DrawingArea role - /// - DrawingArea, - /// - /// FileChooser role - /// - FileChooser, - /// - /// Filler role - /// - Filler, - /// - /// FocusTraversable role - /// - FocusTraversable, - /// - /// FontChooser role - /// - FontChooser, - /// - /// Frame role - /// - Frame, - /// - /// GlassPane role - /// - GlassPane, - /// - /// HtmlContainer role - /// - HtmlContainer, - /// - /// Icon role - /// - Icon, - /// - /// Image role - /// - Image, - /// - /// InternalFrame role - /// - InternalFrame, - /// - /// Label role - /// - Label, - /// - /// LayeredPane role - /// - LayeredPane, - /// - /// List role - /// - List, - /// - /// ListItem role - /// - ListItem, - /// - /// Menu role - /// - Menu, - /// - /// MenuBar role - /// - MenuBar, - /// - /// MenuItem role - /// - MenuItem, - /// - /// OptionPane role - /// - OptionPane, - /// - /// PageTab role - /// - PageTab, - /// - /// PageTabList role - /// - PageTabList, - /// - /// Panel role - /// - Panel, - /// - /// PasswordText role - /// - PasswordText, - /// - /// PopupMenu role - /// - PopupMenu, - /// - /// ProgressBar role - /// - ProgressBar, - /// - /// PushButton role - /// - PushButton, - /// - /// RadioButton role - /// - RadioButton, - /// - /// RadioMenuItem role - /// - RadioMenuItem, - /// - /// RootPane role - /// - RootPane, - /// - /// RowHeader role - /// - RowHeader, - /// - /// ScrollBar role - /// - ScrollBar, - /// - /// ScrollPane role - /// - ScrollPane, - /// - /// Separator role - /// - Separator, - /// - /// Slider role - /// - Slider, - /// - /// SpinButton role - /// - SpinButton, - /// - /// SplitPane role - /// - SplitPane, - /// - /// StatusBar role - /// - StatusBar, - /// - /// Table role - /// - Table, - /// - /// TableCell role - /// - TableCell, - /// - /// TableColumnHeader role - /// - TableColumnHeader, - /// - /// TableRowHeader role - /// - TableRowHeader, - /// - /// TearoffMenuItem role - /// - TearoffMenuItem, - /// - /// Terminal role - /// - Terminal, - /// - /// Text role - /// - Text, - /// - /// ToggleButton role - /// - ToggleButton, - /// - /// ToolBar role - /// - ToolBar, - /// - /// ToolTip role - /// - ToolTip, - /// - /// Tree role - /// - Tree, - /// - /// TreeTable role - /// - TreeTable, - /// - /// Unknown - /// - Unknown, - /// - /// Viewport role - /// - Viewport, - /// - /// Window role - /// - Window, - /// - /// Extended role - /// - Extended, - /// - /// Header role - /// - Header, - /// - /// Footer role - /// - Footer, - /// - /// Paragraph - /// - Paragraph, - /// - /// Ruler role - /// - Ruler, - /// - /// Application role - /// - Application, - /// - /// Autocomplete role - /// - Autocomplete, - /// - /// Editbar role - /// - Editbar, - /// - /// Embedded role - /// - Embedded, - /// - /// Entry role - /// - Entry, - /// - /// Chart role - /// - Chart, - /// - /// Caption role - /// - Caption, - /// - /// DocumentFrame role - /// - DocumentFrame, - /// - /// Heading role - /// - Heading, - /// - /// Page role - /// - Page, - /// - /// Section role - /// - Section, - /// - /// RedundantObject role - /// - RedundantObject, - /// - /// Form role - /// - Form, - /// - /// Link role - /// - Link, - /// - /// InputMethodWindow role - /// - InputMethodWindow, - /// - /// TableRow role - /// - TableRow, - /// - /// TreeItem role - /// - TreeItem, - /// - /// DocumentSpreadsheet role - /// - DocumentSpreadsheet, - /// - /// DocumentPresentation role - /// - DocumentPresentation, - /// - /// DocumentText role - /// - DocumentText, - /// - /// DocumentWeb role - /// - DocumentWeb, - /// - /// DocumentEmail role - /// - DocumentEmail, - /// - /// Comment role - /// - Comment, - /// - /// ListBox role - /// - ListBox, - /// - /// Grouping role - /// - Grouping, - /// - /// ImageMap role - /// - ImageMap, - /// - /// Notification role - /// - Notification, - /// - /// InfoBar role - /// - InfoBar - } -} diff --git a/src/ElmSharp/ElmSharp/AccessibleObject.cs b/src/ElmSharp/ElmSharp/AccessibleObject.cs deleted file mode 100755 index 08eedcb49..000000000 --- a/src/ElmSharp/ElmSharp/AccessibleObject.cs +++ /dev/null @@ -1,248 +0,0 @@ -/* - * 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 ElmSharp.Accessible -{ - /// - /// The delegate to define how to provide informations for or . - /// - /// The sender obj. - /// Return information for Name or Description. - public delegate string AccessibleInfoProvider (AccessibleObject obj); - - /// - /// It's a base abstract class for . - /// It provides available definitions for the screen reader, such as , , , etc. - /// There's many the relationship between two accessible objects, like , , , , etc. - /// - public abstract class AccessibleObject : EvasObject, IAccessibleObject - { - - AccessibleInfoProvider _nameProvider; - AccessibleInfoProvider _descriptionProvider; - - Interop.Elementary.Elm_Atspi_Reading_Info_Cb _nameProviderInternal; - Interop.Elementary.Elm_Atspi_Reading_Info_Cb _descriptionProviderInternal; - - /// - /// Gets or sets the reading information types of an accessible object. - /// - ReadingInfoType IAccessibleObject.ReadingInfoType - { - get - { - return (ReadingInfoType)Interop.Elementary.elm_atspi_accessible_reading_info_type_get(RealHandle); - } - set - { - Interop.Elementary.elm_atspi_accessible_reading_info_type_set(RealHandle, - (Interop.Elementary.Elm_Accessible_Reading_Info_Type)value); - } - } - - /// - /// Gets or sets the role of the object in accessibility domain. - /// - AccessRole IAccessibleObject.Role - { - get - { - return (AccessRole)Interop.Elementary.elm_atspi_accessible_role_get(RealHandle); - } - set - { - Interop.Elementary.elm_atspi_accessible_role_set(RealHandle, - (Interop.Elementary.Elm_Atspi_Role)value); - } - } - - /// - /// Gets or sets highlightable of given widget. - /// - bool IAccessibleObject.CanHighlight - { - get - { - return Interop.Elementary.elm_atspi_accessible_can_highlight_get(RealHandle); - } - set - { - Interop.Elementary.elm_atspi_accessible_can_highlight_set(RealHandle, value); - } - } - - /// - /// Gets or sets the translation domain of "name" and "description" properties. - /// Translation domain should be set if application wants to support i18n for accessibily "name" and "description" properties. - /// When translation domain is set values of "name" and "description" properties will be translated with dgettext function using current translation domain as "domainname" parameter. - /// It is application developer responsibility to ensure that translation files are loaded and binded to translation domain when accessibility is enabled. - /// - string IAccessibleObject.TranslationDomain - { - get - { - return Interop.Elementary.elm_atspi_accessible_translation_domain_get(RealHandle); - } - set - { - Interop.Elementary.elm_atspi_accessible_translation_domain_set(RealHandle, value); - } - } - - /// - /// Gets or sets an accessible name of the object. - /// - string IAccessibleObject.Name - { - get - { - return Interop.Elementary.elm_atspi_accessible_name_get(RealHandle); - } - set - { - Interop.Elementary.elm_atspi_accessible_name_set(RealHandle, value); - } - } - - /// - /// Gets or sets contextual information about object. - /// - string IAccessibleObject.Description - { - get - { - return Interop.Elementary.elm_atspi_accessible_description_get(RealHandle); - } - set - { - Interop.Elementary.elm_atspi_accessible_description_set(RealHandle, value); - } - } - - /// - /// Gets or sets the delegate for . - /// - AccessibleInfoProvider IAccessibleObject.NameProvider - { - get - { - return _nameProvider; - } - - set - { - if (_nameProviderInternal == null) - { - _nameProviderInternal = (data, obj) => _nameProvider(this); - } - if (value == null) - { - _nameProvider = null; - Interop.Elementary.elm_atspi_accessible_name_cb_set(RealHandle, null, IntPtr.Zero); - } - else - { - _nameProvider = new AccessibleInfoProvider(value); - Interop.Elementary.elm_atspi_accessible_name_cb_set(RealHandle, _nameProviderInternal, IntPtr.Zero); - } - } - } - - /// - /// Gets or sets the delegate for . - /// - AccessibleInfoProvider IAccessibleObject.DescriptionProvider - { - get - { - return _descriptionProvider; - } - - set - { - if (_descriptionProviderInternal == null) - { - _descriptionProviderInternal = (data, obj) => _descriptionProvider(this); - } - if (value == null) - { - _descriptionProvider = null; - Interop.Elementary.elm_atspi_accessible_description_cb_set(RealHandle, null, IntPtr.Zero); - } - else - { - _descriptionProvider = new AccessibleInfoProvider(value); - Interop.Elementary.elm_atspi_accessible_description_cb_set(RealHandle, _descriptionProviderInternal, IntPtr.Zero); - } - } - } - - /// - /// Creates and initializes a new instance of the AccessibleObject class with parent EvasObject class parameter. - /// - /// Parent EvasObject class - public AccessibleObject(EvasObject parent) : base(parent) - { - } - - /// - /// Creates and initializes a new instance of the AccessibleObject class. - /// - public AccessibleObject() : base() - { - } - - /// - /// Defines the relationship between two accessible objects. - /// Relationships can be queried by Assistive Technology clients to provide customized feedback, improving overall user experience. - /// AppendRelation API is asymmetric, which means that appending, for example, relation from object A to B, do not append relation from object B to object A. - /// - /// The relationship between source object and target object of a given type. - void IAccessibleObject.AppendRelation(IAccessibleRelation relation) - { - if (relation.Target == null) throw new ArgumentException("Target of Accessibility relation can not be null"); - Interop.Elementary.elm_atspi_accessible_relationship_append(RealHandle, relation.Type, relation.Target.Handle); - } - - /// - /// Removes the relationship between two accessible objects. - /// - /// The relationship between source object and target object of a given type. - void IAccessibleObject.RemoveRelation(IAccessibleRelation relation) - { - if (relation.Target == null) throw new ArgumentException("Target of Accessibility relation can not be null"); - Interop.Elementary.elm_atspi_accessible_relationship_remove(RealHandle, relation.Type, relation.Target.Handle); - } - - /// - /// Highlights accessible widget. - /// - public void Highlight() - { - Interop.Elementary.elm_atspi_component_highlight_grab(RealHandle); - } - - /// - /// Clears highlight of accessible widget. - /// - public void Unhighlight() - { - Interop.Elementary.elm_atspi_component_highlight_clear(RealHandle); - } - } -} diff --git a/src/ElmSharp/ElmSharp/AccessibleRelation.cs b/src/ElmSharp/ElmSharp/AccessibleRelation.cs deleted file mode 100755 index 4d24e989d..000000000 --- a/src/ElmSharp/ElmSharp/AccessibleRelation.cs +++ /dev/null @@ -1,371 +0,0 @@ -/* - * 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. - */ - - -namespace ElmSharp.Accessible -{ - /// - /// IAccessibleRelation is a interface which defines the relationship between two accessible objects. - /// - public interface IAccessibleRelation - { - - AccessibleObject Target { get; set; } - int Type { get; } - } - - /// - /// To define label info for accessible object. - /// - public class LabelledBy : IAccessibleRelation - { - /// - /// Gets or sets the target object which is LabelledBy. - /// - public AccessibleObject Target { get; set; } - - /// - /// Gets the LabelledBy type. - /// - public int Type - { - get { return (int)Interop.Elementary.Elm_Atspi_Relation_Type.ELM_ATSPI_RELATION_LABELLED_BY; } - } - } - - /// - /// To define label info for accessible object. - /// - public class LabelFor : IAccessibleRelation - { - /// - /// Gets or sets the target object which is LabelFor. - /// - public AccessibleObject Target { get; set; } - - /// - /// Gets the LabelFor type. - /// - public int Type - { - get { return (int)Interop.Elementary.Elm_Atspi_Relation_Type.ELM_ATSPI_RELATION_LABEL_FOR; } - } - } - - /// - /// To define control relationship for accessible object. - /// - public class ControllerFor : IAccessibleRelation - { - /// - /// Gets or sets the target object which is ControllerFor. - /// - public AccessibleObject Target { get; set; } - - /// - /// Gets the ControllerFor type. - /// - public int Type - { - get { return (int)Interop.Elementary.Elm_Atspi_Relation_Type.ELM_ATSPI_RELATION_CONTROLLER_FOR; } - } - } - - /// - /// To define control relationship for accessible object. - /// - public class ControlledBy : IAccessibleRelation - { - /// - /// Gets or sets the target object which is ControlledBy. - /// - public AccessibleObject Target { get; set; } - - /// - /// Gets the ControlledBy type. - /// - public int Type - { - get { return (int)Interop.Elementary.Elm_Atspi_Relation_Type.ELM_ATSPI_RELATION_CONTROLLED_BY; } - } - } - - /// - /// To define member relationship for accessible object. - /// - public class MemberOf : IAccessibleRelation - { - /// - /// Gets or sets the target object which is MemberOf. - /// - public AccessibleObject Target { get; set; } - - /// - /// Gets the MemberOf type. - /// - public int Type - { - get { return (int)Interop.Elementary.Elm_Atspi_Relation_Type.ELM_ATSPI_RELATION_MEMBER_OF; } - } - } - - /// - /// To define tooltip for accessible object. - /// - public class TooltipFor : IAccessibleRelation - { - /// - /// Gets or sets the target object which is TooltipFor. - /// - public AccessibleObject Target { get; set; } - - /// - /// Gets the TooltipFor type. - /// - public int Type - { - get { return (int)Interop.Elementary.Elm_Atspi_Relation_Type.ELM_ATSPI_RELATION_TOOLTIP_FOR; } - } - } - - /// - /// To define child for accessible object. - /// - public class ChildOf : IAccessibleRelation - { - /// - /// Gets or sets the target object which is ChildOf. - /// - public AccessibleObject Target { get; set; } - - /// - /// Gets the ChildOf type. - /// - public int Type - { - get { return (int)Interop.Elementary.Elm_Atspi_Relation_Type.ELM_ATSPI_RELATION_NODE_CHILD_OF; } - } - } - - /// - /// To define parent for accessible object. - /// - public class ParentOf : IAccessibleRelation - { - /// - /// Gets or sets the target object which is ParentOf. - /// - public AccessibleObject Target { get; set; } - - /// - /// Gets the ParentOf type. - /// - public int Type - { - get { return (int)Interop.Elementary.Elm_Atspi_Relation_Type.ELM_ATSPI_RELATION_NODE_PARENT_OF; } - } - } - - /// - /// To define extend for accessible object. - /// - public class Extended : IAccessibleRelation - { - /// - /// Gets or sets the target object which is Extended. - /// - public AccessibleObject Target { get; set; } - - /// - /// Gets the Extended type. - /// - public int Type - { - get { return (int)Interop.Elementary.Elm_Atspi_Relation_Type.ELM_ATSPI_RELATION_EXTENDED; } - } - } - - /// - /// To define the custom reading order. - /// - public class FlowsTo : IAccessibleRelation - { - /// - /// Gets or sets the target object which is FlowsTo. - /// - public AccessibleObject Target { get; set; } - - /// - /// Gets the FlowsTo type. - /// - public int Type - { - get { return (int)Interop.Elementary.Elm_Atspi_Relation_Type.ELM_ATSPI_RELATION_FLOWS_TO; } - } - } - - /// - /// To define the custom reading order. - /// - public class FlowsFrom : IAccessibleRelation - { - /// - /// Gets or sets the target object which is FlowsFrom. - /// - public AccessibleObject Target { get; set; } - - /// - /// Gets the FlowsFrom type. - /// - public int Type - { - get { return (int)Interop.Elementary.Elm_Atspi_Relation_Type.ELM_ATSPI_RELATION_FLOWS_FROM; } - } - } - - /// - /// To define subwindow for accessible object. - /// - public class SubwindowOf : IAccessibleRelation - { - /// - /// Gets or sets the target object which is SubwindowOf. - /// - public AccessibleObject Target { get; set; } - - /// - /// Gets the SubwindowOf type. - /// - public int Type - { - get { return (int)Interop.Elementary.Elm_Atspi_Relation_Type.ELM_ATSPI_RELATION_SUBWINDOW_OF; } - } - } - - /// - /// To define embed for accessible object. - /// - public class Embeds : IAccessibleRelation - { - /// - /// Gets or sets the target object which is Embeds. - /// - public AccessibleObject Target { get; set; } - - /// - /// Gets the Embeds type. - /// - public int Type - { - get { return (int)Interop.Elementary.Elm_Atspi_Relation_Type.ELM_ATSPI_RELATION_EMBEDS; } - } - } - - /// - /// To define embed for accessible object. - /// - public class EmbeddedBy : IAccessibleRelation - { - /// - /// Gets or sets the target object which is EmbeddedBy. - /// - public AccessibleObject Target { get; set; } - - /// - /// Gets the EmbeddedBy type. - /// - public int Type - { - get { return (int)Interop.Elementary.Elm_Atspi_Relation_Type.ELM_ATSPI_RELATION_EMBEDDED_BY; } - } - } - - /// - /// To define popup for accessible object. - /// - public class PopupFor : IAccessibleRelation - { - /// - /// Gets or sets the target object which is PopupFor. - /// - public AccessibleObject Target { get; set; } - - /// - /// Gets the PopupFor type. - /// - public int Type - { - get { return (int)Interop.Elementary.Elm_Atspi_Relation_Type.ELM_ATSPI_RELATION_POPUP_FOR; } - } - } - - /// - /// To define parent window for accessible object. - /// - public class ParentWindowOf : IAccessibleRelation - { - /// - /// Gets or sets the target object which is ParentWindowOf. - /// - public AccessibleObject Target { get; set; } - - /// - /// Gets the ParentWindowOf type. - /// - public int Type - { - get { return (int)Interop.Elementary.Elm_Atspi_Relation_Type.ELM_ATSPI_RELATION_PARENT_WINDOW_OF; } - } - } - - /// - /// To define description for accessible object. - /// - public class DescriptionFor : IAccessibleRelation - { - /// - /// Gets or sets the target object which is DescriptionFor. - /// - public AccessibleObject Target { get; set; } - - /// - /// Gets the DescriptionFor type. - /// - public int Type - { - get { return (int)Interop.Elementary.Elm_Atspi_Relation_Type.ELM_ATSPI_RELATION_DESCRIPTION_FOR; } - } - } - - /// - /// To define description for accessible object. - /// - public class DescribedBy : IAccessibleRelation - { - /// - /// Gets or sets the target object which is DescribedBy. - /// - public AccessibleObject Target { get; set; } - - /// - /// Gets the DescribedBy type. - /// - public int Type - { - get { return (int)Interop.Elementary.Elm_Atspi_Relation_Type.ELM_ATSPI_RELATION_DESCRIBED_BY; } - } - } -} diff --git a/src/ElmSharp/ElmSharp/AccessibleUtil.cs b/src/ElmSharp/ElmSharp/AccessibleUtil.cs deleted file mode 100755 index 720fca436..000000000 --- a/src/ElmSharp/ElmSharp/AccessibleUtil.cs +++ /dev/null @@ -1,90 +0,0 @@ -/* - * 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; -using System.Threading.Tasks; - -namespace ElmSharp.Accessible -{ - /// - /// Enumeration for ReadingStatus. - /// - public enum ReadingStatus - { - /// - /// Unknown status - /// - Unknown, - /// - /// Cancelled status - /// - Cancelled, - /// - /// Stopped status - /// - Stoppped, - /// - /// Skipped status - /// - Skipped - } - - /// - /// AccessibleUtil provides a method to set the reading information. - /// - public static class AccessibleUtil - { - - static void AtspiSignalCallback(IntPtr data, string say_signal) - { - GCHandle gch = GCHandle.FromIntPtr(data); - TaskCompletionSource tcs = (TaskCompletionSource) gch.Target; - if (say_signal.Equals("ReadingCancelled")) - { - tcs.SetResult(ReadingStatus.Cancelled); - } - else if (say_signal.Equals("ReadingStopped")) - { - tcs.SetResult(ReadingStatus.Stoppped); - } - else if (say_signal.Equals("ReadingSkipped")) - { - tcs.SetResult(ReadingStatus.Skipped); - } - else - { - tcs.SetException(new InvalidOperationException("unknown signal : " + say_signal)); - } - - gch.Free(); - } - - /// - /// Reads given text by screen reader. - /// - /// The reading text. - /// If true, reading can be discarded by subsequent reading requests, if false the reading must finish before next reading request can be started. - /// Return a task with reading status. - public static Task Say(string text, bool discardable) - { - var tcs = new TaskCompletionSource(); - GCHandle gch = GCHandle.Alloc(tcs); - Interop.Elementary.elm_atspi_bridge_utils_say(text, discardable, AtspiSignalCallback, GCHandle.ToIntPtr(gch)); - return tcs.Task; - } - } -} diff --git a/src/ElmSharp/ElmSharp/AnimatorMotionMapper.cs b/src/ElmSharp/ElmSharp/AnimatorMotionMapper.cs deleted file mode 100644 index defc7af14..000000000 --- a/src/ElmSharp/ElmSharp/AnimatorMotionMapper.cs +++ /dev/null @@ -1,119 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace ElmSharp -{ - public interface AnimatorMotionMapper - { - double Caculate(double position); - } - - public class LinearMotionMapper : AnimatorMotionMapper - { - public double Caculate(double position) - { - return Interop.Ecore.ecore_animator_pos_map(position, Interop.Ecore.PositionMap.Linear, 0, 0); - } - } - - public class AccelerateMotionMapper : AnimatorMotionMapper - { - public double Caculate(double position) - { - return Interop.Ecore.ecore_animator_pos_map(position, Interop.Ecore.PositionMap.Accelerate, 0, 0); - } - } - - public class DecelerateMotionMapper : AnimatorMotionMapper - { - public double Caculate(double position) - { - return Interop.Ecore.ecore_animator_pos_map(position, Interop.Ecore.PositionMap.Decelerate, 0, 0); - } - } - - public class SinusoidalMotionMapper : AnimatorMotionMapper - { - public double Caculate(double position) - { - return Interop.Ecore.ecore_animator_pos_map(position, Interop.Ecore.PositionMap.Sinusoidal, 0, 0); - } - } - - public class AccelerateFactorMotionMapper : AnimatorMotionMapper - { - public double PowerFactor { get; set; } = 0; - - public double Caculate(double position) - { - return Interop.Ecore.ecore_animator_pos_map(position, Interop.Ecore.PositionMap.AccelerateFactor, PowerFactor, 0); - } - } - - public class DecelerateFactorMotionMapper : AnimatorMotionMapper - { - public double PowerFactor { get; set; } = 0; - - public double Caculate(double position) - { - return Interop.Ecore.ecore_animator_pos_map(position, Interop.Ecore.PositionMap.DecelerateFactor, PowerFactor, 0); - } - } - - public class SinusoidalFactorMotionMapper : AnimatorMotionMapper - { - public double PowerFactor { get; set; } = 0; - - public double Caculate(double position) - { - return Interop.Ecore.ecore_animator_pos_map(position, Interop.Ecore.PositionMap.SinusoidalFactor, PowerFactor, 0); - } - } - - public class DivisorInterpolatedMotionMapper : AnimatorMotionMapper - { - public double Divisor { get; set; } = 0; - public double Power { get; set; } = 0; - - public double Caculate(double position) - { - return Interop.Ecore.ecore_animator_pos_map(position, Interop.Ecore.PositionMap.DivisorInterp, Divisor, Power); - } - } - - public class BounceMotionMapper : AnimatorMotionMapper - { - public int Bounces { get; set; } = 0; - public double DecayFactor { get; set; } = 0; - public double Caculate(double position) - { - return Interop.Ecore.ecore_animator_pos_map(position, Interop.Ecore.PositionMap.Bounce, DecayFactor, Bounces); - } - } - - public class SpringMotionMapper : AnimatorMotionMapper - { - public int Wobbles { get; set; } = 0; - public double DecayFactor { get; set; } = 0; - - public double Caculate(double position) - { - return Interop.Ecore.ecore_animator_pos_map(position, Interop.Ecore.PositionMap.Bounce, DecayFactor, Wobbles); - } - } - - public class CubicBezierMotionMapper : AnimatorMotionMapper - { - public double X1 { get; set; } = 0; - public double Y1 { get; set; } = 0; - public double X2 { get; set; } = 0; - public double Y2 { get; set; } = 0; - - public double Caculate(double position) - { - double[] values = { X1, Y1, X2, Y2 }; - return Interop.Ecore.ecore_animator_pos_map_n(position, Interop.Ecore.PositionMap.Bounce, values.Length, values); - } - } -} diff --git a/src/ElmSharp/ElmSharp/Background.cs b/src/ElmSharp/ElmSharp/Background.cs deleted file mode 100644 index e5348b0e0..000000000 --- a/src/ElmSharp/ElmSharp/Background.cs +++ /dev/null @@ -1,158 +0,0 @@ -/* - * 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 ElmSharp -{ - /// - /// The Background is a widget that use for setting (solid) background decorations to a window (unless it has transparency enabled) - /// or to any container object. - /// - public class Background : Layout - { - /// - /// Creates and initializes a new instance of the Background class. - /// - /// The EvasObject to which the new Background will be attached as a child. - public Background(EvasObject parent) : base(parent) - { - Style = "transparent"; - } - - /// - /// Sets or gets color to Background. - /// - public override Color Color - { - get - { - int r = 0; - int g = 0; - int b = 0; - int a = 0; - var swallowContent = GetPartContent("elm.swallow.rectangle"); - if (swallowContent != IntPtr.Zero) - { - Interop.Evas.evas_object_color_get(swallowContent, out r, out g, out b, out a); - } - return new Color(r, g, b, a); - } - set - { - var swallowContent = GetPartContent("elm.swallow.rectangle"); - if (swallowContent == IntPtr.Zero) - { - Interop.Elementary.elm_bg_color_set(RealHandle, value.R, value.G, value.B); - swallowContent = GetPartContent("elm.swallow.rectangle"); - } - Interop.Evas.evas_object_color_set(swallowContent, value.R, value.G, value.B, value.A); - } - } - - /// - /// Sets or gets image to Background. - /// - public string File - { - get - { - return Interop.Elementary.BackgroundFileGet(RealHandle); - } - set - { - Interop.Elementary.elm_bg_file_set(RealHandle, value, IntPtr.Zero); - } - } - - /// - /// Sets or gets the mode of display for a given background widget's image. - /// - /// - /// This sets how the background widget will display its image. - /// This will only work if the File was previously set with an image file on obj. - /// The image can be display tiled, scaled, centered or stretched. scaled by default. - /// - public BackgroundOptions BackgroundOption - { - get - { - return (BackgroundOptions)Interop.Elementary.elm_bg_option_get(RealHandle); - } - set - { - Interop.Elementary.elm_bg_option_set(RealHandle, (Interop.Elementary.BackgroundOptions)value); - } - } - - /// - /// Set the size of the pixmap representation of the image set on a given background widget. - /// This method just makes sense if an image file was set. - /// This is just a hint for the underlying system. - /// The real size of the pixmap may differ depending on the type of image being loaded, being bigger than requested. - /// - /// The new width of the image pixmap representation. - /// The new height of the image pixmap representation. - public void SetFileLoadSize(int w, int h) - { - if (File != null) - { - Interop.Elementary.elm_bg_load_size_set(RealHandle, w, h); - } - else - { - throw new Exception("This method just makes sense if an image file was set."); - } - } - - protected override IntPtr CreateHandle(EvasObject parent) - { - IntPtr handle = Interop.Elementary.elm_layout_add(parent.Handle); - Interop.Elementary.elm_layout_theme_set(handle, "layout", "elm_widget", "default"); - - RealHandle = Interop.Elementary.elm_bg_add(handle); - Interop.Elementary.elm_object_part_content_set(handle, "elm.swallow.content", RealHandle); - - return handle; - } - } - - /// - /// Enumeration for the background type. - /// - public enum BackgroundOptions - { - /// - /// Centers the background image - /// - Center, - - /// - /// Scales the background image, retaining the aspect ratio - /// - Scale, - - /// - /// Stretches the background image to fill the UI component's area. - /// - Stretch, - - /// - /// Tiles the background image at its original size - /// - Tile - } -} \ No newline at end of file diff --git a/src/ElmSharp/ElmSharp/Box.cs b/src/ElmSharp/ElmSharp/Box.cs deleted file mode 100644 index 3436c649e..000000000 --- a/src/ElmSharp/ElmSharp/Box.cs +++ /dev/null @@ -1,239 +0,0 @@ -/* - * 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 ElmSharp -{ - /// - /// The Box is a container used to arranges UI components in a linear order. - /// - public class Box : Container - { - private Interop.Elementary.BoxLayoutCallback _layoutCallback; - - /// - /// Creates and initializes a new instance of the Box class. - /// - /// The EvasObject to which the new Box will be attached as a child. - public Box(EvasObject parent) : base(parent) - { - } - - /// - /// Sets or gets IsHorizontal value which describe pack direction, vertical is default. - /// - public bool IsHorizontal - { - get - { - return Interop.Elementary.elm_box_horizontal_get(RealHandle); - } - set - { - Interop.Elementary.elm_box_horizontal_set(RealHandle, value); - } - } - - /// - /// Sets or gets whether the box to arrange its children homogeneously. - /// - public bool IsHomogeneous - { - get - { - return Interop.Elementary.elm_box_homogeneous_get(RealHandle); - } - set - { - Interop.Elementary.elm_box_homogeneous_set(RealHandle, value); - } - } - - /// - /// Adds an object at the end of the pack list. - /// - /// - /// Packs "content" object into the Box, placing it last in the list of children objects. - /// The actual position the object will get on screen depends on the layout used. - /// If no custom layout is set, it will be at the bottom or right, - /// depending if the Box is vertical or horizontal, respectively. - /// - /// The oject be packed - public void PackEnd(EvasObject content) - { - Interop.Elementary.elm_box_pack_end(RealHandle, content); - AddChild(content); - } - - /// - /// Adds an "content" object to the beginning of the pack list. - /// - /// - /// Pack "content" object into the Box obj, placing it first in the list of children objects. - /// The actual position the object will get on screen depends on the layout used. - /// If no custom layout is set, it will be at the top or left, - /// depending if the Box is vertical or horizontal, respectively. - /// - /// The object to be packed. - public void PackStart(EvasObject content) - { - Interop.Elementary.elm_box_pack_start(RealHandle, content); - AddChild(content); - } - - /// - /// Adds an "content "object to the Box after the "after" object. - /// - /// - /// This will add the "content" to the Box indicated after the object indicated with "after". - /// If "after" is not already in the Box, results are undefined. - /// After means either to the right of the "after" object or below it depending on orientation. - /// - /// The object will be added in Box - /// The object has been added in Box - public void PackAfter(EvasObject content, EvasObject after) - { - Interop.Elementary.elm_box_pack_after(RealHandle, content, after); - AddChild(content); - } - - /// - /// Adds an "content "object to the Box before the "before" object. - /// - /// - /// This will add the "content" to the Box indicated before the object indicated with "before". - /// If "before" is not already in the Box, results are undefined. - /// before means either to the left of the "before" object or below it depending on orientation. - /// - /// The object will be added in Box - /// The object has been added in Box - public void PackBefore(EvasObject content, EvasObject before) - { - Interop.Elementary.elm_box_pack_before(RealHandle, content, before); - AddChild(content); - } - - /// - /// Remove the "content" oject from Box without deleting it. - /// - /// The object to unpack - public void UnPack(EvasObject content) - { - Interop.Elementary.elm_box_unpack(RealHandle, content); - RemoveChild(content); - } - - /// - /// Removes all objects from Box container. - /// - public void UnPackAll() - { - Interop.Elementary.elm_box_unpack_all(RealHandle); - ClearChildren(); - } - - /// - /// Whenever anything changes that requires the Box in obj to recalculate the size and position of its elements, - /// the function cb will be called to determine what the layout of the children will be. - /// - /// The callback function used for layout - public void SetLayoutCallback(Action action) - { - _layoutCallback = (obj, priv, data) => - { - action(); - }; - Interop.Elementary.elm_box_layout_set(RealHandle, _layoutCallback, IntPtr.Zero, null); - } - - /// - /// Sets the color of exact part to Box's layout parent. - /// - /// The name of part class, it could be 'bg', 'elm.swllow.content'. - /// The color value. - public override void SetPartColor(string part, Color color) - { - Interop.Elementary.elm_object_color_class_color_set(Handle, part, color.R * color.A / 255, - color.G * color.A / 255, - color.B * color.A / 255, - color.A); - } - - /// - /// Gets the color of exact part of Box's layout parent. - /// - /// The name of part class, it could be 'bg', 'elm.swllow.content'. - /// - public override Color GetPartColor(string part) - { - int r, g, b, a; - Interop.Elementary.elm_object_color_class_color_get(Handle, part, out r, out g, out b, out a); - return new Color((int)(r / (a / 255.0)), (int)(g / (a / 255.0)), (int)(b / (a / 255.0)), a); - } - - /// - /// Force the box to recalculate its children packing. - /// If any children was added or removed, box will not calculate the values immediately rather leaving it to the next main loop iteration. - /// While this is great as it would save lots of recalculation, whenever you need to get the position of a just added item you must force recalculate before doing so. - /// - public void Recalculate() - { - Interop.Elementary.elm_box_recalculate(RealHandle); - } - - /// - /// Clear the box of all children. - /// Remove all the elements contained by the box, deleting the respective objects. - /// - public void Clear() - { - Interop.Elementary.elm_box_clear(RealHandle); - ClearChildren(); - } - - /// - /// Sets or gets the alignment of the whole bounding box of contents. - /// - /// Horizontal alignment - /// Vertical alignment - public void SetBoxAlignment(double horizontal, double vertical) - { - Interop.Elementary.elm_box_align_set(RealHandle, horizontal, vertical); - } - - /// - /// Sets or gets the space(padding) between the box's elements. - /// - /// Horizontal padding - /// vertical padding - public void SetPadding(int horizontal, int vertical) - { - Interop.Elementary.elm_box_padding_set(RealHandle, horizontal, vertical); - } - - protected override IntPtr CreateHandle(EvasObject parent) - { - IntPtr handle = Interop.Elementary.elm_layout_add(parent.Handle); - Interop.Elementary.elm_layout_theme_set(handle, "layout", "background", "default"); - - RealHandle = Interop.Elementary.elm_box_add(handle); - Interop.Elementary.elm_object_part_content_set(handle, "elm.swallow.content", RealHandle); - - return handle; - } - } -} \ No newline at end of file diff --git a/src/ElmSharp/ElmSharp/Button.cs b/src/ElmSharp/ElmSharp/Button.cs deleted file mode 100755 index 51a1fa79f..000000000 --- a/src/ElmSharp/ElmSharp/Button.cs +++ /dev/null @@ -1,177 +0,0 @@ -/* - * 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 ElmSharp -{ - /// - /// The Button is a widget works as a clickable input element to trigger events. - /// - public class Button : Layout - { - private SmartEvent _clicked; - private SmartEvent _repeated; - private SmartEvent _pressed; - private SmartEvent _released; - - /// - /// Creates and initializes a new instance of the Button class. - /// - /// - /// The EvasObject to which the new Button will be attached as a child. - /// - public Button(EvasObject parent) : base(parent) - { - _clicked = new SmartEvent(this, this.RealHandle, "clicked"); - _repeated = new SmartEvent(this, this.RealHandle, "repeated"); - _pressed = new SmartEvent(this, this.RealHandle, "pressed"); - _released = new SmartEvent(this, this.RealHandle, "unpressed"); - - _clicked.On += (sender, e) => - { - Clicked?.Invoke(this, EventArgs.Empty); - }; - - _repeated.On += (sender, e) => - { - Repeated?.Invoke(this, EventArgs.Empty); - }; - - _pressed.On += (sender, e) => - { - Pressed?.Invoke(this, EventArgs.Empty); - }; - - _released.On += (sender, e) => - { - Released?.Invoke(this, EventArgs.Empty); - }; - } - - /// - /// Clicked will be triggered when Button is clicked. - /// - public event EventHandler Clicked; - - /// - /// Repeated will be triggered when Button is pressed without releasing it. - /// - public event EventHandler Repeated; - - /// - /// Pressed will be triggered when the Button is pressed. - /// - public event EventHandler Pressed; - - /// - /// Released will be triggered when the Button is released after being pressed. - /// - public event EventHandler Released; - - /// - /// Sets or gets the autorepeat feature of a given Button. - /// - /// - /// Autorepeat feature means autorepeat event generated when the button is kept pressed. - /// When set AutoRepeat to false, no autorepeat is performed and buttons will trigger Clicked event when they are clicked. - /// When set to true, keeping a button pressed continuously trigger Repeated event until the button is released. - /// The time it takes until it starts triggering Repeated is given by AutoRepeatInitialTime, - /// and the time between each new emission is given by AutoRepeatGapTimeout. - /// - public bool AutoRepeat - { - get - { - return Interop.Elementary.elm_button_autorepeat_get(RealHandle); - } - set - { - Interop.Elementary.elm_button_autorepeat_set(RealHandle, value); - } - } - - /// - /// Sets or gets the initial timeout before the Repeat event is generated. - /// - public double AutoRepeatInitialTime - { - get - { - return Interop.Elementary.elm_button_autorepeat_initial_timeout_get(RealHandle); - } - set - { - Interop.Elementary.elm_button_autorepeat_initial_timeout_set(RealHandle, value); - } - } - - /// - /// Sets or gets the interval between each generated Repeat event. - /// - public double AutoRepeatGapTimeout - { - get - { - return Interop.Elementary.elm_button_autorepeat_gap_timeout_get(RealHandle); - } - set - { - Interop.Elementary.elm_button_autorepeat_gap_timeout_set(RealHandle, value); - } - } - - [Obsolete("DeleteColorClass is obsolete, please use EdjeObject.DeleteColorClass(string)")] - public void DeleteColorClass(string part) - { - Interop.Elementary.edje_object_color_class_del(Handle, part); - } - - /// - /// Sets or gets the BackgroundColor of a given Button in normal and pressed status. - /// - public override Color BackgroundColor - { - set - { - if (value.IsDefault) - { - EdjeObject.DeleteColorClass("button/bg"); - EdjeObject.DeleteColorClass("button/bg_pressed"); - EdjeObject.DeleteColorClass("button/bg_disabled"); - } - else - { - SetPartColor("bg", value); - SetPartColor("bg_pressed", value); - SetPartColor("bg_disabled", value); - } - _backgroundColor = value; - } - } - - protected override IntPtr CreateHandle(EvasObject parent) - { - IntPtr handle = Interop.Elementary.elm_layout_add(parent.Handle); - Interop.Elementary.elm_layout_theme_set(handle, "layout", "elm_widget", "default"); - - RealHandle = Interop.Elementary.elm_button_add(handle); - Interop.Elementary.elm_object_part_content_set(handle, "elm.swallow.content", RealHandle); - - return handle; - } - } -} \ No newline at end of file diff --git a/src/ElmSharp/ElmSharp/Calendar.cs b/src/ElmSharp/ElmSharp/Calendar.cs deleted file mode 100755 index 01a6c76f6..000000000 --- a/src/ElmSharp/ElmSharp/Calendar.cs +++ /dev/null @@ -1,477 +0,0 @@ -/* - * 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.Collections.Generic; -using System.Linq; -using System.Runtime.InteropServices; - -namespace ElmSharp -{ - /// - /// Enumeration for event periodicity, used to define if a mark should be repeated beyond event's day. It's set when a mark is added. - /// - public enum CalendarMarkRepeatType - { - /// - /// Default value. Marks will be displayed only on event day. - /// - Unique, - - /// - /// Marks will be displayed every day after event day. - /// - Daily, - - /// - /// Marks will be displayed every week after event day. - /// - Weekly, - - /// - /// Marks will be displayed every month day that coincides to event day. - /// - Monthly, - - /// - /// Marks will be displayed every year that coincides to event day. - /// - Annually, - - /// - /// Marks will be displayed every last day of month after event day. - /// - LastDayOfMonth - } - - /// - /// Enumeration for the mode, which determine how user could select a day. - /// - public enum CalendarSelectMode - { - /// - /// Default value. a day is always selected. - /// - Default, - - /// - /// A day is always selected. - /// - Always, - - /// - /// None of the days can be selected. - /// - None, - - /// - /// User may have selected a day or not. - /// - OnDemand - } - - /// - /// Enumeration used to define which fields of a tm struct will be taken into account - /// - [Flags] - public enum CalendarSelectable - { - /// - /// None will be taken into account - /// - None = 0, - /// - /// Year will be taken into account - /// - Year = 1 << 0, - /// - /// Month will be taken into account - /// - Month = 1 << 1, - /// - /// Day will be taken into account - /// - Day = 1 << 2 - } - - /// - /// The CalendarMark is a Item for marking a Calendar's type,date and repeat type. - /// - public class CalendarMark - { - internal IntPtr Handle; - - /// - /// A string used to define the type of mark. - /// - public string Type; - - /// - /// A time struct to represent the date of inclusion of the mark. - /// - public DateTime Date; - - /// - /// Repeat the event following this periodicity. - /// - public CalendarMarkRepeatType Repeat; - - /// - /// Creates and initializes a new instance of the CalendarMark class. - /// - /// Type of mark - /// Date of inclusion of the mark - /// Repeat type - public CalendarMark(string type, DateTime date, CalendarMarkRepeatType repeat) - { - Handle = IntPtr.Zero; - Type = type; - Date = date; - Repeat = repeat; - } - } - - /// - /// The Calendar is a widget that helps applications to flexibly display a calender with day of the week, date, year and month. - /// - public class Calendar : Layout - { - SmartEvent _changed; - DateTime _cacheSelectedDate; - SmartEvent _displayedMonthChanged; - int _cacheDisplayedMonth; - - Interop.Elementary.Elm_Calendar_Format_Cb _calendarFormat; - DateFormatDelegate _dateFormatDelegate = null; - - /// - /// Creates and initializes a new instance of the Calendar class. - /// - /// - /// The EvasObject to which the new Calendar will be attached as a child. - /// - public Calendar(EvasObject parent) : base(parent) - { - _changed = new SmartEvent(this, this.RealHandle, "changed"); - _changed.On += (sender, e) => - { - DateTime selectedDate = SelectedDate; - DateChanged?.Invoke(this, new DateChangedEventArgs(_cacheSelectedDate, selectedDate)); - _cacheSelectedDate = selectedDate; - }; - - _displayedMonthChanged = new SmartEvent(this, this.RealHandle, "display,changed"); - _displayedMonthChanged.On += (sender, e) => - { - int currentDisplayedMonth = DisplayedTime.Month; - DisplayedMonthChanged?.Invoke(this, new DisplayedMonthChangedEventArgs(_cacheDisplayedMonth, currentDisplayedMonth)); - _cacheDisplayedMonth = currentDisplayedMonth; - }; - - _calendarFormat = (t) => { return _dateFormatDelegate(t); }; - } - - /// - /// DateChanged will be triggered when the date in the calendar is changed. - /// - public event EventHandler DateChanged; - - /// - /// DisplayedMonthChanged will be triggered when the current month displayed in the calendar is changed. - /// - public event EventHandler DisplayedMonthChanged; - - /// - /// This delegate type is used to format the string that will be used to display month and year. - /// - /// DateTime - /// - public delegate string DateFormatDelegate(DateTime time); - - /// - /// Sets or gets the minimum for year. - /// - public int MinimumYear - { - get - { - int minimumYear; - int unused; - Interop.Elementary.elm_calendar_min_max_year_get(RealHandle, out minimumYear, out unused); - return minimumYear; - } - set - { - int maximumYear; - int unused; - Interop.Elementary.elm_calendar_min_max_year_get(RealHandle, out unused, out maximumYear); - if (maximumYear < 1902) - { - maximumYear = DateTime.MaxValue.Year; - } - Interop.Elementary.elm_calendar_min_max_year_set(RealHandle, value, maximumYear); - } - } - - /// - /// Sets or gets the maximum for the year. - /// - public int MaximumYear - { - get - { - int maximumYear; - int unused; - Interop.Elementary.elm_calendar_min_max_year_get(RealHandle, out unused, out maximumYear); - return maximumYear; - } - set - { - int minimumYear; - int unused; - Interop.Elementary.elm_calendar_min_max_year_get(RealHandle, out minimumYear, out unused); - Interop.Elementary.elm_calendar_min_max_year_set(RealHandle, minimumYear, value); - } - } - - /// - /// Sets or gets the first day of week, who are used on Calendar. - /// - public DateTime DisplayedTime - { - get - { - var tm = new Interop.Libc.SystemTime(); - Interop.Elementary.elm_calendar_displayed_time_get(RealHandle, out tm); - ///TODO - ///If the defect is fixed, it will be removed. - var daysInMonth = DateTime.DaysInMonth(tm.tm_year + 1900, tm.tm_mon + 1); - var day = tm.tm_mday; - - if (day > daysInMonth) - { - day = daysInMonth; - } - - DateTime date = new DateTime(tm.tm_year + 1900, tm.tm_mon + 1, day, tm.tm_hour, tm.tm_min, tm.tm_sec); - - return date; - } - } - - /// - /// Sets or gets the first day of week, who are used on Calendar. - /// - public DayOfWeek FirstDayOfWeek - { - get - { - return (DayOfWeek)Interop.Elementary.elm_calendar_first_day_of_week_get(RealHandle); - } - set - { - Interop.Elementary.elm_calendar_first_day_of_week_set(RealHandle, (int)value); - } - } - - /// - /// Sets or gets the weekdays names to be displayed by the Calendar. - /// - /// - /// The usage should be like this; - /// List weekDayNames = new List() { "S", "M", "T", "W", "T", "F", "S" }; - /// Calendar.WeekDayNames = weekDayNames; - /// - public IReadOnlyList WeekDayNames - { - get - { - IntPtr stringArrayPtr = Interop.Elementary.elm_calendar_weekdays_names_get(RealHandle); - string[] stringArray; - IntPtrToStringArray(stringArrayPtr, 7, out stringArray); - return stringArray; - } - set - { - if (value != null && value.Count == 7) - { - Interop.Elementary.elm_calendar_weekdays_names_set(RealHandle, value.ToArray()); - } - } - } - - /// - /// Sets or gets the selected date. - /// - /// - /// Selected date changes when the user goes to next/previous month or select a day pressing over it on calendar. - /// - public DateTime SelectedDate - { - get - { - var tm = new Interop.Libc.SystemTime(); - Interop.Elementary.elm_calendar_selected_time_get(RealHandle, ref tm); - if (tm.tm_year == 0 && tm.tm_mon == 0 && tm.tm_mday == 0) - { - return DateTime.Now; - } - return tm; - } - set - { - Interop.Libc.SystemTime tm = value; - Interop.Elementary.elm_calendar_selected_time_set(RealHandle, ref tm); - _cacheSelectedDate = value; - } - } - - /// - /// Sets or gets the interval on time updates for an user mouse button - /// hold on calendar widgets' month/year selection. - /// - public double Interval - { - get - { - return Interop.Elementary.elm_calendar_interval_get(RealHandle); - } - set - { - Interop.Elementary.elm_calendar_interval_set(RealHandle, value); - } - } - - /// - /// Gets or sets the select day mode used. - /// - public CalendarSelectMode SelectMode - { - get - { - return (CalendarSelectMode)Interop.Elementary.elm_calendar_select_mode_get(RealHandle); - } - set - { - Interop.Elementary.elm_calendar_select_mode_set(RealHandle, (Interop.Elementary.Elm_Calendar_Select_Mode)value); - } - } - - /// - /// Gets or sets fields of a datetime will be taken into account, when SelectedDate set is invoked. - /// - public CalendarSelectable Selectable - { - get - { - return (CalendarSelectable)Interop.Elementary.elm_calendar_selectable_get(RealHandle); - } - set - { - Interop.Elementary.elm_calendar_selectable_set(RealHandle, (int)value); - } - } - - /// - /// Gets or sets date format the string that will be used to display month and year. - /// - public DateFormatDelegate DateFormat - { - get - { - return _dateFormatDelegate; - } - set - { - _dateFormatDelegate = value; - if (value != null) - { - Interop.Elementary.elm_calendar_format_function_set(RealHandle, _calendarFormat); - } - else - { - Interop.Elementary.elm_calendar_format_function_set(RealHandle, null); - } - } - } - - /// - /// Add a new mark to the calendar. - /// - /// A string used to define the type of mark. It will be emitted to the theme, that should display a related modification on these days representation. - /// A time struct to represent the date of inclusion of the mark. For marks that repeats it will just be displayed after the inclusion date in the calendar. - /// Repeat the event following this periodicity. Can be a unique mark (that don't repeat), daily, weekly, monthly or annually. - /// Item for a calendar mark. - public CalendarMark AddMark(string type, DateTime date, CalendarMarkRepeatType repeat) - { - CalendarMark mark = new CalendarMark(type, date, repeat); - Interop.Libc.SystemTime tm = date; - IntPtr nativeHandle = Interop.Elementary.elm_calendar_mark_add(RealHandle, type, ref tm, (Interop.Elementary.Elm_Calendar_Mark_Repeat_Type)repeat); - mark.Handle = nativeHandle; - - return mark; - } - - /// - /// Delete mark from the calendar. - /// - /// Item for a calendar mark - public void DeleteMark(CalendarMark mark) - { - Interop.Elementary.elm_calendar_mark_del(mark.Handle); - } - - /// - /// Draw calendar marks. - /// - public void DrawMarks() - { - Interop.Elementary.elm_calendar_marks_draw(RealHandle); - } - - /// - /// Remove all calendar's marks. - /// - public void ClearMarks() - { - Interop.Elementary.elm_calendar_marks_clear(RealHandle); - } - - protected override IntPtr CreateHandle(EvasObject parent) - { - IntPtr handle = Interop.Elementary.elm_layout_add(parent.Handle); - Interop.Elementary.elm_layout_theme_set(handle, "layout", "elm_widget", "default"); - - RealHandle = Interop.Elementary.elm_calendar_add(handle); - Interop.Elementary.elm_object_part_content_set(handle, "elm.swallow.content", RealHandle); - - return handle; - } - - static void IntPtrToStringArray(IntPtr unmanagedArray, int size, out string[] managedArray) - { - managedArray = new string[size]; - IntPtr[] IntPtrArray = new IntPtr[size]; - - Marshal.Copy(unmanagedArray, IntPtrArray, 0, size); - - for (int iterator = 0; iterator < size; iterator++) - { - managedArray[iterator] = Marshal.PtrToStringAnsi(IntPtrArray[iterator]); - } - } - } -} \ No newline at end of file diff --git a/src/ElmSharp/ElmSharp/Check.cs b/src/ElmSharp/ElmSharp/Check.cs deleted file mode 100755 index ae153d826..000000000 --- a/src/ElmSharp/ElmSharp/Check.cs +++ /dev/null @@ -1,79 +0,0 @@ -/* - * 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 ElmSharp -{ - /// - /// The check is a widget allows for toggling a value between true and false. - /// - public class Check : Layout - { - private SmartEvent _changed; - private bool _currentState; - - /// - /// Creates and initializes a new instance of the Check class. - /// - /// - /// The EvasObject to which the new Check will be attached as a child. - /// - public Check(EvasObject parent) : base(parent) - { - _changed = new SmartEvent(this, this.RealHandle, "changed"); - _changed.On += (sender, e) => - { - StateChanged?.Invoke(this, new CheckStateChangedEventArgs(_currentState, IsChecked)); - }; - } - - /// - /// StateChanged will be triggered when the IsChecked in the Check is changed. - /// - public event EventHandler StateChanged; - - /// - /// Sets or gets whether the given Check is checked or not. - /// - /// - /// When object is checked, the value will set to true, Conversely will set to false. - /// - public bool IsChecked - { - get - { - _currentState = Interop.Elementary.elm_check_state_get(RealHandle); - return _currentState; - } - set - { - Interop.Elementary.elm_check_state_set(RealHandle, value); - } - } - - protected override IntPtr CreateHandle(EvasObject parent) - { - IntPtr handle = Interop.Elementary.elm_layout_add(parent.Handle); - Interop.Elementary.elm_layout_theme_set(handle, "layout", "elm_widget", "default"); - - RealHandle = Interop.Elementary.elm_check_add(handle); - Interop.Elementary.elm_object_part_content_set(handle, "elm.swallow.content", RealHandle); - - return handle; - } - } -} diff --git a/src/ElmSharp/ElmSharp/CheckStateChangedEventArgs.cs b/src/ElmSharp/ElmSharp/CheckStateChangedEventArgs.cs deleted file mode 100755 index 461798fe0..000000000 --- a/src/ElmSharp/ElmSharp/CheckStateChangedEventArgs.cs +++ /dev/null @@ -1,49 +0,0 @@ -/* - * 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 ElmSharp -{ - /// - /// It inherits System.EventArgs. - /// The CheckStateChangedEventArgs is EventArgs to record Check's state. - /// Include old state and new state. - /// - public class CheckStateChangedEventArgs : EventArgs - { - /// - /// Gets the OldState property.The return type is bool. - /// - public bool OldState { get; private set; } - - /// - /// Gets the NewState property.The return type is bool. - /// - public bool NewState { get; private set; } - - /// - /// Creates and initializes a new instance of the CheckStateChangedEventArgs class. - /// - /// Old state of Check which to use this CheckStateChangedEventArgs. - /// New state of Check which to use this CheckStateChangedEventArgs. - public CheckStateChangedEventArgs(bool oldState, bool newState) - { - this.OldState = oldState; - this.NewState = newState; - } - } -} diff --git a/src/ElmSharp/ElmSharp/Color.cs b/src/ElmSharp/ElmSharp/Color.cs deleted file mode 100644 index 9b27f0ff3..000000000 --- a/src/ElmSharp/ElmSharp/Color.cs +++ /dev/null @@ -1,339 +0,0 @@ -/* - * 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.Globalization; - -namespace ElmSharp -{ - /// - /// The Color is a struct to record Check's state. - /// - public struct Color - { - readonly int _a; - readonly int _r; - readonly int _g; - readonly int _b; - - readonly Mode _mode; - - enum Mode - { - Default, - Rgb - } - - /// - /// Gets a default Color instance. - /// - /// - /// In default Color instance,Mode type is Default,RGBA all set as -1. - /// - public static Color Default - { - get { return new Color(-1, -1, -1, -1, Mode.Default); } - } - - /// - /// Gets whether the Color instance's mode is default or not. - /// Return type is bool. - /// - public bool IsDefault - { - get { return _mode == Mode.Default; } - } - - /// - /// Gets A value of RGBA. - /// A means the Alpha in color. - /// - public int A - { - get { return _a; } - } - - /// - /// Gets R value of RGBA. - /// R means the Red in color. - /// - public int R - { - get { return _r; } - } - - /// - /// Gets G value of RGBA. - /// G means the Green in color. - /// - public int G - { - get { return _g; } - } - - /// - /// Gets B value of RGBA. - /// B means the Blue in color. - /// - public int B - { - get { return _b; } - } - - /// - /// Creates and initializes a new instance of the Color class. - /// With RGB parameters. - /// - /// Red of RGB - /// Green of RGB - /// Blue of RGB - public Color(int r, int g, int b) : this(r, g, b, 255) - { - } - - /// - /// Creates and initializes a new instance of the Color class. - /// With RGBA parameters. - /// - /// Red of RGBA - /// Green of RGBA< - /// Blue of RGBA< - /// Alpha of RGBA< - public Color(int r, int g, int b, int a) : this(r, g, b, a, Mode.Rgb) - { - } - - Color(int r, int g, int b, int a, Mode mode) - { - _mode = mode; - if (mode == Mode.Rgb) - { - _r = Clamp(r, 0, 255); - _g = Clamp(g, 0, 255); - _b = Clamp(b, 0, 255); - _a = Clamp(a, 0, 255); - } - else // Default - { - _r = _g = _b = _a = -1; - } - } - - public override int GetHashCode() - { - int hashcode = _r.GetHashCode(); - hashcode = (hashcode * 397) ^ _g.GetHashCode(); - hashcode = (hashcode * 397) ^ _b.GetHashCode(); - hashcode = (hashcode * 397) ^ _a.GetHashCode(); - return hashcode; - } - - public override bool Equals(object obj) - { - if (obj is Color) - { - return EqualsInner(this, (Color)obj); - } - return base.Equals(obj); - } - - /// - /// Compare whether two Color instance is same or not. - /// - /// A Color instance. - /// A Color instance. - /// The result whether two instance is same or not. - /// Return type is bool.If they are same, return true. - /// - public static bool operator ==(Color a, Color b) - { - if (ReferenceEquals(a, b)) - return true; - - if ((object)a == null || (object)b == null) - return false; - - return EqualsInner(a, b); - } - - /// - /// Compare whether two Color instance is different or not. - /// - /// A Color instance. - /// A Color instance. - /// The result whether two instance is different or not. - /// Return type is bool.If they are different, return true. - /// - public static bool operator !=(Color a, Color b) - { - return !(a == b); - } - - static bool EqualsInner(Color color1, Color color2) - { - if (color1._mode == Mode.Default && color2._mode == Mode.Default) - return true; - return color1._r == color2._r && color1._g == color2._g && color1._b == color2._b && color1._a == color2._a; - } - - public override string ToString() - { - return string.Format(CultureInfo.InvariantCulture, "[Color: R={0}, G={1}, B={2}, A={3}]", R, G, B, A); - } - - /// - /// Gets a Color instance with a hexadecimal string parameter. - /// - /// Hexadecimal string. - /// New instance of Color struct. - public static Color FromHex(string hex) - { - hex = hex.Replace("#", ""); - switch (hex.Length) - { - case 3: //#rgb => ffrrggbb - hex = string.Format("ff{0}{1}{2}{3}{4}{5}", hex[0], hex[0], hex[1], hex[1], hex[2], hex[2]); - break; - case 4: //#argb => aarrggbb - hex = string.Format("{0}{1}{2}{3}{4}{5}{6}{7}", hex[0], hex[0], hex[1], hex[1], hex[2], hex[2], hex[3], hex[3]); - break; - case 6: //#rrggbb => ffrrggbb - hex = string.Format("ff{0}", hex); - break; - } - return FromUint(Convert.ToUInt32(hex.Replace("#", ""), 16)); - } - - /// - /// Gets a Color instance with a Unsigned integer parameter. - /// - /// Unsigned integer indicates RGBA. - /// New instance of Color struct. - public static Color FromUint(uint argb) - { - return FromRgba((byte)((argb & 0x00ff0000) >> 0x10), (byte)((argb & 0x0000ff00) >> 0x8), (byte)(argb & 0x000000ff), (byte)((argb & 0xff000000) >> 0x18)); - } - - /// - /// Gets a Color instance with R,G,B,A parameters. - /// - /// Red in RGBA. - /// Green in RGBA. - /// Blue in RGBA. - /// Alpha in RGBA. - /// New instance of Color struct. - public static Color FromRgba(int r, int g, int b, int a) - { - return new Color(r, g, b, a); - } - - /// - /// Gets a Color instance with R,G,B,A parameters. - /// - /// Red in RGB. - /// Green in RGB. - /// Blue in RGB. - /// New instance of Color struct. - public static Color FromRgb(int r, int g, int b) - { - return FromRgba(r, g, b, 255); - } - - internal static int Clamp(int self, int min, int max) - { - return Math.Min(max, Math.Max(self, min)); - } - - #region Color Definitions - /// - /// The Tansparent is a predefined Color, it's rgba value is (0, 0, 0, 0). - /// - public static readonly Color Transparent = FromRgba(0, 0, 0, 0); - /// - /// The Aqua is a predefined Color instance, it's rgb value is (0, 255, 255). - /// - public static readonly Color Aqua = FromRgb(0, 255, 255); - /// - /// The Black is a predefined Color instance, it's rgb value is (0, 0, 0). - /// - public static readonly Color Black = FromRgb(0, 0, 0); - /// - /// The Blue is a predefined Color instance, it's rgb value is (0, 0, 255). - /// - public static readonly Color Blue = FromRgb(0, 0, 255); - /// - /// The Fuchsia is a predefined Color instance, it's rgb value is (255, 0, 255). - /// - public static readonly Color Fuchsia = FromRgb(255, 0, 255); - /// - /// The Gray is a predefined Color instance, it's rgb value is (128, 128, 128). - /// - public static readonly Color Gray = FromRgb(128, 128, 128); - /// - /// The Green is a predefined Color instance, it's rgb value is (0, 128, 0). - /// - public static readonly Color Green = FromRgb(0, 128, 0); - /// - /// The Lime is a predefined Color instance, it's rgb value is (0, 255, 0). - /// - public static readonly Color Lime = FromRgb(0, 255, 0); - /// - /// The Maroon is a predefined Color instance, it's rgb value is (128, 0, 0). - /// - public static readonly Color Maroon = FromRgb(128, 0, 0); - /// - /// The Navy is a predefined Color instance, it's rgb value is (0, 0, 128). - /// - public static readonly Color Navy = FromRgb(0, 0, 128); - /// - /// The Olive is a predefined Color instance, it's rgb value is (128, 128, 0). - /// - public static readonly Color Olive = FromRgb(128, 128, 0); - /// - /// The Orange is a predefined Color instance, it's rgb value is (255, 165, 0). - /// - public static readonly Color Orange = FromRgb(255, 165, 0); - /// - /// The Purple is a predefined Color instance, it's rgb value is (128, 0, 128). - /// - public static readonly Color Purple = FromRgb(128, 0, 128); - /// - /// The Pink is a predefined Color instance, it's rgb value is (255, 102, 255). - /// - public static readonly Color Pink = FromRgb(255, 102, 255); - /// - /// The Red is a predefined Color instance, it's rgb value is (255, 0, 0). - /// - public static readonly Color Red = FromRgb(255, 0, 0); - /// - /// The Silver is a predefined Color instance, it's rgb value is (192, 192, 192). - /// - public static readonly Color Silver = FromRgb(192, 192, 192); - /// - /// The Teal is a predefined Color instance, it's rgb value is (0, 128, 128). - /// - public static readonly Color Teal = FromRgb(0, 128, 128); - /// - /// The White is a predefined Color instance, it's rgb value is (255, 255, 255). - /// - public static readonly Color White = FromRgb(255, 255, 255); - /// - /// The Yellow is a predefined Color instance, it's rgb value is (255, 255, 0). - /// - public static readonly Color Yellow = FromRgb(255, 255, 0); - #endregion - } -} diff --git a/src/ElmSharp/ElmSharp/ColorChangedEventArgs.cs b/src/ElmSharp/ElmSharp/ColorChangedEventArgs.cs deleted file mode 100755 index b1090de8c..000000000 --- a/src/ElmSharp/ElmSharp/ColorChangedEventArgs.cs +++ /dev/null @@ -1,49 +0,0 @@ -/* - * 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 ElmSharp -{ - /// - /// It inherits System.EventArgs. - /// Event ColorChanged of ColorSelector contain ColorChangedEventArgs as a parameter. - /// Refer to type. - /// - public class ColorChangedEventArgs : EventArgs - { - /// - /// Gets old color in color changed event. - /// - public Color OldColor { get; private set; } - - /// - /// Gets new color in color changed event. - /// - public Color NewColor { get; private set; } - - /// - /// Creates and initializes a new instance of the ColorChangedEventArgs class. - /// - /// old color - /// new color - public ColorChangedEventArgs(Color oldColor, Color newColor) - { - this.OldColor = oldColor; - this.NewColor = newColor; - } - } -} diff --git a/src/ElmSharp/ElmSharp/ColorSelector.cs b/src/ElmSharp/ElmSharp/ColorSelector.cs deleted file mode 100755 index cf16a993c..000000000 --- a/src/ElmSharp/ElmSharp/ColorSelector.cs +++ /dev/null @@ -1,190 +0,0 @@ -/* - * 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 ElmSharp -{ - /// - /// Enumeration for mode of ColorSelector - /// - public enum ColorSelectorMode - { - /// - /// Only color palette is displayed, default - /// - Palette, - /// - /// Only color selector is displayed - /// - [Obsolete("Components is obsolete as of version 1.2.3 and is no longer supported.")] - Components, - /// - /// Both Palette and selector is displayed - /// - [Obsolete("Both is obsolete as of version 1.2.3 and is no longer supported.")] - Both, - /// - /// Only color picker is displayed - /// - [Obsolete("Picker is obsolete as of version 1.2.3 and is no longer supported.")] - Picker, - /// - /// This mode is not supported. If you use this, nothing will be shown - /// - [Obsolete("Plane is obsolete as of version 1.2.3 and is no longer supported.")] - Plane, - /// - /// This mode is not supported. If you use this, it will be shown same with Palette mode - /// - [Obsolete("PallettePlane is obsolete as of version 1.2.3 and is no longer supported.")] - PallettePlane, - /// - /// This mode is not supported. If you use this, it will be shown same with Palette mode - /// - [Obsolete("All is obsolete as of version 1.2.3 and is no longer supported.")] - All - } - - /// - /// The ColorSelector is a widget to set a series of colors. - /// It also allows to load/save colors from/to config with a unique identifier. - /// - /// - /// By default, the colors are loaded/saved from/to config using "default" identifier. - /// The colors can be picked by user from the color set by clicking on individual - /// color item on the palette or by selecting it from selector. - /// - public class ColorSelector : Layout - { - private readonly SmartEvent _changed; - private Color _currentColor; - - /// - /// Creates and initializes a new instance of the ColorSelector class. - /// - /// - public ColorSelector(EvasObject parent) : base(parent) - { - _changed = new SmartEvent(this, "changed", (data, obj, info) => - { - return new ColorChangedEventArgs(_currentColor, SelectedColor); - }); - } - - /// - /// ColorChanged will be triggered when the SelectedColor changed. - /// - public event EventHandler ColorChanged - { - add { _changed.On += value; } - remove { _changed.On -= value; } - } - - /// - /// Gets or sets color of colorselector. - /// - public Color SelectedColor - { - get - { - int r, g, b, a; - Interop.Elementary.elm_colorselector_color_get(Handle, out r, out g, out b, out a); - _currentColor = new Color(r, g, b, a); - return _currentColor; - } - set - { - Interop.Elementary.elm_colorselector_color_set(Handle, value.R, value.G, value.B, value.A); - _currentColor = new Color(value.R, value.G, value.B, value.A); - } - } - - /// - /// Gets Alpha of a default Color Class(Value is -1). - /// - public override int Opacity - { - get - { - return Color.Default.A; - } - - set - { - Console.WriteLine("ColorSelector instance doesn't support to set Opacity."); - } - } - - /// - /// Gets or sets Colorselector's mode. - /// - public ColorSelectorMode Mode - { - get - { - return (ColorSelectorMode)Interop.Elementary.elm_colorselector_mode_get(Handle); - } - set - { - if (ColorSelectorMode.Palette == value) - { - Interop.Elementary.elm_colorselector_mode_set(Handle, (Interop.Elementary.Elm_Colorselector_Mode)value); - } - } - } - - /// - /// Get or set current palette's name. - /// - public string PaletteName - { - get - { - return Interop.Elementary.elm_colorselector_palette_name_get(Handle); - } - set - { - Interop.Elementary.elm_colorselector_palette_name_set(Handle, value); - } - } - - /// - /// Adds a new color item to palette. - /// - /// Color item to add - /// A new color palette Item. - public ColorSelectorItem AddPaletteColor(Color color) - { - ColorSelectorItem item = new ColorSelectorItem(); - item.Handle = Interop.Elementary.elm_colorselector_palette_color_add(Handle, color.R, color.G, color.B, color.A); - return item; - } - - /// - /// Clear the palette items. - /// - public void ClearPalette() - { - Interop.Elementary.elm_colorselector_palette_clear(Handle); - } - - protected override IntPtr CreateHandle(EvasObject parent) - { - return Interop.Elementary.elm_colorselector_add(parent.Handle); - } - } -} diff --git a/src/ElmSharp/ElmSharp/ColorSelectorItem.cs b/src/ElmSharp/ElmSharp/ColorSelectorItem.cs deleted file mode 100755 index 10205e2ab..000000000 --- a/src/ElmSharp/ElmSharp/ColorSelectorItem.cs +++ /dev/null @@ -1,50 +0,0 @@ -/* - * 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 ElmSharp -{ - /// - /// A instance to the ColorSelector item added. - /// - public class ColorSelectorItem : ItemObject - { - internal ColorSelectorItem() : base(IntPtr.Zero) - { - } - - /// - /// Gets or sets the Palette item's color - /// - public Color Color - { - get - { - int r, g, b, a; - Interop.Elementary.elm_colorselector_palette_item_color_get(Handle, out r, out g, out b, out a); - return Color.FromRgba(r, g, b, a); - } - set - { - if (Handle != IntPtr.Zero) - { - Interop.Elementary.elm_colorselector_palette_item_color_set(Handle, value.R, value.G, value.B, value.A); - } - } - } - } -} diff --git a/src/ElmSharp/ElmSharp/Conformant.cs b/src/ElmSharp/ElmSharp/Conformant.cs deleted file mode 100755 index 84da0e377..000000000 --- a/src/ElmSharp/ElmSharp/Conformant.cs +++ /dev/null @@ -1,45 +0,0 @@ -/* - * 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 ElmSharp -{ - /// - /// The check is a widget that can be used in elementary apps - /// to account for space taken up by the indicator, - /// virtual keypad & softkey windows when running the illume2 module of E17. - /// - public class Conformant : Widget - { - /// - /// Creates and initializes a new instance of the Conformant class. - /// - /// The parent is a given container which will be attached by Conformant - /// as a child.It's type. - public Conformant(Window parent) : base(parent) - { - Interop.Evas.evas_object_size_hint_weight_set(Handle, 1.0, 1.0); - Interop.Elementary.elm_win_conformant_set(parent.Handle, true); - parent.AddResizeObject(this); - } - - protected override IntPtr CreateHandle(EvasObject parent) - { - return Interop.Elementary.elm_conformant_add(parent.Handle); - } - } -} diff --git a/src/ElmSharp/ElmSharp/Container.cs b/src/ElmSharp/ElmSharp/Container.cs deleted file mode 100755 index 6abb589d2..000000000 --- a/src/ElmSharp/ElmSharp/Container.cs +++ /dev/null @@ -1,83 +0,0 @@ -/* - * 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.Collections.Generic; - -namespace ElmSharp -{ - /// - /// It inherits . - /// The Container is a abstract class. - /// Other class inherits it to Elementary is about displaying - /// its widgets in a nice layout. - /// - public abstract class Container : Widget - { - HashSet _children = new HashSet(); - - /// - /// Creates and initializes a new instance of class which inherit from Container. - /// - /// The parent is a given object which will be attached by Container - /// as a child.It's type. - public Container(EvasObject parent) : base(parent) - { - } - - /// - /// Sets the background color of a given Container. - /// - public override Color BackgroundColor - { - set - { - if (value.IsDefault) - { - SetPartColor("bg", Color.Transparent); - } - else - { - SetPartColor("bg", value); - } - _backgroundColor = value; - } - } - - protected IEnumerable Children => _children; - - protected void AddChild(EvasObject obj) - { - _children.Add(obj); - obj.Deleted += OnChildDeleted; - } - - protected void RemoveChild(EvasObject obj) - { - _children.Remove(obj); - } - - protected void ClearChildren() - { - _children.Clear(); - } - - void OnChildDeleted(object sender, EventArgs a) - { - _children.Remove((EvasObject)sender); - } - } -} diff --git a/src/ElmSharp/ElmSharp/ContextPopup.cs b/src/ElmSharp/ElmSharp/ContextPopup.cs deleted file mode 100755 index 3be2baa55..000000000 --- a/src/ElmSharp/ElmSharp/ContextPopup.cs +++ /dev/null @@ -1,250 +0,0 @@ -/* - * 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.Collections.Generic; - -namespace ElmSharp -{ - /// - /// Enumeration of ContextPopup direction type. - /// - public enum ContextPopupDirection - { - /// - /// ContextPopup show appear below clicked area - /// /// - Down, - /// - /// ContextPopup show appear to the right of the clicked area - /// - Right, - /// - /// ContextPopup show appear to the left of the clicked area - /// - Left, - /// - /// ContextPopup show appear above the clicked area - /// - Up, - /// - /// ContextPopup does not determine it's direction yet - /// - Unknown - } - - /// - /// It inherits . - /// The ContextPopup is a widget that when it shown, pops up a list of items. - /// - public class ContextPopup : Layout - { - HashSet _children = new HashSet(); - SmartEvent _dismissed; - Interop.Evas.SmartCallback _onSelected; - - /// - /// Creates and initializes a new instance of the ContextPopup class. - /// - /// The parent is a given container which will be attached by ContextPopup - /// as a child.It's type. - public ContextPopup(EvasObject parent) : base(parent) - { - _dismissed = new SmartEvent(this, this.RealHandle, "dismissed"); - _dismissed.On += (sender, e) => - { - Dismissed?.Invoke(this, EventArgs.Empty); - }; - _onSelected = (data, obj, info) => - { - ContextPopupItem item = ItemObject.GetItemById((int)data) as ContextPopupItem; - item?.SendSelected(); - }; - } - - /// - /// Dismissed is raised when the ContextPopup item is dismissed. - /// - /// - /// Outside of ContextPopup was clicked or it's parent area is changed or the language is changed. and then ContextPopup is dismissed. - /// - public event EventHandler Dismissed; - - /// - /// Gets the current direction of a ContextPopup. - /// - /// - /// Once the ContextPopup showed up, the direction would be determined. - /// - public ContextPopupDirection Direction - { - get - { - return (ContextPopupDirection)Interop.Elementary.elm_ctxpopup_direction_get(RealHandle); - } - } - - /// - /// Gets or sets the value of current ContextPopup object's orientation. - /// True for horizontal mode, False for vertical mode (or errors) - /// - public bool IsHorizontal - { - get - { - return Interop.Elementary.elm_ctxpopup_horizontal_get(RealHandle); - } - set - { - Interop.Elementary.elm_ctxpopup_horizontal_set(RealHandle, value); - } - } - - /// - /// Gets or sets whether ContextPopup hide automatically - /// or not when parent of ContextPopup is resized. - /// - /// - /// Default value of AutoHide is False. - /// - public bool AutoHide - { - get - { - return !Interop.Elementary.elm_ctxpopup_auto_hide_disabled_get(RealHandle); - } - set - { - Interop.Elementary.elm_ctxpopup_auto_hide_disabled_set(RealHandle, !value); - } - } - - /// - /// Clears all items in the given ContextPopup object. - /// - public void Clear() - { - Interop.Elementary.elm_ctxpopup_clear(Handle); - } - - /// - /// Sets the direction priority of a ContextPopup. - /// - /// 1st priority of direction - /// 2nd priority of direction - /// 3th priority of direction - /// 4th priority of direction - public void SetDirectionPriorty(ContextPopupDirection first, ContextPopupDirection second, ContextPopupDirection third, ContextPopupDirection fourth) - { - Interop.Elementary.elm_ctxpopup_direction_priority_set(RealHandle, (int)first, (int)second, (int)third, (int)fourth); - } - - /// - /// Gets the direction priority of a ContextPopup. - /// - /// 1st priority of direction to be returned - /// 2nd priority of direction to be returned - /// 2nd priority of direction to be returned - /// 4th priority of direction to be returned - public void GetDirectionPriority(out ContextPopupDirection first, out ContextPopupDirection second, out ContextPopupDirection third, out ContextPopupDirection fourth) - { - int firstOut, secondOut, thirdOut, fourthOut; - Interop.Elementary.elm_ctxpopup_direction_priority_get(Handle, out firstOut, out secondOut, out thirdOut, out fourthOut); - first = (ContextPopupDirection)firstOut; - second = (ContextPopupDirection)secondOut; - third = (ContextPopupDirection)thirdOut; - fourth = (ContextPopupDirection)fourthOut; - } - - /// - /// Adds a new item to a ContextPopup object with label. - /// - /// The Label of the new item - /// - /// A ContextPopupItem added or NULL, on errors - /// - public ContextPopupItem Append(string label) - { - return Append(label, null); - } - - /// - /// Adds a new item to a ContextPopup object with label and icon. - /// - /// The Label of the new item - /// Icon to be set on new item - /// A ContextPopupItem added or NULL, on errors - public ContextPopupItem Append(string label, EvasObject icon) - { - ContextPopupItem item = new ContextPopupItem(label, icon); - item.Handle = Interop.Elementary.elm_ctxpopup_item_append(RealHandle, label, icon, _onSelected, (IntPtr)item.Id); - AddInternal(item); - return item; - } - - /// - /// Dismiss a ContextPopup object. The ContextPopup will be hidden and the "clicked" signal will be emitted. - /// - public void Dismiss() - { - Interop.Elementary.elm_ctxpopup_dismiss(RealHandle); - } - - /// - /// Gets the possibility that the direction would be available - /// - /// A direction user wants to check - /// - /// Get false if you cannot put it in the direction. Gets true if it's possible. - /// - public bool IsAvailableDirection(ContextPopupDirection direction) - { - return Interop.Elementary.elm_ctxpopup_direction_available_get(RealHandle, (int)direction); - } - - /// - /// Gets Alpha of a default Color Class. - /// - public override int Opacity - { - get - { - return Color.Default.A; - } - - set - { - Console.WriteLine("ContextPopup instance doesn't support to set Opacity."); - } - } - - protected override IntPtr CreateHandle(EvasObject parent) - { - return Interop.Elementary.elm_ctxpopup_add(parent.Handle); - } - - void AddInternal(ContextPopupItem item) - { - _children.Add(item); - item.Deleted += Item_Deleted; - } - - void Item_Deleted(object sender, EventArgs e) - { - _children.Remove((ContextPopupItem)sender); - } - } -} diff --git a/src/ElmSharp/ElmSharp/ContextPopupItem.cs b/src/ElmSharp/ElmSharp/ContextPopupItem.cs deleted file mode 100755 index 35c908bc8..000000000 --- a/src/ElmSharp/ElmSharp/ContextPopupItem.cs +++ /dev/null @@ -1,53 +0,0 @@ -/* - * 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 ElmSharp -{ - /// - /// It inherits . - /// A instance to the ContextPopup item added. - /// - public class ContextPopupItem : ItemObject - { - internal ContextPopupItem(string text, EvasObject icon) : base(IntPtr.Zero) - { - Text = text; - Icon = icon; - } - - /// - /// Gets the Text property of the given ContextPopupItem. - /// - public string Text { get; internal set; } - - /// - /// Gets the Icon(type is ) property of the given ContextPopupItem. - /// - public EvasObject Icon { get; internal set; } - - /// - /// Selected will be triggered when the ContextPopupItem is Selected. - /// - public event EventHandler Selected; - - internal void SendSelected() - { - Selected?.Invoke(this, EventArgs.Empty); - } - } -} diff --git a/src/ElmSharp/ElmSharp/DateChangedEventArgs.cs b/src/ElmSharp/ElmSharp/DateChangedEventArgs.cs deleted file mode 100755 index 25d622cc7..000000000 --- a/src/ElmSharp/ElmSharp/DateChangedEventArgs.cs +++ /dev/null @@ -1,53 +0,0 @@ -/* - * 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 ElmSharp -{ - /// - /// It inherits System.EventArgs. - /// The DateChanged event in Calendar and DateTimeChanged event in DateTimeSelector. - /// contain DateChangedEventArgs as a parameter. - /// - public class DateChangedEventArgs : EventArgs - { - /// - /// Gets the OldDate property of the given DateChangedEventArgs. - /// - public DateTime OldDate { get; private set; } - - /// - /// Gets the NewDate property of the given DateChangedEventArgs. - /// - public DateTime NewDate { get; private set; } - - /// - /// Creates and initializes a new instance of the DateChangedEventArgs class. - /// - /// - /// Old date when DateChanged event or DateTimeChanged event triggered - /// - /// - /// New date when DateChanged event or DateTimeChanged event triggered - /// - public DateChangedEventArgs(DateTime oldDate, DateTime newDate) - { - this.OldDate = oldDate; - this.NewDate = newDate; - } - } -} diff --git a/src/ElmSharp/ElmSharp/DateTimeSelector.cs b/src/ElmSharp/ElmSharp/DateTimeSelector.cs deleted file mode 100755 index 584c236c2..000000000 --- a/src/ElmSharp/ElmSharp/DateTimeSelector.cs +++ /dev/null @@ -1,184 +0,0 @@ -/* - * 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 ElmSharp -{ - /// - /// Enumeration of datetime field types for DateTimeSelector. - /// - public enum DateTimeFieldType - { - Year, - Month, - Date, - Hour, - Minute, - AmPm - } - - /// - /// It inherits - /// DateTimeSelector is a widget to display and input date & time values. - /// This widget displays date and time as per the system's locale settings - /// (Date includes Day, Month & Year along with the defined separators and Time includes Hour, Minute & AM/PM fields. Separator for AM/PM field is ignored. - /// - public class DateTimeSelector : Layout - { - SmartEvent _changed; - DateTime _cacheDateTime; - - /// - /// Creates and initializes a new instance of the DateTimeSelector class. - /// - /// The parent is a given container which will be attached by DateTimeSelector - ///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; - }; - } - - /// - /// ItemSelected is raised when Datetime field value changed. - /// - public event EventHandler DateTimeChanged; - - /// - /// Gets or sets the datetime format. - /// - /// - /// format is a combination of allowed LIBC date format specifiers like: "%b %d, %Y %I : %M %p". - /// - public string Format - { - get - { - return Interop.Elementary.elm_datetime_format_get(RealHandle); - } - set - { - Interop.Elementary.elm_datetime_format_set(RealHandle, value); - } - } - - /// - /// Gets or sets the upper boundary of DateTime field. - /// - public DateTime MaximumDateTime - { - get - { - var tm = new Interop.Libc.SystemTime(); - Interop.Elementary.elm_datetime_value_max_get(RealHandle, ref tm); - return tm; - } - set - { - Interop.Libc.SystemTime tm = value; - Interop.Elementary.elm_datetime_value_max_set(RealHandle, ref tm); - } - } - - /// - /// Gets or sets the lower boundary of DateTime field. - /// - public DateTime MinimumDateTime - { - get - { - var tm = new Interop.Libc.SystemTime(); - Interop.Elementary.elm_datetime_value_min_get(RealHandle, ref tm); - return tm; - } - set - { - Interop.Libc.SystemTime tm = value; - Interop.Elementary.elm_datetime_value_min_set(RealHandle, ref tm); - } - } - - /// - /// Gets or sets the current value of DateTime field. - /// - public DateTime DateTime - { - get - { - var tm = new Interop.Libc.SystemTime(); - Interop.Elementary.elm_datetime_value_get(RealHandle, ref tm); - return tm; - } - set - { - Interop.Libc.SystemTime tm = value; - Interop.Elementary.elm_datetime_value_set(RealHandle, ref tm); - _cacheDateTime = value; - } - } - - /// - /// Gets whether a field can be visible. - /// - /// Enumeration - /// - /// The field is visible or not. - /// Type is bool.If visible, return true. - /// - public bool IsFieldVisible(DateTimeFieldType type) - { - return Interop.Elementary.elm_datetime_field_visible_get(RealHandle, (int)type); - } - - /// - /// Sets the field limits of a field. - /// - /// Enumeration - /// minimum limit - /// maximum limit - public void SetFieldLimit(DateTimeFieldType type, int minimum, int maximum) - { - Interop.Elementary.elm_datetime_field_limit_set(RealHandle, (int)type, minimum, maximum); - } - - /// - /// Gets whether a field can be visible. - /// - /// Enumeration - /// When set as true, the field type visible. - public void SetFieldVisible(DateTimeFieldType type, bool visible) - { - Interop.Elementary.elm_datetime_field_visible_set(RealHandle, (int)type, visible); - } - - protected override IntPtr CreateHandle(EvasObject parent) - { - IntPtr handle = Interop.Elementary.elm_layout_add(parent.Handle); - Interop.Elementary.elm_layout_theme_set(handle, "layout", "elm_widget", "default"); - - RealHandle = Interop.Elementary.elm_datetime_add(handle); - Interop.Elementary.elm_object_part_content_set(handle, "elm.swallow.content", RealHandle); - - return handle; - } - } -} diff --git a/src/ElmSharp/ElmSharp/DisplayedMonthChangedEventArgs.cs b/src/ElmSharp/ElmSharp/DisplayedMonthChangedEventArgs.cs deleted file mode 100755 index 8407f6db5..000000000 --- a/src/ElmSharp/ElmSharp/DisplayedMonthChangedEventArgs.cs +++ /dev/null @@ -1,53 +0,0 @@ -/* - * 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 ElmSharp -{ - /// - /// It inherits System.EventArgs. - /// The DisplayedMonthChangedEvent in Calendar contain - /// DisplayedMonthChangedEventArgs as a parameter. - /// - public class DisplayedMonthChangedEventArgs : EventArgs - { - /// - /// Gets the OldMonth property of the given DisplayedMonthChangedEventArgs. - /// - public int OldMonth { get; private set; } - - /// - /// Gets the NewMonth property of the given DisplayedMonthChangedEventArgs. - /// - public int NewMonth { get; private set; } - - /// - /// Creates and initializes a new instance of the DisplayedMonthChangedEventArgs class. - /// - /// - /// old month of date when DisplayedMonthChangedEvent triggered. - /// - /// - /// new month of date when DisplayedMonthChangedEvent triggered. - /// - public DisplayedMonthChangedEventArgs(int oldMonth, int newMonth) - { - this.OldMonth = oldMonth; - this.NewMonth = newMonth; - } - } -} diff --git a/src/ElmSharp/ElmSharp/EcoreAnimator.cs b/src/ElmSharp/ElmSharp/EcoreAnimator.cs deleted file mode 100755 index 64a548d3d..000000000 --- a/src/ElmSharp/ElmSharp/EcoreAnimator.cs +++ /dev/null @@ -1,88 +0,0 @@ -/* - * 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.Collections.Generic; - -namespace ElmSharp -{ - /// - /// EcoreAnimator is a helper class, it provides functions to manager animations. - /// - public static class EcoreAnimator - { - static readonly Dictionary> _taskMap = new Dictionary>(); - static readonly Object _taskLock = new Object(); - static int _newTaskId = 0; - - static Interop.Ecore.EcoreTaskCallback _nativeHandler; - - static EcoreAnimator() - { - _nativeHandler = NativeHandler; - } - - /// - /// Gets current system time as a floating point value in seconds. - /// - /// Current system time - public static double GetCurrentTime() - { - return Interop.Ecore.ecore_time_get(); - } - - /// - /// Adds an animator to call at every animation tick during main loop execution. - /// - /// The function to call when it ticks off - /// A handle to the new animator - public static IntPtr AddAnimator(Func handler) - { - int id = RegistHandler(handler); - return Interop.Ecore.ecore_animator_add(_nativeHandler, (IntPtr)id); - } - - /// - /// Removes the specified animator from the animator list. - /// - /// The specified animator handle - public static void RemoveAnimator(IntPtr anim) - { - int taskId = (int)Interop.Ecore.ecore_animator_del(anim); - _taskMap.Remove(taskId); - } - - static int RegistHandler(Func task) - { - int taskId; - lock (_taskLock) - { - taskId = _newTaskId++; - } - _taskMap[taskId] = task; - return taskId; - } - - static bool NativeHandler(IntPtr userData) - { - int task_id = (int)userData; - Func userAction = null; - _taskMap.TryGetValue(task_id, out userAction); - return (userAction != null) ? userAction() : false; - } - - } -} diff --git a/src/ElmSharp/ElmSharp/EcoreEvent.cs b/src/ElmSharp/ElmSharp/EcoreEvent.cs deleted file mode 100755 index e42310c00..000000000 --- a/src/ElmSharp/ElmSharp/EcoreEvent.cs +++ /dev/null @@ -1,210 +0,0 @@ -/* - * 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.Collections.Generic; -using System.Linq; -using System.Runtime.InteropServices; - -namespace ElmSharp -{ - /// - /// The EcoreEventType is type of EcoreEvent. - /// It includes some predefined instance. - /// - public class EcoreEventType - { - /// - /// Key down Ecore event type. - /// - public static readonly EcoreEventType KeyDown = new EcoreEventType(Interop.Libraries.EcoreInput, "ECORE_EVENT_KEY_DOWN"); - /// - /// Key Up Ecore event type. - /// - public static readonly EcoreEventType KeyUp = new EcoreEventType(Interop.Libraries.EcoreInput, "ECORE_EVENT_KEY_UP"); - /// - /// Mouse Button Down Ecore event type. - /// - public static readonly EcoreEventType MouseButtonDown = new EcoreEventType(Interop.Libraries.EcoreInput, "ECORE_EVENT_MOUSE_BUTTON_DOWN"); - /// - /// Mouse Button Up Ecore event type. - /// - public static readonly EcoreEventType MouseButtonUp = new EcoreEventType(Interop.Libraries.EcoreInput, "ECORE_EVENT_MOUSE_BUTTON_UP"); - /// - /// Mouse Button Cancel Ecore event type. - /// - public static readonly EcoreEventType MouseButtonCancel = new EcoreEventType(Interop.Libraries.EcoreInput, "ECORE_EVENT_MOUSE_BUTTON_CANCEL"); - /// - /// Mouse Move Ecore event type. - /// - public static readonly EcoreEventType MouseMove = new EcoreEventType(Interop.Libraries.EcoreInput, "ECORE_EVENT_MOUSE_MOVE"); - /// - /// Mouse Wheel Ecore event type. - /// - public static readonly EcoreEventType MouseWheel = new EcoreEventType(Interop.Libraries.EcoreInput, "ECORE_EVENT_MOUSE_WHEEL"); - /// - /// Mouse In Ecore event type. - /// - public static readonly EcoreEventType MouseIn = new EcoreEventType(Interop.Libraries.EcoreInput, "ECORE_EVENT_MOUSE_IN"); - /// - /// Mouse Out Ecore event type. - /// - public static readonly EcoreEventType MouseOut = new EcoreEventType(Interop.Libraries.EcoreInput, "ECORE_EVENT_MOUSE_OUT"); - - private string _lib; - private string _name; - private int _typeValue; - - private EcoreEventType(string lib, string name) - { - _lib = lib; - _name = name; - _typeValue = -1; - } - - /// - /// Gets the value associated with the specified type. - /// - /// The value of type. - public int GetValue() - { - if (_typeValue < 0) - { - IntPtr hDll = Interop.Libdl.LoadLibrary(_lib); - if (hDll != IntPtr.Zero) - { - IntPtr pValue = Interop.Libdl.GetProcAddress(hDll, _name); - if (pValue != IntPtr.Zero) - { - _typeValue = Marshal.ReadInt32(pValue); - } - Interop.Libdl.FreeLibrary(hDll); - } - } - return _typeValue; - } - } - - /// - /// The EcoreEvent is a class to help to create events are being notified of events. - /// - /// Kinds of EventArgs - public class EcoreEvent : IDisposable where TEventArgs : EventArgs - { - public delegate TEventArgs EventInfoParser(IntPtr data, EcoreEventType type, IntPtr info); - - private bool _disposed = false; - private EcoreEventType _eventType; - private readonly EventInfoParser _parser; - private readonly List _nativeCallbacks = new List(); - - /// - /// Creates and initializes a new instance of the EcoreEvent class. - /// - /// EcoreEventType - public EcoreEvent(EcoreEventType type) : this(type, null) - { - } - - /// - /// Creates and initializes a new instance of the EcoreEvent class. - /// - /// EcoreEventType - /// EventInfoParser - public EcoreEvent(EcoreEventType type, EventInfoParser parser) - { - _eventType = type; - _parser = parser; - } - - ~EcoreEvent() - { - Dispose(false); - } - - private struct NativeCallback - { - public Interop.Ecore.EcoreEventCallback callback; - public IntPtr nativeHandler; - public EventHandler eventHandler; - } - - /// - /// On Event Handler of EcoreEvent. - /// - public event EventHandler On - { - add - { - EventHandler handler = value; - var cb = new Interop.Ecore.EcoreEventCallback((data, type, info) => - { - TEventArgs ea = _parser == null ? (TEventArgs)EventArgs.Empty : _parser(data, _eventType, info); - handler(this, ea); - }); - IntPtr hNative = Interop.Ecore.ecore_event_handler_add(_eventType.GetValue(), cb, IntPtr.Zero); - _nativeCallbacks.Add(new NativeCallback { callback = cb, eventHandler = handler, nativeHandler = hNative }); - } - remove - { - EventHandler handler = value; - var callbacks = _nativeCallbacks.Where(cb => cb.eventHandler == handler); - foreach (var cb in callbacks) - { - Interop.Ecore.ecore_event_handler_del(cb.nativeHandler); - } - } - } - - protected virtual void Dispose(bool disposing) - { - if (!_disposed) - { - if (disposing) - { - // Place holder to dispose managed state (managed objects). - } - foreach (var cb in _nativeCallbacks) - { - Interop.Ecore.ecore_event_handler_del(cb.nativeHandler); - } - _nativeCallbacks.Clear(); - _disposed = true; - } - } - - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - } - - /// - /// Event class for EcoreEvent - /// - public class EcoreEvent : EcoreEvent - { - /// - /// Creates and initializes a new instance of the EcoreEvent class. - /// - /// EcoreEventType - public EcoreEvent(EcoreEventType type) : base(type) - { - } - } -} - diff --git a/src/ElmSharp/ElmSharp/EcoreKeyEventArgs.cs b/src/ElmSharp/ElmSharp/EcoreKeyEventArgs.cs deleted file mode 100755 index d05771698..000000000 --- a/src/ElmSharp/ElmSharp/EcoreKeyEventArgs.cs +++ /dev/null @@ -1,68 +0,0 @@ -/* - * 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; - -namespace ElmSharp -{ - /// - /// It inherits System.EventArgs. - /// The EcoreKeyEventArgs is a EventArgs to record Ecore event's key name and key code. - /// - public class EcoreKeyEventArgs : EventArgs - { - /// - /// Gets the KeyName property.The return type is string. - /// - public string KeyName { get; private set; } - /// - /// Gets the KeyCode property.The return type is int. - /// - public int KeyCode { get; private set; } - - /// - /// Creates and initializes a new instance of the EcoreKeyEventArgs class. - /// - /// data - /// type - /// information - /// new instance of the EcoreKeyEventArgs class - public static EcoreKeyEventArgs Create(IntPtr data, EcoreEventType type, IntPtr info) - { - var evt = Marshal.PtrToStructure(info); - return new EcoreKeyEventArgs { KeyName = evt.keyname, KeyCode = (int)evt.keycode }; - } - - [StructLayout(LayoutKind.Sequential)] - struct EcoreEventKey - { - public string keyname; - public string key; - public string str; - public string compose; - public IntPtr window; - public IntPtr root_window; - public IntPtr event_window; - public uint timestamp; - public uint modifiers; - public int same_screen; - public uint keycode; - public IntPtr data; - public IntPtr dev; - } - } -} diff --git a/src/ElmSharp/ElmSharp/EcoreMainloop.cs b/src/ElmSharp/ElmSharp/EcoreMainloop.cs deleted file mode 100755 index 505e2c0fa..000000000 --- a/src/ElmSharp/ElmSharp/EcoreMainloop.cs +++ /dev/null @@ -1,144 +0,0 @@ -/* - * 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.Collections.Generic; - -namespace ElmSharp -{ - /// - /// EcoreMainloop is a helper class, it provide functions relative Ecore's main loop. - /// - public static class EcoreMainloop - { - static readonly Dictionary> _taskMap = new Dictionary>(); - static readonly Object _taskLock = new Object(); - static int _newTaskId = 0; - - static Interop.Ecore.EcoreTaskCallback _nativeHandler; - - static EcoreMainloop() - { - Interop.Ecore.ecore_init(); - Interop.Ecore.ecore_main_loop_glib_integrate(); - _nativeHandler = NativeHandler; - } - - /// - /// Checks if you are calling this function from the main thread. - /// - /// True is the calling function is the same thread, false otherwise. - public static bool IsMainThread => Interop.Eina.eina_main_loop_is(); - - /// - /// Runs the application main loop. - /// - public static void Begin() - { - Interop.Ecore.ecore_main_loop_begin(); - } - - /// - /// Quits the main loop once all the events currently on the queue have been processed. - /// - public static void Quit() - { - Interop.Ecore.ecore_main_loop_quit(); - } - - /// - /// Adds an idler handler. - /// - /// The action to call when idling - public static void Post(Action task) - { - int id = RegistHandler(() => { task(); return false; }); - Interop.Ecore.ecore_idler_add(_nativeHandler, (IntPtr)id); - } - - /// - /// Calls callback asynchronously in the main loop. - /// - /// The action wanted to be called - public static void PostAndWakeUp(Action task) - { - int id = RegistHandler(() => { task(); return false; }); - Interop.Ecore.ecore_main_loop_thread_safe_call_async(_nativeHandler, (IntPtr)id); - } - - /// - /// Calls callback synchronously in the main loop. - /// - /// The action wanted to be called - public static void Send(Action task) - { - int id = RegistHandler(() => { task(); return false; }); - Interop.Ecore.ecore_main_loop_thread_safe_call_sync(_nativeHandler, (IntPtr)id); - } - - /// - /// Creates a timer to call the given function in the given period of time. - /// - /// The interval in seconds. - /// The given function. - /// A timer object handler on success, NULL on failure. - public static IntPtr AddTimer(double interval, Func handler) - { - int id = RegistHandler(handler); - return Interop.Ecore.ecore_timer_add(interval, _nativeHandler, (IntPtr)id); - } - - /// - /// Removes the specified timer from the timer list. - /// - /// The specified timer handler - public static void RemoveTimer(IntPtr id) - { - int taskId = (int)Interop.Ecore.ecore_timer_del(id); - _taskMap.Remove(taskId); - } - - static int RegistHandler(Func task) - { - int taskId; - lock (_taskLock) - { - taskId = _newTaskId++; - } - _taskMap[taskId] = task; - return taskId; - } - - static bool NativeHandler(IntPtr user_data) - { - int task_id = (int)user_data; - Func userAction = null; - if (_taskMap.TryGetValue(task_id, out userAction)) - { - bool result = false; - - if (userAction != null) - result = userAction(); - - if (result == false) - _taskMap.Remove(task_id); - - return result; - } - return false; - } - } -} diff --git a/src/ElmSharp/ElmSharp/EcoreSynchronizationContext.cs b/src/ElmSharp/ElmSharp/EcoreSynchronizationContext.cs deleted file mode 100755 index 0fa013b3e..000000000 --- a/src/ElmSharp/ElmSharp/EcoreSynchronizationContext.cs +++ /dev/null @@ -1,77 +0,0 @@ -/* - * 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.Threading; - -namespace ElmSharp -{ - - /// - /// Provides a synchronization context for the efl application. - /// - public class EcoreSynchronizationContext : SynchronizationContext - { - /// - /// Initializes a new instance of the EcoreSynchronizationContext class. - /// - public EcoreSynchronizationContext() - { - } - - /// - /// Initilizes a new EcoreSynchronizationContext and install into current thread - /// - /// - /// It is equivalent - /// - /// SetSynchronizationContext(new EcoreSynchronizationContext()); - /// - /// - public static void Initialize() - { - SetSynchronizationContext(new EcoreSynchronizationContext()); - } - - /// - /// Dispatches an asynchronous message to a Ecore main loop. - /// - /// The SendOrPostCallback delegate to call. - /// The object passed to the delegate. - /// The Post method starts an asynchronous request to post a message. - public override void Post(SendOrPostCallback d, object state) - { - EcoreMainloop.PostAndWakeUp(() => - { - d(state); - }); - } - - /// - /// Dispatches a synchronous message to a Ecore main loop - /// - /// The SendOrPostCallback delegate to call. - /// The object passed to the delegate. - /// - /// The Send method starts a synchronous request to send a message. - public override void Send(SendOrPostCallback d, object state) - { - EcoreMainloop.Send(() => - { - d(state); - }); - } - } -} diff --git a/src/ElmSharp/ElmSharp/EcoreTimelineAnimator.cs b/src/ElmSharp/ElmSharp/EcoreTimelineAnimator.cs deleted file mode 100644 index 8bc0a3921..000000000 --- a/src/ElmSharp/ElmSharp/EcoreTimelineAnimator.cs +++ /dev/null @@ -1,70 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace ElmSharp -{ - public class EcoreTimelineAnimator - { - double _runtime; - IntPtr _animator; - Action _timelineCallback; - Interop.Ecore.EcoreTimelineCallback _nativeCallback; - double _position; - - public event EventHandler Finished; - - - public EcoreTimelineAnimator(double runtime, Action timelineCallback) - { - _runtime = runtime; - _nativeCallback = NativeCallback; - _timelineCallback = timelineCallback; - _position = 0; - } - - public bool IsRunning { get; private set; } - public double Position => _position; - - public void Start() - { - IsRunning = true; - _animator = Interop.Ecore.ecore_animator_timeline_add(_runtime, _nativeCallback, IntPtr.Zero); - } - - public void Stop() - { - IsRunning = false; - _animator = IntPtr.Zero; - } - - public void Freeze() - { - Interop.Ecore.ecore_animator_freeze(_animator); - } - - public void Thaw() - { - Interop.Ecore.ecore_animator_thaw(_animator); - } - - protected void OnTimeline() - { - _timelineCallback(); - } - - bool NativeCallback(IntPtr data, double pos) - { - _position = pos; - if (!IsRunning) return false; - OnTimeline(); - if (pos == 1.0) - { - IsRunning = false; - _animator = IntPtr.Zero; - Finished?.Invoke(this, EventArgs.Empty); - } - return true; - } - } -} diff --git a/src/ElmSharp/ElmSharp/EdjeObject.cs b/src/ElmSharp/ElmSharp/EdjeObject.cs deleted file mode 100644 index 6bd1fb6d0..000000000 --- a/src/ElmSharp/ElmSharp/EdjeObject.cs +++ /dev/null @@ -1,328 +0,0 @@ -/* - * 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.Collections; -using System.Collections.Generic; - -namespace ElmSharp -{ - /// - /// The EdjeObject is a class that evas object exist in - /// - public class EdjeObject - { - IntPtr _edjeHandle; - Dictionary _signalDatas = new Dictionary(); - - internal EdjeObject(IntPtr handle) - { - _edjeHandle = handle; - } - - /// - /// Checks whether an edje part exists in a given edje object's group definition. - /// This function returns if a given part exists in the edje group bound to object obj - /// - /// This call is useful, for example, when one could expect a given GUI element, depending on the theme applied to obj. - /// The part's name to check for existence in obj's group - /// TRUE, if the edje part exists in obj's group, otherwise FALSE - public EdjeTextPartObject this[string part] - { - get - { - if (Interop.Elementary.edje_object_part_exists(_edjeHandle, part)) - { - return new EdjeTextPartObject(_edjeHandle, part); - } - return null; - } - } - - /// - /// Sends/emits an edje signal to a given edje object. - /// - /// The signal's "emission" string - /// The signal's "source" string - public void EmitSignal(string emission, string source) - { - Interop.Elementary.edje_object_signal_emit(_edjeHandle, emission, source); - } - - /// - /// Deletes the object color class. - /// This function deletes any values at the object level for the specified object and color class. - /// - /// Deleting the color class defined in the theme file. - /// The color class to be deleted - public void DeleteColorClass(string part) - { - Interop.Elementary.edje_object_color_class_del(_edjeHandle, part); - } - - /// - /// Sets the object color class. - /// - /// The color class name. - /// The object Red value. - /// The object Green value. - /// The object Blue value. - /// The object Alpha value. - /// The outline Red value. - /// The outline Green value. - /// The outline Blue value. - /// The outline Alpha value. - /// The shadow Red value. - /// The shadow Green value. - /// The shadow Blue value. - /// The shadow Alpha value. - /// True if succeed, otherwise False - public bool SetColorClass(string colorClass, int red, int green, int blue, int alpha, int outlineRed, int outlineGreen, int outlineBlue, int outlineAlpha, - int shadowRed, int shadowGreen, int shadowBlue, int shadowAlpha) - { - return Interop.Elementary.edje_object_color_class_set(_edjeHandle, colorClass, red, green, blue, alpha, outlineRed, outlineGreen, outlineBlue, outlineAlpha, - shadowRed, shadowGreen, shadowBlue, shadowAlpha); - } - - /// - /// Gets the object color class. - /// - /// The color class name. - /// The object Red value. - /// The object Green value. - /// The object Blue value. - /// The object Alpha value. - /// The outline Red value. - /// The outline Green value. - /// The outline Blue value. - /// The outline Alpha value. - /// The shadow Red value. - /// The shadow Green value. - /// The shadow Blue value. - /// The shadow Alpha value. - /// True if succeed, otherwise False - public bool GetColorClass(string colorClass, out int red, out int green, out int blue, out int alpha, out int outlineRed, out int outlineGreen, out int outlineBlue, out int outlineAlpha, - out int shadowRed, out int shadowGreen, out int shadowBlue, out int shadowAlpha) - { - return Interop.Elementary.edje_object_color_class_get(_edjeHandle, colorClass, out red, out green, out blue, out alpha, out outlineRed, out outlineGreen, out outlineBlue, out outlineAlpha, - out shadowRed, out shadowGreen, out shadowBlue, out shadowAlpha); - } - - /// - /// Sets Edje text class. - /// - /// The text class name. - /// Font name. - /// Font size. - /// True if succeed, otherwise False - public bool SetTextClass(string textClass, string font, int fontSize) - { - return Interop.Elementary.edje_object_text_class_set(_edjeHandle, textClass, font, fontSize); - } - - /// - /// Gets Edje text class. - /// - /// The text class name. - /// Font name. - /// Font size. - /// True if succeed, otherwise False - public bool GetTextClass(string textClass, out string font, out int fontSize) - { - return Interop.Elementary.edje_object_text_class_get(_edjeHandle, textClass, out font, out fontSize); - } - - /// - /// Adds Action for an arriving edje signal, emitted by a given Ejde object. - /// - /// The signal's "emission" string - /// The signal's "source" string - /// The action to be executed when the signal is emitted - public void AddSignalAction(string emission, string source, Action action) - { - if (emission != null && source != null && action != null) - { - var signalData = new SignalData(emission, source, action); - if (!_signalDatas.ContainsKey(signalData)) - { - var signalCallback = new Interop.Elementary.Edje_Signal_Cb((d, o, e, s) => - { - action(e, s); - }); - - Interop.Elementary.edje_object_signal_callback_add(_edjeHandle, emission, source, signalCallback, IntPtr.Zero); - _signalDatas.Add(signalData, signalCallback); - } - } - } - - /// - /// Deletes a signal-triggered action from an object. - /// - /// The signal's "emission" string - /// The signal's "source" string - /// The action to be executed when the signal is emitted - public void DeleteSignalAction(string emission, string source, Action action) - { - if (emission != null && source != null && action != null) - { - var signalData = new SignalData(emission, source, action); - - Interop.Elementary.Edje_Signal_Cb signalCallback = null; - _signalDatas.TryGetValue(signalData, out signalCallback); - - if (signalCallback != null) - { - Interop.Elementary.edje_object_signal_callback_del(_edjeHandle, emission, source, signalCallback); - _signalDatas.Remove(signalData); - } - } - } - - class SignalData - { - public string Emission { get; set; } - public string Source { get; set; } - - public Action Action { get; set; } - - public SignalData(string emission, string source, Action action) - { - Emission = emission; - Source = source; - Action = action; - } - - public override bool Equals(object obj) - { - SignalData s = obj as SignalData; - if (s == null) - { - return false; - } - return (Emission == s.Emission) && (Source == s.Source) && (Action == s.Action); - } - - public override int GetHashCode() - { - int hashCode = Emission.GetHashCode(); - hashCode ^= Source.GetHashCode(); - hashCode ^= Action.GetHashCode(); - return hashCode; - } - } - } - - /// - /// An EdjeTextPartObject is a class dealing with parts of type text. - /// - public class EdjeTextPartObject - { - string _part; - IntPtr _edjeHandle; - - internal EdjeTextPartObject(IntPtr edjeHandle, string part) - { - _edjeHandle = edjeHandle; - _part = part; - } - - /// - /// Gets the name of the EdjeTextPartObject - /// - public string Name { get { return _part; } } - - /// - /// Gets or sets the text for an object part. - /// - public string Text - { - get - { - return Interop.Elementary.edje_object_part_text_get(_edjeHandle, _part); - } - set - { - Interop.Elementary.edje_object_part_text_set(_edjeHandle, _part, value); - } - } - - /// - /// Sets or gets the style of the object part. - /// - public string TextStyle - { - get - { - return Interop.Elementary.edje_object_part_text_style_user_peek(_edjeHandle, _part); - } - set - { - if (value == null) - { - Interop.Elementary.edje_object_part_text_style_user_pop(_edjeHandle, _part); - } - else - { - Interop.Elementary.edje_object_part_text_style_user_push(_edjeHandle, _part, value); - } - } - } - - /// - /// Gets the geometry of a given edje part, in a given edje object's group definition, relative to the object's area. - /// - public Rect Geometry - { - get - { - int x, y, w, h; - Interop.Elementary.edje_object_part_geometry_get(_edjeHandle, _part, out x, out y, out w, out h); - return new Rect(x, y, w, h); - } - } - - /// - /// Gets the native width and height. - /// - public Size TextBlockNativeSize - { - get - { - int w; - int h; - IntPtr part = Interop.Elementary.edje_object_part_object_get(_edjeHandle, _part); - Interop.Evas.evas_object_textblock_size_native_get(part, out w, out h); - return new Size(w, h); - } - } - - /// - /// Gets the formatted width and height. - /// - public Size TextBlockFormattedSize - { - get - { - int w; - int h; - IntPtr part = Interop.Elementary.edje_object_part_object_get(_edjeHandle, _part); - Interop.Evas.evas_object_textblock_size_formatted_get(part, out w, out h); - return new Size(w, h); - } - } - } -} \ No newline at end of file diff --git a/src/ElmSharp/ElmSharp/EffectBase.cs b/src/ElmSharp/ElmSharp/EffectBase.cs deleted file mode 100755 index 19eddb08c..000000000 --- a/src/ElmSharp/ElmSharp/EffectBase.cs +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2017 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 ElmSharp -{ - /// - /// EffectBase class for the TransitEffect - /// - public abstract class EffectBase - { - /// - /// EffectEneded event will be triggered when be effect ended. - /// - public event EventHandler EffectEnded; - - internal abstract IntPtr CreateEffect(IntPtr transit); - - internal void SendEffectEnd() - { - EffectEnded?.Invoke(this, EventArgs.Empty); - } - } -} \ No newline at end of file diff --git a/src/ElmSharp/ElmSharp/Elementary.cs b/src/ElmSharp/ElmSharp/Elementary.cs deleted file mode 100644 index 7984f8353..000000000 --- a/src/ElmSharp/ElmSharp/Elementary.cs +++ /dev/null @@ -1,339 +0,0 @@ -/* - * 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.ComponentModel; -using System.IO; - -namespace ElmSharp -{ - /// - /// Focus Autoscroll Mode - /// - public enum FocusAutoScrollMode - { - /// - /// Directly show the focused region or item automatically - /// - Show, - /// - /// Do not show the focused region or item automatically - /// - None, - /// - /// Bring in the focused region or item automatically which might invole the scrolling - /// - BringIn - } - - /// - /// The Elementary is a General Elementary,a VERY SIMPLE toolkit. - /// - public static class Elementary - { - private static readonly string _themeFilePath = "/usr/share/elm-sharp/elm-sharp-theme.edj"; - - /// - /// Gets or sets the configured finger size. - /// - public static int FingerSize - { - get - { - return Interop.Elementary.elm_config_finger_size_get(); - } - set - { - Interop.Elementary.elm_config_finger_size_set(value); - } - } - - /// - /// Gets or sets the enable status of the focus highlight animation - /// - public static bool IsFocusHighlightAnimation - { - get - { - return Interop.Elementary.elm_config_focus_highlight_animate_get(); - } - set - { - Interop.Elementary.elm_config_focus_highlight_animate_set(value); - } - } - - /// - /// Gets or sets the system mirrored mode. - /// This determines the default mirrored mode of widgets. - /// - public static bool IsMirrored - { - get - { - return Interop.Elementary.elm_config_mirrored_get(); - } - set - { - Interop.Elementary.elm_config_mirrored_set(value); - } - } - - /// - /// Gets or sets the enable status of the focus highlight. - /// - public static bool CanFocusHighlight - { - get - { - return Interop.Elementary.elm_config_focus_highlight_enabled_get(); - } - set - { - Interop.Elementary.elm_config_focus_highlight_enabled_set(value); - } - } - - /// - /// Gets or sets the base scale of the application. - /// - public static double AppBaseScale - { - get - { - return Interop.Elementary.elm_app_base_scale_get(); - } - set - { - Interop.Elementary.elm_app_base_scale_set(value); - } - } - - /// - /// Gets or sets the global scaling factor. - /// - public static double Scale - { - get - { - return Interop.Elementary.elm_config_scale_get(); - } - set - { - Interop.Elementary.elm_config_scale_set(value); - } - } - - /// - /// Gets or sets the amount of inertia a scroller imposes during region bring animations. - /// - public static double BringInScrollFriction - { - get - { - return Interop.Elementary.elm_config_scroll_bring_in_scroll_friction_get(); - } - set - { - Interop.Elementary.elm_config_scroll_bring_in_scroll_friction_set(value); - } - } - - /// - /// Gets of sets focus auto scroll mode. - /// - public static FocusAutoScrollMode FocusAutoScrollMode - { - get - { - return (FocusAutoScrollMode)Interop.Elementary.elm_config_focus_autoscroll_mode_get(); - } - set - { - Interop.Elementary.elm_config_focus_autoscroll_mode_set((Interop.Elementary.Elm_Focus_Autoscroll_Mode)value); - } - } - - /// - /// Initializes Elementary. - /// - public static void Initialize() - { - Interop.Elementary.elm_init(0, null); - } - - /// - /// Shuts down Elementary. - /// - public static void Shutdown() - { - Interop.Elementary.elm_shutdown(); - } - - /// - /// Runs Elementary's main loop. - /// - public static void Run() - { - Interop.Elementary.elm_run(); - } - - [EditorBrowsable(EditorBrowsableState.Never)] - public static void ThemeOverlay() - { - if (File.Exists(_themeFilePath)) - { - AddThemeOverlay(_themeFilePath); - } - } - - /// - /// Prepends a theme overlay to the list of overlays - /// - /// The Edje file path to be used. - public static void AddThemeOverlay(string filePath) - { - Interop.Elementary.elm_theme_overlay_add(IntPtr.Zero, filePath); - } - - /// - /// Delete a theme overlay from the list of overlays - /// - /// The name of the theme overlay. - public static void DeleteThemeOverlay(string filePath) - { - Interop.Elementary.elm_theme_overlay_del(IntPtr.Zero, filePath); - } - - /// - /// Free a theme - /// - public static void FreeTheme() - { - Interop.Elementary.elm_theme_free(IntPtr.Zero); - } - - /// - /// Set the theme search order for the given theme - /// - /// Theme search string - /// This sets the search string for the theme in path-notation from first theme to search, to last, delimited by the : character. Example:"shiny:/path/to/file.edj:default" - public static void SetTheme(string theme) - { - Interop.Elementary.elm_theme_set(IntPtr.Zero, theme); - } - - /// - /// Flush the current theme. - /// - public static void FlushTheme() - { - Interop.Elementary.elm_theme_flush(IntPtr.Zero); - } - - /// - /// This flushes all themes (default and specific ones). - /// - public static void FlushAllThemes() - { - Interop.Elementary.elm_theme_full_flush(); - } - - /// - /// Deletes a theme extension from the list of extensions. - /// - /// The name of the theme extension. - public static void DeleteThemeExtention(string item) - { - Interop.Elementary.elm_theme_extension_del(IntPtr.Zero, item); - } - - [EditorBrowsable(EditorBrowsableState.Never)] - public static double GetSystemScrollFriction() - { - return BringInScrollFriction; - } - - [EditorBrowsable(EditorBrowsableState.Never)] - public static void SetSystemScrollFriction(double timeSet) - { - BringInScrollFriction = timeSet; - } - - [EditorBrowsable(EditorBrowsableState.Never)] - public static string GetProfile() - { - return Interop.Elementary.elm_config_profile_get(); - } - - [EditorBrowsable(EditorBrowsableState.Never)] - public static void SetScale(double scale) - { - Scale = scale; - } - - [EditorBrowsable(EditorBrowsableState.Never)] - public static double GetScale() - { - return Scale; - } - - /// - /// Flush all caches. - /// Frees all data that was in cache and is not currently being used to reduce memory usage. This frees Edje's, Evas' and Eet's cache. - /// - public static void FlushAllCashe() - { - Interop.Elementary.elm_cache_all_flush(); - } - - /// - /// Changes the language of the current application. - /// - /// The language to set, must be the full name of the locale. - public static void SetLanguage(string language) - { - Interop.Elementary.elm_language_set(language); - } - - /// - /// Sets a new policy's value (for a given policy group/identifier). - /// - /// The policy identifier - /// The policy value, which depends on the identifier - /// - public static bool SetPolicy(uint policy, int value) - { - return Interop.Elementary.elm_policy_set(policy, value); - } - - /// - /// Reloads Elementary's configuration, bounded to the current selected profile. - /// - public static void ReloadConfig() - { - Interop.Elementary.elm_config_reload(); - } - - /// - /// Flushes all config settings and then applies those settings to all applications using elementary on the current display. - /// - public static void FlushAllConfig() - { - Interop.Elementary.elm_config_all_flush(); - } - } -} diff --git a/src/ElmSharp/ElmSharp/ElmScrollConfig.cs b/src/ElmSharp/ElmSharp/ElmScrollConfig.cs deleted file mode 100644 index 974d74fd1..000000000 --- a/src/ElmSharp/ElmSharp/ElmScrollConfig.cs +++ /dev/null @@ -1,40 +0,0 @@ -/* - * 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.ComponentModel; - -namespace ElmSharp -{ - /// - /// The ElmScrollConfig is a scrollable views's config - /// - public static class ElmScrollConfig - { - [EditorBrowsable(EditorBrowsableState.Never)] - public static double BringInScrollFriction - { - get - { - return Elementary.BringInScrollFriction; - } - set - { - Elementary.BringInScrollFriction = value; - } - } - } -} \ No newline at end of file diff --git a/src/ElmSharp/ElmSharp/Entry.cs b/src/ElmSharp/ElmSharp/Entry.cs deleted file mode 100755 index 960468745..000000000 --- a/src/ElmSharp/ElmSharp/Entry.cs +++ /dev/null @@ -1,1025 +0,0 @@ -/* - * 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.Collections.Generic; -using System.Runtime.InteropServices; - -namespace ElmSharp -{ - /// - /// Enumeration for describing InputPanel layout type. - /// - public enum InputPanelLayout - { - /// - /// InputPanel layout type default. - /// - Normal, - - /// - /// InputPanel layout type number. - /// - Number, - - /// - /// InputPanel layout type email. - /// - Email, - - /// - /// InputPanel layout type url. - /// - Url, - - /// - /// InputPanel layout type phone. - /// - PhoneNumber, - - /// - /// InputPanel layout type ip. - /// - Ip, - - /// - /// InputPanel layout type month. - /// - Month, - - /// - /// InputPanel layout type number. - /// - NumberOnly, - - /// - /// InputPanel layout type error type. Do not use it directly! - /// - Invalid, - - /// - /// InputPanel layout type hexadecimal. - /// - Hex, - - /// - /// InputPanel layout type terminal type, esc, alt, ctrl, etc. - /// - Terminal, - - /// - /// InputPanel layout type password. - /// - Password, - - /// - /// Keyboard layout type date and time. - /// - DateTime, - - /// - /// InputPanel layout type emoticons. - /// - Emoticon - } - - /// - /// Enumeration that defines the "Return" key types on the input panel (virtual keyboard). - /// - public enum InputPanelReturnKeyType - { - /// - /// Default key type - /// - Default, - - /// - /// Done key type - /// - Done, - - /// - /// Go key type - /// - Go, - - /// - /// Join key type - /// - Join, - - /// - /// Login key type - /// - Login, - - /// - /// Next key type - /// - Next, - - /// - /// Search string or magnifier icon key type - /// - Search, - - /// - /// Send key type - /// - Send, - - /// - /// Sign-in key type - /// - Signin - } - - /// - /// Enumeration that defines the autocapitalization types. - /// - public enum AutoCapital - { - /// - /// No autocapitalization when typing - /// - None, - - /// - /// Autocapitalize each typed word - /// - Word, - - /// - /// Autocapitalize the start of each sentence - /// - Sentence, - - /// - /// Autocapitalize all letters - /// - All - } - - /// - /// Enumeration that defines the entry's copy & paste policy. - /// - public enum CopyAndPasteMode - { - /// - /// Copy & paste text with markup tag - /// - Markup, - - /// - /// Copy & paste text without item(image) tag - /// - NoImage, - - /// - /// Copy & paste text without markup tag - /// - PlainText - } - - /// - /// Enumeration that defines the text format types. - /// - public enum TextFormat - { - /// - /// Plain type - /// - Plain, - - /// - /// Markup type - /// - Markup - } - - /// - /// Enumeration that defines the types of Input Hints. - /// - public enum InputHints - { - /// - /// No active hints - /// - None, - - /// - /// suggest word auto completion - /// - AutoComplete, - - /// - /// typed text should not be stored. - /// - SensitiveData, - } - - /// - /// Enumeration that defines the input panel (virtual keyboard) language modes. - /// - public enum InputPanelLanguage - { - /// - /// Automatic language mode - /// - Automatic, - - /// - /// Alphabet language mode - /// - Alphabet, - } - - /// - /// The entry is a convenience widget that shows a box in which the user can enter text. - /// - public class Entry : Layout - { - SmartEvent _clicked; - SmartEvent _changedByUser; - SmartEvent _cursorChanged; - SmartEvent _activated; - - Dictionary, Interop.Elementary.Elm_Entry_Item_Provider_Cb> _itemsProvider = new Dictionary, Interop.Elementary.Elm_Entry_Item_Provider_Cb>(); - Dictionary, Interop.Elementary.Elm_Entry_Filter_Cb> _textFilters = new Dictionary, Interop.Elementary.Elm_Entry_Filter_Cb>(); - - /// - /// Creates and initializes a new instance of the Entry class. - /// - /// The EvasObject to which the new Entry will be attached as a child. - public Entry(EvasObject parent) : base(parent) - { - _clicked = new SmartEvent(this, this.RealHandle, "clicked"); - _clicked.On += (s, e) => Clicked?.Invoke(this, EventArgs.Empty); - - _changedByUser = new SmartEvent(this, this.RealHandle, "changed,user"); - _changedByUser.On += (s, e) => ChangedByUser?.Invoke(this, EventArgs.Empty); - - _cursorChanged = new SmartEvent(this, this.RealHandle, "cursor,changed"); - _cursorChanged.On += (s, e) => CursorChanged?.Invoke(this, EventArgs.Empty); - - _activated = new SmartEvent(this, this.RealHandle, "activated"); - _activated.On += (s, e) => Activated?.Invoke(this, EventArgs.Empty); - } - - /// - /// Activated will be triggered when the entry in Activated stated. - /// - public event EventHandler Activated; - - /// - /// Clicked will be triggered when the entry is clicked. - /// - public event EventHandler Clicked; - - /// - /// ChangedByUser will be triggered when the entry changed by user. - /// - public event EventHandler ChangedByUser; - - /// - /// CursorChanged will be triggered when the Cursor in the entry is changed. - /// - public event EventHandler CursorChanged; - - /// - /// Sets or gets the entry to the single line mode. - /// - public bool IsSingleLine - { - get - { - return Interop.Elementary.elm_entry_single_line_get(RealHandle); - } - set - { - Interop.Elementary.elm_entry_single_line_set(RealHandle, value); - } - } - - /// - /// Sets or gets the entry to the password mode. - /// - public bool IsPassword - { - get - { - return Interop.Elementary.elm_entry_password_get(RealHandle); - } - set - { - Interop.Elementary.elm_entry_password_set(RealHandle, value); - } - } - - /// - /// Sets or gets whether the entry is editable. - /// - public bool IsEditable - { - get - { - return Interop.Elementary.elm_entry_editable_get(RealHandle); - } - set - { - Interop.Elementary.elm_entry_editable_set(RealHandle, value); - } - } - - /// - /// Sets or gets whether the entry is empty. - /// - public bool IsEmpty - { - get - { - return Interop.Elementary.elm_entry_is_empty(RealHandle); - } - } - - /// - /// Sets or gets text currently shown in the object entry. - /// - public override string Text - { - get - { - return Interop.Elementary.elm_entry_entry_get(RealHandle); - } - set - { - Interop.Elementary.elm_entry_entry_set(RealHandle, value); - } - } - - /// - /// Sets or gets the style on the top of the user style stack. - /// - /// If there is styles in the user style stack, the properties in the top style of user style stack will replace the properties in current theme. The input style is specified in format tag='property=value' (i.e. DEFAULT='font=Sans font_size=60'hilight=' + font_weight=Bold'). - public string TextStyle - { - get - { - return Interop.Elementary.elm_entry_text_style_user_peek(RealHandle); - } - set - { - Interop.Elementary.elm_entry_text_style_user_push(RealHandle, value); - } - } - - /// - /// Sets or gets the current position of the cursor in the entry. - /// - public int CursorPosition - { - get - { - return Interop.Elementary.elm_entry_cursor_pos_get(RealHandle); - } - set - { - Interop.Elementary.elm_entry_cursor_pos_set(RealHandle, value); - } - } - - /// - /// Sets or gets the scrollable state of the entry. - /// - public bool Scrollable - { - get - { - return Interop.Elementary.elm_entry_scrollable_get(RealHandle); - } - set - { - // HACK: Enabling the scrollable property of an entry causes its internal - // hierarchy to change, making the internal edje object inaccessible. - // Access it before the property is set, to cache the edje object's handle. - if (value) - { - var dummy = EdjeObject; - } - Interop.Elementary.elm_entry_scrollable_set(RealHandle, value); - } - } - - /// - /// Sets or Gets the autocapitalization type on the immodule. - /// - public AutoCapital AutoCapital - { - get - { - return (AutoCapital)Interop.Elementary.elm_entry_autocapital_type_get(RealHandle); - } - set - { - Interop.Elementary.elm_entry_autocapital_type_set(RealHandle, (Interop.Elementary.AutocapitalType)value); - } - } - - /// - /// Sets or Gets the entry object's 'autosave' status. - /// - public bool IsAutoSave - { - get - { - return Interop.Elementary.elm_entry_autosave_get(RealHandle); - } - set - { - Interop.Elementary.elm_entry_autosave_set(RealHandle, value); - } - } - - /// - /// Sets or Gets entry text paste/drop mode. - /// - public CopyAndPasteMode CopyAndPasteMode - { - get - { - return (CopyAndPasteMode)Interop.Elementary.elm_entry_cnp_mode_get(RealHandle); - } - set - { - Interop.Elementary.elm_entry_cnp_mode_set(RealHandle, (Interop.Elementary.CopyAndPasteMode)value); - } - } - - /// - /// Gets the geometry of the cursor. - /// - public Rect CursorGeometry - { - get - { - int x, y, w, h; - Interop.Elementary.elm_entry_cursor_geometry_get(RealHandle, out x, out y, out w, out h); - return new Rect(x, y, w, h); - } - } - - /// - /// Gets whether a format node exists at the current cursor position. - /// - public bool IsCursorFormat - { - get - { - return Interop.Elementary.elm_entry_cursor_is_format_get(RealHandle); - } - } - - /// - /// Gets if the current cursor position holds a visible format node. - /// - public bool IsCursorVisibelFormat - { - get - { - return Interop.Elementary.elm_entry_cursor_is_visible_format_get(RealHandle); - } - } - - /// - /// Sets or Gets the value of input hint. - /// - public InputHints InputHint - { - get - { - return (InputHints)Interop.Elementary.elm_entry_input_hint_get(RealHandle); - } - set - { - Interop.Elementary.elm_entry_input_hint_set(RealHandle, (Interop.Elementary.InputHints)value); - } - } - - /// - /// Sets or gets the language mode of the input panel. - /// - public InputPanelLanguage InputPanelLanguage - { - get - { - return (InputPanelLanguage)Interop.Elementary.elm_entry_input_panel_language_get(RealHandle); - } - set - { - Interop.Elementary.elm_entry_input_panel_language_set(RealHandle, (Interop.Elementary.InputPanelLanguage)value); - } - } - - /// - /// Sets or gets the input panel layout variation of the entry. - /// - public int InputPanelVariation - { - get - { - return Interop.Elementary.elm_entry_input_panel_layout_variation_get(RealHandle); - } - set - { - Interop.Elementary.elm_entry_input_panel_layout_variation_set(RealHandle, value); - } - } - - /// - /// Sets or gets the line wrap type to use on multi-line entries. - /// - public WrapType LineWrapType - { - get - { - return (WrapType)Interop.Elementary.elm_entry_line_wrap_get(RealHandle); - } - set - { - Interop.Elementary.elm_entry_line_wrap_set(RealHandle, (Interop.Elementary.WrapType)value); - } - } - - /// - /// Sets or gets whether the entry should allow to use the text prediction. - /// - public bool PredictionAllowed - { - get - { - return Interop.Elementary.elm_entry_prediction_allow_get(RealHandle); - } - set - { - Interop.Elementary.elm_entry_prediction_allow_set(RealHandle, value); - } - } - - /// - /// Sets or gets whether the return key on the input panel should be disabled or not. - /// - public bool InputPanelReturnKeyDisabled - { - get - { - return Interop.Elementary.elm_entry_input_panel_return_key_disabled_get(RealHandle); - } - set - { - Interop.Elementary.elm_entry_input_panel_return_key_disabled_set(RealHandle, value); - } - } - - /// - /// Sets or gets the attribute to show the input panel in case of only an user's explicit Mouse Up event. - /// It doesn't request to show the input panel even though it has focus. - /// If true, the input panel will be shown in case of only Mouse up event. (Focus event will be ignored.) - /// - public bool InputPanelShowByOnDemand - { - get - { - return Interop.Elementary.elm_entry_input_panel_show_on_demand_get(RealHandle); - } - set - { - Interop.Elementary.elm_entry_input_panel_show_on_demand_set(RealHandle, value); - } - } - - /// - /// Sets the file (and implicitly loads it) for the text to display and then edit. - /// - /// The path to the file to load and save - /// The file format - public void SetFile(string file, TextFormat textFormat) - { - Interop.Elementary.elm_entry_file_set(RealHandle, file, (Interop.Elementary.TextFormat)textFormat); - } - - /// - /// Converts a markup (HTML-like) string into UTF-8. - /// - /// The string (in markup) to be converted - /// The converted string (in UTF-8) - public static string ConvertMarkupToUtf8(string markup) - { - return Interop.Elementary.elm_entry_markup_to_utf8(markup); - } - - /// - /// Moves the cursor by one position to the right within the entry. - /// - /// - public bool MoveCursorNext() - { - return Interop.Elementary.elm_entry_cursor_next(RealHandle); - } - - /// - /// Moves the cursor one place to the left within the entry. - /// - /// TRUE on success, otherwise FALSE on failure - public bool MoveCursorPrev() - { - return Interop.Elementary.elm_entry_cursor_prev(RealHandle); - } - - /// - /// Moves the cursor one line up within the entry. - /// - /// TRUE on success, otherwise FALSE on failure - public bool MoveCursorUp() - { - return Interop.Elementary.elm_entry_cursor_up(RealHandle); - } - - /// - /// Moves the cursor one line down within the entry. - /// - /// TRUE on success, otherwise FALSE on failure - public bool MoveCursorDown() - { - return Interop.Elementary.elm_entry_cursor_down(RealHandle); - } - - /// - /// Moves the cursor to the beginning of the entry. - /// - public void MoveCursorBegin() - { - Interop.Elementary.elm_entry_cursor_begin_set(RealHandle); - } - - /// - /// Moves the cursor to the end of the entry. - /// - public void MoveCursorEnd() - { - Interop.Elementary.elm_entry_cursor_end_set(RealHandle); - } - - /// - /// Moves the cursor to the beginning of the current line. - /// - public void MoveCursorLineBegin() - { - Interop.Elementary.elm_entry_cursor_line_begin_set(RealHandle); - } - - /// - /// Moves the cursor to the end of the current line. - /// - public void MoveCursorLineEnd() - { - Interop.Elementary.elm_entry_cursor_line_end_set(RealHandle); - } - - /// - /// Sets the input panel layout of the entry. - /// - /// The layout type - public void SetInputPanelLayout(InputPanelLayout layout) - { - Interop.Elementary.elm_entry_input_panel_layout_set(RealHandle, (Interop.Elementary.InputPanelLayout)layout); - } - - /// - /// Sets the attribute to show the input panel automatically. - /// - /// If true the input panel appears when the entry is clicked or has focus, otherwise false - public void SetInputPanelEnabled(bool enabled) - { - Interop.Elementary.elm_entry_input_panel_enabled_set(RealHandle, enabled); - } - - /// - /// Sets the "return" key type. This type is used to set the string or icon on the "return" key of the input panel. - /// - /// The type of "return" key on the input panel - public void SetInputPanelReturnKeyType(InputPanelReturnKeyType keyType) - { - Interop.Elementary.elm_entry_input_panel_return_key_type_set(RealHandle, (Interop.Elementary.ReturnKeyType)keyType); - } - - /// - /// Hides the input panel (virtual keyboard). - /// - /// - /// Note that the input panel is shown or hidden automatically according to the focus state of the entry widget. - /// This API can be used in case of manually controlling by using SetInputPanelEnabled(false). - /// - public void HideInputPanel() - { - Interop.Elementary.elm_entry_input_panel_hide(RealHandle); - } - - /// - /// Selects all the text within the entry. - /// - public void SelectAll() - { - Interop.Elementary.elm_entry_select_all(RealHandle); - } - - /// - /// Drops any existing text selection within the entry. - /// - public void SelectNone() - { - Interop.Elementary.elm_entry_select_none(RealHandle); - } - - /// - /// Forces calculation of the entry size and text layouting. - /// - public void ForceCalculation() - { - Interop.Elementary.elm_entry_calc_force(RealHandle); - } - - /// - /// Gets the string by the cursor at its current position. - /// - /// - public string GetCursorContent() - { - return Interop.Elementary.elm_entry_cursor_content_get(RealHandle); - } - - /// - /// Begins a selection within the entry as though the user were holding down the mouse button to make a selection. - /// - public void BeginCursorSelection() - { - Interop.Elementary.elm_entry_cursor_selection_begin(RealHandle); - } - - /// - /// Appends the text of the entry. - /// - /// The text to be displayed - public void AppendText(string text) - { - Interop.Elementary.elm_entry_entry_append(RealHandle, text); - } - - /// - /// Inserts the given text into the entry at the current cursor position. - /// - /// - public void InsertTextToCursor(string text) - { - Interop.Elementary.elm_entry_entry_insert(RealHandle, text); - } - - /// - /// Ends a selection within the entry as though the user had just released the mouse button while making a selection. - /// - public void EndCursorSelection() - { - Interop.Elementary.elm_entry_cursor_selection_end(RealHandle); - } - - /// - /// Writes any changes made to the file that is set by File. - /// - public void SaveFile() - { - Interop.Elementary.elm_entry_file_save(RealHandle); - } - - /// - /// Show the input panel (virtual keyboard) based on the input panel property of entry such as layout, autocapital types, and so on. - /// - /// - /// Note that input panel is shown or hidden automatically according to the focus state of entry widget. - /// This API can be used in the case of manually controlling by using SetInputPanelEnabled(false). - /// - public void ShowInputPanel() - { - Interop.Elementary.elm_entry_input_panel_show(RealHandle); - } - - /// - /// This appends a custom item provider to the list for that entry. - /// - /// This function is used to provide items. - public void AppendItemProvider(Func func) - { - if (func != null) - { - if (!_itemsProvider.ContainsKey(func)) - { - Interop.Elementary.Elm_Entry_Item_Provider_Cb itemProviderCallback; - - itemProviderCallback = (d, o, t) => - { - return func?.Invoke(t); - }; - Interop.Elementary.elm_entry_item_provider_append(RealHandle, itemProviderCallback, IntPtr.Zero); - _itemsProvider.Add(func, itemProviderCallback); - } - } - } - - /// - /// This prepends a custom item provider to the list for that entry. - /// - /// This function is used to provide items. - public void PrependItemProvider(Func func) - { - if (!_itemsProvider.ContainsKey(func)) - { - Interop.Elementary.Elm_Entry_Item_Provider_Cb itemProviderCallback; - - itemProviderCallback = (d, o, t) => - { - return func?.Invoke(t); - }; - Interop.Elementary.elm_entry_item_provider_prepend(RealHandle, itemProviderCallback, IntPtr.Zero); - _itemsProvider.Add(func, itemProviderCallback); - } - } - - /// - /// This removes a custom item provider to the list for that entry. - /// - /// This function is used to provide items. - public void RemoveItemProvider(Func func) - { - if (_itemsProvider.ContainsKey(func)) - { - Interop.Elementary.Elm_Entry_Item_Provider_Cb itemProviderCallback; - _itemsProvider.TryGetValue(func, out itemProviderCallback); - - Interop.Elementary.elm_entry_item_provider_remove(RealHandle, itemProviderCallback, IntPtr.Zero); - _itemsProvider.Remove(func); - } - } - - /// - /// Append a markup filter function for text inserted in the entry. - /// - /// This function type is used by entry filters to modify text. - public void AppendMarkUpFilter(Func filter) - { - if (!_textFilters.ContainsKey(filter)) - { - Interop.Elementary.Elm_Entry_Filter_Cb textFilterCallback = (IntPtr d, IntPtr e, ref IntPtr t) => - { - var text = Marshal.PtrToStringAnsi(t); - - var updateText = filter(this, text); - - if (updateText != text) - { - Interop.Libc.Free(t); - t = Marshal.StringToHGlobalAnsi(updateText); - } - }; - Interop.Elementary.elm_entry_markup_filter_append(RealHandle, textFilterCallback, IntPtr.Zero); - _textFilters.Add(filter, textFilterCallback); - } - } - - /// - /// Prepend a markup filter function for text inserted in the entry. - /// - /// This function type is used by entry filters to modify text. - public void PrependMarkUpFilter(Func filter) - { - if (!_textFilters.ContainsKey(filter)) - { - Interop.Elementary.Elm_Entry_Filter_Cb textFilterCallback = (IntPtr d, IntPtr e, ref IntPtr t) => - { - var text = Marshal.PtrToStringAnsi(t); - - var updateText = filter(this, text); - - if (updateText != text) - { - Interop.Libc.Free(t); - t = Marshal.StringToHGlobalAnsi(updateText); - } - }; - Interop.Elementary.elm_entry_markup_filter_prepend(RealHandle, textFilterCallback, IntPtr.Zero); - _textFilters.Add(filter, textFilterCallback); - } - } - - /// - /// Remove a markup filter - /// - /// This function type is used by entry filters to modify text. - public void RemoveMarkUpFilter(Func filter) - { - if (_textFilters.ContainsKey(filter)) - { - Interop.Elementary.Elm_Entry_Filter_Cb textFilterCallback; - _textFilters.TryGetValue(filter, out textFilterCallback); - - Interop.Elementary.elm_entry_markup_filter_remove(RealHandle, textFilterCallback, IntPtr.Zero); - _textFilters.Remove(filter); - } - } - - /// - /// This executes a "copy" action on the selected text in the entry. - /// - public void CopySelection() - { - Interop.Elementary.elm_entry_selection_copy(RealHandle); - } - - /// - /// This executes a "cut" action on the selected text in the entry. - /// - public void CutSelection() - { - Interop.Elementary.elm_entry_selection_cut(RealHandle); - } - - /// - /// This executes a "paste" action in the entry. - /// - public void PasteSelection() - { - Interop.Elementary.elm_entry_selection_paste(RealHandle); - } - - /// - /// This disabled the entry's selection. - /// - /// If true, the selection are disabled. - public void DisableSelection(bool disable) - { - Interop.Elementary.elm_entry_selection_handler_disabled_set(RealHandle, disable); - } - - /// - /// Get any selected text within the entry. - /// - /// Selection's value - public string GetSelection() - { - return Interop.Elementary.elm_entry_selection_get(RealHandle); - } - - /// - /// This selects a region of text within the entry. - /// - /// The starting position. - /// The end position. - public void SetSelectionRegion(int start, int end) - { - Interop.Elementary.elm_entry_select_region_set(RealHandle, start, end); - } - - /// - /// Sets the visibility of the left-side widget of the entry - /// - /// true if the object should be displayed, false if not. - public void SetIconVisible(bool isDisplay) - { - Interop.Elementary.elm_entry_icon_visible_set(RealHandle, isDisplay); - } - - /// - /// Set whether the return key on the input panel is disabled automatically when entry has no text. - /// - /// If enabled is true, the return key is automatically disabled when the entry has no text. - public void SetInputPanelReturnKeyAutoEnable(bool enable) - { - Interop.Elementary.elm_entry_input_panel_return_key_autoenabled_set(RealHandle, enable); - } - - protected override IntPtr CreateHandle(EvasObject parent) - { - return Interop.Elementary.elm_entry_add(parent.Handle); - } - } -} \ No newline at end of file diff --git a/src/ElmSharp/ElmSharp/EvasCanvas.cs b/src/ElmSharp/ElmSharp/EvasCanvas.cs deleted file mode 100644 index 635589036..000000000 --- a/src/ElmSharp/ElmSharp/EvasCanvas.cs +++ /dev/null @@ -1,187 +0,0 @@ -/* - * 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.Collections.Generic; - -namespace ElmSharp -{ - /// - /// Low level Evas canvas functions. Sub groups will present more high level ones, though. - /// Most of these functions deal with low level Evas actions, like: - /// create/destroy raw canvases, not bound to any displaying engine - /// tell a canvas i got focused(in a windowing context, for example) - /// tell a canvas a region should not be calculated anymore in rendering - /// tell a canvas to render its contents, immediately - /// Most users will be using Evas by means of the Ecore_Evas wrapper, which deals with all the above mentioned issues automatically for them.Thus, you'll be looking at this section only if you're building low level stuff. - /// The groups within present you functions that deal with the canvas directly, too, and not yet with its objects.They are the functions you need to use at a minimum to get a working canvas. - /// - public class EvasCanvas - { - IntPtr _handle = IntPtr.Zero; - Dictionary _eventDatas = new Dictionary(); - - internal EvasCanvas(IntPtr evasObject) - { - _handle = CreateHandle(evasObject); - } - - /// - /// Gets the current known default pointer coordinates. - /// This function returns the current known canvas unit coordinates of the mouse pointer. - /// - public Point Pointer - { - get - { - int mx, my; - Interop.Evas.evas_pointer_canvas_xy_get(_handle, out mx, out my); - return new Point { X = mx, Y = my }; - } - } - - /// - /// Gets or sets the image cache. - /// This function returns the image cache size of canvas in bytes. - /// - public int ImageCacheSize - { - get - { - return Interop.Evas.evas_image_cache_get(_handle); - } - set - { - Interop.Evas.evas_image_cache_set(_handle, value); - } - } - - /// - /// Flush the image cache of the canvas. - /// - public void FlushImageCache() - { - Interop.Evas.evas_image_cache_flush(_handle); - } - - /// - /// Add a damage rectangle. - /// - /// The rectangle's top left corner's horizontal coordinate. - /// The rectangle's top left corner's vertical coordinate. - /// The rectangle's width. - /// The rectangle's height. - public void AddDamageRectangle(int x, int y, int width, int height) - { - Interop.Evas.evas_damage_rectangle_add(_handle, x, y, width, height); - } - - /// - /// Add an "obscured region" to an Evas canvas. - /// - /// The rectangle's top left corner's horizontal coordinate. - /// The rectangle's top left corner's vertical coordinate. - /// The rectangle's width. - /// The rectangle's height. - public void AddObscuredRectangle(int x, int y, int width, int height) - { - Interop.Evas.evas_obscured_rectangle_add(_handle, x, y, width, height); - } - - /// - /// Remove all "obscured regions" from an Evas canvas. - /// - public void ClearObscuredRectangle() - { - Interop.Evas.evas_obscured_clear(_handle); - } - - /// - /// Adds or registers a event to a given canvas event. - /// - /// The type of event that triggers - /// The action to be called when the event is triggered - public void AddEventAction(EvasObjectCallbackType type, Action action) - { - if (action != null) - { - var eventData = new EventData(type, action); - - if (!_eventDatas.ContainsKey(eventData)) - { - var evasCallback = new Interop.Evas.EvasCallback((d, o, t) => action()); - Interop.Evas.evas_event_callback_add(_handle, (Interop.Evas.ObjectCallbackType)type, evasCallback, IntPtr.Zero); - _eventDatas.Add(eventData, evasCallback); - } - } - } - - /// - /// Deletes a event to a given canvas event. - /// - /// The type of event that triggers - /// The action to be called when the event is triggered - public void DeleteEventAction(EvasObjectCallbackType type, Action action) - { - if (action != null) - { - var eventData = new EventData(type, action); - Interop.Evas.EvasCallback evasCallback = null; - _eventDatas.TryGetValue(eventData, out evasCallback); - - if (evasCallback != null) - { - Interop.Evas.evas_event_callback_del(_handle, (Interop.Evas.ObjectCallbackType)type, evasCallback); - _eventDatas.Remove(eventData); - } - } - } - - IntPtr CreateHandle(IntPtr evasObject) - { - return Interop.Evas.evas_object_evas_get(evasObject); - } - - class EventData - { - public EvasObjectCallbackType Type { get; set; } - public Action Action { get; set; } - - public EventData(EvasObjectCallbackType type, Action action) - { - Type = type; - Action = action; - } - - public override bool Equals(object obj) - { - EventData e = obj as EventData; - if (e == null) - { - return false; - } - return (Type == e.Type) && (Action == e.Action); - } - - public override int GetHashCode() - { - int hashCode = Type.GetHashCode(); - hashCode ^= Action.GetHashCode(); - return hashCode; - } - } - } -} \ No newline at end of file diff --git a/src/ElmSharp/ElmSharp/EvasKeyEventArgs.cs b/src/ElmSharp/ElmSharp/EvasKeyEventArgs.cs deleted file mode 100644 index 378a7e99e..000000000 --- a/src/ElmSharp/ElmSharp/EvasKeyEventArgs.cs +++ /dev/null @@ -1,148 +0,0 @@ -/* - * 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; - -namespace ElmSharp -{ - /// - /// The EvasKeyEventArgs is an EvasKey EventArgs - /// - public class EvasKeyEventArgs : EventArgs - { - IntPtr _nativeEventInfo; - - /// - /// BackButton name in Platform - /// - public const string PlatformBackButtonName = "XF86Back"; - /// - /// MenuButton name in Platform - /// - public const string PlatformMenuButtonName = "XF86Menu"; - /// - /// HomeButton name in Platform - /// - public const string PlatformHomeButtonName = "XF86Home"; - - /// - /// Gets the name of Key - /// - public string KeyName { get; private set; } - - public EvasEventFlag Flags - { - get - { - IntPtr offset = Marshal.OffsetOf("event_flags"); - return (EvasEventFlag)Marshal.ReadIntPtr(_nativeEventInfo, (int)offset); - } - set - { - IntPtr offset = Marshal.OffsetOf("event_flags"); - Marshal.WriteIntPtr(_nativeEventInfo, (int)offset, (IntPtr)value); - } - } - - EvasKeyEventArgs(IntPtr info) - { - _nativeEventInfo = info; - var evt = Marshal.PtrToStructure(info); - KeyName = evt.keyname; - } - - /// - /// Creates and initializes a new instance of the EvasKeyEventArgs class. - /// - /// data info - /// object - /// information - /// EvasKey eventArgs - static public EvasKeyEventArgs Create(IntPtr data, IntPtr obj, IntPtr info) - { - return new EvasKeyEventArgs(info); - } - - /// - /// Event structure for Key Down event callbacks. - /// - [StructLayout(LayoutKind.Sequential)] - struct EvasEventKeyDown - { - /// - /// Name string of the key pressed - /// - public string keyname; - /// - /// Data to be passed to the event - /// - public IntPtr data; - /// - /// Modifier keys pressed during the event - /// - public IntPtr modifiers; - /// - /// Locks info - /// - public IntPtr locks; - /// - /// Logical key: (example, shift+1 == exclamation) - /// - public string key; - /// - /// UTF8 string if this keystroke has produced a visible string to be ADDED - /// - public string str; - /// - /// UTF8 string if this keystroke has modified a string in the middle of being composed - this string replaces the previous one - /// - public string compose; - - public uint timestamp; - - /// - /// Event_flags - /// - public EvasEventFlag event_flags; - /// - /// - /// - public IntPtr dev; - /// - /// Keycode - /// - public uint keycode; - }; - } - - /// - /// Flags for Events - /// - [Flags] - public enum EvasEventFlag - { - /// - /// No fancy flags set - /// - None = 0, - /// - ///This event is being delivered but should be put "on hold" until the on hold flag is unset. the event should be used for informational purposes and maybe some indications visually, but not actually perform anything - /// - OnHold = 1, - } - -} diff --git a/src/ElmSharp/ElmSharp/EvasMap.cs b/src/ElmSharp/ElmSharp/EvasMap.cs deleted file mode 100755 index 13fa2eebd..000000000 --- a/src/ElmSharp/ElmSharp/EvasMap.cs +++ /dev/null @@ -1,166 +0,0 @@ -/* - * 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 ElmSharp -{ - /// - /// The EvasMap is an opaque handle to map points. - /// - public class EvasMap - { - IntPtr _evasMap; - bool _ownership; - - /// - /// Creates and initializes a new instance of the EvasMap class. - /// - /// The number of points in the map - public EvasMap(int count) - { - _evasMap = Interop.Evas.evas_map_new(count); - _ownership = true; - } - - internal EvasMap(IntPtr handle) - { - _evasMap = handle; - _ownership = false; - } - - ~EvasMap() - { - if (_ownership) - { - Interop.Evas.evas_map_free(_evasMap); - } - } - - internal IntPtr Handle - { - get - { - return _evasMap; - } - } - - /// - /// Gets or sets the flag of the object move synchronization for map rendering. - /// - public bool IsMoveSync - { - get - { - return Interop.Evas.evas_map_util_object_move_sync_get(_evasMap); - } - set - { - Interop.Evas.evas_map_util_object_move_sync_set(_evasMap, value); - } - } - - /// - /// Populates source and destination map points to exactly match the object. - /// - /// The object to use unmapped geometry to populate map coordinates - public void PopulatePoints(EvasObject obj) - { - Interop.Evas.evas_map_util_points_populate_from_object_full(_evasMap, obj, 0); - } - - /// - /// Populates source and destination map points to exactly match the object. - /// - /// The object to use unmapped geometry to populate map coordinates - /// - /// The point Z coordinate hint (pre-perspective transform)This value is used for all four points. - /// - public void PopulatePoints(EvasObject obj, int z) - { - Interop.Evas.evas_map_util_points_populate_from_object_full(_evasMap, obj, z); - } - - /// - /// Populates the source and destination map points to match the given geometry. - /// - /// The geometry value contains X coordinate,Y coordinate,the width and height to use to calculate second and third points - /// The Z coordinate hint (pre-perspective transform) This value is used for all four points. - public void PopulatePoints(Rect geometry, int z) - { - Interop.Evas.evas_map_util_points_populate_from_geometry(_evasMap, geometry.X, geometry.Y, geometry.Width, geometry.Height, z); - } - - /// - /// Rotate the map - /// - /// The abount of degrees from 0.0 to 360.0 to rotate - /// rotation's center horizontal position. - /// rotation's center vertical position. - public void Rotate(double degrees, int cx, int cy) - { - Interop.Evas.evas_map_util_rotate(_evasMap, degrees, cx, cy); - } - - /// - /// Rotates the map around 3 axes in 3D. - /// - /// The amount of degrees from 0.0 to 360.0 to rotate around X axis - /// The amount of degrees from 0.0 to 360.0 to rotate around Y axis - /// The amount of degrees from 0.0 to 360.0 to rotate around Z axis - /// The rotation's center horizontal position - /// The rotation's center vertical position - /// The rotation's center depth position - public void Rotate3D(double dx, double dy, double dz, int cx, int cy, int cz) - { - Interop.Evas.evas_map_util_3d_rotate(_evasMap, dx, dy, dz, cx, cy, cz); - } - - /// - /// Changes the map point's coordinate. - /// - /// The index of point to change ,this must be smaller than map size. - /// 3D Point coordinate - public void SetPointCoordinate(int idx, Point3D point) - { - Interop.Evas.evas_map_point_coord_set(_evasMap, idx, point.X, point.Y, point.Z); - } - - /// - /// Gets the map point's coordinate. - /// - /// The index of point to change ,this must be smaller than map size. - /// The coordinates of the given point in the map. - public Point3D GetPointCoordinate(int idx) - { - Point3D point; - Interop.Evas.evas_map_point_coord_get(_evasMap, idx, out point.X, out point.Y, out point.Z); - return point; - } - - /// - /// Changes the map to apply the given zooming. - /// - /// The horizontal zoom to use - /// The vertical zoom to use - /// The zooming center horizontal position - /// The zooming center vertical position - public void Zoom(double x, double y, int cx, int cy) - { - Interop.Evas.evas_map_util_zoom(_evasMap, x, y, cx, cy); - } - } -} diff --git a/src/ElmSharp/ElmSharp/EvasObject.cs b/src/ElmSharp/ElmSharp/EvasObject.cs deleted file mode 100755 index aea91a4b9..000000000 --- a/src/ElmSharp/ElmSharp/EvasObject.cs +++ /dev/null @@ -1,989 +0,0 @@ -/* - * 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.Collections.Generic; -using System.Diagnostics; - -namespace ElmSharp -{ - public enum TooltipOrientation - { - None, - TopLeft, - Top, - TopRight, - Left, - Center, - Right, - BottomLeft, - Bottom, - BottomRight, - } - - public enum AspectControl - { - None = 0, /* Preference on scaling unset */ - Neither = 1, /* Same effect as unset preference on scaling */ - Horizontal = 2, /* Use all horizontal container space to place an object, using the given aspect */ - Vertical = 3, /* Use all vertical container space to place an object, using the given aspect */ - Both = 4 /* Use all horizontal @b and vertical container spaces to place an object (never growing it out of those bounds), using the given aspect */ - } - - /// - /// The EcasObject is a base class for other widget class - /// - public abstract class EvasObject - { - private IntPtr _realHandle = IntPtr.Zero; - private EvasCanvas _evasCanvas; - - private event EventHandler _backButtonPressed; - - private event EventHandler _moreButtonPressed; - - private Interop.Eext.EextEventCallback _backButtonHandler; - private Interop.Eext.EextEventCallback _moreButtonHandler; - - public IntPtr Handle { get; protected set; } - public EvasObject Parent { get; private set; } - - public IntPtr RealHandle - { - get - { - return _realHandle == IntPtr.Zero ? Handle : _realHandle; - } - protected set - { - _realHandle = value; - Interop.Evas.evas_object_show(_realHandle); - } - } - - EvasObjectEvent _deleted; - EvasObjectEvent _keyup; - EvasObjectEvent _keydown; - EvasObjectEvent _moved; - EvasObjectEvent _resized; - EventHandler _renderPost; - Interop.Evas.EvasCallback _renderPostCallback = null; - Interop.Elementary.Elm_Tooltip_Content_Cb _tooltipContentCallback = null; - - GetTooltipContentDelegate _tooltipContentDelegate = null; - - readonly HashSet _eventStore = new HashSet(); - - /// - /// Creates and initializes a new instance of the EvasObject class with parent EvasObject class parameter. - /// - /// Parent EvasObject class - protected EvasObject(EvasObject parent) : this() - { - Debug.Assert(parent == null || parent.IsRealized); - Realize(parent); - } - - /// - /// Creates and initializes a new instance of the EvasObject class. - /// - protected EvasObject() - { - _backButtonHandler = new Interop.Eext.EextEventCallback((d, o, i) => { _backButtonPressed?.Invoke(this, EventArgs.Empty); }); - _moreButtonHandler = new Interop.Eext.EextEventCallback((d, o, i) => { _moreButtonPressed?.Invoke(this, EventArgs.Empty); }); - - OnInstantiated(); - - _tooltipContentCallback = (d, o, t) => - { - return _tooltipContentDelegate?.Invoke(); - }; - } - - // C# Finalizer was called on GC thread - // So, We can't access to EFL object - // And When Finalizer was called, Field can be already released. - //~EvasObject() - //{ - // Unrealize(); - //} - - /// - /// Deleted will be triggered when widght is deleted - /// - public event EventHandler Deleted; - - /// - /// KeyUp will be triggered when key is loose - /// - public event EventHandler KeyUp; - - /// - /// KeyDown will be triggered when key is preesd down - /// - public event EventHandler KeyDown; - - /// - /// BackButtonPressed will be triggered when Back button is pressed - /// - public event EventHandler BackButtonPressed - { - add - { - if (_backButtonPressed == null) - { - Interop.Eext.eext_object_event_callback_add(RealHandle, Interop.Eext.EextCallbackType.EEXT_CALLBACK_BACK, _backButtonHandler, IntPtr.Zero); - } - _backButtonPressed += value; - } - remove - { - _backButtonPressed -= value; - if (_backButtonPressed == null) - { - Interop.Eext.eext_object_event_callback_del(RealHandle, Interop.Eext.EextCallbackType.EEXT_CALLBACK_BACK, _backButtonHandler); - } - } - } - - /// - /// MoreButtonPressed will be triggered when More button is pressed - /// - public event EventHandler MoreButtonPressed - { - add - { - if (_moreButtonPressed == null) - { - Interop.Eext.eext_object_event_callback_add(RealHandle, Interop.Eext.EextCallbackType.EEXT_CALLBACK_MORE, _moreButtonHandler, IntPtr.Zero); - } - _moreButtonPressed += value; - } - remove - { - _moreButtonPressed -= value; - if (_moreButtonPressed == null) - { - Interop.Eext.eext_object_event_callback_del(RealHandle, Interop.Eext.EextCallbackType.EEXT_CALLBACK_MORE, _moreButtonHandler); - } - } - } - - /// - /// Moved will be triggered when widght is moved - /// - public event EventHandler Moved - { - add { _moved.On += value; } - remove { _moved.On -= value; } - } - - /// - /// Current widget's size Resized Event Handler - /// - public event EventHandler Resized - { - add { _resized.On += value; } - remove { _resized.On -= value; } - } - - /// - /// Current widget RenderPost Event Handler - /// - public event EventHandler RenderPost - { - add - { - _renderPost += value; - if (_renderPostCallback == null) - { - _renderPostCallback = new Interop.Evas.EvasCallback((o, e, d) => _renderPost?.Invoke(this, EventArgs.Empty)); - Interop.Evas.evas_event_callback_add(Interop.Evas.evas_object_evas_get(RealHandle), Interop.Evas.ObjectCallbackType.RenderPost, _renderPostCallback, IntPtr.Zero); - } - } - remove - { - _renderPost -= value; - if (_renderPost == null) - { - Interop.Evas.evas_event_callback_del(Interop.Evas.evas_object_evas_get(RealHandle), Interop.Evas.ObjectCallbackType.RenderPost, _renderPostCallback); - _renderPostCallback = null; - } - } - } - - /// - /// Called back when a widget's tooltip is activated and needs content. - /// - /// - public delegate EvasObject GetTooltipContentDelegate(); - - /// - /// Get widget's status of Realized or not. - /// - public bool IsRealized { get { return Handle != IntPtr.Zero; } } - - /// - /// Gets EvasCanvas - /// - public EvasCanvas EvasCanvas - { - get - { - if (_evasCanvas == null) - _evasCanvas = new EvasCanvas(Handle); - return _evasCanvas; - } - } - - /// - /// Gets the current class's Name. - /// - public string ClassName - { - get - { - return Interop.Eo.eo_class_name_get(Interop.Eo.eo_class_get(RealHandle)); - } - } - - /// - /// Sets or gets the horizontal pointer hints for an object's weight. - /// - public double WeightX - { - get - { - return Interop.Evas.GetWeightX(Handle); - } - set - { - Interop.Evas.SetWeightX(Handle, value); - } - } - - /// - /// Sets or gets the vertical pointer hints for an object's weight. - /// - public double WeightY - { - get - { - return Interop.Evas.GetWeightY(Handle); - } - set - { - Interop.Evas.SetWeightY(Handle, value); - } - } - - /// - /// Sets or gets the horizontal alignment hint of an object's alignment. - /// - public virtual double AlignmentX - { - get - { - return Interop.Evas.GetAlignX(Handle); - } - set - { - Interop.Evas.SetAlignX(Handle, value); - } - } - - /// - /// Sets or gets the vertical alignment hint of an object's alignment. - /// - public virtual double AlignmentY - { - get - { - return Interop.Evas.GetAlignY(Handle); - } - set - { - Interop.Evas.SetAlignY(Handle, value); - } - } - - /// - /// Sets or gets the Width hints for an object's minimum size. - /// - public int MinimumWidth - { - get - { - int w, h; - Interop.Evas.evas_object_size_hint_min_get(RealHandle, out w, out h); - return w; - } - set - { - int h = MinimumHeight; - Interop.Evas.evas_object_size_hint_min_set(RealHandle, value, h); - } - } - - /// - /// Sets or gets the Height hints for an object's minimum size. - /// - public int MinimumHeight - { - get - { - int w, h; - Interop.Evas.evas_object_size_hint_min_get(RealHandle, out w, out h); - return h; - } - set - { - int w = MinimumWidth; - Interop.Evas.evas_object_size_hint_min_set(RealHandle, w, value); - } - } - - /// - /// Gets the visible state of the given Evas object. - /// - public bool IsVisible - { - get - { - return Interop.Evas.evas_object_visible_get(Handle); - } - } - - /// - /// Sets or gets the position and (rectangular) size of the given Evas object. - /// - public Rect Geometry - { - get - { - int x, y, w, h; - Interop.Evas.evas_object_geometry_get(Handle, out x, out y, out w, out h); - Rect rect = new Rect(x, y, w, h); - return rect; - } - set - { - Interop.Evas.evas_object_geometry_set(Handle, value.X, value.Y, value.Width, value.Height); - } - } - - /// - /// Sets or gets the general or main color of the given Evas object. - /// - public virtual Color Color - { - get - { - int r, g, b, a; - Interop.Evas.evas_object_color_get(RealHandle, out r, out g, out b, out a); - return Color.FromRgba(r, g, b, a); - } - set - { - Interop.Evas.SetPremultipliedColor(RealHandle, value.R, value.G, value.B, value.A); - } - } - - /// - /// Sets or gets the map enabled state. - /// - public bool IsMapEnabled - { - get - { - return Interop.Evas.evas_object_map_enable_get(Handle); - } - set - { - Interop.Evas.evas_object_map_enable_set(Handle, value); - } - } - - /// - /// Sets or gets current object transformation map. - /// - public EvasMap EvasMap - { - get - { - IntPtr evasMap = Interop.Evas.evas_object_map_get(Handle); - return new EvasMap(evasMap); - } - set - { - Interop.Evas.evas_object_map_set(Handle, value.Handle); - } - } - - /// - /// Sets or gets whether an object is to repeat events. - /// - public bool RepeatEvents - { - get - { - var result = Interop.Evas.evas_object_repeat_events_get(Handle); - Debug.Assert(Handle == RealHandle || result == Interop.Evas.evas_object_repeat_events_get(RealHandle)); - return result; - } - set - { - if (Handle != RealHandle) - { - Interop.Evas.evas_object_repeat_events_set(RealHandle, value); - } - Interop.Evas.evas_object_repeat_events_set(Handle, value); - } - } - - /// - /// Sets or gets whether events on a smart object's member should get propagated up to its parent. - /// - public bool PropagateEvents - { - get - { - var result = Interop.Evas.evas_object_propagate_events_get(Handle); - Debug.Assert(Handle == RealHandle || result == Interop.Evas.evas_object_propagate_events_get(RealHandle)); - return result; - } - set - { - if (Handle != RealHandle) - { - Interop.Evas.evas_object_propagate_events_set(RealHandle, value); - } - Interop.Evas.evas_object_propagate_events_set(Handle, value); - } - } - - /// - /// Sets or gets whether an object is set to pass (ignore) events. - /// - public bool PassEvents - { - get - { - var result = Interop.Evas.evas_object_pass_events_get(Handle); - Debug.Assert(Handle == RealHandle || result == Interop.Evas.evas_object_pass_events_get(RealHandle)); - return result; - } - set - { - if (Handle != RealHandle) - { - Interop.Evas.evas_object_pass_events_set(RealHandle, value); - } - Interop.Evas.evas_object_pass_events_set(Handle, value); - } - } - - /// - /// Sets or Gets style for this object tooltip. - /// - public string TooltipStyle - { - get - { - return Interop.Elementary.elm_object_tooltip_style_get(RealHandle); - } - set - { - Interop.Elementary.elm_object_tooltip_style_set(RealHandle, value); - } - } - - /// - /// Sets or gets the orientation of Tooltip. - /// - public TooltipOrientation TooltipOrientation - { - get - { - return (TooltipOrientation)Interop.Elementary.elm_object_tooltip_orient_get(RealHandle); - } - set - { - Interop.Elementary.elm_object_tooltip_orient_set(RealHandle, (int)value); - } - } - - /// - /// Sets or gets size restriction state of an object's tooltip. - /// - public bool TooltipWindowMode - { - get - { - return Interop.Elementary.elm_object_tooltip_window_mode_get(RealHandle); - } - set - { - Interop.Elementary.elm_object_tooltip_window_mode_set(RealHandle, value); - } - } - - /// - /// Sets the content to be shown in the tooltip object. - /// - public GetTooltipContentDelegate TooltipContentDelegate - { - get - { - return _tooltipContentDelegate; - } - set - { - _tooltipContentDelegate = value; - if (value != null) - { - Interop.Elementary.elm_object_tooltip_content_cb_set(RealHandle, _tooltipContentCallback, IntPtr.Zero, null); - } - else - { - Interop.Elementary.elm_object_tooltip_content_cb_set(RealHandle, null, IntPtr.Zero, null); - } - } - } - - /// - /// Gets the movement freeze by 1 - /// This gets the movement freeze count by one. - /// - public int TooltipMoveFreezeCount - { - get - { - return Interop.Elementary.elm_object_tooltip_move_freeze_get(RealHandle); - } - } - - /// - /// Sets or gets whether an Evas object is to freeze (discard) events. - /// - public bool AllEventsFrozen - { - get - { - var result = Interop.Evas.evas_object_freeze_events_get(Handle); - Debug.Assert(Handle == RealHandle || result == Interop.Evas.evas_object_freeze_events_get(RealHandle)); - return result; - } - set - { - if (Handle != RealHandle) - { - Interop.Evas.evas_object_freeze_events_set(RealHandle, value); - } - Interop.Evas.evas_object_freeze_events_set(Handle, value); - } - } - - /// - /// Sets or gets the layer of its canvas that the given object will be part of. - /// - public virtual int Layer - { - get - { - return Interop.Evas.evas_object_layer_get(Handle); - } - set - { - Interop.Evas.evas_object_layer_set(Handle, value); - } - } - - /// - /// Clips one object to another. - /// - /// The object to clip object by - public void SetClip(EvasObject clip) - { - Interop.Evas.evas_object_clip_set(Handle, clip); - } - - /// - /// Sets the hints for an object's alignment. - /// - /// The horizontal alignment hint as double value ranging from 0.0 to 1.0,The default alignment hint value is 0.5 - /// The vertical alignment hint as double value ranging from 0.0 to 1.0,The default alignment hint value is 0.5 - public void SetAlignment(double x, double y) - { - Interop.Evas.evas_object_size_hint_align_set(Handle, x, y); - } - - /// - /// Sets the hints for an object's weight. - /// - /// The non-negative double value to use as horizontal weight hint - /// The non-negative double value to use as vertical weight hint - public void SetWeight(double x, double y) - { - Interop.Evas.evas_object_size_hint_weight_set(Handle, x, y); - } - - /// - /// Sets the text for an object's tooltip. - /// - /// The text value to display inside the tooltip - public void SetTooltipText(string text) - { - Interop.Elementary.elm_object_tooltip_text_set(RealHandle, text); - } - - /// - /// Unsets an object's tooltip. - /// - public void UnsetTooltip() - { - Interop.Elementary.elm_object_tooltip_unset(RealHandle); - } - - /// - /// This increments the tooltip movement freeze count by one. - /// If the count is more than 0, the tooltip position will be fixed. - /// - public void PushTooltipMoveFreeze() - { - Interop.Elementary.elm_object_tooltip_move_freeze_push(RealHandle); - } - - /// - /// This decrements the tooltip freeze count by one. - /// - public void PopTooltipMoveFreeze() - { - Interop.Elementary.elm_object_tooltip_move_freeze_pop(RealHandle); - } - - /// - /// Force hide tooltip of object. - /// - public void HideTooltip() - { - Interop.Elementary.elm_object_tooltip_hide(RealHandle); - } - - /// - /// Force show tooltip of object. - /// - public void ShowTooltip() - { - Interop.Elementary.elm_object_tooltip_show(RealHandle); - } - - /// - /// Makes the current object visible. - /// - public void Show() - { - Interop.Evas.evas_object_show(Handle); - } - - /// - /// Makes the current object invisible. - /// - public void Hide() - { - Interop.Evas.evas_object_hide(Handle); - } - - /// - /// Changes the size of the current object. - /// - /// The new width - /// The new height - public void Resize(int w, int h) - { - Interop.Evas.evas_object_resize(Handle, w, h); - } - - /// - /// Moves the current object to the given location. - /// - /// The X position to move the object to. - /// The Y position to move the object to. - public void Move(int x, int y) - { - Interop.Evas.evas_object_move(Handle, x, y); - } - - /// - /// Lowers obj to the bottom of its layer. - /// - public void Lower() - { - Interop.Evas.evas_object_lower(Handle); - } - - /// - /// Define IntPtr operator - /// - /// Parent object - public static implicit operator IntPtr(EvasObject obj) - { - if (obj == null) - return IntPtr.Zero; - return obj.Handle; - } - - /// - /// Requests keyname key events be directed to current obj. - /// - /// The key to request events for - /// Set TRUE to request that the obj is the only object receiving the keyname events,otherwise set FALSE - /// If the call succeeded is true,otherwise is false - public bool KeyGrab(string keyname, bool exclusive) - { - return Interop.Evas.evas_object_key_grab(Handle, keyname, 0, 0, exclusive); - } - - /// - /// Removes the grab on keyname key events. - /// - /// The key the grab is set for - public void KeyUngrab(string keyname) - { - Interop.Evas.evas_object_key_ungrab(Handle, keyname, 0, 0); - } - - /// - /// Mark smart object as changed. - /// - public void MarkChanged() - { - Interop.Evas.evas_object_smart_changed(RealHandle); - } - - /// - /// Call the calculate smart function immediately. - /// This will force immediate calculations needed for renderization of this object. - /// - public void Calculate() - { - Interop.Evas.evas_object_smart_calculate(RealHandle); - } - - /// - /// Sets the hints for an object's aspect ratio. - /// - /// The policy or type of aspect ratio to apply to object - /// The integer to use as aspect width ratio term - /// The integer to use as aspect height ratio term - public void SetSizeHintAspect(AspectControl aspect, int w, int h) - { - Interop.Evas.evas_object_size_hint_aspect_set(Handle, (int)aspect, w, h); - } - - /// - /// Gets the hints for an object's aspect ratio. - /// - /// The policy or type of aspect ratio to apply to object - /// The integer to use as aspect width ratio term - /// The integer to use as aspect height ratio term - public void GetSizeHintAspect(out AspectControl aspect, out int w, out int h) - { - int aspectRatio; - Interop.Evas.evas_object_size_hint_aspect_get(Handle, out aspectRatio, out w, out h); - aspect = (AspectControl)aspectRatio; - } - - /// - /// Stack immediately below anchor. - /// - /// The object below which to stack. - public void StackBelow(EvasObject anchor) - { - Interop.Evas.evas_object_stack_below(Handle, anchor); - } - - /// - /// Stack immediately above anchor. - /// - /// The object above which to stack. - public void StackAbove(EvasObject anchor) - { - Interop.Evas.evas_object_stack_above(Handle, anchor); - } - - /// - /// Raise to the top of its layer. - /// - public void RaiseTop() - { - Interop.Evas.evas_object_raise(Handle); - } - - /// - /// Get the geometry of a line number. - /// - /// the line number. - /// x coord of the line. - /// y coord of the line. - /// w coord of the line. - /// h coord of the line. - /// - public bool GetTextBlockGeometryByLineNumber(int lineNumber, out int x, out int y, out int w, out int h) - { - return Interop.Evas.evas_object_textblock_line_number_geometry_get(RealHandle, lineNumber, out x, out y, out w, out h); - } - - internal IntPtr GetData(string key) - { - return Interop.Evas.evas_object_data_get(RealHandle, key); - } - - internal void SetData(string key, IntPtr data) - { - Interop.Evas.evas_object_data_set(RealHandle, key, data); - } - - internal IntPtr DeleteData(string key) - { - return Interop.Evas.evas_object_data_del(RealHandle, key); - } - - /// - /// The callback of Invalidate Event - /// - protected virtual void OnInvalidate() - { - } - - /// - /// The callback of Instantiated Event - /// - protected virtual void OnInstantiated() - { - } - - /// - /// The callback of Realized Event - /// - protected virtual void OnRealized() - { - } - - /// - /// The callback of Unrealize Event - /// - protected virtual void OnUnrealize() - { - } - - /// - /// Creates a widget handle. - /// - /// Parent EvasObject - /// Handle IntPtr - protected abstract IntPtr CreateHandle(EvasObject parent); - - /// - /// For this object bind Parent object.Init handle and all kinds of EvasObjectEvent. - /// - /// Parent object - public void Realize(EvasObject parent) - { - if (!IsRealized) - { - Parent = parent; - Handle = CreateHandle(parent); - Debug.Assert(Handle != IntPtr.Zero); - - (parent as Window)?.AddChild(this); - - OnRealized(); - _deleted = new EvasObjectEvent(this, EvasObjectCallbackType.Del); - _keydown = new EvasObjectEvent(this, RealHandle, EvasObjectCallbackType.KeyDown, EvasKeyEventArgs.Create); - _keyup = new EvasObjectEvent(this, RealHandle, EvasObjectCallbackType.KeyUp, EvasKeyEventArgs.Create); - _moved = new EvasObjectEvent(this, EvasObjectCallbackType.Move); - _resized = new EvasObjectEvent(this, EvasObjectCallbackType.Resize); - - _deleted.On += (s, e) => MakeInvalidate(); - _keydown.On += (s, e) => KeyDown?.Invoke(this, e); - _keyup.On += (s, e) => KeyUp?.Invoke(this, e); - } - } - - /// - /// Removes current object relationship with others. - /// - public void Unrealize() - { - if (IsRealized) - { - if (_renderPostCallback != null) - { - Interop.Evas.evas_event_callback_del(Interop.Evas.evas_object_evas_get(Handle), Interop.Evas.ObjectCallbackType.RenderPost, _renderPostCallback); - _renderPostCallback = null; - } - - OnUnrealize(); - IntPtr toBeDeleted = Handle; - Handle = IntPtr.Zero; - - DisposeEvent(); - - (Parent as Window)?.RemoveChild(this); - - Interop.Evas.evas_object_del(toBeDeleted); - Parent = null; - } - } - - private void MakeInvalidate() - { - Deleted?.Invoke(this, EventArgs.Empty); - OnInvalidate(); - Handle = IntPtr.Zero; - - MakeInvalidateEvent(); - - (Parent as Window)?.RemoveChild(this); - Parent = null; - _deleted = null; - } - - private void DisposeEvent() - { - foreach (var evt in _eventStore) - { - evt.Dispose(); - } - _eventStore.Clear(); - } - - private void MakeInvalidateEvent() - { - foreach (var evt in _eventStore) - { - evt.MakeInvalidate(); - } - _eventStore.Clear(); - } - - internal void AddToEventLifeTracker(IInvalidatable item) - { - _eventStore.Add(item); - } - } -} diff --git a/src/ElmSharp/ElmSharp/EvasObjectEvent.cs b/src/ElmSharp/ElmSharp/EvasObjectEvent.cs deleted file mode 100644 index 6799be300..000000000 --- a/src/ElmSharp/ElmSharp/EvasObjectEvent.cs +++ /dev/null @@ -1,446 +0,0 @@ -/* - * 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.Collections.Generic; -using System.ComponentModel; -using System.Linq; - -namespace ElmSharp -{ - /// - /// IInvalidatable is a interface which can be overrided by its children class. - /// Inherits IDisposable - /// - public interface IInvalidatable : IDisposable - { - void MakeInvalidate(); - } - - /// - /// Enumeration for EvasObjectCallbackType - /// - public enum EvasObjectCallbackType - { - /// - /// Mouse In Event CallbackType. - /// - MouseIn, - - /// - /// Mouse Out Event CallbackType - /// - MouseOut, - - /// - /// Mouse Button Down Event CallbackType - /// - MouseDown, - - /// - /// Mouse Button Up Event CallbackType - /// - MouseUp, - - /// - /// Mouse Move Event CallbackType - /// - MouseMove, - - /// - /// Mouse Wheel Event CallbackType - /// - MouseWheel, - - /// - /// Multi-touch Down Event CallbackType - /// - MultiDown, - - /// - /// Multi-touch Up Event CallbackType - /// - MultiUp, - - /// - /// Multi-touch Move Event CallbackType - /// - MultiMove, - - /// - /// Object Being Freed (Called after Del) - /// - Free, - - /// - /// Key Press Event CallbackType - /// - KeyDown, - - /// - /// Key Release Event CallbackType - /// - KeyUp, - - /// - /// Focus In Event CallbackType - /// - FocusIn, - - /// - /// Focus Out Event CallbackType - /// - FocusOut, - - /// - /// Show Event CallbackType - /// - Show, - - /// - /// Hide Event CallbackType - /// - Hide, - - /// - /// Move Event CallbackType - /// - Move, - - /// - /// Resize Event CallbackType - /// - Resize, - - /// - /// Restack Event CallbackType - /// - Restack, - - /// - /// Object Being Deleted (called before Free) - /// - Del, - - /// - /// Hold Event CallbackType, Informational purpose event to indicate something - /// - Hold, - - /// - /// Size hints changed Event CallbackType - /// - ChangedSizeHints, - - /// - /// Image has been preloaded - /// - ImagePreloaded, - - /// - /// Canvas got focus as a whole - /// - CanvasFocusIn, - - /// - /// Canvas lost focus as a whole - /// - CanvasFocusOut, - - /// - /// Called just before rendering is updated on the canvas target - /// - RenderFlushPre, - - /// - /// Called just after rendering is updated on the canvas target - /// - RenderFlushPost, - - /// - /// Canvas object got focus - /// - CanvasObjectFocusIn, - - /// - /// Canvas object lost focus - /// - CanvasObjectFocusOut, - - /// - /// Image data has been unloaded (by some mechanism in Evas that throw out original image data) - /// - ImageUnloaded, - - /// - /// Called just before rendering starts on the canvas target - /// - RenderPre, - - /// - /// Called just after rendering stops on the canvas target - /// - RenderPost, - - /// - /// Image size is changed - /// - ImageResize, - - /// - /// Devices added, removed or changed on canvas - /// - DeviceChanged, - - /// - /// Axis is changed - /// - AxisUpdate, - - /// - /// Canvas Viewport size is changed - /// - CanvasViewportResize - } - - /// - /// Event class for EvasObject - /// - /// Kinds of EventArgs - public class EvasObjectEvent : IInvalidatable where TEventArgs : EventArgs - { - /// - /// SmartEventInfoParser delegate of EvasObjectEvent class - /// - /// data - /// obj - /// info - /// delegate handle - public delegate TEventArgs SmartEventInfoParser(IntPtr data, IntPtr obj, IntPtr info); - - private bool _disposed = false; - private EvasObject _sender; - private IntPtr _handle; - private readonly EvasObjectCallbackType _type; - private readonly SmartEventInfoParser _parser; - private readonly List _nativeCallbacks = new List(); - - /// - /// Creates and initializes a new instance of the EvasObjectEvent. - /// - /// EvasObject class belong to - /// EvasObjectCallbackType - /// SmartEventInfoParser - public EvasObjectEvent(EvasObject sender, EvasObjectCallbackType type, SmartEventInfoParser parser) : this(sender, sender.Handle, type, parser) - { - } - - [EditorBrowsableAttribute(EditorBrowsableState.Never)] - public EvasObjectEvent(EvasObject sender, IntPtr handle, EvasObjectCallbackType type, SmartEventInfoParser parser) - { - _sender = sender; - _handle = handle; - _type = type; - _parser = parser; - sender.AddToEventLifeTracker(this); - } - - /// - /// Creates and initializes a new instance of the EvasObjectEvent. - /// - /// EvasObject class belong with - /// SmartEventInfoParser - public EvasObjectEvent(EvasObject sender, EvasObjectCallbackType type) : this(sender, type, null) - { - } - - ~EvasObjectEvent() - { - Dispose(false); - } - - private struct NativeCallback - { - public Interop.Evas.EventCallback callback; - public EventHandler eventHandler; - } - - /// - /// On Event Handler of EvasObjectEvent - /// - public event EventHandler On - { - add - { - if (_handle == IntPtr.Zero) - { - return; - } - EventHandler handler = value; - var cb = new Interop.Evas.EventCallback((data, evas, obj, info) => - { - TEventArgs ea = _parser == null ? (TEventArgs)EventArgs.Empty : _parser(data, obj, info); - handler(_sender, ea); - }); - _nativeCallbacks.Add(new NativeCallback { callback = cb, eventHandler = handler }); - int i = _nativeCallbacks.Count - 1; - Interop.Evas.evas_object_event_callback_add(_handle, (Interop.Evas.ObjectCallbackType)_type, _nativeCallbacks[i].callback, IntPtr.Zero); - } - - remove - { - if (_handle == IntPtr.Zero) - { - return; - } - EventHandler handler = value; - var callbacks = _nativeCallbacks.Where(cb => cb.eventHandler == handler); - foreach (var cb in callbacks) - { - Interop.Evas.evas_object_event_callback_del(_handle, (Interop.Evas.ObjectCallbackType)_type, cb.callback); - } - } - } - - protected virtual void Dispose(bool disposing) - { - if (!_disposed) - { - if (disposing) - { - // Place holder to dispose managed state (managed objects). - } - if (_handle != IntPtr.Zero) - { - foreach (var cb in _nativeCallbacks) - { - Interop.Evas.evas_object_event_callback_del(_handle, (Interop.Evas.ObjectCallbackType)_type, cb.callback); - } - } - _nativeCallbacks.Clear(); - _disposed = true; - } - } - - /// - /// Destroy Current Obj - /// - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - - /// - /// Make current instance invalidate - /// - public void MakeInvalidate() - { - _sender = null; - _handle = IntPtr.Zero; - } - } - - /// - /// Event class for EvasObject - /// - public class EvasObjectEvent : IInvalidatable - { - private EvasObjectEvent _evasObjectEvent; - - private event EventHandler _handlers; - - private bool _disposed = false; - - /// - /// Creates and initializes a new instance of the EvasObjectEvent. - /// - /// EvasObject class belong to - /// EvasObjectCallbackType - public EvasObjectEvent(EvasObject sender, EvasObjectCallbackType type) : this(sender, sender.Handle, type) - { - } - - [EditorBrowsableAttribute(EditorBrowsableState.Never)] - public EvasObjectEvent(EvasObject sender, IntPtr handle, EvasObjectCallbackType type) - { - _evasObjectEvent = new EvasObjectEvent(sender, handle, type, null); - } - - ~EvasObjectEvent() - { - Dispose(false); - } - - /// - /// On Event Handler of EvasObjectEvent - /// - public event EventHandler On - { - add - { - if (_handlers == null) - { - _evasObjectEvent.On += SendEvent; - } - _handlers += value; - } - - remove - { - _handlers -= value; - if (_handlers == null) - { - _evasObjectEvent.On -= SendEvent; - } - } - } - - private void SendEvent(object sender, EventArgs e) - { - _handlers?.Invoke(sender, e); - } - - protected virtual void Dispose(bool disposing) - { - if (!_disposed) - { - if (disposing) - { - _evasObjectEvent.Dispose(); - } - _disposed = true; - } - } - - /// - /// Destroy Current Obj - /// - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - - /// - /// Make current instance invalidate - /// - public void MakeInvalidate() - { - _evasObjectEvent.MakeInvalidate(); - } - } -} \ No newline at end of file diff --git a/src/ElmSharp/ElmSharp/FlipSelector.cs b/src/ElmSharp/ElmSharp/FlipSelector.cs deleted file mode 100755 index bffb71361..000000000 --- a/src/ElmSharp/ElmSharp/FlipSelector.cs +++ /dev/null @@ -1,193 +0,0 @@ -/* - * 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.Collections.Generic; - -namespace ElmSharp -{ - /// - /// A flip selector is a widget to show a set of text items,one at a time.with the same sheet switching style as the clock widget, when one changes the current displaying sheet. - /// - public class FlipSelector : Layout - { - SmartEvent _selected; - SmartEvent _overflowed; - SmartEvent _underflowed; - - /// - /// Creates and initializes a new instance of the FlipSelector. - /// - /// Parent EvasObject - public FlipSelector(EvasObject parent) : base(parent) - { - _selected = new SmartEvent(this, Handle, "selected"); - _overflowed = new SmartEvent(this, Handle, "overflowed"); - _underflowed = new SmartEvent(this, Handle, "underflowed"); - - _selected.On += SelectedChanged; - _overflowed.On += OverflowedChanged; - _underflowed.On += UnderflowedChanged; - } - - /// - /// Selected will be triggered when be Selected - /// - public event EventHandler Selected; - /// - /// Overflowed will be triggered when Overflowed - /// - public event EventHandler Overflowed; - /// - /// Underflowed will be triggered when be Underflowed - /// - public event EventHandler Underflowed; - - /// - /// Sets or gets the interval on time updates for an user mouse button hold on a flip selector widget. - /// - public double Interval - { - get - { - return Interop.Elementary.elm_flipselector_first_interval_get(Handle); - } - set - { - Interop.Elementary.elm_flipselector_first_interval_set(Handle, value); - } - } - - - /// - /// Gets the currently selected item in a flip selector widget. - /// - public FlipSelectorItem SelectedItem - { - get - { - IntPtr handle = Interop.Elementary.elm_flipselector_selected_item_get(Handle); - return ItemObject.GetItemByHandle(handle) as FlipSelectorItem; - } - } - - /// - /// Gets the first item in the given flip selector widget's list of items. - /// - public FlipSelectorItem FirstItem - { - get - { - IntPtr handle = Interop.Elementary.elm_flipselector_first_item_get(Handle); - return ItemObject.GetItemByHandle(handle) as FlipSelectorItem; - } - } - - /// - /// Gets the last item in the given flip selector widget's list of items. - /// - public FlipSelectorItem LastItem - { - get - { - IntPtr handle = Interop.Elementary.elm_flipselector_last_item_get(Handle); - return ItemObject.GetItemByHandle(handle) as FlipSelectorItem; - } - } - - /// - /// Appends a (text) item to a flip selector widget. - /// - /// text value - /// - /// A handle to the item added or NULL, on errors - /// - /// - /// The widget's list of labels to show will be appended with the given value. If the user wishes so, a callback function pointer can be passed, which will get called when this same item is selected. - /// - public FlipSelectorItem Append(string text) - { - FlipSelectorItem item = new FlipSelectorItem(text); - item.Handle = Interop.Elementary.elm_flipselector_item_append(Handle, text, null, (IntPtr)item.Id); - return item; - } - - /// - /// Prepend a (text) item to a flip selector widget. - /// - /// Prepend text - /// A handle to the item added or NULL, on errors - /// - /// The widget's list of labels to show will be prepended with the given value. If the user wishes so, a callback function pointer can be passed, which will get called when this same item is selected. - /// - public FlipSelectorItem Prepend(string text) - { - FlipSelectorItem item = new FlipSelectorItem(text); - item.Handle = Interop.Elementary.elm_flipselector_item_prepend(Handle, text, null, (IntPtr)item.Id); - return item; - } - - /// - /// To remove the given item. - /// - /// FlipSelector's item - public void Remove(FlipSelectorItem item) - { - if (item as FlipSelectorItem != null) - item.Delete(); - } - - /// - /// Programmatically select the next item of a flip selector widget. - /// - /// - /// The selection will be animated. Also, if it reaches the beginning of its list of member items, it will continue with the last one backwards. - /// - public void Next() - { - Interop.Elementary.elm_flipselector_flip_next(Handle); - } - - /// - /// Programmatically select the previous item of a flip selector widget. - /// - public void Prev() - { - Interop.Elementary.elm_flipselector_flip_prev(Handle); - } - - protected override IntPtr CreateHandle(EvasObject parent) - { - return Interop.Elementary.elm_flipselector_add(parent.Handle); - } - - void SelectedChanged(object sender, EventArgs e) - { - SelectedItem?.SendSelected(); - Selected?.Invoke(this, EventArgs.Empty); - } - - void OverflowedChanged(object sender, EventArgs e) - { - Overflowed?.Invoke(this, e); - } - - void UnderflowedChanged(object sender, EventArgs e) - { - Underflowed?.Invoke(this, e); - } - } -} diff --git a/src/ElmSharp/ElmSharp/FlipSelectorItem.cs b/src/ElmSharp/ElmSharp/FlipSelectorItem.cs deleted file mode 100755 index 3210e3b01..000000000 --- a/src/ElmSharp/ElmSharp/FlipSelectorItem.cs +++ /dev/null @@ -1,50 +0,0 @@ -/* - * 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 ElmSharp -{ - /// - /// Iterm class of FlipSelector - /// - public class FlipSelectorItem : ItemObject - { - /// - /// Sets or gets the Text of FlipSelectorItem - /// - public string Text { get; private set; } - - /// - /// Selected will be triggered when Selected - /// - public event EventHandler Selected; - - /// - /// Creates and initializes a new instance of the FlipSelectorItem. - /// - /// FlipSelectorItem's text - public FlipSelectorItem(string text) : base(IntPtr.Zero) - { - Text = text; - } - - internal void SendSelected() - { - Selected?.Invoke(this, EventArgs.Empty); - } - } -} diff --git a/src/ElmSharp/ElmSharp/FloatingButton.cs b/src/ElmSharp/ElmSharp/FloatingButton.cs deleted file mode 100755 index 5252a1f55..000000000 --- a/src/ElmSharp/ElmSharp/FloatingButton.cs +++ /dev/null @@ -1,160 +0,0 @@ -/* - * 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 ElmSharp -{ - /// - /// The FloatingButton is a widget that to add floating area for buttons. - /// - public class FloatingButton : Layout - { - /// - /// Creates and initializes a new instance of the FloatingButton class. - /// - /// Created on this parent container.. - public FloatingButton(EvasObject parent) : base(parent) - { - } - - /// - /// Sets or gets floatingbutton mode. - /// - public FloatingButtonMode Mode - { - get - { - return (FloatingButtonMode)Interop.Eext.eext_floatingbutton_mode_get(Handle); - } - set - { - Interop.Eext.eext_floatingbutton_mode_set(Handle, (int)value); - } - } - - /// - /// Gets floatingbutton Position. - /// - public FloatingButtonPosition Position - { - get - { - return (FloatingButtonPosition)Interop.Eext.eext_floatingbutton_pos_get(Handle); - } - } - - /// - /// Sets or gets movability for a given floatingbutton widget. - /// - public bool MovementBlock - { - get - { - return Interop.Eext.eext_floatingbutton_movement_block_get(Handle); - } - set - { - Interop.Eext.eext_floatingbutton_movement_block_set(Handle, value); - } - } - - /// - /// Get Opacity's value of the given FloatingButton. - /// - public override int Opacity - { - get - { - return Color.Default.A; - } - - set - { - Console.WriteLine("FloatingButton instance doesn't support to set Opacity."); - } - } - - /// - /// Set the floatingbutton position with animation or not. - /// - /// Button position - /// Animat flag - public void SetPosition(FloatingButtonPosition position, bool animated) - { - if (animated) - { - Interop.Eext.eext_floatingbutton_pos_bring_in(Handle, (int)position); - } - else - { - Interop.Eext.eext_floatingbutton_pos_set(Handle, (int)position); - } - } - - protected override IntPtr CreateHandle(EvasObject parent) - { - return Interop.Eext.eext_floatingbutton_add(parent.Handle); - } - } - - /// - /// Enumeration for FloatingButtonMode - /// - public enum FloatingButtonMode - { - /// - /// Allows all positions - /// - All, - - /// - /// Allows LEFT and RIGHT positions only - /// - LeftRightOnly, - } - - /// - /// Enumeration for FloatingButtonPosition - /// - public enum FloatingButtonPosition - { - /// - /// Hides in the left, but small handler will show only - /// - LeftOut, - - /// - /// Shows all of buttons, but lies on the left - /// - Left, - - /// - /// Shows all of buttons, but lies on the center - /// - Center, - - /// - /// Shows all of buttons, but lies on the right - /// - Right, - - /// - /// Hides in the right, but small handler will show only - /// - RightOut, - } -} \ No newline at end of file diff --git a/src/ElmSharp/ElmSharp/GenGrid.cs b/src/ElmSharp/ElmSharp/GenGrid.cs deleted file mode 100644 index 961600839..000000000 --- a/src/ElmSharp/ElmSharp/GenGrid.cs +++ /dev/null @@ -1,606 +0,0 @@ -/* - * 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.Collections.Generic; - -namespace ElmSharp -{ - /// - /// It inherits System.EventArgs. - /// It contains Item which is type. - /// All events of GenGrid contain GenGridItemEventArgs as a parameter. - /// - public class GenGridItemEventArgs : EventArgs - { - /// - /// Gets or sets GenGrid item.The return type is . - /// - public GenGridItem Item { get; set; } - - internal static GenGridItemEventArgs CreateFromSmartEvent(IntPtr data, IntPtr obj, IntPtr info) - { - GenGridItem item = ItemObject.GetItemByHandle(info) as GenGridItem; - return new GenGridItemEventArgs() { Item = item }; - } - } - - /// - /// It inherits . - /// The GenGrid is a widget that aims to position objects in a grid layout while actually creating and rendering only the visible ones. - /// It has two direction in which a given GenGrid widget expands while placing its items, horizontal and vertical. - /// The GenGrid items are represented through definition field details. - /// - public class GenGrid : Layout - { - HashSet _children = new HashSet(); - - SmartEvent _selected; - SmartEvent _unselected; - SmartEvent _activated; - SmartEvent _pressed; - SmartEvent _released; - SmartEvent _doubleClicked; - SmartEvent _realized; - SmartEvent _unrealized; - SmartEvent _longpressed; - SmartEvent _changed; - - /// - /// Creates and initializes a new instance of the GenGrid class. - /// - /// The parent is a given container which will be attached by GenGrid as a child. It's type. - public GenGrid(EvasObject parent) : base(parent) - { - InitializeSmartEvent(); - } - - /// - /// ItemSelected is raised when a new gengrid item is selected. - /// - public event EventHandler ItemSelected; - - /// - /// ItemUnselected is raised when the gengrid item is Unselected. - /// - public event EventHandler ItemUnselected; - - /// - /// ItemPressed is raised when a new gengrid item is pressed. - /// - public event EventHandler ItemPressed; - - /// - /// ItemReleased is raised when a new gengrid item is released. - /// - public event EventHandler ItemReleased; - - /// - /// ItemActivated is raised when a new gengrid item is double clicked or pressed (enter|return|spacebar). - /// - public event EventHandler ItemActivated; - - /// - /// ItemDoubleClicked is raised when a new gengrid item is double clicked. - /// - public event EventHandler ItemDoubleClicked; - - /// - /// ItemRealized is raised when a gengrid item is implementing through . - /// - public event EventHandler ItemRealized; - - /// - /// ItemUnrealized is raised when the gengrid item is deleted. - /// - public event EventHandler ItemUnrealized; - - /// - /// ItemLongPressed is raised when a gengrid item is pressed for a certain amount of time. By default it's 1 second. - /// - public event EventHandler ItemLongPressed; - - /// - /// Changed is raised when an item is added, removed, resized or moved and when the gengrid is resized or gets "horizontal" property changes. - /// - public event EventHandler Changed; - - /// - /// Gets or sets the item's grid alignment along x-axis within a given gengrid widget. - /// Accepted values are in the 0.0 to 1.0 range, with the special value -1.0 used to specify "justify" or "fill" by some users. - /// By default, value is 0.0, meaning that the gengrid has its items grid placed exactly in the left along x-axis. - /// - public double ItemAlignmentX - { - get - { - double align; - Interop.Elementary.elm_gengrid_align_get(RealHandle, out align, IntPtr.Zero); - return align; - } - set - { - double aligny = ItemAlignmentY; - Interop.Elementary.elm_gengrid_align_set(RealHandle, value, aligny); - } - } - - /// - /// Gets or sets the item's grid alignment on y-axis within a given gengrid widget. - /// Accepted values are in the 0.0 to 1.0 range, with the special value -1.0 used to specify "justify" or "fill" by some users. - /// By default, value is 0.0, meaning that the gengrid has its items grid placed exactly in the top along y-axis. - /// - public double ItemAlignmentY - { - get - { - double align; - Interop.Elementary.elm_gengrid_align_get(RealHandle, IntPtr.Zero, out align); - return align; - } - set - { - double alignx = ItemAlignmentX; - Interop.Elementary.elm_gengrid_align_set(RealHandle, alignx, value); - } - } - - /// - /// Gets or sets the manner in which the items grid is filled within a given gengrid widget. - /// It is filled if true, otherwise false. - /// - public bool FillItems - { - get - { - return Interop.Elementary.elm_gengrid_filled_get(RealHandle); - } - set - { - Interop.Elementary.elm_gengrid_filled_set(RealHandle, value); - } - } - - /// - /// Gets or sets whether multi-selection is enabled or disabled for a given gengrid widget. - /// - /// - /// Multi-selection is the ability to have more than one item selected, on a given gengrid, simultaneously. - /// When it is enabled, a sequence of clicks on different items makes them all selected, progressively. - /// A click on an already selected item unselects it. If interacting via the keyboard, multi-selection is enabled while holding the "Shift" key. - /// By default, multi-selection is disabled. - /// - public bool MultipleSelection - { - get - { - return Interop.Elementary.elm_gengrid_multi_select_get(RealHandle); - } - set - { - Interop.Elementary.elm_gengrid_multi_select_set(RealHandle, value); - } - } - - /// - /// Gets or sets the width for the items of a given gengrid widget. - /// - /// - /// A gengrid, after creation, still has no information on the size to give to each of its cells. - /// The default width and height just have one finger wide. - /// Use this property to force a custom width for your items, making them as big as you wish. - /// - public int ItemWidth - { - get - { - int width; - Interop.Elementary.elm_gengrid_item_size_get(RealHandle, out width, IntPtr.Zero); - return width; - } - set - { - int height = ItemHeight; - Interop.Elementary.elm_gengrid_item_size_set(RealHandle, value, height); - } - } - - /// - /// Gets or sets the height for the items of a given gengrid widget. - /// - /// - /// A gengrid, after creation, still has no information on the size to give to each of its cells. - /// The default width and height just have one finger wide. - /// Use this property to force a custom height for your items, making them as big as you wish. - /// - public int ItemHeight - { - get - { - int height; - Interop.Elementary.elm_gengrid_item_size_get(RealHandle, IntPtr.Zero, out height); - return height; - } - set - { - int width = ItemWidth; - Interop.Elementary.elm_gengrid_item_size_set(RealHandle, width, value); - } - } - - /// - /// Gets or sets the gengrid select mode by . - /// - public GenItemSelectionMode SelectionMode - { - get - { - return (GenItemSelectionMode)Interop.Elementary.elm_gengrid_select_mode_get(RealHandle); - } - set - { - Interop.Elementary.elm_gengrid_select_mode_set(RealHandle, (int)value); - } - } - - /// - /// Gets or sets the direction for which a given gengrid widget expands while placing its items. - /// - /// - /// If true, items are placed in columns from top to bottom and when the space for a column is filled, another one is started on the right, thus expanding the grid horizontally. - /// If false, items are placed in rows from left to right, and when the space for a row is filled, another one is started below, thus expanding the grid vertically. - /// - public bool IsHorizontal - { - get - { - return Interop.Elementary.elm_gengrid_horizontal_get(RealHandle); - } - set - { - Interop.Elementary.elm_gengrid_horizontal_set(RealHandle, value); - } - } - - /// - /// Gets or sets whether the gengrid items should be highlighted when an item is selected. - /// - public bool IsHighlight - { - get - { - return Interop.Elementary.elm_gengrid_highlight_mode_get(RealHandle); - } - set - { - Interop.Elementary.elm_gengrid_highlight_mode_set(RealHandle, value); - } - } - - /// - /// Sets or gets the value of HorizontalScrollBarVisiblePolicy - /// - /// - /// ScrollBarVisiblePolicy.Auto means the horizontal scrollbar is made visible if it is needed, and otherwise kept hidden. - /// ScrollBarVisiblePolicy.Visible turns it on all the time, and ScrollBarVisiblePolicy.Invisible always keeps it off. - /// - public ScrollBarVisiblePolicy HorizontalScrollBarVisiblePolicy - { - get - { - int policy; - Interop.Elementary.elm_scroller_policy_get(RealHandle, out policy, IntPtr.Zero); - return (ScrollBarVisiblePolicy)policy; - } - set - { - ScrollBarVisiblePolicy v = VerticalScrollBarVisiblePolicy; - Interop.Elementary.elm_scroller_policy_set(RealHandle, (int)value, (int)v); - } - } - - /// - /// Sets or gets the value of VerticalScrollBarVisiblePolicy - /// - /// - /// ScrollBarVisiblePolicy.Auto means the vertical scrollbar is made visible if it is needed, and otherwise kept hidden. - /// ScrollBarVisiblePolicy.Visible turns it on all the time, and ScrollBarVisiblePolicy.Invisible always keeps it off. - /// - public ScrollBarVisiblePolicy VerticalScrollBarVisiblePolicy - { - get - { - int policy; - Interop.Elementary.elm_scroller_policy_get(RealHandle, IntPtr.Zero, out policy); - return (ScrollBarVisiblePolicy)policy; - } - set - { - ScrollBarVisiblePolicy h = HorizontalScrollBarVisiblePolicy; - Interop.Elementary.elm_scroller_policy_set(RealHandle, (int)h, (int)value); - } - } - - /// - /// Gets the first item in a given gengrid widget. - /// - public GenGridItem FirstItem - { - get - { - IntPtr handle = Interop.Elementary.elm_gengrid_first_item_get(RealHandle); - return ItemObject.GetItemByHandle(handle) as GenGridItem; - } - } - - /// - /// Gets the last item in a given gengrid widget. - /// - public GenGridItem LastItem - { - get - { - IntPtr handle = Interop.Elementary.elm_gengrid_last_item_get(RealHandle); - return ItemObject.GetItemByHandle(handle) as GenGridItem; - } - } - - /// - /// Gets the items count in a given gengrid widget. - /// - public uint ItemCount - { - get - { - return Interop.Elementary.elm_gengrid_items_count(RealHandle); - } - } - - /// - /// Gets the selected item in a given gengrid widget. - /// - public GenGridItem SelectedItem - { - get - { - IntPtr handle = Interop.Elementary.elm_gengrid_selected_item_get(RealHandle); - return ItemObject.GetItemByHandle(handle) as GenGridItem; - } - } - - /// - /// Gets or sets whether a given gengrid widget is or not able have items reordered. - /// - public bool ReorderMode - { - get - { - return Interop.Elementary.elm_gengrid_reorder_mode_get(RealHandle); - } - set - { - Interop.Elementary.elm_gengrid_reorder_mode_set(RealHandle, value); - } - } - - /// - /// Appends a new item to a given gengrid widget. This adds an item to the end of the gengrid. - /// - /// The itemClass defines how to display the data. - /// The item data. - /// Return a gengrid item that contains data and itemClass. - /// - /// - public GenGridItem Append(GenItemClass itemClass, object data) - { - GenGridItem item = new GenGridItem(data, itemClass); - IntPtr handle = Interop.Elementary.elm_gengrid_item_append(RealHandle, itemClass.UnmanagedPtr, (IntPtr)item.Id, null, (IntPtr)item.Id); - item.Handle = handle; - AddInternal(item); - return item; - } - - /// - /// Prepends a new item to a given gengrid widget. This adds an item to the beginning of the gengrid. - /// - /// The itemClass defines how to display the data. - /// The item data. - /// Return a gengrid item that contains data and itemClass. - /// - /// - public GenGridItem Prepend(GenItemClass itemClass, object data) - { - GenGridItem item = new GenGridItem(data, itemClass); - IntPtr handle = Interop.Elementary.elm_gengrid_item_prepend(RealHandle, itemClass.UnmanagedPtr, (IntPtr)item.Id, null, (IntPtr)item.Id); - item.Handle = handle; - AddInternal(item); - return item; - } - - /// - /// Inserts an item before another in a gengrid widget. This inserts an item before another in the gengrid. - /// - /// The itemClass defines how to display the data. - /// The item data. - /// The item before which to place this new one. - /// Return a gengrid item that contains data and itemClass./> - /// - /// - public GenGridItem InsertBefore(GenItemClass itemClass, object data, GenGridItem before) - { - GenGridItem item = new GenGridItem(data, itemClass); - IntPtr handle = Interop.Elementary.elm_gengrid_item_insert_before(RealHandle, itemClass.UnmanagedPtr, (IntPtr)item.Id, before, null, (IntPtr)item.Id); - item.Handle = handle; - AddInternal(item); - return item; - } - - /// - /// Inserts an item before another in a gengrid widget. This inserts an item after another in the gengrid. - /// - /// The itemClass defines how to display the data. - /// The item data. - /// The item after which to place this new one. - /// Return a gengrid item that contains data and itemClass. - /// - /// - public GenGridItem InsertAfter(GenItemClass itemClass, object data, GenGridItem after) - { - GenGridItem item = new GenGridItem(data, itemClass); - IntPtr handle = Interop.Elementary.elm_gengrid_item_insert_after(RealHandle, itemClass.UnmanagedPtr, (IntPtr)item.Id, after, null, (IntPtr)item.Id); - item.Handle = handle; - AddInternal(item); - return item; - } - - /// - /// Insert an item in a gengrid widget using a user-defined sort function. - /// - /// The itemClass defines how to display the data. - /// The item data. - /// User defined comparison function that defines the sort order based on gengrid item and its data. - /// Return a gengrid item that contains data and itemClass. - public GenGridItem InsertSorted(GenItemClass itemClass, object data, Comparison comparison) - { - GenGridItem item = new GenGridItem(data, itemClass); - - Interop.Elementary.Eina_Compare_Cb compareCallback = (handle1, handle2) => - { - GenGridItem first = (ItemObject.GetItemByHandle(handle1) as GenGridItem) ?? item; - GenGridItem second = (ItemObject.GetItemByHandle(handle2) as GenGridItem) ?? item; - return comparison(first.Data, second.Data); - }; - - IntPtr handle = Interop.Elementary.elm_gengrid_item_sorted_insert(RealHandle, itemClass.UnmanagedPtr, (IntPtr)item.Id, compareCallback, null, (IntPtr)item.Id); - item.Handle = handle; - AddInternal(item); - return item; - } - - /// - /// Shows a given item to the visible area of a gengrid. - /// - /// The gengrid item to display. - /// The position of the item in the viewport. - /// The type of how to show the item. - /// - /// If animated is true, the gengrid shows item by scrolling if it's not fully visible. - /// If animated is false, the gengrid shows item by jumping if it's not fully visible. - /// - /// - public void ScrollTo(GenGridItem item, ScrollToPosition position, bool animated) - { - if (animated) - { - Interop.Elementary.elm_gengrid_item_bring_in(item.Handle, (int)position); - } - else - { - Interop.Elementary.elm_gengrid_item_show(item.Handle, (int)position); - } - } - - /// - /// Updates the contents of all the realized items. - /// This updates all realized items by calling all the again to get the content, text, and states. - /// Use this when the original item data has changed and the changes are desired to reflect. - /// - /// - /// to update just one item. - /// - public void UpdateRealizedItems() - { - Interop.Elementary.elm_gengrid_realized_items_update(RealHandle); - } - - /// - /// Removes all items from a given gengrid widget. - /// This removes(and deletes) all items in obj, making it empty. - /// - /// - /// to delete just one item. - /// - public void Clear() - { - Interop.Elementary.elm_gengrid_clear(RealHandle); - } - - /// - /// Get the item that is at the x, y canvas coords. - /// - /// The input x coordinate - /// The input y coordinate - /// The position relative to the item returned here. - /// -1, 0 or 1, depending if the coordinate is on the left portion of that item(-1), on the middle section(0) or on the right part(1). - /// - /// The position relative to the item returned here - /// -1, 0 or 1, depending if the coordinate is on the upper portion of that item (-1), on the middle section (0) or on the lower part (1). - /// - /// - public GenGridItem GetItemByPosition(int x, int y, out int portionX, out int portionY) - { - IntPtr handle = Interop.Elementary.elm_gengrid_at_xy_item_get(RealHandle, x, y, out portionX, out portionY); - return ItemObject.GetItemByHandle(handle) as GenGridItem; - } - - protected override IntPtr CreateHandle(EvasObject parent) - { - IntPtr handle = Interop.Elementary.elm_layout_add(parent.Handle); - Interop.Elementary.elm_layout_theme_set(handle, "layout", "elm_widget", "default"); - - RealHandle = Interop.Elementary.elm_gengrid_add(handle); - Interop.Elementary.elm_object_part_content_set(handle, "elm.swallow.content", RealHandle); - - return handle; - } - - void InitializeSmartEvent() - { - _selected = new SmartEvent(this, this.RealHandle, "selected", GenGridItemEventArgs.CreateFromSmartEvent); - _unselected = new SmartEvent(this, this.RealHandle, "unselected", GenGridItemEventArgs.CreateFromSmartEvent); - _activated = new SmartEvent(this, this.RealHandle, "activated", GenGridItemEventArgs.CreateFromSmartEvent); - _pressed = new SmartEvent(this, this.RealHandle, "pressed", GenGridItemEventArgs.CreateFromSmartEvent); - _released = new SmartEvent(this, this.RealHandle, "released", GenGridItemEventArgs.CreateFromSmartEvent); - _doubleClicked = new SmartEvent(this, this.RealHandle, "clicked,double", GenGridItemEventArgs.CreateFromSmartEvent); - _realized = new SmartEvent(this, this.RealHandle, "realized", GenGridItemEventArgs.CreateFromSmartEvent); - _unrealized = new SmartEvent(this, this.RealHandle, "unrealized", GenGridItemEventArgs.CreateFromSmartEvent); - _longpressed = new SmartEvent(this, this.RealHandle, "longpressed", GenGridItemEventArgs.CreateFromSmartEvent); - _changed = new SmartEvent(this, this.RealHandle, "changed"); - - _selected.On += (s, e) => { if (e.Item != null) ItemSelected?.Invoke(this, e); }; - _unselected.On += (s, e) => { if (e.Item != null) ItemUnselected?.Invoke(this, e); }; - _activated.On += (s, e) => { if (e.Item != null) ItemActivated?.Invoke(this, e); }; - _pressed.On += (s, e) => { if (e.Item != null) ItemPressed?.Invoke(this, e); }; - _released.On += (s, e) => { if (e.Item != null) ItemReleased?.Invoke(this, e); }; - _doubleClicked.On += (s, e) => { if (e.Item != null) ItemDoubleClicked?.Invoke(this, e); }; - _realized.On += (s, e) => { if (e.Item != null) ItemRealized?.Invoke(this, e); }; - _unrealized.On += (s, e) => { if (e.Item != null) ItemUnrealized?.Invoke(this, e); }; - _longpressed.On += (s, e) => { if (e.Item != null) ItemLongPressed?.Invoke(this, e); }; - _changed.On += (s, e) => { Changed?.Invoke(this, e); }; - } - - void AddInternal(GenGridItem item) - { - _children.Add(item); - item.Deleted += Item_Deleted; - } - - void Item_Deleted(object sender, EventArgs e) - { - _children.Remove((GenGridItem)sender); - } - } -} \ No newline at end of file diff --git a/src/ElmSharp/ElmSharp/GenGridItem.cs b/src/ElmSharp/ElmSharp/GenGridItem.cs deleted file mode 100644 index afdede04a..000000000 --- a/src/ElmSharp/ElmSharp/GenGridItem.cs +++ /dev/null @@ -1,183 +0,0 @@ -/* - * 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.ComponentModel; - -namespace ElmSharp -{ - /// - /// It inherits . - /// A instance to the gengrid item added. - /// It contains Update() method to update a gengrid item which is given. - /// - public class GenGridItem : GenItem - { - internal GenGridItem(object data, GenItemClass itemClass) : base(data, itemClass) - { - } - - /// - /// Gets or sets whether a given gengrid item is selected. - /// If one gengrid item is selected, any other previously selected items get unselected in favor of this new one. - /// - /// - /// If true, it is selected. - /// If false, it is unselected. - /// - public override bool IsSelected - { - get - { - return Interop.Elementary.elm_gengrid_item_selected_get(Handle); - } - set - { - Interop.Elementary.elm_gengrid_item_selected_set(Handle, value); - } - } - - [EditorBrowsable(EditorBrowsableState.Never)] - public override string Cursor - { - get - { - return Interop.Elementary.elm_gengrid_item_cursor_get(Handle); - } - set - { - if (!string.IsNullOrEmpty(value)) - { - Interop.Elementary.elm_gengrid_item_cursor_set(Handle, value); - } - else - { - Interop.Elementary.elm_gengrid_item_cursor_unset(Handle); - } - } - } - - [EditorBrowsable(EditorBrowsableState.Never)] - public override string CursorStyle - { - get - { - return Interop.Elementary.elm_gengrid_item_cursor_style_get(Handle); - } - set - { - Interop.Elementary.elm_gengrid_item_cursor_style_set(Handle, value); - } - } - - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool IsUseEngineCursor - { - get - { - return Interop.Elementary.elm_gengrid_item_cursor_engine_only_get(Handle); - } - set - { - Interop.Elementary.elm_gengrid_item_cursor_engine_only_set(Handle, value); - } - } - - /// - /// Gets or sets the style of given gengrid item's tooltip. - /// - public override string TooltipStyle - { - get - { - return Interop.Elementary.elm_gengrid_item_tooltip_style_get(Handle); - } - set - { - Interop.Elementary.elm_gengrid_item_tooltip_style_set(Handle, value); - } - } - - public override GenItemSelectionMode SelectionMode - { - get - { - return (GenItemSelectionMode)Interop.Elementary.elm_gengrid_item_select_mode_get(Handle); - } - set - { - Interop.Elementary.elm_gengrid_item_select_mode_set(Handle, (Interop.Elementary.Elm_Object_Select_Mode)value); - } - } - - /// - /// Gets or sets gengrid item's row position, relative to the whole gengrid's grid area. - /// - public int Row - { - get - { - int row, column; - Interop.Elementary.elm_gengrid_item_pos_get(Handle, out row, out column); - return row; - } - } - - /// - /// Gets or sets gengrid item's column position, relative to the whole gengrid's grid area. - /// - public int Column - { - get - { - int row, column; - Interop.Elementary.elm_gengrid_item_pos_get(Handle, out row, out column); - return column; - } - } - - public override void SetTooltipText(string tooltip) - { - Interop.Elementary.elm_gengrid_item_tooltip_text_set(Handle, tooltip); - } - - public override void UnsetTooltip() - { - Interop.Elementary.elm_gengrid_item_tooltip_unset(Handle); - } - - /// - /// Updates the content of a given gengrid item. - /// This updates an item by calling all the genitem class functions again to get the content, text, and states. - /// Use this when the original item data has changed and you want the changes to reflect. - /// - /// - /// to update the contents of all the realized items. - /// - public override void Update() - { - Interop.Elementary.elm_gengrid_item_update(Handle); - } - - protected override void UpdateTooltipDelegate() - { - Interop.Elementary.elm_gengrid_item_tooltip_content_cb_set(Handle, - TooltipContentDelegate != null ? _tooltipCb : null, - IntPtr.Zero, - null); - } - } -} \ No newline at end of file diff --git a/src/ElmSharp/ElmSharp/GenItem.cs b/src/ElmSharp/ElmSharp/GenItem.cs deleted file mode 100644 index ca50c53c1..000000000 --- a/src/ElmSharp/ElmSharp/GenItem.cs +++ /dev/null @@ -1,132 +0,0 @@ -/* - * 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 ElmSharp -{ - /// - /// Enumeration for select mode of GenItem. - /// - public enum GenItemSelectionMode - { - /// - /// Default select mode. - /// - Default, - - /// - /// Always select mode. - /// - Always, - - /// - /// No select mode. - /// - None, - - /// - /// No select mode with no finger size rule. - /// - DisplayOnly - } - - /// - /// It inherits . - /// A base class for and . - /// It contains genitem class and data to display data. - /// - public abstract class GenItem : ItemObject - { - internal Interop.Elementary.Elm_Tooltip_Item_Content_Cb _tooltipCb; - GetTooltipContentDelegate _tooltipContentDelegate = null; - - /// - /// The delegate returning the tooltip contents. - /// - public delegate EvasObject GetTooltipContentDelegate(); - - internal GenItem(object data, GenItemClass itemClass) : base(IntPtr.Zero) - { - Data = data; - ItemClass = itemClass; - _tooltipCb = (d, obj, tooltip, item) => { return TooltipContentDelegate(); }; - } - - /// - /// Gets the item class that defines how to display data. It returns type. - /// - public GenItemClass ItemClass { get; protected set; } - - public GetTooltipContentDelegate TooltipContentDelegate - { - get - { - return _tooltipContentDelegate; - } - set - { - _tooltipContentDelegate = value; - UpdateTooltipDelegate(); - } - } - - /// - /// It's a abstract property. - /// - public abstract GenItemSelectionMode SelectionMode { get; set; } - - public abstract string Cursor { get; set; } - public abstract string CursorStyle { get; set; } - - public abstract bool IsUseEngineCursor { get; set; } - - /// - /// Gets item data that is added through calling , or methods. - /// - public object Data { get; protected set; } - - /// - /// It's a abstract property. It's implemented by and . - /// - public abstract bool IsSelected { get; set; } - - /// - /// It's a abstract property. It's implemented by and . - /// - public abstract string TooltipStyle { get; set; } - - public abstract void SetTooltipText(string tooltip); - public abstract void UnsetTooltip(); - - /// - /// It's a abstract method. It's implemented by and . - /// - public abstract void Update(); - - /// - /// The override method for delete item class and item data. It's called when the item is deleting. - /// - protected override void OnInvalidate() - { - ItemClass?.SendItemDeleted(Data); - Data = null; - ItemClass = null; - } - - protected abstract void UpdateTooltipDelegate(); - } -} diff --git a/src/ElmSharp/ElmSharp/GenItemClass.cs b/src/ElmSharp/ElmSharp/GenItemClass.cs deleted file mode 100644 index 17fe11a37..000000000 --- a/src/ElmSharp/ElmSharp/GenItemClass.cs +++ /dev/null @@ -1,255 +0,0 @@ -/* - * 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.Collections.Generic; -using System.Runtime.InteropServices; - -namespace ElmSharp -{ - /// - /// It represents the GenGrid or GenList item class definition field details. - /// It has some display styles, such as "default", "full" and "group_index". - /// - public class GenItemClass : IDisposable - { - static Dictionary s_HandleToEvasObject = new Dictionary(); - - /// - /// The delegate to define . - /// - /// The item data. - /// The part where the data should be shown. - /// Return string that should be shown. - public delegate string GetTextDelegate(object data, string part); - - /// - /// The delegate to define . - /// - /// The item data. - /// The part where the data should be shown. - /// Return content that should be shown. - public delegate EvasObject GetContentDelegate(object data, string part); - - /// - /// The delegate to define . - /// - /// The item data. - public delegate void DeleteDelegate(object data); - - /// - /// The delegate to define . - /// - /// The item data. - /// The part where the data should be shown. - /// The content has been added in gengrid. - /// Return content that should be shown. - public delegate EvasObject GetReusableContentDelegate(object data, string part, EvasObject old); - - ItemClass _itemClass; - IntPtr _unmanagedPtr = IntPtr.Zero; - string _style; - - /// - /// Creates and initializes a new instance of the GenItemClass. - /// - /// The item display style. - public GenItemClass(string style) - { - _style = style; - IntPtr unmanaged = CreateItemClass(); - - _itemClass = Marshal.PtrToStructure(unmanaged); - _itemClass.itemStyle = style; - _itemClass.textCallback = GetTextCallback; - _itemClass.contentCallback = GetContentCallback; - _itemClass.stateCallback = null; - _itemClass.delCallback = DelCallback; - _itemClass.reusableContentCallback = GetReusableContentCallback; - - ReleaseItemClass(unmanaged); - } - - ~GenItemClass() - { - Dispose(false); - } - - /// - /// Gets the item style. - /// - public string ItemStyle { get { return _style; } } - - /// - /// Gets or sets the callback that defines how to display item text. - /// If get, return . - /// - public GetTextDelegate GetTextHandler { get; set; } - - /// - /// Gets or sets the callback that defines how to display item content. - /// If get, return . - /// - public GetContentDelegate GetContentHandler { get; set; } - - /// - /// Gets or sets the callback that defines how to delete item text and content. - /// If get, return . - /// - public DeleteDelegate DeleteHandler { get; set; } - - /// - /// Gets or sets the callback that defines how to reuse item content. - /// If get, return . - /// - public GetReusableContentDelegate ReusableContentHandler { get; set; } - - internal IntPtr UnmanagedPtr - { - get - { - if (_unmanagedPtr == IntPtr.Zero) - { - _unmanagedPtr = Marshal.AllocHGlobal(Marshal.SizeOf(_itemClass)); - Marshal.StructureToPtr(_itemClass, _unmanagedPtr, false); - } - return _unmanagedPtr; - } - } - - protected virtual void Dispose(bool disposing) - { - if (_unmanagedPtr != IntPtr.Zero) - { - Marshal.FreeHGlobal(_unmanagedPtr); - _unmanagedPtr = IntPtr.Zero; - } - } - - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - - internal void SendItemDeleted(object data) - { - // data is user inserted value with GenItem - DeleteHandler?.Invoke(data); - } - - protected virtual IntPtr CreateItemClass() - { - return Interop.Elementary.elm_genlist_item_class_new(); - } - - protected virtual void ReleaseItemClass(IntPtr unmanagedPtr) - { - Interop.Elementary.elm_genlist_item_class_free(unmanagedPtr); - } - - string GetTextCallback(IntPtr data, IntPtr obj, IntPtr part) - { - GenItem item = ItemObject.GetItemById((int)data) as GenItem; - return GetTextHandler?.Invoke(item?.Data, Marshal.PtrToStringAnsi(part)); - } - - IntPtr GetContentCallback(IntPtr data, IntPtr obj, IntPtr part) - { - GenItem item = ItemObject.GetItemById((int)data) as GenItem; - EvasObject evasObject = GetContentHandler?.Invoke(item?.Data, Marshal.PtrToStringAnsi(part)); - if (evasObject != null) - { - s_HandleToEvasObject[evasObject.Handle] = evasObject; - evasObject.Deleted += EvasObjectDeleted; - } - return evasObject; - } - - void EvasObjectDeleted(object sender, EventArgs e) - { - IntPtr handle = (sender as EvasObject).Handle; - s_HandleToEvasObject.Remove(handle); - } - - IntPtr GetReusableContentCallback(IntPtr data, IntPtr obj, IntPtr part, IntPtr old) - { - IntPtr reusedHandle = IntPtr.Zero; - GenItem item = ItemObject.GetItemById((int)data) as GenItem; - if (s_HandleToEvasObject.ContainsKey(old)) - { - reusedHandle = ReusableContentHandler?.Invoke(item?.Data, Marshal.PtrToStringAnsi(part), s_HandleToEvasObject[old]); - } - return reusedHandle; - } - - void DelCallback(IntPtr data, IntPtr obj) - { - // We can't use this callback - // because, when item was deleted - // First, ItemObject deleted callback was called - // and We need to clean up ItemObject related objects - // This callback was called after ItemObject deleted callback was completed. - // So, We can't get resource reletated with ItemObject - } - } - - public class GenGridItemClass : GenItemClass - { - public GenGridItemClass(string style) : base(style) - { - } - - protected override IntPtr CreateItemClass() - { - return Interop.Elementary.elm_gengrid_item_class_new(); - } - - protected override void ReleaseItemClass(IntPtr unmanagedPtr) - { - Interop.Elementary.elm_gengrid_item_class_free(unmanagedPtr); - } - } - - [StructLayout(LayoutKind.Sequential)] - internal class ItemClass - { - public delegate string GetTextCallback(IntPtr data, IntPtr obj, IntPtr part); - - public delegate IntPtr GetContentCallback(IntPtr data, IntPtr obj, IntPtr part); - - public delegate int GetStateCallback(IntPtr data, IntPtr obj, IntPtr part); - - public delegate void DelCallback(IntPtr data, IntPtr obj); - - public delegate int FilterCallback(IntPtr data, IntPtr obj, IntPtr key); - - public delegate IntPtr GetReusableContentCallback(IntPtr data, IntPtr obj, IntPtr part, IntPtr old); - - public int version; - public uint refCount; - public int deleteMe; - public string itemStyle; - public readonly string decorateItemStyle; - public readonly string decorateAllItemStyle; - public GetTextCallback textCallback; - public GetContentCallback contentCallback; - public GetStateCallback stateCallback; - public DelCallback delCallback; - public FilterCallback filterCallback; - public GetReusableContentCallback reusableContentCallback; - } -} \ No newline at end of file diff --git a/src/ElmSharp/ElmSharp/GenList.cs b/src/ElmSharp/ElmSharp/GenList.cs deleted file mode 100755 index 161580cdb..000000000 --- a/src/ElmSharp/ElmSharp/GenList.cs +++ /dev/null @@ -1,750 +0,0 @@ -/* - * 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.Collections.Generic; - -namespace ElmSharp -{ - /// - /// Enumeration for setting genlist item type. - /// - public enum GenListItemType - { - /// - /// if Normal is set then this item is normal item. - /// - Normal = 0, - - /// - /// If tree is set then this item is displayed as an item that is able to expand and have child items. - /// - Tree = (1 << 0), - - /// - /// if Group is set then this item is group index item that is displayed at the top until the next group comes. - /// - Group = (1 << 1), - } - - /// - /// Enumeration for setting genlist's resizing behavior, transverse axis scrolling and items cropping. - /// - public enum GenListMode - { - /// - /// The genlist won't set any of its size hints to inform how a possible container should resize it. - /// Then, if it's not created as a "resize object", it might end with zeroed dimensions. - /// The genlist will respect the container's geometry and, if any of its items won't fit into its transverse axis, one won't be able to scroll it in that direction. - /// - Compress = 0, - - /// - /// This is the same as Compress, with the exception that if any of its items won't fit into its transverse axis, one will be able to scroll it in that direction. - /// - Scroll, - - /// - /// Sets a minimum size hint on the genlist object, so that containers may respect it (and resize itself to fit the child properly). - /// More specifically, a minimum size hint will be set for its transverse axis, so that the largest item in that direction fits well. - /// This is naturally bound by the genlist object's maximum size hints, set externally. - /// - Limit, - - /// - /// Besides setting a minimum size on the transverse axis, just like on Limit, the genlist will set a minimum size on th longitudinal axis, trying to reserve space to all its children to be visible at a time. - /// This is naturally bound by the genlist object's maximum size hints, set externally. - /// - Expand - } - - /// - /// It inherits System.EventArgs. - /// It contains Item which is type. - /// All events of GenList contain GenListItemEventArgs as a parameter. - /// - public class GenListItemEventArgs : EventArgs - { - /// - /// Gets or sets GenList item. The return type is . - /// - public GenListItem Item { get; set; } - - internal static GenListItemEventArgs CreateFromSmartEvent(IntPtr data, IntPtr obj, IntPtr info) - { - GenListItem item = ItemObject.GetItemByHandle(info) as GenListItem; - return new GenListItemEventArgs() { Item = item }; - } - } - - /// - /// Enumeration that defines where to position the item in the genlist. - /// - public enum ScrollToPosition - { - /// - /// Scrolls to nowhere. - /// - None = 0, - - /// - /// Scrolls to the nearest viewport. - /// - In = (1 << 0), - - /// - /// Scrolls to the top of the viewport. - /// - Top = (1 << 1), - - /// - /// Scrolls to the middle of the viewport. - /// - Middle = (1 << 2), - - /// - /// Scrolls to the bottom of the viewport. - /// - Bottom = (1 << 3) - } - - /// - /// It inherits . - /// The GenList is a widget that aims to have more expansive list than the simple in ElmSharp that could have more flexible items and allow many more entries while still being fast and low on memory usage. - /// At the same time it was also made to be able to do tree structures. - /// But the price to pay is more complexity when it comes to usage. - /// If all you want is a simple list with icons and a single text, use the widget. - /// - public class GenList : Layout - { - HashSet _children = new HashSet(); - - SmartEvent _selected; - SmartEvent _unselected; - SmartEvent _activated; - SmartEvent _pressed; - SmartEvent _released; - SmartEvent _doubleClicked; - SmartEvent _expanded; - SmartEvent _realized; - SmartEvent _unrealized; - SmartEvent _longpressed; - SmartEvent _moved; - SmartEvent _movedAfter; - SmartEvent _movedBefore; - SmartEvent _scrollAnimationStarted; - SmartEvent _scrollAnimationStopped; - SmartEvent _changed; - - /// - /// Creates and initializes a new instance of the GenList class. - /// - /// 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(); - } - - /// - /// Gets or sets whether the homogeneous mode is enabled. - /// - /// - /// If true, the genlist items have same height and width. - /// - public bool Homogeneous - { - get - { - return Interop.Elementary.elm_genlist_homogeneous_get(RealHandle); - } - set - { - Interop.Elementary.elm_genlist_homogeneous_set(RealHandle, value); - } - } - - /// - /// Gets or sets the horizontal stretching mode. This mode used for sizing items horizontally. - /// The default value is which means that if items are too wide to fit, the scroller scrolls horizontally. - /// If set which means that the item width is fixed (restricted to a minimum of) to the list width when calculating its size in order to allow the height to be calculated based on it. - /// If set which means that items are expanded to the viewport width and limited to that size. - /// if set which means that genlist try to reserve space to all its items to be visible at a time. - /// - /// - /// Compress makes genlist resize slower as it recalculates every item height again whenever the list width changes. - /// The homogeneous mode is so that all items in the genlist are of the same width/height. With Compress, genlist items are initialized fast. - /// However, there are no sub-objects in the genlist which can be on the flying resizable (such as TEXTBLOCK). - /// If so, then some dynamic resizable objects in the genlist would not be diplayed properly. - /// - public GenListMode ListMode - { - get - { - return (GenListMode)Interop.Elementary.elm_genlist_mode_get(RealHandle); - } - set - { - Interop.Elementary.elm_genlist_mode_set(RealHandle, (int)value); - } - } - - /// - /// Gets the first item in the genlist. - /// - public GenListItem FirstItem - { - get - { - IntPtr handle = Interop.Elementary.elm_genlist_first_item_get(RealHandle); - return ItemObject.GetItemByHandle(handle) as GenListItem; - } - } - - /// - /// Gets the last item in the genlist. - /// - public GenListItem LastItem - { - get - { - IntPtr handle = Interop.Elementary.elm_genlist_last_item_get(RealHandle); - return ItemObject.GetItemByHandle(handle) as GenListItem; - } - } - - /// - /// Gets or sets the reorder mode. - /// After turning on the reorder mode, longpress on a normal item triggers reordering of the item. - /// You can move the item up and down. However, reordering does not work with group items. - /// - public bool ReorderMode - { - get - { - return Interop.Elementary.elm_genlist_reorder_mode_get(RealHandle); - } - set - { - Interop.Elementary.elm_genlist_reorder_mode_set(RealHandle, value); - } - } - - /// - /// Gets or set the maximum number of items within an item block. - /// - public int BlockCount - { - get - { - return Interop.Elementary.elm_genlist_block_count_get(RealHandle); - } - set - { - Interop.Elementary.elm_genlist_block_count_set(RealHandle, value); - } - } - - /// - /// Gets or sets whether the genlist items should be highlighted when an item is selected. - /// - public bool IsHighlight - { - get - { - return Interop.Elementary.elm_genlist_highlight_mode_get(RealHandle); - } - set - { - Interop.Elementary.elm_genlist_highlight_mode_set(RealHandle, value); - } - } - - /// - /// Gets or sets the timeout in seconds for the longpress event. - /// - public double LongPressTimeout - { - get - { - return Interop.Elementary.elm_genlist_longpress_timeout_get(RealHandle); - } - set - { - Interop.Elementary.elm_genlist_longpress_timeout_set(RealHandle, value); - } - } - - /// - /// Gets or sets whether enable multi-selection in the genlist. - /// - public bool IsMultiSelection - { - get - { - return Interop.Elementary.elm_genlist_multi_select_get(RealHandle); - } - set - { - Interop.Elementary.elm_genlist_multi_select_set(RealHandle, value); - } - } - - /// - /// Gets the selected item in a given genlist widget. - /// - public GenListItem SelectedItem - { - get - { - IntPtr handle = Interop.Elementary.elm_genlist_selected_item_get(RealHandle); - return ItemObject.GetItemByHandle(handle) as GenListItem; - } - } - - /// - /// Gets or sets the genlist select mode by . - /// - public GenItemSelectionMode SelectionMode - { - get - { - return (GenItemSelectionMode)Interop.Elementary.elm_genlist_select_mode_get(RealHandle); - } - set - { - Interop.Elementary.elm_genlist_select_mode_set(RealHandle, (int)value); - } - } - - /// - /// ItemSelected is raised when a new genlist item is selected. - /// - public event EventHandler ItemSelected; - - /// - /// ItemUnselected is raised when the genlist item is Unselected. - /// - public event EventHandler ItemUnselected; - - /// - /// ItemPressed is raised when a new genlist item is pressed. - /// - public event EventHandler ItemPressed; - - /// - /// ItemReleased is raised when a new genlist item is released. - /// - public event EventHandler ItemReleased; - - /// - /// ItemActivated is raised when a new genlist item is double clicked or pressed (enter|return|spacebar). - /// - public event EventHandler ItemActivated; - - /// - /// ItemDoubleClicked is raised when a new genlist item is double clicked. - /// - public event EventHandler ItemDoubleClicked; - - /// - /// ItemExpanded is raised when a new genlist item is indicated to expand. - /// - public event EventHandler ItemExpanded; - - /// - /// ItemRealized is raised when a new genlist item is created as a real object. - /// - public event EventHandler ItemRealized; - - /// - /// ItemUnrealized is raised when a new genlist item is unrealized. - /// After calling unrealize, the item's content objects are deleted and the item object itself is deleted or is put into a floating cache. - /// - public event EventHandler ItemUnrealized; - - /// - /// ItemLongPressed is raised when a genlist item is pressed for a certain amount of time. By default it's 1 second. - /// - public event EventHandler ItemLongPressed; - - /// - /// ItemMoved is raised when a genlist item is moved in the reorder mode. - /// - public event EventHandler ItemMoved; - - /// - /// ItemMovedAfter is raised when a genlist item is moved after another item in the reorder mode. - /// To get the relative previous item, use . - /// - public event EventHandler ItemMovedAfter; - - /// - /// ItemMovedBefore is raised when a genlist item is moved before another item in the reorder mode. - /// To get the relative next item, use . - /// - public event EventHandler ItemMovedBefore; - - /// - /// Changed is raised when genlist is changed. - /// - public event EventHandler Changed - { - add { _changed.On += value; } - remove { _changed.On -= value; } - } - - /// - /// ScrollAnimationStarted is raised when scrolling animation has started. - /// - public event EventHandler ScrollAnimationStarted - { - add { _scrollAnimationStarted.On += value; } - remove { _scrollAnimationStarted.On -= value; } - } - - /// - /// ScrollAnimationStopped is raised when scrolling animation has stopped. - /// - public event EventHandler ScrollAnimationStopped - { - add { _scrollAnimationStopped.On += value; } - remove { _scrollAnimationStopped.On -= value; } - } - - /// - /// Appends a new item to the end of a given genlist widget. - /// - /// The itemClass defines how to display the data. - /// The item data. - /// Return a new added genlist item that contains data and itemClass. - /// - /// - public GenListItem Append(GenItemClass itemClass, object data) - { - return Append(itemClass, data, GenListItemType.Normal); - } - - /// - /// Appends a new item with to the end of a given genlist widget. - /// - /// The itemClass defines how to display the data. - /// The item data. - /// The genlist item type. - /// Return a new added genlist item that contains data and itemClass. - public GenListItem Append(GenItemClass itemClass, object data, GenListItemType type) - { - return Append(itemClass, data, type, null); - } - - /// - /// Appends a new item with to the end of a given genlist widget or the end of the children list if the parent is given. - /// - /// The itemClass defines how to display the data. - /// The item data. - /// The genlist item type. - /// The parent item, otherwise null if there is no parent item. - /// Return a new added genlist item that contains data and itemClass. - public GenListItem Append(GenItemClass itemClass, object data, GenListItemType type, GenListItem parent) - { - GenListItem item = new GenListItem(data, itemClass); - IntPtr handle = Interop.Elementary.elm_genlist_item_append(RealHandle, itemClass.UnmanagedPtr, (IntPtr)item.Id, parent, (int)type, null, (IntPtr)item.Id); - item.Handle = handle; - AddInternal(item); - return item; - } - - /// - /// Prepends a new item to the beginning of a given genlist widget. - /// - /// The itemClass defines how to display the data. - /// The item data. - /// Return a new added genlist item that contains data and itemClass. - public GenListItem Prepend(GenItemClass itemClass, object data) - { - return Prepend(itemClass, data, GenListItemType.Normal); - } - - /// - /// Prepends a new item with to the beginning of a given genlist widget. - /// - /// The itemClass defines how to display the data. - /// The item data. - /// The genlist item type. - /// Return a new added genlist item that contains data and itemClass. - public GenListItem Prepend(GenItemClass itemClass, object data, GenListItemType type) - { - return Prepend(itemClass, data, type, null); - } - - /// - /// Prepends a new item with to the beginning of a given genlist widget or the beginning of the children list if the parent is given. - /// - /// The itemClass defines how to display the data. - /// The item data. - /// The genlist item type. - /// The parent item, otherwise null if there is no parent item. - /// Return a new added genlist item that contains data and itemClass. - public GenListItem Prepend(GenItemClass itemClass, object data, GenListItemType type, GenListItem parent) - { - GenListItem item = new GenListItem(data, itemClass); - IntPtr handle = Interop.Elementary.elm_genlist_item_prepend(RealHandle, itemClass.UnmanagedPtr, (IntPtr)item.Id, parent, (int)type, null, (IntPtr)item.Id); - item.Handle = handle; - AddInternal(item); - return item; - } - - /// - /// Inserts an item before another item in a genlist widget. - /// It is the same tree level or group as the item before which it is inserted.???? - /// - /// The itemClass defines how to display the data. - /// The item data. - /// The item before which to place this new one. - /// Return a new added genlist item that contains data and itemClass. - public GenListItem InsertBefore(GenItemClass itemClass, object data, GenListItem before) - { - return InsertBefore(itemClass, data, before, GenListItemType.Normal); - } - - /// - /// Inserts an item with before another item in a genlist widget. - /// It is the same tree level or group as the item before which it is inserted.???? - /// - /// The itemClass defines how to display the data. - /// The item data. - /// The item before which to place this new one. - /// The genlist item type. - /// Return a new added genlist item that contains data and itemClass. - public GenListItem InsertBefore(GenItemClass itemClass, object data, GenListItem before, GenListItemType type) - { - return InsertBefore(itemClass, data, before, type, null); - } - - /// - /// Inserts an item with before another item under a parent in a genlist widget. - /// - /// The itemClass defines how to display the data. - /// The item data. - /// The item before which to place this new one. - /// The genlist item type. - /// The parent item, otherwise null if there is no parent item. - /// Return a new added genlist item that contains data and itemClass. - public GenListItem InsertBefore(GenItemClass itemClass, object data, GenListItem before, GenListItemType type, GenListItem parent) - { - GenListItem item = new GenListItem(data, itemClass); - // insert before the `before` list item - IntPtr handle = Interop.Elementary.elm_genlist_item_insert_before( - RealHandle, // genlist handle - itemClass.UnmanagedPtr, // item class - (IntPtr)item.Id, // data - parent, // parent - before, // before - (int)type, // item type - null, // select callback - (IntPtr)item.Id); // callback data - item.Handle = handle; - AddInternal(item); - return item; - } - - /// - /// Inserts an item with after another item under a parent in a genlist widget. - /// - /// The itemClass defines how to display the data. - /// The item data. - /// The item after which to place this new one. - /// The genlist item type. - /// The parent item, otherwise null if there is no parent item. - /// Return a new added genlist item that contains data and itemClass. - public GenListItem InsertAfter(GenItemClass itemClass, object data, GenListItem after, GenListItemType type, GenListItem parent) - { - GenListItem item = new GenListItem(data, itemClass); - // insert before the `before` list item - IntPtr handle = Interop.Elementary.elm_genlist_item_insert_before( - RealHandle, // genlist handle - itemClass.UnmanagedPtr, // item class - (IntPtr)item.Id, // data - parent, // parent - after, // after - (int)type, // item type - null, // select callback - (IntPtr)item.Id); // callback data - item.Handle = handle; - AddInternal(item); - return item; - } - - /// - /// Insert an item in a genlist widget using a user-defined sort function. - /// - /// The itemClass defines how to display the data. - /// The item data. - /// User defined comparison function that defines the sort order based on genlist item and its data. - /// The genlist item type. - /// The parent item, otherwise null if there is no parent item. - /// Return a genlist item that contains data and itemClass. - public GenListItem InsertSorted(GenItemClass itemClass, object data, Comparison comparison, GenListItemType type, GenListItem parent) - { - GenListItem item = new GenListItem(data, itemClass); - - Interop.Elementary.Eina_Compare_Cb compareCallback = (handle1, handle2) => - { - GenListItem first = (ItemObject.GetItemByHandle(handle1) as GenListItem) ?? item; - GenListItem second = (ItemObject.GetItemByHandle(handle2) as GenListItem) ?? item; - return comparison(first.Data, second.Data); - }; - - IntPtr handle = Interop.Elementary.elm_genlist_item_sorted_insert( - RealHandle, // genlist handle - itemClass.UnmanagedPtr, // item clas - (IntPtr)item.Id, // data - parent, // parent - (int)type, // item type - compareCallback, // compare callback - null, //select callback - (IntPtr)item.Id); // callback data - item.Handle = handle; - AddInternal(item); - return item; - } - - /// - /// Shows the given item with position type in a genlist. - /// When animated is true, genlist will jump to the given item and display it (by animatedly scrolling), if it is not fully visible. This may use animation and may take some time. - /// When animated is false, genlist will jump to the given item and display it (by jumping to that position), if it is not fully visible. - /// - /// The item to display. - /// The position to show the given item to . - /// The animated indicates how to display the item, by scrolling or by jumping. - public void ScrollTo(GenListItem item, ScrollToPosition position, bool animated) - { - if (animated) - { - Interop.Elementary.elm_genlist_item_bring_in(item.Handle, (Interop.Elementary.Elm_Genlist_Item_Scrollto_Type)position); - } - else - { - Interop.Elementary.elm_genlist_item_show(item.Handle, (Interop.Elementary.Elm_Genlist_Item_Scrollto_Type)position); - } - } - - /// - /// Updates the content of all the realized items. - /// This updates all the realized items by calling all the again to get the content, text and states. - /// Use this when the original item data has changed and the changes are desired to reflect. - /// To update just one item, use . - /// - /// - public void UpdateRealizedItems() - { - Interop.Elementary.elm_genlist_realized_items_update(RealHandle); - } - - /// - /// Removes all items from a given genlist widget. - /// This removes (and deletes) all items in obj, making it empty. - /// To delete just one item, use . - /// - /// - public void Clear() - { - Interop.Elementary.elm_genlist_clear(RealHandle); - } - - /// - /// Get the item that is at the x, y canvas coords. - /// - /// The input x coordinate - /// The input y coordinate - /// The position relative to the item returned here - /// -1, 0, or 1, depending on whether the coordinate is on the upper portion of that item (-1), in the middle section (0), or on the lower part (1). - /// - /// - public GenListItem GetItemByPosition(int x, int y, out int pos) - { - IntPtr handle = Interop.Elementary.elm_genlist_at_xy_item_get(RealHandle, x, y, out pos); - return ItemObject.GetItemByHandle(handle) as GenListItem; - } - - /// - /// Gets the nth item in a given genlist widget, placed at position nth, in its internal items list. - /// - /// The number of the item to grab (0 being the first) - /// - public GenListItem GetItemByIndex(int index) - { - IntPtr handle = Interop.Elementary.elm_genlist_nth_item_get(RealHandle, index); - return ItemObject.GetItemByHandle(handle) as GenListItem; - } - - protected override IntPtr CreateHandle(EvasObject parent) - { - IntPtr handle = Interop.Elementary.elm_layout_add(parent.Handle); - Interop.Elementary.elm_layout_theme_set(handle, "layout", "elm_widget", "default"); - - RealHandle = Interop.Elementary.elm_genlist_add(handle); - Interop.Elementary.elm_object_part_content_set(handle, "elm.swallow.content", RealHandle); - - return handle; - } - - void InitializeSmartEvent() - { - _selected = new SmartEvent(this, this.RealHandle, "selected", GenListItemEventArgs.CreateFromSmartEvent); - _unselected = new SmartEvent(this, this.RealHandle, "unselected", GenListItemEventArgs.CreateFromSmartEvent); - _activated = new SmartEvent(this, this.RealHandle, "activated", GenListItemEventArgs.CreateFromSmartEvent); - _pressed = new SmartEvent(this, this.RealHandle, "pressed", GenListItemEventArgs.CreateFromSmartEvent); - _released = new SmartEvent(this, this.RealHandle, "released", GenListItemEventArgs.CreateFromSmartEvent); - _doubleClicked = new SmartEvent(this, this.RealHandle, "clicked,double", GenListItemEventArgs.CreateFromSmartEvent); - _expanded = new SmartEvent(this, this.RealHandle, "expanded", GenListItemEventArgs.CreateFromSmartEvent); - _realized = new SmartEvent(this, this.RealHandle, "realized", GenListItemEventArgs.CreateFromSmartEvent); - _unrealized = new SmartEvent(this, this.RealHandle, "unrealized", GenListItemEventArgs.CreateFromSmartEvent); - _longpressed = new SmartEvent(this, this.RealHandle, "longpressed", GenListItemEventArgs.CreateFromSmartEvent); - _moved = new SmartEvent(this, this.RealHandle, "moved", GenListItemEventArgs.CreateFromSmartEvent); - _movedAfter = new SmartEvent(this, this.RealHandle, "moved,after", GenListItemEventArgs.CreateFromSmartEvent); - _movedBefore = new SmartEvent(this, this.RealHandle, "moved,before", GenListItemEventArgs.CreateFromSmartEvent); - _scrollAnimationStarted = new SmartEvent(this, this.RealHandle, "scroll,anim,start"); - _scrollAnimationStopped = new SmartEvent(this, this.RealHandle, "scroll,anim,stop"); - _changed = new SmartEvent(this, this.RealHandle, "changed"); - - _selected.On += (s, e) => { if (e.Item != null) ItemSelected?.Invoke(this, e); }; - _unselected.On += (s, e) => { if (e.Item != null) ItemUnselected?.Invoke(this, e); }; - _activated.On += (s, e) => { if (e.Item != null) ItemActivated?.Invoke(this, e); }; - _pressed.On += (s, e) => { if (e.Item != null) ItemPressed?.Invoke(this, e); }; - _released.On += (s, e) => { if (e.Item != null) ItemReleased?.Invoke(this, e); }; - _doubleClicked.On += (s, e) => { if (e.Item != null) ItemDoubleClicked?.Invoke(this, e); }; - _expanded.On += (s, e) => { if (e.Item != null) ItemExpanded?.Invoke(this, e); }; - _realized.On += (s, e) => { if (e.Item != null) ItemRealized?.Invoke(this, e); }; - _unrealized.On += (s, e) => { if (e.Item != null) ItemUnrealized?.Invoke(this, e); }; - _longpressed.On += (s, e) => { if (e.Item != null) ItemLongPressed?.Invoke(this, e); }; - _moved.On += (s, e) => { if (e.Item != null) ItemMoved?.Invoke(this, e); }; - _movedAfter.On += (s, e) => { if (e.Item != null) ItemMovedAfter?.Invoke(this, e); }; - _movedBefore.On += (s, e) => { if (e.Item != null) ItemMovedBefore?.Invoke(this, e); }; - } - - void AddInternal(GenListItem item) - { - _children.Add(item); - item.Deleted += Item_Deleted; - } - - void Item_Deleted(object sender, EventArgs e) - { - _children.Remove((GenListItem)sender); - } - } -} \ No newline at end of file diff --git a/src/ElmSharp/ElmSharp/GenListItem.cs b/src/ElmSharp/ElmSharp/GenListItem.cs deleted file mode 100755 index f12ff86ef..000000000 --- a/src/ElmSharp/ElmSharp/GenListItem.cs +++ /dev/null @@ -1,316 +0,0 @@ -/* - * 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.ComponentModel; - -namespace ElmSharp -{ - /// - /// The type of item's part type. - /// - [Flags] - public enum GenListItemFieldType - { - /// - /// All item's parts. - /// - All = 0, - - /// - /// The text part type. - /// - Text = (1 << 0), - - /// - /// The Content part type. - /// - Content = (1 << 1), - - /// - /// The state of part. - /// - State = (1 << 2), - - /// - /// No part type. - /// - None = (1 << 3) - }; - - /// - /// It inherits . - /// A instance to the genlist item added. - /// It contains Update() method to update a genlist item which is given. - /// - public class GenListItem : GenItem - { - internal GenListItem(object data, GenItemClass itemClass) : base(data, itemClass) - { - } - - /// - /// Gets or sets whether a given genlist item is selected. - /// - public override bool IsSelected - { - get - { - return Interop.Elementary.elm_genlist_item_selected_get(Handle); - } - set - { - Interop.Elementary.elm_genlist_item_selected_set(Handle, value); - } - } - - /// - /// Gets or sets whether a given genlist item is expanded. - /// - public bool IsExpanded - { - get - { - return Interop.Elementary.elm_genlist_item_expanded_get(Handle); - } - set - { - Interop.Elementary.elm_genlist_item_expanded_set(Handle, value); - } - } - - /// - /// Updates the content of an item. - /// This updates an item by calling all the again to get the content, text, and states. - /// Use this when the original item data has changed and the changes are desired to reflect. - /// To update already realized items, use . - /// - /// - public override void Update() - { - Interop.Elementary.elm_genlist_item_update(Handle); - } - - /// - /// Updates the part of an item. - /// This updates an item's part by calling item's fetching functions again to get the contents, texts and states. - /// Use this when the original item data has changed and the changes are desired to be reflected. - /// To update an item's all property, use . - /// - /// The part could be "elm.text", "elm.swalllow.icon", "elm.swallow.end", "elm.swallow.content" and so on. It is also used for globbing to match '*', '?', and '.'. It can be used at updating multi fields. - /// The type of item's part type. - /// - public void UpdateField(string part, GenListItemFieldType type) - { - Interop.Elementary.elm_genlist_item_fields_update(Handle, part, (uint)type); - } - - /// - /// Demote an item to the end of the list. - /// - public void DemoteItem() - { - Interop.Elementary.elm_genlist_item_demote(Handle); - } - - /// - /// Gets or sets the genlist item's select mode. - /// - public override GenItemSelectionMode SelectionMode - { - get - { - return (GenItemSelectionMode)Interop.Elementary.elm_genlist_item_select_mode_get(Handle); - } - set - { - Interop.Elementary.elm_genlist_item_select_mode_set(Handle, (Interop.Elementary.Elm_Object_Select_Mode)value); - } - } - - /// - /// Gets the next item in a genlist widget's internal list of items. - /// - /// - public GenListItem Next - { - get - { - IntPtr next = Interop.Elementary.elm_genlist_item_next_get(Handle); - if (next == IntPtr.Zero) - return null; - else - return GetItemByHandle(next) as GenListItem; - } - } - - /// - /// Get the previous item in a genlist widget's internal list of items. - /// - /// - public GenListItem Previous - { - get - { - IntPtr prev = Interop.Elementary.elm_genlist_item_prev_get(Handle); - if (prev == IntPtr.Zero) - return null; - else - return GetItemByHandle(prev) as GenListItem; - } - } - - [EditorBrowsable(EditorBrowsableState.Never)] - public override string Cursor - { - get - { - return Interop.Elementary.elm_genlist_item_cursor_get(Handle); - } - set - { - if (!string.IsNullOrEmpty(value)) - { - Interop.Elementary.elm_genlist_item_cursor_set(Handle, value); - } - else - { - Interop.Elementary.elm_genlist_item_cursor_unset(Handle); - } - } - } - - [EditorBrowsable(EditorBrowsableState.Never)] - public override string CursorStyle - { - get - { - return Interop.Elementary.elm_genlist_item_cursor_style_get(Handle); - } - set - { - Interop.Elementary.elm_genlist_item_cursor_style_set(Handle, value); - } - } - - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool IsUseEngineCursor - { - get - { - return Interop.Elementary.elm_genlist_item_cursor_engine_only_get(Handle); - } - set - { - Interop.Elementary.elm_genlist_item_cursor_engine_only_set(Handle, value); - } - } - - public override void SetTooltipText(string tooltip) - { - Interop.Elementary.elm_genlist_item_tooltip_text_set(Handle, tooltip); - } - - public override void UnsetTooltip() - { - Interop.Elementary.elm_genlist_item_tooltip_unset(Handle); - } - - /// - /// Gets or sets the style of given genlist item's tooltip. - /// - public override string TooltipStyle - { - get - { - return Interop.Elementary.elm_genlist_item_tooltip_style_get(Handle); - } - set - { - Interop.Elementary.elm_genlist_item_tooltip_style_set(Handle, value); - } - } - - /// - /// Gets or sets whether disable size restrictions on an object's tooltip. - /// - public bool IsTooltipWindowMode - { - get - { - return Interop.Elementary.elm_genlist_item_tooltip_window_mode_get(Handle); - } - set - { - Interop.Elementary.elm_genlist_item_tooltip_window_mode_set(Handle, value); - } - } - - /// - /// Gets the index of the item. It is only valid once displayed. - /// - public int Index - { - get - { - return Interop.Elementary.elm_genlist_item_index_get(Handle); - } - } - - /// - /// Gets the depth of expanded item. - /// - public int ExpandedItemDepth - { - get - { - return Interop.Elementary.elm_genlist_item_expanded_depth_get(Handle); - } - } - - /// - /// Remove all sub-items (children) of the given item. - /// - /// - /// This removes all items that are children (and their descendants) of the given item it. - /// - public void ClearSubitems() - { - Interop.Elementary.elm_genlist_item_subitems_clear(Handle); - } - - /// - /// Update the item class of an item. - /// This sets another class of the item, changing the way that it is displayed. After changing the item class, is called on the item. - /// - /// The item class for the item. - /// The data for the item. - public void UpdateItemClass(GenItemClass itemClass, object data) - { - Data = data; - ItemClass = itemClass; - Interop.Elementary.elm_genlist_item_item_class_update((IntPtr)Handle, itemClass.UnmanagedPtr); - } - - protected override void UpdateTooltipDelegate() - { - Interop.Elementary.elm_genlist_item_tooltip_content_cb_set(Handle, - TooltipContentDelegate != null ? _tooltipCb : null, - IntPtr.Zero, - null); - } - } -} diff --git a/src/ElmSharp/ElmSharp/GestureLayer.cs b/src/ElmSharp/ElmSharp/GestureLayer.cs deleted file mode 100644 index c6bce6c36..000000000 --- a/src/ElmSharp/ElmSharp/GestureLayer.cs +++ /dev/null @@ -1,835 +0,0 @@ -/* - * 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; -using System.Collections.Generic; - -namespace ElmSharp -{ - /// - /// The GestureLayer is used to detect gestures. - /// Inherits Widget - /// - public class GestureLayer : Widget - { - private readonly Interop.Elementary.GestureEventCallback _gestureCallback; - - // Important: don't remove items from _handlers list - // The list can grow up to (number of GestureType) * (number of GestureState) - // but all gestures share the callback and you don't want to desynchronize mapping - private readonly List _handlers = new List(); - - /// - /// Creates and initializes a new instance of GestureLayer class. - /// - /// The parent is a given container which will be attached by GestureLayer as a child. It's type. - public GestureLayer(EvasObject parent) : base(parent) - { - _gestureCallback = new Interop.Elementary.GestureEventCallback(GestureCallbackHandler); - } - - /// - /// Enumeration for supported gesture types. - /// - public enum GestureType - { - /// - /// N fingers single taps - /// - Tap = 1, - - /// - /// N fingers single long-taps - /// - LongTap, - - /// - /// N fingers double-single taps - /// - DoubleTap, - - /// - /// N fingers triple-single taps - /// - TripleTap, - - /// - /// Reports momentum in the direction of move - /// - Momentum, - - /// - /// N fingers line gesture - /// - Line, - - /// - /// N fingers flick gesture - /// - Flick, - - /// - /// Zoom - /// - Zoom, - - /// - /// Rotate - /// - Rotate, - } - - /// - /// Enumeration for gesture states. - /// - public enum GestureState - { - /// - /// Gesture not started - /// - Undefined = -1, - - /// - /// Gesture started - /// - Start, - - /// - /// Gesture is ongoing - /// - Move, - - /// - /// Gesture completed - /// - End, - - /// - /// Ongoing gesture is aborted - /// - Abort, - } - - #region Properties - - /// - /// Sets or gets the repeat-events setting. - /// - public bool HoldEvents - { - get - { - return Interop.Elementary.elm_gesture_layer_hold_events_get(Handle); - } - set - { - Interop.Elementary.elm_gesture_layer_hold_events_set(Handle, value); - } - } - - /// - /// Sets or gets the gesture layer continues enable of an object - /// - public bool Continues - { - get - { - return Interop.Elementary.elm_gesture_layer_continues_enable_get(Handle); - } - set - { - Interop.Elementary.elm_gesture_layer_continues_enable_set(Handle, value); - } - } - - /// - /// Sets or gets the gesture layer finger-size for taps. - /// - public int TapFingerSize - { - get - { - return Interop.Elementary.elm_gesture_layer_tap_finger_size_get(Handle); - } - set - { - Interop.Elementary.elm_gesture_layer_tap_finger_size_set(Handle, value); - } - } - - /// - /// Sets or gets the gesture layer long tap start timeout of an object - /// - public double LongTapTimeout - { - get - { - return Interop.Elementary.elm_gesture_layer_long_tap_start_timeout_get(Handle); - } - set - { - Interop.Elementary.elm_gesture_layer_long_tap_start_timeout_set(Handle, value); - } - } - - /// - /// Sets or gets the gesture layer double tap timeout of an object - /// - public double DoubleTapTimeout - { - get - { - return Interop.Elementary.elm_gesture_layer_double_tap_timeout_get(Handle); - } - set - { - Interop.Elementary.elm_gesture_layer_double_tap_timeout_set(Handle, value); - } - } - - /// - /// Sets or gets the gesture layer flick time limit (in ms) of an object - /// - public int FlickTimeLimit - { - get - { - return (int)Interop.Elementary.elm_gesture_layer_flick_time_limit_ms_get(Handle); - } - set - { - Interop.Elementary.elm_gesture_layer_flick_time_limit_ms_set(Handle, (UInt32)value); - } - } - - /// - /// Sets or gets the gesture layer line min length of an object - /// - public int MinimumLineLength - { - get - { - return Interop.Elementary.elm_gesture_layer_line_min_length_get(Handle); - } - set - { - Interop.Elementary.elm_gesture_layer_line_min_length_set(Handle, value); - } - } - - /// - /// Sets or gets the gesture layer line angular tolerance of an object - /// - public double LineAngularTolerance - { - get - { - return Interop.Elementary.elm_gesture_layer_line_angular_tolerance_get(Handle); - } - set - { - Interop.Elementary.elm_gesture_layer_line_angular_tolerance_set(Handle, value); - } - } - - /// - /// Sets or gets the gesture layer line distance tolerance of an object - /// - public int LineDistanceTolerance - { - get - { - return Interop.Elementary.elm_gesture_layer_line_distance_tolerance_get(Handle); - } - set - { - Interop.Elementary.elm_gesture_layer_line_distance_tolerance_set(Handle, value); - } - } - - /// - /// Sets or gets step-value for rotate action. - /// - public double RotateStep - { - get - { - return Interop.Elementary.elm_gesture_layer_rotate_step_get(Handle); - } - set - { - Interop.Elementary.elm_gesture_layer_rotate_step_set(Handle, value); - } - } - - /// - /// Sets or gets the gesture layer rotate angular tolerance of an object - /// - public double RotateAngularTolerance - { - get - { - return Interop.Elementary.elm_gesture_layer_rotate_angular_tolerance_get(Handle); - } - set - { - Interop.Elementary.elm_gesture_layer_rotate_angular_tolerance_set(Handle, value); - } - } - - /// - /// Sets or gets control step value for zoom action. - /// - public double ZoomStep - { - get - { - return Interop.Elementary.elm_gesture_layer_zoom_step_get(Handle); - } - set - { - Interop.Elementary.elm_gesture_layer_zoom_step_set(Handle, value); - } - } - - /// - /// Sets or gets the gesture layer zoom distance tolerance of an object - /// - public int ZoomDistanceTolerance - { - get - { - return Interop.Elementary.elm_gesture_layer_zoom_distance_tolerance_get(Handle); - } - set - { - Interop.Elementary.elm_gesture_layer_zoom_distance_tolerance_set(Handle, value); - } - } - - /// - /// Sets or gets the gesture layer zoom finger factor of an object - /// - public double ZoomFingerFactor - { - get - { - return Interop.Elementary.elm_gesture_layer_zoom_finger_factor_get(Handle); - } - set - { - Interop.Elementary.elm_gesture_layer_zoom_finger_factor_set(Handle, value); - } - } - - /// - /// Sets or gets the gesture layer zoom wheel factor of an object - /// - public double ZoomWheelFactor - { - get - { - return Interop.Elementary.elm_gesture_layer_zoom_wheel_factor_get(Handle); - } - set - { - Interop.Elementary.elm_gesture_layer_zoom_wheel_factor_set(Handle, value); - } - } - - #endregion Properties - - /// - /// Attach a gesture layer widget to an Evas object (setting the widget's target). - /// A gesture layer's target may be any Evas object. This object will be used to listen to mouse and key events. - /// - /// The object to attach. - public void Attach(EvasObject target) - { - Interop.Elementary.elm_gesture_layer_attach(Handle, target.Handle); - } - - /// - /// Set the gesture state change callback. - /// When all callbacks for the gesture are set to null, it means this gesture is disabled. - /// - /// The gesture you want to track state of. - /// The event the callback tracks (START, MOVE, END, ABORT). - /// The callback itself. - public void SetGestureCallback(GestureType type, GestureState state, Action action) - { - lock (_handlers) - { - bool found = false; - int i = 0; - // if this (type, state) already exists in _handlers, we will reuse it - foreach (var handler in _handlers) - { - if (handler.Type == type && handler.State == state) - { - found = true; - break; - } - i++; - } - if (found) - { - // if we are changing null -> not-null, or not-null -> null, then inform the EFL - if (_handlers[i].Action == null ^ action == null) - Interop.Elementary.elm_gesture_layer_cb_set(Handle, type, state, action == null ? null : _gestureCallback, new IntPtr(i)); - // overwrite previous action - _handlers[i].Action = action; - } - else - { - if (action == null) - { - // ignore unsetting a handler for event which was not registered yet? - return; - } - // (type, state) was not found, so we are adding a new entry and registering the callback - _handlers.Add(new NativeCallback(type, state, action)); - // callback is always the same, the event is recognised by the index in _handler list (the index is passed as data) - Interop.Elementary.elm_gesture_layer_cb_set(Handle, type, state, _gestureCallback, new IntPtr(i)); - } - } - } - - /// - /// clear the gesture state change callback. - /// - public void ClearCallbacks() - { - lock (_handlers) - { - int i = 0; - foreach (var handler in _handlers) - { - if (handler.Action != null) - { - Interop.Elementary.elm_gesture_layer_cb_set(Handle, handler.Type, handler.State, null, new IntPtr(i)); - handler.Action = null; - } - i++; - } - } - } - - #region Typed callback setting methods - - // Following methods have been added for convenience, so the user will not have to convert Info structures himself - /// - /// Set the tap callback. - /// - /// The gesture you want to track state of. - /// The event the callback tracks (START, MOVE, END, ABORT). - /// The callback itself. - public void SetTapCallback(GestureType type, GestureState state, Action action) - { - SetCallback(type, state, action); - } - - /// - /// Set the gesture state change callback with Momentum Gesture Type - /// - /// The event the callback tracks (START, MOVE, END, ABORT). - /// The callback itself. - public void SetMomentumCallback(GestureState state, Action action) - { - SetCallback(GestureType.Momentum, state, action); - } - - /// - /// Set the gesture state change callback with Line Gesture Type - /// - /// The event the callback tracks (START, MOVE, END, ABORT). - /// The callback itself. - public void SetLineCallback(GestureState state, Action action) - { - SetCallback(GestureType.Line, state, action); - } - - /// - /// Set the gesture state change callback with Flick Gesture Type - /// - /// The event the callback tracks (START, MOVE, END, ABORT). - /// The callback itself. - public void SetFlickCallback(GestureState state, Action action) - { - SetCallback(GestureType.Flick, state, action); - } - - /// - /// Set the gesture state change callback with Zoom Gesture Type - /// - /// The event the callback tracks (START, MOVE, END, ABORT). - /// The callback itself. - public void SetZoomCallback(GestureState state, Action action) - { - SetCallback(GestureType.Zoom, state, action); - } - - /// - /// Set the gesture state change callback with Rotate Gesture Type - /// - /// The event the callback tracks (START, MOVE, END, ABORT). - /// The callback itself. - public void SetRotateCallback(GestureState state, Action action) - { - SetCallback(GestureType.Rotate, state, action); - } - - #endregion Typed callback setting methods - - /// - /// Call this function to construct a new gesture-layer object. - /// - /// The gesture layer's parent widget. - /// - protected override IntPtr CreateHandle(EvasObject parent) - { - return Interop.Elementary.elm_gesture_layer_add(parent); - } - - /// - /// clear the gesture state change callback. - /// - protected override void OnUnrealize() - { - ClearCallbacks(); - base.OnUnrealize(); - } - - private void SetCallback(GestureType type, GestureState state, Action action) - { - if (action == null) - SetGestureCallback(type, state, null); - else - SetGestureCallback(type, state, new Action((info) => action((T)info))); - } - - private void GestureCallbackHandler(IntPtr data, IntPtr event_info) - { - // so EFL called our callback, lets use data to find the right Action to call - var handlerIndex = (int)data; - // thanks to the fact that we never remove item from _handlers, we don't need a lock here - if (handlerIndex < 0 || handlerIndex >= _handlers.Count) - return; - Action action = _handlers[handlerIndex].Action; - if (action == null) - return; - // the interpretation of the event_info struct pointer depends on the GestureType - switch (_handlers[handlerIndex].Type) - { - case GestureType.Tap: - case GestureType.LongTap: - case GestureType.DoubleTap: - case GestureType.TripleTap: - action(Marshal.PtrToStructure(event_info)); - break; - - case GestureType.Momentum: - action(Marshal.PtrToStructure(event_info)); - break; - - case GestureType.Line: - case GestureType.Flick: - action(Marshal.PtrToStructure(event_info)); - break; - - case GestureType.Zoom: - action(Marshal.PtrToStructure(event_info)); - break; - - case GestureType.Rotate: - action(Marshal.PtrToStructure(event_info)); - break; - } - } - - #region Info structures - - /// - /// The struct of TapData - /// - [StructLayout(LayoutKind.Sequential)] - public struct TapData - { - /// - /// The x coordinate of the center point. - /// - public Int32 X; - - /// - /// The y coordinate of the center point. - /// - public Int32 Y; - -#pragma warning disable 3003 - - /// - /// The number of fingers tapped. - /// - public UInt32 FingersCount; - - /// - /// The timestamp. - /// - public UInt32 Timestamp; - -#pragma warning restore 3003 - } - - /// - /// The struct of MomentumData - /// - [StructLayout(LayoutKind.Sequential)] - public struct MomentumData - { - /// - /// Final-swipe direction starting point on X. - /// - public Int32 X1; - - /// - /// Final-swipe direction starting point on Y. - /// - public Int32 Y1; - - /// - /// Final-swipe direction ending point on X. - /// - public Int32 X2; - - /// - /// Final-swipe direction ending point on Y - /// - public Int32 Y2; - -#pragma warning disable 3003 - - /// - /// Timestamp of start of final x-swipe. - /// - public UInt32 HorizontalSwipeTimestamp; - - /// - /// Timestamp of start of final y-swipe. - /// - public UInt32 VerticalSwipeTimestamp; - - /// - /// Momentum on X. - /// - public Int32 HorizontalMomentum; - - /// - /// Momentum on Y. - /// - public Int32 VerticalMomentum; - - /// - /// Number of fingers. - /// - public UInt32 FingersCount; - -#pragma warning restore 3003 - } - - /// - /// The struct of LineData - /// - [StructLayout(LayoutKind.Sequential)] - public struct LineData - { - /// - /// Final-swipe direction starting point on X. - /// - public Int32 X1; - - /// - /// Final-swipe direction starting point on Y. - /// - public Int32 Y1; - - /// - /// Final-swipe direction ending point on X. - /// - public Int32 X2; - - /// - /// Final-swipe direction ending point on Y - /// - public Int32 Y2; - -#pragma warning disable 3003 - - /// - /// Timestamp of start of final x-swipe. - /// - public UInt32 HorizontalSwipeTimestamp; - - /// - /// Timestamp of start of final y-swipe. - /// - public UInt32 VerticalSwipeTimestamp; - - /// - /// Momentum on X. - /// - public Int32 HorizontalMomentum; - - /// - /// Momentum on Y. - /// - public Int32 VerticalMomentum; - - /// - /// Number of fingers. - /// - public UInt32 FingersCount; - -#pragma warning restore 3003 - - /// - /// Angle (direction) of lines. - /// - public double Angle; - } - - /// - /// The struct of ZoomData - /// - [StructLayout(LayoutKind.Sequential)] - public struct ZoomData - { - /// - /// The x coordinate of zoom center point reported to user. - /// - public Int32 X; - - /// - /// The y coordinate of zoom center point reported to user. - /// - public Int32 Y; - - /// - /// The radius (distance) between fingers reported to user. - /// - public Int32 Radius; - - /// - /// The zoom value. 1.0 means no zoom. - /// - public double Zoom; - - /// - /// Zoom momentum: zoom growth per second (NOT YET SUPPORTED). - /// - private double Momentum; - } - - /// - /// The struct of RotateData - /// - [StructLayout(LayoutKind.Sequential)] - public struct RotateData - { - /// - /// The x coordinate of rotation center point reported to user. - /// - public Int32 X; - - /// - /// The y coordinate of rotation center point reported to user. - /// - public Int32 Y; - - /// - /// The radius (distance) between fingers reported to user. - /// - public Int32 Radius; - - /// - /// The start-angle. - /// - public double BaseAngle; - - /// - /// The rotation value. 0.0 means no rotation. - /// - public double Angle; - - /// - /// Rotation momentum: rotation done per second (NOT YET SUPPORTED). - /// - private double Momentum; - } - - #endregion Info structures - - /// - /// Config is a static class, it provides gestureLayer's timeout information. - /// - public static class Config - { - /// - /// Sets or gets the duration for occurring long tap event of gesture layer. - /// - public static double DefaultLongTapTimeout - { - get - { - return Interop.Elementary.elm_config_glayer_long_tap_start_timeout_get(); - } - set - { - Interop.Elementary.elm_config_glayer_long_tap_start_timeout_set(value); - } - } - - /// - /// Sets or gets the duration for occurring double tap event of gesture layer. - /// - public static double DefaultDoubleTapTimeout - { - get - { - return Interop.Elementary.elm_config_glayer_double_tap_timeout_get(); - } - set - { - Interop.Elementary.elm_config_glayer_double_tap_timeout_set(value); - } - } - } - - private class NativeCallback - { - public readonly GestureType Type; - public readonly GestureState State; - public Action Action; - - public NativeCallback(GestureType type, GestureState state, Action action) - { - Type = type; - State = state; - Action = action; - } - } - } -} \ No newline at end of file diff --git a/src/ElmSharp/ElmSharp/Hoversel.cs b/src/ElmSharp/ElmSharp/Hoversel.cs deleted file mode 100644 index 6adca6267..000000000 --- a/src/ElmSharp/ElmSharp/Hoversel.cs +++ /dev/null @@ -1,207 +0,0 @@ -/* - * 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 ElmSharp -{ - /// - /// The HoverselItemEventArgs is an HoverselItem's EventArgs - /// - public class HoverselItemEventArgs : EventArgs - { - /// - /// Hoversel's Item - /// - public HoverselItem Item { get; set; } - - internal static HoverselItemEventArgs CreateFromSmartEvent(IntPtr data, IntPtr obj, IntPtr info) - { - HoverselItem item = ItemObject.GetItemByHandle(info) as HoverselItem; - return new HoverselItemEventArgs() { Item = item }; - } - } - - /// - /// The hoversel is a button that pops up a list of items. - /// - public class Hoversel : Layout - { - SmartEvent _clicked; - SmartEvent _expanded; - SmartEvent _dismissed; - SmartEvent _selected; - Interop.Evas.SmartCallback _onItemSelected; - - /// - /// Creates and initializes a new instance of the Hoversel class. - /// - /// The parent is a given container which will be attached by Hoversel as a child. It's type. - public Hoversel(EvasObject parent) : base(parent) - { - _clicked = new SmartEvent(this, "clicked"); - _clicked.On += (sender, e) => - { - Clicked?.Invoke(this, EventArgs.Empty); - }; - _expanded = new SmartEvent(this, "expanded"); - _expanded.On += (sender, e) => - { - Expanded?.Invoke(this, EventArgs.Empty); - }; - _dismissed = new SmartEvent(this, "dismissed"); - _dismissed.On += (sender, e) => - { - Dismissed?.Invoke(this, EventArgs.Empty); - }; - _selected = new SmartEvent(this, RealHandle, "selected", HoverselItemEventArgs.CreateFromSmartEvent); - _selected.On += (s, e) => - { - if (e.Item != null) ItemSelected?.Invoke(this, e); - }; - _onItemSelected = (data, obj, info) => - { - HoverselItem item = ItemObject.GetItemById((int)data) as HoverselItem; - item?.SendItemSelected(); - }; - } - - /// - /// Clicked will be triggered when Hoversel is clicked - /// - public event EventHandler Clicked; - - /// - /// Expanded will be triggered when Hoversel is activated by clicking the hoversel or by a function - /// - public event EventHandler Expanded; - - /// - /// Dismissed will be triggered when Hoversel Dismissed - /// - public event EventHandler Dismissed; - - /// - /// ItemSelected will be triggered when Hoversel's Item Selected - /// - public event EventHandler ItemSelected; - - /// - /// Gets or sets the status to control whether the hoversel should expand horizontally. - /// - public bool IsHorizontal - { - get - { - return Interop.Elementary.elm_hoversel_horizontal_get(RealHandle); - } - set - { - Interop.Elementary.elm_hoversel_horizontal_set(RealHandle, value); - } - } - - /// - /// Gets or sets the hover parent. - /// - public IntPtr HoverParent - { - get - { - return Interop.Elementary.elm_hoversel_hover_parent_get(RealHandle); - } - set - { - Interop.Elementary.elm_hoversel_hover_parent_set(RealHandle, value); - } - } - - /// - /// Gets the flag of whether the hoversel is expanded. - /// - public bool IsExpanded - { - get - { - return Interop.Elementary.elm_hoversel_expanded_get(RealHandle); - } - } - - /// - /// Gets or sets the status of whether update icon and text of hoversel same to those of selected item automatically. - /// - public bool AutoUpdate - { - get - { - return Interop.Elementary.elm_hoversel_auto_update_get(RealHandle); - } - set - { - Interop.Elementary.elm_hoversel_auto_update_set(RealHandle, value); - } - } - - /// - /// This triggers the hoversel popup from code, the same as if the user had clicked the button. - /// - public void HoverBegin() - { - Interop.Elementary.elm_hoversel_hover_begin(RealHandle); - } - - /// - /// This dismisses the hoversel popup as if the user had clicked outside the hover. - /// - public void HoverEnd() - { - Interop.Elementary.elm_hoversel_hover_end(RealHandle); - } - - /// - /// This will remove all the children items from the hoversel. - /// - public void Clear() - { - Interop.Elementary.elm_hoversel_clear(RealHandle); - } - - /// - /// Add an item to the hoversel button. - /// This adds an item to the hoversel to show when it is clicked. - /// - /// Item's label - /// A handle to the added item. - public HoverselItem AddItem(string label) - { - HoverselItem item = new HoverselItem(); - item.Label = label; - item.Handle = Interop.Elementary.elm_hoversel_item_add(RealHandle, label, null, 0, _onItemSelected, (IntPtr)item.Id); - return item; - } - - protected override IntPtr CreateHandle(EvasObject parent) - { - IntPtr handle = Interop.Elementary.elm_layout_add(parent.Handle); - Interop.Elementary.elm_layout_theme_set(handle, "layout", "background", "default"); - - RealHandle = Interop.Elementary.elm_hoversel_add(handle); - Interop.Elementary.elm_object_part_content_set(handle, "elm.swallow.content", RealHandle); - - return handle; - } - } -} diff --git a/src/ElmSharp/ElmSharp/HoverselItem.cs b/src/ElmSharp/ElmSharp/HoverselItem.cs deleted file mode 100755 index ebdaece2b..000000000 --- a/src/ElmSharp/ElmSharp/HoverselItem.cs +++ /dev/null @@ -1,45 +0,0 @@ -/* - * 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 ElmSharp -{ - /// - /// The HoverselItem is the Item of Hoversel - /// - public class HoverselItem : ItemObject - { - internal HoverselItem() : base(IntPtr.Zero) - { - } - - /// - /// HoverselItem's label - /// - public string Label { get; internal set; } - - /// - /// ItemSelected will be triggered when HoverselItem Selected - /// - public event EventHandler ItemSelected; - - internal void SendItemSelected() - { - ItemSelected?.Invoke(this, EventArgs.Empty); - } - } -} diff --git a/src/ElmSharp/ElmSharp/IAccessibleObject.cs b/src/ElmSharp/ElmSharp/IAccessibleObject.cs deleted file mode 100755 index f1488ffc6..000000000 --- a/src/ElmSharp/ElmSharp/IAccessibleObject.cs +++ /dev/null @@ -1,37 +0,0 @@ -/* - * 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. - */ - -namespace ElmSharp.Accessible -{ - /// - /// IAccessibleObject is a interface which defines properties and methods of accessible object. - /// - public interface IAccessibleObject - { - ReadingInfoType ReadingInfoType { get; set; } - AccessRole Role { get; set; } - bool CanHighlight { get; set; } - string TranslationDomain { get; set; } - string Name { get; set; } - string Description { get; set; } - AccessibleInfoProvider NameProvider { get; set; } - AccessibleInfoProvider DescriptionProvider { get; set; } - void AppendRelation(IAccessibleRelation relation); - void RemoveRelation(IAccessibleRelation relation); - void Highlight(); - void Unhighlight(); - } -} diff --git a/src/ElmSharp/ElmSharp/Icon.cs b/src/ElmSharp/ElmSharp/Icon.cs deleted file mode 100755 index 3ebff8fd8..000000000 --- a/src/ElmSharp/ElmSharp/Icon.cs +++ /dev/null @@ -1,115 +0,0 @@ -/* - * 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 ElmSharp -{ - /// - /// Enumeration for the icon lookup order. Should look for icons in the theme, FDO paths, or both. - /// - public enum IconLookupOrder - { - /// - /// Icon look up order: freedesktop, theme - /// - FreeDesktopFirst = 0, - /// - /// Icon look up order: theme, freedesktop - /// - ThemeFirst, - /// - /// Icon look up order: freedesktop - /// - FreeDesktopOnly, - /// - /// Icon look up order: theme - /// - ThemeOnly - } - - /// - /// The Icon is a widget that displays standard icon images ("delete", "edit", "arrows", etc.) - /// or images coming from a custom file (PNG, JPG, EDJE, etc.), on icon context. - /// Inherits Image - /// - public class Icon : Image - { - /// - /// Creates and initializes a new instance of Icon class. - /// - /// The parent is a given container which will be attached by Icon as a child. It's type. - public Icon(EvasObject parent) : base(parent) - { - } - - /// - /// Sets or gets the standard icon name of a given Icon widget. - /// - public string StandardIconName - { - get - { - return Interop.Elementary.elm_icon_standard_get(RealHandle); - } - set - { - Interop.Elementary.elm_icon_standard_set(RealHandle, value); - } - } - - /// - /// Sets or gets the icon lookup order of a given Icon widget. - /// - public IconLookupOrder IconLookupOrder - { - get - { - return (IconLookupOrder)Interop.Elementary.elm_icon_order_lookup_get(RealHandle); - } - set - { - Interop.Elementary.elm_icon_order_lookup_set(RealHandle, (int)value); - } - } - - /// - /// Sets the file that is used, but uses a generated thumbnail. - /// - /// The path to the file that is used as an icon image - /// The group that the icon belongs to - public void SetThumb(string file, string group) - { - Interop.Elementary.elm_icon_thumb_set(RealHandle, file, group); - } - - /// - /// Adds a new icon object to the parent. - /// - /// EvasObject - /// The new object, otherwise NULL if it cannot be created - protected override IntPtr CreateHandle(EvasObject parent) - { - IntPtr handle = Interop.Elementary.elm_layout_add(parent.Handle); - Interop.Elementary.elm_layout_theme_set(handle, "layout", "background", "default"); - - RealHandle = Interop.Elementary.elm_icon_add(handle); - Interop.Elementary.elm_object_part_content_set(handle, "elm.swallow.content", RealHandle); - - return handle; - } - } -} diff --git a/src/ElmSharp/ElmSharp/Image.cs b/src/ElmSharp/ElmSharp/Image.cs deleted file mode 100644 index 743cb4264..000000000 --- a/src/ElmSharp/ElmSharp/Image.cs +++ /dev/null @@ -1,688 +0,0 @@ -/* - * 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.IO; -using System.Threading; -using System.Threading.Tasks; - -namespace ElmSharp -{ - /// - /// The Image is a widget that allows one to load and display an image file on it, - /// be it from a disk file or from a memory region. - /// Inherits Widget - /// - public class Image : Widget - { - bool _canScaleUp = true; - bool _canScaleDown = true; - SmartEvent _clicked; - Color _color = Color.Default; - - /// - /// Creates and initializes a new instance of Image class. - /// - /// The parent is a given container which will be attached by Image as a child. It's type. - public Image(EvasObject parent) : base(parent) - { - _clicked = new SmartEvent(this, "clicked"); - _clicked.On += (s, e) => Clicked?.Invoke(this, EventArgs.Empty); - } - - /// - /// Clicked will be triggered when the image is clicked. - /// - public event EventHandler Clicked; - - /// - /// LoadingCompleted will be triggered when the image is loaded completely. - /// - public event EventHandler LoadingCompleted; - - /// - /// Clicked will be triggered when the image is fail to load. - /// - public event EventHandler LoadingFailed; - - /// - /// Gets the file that is used as an image. - /// - public string File - { - get - { - return Interop.Elementary.elm_image_file_get(RealHandle); - } - } - - /// - /// Sets or gets the smooth effect for an image. - /// - public bool IsSmooth - { - get - { - return Interop.Elementary.elm_image_smooth_get(RealHandle); - } - set - { - Interop.Elementary.elm_image_smooth_set(RealHandle, value); - } - } - - /// - /// Sets or gets whether scaling is disabled on the object. - /// - public bool IsScaling - { - get - { - return !Interop.Elementary.elm_image_no_scale_get(RealHandle); - } - set - { - Interop.Elementary.elm_image_no_scale_set(RealHandle, !value); - } - } - - /// - /// Sets or gets whether the object is down resizeable. - /// - public bool CanScaleDown - { - get - { - return _canScaleDown; - } - set - { - _canScaleDown = value; - Interop.Elementary.elm_image_resizable_set(RealHandle, _canScaleUp, _canScaleDown); - } - } - - /// - /// Sets or gets whether the object is up resizeable. - /// - public bool CanScaleUp - { - get - { - return _canScaleUp; - } - set - { - _canScaleUp = value; - Interop.Elementary.elm_image_resizable_set(RealHandle, _canScaleUp, _canScaleDown); - } - } - - /// - /// Sets or gets whether the image fills the entire object area, when keeping the aspect ratio. - /// - public bool CanFillOutside - { - get - { - return Interop.Elementary.elm_image_fill_outside_get(RealHandle); - } - set - { - Interop.Elementary.elm_image_fill_outside_set(RealHandle, value); - } - } - - /// - /// Sets or gets the prescale size for the image. - /// - public int PrescaleSize - { - get - { - return Interop.Elementary.elm_image_prescale_get(RealHandle); - } - set - { - Interop.Elementary.elm_image_prescale_set(RealHandle, value); - } - } - - /// - /// Sets or gets whether the original aspect ratio of the image should be kept on resize. - /// - public bool IsFixedAspect - { - get - { - return Interop.Elementary.elm_image_aspect_fixed_get(RealHandle); - } - set - { - Interop.Elementary.elm_image_aspect_fixed_set(RealHandle, value); - } - } - - /// - /// Sets or gets whether an image object (which supports animation) is to animate itself. - /// - public bool IsAnimated - { - get - { - return Interop.Elementary.elm_image_animated_get(RealHandle); - } - set - { - Interop.Elementary.elm_image_animated_set(RealHandle, value); - } - } - - /// - /// Gets whether an image object supports animation. - /// - public bool IsAnimatedAvailable - { - get - { - return Interop.Elementary.elm_image_animated_available_get(RealHandle); - } - } - - /// - /// Sets or gets whether an image object is under animation. - /// - /// - /// An image object, even if it supports animation, will be displayed by default without animation. - /// To actually start playing any image object's animation, should be TRUE before setting this property true. - /// - public bool IsAnimationPlaying - { - get - { - return Interop.Elementary.elm_image_animated_play_get(RealHandle); - } - set - { - Interop.Elementary.elm_image_animated_play_set(RealHandle, value); - } - } - - /// - /// Sets or gets whether the image is 'editable'. - /// - public bool IsEditable - { - get - { - return Interop.Elementary.elm_image_editable_get(RealHandle); - } - set - { - Interop.Elementary.elm_image_editable_set(RealHandle, value); - } - } - - /// - /// Gets the current size of the image. - /// - public Size ObjectSize - { - get - { - Interop.Elementary.elm_image_object_size_get(RealHandle, out int w, out int h); - return new Size(w, h); - } - } - - /// - /// Sets or gets whether alpha channel data is being used on the given image object. - /// - public bool IsOpaque - { - get - { - IntPtr evasObj = Interop.Elementary.elm_image_object_get(RealHandle); - if (evasObj != IntPtr.Zero) - { - return !Interop.Evas.evas_object_image_alpha_get(evasObj); - } - return false; - } - set - { - IntPtr evasObj = Interop.Elementary.elm_image_object_get(RealHandle); - if (evasObj != IntPtr.Zero) - { - Interop.Evas.evas_object_image_alpha_set(evasObj, !value); - } - } - } - - /// - /// Sets or gets the image orientation. - /// - public ImageOrientation Orientation - { - get - { - return (ImageOrientation)Interop.Elementary.elm_image_orient_get(RealHandle); - } - set - { - Interop.Elementary.elm_image_orient_set(RealHandle, (int)value); - } - } - - /// - /// Sets or gets the image color - /// - public override Color Color - { - get - { - return _color; - } - set - { - IntPtr evasObj = Interop.Elementary.elm_image_object_get(RealHandle); - if (evasObj != IntPtr.Zero) - { - if (value.IsDefault) - { - // Currently, we assume the Image.Color property as a blending color (actually, multiply blending). - // Thus we are using Color.White (255,255,255,255) as a default color to ensure original image color. (255/255 * original = original) - Interop.Evas.evas_object_color_set(evasObj, 255, 255, 255, 255); - } - else - { - Interop.Evas.SetPremultipliedColor(evasObj, value.R, value.G, value.B, value.A); - } - } - _color = value; - } - } - - /// - /// Sets the background color - /// - public override Color BackgroundColor - { - set - { - if (value.IsDefault) - { - SetPartColor("bg", Color.Transparent); - } - else - { - SetPartColor("bg", value); - } - _backgroundColor = value; - } - } - - /// - /// Sets the dimensions for an image object's border, a region which is not scaled together with its center ever. - /// - /// The border's left width - /// The border's right width - /// The border's top width - /// The border's bottom width - public void SetBorder(int left, int right, int top, int bottom) - { - IntPtr evasObj = Interop.Elementary.elm_image_object_get(RealHandle); - Interop.Evas.evas_object_image_border_set(evasObj, left, right, top, bottom); - } - - /// - /// Sets or gets if the center part of the given image object (not the border) should be drawn. - /// - /// - /// When rendering, the image may be scaled to fit the size of the image object. - /// This function sets if the center part of the scaled image is to be drawn or left completely blank, or forced to be solid. - /// Very useful for frames and decorations. - /// - public ImageBorderFillMode BorderCenterFillMode - { - get - { - IntPtr evasObj = Interop.Elementary.elm_image_object_get(RealHandle); - return (ImageBorderFillMode)Interop.Evas.evas_object_image_border_center_fill_get(evasObj); - } - set - { - IntPtr evasObj = Interop.Elementary.elm_image_object_get(RealHandle); - Interop.Evas.evas_object_image_border_center_fill_set(evasObj, (int)value); - } - } - - /// - /// Sets the file that is used as the image's source. - /// - /// The path to the file that is used as an image source - /// (true = success, false = error) - public bool Load(string file) - { - if (file == null) - throw new ArgumentNullException("file"); - - Interop.Elementary.elm_image_async_open_set(RealHandle, false); - Interop.Elementary.elm_image_preload_disabled_set(RealHandle, true); - return Interop.Elementary.elm_image_file_set(RealHandle, file, null); - } - - /// - /// Sets the uri that is used as the image's source. - /// - /// The uri to the file that is used as an image source - /// (true = success, false = error) - public bool Load(Uri uri) - { - if (uri == null) - throw new ArgumentNullException("uri"); - - return Load(uri.IsFile ? uri.LocalPath : uri.AbsoluteUri); - } - - /// - /// Sets a location in the memory to be used as an image object's source bitmap. - /// - /// - /// This function is handy when the contents of an image file are mapped into the memory, for example. - /// The format string should be something like "png", "jpg", "tga", "tiff", "bmp" etc, when provided (null, on the contrary). - /// This improves the loader performance as it tries the "correct" loader first, before trying a range of other possible loaders until one succeeds. - /// - /// The binary data that is used as an image source - /// The size of the binary data blob img - /// (true = success, false = error) - [Obsolete("This method will be removed. Use Load(Stream stream) instead.")] - public unsafe bool Load(byte* img, long size) - { - if (img == null) - throw new ArgumentNullException("img"); - - Interop.Elementary.elm_image_async_open_set(RealHandle, false); - Interop.Elementary.elm_image_preload_disabled_set(RealHandle, true); - return Interop.Elementary.elm_image_memfile_set(RealHandle, img, size, IntPtr.Zero, IntPtr.Zero); - } - - /// - /// Sets the stream that is used as the image's source. - /// - /// The stream that is used as an image source - /// (true = success, false = error) - public bool Load(Stream stream) - { - if (stream == null) - throw new ArgumentNullException("stream"); - - Interop.Elementary.elm_image_async_open_set(RealHandle, false); - Interop.Elementary.elm_image_preload_disabled_set(RealHandle, true); - MemoryStream memstream = new MemoryStream(); - stream.CopyTo(memstream); - unsafe - { - byte[] dataArr = memstream.ToArray(); - fixed (byte* data = &dataArr[0]) - { - return Interop.Elementary.elm_image_memfile_set(RealHandle, data, dataArr.Length, IntPtr.Zero, IntPtr.Zero); - } - } - } - - /// - /// Sets the file that is used as the image's source with async. - /// - /// The path to the file that is used as an image source - /// cancellation token - /// (true = success, false = error) - public Task LoadAsync(string file, CancellationToken cancellationToken = default(CancellationToken)) - { - if (file == null) - throw new ArgumentNullException("file"); - - Interop.Elementary.elm_image_async_open_set(RealHandle, true); - Interop.Elementary.elm_image_preload_disabled_set(RealHandle, false); - - var tcs = new TaskCompletionSource(); - - cancellationToken.Register(() => - { - if (tcs != null && !tcs.Task.IsCompleted) - { - tcs.SetCanceled(); - } - }); - - SmartEvent loadReady = new SmartEvent(this, RealHandle, "load,ready"); - loadReady.On += (s, e) => - { - loadReady.Dispose(); - LoadingCompleted?.Invoke(this, EventArgs.Empty); - if (tcs != null && !tcs.Task.IsCompleted) - { - tcs.SetResult(true); - } - }; - - SmartEvent loadError = new SmartEvent(this, RealHandle, "load,error"); - loadError.On += (s, e) => - { - loadError.Dispose(); - LoadingFailed?.Invoke(this, EventArgs.Empty); - if (tcs != null && !tcs.Task.IsCompleted) - { - tcs.SetResult(false); - } - }; - - bool ret = Interop.Elementary.elm_image_file_set(RealHandle, file, null); - if (!ret) - { - throw new InvalidOperationException("Failed to set file to Image"); - } - - return tcs.Task; - } - - /// - /// Sets the uri that is used as the image's source with async. - /// - /// The uri to the file that is used as an image source - /// cancellation token - /// (true = success, false = error) - public Task LoadAsync(Uri uri, CancellationToken cancellationToken = default(CancellationToken)) - { - if (uri == null) - throw new ArgumentNullException("uri"); - - return LoadAsync(uri.IsFile ? uri.LocalPath : uri.AbsoluteUri, cancellationToken); - } - - /// - /// Sets the stream that is used as the image's source with async. - /// - /// The stream that is used as an image source - /// cancellation token - /// (true = success, false = error) - public async Task LoadAsync(Stream stream, CancellationToken cancellationToken = default(CancellationToken)) - { - if (stream == null) - throw new ArgumentNullException("stream"); - - Interop.Elementary.elm_image_async_open_set(RealHandle, true); - Interop.Elementary.elm_image_preload_disabled_set(RealHandle, false); - - var tcs = new TaskCompletionSource(); - - cancellationToken.Register(() => - { - if (tcs != null && !tcs.Task.IsCompleted) - { - tcs.SetCanceled(); - } - }); - - SmartEvent loadReady = new SmartEvent(this, RealHandle, "load,ready"); - loadReady.On += (s, e) => - { - loadReady.Dispose(); - LoadingCompleted?.Invoke(this, EventArgs.Empty); - if (tcs != null && !tcs.Task.IsCompleted) - { - tcs.SetResult(true); - } - }; - - SmartEvent loadError = new SmartEvent(this, RealHandle, "load,error"); - loadError.On += (s, e) => - { - loadError.Dispose(); - LoadingFailed?.Invoke(this, EventArgs.Empty); - if (tcs != null && !tcs.Task.IsCompleted) - { - tcs.SetResult(false); - } - }; - - MemoryStream memstream = new MemoryStream(); - await stream.CopyToAsync(memstream); - - unsafe - { - byte[] dataArr = memstream.ToArray(); - fixed (byte* data = &dataArr[0]) - { - bool ret = Interop.Elementary.elm_image_memfile_set(RealHandle, data, dataArr.Length, IntPtr.Zero, IntPtr.Zero); - if (!ret) - { - return false; - } - } - } - - return await tcs.Task; - } - - /// - /// Sets the color of color class for a given widget. - /// - /// The name of color class. - /// The struct of color - public override void SetPartColor(string part, Color color) - { - Interop.Elementary.elm_object_color_class_color_set(Handle, part, color.R * color.A / 255, - color.G * color.A / 255, - color.B * color.A / 255, - color.A); - } - - /// - /// Gets the color of color class for a given widget. - /// - /// The name of color class. - /// color object - public override Color GetPartColor(string part) - { - Interop.Elementary.elm_object_color_class_color_get(Handle, part, out int r, out int g, out int b, out int a); - return new Color((int)(r / (a / 255.0)), (int)(g / (a / 255.0)), (int)(b / (a / 255.0)), a); - } - - /// - /// Sets the content at a part of a given container widget. - /// - /// The parent is a given container which will be attached by Image as a child. It's type. - /// The new object, otherwise null if it cannot be created - protected override IntPtr CreateHandle(EvasObject parent) - { - IntPtr handle = Interop.Elementary.elm_layout_add(parent); - Interop.Elementary.elm_layout_theme_set(handle, "layout", "background", "default"); - - RealHandle = Interop.Elementary.elm_image_add(handle); - Interop.Elementary.elm_object_part_content_set(handle, "elm.swallow.content", RealHandle); - - return handle; - } - } - - /// - /// Enumeration for the fill mode of image border - /// - public enum ImageBorderFillMode - { - /// - /// None mode of image border - /// - None, - - /// - /// Default mode of image border - /// - Default, - - /// - /// Solid mode of image border - /// - Solid, - } - - /// - /// Enumeration for the possible orientation options - /// - public enum ImageOrientation : int - { - /// - /// No orientation change - /// - None = 0, - - /// - /// Rotate 90 degrees clockwise - /// - Rotate90, - - /// - /// Rotate 180 degrees clockwise - /// - Rotate180, - - /// - /// Rotate 90 degrees counter-clockwise (i.e. 270 degrees clockwise) - /// - Rotate270, - - /// - /// Flip image horizontally - /// - FlipHorizontal, - - /// - /// Flip image vertically - /// - FlipVertical, - - /// - /// Flip the image along the y = (width - x) line (bottom-left to top-right) - /// - FlipTranspose, - - /// - /// Flip the image along the y = x line (top-left to bottom-right) - /// - FlipTransverse - } -} \ No newline at end of file diff --git a/src/ElmSharp/ElmSharp/Index.cs b/src/ElmSharp/ElmSharp/Index.cs deleted file mode 100755 index f73ec7acc..000000000 --- a/src/ElmSharp/ElmSharp/Index.cs +++ /dev/null @@ -1,260 +0,0 @@ -/* - * 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.Collections.Generic; - -namespace ElmSharp -{ - /// - /// An index widget gives you an index for fast access to whichever group of other UI items one might have. - /// Inherits Layout - /// - public class Index : Layout - { - HashSet _children = new HashSet(); - SmartEvent _delayedChanged; - - /// - /// Creates and initializes a new instance of Index class. - /// - /// The parent is a given container which will be attached by Index as a child. It's type. - public Index(EvasObject parent) : base(parent) - { - _delayedChanged = new SmartEvent(this, this.RealHandle, "delay,changed"); - _delayedChanged.On += _delayedChanged_On; - } - - /// - /// Changed will be triggered when the selected index item is changed. - /// - public event EventHandler Changed; - - /// - /// Sets or gets the auto hiding feature is enabled or not for a given index widget. - /// - public bool AutoHide - { - get - { - return !Interop.Elementary.elm_index_autohide_disabled_get(RealHandle); - } - set - { - Interop.Elementary.elm_index_autohide_disabled_set(RealHandle, !value); - } - } - - /// - /// Sets or gets a value whether horizontal mode is enabled or not. - /// - public bool IsHorizontal - { - get - { - return Interop.Elementary.elm_index_horizontal_get(RealHandle); - } - set - { - Interop.Elementary.elm_index_horizontal_set(RealHandle, value); - } - } - - /// - /// Sets or gets the value of indicator's disabled status. - /// - public bool IndicatorVisible - { - get - { - return !Interop.Elementary.elm_index_indicator_disabled_get(RealHandle); - } - set - { - Interop.Elementary.elm_index_indicator_disabled_set(RealHandle, !value); - } - } - - /// - /// Sets or gets the omit feature is enabled or not for a given index widget. - /// - public bool OmitEnabled - { - get - { - return Interop.Elementary.elm_index_omit_enabled_get(RealHandle); - } - set - { - Interop.Elementary.elm_index_omit_enabled_set(RealHandle, value); - } - } - - /// - /// Set a delay change time for index object. - /// delay time is 0.2 sec by default. - /// - public double Delay - { - get - { - return Interop.Elementary.elm_index_delay_change_time_get(RealHandle); - } - set - { - Interop.Elementary.elm_index_delay_change_time_set(RealHandle, value); - } - } - - /// - /// Gets or sets the items level for a given index widget. - /// - public int Level - { - get - { - return Interop.Elementary.elm_index_item_level_get(RealHandle); - } - set - { - Interop.Elementary.elm_index_item_level_set(RealHandle, value); - } - } - - /// - /// Control standard_priority group of index. - /// Priority group will be shown as many items as it can, and other group will be shown one character only. - /// - public int Priority - { - get - { - return Interop.Elementary.elm_index_standard_priority_get(RealHandle); - } - set - { - Interop.Elementary.elm_index_standard_priority_set(RealHandle, value); - } - } - - /// - /// Gets the last selected item, for a given index widget. - /// - public IndexItem SelectedItem - { - get - { - IntPtr handle = Interop.Elementary.elm_index_selected_item_get(RealHandle, 0); - return ItemObject.GetItemByHandle(handle) as IndexItem; - } - } - - /// - /// Append a new item on a given index widget. - /// - /// the label which the item should be indexed - /// A object to the IndexItem added or null, on errors - public IndexItem Append(string label) - { - IndexItem item = new IndexItem(label); - item.Handle = Interop.Elementary.elm_index_item_append(RealHandle, label, null, (IntPtr)item.Id); - return item; - } - - /// - /// Prepend a new item on a given index widget. - /// - /// the label which the item should be indexed - /// A handle to the item added or NULL, on errors - public IndexItem Prepend(string label) - { - IndexItem item = new IndexItem(label); - item.Handle = Interop.Elementary.elm_index_item_prepend(RealHandle, label, null, (IntPtr)item.Id); - return item; - } - - /// - /// Insert a new item into the index object before item before. - /// - /// the label which the item should be indexed - /// The index item to insert after. - /// A object to the IndexItem added or null, on errors - public IndexItem InsertBefore(string label, IndexItem before) - { - IndexItem item = new IndexItem(label); - item.Handle = Interop.Elementary.elm_index_item_insert_before(RealHandle, before, label, null, (IntPtr)item.Id); - return item; - } - - /// - /// Insert a new item into the index object after item after. - /// - /// the label which the item should be indexed - /// The index item to insert after. - /// A object to the IndexItem added or null, on errors - public IndexItem InsertAfter(string label, IndexItem after) - { - IndexItem item = new IndexItem(label); - item.Handle = Interop.Elementary.elm_index_item_insert_after(RealHandle, after, label, null, (IntPtr)item.Id); - return item; - } - - /// - /// Flush the changes made to the index items so they work correctly. - /// - /// The index level (one of 0 or 1) where changes were made - public void Update(int level) - { - Interop.Elementary.elm_index_level_go(RealHandle, level); - } - - /// - /// Removes all items from a given index widget. - /// - public void Clear() - { - Interop.Elementary.elm_index_item_clear(RealHandle); - } - - protected override IntPtr CreateHandle(EvasObject parent) - { - IntPtr handle = Interop.Elementary.elm_layout_add(parent.Handle); - Interop.Elementary.elm_layout_theme_set(handle, "layout", "elm_widget", "default"); - - RealHandle = Interop.Elementary.elm_index_add(handle); - Interop.Elementary.elm_object_part_content_set(handle, "elm.swallow.content", RealHandle); - - return handle; - } - - void _delayedChanged_On(object sender, EventArgs e) - { - SelectedItem?.SendSelected(); - Changed?.Invoke(this, e); - } - - void AddInternal(IndexItem item) - { - _children.Add(item); - item.Deleted += Item_Deleted; - } - - void Item_Deleted(object sender, EventArgs e) - { - _children.Remove((IndexItem)sender); - } - } -} \ No newline at end of file diff --git a/src/ElmSharp/ElmSharp/IndexItem.cs b/src/ElmSharp/ElmSharp/IndexItem.cs deleted file mode 100755 index 67dcfd440..000000000 --- a/src/ElmSharp/ElmSharp/IndexItem.cs +++ /dev/null @@ -1,59 +0,0 @@ -/* - * 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 ElmSharp -{ - /// - /// The IndexItem is used to manage index item - /// Inherits ItemObject - /// - public class IndexItem : ItemObject - { - /// - /// Creates and initializes a new instance of IndexItem class. - /// - /// the text is set to the Text. It's 'string' type. - public IndexItem(string text) : base(IntPtr.Zero) - { - Text = text; - } - - /// - /// Selected will be triggered when the index item is selected - /// - public event EventHandler Selected; - - /// - /// Gets the text - /// - public string Text { get; private set; } - - /// - /// Sets the selected state of an item. - /// - /// The selected state - public void Select(bool selected) - { - Interop.Elementary.elm_index_item_selected_set(Handle, selected); - } - internal void SendSelected() - { - Selected?.Invoke(this, EventArgs.Empty); - } - - } -} diff --git a/src/ElmSharp/ElmSharp/ItemObject.cs b/src/ElmSharp/ElmSharp/ItemObject.cs deleted file mode 100644 index f00939675..000000000 --- a/src/ElmSharp/ElmSharp/ItemObject.cs +++ /dev/null @@ -1,366 +0,0 @@ -/* - * 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.Collections.Generic; - -namespace ElmSharp -{ - /// - /// The ItemObject is used to manage item object - /// - public class ItemObject - { - private static Dictionary s_IdToItemTable = new Dictionary(); - private static Dictionary s_HandleToItemTable = new Dictionary(); - private static int s_globalId = 0; - - readonly Dictionary _partContents = new Dictionary(); - Interop.Evas.SmartCallback _deleteCallback; - IntPtr _handle = IntPtr.Zero; - Dictionary _signalDatas = new Dictionary(); - EvasObject _trackObject = null; - - /// - /// Creates and initializes a new instance of ItemObject class. - /// - /// IntPtr - protected ItemObject(IntPtr handle) - { - _deleteCallback = DeleteCallbackHandler; - Id = GetNextId(); - s_IdToItemTable[Id] = this; - Handle = handle; - } - - // C# Finalizer was called on GC thread - // So, We can't access to EFL object - // And When Finalizer was called, Field can be already released. - //~ItemObject() - //{ - // if (Handle != IntPtr.Zero) - // Interop.Elementary.elm_object_item_del(Handle); - //} - - /// - /// Gets the id of item object - /// - public int Id { get; private set; } - - /// - /// Sets or gets whether the item object is enabled - /// - public bool IsEnabled - { - get { return !Interop.Elementary.elm_object_item_disabled_get(Handle); } - set { Interop.Elementary.elm_object_item_disabled_set(Handle, !value); } - } - - /// - /// Gets track object of the item. - /// - public EvasObject TrackObject - { - get - { - if (_trackObject == null) - _trackObject = new ItemEvasObject(Handle); - return _trackObject; - } - } - - internal IntPtr Handle - { - get - { - return _handle; - } - set - { - if (_handle == value) - return; - - if (_handle != IntPtr.Zero) - { - UnsetDeleteCallback(); - } - _handle = value; - SetDeleteCallback(); - s_HandleToItemTable[Handle] = this; - } - } - - /// - /// Deleted will be triggered when the item object is deleted - /// - public event EventHandler Deleted; - - /// - /// Delete the item object - /// - public void Delete() - { - Interop.Elementary.elm_object_item_del(Handle); - _handle = IntPtr.Zero; - } - - /// - /// Set a content of an object item and delete old content - /// - /// The content part name (null for the default content) - /// The content of the object item - public void SetPartContent(string part, EvasObject content) - { - SetPartContent(part, content, false); - } - - /// - /// Set a content of an object item - /// - /// The content part name (null for the default content) - /// The content of the object item - /// judge whether delete old content - public void SetPartContent(string part, EvasObject content, bool preserveOldContent) - { - IntPtr oldContent = Interop.Elementary.elm_object_item_part_content_unset(Handle, part); - if (oldContent != IntPtr.Zero && !preserveOldContent) - { - Interop.Evas.evas_object_del(oldContent); - } - Interop.Elementary.elm_object_item_part_content_set(Handle, part, content); - _partContents[part ?? "__default__"] = content; - } - - /// - /// Set a label of an object item - /// - /// The text part name (null for the default label) - /// Text of the label - public void SetPartText(string part, string text) - { - Interop.Elementary.elm_object_item_part_text_set(Handle, part, text); - } - - /// - /// Gets a label of an object item - /// - /// The text part name (null for the default label) - /// - public string GetPartText(string part) - { - return Interop.Elementary.elm_object_item_part_text_get(Handle, part); - } - - /// - /// Sets color of an object item - /// - /// The text part name (null for the default label) - /// the color - public void SetPartColor(string part, Color color) - { - Interop.Elementary.elm_object_item_color_class_color_set(Handle, part, color.R * color.A / 255, - color.G * color.A / 255, - color.B * color.A / 255, - color.A); - } - - /// - /// Gets color of an object item - /// - /// The text part name (null for the default label) - /// the color of object item - public Color GetPartColor(string part) - { - int r, g, b, a; - Interop.Elementary.elm_object_item_color_class_color_get(Handle, part, out r, out g, out b, out a); - return new Color((int)(r / (a / 255.0)), (int)(g / (a / 255.0)), (int)(b / (a / 255.0)), a); - } - - /// - /// Deletes color of an object item - /// - /// The text part name - public void DeletePartColor(string part) - { - Interop.Elementary.elm_object_item_color_class_del(Handle, part); - } - - /// - /// Add a function for a signal emitted by object item edje. - /// - /// The signal's name. - /// The signal's source. - /// The function to be executed when the signal is emitted. - public void AddSignalHandler(string emission, string source, Func func) - { - if (emission != null && source != null && func != null) - { - var signalData = new SignalData(emission, source, func); - if (!_signalDatas.ContainsKey(signalData)) - { - var signalCallback = new Interop.Elementary.Elm_Object_Item_Signal_Cb((d, o, e, s) => - { - return func(e, s); - }); - Interop.Elementary.elm_object_item_signal_callback_add(Handle, emission, source, signalCallback, IntPtr.Zero); - } - } - } - - /// - /// Remove a signal-triggered function from a object item edje object. - /// - /// The signal's name. - /// The signal's source. - /// The function to be executed when the signal is emitted. - public void RemoveSignalHandler(string emission, string source, Func func) - { - if (emission != null && source != null && func != null) - { - var signalData = new SignalData(emission, source, func); - - Interop.Elementary.Elm_Object_Item_Signal_Cb signalCallback = null; - _signalDatas.TryGetValue(signalData, out signalCallback); - - if (signalCallback != null) - { - Interop.Elementary.elm_object_item_signal_callback_del(Handle, emission, source, signalCallback); - _signalDatas.Remove(signalData); - } - } - } - - /// - /// Send a signal to the edje object of the widget item. - /// - /// The signal's name. - /// The signal's source. - public void EmitSignal(string emission, string source) - { - Interop.Elementary.elm_object_item_signal_emit(Handle, emission, source); - } - - /// - /// Gets the handle of object item - /// - /// ItemObject - public static implicit operator IntPtr(ItemObject obj) - { - if (obj == null) - return IntPtr.Zero; - return obj.Handle; - } - - /// - /// OnInvalidate of object item - /// - protected virtual void OnInvalidate() { } - - internal static ItemObject GetItemById(int id) - { - ItemObject value; - s_IdToItemTable.TryGetValue(id, out value); - return value; - } - - internal static ItemObject GetItemByHandle(IntPtr handle) - { - ItemObject value; - s_HandleToItemTable.TryGetValue(handle, out value); - return value; - } - - void DeleteCallbackHandler(IntPtr data, IntPtr obj, IntPtr info) - { - Deleted?.Invoke(this, EventArgs.Empty); - OnInvalidate(); - if (s_IdToItemTable.ContainsKey(Id)) - { - s_IdToItemTable.Remove(Id); - } - if (s_HandleToItemTable.ContainsKey(_handle)) - { - s_HandleToItemTable.Remove(_handle); - } - _partContents.Clear(); - _handle = IntPtr.Zero; - } - - void UnsetDeleteCallback() - { - Interop.Elementary.elm_object_item_del_cb_set(Handle, null); - } - - void SetDeleteCallback() - { - if (Handle != IntPtr.Zero) - Interop.Elementary.elm_object_item_del_cb_set(Handle, _deleteCallback); - } - - static int GetNextId() - { - return s_globalId++; - } - - class SignalData - { - public string Emission { get; set; } - public string Source { get; set; } - public Func Func { get; set; } - - public SignalData(string emission, string source, Func func) - { - Emission = emission; - Source = source; - Func = func; - } - - public override bool Equals(object obj) - { - SignalData s = obj as SignalData; - if (s == null) - { - return false; - } - return (Emission == s.Emission) && (Source == s.Source) && (Func == s.Func); - } - - public override int GetHashCode() - { - int hashCode = Emission.GetHashCode(); - hashCode ^= Source.GetHashCode(); - hashCode ^= Func.GetHashCode(); - return hashCode; - } - } - - class ItemEvasObject : EvasObject - { - IntPtr _parent = IntPtr.Zero; - - public ItemEvasObject(IntPtr parent) : base() - { - _parent = parent; - Realize(null); - } - - protected override IntPtr CreateHandle(EvasObject parent) - { - return Interop.Elementary.elm_object_item_track(_parent); - } - } - } -} \ No newline at end of file diff --git a/src/ElmSharp/ElmSharp/ItemObjectExtension.cs b/src/ElmSharp/ElmSharp/ItemObjectExtension.cs deleted file mode 100755 index ef8b60950..000000000 --- a/src/ElmSharp/ElmSharp/ItemObjectExtension.cs +++ /dev/null @@ -1,44 +0,0 @@ -/* - * 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 ElmSharp -{ - /// - /// The ItemObjectExtension is used to manage item object extension - /// - public static class ItemObjectExtension - { - /// - /// Grab high light of item object - /// - /// the item object which is grabbed high light - public static void GrabHighlight(this ItemObject obj) - { - Interop.Elementary.elm_atspi_component_highlight_grab(obj.Handle); - } - - /// - /// Clear high light of item object - /// - /// the item object which is cleared high light - public static void ClearHighlight(this ItemObject obj) - { - Interop.Elementary.elm_atspi_component_highlight_clear(obj.Handle); - } - } -} diff --git a/src/ElmSharp/ElmSharp/Label.cs b/src/ElmSharp/ElmSharp/Label.cs deleted file mode 100755 index 12aae0723..000000000 --- a/src/ElmSharp/ElmSharp/Label.cs +++ /dev/null @@ -1,209 +0,0 @@ -/* - * 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 ElmSharp -{ - /// - /// Label is a widget to display text, with simple html-like markup. - /// Inherits Layout - /// - public class Label : Layout - { - SmartEvent _slideCompleted; - - /// - /// Creates and initializes a new instance of Label class. - /// - /// The parent is a given container which will be attached by Label as a child. It's type. - public Label(EvasObject parent) : base(parent) - { - _slideCompleted = new SmartEvent(this, this.RealHandle, "slide,end"); - _slideCompleted.On += (s, e) => - { - SlideCompleted?.Invoke(this, EventArgs.Empty); - }; - } - - /// - /// SlideCompleted will be triggered when the slide is completed. - /// - public event EventHandler SlideCompleted; - - /// - /// Sets or gets wrap width of the label. - /// - public int LineWrapWidth - { - get - { - return Interop.Elementary.elm_label_wrap_width_get(RealHandle); - } - set - { - Interop.Elementary.elm_label_wrap_width_set(RealHandle, value); - } - } - - /// - /// Sets or gets the wrapping behavior of the label. - /// - public WrapType LineWrapType - { - get - { - return (WrapType)Interop.Elementary.elm_label_line_wrap_get(RealHandle); - } - set - { - Interop.Elementary.elm_label_line_wrap_set(RealHandle, (int)value); - if (value != WrapType.None) - { - Interop.Evas.evas_object_size_hint_min_get(RealHandle, IntPtr.Zero, out int h); - Interop.Evas.evas_object_size_hint_min_set(RealHandle, 0, h); - } - } - } - - /// - /// Sets or gets the slide mode of the label widget. - /// - public LabelSlideMode SlideMode - { - get - { - return (LabelSlideMode)Interop.Elementary.elm_label_slide_mode_get(RealHandle); - } - set - { - Interop.Elementary.elm_label_slide_mode_set(RealHandle, (int)value); - } - } - - /// - /// Sets or gets the slide duration of the label. - /// - public double SlideDuration - { - get - { - return Interop.Elementary.elm_label_slide_duration_get(RealHandle); - } - set - { - Interop.Elementary.elm_label_slide_duration_set(RealHandle, value); - } - } - - /// - /// Sets or gets the slide Speed of the label. - /// - /// - /// The speed of the slide animation in px per seconds. - /// If you set the duration of the slide using elm_label_slide_duration_set() you cannot get the correct speed using this function until the label is actually rendered and resized. - /// - /// - public double SlideSpeed - { - get - { - return Interop.Elementary.elm_label_slide_speed_get(RealHandle); - } - set - { - Interop.Elementary.elm_label_slide_speed_set(RealHandle, value); - } - } - - /// - /// Sets or gets the ellipsis behavior of the label. - /// - public bool IsEllipsis - { - get - { - return Interop.Elementary.elm_label_ellipsis_get(RealHandle); - } - set - { - Interop.Elementary.elm_label_ellipsis_set(RealHandle, value); - } - } - - /// - /// Sets or gets the style of the label text. - /// - /// - /// APIs, elm_label_text_style_user_peek/pop/push, are internal APIs only in Tizen. Avalilable since Tizen_4.0. - /// - /// - public string TextStyle - { - get - { - return Interop.Elementary.elm_label_text_style_user_peek(RealHandle); - } - set - { - if (string.IsNullOrEmpty(value)) - { - Interop.Elementary.elm_label_text_style_user_pop(RealHandle); - } - else - { - Interop.Elementary.elm_label_text_style_user_push(RealHandle, value); - } - } - } - - /// - /// Start slide effect. - /// - public void PlaySlide() - { - Interop.Elementary.elm_label_slide_go(RealHandle); - } - - /// - /// Sets the content at a part of a given container widget. - /// - /// EvasObject - /// The new object, otherwise null if it cannot be created - protected override IntPtr CreateHandle(EvasObject parent) - { - return Interop.Elementary.elm_label_add(parent.Handle); - } - } - - /// - /// Enumeration for slide mode of a label widget - /// - public enum LabelSlideMode - { - /// - /// no slide effect - /// - None = 0, - /// - /// slide only if the label area is bigger than the text width length - /// - Auto, - /// - /// slide always - /// - Always - } -} diff --git a/src/ElmSharp/ElmSharp/Layout.cs b/src/ElmSharp/ElmSharp/Layout.cs deleted file mode 100644 index 9a45bbeb1..000000000 --- a/src/ElmSharp/ElmSharp/Layout.cs +++ /dev/null @@ -1,352 +0,0 @@ -/* - * 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 ElmSharp -{ - /// - /// This is a container widget that takes a standard Edje design file and wraps it very thinly in a widget. - /// Inherits Widget - /// - public class Layout : Container - { - SmartEvent _languageChanged; - SmartEvent _themeChanged; - - IntPtr _edjeHandle; - - /// - /// Creates and initializes a new instance of Layout class. - /// - /// 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); - }; - } - - /// - /// LanguageChanged will be triggered when the program's language is changed. - /// - public event EventHandler LanguageChanged; - - /// - /// ThemeChanged will be triggered when the theme is changed. - /// - public event EventHandler ThemeChanged; - - /// - /// Gets the edje layout. - /// - public EdjeObject EdjeObject - { - get - { - if (_edjeHandle == IntPtr.Zero) - _edjeHandle = Interop.Elementary.elm_layout_edje_get(RealHandle); - return new EdjeObject(_edjeHandle); - } - } - - /// - /// Gets or sets accessibility state of texblock(text) parts in the layout object. - /// - public bool TextBlockAccessibility - { - get - { - return Interop.Elementary.elm_layout_edje_object_can_access_get(RealHandle); - } - set - { - Interop.Elementary.elm_layout_edje_object_can_access_set(RealHandle, value); - } - } - - /// - /// Freezes the Elementary layout object. - /// This function puts all changes on hold. - /// Successive freezes will nest, requiring an equal number of thaws. - /// - /// The frozen state or 0 if the object is not frozen or on error. - public int Freeze() - { - return Interop.Elementary.elm_layout_freeze(RealHandle); - } - - /// - /// Thaws the Elementary object. - /// If sucessives freezes were done, an equal number of thaws will be required. - /// - /// The frozen state or 0 if the object is not frozen or on error. - public int Thaw() - { - return Interop.Elementary.elm_layout_thaw(RealHandle); - } - - /// - /// Eval sizing. - /// Manually forces a sizing re-evaluation. - /// This is useful when the minimum size required by the edje theme of this layout has changed. - /// The change on the minimum size required by the edje theme is not immediately reported to the elementary layout, so one needs to call this function in order to tell the widget (layout) that it needs to reevaluate its own size. - /// The minimum size of the theme is calculated based on minimum size of parts, the size of elements inside containers like box and table, etc. - /// All of this can change due to state changes, and that's when this function should be called. - /// - public void Resizing() - { - Interop.Elementary.elm_layout_sizing_eval(RealHandle); - } - - /// - /// Request sizing reevaluation, restricted to current width and/or height. - /// Useful mostly when there are TEXTBLOCK parts defining the height of the object and nothing else restricting it to a minimum width.Calling this function will restrict the minimum size in the Edje calculation to whatever size it the layout has at the moment. - /// - /// Restrict minimum size ot the current width. - /// Restrict minimum size ot the current height. - public void Resizing(bool width, bool height) - { - Interop.Elementary.elm_layout_sizing_restricted_eval(RealHandle, width, height); - } - - /// - /// Get the edje data from the given layout. - /// This function fetches data specified inside the edje theme of this layout. - /// This function return NULL if data is not found. - /// - /// The data key - /// The data - public string GetEdjeData(string key) - { - return Interop.Elementary.elm_layout_data_get(RealHandle, key); - } - - /// - /// Gets the text set in the given part. - /// - /// The TEXT part to retrieve the text off. - /// - public override string GetPartText(string part) - { - return Interop.Elementary.elm_layout_text_get(RealHandle, part); - } - - /// - /// Sets the text set in the given part. - /// - /// The TEXT part to retrieve the text off. - /// The text to set. - /// - public override bool SetPartText(string part, string text) - { - return Interop.Elementary.elm_layout_text_set(RealHandle, part, text); - } - - /// - /// Append child to layout box part. - /// Once the object is appended, it will become child of the layout. - /// Its lifetime will be bound to the layout, whenever the layout dies the child will be deleted automatically. - /// - /// The part - /// The Object to append - /// Sucess is true - public bool BoxAppend(string part, EvasObject child) - { - AddChild(child); - return Interop.Elementary.elm_layout_box_append(RealHandle, part, child.Handle); - } - - /// - /// Prepend child to layout box part. - /// Once the object is prepended, it will become child of the layout. - /// Its lifetime will be bound to the layout, whenever the layout dies the child will be deleted automatically. - /// - /// The part - /// The Object to prepend - /// Sucess is true - public bool BoxPrepend(string part, EvasObject child) - { - AddChild(child); - return Interop.Elementary.elm_layout_box_prepend(RealHandle, part, child.Handle); - } - - /// - /// Remove a child of the given part box. - /// The object will be removed from the box part and its lifetime will not be handled by the layout anymore. - /// - /// The part - /// The Object to remove - /// Sucess is true - public bool BoxRemove(string part, EvasObject child) - { - RemoveChild(child); - return Interop.Elementary.elm_layout_box_remove(RealHandle, part, child.Handle) != null; - } - - /// - /// Remove all children of the given part box. - /// The objects will be removed from the box part and their lifetime will not be handled by the layout anymore. - /// - /// The part - /// If true, then all objects will be deleted as well, otherwise they will just be removed and will be dangling on the canvas. - /// Sucess is true - public bool BoxRemoveAll(string part, bool clear) - { - ClearChildren(); - return Interop.Elementary.elm_layout_box_remove_all(RealHandle, part, clear); - } - - /// - /// Insert child to layout box part at a given position. - /// Once the object is inserted, it will become child of the layout. - /// Its lifetime will be bound to the layout, whenever the layout dies the child will be deleted automatically. - /// - /// The part - /// The child object to insert into box. - /// The numeric position >=0 to insert the child. - /// Sucess is true - public bool BoxInsertAt(string part, EvasObject child, uint position) - { - AddChild(child); - return Interop.Elementary.elm_layout_box_insert_at(RealHandle, part, child.Handle, position); - } - - /// - /// Insert child to layout box part before a reference object. - /// Once the object is inserted, it will become child of the layout. - /// Its lifetime will be bound to the layout, whenever the layout dies the child will be deleted automatically. - /// - /// - /// The child object to insert into box. - /// Another reference object to insert before in box. - /// Sucess is true - public bool BoxInsertBefore(string part, EvasObject child, EvasObject reference) - { - AddChild(child); - return Interop.Elementary.elm_layout_box_insert_before(RealHandle, part, child.Handle, reference.Handle); - } - - /// - /// Sets the layout content. - /// - /// The swallow part name in the edje file - /// The child that will be added in this layout object. - /// TRUE on success, FALSE otherwise - public override bool SetPartContent(string part, EvasObject content) - { - return SetPartContent(part, content, false); - } - - /// - /// Sets the layout content. - /// - /// The name of particular part - /// The content - /// true, preserve old content will be unset. false, preserve old content will not be unset. - /// TRUE on success, FALSE otherwise - public override bool SetPartContent(string part, EvasObject content, bool preserveOldContent) - { - if (preserveOldContent) - { - Interop.Elementary.elm_layout_content_unset(RealHandle, part); - } - UpdatePartContents(content, part); - return Interop.Elementary.elm_layout_content_set(RealHandle, part, content); - } - - /// - /// Sets the edje group from the elementary theme that is used as a layout. - /// - /// The class of the group - /// The group - /// The style to use - public void SetTheme(string klass, string group, string style) - { - Interop.Elementary.elm_layout_theme_set(RealHandle, klass, group, style); - } - - /// - /// Sets the file that is used as a layout. - /// - /// The path to the file (edj) that is used as a layout - /// The group that the layout belongs to in the edje file - public void SetFile(string file, string group) - { - Interop.Elementary.elm_layout_file_set(RealHandle, file, group); - } - - /// - /// Sets the back ground color of layout - /// - public override Color BackgroundColor - { - set - { - if (value.IsDefault) - { - string part = ClassName.ToLower().Replace("elm_", "") + "/" + "bg"; - EdjeObject.DeleteColorClass(part); - } - else - { - SetPartColor("bg", value); - } - _backgroundColor = value; - } - } - - /// - /// Sets the vertical text alignment of layout's text part - /// - /// - /// API, elm_layout_text_valign_set, is an internal API only in Tizen. Avalilable since Tizen_4.0. - /// - public virtual void SetVerticalTextAlignment(string part, double valign) - { - Interop.Elementary.elm_layout_text_valign_set(RealHandle, part, valign); - } - - /// - /// Gets the vertical text alignment of layout's text part - /// - /// - /// API, elm_layout_text_valign_get, is internal API only in Tizen. Avalilable since Tizen_4.0. - /// - public virtual double GetVerticalTextAlignment(string part) - { - return Interop.Elementary.elm_layout_text_valign_get(RealHandle, part); - } - - /// - /// 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. - /// The new object, otherwise null if it cannot be created - protected override IntPtr CreateHandle(EvasObject parent) - { - return Interop.Elementary.elm_layout_add(parent.Handle); - } - } -} \ No newline at end of file diff --git a/src/ElmSharp/ElmSharp/List.cs b/src/ElmSharp/ElmSharp/List.cs deleted file mode 100755 index 9a14f939b..000000000 --- a/src/ElmSharp/ElmSharp/List.cs +++ /dev/null @@ -1,253 +0,0 @@ -/* - * 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.Collections.Generic; - -namespace ElmSharp -{ - /// - /// Enumeration for setting list's resizing behavior, transverse axis scrolling and items cropping. - /// - public enum ListMode - { - /// - /// The list won't set any of its size hints to inform how a possible container should resize it. - /// Then, if it's not created as a "resize object", it might end with zeroed dimensions. - /// The list will respect the container's geometry and, if any of its items won't fit into its transverse axis, one won't be able to scroll it in that direction. - /// - Compress = 0, - /// - /// This is the same as Compress, with the exception that if any of its items won't fit into its transverse axis, one will be able to scroll it in that direction. - /// - Scroll, - /// - /// Sets a minimum size hint on the genlist object, so that containers may respect it (and resize itself to fit the child properly). - /// More specifically, a minimum size hint will be set for its transverse axis, so that the largest item in that direction fits well. - /// This is naturally bound by the list object's maximum size hints, set externally. - /// - Limit, - /// - /// Besides setting a minimum size on the transverse axis, just like on Limit, the list will set a minimum size on th longitudinal axis, trying to reserve space to all its children to be visible at a time. - /// This is naturally bound by the list object's maximum size hints, set externally. - /// - Expand - } - - /// - /// It inherits System.EventArgs. - /// It contains Item which is type. - /// All events of List contain ListItemEventArgs as a parameter. - /// - public class ListItemEventArgs : EventArgs - { - /// - /// Gets or sets List item. The return type is . - /// - public ListItem Item { get; set; } - - internal static ListItemEventArgs CreateFromSmartEvent(IntPtr data, IntPtr obj, IntPtr info) - { - ListItem item = ItemObject.GetItemByHandle(info) as ListItem; - return new ListItemEventArgs() { Item = item }; - } - } - - /// - /// It inherits . - /// The List is a widget that aims to display simple list item which has 2 icons and 1 text, and can be selected. - /// For more robust lists, should probably be used. - /// - /// - /// - public class List : Layout - { - HashSet _children = new HashSet(); - SmartEvent _selected; - SmartEvent _unselected; - SmartEvent _doubleClicked; - SmartEvent _longpressed; - SmartEvent _activated; - - /// - /// Creates and initializes a new instance of the List class. - /// - /// The parent is a given container which will be attached by List as a child. It's type. - public List(EvasObject parent) : base(parent) - { - _selected = new SmartEvent(this, this.RealHandle, "selected", ListItemEventArgs.CreateFromSmartEvent); - _unselected = new SmartEvent(this, this.RealHandle, "unselected", ListItemEventArgs.CreateFromSmartEvent); - _doubleClicked = new SmartEvent(this, this.RealHandle, "clicked,double", ListItemEventArgs.CreateFromSmartEvent); - _longpressed = new SmartEvent(this, this.RealHandle, "longpressed", ListItemEventArgs.CreateFromSmartEvent); - _activated = new SmartEvent(this, this.RealHandle, "activated", ListItemEventArgs.CreateFromSmartEvent); - _selected.On += (s, e) => { ItemSelected?.Invoke(this, e); }; - _unselected.On += (s, e) => { ItemUnselected?.Invoke(this, e); }; - _doubleClicked.On += (s, e) => { ItemDoubleClicked?.Invoke(this, e); }; - _longpressed.On += (s, e) => { ItemLongPressed?.Invoke(this, e); }; - _activated.On += (s, e) => { ItemActivated?.Invoke(this, e); }; - } - - /// - /// Gets or sets which mode to use for the list. - /// - public ListMode Mode - { - get - { - return (ListMode)Interop.Elementary.elm_list_mode_get(RealHandle); - } - set - { - Interop.Elementary.elm_list_mode_set(RealHandle, (Interop.Elementary.Elm_List_Mode)value); - } - } - - /// - /// Gets the selected item. - /// - public ListItem SelectedItem - { - get - { - IntPtr item = Interop.Elementary.elm_list_selected_item_get(RealHandle); - return ItemObject.GetItemByHandle(item) as ListItem; - } - } - - /// - /// ItemSelected is raised when a new list item is selected. - /// - public event EventHandler ItemSelected; - - /// - /// ItemUnselected is raised when the list item is Unselected. - /// - public event EventHandler ItemUnselected; - - /// - /// ItemDoubleClicked is raised when a new list item is double clicked. - /// - public event EventHandler ItemDoubleClicked; - - /// - /// ItemLongPressed is raised when a list item is pressed for a certain amount of time. By default it's 1 second. - /// - public event EventHandler ItemLongPressed; - - /// - /// ItemActivated is raised when a new list item is double clicked or pressed (enter|return|spacebar). - /// - public event EventHandler ItemActivated; - - /// - /// Starts the list. - /// Call before running on the list object. - /// If not called, it won't display the list properly. - /// - public void Update() - { - Interop.Elementary.elm_list_go(RealHandle); - } - - /// - /// Appends a new item with a text to the end of a given list widget. - /// - /// The text for the item. - /// Return a new added list item that contains a text. - /// - public ListItem Append(string label) - { - return Append(label, null, null); - } - - /// - /// Appends a new item with a text and 2 icons to the end of a given list widget. - /// - /// The text for the item. - /// The left icon for the item. - /// The right icon for the item. - /// Return a new added list item that contains a text and 2 icons. - /// - public ListItem Append(string label, EvasObject leftIcon, EvasObject rightIcon) - { - ListItem item = new ListItem(label, leftIcon, rightIcon); - item.Handle = Interop.Elementary.elm_list_item_append(RealHandle, label, leftIcon, rightIcon, null, (IntPtr)item.Id); - AddInternal(item); - return item; - } - - /// - /// Prepends a new item with a text to the beginning of a given list widget. - /// - /// The text for the item. - /// Return a new added list item that contains a text. - public ListItem Prepend(string label) - { - return Prepend(label, null, null); - } - - /// - /// Prepends a new item with a text and 2 icons to the beginning of a given list widget. - /// - /// The text for the item. - /// The left icon for the item. - /// The right icon for the item. - /// Return a new added list item that contains a text and 2 icons. - public ListItem Prepend(string label, EvasObject leftIcon, EvasObject rigthIcon) - { - ListItem item = new ListItem(label, leftIcon, rigthIcon); - item.Handle = Interop.Elementary.elm_list_item_prepend(RealHandle, label, leftIcon, rigthIcon, null, (IntPtr)item.Id); - AddInternal(item); - return item; - } - - /// - /// Removes all items from a given list widget. - /// To delete just one item, use . - /// - public void Clear() - { - Interop.Elementary.elm_list_clear(RealHandle); - foreach (var item in _children) - { - item.Deleted -= Item_Deleted; - } - _children.Clear(); - } - - protected override IntPtr CreateHandle(EvasObject parent) - { - IntPtr handle = Interop.Elementary.elm_layout_add(parent.Handle); - Interop.Elementary.elm_layout_theme_set(handle, "layout", "elm_widget", "default"); - - RealHandle = Interop.Elementary.elm_list_add(handle); - Interop.Elementary.elm_object_part_content_set(handle, "elm.swallow.content", RealHandle); - - return handle; - } - - void AddInternal(ListItem item) - { - _children.Add(item); - item.Deleted += Item_Deleted; - } - - void Item_Deleted(object sender, EventArgs e) - { - _children.Remove((ListItem)sender); - } - } -} diff --git a/src/ElmSharp/ElmSharp/ListItem.cs b/src/ElmSharp/ElmSharp/ListItem.cs deleted file mode 100644 index 09354b14f..000000000 --- a/src/ElmSharp/ElmSharp/ListItem.cs +++ /dev/null @@ -1,50 +0,0 @@ -/* - * 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 ElmSharp -{ - /// - /// It inherits . - /// A instance to the list item added. - /// It contains Text, LeftIcon and RightIcon properties to show a list item which is given. - /// - public class ListItem : ItemObject - { - internal ListItem(string text, EvasObject leftIcon, EvasObject rightIcon) : base(IntPtr.Zero) - { - Text = text; - LeftIcon = leftIcon; - RightIcon = rightIcon; - } - - /// - /// Gets the text for the list item. - /// - public string Text { get; internal set; } - - /// - /// Gets the left icon for the list item. - /// - public EvasObject LeftIcon { get; internal set; } - - /// - /// Gets the right icon for the list item. - /// - public EvasObject RightIcon { get; internal set; } - } -} \ No newline at end of file diff --git a/src/ElmSharp/ElmSharp/MultiButtonEntry.cs b/src/ElmSharp/ElmSharp/MultiButtonEntry.cs deleted file mode 100755 index 21d9a546d..000000000 --- a/src/ElmSharp/ElmSharp/MultiButtonEntry.cs +++ /dev/null @@ -1,407 +0,0 @@ -/* - * 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.Collections.Generic; - -namespace ElmSharp -{ - /// - /// It inherits . - /// The MultiButtonEntry is a widget letting an user enter text and each chunk of text managed as a set of buttons. - /// Each text button is inserted by pressing the "return" key. If there is no space in the current row, a new button is added to the next row. - /// When a text button is pressed, it will become focused. Backspace removes the focus. When the multi-button entry loses focus, items longer than one line are shrunk to one line. - /// The typical use case of multi-button entry is composing emails/messages to a group of addresses, each of which is an item that can be clicked for further actions. - /// - public class MultiButtonEntry : Layout - { - HashSet _children = new HashSet(); - List> _filters = new List>(); - Func _formatFunc = null; - Entry _entry = null; - - Interop.Elementary.MultiButtonEntryItemFilterCallback _filterCallback; - Interop.Elementary.MultiButtonEntryFormatCallback _formatCallback; - - SmartEvent _clicked; - SmartEvent _expanded; - SmartEvent _contracted; - SmartEvent _expandedStateChanged; - SmartEvent _itemSelected; - SmartEvent _itemClicked; - SmartEvent _itemLongPressed; - SmartEvent _itemAdded; - - /// - /// Creates and initializes a new instance of the MultiButtonEntry class. - /// - /// The parent is a given container which will be attached by MultiButtonEntry as a child. It's type. - public MultiButtonEntry(EvasObject parent) : base(parent) - { - _clicked = new SmartEvent(this, "clicked"); - _expanded = new SmartEvent(this, "expanded"); - _contracted = new SmartEvent(this, "contracted"); - _expandedStateChanged = new SmartEvent(this, "expand,state,changed"); - - _itemSelected = new SmartEvent(this, "item,selected", MultiButtonEntryItemEventArgs.CreateFromSmartEvent); - _itemClicked = new SmartEvent(this, "item,clicked", MultiButtonEntryItemEventArgs.CreateFromSmartEvent); - _itemLongPressed = new SmartEvent(this, "item,longpressed", MultiButtonEntryItemEventArgs.CreateFromSmartEvent); - _itemAdded = new SmartEvent(this, "item,added", MultiButtonEntryItemEventArgs.CreateAndAddFromSmartEvent); - - _filterCallback = new Interop.Elementary.MultiButtonEntryItemFilterCallback(FilterCallbackHandler); - _formatCallback = new Interop.Elementary.MultiButtonEntryFormatCallback(FormatCallbackHandler); - - _clicked.On += (sender, e) => Clicked?.Invoke(this, EventArgs.Empty); - _expanded.On += (sender, e) => Expanded?.Invoke(this, EventArgs.Empty); - _contracted.On += (sender, e) => Contracted?.Invoke(this, EventArgs.Empty); - _expandedStateChanged.On += (sender, e) => ExpandedStateChanged?.Invoke(this, EventArgs.Empty); - - _itemSelected.On += (sender, e) => { ItemSelected?.Invoke(this, e); }; - _itemClicked.On += (sender, e) => { ItemClicked?.Invoke(this, e); }; - _itemLongPressed.On += (sender, e) => { ItemLongPressed?.Invoke(this, e); }; - _itemAdded.On += OnItemAdded; - } - - /// - /// Clicked is raised when a MultiButtonEntry is clicked. - /// - public event EventHandler Clicked; - - /// - /// Expanded is raised when a MultiButtonEntry is expanded. - /// - public event EventHandler Expanded; - - /// - /// Contracted is raised when a MultiButtonEntry is contracted. - /// - public event EventHandler Contracted; - - /// - /// ExpandedStateChanged is raised when shrink mode state of MultiButtonEntry is changed. - /// - public event EventHandler ExpandedStateChanged; - - /// - /// ItemSelected is raised when an item is selected by api, user interaction, and etc. - /// This is also raised when a user press back space while cursor is on the first field of entry. - /// - public event EventHandler ItemSelected; - - /// - /// ItemClicked is raised when an item is clicked by user interaction. - /// - public event EventHandler ItemClicked; - - /// - /// ItemLongPressed is raised when MultiButtonEntry item is pressed for a long time. - /// - public event EventHandler ItemLongPressed; - - /// - /// ItemAdded is raised when a new MultiButtonEntry item is added. - /// - public event EventHandler ItemAdded; - - /// - /// ItemDeleted is raised when a MultiButtonEntry item is deleted. - /// - public event EventHandler ItemDeleted; - - /// - /// Gets the selected item in the multibuttonentry. - /// - public MultiButtonEntryItem SelectedItem - { - get - { - IntPtr handle = Interop.Elementary.elm_multibuttonentry_selected_item_get(RealHandle); - return ItemObject.GetItemByHandle(handle) as MultiButtonEntryItem; - } - } - - /// - /// Gets or sets whether the multibuttonentry is editable or not. - /// - public bool IsEditable - { - get - { - return Interop.Elementary.elm_multibuttonentry_editable_get(RealHandle); - } - set - { - Interop.Elementary.elm_multibuttonentry_editable_set(RealHandle, value); - } - } - - /// - /// Gets or sets the multibuttonentry to expanded state. - /// If true, expanded state. - /// If false, single line state. - /// - public bool IsExpanded - { - get - { - return Interop.Elementary.elm_multibuttonentry_expanded_get(RealHandle); - } - set - { - Interop.Elementary.elm_multibuttonentry_expanded_set(RealHandle, value); - } - } - - /// - /// Gets the first item in the multibuttonentry. - /// - public MultiButtonEntryItem FirstItem - { - get - { - IntPtr handle = Interop.Elementary.elm_multibuttonentry_first_item_get(RealHandle); - return ItemObject.GetItemByHandle(handle) as MultiButtonEntryItem; - } - } - - /// - /// Gets the last item in the multibuttonentry. - /// - public MultiButtonEntryItem LastItem - { - get - { - IntPtr handle = Interop.Elementary.elm_multibuttonentry_last_item_get(RealHandle); - return ItemObject.GetItemByHandle(handle) as MultiButtonEntryItem; - } - } - - /// - /// Gets the entry object int the multibuttonentry. - /// - public Entry Entry - { - get - { - if (_entry == null) - { - _entry = new EntryInner(this); - } - - return _entry; - } - } - - protected override IntPtr CreateHandle(EvasObject parent) - { - return Interop.Elementary.elm_multibuttonentry_add(parent.Handle); - } - - /// - /// Append a new item to the multibuttonentry. - /// - /// The label of new item. - /// A MultiButtonEntryItem to the item added. - public MultiButtonEntryItem Append(string label) - { - var handle = Interop.Elementary.elm_multibuttonentry_item_append(RealHandle, label, null, IntPtr.Zero); - MultiButtonEntryItem item = ItemObject.GetItemByHandle(handle) as MultiButtonEntryItem; - return item; - } - - /// - /// Prepend a new item to the multibuttonentry. - /// - /// The label of new item. - /// A MultiButtonEntryItem to the item added. - public MultiButtonEntryItem Prepend(string label) - { - var handle = Interop.Elementary.elm_multibuttonentry_item_prepend(RealHandle, label, null, IntPtr.Zero); - MultiButtonEntryItem item = ItemObject.GetItemByHandle(handle) as MultiButtonEntryItem; - return item; - } - - /// - /// Add a new item to the multibuttonentry before the indicated object reference. - /// - /// The item before which to add it. - /// The label of new item. - /// A MultiButtonEntryItem to the item added. - public MultiButtonEntryItem InsertBefore(MultiButtonEntryItem before, string label) - { - var handle = Interop.Elementary.elm_multibuttonentry_item_insert_before(RealHandle, before.Handle, label, null, IntPtr.Zero); - MultiButtonEntryItem item = ItemObject.GetItemByHandle(handle) as MultiButtonEntryItem; - return item; - } - - /// - /// Add a new item to the multibuttonentry after the indicated object. - /// - /// The item after which to add it. - /// The label of new item. - /// A MultiButtonEntryItem to the item added. - public MultiButtonEntryItem InsertAfter(MultiButtonEntryItem after, string label) - { - var handle = Interop.Elementary.elm_multibuttonentry_item_insert_after(RealHandle, after.Handle, label, null, IntPtr.Zero); - MultiButtonEntryItem item = ItemObject.GetItemByHandle(handle) as MultiButtonEntryItem; - return item; - } - - /// - /// Remove all items in the multibuttonentry. - /// - public void Clear() - { - Interop.Elementary.elm_multibuttonentry_clear(RealHandle); - foreach (var item in _children) - { - item.Deleted -= Item_Deleted; - } - _children.Clear(); - } - - /// - /// Append an item filter function for text inserted in the Multibuttonentry. - /// - /// The function to use as item filter. - public void AppendFilter(Func func) - { - _filters.Add(func); - if (_filters.Count == 1) - { - Interop.Elementary.elm_multibuttonentry_item_filter_append(RealHandle, _filterCallback, IntPtr.Zero); - } - } - - /// - /// Prepend a filter function for text inserted in the Multibuttonentry. - /// - /// The function to use as text filter. - public void PrependFilter(Func func) - { - _filters.Insert(0, func); - if (_filters.Count == 1) - { - Interop.Elementary.elm_multibuttonentry_item_filter_prepend(RealHandle, _filterCallback, IntPtr.Zero); - } - } - - /// - /// Remove a filter from the list. - /// - /// The filter function to remove. - public void RemoveFilter(Func func) - { - _filters.Remove(func); - if (_filters.Count == 0) - { - Interop.Elementary.elm_multibuttonentry_item_filter_remove(RealHandle, _filterCallback, IntPtr.Zero); - } - } - - /// - /// Set a function to format the string that will be used to display the hidden items counter. - /// If func is NULL, the default format will be used, which is "+ 'the hidden items counter'". - /// - /// The function to return string to show - public void SetFormatCallback(Func func) - { - if (func == null) - { - Interop.Elementary.elm_multibuttonentry_format_function_set(RealHandle, null, IntPtr.Zero); - } - else - { - _formatFunc = func; - Interop.Elementary.elm_multibuttonentry_format_function_set(RealHandle, _formatCallback, IntPtr.Zero); - } - } - - string FormatCallbackHandler(int count, IntPtr data) - { - return _formatFunc(count); - } - - void Item_Deleted(object sender, EventArgs e) - { - var removed = sender as MultiButtonEntryItem; - _children.Remove(removed); - - // "item,deleted" event will be called after removing the item from ItemObject has been done. - // ItemObject will no longer have the item instance that is deleted after this. - // So, ItemDelete event with the removed item should be triggered here. - ItemDeleted?.Invoke(this, new MultiButtonEntryItemEventArgs() { Item = removed }); - } - - void OnItemAdded(object sender, MultiButtonEntryItemEventArgs e) - { - _children.Add(e.Item); - e.Item.Deleted += Item_Deleted; - ItemAdded?.Invoke(this, e); - } - - bool FilterCallbackHandler(IntPtr obj, string label, IntPtr itemData, IntPtr data) - { - foreach (var func in _filters) - { - if (!func(label)) - return false; - } - return true; - } - - internal class EntryInner : Entry - { - internal EntryInner(EvasObject parent) : base(parent) - { - } - - protected override IntPtr CreateHandle(EvasObject parent) - { - return Interop.Elementary.elm_multibuttonentry_entry_get(parent.Handle); - } - } - } - - /// - /// It inherits System.EventArgs. - /// The MultiButtonEntryItemEventArgs is a argument for all events of MultiButtonEntry. - /// It contains Item which is type. - /// - public class MultiButtonEntryItemEventArgs : EventArgs - { - /// - /// Gets or sets MultiButtonEntryItem item. The return type is . - /// - public MultiButtonEntryItem Item { get; set; } - - internal static MultiButtonEntryItemEventArgs CreateFromSmartEvent(IntPtr data, IntPtr obj, IntPtr info) - { - MultiButtonEntryItem item = ItemObject.GetItemByHandle(info) as MultiButtonEntryItem; - return new MultiButtonEntryItemEventArgs() { Item = item }; - } - - internal static MultiButtonEntryItemEventArgs CreateAndAddFromSmartEvent(IntPtr data, IntPtr obj, IntPtr info) - { - // Item can be added throught calling Append method and user input. - // And since "item.added" event will be called before xx_append() method returns, - // ItemObject does NOT have an item that contains handle matched to "info" at this time. - // So, item should be created and added internally here. - MultiButtonEntryItem item = new MultiButtonEntryItem(info); - return new MultiButtonEntryItemEventArgs() { Item = item }; - } - } -} \ No newline at end of file diff --git a/src/ElmSharp/ElmSharp/MultiButtonEntryItem.cs b/src/ElmSharp/ElmSharp/MultiButtonEntryItem.cs deleted file mode 100755 index 583e1ee43..000000000 --- a/src/ElmSharp/ElmSharp/MultiButtonEntryItem.cs +++ /dev/null @@ -1,86 +0,0 @@ -/* - * 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 ElmSharp -{ - /// - /// It inherits . - /// MutltiButtonEntryItem is a item which is added to MultiButtonEntry. - /// It contains Next and Prev properties to get next and previous item. - /// - public class MultiButtonEntryItem : ItemObject - { - /// - /// Creates and initializes a new instance of the MultiButtonEntryItem class. - /// - /// The text of MultiButtonEntryItem's Label name. - public MultiButtonEntryItem(string text) : base(IntPtr.Zero) - { - Label = text; - } - - internal MultiButtonEntryItem(IntPtr handle) : base(handle) - { - Label = Interop.Elementary.elm_object_item_part_text_get(handle, null); - } - - /// - /// Gets the label of this item. - /// - public string Label { get; private set; } - - /// - /// Gets or sets the selected state of an item. - /// - public bool IsSelected - { - get - { - return Interop.Elementary.elm_multibuttonentry_item_selected_get(Handle); - } - set - { - Interop.Elementary.elm_multibuttonentry_item_selected_set(Handle, value); - } - } - - /// - /// Get the next item in the multibuttonentry. - /// - public MultiButtonEntryItem Next - { - get - { - var next = Interop.Elementary.elm_multibuttonentry_item_next_get(Handle); - return ItemObject.GetItemByHandle(next) as MultiButtonEntryItem; - } - } - - /// - /// Get the previous item in the multibuttonentry. - /// - public MultiButtonEntryItem Prev - { - get - { - var prev = Interop.Elementary.elm_multibuttonentry_item_prev_get(Handle); - return ItemObject.GetItemByHandle(prev) as MultiButtonEntryItem; - } - } - } -} \ No newline at end of file diff --git a/src/ElmSharp/ElmSharp/NaviItem.cs b/src/ElmSharp/ElmSharp/NaviItem.cs deleted file mode 100755 index f7da156b0..000000000 --- a/src/ElmSharp/ElmSharp/NaviItem.cs +++ /dev/null @@ -1,126 +0,0 @@ -/* - * 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 ElmSharp -{ - /// - /// The NaviItem is a widget to contain the contents to show in Naviframe. - /// Inherits ItemObject - /// - public class NaviItem : ItemObject - { - EvasObject _content; - bool _isPopped; - Color _barBackgroundColor = Color.Default; - Interop.Elementary.Elm_Naviframe_Item_Pop_Cb _popped; - - NaviItem(IntPtr handle, EvasObject content) : base(handle) - { - _isPopped = false; - _content = content; - _popped = (d, i) => - { - _isPopped = true; - Popped?.Invoke(this, EventArgs.Empty); - return true; - }; - Interop.Elementary.elm_naviframe_item_pop_cb_set(handle, _popped, IntPtr.Zero); - } - - /// - /// Popped will be triggered when NaviItem is removed. - /// - public event EventHandler Popped; - - /// - /// Gets the content object. The name of content part is "elm.swallow.content". - /// - public EvasObject Content - { - get { return _content; } - } - - /// - /// Sets or gets a value whether title area is enabled or not. - /// - public bool TitleBarVisible - { - get - { - return Interop.Elementary.elm_naviframe_item_title_enabled_get(Handle); - } - set - { - Interop.Elementary.elm_naviframe_item_title_enabled_set(Handle, value, false); - } - } - - /// - /// Sets or gets the title bar background color - /// - public Color TitleBarBackgroundColor - { - get - { - return _barBackgroundColor; - } - set - { - if (value.IsDefault) - { - Interop.Elementary.elm_object_item_color_class_del(Handle, "bg_title"); - } - else - { - SetPartColor("bg_title", value); - _barBackgroundColor = value; - } - } - } - - /// - /// Sets or gets an item style. - /// - public string Style - { - get - { - return Interop.Elementary.elm_naviframe_item_style_get(Handle); - } - set - { - Interop.Elementary.elm_naviframe_item_style_set(Handle, value); - } - } - - /// - /// Invalidate the EventArgs if _isPopped is false. - /// The method should be overridden in children class. - /// - protected override void OnInvalidate() - { - if (!_isPopped) - Popped?.Invoke(this, EventArgs.Empty); - } - - internal static NaviItem FromNativeHandle(IntPtr handle, EvasObject content) - { - return new NaviItem(handle, content); - } - } -} diff --git a/src/ElmSharp/ElmSharp/Naviframe.cs b/src/ElmSharp/ElmSharp/Naviframe.cs deleted file mode 100755 index 8d3175658..000000000 --- a/src/ElmSharp/ElmSharp/Naviframe.cs +++ /dev/null @@ -1,259 +0,0 @@ -/* - * 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.Collections.Generic; - -namespace ElmSharp -{ - /// - /// The NaviframeEventArgs is a event args class for navi frame. - /// Inherits EventArgs - /// - public class NaviframeEventArgs : EventArgs - { - /// - /// Sets or gets the content object. The name of content part is "elm.swallow.content". - /// - public EvasObject Content { get; set; } - } - /// - /// Naviframe is a widget to stands for navigation frame. It's a views manager for applications. - /// Inherits Widget - /// - public class Naviframe : Widget - { - SmartEvent _transitionFinished; - readonly List _itemStack = new List(); - - /// - /// Creates and initializes a new instance of Naviframe class. - /// - /// The parent is a given container which will be attached by Naviframe as a child. It's type. - public Naviframe(EvasObject parent) : base(parent) - { - _transitionFinished = new SmartEvent(this, this.RealHandle, "transition,finished"); - _transitionFinished.On += (s, e) => AnimationFinished?.Invoke(this, EventArgs.Empty); - } - - /// - /// Popped will be triggered when NaviItem is removed. - /// - /// - /// It is always called when NaviItem was removed. - /// (even if removed by NaviItem.Delete()) - /// This event will be invoked in progress of Pop/Delete operation. - /// After called Popped event, Pop/Delete method will be returned - /// - public event EventHandler Popped; - - /// - /// AnimationFinished will be triggered when animation is finished. - /// - public event EventHandler AnimationFinished; - - /// - /// Gets the list of navi item - /// - public IReadOnlyList NavigationStack - { - get { return _itemStack; } - } - - /// - /// Sets or gets the the preserve content objects when items are popped. - /// - public bool PreserveContentOnPop - { - get - { - return Interop.Elementary.elm_naviframe_content_preserve_on_pop_get(RealHandle); - } - set - { - Interop.Elementary.elm_naviframe_content_preserve_on_pop_set(RealHandle, value); - } - } - - /// - /// Sets or gets whether the default back button is enabled - /// - public bool DefaultBackButtonEnabled - { - get - { - return Interop.Elementary.elm_naviframe_prev_btn_auto_pushed_get(RealHandle); - } - set - { - Interop.Elementary.elm_naviframe_prev_btn_auto_pushed_set(RealHandle, value); - } - } - - /// - /// Push a new item to the top of the naviframe stack and show it. - /// The title and style are null. - /// - /// The main content object. The name of content part is "elm.swallow.content". - /// The created item or null upon failure. - public NaviItem Push(EvasObject content) - { - return Push(content, null); - } - - /// - /// Push a new item to the top of the naviframe stack and show it. - /// The style are null. - /// - /// The main content object. The name of content part is "elm.swallow.content". - /// The current item title. null would be default. - /// - public NaviItem Push(EvasObject content, string title) - { - return Push(content, title, null); - } - - /// - /// Push a new item to the top of the naviframe stack and show it. - /// - /// The main content object. The name of content part is "elm.swallow.content". - /// The current item title. null would be default. - /// The current item style name. null would be default. - /// The created item or null upon failure. - public NaviItem Push(EvasObject content, string title, string style) - { - IntPtr item = Interop.Elementary.elm_naviframe_item_push(RealHandle, title, IntPtr.Zero, IntPtr.Zero, content.Handle, style); - NaviItem naviItem = NaviItem.FromNativeHandle(item, content); - _itemStack.Add(naviItem); - naviItem.Popped += ItemPoppedHandler; - return naviItem; - } - - /// - /// Insert a new item into the naviframe before item. - /// The title is "" and the style is null. - /// - /// The item which the new item is inserted before. - /// The main content object. The name of content part is "elm.swallow.content". - /// The created item or null upon failure. - public NaviItem InsertBefore(NaviItem before, EvasObject content) - { - return InsertBefore(before, content, ""); - } - - /// - /// Insert a new item into the naviframe before item. - /// The style is null. - /// - /// The item which the new item is inserted before. - /// The main content object. The name of content part is "elm.swallow.content". - /// The current item title. null would be default. - /// The created item or null upon failure. - public NaviItem InsertBefore(NaviItem before, EvasObject content, string title) - { - return InsertBefore(before, content, title, null); - } - - /// - /// Insert a new item into the naviframe before item. - /// - /// The item which the new item is inserted before. - /// The main content object. The name of content part is "elm.swallow.content". - /// The current item title. null would be default. - /// The current item style name. null would be default. - /// The created item or null upon failure. - public NaviItem InsertBefore(NaviItem before, EvasObject content, string title, string style) - { - IntPtr item = Interop.Elementary.elm_naviframe_item_insert_before(RealHandle, before, title, IntPtr.Zero, IntPtr.Zero, content, null); - NaviItem naviItem = NaviItem.FromNativeHandle(item, content); - int idx = _itemStack.IndexOf(before); - _itemStack.Insert(idx, naviItem); - naviItem.Popped += ItemPoppedHandler; - return naviItem; - } - - /// - /// Insert a new item into the naviframe after item. - /// The title is "" and the style is null. - /// - /// The item which the new item is inserted after. - /// The main content object. The name of content part is "elm.swallow.content". - /// The created item or null upon failure. - public NaviItem InsertAfter(NaviItem after, EvasObject content) - { - return InsertAfter(after, content, ""); - } - - /// - /// Insert a new item into the naviframe after item. - /// The style is null. - /// - /// The item which the new item is inserted after. - /// The main content object. The name of content part is "elm.swallow.content". - /// The current item title. null would be default. - /// The created item or null upon failure. - public NaviItem InsertAfter(NaviItem after, EvasObject content, string title) - { - return InsertAfter(after, content, title, null); - } - - /// - /// Insert a new item into the naviframe after item. - /// - /// The item which the new item is inserted after. - /// The main content object. The name of content part is "elm.swallow.content". - /// The current item title. null would be default. - /// The current item style name. null would be default. - /// The created item or null upon failure. - public NaviItem InsertAfter(NaviItem after, EvasObject content, string title, string style) - { - IntPtr item = Interop.Elementary.elm_naviframe_item_insert_after(RealHandle, after, title, IntPtr.Zero, IntPtr.Zero, content, null); - NaviItem naviItem = NaviItem.FromNativeHandle(item, content); - int idx = _itemStack.IndexOf(after); - _itemStack.Insert(idx + 1, naviItem); - naviItem.Popped += ItemPoppedHandler; - return naviItem; - } - - /// - /// Pop an item that is on top of the stack. - /// - public void Pop() - { - Interop.Elementary.elm_naviframe_item_pop(RealHandle); - } - - protected override IntPtr CreateHandle(EvasObject parent) - { - IntPtr handle = Interop.Elementary.elm_layout_add(parent); - Interop.Elementary.elm_layout_theme_set(handle, "layout", "elm_widget", "default"); - - RealHandle = Interop.Elementary.elm_naviframe_add(handle); - Interop.Elementary.elm_object_part_content_set(handle, "elm.swallow.content", RealHandle); - - return handle; - } - - void ItemPoppedHandler(object sender, EventArgs e) - { - NaviItem item = sender as NaviItem; - if (item == null) - return; - _itemStack.Remove(item); - Popped?.Invoke(this, new NaviframeEventArgs() { Content = item.Content }); - } - } -} diff --git a/src/ElmSharp/ElmSharp/Panel.cs b/src/ElmSharp/ElmSharp/Panel.cs deleted file mode 100755 index f644d27b8..000000000 --- a/src/ElmSharp/ElmSharp/Panel.cs +++ /dev/null @@ -1,137 +0,0 @@ -/* - * 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 ElmSharp -{ - /// - /// Enumeration for paneldirection type. - /// - public enum PanelDirection - { - /// - /// Top to bottom - /// - Top = 0, - /// - /// Bottom to top - /// - Bottom, - /// - /// Left to right - /// - Left, - /// - /// Right to left - /// - Right, - } - - /// - /// The Panel is a container that can contain subobjects. - /// - public class Panel : Layout - { - SmartEvent _toggled; - - /// - /// Creates and initializes a new instance of Panel class. - /// - /// The EvasObject to which the new Panel will be attached as a child. - public Panel(EvasObject parent) : base(parent) - { - _toggled = new SmartEvent(this, this.RealHandle, "toggled"); - _toggled.On += (s, e) => Toggled?.Invoke(this, EventArgs.Empty); - } - - /// - /// Sets or gets the hidden status of a given Panel widget. - /// - public bool IsOpen - { - get - { - return !Interop.Elementary.elm_panel_hidden_get(RealHandle); - } - set - { - Interop.Elementary.elm_panel_hidden_set(RealHandle, !value); - } - } - - /// - /// Sets or gets the direction of a given Panel widget. - /// - public PanelDirection Direction - { - get - { - return (PanelDirection)Interop.Elementary.elm_panel_orient_get(RealHandle); - } - set - { - Interop.Elementary.elm_panel_orient_set(RealHandle, (int)value); - } - } - - /// - /// Toggled will be triggered when toggles Panel. - /// - public event EventHandler Toggled; - - /// - /// Enable or disable scrolling in the Panel. - /// - /// - /// Bool value can be false or true. - /// - public void SetScrollable(bool enable) - { - Interop.Elementary.elm_panel_scrollable_set(RealHandle, enable); - } - - /// - /// Sets the scroll size of Panel. - /// - /// - /// The size of scroll area. - /// - public void SetScrollableArea(double ratio) - { - Interop.Elementary.elm_panel_scrollable_content_size_set(RealHandle, ratio); - } - - /// - /// Toggles the hidden state of the Panel. - /// - public void Toggle() - { - Interop.Elementary.elm_panel_toggle(RealHandle); - } - - protected override IntPtr CreateHandle(EvasObject parent) - { - IntPtr handle = Interop.Elementary.elm_layout_add(parent); - Interop.Elementary.elm_layout_theme_set(handle, "layout", "elm_widget", "default"); - - RealHandle = Interop.Elementary.elm_panel_add(handle); - Interop.Elementary.elm_object_part_content_set(handle, "elm.swallow.content", RealHandle); - - return handle; - } - } -} diff --git a/src/ElmSharp/ElmSharp/Panes.cs b/src/ElmSharp/ElmSharp/Panes.cs deleted file mode 100755 index 4871d682c..000000000 --- a/src/ElmSharp/ElmSharp/Panes.cs +++ /dev/null @@ -1,194 +0,0 @@ -/* - * 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 ElmSharp -{ - /// - /// The Panes is a widget that adds a draggable bar between two contents. - /// When dragged this bar resizes contents' size. - /// - public class Panes : Layout - { - SmartEvent _press; - SmartEvent _unpressed; - - /// - /// Creates and initializes a new instance of the Panes class. - /// - /// The EvasObject to which the new Panes will be attached as a child. - public Panes(EvasObject parent) : base(parent) - { - _press = new SmartEvent(this, this.RealHandle, "press"); - _unpressed = new SmartEvent(this, this.RealHandle, "unpress"); - - _press.On += (s, e) => Pressed?.Invoke(this, e); - _unpressed.On += (s, e) => Unpressed?.Invoke(this, e); - } - - /// - /// Pressed will be triggered when panes have been pressed (button isn't released yet). - /// - public event EventHandler Pressed; - - /// - /// Unpressed will be triggered when panes are released after being pressed. - /// - public event EventHandler Unpressed; - - /// - /// Sets or gets resize mode of a given Panes widget. - /// True means the left and right panes resize homogeneously. - /// - public bool IsFixed - { - get - { - return Interop.Elementary.elm_panes_fixed_get(RealHandle); - } - set - { - Interop.Elementary.elm_panes_fixed_set(RealHandle, value); - } - } - - /// - /// Sets or Gets the size proportion of the Panes widget's left side. - /// - /// - /// By default it's homogeneous, i.e., both sides have the same size.If something different is required, - /// it can be set with this function. For example, if the left content should be displayed over 75% of the panes size, - /// size should be passed as 0.75. This way, the right content is resized to 25% of the panes size. - /// If displayed vertically, left content is displayed at the top, and right content at the bottom. - /// This proportion changes when the user drags the panes bar. - /// - /// The value is float type and between 0.0 and 1.0 representing the size proportion of the left side. - /// - public double Proportion - { - get - { - return Interop.Elementary.elm_panes_content_left_size_get(RealHandle); - } - set - { - Interop.Elementary.elm_panes_content_left_size_set(RealHandle, value); - } - } - - /// - /// Sets or gets the orientation of a given Panes widget. - /// - /// - /// Use this function to change how your panes is to be disposed: vertically or horizontally. - /// Horizontal panes have "top" and "bottom" contents, vertical panes have "left" and "right" contents. - /// By default panes is in a vertical mode. - /// - public bool IsHorizontal - { - get - { - return Interop.Elementary.elm_panes_horizontal_get(RealHandle); - } - set - { - Interop.Elementary.elm_panes_horizontal_set(RealHandle, value); - } - } - - /// - /// Sets or gets the absolute minimum size of panes widget's left side. - /// If displayed vertically, left content is displayed at top. - /// value representing minimum size of left side in pixels. - /// - public int LeftMinimumSize - { - get - { - return Interop.Elementary.elm_panes_content_left_min_size_get(RealHandle); - } - set - { - Interop.Elementary.elm_panes_content_left_min_size_set(RealHandle, value); - } - } - - /// - /// Sets or gets the relative minimum size of panes widget's left side. - /// proportion of minimum size of left side. - /// If displayed vertically, left content is displayed at top. - /// value between 0.0 and 1.0 representing size proportion of minimum size of left side. - /// - public double LeftMinimumRelativeSize - { - get - { - return Interop.Elementary.elm_panes_content_left_min_relative_size_get(RealHandle); - } - set - { - Interop.Elementary.elm_panes_content_left_min_relative_size_set(RealHandle, value); - } - } - - /// - /// Sets or gets the absolute minimum size of panes widget's right side. - /// If displayed vertically, right content is displayed at top. - /// value representing minimum size of right side in pixels. - /// - public int RightMinimumSize - { - get - { - return Interop.Elementary.elm_panes_content_right_min_size_get(RealHandle); - } - set - { - Interop.Elementary.elm_panes_content_right_min_size_set(RealHandle, value); - } - } - - /// - /// Sets or gets the relative minimum size of panes widget's right side. - /// proportion of minimum size of right side. - /// If displayed vertically, right content is displayed at top. - /// value between 0.0 and 1.0 representing size proportion of minimum size of right side. - /// - public double RightMinimumRelativeSize - { - get - { - return Interop.Elementary.elm_panes_content_right_min_relative_size_get(RealHandle); - } - set - { - Interop.Elementary.elm_panes_content_right_min_relative_size_set(RealHandle, value); - } - } - - protected override IntPtr CreateHandle(EvasObject parent) - { - IntPtr handle = Interop.Elementary.elm_layout_add(parent.Handle); - Interop.Elementary.elm_layout_theme_set(handle, "layout", "elm_widget", "default"); - - RealHandle = Interop.Elementary.elm_panes_add(handle); - Interop.Elementary.elm_object_part_content_set(handle, "elm.swallow.content", RealHandle); - - return handle; - } - } -} \ No newline at end of file diff --git a/src/ElmSharp/ElmSharp/Point.cs b/src/ElmSharp/ElmSharp/Point.cs deleted file mode 100755 index 3fe04cd6e..000000000 --- a/src/ElmSharp/ElmSharp/Point.cs +++ /dev/null @@ -1,84 +0,0 @@ -/* - * 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 ElmSharp -{ - /// - /// The Point is a struct that defines a 2-D point as a pair of generic type. - /// - public struct Point : IEquatable - { - /// - /// Location along the horizontal axis. - /// - public int X; - - /// - /// Location along the vertical axis. - /// - public int Y; - - public override string ToString() - { - return string.Format("{{X={0} Y={1}}}", X, Y); - } - - public override int GetHashCode() - { - unchecked - { - return X.GetHashCode() ^ (Y.GetHashCode() * 397); - } - } - - public override bool Equals(object obj) - { - if (!(obj is Point)) - return false; - - return Equals((Point)obj); - } - - public bool Equals(Point other) - { - return X.Equals(other.X) && Y.Equals(other.Y); - } - - /// - /// Whether the two s are equal. - /// - /// A on the left hand side. - /// A on the right hand side. - /// True if the two s have equal values. - public static bool operator ==(Point p1, Point p2) - { - return p1.Equals(p2); - } - - /// - /// Whether two s are not equal. - /// - /// A on the left hand side. - /// A on the right hand side. - /// True if the two s do not have equal values. - public static bool operator !=(Point p1, Point p2) - { - return !p1.Equals(p2); - } - } -} diff --git a/src/ElmSharp/ElmSharp/Point3D.cs b/src/ElmSharp/ElmSharp/Point3D.cs deleted file mode 100755 index ebb8afbf0..000000000 --- a/src/ElmSharp/ElmSharp/Point3D.cs +++ /dev/null @@ -1,92 +0,0 @@ -/* - * 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 ElmSharp -{ - /// - /// The Point3D is a Struct that defining a 3-D point. - /// - public struct Point3D : IEquatable - { - /// - /// The X coordinate of a 3D point. - /// - public int X; - - /// - /// The Y coordinate of a 3D point. - /// - public int Y; - - /// - /// The Z coordinate of a 3D point. - /// - public int Z; - - public override string ToString() - { - return string.Format("{{X={0} Y={1} Z={2}}}", X, Y, Z); - } - - public override int GetHashCode() - { - unchecked - { - int hashCode = X.GetHashCode(); - hashCode = (hashCode * 397) ^ Y.GetHashCode(); - hashCode = (hashCode * 397) ^ Z.GetHashCode(); - return hashCode; - } - } - - public override bool Equals(object obj) - { - if (!(obj is Point3D)) - return false; - - return Equals((Point3D)obj); - } - - public bool Equals(Point3D other) - { - return X.Equals(other.X) && Y.Equals(other.Y) && Z.Equals(other.Z); - } - - /// - /// Whether the two s are equal. - /// - /// A on the left hand side. - /// A on the right hand side. - /// True if the two s have equal values. - public static bool operator ==(Point3D p1, Point3D p2) - { - return p1.Equals(p2); - } - - /// - /// Whether two s are not equal. - /// - /// A on the left hand side. - /// A on the right hand side. - /// True if the two s do not have equal values. - public static bool operator !=(Point3D p1, Point3D p2) - { - return !p1.Equals(p2); - } - } -} diff --git a/src/ElmSharp/ElmSharp/Polygon.cs b/src/ElmSharp/ElmSharp/Polygon.cs deleted file mode 100755 index 5db398d1e..000000000 --- a/src/ElmSharp/ElmSharp/Polygon.cs +++ /dev/null @@ -1,67 +0,0 @@ -/* - * 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 ElmSharp -{ - /// - /// The Polygon is a widget that used to draw a polygon (filled). - /// - public class Polygon : EvasObject - { - /// - /// Creates and initializes a new instance of the Polygon class. - /// The EvasObject to which the new Polygon will be attached as a child. - /// - public Polygon(EvasObject parent) : base(parent) - { - } - - /// - /// Adds a new vertex to the Polygon. - /// The X coordinate of the new vertex. - /// The Y coordinate of the new vertex. - /// - public void AddPoint(int x, int y) - { - Interop.Evas.evas_object_polygon_point_add(Handle, x, y); - } - - /// - /// Adds a new vertex to the Polygon. - /// The coordinates of the new vertex. - /// - public void AddPoint(Point p) - { - AddPoint(p.X, p.Y); - } - - /// - /// Removes all the vertices of the Polygon, making it empty. - /// - public void ClearPoints() - { - Interop.Evas.evas_object_polygon_points_clear(Handle); - } - - protected override IntPtr CreateHandle(EvasObject parent) - { - IntPtr evas = Interop.Evas.evas_object_evas_get(parent.Handle); - return Interop.Evas.evas_object_polygon_add(evas); - } - } -} diff --git a/src/ElmSharp/ElmSharp/Popup.cs b/src/ElmSharp/ElmSharp/Popup.cs deleted file mode 100755 index 26f736d25..000000000 --- a/src/ElmSharp/ElmSharp/Popup.cs +++ /dev/null @@ -1,291 +0,0 @@ -/* - * 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.Collections.Generic; - -namespace ElmSharp -{ - /// - /// Enumeration for the popup orientation type. - /// - public enum PopupOrientation - { - /// - /// Appears in the top of parent, default. - /// - Top, - /// - /// Appears in the center of parent. - /// - Center, - /// - /// Appears in the bottom of parent. - /// - Bottom, - /// - /// Appears in the left of parent. - /// - Left, - /// - /// Appears in the right of parent. - /// - Right, - /// - /// Appears in the top left of parent. - /// - TopLeft, - /// - /// Appears in the top right of parent. - /// - TopRight, - /// - /// Appears in the bottom left of parent. - /// - BottomLeft, - /// - /// Appears in the bottom right of parent. - /// - BottomRight - } - - /// - /// The Popup is a widget that is an enhancement of Notify. - /// In addition to content area, there are two optional sections, namely title area and action area. - /// - public class Popup : Layout - { - HashSet _children = new HashSet(); - SmartEvent _dismissed; - SmartEvent _blockClicked; - SmartEvent _timeout; - SmartEvent _showFinished; - - /// - /// Creates and initializes a new instance of the Popup class. - /// - /// The EvasObject to which the new Popup will be attached as a child. - public Popup(EvasObject parent) : base(parent) - { - _dismissed = new SmartEvent(this, "dismissed"); - _dismissed.On += (sender, e) => - { - Dismissed?.Invoke(this, EventArgs.Empty); - }; - - _blockClicked = new SmartEvent(this, "block,clicked"); - _blockClicked.On += (sender, e) => - { - OutsideClicked?.Invoke(this, EventArgs.Empty); - }; - - _timeout = new SmartEvent(this, "timeout"); - _timeout.On += (sender, e) => - { - TimedOut?.Invoke(this, EventArgs.Empty); - }; - - _showFinished = new SmartEvent(this, "show,finished"); - _showFinished.On += (sender, e) => - { - ShowAnimationFinished?.Invoke(this, EventArgs.Empty); - }; - } - - /// - /// Dismissed will be triggered when Popup have been dismissed. - /// - public event EventHandler Dismissed; - - /// - /// OutsideClicked will be triggered when users taps on the outside of Popup. - /// - public event EventHandler OutsideClicked; - - /// - /// OutsideClicked will be triggered when Popup is closed as a result of timeout. - /// - public event EventHandler TimedOut; - - /// - /// OutsideClicked will be triggered when the Popup transition is finished in showing. - /// - public event EventHandler ShowAnimationFinished; - - /// - /// Sets or gets the position in which Popup will appear in its parent. - /// - public PopupOrientation Orientation - { - get - { - return (PopupOrientation)Interop.Elementary.elm_popup_orient_get(Handle); - } - set - { - Interop.Elementary.elm_popup_orient_set(Handle, (int)value); - } - } - - /// - /// Sets or gets the wrapping type of content text packed in content area of Popup widget. - /// - public WrapType ContentTextWrapType - { - get - { - return (WrapType)Interop.Elementary.elm_popup_content_text_wrap_type_get(Handle); - } - set - { - Interop.Elementary.elm_popup_content_text_wrap_type_set(Handle, (int)value); - } - } - - /// - /// Sets or gets the timeout value set to the Popup(in seconds). - /// - /// - /// Since calling Show() on a popup restarts the timer controlling when it is hidden, - /// setting this before the popup is shown will in effect mean starting the timer when the popup is shown. - /// TimedOut is called afterwards which can be handled if needed. - /// Set a value <= 0.0 to disable a running timer.If the value > 0.0 and the popup is previously visible, - /// the timer will be started with this value, canceling any running timer. - /// - public double Timeout - { - get - { - return Interop.Elementary.elm_popup_timeout_get(Handle); - } - set - { - Interop.Elementary.elm_popup_timeout_set(Handle, value); - } - } - - /// - /// Sets or gets whether events should be passed to event blocked area by a click outside. - /// - /// - /// The visible region of popup is surrounded by a translucent region called Blocked Event area. - /// - public bool AllowEvents - { - get - { - return Interop.Elementary.elm_popup_allow_events_get(Handle); - } - set - { - Interop.Elementary.elm_popup_allow_events_set(Handle, value); - } - } - - /// - /// Sets or gets the AlignmentX in which the popup will appear in its parent. - /// - public override double AlignmentX - { - get - { - return Interop.Elementary.GetPopupAlignX(Handle); - } - set - { - Interop.Elementary.SetPopupAlignX(Handle, value); - } - } - - /// - /// Sets or gets the AlignmentY in which the popup will appear in its parent. - /// - public override double AlignmentY - { - get - { - return Interop.Elementary.GetPopupAlignY(Handle); - } - set - { - Interop.Elementary.SetPopupAlignY(Handle, value); - } - } - - /// - /// Gets the Opacity value of the Popup. - /// - public override int Opacity - { - get - { - return Color.Default.A; - } - - set - { - Console.WriteLine("Popup instance doesn't support to set Opacity."); - } - } - - /// - /// Adds label to a Popup widget. - /// - /// - /// The new PopupItem which contains label . - public PopupItem Append(string label) - { - return Append(label, null); - } - - /// - /// Adds Label and icon to a Popup widget. - /// - /// The Label which will be added into a new PopupItem. - /// The icon which will be added into a new PopupItem. - /// The new PopupItem which contains label and icon. - public PopupItem Append(string label, EvasObject icon) - { - PopupItem item = new PopupItem(label, icon); - item.Handle = Interop.Elementary.elm_popup_item_append(Handle, label, icon, null, (IntPtr)item.Id); - AddInternal(item); - return item; - } - - /// - /// Uses this function to dismiss the popup in hide effect. - /// when the Popup is dismissed, the "dismissed" signal will be emitted. - /// - public void Dismiss() - { - Interop.Elementary.elm_popup_dismiss(Handle); - } - - protected override IntPtr CreateHandle(EvasObject parent) - { - return Interop.Elementary.elm_popup_add(parent.Handle); - } - void AddInternal(PopupItem item) - { - _children.Add(item); - item.Deleted += Item_Deleted; - } - void Item_Deleted(object sender, EventArgs e) - { - _children.Remove((PopupItem)sender); - } - } -} \ No newline at end of file diff --git a/src/ElmSharp/ElmSharp/PopupItem.cs b/src/ElmSharp/ElmSharp/PopupItem.cs deleted file mode 100755 index 1251c5586..000000000 --- a/src/ElmSharp/ElmSharp/PopupItem.cs +++ /dev/null @@ -1,42 +0,0 @@ -/* - * 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 ElmSharp -{ - /// - /// The PopupItem is a class that including icon and text. - /// - public class PopupItem : ItemObject - { - internal PopupItem(string text, EvasObject icon) : base(IntPtr.Zero) - { - Text = text; - Icon = icon; - } - - /// - /// Gets the text label of popupitem.Return value is string. - /// - public string Text { get; internal set; } - - /// - /// Gets the icon EvasObject of popupitem. - /// - public EvasObject Icon { get; internal set; } - } -} diff --git a/src/ElmSharp/ElmSharp/ProgressBar.cs b/src/ElmSharp/ElmSharp/ProgressBar.cs deleted file mode 100755 index e04f01596..000000000 --- a/src/ElmSharp/ElmSharp/ProgressBar.cs +++ /dev/null @@ -1,223 +0,0 @@ -/* - * 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 ElmSharp -{ - /// - /// The ProgressBar is a widget for visually representing the progress status of a given job/task. - /// - public class ProgressBar : Layout - { - SmartEvent _changed; - - /// - /// Creates and initializes a new instance of the ProgressBar class. - /// - /// The EvasObject to which the new ProgressBar will be attached as a child. - public ProgressBar(EvasObject parent) : base(parent) - { - _changed = new SmartEvent(this, this.RealHandle, "changed"); - _changed.On += (s, e) => - { - ValueChanged?.Invoke(this, EventArgs.Empty); - }; - } - - /// - /// ValueChanged will be triggered when value of ProgressBar change. - /// - public event EventHandler ValueChanged; - - /// - /// Sets or gets the value wheather a given ProgressBar widget is at the "pulsing mode". - /// - /// - /// By default, progress bars display values from low to high value boundaries. - /// There are, though, contexts in which the progress of a given task is unknown. - /// For such cases, one can set a progress bar widget to a "pulsing state", - /// to give the user an idea that some computation is being held, - /// but without exact progress values. In the default theme, - /// it animates its bar with the contents filling in constantly and back to non-filled, in a loop. - /// - public bool IsPulseMode - { - get - { - return Interop.Elementary.elm_progressbar_pulse_get(RealHandle); - } - set - { - Interop.Elementary.elm_progressbar_pulse_set(RealHandle, value); - } - } - - /// - /// Sets or gets the value of ProgressBar. - /// - /// - /// Use this property to set the progress bar levels. - /// If you pass a value out of the specified range(0.0~1.0), - /// it is interpreted as the closest of the boundary values in the range. - /// - public double Value - { - get - { - return Interop.Elementary.elm_progressbar_value_get(RealHandle); - } - set - { - Interop.Elementary.elm_progressbar_value_set(RealHandle, value); - } - } - - /// - /// Sets or gets the span value of ProgressBar. - /// - public int SpanSize - { - get - { - return Interop.Elementary.elm_progressbar_span_size_get(RealHandle); - } - set - { - Interop.Elementary.elm_progressbar_span_size_set(RealHandle, value); - } - } - - /// - /// Sets or gets the value wheather a given ProgressBar widget is horizontal. - /// - public bool IsHorizontal - { - get - { - return Interop.Elementary.elm_progressbar_horizontal_get(RealHandle); - } - set - { - Interop.Elementary.elm_progressbar_horizontal_set(RealHandle, value); - } - } - - /// - /// Sets or gets the value whether a given progress bar widget's displaying values are inverted. - /// - public bool IsInverted - { - get - { - return Interop.Elementary.elm_progressbar_inverted_get(RealHandle); - } - set - { - Interop.Elementary.elm_progressbar_inverted_set(RealHandle, value); - } - } - - /// - /// Sets or gets format string for a given progress bar widget's units label. - /// - /// - /// If NULL is passed on format, it makes obj units area to be hidden completely. - /// If not, it sets the format string for the units label's text. - /// The units label is provided with a floating point value, so the units text displays at most one floating point value. - /// Note that the units label is optional. Use a format string such as "%1.2f meters" for example. - /// - public string UnitFormat - { - get - { - return Interop.Elementary.elm_progressbar_unit_format_get(RealHandle); - } - set - { - Interop.Elementary.elm_progressbar_unit_format_set(RealHandle, value); - } - } - - /// - /// Starts a given progress bar "pulsing" animation, if its under that mode. - /// - public void PlayPulse() - { - Interop.Elementary.elm_progressbar_pulse(RealHandle, true); - } - - [Obsolete("use StopPulse instead")] - public void StopPluse() - { - Interop.Elementary.elm_progressbar_pulse(RealHandle, false); - } - - /// - /// Stops a given progress bar "pulsing" animation, if its under that mode. - /// - public void StopPulse() - { - Interop.Elementary.elm_progressbar_pulse(RealHandle, false); - } - - /// - /// Gets the part value of the given part of the Progressbar. - /// - /// Part of the Progressbar. - /// Returns value range is from 0.0 to 1.0. - public double GetPartValue(string part) - { - return Interop.Elementary.elm_progressbar_part_value_get(RealHandle, part); - } - - /// - /// Sets or gets the general or main color of the given Progressbar. - /// - public override Color Color - { - get - { - return GetPartColor("bar"); - } - set - { - SetPartColor("bar", value); - } - } - - /// - /// Sets the part value of the give part of the Progressbar. - /// - /// Part of the Progressbar. - /// Value range is from 0.0 to 1.0. - public void SetPartValue(string part, double value) - { - Interop.Elementary.elm_progressbar_part_value_set(RealHandle, part, value); - } - - protected override IntPtr CreateHandle(EvasObject parent) - { - IntPtr handle = Interop.Elementary.elm_layout_add(parent.Handle); - Interop.Elementary.elm_layout_theme_set(handle, "layout", "elm_widget", "default"); - - RealHandle = Interop.Elementary.elm_progressbar_add(handle); - Interop.Elementary.elm_object_part_content_set(handle, "elm.swallow.content", RealHandle); - - return handle; - } - } -} \ No newline at end of file diff --git a/src/ElmSharp/ElmSharp/Radio.cs b/src/ElmSharp/ElmSharp/Radio.cs deleted file mode 100755 index 9a5f2d595..000000000 --- a/src/ElmSharp/ElmSharp/Radio.cs +++ /dev/null @@ -1,97 +0,0 @@ -/* - * 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 ElmSharp -{ - /// - /// The Radio is a widget that allows for 1 or more options to be displayed and have the user choose only 1 of them. - /// - public class Radio : Layout - { - SmartEvent _changed; - - /// - /// Creates and initializes a new instance of the Radio class. - /// - /// The EvasObject to which the new Radio will be attached as a child. - public Radio(EvasObject parent) : base(parent) - { - _changed = new SmartEvent(this, this.RealHandle, "changed"); - _changed.On += (s, e) => ValueChanged?.Invoke(this, EventArgs.Empty); - } - - /// - /// ValueChanged will be triggered when value of Radio change. - /// - public event EventHandler ValueChanged; - - /// - /// Sets or gets a unique value to each Radio button. - /// - public int StateValue - { - get - { - return Interop.Elementary.elm_radio_state_value_get(RealHandle); - } - set - { - Interop.Elementary.elm_radio_state_value_set(RealHandle, value); - } - } - - /// - /// Sets or gets the value of the radio group. - /// - public int GroupValue - { - get - { - return Interop.Elementary.elm_radio_value_get(RealHandle); - } - set - { - Interop.Elementary.elm_radio_value_set(RealHandle, value); - } - } - - /// - /// Adds this radio to a group of other radio objects. - /// - /// Group which add radio in. - public void SetGroup(Radio group) - { - if (group == null) - { - throw new ArgumentNullException("group"); - } - Interop.Elementary.elm_radio_group_add(RealHandle, group.RealHandle); - } - - protected override IntPtr CreateHandle(EvasObject parent) - { - IntPtr handle = Interop.Elementary.elm_layout_add(parent.Handle); - Interop.Elementary.elm_layout_theme_set(handle, "layout", "elm_widget", "default"); - - RealHandle = Interop.Elementary.elm_radio_add(handle); - Interop.Elementary.elm_object_part_content_set(handle, "elm.swallow.content", RealHandle); - - return handle; - } - } -} diff --git a/src/ElmSharp/ElmSharp/ReadingInfoType.cs b/src/ElmSharp/ElmSharp/ReadingInfoType.cs deleted file mode 100755 index 35df93265..000000000 --- a/src/ElmSharp/ElmSharp/ReadingInfoType.cs +++ /dev/null @@ -1,48 +0,0 @@ -/* - * 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 ElmSharp.Accessible -{ - /// - /// Enumeration for ReadingInfoType. - /// - [Flags] - public enum ReadingInfoType - { - /// - /// None - /// - None = 0, - /// - /// Name for reading info type - /// - Name = 0x1, - /// - /// Role for reading info type - /// - Role = 0x2, - /// - /// Description for reading info type - /// - Description = 0x4, - /// - /// State for reading info type - /// - State = 0x8 - } -} diff --git a/src/ElmSharp/ElmSharp/Rect.cs b/src/ElmSharp/ElmSharp/Rect.cs deleted file mode 100644 index 2f7a54404..000000000 --- a/src/ElmSharp/ElmSharp/Rect.cs +++ /dev/null @@ -1,144 +0,0 @@ -/* - * 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; - -namespace ElmSharp -{ - /// - /// The Rect is a struct that represent rectangluar space. - /// - [StructLayout(LayoutKind.Sequential)] - public struct Rect : IEquatable - { - /// - /// Creates and initializes a new instance of the Rect class. - /// - /// X axis value. - /// Y axis value. - /// Width value. - /// Height value. - public Rect(int x, int y, int w, int h) - { - X = x; - Y = y; - Width = w; - Height = h; - } - /// - /// Gets or sets the position of this Rectangle on the X axis. - /// - public int X { get; set; } - - /// - /// Gets or sets the position of this Rectangle on the Y axis. - /// - public int Y { get; set; } - - /// - /// Gets or sets the width of this Rectangle. - /// - public int Width { get; set; } - - /// - /// Gets or sets the height of this Rectangle. - /// - public int Height { get; set; } - - /// - /// Gets the position of this Rectangle on the X axis. - /// - public int Left { get { return X; } } - - /// - /// Gets the extent along the X axis. - /// - public int Right { get { return X + Width; } } - - /// - /// Gets the position of this Rectangle on the Y axis. - /// - public int Top { get { return Y; } } - - /// - /// Gets the extent along the Y axis. - /// - public int Bottom { get { return Y + Height; } } - - /// - /// Gets the Point defined by Rectangle.Left and Rectangle.Top. - /// - public Point Location { get { return new Point { X = X, Y = Y }; } } - - /// - /// Gets the extent of the Rectangle along its X and Y axis. - /// - public Size Size { get { return new Size { Width = Width, Height = Height }; } } - - public override string ToString() - { - return string.Format("{{X={0} Y={1} Width={2} Height={3}}}", X, Y, Width, Height); - } - - public override int GetHashCode() - { - unchecked - { - int hashCode = X.GetHashCode(); - hashCode = (hashCode * 397) ^ Y.GetHashCode(); - hashCode = (hashCode * 397) ^ Width.GetHashCode(); - hashCode = (hashCode * 397) ^ Height.GetHashCode(); - return hashCode; - } - } - - public override bool Equals(object obj) - { - if (!(obj is Rect)) - return false; - - return Equals((Rect)obj); - } - - public bool Equals(Rect other) - { - return X.Equals(other.X) && Y.Equals(other.Y) && Width.Equals(other.Width) && Height.Equals(other.Height); - } - - /// - /// Whether the two s are equal. - /// - /// A on the left hand side. - /// A on the right hand side. - /// True if the two s have equal values. - public static bool operator ==(Rect r1, Rect r2) - { - return r1.Equals(r2); - } - - /// - /// Whether two s are not equal. - /// - /// A on the left hand side. - /// A on the right hand side. - /// True if the two s do not have equal values. - public static bool operator !=(Rect r1, Rect r2) - { - return !r1.Equals(r2); - } - } -} diff --git a/src/ElmSharp/ElmSharp/Rectangle.cs b/src/ElmSharp/ElmSharp/Rectangle.cs deleted file mode 100755 index b0e69f8dd..000000000 --- a/src/ElmSharp/ElmSharp/Rectangle.cs +++ /dev/null @@ -1,41 +0,0 @@ -/* - * 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 ElmSharp -{ - /// - /// The Rectangle is a class that used to draw a solid colored rectangle. - /// - public class Rectangle : EvasObject - { - /// - /// Creates and initializes a new instance of the Rectangle class. - /// - /// The to which the new Slider will be attached as a child. - public Rectangle(EvasObject parent) : base(parent) - { - Interop.Evas.evas_object_size_hint_weight_set(Handle, 1.0, 1.0); - } - - protected override IntPtr CreateHandle(EvasObject parent) - { - IntPtr evas = Interop.Evas.evas_object_evas_get(parent.Handle); - return Interop.Evas.evas_object_rectangle_add(evas); - } - } -} diff --git a/src/ElmSharp/ElmSharp/Scroller.cs b/src/ElmSharp/ElmSharp/Scroller.cs deleted file mode 100755 index 2ceb38c8c..000000000 --- a/src/ElmSharp/ElmSharp/Scroller.cs +++ /dev/null @@ -1,794 +0,0 @@ -/* - * 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 ElmSharp -{ - /// - /// Enumeration for visible type of scrollbar. - /// - public enum ScrollBarVisiblePolicy - { - /// - /// Show scrollbars as needed - /// - Auto = 0, - - /// - /// Always show scrollbars - /// - Visible, - - /// - /// Never show scrollbars - /// - Invisible - } - - /// - /// Enumeration for visible type of scrollbar. - /// - public enum ScrollBlock - { - /// - /// Scrolling movement is allowed in both direction.(X axis and Y axis) - /// - None = 1, - - /// - /// Scrolling movement is not allowed in Y axis direction. - /// - Vertical = 2, - - /// - /// Scrolling movement is not allowed in X axis direction. - /// - Horizontal = 4 - } - - /// - /// Type that controls how the content is scrolled. - /// - public enum ScrollSingleDirection - { - /// - /// Scroll every direction. - /// - None, - - /// - /// Scroll single direction if the direction is certain. - /// - Soft, - - /// - /// Scroll only single direction. - /// - Hard, - } - - /// - /// The Scroller is a container that holds and clips a single object and allows you to scroll across it. - /// - public class Scroller : Layout - { - SmartEvent _scroll; - SmartEvent _dragStart; - SmartEvent _dragStop; - SmartEvent _scrollpage; - - /// - /// Creates and initializes a new instance of the Scroller class. - /// - /// 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"); - } - - /// - /// Scrolled will be triggered when the content has been scrolled. - /// - public event EventHandler Scrolled - { - add - { - _scroll.On += value; - } - remove - { - _scroll.On -= value; - } - } - - /// - /// DragStart will be triggered when dragging the contents around has started. - /// - public event EventHandler DragStart - { - add - { - _dragStart.On += value; - } - remove - { - _dragStart.On -= value; - } - } - - /// - /// DragStop will be triggered when dragging the contents around has stopped. - /// - public event EventHandler DragStop - { - add - { - _dragStop.On += value; - } - remove - { - _dragStop.On -= value; - } - } - - /// - /// PageScrolled will be triggered when the visible page has changed. - /// - public event EventHandler PageScrolled - { - add - { - _scrollpage.On += value; - } - remove - { - _scrollpage.On -= value; - } - } - - /// - /// Gets the current region in the content object that is visible through the Scroller. - /// - public Rect CurrentRegion - { - get - { - int x, y, w, h; - Interop.Elementary.elm_scroller_region_get(RealHandle, out x, out y, out w, out h); - return new Rect(x, y, w, h); - } - } - - /// - /// Sets or gets the value of HorizontalScrollBarVisiblePolicy - /// - /// - /// ScrollBarVisiblePolicy.Auto means the horizontal scrollbar is made visible if it is needed, and otherwise kept hidden. - /// ScrollBarVisiblePolicy.Visible turns it on all the time, and ScrollBarVisiblePolicy.Invisible always keeps it off. - /// - public virtual ScrollBarVisiblePolicy HorizontalScrollBarVisiblePolicy - { - get - { - int policy; - Interop.Elementary.elm_scroller_policy_get(RealHandle, out policy, IntPtr.Zero); - return (ScrollBarVisiblePolicy)policy; - } - set - { - ScrollBarVisiblePolicy v = VerticalScrollBarVisiblePolicy; - Interop.Elementary.elm_scroller_policy_set(RealHandle, (int)value, (int)v); - } - } - - /// - /// Sets or gets the value of VerticalScrollBarVisiblePolicy - /// - /// - /// ScrollBarVisiblePolicy.Auto means the vertical scrollbar is made visible if it is needed, and otherwise kept hidden. - /// ScrollBarVisiblePolicy.Visible turns it on all the time, and ScrollBarVisiblePolicy.Invisible always keeps it off. - /// - public virtual ScrollBarVisiblePolicy VerticalScrollBarVisiblePolicy - { - get - { - int policy; - Interop.Elementary.elm_scroller_policy_get(RealHandle, IntPtr.Zero, out policy); - return (ScrollBarVisiblePolicy)policy; - } - set - { - ScrollBarVisiblePolicy h = HorizontalScrollBarVisiblePolicy; - Interop.Elementary.elm_scroller_policy_set(RealHandle, (int)h, (int)value); - } - } - - /// - /// Sets or gets the value of ScrollBlock. - /// - /// - /// This function will block scrolling movement in a given direction.One can disable movements in the X axis, the Y axis or both. - /// The default value is ScrollBlock.None, where movements are allowed in both directions. - /// - public ScrollBlock ScrollBlock - { - get - { - return (ScrollBlock)Interop.Elementary.elm_scroller_movement_block_get(RealHandle); - } - set - { - Interop.Elementary.elm_scroller_movement_block_set(RealHandle, (int)value); - } - } - - /// - /// Sets or gets scroll current page number. - /// - /// - /// Current page means the page which meets the top of the viewport. - /// If there are two or more pages in the viewport, it returns the number of the page which meets the top of the viewport. - /// The page number starts from 0. 0 is the first page. - /// - public int VerticalPageIndex - { - get - { - int v, h; - Interop.Elementary.elm_scroller_current_page_get(RealHandle, out h, out v); - return v; - } - } - - /// - /// Sets or gets scroll current page number. - /// - /// - /// Current page means the page which meets the left of the viewport. - /// If there are two or more pages in the viewport, it returns the number of the page which meets the left of the viewport. - /// The page number starts from 0. 0 is the first page. - /// - public int HorizontalPageIndex - { - get - { - int v, h; - Interop.Elementary.elm_scroller_current_page_get(RealHandle, out h, out v); - return h; - } - } - - /// - /// Sets or gets the maximum limit of the movable page at vertical direction. - /// - public int VerticalPageScrollLimit - { - get - { - int v, h; - Interop.Elementary.elm_scroller_page_scroll_limit_get(RealHandle, out h, out v); - return v; - } - set - { - int h = HorizontalPageScrollLimit; - Interop.Elementary.elm_scroller_page_scroll_limit_set(RealHandle, h, value); - } - } - - /// - /// Sets or gets the maximum limit of the movable page at horizontal direction. - /// - public int HorizontalPageScrollLimit - { - get - { - int v, h; - Interop.Elementary.elm_scroller_page_scroll_limit_get(RealHandle, out h, out v); - return h; - } - set - { - int v = VerticalPageScrollLimit; - Interop.Elementary.elm_scroller_page_scroll_limit_set(RealHandle, value, v); - } - } - - /// - /// Sets or gets the vertical bounce behaviour. - /// When scrolling, the scroller may "bounce" when reaching an edge of the content object. - /// This is a visual way to indicate the end has been reached. - /// This is enabled by default for both axis. - /// This API will set if it is enabled for the given axis with the boolean parameters for each axis. - /// - public bool VerticalBounce - { - get - { - bool v, h; - Interop.Elementary.elm_scroller_bounce_get(RealHandle, out h, out v); - return v; - } - set - { - bool h = HorizontalBounce; - Interop.Elementary.elm_scroller_bounce_set(RealHandle, h, value); - } - } - - /// - /// Sets or gets the horizontal bounce behaviour. - /// When scrolling, the scroller may "bounce" when reaching an edge of the content object. - /// This is a visual way to indicate the end has been reached. - /// This is enabled by default for both axis. - /// This API will set if it is enabled for the given axis with the boolean parameters for each axis. - /// - public bool HorizontalBounce - { - get - { - bool v, h; - Interop.Elementary.elm_scroller_bounce_get(RealHandle, out h, out v); - return h; - } - set - { - bool v = VerticalBounce; - Interop.Elementary.elm_scroller_bounce_set(RealHandle, value, v); - } - } - - /// - /// Gets the width of the content object of the scroller. - /// - public int ChildWidth - { - get - { - int w, h; - Interop.Elementary.elm_scroller_child_size_get(RealHandle, out w, out h); - return w; - } - } - - /// - /// Gets the height of the content object of the scroller. - /// - public int ChildHeight - { - get - { - int w, h; - Interop.Elementary.elm_scroller_child_size_get(RealHandle, out w, out h); - return h; - } - } - - /// - /// Set scrolling gravity values for a scroller. - /// The gravity, defines how the scroller will adjust its view when the size of the scroller contents increase. - /// The scroller will adjust the view to glue itself as follows. - /// x=0.0, for staying where it is relative to the left edge of the content x=1.0, for staying where it is relative to the rigth edge of the content y=0.0, for staying where it is relative to the top edge of the content y=1.0, for staying where it is relative to the bottom edge of the content - /// Default values for x and y are 0.0 - /// - public double HorizontalGravity - { - get - { - double v, h; - Interop.Elementary.elm_scroller_gravity_get(RealHandle, out h, out v); - return h; - } - set - { - double v = VerticalGravity; - Interop.Elementary.elm_scroller_gravity_set(RealHandle, value, v); - } - } - - /// - /// Set scrolling gravity values for a scroller. - /// The gravity, defines how the scroller will adjust its view when the size of the scroller contents increase. - /// The scroller will adjust the view to glue itself as follows. - /// x=0.0, for staying where it is relative to the left edge of the content x=1.0, for staying where it is relative to the rigth edge of the content y=0.0, for staying where it is relative to the top edge of the content y=1.0, for staying where it is relative to the bottom edge of the content - /// Default values for x and y are 0.0 - /// - public double VerticalGravity - { - get - { - double v, h; - Interop.Elementary.elm_scroller_gravity_get(RealHandle, out h, out v); - return v; - } - set - { - double h = HorizontalGravity; - Interop.Elementary.elm_scroller_gravity_set(RealHandle, h, value); - } - } - - /// - /// Get scroll last page number. - /// The page number starts from 0. 0 is the first page. This returns the last page number among the pages. - /// - public int LastVerticalPageNumber - { - get - { - int v, h; - Interop.Elementary.elm_scroller_last_page_get(RealHandle, out h, out v); - return v; - } - } - - /// - /// Get scroll last page number. - /// The page number starts from 0. 0 is the first page. This returns the last page number among the pages. - /// - public int LastHorizontalPageNumber - { - get - { - int v, h; - Interop.Elementary.elm_scroller_last_page_get(RealHandle, out h, out v); - return h; - } - } - - /// - /// Set an infinite loop_ for a scroller. - /// This function sets the infinite loop vertically. - /// If the content is set, it will be shown repeatedly. - /// - public bool VerticalLoop - { - get - { - bool v, h; - Interop.Elementary.elm_scroller_loop_get(RealHandle, out h, out v); - return v; - } - set - { - bool h = HorizontalLoop; - Interop.Elementary.elm_scroller_loop_set(RealHandle, h, value); - } - } - - /// - /// Set an infinite loop_ for a scroller. - /// This function sets the infinite loop horizontally. - /// If the content is set, it will be shown repeatedly. - /// - public bool HorizontalLoop - { - get - { - bool v, h; - Interop.Elementary.elm_scroller_loop_get(RealHandle, out h, out v); - return h; - } - set - { - bool v = VerticalLoop; - Interop.Elementary.elm_scroller_loop_set(RealHandle, value, v); - } - } - - /// - /// Gets or sets a given scroller widget's scrolling page size, relative to its viewport size. - /// - public double VerticalRelativePageSize - { - get - { - double v, h; - Interop.Elementary.elm_scroller_page_relative_get(RealHandle, out h, out v); - return v; - } - set - { - double h = HorizontalRelativePageSize; - Interop.Elementary.elm_scroller_page_relative_set(RealHandle, h, value); - } - } - - /// - /// Gets or sets a given scroller widget's scrolling page size, relative to its viewport size. - /// - public double HorizontalRelativePageSize - { - get - { - double v, h; - Interop.Elementary.elm_scroller_page_relative_get(RealHandle, out h, out v); - return h; - } - set - { - double v = VerticalRelativePageSize; - Interop.Elementary.elm_scroller_page_relative_set(RealHandle, value, v); - } - } - - /// - /// Gets or Sets the page snapping behavior of a scroller. - /// - /// - /// When scrolling, if a scroller is paged (see VerticalRelativePageSize), - /// the scroller may snap to pages when being scrolled, i.e., even if it had momentum to scroll further, - /// it will stop at the next page boundaries. This is disabled, by default, for both axis. - /// This function will set if it that is enabled or not, for each axis. - /// - public bool VerticalSnap - { - get - { - bool v, h; - Interop.Elementary.elm_scroller_page_snap_get(RealHandle, out h, out v); - return v; - } - set - { - bool h = HorizontalSnap; - Interop.Elementary.elm_scroller_page_snap_set(RealHandle, h, value); - } - } - - /// - /// Gets or Sets the page snapping behavior of a scroller. - /// - /// - /// When scrolling, if a scroller is paged (see HorizontalRelativePageSize), - /// the scroller may snap to pages when being scrolled, i.e., even if it had momentum to scroll further, - /// it will stop at the next page boundaries. This is disabled, by default, for both axis. - /// This function will set if it that is enabled or not, for each axis. - /// - public bool HorizontalSnap - { - get - { - bool v, h; - Interop.Elementary.elm_scroller_page_snap_get(RealHandle, out h, out v); - return h; - } - set - { - bool v = VerticalSnap; - Interop.Elementary.elm_scroller_page_snap_set(RealHandle, value, v); - } - } - - /// - /// Gets or sets the page size to an absolute fixed value, with 0 turning it off for that axis. - /// - public int PageHeight - { - get - { - int w, h; - Interop.Elementary.elm_scroller_page_size_get(RealHandle, out w, out h); - return h; - } - set - { - int w = PageWidth; - Interop.Elementary.elm_scroller_page_size_set(RealHandle, w, value); - } - } - - /// - /// Gets or sets the page size to an absolute fixed value, with 0 turning it off for that axis. - /// - public int PageWidth - { - get - { - int w, h; - Interop.Elementary.elm_scroller_page_size_get(RealHandle, out w, out h); - return w; - } - set - { - int h = PageHeight; - Interop.Elementary.elm_scroller_page_size_set(RealHandle, value, h); - } - } - - /// - /// Gets or sets the event propagation for a scroller. - /// This enables or disables event propagation from the scroller content to the scroller and its parent. - /// By default event propagation is enabled. - /// - public bool ContentPropagateEvents - { - get - { - return Interop.Elementary.elm_scroller_propagate_events_get(RealHandle); - } - set - { - Interop.Elementary.elm_scroller_propagate_events_set(RealHandle, value); - } - } - - /// - /// Gets or sets the step size to move scroller by key event. - /// - public int HorizontalStepSize - { - get - { - int h, v; - Interop.Elementary.elm_scroller_step_size_get(RealHandle, out h, out v); - return h; - } - set - { - int v = VerticalStepSize; - Interop.Elementary.elm_scroller_step_size_set(RealHandle, value, v); - } - } - - /// - /// Gets or sets the step size to move scroller by key event. - /// - public int VerticalStepSize - { - get - { - int h, v; - Interop.Elementary.elm_scroller_step_size_get(RealHandle, out h, out v); - return v; - } - set - { - int h = HorizontalStepSize; - Interop.Elementary.elm_scroller_step_size_set(RealHandle, h, value); - } - } - - /// - /// Gets or sets a value whether mouse wheel is enabled or not over the scroller. - /// - public bool WheelDisabled - { - get - { - return Interop.Elementary.elm_scroller_wheel_disabled_get(RealHandle); - } - set - { - Interop.Elementary.elm_scroller_wheel_disabled_set(RealHandle, value); - } - } - - /// - /// Gets or sets the type of single direction scroll. - /// - public ScrollSingleDirection SingleDirection - { - get - { - return (ScrollSingleDirection)Interop.Elementary.elm_scroller_single_direction_get(RealHandle); - } - set - { - Interop.Elementary.elm_scroller_single_direction_set(RealHandle, (int)value); - } - } - - /// - /// Sets the scroller minimum size limited to the minimum size of the content. - /// By default the scroller will be as small as its design allows, irrespective of its content. - /// This will make the scroller minimum size the right size horizontally and/or vertically to perfectly fit its content in that direction. - /// - /// Enable limiting minimum size horizontally - /// Enable limiting minimum size vertically - public void MinimumLimit(bool horizontal, bool vertical) - { - Interop.Elementary.elm_scroller_content_min_limit(RealHandle, horizontal, vertical); - } - - /// - /// Sets the page size to an absolute fixed value, with 0 turning it off for that axis. - /// - /// The horizontal page size. - /// The vertical page size. - public void SetPageSize(int width, int height) - { - Interop.Elementary.elm_scroller_page_size_set(RealHandle, width, height); - } - - /// - /// Sets the scroll page size relative to the viewport size. - /// - /// - /// The scroller is capable of limiting scrolling by the user to "pages". - /// That is to jump by and only show a "whole page" at a time as if the continuous area of the scroller - /// content is split into page sized pieces. This sets the size of a page relative to the viewport of the scroller. - /// 1.0 is "1 viewport" which is the size (horizontally or vertically). 0.0 turns it off in that axis. - /// This is mutually exclusive with the page size (see elm_scroller_page_size_set() for more information). - /// Likewise 0.5 is "half a viewport". Usable values are normally between 0.0 and 1.0 including 1.0. - /// If you only want 1 axis to be page "limited", use 0.0 for the other axis. - /// - /// The horizontal page relative size. - /// The vertical page relative size. - public void SetPageSize(double width, double height) - { - Interop.Elementary.elm_scroller_page_relative_set(RealHandle, width, height); - } - - /// - /// Shows a specific virtual region within the scroller content object by the page number. - /// (0, 0) of the indicated page is located at the top-left corner of the viewport. - /// - /// The horizontal page number. - /// The vertical page number. - /// True means slider with animation. - public void ScrollTo(int horizontalPageIndex, int verticalPageIndex, bool animated) - { - if (animated) - { - Interop.Elementary.elm_scroller_page_bring_in(RealHandle, horizontalPageIndex, verticalPageIndex); - } - else - { - Interop.Elementary.elm_scroller_page_show(RealHandle, horizontalPageIndex, verticalPageIndex); - } - } - - /// - /// Shows a specific virtual region within the scroller content object. - /// - /// - /// This ensures that all (or part, if it does not fit) of the designated region in the virtual content object ((0, 0) - /// starting at the top-left of the virtual content object) is shown within the scroller. - /// If set "animated" to true, it will allows the scroller to "smoothly slide" to this location - /// (if configuration in general calls for transitions). - /// It may not jump immediately to the new location and may take a while and show other content along the way. - /// - /// Rect struct of region. - /// True means allows the scroller to "smoothly slide" to this location. - public void ScrollTo(Rect region, bool animated) - { - if (animated) - { - Interop.Elementary.elm_scroller_region_bring_in(RealHandle, region.X, region.Y, region.Width, region.Height); - } - else - { - Interop.Elementary.elm_scroller_region_show(RealHandle, region.X, region.Y, region.Width, region.Height); - } - } - - protected override IntPtr CreateHandle(EvasObject parent) - { - IntPtr handle = Interop.Elementary.elm_layout_add(parent.Handle); - Interop.Elementary.elm_layout_theme_set(handle, "layout", "elm_widget", "default"); - - RealHandle = Interop.Elementary.elm_scroller_add(handle); - Interop.Elementary.elm_object_part_content_set(handle, "elm.swallow.content", RealHandle); - - return handle; - } - } -} \ No newline at end of file diff --git a/src/ElmSharp/ElmSharp/Size.cs b/src/ElmSharp/ElmSharp/Size.cs deleted file mode 100755 index c2af5e21a..000000000 --- a/src/ElmSharp/ElmSharp/Size.cs +++ /dev/null @@ -1,99 +0,0 @@ -/* - * 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 ElmSharp -{ - /// - /// The Size is a struct that defining height and width as a pair of generic type. - /// - public struct Size : IEquatable - { - /// - /// Magnitude along the horizontal axis, in platform-defined units. - /// - public int Width; - - /// - /// Magnitude along the vertical axis, in platform-specific units. - /// - public int Height; - - /// - /// Initializes a new instance of the Size structure from the specified dimensions. - /// - /// The width to set - /// The height to set - public Size(int width, int height) - { - Width = width; - Height = height; - } - - /// - /// A human-readable representation of the . - /// - /// The string is formatted as "{{Width={0} Height={1}}}". - public override string ToString() - { - return string.Format("{{Width={0} Height={1}}}", Width, Height); - } - - public override int GetHashCode() - { - unchecked - { - return Width.GetHashCode() ^ (Height.GetHashCode() * 397); - } - } - - public override bool Equals(object obj) - { - if (!(obj is Size)) - return false; - - return Equals((Size)obj); - } - - public bool Equals(Size other) - { - return Width.Equals(other.Width) && Height.Equals(other.Height); - } - - /// - /// Whether the two s are equal. - /// - /// A on the left hand side. - /// A on the right hand side. - /// True if the two s have equal values. - public static bool operator ==(Size s1, Size s2) - { - return s1.Equals(s2); - } - - /// - /// Whether two s are not equal. - /// - /// A on the left hand side. - /// A on the right hand side. - /// True if the two s do not have equal values. - public static bool operator !=(Size s1, Size s2) - { - return !s1.Equals(s2); - } - } -} diff --git a/src/ElmSharp/ElmSharp/Slider.cs b/src/ElmSharp/ElmSharp/Slider.cs deleted file mode 100755 index 41fb50768..000000000 --- a/src/ElmSharp/ElmSharp/Slider.cs +++ /dev/null @@ -1,328 +0,0 @@ -/* - * 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 ElmSharp -{ - /// - /// Enumeration for the Slider's indicator visiblity mode. - /// - public enum SliderIndicatorVisibleMode - { - /// - /// Show indicator on mouse down or change in slider value. - /// - Default, - - /// - /// Always show the indicator. - /// - Always, - - /// - /// Show the indicator on focus. - /// - OnFocus, - - /// - /// Never show the indicator. - /// - None, - } - - /// - /// The Slider is a widget that adds a draggable slider widget for selecting the value of something within a range. - /// - public class Slider : Layout - { - double _minimum = 0.0; - double _maximum = 1.0; - - SmartEvent _changed; - SmartEvent _delayedChanged; - SmartEvent _dragStarted; - SmartEvent _dragStopped; - - /// - /// Creates and initializes a new instance of the Slider class. - /// - /// The to which the new Slider will be attached as a child. - public Slider(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); - - _dragStarted = new SmartEvent(this, this.RealHandle, "slider,drag,start"); - _dragStarted.On += (s, e) => DragStarted?.Invoke(this, EventArgs.Empty); - - _dragStopped = new SmartEvent(this, this.RealHandle, "slider,drag,stop"); - _dragStopped.On += (s, e) => DragStopped?.Invoke(this, EventArgs.Empty); - } - - /// - /// ValueChanged will be triggered when the Slider value is changed by the user. - /// - public event EventHandler ValueChanged; - - /// - /// DelayedValueChanged will be triggered when a short time after the value is changed by the user. - /// This will be called only when the user stops dragging for a very short period or when they release their finger/mouse, - /// so it avoids possibly expensive reactions to the value change. - /// - public event EventHandler DelayedValueChanged; - - /// - /// DragStarted will be triggered when dragging the Slider indicator around has started. - /// - public event EventHandler DragStarted; - - /// - /// DragStopped will be triggered when dragging the Slider indicator around has stopped. - /// - public event EventHandler DragStopped; - - /// - /// Sets or gets the (exact) length of the bar region of a given Slider widget. - /// - /// - /// This sets the minimum width (when in the horizontal mode) or height (when in the vertical mode) - /// of the actual bar area of the slider obj. This in turn affects the object's minimum size. - /// Use this when you're not setting other size hints expanding on the given direction - /// (like weight and alignment hints), and you would like it to have a specific size. - /// - public int SpanSize - { - get - { - return Interop.Elementary.elm_slider_span_size_get(RealHandle); - } - set - { - Interop.Elementary.elm_slider_span_size_set(RealHandle, value); - } - } - - /// - /// Sets or gets the format string for the indicator label. - /// - /// - /// The slider may display its value somewhere other than the unit label, - /// for example, above the slider knob that is dragged around. This function sets the format string - /// used for this.If NULL, the indicator label won't be visible. If not, it sets the format string - /// for the label text. For the label text floating point value is provided, so the label text can - /// display up to 1 floating point value. Note that this is optional.Use a format string - /// such as "%1.2f meters" for example, and it displays values like: "3.14 meters" for a value - /// equal to 3.14159.By default, the indicator label is disabled. - /// - public string IndicatorFormat - { - get - { - return Interop.Elementary.elm_slider_indicator_format_get(RealHandle); - } - set - { - Interop.Elementary.elm_slider_indicator_format_set(RealHandle, value); - } - } - - /// - /// Sets or gets the orientation of a given slider widget. - /// - /// - /// The orientation may be vertically or horizontally.By default, it's displayed horizontally. - /// - public bool IsHorizontal - { - get - { - return Interop.Elementary.elm_slider_horizontal_get(RealHandle); - } - set - { - Interop.Elementary.elm_slider_horizontal_set(RealHandle, value); - } - } - - /// - /// Sets or gets the minimum values for the slider. - /// - /// - /// This defines the allowed minimum values to be selected by the user. - /// If the actual value is less than min, it is updated to min. - /// Actual value can be obtained with Value.By default, min is equal to 0.0. - /// - public double Minimum - { - get - { - return _minimum; - } - set - { - _minimum = value; - Interop.Elementary.elm_slider_min_max_set(RealHandle, _minimum, _maximum); - } - } - - /// - /// Sets or gets the maximum values for the slider. - /// - /// - /// This defines the allowed maximum values to be selected by the user. - /// If the actual value is bigger then max, it is updated to max. - /// Actual value can be obtained with Value.By default, min is equal to 0.0, and max is equal to 1.0. - /// Maximum must be greater than minimum, otherwise the behavior is undefined. - /// - public double Maximum - { - get - { - return _maximum; - } - set - { - _maximum = value; - Interop.Elementary.elm_slider_min_max_set(RealHandle, _minimum, _maximum); - } - } - - /// - /// Gets or sets the value displayed by the slider. - /// - /// - /// Value will be presented on the unit label following format specified with UnitFormat and - /// on indicator with IndicatorFormat.The value must to be between Minimum and Maximum values. - /// - public double Value - { - get - { - return Interop.Elementary.elm_slider_value_get(RealHandle); - } - set - { - Interop.Elementary.elm_slider_value_set(RealHandle, value); - } - } - - /// - /// Sets or gets the step by which the slider indicator moves. - /// - /// - /// This value is used when the draggable object is moved automatically i.e., - /// in case of a key event when up/down/left/right key is pressed or in case accessibility - /// is set and the flick event is used to inc/dec slider values. - /// By default, the step value is equal to 0.05. - /// - public double Step - { - get - { - return Interop.Elementary.elm_slider_step_get(RealHandle); - } - set - { - Interop.Elementary.elm_slider_step_set(RealHandle, value); - } - } - - /// - /// Gets or sets whether a given slider widget's displaying values are inverted. - /// - /// - /// A slider may be inverted, in which case it gets its values inverted, - /// with high values being on the left or top and low values on the right or bottom, - /// as opposed to normally have the low values on the former and high values on the latter, - /// respectively, for the horizontal and vertical modes. - /// - public bool IsInverted - { - get - { - return Interop.Elementary.elm_slider_inverted_get(RealHandle); - } - set - { - Interop.Elementary.elm_slider_inverted_set(RealHandle, value); - } - } - - /// - /// Sets or gets whether to enlarge the slider indicator (augmented knob). - /// - /// - /// By default, the indicator is bigger when dragged by the user. - /// It won't display values set with IndicatorFormat if you disable the indicator. - /// - public bool IsIndicatorVisible - { - get - { - return Interop.Elementary.elm_slider_indicator_show_get(RealHandle); - } - set - { - Interop.Elementary.elm_slider_indicator_show_set(RealHandle, value); - } - } - - /// - /// Sets or gets the visible mode of slider indicator. - /// - public SliderIndicatorVisibleMode IndicatorVisibleMode - { - get - { - return (SliderIndicatorVisibleMode)Interop.Elementary.elm_slider_indicator_visible_mode_get(RealHandle); - } - set - { - Interop.Elementary.elm_slider_indicator_visible_mode_set(RealHandle, (int)value); - } - } - - /// - /// Sets or gets whether to Show the indicator of slider on focus. - /// - public bool IsIndicatorFocusable - { - get - { - return Interop.Elementary.elm_slider_indicator_show_on_focus_get(RealHandle); - } - set - { - Interop.Elementary.elm_slider_indicator_show_on_focus_set(RealHandle, value); - } - } - - protected override IntPtr CreateHandle(EvasObject parent) - { - IntPtr handle = Interop.Elementary.elm_layout_add(parent.Handle); - Interop.Elementary.elm_layout_theme_set(handle, "layout", "elm_widget", "default"); - - RealHandle = Interop.Elementary.elm_slider_add(handle); - Interop.Elementary.elm_object_part_content_set(handle, "elm.swallow.content", RealHandle); - - return handle; - } - } -} \ No newline at end of file diff --git a/src/ElmSharp/ElmSharp/SmartEvent.cs b/src/ElmSharp/ElmSharp/SmartEvent.cs deleted file mode 100644 index f413f825d..000000000 --- a/src/ElmSharp/ElmSharp/SmartEvent.cs +++ /dev/null @@ -1,241 +0,0 @@ -/* - * 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.ComponentModel; -using System.Collections.Generic; -using System.Linq; - -namespace ElmSharp -{ - /// - /// It inherits . - /// The event with TEventArgs for . - /// EvasObject can elect SmartEvent occurring inside of them to be reported back to their users via delegates. - /// This way, you can extend EvasObject's own . - /// They are defined by an event string, which identifies them uniquely. - /// - /// The parameter for the event. - public class SmartEvent : IInvalidatable where TEventArgs : EventArgs - { - /// - /// The delegate for creating smart event item args. - /// - /// The item data. - /// The sender obj. - /// The item sender obj. - /// Return smart event item args. - public delegate TEventArgs SmartEventInfoParser(IntPtr data, IntPtr obj, IntPtr info); - - private EvasObject _sender; - private readonly string _eventName; - private IntPtr _handle; - private readonly SmartEventInfoParser _parser; - private readonly List _nativeCallbacks = new List(); - - /// - /// Creates and initializes a new instance of the SmartEvent class. - /// - /// The source of the event. - /// The event name. - /// The event parameter. - public SmartEvent(EvasObject sender, string eventName, SmartEventInfoParser parser) : this(sender, sender.Handle, eventName, parser) - { - } - - [EditorBrowsableAttribute(EditorBrowsableState.Never)] - public SmartEvent(EvasObject sender, IntPtr handle, string eventName, SmartEventInfoParser parser) - { - _sender = sender; - _eventName = eventName; - _handle = handle; - _parser = parser; - sender.AddToEventLifeTracker(this); - } - - /// - /// Creates and initializes a new instance of the SmartEvent class. - /// - /// The source of the event. - /// The event name. - public SmartEvent(EvasObject sender, string eventName) : this(sender, eventName, null) - { - } - - ~SmartEvent() - { - Dispose(false); - } - - private struct NativeCallback - { - public Interop.Evas.SmartCallback callback; - public EventHandler eventHandler; - } - - /// - /// Adds or removes delegate for event. - /// - public event EventHandler On - { - add - { - if (_handle == IntPtr.Zero) - { - return; - } - EventHandler handler = value; - var cb = new Interop.Evas.SmartCallback((d, o, e) => - { - TEventArgs ea = _parser == null ? (TEventArgs)EventArgs.Empty : _parser(d, o, e); - handler(_sender, ea); - }); - _nativeCallbacks.Add(new NativeCallback { callback = cb, eventHandler = handler }); - int i = _nativeCallbacks.Count - 1; - Interop.Evas.evas_object_smart_callback_add(_handle, _eventName, _nativeCallbacks[i].callback, IntPtr.Zero); - } - - remove - { - if (_handle == IntPtr.Zero) - { - return; - } - EventHandler handler = value; - var callbacks = _nativeCallbacks.Where(cb => cb.eventHandler == handler); - foreach (var cb in callbacks) - { - Interop.Evas.evas_object_smart_callback_del(_handle, _eventName, cb.callback); - } - } - } - - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - - /// - /// Make current instance invalidate. - /// - public void MakeInvalidate() - { - _sender = null; - _handle = IntPtr.Zero; - } - - protected virtual void Dispose(bool disposing) - { - if (disposing) - { - // Place holder to dispose managed state (managed objects). - } - if (_handle != IntPtr.Zero) - { - foreach (var cb in _nativeCallbacks) - { - Interop.Evas.evas_object_smart_callback_del(_handle, _eventName, cb.callback); - } - } - _nativeCallbacks.Clear(); - } - } - - /// - /// It inherits . - /// EvasObject can elect SmartEvent occurring inside of them to be reported back to their users via delegates. - /// This way, you can extend EvasObject's own . - /// They are defined by an event string, which identifies them uniquely. - /// - public class SmartEvent : IInvalidatable - { - private SmartEvent _smartEvent; - private event EventHandler _handlers; - - /// - /// Creates and initializes a new instance of the SmartEvent class. - /// - /// The source of the event. - /// The event name. - public SmartEvent(EvasObject sender, string eventName) : this(sender, sender.RealHandle, eventName) - { - } - - [EditorBrowsableAttribute(EditorBrowsableState.Never)] - public SmartEvent(EvasObject sender, IntPtr handle, string eventName) - { - _smartEvent = new SmartEvent(sender, handle, eventName, null); - } - - ~SmartEvent() - { - Dispose(false); - } - - /// - /// Adds or removes delegate for event. - /// - public event EventHandler On - { - add - { - if (_handlers == null) - { - _smartEvent.On += SendEvent; - } - _handlers += value; - } - - remove - { - _handlers -= value; - if (_handlers == null) - { - _smartEvent.On -= SendEvent; - } - } - } - - private void SendEvent(object sender, EventArgs e) - { - _handlers?.Invoke(sender, e); - } - - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - - /// - /// Make current instance invalidate. - /// - public void MakeInvalidate() - { - _smartEvent.MakeInvalidate(); - } - - protected virtual void Dispose(bool disposing) - { - if (disposing) - { - // Place holder to dispose managed state (managed objects). - _smartEvent.Dispose(); - } - } - } -} diff --git a/src/ElmSharp/ElmSharp/Spinner.cs b/src/ElmSharp/ElmSharp/Spinner.cs deleted file mode 100755 index e6a12e656..000000000 --- a/src/ElmSharp/ElmSharp/Spinner.cs +++ /dev/null @@ -1,254 +0,0 @@ -/* - * 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 ElmSharp -{ - /// - /// The Spinner is a widget that increase or decrease numeric values using arrow buttons, or edit values directly. - /// Inherits . - /// - public class Spinner : Layout - { - double _minimum = 0.0; - double _maximum = 100.0; - - SmartEvent _changed; - SmartEvent _delayedChanged; - - /// - /// Creates and initializes a new instance of the Spinner class. - /// - /// 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); - } - - /// - /// ValueChanged will be triggered whenever the spinner value is changed. - /// - public event EventHandler ValueChanged; - - /// - /// DelayedValueChanged will be triggered after a short time when the value is changed. - /// - public event EventHandler DelayedValueChanged; - - /// - /// Sets or gets the label format of the spinner. - /// - public string LabelFormat - { - get - { - return Interop.Elementary.elm_spinner_label_format_get(RealHandle); - } - set - { - Interop.Elementary.elm_spinner_label_format_set(RealHandle, value); - } - } - - /// - /// Sets or gets the minimum value for the spinner. - /// - public double Minimum - { - get - { - return _minimum; - } - set - { - _minimum = value; - Interop.Elementary.elm_spinner_min_max_set(RealHandle, _minimum, _maximum); - } - } - - /// - /// Sets or gets the maximum value for the spinner. - /// - public double Maximum - { - get - { - return _maximum; - } - set - { - _maximum = value; - Interop.Elementary.elm_spinner_min_max_set(RealHandle, _minimum, _maximum); - } - } - - /// - /// Sets or gets the step that used to increment or decrement the spinner value. - /// - public double Step - { - get - { - return Interop.Elementary.elm_spinner_step_get(RealHandle); - } - set - { - Interop.Elementary.elm_spinner_step_set(RealHandle, value); - } - } - - /// - /// Sets or gets the value displayed by the spinner. - /// - public double Value - { - get - { - return Interop.Elementary.elm_spinner_value_get(RealHandle); - } - set - { - Interop.Elementary.elm_spinner_value_set(RealHandle, value); - } - } - - /// - /// Sets or gets the interval on time updates for an user mouse button hold on spinner widgets' arrows. - /// - public double Interval - { - get - { - return Interop.Elementary.elm_spinner_interval_get(RealHandle); - } - set - { - Interop.Elementary.elm_spinner_interval_set(RealHandle, value); - } - } - - /// - /// Sets or gets the base for rounding. - /// - public double RoundBase - { - get - { - return Interop.Elementary.elm_spinner_base_get(RealHandle); - } - set - { - Interop.Elementary.elm_spinner_base_set(RealHandle, value); - } - } - - /// - /// Sets or gets the round value for rounding. - /// - public int RoundValue - { - get - { - return Interop.Elementary.elm_spinner_round_get(RealHandle); - } - set - { - Interop.Elementary.elm_spinner_round_set(RealHandle, value); - } - } - - /// - /// Sets or gets the wrap of a given spinner widget. - /// - /// - /// If wrap is disabled, when the user tries to increment the value, but displayed value plus step value is bigger than maximum value, the new value will be the maximum value. - /// If wrap is enabled, when the user tries to increment the value, but displayed value plus step value is bigger than maximum value, the new value will be the minimum value. - /// By default it's disabled. - /// - public bool IsWrapEnabled - { - get - { - return Interop.Elementary.elm_spinner_wrap_get(RealHandle); - } - set - { - Interop.Elementary.elm_spinner_wrap_set(RealHandle, value); - } - } - - /// - /// Sets or gets whether the spinner can be directly edited by the user or not. - /// - /// By default it is enabled - public bool IsEditable - { - get - { - return Interop.Elementary.elm_spinner_editable_get(RealHandle); - } - set - { - Interop.Elementary.elm_spinner_editable_set(RealHandle, value); - } - } - - /// - /// Set a special string to display in the place of the numerical value. - /// - /// The numerical value to be replaced - /// The label to be used - public void AddSpecialValue(double value, string label) - { - Interop.Elementary.elm_spinner_special_value_add(RealHandle, value, label); - } - - /// - /// Remove a previously added special value, After this, the spinner will display the value itself instead of a label. - /// - /// The replaced numerical value - public void RemoveSpecialValue(double value) - { - Interop.Elementary.elm_spinner_special_value_del(RealHandle, value); - } - - /// - /// Get the special string display in the place of the numerical value. - /// - /// The replaced numerical value. - /// The value of the spinner which replaced numerical value with special string - public string GetSpecialValue(double value) - { - return Interop.Elementary.elm_spinner_special_value_get(RealHandle, value); - } - - protected override IntPtr CreateHandle(EvasObject parent) - { - IntPtr handle = Interop.Elementary.elm_layout_add(parent.Handle); - Interop.Elementary.elm_layout_theme_set(handle, "layout", "elm_widget", "default"); - - RealHandle = Interop.Elementary.elm_spinner_add(handle); - Interop.Elementary.elm_object_part_content_set(handle, "elm.swallow.content", RealHandle); - - return handle; - } - } -} diff --git a/src/ElmSharp/ElmSharp/Table.cs b/src/ElmSharp/ElmSharp/Table.cs deleted file mode 100755 index 707a34b3e..000000000 --- a/src/ElmSharp/ElmSharp/Table.cs +++ /dev/null @@ -1,160 +0,0 @@ -/* - * 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 ElmSharp -{ - /// - /// The Table is a container widget to arrange other widgets in a table where items can span multiple columns or rows . - /// Inherits . - /// - public class Table : Container - { - int _paddingX = 0; - int _paddingY = 0; - - /// - /// Creates and initializes a new instance of the Table class. - /// - /// - /// A to which the new Table instance will be attached. - /// - public Table(EvasObject parent) : base(parent) - { - } - - /// - /// Sets or gets whether the layout of this table is homogeneous. - /// - /// True for homogeneous, False for no homogeneous - public bool Homogeneous - { - get - { - return Interop.Elementary.elm_table_homogeneous_get(RealHandle); - } - set - { - Interop.Elementary.elm_table_homogeneous_set(RealHandle, value); - } - } - - /// - /// Sets or gets the horizontal padding between the cells. - /// - public int PaddingX - { - get - { - return _paddingX; - } - set - { - _paddingX = value; - Interop.Elementary.elm_table_padding_set(RealHandle, _paddingX, _paddingY); - } - } - - /// - /// Sets or gets the vertical padding between the cells. - /// - public int PaddingY - { - get - { - return _paddingY; - } - set - { - _paddingY = value; - Interop.Elementary.elm_table_padding_set(RealHandle, _paddingX, _paddingY); - } - } - /// - /// Adds a subobject on the table with the coordinates passed. - /// - /// The subobject to be added to the table - /// The column number - /// The row number - /// The column span - /// The row span - public void Pack(EvasObject obj, int col, int row, int colspan, int rowspan) - { - if (obj == null) - throw new ArgumentNullException("obj"); - Interop.Elementary.elm_table_pack(RealHandle, obj, col, row, colspan, rowspan); - AddChild(obj); - } - - /// - /// Removes the child from the table. - /// - /// The subobject - public void Unpack(EvasObject obj) - { - if (obj == null) - throw new ArgumentNullException("obj"); - Interop.Elementary.elm_table_unpack(RealHandle, obj); - RemoveChild(obj); - } - - /// - /// Removes all child objects from a table object. - /// - public void Clear() - { - Interop.Elementary.elm_table_clear(RealHandle, false); - ClearChildren(); - } - - /// - /// Sets the color for particular part of the table. - /// - /// The name of part class - /// The color - public override void SetPartColor(string part, Color color) - { - Interop.Elementary.elm_object_color_class_color_set(Handle, part, color.R * color.A / 255, - color.G * color.A / 255, - color.B * color.A / 255, - color.A); - } - - /// - /// Gets the color of particular part of the table. - /// - /// The name of part class, it could be 'bg', 'elm.swllow.content' - /// The color of the particular part - public override Color GetPartColor(string part) - { - int r, g, b, a; - Interop.Elementary.elm_object_color_class_color_get(Handle, part, out r, out g, out b, out a); - return new Color((int)(r / (a / 255.0)), (int)(g / (a / 255.0)), (int)(b / (a / 255.0)), a); - } - - protected override IntPtr CreateHandle(EvasObject parent) - { - IntPtr handle = Interop.Elementary.elm_layout_add(parent); - Interop.Elementary.elm_layout_theme_set(handle, "layout", "background", "default"); - - RealHandle = Interop.Elementary.elm_table_add(handle); - Interop.Elementary.elm_object_part_content_set(handle, "elm.swallow.content", RealHandle); - - return handle; - } - } -} diff --git a/src/ElmSharp/ElmSharp/Toolbar.cs b/src/ElmSharp/ElmSharp/Toolbar.cs deleted file mode 100644 index 644a43cef..000000000 --- a/src/ElmSharp/ElmSharp/Toolbar.cs +++ /dev/null @@ -1,462 +0,0 @@ -/* - * 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.ComponentModel; - -namespace ElmSharp -{ - /// - /// Enumeration for the selection mode of Toolbar. - /// - public enum ToolbarSelectionMode - { - /// - /// Default select mode. - /// - Default = 0, - - /// - /// Always select mode. - /// - Always, - - /// - /// No select mode. - /// - None, - - /// - /// No select mode with no finger size rule. - /// - DisplayOnly, - } - - /// - /// Enumeration that sets the toolbar items display behavior, it can be scrollable, can show a menu with exceeding items, or simply hide them. - /// - public enum ToolbarShrinkMode - { - /// - /// Sets minimum toolbar size to fit all the items. - /// - None = 0, - - /// - /// Hides exceeding items. - /// - Hide, - - /// - /// Allows accessing exceeding items through a scroller. - /// - Scroll, - - /// - /// Inserts a button to pop up a menu with exceeding items. - /// - Menu, - - /// - /// Expands all items according to the size of the toolbar. - /// - Expand - } - - /// - /// Enumeration for the icon lookup order of Toolbar. - /// - public enum ToolbarIconLookupOrder - { - /// - /// Icon look up order: freedesktop, theme. - /// - FreedesktopTheme, - - /// - /// Icon look up order: theme, freedesktop. - /// - ThemeFreedesktop, - - /// - /// Icon look up order: freedesktop. - /// - Freedesktop, - - /// - /// Icon look up order: theme. - /// - Theme, - } - - /// - /// Event arguments for events of . - /// - /// - /// Inherits EventArgs. - /// - public class ToolbarItemEventArgs : EventArgs - { - /// - /// Gets the ToolbarItem. - /// - public ToolbarItem Item { get; private set; } - - internal static ToolbarItemEventArgs CreateFromSmartEvent(IntPtr data, IntPtr obj, IntPtr info) - { - ToolbarItem item = ItemObject.GetItemByHandle(info) as ToolbarItem; - return new ToolbarItemEventArgs() { Item = item }; - } - } - - /// - /// The Toolbar is a widget that displays a list of items inside a box. - /// - public class Toolbar : Widget - { - SmartEvent _clicked; - SmartEvent _selected; - SmartEvent _longpressed; - - /// - /// Creates and initializes a new instance of the Toolbar class. - /// - /// - /// A EvasObject to which the new Table instance will be attached. - /// - public Toolbar(EvasObject parent) : base(parent) - { - _selected = new SmartEvent(this, this.RealHandle, "selected", ToolbarItemEventArgs.CreateFromSmartEvent); - _selected.On += (s, e) => - { - if (e.Item != null) - { - Selected?.Invoke(this, e); - e.Item.SendSelected(); - } - }; - _longpressed = new SmartEvent(this, this.RealHandle, "longpressed", ToolbarItemEventArgs.CreateFromSmartEvent); - _longpressed.On += (s, e) => - { - e.Item?.SendLongPressed(); - }; - _clicked = new SmartEvent(this, this.RealHandle, "clicked", ToolbarItemEventArgs.CreateFromSmartEvent); - _clicked.On += (s, e) => - { - e.Item?.SendClicked(); - }; - } - - /// - /// Selected will be triggered when toolbar have been selected. - /// - public event EventHandler Selected; - - /// - /// Sets or gets whether the layout of this toolbar is homogeneous. - /// - /// True for homogeneous, False for no homogeneous - public bool Homogeneous - { - get - { - return Interop.Elementary.elm_toolbar_homogeneous_get(RealHandle); - } - set - { - Interop.Elementary.elm_toolbar_homogeneous_set(RealHandle, value); - } - } - - /// - /// Sets or gets the slection mode of a given Toolbar widget. - /// - public ToolbarSelectionMode SelectionMode - { - get - { - return (ToolbarSelectionMode)Interop.Elementary.elm_toolbar_select_mode_get(RealHandle); - } - set - { - Interop.Elementary.elm_toolbar_select_mode_set(RealHandle, (int)value); - } - } - - /// - /// Sets or gets the shrink mode of a given Toolbar widget. - /// - public ToolbarShrinkMode ShrinkMode - { - get - { - return (ToolbarShrinkMode)Interop.Elementary.elm_toolbar_shrink_mode_get(RealHandle); - } - set - { - Interop.Elementary.elm_toolbar_shrink_mode_set(RealHandle, (int)value); - } - } - - [EditorBrowsable(EditorBrowsableState.Never)] - public bool IsHorizontal - { - get - { - return Interop.Elementary.elm_toolbar_horizontal_get(RealHandle); - } - set - { - Interop.Elementary.elm_toolbar_horizontal_set(RealHandle, value); - } - } - - /// - /// Sets or gets the icon lookup order, for toolbar items' icons. - /// The default lookup order is ToolbarIocnLookupOrder.ThemeFreedesktop. - /// Icons added before calling this function will not be affected. - /// - public ToolbarIconLookupOrder IconLookupOrder - { - get - { - return (ToolbarIconLookupOrder)Interop.Elementary.elm_toolbar_icon_order_lookup_get(RealHandle); - } - set - { - Interop.Elementary.elm_toolbar_icon_order_lookup_set(RealHandle, (int)value); - } - } - - /// - /// Sets or gets the icon size of a given toolbar widget. - /// Default value is 32 pixels, to be used by toolbar items. - /// - public int IconSize - { - get - { - return Interop.Elementary.elm_toolbar_icon_size_get(RealHandle); - } - set - { - Interop.Elementary.elm_toolbar_icon_size_set(RealHandle, value); - } - } - - /// - /// Gets the number of items in a toolbar widget. - /// - public int ItemsCount - { - get - { - return Interop.Elementary.elm_toolbar_items_count(RealHandle); - } - } - - /// - /// Sets or gets the alignment of the items. - /// - /// The toolbar items alignment, a float between 0.0 and 1.0 - public double ItemAlignment - { - get - { - return Interop.Elementary.elm_toolbar_align_get(RealHandle); - } - set - { - Interop.Elementary.elm_toolbar_align_set(RealHandle, value); - } - } - - /// - /// Sets or gets the item's transverse expansion of a given toolbar widget. - /// - /// - /// The transverse expansion of the item, true for on and false for off. - /// By default it's false. - /// - public bool TransverseExpansion - { - get - { - return Interop.Elementary.elm_toolbar_transverse_expanded_get(RealHandle); - } - set - { - Interop.Elementary.elm_toolbar_transverse_expanded_set(RealHandle, value); - } - } - - /// - /// Appends ToolbarItem which just contains label to the toolbar. - /// - /// The label of the item - /// The new ToolbarItem which appended to the toolbar - /// - /// - public ToolbarItem Append(string label) - { - return Append(label, null); - } - - /// - /// Appends ToolbarItem which contains label and icon to the toolbar. - /// - /// The label of the item - /// A string with the icon name or the absolute path of an image file - /// The new ToolbarItem which appended to the toolbar - /// - /// - /// - public ToolbarItem Append(string label, string icon) - { - ToolbarItem item = new ToolbarItem(label, icon); - item.Handle = Interop.Elementary.elm_toolbar_item_append(RealHandle, icon, label, null, (IntPtr)item.Id); - return item; - } - - /// - /// Prepends ToolbarItem which just contains label to the toolbar. - /// - /// The label of the item - /// The new ToolbarItem which prepended to the toolbar - /// - /// - /// - public ToolbarItem Prepend(string label) - { - return Prepend(label, null); - } - - /// - /// Prepends ToolbarItem which contains label and icon to the toolbar. - /// - /// The label of the item - /// A string with the icon name or the absolute path of an image file - /// The new which prepended to the toolbar - /// - /// - /// - public ToolbarItem Prepend(string label, string icon) - { - ToolbarItem item = new ToolbarItem(label, icon); - item.Handle = Interop.Elementary.elm_toolbar_item_prepend(RealHandle, icon, label, null, (IntPtr)item.Id); - return item; - } - - /// - /// Inserts a new item which just contains label into the toolbar object before item . - /// - /// The toolbar item to insert before - /// The label of the item - /// The new which insert into the toolbar - /// - public ToolbarItem InsertBefore(ToolbarItem before, string label) - { - return InsertBefore(before, label, string.Empty); - } - - /// - /// Inserts a new item which contains label and icon into the toolbar object before item . - /// - /// The toolbar item to insert before - /// The label of the item - /// A string with the icon name or the absolute path of an image file - /// The new which insert into the toolbar - /// - public ToolbarItem InsertBefore(ToolbarItem before, string label, string icon) - { - ToolbarItem item = new ToolbarItem(label, icon); - item.Handle = Interop.Elementary.elm_toolbar_item_insert_before(RealHandle, before, icon, label, null, (IntPtr)item.Id); - return item; - } - - /// - /// Inserts a new item which contains label and icon into the toolbar object after item . - /// - /// The toolbar item to insert after - /// The label of the item - /// A string with the icon name or the absolute path of an image file - /// The new which insert into the toolbar - public ToolbarItem InsertAfter(ToolbarItem after, string label, string icon) - { - ToolbarItem item = new ToolbarItem(label, icon); - item.Handle = Interop.Elementary.elm_toolbar_item_insert_after(RealHandle, after, icon, label, null, (IntPtr)item.Id); - return item; - } - - /// - /// Find the item with that label in the toolbar. - /// - /// The label of the item - /// The into the toolbar - public ToolbarItem FindItemByLabel(string label) - { - IntPtr handle = Interop.Elementary.elm_toolbar_item_find_by_label(RealHandle, label); - return ItemObject.GetItemByHandle(handle) as ToolbarItem; - } - - /// - /// Gets the selected ToolbarItemItem of the toolbar. - /// - public ToolbarItem SelectedItem - { - get - { - IntPtr handle = Interop.Elementary.elm_toolbar_selected_item_get(RealHandle); - return ItemObject.GetItemByHandle(handle) as ToolbarItem; - } - } - - /// - /// Gets the first ToolbarItemItem of the toolbar. - /// - public ToolbarItem FirstItem - { - get - { - IntPtr handle = Interop.Elementary.elm_toolbar_first_item_get(RealHandle); - return ItemObject.GetItemByHandle(handle) as ToolbarItem; - } - } - - /// - /// Gets the last ToolbarItemItem of the toolbar. - /// - public ToolbarItem LastItem - { - get - { - IntPtr handle = Interop.Elementary.elm_toolbar_last_item_get(RealHandle); - return ItemObject.GetItemByHandle(handle) as ToolbarItem; - } - } - - protected override IntPtr CreateHandle(EvasObject parent) - { - IntPtr handle = Interop.Elementary.elm_layout_add(parent.Handle); - Interop.Elementary.elm_layout_theme_set(handle, "layout", "elm_widget", "default"); - - RealHandle = Interop.Elementary.elm_toolbar_add(handle); - Interop.Elementary.elm_object_part_content_set(handle, "elm.swallow.content", RealHandle); - - return handle; - } - } -} \ No newline at end of file diff --git a/src/ElmSharp/ElmSharp/ToolbarItem.cs b/src/ElmSharp/ElmSharp/ToolbarItem.cs deleted file mode 100755 index 072baab7e..000000000 --- a/src/ElmSharp/ElmSharp/ToolbarItem.cs +++ /dev/null @@ -1,141 +0,0 @@ -/* - * 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 ElmSharp -{ - /// - /// The ToolbarItem is a item of Toolbar. - /// - public class ToolbarItem : ItemObject - { - string _icon; - string _text; - internal ToolbarItem(string text, string icon) : base(IntPtr.Zero) - { - _text = text; - _icon = icon; - } - - /// - /// Sets or gets the icon path of the item. - /// - public string Icon - { - get - { - return _icon; - } - set - { - _icon = value; - Interop.Elementary.elm_toolbar_item_icon_set(Handle, value); - } - } - - /// - /// Sets or gets the text string of the item. - /// - public string Text - { - get - { - return _text; - } - set - { - _text = value; - SetPartText(null, value); - } - } - - /// - /// Sets or gets the enable of the item. - /// - [Obsolete("Enabled is obsolete as of version v1.1.0-beta-023. Please use IsEnabled instead.")] - public bool Enabled - { - get - { - return IsEnabled; - } - set - { - IsEnabled = value; - } - } - - /// - /// Sets or gets whether displaying the item as a separator. - /// - /// Items aren't set as a separator by default. If set as a separator it displays a separator theme, so it won't display icons or labels. - public bool IsSeparator - { - get - { - return Interop.Elementary.elm_toolbar_item_separator_get(Handle); - } - set - { - Interop.Elementary.elm_toolbar_item_separator_set(Handle, value); - } - } - - /// - /// Sets or gets whether the item is selected. - /// - public bool IsSelected - { - get - { - return Interop.Elementary.elm_toolbar_item_selected_get(Handle); - } - set - { - Interop.Elementary.elm_toolbar_item_selected_set(Handle, value); - } - } - - /// - /// Selected will be triggered when the item is selected. - /// - public event EventHandler Selected; - - /// - /// LongPressed will be triggered when the item is pressed long time. - /// - public event EventHandler LongPressed; - - /// - /// Clicked will be triggered when the item is clicked. - /// - public event EventHandler Clicked; - - internal void SendSelected() - { - Selected?.Invoke(this, EventArgs.Empty); - } - internal void SendLongPressed() - { - LongPressed?.Invoke(this, EventArgs.Empty); - } - internal void SendClicked() - { - Clicked?.Invoke(this, EventArgs.Empty); - } - } -} diff --git a/src/ElmSharp/ElmSharp/Transit.cs b/src/ElmSharp/ElmSharp/Transit.cs deleted file mode 100755 index 8ee276a5e..000000000 --- a/src/ElmSharp/ElmSharp/Transit.cs +++ /dev/null @@ -1,386 +0,0 @@ -/* - * Copyright (c) 2017 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.Collections; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using static Interop.Elementary; - -namespace ElmSharp -{ - /// - /// Transit is designed to apply various animated transition effects, such like translation, rotation, etc. - /// For using these effects, create an Transit and add the desired transition effects. - /// - /// Transit is not reusable. If the effect ends, the transit is destroyed automatically. - public class Transit : IDisposable - { - IntPtr _handle = IntPtr.Zero; - bool _isDisposed = false; - ObservableCollection _objects = new ObservableCollection(); - ObservableCollection _chains = new ObservableCollection(); - HashSet _checker = new HashSet(); - Elm_Transit_Del_Cb DeletedCallback; - Elm_Transit_Effect_End_Cb EffectEndCallback; - Elm_Transit_Effect_Transition_Cb EffectTransitionCallback; - - /// - /// A callback called when the transit is deleted. - /// - public event EventHandler Deleted; - - /// - /// Creates and initializes a new instance of Transit class. - /// - public Transit() - { - _handle = Interop.Elementary.elm_transit_add(); - DeletedCallback = (ptr1, ptr2) => { - Deleted?.Invoke(this, EventArgs.Empty); - Dispose(true); - }; - Interop.Elementary.elm_transit_del_cb_set(_handle, DeletedCallback, IntPtr.Zero); - ((INotifyCollectionChanged)_objects).CollectionChanged += OnObjectCollectionChanged; - ((INotifyCollectionChanged)_chains).CollectionChanged += OnChaninCollectionChanged; - } - - ~Transit() - { - Dispose(false); - } - - /// - /// Gets or sets the transit animation time - /// - public double Duration - { - get - { - return Interop.Elementary.elm_transit_duration_get(_handle); - } - set - { - Interop.Elementary.elm_transit_duration_set(_handle, value); - } - } - - /// - /// Gets or sets a value whether the objects states will be keep or not. - /// If it is not kept, the objects states will be reset when transition ends. - /// - public bool ObjectStateKeep - { - get - { - return Interop.Elementary.elm_transit_objects_final_state_keep_get(_handle); - } - set - { - Interop.Elementary.elm_transit_objects_final_state_keep_set(_handle, value); - } - } - - /// - /// Gets or sets the transit animation acceleration type. - /// - public TweenMode TweenMode - { - get - { - return (TweenMode)Interop.Elementary.elm_transit_tween_mode_get(_handle); - } - set - { - Interop.Elementary.elm_transit_tween_mode_set(_handle, (int)value); - } - } - - /// - /// Gets or sets the transit repeat count. - /// If the repeat is a negative number, it will repeat infinite times. - /// - public int Repeat - { - get - { - return Interop.Elementary.elm_transit_repeat_times_get(_handle); - } - set - { - Interop.Elementary.elm_transit_repeat_times_set(_handle, value); - } - } - - /// - /// Gets or sets if the auto reverse is on. - /// - public bool AutoReverse - { - get - { - return Interop.Elementary.elm_transit_auto_reverse_get(_handle); - } - set - { - Interop.Elementary.elm_transit_auto_reverse_set(_handle, value); - } - } - - /// - /// Gets or sets the event enabled when transit is operating. - /// - public bool EventEnabled - { - get - { - return Interop.Elementary.elm_transit_event_enabled_get(_handle); - } - set - { - Interop.Elementary.elm_transit_event_enabled_set(_handle, value); - } - } - - /// - /// Gets or sets the smooth scaling for transit map rendering - /// This gets smooth scaling for transit map rendering. - /// - public bool Smooth - { - get - { - return Interop.Elementary.elm_transit_smooth_get(_handle); - } - set - { - Interop.Elementary.elm_transit_smooth_set(_handle, value); - } - } - - /// - /// Get the time progression of the animation (a double value between 0.0 and 1.0). - /// The value returned is a fraction(current time / total time). - /// It represents the progression position relative to the total. - /// - public double Progress - { - get - { - return Interop.Elementary.elm_transit_progress_value_get(_handle); - } - } - - /// - /// Gets or sets the transit animation tween mode acceleration factor. - /// - /// A factor value from 0.0 to 1.0. - public double BeginAccelerationFactor - { - get - { - double begin = 1.0, end = 0.0; - Interop.Elementary.elm_transit_tween_mode_factor_get(_handle, out begin, out end); - return begin; - } - set - { - Interop.Elementary.elm_transit_tween_mode_factor_set(_handle, value, EndAccelerationFactor); - } - } - - /// - /// Gets or sets the transit animation tween mode acceleration factor. - /// - /// A factor value from 0.0 to 1.0. - public double EndAccelerationFactor - { - get - { - double begin = 1.0, end = 0.0; - Interop.Elementary.elm_transit_tween_mode_factor_get(_handle, out begin, out end); - return end; - } - set - { - Interop.Elementary.elm_transit_tween_mode_factor_set(_handle, BeginAccelerationFactor, value); - } - } - - /// - /// Starts the transition in given seconds. - /// Once this API is called, the transit begins to measure the time. - /// - /// The interval value in seconds - public void Go(double interval = 0) - { - Interop.Elementary.elm_transit_go_in(_handle, interval); - } - - /// - /// Pause the transition. - /// - public void Pause() - { - if (Interop.Elementary.elm_transit_paused_get(_handle) == false) - Interop.Elementary.elm_transit_paused_set(_handle, true); - } - - /// - /// Resume the transition. - /// - public void Resume() - { - if (Interop.Elementary.elm_transit_paused_get(_handle) == true) - Interop.Elementary.elm_transit_paused_set(_handle, false); - } - - /// - /// Get the current chained transit list. - /// - /// Cannot add the duplicate transit. - public IList Chains - { - get { return _chains; } - } - - /// - /// Get the objects list of the transit. - /// - /// Cannot add the duplicate object. - public IList Objects - { - get { return _objects; } - } - - /// - /// Add the effect. - /// - /// EffectBase object. - public void AddEffect(EffectBase effect) - { - IntPtr _effect = effect.CreateEffect(_handle); - EffectEndCallback = (effectPtr, transitPtr) => { effect.SendEffectEnd(); }; - EffectTransitionCallback = (effectPtr, transitPtr, progress) => { }; - Interop.Elementary.elm_transit_effect_add(_handle, EffectTransitionCallback, _effect, EffectEndCallback); - } - - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - - protected virtual void Dispose(bool isDisposing) - { - if (_isDisposed) - return; - - if (isDisposing) - { - ((INotifyCollectionChanged)_chains).CollectionChanged -= OnChaninCollectionChanged; - _chains.Clear(); - ((INotifyCollectionChanged)_objects).CollectionChanged -= OnObjectCollectionChanged; - _objects.Clear(); - _checker.Clear(); - } - - _isDisposed = true; - } - - void OnObjectCollectionChanged(object sender, NotifyCollectionChangedEventArgs e) - { - if (e.Action == NotifyCollectionChangedAction.Add) - { - foreach (EvasObject item in e.NewItems) - AddObject(item); - } - else if (e.Action == NotifyCollectionChangedAction.Remove) - { - foreach (EvasObject item in e.OldItems) - RemoveObject(item); - } - } - - void OnChaninCollectionChanged(object sender, NotifyCollectionChangedEventArgs e) - { - if (e.Action == NotifyCollectionChangedAction.Add) - { - foreach (Transit item in e.NewItems) - AddChainedTransit(item); - } - else if (e.Action == NotifyCollectionChangedAction.Remove) - { - foreach (Transit item in e.OldItems) - DeleteChainedTransit(item); - } - } - - /// - /// Add new object to apply the effects. - /// After the first addition of an object to transit, if its object list become empty again, the transit will be killed. - /// If the obj belongs to another transit, the obj will be removed from it and it will only belong to the other transit. - /// - /// It is not allowed to add a new object after transit begins. - /// Object to be animated. - void AddObject(EvasObject obj) - { - if (_checker.Contains(obj)) - throw new Exception("Cannot add the duplicate object."); - - _checker.Add(obj); - Interop.Elementary.elm_transit_object_add(_handle, obj); - } - - /// - /// Removes an added object from the transit. - /// - /// Object to be removed from transit. - void RemoveObject(EvasObject obj) - { - if (_checker.Contains(obj)) - _checker.Remove(obj); - - Interop.Elementary.elm_transit_object_remove(_handle, obj); - } - - /// - /// Makes the chain relationship between two transits. - /// - /// The chain transit object. This transit will be operated after transit is done. - void AddChainedTransit(Transit transit) - { - if (_checker.Contains(transit)) - throw new Exception("Cannot add the duplicate transit."); - - _checker.Add(transit); - Interop.Elementary.elm_transit_chain_transit_add(_handle, transit._handle); - } - - /// - /// Cut off the chain relationship between two transits. - /// - /// The chain transit object. - void DeleteChainedTransit(Transit transit) - { - if (_checker.Contains(transit)) - _checker.Remove(transit); - - Interop.Elementary.elm_transit_chain_transit_del(_handle, transit._handle); - } - } -} diff --git a/src/ElmSharp/ElmSharp/TransitEffect.cs b/src/ElmSharp/ElmSharp/TransitEffect.cs deleted file mode 100755 index fd29499cc..000000000 --- a/src/ElmSharp/ElmSharp/TransitEffect.cs +++ /dev/null @@ -1,461 +0,0 @@ -/* - * Copyright (c) 2017 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.Collections.Generic; - -namespace ElmSharp -{ - /// - /// The axis along which flip effect should be applied. - /// - public enum FlipAxis - { - /// - /// Flip on X axis - /// - X, - - /// - /// Flip on Y axis - /// - Y, - } - - /// - /// The direction in which the wipe effect should occur. - /// - public enum WipeDirection - { - /// - /// Wipe to the left - /// - Left, - - /// - /// Wipe to the right - /// - Right, - - /// - /// Wipe to the up - /// - Up, - - /// - /// Wipe to the down - /// - Down, - } - - /// - /// Whether the wipe effect should show or hide the object. - /// - public enum WipeType - { - /// - /// Hide the object during the animation - /// - Hide, - - /// - /// Show the object during the animation - /// - Show, - } - - /// - /// The type of acceleration used in the transition. - /// - public enum TweenMode - { - /// - /// Constant speed - /// - Linear, - - /// - /// Starts slow, increase speed over time, then decrease again and stop slowly, v1 being a power factor - /// - Sinusoidal, - - /// - /// Starts fast and decrease speed over time, v1 being a power factor - /// - Decelerate, - - /// - /// Starts slow and increase speed over time, v1 being a power factor - /// - Accelerate, - - /// - /// Start at gradient v1, interpolated via power of v2 curve - /// - DivisorInterpolate, - - /// - /// Start at 0.0 then "drop" like a ball bouncing to the ground at 1.0, and bounce v2 times, with decay factor of v1 - /// - Bounce, - - /// - /// Start at 0.0 then "wobble" like a spring rest position 1.0, and wobble v2 times, with decay factor of v1 - /// - Spring, - - /// - /// Follow the cubic-bezier curve calculated with the control points (x1, y1), (x2, y2) - /// - BezierCurve, - } - - /// - /// Blend effect class. - /// - public class BlendEffect : EffectBase - { - /// - /// Creates and initializes a new instance of BlendEffect class. - /// - public BlendEffect() - { - } - - internal override IntPtr CreateEffect(IntPtr transit) - { - return Interop.Elementary.elm_transit_effect_blend_add(transit); - } - } - - /// - /// Color effect class. - /// - public class ColorEffect : EffectBase - { - Color _begin; - Color _end; - - /// - /// Creates and initializes a new instance of ColorEffect class. - /// - /// The begin color of the effect - /// The end color of the effect - public ColorEffect(Color beginColor, Color endColor) - { - _begin = beginColor; - _end = endColor; - } - - /// - /// The begin color of the effect - /// - public Color BeginColor - { - get { return _begin; } - } - - /// - /// The end color of the effect - /// - public Color EndColor - { - get { return _end; } - } - - internal override IntPtr CreateEffect(IntPtr transit) - { - return Interop.Elementary.elm_transit_effect_color_add(transit, _begin.R, _begin.G, _begin.B, _begin.A, _end.R, _end.G, _end.B, _end.A); - } - } - - /// - /// Fade effect class. - /// - public class FadeEffect : EffectBase - { - /// - /// Creates and initializes a new instance of FadeEffect class. - /// - public FadeEffect() - { - } - - internal override IntPtr CreateEffect(IntPtr transit) - { - return Interop.Elementary.elm_transit_effect_fade_add(transit); - } - } - - /// - /// Flip effect class. - /// - public class FlipEffect : EffectBase - { - FlipAxis _axis; - bool _clockWise; - bool _resizable; - - /// - /// Creates and initializes a new instance of FlipEffect class. - /// - /// Flipping Axis(X or Y). - /// Flipping Direction. True is clock-wise. - /// Resizable effect with FlipEffect - public FlipEffect(FlipAxis axis, bool clockWise, bool resizable = false) - { - _axis = axis; - _clockWise = clockWise; - _resizable = resizable; - } - - /// - /// Flipping Axis(X or Y). - /// - public FlipAxis Axis - { - get { return _axis; } - } - - /// - /// Flipping Direction. True is clock-wise. - /// - public bool ClockWise - { - get { return _clockWise; } - } - - /// - /// Resizable FlipEffect. - /// - public bool Resizable - { - get { return _resizable; } - } - - internal override IntPtr CreateEffect(IntPtr transit) - { - if (_resizable) - return Interop.Elementary.elm_transit_effect_resizable_flip_add(transit, (int)_axis, _clockWise); - return Interop.Elementary.elm_transit_effect_flip_add(transit, (int)_axis, _clockWise); - } - } - - /// - /// Resizing effect class. - /// - public class ResizingEffect : EffectBase - { - Size _begin; - Size _end; - - /// - /// Creates and initializes a new instance of FlipEffect class. - /// - /// The begin Size of the effect - /// The end Size of the effect - public ResizingEffect(Size beginSize, Size endSize) - { - _begin = beginSize; - _end = endSize; - } - - /// - /// The begin Size of the effect - /// - public Size BeginSize - { - get { return _begin; } - } - - /// - /// The end Size of the effect - /// - public Size EndSize - { - get { return _end; } - } - - internal override IntPtr CreateEffect(IntPtr transit) - { - return Interop.Elementary.elm_transit_effect_resizing_add(transit, _begin.Width, _begin.Height, _end.Width, _end.Height); - } - } - - /// - /// Rotation effect class. - /// - public class RotationEffect : EffectBase - { - float _begin; - float _end; - - /// - /// Creates and initializes a new instance of RotationEffect class. - /// - /// The begin degree of the effect - /// The end degree of the effect - public RotationEffect(float beginDegree, float endDegree) - { - _begin = beginDegree; - _end = endDegree; - } - - /// - /// The begin degree of the effect - /// - public float BeginDegree - { - get { return _begin; } - } - - /// - /// The end degree of the effect - /// - public float EndDegree - { - get { return _end; } - } - - internal override IntPtr CreateEffect(IntPtr transit) - { - return Interop.Elementary.elm_transit_effect_rotation_add(transit, _begin, _end); - } - } - - /// - /// Translation effect class. - /// - public class TranslationEffect : EffectBase - { - Point _begin; - Point _end; - - /// - /// Creates and initializes a new instance of FlipEffect class. - /// - /// The begin Point of the effect - /// The end Point of the effect - public TranslationEffect(Point beginPoint, Point endPoint) - { - _begin = beginPoint; - _end = endPoint; - } - - /// - /// The begin Point of the effect - /// - public Point BeginPoint - { - get { return _begin; } - } - - /// - /// The end Point of the effect - /// - public Point EndPoint - { - get { return _end; } - } - - internal override IntPtr CreateEffect(IntPtr transit) - { - return Interop.Elementary.elm_transit_effect_translation_add(transit, _begin.X, _begin.Y, _end.X, _end.Y); - } - } - - /// - /// Wipe effect class. - /// - public class WipeEffect : EffectBase - { - WipeType _type; - WipeDirection _direction; - - /// - /// Creates and initializes a new instance of WipeEffect class. - /// - /// Wipe type. Hide or show. - /// Wipe Direction. - public WipeEffect(WipeType type, WipeDirection direction) - { - _type = type; - _direction = direction; - } - - /// - /// Wipe type. Hide or show. - /// - public WipeType Type - { - get { return _type; } - } - - /// - /// Wipe Direction. - /// - public WipeDirection Direction - { - get { return _direction; } - } - - internal override IntPtr CreateEffect(IntPtr transit) - { - return Interop.Elementary.elm_transit_effect_wipe_add(transit, (int)_type, (int)_direction); - } - } - - /// - /// Zoom effect class. - /// - public class ZoomEffect : EffectBase - { - float _begin; - float _end; - - /// - /// Creates and initializes a new instance of ZoomEffect class. - /// - /// The begin rate of the effect - /// The end rate of the effect - public ZoomEffect(float beginRate, float endRate) - { - _begin = beginRate; - _end = endRate; - } - - /// - /// The begin rate of the effect - /// - public float BeginRate - { - get { return _begin; } - } - - /// - /// The end rate of the effect - /// - public float EndRate - { - get { return _end; } - } - - internal override IntPtr CreateEffect(IntPtr transit) - { - return Interop.Elementary.elm_transit_effect_zoom_add(transit, _begin, _end); - } - } -} \ No newline at end of file diff --git a/src/ElmSharp/ElmSharp/Utility.cs b/src/ElmSharp/ElmSharp/Utility.cs deleted file mode 100644 index baff80297..000000000 --- a/src/ElmSharp/ElmSharp/Utility.cs +++ /dev/null @@ -1,160 +0,0 @@ -/* - * Copyright (c) 2017 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. - */ - -namespace ElmSharp -{ - public static class Utility - { - /// - /// Appends a font path to the list of font paths used by the application. - /// - /// The new font path. - public static void AppendGlobalFontPath(string path) - { - Interop.Evas.evas_font_path_global_append(path); - } - - /// - /// Prepends a font path to the list of font paths used by the application. - /// - /// The new font path. - public static void PrependEvasGlobalFontPath(string path) - { - Interop.Evas.evas_font_path_global_prepend(path); - } - - /// - /// Removes all font paths loaded into memory by evas_font_path_app_* APIs for the application. - /// - public static void ClearEvasGlobalFontPath() - { - Interop.Evas.evas_font_path_global_clear(); - } - - /// - /// Sets Edje color class. - /// - /// Color class - /// Object Red value - /// Object Red value - /// Object Red value - /// Object Red value - /// Outline Red value - /// Outline Green value - /// Outline Blue value - /// Outline Alpha value - /// Shadow Red value - /// Shadow Green value - /// Shadow Bluevalue - /// Shadow Alpha value - /// - public static bool SetEdjeColorClass(string colorClass, int red, int green, int blue, int alpha, int outlineRed, int outlineGreen, int outlineBlue, int outlineAlpha, - int shadowRed, int shadowGreen, int shadowBlue, int shadowAlpha) - { - return Interop.Elementary.edje_color_class_set(colorClass, red, green, blue, alpha, outlineRed, outlineGreen, outlineBlue, outlineAlpha, shadowRed, shadowGreen, shadowBlue, shadowAlpha); - } - - /// - /// Gets Edje color class. - /// - /// Color class - /// Object Red value - /// Object Red value - /// Object Red value - /// Object Red value - /// Outline Red value - /// Outline Green value - /// Outline Blue value - /// Outline Alpha value - /// Shadow Red value - /// Shadow Green value - /// Shadow Bluevalue - /// Shadow Alpha value - /// - public static bool GetEdjeColorClass(string colorClass, out int red, out int green, out int blue, out int alpha, out int outlineRed, out int outlineGreen, out int outlineBlue, - out int outlineAlpha, out int shadowRed, out int shadowGreen, out int shadowBlue, out int shadowAlpha) - { - return Interop.Elementary.edje_color_class_get(colorClass, out red, out green, out blue, out alpha, out outlineRed, out outlineGreen, out outlineBlue, out outlineAlpha, - out shadowRed, out shadowGreen, out shadowBlue, out shadowAlpha); - } - - /// - /// Processes all queued up edje messages. - /// This function triggers the processing of messages addressed to any (alive) edje objects. - /// - public static void ProcessEdjeMessageSignal() - { - Interop.Elementary.edje_message_signal_process(); - } - - /// - /// Sets the Edje text class. - /// - /// The text class name - /// The font name - /// The font size - /// True, on success or false, on error - public static bool SetEdjeTextClass(string textClass, string font, int size) - { - return Interop.Elementary.edje_text_class_set(textClass, font, size); - } - - /// - /// Gets the Edje text class. - /// - /// The text class name - /// The font name - /// The font size - /// True, on success or false, on error - public static bool GetEdjeTextClass(string textClass, out string font, out int size) - { - return Interop.Elementary.edje_text_class_get(textClass, out font, out size); - } - - /// - /// Delete the text class. - /// - /// - public static void DeleteEdjeTextClass(string textClass) - { - Interop.Elementary.edje_text_class_del(textClass); - } - - /// - /// Pre-multiplies a rgb triplet by an alpha factor. - /// - /// The alpha factor - /// The Red component of the color - /// The Green component of the color - /// The Blue component of the color - public static void PremulityplyEvasColorByAlpha(int alpha, ref int red, ref int green, ref int blue) - { - Interop.Evas.evas_color_argb_premul(alpha, ref red, ref green, ref blue); - } - - /// - /// Undoes pre-multiplies a rgb triplet by an alpha factor. - /// - /// The alpha factor - /// The Red component of the color - /// The Green component of the color - /// The Blue component of the color - public static void UnPremulityplyEvasColorByAlpha(int alpha, ref int red, ref int green, ref int blue) - { - Interop.Evas.evas_color_argb_unpremul(alpha, ref red, ref green, ref blue); - } - } -} \ No newline at end of file diff --git a/src/ElmSharp/ElmSharp/Widget.cs b/src/ElmSharp/ElmSharp/Widget.cs deleted file mode 100755 index f1df74462..000000000 --- a/src/ElmSharp/ElmSharp/Widget.cs +++ /dev/null @@ -1,442 +0,0 @@ -/* - * 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.Collections.Generic; -using ElmSharp.Accessible; - -namespace ElmSharp -{ - /// - /// Enumeration for the focus direction. - /// - public enum FocusDirection - { - /// - /// Previous direction - /// - Previous, - - /// - /// Next direction - /// - Next, - - /// - /// Up direction - /// - Up, - - /// - /// Down direction - /// - Down, - - /// - /// Right direction - /// - Right, - - /// - /// Left direction - /// - Left - } - - /// - /// The Widget is abstract class, it is the parent of other widgets. - /// Inherits from . - /// - public abstract class Widget : AccessibleObject - { - Dictionary _partContents = new Dictionary(); - - SmartEvent _focused; - SmartEvent _unfocused; - - internal Color _backgroundColor = Color.Default; - internal int _opacity = Color.Default.A; - - protected Widget() - { - } - - /// - /// Creates and initializes a new instance of the Widget class. - /// - /// 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); - } - - /// - /// Update the part contents - /// - /// The content which put to the part - /// The updated part - protected void UpdatePartContents(EvasObject content, string part = "__default__") - { - _partContents[part] = content; - } - - /// - /// Focused will be triggered when the widget is focused. - /// - public event EventHandler Focused; - - /// - /// Unfocused will be triggered when the widget is unfocused. - /// - public event EventHandler Unfocused; - - /// - /// Sets or gets the state of the widget, which might be enabled or disabled. - /// - public bool IsEnabled - { - get - { - return !Interop.Elementary.elm_object_disabled_get(RealHandle); - } - set - { - Interop.Elementary.elm_object_disabled_set(RealHandle, !value); - } - } - - /// - /// Sets or gets the style of the widget. - /// - public string Style - { - get - { - return Interop.Elementary.elm_object_style_get(RealHandle); - } - set - { - Interop.Elementary.elm_object_style_set(RealHandle, value); - } - } - - /// - /// Gets whether this widget is focused. - /// - public bool IsFocused - { - get - { - return Interop.Elementary.elm_object_focus_get(RealHandle); - } - } - - /// - /// Gets whether a widget is focusable or not. - /// - /// Widgets which are meant to be interacted with by input events are created able to be focused, by default - public bool IsFocusAllowed - { - get - { - return Interop.Elementary.elm_object_focus_allow_get(RealHandle); - } - } - - /// - /// Sets or gets the text of the widget. - /// - /// It could be override by special child class - public virtual string Text - { - get - { - return Interop.Elementary.elm_object_part_text_get(RealHandle); - } - set - { - Interop.Elementary.elm_object_part_text_set(RealHandle, IntPtr.Zero, value); - } - } - - /// - /// Sets or gets the background color of the widget. - /// - /// It could be override by special child class - public virtual Color BackgroundColor - { - get - { - if (!_backgroundColor.IsDefault) - { - _backgroundColor = GetPartColor("bg"); - } - return _backgroundColor; - } - set - { - if (value.IsDefault) - { - Console.WriteLine("Widget instance doesn't support to set BackgroundColor to Color.Default."); - } - else - { - SetPartColor("bg", value); - _backgroundColor = value; - } - } - } - - /// - /// Sets or gets the opacity of the widget. - /// - /// It could be override by special child class - public virtual int Opacity - { - get - { - if (_opacity != Color.Default.A) - { - _opacity = GetPartOpacity("opacity"); - } - return _opacity; - } - set - { - SetPartOpacity("opacity", value); - _opacity = value; - } - } - - /// - /// Sets or gets whether a widget and its children are focusable or not. - /// - public bool AllowTreeFocus - { - get - { - return Interop.Elementary.elm_object_tree_focus_allow_get(RealHandle); - } - set - { - Interop.Elementary.elm_object_tree_focus_allow_set(RealHandle, value); - } - } - - /// - /// Sets or gets the widget's mirrored mode. - /// - public bool IsMirroredMode - { - get - { - return Interop.Elementary.elm_object_mirrored_get(RealHandle); - } - set - { - Interop.Elementary.elm_object_mirrored_set(RealHandle, value); - } - } - - /// - /// Sets or gets the widget's mirrored mode setting. - /// When widget set automatic mode(true), it follows the system mirrored mode. - /// - public bool IsAutoMirroredMode - { - get - { - return Interop.Elementary.elm_object_mirrored_automatic_get(RealHandle); - } - set - { - Interop.Elementary.elm_object_mirrored_automatic_set(RealHandle, value); - } - } - - /// - /// Sets the widget to be focused or not. - /// - /// Weather be focused - public void SetFocus(bool isFocus) - { - Interop.Elementary.elm_object_focus_set(RealHandle, isFocus); - } - - /// - /// Sets the ability for a widget to be focused. - /// - /// True if the object can be focused, false if not(and on errors) - public void AllowFocus(bool isAllowFocus) - { - Interop.Elementary.elm_object_focus_allow_set(RealHandle, isAllowFocus); - } - - /// - /// Gives focus to next widget in widget tree. - /// - /// Direction to move the focus - public void FocusNext(FocusDirection direction) - { - Interop.Elementary.elm_object_focus_next(RealHandle, (int)direction); - } - - /// - /// Set next widget with specific focus direction. - /// - /// Focus next widget - /// Focus direction - public void SetNextFocusObject(EvasObject next, FocusDirection direction) - { - Interop.Elementary.elm_object_focus_next_object_set(RealHandle, next.RealHandle, (int)direction); - } - - /// - /// Sets content to particular part of the widget, and the preserve old content will not be unset. - /// - /// The name of particular part - /// The content - /// - public virtual bool SetPartContent(string part, EvasObject content) - { - return SetPartContent(part, content, false); - } - - /// - /// Sets content to particular part of the widget. - /// - /// The name of particular part - /// The content - /// true, preserve old content will be unset. false, preserve old content will not be unset. - /// - public virtual bool SetPartContent(string part, EvasObject content, bool preserveOldContent) - { - if (preserveOldContent) - { - Interop.Elementary.elm_object_part_content_unset(RealHandle, part); - } - Interop.Elementary.elm_object_part_content_set(RealHandle, part, content); - UpdatePartContents(content, part); - return true; - } - - /// - /// Sets content to the widget, and the preserve old content will not be unset. - /// - /// The content - /// - public void SetContent(EvasObject content) - { - SetContent(content, false); - } - - /// - /// Sets content the widget. - /// - /// The content - /// true, preserve old content will be unset. false, preserve old content will not be unset. - /// - public void SetContent(EvasObject content, bool preserveOldContent) - { - if (preserveOldContent) - { - Interop.Elementary.elm_object_content_unset(RealHandle); - } - - Interop.Elementary.elm_object_content_set(RealHandle, content); - UpdatePartContents(content); - } - - /// - /// Sets text to particular part of the widget. - /// - /// The name of particular part - /// The text - public virtual bool SetPartText(string part, string text) - { - Interop.Elementary.elm_object_part_text_set(RealHandle, part, text); - return true; - } - - /// - /// Gets text of a particular part of the widget. - /// - /// The name of particular part - /// Text of the particular part of the widget - public virtual string GetPartText(string part) - { - return Interop.Elementary.elm_object_part_text_get(RealHandle, part); - } - - /// - /// Sets color of a particular part of the widget. - /// - /// The name of particular part - /// The color be set to widget - /// This method is a virtual method, it could be override by special child class - public virtual void SetPartColor(string part, Color color) - { - Interop.Elementary.elm_object_color_class_color_set(RealHandle, part, color.R * color.A / 255, - color.G * color.A / 255, - color.B * color.A / 255, - color.A); - } - - /// - /// Gets color of the particular part of the widget. - /// - /// The name of particular part - /// The color of the particular part - /// This method is a virtual method, it could be override by special child class - public virtual Color GetPartColor(string part) - { - int r, g, b, a; - Interop.Elementary.elm_object_color_class_color_get(RealHandle, part, out r, out g, out b, out a); - return new Color((int)(r / (a / 255.0)), (int)(g / (a / 255.0)), (int)(b / (a / 255.0)), a); - } - - /// - /// Sets opacity of the particular part of the widget. - /// - /// The name of particular part - /// The opacity of the particular part - public void SetPartOpacity(string part, int opacity) - { - Interop.Elementary.elm_object_color_class_color_set(Handle, part, 255, 255, 255, opacity); - } - - /// - /// Gets opacity of the particular part of the widget. - /// - /// The name of particular part - /// Opacity value of the particular part - public int GetPartOpacity(string part) - { - int r, g, b, a; - Interop.Elementary.elm_object_color_class_color_get(Handle, part, out r, out g, out b, out a); - return a; - } - - internal IntPtr GetPartContent(string part) - { - return Interop.Elementary.elm_object_part_content_get(RealHandle, part); - } - } -} \ No newline at end of file diff --git a/src/ElmSharp/ElmSharp/Window.cs b/src/ElmSharp/ElmSharp/Window.cs deleted file mode 100755 index 8e879a6db..000000000 --- a/src/ElmSharp/ElmSharp/Window.cs +++ /dev/null @@ -1,1043 +0,0 @@ -/* - * 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.Collections.Generic; -using System.ComponentModel; - -namespace ElmSharp -{ - /// - /// Enumeration for the display rotation of window. - /// - [Flags] - public enum DisplayRotation - { - /// - /// Rotation value of window is 0 degree - /// - Degree_0 = 1, - - /// - /// Rotation value of window is 90 degree - /// - Degree_90 = 2, - - /// - /// Rotation value of window is 180 degree - /// - Degree_180 = 4, - - /// - /// Rotation value of window is 270 degree - /// - Degree_270 = 8 - }; - - /// - /// Enumeration for the indicator opacity - /// - public enum StatusBarMode - { - /// - /// Opacifies the status bar - /// - Opaque = 1, - - /// - /// Be translucent the status bar - /// - /// - /// Not supported. - /// - Translucent = 2, - - /// - /// Transparentizes the status bar - /// - Transparent = 3, - } - - [EditorBrowsable(EditorBrowsableState.Never)] - public enum KeyGrabMode - { - Shared = 256, - Topmost = 512, - Exclusive = 1024, - OverrideExclusive = 2048, - } - - /// - /// Enumeration for the indicator mode. - /// - public enum IndicatorMode - { - /// - /// Unknown indicator state. - /// - Unknown = 0, - - /// - /// Hides the indicator. - /// - Hide, - - /// - /// Shows the indicator. - /// - Show, - }; - - /// - /// Enumeration for the keyboard mode - /// - public enum KeyboardMode - { - /// - /// Unknown keyboard state - /// - Unknown, - - /// - /// Request to deactivate the keyboard - /// - Off, - - /// - /// Enable keyboard with default layout - /// - On, - - /// - /// Alpha (a-z) keyboard layout - /// - Alpha, - - /// - /// Numeric keyboard layout - /// - Numeric, - - /// - /// PIN keyboard layout - /// - Pin, - - /// - /// Phone keyboard layout - /// - PhoneNumber, - - /// - /// Hexadecimal numeric keyboard layout - /// - Hex, - - /// - /// Full (QWERTY) keyboard layout - /// - QWERTY, - - /// - /// Password keyboard layout - /// - Password, - - /// - /// IP keyboard layout - /// - IP, - - /// - /// Host keyboard layout - /// - Host, - - /// - /// File keyboard layout - /// - File, - - /// - /// URL keyboard layout - /// - URL, - - /// - /// Keypad layout - /// - Keypad, - - /// - /// J2ME keyboard layout - /// - J2ME, - }; - - /// - /// Enumeration for the window type - /// - public enum WindowType - { - /// - /// Unknown - /// - Unknown, - - /// - /// A normal window. Indicates a normal, top-level window. Almost every window will be created with this type. - /// - Basic, - - /// - /// Used for simple dialog windows. - /// - Dialog, - - /// - /// For special desktop windows, like a background window holding desktop icons. - /// - Desktop, - - /// - /// The window is used as a dock or panel. Usually would be kept on top of any other window by the Window Manager. - /// - Dock, - - /// - /// The window is used to hold a floating toolbar, or similar. - /// - Toolbar, - - /// - /// Similar to Toolbar. - /// - Menu, - - /// - /// A persistent utility window, like a toolbox or palette. - /// - Utility, - - /// - /// Splash window for a starting up application. - /// - Splash, - - /// - /// The window is a dropdown menu, as when an entry in a menubar is clicked. - /// - DropdownMenu, - - /// - /// Like DropdownMenu, but for the menu triggered by right-clicking an object. - /// - PopupMenu, - - /// - /// The window is a tooltip. A short piece of explanatory text that typically appear after the mouse cursor hovers over an object for a while. - /// - Tooltip, - - /// - /// A notification window, like a warning about battery life or a new E-Mail received. - /// - Notification, - - /// - /// A window holding the contents of a combo box. - /// - Combo, - - /// - /// Used to indicate the window is a representation of an object being dragged across different windows, or even applications. - /// - DragAndDrop, - - /// - /// The window is rendered onto an image buffer. No actual window is created for this type, instead the window and all of its contents will be rendered to an image buffer. - /// This allows to have children window inside a parent one just like any other object would be, and do other things like applying Evas_Map effects to it. - /// - InlinedImage, - - /// - /// The window is rendered onto an image buffer and can be shown other process's plug image object. - /// No actual window is created for this type, instead the window and all of its contents will be rendered to an image buffer and can be shown other process's plug image object. - /// - SocketImage, - - /// - /// This window was created using a pre-existing canvas. The window widget can be deleted, but the canvas must be managed externally. - /// - Fake, - }; - - /// - /// The Window is container that contain the graphical user interface of a program. - /// - public class Window : Widget - { - SmartEvent _deleteRequest; - SmartEvent _rotationChanged; - HashSet _referenceHolder = new HashSet(); - - /// - /// Creates and initializes a new instance of the Window class. - /// - /// Window name. - public Window(string name) : this(null, name) - { - } - - /// - /// Creates and initializes a new instance of the Window class. - /// - /// - /// Parent widget which this widow created on. - /// - /// - /// Window name. - /// - /// - /// Window constructor.show window indicator,set callback - /// When closing the window in any way outside the program control, - /// and set callback when window rotation changed. - /// - public Window(Window parent, string name) : this(parent, name, WindowType.Basic) - { - } - - /// - /// Creates and initializes a new instance of the Window class. - /// - /// - /// Parent widget which this widow created on. - /// - /// - /// Window name. - /// - /// - /// Window type - /// - /// - /// Window constructor.show window indicator,set callback - /// When closing the window in any way outside the program control, - /// and set callback when window rotation changed. - /// - public Window(Window parent, string name, WindowType type) - { - Name = name; - Type = type; - Realize(parent); - IndicatorMode = IndicatorMode.Show; - - _deleteRequest = new SmartEvent(this, "delete,request"); - _rotationChanged = new SmartEvent(this, "wm,rotation,changed"); - _deleteRequest.On += (s, e) => CloseRequested?.Invoke(this, EventArgs.Empty); - _rotationChanged.On += (s, e) => RotationChanged?.Invoke(this, EventArgs.Empty); - } - - protected Window() - { - } - - /// - /// CloseRequested will be triggered when Window close. - /// - public event EventHandler CloseRequested; - - /// - /// RotationChanged will be triggered when Window do rotation. - /// - public event EventHandler RotationChanged; - - /// - /// Sets or gets Window name. - /// - public string Name { get; set; } - - /// - /// Gets the Window type. - /// - public WindowType Type { get; } = WindowType.Basic; - - /// - /// Gets Window size with Size value(w,h) - /// - public Size ScreenSize - { - get - { - int x, y, w, h; - Interop.Elementary.elm_win_screen_size_get(Handle, out x, out y, out w, out h); - return new Size(w, h); - } - } - - /// - /// Gets the screen dpi for the screen that a Window is on. - /// - public Point ScreenDpi - { - get - { - Point point = default(Point); - Interop.Elementary.elm_win_screen_dpi_get(Handle, out point.X, out point.Y); - return point; - } - } - - /// - /// Gets the rotation of the Window.The rotation of the window in degrees (0-360). - /// - public int Rotation - { - get - { - return Interop.Elementary.elm_win_rotation_get(Handle); - } - } - - /// - /// Gets whether window manager supports window rotation or not. - /// - public bool IsRotationSupported - { - get - { - return Interop.Elementary.elm_win_wm_rotation_supported_get(Handle); - } - } - - [Obsolete("Sorry, it's error typo of AvailableRotations, please use AvailableRotations")] - public DisplayRotation AavailableRotations { get; set; } - - /// - /// Sets or gets available rotation degree. - /// - public DisplayRotation AvailableRotations - { - get - { - int[] rotations; - Interop.Elementary.elm_win_wm_rotation_available_rotations_get(Handle, out rotations); - if (rotations == null) - { - return 0; - } - return ConvertToDisplayRotation(rotations); - } - set - { - Interop.Elementary.elm_win_wm_rotation_available_rotations_set(Handle, ConvertDegreeArray(value)); - } - } - - /// - /// Sets or gets whether auto deletion function is enable. - /// - /// - /// If you enable auto deletion, the window is automatically destroyed after the signal is emitted. - /// If auto deletion is disabled, the window is not destroyed and the program has to handle it. - /// - public bool AutoDeletion - { - get - { - return Interop.Elementary.elm_win_autodel_get(Handle); - } - set - { - Interop.Elementary.elm_win_autodel_set(Handle, value); - } - } - - /// - /// Sets or gets the alpha channel state of a window. - /// - /// - /// True if the window alpha channel is enabled, false otherwise. - /// If alpha is true, the alpha channel of the canvas will be enabled possibly making parts of the window completely or partially transparent. - /// - public bool Alpha - { - get - { - return Interop.Elementary.elm_win_alpha_get(Handle); - } - set - { - Interop.Elementary.elm_win_alpha_set(Handle, value); - } - } - - /// - /// Sets or gets the role of the window. - /// - /// - /// The Role will be invalid if a new role is set or if the window is destroyed. - /// - public string Role - { - get - { - return Interop.Elementary.elm_win_role_get(Handle); - } - set - { - Interop.Elementary.elm_win_role_set(Handle, value); - } - } - - /// - /// Sets or gets the mode of status bar. - /// - public StatusBarMode StatusBarMode - { - get - { - return (StatusBarMode)Interop.Elementary.elm_win_indicator_opacity_get(Handle); - } - set - { - Interop.Elementary.elm_win_indicator_opacity_set(Handle, (int)value); - } - } - - [EditorBrowsable(EditorBrowsableState.Never)] - public bool Iconified - { - get - { - return Interop.Elementary.elm_win_iconified_get(RealHandle); - } - set - { - Interop.Elementary.elm_win_iconified_set(RealHandle, value); - } - } - - /// - /// Gets or sets the window's indicator mode. - /// - /// The indicator mode. - public IndicatorMode IndicatorMode - { - get - { - return Interop.Elementary.elm_win_indicator_mode_get(RealHandle); - } - set - { - Interop.Elementary.elm_win_indicator_mode_set(RealHandle, value); - } - } - - /// - /// Gets or sets the aspect ratio of a window. - /// - public double Aspect - { - get - { - return Interop.Elementary.elm_win_aspect_get(RealHandle); - } - set - { - Interop.Elementary.elm_win_aspect_set(RealHandle, value); - } - } - - /// - /// Window's autohide state. - /// - public bool AutoHide - { - get - { - return Interop.Elementary.elm_win_autohide_get(RealHandle); - } - set - { - Interop.Elementary.elm_win_autohide_set(RealHandle, value); - } - } - - /// - /// Get the borderless state of a window. - /// This function requests the Window Manager to not draw any decoration around the window. - /// - public bool Borderless - { - get - { - return Interop.Elementary.elm_win_borderless_get(RealHandle); - } - set - { - Interop.Elementary.elm_win_borderless_set(RealHandle, value); - } - } - - /// - /// Gets or sets the demand attention state of a window. - /// - public bool DemandAttention - { - get - { - return Interop.Elementary.elm_win_demand_attention_get(RealHandle); - } - set - { - Interop.Elementary.elm_win_demand_attention_set(RealHandle, value); - } - } - - /// - /// Gets or sets the floating mode of a window. - /// - public bool FloatingMode - { - get - { - return Interop.Elementary.elm_win_floating_mode_get(RealHandle); - } - set - { - Interop.Elementary.elm_win_floating_mode_set(RealHandle, value); - } - } - - /// - /// Gets or sets the animate status for the focus highlight for this window. - /// This function will enable or disable the animation of focus highlight only for the given window, regardless of the global setting for it. - /// - public bool FocusHighlightAnimation - { - get - { - return Interop.Elementary.elm_win_focus_highlight_animate_get(RealHandle); - } - set - { - Interop.Elementary.elm_win_focus_highlight_animate_set(RealHandle, value); - } - } - - /// - /// Gets or sets the enabled status for the focus highlight in a window. - /// This function will enable or disable the focus highlight only for the given window, regardless of the global setting for it. - /// - public bool FocusHighlightEnabled - { - get - { - return Interop.Elementary.elm_win_focus_highlight_enabled_get(RealHandle); - } - set - { - Interop.Elementary.elm_win_focus_highlight_enabled_set(RealHandle, value); - } - } - - /// - /// Gets or sets the style for the focus highlight on this window. - /// Sets the style to use for theming the highlight of focused objects on the given window.If style is NULL, the default will be used. - /// - public string FocusHighlightStyle - { - get - { - return Interop.Elementary.elm_win_focus_highlight_style_get(RealHandle); - } - set - { - Interop.Elementary.elm_win_focus_highlight_style_set(RealHandle, value); - } - } - - /// - /// Get the keyboard mode of the window. - /// - public KeyboardMode KeyboardMode - { - get - { - return (KeyboardMode)Interop.Elementary.elm_win_keyboard_mode_get(RealHandle); - } - set - { - Interop.Elementary.elm_win_keyboard_mode_set(RealHandle, (int)value); - } - } - - /// - /// Gets or sets the layer of the window. - /// What this means exactly will depend on the underlying engine used. - /// In the case of X11 backed engines, the value in layer has the following meanings - /// less than 3 means that the window will be placed below all others, - /// more than 5 means that the window will be placed above all others, - /// and anything else means that the window will be placed in the default layer. - /// - public override int Layer - { - get - { - return Interop.Elementary.elm_win_layer_get(RealHandle); - } - set - { - Interop.Elementary.elm_win_layer_set(RealHandle, value); - } - } - - /// - /// Gets or sets the modal state of a window. - /// - public bool Modal - { - get - { - return Interop.Elementary.elm_win_modal_get(RealHandle); - } - set - { - Interop.Elementary.elm_win_modal_set(RealHandle, value); - } - } - - /// - /// Gets or sets the noblank property of a window. - /// This is a way to request the display on which the windowis shown does not blank, screensave or otherwise hide or obscure the window.It is intended for uses such as media playback on a television where a user may not want to be interrupted by an idle screen. - /// The noblank property may have no effect if the window is iconified/minimized or hidden. - /// - public bool NoBlank - { - get - { - return Interop.Elementary.elm_win_noblank_get(RealHandle); - } - set - { - Interop.Elementary.elm_win_noblank_set(RealHandle, value); - } - } - - /// - /// Get the profile of a window. - /// - public string Profile - { - get - { - return Interop.Elementary.elm_win_profile_get(RealHandle); - } - set - { - Interop.Elementary.elm_win_profile_set(RealHandle, value); - } - } - - /// - /// Get the constraints on the maximum width and height of a window relative to the width and height of its screen. - /// When this function returns true, obj will never resize larger than the screen. - /// - public bool ScreenConstrain - { - get - { - return Interop.Elementary.elm_win_screen_constrain_get(RealHandle); - } - set - { - Interop.Elementary.elm_win_screen_constrain_set(RealHandle, value); - } - } - - /// - /// Gets or sets the base size of a window. - /// - public Size BaseSize - { - get - { - int w, h; - Interop.Elementary.elm_win_size_base_get(RealHandle, out w, out h); - return new Size(w, h); - } - set - { - Interop.Elementary.elm_win_size_base_set(RealHandle, value.Width, value.Height); - } - } - - /// - /// Gets or sets the step size of a window. - /// - public Size StepSize - { - get - { - int w, h; - Interop.Elementary.elm_win_size_step_get(RealHandle, out w, out h); - return new Size(w, h); - } - set - { - Interop.Elementary.elm_win_size_step_set(RealHandle, value.Width, value.Height); - } - } - - /// - /// Get the screen position X of a window. - /// - public int ScreenPositionX - { - get - { - int x, y; - Interop.Elementary.elm_win_screen_position_get(Handle, out x, out y); - return x; - } - } - - /// - /// Get the screen position Y of a window. - /// - public int ScreenPositionY - { - get - { - int x, y; - Interop.Elementary.elm_win_screen_position_get(Handle, out x, out y); - return y; - } - } - - /// - /// Gets or sets the title of the window. - /// - public string Title - { - get - { - return Interop.Elementary.elm_win_title_get(Handle); - } - set - { - Interop.Elementary.elm_win_title_set(Handle, value); - } - } - - /// - /// Gets or sets the urgent state of a window. - /// - public bool Urgent - { - get - { - return Interop.Elementary.elm_win_urgent_get(Handle); - } - set - { - Interop.Elementary.elm_win_urgent_set(Handle, value); - } - } - - /// - /// Gets or sets the withdrawn state of a window. - /// - public bool Withdrawn - { - get - { - return Interop.Elementary.elm_win_urgent_get(Handle); - } - set - { - Interop.Elementary.elm_win_urgent_set(Handle, value); - } - } - - /// - /// Create a socket to provide the service for Plug widget. - /// - /// A service name - /// A number (any value, 0 being the common default) to differentiate multiple instances of services with the same name. - /// A boolean that if true, specifies to create a system-wide service all users can connect to, otherwise the service is private to the user id that created the service. - /// If true, create successfull, otherwise false - public bool CreateServiceSocket(string name, int number, bool systemWide) - { - return Interop.Elementary.elm_win_socket_listen(RealHandle, name, number, systemWide); - } - - /// - /// Set the rotation of the window. - /// - /// The rotation of the window, in degrees (0-360), counter-clockwise. - /// Resizes the window's contents so that they fit inside the current window geometry. - public void SetRotation(int degree, bool resize) - { - if (resize) - Interop.Elementary.elm_win_rotation_with_resize_set(RealHandle, degree); - else - Interop.Elementary.elm_win_rotation_set(RealHandle, degree); - } - - /// - /// Set the window to be skipped by focus. - /// This sets the window to be skipped by normal input. - /// This means a window manager will be asked to not focus this window as well as omit it from things like the taskbar, pager etc. - /// Call this and enable it on a window BEFORE you show it for the first time, otherwise it may have no effect. - /// Use this for windows that have only output information or might only be interacted with by the mouse or fingers, and never for typing input. - /// Be careful that this may have side-effects like making the window non-accessible in some cases unless the window is specially handled. Use this with care. - /// - public void FocusSkip(bool skip) - { - Interop.Elementary.elm_win_prop_focus_skip_set(Handle, skip); - } - - /// - /// Pull up the window object. - /// Places the window pointed by obj at the top of the stack, so that it's not covered by any other window. - /// - public void PullUp() - { - Interop.Elementary.elm_win_raise(Handle); - } - - /// - /// Bring down the window object. - /// Places the window pointed by obj at the bottom of the stack, so that no other window is covered by it. - /// - public void BringDown() - { - Interop.Elementary.elm_win_lower(Handle); - } - - /// - /// This function sends a request to the Windows Manager to activate the Window. - /// If honored by the WM, the window receives the keyboard focus. - /// - /// - /// This is just a request that a Window Manager may ignore, so calling this function does not ensure - /// in any way that the window is going to be the active one after it. - /// - public void Active() - { - Interop.Elementary.elm_win_activate(Handle); - } - - /// - /// Delete subobj as a resize object of window obj. - /// This function removes the object subobj from the resize objects of the window obj. - /// It will not delete the object itself, which will be left unmanaged and should be deleted by the developer, manually handled or set as child of some other container. - /// - /// Resize object. - public void DeleteResizeObject(EvasObject obj) - { - Interop.Elementary.elm_win_resize_object_del(Handle, obj); - } - - /// - /// Adds obj as a resize object of the Window. - /// - /// - /// Setting an object as a resize object of the window means that the obj child's size and - /// position is controlled by the window directly. That is, the obj is resized to match the window size - /// and should never be moved or resized manually by the developer.In addition, - /// resize objects of the window control the minimum size of it as well as whether it can or cannot be resized by the user. - /// - /// - /// Resize object. - /// - public void AddResizeObject(EvasObject obj) - { - Interop.Elementary.elm_win_resize_object_add(Handle, obj); - } - - [EditorBrowsable(EditorBrowsableState.Never)] - public void WinKeyGrab(string keyname, KeyGrabMode mode) - { - Interop.Elementary.elm_win_keygrab_set(RealHandle, keyname, 0, 0, 0, mode); - } - - [EditorBrowsable(EditorBrowsableState.Never)] - public void WinKeyUngrab(string keyname) - { - Interop.Elementary.elm_win_keygrab_unset(RealHandle, keyname, 0, 0); - } - - /// - /// Set the keygrab of the window. - /// - /// keyname string to set keygrab - public void KeyGrabEx(string keyname) - { - Interop.Elementary.eext_win_keygrab_set(RealHandle, keyname); - } - - /// - /// Unset the keygrab of the window. - /// - /// keyname string to unset keygrab - public void KeyUngrabEx(string keyname) - { - Interop.Elementary.eext_win_keygrab_unset(RealHandle, keyname); - } - - protected override IntPtr CreateHandle(EvasObject parent) - { - Interop.Elementary.elm_config_accel_preference_set("3d"); - return Interop.Elementary.elm_win_add(parent != null ? parent.Handle : IntPtr.Zero, Name, (int)Type); - } - - internal void AddChild(EvasObject obj) - { - _referenceHolder.Add(obj); - } - - internal void RemoveChild(EvasObject obj) - { - _referenceHolder.Remove(obj); - } - - static int[] ConvertDegreeArray(DisplayRotation value) - { - List rotations = new List(); - if (value.HasFlag(DisplayRotation.Degree_0)) - rotations.Add(0); - if (value.HasFlag(DisplayRotation.Degree_90)) - rotations.Add(90); - if (value.HasFlag(DisplayRotation.Degree_180)) - rotations.Add(180); - if (value.HasFlag(DisplayRotation.Degree_270)) - rotations.Add(270); - return rotations.ToArray(); - } - - static DisplayRotation ConvertToDisplayRotation(int[] values) - { - int orientation = 0; - foreach (int v in values) - { - orientation |= (1 << (v / 90)); - } - return (DisplayRotation)orientation; - } - } -} diff --git a/src/ElmSharp/ElmSharp/WrapType.cs b/src/ElmSharp/ElmSharp/WrapType.cs deleted file mode 100755 index 572579088..000000000 --- a/src/ElmSharp/ElmSharp/WrapType.cs +++ /dev/null @@ -1,44 +0,0 @@ -/* - * 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 ElmSharp -{ - /// - /// Enumeration for the wrap type. - /// - public enum WrapType - { - /// - /// No wrap. - /// - None = 0, - /// - /// Char wrap - wrap between characters. - /// - Char, - /// - /// Word wrap - wrap within the allowed wrapping points - /// (as defined in the unicode standard). - /// - Word, - /// - /// Mixed wrap - Word wrap, if that fails, char wrap. - /// - Mixed - } -} diff --git a/src/ElmSharp/Interop/Interop.Ecore.cs b/src/ElmSharp/Interop/Interop.Ecore.cs deleted file mode 100644 index 10e72d3bf..000000000 --- a/src/ElmSharp/Interop/Interop.Ecore.cs +++ /dev/null @@ -1,113 +0,0 @@ -/* - * 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 Ecore - { - internal enum PositionMap - { - Linear, - Accelerate, - Decelerate, - Sinusoidal, - AccelerateFactor, - DecelerateFactor, - SinusoidalFactor, - DivisorInterp, - Bounce, - Spring, - CubicBezier - } - - internal delegate void EcoreCallback(IntPtr data); - internal delegate bool EcoreTaskCallback(IntPtr data); - internal delegate void EcoreEventCallback(IntPtr data, int type, IntPtr evt); - internal delegate bool EcoreTimelineCallback(IntPtr data, double pos); - - [DllImport(Libraries.Ecore)] - internal static extern int ecore_init(); - - [DllImport(Libraries.Ecore)] - internal static extern int ecore_shutdown(); - - [DllImport(Libraries.Ecore)] - internal static extern void ecore_main_loop_begin(); - - [DllImport(Libraries.Ecore)] - internal static extern void ecore_main_loop_quit(); - - [DllImport(Libraries.Ecore)] - internal static extern bool ecore_main_loop_glib_integrate(); - - [DllImport(Libraries.Ecore)] - internal static extern IntPtr ecore_idler_add(EcoreTaskCallback callback, IntPtr data); - - [DllImport(Libraries.Ecore)] - internal static extern void ecore_main_loop_thread_safe_call_async(EcoreTaskCallback callback, IntPtr data); - - [DllImport(Libraries.Ecore)] - internal static extern IntPtr ecore_main_loop_thread_safe_call_sync(EcoreTaskCallback callback, IntPtr data); - - [DllImport(Libraries.Ecore)] - internal static extern IntPtr ecore_idler_del(IntPtr idler); - - [DllImport(Libraries.Ecore)] - internal static extern IntPtr ecore_timer_add(double interval, EcoreTaskCallback callback, IntPtr data); - - [DllImport(Libraries.Ecore)] - internal static extern IntPtr ecore_timer_del(IntPtr timer); - - [DllImport(Libraries.Ecore)] - internal static extern IntPtr ecore_animator_add(EcoreTaskCallback func, IntPtr data); - - [DllImport(Libraries.Ecore)] - internal static extern IntPtr ecore_animator_del(IntPtr animator); - - [DllImport(Libraries.Ecore)] - internal static extern double ecore_time_get(); - - [DllImport(Libraries.Ecore)] - internal static extern IntPtr ecore_event_handler_add(int type, EcoreEventCallback func, IntPtr data); - - [DllImport(Libraries.Ecore)] - internal static extern IntPtr ecore_event_handler_del(IntPtr handler); - - [DllImport(Libraries.Ecore)] - internal static extern IntPtr ecore_animator_timeline_add(double runtime, EcoreTimelineCallback func, IntPtr data); - - [DllImport(Libraries.Ecore)] - internal static extern void ecore_animator_freeze(IntPtr animator); - - [DllImport(Libraries.Ecore)] - internal static extern void ecore_animator_thaw(IntPtr animator); - - [DllImport(Libraries.Ecore)] - internal static extern void ecore_animator_frametime_set(double frametime); - - [DllImport(Libraries.Ecore)] - internal static extern void ecore_animator_frametime_get(); - - [DllImport(Libraries.Ecore)] - internal static extern double ecore_animator_pos_map(double pos, PositionMap map, double v1, double v2); - - [DllImport(Libraries.Ecore)] - internal static extern double ecore_animator_pos_map_n(double pos, PositionMap map, int v_size, double[] v); - } -} diff --git a/src/ElmSharp/Interop/Interop.Eext.Event.cs b/src/ElmSharp/Interop/Interop.Eext.Event.cs deleted file mode 100644 index 02420dc21..000000000 --- a/src/ElmSharp/Interop/Interop.Eext.Event.cs +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2017 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 Eext - { - public enum EextCallbackType - { - EEXT_CALLBACK_BACK, // H/W Back Key Event - EEXT_CALLBACK_MORE, // H/W More Key Event - } - internal delegate void EextEventCallback(IntPtr data, IntPtr obj, IntPtr info); - - [DllImport(Libraries.Eext)] - internal static extern void eext_object_event_callback_add(IntPtr obj, EextCallbackType type, EextEventCallback callback, IntPtr data); - - - [DllImport(Libraries.Eext)] - internal static extern void eext_object_event_callback_del(IntPtr obj, EextCallbackType type, EextEventCallback callback); - } -} diff --git a/src/ElmSharp/Interop/Interop.Eext.FloatingButton.cs b/src/ElmSharp/Interop/Interop.Eext.FloatingButton.cs deleted file mode 100755 index 7ecef6a23..000000000 --- a/src/ElmSharp/Interop/Interop.Eext.FloatingButton.cs +++ /dev/null @@ -1,48 +0,0 @@ -/* - * 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 Eext - { - [DllImport(Libraries.Eext)] - internal static extern IntPtr eext_floatingbutton_add(IntPtr parent); - - [DllImport(Libraries.Eext)] - internal static extern int eext_floatingbutton_mode_get(IntPtr floatingButton); - - [DllImport(Libraries.Eext)] - internal static extern void eext_floatingbutton_mode_set(IntPtr floatingButton, int mode); - - [DllImport(Libraries.Eext)] - internal static extern int eext_floatingbutton_pos_get(IntPtr floatingButton); - - [DllImport(Libraries.Eext)] - internal static extern bool eext_floatingbutton_pos_set(IntPtr floatingButton, int position); - - [DllImport(Libraries.Eext)] - internal static extern bool eext_floatingbutton_movement_block_get(IntPtr floatingButton); - - [DllImport(Libraries.Eext)] - internal static extern void eext_floatingbutton_movement_block_set(IntPtr floatingButton, bool block); - - [DllImport(Libraries.Eext)] - internal static extern bool eext_floatingbutton_pos_bring_in(IntPtr floatingButton, int posposition); - } -} \ No newline at end of file diff --git a/src/ElmSharp/Interop/Interop.Eina.cs b/src/ElmSharp/Interop/Interop.Eina.cs deleted file mode 100644 index 1051b5200..000000000 --- a/src/ElmSharp/Interop/Interop.Eina.cs +++ /dev/null @@ -1,28 +0,0 @@ -/* - * 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 Eina - { - [DllImport(Libraries.Eina)] - [return: MarshalAs(UnmanagedType.U1)] - internal static extern bool eina_main_loop_is(); - } -} diff --git a/src/ElmSharp/Interop/Interop.Elementary.Accessibility.cs b/src/ElmSharp/Interop/Interop.Elementary.Accessibility.cs deleted file mode 100644 index fc3bc6bb9..000000000 --- a/src/ElmSharp/Interop/Interop.Elementary.Accessibility.cs +++ /dev/null @@ -1,249 +0,0 @@ -/* - * 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 Elementary - { - internal enum Elm_Atspi_Relation_Type - { - ELM_ATSPI_RELATION_NULL, - ELM_ATSPI_RELATION_LABEL_FOR, - ELM_ATSPI_RELATION_LABELLED_BY, - ELM_ATSPI_RELATION_CONTROLLER_FOR, - ELM_ATSPI_RELATION_CONTROLLED_BY, - ELM_ATSPI_RELATION_MEMBER_OF, - ELM_ATSPI_RELATION_TOOLTIP_FOR, - ELM_ATSPI_RELATION_NODE_CHILD_OF, - ELM_ATSPI_RELATION_NODE_PARENT_OF, - ELM_ATSPI_RELATION_EXTENDED, - ELM_ATSPI_RELATION_FLOWS_TO, - ELM_ATSPI_RELATION_FLOWS_FROM, - ELM_ATSPI_RELATION_SUBWINDOW_OF, - ELM_ATSPI_RELATION_EMBEDS, - ELM_ATSPI_RELATION_EMBEDDED_BY, - ELM_ATSPI_RELATION_POPUP_FOR, - ELM_ATSPI_RELATION_PARENT_WINDOW_OF, - ELM_ATSPI_RELATION_DESCRIPTION_FOR, - ELM_ATSPI_RELATION_DESCRIBED_BY, - ELM_ATSPI_RELATION_LAST_DEFINED, - } - - internal enum Elm_Atspi_Role - { - ELM_ATSPI_ROLE_INVALID, - ELM_ATSPI_ROLE_ACCELERATOR_LABEL, - ELM_ATSPI_ROLE_ALERT, - ELM_ATSPI_ROLE_ANIMATION, - ELM_ATSPI_ROLE_ARROW, - ELM_ATSPI_ROLE_CALENDAR, - ELM_ATSPI_ROLE_CANVAS, - ELM_ATSPI_ROLE_CHECK_BOX, - ELM_ATSPI_ROLE_CHECK_MENU_ITEM, - ELM_ATSPI_ROLE_COLOR_CHOOSER, - ELM_ATSPI_ROLE_COLUMN_HEADER, - ELM_ATSPI_ROLE_COMBO_BOX, - ELM_ATSPI_ROLE_DATE_EDITOR, - ELM_ATSPI_ROLE_DESKTOP_ICON, - ELM_ATSPI_ROLE_DESKTOP_FRAME, - ELM_ATSPI_ROLE_DIAL, - ELM_ATSPI_ROLE_DIALOG, - ELM_ATSPI_ROLE_DIRECTORY_PANE, - ELM_ATSPI_ROLE_DRAWING_AREA, - ELM_ATSPI_ROLE_FILE_CHOOSER, - ELM_ATSPI_ROLE_FILLER, - ELM_ATSPI_ROLE_FOCUS_TRAVERSABLE, - ELM_ATSPI_ROLE_FONT_CHOOSER, - ELM_ATSPI_ROLE_FRAME, - ELM_ATSPI_ROLE_GLASS_PANE, - ELM_ATSPI_ROLE_HTML_CONTAINER, - ELM_ATSPI_ROLE_ICON, - ELM_ATSPI_ROLE_IMAGE, - ELM_ATSPI_ROLE_INTERNAL_FRAME, - ELM_ATSPI_ROLE_LABEL, - ELM_ATSPI_ROLE_LAYERED_PANE, - ELM_ATSPI_ROLE_LIST, - ELM_ATSPI_ROLE_LIST_ITEM, - ELM_ATSPI_ROLE_MENU, - ELM_ATSPI_ROLE_MENU_BAR, - ELM_ATSPI_ROLE_MENU_ITEM, - ELM_ATSPI_ROLE_OPTION_PANE, - ELM_ATSPI_ROLE_PAGE_TAB, - ELM_ATSPI_ROLE_PAGE_TAB_LIST, - ELM_ATSPI_ROLE_PANEL, - ELM_ATSPI_ROLE_PASSWORD_TEXT, - ELM_ATSPI_ROLE_POPUP_MENU, - ELM_ATSPI_ROLE_PROGRESS_BAR, - ELM_ATSPI_ROLE_PUSH_BUTTON, - ELM_ATSPI_ROLE_RADIO_BUTTON, - ELM_ATSPI_ROLE_RADIO_MENU_ITEM, - ELM_ATSPI_ROLE_ROOT_PANE, - ELM_ATSPI_ROLE_ROW_HEADER, - ELM_ATSPI_ROLE_SCROLL_BAR, - ELM_ATSPI_ROLE_SCROLL_PANE, - ELM_ATSPI_ROLE_SEPARATOR, - ELM_ATSPI_ROLE_SLIDER, - ELM_ATSPI_ROLE_SPIN_BUTTON, - ELM_ATSPI_ROLE_SPLIT_PANE, - ELM_ATSPI_ROLE_STATUS_BAR, - ELM_ATSPI_ROLE_TABLE, - ELM_ATSPI_ROLE_TABLE_CELL, - ELM_ATSPI_ROLE_TABLE_COLUMN_HEADER, - ELM_ATSPI_ROLE_TABLE_ROW_HEADER, - ELM_ATSPI_ROLE_TEAROFF_MENU_ITEM, - ELM_ATSPI_ROLE_TERMINAL, - ELM_ATSPI_ROLE_TEXT, - ELM_ATSPI_ROLE_TOGGLE_BUTTON, - ELM_ATSPI_ROLE_TOOL_BAR, - ELM_ATSPI_ROLE_TOOL_TIP, - ELM_ATSPI_ROLE_TREE, - ELM_ATSPI_ROLE_TREE_TABLE, - ELM_ATSPI_ROLE_UNKNOWN, - ELM_ATSPI_ROLE_VIEWPORT, - ELM_ATSPI_ROLE_WINDOW, - ELM_ATSPI_ROLE_EXTENDED, - ELM_ATSPI_ROLE_HEADER, - ELM_ATSPI_ROLE_FOOTER, - ELM_ATSPI_ROLE_PARAGRAPH, - ELM_ATSPI_ROLE_RULER, - ELM_ATSPI_ROLE_APPLICATION, - ELM_ATSPI_ROLE_AUTOCOMPLETE, - ELM_ATSPI_ROLE_EDITBAR, - ELM_ATSPI_ROLE_EMBEDDED, - ELM_ATSPI_ROLE_ENTRY, - ELM_ATSPI_ROLE_CHART, - ELM_ATSPI_ROLE_CAPTION, - ELM_ATSPI_ROLE_DOCUMENT_FRAME, - ELM_ATSPI_ROLE_HEADING, - ELM_ATSPI_ROLE_PAGE, - ELM_ATSPI_ROLE_SECTION, - ELM_ATSPI_ROLE_REDUNDANT_OBJECT, - ELM_ATSPI_ROLE_FORM, - ELM_ATSPI_ROLE_LINK, - ELM_ATSPI_ROLE_INPUT_METHOD_WINDOW, - ELM_ATSPI_ROLE_TABLE_ROW, - ELM_ATSPI_ROLE_TREE_ITEM, - ELM_ATSPI_ROLE_DOCUMENT_SPREADSHEET, - ELM_ATSPI_ROLE_DOCUMENT_PRESENTATION, - ELM_ATSPI_ROLE_DOCUMENT_TEXT, - ELM_ATSPI_ROLE_DOCUMENT_WEB, - ELM_ATSPI_ROLE_DOCUMENT_EMAIL, - ELM_ATSPI_ROLE_COMMENT, - ELM_ATSPI_ROLE_LIST_BOX, - ELM_ATSPI_ROLE_GROUPING, - ELM_ATSPI_ROLE_IMAGE_MAP, - ELM_ATSPI_ROLE_NOTIFICATION, - ELM_ATSPI_ROLE_INFO_BAR - } - - [Flags] - internal enum Elm_Accessible_Reading_Info_Type - { - ELM_ACCESSIBLE_READING_INFO_TYPE_NAME = 0x1, - ELM_ACCESSIBLE_READING_INFO_TYPE_ROLE = 0x2, - ELM_ACCESSIBLE_READING_INFO_TYPE_DESCRIPTION = 0x4, - ELM_ACCESSIBLE_READING_INFO_TYPE_STATE = 0x8 - } - - internal delegate void Elm_Atspi_Say_Signal_Cb(IntPtr data, string say_signal); - internal delegate string Elm_Atspi_Reading_Info_Cb(IntPtr data, IntPtr obj); - - [DllImport(Libraries.Elementary)] - [return: MarshalAs(UnmanagedType.U1)] - internal static extern bool elm_atspi_accessible_relationship_append(IntPtr obj, Elm_Atspi_Relation_Type type, IntPtr relationObj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_atspi_accessible_relationship_remove(IntPtr obj, Elm_Atspi_Relation_Type type, IntPtr relationObj); - - [DllImport(Libraries.Elementary)] - [return: MarshalAs(UnmanagedType.U1)] - internal static extern bool elm_atspi_accessible_relationship_append(IntPtr obj, int type, IntPtr relationObj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_atspi_accessible_relationship_remove(IntPtr obj, int type, IntPtr relationObj); - - [DllImport(Libraries.Elementary, EntryPoint = "elm_atspi_accessible_translation_domain_get")] - internal static extern IntPtr _elm_atspi_accessible_translation_domain_get(IntPtr obj); - - internal static string elm_atspi_accessible_translation_domain_get(IntPtr obj) - { - var str = _elm_atspi_accessible_translation_domain_get(obj); - return Marshal.PtrToStringAnsi(str); - } - - [DllImport(Libraries.Elementary)] - internal static extern void elm_atspi_accessible_translation_domain_set(IntPtr obj, string domain); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_atspi_accessible_name_set(IntPtr obj, string name); - - [DllImport(Libraries.Elementary, EntryPoint = "elm_atspi_accessible_name_get")] - internal static extern IntPtr _elm_atspi_accessible_name_get(IntPtr obj); - - internal static string elm_atspi_accessible_name_get(IntPtr obj) - { - var str = _elm_atspi_accessible_name_get(obj); - return Marshal.PtrToStringAnsi(str); - } - - [DllImport(Libraries.Elementary)] - internal static extern void elm_atspi_accessible_name_cb_set(IntPtr obj, Elm_Atspi_Reading_Info_Cb name_cb, IntPtr data); - - [DllImport(Libraries.Elementary)] - internal static extern Elm_Atspi_Role elm_atspi_accessible_role_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_atspi_accessible_role_set(IntPtr obj, Elm_Atspi_Role role); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_atspi_accessible_description_set(IntPtr obj, string description); - - [DllImport(Libraries.Elementary, EntryPoint = "elm_atspi_accessible_description_get")] - internal static extern IntPtr _elm_atspi_accessible_description_get(IntPtr obj); - internal static string elm_atspi_accessible_description_get(IntPtr obj) - { - var str = _elm_atspi_accessible_description_get(obj); - return Marshal.PtrToStringAnsi(str); - } - - [DllImport(Libraries.Elementary)] - internal static extern void elm_atspi_accessible_description_cb_set(IntPtr obj, Elm_Atspi_Reading_Info_Cb description_cb, IntPtr data); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_atspi_accessible_reading_info_type_set(IntPtr obj, Elm_Accessible_Reading_Info_Type reading_info); - - [DllImport(Libraries.Elementary)] - internal static extern int elm_atspi_accessible_reading_info_type_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_atspi_accessible_can_highlight_set(IntPtr obj, bool can_highlight); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_atspi_accessible_can_highlight_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_atspi_component_highlight_grab(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_atspi_component_highlight_clear(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_atspi_bridge_utils_say(string text, bool discardable, Elm_Atspi_Say_Signal_Cb func, IntPtr data); - } -} diff --git a/src/ElmSharp/Interop/Interop.Elementary.Bg.cs b/src/ElmSharp/Interop/Interop.Elementary.Bg.cs deleted file mode 100644 index 2f6f7327b..000000000 --- a/src/ElmSharp/Interop/Interop.Elementary.Bg.cs +++ /dev/null @@ -1,60 +0,0 @@ -/* - * 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 Elementary - { - public enum BackgroundOptions - { - Center, Scale, Stretch, Tile - } - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_bg_add(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_bg_color_set(IntPtr obj, int r, int g, int b); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_bg_color_get(IntPtr obj, out int r, out int g, out int b); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_bg_file_set(IntPtr obj, string file, IntPtr group); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_bg_file_get(IntPtr obj, out IntPtr file, IntPtr group); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_bg_option_set(IntPtr obj, BackgroundOptions option); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_bg_load_size_set(IntPtr obj, int w, int h); - - [DllImport(Libraries.Elementary)] - internal static extern BackgroundOptions elm_bg_option_get(IntPtr obj); - - internal static string BackgroundFileGet(IntPtr obj) - { - IntPtr file = IntPtr.Zero; - elm_bg_file_get(obj, out file, IntPtr.Zero); - return Marshal.PtrToStringAnsi(file); - } - } -} \ No newline at end of file diff --git a/src/ElmSharp/Interop/Interop.Elementary.Box.cs b/src/ElmSharp/Interop/Interop.Elementary.Box.cs deleted file mode 100644 index cb104a6a1..000000000 --- a/src/ElmSharp/Interop/Interop.Elementary.Box.cs +++ /dev/null @@ -1,94 +0,0 @@ -/* - * 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 Elementary - { - public delegate void BoxLayoutCallback(IntPtr obj, IntPtr priv, IntPtr userData); - - public delegate void BoxDataFreeCallback(IntPtr data); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_box_add(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_box_horizontal_set(IntPtr obj, bool horizontal); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_box_horizontal_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_box_pack_start(IntPtr obj, IntPtr subobj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_box_pack_end(IntPtr obj, IntPtr subobj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_box_pack_before(IntPtr obj, IntPtr subobj, IntPtr before); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_box_pack_after(IntPtr obj, IntPtr subobj, IntPtr after); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_box_unpack(IntPtr obj, IntPtr subobj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_box_unpack_all(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_box_align_set(IntPtr obj, double horizontal, double vertical); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_box_align_get(IntPtr obj, out double horizontal, out double vertical); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_box_align_get(IntPtr obj, IntPtr horizontal, out double vertical); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_box_align_get(IntPtr obj, out double horizontal, IntPtr vertical); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_box_children_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_box_clear(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_box_padding_set(IntPtr obj, int horizontal, int vertical); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_box_padding_get(IntPtr obj, out int horizontal, out int vertical); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_box_layout_set(IntPtr obj, BoxLayoutCallback cb, IntPtr data, BoxDataFreeCallback dataFreeCb); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_box_layout_set(IntPtr obj, BoxLayoutCallback cb, IntPtr data, IntPtr dataFreeCb); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_box_homogeneous_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_box_homogeneous_set(IntPtr obj, bool ishomogeneous); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_box_recalculate(IntPtr obj); - } -} \ No newline at end of file diff --git a/src/ElmSharp/Interop/Interop.Elementary.Button.cs b/src/ElmSharp/Interop/Interop.Elementary.Button.cs deleted file mode 100644 index 5d5279ffd..000000000 --- a/src/ElmSharp/Interop/Interop.Elementary.Button.cs +++ /dev/null @@ -1,78 +0,0 @@ -/* - * 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 Elementary - { - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_button_add(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_button_autorepeat_initial_timeout_set(IntPtr obj, double t); - - [DllImport(Libraries.Elementary)] - internal static extern double elm_button_autorepeat_initial_timeout_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_button_autorepeat_gap_timeout_set(IntPtr obj, double t); - - [DllImport(Libraries.Elementary)] - internal static extern double elm_button_autorepeat_gap_timeout_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_button_autorepeat_set(IntPtr obj, bool on); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_button_autorepeat_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_radio_add(IntPtr parent); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_radio_group_add(IntPtr obj, IntPtr group); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_radio_state_value_set(IntPtr obj, int value); - - [DllImport(Libraries.Elementary)] - internal static extern int elm_radio_state_value_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_radio_value_set(IntPtr obj, int value); - - [DllImport(Libraries.Elementary)] - internal static extern int elm_radio_value_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_radio_selected_object_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_check_add(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_check_state_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_check_state_set(IntPtr obj, bool value); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_check_state_pointer_set(IntPtr obj, bool value); - } -} diff --git a/src/ElmSharp/Interop/Interop.Elementary.CalendarView.cs b/src/ElmSharp/Interop/Interop.Elementary.CalendarView.cs deleted file mode 100644 index 688503570..000000000 --- a/src/ElmSharp/Interop/Interop.Elementary.CalendarView.cs +++ /dev/null @@ -1,108 +0,0 @@ -/* - * 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 Elementary - { - internal enum Elm_Calendar_Mark_Repeat_Type - { - ELM_CALENDAR_UNIQUE = 0, /* Default value. Marks will be displayed only on event day. */ - ELM_CALENDAR_DAILY, /* Marks will be displayed every day after event day (inclusive). */ - ELM_CALENDAR_WEEKLY, /* Marks will be displayed every week after event day (inclusive) */ - ELM_CALENDAR_MONTHLY, /* Marks will be displayed every month day that coincides to event day. */ - ELM_CALENDAR_ANNUALLY, /* Marks will be displayed every year that coincides to event day (and month). */ - LM_CALENDAR_LAST_DAY_OF_MONTH /* Marks will be displayed every last day of month after event day (inclusive). */ - }; - - internal enum Elm_Calendar_Select_Mode - { - ELM_CALENDAR_SELECT_MODE_DEFAULT = 0, /* Default value. a day is always selected. */ - ELM_CALENDAR_SELECT_MODE_ALWAYS, /* a day is always selected. */ - ELM_CALENDAR_SELECT_MODE_NONE, /* None of the days can be selected. */ - ELM_CALENDAR_SELECT_MODE_ONDEMAND /* User may have selected a day or not. */ - } - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_calendar_add(IntPtr parent); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_calendar_weekdays_names_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_calendar_weekdays_names_set(IntPtr obj, string[] weekdays); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_calendar_min_max_year_set(IntPtr obj, int min, int max); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_calendar_min_max_year_get(IntPtr obj, out int min, out int max); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_calendar_selected_time_set(IntPtr obj, ref Libc.SystemTime selectedtime); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_calendar_selected_time_get(IntPtr obj, ref Libc.SystemTime selectedtime); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_calendar_first_day_of_week_set(IntPtr obj, int day); - - [DllImport(Libraries.Elementary)] - internal static extern int elm_calendar_first_day_of_week_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_calendar_selectable_set(IntPtr obj, int SelectedField); - - [DllImport(Libraries.Elementary)] - internal static extern int elm_calendar_selectable_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_calendar_displayed_time_get(IntPtr obj, out Libc.SystemTime displayedtime); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_calendar_interval_set(IntPtr obj, double interval); - - [DllImport(Libraries.Elementary)] - internal static extern double elm_calendar_interval_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_calendar_select_mode_set(IntPtr obj, Elm_Calendar_Select_Mode mode); - - [DllImport(Libraries.Elementary)] - internal static extern int elm_calendar_select_mode_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_calendar_mark_add(IntPtr obj, string type, ref Libc.SystemTime date, Elm_Calendar_Mark_Repeat_Type repeatType); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_calendar_mark_del(IntPtr markItem); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_calendar_marks_draw(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_calendar_marks_clear(IntPtr obj); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate string Elm_Calendar_Format_Cb(Libc.SystemTime date); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_calendar_format_function_set(IntPtr obj, Elm_Calendar_Format_Cb format_function); - } -} \ No newline at end of file diff --git a/src/ElmSharp/Interop/Interop.Elementary.ColorPicker.cs b/src/ElmSharp/Interop/Interop.Elementary.ColorPicker.cs deleted file mode 100755 index 231fc9d93..000000000 --- a/src/ElmSharp/Interop/Interop.Elementary.ColorPicker.cs +++ /dev/null @@ -1,82 +0,0 @@ -/* - * 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 Elementary - { - - internal enum Elm_Colorselector_Mode - { - ELM_COLORSELECTOR_PALETTE = 0, /* Only color palette is displayed. */ - ELM_COLORSELECTOR_COMPONENTS, /* Only color selector is displayed. */ - ELM_COLORSELECTOR_BOTH, /* Both Palette and selector is displayed, default.*/ - ELM_COLORSELECTOR_PICKER, /* Only color picker is displayed. */ - ELM_COLORSELECTOR_ALL /* All possible color selector is displayed. */ - }; - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_colorselector_add(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_colorselector_color_set(IntPtr obj, int r, int g, int b, int a); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_colorselector_color_get(IntPtr obj, out int r, out int g, out int b, out int a); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_colorselector_palette_name_set(IntPtr obj, string name); - - [DllImport(Libraries.Elementary, EntryPoint = "elm_colorselector_palette_name_get", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true, CharSet = CharSet.Ansi)] - internal static extern IntPtr _elm_colorselector_palette_name_get(IntPtr obj); - internal static string elm_colorselector_palette_name_get(IntPtr obj) - { - var text = _elm_colorselector_palette_name_get(obj); - return Marshal.PtrToStringAnsi(text); - } - - [DllImport(Libraries.Elementary)] - internal static extern void elm_colorselector_mode_set(IntPtr obj, Elm_Colorselector_Mode mode); - - [DllImport(Libraries.Elementary)] - internal static extern Elm_Colorselector_Mode elm_colorselector_mode_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_colorselector_palette_color_add(IntPtr obj, int r, int g, int b, int a); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_colorselector_palette_clear(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_colorselector_palette_selected_item_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_colorselector_palette_item_color_get(IntPtr obj, out int r, out int g, out int b, out int a); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_colorselector_palette_item_color_set(IntPtr obj, int r, int g, int b, int a); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_colorselector_palette_item_selected_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_colorselector_palette_item_selected_set(IntPtr obj, bool selected); - - } -} diff --git a/src/ElmSharp/Interop/Interop.Elementary.CtxPopup.cs b/src/ElmSharp/Interop/Interop.Elementary.CtxPopup.cs deleted file mode 100644 index e2db4ba99..000000000 --- a/src/ElmSharp/Interop/Interop.Elementary.CtxPopup.cs +++ /dev/null @@ -1,66 +0,0 @@ -/* - * 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 Elementary - { - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_ctxpopup_add(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_ctxpopup_horizontal_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_ctxpopup_horizontal_set(IntPtr obj, bool horizontal); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_ctxpopup_auto_hide_disabled_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_ctxpopup_auto_hide_disabled_set(IntPtr obj, bool disabled); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_ctxpopup_hover_parent_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_ctxpopup_hover_parent_set(IntPtr obj, IntPtr parent); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_ctxpopup_direction_available_get(IntPtr obj, int direction); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_ctxpopup_direction_priority_set(IntPtr obj, int first, int second, int third, int fourth); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_ctxpopup_direction_priority_get(IntPtr obj, out int first, out int second, out int third, out int fourth); - - [DllImport(Libraries.Elementary)] - internal static extern int elm_ctxpopup_direction_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_ctxpopup_dismiss(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_ctxpopup_clear(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_ctxpopup_item_append(IntPtr obj, string label, IntPtr icon, Evas.SmartCallback func, IntPtr data); - } -} diff --git a/src/ElmSharp/Interop/Interop.Elementary.DateTimePicker.cs b/src/ElmSharp/Interop/Interop.Elementary.DateTimePicker.cs deleted file mode 100644 index a8bf333ba..000000000 --- a/src/ElmSharp/Interop/Interop.Elementary.DateTimePicker.cs +++ /dev/null @@ -1,80 +0,0 @@ -/* - * 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 Elementary - { - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_datetime_add(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_datetime_value_set(IntPtr obj, ref Libc.SystemTime newtime); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_datetime_value_get(IntPtr obj, ref Libc.SystemTime currtime); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_datetime_format_set(IntPtr obj, string format); - - [DllImport(Libraries.Elementary, EntryPoint = "elm_datetime_format_get")] - internal static extern IntPtr _elm_datetime_format_get(IntPtr obj); - - internal static string elm_datetime_format_get(IntPtr obj) - { - var format = _elm_datetime_format_get(obj); - return Marshal.PtrToStringAnsi(format); - } - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_datetime_value_max_set(IntPtr obj, ref Libc.SystemTime maxtime); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_datetime_value_max_get(IntPtr obj, ref Libc.SystemTime maxtime); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_datetime_value_min_set(IntPtr obj, ref Libc.SystemTime mintime); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_datetime_value_min_get(IntPtr obj, ref Libc.SystemTime mintime); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_datetime_field_limit_set(IntPtr obj, int type, int min, int max); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_datetime_field_limit_get(IntPtr obj, int type, out int min, out int max); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_datetime_field_visible_set(IntPtr obj, int type, bool visible); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_datetime_field_visible_get(IntPtr obj, int type); - - internal enum DateTimeFieldType - { - Year, - Month, - Date, - Hour, - Minute, - AmPm - } - } -} - diff --git a/src/ElmSharp/Interop/Interop.Elementary.Entry.cs b/src/ElmSharp/Interop/Interop.Elementary.Entry.cs deleted file mode 100644 index b858d5a44..000000000 --- a/src/ElmSharp/Interop/Interop.Elementary.Entry.cs +++ /dev/null @@ -1,401 +0,0 @@ -/* - * 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 Elementary - { - /// - /// Types of "Enter" keys available for different keyboards layout - /// - public enum ReturnKeyType - { - Default, - Done, - Go, - Join, - Login, - Next, - Search, - Send, - Signin - } - - public enum InputPanelLayout - { - Normal, - Number, - Email, - Url, - PhoneNumber, - Ip, - Month, - NumberOnly, - Invalid, - Hex, - Terminal, - Password, - DateTime, - Emoticon - } - - internal enum WrapType - { - None, - Char, - Word, - Mixed, - } - - internal enum AutocapitalType - { - None, - Word, - Sentence, - AllCharacter, - } - - internal enum InputHints - { - None, - AutoComplete, - SensitiveData, - } - - internal enum InputPanelLanguage - { - Automatic, - Alphabet, - } - - internal enum CopyAndPasteMode - { - Markup, - NoImage, - PlainText - } - - internal enum TextFormat - { - PlainUtf8, - MarkupUtf8 - } - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_entry_add(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_entry_editable_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_entry_editable_set(IntPtr obj, bool value); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_entry_single_line_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_entry_single_line_set(IntPtr obj, bool value); - - [DllImport(Libraries.Elementary, EntryPoint = "elm_entry_entry_get", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true, CharSet = CharSet.Ansi)] - internal static extern IntPtr _elm_entry_entry_get(IntPtr obj); - - internal static string elm_entry_entry_get(IntPtr obj) - { - var text = _elm_entry_entry_get(obj); - return Marshal.PtrToStringAnsi(text); - } - - [DllImport(Libraries.Elementary)] - internal static extern void elm_entry_entry_set(IntPtr obj, string value); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_entry_entry_append(IntPtr obj, string value); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_entry_entry_insert(IntPtr obj, string value); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_entry_file_get(IntPtr obj, out string file, out TextFormat format); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_entry_file_set(IntPtr obj, string file, TextFormat format); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_entry_file_save(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_entry_password_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_entry_password_set(IntPtr obj, bool value); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_entry_is_empty(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_entry_cursor_next(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_entry_cursor_prev(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_entry_cursor_up(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_entry_cursor_down(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_entry_cursor_begin_set(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_entry_cursor_end_set(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern string elm_entry_cursor_content_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_entry_cursor_line_begin_set(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_entry_cursor_line_end_set(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern int elm_entry_cursor_pos_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_entry_cursor_pos_set(IntPtr obj, int pos); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_entry_cursor_geometry_get(IntPtr obj, out int x, out int y, out int w, out int h); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_entry_cursor_is_format_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_entry_cursor_is_visible_format_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_entry_cursor_selection_begin(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_entry_cursor_selection_end(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern string elm_entry_markup_to_utf8(IntPtr text); - - [DllImport(Libraries.Elementary)] - internal static extern string elm_entry_markup_to_utf8(string text); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_entry_input_panel_show(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_entry_input_panel_enabled_set(IntPtr obj, bool enabled); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_entry_input_panel_enabled_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_entry_input_panel_return_key_type_set(IntPtr obj, ReturnKeyType keyType); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_entry_input_panel_layout_set(IntPtr obj, InputPanelLayout layout); - - [DllImport(Libraries.Elementary)] - internal static extern InputPanelLayout elm_entry_input_panel_layout_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_entry_select_all(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_entry_select_none(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_entry_text_style_user_pop(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_entry_text_style_user_push(IntPtr obj, string style); - - [DllImport(Libraries.Elementary, EntryPoint = "elm_entry_text_style_user_peek", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true, CharSet = CharSet.Ansi)] - internal static extern IntPtr _elm_entry_text_style_user_peek(IntPtr obj); - - internal static string elm_entry_text_style_user_peek(IntPtr obj) - { - var text = _elm_entry_text_style_user_peek(obj); - return Marshal.PtrToStringAnsi(text); - } - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_entry_scrollable_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_entry_scrollable_set(IntPtr obj, bool scroll); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_entry_input_panel_hide(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_entry_input_panel_imdata_set(IntPtr obj, IntPtr data, int len); - - [DllImport(Libraries.Elementary)] - internal static extern int elm_entry_input_panel_layout_variation_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_entry_input_panel_layout_variation_set(IntPtr obj, int variation); - - [DllImport(Libraries.Elementary)] - internal static extern WrapType elm_entry_line_wrap_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_entry_line_wrap_set(IntPtr obj, WrapType wrap); - - [DllImport(Libraries.Elementary)] - internal static extern AutocapitalType elm_entry_autocapital_type_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_entry_autocapital_type_set(IntPtr obj, AutocapitalType autoCapitalType); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_entry_autosave_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_entry_autosave_set(IntPtr obj, bool autosave); - - [DllImport(Libraries.Elementary)] - internal static extern CopyAndPasteMode elm_entry_cnp_mode_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_entry_cnp_mode_set(IntPtr obj, CopyAndPasteMode mode); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_entry_calc_force(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_entry_imf_context_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern InputHints elm_entry_input_hint_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_entry_input_hint_set(IntPtr obj, InputHints hints); - - [DllImport(Libraries.Elementary)] - internal static extern InputPanelLanguage elm_entry_input_panel_language_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_entry_input_panel_language_set(IntPtr obj, InputPanelLanguage lang); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_entry_input_panel_return_key_disabled_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_entry_input_panel_return_key_disabled_set(IntPtr obj, bool disabled); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_entry_input_panel_return_key_autoenabled_set(IntPtr obj, bool enabled); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_entry_input_panel_show_on_demand_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_entry_input_panel_show_on_demand_set(IntPtr obj, bool onDemand); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_entry_markup_filter_append(IntPtr obj, Elm_Entry_Filter_Cb func, IntPtr data); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_entry_markup_filter_prepend(IntPtr obj, Elm_Entry_Filter_Cb func, IntPtr data); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_entry_markup_filter_remove(IntPtr obj, Elm_Entry_Filter_Cb func, IntPtr data); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_entry_prediction_allow_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_entry_prediction_allow_set(IntPtr obj, bool prediction); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_entry_select_allow_set(IntPtr obj, bool allow); - - [DllImport(Libraries.Elementary)] - internal static extern string elm_entry_utf8_to_markup(string str); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void Elm_Entry_Filter_Cb(IntPtr data, IntPtr obj, ref IntPtr text); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_entry_anchor_hover_parent_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_entry_anchor_hover_parent_set(IntPtr obj, IntPtr parent); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_entry_anchor_hover_end(IntPtr obj); - - [DllImport(Libraries.Elementary, EntryPoint = "elm_entry_anchor_hover_style_get")] - internal static extern IntPtr _elm_entry_anchor_hover_style_get(IntPtr obj); - - internal static string elm_entry_anchor_hover_style_get(IntPtr obj) - { - return Marshal.PtrToStringAnsi(_elm_entry_anchor_hover_style_get(obj)); - } - - [DllImport(Libraries.Elementary)] - internal static extern void elm_entry_anchor_hover_style_set(IntPtr obj, string style); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_entry_icon_visible_set(IntPtr obj, bool setting); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate IntPtr Elm_Entry_Item_Provider_Cb(IntPtr data, IntPtr entry, string text); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_entry_item_provider_append(IntPtr obj, Elm_Entry_Item_Provider_Cb func, IntPtr data); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_entry_item_provider_prepend(IntPtr obj, Elm_Entry_Item_Provider_Cb func, IntPtr data); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_entry_item_provider_remove(IntPtr obj, Elm_Entry_Item_Provider_Cb func, IntPtr data); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_entry_selection_copy(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_entry_selection_cut(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_entry_selection_paste(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_entry_selection_handler_disabled_set(IntPtr obj, bool disabled); - - [DllImport(Libraries.Elementary, EntryPoint = "elm_entry_selection_get")] - internal static extern IntPtr _elm_entry_selection_get(IntPtr obj); - - internal static string elm_entry_selection_get(IntPtr obj) - { - return Marshal.PtrToStringAnsi(_elm_entry_selection_get(obj)); - } - - [DllImport(Libraries.Elementary)] - internal static extern void elm_entry_select_region_set(IntPtr obj, int start, int end); - } -} \ No newline at end of file diff --git a/src/ElmSharp/Interop/Interop.Elementary.FlipSelector.cs b/src/ElmSharp/Interop/Interop.Elementary.FlipSelector.cs deleted file mode 100644 index 976857167..000000000 --- a/src/ElmSharp/Interop/Interop.Elementary.FlipSelector.cs +++ /dev/null @@ -1,54 +0,0 @@ -/* - * 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 Elementary - { - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_flipselector_add(IntPtr parent); - - [DllImport(Libraries.Elementary)] - internal static extern double elm_flipselector_first_interval_get(IntPtr flipSelector); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_flipselector_first_interval_set(IntPtr flipSelector, double interval); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_flipselector_item_append(IntPtr flipSelector, string text, Evas.SmartCallback func, IntPtr data); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_flipselector_item_prepend(IntPtr flipSelector, string text, Evas.SmartCallback func, IntPtr data); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_flipselector_flip_next(IntPtr flipSelector); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_flipselector_flip_prev(IntPtr flipSelector); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_flipselector_selected_item_get(IntPtr flipSelector); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_flipselector_first_item_get(IntPtr flipSelector); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_flipselector_last_item_get(IntPtr flipSelector); - } -} diff --git a/src/ElmSharp/Interop/Interop.Elementary.GenGridView.cs b/src/ElmSharp/Interop/Interop.Elementary.GenGridView.cs deleted file mode 100644 index b9acd01a2..000000000 --- a/src/ElmSharp/Interop/Interop.Elementary.GenGridView.cs +++ /dev/null @@ -1,207 +0,0 @@ -/* - * 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 Elementary - { - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_gengrid_add(IntPtr parent); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_gengrid_align_set(IntPtr obj, double align_x, double align_y); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_gengrid_align_get(IntPtr obj, out double align_x, out double align_y); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_gengrid_align_get(IntPtr obj, IntPtr align_x, out double align_y); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_gengrid_align_get(IntPtr obj, out double align_x, IntPtr align_y); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_gengrid_horizontal_set(IntPtr obj, bool horizontal); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_gengrid_horizontal_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_gengrid_multi_select_set(IntPtr obj, bool multi); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_gengrid_multi_select_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_gengrid_item_append(IntPtr obj, IntPtr itc, IntPtr data, Evas.SmartCallback func, IntPtr func_data); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_gengrid_item_prepend(IntPtr obj, IntPtr itc, IntPtr data, Evas.SmartCallback func, IntPtr func_data); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_gengrid_item_insert_before(IntPtr obj, IntPtr itc, IntPtr data, IntPtr before, Evas.SmartCallback func, IntPtr func_data); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_gengrid_item_insert_after(IntPtr obj, IntPtr itc, IntPtr data, IntPtr after, Evas.SmartCallback func, IntPtr func_data); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_gengrid_item_class_new(); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_gengrid_item_size_set(IntPtr obj, int w, int h); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_gengrid_item_size_get(IntPtr obj, out int w, out int h); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_gengrid_item_size_get(IntPtr obj, IntPtr w, out int h); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_gengrid_item_size_get(IntPtr obj, out int w, IntPtr h); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_gengrid_filled_set(IntPtr obj, bool fill); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_gengrid_filled_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern int elm_gengrid_item_index_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_gengrid_clear(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_gengrid_item_selected_set(IntPtr obj, bool selected); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_gengrid_item_selected_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern uint elm_gengrid_items_count(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_gengrid_highlight_mode_set(IntPtr obj, bool highlight); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_gengrid_highlight_mode_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_gengrid_item_show(IntPtr obj, int type); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_gengrid_item_bring_in(IntPtr obj, int type); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_gengrid_item_select_mode_set(IntPtr it, Elm_Object_Select_Mode mode); - - [DllImport(Libraries.Elementary)] - internal static extern Elm_Object_Select_Mode elm_gengrid_item_select_mode_get(IntPtr it); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_gengrid_select_mode_set(IntPtr it, int mode); - - [DllImport(Libraries.Elementary)] - internal static extern int elm_gengrid_select_mode_get(IntPtr it); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_gengrid_realized_items_update(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_gengrid_item_update(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_gengrid_at_xy_item_get(IntPtr obj, int x, int y, out int xposret, out int yposret); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_gengrid_selected_item_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_gengrid_first_item_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_gengrid_item_class_free(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_gengrid_last_item_get(IntPtr obj); - - [DllImport(Libraries.Elementary, EntryPoint = "elm_gengrid_item_cursor_get")] - internal static extern IntPtr _elm_gengrid_item_cursor_get(IntPtr obj); - - internal static string elm_gengrid_item_cursor_get(IntPtr obj) - { - return Marshal.PtrToStringAnsi(_elm_gengrid_item_cursor_get(obj)); - } - - [DllImport(Libraries.Elementary)] - internal static extern void elm_gengrid_item_cursor_set(IntPtr obj, string cursor); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_gengrid_item_cursor_unset(IntPtr obj); - - [DllImport(Libraries.Elementary, EntryPoint = "elm_gengrid_item_cursor_style_get")] - internal static extern IntPtr _elm_gengrid_item_cursor_style_get(IntPtr obj); - - internal static string elm_gengrid_item_cursor_style_get(IntPtr obj) - { - return Marshal.PtrToStringAnsi(_elm_gengrid_item_cursor_style_get(obj)); - } - - [DllImport(Libraries.Elementary)] - internal static extern void elm_gengrid_item_cursor_style_set(IntPtr obj, string cursor); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_gengrid_item_cursor_engine_only_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_gengrid_item_cursor_engine_only_set(IntPtr obj, bool engine); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_gengrid_item_tooltip_text_set(IntPtr obj, string text); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_gengrid_item_tooltip_unset(IntPtr obj); - - [DllImport(Libraries.Elementary, EntryPoint = "elm_gengrid_item_tooltip_style_get")] - internal static extern IntPtr _elm_gengrid_item_tooltip_style_get(IntPtr obj); - - internal static string elm_gengrid_item_tooltip_style_get(IntPtr obj) - { - return Marshal.PtrToStringAnsi(_elm_gengrid_item_tooltip_style_get(obj)); - } - - [DllImport(Libraries.Elementary)] - internal static extern void elm_gengrid_item_tooltip_style_set(IntPtr obj, string style); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_gengrid_reorder_mode_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_gengrid_reorder_mode_set(IntPtr obj, bool mode); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_gengrid_item_pos_get(IntPtr obj, out int row, out int column); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_gengrid_item_sorted_insert(IntPtr obj, IntPtr itc, IntPtr data, Eina_Compare_Cb compare, Evas.SmartCallback func, IntPtr funcData); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_gengrid_item_tooltip_content_cb_set(IntPtr obj, Elm_Tooltip_Item_Content_Cb func, IntPtr funcData, Evas.SmartCallback deleteFunc); - } -} \ No newline at end of file diff --git a/src/ElmSharp/Interop/Interop.Elementary.GenListView.cs b/src/ElmSharp/Interop/Interop.Elementary.GenListView.cs deleted file mode 100644 index bfb326f0f..000000000 --- a/src/ElmSharp/Interop/Interop.Elementary.GenListView.cs +++ /dev/null @@ -1,262 +0,0 @@ -/* - * 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 Elementary - { - internal enum Elm_Genlist_Item_Scrollto_Type - { - ELM_GENLIST_ITEM_SCROLLTO_NONE = 0, - - // Scrolls to nowhere - ELM_GENLIST_ITEM_SCROLLTO_IN = (1 << 0), - - // Scrolls to the nearest viewport - ELM_GENLIST_ITEM_SCROLLTO_TOP = (1 << 1), - - // Scrolls to the top of the viewport - ELM_GENLIST_ITEM_SCROLLTO_MIDDLE = (1 << 2), - - // Scrolls to the middle of the viewport - ELM_GENLIST_ITEM_SCROLLTO_BOTTOM = (1 << 3) - - // Scrolls to the bottom of the viewport - } - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void Evas_Smart_Cb(IntPtr data, IntPtr obj, IntPtr eventInfo); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_genlist_add(IntPtr parent); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_genlist_mode_set(IntPtr obj, int mode); - - [DllImport(Libraries.Elementary)] - internal static extern int elm_genlist_mode_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_genlist_select_mode_set(IntPtr obj, int mode); - - [DllImport(Libraries.Elementary)] - internal static extern int elm_genlist_select_mode_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_genlist_item_append(IntPtr obj, IntPtr itc, IntPtr data, IntPtr parent, int type, Evas.SmartCallback func, IntPtr func_data); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_genlist_item_prepend(IntPtr obj, IntPtr itc, IntPtr data, IntPtr parent, int type, Evas.SmartCallback func, IntPtr func_data); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_genlist_item_insert_before(IntPtr obj, IntPtr itc, IntPtr data, IntPtr parent, IntPtr before, int type, Evas.SmartCallback func, IntPtr func_data); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_genlist_item_class_new(); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_genlist_item_class_free(IntPtr itemClass); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_genlist_block_count_set(IntPtr obj, int count); - - [DllImport(Libraries.Elementary)] - internal static extern int elm_genlist_block_count_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_genlist_homogeneous_set(IntPtr obj, bool homogeneous); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_genlist_homogeneous_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern int elm_genlist_item_index_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern int elm_genlist_item_type_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_genlist_item_parent_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_genlist_realized_items_update(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_genlist_item_update(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_genlist_item_show(IntPtr item, Elm_Genlist_Item_Scrollto_Type type); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_genlist_item_bring_in(IntPtr item, Elm_Genlist_Item_Scrollto_Type type); - - [DllImport(Libraries.Elementary)] - internal static extern int elm_genlist_items_count(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_genlist_first_item_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_genlist_last_item_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_genlist_item_next_get(IntPtr item); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_genlist_item_prev_get(IntPtr item); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_genlist_item_selected_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_genlist_item_selected_set(IntPtr obj, bool selected); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_genlist_item_select_mode_set(IntPtr obj, Elm_Object_Select_Mode mode); - - [DllImport(Libraries.Elementary)] - internal static extern Elm_Object_Select_Mode elm_genlist_item_select_mode_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_genlist_item_item_class_update(IntPtr obj, IntPtr itc); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_genlist_clear(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_genlist_item_fields_update(IntPtr item, string part, uint type); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_genlist_reorder_mode_set(IntPtr obj, bool mode); - - [DllImport(Libraries.Elementary)] - [return: MarshalAs(UnmanagedType.U1)] - internal static extern bool elm_genlist_reorder_mode_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - [return: MarshalAs(UnmanagedType.U1)] - internal static extern void elm_genlist_item_expanded_set(IntPtr obj, bool isExpanded); - - [DllImport(Libraries.Elementary)] - [return: MarshalAs(UnmanagedType.U1)] - internal static extern bool elm_genlist_item_expanded_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_genlist_highlight_mode_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_genlist_highlight_mode_set(IntPtr obj, bool highlight); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_genlist_at_xy_item_get(IntPtr obj, int x, int y, out int posret); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_genlist_item_insert_after(IntPtr obj, IntPtr itc, IntPtr data, IntPtr parent, IntPtr after, int type, Evas.SmartCallback func, IntPtr func_data); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_genlist_item_item_class_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern double elm_genlist_longpress_timeout_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_genlist_longpress_timeout_set(IntPtr obj, double timeout); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_genlist_multi_select_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_genlist_multi_select_set(IntPtr obj, bool multi); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_genlist_nth_item_get(IntPtr obj, int nth); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_genlist_selected_item_get(IntPtr obj); - - [DllImport(Libraries.Elementary, EntryPoint = "elm_genlist_item_cursor_get")] - internal static extern IntPtr _elm_genlist_item_cursor_get(IntPtr obj); - - internal static string elm_genlist_item_cursor_get(IntPtr obj) - { - return Marshal.PtrToStringAnsi(_elm_genlist_item_cursor_get(obj)); - } - - [DllImport(Libraries.Elementary)] - internal static extern void elm_genlist_item_cursor_set(IntPtr obj, string cursor); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_genlist_item_cursor_unset(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_genlist_item_cursor_engine_only_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_genlist_item_cursor_engine_only_set(IntPtr obj, bool engineOnly); - - [DllImport(Libraries.Elementary, EntryPoint = "elm_genlist_item_cursor_style_get")] - internal static extern IntPtr _elm_genlist_item_cursor_style_get(IntPtr obj); - - internal static string elm_genlist_item_cursor_style_get(IntPtr obj) - { - return Marshal.PtrToStringAnsi(_elm_genlist_item_cursor_style_get(obj)); - } - - [DllImport(Libraries.Elementary)] - internal static extern void elm_genlist_item_cursor_style_set(IntPtr obj, string style); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_genlist_item_demote(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern int elm_genlist_item_expanded_depth_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_genlist_item_subitems_clear(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_genlist_item_tooltip_text_set(IntPtr obj, string text); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_genlist_item_tooltip_unset(IntPtr obj); - - [DllImport(Libraries.Elementary, EntryPoint = "elm_genlist_item_tooltip_style_get")] - internal static extern IntPtr _elm_genlist_item_tooltip_style_get(IntPtr obj); - - internal static string elm_genlist_item_tooltip_style_get(IntPtr obj) - { - return Marshal.PtrToStringAnsi(_elm_genlist_item_tooltip_style_get(obj)); - } - - [DllImport(Libraries.Elementary)] - internal static extern void elm_genlist_item_tooltip_style_set(IntPtr obj, string style); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_genlist_item_tooltip_window_mode_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_genlist_item_tooltip_window_mode_set(IntPtr obj, bool disable); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_genlist_item_sorted_insert(IntPtr obj, IntPtr itc, IntPtr data, IntPtr parent, int type, Eina_Compare_Cb compare, Evas.SmartCallback func, IntPtr funcData); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_genlist_item_tooltip_content_cb_set(IntPtr obj, Elm_Tooltip_Item_Content_Cb func, IntPtr funcData, Evas.SmartCallback deleteFunc); - } -} \ No newline at end of file diff --git a/src/ElmSharp/Interop/Interop.Elementary.GestureLayer.cs b/src/ElmSharp/Interop/Interop.Elementary.GestureLayer.cs deleted file mode 100644 index 369eba10a..000000000 --- a/src/ElmSharp/Interop/Interop.Elementary.GestureLayer.cs +++ /dev/null @@ -1,138 +0,0 @@ -/* - * 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 Elementary - { - public delegate void GestureEventCallback(IntPtr data, IntPtr event_info); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_gesture_layer_add(IntPtr parent); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_gesture_layer_attach(IntPtr obj, IntPtr target); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_gesture_layer_zoom_step_set(IntPtr obj, double step); - - [DllImport(Libraries.Elementary)] - internal static extern double elm_gesture_layer_zoom_step_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_gesture_layer_tap_finger_size_set(IntPtr obj, int sz); - - [DllImport(Libraries.Elementary)] - internal static extern int elm_gesture_layer_tap_finger_size_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_gesture_layer_hold_events_set(IntPtr obj, bool hold_events); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_gesture_layer_hold_events_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_gesture_layer_rotate_step_set(IntPtr obj, double step); - - [DllImport(Libraries.Elementary)] - internal static extern double elm_gesture_layer_rotate_step_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_gesture_layer_cb_set(IntPtr obj, ElmSharp.GestureLayer.GestureType idx, ElmSharp.GestureLayer.GestureState cb_type, GestureEventCallback cb, IntPtr data); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_gesture_layer_line_min_length_set(IntPtr obj, int line_min_length); - - [DllImport(Libraries.Elementary)] - internal static extern int elm_gesture_layer_line_min_length_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_gesture_layer_zoom_distance_tolerance_set(IntPtr obj, int zoom_distance_tolerance); - - [DllImport(Libraries.Elementary)] - internal static extern int elm_gesture_layer_zoom_distance_tolerance_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_gesture_layer_line_distance_tolerance_set(IntPtr obj, int line_distance_tolerance); - - [DllImport(Libraries.Elementary)] - internal static extern int elm_gesture_layer_line_distance_tolerance_get (IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_gesture_layer_line_angular_tolerance_set(IntPtr obj, double line_angular_tolerance); - - [DllImport(Libraries.Elementary)] - internal static extern double elm_gesture_layer_line_angular_tolerance_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_gesture_layer_zoom_wheel_factor_set(IntPtr obj, double zoom_wheel_factor); - - [DllImport(Libraries.Elementary)] - internal static extern double elm_gesture_layer_zoom_wheel_factor_get (IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_gesture_layer_zoom_finger_factor_set (IntPtr obj, double zoom_finger_factor); - - [DllImport(Libraries.Elementary)] - internal static extern double elm_gesture_layer_zoom_finger_factor_get (IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_gesture_layer_rotate_angular_tolerance_set (IntPtr obj, double rotate_angular_tolerance); - - [DllImport(Libraries.Elementary)] - internal static extern double elm_gesture_layer_rotate_angular_tolerance_get (IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_gesture_layer_flick_time_limit_ms_set (IntPtr obj, UInt32 flick_time_limit_ms); - - [DllImport(Libraries.Elementary)] - internal static extern UInt32 elm_gesture_layer_flick_time_limit_ms_get (IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_gesture_layer_long_tap_start_timeout_set(IntPtr obj, double long_tap_start_timeout); - - [DllImport(Libraries.Elementary)] - internal static extern double elm_gesture_layer_long_tap_start_timeout_get (IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_gesture_layer_continues_enable_set(IntPtr obj, bool continues_enable); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_gesture_layer_continues_enable_get (IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_gesture_layer_double_tap_timeout_set (IntPtr obj, double double_tap_timeout); - - [DllImport(Libraries.Elementary)] - internal static extern double elm_gesture_layer_double_tap_timeout_get (IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern double elm_config_glayer_long_tap_start_timeout_get (); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_config_glayer_long_tap_start_timeout_set(double long_tap_timeout); - - [DllImport(Libraries.Elementary)] - internal static extern double elm_config_glayer_double_tap_timeout_get(); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_config_glayer_double_tap_timeout_set(double double_tap_timeout); - } -} - diff --git a/src/ElmSharp/Interop/Interop.Elementary.Hoversel.cs b/src/ElmSharp/Interop/Interop.Elementary.Hoversel.cs deleted file mode 100755 index ca8cefe98..000000000 --- a/src/ElmSharp/Interop/Interop.Elementary.Hoversel.cs +++ /dev/null @@ -1,67 +0,0 @@ -/* - * 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 Elementary - { - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_hoversel_add(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_hoversel_horizontal_set(IntPtr obj, bool horizontal); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_hoversel_horizontal_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_hoversel_hover_parent_set(IntPtr obj, IntPtr parent); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_hoversel_hover_parent_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_hoversel_expanded_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_hoversel_auto_update_set(IntPtr obj, bool auto_update); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_hoversel_auto_update_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_hoversel_hover_begin(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_hoversel_clear(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_hoversel_hover_end(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_hoversel_item_add(IntPtr obj, string label, string icon_file, int icon_type, Evas.SmartCallback func, IntPtr data); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_hoversel_item_icon_set(IntPtr obj, string icon_file, string icon_group, int icon_type); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_hoversel_item_icon_get(IntPtr obj, out string icon_file, out string icon_group, int icon_type); - } -} - diff --git a/src/ElmSharp/Interop/Interop.Elementary.Image.cs b/src/ElmSharp/Interop/Interop.Elementary.Image.cs deleted file mode 100644 index c49ff92b0..000000000 --- a/src/ElmSharp/Interop/Interop.Elementary.Image.cs +++ /dev/null @@ -1,142 +0,0 @@ -/* - * 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 Elementary - { - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_image_add(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_image_async_open_set(IntPtr obj, bool async); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_image_object_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_image_object_size_get(IntPtr obj, out int w, out int h); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_image_preload_disabled_set(IntPtr obj, bool disabled); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_image_file_set(IntPtr obj, string file, string group); - - [DllImport(Libraries.Elementary, EntryPoint = "elm_image_file_get")] - internal static extern void _elm_image_file_get(IntPtr obj, out IntPtr file, out IntPtr group); - internal static string elm_image_file_get(IntPtr obj) - { - IntPtr file; - IntPtr group; - _elm_image_file_get(obj, out file, out group); - return Marshal.PtrToStringAnsi(file); - } - - [DllImport(Libraries.Elementary)] - internal static unsafe extern bool elm_image_memfile_set(IntPtr obj, byte* img, long size, IntPtr format, IntPtr key); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_image_smooth_set(IntPtr obj, bool smooth); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_image_smooth_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_image_resizable_set(IntPtr obj, bool up, bool down); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_image_resizable_get(IntPtr obj, out bool up, out bool down); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_image_no_scale_set(IntPtr obj, bool no_scale); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_image_no_scale_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_image_aspect_fixed_set(IntPtr obj, bool value); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_image_aspect_fixed_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_image_fill_outside_set(IntPtr obj, bool fill_outside); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_image_fill_outside_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_image_animated_available_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_image_animated_set(IntPtr obj, bool anim); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_image_animated_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_image_animated_play_set(IntPtr obj, bool play); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_image_animated_play_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_image_prescale_set(IntPtr obj, int size); - - [DllImport(Libraries.Elementary)] - internal static extern int elm_image_prescale_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_image_editable_set(IntPtr obj, bool set); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_image_editable_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern int elm_image_orient_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_image_orient_set(IntPtr obj, int orient); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_icon_add(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_icon_standard_set(IntPtr obj, string name); - - [DllImport(Libraries.Elementary, EntryPoint = "elm_icon_standard_get", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true, CharSet = CharSet.Ansi)] - internal static extern IntPtr _elm_icon_standard_get(IntPtr obj); - internal static string elm_icon_standard_get(IntPtr obj) - { - var text = _elm_icon_standard_get(obj); - return Marshal.PtrToStringAnsi(text); - } - - [DllImport(Libraries.Elementary)] - internal static extern void elm_icon_thumb_set(IntPtr obj, string file, string group); - - [DllImport(Libraries.Elementary)] - internal static extern int elm_icon_order_lookup_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_icon_order_lookup_set(IntPtr obj, int order); - } -} - diff --git a/src/ElmSharp/Interop/Interop.Elementary.Index.cs b/src/ElmSharp/Interop/Interop.Elementary.Index.cs deleted file mode 100644 index f2ecacd2b..000000000 --- a/src/ElmSharp/Interop/Interop.Elementary.Index.cs +++ /dev/null @@ -1,103 +0,0 @@ -/* - * 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 Elementary - { - internal delegate void EventCallback(IntPtr data, IntPtr obj, IntPtr info); - - internal delegate void SmartCallback(IntPtr data, IntPtr obj, IntPtr info); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_index_add(IntPtr parent); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_index_autohide_disabled_get(IntPtr index); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_index_autohide_disabled_set(IntPtr index, bool disabled); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_index_horizontal_get(IntPtr index); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_index_horizontal_set(IntPtr index, bool horizontal); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_index_item_append(IntPtr index, string text, EventCallback callback, IntPtr data); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_index_item_prepend(IntPtr index, string text, EventCallback callback, IntPtr data); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_index_selected_item_get(IntPtr index, int level); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_index_item_selected_set(IntPtr item, bool selected); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_index_level_go(IntPtr index, int level); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_index_indicator_disabled_get(IntPtr index); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_index_indicator_disabled_set(IntPtr index, bool disabled); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_index_omit_enabled_get(IntPtr index); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_index_omit_enabled_set(IntPtr index, bool enabled); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_index_item_insert_before(IntPtr obj, IntPtr before, string letter, EventCallback func, IntPtr data); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_index_item_sorted_insert(IntPtr obj, string letter, Evas_Smart_Cb func, IntPtr data, Eina_Compare_Cb cmpFunc, Eina_Compare_Cb cmpDataFunc); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_index_delay_change_time_set(IntPtr obj, double time); - - [DllImport(Libraries.Elementary)] - internal static extern double elm_index_delay_change_time_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_index_item_clear(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_index_item_find(IntPtr obj, IntPtr data); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_index_item_insert_after(IntPtr obj, IntPtr after, string letter, SmartCallback func, IntPtr data); - - [DllImport(Libraries.Elementary)] - internal static extern int elm_index_item_level_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_index_item_level_set(IntPtr obj, int level); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_index_standard_priority_set(IntPtr obj, int priority); - - [DllImport(Libraries.Elementary)] - internal static extern int elm_index_standard_priority_get(IntPtr obj); - } -} \ No newline at end of file diff --git a/src/ElmSharp/Interop/Interop.Elementary.Item.cs b/src/ElmSharp/Interop/Interop.Elementary.Item.cs deleted file mode 100644 index 0d516ec6a..000000000 --- a/src/ElmSharp/Interop/Interop.Elementary.Item.cs +++ /dev/null @@ -1,116 +0,0 @@ -/* - * 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 Elementary - { - [DllImport(Libraries.Elementary)] - internal static extern void elm_object_item_part_content_set(IntPtr obj, string part, IntPtr content); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_object_item_part_content_unset(IntPtr obj, string part); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_object_item_part_content_set(IntPtr obj, IntPtr part, IntPtr content); - - [DllImport(Libraries.Elementary, EntryPoint = "elm_object_item_part_text_get", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true, CharSet = CharSet.Ansi)] - internal static extern IntPtr _elm_object_item_part_text_get(IntPtr obj, string part); - - internal static string elm_object_item_part_text_get(IntPtr obj, string part) - { - var text = _elm_object_item_part_text_get(obj, part); - return Marshal.PtrToStringAnsi(text); - } - - [DllImport(Libraries.Elementary)] - internal static extern void elm_object_item_color_class_color_set(IntPtr it, string part, int r, int g, int b, int a); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_object_item_color_class_color_get(IntPtr obj, string part, out int r, out int g, out int b, out int a); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_object_item_color_class_del(IntPtr obj, string part); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_object_item_part_text_set(IntPtr obj, string part, string label); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_object_item_part_text_set(IntPtr obj, IntPtr part, string label); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_object_item_data_get(IntPtr it); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_object_item_data_set(IntPtr it, IntPtr data); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_object_item_del(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_object_item_del_cb_set(IntPtr obj, Interop.Evas.SmartCallback callback); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_object_item_disabled_set(IntPtr obj, bool disable); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_object_item_disabled_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_object_item_part_content_get(IntPtr obj, string part); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_object_item_access_object_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_object_item_access_unregister(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_object_item_track(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_object_item_untrack(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_object_item_widget_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_object_item_signal_emit(IntPtr obj, string emission, string source); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_object_item_signal_callback_add(IntPtr obj, string emission, string source, Elm_Object_Item_Signal_Cb func, IntPtr data); - - [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); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool Elm_Object_Item_Signal_Cb(IntPtr data, IntPtr item, string emission, string source); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate IntPtr Elm_Tooltip_Item_Content_Cb(IntPtr data, IntPtr obj, IntPtr tooltip, IntPtr item); - - internal enum Elm_Object_Select_Mode - { - ELM_OBJECT_SELECT_MODE_DEFAULT, - ELM_OBJECT_SELECT_MODE_ALWAYS, - ELM_OBJECT_SELECT_MODE_NONE, - ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY - } - } -} \ No newline at end of file diff --git a/src/ElmSharp/Interop/Interop.Elementary.Label.cs b/src/ElmSharp/Interop/Interop.Elementary.Label.cs deleted file mode 100755 index bf5c2d5fc..000000000 --- a/src/ElmSharp/Interop/Interop.Elementary.Label.cs +++ /dev/null @@ -1,80 +0,0 @@ -/* - * 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 Elementary - { - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_label_add(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_label_slide_mode_set(IntPtr obj, int mode); - - [DllImport(Libraries.Elementary)] - internal static extern int elm_label_slide_mode_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_label_slide_duration_set(IntPtr obj, double duration); - - [DllImport(Libraries.Elementary)] - internal static extern double elm_label_slide_duration_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_label_slide_speed_set(IntPtr obj, double speed); - - [DllImport(Libraries.Elementary)] - internal static extern double elm_label_slide_speed_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_label_slide_go(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_label_line_wrap_set(IntPtr obj, int wrap); - - [DllImport(Libraries.Elementary)] - internal static extern int elm_label_line_wrap_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_label_wrap_width_set(IntPtr obj, int w); - - [DllImport(Libraries.Elementary)] - internal static extern int elm_label_wrap_width_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_label_ellipsis_set(IntPtr obj, bool ellipsis); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_label_ellipsis_get(IntPtr obj); - - [DllImport(Libraries.Elementary, EntryPoint = "elm_label_text_style_user_peek", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true, CharSet = CharSet.Ansi)] - internal static extern IntPtr _elm_label_text_style_user_peek(IntPtr obj); - internal static string elm_label_text_style_user_peek(IntPtr obj) - { - var text = _elm_label_text_style_user_peek(obj); - return Marshal.PtrToStringAnsi(text); - } - - [DllImport(Libraries.Elementary)] - internal static extern void elm_label_text_style_user_push(IntPtr obj, string style); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_label_text_style_user_pop(IntPtr obj); - } -} \ No newline at end of file diff --git a/src/ElmSharp/Interop/Interop.Elementary.List.cs b/src/ElmSharp/Interop/Interop.Elementary.List.cs deleted file mode 100644 index 40f4059c1..000000000 --- a/src/ElmSharp/Interop/Interop.Elementary.List.cs +++ /dev/null @@ -1,60 +0,0 @@ -/* - * 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 Elementary - { - public enum Elm_List_Mode - { - ELM_LIST_COMPRESS = 0, - ELM_LIST_SCROLL, - ELM_LIST_LIMIT, - ELM_LIST_EXPAND, - ELM_LIST_LAST - } - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_list_add(IntPtr parent); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_list_item_append(IntPtr obj, string label, IntPtr lefticon, IntPtr righticon, Evas.SmartCallback func, IntPtr data); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_list_item_prepend(IntPtr obj, string label, IntPtr icon, IntPtr end, Evas.SmartCallback func, IntPtr data); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_list_go(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_list_mode_set(IntPtr obj, Elm_List_Mode listMode); - - [DllImport(Libraries.Elementary)] - internal static extern Elm_List_Mode elm_list_mode_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_list_item_selected_set(IntPtr obj, bool value); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_list_selected_item_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_list_clear(IntPtr obj); - } -} diff --git a/src/ElmSharp/Interop/Interop.Elementary.MultiButtonEntry.cs b/src/ElmSharp/Interop/Interop.Elementary.MultiButtonEntry.cs deleted file mode 100644 index 0fa7ca537..000000000 --- a/src/ElmSharp/Interop/Interop.Elementary.MultiButtonEntry.cs +++ /dev/null @@ -1,94 +0,0 @@ -/* - * 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 Elementary - { - public delegate bool MultiButtonEntryItemFilterCallback(IntPtr obj, string label, IntPtr itemData, IntPtr data); - - public delegate string MultiButtonEntryFormatCallback(int count, IntPtr data); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_multibuttonentry_add(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_multibuttonentry_entry_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_multibuttonentry_expanded_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_multibuttonentry_expanded_set(IntPtr obj, bool expanded); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_multibuttonentry_editable_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_multibuttonentry_editable_set(IntPtr obj, bool editable); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_multibuttonentry_item_prepend(IntPtr obj, string label, Evas.SmartCallback func, IntPtr data); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_multibuttonentry_item_append(IntPtr obj, string label, Evas.SmartCallback func, IntPtr data); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_multibuttonentry_item_insert_before(IntPtr obj, IntPtr before, string label, Evas.SmartCallback func, IntPtr data); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_multibuttonentry_item_insert_after(IntPtr obj, IntPtr after, string label, Evas.SmartCallback func, IntPtr data); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_multibuttonentry_first_item_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_multibuttonentry_last_item_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_multibuttonentry_selected_item_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_multibuttonentry_item_selected_set(IntPtr obj, bool selected); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_multibuttonentry_item_selected_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_multibuttonentry_clear(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_multibuttonentry_item_prev_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_multibuttonentry_item_next_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_multibuttonentry_format_function_set(IntPtr obj, MultiButtonEntryFormatCallback callback, IntPtr data); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_multibuttonentry_item_filter_append(IntPtr obj, MultiButtonEntryItemFilterCallback callback, IntPtr data); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_multibuttonentry_item_filter_prepend(IntPtr obj, MultiButtonEntryItemFilterCallback callback, IntPtr data); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_multibuttonentry_item_filter_remove(IntPtr obj, MultiButtonEntryItemFilterCallback callback, IntPtr data); - } -} \ No newline at end of file diff --git a/src/ElmSharp/Interop/Interop.Elementary.Naviframe.cs b/src/ElmSharp/Interop/Interop.Elementary.Naviframe.cs deleted file mode 100644 index 732eceeaa..000000000 --- a/src/ElmSharp/Interop/Interop.Elementary.Naviframe.cs +++ /dev/null @@ -1,87 +0,0 @@ -/* - * 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 Elementary - { - [DllImport(Libraries.Elementary)] - internal static extern void elm_naviframe_item_pop_cb_set(IntPtr it, Elm_Naviframe_Item_Pop_Cb func, IntPtr data); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_naviframe_add(IntPtr parent); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_naviframe_event_enabled_set(IntPtr obj, bool enabled); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_naviframe_prev_btn_auto_pushed_set(IntPtr obj, bool value); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_naviframe_prev_btn_auto_pushed_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_naviframe_item_title_enabled_set(IntPtr item, bool enable, bool transition); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_naviframe_item_title_enabled_get(IntPtr item); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_naviframe_item_push(IntPtr obj, string title, IntPtr prev, IntPtr next, IntPtr content, string style); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_naviframe_item_pop(IntPtr obj); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool Elm_Naviframe_Item_Pop_Cb(IntPtr data, IntPtr item); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_naviframe_content_preserve_on_pop_set(IntPtr obj, bool preserve); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_naviframe_content_preserve_on_pop_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_naviframe_item_insert_before(IntPtr naviframe, IntPtr before, string title, IntPtr prev, IntPtr next, IntPtr content, string style); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_naviframe_item_insert_after(IntPtr naviframe, IntPtr after, string title, IntPtr prev, IntPtr next, IntPtr content, string style); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_naviframe_top_item_get(IntPtr naviframe); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_naviframe_bottom_item_get(IntPtr naviframe); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_naviframe_item_pop_to(IntPtr item); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_naviframe_item_style_set(IntPtr item, string style); - - [DllImport(Libraries.Elementary, EntryPoint = "elm_naviframe_item_style_get", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true, CharSet = CharSet.Ansi)] - internal static extern IntPtr _elm_naviframe_item_style_get(IntPtr item); - - internal static string elm_naviframe_item_style_get(IntPtr item) - { - var text = _elm_naviframe_item_style_get(item); - return Marshal.PtrToStringAnsi(text); - } - } -} \ No newline at end of file diff --git a/src/ElmSharp/Interop/Interop.Elementary.Panel.cs b/src/ElmSharp/Interop/Interop.Elementary.Panel.cs deleted file mode 100644 index c25f4fdee..000000000 --- a/src/ElmSharp/Interop/Interop.Elementary.Panel.cs +++ /dev/null @@ -1,48 +0,0 @@ -/* - * 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 Elementary - { - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_panel_add(IntPtr parent); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_panel_toggle(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_panel_hidden_set(IntPtr obj, bool hidden); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_panel_hidden_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_panel_scrollable_set(IntPtr obj, bool scrollable); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_panel_scrollable_content_size_set(IntPtr obj, double ratio); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_panel_orient_set(IntPtr obj, int orient); - - [DllImport(Libraries.Elementary)] - internal static extern int elm_panel_orient_get(IntPtr obj); - } -} diff --git a/src/ElmSharp/Interop/Interop.Elementary.Panes.cs b/src/ElmSharp/Interop/Interop.Elementary.Panes.cs deleted file mode 100644 index d3aa6e8eb..000000000 --- a/src/ElmSharp/Interop/Interop.Elementary.Panes.cs +++ /dev/null @@ -1,75 +0,0 @@ -/* - * 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 Elementary - { - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_panes_add(IntPtr parent); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_panes_content_left_size_set(IntPtr obj, double size); - - [DllImport(Libraries.Elementary)] - internal static extern double elm_panes_content_left_size_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern double elm_panes_content_left_min_relative_size_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_panes_content_left_min_relative_size_set(IntPtr obj, double size); - - [DllImport(Libraries.Elementary)] - internal static extern int elm_panes_content_left_min_size_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_panes_content_left_min_size_set(IntPtr obj, int size); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_panes_content_right_size_set(IntPtr obj, double size); - - [DllImport(Libraries.Elementary)] - internal static extern double elm_panes_content_right_size_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern double elm_panes_content_right_min_relative_size_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_panes_content_right_min_relative_size_set(IntPtr obj, double size); - - [DllImport(Libraries.Elementary)] - internal static extern int elm_panes_content_right_min_size_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_panes_content_right_min_size_set(IntPtr obj, int size); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_panes_horizontal_set(IntPtr obj, bool horizontal); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_panes_horizontal_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_panes_fixed_set(IntPtr obj, bool fix); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_panes_fixed_get(IntPtr obj); - } -} \ No newline at end of file diff --git a/src/ElmSharp/Interop/Interop.Elementary.Popup.cs b/src/ElmSharp/Interop/Interop.Elementary.Popup.cs deleted file mode 100644 index aeae8329a..000000000 --- a/src/ElmSharp/Interop/Interop.Elementary.Popup.cs +++ /dev/null @@ -1,101 +0,0 @@ -/* - * 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 Elementary - { - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_popup_add(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern double elm_popup_timeout_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_popup_timeout_set(IntPtr obj, double timeout); - - [DllImport(Libraries.Elementary)] - internal static extern double elm_popup_timeout_set(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern int elm_popup_orient_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_popup_orient_set(IntPtr obj, int orient); - - [DllImport(Libraries.Elementary)] - internal static extern int elm_popup_orient_set(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_popup_allow_events_set(IntPtr obj, bool allow); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_popup_allow_events_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_popup_item_append(IntPtr obj, string label, IntPtr icon, Evas.SmartCallback func, IntPtr data); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_popup_dismiss(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_popup_align_set(IntPtr obj, double horizontal, double vertical); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_popup_align_get(IntPtr obj, out double horizontal, out double vertical); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_popup_align_get(IntPtr obj, IntPtr horizontal, out double vertical); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_popup_align_get(IntPtr obj, out double horizontal, IntPtr vertical); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_popup_content_text_wrap_type_set(IntPtr obj, int type); - - [DllImport(Libraries.Elementary)] - internal static extern int elm_popup_content_text_wrap_type_get(IntPtr obj); - - internal static double GetPopupAlignX(IntPtr obj) - { - double x; - elm_popup_align_get(obj, out x, IntPtr.Zero); - return x; - } - - internal static double GetPopupAlignY(IntPtr obj) - { - double y; - elm_popup_align_get(obj, IntPtr.Zero, out y); - return y; - } - - internal static void SetPopupAlignX(IntPtr obj, double x) - { - double y = GetPopupAlignY(obj); - elm_popup_align_set(obj, x, y); - } - - internal static void SetPopupAlignY(IntPtr obj, double y) - { - double x = GetPopupAlignX(obj); - elm_popup_align_set(obj, x, y); - } - } -} diff --git a/src/ElmSharp/Interop/Interop.Elementary.ProgressBar.cs b/src/ElmSharp/Interop/Interop.Elementary.ProgressBar.cs deleted file mode 100644 index 4e35680d4..000000000 --- a/src/ElmSharp/Interop/Interop.Elementary.ProgressBar.cs +++ /dev/null @@ -1,78 +0,0 @@ -/* - * 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 Elementary - { - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_progressbar_add(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_progressbar_pulse_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_progressbar_pulse_set(IntPtr obj, bool pulse); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_progressbar_horizontal_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_progressbar_horizontal_set(IntPtr obj, bool horizontal); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_progressbar_inverted_set(IntPtr obj, bool inverted); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_progressbar_inverted_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_progressbar_value_set(IntPtr obj, double val); - - [DllImport(Libraries.Elementary)] - internal static extern double elm_progressbar_value_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_progressbar_span_size_set(IntPtr obj, int size); - - [DllImport(Libraries.Elementary)] - internal static extern int elm_progressbar_span_size_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_progressbar_pulse(IntPtr obj, bool state); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_progressbar_part_value_set(IntPtr obj, string part, double val); - - [DllImport(Libraries.Elementary)] - internal static extern double elm_progressbar_part_value_get(IntPtr obj, string part); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_progressbar_unit_format_set(IntPtr obj, string format); - - [DllImport(Libraries.Elementary, EntryPoint = "elm_progressbar_unit_format_get")] - internal static extern IntPtr _elm_progressbar_unit_format_get(IntPtr obj); - - internal static string elm_progressbar_unit_format_get(IntPtr obj) - { - var format = _elm_progressbar_unit_format_get(obj); - return Marshal.PtrToStringAnsi(format); - } - } -} \ No newline at end of file diff --git a/src/ElmSharp/Interop/Interop.Elementary.ScrollView.cs b/src/ElmSharp/Interop/Interop.Elementary.ScrollView.cs deleted file mode 100644 index 671aa5cca..000000000 --- a/src/ElmSharp/Interop/Interop.Elementary.ScrollView.cs +++ /dev/null @@ -1,147 +0,0 @@ -/* - * 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 Elementary - { - [DllImport(Libraries.Elementary)] - internal static extern void elm_interface_scrollable_content_size_get (out int w, out int h); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_interface_scrollable_page_bring_in (int pagenumber_h, int pagenumber_v); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_scroller_add (IntPtr parent); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_scroller_bounce_get(IntPtr obj, out bool h_bounce, out bool v_bounce); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_scroller_bounce_set(IntPtr obj, bool h_bounce, bool v_bounce); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_scroller_child_size_get (IntPtr obj, out int w, out int h); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_scroller_content_min_limit (IntPtr obj, bool w, bool h); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_scroller_current_page_get (IntPtr obj, out int h_pagenumber, out int v_pagenumber); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_scroller_gravity_get(IntPtr obj, out double x, out double y); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_scroller_gravity_set (IntPtr obj, double x, double y); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_scroller_last_page_get (IntPtr obj, out int h_pagenumber, out int v_pagenumber); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_scroller_loop_get(IntPtr obj, out bool loop_h, out bool loop_v); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_scroller_loop_set (IntPtr obj, bool loop_h, bool loop_v); - - [DllImport(Libraries.Elementary)] - internal static extern int elm_scroller_movement_block_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_scroller_movement_block_set(IntPtr obj, int block); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_scroller_page_bring_in (IntPtr obj, int h_pagenumber, int v_pagenumber); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_scroller_page_relative_get (IntPtr obj, out double h_pagerel, out double v_pagerel); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_scroller_page_relative_set (IntPtr obj, double h_pagerel, double v_pagerel); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_scroller_page_show (IntPtr obj, int h_pagenumber, int v_pagenumber); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_scroller_page_size_get (IntPtr obj, out int h_pagesize, out int v_pagesize); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_scroller_page_size_set (IntPtr obj, int h_pagesize, int v_pagesize); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_scroller_page_snap_get (IntPtr obj, out bool page_h_snap, out bool page_v_snap); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_scroller_page_snap_set (IntPtr obj, bool page_h_snap, bool page_v_snap); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_scroller_policy_get(IntPtr obj, out int policy_h, out int policy_v); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_scroller_policy_get(IntPtr obj, out int policy_h, IntPtr policy_v); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_scroller_policy_get(IntPtr obj, IntPtr policy_h, out int policy_v); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_scroller_policy_set(IntPtr obj, int policy_h, int policy_v); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_scroller_region_bring_in (IntPtr obj, int x, int y, int w, int h); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_scroller_region_get (IntPtr obj, out int x, out int y, out int w, out int h); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_scroller_region_show (IntPtr obj, int x, int y, int w, int h); - - [DllImport(Libraries.Elementary)] - internal static extern int elm_scroller_single_direction_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_scroller_single_direction_set(IntPtr obj, int singleDirection); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_scroller_step_size_get (IntPtr obj, out int x, out int y); - - [DllImportAttribute(Libraries.Elementary)] - internal static extern void elm_scroller_step_size_set (IntPtr obj, int x, int y); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_scroller_wheel_disabled_get (IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_scroller_wheel_disabled_set (IntPtr obj, bool disabled); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_scroller_propagate_events_get (IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_scroller_propagate_events_set (IntPtr obj, bool propagation); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_scroller_page_scroll_limit_get (IntPtr obj, out int page_limit_h_, out int page_limit_v_); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_scroller_page_scroll_limit_set (IntPtr obj, int page_limit_h_, int page_limit_v_); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_object_scroll_lock_y_set(IntPtr obj, bool enable); - } -} \ No newline at end of file diff --git a/src/ElmSharp/Interop/Interop.Elementary.Slider.cs b/src/ElmSharp/Interop/Interop.Elementary.Slider.cs deleted file mode 100755 index 6f30f3100..000000000 --- a/src/ElmSharp/Interop/Interop.Elementary.Slider.cs +++ /dev/null @@ -1,119 +0,0 @@ -/* - * 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 Elementary - { - internal enum Elm_Slider_Indicator_Visible_Mode - { - ELM_SLIDER_INDICATOR_VISIBLE_MODE_DEFAULT, /* show indicator on mouse down or change in slider value */ - ELM_SLIDER_INDICATOR_VISIBLE_MODE_ALWAYS, /* Always show the indicator. */ - ELM_SLIDER_INDICATOR_VISIBLE_MODE_ON_FOCUS, /* Show the indicator on focus */ - ELM_SLIDER_INDICATOR_VISIBLE_MODE_NONE /* Never show the indicator */ - } - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_slider_add(IntPtr parent); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_slider_indicator_show_set(IntPtr obj, bool show); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_slider_indicator_show_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_slider_indicator_show_on_focus_set(IntPtr obj, bool focus); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_slider_indicator_show_on_focus_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_slider_indicator_format_set(IntPtr obj, string indicator); - - [DllImport(Libraries.Elementary, EntryPoint = "elm_slider_indicator_format_get", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true, CharSet = CharSet.Ansi)] - internal static extern IntPtr _elm_slider_indicator_format_get(IntPtr obj); - - internal static string elm_slider_indicator_format_get(IntPtr obj) - { - var text = _elm_slider_indicator_format_get(obj); - return Marshal.PtrToStringAnsi(text); - } - - [DllImport(Libraries.Elementary)] - internal static extern void elm_slider_unit_format_set(IntPtr obj, string units); - - [DllImport(Libraries.Elementary, EntryPoint = "elm_slider_unit_format_get", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true, CharSet = CharSet.Ansi)] - internal static extern IntPtr _elm_slider_unit_format_get(IntPtr obj); - - internal static string elm_slider_unit_format_get(IntPtr obj) - { - var text = _elm_slider_unit_format_get(obj); - return Marshal.PtrToStringAnsi(text); - } - - [DllImport(Libraries.Elementary)] - internal static extern void elm_slider_inverted_set(IntPtr obj, bool inverted); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_slider_inverted_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_slider_horizontal_set(IntPtr obj, bool value); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_slider_horizontal_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_slider_min_max_set(IntPtr obj, double min, double max); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_slider_min_max_get(IntPtr obj, out double min, out double max); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_slider_min_max_get(IntPtr obj, out double min, IntPtr max); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_slider_min_max_get(IntPtr obj, IntPtr min, out double max); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_slider_value_set(IntPtr obj, double val); - - [DllImport(Libraries.Elementary)] - internal static extern double elm_slider_value_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_slider_span_size_set(IntPtr obj, int size); - - [DllImport(Libraries.Elementary)] - internal static extern int elm_slider_span_size_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_slider_step_set(IntPtr obj, double step); - - [DllImport(Libraries.Elementary)] - internal static extern double elm_slider_step_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern int elm_slider_indicator_visible_mode_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_slider_indicator_visible_mode_set(IntPtr obj, int mode); - } -} \ No newline at end of file diff --git a/src/ElmSharp/Interop/Interop.Elementary.Spinner.cs b/src/ElmSharp/Interop/Interop.Elementary.Spinner.cs deleted file mode 100644 index 338b4cc72..000000000 --- a/src/ElmSharp/Interop/Interop.Elementary.Spinner.cs +++ /dev/null @@ -1,103 +0,0 @@ -/* - * 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 Elementary - { - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_spinner_add(IntPtr parent); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_spinner_min_max_set(IntPtr obj, double min, double max); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_spinner_min_max_get(IntPtr obj, out double min, IntPtr max); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_spinner_min_max_get(IntPtr obj, IntPtr min, out double max); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_spinner_step_set(IntPtr obj, double step); - - [DllImport(Libraries.Elementary)] - internal static extern double elm_spinner_step_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_spinner_wrap_set(IntPtr obj, bool wrap); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_spinner_wrap_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_spinner_interval_set(IntPtr obj, double interval); - - [DllImport(Libraries.Elementary)] - internal static extern double elm_spinner_interval_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_spinner_round_set(IntPtr obj, int rnd); - - [DllImport(Libraries.Elementary)] - internal static extern int elm_spinner_round_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_spinner_editable_set(IntPtr obj, bool editable); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_spinner_editable_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_spinner_base_set(IntPtr obj, double value); - - [DllImport(Libraries.Elementary)] - internal static extern double elm_spinner_base_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_spinner_value_set(IntPtr obj, double val); - - [DllImport(Libraries.Elementary)] - internal static extern double elm_spinner_value_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_spinner_label_format_set(IntPtr obj, string fmt); - - [DllImport(Libraries.Elementary, EntryPoint = "elm_spinner_label_format_get", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true, CharSet = CharSet.Ansi)] - internal static extern IntPtr _elm_spinner_label_format_get(IntPtr obj); - internal static string elm_spinner_label_format_get(IntPtr obj) - { - var text = _elm_spinner_label_format_get(obj); - return Marshal.PtrToStringAnsi(text); - } - - [DllImport(Libraries.Elementary)] - internal static extern void elm_spinner_special_value_add(IntPtr obj, double value, string label); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_spinner_special_value_del(IntPtr obj, double value); - - [DllImport(Libraries.Elementary, EntryPoint = "elm_spinner_special_value_get", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true, CharSet = CharSet.Ansi)] - internal static extern IntPtr _elm_spinner_special_value_get(IntPtr obj, double value); - internal static string elm_spinner_special_value_get(IntPtr obj, double value) - { - var text = _elm_spinner_special_value_get(obj, value); - return Marshal.PtrToStringAnsi(text); - } - } -} diff --git a/src/ElmSharp/Interop/Interop.Elementary.Table.cs b/src/ElmSharp/Interop/Interop.Elementary.Table.cs deleted file mode 100644 index d793a7544..000000000 --- a/src/ElmSharp/Interop/Interop.Elementary.Table.cs +++ /dev/null @@ -1,55 +0,0 @@ -/* - * 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 Elementary - { - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_table_add(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_table_homogeneous_set(IntPtr obj, bool homogeneous); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_table_homogeneous_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_table_padding_set(IntPtr obj, int horizontal, int vertical); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_table_padding_get(IntPtr obj, out int horizontal, out int vertical); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_table_clear (IntPtr obj, bool clear); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_table_unpack (IntPtr obj, IntPtr subobj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_table_pack(IntPtr obj, IntPtr subobj, int column, int row, int colspan, int rowspan); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_table_pack_set(IntPtr subobj, int col, int row, int colspan, int rowspan); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_table_pack_get(IntPtr subobj, out int col, out int row, out int colspan, out int rowspan); - } -} diff --git a/src/ElmSharp/Interop/Interop.Elementary.Toolbar.cs b/src/ElmSharp/Interop/Interop.Elementary.Toolbar.cs deleted file mode 100644 index d75382715..000000000 --- a/src/ElmSharp/Interop/Interop.Elementary.Toolbar.cs +++ /dev/null @@ -1,134 +0,0 @@ -/* - * 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 Elementary - { - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_toolbar_add(IntPtr parent); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_toolbar_shrink_mode_set(IntPtr obj, int shrink_mode); - - [DllImport(Libraries.Elementary)] - internal static extern int elm_toolbar_shrink_mode_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_toolbar_item_append(IntPtr obj, string icon, string label, Evas.SmartCallback func, IntPtr data); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_toolbar_item_prepend(IntPtr obj, string icon, string label, Evas.SmartCallback func, IntPtr data); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_toolbar_item_insert_before(IntPtr obj, IntPtr before, string icon, string label, Evas.SmartCallback func, IntPtr data); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_toolbar_transverse_expanded_set(IntPtr obj, bool transverse_expanded); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_toolbar_transverse_expanded_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_toolbar_select_mode_set(IntPtr obj, int mode); - - [DllImport(Libraries.Elementary)] - internal static extern int elm_toolbar_select_mode_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern double elm_toolbar_align_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_toolbar_align_set(IntPtr obj, double align); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_toolbar_homogeneous_set(IntPtr obj, bool homogeneous); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_toolbar_homogeneous_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_toolbar_horizontal_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_toolbar_horizontal_set(IntPtr obj, bool horizontal); - - [DllImport(Libraries.Elementary)] - internal static extern int elm_toolbar_icon_order_lookup_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_toolbar_icon_order_lookup_set(IntPtr obj, int order); - - [DllImport(Libraries.Elementary)] - internal static extern int elm_toolbar_icon_size_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_toolbar_icon_size_set(IntPtr obj, int size); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_toolbar_item_icon_set(IntPtr obj, string icon); - - [DllImport(Libraries.Elementary, EntryPoint = "elm_toolbar_item_icon_get", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true, CharSet = CharSet.Ansi)] - internal static extern IntPtr _elm_toolbar_item_icon_get(IntPtr obj); - internal static string elm_toolbar_item_icon_get(IntPtr obj) - { - var text = _elm_toolbar_item_icon_get(obj); - return Marshal.PtrToStringAnsi(text); - } - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_toolbar_first_item_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_toolbar_last_item_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_toolbar_item_selected_set(IntPtr obj, bool selected); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_toolbar_item_selected_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_toolbar_selected_item_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_toolbar_item_separator_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_toolbar_item_separator_set(IntPtr obj, bool separator); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_toolbar_item_find_by_label(IntPtr obj, string label); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_toolbar_item_insert_after(IntPtr obj, IntPtr after, string icon, string label, Evas_Smart_Cb func, IntPtr data); - - [DllImport(Libraries.Elementary)] - internal static extern int elm_toolbar_items_count(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_toolbar_menu_parent_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_toolbar_menu_parent_set(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_toolbar_more_item_get(IntPtr obj); - } -} diff --git a/src/ElmSharp/Interop/Interop.Elementary.Win.cs b/src/ElmSharp/Interop/Interop.Elementary.Win.cs deleted file mode 100644 index c209c95b0..000000000 --- a/src/ElmSharp/Interop/Interop.Elementary.Win.cs +++ /dev/null @@ -1,438 +0,0 @@ -/* - * 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 ElmSharp; -using System; -using System.Runtime.InteropServices; - -internal static partial class Interop -{ - internal static partial class Elementary - { - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_win_add(IntPtr parent, string name, int type); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_win_util_standard_add(string name, string title); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_win_activate(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_win_title_set(IntPtr obj, string title); - - [DllImport(Libraries.Elementary, EntryPoint = "elm_win_title_get", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true, CharSet = CharSet.Ansi)] - internal static extern IntPtr _elm_win_title_get(IntPtr obj); - - internal static string elm_win_title_get(IntPtr obj) - { - var text = _elm_win_title_get(obj); - return Marshal.PtrToStringAnsi(text); - } - - [DllImport(Libraries.Elementary)] - internal static extern void elm_win_screen_size_get(IntPtr obj, out int x, out int y, out int w, out int h); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_win_resize_object_del(IntPtr obj, IntPtr subobj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_win_resize_object_add(IntPtr obj, IntPtr subobj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_win_raise(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_win_lower(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_win_alpha_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_win_alpha_set(IntPtr obj, bool alpha); - - [DllImport(Libraries.Elementary, EntryPoint = "elm_win_role_get")] - internal static extern IntPtr _elm_win_role_get(IntPtr obj); - - internal static string elm_win_role_get(IntPtr obj) - { - var text = _elm_win_role_get(obj); - return Marshal.PtrToStringAnsi(text); - } - - [DllImport(Libraries.Elementary)] - internal static extern void elm_win_role_set(IntPtr obj, string role); - - [DllImport(Libraries.Elementary, EntryPoint = "elm_win_focus_highlight_style_get")] - internal static extern IntPtr _elm_win_focus_highlight_style_get(IntPtr obj); - - internal static string elm_win_focus_highlight_style_get(IntPtr obj) - { - return Marshal.PtrToStringAnsi(_elm_win_focus_highlight_style_get(obj)); - } - - [DllImport(Libraries.Elementary)] - internal static extern void elm_win_focus_highlight_style_set(IntPtr obj, string style); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_win_borderless_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_win_borderless_set(IntPtr obj, bool borderless); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_win_focus_highlight_enabled_set(IntPtr obj, bool enabled); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_win_focus_highlight_enabled_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_win_autodel_set(IntPtr obj, bool autodel); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_win_autodel_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_win_override_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_win_override_set(IntPtr obj, bool isOverride); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_win_indicator_opacity_set(IntPtr obj, int opacity); - - [DllImport(Libraries.Elementary)] - internal static extern int elm_win_indicator_opacity_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_win_indicator_mode_set(IntPtr obj, IndicatorMode mode); - - [DllImport(Libraries.Elementary)] - internal static extern IndicatorMode elm_win_indicator_mode_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_win_demand_attention_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_win_demand_attention_set(IntPtr obj, bool demandAttention); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_win_conformant_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_win_conformant_set(IntPtr obj, bool conformant); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_win_fullscreen_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_win_fullscreen_set(IntPtr obj, bool fullscreen); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_win_rotation_set(IntPtr obj, int rotation); - - [DllImport(Libraries.Elementary)] - internal static extern int elm_win_rotation_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_win_rotation_with_resize_set(IntPtr obj, int rotation); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_win_prop_focus_skip_set(IntPtr obj, bool skip); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_win_wm_rotation_supported_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_win_focus_get(IntPtr obj); - - [DllImport(Libraries.Elementary, EntryPoint = "elm_win_wm_rotation_available_rotations_set")] - internal static extern void _elm_win_wm_rotation_available_rotations_set(IntPtr obj, IntPtr rotations, uint count); - - internal static void elm_win_wm_rotation_available_rotations_set(IntPtr obj, int[] rotations) - { - IntPtr pRotations = Marshal.AllocHGlobal(Marshal.SizeOf() * rotations.Length); - Marshal.Copy(rotations, 0, pRotations, rotations.Length); - _elm_win_wm_rotation_available_rotations_set(obj, pRotations, (uint)rotations.Length); - Marshal.FreeHGlobal(pRotations); - } - - [DllImport(Libraries.Elementary, EntryPoint = "elm_win_wm_rotation_available_rotations_get")] - internal static extern bool _elm_win_wm_rotation_available_rotations_get(IntPtr obj, out IntPtr rotations, out int count); - - internal static bool elm_win_wm_rotation_available_rotations_get(IntPtr obj, out int[] rotations) - { - IntPtr rotationArrPtr; - int count; - if (_elm_win_wm_rotation_available_rotations_get(obj, out rotationArrPtr, out count)) - { - rotations = new int[count]; - Marshal.Copy(rotationArrPtr, rotations, 0, count); - Libc.Free(rotationArrPtr); - return true; - } - rotations = null; - return false; - } - - [DllImport(Libraries.Elementary)] - internal static extern int elm_win_layer_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_win_layer_set(IntPtr obj, int layer); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_win_sticky_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_win_sticky_set(IntPtr obj, bool sticky); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_win_screen_dpi_get(IntPtr obj, out int xdpi, out int ydpi); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_win_iconified_set(IntPtr obj, bool iconified); - - [DllImport(Libraries.Elementary)] - [return: MarshalAs(UnmanagedType.U1)] - internal static extern bool elm_win_iconified_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_win_floating_mode_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_win_floating_mode_set(IntPtr obj, bool floating); - - [DllImport(Libraries.Elementary)] - [return: MarshalAs(UnmanagedType.U1)] - internal static extern bool elm_win_keygrab_set(IntPtr obj, string key, ulong modifiers, ulong notModifiers, int proirity, KeyGrabMode grabMode); - - [DllImport(Libraries.Elementary)] - [return: MarshalAs(UnmanagedType.U1)] - internal static extern bool elm_win_keygrab_unset(IntPtr obj, string key, ulong modifiers, ulong notModifiers); - - [DllImport(Libraries.Eext)] - internal static extern bool eext_win_keygrab_set(IntPtr obj, string key); - - [DllImport(Libraries.Eext)] - internal static extern bool eext_win_keygrab_unset(IntPtr obj, string key); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_win_keyboard_win_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_win_keyboard_win_set(IntPtr obj, bool isKeyboard); - - [DllImport(Libraries.Elementary)] - internal static extern int elm_win_keyboard_mode_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_win_keyboard_mode_set(IntPtr obj, int mode); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_win_inwin_activate(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_win_inwin_add(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_win_inwin_content_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_win_inwin_content_set(IntPtr obj, IntPtr content); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_win_inwin_content_unset(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern double elm_win_aspect_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_win_aspect_set(IntPtr obj, double aspect); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_win_autohide_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_win_autohide_set(IntPtr obj, bool autohide); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_win_center(IntPtr obj, bool h, bool v); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_win_focus_highlight_animate_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_win_focus_highlight_animate_set(IntPtr obj, bool animate); - - [DllImport(Libraries.Elementary, EntryPoint = "elm_win_icon_name_get")] - internal static extern IntPtr _elm_win_icon_name_get(IntPtr obj); - - internal static string elm_win_icon_name_get(IntPtr obj) - { - return Marshal.PtrToStringAnsi(_elm_win_icon_name_get(obj)); - } - - [DllImport(Libraries.Elementary)] - internal static extern void elm_win_icon_name_set(IntPtr obj, string iconName); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_win_icon_object_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_win_icon_object_set(IntPtr obj, IntPtr icon); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_win_inlined_image_object_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_win_modal_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_win_modal_set(IntPtr obj, bool modal); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_win_noblank_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_win_noblank_set(IntPtr obj, bool noblank); - - [DllImport(Libraries.Elementary)] - internal static extern int elm_win_norender_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_win_norender_pop(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_win_norender_push(IntPtr obj); - - [DllImport(Libraries.Elementary, EntryPoint = "elm_win_profile_get")] - internal static extern IntPtr _elm_win_profile_get(IntPtr obj); - - internal static string elm_win_profile_get(IntPtr obj) - { - return Marshal.PtrToStringAnsi(_elm_win_profile_get(obj)); - } - - [DllImport(Libraries.Elementary)] - internal static extern void elm_win_profile_set(IntPtr obj, string profile); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_win_quickpanel_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern int elm_win_quickpanel_priority_major_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_win_quickpanel_priority_major_set(IntPtr obj, int priority); - - [DllImport(Libraries.Elementary)] - internal static extern int elm_win_quickpanel_priority_minor_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_win_quickpanel_priority_minor_set(IntPtr obj, int priority); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_win_quickpanel_set(IntPtr obj, bool quickpanel); - - [DllImport(Libraries.Elementary)] - internal static extern int elm_win_quickpanel_zone_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_win_quickpanel_zone_set(IntPtr obj, int zone); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_win_render(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_win_screen_constrain_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_win_screen_constrain_set(IntPtr obj, bool constrain); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_win_screen_position_get(IntPtr obj, out int x, out int y); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_win_shaped_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_win_shaped_set(IntPtr obj, bool shaped); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_win_size_base_get(IntPtr obj, out int w, out int h); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_win_size_base_set(IntPtr obj, int w, int h); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_win_size_step_get(IntPtr obj, out int w, out int h); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_win_size_step_set(IntPtr obj, int w, int h); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_win_socket_listen(IntPtr obj, string svcname, int svcnum, bool svcsys); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_win_trap_data_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_win_trap_set(IntPtr obj, IntPtr trap); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_win_urgent_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_win_urgent_set(IntPtr obj, bool urgent); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_win_util_dialog_add(IntPtr obj, string name, string title); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_win_withdrawn_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_win_withdrawn_set(IntPtr obj, bool withdrawn); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_win_wm_rotation_manual_rotation_done(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_win_wm_rotation_manual_rotation_done_get(IntPtr obj, bool withdrawn); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_win_wm_rotation_manual_rotation_done_set(IntPtr obj, bool set); - - [DllImport(Libraries.Elementary)] - internal static extern int elm_win_wm_rotation_preferred_rotation_get(IntPtr obj, bool withdrawn); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_win_available_profiles_get(IntPtr obj, out string[] profiles, out int count); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_win_available_profiles_set(IntPtr obj, string[] profiles, int count); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_win_fake_add(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_win_fake_canvas_set(IntPtr obj, IntPtr oee); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_win_illume_command_send(IntPtr obj, IntPtr param); - } -} \ No newline at end of file diff --git a/src/ElmSharp/Interop/Interop.Elementary.cs b/src/ElmSharp/Interop/Interop.Elementary.cs deleted file mode 100644 index 601f8eeda..000000000 --- a/src/ElmSharp/Interop/Interop.Elementary.cs +++ /dev/null @@ -1,795 +0,0 @@ -/* - * 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 Elementary - { - internal enum Edje_Message_Type - { - EDJE_MESSAGE_NONE = 0, - - // A message with a string as value. Use #Edje_Message_String structs as message body, for this type. - EDJE_MESSAGE_STRING = 2, - - // A message with an integer number as value. Use #Edje_Message_Int structs as message body, for this type. - EDJE_MESSAGE_INT = 3, - - // A message with a floating pointer number as value. Use #Edje_Message_Float structs as message body, for this type. - EDJE_MESSAGE_FLOAT = 4, - - // A message with a list of strings as value. Use #Edje_Message_String_Set structs as message body, for this type. - EDJE_MESSAGE_STRING_SET = 5, - - // A message with a list of integer numbers as value. Use #Edje_Message_Int_Set structs as message body, for this type. - EDJE_MESSAGE_INT_SET = 6, - - // A message with a list of floating point numbers as value. Use #Edje_Message_Float_Set structs as message body, for this type. - EDJE_MESSAGE_FLOAT_SET = 7, - - // A message with a struct containing a string and an integer number as value. Use #Edje_Message_String_Int structs as message body, for this type. - EDJE_MESSAGE_STRING_INT = 8, - - // A message with a struct containing a string and a floating point number as value. Use #Edje_Message_String_Float structs as message body, for this type. - EDJE_MESSAGE_STRING_FLOAT = 9, - - // A message with a struct containing a string and list of integer numbers as value. Use #Edje_Message_String_Int_Set structs as message body, for this type. - EDJE_MESSAGE_STRING_INT_SET = 10, - - // A message with a struct containing a string and list of floating point numbers as value. Use #Edje_Message_String_Float_Set structs as message body, for this type. - EDJE_MESSAGE_STRING_FLOAT_SET = 11 - } - internal enum Elm_Focus_Autoscroll_Mode - { - ELM_FOCUS_AUTOSCROLL_MODE_SHOW, - ELM_FOCUS_AUTOSCROLL_MODE_NONE, - ELM_FOCUS_AUTOSCROLL_MODE_BRING_IN - } - - [DllImport(Libraries.Elementary)] - internal static extern void elm_config_scroll_bring_in_scroll_friction_set(double time); - - [DllImport(Libraries.Elementary)] - internal static extern double elm_config_scroll_bring_in_scroll_friction_get(); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_config_focus_autoscroll_mode_set(Elm_Focus_Autoscroll_Mode mode); - - [DllImport(Libraries.Elementary)] - internal static extern Elm_Focus_Autoscroll_Mode elm_config_focus_autoscroll_mode_get(); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_config_accel_preference_set(string preference); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_config_scale_set(double scale); - - [DllImport(Libraries.Elementary)] - internal static extern double elm_config_scale_get(); - - [DllImport(Libraries.Elementary, EntryPoint = "elm_config_profile_get")] - internal static extern IntPtr _elm_config_profile_get(); - - internal static string elm_config_profile_get() - { - return Marshal.PtrToStringAnsi(_elm_config_profile_get()); - } - - [DllImport(Libraries.Elementary)] - internal static extern void elm_config_preferred_engine_set(string name); - - [DllImport(Libraries.Elementary)] - internal static extern double elm_config_longpress_timeout_get(); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_config_reload(); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_config_all_flush(); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_config_finger_size_set(int size); - - [DllImport(Libraries.Elementary)] - internal static extern int elm_config_finger_size_get(); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_config_mirrored_get(); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_config_mirrored_set(bool mirrored); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_object_mirrored_automatic_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_object_mirrored_automatic_set(IntPtr obj, bool automatic); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_object_mirrored_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_object_mirrored_set(IntPtr obj, bool mirrored); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_grid_add(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_grid_pack(IntPtr obj, IntPtr subObj, int x, int y, int w, int h); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_grid_pack_get(IntPtr subObj, out int x, out int y, out int w, out int h); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_grid_pack_set(IntPtr subObj, int x, int y, int w, int h); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_grid_size_set(IntPtr obj, int w, int h); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_object_tree_dump(IntPtr top); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_object_disabled_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_object_disabled_set(IntPtr obj, bool disabled); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_init(int argc, string[] argv); - - [DllImport(Libraries.Elementary)] - internal static extern bool ecore_main_loop_glib_integrate(); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_run(); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_exit(); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_shutdown(); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_app_base_scale_set(double base_scale); - - [DllImport(Libraries.Elementary)] - internal static extern double elm_app_base_scale_get(); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_conformant_add(IntPtr obj); - - [DllImport(Libraries.Elementary, EntryPoint = "elm_object_part_text_get")] - internal static extern IntPtr _elm_object_part_text_get(IntPtr obj, IntPtr part); - - [DllImport(Libraries.Elementary, EntryPoint = "elm_object_part_text_get")] - internal static extern IntPtr _elm_object_part_text_get(IntPtr obj, string part); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_object_tooltip_text_set(IntPtr obj, string text); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_object_tooltip_unset(IntPtr obj); - - [DllImport(Libraries.Elementary, EntryPoint = "elm_object_tooltip_style_get")] - internal static extern IntPtr _elm_object_tooltip_style_get(IntPtr obj); - - internal static string elm_object_tooltip_style_get(IntPtr obj) - { - return Marshal.PtrToStringAnsi(_elm_object_tooltip_style_get(obj)); - } - - [DllImport(Libraries.Elementary)] - internal static extern void elm_object_tooltip_style_set(IntPtr obj, string style); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_object_tooltip_window_mode_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_object_tooltip_window_mode_set(IntPtr obj, bool disable); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_object_tooltip_move_freeze_push(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_object_tooltip_move_freeze_pop(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern int elm_object_tooltip_move_freeze_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_object_tooltip_show(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_object_tooltip_hide(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_object_tooltip_orient_set(IntPtr obj, int orient); - - [DllImport(Libraries.Elementary)] - internal static extern int elm_object_tooltip_orient_get(IntPtr obj); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate IntPtr Elm_Tooltip_Content_Cb(IntPtr data, IntPtr obj, IntPtr tooltip); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_object_tooltip_content_cb_set(IntPtr obj, Elm_Tooltip_Content_Cb func, IntPtr data, Interop.Evas.SmartCallback del); - - internal static string elm_object_part_text_get(IntPtr obj, string part) - { - return Marshal.PtrToStringAnsi(_elm_object_part_text_get(obj, part)); - } - - internal static string elm_object_part_text_get(IntPtr obj) - { - return Marshal.PtrToStringAnsi(_elm_object_part_text_get(obj, IntPtr.Zero)); - } - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_object_part_content_get(IntPtr obj, string part); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_object_part_content_set(IntPtr obj, string part, IntPtr content); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_object_part_content_set(IntPtr obj, IntPtr part, IntPtr content); - - internal static void elm_object_content_set(IntPtr obj, IntPtr content) - { - elm_object_part_content_set(obj, IntPtr.Zero, content); - } - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_object_part_content_unset(IntPtr obj, string part); - - internal static void elm_object_content_unset(IntPtr obj) - { - elm_object_part_content_unset(obj, null); - } - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_layout_add(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_layout_content_get(IntPtr obj, string swallow); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_layout_content_set(IntPtr obj, string swallow, IntPtr content); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_layout_content_unset(IntPtr obj, string swallow); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_layout_text_set(IntPtr obj, string part, string text); - - [DllImport(Libraries.Elementary, EntryPoint = "elm_layout_text_get")] - internal static extern IntPtr _elm_layout_text_get(IntPtr obj, string part); - - internal static string elm_layout_text_get(IntPtr obj, string part) - { - return Marshal.PtrToStringAnsi(_elm_layout_text_get(obj, part)); - } - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_layout_theme_set(IntPtr obj, string klass, string group, string style); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_layout_file_get(IntPtr obj, IntPtr file, IntPtr group); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_layout_file_set(IntPtr obj, string file, string group); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_layout_signal_emit(IntPtr obj, string emission, string source); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_layout_signal_callback_add(IntPtr obj, string emission, string source, Edje_Signal_Cb func, IntPtr data); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_layout_signal_callback_del(IntPtr obj, string emission, string source, Edje_Signal_Cb func); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void Edje_Signal_Cb(IntPtr data, IntPtr obj, string emission, string source); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_layout_box_append(IntPtr obj, string part, IntPtr child); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_layout_box_prepend(IntPtr obj, string part, IntPtr child); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_layout_box_remove(IntPtr obj, string part, IntPtr child); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_layout_box_remove_all(IntPtr obj, string part, bool clear); - - [DllImport(Libraries.Elementary, EntryPoint = "elm_layout_data_get")] - internal static extern IntPtr _elm_layout_data_get(IntPtr obj, string key); - - internal static string elm_layout_data_get(IntPtr obj, string key) - { - return Marshal.PtrToStringAnsi(_elm_layout_data_get(obj, key)); - } - - [DllImport(Libraries.Elementary)] - internal static extern void elm_layout_text_valign_set(IntPtr obj, string part, double valign); - - [DllImport(Libraries.Elementary)] - internal static extern double elm_layout_text_valign_get(IntPtr obj, string part); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_notify_add(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_notify_align_set(IntPtr obj, double horizontal, double vertical); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_notify_timeout_set(IntPtr obj, double timeout); - - [DllImport(Libraries.Elementary)] - internal static extern double elm_object_scale_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_object_scale_set(IntPtr obj, double scale); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_object_signal_emit(IntPtr obj, string emission, string source); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_object_signal_callback_del(IntPtr obj, string emission, string source, Edje_Signal_Cb func); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_object_signal_callback_add(IntPtr obj, string emission, string source, Edje_Signal_Cb func, IntPtr data); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_object_style_set(IntPtr obj, string style); - - [DllImport(Libraries.Elementary, EntryPoint = "elm_object_style_get")] - internal static extern IntPtr _elm_object_style_get(IntPtr obj); - - internal static string elm_object_style_get(IntPtr obj) - { - return Marshal.PtrToStringAnsi(_elm_object_style_get(obj)); - } - - [DllImport(Libraries.Elementary)] - internal static extern void elm_object_color_class_color_get(IntPtr obj, string colorClass, out int r, out int g, out int b, out int a); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_object_color_class_color_set(IntPtr obj, string colorClass, int r, int g, int b, int a); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_object_part_text_set(IntPtr obj, string part, string text); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_object_part_text_set(IntPtr obj, IntPtr part, string text); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_config_focus_highlight_animate_set(bool animate); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_config_focus_highlight_animate_get(); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_config_focus_highlight_enabled_set(bool enable); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_config_focus_highlight_enabled_get(); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_object_tree_focus_allow_set(IntPtr obj, bool focusable); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_object_tree_focus_allow_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_object_focus_next_object_get(IntPtr obj, int dir); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_object_focused_object_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_object_focus_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_object_focus_set(IntPtr obj, bool focus); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_object_focus_allow_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_object_focus_allow_set(IntPtr obj, bool enable); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_object_focus_next(IntPtr obj, int direction); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_object_focus_next_object_set(IntPtr obj, IntPtr next, int direction); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_object_focus_next_item_set(IntPtr obj, IntPtr nextItem, int direction); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_theme_extension_add(IntPtr theme, string path); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_theme_overlay_add(IntPtr theme, string path); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_language_set(string lang); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_policy_set(uint policy, int value); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_theme_new(); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_theme_free(IntPtr theme); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_theme_ref_set(IntPtr theme, IntPtr themeRef); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_theme_extension_del(IntPtr theme, string item); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_theme_overlay_del(IntPtr theme, string item); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_theme_set(IntPtr obj, string theme); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_theme_flush(IntPtr theme); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_theme_full_flush(); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_object_theme_set(IntPtr obj, IntPtr theme); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_layout_edje_get(IntPtr obj); - - internal static void SetObjectText(IntPtr obj, string text) - { - elm_object_part_text_set(obj, IntPtr.Zero, text); - } - - [DllImport(Libraries.Elementary)] - internal static extern void elm_cache_all_flush(); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_object_domain_translatable_part_text_set(IntPtr obj, string part, string domain, string text); - - [DllImport(Libraries.Elementary)] - internal static extern void edje_object_color_class_del(IntPtr obj, string colorClass); - - [DllImport(Libraries.Elementary)] - internal static extern bool edje_object_part_exists(IntPtr obj, string part); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr edje_object_part_object_get(IntPtr obj, string part); - - [DllImport(Libraries.Elementary)] - internal static extern bool edje_object_part_geometry_get(IntPtr obj, string part, out int x, out int y, out int w, out int h); - - [DllImport(Libraries.Elementary)] - internal static extern bool edje_object_part_text_set(IntPtr obj, string part, string text); - - [DllImport(Libraries.Elementary, EntryPoint = "edje_object_part_text_get", CharSet = CharSet.Ansi)] - internal static extern IntPtr _edje_object_part_text_get(IntPtr obj, string part); - - internal static string edje_object_part_text_get(IntPtr obj, string part) - { - var text = _edje_object_part_text_get(obj, part); - return Marshal.PtrToStringAnsi(text); - } - - [DllImport(Libraries.Elementary, EntryPoint = "edje_object_part_text_style_user_peek", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true, CharSet = CharSet.Ansi)] - internal static extern IntPtr _edje_object_part_text_style_user_peek(IntPtr obj, string part); - - internal static string edje_object_part_text_style_user_peek(IntPtr obj, string part) - { - var text = _edje_object_part_text_style_user_peek(obj, part); - return Marshal.PtrToStringAnsi(text); - } - - [DllImport(Libraries.Elementary)] - internal static extern void edje_object_part_text_style_user_push(IntPtr obj, string part, string style); - - [DllImport(Libraries.Elementary)] - internal static extern void edje_object_part_text_style_user_pop(IntPtr obj, string part); - - [DllImport(Libraries.Elementary)] - internal static extern void edje_object_signal_emit(IntPtr obj, string emission, string source); - - [DllImport(Libraries.Elementary)] - internal static extern void edje_object_mirrored_set(IntPtr obj, bool rtl); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr edje_object_add(IntPtr evas); - - [DllImport(Libraries.Elementary)] - internal static extern bool edje_object_file_set(IntPtr obj, string file, string group); - - [DllImport(Libraries.Elementary)] - internal static extern bool edje_object_part_box_append(IntPtr obj, string part, IntPtr child); - - [DllImport(Libraries.Elementary)] - internal static extern bool edje_object_part_box_prepend(IntPtr obj, string part, IntPtr child); - - [DllImport(Libraries.Elementary, EntryPoint = "edje_object_part_state_get")] - internal static extern IntPtr _edje_object_part_state_get(IntPtr obj, string part, out double value); - - internal static string edje_object_part_state_get(IntPtr obj, string part, out double value) - { - return Marshal.PtrToStringAnsi(_edje_object_part_state_get(obj, part, out value)); - } - - [DllImport(Libraries.Elementary)] - internal static extern void edje_object_signal_callback_add(IntPtr obj, string emission, string source, Edje_Signal_Cb func, IntPtr data); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr edje_object_signal_callback_del(IntPtr obj, string emission, string source, Edje_Signal_Cb func); - - [DllImport(Libraries.Elementary)] - internal static extern void edje_object_signal_callback_del_full(IntPtr obj, string emission, string source, Edje_Signal_Cb func, IntPtr data); - - [DllImport(Libraries.Elementary)] - internal static extern bool edje_color_class_set(string colorClass, int r, int g, int b, int a, int r2, int g2, int b2, int a2, int r3, int g3, int b3, int a3); - - [DllImport(Libraries.Elementary)] - internal static extern bool edje_color_class_get(string colorClass, out int r, out int g, out int b, out int a, out int r2, out int g2, out int b2, out int a2, - out int r3, out int g3, out int b3, out int a3); - - [DllImport(Libraries.Elementary)] - internal static extern bool edje_object_color_class_set(IntPtr obj, string colorClass, int r, int g, int b, int a, int r2, int g2, int b2, int a2, int r3, int g3, int b3, int a3); - - [DllImport(Libraries.Elementary)] - internal static extern bool edje_object_color_class_get(IntPtr obj, string colorClass, out int r, out int g, out int b, out int a, out int r2, out int g2, out int b2, out int a2, - out int r3, out int g3, out int b3, out int a3); - - [DllImport(Libraries.Elementary)] - internal static extern void edje_message_signal_process(); - - [DllImport(Libraries.Elementary)] - internal static extern void edje_object_message_handler_set(IntPtr obj, Edje_Message_Handler_Cb func, IntPtr data); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void Edje_Message_Handler_Cb(IntPtr data, IntPtr obj, Edje_Message_Type type, int id, IntPtr msg); - - [DllImport(Libraries.Elementary)] - internal static extern void edje_object_message_send(IntPtr obj, Edje_Message_Type type, int id, IntPtr msg); - - [DllImport(Libraries.Elementary)] - internal static extern void edje_object_message_signal_process(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern bool edje_object_text_class_set(IntPtr obj, string textClass, string font, int size); - - [DllImport(Libraries.Elementary)] - internal static extern bool edje_object_text_class_get(IntPtr obj, string textClass, out string font, out int size); - - [DllImport(Libraries.Elementary)] - internal static extern bool edje_text_class_set(string textClass, string font, int size); - - [DllImport(Libraries.Elementary)] - internal static extern bool edje_text_class_get(string textClass, out string font, out int size); - - [DllImport(Libraries.Elementary)] - internal static extern void edje_text_class_del(string textClass); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_transit_add(); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_transit_del(IntPtr transit); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_transit_object_add(IntPtr transit, IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_transit_effect_translation_add(IntPtr transit, int fromDx, int fromDy, int toDx, int toDy); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_transit_objects_final_state_keep_set(IntPtr transit, bool stateKeep); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_transit_tween_mode_set(IntPtr transit, int tweenMode); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_transit_repeat_times_set(IntPtr transit, int repeat); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_transit_duration_set(IntPtr transit, double duration); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_transit_go(IntPtr transit); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_transit_effect_zoom_add(IntPtr transit, float fromRate, float toRate); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_transit_effect_color_add(IntPtr transit, int fromR, int fromG, int fromB, int fromA, int toR, int toG, int toB, int toA); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_transit_auto_reverse_set(IntPtr transit, bool reverse); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_transit_effect_add(IntPtr transit, Elm_Transit_Effect_Transition_Cb transitionCb, IntPtr effect, Elm_Transit_Effect_End_Cb endCb); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_transit_effect_fade_add(IntPtr transit); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_transit_effect_resizing_add(IntPtr transit, int fromW, int fromH, int toW, int toH); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_transit_event_enabled_set(IntPtr transit, bool enabled); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_transit_smooth_set(IntPtr transit, bool enabled); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_transit_effect_del(IntPtr transit, Elm_Transit_Effect_Transition_Cb transitionCb, IntPtr effect); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_transit_object_remove(IntPtr transit, IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_transit_objects_final_state_keep_get(IntPtr transit); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_transit_event_enabled_get(IntPtr transit); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_transit_del_cb_set(IntPtr transit, Elm_Transit_Del_Cb cb, IntPtr data); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_transit_auto_reverse_get(IntPtr transit); - - [DllImport(Libraries.Elementary)] - internal static extern int elm_transit_repeat_times_get(IntPtr transit); - - [DllImport(Libraries.Elementary)] - internal static extern int elm_transit_tween_mode_get(IntPtr transit); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_transit_tween_mode_factor_set(IntPtr transit, double v1, double v2); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_transit_tween_mode_factor_get(IntPtr transit, out double v1, out double v2); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_transit_tween_mode_factor_n_set(IntPtr transit, int vSize, out double v); - - [DllImport(Libraries.Elementary)] - internal static extern double elm_transit_duration_get(IntPtr transit); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_transit_go_in(IntPtr transit, double interval); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_transit_paused_set(IntPtr transit, bool paused); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_transit_paused_get(IntPtr transit); - - [DllImport(Libraries.Elementary)] - internal static extern double elm_transit_progress_value_get(IntPtr transit); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_transit_chain_transit_add(IntPtr transit, IntPtr chainTransit); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_transit_chain_transit_del(IntPtr transit, IntPtr chainTransit); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_transit_chain_transits_get(IntPtr transit); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_transit_smooth_get(IntPtr transit); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_transit_effect_flip_add(IntPtr transit, int axis, bool cw); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_transit_effect_resizable_flip_add(IntPtr transit, int axis, bool cw); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_transit_effect_wipe_add(IntPtr transit, int type, int dir); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_transit_effect_blend_add(IntPtr transit); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_transit_effect_rotation_add(IntPtr transit, float fromDegree, float toDegree); - - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_transit_effect_image_animation_add(IntPtr transit, IntPtr images); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate int Eina_Compare_Cb(IntPtr data1, IntPtr data2); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void Elm_Transit_Effect_Transition_Cb(IntPtr effect, IntPtr transit, double progress); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void Elm_Transit_Effect_End_Cb(IntPtr effect, IntPtr transit); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void Elm_Transit_Del_Cb(IntPtr data, IntPtr transit); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_layout_box_insert_at(IntPtr obj, string part, IntPtr child, uint pos); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_layout_box_insert_before(IntPtr obj, string part, IntPtr child, IntPtr reference); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_layout_edje_object_can_access_get(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_layout_edje_object_can_access_set(IntPtr obj, bool canAccess); - - [DllImport(Libraries.Elementary)] - internal static extern int elm_layout_freeze(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_layout_part_cursor_engine_only_get(IntPtr obj, string part); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_layout_part_cursor_engine_only_set(IntPtr obj, string part, bool engineOnly); - - [DllImport(Libraries.Elementary, EntryPoint = "elm_layout_part_cursor_get")] - internal static extern IntPtr _elm_layout_part_cursor_get(IntPtr obj, string part); - - internal static string elm_layout_part_cursor_get(IntPtr obj, string part) - { - return Marshal.PtrToStringAnsi(_elm_layout_part_cursor_get(obj, part)); - } - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_layout_part_cursor_set(IntPtr obj, string part, string cursor); - - [DllImport(Libraries.Elementary, EntryPoint = "elm_layout_part_cursor_style_get")] - internal static extern IntPtr _elm_layout_part_cursor_style_get(IntPtr obj, string part); - - internal static string elm_layout_part_cursor_style_get(IntPtr obj, string part) - { - return Marshal.PtrToStringAnsi(_elm_layout_part_cursor_style_get(obj, part)); - } - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_layout_part_cursor_style_set(IntPtr obj, string part, string style); - - [DllImport(Libraries.Elementary)] - internal static extern bool elm_layout_part_cursor_unset(IntPtr obj, string part); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_layout_sizing_eval(IntPtr obj); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_layout_sizing_restricted_eval(IntPtr obj, bool width, bool height); - - [DllImport(Libraries.Elementary)] - internal static extern int elm_layout_thaw(IntPtr obj); - } -} diff --git a/src/ElmSharp/Interop/Interop.Eo.cs b/src/ElmSharp/Interop/Interop.Eo.cs deleted file mode 100644 index 9ff0936cc..000000000 --- a/src/ElmSharp/Interop/Interop.Eo.cs +++ /dev/null @@ -1,38 +0,0 @@ -/* - * 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 Eo - { - [DllImport(Libraries.Eo)] - internal static extern IntPtr eo_class_get(IntPtr obj); - - [DllImport(Libraries.Eo, EntryPoint = "eo_class_name_get", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true, CharSet = CharSet.Ansi)] - internal static extern IntPtr _eo_class_name_get(IntPtr klass); - - internal static string eo_class_name_get(IntPtr obj) - { - var name = _eo_class_name_get(obj); - return Marshal.PtrToStringAnsi(name); - } - - } - -} \ No newline at end of file diff --git a/src/ElmSharp/Interop/Interop.Evas.Image.cs b/src/ElmSharp/Interop/Interop.Evas.Image.cs deleted file mode 100644 index c18cbdd6a..000000000 --- a/src/ElmSharp/Interop/Interop.Evas.Image.cs +++ /dev/null @@ -1,54 +0,0 @@ -/* - * 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 Evas - { - [DllImport(Libraries.Evas)] - internal static extern void evas_object_image_file_set(IntPtr obj, string file, string key); - - [DllImport(Libraries.Evas)] - internal static extern void evas_object_image_border_set(IntPtr obj, int l, int r, int t, int b); - - [DllImport(Libraries.Evas)] - internal static extern int evas_object_image_border_center_fill_get(IntPtr obj); - - [DllImport(Libraries.Evas)] - internal static extern void evas_object_image_border_center_fill_set(IntPtr obj, int filled); - - [DllImport(Libraries.Evas)] - internal static extern void evas_object_image_alpha_set(IntPtr obj, bool has_alpha); - - [DllImport(Libraries.Evas)] - internal static extern bool evas_object_image_alpha_get(IntPtr obj); - - [DllImport(Libraries.Evas)] - internal static extern LoadError evas_object_image_load_error_get(IntPtr obj); - - [DllImport(Libraries.Evas)] - internal static extern void evas_object_image_size_get(IntPtr obj, IntPtr x, out int y); - - [DllImport(Libraries.Evas)] - internal static extern void evas_object_image_size_get(IntPtr obj, out int x, IntPtr y); - - [DllImport(Libraries.Evas)] - internal static extern void evas_object_image_size_get(IntPtr obj, out int x, out int y); - } -} \ No newline at end of file diff --git a/src/ElmSharp/Interop/Interop.Evas.cs b/src/ElmSharp/Interop/Interop.Evas.cs deleted file mode 100644 index cd4d0b61c..000000000 --- a/src/ElmSharp/Interop/Interop.Evas.cs +++ /dev/null @@ -1,824 +0,0 @@ -/* - * 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 Evas - { - public enum ObjectCallbackType - { - MouseIn, - MouseOut, - MouseDown, - MouseUp, - MouseMove, - MouseWheel, - MultiDown, - MultiUp, - MultiMove, - Free, - KeyDown, - KeyUp, - FocusIn, - FocusOut, - Show, - Hide, - Move, - Resize, - Restack, - Del, - Hold, - ChangedSizeHints, - ImagePreloaded, - CanvasFocusIn, - CanvasFocusOut, - RenderFlushPre, - RenderFlushPost, - CanvasObjectFocusIn, - CanvasObjectFocusOut, - ImageUnloaded, - RenderPre, - RenderPost, - ImageResize, - DeviceChanged, - AxisUpdate, - CanvasViewportResize - } - - public enum LoadError - { - None = 0, /* No error on load */ - Generic = 1, /* A non-specific error occurred */ - DoesNotRxist = 2, /* File (or file path) does not exist */ - PermissionDenied = 3, /* Permission denied to an existing file (or path) */ - ResourceAllocationFailed = 4, /* Allocation of resources failure prevented load */ - CorruptFile = 5, /* File corrupt (but was detected as a known format) */ - UnknownFormat = 6 /* File is not a known format */ - } - - public enum Colorspace - { - Argb8888, /* ARGB 32 bits per pixel, high-byte is Alpha, accessed 1 32bit word at a time */ - Ycbcr422p709pl, /* YCbCr 4:2:2 Planar, ITU.BT-709 specifications. The data pointed to is just an array of row pointer, pointing to the Y rows, then the Cb, then Cr rows */ - Ergb565a5p, /* 16bit rgb565 + Alpha plane at end - 5 bits of the 8 being used per alpha byte */ - Egry8, /* 8bit grayscale */ - Eycbcr422601pl, /* YCbCr 4:2:2, ITU.BT-601 specifications. The data pointed to is just an array of row pointer, pointing to line of Y,Cb,Y,Cr bytes */ - Eycbcr420nv12601pl, /* YCbCr 4:2:0, ITU.BT-601 specification. The data pointed to is just an array of row pointer, pointing to the Y rows, then the Cb,Cr rows. */ - Eycbcr420tm12601pl, /* YCbCr 4:2:0, ITU.BT-601 specification. The data pointed to is just an array of tiled row pointer, pointing to the Y rows, then the Cb,Cr rows. */ - Eagry88, /* AY 8bits Alpha and 8bits Grey, accessed 1 16bits at a time */ - Eetc1, /* OpenGL ETC1 encoding of RGB texture (4 bit per pixel) @since 1.10 */ - Ergb8etc2, /* OpenGL GL_COMPRESSED_RGB8_ETC2 texture compression format (4 bit per pixel) @since 1.10 */ - Ergba8etc2eac, /* OpenGL GL_COMPRESSED_RGBA8_ETC2_EAC texture compression format, supports alpha (8 bit per pixel) @since 1.10 */ - Eetc1alpha, /* ETC1 with alpha support using two planes: ETC1 RGB and ETC1 grey for alpha @since 1.11 */ - } - - public enum ImageScaleHint - { - None = 0, /* No scale hint at all */ - Dynamic = 1, /* Image is being re-scaled over time, thus turning scaling cache @b off for its data */ - Static = 2 /* Image is not being re-scaled over time, thus turning scaling cache @b on for its data */ - } - - public enum RenderOp - { - Blend = 0, /* default op: d = d*(1-sa) + s */ - BlendRel = 1, /* d = d*(1 - sa) + s*da */ - Copy = 2, /* d = s */ - CopyRel = 3, /* d = s*da */ - Add = 4, /* d = d + s */ - AddRel = 5, /* d = d + s*da */ - Sub = 6, /* d = d - s */ - SubRel = 7, /* d = d - s*da */ - Tint = 8, /* d = d*s + d*(1 - sa) + s*(1 - da) */ - TintRel = 9, /* d = d*(1 - sa + s) */ - Mask = 10, /* d = d*sa */ - Mul = 11 /* d = d*s */ - } - - public enum ObjectCallbackPriority - { - After = 100, - Before = -100, - Default = 0 - } - - public enum TableHomogeneousMode - { - None = 0, - Table = 1, - Item = 2 - } - - public enum TextStyleType - { - Plain, /* plain, standard text */ - Shadow, /* text with shadow underneath */ - Outline, /* text with an outline */ - SoftOutline, /* text with a soft outline */ - Glow, /* text with a glow effect */ - OutlineShadow, /* text with both outline and shadow effects */ - FarShadow, /* text with (far) shadow underneath */ - OutlineSoftShadow, /* text with outline and soft shadow effects combined */ - SoftShadow, /* text with(soft) shadow underneath */ - FarSoftShadow, /* text with(far soft) shadow underneath */ - ShadowDirectionBottomRight, /* shadow growing to bottom right */ - ShadowDirectionBottom, /* shadow growing to the bottom */ - ShadowDirectionBottomLeft, /* shadow growing to bottom left */ - ShadowDirectionLeft, /* shadow growing to the left */ - ShadowDirectionTopLeft, /* shadow growing to top left */ - ShadowDirectionTop, /* shadow growing to the top */ - ShadowDirectionTopRight, /* shadow growing to top right */ - ShadowDirectionRight, /* shadow growing to the right */ - } - - //public struct TextBlockStyle - //{ - // string StyleText; - // string DefaultTag; - - // List objects; - // bool DeleteMe; - //} - - //public struct StyleTag - //{ - //} - - internal delegate void EventCallback(IntPtr data, IntPtr evas, IntPtr obj, IntPtr info); - - internal delegate void EvasCallback(IntPtr data, IntPtr evas, IntPtr info); - - [DllImport(Libraries.Evas)] - internal static extern void evas_event_callback_add(IntPtr obj, ObjectCallbackType type, EvasCallback func, IntPtr data); - - [DllImport(Libraries.Evas)] - internal static extern void evas_event_callback_del(IntPtr obj, ObjectCallbackType type, EvasCallback func); - - [DllImport(Libraries.Evas)] - internal static extern void evas_object_event_callback_add(IntPtr obj, ObjectCallbackType type, EventCallback func, IntPtr data); - - [DllImport(Libraries.Evas)] - internal static extern void evas_object_event_callback_del(IntPtr obj, ObjectCallbackType type, EventCallback func); - - public delegate void SmartCallback(IntPtr data, IntPtr obj, IntPtr info); - - public static readonly string BackKeyName = "XF86Back"; - public static readonly string MenuKeyName = "XF86Menu"; - - public enum ButtonFlags - { - None, DoubleClick, TripleClick - } - - [DllImport(Libraries.Evas)] - internal static extern bool evas_object_key_grab(IntPtr obj, string keyname, ulong modifier, ulong not_modifier, bool exclusive); - - [DllImport(Libraries.Evas)] - internal static extern void evas_object_key_ungrab(IntPtr obj, string keyname, ulong modifier, ulong not_modifier); - - [DllImport(Libraries.Evas)] - internal static extern IntPtr evas_object_data_get(IntPtr obj, string keyname); - - [DllImport(Libraries.Evas)] - internal static extern void evas_object_data_set(IntPtr obj, string keyname, IntPtr data); - - [DllImport(Libraries.Evas, EntryPoint = "evas_object_type_get", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true, CharSet = CharSet.Ansi)] - internal static extern IntPtr _evas_object_type_get(IntPtr obj); - - internal static string evas_object_type_get(IntPtr obj) - { - var text = _evas_object_type_get(obj); - return Marshal.PtrToStringAnsi(text); - } - - [DllImport(Libraries.Evas)] - internal static extern IntPtr evas_object_evas_get(IntPtr obj); - - [DllImport(Libraries.Evas)] - internal static extern IntPtr evas_object_image_add(IntPtr obj); - - [DllImport(Libraries.Evas)] - internal static extern void evas_object_del(IntPtr objectPtr); - - [DllImport(Libraries.Evas)] - internal static extern void evas_object_show(IntPtr obj); - - [DllImport(Libraries.Evas)] - internal static extern void evas_object_hide(IntPtr obj); - - [DllImport(Libraries.Evas)] - internal static extern bool evas_object_visible_get(IntPtr obj); - - [DllImport(Libraries.Evas)] - internal static extern void evas_object_smart_callback_add(IntPtr obj, string eventName, SmartCallback seh, IntPtr data); - - [DllImport(Libraries.Evas)] - internal static extern void evas_object_smart_callback_del(IntPtr obj, string eventName, SmartCallback seh); - - [DllImport(Libraries.Evas)] - internal static extern void evas_object_size_hint_min_set(IntPtr obj, int w, int h); - - [DllImport(Libraries.Evas)] - internal static extern void evas_object_size_hint_min_get(IntPtr obj, out int w, out int h); - - [DllImport(Libraries.Evas)] - internal static extern void evas_object_size_hint_min_get(IntPtr obj, IntPtr w, out int h); - - [DllImport(Libraries.Evas)] - internal static extern void evas_object_size_hint_min_get(IntPtr obj, out int w, IntPtr h); - - [DllImport(Libraries.Evas)] - internal static extern void evas_object_size_hint_max_set(IntPtr obj, int w, int h); - - [DllImport(Libraries.Evas)] - internal static extern void evas_object_size_hint_max_get(IntPtr obj, out int w, out int h); - - [DllImport(Libraries.Evas)] - internal static extern void evas_object_size_hint_max_get(IntPtr obj, IntPtr w, out int h); - - [DllImport(Libraries.Evas)] - internal static extern void evas_object_size_hint_max_get(IntPtr obj, out int w, IntPtr h); - - [DllImport(Libraries.Evas)] - internal static extern void evas_object_size_hint_weight_get(IntPtr obj, out double x, out double y); - - [DllImport(Libraries.Evas)] - internal static extern void evas_object_size_hint_weight_get(IntPtr obj, out double x, IntPtr y); - - [DllImport(Libraries.Evas)] - internal static extern void evas_object_size_hint_weight_get(IntPtr obj, IntPtr x, out double y); - - [DllImport(Libraries.Evas)] - internal static extern void evas_object_size_hint_align_get(IntPtr obj, out double x, out double y); - - [DllImport(Libraries.Evas)] - internal static extern void evas_object_size_hint_align_get(IntPtr obj, out double x, IntPtr y); - - [DllImport(Libraries.Evas)] - internal static extern void evas_object_size_hint_align_get(IntPtr obj, IntPtr x, out double y); - - [DllImport(Libraries.Evas)] - internal static extern void evas_object_size_hint_weight_set(IntPtr obj, double x, double y); - - [DllImport(Libraries.Evas)] - internal static extern void evas_object_size_hint_align_set(IntPtr obj, double x, double y); - - [DllImport(Libraries.Evas)] - internal static extern void evas_object_move(IntPtr obj, int x, int y); - - [DllImport(Libraries.Evas)] - internal static extern void evas_object_resize(IntPtr obj, int w, int h); - - [DllImport(Libraries.Evas)] - internal static extern void evas_object_geometry_set(IntPtr obj, int x, int y, int w, int h); - - [DllImport(Libraries.Evas)] - internal static extern void evas_object_geometry_get(IntPtr obj, out int x, out int y, out int w, out int h); - - [DllImport(Libraries.Evas)] - internal static extern void evas_object_geometry_get(IntPtr obj, out int x, IntPtr y, IntPtr w, IntPtr h); - - [DllImport(Libraries.Evas)] - internal static extern void evas_object_geometry_get(IntPtr obj, IntPtr x, out int y, IntPtr w, IntPtr h); - - [DllImport(Libraries.Evas)] - internal static extern void evas_object_geometry_get(IntPtr obj, IntPtr x, IntPtr y, out int w, IntPtr h); - - [DllImport(Libraries.Evas)] - internal static extern void evas_object_geometry_get(IntPtr obj, IntPtr x, IntPtr y, IntPtr w, out int h); - - [DllImport(Libraries.Evas)] - internal static extern void evas_object_geometry_get(IntPtr obj, IntPtr x, IntPtr y, out int w, out int h); - - [DllImport(Libraries.Evas)] - internal static extern void evas_object_geometry_get(IntPtr obj, out int x, out int y, IntPtr w, IntPtr h); - - [DllImport(Libraries.Evas)] - internal static extern IntPtr evas_object_smart_members_get(IntPtr obj); - - [DllImport(Libraries.Evas)] - internal static extern IntPtr evas_map_new(int count); - - [DllImport(Libraries.Evas)] - internal static extern void evas_map_util_points_populate_from_object_full(IntPtr map, IntPtr obj, int z); - - [DllImport(Libraries.Evas)] - internal static extern void evas_map_util_points_populate_from_geometry(IntPtr map, int x, int y, int w, int h, int z); - - [DllImport(Libraries.Evas)] - internal static extern void evas_map_util_rotate(IntPtr map, double degree, int cx, int cy); - - [DllImport(Libraries.Evas)] - internal static extern void evas_map_util_3d_rotate(IntPtr map, double dx, double dy, double dz, int cx, int cy, int cz); - - [DllImport(Libraries.Evas)] - internal static extern void evas_map_util_zoom(IntPtr map, double x, double y, int cx, int cy); - - [DllImport(Libraries.Evas)] - internal static extern void evas_map_point_coord_set(IntPtr map, int idx, int x, int y, int z); - - [DllImport(Libraries.Evas)] - internal static extern void evas_map_point_coord_get(IntPtr map, int idx, out int x, out int y, out int z); - - [DllImport(Libraries.Evas)] - internal static extern void evas_object_map_enable_set(IntPtr obj, bool enabled); - - [DllImport(Libraries.Evas)] - internal static extern bool evas_object_map_enable_get(IntPtr obj); - - [DllImport(Libraries.Evas)] - internal static extern void evas_map_util_object_move_sync_set(IntPtr map, bool enabled); - - [DllImport(Libraries.Evas)] - internal static extern bool evas_map_util_object_move_sync_get(IntPtr map); - - [DllImport(Libraries.Evas)] - internal static extern void evas_object_map_set(IntPtr obj, IntPtr map); - - [DllImport(Libraries.Evas)] - internal static extern IntPtr evas_object_map_get(IntPtr obj); - - [DllImport(Libraries.Evas)] - internal static extern void evas_map_free(IntPtr map); - - [DllImport(Libraries.Evas)] - internal static extern IntPtr evas_object_polygon_add(IntPtr evas); - - [DllImport(Libraries.Evas)] - internal static extern IntPtr evas_object_polygon_point_add(IntPtr evas, int x, int y); - - [DllImport(Libraries.Evas)] - internal static extern IntPtr evas_object_polygon_points_clear(IntPtr evas); - - [DllImport(Libraries.Evas)] - internal static extern IntPtr evas_object_rectangle_add(IntPtr evas); - - [DllImport(Libraries.Evas)] - internal static extern void evas_object_color_set(IntPtr obj, int r, int g, int b, int a); - - [DllImport(Libraries.Evas)] - internal static extern void evas_object_color_get(IntPtr obj, out int r, out int g, out int b, out int a); - - [DllImport(Libraries.Evas)] - internal static extern void evas_object_color_get(IntPtr obj, IntPtr r, IntPtr g, IntPtr b, out int a); - - [DllImport(Libraries.Evas)] - internal static extern void evas_object_clip_set(IntPtr obj, IntPtr clip); - - [DllImport(Libraries.Evas)] - internal static extern void evas_object_clip_unset(IntPtr obj); - - [DllImport(Libraries.Evas)] - internal static extern IntPtr evas_object_clip_get(IntPtr obj); - - [DllImport(Libraries.Evas)] - internal static extern void evas_object_lower(IntPtr obj); - - [DllImport(Libraries.Evas)] - internal static extern void evas_event_feed_mouse_move(IntPtr obj, int x, int y, int timestamp, IntPtr data); - - [DllImport(Libraries.Evas)] - internal static extern void evas_event_feed_mouse_down(IntPtr obj, int b, ButtonFlags flags, int timestamp, IntPtr data); - - [DllImport(Libraries.Evas)] - internal static extern void evas_event_feed_mouse_up(IntPtr obj, int b, ButtonFlags flags, int timestamp, IntPtr data); - - [DllImport(Libraries.Evas)] - internal static extern void evas_event_feed_key_down(IntPtr obj, string keyname, string key, string str, string compose, int timestamp, IntPtr data); - - [DllImport(Libraries.Evas)] - internal static extern void evas_event_feed_key_up(IntPtr obj, string keyname, string key, string str, string compose, int timestamp, IntPtr data); - - [DllImport(Libraries.Evas)] - internal static extern void evas_object_ref(IntPtr obj); - - [DllImport(Libraries.Evas)] - internal static extern void evas_object_unref(IntPtr obj); - - [DllImport(Libraries.Evas)] - internal static extern int evas_object_ref_get(IntPtr obj); - - [DllImport(Libraries.Evas)] - internal static extern void evas_object_repeat_events_set(IntPtr obj, bool repeat); - - [DllImport(Libraries.Evas)] - [return: MarshalAs(UnmanagedType.U1)] - internal static extern bool evas_object_repeat_events_get(IntPtr obj); - - [DllImport(Libraries.Evas)] - internal static extern void evas_object_propagate_events_set(IntPtr obj, bool propagate); - - [DllImport(Libraries.Evas)] - [return: MarshalAs(UnmanagedType.U1)] - internal static extern bool evas_object_propagate_events_get(IntPtr obj); - - [DllImport(Libraries.Evas)] - internal static extern void evas_object_pass_events_set(IntPtr obj, bool propagate); - - [DllImport(Libraries.Evas)] - [return: MarshalAs(UnmanagedType.U1)] - internal static extern bool evas_object_pass_events_get(IntPtr obj); - - [DllImport(Libraries.Evas)] - internal static extern void evas_object_textblock_size_native_get(IntPtr obj, out int w, out int h); - - [DllImport(Libraries.Evas)] - internal static extern void evas_object_textblock_size_formatted_get(IntPtr obj, out int w, out int h); - - [DllImport(Libraries.Evas)] - internal static extern void evas_object_smart_changed(IntPtr obj); - - [DllImport(Libraries.Evas)] - internal static extern void evas_object_smart_calculate(IntPtr obj); - - [DllImport(Libraries.Evas)] - internal static extern void evas_color_argb_premul(int a, ref int r, ref int g, ref int b); - - [DllImport(Libraries.Evas)] - internal static extern void evas_damage_rectangle_add(IntPtr obj, int x, int y, int w, int h); - - [DllImport(Libraries.Evas)] - internal static extern void evas_data_argb_premul(uint data, uint length); - - [DllImport(Libraries.Evas)] - internal static extern void evas_event_callback_del_full(IntPtr obj, ObjectCallbackType type, EvasCallback func, IntPtr data); - - [DllImport(Libraries.Evas)] - internal static extern void evas_font_path_global_append(string path); - - [DllImport(Libraries.Evas)] - internal static extern void evas_image_cache_flush(IntPtr obj); - - [DllImport(Libraries.Evas)] - internal static extern void evas_image_cache_set(IntPtr obj, int size); - - [DllImport(Libraries.Evas)] - internal static extern void evas_pointer_canvas_xy_get(IntPtr obj, out int mx, out int my); - - [DllImport(Libraries.Evas, EntryPoint = "evas_load_error_str")] - internal static extern IntPtr _evas_load_error_str(LoadError error); - - internal static string evas_load_error_str(LoadError error) - { - return Marshal.PtrToStringAnsi(_evas_load_error_str(error)); - } - - [DllImport(Libraries.Evas)] - internal static extern IntPtr evas_object_data_del(IntPtr obj, string key); - - [DllImport(Libraries.Evas)] - internal static extern void evas_object_focus_set(IntPtr obj, bool focus); - - [DllImport(Libraries.Evas)] - internal static extern void evas_object_freeze_events_set(IntPtr obj, bool freeze); - - [DllImport(Libraries.Evas)] - internal static extern void evas_object_image_colorspace_set(IntPtr obj, Colorspace colorSpace); - - [DllImport(Libraries.Evas)] - internal static extern void evas_object_image_data_copy_set(IntPtr obj, IntPtr data); - - [DllImport(Libraries.Evas)] - internal static extern IntPtr evas_object_image_data_get(IntPtr obj, bool forWriting); - - [DllImport(Libraries.Evas)] - internal static extern void evas_object_image_data_set(IntPtr obj, IntPtr data); - - [DllImport(Libraries.Evas)] - internal static extern void evas_object_image_data_update_add(IntPtr obj, int x, int y, int w, int h); - - [DllImport(Libraries.Evas)] - internal static extern void evas_object_image_fill_set(IntPtr obj, int x, int y, int w, int h); - - [DllImport(Libraries.Evas)] - internal static extern IntPtr evas_object_image_filled_add(IntPtr obj); - - [DllImport(Libraries.Evas)] - internal static extern void evas_object_image_filled_set(IntPtr obj, bool setting); - - [DllImport(Libraries.Evas)] - internal static extern void evas_object_image_memfile_set(IntPtr obj, IntPtr data, int size, string format, string key); - - [DllImport(Libraries.Evas)] - internal static extern void evas_object_image_pixels_dirty_set(IntPtr obj, bool dirty); - - [DllImport(Libraries.Evas)] - internal static extern void evas_object_image_save(IntPtr obj, string file, string key, string flags); - - [DllImport(Libraries.Evas)] - internal static extern void evas_object_image_scale_hint_set(IntPtr obj, ImageScaleHint hint); - - [DllImport(Libraries.Evas)] - internal static extern void evas_object_image_size_set(IntPtr obj, int w, int h); - - [DllImport(Libraries.Evas)] - internal static extern void evas_object_image_smooth_scale_set(IntPtr obj, bool smoothScale); - - [DllImport(Libraries.Evas)] - internal static extern void evas_object_image_source_set(IntPtr obj, IntPtr src); - - [DllImport(Libraries.Evas)] - internal static extern void evas_object_image_source_visible_set(IntPtr obj, bool visible); - - [DllImport(Libraries.Evas)] - internal static extern void evas_object_layer_set(IntPtr obj, int layer); - - [DllImport(Libraries.Evas)] - internal static extern void evas_object_raise(IntPtr obj); - - [DllImport(Libraries.Evas)] - internal static extern void evas_object_render_op_set(IntPtr obj, RenderOp op); - - [DllImport(Libraries.Evas)] - internal static extern void evas_object_size_hint_aspect_set(IntPtr obj, int aspect, int w, int h); - - [DllImport(Libraries.Evas)] - internal static extern IntPtr evas_object_smart_add(IntPtr obj, IntPtr smart); - - [DllImport(Libraries.Evas)] - internal static extern IntPtr evas_object_smart_data_get(IntPtr obj); - - [DllImport(Libraries.Evas)] - internal static extern void evas_object_smart_data_set(IntPtr obj, IntPtr data); - - [DllImport(Libraries.Evas)] - internal static extern void evas_object_smart_member_add(IntPtr obj, IntPtr smart); - - [DllImport(Libraries.Evas)] - internal static extern void evas_object_smart_member_del(IntPtr obj); - - [DllImport(Libraries.Evas)] - internal static extern void evas_object_stack_above(IntPtr obj, IntPtr avobe); - - [DllImport(Libraries.Evas)] - internal static extern IntPtr evas_object_text_add(IntPtr obj); - - [DllImport(Libraries.Evas)] - internal static extern void evas_object_text_font_set(IntPtr obj, string font, int size); - - [DllImport(Libraries.Evas)] - internal static extern void evas_object_text_text_set(IntPtr obj, string text); - - [DllImport(Libraries.Evas)] - internal static extern IntPtr evas_object_textblock_add(IntPtr obj); - - [DllImport(Libraries.Evas)] - internal static extern IntPtr evas_object_textblock_style_set(IntPtr obj, IntPtr textBlockStyle); - - [DllImport(Libraries.Evas)] - internal static extern void evas_object_textblock_text_markup_set(IntPtr obj, string text); - - [DllImport(Libraries.Evas)] - internal static extern void evas_obscured_clear(IntPtr obj); - - [DllImport(Libraries.Evas)] - internal static extern IntPtr evas_smart_class_new(IntPtr obj); - - [DllImport(Libraries.Evas, EntryPoint = "evas_device_name_get")] - internal static extern IntPtr _evas_device_name_get(IntPtr obj); - - internal static string evas_device_name_get(IntPtr obj) - { - return Marshal.PtrToStringAnsi(_evas_device_name_get(obj)); - } - - [DllImport(Libraries.Evas)] - internal static extern void evas_font_path_global_clear(); - - [DllImport(Libraries.Evas)] - internal static extern IntPtr evas_object_above_get(IntPtr obj); - - [DllImport(Libraries.Evas)] - internal static extern void evas_object_event_callback_priority_add(IntPtr obj, ObjectCallbackType type, ObjectCallbackPriority priority, EventCallback func, IntPtr data); - - [DllImport(Libraries.Evas)] - internal static extern bool evas_object_focus_get(IntPtr obj); - - [DllImport(Libraries.Evas)] - internal static extern bool evas_object_freeze_events_get(IntPtr obj); - - [DllImport(Libraries.Evas)] - internal static extern int evas_object_layer_get(IntPtr obj); - - [DllImport(Libraries.Evas)] - internal static extern void evas_object_smart_callback_priority_add(IntPtr obj, string eventName, ObjectCallbackPriority priority, EventCallback func, IntPtr data); - - [DllImport(Libraries.Evas)] - internal static extern void evas_object_smart_clipped_smart_set(IntPtr obj); - - [DllImport(Libraries.Evas)] - internal static extern void evas_object_table_homogeneous_set(IntPtr obj, TableHomogeneousMode mode); - - [DllImport(Libraries.Evas)] - internal static extern bool evas_object_table_pack(IntPtr obj, IntPtr child, uint col, uint row, uint colspan, uint rowspan); - - [DllImport(Libraries.Evas)] - internal static extern void evas_object_table_padding_set(IntPtr obj, int horizontal, int vertical); - - [DllImport(Libraries.Evas)] - internal static extern void evas_object_text_filter_program_set(IntPtr obj, string program); - - [DllImport(Libraries.Evas)] - internal static extern void evas_object_text_glow_color_set(IntPtr obj, int r, int g, int b, int a); - - [DllImport(Libraries.Evas)] - internal static extern void evas_object_text_outline_color_set(IntPtr obj, int r, int g, int b, int a); - - [DllImport(Libraries.Evas)] - internal static extern void evas_object_text_shadow_color_set(IntPtr obj, int r, int g, int b, int a); - - [DllImport(Libraries.Evas)] - internal static extern void evas_object_text_style_set(IntPtr obj, TextStyleType type); - - [DllImport(Libraries.Evas)] - internal static extern bool evas_object_textblock_line_number_geometry_get(IntPtr obj, int line, out int x, out int y, out int w, out int h); - - [DllImport(Libraries.Evas)] - internal static extern void evas_object_textblock_valign_set(IntPtr obj, double align); - - [DllImport(Libraries.Evas)] - internal static extern int evas_string_char_len_get(string str); - - [DllImport(Libraries.Evas)] - internal static extern int evas_textblock_style_free(IntPtr obj); - - [DllImport(Libraries.Evas)] - internal static extern IntPtr evas_textblock_style_new(); - - [DllImport(Libraries.Evas)] - internal static extern void evas_textblock_style_set(IntPtr obj, string text); - - [DllImport(Libraries.Evas)] - internal static extern string evas_textblock_text_markup_to_utf8(IntPtr obj, string text); - - [DllImport(Libraries.Evas)] - internal static extern string evas_textblock_text_utf8_to_markup(IntPtr obj, string text); - - [DllImport(Libraries.Evas)] - internal static extern void evas_obscured_rectangle_add(IntPtr obj, int x, int y, int w, int h); - - [DllImport(Libraries.Evas)] - internal static extern void evas_render(IntPtr obj); - - [DllImport(Libraries.Evas)] - internal static extern void evas_norender(IntPtr obj); - - [DllImport(Libraries.Evas)] - internal static extern int evas_image_cache_get(IntPtr obj); - - [DllImport(Libraries.Evas)] - internal static extern void evas_font_path_global_prepend(string path); - - [DllImport(Libraries.Evas)] - internal static extern void evas_color_argb_unpremul(int a, ref int r, ref int g, ref int b); - - [DllImport(Libraries.Evas)] - internal static extern void evas_color_hsv_to_rgb(int r, int g, int b, out float h, out float s, out float v); - - [DllImport(Libraries.Evas)] - internal static extern void evas_color_rgb_to_hsv(float h, float s, float v, out int r, out int g, out int b); - - [DllImport(Libraries.Evas)] - internal static extern void evas_object_stack_below(IntPtr obj, IntPtr below); - - [DllImport(Libraries.Evas)] - internal static extern void evas_object_size_hint_aspect_get(IntPtr obj, out int aspect, out int w, out int h); - - internal static void SetX(IntPtr obj, int x) - { - int y = GetY(obj); - evas_object_move(obj, x, y); - } - - internal static void SetY(IntPtr obj, int y) - { - int x = GetX(obj); - evas_object_move(obj, x, y); - } - - internal static void SetWidth(IntPtr obj, int w) - { - int h = GetHeight(obj); - evas_object_resize(obj, w, h); - } - - internal static void SetHeight(IntPtr obj, int h) - { - int w = GetWidth(obj); - evas_object_resize(obj, w, h); - } - - internal static int GetX(IntPtr obj) - { - int x; - evas_object_geometry_get(obj, out x, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero); - return x; - } - - internal static int GetY(IntPtr obj) - { - int y; - evas_object_geometry_get(obj, IntPtr.Zero, out y, IntPtr.Zero, IntPtr.Zero); - return y; - } - - internal static int GetWidth(IntPtr obj) - { - int w; - evas_object_geometry_get(obj, IntPtr.Zero, IntPtr.Zero, out w, IntPtr.Zero); - return w; - } - - internal static int GetHeight(IntPtr obj) - { - int h; - evas_object_geometry_get(obj, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, out h); - return h; - } - - internal static double GetAlignX(IntPtr obj) - { - double x; - evas_object_size_hint_align_get(obj, out x, IntPtr.Zero); - return x; - } - - internal static double GetAlignY(IntPtr obj) - { - double y; - evas_object_size_hint_align_get(obj, IntPtr.Zero, out y); - return y; - } - - internal static void SetAlignX(IntPtr obj, double x) - { - double y = GetAlignY(obj); - evas_object_size_hint_align_set(obj, x, y); - } - - internal static void SetAlignY(IntPtr obj, double y) - { - double x = GetAlignX(obj); - evas_object_size_hint_align_set(obj, x, y); - } - - internal static double GetWeightX(IntPtr obj) - { - double x; - evas_object_size_hint_weight_get(obj, out x, IntPtr.Zero); - return x; - } - - internal static double GetWeightY(IntPtr obj) - { - double y; - evas_object_size_hint_weight_get(obj, IntPtr.Zero, out y); - return y; - } - - internal static void SetWeightX(IntPtr obj, double x) - { - double y = GetWeightY(obj); - evas_object_size_hint_weight_set(obj, x, y); - } - - internal static void SetWeightY(IntPtr obj, double y) - { - double x = GetWeightX(obj); - evas_object_size_hint_weight_set(obj, x, y); - } - - internal static int GetAlpha(IntPtr obj) - { - int a; - evas_object_color_get(obj, IntPtr.Zero, IntPtr.Zero, IntPtr.Zero, out a); - return a; - } - - internal static void SetAlpha(IntPtr obj, int a) - { - evas_object_color_set(obj, a, a, a, a); - } - - internal static void SetPremultipliedColor(IntPtr obj, int r, int g, int b, int a) - { - evas_object_color_set(obj, r * a / 255, g * a / 255, b * a / 255, a); - } - } -} \ No newline at end of file diff --git a/src/ElmSharp/Interop/Interop.Libc.cs b/src/ElmSharp/Interop/Interop.Libc.cs deleted file mode 100644 index 1e29684d9..000000000 --- a/src/ElmSharp/Interop/Interop.Libc.cs +++ /dev/null @@ -1,67 +0,0 @@ -/* - * 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 Libc - { - [DllImport(Libraries.Libc, EntryPoint = "free", CallingConvention = CallingConvention.Cdecl)] - internal static extern int Free(IntPtr ptr); - - // Broken-down time is stored in the structure tm which is defined in as follows: - [StructLayout(LayoutKind.Sequential)] - internal struct SystemTime - { - public int tm_sec; - public int tm_min; - public int tm_hour; - public int tm_mday; - public int tm_mon; - public int tm_year; - public int tm_wday; - public int tm_yday; - public int tm_isdst; - - // The glibc version of struct tm has additional fields - public long tm_gmtoff; - public IntPtr tm_zone; - - public static implicit operator SystemTime(DateTime value) - { - SystemTime tm = new SystemTime(); - tm.tm_sec = value.Second; - tm.tm_min = value.Minute; - tm.tm_hour = value.Hour; - tm.tm_mday = value.Day; - tm.tm_mon = value.Month - 1; - tm.tm_year = value.Year - 1900; - tm.tm_wday = (int)value.DayOfWeek; - tm.tm_yday = value.DayOfYear; - tm.tm_isdst = value.IsDaylightSavingTime() ? 1 : 0; - return tm; - } - - public static implicit operator DateTime(SystemTime value) - { - DateTime date = new DateTime(value.tm_year + 1900, value.tm_mon + 1, value.tm_mday, value.tm_hour, value.tm_min, value.tm_sec); - return date; - } - } - } -} diff --git a/src/ElmSharp/Interop/Interop.Libdl.cs b/src/ElmSharp/Interop/Interop.Libdl.cs deleted file mode 100644 index 4f233f856..000000000 --- a/src/ElmSharp/Interop/Interop.Libdl.cs +++ /dev/null @@ -1,60 +0,0 @@ -/* - * 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 Libdl - { - private const int RTLD_NOW = 2; - - [DllImport(Libraries.Libdl)] - private static extern IntPtr dlopen(string filename, int flags); - - [DllImport(Libraries.Libdl)] - private static extern int dlclose(IntPtr handle); - - [DllImport(Libraries.Libdl)] - private static extern IntPtr dlsym(IntPtr handle, string symbol); - - [DllImport(Libraries.Libdl)] - private static extern IntPtr dlerror(); - - internal static IntPtr LoadLibrary(string filename) - { - return dlopen(filename, RTLD_NOW); - } - - internal static void FreeLibrary(IntPtr handle) - { - dlclose(handle); - } - - internal static IntPtr GetProcAddress(IntPtr handle, string name) - { - dlerror(); - var res = dlsym(handle, name); - var errPtr = dlerror(); - if (errPtr != IntPtr.Zero) - { - throw new Exception("dlsym : " + Marshal.PtrToStringAnsi(errPtr)); - } - return res; - } - } -} diff --git a/src/ElmSharp/Interop/Interop.Libraries.cs b/src/ElmSharp/Interop/Interop.Libraries.cs deleted file mode 100644 index 7f1ca6a7e..000000000 --- a/src/ElmSharp/Interop/Interop.Libraries.cs +++ /dev/null @@ -1,31 +0,0 @@ -/* - * 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 class Libraries - { - internal const string Libc = "libc.so.6"; - internal const string Libdl = "libdl.so.2"; - internal const string Evas = "libevas.so.1"; - internal const string Elementary = "libelementary.so.1"; - internal const string Eina = "libeina.so.1"; - internal const string Ecore = "libecore.so.1"; - internal const string EcoreInput = "libecore_input.so.1"; - internal const string Eo = "libeo.so.1"; - internal const string Eext = "libefl-extension.so.0"; - } -} diff --git a/src/NUI/CoreUIApplication.cs b/src/NUI/CoreUIApplication.cs new file mode 100755 index 000000000..f59b55a19 --- /dev/null +++ b/src/NUI/CoreUIApplication.cs @@ -0,0 +1,142 @@ +/* + * Copyright (c) 2016 Samsung Electronics Co., Ltd. + * + * 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.NUI; + +namespace Tizen +{ + public class Log + { + public static void Error(params object[] s) {} + public static void Debug(params object[] s) {} + public static void Fatal(params object[] s) {} + } +} + +namespace Tizen.NUI +{ + + public class ReceivedAppControlArgs + { + public int ApplicationId; + public int CallerApplicationId; + public int IsReplyRequest; + } + + public class AppControlReceivedEventArgs + { + public ReceivedAppControlArgs ReceivedAppControl; + } + + public class LocaleChangedEventArgs + { } + + public class LowMemoryEventArgs + { } + + public class LowBatteryEventArgs + { } + + public class RegionFormatChangedEventArgs + { } + + + /// + /// Represents an application that have UI screen. The NUIApplication class has a default stage. + /// + public class CoreUIApplication + { + /// + /// The default constructor. + /// + public CoreUIApplication() + { + } + + /// + /// Overrides this method if want to handle behavior. + /// + protected virtual void OnPause() + { + } + + /// + /// Overrides this method if want to handle behavior before calling OnCreate(). + /// stage property is initialized in this overrided method. + /// + protected virtual void OnPreCreate() + { + } + + /// + /// Overrides this method if want to handle behavior. + /// + protected virtual void OnResume() + { + } + + /// + /// Overrides this method if want to handle behavior. + /// + protected virtual void OnAppControlReceived(AppControlReceivedEventArgs e) + { + } + + /// + /// Overrides this method if want to handle behavior. + /// + protected virtual void OnCreate() + { + } + + /// + /// Overrides this method if want to handle behavior. + /// + protected virtual void OnLocaleChanged(LocaleChangedEventArgs e) + { + } + + /// + /// Overrides this method if want to handle behavior. + /// + protected virtual void OnLowBattery(LowBatteryEventArgs e) + { + } + + /// + /// Overrides this method if want to handle behavior. + /// + protected virtual void OnLowMemory(LowMemoryEventArgs e) + { + } + + /// + /// Overrides this method if want to handle behavior. + /// + protected virtual void OnRegionFormatChanged(RegionFormatChangedEventArgs e) + { + } + + /// + /// Overrides this method if want to handle behavior. + /// + protected virtual void OnTerminate() + { + } + } +} \ No newline at end of file diff --git a/src/NUI/NUIApplication.cs b/src/NUI/NUIApplication.cs new file mode 100755 index 000000000..f7ec4a7ad --- /dev/null +++ b/src/NUI/NUIApplication.cs @@ -0,0 +1,249 @@ +/* + * Copyright (c) 2016 Samsung Electronics Co., Ltd. + * + * 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.NUI; + +namespace Tizen.NUI +{ + + /// + /// Represents an application that have UI screen. The NUIApplication class has a default stage. + /// + public class NUIApplication : CoreUIApplication + { + private void LOG(string _str) + { + //Tizen.Log.Debug("NUI", _str); + //Console.WriteLine("[NUI]" + _str); + } + + /// + /// The instance of the Application. + /// + /// + /// This application is created before OnCreate() or created event. And the NUIApplication will be terminated when this application is closed. + /// + private Application _application; + + /// + /// The instance of the Dali Application extension. + /// + private ApplicationExtensions _applicationExt; + + /// + /// Store the stylesheet value. + /// + private string _stylesheet; + + /// + /// Store the window mode value. + /// + private Application.WindowMode _windowMode; + + /// + /// Store the app mode value. + /// + private AppMode _appMode; + + private Window _stage; + + /// + /// The default constructor. + /// + public NUIApplication() : base() + { + _appMode = AppMode.Default; + } + + /// + /// The constructor with stylesheet. + /// + public NUIApplication(string stylesheet) : base() + { + //handle the stylesheet + _appMode = AppMode.StyleSheetOnly; + _stylesheet = stylesheet; + } + + /// + /// The constructor with stylesheet and window mode. + /// + public NUIApplication(string stylesheet, WindowMode windowMode) : base() + { + //handle the stylesheet and windowMode + _appMode = AppMode.StyleSheetWithWindowMode; + _stylesheet = stylesheet; + _windowMode = (Application.WindowMode)windowMode; + } + + /// + /// Overrides this method if want to handle behavior. + /// + protected override void OnPause() + { + base.OnPause(); + _applicationExt.Pause(); + LOG("OnPause() is called!"); + } + + /// + /// Overrides this method if want to handle behavior before calling OnCreate(). + /// stage property is initialized in this overrided method. + /// + protected override void OnPreCreate() + { + _applicationExt = new ApplicationExtensions(_application); + // _applicationExt.Init(); + + _stage = Window.Instance; + _stage.SetBackgroundColor(Color.White); + LOG("OnPreCreate() is called!"); + } + + /// + /// Overrides this method if want to handle behavior. + /// + protected override void OnResume() + { + base.OnResume(); + _applicationExt.Resume(); + LOG("OnResume() is called!"); + } + + /// + /// Overrides this method if want to handle behavior. + /// + protected override void OnAppControlReceived(AppControlReceivedEventArgs e) + { + base.OnAppControlReceived(e); + LOG("OnAppControlReceived() is called!"); + if (e != null) + { + LOG("OnAppControlReceived() is called! ApplicationId=" + e.ReceivedAppControl.ApplicationId); + LOG("CallerApplicationId=" + e.ReceivedAppControl.CallerApplicationId + " IsReplyRequest=" + e.ReceivedAppControl.IsReplyRequest); + } + } + + /// + /// Overrides this method if want to handle behavior. + /// + protected override void OnCreate() + { + base.OnCreate(); + LOG("OnCreate() is called!"); + } + + /// + /// Overrides this method if want to handle behavior. + /// + protected override void OnLocaleChanged(LocaleChangedEventArgs e) + { + base.OnLocaleChanged(e); + _applicationExt.LanguageChange(); + LOG("OnLocaleChanged() is called!"); + } + + /// + /// Overrides this method if want to handle behavior. + /// + protected override void OnLowBattery(LowBatteryEventArgs e) + { + base.OnLowBattery(e); + LOG("OnLowBattery() is called!"); + } + + /// + /// Overrides this method if want to handle behavior. + /// + protected override void OnLowMemory(LowMemoryEventArgs e) + { + base.OnLowMemory(e); + LOG("OnLowMemory() is called!"); + } + + /// + /// Overrides this method if want to handle behavior. + /// + protected override void OnRegionFormatChanged(RegionFormatChangedEventArgs e) + { + base.OnRegionFormatChanged(e); + LOG("OnRegionFormatChanged() is called!"); + } + + /// + /// Overrides this method if want to handle behavior. + /// + protected override void OnTerminate() + { + base.OnTerminate(); + _applicationExt.Terminate(); + LOG("OnTerminate() is called!"); + } + + /// + /// The mode of creating NUI application. + /// + private enum AppMode + { + Default = 0, + StyleSheetOnly = 1, + StyleSheetWithWindowMode = 2 + } + + /// + /// Enumeration for deciding whether a NUI application window is opaque or transparent. + /// + public enum WindowMode + { + Opaque = 0, + Transparent = 1 + } + + internal void CreateApp() + { + switch (_appMode) + { + case AppMode.Default: + _application = Tizen.NUI.Application.NewApplication(); + break; + case AppMode.StyleSheetOnly: + _application = Tizen.NUI.Application.NewApplication(_stylesheet); + break; + case AppMode.StyleSheetWithWindowMode: + _application = Tizen.NUI.Application.NewApplication(_stylesheet, _windowMode); + break; + default: + break; + } + + } + + public void Run(string[] args) + { + CreateApp(); + _application.Initialized += Initialize; + _application.MainLoop(); + } + + internal void Initialize(object source, NUIApplicationInitEventArgs e) + { + OnPreCreate(); + OnCreate(); + } + } +} \ No newline at end of file diff --git a/src/NUI/TizenApplicationDummy.cs b/src/NUI/TizenApplicationDummy.cs new file mode 100755 index 000000000..0f9ddbd9b --- /dev/null +++ b/src/NUI/TizenApplicationDummy.cs @@ -0,0 +1,28 @@ +/* + * Copyright (c) 2016 Samsung Electronics Co., Ltd. + * + * 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.String; +//using System.Environment; + +namespace Tizen.Applications.Application.Current +{ + public class DirectoryInfo + { + //private static readonly Tizen.Applications.Application.Current.DirectoryInfo _directoryInfo = new DirectoryInfo(); + public static string Resource = System.Environment.CurrentDirectory; + } +} \ No newline at end of file diff --git a/src/Tizen.Account.AccountManager/Interop/Interop.Account.cs b/src/Tizen.Account.AccountManager/Interop/Interop.Account.cs deleted file mode 100644 index 90489bc04..000000000 --- a/src/Tizen.Account.AccountManager/Interop/Interop.Account.cs +++ /dev/null @@ -1,154 +0,0 @@ -/* - * 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; -using Tizen.Account.AccountManager; -/// -/// Interop for Account class APIs. -/// -/// 3 -internal static partial class Interop -{ - /// - /// Interop for Account class APIs. - /// - /// 3 - internal static partial class Account - { - [DllImport(Libraries.AccountSvc, EntryPoint = "account_create", CallingConvention = CallingConvention.Cdecl)] - internal static extern int Create(out SafeAccountHandle handle); - - - [DllImport(Libraries.AccountSvc, EntryPoint = "account_destroy", CallingConvention = CallingConvention.Cdecl)] - internal static extern int Destroy(IntPtr handle); - - [DllImport(Libraries.AccountSvc, EntryPoint = "account_get_account_id", CallingConvention = CallingConvention.Cdecl)] - internal static extern int GetAccountId(SafeAccountHandle data, out int accountId); - - [DllImport(Libraries.AccountSvc, EntryPoint = "account_get_user_name", CallingConvention = CallingConvention.Cdecl)] - internal static extern int GetAccountUserName(SafeAccountHandle data, out string userName); - - [DllImport(Libraries.AccountSvc, EntryPoint = "account_set_user_name", CallingConvention = CallingConvention.Cdecl)] - internal static extern int SetAccountUserName(SafeAccountHandle handle, string userName); - - [DllImport(Libraries.AccountSvc, EntryPoint = "account_get_display_name", CallingConvention = CallingConvention.Cdecl)] - internal static extern int GetAccountDisplayName(SafeAccountHandle handle, out string displayName); - - [DllImport(Libraries.AccountSvc, EntryPoint = "account_set_display_name", CallingConvention = CallingConvention.Cdecl)] - internal static extern int SetAccountDisplayName(SafeAccountHandle handle, string displayName); - - [DllImport(Libraries.AccountSvc, EntryPoint = "account_get_capability", CallingConvention = CallingConvention.Cdecl)] - internal static extern int GetAccountCapability(SafeAccountHandle handle, string capabilityType, out int capabilityValue); - - [DllImport(Libraries.AccountSvc, EntryPoint = "account_set_capability", CallingConvention = CallingConvention.Cdecl)] - internal static extern int SetAccountCapability(SafeAccountHandle handle, string capabilityType, int capabilityValue); - - [DllImport(Libraries.AccountSvc, EntryPoint = "account_get_icon_path", CallingConvention = CallingConvention.Cdecl)] - internal static extern int GetAccountIconPath(SafeAccountHandle handle, out string iconPath); - - [DllImport(Libraries.AccountSvc, EntryPoint = "account_set_icon_path", CallingConvention = CallingConvention.Cdecl)] - internal static extern int SetAccountIconPath(SafeAccountHandle handle, string iconPath); - - [DllImport(Libraries.AccountSvc, EntryPoint = "account_get_domain_name", CallingConvention = CallingConvention.Cdecl)] - internal static extern int GetAccountDomainName(SafeAccountHandle handle, out string domainName); - - [DllImport(Libraries.AccountSvc, EntryPoint = "account_set_domain_name", CallingConvention = CallingConvention.Cdecl)] - internal static extern int SetAccountDomainName(SafeAccountHandle handle, string domainName); - - [DllImport(Libraries.AccountSvc, EntryPoint = "account_get_email_address", CallingConvention = CallingConvention.Cdecl)] - internal static extern int GetAccountEmail(SafeAccountHandle handle, out string email); - - [DllImport(Libraries.AccountSvc, EntryPoint = "account_set_email_address", CallingConvention = CallingConvention.Cdecl)] - internal static extern int SetAccountEmail(SafeAccountHandle handle, string email); - - [DllImport(Libraries.AccountSvc, EntryPoint = "account_get_package_name", CallingConvention = CallingConvention.Cdecl)] - internal static extern int GetAccountPackageName(SafeAccountHandle handle, out string name); - - [DllImport(Libraries.AccountSvc, EntryPoint = "account_set_package_name", CallingConvention = CallingConvention.Cdecl)] - internal static extern int SetAccountPackageName(SafeAccountHandle handle, string name); - - [DllImport(Libraries.AccountSvc, EntryPoint = "account_get_access_token", CallingConvention = CallingConvention.Cdecl)] - internal static extern int GetAccountAccessToken(SafeAccountHandle handle, out string accessToken); - - [DllImport(Libraries.AccountSvc, EntryPoint = "account_set_access_token", CallingConvention = CallingConvention.Cdecl)] - internal static extern int SetAccountAccessToken(SafeAccountHandle handle, string accessToken); - - [DllImport(Libraries.AccountSvc, EntryPoint = "account_get_user_text", CallingConvention = CallingConvention.Cdecl)] - internal static extern int GetAccountUserText(SafeAccountHandle handle, int index, out string userText); - - [DllImport(Libraries.AccountSvc, EntryPoint = "account_set_user_text", CallingConvention = CallingConvention.Cdecl)] - internal static extern int SetAccountUserText(SafeAccountHandle handle, int index, string userText); - - [DllImport(Libraries.AccountSvc, EntryPoint = "account_get_user_int", CallingConvention = CallingConvention.Cdecl)] - internal static extern int GetAccountUserInt(SafeAccountHandle handle, int index, out int value); - - [DllImport(Libraries.AccountSvc, EntryPoint = "account_set_user_int", CallingConvention = CallingConvention.Cdecl)] - internal static extern int SetAccountUserInt(SafeAccountHandle handle, int index, int value); - - [DllImport(Libraries.AccountSvc, EntryPoint = "account_get_auth_type", CallingConvention = CallingConvention.Cdecl)] - internal static extern int GetAccountAuthType(SafeAccountHandle handle, out int authType); - - [DllImport(Libraries.AccountSvc, EntryPoint = "account_set_auth_type", CallingConvention = CallingConvention.Cdecl)] - internal static extern int SetAccountAuthType(SafeAccountHandle handle, int authType); - - [DllImport(Libraries.AccountSvc, EntryPoint = "account_get_secret", CallingConvention = CallingConvention.Cdecl)] - internal static extern int GetAccountSercet(SafeAccountHandle handle, out int secretType); - - [DllImport(Libraries.AccountSvc, EntryPoint = "account_set_secret", CallingConvention = CallingConvention.Cdecl)] - internal static extern int SetAccountSecret(SafeAccountHandle handle, int secretType); - - [DllImport(Libraries.AccountSvc, EntryPoint = "account_get_sync_support", CallingConvention = CallingConvention.Cdecl)] - internal static extern int GetAccountSyncSupport(SafeAccountHandle handle, out int syncType); - - [DllImport(Libraries.AccountSvc, EntryPoint = "account_set_sync_support", CallingConvention = CallingConvention.Cdecl)] - internal static extern int SetAccountSyncSupport(SafeAccountHandle handle, int syncType); - - [DllImport(Libraries.AccountSvc, EntryPoint = "account_get_source", CallingConvention = CallingConvention.Cdecl)] - internal static extern int GetAccountSource(SafeAccountHandle handle, out string source); - - [DllImport(Libraries.AccountSvc, EntryPoint = "account_set_source", CallingConvention = CallingConvention.Cdecl)] - internal static extern int SetAccountSource(SafeAccountHandle handle, string source); - - [DllImport(Libraries.AccountSvc, EntryPoint = "account_get_custom", CallingConvention = CallingConvention.Cdecl)] - internal static extern int GetAccountCustomValue(SafeAccountHandle handle, string key, out string value); - - [DllImport(Libraries.AccountSvc, EntryPoint = "account_set_custom", CallingConvention = CallingConvention.Cdecl)] - internal static extern int SetAccountCustomValue(SafeAccountHandle handle, string key, string value); - - [DllImport(Libraries.AccountSvc, EntryPoint = "account_update_sync_status_by_id", CallingConvention = CallingConvention.Cdecl)] - internal static extern int UpdateAccountSyncStatusById(int accountId, int status); - - [DllImport(Libraries.AccountSvc, EntryPoint = "account_get_capability_all")] - internal static extern int GetAllAccountCapabilities(SafeAccountHandle handle, AccountCapabilityCallback callback, IntPtr userData); - - [DllImport(Libraries.AccountSvc, EntryPoint = "account_query_capability_by_account_id")] - internal static extern int QueryAccountCapabilityById(AccountCapabilityCallback callback, int accountId, IntPtr userData); - - [DllImport(Libraries.AccountSvc, EntryPoint = "account_get_custom_all")] - internal static extern int GetAllAccountCustomValues(SafeAccountHandle handle, AccountCustomCallback callback, IntPtr userData); - - //Callbacks - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool AccountCapabilityCallback(string capabilityType, int capabilityState, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool AccountCustomCallback(string key, string value, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool AccountCallback(IntPtr data, IntPtr userData); - } -} diff --git a/src/Tizen.Account.AccountManager/Interop/Interop.AccountProvider.cs b/src/Tizen.Account.AccountManager/Interop/Interop.AccountProvider.cs deleted file mode 100644 index 02f631420..000000000 --- a/src/Tizen.Account.AccountManager/Interop/Interop.AccountProvider.cs +++ /dev/null @@ -1,92 +0,0 @@ -/* - * 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; -using Tizen.Account.AccountManager; - -/// -/// Interop for AccountProvider class APIs. -/// -/// 3 -internal static partial class Interop -{ - /// - /// Interop for AccountProvider class APIs. - /// - /// 3 - internal static partial class AccountProvider - { - - [DllImport(Libraries.AccountSvc, EntryPoint = "account_type_create", CallingConvention = CallingConvention.Cdecl)] - internal static extern int Create(out IntPtr handle); - - [DllImport(Libraries.AccountSvc, EntryPoint = "account_type_destroy", CallingConvention = CallingConvention.Cdecl)] - internal static extern int Destroy(IntPtr handle); - - [DllImport(Libraries.AccountSvc, EntryPoint = "account_type_get_app_id", CallingConvention = CallingConvention.Cdecl)] - internal static extern int GetAppId(IntPtr handle, out string appId); - - [DllImport(Libraries.AccountSvc, EntryPoint = "account_type_query_supported_feature", CallingConvention = CallingConvention.Cdecl)] - [return: MarshalAs(UnmanagedType.I1)] - internal static extern bool IsFeatureSupported(string appId, string capability); - - [DllImport(Libraries.AccountSvc, EntryPoint = "account_type_get_service_provider_id", CallingConvention = CallingConvention.Cdecl)] - internal static extern int GetServiceProviderId(IntPtr handle, out string providerId); - - [DllImport(Libraries.AccountSvc, EntryPoint = "account_type_get_icon_path", CallingConvention = CallingConvention.Cdecl)] - internal static extern int GetAccountProviderIconPath(IntPtr handle, out string iconPath); - - [DllImport(Libraries.AccountSvc, EntryPoint = "account_type_get_small_icon_path", CallingConvention = CallingConvention.Cdecl)] - internal static extern int GetAccountProviderSmallIconPath(IntPtr handle, out string iconPath); - - [DllImport(Libraries.AccountSvc, EntryPoint = "account_type_get_multiple_account_support", CallingConvention = CallingConvention.Cdecl)] - internal static extern int GetMultipleAccountSupport(IntPtr handle, out int suppport); - - [DllImport(Libraries.AccountSvc, EntryPoint = "account_type_get_label_by_locale", CallingConvention = CallingConvention.Cdecl)] - internal static extern int GetlabelbyLocale(IntPtr handle, string locale, out string label); - - [DllImport(Libraries.AccountSvc, EntryPoint = "account_type_query_app_id_exist", CallingConvention = CallingConvention.Cdecl)] - internal static extern int GetAppIdExists(string appId); - - [DllImport(Libraries.AccountSvc, EntryPoint = "account_type_foreach_account_type_from_db", CallingConvention = CallingConvention.Cdecl)] - internal static extern int GetAllAccountProviders(AccountProviderCallback callback, IntPtr data); - - [DllImport(Libraries.AccountSvc, EntryPoint = "account_type_query_provider_feature_by_app_id")] - internal static extern int GetAccountProviderFeaturesByAppId(AccountProviderFeatureCallback callback, string appId, IntPtr userData); - - [DllImport(Libraries.AccountSvc, EntryPoint = "account_type_get_provider_feature_all")] - internal static extern int GetAccountProviderFeatures(IntPtr handle, AccountProviderFeatureCallback callback, IntPtr userData); - - [DllImport(Libraries.AccountSvc, EntryPoint = "account_type_get_label")] - internal static extern int GetAccountProviderLabels(IntPtr handle, LabelCallback callback, IntPtr userData); - - [DllImport(Libraries.AccountSvc, EntryPoint = "account_type_query_label_by_app_id")] - internal static extern int GetLablesByAppId(LabelCallback callback, string appId, IntPtr userData); - - - //Callbacks - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool AccountProviderFeatureCallback(string appId, string key, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool AccountProviderCallback(IntPtr handle, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool LabelCallback(string appId, string label, string locale, IntPtr user_data); - - } -} diff --git a/src/Tizen.Account.AccountManager/Interop/Interop.AccountService.cs b/src/Tizen.Account.AccountManager/Interop/Interop.AccountService.cs deleted file mode 100644 index 1995ce06c..000000000 --- a/src/Tizen.Account.AccountManager/Interop/Interop.AccountService.cs +++ /dev/null @@ -1,119 +0,0 @@ -/* - * 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; -using Tizen.Account.AccountManager; - -/// -/// Interop for Account class APIs. -/// -/// 3 -internal static partial class Interop -{ - /// - /// Interop for Account class APIs. - /// - /// 3 - internal static partial class AccountService - { - [DllImport(Libraries.AccountSvc, EntryPoint = "account_update_to_db_by_id", CallingConvention = CallingConvention.Cdecl)] - internal static extern int UpdateAccountToDBById(SafeAccountHandle handle, int id); - - [DllImport(Libraries.AccountSvc, EntryPoint = "account_update_to_db_by_user_name", CallingConvention = CallingConvention.Cdecl)] - internal static extern int UpdateAccountToDBByUserName(IntPtr handle, string userName, string packageName); - - [DllImport(Libraries.AccountSvc, EntryPoint = "account_query_account_by_account_id", CallingConvention = CallingConvention.Cdecl)] - internal static extern int QueryAccountById(int accountId, ref SafeAccountHandle handle); - - [DllImport(Libraries.AccountSvc, EntryPoint = "account_query_account_by_user_name", CallingConvention = CallingConvention.Cdecl)] - internal static extern int QueryAccountByUserName(Interop.Account.AccountCallback callback, string userName, IntPtr userData); - - [DllImport(Libraries.AccountSvc, EntryPoint = "account_query_account_by_package_name", CallingConvention = CallingConvention.Cdecl)] - internal static extern int QueryAccountByPackageName(Interop.Account.AccountCallback callback, string packageName, IntPtr userData); - - [DllImport(Libraries.AccountSvc, EntryPoint = "account_query_capability_by_account_id", CallingConvention = CallingConvention.Cdecl)] - internal static extern int QueryAccountCapabilityById(Interop.Account.AccountCapabilityCallback callback, int accoutId, IntPtr data); - - [DllImport(Libraries.AccountSvc, EntryPoint = "account_update_sync_status_by_id", CallingConvention = CallingConvention.Cdecl)] - internal static extern int UpdateAccountSyncStatusById(int accoutId, int status); - - [DllImport(Libraries.AccountSvc, EntryPoint = "account_insert_to_db", CallingConvention = CallingConvention.Cdecl)] - internal static extern int AddAccount(SafeAccountHandle handle, out int accountId); - - [DllImport(Libraries.AccountSvc, EntryPoint = "account_delete_from_db_by_id", CallingConvention = CallingConvention.Cdecl)] - internal static extern int DeleteAccountById(int accountId); - - [DllImport(Libraries.AccountSvc, EntryPoint = "account_delete_from_db_by_user_name", CallingConvention = CallingConvention.Cdecl)] - internal static extern int DeleteAccountByUser(string userName, string packageName); - - [DllImport(Libraries.AccountSvc, EntryPoint = "account_delete_from_db_by_package_name", CallingConvention = CallingConvention.Cdecl)] - internal static extern int DeleteAccountByPackage(string packageName); - - [DllImport(Libraries.AccountSvc, EntryPoint = "account_get_total_count_from_db", CallingConvention = CallingConvention.Cdecl)] - internal static extern int GetAccountCount(out int count); - - [DllImport(Libraries.AccountSvc, EntryPoint = "account_foreach_account_from_db")] - internal static extern int AccountForeachAccountFromDb(Interop.Account.AccountCallback callback, IntPtr userData); - - [DllImport(Libraries.AccountSvc, EntryPoint = "account_query_account_by_capability")] - internal static extern int GetAccountByCapability(Interop.Account.AccountCallback callback, string capabilityType, int value, IntPtr userData); - - [DllImport(Libraries.AccountSvc, EntryPoint = "account_query_account_by_capability_type")] - internal static extern int GetAccountByCapabilityType(Interop.Account.AccountCallback callback, string capabilityType, IntPtr userData); - - [DllImport(Libraries.AccountSvc, EntryPoint = "account_type_foreach_account_type_from_db")] - internal static extern int GetAllAccountproviders(Interop.AccountProvider.AccountProviderCallback callback, IntPtr userData); - - [DllImport(Libraries.AccountSvc, EntryPoint = "account_type_query_by_provider_feature")] - internal static extern int GetAccountProviderByFeature(Interop.AccountProvider.AccountProviderCallback callback, string key, IntPtr userData); - - [DllImport(Libraries.AccountSvc, EntryPoint = "account_type_query_by_app_id")] - internal static extern int GetAccountProviderByAppId(string appId, out IntPtr handle); - - [DllImport(Libraries.AccountSvc, EntryPoint = "account_subscribe_create")] - internal static extern int CreateAccountSubscriber(out Interop.AccountService.SafeAccountSubscriberHandle handle); - - [DllImport(Libraries.AccountSvc, EntryPoint = "account_subscribe_notification")] - internal static extern int RegisterSubscriber(Interop.AccountService.SafeAccountSubscriberHandle handle, Interop.AccountService.SubscribeCallback callback, IntPtr userData); - - [DllImport(Libraries.AccountSvc, EntryPoint = "account_unsubscribe_notification")] - internal static extern int UnregisterSubscriber(Interop.AccountService.SafeAccountSubscriberHandle handle); - - //Callbacks - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool SubscribeCallback(string eventType, int accountId, IntPtr userData); - - internal sealed class SafeAccountSubscriberHandle : SafeHandle - { - public SafeAccountSubscriberHandle() - : base(IntPtr.Zero, true) - { - } - - public override bool IsInvalid - { - get { return this.handle == IntPtr.Zero; } - } - - protected override bool ReleaseHandle() - { - this.SetHandle(IntPtr.Zero); - return true; - } - } - } -} diff --git a/src/Tizen.Account.AccountManager/Interop/Interop.Libraries.cs b/src/Tizen.Account.AccountManager/Interop/Interop.Libraries.cs deleted file mode 100644 index dba2781fd..000000000 --- a/src/Tizen.Account.AccountManager/Interop/Interop.Libraries.cs +++ /dev/null @@ -1,33 +0,0 @@ -/* - * 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. - */ - -/// -/// Interop for the library reference. -/// -/// 3 -internal static partial class Interop -{ - /// - /// Interop for the library reference. - /// - /// 3 - internal static partial class Libraries - { - public const string AccountSvc = "libaccounts-svc.so.0"; - public const string Glib = "libglib-2.0.so.0"; - public const string Libc = "libc.so.6"; - } -} diff --git a/src/Tizen.Account.AccountManager/Tizen.Account.AccountManager.csproj b/src/Tizen.Account.AccountManager/Tizen.Account.AccountManager.csproj deleted file mode 100644 index 7f4584ffe..000000000 --- a/src/Tizen.Account.AccountManager/Tizen.Account.AccountManager.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - netstandard2.0 - - - - - - - - diff --git a/src/Tizen.Account.AccountManager/Tizen.Account.AccountManager.sln b/src/Tizen.Account.AccountManager/Tizen.Account.AccountManager.sln deleted file mode 100755 index 4ea530483..000000000 --- a/src/Tizen.Account.AccountManager/Tizen.Account.AccountManager.sln +++ /dev/null @@ -1,34 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26430.12 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Account.AccountManager", "Tizen.Account.AccountManager.csproj", "{A7594F6F-E28C-475E-B614-9596C140A2E7}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen", "..\Tizen\Tizen.csproj", "{BB293E56-D739-4B0A-B27B-F4FC8AD7832F}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Log", "..\Tizen.Log\Tizen.Log.csproj", "{7B75CA54-AA68-425B-86E2-B550D8F9BA4C}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {A7594F6F-E28C-475E-B614-9596C140A2E7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A7594F6F-E28C-475E-B614-9596C140A2E7}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A7594F6F-E28C-475E-B614-9596C140A2E7}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A7594F6F-E28C-475E-B614-9596C140A2E7}.Release|Any CPU.Build.0 = Release|Any CPU - {BB293E56-D739-4B0A-B27B-F4FC8AD7832F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {BB293E56-D739-4B0A-B27B-F4FC8AD7832F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {BB293E56-D739-4B0A-B27B-F4FC8AD7832F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {BB293E56-D739-4B0A-B27B-F4FC8AD7832F}.Release|Any CPU.Build.0 = Release|Any CPU - {7B75CA54-AA68-425B-86E2-B550D8F9BA4C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7B75CA54-AA68-425B-86E2-B550D8F9BA4C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7B75CA54-AA68-425B-86E2-B550D8F9BA4C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7B75CA54-AA68-425B-86E2-B550D8F9BA4C}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/src/Tizen.Account.AccountManager/Tizen.Account.AccountManager/Account.cs b/src/Tizen.Account.AccountManager/Tizen.Account.AccountManager/Account.cs deleted file mode 100644 index b09639fd7..000000000 --- a/src/Tizen.Account.AccountManager/Tizen.Account.AccountManager/Account.cs +++ /dev/null @@ -1,623 +0,0 @@ -/* - * 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.Collections.Generic; - -namespace Tizen.Account.AccountManager -{ - /// - /// Represents the account information. - /// - /// 3 - public class Account : IDisposable - { - private readonly SafeAccountHandle _handle; - - /// - /// Account constructor. - /// - /// 4 - /// The account handle. - public Account(SafeAccountHandle handle) - { - _handle = handle; - } - - ~Account() - { - Dispose(false); - } - - /// - /// Creates a new account instance. - /// - /// 3 - /// Account Instance. - public static Account CreateAccount() - { - SafeAccountHandle handle; - AccountError err = (AccountError)Interop.Account.Create(out handle); - if (err != AccountError.None) - { - throw AccountErrorFactory.CreateException(err, "Failed to create new error."); - } - - return new Account(handle); - } - - /// - /// Id of the Account. - /// - /// 3 - /// Account ID shall be created only when the account is added to the database. - public int AccountId - { - get - { - int id = 0; - AccountError res = (AccountError)Interop.Account.GetAccountId(_handle, out id); - if (res != AccountError.None) - { - Log.Warn(AccountErrorFactory.LogTag, "Failed to get Id for the Account"); - } - - return id; - } - } - - /// - /// UserName of the account. - /// - /// 3 - /// User name of the account. - public string UserName - { - get - { - string name = ""; - AccountError res = (AccountError)Interop.Account.GetAccountUserName(_handle, out name); - if (res != AccountError.None) - { - Log.Warn(AccountErrorFactory.LogTag, "Failed to get UserName for the Account"); - } - - return name; - } - - set - { - AccountError res = (AccountError)Interop.Account.SetAccountUserName(_handle, value); - if (res != AccountError.None) - { - throw AccountErrorFactory.CreateException(res, "Failed to Set UserName for Account"); - } - } - } - - /// - /// Display name of the account. - /// - /// 3 - /// Display name of the account. - public string DisplayName - { - get - { - string name = ""; - AccountError res = (AccountError)Interop.Account.GetAccountDisplayName(_handle, out name); - if (res != AccountError.None) - { - Log.Warn(AccountErrorFactory.LogTag, "Failed to get DisplayName for the Account"); - } - - return name; - } - - set - { - AccountError res = (AccountError)Interop.Account.SetAccountDisplayName(_handle, value); - if (res != AccountError.None) - { - throw AccountErrorFactory.CreateException(res, "Failed to Set DisplayName for Account"); - } - } - } - - /// - /// Icon path of the account. - /// - /// 3 - /// Icon path of the account. - public string IconPath - { - get - { - string path = ""; - AccountError res = (AccountError)Interop.Account.GetAccountIconPath(_handle, out path); - if (res != AccountError.None) - { - Log.Warn(AccountErrorFactory.LogTag, "Failed to get IconPath for the Account"); - } - - return path; - } - - set - { - AccountError res = (AccountError)Interop.Account.SetAccountIconPath(_handle, value); - if (res != AccountError.None) - { - throw AccountErrorFactory.CreateException(res, "Failed to Set IconPath for Account"); - } - } - } - - /// - /// Domain name of the account. - /// - /// 3 - /// Domain name of the account. - public string DomainName - { - get - { - string name = ""; - AccountError res = (AccountError)Interop.Account.GetAccountDomainName(_handle, out name); - if (res != AccountError.None) - { - Log.Warn(AccountErrorFactory.LogTag, "Failed to get DomainName for the Account"); - } - - return name; - } - - set - { - AccountError res = (AccountError)Interop.Account.SetAccountDomainName(_handle, value); - if (res != AccountError.None) - { - throw AccountErrorFactory.CreateException(res, "Failed to Set DomainName for Account"); - } - } - } - - /// - /// Email ID of the account. - /// - /// 3 - /// Email ID of the account. - public string EmailId - { - get - { - string email = ""; - AccountError res = (AccountError)Interop.Account.GetAccountEmail(_handle, out email); - if (res != AccountError.None) - { - Log.Warn(AccountErrorFactory.LogTag, "Failed to get email for the Account"); - } - - return email; - } - - set - { - AccountError res = (AccountError)Interop.Account.SetAccountEmail(_handle, value); - if (res != AccountError.None) - { - throw AccountErrorFactory.CreateException(res, "Failed to Set email for Account"); - } - } - } - - /// - /// Package name of the account. - /// - /// 3 - /// Package name of the account. - public string PackageName - { - get - { - string name = ""; - AccountError res = (AccountError)Interop.Account.GetAccountPackageName(_handle, out name); - if (res != AccountError.None) - { - Log.Warn(AccountErrorFactory.LogTag, "Failed to get PacakageName for the Account"); - } - - return name; - } - - set - { - AccountError res = (AccountError)Interop.Account.SetAccountPackageName(_handle, value); - if (res != AccountError.None) - { - throw AccountErrorFactory.CreateException(res, "Failed to Set PacakageName for Account"); - } - } - } - - /// - /// Access token of the account. - /// - /// 3 - /// Access token of the account. - public string AccessToken - { - get - { - string token = ""; - AccountError res = (AccountError)Interop.Account.GetAccountAccessToken(_handle, out token); - if (res != AccountError.None) - { - Log.Warn(AccountErrorFactory.LogTag, "Failed to get token for the Account"); - } - - return token; - } - - set - { - AccountError res = (AccountError)Interop.Account.SetAccountAccessToken(_handle, value); - if (res != AccountError.None) - { - throw AccountErrorFactory.CreateException(res, "Failed to Set token for Account"); - } - } - } - - /// - /// Authentication type of the account. - /// - /// 3 - /// Authentication type of the account. - public AccountAuthType AuthType - { - get - { - int user; - AccountError res = (AccountError)Interop.Account.GetAccountAuthType(_handle, out user); - if (res != AccountError.None) - { - Log.Warn(AccountErrorFactory.LogTag, "Failed to get AuthType for the Account"); - } - - return (AccountAuthType)user; - } - - set - { - AccountError res = (AccountError)Interop.Account.SetAccountAuthType(_handle, (int)value); - if (res != AccountError.None) - { - throw AccountErrorFactory.CreateException(res, "Failed to Set AuthType for Account"); - } - } - } - - /// - /// Secrecy state of the account. - /// - /// 3 - /// Secrecy state of the account. - public AccountSecrecyState SecrecyState - { - get - { - int state; - AccountError res = (AccountError)Interop.Account.GetAccountSercet(_handle, out state); - if (res != AccountError.None) - { - Log.Warn(AccountErrorFactory.LogTag, "Failed to get User Secret for the Account"); - } - - return (AccountSecrecyState)state; - } - - set - { - AccountError res = (AccountError)Interop.Account.SetAccountSecret(_handle, (int)value); - if (res != AccountError.None) - { - throw AccountErrorFactory.CreateException(res, "Failed to Set User Secret for Account"); - } - } - } - - /// - /// Sync state of the account. - /// - /// 3 - /// Sync state of the account. - public AccountSyncState SyncState - { - get - { - int supported; - AccountError res = (AccountError)Interop.Account.GetAccountSyncSupport(_handle, out supported); - if (res != AccountError.None) - { - Log.Warn(AccountErrorFactory.LogTag, "Failed to get AuthType for the Account"); - } - - return (AccountSyncState)supported; - } - - set - { - AccountError res = (AccountError)Interop.Account.SetAccountSyncSupport(_handle, (int)value); - if (res != AccountError.None) - { - throw AccountErrorFactory.CreateException(res, "Failed to Set AuthType for Account"); - } - } - } - - /// - /// Source of the account. - /// - /// 3 - /// Account source. - public string Source - { - get - { - string text = ""; - AccountError res = (AccountError)Interop.Account.GetAccountSource(_handle, out text); - if (res != AccountError.None) - { - Log.Warn(AccountErrorFactory.LogTag, "Failed to get User Secret for the Account"); - } - - return text; - } - - set - { - AccountError res = (AccountError)Interop.Account.SetAccountSource(_handle, value); - if (res != AccountError.None) - { - throw AccountErrorFactory.CreateException(res, "Failed to Set User Secret for Account"); - } - } - } - - /// - /// Handle of the account. - /// - /// 4 - /// Account handle. - public SafeAccountHandle SafeAccountHandle - { - get - { - return _handle; - } - } - /// - /// Sets the account capability. - /// - /// 3 - /// The account capability type. - /// The account capability state. - /// In case of an invalid parameter. - public void SetCapability(string capabilityType, CapabilityState state) - { - AccountError ret = (AccountError)Interop.Account.SetAccountCapability(_handle, capabilityType, (int)state); - if (ret != AccountError.None) - { - throw AccountErrorFactory.CreateException(ret, "failed to set account capability"); - } - } - /// - /// Gets all the capabilities of the account. - /// - /// 3 - /// The capability type to get the capability value. - /// The capability value (on/off) of the specified CapabilityState. - /// In case of an invalid parameter. - public CapabilityState GetCapability(string capabilityType) - { - int type; - AccountError res = (AccountError)Interop.Account.GetAccountCapability(_handle, capabilityType, out type); - if (res != AccountError.None) - { - throw AccountErrorFactory.CreateException(res, "Failed to GetCapability for Account"); - } - - return (CapabilityState)type; - } - - /// - /// Gets all the capabilities of the account. - /// - /// 3 - /// List of capabilities as dictionary. - public Dictionary GetAllCapabilities() - { - - AccountError res = AccountError.None; - Dictionary list = new Dictionary(); - Interop.Account.AccountCapabilityCallback capabilityCallback = (string type, int state, IntPtr data) => - { - list.Add(type, (CapabilityState)state); - return true; - }; - - res = (AccountError)Interop.Account.GetAllAccountCapabilities(_handle, capabilityCallback, IntPtr.Zero); - if (res != AccountError.None) - { - throw AccountErrorFactory.CreateException(res, "Failed to get account capabilities"); - } - - return list; - } - - /// - /// Sets the custom value to the account. - /// - /// 3 - /// Key to be added to the account. - /// Value to be updated for respective key for the account. - /// In case of an invalid parameter. - public void SetCustomValue(string key, string value) - { - AccountError err = (AccountError)Interop.Account.SetAccountCustomValue(_handle, key, value); - if (err != AccountError.None) - { - throw AccountErrorFactory.CreateException(err, "Failed to set the value for : " + key); - } - } - - /// - /// Gets the user specific custom text of an account key. - /// - /// 3 - /// The key to retrieve custom text. - /// The text of the given key. - /// In case of an invalid parameter. - /// If there is no given capability type in the account. - public string GetCustomValue(string key) - { - string result = ""; - AccountError err = (AccountError)Interop.Account.GetAccountCustomValue(_handle, key, out result); - if (err != AccountError.None) - { - throw AccountErrorFactory.CreateException(err, "Failed to get the value for : " + key); - } - - return result; - } - - /// - /// Gets all the custom values. - /// - /// 3 - /// List of custom key, value pairs as dictionary. - public Dictionary GetAllCustomValues() - { - AccountError res = AccountError.None; - Dictionary list = new Dictionary(); - - Interop.Account.AccountCustomCallback customCallback = (string key, string value, IntPtr data) => - { - list.Add(key, value); - return true; - }; - - res = (AccountError)Interop.Account.GetAllAccountCustomValues(_handle, customCallback, IntPtr.Zero); - - if (res != AccountError.None) - { - throw AccountErrorFactory.CreateException(res, "Failed to get account capabilities"); - } - - return list; - } - - /// - /// Sets the user text. - /// - /// 3 - /// The index of the user text (must be in range from 0 to 4). - /// The text string to set as the user text. - /// In case of an invalid parameter. - public void SetUserText(int index, string text) - { - AccountError err = (AccountError)Interop.Account.SetAccountUserText(_handle, index, text); - if (err != AccountError.None) - { - throw AccountErrorFactory.CreateException(err, "Failed to get the value for : " + index); - } - } - - /// - /// Gets the user text. - /// - /// 3 - /// The index of the user text (must be in range from 0 to 4). - /// The user text of the given key. - /// In case of an invalid parameter. - /// In case of out of memory. - public string GetUserText(int index) - { - string result = ""; - AccountError err = (AccountError)Interop.Account.GetAccountUserText(_handle, index, out result); - if (err != AccountError.None) - { - throw AccountErrorFactory.CreateException(err, "Failed to get the value for : " + index); - } - - return result; - } - - /// - /// Gets the user integer value. - /// - /// 3 - /// The index of the user integer (must be in range from 0 to 4). - /// The user integer of the given key. - /// In case of an invalid parameter. - public int GetUserInt(int index) - { - int result = -1; - AccountError err = (AccountError)Interop.Account.GetAccountUserInt(_handle, index, out result); - if (err != AccountError.None) - { - throw AccountErrorFactory.CreateException(err, "Failed to get the value for : " + index); - } - - return result; - } - - /// - /// Sets the user integer value. - /// - /// 3 - /// The index of the user integer (must be in range from 0 to 4). - /// The integer to set as the user integer. - /// In case of an invalid parameter. - public void SetUserInt(int index, int value) - { - AccountError err = (AccountError)Interop.Account.SetAccountUserInt(_handle, index, value); - if (err != AccountError.None) - { - throw AccountErrorFactory.CreateException(err, "Failed to get the value for : " + index); - } - } - - /// - /// Overloaded Dispose API for destroying the account handle. - /// - /// 3 - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - - protected virtual void Dispose(bool disposing) - { - if (!disposing) - { - _handle.Dispose(); - } - } - } -} diff --git a/src/Tizen.Account.AccountManager/Tizen.Account.AccountManager/AccountEnums.cs b/src/Tizen.Account.AccountManager/Tizen.Account.AccountManager/AccountEnums.cs deleted file mode 100644 index 53942e079..000000000 --- a/src/Tizen.Account.AccountManager/Tizen.Account.AccountManager/AccountEnums.cs +++ /dev/null @@ -1,166 +0,0 @@ -/* - * 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. - */ - -namespace Tizen.Account.AccountManager -{ - /// - /// Enumeration for the state of capability. - /// - /// 3 - public enum CapabilityState - { - /// - /// Account capability is invalid. - /// - /// 3 - InvalidState, - - /// - /// Account capability is disabled. - /// - /// 3 - Disabled, - - /// - /// Account capability is enabled. - /// - /// 3 - Enabled - } - - /// - /// Enumeration for the state of account secrecy. - /// - public enum AccountSecrecyState - { - /// - /// Account secrecy is invalid. - /// - /// 3 - InvalidState, - - /// - /// Account is not visible. - /// - /// 3 - Invisible, - - /// - /// Account is visible. - /// - /// 3 - Visible - } - - /// - /// Enumeration for the account sync status. - /// - /// 3 - public enum AccountSyncState - { - /// - /// Account sync is invalid. - /// - /// 3 - InvalidState, - - /// - /// Account sync not supported. - /// - /// 3 - NotSupported, - - /// - /// Account sync supported, but all the synchronization functionalities are off. - /// - /// 3 - Off, - - /// - /// Account sync supported and sync status is idle. - /// - /// 3 - Idle, - - /// - /// Account sync supported and sync status is running. - /// - /// 3 - Running - } - - /// - /// Enumeration for the account auth type. - /// - /// 3 - public enum AccountAuthType - { - /// - /// Auth type is invalid. - /// - /// 3 - Invalid, - - /// - /// XAuth type. - /// - /// 3 - XAuth, - - /// - /// OAuth type. - /// - /// 3 - OAuth, - - /// - /// ClientLogin type. - /// - /// 3 - ClientLogin - } - - /// - /// Account information change notification types. - /// - /// 3 - /// - /// When the account database is changed, you can distinguish one event type from the other which are set for subscribing notification. - /// - public enum AccountNotificationType - { - /// - /// The insert notification type. - /// - /// 3 - Insert, - /// - /// The delete notification type. - /// - /// 3 - Delete, - /// - /// The update notification type. - /// - /// 3 - Update, - /// - /// The sync update notification type. - /// - /// 3 - syncUpdate - } -} diff --git a/src/Tizen.Account.AccountManager/Tizen.Account.AccountManager/AccountErrorFactory.cs b/src/Tizen.Account.AccountManager/Tizen.Account.AccountManager/AccountErrorFactory.cs deleted file mode 100644 index f23c792cd..000000000 --- a/src/Tizen.Account.AccountManager/Tizen.Account.AccountManager/AccountErrorFactory.cs +++ /dev/null @@ -1,204 +0,0 @@ -/* - * 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; - -namespace Tizen.Account.AccountManager -{ - /// - /// Enumeration for the types of error occurred, if any. - /// - /// 3 - public enum AccountError - { - //TIZEN_ERROR_ACCOUNT = -0x01000000 - /// - /// Successful. - /// - /// 3 - None = Tizen.Internals.Errors.ErrorCode.None, - /// - /// Invalid parameter. - /// - /// 3 - InvalidParameter = Tizen.Internals.Errors.ErrorCode.InvalidParameter, - /// - /// Out of memory. - /// - /// 3 - OutOfMemory = Tizen.Internals.Errors.ErrorCode.OutOfMemory, - /// - /// Same user name exists in your application. - /// - /// 3 - Duplicated = -0x01000000 | 0x01, - /// - /// Empty data. - /// - /// 3 - NoData = Tizen.Internals.Errors.ErrorCode.NoData, - /// - /// Elated record does not exist. - /// - /// 3 - RecordNotFound = -0x01000000 | 0x03, - /// - /// Invalid operation. - /// - /// 3 - InvalidOperation = Tizen.Internals.Errors.ErrorCode.InvalidOperation, - /// - /// DB operation failed. - /// - /// 3 - DBFailed = -0x01000000 | 0x04, - /// - /// DB is not connected. - /// - /// 3 - DBNotOpened = -0x01000000 | 0x05, - /// - /// DB query syntax error. - /// - /// 3 - QuerySyntaxError = -0x01000000 | 0x06, - /// - /// Iterator has reached the end. - /// - /// 3 - IteratorEnd = -0x01000000 | 0x07, - /// - /// Notification failed. - /// - /// 3 - NotificationFailed = -0x01000000 | 0x08, - /// - /// Permission denied. - /// - /// 3 - PermissionDenied = Tizen.Internals.Errors.ErrorCode.PermissionDenied, - /// - /// XML parse failed. - /// - /// 3 - XMLParseFailed = -0x01000000 | 0x0a, - /// - /// XML file not found. - /// - /// 3 - XMLFileNotFound = -0x01000000 | 0x0b, - /// - /// Subscription failed - /// - /// 3 - EventSubscriptionFailed = -0x01000000 | 0x0c, - /// - /// Account provider is not registered. - /// - /// 3 - ProviderNotRegistered = -0x01000000 | 0x0d, - /// - /// Multiple accounts are not supported. - /// - /// 3 - MultipleNotAllowed = -0x01000000 | 0x0e, - /// - /// SQLite busy handler expired. - /// - /// 3 - DBBusy = -0x01000000 | 0x10 - }; - - internal class AccountErrorFactory - { - internal const string LogTag = "Tizen.Account.AccountManager"; - - internal static Exception CreateException(AccountError err, string msg) - { - Log.Info(LogTag, "Got Error " + err + " throwing Exception with msg " + msg); - Exception exp; - switch (err) - { - case AccountError.InvalidParameter: - { - exp = new ArgumentException(msg + " Invalid Parameters Provided"); - break; - } - - case AccountError.OutOfMemory: - { - exp = new OutOfMemoryException(msg + " Out Of Memory"); - break; - } - - case AccountError.InvalidOperation: - { - exp = new InvalidOperationException(msg + " Inavlid operation"); - break; - } - - case AccountError.NoData: - { - exp = new InvalidOperationException(msg + " Empty Data"); - break; - } - - case AccountError.PermissionDenied: - { - exp = new UnauthorizedAccessException(msg + " Permission Denied"); - break; - } - - case AccountError.DBFailed: - { - exp = new InvalidOperationException(msg + " DataBase Failed"); - break; - } - - case AccountError.DBBusy: - { - exp = new InvalidOperationException(msg + " DataBase Busy"); - break; - } - - case AccountError.QuerySyntaxError: - { - exp = new InvalidOperationException(msg + " Network Error"); - break; - } - case AccountError.XMLFileNotFound: - { - exp = new System.IO.FileNotFoundException(msg + " XML File not found"); - break; - } - case AccountError.XMLParseFailed: - { - exp = new System.IO.InvalidDataException(msg + " XML parse error"); - break; - } - - default: - { - exp = new InvalidOperationException(err + " " + msg); - break; - } - } - - return exp; - } - } -} diff --git a/src/Tizen.Account.AccountManager/Tizen.Account.AccountManager/AccountProvider.cs b/src/Tizen.Account.AccountManager/Tizen.Account.AccountManager/AccountProvider.cs deleted file mode 100644 index be9e07768..000000000 --- a/src/Tizen.Account.AccountManager/Tizen.Account.AccountManager/AccountProvider.cs +++ /dev/null @@ -1,380 +0,0 @@ -/* - * 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.Collections.Generic; -using Tizen.Internals.Errors; - -namespace Tizen.Account.AccountManager -{ - /// - /// The account ID. - /// - /// 3 - public class AccountProvider : IDisposable - { - internal IntPtr _handle; - internal AccountProvider(IntPtr handle) - { - Handle = handle; - } - - ~AccountProvider() - { - Dispose(false); - } - - internal IntPtr Handle - { - get - { - return _handle; - } - - set - { - _handle = value; - } - } - /// - /// The account ID. - /// - /// 3 - public string AppId - { - get - { - string id = ""; - AccountError res = (AccountError)Interop.AccountProvider.GetAppId(Handle, out id); - if (res != AccountError.None) - { - Log.Warn(AccountErrorFactory.LogTag, "Failed to get AppId for the AccountProvider"); - } - - return id; - } - } - - /// - /// ServiceProvider ID of the account provider. - /// - /// 3 - public string ServiceProviderId - { - get - { - string id = ""; - AccountError res = (AccountError)Interop.AccountProvider.GetServiceProviderId(Handle, out id); - if (res != AccountError.None) - { - Log.Warn(AccountErrorFactory.LogTag, "Failed to get ServiceProviderId for the AccountProvider"); - } - - return id; - } - } - - /// - /// Icon path of the account provider. - /// - /// 3 - public string IconPath - { - get - { - string path = ""; - AccountError res = (AccountError)Interop.AccountProvider.GetAccountProviderIconPath(Handle, out path); - if (res != AccountError.None) - { - Log.Warn(AccountErrorFactory.LogTag, "Failed to get IconPath for the AccountProvider"); - } - - return path; - } - } - - /// - /// Small icon path of the account provider. - /// - /// 3 - public string SmallIconPath - { - get - { - string path = ""; - AccountError res = (AccountError)Interop.AccountProvider.GetAccountProviderSmallIconPath(Handle, out path); - if (res != AccountError.None) - { - Log.Warn(AccountErrorFactory.LogTag, "Failed to get SmallIconPath for the AccountProvider"); - } - - return path; - } - } - - /// - /// Flag for the account provider if it supports multiple accounts. - /// - /// 3 - public bool MultipleAccountSupport - { - get - { - int multiple = 0; - AccountError res = (AccountError)Interop.AccountProvider.GetMultipleAccountSupport(Handle, out multiple); - if (res != AccountError.None) - { - Log.Warn(AccountErrorFactory.LogTag, "Failed to get SmallIconPath for the AccountProvider"); - } - - return (multiple == 0) ? false : true; - } - } - - /// - /// Retrieves all the capability information of the account provider. - /// - /// 3 - /// http://tizen.org/privilege/account.read - /// http://tizen.org/feature/account - /// - /// The list of capability information. - /// - /// In case of any DB error. - /// In case of privilege not defined. - /// The required feature is not supported. - public IEnumerable GetAllCapabilities() - { - List capabilities = new List(); - AccountError res; - Interop.AccountProvider.AccountProviderFeatureCallback callback = (string appId, string key, IntPtr data) => - { - capabilities.Add(key); - return true; - }; - - res = (AccountError)Interop.AccountProvider.GetAccountProviderFeatures(Handle, callback, IntPtr.Zero); - if (res != AccountError.None) - { - throw AccountErrorFactory.CreateException(res, "Failed to GetAllCapabilities for AccountProvider"); - } - - return capabilities; - } - - /// - /// Gets the specific label information detail of the account provider. - /// - /// 3 - /// - /// The locale is specified as an ISO 3166 alpha-2 two letter country-code followed by ISO 639-1 for the two-letter language code. - /// For example, "ko_KR" or "ko-kr" for Korean, "en_US" or "en-us" for American English. - /// - /// The label text given for the locale. - /// http://tizen.org/privilege/account.read - /// http://tizen.org/feature/account - /// In case of any DB error or record not found for given locale. - /// In case of privilege not defined. - /// The required feature is not supported. - public string GetLabel(string locale) - { - string label; - AccountError res = (AccountError)Interop.AccountProvider.GetlabelbyLocale(Handle, locale, out label); - if (res != AccountError.None) - { - throw AccountErrorFactory.CreateException(res, "Failed to GetLabel for AccountProvider"); - } - - return label; - } - - /// - /// Gets the specific label information detail of the account provider. - /// - /// 3 - /// - /// The application ID to search. - /// - /// All the labels information for the given application ID. - /// http://tizen.org/privilege/account.read - /// http://tizen.org/feature/account - /// In case of any DB error or record not found for given the application ID. - /// In case of an invalid parameter. - /// In case of privilege not defined. - /// The required feature is not supported. - public static Dictionary GetLabelsByAppId(string appId) - { - - Dictionary labels = new Dictionary(); - Interop.AccountProvider.LabelCallback callback = (string applicationId, string label, string locale, IntPtr userData) => - { - labels.Add(locale, label); - return true; - }; - - AccountError err = (AccountError)Interop.AccountProvider.GetLablesByAppId(callback, appId, IntPtr.Zero); - if (err != AccountError.None) - { - throw AccountErrorFactory.CreateException(err, "Failed to GetLablesByAppId"); - } - - return labels; - } - - /// - /// Gets the label information detail of the account provider. - /// - /// 3 - /// All the labels information for the given account provider. - /// http://tizen.org/privilege/account.read - /// http://tizen.org/feature/account - /// In case of any DB error. - /// In case of privilege not defined. - /// The required feature is not supported. - public Dictionary GetLabels() - { - - Dictionary labels = new Dictionary(); - Interop.AccountProvider.LabelCallback callback = (string applicationId, string label, string locale, IntPtr userData) => - { - labels.Add(locale, label); - return true; - }; - - AccountError err = (AccountError)Interop.AccountProvider.GetAccountProviderLabels(Handle, callback, IntPtr.Zero); - if (err != AccountError.None) - { - throw AccountErrorFactory.CreateException(err, "Failed to GetAccountProviderLabels"); - } - - return labels; - } - - /// - /// Checks whether the given appId exists in the account provider DB. - /// - /// 3 - /// The application ID to check. - /// returns true If App is supported - /// http://tizen.org/privilege/account.read - /// http://tizen.org/feature/account - /// In case of any DB error or record not found for the given application ID. - /// In case of an invalid parameter. - /// In case of privilege not defined. - /// The required feature is not supported. - public bool IsAppSupported(string appId) - { - bool isSupported = false; - AccountError res = (AccountError)Interop.AccountProvider.GetAppIdExists(appId); - - if (res != AccountError.None) - { - throw AccountErrorFactory.CreateException(res, "Failed to GetLabel for AccountProvider"); - } - else - { - isSupported = true; - } - - return isSupported; - } - - /// - /// Checks whether the given application ID supports the capability. - /// - /// 3 - /// The application ID. - /// The capability information. - /// - /// TRUE if the application supports the given capability, - /// otherwise FALSE if the application does not support the given capability - /// - /// http://tizen.org/privilege/account.read - /// http://tizen.org/feature/account - /// In case of any DB error. - /// In case of an invalid parameter. - /// In case of privilege not defined. - /// The required feature is not supported. - public static bool IsFeatureSupportedByApp(string appId, string capability) - { - bool supported = Interop.AccountProvider.IsFeatureSupported(appId, capability); - if (!supported) - { - //Get last result and validate error code. - AccountError err = (AccountError)ErrorFacts.GetLastResult(); - if ((err != AccountError.None) && (err != AccountError.RecordNotFound)) - { - throw AccountErrorFactory.CreateException(err, "Failed to get IsFeatureSupported"); - } - } - - return supported; - } - - /// - /// Retrieves capability information with the application ID. - /// - /// 3 - /// The application ID. - /// Capability information list for the given appId. - /// http://tizen.org/privilege/account.read - /// http://tizen.org/feature/account - /// In case of any DB error or record not found for the given application ID. - /// In case of an invalid parameter. - /// In case of privilege not defined. - /// The required feature is not supported. - public static IEnumerable GetFeaturesByAppId(string appId) - { - - List features = new List(); - Interop.AccountProvider.AccountProviderFeatureCallback callback = (string applicationId, string key, IntPtr userData) => - { - features.Add(key); - return true; - }; - - AccountError err = (AccountError)Interop.AccountProvider.GetAccountProviderFeaturesByAppId(callback, appId, IntPtr.Zero); - if (err != AccountError.None) - { - throw AccountErrorFactory.CreateException(err, "Failed to GetAccountProviderFeaturesByAppId"); - } - - return (IEnumerable)features; - } - - /// - /// Overloaded Dispose API for destroying the AccountProvider Handle. - /// - /// 3 - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - - protected virtual void Dispose(bool disposing) - { - if (!disposing) - { - if (_handle != IntPtr.Zero) - { - Interop.AccountProvider.Destroy(_handle); - _handle = IntPtr.Zero; - } - } - } - } -} diff --git a/src/Tizen.Account.AccountManager/Tizen.Account.AccountManager/AccountService.cs b/src/Tizen.Account.AccountManager/Tizen.Account.AccountManager/AccountService.cs deleted file mode 100644 index 9e5193ca3..000000000 --- a/src/Tizen.Account.AccountManager/Tizen.Account.AccountManager/AccountService.cs +++ /dev/null @@ -1,640 +0,0 @@ -/* - * 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.Collections.Generic; - -namespace Tizen.Account.AccountManager -{ - /// - /// The AccountManager APIs are separated into two major sections: - /// 1. Registering an account provider while an application is installed. This information will be used for the Add account screen. - /// 2. Adding an account information when an application signs in successfully to share the account information to the Tizen system. This information will be shown in the Tizen settings account menu. - /// - /// The APIs of both of the sections consist of the following functionality: - /// - /// Create an account or account provider. - /// Update an account or account provider (Only available for the creator). - /// Delete an account or account provider (Only available for the creator). - /// Read an account or account provider with some filter. - /// - /// - /// 3 - - public static class AccountService - { - /// - /// This is the contact capability string. - /// - /// 3 - public static readonly string ContactCapability = "http://tizen.org/account/capability/contact"; - - /// - /// This is the calendar capability string. - /// - /// 3 - public static readonly string CalendarCapability = "http://tizen.org/account/capability/calendar"; - - /// - /// This is the email capability string. - /// - /// 3 - public static readonly string EmailCapability = "http://tizen.org/account/capability/email"; - - /// - /// This is the photo capability string. - /// - /// 3 - public static readonly string PhotoCapability = "http://tizen.org/account/capability/photo"; - - /// - /// This is the video capability string. - /// - /// 3 - public static readonly string VideoCapability = "http://tizen.org/account/capability/video"; - - /// - /// This is the music capability string. - /// - /// 3 - public static readonly string MusicCapability = "http://tizen.org/account/capability/music"; - - /// - /// This is the document capability string. - /// - /// 3 - public static readonly string DocumentCapability = "http://tizen.org/account/capability/document"; - - /// - /// This is the message capability string. - /// - /// 3 - public static readonly string MessageCapability = "http://tizen.org/account/capability/message"; - - /// - /// This is the game capability string. - /// - /// 3 - public static readonly string GameCapability = "http://tizen.org/account/capability/game"; - - /// - /// Retrieves all the accounts details from the account database. - /// - /// 3 - /// List of accounts. - /// http://tizen.org/privilege/account.read - /// http://tizen.org/feature/account - /// In case of any DB error. - /// In case of privilege not defined. - /// The required feature is not supported. - public static IEnumerable GetAccountsAsync() - { - List accounts = new List(); - List values = new List(); - Interop.Account.AccountCallback accountCallback = (IntPtr data, IntPtr userdata) => - { - Account account = new Account(new SafeAccountHandle(data, true)); - values.Add(account.AccountId); - account.Dispose(); - return true; - }; - - AccountError res = (AccountError)Interop.AccountService.AccountForeachAccountFromDb(accountCallback, IntPtr.Zero); - if (res != AccountError.None) - { - throw AccountErrorFactory.CreateException(res, "Failed to AccountForeachAccountFromDb"); - } - - foreach (int i in values) - { - Account account = AccountService.GetAccountById(i); - accounts.Add(account); - } - - return accounts; - } - - /// - /// Retrieves the account with the account ID. - /// - /// 3 - /// The account ID to be searched. - /// Account instance with reference to the given ID. - /// http://tizen.org/privilege/account.read - /// http://tizen.org/feature/account - /// In case of any DB error or record not found for given account ID. - /// In case of an invalid parameter. - /// In case of privilege not defined. - /// The required feature is not supported. - public static Account GetAccountById(int accountId) - { - Account account = Account.CreateAccount(); - SafeAccountHandle handle = account.SafeAccountHandle; - - AccountError res = (AccountError)Interop.AccountService.QueryAccountById(accountId, ref handle); - if (res != AccountError.None) - { - throw AccountErrorFactory.CreateException(res, "Failed to get accounts from the database for account id: " + accountId); - } - Account ref_account = new Account(handle); - - return ref_account; - } - - /// - /// Retrieves all the AccountProviders details from the account database. - /// - /// 3 - /// List of AccountProviders. - /// http://tizen.org/privilege/account.read - /// http://tizen.org/feature/account - /// In case of any DB error. - /// In case of privilege not defined. - /// The required feature is not supported. - public static IEnumerable GetAccountProviders() - { - List values = new List(); - List providers = new List(); - Interop.AccountProvider.AccountProviderCallback accountCallback = (IntPtr handle, IntPtr data) => - { - AccountProvider provider = new AccountProvider(handle); - values.Add(provider.AppId); - provider.Dispose(); - return true; - }; - - AccountError res = (AccountError)Interop.AccountService.GetAllAccountproviders(accountCallback, IntPtr.Zero); - if (res != AccountError.None) - { - Log.Warn(AccountErrorFactory.LogTag, "Failed to get account providers from the database"); - throw AccountErrorFactory.CreateException(res, "Failed to get account providers from the database"); - } - - foreach (string val in values) - { - AccountProvider provider = GetAccountProviderByAppId(val); - providers.Add(provider); - } - - return providers; - } - - /// - /// Retrieves the account provider information with the application ID. - /// - /// 3 - /// The application ID. - /// The AccountProvider instance associated with the given application ID. - /// http://tizen.org/privilege/account.read - /// http://tizen.org/feature/account - /// In case of any DB error or record not found for given appId. - /// In case of an invalid parameter. - /// In case of privilege not defined. - /// The required feature is not supported. - public static AccountProvider GetAccountProviderByAppId(string appId) - { - IntPtr handle; - Interop.AccountProvider.Create(out handle); - AccountError err = (AccountError)Interop.AccountService.GetAccountProviderByAppId(appId, out handle); - if (err != AccountError.None) - { - throw AccountErrorFactory.CreateException(err, "Failed to GetAccountProviderByAppId"); - } - - AccountProvider provider = new AccountProvider(handle); - return provider; - } - - /// - /// Retrieves all the account providers information with feature. - /// - /// 3 - /// The capability value to search for account providers. - /// Retrieves the AccountProviders information with the capability name. - /// http://tizen.org/privilege/account.read - /// http://tizen.org/feature/account - /// In case of any DB error or record not found for given feature. - /// In case of invalid parameter. - /// In case of privilege not defined. - /// The required feature is not supported. - public static IEnumerable GetAccountProvidersByFeature(string feature) - { - List values = new List(); - List providers = new List(); - Interop.AccountProvider.AccountProviderCallback providerCallback = (IntPtr handle, IntPtr data) => - { - AccountProvider provider = new AccountProvider(handle); - values.Add(provider.AppId); - provider.Dispose(); - return true; - }; - - AccountError err = (AccountError)Interop.AccountService.GetAccountProviderByFeature(providerCallback, feature, IntPtr.Zero); - if (err != AccountError.None) - { - throw AccountErrorFactory.CreateException(err, "Failed to GetAccountProviderByFeature"); - } - - foreach (string val in values) - { - AccountProvider provider = GetAccountProviderByAppId(val); - providers.Add(provider); - } - - return providers; - } - - /// - /// Inserts into the Database with the new account Information. - /// - /// 3 - /// New Account instance to be added. - /// The account ID of the account instance. - /// http://tizen.org/privilege/account.read - /// http://tizen.org/privilege/account.write - /// http://tizen.org/feature/account - /// In case of any DB error. - /// In case of an invalid parameter. - /// In case of privilege not defined. - /// In case of OutOfMemory error. - /// The required feature is not supported. - public static int AddAccount(Account account) - { - if (account == null) - { - throw AccountErrorFactory.CreateException(AccountError.InvalidParameter, "Failed to AddAccount"); - } - - int id = -1; - AccountError err = (AccountError)Interop.AccountService.AddAccount(account.SafeAccountHandle, out id); - if (err != AccountError.None) - { - throw AccountErrorFactory.CreateException(err, "Failed to AddAccount"); - } - - return id; - } - - /// - /// Updates the account details to the account database. - /// - /// 3 - /// Account instance to be updated. - /// http://tizen.org/privilege/account.read - /// http://tizen.org/privilege/account.write - /// http://tizen.org/feature/account - /// In case of any DB error. - /// In case of an invalid parameter. - /// In case of privilege not defined. - /// In case of OutOfMemory error. - /// The required feature is not supported. - public static void UpdateAccount(Account account) - { - if (account == null) - { - throw AccountErrorFactory.CreateException(AccountError.InvalidParameter, "Failed to UpdateAccount"); - } - - AccountError err = (AccountError)Interop.AccountService.UpdateAccountToDBById(account.SafeAccountHandle, account.AccountId); - if (err != AccountError.None) - { - throw AccountErrorFactory.CreateException(err, "Failed to UpdateAccount"); - } - } - - /// - /// Deletes the account information from the database. - /// - /// 3 - /// Account instance to be deleted from the database. - /// http://tizen.org/privilege/account.read - /// http://tizen.org/privilege/account.write - /// http://tizen.org/feature/account - /// In case of any DB error. - /// In case of an invalid parameter. - /// In case of privilege not defined. - /// The required feature is not supported. - public static void DeleteAccount(Account account) - { - if (account == null) - { - throw AccountErrorFactory.CreateException(AccountError.InvalidParameter, "Failed to DeleteAccount"); - } - - AccountError err = (AccountError)Interop.AccountService.DeleteAccountById(account.AccountId); - if (err != AccountError.None) - { - throw AccountErrorFactory.CreateException(err, "Failed to delete the account by Id: " + account.AccountId); - } - } - - /// - /// Deletes the account from the account database by user name. - /// - /// 3 - /// The user name of the account to delete. - /// The package name of the account to delete. - /// http://tizen.org/privilege/account.read - /// http://tizen.org/privilege/account.write - /// http://tizen.org/feature/account - /// In case of any DB error. - /// In case of an invalid parameter. - /// In case of privilege not defined. - /// The required feature is not supported. - public static void DeleteAccount(string userName, string packageName) - { - AccountError err = (AccountError)Interop.AccountService.DeleteAccountByUser(userName, packageName); - if (err != AccountError.None) - { - throw AccountErrorFactory.CreateException(err, "Failed to delete the account by userName: " + userName); - } - } - - /// - /// Deletes the account from the account database by package name. - /// - /// 3 - /// The package name of the account to delete. - /// http://tizen.org/privilege/account.read - /// http://tizen.org/privilege/account.write - /// http://tizen.org/feature/account - /// In case of any DB error. - /// In case of an invalid parameter. - /// In case of privilege not defined. - /// The required feature is not supported. - public static void DeleteAccount(string packageName) - { - AccountError err = (AccountError)Interop.AccountService.DeleteAccountByPackage(packageName); - if (err != AccountError.None) - { - throw AccountErrorFactory.CreateException(err, "Failed to delete the account by package name: " + packageName); - } - - } - - /// - /// Retrieves all the accounts with the given user name. - /// - /// 3 - /// The user name to search. - /// Accounts list matched with the user name. - /// http://tizen.org/privilege/account.read - /// http://tizen.org/feature/account - /// In case of any DB error or record not found for given username. - /// In case of an invalid parameter. - /// In case of privilege not defined. - /// The required feature is not supported. - public static IEnumerable GetAccountsByUserName(string userName) - { - List accounts = new List(); - List values = new List(); - Interop.Account.AccountCallback accountCallback = (IntPtr handle, IntPtr data) => - { - Account account = new Account(new SafeAccountHandle(handle, true)); - values.Add(account.AccountId); - account.Dispose(); - return true; - }; - - AccountError err = (AccountError)Interop.AccountService.QueryAccountByUserName(accountCallback, userName, IntPtr.Zero); - if (err != AccountError.None) - { - throw AccountErrorFactory.CreateException(err, "Failed to GetAccountByUserName"); - } - - foreach (int i in values) - { - Account account = AccountService.GetAccountById(i); - accounts.Add(account); - } - - return accounts; - } - - /// - /// Retrieves all the accounts with the given package name. - /// - /// 3 - /// The package name to search. - /// Accounts list matched with the package name. - /// http://tizen.org/privilege/account.read - /// http://tizen.org/feature/account - /// In case of any DB error or record not found for given package name. - /// In case of an invalid parameter. - /// In case of privilege not defined. - /// The required feature is not supported. - public static IEnumerable GetAccountsByPackageName(string packageName) - { - List accounts = new List(); - List values = new List(); - Interop.Account.AccountCallback accountCallback = (IntPtr handle, IntPtr data) => - { - Account account = new Account(new SafeAccountHandle(handle, true)); - values.Add(account.AccountId); - account.Dispose(); - return true; - }; - - AccountError err = (AccountError)Interop.AccountService.QueryAccountByPackageName(accountCallback, packageName, IntPtr.Zero); - if (err != AccountError.None) - { - throw AccountErrorFactory.CreateException(err, "Failed to GetAccountByPackageName"); - } - - foreach (int i in values) - { - Account account = AccountService.GetAccountById(i); - accounts.Add(account); - } - - return accounts; - } - - /// - /// Retrieves all accounts with the given capability type. - /// - /// 3 - /// Capability type. - /// Accounts list matched with the capability type. - /// http://tizen.org/privilege/account.read - /// http://tizen.org/feature/account - /// In case of any DB error or record not found for the given capability type. - /// In case of an invalid parameter. - /// In case of privilege not defined. - /// The required feature is not supported. - public static IEnumerable GetAccountsByCapabilityType(string type) - { - List accounts = new List(); - List values = new List(); - Interop.Account.AccountCallback accountCallback = (IntPtr handle, IntPtr data) => - { - Account account = new Account(new SafeAccountHandle(handle, true)); - values.Add(account.AccountId); - account.Dispose(); - return true; - }; - - AccountError err = (AccountError)Interop.AccountService.GetAccountByCapabilityType(accountCallback, type, IntPtr.Zero); - if (err != AccountError.None) - { - throw AccountErrorFactory.CreateException(err, "Failed to GetAccountByCapabilityType"); - } - - foreach (int i in values) - { - Account account = AccountService.GetAccountById(i); - accounts.Add(account); - } - - return accounts; - } - - /// - /// Retrieves all the capabilities with the given account. - /// - /// 3 - /// Account instance. - /// Capabilities list as dictionary of the capability type and state. - /// http://tizen.org/privilege/account.read - /// http://tizen.org/feature/account - /// In case of any DB error or record not found for given account ID. - /// In case of an invalid parameter. - /// In case of privilege not defined. - /// The required feature is not supported. - public static Dictionary GetCapabilitiesById(int accountId) - { - Dictionary capabilities = new Dictionary(); - Interop.Account.AccountCapabilityCallback capabilityCallback = (string type, int capabilityState, IntPtr data) => - { - capabilities.Add(type, (CapabilityState)capabilityState); - return true; - }; - - AccountError err = (AccountError)Interop.AccountService.QueryAccountCapabilityById(capabilityCallback, accountId, IntPtr.Zero); - if (err != AccountError.None) - { - throw AccountErrorFactory.CreateException(err, "Failed to GetAllCapabilitiesById"); - } - - return capabilities; - } - - /// - /// Gets the count of accounts in the account database. - /// - /// 3 - /// The number of accounts in the database. - /// http://tizen.org/privilege/account.read - /// http://tizen.org/feature/account - /// In case of any DB error. - /// In case of privilege not defined. - /// The required feature is not supported. - public static int GetAccountsCount() - { - int count = 0; - AccountError err = (AccountError)Interop.AccountService.GetAccountCount(out count); - if (err != AccountError.None) - { - throw AccountErrorFactory.CreateException(err, "Failed to GetAccountCount"); - } - - return count; - } - - /// - /// Updates the sync status of the given account. - /// - /// 3 - /// Account for which the sync status needs to be updated. - /// Sync State - /// http://tizen.org/privilege/account.read - /// http://tizen.org/privilege/account.write - /// http://tizen.org/feature/account - /// In case of any DB error. - /// In case of an invalid parameter. - /// In case of privilege not defined. - /// The required feature is not supported. - public static void UpdateSyncStatusById(Account account, AccountSyncState status) - { - AccountError err = (AccountError)Interop.AccountService.UpdateAccountSyncStatusById(account.AccountId, (int)status); - if (err != AccountError.None) - { - throw AccountErrorFactory.CreateException(err, "Failed to UpdateSyncStatusById"); - } - } - - private static readonly Interop.AccountService.SubscribeCallback s_accountUpdatedCallback = (string eventType, int accountId, IntPtr userData) => - { - AccountSubscriberEventArgs eventArgs = new AccountSubscriberEventArgs(eventType, accountId); - s_accountUpdated?.Invoke(null, eventArgs); - return true; - }; - - private static Interop.AccountService.SafeAccountSubscriberHandle s_subscriberHandle; - - private static event EventHandler s_accountUpdated; - /// - /// ContentUpdated event is triggered when the media item info from DB changes. - /// - /// 3 - /// - /// ContentUpdate event is triggered if the MediaInformation updated/deleted or new information is inserted. - /// - /// http://tizen.org/privilege/account.read - /// http://tizen.org/feature/account - /// In case of any DB error. - /// In case of an invalid parameter. - /// In case of privilege not defined. - /// The required feature is not supported. - public static event EventHandler AccountUpdated - { - add - { - if (s_accountUpdated == null) - { - if (s_subscriberHandle == null) - { - Interop.AccountService.CreateAccountSubscriber(out s_subscriberHandle); - } - - AccountError ret = (AccountError)Interop.AccountService.RegisterSubscriber(s_subscriberHandle, s_accountUpdatedCallback, IntPtr.Zero); - - if (ret != AccountError.None) - { - throw AccountErrorFactory.CreateException(ret, "Error in callback handling"); - } - } - - s_accountUpdated += value; - } - - remove - { - s_accountUpdated -= value; - if (s_accountUpdated == null) - { - AccountError ret = (AccountError)Interop.AccountService.UnregisterSubscriber(s_subscriberHandle); - if (ret != AccountError.None) - { - throw AccountErrorFactory.CreateException(ret, "Error in callback handling"); - } - s_subscriberHandle = null; - } - } - } - - } -} diff --git a/src/Tizen.Account.AccountManager/Tizen.Account.AccountManager/AccountSubscriberEventArgs.cs b/src/Tizen.Account.AccountManager/Tizen.Account.AccountManager/AccountSubscriberEventArgs.cs deleted file mode 100644 index 2df239990..000000000 --- a/src/Tizen.Account.AccountManager/Tizen.Account.AccountManager/AccountSubscriberEventArgs.cs +++ /dev/null @@ -1,73 +0,0 @@ -/* - * 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.Account.AccountManager -{ - /// - /// Event arguments passed when the event is triggered to notify that the account is updated/removed from the account database. - /// - /// 3 - public class AccountSubscriberEventArgs : EventArgs - { - private const string NotiInsert = "insert"; - private const string NotiDelete = "delete"; - private const string NotiUpdate = "update"; - private const string NotiSyncUpdate = "sync_update"; - internal AccountSubscriberEventArgs(string eventType, int accountId) - { - if (eventType.CompareTo(NotiInsert) == 0) - { - EventType = AccountNotificationType.Insert; - } - else if (eventType.CompareTo(NotiDelete) == 0) - { - EventType = AccountNotificationType.Delete; - } - else if (eventType.CompareTo(NotiUpdate) == 0) - { - EventType = AccountNotificationType.Update; - } - else if (eventType.CompareTo(NotiSyncUpdate) == 0) - { - EventType = AccountNotificationType.syncUpdate; - } - - AccountId = accountId; - } - - /// - /// The account event type. - /// - /// 3 - public AccountNotificationType EventType - { - get; - internal set; - } - - /// - /// The account ID to update. - /// - /// 3 - public int AccountId - { - get; - internal set; - } - } -} diff --git a/src/Tizen.Account.AccountManager/Tizen.Account.AccountManager/SafeAccountHandle.cs b/src/Tizen.Account.AccountManager/Tizen.Account.AccountManager/SafeAccountHandle.cs deleted file mode 100644 index 3da224c54..000000000 --- a/src/Tizen.Account.AccountManager/Tizen.Account.AccountManager/SafeAccountHandle.cs +++ /dev/null @@ -1,63 +0,0 @@ -/* - * 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.Collections.Generic; -using System.Runtime.InteropServices; - -namespace Tizen.Account.AccountManager -{ - /// - /// Represents a wrapper class for a unmanaged Account handle. - /// - public sealed class SafeAccountHandle : SafeHandle - { - /// - /// Initializes a new instance of the SafeAppControlHandle class. - /// - public SafeAccountHandle() : base(IntPtr.Zero, true) - { - } - - /// - /// Initializes a new instance of the SafeAccountHandle class. - /// - /// An IntPtr object that represents the pre-existing handle to use. - /// true to reliably release the handle during the finalization phase; false to prevent reliable release. - public SafeAccountHandle(IntPtr existingHandle, bool ownsHandle) : base(IntPtr.Zero, ownsHandle) - { - SetHandle(existingHandle); - } - - /// - /// Gets a value that indicates whether the handle is invalid. - /// - public override bool IsInvalid - { - get { return this.handle == IntPtr.Zero; } - } - - /// - /// When overridden in a derived class, executes the code required to free the handle. - /// - /// true if the handle is released successfully - protected override bool ReleaseHandle() - { - this.SetHandle(IntPtr.Zero); - return true; - } - } -} diff --git a/src/Tizen.Account.FidoClient/Interop/Interop.Libc.cs b/src/Tizen.Account.FidoClient/Interop/Interop.Libc.cs deleted file mode 100755 index 13c7170a0..000000000 --- a/src/Tizen.Account.FidoClient/Interop/Interop.Libc.cs +++ /dev/null @@ -1,27 +0,0 @@ -/* - * 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 Libc - { - [DllImport(Libraries.Libc, EntryPoint = "free", CallingConvention = CallingConvention.Cdecl)] - internal static extern int Free(IntPtr ptr); - } -} diff --git a/src/Tizen.Account.FidoClient/Interop/Interop.Libraries.cs b/src/Tizen.Account.FidoClient/Interop/Interop.Libraries.cs deleted file mode 100755 index 955fffebc..000000000 --- a/src/Tizen.Account.FidoClient/Interop/Interop.Libraries.cs +++ /dev/null @@ -1,28 +0,0 @@ -/* - * 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 -{ - /// - /// Wrapper class for maintaining names of dependent native libraries. - /// - internal static partial class Libraries - { - public const string FidoClient = "libfido-client.so.0"; - public const string Glib = "libglib-2.0.so.0"; - public const string Libc = "libc.so.6"; - } -} diff --git a/src/Tizen.Account.FidoClient/Interop/Interop.Uaf.Authenticator.cs b/src/Tizen.Account.FidoClient/Interop/Interop.Uaf.Authenticator.cs deleted file mode 100755 index 7cbd9f94e..000000000 --- a/src/Tizen.Account.FidoClient/Interop/Interop.Uaf.Authenticator.cs +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright 2016 by Samsung Electronics, Inc., -// -// This software is the confidential and proprietary information -// of Samsung Electronics, Inc. ("Confidential Information"). You -// shall not disclose such Confidential Information and shall use -// it only in accordance with the terms of the license agreement -// you entered into with Samsung. - -using System; -using System.Runtime.InteropServices; -using Tizen.Internals.Errors; - -internal static partial class Interop -{ - internal static partial class UafAuthenticator - { - [DllImport(Libraries.FidoClient, EntryPoint = "fido_foreach_authenticator")] - internal static extern int ForeachAuthenticator(FidoAuthenticatorCallback cb, IntPtr /* void */ userData); - - [DllImport(Libraries.FidoClient, EntryPoint = "fido_authenticator_get_title")] - internal static extern int GetTitle(IntPtr /* fido_authenticator_h */ auth, out IntPtr title); - - [DllImport(Libraries.FidoClient, EntryPoint = "fido_authenticator_get_aaid")] - internal static extern int GetAaid(IntPtr /* fido_authenticator_h */ auth, out IntPtr aaid); - - [DllImport(Libraries.FidoClient, EntryPoint = "fido_authenticator_get_description")] - internal static extern int GetDescription(IntPtr /* fido_authenticator_h */ auth, out IntPtr desc); - - [DllImport(Libraries.FidoClient, EntryPoint = "fido_authenticator_get_assertion_scheme")] - internal static extern int GetAssertionScheme(IntPtr /* fido_authenticator_h */ auth, out IntPtr scheme); - - [DllImport(Libraries.FidoClient, EntryPoint = "fido_authenticator_get_algorithm")] - internal static extern int GetAlgorithm(IntPtr /* fido_authenticator_h */ auth, out int /* fido_auth_algo_e */ algo); - - [DllImport(Libraries.FidoClient, EntryPoint = "fido_authenticator_foreach_attestation_type")] - internal static extern int ForeachAttestationType(IntPtr /* fido_authenticator_h */ auth, FidoAttestationTypeCallback cb, IntPtr /* void */ userData); - - [DllImport(Libraries.FidoClient, EntryPoint = "fido_authenticator_get_verification_method")] - internal static extern int GetVerificationMethod(IntPtr /* fido_authenticator_h */ auth, out int /* fido_auth_user_verify_type_e */ userVerification); - - [DllImport(Libraries.FidoClient, EntryPoint = "fido_authenticator_get_key_protection_method")] - internal static extern int GetKeyProtectionMethod(IntPtr /* fido_authenticator_h */ auth, out int /* fido_auth_key_protection_type_e */ keyProtection); - - [DllImport(Libraries.FidoClient, EntryPoint = "fido_authenticator_get_matcher_protection_method")] - internal static extern int GetMatcherProtectionMethod(IntPtr /* fido_authenticator_h */ auth, out int /* fido_auth_matcher_protection_type_e */ matcherProtection); - - [DllImport(Libraries.FidoClient, EntryPoint = "fido_authenticator_get_attachment_hint")] - internal static extern int GetAttachmentHint(IntPtr /* fido_authenticator_h */ auth, out int /* fido_auth_attachment_hint_e */ attachmentHint); - - [DllImport(Libraries.FidoClient, EntryPoint = "fido_authenticator_get_is_second_factor_only")] - internal static extern bool GetIsSecondFactorOnly(IntPtr /* fido_authenticator_h */ auth); - - [DllImport(Libraries.FidoClient, EntryPoint = "fido_authenticator_get_tc_discplay")] - internal static extern int GetTcDiscplay(IntPtr /* fido_authenticator_h */ auth, out int /* fido_auth_tc_display_type_e */ tcDisplay); - - [DllImport(Libraries.FidoClient, EntryPoint = "fido_authenticator_get_tc_display_type")] - internal static extern int GetTcDisplayType(IntPtr /* fido_authenticator_h */ auth, out IntPtr tcDisplayContentType); - - [DllImport(Libraries.FidoClient, EntryPoint = "fido_authenticator_get_icon")] - internal static extern int GetIcon(IntPtr /* fido_authenticator_h */ auth, out IntPtr icon); - - [UnmanagedFunctionPointerAttribute(CallingConvention.Cdecl)] - internal delegate void FidoAuthenticatorCallback(IntPtr /* fido_authenticator_h */ authInfo, IntPtr /* void */ userData); - - [UnmanagedFunctionPointerAttribute(CallingConvention.Cdecl)] - internal delegate void FidoAttestationTypeCallback(int /* fido_auth_attestation_type_e */ attType, IntPtr /* void */ userData); - } -} diff --git a/src/Tizen.Account.FidoClient/Interop/Interop.Uaf.Client.cs b/src/Tizen.Account.FidoClient/Interop/Interop.Uaf.Client.cs deleted file mode 100755 index 2c4072d5e..000000000 --- a/src/Tizen.Account.FidoClient/Interop/Interop.Uaf.Client.cs +++ /dev/null @@ -1,35 +0,0 @@ -// Copyright 2016 by Samsung Electronics, Inc., -// -// This software is the confidential and proprietary information -// of Samsung Electronics, Inc. ("Confidential Information"). You -// shall not disclose such Confidential Information and shall use -// it only in accordance with the terms of the license agreement -// you entered into with Samsung. - -using System; -using System.Runtime.InteropServices; -using Tizen.Internals.Errors; - -internal static partial class Interop -{ - internal static partial class UafClient - { - [DllImport(Libraries.FidoClient, EntryPoint = "fido_get_client_vendor")] - internal static extern int FidoGetClientVendor(out string vendorName); - - [DllImport(Libraries.FidoClient, EntryPoint = "fido_get_client_version")] - internal static extern int FidoGetClientVersion(out int clientMajorVersion, out int clientMinorVersion); - - [DllImport(Libraries.FidoClient, EntryPoint = "fido_uaf_is_supported")] - internal static extern int FidoUafIsSupported(string uafMessageJson, out bool isSupported); - - [DllImport(Libraries.FidoClient, EntryPoint = "fido_uaf_get_response_message")] - internal static extern int FidoUafGetResponseMessage(string uafRequestJson, string channelBinding, FidoUafResponseMessageCallback callback, IntPtr /* void */ userData); - - [DllImport(Libraries.FidoClient, EntryPoint = "fido_uaf_set_server_result")] - internal static extern int FidoUafSetServerResult(int responseCode, string uafResponseJson); - - [UnmanagedFunctionPointerAttribute(CallingConvention.Cdecl)] - internal delegate void FidoUafResponseMessageCallback(int /* fido_error_e */ tizenErrorCode, string uafResponseJson, IntPtr /* void */ userData); - } -} diff --git a/src/Tizen.Account.FidoClient/Tizen.Account.FidoClient.csproj b/src/Tizen.Account.FidoClient/Tizen.Account.FidoClient.csproj deleted file mode 100644 index 7f4584ffe..000000000 --- a/src/Tizen.Account.FidoClient/Tizen.Account.FidoClient.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - netstandard2.0 - - - - - - - - diff --git a/src/Tizen.Account.FidoClient/Tizen.Account.FidoClient.sln b/src/Tizen.Account.FidoClient/Tizen.Account.FidoClient.sln deleted file mode 100755 index a6baae642..000000000 --- a/src/Tizen.Account.FidoClient/Tizen.Account.FidoClient.sln +++ /dev/null @@ -1,34 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26430.12 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Account.FidoClient", "Tizen.Account.FidoClient.csproj", "{11ED0ABB-177B-434B-909C-14D589455779}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen", "..\Tizen\Tizen.csproj", "{89AE4C5A-07D4-476A-8E30-6B0502094C1E}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Log", "..\Tizen.Log\Tizen.Log.csproj", "{B6FD3563-E050-43C1-BB6C-3728CBF5F8EA}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {11ED0ABB-177B-434B-909C-14D589455779}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {11ED0ABB-177B-434B-909C-14D589455779}.Debug|Any CPU.Build.0 = Debug|Any CPU - {11ED0ABB-177B-434B-909C-14D589455779}.Release|Any CPU.ActiveCfg = Release|Any CPU - {11ED0ABB-177B-434B-909C-14D589455779}.Release|Any CPU.Build.0 = Release|Any CPU - {89AE4C5A-07D4-476A-8E30-6B0502094C1E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {89AE4C5A-07D4-476A-8E30-6B0502094C1E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {89AE4C5A-07D4-476A-8E30-6B0502094C1E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {89AE4C5A-07D4-476A-8E30-6B0502094C1E}.Release|Any CPU.Build.0 = Release|Any CPU - {B6FD3563-E050-43C1-BB6C-3728CBF5F8EA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B6FD3563-E050-43C1-BB6C-3728CBF5F8EA}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B6FD3563-E050-43C1-BB6C-3728CBF5F8EA}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B6FD3563-E050-43C1-BB6C-3728CBF5F8EA}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/src/Tizen.Account.FidoClient/Tizen.Account.FidoClient/AuthenticatorInformation.cs b/src/Tizen.Account.FidoClient/Tizen.Account.FidoClient/AuthenticatorInformation.cs deleted file mode 100755 index 220b131ba..000000000 --- a/src/Tizen.Account.FidoClient/Tizen.Account.FidoClient/AuthenticatorInformation.cs +++ /dev/null @@ -1,126 +0,0 @@ -/* - * 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.Collections.Generic; - -namespace Tizen.Account.FidoClient -{ - /// - /// Contains information about the authenticators registered on the device. - /// - /// 3 - /// - /// - /// IEnumerable authInfos = await UafAuthenticatorFinder.DiscoverAuthenticatorsAsync(); - /// foreach (AuthenticatorInformation authInfo in authInfos) - /// { - /// string aaid = authInfo.Aaid; - /// string title = authInfo.Title; - /// } - /// - /// - public class AuthenticatorInformation - { - internal AuthenticatorInformation() - { - } - - /// - /// The authenticator Title - /// - /// 3 - public string Title { get; internal set; } - - /// - /// The Authenticator AAID (Authenticator Attestation ID) - /// - /// 3 - public string Aaid { get; internal set; } - - /// - /// The Authenticator description - /// - /// 3 - public string Description { get; internal set; } - - /// - /// The Authenticator assertion scheme. - /// - /// 3 - public string AssertionScheme { get; internal set; } - - /// - /// The Authenticator algorithm. - /// - /// 3 - public AuthenticationAlgorithm AuthenticationAlgorithm { get; internal set; } - - /// - /// The user verification method of this Authenticator - /// - /// 3 - public UserVerificationMethod UserVerification { get; internal set; } - - /// - /// The key protection method of this Authenticator. - /// - /// 3 - public KeyProtectionType KeyProtection { get; internal set; } - - /// - /// The matcher protection method of this Authenticator. - /// - /// 3 - public MatcherProtectionType MatcherProtection { get; internal set; } - - /// - /// The attachment hint of this Authenticator. - /// - /// 3 - public AuthenticatorAttachmentHint AttachmentHint { get; internal set; } - - /// - /// Denotes the Authenticator is Second factor only which is supported by U2F standards. - /// - /// 3 - public bool IsSecondFactorOnly { get; internal set; } - - /// - /// The available attestation types for this Authenticator. - /// - /// 3 - public IEnumerable AttestationTypes { get; internal set; } - - /// - /// The Transaction Confirmation display type of this Authenticator. - /// - /// 3 - public TransactionConfirmationDisplayType TcDisplayType { get; internal set; } - - /// - /// The Transaction Confirmation display type of this Authenticator. - /// - /// 3 - public string TcDisplayContentType { get; internal set; } - - /// - /// The icon of this Authenticator. - /// - /// 3 - public string Icon { get; internal set; } - } -} \ No newline at end of file diff --git a/src/Tizen.Account.FidoClient/Tizen.Account.FidoClient/ErrorFactory.cs b/src/Tizen.Account.FidoClient/Tizen.Account.FidoClient/ErrorFactory.cs deleted file mode 100755 index ef3191ab7..000000000 --- a/src/Tizen.Account.FidoClient/Tizen.Account.FidoClient/ErrorFactory.cs +++ /dev/null @@ -1,91 +0,0 @@ -/* - * 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.Account.FidoClient -{ - internal enum FidoErrorCode - { - None = ErrorCode.None, - OutOfMemory = ErrorCode.OutOfMemory, - InvalidParameter = ErrorCode.InvalidParameter, - NoData = ErrorCode.NoData, - NotSupported = ErrorCode.NotSupported, - PermissionDenied = ErrorCode.PermissionDenied, - UserActionInProgress = -0x01030000 | 0x01, - UserCancelled = -0x01030000 | 0x02, - UnsupportedVersion = -0x01030000 | 0x03, - NoSuitableAuthenticator = -0x01030000 | 0x04, - ProtocolError = -0x01030000 | 0x05, - UntrustedFacetId = -0x01030000 | 0x06, - Unknown = ErrorCode.Unknown - } - - internal class ErrorFactory - { - internal static string LogTag = "Tizen.Account.FidoClient"; - - internal static Exception GetException(int error) - { - if ((FidoErrorCode)error == FidoErrorCode.OutOfMemory) - { - return new OutOfMemoryException("Out of memory"); - } - else if ((FidoErrorCode)error == FidoErrorCode.InvalidParameter) - { - return new ArgumentException("Invalid parameter"); - } - else if ((FidoErrorCode)error == FidoErrorCode.UserActionInProgress) - { - return new InvalidOperationException("User action already in progress"); - } - else if ((FidoErrorCode)error == FidoErrorCode.NotSupported) - { - return new NotSupportedException("FIDO is unsupported."); - } - else if ((FidoErrorCode)error == FidoErrorCode.PermissionDenied) - { - return new UnauthorizedAccessException("Permission denied"); - } - else if ((FidoErrorCode)error == FidoErrorCode.UnsupportedVersion) - { - return new NotSupportedException("UAF message's version is not supported."); - } - else if ((FidoErrorCode)error == FidoErrorCode.NoSuitableAuthenticator) - { - return new Exception("Suitable authenticator can't be found"); - } - else if ((FidoErrorCode)error == FidoErrorCode.ProtocolError) - { - return new ArgumentException("Protocol error, the interaction may have timed out, or the UAF message is malformed."); - } - else if ((FidoErrorCode)error == FidoErrorCode.UserCancelled) - { - return new Exception("User has canceled the operation."); - } - else if ((FidoErrorCode)error == FidoErrorCode.UntrustedFacetId) - { - return new Exception(" The caller's id is not allowed to use this operation."); - } - else - { - return new Exception("Unknown error"); - } - } - } -} diff --git a/src/Tizen.Account.FidoClient/Tizen.Account.FidoClient/UafAuthenticatorFinder.cs b/src/Tizen.Account.FidoClient/Tizen.Account.FidoClient/UafAuthenticatorFinder.cs deleted file mode 100755 index bed73d4a2..000000000 --- a/src/Tizen.Account.FidoClient/Tizen.Account.FidoClient/UafAuthenticatorFinder.cs +++ /dev/null @@ -1,211 +0,0 @@ -/* - * 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.Collections.Generic; -using System.Threading.Tasks; -using System.Runtime.InteropServices; - -namespace Tizen.Account.FidoClient -{ - /// - /// Class to find available FIDO specific authenticators on the device - /// - /// 3 - public static class UafAuthenticatorFinder - { - /// - /// Retrieves all the available FIDO authenticators supported by this Device. - /// - /// 3 - /// Enumerable list of authenticators - /// http://tizen.org/privilege/fido.client - /// http://tizen.org/feature/fido.uaf - /// Thrown when the application does not have privilege to access this method - /// FIDO is not supported - - /// - /// - /// IEnumerable authInfos = await UafAuthenticatorFinder.DiscoverAuthenticatorsAsync(); - /// foreach (AuthenticatorInformation authInfo in authInfos) - /// { - /// string aaid = authInfo.Aaid; - /// string title = authInfo.Title; - /// } - /// - /// - public static async Task> DiscoverAuthenticatorsAsync() - { - IEnumerable result = null; - await Task.Run(() => result = Discover()); - return result; - } - - private static IEnumerable Discover() - { - IList result = new List(); - - Interop.UafAuthenticator.FidoAuthenticatorCallback cb = (IntPtr authHandle, IntPtr userData) => - { - Log.Info(ErrorFactory.LogTag, "Iterating authenticators"); - result.Add(GetAuthInfo(authHandle)); - }; - - int ret = Interop.UafAuthenticator.ForeachAuthenticator(cb, IntPtr.Zero); - if(ret != (int)FidoErrorCode.None) - { - Log.Error(ErrorFactory.LogTag, "Interop API failed with error code: [" + ret + "]"); - throw ErrorFactory.GetException(ret); - } - - return result; - } - - private static AuthenticatorInformation GetAuthInfo(IntPtr authHandle) - { - var authInfo = new AuthenticatorInformation(); - - IntPtr stringPtr; - int ret = Interop.UafAuthenticator.GetTitle(authHandle, out stringPtr); - if (ret != (int)FidoErrorCode.None) - { - Log.Error(ErrorFactory.LogTag, "Interop API failed with error code: [" + ret + "]"); - throw ErrorFactory.GetException(ret); - } - authInfo.Title = Marshal.PtrToStringAnsi(stringPtr); - Interop.Libc.Free(stringPtr); - - ret = Interop.UafAuthenticator.GetAaid(authHandle, out stringPtr); - if (ret != (int)FidoErrorCode.None) - { - Log.Error(ErrorFactory.LogTag, "Interop API failed with error code: [" + ret + "]"); - throw ErrorFactory.GetException(ret); - } - authInfo.Aaid = Marshal.PtrToStringAnsi(stringPtr); - Interop.Libc.Free(stringPtr); - - ret = Interop.UafAuthenticator.GetDescription(authHandle, out stringPtr); - if (ret != (int)FidoErrorCode.None) - { - Log.Error(ErrorFactory.LogTag, "Interop API failed with error code: [" + ret + "]"); - throw ErrorFactory.GetException(ret); - } - authInfo.Description = Marshal.PtrToStringAnsi(stringPtr); - Interop.Libc.Free(stringPtr); - - ret = Interop.UafAuthenticator.GetAssertionScheme(authHandle, out stringPtr); - if (ret != (int)FidoErrorCode.None) - { - Log.Error(ErrorFactory.LogTag, "Interop API failed with error code: [" + ret + "]"); - throw ErrorFactory.GetException(ret); - } - authInfo.AssertionScheme = Marshal.PtrToStringAnsi(stringPtr); - Interop.Libc.Free(stringPtr); - - int authAlgo; - ret = Interop.UafAuthenticator.GetAlgorithm(authHandle, out authAlgo); - if (ret != (int)FidoErrorCode.None) - { - Log.Error(ErrorFactory.LogTag, "Interop API failed with error code: [" + ret + "]"); - throw ErrorFactory.GetException(ret); - } - - int usrVerificationMethod; - ret = Interop.UafAuthenticator.GetVerificationMethod(authHandle, out usrVerificationMethod); - if (ret != (int)FidoErrorCode.None) - { - Log.Error(ErrorFactory.LogTag, "Interop API failed with error code: [" + ret + "]"); - throw ErrorFactory.GetException(ret); - } - - int keyProtectionType; - ret = Interop.UafAuthenticator.GetKeyProtectionMethod(authHandle, out keyProtectionType); - if (ret != (int)FidoErrorCode.None) - { - Log.Error(ErrorFactory.LogTag, "Interop API failed with error code: [" + ret + "]"); - throw ErrorFactory.GetException(ret); - } - - int matcherProtection; - ret = Interop.UafAuthenticator.GetMatcherProtectionMethod(authHandle, out matcherProtection); - if (ret != (int)FidoErrorCode.None) - { - Log.Error(ErrorFactory.LogTag, "Interop API failed with error code: [" + ret + "]"); - throw ErrorFactory.GetException(ret); - } - - int attachmentHint; - ret = Interop.UafAuthenticator.GetAttachmentHint(authHandle, out attachmentHint); - if (ret != (int)FidoErrorCode.None) - { - Log.Error(ErrorFactory.LogTag, "Interop API failed with error code: [" + ret + "]"); - throw ErrorFactory.GetException(ret); - } - - bool isSecondaryOnly = Interop.UafAuthenticator.GetIsSecondFactorOnly(authHandle); - - int tcDisplayType; - ret = Interop.UafAuthenticator.GetTcDiscplay(authHandle, out tcDisplayType); - if (ret != (int)FidoErrorCode.None) - { - Log.Error(ErrorFactory.LogTag, "Interop API failed with error code: [" + ret + "]"); - throw ErrorFactory.GetException(ret); - } - - ret = Interop.UafAuthenticator.GetTcDisplayType(authHandle, out stringPtr); - if (ret != (int)FidoErrorCode.None) - { - Log.Error(ErrorFactory.LogTag, "Interop API failed with error code: [" + ret + "]"); - throw ErrorFactory.GetException(ret); - } - authInfo.TcDisplayContentType = Marshal.PtrToStringAnsi(stringPtr); - Interop.Libc.Free(stringPtr); - - ret = Interop.UafAuthenticator.GetIcon(authHandle, out stringPtr); - if (ret != (int)FidoErrorCode.None) - { - Log.Error(ErrorFactory.LogTag, "Interop API failed with error code: [" + ret + "]"); - throw ErrorFactory.GetException(ret); - } - authInfo.Icon = Marshal.PtrToStringAnsi(stringPtr); - Interop.Libc.Free(stringPtr); - - var attestationTypes = new List (); - Interop.UafAuthenticator.FidoAttestationTypeCallback cb = (int type, IntPtr usrData) => - { - attestationTypes.Add((AuthenticatorAttestationType)type); - }; - - ret = Interop.UafAuthenticator.ForeachAttestationType(authHandle, cb, IntPtr.Zero); - if (ret != (int)FidoErrorCode.None) - { - Log.Error(ErrorFactory.LogTag, "Interop API failed with error code: [" + ret + "]"); - throw ErrorFactory.GetException(ret); - } - - authInfo.AuthenticationAlgorithm = (AuthenticationAlgorithm)authAlgo; - authInfo.UserVerification = (UserVerificationMethod)usrVerificationMethod; - authInfo.KeyProtection = (KeyProtectionType)keyProtectionType; - authInfo.MatcherProtection = (MatcherProtectionType)matcherProtection; - authInfo.AttachmentHint = (AuthenticatorAttachmentHint)attachmentHint; - authInfo.IsSecondFactorOnly = isSecondaryOnly; - authInfo.TcDisplayType = (TransactionConfirmationDisplayType)tcDisplayType; - authInfo.AttestationTypes = attestationTypes; - - return authInfo; - } - } -} diff --git a/src/Tizen.Account.FidoClient/Tizen.Account.FidoClient/UafClient.cs b/src/Tizen.Account.FidoClient/Tizen.Account.FidoClient/UafClient.cs deleted file mode 100755 index da3f9dabf..000000000 --- a/src/Tizen.Account.FidoClient/Tizen.Account.FidoClient/UafClient.cs +++ /dev/null @@ -1,247 +0,0 @@ -/* - * 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.Threading.Tasks; -using Tizen.Internals.Errors; - -namespace Tizen.Account.FidoClient -{ - /// - /// The FIDO UAF Client APIs - /// - /// 3 - public static class UafClient - { - private static string _vendorName = null; - private static int _majorVersion; - private static int _minorVersion; - - static UafClient() - { - int ret = Interop.UafClient.FidoGetClientVendor(out _vendorName); - if (ret != (int)FidoErrorCode.None) - { - Log.Error(ErrorFactory.LogTag, "Interop API failed with error code: [" + ret + "]"); - throw ErrorFactory.GetException(ret); - } - - ret = Interop.UafClient.FidoGetClientVersion(out _majorVersion, out _minorVersion); - if (ret != (int)FidoErrorCode.None) - { - Log.Error(ErrorFactory.LogTag, "Interop API failed with error code: [" + ret + "]"); - throw ErrorFactory.GetException(ret); - } - } - - /// - /// The FIDO Client vendor name - /// - /// 3 - public static string VendorName - { - get - { - return _vendorName; - } - } - - /// - /// The FIDO Client Major version - /// - /// 3 - public static int MajorVersion - { - get - { - return _majorVersion; - } - } - - /// - /// The FIDO Client Minor version - /// - /// 3 - public static int MinorVersion - { - get - { - return _minorVersion; - } - } - - /// - /// The FIDO Server response for successfull interaction. - /// - /// 3 - public static int StautsOk - { - get - { - return 1200; - } - } - - /// - /// Checks whether the FIDO message can be processed - /// - /// 3 - /// The FIDO UAF message which is received from the relying party server - /// True if the message can be handled by the device, else false - /// http://tizen.org/privilege/fido.client - /// http://tizen.org/feature/fido.uaf - /// In case of invalid parameter - /// Thrown when the application does not have privilege to access this method - /// FIDO is not supported - /// - /// - /// UafMessage uafRequest = new UafMessage() - /// { - /// Operation = "UafRequestJson" - /// }; - /// bool response = await UafClient.CheckPolicyAsync(uafRequest); - /// - /// - public static async Task CheckPolicyAsync(UafMessage uafMessage) - { - if (uafMessage == null) - { - Log.Error(ErrorFactory.LogTag, "Invalid request or request is null"); - throw ErrorFactory.GetException((int)FidoErrorCode.InvalidParameter); - } - - bool result = false; - await Task.Run(() => result = CheckPolicy(uafMessage.Operation)); - return result; - } - - /// - /// Processes the given FIDO UAF message. - /// - /// 3 - /// The FIDO UAF message which is received from the relying party server - /// The channel binding data in JSON format which is received from the relying party server - /// FIDO response message - /// http://tizen.org/privilege/fido.client - /// http://tizen.org/feature/fido.uaf - /// In case of invalid parameter - /// Thrown when the application does not have privilege to access this method - /// FIDO is not supported - /// - /// - /// UafMessage uafRequest = new UafMessage() - /// { - /// Operation = "UafAuthRequestJson" - /// }; - /// - /// var response = await UafClient.ProcessRequestAsync(uafRequest, null); - /// - /// - public static async Task ProcessRequestAsync(UafMessage uafMessage, string channelBindng) - { - if (uafMessage == null) - { - Log.Error(ErrorFactory.LogTag, "Invalid request or request is null"); - throw ErrorFactory.GetException((int)FidoErrorCode.InvalidParameter); - } - - TaskCompletionSource tcs = new TaskCompletionSource(); - Interop.UafClient.FidoUafResponseMessageCallback cb = (int errorCode, string uafResponseJson, IntPtr userData) => - { - if (uafMessage == null) - { - Log.Error(ErrorFactory.LogTag, "Invalid request or request is null"); - tcs.SetException(ErrorFactory.GetException((int)FidoErrorCode.InvalidParameter)); - } - - if (errorCode != (int)FidoErrorCode.None) - { - Log.Error(ErrorFactory.LogTag, "Interop callback failed with error code: [" + errorCode + "]"); - tcs.SetException(ErrorFactory.GetException(errorCode)); - } - - tcs.SetResult(new UafResponse() { Response = uafResponseJson }); - }; - - int ret = Interop.UafClient.FidoUafGetResponseMessage(uafMessage.Operation, channelBindng, cb, IntPtr.Zero); - if (ret != (int)FidoErrorCode.None) - { - Log.Error(ErrorFactory.LogTag, "Interop API failed with error code: [" + ret + "]"); - throw ErrorFactory.GetException(ret); - } - - return await tcs.Task; - } - - /// - /// Notifies the FIDO client about the server result. FIDO Server sends the result of processing a UAF message to FIDO client. - /// - /// 3 - /// The status code received from Server.(StautsOk implies success) - /// The FIDO response message sent to server in JSON format - /// http://tizen.org/privilege/fido.client - /// http://tizen.org/feature/fido.uaf - /// - /// This is especially important for cases when a new registration may be considered by the client to be in a pending state until it is communicated that the server accepted it - /// - /// In case of invalid parameter - /// Thrown when the application does not have privilege to access this method - /// FIDO is not supported - /// - /// - /// UafResponse response = new UafResponse() - /// { - /// Response = "Responsejson" - /// }; - /// - /// await UafClient.NotifyResultAsync(UafClient.StautsOk, response); - /// - /// - public static async Task NotifyResultAsync(int responseCode, UafResponse response) - { - if (response == null) - { - Log.Error(ErrorFactory.LogTag, "Invalid parameter"); - throw ErrorFactory.GetException((int)FidoErrorCode.InvalidParameter); - } - - await Task.Run(() => NotifyResult(responseCode, response.Response)); - } - - private static bool CheckPolicy(string uafOperation) - { - bool isSupported; - int ret = Interop.UafClient.FidoUafIsSupported(uafOperation, out isSupported); - if (ret != (int)FidoErrorCode.None) - { - Log.Error(ErrorFactory.LogTag, "Interop API failed with error code: [" + ret + "]"); - throw ErrorFactory.GetException(ret); - } - return isSupported; - } - - private static void NotifyResult(int responseCode, string response) - { - int ret = Interop.UafClient.FidoUafSetServerResult(responseCode, response); - if (ret != (int)FidoErrorCode.None) - { - Log.Error(ErrorFactory.LogTag, "Interop API failed with error code: [" + ErrorFacts.GetErrorMessage(ret) + "]"); - throw ErrorFactory.GetException(ret); - } - } - - } -} diff --git a/src/Tizen.Account.FidoClient/Tizen.Account.FidoClient/UafEnumerations.cs b/src/Tizen.Account.FidoClient/Tizen.Account.FidoClient/UafEnumerations.cs deleted file mode 100755 index 89367ff75..000000000 --- a/src/Tizen.Account.FidoClient/Tizen.Account.FidoClient/UafEnumerations.cs +++ /dev/null @@ -1,312 +0,0 @@ -/* - * 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. - */ - -namespace Tizen.Account.FidoClient -{ - /// - /// Authenticator's supported algorithm and encoding - /// - /// 3 - public enum AuthenticationAlgorithm - { - /// - /// SECP256R1 ECDSA SHA256 Raw - /// - /// 3 - Secp256r1EcdsaSha256Raw = 0X01, - - /// - /// SECP256R1 ECDSA SHA256 DER - /// - /// 3 - Secp256r1EcdsaSha256Der = 0X02, - - /// - /// RSA PSS SHA256 Raw - /// - /// 3 - RsassaPssSha256Raw = 0X03, - - /// - /// RSA PSS SHA256 DER - /// - /// 3 - RsassaPssSha256Der = 0X04, - - /// - /// SECP256K1 ECDSA SHA256 Raw - /// - /// 3 - Secp256k1EcdsaSha256Raw = 0X05, - - /// - /// SECP256K1 ECDSA SHA256 DER - /// - /// 3 - Secp256k1EcdsaSha256Der = 0X06 - } - - /// - /// Authenticator's supported user verification method type. - /// - /// 3 - public enum UserVerificationMethod - { - /// - /// User presence verification. - /// - /// 3 - Presence = 0X01, - - /// - /// User fingerprint verification. - /// - /// 3 - Fingerprint = 0X02, - - /// - /// User passcode verification. - /// - /// 3 - Passcode = 0X04, - - /// - /// User voiceprint verification. - /// - /// 3 - Voiceprint = 0X08, - - /// - /// User faceprint verification. - /// - /// 3 - Faceprint = 0X10, - /// - /// User location verification. - /// - /// 3 - Location = 0X20, - - /// - /// User eyeprint verification. - /// - /// 3 - Eyeprint = 0X40, - - /// - /// User pattern verification. - /// - /// 3 - Pattern = 0X80, - - /// - /// User handprint verification. - /// - /// 3 - Handprint = 0X100, - - /// - /// Silent verification. - /// - /// 3 - None = 0X200, - - /// - /// If an authenticator sets multiple flags for user verification types, it may also set this flag to indicate that all verification methods will be enforced (e.g. faceprint AND voiceprint). If flags for multiple user verification methods are set and this flag is not set, verification with only one is necessary (e.g. fingerprint OR passcode). - /// - /// 3 - All = 0X400 - } - - /// - /// Authenticator's supported key protection method type. - /// - /// 3 - public enum KeyProtectionType - { - /// - /// Software based key management. - /// - /// 3 - Software = 0X01, - - /// - /// Hardware based key management. - /// - /// 3 - Hardware = 0X02, - - /// - /// Trusted Execution Environment based key management. - /// - /// 3 - Tee = 0X04, - - /// - /// Secure Element based key management. - /// - /// 3 - SecureElement = 0X08, - - /// - /// Authenticator does not store (wrapped) UAuth keys at the client, but relies on a server-provided key handle. - /// - /// 3 - RemoteHandle = 0X10 - } - - /// - /// Authenticator's supported matcher protection type. - /// - /// 3 - public enum MatcherProtectionType - { - /// - /// Authenticator's matcher is running in software. - /// - /// 3 - Software = 0X01, - - /// - /// Authenticator's matcher is running inside the Trusted Execution Environment. - /// - /// 3 - Tee = 0X02, - - /// - /// Aauthenticator's matcher is running on the chip. - /// - /// 3 - OnChip = 0X04 - } - - /// - /// Authenticator's supproted method to communicate to FIDO user device. - /// - /// 3 - public enum AuthenticatorAttachmentHint - { - /// - /// Authenticator is permanently attached to the FIDO User Device. - /// - /// 3 - Internal = 0X01, - - /// - /// Authenticator is removable or remote from the FIDO User Device. - /// - /// 3 - External = 0X02, - - /// - /// The external authenticator currently has an exclusive wired connection. - /// - /// 3 - Wired = 0X04, - - /// - /// The external authenticator communicates with the FIDO User Device through wireless means. - /// - /// 3 - Wireless = 0X08, - - /// - /// Authenticator is able to communicate by NFC to the FIDO User Device. - /// - /// 3 - Nfc = 0X10, - - /// - /// Authenticator is able to communicate by Bluetooth to the FIDO User Device. - /// - /// 3 - Bt = 0X20, - - /// - /// Authenticator is connected to the FIDO User Device ver a non-exclusive network (e.g. over a TCP/IP LAN or WAN, as opposed to a PAN or point-to-point connection). - /// - /// 3 - Nw = 0X40, - - /// - /// The external authenticator is in a "ready" state. - /// - /// 3 - Ready = 0X80, - - /// - /// The external authenticator is able to communicate using WiFi Direct with the FIDO User Device. - /// - /// 3 - WifiDirect = 0X100 - } - - /// - /// Authenticator's supported Attestation type. - /// - /// 3 - public enum AuthenticatorAttestationType - { - /// - /// Full basic attestation. - /// - /// 3 - BasicFull = 0X3e07, - - /// - /// Surrogate basic attestation. - /// - /// 3 - BasicSurrogate = 0X3e08, - } - - /// - /// Transaction confirmation display capability type. - /// - /// 3 - public enum TransactionConfirmationDisplayType - { - /// - /// Some form of transaction confirmation display is available on this authenticator. - /// - /// 3 - Any = 0X01, - - /// - /// Software-based transaction confirmation display operating in a privileged context is available on this authenticator. - /// - /// 3 - PrivilegedSoftware = 0X02, - - /// - /// Transaction confirmation display is in a Trusted Execution Environment. - /// - /// 3 - Tee = 0X04, - - /// - /// Transaction confirmation display based on hardware assisted capabilities is available on this authenticator. - /// - /// 3 - Hw = 0X08, - - /// - /// Transaction confirmation display is provided on a distinct device from the FIDO User Device. - /// - /// 3 - Remote = 0X10 - } -} diff --git a/src/Tizen.Account.FidoClient/Tizen.Account.FidoClient/UafMessage.cs b/src/Tizen.Account.FidoClient/Tizen.Account.FidoClient/UafMessage.cs deleted file mode 100755 index 92fe2fefb..000000000 --- a/src/Tizen.Account.FidoClient/Tizen.Account.FidoClient/UafMessage.cs +++ /dev/null @@ -1,39 +0,0 @@ -/* - * 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. - */ - -namespace Tizen.Account.FidoClient -{ - /// - /// The FIDO message received from the relying party server - /// - /// 3 - public class UafMessage - { - /// - /// The constructor - /// - /// 3 - public UafMessage() - { - } - - /// - /// The FIDO message in JSON format which is received from the relying party server - /// - /// 3 - public string Operation { get; set; } - } -} \ No newline at end of file diff --git a/src/Tizen.Account.FidoClient/Tizen.Account.FidoClient/UafResponse.cs b/src/Tizen.Account.FidoClient/Tizen.Account.FidoClient/UafResponse.cs deleted file mode 100755 index bc63076f3..000000000 --- a/src/Tizen.Account.FidoClient/Tizen.Account.FidoClient/UafResponse.cs +++ /dev/null @@ -1,39 +0,0 @@ -/* - * 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. - */ - -namespace Tizen.Account.FidoClient -{ - /// - /// Represents FIDO response message - /// - /// 3 - public class UafResponse - { - /// - /// The constructor - /// - /// 3 - public UafResponse() - { - } - - /// - /// FIDO response message in JSON format - /// - /// 3 - public string Response { set; get; } - } -} \ No newline at end of file diff --git a/src/Tizen.Account.OAuth2/Interop/Interop.Common.cs b/src/Tizen.Account.OAuth2/Interop/Interop.Common.cs deleted file mode 100644 index b16906f04..000000000 --- a/src/Tizen.Account.OAuth2/Interop/Interop.Common.cs +++ /dev/null @@ -1,55 +0,0 @@ -/* - * 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; - -/// -/// Contains Interop declarations of OAuth2 classes. -/// -internal static partial class Interop -{ - /// - /// Safehandle wrapper for OAuth2 native handles. - /// - internal abstract class SafeOauth2Handle : SafeHandle - { - public SafeOauth2Handle() : base(IntPtr.Zero, true) - { - } - - public SafeOauth2Handle(IntPtr handle) : base(handle, true) - { - } - - public override bool IsInvalid - { - get - { - return handle == IntPtr.Zero; - } - } - - public abstract void Destroy(); - - protected override bool ReleaseHandle() - { - Destroy(); - SetHandle(IntPtr.Zero); - return true; - } - } -} diff --git a/src/Tizen.Account.OAuth2/Interop/Interop.Error.cs b/src/Tizen.Account.OAuth2/Interop/Interop.Error.cs deleted file mode 100644 index de7716834..000000000 --- a/src/Tizen.Account.OAuth2/Interop/Interop.Error.cs +++ /dev/null @@ -1,44 +0,0 @@ -/* - * 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; - -/// -/// Contains Interop declarations of OAuth2 classes. -/// -internal static partial class Interop -{ - /// - /// Wrapper class for OAuth2 native API. - /// - internal static partial class Error - { - [DllImport(Libraries.OAuth2, EntryPoint = "oauth2_error_get_code")] - internal static extern int GetCode(IntPtr /* oauth2_error_h */ handle, out int serverErrorCode, out int platformErrorCode); - - [DllImport(Libraries.OAuth2, EntryPoint = "oauth2_error_get_description")] - internal static extern int GetDescription(IntPtr /* oauth2_error_h */ handle, out string description); - - [DllImport(Libraries.OAuth2, EntryPoint = "oauth2_error_get_uri")] - internal static extern int GetUri(IntPtr /* oauth2_error_h */ handle, out string uri); - - [DllImport(Libraries.OAuth2, EntryPoint = "oauth2_error_get_custom_data")] - internal static extern int GetCustomData(IntPtr /* oauth2_error_h */ handle, string customKey, out string customValue); - - - } -} diff --git a/src/Tizen.Account.OAuth2/Interop/Interop.Libraries.cs b/src/Tizen.Account.OAuth2/Interop/Interop.Libraries.cs deleted file mode 100644 index b44646744..000000000 --- a/src/Tizen.Account.OAuth2/Interop/Interop.Libraries.cs +++ /dev/null @@ -1,28 +0,0 @@ -/* - * 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 -{ - /// - /// Wrapper class for maintaining names of dependent native libraries. - /// - internal static partial class Libraries - { - public const string OAuth2 = "liboauth2.so.0"; - public const string Glib = "libglib-2.0.so.0"; - public const string Libc = "libc.so.6"; - } -} diff --git a/src/Tizen.Account.OAuth2/Interop/Interop.Manager.cs b/src/Tizen.Account.OAuth2/Interop/Interop.Manager.cs deleted file mode 100755 index 3970b6bf1..000000000 --- a/src/Tizen.Account.OAuth2/Interop/Interop.Manager.cs +++ /dev/null @@ -1,70 +0,0 @@ -/* - * 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; - -/// -/// Contains Interop declarations of OAuth2 classes. -/// -internal static partial class Interop -{ - /// - /// Wrapper class for OAuth2 native API. - /// - internal static partial class Manager - { - [UnmanagedFunctionPointerAttribute(CallingConvention.Cdecl)] - internal delegate void Oauth2TokenCallback(IntPtr /* oauth2_response_h */ response, IntPtr /* void */ userData); - - [UnmanagedFunctionPointerAttribute(CallingConvention.Cdecl)] - internal delegate void Oauth2AuthGrantCallback(IntPtr /* oauth2_response_h */ response, IntPtr /* void */ userData); - - [UnmanagedFunctionPointerAttribute(CallingConvention.Cdecl)] - internal delegate void Oauth2AccessTokenCallback(IntPtr /* oauth2_response_h */ response, IntPtr /* void */ userData); - - [UnmanagedFunctionPointerAttribute(CallingConvention.Cdecl)] - internal delegate void Oauth2RefreshTokenCallback(IntPtr /* oauth2_response_h */ response, IntPtr /* void */ userData); - - [DllImport(Libraries.OAuth2, EntryPoint = "oauth2_manager_create")] - internal static extern int Create(out IntPtr /* oauth2_manager_h */ handle); - - [DllImport(Libraries.OAuth2, EntryPoint = "oauth2_manager_destroy")] - internal static extern int Destroy(IntPtr /* oauth2_manager_h */ handle); - - [DllImport(Libraries.OAuth2, EntryPoint = "oauth2_manager_request_token")] - internal static extern int RequestToken(IntPtr /* oauth2_manager_h */ handle, IntPtr /* oauth2_request_h */ request, Oauth2TokenCallback callback, IntPtr /* void */ userData); - - [DllImport(Libraries.OAuth2, EntryPoint = "oauth2_manager_request_authorization_grant")] - internal static extern int RequestAuthorizationGrant(IntPtr /* oauth2_manager_h */ handle, IntPtr /* oauth2_request_h */ request, Oauth2AuthGrantCallback callback, IntPtr /* void */ userData); - - [DllImport(Libraries.OAuth2, EntryPoint = "oauth2_manager_request_access_token")] - internal static extern int RequestAccessToken(IntPtr /* oauth2_manager_h */ handle, IntPtr /* oauth2_request_h */ request, Oauth2AccessTokenCallback callback, IntPtr /* void */ userData); - - [DllImport(Libraries.OAuth2, EntryPoint = "oauth2_manager_refresh_access_token")] - internal static extern int RefreshAccessToken(IntPtr /* oauth2_manager_h */ handle, IntPtr /* oauth2_request_h */ request, Oauth2RefreshTokenCallback callback, IntPtr /* void */ userData); - - [DllImport(Libraries.OAuth2, EntryPoint = "oauth2_manager_is_request_in_progress")] - [return: MarshalAs(UnmanagedType.I1)] - internal static extern bool IsRequestInProgress(IntPtr /* oauth2_manager_h */ handle); - - [DllImport(Libraries.OAuth2, EntryPoint = "oauth2_manager_clear_cookies")] - internal static extern int ClearCookies(IntPtr /* oauth2_manager_h */ handle); - - [DllImport(Libraries.OAuth2, EntryPoint = "oauth2_manager_clear_cache")] - internal static extern int ClearCache(IntPtr /* oauth2_manager_h */ handle); - } -} diff --git a/src/Tizen.Account.OAuth2/Interop/Interop.Request.cs b/src/Tizen.Account.OAuth2/Interop/Interop.Request.cs deleted file mode 100644 index c76dba092..000000000 --- a/src/Tizen.Account.OAuth2/Interop/Interop.Request.cs +++ /dev/null @@ -1,129 +0,0 @@ -/* - * 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; - -/// -/// Contains Interop declarations of OAuth2 classes. -/// -internal static partial class Interop -{ - /// - /// Wrapper class for OAuth2 native API. - /// - internal static partial class Request - { - [DllImport(Libraries.OAuth2, EntryPoint = "oauth2_request_create")] - internal static extern int Create(out IntPtr /* oauth2_request_h */ handle); - - [DllImport(Libraries.OAuth2, EntryPoint = "oauth2_request_destroy")] - internal static extern int Destroy(IntPtr /* oauth2_request_h */ handle); - - [DllImport(Libraries.OAuth2, EntryPoint = "oauth2_request_set_auth_end_point_url")] - internal static extern int SetAuthEndPointUrl(IntPtr /* oauth2_request_h */ handle, string url); - - [DllImport(Libraries.OAuth2, EntryPoint = "oauth2_request_set_token_end_point_url")] - internal static extern int SetTokenEndPointUrl(IntPtr /* oauth2_request_h */ handle, string url); - - [DllImport(Libraries.OAuth2, EntryPoint = "oauth2_request_set_redirection_url")] - internal static extern int SetRedirectionUrl(IntPtr /* oauth2_request_h */ handle, string url); - - [DllImport(Libraries.OAuth2, EntryPoint = "oauth2_request_set_refresh_token_url")] - internal static extern int SetRefreshTokenUrl(IntPtr /* oauth2_request_h */ handle, string url); - - [DllImport(Libraries.OAuth2, EntryPoint = "oauth2_request_set_refresh_token")] - internal static extern int SetRefreshToken(IntPtr /* oauth2_request_h */ handle, string refreshToken); - - [DllImport(Libraries.OAuth2, EntryPoint = "oauth2_request_set_response_type")] - internal static extern int SetResponseType(IntPtr /* oauth2_request_h */ handle, ResponseType /* oauth2_response_type_e */ responseType); - - [DllImport(Libraries.OAuth2, EntryPoint = "oauth2_request_set_client_id")] - internal static extern int SetClientId(IntPtr /* oauth2_request_h */ handle, string clientId); - - [DllImport(Libraries.OAuth2, EntryPoint = "oauth2_request_set_client_secret")] - internal static extern int SetClientSecret(IntPtr /* oauth2_request_h */ handle, string clientSecret); - - [DllImport(Libraries.OAuth2, EntryPoint = "oauth2_request_set_client_authentication_type")] - internal static extern int SetClientAuthenticationType(IntPtr /* oauth2_request_h */ handle, int /* oauth2_client_authentication_type_e */ clientAuthType); - - [DllImport(Libraries.OAuth2, EntryPoint = "oauth2_request_set_scope")] - internal static extern int SetScope(IntPtr /* oauth2_request_h */ handle, string scope); - - [DllImport(Libraries.OAuth2, EntryPoint = "oauth2_request_set_state")] - internal static extern int SetState(IntPtr /* oauth2_request_h */ handle, string state); - - [DllImport(Libraries.OAuth2, EntryPoint = "oauth2_request_set_grant_type")] - internal static extern int SetGrantType(IntPtr /* oauth2_request_h */ handle, GrantType /* oauth2_grant_type_e */ grantType); - - [DllImport(Libraries.OAuth2, EntryPoint = "oauth2_request_set_authorization_code")] - internal static extern int SetAuthorizationCode(IntPtr /* oauth2_request_h */ handle, string code); - - [DllImport(Libraries.OAuth2, EntryPoint = "oauth2_request_set_user_name")] - internal static extern int SetUserName(IntPtr /* oauth2_request_h */ handle, string userName); - - [DllImport(Libraries.OAuth2, EntryPoint = "oauth2_request_set_password")] - internal static extern int SetPassword(IntPtr /* oauth2_request_h */ handle, string password); - - [DllImport(Libraries.OAuth2, EntryPoint = "oauth2_request_add_custom_data")] - internal static extern int AddCustomData(IntPtr /* oauth2_request_h */ handle, string key, string value); - - [DllImport(Libraries.OAuth2, EntryPoint = "oauth2_request_get_auth_end_point_url")] - internal static extern int GetAuthEndPointUrl(IntPtr /* oauth2_request_h */ handle, out string url); - - [DllImport(Libraries.OAuth2, EntryPoint = "oauth2_request_get_token_end_point_url")] - internal static extern int GetTokenEndPointUrl(IntPtr /* oauth2_request_h */ handle, out string url); - - [DllImport(Libraries.OAuth2, EntryPoint = "oauth2_request_get_redirection_url")] - internal static extern int GetRedirectionUrl(IntPtr /* oauth2_request_h */ handle, out string url); - - [DllImport(Libraries.OAuth2, EntryPoint = "oauth2_request_get_refresh_token_url")] - internal static extern int GetRefreshTokenUrl(IntPtr /* oauth2_request_h */ handle, out string url); - - [DllImport(Libraries.OAuth2, EntryPoint = "oauth2_request_get_refresh_token")] - internal static extern int GetRefreshToken(IntPtr /* oauth2_request_h */ handle, out string refreshToken); - - [DllImport(Libraries.OAuth2, EntryPoint = "oauth2_request_get_response_type")] - internal static extern int GetResponseType(IntPtr /* oauth2_request_h */ handle, out ResponseType /* oauth2_response_type_e */ responseType); - - [DllImport(Libraries.OAuth2, EntryPoint = "oauth2_request_get_client_id")] - internal static extern int GetClientId(IntPtr /* oauth2_request_h */ handle, out string clientId); - - [DllImport(Libraries.OAuth2, EntryPoint = "oauth2_request_get_client_secret")] - internal static extern int GetClientSecret(IntPtr /* oauth2_request_h */ handle, out string clientSecret); - - [DllImport(Libraries.OAuth2, EntryPoint = "oauth2_request_get_scope")] - internal static extern int GetScope(IntPtr /* oauth2_request_h */ handle, out string scope); - - [DllImport(Libraries.OAuth2, EntryPoint = "oauth2_request_get_state")] - internal static extern int GetState(IntPtr /* oauth2_request_h */ handle, out string state); - - [DllImport(Libraries.OAuth2, EntryPoint = "oauth2_request_get_grant_type")] - internal static extern int GetGrantType(IntPtr /* oauth2_request_h */ handle, out GrantType /* oauth2_grant_type_e */ grantType); - - [DllImport(Libraries.OAuth2, EntryPoint = "oauth2_request_get_authorization_code")] - internal static extern int GetAuthorizationCode(IntPtr /* oauth2_request_h */ handle, out string code); - - [DllImport(Libraries.OAuth2, EntryPoint = "oauth2_request_get_user_name")] - internal static extern int GetUserName(IntPtr /* oauth2_request_h */ handle, out string userName); - - [DllImport(Libraries.OAuth2, EntryPoint = "oauth2_request_get_password")] - internal static extern int GetPassword(IntPtr /* oauth2_request_h */ handle, out string password); - - [DllImport(Libraries.OAuth2, EntryPoint = "oauth2_request_get_custom_data")] - internal static extern int GetCustomData(IntPtr /* oauth2_request_h */ handle, string customKey, out string customValue); - } -} diff --git a/src/Tizen.Account.OAuth2/Interop/Interop.Response.cs b/src/Tizen.Account.OAuth2/Interop/Interop.Response.cs deleted file mode 100644 index 613141457..000000000 --- a/src/Tizen.Account.OAuth2/Interop/Interop.Response.cs +++ /dev/null @@ -1,62 +0,0 @@ -/* - * 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; - -/// -/// Contains Interop declarations of OAuth2 classes. -/// -internal static partial class Interop -{ - /// - /// Wrapper class for OAuth2 native API. - /// - internal static partial class Response - { - [DllImport(Libraries.OAuth2, EntryPoint = "oauth2_response_destroy")] - internal static extern int Destroy(IntPtr /* oauth2_response_h */ handle); - - [DllImport(Libraries.OAuth2, EntryPoint = "oauth2_response_get_authorization_code")] - internal static extern int GetAuthorizationCode(IntPtr /* oauth2_response_h */ handle, out IntPtr code); - - [DllImport(Libraries.OAuth2, EntryPoint = "oauth2_response_get_state")] - internal static extern int GetState(IntPtr /* oauth2_response_h */ handle, out IntPtr state); - - [DllImport(Libraries.OAuth2, EntryPoint = "oauth2_response_get_access_token")] - internal static extern int GetAccessToken(IntPtr /* oauth2_response_h */ handle, out IntPtr accessToken); - - [DllImport(Libraries.OAuth2, EntryPoint = "oauth2_response_get_token_type")] - internal static extern int GetTokenType(IntPtr /* oauth2_response_h */ handle, out IntPtr tokenType); - - [DllImport(Libraries.OAuth2, EntryPoint = "oauth2_response_get_expires_in")] - internal static extern int GetExpiresIn(IntPtr /* oauth2_response_h */ handle, out long expiresIn); - - [DllImport(Libraries.OAuth2, EntryPoint = "oauth2_response_get_refresh_token")] - internal static extern int GetRefreshToken(IntPtr /* oauth2_response_h */ handle, out IntPtr refreshToken); - - [DllImport(Libraries.OAuth2, EntryPoint = "oauth2_response_get_scope")] - internal static extern int GetScope(IntPtr /* oauth2_response_h */ handle, out IntPtr scope); - - [DllImport(Libraries.OAuth2, EntryPoint = "oauth2_response_get_error")] - internal static extern int GetError(IntPtr /* oauth2_response_h */ handle, out IntPtr /* oauth2_error_h */ error); - - [DllImport(Libraries.OAuth2, EntryPoint = "oauth2_response_get_custom_data")] - internal static extern int GetCustomData(IntPtr /* oauth2_response_h */ handle, string customKey, out IntPtr customValue); - - - } -} diff --git a/src/Tizen.Account.OAuth2/Interop/Interop.Types.cs b/src/Tizen.Account.OAuth2/Interop/Interop.Types.cs deleted file mode 100644 index 27bf2cb90..000000000 --- a/src/Tizen.Account.OAuth2/Interop/Interop.Types.cs +++ /dev/null @@ -1,38 +0,0 @@ -/* - * 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; - -/// -/// Contains Interop declarations of OAuth2 classes. -/// -internal static partial class Interop -{ - internal enum GrantType - { - AuthCode, // OAUTH2_GRANT_TYPE_AUTH_CODE - Password, // OAUTH2_GRANT_TYPE_PASSWORD - ClientCredentials, // OAUTH2_GRANT_TYPE_CLIENT_CREDENTIALS - Refresh, // OAUTH2_GRANT_TYPE_REFRESH - } - - internal enum ResponseType - { - Code, // OAUTH2_RESPONSE_TYPE_CODE - Token, // OAUTH2_RESPONSE_TYPE_TOKEN - } -} diff --git a/src/Tizen.Account.OAuth2/Tizen.Account.OAuth2.csproj b/src/Tizen.Account.OAuth2/Tizen.Account.OAuth2.csproj deleted file mode 100644 index 7f4584ffe..000000000 --- a/src/Tizen.Account.OAuth2/Tizen.Account.OAuth2.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - netstandard2.0 - - - - - - - - diff --git a/src/Tizen.Account.OAuth2/Tizen.Account.OAuth2.sln b/src/Tizen.Account.OAuth2/Tizen.Account.OAuth2.sln deleted file mode 100755 index f6466f37d..000000000 --- a/src/Tizen.Account.OAuth2/Tizen.Account.OAuth2.sln +++ /dev/null @@ -1,34 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26430.12 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Account.OAuth2", "Tizen.Account.OAuth2.csproj", "{1D4A1B0D-AAF5-44A3-8F51-82AD8FD02E9C}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen", "..\Tizen\Tizen.csproj", "{F01EC0FE-2430-4E29-8E32-7F382B203A40}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Log", "..\Tizen.Log\Tizen.Log.csproj", "{CB517D83-FC5A-4797-A36B-AB40B2CA9A13}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {1D4A1B0D-AAF5-44A3-8F51-82AD8FD02E9C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1D4A1B0D-AAF5-44A3-8F51-82AD8FD02E9C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1D4A1B0D-AAF5-44A3-8F51-82AD8FD02E9C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {1D4A1B0D-AAF5-44A3-8F51-82AD8FD02E9C}.Release|Any CPU.Build.0 = Release|Any CPU - {F01EC0FE-2430-4E29-8E32-7F382B203A40}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F01EC0FE-2430-4E29-8E32-7F382B203A40}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F01EC0FE-2430-4E29-8E32-7F382B203A40}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F01EC0FE-2430-4E29-8E32-7F382B203A40}.Release|Any CPU.Build.0 = Release|Any CPU - {CB517D83-FC5A-4797-A36B-AB40B2CA9A13}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {CB517D83-FC5A-4797-A36B-AB40B2CA9A13}.Debug|Any CPU.Build.0 = Debug|Any CPU - {CB517D83-FC5A-4797-A36B-AB40B2CA9A13}.Release|Any CPU.ActiveCfg = Release|Any CPU - {CB517D83-FC5A-4797-A36B-AB40B2CA9A13}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/src/Tizen.Account.OAuth2/Tizen.Account.OAuth2/AccessToken.cs b/src/Tizen.Account.OAuth2/Tizen.Account.OAuth2/AccessToken.cs deleted file mode 100755 index 4d185a048..000000000 --- a/src/Tizen.Account.OAuth2/Tizen.Account.OAuth2/AccessToken.cs +++ /dev/null @@ -1,55 +0,0 @@ -/* - * 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.Collections.Generic; - -namespace Tizen.Account.OAuth2 -{ - /// - /// Class containing access token and related information. - /// - /// 3 - public class AccessToken - { - internal AccessToken() - { - } - - /// - /// The lifetime in seconds of the access token. - /// - /// 3 - public long ExpiresIn { get; internal set;} - - /// - /// The access token issued by the authorization server. - /// - /// 3 - public string Token { get; internal set;} - - /// - /// The scope of the access token. - /// - /// 3 - public IEnumerable Scope { get; internal set;} - - /// - /// The type of the access token. - /// - /// 3 - public string TokenType { get; internal set;} - } -} diff --git a/src/Tizen.Account.OAuth2/Tizen.Account.OAuth2/AuthenticationScheme.cs b/src/Tizen.Account.OAuth2/Tizen.Account.OAuth2/AuthenticationScheme.cs deleted file mode 100755 index 6f385e7a7..000000000 --- a/src/Tizen.Account.OAuth2/Tizen.Account.OAuth2/AuthenticationScheme.cs +++ /dev/null @@ -1,45 +0,0 @@ -/* - * 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. - */ - -namespace Tizen.Account.OAuth2 -{ - /// - /// Enumerations for Client authentication scheme, used to sign client id and client secret accordingly. - /// Default is Basic (http://tools.ietf.org/html/rfc2617#section-2) - /// - /// 3 - /// Facebook and Google does not support HTTP Basic Authentication, instead they require client credentials to be sent via request body. - public enum AuthenticationScheme - { - /// - /// HTTP Basic Authentication for client authentication - /// - /// 3 - Basic = 0, - - /// - /// HTTP Basic Authentication for client authentication - /// - /// 3 - Digest, - - /// - /// Client credentials are sent via request body - /// - /// 3 - RequestBody - } -} diff --git a/src/Tizen.Account.OAuth2/Tizen.Account.OAuth2/AuthorizationRequest.cs b/src/Tizen.Account.OAuth2/Tizen.Account.OAuth2/AuthorizationRequest.cs deleted file mode 100755 index e6a4a4dee..000000000 --- a/src/Tizen.Account.OAuth2/Tizen.Account.OAuth2/AuthorizationRequest.cs +++ /dev/null @@ -1,76 +0,0 @@ -/* - * 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.Collections.Generic; - -namespace Tizen.Account.OAuth2 -{ - /// - /// The request parameters to be sent to authorization end point. - /// - /// 3 - public abstract class AuthorizationRequest - { - /// - /// The desired response type from the OAuth authorization end point. - /// - /// 3 - public abstract string ResponseType { get; } - - /// - /// Client secret credentials. - /// - /// 3 - public ClientCredentials ClientSecrets { get; set; } - - /// - /// The scope of the access. - /// - /// 3 - public IEnumerable Scopes { get; set; } - - /// - /// The authorization end point URL. - /// - /// 3 - public Uri AuthorizationEndpoint { get; set; } - - /// - /// The redirection endpoint of the auhorization flow. - /// - /// 3 - public Uri RedirectionEndPoint { get; set; } - - /// - /// The access token end point URL. - /// - /// 3 - public Uri TokenEndpoint { get; set; } - - /// - /// The client's state which is maintained between request and response. - /// - /// 3 - public string State { get; set; } - - /// - /// Custom key-value parameters to be sent to the server - /// - /// 3 - public IEnumerable> CustomData { get; set; } - } -} diff --git a/src/Tizen.Account.OAuth2/Tizen.Account.OAuth2/AuthorizationResponse.cs b/src/Tizen.Account.OAuth2/Tizen.Account.OAuth2/AuthorizationResponse.cs deleted file mode 100755 index c12422ae5..000000000 --- a/src/Tizen.Account.OAuth2/Tizen.Account.OAuth2/AuthorizationResponse.cs +++ /dev/null @@ -1,108 +0,0 @@ -/* - * 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; - -namespace Tizen.Account.OAuth2 -{ - /// - /// The response containing authroization code from the authorization server. - /// - /// 3 - public class AuthorizationResponse : IDisposable - { - private bool _disposed = false; - private IntPtr _responseHandle; - - internal AuthorizationResponse(IntPtr handle) - { - _responseHandle = handle; - } - - /// - /// Destructor of the AuthorizationResponse class. - /// - /// 3 - ~AuthorizationResponse() - { - Dispose(false); - } - - /// - /// The authroization code. - /// - /// 3 - public string Code { get; internal set; } - - /// - /// The state parameter present in authorization request. - /// - /// 3 - /// - /// The value can be null depending on the server specifications. - /// - public string State { get; internal set; } - - /// - /// Custom key-value parameter received from service provider - /// - /// 3 - /// - /// The return value can be null depending on the server specifications. - /// - public string GetCustomValue(string key) - { - IntPtr value = IntPtr.Zero; - int ret = Interop.Response.GetCustomData(_responseHandle, key, out value); - if (ret != (int)OAuth2Error.None) - { - Log.Error(ErrorFactory.LogTag, "Interop failed"); - throw ErrorFactory.GetException(ret); - } - return Marshal.PtrToStringAnsi(value); - } - - /// - /// Releases any unmanaged resources used by this object. - /// - /// 3 - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - - /// - /// Releases any unmanaged resources used by this object. Can also dispose any other disposable objects. - /// - /// 3 - /// If true, disposes any disposable objects. If false, does not dispose disposable objects. - protected virtual void Dispose(bool disposing) - { - if (_disposed) - return; - - if (disposing) - { - // Free managed objects - } - - Interop.Response.Destroy(_responseHandle); - _disposed = true; - } - } -} diff --git a/src/Tizen.Account.OAuth2/Tizen.Account.OAuth2/Authorizer.cs b/src/Tizen.Account.OAuth2/Tizen.Account.OAuth2/Authorizer.cs deleted file mode 100755 index bf0496cf7..000000000 --- a/src/Tizen.Account.OAuth2/Tizen.Account.OAuth2/Authorizer.cs +++ /dev/null @@ -1,490 +0,0 @@ -/* - * 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.Collections.Generic; -using System.Runtime.InteropServices; -using System.Threading.Tasks; - -namespace Tizen.Account.OAuth2 -{ - /// - /// An abstract class to represent various OAuth 2.0 authorization code flows. - /// Refer to http://tools.ietf.org/html/rfc6749 about OAuth 2.0 protocols. - /// Also service provider document needs to be referred for using end points and additional parameters. - /// - /// 3 - public abstract class Authorizer : IDisposable - { - - internal IntPtr _managerHandle; - private bool _disposed = false; - - /// - /// Constructor for Authoirzer instances - /// - /// 3 - public Authorizer() - { - int ret = Interop.Manager.Create(out _managerHandle); - if (ret != (int)OAuth2Error.None) - { - Log.Error(ErrorFactory.LogTag, "Interop failed"); - throw ErrorFactory.GetException(ret); - } - } - - /// - /// Destructor of the Authorizer class. - /// - /// 3 - ~Authorizer() - { - Dispose(false); - } - - /// - /// Indicates if the current instance is already handling an authorization request - /// - /// 3 - public bool IsRequestInProgress - { - get - { - return Interop.Manager.IsRequestInProgress(_managerHandle); - } - } - - /// - /// Authorizes the client with access toekn / authorizaion code in Implicit and Authorization Code grant flows respectively. - /// - /// 3 - /// - /// - /// An authorization request - /// The authorization response from server - public virtual Task AuthorizeAsync(AuthorizationRequest request) - { - throw new NotImplementedException(); - } - - /// - /// Gets the access token in OAuth2 supported grant flows except Implicit Grant flow. - /// - /// 3 - /// - /// - /// A token request - /// The response from server - public virtual Task GetAccessTokenAsync(TokenRequest request) - { - throw new NotImplementedException(); - } - - /// - /// Releases any unmanaged resources used by this object. - /// - /// 3 - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - - /// - /// Retrieves access token using a refresh token. - /// - /// 3 - /// Request containing refresh token - /// The response containing access token. - /// http://tizen.org/privilege/internet - /// Thrown when method failed due to invalid argumets - /// Thrown when method fails due to server error - public virtual async Task RefreshAccessTokenAsync(RefreshTokenRequest request) - { - IntPtr requestHandle = GetRequestHandle(request); - return await Task.Run(() => GetRefreshToken(requestHandle)); - } - - private TokenResponse GetRefreshToken(IntPtr requestHandle) - { - int ret = (int)OAuth2Error.None; - IntPtr error = IntPtr.Zero; - TokenResponse response = null; - Interop.Manager.Oauth2RefreshTokenCallback accessTokenCb = (IntPtr responseHandle, IntPtr usrData) => - { - Interop.Response.GetError(responseHandle, out error); - if (error != IntPtr.Zero) - { - Log.Error(ErrorFactory.LogTag, "Error occured"); - } - else - { - IntPtr accessToken; - ret = Interop.Response.GetAccessToken(responseHandle, out accessToken); - if (ret != (int)OAuth2Error.None) - { - Log.Error(ErrorFactory.LogTag, "Interop failed"); - throw ErrorFactory.GetException(ret); - } - - IntPtr tokenType; - ret = Interop.Response.GetTokenType(responseHandle, out tokenType); - if (ret != (int)OAuth2Error.None) - { - Log.Error(ErrorFactory.LogTag, "Failed to get token type"); - } - - long expiresIn; - ret = Interop.Response.GetExpiresIn(responseHandle, out expiresIn); - if (ret != (int)OAuth2Error.None) - { - Log.Error(ErrorFactory.LogTag, "Failed to get expires in"); - } - - IntPtr refreshToken; - ret = Interop.Response.GetRefreshToken(responseHandle, out refreshToken); - if (ret != (int)OAuth2Error.None) - { - Log.Error(ErrorFactory.LogTag, "Interop failed"); - throw ErrorFactory.GetException(ret); - } - - IntPtr scope; - ret = Interop.Response.GetScope(responseHandle, out scope); - if (ret != (int)OAuth2Error.None) - { - Log.Error(ErrorFactory.LogTag, "Failed to get scope"); - } - - IEnumerable scopes = (scope == IntPtr.Zero) ? null : Marshal.PtrToStringAnsi(scope)?.Split(' '); - - var token = new AccessToken(); - token.Token = (accessToken == IntPtr.Zero) ? null : Marshal.PtrToStringAnsi(accessToken); - token.TokenType = (tokenType == IntPtr.Zero) ? null : Marshal.PtrToStringAnsi(tokenType); - token.Scope = scopes; - token.ExpiresIn = expiresIn; - - response = new TokenResponse(responseHandle); - response.AccessToken = token; - response.RefreshToken = (refreshToken == IntPtr.Zero) ? null : new RefreshToken() { Token = Marshal.PtrToStringAnsi(refreshToken) }; - } - }; - - ret = Interop.Manager.RefreshAccessToken(_managerHandle, requestHandle, accessTokenCb, IntPtr.Zero); - Interop.Request.Destroy(requestHandle); - if (ret != (int)OAuth2Error.None || error != IntPtr.Zero) - { - if (error != IntPtr.Zero) - { - throw ErrorFactory.GetException(error); - } - else - { - Log.Error(ErrorFactory.LogTag, "Interop failed"); - throw ErrorFactory.GetException(ret); - } - } - - return response; - } - - /// - /// Releases any unmanaged resources used by this object. Can also dispose any other disposable objects. - /// - /// 3 - /// If true, disposes any disposable objects. If false, does not dispose disposable objects. - protected virtual void Dispose(bool disposing) - { - if (_disposed) - return; - - if (disposing) - { - // Free managed objects - } - - Interop.Manager.Destroy(_managerHandle); - _disposed = true; - } - - // Fill device request handle for refreshing access token - internal IntPtr GetRequestHandle(RefreshTokenRequest request) - { - IntPtr requestHandle; - int ret = Interop.Request.Create(out requestHandle); - if (ret != (int)OAuth2Error.None) - { - Log.Error(ErrorFactory.LogTag, "Interop failed"); - throw ErrorFactory.GetException(ret); - } - - ret = Interop.Request.SetRefreshTokenUrl(requestHandle, request.TokenEndpoint.ToString()); - if (ret != (int)OAuth2Error.None) - { - Log.Error(ErrorFactory.LogTag, "Interop failed"); - throw ErrorFactory.GetException(ret); - } - - ret = Interop.Request.SetGrantType(requestHandle, Interop.GrantType.Refresh); - if (ret != (int)OAuth2Error.None) - { - Log.Error(ErrorFactory.LogTag, "Interop failed"); - throw ErrorFactory.GetException(ret); - } - - ret = Interop.Request.SetRefreshToken(requestHandle, request.RefreshToken); - if (ret != (int)OAuth2Error.None) - { - Log.Error(ErrorFactory.LogTag, "Interop failed"); - throw ErrorFactory.GetException(ret); - } - - if (request.ClientSecrets.Id != null) - { - ret = Interop.Request.SetClientId(requestHandle, request.ClientSecrets.Id); - if (ret != (int)OAuth2Error.None) - { - Log.Error(ErrorFactory.LogTag, "Interop failed"); - throw ErrorFactory.GetException(ret); - } - } - - if (request.ClientSecrets.Secret != null) - { - ret = Interop.Request.SetClientSecret(requestHandle, request.ClientSecrets.Secret); - if (ret != (int)OAuth2Error.None) - { - Log.Error(ErrorFactory.LogTag, "Interop failed"); - throw ErrorFactory.GetException(ret); - } - } - - if (request.Scopes != null) - { - string scope = string.Join(" ", request.Scopes); - ret = Interop.Request.SetScope(requestHandle, scope); - if (ret != (int)OAuth2Error.None) - { - Log.Error(ErrorFactory.LogTag, "Interop failed"); - throw ErrorFactory.GetException(ret); - } - } - - ret = Interop.Request.SetClientAuthenticationType(requestHandle, (int)request.AuthenticationScheme); - if (ret != (int)OAuth2Error.None) - { - Log.Error(ErrorFactory.LogTag, "Interop failed"); - throw ErrorFactory.GetException(ret); - } - - return requestHandle; - } - - internal TokenResponse GetAccessToken(IntPtr requestHandle) - { - int ret = (int)OAuth2Error.None; - IntPtr error = IntPtr.Zero; - TokenResponse response = null; - Interop.Manager.Oauth2TokenCallback accessTokenCb = (IntPtr responseHandle, IntPtr usrData) => - { - if (responseHandle == IntPtr.Zero) - { - Log.Error(ErrorFactory.LogTag, "Error occured"); - throw (new ArgumentNullException()); - } - - Interop.Response.GetError(responseHandle, out error); - if (error != IntPtr.Zero) - { - Log.Error(ErrorFactory.LogTag, "Server Error occured"); - } - else - { - IntPtr accessToken = IntPtr.Zero; - ret = Interop.Response.GetAccessToken(responseHandle, out accessToken); - if (ret != (int)OAuth2Error.None) - { - Log.Error(ErrorFactory.LogTag, "Failed to get access token"); - throw ErrorFactory.GetException(ret); - } - - IntPtr tokenType; - ret = Interop.Response.GetTokenType(responseHandle, out tokenType); - if (ret != (int)OAuth2Error.None) - { - Log.Debug(ErrorFactory.LogTag, "TokenType can't be found"); - } - - long expiresIn = -1; - ret = Interop.Response.GetExpiresIn(responseHandle, out expiresIn); - if (ret != (int)OAuth2Error.None) - { - Log.Debug(ErrorFactory.LogTag, "ExpiresIn can't be found"); - } - - IntPtr refreshToken; - ret = Interop.Response.GetRefreshToken(responseHandle, out refreshToken); - if (ret != (int)OAuth2Error.None) - { - Log.Debug(ErrorFactory.LogTag, "Refresh Token can't be found"); - } - - IntPtr scope; - ret = Interop.Response.GetScope(responseHandle, out scope); - if (ret != (int)OAuth2Error.None) - { - Log.Debug(ErrorFactory.LogTag, "Scope can't be found"); - } - - IntPtr state; - ret = Interop.Response.GetState(responseHandle, out state); - if (ret != (int)OAuth2Error.None) - { - Log.Debug(ErrorFactory.LogTag, "State can't be found"); - } - - IEnumerable scopes = (scope == IntPtr.Zero) ? null : Marshal.PtrToStringAnsi(scope)?.Split(' '); - - var token = new AccessToken(); - token.Token = (accessToken == IntPtr.Zero)? null : Marshal.PtrToStringAnsi(accessToken); - token.TokenType = (tokenType == IntPtr.Zero) ? null : Marshal.PtrToStringAnsi(tokenType); - token.Scope = scopes; - token.ExpiresIn = expiresIn; - - response = new TokenResponse(responseHandle); - response.AccessToken = token; - response.State = (state == IntPtr.Zero) ? null : Marshal.PtrToStringAnsi(state); - response.RefreshToken = (refreshToken == IntPtr.Zero) ? null : new RefreshToken() { Token = Marshal.PtrToStringAnsi(refreshToken) }; - } - }; - - ret = Interop.Manager.RequestToken(_managerHandle, requestHandle, accessTokenCb, IntPtr.Zero); - Interop.Request.Destroy(requestHandle); - if (ret != (int)OAuth2Error.None || error != IntPtr.Zero) - { - if (error != IntPtr.Zero) - { - throw ErrorFactory.GetException(error); - } - else - { - Log.Error(ErrorFactory.LogTag, "Interop failed"); - throw ErrorFactory.GetException(ret); - } - } - - return response; - } - - internal TokenResponse GetAccessTokenByCode(IntPtr requestHandle) - { - int ret = (int)OAuth2Error.None; - IntPtr error = IntPtr.Zero; - TokenResponse response = null; - Interop.Manager.Oauth2AccessTokenCallback accessTokenCb = (IntPtr responseHandle, IntPtr usrData) => - { - if (responseHandle == IntPtr.Zero) - { - Log.Error(ErrorFactory.LogTag, "Error occured"); - throw (new ArgumentNullException()); - } - - Interop.Response.GetError(responseHandle, out error); - if (error != IntPtr.Zero) - { - Log.Error(ErrorFactory.LogTag, "Server Error occured"); - } - else - { - IntPtr accessToken = IntPtr.Zero; - ret = Interop.Response.GetAccessToken(responseHandle, out accessToken); - if (ret != (int)OAuth2Error.None) - { - Log.Error(ErrorFactory.LogTag, "Failed to get access token"); - throw ErrorFactory.GetException(ret); - } - - IntPtr tokenType; - ret = Interop.Response.GetTokenType(responseHandle, out tokenType); - if (ret != (int)OAuth2Error.None) - { - Log.Debug(ErrorFactory.LogTag, "TokenType can't be found"); - } - - long expiresIn = -1; - ret = Interop.Response.GetExpiresIn(responseHandle, out expiresIn); - if (ret != (int)OAuth2Error.None) - { - Log.Debug(ErrorFactory.LogTag, "ExpiresIn can't be found"); - } - - IntPtr refreshToken; - ret = Interop.Response.GetRefreshToken(responseHandle, out refreshToken); - if (ret != (int)OAuth2Error.None) - { - Log.Debug(ErrorFactory.LogTag, "Refresh Token can't be found"); - } - - IntPtr scope; - ret = Interop.Response.GetScope(responseHandle, out scope); - if (ret != (int)OAuth2Error.None) - { - Log.Debug(ErrorFactory.LogTag, "Scope can't be found"); - } - - IntPtr state; - ret = Interop.Response.GetState(responseHandle, out state); - if (ret != (int)OAuth2Error.None) - { - Log.Debug(ErrorFactory.LogTag, "State can't be found"); - } - - IEnumerable scopes = (scope == IntPtr.Zero) ? null : Marshal.PtrToStringAnsi(scope)?.Split(' '); - - var token = new AccessToken(); - token.Token = (accessToken == IntPtr.Zero) ? null : Marshal.PtrToStringAnsi(accessToken); - token.TokenType = (tokenType == IntPtr.Zero) ? null : Marshal.PtrToStringAnsi(tokenType); - token.Scope = scopes; - token.ExpiresIn = expiresIn; - - response = new TokenResponse(responseHandle); - response.AccessToken = token; - response.State = (state == IntPtr.Zero) ? null : Marshal.PtrToStringAnsi(state); - response.RefreshToken = (refreshToken == IntPtr.Zero) ? null : new RefreshToken() { Token = Marshal.PtrToStringAnsi(refreshToken) }; - } - }; - - ret = Interop.Manager.RequestAccessToken(_managerHandle, requestHandle, accessTokenCb, IntPtr.Zero); - Interop.Request.Destroy(requestHandle); - if (ret != (int)OAuth2Error.None || error != IntPtr.Zero) - { - if (error != IntPtr.Zero) - { - throw ErrorFactory.GetException(error); - } - else - { - Log.Error(ErrorFactory.LogTag, "Interop failed : " + ret); - throw ErrorFactory.GetException(ret); - } - } - - return response; - } - } -} - diff --git a/src/Tizen.Account.OAuth2/Tizen.Account.OAuth2/ClientCredentials.cs b/src/Tizen.Account.OAuth2/Tizen.Account.OAuth2/ClientCredentials.cs deleted file mode 100755 index 3b6f58b0e..000000000 --- a/src/Tizen.Account.OAuth2/Tizen.Account.OAuth2/ClientCredentials.cs +++ /dev/null @@ -1,49 +0,0 @@ -/* - * 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.Account.OAuth2 -{ - /// - /// Contains client credentials required for authentication in request-body - /// - /// 3 - public class ClientCredentials - { - /// - /// The constructor - /// - /// 3 - public ClientCredentials() - { - - } - - /// - /// The client identifier - /// - /// 3 - public string Id { get; set; } - - /// - /// The client secret - /// - /// 3 - public string Secret { get; set; } - } -} - diff --git a/src/Tizen.Account.OAuth2/Tizen.Account.OAuth2/ClientCredentialsAuthorizer.cs b/src/Tizen.Account.OAuth2/Tizen.Account.OAuth2/ClientCredentialsAuthorizer.cs deleted file mode 100755 index b9d8f1c57..000000000 --- a/src/Tizen.Account.OAuth2/Tizen.Account.OAuth2/ClientCredentialsAuthorizer.cs +++ /dev/null @@ -1,168 +0,0 @@ -/* - * 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.Threading.Tasks; -using System.Collections.Generic; - -namespace Tizen.Account.OAuth2 -{ - /// - /// The ClientCredentialsAuthorizer is used to obtain access tokens using Client Credentials Grant flow as described at https://tools.ietf.org/html/rfc6749#section-4.4 - /// - /// 3 - public class ClientCredentialsAuthorizer : Authorizer - { - /// - /// The constructor - /// - /// 3 - public ClientCredentialsAuthorizer() - { - - } - - /// - /// Authorization not supported through this API for this flow. - /// - /// 3 - /// Thrown when the operation is not supported - public override Task AuthorizeAsync(AuthorizationRequest request) - { - Log.Error(ErrorFactory.LogTag, "Authorization is not supported in this flow"); - throw new InvalidOperationException(); - } - - /// - /// Refreshing access token is not supported in this flow. - /// - /// 3 - /// Thrown when the operation is not supported - public override Task RefreshAccessTokenAsync(RefreshTokenRequest request) - { - Log.Error(ErrorFactory.LogTag, "Refreshing access token is not supported in this flow"); - throw new InvalidOperationException(); - } - - /// - /// Retrieves access token using client credentials. - /// The authroization request parameters should be as defined in https://tools.ietf.org/html/rfc6749#section-4.4.2 - /// - /// 3 - /// The token request - /// The response containing access token. - /// http://tizen.org/privilege/internet - /// Thrown when method failed due to invalid argumets - /// Thrown when method fails due to server error - public override async Task GetAccessTokenAsync(TokenRequest request) - { - IntPtr requestHandle = GetRequestHandle(request as ClientCredentialsTokenRequest); - return await Task.Run(() => GetAccessToken(requestHandle)); - } - - // Fill device request handle for access token - private IntPtr GetRequestHandle(ClientCredentialsTokenRequest request) - { - if (request == null) - { - Log.Error(ErrorFactory.LogTag, "Invalid request or request is null"); - throw ErrorFactory.GetException((int)OAuth2Error.InvalidParameter); - } - - IntPtr requestHandle; - int ret = Interop.Request.Create(out requestHandle); - if (ret != (int)OAuth2Error.None) - { - Log.Error(ErrorFactory.LogTag, "Interop failed"); - throw ErrorFactory.GetException(ret); - } - - ret = Interop.Request.SetTokenEndPointUrl(requestHandle, request.TokenEndpoint.ToString()); - if (ret != (int)OAuth2Error.None) - { - Log.Error(ErrorFactory.LogTag, "Interop failed"); - throw ErrorFactory.GetException(ret); - } - - ret = Interop.Request.SetRedirectionUrl(requestHandle, request.RedirectionEndPoint.ToString()); - if (ret != (int)OAuth2Error.None) - { - Log.Error(ErrorFactory.LogTag, "Interop failed"); - throw ErrorFactory.GetException(ret); - } - - ret = Interop.Request.SetGrantType(requestHandle, Interop.GrantType.ClientCredentials); - if (ret != (int)OAuth2Error.None) - { - Log.Error(ErrorFactory.LogTag, "Interop failed"); - throw ErrorFactory.GetException(ret); - } - - if (request.ClientSecrets.Id != null) - { - ret = Interop.Request.SetClientId(requestHandle, request.ClientSecrets.Id); - if (ret != (int)OAuth2Error.None) - { - Log.Error(ErrorFactory.LogTag, "Interop failed"); - throw ErrorFactory.GetException(ret); - } - } - - if (request.ClientSecrets.Secret != null) - { - ret = Interop.Request.SetClientSecret(requestHandle, request.ClientSecrets.Secret); - if (ret != (int)OAuth2Error.None) - { - Log.Error(ErrorFactory.LogTag, "Interop failed"); - throw ErrorFactory.GetException(ret); - } - } - - if (request.Scopes != null) - { - string scope = string.Join(" ", request.Scopes); - ret = Interop.Request.SetScope(requestHandle, scope); - if (ret != (int)OAuth2Error.None) - { - Log.Error(ErrorFactory.LogTag, "Interop failed"); - throw ErrorFactory.GetException(ret); - } - } - - if (request.CustomData != null) - { - foreach (var item in request.CustomData) - { - ret = Interop.Request.AddCustomData(requestHandle, item.Key, item.Value); - if (ret != (int)OAuth2Error.None) - { - Log.Error(ErrorFactory.LogTag, "Interop failed"); - throw ErrorFactory.GetException(ret); - } - } - } - - ret = Interop.Request.SetClientAuthenticationType(requestHandle, (int) request.AuthenticationScheme); - if (ret != (int)OAuth2Error.None) - { - Log.Error(ErrorFactory.LogTag, "Interop failed"); - throw ErrorFactory.GetException(ret); - } - - return requestHandle; - } - } -} diff --git a/src/Tizen.Account.OAuth2/Tizen.Account.OAuth2/ClientCredentialsTokenRequest.cs b/src/Tizen.Account.OAuth2/Tizen.Account.OAuth2/ClientCredentialsTokenRequest.cs deleted file mode 100755 index a57225fc7..000000000 --- a/src/Tizen.Account.OAuth2/Tizen.Account.OAuth2/ClientCredentialsTokenRequest.cs +++ /dev/null @@ -1,42 +0,0 @@ -/* - * 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.Account.OAuth2 -{ - /// - /// The class contains request parameters for retreiving access token in Client Credentials Grant flow. - /// - /// 3 - public class ClientCredentialsTokenRequest : TokenRequest - { - /// - /// The constructor - /// - /// 3 - public ClientCredentialsTokenRequest() - { - - } - - /// - /// The grant type. - /// - /// 3 - public override string GrantType { get; } = "client_credentials"; - } -} diff --git a/src/Tizen.Account.OAuth2/Tizen.Account.OAuth2/CodeGrantAuthorizationRequest.cs b/src/Tizen.Account.OAuth2/Tizen.Account.OAuth2/CodeGrantAuthorizationRequest.cs deleted file mode 100755 index 385a79865..000000000 --- a/src/Tizen.Account.OAuth2/Tizen.Account.OAuth2/CodeGrantAuthorizationRequest.cs +++ /dev/null @@ -1,40 +0,0 @@ -/* - * 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. - */ - -namespace Tizen.Account.OAuth2 -{ - /// - /// The class contains request parameters for retreiving authorization code in Authorization Code Grant flow. - /// Please refer https://tools.ietf.org/html/rfc6749#section-4.1.1 for more details - /// - public class CodeGrantAuthorizationRequest : AuthorizationRequest - { - /// - /// The constructor - /// - /// 3 - public CodeGrantAuthorizationRequest() - { - - } - - /// - /// The response type parameter to authorization server. - /// - /// 3 - public override string ResponseType { get; } = "code"; - } -} diff --git a/src/Tizen.Account.OAuth2/Tizen.Account.OAuth2/CodeGrantAuthorizer.cs b/src/Tizen.Account.OAuth2/Tizen.Account.OAuth2/CodeGrantAuthorizer.cs deleted file mode 100755 index bb7f1b5bc..000000000 --- a/src/Tizen.Account.OAuth2/Tizen.Account.OAuth2/CodeGrantAuthorizer.cs +++ /dev/null @@ -1,343 +0,0 @@ -/* - * 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.Threading.Tasks; -using System.Runtime.InteropServices; -using System.Collections.Generic; - -namespace Tizen.Account.OAuth2 -{ - /// - /// The CodeGrantAuthorizer is used to obtain access tokens and refresh tokens using Authorization Code Grant flow as described at https://tools.ietf.org/html/rfc6749#section-4.1 - /// - /// 3 - public class CodeGrantAuthorizer : Authorizer - { - /// - /// The constructor - /// - /// 3 - public CodeGrantAuthorizer() - { - - } - - /// - /// Retrieves authorization code asynchronously. The authroization request parameters should be as defined in https://tools.ietf.org/html/rfc6749#section-4.1.1 - /// - /// 3 - /// The authorization request - /// The response containing authorization code. - /// http://tizen.org/privilege/internet - /// Thrown when method failed due to invalid argumets - /// Thrown when method fails due to server error - public override async Task AuthorizeAsync(AuthorizationRequest request) - { - IntPtr requestHandle = GetRequestHandle(request as CodeGrantAuthorizationRequest); - return await Task.Run(() => GetAuthorizationResponse(requestHandle)); - } - - /// - /// Retrieves access token by exchanging authorization code received using . - /// The authroization request parameters should be as defined in https://tools.ietf.org/html/rfc6749#section-4.1.3 - /// - /// 3 - /// The token request - /// The response containing access token. - /// http://tizen.org/privilege/internet - /// Thrown when method failed due to invalid argumets - /// Thrown when method fails due to server error - public override async Task GetAccessTokenAsync(TokenRequest request) - { - IntPtr requestHandle = GetRequestHandle(request as CodeGrantTokenRequest); - return await Task.Run(() => GetAccessTokenByCode(requestHandle) ); - } - - /// - /// Clears the cookies - /// - /// 3 - public void ClearCookies() - { - int ret = (int)OAuth2Error.None; - ret = Interop.Manager.ClearCookies(_managerHandle); - if (ret != (int)OAuth2Error.None) - { - Log.Error(ErrorFactory.LogTag, "Interop failed"); - throw ErrorFactory.GetException(ret); - } - } - - /// - /// Clear the cache - /// - /// 3 - public void ClearCache() - { - int ret = (int)OAuth2Error.None; - ret = Interop.Manager.ClearCache(_managerHandle); - if (ret != (int)OAuth2Error.None) - { - Log.Error(ErrorFactory.LogTag, "Interop failed"); - throw ErrorFactory.GetException(ret); - } - } - - // Fill device request handle for Authorization code grant - private IntPtr GetRequestHandle(CodeGrantAuthorizationRequest request) - { - if (request == null) - { - Log.Error(ErrorFactory.LogTag, "Invalid request or request is null"); - throw ErrorFactory.GetException((int)OAuth2Error.InvalidParameter); - } - - IntPtr requestHandle; - int ret = Interop.Request.Create(out requestHandle); - if (ret != (int)OAuth2Error.None) - { - Log.Error(ErrorFactory.LogTag, "Interop failed"); - throw ErrorFactory.GetException(ret); - } - - ret = Interop.Request.SetAuthEndPointUrl(requestHandle, request.AuthorizationEndpoint.ToString()); - if (ret != (int)OAuth2Error.None) - { - Log.Error(ErrorFactory.LogTag, "Interop failed"); - throw ErrorFactory.GetException(ret); - } - - ret = Interop.Request.SetResponseType(requestHandle, Interop.ResponseType.Code); - if (ret != (int)OAuth2Error.None) - { - Log.Error(ErrorFactory.LogTag, "Interop failed"); - throw ErrorFactory.GetException(ret); - } - - if (request.ClientSecrets.Id != null) - { - ret = Interop.Request.SetClientId(requestHandle, request.ClientSecrets.Id); - if (ret != (int)OAuth2Error.None) - { - Log.Error(ErrorFactory.LogTag, "Interop failed"); - throw ErrorFactory.GetException(ret); - } - } - - if (request.ClientSecrets.Secret != null) - { - ret = Interop.Request.SetClientSecret(requestHandle, request.ClientSecrets.Secret); - if (ret != (int)OAuth2Error.None) - { - Log.Error(ErrorFactory.LogTag, "Interop failed"); - throw ErrorFactory.GetException(ret); - } - } - - if (request.RedirectionEndPoint != null) - { - ret = Interop.Request.SetRedirectionUrl(requestHandle, request.RedirectionEndPoint.OriginalString); - if (ret != (int)OAuth2Error.None) - { - Log.Error(ErrorFactory.LogTag, "Interop failed"); - throw ErrorFactory.GetException(ret); - } - } - - if (request.Scopes != null) - { - string scope = string.Join(" ", request.Scopes); - ret = Interop.Request.SetScope(requestHandle, scope); - if (ret != (int)OAuth2Error.None) - { - Log.Error(ErrorFactory.LogTag, "Interop failed"); - throw ErrorFactory.GetException(ret); - } - } - - if (request.State != null) - { - ret = Interop.Request.SetState(requestHandle, request.State); - if (ret != (int)OAuth2Error.None) - { - Log.Error(ErrorFactory.LogTag, "Interop failed"); - throw ErrorFactory.GetException(ret); - } - } - - if (request.CustomData != null) - { - foreach( var item in request.CustomData) - { - ret = Interop.Request.AddCustomData(requestHandle, item.Key, item.Value); - if (ret != (int)OAuth2Error.None) - { - Log.Error(ErrorFactory.LogTag, "Interop failed"); - throw ErrorFactory.GetException(ret); - } - } - } - - return requestHandle; - } - - // Fill device request handle for access token - private IntPtr GetRequestHandle(CodeGrantTokenRequest request) - { - if (request == null) - { - Log.Error(ErrorFactory.LogTag, "Invalid request or request is null"); - throw ErrorFactory.GetException((int)OAuth2Error.InvalidParameter); - } - - IntPtr requestHandle; - int ret = Interop.Request.Create(out requestHandle); - if (ret != (int)OAuth2Error.None) - { - Log.Error(ErrorFactory.LogTag, "Interop failed"); - throw ErrorFactory.GetException(ret); - } - - ret = Interop.Request.SetGrantType(requestHandle, Interop.GrantType.AuthCode); - if (ret != (int)OAuth2Error.None) - { - Log.Error(ErrorFactory.LogTag, "Interop failed"); - throw ErrorFactory.GetException(ret); - } - - ret = Interop.Request.SetAuthorizationCode(requestHandle, request.Code); - if (ret != (int)OAuth2Error.None) - { - Log.Error(ErrorFactory.LogTag, "Interop failed"); - throw ErrorFactory.GetException(ret); - } - - ret = Interop.Request.SetTokenEndPointUrl(requestHandle, request.TokenEndpoint.ToString()); - if (ret != (int)OAuth2Error.None) - { - Log.Error(ErrorFactory.LogTag, "Interop failed"); - throw ErrorFactory.GetException(ret); - } - - ret = Interop.Request.SetRedirectionUrl(requestHandle, request.RedirectionEndPoint.ToString()); - if (ret != (int)OAuth2Error.None) - { - Log.Error(ErrorFactory.LogTag, "Interop failed"); - throw ErrorFactory.GetException(ret); - } - - ret = Interop.Request.SetClientId(requestHandle, request.ClientSecrets.Id); - if (ret != (int)OAuth2Error.None) - { - Log.Error(ErrorFactory.LogTag, "Interop failed"); - throw ErrorFactory.GetException(ret); - } - - if (request.ClientSecrets.Secret != null) - { - ret = Interop.Request.SetClientSecret(requestHandle, request.ClientSecrets.Secret); - if (ret != (int)OAuth2Error.None) - { - Log.Error(ErrorFactory.LogTag, "Interop failed"); - throw ErrorFactory.GetException(ret); - } - } - - if (request.CustomData != null) - { - foreach (var item in request.CustomData) - { - ret = Interop.Request.AddCustomData(requestHandle, item.Key, item.Value); - if (ret != (int)OAuth2Error.None) - { - Log.Error(ErrorFactory.LogTag, "Interop failed"); - throw ErrorFactory.GetException(ret); - } - } - } - - ret = Interop.Request.SetClientAuthenticationType(requestHandle, (int)request.AuthenticationScheme); - if (ret != (int)OAuth2Error.None) - { - Log.Error(ErrorFactory.LogTag, "Interop failed"); - throw ErrorFactory.GetException(ret); - } - - return requestHandle; - } - - private AuthorizationResponse GetAuthorizationResponse(IntPtr requestHandle) - { - AuthorizationResponse response = null; - int ret = (int)OAuth2Error.None; - IntPtr error = IntPtr.Zero; - - Interop.Manager.Oauth2AuthGrantCallback authGrantCb = (IntPtr responseHandle, IntPtr usrData) => - { - if (responseHandle == IntPtr.Zero) - { - Log.Error(ErrorFactory.LogTag, "Error occured"); - throw (new ArgumentNullException()); - } - - Interop.Response.GetError(responseHandle, out error); - if (error == IntPtr.Zero) - { - Log.Warn(ErrorFactory.LogTag, "Error occured"); - throw ErrorFactory.GetException(error); - } - else - { - IntPtr authorizationCode; - ret = Interop.Response.GetAuthorizationCode(responseHandle, out authorizationCode); - if (ret != (int)OAuth2Error.None) - { - Log.Error(ErrorFactory.LogTag, "Interop failed"); - throw ErrorFactory.GetException(ret); - } - - IntPtr state; - ret = Interop.Response.GetState(responseHandle, out state); - if (ret != (int)OAuth2Error.None) - { - Log.Error(ErrorFactory.LogTag, "Interop failed"); - throw ErrorFactory.GetException(ret); - } - - response = new AuthorizationResponse(responseHandle) { Code = Marshal.PtrToStringAnsi(authorizationCode), State = Marshal.PtrToStringAnsi(state) }; - } - }; - - ret = Interop.Manager.RequestAuthorizationGrant(_managerHandle, requestHandle, authGrantCb, IntPtr.Zero); - Interop.Request.Destroy(requestHandle); - if (ret != (int)OAuth2Error.None || error != IntPtr.Zero) - { - if (error != IntPtr.Zero) - { - throw ErrorFactory.GetException(error); - } - else - { - Log.Error(ErrorFactory.LogTag, "Interop failed"); - throw ErrorFactory.GetException(ret); - } - } - - return response; - } - } -} diff --git a/src/Tizen.Account.OAuth2/Tizen.Account.OAuth2/CodeGrantTokenRequest.cs b/src/Tizen.Account.OAuth2/Tizen.Account.OAuth2/CodeGrantTokenRequest.cs deleted file mode 100755 index 38d21f970..000000000 --- a/src/Tizen.Account.OAuth2/Tizen.Account.OAuth2/CodeGrantTokenRequest.cs +++ /dev/null @@ -1,48 +0,0 @@ -/* - * 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.Account.OAuth2 -{ - /// - /// The class contains request parameters for retreiving access token in Authorization Code Grant flow. - /// - /// 3 - public class CodeGrantTokenRequest : TokenRequest - { - /// - /// The constructor - /// - /// 3 - public CodeGrantTokenRequest() - { - - } - - /// - /// The grant type - /// - /// 3 - public override string GrantType { get; } = "authorization_code"; - - /// - /// The authoriztion code received from the authorization server. - /// - /// 3 - public string Code { get; set; } - } -} diff --git a/src/Tizen.Account.OAuth2/Tizen.Account.OAuth2/ImplicitGrantAuthorizationRequest.cs b/src/Tizen.Account.OAuth2/Tizen.Account.OAuth2/ImplicitGrantAuthorizationRequest.cs deleted file mode 100755 index 5b0c50ac6..000000000 --- a/src/Tizen.Account.OAuth2/Tizen.Account.OAuth2/ImplicitGrantAuthorizationRequest.cs +++ /dev/null @@ -1,39 +0,0 @@ -/* - * 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. - */ - -namespace Tizen.Account.OAuth2 -{ - /// - /// The class contains request parameters for retreiving access token in Implicit Grant flow. - /// - public class ImplicitGrantAuthorizationRequest : AuthorizationRequest - { - /// - /// The constructor - /// - /// 3 - public ImplicitGrantAuthorizationRequest() - { - - } - - /// - /// The response type parameter to aturhoization server. - /// - /// 3 - public override string ResponseType { get; } = "token"; - } -} diff --git a/src/Tizen.Account.OAuth2/Tizen.Account.OAuth2/ImplicitGrantAuthorizer.cs b/src/Tizen.Account.OAuth2/Tizen.Account.OAuth2/ImplicitGrantAuthorizer.cs deleted file mode 100755 index c59dbee50..000000000 --- a/src/Tizen.Account.OAuth2/Tizen.Account.OAuth2/ImplicitGrantAuthorizer.cs +++ /dev/null @@ -1,246 +0,0 @@ -/* - * 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.Collections.Generic; -using System.Runtime.InteropServices; -using System.Threading.Tasks; - -namespace Tizen.Account.OAuth2 -{ - /// - /// The ImplicitGrantAuthorizer is used to obtain access tokens using Implicit Grant flow as described at https://tools.ietf.org/html/rfc6749#section-4.2 - /// - /// 3 - public class ImplicitGrantAuthorizer : Authorizer - { - /// - /// The constructor - /// - /// 3 - public ImplicitGrantAuthorizer() - { - - } - - /// - /// Retrieves access token asynchronously. The authroization request parameters should be as defined in https://tools.ietf.org/html/rfc6749#section-4.2.1 - /// - /// 3 - /// The authorization request - /// The response containing access token. - /// http://tizen.org/privilege/internet - /// Thrown when method failed due to invalid argumets - /// Thrown when method fails due to server error - public new virtual async Task AuthorizeAsync(AuthorizationRequest request) - { - IntPtr requestHandle = GetRequestHandle(request as ImplicitGrantAuthorizationRequest); - return await Task.Run(() => GetAuthorizationResponse(requestHandle)); - } - - /// - /// Access token can be retreived implicitly using in this flow. - /// - /// 3 - /// Thrown when the operation is not supported - public override Task GetAccessTokenAsync(TokenRequest request) - { - Log.Error(ErrorFactory.LogTag, "Obtain token directly from authorization grant "); - throw new InvalidOperationException(); - } - - /// - /// Refreshing access token is not supported in this flow. - /// - /// 3 - /// Thrown when the operation is not supported - public override Task RefreshAccessTokenAsync(RefreshTokenRequest request) - { - Log.Error(ErrorFactory.LogTag, "Refesh token is not supported in Implicit Grant flow"); - throw new InvalidOperationException(); - } - - private TokenResponse GetAuthorizationResponse(IntPtr requestHandle) - { - IntPtr error = IntPtr.Zero; - TokenResponse response = null; - int ret = (int)OAuth2Error.None; - Interop.Manager.Oauth2AuthGrantCallback authGrantCb = (IntPtr responseHandle, IntPtr usrData) => - { - if (responseHandle == IntPtr.Zero) - { - Log.Error(ErrorFactory.LogTag, "Error occured"); - throw (new ArgumentNullException()); - } - - Interop.Response.GetError(responseHandle, out error); - if (error != IntPtr.Zero) - { - Log.Error(ErrorFactory.LogTag, "Server Error occured"); - } - else - { - IntPtr accessToken; - ret = Interop.Response.GetAccessToken(responseHandle, out accessToken); - if (ret != (int)OAuth2Error.None) - { - Log.Error(ErrorFactory.LogTag, "Interop failed"); - throw ErrorFactory.GetException(ret); - } - - IntPtr tokenType; - ret = Interop.Response.GetTokenType(responseHandle, out tokenType); - if (ret != (int)OAuth2Error.None) - { - Log.Error(ErrorFactory.LogTag, "Interop failed"); - throw ErrorFactory.GetException(ret); - } - - long expiresIn; - ret = Interop.Response.GetExpiresIn(responseHandle, out expiresIn); - if (ret != (int)OAuth2Error.None) - { - Log.Error(ErrorFactory.LogTag, "Interop failed"); - throw ErrorFactory.GetException(ret); - } - - IntPtr scope; - ret = Interop.Response.GetScope(responseHandle, out scope); - if (ret != (int)OAuth2Error.None) - { - Log.Error(ErrorFactory.LogTag, "Interop failed"); - throw ErrorFactory.GetException(ret); - } - - IntPtr state; - ret = Interop.Response.GetState(responseHandle, out state); - if (ret != (int)OAuth2Error.None) - { - Log.Error(ErrorFactory.LogTag, "Interop failed"); - throw ErrorFactory.GetException(ret); - } - - IEnumerable scopes = (scope == IntPtr.Zero) ? null : Marshal.PtrToStringAnsi(scope)?.Split(' '); - - var token = new AccessToken() { Token = Marshal.PtrToStringAnsi(accessToken), ExpiresIn = expiresIn, Scope = scopes, TokenType = Marshal.PtrToStringAnsi(tokenType) }; - response = new TokenResponse(responseHandle) { AccessToken = token, State = Marshal.PtrToStringAnsi(state), RefreshToken = null }; - } - }; - - ret = Interop.Manager.RequestAuthorizationGrant(_managerHandle, requestHandle, authGrantCb, IntPtr.Zero); - Interop.Request.Destroy(requestHandle); - if (ret != (int)OAuth2Error.None || error != IntPtr.Zero) - { - if (error != IntPtr.Zero) - { - throw ErrorFactory.GetException(error); - } - else - { - Log.Error(ErrorFactory.LogTag, "Interop failed"); - throw ErrorFactory.GetException(ret); - } - } - - return response; - } - - // Fill device request handle for Authorization code grant - private IntPtr GetRequestHandle(ImplicitGrantAuthorizationRequest request) - { - if (request == null) - { - Log.Error(ErrorFactory.LogTag, "Invalid request or request is null"); - throw ErrorFactory.GetException((int)OAuth2Error.InvalidParameter); - } - - IntPtr requestHandle; - int ret = Interop.Request.Create(out requestHandle); - if (ret != (int)OAuth2Error.None) - { - Log.Error(ErrorFactory.LogTag, "Interop failed"); - throw ErrorFactory.GetException(ret); - } - - ret = Interop.Request.SetAuthEndPointUrl(requestHandle, request.AuthorizationEndpoint.ToString()); - if (ret != (int)OAuth2Error.None) - { - Log.Error(ErrorFactory.LogTag, "Interop failed"); - throw ErrorFactory.GetException(ret); - } - - ret = Interop.Request.SetResponseType(requestHandle, Interop.ResponseType.Token); - if (ret != (int)OAuth2Error.None) - { - Log.Error(ErrorFactory.LogTag, "Interop failed"); - throw ErrorFactory.GetException(ret); - } - - ret = Interop.Request.SetClientId(requestHandle, request.ClientSecrets.Id); - if (ret != (int)OAuth2Error.None) - { - Log.Error(ErrorFactory.LogTag, "Interop failed"); - throw ErrorFactory.GetException(ret); - } - - if (request.RedirectionEndPoint != null) - { - ret = Interop.Request.SetRedirectionUrl(requestHandle, request.RedirectionEndPoint.ToString()); - if (ret != (int)OAuth2Error.None) - { - Log.Error(ErrorFactory.LogTag, "Interop failed"); - throw ErrorFactory.GetException(ret); - } - } - - if (request.Scopes != null) - { - string scope = string.Join(" ", request.Scopes); - ret = Interop.Request.SetScope(requestHandle, scope); - if (ret != (int)OAuth2Error.None) - { - Log.Error(ErrorFactory.LogTag, "Interop failed"); - throw ErrorFactory.GetException(ret); - } - } - - if (request.State != null) - { - ret = Interop.Request.SetState(requestHandle, request.State); - if (ret != (int)OAuth2Error.None) - { - Log.Error(ErrorFactory.LogTag, "Interop failed"); - throw ErrorFactory.GetException(ret); - } - } - - if (request.CustomData != null) - { - foreach (var item in request.CustomData) - { - ret = Interop.Request.AddCustomData(requestHandle, item.Key, item.Value); - if (ret != (int)OAuth2Error.None) - { - Log.Error(ErrorFactory.LogTag, "Interop failed"); - throw ErrorFactory.GetException(ret); - } - } - } - - return requestHandle; - } - } -} diff --git a/src/Tizen.Account.OAuth2/Tizen.Account.OAuth2/OAuth2ErrorFactory.cs b/src/Tizen.Account.OAuth2/Tizen.Account.OAuth2/OAuth2ErrorFactory.cs deleted file mode 100755 index 08569f6ab..000000000 --- a/src/Tizen.Account.OAuth2/Tizen.Account.OAuth2/OAuth2ErrorFactory.cs +++ /dev/null @@ -1,127 +0,0 @@ -/* - * 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.Account.OAuth2 -{ - internal enum OAuth2Error - { - // Tizen Account Oauth Error - // TIZEN_ERROR_ACCOUNT_OAUTH -0x01010000 - - None = ErrorCode.None, - OutOfMemory = ErrorCode.OutOfMemory, - InvalidParameter = ErrorCode.InvalidParameter, - AlreadyInProgress = ErrorCode.AlreadyInProgress, - NotSupported = ErrorCode.NotSupported, - PermissionDenied = ErrorCode.PermissionDenied, - ParseFailed = -0x01010000 | 0X01, - NetworkError = -0x01010000 | 0X02, - Server = -0x01010000 | 0X03, - UserCancelled = -0x01010000 | 0X04, - ValueNotFound = -0x01010000 | 0X05, - Unknown = ErrorCode.Unknown - } - - internal class ErrorFactory - { - internal static string LogTag = "Tizen.Account.OAuth2"; - - internal static Exception GetException(IntPtr error) - { - int serverErrorCode, platformErrorCode; - int ret = Interop.Error.GetCode(error, out serverErrorCode, out platformErrorCode); - if (ret != (int)OAuth2Error.None) - { - Log.Debug(ErrorFactory.LogTag, "error code can't be found"); - } - - string errorDescription; - ret = Interop.Error.GetDescription(error, out errorDescription); - if (ret != (int)OAuth2Error.None) - { - Log.Debug(ErrorFactory.LogTag, "error description can't be found"); - } - - string uri; - Interop.Error.GetUri(error, out uri); - if (ret != (int)OAuth2Error.None) - { - Log.Debug(ErrorFactory.LogTag, "error uri can't be found"); - } - - var errorResponse = new OAuth2ErrorResponse() - { - PlatformErrorCode = platformErrorCode, - ServerErrorCode = serverErrorCode, - ErrorUri = uri, - Error = errorDescription - }; - - return new OAuth2Exception() { Error = errorResponse }; - } - - internal static Exception GetException(int error) - { - if ((OAuth2Error)error == OAuth2Error.OutOfMemory) - { - return new OutOfMemoryException("Out of memory"); - } - else if ((OAuth2Error)error == OAuth2Error.InvalidParameter) - { - return new ArgumentException("Invalid parameter"); - } - else if ((OAuth2Error)error == OAuth2Error.AlreadyInProgress) - { - return new InvalidOperationException("Request already in progress"); - } - else if ((OAuth2Error)error == OAuth2Error.NotSupported) - { - return new NotSupportedException("Not supported"); - } - else if ((OAuth2Error)error == OAuth2Error.PermissionDenied) - { - return new UnauthorizedAccessException("Permission denied"); - } - else if ((OAuth2Error)error == OAuth2Error.ParseFailed) - { - return new FormatException("Parsing failed"); - } - else if ((OAuth2Error)error == OAuth2Error.NetworkError) - { - return new Exception("Networking error occured"); - } - else if ((OAuth2Error)error == OAuth2Error.Server) - { - return new Exception("Server error"); - } - else if ((OAuth2Error)error == OAuth2Error.UserCancelled) - { - return new Exception("User cancelled"); - } - else if ((OAuth2Error)error == OAuth2Error.ValueNotFound) - { - return new ArgumentException("Value not found"); - } - else - { - return new Exception("Unknown error"); - } - } - } -} diff --git a/src/Tizen.Account.OAuth2/Tizen.Account.OAuth2/OAuth2ErrorResponse.cs b/src/Tizen.Account.OAuth2/Tizen.Account.OAuth2/OAuth2ErrorResponse.cs deleted file mode 100755 index 82f102421..000000000 --- a/src/Tizen.Account.OAuth2/Tizen.Account.OAuth2/OAuth2ErrorResponse.cs +++ /dev/null @@ -1,72 +0,0 @@ -/* - * 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.Account.OAuth2 -{ - /// - /// Exception wrapper for OAuth2 related exception - /// - public class OAuth2Exception : Exception - { - internal OAuth2Exception() - { - } - - /// - /// The error response. - /// - /// 3 - public OAuth2ErrorResponse Error { get; internal set; } - } - - /// - /// Wrapper class contaning OAuth2 related error information - /// - /// 3 - public class OAuth2ErrorResponse - { - internal OAuth2ErrorResponse () - { - - } - - /// - /// The server error code - /// - /// 3 - public int ServerErrorCode { get; internal set; } - - /// - /// The platform error cocde - /// - /// 3 - public int PlatformErrorCode { get; internal set; } - - /// - /// Error description - /// - /// 3 - public string Error { get; internal set; } - - /// - /// URI of the error page. - /// - /// 3 - public string ErrorUri { get; internal set; } - } -} diff --git a/src/Tizen.Account.OAuth2/Tizen.Account.OAuth2/RefreshToken.cs b/src/Tizen.Account.OAuth2/Tizen.Account.OAuth2/RefreshToken.cs deleted file mode 100755 index 505056367..000000000 --- a/src/Tizen.Account.OAuth2/Tizen.Account.OAuth2/RefreshToken.cs +++ /dev/null @@ -1,36 +0,0 @@ -/* - * 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. - */ - -namespace Tizen.Account.OAuth2 -{ - /// - /// The refresh token which can be used to obtain new access token. - /// - /// 3 - public class RefreshToken - { - internal RefreshToken () - { - - } - - /// - /// The refresh token issued to the client. - /// - /// 3 - public string Token { get; internal set; } - } -} diff --git a/src/Tizen.Account.OAuth2/Tizen.Account.OAuth2/RefreshTokenRequest.cs b/src/Tizen.Account.OAuth2/Tizen.Account.OAuth2/RefreshTokenRequest.cs deleted file mode 100755 index 0928ab602..000000000 --- a/src/Tizen.Account.OAuth2/Tizen.Account.OAuth2/RefreshTokenRequest.cs +++ /dev/null @@ -1,46 +0,0 @@ -/* - * 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. - */ - -namespace Tizen.Account.OAuth2 -{ - /// - /// The class contains request parameters for refreshing an access token. - /// - /// 3 - public class RefreshTokenRequest : TokenRequest - { - /// - /// The constructor - /// - /// 3 - public RefreshTokenRequest() - { - - } - - /// - /// The grant type to be used - /// - /// 3 - public override string GrantType { get; } = "refresh_token"; - - /// - /// The refresh token issued by authorization server. - /// - /// 3 - public string RefreshToken { get; set; } - } -} diff --git a/src/Tizen.Account.OAuth2/Tizen.Account.OAuth2/ResourceOwnerPwdCredentialsAuthorizer.cs b/src/Tizen.Account.OAuth2/Tizen.Account.OAuth2/ResourceOwnerPwdCredentialsAuthorizer.cs deleted file mode 100755 index 27ae24421..000000000 --- a/src/Tizen.Account.OAuth2/Tizen.Account.OAuth2/ResourceOwnerPwdCredentialsAuthorizer.cs +++ /dev/null @@ -1,182 +0,0 @@ -/* - * 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.Collections.Generic; -using System.Runtime.InteropServices; -using System.Threading.Tasks; - -namespace Tizen.Account.OAuth2 -{ - /// - /// The ResourceOwnerPwdCredentialsAuthorizer is used to obtain access tokens using Resource Owner Password Credentials Grant flow as described at https://tools.ietf.org/html/rfc6749#section-4.3 - /// - /// 3 - public class ResourceOwnerPwdCredentialsAuthorizer : Authorizer - { - /// - /// The constructor - /// - /// 3 - public ResourceOwnerPwdCredentialsAuthorizer() - { - - } - - /// - /// Authorization not supported through this API for this flow. - /// - /// 3 - /// Thrown when the operation is not supported - public override Task AuthorizeAsync(AuthorizationRequest request) - { - Log.Error(ErrorFactory.LogTag, "Authorization is not supported in this flow"); - throw new InvalidOperationException(); - } - - /// - /// Retrieves access token by sending resource owner's password credentials. - /// The authroization request parameters should be as defined in https://tools.ietf.org/html/rfc6749#section-4.3.2 - /// - /// 3 - /// The token request - /// The response containing access token. - /// http://tizen.org/privilege/internet - /// Thrown when method failed due to invalid argumets - /// Thrown when method fails due to server error - public override async Task GetAccessTokenAsync(TokenRequest request) - { - IntPtr requestHandle = GetRequestHandle(request as ResourceOwnerPwdCredentialsTokenRequest); - return await Task.Run(() => GetAccessToken(requestHandle)); - } - - // Fill device request handle for access token - private IntPtr GetRequestHandle(ResourceOwnerPwdCredentialsTokenRequest request) - { - if (request == null) - { - Log.Error(ErrorFactory.LogTag, "Invalid request or request is null"); - throw ErrorFactory.GetException((int)OAuth2Error.InvalidParameter); - } - - IntPtr requestHandle; - int ret = Interop.Request.Create(out requestHandle); - if (ret != (int)OAuth2Error.None) - { - Log.Error(ErrorFactory.LogTag, "Interop failed"); - throw ErrorFactory.GetException(ret); - } - - ret = Interop.Request.SetTokenEndPointUrl(requestHandle, request.TokenEndpoint.ToString()); - if (ret != (int)OAuth2Error.None) - { - Log.Error(ErrorFactory.LogTag, "Interop failed"); - throw ErrorFactory.GetException(ret); - } - - ret = Interop.Request.SetRedirectionUrl(requestHandle, request.RedirectionEndPoint.ToString()); - if (ret != (int)OAuth2Error.None) - { - Log.Error(ErrorFactory.LogTag, "Interop failed"); - throw ErrorFactory.GetException(ret); - } - - ret = Interop.Request.SetGrantType(requestHandle, Interop.GrantType.Password); - if (ret != (int)OAuth2Error.None) - { - Log.Error(ErrorFactory.LogTag, "Interop failed"); - throw ErrorFactory.GetException(ret); - } - - ret = Interop.Request.SetUserName(requestHandle, request.Username); - if (ret != (int)OAuth2Error.None) - { - Log.Error(ErrorFactory.LogTag, "Interop failed"); - throw ErrorFactory.GetException(ret); - } - - ret = Interop.Request.SetPassword(requestHandle, request.Password); - if (ret != (int)OAuth2Error.None) - { - Log.Error(ErrorFactory.LogTag, "Interop failed"); - throw ErrorFactory.GetException(ret); - } - - if (request.ClientSecrets.Id != null) - { - ret = Interop.Request.SetClientId(requestHandle, request.ClientSecrets.Id); - if (ret != (int)OAuth2Error.None) - { - Log.Error(ErrorFactory.LogTag, "Interop failed"); - throw ErrorFactory.GetException(ret); - } - } - - if (request.ClientSecrets.Secret != null) - { - ret = Interop.Request.SetClientSecret(requestHandle, request.ClientSecrets.Secret); - if (ret != (int)OAuth2Error.None) - { - Log.Error(ErrorFactory.LogTag, "Interop failed"); - throw ErrorFactory.GetException(ret); - } - } - - if (request.Scopes != null) - { - string scope = string.Join(" ", request.Scopes); - ret = Interop.Request.SetScope(requestHandle, scope); - if (ret != (int)OAuth2Error.None) - { - Log.Error(ErrorFactory.LogTag, "Interop failed"); - throw ErrorFactory.GetException(ret); - } - } - - if (request.CustomData != null) - { - foreach (var item in request.CustomData) - { - ret = Interop.Request.AddCustomData(requestHandle, item.Key, item.Value); - if (ret != (int)OAuth2Error.None) - { - Log.Error(ErrorFactory.LogTag, "Interop failed"); - throw ErrorFactory.GetException(ret); - } - } - } - - if (request.State != null) - { - ret = Interop.Request.SetState(requestHandle, request.State); - if (ret != (int)OAuth2Error.None) - { - Log.Error(ErrorFactory.LogTag, "Interop failed"); - throw ErrorFactory.GetException(ret); - } - } - - ret = Interop.Request.SetClientAuthenticationType(requestHandle, (int)request.AuthenticationScheme); - if (ret != (int)OAuth2Error.None) - { - Log.Error(ErrorFactory.LogTag, "Interop failed"); - throw ErrorFactory.GetException(ret); - } - - return requestHandle; - } - } -} diff --git a/src/Tizen.Account.OAuth2/Tizen.Account.OAuth2/ResourceOwnerPwdCredentialsTokenRequest.cs b/src/Tizen.Account.OAuth2/Tizen.Account.OAuth2/ResourceOwnerPwdCredentialsTokenRequest.cs deleted file mode 100755 index a0cf7fa2e..000000000 --- a/src/Tizen.Account.OAuth2/Tizen.Account.OAuth2/ResourceOwnerPwdCredentialsTokenRequest.cs +++ /dev/null @@ -1,51 +0,0 @@ -/* - * 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. - */ - -namespace Tizen.Account.OAuth2 -{ - /// - /// The class contains request parameters for retreiving access token in Resource Owner Password Credentials Grant flow. - /// - /// 3 - public class ResourceOwnerPwdCredentialsTokenRequest : TokenRequest - { - /// - /// The constructor - /// - public ResourceOwnerPwdCredentialsTokenRequest() - { - - } - - /// - /// The grant type - /// - /// 3 - public override string GrantType { get; } = "password"; - - /// - /// The resource owner username - /// - /// 3 - public string Username { get; set; } - - /// - /// The resource owner password - /// - /// 3 - public string Password { get; set; } - } -} diff --git a/src/Tizen.Account.OAuth2/Tizen.Account.OAuth2/TokenRequest.cs b/src/Tizen.Account.OAuth2/Tizen.Account.OAuth2/TokenRequest.cs deleted file mode 100755 index 1575c2281..000000000 --- a/src/Tizen.Account.OAuth2/Tizen.Account.OAuth2/TokenRequest.cs +++ /dev/null @@ -1,76 +0,0 @@ -/* - * 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.Collections.Generic; - -namespace Tizen.Account.OAuth2 -{ - /// - /// Abstract wrapper class containing OAuth 2.0 request parameters for requesting an access token. - /// - /// 3 - public abstract class TokenRequest - { - /// - /// The Grant type - /// - /// 3 - public abstract string GrantType { get; } - - /// - /// The client credentials - /// - /// 3 - public ClientCredentials ClientSecrets { get; set; } - - /// - /// The access token end point URL. - /// - /// 3 - public Uri TokenEndpoint { get; set; } - - /// - /// The redirection endpoint of the auhorization flow. - /// - /// 3 - public Uri RedirectionEndPoint { get; set; } - - /// - /// The scope of the access request as described by https://tools.ietf.org/html/rfc6749#section-3.3 - /// - /// 3 - public IEnumerable Scopes { get; set; } - - /// - /// Custom key-value parameters to be sent to the server - /// - /// 3 - public IEnumerable> CustomData { get; set; } - - /// - /// Client authentication scheme. Default is Basic - /// - /// 3 - public AuthenticationScheme AuthenticationScheme { get; set; } = AuthenticationScheme.Basic; - - /// - /// The client's state which is maintained between request and response. - /// - /// 3 - public string State { get; set; } - } -} diff --git a/src/Tizen.Account.OAuth2/Tizen.Account.OAuth2/TokenResponse.cs b/src/Tizen.Account.OAuth2/Tizen.Account.OAuth2/TokenResponse.cs deleted file mode 100755 index 078326854..000000000 --- a/src/Tizen.Account.OAuth2/Tizen.Account.OAuth2/TokenResponse.cs +++ /dev/null @@ -1,116 +0,0 @@ -/* - * 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; - -namespace Tizen.Account.OAuth2 -{ - /// - /// The response from authroization server containing access token and an optional refresh token. - /// - /// 3 - public class TokenResponse - { - private bool _disposed = false; - private IntPtr _responseHandle; - - internal TokenResponse(IntPtr handle) - { - _responseHandle = handle; - } - - /// - /// Destructor of the AuthorizationResponse class. - /// - /// 3 - ~TokenResponse() - { - Dispose(false); - } - - /// - /// The access token - /// - /// 3 - public AccessToken AccessToken { get; internal set; } - - /// - /// The state parameter present in authorization request. - /// - /// 3 - /// - /// The value can be null depending on the server specifications. - /// - public string State { get; internal set; } - - /// - /// The refresh token. The value will be null if authorization server doesn't return a refresh token. - /// - /// 3 - /// - /// Issuing a refresh token is optional at the discretion of the authorization server. - /// - public RefreshToken RefreshToken { get; internal set; } - - /// - /// Gets the value of the key received from service provider - /// - /// 3 - /// The value of respecitve key - /// Thrown when the key does not exist or when there is an invalid parameter. - public string GetCustomValue(string key) - { - IntPtr value; - int ret = Interop.Response.GetCustomData(_responseHandle, key, out value); - if (ret != (int)OAuth2Error.None) - { - Log.Error(ErrorFactory.LogTag, "Interop failed"); - throw ErrorFactory.GetException(ret); - } - return Marshal.PtrToStringAnsi(value); - } - - /// - /// Releases any unmanaged resources used by this object. - /// - /// 3 - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - - /// - /// Releases any unmanaged resources used by this object. Can also dispose any other disposable objects. - /// - /// 3 - /// If true, disposes any disposable objects. If false, does not dispose disposable objects. - protected virtual void Dispose(bool disposing) - { - if (_disposed) - return; - - if (disposing) - { - // Free managed objects - } - - Interop.Response.Destroy(_responseHandle); - _disposed = true; - } - } -} diff --git a/src/Tizen.Account.SyncManager/Interop/Interop.Adapter.cs b/src/Tizen.Account.SyncManager/Interop/Interop.Adapter.cs deleted file mode 100755 index 9a05dbc2f..000000000 --- a/src/Tizen.Account.SyncManager/Interop/Interop.Adapter.cs +++ /dev/null @@ -1,28 +0,0 @@ -// Copyright 2016 by Samsung Electronics, Inc., -// -// This software is the confidential and proprietary information -// of Samsung Electronics, Inc. ("Confidential Information"). You -// shall not disclose such Confidential Information and shall use -// it only in accordance with the terms of the license agreement -// you entered into with Samsung. - -using System; -using System.Runtime.InteropServices; - -internal static partial class Interop -{ - internal static partial class Adapter - { - [DllImport(Libraries.SyncManager, EntryPoint = "sync_adapter_set_callbacks")] - internal static extern int SetCallbacks(SyncAdapterStartSyncCallback onStartCb, SyncAdapterCancelSyncCallback onCancelCb); - - [DllImport(Libraries.SyncManager, EntryPoint = "sync_adapter_unset_callbacks")] - internal static extern int UnsetCallbacks(); - - [UnmanagedFunctionPointerAttribute(CallingConvention.Cdecl)] - internal delegate bool SyncAdapterStartSyncCallback(IntPtr account, string syncJobName, string syncCapability, IntPtr syncJobUserData); - - [UnmanagedFunctionPointerAttribute(CallingConvention.Cdecl)] - internal delegate void SyncAdapterCancelSyncCallback(IntPtr account, string syncJobName, string syncCapability, IntPtr syncJobUserData); - } -} diff --git a/src/Tizen.Account.SyncManager/Interop/Interop.Libraries.cs b/src/Tizen.Account.SyncManager/Interop/Interop.Libraries.cs deleted file mode 100755 index a1d341077..000000000 --- a/src/Tizen.Account.SyncManager/Interop/Interop.Libraries.cs +++ /dev/null @@ -1,28 +0,0 @@ -/* - * 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 -{ - /// - /// The Wrapper class for maintaining names of dependent native libraries. - /// - internal static partial class Libraries - { - public const string SyncManager = "libcore-sync-client.so.1"; - public const string Glib = "libglib-2.0.so.0"; - public const string Libc = "libc.so.6"; - } -} diff --git a/src/Tizen.Account.SyncManager/Interop/Interop.Manager.cs b/src/Tizen.Account.SyncManager/Interop/Interop.Manager.cs deleted file mode 100755 index c26969481..000000000 --- a/src/Tizen.Account.SyncManager/Interop/Interop.Manager.cs +++ /dev/null @@ -1,36 +0,0 @@ -// Copyright 2016 by Samsung Electronics, Inc., -// -// This software is the confidential and proprietary information -// of Samsung Electronics, Inc. ("Confidential Information"). You -// shall not disclose such Confidential Information and shall use -// it only in accordance with the terms of the license agreement -// you entered into with Samsung. - -using System; -using System.Runtime.InteropServices; -using Tizen.Applications; -using Tizen.Account.AccountManager; - -internal static partial class Interop -{ - internal static partial class Manager - { - [DllImport(Libraries.SyncManager, EntryPoint = "sync_manager_on_demand_sync_job")] - internal static extern int RequestOnDemandSyncJob(SafeAccountHandle account, string syncJobName, int syncOption, SafeBundleHandle syncJobUserData, out int syncJobId); - - [DllImport(Libraries.SyncManager, EntryPoint = "sync_manager_add_periodic_sync_job")] - internal static extern int AddPeriodicSyncJob(SafeAccountHandle account, string syncJobName, int syncPeriod, int syncOption, SafeBundleHandle syncJobUserData, out int syncJobId); - - [DllImport(Libraries.SyncManager, EntryPoint = "sync_manager_add_data_change_sync_job")] - internal static extern int AddDataChangeSyncJob(SafeAccountHandle account, string syncCapability, int syncOption, SafeBundleHandle syncJobUserData, out int syncJobId); - - [DllImport(Libraries.SyncManager, EntryPoint = "sync_manager_remove_sync_job")] - internal static extern int RemoveSyncJob(int syncJobId); - - [DllImport(Libraries.SyncManager, EntryPoint = "sync_manager_foreach_sync_job")] - internal static extern int ForeachSyncJob(SyncManagerSyncJobCallback syncJobCb, IntPtr userData); - - [UnmanagedFunctionPointerAttribute(CallingConvention.Cdecl)] - internal delegate bool SyncManagerSyncJobCallback(IntPtr account, string syncJobName, string syncCapability, int syncJobId, IntPtr syncJobUserData, IntPtr userData); - } -} diff --git a/src/Tizen.Account.SyncManager/Tizen.Account.SyncManager.csproj b/src/Tizen.Account.SyncManager/Tizen.Account.SyncManager.csproj deleted file mode 100644 index af9c378d4..000000000 --- a/src/Tizen.Account.SyncManager/Tizen.Account.SyncManager.csproj +++ /dev/null @@ -1,14 +0,0 @@ - - - - netstandard2.0 - - - - - - - - - - diff --git a/src/Tizen.Account.SyncManager/Tizen.Account.SyncManager.sln b/src/Tizen.Account.SyncManager/Tizen.Account.SyncManager.sln deleted file mode 100755 index 14b65a79a..000000000 --- a/src/Tizen.Account.SyncManager/Tizen.Account.SyncManager.sln +++ /dev/null @@ -1,22 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26430.13 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Account.SyncManager", "Tizen.Account.SyncManager.csproj", "{16028D3D-9DA0-466A-9CE4-EE8790F450D6}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {16028D3D-9DA0-466A-9CE4-EE8790F450D6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {16028D3D-9DA0-466A-9CE4-EE8790F450D6}.Debug|Any CPU.Build.0 = Debug|Any CPU - {16028D3D-9DA0-466A-9CE4-EE8790F450D6}.Release|Any CPU.ActiveCfg = Release|Any CPU - {16028D3D-9DA0-466A-9CE4-EE8790F450D6}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/src/Tizen.Account.SyncManager/Tizen.Account.SyncManager/Enumerations.cs b/src/Tizen.Account.SyncManager/Tizen.Account.SyncManager/Enumerations.cs deleted file mode 100755 index 7bfb265e8..000000000 --- a/src/Tizen.Account.SyncManager/Tizen.Account.SyncManager/Enumerations.cs +++ /dev/null @@ -1,84 +0,0 @@ -/* - * 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.Account.SyncManager -{ - /// - /// Enumeration for the sync option. - /// - [Flags] - public enum SyncOption - { - /// - /// The sync job will be operated normally. - /// - None = 0, - - /// - /// The sync job will be operated as soon as possible. - /// - Expedited = 0X01, - - /// - /// The sync job will not be performed again when it fails. - /// - NoRetry = 0X02, - } - - /// - /// Enumeration for the sync period. - /// - public enum SyncPeriod - { - /// - /// Sync within 30 minutes. - /// - ThirtyMin = 0, - - /// - /// Sync within 1 hour. - /// - OneHour, - - /// - /// Sync within 2 hours. - /// - TwoHours, - - /// - /// Sync within 3 hours. - /// - ThreeHours, - - /// - /// Sync within 6 hours. - /// - SixHours, - - /// - /// Sync within 12 hours. - /// - TwelveHours, - - /// - /// Sync within 1 day. - /// - OneDay, - } -} - diff --git a/src/Tizen.Account.SyncManager/Tizen.Account.SyncManager/ErrorFactory.cs b/src/Tizen.Account.SyncManager/Tizen.Account.SyncManager/ErrorFactory.cs deleted file mode 100755 index 79f1af9cc..000000000 --- a/src/Tizen.Account.SyncManager/Tizen.Account.SyncManager/ErrorFactory.cs +++ /dev/null @@ -1,90 +0,0 @@ -/* - * 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.Account.SyncManager -{ - internal enum SyncManagerErrorCode - { - None = ErrorCode.None, - NotSupported = ErrorCode.NotSupported, - OutOfMemory = ErrorCode.OutOfMemory, - InvalidParameter = ErrorCode.InvalidParameter, - InvalidOperation = ErrorCode.InvalidOperation, - PermissionDenied = ErrorCode.PermissionDenied, - IoError = ErrorCode.IoError, - AlreadyInProgress = ErrorCode.AlreadyInProgress, - QuotaExceeded = ErrorCode.QuotaExceeded, - SystemError = -0x01020000 | 0X01, - AdapterNotFound = -0x01020000 | 0X02 - } - - internal class ErrorFactory - { - internal static string LogTag = "Tizen.Account.SyncManager"; - - internal static Exception GetException(int error) - { - if ((SyncManagerErrorCode)error == SyncManagerErrorCode.NotSupported) - { - return new NotSupportedException("Not supported (%http://tizen.org/feature/account.sync)"); - } - else if ((SyncManagerErrorCode)error == SyncManagerErrorCode.OutOfMemory) - { - return new OutOfMemoryException("Out of memory"); - } - else if ((SyncManagerErrorCode)error == SyncManagerErrorCode.InvalidParameter) - { - return new ArgumentException("Invalid parameter"); - } - else if ((SyncManagerErrorCode)error == SyncManagerErrorCode.InvalidOperation) - { - return new InvalidOperationException("Invalid operation"); - } - else if ((SyncManagerErrorCode)error == SyncManagerErrorCode.PermissionDenied) - { - return new UnauthorizedAccessException("Permission denied (%http://tizen.org/privilege/alarm.set, %http://tizen.org/privilege/calendar.read, %http://tizen.org/privilege/contact.read)"); - } - else if ((SyncManagerErrorCode)error == SyncManagerErrorCode.IoError) - { - return new Exception("IO error occured"); - } - else if ((SyncManagerErrorCode)error == SyncManagerErrorCode.AlreadyInProgress) - { - return new InvalidOperationException("Sync is already in progress"); - } - else if ((SyncManagerErrorCode)error == SyncManagerErrorCode.QuotaExceeded) - { - return new InvalidOperationException("Quota for sync jobs exceeded"); - } - else if ((SyncManagerErrorCode)error == SyncManagerErrorCode.SystemError) - { - return new Exception("System error occured"); - } - else if ((SyncManagerErrorCode)error == SyncManagerErrorCode.AdapterNotFound) - { - return new InvalidOperationException("Sync adapter couldn't be found"); - } - else - { - return new Exception("Unknown error"); - } - } - } -} - diff --git a/src/Tizen.Account.SyncManager/Tizen.Account.SyncManager/SyncAdapter.cs b/src/Tizen.Account.SyncManager/Tizen.Account.SyncManager/SyncAdapter.cs deleted file mode 100755 index 4a25deef4..000000000 --- a/src/Tizen.Account.SyncManager/Tizen.Account.SyncManager/SyncAdapter.cs +++ /dev/null @@ -1,115 +0,0 @@ -/* - * 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.Applications; -using Tizen.Account.AccountManager; - -namespace Tizen.Account.SyncManager -{ - /// - /// This class contains the delegates to be called upon scheduling a sync operation. - /// - public class SyncAdapter - { - Interop.Adapter.SyncAdapterStartSyncCallback _startSyncCallback; - Interop.Adapter.SyncAdapterCancelSyncCallback _cancelSyncCallback; - - /// - /// The callback function for the sync adapter's start sync request. - /// - /// The sync job parameters corresponding to the sync request. - /// true if the sync operation is success, @c false otherwise. - public delegate bool StartSyncCallback(SyncJobData syncParameters); - - /// - /// The callback function for the sync adapter's cancel sync request. - /// - /// The sync job parameters corresponding to the sync request. - public delegate void CancelSyncCallback(SyncJobData syncParameters); - - /// - /// Sets the client (sync adapter) callback functions. - /// - /// A callback function to be called by the sync manager for performing the sync operation. - /// A callback function to be called by the sync manager for cancelling the sync operation. - /// Thrown when any of the arguments are null. - /// Thrown when the application calling this API cannot be a sync adapter. - public void SetSyncEventCallbacks(StartSyncCallback startSyncCb, CancelSyncCallback cancelSyncCb) - { - if (startSyncCb == null || cancelSyncCb == null) - { - throw new ArgumentNullException(); - } - - _startSyncCallback = (IntPtr accountHandle, string syncJobName, string syncCapability, IntPtr syncJobUserData) => - { - Log.Debug(ErrorFactory.LogTag, "Start sync event received"); - - AccountManager.Account account = new AccountManager.Account(new SafeAccountHandle(accountHandle, true)); - Bundle bundle = new Bundle(new SafeBundleHandle(syncJobUserData, true)); - - SyncJobData syncJobData = new SyncJobData() - { - Account = account, - SyncJobName = syncJobName, - UserData = bundle - }; - - return startSyncCb(syncJobData); - }; - - _cancelSyncCallback = (IntPtr accountHandle, string syncJobName, string syncCapability, IntPtr syncJobUserData) => - { - Log.Debug(ErrorFactory.LogTag, "cancel sync event received"); - - AccountManager.Account account = new AccountManager.Account(new SafeAccountHandle(accountHandle, true)); - Bundle bundle = new Bundle(new SafeBundleHandle(syncJobUserData, true)); - - SyncJobData syncJobData = new SyncJobData() - { - Account = account, - SyncJobName = syncJobName, - UserData = bundle - }; - - cancelSyncCb(syncJobData); - }; - - int ret = Interop.Adapter.SetCallbacks(_startSyncCallback, _cancelSyncCallback); - if (ret != (int)SyncManagerErrorCode.None) - { - Log.Error(ErrorFactory.LogTag, "Failed to set callbacks"); - throw ErrorFactory.GetException(ret); - } - } - - /// - /// Unsets the client (sync adapter) callback functions. - /// - /// Thrown when sync manager internal error occurs. - public void UnsetSyncEventCallbacks() - { - int ret = Interop.Adapter.UnsetCallbacks(); - if (ret != (int)SyncManagerErrorCode.None) - { - Log.Error(ErrorFactory.LogTag, "Failed to unset callbacks"); - throw ErrorFactory.GetException(ret); - } - } - } -} - diff --git a/src/Tizen.Account.SyncManager/Tizen.Account.SyncManager/SyncClient.cs b/src/Tizen.Account.SyncManager/Tizen.Account.SyncManager/SyncClient.cs deleted file mode 100755 index f86747b4c..000000000 --- a/src/Tizen.Account.SyncManager/Tizen.Account.SyncManager/SyncClient.cs +++ /dev/null @@ -1,178 +0,0 @@ -/* - * 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.Collections.Generic; -using Tizen.Applications; -using Tizen.Account.AccountManager; - -namespace Tizen.Account.SyncManager -{ - /// - /// The SyncClient APIs for managing the sync operations. Applications will call these APIs to schedule their sync operations. - /// The sync service maintains sync requests from all the applications and invokes their respective callback methods to perform account synchronization operations. - /// - public static class SyncClient - { - /// - /// The constructor. - /// - static SyncClient() - { - } - - /// - /// Requests the sync manager to perform one time sync operation. - /// - /// The sync job information of the sync job request. - /// Sync options determine a way to operate the sync job and can be used as ORing. - /// Thrown when any of the arugments are null. - /// Thrown when the application calling this API doesn't have a sync adapter. - /// An unique value which can manage sync jobs. The number of sync job ID is limite as it is less than hundred. - public static int RequestOnDemandSyncJob(SyncJobData request, SyncOption syncOptions) - { - if (request == null || request.SyncJobName == null) - { - throw new ArgumentNullException(); - } - - SafeAccountHandle accountHandle = (request.Account != null) ? request.Account.SafeAccountHandle : new SafeAccountHandle(); - SafeBundleHandle bundleHandle = (request.UserData != null) ? request.UserData.SafeBundleHandle : new SafeBundleHandle(); - - int id = 0; - int ret = Interop.Manager.RequestOnDemandSyncJob(accountHandle, request.SyncJobName, (int)syncOptions, bundleHandle, out id); - if (ret != (int)SyncManagerErrorCode.None) - { - Log.Error(ErrorFactory.LogTag, "Failed to request on demand sync job"); - throw ErrorFactory.GetException(ret); - } - return id; - } - - /// - /// Requests the sync manager to perform periodic sync operations. - /// - /// The sync job information of the sync job request. - /// Determines the time interval of the periodic sync. The periodic sync operation can be triggered in that interval, but it does not guarantee the exact time. The minimum value is 30 minutes. - /// Sync options determine a way to operate the sync job and can be used as ORing. - /// http://tizen.org/privilege/alarm.set - /// In case of a privilege not defined. - /// Thrown when any of the arguments are null. - /// Thrown when the application calling this API doesn't have a sync adapter. - /// A unique value which can manage sync jobs. The number of sync job IDs is limited as it is less than hundred. - public static int AddPeriodicSyncJob(SyncJobData request, SyncPeriod period, SyncOption syncOptions) - { - if (request == null || request.SyncJobName == null) - { - throw new ArgumentNullException(); - } - - SafeAccountHandle accountHandle = (request.Account != null) ? request.Account.SafeAccountHandle : new SafeAccountHandle(); - SafeBundleHandle bundleHandle = (request.UserData != null) ? request.UserData.SafeBundleHandle : new SafeBundleHandle(); - - int id = 0; - int ret = Interop.Manager.AddPeriodicSyncJob(accountHandle, request.SyncJobName, (int) period, (int)syncOptions, bundleHandle, out id); - if (ret != (int)SyncManagerErrorCode.None) - { - Log.Error(ErrorFactory.LogTag, "Failed to add periodic sync job"); - throw ErrorFactory.GetException(ret); - } - return id; - } - - /// - /// Requests the sync manager to perform sync operations whenever the corresponding DB is changed. - /// - /// The sync job information of the sync job request. - /// Sync options determine a way to operate the sync job and can be used as ORing. - /// http://tizen.org/privilege/calendar.read - /// http://tizen.org/privilege/contact.read - /// In case of a privilege is not defined. - /// Thrown when any of the arguments are null. - /// Thrown when the application calling this API doesn't have a sync adapter. - /// A unique value which can manage sync jobs. The number of sync job IDs is limited as it is less than hundred. - public static int AddDataChangeSyncJob(SyncJobData request, SyncOption syncOptions) - { - if (request == null || request.SyncJobName == null) - { - throw new ArgumentNullException(); - } - - SafeAccountHandle accountHandle = (request.Account != null) ? request.Account.SafeAccountHandle : new SafeAccountHandle(); - SafeBundleHandle bundleHandle = (request.UserData != null) ? request.UserData.SafeBundleHandle : new SafeBundleHandle(); - - int id = 0; - int ret = Interop.Manager.AddDataChangeSyncJob(accountHandle, request.SyncJobName, (int)syncOptions, bundleHandle, out id); - if (ret != (int)SyncManagerErrorCode.None) - { - Log.Error(ErrorFactory.LogTag, "Failed to add data change sync job"); - throw ErrorFactory.GetException(ret); - } - return id; - } - - /// - /// Gets all the sync jobs registered with the sync manager. - /// - /// - /// Returns the list of SyncJobData corresponding to sync requests. - /// - public static IEnumerable> GetAllSyncJobs() - { - IDictionary syncJobs = new Dictionary(); - Interop.Manager.SyncManagerSyncJobCallback cb = (IntPtr accountHandle, string syncJobName, string syncCapability, int syncJobId, IntPtr syncJobUserData, IntPtr userData) => - { - AccountManager.Account account = new AccountManager.Account(new SafeAccountHandle(accountHandle, true)); - Bundle bundle = new Bundle(new SafeBundleHandle(syncJobUserData, true)); - - SyncJobData syncJobData = new SyncJobData(); - syncJobData.Account = account; - if (syncJobName != null) - syncJobData.SyncJobName = syncJobName; - else - syncJobData.SyncJobName = syncCapability; - syncJobData.UserData = bundle; - - syncJobs.Add(syncJobId, syncJobData); - return true; - }; - - int ret = Interop.Manager.ForeachSyncJob(cb, IntPtr.Zero); - if (ret != (int)SyncManagerErrorCode.None) - { - Log.Error(ErrorFactory.LogTag, "Failed to get registered sync job"); - throw ErrorFactory.GetException(ret); - } - return syncJobs; - } - - /// - /// Requests the sync manager to remove the corresponding sync job based on the ID. - /// - /// A unique value of each sync job, it can be used to search a specific sync job and remove it. - /// Thrown if the input arugments is invalid. - public static void RemoveSyncJob(int id) - { - int ret = Interop.Manager.RemoveSyncJob(id); - if (ret != (int)SyncManagerErrorCode.None) - { - Log.Error(ErrorFactory.LogTag, "Failed to remove sync job"); - throw ErrorFactory.GetException(ret); - } - } - } -} - diff --git a/src/Tizen.Account.SyncManager/Tizen.Account.SyncManager/SyncJobData.cs b/src/Tizen.Account.SyncManager/Tizen.Account.SyncManager/SyncJobData.cs deleted file mode 100755 index e9f88da59..000000000 --- a/src/Tizen.Account.SyncManager/Tizen.Account.SyncManager/SyncJobData.cs +++ /dev/null @@ -1,91 +0,0 @@ -/* - * 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 Tizen.Applications; -using Tizen.Account.AccountManager; - -namespace Tizen.Account.SyncManager -{ - /// - /// This class represents information about the sync job request. - /// - public class SyncJobData - { - /// - /// Represents the calendar capability. - /// - /// - /// If you want to receive notification about the calendar database change, assign it to the SyncJobName property of the SyncJobData object. - /// - public const string CalendarCapability = "http://tizen.org/sync/capability/calendar"; - - /// - /// Represents the contact capability. - /// - /// - /// If you want to receive notification about the contact database change, assign it to the SyncJobName property of the SyncJobData object. - /// - public const string ContactCapability = "http://tizen.org/sync/capability/contact"; - - /// - /// Represents the image capability. - /// - /// - /// If you want to receive notification about the image database change, assign it to the SyncJobName property of the SyncJobData object. - /// - public const string ImageCapability = "http://tizen.org/sync/capability/image"; - - /// - /// Represents the video capability. - /// - /// - /// If you want to receive notification about the video database change, assign it to the SyncJobName property of the SyncJobData object. - /// - public const string VideoCapability = "http://tizen.org/sync/capability/video"; - - /// - /// Represents the sound capability. - /// - /// - /// If you want to receive notification about the sound database change, assign it to the SyncJobName property of the SyncJobData object. - /// - public const string SoundCapability = "http://tizen.org/sync/capability/sound"; - - /// - /// Represents the music capability. - /// - /// - /// If you want to receive notification about the music database change, assign it to the SyncJobName property of the SyncJobData object. - /// - public const string MusicCapability = "http://tizen.org/sync/capability/music"; - - /// - /// The account instance on which the sync operation was requested or @c null in the case of the accountless sync operation. - /// - public AccountManager.Account Account { get; set; } - - /// - /// User data which contains an additional information related to the registered sync job. - /// - public Bundle UserData { get; set; } - - /// - /// A string representing a sync job which has been operated or capability setting to operate the data change sync job. - /// - public string SyncJobName { get; set; } - } -} - diff --git a/src/Tizen.Applications.Alarm/Interop/Interop.Alarm.cs b/src/Tizen.Applications.Alarm/Interop/Interop.Alarm.cs deleted file mode 100755 index bb4bbf9c6..000000000 --- a/src/Tizen.Applications.Alarm/Interop/Interop.Alarm.cs +++ /dev/null @@ -1,102 +0,0 @@ -/* - * 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; - -using Tizen.Internals.Errors; -using Tizen.Applications; -using Tizen.Applications.Notifications; - -internal static partial class Interop -{ - internal static partial class Alarm - { - [StructLayout(LayoutKind.Sequential)] - internal struct DateTime - { - internal int sec; - internal int min; - internal int hour; - internal int mday; /* day of the month, range 1 to 31*/ - internal int mon; - internal int year; - internal int wday; /* day of the week, range 0 to 6*/ - internal int yday; /* day in the year, range 0 to 365*/ - internal int isdst; /* daylight saving time*/ - internal long tm_gmtoff; - internal IntPtr tm_zone; - }; - - [DllImport(Libraries.Alarm, EntryPoint = "alarm_schedule_after_delay")] - internal static extern int CreateAlarmAfterDelay(SafeAppControlHandle appControl, int delay, int period, out int alarmId); - - [DllImport(Libraries.Alarm, EntryPoint = "alarm_schedule_once_after_delay")] - internal static extern int CreateAlarmOnceAfterDelay(SafeAppControlHandle appControl, int delay, out int alarmId); - - [DllImport(Libraries.Alarm, EntryPoint = "alarm_schedule_once_at_date")] - internal static extern int CreateAlarmOnceAtDate(SafeAppControlHandle appControl, ref DateTime date, out int alarmId); - - [DllImport(Libraries.Alarm, EntryPoint = "alarm_schedule_with_recurrence_week_flag")] - internal static extern int CreateAlarmRecurWeek(SafeAppControlHandle appControl, ref DateTime date, int week, out int alarmId); - - [DllImport(Libraries.Alarm, EntryPoint = "alarm_get_scheduled_recurrence_week_flag")] - internal static extern int GetAlarmWeekFlag(int alarmId, out int weekFlag); - - [DllImport(Libraries.Alarm, EntryPoint = "alarm_cancel")] - internal static extern int CancelAlarm(int alarmId); - - [DllImport(Libraries.Alarm, EntryPoint = "alarm_cancel_all")] - internal static extern int CancelAllAlarms(); - - [DllImport(Libraries.Alarm, EntryPoint = "alarm_get_scheduled_date")] - internal static extern int GetAlarmScheduledDate(int alarmId, out DateTime date); - - [DllImport(Libraries.Alarm, EntryPoint = "alarm_get_current_time")] - internal static extern int GetCurrentTime(out DateTime date); - - [DllImport(Libraries.Alarm, EntryPoint = "alarm_get_app_control")] - internal static extern int GetAlarmAppControl(int alarmId, out SafeAppControlHandle control); - - [DllImport(Libraries.Alarm, EntryPoint = "alarm_get_scheduled_period")] - internal static extern int GetAlarmScheduledPeriod(int alarmId, out int period); - - [DllImport(Libraries.Alarm, EntryPoint = "alarm_set_global")] - internal static extern int SetAlarmGlobalFlag(int alarmId, bool global); - - [DllImport(Libraries.Alarm, EntryPoint = "alarm_get_global")] - internal static extern int GetAlarmGlobalFlag(int alarmId, out bool global); - - [DllImport(Libraries.Alarm, EntryPoint = "alarm_foreach_registered_alarm")] - internal static extern int GetAllRegisteredAlarms(RegisteredAlarmCallback callback, IntPtr userData); - - [DllImport(Libraries.Alarm, EntryPoint = "alarm_schedule_noti_once_at_date")] - internal static extern AlarmError CreateAlarmNotiOnceAtDate(NotificationSafeHandle noti, ref DateTime date, out int alarmId); - - [DllImport(Libraries.Alarm, EntryPoint = "alarm_schedule_noti_after_delay")] - internal static extern AlarmError CreateAlarmNotiAfterDelay(NotificationSafeHandle noti, int delay, int period, out int alarmId); - - [DllImport(Libraries.Alarm, EntryPoint = "alarm_schedule_noti_once_after_delay")] - internal static extern AlarmError CreateAlarmNotiOnceAfterDelay(NotificationSafeHandle noti, int delay, out int alarmId); - - [DllImport(Libraries.Alarm, EntryPoint = "alarm_schedule_noti_with_recurrence_week_flag")] - internal static extern AlarmError CreateAlarmNotiRecurWeek(NotificationSafeHandle noti, ref DateTime date, int week, out int alarmId); - - //callback - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool RegisteredAlarmCallback(int alarmId, IntPtr userData); - } -} diff --git a/src/Tizen.Applications.Alarm/Interop/Interop.Libraries.cs b/src/Tizen.Applications.Alarm/Interop/Interop.Libraries.cs deleted file mode 100755 index 63f4a2939..000000000 --- a/src/Tizen.Applications.Alarm/Interop/Interop.Libraries.cs +++ /dev/null @@ -1,23 +0,0 @@ -/* - * 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 Alarm = "libcapi-appfw-alarm.so.0"; - } -} diff --git a/src/Tizen.Applications.Alarm/Tizen.Applications.Alarm.csproj b/src/Tizen.Applications.Alarm/Tizen.Applications.Alarm.csproj deleted file mode 100755 index 9c3d05990..000000000 --- a/src/Tizen.Applications.Alarm/Tizen.Applications.Alarm.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - netstandard2.0 - - - - - - - - diff --git a/src/Tizen.Applications.Alarm/Tizen.Applications.Alarm.sln b/src/Tizen.Applications.Alarm/Tizen.Applications.Alarm.sln deleted file mode 100755 index 9afcde6ec..000000000 --- a/src/Tizen.Applications.Alarm/Tizen.Applications.Alarm.sln +++ /dev/null @@ -1,46 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26430.12 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Applications.Alarm", "Tizen.Applications.Alarm.csproj", "{8807011E-9AE7-41D2-B568-E9F7B1B8E030}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Applications.Common", "..\Tizen.Applications.Common\Tizen.Applications.Common.csproj", "{ECB33982-A146-4B3E-A8C8-C3496EA897B2}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Applications.Notification", "..\Tizen.Applications.Notification\Tizen.Applications.Notification.csproj", "{243EE447-5438-495D-AD85-4261EB97EA4F}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen", "..\Tizen\Tizen.csproj", "{9FFD6275-D54A-4F6B-9066-619F82D8B2C6}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Log", "..\Tizen.Log\Tizen.Log.csproj", "{6F685D6D-FD89-4F05-AC1B-BBB8473B5F5F}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {8807011E-9AE7-41D2-B568-E9F7B1B8E030}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {8807011E-9AE7-41D2-B568-E9F7B1B8E030}.Debug|Any CPU.Build.0 = Debug|Any CPU - {8807011E-9AE7-41D2-B568-E9F7B1B8E030}.Release|Any CPU.ActiveCfg = Release|Any CPU - {8807011E-9AE7-41D2-B568-E9F7B1B8E030}.Release|Any CPU.Build.0 = Release|Any CPU - {ECB33982-A146-4B3E-A8C8-C3496EA897B2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {ECB33982-A146-4B3E-A8C8-C3496EA897B2}.Debug|Any CPU.Build.0 = Debug|Any CPU - {ECB33982-A146-4B3E-A8C8-C3496EA897B2}.Release|Any CPU.ActiveCfg = Release|Any CPU - {ECB33982-A146-4B3E-A8C8-C3496EA897B2}.Release|Any CPU.Build.0 = Release|Any CPU - {243EE447-5438-495D-AD85-4261EB97EA4F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {243EE447-5438-495D-AD85-4261EB97EA4F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {243EE447-5438-495D-AD85-4261EB97EA4F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {243EE447-5438-495D-AD85-4261EB97EA4F}.Release|Any CPU.Build.0 = Release|Any CPU - {9FFD6275-D54A-4F6B-9066-619F82D8B2C6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {9FFD6275-D54A-4F6B-9066-619F82D8B2C6}.Debug|Any CPU.Build.0 = Debug|Any CPU - {9FFD6275-D54A-4F6B-9066-619F82D8B2C6}.Release|Any CPU.ActiveCfg = Release|Any CPU - {9FFD6275-D54A-4F6B-9066-619F82D8B2C6}.Release|Any CPU.Build.0 = Release|Any CPU - {6F685D6D-FD89-4F05-AC1B-BBB8473B5F5F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6F685D6D-FD89-4F05-AC1B-BBB8473B5F5F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6F685D6D-FD89-4F05-AC1B-BBB8473B5F5F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6F685D6D-FD89-4F05-AC1B-BBB8473B5F5F}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/src/Tizen.Applications.Alarm/Tizen.Applications/Alarm.cs b/src/Tizen.Applications.Alarm/Tizen.Applications/Alarm.cs deleted file mode 100755 index 01691517c..000000000 --- a/src/Tizen.Applications.Alarm/Tizen.Applications/Alarm.cs +++ /dev/null @@ -1,181 +0,0 @@ -/* - * 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.Applications -{ - /// - /// The alarm API allows setting an "alarm clock" for the delivery of a notification at some point in the future. - /// - /// - /// - /// public class AlarmExample - /// { - /// /// ... - /// IEnumerable < Alarm > alarms = AlarmManager.GetAllScheduledAlarms(); - /// alarms[0].Cancel(); - /// } - /// - /// - public class Alarm - { - private const string _logTag = "Tizen.Applications.Alarm"; - - /// - /// Constructor created with the new AlarmId. - /// - /// - internal Alarm(int id) - { - AlarmId = id; - } - - /// - /// The alarm ID uniquely identifies an alarm. - /// - public int AlarmId - { - get; private set; - } - - /// - /// Gets the recurrence days of the week. - /// - /// http://tizen.org/privilege/alarm.get - /// - /// week_flag may be a combination of days, like Tuesday | Friday. - /// - public AlarmWeekFlag WeekFlag - { - get - { - int week; - AlarmError ret = (AlarmError)Interop.Alarm.GetAlarmWeekFlag(AlarmId, out week); - if (ret != AlarmError.None) - { - Log.Error(_logTag, "Failed to get WeekFlag"); - } - - return (AlarmWeekFlag)week; - } - } - - /// - /// Gets the scheduled time. - /// - /// http://tizen.org/privilege/alarm.get - public DateTime ScheduledDate - { - get - { - Interop.Alarm.DateTime value; - AlarmError ret = (AlarmError)Interop.Alarm.GetAlarmScheduledDate(AlarmId, out value); - if (ret != AlarmError.None) - { - Log.Error(_logTag, "Failed to get WeekFlag"); - } - - DateTime time = AlarmManager.ConvertIntPtrToDateTime(value); - return time; - } - } - - /// - /// Gets the period of time between the recurrent alarms. - /// - /// http://tizen.org/privilege/alarm.get - public int Period - { - get - { - int period; - AlarmError ret = (AlarmError)Interop.Alarm.GetAlarmScheduledPeriod(AlarmId, out period); - if (ret != AlarmError.None) - { - Log.Error(_logTag, "Failed to get WeekFlag"); - } - - return period; - } - } - - /// - /// Gets the AppControl to be invoked when the the alarm is triggered. - /// - /// http://tizen.org/privilege/alarm.get - public AppControl AlarmAppControl - { - get - { - SafeAppControlHandle handle; - AlarmError ret = (AlarmError)Interop.Alarm.GetAlarmAppControl(AlarmId, out handle); - - if (ret != AlarmError.None) - { - Log.Error(_logTag, "Failed to get WeekFlag"); - } - - return new AppControl(handle); - } - } - - /// - /// Gets whether the alarm will launch global application or not. - /// - /// http://tizen.org/privilege/alarm.set - /// http://tizen.org/privilege/alarm.get - public bool Global - { - get - { - bool global; - AlarmError ret = (AlarmError)Interop.Alarm.GetAlarmGlobalFlag(AlarmId, out global); - if (ret != AlarmError.None) - { - Log.Error(_logTag, "Failed to get WeekFlag"); - } - - return global; - } - - set - { - AlarmError ret = (AlarmError)Interop.Alarm.SetAlarmGlobalFlag(AlarmId, value); - if (ret != AlarmError.None) - { - Log.Error(_logTag, "Failed to get WeekFlag"); - } - } - } - - /// - /// Cancels the specific alarm. - /// - /// Thrown in case of an invalid parmaeter. - /// Thrown in case of a permission denied due to insufficient privileges. - /// Thrown in case of any internal error. - /// http://tizen.org/privilege/alarm.set - public void Cancel() - { - AlarmError ret = (AlarmError)Interop.Alarm.CancelAlarm(AlarmId); - if (ret != AlarmError.None) - { - throw AlarmErrorFactory.GetException(ret, "Failed to Cancel alarm"); - } - } - } -} diff --git a/src/Tizen.Applications.Alarm/Tizen.Applications/AlarmErrorFactory.cs b/src/Tizen.Applications.Alarm/Tizen.Applications/AlarmErrorFactory.cs deleted file mode 100755 index 452488214..000000000 --- a/src/Tizen.Applications.Alarm/Tizen.Applications/AlarmErrorFactory.cs +++ /dev/null @@ -1,58 +0,0 @@ -/* - * 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.Applications -{ - internal enum AlarmError - { - None = Tizen.Internals.Errors.ErrorCode.None, - InvalidParameter = Tizen.Internals.Errors.ErrorCode.InvalidParameter, - InvalidTime = -0x01100000 | 0x05, - InvalidDate = -0x01100000 | 0x06, - ConnectionFail = -0x01100000 | 0x07, - NotPermittedApp = -0x01100000 | 0x08, - OutOfMemory = Tizen.Internals.Errors.ErrorCode.OutOfMemory, - PermissionDenied = Tizen.Internals.Errors.ErrorCode.PermissionDenied - } - internal static class AlarmErrorFactory - { - private const string _logTag = "Tizen.Applications.Alarm"; - - internal static Exception GetException(AlarmError ret, string msg) - { - switch (ret) - { - case AlarmError.InvalidParameter: - //fall through - case AlarmError.InvalidTime: - //fall through - case AlarmError.InvalidDate: - Log.Error(_logTag, msg); - return new ArgumentException(ret + " error occurred."); - case AlarmError.NotPermittedApp: - //fall through - case AlarmError.PermissionDenied: - Log.Error(_logTag, msg); - return new UnauthorizedAccessException(ret + "error occured."); - default: - Log.Error(_logTag, msg); - return new InvalidOperationException(ret + " error occurred."); - } - } - } -} diff --git a/src/Tizen.Applications.Alarm/Tizen.Applications/AlarmManager.cs b/src/Tizen.Applications.Alarm/Tizen.Applications/AlarmManager.cs deleted file mode 100755 index 7faff6f8b..000000000 --- a/src/Tizen.Applications.Alarm/Tizen.Applications/AlarmManager.cs +++ /dev/null @@ -1,412 +0,0 @@ -/* - * 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. - */ - -namespace Tizen.Applications -{ - using System; - using System.Collections.Generic; - using System.Runtime.InteropServices; - using Tizen.Applications.Notifications; - - /// - /// Enumeration for alarm week flag, the days of the week. - /// - [Flags] - public enum AlarmWeekFlag - { - /// - /// An identifier for Sunday. - /// - Sunday = 0x01, - - /// - /// An identifier for Monday. - /// - Monday = 0x02, - - /// - /// An identifier for Tuesday. - /// - Tuesday = 0x04, - - /// - /// An identifier for Wednesday. - /// - Wednesday = 0x08, - - /// - /// An identifier for Thursday. - /// - Thursday = 0x10, - - /// - /// An identifier for Friday. - /// - Friday = 0x20, - - /// - /// An identifier for Saturday. - /// - Saturday = 0x40, - - /// - /// All days of the week. - /// - AllDays = Sunday |Monday|Tuesday|Wednesday|Thursday|Friday|Saturday, - - /// - /// Only weekdays. - /// - WeekDays = Monday | Tuesday | Wednesday | Thursday | Friday - } - - /// - /// Mobile devices typically give constant access to information from various sources. Some of this information is best delivered through alarms. - /// The most obvious case is a calendar scheduling application, which lets you know when a meeting is about to start. Alarms are certainly better than actively waiting in a loop. - /// They are also better than putting an interface to sleep because they do not block your main UI thread. - /// Use of alarms helps build smooth user experiences and implements unattended data synchronization tasks. - /// If an application is installed after setting the alarm, your alarm is canceled automatically. - /// - /// - /// - /// public class AlarmManagerExample - /// { - /// /// ... - /// Alarm alarm = AlarmManager.CreateAlarm(24000,1000,null); - /// AlarmManager.CancelAll(); - /// } - /// - /// - - public static class AlarmManager - { - private const string LogTag = "Tizen.Applications.Alarm"; - - private static Interop.Alarm.DateTime ConvertDateTimeToStruct(DateTime value) - { - Interop.Alarm.DateTime time = new Interop.Alarm.DateTime(); - time.sec = value.Second; - time.min = value.Minute; - time.hour = value.Hour; - time.mday = value.Day; - time.mon = value.Month - 1; - time.year = value.Year - 1900; - time.wday = (int)value.DayOfWeek; - time.yday = value.DayOfYear; - time.isdst = 0; - return time; - } - - internal static DateTime ConvertIntPtrToDateTime(Interop.Alarm.DateTime time) - { - DateTime value = new DateTime(1900 + time.year, 1 + time.mon, time.mday, time.hour, time.min, time.sec, DateTimeKind.Utc); - return value; - } - - /// - /// Sets an alarm to be triggered after a specific time. - /// The alarm will first go off delay seconds later and then will go off every certain amount of time defined using period seconds. - /// - /// The amount of time before the first execution (in seconds). - /// The amount of time between subsequent alarms (in seconds). This value does not guarantee the accuracy. - /// The actual interval is calculated by the OS. The minimum value is 600sec. - /// The destination AppControl is used to perform a specific task when the alarm is triggered. - /// An alarm instance is created with the set param values. - /// Thrown in case of an invalid parameter. - /// Thrown in case of a permission denied. - /// Thrown in case of any internal error. - /// http://tizen.org/privilege/alarm.set - public static Alarm CreateAlarm(int delay, int period, AppControl appControl) - { - Alarm alarm = null; - int alarmId; - SafeAppControlHandle handle = (appControl == null) ? null : appControl.SafeAppControlHandle; - AlarmError ret = (AlarmError)Interop.Alarm.CreateAlarmAfterDelay(handle, delay, period, out alarmId); - alarm = new Alarm(alarmId); - if (ret != AlarmError.None) - { - throw AlarmErrorFactory.GetException(ret, "Failed to create Alarm"); - } - - return alarm; - } - - /// - /// Sets an alarm to be triggered after a specific time. - /// The alarm will go off delay seconds later. - /// - /// The amount of time before the execution (in seconds). - /// The destination AppControl to perform a specific task when the alarm is triggered. - /// An alarm instance is created with the set param values. - /// Thrown in case of an invalid parameter. - /// Thrown in case of a permission denied. - /// Thrown in case of any internal error. - /// http://tizen.org/privilege/alarm.set - public static Alarm CreateAlarm(int delay, AppControl appControl) - { - Alarm alarm = null; - int alarmId; - AlarmError ret = (AlarmError)Interop.Alarm.CreateAlarmOnceAfterDelay(appControl.SafeAppControlHandle, delay, out alarmId); - alarm = new Alarm(alarmId); - if (ret != AlarmError.None) - { - throw AlarmErrorFactory.GetException(ret, "Failed to create Alarm"); - } - - return alarm; - } - - /// - /// Sets an alarm to be triggered at a specific time. - /// The date describes the time of the first occurrence. - /// - /// The first active alarm time. - /// The destination AppControl to perform specific work when the alarm is triggered. - /// An alarm instance is created with the set param values. - /// This operation is permitted with the UI application appcontrol only. - /// Thrown in case of an invalid parameter. - /// Thrown in case of a permission denied. - /// Thrown in case of any internal error. - /// http://tizen.org/privilege/alarm.set - public static Alarm CreateAlarm(DateTime value, AppControl appControl) - { - Alarm alarm = null; - int alarmId; - Interop.Alarm.DateTime time = ConvertDateTimeToStruct(value); - AlarmError ret = (AlarmError)Interop.Alarm.CreateAlarmOnceAtDate(appControl.SafeAppControlHandle, ref time, out alarmId); - alarm = new Alarm(alarmId); - if (ret != AlarmError.None) - { - throw AlarmErrorFactory.GetException(ret, "Failed to create Alarm"); - } - - return alarm; - } - - /// - /// Sets an alarm to be triggered periodically, starting at a specific time. - /// The date describes the time of the first occurrence. - /// The weekFlag is the repeat value of the days of the week. - /// If the weekFlag is AlarmWeekFlag.Tuesday, the alarm will repeat every Tuesday at a specific time. - /// - /// This operation is permitted with UI application appcontrol only. - /// The first active alarm time. - /// The day of the week, AlarmWeekFlag may be a combination of days, like AlarmWeekFlag.Sunday | AlarmWeekFlag.Monday. - /// The destination AppControl to perform specific work when the alarm is triggered. - /// An alarm instance is created with the set param values. - /// Thrown in case of an invalid parameter. - /// Thrown in case of a permission denied. - /// Thrown in case of any internal error. - /// http://tizen.org/privilege/alarm.set - public static Alarm CreateAlarm(DateTime value, AlarmWeekFlag weekFlag, AppControl appControl) - { - Alarm alarm = null; - int alarmId; - Interop.Alarm.DateTime time = ConvertDateTimeToStruct(value); - AlarmError ret = (AlarmError)Interop.Alarm.CreateAlarmRecurWeek(appControl.SafeAppControlHandle, ref time, (int)weekFlag, out alarmId); - alarm = new Alarm(alarmId); - if (ret != AlarmError.None) - { - throw AlarmErrorFactory.GetException(ret, "Failed to create Alarm"); - } - - return alarm; - } - - /// - /// Sets a notification alarm to be triggered at a specific time. - /// The date describes the time of the first occurrence. - /// - /// The first active alarm time. - /// The notification to be posted when the alarm is triggered. - /// An alarm instance is created with the set param values. - /// Thrown in case of an invalid parameter. - /// Thrown in case of a permission denied. - /// Thrown in case of any internal error. - /// http://tizen.org/privilege/alarm.set - /// http://tizen.org/privilege/notification - public static Alarm CreateAlarm(DateTime dateTime, Notification notification) - { - Alarm alarm = null; - int alarmId; - NotificationSafeHandle safeHandle = NotificationManager.MakeNotificationSafeHandle(notification); - Interop.Alarm.DateTime time = ConvertDateTimeToStruct(dateTime); - AlarmError ret = Interop.Alarm.CreateAlarmNotiOnceAtDate(safeHandle, ref time, out alarmId); - if (ret != AlarmError.None) - { - throw AlarmErrorFactory.GetException(ret, "Failed to create Alarm"); - } - - alarm = new Alarm(alarmId); - - return alarm; - } - - /// - /// Sets a notification alarm to be triggered after a specific time. - /// The alarm will first go off delay seconds later and then will go off every certain amount of time defined using period seconds. - /// - /// The amount of time before the first execution (in seconds). - /// The amount of time between subsequent alarms (in seconds). This value does not guarantee the accuracy. - /// The notification to be posted when the alarm is triggered. - /// An alarm instance is created with the set param values. - /// Thrown in case of an invalid parameter. - /// Thrown in case of a permission denied. - /// Thrown in case of any internal error. - /// http://tizen.org/privilege/alarm.set - /// http://tizen.org/privilege/notification - public static Alarm CreateAlarm(int delay, int period, Notification notification) - { - Alarm alarm = null; - int alarmId; - NotificationSafeHandle safeHandle = NotificationManager.MakeNotificationSafeHandle(notification); - AlarmError ret = Interop.Alarm.CreateAlarmNotiAfterDelay(safeHandle, delay, period, out alarmId); - if (ret != AlarmError.None) - { - throw AlarmErrorFactory.GetException(ret, "Failed to create Alarm"); - } - - alarm = new Alarm(alarmId); - - return alarm; - } - - /// - /// Sets a notification alarm to be triggered periodically, starting at a specific time. - /// The date describes the time of the first occurrence. - /// The weekFlag is the repeat value of the days of the week. - /// If the weekFlag is AlarmWeekFlag.Tuesday, the alarm will repeat every Tuesday at a specific time. - /// - /// The first active alarm time. - /// The day of the week, AlarmWeekFlag may be a combination of days, - /// like AlarmWeekFlag.Sunday | AlarmWeekFlag.Monday. - /// The notification to be posted when the alarm is triggered. - /// An alarm instance is created with the set param values. - /// Thrown in case of an invalid parameter. - /// Thrown in case of a permission denied. - /// Thrown in case of any internal error. - /// http://tizen.org/privilege/alarm.set - /// http://tizen.org/privilege/notification - public static Alarm CreateAlarm(DateTime dateTime, AlarmWeekFlag weekFlag, Notification notification) - { - Alarm alarm = null; - int alarmId; - NotificationSafeHandle safeHandle = NotificationManager.MakeNotificationSafeHandle(notification); - Interop.Alarm.DateTime time = ConvertDateTimeToStruct(dateTime); - AlarmError ret = Interop.Alarm.CreateAlarmNotiRecurWeek(safeHandle, ref time, (int)weekFlag, out alarmId); - if (ret != AlarmError.None) - { - throw AlarmErrorFactory.GetException(ret, "Failed to create Alarm"); - } - - alarm = new Alarm(alarmId); - - return alarm; - } - - /// - /// Sets a notification alarm to be triggered after a specific time. - /// The alarm will go off delay seconds later. - /// - /// The amount of time before the first execution (in seconds). - /// The notification to be posted when the alarm is triggered. - /// An alarm instance is created with the set param values. - /// Thrown in case of an invalid parameter. - /// Thrown in case of a permission denied. - /// Thrown in case of any internal error. - /// http://tizen.org/privilege/alarm.set - /// http://tizen.org/privilege/notification - public static Alarm CreateAlarm(int delay, Notification notification) - { - Alarm alarm = null; - int alarmId; - NotificationSafeHandle safeHandle = NotificationManager.MakeNotificationSafeHandle(notification); - AlarmError ret = Interop.Alarm.CreateAlarmNotiOnceAfterDelay(safeHandle, delay, out alarmId); - if (ret != AlarmError.None) - { - throw AlarmErrorFactory.GetException(ret, "Failed to create Alarm"); - } - - alarm = new Alarm(alarmId); - - return alarm; - } - - /// - /// Cancels all scheduled alarms that are registered by the application that calls this API. - /// - /// Thrown in case of a permission denied. - /// Thrown in case of any internal error. - /// http://tizen.org/privilege/alarm.set - public static void CancelAll() - { - AlarmError ret = (AlarmError)Interop.Alarm.CancelAllAlarms(); - if (ret != AlarmError.None) - { - throw AlarmErrorFactory.GetException(ret, "Failed to cancel Alarms"); - } - } - - /// - /// Retrieves all registered alarms. - /// - /// List of all alarm instances. - /// Thrown in case of a permission denied. - /// Thrown in case of any internal error. - /// http://tizen.org/privilege/alarm.get - public static IEnumerable GetAllScheduledAlarms() - { - List alarms = new List(); - Interop.Alarm.RegisteredAlarmCallback callback = (int alarmId, IntPtr userData) => - { - alarms.Add(new Alarm(alarmId)); - return true; - }; - - AlarmError ret = (AlarmError)Interop.Alarm.GetAllRegisteredAlarms(callback, IntPtr.Zero); - if (ret != AlarmError.None) - { - throw AlarmErrorFactory.GetException(ret, "Failed to get Alarms"); - } - - return alarms; - } - - /// - /// Gets the current system time. - /// - /// The current system time. - /// Thrown in case of any internal error. - public static DateTime GetCurrentTime() - { - DateTime time; - Interop.Alarm.DateTime value; - AlarmError ret = (AlarmError)Interop.Alarm.GetCurrentTime(out value); - if (ret != AlarmError.None) - { - throw AlarmErrorFactory.GetException(ret, "Failed to get Currenttime"); - } - else - { - - time = ConvertIntPtrToDateTime(value); - } - - return time; - } - - } -} diff --git a/src/Tizen.Applications.AttachPanel/Interop/Interop.AttachPanel.cs b/src/Tizen.Applications.AttachPanel/Interop/Interop.AttachPanel.cs deleted file mode 100755 index 37181917e..000000000 --- a/src/Tizen.Applications.AttachPanel/Interop/Interop.AttachPanel.cs +++ /dev/null @@ -1,71 +0,0 @@ -using System; -using System.Runtime.InteropServices; -using Tizen.Applications; - -internal static partial class Interop -{ - internal static partial class AttachPanel - { - internal enum ErrorCode : int - { - None = Tizen.Internals.Errors.ErrorCode.None, - InvalidParameter = Tizen.Internals.Errors.ErrorCode.InvalidParameter, - OutOfMemory = Tizen.Internals.Errors.ErrorCode.OutOfMemory, - PermissionDenied = Tizen.Internals.Errors.ErrorCode.PermissionDenied, - AlreadyExists = -0x02850000 | 0x01, - NotInitialized = -0x02850000 | 0x02, - UnsupportedContentCategory = -0x02850000 | 0x03, - AlreadyDestroyed = -0x02850000 | 0x05, - } - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void AttachPanelEventCallback(IntPtr attachPanel, int eventType, IntPtr eventInfo, IntPtr userData); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void AttachPanelResultCallback(IntPtr attachPanel, int category, IntPtr result, int resultCode, IntPtr userData); - - [DllImport(Libraries.AttachPanel, EntryPoint = "attach_panel_create")] - internal static extern ErrorCode CreateAttachPanel(IntPtr conform, ref IntPtr attach_panel); - - [DllImport(Libraries.AttachPanel, EntryPoint = "attach_panel_destroy")] - internal static extern ErrorCode DestroyAttachPanel(IntPtr attach_panel); - - [DllImport(Libraries.AttachPanel, EntryPoint = "attach_panel_add_content_category")] - internal static extern ErrorCode AddCategory(IntPtr attach_panel, int content_category, IntPtr extraData); - - [DllImport(Libraries.AttachPanel, EntryPoint = "attach_panel_remove_content_category")] - internal static extern ErrorCode RemoveCategory(IntPtr attach_panel, int content_category); - - [DllImport(Libraries.AttachPanel, EntryPoint = "attach_panel_set_extra_data")] - internal static extern ErrorCode SetExtraData(IntPtr attach_panel, int content_category, IntPtr extraData); - - [DllImport(Libraries.AttachPanel, EntryPoint = "attach_panel_set_result_cb")] - internal static extern ErrorCode SetResultCb(IntPtr attach_panel, AttachPanelResultCallback callback, IntPtr userData); - - [DllImport(Libraries.AttachPanel, EntryPoint = "attach_panel_unset_result_cb")] - internal static extern ErrorCode UnsetResultCb(IntPtr attach_panel); - - [DllImport(Libraries.AttachPanel, EntryPoint = "attach_panel_set_event_cb")] - internal static extern ErrorCode SetEventCb(IntPtr attach_panel, AttachPanelEventCallback callback, IntPtr userData); - - [DllImport(Libraries.AttachPanel, EntryPoint = "attach_panel_unset_event_cb")] - internal static extern ErrorCode UnsetEventCb(IntPtr attach_panel); - - [DllImport(Libraries.AttachPanel, EntryPoint = "attach_panel_show")] - internal static extern ErrorCode Show(IntPtr attach_panel); - - [DllImport(Libraries.AttachPanel, EntryPoint = "attach_panel_show_without_animation")] - internal static extern ErrorCode ShowWithoutAnimation(IntPtr attach_panel); - - [DllImport(Libraries.AttachPanel, EntryPoint = "attach_panel_hide")] - internal static extern ErrorCode Hide(IntPtr attach_panel); - - [DllImport(Libraries.AttachPanel, EntryPoint = "attach_panel_hide_without_animation")] - internal static extern ErrorCode HideWithoutAnimation(IntPtr attach_panel); - - [DllImport(Libraries.AttachPanel, EntryPoint = "attach_panel_get_visibility")] - internal static extern ErrorCode GetVisibility(IntPtr attach_panel, out int visible); - - [DllImport(Libraries.AttachPanel, EntryPoint = "attach_panel_get_state")] - internal static extern ErrorCode GetState(IntPtr attach_panel, out int state); - } -} \ No newline at end of file diff --git a/src/Tizen.Applications.AttachPanel/Interop/Interop.Libraries.cs b/src/Tizen.Applications.AttachPanel/Interop/Interop.Libraries.cs deleted file mode 100755 index 4b4049b13..000000000 --- a/src/Tizen.Applications.AttachPanel/Interop/Interop.Libraries.cs +++ /dev/null @@ -1,7 +0,0 @@ -internal static partial class Interop -{ - internal static partial class Libraries - { - public const string AttachPanel = "libattach-panel.so.0.1.0"; - } -} diff --git a/src/Tizen.Applications.AttachPanel/Tizen.Applications.AttachPanel.csproj b/src/Tizen.Applications.AttachPanel/Tizen.Applications.AttachPanel.csproj deleted file mode 100755 index 020b2cb3d..000000000 --- a/src/Tizen.Applications.AttachPanel/Tizen.Applications.AttachPanel.csproj +++ /dev/null @@ -1,11 +0,0 @@ - - - - netstandard2.0 - - - - - - - diff --git a/src/Tizen.Applications.AttachPanel/Tizen.Applications.AttachPanel.sln b/src/Tizen.Applications.AttachPanel/Tizen.Applications.AttachPanel.sln deleted file mode 100755 index 8eeff18ca..000000000 --- a/src/Tizen.Applications.AttachPanel/Tizen.Applications.AttachPanel.sln +++ /dev/null @@ -1,40 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26430.12 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Applications.AttachPanel", "Tizen.Applications.AttachPanel.csproj", "{C8C93D46-CACE-4BF1-8B50-6A6A00967045}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Applications.Common", "..\Tizen.Applications.Common\Tizen.Applications.Common.csproj", "{D2B5F854-4FE1-473C-A8E3-53ABB0A966AA}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen", "..\Tizen\Tizen.csproj", "{B01C1F2E-18E2-4DDE-8B7E-6642F0730A7F}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Log", "..\Tizen.Log\Tizen.Log.csproj", "{AFF3D5BA-42DA-40CE-BC57-0DC1E92673B9}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {C8C93D46-CACE-4BF1-8B50-6A6A00967045}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C8C93D46-CACE-4BF1-8B50-6A6A00967045}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C8C93D46-CACE-4BF1-8B50-6A6A00967045}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C8C93D46-CACE-4BF1-8B50-6A6A00967045}.Release|Any CPU.Build.0 = Release|Any CPU - {D2B5F854-4FE1-473C-A8E3-53ABB0A966AA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D2B5F854-4FE1-473C-A8E3-53ABB0A966AA}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D2B5F854-4FE1-473C-A8E3-53ABB0A966AA}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D2B5F854-4FE1-473C-A8E3-53ABB0A966AA}.Release|Any CPU.Build.0 = Release|Any CPU - {B01C1F2E-18E2-4DDE-8B7E-6642F0730A7F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B01C1F2E-18E2-4DDE-8B7E-6642F0730A7F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B01C1F2E-18E2-4DDE-8B7E-6642F0730A7F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B01C1F2E-18E2-4DDE-8B7E-6642F0730A7F}.Release|Any CPU.Build.0 = Release|Any CPU - {AFF3D5BA-42DA-40CE-BC57-0DC1E92673B9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {AFF3D5BA-42DA-40CE-BC57-0DC1E92673B9}.Debug|Any CPU.Build.0 = Debug|Any CPU - {AFF3D5BA-42DA-40CE-BC57-0DC1E92673B9}.Release|Any CPU.ActiveCfg = Release|Any CPU - {AFF3D5BA-42DA-40CE-BC57-0DC1E92673B9}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/src/Tizen.Applications.AttachPanel/Tizen.Applications.AttachPanel/AttachPanel.cs b/src/Tizen.Applications.AttachPanel/Tizen.Applications.AttachPanel/AttachPanel.cs deleted file mode 100755 index bd403f08b..000000000 --- a/src/Tizen.Applications.AttachPanel/Tizen.Applications.AttachPanel/AttachPanel.cs +++ /dev/null @@ -1,263 +0,0 @@ -using System; - -namespace Tizen.Applications.AttachPanel -{ - /// - /// Represents immutable class for attach panel. - /// - public partial class AttachPanel - { - /// - /// Represents immutable class for attach panel. - /// - /// 3 - /// The caller's conformant - /// Thrown when an attempt to allocate memory fails. - /// Thrown when the AttachPanel is already exist or the is not a conformant object - public AttachPanel(IntPtr conformant) - { - if (conformant == IntPtr.Zero) - { - throw new ArgumentNullException("Use the value property, not null value"); - } - IntPtr candidateAttachPanel = new IntPtr(); - Interop.AttachPanel.ErrorCode err = Interop.AttachPanel.CreateAttachPanel(conformant, ref candidateAttachPanel); - checkException(err); - - Tizen.Log.Debug("AttachPanelSharp", "Success to create an AttachPanel Instance"); - isCreationSucceed = true; - _attachPanel = candidateAttachPanel; - - if (_eventEventHandler == null) - { - StateEventListenStart(); - } - - if (_resultEventHandler == null) - { - ResultEventListenStart(); - } - } - - ~AttachPanel() - { - if (isCreationSucceed && - _attachPanel != IntPtr.Zero) - { - Interop.AttachPanel.ErrorCode err = Interop.AttachPanel.DestroyAttachPanel(_attachPanel); - checkException(err); - _attachPanel = IntPtr.Zero; - } - } - - /// - /// Gets the state of the AttachPanel. - /// - /// The AttachPanel window state - public int State - { - get - { - int state; - Interop.AttachPanel.ErrorCode err = Interop.AttachPanel.GetState(_attachPanel, out state); - checkException(err); - return state; - } - } - - /// - /// Gets the value that indicates whether the AttachPanel is visible. - /// - /// visible value of AttachPanel state - public int Visible - { - get - { - int visible; - Interop.AttachPanel.ErrorCode err = Interop.AttachPanel.GetVisibility(_attachPanel, out visible); - checkException(err); - return visible; - } - } - - /// - /// Add a content category in the AttachPanel. - /// - /// The ContentCategory to be added in the AttachPanel - /// The AttachPanel send some information using Bundle - /// http://tizen.org/privilege/mediastorage - /// http://tizen.org/privilege/camera - /// http://tizen.org/privilege/recorder - /// http://tizen.org/privilege/appmanager.launch - /// http://tizen.org/feature/camera - /// http://tizen.org/feature/microphone - /// - /// The caller app has to check the return value of this function. - /// Content categories will be shown as the sequence of using AddCategory - /// Some contents need time to load it all. - /// So, it is needed to use this before the mainloop of Show - /// Privileges, - /// http://tizen.org/privilege/mediastorage, for using Image or Camera - /// http://tizen.org/privilege/camera, for using Camera or TakePicture - /// http://tizen.org/privilege/recorder, for using Voice - /// http://tizen.org/privilege/appmanager.launch, for adding content categories on the More tab - /// http://tizen.org/feature/camera, for using Camera or TakePicture - /// http://tizen.org/feature/microphone, for using Voice - /// Deliver more information to the callee with a bundle if you need. - /// http://tizen.org/appcontrol/data/total_count - /// http://tizen.org/appcontrol/data/total_size - /// - /// Thrown when the is not a valid category - /// Thrown when application does not have privilege to access this method - /// Thrown when the device does not supported the feature - /// Thrown when the AttachPanel is not created yet or already destroyed - public void AddCategory(ContentCategory category, Bundle extraData) - { - IntPtr bundle = IntPtr.Zero; - if (extraData != null) - { - bundle = extraData.SafeBundleHandle.DangerousGetHandle(); - } - Interop.AttachPanel.ErrorCode err = Interop.AttachPanel.AddCategory(_attachPanel, (int)category, bundle); - checkException(err); - } - - /// - /// Removes the ContentCategory from the AttachPanel - /// - /// The ContentCategory adding in the AttachPanel - /// Thrown when the is not a valid category - /// Thrown when the AttachPanel is not created yet or already destroyed - public void RemoveCategory(ContentCategory category) - { - Interop.AttachPanel.ErrorCode err = Interop.AttachPanel.RemoveCategory(_attachPanel, (int)category); - checkException(err); - } - - /// - /// Sets extraData to send to the ContentCategory using a Bundle - /// - /// The ContentCategory that some information to be set in the AttachPanel. - /// The AttachPanel send some information using Bundle - /// Thrown when the is not a valid category - /// Thrown when the AttachPanel is destroyed - /// Thrown when an attempt to allocate memory fails. - public void SetExtraData(ContentCategory category, Bundle extraData) - { - if(extraData == null) - { - checkException(Interop.AttachPanel.ErrorCode.InvalidParameter); - } - - IntPtr bundle = IntPtr.Zero; - if (extraData != null) - { - bundle = extraData.SafeBundleHandle.DangerousGetHandle(); - } - Interop.AttachPanel.ErrorCode err = Interop.AttachPanel.SetExtraData(_attachPanel, (int)category, bundle); - checkException(err); - } - - /// - /// Shows the attach panel with animations - /// - /// Thrown when the AttachPanel is destroyed - public void Show() - { - Interop.AttachPanel.ErrorCode err = Interop.AttachPanel.Show(_attachPanel); - checkException(err); - } - - /// - /// Shows the attach panel and selects whether or not to animate - /// - /// Thrown when the AttachPanel is destroyed - public void Show(bool animation) - { - if (animation) - { - Interop.AttachPanel.ErrorCode err = Interop.AttachPanel.Show(_attachPanel); - checkException(err); - } - else - { - Interop.AttachPanel.ErrorCode err = Interop.AttachPanel.ShowWithoutAnimation(_attachPanel); - checkException(err); - } - } - - /// - /// Hides the attach panel with animations - /// - /// Thrown when the AttachPanel is destroyed - public void Hide() - { - Interop.AttachPanel.ErrorCode err = Interop.AttachPanel.Hide(_attachPanel); - checkException(err); - } - - /// - /// Hides the attach panel and selects whether or not to animate - /// - /// Thrown when the AttachPanel is destroyed - public void Hide(bool animation) - { - if (animation) - { - Interop.AttachPanel.ErrorCode err = Interop.AttachPanel.Hide(_attachPanel); - checkException(err); - } - else - { - Interop.AttachPanel.ErrorCode err = Interop.AttachPanel.HideWithoutAnimation(_attachPanel); - checkException(err); - } - } - - /// - /// Occurs when reserved events are published from the panel-side. - /// - public event EventHandler EventChanged - { - add - { - if (_eventEventHandler == null) - { - StateEventListenStart(); - } - _eventEventHandler += value; - } - remove - { - _eventEventHandler -= value; - if (_eventEventHandler == null) - { - StateEventListenStop(); - } - } - } - - /// - /// Occurs when an user selects and confirms something to attach in the AttachPanel - /// - public event EventHandler ResultCallback - { - add - { - if (_resultEventHandler == null) - { - ResultEventListenStart(); - } - _resultEventHandler += value; - } - remove - { - _resultEventHandler -= value; - if (_resultEventHandler == null) - { - ResultEventListenStop(); - } - } - } - } -} diff --git a/src/Tizen.Applications.AttachPanel/Tizen.Applications.AttachPanel/AttachPanelInternal.cs b/src/Tizen.Applications.AttachPanel/Tizen.Applications.AttachPanel/AttachPanelInternal.cs deleted file mode 100755 index e40af2de3..000000000 --- a/src/Tizen.Applications.AttachPanel/Tizen.Applications.AttachPanel/AttachPanelInternal.cs +++ /dev/null @@ -1,76 +0,0 @@ -using System; -using System.Collections.Generic; - -namespace Tizen.Applications.AttachPanel -{ - public partial class AttachPanel - { - private static IntPtr _attachPanel; - private bool isCreationSucceed; - - private static event EventHandler _eventEventHandler; - private static event EventHandler _resultEventHandler; - - private static Interop.AttachPanel.AttachPanelEventCallback SetEventListener; - private static Interop.AttachPanel.AttachPanelResultCallback SetResultListener; - - private void StateEventListenStart() - { - Interop.AttachPanel.ErrorCode err = 0; - - SetEventListener = (attachPanel, eventType, eventInfo, userData) => - { - _eventEventHandler?.Invoke(null, new StateEventArgs(attachPanel, (EventType)eventType, eventInfo, userData)); - }; - err = Interop.AttachPanel.SetEventCb(_attachPanel, SetEventListener, IntPtr.Zero); - checkException(err); - } - private void StateEventListenStop() - { - Interop.AttachPanel.ErrorCode err = 0; - err = Interop.AttachPanel.UnsetEventCb(_attachPanel); - checkException(err); - } - - private void ResultEventListenStart() - { - Interop.AttachPanel.ErrorCode err = 0; - SetResultListener = (attachPanel, category, resulthandler, resultCode, userData) => - { - SafeAppControlHandle handle = new SafeAppControlHandle(resulthandler, false); - AppControl result = new AppControl(handle); - _resultEventHandler?.Invoke(null, new ResultEventArgs(attachPanel, (ContentCategory)category, result, (AppControlReplyResult)resultCode, userData)); - }; - err = Interop.AttachPanel.SetResultCb(_attachPanel, SetResultListener, IntPtr.Zero); - checkException(err); - } - - private void ResultEventListenStop() - { - Interop.AttachPanel.ErrorCode err = 0; - err = Interop.AttachPanel.UnsetResultCb(_attachPanel); - checkException(err); - } - - internal static void checkException(Interop.AttachPanel.ErrorCode err) - { - switch (err) - { - case Interop.AttachPanel.ErrorCode.InvalidParameter: - throw new ArgumentOutOfRangeException("Invalid parameter error at unmanaged code"); - case Interop.AttachPanel.ErrorCode.OutOfMemory: - throw new OutOfMemoryException("Out of Memory"); - case Interop.AttachPanel.ErrorCode.PermissionDenied: - throw new UnauthorizedAccessException(); - case Interop.AttachPanel.ErrorCode.AlreadyExists: - throw new InvalidOperationException("Already Exists"); - case Interop.AttachPanel.ErrorCode.NotInitialized: - throw new InvalidOperationException("Not initialized"); - case Interop.AttachPanel.ErrorCode.UnsupportedContentCategory: - throw new NotSupportedException("Unsupported Content Category"); - case Interop.AttachPanel.ErrorCode.AlreadyDestroyed: - throw new InvalidOperationException("Already Destroyed"); - } - } - } -} diff --git a/src/Tizen.Applications.AttachPanel/Tizen.Applications.AttachPanel/ContentCategory.cs b/src/Tizen.Applications.AttachPanel/Tizen.Applications.AttachPanel/ContentCategory.cs deleted file mode 100755 index e86b9eac7..000000000 --- a/src/Tizen.Applications.AttachPanel/Tizen.Applications.AttachPanel/ContentCategory.cs +++ /dev/null @@ -1,57 +0,0 @@ -namespace Tizen.Applications.AttachPanel -{ - /// - /// Enumeration for the attach panel content category. - /// - public enum ContentCategory - { - /// - /// Attaching images from the gallery - /// - Image = 1, - /// - /// Taking pictures to attach - /// - Camera, - /// - /// Taking a voice clip to attach - /// - Voice, - /// - /// Attaching video from the gallery - /// - Video, - /// - /// Attaching audio from my files - /// - Audio, - /// - /// Attaching calendar data from the calendar - /// - Calendar, - /// - /// Attaching contact data from the contacts - /// - Contact, - /// - /// Attaching files data from my files - /// - Myfiles, - /// - /// Taking a video clip to attach - /// - VideoRecorder, - /// - /// Attaching files from the document list - /// - Document, - /// - /// Launching apps to take pictures will be attached - /// - TakePicture, - /// - /// Attaching memo data from the memo - /// - Memo, - } -} diff --git a/src/Tizen.Applications.AttachPanel/Tizen.Applications.AttachPanel/EventType.cs b/src/Tizen.Applications.AttachPanel/Tizen.Applications.AttachPanel/EventType.cs deleted file mode 100755 index dc460a1c3..000000000 --- a/src/Tizen.Applications.AttachPanel/Tizen.Applications.AttachPanel/EventType.cs +++ /dev/null @@ -1,25 +0,0 @@ -namespace Tizen.Applications.AttachPanel -{ - /// - /// Enumeration for the attach panel event. - /// - public enum EventType - { - /// - /// Attach panel starts the effect to show - /// - ShowStart = 1, - /// - /// Attach panel finishes the effect to show - /// - ShowFinish, - /// - /// Attach panel starts the effect to hide the panel - /// - HideStart, - /// - /// Attach panel finishes the effect to hide the panel - /// - HideFinish, - } -} diff --git a/src/Tizen.Applications.AttachPanel/Tizen.Applications.AttachPanel/ResultEventArgs.cs b/src/Tizen.Applications.AttachPanel/Tizen.Applications.AttachPanel/ResultEventArgs.cs deleted file mode 100755 index 6628b9d90..000000000 --- a/src/Tizen.Applications.AttachPanel/Tizen.Applications.AttachPanel/ResultEventArgs.cs +++ /dev/null @@ -1,51 +0,0 @@ -using System; - -namespace Tizen.Applications.AttachPanel -{ - /// - /// Class for event arguments of the result event - /// - public class ResultEventArgs : EventArgs - { - private readonly IntPtr _attachPanel; - private readonly ContentCategory _category; - private readonly AppControl _result; - private readonly AppControlReplyResult _resultCode; - private readonly IntPtr _userData; - - internal ResultEventArgs(IntPtr attachPanel, ContentCategory category, AppControl result, AppControlReplyResult resultCode, IntPtr userData) - { - _attachPanel = attachPanel; - _category = category; - _result = result; - _resultCode = resultCode; - _userData = userData; - } - - /// - /// Property for attach panel object. - /// - public IntPtr AttachPanel { get { return _attachPanel; } } - - /// - /// Results are from the content category. - /// - public ContentCategory Category { get { return _category; } } - - /// - /// Property for result - /// The caller app has to use ExtraData property to get received data. - /// - public AppControl Result { get { return _result; } } - - /// - /// Property for result of AppControl - /// - public AppControlReplyResult ResultCode { get { return _resultCode; } } - - /// - /// Property for user data - /// - public IntPtr UserData { get { return _userData; } } - } -} diff --git a/src/Tizen.Applications.AttachPanel/Tizen.Applications.AttachPanel/StateEventArgs.cs b/src/Tizen.Applications.AttachPanel/Tizen.Applications.AttachPanel/StateEventArgs.cs deleted file mode 100755 index 5354c5fd3..000000000 --- a/src/Tizen.Applications.AttachPanel/Tizen.Applications.AttachPanel/StateEventArgs.cs +++ /dev/null @@ -1,44 +0,0 @@ -using System; - -namespace Tizen.Applications.AttachPanel -{ - /// - /// Class for event arguments of the state event - /// - public class StateEventArgs : EventArgs - { - private readonly IntPtr _attachPanel; - private readonly EventType _eventType; - private readonly IntPtr _eventInfo; - private readonly IntPtr _userData; - - internal StateEventArgs(IntPtr attachPanel, EventType eventType, IntPtr eventInfo, IntPtr userData) - { - _attachPanel = attachPanel; - _eventType = eventType; - _eventInfo = eventInfo; - _userData = userData; - } - - /// - /// Property for attach panel object - /// - public IntPtr AttachPanel { get { return _attachPanel; } } - - /// - /// Property for event type. - /// - public EventType EventType { get { return _eventType; } } - - /// - /// Additional event information. - /// This can be NULL if there are no necessary information. - /// - public IntPtr EventInfo { get { return _eventInfo; } } - - /// - /// Property for user data. - /// - public IntPtr UserData { get { return _userData; } } - } -} diff --git a/src/Tizen.Applications.AttachPanel/Tizen.Applications.AttachPanel/StateType.cs b/src/Tizen.Applications.AttachPanel/Tizen.Applications.AttachPanel/StateType.cs deleted file mode 100755 index a2474dbf1..000000000 --- a/src/Tizen.Applications.AttachPanel/Tizen.Applications.AttachPanel/StateType.cs +++ /dev/null @@ -1,21 +0,0 @@ -namespace Tizen.Applications.AttachPanel -{ - /// - /// Enumeration for the attach panel's window state. - /// - public enum StateType - { - /// - /// Attach panel is not visible - /// - Hidden = 0, - /// - /// Attach panel is in partial window mode - /// - Partial, - /// - /// Attach panel is in full screen mode - /// - Full, - } -} \ No newline at end of file diff --git a/src/Tizen.Applications.Badge/GlobalSuppressions.cs b/src/Tizen.Applications.Badge/GlobalSuppressions.cs deleted file mode 100755 index 9d7425338..000000000 Binary files a/src/Tizen.Applications.Badge/GlobalSuppressions.cs and /dev/null differ diff --git a/src/Tizen.Applications.Badge/Interop/Interop.Badge.cs b/src/Tizen.Applications.Badge/Interop/Interop.Badge.cs deleted file mode 100755 index 53b1b1a28..000000000 --- a/src/Tizen.Applications.Badge/Interop/Interop.Badge.cs +++ /dev/null @@ -1,65 +0,0 @@ -/* - * 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; -using Tizen.Applications; - -internal static partial class Interop -{ - internal static partial class Badge - { - internal enum Action : uint - { - Create = 0, - Remove, - Update, - ChangedDisplay, - ServiceReady - } - - internal delegate void ForeachCallback(string appId, uint count, IntPtr userData); - - internal delegate void ChangedCallback(Action action, string appId, uint count, IntPtr userData); - - [DllImport(Libraries.Badge, EntryPoint = "badge_add")] - internal static extern BadgeError Add(string appId); - - [DllImport(Libraries.Badge, EntryPoint = "badge_remove")] - internal static extern BadgeError Remove(string appId); - - [DllImport(Libraries.Badge, EntryPoint = "badge_set_count")] - internal static extern BadgeError SetCount(string appId, uint count); - - [DllImport(Libraries.Badge, EntryPoint = "badge_get_count")] - internal static extern BadgeError GetCount(string appId, out uint count); - - [DllImport(Libraries.Badge, EntryPoint = "badge_set_display")] - internal static extern BadgeError SetDisplay(string appId, uint isDisplay); - - [DllImport(Libraries.Badge, EntryPoint = "badge_get_display")] - internal static extern BadgeError GetDisplay(string appId, out uint isDisplay); - - [DllImport(Libraries.Badge, EntryPoint = "badge_foreach")] - internal static extern BadgeError Foreach(ForeachCallback callback, IntPtr userData); - - [DllImport(Libraries.Badge, EntryPoint = "badge_register_changed_cb")] - internal static extern BadgeError SetChangedCallback(ChangedCallback callback, IntPtr userData); - - [DllImport(Libraries.Badge, EntryPoint = "badge_unregister_changed_cb")] - internal static extern BadgeError UnsetChangedCallback(ChangedCallback callback); - } -} diff --git a/src/Tizen.Applications.Badge/Interop/Interop.Libraries.cs b/src/Tizen.Applications.Badge/Interop/Interop.Libraries.cs deleted file mode 100755 index 01ccffda2..000000000 --- a/src/Tizen.Applications.Badge/Interop/Interop.Libraries.cs +++ /dev/null @@ -1,23 +0,0 @@ -/* - * 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 Badge = "libbadge.so.0"; - } -} diff --git a/src/Tizen.Applications.Badge/Tizen.Applications.Badge.csproj b/src/Tizen.Applications.Badge/Tizen.Applications.Badge.csproj deleted file mode 100755 index 7f4584ffe..000000000 --- a/src/Tizen.Applications.Badge/Tizen.Applications.Badge.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - netstandard2.0 - - - - - - - - diff --git a/src/Tizen.Applications.Badge/Tizen.Applications.Badge.sln b/src/Tizen.Applications.Badge/Tizen.Applications.Badge.sln deleted file mode 100755 index 461be58d0..000000000 --- a/src/Tizen.Applications.Badge/Tizen.Applications.Badge.sln +++ /dev/null @@ -1,34 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26430.12 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Applications.Badge", "Tizen.Applications.Badge.csproj", "{2BA194AC-736A-4C5F-A41F-1A77B1D5CEA2}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen", "..\Tizen\Tizen.csproj", "{9D519F2A-4853-499F-A479-3440CFAF4701}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Log", "..\Tizen.Log\Tizen.Log.csproj", "{C791221D-31B2-4D62-A149-60BA76E99E11}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {2BA194AC-736A-4C5F-A41F-1A77B1D5CEA2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {2BA194AC-736A-4C5F-A41F-1A77B1D5CEA2}.Debug|Any CPU.Build.0 = Debug|Any CPU - {2BA194AC-736A-4C5F-A41F-1A77B1D5CEA2}.Release|Any CPU.ActiveCfg = Release|Any CPU - {2BA194AC-736A-4C5F-A41F-1A77B1D5CEA2}.Release|Any CPU.Build.0 = Release|Any CPU - {9D519F2A-4853-499F-A479-3440CFAF4701}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {9D519F2A-4853-499F-A479-3440CFAF4701}.Debug|Any CPU.Build.0 = Debug|Any CPU - {9D519F2A-4853-499F-A479-3440CFAF4701}.Release|Any CPU.ActiveCfg = Release|Any CPU - {9D519F2A-4853-499F-A479-3440CFAF4701}.Release|Any CPU.Build.0 = Release|Any CPU - {C791221D-31B2-4D62-A149-60BA76E99E11}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C791221D-31B2-4D62-A149-60BA76E99E11}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C791221D-31B2-4D62-A149-60BA76E99E11}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C791221D-31B2-4D62-A149-60BA76E99E11}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/src/Tizen.Applications.Badge/Tizen.Applications/Badge.cs b/src/Tizen.Applications.Badge/Tizen.Applications/Badge.cs deleted file mode 100755 index 6fc0ebc2a..000000000 --- a/src/Tizen.Applications.Badge/Tizen.Applications/Badge.cs +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright (c) 2016 - 2017 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. - */ - -namespace Tizen.Applications -{ - /// - /// The class containing common properties of the Badge. - /// - public class Badge - { - private int count = 0; - - /// - /// Initializes a new instance of the Badge class. - /// - /// 3 - /// Application ID - /// Count value - /// True if it should be displayed - /// Thrown when failed because of invalid argument - public Badge(string appId, int count = 1, bool visible = true) - { - if (IsNegativeNumber(count)) - { - throw BadgeErrorFactory.GetException(BadgeError.InvalidParameter, "The count must be positive number"); - } - AppId = appId; - this.count = count; - Visible = visible; - } - - /// - /// Property for the count value of the badge. - /// - /// 3 - /// Thrown when set negative number - public int Count - { - get - { - return count; - } - set - { - if (IsNegativeNumber(value)) - { - throw BadgeErrorFactory.GetException(BadgeError.InvalidParameter, "The count must be positive number"); - } - - count = value; - } - } - - /// - /// Property for the application ID of the badge. - /// - /// 3 - public string AppId { get; set; } - - /// - /// Property for display visibility. True if the badge display visible, otherwise false.. - /// - /// 3 - public bool Visible{ get; set; } - - private bool IsNegativeNumber(int number) - { - return number < 0; - } - } -} diff --git a/src/Tizen.Applications.Badge/Tizen.Applications/BadgeControl.cs b/src/Tizen.Applications.Badge/Tizen.Applications/BadgeControl.cs deleted file mode 100755 index 3c5b60ee2..000000000 --- a/src/Tizen.Applications.Badge/Tizen.Applications/BadgeControl.cs +++ /dev/null @@ -1,298 +0,0 @@ -/* - * Copyright (c) 2016 - 2017 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. - */ - -namespace Tizen.Applications -{ - using System; - using System.Collections.Generic; - /// - /// The class for badge operation. - /// - public static class BadgeControl - { - private static event EventHandler s_changed; - private static bool s_registered = false; - private static Interop.Badge.ChangedCallback s_callback; - - /// - /// Event handler for receiving badge events. - /// - /// 3 - /// http://tizen.org/feature/badge - /// http://tizen.org/privilege/notification - /// Thrown in case of failed conditions. - /// Thrown when an application does not have the privilege to access. - /// Thrown when Badge is not supported. - public static event EventHandler Changed - { - add - { - if (s_changed == null && !s_registered) - { - if (s_callback == null) - { - s_callback = new Interop.Badge.ChangedCallback(OnChangedEvent); - } - - BadgeError err = Interop.Badge.SetChangedCallback(s_callback, IntPtr.Zero); - if (err != BadgeError.None) - { - throw BadgeErrorFactory.GetException(err, "Failed to add event handler"); - } - - s_registered = true; - } - - s_changed += value; - } - remove - { - s_changed -= value; - if (s_changed == null && s_registered) - { - BadgeError err = Interop.Badge.UnsetChangedCallback(s_callback); - if (err != BadgeError.None) - { - throw BadgeErrorFactory.GetException(err, "Failed to remove event handler"); - } - - s_callback = null; - s_registered = false; - } - } - } - - /// - /// Gets the badge information from the application ID. - /// - /// 3 - /// Application ID. - /// The Badge object with inputted application ID - /// http://tizen.org/feature/badge - /// http://tizen.org/privilege/notification - /// Thrown when failed because of an invalid argument. - /// Thrown when an application does not have the privilege to access. - /// Thrown in case of failed conditions. - /// Thrown when Badge is not supported. - public static Badge Find(string appId) - { - uint count; - uint display; - - BadgeError err = Interop.Badge.GetCount(appId, out count); - if (err != BadgeError.None) - { - throw BadgeErrorFactory.GetException(err, "Failed to find badge count of " + appId); - } - - err = Interop.Badge.GetDisplay(appId, out display); - if (err != BadgeError.None) - { - throw BadgeErrorFactory.GetException(err, "Failed to find badge display of " + appId); - } - - return new Badge(appId, (int)count, display == 0 ? false : true); - } - - /// - /// Removes the badge information. - /// - /// 3 - /// Application ID. - /// http://tizen.org/feature/badge - /// http://tizen.org/privilege/notification - /// Thrown when failed because of a an invalid argument. - /// Thrown when an application does not have the privilege to access. - /// Thrown in case of failed conditions. - /// Thrown when Badge is not supported. - public static void Remove(string appId) - { - BadgeError err = Interop.Badge.Remove(appId); - if (err != BadgeError.None) - { - throw BadgeErrorFactory.GetException(err, "Failed to Remove badge of " + appId); - } - } - - /// - /// Removes the badge information. - /// - /// 3 - /// The Badge object. - /// http://tizen.org/feature/badge - /// http://tizen.org/privilege/notification - /// Thrown when failed because of an invalid argument. - /// Thrown when an application does not have the privilege to access. - /// Thrown in case of failed conditions. - /// Thrown when Badge is not supported. - public static void Remove(Badge badge) - { - if (badge == null) - { - throw BadgeErrorFactory.GetException(BadgeError.InvalidParameter, "Invalid Badge object"); - } - - Remove(badge.AppId); - } - - /// - /// Adds the badge information. - /// - /// 3 - /// The Badge object. - /// http://tizen.org/feature/badge - /// http://tizen.org/privilege/notification - /// Thrown when failed because of an invalid argument. - /// Thrown when an application does not have the privilege to access. - /// Thrown in case of failed conditions. - /// Thrown when Badge is not supported. - public static void Add(Badge badge) - { - if (badge == null) - { - throw BadgeErrorFactory.GetException(BadgeError.InvalidParameter, "Invalid Badge object"); - } - - BadgeError err = Interop.Badge.Add(badge.AppId); - if (err != BadgeError.None) - { - throw BadgeErrorFactory.GetException(err, "Failed to add badge of " + badge.AppId); - } - - try - { - Update(badge); - } - catch (Exception e) - { - Remove(badge.AppId); - throw e; - } - } - - /// - /// Updates the badge information. - /// - /// 3 - /// The Badge object. - /// http://tizen.org/feature/badge - /// http://tizen.org/privilege/notification - /// Thrown when failed because of an invalid argument. - /// Thrown when an application does not have the privilege to access. - /// Thrown in case of failed conditions. - /// Thrown when Badge is not supported. - public static void Update(Badge badge) - { - if (badge == null) - { - throw BadgeErrorFactory.GetException(BadgeError.InvalidParameter, "Invalid Badge object"); - } - - BadgeError err = Interop.Badge.SetCount(badge.AppId, (uint)badge.Count); - if (err != BadgeError.None) - { - throw BadgeErrorFactory.GetException(err, "Failed to update badge of " + badge.AppId); - } - - err = Interop.Badge.SetDisplay(badge.AppId, badge.Visible ? 1U : 0U); - if (err != BadgeError.None) - { - throw BadgeErrorFactory.GetException(err, "Failed to update badge of " + badge.AppId); - } - } - - /// - /// Gets all the badge information. - /// - /// 3 - /// List of all Badge instances. - /// http://tizen.org/feature/badge - /// http://tizen.org/privilege/notification - /// Thrown when an application does not have the privilege to access. - /// Thrown in case of failed conditions. - /// Thrown when Badge is not supported. - public static IEnumerable GetBadges() - { - IList list = new List(); - - BadgeError err = Interop.Badge.Foreach((appId, count, userData) => - { - uint display = 0; - BadgeError errGetDisplay = Interop.Badge.GetDisplay(appId, out display); - if (errGetDisplay != BadgeError.None) - { - throw BadgeErrorFactory.GetException(errGetDisplay, "Failed to get badges "); - } - - list.Add(new Badge(appId, (int)count, display == 0 ? false : true)); - }, IntPtr.Zero); - - if (err != BadgeError.None) - { - throw BadgeErrorFactory.GetException(err, "Failed to get badges"); - } - - return list; - } - - private static void OnChangedEvent(Interop.Badge.Action action, string appId, uint count, IntPtr userData) - { - uint display = 0; - uint countLocal = 0; - - switch (action) - { - case Interop.Badge.Action.Create: - s_changed?.Invoke(null, new BadgeEventArgs() - { - Reason = BadgeEventArgs.Action.Add, - Badge = new Badge(appId, 0, false) - }); - break; - - case Interop.Badge.Action.Remove: - s_changed?.Invoke(null, new BadgeEventArgs() - { - Reason = BadgeEventArgs.Action.Remove, - Badge = new Badge(appId, 0, false) - }); - break; - - case Interop.Badge.Action.Update: - Interop.Badge.GetDisplay(appId, out display); - s_changed?.Invoke(null, new BadgeEventArgs() - { - Reason = BadgeEventArgs.Action.Update, - Badge = new Badge(appId, (int)count, display == 0 ? false : true) - }); - break; - - case Interop.Badge.Action.ChangedDisplay: - Interop.Badge.GetCount(appId, out countLocal); - s_changed?.Invoke(null, new BadgeEventArgs() - { - Reason = BadgeEventArgs.Action.Update, - Badge = new Badge(appId, (int)countLocal, count == 0 ? false : true) - }); - break; - - case Interop.Badge.Action.ServiceReady: - // Ignore - break; - } - } - } -} diff --git a/src/Tizen.Applications.Badge/Tizen.Applications/BadgeErrorFactory.cs b/src/Tizen.Applications.Badge/Tizen.Applications/BadgeErrorFactory.cs deleted file mode 100755 index 8a7a0b125..000000000 --- a/src/Tizen.Applications.Badge/Tizen.Applications/BadgeErrorFactory.cs +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) 2017 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. - */ - -namespace Tizen.Applications -{ - using System; - using System.Runtime.CompilerServices; - - internal enum BadgeError - { - None = Tizen.Internals.Errors.ErrorCode.None, - InvalidParameter = Tizen.Internals.Errors.ErrorCode.InvalidParameter, - OutOfMemory = Tizen.Internals.Errors.ErrorCode.OutOfMemory, - PermissionDenied = Tizen.Internals.Errors.ErrorCode.PermissionDenied, - IoError = Tizen.Internals.Errors.ErrorCode.IoError, - NotSupported = Tizen.Internals.Errors.ErrorCode.NotSupported, - DbError = -0x01120000 | 0x01, - AlreadyExists = -0x01120000 | 0x02, - DBusError = -0x01120000 | 0x03, - DoesnotExist = -0x01120000 | 0x04, - ServiceError = -0x01120000 | 0x05, - InvalidPackage = -0x01120000 | 0x06 - } - - /// - /// Immutable class for getting the badge information. - /// - internal static class BadgeErrorFactory - { - private static readonly string LogTag = "Tizen.Applications.Badge"; - - internal static Exception GetException(BadgeError ret, string msg, [CallerMemberName] string memberName = "", [CallerFilePath] string filePath = "", [CallerLineNumber] int lineNumber = 0) - { - Log.Error(LogTag, memberName + " : " + lineNumber); - - switch (ret) - { - case BadgeError.InvalidParameter: - Log.Error(LogTag, msg); - return new ArgumentException(ret + " error occurred."); - case BadgeError.PermissionDenied: - Log.Error(LogTag, msg); - throw new UnauthorizedAccessException("Permission denied (http://tizen.org/privilege/notification)"); - case BadgeError.NotSupported: - Log.Error(LogTag, msg); - throw new NotSupportedException("Not Supported (http://tizen.org/feature/badge)"); - default: - Log.Error(LogTag, msg); - return new InvalidOperationException(ret + " error occurred."); - } - } - } -} diff --git a/src/Tizen.Applications.Badge/Tizen.Applications/BadgeEventArgs.cs b/src/Tizen.Applications.Badge/Tizen.Applications/BadgeEventArgs.cs deleted file mode 100755 index b93cf66e9..000000000 --- a/src/Tizen.Applications.Badge/Tizen.Applications/BadgeEventArgs.cs +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (c) 2016 - 2017 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. - */ - -namespace Tizen.Applications -{ - using System; - - /// - /// The class for event arguments of the badge event. - /// - public class BadgeEventArgs : EventArgs - { - internal BadgeEventArgs() - { - } - - /// - /// Enumeration for the badge action. - /// - /// 3 - public enum Action : int - { - /// - /// The badge was added. - /// - Add = 0, - - /// - /// The badge was removed. - /// - Remove, - - /// - /// The badge was updated. - /// - Update, - } - - /// - /// The property for the badge object. - /// - /// 3 - public Badge Badge { get; internal set; } - - /// - /// The property for the action value. - /// - /// 3 - public Action Reason { get; internal set; } - } -} diff --git a/src/Tizen.Applications.Common/Interop/Interop.AppCommon.cs b/src/Tizen.Applications.Common/Interop/Interop.AppCommon.cs deleted file mode 100755 index 5ad41f5ff..000000000 --- a/src/Tizen.Applications.Common/Interop/Interop.AppCommon.cs +++ /dev/null @@ -1,96 +0,0 @@ -/* - * 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; - -using Tizen.Internals.Errors; -using Tizen.Applications; - -internal static partial class Interop -{ - internal static partial class AppCommon - { - internal enum ResourceCategory : int - { - Image = 0, - Layout, - Sound, - Binary - } - - [DllImport(Libraries.AppCommon, EntryPoint = "app_get_id")] - internal static extern ErrorCode AppGetId(out string appId); - - [DllImport(Libraries.AppCommon, EntryPoint = "app_get_name")] - internal static extern ErrorCode AppGetName(out string name); - - [DllImport(Libraries.AppCommon, EntryPoint = "app_get_resource_path")] - internal static extern string AppGetResourcePath(); - - [DllImport(Libraries.AppCommon, EntryPoint = "app_get_data_path")] - internal static extern string AppGetDataPath(); - - [DllImport(Libraries.AppCommon, EntryPoint = "app_get_cache_path")] - internal static extern string AppGetCachePath(); - - [DllImport(Libraries.AppCommon, EntryPoint = "app_get_shared_data_path")] - internal static extern string AppGetSharedDataPath(); - - [DllImport(Libraries.AppCommon, EntryPoint = "app_get_shared_resource_path")] - internal static extern string AppGetSharedResourcePath(); - - [DllImport(Libraries.AppCommon, EntryPoint = "app_get_shared_trusted_path")] - internal static extern string AppGetSharedTrustedPath(); - - [DllImport(Libraries.AppCommon, EntryPoint = "app_get_tep_resource_path")] - internal static extern string AppGetTepResourcePath(); - - [DllImport(Libraries.AppCommon, EntryPoint = "app_get_external_cache_path")] - internal static extern string AppGetExternalCachePath(); - - [DllImport(Libraries.AppCommon, EntryPoint = "app_get_external_data_path")] - internal static extern string AppGetExternalDataPath(); - - [DllImport(Libraries.AppCommon, EntryPoint = "app_get_external_shared_data_path")] - internal static extern string AppGetExternalSharedDataPath(); - - [DllImport(Libraries.AppCommon, EntryPoint = "app_get_version")] - internal static extern ErrorCode AppGetVersion(out string version); - - [DllImport(Libraries.AppCommon, EntryPoint = "app_event_get_low_memory_status")] - internal static extern ErrorCode AppEventGetLowMemoryStatus(IntPtr handle, out LowMemoryStatus status); - - [DllImport(Libraries.AppCommon, EntryPoint = "app_event_get_low_battery_status")] - internal static extern ErrorCode AppEventGetLowBatteryStatus(IntPtr handle, out LowBatteryStatus status); - - [DllImport(Libraries.AppCommon, EntryPoint = "app_event_get_language")] - internal static extern ErrorCode AppEventGetLanguage(IntPtr handle, out string lang); - - [DllImport(Libraries.AppCommon, EntryPoint = "app_event_get_region_format")] - internal static extern ErrorCode AppEventGetRegionFormat(IntPtr handle, out string region); - - [DllImport(Libraries.AppCommon, EntryPoint = "app_resource_manager_get")] - internal static extern ErrorCode AppResourceManagerGet(ResourceCategory category, string id, out string path); - - [DllImport(Libraries.Application, EntryPoint = "app_resource_manager_get")] - internal static extern ErrorCode LegacyAppResourceManagerGet(ResourceCategory category, string id, out string path); - - [DllImport(Libraries.AppCommon, EntryPoint = "app_event_get_device_orientation")] - internal static extern ErrorCode AppEventGetDeviceOrientation(IntPtr handle, out DeviceOrientation orientation); - } -} - diff --git a/src/Tizen.Applications.Common/Interop/Interop.AppControl.cs b/src/Tizen.Applications.Common/Interop/Interop.AppControl.cs deleted file mode 100755 index c379698b2..000000000 --- a/src/Tizen.Applications.Common/Interop/Interop.AppControl.cs +++ /dev/null @@ -1,138 +0,0 @@ -/* - * 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; - -using Tizen.Applications; - -internal static partial class Interop -{ - internal static partial class AppControl - { - internal const int AppStartedStatus = 1; - - internal delegate bool ExtraDataCallback(IntPtr handle, string key, IntPtr userData); - internal delegate bool AppMatchedCallback(IntPtr handle, string applicationId, IntPtr userData); - internal delegate void ReplyCallback(IntPtr request, IntPtr reply, int result, IntPtr userData); - - internal enum ErrorCode - { - None = Tizen.Internals.Errors.ErrorCode.None, - InvalidParameter = Tizen.Internals.Errors.ErrorCode.InvalidParameter, - OutOfMemory = Tizen.Internals.Errors.ErrorCode.OutOfMemory, - AppNotFound = -0x01100000 | 0x21, - KeyNotFound = Tizen.Internals.Errors.ErrorCode.KeyNotAvailable, - KeyRejected = Tizen.Internals.Errors.ErrorCode.KeyRejected, - InvalidDataType = -0x01100000 | 0x22, - LaunchRejected = -0x01100000 | 0x23, - PermissionDenied = Tizen.Internals.Errors.ErrorCode.PermissionDenied, - LaunchFailed = -0x01100000 | 0x24, - IoError = Tizen.Internals.Errors.ErrorCode.IoError, - TimedOut = Tizen.Internals.Errors.ErrorCode.TimedOut, - } - - [DllImport(Libraries.AppControl, EntryPoint = "app_control_create")] - internal static extern ErrorCode Create(out SafeAppControlHandle handle); - - [DllImport(Libraries.AppControl, EntryPoint = "app_control_clone")] - internal static extern ErrorCode DangerousClone(out SafeAppControlHandle clone, IntPtr handle); - - [DllImport(Libraries.AppControl, EntryPoint = "app_control_get_app_id")] - internal static extern ErrorCode GetAppId(IntPtr app_control, out IntPtr app_id); - - [DllImport(Libraries.AppControl, EntryPoint = "app_control_get_operation")] - internal static extern ErrorCode GetOperation(SafeAppControlHandle handle, out string operation); - - [DllImport(Libraries.AppControl, EntryPoint = "app_control_set_operation")] - internal static extern ErrorCode SetOperation(SafeAppControlHandle handle, string operation); - - [DllImport(Libraries.AppControl, EntryPoint = "app_control_get_uri")] - internal static extern ErrorCode GetUri(SafeAppControlHandle handle, out string uri); - - [DllImport(Libraries.AppControl, EntryPoint = "app_control_set_uri")] - internal static extern ErrorCode SetUri(SafeAppControlHandle handle, string uri); - - [DllImport(Libraries.AppControl, EntryPoint = "app_control_get_mime")] - internal static extern ErrorCode GetMime(SafeAppControlHandle handle, out string mime); - - [DllImport(Libraries.AppControl, EntryPoint = "app_control_set_mime")] - internal static extern ErrorCode SetMime(SafeAppControlHandle handle, string mime); - - [DllImport(Libraries.AppControl, EntryPoint = "app_control_get_category")] - internal static extern ErrorCode GetCategory(SafeAppControlHandle handle, out string category); - - [DllImport(Libraries.AppControl, EntryPoint = "app_control_set_category")] - internal static extern ErrorCode SetCategory(SafeAppControlHandle handle, string category); - - [DllImport(Libraries.AppControl, EntryPoint = "app_control_get_app_id")] - internal static extern ErrorCode GetAppId(SafeAppControlHandle handle, out string appId); - - [DllImport(Libraries.AppControl, EntryPoint = "app_control_set_app_id")] - internal static extern ErrorCode SetAppId(SafeAppControlHandle handle, string appId); - - [DllImport(Libraries.AppControl, EntryPoint = "app_control_set_launch_mode")] - internal static extern ErrorCode SetLaunchMode(SafeAppControlHandle handle, int mode); - - [DllImport(Libraries.AppControl, EntryPoint = "app_control_get_launch_mode")] - internal static extern ErrorCode GetLaunchMode(SafeAppControlHandle handle, out int mode); - - [DllImport(Libraries.AppControl, EntryPoint = "app_control_get_caller")] - internal static extern ErrorCode GetCaller(SafeAppControlHandle handle, out string caller); - - [DllImport(Libraries.AppControl, EntryPoint = "app_control_is_reply_requested")] - internal static extern ErrorCode IsReplyRequested(SafeAppControlHandle handle, out bool requested); - - [DllImport(Libraries.AppControl, EntryPoint = "app_control_add_extra_data")] - internal static extern ErrorCode AddExtraData(SafeAppControlHandle handle, string key, string value); - - [DllImport(Libraries.AppControl, EntryPoint = "app_control_remove_extra_data")] - internal static extern ErrorCode RemoveExtraData(SafeAppControlHandle handle, string key); - - [DllImport(Libraries.AppControl, EntryPoint = "app_control_get_extra_data")] - internal static extern ErrorCode GetExtraData(SafeAppControlHandle handle, string key, out string value); - - [DllImport(Libraries.AppControl, EntryPoint = "app_control_add_extra_data_array")] - internal static extern ErrorCode AddExtraDataArray(SafeAppControlHandle handle, string key, string[] value, int length); - - [DllImport(Libraries.AppControl, EntryPoint = "app_control_get_extra_data_array")] - internal static extern ErrorCode GetExtraDataArray(SafeAppControlHandle handle, string key, out IntPtr value, out int length); - - [DllImport(Libraries.AppControl, EntryPoint = "app_control_is_extra_data_array")] - internal static extern ErrorCode IsExtraDataArray(SafeAppControlHandle handle, string key, out bool array); - - [DllImport(Libraries.AppControl, EntryPoint = "app_control_destroy")] - internal static extern ErrorCode DangerousDestroy(IntPtr handle); - - [DllImport(Libraries.AppControl, EntryPoint = "app_control_foreach_extra_data")] - internal static extern ErrorCode ForeachExtraData(SafeAppControlHandle handle, ExtraDataCallback callback, IntPtr userData); - - [DllImport(Libraries.AppControl, EntryPoint = "app_control_foreach_app_matched")] - internal static extern ErrorCode ForeachAppMatched(SafeAppControlHandle handle, AppMatchedCallback callback, IntPtr userData); - - [DllImport(Libraries.AppControl, EntryPoint = "app_control_send_launch_request")] - internal static extern ErrorCode SendLaunchRequest(SafeAppControlHandle handle, ReplyCallback callback, IntPtr userData); - - [DllImport(Libraries.AppControl, EntryPoint = "app_control_send_terminate_request")] - internal static extern ErrorCode SendTerminateRequest(SafeAppControlHandle handle); - - [DllImport(Libraries.AppControl, EntryPoint = "app_control_reply_to_launch_request")] - internal static extern ErrorCode ReplyToLaunchRequest(SafeAppControlHandle reply, SafeAppControlHandle request, int result); - - [DllImport(Libraries.AppControl, EntryPoint = "app_control_enable_app_started_result_event")] - internal static extern ErrorCode EnableAppStartedResultEvent(SafeAppControlHandle handle); - } -} diff --git a/src/Tizen.Applications.Common/Interop/Interop.ApplicationManager.cs b/src/Tizen.Applications.Common/Interop/Interop.ApplicationManager.cs deleted file mode 100644 index 0879a32da..000000000 --- a/src/Tizen.Applications.Common/Interop/Interop.ApplicationManager.cs +++ /dev/null @@ -1,356 +0,0 @@ -/* - * 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 ApplicationManager - { - internal enum ErrorCode - { - None = Tizen.Internals.Errors.ErrorCode.None, - InvalidParameter = Tizen.Internals.Errors.ErrorCode.InvalidParameter, - OutOfMemory = Tizen.Internals.Errors.ErrorCode.OutOfMemory, - IoError = Tizen.Internals.Errors.ErrorCode.IoError, - NoSuchApp = -0x01110000 | 0x01, - DbFailed = -0x01110000 | 0x03, - InvalidPackage = -0x01110000 | 0x04, - AppNoRunning = -0x01110000 | 0x05, - RequestFailed = -0x01110000 | 0x06, - PermissionDenied = Tizen.Internals.Errors.ErrorCode.PermissionDenied - } - - internal enum AppContextEvent - { - Launched = 0, - Terminated = 1 - } - - internal enum AppManagerEventStatusType - { - All = 0x00, - Enable = 0x01, - Disable = 0x02 - } - - internal enum AppManagerEventType - { - Enable = 0, - Disable = 1 - } - - internal enum AppManagerEventState - { - Started = 0, - Completed = 1, - Failed = 2 - } - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void AppManagerEventCallback(string appType, string appId, AppManagerEventType eventType, AppManagerEventState eventState, IntPtr eventHandle, IntPtr userData); - //void(* app_manager_event_cb)(const char *type, const char *app_id, app_manager_event_type_e event_type, app_manager_event_state_e event_state, app_manager_event_h handle, void *user_data) - - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void AppManagerAppContextEventCallback(IntPtr handle, AppContextEvent state, IntPtr userData); - //void(* app_manager_app_context_event_cb)(app_context_h app_context, app_context_event_e event, void *user_data) - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool AppManagerAppInfoCallback(IntPtr handle, IntPtr userData); - //bool(* app_manager_app_info_cb )(app_info_h app_info, void *user_data) - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool AppManagerAppContextCallback(IntPtr handle, IntPtr userData); - //bool(* app_manager_app_context_cb)(app_context_h app_context, void *user_data) - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool AppInfoFilterCallback(IntPtr handle, IntPtr userData); - //bool(* app_info_filter_cb )(app_info_h app_info, void *user_data) - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool AppInfoMetadataCallback(string key, string value, IntPtr userData); - //bool(* app_info_metadata_cb )(const char *metadata_key, const char *metadata_value, void *user_data) - - [DllImport(Libraries.AppManager, EntryPoint = "app_manager_set_app_context_event_cb")] - internal static extern ErrorCode AppManagerSetAppContextEvent(AppManagerAppContextEventCallback callback, IntPtr userData); - //int app_manager_set_app_context_event_cb( app_manager_app_context_event_cb callback, void * user_data) - - [DllImport(Libraries.AppManager, EntryPoint = "app_manager_unset_app_context_event_cb")] - internal static extern void AppManagerUnSetAppContextEvent(); - //void app_manager_unset_app_context_event_cb (void); - - [DllImport(Libraries.AppManager, EntryPoint = "app_manager_foreach_running_app_context")] - internal static extern ErrorCode AppManagerForeachRunningAppContext(AppManagerAppContextCallback callback, IntPtr userData); - //int app_manager_foreach_running_app_context(app_manager_app_context_cb callback, void *user_data) - - [DllImport(Libraries.AppManager, EntryPoint = "app_manager_foreach_app_context")] - internal static extern ErrorCode AppManagerForeachAppContext(AppManagerAppContextCallback callback, IntPtr userData); - //int app_manager_foreach_app_context(app_manager_app_context_cb callback, void *user_data) - - [DllImport(Libraries.AppManager, EntryPoint = "app_manager_get_app_context")] - internal static extern ErrorCode AppManagerGetAppContext(string applicationId, out IntPtr handle); - //int app_manager_get_app_context(const char* app_id, app_context_h *app_context); - - [DllImport(Libraries.AppManager, EntryPoint = "app_manager_get_app_id")] - internal static extern ErrorCode AppManagerGetAppId(int processId, out string applicationId); - //int app_manager_get_app_id (pid_t pid, char **appid); - - [DllImport(Libraries.AppManager, EntryPoint = "app_manager_is_running")] - internal static extern ErrorCode AppManagerIsRunning(string applicationId, out bool running); - //int app_manager_is_running (const char *appid, bool *running); - - [DllImport(Libraries.AppManager, EntryPoint = "app_manager_resume_app")] - internal static extern ErrorCode AppManagerResumeApp(IntPtr handle); - //int app_manager_resume_app (app_context_h handle); - - [DllImport(Libraries.AppManager, EntryPoint = "app_manager_request_terminate_bg_app")] - internal static extern ErrorCode AppManagerRequestTerminateBgApp(IntPtr handle); - //int app_manager_request_terminate_bg_app (app_context_h handle); - - [DllImport(Libraries.AppManager, EntryPoint = "app_manager_foreach_app_info")] - internal static extern ErrorCode AppManagerForeachAppInfo(AppManagerAppInfoCallback callback, IntPtr userData); - //int app_manager_foreach_app_info(app_manager_app_info_cb callback, void *user_data) - - [DllImport(Libraries.AppManager, EntryPoint = "app_manager_get_app_info")] - internal static extern ErrorCode AppManagerGetAppInfo(string applicationId, out IntPtr handle); - //int app_manager_get_app_info(const char * app_id, app_info_h * app_info) - - [DllImport(Libraries.AppManager, EntryPoint = "app_manager_get_shared_data_path")] - internal static extern ErrorCode AppManagerGetSharedDataPath(string applicationId, out string path); - //int app_manager_get_shared_data_path (const char *appid, char **path); - - [DllImport(Libraries.AppManager, EntryPoint = "app_manager_get_shared_resource_path")] - internal static extern ErrorCode AppManagerGetSharedResourcePath(string applicationId, out string path); - //int app_manager_get_shared_resource_path (const char *appid, char **path); - - [DllImport(Libraries.AppManager, EntryPoint = "app_manager_get_shared_trusted_path")] - internal static extern ErrorCode AppManagerGetSharedTrustedPath(string applicationId, out string path); - //int app_manager_get_shared_trusted_path (const char *appid, char **path); - - [DllImport(Libraries.AppManager, EntryPoint = "app_manager_get_external_shared_data_path")] - internal static extern ErrorCode AppManagerGetExternalSharedDataPath(string applicationId, out string path); - //int app_manager_get_external_shared_data_path (const char *appid, char **path); - - [DllImport(Libraries.AppManager, EntryPoint = "app_manager_event_create")] - internal static extern ErrorCode AppManagerEventCreate(out IntPtr handle); - //int app_manager_event_create (app_manager_event_h *handle); - - [DllImport(Libraries.AppManager, EntryPoint = "app_manager_event_set_status")] - internal static extern ErrorCode AppManagerEventSetStatus(IntPtr handle, AppManagerEventStatusType statusType); - //int app_manager_event_set_status (app_manager_event_h handle, int status_type); - - [DllImport(Libraries.AppManager, EntryPoint = "app_manager_set_event_cb")] - internal static extern ErrorCode AppManagerSetEventCallback(IntPtr handle, AppManagerEventCallback callback, IntPtr userData); - //int app_manager_set_event_cb (app_manager_event_h handle, app_manager_event_cb callback, void *user_data); - - [DllImport(Libraries.AppManager, EntryPoint = "app_manager_unset_event_cb")] - internal static extern ErrorCode AppManagerUnSetEventCallback(IntPtr handle); - //int app_manager_unset_event_cb (app_manager_event_h handle); - - [DllImport(Libraries.AppManager, EntryPoint = "app_manager_event_destroy")] - internal static extern ErrorCode AppManagerEventDestroy(IntPtr handle); - //int app_manager_event_destroy (app_manager_event_h handle); - - [DllImport(Libraries.AppManager, EntryPoint = "app_manager_terminate_app")] - internal static extern ErrorCode AppManagerTerminateApp(IntPtr handle); - //int app_manager_terminate_app (app_context_h app_context); - - [DllImport(Libraries.AppManager, EntryPoint = "app_manager_get_app_context_by_instance_id")] - internal static extern ErrorCode AppManagerGetAppContextByInstanceId(string applicationId, string instanceId, out IntPtr handle); - //int app_manager_get_app_context_by_instance_id (const char *app_id, const char *instance_id, app_context_h *app_context); - - [DllImport(Libraries.AppManager, EntryPoint = "app_context_destroy")] - internal static extern ErrorCode AppContextDestroy(IntPtr handle); - //int app_context_destroy(app_context_h app_context) - - [DllImport(Libraries.AppManager, EntryPoint = "app_context_get_app_id")] - internal static extern ErrorCode AppContextGetAppId(IntPtr handle, out string applicationId); - //int app_context_get_app_id(app_context_h app_context, char **app_id) - - [DllImport(Libraries.AppManager, EntryPoint = "app_context_get_package_id")] - internal static extern ErrorCode AppContextGetPackageId(IntPtr handle, out string packageId); - //int app_context_get_package_id(app_context_h app_context, char **package_id) - - [DllImport(Libraries.AppManager, EntryPoint = "app_context_get_pid")] - internal static extern ErrorCode AppContextGetPid(IntPtr handle, out int processId); - //int app_context_get_pid (app_context_h app_context, pid_t *pid) - - [DllImport(Libraries.AppManager, EntryPoint = "app_context_get_app_state")] - internal static extern ErrorCode AppContextGetAppState(IntPtr handle, out int state); - //int app_context_get_app_state (app_context_h app_context, app_state_e *state) - - [DllImport(Libraries.AppManager, EntryPoint = "app_context_is_terminated")] - internal static extern ErrorCode AppContextIsTerminated(IntPtr handle, out bool terminated); - //int app_context_is_terminated (app_context_h app_context, bool *terminated); - - [DllImport(Libraries.AppManager, EntryPoint = "app_context_is_equal")] - internal static extern ErrorCode AppContextIsEqual(IntPtr first, IntPtr second, out bool equal); - //int app_context_is_equal (app_context_h lhs, app_context_h rhs, bool *equal); - - [DllImport(Libraries.AppManager, EntryPoint = "app_context_is_sub_app")] - internal static extern ErrorCode AppContextIsSubApp(IntPtr handle, out bool is_sub_app); - //int app_context_is_sub_app (app_context_h app_context, bool *is_sub_app); - - [DllImport(Libraries.AppManager, EntryPoint = "app_context_clone")] - internal static extern ErrorCode AppContextClone(out IntPtr destination, IntPtr source); - //int app_context_clone (app_context_h *clone, app_context_h app_context); - - [DllImport(Libraries.AppManager, EntryPoint = "app_info_create")] - internal static extern ErrorCode AppInfoCreate(string applicationId, out IntPtr handle); - //int app_info_create (const char *app_id, app_info_h *app_info); - - [DllImport(Libraries.AppManager, EntryPoint = "app_info_destroy")] - internal static extern ErrorCode AppInfoDestroy(IntPtr handle); - //int app_info_destroy (app_info_h app_info); - - [DllImport(Libraries.AppManager, EntryPoint = "app_info_get_app_id")] - internal static extern ErrorCode AppInfoGetAppId(IntPtr handle, out string applicationId); - //int app_info_get_app_id (app_info_h app_info, char **app_id); - - [DllImport(Libraries.AppManager, EntryPoint = "app_info_get_exec")] - internal static extern ErrorCode AppInfoGetExec(IntPtr handle, out string exec); - //int app_info_get_exec (app_info_h app_info, char **exec); - - [DllImport(Libraries.AppManager, EntryPoint = "app_info_get_label")] - internal static extern ErrorCode AppInfoGetLabel(IntPtr handle, out string label); - //int app_info_get_label (app_info_h app_info, char **label); - - [DllImport(Libraries.AppManager, EntryPoint = "app_info_get_localed_label")] - internal static extern ErrorCode AppInfoGetLocaledLabel(string applicationId, string locale, out string label); - //int app_info_get_localed_label (const char *app_id, const char *locale, char **label); - - [DllImport(Libraries.AppManager, EntryPoint = "app_info_get_icon")] - internal static extern ErrorCode AppInfoGetIcon(IntPtr handle, out string path); - //int app_info_get_icon (app_info_h app_info, char **path) - - [DllImport(Libraries.AppManager, EntryPoint = "app_info_get_package")] - internal static extern ErrorCode AppInfoGetPackage(IntPtr handle, out string package); - //int app_info_get_package (app_info_h app_info, char **package) - - [DllImport(Libraries.AppManager, EntryPoint = "app_info_get_type")] - internal static extern ErrorCode AppInfoGetType(IntPtr handle, out string type); - //int app_info_get_type (app_info_h app_info, char **type) - - [DllImport(Libraries.AppManager, EntryPoint = "app_info_foreach_metadata")] - internal static extern ErrorCode AppInfoForeachMetadata(IntPtr handle, AppInfoMetadataCallback callback, IntPtr userData); - //int app_info_foreach_metadata(app_info_h app_info, app_info_metadata_cb callback, void *user_data) - - [DllImport(Libraries.AppManager, EntryPoint = "app_info_is_nodisplay")] - internal static extern ErrorCode AppInfoIsNodisplay(IntPtr handle, out bool noDisplay); - //int app_info_is_nodisplay (app_info_h app_info, bool *nodisplay) - - [DllImport(Libraries.AppManager, EntryPoint = "app_info_is_equal")] - internal static extern ErrorCode AppInfoIsEqual(IntPtr first, IntPtr second, out bool equal); - //int app_info_is_equal (app_info_h lhs, app_info_h rhs, bool *equal) - - [DllImport(Libraries.AppManager, EntryPoint = "app_info_is_enabled")] - internal static extern ErrorCode AppInfoIsEnabled(IntPtr handle, out bool enabled); - //int app_info_is_enabled (app_info_h app_info, bool *enabled) - - [DllImport(Libraries.AppManager, EntryPoint = "app_info_is_onboot")] - internal static extern ErrorCode AppInfoIsOnBoot(IntPtr handle, out bool onBoot); - //int app_info_is_onboot (app_info_h app_info, bool *onboot) - - [DllImport(Libraries.AppManager, EntryPoint = "app_info_is_preload")] - internal static extern ErrorCode AppInfoIsPreLoad(IntPtr handle, out bool preLoaded); - //int app_info_is_preload (app_info_h app_info, bool *preload) - - [DllImport(Libraries.AppManager, EntryPoint = "app_info_clone")] - internal static extern ErrorCode AppInfoClone(out IntPtr destination, IntPtr source); - //int app_info_clone(app_info_h * clone, app_info_h app_info) - - [DllImport(Libraries.AppManager, EntryPoint = "app_info_filter_create")] - internal static extern ErrorCode AppInfoFilterCreate(out IntPtr handle); - //int app_info_filter_create(app_info_filter_h * handle) - - [DllImport(Libraries.AppManager, EntryPoint = "app_info_filter_destroy")] - internal static extern ErrorCode AppInfoFilterDestroy(IntPtr handle); - //int app_info_filter_destroy(app_info_filter_h handle) - - [DllImport(Libraries.AppManager, EntryPoint = "app_info_filter_add_bool")] - internal static extern ErrorCode AppInfoFilterAddBool(IntPtr handle, string property, bool value); - //int app_info_filter_add_bool(app_info_filter_h handle, const char *property, const bool value) - - [DllImport(Libraries.AppManager, EntryPoint = "app_info_filter_add_string")] - internal static extern ErrorCode AppInfoFilterAddString(IntPtr handle, string property, string value); - //int app_info_filter_add_string(app_info_filter_h handle, const char *property, const char *value) - - [DllImport(Libraries.AppManager, EntryPoint = "app_info_filter_count_appinfo")] - internal static extern ErrorCode AppInfoFilterCountAppinfo(IntPtr handle, out int count); - //int app_info_filter_count_appinfo(app_info_filter_h handle, int *count) - - [DllImport(Libraries.AppManager, EntryPoint = "app_info_filter_foreach_appinfo")] - internal static extern ErrorCode AppInfoFilterForeachAppinfo(IntPtr handle, AppInfoFilterCallback callback, IntPtr userData); - //int app_info_filter_foreach_appinfo(app_info_filter_h handle, app_info_filter_cb callback, void * user_data) - - [DllImport(Libraries.AppManager, EntryPoint = "app_info_metadata_filter_create")] - internal static extern ErrorCode AppInfoMetadataFilterCreate(out IntPtr handle); - //int app_info_metadata_filter_create (app_info_metadata_filter_h *handle) - - [DllImport(Libraries.AppManager, EntryPoint = "app_info_metadata_filter_destroy")] - internal static extern ErrorCode AppInfoMetadataFilterDestroy(IntPtr handle); - //int app_info_metadata_filter_destroy (app_info_metadata_filter_h handle) - - [DllImport(Libraries.AppManager, EntryPoint = "app_info_metadata_filter_add")] - internal static extern ErrorCode AppInfoMetadataFilterAdd(IntPtr handle, string key, string value); - //int app_info_metadata_filter_add (app_info_metadata_filter_h handle, const char *key, const char *value) - - [DllImport(Libraries.AppManager, EntryPoint = "app_info_metadata_filter_foreach")] - internal static extern ErrorCode AppInfoMetadataFilterForeach(IntPtr handle, AppInfoFilterCallback callback, IntPtr userData); - //int app_info_metadata_filter_foreach (app_info_metadata_filter_h handle, app_info_filter_cb callback, void *user_data) - - [StructLayout(LayoutKind.Sequential)] - internal struct RuaRec - { - internal int id; - internal IntPtr pkgName; - internal IntPtr appPath; - internal IntPtr arg; - internal IntPtr launchTime; - internal IntPtr instanceId; - internal IntPtr instanceName; - internal IntPtr icon; - internal IntPtr uri; - internal IntPtr image; - }; - - [DllImport(Libraries.Rua, EntryPoint = "rua_history_get_rec")] - internal static extern ErrorCode RuaHistoryGetRecord(out RuaRec record, IntPtr table, int nRows, int nCols, int row); - //int rua_history_get_rec(struct rua_rec *rec, char** table, int nrows, int ncols, int row); - - [DllImport(Libraries.Rua, EntryPoint = "rua_history_load_db")] - internal static extern ErrorCode RuaHistoryLoadDb(out IntPtr table, out int nRows, out int nCols); - //int rua_history_load_db(char*** table, int *nrows, int *ncols); - - [DllImport(Libraries.Rua, EntryPoint = "rua_history_unload_db")] - internal static extern ErrorCode RuaHistoryUnLoadDb(ref IntPtr table); - //int rua_history_unload_db(char*** table); - - [DllImport(Libraries.Rua, EntryPoint = "rua_delete_history_with_pkgname")] - internal static extern ErrorCode RuaDeleteHistoryWithPkgname(string pkgName); - //int rua_delete_history_with_pkgname(char* pkg_name); - - [DllImport(Libraries.Rua, EntryPoint = "rua_delete_history_with_apppath")] - internal static extern ErrorCode RuaDeleteHistoryWithApppath(string appPath); - //int rua_delete_history_with_apppath(char* app_path); - - [DllImport(Libraries.Rua, EntryPoint = "rua_clear_history")] - internal static extern ErrorCode RuaClearHistory(); - //int rua_clear_history(void); - } -} diff --git a/src/Tizen.Applications.Common/Interop/Interop.Bundle.cs b/src/Tizen.Applications.Common/Interop/Interop.Bundle.cs deleted file mode 100755 index 65c314ae0..000000000 --- a/src/Tizen.Applications.Common/Interop/Interop.Bundle.cs +++ /dev/null @@ -1,82 +0,0 @@ -/* - * 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; - -using Tizen.Applications; - -internal static partial class Interop -{ - internal static partial class Bundle - { - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void Iterator(string key, int type, IntPtr keyval, IntPtr userData); - - [DllImport(Libraries.Bundle, EntryPoint = "bundle_create")] - internal static extern SafeBundleHandle Create(); - - [DllImport(Libraries.Bundle, EntryPoint = "bundle_free")] - internal static extern int DangerousFree(IntPtr handle); - - [DllImport(Libraries.Bundle, EntryPoint = "bundle_del")] - internal static extern int RemoveItem(SafeBundleHandle handle, string key); - - [DllImport(Libraries.Bundle, EntryPoint = "bundle_add_str")] - internal static extern int AddString(SafeBundleHandle handle, string key, string value); - - [DllImport(Libraries.Bundle, EntryPoint = "bundle_get_type")] - internal static extern int GetType(SafeBundleHandle handle, string key); - - [DllImport(Libraries.Bundle, EntryPoint = "bundle_get_str")] - internal static extern int GetString(SafeBundleHandle handle, string key, out IntPtr value); - - [DllImport(Libraries.Bundle, EntryPoint = "bundle_add_byte")] - internal static extern unsafe int AddByte(SafeBundleHandle handle, string key, byte* value, int size); - - [DllImport(Libraries.Bundle, EntryPoint = "bundle_get_byte")] - internal static extern int GetByte(SafeBundleHandle handle, string key, out IntPtr value, out int size); - - [DllImport(Libraries.Bundle, EntryPoint = "bundle_add_str_array")] - internal static extern int AddStringArray(SafeBundleHandle handle, string key, string[] value, int size); - - [DllImport(Libraries.Bundle, EntryPoint = "bundle_get_str_array")] - internal static extern IntPtr GetStringArray(SafeBundleHandle handle, string key, out int size); - - [DllImport(Libraries.Bundle, EntryPoint = "bundle_foreach")] - internal static extern void Foreach(SafeBundleHandle handle, Iterator iterator, IntPtr userData); - - [DllImport(Libraries.Bundle, EntryPoint = "bundle_encode")] - internal static extern void BundleEncode(SafeBundleHandle handle, out string str, out int len); - - [DllImport(Libraries.Bundle, EntryPoint = "bundle_decode")] - internal static extern SafeBundleHandle BundleDecode(string bundleRaw, int len); - - [DllImport(Libraries.Bundle, EntryPoint = "bundle_dup")] - internal static extern SafeBundleHandle DangerousClone(IntPtr handle); - - internal static class UnsafeCode - { - internal static unsafe int AddItem(SafeBundleHandle handle, string key, byte[] value, int offset, int count) - { - fixed (byte* pointer = value) - { - return AddByte(handle, key, pointer + offset, count); - } - } - } - } -} diff --git a/src/Tizen.Applications.Common/Interop/Interop.Glib.cs b/src/Tizen.Applications.Common/Interop/Interop.Glib.cs deleted file mode 100755 index 576a6e287..000000000 --- a/src/Tizen.Applications.Common/Interop/Interop.Glib.cs +++ /dev/null @@ -1,30 +0,0 @@ -/* - * 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 Glib - { - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool GSourceFunc(IntPtr userData); - - [DllImport(Libraries.Glib, EntryPoint = "g_idle_add", CallingConvention = CallingConvention.Cdecl)] - internal static extern uint IdleAdd(GSourceFunc d, IntPtr data); - } -} diff --git a/src/Tizen.Applications.Common/Interop/Interop.Libc.cs b/src/Tizen.Applications.Common/Interop/Interop.Libc.cs deleted file mode 100755 index 825599e27..000000000 --- a/src/Tizen.Applications.Common/Interop/Interop.Libc.cs +++ /dev/null @@ -1,27 +0,0 @@ -/* - * 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 Libc - { - [DllImport(Libraries.Libc, EntryPoint = "free", CallingConvention = CallingConvention.Cdecl)] - internal static extern int Free(IntPtr ptr); - } -} diff --git a/src/Tizen.Applications.Common/Interop/Interop.Libraries.cs b/src/Tizen.Applications.Common/Interop/Interop.Libraries.cs deleted file mode 100755 index 8a417c65a..000000000 --- a/src/Tizen.Applications.Common/Interop/Interop.Libraries.cs +++ /dev/null @@ -1,31 +0,0 @@ -/* - * 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 AppCommon = "libcapi-appfw-app-common.so.0"; - public const string AppControl = "libcapi-appfw-app-control.so.0"; - public const string AppEvent = "libcapi-appfw-event.so.0"; - public const string AppManager = "libcapi-appfw-app-manager.so.0"; - public const string Bundle = "libbundle.so.0"; - public const string Rua = "librua.so.0"; - public const string Glib = "libglib-2.0.so.0"; - public const string Libc = "libc.so.6"; - public const string Application = "libcapi-appfw-application.so.0"; - } -} diff --git a/src/Tizen.Applications.Common/Tizen.Applications.Common.csproj b/src/Tizen.Applications.Common/Tizen.Applications.Common.csproj deleted file mode 100755 index 7f4584ffe..000000000 --- a/src/Tizen.Applications.Common/Tizen.Applications.Common.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - netstandard2.0 - - - - - - - - diff --git a/src/Tizen.Applications.Common/Tizen.Applications.Common.sln b/src/Tizen.Applications.Common/Tizen.Applications.Common.sln deleted file mode 100755 index 2be100550..000000000 --- a/src/Tizen.Applications.Common/Tizen.Applications.Common.sln +++ /dev/null @@ -1,34 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26430.12 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Applications.Common", "Tizen.Applications.Common.csproj", "{C38800D6-AB85-4D6E-9C3F-F79C7C3ED4EB}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen", "..\Tizen\Tizen.csproj", "{2E04FB0F-03F4-40B0-BB25-5ADFB08C8DF3}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Log", "..\Tizen.Log\Tizen.Log.csproj", "{8DA5B43B-63E9-460C-B64F-0B691539DC5D}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {C38800D6-AB85-4D6E-9C3F-F79C7C3ED4EB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C38800D6-AB85-4D6E-9C3F-F79C7C3ED4EB}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C38800D6-AB85-4D6E-9C3F-F79C7C3ED4EB}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C38800D6-AB85-4D6E-9C3F-F79C7C3ED4EB}.Release|Any CPU.Build.0 = Release|Any CPU - {2E04FB0F-03F4-40B0-BB25-5ADFB08C8DF3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {2E04FB0F-03F4-40B0-BB25-5ADFB08C8DF3}.Debug|Any CPU.Build.0 = Debug|Any CPU - {2E04FB0F-03F4-40B0-BB25-5ADFB08C8DF3}.Release|Any CPU.ActiveCfg = Release|Any CPU - {2E04FB0F-03F4-40B0-BB25-5ADFB08C8DF3}.Release|Any CPU.Build.0 = Release|Any CPU - {8DA5B43B-63E9-460C-B64F-0B691539DC5D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {8DA5B43B-63E9-460C-B64F-0B691539DC5D}.Debug|Any CPU.Build.0 = Debug|Any CPU - {8DA5B43B-63E9-460C-B64F-0B691539DC5D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {8DA5B43B-63E9-460C-B64F-0B691539DC5D}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/src/Tizen.Applications.Common/Tizen.Applications.CoreBackend/DefaultCoreBackend.cs b/src/Tizen.Applications.Common/Tizen.Applications.CoreBackend/DefaultCoreBackend.cs deleted file mode 100755 index 24915d97e..000000000 --- a/src/Tizen.Applications.Common/Tizen.Applications.CoreBackend/DefaultCoreBackend.cs +++ /dev/null @@ -1,155 +0,0 @@ -/* - * 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.Collections.Generic; - -using Tizen.Internals.Errors; - -namespace Tizen.Applications.CoreBackend -{ - /// - /// An abstract class to provide default event handlers for apps. - /// - public abstract class DefaultCoreBackend : ICoreBackend - { - /// - /// Low level event types. - /// - public enum AppEventType - { - LowMemory = 0, - LowBattery, - LanguageChanged, - DeviceOrientationChanged, - RegionFormatChanged, - SuspendedStateChanged - } - - protected static readonly string LogTag = typeof(DefaultCoreBackend).Namespace; - - protected IDictionary Handlers = new Dictionary(); - - public DefaultCoreBackend() - { - } - - ~DefaultCoreBackend() - { - Dispose(false); - } - - public void AddEventHandler(EventType evType, Action handler) - { - Handlers.Add(evType, handler); - } - - public void AddEventHandler(EventType evType, Action handler) where TEventArgs : EventArgs - { - Handlers.Add(evType, handler); - } - - public virtual void Run(string[] args) - { - TizenSynchronizationContext.Initialize(); - } - - public abstract void Exit(); - - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - - protected abstract void Dispose(bool disposing); - - protected virtual void OnLowMemoryNative(IntPtr infoHandle, IntPtr data) - { - LowMemoryStatus status = LowMemoryStatus.None; - ErrorCode err = Interop.AppCommon.AppEventGetLowMemoryStatus(infoHandle, out status); - if (err != ErrorCode.None) - { - Log.Error(LogTag, "Failed to get memory status. Err = " + err); - } - if (Handlers.ContainsKey(EventType.LowMemory)) - { - var handler = Handlers[EventType.LowMemory] as Action; - handler?.Invoke(new LowMemoryEventArgs(status)); - } - } - - protected virtual void OnLowBatteryNative(IntPtr infoHandle, IntPtr data) - { - LowBatteryStatus status = LowBatteryStatus.None; - ErrorCode err = Interop.AppCommon.AppEventGetLowBatteryStatus(infoHandle, out status); - if (err != ErrorCode.None) - { - Log.Error(LogTag, "Failed to get battery status. Err = " + err); - } - if (Handlers.ContainsKey(EventType.LowBattery)) - { - var handler = Handlers[EventType.LowBattery] as Action; - handler?.Invoke(new LowBatteryEventArgs(status)); - } - } - - protected virtual void OnLocaleChangedNative(IntPtr infoHandle, IntPtr data) - { - string lang; - ErrorCode err = Interop.AppCommon.AppEventGetLanguage(infoHandle, out lang); - if (err != ErrorCode.None) - { - Log.Error(LogTag, "Failed to get changed language. Err = " + err); - } - if (Handlers.ContainsKey(EventType.LocaleChanged)) - { - var handler = Handlers[EventType.LocaleChanged] as Action; - handler?.Invoke(new LocaleChangedEventArgs(lang)); - } - } - - protected virtual void OnRegionChangedNative(IntPtr infoHandle, IntPtr data) - { - string region; - ErrorCode err = Interop.AppCommon.AppEventGetRegionFormat(infoHandle, out region); - if (err != ErrorCode.None) - { - Log.Error(LogTag, "Failed to get changed region format. Err = " + err); - } - if (Handlers.ContainsKey(EventType.RegionFormatChanged)) - { - var handler = Handlers[EventType.RegionFormatChanged] as Action; - handler?.Invoke(new RegionFormatChangedEventArgs(region)); - } - } - - protected virtual void OnDeviceOrientationChangedNative(IntPtr infoHandle, IntPtr data) - { - DeviceOrientation orientation; - ErrorCode err = Interop.AppCommon.AppEventGetDeviceOrientation(infoHandle, out orientation); - if (err != ErrorCode.None) - { - Log.Error(LogTag, "Failed to get deivce orientation. Err = " + err); - } - if (Handlers.ContainsKey(EventType.DeviceOrientationChanged)) - { - var handler = Handlers[EventType.DeviceOrientationChanged] as Action; - handler?.Invoke(new DeviceOrientationEventArgs(orientation)); - } - } - } -} diff --git a/src/Tizen.Applications.Common/Tizen.Applications.CoreBackend/EventType.cs b/src/Tizen.Applications.Common/Tizen.Applications.CoreBackend/EventType.cs deleted file mode 100755 index 2eadeb692..000000000 --- a/src/Tizen.Applications.Common/Tizen.Applications.CoreBackend/EventType.cs +++ /dev/null @@ -1,123 +0,0 @@ -/* - * 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. - */ -namespace Tizen.Applications.CoreBackend -{ - /// - /// This class represents the type of event for backends. This class can be converted from the string type. - /// - public class EventType - { - /// - /// Pre-defined event type "PreCreated". - /// - public static readonly EventType PreCreated = "PreCreated"; - - /// - /// Pre-defined event type "Created". - /// - public static readonly EventType Created = "Created"; - - /// - /// Pre-defined event type "Terminated". - /// - public static readonly EventType Terminated = "Terminated"; - - /// - /// Pre-defined event type "AppControlReceived". - /// - public static readonly EventType AppControlReceived = "AppControlReceived"; - - /// - /// Pre-defined event type "Resumed". - /// - public static readonly EventType Resumed = "Resumed"; - - /// - /// Pre-defined event type "Paused". - /// - public static readonly EventType Paused = "Paused"; - - /// - /// Pre-defined event type "LowMemory". - /// - public static readonly EventType LowMemory = "LowMemory"; - - /// - /// Pre-defined event type "LowBattery". - /// - public static readonly EventType LowBattery = "LowBattery"; - - /// - /// Pre-defined event type "LocaleChanged". - /// - public static readonly EventType LocaleChanged = "LocaleChanged"; - - /// - /// Pre-defined event type "RegionFormatChanged". - /// - public static readonly EventType RegionFormatChanged = "RegionFormatChanged"; - - /// - /// Pre-defined event type "DeviceOrientationChanged". - /// - public static readonly EventType DeviceOrientationChanged = "DeviceOrientationChanged"; - - private string _typeName; - - /// - /// Initializes the EventType class. - /// - /// The name of event type. - public EventType(string name) - { - _typeName = name; - } - - /// - /// Returns the name of event type. - /// - public override string ToString() - { - return _typeName; - } - - /// - /// Returns the hash code for event type string. - /// - public override int GetHashCode() - { - if (_typeName == null) return 0; - return _typeName.GetHashCode(); - } - - /// - /// Determines whether this instance and a specified object. - /// - public override bool Equals(object obj) - { - EventType other = obj as EventType; - return other != null && other._typeName == this._typeName; - } - - /// - /// Converts a string to EventType instance. - /// - public static implicit operator EventType(string value) - { - return new EventType(value); - } - } -} diff --git a/src/Tizen.Applications.Common/Tizen.Applications.CoreBackend/ICoreBackend.cs b/src/Tizen.Applications.Common/Tizen.Applications.CoreBackend/ICoreBackend.cs deleted file mode 100755 index 3b941504e..000000000 --- a/src/Tizen.Applications.Common/Tizen.Applications.CoreBackend/ICoreBackend.cs +++ /dev/null @@ -1,52 +0,0 @@ -/* - * 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.Applications.CoreBackend -{ - /// - /// An interface that represents the backend lifecycles. - /// - public interface ICoreBackend : IDisposable - { - /// - /// Adds an event handler. - /// - /// The type of event. - /// The handler method without arguments. - void AddEventHandler(EventType evType, Action handler); - - /// - /// Adds an event handler. - /// - /// The EventArgs type used in arguments of the handler method. - /// The type of event. - /// The handler method with a TEventArgs type argument. - void AddEventHandler(EventType evType, Action handler) where TEventArgs : EventArgs; - - /// - /// Runs the mainloop of the backend. - /// - /// - void Run(string[] args); - - /// - /// Exits the mainloop of the backend. - /// - void Exit(); - } -} diff --git a/src/Tizen.Applications.Common/Tizen.Applications/AppControl.cs b/src/Tizen.Applications.Common/Tizen.Applications/AppControl.cs deleted file mode 100755 index fd4c79c38..000000000 --- a/src/Tizen.Applications.Common/Tizen.Applications/AppControl.cs +++ /dev/null @@ -1,1038 +0,0 @@ -/* - * 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.Collections.Generic; -using System.Linq; -using System.Runtime.InteropServices; - -namespace Tizen.Applications -{ - /// - /// Represents the control message to exchange between applications. - /// - /// - /// - /// public class AppControlExample : UIApplication - /// { - /// /// ... - /// protected override void OnAppControlReceived(AppControlReceivedEventArgs e) - /// { - /// AppControl appControl = new AppControl(); - /// appControl.ApplicationId = "org.tizen.calculator"; - /// AppControl.SendLaunchRequest(appControl, (launchRequest, replyRequest, result) => { - /// // ... - /// }); - /// } - /// } - /// - /// - public class AppControl - { - private const string LogTag = "Tizen.Applications"; - - private static Dictionary s_replyNativeCallbackMaps = new Dictionary(); - private static int s_replyNativeCallbackId = 0; - - private readonly SafeAppControlHandle _handle; - - private string _operation = null; - private string _mime = null; - private string _uri = null; - private string _category = null; - private string _applicationId = null; - private ExtraDataCollection _extraData = null; - - /// - /// Initializes the instance of the AppControl class. - /// - /// Thrown when failed to create the AppControl handle. - public AppControl() - { - Interop.AppControl.ErrorCode err = Interop.AppControl.Create(out _handle); - if (err != Interop.AppControl.ErrorCode.None) - { - throw new InvalidOperationException("Failed to create the appcontrol handle. Err = " + err); - } - } - - /// - /// Initializes the instance of the AppControl class with a parameter. - /// - /// The flag value to receive an additional launch result event on the launch request. - /// Thrown when failed to create the AppControl handle. - public AppControl(bool enableAppStartedResultEvent) - { - Interop.AppControl.ErrorCode err = Interop.AppControl.Create(out _handle); - if (err != Interop.AppControl.ErrorCode.None) - { - throw new InvalidOperationException("Failed to create the appcontrol handle. Err = " + err); - } - - if (enableAppStartedResultEvent) - { - err = Interop.AppControl.EnableAppStartedResultEvent(_handle); - if (err != Interop.AppControl.ErrorCode.None) - { - throw new InvalidOperationException("Failed to set EnableAppStartedResultEvent"); - } - } - } - - /// - /// Initializes the instance of the AppControl class with the SafeAppControlHandle. - /// - /// - public AppControl(SafeAppControlHandle handle) - { - if (handle == null) - { - throw new ArgumentNullException("handle"); - } - - Interop.AppControl.ErrorCode err = Interop.AppControl.DangerousClone(out _handle, handle.DangerousGetHandle()); - if (err != Interop.AppControl.ErrorCode.None) - { - throw new InvalidOperationException("Failed to clone the appcontrol handle. Err = " + err); - } - } - - private AppControl(IntPtr handle) - { - Interop.AppControl.ErrorCode err = Interop.AppControl.DangerousClone(out _handle, handle); - if (err != Interop.AppControl.ErrorCode.None) - { - throw new InvalidOperationException("Failed to clone the appcontrol handle. Err = " + err); - } - } - - #region Public Properties - - /// - /// Gets the SafeAppControlHandle instance. - /// - public SafeAppControlHandle SafeAppControlHandle - { - get - { - return _handle; - } - } - - /// - /// Gets and sets the operation to be performed. - /// - /// - /// The operation is the mandatory information for the launch request. If the operation is not specified, - /// AppControlOperations.Default is used for the launch request. If the operation is AppControlOperations.Default, - /// the package information is mandatory to explicitly launch the application. - /// (if the operation is null for setter, it clears the previous value.) - /// - /// - /// - /// AppControl appControl = new AppControl(); - /// appControl.Operation = AppControlOperations.Default; - /// Log.Debug(LogTag, "Operation: " + appControl.Operation); - /// - /// - public string Operation - { - get - { - if (String.IsNullOrEmpty(_operation)) - { - Interop.AppControl.ErrorCode err = Interop.AppControl.GetOperation(_handle, out _operation); - if (err != Interop.AppControl.ErrorCode.None) - { - Log.Warn(LogTag, "Failed to get the operation from the appcontrol. Err = " + err); - } - } - return _operation; - } - set - { - Interop.AppControl.ErrorCode err = Interop.AppControl.SetOperation(_handle, value); - if (err == Interop.AppControl.ErrorCode.None) - { - _operation = value; - } - else - { - Log.Warn(LogTag, "Failed to set the operation to the appcontrol. Err = " + err); - } - } - } - - /// - /// Gets and sets the explicit MIME type of the data. - /// - /// - /// (if the mime is null for setter, it clears the previous value.) - /// - /// - /// - /// AppControl appControl = new AppControl(); - /// appControl.Mime = "image/jpg"; - /// Log.Debug(LogTag, "Mime: " + appControl.Mime); - /// - /// - public string Mime - { - get - { - if (String.IsNullOrEmpty(_mime)) - { - Interop.AppControl.ErrorCode err = Interop.AppControl.GetMime(_handle, out _mime); - if (err != Interop.AppControl.ErrorCode.None) - { - Log.Warn(LogTag, "Failed to get the mime from the appcontrol. Err = " + err); - } - } - return _mime; - } - set - { - Interop.AppControl.ErrorCode err = Interop.AppControl.SetMime(_handle, value); - if (err == Interop.AppControl.ErrorCode.None) - { - _mime = value; - } - else - { - Log.Warn(LogTag, "Failed to set the mime to the appcontrol. Err = " + err); - } - } - } - - /// - /// Gets and sets the URI of the data. - /// - /// - /// Since Tizen 2.4, if the parameter 'uri' is started with 'file://' and - /// it is a regular file in this application's data path, which can be obtained - /// by property DataPath in ApplicationInfo class, - /// it will be shared to the callee application. - /// Framework will grant a temporary permission to the callee application for this file and - /// revoke it when the callee application is terminated. - /// The callee application can just read it. - /// (if the uri is null for setter, it clears the previous value.) - /// - /// - /// - /// public class AppControlExample : UIApplication - /// { - /// ... - /// protected override void OnAppControlReceived(AppControlReceivedEventArgs e) - /// { - /// ... - /// AppControl appControl = new AppControl(); - /// appContrl.Uri = this.ApplicationInfo.DataPath + "image.jpg"; - /// Log.Debug(LogTag, "Set Uri: " + appControl.Uri); - /// } - /// } - /// - /// - public string Uri - { - get - { - if (String.IsNullOrEmpty(_uri)) - { - Interop.AppControl.ErrorCode err = Interop.AppControl.GetUri(_handle, out _uri); - if (err != Interop.AppControl.ErrorCode.None) - { - Log.Warn(LogTag, "Failed to get the uri from the appcontrol. Err = " + err); - } - } - return _uri; - } - set - { - Interop.AppControl.ErrorCode err = Interop.AppControl.SetUri(_handle, value); - if (err == Interop.AppControl.ErrorCode.None) - { - _uri = value; - } - else - { - Log.Warn(LogTag, "Failed to set the uri to the appcontrol. Err = " + err); - } - } - } - - /// - /// Gets and sets the explicit category. - /// - /// - /// (if the category is null for setter, it clears the previous value.) - /// - public string Category - { - get - { - if (String.IsNullOrEmpty(_category)) - { - Interop.AppControl.ErrorCode err = Interop.AppControl.GetCategory(_handle, out _category); - if (err != Interop.AppControl.ErrorCode.None) - { - Log.Warn(LogTag, "Failed to get the category from the appcontrol. Err = " + err); - } - } - return _category; - } - set - { - Interop.AppControl.ErrorCode err = Interop.AppControl.SetCategory(_handle, value); - if (err == Interop.AppControl.ErrorCode.None) - { - _category = value; - } - else - { - Log.Warn(LogTag, "Failed to set the category to the appcontrol. Err = " + err); - } - } - } - - /// - /// Gets and sets the application ID to explicitly launch. - /// - /// - /// (if the application ID is null for setter, it clears the previous value.) - /// - /// - /// - /// AppControl appControl = new AppControl(); - /// appControl.ApplicationId = "org.tizen.calculator"; - /// Log.Debug(LogTag, "ApplicationId: " + appControl.ApplicationId); - /// - /// - public string ApplicationId - { - get - { - if (String.IsNullOrEmpty(_applicationId)) - { - Interop.AppControl.ErrorCode err = Interop.AppControl.GetAppId(_handle, out _applicationId); - if (err != Interop.AppControl.ErrorCode.None) - { - Log.Warn(LogTag, "Failed to get the application id from the AppControl. Err = " + err); - } - } - return _applicationId; - } - set - { - Interop.AppControl.ErrorCode err = Interop.AppControl.SetAppId(_handle, value); - if (err == Interop.AppControl.ErrorCode.None) - { - _applicationId = value; - } - else - { - Log.Warn(LogTag, "Failed to set the application id to the AppControl. Err = " + err); - } - } - } - - /// - /// Gets and sets the launch mode of the application. - /// - /// - /// Although, LaunchMode were set as AppControlLaunchMode.Group, the - /// callee application would be launched as a single mode - /// if the manifest file of callee application defined the launch mode as "single". - /// This property can just set the preference of the caller application to launch an application. - /// Sub-applications, which were launched as a group mode always have own process. - /// Since Tizen 3.0, if launch mode is not set in the caller application control, - /// this property returns the AppControlLaunchMode.Single launch mode. - /// - /// - /// - /// AppControl appControl = new AppControl(); - /// appControl.LaunchMode = AppControlLaunchMode.Group; - /// - /// - public AppControlLaunchMode LaunchMode - { - get - { - int value = 0; - Interop.AppControl.ErrorCode err = Interop.AppControl.GetLaunchMode(_handle, out value); - if (err != Interop.AppControl.ErrorCode.None) - { - Log.Warn(LogTag, "Failed to get the LaunchMode from the AppControl. Err = " + err); - } - return (AppControlLaunchMode)value; - } - set - { - Interop.AppControl.ErrorCode err = Interop.AppControl.SetLaunchMode(_handle, (int)value); - if (err != Interop.AppControl.ErrorCode.None) - { - Log.Warn(LogTag, "Failed to set the LaunchMode to the AppControl. Err = " + err); - } - } - } - - /// - /// Gets the collection of the extra data. - /// - /// - /// Extra data for communication between AppControls. - /// - /// - /// - /// AppControl appControl = new AppControl(); - /// appControl.ExtraData.Add("key", "value"); - /// ... - /// - /// - public ExtraDataCollection ExtraData - { - get - { - if (_extraData == null) - _extraData = new ExtraDataCollection(_handle); - return _extraData; - } - } - - #endregion // Public Properties - - /// - /// Retrieves all applications that can be launched to handle the given app_control request. - /// - /// The AppControl. - /// ApplicationIds. - /// Thrown when failed because of an invalid parameter. - /// - /// - /// IEnumerable applicationIds = AppControl.GetMatchedApplicationIds(control); - /// if (applicationIds != null) - /// { - /// foreach (string id in applicationIds) - /// { - /// // ... - /// } - /// } - /// - /// - public static IEnumerable GetMatchedApplicationIds(AppControl control) - { - if (control == null) - { - throw new ArgumentNullException("control"); - } - - List ids = new List(); - Interop.AppControl.AppMatchedCallback callback = (handle, applicationId, userData) => - { - if (applicationId == null) - { - return false; - } - - ids.Add(applicationId); - return true; - }; - - Interop.AppControl.ErrorCode err = Interop.AppControl.ForeachAppMatched(control._handle, callback, IntPtr.Zero); - if (err != Interop.AppControl.ErrorCode.None) - { - throw new InvalidOperationException("Failed to get matched application ids. err = " + err); - } - - return ids; - } - - /// - /// Sends the launch request. - /// - /// - /// The operation is mandatory information for the launch request. - /// If the operation is not specified, AppControlOperations.Default is used by default. - /// If the operation is AppControlOperations.Default, the application ID is mandatory to explicitly launch the application. \n - /// Since Tizen 2.4, the launch request of the service application over out of packages is restricted by the platform. - /// Also, implicit launch requests are NOT delivered to service applications since 2.4. - /// To launch a service application, an explicit launch request with the application ID given by property ApplicationId MUST be sent. - /// - /// The AppControl. - /// Thrown when failed because of a null argument. - /// Thrown when failed because of an invalid operation. - /// Thrown when failed because of timeout. - /// http://tizen.org/privilege/appmanager.launch - /// - /// - /// AppControl appControl = new AppControl(); - /// appControl.ApplicationId = "org.tizen.calculator"; - /// AppControl.SendLaunchRequest(appControl); - /// - /// - public static void SendLaunchRequest(AppControl launchRequest) - { - SendLaunchRequest(launchRequest, null); - } - - /// - /// Sends the launch request. - /// - /// - /// The operation is mandatory information for the launch request. - /// If the operation is not specified, AppControlOperations.Default is used by default. - /// If the operation is AppControlOperations.Default, the application ID is mandatory to explicitly launch the application. \n - /// Since Tizen 2.4, the launch request of the service application over out of packages is restricted by the platform. - /// Also, implicit launch requests are NOT delivered to service applications since 2.4. - /// To launch a service application, an explicit launch request with the application ID given by property ApplicationId MUST be sent. - /// - /// The AppControl. - /// The callback function to be called when the reply is delivered. - /// Thrown when failed because of the argument is invalid. - /// Thrown when failed because of an invalid operation. - /// Thrown when failed because of timeout. - /// http://tizen.org/privilege/appmanager.launch - /// - /// - /// AppControl appControl = new AppControl(); - /// appControl.ApplicationId = "org.tizen.calculator"; - /// AppControl.SendLaunchRequest(appControl, (launchRequest, replyRequest, result) => { - /// // ... - /// }); - /// - /// - public static void SendLaunchRequest(AppControl launchRequest, AppControlReplyCallback replyAfterLaunching) - { - if (launchRequest == null) - { - throw new ArgumentNullException("launchRequest"); - } - - Interop.AppControl.ErrorCode err; - - if (replyAfterLaunching != null) - { - int id = 0; - lock (s_replyNativeCallbackMaps) - { - id = s_replyNativeCallbackId++; - s_replyNativeCallbackMaps[id] = (launchRequestHandle, replyRequestHandle, result, userData) => - { - if (replyAfterLaunching != null) - { - Log.Debug(LogTag, "Reply Callback is launched"); - replyAfterLaunching(new AppControl(launchRequestHandle), new AppControl(replyRequestHandle), (AppControlReplyResult)result); - if (result != Interop.AppControl.AppStartedStatus) - { - lock (s_replyNativeCallbackMaps) - { - s_replyNativeCallbackMaps.Remove(id); - } - } - } - }; - } - err = Interop.AppControl.SendLaunchRequest(launchRequest._handle, s_replyNativeCallbackMaps[id], IntPtr.Zero); - } - else - { - err = Interop.AppControl.SendLaunchRequest(launchRequest._handle, null, IntPtr.Zero); - } - - if (err != Interop.AppControl.ErrorCode.None) - { - switch (err) - { - case Interop.AppControl.ErrorCode.InvalidParameter: - throw new ArgumentException("Invalid Arguments"); - case Interop.AppControl.ErrorCode.TimedOut: - throw new TimeoutException("Timed out"); - default: - throw new InvalidOperationException("Error = " + err); - } - } - } - - /// - /// Sends the terminate request to the application that is launched by AppControl. - /// - /// - /// You are not allowed to terminate other general applications using this API. - /// This API can be used to terminate sub-applications, which were launched as a group mode by the caller application. - /// Once the callee application is being terminated by this API, - /// other applications, which were launched by the callee application as a group mode will be terminated as well. - /// - /// The AppControl. - /// Thrown when failed because of the argument is invalid. - /// Thrown when failed because of an invalid operation. - /// Thrown when failed because of timeout. - /// - /// - /// AppControl terminateRequest = new AppControl(); - /// terminateRequest.ApplicationId = "org.tizen.calculator"; - /// AppControl.SendTerminateRequest(terminateRequest); - /// - /// - public static void SendTerminateRequest(AppControl terminateRequest) - { - if (terminateRequest == null) - { - throw new ArgumentNullException("terminateRequest"); - } - Interop.AppControl.ErrorCode err; - - err = Interop.AppControl.SendTerminateRequest(terminateRequest._handle); - - if (err != Interop.AppControl.ErrorCode.None) - { - switch (err) - { - case Interop.AppControl.ErrorCode.InvalidParameter: - throw new ArgumentException("Invalid Arguments"); - case Interop.AppControl.ErrorCode.TimedOut: - throw new TimeoutException("Timed out"); - default: - throw new InvalidOperationException("Error = " + err); - } - } - } - - /// - /// Class for extra data. - /// - public class ExtraDataCollection - { - private readonly SafeAppControlHandle _handle; - - internal ExtraDataCollection(SafeAppControlHandle handle) - { - _handle = handle; - } - - /// - /// Adds extra data. - /// - /// - /// The function replaces any existing value for the given key. - /// - /// The name of the extra data. - /// The value associated with the given key. - /// Thrown when a key or a value is a zero-length string. - /// Thrown when the application tries to use the same key with the system-defined key. - /// - /// - /// AppControl appControl = new AppControl(); - /// appControl.ExtraData.Add("myKey", "myValue"); - /// - /// - public void Add(string key, string value) - { - if (string.IsNullOrEmpty(key)) - { - throw new ArgumentNullException("key"); - } - if (string.IsNullOrEmpty(value)) - { - throw new ArgumentNullException("value"); - } - Interop.AppControl.ErrorCode err = Interop.AppControl.AddExtraData(_handle, key, value); - if (err != Interop.AppControl.ErrorCode.None) - { - switch (err) - { - case Interop.AppControl.ErrorCode.InvalidParameter: - throw new ArgumentException("Invalid parameter: key or value is a zero-length string"); - case Interop.AppControl.ErrorCode.KeyRejected: - throw new ArgumentException("Key is rejected: the key is system-defined key."); - default: - throw new InvalidOperationException("Error = " + err); - } - } - } - - /// - /// Adds extra data. - /// - /// - /// The function replaces any existing value for the given key. - /// - /// The name of the extra data. - /// The value associated with the given key. - /// Thrown when key or value is a zero-length string. - /// Thrown when the application tries to use the same key with the system-defined key. - /// - /// - /// AppControl appControl = new AppControl(); - /// string[] myValues = new string[] { "first", "second", "third" }; - /// appControl.ExtraData.Add("myKey", myValues); - /// - /// - public void Add(string key, IEnumerable value) - { - if (string.IsNullOrEmpty(key)) - { - throw new ArgumentNullException("key"); - } - if (value == null) - { - throw new ArgumentNullException("value"); - } - string[] valueArray = value.ToArray(); - Interop.AppControl.ErrorCode err = Interop.AppControl.AddExtraDataArray(_handle, key, valueArray, valueArray.Length); - if (err != Interop.AppControl.ErrorCode.None) - { - switch (err) - { - case Interop.AppControl.ErrorCode.InvalidParameter: - throw new ArgumentException("Invalid parameter: key or value is a zero-length string"); - case Interop.AppControl.ErrorCode.KeyRejected: - throw new ArgumentException("Key is rejected: the key is system-defined key."); - default: - throw new InvalidOperationException("Error = " + err); - } - } - } - - /// - /// Gets the extra data. - /// - /// Only string and IEnumerable<string> - /// The name of extra data. - /// The value associated with the given key. - /// Thrown when the key is an invalid parameter. - /// Thrown when the key is not found. - /// Thrown when the key is rejected. - /// - /// - /// AppControl appControl = new AppControl(); - /// string myValue = appControl.ExtraData.Get("myKey"); - /// - /// - public T Get(string key) - { - object ret = Get(key); - return (T)ret; - } - - /// - /// Gets the extra data. - /// - /// The name of extra data. - /// The value associated with the given key. - /// Thrown when the key is an invalid parameter. - /// Thrown when the key is not found. - /// Thrown when the key is rejected. - /// - /// - /// AppControl appControl = new AppControl(); - /// string myValue = appControl.ExtraData.Get("myKey") as string; - /// if (myValue != null) - /// { - /// // ... - /// } - /// - /// - public object Get(string key) - { - if (IsCollection(key)) - { - return GetDataCollection(key); - } - else - { - return GetData(key); - } - } - - /// - /// Gets all keys in extra data. - /// - /// The keys in the AppControl. - /// Thrown when the key is an invalid parameter. - /// - /// - /// AppControl appControl = new AppControl(); - /// IEnumerable keys = appControl.GetKeys(); - /// if (keys != null) - /// { - /// foreach (string key in keys) - /// { - /// // ... - /// } - /// } - /// - /// - public IEnumerable GetKeys() - { - List keys = new List(); - Interop.AppControl.ExtraDataCallback callback = (handle, key, userData) => - { - if (key == null) - { - return false; - } - - keys.Add(key); - return true; - }; - - Interop.AppControl.ErrorCode err = Interop.AppControl.ForeachExtraData(_handle, callback, IntPtr.Zero); - if (err != Interop.AppControl.ErrorCode.None) - { - throw new InvalidOperationException("Failed to get keys. err = " + err); - } - - return keys; - } - - /// - /// Tries getting the extra data. - /// - /// The name of extra data. - /// The value associated with the given key. - /// The result whether getting the value is done. - /// Thrown when the key is an invalid parameter. - /// Thrown when the key is not found. - /// Thrown when the key is rejected. - /// - /// - /// AppControl appControl = new AppControl(); - /// string myValue = string.Empty; - /// bool result = appControl.ExtraData.TryGet("myKey", out myValue); - /// if (result != null) - /// { - /// // ... - /// } - /// - /// - public bool TryGet(string key, out string value) - { - if (string.IsNullOrEmpty(key)) - { - throw new ArgumentNullException("key"); - } - Interop.AppControl.GetExtraData(_handle, key, out value); - if (value != null) - { - return true; - } - else - { - value = default(string); - return false; - } - } - - /// - /// Tries getting the extra data. - /// - /// The name of extra data. - /// The value associated with the given key. - /// The result whether getting the value is done. - /// Thrown when the key is an invalid parameter. - /// Thrown when the key is not found. - /// Thrown when the key is rejected. - /// - /// - /// AppControl appControl = new AppControl(); - /// IEnumerable myValue = null; - /// bool result = appControl.ExtraData.TryGet("myKey", out myValue); - /// if (result) - /// { - /// foreach (string value in myValue) - /// { - /// // ... - /// } - /// } - /// - /// - public bool TryGet(string key, out IEnumerable value) - { - if (string.IsNullOrEmpty(key)) - { - throw new ArgumentNullException("key"); - } - IntPtr valuePtr = IntPtr.Zero; - int len = -1; - Interop.AppControl.ErrorCode err = Interop.AppControl.GetExtraDataArray(_handle, key, out valuePtr, out len); - if (err == Interop.AppControl.ErrorCode.None && valuePtr != IntPtr.Zero) - { - List stringList = new List(); - for (int i = 0; i < len; ++i) - { - IntPtr charArr = Marshal.ReadIntPtr(valuePtr, IntPtr.Size * i); - stringList.Add(Marshal.PtrToStringAnsi(charArr)); - Interop.Libc.Free(charArr); - } - Interop.Libc.Free(valuePtr); - value = stringList; - return true; - } - else - { - value = default(IEnumerable); - return false; - } - } - - /// - /// Removes the extra data. - /// - /// The name of the extra data. - /// Thrown when the key is a zero-length string. - /// Thrown when the key is not found. - /// Thrown when the key is rejected. - /// - /// - /// AppControl appControl = new AppControl(); - /// appControl.ExtraData.Remove("myKey"); - /// - /// - public void Remove(string key) - { - if (string.IsNullOrEmpty(key)) - { - throw new ArgumentNullException("key"); - } - Interop.AppControl.ErrorCode err = Interop.AppControl.RemoveExtraData(_handle, key); - if (err != Interop.AppControl.ErrorCode.None) - { - switch (err) - { - case Interop.AppControl.ErrorCode.InvalidParameter: - throw new ArgumentException("Invalid parameter: key is a zero-length string"); - case Interop.AppControl.ErrorCode.KeyNotFound: - throw new KeyNotFoundException("Key is not found"); ; - case Interop.AppControl.ErrorCode.KeyRejected: - throw new ArgumentException("Key is rejected: the key is system-defined key."); - default: - throw new InvalidOperationException("Error = " + err); - } - } - } - - /// - /// Counts keys in the extra data. - /// - /// The number of counting keys. - /// Thrown when the key is an invalid parameter. - /// - /// - /// AppControl appControl = new AppControl(); - /// int numberOfKeys = appControl.ExtraData.Count(); - /// - /// - public int Count() - { - return GetKeys().Count(); - } - - /// - /// Checks whether the extra data associated with the given key is of the collection data type. - /// - /// The name of the extra data. - /// If true, the extra data is of the array data type, otherwise false. - /// Thrown when the key is a zero-length string. - /// Thrown when failed to check the key. - /// - /// - /// AppControl appControl = new AppControl(); - /// bool result = appControl.ExtraData.IsCollection("myKey"); - /// - /// - public bool IsCollection(string key) - { - if (string.IsNullOrEmpty(key)) - { - throw new ArgumentNullException("key"); - } - bool isArray = false; - Interop.AppControl.ErrorCode err = Interop.AppControl.IsExtraDataArray(_handle, key, out isArray); - if (err != Interop.AppControl.ErrorCode.None) - { - throw new InvalidOperationException("Error = " + err); - } - return isArray; - } - - private string GetData(string key) - { - if (string.IsNullOrEmpty(key)) - { - throw new ArgumentNullException("key"); - } - string value = string.Empty; - Interop.AppControl.ErrorCode err = Interop.AppControl.GetExtraData(_handle, key, out value); - if (err != Interop.AppControl.ErrorCode.None) - { - switch (err) - { - case Interop.AppControl.ErrorCode.InvalidParameter: - throw new ArgumentException("Invalid parameter: key is a zero-length string"); - case Interop.AppControl.ErrorCode.KeyNotFound: - throw new KeyNotFoundException("Key is not found"); ; - case Interop.AppControl.ErrorCode.InvalidDataType: - throw new ArgumentException("Invalid data type: value is data collection type"); - case Interop.AppControl.ErrorCode.KeyRejected: - throw new ArgumentException("Key is rejected: the key is system-defined key."); - default: - throw new InvalidOperationException("Error = " + err); - } - } - return value; - } - - private IEnumerable GetDataCollection(string key) - { - if (string.IsNullOrEmpty(key)) - { - throw new ArgumentNullException("key"); - } - IntPtr valuePtr = IntPtr.Zero; - int len = -1; - Interop.AppControl.ErrorCode err = Interop.AppControl.GetExtraDataArray(_handle, key, out valuePtr, out len); - if (err != Interop.AppControl.ErrorCode.None) - { - switch (err) - { - case Interop.AppControl.ErrorCode.InvalidParameter: - throw new ArgumentException("Invalid parameter: key is a zero-length string"); - case Interop.AppControl.ErrorCode.KeyNotFound: - throw new KeyNotFoundException("Key is not found"); ; - case Interop.AppControl.ErrorCode.InvalidDataType: - throw new ArgumentException("Invalid data type: value is data collection type"); - case Interop.AppControl.ErrorCode.KeyRejected: - throw new ArgumentException("Key is rejected: the key is system-defined key."); - default: - throw new InvalidOperationException("Error = " + err); - } - } - - List valueArray = new List(); - if (valuePtr != IntPtr.Zero) - { - for (int i = 0; i < len; ++i) - { - IntPtr charArr = Marshal.ReadIntPtr(valuePtr, IntPtr.Size * i); - valueArray.Add(Marshal.PtrToStringAnsi(charArr)); - Interop.Libc.Free(charArr); - } - Interop.Libc.Free(valuePtr); - } - return valueArray; - } - } - } -} diff --git a/src/Tizen.Applications.Common/Tizen.Applications/AppControlData.cs b/src/Tizen.Applications.Common/Tizen.Applications/AppControlData.cs deleted file mode 100755 index b3cb0a80a..000000000 --- a/src/Tizen.Applications.Common/Tizen.Applications/AppControlData.cs +++ /dev/null @@ -1,149 +0,0 @@ -/* - * 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. - */ - -namespace Tizen.Applications -{ - /// - /// Data of the AppControl. - /// - public static class AppControlData - { - /// - /// Subject. - /// - public const string Subject = "http://tizen.org/appcontrol/data/subject"; - - /// - /// Recipients. - /// - public const string To = "http://tizen.org/appcontrol/data/to"; - - /// - /// E-mail addresses that should be carbon copied. - /// - public const string Cc = "http://tizen.org/appcontrol/data/cc"; - - /// - /// E-mail addresses that should be blind carbon copied. - /// - public const string Bcc = "http://tizen.org/appcontrol/data/bcc"; - - /// - /// Text. - /// - public const string Text = "http://tizen.org/appcontrol/data/text"; - - /// - /// Title. - /// - public const string Title = "http://tizen.org/appcontrol/data/title"; - - /// - /// Selected items. - /// - public const string Selected = "http://tizen.org/appcontrol/data/selected"; - - /// - /// Paths of items. - /// - public const string Path = "http://tizen.org/appcontrol/data/path"; - - /// - /// Selection mode ("single" or "multiple"). - /// - public const string SectionMode = "http://tizen.org/appcontrol/data/selection_mode"; - - /// - /// All-day mode of the event ("true" or "false"). - /// - public const string AllDay = "http://tizen.org/appcontrol/data/calendar/all_day"; - - /// - /// Start time of the event (format: YYYY-MM-DD HH:MM:SS). - /// - public const string StartTime = "http://tizen.org/appcontrol/data/calendar/start_time"; - - /// - /// End time of the event (format: YYYY-MM-DD HH:MM:SS). - /// - public const string Endtime = "http://tizen.org/appcontrol/data/calendar/end_time"; - - /// - /// E-mail addressed. - /// - public const string Email = "http://tizen.org/appcontrol/data/email"; - - /// - /// Phone numbers. - /// - public const string Phone = "http://tizen.org/appcontrol/data/phone"; - - /// - /// URLs. - /// - public const string Url = "http://tizen.org/appcontrol/data/url"; - - /// - /// IDs. - /// - public const string Ids = "http://tizen.org/appcontrol/data/id"; - - /// - /// Type. - /// - public const string Type = "http://tizen.org/appcontrol/data/type"; - - /// - /// Total count. - /// - public const string TotalCount = "http://tizen.org/appcontrol/data/total_count"; - - /// - /// Total size (unit : bytes). - /// - public const string TotalSize = "http://tizen.org/appcontrol/data/total_size"; - - /// - /// Name. - /// - public const string Name = "http://tizen.org/appcontrol/data/name"; - - /// - /// Location. - /// - public const string Location = "http://tizen.org/appcontrol/data/location"; - - /// - /// Select the type of input method. - /// - public const string InputType = "http://tizen.org/appcontrol/data/input_type"; - - /// - /// Send the pre inputted text, such as "http://" in web. - /// - public const string InputDefaultText = "http://tizen.org/appcontrol/data/input_default_text"; - - /// - /// Send guide text to show to the user, such as "Input user name". - /// - public const string InputGuideText = "http://tizen.org/appcontrol/data/input_guide_text"; - - /// - /// Send text to receive answer result from smart reply. - /// - public const string InputPredictionHint = "http://tizen.org/appcontrol/data/input_prediction_hint"; - } -} diff --git a/src/Tizen.Applications.Common/Tizen.Applications/AppControlLaunchMode.cs b/src/Tizen.Applications.Common/Tizen.Applications/AppControlLaunchMode.cs deleted file mode 100755 index 1a0c5d1c4..000000000 --- a/src/Tizen.Applications.Common/Tizen.Applications/AppControlLaunchMode.cs +++ /dev/null @@ -1,34 +0,0 @@ -/* - * 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. - */ - -namespace Tizen.Applications -{ - /// - /// Enumeration for the application control launch mode. - /// - public enum AppControlLaunchMode - { - /// - /// Prefer to launch an application as a single mode. - /// - Single = 0, - - /// - /// Prefer to launch an application as a group mode. - /// - Group, - } -} diff --git a/src/Tizen.Applications.Common/Tizen.Applications/AppControlOperations.cs b/src/Tizen.Applications.Common/Tizen.Applications/AppControlOperations.cs deleted file mode 100755 index a3e4623e6..000000000 --- a/src/Tizen.Applications.Common/Tizen.Applications/AppControlOperations.cs +++ /dev/null @@ -1,159 +0,0 @@ -/* - * 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. - */ - -namespace Tizen.Applications -{ - /// - /// Operations of the AppControl. - /// - public static class AppControlOperations - { - /// - /// An explicit launch for a homescreen application. - /// - public const string Main = "http://tizen.org/appcontrol/operation/main"; - - /// - /// An explicit launch for an application that excludes a homescreen application. - /// - public const string Default = "http://tizen.org/appcontrol/operation/default"; - - /// - /// Provides an editable access to the given data. - /// - public const string Edit = "http://tizen.org/appcontrol/operation/edit"; - - /// - /// Displays the data. - /// - public const string View = "http://tizen.org/appcontrol/operation/view"; - - /// - /// Picks items. - /// - public const string Pick = "http://tizen.org/appcontrol/operation/pick"; - - /// - /// Creates contents. - /// - public const string CreateContent = "http://tizen.org/appcontrol/operation/create_content"; - - /// - /// Performs a call to someone. - /// - public const string Call = "http://tizen.org/appcontrol/operation/call"; - - /// - /// Delivers some data to someone else. - /// - public const string Send = "http://tizen.org/appcontrol/operation/send"; - - /// - /// Delivers text data to someone else. - /// - public const string SendText = "http://tizen.org/appcontrol/operation/send_text"; - - /// - /// Shares an item with someone else. - /// - public const string Share = "http://tizen.org/appcontrol/operation/share"; - - /// - /// Shares multiple items with someone else. - /// - public const string MultiShare = "http://tizen.org/appcontrol/operation/multi_share"; - - /// - /// Shares text data with someone else. - /// - public const string ShareText = "http://tizen.org/appcontrol/operation/share_text"; - - /// - /// Dials a number. This shows an UI with the number to be dialed, allowing the user to explicitly initiate the call. - /// - public const string Dial = "http://tizen.org/appcontrol/operation/dial"; - - /// - /// Performs a search. - /// - public const string Search = "http://tizen.org/appcontrol/operation/search"; - - /// - /// Downloads items. - /// - public const string Download = "http://tizen.org/appcontrol/operation/download"; - - /// - /// Prints contents. - /// - public const string Print = "http://tizen.org/appcontrol/operation/print"; - - /// - /// Composes a message. - /// - public const string Compose = "http://tizen.org/appcontrol/operation/compose"; - - /// - /// Can be launched by interested System-Event. - /// - public const string LaunchOnEvent = "http://tizen.org/appcontrol/operation/launch_on_event"; - - /// - /// Adds an item. - /// - public const string Add = "http://tizen.org/appcontrol/operation/add"; - - /// - /// Captures images by camera applications. - /// - public const string ImageCapture = "http://tizen.org/appcontrol/operation/image_capture"; - - /// - /// Captures videos by camera applications. - /// - public const string VideoCapture = "http://tizen.org/appcontrol/operation/video_capture"; - - /// - /// Shows system settings. - /// - public const string Setting = "http://tizen.org/appcontrol/operation/setting"; - - /// - /// Shows settings to enable Bluetooth. - /// - public const string SettingBluetoothEnable = "http://tizen.org/appcontrol/operation/setting/bt_enable"; - - /// - /// Shows settings to configure the Bluetooth visibility. - /// - public const string SettingBluetoothVisibility = "http://tizen.org/appcontrol/operation/setting/bt_visibility"; - - /// - /// Shows settings to allow configuration of current location sources. - /// - public const string SettingLocation = "http://tizen.org/appcontrol/operation/setting/location"; - - /// - /// Shows NFC settings. - /// - public const string SettingNfc = "http://tizen.org/appcontrol/operation/setting/nfc"; - - /// - /// Shows settings to allow configuration of Wi-Fi. - /// - public const string SettingWifi = "http://tizen.org/appcontrol/operation/setting/wifi"; - } -} diff --git a/src/Tizen.Applications.Common/Tizen.Applications/AppControlReceivedEventArgs.cs b/src/Tizen.Applications.Common/Tizen.Applications/AppControlReceivedEventArgs.cs deleted file mode 100755 index 890146889..000000000 --- a/src/Tizen.Applications.Common/Tizen.Applications/AppControlReceivedEventArgs.cs +++ /dev/null @@ -1,40 +0,0 @@ -/* - * 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.Applications -{ - /// - /// Arguments for the event that raised when the application receives the AppControl. - /// - public class AppControlReceivedEventArgs : EventArgs - { - /// - /// Initializes the AppControlReceivedEventArgs class. - /// - /// - public AppControlReceivedEventArgs(ReceivedAppControl appControl) - { - ReceivedAppControl = appControl; - } - - /// - /// The received AppControl. - /// - public ReceivedAppControl ReceivedAppControl { get; private set; } - } -} diff --git a/src/Tizen.Applications.Common/Tizen.Applications/AppControlReplyCallback.cs b/src/Tizen.Applications.Common/Tizen.Applications/AppControlReplyCallback.cs deleted file mode 100755 index 1a9c6c90e..000000000 --- a/src/Tizen.Applications.Common/Tizen.Applications/AppControlReplyCallback.cs +++ /dev/null @@ -1,26 +0,0 @@ -/* - * 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. - */ - -namespace Tizen.Applications -{ - /// - /// Reply callback for the launch request - /// - /// The AppControl of the launch request that has been sent - /// The AppControl in which the results of the callee are contained - /// The result of the launch request - public delegate void AppControlReplyCallback(AppControl launchRequest, AppControl replyRequest, AppControlReplyResult result); -} diff --git a/src/Tizen.Applications.Common/Tizen.Applications/AppControlReplyResult.cs b/src/Tizen.Applications.Common/Tizen.Applications/AppControlReplyResult.cs deleted file mode 100755 index 86a33d3c7..000000000 --- a/src/Tizen.Applications.Common/Tizen.Applications/AppControlReplyResult.cs +++ /dev/null @@ -1,44 +0,0 @@ -/* - * 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. - */ - -namespace Tizen.Applications -{ - /// - /// Enumeration for the application control result. - /// - public enum AppControlReplyResult - { - /// - /// The callee application launched actually. - /// - AppStarted = 1, - - /// - /// The operation succeeded. - /// - Succeeded = 0, - - /// - /// The operation failed by the callee. - /// - Failed = -1, - - /// - /// The operation canceled by the platform. - /// - Canceled = -2, - } -} diff --git a/src/Tizen.Applications.Common/Tizen.Applications/Application.cs b/src/Tizen.Applications.Common/Tizen.Applications/Application.cs deleted file mode 100755 index 5d3077f07..000000000 --- a/src/Tizen.Applications.Common/Tizen.Applications/Application.cs +++ /dev/null @@ -1,140 +0,0 @@ -/* - * 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.Applications -{ - /// - /// The class that represents a Tizen application. - /// - public abstract class Application : IDisposable - { - internal const string LogTag = "Tizen.Applications"; - - private static Application s_CurrentApplication = null; - - private object _lock = new object(); - - private DirectoryInfo _directoryInfo; - private ApplicationInfo _applicationInfo; - - /// - /// Gets the instance of the current application. - /// - public static Application Current { get { return s_CurrentApplication; } } - - /// - /// Gets the class representing directory information of the current application. - /// - public DirectoryInfo DirectoryInfo - { - get - { - lock (_lock) - { - if (_directoryInfo == null) - { - _directoryInfo = new DirectoryInfo(); - } - } - return _directoryInfo; - } - } - - /// - /// Gets the class representing information of the current application. - /// - public ApplicationInfo ApplicationInfo - { - get - { - lock (_lock) - { - if (_applicationInfo == null) - { - string appId = string.Empty; - Interop.AppCommon.AppGetId(out appId); - if (!string.IsNullOrEmpty(appId)) - { - _applicationInfo = new ApplicationInfo(appId); - } - } - } - return _applicationInfo; - } - } - - /// - /// Runs the application's main loop. - /// - /// Arguments from commandline. - public virtual void Run(string[] args) - { - if (args == null) - { - throw new ArgumentNullException("args"); - } - s_CurrentApplication = this; - } - - /// - /// Exits the main loop of the application. - /// - public abstract void Exit(); - - #region IDisposable Support - private bool _disposedValue = false; // To detect redundant calls - - /// - /// Releases any unmanaged resources used by this object. Can also dispose any other disposable objects. - /// - /// If true, disposes any disposable objects. If false, does not dispose disposable objects. - protected virtual void Dispose(bool disposing) - { - if (!_disposedValue) - { - if (disposing) - { - if (_applicationInfo != null) - { - _applicationInfo.Dispose(); - } - } - - _disposedValue = true; - } - } - - /// - /// Finalizer of the application class. - /// - ~Application() - { - Dispose(false); - } - - /// - /// Releases all resources used by the application class. - /// - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - #endregion - } -} diff --git a/src/Tizen.Applications.Common/Tizen.Applications/ApplicationDisabledEventArgs.cs b/src/Tizen.Applications.Common/Tizen.Applications/ApplicationDisabledEventArgs.cs deleted file mode 100644 index 519793544..000000000 --- a/src/Tizen.Applications.Common/Tizen.Applications/ApplicationDisabledEventArgs.cs +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 2017 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.Applications -{ - /// - /// Arguments for the event raised when the application is disabled. - /// - public class ApplicationDisabledEventArgs : EventArgs - { - private readonly ApplicationEventState _eventState; - private readonly string _applicationId; - - internal ApplicationDisabledEventArgs(string appId, ApplicationEventState eventState) - { - _applicationId = appId; - _eventState = eventState; - } - - /// - /// The ID of the application. - /// - public string ApplicationId { get { return _applicationId; } } - - /// - /// The event state of the application. - /// - public ApplicationEventState EventState { get { return _eventState; } } - } -} - diff --git a/src/Tizen.Applications.Common/Tizen.Applications/ApplicationEnabledEventArgs.cs b/src/Tizen.Applications.Common/Tizen.Applications/ApplicationEnabledEventArgs.cs deleted file mode 100644 index 297ba833a..000000000 --- a/src/Tizen.Applications.Common/Tizen.Applications/ApplicationEnabledEventArgs.cs +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 2017 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.Applications -{ - /// - /// Arguments for the event raised when the application is enabled. - /// - public class ApplicationEnabledEventArgs : EventArgs - { - private readonly ApplicationEventState _eventState; - private readonly string _applicationId; - - internal ApplicationEnabledEventArgs(string appId, ApplicationEventState eventState) - { - _applicationId = appId; - _eventState = eventState; - } - - /// - /// The ID of the application. - /// - public string ApplicationId { get { return _applicationId; } } - - /// - /// The event state of the application. - /// - public ApplicationEventState EventState { get { return _eventState; } } - } -} - diff --git a/src/Tizen.Applications.Common/Tizen.Applications/ApplicationEventState.cs b/src/Tizen.Applications.Common/Tizen.Applications/ApplicationEventState.cs deleted file mode 100644 index fff69eac0..000000000 --- a/src/Tizen.Applications.Common/Tizen.Applications/ApplicationEventState.cs +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2017 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.Applications -{ - /// - /// Enumeration for the application event state. - /// - public enum ApplicationEventState - { - /// - /// Processing started. - /// - Started = Interop.ApplicationManager.AppManagerEventState.Started, - /// - /// Processing completed. - /// - Completed = Interop.ApplicationManager.AppManagerEventState.Completed, - /// - /// Processing failed. - /// - Failed = Interop.ApplicationManager.AppManagerEventState.Failed - } -} - diff --git a/src/Tizen.Applications.Common/Tizen.Applications/ApplicationInfo.cs b/src/Tizen.Applications.Common/Tizen.Applications/ApplicationInfo.cs deleted file mode 100755 index a0e722757..000000000 --- a/src/Tizen.Applications.Common/Tizen.Applications/ApplicationInfo.cs +++ /dev/null @@ -1,406 +0,0 @@ -/* - * 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.Collections.Generic; - -namespace Tizen.Applications -{ - /// - /// This class provides methods and properties to get information of the application. - /// - public class ApplicationInfo : IDisposable - { - private const string LogTag = "Tizen.Applications"; - private bool _disposed = false; - private IntPtr _infoHandle = IntPtr.Zero; - private string _applicationId = string.Empty; - private Interop.ApplicationManager.ErrorCode err = Interop.ApplicationManager.ErrorCode.None; - - internal ApplicationInfo(IntPtr infoHandle) - { - err = Interop.ApplicationManager.AppInfoGetAppId(infoHandle, out _applicationId); - if (err != Interop.ApplicationManager.ErrorCode.None) - { - throw new ArgumentException("Invalid native handle."); - } - _infoHandle = infoHandle; - } - - /// - /// A constructor of ApplicationInfo that takes the application ID. - /// - /// Application ID. - public ApplicationInfo(string applicationId) - { - _applicationId = applicationId; - } - - /// - /// Destructor of the class. - /// - ~ApplicationInfo() - { - Dispose(false); - } - - /// - /// Gets the application ID. - /// - public string ApplicationId - { - get - { - if (!string.IsNullOrEmpty(_applicationId)) - return _applicationId; - IntPtr infoHandle = GetInfoHandle(); - string appid = string.Empty; - if (infoHandle != IntPtr.Zero) - { - err = Interop.ApplicationManager.AppInfoGetAppId(infoHandle, out appid); - if (err != Interop.ApplicationManager.ErrorCode.None) - { - Log.Warn(LogTag, "Failed to get the application id. err = " + err); - } - } - return appid; - } - } - - /// - /// Gets the package ID of the application. - /// - public string PackageId - { - get - { - IntPtr infoHandle = GetInfoHandle(); - string packageid = string.Empty; - if (infoHandle != IntPtr.Zero) - { - err = Interop.ApplicationManager.AppInfoGetPackage(infoHandle, out packageid); - if (err != Interop.ApplicationManager.ErrorCode.None) - { - Log.Warn(LogTag, "Failed to get the package id of " + _applicationId + ". err = " + err); - } - } - return packageid; - } - } - - /// - /// Gets the label of the application. - /// - public string Label - { - get - { - IntPtr infoHandle = GetInfoHandle(); - string label = string.Empty; - if (infoHandle != IntPtr.Zero) - { - err = Interop.ApplicationManager.AppInfoGetLabel(infoHandle, out label); - if (err != Interop.ApplicationManager.ErrorCode.None) - { - Log.Warn(LogTag, "Failed to get the app label of " + _applicationId + ". err = " + err); - } - } - return label; - } - } - - /// - /// Gets the executable path of the application. - /// - public string ExecutablePath - { - get - { - IntPtr infoHandle = GetInfoHandle(); - string exec = string.Empty; - if (infoHandle != IntPtr.Zero) - { - err = Interop.ApplicationManager.AppInfoGetExec(infoHandle, out exec); - if (err != Interop.ApplicationManager.ErrorCode.None) - { - Log.Warn(LogTag, "Failed to get the executable file path of " + _applicationId + ". err = " + err); - } - } - return exec; - } - } - - /// - /// Gets the absolute path to the icon image. - /// - public string IconPath - { - get - { - IntPtr infoHandle = GetInfoHandle(); - string path = string.Empty; - if (infoHandle != IntPtr.Zero) - { - err = Interop.ApplicationManager.AppInfoGetIcon(infoHandle, out path); - if (err != Interop.ApplicationManager.ErrorCode.None) - { - Log.Warn(LogTag, "Failed to get the app icon path of " + _applicationId + ". err = " + err); - } - } - return path; - } - } - - /// - /// Gets the application type name. - /// - public string ApplicationType - { - get - { - IntPtr infoHandle = GetInfoHandle(); - string type = string.Empty; - if (infoHandle != IntPtr.Zero) - { - err = Interop.ApplicationManager.AppInfoGetType(infoHandle, out type); - if (err != Interop.ApplicationManager.ErrorCode.None) - { - Log.Warn(LogTag, "Failed to get the application type of " + _applicationId + ". err = " + err); - } - } - return type; - } - } - - /// - /// Gets the application's metadata. - /// - public IDictionary Metadata - { - get - { - IDictionary metadata = new Dictionary(); - - Interop.ApplicationManager.AppInfoMetadataCallback cb = (string key, string value, IntPtr userData) => - { - if (key.Length != 0) - { - metadata.Add(key, value); - } - return true; - }; - - IntPtr infoHandle = GetInfoHandle(); - if (infoHandle != IntPtr.Zero) - { - err = Interop.ApplicationManager.AppInfoForeachMetadata(infoHandle, cb, IntPtr.Zero); - if (err != Interop.ApplicationManager.ErrorCode.None) - { - Log.Warn(LogTag, "Failed to get application metadata of " + _applicationId + ". err = " + err); - } - } - return metadata; - } - } - - /// - /// Checks whether the application information is nodisplay. If the application icon is not displayed on the menu screen, true; otherwise, false. - /// - public bool IsNoDisplay - { - get - { - IntPtr infoHandle = GetInfoHandle(); - bool nodisplay = false; - if (infoHandle != IntPtr.Zero) - { - err = Interop.ApplicationManager.AppInfoIsNodisplay(infoHandle, out nodisplay); - if (err != Interop.ApplicationManager.ErrorCode.None) - { - Log.Warn(LogTag, "Failed to get the IsNoDisplay value of " + _applicationId + ". err = " + err); - - } - } - return nodisplay; - } - } - - /// - /// Checks whether the application is launched on booting time. If the application automatically starts on boot, true; otherwise, false. - /// - public bool IsOnBoot - { - get - { - IntPtr infoHandle = GetInfoHandle(); - bool onboot = false; - if (infoHandle != IntPtr.Zero) - { - err = Interop.ApplicationManager.AppInfoIsOnBoot(infoHandle, out onboot); - if (err != Interop.ApplicationManager.ErrorCode.None) - { - Log.Warn(LogTag, "Failed to get the IsOnBoot value of " + _applicationId + ". err = " + err); - } - } - return onboot; - } - } - - /// - /// Checks whether the application is preloaded. If the application is preloaded, true; otherwise, false. - /// - public bool IsPreload - { - get - { - IntPtr infoHandle = GetInfoHandle(); - bool preloaded = false; - if (infoHandle != IntPtr.Zero) - { - err = Interop.ApplicationManager.AppInfoIsPreLoad(infoHandle, out preloaded); - if (err != Interop.ApplicationManager.ErrorCode.None) - { - Log.Warn(LogTag, "Failed to get the IsPreload value of " + _applicationId + ". err = " + err); - } - } - return preloaded; - } - } - - /// - /// Gets the shared data path. - /// - public string SharedDataPath - { - get - { - string path = string.Empty; - err = Interop.ApplicationManager.AppManagerGetSharedDataPath(ApplicationId, out path); - if (err != Interop.ApplicationManager.ErrorCode.None) - { - Log.Warn(LogTag, "Failed to get the SharedDataPath of " + _applicationId + ". err = " + err); - } - return path; - } - } - - /// - /// Gets the shared resource path. - /// - public string SharedResourcePath - { - get - { - string path = string.Empty; - err = Interop.ApplicationManager.AppManagerGetSharedResourcePath(ApplicationId, out path); - if (err != Interop.ApplicationManager.ErrorCode.None) - { - Log.Warn(LogTag, "Failed to get the SharedResourcePath of " + _applicationId + ". err = " + err); - } - return path; - } - } - - /// - /// Gets the shared trust path. - /// - public string SharedTrustedPath - { - get - { - string path = string.Empty; - err = Interop.ApplicationManager.AppManagerGetSharedTrustedPath(ApplicationId, out path); - if (err != Interop.ApplicationManager.ErrorCode.None) - { - Log.Warn(LogTag, "Failed to get the SharedTrustedPath of " + _applicationId + ". err = " + err); - } - return path; - } - } - - /// - /// Gets the external shared data path. - /// - public string ExternalSharedDataPath - { - get - { - string path = string.Empty; - err = Interop.ApplicationManager.AppManagerGetExternalSharedDataPath(ApplicationId, out path); - if (err != Interop.ApplicationManager.ErrorCode.None) - { - Log.Warn(LogTag, "Failed to get the ExternalSharedDataPath of " + _applicationId + ". err = " + err); - } - return path; - } - } - - /// - /// Gets the localized label of the application for the given locale. - /// - /// Locale. - public string GetLocalizedLabel(string locale) - { - string label = string.Empty; - err = Interop.ApplicationManager.AppInfoGetLocaledLabel(ApplicationId, locale, out label); - if (err != Interop.ApplicationManager.ErrorCode.None) - { - Log.Warn(LogTag, "Failed to get the GetLocalizedLabel of " + _applicationId + ". err = " + err); - label = Label; - } - return label; - } - - private IntPtr GetInfoHandle() - { - if (_infoHandle == IntPtr.Zero) - { - IntPtr infoHandle = IntPtr.Zero; - err = Interop.ApplicationManager.AppManagerGetAppInfo(_applicationId, out infoHandle); - if (err != Interop.ApplicationManager.ErrorCode.None) - { - Log.Warn(LogTag, "Failed to get the handle of the ApplicationInfo. err = " + err); - } - _infoHandle = infoHandle; - } - return _infoHandle; - } - - /// - /// Releases all resources used by the ApplicationInfo class. - /// - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - - private void Dispose(bool disposing) - { - if (_disposed) - return; - if (disposing) - { - } - if (_infoHandle != IntPtr.Zero) - { - Interop.ApplicationManager.AppInfoDestroy(_infoHandle); - _infoHandle = IntPtr.Zero; - } - _disposed = true; - } - } -} diff --git a/src/Tizen.Applications.Common/Tizen.Applications/ApplicationInfoFilter.cs b/src/Tizen.Applications.Common/Tizen.Applications/ApplicationInfoFilter.cs deleted file mode 100755 index 313d30b8c..000000000 --- a/src/Tizen.Applications.Common/Tizen.Applications/ApplicationInfoFilter.cs +++ /dev/null @@ -1,70 +0,0 @@ -/* - * 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.Collections.Generic; - -namespace Tizen.Applications -{ - /// - /// This class is a parameter of the GetInstalledApplicationsAsync method. - /// - public class ApplicationInfoFilter - { - /// - /// - /// - public ApplicationInfoFilter() - { - Filter = new Dictionary(); - } - - /// - /// This class is a possible key to use in the InstalledApplicationFilter. - /// - public static class Keys - { - /// - /// - /// - public const string Id = "PACKAGE_INFO_PROP_APP_ID"; - /// - /// - /// - public const string Type = "PACKAGE_INFO_PROP_APP_TYPE"; - /// - /// - /// - public const string Category = "PACKAGE_INFO_PROP_APP_CATEGORY"; - /// - /// - /// - public const string NoDisplay = "PACKAGE_INFO_PROP_APP_NODISPLAY"; - /// - /// - /// - public const string TaskManage = "PACKAGE_INFO_PROP_APP_TASKMANAGE"; - } - - /// - /// - /// - public IDictionary Filter - { - get; private set; - } - } -} diff --git a/src/Tizen.Applications.Common/Tizen.Applications/ApplicationInfoMetadataFilter.cs b/src/Tizen.Applications.Common/Tizen.Applications/ApplicationInfoMetadataFilter.cs deleted file mode 100755 index 37abfb778..000000000 --- a/src/Tizen.Applications.Common/Tizen.Applications/ApplicationInfoMetadataFilter.cs +++ /dev/null @@ -1,28 +0,0 @@ -/* - * 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.Collections.Generic; - -namespace Tizen.Applications -{ - /// - /// This class is a parameter of the GetInstalledApplicationsAsync method. - /// - public class ApplicationInfoMetadataFilter : ApplicationInfoFilter - { - } -} diff --git a/src/Tizen.Applications.Common/Tizen.Applications/ApplicationLaunchedEventArgs.cs b/src/Tizen.Applications.Common/Tizen.Applications/ApplicationLaunchedEventArgs.cs deleted file mode 100755 index e80ef3900..000000000 --- a/src/Tizen.Applications.Common/Tizen.Applications/ApplicationLaunchedEventArgs.cs +++ /dev/null @@ -1,31 +0,0 @@ -/* - * 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.Applications -{ - /// - /// Arguments for the event raised when the application is launched. - /// - public class ApplicationLaunchedEventArgs : EventArgs - { - /// - /// The information of the application. - /// - public ApplicationRunningContext ApplicationRunningContext { get; internal set; } - } -} \ No newline at end of file diff --git a/src/Tizen.Applications.Common/Tizen.Applications/ApplicationManager.cs b/src/Tizen.Applications.Common/Tizen.Applications/ApplicationManager.cs deleted file mode 100755 index 83fdd541d..000000000 --- a/src/Tizen.Applications.Common/Tizen.Applications/ApplicationManager.cs +++ /dev/null @@ -1,608 +0,0 @@ -/* - * 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.Collections.Generic; -using System.ComponentModel; -using System.Runtime.InteropServices; -using System.Threading.Tasks; - -namespace Tizen.Applications -{ - /// - /// This class has the methods and events of the ApplicationManager. - /// - public static class ApplicationManager - { - private const string LogTag = "Tizen.Applications"; - private static EventHandler s_launchedHandler; - private static EventHandler s_terminatedHandler; - private static Interop.ApplicationManager.AppManagerAppContextEventCallback s_applicationChangedEventCallback; - private static EventHandler _enabledHandler; - private static EventHandler _disabledHandler; - private static Interop.ApplicationManager.AppManagerEventCallback _eventCallback; - private static IntPtr _eventHandle = IntPtr.Zero; - - /// - /// Occurs whenever the installed application is enabled. - /// - public static event EventHandler ApplicationEnabled - { - add - { - if (_enabledHandler == null && _disabledHandler == null) - { - RegisterApplicationEvent(); - } - _enabledHandler += value; - } - remove - { - _enabledHandler -= value; - if (_enabledHandler == null && _disabledHandler == null) - { - UnRegisterApplicationEvent(); - } - } - } - - /// - /// Occurs whenever the installed application is disabled. - /// - public static event EventHandler ApplicationDisabled - { - add - { - if (_disabledHandler == null && _enabledHandler == null) - { - RegisterApplicationEvent(); - } - _disabledHandler += value; - } - remove - { - _disabledHandler -= value; - if (_disabledHandler == null && _enabledHandler == null) - { - UnRegisterApplicationEvent(); - } - } - } - - /// - /// Occurs whenever the installed applications get launched. - /// - public static event EventHandler ApplicationLaunched - { - add - { - if (s_launchedHandler == null && s_terminatedHandler == null) - { - RegisterApplicationChangedEvent(); - } - s_launchedHandler += value; - } - remove - { - s_launchedHandler -= value; - if (s_launchedHandler == null && s_terminatedHandler == null) - { - UnRegisterApplicationChangedEvent(); - } - } - } - - /// - /// Occurs whenever the installed applications get terminated. - /// - public static event EventHandler ApplicationTerminated - { - add - { - if (s_launchedHandler == null && s_terminatedHandler == null) - { - RegisterApplicationChangedEvent(); - } - s_terminatedHandler += value; - } - remove - { - s_terminatedHandler -= value; - if (s_launchedHandler == null && s_terminatedHandler == null) - { - UnRegisterApplicationChangedEvent(); - } - } - } - - /// - /// Gets the information of the installed applications asynchronously. - /// - public static async Task> GetInstalledApplicationsAsync() - { - return await Task.Run(() => - { - Interop.ApplicationManager.ErrorCode err = Interop.ApplicationManager.ErrorCode.None; - List result = new List(); - - Interop.ApplicationManager.AppManagerAppInfoCallback cb = (IntPtr infoHandle, IntPtr userData) => - { - if (infoHandle != IntPtr.Zero) - { - IntPtr clonedHandle = IntPtr.Zero; - err = Interop.ApplicationManager.AppInfoClone(out clonedHandle, infoHandle); - if (err != Interop.ApplicationManager.ErrorCode.None) - { - Log.Warn(LogTag, "Failed to clone the appinfo. err = " + err); - return false; - } - ApplicationInfo app = new ApplicationInfo(clonedHandle); - result.Add(app); - return true; - } - return false; - }; - err = Interop.ApplicationManager.AppManagerForeachAppInfo(cb, IntPtr.Zero); - if (err != Interop.ApplicationManager.ErrorCode.None) - { - throw ApplicationManagerErrorFactory.GetException(err, "Failed to foreach the appinfo."); - } - return result; - }); - } - - /// - /// Gets the information of the installed applications with the ApplicationInfoFilter asynchronously. - /// - /// Key-value pairs for filtering. - public static async Task> GetInstalledApplicationsAsync(ApplicationInfoFilter filter) - { - return await Task.Run(() => - { - List result = new List(); - - Interop.ApplicationManager.AppInfoFilterCallback cb = (IntPtr infoHandle, IntPtr userData) => - { - if (infoHandle != IntPtr.Zero) - { - IntPtr clonedHandle = IntPtr.Zero; - Interop.ApplicationManager.ErrorCode err = Interop.ApplicationManager.AppInfoClone(out clonedHandle, infoHandle); - if (err != Interop.ApplicationManager.ErrorCode.None) - { - Log.Warn(LogTag, "Failed to clone the appinfo. err = " + err); - return false; - } - ApplicationInfo app = new ApplicationInfo(clonedHandle); - result.Add(app); - return true; - } - return false; - }; - filter.Fetch(cb); - return result; - }); - } - - /// - /// Gets the information of the installed applications with the ApplicationInfoMetadataFilter asynchronously. - /// - /// Key-value pairs for filtering. - public static async Task> GetInstalledApplicationsAsync(ApplicationInfoMetadataFilter filter) - { - return await Task.Run(() => - { - List result = new List(); - - Interop.ApplicationManager.AppInfoFilterCallback cb = (IntPtr infoHandle, IntPtr userData) => - { - if (infoHandle != IntPtr.Zero) - { - IntPtr clonedHandle = IntPtr.Zero; - Interop.ApplicationManager.ErrorCode err = Interop.ApplicationManager.AppInfoClone(out clonedHandle, infoHandle); - if (err != Interop.ApplicationManager.ErrorCode.None) - { - Log.Warn(LogTag, "Failed to clone the appinfo. err = " + err); - return false; - } - ApplicationInfo app = new ApplicationInfo(clonedHandle); - result.Add(app); - return true; - } - return false; - }; - filter.Fetch(cb); - return result; - }); - } - - /// - /// Gets the information of the running applications asynchronously. - /// - public static async Task> GetRunningApplicationsAsync() - { - return await Task.Run(() => - { - Interop.ApplicationManager.ErrorCode err = Interop.ApplicationManager.ErrorCode.None; - List result = new List(); - - Interop.ApplicationManager.AppManagerAppContextCallback cb = (IntPtr contextHandle, IntPtr userData) => - { - if (contextHandle != IntPtr.Zero) - { - IntPtr clonedHandle = IntPtr.Zero; - err = Interop.ApplicationManager.AppContextClone(out clonedHandle, contextHandle); - if (err != Interop.ApplicationManager.ErrorCode.None) - { - Log.Warn(LogTag, "Failed to clone the app context. err = " + err); - return false; - } - ApplicationRunningContext context = new ApplicationRunningContext(clonedHandle); - result.Add(context); - return true; - } - return false; - }; - - err = Interop.ApplicationManager.AppManagerForeachAppContext(cb, IntPtr.Zero); - if (err != Interop.ApplicationManager.ErrorCode.None) - { - throw ApplicationManagerErrorFactory.GetException(err, "Failed to foreach appcontext."); - } - return result; - }); - } - - /// - /// Gets the information of the running applications including subapp asynchronously. - /// - public static async Task> GetAllRunningApplicationsAsync() - { - return await Task.Run(() => - { - Interop.ApplicationManager.ErrorCode err = Interop.ApplicationManager.ErrorCode.None; - List result = new List(); - - Interop.ApplicationManager.AppManagerAppContextCallback cb = (IntPtr contextHandle, IntPtr userData) => - { - if (contextHandle != IntPtr.Zero) - { - IntPtr clonedHandle = IntPtr.Zero; - err = Interop.ApplicationManager.AppContextClone(out clonedHandle, contextHandle); - if (err != Interop.ApplicationManager.ErrorCode.None) - { - Log.Warn(LogTag, "Failed to clone the app context. err = " + err); - return false; - } - ApplicationRunningContext context = new ApplicationRunningContext(clonedHandle); - result.Add(context); - return true; - } - return false; - }; - - err = Interop.ApplicationManager.AppManagerForeachRunningAppContext(cb, IntPtr.Zero); - if (err != Interop.ApplicationManager.ErrorCode.None) - { - throw ApplicationManagerErrorFactory.GetException(err, "Failed to foreach appcontext."); - } - return result; - }); - } - - /// - /// Gets the information of the specified application with the application ID. - /// - /// Application ID. - public static ApplicationInfo GetInstalledApplication(string applicationId) - { - IntPtr infoHandle = IntPtr.Zero; - Interop.ApplicationManager.ErrorCode err = Interop.ApplicationManager.AppManagerGetAppInfo(applicationId, out infoHandle); - if (err != Interop.ApplicationManager.ErrorCode.None) - { - throw ApplicationManagerErrorFactory.GetException(err, "Failed to get the installed application information of " + applicationId + "."); - } - ApplicationInfo app = new ApplicationInfo(infoHandle); - return app; - } - - /// - /// Returns if the specified application is running or not. - /// - /// The application ID. - /// Returns true if the given application is running, otherwise false. - /// Thrown when the given parameter is invalid. - public static bool IsRunning(string applicationId) - { - bool isRunning = false; - Interop.ApplicationManager.ErrorCode err = Interop.ApplicationManager.AppManagerIsRunning(applicationId, out isRunning); - if (err != Interop.ApplicationManager.ErrorCode.None) - { - throw ApplicationManagerErrorFactory.GetException(Interop.ApplicationManager.ErrorCode.InvalidParameter, "Invalid parameter"); - } - return isRunning; - } - - private static void RegisterApplicationChangedEvent() - { - Interop.ApplicationManager.ErrorCode err = Interop.ApplicationManager.ErrorCode.None; - s_applicationChangedEventCallback = (IntPtr contextHandle, Interop.ApplicationManager.AppContextEvent state, IntPtr userData) => - { - if (contextHandle == IntPtr.Zero) return; - - IntPtr clonedHandle = IntPtr.Zero; - err = Interop.ApplicationManager.AppContextClone(out clonedHandle, contextHandle); - if (err != Interop.ApplicationManager.ErrorCode.None) - { - throw ApplicationManagerErrorFactory.GetException(err, "Failed to register the application context event."); - } - using (ApplicationRunningContext context = new ApplicationRunningContext(clonedHandle)) - { - if (state == Interop.ApplicationManager.AppContextEvent.Launched) - { - s_launchedHandler?.Invoke(null, new ApplicationLaunchedEventArgs { ApplicationRunningContext = context }); - } - else if (state == Interop.ApplicationManager.AppContextEvent.Terminated) - { - s_terminatedHandler?.Invoke(null, new ApplicationTerminatedEventArgs { ApplicationRunningContext = context }); - } - } - }; - err = Interop.ApplicationManager.AppManagerSetAppContextEvent(s_applicationChangedEventCallback, IntPtr.Zero); - if (err != Interop.ApplicationManager.ErrorCode.None) - { - throw ApplicationManagerErrorFactory.GetException(err, "Failed to register the application context event."); - } - } - - private static void UnRegisterApplicationChangedEvent() - { - Interop.ApplicationManager.AppManagerUnSetAppContextEvent(); - } - - private static void RegisterApplicationEvent() - { - Interop.ApplicationManager.ErrorCode err = Interop.ApplicationManager.ErrorCode.None; - err = Interop.ApplicationManager.AppManagerEventCreate(out _eventHandle); - if (err != Interop.ApplicationManager.ErrorCode.None) - { - throw ApplicationManagerErrorFactory.GetException(err, "Failed to create the application event handle"); - } - - err = Interop.ApplicationManager.AppManagerEventSetStatus(_eventHandle, Interop.ApplicationManager.AppManagerEventStatusType.All); - if (err != Interop.ApplicationManager.ErrorCode.None) - { - Interop.ApplicationManager.AppManagerEventDestroy(_eventHandle); - _eventHandle = IntPtr.Zero; - throw ApplicationManagerErrorFactory.GetException(err, "Failed to set the application event"); - } - - _eventCallback = (string appType, string appId, Interop.ApplicationManager.AppManagerEventType eventType, Interop.ApplicationManager.AppManagerEventState eventState, IntPtr eventHandle, IntPtr UserData) => - { - if (eventType == Interop.ApplicationManager.AppManagerEventType.Enable) - { - _enabledHandler?.Invoke(null, new ApplicationEnabledEventArgs(appId, (ApplicationEventState)eventState)); - } - else if (eventType == Interop.ApplicationManager.AppManagerEventType.Disable) - { - _disabledHandler?.Invoke(null, new ApplicationDisabledEventArgs(appId, (ApplicationEventState)eventState)); - } - }; - err = Interop.ApplicationManager.AppManagerSetEventCallback(_eventHandle, _eventCallback, IntPtr.Zero); - if (err != Interop.ApplicationManager.ErrorCode.None) - { - Interop.ApplicationManager.AppManagerEventDestroy(_eventHandle); - _eventHandle = IntPtr.Zero; - throw ApplicationManagerErrorFactory.GetException(err, "Failed to set the application event callback"); - } - } - - private static void UnRegisterApplicationEvent() - { - if (_eventHandle != IntPtr.Zero) - { - Interop.ApplicationManager.AppManagerUnSetEventCallback(_eventHandle); - Interop.ApplicationManager.AppManagerEventDestroy(_eventHandle); - _eventHandle = IntPtr.Zero; - } - } - - /// - /// Gets the information of the recent applications. - /// - /// Returns a dictionary containing all the recent application info. - /// Thrown when failed because of an invalid operation. - [EditorBrowsable(EditorBrowsableState.Never)] - public static IEnumerable GetRecentApplications() - { - Interop.ApplicationManager.ErrorCode err = Interop.ApplicationManager.ErrorCode.None; - - List result = new List(); - IntPtr table; - int nrows, ncols; - - err = Interop.ApplicationManager.RuaHistoryLoadDb(out table, out nrows, out ncols); - if (err != Interop.ApplicationManager.ErrorCode.None) - { - throw ApplicationManagerErrorFactory.GetException(err, "Failed to load a table for the recent application list."); - } - - for (int row = 0; row < nrows; ++row) - { - Interop.ApplicationManager.RuaRec record; - - err = Interop.ApplicationManager.RuaHistoryGetRecord(out record, table, nrows, ncols, row); - if (err != Interop.ApplicationManager.ErrorCode.None) - { - throw ApplicationManagerErrorFactory.GetException(err, "Failed to get record."); - } - - RecentApplicationInfo info = new RecentApplicationInfo(record); - result.Add(info); - } - - err = Interop.ApplicationManager.RuaHistoryUnLoadDb(ref table); - if (err != Interop.ApplicationManager.ErrorCode.None) - { - throw ApplicationManagerErrorFactory.GetException(err, "Failed to unload a table for the recent application list."); - } - - return result; - } - } - - internal static class FilterExtension - { - private const string LogTag = "Tizen.Applications"; - internal static void Fetch(this ApplicationInfoFilter filter, Interop.ApplicationManager.AppInfoFilterCallback callback) - { - if (filter is ApplicationInfoMetadataFilter) - { - ApplicationInfoMetadataFilter metaFilter = (ApplicationInfoMetadataFilter)filter; - metaFilter.Fetch(callback); - return; - } - - IntPtr nativeHandle = MakeNativeAppInfoFilter(filter.Filter); - if (nativeHandle == IntPtr.Zero) - { - throw ApplicationManagerErrorFactory.NativeFilterHandleIsInvalid(); - } - try - { - Interop.ApplicationManager.ErrorCode err = Interop.ApplicationManager.AppInfoFilterForeachAppinfo(nativeHandle, callback, IntPtr.Zero); - if (err != Interop.ApplicationManager.ErrorCode.None) - { - throw ApplicationManagerErrorFactory.GetException(err, "Failed to get application information list with filter."); - } - } - finally - { - Interop.ApplicationManager.AppInfoFilterDestroy(nativeHandle); - } - } - - internal static void Fetch(this ApplicationInfoMetadataFilter filter, Interop.ApplicationManager.AppInfoFilterCallback callback) - { - IntPtr nativeHandle = MakeNativeAppMetadataFilter(filter.Filter); - if (nativeHandle == IntPtr.Zero) - { - throw ApplicationManagerErrorFactory.NativeFilterHandleIsInvalid(); - } - try - { - Interop.ApplicationManager.ErrorCode err = Interop.ApplicationManager.AppInfoMetadataFilterForeach(nativeHandle, callback, IntPtr.Zero); - if (err != Interop.ApplicationManager.ErrorCode.None) - { - throw ApplicationManagerErrorFactory.GetException(err, "Failed to get metadata list with filter."); - } - } - finally - { - Interop.ApplicationManager.AppInfoMetadataFilterDestroy(nativeHandle); - } - } - - private static IntPtr MakeNativeAppInfoFilter(IDictionary filter) - { - if (filter == null || filter.Count == 0) - { - throw ApplicationManagerErrorFactory.FilterIsInvalid(); - } - - IntPtr infoHandle = IntPtr.Zero; - Interop.ApplicationManager.ErrorCode err = Interop.ApplicationManager.AppInfoFilterCreate(out infoHandle); - if (err != Interop.ApplicationManager.ErrorCode.None) - { - throw ApplicationManagerErrorFactory.GetException(err, "Failed to create the filter handle."); - } - - foreach (var item in filter) - { - if ((item.Key == ApplicationInfoFilter.Keys.Id) || - (item.Key == ApplicationInfoFilter.Keys.Type) || - (item.Key == ApplicationInfoFilter.Keys.Category)) - { - err = Interop.ApplicationManager.AppInfoFilterAddString(infoHandle, item.Key, item.Value); - } - else if ((item.Key == ApplicationInfoFilter.Keys.NoDisplay) || - (item.Key == ApplicationInfoFilter.Keys.TaskManage)) - { - err = Interop.ApplicationManager.AppInfoFilterAddBool(infoHandle, item.Key, Convert.ToBoolean(item.Value)); - } - else - { - Log.Warn(LogTag, string.Format("'{0}' is not supported key for the filter.", item.Key)); - } - if (err != Interop.ApplicationManager.ErrorCode.None) - { - Interop.ApplicationManager.AppInfoFilterDestroy(infoHandle); - throw ApplicationManagerErrorFactory.GetException(err, "Failed to add item to the filter."); - } - } - return infoHandle; - } - - private static IntPtr MakeNativeAppMetadataFilter(IDictionary filter) - { - if (filter == null || filter.Count == 0) - { - throw ApplicationManagerErrorFactory.FilterIsInvalid(); - } - - IntPtr infoHandle = IntPtr.Zero; - Interop.ApplicationManager.ErrorCode err = Interop.ApplicationManager.AppInfoMetadataFilterCreate(out infoHandle); - if (err != Interop.ApplicationManager.ErrorCode.None) - { - throw ApplicationManagerErrorFactory.GetException(err, "Failed to create the filter for searching with metadata."); - } - foreach (var item in filter) - { - err = Interop.ApplicationManager.AppInfoMetadataFilterAdd(infoHandle, item.Key, item.Value); - if (err != Interop.ApplicationManager.ErrorCode.None) - { - Interop.ApplicationManager.AppInfoMetadataFilterDestroy(infoHandle); - throw ApplicationManagerErrorFactory.GetException(err, "Failed to add the item to the filter."); - } - } - return infoHandle; - } - } - - internal static class ApplicationManagerErrorFactory - { - internal static Exception NativeFilterHandleIsInvalid() - { - return new InvalidOperationException("The native handle for filtering is invalid."); - } - - internal static Exception FilterIsInvalid() - { - return new ArgumentException("The filter is invalid."); - } - - internal static Exception GetException(Interop.ApplicationManager.ErrorCode err, string message) - { - string errMessage = String.Format("{0} err = {1}", message, err); - switch (err) - { - case Interop.ApplicationManager.ErrorCode.InvalidParameter: - return new ArgumentException(errMessage); - default: - return new InvalidOperationException(errMessage); - } - } - } -} diff --git a/src/Tizen.Applications.Common/Tizen.Applications/ApplicationRunningContext.cs b/src/Tizen.Applications.Common/Tizen.Applications/ApplicationRunningContext.cs deleted file mode 100644 index 627c63981..000000000 --- a/src/Tizen.Applications.Common/Tizen.Applications/ApplicationRunningContext.cs +++ /dev/null @@ -1,294 +0,0 @@ -/* - * Copyright (c) 2017 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.Collections.Generic; -using System.ComponentModel; - -namespace Tizen.Applications -{ - /// - /// This class provides methods and properties to get information of the application. - /// - public class ApplicationRunningContext : IDisposable - { - private const string LogTag = "Tizen.Applications"; - private bool _disposed = false; - private IntPtr _contextHandle = IntPtr.Zero; - private Interop.ApplicationManager.ErrorCode err = Interop.ApplicationManager.ErrorCode.None; - - internal ApplicationRunningContext(IntPtr contextHandle) - { - _contextHandle = contextHandle; - } - - /// - /// A constructor of ApplicationRunningContext that takes the application ID. - /// - /// Application ID. - /// Thrown when failed because of an invalid argument. - /// Thrown when failed because of the "application not exist" error or the system error. - /// Thrown when failed because of out of memory. - public ApplicationRunningContext(string applicationId) - { - IntPtr contextHandle = IntPtr.Zero; - err = Interop.ApplicationManager.AppManagerGetAppContext(applicationId, out contextHandle); - if (err != Interop.ApplicationManager.ErrorCode.None) - { - Log.Warn(LogTag, "Failed to get the handle of the ApplicationRunningContext. err = " + err); - switch (err) - { - case Interop.ApplicationManager.ErrorCode.InvalidParameter: - throw new ArgumentException("Invalid Parameter."); - case Interop.ApplicationManager.ErrorCode.NoSuchApp: - throw new InvalidOperationException("No such application."); - case Interop.ApplicationManager.ErrorCode.OutOfMemory: - throw new OutOfMemoryException("Out of memory"); - default: - throw new InvalidOperationException("Invalid Operation."); - } - } - _contextHandle = contextHandle; - } - - /// - /// A constructor of ApplicationRunningContext that takes the application id. - /// - /// application id. - /// instance id. - /// Thrown when failed of invalid argument. - /// Thrown when failed because of application not exist error or system error. - /// Thrown when failed because of out of memory. - [EditorBrowsable(EditorBrowsableState.Never)] - public ApplicationRunningContext(string applicationId, string instanceId) - { - IntPtr contextHandle = IntPtr.Zero; - err = Interop.ApplicationManager.AppManagerGetAppContextByInstanceId(applicationId, instanceId, out contextHandle); - if (err != Interop.ApplicationManager.ErrorCode.None) - { - Log.Warn(LogTag, "Failed to get the handle of the ApplicationRunningContext. err = " + err); - switch (err) - { - case Interop.ApplicationManager.ErrorCode.InvalidParameter: - throw new ArgumentException("Invalid Parameter."); - case Interop.ApplicationManager.ErrorCode.NoSuchApp: - throw new InvalidOperationException("No such application."); - case Interop.ApplicationManager.ErrorCode.OutOfMemory: - throw new OutOfMemoryException("Out of memory"); - default: - throw new InvalidOperationException("Invalid Operation."); - } - } - _contextHandle = contextHandle; - } - - /// - /// Destructor of the class. - /// - ~ApplicationRunningContext() - { - Dispose(false); - } - - /// - /// Enumeration for the application state. - /// - public enum AppState - { - /// - /// The undefined state. - /// - Undefined = 0, - - /// - /// The UI application is running in the foreground. - /// - Foreground, - - /// - /// The UI application is running in the background. - /// - Background, - - /// - /// The service application is running. - /// - Service, - - /// - /// The application is terminated. - /// - Terminated, - } - - /// - /// Gets the application ID. - /// - public string ApplicationId - { - get - { - string appid = string.Empty; - err = Interop.ApplicationManager.AppContextGetAppId(_contextHandle, out appid); - if (err != Interop.ApplicationManager.ErrorCode.None) - { - Log.Warn(LogTag, "Failed to get the application id. err = " + err); - } - return appid; - } - } - - /// - /// Gets the package ID of the application. - /// - public string PackageId - { - get - { - string packageid = string.Empty; - err = Interop.ApplicationManager.AppContextGetPackageId(_contextHandle, out packageid); - if (err != Interop.ApplicationManager.ErrorCode.None) - { - Log.Warn(LogTag, "Failed to get the package id. err = " + err); - } - return packageid; - } - } - - /// - /// Gets the application's process ID. - /// - public int ProcessId - { - get - { - int pid = 0; - err = Interop.ApplicationManager.AppContextGetPid(_contextHandle, out pid); - if (err != Interop.ApplicationManager.ErrorCode.None) - { - Log.Warn(LogTag, "Failed to get the process id. err = " + err); - } - return pid; - } - } - - /// - /// Gets the state of the application. - /// - public AppState State - { - get - { - int state = 0; - - err = Interop.ApplicationManager.AppContextGetAppState(_contextHandle, out state); - if (err != Interop.ApplicationManager.ErrorCode.None) - { - Log.Warn(LogTag, "Failed to get the application state. err = " + err); - } - return (AppState)state; - } - } - - /// - /// Gets whether the application is sub application of the application group. - /// - public bool IsSubApp - { - get - { - bool subapp = false; - err = Interop.ApplicationManager.AppContextIsSubApp(_contextHandle, out subapp); - if (err != Interop.ApplicationManager.ErrorCode.None) - { - Log.Warn(LogTag, "Failed to get the IsSubApp value. err = " + err); - } - return subapp; - } - } - - /// - /// Terminates the application. - /// - /// Thrown when failed of invalid argument. - /// Thrown when failed because of permission denied. - /// Thrown when failed because of system error. - /// http://tizen.org/privilege/appmanager.kill - [EditorBrowsable(EditorBrowsableState.Never)] - public void Terminate() - { - err = Interop.ApplicationManager.AppManagerTerminateApp(_contextHandle); - if (err != Interop.ApplicationManager.ErrorCode.None) - { - switch (err) - { - case Interop.ApplicationManager.ErrorCode.InvalidParameter: - throw new ArgumentException("Invalid argument."); - case Interop.ApplicationManager.ErrorCode.PermissionDenied: - throw new UnauthorizedAccessException("Permission denied."); - default: - throw new InvalidOperationException("Invalid Operation."); - } - } - } - - /// - /// Resumes the running application. - /// - /// Thrown when failed of invalid argument. - /// Thrown when failed because of permission denied. - /// Thrown when failed because of system error. - /// http://tizen.org/privilege/appmanager.launch - public void Resume() - { - err = Interop.ApplicationManager.AppManagerResumeApp(_contextHandle); - if (err != Interop.ApplicationManager.ErrorCode.None) - { - switch (err) - { - case Interop.ApplicationManager.ErrorCode.InvalidParameter: - throw new ArgumentException("Invalid argument."); - case Interop.ApplicationManager.ErrorCode.PermissionDenied: - throw new UnauthorizedAccessException("Permission denied."); - default: - throw new InvalidOperationException("Invalid Operation."); - } - } - } - - /// - /// Releases all resources used by the ApplicationRunningContext class. - /// - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - - private void Dispose(bool disposing) - { - if (_disposed) - return; - - if (_contextHandle != IntPtr.Zero) - { - Interop.ApplicationManager.AppContextDestroy(_contextHandle); - _contextHandle = IntPtr.Zero; - } - _disposed = true; - } - } -} diff --git a/src/Tizen.Applications.Common/Tizen.Applications/ApplicationTerminatedEventArgs.cs b/src/Tizen.Applications.Common/Tizen.Applications/ApplicationTerminatedEventArgs.cs deleted file mode 100755 index 360cd931c..000000000 --- a/src/Tizen.Applications.Common/Tizen.Applications/ApplicationTerminatedEventArgs.cs +++ /dev/null @@ -1,31 +0,0 @@ -/* - * 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.Applications -{ - /// - /// Arguments for the event raised when the application is terminated. - /// - public class ApplicationTerminatedEventArgs : EventArgs - { - /// - /// The information of the application. - /// - public ApplicationRunningContext ApplicationRunningContext { get; internal set; } - } -} \ No newline at end of file diff --git a/src/Tizen.Applications.Common/Tizen.Applications/ApplicationType.cs b/src/Tizen.Applications.Common/Tizen.Applications/ApplicationType.cs deleted file mode 100755 index de05b86e8..000000000 --- a/src/Tizen.Applications.Common/Tizen.Applications/ApplicationType.cs +++ /dev/null @@ -1,37 +0,0 @@ -/* - * 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. - */ - -namespace Tizen.Applications -{ - /// - /// Enumeration for the applications type. - /// - public enum ApplicationType - { - /// - /// All applications. - /// - All = 0, - /// - /// UI applications. - /// - Ui = 1, - /// - /// Service applications. - /// - Service = 2 - } -} diff --git a/src/Tizen.Applications.Common/Tizen.Applications/Bundle.cs b/src/Tizen.Applications.Common/Tizen.Applications/Bundle.cs deleted file mode 100755 index 0f790ab77..000000000 --- a/src/Tizen.Applications.Common/Tizen.Applications/Bundle.cs +++ /dev/null @@ -1,714 +0,0 @@ -/* - * 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.Reflection; -using System.Collections.Generic; -using System.Linq; -using System.Runtime.InteropServices; -using Tizen.Internals.Errors; - -namespace Tizen.Applications -{ - /// - /// A bundle object represents a bundle. - /// A bundle holds items (key-value pairs) and can be used with other Tizen APIs. - /// Keys can be used to access values. - /// This class is accessed by using a constructor to create a new instance of this object. - /// A bundle instance is not guaranteed to be thread safe if the instance is modified by multiple threads. - /// - public class Bundle : IDisposable - { - private SafeBundleHandle _handle; - private bool _disposed = false; - private readonly HashSet _keys; - - /// - /// The bundle constructor. - /// - /// Thrown when out of memory. - /// - /// Tizen.Applications.Bundle bundle = new Tizen.Applications.Bundle(); - /// - public Bundle() - { - _handle = Interop.Bundle.Create(); - BundleErrorFactory.CheckAndThrowException(ErrorFacts.GetLastResult(), _handle); - _keys = new HashSet(); - } - - /// - /// The bundle constructor. - /// - /// The SafeBundleHandle instance. - /// Thrown when the handle is null or invalid. - public Bundle(SafeBundleHandle handle) - { - if (handle == null || handle.IsInvalid) - { - throw new ArgumentNullException("handle"); - } - - _handle = Interop.Bundle.DangerousClone(handle.DangerousGetHandle()); - _keys = new HashSet(); - Interop.Bundle.Iterator iterator = (string key, int type, IntPtr keyval, IntPtr userData) => - { - _keys.Add(key); - }; - - Interop.Bundle.Foreach(_handle, iterator, IntPtr.Zero); - if ((BundleErrorFactory.BundleError)ErrorFacts.GetLastResult() == BundleErrorFactory.BundleError.InvalidParameter) - { - throw new ArgumentException("Invalid parameter - cannot create bundle instance"); - } - } - - private enum BundleTypeProperty - { - Array = 0x0100, - Primitive = 0x0200, - Measurable = 0x0400 - } - - private enum BundleType - { - None = -1, - Any = 0, - String = 1 | BundleTypeProperty.Measurable, - StringArray = String | BundleTypeProperty.Array | BundleTypeProperty.Measurable, - Byte = 2, - ByteArray = Byte | BundleTypeProperty.Array - } - - /// - /// 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 - { - return _keys.Count; - } - } - - /// - /// The keys in a bundle object. - /// - /// - /// Tizen.Applications.Bundle bundle = new Tizen.Applications.Bundle(); - /// bundle.AddItem("string1", "a_string1"); - /// bundle.AddItem("string2", "a_string2"); - /// bundle.AddItem("string3", "a_string3"); - /// Console.WriteLine("The bundle contains the following keys:"); - /// foreach(string key in bundle.Keys) - /// { - /// Console.WriteLine(key); - /// } - /// - public IEnumerable Keys - { - get - { - return _keys; - } - } - - /// - /// Gets the SafeBundleHandle instance. - /// - public SafeBundleHandle SafeBundleHandle - { - get { return _handle; } - } - - /// - /// Releases any unmanaged resources used by this object. - /// - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - - /// - /// Checks whether the bundle contains an item with a specified key. - /// - /// 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"); - /// if (bundle.Contains("string")) - /// { - /// string aValue = bundle.GetItem("string"); - /// Console.WriteLine(aValue); - /// } - /// - public bool Contains(string key) - { - return _keys.Contains(key); - } - - /// - /// Adds an item into the bundle. - /// - /// The key to identify the item with. If an item with the key already exists in the bundle, this method will not succeed. - /// The value of the item. - /// 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) - { - throw new ArgumentNullException("value"); - } - AddItem(key, value, 0, value.Length); - } - - /// - /// Adds an item into the bundle. - /// - /// The key to identify the item with. If an item with the key already exists in the bundle, this method will not succeed. - /// The value of the item. - /// The zero-based byte offset in value from which to add to the bundle. - /// The maximum number of bytes to add to the bundle starting with offset. - /// Thrown when the offset or count is out of range. - /// 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)) - { - if (value == null) - { - throw new ArgumentNullException("value"); - } - if (offset < 0) - { - throw new ArgumentOutOfRangeException("offset", offset, "Cannot be less than 0"); - } - if (offset > value.Length - 1) - { - throw new ArgumentOutOfRangeException("offset", offset, "Greater than last index of array"); - } - if (count < 1) - { - throw new ArgumentOutOfRangeException("count", count, "Must be at least 1"); - } - if (offset + count > value.Length) - { - throw new ArgumentException("The count is too large for the specified offset"); - } - // Code is in Interop file because it is unsafe - int ret = Interop.Bundle.UnsafeCode.AddItem(_handle, key, value, offset, count); - BundleErrorFactory.CheckAndThrowException(ret, _handle); - _keys.Add(key); - } - else - { - throw new ArgumentException("Key already exists", "key"); - } - } - - /// - /// Adds an item into the bundle. - /// - /// The key to identify the item with. If an item with the key already exists in the bundle, this method will not succeed. - /// 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)) - { - int ret = Interop.Bundle.AddString(_handle, key, value); - BundleErrorFactory.CheckAndThrowException(ret, _handle); - _keys.Add(key); - } - else - { - throw new ArgumentException("Key already exists", "key"); - } - } - - /// - /// Adds an item into the bundle. - /// - /// The key to identify the item with. If an item with the key already exists in the bundle, this method will not succeed. - /// 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)) - { - string[] valueArray = value.Select(v => v == null ? string.Empty : v).ToArray(); - int ret = Interop.Bundle.AddStringArray(_handle, key, valueArray, valueArray.Count()); - BundleErrorFactory.CheckAndThrowException(ret, _handle); - _keys.Add(key); - } - else - { - throw new ArgumentException("Key already exists", "key"); - } - } - - /// - /// Gets the value of a bundle item with a specified key. - /// - /// The key of the bundle item whose value is desired. - /// 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"); - /// if (bundle.Contains("string")) - /// { - /// object aValue = bundle.GetItem("string"); - /// if (bundle.Is("string");) - /// { - /// string aString = (string)aValue; - /// Console.WriteLine(aString); - /// } - /// } - /// - public object GetItem(string key) - { - if (_keys.Contains(key)) - { - int type = Interop.Bundle.GetType(_handle, key); - BundleErrorFactory.CheckAndThrowException(ErrorFacts.GetLastResult(), _handle); - switch (type) - { - case (int)BundleType.String: - // get string - IntPtr stringPtr; - int retString = Interop.Bundle.GetString(_handle, key, out stringPtr); - BundleErrorFactory.CheckAndThrowException(retString, _handle); - string stringValue = Marshal.PtrToStringAnsi(stringPtr); - if (stringValue == null) - return string.Empty; - return stringValue; - - case (int)BundleType.StringArray: - // get string array - int stringArraySize; - IntPtr stringArrayPtr = Interop.Bundle.GetStringArray(_handle, key, out stringArraySize); - BundleErrorFactory.CheckAndThrowException(ErrorFacts.GetLastResult(), _handle); - string[] stringArray; - IntPtrToStringArray(stringArrayPtr, stringArraySize, out stringArray); - return stringArray; - - case (int)BundleType.Byte: - // get byte array - IntPtr byteArrayPtr; - int byteArraySize; - int retByte = Interop.Bundle.GetByte(_handle, key, out byteArrayPtr, out byteArraySize); - BundleErrorFactory.CheckAndThrowException(retByte, _handle); - byte[] byteArray = new byte[byteArraySize]; - Marshal.Copy(byteArrayPtr, byteArray, 0, byteArraySize); - return byteArray; - - default: - throw new ArgumentException("Key does not exist in the bundle", "key"); - } - } - else - { - throw new ArgumentException("Key does not exist in the bundle (may be null or empty string)", "key"); - } - } - - /// - /// Gets the value of a bundle item with a specified key. - /// Note that this is a generic method. - /// - /// The generic type to return. - /// The key of the bundle item whose value is desired. - /// The value of the bundle item if it is of the specified generic type. - /// 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" }; - /// bundle.AddItem("string_array", stringArray); - /// if (bundle.Is("string_array")) - /// { - /// Console.WriteLine("It is a string"); - /// Console.WriteLine(bundle.GetItem("string_array")); - /// } - /// else if (bundle.Is("string_array")) - /// { - /// Console.WriteLine("It is a string[]"); - /// string[] anArray = bundle.GetItem("string_array"); - /// foreach (string value in anArray) - /// { - /// Console.WriteLine(value); - /// } - /// } - /// - public T GetItem(string key) - { - return (T)GetItem(key); - } - - /// - /// Gets the value of a bundle item with a specified key. - /// - /// The key of the bundle item whose value is desired. - /// 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 }; - /// bundle.AddItem("byte_array", byteArray); - /// byte[] aByteArray; - /// if (bundle.TryGetItem("byte_array", out aByteArray)) - /// { - /// 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) - { - value = GetItem(key); - return true; - } - else - { - if (_keys.Contains(key) && ErrorFacts.GetLastResult() == (int)BundleErrorFactory.BundleError.InvalidParameter) - { - throw new InvalidOperationException("Invalid bundle instance (object may have been disposed or released)"); - } - value = default(byte[]); - return false; - } - } - - /// - /// Gets the value of a bundle item with a specified key. - /// - /// The key of the bundle item whose value is desired. - /// 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"); - /// string aString; - /// if (bundle.TryGetItem("string", out aString)) - /// { - /// Console.WriteLine(aString); - /// } - /// - public bool TryGetItem(string key, out string value) - { - if (_keys.Contains(key) && Interop.Bundle.GetType(_handle, key) == (int)BundleType.String) - { - value = GetItem(key); - return true; - } - else - { - if (_keys.Contains(key) && ErrorFacts.GetLastResult() == (int)BundleErrorFactory.BundleError.InvalidParameter) - { - throw new InvalidOperationException("Invalid bundle instance (object may have been disposed or released)"); - } - value = default(string); - return false; - } - } - - /// - /// Gets the value of a bundle item with a specified key. - /// - /// The key of the bundle item whose value is desired. - /// 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" }; - /// bundle.AddItem("string_array", stringArray); - /// System.Collections.Generic.IEnumerable aStringEnumerable; - /// if (bundle.TryGetItem("string", out aStringEnumerable)) - /// { - /// foreach (string value in aStringEnumerable) - /// { - /// Console.WriteLine(value); - /// } - /// } - /// - public bool TryGetItem(string key, out IEnumerable value) - { - if (_keys.Contains(key) && Interop.Bundle.GetType(_handle, key) == (int)BundleType.StringArray) - { - value = GetItem>(key); - return true; - } - else - { - if (_keys.Contains(key) && ErrorFacts.GetLastResult() == (int)BundleErrorFactory.BundleError.InvalidParameter) - { - throw new InvalidOperationException("Invalid bundle instance (object may have been disposed or released)"); - } - value = default(IEnumerable); - return false; - } - } - - /// - /// Checks whether an item is of a specific type. - /// - /// The generic type to check for. - /// The key whose type wants to be checked. - /// 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" }; - /// bundle.AddItem("string_array", stringArray); - /// if (bundle.Is("string_array")) - /// { - /// Console.WriteLine("It is a string[]"); - /// string[] anArray = bundle.GetItem("string_array"); - /// foreach (string value in anArray) - /// { - /// Console.WriteLine(value); - /// } - /// } - /// - public bool Is(string key) - { - if (_keys.Contains(key)) - { - int type = Interop.Bundle.GetType(_handle, key); - switch (type) - { - case (int)BundleType.String: - return typeof(string) == typeof(T); - - case (int)BundleType.StringArray: - return typeof(T).GetTypeInfo().IsAssignableFrom(typeof(string[]).GetTypeInfo()); - - case (int)BundleType.Byte: - return typeof(byte[]) == typeof(T); - - default: - throw new ArgumentException("Key does not exist in the bundle", "key"); - } - } - else - { - throw new ArgumentException("Key does not exist in the bundle (may be null or empty string)", "key"); - } - } - - /// - /// Removes a bundle item with a specific key from a Bundle. - /// - /// The key of the item to delete. - /// 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"); - /// if (bundle.Contains("string")) - /// { - /// if (bundle.RemoveItem("string")) - /// { - /// Console.WriteLine("Removed"); - /// } - /// } - /// - public bool RemoveItem(string key) - { - if (_keys.Contains(key)) - { - int ret = Interop.Bundle.RemoveItem(_handle, key); - if (ret == (int)BundleErrorFactory.BundleError.KeyNotAvailable) - { - return false; - } - BundleErrorFactory.CheckAndThrowException(ret, _handle); - _keys.Remove(key); - return true; - } - else - { - return false; - } - } - - /// - /// Decodes an encoded bundle data. - /// - /// 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; - - handle = Interop.Bundle.BundleDecode(bundleRaw, bundleRaw.Length); - if (ErrorFacts.GetLastResult() == (int)BundleErrorFactory.BundleError.InvalidParameter) - { - throw new ArgumentException("Invalid bundle raw"); - } - - return new Bundle(handle); - } - - /// - /// Encodes bundle to string. - /// - /// 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; - int len; - - Interop.Bundle.BundleEncode(_handle, out bundleRaw, out len); - if (ErrorFacts.GetLastResult() == (int)BundleErrorFactory.BundleError.InvalidParameter) - { - throw new InvalidOperationException("Invalid bundle"); - } - - return bundleRaw; - } - - /// - /// Releases any unmanaged resources used by this object. Can also dispose any other disposable objects. - /// - /// If true, disposes any disposable objects. If false, does not dispose disposable objects. - protected virtual void Dispose(bool disposing) - { - if (!_disposed) - { - if (disposing) - { - if (_handle != null && !_handle.IsInvalid) - _handle.Dispose(); - } - - _disposed = true; - } - } - - /// - /// Destructor of the bundle class. - /// - ~Bundle() - { - Dispose(false); - } - - static private void IntPtrToStringArray(IntPtr unmanagedArray, int size, out string[] managedArray) - { - managedArray = new string[size]; - IntPtr[] IntPtrArray = new IntPtr[size]; - - Marshal.Copy(unmanagedArray, IntPtrArray, 0, size); - - for (int iterator = 0; iterator < size; iterator++) - { - managedArray[iterator] = Marshal.PtrToStringAnsi(IntPtrArray[iterator]); - } - } - } - - internal static class BundleErrorFactory - { - internal enum BundleError - { - None = ErrorCode.None, - OutOfMemory = ErrorCode.OutOfMemory, - InvalidParameter = ErrorCode.InvalidParameter, - KeyNotAvailable = ErrorCode.KeyNotAvailable, - KeyExists = -0x01180000 | 0x01 - } - - static internal void CheckAndThrowException(int error, SafeBundleHandle handle) - { - if ((BundleError)error == BundleError.None) - { - return; - } - else if ((BundleError)error == BundleError.OutOfMemory) - { - throw new InvalidOperationException("Out of memory"); - } - else if ((BundleError)error == BundleError.InvalidParameter) - { - if (handle.IsInvalid) - { - throw new InvalidOperationException("Invalid bundle instance (object may have been disposed or released)"); - } - throw new ArgumentException("Invalid parameter"); - } - else if ((BundleError)error == BundleError.KeyNotAvailable) - { - throw new ArgumentException("Key does not exist in the bundle"); - } - else if ((BundleError)error == BundleError.KeyExists) - { - throw new ArgumentException("Key already exists"); - } - } - } -} diff --git a/src/Tizen.Applications.Common/Tizen.Applications/CoreApplication.cs b/src/Tizen.Applications.Common/Tizen.Applications/CoreApplication.cs deleted file mode 100755 index d725a784b..000000000 --- a/src/Tizen.Applications.Common/Tizen.Applications/CoreApplication.cs +++ /dev/null @@ -1,217 +0,0 @@ -/* - * 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.Applications.CoreBackend; - -namespace Tizen.Applications -{ - /// - /// This class represents an application controlled lifecycles by the backend system. - /// - public class CoreApplication : Application - { - private readonly ICoreBackend _backend; - private bool _disposedValue = false; - - /// - /// Initializes the CoreApplication class. - /// - /// The backend instance implementing ICoreBacked interface. - public CoreApplication(ICoreBackend backend) - { - _backend = backend; - } - - /// - /// Occurs when the application is launched. - /// - public event EventHandler Created; - - /// - /// Occurs when the application is about to shutdown. - /// - public event EventHandler Terminated; - - /// - /// Occurs whenever the application receives the appcontrol message. - /// - public event EventHandler AppControlReceived; - - /// - /// Occurs when the system memory is low. - /// - public event EventHandler LowMemory; - - /// - /// Occurs when the system battery is low. - /// - public event EventHandler LowBattery; - - /// - /// Occurs when the system language is chagned. - /// - public event EventHandler LocaleChanged; - - /// - /// Occurs when the region format is changed. - /// - public event EventHandler RegionFormatChanged; - - /// - /// Occurs when the device orientation is changed. - /// - public event EventHandler DeviceOrientationChanged; - - /// - /// The backend instance. - /// - protected ICoreBackend Backend { get { return _backend; } } - - /// - /// Runs the application's main loop. - /// - /// Arguments from commandline. - public override void Run(string[] args) - { - base.Run(args); - - _backend.AddEventHandler(EventType.Created, OnCreate); - _backend.AddEventHandler(EventType.Terminated, OnTerminate); - _backend.AddEventHandler(EventType.AppControlReceived, OnAppControlReceived); - _backend.AddEventHandler(EventType.LowMemory, OnLowMemory); - _backend.AddEventHandler(EventType.LowBattery, OnLowBattery); - _backend.AddEventHandler(EventType.LocaleChanged, OnLocaleChanged); - _backend.AddEventHandler(EventType.RegionFormatChanged, OnRegionFormatChanged); - _backend.AddEventHandler(EventType.DeviceOrientationChanged, OnDeviceOrientationChanged); - - string[] argsClone = null; - - if (args == null) - { - argsClone = new string[1]; - } - else - { - argsClone = new string[args.Length + 1]; - args.CopyTo(argsClone, 1); - } - argsClone[0] = string.Empty; - _backend.Run(argsClone); - } - - /// - /// Exits the main loop of the application. - /// - public override void Exit() - { - _backend.Exit(); - } - - /// - /// Overrides this method if want to handle behavior when the application is launched. - /// If base.OnCreated() is not called, the event 'Created' will not be emitted. - /// - protected virtual void OnCreate() - { - Created?.Invoke(this, EventArgs.Empty); - } - - /// - /// Overrides this method if want to handle behavior when the application is terminated. - /// If base.OnTerminate() is not called, the event 'Terminated' will not be emitted. - /// - protected virtual void OnTerminate() - { - Terminated?.Invoke(this, EventArgs.Empty); - } - - /// - /// Overrides this method if want to handle behavior when the application receives the appcontrol message. - /// If base.OnAppControlReceived() is not called, the event 'AppControlReceived' will not be emitted. - /// - /// - protected virtual void OnAppControlReceived(AppControlReceivedEventArgs e) - { - AppControlReceived?.Invoke(this, e); - } - - /// - /// Overrides this method if want to handle behavior when the system memory is low. - /// If base.OnLowMemory() is not called, the event 'LowMemory' will not be emitted. - /// - protected virtual void OnLowMemory(LowMemoryEventArgs e) - { - LowMemory?.Invoke(this, e); - System.GC.Collect(); - } - - /// - /// Overrides this method if want to handle behavior when the system battery is low. - /// If base.OnLowBattery() is not called, the event 'LowBattery' will not be emitted. - /// - protected virtual void OnLowBattery(LowBatteryEventArgs e) - { - LowBattery?.Invoke(this, e); - } - - /// - /// Overrides this method if want to handle behavior when the system language is changed. - /// If base.OnLocaleChanged() is not called, the event 'LocaleChanged' will not be emitted. - /// - protected virtual void OnLocaleChanged(LocaleChangedEventArgs e) - { - LocaleChanged?.Invoke(this, e); - } - - /// - /// Overrides this method if want to handle behavior when the region format is changed. - /// If base.OnRegionFormatChanged() is not called, the event 'RegionFormatChanged' will not be emitted. - /// - protected virtual void OnRegionFormatChanged(RegionFormatChangedEventArgs e) - { - RegionFormatChanged?.Invoke(this, e); - } - - /// - /// Overrides this method if want to handle behavior when the device orientation is changed. - /// If base.OnRegionFormatChanged() is not called, the event 'RegionFormatChanged' will not be emitted. - /// - protected virtual void OnDeviceOrientationChanged(DeviceOrientationEventArgs e) - { - DeviceOrientationChanged?.Invoke(this, e); - } - - /// - /// Releases any unmanaged resources used by this object. Can also dispose any other disposable objects. - /// - /// If true, disposes any disposable objects. If false, does not dispose disposable objects. - protected override void Dispose(bool disposing) - { - if (!_disposedValue) - { - if (disposing) - { - _backend.Dispose(); - } - - _disposedValue = true; - } - base.Dispose(disposing); - } - } -} diff --git a/src/Tizen.Applications.Common/Tizen.Applications/DeviceOrientation.cs b/src/Tizen.Applications.Common/Tizen.Applications/DeviceOrientation.cs deleted file mode 100755 index 19a8f21cb..000000000 --- a/src/Tizen.Applications.Common/Tizen.Applications/DeviceOrientation.cs +++ /dev/null @@ -1,44 +0,0 @@ -/* - * 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. - */ - -namespace Tizen.Applications -{ - /// - /// Enumeration for the device orientation. - /// - public enum DeviceOrientation - { - /// - /// The device orientation is 0. - /// - Orientation_0 = 0, - - /// - /// The device orientation is 90. - /// - Orientation_90 = 90, - - /// - /// The device orientation is 180. - /// - Orientation_180 = 180, - - /// - /// The device orientation is 270. - /// - Orientation_270 = 270, - } -} \ No newline at end of file diff --git a/src/Tizen.Applications.Common/Tizen.Applications/DeviceOrientationEventArgs.cs b/src/Tizen.Applications.Common/Tizen.Applications/DeviceOrientationEventArgs.cs deleted file mode 100755 index 63bb8ea5d..000000000 --- a/src/Tizen.Applications.Common/Tizen.Applications/DeviceOrientationEventArgs.cs +++ /dev/null @@ -1,40 +0,0 @@ -/* - * 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.Applications -{ - /// - /// The class for event arguments of the DeviceOrientationChanged. - /// - public class DeviceOrientationEventArgs : EventArgs - { - /// - /// Initializes the DeviceOrientationEventArgs class. - /// - /// The information of the DeviceOrientation - public DeviceOrientationEventArgs(DeviceOrientation orientation) - { - DeviceOrientation = orientation; - } - - /// - /// The received DeviceOrientation. - /// - public DeviceOrientation DeviceOrientation { get; private set; } - } -} diff --git a/src/Tizen.Applications.Common/Tizen.Applications/DirectoryInfo.cs b/src/Tizen.Applications.Common/Tizen.Applications/DirectoryInfo.cs deleted file mode 100755 index 0166fc19a..000000000 --- a/src/Tizen.Applications.Common/Tizen.Applications/DirectoryInfo.cs +++ /dev/null @@ -1,173 +0,0 @@ -/* - * 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. - */ - -namespace Tizen.Applications -{ - /// - /// Represents directory information of the application. - /// - public class DirectoryInfo - { - private string _dataPath; - private string _cachePath; - private string _resourcePath; - - private string _sharedDataPath; - private string _sharedResourcePath; - private string _sharedTrustedPath; - - private string _externalDataPath; - private string _externalCachePath; - private string _externalSharedDataPath; - - private string _expansionPackageResourcePath; - - internal DirectoryInfo() - { - } - - /// - /// Gets the absolute path to the application's data directory, which is used to store private data of the application. - /// - public string Data - { - get - { - if (_dataPath == null) - _dataPath = Interop.AppCommon.AppGetDataPath(); - return _dataPath; - } - } - - /// - /// Gets the absolute path to the application's cache directory, which is used to store temporary data of the application. - /// - public string Cache - { - get - { - if (_cachePath == null) - _cachePath = Interop.AppCommon.AppGetCachePath(); - return _cachePath; - } - } - - /// - /// Gets the absolute path to the application resource directory. The resource files are delivered with the application package. - /// - public string Resource - { - get - { - if (_resourcePath == null) - _resourcePath = Interop.AppCommon.AppGetResourcePath(); - return _resourcePath; - } - } - - /// - /// Gets the absolute path to the application's shared data directory, which is used to share data with other applications. - /// - public string SharedData - { - get - { - if (_sharedDataPath == null) - _sharedDataPath = Interop.AppCommon.AppGetSharedDataPath(); - return _sharedDataPath; - } - } - - /// - /// Gets the absolute path to the application's shared resource directory, which is used to share resources with other applications. - /// - public string SharedResource - { - get - { - if (_sharedResourcePath == null) - _sharedResourcePath = Interop.AppCommon.AppGetSharedResourcePath(); - return _sharedResourcePath; - } - } - - - /// - /// Gets the absolute path to the application's shared trusted directory, which is used to share data with a family of trusted applications. - /// - public string SharedTrusted - { - get - { - if (_sharedTrustedPath == null) - _sharedTrustedPath = Interop.AppCommon.AppGetSharedTrustedPath(); - return _sharedTrustedPath; - } - } - - /// - /// Gets the absolute path to the application's external data directory, which is used to store data of the application. - /// - public string ExternalData - { - get - { - if (_externalDataPath == null) - _externalDataPath = Interop.AppCommon.AppGetExternalDataPath(); - return _externalDataPath; - } - } - - /// - /// Gets the absolute path to the application's external cache directory, which is used to store temporary data of the application. - /// - public string ExternalCache - { - get - { - if (_externalCachePath == null) - _externalCachePath = Interop.AppCommon.AppGetExternalCachePath(); - return _externalCachePath; - } - } - - /// - /// Gets the absolute path to the application's external shared data directory, which is used to share data with other applications. - /// - public string ExternalSharedData - { - get - { - if (_externalSharedDataPath == null) - _externalSharedDataPath = Interop.AppCommon.AppGetExternalSharedDataPath(); - return _externalSharedDataPath; - } - } - - /// - /// Gets the absolute path to the application's TEP(Tizen Expansion Package) directory. The resource files are delivered with the expansion package. - /// - public string ExpansionPackageResource - { - get - { - if (_expansionPackageResourcePath == null) - _expansionPackageResourcePath = Interop.AppCommon.AppGetTepResourcePath(); - return _expansionPackageResourcePath; - } - } - } -} diff --git a/src/Tizen.Applications.Common/Tizen.Applications/LocaleChangedEventArgs.cs b/src/Tizen.Applications.Common/Tizen.Applications/LocaleChangedEventArgs.cs deleted file mode 100755 index a1e99bad4..000000000 --- a/src/Tizen.Applications.Common/Tizen.Applications/LocaleChangedEventArgs.cs +++ /dev/null @@ -1,42 +0,0 @@ -/* - * 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.Applications -{ - /// - /// The class for the argument of the LocaleChanged EventHandler - /// - public class LocaleChangedEventArgs : EventArgs - { - - /// - /// Initializes LocaleChangedEventArgs class - /// - /// The information of the Locale - public LocaleChangedEventArgs(string locale) - { - Locale = locale; - } - - /// - /// The property to get the intformation of the Locale - /// - public string Locale { get; private set; } - - } -} diff --git a/src/Tizen.Applications.Common/Tizen.Applications/LowBatteryEventArgs.cs b/src/Tizen.Applications.Common/Tizen.Applications/LowBatteryEventArgs.cs deleted file mode 100755 index bf0c49aae..000000000 --- a/src/Tizen.Applications.Common/Tizen.Applications/LowBatteryEventArgs.cs +++ /dev/null @@ -1,40 +0,0 @@ -/* - * 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.Applications -{ - /// - /// The class for the argument of the LowBattery EventHandler - /// - public class LowBatteryEventArgs : EventArgs - { - /// - /// Initializes LowBatteryEventArgs class - /// - /// The information of the LowBatteryEventArgs - public LowBatteryEventArgs(LowBatteryStatus status) - { - LowBatteryStatus = status; - } - - /// - /// The property to get the intformation of the LowBatteryStatus - /// - public LowBatteryStatus LowBatteryStatus { get; private set; } - } -} diff --git a/src/Tizen.Applications.Common/Tizen.Applications/LowBatteryStatus.cs b/src/Tizen.Applications.Common/Tizen.Applications/LowBatteryStatus.cs deleted file mode 100755 index d9d218460..000000000 --- a/src/Tizen.Applications.Common/Tizen.Applications/LowBatteryStatus.cs +++ /dev/null @@ -1,39 +0,0 @@ -/* - * 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. - */ - -namespace Tizen.Applications -{ - /// - /// Enumeration for the low battery status. - /// - public enum LowBatteryStatus - { - /// - /// - /// - None = 0, - - /// - /// The battery status is under 1%. - /// - PowerOff = 1, - - /// - /// The battery status is under 5%. - /// - CriticalLow - } -} diff --git a/src/Tizen.Applications.Common/Tizen.Applications/LowMemoryEventArgs.cs b/src/Tizen.Applications.Common/Tizen.Applications/LowMemoryEventArgs.cs deleted file mode 100755 index e42fedcb6..000000000 --- a/src/Tizen.Applications.Common/Tizen.Applications/LowMemoryEventArgs.cs +++ /dev/null @@ -1,40 +0,0 @@ -/* - * 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.Applications -{ - /// - /// The class for the argument of the LowMemory EventHandler - /// - public class LowMemoryEventArgs : EventArgs - { - /// - /// Initializes LowMemoryEventArgs class - /// - /// The information of the LowMemoryStatus - public LowMemoryEventArgs(LowMemoryStatus status) - { - LowMemoryStatus = status; - } - - /// - /// The property to get the intformation of the LowMemoryStatus - /// - public LowMemoryStatus LowMemoryStatus { get; private set; } - } -} diff --git a/src/Tizen.Applications.Common/Tizen.Applications/LowMemoryStatus.cs b/src/Tizen.Applications.Common/Tizen.Applications/LowMemoryStatus.cs deleted file mode 100755 index e584addfd..000000000 --- a/src/Tizen.Applications.Common/Tizen.Applications/LowMemoryStatus.cs +++ /dev/null @@ -1,44 +0,0 @@ -/* - * 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. - */ - -namespace Tizen.Applications -{ - /// - /// Enumeration for the low memory status. - /// - public enum LowMemoryStatus - { - /// - /// Not initialized status. - /// - None = 0x00, - - /// - /// Normal status. - /// - Normal = 0x01, - - /// - /// Soft warning status. - /// - SoftWarning = 0x02, - - /// - /// Hard warning status. - /// - HardWarning = 0x04, - } -} diff --git a/src/Tizen.Applications.Common/Tizen.Applications/ReceivedAppControl.cs b/src/Tizen.Applications.Common/Tizen.Applications/ReceivedAppControl.cs deleted file mode 100755 index f639ef36b..000000000 --- a/src/Tizen.Applications.Common/Tizen.Applications/ReceivedAppControl.cs +++ /dev/null @@ -1,146 +0,0 @@ -/* - * 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.Applications -{ - /// - /// Represents the received AppControl. - /// - /// - /// - /// public class ReceivedAppControlExample : UIApplication - /// { - /// // ... - /// protected override void OnAppControlReceived(AppControlReceivedEventArgs e) - /// { - /// ReceivedAppControl control = e.ReceivedAppControl; - /// if (control.Operation == AppControlOperations.Pick) - /// { - /// Log.Debug(LogTag, "Received AppControl is Pick"); - /// } - /// if (control.IsReplyRequest) - /// { - /// AppControl replyRequest = new AppControl(); - /// replyRequest.ExtraData.Add("myKey", "I'm replying"); - /// control.ReplyToLaunchRequest(replyRequest, AppControlReplyResult.Succeeded); - /// } - /// } - /// } - /// - /// - public class ReceivedAppControl : AppControl - { - private const string LogTag = "Tizen.Applications"; - - /// - /// Initializes a ReceivedAppControl class. - /// - public ReceivedAppControl(SafeAppControlHandle handle) : base(handle) - { - } - - /// - /// Gets the application ID of the caller from the launch request. - /// - /// - /// The application ID of the caller. - /// - /// - /// - /// protected override void OnAppControlReceived(AppControlReceivedEventArgs e) - /// { - /// ReceivedAppControl control = e.ReceivedAppControl; - /// string caller = control.CallerApplicationId; - /// } - /// - /// - public string CallerApplicationId - { - get - { - string value = String.Empty; - Interop.AppControl.ErrorCode err = Interop.AppControl.GetCaller(SafeAppControlHandle, out value); - if (err != Interop.AppControl.ErrorCode.None) - { - Log.Warn(LogTag, "Failed to get the caller application id from the AppControl. Err = " + err); - } - return value; - } - } - - /// - /// Checks whether the caller is requesting a reply from the launch request. - /// - /// - /// If true, this ReceivedAppControl is requested by the caller, otherwise false - /// - /// - /// - /// protected override void OnAppControlReceived(AppControlReceivedEventArgs e) - /// { - /// ReceivedAppControl control = e.ReceivedAppControl; - /// bool isReply = control.IsReplyRequest; - /// } - /// - /// - public bool IsReplyRequest - { - get - { - bool value = false; - Interop.AppControl.ErrorCode err = Interop.AppControl.IsReplyRequested(SafeAppControlHandle, out value); - if (err != Interop.AppControl.ErrorCode.None) - { - Log.Warn(LogTag, "Failed to check the reply of the AppControl is requested. Err = " + err); - } - return value; - } - } - - /// - /// Replies to the launch request sent by the caller. - /// If the caller application sends the launch request to receive the result, the callee application can return the result back to the caller. - /// - /// The AppControl in which the results of the callee are contained. - /// The result code of the launch request. - /// - /// - /// protected override void OnAppControlReceived(AppControlReceivedEventArgs e) - /// { - /// ReceivedAppControl control = e.ReceivedAppControl; - /// if (control.IsReplyRequest) - /// { - /// AppControl replyRequest = new AppControl(); - /// replyRequest.ExtraData.Add("myKey", "I'm replying"); - /// control.ReplyToLaunchRequest(replyRequest, AppControlReplyResult.Succeeded); - /// } - /// } - /// - /// - public void ReplyToLaunchRequest(AppControl replyRequest, AppControlReplyResult result) - { - if (replyRequest == null) - { - throw new ArgumentNullException("replyRequest"); - } - Interop.AppControl.ErrorCode err = Interop.AppControl.ReplyToLaunchRequest(replyRequest.SafeAppControlHandle, this.SafeAppControlHandle, (int)result); - if (err != Interop.AppControl.ErrorCode.None) - throw new InvalidOperationException("Failed to reply. Err = " + err); - } - } -} diff --git a/src/Tizen.Applications.Common/Tizen.Applications/RecentApplicationControl.cs b/src/Tizen.Applications.Common/Tizen.Applications/RecentApplicationControl.cs deleted file mode 100755 index 19f9bb76c..000000000 --- a/src/Tizen.Applications.Common/Tizen.Applications/RecentApplicationControl.cs +++ /dev/null @@ -1,67 +0,0 @@ -/* - * 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.Collections.Generic; -using System.ComponentModel; -using System.Runtime.InteropServices; - -namespace Tizen.Applications -{ - /// - /// This class provides methods and properties to get information of the recent application. - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public class RecentApplicationControl - { - private const string LogTag = "Tizen.Applications"; - - private readonly string _pkgId; - - internal RecentApplicationControl(String pkgId) - { - _pkgId = pkgId; - } - - /// - /// Deletes the application from the recent application list. - /// - /// platform - public void Delete() - { - Interop.ApplicationManager.ErrorCode err = Interop.ApplicationManager.ErrorCode.None; - err = Interop.ApplicationManager.RuaDeleteHistoryWithPkgname(_pkgId); - if (err != Interop.ApplicationManager.ErrorCode.None) - { - throw ApplicationManagerErrorFactory.GetException(err, "Failed to delete application from recent application list."); - } - } - - /// - /// Deletes all recent applications from the recent application list. - /// - /// platform - public static void DeleteAll() - { - Interop.ApplicationManager.ErrorCode err = Interop.ApplicationManager.ErrorCode.None; - err = Interop.ApplicationManager.RuaClearHistory(); - if (err != Interop.ApplicationManager.ErrorCode.None) - { - throw ApplicationManagerErrorFactory.GetException(err, "Failed to clear the recent application list."); - } - } - } -} diff --git a/src/Tizen.Applications.Common/Tizen.Applications/RecentApplicationInfo.cs b/src/Tizen.Applications.Common/Tizen.Applications/RecentApplicationInfo.cs deleted file mode 100755 index 6ffc644af..000000000 --- a/src/Tizen.Applications.Common/Tizen.Applications/RecentApplicationInfo.cs +++ /dev/null @@ -1,72 +0,0 @@ -/* - * 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.ComponentModel; -using System.Runtime.InteropServices; - -namespace Tizen.Applications -{ - /// - /// This class provides methods and properties to get information of the recent application. - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public class RecentApplicationInfo : ApplicationInfo - { - private const string LogTag = "Tizen.Applications"; - - /// - /// Gets the instance ID. - /// - public string InstanceId { get; private set; } - - /// - /// Gets the instance name. - /// - public string InstanceName { get; private set; } - - /// - /// Gets the arguements. - /// - public string Arg { get; private set; } - - /// - /// Gets the URI. - /// - public string Uri { get; private set; } - - /// - /// Gets the launchTime. - /// - public DateTime LaunchTime { get; private set; } - - /// - /// Gets the recent application controller. - /// - public RecentApplicationControl Controller { get; private set; } - - internal RecentApplicationInfo(Interop.ApplicationManager.RuaRec record) : base(Marshal.PtrToStringAnsi(record.pkgName)) - { - InstanceId = Marshal.PtrToStringAnsi(record.instanceId); - InstanceName = Marshal.PtrToStringAnsi(record.instanceName); - Arg = Marshal.PtrToStringAnsi(record.arg); - Uri = Marshal.PtrToStringAnsi(record.uri); - long seconds = record.launchTime.ToInt64(); - LaunchTime = new DateTime(1970, 1, 1).AddSeconds(seconds); - Controller = new RecentApplicationControl(Marshal.PtrToStringAnsi(record.pkgName)); - } - } -} diff --git a/src/Tizen.Applications.Common/Tizen.Applications/RegionFormatChangedEventArgs.cs b/src/Tizen.Applications.Common/Tizen.Applications/RegionFormatChangedEventArgs.cs deleted file mode 100755 index a4810935b..000000000 --- a/src/Tizen.Applications.Common/Tizen.Applications/RegionFormatChangedEventArgs.cs +++ /dev/null @@ -1,41 +0,0 @@ -/* - * 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.Applications -{ - /// - /// The class for the argument of the RegionFormatChanged EventHandler - /// - public class RegionFormatChangedEventArgs : EventArgs - { - - /// - /// Initializes RegionFormatChangedEventArgs class - /// - /// The information of the Region - public RegionFormatChangedEventArgs(string region) - { - Region = region; - } - - /// - /// The property to get the intformation of the Region - /// - public string Region { get; private set; } - } -} diff --git a/src/Tizen.Applications.Common/Tizen.Applications/ResourceManager.cs b/src/Tizen.Applications.Common/Tizen.Applications/ResourceManager.cs deleted file mode 100755 index 3212faccc..000000000 --- a/src/Tizen.Applications.Common/Tizen.Applications/ResourceManager.cs +++ /dev/null @@ -1,125 +0,0 @@ -/* - * Copyright (c) 2017 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.Applications -{ - /// - /// The class for getting the resource path. - /// - public static class ResourceManager - { - /// - /// Enumeration for the resource category. - /// - public enum Category : int - { - /// - /// Image format. - /// - Image = 0, - - /// - /// Layout format. - /// - Layout, - - /// - /// Sound format. - /// - Sound, - - /// - /// Binary format. - /// - Binary - } - - private static ErrorCode AppResourceManagerGet(Category category, string id, out string path) - { - ErrorCode err; - - try - { - err = Interop.AppCommon.AppResourceManagerGet( - (Interop.AppCommon.ResourceCategory)category, id, out path); - } - catch (System.TypeLoadException) - { - err = Interop.AppCommon.LegacyAppResourceManagerGet( - (Interop.AppCommon.ResourceCategory)category, id, out path); - } - - return err; - } - - /// - /// Converts resource ID to the path name. - /// - /// Category to search. - /// ID to search. - /// Found resource path. - /// Thrown in case of failed conditions. - public static string GetPath(Category category, string id) - { - string path; - ErrorCode err = AppResourceManagerGet(category, id, out path); - - switch (err) - { - case ErrorCode.InvalidParameter: - throw new InvalidOperationException("Invalid parameter"); - - case ErrorCode.OutOfMemory: - throw new InvalidOperationException("Out-of-memory at unmanaged code"); - - case ErrorCode.IoError: - throw new InvalidOperationException("IO error at unmanaged code"); - } - - return path; - } - - /// - /// Converts resource ID to the path name. - /// - /// Category to search. - /// ID to search. - /// Found resource path or null when the resource doesn't exist. - /// Thrown in case of failed conditions. - public static string TryGetPath(Category category, string id) - { - string path; - ErrorCode err = AppResourceManagerGet(category, id, out path); - - switch (err) - { - case ErrorCode.InvalidParameter: - throw new InvalidOperationException("Invalid parameter"); - - case ErrorCode.OutOfMemory: - throw new InvalidOperationException("Out-of-memory at unmanaged code"); - - case ErrorCode.IoError: - return null; - } - - return path; - } - } -} diff --git a/src/Tizen.Applications.Common/Tizen.Applications/SafeAppControlHandle.cs b/src/Tizen.Applications.Common/Tizen.Applications/SafeAppControlHandle.cs deleted file mode 100755 index 50006f595..000000000 --- a/src/Tizen.Applications.Common/Tizen.Applications/SafeAppControlHandle.cs +++ /dev/null @@ -1,63 +0,0 @@ -/* - * 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; - -namespace Tizen.Applications -{ - /// - /// Represents a wrapper class for an unmanaged AppControl handle. - /// - public sealed class SafeAppControlHandle : SafeHandle - { - /// - /// Initializes a new instance of the SafeAppControlHandle class. - /// - public SafeAppControlHandle() : base(IntPtr.Zero, true) - { - } - - /// - /// Initializes a new instance of the SafeAppControlHandle class. - /// - /// An IntPtr object that represents the pre-existing handle to use. - /// true to reliably release the handle during the finalization phase; false to prevent reliable release. - public SafeAppControlHandle(IntPtr existingHandle, bool ownsHandle) : base(IntPtr.Zero, ownsHandle) - { - SetHandle(existingHandle); - } - - /// - /// Gets a value that indicates whether the handle is invalid. - /// - public override bool IsInvalid - { - get { return this.handle == IntPtr.Zero; } - } - - /// - /// When overridden in a derived class, executes the code required to free the handle. - /// - /// true if the handle is released successfully. - protected override bool ReleaseHandle() - { - Interop.AppControl.DangerousDestroy(this.handle); - this.SetHandle(IntPtr.Zero); - return true; - } - } -} diff --git a/src/Tizen.Applications.Common/Tizen.Applications/SafeBundleHandle.cs b/src/Tizen.Applications.Common/Tizen.Applications/SafeBundleHandle.cs deleted file mode 100755 index 7da7f2790..000000000 --- a/src/Tizen.Applications.Common/Tizen.Applications/SafeBundleHandle.cs +++ /dev/null @@ -1,63 +0,0 @@ -/* - * 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; - -namespace Tizen.Applications -{ - /// - /// Represents a wrapper class for an unmanaged bundle handle. - /// - public sealed class SafeBundleHandle : SafeHandle - { - /// - /// Initializes a new instance of the SafeBundleHandle class. - /// - public SafeBundleHandle() : base(IntPtr.Zero, true) - { - } - - /// - /// Initializes a new instance of the SafeBundleHandle class. - /// - /// An IntPtr object that represents the pre-existing handle to use. - /// true to reliably release the handle during the finalization phase; false to prevent reliable release. - public SafeBundleHandle(IntPtr existingHandle, bool ownsHandle) : base(IntPtr.Zero, ownsHandle) - { - SetHandle(existingHandle); - } - - /// - /// Gets a value that indicates whether the handle is invalid. - /// - public override bool IsInvalid - { - get { return this.handle == IntPtr.Zero; } - } - - /// - /// When overridden in a derived class, executes the code required to free the handle. - /// - /// true if the handle is released successfully. - protected override bool ReleaseHandle() - { - Interop.Bundle.DangerousFree(this.handle); - this.SetHandle(IntPtr.Zero); - return true; - } - } -} diff --git a/src/Tizen.Applications.Common/Tizen.Applications/TizenSynchronizationContext.cs b/src/Tizen.Applications.Common/Tizen.Applications/TizenSynchronizationContext.cs deleted file mode 100644 index df2995039..000000000 --- a/src/Tizen.Applications.Common/Tizen.Applications/TizenSynchronizationContext.cs +++ /dev/null @@ -1,128 +0,0 @@ -/* - * 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.Collections.Concurrent; -using System.Threading; - -namespace Tizen.Applications -{ - - /// - /// Provides a synchronization context for the Tizen application model. - /// - public class TizenSynchronizationContext : SynchronizationContext - { - private readonly Interop.Glib.GSourceFunc _wrapperHandler; - private readonly Object _transactionLock = new Object(); - private readonly ConcurrentDictionary _handlerMap = new ConcurrentDictionary(); - private int _transactionId = 0; - - /// - /// Initializes a new instance of the TizenSynchronizationContext class. - /// - public TizenSynchronizationContext() - { - _wrapperHandler = new Interop.Glib.GSourceFunc(Handler); - } - - /// - /// Initilizes a new TizenSynchronizationContext and install into the current thread. - /// - /// - /// It is equivalent. - /// - /// SetSynchronizationContext(new TizenSynchronizationContext()); - /// - /// - public static void Initialize() - { - SetSynchronizationContext(new TizenSynchronizationContext()); - } - - - /// - /// Dispatches an asynchronous message to a Tizen main loop. - /// - /// The SendOrPostCallback delegate to call. - /// The object passed to the delegate. - /// - /// The post method starts an asynchronous request to post a message. - public override void Post(SendOrPostCallback d, object state) - { - Post(() => - { - d(state); - }); - } - - /// - /// Dispatches a synchronous message to a Tizen main loop. - /// - /// The SendOrPostCallback delegate to call. - /// The object passed to the delegate. - /// - /// The send method starts a synchronous request to send a message. - public override void Send(SendOrPostCallback d, object state) - { - var mre = new ManualResetEvent(false); - Exception err = null; - Post(() => - { - try - { - d(state); - } - catch (Exception ex) - { - err = ex; - } - finally - { - mre.Set(); - } - }); - mre.WaitOne(); - if (err != null) - { - throw err; - } - } - - private void Post(Action action) - { - int id = 0; - lock (_transactionLock) - { - id = _transactionId++; - } - _handlerMap.TryAdd(id, action); - Interop.Glib.IdleAdd(_wrapperHandler, (IntPtr)id); - } - - private bool Handler(IntPtr userData) - { - int key = (int)userData; - if (_handlerMap.ContainsKey(key)) - { - Action action; - _handlerMap.TryRemove(key, out action); - action?.Invoke(); - } - return false; - } - } -} diff --git a/src/Tizen.Applications.DataControl/Interop/Interop.DataControl.cs b/src/Tizen.Applications.DataControl/Interop/Interop.DataControl.cs deleted file mode 100755 index b19f6eeed..000000000 --- a/src/Tizen.Applications.DataControl/Interop/Interop.DataControl.cs +++ /dev/null @@ -1,466 +0,0 @@ -/* - * Copyright (c) 2017 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; -using System.Text; -using Tizen.Applications; -using Tizen; -using Tizen.Applications.DataControl; - -internal static partial class Interop -{ - internal static partial class DataControl - { - - internal enum NativeResultType : int - { - Success = Tizen.Internals.Errors.ErrorCode.None, - OutOfMemory = Tizen.Internals.Errors.ErrorCode.OutOfMemory, - IoError = Tizen.Internals.Errors.ErrorCode.IoError, - InvalidParameter = Tizen.Internals.Errors.ErrorCode.InvalidParameter, - PermissionDenied = Tizen.Internals.Errors.ErrorCode.PermissionDenied, - MaxExceed = -0x01190000 | 0x01, - } - - internal sealed class SafeBulkDataHandle : SafeHandle - { - internal SafeBulkDataHandle() - : base(IntPtr.Zero, true) - { - } - - internal SafeBulkDataHandle(IntPtr existingHandle, bool ownsHandle) : base(IntPtr.Zero, ownsHandle) - { - SetHandle(existingHandle); - } - - public override bool IsInvalid - { - get { return this.handle == IntPtr.Zero; } - } - - protected override bool ReleaseHandle() - { - DataControl.BulkFree(this.handle); - this.SetHandle(IntPtr.Zero); - return true; - } - } - - internal sealed class SafeBulkResultDataHandle : SafeHandle - { - internal SafeBulkResultDataHandle() - : base(IntPtr.Zero, true) - { - } - - internal SafeBulkResultDataHandle(IntPtr existingHandle, bool ownsHandle) : base(IntPtr.Zero, ownsHandle) - { - SetHandle(existingHandle); - } - - public override bool IsInvalid - { - get { return this.handle == IntPtr.Zero; } - } - - protected override bool ReleaseHandle() - { - DataControl.BulkResultFree(this.handle); - this.SetHandle(IntPtr.Zero); - return true; - } - } - - internal sealed class SafeCursorHandle : SafeHandle - { - internal SafeCursorHandle() - : base(IntPtr.Zero, true) - { - } - - internal SafeCursorHandle(IntPtr existingHandle, bool ownsHandle) : base(IntPtr.Zero, ownsHandle) - { - SetHandle(existingHandle); - } - - public override bool IsInvalid - { - get { return this.handle == IntPtr.Zero; } - } - - protected override bool ReleaseHandle() - { - this.SetHandle(IntPtr.Zero); - return true; - } - } - - internal sealed class SafeDataControlHandle : SafeHandle - { - internal SafeDataControlHandle() - : base(IntPtr.Zero, true) - { - } - - internal SafeDataControlHandle(IntPtr existingHandle, bool ownsHandle) : base(IntPtr.Zero, ownsHandle) - { - SetHandle(existingHandle); - } - - public override bool IsInvalid - { - get { return this.handle == IntPtr.Zero; } - } - - protected override bool ReleaseHandle() - { - DataControl.Destroy(this.handle); - this.SetHandle(IntPtr.Zero); - return true; - } - } - - [DllImport(Libraries.DataControl, EntryPoint = "data_control_sql_create")] - internal static extern ResultType DataControlCreate(out SafeDataControlHandle handle); - - [DllImport(Libraries.DataControl, EntryPoint = "data_control_sql_destroy")] - internal static extern ResultType Destroy(IntPtr handle); - - [DllImport(Libraries.DataControl, EntryPoint = "data_control_sql_get_provider_id")] - internal static extern ResultType DataControlGetProviderId(SafeDataControlHandle handle, out string providerId); - - [DllImport(Libraries.DataControl, EntryPoint = "data_control_sql_set_provider_id")] - internal static extern ResultType DataControlSetProviderId(SafeDataControlHandle handle, string providerId); - - [DllImport(Libraries.DataControl, EntryPoint = "data_control_sql_set_data_id")] - internal static extern ResultType DataControlSetDataId(SafeDataControlHandle handle, string dataId); - - [DllImport(Libraries.DataControl, EntryPoint = "data_control_sql_get_data_id")] - internal static extern ResultType DataControlGetDataId(SafeDataControlHandle handle, out string dataId); - - internal delegate void MapGetResponseCallback(int requestID, - IntPtr provider, string[] resultValueList, int resultValueCount, bool providerResult, string error, IntPtr userData); - internal delegate void MapSetResponseCallback(int requestID, - IntPtr provider, bool providerResult, string error, IntPtr userData); - internal delegate void MapAddResponseCallback(int requestID, - IntPtr provider, bool providerResult, string error, IntPtr userData); - internal delegate void MapRemoveResponseCallback(int requestID, - IntPtr provider, bool providerResult, string error, IntPtr userData); - internal delegate void MapBulkAddResponseCallback(int requestID, - IntPtr provider, IntPtr bulkResults, bool providerResult, string error, IntPtr userData); - - [StructLayoutAttribute(LayoutKind.Sequential)] - internal struct MapResponseCallbacks - { - public MapGetResponseCallback Get; - public MapSetResponseCallback Set; - public MapAddResponseCallback Add; - public MapRemoveResponseCallback Remove; - } - - internal delegate void SqlSelectResponseCallback(int requestID, - IntPtr provider, IntPtr cursor, bool providerResult, string error, IntPtr userData); - internal delegate void SqlInsertResponseCallback(int requestID, - IntPtr provider, long inserted_row_id, bool providerResult, string error, IntPtr userData); - internal delegate void SqlUpdateResponseCallback(int requestID, - IntPtr provider, bool providerResult, string error, IntPtr userData); - internal delegate void SqlDeleteResponseCallback(int requestID, - IntPtr provider, bool providerResult, string error, IntPtr userData); - internal delegate void SqlBulkInsertResponseCallback(int requestID, - IntPtr provider, IntPtr bulk_results, bool providerResult, string error, IntPtr userData); - - [StructLayoutAttribute(LayoutKind.Sequential)] - internal struct SqlResponseCallbacks - { - public SqlSelectResponseCallback Select; - public SqlInsertResponseCallback Insert; - public SqlUpdateResponseCallback Update; - public SqlDeleteResponseCallback Delete; - } - - [DllImport(Libraries.DataControl, EntryPoint = "data_control_map_register_response_cb")] - internal static extern ResultType RegisterMapResponse(SafeDataControlHandle provider, ref MapResponseCallbacks callback, IntPtr userData); - - [DllImport(Libraries.DataControl, EntryPoint = "data_control_map_unregister_response_cb")] - internal static extern ResultType UnregisterMapResponse(SafeDataControlHandle provider); - - [DllImport(Libraries.DataControl, EntryPoint = "data_control_map_register_add_bulk_data_response_cb")] - internal static extern ResultType RegisterMapBulkResponseCallback(SafeDataControlHandle provider, MapBulkAddResponseCallback callback, IntPtr userData); - - [DllImport(Libraries.DataControl, EntryPoint = "data_control_map_unregister_add_bulk_data_response_cb")] - internal static extern ResultType UnregisterMapBulkResponseCallback(SafeDataControlHandle provider); - - [DllImport(Libraries.DataControl, EntryPoint = "data_control_sql_register_response_cb")] - internal static extern ResultType RegisterSqlResponseCallback(SafeDataControlHandle provider, ref SqlResponseCallbacks callback, IntPtr userData); - - [DllImport(Libraries.DataControl, EntryPoint = "data_control_sql_unregister_response_cb")] - internal static extern ResultType UnregisterSqlResponseCallback(SafeDataControlHandle provider); - - [DllImport(Libraries.DataControl, EntryPoint = "data_control_sql_register_insert_bulk_data_response_cb")] - internal static extern ResultType RegisterSqlBulkResponseCallback(SafeDataControlHandle provider, SqlBulkInsertResponseCallback callback, IntPtr userData); - - [DllImport(Libraries.DataControl, EntryPoint = "data_control_sql_unregister_insert_bulk_data_response_cb")] - internal static extern ResultType UnregisterSqlBulkResponseCallback(SafeDataControlHandle provider); - - internal delegate void MapGetRequestCallback(int requestID, - IntPtr provider, string key, IntPtr userData); - internal delegate void MapSetRequestCallback(int requestID, - IntPtr provider, string key, string oldValue, string newValue, IntPtr userData); - internal delegate void MapAddRequestCallback(int requestID, - IntPtr provider, string key, string value, IntPtr userData); - internal delegate void MapRemoveRequestCallback(int requestID, - IntPtr provider, string key, string value, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void MapBulkAddRequestCallback(int requestID, - IntPtr provider, IntPtr bulkData, IntPtr userData); - - [StructLayoutAttribute(LayoutKind.Sequential)] - internal struct MapRequestCallbacks - { - public MapGetRequestCallback Get; - public MapSetRequestCallback Set; - public MapAddRequestCallback Add; - public MapRemoveRequestCallback Remove; - } - - internal delegate void SqlInsertRequestCallback(int requestID, - IntPtr provider, IntPtr insertData, IntPtr userData); - internal delegate void SqlSelectRequestCallback(int requestID, - IntPtr provider, IntPtr columnList, int columnCount, string where, string order, IntPtr userData); - internal delegate void SqlUpdateRequestCallback(int requestID, - IntPtr provider, IntPtr updateData, string where, IntPtr userData); - internal delegate void SqlDeleteRequestCallback(int requestID, - IntPtr provider, string where, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void SqlBulkInsertRequestCallback(int requestID, - IntPtr provider, IntPtr bulk_data, IntPtr userData); - - [StructLayoutAttribute(LayoutKind.Sequential)] - internal struct SqlRequestCallbacks - { - public SqlInsertRequestCallback Insert; - public SqlSelectRequestCallback Select; - public SqlUpdateRequestCallback Update; - public SqlDeleteRequestCallback Delete; - } - - [DllImport(Libraries.DataControl, EntryPoint = "data_control_provider_map_register_cb")] - internal static extern ResultType RegisterMapRequest(ref MapRequestCallbacks callback, IntPtr userData); - - [DllImport(Libraries.DataControl, EntryPoint = "data_control_provider_sql_register_cb")] - internal static extern ResultType RegisterSqlRequest(ref SqlRequestCallbacks callback, IntPtr userData); - - [DllImport(Libraries.DataControl, EntryPoint = "data_control_provider_sql_register_insert_bulk_data_request_cb")] - internal static extern ResultType RegisterSqlBulkRequest(SqlBulkInsertRequestCallback callback, IntPtr userData); - - [DllImport(Libraries.DataControl, EntryPoint = "data_control_provider_sql_unregister_insert_bulk_data_request_cb")] - internal static extern ResultType UnregisterSqlBulkRequest(); - - [DllImport(Libraries.DataControl, EntryPoint = "data_control_provider_map_register_add_bulk_data_request_cb")] - internal static extern ResultType RegisterMapBulkRequest(MapBulkAddRequestCallback callback, IntPtr userData); - - [DllImport(Libraries.DataControl, EntryPoint = "data_control_provider_map_unregister_add_bulk_data_request_cb")] - internal static extern ResultType UnregisterMapBulkRequest(); - - [DllImport(Libraries.DataControl, EntryPoint = "data_control_provider_send_map_result")] - internal static extern ResultType SendMapResult(int requestID); - - [DllImport(Libraries.DataControl, EntryPoint = "data_control_provider_send_map_get_value_result")] - internal static extern ResultType SendMapGetResult(int requestID, string[] valueList, int valueCount); - - [DllImport(Libraries.DataControl, EntryPoint = "data_control_provider_send_insert_result")] - internal static extern ResultType SendInsertResult(int requestID, long rowId); - - [DllImport(Libraries.DataControl, EntryPoint = "data_control_provider_send_update_result")] - internal static extern ResultType SendUpdateResult(int requestID); - - [DllImport(Libraries.DataControl, EntryPoint = "data_control_provider_send_delete_result")] - internal static extern ResultType SendDeleteResult(int requestID); - - [DllImport(Libraries.DataControl, EntryPoint = "datacontrol_provider_send_select_result_without_data")] - internal static extern ResultType SendSelectResult(int requestID, out int fd); - - [DllImport(Libraries.DataControl, EntryPoint = "data_control_provider_send_error")] - internal static extern ResultType SendError(int requestID, string error); - - [DllImport(Libraries.DataControl, EntryPoint = "data_control_sql_insert")] - internal static extern ResultType Insert(SafeDataControlHandle provider, SafeBundleHandle insertData, out int requestId); - - [DllImport(Libraries.DataControl, EntryPoint = "data_control_sql_select_with_page")] - internal static extern ResultType Select(SafeDataControlHandle provider, string[] columnList, int columnCount, string where, string order, int pageNumber, - int countPerPage, out int requestID); - - [DllImport(Libraries.DataControl, EntryPoint = "data_control_sql_delete")] - internal static extern ResultType Delete(SafeDataControlHandle provider, string where, out int requestID); - - [DllImport(Libraries.DataControl, EntryPoint = "data_control_sql_update")] - internal static extern ResultType Update(SafeDataControlHandle provider, SafeBundleHandle updatetData, string where, out int requestID); - - [DllImport(Libraries.DataControl, EntryPoint = "data_control_sql_insert_bulk_data")] - internal static extern ResultType BulkInsert(SafeDataControlHandle provider, SafeBulkDataHandle insertData, out int requestID); - - [DllImport(Libraries.DataControl, EntryPoint = "data_control_map_add")] - internal static extern ResultType MapAdd(SafeDataControlHandle provider, string key, string value, out int requestId); - - [DllImport(Libraries.DataControl, EntryPoint = "data_control_map_set")] - internal static extern ResultType MapSet(SafeDataControlHandle provider, string key, string oldValue, string newValue, out int requestId); - - [DllImport(Libraries.DataControl, EntryPoint = "data_control_map_remove")] - internal static extern ResultType MapRemove(SafeDataControlHandle provider, string key, string value, out int requestId); - - [DllImport(Libraries.DataControl, EntryPoint = "data_control_map_get_with_page")] - internal static extern ResultType MapGet(SafeDataControlHandle provider, string key, out int requestId, int pageNumber, - int countPerPage); - [DllImport(Libraries.DataControl, EntryPoint = "data_control_map_add_bulk_data")] - internal static extern ResultType BulkAdd(SafeDataControlHandle provider, SafeBulkDataHandle insertData, out int requestID); - - [DllImport(Libraries.DataControl, EntryPoint = "data_control_provider_create_insert_statement")] - internal static extern string CreateInsertStatement(SafeDataControlHandle provider, SafeBundleHandle insertData); - - [DllImport(Libraries.DataControl, EntryPoint = "data_control_provider_create_delete_statement")] - internal static extern string CreateDeleteStatement(SafeDataControlHandle provider, string where); - - [DllImport(Libraries.DataControl, EntryPoint = "data_control_provider_create_update_statement")] - internal static extern string CreateUpdateStatement(SafeDataControlHandle provider, SafeBundleHandle updateData, string where); - - [DllImport(Libraries.DataControl, EntryPoint = "datacontrol_provider_get_select_page_info")] - internal static extern ResultType GetSelectPageInfo(int requestId, out int pageNum, out int countPerPage); - - [DllImport(Libraries.DataControl, EntryPoint = "datacontrol_provider_write_socket")] - internal static extern unsafe ResultType WriteSelectResult(int socketFd, byte* buffer, uint nbytes, out uint bytesWrite); - - [DllImport(Libraries.DataControl, EntryPoint = "data_control_provider_send_data_change_noti")] - internal static extern ResultType SendDataChange(IntPtr handle, ChangeType type, SafeBundleHandle data); - - [DllImport(Libraries.DataControl, EntryPoint = "data_control_sql_step_next")] - internal static extern ResultType Next(SafeCursorHandle cursor); - - [DllImport(Libraries.DataControl, EntryPoint = "data_control_sql_step_last")] - internal static extern ResultType Last(SafeCursorHandle cursor); - - [DllImport(Libraries.DataControl, EntryPoint = "data_control_sql_step_first")] - internal static extern ResultType First(SafeCursorHandle cursor); - - [DllImport(Libraries.DataControl, EntryPoint = "data_control_sql_step_previous")] - internal static extern ResultType Prev(SafeCursorHandle cursor); - - [DllImport(Libraries.DataControl, EntryPoint = "data_control_sql_get_column_count")] - internal static extern int GetColumnCount(SafeCursorHandle cursor); - - [DllImport(Libraries.DataControl, EntryPoint = "data_control_sql_get_column_name")] - internal static extern ResultType GetColumnName(SafeCursorHandle cursor, int idx, StringBuilder name); - - [DllImport(Libraries.DataControl, EntryPoint = "data_control_sql_get_column_item_size")] - internal static extern int GetItemSize(SafeCursorHandle cursor, int idx); - - [DllImport(Libraries.DataControl, EntryPoint = "data_control_sql_get_column_item_type")] - internal static extern ResultType GetItemType(SafeCursorHandle cursor, int idx, out int type); - - [DllImport(Libraries.DataControl, EntryPoint = "data_control_sql_get_blob_data")] - internal static extern ResultType GetBlob(SafeCursorHandle cursor, int idx, byte[] buffer, int size); - - [DllImport(Libraries.DataControl, EntryPoint = "data_control_sql_get_int_data")] - internal static extern ResultType GetInt(SafeCursorHandle cursor, int idx, out int data); - - [DllImport(Libraries.DataControl, EntryPoint = "data_control_sql_get_int64_data")] - internal static extern ResultType GetInt64(SafeCursorHandle cursor, int idx, out long data); - - [DllImport(Libraries.DataControl, EntryPoint = "data_control_sql_get_double_data")] - internal static extern ResultType Getdouble(SafeCursorHandle cursor, int idx, out double data); - - [DllImport(Libraries.DataControl, EntryPoint = "data_control_sql_get_text_data")] - internal static extern unsafe ResultType GetText(SafeCursorHandle cursor, int idx, byte[] data); - - [DllImport(Libraries.DataControl, EntryPoint = "data_control_bulk_data_create")] - internal static extern ResultType BulkCreate(out SafeBulkDataHandle handle); - - [DllImport(Libraries.DataControl, EntryPoint = "data_control_bulk_data_add")] - internal static extern ResultType BulkAdd(SafeBulkDataHandle handle, SafeBundleHandle data); - - [DllImport(Libraries.DataControl, EntryPoint = "data_control_bulk_data_get_count")] - internal static extern ResultType BulkGetCount(SafeBulkDataHandle handle, out int count); - - [DllImport(Libraries.DataControl, EntryPoint = "data_control_bulk_data_destroy")] - internal static extern ResultType BulkFree(IntPtr handle); - - [DllImport(Libraries.DataControl, EntryPoint = "data_control_bulk_data_get_data")] - internal static extern ResultType BulkGetData(SafeBulkDataHandle handle, int idx, out IntPtr data); - - [DllImport(Libraries.DataControl, EntryPoint = "data_control_bulk_result_data_create")] - internal static extern ResultType BulkResultCreate(out SafeBulkResultDataHandle handle); - - [DllImport(Libraries.DataControl, EntryPoint = "data_control_bulk_result_data_add")] - internal static extern ResultType BulkResultAdd(SafeBulkResultDataHandle handle, SafeBundleHandle data, int result); - - [DllImport(Libraries.DataControl, EntryPoint = "data_control_bulk_result_data_get_count")] - internal static extern ResultType BulkResultGetCount(SafeBulkResultDataHandle handle, out int count); - - [DllImport(Libraries.DataControl, EntryPoint = "data_control_bulk_result_data_get_result_data")] - internal static extern ResultType BulkResultGetData(SafeBulkResultDataHandle handle, int idx, out IntPtr data, out int result); - - [DllImport(Libraries.DataControl, EntryPoint = "data_control_bulk_result_data_get_result_data")] - internal static extern ResultType BulkResultGetResult(SafeBulkResultDataHandle handle, int idx, out IntPtr data, out int result); - - [DllImport(Libraries.DataControl, EntryPoint = "data_control_bulk_result_data_destroy")] - internal static extern ResultType BulkResultFree(IntPtr handle); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void AddCallbackResultCallback(IntPtr handle, ResultType type, int callbackID, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void DataChangeCallback(IntPtr handle, ChangeType type, IntPtr data, IntPtr userData); - - [DllImport(Libraries.DataControl, EntryPoint = "data_control_add_data_change_cb", CallingConvention = CallingConvention.Cdecl)] - internal static extern ResultType AddDataChangeCallback(SafeDataControlHandle provider, DataChangeCallback callback, - IntPtr userData, AddCallbackResultCallback resultCallback, IntPtr resultCbUserData, out int callbackID); - - [DllImport(Libraries.DataControl, EntryPoint = "data_control_remove_data_change_cb", CallingConvention = CallingConvention.Cdecl)] - internal static extern ResultType RemoveDataChangeCallback(SafeDataControlHandle provider, int callbackID); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool DataChangeConsumerFilterCb(IntPtr handle, string consumerAppid, IntPtr userData); - - [DllImport(Libraries.DataControl, EntryPoint = "data_control_provider_add_data_change_consumer_filter_cb", CallingConvention = CallingConvention.Cdecl)] - internal static extern ResultType AddDataChangeConsumerFilterCallback(DataChangeConsumerFilterCb callback, - IntPtr userData, - out int callbackID); - - [DllImport(Libraries.DataControl, EntryPoint = "data_control_provider_remove_data_change_consumer_filter_cb")] - internal static extern int RemoveDataChangeConsumerFilterCallback(int callbackID); - - [DllImport(Libraries.DataControl, EntryPoint = "data_control_provider_send_bulk_insert_result")] - internal static extern ResultType SendBulkInsertResult(int requestId, SafeBulkResultDataHandle result); - - [DllImport(Libraries.DataControl, EntryPoint = "data_control_provider_send_map_bulk_add_result")] - internal static extern ResultType SendMapBulkAddResult(int requestId, SafeBulkResultDataHandle result); - - internal static class UnsafeCode - { - internal static unsafe ResultType WriteResult(int socketFd, byte[] value, int nbytes, out uint bytesWrite) - { - fixed (byte* pointer = value) - { - return WriteSelectResult(socketFd, pointer, (uint)nbytes, out bytesWrite); - } - } - } - - } -} diff --git a/src/Tizen.Applications.DataControl/Interop/Interop.Libraries.cs b/src/Tizen.Applications.DataControl/Interop/Interop.Libraries.cs deleted file mode 100755 index 1658ec6cb..000000000 --- a/src/Tizen.Applications.DataControl/Interop/Interop.Libraries.cs +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2017 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 DataControl = "libdata-control.so.0"; - } -} diff --git a/src/Tizen.Applications.DataControl/Tizen.Applications.DataControl.Core/CloneCursorCore.cs b/src/Tizen.Applications.DataControl/Tizen.Applications.DataControl.Core/CloneCursorCore.cs deleted file mode 100755 index 1e066ee0e..000000000 --- a/src/Tizen.Applications.DataControl/Tizen.Applications.DataControl.Core/CloneCursorCore.cs +++ /dev/null @@ -1,259 +0,0 @@ -/* - * Copyright (c) 2017 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.IO; -using System.Text; -using System.Collections.Generic; -using System.Threading; - -namespace Tizen.Applications.DataControl.Core -{ - internal class CloneCursorCore : ICursor - { - internal const int MaxColumnNameSize = 1024; - private const string LogTag = "Tizen.Applications.DataControl"; - private long _rowCount; - private int _columnCount; - private const int ResultNoData = -1; - private Interop.DataControl.SafeCursorHandle _cursor; - internal CloneCursorCore(Interop.DataControl.SafeCursorHandle cursor) - { - _cursor = cursor; - _columnCount = Interop.DataControl.GetColumnCount(cursor); - - if (_columnCount == ResultNoData) - { - _rowCount = 0; - return; - } - - Interop.DataControl.First(cursor); - - do - { - _rowCount++; - } - while (Interop.DataControl.Next(cursor) == (int)ResultType.Success); - Interop.DataControl.First(cursor); - } - - public int GetColumnCount() - { - return Interop.DataControl.GetColumnCount(_cursor); - } - - public ColumnType GetColumnType(int index) - { - int type; - ResultType ret; - - if (index < 0 || index >= _columnCount) - { - ErrorFactory.ThrowException(ResultType.InvalidParameter, false); - } - - ret = Interop.DataControl.GetItemType(_cursor, index, out type); - if (ret != ResultType.Success) - { - ErrorFactory.ThrowException(ret, false, "Column Index " + index.ToString()); - } - - return (ColumnType)type; - } - - public string GetColumnName(int index) - { - string retStr; - ResultType ret; - StringBuilder columnName = new StringBuilder(); - - if (index < 0 || index >= _columnCount) - { - ErrorFactory.ThrowException(ResultType.InvalidParameter, false); - } - - columnName.Length = MaxColumnNameSize; - ret = Interop.DataControl.GetColumnName(_cursor, index, columnName); - if (ret != ResultType.Success) - { - ErrorFactory.ThrowException(ret, false, "Column Index " + index.ToString()); - } - - retStr = columnName.ToString(); - columnName.Clear(); - columnName = null; - - return retStr; - } - - public long GetRowCount() - { - return _rowCount; - } - - public bool Next() - { - ResultType type = Interop.DataControl.Next(_cursor); - - if (type != ResultType.Success) - { - return false; - } - - return true; - } - - public bool Prev() - { - ResultType type = Interop.DataControl.Prev(_cursor); - - if (type != ResultType.Success) - { - return false; - } - - return true; - } - - public bool Reset() - { - ResultType type = Interop.DataControl.First(_cursor); - - if (type != ResultType.Success) - { - return false; - } - - return true; - } - - public int GetIntValue(int index) - { - ResultType ret; - int value; - - if (index < 0 || index >= _columnCount) - { - ErrorFactory.ThrowException(ResultType.InvalidParameter, false); - } - - ret = Interop.DataControl.GetInt(_cursor, index, out value); - if (ret != ResultType.Success) - { - ErrorFactory.ThrowException(ret, false, "Column Index " + index.ToString()); - } - - return value; - } - - public Int64 GetInt64Value(int index) - { - ResultType ret; - Int64 value; - - if (index < 0 || index >= _columnCount) - { - ErrorFactory.ThrowException(ResultType.InvalidParameter, false); - } - - ret = Interop.DataControl.GetInt64(_cursor, index, out value); - if (ret != ResultType.Success) - { - ErrorFactory.ThrowException(ret, false, "Column Index " + index.ToString()); - } - - return value; - } - - public double GetDoubleValue(int index) - { - ResultType ret; - double value; - - if (index < 0 || index >= _columnCount) - { - ErrorFactory.ThrowException(ResultType.InvalidParameter, false); - } - - ret = Interop.DataControl.Getdouble(_cursor, index, out value); - if (ret != ResultType.Success) - { - ErrorFactory.ThrowException(ret, false, "Column Index " + index.ToString()); - } - - return value; - } - - public string GetStringValue(int index) - { - ResultType ret; - int size; - byte[] value; - string text; - - if (index < 0 || index >= _columnCount) - { - ErrorFactory.ThrowException(ResultType.InvalidParameter, false); - } - - size = Interop.DataControl.GetItemSize(_cursor, index); - if (size < 0) - { - ErrorFactory.ThrowException(ResultType.IoError, false, "Invalid size"); - } - - value = new byte[size + 1]; - ret = Interop.DataControl.GetText(_cursor, index, value); - if (ret != ResultType.Success) - { - ErrorFactory.ThrowException(ret, false); - } - - text = Encoding.UTF8.GetString(value); - - return text; - } - - public byte[] GetBlobValue(int index) - { - ResultType ret; - int size; - byte[] byte_array; - - if (index < 0 || index >= _columnCount) - { - ErrorFactory.ThrowException(ResultType.InvalidParameter, false); - } - - size = Interop.DataControl.GetItemSize(_cursor, index); - if (size < 0) - { - ErrorFactory.ThrowException(ResultType.IoError, false, "Invalid size"); - } - - byte_array = new byte[size]; - ret = Interop.DataControl.GetBlob(_cursor, index, byte_array, size); - if (ret != ResultType.Success) - { - ErrorFactory.ThrowException(ret, false); - } - - return byte_array; - } - } -} \ No newline at end of file diff --git a/src/Tizen.Applications.DataControl/Tizen.Applications.DataControl.csproj b/src/Tizen.Applications.DataControl/Tizen.Applications.DataControl.csproj deleted file mode 100644 index 020b2cb3d..000000000 --- a/src/Tizen.Applications.DataControl/Tizen.Applications.DataControl.csproj +++ /dev/null @@ -1,11 +0,0 @@ - - - - netstandard2.0 - - - - - - - diff --git a/src/Tizen.Applications.DataControl/Tizen.Applications.DataControl.sln b/src/Tizen.Applications.DataControl/Tizen.Applications.DataControl.sln deleted file mode 100755 index 03947af3d..000000000 --- a/src/Tizen.Applications.DataControl/Tizen.Applications.DataControl.sln +++ /dev/null @@ -1,40 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26430.12 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Applications.DataControl", "Tizen.Applications.DataControl.csproj", "{12BD57BA-0C9C-4861-A2CF-F759AFB63C9B}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen", "..\Tizen\Tizen.csproj", "{787BCB6D-5159-4927-B87B-6C4C6CB27BB9}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Applications.Common", "..\Tizen.Applications.Common\Tizen.Applications.Common.csproj", "{EDCB4562-3D7A-422A-9D31-2D04F17F9B5C}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Log", "..\Tizen.Log\Tizen.Log.csproj", "{40D22D0C-CB4D-4EF7-B1A0-B350BC5A536F}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {12BD57BA-0C9C-4861-A2CF-F759AFB63C9B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {12BD57BA-0C9C-4861-A2CF-F759AFB63C9B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {12BD57BA-0C9C-4861-A2CF-F759AFB63C9B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {12BD57BA-0C9C-4861-A2CF-F759AFB63C9B}.Release|Any CPU.Build.0 = Release|Any CPU - {787BCB6D-5159-4927-B87B-6C4C6CB27BB9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {787BCB6D-5159-4927-B87B-6C4C6CB27BB9}.Debug|Any CPU.Build.0 = Debug|Any CPU - {787BCB6D-5159-4927-B87B-6C4C6CB27BB9}.Release|Any CPU.ActiveCfg = Release|Any CPU - {787BCB6D-5159-4927-B87B-6C4C6CB27BB9}.Release|Any CPU.Build.0 = Release|Any CPU - {EDCB4562-3D7A-422A-9D31-2D04F17F9B5C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {EDCB4562-3D7A-422A-9D31-2D04F17F9B5C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {EDCB4562-3D7A-422A-9D31-2D04F17F9B5C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {EDCB4562-3D7A-422A-9D31-2D04F17F9B5C}.Release|Any CPU.Build.0 = Release|Any CPU - {40D22D0C-CB4D-4EF7-B1A0-B350BC5A536F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {40D22D0C-CB4D-4EF7-B1A0-B350BC5A536F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {40D22D0C-CB4D-4EF7-B1A0-B350BC5A536F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {40D22D0C-CB4D-4EF7-B1A0-B350BC5A536F}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/src/Tizen.Applications.DataControl/Tizen.Applications.DataControl/BulkData.cs b/src/Tizen.Applications.DataControl/Tizen.Applications.DataControl/BulkData.cs deleted file mode 100755 index 74dd11ff9..000000000 --- a/src/Tizen.Applications.DataControl/Tizen.Applications.DataControl/BulkData.cs +++ /dev/null @@ -1,361 +0,0 @@ -/* - * Copyright (c) 2017 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.Collections.Generic; - -namespace Tizen.Applications.DataControl -{ - /// - /// Represents the BulkData class for the DataControl bulk request. - /// - public class BulkData : IDisposable - { - private bool _disposed = false; - private Interop.DataControl.SafeBulkDataHandle _handle; - - /// - /// Initializes the BulkData class. - /// - /// Thrown in case of any internal error. - public BulkData() - { - ResultType ret; - - ret = Interop.DataControl.BulkCreate(out _handle); - if (ret != ResultType.Success) - { - ErrorFactory.ThrowException(ret, true, "BulkCreate"); - } - - } - - internal BulkData(Interop.DataControl.SafeBulkDataHandle handle) - { - ResultType ret; - int count, i; - - ret = Interop.DataControl.BulkCreate(out _handle); - if (ret != ResultType.Success) - { - ErrorFactory.ThrowException(ret, true, "BulkCreate"); - } - - ret = Interop.DataControl.BulkGetCount(handle, out count); - for ( i = 0; i < count; i++) - { - IntPtr bundleHandle; - Bundle bundle; - - ret = Interop.DataControl.BulkGetData(handle, i, out bundleHandle); - if (ret != ResultType.Success) - { - ErrorFactory.ThrowException(ret, true, "BulkGetData"); - } - - bundle = new Bundle(new SafeBundleHandle(bundleHandle, false)); - ret = Interop.DataControl.BulkAdd(_handle, bundle.SafeBundleHandle); - if (ret != ResultType.Success) - { - ErrorFactory.ThrowException(ret, true, "BulkAdd"); - } - } - } - - internal Interop.DataControl.SafeBulkDataHandle SafeBulkDataHandle - { - get { return _handle; } - } - - /// - /// Adds the bulk data. - /// - /// Bulk data - /// Thrown in case of an invalid parameter. - public void Add(Bundle data) - { - ResultType ret; - - if (data == null || data.SafeBundleHandle.IsInvalid) - { - ErrorFactory.ThrowException(ResultType.InvalidParameter, false, "data"); - } - - ret = Interop.DataControl.BulkAdd(_handle, data.SafeBundleHandle); - if (ret != ResultType.Success) - { - ErrorFactory.ThrowException(ret, true, "BulkAdd"); - } - } - - /// - /// Gets the current data count. - /// - public int GetCount() - { - int count; - ResultType ret; - - ret = Interop.DataControl.BulkGetCount(_handle, out count); - if (ret != ResultType.Success) - { - ErrorFactory.ThrowException(ret, true, "BulkGetCount"); - } - - return count; - } - - /// - /// Returns the data at the given zero-based data index. - /// - /// The target data index. - /// Thrown in case of an invalid parameter. - public Bundle GetData(int index) - { - IntPtr bundlePtr; - Bundle bundle; - ResultType ret; - - if (index < 0) - { - ErrorFactory.ThrowException(ResultType.InvalidParameter, false, "index"); - } - - ret = Interop.DataControl.BulkGetData(_handle, index, out bundlePtr); - if (ret != ResultType.Success) - { - ErrorFactory.ThrowException(ret, true, "BulkGetData"); - } - - bundle = new Bundle(new SafeBundleHandle(bundlePtr, false)); - return bundle; - } - - /// - /// Releases all the resources used by the BulkData class. - /// - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - - /// - /// Releases any unmanaged resources used by this object. Can also dispose any other disposable objects. - /// - /// If true, disposes any disposable objects. If false, does not dispose disposable objects. - protected virtual void Dispose(bool disposing) - { - if (!_disposed) - { - if (_handle != null && !_handle.IsInvalid) - { - _handle.Dispose(); - } - - _disposed = true; - } - } - - ~BulkData() - { - Dispose(false); - } - } - - /// - /// Represents the BulkResultData class for the DataControl bulk request. - /// - public class BulkResultData : IDisposable - { - private const string LogTag = "Tizen.Applications.DataControl"; - private bool _disposed = false; - private Interop.DataControl.SafeBulkResultDataHandle _handle; - /// - /// Initializes the BulkResultData class. - /// - /// Thrown in case of any internal error. - public BulkResultData() - { - ResultType ret; - - ret = Interop.DataControl.BulkResultCreate(out _handle); - if (ret != ResultType.Success) - { - ErrorFactory.ThrowException(ret, true,"BulkResultCreate"); - } - } - - internal BulkResultData(Interop.DataControl.SafeBulkResultDataHandle handle) - { - ResultType ret; - - ret = Interop.DataControl.BulkResultCreate(out _handle); - if (ret != ResultType.Success) - { - ErrorFactory.ThrowException(ret, true,"BulkResultCreate"); - } - - int count; - ret = Interop.DataControl.BulkResultGetCount(handle, out count); - for (int i = 0; i < count; i++) - { - IntPtr bundleHandle; - Bundle bundle; - int result; - - ret = Interop.DataControl.BulkResultGetData(handle, i, out bundleHandle, out result); - if (ret != ResultType.Success) - { - ErrorFactory.ThrowException(ret, true, "BulkResultGetData"); - } - - bundle = new Bundle(new SafeBundleHandle(bundleHandle, false)); - ret = Interop.DataControl.BulkResultAdd(_handle, bundle.SafeBundleHandle, result); - if (ret != ResultType.Success) - { - ErrorFactory.ThrowException(ret, true, "BulkResultAdd"); - } - } - } - - /// - /// Adds the bulk operation result data. - /// - /// The result data. - /// Result. - /// Thrown in case of an invalid parameter. - public void Add(Bundle data, int result) - { - ResultType ret; - - if (data == null || data.SafeBundleHandle.IsInvalid) - { - ErrorFactory.ThrowException(ResultType.InvalidParameter, false, "data"); - } - - ret = Interop.DataControl.BulkResultAdd(_handle, data.SafeBundleHandle, result); - if (ret != ResultType.Success) - { - ErrorFactory.ThrowException(ret, true, "BulkResultAdd"); - } - } - - internal Interop.DataControl.SafeBulkResultDataHandle SafeBulkDataHandle - { - get { return _handle; } - } - - /// - /// Gets the current result data count. - /// - public int GetCount() - { - int count; - ResultType ret; - - ret = Interop.DataControl.BulkResultGetCount(_handle, out count); - if (ret != ResultType.Success) - { - ErrorFactory.ThrowException(ret, true,"BulkResultGetCount"); - } - - return count; - } - - /// - /// Returns the result data at the given zero-based data index. - /// - /// The target result data index. - /// Thrown in case of an invalid parameter. - public Bundle GetData(int index) - { - IntPtr bundlePtr; - Bundle bundle; - ResultType ret; - int result; - - if (index < 0) - { - ErrorFactory.ThrowException(ResultType.InvalidParameter, false, "index"); - } - - ret = Interop.DataControl.BulkResultGetData(_handle, index, out bundlePtr, out result); - if (ret != ResultType.Success) - { - ErrorFactory.ThrowException(ret, true, "BulkResultGetData"); - } - - bundle = new Bundle(new SafeBundleHandle(bundlePtr, false)); - return bundle; - } - - /// - /// Returns the result at the given zero-based data index. - /// - /// The target result index. - /// Thrown in case of an invalid parameter. - public int GetResult(int index) - { - IntPtr bundlePtr; - ResultType ret; - int result; - - if (index < 0) - { - ErrorFactory.ThrowException(ResultType.InvalidParameter, false, "index"); - } - - ret = Interop.DataControl.BulkResultGetData(_handle, index, out bundlePtr, out result); - if (ret != ResultType.Success) - { - ErrorFactory.ThrowException(ret, true, "BulkResultGetData"); - } - - return result; - } - - /// - /// Releases all the resources used by the BulkResultData class. - /// - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - - /// - /// Releases any unmanaged resources used by this object. Can also dispose any other disposable objects. - /// - /// If true, disposes any disposable objects. If false, does not dispose disposable objects. - protected virtual void Dispose(bool disposing) - { - if (!_disposed) - { - if (_handle != null && !_handle.IsInvalid) - { - _handle.Dispose(); - } - - _disposed = true; - } - } - - ~BulkResultData() - { - Dispose(false); - } - } -} diff --git a/src/Tizen.Applications.DataControl/Tizen.Applications.DataControl/Consumer.cs b/src/Tizen.Applications.DataControl/Tizen.Applications.DataControl/Consumer.cs deleted file mode 100755 index 7811d1533..000000000 --- a/src/Tizen.Applications.DataControl/Tizen.Applications.DataControl/Consumer.cs +++ /dev/null @@ -1,973 +0,0 @@ -/* - * Copyright (c) 2017 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.Collections.Generic; -using Tizen.Applications.DataControl.Core; -using System.Threading; - -namespace Tizen.Applications.DataControl -{ - /// - /// Represents the Consumer class for the DataControl consumer application. - /// - public abstract class Consumer : IDisposable - { - - private Interop.DataControl.SafeDataControlHandle _handle; - private string _dataID, _providerID; - private int _changeCallbackID = 0; - private const string LogTag = "Tizen.Applications.DataControl"; - private bool _disposed = false; - private static Mutex _lock = new Mutex(); - private Interop.DataControl.DataChangeCallback _dataChangeCallback; - private Interop.DataControl.AddCallbackResultCallback _addCallbackResultCallback; - - private static class CallbackManager - { - private static IDictionary _mapResponseCallbacks = new Dictionary(); - private static IDictionary _mapBulkResponseCallback = new Dictionary(); - private static IDictionary _sqlResponseCallbacks = new Dictionary(); - private static IDictionary _sqlBulkResponseCallback = new Dictionary(); - private static IDictionary _reqConsumerDictionary = new Dictionary(); - private static IDictionary _reqProviderList = new Dictionary(); - private static void InsertResponse(int reqId, IntPtr provider, long insertedRowId, bool providerResult, string error, IntPtr userData) - { - Log.Debug(LogTag, $"InsertResponse {reqId.ToString()}"); - if (!_reqConsumerDictionary.ContainsKey(reqId)) - { - Log.Error(LogTag, $"Invalid reqId {reqId.ToString()}"); - return; - } - - if (!providerResult) - { - Log.Error(LogTag, $"reqId {reqId.ToString()}, error : {error}, rowID : {insertedRowId.ToString()}"); - } - - Consumer consumer = _reqConsumerDictionary[reqId]; - consumer.OnInsertResult(new InsertResult(insertedRowId, providerResult)); - _reqConsumerDictionary.Remove(reqId); - } - - private static void BulkInsertResponse(int reqId, IntPtr provider, IntPtr bulkResults, bool providerResult, string error, IntPtr userData) - { - BulkResultData brd; - Log.Debug(LogTag, $"BulkInsertResponse {reqId.ToString()}"); - if (!_reqConsumerDictionary.ContainsKey(reqId)) - { - Log.Error(LogTag, $"Invalid reqId {reqId.ToString()}"); - return; - } - - if (!providerResult) - { - Log.Error(LogTag, $"reqId {reqId.ToString()}, error : {error}"); - } - - if (bulkResults != IntPtr.Zero) - { - brd = new BulkResultData(new Interop.DataControl.SafeBulkResultDataHandle(bulkResults, false)); - } - else - { - brd = new BulkResultData(); - Log.Error(LogTag, $"reqId {reqId.ToString()}, bulkResults is null"); - } - - Consumer consumer = _reqConsumerDictionary[reqId]; - consumer.OnBulkInsertResult(new BulkInsertResult(brd, providerResult)); - _reqConsumerDictionary.Remove(reqId); - } - - private static void SelectResponse(int reqId, IntPtr provider, IntPtr cursor, bool providerResult, string error, IntPtr userData) - { - MatrixCursor dmc; - Log.Debug(LogTag, $"SelectResponse {reqId.ToString()}"); - if (!_reqConsumerDictionary.ContainsKey(reqId)) - { - Log.Error(LogTag, $"Invalid reqId {reqId.ToString()}"); - return; - } - - if (!providerResult) - { - Log.Error(LogTag, $"reqId {reqId.ToString()}, error : {error}"); - } - - if (cursor != IntPtr.Zero) - { - try - { - dmc = CloneCursor(new CloneCursorCore(new Interop.DataControl.SafeCursorHandle(cursor, true))); - } - catch (Exception ex) - { - dmc = new MatrixCursor(); - Log.Error(LogTag, $"reqId {reqId.ToString()}, {ex.ToString()}"); - } - } - else - { - dmc = new MatrixCursor(); - Log.Error(LogTag, $"reqId {reqId.ToString()}, cursor is null"); - } - Consumer consumer = _reqConsumerDictionary[reqId]; - consumer.OnSelectResult(new SelectResult(dmc, providerResult)); - _reqConsumerDictionary.Remove(reqId); - } - - private static void UpdateResponse(int reqId, IntPtr provider, bool providerResult, string error, IntPtr userData) - { - if (!_reqConsumerDictionary.ContainsKey(reqId)) - { - Log.Error(LogTag, $"Invalid reqId {reqId.ToString()}"); - return; - } - - if (!providerResult) - { - Log.Error(LogTag, $"reqId {reqId.ToString()}, error : {error}"); - } - - Consumer consumer = _reqConsumerDictionary[reqId]; - consumer.OnUpdateResult(new UpdateResult(providerResult)); - _reqConsumerDictionary.Remove(reqId); - } - - private static void DeleteResponse(int reqId, IntPtr provider, bool providerResult, string error, IntPtr userData) - { - if (!_reqConsumerDictionary.ContainsKey(reqId)) - { - Log.Error(LogTag, $"Invalid reqId {reqId.ToString()}"); - return; - } - - if (!providerResult) - { - Log.Error(LogTag, $"reqId {reqId.ToString()}, error : {error}"); - } - - Consumer consumer = _reqConsumerDictionary[reqId]; - consumer.OnDeleteResult(new DeleteResult(providerResult)); - _reqConsumerDictionary.Remove(reqId); - } - - private static void MapGetResponse(int reqId, IntPtr provider, string[] valueList, int valueCount, bool providerResult, string error, IntPtr userData) - { - MapGetResult mgr; - Log.Debug(LogTag, $"MapGetResponse {reqId.ToString()}"); - if (!_reqConsumerDictionary.ContainsKey(reqId)) - { - Log.Error(LogTag, $"Invalid reqId {reqId.ToString()}"); - return; - } - - if (!providerResult) - { - Log.Error(LogTag, $"reqId {reqId.ToString()}, error : {error}"); - } - - if (valueList !=null) - { - mgr = new MapGetResult(valueList, providerResult); - } - else - { - mgr = new MapGetResult(new string[0], providerResult); - Log.Error(LogTag, $"reqId {reqId.ToString()}, valueList is null"); - } - - Consumer consumer = _reqConsumerDictionary[reqId]; - consumer.OnMapGetResult(mgr); - _reqConsumerDictionary.Remove(reqId); - } - - private static void MapBulkAddResponse(int reqId, IntPtr provider, IntPtr bulkResults, bool providerResult, string error, IntPtr userData) - { - BulkResultData brd; - Log.Debug(LogTag, $"MapBulkAddResponse {reqId.ToString()}"); - if (!_reqConsumerDictionary.ContainsKey(reqId)) - { - Log.Error(LogTag, $"Invalid reqId {reqId.ToString()}"); - return; - } - - if (!providerResult) - { - Log.Error(LogTag, $"reqId {reqId.ToString()}, error : {error}"); - } - - if (bulkResults != IntPtr.Zero) - { - brd = new BulkResultData(new Interop.DataControl.SafeBulkResultDataHandle(bulkResults, false)); - } - else - { - brd = new BulkResultData(); - Log.Error(LogTag, $"reqId {reqId.ToString()}, bulkResults is null"); - } - - Consumer consumer = _reqConsumerDictionary[reqId]; - consumer.OnMapBulkAddResult(new MapBulkAddResult(brd, providerResult)); - _reqConsumerDictionary.Remove(reqId); - } - - private static void MapAddResponse(int reqId, IntPtr provider, bool providerResult, string error, IntPtr userData) - { - Log.Debug(LogTag, $"MapAddResponse {reqId.ToString()}"); - if (!_reqConsumerDictionary.ContainsKey(reqId)) - { - Log.Error(LogTag, $"Invalid reqId {reqId.ToString()}"); - return; - } - - if (!providerResult) - { - Log.Error(LogTag, $"reqId {reqId.ToString()}, error : {error}"); - } - - Consumer consumer = _reqConsumerDictionary[reqId]; - consumer.OnMapAddResult(new MapAddResult(providerResult)); - _reqConsumerDictionary.Remove(reqId); - } - - private static void MapSetResponse(int reqId, IntPtr provider, bool providerResult, string error, IntPtr userData) - { - Log.Debug(LogTag, $"MapSetResponse {reqId.ToString()}"); - if (!_reqConsumerDictionary.ContainsKey(reqId)) - { - Log.Error(LogTag, $"Invalid reqId {reqId.ToString()}"); - return; - } - - if (!providerResult) - { - Log.Error(LogTag, $"reqId {reqId.ToString()}, error : {error}"); - } - - Consumer consumer = _reqConsumerDictionary[reqId]; - consumer.OnMapSetResult(new MapSetResult(providerResult)); - _reqConsumerDictionary.Remove(reqId); - } - - private static void MapRemoveResponse(int reqId, IntPtr provider, bool providerResult, string error, IntPtr userData) - { - if (!_reqConsumerDictionary.ContainsKey(reqId)) - { - Log.Error(LogTag, $"Invalid reqId {reqId.ToString()}"); - return; - } - - if (!providerResult) - { - Log.Error(LogTag, $"reqId {reqId.ToString()}, error : {error}"); - } - - Consumer consumer = _reqConsumerDictionary[reqId]; - consumer.OnMapRemoveResult(new MapRemoveResult(providerResult)); - _reqConsumerDictionary.Remove(reqId); - } - - private static MatrixCursor CloneCursor(CloneCursorCore coreCursor) - { - int size = coreCursor.GetColumnCount(); - int i; - string[] name = new string[size]; - object[] newRow = new object[size]; - ColumnType[] type = new ColumnType[size]; - - for (i = 0; i < size; i++) - { - name[i] = coreCursor.GetColumnName(i); - type[i] = coreCursor.GetColumnType(i); - } - - MatrixCursor dmc = new MatrixCursor(name, type); - - if (coreCursor.GetRowCount() <= 0) - { - return dmc; - } - - coreCursor.Reset(); - do - { - for (i = 0; i < size; i++) - { - switch (type[i]) - { - case ColumnType.ColumnTypeInt: - newRow[i] = coreCursor.GetInt64Value(i); - break; - case ColumnType.ColumnTypeDouble: - newRow[i] = coreCursor.GetDoubleValue(i); - break; - case ColumnType.ColumnTypeBlob: - newRow[i] = coreCursor.GetBlobValue(i); - break; - case ColumnType.ColumnTypeString: - newRow[i] = coreCursor.GetStringValue(i); - break; - } - } - - dmc.AddRow(newRow); - } - while (coreCursor.Next()); - - return dmc; - } - - internal static void RegisterReqId(int reqId, Consumer consumer) - { - _lock.WaitOne(); - _reqConsumerDictionary.Add(reqId, consumer); - _lock.ReleaseMutex(); - } - - internal static void RegisterCallback(Interop.DataControl.SafeDataControlHandle handle, string providerId) - { - ResultType ret; - Interop.DataControl.SqlResponseCallbacks sqlCallbacks; - Interop.DataControl.SqlBulkInsertResponseCallback sqlBulkCallbacks; - Interop.DataControl.MapResponseCallbacks mapCallbacks; - Interop.DataControl.MapBulkAddResponseCallback mapBulkCallbacks; - bool sqlRegistered = false; - bool mapRegistered = false; - - if (_reqProviderList.ContainsKey(providerId)) - { - _reqProviderList[providerId]++; - Log.Error(LogTag, "The data control is already set"); - return; - } - - sqlCallbacks.Insert = new Interop.DataControl.SqlInsertResponseCallback(InsertResponse); - sqlCallbacks.Select = new Interop.DataControl.SqlSelectResponseCallback(SelectResponse); - sqlCallbacks.Update = new Interop.DataControl.SqlUpdateResponseCallback(UpdateResponse); - sqlCallbacks.Delete = new Interop.DataControl.SqlDeleteResponseCallback(DeleteResponse); - ret = Interop.DataControl.RegisterSqlResponseCallback(handle, ref sqlCallbacks, IntPtr.Zero); - if (ret != ResultType.Success) - { - Log.Error(LogTag, "Registering the sql callback function is failed : " + ret); - } - else - { - _sqlResponseCallbacks.Add(providerId, sqlCallbacks); - sqlRegistered = true; - } - - sqlBulkCallbacks = new Interop.DataControl.SqlBulkInsertResponseCallback(BulkInsertResponse); - ret = Interop.DataControl.RegisterSqlBulkResponseCallback(handle, sqlBulkCallbacks, IntPtr.Zero); - if (ret != ResultType.Success) - { - Log.Error(LogTag, "Registering the sql bulk callback function is failed : " + ret); - } - else - { - _sqlBulkResponseCallback.Add(providerId, sqlBulkCallbacks); - } - - mapCallbacks.Add = new Interop.DataControl.MapAddResponseCallback(MapAddResponse); - mapCallbacks.Set = new Interop.DataControl.MapSetResponseCallback(MapSetResponse); - mapCallbacks.Get = new Interop.DataControl.MapGetResponseCallback(MapGetResponse); - mapCallbacks.Remove = new Interop.DataControl.MapRemoveResponseCallback(MapRemoveResponse); - ret = Interop.DataControl.RegisterMapResponse(handle, ref mapCallbacks, IntPtr.Zero); - - if (ret != ResultType.Success) - { - Log.Error(LogTag, "Registering the map callback function is failed : " + ret); - } - else - { - _mapResponseCallbacks.Add(providerId, mapCallbacks); - mapRegistered = true; - } - - mapBulkCallbacks = new Interop.DataControl.MapBulkAddResponseCallback(MapBulkAddResponse); - ret = Interop.DataControl.RegisterMapBulkResponseCallback(handle, mapBulkCallbacks, IntPtr.Zero); - if (ret != ResultType.Success) - { - Log.Error(LogTag, "Registering the map bulk callback function is failed : " + ret); - } - else - { - _mapBulkResponseCallback.Add(providerId, mapBulkCallbacks); - } - - if (!mapRegistered && !sqlRegistered) - { - ErrorFactory.ThrowException(ret, true, "Registering the response callback function is failed"); - } - - _reqProviderList.Add(providerId, 1); - } - - internal static void UnregisterCallback(Interop.DataControl.SafeDataControlHandle handle, string providerId) - { - int count; - - _reqProviderList[providerId]--; - count = _reqProviderList[providerId]; - if (count <= 0) - { - _reqProviderList.Remove(providerId); - - _mapResponseCallbacks.Remove(providerId); - Interop.DataControl.UnregisterMapResponse(handle); - - _mapBulkResponseCallback.Remove(providerId); - Interop.DataControl.UnregisterMapBulkResponseCallback(handle); - - _sqlResponseCallbacks.Remove(providerId); - Interop.DataControl.UnregisterSqlResponseCallback(handle); - - _sqlBulkResponseCallback.Remove(providerId); - Interop.DataControl.UnregisterSqlBulkResponseCallback(handle); - } - - } - } - - /// - /// Sends the insert request to the provider application. - /// - /// The OnInsertResult will recieve the result of this API. - /// The insert data. - /// Thrown in case of an invalid parmaeter. - /// Thrown in case if a permission is denied. - /// Thrown when the message has exceeded the maximum limit (1MB). - /// Thrown in case of any internal error. - /// http://tizen.org/privilege/datasharing - /// http://tizen.org/privilege/appmanager.launch - public void Insert(Bundle insertData) - { - int reqId; - ResultType ret; - - if (insertData == null || insertData.SafeBundleHandle.IsInvalid) - { - ErrorFactory.ThrowException(ResultType.InvalidParameter, false, "insertData"); - } - - _lock.WaitOne(); - ret = Interop.DataControl.Insert(_handle, insertData.SafeBundleHandle, out reqId); - _lock.ReleaseMutex(); - if (ret != ResultType.Success) - { - ErrorFactory.ThrowException(ret, false, "Insert"); - } - - CallbackManager.RegisterReqId(reqId, this); - } - - /// - /// Sends the select request to the provider application. - /// - /// The OnSelectResult will recieve the result of this API. - /// Select the target column list. - /// The Where statement for the select query. - /// The Order statement for the select query. - /// Select the target page number. - /// Select the row count per page. - /// Thrown in case of an invalid parmaeter. - /// Thrown in case if a permission is denied.. - /// Thrown in case of any internal error. - /// http://tizen.org/privilege/datasharing - /// http://tizen.org/privilege/appmanager.launch - public void Select(string[] columnList, string where, string order, int pageNumber = 1, int countPerPage = 20) - { - int reqId, i; - ResultType ret; - if (columnList == null || columnList.Length == 0) - { - ErrorFactory.ThrowException(ResultType.InvalidParameter, false, "column_list"); - } - - for (i = 0; i < columnList.Length; i++) - { - if (string.IsNullOrEmpty(columnList[i])) - { - ErrorFactory.ThrowException(ResultType.InvalidParameter, false, "column_list index " + i.ToString()); - } - } - - _lock.WaitOne(); - ret = Interop.DataControl.Select(_handle, columnList, columnList.Length, where, order, pageNumber, countPerPage, out reqId); - _lock.ReleaseMutex(); - if (ret != ResultType.Success) - { - ErrorFactory.ThrowException(ret, false, "Select"); - } - Log.Info(LogTag, "select end. " + reqId.ToString()); - - CallbackManager.RegisterReqId(reqId, this); - } - - /// - /// Sends the delete request to the provider application. - /// - /// The OnDeleteResult will recieve the result of this API - /// The Where statement for the delete query. - /// Thrown in case if a permission is denied. - /// Thrown in case of any internal error. - /// http://tizen.org/privilege/datasharing - /// http://tizen.org/privilege/appmanager.launch - public void Delete(string where) - { - int reqId; - ResultType ret; - - _lock.WaitOne(); - ret = Interop.DataControl.Delete(_handle, where, out reqId); - _lock.ReleaseMutex(); - if (ret != ResultType.Success) - { - ErrorFactory.ThrowException(ret, false, "Delete"); - } - - CallbackManager.RegisterReqId(reqId, this); - } - - /// - /// Sends the update request to the provider application. - /// - /// The OnUpdateResult will recieve result of this API. - /// The update data. - /// The Where statement for the query. - /// Thrown in case of an invalid parmaeter. - /// Thrown in case if a permission is denied. - /// Thrown when the message has exceeded the maximum limit (1MB). - /// Thrown in case of any internal error. - /// http://tizen.org/privilege/datasharing - /// http://tizen.org/privilege/appmanager.launch - public void Update(Bundle updateData, string where) - { - int reqId; - ResultType ret; - - if (updateData == null || updateData.SafeBundleHandle.IsInvalid) - { - ErrorFactory.ThrowException(ResultType.InvalidParameter, false, "insertData"); - } - - if (string.IsNullOrEmpty(where)) - { - ErrorFactory.ThrowException(ResultType.InvalidParameter, false, "where"); - } - - _lock.WaitOne(); - ret = Interop.DataControl.Update(_handle, updateData.SafeBundleHandle, where, out reqId); - _lock.ReleaseMutex(); - if (ret != ResultType.Success) - { - ErrorFactory.ThrowException(ret, false, "Update"); - } - - CallbackManager.RegisterReqId(reqId, this); - } - - /// - /// Sends the bulk insert request to the provider application. - /// - /// The OnBulkInsertResult will recieve the result of this API. - /// The bulk insert data. - /// Thrown in case of an invalid parmaeter. - /// Thrown in case oif a permission is denied. - /// Thrown when the message has exceeded the maximum limit (1MB). - /// Thrown in case of any internal error. - /// http://tizen.org/privilege/datasharing - /// http://tizen.org/privilege/appmanager.launch - public void BulkInsert(BulkData insertData) - { - int reqId; - ResultType ret; - - if (insertData == null || insertData.SafeBulkDataHandle.IsInvalid) - { - ErrorFactory.ThrowException(ResultType.InvalidParameter, false, "insertData"); - } - - _lock.WaitOne(); - ret = Interop.DataControl.BulkInsert(_handle, insertData.SafeBulkDataHandle, out reqId); - _lock.ReleaseMutex(); - if (ret != ResultType.Success) - { - ErrorFactory.ThrowException(ret, false, "BulkInsert"); - } - - CallbackManager.RegisterReqId(reqId, this); - } - - /// - /// Sends the map add request to the provider application. - /// - /// The OnMapAddResult will recieve the result of this API. - /// The key of the value to add. - /// The value to add. - /// Thrown in case of an invalid parmaeter. - /// Thrown in case of if a permission is denied. - /// Thrown when the message has exceeded the maximum limit (1MB). - /// Thrown in case of any internal error. - /// http://tizen.org/privilege/datasharing - /// http://tizen.org/privilege/appmanager.launch - public void MapAdd(string key, string value) - { - int reqId; - ResultType ret; - - if (string.IsNullOrEmpty(key) || string.IsNullOrEmpty(value)) - { - ErrorFactory.ThrowException(ResultType.InvalidParameter, false); - } - - _lock.WaitOne(); - ret = Interop.DataControl.MapAdd(_handle, key, value, out reqId); - _lock.ReleaseMutex(); - if (ret != ResultType.Success) - { - ErrorFactory.ThrowException(ret, false, "MapAdd"); - } - - CallbackManager.RegisterReqId(reqId, this); - } - - /// - /// Sends the map get request to the provider application. - /// - /// The OnMapGetResult will recieve the result of this API. - /// The key of the value list to obtain. - /// The page number of the value set. - /// The desired maximum count of the data items per page. - /// Thrown in case of an invalid parmaeter. - /// Thrown in case if a permission is denied. - /// Thrown in case of any internal error. - /// http://tizen.org/privilege/datasharing - /// http://tizen.org/privilege/appmanager.launch - public void MapGet(string key, int pageNumber = 1, int countPerPage = 20) - { - int reqId; - ResultType ret; - - if (string.IsNullOrEmpty(key) || pageNumber <= 0 || countPerPage <= 0) - { - ErrorFactory.ThrowException(ResultType.InvalidParameter, false); - } - - _lock.WaitOne(); - ret = Interop.DataControl.MapGet(_handle, key, out reqId, pageNumber, countPerPage); - _lock.ReleaseMutex(); - if (ret != ResultType.Success) - { - ErrorFactory.ThrowException(ret, false, "MapGet"); - } - - CallbackManager.RegisterReqId(reqId, this); - } - - /// - /// Sends the map remove request to the provider application. - /// - /// The OnMapRemoveResult will recieve the result of this API. - /// The key of the value to remove. - /// The value to remove. - /// Thrown in case of an invalid parmaeter. - /// Thrown in case if a permission is denied. - /// Thrown in case of any internal error. - /// http://tizen.org/privilege/datasharing - /// http://tizen.org/privilege/appmanager.launch - public void MapRemove(string key, string value) - { - int reqId; - ResultType ret; - - if (string.IsNullOrEmpty(key) || string.IsNullOrEmpty(value)) - { - ErrorFactory.ThrowException(ResultType.InvalidParameter, false); - } - - _lock.WaitOne(); - ret = Interop.DataControl.MapRemove(_handle, key, value, out reqId); - _lock.ReleaseMutex(); - if (ret != ResultType.Success) - { - ErrorFactory.ThrowException(ret, false, "MapRemove"); - } - - CallbackManager.RegisterReqId(reqId, this); - } - - /// - /// Sends the map set request to the provider application. - /// - /// The OnMapSetResult will recieve the result of this API. - /// The key of the value to replace. - /// The value to be replaced. - /// The new value that replaces the existing value. - /// Thrown in case of an invalid parmaeter. - /// Thrown in case if a permission is denied. - /// Thrown when message has exceeded the maximum limit (1MB). - /// Thrown in case of any internal error. - /// http://tizen.org/privilege/datasharing - /// http://tizen.org/privilege/appmanager.launch - public void MapSet(string key, string oldValue, string newValue) - { - int reqId; - ResultType ret; - - if (string.IsNullOrEmpty(key) || string.IsNullOrEmpty(oldValue) || string.IsNullOrEmpty(newValue)) - { - ErrorFactory.ThrowException(ResultType.InvalidParameter, false); - } - - _lock.WaitOne(); - ret = Interop.DataControl.MapSet(_handle, key, oldValue, newValue, out reqId); - _lock.ReleaseMutex(); - if (ret != ResultType.Success) - { - ErrorFactory.ThrowException(ret, false, "MapSet"); - } - - CallbackManager.RegisterReqId(reqId, this); - } - - /// - /// Sends the map bulk add request to the provider application. - /// - /// The OnMapBulkAddResult will recieve the result of this API. - /// The map bulk add data. - /// Thrown in case of an invalid parmaeter. - /// Thrown in case if a permission is denied. - /// Thrown when the message has exceeded the maximum limit (1MB). - /// Thrown in case of any internal error. - /// http://tizen.org/privilege/datasharing - /// http://tizen.org/privilege/appmanager.launch - public void MapBulkAdd(BulkData addData) - { - int reqId; - ResultType ret; - - if (addData == null || addData.SafeBulkDataHandle.IsInvalid) - { - ErrorFactory.ThrowException(ResultType.InvalidParameter, false, "addData"); - } - - _lock.WaitOne(); - ret = Interop.DataControl.BulkAdd(_handle, addData.SafeBulkDataHandle, out reqId); - _lock.ReleaseMutex(); - if (ret != ResultType.Success) - { - ErrorFactory.ThrowException(ret, false, "BulkAdd"); - } - - CallbackManager.RegisterReqId(reqId, this); - } - - private void DataChange(IntPtr handle, ChangeType type, IntPtr data, IntPtr userData) - { - OnDataChange(type, new Bundle(new SafeBundleHandle(data, false))); - } - - private void DataChangeListenResult(IntPtr handle, ResultType type, int callbackId, IntPtr userData) - { - OnDataChangeListenResult(new DataChangeListenResult(type)); - } - - /// - /// Listens the DataChange event. - /// - /// The OnDataChangeListenResult will recieve the result of this API. - /// If success, the OnDataChange will recieve the DataChange event. - /// Thrown in case if a permission is denied. - /// Thrown in case of any internal error. - /// http://tizen.org/privilege/datasharing - /// http://tizen.org/privilege/appmanager.launch - public void DataChangeListen() - { - ResultType ret; - _lock.WaitOne(); - /* Only one callback is allowed for every obejct */ - if (_changeCallbackID > 0) - { - _lock.ReleaseMutex(); - return; - } - _dataChangeCallback = new Interop.DataControl.DataChangeCallback(DataChange); - _addCallbackResultCallback = new Interop.DataControl.AddCallbackResultCallback(DataChangeListenResult); - ret = Interop.DataControl.AddDataChangeCallback(_handle, _dataChangeCallback, IntPtr.Zero, - _addCallbackResultCallback , IntPtr.Zero, out _changeCallbackID); - _lock.ReleaseMutex(); - if (ret != ResultType.Success) - { - ErrorFactory.ThrowException(ret, false, "DataChangeListen"); - } - } - - /// - /// Initializes the Consumer class with the providerId and the ataId. - /// - /// The DataControl Provider ID. - /// The DataControl Data ID. - /// Thrown in case of an invalid parmaeter. - /// Thrown in case of any internal error. - public Consumer(string providerId, string dataId) - { - ResultType ret; - - if (string.IsNullOrEmpty(providerId)) - { - ErrorFactory.ThrowException(ResultType.InvalidParameter, false, "providerId"); - } - - if (string.IsNullOrEmpty(dataId)) - { - ErrorFactory.ThrowException(ResultType.InvalidParameter, false, "dataId"); - } - - ret = Interop.DataControl.DataControlCreate(out _handle); - if (ret != ResultType.Success) - { - ErrorFactory.ThrowException(ret, false, "Creating data control handle is failed"); - } - - Interop.DataControl.DataControlSetProviderId(_handle, providerId); - Interop.DataControl.DataControlSetDataId(_handle, dataId); - CallbackManager.RegisterCallback(_handle, providerId); - _dataID = dataId; - _providerID = providerId; - } - - ~Consumer() - { - Dispose(false); - } - - /// - /// Overrides this method if you want to handle the behavior when the DataChangeListen result is received. - /// - protected virtual void OnDataChangeListenResult(DataChangeListenResult result) - { - Log.Info(LogTag, "The OnDataChangeListenResult is not implemented."); - } - - /// - /// Overrides this method if you want to handle the behavior when the data change event is received. - /// - protected virtual void OnDataChange(ChangeType type, Bundle data) - { - Log.Info(LogTag, "The OnDataChange is not implemented."); - } - - /// - /// Overrides this method if you want to handle the behavior when the select response is received. - /// - protected abstract void OnSelectResult(SelectResult result); - - /// - /// Overrides this method if you want to handle the behavior when the insert response is received. - /// - protected abstract void OnInsertResult(InsertResult result); - - /// - /// Overrides this method if you want to handle the behavior when the update response is received. - /// - protected abstract void OnUpdateResult(UpdateResult result); - - /// - /// Overrides this method if want to handle the behavior when the delete response is received. - /// - protected abstract void OnDeleteResult(DeleteResult result); - /// - /// Overrides this method if you want to handle the behavior when the BulkInsert response is received. - /// - protected virtual void OnBulkInsertResult(BulkInsertResult result) - { - Log.Info(LogTag, "The OnBulkInsertResult is not implemented."); - } - - /// - /// Overrides this method if you want to handle the behavior when the map get response is received. - /// - protected virtual void OnMapGetResult(MapGetResult result) - { - Log.Info(LogTag, "The OnMapGetResult is not implemented."); - } - - /// - /// Overrides this method if you want to handle the behavior when the map add response is received. - /// - protected virtual void OnMapAddResult(MapAddResult result) - { - Log.Info(LogTag, "The OnMapAddResult is not implemented."); - } - - /// - /// Overrides this method if you want to handle the behavior when the map set response is received. - /// - protected virtual void OnMapSetResult(MapSetResult result) - { - Log.Info(LogTag, "The OnMapSetResult is not implemented."); - } - - /// - /// Overrides this method if you want to handle the behavior when the map remove response is received. - /// - protected virtual void OnMapRemoveResult(MapRemoveResult result) - { - Log.Info(LogTag, "The OnMapRemoveResult is not implemented."); - } - - /// - /// Overrides this method if you want to handle the behavior when the BulkAdd response is received. - /// - protected virtual void OnMapBulkAddResult(MapBulkAddResult result) - { - Log.Info(LogTag, "The OnMapBulkAddResult is not implemented."); - } - - /// - /// Releases the unmanaged resources used by the Consumer class specifying whether to perform a normal dispose operation. - /// - /// true for a normal dispose operation; false to finalize the handle. - protected virtual void Dispose(bool disposing) - { - if (!_disposed) - { - if (_changeCallbackID > 0) - { - Interop.DataControl.RemoveDataChangeCallback(_handle, _changeCallbackID); - } - - CallbackManager.UnregisterCallback(_handle, _providerID); - _handle.Dispose(); - _disposed = true; - } - - if (disposing) - { - GC.SuppressFinalize(this); - } - } - - /// - /// Releases all resources used by the Consumer class. - /// - public void Dispose() - { - Dispose(true); - } - } -} diff --git a/src/Tizen.Applications.DataControl/Tizen.Applications.DataControl/ErrorFactory.cs b/src/Tizen.Applications.DataControl/Tizen.Applications.DataControl/ErrorFactory.cs deleted file mode 100755 index a5712c960..000000000 --- a/src/Tizen.Applications.DataControl/Tizen.Applications.DataControl/ErrorFactory.cs +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) 2017 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.CompilerServices; - -namespace Tizen.Applications.DataControl -{ - internal static class ErrorFactory - { - private const string LogTag = "Tizen.Applications.DataControl"; - - internal static void ThrowException(ResultType errorCode, bool ignoreType, string errorMessage = null, - [CallerMemberName] string memberName = "", [CallerFilePath] string filePath = "", [CallerLineNumber] int lineNumber = 0) - { - Log.Error(LogTag, $"{memberName}({lineNumber.ToString()}) : {filePath}"); - if (ignoreType) - { - throw new InvalidOperationException(string.IsNullOrEmpty(errorMessage) ? "error code : " + errorCode.ToString() : - $"{errorMessage} - {errorCode}"); - } - - switch (errorCode) - { - case ResultType.Success: - return; - case ResultType.OutOfMemory: - case ResultType.IoError: - throw new InvalidOperationException(string.IsNullOrEmpty(errorMessage) ? "error code : " + errorCode.ToString() : - $"{errorMessage} - {errorCode}"); - case ResultType.InvalidParameter: - Log.Error(LogTag, "Invalid parameter : " + errorMessage); - throw new ArgumentException(string.IsNullOrEmpty(errorMessage) ? "Invalid parameter" : "Invalid parameter : " + errorMessage); - case ResultType.PermissionDenied: - Log.Error(LogTag, "Permission denied : " + errorMessage); - throw new UnauthorizedAccessException(string.IsNullOrEmpty(errorMessage) ? "Permission denied" : "Permission denied : " + errorMessage); - case ResultType.MaxExceed: - Log.Error(LogTag, "Too long argument : " + errorMessage); - throw new ArgumentOutOfRangeException(string.IsNullOrEmpty(errorMessage) ? "Too long argument" : "Too long argument : " + errorMessage); - default: - Log.Error(LogTag, $"Unknown error : {errorMessage} - {errorCode}"); - throw new InvalidOperationException(string.IsNullOrEmpty(errorMessage) ? "Unknown error : " + errorCode.ToString() : - $"Unknown error : {errorMessage} - {errorCode}"); - } - } - } -} diff --git a/src/Tizen.Applications.DataControl/Tizen.Applications.DataControl/ICursor.cs b/src/Tizen.Applications.DataControl/Tizen.Applications.DataControl/ICursor.cs deleted file mode 100755 index 0843ceb71..000000000 --- a/src/Tizen.Applications.DataControl/Tizen.Applications.DataControl/ICursor.cs +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright (c) 2017 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.Applications.DataControl -{ - /// - /// This interface is for the DataControl cursor. - /// - public interface ICursor - { - /// - /// Gets a column count. - /// - int GetColumnCount(); - /// - /// Gets a column type. - /// - /// The index of column. - ColumnType GetColumnType(int index); - /// - /// Gets a column name. - /// - /// The index of column. - string GetColumnName(int index); - /// - /// Gets the numbers of rows in the cursor. - /// - long GetRowCount(); - /// - /// Gets a next row. - /// - bool Next(); - /// - /// Gets a prev row. - /// - bool Prev(); - /// - /// Gets a first row. - /// - bool Reset(); - /// - /// Gets an integer value. - /// - /// The index of row. - int GetIntValue(int index); - /// - /// Gets an int64 value. - /// - /// The index of row. - Int64 GetInt64Value(int index); - /// - /// Gets a double value. - /// - /// The index of row. - double GetDoubleValue(int index); - /// - /// Gets a string value. - /// - /// The index of row. - string GetStringValue(int index); - /// - /// Gets a BLOB value. - /// - /// The index of row. - byte[] GetBlobValue(int index); - } -} \ No newline at end of file diff --git a/src/Tizen.Applications.DataControl/Tizen.Applications.DataControl/MatrixCursor.cs b/src/Tizen.Applications.DataControl/Tizen.Applications.DataControl/MatrixCursor.cs deleted file mode 100755 index 2df5c7b78..000000000 --- a/src/Tizen.Applications.DataControl/Tizen.Applications.DataControl/MatrixCursor.cs +++ /dev/null @@ -1,629 +0,0 @@ -/* - * Copyright (c) 2017 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.IO; -using System.Text; -using System.Collections.Generic; -using System.Threading; -using System.Diagnostics; - -namespace Tizen.Applications.DataControl -{ - /// - /// Represents the MatrixCursor class for the DataControl provider's matrix cursor. - /// - public class MatrixCursor : IDisposable, ICursor - { - private const string LogTag = "Tizen.Applications.DataControl"; - private FileStream _fs; - private bool _disposed = false; - private string _cursorPath; - private long _rowCount = 0; - private long _rowCountPosition = 0; - private int _currentRowIndex = 0; - private IList _rowFieldOffset = new List(); - private string[] _columnNames; - private ColumnType[] _columnTypes; - private const int ColumnTypeNull = 5; - - private byte[] GetValue(int index) - { - byte[] int_tmp = new byte[sizeof(int)]; - byte[] ret_array; - ColumnType type; - int size, read_len; - - MoveToColumn(index); - - read_len = _fs.Read(int_tmp, 0, int_tmp.Length); - if (read_len != int_tmp.Length) - { - ErrorFactory.ThrowException(ResultType.IoError, true, "Column Type " + index.ToString()); - } - - type = (ColumnType)BitConverter.ToInt32(int_tmp, 0); - - if (type != _columnTypes[index]) - { - if ((int)type == ColumnTypeNull && - (_columnTypes[index] == ColumnType.ColumnTypeBlob || _columnTypes[index] == ColumnType.ColumnTypeString)) - { - return null; /* null type */ - } - - ErrorFactory.ThrowException(ResultType.IoError, true, "Type mismatch " + index.ToString()); - } - - read_len = _fs.Read(int_tmp, 0, int_tmp.Length); - if (read_len != int_tmp.Length) - { - ErrorFactory.ThrowException(ResultType.IoError, true, "Column size " + index.ToString()); - } - - size = BitConverter.ToInt32(int_tmp, 0); - - if (size < 0) - { - ErrorFactory.ThrowException(ResultType.IoError, true, "Invalid data size " + index.ToString()); - } - - ret_array = new byte[size]; - read_len = _fs.Read(ret_array, 0, ret_array.Length); - if (read_len != ret_array.Length) - { - ErrorFactory.ThrowException(ResultType.IoError, true, "Column value size " + index.ToString()); - return null; - } - - return ret_array; - } - - private void MoveToColumn(int ColumnIndex) - { - int i, tmp_position; - byte[] int_tmp = new byte[sizeof(int)]; - int read_len; - long seek_len; - - seek_len = _fs.Seek(_rowFieldOffset[_currentRowIndex], SeekOrigin.Begin); - if (seek_len != _rowFieldOffset[_currentRowIndex]) - { - ErrorFactory.ThrowException(ResultType.IoError, true, "Row index " + _currentRowIndex.ToString()); - } - - for (i = 0; i < ColumnIndex; i++) - { - /* type(int) size(int) value */ - switch (_columnTypes[i]) - { - case ColumnType.ColumnTypeInt: - tmp_position = sizeof(int) * 2 + sizeof(Int64); - _fs.Seek(tmp_position, SeekOrigin.Current); - break; - case ColumnType.ColumnTypeDouble: - tmp_position = sizeof(int) * 2 + sizeof(double); - _fs.Seek(tmp_position, SeekOrigin.Current); - break; - case ColumnType.ColumnTypeString: - tmp_position = sizeof(int); - _fs.Seek(tmp_position, SeekOrigin.Current); - read_len = _fs.Read(int_tmp, 0, int_tmp.Length); - if (read_len != int_tmp.Length) - { - ErrorFactory.ThrowException(ResultType.IoError, true, "Column Index " + ColumnIndex.ToString()); - } - - tmp_position = BitConverter.ToInt32(int_tmp, 0); - - if (tmp_position > 0) - { - _fs.Seek(tmp_position, SeekOrigin.Current); - } - - break; - case ColumnType.ColumnTypeBlob: - tmp_position = sizeof(int); - _fs.Seek(tmp_position, SeekOrigin.Current); - - read_len = _fs.Read(int_tmp, 0, int_tmp.Length); - if (read_len != int_tmp.Length) - { - ErrorFactory.ThrowException(ResultType.IoError, true, "Column Index " + ColumnIndex.ToString()); - } - - tmp_position = BitConverter.ToInt32(int_tmp, 0); - - if (tmp_position > 0) - { - _fs.Seek(tmp_position, SeekOrigin.Current); - } - - break; - } - } - - } - - internal FileStream GetFileStream() - { - return _fs; - } - - /// - /// Gets the column count of the MatrixCursor. - /// - public int GetColumnCount() - { - return _columnTypes.Length; - } - - /// - /// Returns the column type at the given zero-based column index. - /// - /// Target column index - /// Thrown in case of an invalid parameter. - public ColumnType GetColumnType(int index) - { - if (index < 0 || index >= _columnTypes.Length) - { - ErrorFactory.ThrowException(ResultType.InvalidParameter, false); - } - - return _columnTypes[index]; - } - - /// - /// Returns the column name at the given zero-based column index. - /// - /// The target column index. - /// Thrown in case of an invalid parameter. - public string GetColumnName(int index) - { - if (index < 0 || index >= _columnTypes.Length) - { - ErrorFactory.ThrowException(ResultType.InvalidParameter, false); - } - - return _columnNames[index]; - } - - /// - /// Gets the MatrixCursor's row count. - /// - public long GetRowCount() - { - return _rowCount; - } - - /// - /// Move the MatrixCursor to the next row. - /// - public bool Next() - { - if (_currentRowIndex >= _rowCount - 1) - { - return false; - } - - _currentRowIndex++; - return true; - } - - /// - /// Move the MatrixCursor to the previous row. - /// - public bool Prev() - { - if (_currentRowIndex <= 0) - { - return false; - } - - _currentRowIndex--; - return true; - } - - /// - /// Move the MatrixCursor to the first row. - /// - public bool Reset() - { - _currentRowIndex = 0; - return true; - } - - /// - /// Returns the value of the requested column as an integer. - /// - /// Thrown in case of an invalid parameter. - public int GetIntValue(int index) - { - int ret; - byte[] byte_array; - - if (index < 0 || index >= _columnTypes.Length) - { - ErrorFactory.ThrowException(ResultType.InvalidParameter, false); - } - - byte_array = GetValue(index); - if (byte_array == null) - { - ErrorFactory.ThrowException(ResultType.InvalidParameter, false); - } - ret = BitConverter.ToInt32(byte_array, 0); - - return ret; - } - - /// - /// Returns the value of the requested column as int64. - /// - /// Thrown in case of an invalid parameter. - public Int64 GetInt64Value(int index) - { - Int64 ret; - byte[] byte_array; - - if (index < 0 || index >= _columnTypes.Length) - { - ErrorFactory.ThrowException(ResultType.InvalidParameter, false); - } - - byte_array = GetValue(index); - if (byte_array == null) - { - ErrorFactory.ThrowException(ResultType.InvalidParameter, false); - } - ret = BitConverter.ToInt64(byte_array, 0); - - return ret; - } - - /// - /// Returns the value of the requested column as a double. - /// - /// Thrown in case of an invalid parameter. - public double GetDoubleValue(int index) - { - double ret; - byte[] byte_array; - - if (index < 0 || index >= _columnTypes.Length) - { - ErrorFactory.ThrowException(ResultType.InvalidParameter, false); - } - - byte_array = GetValue(index); - if (byte_array == null) - { - ErrorFactory.ThrowException(ResultType.InvalidParameter, false); - } - ret = BitConverter.ToDouble(byte_array, 0); - - return ret; - } - - /// - /// Returns the value of the requested column as a string. - /// - /// Thrown in case of an invalid parameter. - public string GetStringValue(int index) - { - string ret; - byte[] byte_array; - - if (index < 0 || index >= _columnTypes.Length) - { - ErrorFactory.ThrowException(ResultType.InvalidParameter, false); - } - - byte_array = GetValue(index); - - if (byte_array == null) - { - return null; - } - - ret = Encoding.UTF8.GetString(byte_array).TrimEnd('\0'); - return ret; - - } - - /// - /// Returns the value of the requested column as a BLOB. - /// - /// Thrown in case of an invalid parameter. - public byte[] GetBlobValue(int index) - { - byte[] byte_array; - - if (index < 0 || index >= _columnTypes.Length) - { - ErrorFactory.ThrowException(ResultType.InvalidParameter, false); - } - - byte_array = GetValue(index); - return byte_array; - } - - private static class FileManager - { - private static readonly string DATACONTROL_DIRECTORY = "/tmp/"; - private static Dictionary fileTable = new Dictionary(); - public static string OpenFileStream(int threadID) - { - string path; - int index; - - if (threadID < 0) - { - Log.Error(LogTag, "threadID is " + threadID.ToString()); - return null; - } - - if (fileTable.ContainsKey(threadID) == false) - { - fileTable.Add(threadID, 0); - } - - index = fileTable[threadID]; - index++; - fileTable[threadID] = index; - - path = DATACONTROL_DIRECTORY + Application.Current.ApplicationInfo.ApplicationId + "_" + Process.GetCurrentProcess().Id.ToString() + "_" + threadID.ToString() + "_" + index.ToString(); - - return path; - } - } - - /// - /// Initializes the MatrixCursor class with columnNames and columnTypes. - /// - /// The MatrixCursor's column name list. - /// The MatrixCursor's column type list. - /// Thrown in case of an invalid parameter. - /// Thrown in case of any internal error. - public MatrixCursor(string[] columnNames, ColumnType[] columnTypes) - { - byte[] byte_tmp, length_tmp, string_tmp; - int i, total_len_of_column_names = 0; - - if (columnNames == null || columnTypes == null || - (columnNames.Length != columnTypes.Length) || columnNames.Length < 1) - { - ErrorFactory.ThrowException(ResultType.InvalidParameter, false); - } - - for (i = 0; i < columnNames.Length; i++) - { - if (string.IsNullOrEmpty(columnNames[i])) - { - ErrorFactory.ThrowException(ResultType.InvalidParameter, false, "columnNames index " + i.ToString()); - } - } - - for (i = 0; i < columnTypes.Length; i++) - { - if ( columnTypes[i] < ColumnType.ColumnTypeInt || columnTypes[i] > ColumnType.ColumnTypeBlob) - { - ErrorFactory.ThrowException(ResultType.InvalidParameter, false, "columnTypes index" + i.ToString()); - } - } - - _columnNames = columnNames; - _columnTypes = columnTypes; - - _cursorPath = FileManager.OpenFileStream(Thread.CurrentThread.ManagedThreadId); - if (_cursorPath == null) - { - Log.Error(LogTag, "Unable to create a cursor file : " + _cursorPath); - ErrorFactory.ThrowException(ResultType.IoError, true); - } - - _fs = new FileStream(_cursorPath, FileMode.Create); - /* column count */ - byte_tmp = BitConverter.GetBytes(columnNames.Length); - _fs.Write(byte_tmp, 0, byte_tmp.Length); - - /* column type */ - for (i = 0; i < columnTypes.Length; i++) - { - byte_tmp = BitConverter.GetBytes((int)_columnTypes[i]); - _fs.Write(byte_tmp, 0, byte_tmp.Length); - } - - /* column name */ - for (i = 0; i < columnTypes.Length; i++) - { - string_tmp = Encoding.UTF8.GetBytes(columnNames[i]); - byte_tmp = new byte[string_tmp.Length + 1];/*insert null */ - - string_tmp.CopyTo(byte_tmp, 0); - - length_tmp = BitConverter.GetBytes(byte_tmp.Length); - total_len_of_column_names += length_tmp.Length; - - _fs.Write(length_tmp, 0, length_tmp.Length); - _fs.Write(byte_tmp, 0, byte_tmp.Length); - } - - /* total length of column names */ - byte_tmp = BitConverter.GetBytes(total_len_of_column_names); - _fs.Write(byte_tmp, 0, byte_tmp.Length); - - _rowCountPosition = _fs.Position; - /* row count */ - byte_tmp = BitConverter.GetBytes(_rowCount); - _fs.Write(byte_tmp, 0, byte_tmp.Length); - _fs.Flush(); - } - - internal MatrixCursor() - { - _columnNames = new string[0]; - _columnTypes = new ColumnType[0]; - _fs = null; - _cursorPath = null; - } - - /// - /// Adds a new row to the end with the given column values. - /// - /// New column values - /// Thrown in case of an invalid parameter. - public void AddRow(object[] columnValues) - { - int i, size = 0; - byte[] type_array, length_array, value_array = null, string_array, byte_tmp; - - if (columnValues == null || columnValues.Length <= 0 || columnValues.Length != _columnTypes.Length) - { - ErrorFactory.ThrowException(ResultType.InvalidParameter, false); - } - - using (MemoryStream ms = new MemoryStream()) - { - for (i = 0; i < _columnTypes.Length; i++) - { - type_array = BitConverter.GetBytes((int)_columnTypes[i]); - switch (_columnTypes[i]) - { - case ColumnType.ColumnTypeInt: - if (!(columnValues[i] is Int64) && !(columnValues[i] is Int32)) - { - ErrorFactory.ThrowException(ResultType.InvalidParameter, false, "Type mismatch :Index " + i.ToString()); - } - - value_array = BitConverter.GetBytes(Convert.ToUInt64(columnValues[i])); - size = value_array.Length; - break; - case ColumnType.ColumnTypeDouble: - if (!(columnValues[i] is Double)) - { - ErrorFactory.ThrowException(ResultType.InvalidParameter, false, "Type mismatch :Index " + i.ToString()); - } - - value_array = BitConverter.GetBytes(Convert.ToDouble(columnValues[i])); - size = value_array.Length; - break; - case ColumnType.ColumnTypeString: - if (columnValues[i] == null) - { - type_array = BitConverter.GetBytes(ColumnTypeNull); - size = 0; - break; - } - - if (!(columnValues[i] is string)) - { - ErrorFactory.ThrowException(ResultType.InvalidParameter, false, "Type mismatch :Index " + i.ToString()); - } - - string_array = Encoding.UTF8.GetBytes(Convert.ToString(columnValues[i])); - value_array = new byte[string_array.Length + 1];/*insert null */ - string_array.CopyTo(value_array, 0); - size = value_array.Length; - break; - - case ColumnType.ColumnTypeBlob: - if (columnValues[i] == null) - { - type_array = BitConverter.GetBytes(ColumnTypeNull); - size = 0; - break; - } - - if (!(columnValues[i] is byte[])) - { - ErrorFactory.ThrowException(ResultType.InvalidParameter, false, "Type mismatch :Index " + i.ToString()); - } - - value_array = (byte[])columnValues[i]; - size = value_array.Length; - break; - } - - ms.Write(type_array, 0, type_array.Length); - - length_array = BitConverter.GetBytes(size); - ms.Write(length_array, 0, length_array.Length); - if (size > 0) - { - ms.Write(value_array, 0, value_array.Length); - } - } - - /* update row count */ - _rowCount++; - byte_tmp = BitConverter.GetBytes(_rowCount); - _fs.Seek(_rowCountPosition, SeekOrigin.Begin); - _fs.Write(byte_tmp, 0, byte_tmp.Length); - - _fs.Seek(0, SeekOrigin.End); - - _rowFieldOffset.Add(_fs.Position); - ms.WriteTo(_fs);/* row data */ - _fs.Flush(); - - Log.Debug(LogTag, "_fs pos = " + _fs.Position.ToString()); - Log.Debug(LogTag, "_fs len = " + _fs.Length.ToString()); - } - } - - /// - /// Releases all the resources used by the MatrixCursor class. - /// - public void Dispose() - { - Dispose(true); - } - - protected virtual void Dispose(bool disposing) - { - if (!_disposed) - { - if (!string.IsNullOrEmpty(_cursorPath)) - { - FileInfo fi = new FileInfo(_cursorPath); - - if (_fs != null) - { - _fs.Dispose(); - } - - if (fi.Exists) - { - fi.Delete(); - } - } - - _disposed = true; - } - - if (disposing) - { - GC.SuppressFinalize(this); - } - } - - ~MatrixCursor() - { - Dispose(false); - } - } -} diff --git a/src/Tizen.Applications.DataControl/Tizen.Applications.DataControl/Provider.cs b/src/Tizen.Applications.DataControl/Tizen.Applications.DataControl/Provider.cs deleted file mode 100755 index c99702eb0..000000000 --- a/src/Tizen.Applications.DataControl/Tizen.Applications.DataControl/Provider.cs +++ /dev/null @@ -1,1091 +0,0 @@ -/* - * Copyright (c) 2017 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.IO; -using System.Text; -using System.Collections.Generic; -using Tizen.Applications.DataControl; -using System.Runtime.InteropServices; -using System.Threading; - -namespace Tizen.Applications.DataControl -{ - /// - /// Represents the Provider class for the DataControl provider application. - /// - public abstract class Provider : IDisposable - { - private const string LogTag = "Tizen.Applications.DataControl"; - private static IDictionary _providerDict = new Dictionary(); - private static Interop.DataControl.SqlRequestCallbacks _sqlRequestCallbacks; - private static Interop.DataControl.MapRequestCallbacks _mapRequestCallbacks; - private IntPtr _nativeHandle; - private static Interop.DataControl.DataChangeConsumerFilterCb _filterCallback; - private static int _filterCallbackID; - private static bool _filterRegistered; - private static Interop.DataControl.SqlBulkInsertRequestCallback _sqlBulkCallback; - private static Interop.DataControl.MapBulkAddRequestCallback _mapBulkCallback; - private static Mutex _lock = new Mutex(); - private bool _disposed = false; - private bool _isRunning = false; - - /// - /// Gets the data ID. - /// - public string DataID - { - get; - private set; - } - - private static bool DataChangeListenFilter(IntPtr handlePtr, string consumerAppid, IntPtr userData) - { - Provider provider; - DataChangeListenResult result; - - provider = GetProvider(handlePtr); - if (provider == null) - { - Log.Error(LogTag, "Provider not exist "); - return false; - } - - result = provider.OnDataChangeListenRequest(consumerAppid); - if (result == null || result.Result != ResultType.Success) - { - return false; - } - else - { - return true; - } - } - - private enum OperationType : short - { - Select, - Update, - Insert, - Delete - } - - private static string CreateSelectQuery(IntPtr handlePtr, string[] columnList, int columnCount, string where, string order, int pageNum, int countPerPage) - { - Interop.DataControl.SafeDataControlHandle handle = new Interop.DataControl.SafeDataControlHandle(handlePtr, false); - string query = "SELECT"; - string dataId; - if (columnList == null) - { - query += " * "; - } - else - { - for (int i = 0; i < columnCount; i++) - { - if (i != 0) - { - query += ","; - } - - query += " " + columnList[i]; - } - } - - Interop.DataControl.DataControlGetDataId(handle, out dataId); - query += " FROM " + dataId; - if (where != null) - { - query += " WHERE " + where; - } - - if (order != null) - { - query += " ORDER BY " + order; - } - - if (pageNum != 0) - { - query += " LIMIT " + countPerPage + " OFFSET " + (countPerPage * (pageNum - 1)); - } - handle.Dispose(); - return query; - } - - private static void InsertRequest(int requestId, IntPtr handlePtr, IntPtr insertData, IntPtr userData) - { - Provider provider; - InsertResult result; - SafeBundleHandle sbh = new SafeBundleHandle(insertData, false); - string query = GetQuery(handlePtr, sbh, null, OperationType.Update); - ResultType ret; - - provider = GetProvider(handlePtr); - if (provider == null) - { - Log.Error(LogTag, "Provider not exist "); - return; - } - - result = provider.OnInsert(query, new Bundle(sbh)); - if (result != null) - { - if (result.Result) - { - ret = Interop.DataControl.SendInsertResult(requestId, result.RowID); - if (ret != ResultType.Success) - { - Log.Error(LogTag, "SendInsertResult fail " + ret.ToString()); - } - } - else - { - ret = Interop.DataControl.SendError(requestId, result.Result.ToString()); - if (ret != ResultType.Success) - { - Log.Error(LogTag, "SendError fail " + ret.ToString()); - } - } - } - else - { - Log.Info(LogTag, $"InsertResult is null : {requestId.ToString()}"); - } - } - - private static void BulkInsertRequest(int requestId, IntPtr handlePtr, IntPtr bulk_data, IntPtr userData) - { - Provider provider; - BulkInsertResult result; - BulkData bulkData = new BulkData(new Interop.DataControl.SafeBulkDataHandle(bulk_data, false)); - Interop.DataControl.SafeBulkDataHandle sbdh = bulkData.SafeBulkDataHandle; - IntPtr bundleHandel; - ResultType ret; - - int count = bulkData.GetCount(); - List queryList = new List(); - - for (int i = 0; i < count; i++) - { - Interop.DataControl.BulkGetData(sbdh, i, out bundleHandel); - queryList.Add(GetQuery(handlePtr, new SafeBundleHandle(bundleHandel, false), null, OperationType.Insert)); - } - - provider = GetProvider(handlePtr); - if (provider == null) - { - Log.Error(LogTag, "Provider not exist "); - return; - } - - result = provider.OnBulkInsert(queryList, bulkData); - if (result != null) - { - if (result.Result) - { - ret = Interop.DataControl.SendBulkInsertResult(requestId, result.BulkResultData.SafeBulkDataHandle); - if (ret != ResultType.Success) - { - Log.Error(LogTag, "SendBulkInsertResult fail " + ret.ToString()); - } - } - else - { - ret = Interop.DataControl.SendError(requestId, result.Result.ToString()); - if (ret != ResultType.Success) - { - Log.Error(LogTag, "SendError fail " + ret.ToString()); - } - } - - if (result.BulkResultData != null) - { - result.BulkResultData.Dispose(); - } - } - else - { - Log.Info(LogTag, $"BulkInsertResult is null : {requestId.ToString()}"); - } - } - - private static void SendNativeProtocol(int socketFd, ICursor cursor, int requestId) - { - uint write_len; - int DATACONTROL_RESULT_NO_DATA = -1; - int COLUMN_TYPE_NULL = 5; - int column_count, i, rowcount, size = 0, total_len_of_column_names = 0; - byte[] type_array, length_array, string_array, int_tmp, value_array = null; - string txt; - ResultType result; - MemoryStream ms; - - if (cursor.Reset() == false) - { - Log.Error(LogTag, "Reset is failed : " + requestId.ToString()); - return; - } - - if (cursor.GetRowCount() <= 0) - { - Log.Error(LogTag, "The DB does not have another row : " + requestId.ToString()); - int_tmp = BitConverter.GetBytes(DATACONTROL_RESULT_NO_DATA); - result = (ResultType)Interop.DataControl.UnsafeCode.WriteResult(socketFd, int_tmp, int_tmp.Length, out write_len); - return; - } - - /* 1. column count */ - column_count = cursor.GetColumnCount(); - int_tmp = BitConverter.GetBytes(column_count); - result = (ResultType)Interop.DataControl.UnsafeCode.WriteResult(socketFd, int_tmp, int_tmp.Length, out write_len); - if (result != ResultType.Success) - { - Log.Error(LogTag, "Writing a column_count to a file descriptor is failed."); - return; - } - - Log.Info(LogTag, "Writing a column_count " + column_count.ToString()); - - /* 2.column type x column_count */ - for (i = 0; i < column_count; i++) - { - type_array = BitConverter.GetBytes((int)cursor.GetColumnType(i)); - result = (ResultType)Interop.DataControl.UnsafeCode.WriteResult(socketFd, type_array, type_array.Length, out write_len); - if (result != ResultType.Success) - { - Log.Error(LogTag, "Writing a type to a file descriptor is failed."); - return; - } - - Log.Info(LogTag, "Writing a column_type " + cursor.GetColumnType(i).ToString()); - } - - /* 3. column name x column_count */ - for (i = 0; i < column_count; i++) - { - Log.Info(LogTag, "Writing a name " + cursor.GetColumnName(i)); - - total_len_of_column_names += cursor.GetColumnName(i).Length; - string_array = Encoding.UTF8.GetBytes(cursor.GetColumnName(i)); - value_array = new byte[string_array.Length + 1];/*insert null */ - string_array.CopyTo(value_array, 0); - length_array = BitConverter.GetBytes(value_array.Length); - - result = (ResultType)Interop.DataControl.UnsafeCode.WriteResult(socketFd, length_array, length_array.Length, out write_len); - if (result != ResultType.Success) - { - Log.Error(LogTag, "Writing a type to a file descriptor is failed."); - return; - } - - result = (ResultType)Interop.DataControl.UnsafeCode.WriteResult(socketFd, value_array, value_array.Length, out write_len); - if (result != ResultType.Success) - { - Log.Error(LogTag, "Writing a type to a file descriptor is failed."); - return; - } - - } - - /* 4. total length of column names */ - length_array = BitConverter.GetBytes(total_len_of_column_names); - result = (ResultType)Interop.DataControl.UnsafeCode.WriteResult(socketFd, length_array, length_array.Length, out write_len); - if (result != ResultType.Success) - { - Log.Error(LogTag, "Writing a total_len_of_column_names to a file descriptor is failed"); - return; - } - - Log.Info(LogTag, "Writing total length of column namese " + total_len_of_column_names.ToString()); - - /* 5. row count */ - length_array = BitConverter.GetBytes(cursor.GetRowCount()); - Log.Error(LogTag, "=========================== select rowcount " + cursor.GetRowCount().ToString()); - result = (ResultType)Interop.DataControl.UnsafeCode.WriteResult(socketFd, length_array, length_array.Length, out write_len); - if (result != ResultType.Success) - { - Log.Error(LogTag, "Writing a row count to a file descriptor is failed"); - return; - } - - Log.Error(LogTag, "Writing a row count " + cursor.GetRowCount().ToString()); - - rowcount = 0; - do - { - ms = new MemoryStream(); - - for (i = 0; i < column_count; i++) - { - type_array = BitConverter.GetBytes((int)cursor.GetColumnType(i)); - switch (cursor.GetColumnType(i)) - { - case ColumnType.ColumnTypeInt: - value_array = BitConverter.GetBytes(cursor.GetInt64Value(i)); - size = value_array.Length; - break; - - case ColumnType.ColumnTypeDouble: - value_array = BitConverter.GetBytes(cursor.GetDoubleValue(i)); - size = value_array.Length; - break; - - case ColumnType.ColumnTypeString: - txt = cursor.GetStringValue(i); - if (txt == null) - { - type_array = BitConverter.GetBytes(COLUMN_TYPE_NULL); - size = 0; - break; - } - - string_array = Encoding.UTF8.GetBytes(txt); - value_array = new byte[string_array.Length + 1];/*insert null */ - string_array.CopyTo(value_array, 0); - size = value_array.Length; - break; - - case ColumnType.ColumnTypeBlob: - int_tmp = cursor.GetBlobValue(i); - if (int_tmp == null) - { - type_array = BitConverter.GetBytes(COLUMN_TYPE_NULL); - size = 0; - break; - } - - value_array = int_tmp; - size = value_array.Length; - break; - } - - ms.Write(type_array, 0, type_array.Length); - - length_array = BitConverter.GetBytes(size); - ms.Write(length_array, 0, length_array.Length); - if (size > 0) - { - ms.Write(value_array, 0, value_array.Length); - } - } - - value_array = ms.ToArray(); - - result = (ResultType)Interop.DataControl.UnsafeCode.WriteResult(socketFd, value_array, value_array.Length, out write_len); - if (result != ResultType.Success) - { - Log.Error(LogTag, "Writing a row to a file descriptor is failed"); - ms.Dispose(); - return; - } - - ms.Dispose(); - Log.Info(LogTag, "row_count ~~~~ ", rowcount.ToString()); - - } - while (cursor.Next()); - } - - private static void SelectRequest(int requestId, - IntPtr handlePtr, IntPtr columnList, int columnCount, string where, string order, IntPtr userData) - { - Provider provider; - SelectResult result; - int pageNum = 0; - int countPerPage = 0; - int MAX_WRITE_SIZE = 1024; /* 1kbyte */ - string query = null; - int socketFd, write_size, i; - uint write_len; - ResultType ret; - string[] _columnList = new string[columnCount]; - byte[] buffer; - - unsafe - { - byte** _sbyte_columnList = (byte**)columnList; - - for (i = 0; i < columnCount; i++) - { - _columnList[i] = Marshal.PtrToStringAnsi((IntPtr)_sbyte_columnList[i]); - } - } - - Interop.DataControl.GetSelectPageInfo(requestId, out pageNum, out countPerPage); - query = CreateSelectQuery(handlePtr, _columnList, _columnList.Length, where, order, pageNum, countPerPage); - provider = GetProvider(handlePtr); - if (provider == null) - { - Log.Error(LogTag, "Provider not exist "); - return; - } - - result = provider.OnSelect(query, where, _columnList, _columnList.Length, order, pageNum, countPerPage); - if (result != null) - { - if (result.Result) - { - Interop.DataControl.SendSelectResult(requestId, out socketFd); - - MatrixCursor mc = result.ResultCursor as MatrixCursor; - - if (mc == null) - { - SendNativeProtocol(socketFd, result.ResultCursor, requestId); - } - else - { - FileStream fs = mc.GetFileStream(); - fs.Seek(0, SeekOrigin.Begin); - - buffer = new byte[MAX_WRITE_SIZE]; - - do - { - write_size = fs.Read(buffer, 0, MAX_WRITE_SIZE); - - if (write_size > 0) - { - ret = (ResultType)Interop.DataControl.UnsafeCode.WriteResult(socketFd, buffer, write_size, out write_len); - if (ret != ResultType.Success) - { - Log.Error(LogTag, "Writing a row to a file descriptor is failed"); - mc.Dispose(); - return; - } - } - } - while (write_size > 0); - mc.Dispose(); - } - - } - else - { - ret = Interop.DataControl.SendError(requestId, result.Result.ToString()); - if (ret != ResultType.Success) - { - Log.Error(LogTag, "SendError fail " + ret.ToString()); - } - } - } - else - { - Log.Info(LogTag, $"SelectResult is null : {requestId.ToString()}"); - } - } - - private static void UpdateRequest(int requestId, - IntPtr handlePtr, IntPtr updateData, string where, IntPtr userData) - { - Provider provider; - UpdateResult result; - SafeBundleHandle sbh = new SafeBundleHandle(updateData, false); - string query = GetQuery(handlePtr, sbh, where, OperationType.Update); - ResultType ret; - - provider = GetProvider(handlePtr); - if (provider == null) - { - Log.Error(LogTag, "Provider not exist "); - return; - } - - result = provider.OnUpdate(query, where, new Bundle(sbh)); - if (result != null) - { - if (result.Result) - { - ret = Interop.DataControl.SendUpdateResult(requestId); - if (ret != ResultType.Success) - { - Log.Error(LogTag, "SendUpdateResult fail " + ret.ToString()); - } - } - else - { - ret = Interop.DataControl.SendError(requestId, result.Result.ToString()); - if (ret != ResultType.Success) - { - Log.Error(LogTag, "SendError fail " + ret.ToString()); - } - } - } - else - { - Log.Info(LogTag, $"UpdateResult is null : {requestId.ToString()}"); - } - } - - private static void DeleteRequest(int requestId, - IntPtr handlePtr, string where, IntPtr userData) - { - Provider provider; - DeleteResult result; - string query = GetQuery(handlePtr, null, where, OperationType.Delete); - ResultType ret; - - provider = GetProvider(handlePtr); - if (provider == null) - { - Log.Error(LogTag, "Provider not exist "); - return; - } - - result = provider.OnDelete(query, where); - if (result != null) - { - if (result.Result) - { - ret = Interop.DataControl.SendDeleteResult(requestId); - if (ret != ResultType.Success) - { - Log.Error(LogTag, "SendDeleteResult fail " + ret.ToString()); - } - - } - else - { - ret = Interop.DataControl.SendError(requestId, result.Result.ToString()); - if (ret != ResultType.Success) - { - Log.Error(LogTag, "SendError fail " + ret.ToString()); - } - } - } - else - { - Log.Info(LogTag, $"DeleteResult is null : {requestId.ToString()}"); - } - } - - private static void MapAddRequest(int requestId, IntPtr handlePtr, string key, string value, IntPtr userData) - { - Provider provider; - MapAddResult result; - ResultType ret; - - provider = GetProvider(handlePtr); - if (provider == null) - { - Log.Error(LogTag, "Provider not exist"); - return; - } - - result = provider.OnMapAdd(key, value); - if (result != null) - { - if (result.Result) - { - ret = Interop.DataControl.SendMapResult(requestId); - if (ret != ResultType.Success) - { - Log.Error(LogTag, "SendMapResult fail " + ret.ToString()); - } - } - else - { - ret = Interop.DataControl.SendError(requestId, result.Result.ToString()); - if (ret != ResultType.Success) - { - Log.Error(LogTag, "SendError fail " + ret.ToString()); - } - } - } - else - { - Log.Info(LogTag, $"MapAddResult is null : {requestId.ToString()}"); - } - } - - private static void MapSetRequest(int requestId, IntPtr handlePtr, string key, string oldValue, string newValue, IntPtr userData) - { - Provider provider; - MapSetResult result; - ResultType ret; - - provider = GetProvider(handlePtr); - if (provider == null) - { - Log.Error(LogTag, "Provider not exist"); - return; - } - - result = provider.OnMapSet(key, oldValue, newValue); - if (result != null) - { - if (result.Result) - { - ret = Interop.DataControl.SendMapResult(requestId); - if (ret != ResultType.Success) - { - Log.Error(LogTag, "SendMapResult fail " + ret.ToString()); - } - } - else - { - ret = Interop.DataControl.SendError(requestId, result.Result.ToString()); - if (ret != ResultType.Success) - { - Log.Error(LogTag, "SendError fail " + ret.ToString()); - } - } - } - else - { - Log.Info(LogTag, $"MapSetResult is null : {requestId.ToString()}"); - } - } - - private static void MapRemoveRequest(int requestId, IntPtr handlePtr, string key, string value, IntPtr userData) - { - Provider provider; - MapRemoveResult result; - ResultType ret; - - provider = GetProvider(handlePtr); - if (provider == null) - { - Log.Error(LogTag, "Provider not exist"); - return; - } - - result = provider.OnMapRemove(key, value); - if (result != null) - { - if (result.Result) - { - ret = Interop.DataControl.SendMapResult(requestId); - if (ret != ResultType.Success) - { - Log.Error(LogTag, "SendMapResult fail " + ret.ToString()); - } - - } - else - { - ret = Interop.DataControl.SendError(requestId, result.Result.ToString()); - if (ret != ResultType.Success) - { - Log.Error(LogTag, "SendError fail " + ret.ToString()); - } - } - } - else - { - Log.Info(LogTag, $"MapRemoveRequest is null : {requestId.ToString()}"); - } - } - - private static void MapGetRequest(int requestID, IntPtr handlePtr, string key, IntPtr userData) - { - Provider provider; - MapGetResult result; - ResultType ret; - - provider = GetProvider(handlePtr); - if (provider == null) - { - Log.Error(LogTag, "Provider not exist"); - return; - } - - result = provider.OnMapGet(key); - if (result != null) - { - if (result.Result) - { - int valueCount = 0; - if (result.ValueList != null) - valueCount = result.ValueList.Length; - ret = Interop.DataControl.SendMapGetResult(requestID, result.ValueList, valueCount); - if (ret != ResultType.Success) - { - Log.Error(LogTag, "SendMapGetResult fail " + ret.ToString()); - } - - } - else - { - ret = Interop.DataControl.SendError(requestID, result.Result.ToString()); - if (ret != ResultType.Success) - { - Log.Error(LogTag, "SendError fail " + ret.ToString()); - } - } - } - else - { - Log.Info(LogTag, $"MapRemoveRequest is null : {requestID.ToString()}"); - } - } - - private static void MapBulkAddRequest(int requestID, IntPtr handlePtr, IntPtr bulkDataPtr, IntPtr userData) - { - Provider provider; - MapBulkAddResult result; - BulkData bulkData = new BulkData(new Interop.DataControl.SafeBulkDataHandle(bulkDataPtr, false)); - Interop.DataControl.SafeBulkDataHandle sbdh = bulkData.SafeBulkDataHandle; - IntPtr bundleHandel; - int count = bulkData.GetCount(); - List queryList = new List(); - ResultType ret; - - for (int i = 0; i < count; i++) - { - Interop.DataControl.BulkGetData(sbdh, i, out bundleHandel); - queryList.Add(GetQuery(handlePtr, new SafeBundleHandle(bundleHandel, false), null, OperationType.Insert)); - } - - provider = GetProvider(handlePtr); - if (provider == null) - { - Log.Error(LogTag, "Provider not exist"); - return; - } - - result = provider.OnMapBulkAdd(bulkData); - if (result != null) - { - if (result.Result) - { - ret = Interop.DataControl.SendMapBulkAddResult(requestID, result.BulkResultData.SafeBulkDataHandle); - if (ret != ResultType.Success) - { - Log.Error(LogTag, "SendMapBulkAddResult fail " + ret.ToString()); - } - } - else - { - ret = Interop.DataControl.SendError(requestID, result.Result.ToString()); - if (ret != ResultType.Success) - { - Log.Error(LogTag, "SendError fail " + ret.ToString()); - } - } - - if (result.BulkResultData != null) - { - result.BulkResultData.Dispose(); - } - } - else - { - Log.Info(LogTag, $"MapBulkAddRequest is null : {requestID.ToString()}"); - } - } - - private static string GetQuery(IntPtr handlePtr, SafeBundleHandle data, string where, OperationType type) - { - Interop.DataControl.SafeDataControlHandle handle = new Interop.DataControl.SafeDataControlHandle(handlePtr, false); - string query = null; - - switch (type) - { - case OperationType.Select: - break; - case OperationType.Update: - query = Interop.DataControl.CreateUpdateStatement(handle, data, where); - break; - case OperationType.Delete: - query = Interop.DataControl.CreateDeleteStatement(handle, where); - break; - case OperationType.Insert: - query = Interop.DataControl.CreateInsertStatement(handle, data); - break; - default: - break; - } - handle.Dispose(); - - return query; - } - - private static Provider GetProvider(IntPtr handlePtr) - { - Interop.DataControl.SafeDataControlHandle handle = new Interop.DataControl.SafeDataControlHandle(handlePtr, false); - Provider provider = null; - string dataID; - - Interop.DataControl.DataControlGetDataId(handle, out dataID); - if (dataID != null && _providerDict.ContainsKey(dataID)) - { - provider = _providerDict[dataID]; - provider._nativeHandle = handlePtr; - Log.Info(LogTag, "DataID :" + dataID + ", hash code : " + provider.GetHashCode().ToString()); - } - handle.Dispose(); - - return provider; - } - - /// - /// Sends a data change notification to consumer applications which have successfully added a data change listen. - /// - /// The changed data type. - /// Customized information about the changed data. - /// Thrown in case of an invalid parameter. - /// Thrown in case a permission is denied. - /// Thrown in case of any internal error. - /// http://tizen.org/privilege/datasharing - public void SendDataChange(ChangeType type, Bundle changedData) - { - ResultType ret; - - if (changedData == null || changedData.SafeBundleHandle.IsInvalid) - { - ErrorFactory.ThrowException(ResultType.InvalidParameter, false, "changedData"); - } - - if (this._nativeHandle == IntPtr.Zero) - { - return; - } - - ret = Interop.DataControl.SendDataChange(this._nativeHandle, type, changedData.SafeBundleHandle); - if (ret != ResultType.Success) - { - ErrorFactory.ThrowException(ret, false); - } - } - - /// - /// Initializes the Provider class with the dataID. - /// - /// The DataControl Data ID. - /// Thrown in case of an invalid parameter. - public Provider(string dataID) - { - if (string.IsNullOrEmpty(dataID)) - { - ErrorFactory.ThrowException(ResultType.InvalidParameter, false, "dataID"); - } - - DataID = dataID; - } - - /// - /// Starts the Provider service. - /// - /// Only one Provider service can be run for each process. - /// Thrown in case a permission is denied. - /// Thrown in case of any internal error. - /// http://tizen.org/privilege/datasharing - public void Run() - { - ResultType ret; - _lock.WaitOne(); - if (_providerDict.ContainsKey(DataID)) - { - _lock.ReleaseMutex(); - ErrorFactory.ThrowException((ResultType)1, true, "The provider is already running"); - return; - } - - if (_providerDict.Count == 0) - { - Log.Debug(LogTag, "Provider create"); - - _sqlRequestCallbacks.Insert = new Interop.DataControl.SqlInsertRequestCallback(InsertRequest); - _sqlRequestCallbacks.Select = new Interop.DataControl.SqlSelectRequestCallback(SelectRequest); - _sqlRequestCallbacks.Update = new Interop.DataControl.SqlUpdateRequestCallback(UpdateRequest); - _sqlRequestCallbacks.Delete = new Interop.DataControl.SqlDeleteRequestCallback(DeleteRequest); - - ret = Interop.DataControl.RegisterSqlRequest(ref _sqlRequestCallbacks, IntPtr.Zero); - if (ret != ResultType.Success) - { - _lock.ReleaseMutex(); - ErrorFactory.ThrowException(ret, false); - } - - _sqlBulkCallback = new Interop.DataControl.SqlBulkInsertRequestCallback(BulkInsertRequest); - ret = Interop.DataControl.RegisterSqlBulkRequest(_sqlBulkCallback, IntPtr.Zero); - if (ret != ResultType.Success) - { - _lock.ReleaseMutex(); - ErrorFactory.ThrowException(ret, false); - } - - _mapRequestCallbacks.Add = new Interop.DataControl.MapAddRequestCallback(MapAddRequest); - _mapRequestCallbacks.Remove = new Interop.DataControl.MapRemoveRequestCallback(MapRemoveRequest); - _mapRequestCallbacks.Set = new Interop.DataControl.MapSetRequestCallback(MapSetRequest); - _mapRequestCallbacks.Get = new Interop.DataControl.MapGetRequestCallback(MapGetRequest); - ret = Interop.DataControl.RegisterMapRequest(ref _mapRequestCallbacks, IntPtr.Zero); - if (ret != ResultType.Success) - { - _lock.ReleaseMutex(); - ErrorFactory.ThrowException(ret, false); - } - - _mapBulkCallback = new Interop.DataControl.MapBulkAddRequestCallback(MapBulkAddRequest); - ret = Interop.DataControl.RegisterMapBulkRequest(_mapBulkCallback, IntPtr.Zero); - if (ret != ResultType.Success) - { - _lock.ReleaseMutex(); - ErrorFactory.ThrowException(ret, false); - } - - if (_filterRegistered == false) - { - if (_filterCallback == null) - _filterCallback = new Interop.DataControl.DataChangeConsumerFilterCb(DataChangeListenFilter); - - ret = Interop.DataControl.AddDataChangeConsumerFilterCallback( - _filterCallback, - IntPtr.Zero, out _filterCallbackID); - - if (ret != ResultType.Success) - { - _lock.ReleaseMutex(); - ErrorFactory.ThrowException(ret, false); - } - } - - _filterRegistered = true; - } - - _providerDict.Add(DataID, this); - Log.Info(LogTag, "DataID :" + DataID + ", hash code : " + this.GetHashCode().ToString()); - _isRunning = true; - _lock.ReleaseMutex(); - } - - /// - /// Stops the Provider service. - /// - public void Stop() - { - if (_isRunning == true) - { - Log.Info(LogTag, "DataID :" + DataID); - _isRunning = false; - _providerDict.Remove(DataID); - } - } - - ~Provider() - { - Dispose(false); - } - - /// - /// Overrides this method if you want to handle the behavior when the select request is received. - /// - protected abstract SelectResult OnSelect(string query, string where, string[] columList, int columnCount, string order, int pageNum, int countPerPage); - - /// - /// Overrides this method if you want to handle the behavior when the insert request is received. - /// - protected abstract InsertResult OnInsert(string query, Bundle insertData); - - /// - /// Overrides this method if you want to handle the behavior when the update request is received. - /// - protected abstract UpdateResult OnUpdate(string query, string where, Bundle updateData); - - /// - /// Overrides this method if you want to handle the behavior when the delete request is received. - /// - protected abstract DeleteResult OnDelete(string query, string where); - - /// - /// Overrides this method if you want to handle the behavior when the bulk insert request is received. - /// - protected virtual BulkInsertResult OnBulkInsert(IEnumerable query, BulkData bulkInsertData) - { - Log.Info(LogTag, "The OnBulkInsert is not implemented."); - return null; - } - - /// - /// Overrides this method if you want to handle the behavior when the map get request is received. - /// - protected virtual MapGetResult OnMapGet(string key) - { - Log.Info(LogTag, "The OnMapGet is not implemented."); - return null; - } - - /// - /// Overrides this method if you want to handle the behavior when the map add request is received. - /// - protected virtual MapAddResult OnMapAdd(string key, string value) - { - Log.Info(LogTag, "The OnMapAdd is not implemented."); - return null; - } - - /// - /// Overrides this method if you want to handle the behavior when the update request is received. - /// - protected virtual MapSetResult OnMapSet(string key, string oldValue, string newValue) - { - Log.Info(LogTag, "The OnMapSet is not implemented."); - return null; - } - - /// - /// Overrides this method if you want to handle the behavior when the delete request is received. - /// - protected virtual MapRemoveResult OnMapRemove(string key, string value) - { - Log.Info(LogTag, "The OnMapRemove is not implemented."); - return null; - } - - /// - /// Overrides this method if you want to handle the behavior when the bulk add request is received. - /// - protected virtual MapBulkAddResult OnMapBulkAdd(BulkData bulkAddData) - { - Log.Info(LogTag, "The OnMapBulkAdd is not implemented."); - return null; - } - - /// - /// Overrides this method if you want to handle the behavior when the data change listen request is received. - /// - protected virtual DataChangeListenResult OnDataChangeListenRequest(string requestAppID) - { - Log.Info(LogTag, "The OnDataChangeListenRequest is not implemented."); - return null; - } - - /// - /// Releases unmanaged resources used by the Provider class specifying whether to perform a normal dispose operation. - /// - /// true for a normal dispose operation; false to finalize the handle. - protected virtual void Dispose(bool disposing) - { - if (!_disposed) - { - Stop(); - _disposed = true; - } - if (disposing) - { - GC.SuppressFinalize(this); - } - } - - /// - /// Releases all the resources used by the Provider class. - /// - public void Dispose() - { - Dispose(true); - } - } -} diff --git a/src/Tizen.Applications.DataControl/Tizen.Applications.DataControl/Results.cs b/src/Tizen.Applications.DataControl/Tizen.Applications.DataControl/Results.cs deleted file mode 100755 index f61c22606..000000000 --- a/src/Tizen.Applications.DataControl/Tizen.Applications.DataControl/Results.cs +++ /dev/null @@ -1,385 +0,0 @@ -/* - * Copyright (c) 2017 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.Applications.DataControl -{ - /// - /// This class contains the insert operation result. - /// - public class InsertResult - { - /// - /// Gets the insert data's row ID. - /// - public long RowID - { - get; - private set; - } - - /// - /// Gets the insert operation result. - /// - public bool Result - { - get; - private set; - } - - /// - /// Initializes the InsertResult class with columnNames and columnTypes. - /// - /// The inserted row ID. - /// The insert request result. - public InsertResult(long rowID, bool result) - { - RowID = rowID; - Result = result; - } - } - - /// - /// This class contains the bulk insert operation result. - /// - public class BulkInsertResult - { - /// - /// Gets the bulk insert operation result data. - /// - public BulkResultData BulkResultData - { - get; - private set; - } - - /// - /// Gets the bulk insert operation result. - /// - public bool Result - { - get; - private set; - } - - /// - /// Initializes the InsertResult class with the bulkResultData and the result. - /// - /// The bulk insert request result data. - /// The bulk insert request result. - /// Thrown in case of an invalid parameter. - public BulkInsertResult(BulkResultData bulkResultData, bool result) - { - if (result == true && (bulkResultData == null || bulkResultData.SafeBulkDataHandle.IsInvalid)) - { - ErrorFactory.ThrowException(ResultType.InvalidParameter, false, "bulkResultData"); - } - - BulkResultData = bulkResultData; - Result = result; - } - } - - /// - /// This class contains the update operation result. - /// - public class UpdateResult - { - /// - /// Gets the update operation result. - /// - public bool Result - { - get; - private set; - } - - /// - /// Initializes the UpdateResult class with the result. - /// - /// The update request result. - public UpdateResult(bool result) - { - Result = result; - } - } - - /// - /// This class contains the delete operation result. - /// - public class DeleteResult - { - /// - /// Gets the delete operation result. - /// - public bool Result - { - get; - private set; - } - - /// - /// Initializes the DeleteResult class with the result. - /// - /// The delete request result. - public DeleteResult(bool result) - { - Result = result; - } - } - - /// - /// This class contains the select operation result. - /// - public class SelectResult - { - /// - /// Gets the select operation result cursor. - /// - public ICursor ResultCursor - { - get; - private set; - } - /// - /// Gets the select operation result. - /// - public bool Result - { - get; - private set; - } - - /// - /// Initializes the SelectResult class with the cursor and the result. - /// - /// The cursor with the selected data. - /// The select request result. - /// Thrown in case of an invalid parameter. - public SelectResult(ICursor cursor, bool result) - { - int i; - - if (result == true && cursor == null) - { - ErrorFactory.ThrowException(ResultType.InvalidParameter, false, "cursor"); - } - - if (result == true && (cursor is MatrixCursor) == false) - { - if (cursor.GetColumnCount() <= 0) - { - ErrorFactory.ThrowException(ResultType.InvalidParameter, false, "column count"); - } - - for (i = 0; i < cursor.GetColumnCount(); i++) - { - if (string.IsNullOrEmpty(cursor.GetColumnName(i))) - { - ErrorFactory.ThrowException(ResultType.InvalidParameter, false, "column name index " + i.ToString()); - } - - if (cursor.GetColumnType(i) < ColumnType.ColumnTypeInt || cursor.GetColumnType(i) > ColumnType.ColumnTypeBlob) - { - ErrorFactory.ThrowException(ResultType.InvalidParameter, false, "column type index" + i.ToString()); - } - } - } - - ResultCursor = cursor; - Result = result; - } - } - - /// - /// This class contains the MapAdd operation result. - /// - public class MapAddResult - { - - /// - /// Gets the MapAdd operation result. - /// - public bool Result - { - get; - private set; - } - - /// - /// Initializes the MapAddResult class with the result. - /// - /// The MapAdd request result. - public MapAddResult(bool result) - { - Result = result; - } - } - - /// - /// This class contains the MapBulkAdd operation result. - /// - public class MapBulkAddResult - { - /// - /// Gets the MapBulkAdd operation result data. - /// - public BulkResultData BulkResultData - { - get; - private set; - } - - /// - /// Gets the MapBulkAdd operation result. - /// - public bool Result - { - get; - private set; - } - - /// - /// Initializes the MapBulkAddResult class with the bulkResultData and the result. - /// - /// The MapBulkAdd request result data. - /// The MapBulkAdd request result. - /// Thrown in case of an invalid parameter. - public MapBulkAddResult(BulkResultData bulkResultData, bool result) - { - if (result == true && (bulkResultData == null || bulkResultData.SafeBulkDataHandle.IsInvalid)) - { - ErrorFactory.ThrowException(ResultType.InvalidParameter, false, "bulkResultData"); - } - - BulkResultData = bulkResultData; - Result = result; - } - } - - /// - /// This class contains the MapSet operation result. - /// - public class MapSetResult - { - /// - /// Gets the MapSet operation result. - /// - public bool Result - { - get; - private set; - } - - /// - /// Initializes the MapSetResult class with the result. - /// - /// MapSet request result - public MapSetResult(bool result) - { - Result = result; - } - } - - /// - /// This class contains the MapRemove operation result. - /// - public class MapRemoveResult - { - /// - /// Gets the MapRemove operation result. - /// - public bool Result - { - get; - private set; - } - - /// - /// Initializes the MapRemoveResult class with the result. - /// - /// The MapRemove request result. - public MapRemoveResult(bool result) - { - Result = result; - } - } - - /// - /// This class contains the MapGet operation result. - /// - public class MapGetResult - { - /// - /// Gets the result value list of the MapGet operation. - /// - public string[] ValueList - { - get; - private set; - } - /// - /// Gets the MapGet operation result. - /// - public bool Result - { - get; - private set; - } - - /// - /// Initializes the MapGetResult class with the data and the result. - /// - /// The MapGet request result data. - /// The MapGet request result. - /// Thrown in case of an invalid parameter. - public MapGetResult(string[] valueLIst, bool result) - { - if (result == true && valueLIst == null) - { - ErrorFactory.ThrowException(ResultType.InvalidParameter, false, "valueLIst"); - } - - ValueList = valueLIst; - Result = result; - } - } - - /// - /// This class contains the DataChangeListen operation result. - /// - public class DataChangeListenResult - { - /// - /// Gets the DataChangeListen operation result. - /// - public ResultType Result - { - get; - private set; - } - - /// - /// Initializes the DataChangeListenResult class with the result. - /// - /// The DataChangeListen request result. - public DataChangeListenResult(ResultType result) - { - Result = result; - } - } -} diff --git a/src/Tizen.Applications.DataControl/Tizen.Applications.DataControl/Types.cs b/src/Tizen.Applications.DataControl/Tizen.Applications.DataControl/Types.cs deleted file mode 100755 index 6b4749fb0..000000000 --- a/src/Tizen.Applications.DataControl/Tizen.Applications.DataControl/Types.cs +++ /dev/null @@ -1,106 +0,0 @@ -/* - * Copyright (c) 2017 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.Applications.DataControl -{ - - /// - /// Enumeration for the DataControl column types. - /// - public enum ColumnType : short - { - /// - /// Value representing DataControl operation success. - /// - ColumnTypeInt = 1, - /// - /// Value representing DataControl operation success. - /// - ColumnTypeDouble = 2, - /// - /// Value representing DataControl operation success. - /// - ColumnTypeString = 3, - /// - /// Value representing DataControl operation success. - /// - ColumnTypeBlob = 4 - } - - /// - /// Enumeration for the DataControl column types. - /// - public enum ChangeType : short - { - /// - /// Value representing DataControl provider data changed by update. - /// - Update, - /// - /// Value representing DataControl provider data changed by insert. - /// - Insert, - /// - /// Value representing DataControl provider data changed by delete. - /// - Delete, - /// - /// Value representing DataControl provider data changed by map add. - /// - MapAdd, - /// - /// Value representing DataControl provider data changed by map remove. - /// - MapRemove, - /// - /// Value representing DataControl provider data changed by map set. - /// - MapSet, - } - - /// - /// Enumeration for the DataControl result types. - /// - public enum ResultType : int - { - /// - /// Value representing DataControl operation success. - /// - Success = Interop.DataControl.NativeResultType.Success, - /// - /// Value representing DataControl operation causing out of memory error. - /// - OutOfMemory = Interop.DataControl.NativeResultType.OutOfMemory, - /// - /// Value representing DataControl operation causing I/O error. - /// - IoError = Interop.DataControl.NativeResultType.IoError, - /// - /// Value representing DataControl operation causing invalid parameter error. - /// - InvalidParameter = Interop.DataControl.NativeResultType.InvalidParameter, - /// - /// Value representing DataControl operation causing permission denied error. - /// - PermissionDenied = Interop.DataControl.NativeResultType.PermissionDenied, - /// - /// Value representing DataControl operation causing max exceed error. - /// - MaxExceed = Interop.DataControl.NativeResultType.MaxExceed, - } -} diff --git a/src/Tizen.Applications.MessagePort/Interop/Interop.Libraries.cs b/src/Tizen.Applications.MessagePort/Interop/Interop.Libraries.cs deleted file mode 100755 index 2b7e4da27..000000000 --- a/src/Tizen.Applications.MessagePort/Interop/Interop.Libraries.cs +++ /dev/null @@ -1,23 +0,0 @@ -/* - * 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 MessagePort = "libmessage-port.so.1"; - } -} diff --git a/src/Tizen.Applications.MessagePort/Interop/Interop.MessagePort.cs b/src/Tizen.Applications.MessagePort/Interop/Interop.MessagePort.cs deleted file mode 100755 index 564e7ba83..000000000 --- a/src/Tizen.Applications.MessagePort/Interop/Interop.MessagePort.cs +++ /dev/null @@ -1,65 +0,0 @@ -/* - * 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; - -using Tizen.Applications; - -internal static partial class Interop -{ - internal static partial class MessagePort - { - [DllImport(Libraries.MessagePort, EntryPoint = "message_port_register_local_port", CallingConvention = CallingConvention.Cdecl)] - internal static extern int RegisterPort(string local_port, message_port_message_cb callback, IntPtr userData); - - [DllImport(Libraries.MessagePort, EntryPoint = "message_port_register_trusted_local_port", CallingConvention = CallingConvention.Cdecl)] - internal static extern int RegisterTrustedPort(string trusted_local_port, message_port_message_cb callback, IntPtr userData); - - [DllImport(Libraries.MessagePort, EntryPoint = "message_port_unregister_local_port", CallingConvention = CallingConvention.Cdecl)] - internal static extern int UnregisterPort(int local_port_id); - - [DllImport(Libraries.MessagePort, EntryPoint = "message_port_unregister_trusted_local_port", CallingConvention = CallingConvention.Cdecl)] - internal static extern int UnregisterTrustedPort(int trusted_local_port_id); - - [DllImport(Libraries.MessagePort, EntryPoint = "message_port_send_message_with_local_port", CallingConvention = CallingConvention.Cdecl)] - internal static extern int SendMessageWithLocalPort(string remote_app_id, string remote_port, SafeBundleHandle message, int local_port_id); - - [DllImport(Libraries.MessagePort, EntryPoint = "message_port_send_trusted_message_with_local_port", CallingConvention = CallingConvention.Cdecl)] - internal static extern int SendTrustedMessageWithLocalPort(string remote_app_id, string remote_port, SafeBundleHandle message, int local_port_id); - - [DllImport(Libraries.MessagePort, EntryPoint = "message_port_check_remote_port", CallingConvention = CallingConvention.Cdecl)] - internal static extern int CheckRemotePort(string remote_app_id, string remote_port, out bool exist); - - [DllImport(Libraries.MessagePort, EntryPoint = "message_port_check_trusted_remote_port", CallingConvention = CallingConvention.Cdecl)] - internal static extern int CheckTrustedRemotePort(string remote_app_id, string remote_port, out bool exist); - - [DllImport(Libraries.MessagePort, EntryPoint = "message_port_add_registered_cb", CallingConvention = CallingConvention.Cdecl)] - internal static extern int AddRegisteredCallback(string remote_app_id, string remote_port, bool trusted_remote_port, message_port_registration_event_cb callback, IntPtr userData, out int watcher_id); - - [DllImport(Libraries.MessagePort, EntryPoint = "message_port_add_unregistered_cb", CallingConvention = CallingConvention.Cdecl)] - internal static extern int AddUnregisteredCallback(string remote_app_id, string remote_port, bool trusted_remote_port, message_port_registration_event_cb callback, IntPtr userData, out int watcher_id); - - [DllImport(Libraries.MessagePort, EntryPoint = "message_port_remove_registration_event_cb", CallingConvention = CallingConvention.Cdecl)] - internal static extern int RemoveRegistrationCallback(int watcher_id); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void message_port_message_cb(int local_port_id, string remote_app_id, string remote_port, bool trusted_remote_port, IntPtr message, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void message_port_registration_event_cb(string remote_app_id, string remote_port, bool trusted_remote_port, IntPtr userData); - } -} diff --git a/src/Tizen.Applications.MessagePort/Tizen.Applications.MessagePort.csproj b/src/Tizen.Applications.MessagePort/Tizen.Applications.MessagePort.csproj deleted file mode 100755 index 020b2cb3d..000000000 --- a/src/Tizen.Applications.MessagePort/Tizen.Applications.MessagePort.csproj +++ /dev/null @@ -1,11 +0,0 @@ - - - - netstandard2.0 - - - - - - - diff --git a/src/Tizen.Applications.MessagePort/Tizen.Applications.MessagePort.sln b/src/Tizen.Applications.MessagePort/Tizen.Applications.MessagePort.sln deleted file mode 100755 index c89ef6922..000000000 --- a/src/Tizen.Applications.MessagePort/Tizen.Applications.MessagePort.sln +++ /dev/null @@ -1,40 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26430.12 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Applications.MessagePort", "Tizen.Applications.MessagePort.csproj", "{D4D1B081-7D62-4FD7-B474-216527AFC076}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen", "..\Tizen\Tizen.csproj", "{C1AF9022-830D-4FEB-B308-050568624979}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Log", "..\Tizen.Log\Tizen.Log.csproj", "{48373A14-DFEF-49CF-984F-7ED985EBF802}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Applications.Common", "..\Tizen.Applications.Common\Tizen.Applications.Common.csproj", "{3CA3AD79-049D-42EB-B9A7-3C24BB418855}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {D4D1B081-7D62-4FD7-B474-216527AFC076}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D4D1B081-7D62-4FD7-B474-216527AFC076}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D4D1B081-7D62-4FD7-B474-216527AFC076}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D4D1B081-7D62-4FD7-B474-216527AFC076}.Release|Any CPU.Build.0 = Release|Any CPU - {C1AF9022-830D-4FEB-B308-050568624979}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C1AF9022-830D-4FEB-B308-050568624979}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C1AF9022-830D-4FEB-B308-050568624979}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C1AF9022-830D-4FEB-B308-050568624979}.Release|Any CPU.Build.0 = Release|Any CPU - {48373A14-DFEF-49CF-984F-7ED985EBF802}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {48373A14-DFEF-49CF-984F-7ED985EBF802}.Debug|Any CPU.Build.0 = Debug|Any CPU - {48373A14-DFEF-49CF-984F-7ED985EBF802}.Release|Any CPU.ActiveCfg = Release|Any CPU - {48373A14-DFEF-49CF-984F-7ED985EBF802}.Release|Any CPU.Build.0 = Release|Any CPU - {3CA3AD79-049D-42EB-B9A7-3C24BB418855}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {3CA3AD79-049D-42EB-B9A7-3C24BB418855}.Debug|Any CPU.Build.0 = Debug|Any CPU - {3CA3AD79-049D-42EB-B9A7-3C24BB418855}.Release|Any CPU.ActiveCfg = Release|Any CPU - {3CA3AD79-049D-42EB-B9A7-3C24BB418855}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/src/Tizen.Applications.MessagePort/Tizen.Applications.Messages/MessagePort.cs b/src/Tizen.Applications.MessagePort/Tizen.Applications.Messages/MessagePort.cs deleted file mode 100755 index dc44e9d73..000000000 --- a/src/Tizen.Applications.MessagePort/Tizen.Applications.Messages/MessagePort.cs +++ /dev/null @@ -1,315 +0,0 @@ -/* - * 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.Collections.Generic; -using Tizen.Applications; - -namespace Tizen.Applications.Messages -{ - /// - /// The message port API provides functions to send and receive messages between applications. - /// - /// - /// The message port API provides functions for passing messages between applications. An application should register its own local port to receive messages from remote applications. - /// If a remote application sends a message, the registered callback function of the local port is called. - /// The trusted message-port API allows communications between applications that are signed by the same developer(author) certificate. - /// - public class MessagePort : IDisposable - { - private static readonly object s_lock = new object(); - private static readonly HashSet s_portMap = new HashSet(); - - // The name of the local message port - private readonly string _portName = null; - - // If true the message port is a trusted port, otherwise false it is not - private readonly bool _trusted = false; - - // The local message port ID - private int _portId = 0; - - // If true the message port is listening, otherwise false it is not - private bool _listening = false; - - private Interop.MessagePort.message_port_message_cb _messageCallBack; - - /// - /// Initializes the instance of the MessagePort class. - /// - /// 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)) - { - MessagePortErrorFactory.ThrowException((int)MessagePortError.InvalidParameter, "Invalid PortName", "PortName"); - } - _portName = portName; - _trusted = trusted; - } - - /// - /// Destructor of the MessagePort class. - /// - ~MessagePort() - { - Dispose(false); - } - - /// - /// Called when a message is received. - /// - /// - /// MessagePort messagePort = new MessagePort("SenderPort", true); - /// messagePort.MessageReceived += MessageReceivedCallback; - /// static void MessageReceivedCallback(object sender, MessageReceivedEventArgs e) - /// { - /// Console.WriteLine("Message Received "); - /// if (e.Remote.AppId != null) { - /// Console.WriteLine("from :"+e.Remote.AppId); - /// } - /// } - /// - public event EventHandler MessageReceived; - - /// - /// The name of the local message port. - /// - public string PortName - { - get - { - return _portName; - } - } - /// - /// If true, the message port is a trusted port, otherwise false. - /// - public bool Trusted - { - get - { - return _trusted; - } - } - - /// - /// If true, the message port is listening, otherwise false. - /// - public bool Listening - { - get - { - return _listening; - } - } - - /// - /// Register the local message port. - /// - /// 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) - { - if (s_portMap.Contains(_portName)) - { - MessagePortErrorFactory.ThrowException((int)MessagePortError.InvalidOperation, _portName + "is already used"); - } - _messageCallBack = (int localPortId, string remoteAppId, string remotePortName, bool trusted, IntPtr message, IntPtr userData) => - { - MessageReceivedEventArgs args = new MessageReceivedEventArgs() - { - Message = new Bundle(new SafeBundleHandle(message, false)) - }; - - if (!String.IsNullOrEmpty(remotePortName) && !String.IsNullOrEmpty(remoteAppId)) - { - args.Remote = new RemoteValues() - { - AppId = remoteAppId, - PortName = remotePortName, - Trusted = trusted - }; - } - MessageReceived?.Invoke(this, args); - }; - - _portId = _trusted ? - Interop.MessagePort.RegisterTrustedPort(_portName, _messageCallBack, IntPtr.Zero) : - Interop.MessagePort.RegisterPort(_portName, _messageCallBack, IntPtr.Zero); - - if (_portId <= 0) - MessagePortErrorFactory.ThrowException(_portId, "RegisterPort", _portName); - - s_portMap.Add(_portName); - _listening = true; - } - } - - /// - /// Unregisters the local message port. - /// - /// 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; - /// messagePort.Listen(); - /// using (var message = new Tizen.Application.Bundle()) - /// { - /// message.AddItem("message", "a_string"); - /// messagePort.Send(message, "ReceiverAppID", "ReceiverPort"); - /// } - /// messagePort.StopListening(); - /// - public void StopListening() - { - if (!_listening) - { - MessagePortErrorFactory.ThrowException((int)MessagePortError.InvalidOperation, "Already stopped"); - } - - int ret = _trusted ? - Interop.MessagePort.UnregisterTrustedPort(_portId) : - Interop.MessagePort.UnregisterPort(_portId); - - if (ret != (int)MessagePortError.None) - { - MessagePortErrorFactory.ThrowException(ret, "Error Unregister port"); - } - - lock (s_lock) - { - s_portMap.Remove(_portName); - } - _portId = 0; - _listening = false; - } - - /// - /// Sends an untrusted message to the message port of a remote application. - /// - /// The message to be passed to the remote application, the recommended message size is under 4KB. - /// The ID of the remote application. - /// The name of the remote message port. - /// Thrown 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. - /// Thrown when message has exceeded the maximum limit(4KB). - /// - /// MessagePort messagePort = new MessagePort("SenderPort", true); - /// messagePort.MessageReceived += MessageReceivedCallback; - /// messagePort.Listen(); - /// using (var message = new Tizen.Application.Bundle()) - /// { - /// message.AddItem("message", "a_string"); - /// messagePort.Send(message, "ReceiverAppID", "ReceiverPort"); - /// } - /// - public void Send(Bundle message, string remoteAppId, string remotePortName) - { - Send(message, remoteAppId, remotePortName, false); - } - - /// - /// Sends a message to the message port of a remote application. - /// - /// The message to be passed to the remote application, the recommended message size is under 4KB. - /// The ID of the remote application. - /// The name of the remote message port. - /// If true, it is the trusted message port of remote application, otherwise false. - /// Thrown 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. - /// 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; - /// messagePort.Listen(); - /// using (var message = new Tizen.Application.Bundle()) - /// { - /// message.AddItem("message", "a_string"); - /// messagePort.Send(message, "ReceiverAppID", "ReceiverPort", true); - /// } - /// - public void Send(Bundle message, string remoteAppId, string remotePortName, bool trusted) - { - if (!_listening) - { - MessagePortErrorFactory.ThrowException((int)MessagePortError.InvalidOperation, "Should start listen before send"); - } - if (message == null) - { - MessagePortErrorFactory.ThrowException((int)MessagePortError.InvalidParameter, "message is null", "Message"); - } - int ret = trusted ? - Interop.MessagePort.SendTrustedMessageWithLocalPort(remoteAppId, remotePortName, message.SafeBundleHandle, _portId) : - Interop.MessagePort.SendMessageWithLocalPort(remoteAppId, remotePortName, message.SafeBundleHandle, _portId); - - if (ret != (int)MessagePortError.None) - { - if (ret == (int)MessagePortError.MaxExceeded) - { - MessagePortErrorFactory.ThrowException(ret, "Message has exceeded the maximum limit(4KB)", "Message"); - } - MessagePortErrorFactory.ThrowException(ret, "Can't send message"); - } - } - - /// - /// Releases the unmanaged resources used by the MessagePort class specifying whether to perform a normal dispose operation. - /// - /// true for a normal dispose operation; false to finalize the handle. - protected virtual void Dispose(bool disposing) - { - if (_listening) - { - try - { - StopListening(); - } - catch (Exception e) - { - Log.Warn(GetType().Namespace, "Exception in Dispose :" + e.Message); - } - } - } - - /// - /// Releases all resources used by the MessagePort class. - /// - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - } -} diff --git a/src/Tizen.Applications.MessagePort/Tizen.Applications.Messages/MessagePortErrorFactory.cs b/src/Tizen.Applications.MessagePort/Tizen.Applications.Messages/MessagePortErrorFactory.cs deleted file mode 100755 index 5215ac1d5..000000000 --- a/src/Tizen.Applications.MessagePort/Tizen.Applications.Messages/MessagePortErrorFactory.cs +++ /dev/null @@ -1,64 +0,0 @@ -/* - * 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.CompilerServices; -using Tizen.Internals.Errors; - -namespace Tizen.Applications.Messages -{ - internal enum MessagePortError - { - None = ErrorCode.None, - IOError = ErrorCode.IoError, - OutOfMemory = ErrorCode.OutOfMemory, - InvalidParameter = ErrorCode.InvalidParameter, - InvalidOperation = ErrorCode.InvalidOperation, - PortNotFound = -0x01130000 | 0x01, - CertificateNotMatch = -0x01130000 | 0x02, - MaxExceeded = -0x01130000 | 0x03, - ResourceUnavailable = -0x01130000 | 0x04 - } - - internal static class MessagePortErrorFactory - { - private const string LogTag = "Tizen.Applications.MessagePort"; - internal static void ThrowException(int errorCode, string errorMessage = null, string paramName = null, - [CallerMemberName] string memberName = "", [CallerFilePath] string filePath = "", [CallerLineNumber] int lineNumber = 0) - { - MessagePortError err = (MessagePortError)errorCode; - if (String.IsNullOrEmpty(errorMessage)) - { - errorMessage = err.ToString(); - } - - Log.Error(LogTag, $"{memberName}({lineNumber.ToString()}) : {filePath}"); - Log.Error(LogTag, "Error : " + errorMessage); - - switch ((MessagePortError)errorCode) - { - case MessagePortError.IOError: - case MessagePortError.InvalidOperation: - case MessagePortError.PortNotFound: - case MessagePortError.ResourceUnavailable: throw new InvalidOperationException(errorMessage); - case MessagePortError.InvalidParameter: throw new ArgumentException(errorMessage, paramName); - case MessagePortError.CertificateNotMatch: throw new UnauthorizedAccessException(errorMessage); - case MessagePortError.OutOfMemory: throw new OutOfMemoryException(errorMessage); - case MessagePortError.MaxExceeded: throw new ArgumentOutOfRangeException(paramName, errorMessage); - } - } - } -} diff --git a/src/Tizen.Applications.MessagePort/Tizen.Applications.Messages/MessageReceivedEventArgs.cs b/src/Tizen.Applications.MessagePort/Tizen.Applications.Messages/MessageReceivedEventArgs.cs deleted file mode 100755 index 1f4924bc8..000000000 --- a/src/Tizen.Applications.MessagePort/Tizen.Applications.Messages/MessageReceivedEventArgs.cs +++ /dev/null @@ -1,35 +0,0 @@ -/* - * 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.Applications.Messages -{ - /// - /// An extended EventArgs class, which contains remote message port information and message. - /// - public class MessageReceivedEventArgs : EventArgs - { - /// - /// Contains AppId, port name, and trusted. - /// - public RemoteValues Remote { get; internal set; } - - /// - /// The message passed from the remote application. - /// - public Bundle Message { get; internal set; } - } -} diff --git a/src/Tizen.Applications.MessagePort/Tizen.Applications.Messages/RemotePort.cs b/src/Tizen.Applications.MessagePort/Tizen.Applications.Messages/RemotePort.cs deleted file mode 100755 index 5e9f54151..000000000 --- a/src/Tizen.Applications.MessagePort/Tizen.Applications.Messages/RemotePort.cs +++ /dev/null @@ -1,315 +0,0 @@ -/* - * Copyright (c) 2017 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. - */ - -namespace Tizen.Applications.Messages -{ - using System; - - /// - /// The RemotePort Class provides functions to get if the remote port is running and to get whether the remote port is registered or unregistered. - /// - /// 4 - public class RemotePort : IDisposable - { - private int _watcherIdForRegistered = -1; - private int _watcherIdForUnRegistered = -1; - private bool _disposed = false; - - private Interop.MessagePort.message_port_registration_event_cb _registeredCallBack; - private Interop.MessagePort.message_port_registration_event_cb _unregisteredCallBack; - - private EventHandler _remotePortRegistered; - private EventHandler _remotePortUnregistered; - - private readonly string _portName = null; - private readonly string _appId = null; - private readonly bool _trusted = false; - - private bool _isRunning = false; - - /// - /// Constructor of the RemotePort class. - /// - /// 4 - /// The Id of the remote application - /// 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)) - { - MessagePortErrorFactory.ThrowException((int)MessagePortError.InvalidParameter, "Remote Port", "AppId or PortName"); - } - - _appId = appId; - _portName = portName; - _trusted = trusted; - - _registeredCallBack = (string remoteAppId, string remotePortName, bool remoteTrusted, IntPtr userData) => - { - RemotePortStateChangedEventArgs args = new RemotePortStateChangedEventArgs() - { - Status = State.Registered - }; - - _remotePortRegistered?.Invoke(this, args); - }; - - _unregisteredCallBack = (string remoteAppId, string remotePortName, bool remoteTrusted, IntPtr userData) => - { - RemotePortStateChangedEventArgs args = new RemotePortStateChangedEventArgs() - { - Status = State.Unregistered - }; - - _remotePortUnregistered?.Invoke(this, args); - }; - } - - /// - /// Destructor of the RemotePort class. - /// - /// 4 - ~RemotePort() - { - Dispose(false); - } - - /// - /// The AppId of the remote port - /// - /// 4 - /// Return appid of RemotePort - public string AppId - { - get - { - return _appId; - } - } - - /// - /// The name of the remote message port - /// - /// 4 - /// Return name of RemotePort - public string PortName - { - get - { - return _portName; - } - } - - /// - /// If true the remote port is a trusted port, otherwise if false it is not - /// - /// 4 - /// Return true if RemotePort is trusted - public bool Trusted - { - get - { - return _trusted; - } - } - - /// - /// Check if the remote message port is running. - /// - /// 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() - { - int ret; - - ret = _trusted ? - Interop.MessagePort.CheckTrustedRemotePort(_appId, _portName, out _isRunning) : - Interop.MessagePort.CheckRemotePort(_appId, _portName, out _isRunning); - - if (ret != (int)MessagePortError.None) - { - MessagePortErrorFactory.ThrowException(ret); - } - - return _isRunning; - } - - /// - /// Called when the remote port is registered or unregistered. - /// - /// 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; - /// static void RemotePortStateChangedCallback(object sender, MessageReceivedEventArgs e) - /// { - /// switch (e.Status) - /// { - /// case State.Registered : - /// Console.WriteLine("Remote Port Registered "); - /// break; - /// case State.Unregistered : - /// Console.WriteLine("Remote Port Unregistered "); - /// break; - /// default : - /// break; - /// } - /// } - /// - public event EventHandler RemotePortStateChanged - { - add - { - if (_remotePortRegistered == null) - { - int ret = AddRegistrationCallback(); - - if (ret != (int)MessagePortError.None) - { - MessagePortErrorFactory.ThrowException(ret); - } - } - - _remotePortRegistered += value; - _remotePortUnregistered += value; - } - - remove - { - if (_remotePortRegistered?.GetInvocationList()?.Length > 0) - { - _remotePortRegistered -= value; - _remotePortUnregistered -= value; - - if (_remotePortRegistered == null) - { - RemoveRegistrationCallback(); - } - } - } - } - - private int AddRegistrationCallback() - { - if (_watcherIdForRegistered != -1) - { - Interop.MessagePort.RemoveRegistrationCallback(_watcherIdForRegistered); - _watcherIdForRegistered = -1; - } - - int ret = Interop.MessagePort.AddRegisteredCallback(_appId, _portName, _trusted, _registeredCallBack, IntPtr.Zero, out _watcherIdForRegistered); - - if (ret != (int)MessagePortError.None) - { - return ret; - } - - if (_watcherIdForUnRegistered != -1) - { - Interop.MessagePort.RemoveRegistrationCallback(_watcherIdForUnRegistered); - _watcherIdForUnRegistered = -1; - } - - ret = Interop.MessagePort.AddUnregisteredCallback(_appId, _portName, _trusted, _unregisteredCallBack, IntPtr.Zero, out _watcherIdForUnRegistered); - - if (ret != (int)MessagePortError.None) - { - return ret; - } - - return ret; - } - - private void RemoveRegistrationCallback() - { - if (_watcherIdForRegistered != -1 && _watcherIdForUnRegistered != -1) - { - int ret = Interop.MessagePort.RemoveRegistrationCallback(_watcherIdForRegistered); - - if (ret != (int)MessagePortError.None) - { - MessagePortErrorFactory.ThrowException(ret); - } - - _watcherIdForRegistered = -1; - - ret = Interop.MessagePort.RemoveRegistrationCallback(_watcherIdForUnRegistered); - - if (ret != (int)MessagePortError.None) - { - MessagePortErrorFactory.ThrowException(ret); - } - - _watcherIdForUnRegistered = -1; - } - } - - /// - /// Releases the unmanaged resources used by the RemotePort class specifying whether to perform a normal dispose operation. - /// - /// true for a normal dispose operation; false to finalize the handle. - protected virtual void Dispose(bool disposing) - { - if (_disposed) - { - return; - } - - RemoveRegistrationCallback(); - - _disposed = true; - } - - /// - /// Releases all resources used by the RemotePort class. - /// - /// 4 - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - } - - /// - /// Enumeration for Remote Message Port state type - /// - /// 4 - public enum State : Byte - { - /// - /// Value representing Remote Port state is unregistered - /// - Unregistered = 0, - /// - /// Value representing Remote Port state is registered - /// - Registered = 1 - } -} diff --git a/src/Tizen.Applications.MessagePort/Tizen.Applications.Messages/RemotePortStateChangedEventArgs.cs b/src/Tizen.Applications.MessagePort/Tizen.Applications.Messages/RemotePortStateChangedEventArgs.cs deleted file mode 100755 index b679eb8a8..000000000 --- a/src/Tizen.Applications.MessagePort/Tizen.Applications.Messages/RemotePortStateChangedEventArgs.cs +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) 2017 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. - */ - -namespace Tizen.Applications.Messages -{ - using System; - - /// - /// An extended EventArgs class which contains state of remote message port - /// - /// 4 - public class RemotePortStateChangedEventArgs : EventArgs - { - /// - /// The State of remote port - /// - /// 4 - public State Status { get; internal set; } - } -} diff --git a/src/Tizen.Applications.MessagePort/Tizen.Applications.Messages/RemoteValues.cs b/src/Tizen.Applications.MessagePort/Tizen.Applications.Messages/RemoteValues.cs deleted file mode 100755 index e1b4b3be8..000000000 --- a/src/Tizen.Applications.MessagePort/Tizen.Applications.Messages/RemoteValues.cs +++ /dev/null @@ -1,39 +0,0 @@ -/* - * 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. - */ - -namespace Tizen.Applications.Messages -{ - /// - /// Contains AppId, port name, and trusted. - /// - public class RemoteValues - { - /// - /// The ID of the remote application that sent this message. - /// - public string AppId { get; set; } - - /// - /// The name of the remote message port. - /// - public string PortName { get; set; } - - /// - /// If true, the remote port is a trusted port, otherwise, if false, it is not. - /// - public bool Trusted { get; set; } - } -} diff --git a/src/Tizen.Applications.Notification/Interop/Interop.Libraries.cs b/src/Tizen.Applications.Notification/Interop/Interop.Libraries.cs deleted file mode 100755 index d5edebdbc..000000000 --- a/src/Tizen.Applications.Notification/Interop/Interop.Libraries.cs +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2017 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 Notification = "libnotification.so.0"; - } -} diff --git a/src/Tizen.Applications.Notification/Interop/Interop.Notification.cs b/src/Tizen.Applications.Notification/Interop/Interop.Notification.cs deleted file mode 100755 index 854e1aa0c..000000000 --- a/src/Tizen.Applications.Notification/Interop/Interop.Notification.cs +++ /dev/null @@ -1,317 +0,0 @@ -/* - * Copyright (c) 2017 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; -using Tizen.Applications; -using Tizen.Applications.Notifications; - -internal static partial class Interop -{ - internal static class Notification - { - [DllImport(Libraries.Notification, EntryPoint = "notification_create")] - internal static extern IntPtr Create(NotificationType type); - - [DllImport(Libraries.Notification, EntryPoint = "notification_free")] - internal static extern NotificationError Destroy(IntPtr handle); - - [DllImport(Libraries.Notification, EntryPoint = "notification_get_text")] - internal static extern NotificationError GetTextReferenceType(NotificationSafeHandle handle, NotificationText type, out IntPtr text); - - [DllImport(Libraries.Notification, EntryPoint = "notification_set_text")] - internal static extern NotificationError SetText(NotificationSafeHandle handle, NotificationText type, string text, string key, int args); - - [DllImport(Libraries.Notification, EntryPoint = "notification_get_image")] - internal static extern NotificationError GetImageReferenceType(NotificationSafeHandle handle, NotificationImage type, out IntPtr path); - - [DllImport(Libraries.Notification, EntryPoint = "notification_set_image")] - internal static extern NotificationError SetImage(NotificationSafeHandle handle, NotificationImage type, string path); - - [DllImport(Libraries.Notification, EntryPoint = "notification_get_time")] - internal static extern NotificationError GetTime(NotificationSafeHandle handle, out int time); - - [DllImport(Libraries.Notification, EntryPoint = "notification_set_time")] - internal static extern NotificationError SetTime(NotificationSafeHandle handle, int time); - - [DllImport(Libraries.Notification, EntryPoint = "notification_get_insert_time")] - internal static extern NotificationError GetInsertTime(NotificationSafeHandle handle, out long time); - - [DllImport(Libraries.Notification, EntryPoint = "notification_get_sound")] - internal static extern NotificationError GetSoundReferenceType(NotificationSafeHandle handle, out AccessoryOption type, out IntPtr path); - - [DllImport(Libraries.Notification, EntryPoint = "notification_set_sound")] - internal static extern NotificationError SetSound(NotificationSafeHandle handle, AccessoryOption type, string path); - - [DllImport(Libraries.Notification, EntryPoint = "notification_get_vibration")] - internal static extern NotificationError GetVibrationReferenceType(NotificationSafeHandle handle, out AccessoryOption type, out IntPtr path); - - [DllImport(Libraries.Notification, EntryPoint = "notification_set_vibration")] - internal static extern NotificationError SetVibration(NotificationSafeHandle handle, AccessoryOption type, string path); - - [DllImport(Libraries.Notification, EntryPoint = "notification_get_led")] - internal static extern NotificationError GetLed(NotificationSafeHandle handle, out AccessoryOption type, out int color); - - [DllImport(Libraries.Notification, EntryPoint = "notification_set_led")] - internal static extern NotificationError SetLed(NotificationSafeHandle handle, AccessoryOption type, int color); - - [DllImport(Libraries.Notification, EntryPoint = "notification_get_led_time_period")] - internal static extern NotificationError GetLedTimePeriod(NotificationSafeHandle handle, out int onMillisecond, out int offMillisecond); - - [DllImport(Libraries.Notification, EntryPoint = "notification_set_led_time_period")] - internal static extern NotificationError SetLedTimePeriod(NotificationSafeHandle handle, int onMillisecond, int offMillisecond); - - [DllImport(Libraries.Notification, EntryPoint = "notification_get_launch_option")] - internal static extern NotificationError GetAppControl(NotificationSafeHandle handle, LaunchOption type, out SafeAppControlHandle apphandle); - - [DllImport(Libraries.Notification, EntryPoint = "notification_set_launch_option")] - internal static extern NotificationError SetAppControl(NotificationSafeHandle handle, LaunchOption type, SafeAppControlHandle appHandle); - - [DllImport(Libraries.Notification, EntryPoint = "notification_get_event_handler")] - internal static extern NotificationError GetEventHandler(NotificationSafeHandle handle, int type, out SafeAppControlHandle appHandle); - - [DllImport(Libraries.Notification, EntryPoint = "notification_set_event_handler")] - internal static extern NotificationError SetEventHandler(NotificationSafeHandle handle, int type, SafeAppControlHandle appHandle); - - [DllImport(Libraries.Notification, EntryPoint = "notification_get_property")] - internal static extern NotificationError GetProperties(NotificationSafeHandle handle, out int flags); - - [DllImport(Libraries.Notification, EntryPoint = "notification_set_property")] - internal static extern NotificationError SetProperties(NotificationSafeHandle handle, int flags); - - [DllImport(Libraries.Notification, EntryPoint = "notification_get_display_applist")] - internal static extern NotificationError GetApplist(NotificationSafeHandle handle, out int flags); - - [DllImport(Libraries.Notification, EntryPoint = "notification_set_display_applist")] - internal static extern NotificationError SetApplist(NotificationSafeHandle handle, int flags); - - [DllImport(Libraries.Notification, EntryPoint = "notification_get_size")] - internal static extern NotificationError GetProgressSize(NotificationSafeHandle handle, out double size); - - [DllImport(Libraries.Notification, EntryPoint = "notification_set_size")] - internal static extern NotificationError SetProgressSize(NotificationSafeHandle handle, double size); - - [DllImport(Libraries.Notification, EntryPoint = "notification_get_progress")] - internal static extern NotificationError GetProgress(NotificationSafeHandle handle, out double progress); - - [DllImport(Libraries.Notification, EntryPoint = "notification_set_progress")] - internal static extern NotificationError SetProgress(NotificationSafeHandle handle, double progress); - - [DllImport(Libraries.Notification, EntryPoint = "notification_get_layout")] - internal static extern NotificationError GetLayout(NotificationSafeHandle handle, out NotificationLayout layout); - - [DllImport(Libraries.Notification, EntryPoint = "notification_set_layout")] - internal static extern NotificationError SetLayout(NotificationSafeHandle handle, NotificationLayout layout); - - [DllImport(Libraries.Notification, EntryPoint = "notification_get_type")] - internal static extern NotificationError GetType(NotificationSafeHandle handle, out NotificationType type); - - [DllImport(Libraries.Notification, EntryPoint = "notification_update")] - internal static extern NotificationError Update(NotificationSafeHandle handle); - - [DllImport(Libraries.Notification, EntryPoint = "notification_delete")] - internal static extern NotificationError Delete(NotificationSafeHandle handle); - - [DllImport(Libraries.Notification, EntryPoint = "notification_delete_all")] - internal static extern NotificationError DeleteAll(int type); - - [DllImport(Libraries.Notification, EntryPoint = "notification_post")] - internal static extern NotificationError Post(NotificationSafeHandle handle); - - [DllImport(Libraries.Notification, EntryPoint = "notification_get_pkgname")] - internal static extern NotificationError GetPackageName(NotificationSafeHandle handle, out IntPtr name); - - [DllImport(Libraries.Notification, EntryPoint = "notification_set_event_handler")] - internal static extern NotificationError AddButtonAction(NotificationSafeHandle handle, ButtonIndex type, SafeAppControlHandle appcontrol); - - [DllImport(Libraries.Notification, EntryPoint = "notification_remove_button")] - internal static extern NotificationError RemoveButton(NotificationSafeHandle handle, ButtonIndex index); - - [DllImport(Libraries.Notification, EntryPoint = "notification_set_tag")] - internal static extern NotificationError SetTag(NotificationSafeHandle handle, string tag); - - [DllImport(Libraries.Notification, EntryPoint = "notification_get_tag")] - internal static extern NotificationError GetTagReferenceType(NotificationSafeHandle handle, out IntPtr tag); - - [DllImport(Libraries.Notification, EntryPoint = "notification_load_by_tag")] - internal static extern IntPtr Load(string text); - - [DllImport(Libraries.Notification, EntryPoint = "notification_get_id")] - internal static extern NotificationError GetID(NotificationSafeHandle handle, out int groupID, out int privID); - - [DllImport(Libraries.Notification, EntryPoint = "notification_set_priv_id")] - internal static extern NotificationError SetID(NotificationSafeHandle handle, int privID); - - [DllImport(Libraries.Notification, EntryPoint = "notification_save_as_template")] - internal static extern NotificationError SaveTemplate(NotificationSafeHandle handle, string name); - - [DllImport(Libraries.Notification, EntryPoint = "notification_create_from_template")] - internal static extern IntPtr LoadTemplate(string name); - - [DllImport(Libraries.Notification, EntryPoint = "notification_get_noti_block_state")] - internal static extern NotificationError GetBlockState(out NotificationBlockState status); - - [DllImport(Libraries.Notification, EntryPoint = "notification_set_auto_remove")] - internal static extern NotificationError SetAutoRemove(NotificationSafeHandle handle, bool autoRemove); - - [DllImport(Libraries.Notification, EntryPoint = "notification_get_auto_remove")] - internal static extern NotificationError GetAutoRemove(NotificationSafeHandle handle, out bool autoRemove); - - [DllImport(Libraries.Notification, EntryPoint = "notification_set_ongoing_value_type")] - internal static extern NotificationError SetProgressType(NotificationSafeHandle handle, ProgressCategory category); - - [DllImport(Libraries.Notification, EntryPoint = "notification_get_ongoing_value_type")] - internal static extern NotificationError GetProgressType(NotificationSafeHandle handle, out ProgressCategory category); - - [DllImport(Libraries.Notification, EntryPoint = "notification_set_ongoing_flag")] - internal static extern NotificationError SetOngoingFlag(NotificationSafeHandle handle, bool flag); - - [DllImport(Libraries.Notification, EntryPoint = "notification_get_ongoing_flag")] - internal static extern NotificationError GetProgressFlag(NotificationSafeHandle handle, bool flag); - - [DllImport(Libraries.Notification, EntryPoint = "notification_get_ongoing_flag")] - internal static extern NotificationError GetProgressFlag(NotificationSafeHandle handle, out bool flag); - - [DllImport(Libraries.Notification, EntryPoint = "notification_set_text_input")] - internal static extern NotificationError SetPlaceHolderLength(NotificationSafeHandle handle, int length); - - [DllImport(Libraries.Notification, EntryPoint = "notification_get_text_input_max_length")] - internal static extern NotificationError GetPlaceHolderLength(NotificationSafeHandle handle, out int length); - - [DllImport(Libraries.Notification, EntryPoint = "notification_get_hide_timeout")] - internal static extern NotificationError GetHideTime(NotificationSafeHandle handle, out int timeout); - - [DllImport(Libraries.Notification, EntryPoint = "notification_set_hide_timeout")] - internal static extern NotificationError SetHideTime(NotificationSafeHandle handle, int timeout); - - [DllImport(Libraries.Notification, EntryPoint = "notification_get_delete_timeout")] - internal static extern NotificationError GetDeleteTime(NotificationSafeHandle handle, out int timeout); - - [DllImport(Libraries.Notification, EntryPoint = "notification_set_delete_timeout")] - internal static extern NotificationError SetDeleteTime(NotificationSafeHandle handle, int timeout); - - [DllImport(Libraries.Notification, EntryPoint = "notification_set_extention_data")] - internal static extern NotificationError SetExtentionData(NotificationSafeHandle handle, string key, SafeBundleHandle bundleHandle); - - [DllImport(Libraries.Notification, EntryPoint = "notification_get_extention_data")] - internal static extern NotificationError GetExtentionData(NotificationSafeHandle handle, string key, out SafeBundleHandle bundleHandle); - - [DllImport(Libraries.Notification, EntryPoint = "notification_get_args")] - internal static extern NotificationError GetExtentionBundle(NotificationSafeHandle handle, out IntPtr args, out IntPtr group_args); - - [DllImport(Libraries.Notification, EntryPoint = "notification_get_default_button")] - internal static extern NotificationError GetDefaultButton(NotificationSafeHandle handle, out int index); - - [DllImport(Libraries.Notification, EntryPoint = "notification_set_default_button")] - internal static extern NotificationError SetDefaultButton(NotificationSafeHandle handle, int index); - - [DllImport(Libraries.Notification, EntryPoint = "notification_set_extension_event_handler")] - internal static extern NotificationError SetExtensionAction(NotificationSafeHandle handle, NotificationEventType type, SafeAppControlHandle appcontrol); - - [DllImport(Libraries.Notification, EntryPoint = "notification_get_extension_event_handler")] - internal static extern NotificationError GetExtensionAction(NotificationSafeHandle handle, NotificationEventType type, out SafeAppControlHandle appcontrol); - - internal static NotificationError GetText(NotificationSafeHandle handle, NotificationText type, out string text) - { - NotificationError ret; - IntPtr ptr; - ret = GetTextReferenceType(handle, type, out ptr); - - if (ptr == IntPtr.Zero) - { - text = null; - } - else - { - text = Marshal.PtrToStringAnsi(ptr); - } - - return ret; - } - - internal static NotificationError GetImage(NotificationSafeHandle handle, NotificationImage type, out string path) - { - NotificationError ret; - IntPtr ptr; - ret = GetImageReferenceType(handle, type, out ptr); - - if (ptr == IntPtr.Zero) - { - path = null; - } - else - { - path = Marshal.PtrToStringAnsi(ptr); - } - - return ret; - } - - internal static NotificationError GetSound(NotificationSafeHandle handle, out AccessoryOption type, out string path) - { - NotificationError ret; - IntPtr ptr; - ret = GetSoundReferenceType(handle, out type, out ptr); - - if (ptr == IntPtr.Zero) - { - path = null; - } - else - { - path = Marshal.PtrToStringAnsi(ptr); - } - - return ret; - } - - internal static NotificationError GetVibration(NotificationSafeHandle handle, out AccessoryOption type, out string path) - { - NotificationError ret; - IntPtr ptr; - ret = GetVibrationReferenceType(handle, out type, out ptr); - - if (ptr == IntPtr.Zero) - { - path = null; - } - else - { - path = Marshal.PtrToStringAnsi(ptr); - } - - return ret; - } - - internal static NotificationError GetTag(NotificationSafeHandle handle, out string tag) - { - NotificationError ret; - IntPtr ptr; - ret = GetTagReferenceType(handle, out ptr); - - if (ptr == IntPtr.Zero) - { - tag = null; - } - else - { - tag = Marshal.PtrToStringAnsi(ptr); - } - - return ret; - } - } -} diff --git a/src/Tizen.Applications.Notification/Tizen.Applications.Notification.csproj b/src/Tizen.Applications.Notification/Tizen.Applications.Notification.csproj deleted file mode 100755 index 020b2cb3d..000000000 --- a/src/Tizen.Applications.Notification/Tizen.Applications.Notification.csproj +++ /dev/null @@ -1,11 +0,0 @@ - - - - netstandard2.0 - - - - - - - diff --git a/src/Tizen.Applications.Notification/Tizen.Applications.Notification.sln b/src/Tizen.Applications.Notification/Tizen.Applications.Notification.sln deleted file mode 100755 index 03316805c..000000000 --- a/src/Tizen.Applications.Notification/Tizen.Applications.Notification.sln +++ /dev/null @@ -1,40 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26430.12 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Applications.Notification", "Tizen.Applications.Notification.csproj", "{DB7A1051-D52D-4A42-8817-7A61E35E2FE6}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Applications.Common", "..\Tizen.Applications.Common\Tizen.Applications.Common.csproj", "{5C021594-8AFF-4E71-B5F7-D3E565825BEF}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen", "..\Tizen\Tizen.csproj", "{593C96BE-8C68-490F-982E-952617901774}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Log", "..\Tizen.Log\Tizen.Log.csproj", "{78C34A63-D5BE-48E8-BBB5-76FCBEE65AD1}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {DB7A1051-D52D-4A42-8817-7A61E35E2FE6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {DB7A1051-D52D-4A42-8817-7A61E35E2FE6}.Debug|Any CPU.Build.0 = Debug|Any CPU - {DB7A1051-D52D-4A42-8817-7A61E35E2FE6}.Release|Any CPU.ActiveCfg = Release|Any CPU - {DB7A1051-D52D-4A42-8817-7A61E35E2FE6}.Release|Any CPU.Build.0 = Release|Any CPU - {5C021594-8AFF-4E71-B5F7-D3E565825BEF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {5C021594-8AFF-4E71-B5F7-D3E565825BEF}.Debug|Any CPU.Build.0 = Debug|Any CPU - {5C021594-8AFF-4E71-B5F7-D3E565825BEF}.Release|Any CPU.ActiveCfg = Release|Any CPU - {5C021594-8AFF-4E71-B5F7-D3E565825BEF}.Release|Any CPU.Build.0 = Release|Any CPU - {593C96BE-8C68-490F-982E-952617901774}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {593C96BE-8C68-490F-982E-952617901774}.Debug|Any CPU.Build.0 = Debug|Any CPU - {593C96BE-8C68-490F-982E-952617901774}.Release|Any CPU.ActiveCfg = Release|Any CPU - {593C96BE-8C68-490F-982E-952617901774}.Release|Any CPU.Build.0 = Release|Any CPU - {78C34A63-D5BE-48E8-BBB5-76FCBEE65AD1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {78C34A63-D5BE-48E8-BBB5-76FCBEE65AD1}.Debug|Any CPU.Build.0 = Debug|Any CPU - {78C34A63-D5BE-48E8-BBB5-76FCBEE65AD1}.Release|Any CPU.ActiveCfg = Release|Any CPU - {78C34A63-D5BE-48E8-BBB5-76FCBEE65AD1}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/Notification.cs b/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/Notification.cs deleted file mode 100755 index 3064dcab8..000000000 --- a/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/Notification.cs +++ /dev/null @@ -1,510 +0,0 @@ -/* - * Copyright (c) 2017 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. - */ - -namespace Tizen.Applications.Notifications -{ - using System; - using System.Collections.Generic; - using System.ComponentModel; - - /// - /// This class contains common properties and methods of notifications. - /// - /// - /// A notification is a message that is displayed on the notification area. - /// It is created to notify information to the user through the application. - /// This class helps you to provide method and property for creating notification object. - /// - public sealed partial class Notification : IDisposable - { - internal static readonly string LogTag = "Tizen.Applications.Notification"; - - private NotificationSafeHandle safeHandle; - private bool disposed = false; - - private IDictionary styleDictionary; - private IDictionary extraDataDictionary; - private int count = 0; - - /// - /// Initializes a new instance of the class. - /// - public Notification() - { - styleDictionary = new Dictionary(); - extraDataDictionary = new Dictionary(); - } - - /// - /// Gets or sets the tag of notification. - /// - public string Tag { get; set; } = string.Empty; - - /// - /// Gets or sets the title of notification. - /// - public string Title { get; set; } = string.Empty; - - /// - /// Gets or sets the icon of notification. - /// You should set an absolute path for an image file. - /// - public string Icon { get; set; } = string.Empty; - - /// - /// Gets or sets the sub icon of notification. - /// This SubIcon is displayed in Icon you set. - /// You should set an absolute path for an image file. - /// - public string SubIcon { get; set; } = string.Empty; - - /// - /// Gets or sets the content of notification. - /// - public string Content { get; set; } = string.Empty; - - /// - /// Gets or sets a value indicating whether TimeStamp of the notification is Visible or not. - /// Default to true. - /// - public bool IsTimeStampVisible { get; set; } = true; - - /// - /// Gets or sets the TimeStamp of notification. - /// - /// - /// If you don't set TimeStamp, it will set the value when the notification is posted. - /// TimeStamp requires NotificationManager.Post() to be called. - /// If you set IsVisibleTimeStamp property to false, TimeStamp is not visible in notification. - /// - public DateTime TimeStamp { get; set; } - - /// - /// Gets or sets action, which is invoked when the notification is clicked. - /// - /// - /// If you set it to null, the already set AppControl will be removed and nothing will happen when you click on notification. - /// - /// - public AppControl Action { get; set; } - - /// - /// Gets or sets count, which is displayed at the right side of the notification. - /// - /// - /// You must set only positive number. - /// If you set count to negative number, this property throws exception. - /// - /// Thrown when argument is invalid. - public int Count - { - get - { - return count; - } - - set - { - if (value < 0) - { - Log.Error(LogTag, "Count value is negative"); - throw NotificationErrorFactory.GetException(NotificationError.InvalidParameter, "The Count must be a positive integer."); - } - - count = value; - } - } - - [EditorBrowsable(EditorBrowsableState.Never)] - public bool IsOngoing { get; set; } = false; - - /// - /// Gets or sets property. - /// - /// - public NotificationProperty Property { get; set; } = NotificationProperty.None; - - /// - /// Gets or sets object for display at notification. - /// - /// - public ProgressType Progress { get; set; } - - /// - /// Gets or sets which is included vibration, LED and sound option to be applied at notification. - /// - /// - /// If you set it to null, the already set AccessorySet will be initialized. - /// - /// - /// - /// Notification notification = new Notification - /// { - /// Title = "Notification", - /// Content = "Hello Tizen", - /// Icon = "Icon path", - /// Count = 3 - /// }; - /// - /// Notification.AccessorySet accessory = new Notification.AccessorySet - /// { - /// SoundOption = AccessoryOption.Custom, - /// SoundPath = "Sound File Path", - /// IsVibration = true, - /// LedOption = AccessoryOption.Custom, - /// LedOnMs = 100; - /// LedOffMs = 50; - /// LedColor = Color.Lime - /// }; - /// - /// notification.Accessory = accessory; - /// - /// NotificationManager.Post(notification); - /// - /// - public AccessorySet Accessory { get; set; } - - /// - /// Gets or sets a value indicating whether notification is displayed on the default viewer. - /// If you set false and add style, you can see only style notification. - /// - public bool IsVisible { get; set; } = true; - - /// - /// Gets or sets NotificationSafeHandle. - /// - internal NotificationSafeHandle Handle - { - get - { - return safeHandle; - } - - set - { - if (value == null) - { - Log.Error(LogTag, "Invalid argument NotificationSafeHandle"); - throw NotificationErrorFactory.GetException(NotificationError.InvalidParameter, "invalid argument to set NotificationSafeHandle"); - } - - safeHandle = value; - } - } - - /// - /// Gets or sets private ID. - /// - internal int PrivID { get; set; } = -1; - - /// - /// Method for adding various styles to be applied to notification. - /// - /// - /// The user always see about valid notification style. If you add a style which is not supported in platform, - /// this method has no effect. - /// - /// The style to be applied to notification. - /// Thrown when argument is invalid. - /// - /// - /// Notification notification = new Notification - /// { - /// Title = "Notification", - /// Content = "Hello Tizen", - /// Icon = "Icon path", - /// Count = 3 - /// }; - /// - /// Notification.LockStyle lockStyle = new Notification.LockStyle - /// { - /// IconPath = "Icon path", - /// ThumbnailPath = "Thumbnail Path" - /// }; - /// - /// notification.AddStyle(lockStyle); - /// - /// NotificationManager.Post(notification); - /// - /// - public void AddStyle(StyleBase style) - { - if (style == null) - { - throw NotificationErrorFactory.GetException(NotificationError.InvalidParameter, "invalid parameter entered"); - } - - if (styleDictionary.ContainsKey(style.Key) == true) - { - Log.Info(LogTag, "The Style is existed, so extender data is replaced"); - styleDictionary.Remove(style.Key); - styleDictionary.Add(style.Key, style); - } - else - { - styleDictionary.Add(style.Key, style); - } - } - - /// - /// Method to remove style you already added. - /// - /// Type of notification style to be queried. - /// Thrown when argument is invalid. - public void RemoveStyle() where T : Notification.StyleBase, new() - { - T type = new T(); - - if (styleDictionary.ContainsKey(type.Key)) - { - styleDictionary.Remove(type.Key); - } - else - { - Log.Error(LogTag, "Sytle Can't be removed, there is no style matched input key"); - throw NotificationErrorFactory.GetException(NotificationError.InvalidParameter, "invalid parameter entered"); - } - } - - /// - /// Method to get style you already added. - /// - /// Type of notification style to be queried. - /// - /// The Notification.Style object associated with the given style. - /// - /// Thrown when argument is invalid. - public T GetStyle() where T : Notification.StyleBase, new() - { - T type = new T(); - StyleBase style = null; - - styleDictionary.TryGetValue(type.Key, out style); - - if (style == null) - { - Log.Error(LogTag, "Invalid Style"); - throw NotificationErrorFactory.GetException(NotificationError.InvalidParameter, "invalid parameter entered"); - } - else - { - return style as T; - } - } - - /// - /// Method to set extra data to add extra data. - /// - /// - /// The type of extra data is bundle. - /// - /// The key of the extra data you want to add. - /// The value you want to add. - /// Thrown when argument is invalid. - /// - /// - /// Notification notification = new Notification - /// { - /// Title = "Notification", - /// Content = "Hello Tizen", - /// Icon = "Icon path", - /// }; - /// - /// Bundle bundle = new Bundle(); - /// bundle.AddItem("key", "value"); - /// - /// notification.SetExtraData("firstKey", bundle); - /// - /// - public void SetExtraData(string key, Bundle value) - { - if (value == null || value.SafeBundleHandle.IsInvalid || string.IsNullOrEmpty(key)) - { - throw NotificationErrorFactory.GetException(NotificationError.InvalidParameter, "invalid parameter entered"); - } - - if (extraDataDictionary.ContainsKey(key) == true) - { - Log.Info(LogTag, "The key is existed, so extender data is replaced"); - extraDataDictionary.Remove(key); - extraDataDictionary.Add(key, value); - } - else - { - extraDataDictionary.Add(key, value); - } - } - - /// - /// Method to remove extra you already added. - /// - /// - /// The type of extra data is bundle. - /// - /// The key of the extra data to add. - /// Thrown when argument is invalid. - public void RemoveExtraData(string key) - { - if (string.IsNullOrEmpty(key)) - { - throw NotificationErrorFactory.GetException(NotificationError.InvalidParameter, "invalid parameter entered"); - } - - if (extraDataDictionary.ContainsKey(key)) - { - extraDataDictionary.Remove(key); - } - else - { - throw NotificationErrorFactory.GetException(NotificationError.InvalidParameter, "invalid parameter entered"); - } - } - - /// - /// Method to get extra data you already set. - /// - /// The key of the extra data to get. - /// Bundle Object that include extra data - /// Thrown when argument is invalid. - public Bundle GetExtraData(string key) - { - if (string.IsNullOrEmpty(key)) - { - throw NotificationErrorFactory.GetException(NotificationError.InvalidParameter, "invalid parameter entered"); - } - - Bundle bundle; - if (extraDataDictionary.TryGetValue(key, out bundle) == false) - { - throw NotificationErrorFactory.GetException(NotificationError.InvalidParameter, "invalid parameter entered : " + key); - } - - return bundle; - } - - /// - /// Releases any unmanaged resources used by this object. - /// - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - - internal void Dispose(bool disposing) - { - if (disposed) - { - return; - } - - if (disposing) - { - Handle.Dispose(); - } - - disposed = true; - } - - internal IDictionary GetStyleDictionary() - { - return styleDictionary; - } - - internal IDictionary GetextraDataDictionary() - { - return extraDataDictionary; - } - - internal StyleBase GetStyle(string key) - { - if (string.IsNullOrEmpty(key)) - { - throw NotificationErrorFactory.GetException(NotificationError.InvalidParameter, "Key is null or empty"); - } - - StyleBase style = null; - bool ret = styleDictionary.TryGetValue(key, out style); - if (ret == false) - { - throw NotificationErrorFactory.GetException(NotificationError.InvalidParameter, "The Style object matched input key is not existed"); - } - - return style; - } - - internal void Make() - { - NotificationBinder.BindObject(this); - - foreach (string key in GetextraDataDictionary().Keys) - { - Log.Info(LogTag, "Start to bind Notification.ExtenderData to SafeHandle"); - Interop.Notification.SetExtentionData(Handle, key, extraDataDictionary[key].SafeBundleHandle); - } - - foreach (Notification.StyleBase style in styleDictionary.Values) - { - Log.Info(LogTag, "Start to bind Notification.Style to SafeHandle [" + style.Key + "]"); - style.Make(this); - } - - if (Accessory != null) - { - Log.Info(LogTag, "Start to bind Notification.AccessetSet to SafeHandle"); - Accessory.Make(this); - } - - if (Progress != null) - { - Log.Info(LogTag, "Start to bind Notification.Progress to SafeHandle"); - Progress.Make(this); - } - } - - internal Notification Build() - { - IntPtr extention = IntPtr.Zero; - IntPtr extentionBundlePtr = IntPtr.Zero; - - NotificationBinder.BindSafeHandle(this); - - Interop.Notification.GetExtentionBundle(Handle, out extention, out extentionBundlePtr); - - if (extention != IntPtr.Zero) - { - Bundle bundle = new Bundle(new SafeBundleHandle(extention, false)); - foreach (string key in bundle.Keys) - { - if (key.StartsWith("_NOTIFICATION_EXTENSION_EVENT_")) - continue; - - SafeBundleHandle sbh; - Interop.Notification.GetExtentionData(Handle, key, out sbh); - extraDataDictionary.Add(key, new Bundle(sbh)); - } - } - - ProgressBinder.BindSafeHandle(this); - AccessorySetBinder.BindSafeHandle(this); - IndicatorBinder.BindSafeHandle(this); - ActiveBinder.BindSafeHandle(this); - LockBinder.BindSafehandle(this); - - return this; - } - } -} diff --git a/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationAccessorySet.cs b/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationAccessorySet.cs deleted file mode 100755 index ef94adafd..000000000 --- a/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationAccessorySet.cs +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Copyright (c) 2017 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. - */ - -namespace Tizen.Applications.Notifications -{ - using Tizen.Common; - - /// - /// This class contains common properties and methods of notifications. - /// - /// - /// A notification is a message that is displayed on the notification area. - /// It is created to notify information to the user through the application. - /// This class helps you to provide method and property for creating notification object. - /// - public sealed partial class Notification - { - /// - /// Class for notification AccessorySet, which includes vibration, LED, and sound option. - /// - public sealed class AccessorySet : MakerBase - { - /// - /// Gets or sets the sound option. Default to AccessoryOption.Off. - /// - /// - /// If you set AccessoryOption.Custom, you must the SoundPath. Otherwise, an exception is thrown. - /// - public AccessoryOption SoundOption { get; set; } = AccessoryOption.Off; - - /// - /// Gets or sets the sound path, It will play on the sound file you set. - /// You should set an absolute path for a sound file. - /// - public string SoundPath { get; set; } - - /// - /// Gets or sets a value indicating whether vibration is operated. Default is false. - /// - public bool CanVibrate { get; set; } = false; - - /// - /// Gets or sets the led option. The default value is AccessoryOption.Off. - /// - /// - /// If you set AccessoryOption.Custom and not set LedColor, the LED will show default color. - /// - public AccessoryOption LedOption { get; set; } = AccessoryOption.Off; - - /// - /// Gets or sets the on time so that it looks like the device's LED is blinking. - /// - /// - /// Default value of LedOnMillisecond is 0. - /// The rate is specified in terms of the number of Milliseconds to be on. - /// You must set the on and off times at the same time. Otherwise, it may not operate normally. - /// - public int LedOnMillisecond { get; set; } - - /// - /// Gets or sets the off time so that it looks like the device's LED is blinking. - /// - /// - /// The rate is specified in terms of the number of Milliseconds to be off. - /// You must set the on and off times at the same time. Otherwise, it may not operate normally. - /// - public int LedOffMillisecond { get; set; } - - /// - /// Gets or sets the LED color that you would like the LED on the device to blink. - /// - /// - /// If you want to set LedColor, you should always set LedOption as AccessoryOption.Custom, otherwise, it may operate default LED color. - /// - public Color LedColor { get; set; } - - internal override void Make(Notification notification) - { - AccessorySetBinder.BindObject(notification); - } - } - } -} diff --git a/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationAccessorySetBinder.cs b/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationAccessorySetBinder.cs deleted file mode 100755 index 91e22824d..000000000 --- a/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationAccessorySetBinder.cs +++ /dev/null @@ -1,144 +0,0 @@ -/* - * Copyright (c) 2017 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. - */ - -namespace Tizen.Applications.Notifications -{ - using Tizen.Common; - - internal static class AccessorySetBinder - { - internal static void BindObject(Notification notification) - { - BindLedToHandle(notification); - BindSoundToHandle(notification); - BindVibrationToHandle(notification); - } - - internal static void BindSafeHandle(Notification notification) - { - Notification.AccessorySet accessory = new Notification.AccessorySet(); - BindHandleToLed(notification, accessory); - BindHandleToSound(notification, accessory); - BindHandleToVibration(notification, accessory); - notification.Accessory = accessory; - } - - private static void BindLedToHandle(Notification notification) - { - NotificationError ret = NotificationError.None; - Notification.AccessorySet accessory = notification.Accessory; - - ret = Interop.Notification.SetLed(notification.Handle, accessory.LedOption, 0); - if (ret != NotificationError.None) - { - throw NotificationErrorFactory.GetException(ret, "unable to set led"); - } - - ret = Interop.Notification.SetLedTimePeriod(notification.Handle, accessory.LedOnMillisecond, accessory.LedOffMillisecond); - if (ret != NotificationError.None) - { - throw NotificationErrorFactory.GetException(ret, "unable to set led period"); - } - - if (notification.Accessory.LedOption == AccessoryOption.Custom) - { - Color color = accessory.LedColor; - ret = Interop.Notification.SetLed(notification.Handle, AccessoryOption.Custom, color.GetArgb()); - if (ret != NotificationError.None) - { - throw NotificationErrorFactory.GetException(ret, "unable to set led color"); - } - } - } - - private static void BindVibrationToHandle(Notification notification) - { - Notification.AccessorySet accessory = notification.Accessory; - if (accessory.CanVibrate == false) - { - Interop.Notification.SetVibration(notification.Handle, AccessoryOption.Off, null); - } - else - { - Interop.Notification.SetVibration(notification.Handle, AccessoryOption.On, null); - } - } - - private static void BindSoundToHandle(Notification notification) - { - Notification.AccessorySet accessory = notification.Accessory; - - if (accessory.SoundOption == AccessoryOption.Custom && string.IsNullOrEmpty(accessory.SoundPath)) - { - throw NotificationErrorFactory.GetException(NotificationError.InvalidParameter, "If the option is set to Custom, the path must also be set."); - } - - NotificationError ret = Interop.Notification.SetSound(notification.Handle, accessory.SoundOption, accessory.SoundPath); - if (ret != NotificationError.None) - { - throw NotificationErrorFactory.GetException(ret, "unable to set sound"); - } - } - - private static void BindHandleToLed(Notification notification, Notification.AccessorySet accessory) - { - AccessoryOption type; - int argb; - Interop.Notification.GetLed(notification.Handle, out type, out argb); - - accessory.LedOption = type; - if (type == AccessoryOption.Custom) - { - accessory.LedColor = new Color(argb >> 16 & 255, argb >> 8 & 255, argb >> 0 & 255, argb >> 24 & 255); - } - - int onMillisecond, offMillisecond; - Interop.Notification.GetLedTimePeriod(notification.Handle, out onMillisecond, out offMillisecond); - accessory.LedOnMillisecond = onMillisecond; - accessory.LedOffMillisecond = offMillisecond; - } - - private static void BindHandleToSound(Notification notification, Notification.AccessorySet accessory) - { - AccessoryOption type; - string path; - - Interop.Notification.GetSound(notification.Handle, out type, out path); - - accessory.SoundOption = type; - if (type == AccessoryOption.Custom) - { - accessory.SoundPath = path; - } - } - - private static void BindHandleToVibration(Notification notification, Notification.AccessorySet accessory) - { - AccessoryOption type; - string path; - - Interop.Notification.GetVibration(notification.Handle, out type, out path); - if (type == AccessoryOption.Off) - { - accessory.CanVibrate = false; - } - else - { - accessory.CanVibrate = true; - } - } - } -} \ No newline at end of file diff --git a/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationActiveStyle.cs b/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationActiveStyle.cs deleted file mode 100755 index 66a716377..000000000 --- a/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationActiveStyle.cs +++ /dev/null @@ -1,298 +0,0 @@ -/* - * Copyright (c) 2017 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. - */ - -namespace Tizen.Applications.Notifications -{ - using System.Collections.Generic; - - /// - /// This class contains common properties and methods of notifications. - /// - /// - /// A notification is a message that is displayed on the notification area. - /// It is created to notify information to the user through the application. - /// This class helps you to provide method and property for creating notification object. - /// - public sealed partial class Notification - { - /// - /// Class for generating active style notification. - /// - public sealed class ActiveStyle : StyleBase - { - private IDictionary buttonDictionary; - private int hideTimeout = 0; - private int deleteTimeout = 0; - - /// - /// Initializes a new instance of the class. - /// - public ActiveStyle() - { - buttonDictionary = new Dictionary(); - } - - /// - /// Gets or sets an absolute path for an image file to display on the background of active notification. - /// - public string BackgroundImage { get; set; } - - /// - /// Gets or sets a value indicating whether the active notification is removed automatically. Default value is true. - /// - /// - /// IsAutoRemove option lets the active notification to be removed several seconds after it shows. - /// When 'IsAutoRemove' is set as false, the active notification will not be removed as long as the user removes - /// it or the application, which posted the active notification. - /// > - public bool IsAutoRemove { get; set; } = true; - - /// - /// Gets or sets the default button to display highlight on the active notification. - /// - /// - /// The default button for display highlight is only reflected on the Tizen TV. - /// If you use this property on other profile, this value has no effect. - /// - public ButtonIndex DefaultButton { get; set; } = ButtonIndex.None; - - /// - /// Gets or sets a ReplyAction to this active notification style. - /// - /// - /// When you add a ReplyAction to the ActiveStyle, the notification UI will show a ReplyAction with button. - /// If you set null parameter, ReplyAction is not displayed. - /// - /// - /// - /// - /// ButtonAction button = new ButtonAction - /// { - /// Index = ButtonIndex.First, - /// Text = "Yes" - /// Action = new AppControl{ ApplicationId = "org.tizen.app" }; - /// }; - /// - /// ReplyAction reply = new ReplyAction - /// { - /// ParentIndex = ButtonIndex.First; - /// PlaceHolderText = "Please write your reply." - /// ReplyMax = 160, - /// Button = new ButtonAction - /// { - /// Text = "Yes", - /// ImagePath = "image path" - /// Action = new AppControl{ ApplicationId = "org.tizen.app" }; - /// }; - /// }; - /// - /// ActiveStyle active = new ActiveStyle - /// { - /// AutoRemove = true, - /// BackgroundImage = "image path", - /// ReplyAction = reply - /// }; - /// - /// active.AddButtonAction(button); - /// - /// - public ReplyAction ReplyAction { get; set; } - - /// - /// Gets or sets Action which is invoked when notification is hidden by user. - /// - /// - /// If you set it to null, the already set AppControl will be removed and nothing will happen when notification is hidden by user. - /// The property is only reflected on Tizen TV. - /// If you use this API on other profile, this action have no effect - /// - /// - public AppControl HiddenByUserAction { get; set; } - - /// - /// Gets or sets Action which is invoked when there is no any response by user until hide timeout. - /// - /// - /// This action occurs when there is no response to the notification until the delete timeout set by SetRemoveTime(). - /// If you set it to null, the already set AppControl will be removed and nothing will happen when notification is hidden by timeout. - /// The property is only reflected on Tizen TV. - /// If you use this API on other profile, this action settings have no effect - /// - /// - public AppControl HiddenByTimeoutAction { get; set; } - - /// - /// Gets or sets Action which is invoked when the notification is hidden by external factor. - /// - /// - /// If you set it to null, the already set AppControl will be removed and nothing will happen when notification is hidden by external factor. - /// The property is only reflected on Tizen TV. - /// If you use this API on other profile, this action settings have no effect - /// - /// - public AppControl HiddenByExternalAction { get; set; } - - /// - /// Gets the key of ActiveStyle. - /// - internal override string Key - { - get - { - return "Active"; - } - } - - /// - /// Method to set time to hide or delete notification. - /// - /// - /// The time settings for hiding and deleting are only reflected on the Tizen TV. - /// If you use this API on other profile, this time settings have no effect. - /// - /// The value in seconds when the notification can be hidden from the notification viewer after the notification is posted. - /// The value in seconds when the notification can be deleted from the notification list in setting application after notification is posted. - /// Thrown when argument is invalid. - public void SetRemoveTime(int hideTime, int deleteTime) - { - if (hideTime < 0 || deleteTime < 0) - { - throw NotificationErrorFactory.GetException(NotificationError.InvalidParameter, "invalid argument"); - } - - hideTimeout = hideTime; - deleteTimeout = deleteTime; - } - - /// - /// Method to get time set to hide or delete notification. - /// - /// The value in seconds when the notification can be hidden from the notification viewer after notification is posted. - /// The value in seconds when the notification can be deleted from the notification list in setting application after notification is posted. - public void GetRemoveTime(out int hideTime, out int deleteTime) - { - hideTime = hideTimeout; - deleteTime = deleteTimeout; - } - - /// - /// Method to add a button to the active notification style. - /// Buttons are displayed on the notification. - /// - /// - /// If you add button that has same index, the button is replaced to latest adding button. - /// If you don't set an index on ButtonAction, the index is set sequentially from zero. - /// - /// A ButtonAction for appear to the notification. - /// Thrown when an argument is invalid. - /// - /// - /// - /// ButtonAction button = new ButtonAction - /// { - /// Index = 0, - /// Text = "Yes" - /// Action = new AppControl{ ApplicationId = "org.tizen.app" }; - /// }; - /// - /// ActiveStyle active = new ActiveStyle - /// { - /// IsAutoRemove = true, - /// BackgroundImage = "image path", - /// }; - /// - /// active.AddButtonAction(button); - /// - /// - /// - public void AddButtonAction(ButtonAction button) - { - if (button == null) - { - throw NotificationErrorFactory.GetException(NotificationError.InvalidParameter, "invalid ButtonAction object"); - } - - if (button.Index == ButtonIndex.None) - { - button.Index = (ButtonIndex)buttonDictionary.Count; - buttonDictionary.Add(button.Index, button); - } - else if (button.Index >= ButtonIndex.First) - { - if (buttonDictionary.ContainsKey(button.Index)) - { - buttonDictionary.Remove(button.Index); - } - - buttonDictionary.Add(button.Index, button); - } - } - - /// - /// Removes the ButtonAction you already added. - /// - /// The index to remove a button. - /// true if the element is successfully found and removed; otherwise, false. - public bool RemoveButtonAction(ButtonIndex index) - { - bool ret = buttonDictionary.Remove(index); - - if (ret == false) - { - Log.Debug(Notification.LogTag, "Invalid key, there is no button matched input index"); - } - else - { - Log.Debug(Notification.LogTag, "The button was removed."); - } - - return ret; - } - - /// - /// Gets the ButtonAction of the active notification. - /// - /// The index to get a button you already added. - /// The ButtonAction object, which you already added. - /// Thrown when an argument is invalid. - public ButtonAction GetButtonAction(ButtonIndex index) - { - ButtonAction button = null; - - if (buttonDictionary.ContainsKey(index) == true) - { - buttonDictionary.TryGetValue(index, out button); - } - else - { - throw NotificationErrorFactory.GetException(NotificationError.InvalidParameter, "The value is not existed."); - } - - return button; - } - - internal ICollection GetButtonAction() - { - return buttonDictionary.Values; - } - - internal override void Make(Notification notification) - { - ActiveBinder.BindObject(notification); - } - } - } -} diff --git a/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationBinder.cs b/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationBinder.cs deleted file mode 100755 index e7c6c218b..000000000 --- a/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationBinder.cs +++ /dev/null @@ -1,233 +0,0 @@ -/* - * Copyright (c) 2017 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. - */ - -namespace Tizen.Applications.Notifications -{ - using System; - - internal static class NotificationBinder - { - private static readonly int DoNotShowTimeStamp = -1; - - internal static void BindObject(Notification notification) - { - BindNotificationSafeHandle(notification); - BindNotificationText(notification); - BindNotificationTime(notification); - - Interop.Notification.SetID(notification.Handle, notification.PrivID); - - if (notification.IsVisible) - { - Interop.Notification.SetApplist(notification.Handle, (int)NotificationDisplayApplist.Tray); - } - else - { - Interop.Notification.SetApplist(notification.Handle, 0); - } - - if (notification.IsOngoing == true) - { - Log.Info(Notification.LogTag, "Start to set IsOngoing to SafeHandle"); - Interop.Notification.SetLayout(notification.Handle, NotificationLayout.Ongoing); - Interop.Notification.SetOngoingFlag(notification.Handle, true); - } - - if (string.IsNullOrEmpty(notification.Tag) != true) - { - Interop.Notification.SetTag(notification.Handle, notification.Tag); - } - - if (notification.Action != null && notification.Action.SafeAppControlHandle.IsInvalid == false) - { - Interop.Notification.SetAppControl(notification.Handle, LaunchOption.AppControl, notification.Action.SafeAppControlHandle); - } - - Interop.Notification.SetProperties(notification.Handle, (int)notification.Property); - } - - internal static void BindSafeHandle(Notification notification) - { - int privID, groupID; - Interop.Notification.GetID(notification.Handle, out groupID, out privID); - notification.PrivID = privID; - - NotificationLayout layout; - Interop.Notification.GetLayout(notification.Handle, out layout); - NotificationType type; - Interop.Notification.GetType(notification.Handle, out type); - if (layout == NotificationLayout.Ongoing && type == NotificationType.Ongoing) - { - notification.IsOngoing = true; - } - - int appList; - Interop.Notification.GetApplist(notification.Handle, out appList); - if ((appList & (int)NotificationDisplayApplist.Tray) == 0) - { - notification.IsVisible = false; - } - - BindSafeHandleText(notification); - BindSafeHandleTime(notification); - BindSafeHandleTag(notification); - BindSafeHandleAction(notification); - } - - private static void BindNotificationSafeHandle(Notification notification) - { - IntPtr ptr; - NotificationError ret; - - if (notification.Handle != null && notification.Handle.IsInvalid == false) - { - notification.Handle.Dispose(); - } - - if (notification.IsOngoing == true || notification.Progress != null) - { - ptr = Interop.Notification.Create(NotificationType.Ongoing); - } - else - { - ptr = Interop.Notification.Create(NotificationType.Basic); - } - - if (ptr == IntPtr.Zero) - { - ret = (NotificationError)Tizen.Internals.Errors.ErrorFacts.GetLastResult(); - throw NotificationErrorFactory.GetException(ret, "Unable to create IntPtr Notification"); - } - - notification.Handle = new NotificationSafeHandle(ptr, true); - } - - private static void BindNotificationText(Notification notification) - { - Interop.Notification.SetText(notification.Handle, NotificationText.Title, notification.Title, null, -1); - Interop.Notification.SetText(notification.Handle, NotificationText.Content, notification.Content, null, -1); - Interop.Notification.SetImage(notification.Handle, NotificationImage.Icon, notification.Icon); - Interop.Notification.SetImage(notification.Handle, NotificationImage.SubIcon, notification.SubIcon); - Interop.Notification.SetText(notification.Handle, NotificationText.EventCount, notification.Count.ToString(), null, -1); - } - - private static void BindNotificationTime(Notification notification) - { - if (notification.IsTimeStampVisible == true) - { - if (notification.TimeStamp != DateTime.MinValue) - { - TimeSpan datatime = notification.TimeStamp.ToUniversalTime() - new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc); - Interop.Notification.SetTime(notification.Handle, (int)datatime.TotalSeconds); - } - } - else - { - Interop.Notification.SetTime(notification.Handle, DoNotShowTimeStamp); - } - } - - private static void BindSafeHandleText(Notification notification) - { - string text; - Interop.Notification.GetText(notification.Handle, NotificationText.Title, out text); - if (string.IsNullOrEmpty(text) == false) - { - notification.Title = text; - } - - Interop.Notification.GetText(notification.Handle, NotificationText.Content, out text); - if (string.IsNullOrEmpty(text) == false) - { - notification.Content = text; - } - - string path; - Interop.Notification.GetImage(notification.Handle, NotificationImage.Icon, out path); - if (string.IsNullOrEmpty(path) == false) - { - notification.Icon = path; - } - - Interop.Notification.GetImage(notification.Handle, NotificationImage.SubIcon, out path); - if (string.IsNullOrEmpty(path) == false) - { - notification.SubIcon = path; - } - - Interop.Notification.GetText(notification.Handle, NotificationText.EventCount, out text); - if (string.IsNullOrEmpty(text) == false) - { - try - { - notification.Count = int.Parse(text); - } - catch (Exception ex) - { - Log.Error(Notification.LogTag, ex.ToString()); - } - } - } - - private static void BindSafeHandleTime(Notification notification) - { - int time; - - Interop.Notification.GetTime(notification.Handle, out time); - - if (time == DoNotShowTimeStamp) - { - notification.IsTimeStampVisible = false; - } - else - { - notification.IsTimeStampVisible = true; - - if (time != 0) - { - notification.TimeStamp = (new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Local)).AddSeconds(time).ToLocalTime(); - } - } - } - - private static void BindSafeHandleTag(Notification notification) - { - string text; - Interop.Notification.GetTag(notification.Handle, out text); - if (string.IsNullOrEmpty(text) != true) - { - notification.Tag = text; - } - } - - private static void BindSafeHandleProperty(Notification notification) - { - int property; - Interop.Notification.GetProperties(notification.Handle, out property); - notification.Property = (NotificationProperty)property; - } - - private static void BindSafeHandleAction(Notification notification) - { - SafeAppControlHandle appcontrol = null; - Interop.Notification.GetAppControl(notification.Handle, LaunchOption.AppControl, out appcontrol); - if (appcontrol != null && appcontrol.IsInvalid == false) - { - notification.Action = new AppControl(appcontrol); - } - } - } -} \ No newline at end of file diff --git a/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationButtonAction.cs b/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationButtonAction.cs deleted file mode 100755 index 1c8704138..000000000 --- a/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationButtonAction.cs +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Copyright (c) 2017 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. - */ - -namespace Tizen.Applications.Notifications -{ - /// - /// This class contains common properties and methods of notifications. - /// - /// - /// A notification is a message that is displayed on the notification area. - /// It is created to notify information to the user through the application. - /// This class helps you to provide method and property for creating notification object. - /// - public sealed partial class Notification - { - /// - /// This class helps you to set the button on active style of notification. - /// - /// - /// It must include a text, an index, an ImagePath, and an action to be invoked when the user selects the button. - /// > - public sealed class ButtonAction : MakerBase - { - /// - /// Gets or sets the index of the button, which appeares as notification. - /// - public ButtonIndex Index { get; set; } = ButtonIndex.None; - - /// - /// Gets or sets the text describing the button. - /// - public string Text { get; set; } - - /// - /// Gets or sets the image path that represents the button. - /// You should provide an absolute path for an image file. - /// - public string ImagePath { get; set; } - - /// - /// Gets or sets the action, which is invoked when the button is clicked. - /// - /// - /// If you don't set action, nothing happens when the button is clicked. - /// - /// - /// - /// ButtonAction button = new ButtonAction - /// { - /// Index = ButtonIndex.First, - /// text = "Yes", - /// ImagePath = "image path", - /// Action = new AppControl{ ApplicationId = "org.tizen.app" }; - /// }; - /// - /// - /// - public AppControl Action { get; set; } - - internal override void Make(Notification notification) - { - int enumIndex = (int)NotificationText.FirstButton + (int)Index; - - Interop.Notification.SetText(notification.Handle, (NotificationText)enumIndex, Text, null, -1); - enumIndex = (int)NotificationImage.FirstButton + (int)Index; - Interop.Notification.SetImage(notification.Handle, (NotificationImage)enumIndex, ImagePath); - if (Action != null && Action.SafeAppControlHandle.IsInvalid == false) - { - Interop.Notification.SetEventHandler(notification.Handle, (int)Index, Action.SafeAppControlHandle); - } - } - } - } -} diff --git a/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationEnumerations.cs b/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationEnumerations.cs deleted file mode 100755 index 877eba366..000000000 --- a/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationEnumerations.cs +++ /dev/null @@ -1,218 +0,0 @@ -/* - * Copyright (c) 2017 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. - */ - -namespace Tizen.Applications.Notifications -{ - using System; - - /// - /// Enumeration for the progress category. - /// - public enum ProgressCategory - { - /// - /// Value for percent type. - /// - Percent, - - /// - /// Value for time type. - /// - Time, - - /// - /// Value for pending type, which is not the updated progress current value. - /// - PendingBar - } - - /// - /// Enumeration for the accessory option. - /// - public enum AccessoryOption - { - /// - /// Value for off accessory option. - /// - Off = -1, - - /// - /// Value for on accessory option. - /// - On, - - /// - /// Value for the custom accessory option. - /// - Custom - } - - /// - /// Enumeration for the button index. - /// - public enum ButtonIndex - { - /// - /// Value for the default button index. - /// - None = -1, - - /// - /// Value for the first button index. - /// - First, - - /// - /// Value for the second button index. - /// - Second, - - /// - /// Value for the third button index. - /// - Third - } - - /// - /// Enumeration for the notification particular property. - /// - [Flags] - public enum NotificationProperty - { - /// - /// Value for adjust nothing. - /// - None = 0x00, - - /// - /// Value for display only SIM card inserted. - /// - DisplayOnlySimMode = 0x01, - - /// - /// Value for disable application launch when it is selected. - /// - DisableAppLaunch = 0x02, - - /// - /// Value for disable auto delete when it is selected. - /// - DisableAutoDelete = 0x04, - - /// - /// Value for deleted when device is rebooted even though notification is not set ongoing. - /// - VolatileDisplay = 0x100 - } - - /// - /// Enumeration for the block state. - /// - public enum NotificationBlockState - { - /// - /// Value to check if the app is allowed to post notification. - /// - Allowed = 0, - - /// - /// Value to check if the app is not allowed to post any notification. - /// - Blocked, - - /// - /// Value to check if the do not disturb mode is set by the user. - /// - DoNotDisturb - } - - internal enum NotificationType - { - None = -1, - Basic = 0, - Ongoing, - } - - internal enum NotificationEventType - { - FirstButton = 0, - SecondButton, - ThirdButton, - ClickOnIcon = 6, - ClockOnThumbnail = 7, - ClickOnTextInputButton = 8, - HiddenByUser = 100, - HiddenByTimeout = 101, - HiddenByExternal = 102, - } - - internal enum NotificationLayout - { - None = 0, - SingleEvent = 1, - Thumbnail = 3, - Ongoing = 4, - Progress = 5, - Extension = 6 - } - - internal enum NotificationText - { - Title = 0, - Content, - EventCount = 3, - FirstMainText, - FirstSubText, - SecondMainText, - SecondSubText, - FirstButton = 13, - SeceondButton = 14, - ThirdButton = 15, - PlaceHolder = 19, - InputButton = 20, - } - - internal enum NotificationImage - { - Icon = 0, - IconForIndicator, - IconForLock, - Thumbnail, - ThumbnailForLock, - SubIcon, - Background, - FirstButton = 12, - SecondButton, - ThirdButton, - TextInputButton = 18, - } - - internal enum LaunchOption - { - AppControl = 1 - } - - [Flags] - internal enum NotificationDisplayApplist - { - Tray = 0x00000001, - Ticker = 0x00000002, - Lock = 0x00000004, - Indicator = 0x00000008, - Active = 0x00000010, - All = 0x0000000f, - } -} diff --git a/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationErrorFactory.cs b/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationErrorFactory.cs deleted file mode 100755 index 12f92f32c..000000000 --- a/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationErrorFactory.cs +++ /dev/null @@ -1,56 +0,0 @@ -/* - * 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. - */ - -namespace Tizen.Applications.Notifications -{ - using System; - using System.Runtime.CompilerServices; - - internal enum NotificationError - { - None = Tizen.Internals.Errors.ErrorCode.None, - InvalidParameter = Tizen.Internals.Errors.ErrorCode.InvalidParameter, - OutOfMemory = Tizen.Internals.Errors.ErrorCode.OutOfMemory, - IoError = Tizen.Internals.Errors.ErrorCode.IoError, - DbError = -0x01140000 | 0x01, - AlreadyExists = -0x01140000 | 0x02, - DBusError = -0x01140000 | 0x03, - DoesnotExist = -0x01140000 | 0x04, - ServiceError = -0x01140000 | 0x05, - PermissionDenied = Tizen.Internals.Errors.ErrorCode.PermissionDenied, - InvalidOperation = Tizen.Internals.Errors.ErrorCode.InvalidOperation - } - - internal static class NotificationErrorFactory - { - internal static Exception GetException(NotificationError ret, string msg, [CallerMemberName] string memberName = "", [CallerFilePath] string filePath = "", [CallerLineNumber] int lineNumber = 0) - { - Log.Error(Notification.LogTag, memberName + " : " + lineNumber); - - switch (ret) - { - case NotificationError.InvalidParameter: - Log.Error(Notification.LogTag, msg); - return new ArgumentException(ret + " error occurred."); - case NotificationError.PermissionDenied: - throw new UnauthorizedAccessException("Permission denied (http://tizen.org/privilege/notification)"); - default: - Log.Error(Notification.LogTag, msg); - return new InvalidOperationException(ret + " error occurred."); - } - } - } -} diff --git a/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationIndicatorStyle.cs b/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationIndicatorStyle.cs deleted file mode 100755 index 110fbe95c..000000000 --- a/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationIndicatorStyle.cs +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) 2017 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. - */ - -namespace Tizen.Applications.Notifications -{ - /// - /// The class contains common properties and methods of notifications. - /// - /// - /// A notification is a message that is displayed on the notification area. - /// It is created to notify information to the user through the application. - /// This class helps you to provide method and property for creating notification object. - /// - public sealed partial class Notification - { - /// - /// Class for generating indicator style notification. - /// - public sealed class IndicatorStyle : StyleBase - { - /// - /// Gets or sets an absolute path for an image file. - /// If you set IconPath, you can see the icon on the right side of indicator. - /// - public string IconPath { get; set; } - - /// - /// Gets or sets a sub text for displaying indicator style. - /// - public string SubText { get; set; } - - /// - /// Gets the key of IndicatorStyle. - /// - internal override string Key - { - get - { - return "Indicator"; - } - } - - internal override void Make(Notification notification) - { - IndicatorBinder.BindObject(notification); - } - } - } -} diff --git a/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationLockStyle.cs b/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationLockStyle.cs deleted file mode 100755 index 12fcd6ad9..000000000 --- a/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationLockStyle.cs +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (c) 2017 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. - */ - -namespace Tizen.Applications.Notifications -{ - /// - /// This class contains common properties and methods of notifications. - /// - /// - /// A notification is a message that is displayed on the notification area. - /// It is created to notify information to the user through the application. - /// This class helps you to provide method and property for creating notification object. - /// - public sealed partial class Notification - { - /// - /// Class for generating lock style notification. - /// - public sealed class LockStyle : StyleBase - { - /// - /// Gets or sets an absolute path for an image file to display the icon of lock style. - /// - public string IconPath { get; set; } - - /// - /// Gets or sets an absolute path for a thumbnail image file to display on lock style. - /// - public string ThumbnailPath { get; set; } - - /// - /// Gets the key of LockStyle. - /// - internal override string Key - { - get - { - return "Lock"; - } - } - - internal override void Make(Notification notification) - { - LockBinder.BindObject(notification); - } - } - } -} \ No newline at end of file diff --git a/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationMakerBase.cs b/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationMakerBase.cs deleted file mode 100755 index 5b450b716..000000000 --- a/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationMakerBase.cs +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2017 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. - */ - -namespace Tizen.Applications.Notifications -{ - using System.ComponentModel; - - /// - /// This class contains common properties and methods of notifications. - /// - /// - /// A notification is a message that is displayed on the notification area. - /// It is created to notify information to the user through the application. - /// This class helps you to provide method and property for creating notification object. - /// - public sealed partial class Notification - { - /// - /// An object that helps notification to make to SafeHandle. - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public abstract class MakerBase - { - internal abstract void Make(Notification notification); - } - } -} \ No newline at end of file diff --git a/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationManager.cs b/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationManager.cs deleted file mode 100755 index 84758f2eb..000000000 --- a/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationManager.cs +++ /dev/null @@ -1,480 +0,0 @@ -/* - * Copyright (c) 2017 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. - */ - -namespace Tizen.Applications.Notifications -{ - using System; - using System.ComponentModel; - - /// - /// NotificationManager class to post, update, delete, and get notification. - /// - public static class NotificationManager - { - /// - /// Posts a new notification. - /// - /// Notification to post. - /// Thrown when an argument is invalid. - /// Thrown in case of a permission is denied. - /// Thrown in case of any internal error. - /// - /// - /// Notification notification = new Notification - /// { - /// Title = "title", - /// Content = "content", - /// Icon = "absolute icon path", - /// Tag = "first notification" - /// }; - /// - /// Notification.AccessorySet accessory = new Notification.AccessorySet - /// { - /// SoundOption = AccessoryOption.On, - /// CanVibrate = true - /// }; - /// notification.Accessory = accessory; - /// - /// // do something - /// - /// NotificationManager.Post(notification); - /// - /// - /// http://tizen.org/privilege/notification - public static void Post(Notification notification) - { - if (notification == null) - { - throw NotificationErrorFactory.GetException(NotificationError.InvalidParameter, "invalid argument to post method"); - } - - notification.Make(); - - NotificationError ret = Interop.Notification.Post(notification.Handle); - if (ret != NotificationError.None) - { - throw NotificationErrorFactory.GetException(ret, "post notification failed"); - } - - int priv_id, group_id; - Interop.Notification.GetID(notification.Handle, out group_id, out priv_id); - notification.PrivID = priv_id; - } - - /// - /// Updates a posted notification. - /// - /// Notification to update. - /// Thrown when an argument is invalid. - /// Thrown in case of a permission is denied. - /// Thrown in case of any internal error. - /// - /// - /// string tag = "first tag"; - /// - /// Notification notification = new Notification - /// { - /// Title = "title", - /// Content = "content", - /// Icon = "absolute icon path", - /// Tag = tag - /// }; - /// - /// Notification.AccessorySet accessory = new Notification.AccessorySet - /// { - /// LedOption = AccessoryOption.On, - /// VibrationOption = AccessoryOption.Custom, - /// VibrationPath = "vibration absolute path" - /// } - /// notification.Accessory = accessory; - /// - /// NotificationManager.Post(notification); - /// - /// // do something - /// - /// Notification loadNotification = NotificationManager.Load(tag); - /// - /// loadNotification.Progress = new ProgressType(ProgressCategory.Percent, 0.0. 100.0); - /// - /// Thread thread = new Thread(new ParameterizedThreadStart(UpdateProgress)); - /// thread.IsBackground = true; - /// thread.Start(notification); - /// - /// ... - /// - /// static void UpdateProgress(Object obj) - /// { - /// Notification notification = (Notification)obj; - /// - /// for (double current = 1.0; current <= 100.0; current = current + 1.0) - /// { - /// notification.Progress.ProgressCurrent = current; - /// NotificationManager.Update(notification); - /// Thread.Sleep(300); - /// } - /// } - /// - /// - /// http://tizen.org/privilege/notification - ///
-        /// Post method should be called on the notification object.
-        /// 
- public static void Update(Notification notification) - { - if (notification == null || notification.Handle == null || notification.Handle.IsInvalid) - { - throw NotificationErrorFactory.GetException(NotificationError.InvalidParameter, "invalid argument to post method"); - } - - notification.Make(); - NotificationError ret = Interop.Notification.Update(notification.Handle); - if (ret != NotificationError.None) - { - throw NotificationErrorFactory.GetException(ret, "update notification failed"); - } - } - - /// - /// Deletes a posted notification. - /// - /// Notification to remove. - /// Thrown when an argument is invalid. - /// Thrown in case of a permission is denied. - /// Thrown in case of any internal error. - /// - /// - /// Notification notification = new Notification - /// { - /// Title = "title", - /// Content = "content", - /// Icon = "absolute icon path", - /// Tag = "first notification" - /// }; - /// NotificationManager.Post(notification); - /// - /// // do something - /// - /// NotificationManager.Delete(notification); - /// - /// - /// http://tizen.org/privilege/notification - ///
-        /// Post method should be called on the notification object.
-        /// 
- public static void Delete(Notification notification) - { - if (notification == null || notification.Handle == null || notification.Handle.IsInvalid) - { - throw NotificationErrorFactory.GetException(NotificationError.InvalidParameter, "invalid argument to post method"); - } - - NotificationError ret = Interop.Notification.Delete(notification.Handle); - if (ret != NotificationError.None) - { - throw NotificationErrorFactory.GetException(ret, "delete notification failed"); - } - } - - /// - /// Removes all posted notifications of calling application. - /// - /// Thrown in case of a permission is denied. - /// Thrown in case of any internal error. - /// - /// - /// Notification firstNotification = new Notification - /// { - /// Title = "title", - /// Content = "content", - /// Icon = "absolute icon path", - /// Tag = "first notification" - /// }; - /// NotificationManager.Post(firstNotification); - /// - /// Notification secondNotification = new Notification - /// { - /// Title = "title", - /// Content = "content", - /// Icon = "absolute icon path", - /// Tag = "second notification" - /// }; - /// NotificationManager.Post(secondNotification); - /// NotificationManager.DeleteAll(); - /// - /// - /// http://tizen.org/privilege/notification - public static void DeleteAll() - { - NotificationError ret; - - ret = Interop.Notification.DeleteAll((int)NotificationType.Basic); - if (ret != NotificationError.None) - { - throw NotificationErrorFactory.GetException(ret, "delete all notifications failed of Noti type"); - } - - ret = Interop.Notification.DeleteAll((int)NotificationType.Ongoing); - if (ret != NotificationError.None) - { - throw NotificationErrorFactory.GetException(ret, "delete all notifications failed of Ongoing type"); - } - } - - /// - /// Searches for a posted notification which has the specified tag and has not been deleted yet. - /// - /// - /// Load method should be called only for notifications, which have been posted using the NotificationManager.Post method. - /// If two or more notifications share the same tag, the notification posted most recently is returned. - /// - /// Tag used to query. - /// Notification Object with specified tag. - /// Throwing the same exception when argument is invalid and when the tag does not exist is misleading. - /// Thrown in case of permission denied. - /// Thrown in case of any internal error. - /// - /// - /// Notification notification = new Notification - /// { - /// Title = "title", - /// Content = "content", - /// Icon = "absolute icon path", - /// Tag = "first notification" - /// }; - /// NotificationManager.Post(notification); - /// - /// // do someting - /// - /// Notification loadNotification = NotificationManager.Load("first notification"); - /// - /// - /// http://tizen.org/privilege/notification - public static Notification Load(string tag) - { - IntPtr ptr = IntPtr.Zero; - - if (string.IsNullOrEmpty(tag)) - { - throw NotificationErrorFactory.GetException(NotificationError.InvalidParameter, "invalid parameter entered"); - } - - ptr = Interop.Notification.Load(tag); - - if (ptr == IntPtr.Zero) - { - NotificationError ret = (NotificationError)Tizen.Internals.Errors.ErrorFacts.GetLastResult(); - Log.Error(Notification.LogTag, "unable to load Notification : " + ret.ToString()); - if (ret == NotificationError.DbError) - { - throw NotificationErrorFactory.GetException(NotificationError.InvalidParameter, "the tag does not exist"); - } - else - { - throw NotificationErrorFactory.GetException(ret, "unable to load Notification"); - } - } - - Notification notification = new Notification - { - Handle = new NotificationSafeHandle(ptr, true) - }.Build(); - - return notification; - } - - /// - /// Saves a notification template to the notification database. - /// - /// Notification to save as template. - /// Template name. - /// Thrown when an argument is invalid. - /// Thrown in case of a permission is denied. - /// Thrown when it can't be saved as a template. - /// - /// - /// Notification notification = new Notification - /// { - /// Title = "title", - /// Content = "content", - /// Icon = "absolute icon path", - /// Tag = "first notification" - /// }; - /// - /// Notification.Accessory accessory = new Notification.Accessory - /// { - /// LedOption = AccessoryOption.On, - /// VibrationOption = AccessoryOption.Custom, - /// VibrationPath = "vibration absolute path" - /// } - /// notification.setAccessory(accessory); - /// - /// // do something - /// - /// NotificationManager.Post(notification); - /// - /// Notification.LockStyle style = new Notification.LockStyle - /// { - /// IconPath = "icon path", - /// ThumbnailPath = "Thumbnail path" - /// } - /// notification.AddStyle(style); - /// NotificationManager.SaveTemplate(notification, "firstTemplate"); - /// - /// - /// http://tizen.org/privilege/notification - public static void SaveTemplate(Notification notification, string name) - { - if (notification == null || string.IsNullOrEmpty(name)) - { - throw NotificationErrorFactory.GetException(NotificationError.InvalidParameter, "invalid argument to save template"); - } - - notification.Make(); - - NotificationError ret = Interop.Notification.SaveTemplate(notification.Handle, name); - if (ret != NotificationError.None) - { - throw NotificationErrorFactory.GetException(ret, "save as template failed"); - } - } - - /// - /// Loads a notification template from the notification database. - /// - /// Template name. - /// Notification Object with inputted template name. - /// Throwing the same exception when argument is invalid and when the template does not exist is misleading. - /// Thrown in case of permission denied. - /// Thrown in case of any internal error. - /// - /// - /// Notification notification = new Notification - /// { - /// Title = "title", - /// Content = "content", - /// Icon = "absolute icon path", - /// Tag = "first notification" - /// }; - /// - /// Notification.Accessory accessory = new Notification.Accessory - /// { - /// LedOption = AccessoryOption.On, - /// VibrationOption = AccessoryOption.Custom, - /// VibrationPath = "vibration absolute path" - /// } - /// notification.setAccessory(accessory); - /// - /// // do something - /// - /// NotificationManager.Post(notification); - /// - /// Notification.LockStyle style = new Notification.LockStyle - /// { - /// IconPath = "icon path", - /// ThumbnailPath = "Thumbnail path" - /// } - /// notification.AddStyle(style); - /// NotificationManager.SaveTemplate(notification, "firstTemplate"); - /// Notification notificationTemplate = NotificationManager.LoadTemplate("firstTemplate"); - /// - /// - /// http://tizen.org/privilege/notification - public static Notification LoadTemplate(string name) - { - IntPtr handle = IntPtr.Zero; - - if (string.IsNullOrEmpty(name)) - { - throw NotificationErrorFactory.GetException(NotificationError.InvalidParameter, "invalid argument to load template"); - } - - handle = Interop.Notification.LoadTemplate(name); - if (handle == IntPtr.Zero) - { - NotificationError ret = (NotificationError)Tizen.Internals.Errors.ErrorFacts.GetLastResult(); - if (ret == NotificationError.DbError) - { - throw NotificationErrorFactory.GetException(NotificationError.InvalidParameter, "the name does not exist"); - } - else - { - throw NotificationErrorFactory.GetException(ret, "unable to create Notification from template"); - } - } - - Notification notification = new Notification - { - Handle = new NotificationSafeHandle(handle, true) - }.Build(); - - return notification; - } - - /// - /// Gets notification block state. - /// - /// - /// The user can set the notification block state in settings. - /// The block state indicates whether or not notifications can be posted. - /// Additionally, only notifications to the notification panel are allowed in "Do not disturb mode". - /// Sound, vibrate, and active notifications are blocked. - /// - /// NotificationBlockState is a state if notification is posted. - /// Thrown in case of a permission is denied. - /// Thrown in case of any internal error. - /// http://tizen.org/privilege/notification - public static NotificationBlockState GetBlockState() - { - NotificationBlockState state; - NotificationError ret; - - ret = Interop.Notification.GetBlockState(out state); - if (ret != NotificationError.None) - { - throw NotificationErrorFactory.GetException(ret, "GetBlockState failed"); - } - - Log.Info(Notification.LogTag, "Current block state is " + state.ToString()); - return state; - } - - [EditorBrowsable(EditorBrowsableState.Never)] - public static NotificationSafeHandle MakeNotificationSafeHandle(Notification notification) - { - if (notification == null) - { - throw NotificationErrorFactory.GetException(NotificationError.InvalidParameter, "invalid notification object"); - } - - notification.Make(); - - return notification.Handle; - } - - [EditorBrowsable(EditorBrowsableState.Never)] - public static Notification MakeNotification(NotificationSafeHandle handle) - { - if (handle == null || handle.IsInvalid == true) - { - throw NotificationErrorFactory.GetException(NotificationError.InvalidParameter, "handle is invalid or null"); - } - - Notification notification = new Notification { Handle = handle }.Build(); - - return notification; - } - } -} diff --git a/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationProgress.cs b/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationProgress.cs deleted file mode 100755 index a124d422a..000000000 --- a/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationProgress.cs +++ /dev/null @@ -1,124 +0,0 @@ -/* - * Copyright (c) 2017 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. - */ - -namespace Tizen.Applications.Notifications -{ - /// - /// This class contains common properties and methods of notifications. - /// - /// - /// A notification is a message that is displayed on the notification area. - /// It is created to notify information to the user through the application. - /// This class helps you to provide method and property for creating notification object. - /// - public sealed partial class Notification - { - /// - /// Class for displaying progress notification. - /// You must initialize progress category, current, and max value when you create an object. - /// - public sealed class ProgressType : MakerBase - { - private double progressCurrent; - private double progressMax; - - /// - /// Initializes a new instance of the class. - /// You must initialize category, current, and max value of the progress. - /// - /// The category of progress that appeared on notification. - /// The current value of the progress. - /// The max value of the progress. - /// Thrown when an argument is invalid. - public ProgressType(ProgressCategory category, double current, double max) - { - if (IsNegativeNumber(current)) - { - throw NotificationErrorFactory.GetException(NotificationError.InvalidParameter, "The current must be a positive integer."); - } - - if (IsNegativeNumber(max)) - { - throw NotificationErrorFactory.GetException(NotificationError.InvalidParameter, "The max must be a positive integer."); - } - - Category = category; - ProgressCurrent = current; - ProgressMax = max; - } - - /// - /// Gets or sets category of ProgressType. - /// - /// - public ProgressCategory Category { get; set; } - - /// - /// Gets or sets current value of ProgressType. - /// - /// Thrown when argument is invalid. - public double ProgressCurrent - { - get - { - return progressCurrent; - } - - set - { - if (IsNegativeNumber(value)) - { - throw NotificationErrorFactory.GetException(NotificationError.InvalidParameter, "The value must be a positive integer."); - } - - progressCurrent = value; - } - } - - /// - /// Gets or sets max value of ProgressType. - /// - /// Thrown when argument is invalid. - public double ProgressMax - { - get - { - return progressMax; - } - - set - { - if (IsNegativeNumber(value)) - { - throw NotificationErrorFactory.GetException(NotificationError.InvalidParameter, "The value must be a positive integer."); - } - - progressMax = value; - } - } - - internal override void Make(Notification notification) - { - ProgressBinder.BindObject(notification); - } - - private bool IsNegativeNumber(double number) - { - return number < 0; - } - } - } -} diff --git a/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationProgressBinder.cs b/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationProgressBinder.cs deleted file mode 100755 index 6afd5c5df..000000000 --- a/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationProgressBinder.cs +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright (c) 2017 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. - */ - -namespace Tizen.Applications.Notifications -{ - internal static class ProgressBinder - { - internal static void BindObject(Notification notification) - { - double current, max; - - Notification.ProgressType progress = notification.Progress; - - if (progress.Category == ProgressCategory.PendingBar) - { - Interop.Notification.SetProgressType(notification.Handle, ProgressCategory.Percent); - current = 0; - max = 0; - } - else if (progress.Category == ProgressCategory.Percent) - { - Interop.Notification.SetProgressType(notification.Handle, progress.Category); - current = progress.ProgressCurrent / 100; - max = progress.ProgressMax; - } - else - { - Interop.Notification.SetProgressType(notification.Handle, progress.Category); - current = progress.ProgressCurrent; - max = progress.ProgressMax; - } - - Interop.Notification.SetProgress(notification.Handle, current); - Interop.Notification.SetProgressSize(notification.Handle, max); - Interop.Notification.SetLayout(notification.Handle, NotificationLayout.Progress); - Interop.Notification.SetOngoingFlag(notification.Handle, true); - } - - internal static void BindSafeHandle(Notification notification) - { - NotificationLayout layout; - Interop.Notification.GetLayout(notification.Handle, out layout); - - if (layout == NotificationLayout.Progress) - { - ProgressCategory category; - double current, max; - - Interop.Notification.GetProgressType(notification.Handle, out category); - Interop.Notification.GetProgress(notification.Handle, out current); - Interop.Notification.GetProgressSize(notification.Handle, out max); - - if (category == ProgressCategory.Percent) - { - current *= 100; - } - - notification.Progress = new Notification.ProgressType(category, current, max); - } - } - } -} diff --git a/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationReplyAction.cs b/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationReplyAction.cs deleted file mode 100755 index c530d78a5..000000000 --- a/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationReplyAction.cs +++ /dev/null @@ -1,111 +0,0 @@ -/* - * Copyright (c) 2017 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. - */ - -namespace Tizen.Applications.Notifications -{ - /// - /// This class contains common properties and methods of notifications. - /// - /// - /// A notification is a message that is displayed on the notification area. - /// It is created to notify information to the user through the application. - /// This class helps you to provide method and property for creating notification object. - /// - public sealed partial class Notification - { - /// - /// Class for displaying direct-reply on notification. - /// You must set a ReplyMax and Button. Otherwise, user can't send written text to application which is set by AppControl. - /// - public sealed class ReplyAction : MakerBase - { - /// - /// Gets or sets the index of button, which appears at notification. - /// If you set ParentIndex, ReplyAction is displayed when button matches with ParentIndex that is clicked by the user. - /// If you don't set ParentIndex, it appears as notification directly. - /// - public ButtonIndex ParentIndex { get; set; } = ButtonIndex.None; - - /// - /// Gets or sets the PlaceHolderText of ReplyAction which appears at notification. - /// If you set PlaceHolderText, it is displayed to placeholder in notification. - /// - public string PlaceHolderText { get; set; } - - /// - /// Gets or sets the maximum number of characters that the user can input. - /// You must set a ReplyMax. Otherwise user don't write text to placeholder in notification. - /// - /// - /// Default value is 160. - /// - public int ReplyMax { get; set; } = 160; - - /// - /// Gets or sets the button, which appears as ReplyAction in notification. - /// You must set the button, otherwise, a user can't send written text to application, which is set by AppControl. - /// - /// - /// If you set it to null, the already set ButtonAction will be removed. - /// - /// - /// - /// ReplyAction button = new ReplyAction - /// { - /// ParentIndex = ButtonIndex.Second; - /// PlaceHolderText = "Please write your reply." - /// ReplyMax = 160, - /// Button = new ButtonAction - /// { - /// text = "Yes", - /// ImagePath = "image path", - /// Action = new AppControl{ ApplicationId = "org.tizen.app" }; - /// }; - /// }; - /// - /// - public ButtonAction Button { get; set; } - - internal override void Make(Notification notification) - { - string replyKey = "__PARENT_INDEX__"; - - if (Button != null) - { - Interop.Notification.SetText(notification.Handle, NotificationText.InputButton, Button.Text, null, -1); - Interop.Notification.SetImage(notification.Handle, NotificationImage.TextInputButton, Button.ImagePath); - - if (this.Button.Action != null && this.Button.Action.SafeAppControlHandle.IsInvalid == false) - { - Interop.Notification.SetEventHandler(notification.Handle, (int)NotificationEventType.ClickOnTextInputButton, this.Button.Action.SafeAppControlHandle); - - if (this.ParentIndex != ButtonIndex.None) - { - Interop.Notification.SetEventHandler(notification.Handle, (int)this.ParentIndex, this.Button.Action.SafeAppControlHandle); - } - } - } - - Bundle bundle = new Bundle(); - bundle.AddItem(replyKey, ((int)this.ParentIndex).ToString()); - Interop.Notification.SetExtentionData(notification.Handle, replyKey, bundle.SafeBundleHandle); - - Interop.Notification.SetPlaceHolderLength(notification.Handle, this.ReplyMax); - Interop.Notification.SetText(notification.Handle, NotificationText.PlaceHolder, PlaceHolderText, null, -1); - } - } - } -} diff --git a/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationSafeHandle.cs b/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationSafeHandle.cs deleted file mode 100755 index 28ce60a50..000000000 --- a/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationSafeHandle.cs +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (c) 2017 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. - */ - -namespace Tizen.Applications.Notifications -{ - using System; - using System.ComponentModel; - using System.Runtime.InteropServices; - - [EditorBrowsable(EditorBrowsableState.Never)] - public sealed class NotificationSafeHandle : SafeHandle - { - [EditorBrowsable(EditorBrowsableState.Never)] - public NotificationSafeHandle() - : base(IntPtr.Zero, true) - { - } - - internal NotificationSafeHandle(IntPtr existingHandle, bool ownsHandle) : base(IntPtr.Zero, ownsHandle) - { - SetHandle(existingHandle); - } - - /// - /// Gets a value that indicates whether the handle is invalid. - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool IsInvalid - { - get { return this.DangerousGetHandle() == IntPtr.Zero; } - } - - protected override bool ReleaseHandle() - { - Interop.Notification.Destroy(this.handle); - this.SetHandle(IntPtr.Zero); - return true; - } - } -} diff --git a/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationStyle.cs b/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationStyle.cs deleted file mode 100755 index a7dda898a..000000000 --- a/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationStyle.cs +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2017 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. - */ - -namespace Tizen.Applications.Notifications -{ - /// - /// This class contains common properties and methods of notifications. - /// - /// - /// A notification is a message that is displayed on the notification area. - /// It is created to notify information to the user through the application. - /// This class helps you to provide method and property for creating notification object. - /// - public sealed partial class Notification - { - /// - /// An object can apply a rich notification style to a notification object. - /// If the platform does not provide rich notification, styles in this class have no effect. - /// - public abstract class StyleBase : MakerBase - { - internal abstract string Key { get; } - } - } -} \ No newline at end of file diff --git a/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationStyleBinder.cs b/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationStyleBinder.cs deleted file mode 100755 index f84c6f72a..000000000 --- a/src/Tizen.Applications.Notification/Tizen.Applications.Notifications/NotificationStyleBinder.cs +++ /dev/null @@ -1,322 +0,0 @@ -/* - * Copyright (c) 2017 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. - */ - -namespace Tizen.Applications.Notifications -{ - using System; - - internal static class IndicatorBinder - { - internal static void BindObject(Notification notification) - { - int flag; - NotificationError ret = NotificationError.None; - Notification.IndicatorStyle style = (Notification.IndicatorStyle)notification.GetStyle("Indicator"); - Interop.Notification.GetApplist(notification.Handle, out flag); - - if (string.IsNullOrEmpty(style.SubText) == false) - { - ret = Interop.Notification.SetText(notification.Handle, NotificationText.FirstMainText, style.SubText, null, -1); - if (ret != NotificationError.None) - { - throw NotificationErrorFactory.GetException(ret, "unable to set indicator text"); - } - flag |= (int)NotificationDisplayApplist.Ticker; - } - - if (string.IsNullOrEmpty(style.IconPath) == false) - { - ret = Interop.Notification.SetImage(notification.Handle, NotificationImage.IconForIndicator, style.IconPath); - if (ret != NotificationError.None) - { - throw NotificationErrorFactory.GetException(ret, "unable to set indicator image"); - } - flag |= (int)NotificationDisplayApplist.Indicator; - } - Interop.Notification.SetApplist(notification.Handle, flag); - } - - internal static void BindSafeHandle(Notification notification) - { - int appList; - Interop.Notification.GetApplist(notification.Handle, out appList); - if ((appList & (int)NotificationDisplayApplist.Ticker) != 0 || (appList & (int)NotificationDisplayApplist.Indicator) != 0) - { - string path, text; - Notification.IndicatorStyle indicator = new Notification.IndicatorStyle(); - Interop.Notification.GetImage(notification.Handle, NotificationImage.IconForIndicator, out path); - indicator.IconPath = path; - Interop.Notification.GetText(notification.Handle, NotificationText.FirstMainText, out text); - indicator.SubText = text; - - notification.AddStyle(indicator); - } - } - } - - internal static class ActiveBinder - { - internal static void BindObject(Notification notification) - { - int flag; - NotificationError ret = NotificationError.None; - Notification.ActiveStyle style = (Notification.ActiveStyle)notification.GetStyle("Active"); - - Interop.Notification.SetAutoRemove(notification.Handle, style.IsAutoRemove); - if (style.IsAutoRemove == true) - { - int hidetime; - int deletetime; - style.GetRemoveTime(out hidetime, out deletetime); - - Interop.Notification.SetHideTime(notification.Handle, hidetime); - try - { - Interop.Notification.SetDeleteTime(notification.Handle, deletetime); - } - catch (TypeLoadException) - { - // To support in API version 3.0 - style.SetRemoveTime(hidetime, 60); - } - } - - ret = Interop.Notification.SetImage(notification.Handle, NotificationImage.Background, style?.BackgroundImage); - if (ret != NotificationError.None) - { - throw NotificationErrorFactory.GetException(ret, "unable to set background Image"); - } - - if (style.DefaultButton != ButtonIndex.None) - { - Interop.Notification.SetDefaultButton(notification.Handle, (int)style.DefaultButton + 1); - } - - Interop.Notification.GetApplist(notification.Handle, out flag); - Interop.Notification.SetApplist(notification.Handle, flag | (int)NotificationDisplayApplist.Active); - - foreach (Notification.ButtonAction button in style.GetButtonAction()) - { - button.Make(notification); - } - - if (style.ReplyAction != null) - { - style.ReplyAction.Make(notification); - } - - if (style.HiddenByUserAction != null) - { - Interop.Notification.SetExtensionAction(notification.Handle, NotificationEventType.HiddenByUser, style.HiddenByUserAction.SafeAppControlHandle); - } - - if (style.HiddenByTimeoutAction != null) - { - Interop.Notification.SetExtensionAction(notification.Handle, NotificationEventType.HiddenByTimeout, style.HiddenByTimeoutAction.SafeAppControlHandle); - } - - if (style.HiddenByExternalAction != null) - { - Interop.Notification.SetExtensionAction(notification.Handle, NotificationEventType.HiddenByExternal, style.HiddenByExternalAction.SafeAppControlHandle); - } - } - - internal static void BindSafeHandle(Notification notification) - { - int appList; - Interop.Notification.GetApplist(notification.Handle, out appList); - - if ((appList & (int)NotificationDisplayApplist.Active) != 0) - { - Notification.ActiveStyle active = new Notification.ActiveStyle(); - bool isExisted = false; - bool autoRemove; - string path, text; - SafeAppControlHandle appcontrol = null; - string replyKey = "__PARENT_INDEX__"; - - for (int i = (int)ButtonIndex.First; i <= (int)ButtonIndex.Third; i++) - { - appcontrol = null; - - Interop.Notification.GetImage(notification.Handle, NotificationImage.FirstButton + i, out path); - Interop.Notification.GetText(notification.Handle, NotificationText.FirstButton + i, out text); - Interop.Notification.GetEventHandler(notification.Handle, i, out appcontrol); - - if (string.IsNullOrEmpty(path) == false || string.IsNullOrEmpty(text) == false - || (appcontrol != null && appcontrol.IsInvalid == false)) - { - Notification.ButtonAction button = new Notification.ButtonAction(); - if (appcontrol != null && appcontrol.IsInvalid == false) - { - button.Action = new AppControl(appcontrol); - } - - button.ImagePath = path; - button.Text = text; - button.Index = (ButtonIndex)i; - active.AddButtonAction(button); - isExisted = true; - } - } - - appcontrol = null; - Interop.Notification.GetExtensionAction(notification.Handle, NotificationEventType.HiddenByUser, out appcontrol); - if (appcontrol != null && appcontrol.IsInvalid == false) - { - active.HiddenByUserAction = new AppControl(appcontrol); - } - - appcontrol = null; - Interop.Notification.GetExtensionAction(notification.Handle, NotificationEventType.HiddenByTimeout, out appcontrol); - if (appcontrol != null && appcontrol.IsInvalid == false) - { - active.HiddenByTimeoutAction = new AppControl(appcontrol); - } - - appcontrol = null; - Interop.Notification.GetExtensionAction(notification.Handle, NotificationEventType.HiddenByExternal, out appcontrol); - if (appcontrol != null && appcontrol.IsInvalid == false) - { - active.HiddenByExternalAction = new AppControl(appcontrol); - } - - Interop.Notification.GetAutoRemove(notification.Handle, out autoRemove); - active.IsAutoRemove = autoRemove; - if (autoRemove) - { - int hidetime, deletetime; - Interop.Notification.GetHideTime(notification.Handle, out hidetime); - try - { - Interop.Notification.GetDeleteTime(notification.Handle, out deletetime); - } - catch (TypeLoadException) - { - // To support in API version 3.0 - deletetime = 60; - } - - active.SetRemoveTime(hidetime, deletetime); - } - - Interop.Notification.GetImage(notification.Handle, NotificationImage.Background, out path); - if (string.IsNullOrEmpty(path) == false) - { - isExisted = true; - active.BackgroundImage = path; - } - - int defaultIndex; - Interop.Notification.GetDefaultButton(notification.Handle, out defaultIndex); - active.DefaultButton = (ButtonIndex)(defaultIndex - 1); - - appcontrol = null; - Interop.Notification.GetImage(notification.Handle, NotificationImage.TextInputButton, out path); - Interop.Notification.GetText(notification.Handle, NotificationText.InputButton, out text); - Interop.Notification.GetEventHandler(notification.Handle, (int)NotificationEventType.ClickOnTextInputButton, out appcontrol); - - if (string.IsNullOrEmpty(path) == false || string.IsNullOrEmpty(text) == false - || (appcontrol != null && appcontrol.IsInvalid == false)) - { - Notification.ReplyAction reply = new Notification.ReplyAction(); - Notification.ButtonAction button = new Notification.ButtonAction(); - if (appcontrol != null && appcontrol.IsInvalid == false) - { - button.Action = new AppControl(appcontrol); - } - - button.ImagePath = path; - button.Text = text; - reply.Button = button; - - Interop.Notification.GetText(notification.Handle, NotificationText.PlaceHolder, out text); - reply.PlaceHolderText = text; - - int holderLength; - Interop.Notification.GetPlaceHolderLength(notification.Handle, out holderLength); - reply.ReplyMax = holderLength; - - isExisted = true; - - try - { - SafeBundleHandle bundleHandle; - Interop.Notification.GetExtentionData(notification.Handle, replyKey, out bundleHandle); - Bundle bundle = new Bundle(bundleHandle); - reply.ParentIndex = (ButtonIndex)int.Parse(bundle.GetItem(replyKey).ToString()); - } - catch (Exception ex) - { - Log.Error(Notification.LogTag, ex.ToString()); - } - - active.ReplyAction = reply; - } - - if (isExisted) - { - notification.AddStyle(active); - } - } - } - } - - internal static class LockBinder - { - internal static void BindObject(Notification notification) - { - int flag; - NotificationError ret = NotificationError.None; - Notification.LockStyle style = (Notification.LockStyle)notification.GetStyle("Lock"); - - ret = Interop.Notification.SetImage(notification.Handle, NotificationImage.IconForLock, style.IconPath); - if (ret != NotificationError.None) - { - throw NotificationErrorFactory.GetException(ret, "unable to set lock icon"); - } - - ret = Interop.Notification.SetImage(notification.Handle, NotificationImage.ThumbnailForLock, style.ThumbnailPath); - if (ret != NotificationError.None) - { - throw NotificationErrorFactory.GetException(ret, "unable to set lock thumbnail"); - } - - Interop.Notification.GetApplist(notification.Handle, out flag); - Interop.Notification.SetApplist(notification.Handle, flag | (int)NotificationDisplayApplist.Lock); - } - - internal static void BindSafehandle(Notification notification) - { - int applist; - Interop.Notification.GetApplist(notification.Handle, out applist); - - if ((applist & (int)NotificationDisplayApplist.Lock) != 0) - { - string path; - Notification.LockStyle lockStyle = new Notification.LockStyle(); - - Interop.Notification.GetImage(notification.Handle, NotificationImage.IconForLock, out path); - lockStyle.IconPath = path; - - Interop.Notification.GetImage(notification.Handle, NotificationImage.ThumbnailForLock, out path); - lockStyle.ThumbnailPath = path; - - notification.AddStyle(lockStyle); - } - } - } -} diff --git a/src/Tizen.Applications.NotificationEventListener/Interop/Interop.Libraries.cs b/src/Tizen.Applications.NotificationEventListener/Interop/Interop.Libraries.cs deleted file mode 100755 index 75347d447..000000000 --- a/src/Tizen.Applications.NotificationEventListener/Interop/Interop.Libraries.cs +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2017 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 NotificationEventListener = "libnotification.so.0"; - } -} diff --git a/src/Tizen.Applications.NotificationEventListener/Interop/Interop.NotificationEventListener.cs b/src/Tizen.Applications.NotificationEventListener/Interop/Interop.NotificationEventListener.cs deleted file mode 100755 index 708a5ad18..000000000 --- a/src/Tizen.Applications.NotificationEventListener/Interop/Interop.NotificationEventListener.cs +++ /dev/null @@ -1,301 +0,0 @@ -/* - * Copyright (c) 2017 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.Collections.Generic; -using System.Runtime.InteropServices; - -using Tizen.Applications; -using Tizen.Applications.NotificationEventListener; - -internal static partial class Interop -{ - internal static class NotificationEventListener - { - internal delegate void ChangedCallback(IntPtr userData, NotificationType type, IntPtr operationList, int num); - - internal enum ErrorCode - { - None = Tizen.Internals.Errors.ErrorCode.None, - InvalidParameter = Tizen.Internals.Errors.ErrorCode.InvalidParameter, - OutOfMemory = Tizen.Internals.Errors.ErrorCode.OutOfMemory, - IoError = Tizen.Internals.Errors.ErrorCode.IoError, - DbError = -0x01140000 | 0x01, - AlreadyExists = -0x01140000 | 0x02, - DBusError = -0x01140000 | 0x03, - DoesnotExist = -0x01140000 | 0x04, - ServiceError = -0x01140000 | 0x05, - PermissionDenied = Tizen.Internals.Errors.ErrorCode.PermissionDenied, - InvalidOperation = Tizen.Internals.Errors.ErrorCode.InvalidOperation - } - - [DllImport(Libraries.NotificationEventListener, EntryPoint = "notification_free")] - internal static extern ErrorCode Destroy(IntPtr handle); - - [DllImport(Libraries.NotificationEventListener, EntryPoint = "notification_get_id")] - internal static extern ErrorCode GetID(NotificationSafeHandle handle, out int groupId, out int privateId); - - [DllImport(Libraries.NotificationEventListener, EntryPoint = "notification_get_pkgname")] - internal static extern ErrorCode GetAppIdReferenceType(NotificationSafeHandle handle, out IntPtr appid); - - [DllImport(Libraries.NotificationEventListener, EntryPoint = "notification_get_text")] - internal static extern ErrorCode GetTextReferenceType(NotificationSafeHandle handle, NotificationText type, out IntPtr text); - - [DllImport(Libraries.NotificationEventListener, EntryPoint = "notification_get_image")] - internal static extern ErrorCode GetImageReferenceType(NotificationSafeHandle handle, NotificationImage type, out IntPtr text); - - [DllImport(Libraries.NotificationEventListener, EntryPoint = "notification_get_insert_time")] - internal static extern ErrorCode GetInsertTime(NotificationSafeHandle handle, out int time); - - [DllImport(Libraries.NotificationEventListener, EntryPoint = "notification_get_time")] - internal static extern ErrorCode GetTime(NotificationSafeHandle handle, out int time); - - [DllImport(Libraries.NotificationEventListener, EntryPoint = "notification_get_sound")] - internal static extern ErrorCode GetSoundReferenceType(NotificationSafeHandle handle, out AccessoryOption type, out IntPtr path); - - [DllImport(Libraries.NotificationEventListener, EntryPoint = "notification_get_vibration")] - internal static extern ErrorCode GetVibrationReferenceType(NotificationSafeHandle handle, out AccessoryOption type, out IntPtr path); - - [DllImport(Libraries.NotificationEventListener, EntryPoint = "notification_get_led")] - internal static extern ErrorCode GetLed(NotificationSafeHandle handle, out AccessoryOption type, out int color); - - [DllImport(Libraries.NotificationEventListener, EntryPoint = "notification_get_led_time_period")] - internal static extern ErrorCode GetLedTime(NotificationSafeHandle handle, out int onMilliSeconds, out int offMilliSeconds); - - [DllImport(Libraries.NotificationEventListener, EntryPoint = "notification_get_tag")] - internal static extern ErrorCode GetTagReferenceType(NotificationSafeHandle handle, out IntPtr tag); - - [DllImport(Libraries.NotificationEventListener, EntryPoint = "notification_get_display_applist")] - internal static extern ErrorCode GetStyleList(NotificationSafeHandle handle, out int styleList); - - [DllImport(Libraries.NotificationEventListener, EntryPoint = "notification_get_auto_remove")] - internal static extern ErrorCode GetAutoRemove(NotificationSafeHandle handle, out bool autoRemove); - - [DllImport(Libraries.NotificationEventListener, EntryPoint = "notification_get_text_input_max_length")] - internal static extern ErrorCode GetPlaceHolderLength(NotificationSafeHandle handle, out int max); - - [DllImport(Libraries.NotificationEventListener, EntryPoint = "notification_get_launch_option")] - internal static extern ErrorCode GetAppControl(NotificationSafeHandle handle, LaunchOption type, out SafeAppControlHandle appControlHandle); - - [DllImport(Libraries.NotificationEventListener, EntryPoint = "notification_get_event_handler")] - internal static extern ErrorCode GetEventHandler(NotificationSafeHandle handle, int type, out SafeAppControlHandle appControlHandle); - - [DllImport(Libraries.NotificationEventListener, EntryPoint = "notification_register_detailed_changed_cb")] - internal static extern ErrorCode SetChangedCallback(ChangedCallback callback, IntPtr userData); - - [DllImport(Libraries.NotificationEventListener, EntryPoint = "notification_unregister_detailed_changed_cb")] - internal static extern ErrorCode UnsetChangedCallback(ChangedCallback callback); - - [DllImport(Libraries.NotificationEventListener, EntryPoint = "notification_op_get_data")] - internal static extern ErrorCode GetOperationData(IntPtr operationList, NotificationOperationDataType type, out IntPtr userData); - - [DllImport(Libraries.NotificationEventListener, EntryPoint = "notification_list_get_data")] - internal static extern IntPtr GetData(IntPtr notificationList); - - [DllImport(Libraries.NotificationEventListener, EntryPoint = "notification_list_get_next")] - internal static extern IntPtr GetNext(IntPtr notificationList); - - [DllImport(Libraries.NotificationEventListener, EntryPoint = "notification_delete_by_priv_id")] - internal static extern ErrorCode Delete(string appId, NotificationType type, int uniqueNumber); - - [DllImport(Libraries.NotificationEventListener, EntryPoint = "notification_clear")] - internal static extern ErrorCode DeleteAll(int type); - - [DllImport(Libraries.NotificationEventListener, EntryPoint = "notification_get_list")] - internal static extern ErrorCode GetList(NotificationType type, int count, out IntPtr notification); - - [DllImport(Libraries.NotificationEventListener, EntryPoint = "notification_send_event_by_priv_id")] - internal static extern ErrorCode SendEvent(int uniqueNumber, int evnetType); - - [DllImport(Libraries.NotificationEventListener, EntryPoint = "notification_get_layout")] - internal static extern ErrorCode GetLayout(NotificationSafeHandle handle, out NotificationLayout type); - - [DllImport(Libraries.NotificationEventListener, EntryPoint = "notification_get_type")] - internal static extern ErrorCode GetType(NotificationSafeHandle handle, out NotificationType type); - - [DllImport(Libraries.NotificationEventListener, EntryPoint = "notification_get_ongoing_value_type")] - internal static extern ErrorCode GetOngoingType(NotificationSafeHandle handle, out ProgressCategory category); - - [DllImport(Libraries.NotificationEventListener, EntryPoint = "notification_get_size")] - internal static extern ErrorCode GetProgressSize(NotificationSafeHandle handle, out double value); - - [DllImport(Libraries.NotificationEventListener, EntryPoint = "notification_get_progress")] - internal static extern ErrorCode GetProgress(NotificationSafeHandle handle, out double value); - - [DllImport(Libraries.NotificationEventListener, EntryPoint = "notification_get_property")] - internal static extern ErrorCode GetProperties(NotificationSafeHandle handle, out int flags); - - [DllImport(Libraries.NotificationEventListener, EntryPoint = "notification_get_extention_data")] - internal static extern ErrorCode GetExtender(NotificationSafeHandle handle, string key, out SafeBundleHandle value); - - [DllImport(Libraries.NotificationEventListener, EntryPoint = "notification_clone")] - internal static extern ErrorCode GetClone(IntPtr handle, out IntPtr value); - - [DllImport(Libraries.NotificationEventListener, EntryPoint = "notification_free_list")] - internal static extern ErrorCode NotificationListFree(IntPtr list); - - [DllImport(Libraries.NotificationEventListener, EntryPoint = "notification_get_args")] - internal static extern ErrorCode GetExtentionBundle(NotificationSafeHandle handle, out IntPtr args, out IntPtr groupArgs); - - [DllImport(Libraries.NotificationEventListener, EntryPoint = "notification_get_hide_timeout")] - internal static extern ErrorCode GetHideTimeout(NotificationSafeHandle handle, out int timeout); - - [DllImport(Libraries.NotificationEventListener, EntryPoint = "notification_get_delete_timeout")] - internal static extern ErrorCode GetDeleteTimeout(NotificationSafeHandle handle, out int timeout); - - [DllImport(Libraries.NotificationEventListener, EntryPoint = "notification_get_event_flag")] - internal static extern ErrorCode GetEventFlag(NotificationSafeHandle handle, out bool eventFlag); - - [DllImport(Libraries.NotificationEventListener, EntryPoint = "notification_get_default_button")] - internal static extern ErrorCode GetDefaultButton(NotificationSafeHandle handle, out int index); - - [DllImport(Libraries.NotificationEventListener, EntryPoint = "notification_get_extension_event_handler")] - internal static extern ErrorCode GetExtensionAction(NotificationSafeHandle handle, UserEventType type, out SafeAppControlHandle appcontrol); - - internal static ErrorCode GetAppId(NotificationSafeHandle handle, out string appid) - { - ErrorCode err; - IntPtr ptr; - err = GetAppIdReferenceType(handle, out ptr); - - if (ptr == IntPtr.Zero) - { - appid = null; - } - else - { - appid = Marshal.PtrToStringAnsi(ptr); - } - - return err; - } - - internal static ErrorCode GetText(NotificationSafeHandle handle, NotificationText type, out string text) - { - ErrorCode err; - IntPtr ptr; - err = GetTextReferenceType(handle, type, out ptr); - - if (ptr == IntPtr.Zero) - { - text = null; - } - else - { - text = Marshal.PtrToStringAnsi(ptr); - } - - return err; - } - - internal static ErrorCode GetImage(NotificationSafeHandle handle, NotificationImage type, out string text) - { - ErrorCode err; - IntPtr ptr; - err = GetImageReferenceType(handle, type, out ptr); - - if (ptr == IntPtr.Zero) - { - text = null; - } - else - { - text = Marshal.PtrToStringAnsi(ptr); - } - - return err; - } - - internal static ErrorCode GetSound(NotificationSafeHandle handle, out AccessoryOption type, out string path) - { - ErrorCode err; - IntPtr ptr; - err = GetSoundReferenceType(handle, out type, out ptr); - - if (ptr == IntPtr.Zero) - { - path = null; - } - else - { - path = Marshal.PtrToStringAnsi(ptr); - } - - return err; - } - - internal static ErrorCode GetVibration(NotificationSafeHandle handle, out AccessoryOption type, out string path) - { - ErrorCode err; - IntPtr ptr; - err = GetVibrationReferenceType(handle, out type, out ptr); - - if (ptr == IntPtr.Zero) - { - path = null; - } - else - { - path = Marshal.PtrToStringAnsi(ptr); - } - - return err; - } - - internal static ErrorCode GetTag(NotificationSafeHandle handle, out string tag) - { - ErrorCode err; - IntPtr ptr; - err = GetTagReferenceType(handle, out ptr); - - if (ptr == IntPtr.Zero) - { - tag = null; - } - else - { - tag = Marshal.PtrToStringAnsi(ptr); - } - - return err; - } - - internal sealed class NotificationSafeHandle : SafeHandle - { - public NotificationSafeHandle() - : base(IntPtr.Zero, true) - { - } - - internal NotificationSafeHandle(IntPtr existingHandle, bool ownsHandle) : base(IntPtr.Zero, ownsHandle) - { - SetHandle(existingHandle); - } - - public override bool IsInvalid - { - get { return this.handle == IntPtr.Zero; } - } - - protected override bool ReleaseHandle() - { - NotificationEventListener.Destroy(this.handle); - this.SetHandle(IntPtr.Zero); - return true; - } - } - } -} diff --git a/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener.csproj b/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener.csproj deleted file mode 100755 index 020b2cb3d..000000000 --- a/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener.csproj +++ /dev/null @@ -1,11 +0,0 @@ - - - - netstandard2.0 - - - - - - - diff --git a/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener.sln b/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener.sln deleted file mode 100755 index 5d8b12b6c..000000000 --- a/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener.sln +++ /dev/null @@ -1,40 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26430.12 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Applications.NotificationEventListener", "Tizen.Applications.NotificationEventListener.csproj", "{E3032B94-F177-43F9-9C3F-BA90717C26BF}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen", "..\Tizen\Tizen.csproj", "{7F09F72D-15F1-4980-87D5-8387213CB4A8}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Log", "..\Tizen.Log\Tizen.Log.csproj", "{1232A53F-6B57-469F-A2E1-54AA49FA63B1}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Applications.Common", "..\Tizen.Applications.Common\Tizen.Applications.Common.csproj", "{2C3BE4AB-1DB5-44D9-85C0-AAD4477D23F9}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {E3032B94-F177-43F9-9C3F-BA90717C26BF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E3032B94-F177-43F9-9C3F-BA90717C26BF}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E3032B94-F177-43F9-9C3F-BA90717C26BF}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E3032B94-F177-43F9-9C3F-BA90717C26BF}.Release|Any CPU.Build.0 = Release|Any CPU - {7F09F72D-15F1-4980-87D5-8387213CB4A8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7F09F72D-15F1-4980-87D5-8387213CB4A8}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7F09F72D-15F1-4980-87D5-8387213CB4A8}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7F09F72D-15F1-4980-87D5-8387213CB4A8}.Release|Any CPU.Build.0 = Release|Any CPU - {1232A53F-6B57-469F-A2E1-54AA49FA63B1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1232A53F-6B57-469F-A2E1-54AA49FA63B1}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1232A53F-6B57-469F-A2E1-54AA49FA63B1}.Release|Any CPU.ActiveCfg = Release|Any CPU - {1232A53F-6B57-469F-A2E1-54AA49FA63B1}.Release|Any CPU.Build.0 = Release|Any CPU - {2C3BE4AB-1DB5-44D9-85C0-AAD4477D23F9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {2C3BE4AB-1DB5-44D9-85C0-AAD4477D23F9}.Debug|Any CPU.Build.0 = Debug|Any CPU - {2C3BE4AB-1DB5-44D9-85C0-AAD4477D23F9}.Release|Any CPU.ActiveCfg = Release|Any CPU - {2C3BE4AB-1DB5-44D9-85C0-AAD4477D23F9}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationAccessoryArgsBinder.cs b/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationAccessoryArgsBinder.cs deleted file mode 100755 index 30dd57303..000000000 --- a/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationAccessoryArgsBinder.cs +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (c) 2017 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. - */ - -namespace Tizen.Applications.NotificationEventListener -{ - internal static class NotificationAccessoryAgsBinder - { - internal static void BindObject(NotificationEventArgs eventargs) - { - AccessoryOption type; - int color; - string path; - - NotificationEventArgs.AccessoryArgs accessory = new NotificationEventArgs.AccessoryArgs(); - - Interop.NotificationEventListener.GetLed(eventargs.Handle, out type, out color); - accessory.LedOption = type; - if (type != AccessoryOption.Off) - { - int on, off; - - Interop.NotificationEventListener.GetLedTime(eventargs.Handle, out on, out off); - accessory.LedOnMillisecond = on; - accessory.LedOffMillisecond = off; - - if (type == AccessoryOption.Custom) - { - accessory.LedColor = new Common.Color(color >> 16 & 255, color >> 8 & 255, color >> 0 & 255, color >> 24 & 255); - } - } - - Interop.NotificationEventListener.GetSound(eventargs.Handle, out type, out path); - accessory.SoundOption = type; - if (type == AccessoryOption.Custom) - { - accessory.SoundPath = path; - } - - Interop.NotificationEventListener.GetVibration(eventargs.Handle, out type, out path); - if (type == AccessoryOption.Off) - { - accessory.CanVibrate = false; - } - else - { - accessory.CanVibrate = true; - } - - eventargs.Accessory = accessory; - } - } -} diff --git a/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationButtonActionArgsBinder.cs b/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationButtonActionArgsBinder.cs deleted file mode 100755 index e252015d1..000000000 --- a/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationButtonActionArgsBinder.cs +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2017 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. - */ - -namespace Tizen.Applications.NotificationEventListener -{ - internal static class NotificationButtonActionArgBinder - { - internal static void BindObject(NotificationEventArgs eventargs, int index) - { - string text; - bool isExisted = false; - SafeAppControlHandle appcontrol = null; - NotificationEventArgs.ButtonActionArgs button = new NotificationEventArgs.ButtonActionArgs(); - - button.Index = (ButtonIndex)index; - - Interop.NotificationEventListener.GetImage(eventargs.Handle, NotificationImage.Button_1 + index, out text); - if (string.IsNullOrEmpty(text) == false) - { - isExisted = true; - button.ImagePath = text; - } - - Interop.NotificationEventListener.GetText(eventargs.Handle, NotificationText.FirstButton + index, out text); - if (string.IsNullOrEmpty(text) == false) - { - isExisted = true; - button.Text = text; - } - - Interop.NotificationEventListener.GetEventHandler(eventargs.Handle, index, out appcontrol); - - if (appcontrol != null && appcontrol.IsInvalid == false) - { - button.Action = new AppControl(appcontrol); - isExisted = true; - } - - if (isExisted) - { - (eventargs.Style["Active"] as NotificationEventArgs.ActiveStyleArgs).Button.Add(button); - } - } - } -} \ No newline at end of file diff --git a/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationDeleteEventArgs.cs b/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationDeleteEventArgs.cs deleted file mode 100755 index 0f26d6c22..000000000 --- a/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationDeleteEventArgs.cs +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) 2017 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. - */ - -namespace Tizen.Applications.NotificationEventListener -{ - using System; - /// - /// This class provides the property to get information about the deleted notification. - /// - public class NotificationDeleteEventArgs : EventArgs - { - /// - /// Gets the unique number of the notification. - /// - public int UniqueNumber { get; internal set; } - } -} diff --git a/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationDeleteEventArgsBinder.cs b/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationDeleteEventArgsBinder.cs deleted file mode 100755 index 35108cdf4..000000000 --- a/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationDeleteEventArgsBinder.cs +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) 2017 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. - */ - -namespace Tizen.Applications.NotificationEventListener -{ - internal static class NotificationDeleteEventArgsBinder - { - internal static NotificationDeleteEventArgs BindObject(int uniqueNumber) - { - NotificationDeleteEventArgs deleteargs = new NotificationDeleteEventArgs(); - - deleteargs.UniqueNumber = uniqueNumber; - - return deleteargs; - } - } -} \ No newline at end of file diff --git a/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationEventArgs.cs b/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationEventArgs.cs deleted file mode 100755 index 140ab9608..000000000 --- a/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationEventArgs.cs +++ /dev/null @@ -1,185 +0,0 @@ -/* - * Copyright (c) 2017 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. - */ - -namespace Tizen.Applications.NotificationEventListener -{ - using System; - using System.Collections.Generic; - using System.ComponentModel; - - /// - /// This class provides the methods and properties to get information about the posted or updated notification. - /// - public partial class NotificationEventArgs : EventArgs - { - private const string LogTag = "Tizen.Applications.NotificationEventListener"; - - internal IDictionary Style; - internal IDictionary ExtraData; - internal Interop.NotificationEventListener.NotificationSafeHandle Handle; - - /// - /// Initializes a new instance of the class. - /// - public NotificationEventArgs() - { - Style = new Dictionary(); - ExtraData = new Dictionary(); - } - - /// - /// Gets the unique ID of the notification. - /// - public int UniqueNumber { get; internal set; } - - /// - /// Gets the appId of the notification. - /// - public string AppID { get; internal set; } - - /// - /// Gets the title of the notification. - /// - public string Title { get; internal set; } - - /// - /// Gets the content text of the notification. - /// - public string Content { get; internal set; } - - /// - /// Gets the icon's path of the notification. - /// - public string Icon { get; internal set; } - - /// - /// Gets the sub icon path of the notification. - /// - public string SubIcon { get; internal set; } - - /// - /// Gets the timestamp if the notification is visible or not. - /// - public bool IsTimeStampVisible { get; internal set; } - - /// - /// Gets TimeStamp of notification. - /// - /// - /// If IsTimeStampVisible property is set false, this TimeStamp property is meaningless. - /// - public DateTime TimeStamp { get; internal set; } - - /// - /// Gets the count, which is displayed at the right side of notification. - /// - public int Count { get; internal set; } - - /// - /// Gets the tag of notification. - /// - public string Tag { get; internal set; } - - [EditorBrowsable(EditorBrowsableState.Never)] - public bool IsOngoing { get; internal set; } = false; - - /// - /// Gets a value that determines whether notification is displayed on the default viewer. - /// If IsDisplay property is set as false and add style, you can see only style notification. - /// - public bool IsVisible { get; internal set; } = true; - - [EditorBrowsable(EditorBrowsableState.Never)] - public bool HasEventFlag { get; internal set; } = false; - - /// - /// Gets the AppControl, which is invoked when notification is clicked. - /// - public AppControl Action { get; internal set; } - - /// - /// Gets the object of the progress notification. - /// - public ProgressArgs Progress { get; internal set; } - - /// - /// Gets the AccessoryArgs, which has option of sound, vibration, and LED. - /// - public AccessoryArgs Accessory { get; internal set; } - - /// - /// Gets the key for extra data. - /// - public ICollection ExtraDataKey - { - get - { - return ExtraData.Keys; - } - } - - /// - /// Gets the property. - /// - public NotificationProperty Property { get; internal set; } - - /// - /// Gets the styleArgs of active, lock, indicator, and bigpicture. - /// - /// Type of notification style to be queried. - /// The NotificationEventListener.StyleArgs object associated with the given style. - /// Thrown when an argument is invalid. - public T GetStyle() where T : StyleArgs, new() - { - T type = new T(); - StyleArgs style = null; - - Style.TryGetValue(type.Key, out style); - - if (style == null) - { - Log.Error(LogTag, "Invalid Style"); - throw NotificationEventListenerErrorFactory.GetException(Interop.NotificationEventListener.ErrorCode.InvalidParameter, "invalid parameter entered"); - } - else - { - return style as T; - } - } - - /// - /// Gets the ExtraDataArgs. - /// - /// The key that specifies which extra data. - /// Returns the bundle for key. - public Bundle GetExtraData(string key) - { - Bundle bundle; - - if (string.IsNullOrEmpty(key)) - { - throw NotificationEventListenerErrorFactory.GetException(Interop.NotificationEventListener.ErrorCode.InvalidParameter, "invalid parameter entered"); - } - - if (ExtraData.TryGetValue(key, out bundle) == false) - { - throw NotificationEventListenerErrorFactory.GetException(Interop.NotificationEventListener.ErrorCode.InvalidParameter, "invalid parameter entered : " + key); - } - - return bundle; - } - } -} diff --git a/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationEventArgsAccessory.cs b/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationEventArgsAccessory.cs deleted file mode 100755 index 75c1d97ed..000000000 --- a/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationEventArgsAccessory.cs +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright (c) 2017 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. - */ - -namespace Tizen.Applications.NotificationEventListener -{ - using Tizen.Common; - - /// - /// This class provides methods and properties to get information about the posted or updated notification. - /// - public partial class NotificationEventArgs - { - /// - /// Class to get infomation about notification accessory. - /// - public class AccessoryArgs - { - /// - /// Gets the sound option. - /// - public AccessoryOption SoundOption { get; internal set; } - - /// - /// Gets the sound path. - /// - public string SoundPath { get; internal set; } - - /// - /// Gets the vibration option. - /// - public bool CanVibrate { get; internal set; } - - /// - /// Gets the LED option. - /// - public AccessoryOption LedOption { get; internal set; } - - /// - /// Gets LED on time period that you would like the LED on the device to blink as well as the rate. - /// - /// - /// Default value of LedOnMilliseconds is 0. - /// The rate is specified in terms of the number of milliseconds to be on. - /// - public int LedOnMillisecond { get; internal set; } - - /// - /// Gets LED on time period that you would like the LED on the device to blink as well as the rate. - /// - /// - /// Default value of LedOffMillisecond is 0. - /// The rate is specified in terms of the number of millisecond to be off. - /// - public int LedOffMillisecond { get; internal set; } - - /// - /// Gets LED color that you would like the LED on the device to blink. - /// - public Color LedColor { get; internal set; } - } - } -} diff --git a/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationEventArgsActiveStyle.cs b/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationEventArgsActiveStyle.cs deleted file mode 100755 index 161882671..000000000 --- a/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationEventArgsActiveStyle.cs +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Copyright (c) 2017 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. - */ - -namespace Tizen.Applications.NotificationEventListener -{ - using System.Collections.Generic; - - /// - /// This class provides methods and properties to get information about the posted or updated notification. - /// - public partial class NotificationEventArgs - { - /// - /// Class to get infomation about notification active style. - /// - public class ActiveStyleArgs : StyleArgs - { - /// - /// Initializes a new instance of the class. - /// - public ActiveStyleArgs() - { - Button = new List(); - } - - /// - /// Gets the IsAutoRemove option of the active notification. - /// IsAutoRemove option lets the active notification be removed several seconds after it shows. - /// - /// - /// When 'IsAutoRemove' is set as false, the active notification will not be removed as long as the user removes - /// the active notification, or the app which posted the active notification removes the active notification. - /// - public bool IsAutoRemove { get; internal set; } - - /// - /// Gets an absolute path for an image file to display on the background of active notification. - /// - public string BackgroundImage { get; internal set; } - - /// - /// Gets the default button to display highlight on the active notification. - /// - public ButtonIndex DefaultButton { get; internal set; } - - /// - /// Gets timeout value in seconds when the notification can be hidden from the viewer. - /// - public int HideTimeout { get; internal set; } - - /// - /// Gets timeout value in seconds when the notification can be deleted from the viewer. - /// - public int DeleteTimeout { get; internal set; } - - /// - /// Gets Action which is invoked when notification is hidden by user. - /// - /// - /// The property is only reflected on Tizen TV. - /// If you use this API on other profile, this action have no effect - /// - public AppControl HiddenByUserAction { get; internal set; } - - /// - /// Gets or sets Action which is invoked when there is no any response by user until hide timeout. - /// - /// - /// The property is only reflected on Tizen TV. - /// If you use this API on other profile, this action settings have no effect - /// - public AppControl HiddenByTimeoutAction { get; internal set; } - - /// - /// Gets or sets Action which is invoked when the notification is hidden by external factor. - /// - /// - /// If you use this API on other profile, this action settings have no effect - /// - public AppControl HiddenByExternalAction { get; internal set; } - - /// - /// Gets a button to this active notification style. - /// Buttons are displayed in the notification content. - /// - public IList Button { get; internal set; } - - /// - /// Gets a ReplyAction to this active notification style. - /// - public ReplyActionArgs Reply { get; internal set; } - - internal override string Key - { - get - { - return "Active"; - } - } - } - } -} diff --git a/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationEventArgsBinder.cs b/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationEventArgsBinder.cs deleted file mode 100755 index d30292e82..000000000 --- a/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationEventArgsBinder.cs +++ /dev/null @@ -1,213 +0,0 @@ -/* - * Copyright (c) 2017 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. - */ - -namespace Tizen.Applications.NotificationEventListener -{ - using System; - - internal static class NotificationEventArgsBinder - { - private const string LogTag = "Tizen.Applications.NotificationEventListener"; - - internal static NotificationEventArgs BindObject(IntPtr notification, bool data) - { - Interop.NotificationEventListener.ErrorCode err; - int time; - int uniqueNumber = -1; - int groupNumber = -1; - int property; - int doNotShowTimeStamp = -1; - int displayList; - bool eventFlag = false; - NotificationLayout layout; - NotificationType type; - string text; - IntPtr extention = IntPtr.Zero; - IntPtr dummy = IntPtr.Zero; - SafeAppControlHandle appcontrol = null; - - NotificationEventArgs eventargs = new NotificationEventArgs(); - - eventargs.Handle = new Interop.NotificationEventListener.NotificationSafeHandle(notification, data); - - err = Interop.NotificationEventListener.GetID(eventargs.Handle, out groupNumber, out uniqueNumber); - if (err != Interop.NotificationEventListener.ErrorCode.None) - { - Log.Error(LogTag, "unable to get UniqueNumber"); - } - - eventargs.UniqueNumber = uniqueNumber; - - Interop.NotificationEventListener.GetAppId(eventargs.Handle, out text); - if (string.IsNullOrEmpty(text) == false) - { - eventargs.AppID = text; - } - - Interop.NotificationEventListener.GetText(eventargs.Handle, NotificationText.Title, out text); - if (string.IsNullOrEmpty(text) == false) - { - eventargs.Title = text; - } - - Interop.NotificationEventListener.GetText(eventargs.Handle, NotificationText.Content, out text); - if (string.IsNullOrEmpty(text) == false) - { - eventargs.Content = text; - } - - Interop.NotificationEventListener.GetImage(eventargs.Handle, NotificationImage.Icon, out text); - if (string.IsNullOrEmpty(text) == false) - { - eventargs.Icon = text; - } - - Interop.NotificationEventListener.GetImage(eventargs.Handle, NotificationImage.SubIcon, out text); - if (string.IsNullOrEmpty(text) == false) - { - eventargs.SubIcon = text; - } - - err = Interop.NotificationEventListener.GetTime(eventargs.Handle, out time); - if (err != Interop.NotificationEventListener.ErrorCode.None) - { - Log.Info(LogTag, "unable to get TimeStamp"); - } - - if (time == doNotShowTimeStamp) - { - eventargs.IsTimeStampVisible = false; - } - else - { - eventargs.IsTimeStampVisible = true; - - if (time == 0) - { - err = Interop.NotificationEventListener.GetInsertTime(eventargs.Handle, out time); - if (err != Interop.NotificationEventListener.ErrorCode.None) - { - Log.Info(LogTag, "unable to get InsertTime"); - } - } - - eventargs.TimeStamp = (new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc)).AddSeconds(time).ToLocalTime(); - } - - err = Interop.NotificationEventListener.GetText(eventargs.Handle, NotificationText.EventCount, out text); - if (err != Interop.NotificationEventListener.ErrorCode.None) - { - Log.Info(LogTag, "unable to get Event Count"); - } - - if (string.IsNullOrEmpty(text) == false) - { - try - { - eventargs.Count = int.Parse(text); - } - catch (Exception ex) - { - Log.Error(LogTag, ex.ToString()); - } - } - - err = Interop.NotificationEventListener.GetAppControl(eventargs.Handle, LaunchOption.AppControl, out appcontrol); - if (err != Interop.NotificationEventListener.ErrorCode.None) - { - Log.Info(LogTag, "unable to get Action"); - } - - if (appcontrol != null && appcontrol.IsInvalid == false) - { - eventargs.Action = new AppControl(appcontrol); - } - - Interop.NotificationEventListener.GetTag(eventargs.Handle, out text); - if (string.IsNullOrEmpty(text) == false) - { - eventargs.Tag = text; - } - - err = Interop.NotificationEventListener.GetProperties(eventargs.Handle, out property); - if (err != Interop.NotificationEventListener.ErrorCode.None) - { - Log.Info(LogTag, "unable to get Property"); - } - else - { - eventargs.Property = (NotificationProperty)property; - } - - Interop.NotificationEventListener.GetStyleList(eventargs.Handle, out displayList); - if ((displayList & (int)NotificationDisplayApplist.Tray) == 0) - { - eventargs.IsVisible = false; - } - - err = Interop.NotificationEventListener.GetExtentionBundle(eventargs.Handle, out extention, out dummy); - if (err != Interop.NotificationEventListener.ErrorCode.None) - { - Log.Info(LogTag, "unable to get Extender"); - } - - if (extention != IntPtr.Zero) - { - Bundle bundle = new Bundle(new SafeBundleHandle(extention, false)); - foreach (string key in bundle.Keys) - { - if (key.StartsWith("_NOTIFICATION_EXTENSION_EVENT_")) - continue; - - SafeBundleHandle sbh; - Interop.NotificationEventListener.GetExtender(eventargs.Handle, key, out sbh); - eventargs.ExtraData.Add(key, new Bundle(sbh)); - } - } - - err = Interop.NotificationEventListener.GetLayout(eventargs.Handle, out layout); - if (err != Interop.NotificationEventListener.ErrorCode.None) - { - Log.Info(LogTag, "unable to get layout"); - } - - err = Interop.NotificationEventListener.GetType(eventargs.Handle, out type); - if (err != Interop.NotificationEventListener.ErrorCode.None) - { - Log.Info(LogTag, "unable to get type"); - } - - if (layout == NotificationLayout.OngoingEvent && type == NotificationType.Ongoing) - { - eventargs.IsOngoing = true; - } - - err = Interop.NotificationEventListener.GetEventFlag(eventargs.Handle, out eventFlag); - if (err != Interop.NotificationEventListener.ErrorCode.None) - { - Log.Info(LogTag, "unable to get event flag"); - } - - eventargs.HasEventFlag = eventFlag; - - NotificationAccessoryAgsBinder.BindObject(eventargs); - NotificationStyleArgBinder.BindObject(eventargs); - NotificationProgressArgBinder.BindObject(eventargs); - - return eventargs; - } - } -} diff --git a/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationEventArgsButtonAction.cs b/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationEventArgsButtonAction.cs deleted file mode 100755 index bbc528995..000000000 --- a/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationEventArgsButtonAction.cs +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) 2017 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. - */ - -namespace Tizen.Applications.NotificationEventListener -{ - /// - /// This class provides methods and properties to get information about the posted or updated notification. - /// - public partial class NotificationEventArgs - { - /// - /// Class to get infomation about notification ButtonAction. - /// - public class ButtonActionArgs - { - /// - /// Gets the index of the button, which appears at notification. - /// - public ButtonIndex Index { get; internal set; } - - /// - /// Gets the text that describes the button. - /// - public string Text { get; internal set; } - - /// - /// Gets the image's path that represents the button. - /// - public string ImagePath { get; internal set; } - - /// - /// Gets the AppControl that is invoked when the button is clicked. - /// - public AppControl Action { get; internal set; } - } - } -} \ No newline at end of file diff --git a/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationEventArgsEnumerations.cs b/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationEventArgsEnumerations.cs deleted file mode 100755 index 134479fec..000000000 --- a/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationEventArgsEnumerations.cs +++ /dev/null @@ -1,493 +0,0 @@ -/* - * Copyright (c) 2017 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. - */ - -namespace Tizen.Applications.NotificationEventListener -{ - using System; - using System.ComponentModel; - - /// - /// Enumeration for the progress category. - /// - public enum ProgressCategory - { - /// - /// Value for the percent type. - /// - Percent, - - /// - /// Value for the time type. - /// - Time, - - /// - /// Value for the pending type, which is not the updated progress current value. - /// - PendingBar - } - - /// - /// Enumeration for the accessory option. - /// - public enum AccessoryOption - { - /// - /// Value for off accessory option. - /// - Off = -1, - - /// - /// Value for on accessory option. - /// - On, - - /// - /// Value for the custom accessory option. - /// - Custom - } - - /// - /// Enumeration for the button index. - /// - public enum ButtonIndex - { - /// - /// Value for the default button index. - /// - None = -1, - - /// - /// Value for the first button index. - /// - First, - - /// - /// Value for the second button index. - /// - Second, - - /// - /// Value for the third button index. - /// - Third - } - - /// - /// Enumeration for the notification particular property. - /// - [Flags] - public enum NotificationProperty - { - /// - /// Value for the adjust nothing. - /// - None = 0x00, - - /// - /// Value for display only when SIM card inserted. - /// - DisplayOnlySimMode = 0x01, - - /// - /// Value for disable application launch when it is selected. - /// - DisableAppLaunch = 0x02, - - /// - /// Value for disable auto delete when it is selected. - /// - DisableAutoDelete = 0x04, - - /// - /// Value for deleted when device is rebooted even though notification is not set OngoingType. - /// - VolatileDisplay = 0x100, - } - - /// - /// Enumeration for event type on notification. - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public enum UserEventType - { - /// - /// Event type : Click on button 1. - /// - ClickOnButton1 = 0, - - /// - /// Event type : Click on button 2. - /// - ClickOnButton2, - - /// - /// Event type : Click on button 3. - /// - ClickOnButton3, - - /// - /// Event type : Click on text_input button. - /// - ClickOnReplyButton = 8, - - /// - /// Event type : Hidden by user. - /// - HiddenByUser = 100, - - /// - /// Event type : Deleted by timer. - /// - HiddenByTimeout = 101, - - /// - /// Event type : Deleted by timer. - /// - HiddenByExternal = 102, - - /// - /// Event type : Clicked by user. - /// - ClickOnNotification = 200, - - /// - /// Event type : Deleted by user. - /// - DeleteNotification = 201, - } - - /// - /// Enumeration for notification type. - /// - internal enum NotificationType - { - /// - /// Notification type. - /// - Notification = 0, - - /// - /// Ongoing type. - /// - Ongoing, - } - - /// - /// Enumeration for notification text type. - /// - internal enum NotificationText - { - /// - /// Title. - /// - Title = 0, - - /// - /// Content. - /// - Content, - - /// - /// Text to display the event count. - /// - EventCount = 3, - - /// - /// Box contents 1. - /// - FirstMainText, - - /// - /// Box contents 1-1. - /// - FirstSubText, - - /// - /// Box contents 2. - /// - SecondMainText, - - /// - /// Box contents 2-1. - /// - SecondSubText, - - /// - /// Text on button 1. - /// - FirstButton = 13, - - /// - /// Text on button 2. - /// - SecondButton, - - /// - /// Text on button 3. - /// - ThirdButton, - - /// - /// Guide text on the message reply box. - /// - PlaceHolder = 19, - - /// - /// Text on button on the message reply box. - /// - InputButton = 20, - } - - /// - /// Enumeration for the image type. - /// - internal enum NotificationImage - { - /// - /// Icon. - /// - Icon = 0, - - /// - /// Indicator icon. - /// - Indicator, - - /// - /// Lock screen icon. - /// - Lockscreen, - - /// - /// Thumbnail. - /// - Thumbnail, - - /// - /// Lock screen thumbnail. - /// - ThumbnailLockscreen, - - /// - /// Icon. - /// - SubIcon, - - /// - /// Image displayed on background. - /// - Background, - - /// - /// Image for button 1. - /// - Button_1 = 12, - - /// - /// Image for button 2. - /// - Button_2, - - /// - /// Image for button 3. - /// - Button_3, - - /// - /// Image for message reply. - /// - TextInputButton = 18, - } - - /// - /// Enumeration for notification layout type. - /// - internal enum NotificationLayout - { - /// - /// Default. - /// - None = 0, - - /// - /// Layout for notification. Used to inform single event. - /// - SingleEvent = 1, - - /// - /// Layout for notification. Used to display images. - /// - Thumbnail = 3, - - /// - /// Layout for ongoing notification. Used to display text message. - /// - OngoingEvent = 4, - - /// - /// Layout for ongoing notification. Used to display progress. - /// - OngoingProgress = 5, - } - - /// - /// Enumeration for notification launch option type. - /// - internal enum LaunchOption - { - /// - /// Launching with application control. - /// - AppControl = 1 - } - - /// - /// Enumeration for notification operation data code. - /// - internal enum NotificationOperationDataType - { - /// - /// Default. - /// - Min = 0, - - /// - /// Operation type. - /// - Type, - - /// - /// Private ID. - /// - UniqueNumber, - - /// - /// Notification handler. - /// - Notification, - - /// - /// Reserved. - /// - ExtraInformation1, - - /// - /// Reserved. - /// - ExtraInformation2, - } - - /// - /// Enumeration for notification operation code. - /// - internal enum NotificationOperationType - { - /// - /// Default. - /// - None = 0, - - /// - /// Notification inserted. - /// - Insert, - - /// - /// Notification updated. - /// - Update, - - /// - /// Notification deleted. - /// - Delete, - } - - /// - /// Enumeration for event type on notification. - /// - internal enum ClickEventType - { - /// - /// Event type : Click on button 1. - /// - FirstButton = 0, - - /// - /// Event type : Click on button 2. - /// - SecondButton = 1, - - /// - /// Event type : Click on button 3. - /// - ThirdButton = 2, - - /// - /// Event type : Click on icon. - /// - Icon = 6, - - /// - /// Event type : Click on thumbnail. - /// - Thumbnail = 7, - - /// - /// Event type : Click on text_input button. - /// - InputButton = 8, - } - - /// - /// Enumeration for display application list. - /// - [Flags] - internal enum NotificationDisplayApplist - { - /// - /// Notification Tray(Quickpanel). - /// - Tray = 0x00000001, - - /// - /// Ticker notification. - /// - Ticker = 0x00000002, - - /// - /// Lock screen. - /// - Lock = 0x00000004, - - /// - /// Indicator. - /// - Indicator = 0x00000008, - - /// - /// Active notification. - /// - Active = 0x00000010, - - /// - /// All display application except active notification. - /// - All = 0x0000000f, - } -} diff --git a/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationEventArgsIndicatorStyle.cs b/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationEventArgsIndicatorStyle.cs deleted file mode 100755 index 32ad1f53d..000000000 --- a/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationEventArgsIndicatorStyle.cs +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017 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. - */ - -namespace Tizen.Applications.NotificationEventListener -{ - /// - /// This class provides methods and properties to get information about the posted or updated notification. - /// - public partial class NotificationEventArgs - { - /// - /// Class to generate the indicator style notification. - /// - public class IndicatorStyleArgs : StyleArgs - { - /// - /// Gets the path of the image file to display on the icon of indicator style. - /// - public string IconPath { get; internal set; } - - /// - /// Gets the sub text to display indicator style. - /// - public string SubText { get; internal set; } - - internal override string Key - { - get - { - return "Indicator"; - } - } - } - } -} diff --git a/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationEventArgsLockStyle.cs b/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationEventArgsLockStyle.cs deleted file mode 100755 index 3a24f18d3..000000000 --- a/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationEventArgsLockStyle.cs +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017 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. - */ - -namespace Tizen.Applications.NotificationEventListener -{ - /// - /// This class provides methods and properties to get information about the posted or updated notification. - /// - public partial class NotificationEventArgs - { - /// - /// Class to get infomation about notification lock style. - /// - public class LockStyleArgs : StyleArgs - { - /// - /// Gets the path of the image file to display on the icon of lock style. - /// - public string IconPath { get; internal set; } - - /// - /// Gets the path of the thumbnail image file to display on the icon of lock style. - /// - public string Thumbnail { get; internal set; } - - internal override string Key - { - get - { - return "Lock"; - } - } - } - } -} diff --git a/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationEventArgsProgress.cs b/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationEventArgsProgress.cs deleted file mode 100755 index 069d4e8a9..000000000 --- a/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationEventArgsProgress.cs +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) 2017 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. - */ - -namespace Tizen.Applications.NotificationEventListener -{ - /// - /// This class provides methods and properties to get information about the posted or updated notification. - /// - public partial class NotificationEventArgs - { - /// - /// Class to get infomation about progress notification. - /// - public class ProgressArgs - { - /// - /// Gets category of ProgressType. - /// - public ProgressCategory Category { get; internal set; } - - /// - /// Gets current value of ProgressType. - /// - public double Current { get; internal set; } - - /// - /// Gets max value of ProgressType. - /// - public double Max { get; internal set; } - } - } -} \ No newline at end of file diff --git a/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationEventArgsReplyAction.cs b/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationEventArgsReplyAction.cs deleted file mode 100755 index 426f496ad..000000000 --- a/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationEventArgsReplyAction.cs +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) 2017 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. - */ - -namespace Tizen.Applications.NotificationEventListener -{ - /// - /// This class provides methods and properties to get information about the posted or updated notification. - /// - public partial class NotificationEventArgs - { - /// - /// Class to get infomation about notification ReplyAction. - /// - public class ReplyActionArgs - { - /// - /// Gets index of button, which appears at notification. - /// If there is no ParentIndex, the ReplyAction should be displayed directly on the active notification. - /// - public ButtonIndex ParentIndex { get; internal set; } = ButtonIndex.None; - - /// - /// Gets the PlaceHolderText of ReplyAction, which appears at notification. - /// It will be displayed to the text input box on the active notification. - /// - public string PlaceHolderText { get; internal set; } - - /// - /// Gets a max length of text input. - /// - public int ReplyMax { get; internal set; } - - /// - /// Gets the button displayed in the replyaction. - /// - public ButtonActionArgs Button { get; internal set; } - } - } -} \ No newline at end of file diff --git a/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationEventArgsStyle.cs b/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationEventArgsStyle.cs deleted file mode 100755 index 69af7d2dd..000000000 --- a/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationEventArgsStyle.cs +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (c) 2017 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. - */ - -namespace Tizen.Applications.NotificationEventListener -{ - /// - /// This class provides methods and properties to get information about the posted or updated notification. - /// - public partial class NotificationEventArgs - { - public abstract class StyleArgs - { - internal abstract string Key { get; } - } - } -} diff --git a/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationEventListenerErrorFactory.cs b/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationEventListenerErrorFactory.cs deleted file mode 100755 index 8a6bbcb1a..000000000 --- a/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationEventListenerErrorFactory.cs +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright (c) 2017 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. - */ - -namespace Tizen.Applications.NotificationEventListener -{ - using System; - using System.Runtime.CompilerServices; - - internal static class NotificationEventListenerErrorFactory - { - private const string LogTag = "Tizen.Applications.NotificationEventListener"; - - internal static Exception GetException( - Interop.NotificationEventListener.ErrorCode err, - string msg, - [CallerMemberName] string memberName = "", - [CallerFilePath] string filePath = "", - [CallerLineNumber] int lineNumber = 0) - { - Log.Error(LogTag, memberName + " : " + lineNumber); - switch (err) - { - case Interop.NotificationEventListener.ErrorCode.InvalidParameter: - Log.Error(LogTag, msg); - return new ArgumentException(err + " error occurred."); - case Interop.NotificationEventListener.ErrorCode.PermissionDenied: - Log.Error(LogTag, msg); - return new UnauthorizedAccessException(err + "Permission denied."); - default: - Log.Error(LogTag, msg); - return new InvalidOperationException(err + " error occurred."); - } - } - } -} diff --git a/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationListenerManager.cs b/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationListenerManager.cs deleted file mode 100755 index 4d6f58241..000000000 --- a/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationListenerManager.cs +++ /dev/null @@ -1,417 +0,0 @@ -/* - * Copyright (c) 2017 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. - */ - -namespace Tizen.Applications.NotificationEventListener -{ - using System; - using System.Collections.Generic; - using System.ComponentModel; - using System.Runtime.InteropServices; - - /// - /// This class provides a way to register callback function for some notification events. - /// - /// - /// The event listener can use this class to get a list of notifications or to clear notifications. - /// - public partial class NotificationListenerManager - { - private const string LogTag = "Tizen.Applications.NotificationEventListener"; - - private static event EventHandler AddEventHandler; - - private static event EventHandler UpdateEventHandler; - - private static event EventHandler DeleteEventHandler; - - private static Interop.NotificationEventListener.ChangedCallback callback; - - [StructLayout(LayoutKind.Sequential)] - private struct NotificationOperation - { - NotificationOperationType type; - int uniqueNumber; - int extraInformation1; - int extraInformation2; - IntPtr notification; - } - - private static int GetEventHandleLength() - { - int length = 0; - - length += (DeleteEventHandler == null) ? 0 : DeleteEventHandler.GetInvocationList().Length; - length += (UpdateEventHandler == null) ? 0 : UpdateEventHandler.GetInvocationList().Length; - length += (AddEventHandler == null) ? 0 : AddEventHandler.GetInvocationList().Length; - - return length; - } - - /// - /// Event handler for notification insert event. - /// - /// Thrown in case of an invalid parameter. - /// Thrown in case of a permission is denied. - /// Thrown in case of any internal error. - /// http://tizen.org/privilege/notification - public static event EventHandler Added - { - add - { - if (callback == null) - { - callback = new Interop.NotificationEventListener.ChangedCallback(ChangedEvent); - } - - if (GetEventHandleLength() == 0) - { - Interop.NotificationEventListener.ErrorCode err = Interop.NotificationEventListener.SetChangedCallback(callback, IntPtr.Zero); - if (err != (int)Interop.NotificationEventListener.ErrorCode.None) - { - throw NotificationEventListenerErrorFactory.GetException(err, "unable to set changed callback"); - } - } - - AddEventHandler += value; - } - - remove - { - if (AddEventHandler != null && AddEventHandler.GetInvocationList().Length > 0) - { - AddEventHandler -= value; - - if (GetEventHandleLength() == 0) - { - Interop.NotificationEventListener.ErrorCode err = Interop.NotificationEventListener.UnsetChangedCallback(callback); - if (err != (int)Interop.NotificationEventListener.ErrorCode.None) - { - throw NotificationEventListenerErrorFactory.GetException(err, "unable to unset changed callback"); - } - } - } - } - } - - /// - /// Event handler for notification update event. - /// - /// Thrown in case of an invalid parameter. - /// Thrown in case of a permission is denied. - /// Thrown in case of any internal error. - /// http://tizen.org/privilege/notification - public static event EventHandler Updated - { - add - { - if (callback == null) - { - callback = new Interop.NotificationEventListener.ChangedCallback(ChangedEvent); - } - - if (GetEventHandleLength() == 0) - { - Interop.NotificationEventListener.ErrorCode err = Interop.NotificationEventListener.SetChangedCallback(callback, IntPtr.Zero); - if (err != Interop.NotificationEventListener.ErrorCode.None) - { - throw NotificationEventListenerErrorFactory.GetException(err, "unable to set changed callback"); - } - } - - UpdateEventHandler += value; - } - - remove - { - if (UpdateEventHandler != null && UpdateEventHandler.GetInvocationList().Length > 0) - { - UpdateEventHandler -= value; - - if (GetEventHandleLength() == 0) - { - Interop.NotificationEventListener.ErrorCode err = Interop.NotificationEventListener.UnsetChangedCallback(callback); - if (err != Interop.NotificationEventListener.ErrorCode.None) - { - throw NotificationEventListenerErrorFactory.GetException(err, "unable to unset changed callback"); - } - } - } - } - } - - /// - /// Event handler for notification delete event. - /// - /// Thrown in case of an invalid parameter. - /// Thrown in case of a permission is denied. - /// Thrown in case of any internal error. - /// http://tizen.org/privilege/notification - public static event EventHandler Deleted - { - add - { - if (callback == null) - { - callback = new Interop.NotificationEventListener.ChangedCallback(ChangedEvent); - } - - if (GetEventHandleLength() == 0) - { - Interop.NotificationEventListener.ErrorCode err = Interop.NotificationEventListener.SetChangedCallback(callback, IntPtr.Zero); - if (err != Interop.NotificationEventListener.ErrorCode.None) - { - throw NotificationEventListenerErrorFactory.GetException(err, "unable to set changed callback"); - } - } - - DeleteEventHandler += value; - } - - remove - { - if (DeleteEventHandler != null && DeleteEventHandler.GetInvocationList().Length > 0) - { - DeleteEventHandler -= value; - - if (GetEventHandleLength() == 0) - { - Interop.NotificationEventListener.ErrorCode err = Interop.NotificationEventListener.UnsetChangedCallback(callback); - if (err != Interop.NotificationEventListener.ErrorCode.None) - { - throw NotificationEventListenerErrorFactory.GetException(err, "unable to unset changed callback"); - } - } - } - } - } - - private static void ChangedEvent(IntPtr userData, NotificationType type, IntPtr operationList, int num) - { - IntPtr operationType; - IntPtr uniqueNumber; - IntPtr notification; - - NotificationEventArgs eventargs; - NotificationDeleteEventArgs deleteargs; - - for (int i = 0; i < num; i++) - { - uniqueNumber = IntPtr.Zero; - operationType = IntPtr.Zero; - notification = IntPtr.Zero; - - Interop.NotificationEventListener.GetOperationData(operationList + (i * Marshal.SizeOf()), NotificationOperationDataType.Type, out operationType); - Interop.NotificationEventListener.GetOperationData(operationList + (i * Marshal.SizeOf()), NotificationOperationDataType.UniqueNumber, out uniqueNumber); - Interop.NotificationEventListener.GetOperationData(operationList + (i * Marshal.SizeOf()), NotificationOperationDataType.Notification, out notification); - - if (operationType == IntPtr.Zero) - { - Log.Error(LogTag, "unable to get operationType"); - continue; - } - - Log.Info(LogTag, "type : " + ((int)operationType).ToString()); - Log.Info(LogTag, "Add : " + (AddEventHandler == null ? "0" : AddEventHandler.GetInvocationList().Length.ToString())); - Log.Info(LogTag, "update: " + (UpdateEventHandler == null ? "0" : UpdateEventHandler.GetInvocationList().Length.ToString())); - Log.Info(LogTag, "delete : " + (DeleteEventHandler == null ? "0" : DeleteEventHandler.GetInvocationList().Length.ToString())); - - switch ((int)operationType) - { - case (int)NotificationOperationType.Insert: - if (notification != IntPtr.Zero) - { - try - { - eventargs = NotificationEventArgsBinder.BindObject(notification, false); - AddEventHandler?.Invoke(null, eventargs); - } - catch (Exception e) - { - Log.Error(LogTag, e.Message); - } - } - - break; - - case (int)NotificationOperationType.Update: - if (notification != IntPtr.Zero) - { - try - { - eventargs = NotificationEventArgsBinder.BindObject(notification, false); - UpdateEventHandler?.Invoke(null, eventargs); - } - catch (Exception e) - { - Log.Error(LogTag, e.Message); - } - } - - break; - - case (int)NotificationOperationType.Delete: - if (uniqueNumber != IntPtr.Zero) - { - try - { - deleteargs = NotificationDeleteEventArgsBinder.BindObject((int)uniqueNumber); - DeleteEventHandler?.Invoke(null, deleteargs); - } - catch (Exception e) - { - Log.Error(LogTag, e.Message); - } - } - - break; - - default: - Log.Info(LogTag, "Event : " + (int)operationType); - break; - } - } - } - - /// - /// Deletes a notification with appId and uniqueNumber. - /// - /// The name of the application you want to delete. - /// The unique number of the notification. - /// Thrown in case of an invalid parameter. - /// Thrown in case of a permission is denied. - /// Thrown in case of any internal error. - /// http://tizen.org/privilege/notification - public static void Delete(string appId, int uniqueNumber) - { - Interop.NotificationEventListener.ErrorCode err; - - if (string.IsNullOrEmpty(appId) || uniqueNumber < 0) - { - throw NotificationEventListenerErrorFactory.GetException(Interop.NotificationEventListener.ErrorCode.InvalidParameter, "invalid parameter"); - } - - err = Interop.NotificationEventListener.Delete(appId, 0, uniqueNumber); - if (err != Interop.NotificationEventListener.ErrorCode.None) - { - throw NotificationEventListenerErrorFactory.GetException(err, "unable to delete"); - } - } - - /// - /// Deletes all notifications. - /// - /// Thrown in case of a permission is denied. - /// Thrown in case of any internal error. - /// http://tizen.org/privilege/notification - public static void DeleteAll() - { - Interop.NotificationEventListener.ErrorCode err; - - err = Interop.NotificationEventListener.DeleteAll((int)NotificationType.Notification); - if (err != Interop.NotificationEventListener.ErrorCode.None) - { - throw NotificationEventListenerErrorFactory.GetException(err, "delete all notifications failed of Noti type"); - } - - err = Interop.NotificationEventListener.DeleteAll((int)NotificationType.Ongoing); - if (err != Interop.NotificationEventListener.ErrorCode.None) - { - throw NotificationEventListenerErrorFactory.GetException(err, "delete all notifications failed of Ongoing type"); - } - } - - /// - /// Returns the notification list. - /// - /// Thrown in case of a permission is denied. - /// Thrown in case of any internal error. - /// http://tizen.org/privilege/notification - public static IList GetList() - { - Interop.NotificationEventListener.ErrorCode err; - IntPtr notificationList = IntPtr.Zero; - IntPtr currentList = IntPtr.Zero; - IList list = new List(); - - err = Interop.NotificationEventListener.GetList(NotificationType.Notification, -1, out notificationList); - if (err != Interop.NotificationEventListener.ErrorCode.None) - { - throw NotificationEventListenerErrorFactory.GetException(err, "unable to get notification list"); - } - - if (notificationList != IntPtr.Zero) - { - currentList = notificationList; - while (currentList != IntPtr.Zero) - { - IntPtr notification; - NotificationEventArgs eventargs = new NotificationEventArgs(); - - notification = Interop.NotificationEventListener.GetData(currentList); - - eventargs = NotificationEventArgsBinder.BindObject(notification, false); - - list.Add(eventargs); - - currentList = Interop.NotificationEventListener.GetNext(currentList); - } - - Interop.NotificationEventListener.NotificationListFree(notificationList); - notificationList = IntPtr.Zero; - } - - err = Interop.NotificationEventListener.GetList(NotificationType.Ongoing, -1, out notificationList); - if (err != Interop.NotificationEventListener.ErrorCode.None) - { - throw NotificationEventListenerErrorFactory.GetException(err, "unable to get notification list"); - } - - if (notificationList != IntPtr.Zero) - { - currentList = notificationList; - while (currentList != IntPtr.Zero) - { - IntPtr notification; - NotificationEventArgs eventargs = new NotificationEventArgs(); - - notification = Interop.NotificationEventListener.GetData(currentList); - - eventargs = NotificationEventArgsBinder.BindObject(notification, false); - - list.Add(eventargs); - - currentList = Interop.NotificationEventListener.GetNext(currentList); - } - - Interop.NotificationEventListener.NotificationListFree(notificationList); - } - - return list; - } - - [EditorBrowsable(EditorBrowsableState.Never)] - public static void SendEvent(int uniqueNumber, UserEventType type) - { - Interop.NotificationEventListener.ErrorCode err; - - err = Interop.NotificationEventListener.SendEvent(uniqueNumber, (int)type); - if (err != Interop.NotificationEventListener.ErrorCode.None) - { - throw NotificationEventListenerErrorFactory.GetException(err, "failed to send event"); - } - } - } -} diff --git a/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationProgressArgsBinder.cs b/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationProgressArgsBinder.cs deleted file mode 100755 index 8611503a9..000000000 --- a/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationProgressArgsBinder.cs +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) 2017 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. - */ - -namespace Tizen.Applications.NotificationEventListener -{ - internal static class NotificationProgressArgBinder - { - internal static void BindObject(NotificationEventArgs eventargs) - { - NotificationLayout layout; - Interop.NotificationEventListener.GetLayout(eventargs.Handle, out layout); - - if (layout == NotificationLayout.OngoingProgress) - { - ProgressCategory category; - double current, max; - - Interop.NotificationEventListener.GetOngoingType(eventargs.Handle, out category); - Interop.NotificationEventListener.GetProgress(eventargs.Handle, out current); - Interop.NotificationEventListener.GetProgressSize(eventargs.Handle, out max); - - if (category == ProgressCategory.Percent) - { - current *= 100; - - if (current == 0 && max == 0) - category = ProgressCategory.PendingBar; - } - - eventargs.Progress = new NotificationEventArgs.ProgressArgs(); - eventargs.Progress.Current = current; - eventargs.Progress.Max = max; - eventargs.Progress.Category = category; - } - } - } -} diff --git a/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationReplyActionArgsBinder.cs b/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationReplyActionArgsBinder.cs deleted file mode 100755 index 98a9da95f..000000000 --- a/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationReplyActionArgsBinder.cs +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Copyright (c) 2017 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. - */ - -namespace Tizen.Applications.NotificationEventListener -{ - using System; - - internal static class NotificationReplyActionArgBinder - { - private const string LogTag = "Tizen.Applications.NotificationEventListener"; - - internal static void BindObject(NotificationEventArgs eventargs) - { - string text; - int max; - bool isExisted = false; - SafeAppControlHandle appcontrol = null; - Bundle bundle; - NotificationEventArgs.ReplyActionArgs reply = new NotificationEventArgs.ReplyActionArgs(); - NotificationEventArgs.ButtonActionArgs button = new NotificationEventArgs.ButtonActionArgs(); - string replyKey = "__PARENT_INDEX__"; - - Interop.NotificationEventListener.GetImage(eventargs.Handle, NotificationImage.TextInputButton, out text); - if (string.IsNullOrEmpty(text) == false) - { - isExisted = true; - button.ImagePath = text; - } - - Interop.NotificationEventListener.GetText(eventargs.Handle, NotificationText.InputButton, out text); - if (string.IsNullOrEmpty(text) == false) - { - isExisted = true; - button.Text = text; - } - - Interop.NotificationEventListener.GetEventHandler(eventargs.Handle, (int)ClickEventType.InputButton, out appcontrol); - - if (appcontrol != null && appcontrol.IsInvalid == false) - { - button.Action = new AppControl(appcontrol); - isExisted = true; - } - - reply.Button = button; - - Interop.NotificationEventListener.GetText(eventargs.Handle, NotificationText.PlaceHolder, out text); - - if (string.IsNullOrEmpty(text) == false) - { - isExisted = true; - reply.PlaceHolderText = text; - } - - Interop.NotificationEventListener.GetPlaceHolderLength(eventargs.Handle, out max); - reply.ReplyMax = max; - if (max > 0) - { - isExisted = true; - } - - if (eventargs.ExtraData.TryGetValue(replyKey, out bundle)) - { - if (bundle.Contains(replyKey)) - { - string parentIndex; - if (bundle.TryGetItem(replyKey, out parentIndex)) - { - try - { - reply.ParentIndex = (ButtonIndex)int.Parse(parentIndex); - isExisted = true; - } - catch (Exception ex) - { - Log.Error(LogTag, "unable to get ParentIndex " + ex.Message); - } - } - } - } - - if (isExisted) - { - (eventargs.Style["Active"] as NotificationEventArgs.ActiveStyleArgs).Reply = reply; - } - } - } -} \ No newline at end of file diff --git a/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationStyleArgsBinder.cs b/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationStyleArgsBinder.cs deleted file mode 100755 index 0ccf9bba9..000000000 --- a/src/Tizen.Applications.NotificationEventListener/Tizen.Applications.NotificationEventListener/NotificationStyleArgsBinder.cs +++ /dev/null @@ -1,116 +0,0 @@ -/* - * Copyright (c) 2017 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. - */ - -namespace Tizen.Applications.NotificationEventListener -{ - using System; - - internal static class NotificationStyleArgBinder - { - internal static void BindObject(NotificationEventArgs eventargs) - { - bool autoRemove; - string path; - int styleList; - int timeout; - SafeAppControlHandle appcontrol = null; - - Interop.NotificationEventListener.GetStyleList(eventargs.Handle, out styleList); - - if ((styleList & (int)NotificationDisplayApplist.Active) != 0) - { - NotificationEventArgs.ActiveStyleArgs activeStyle = new NotificationEventArgs.ActiveStyleArgs(); - eventargs.Style.Add(activeStyle.Key, activeStyle); - - for (int i = (int)ClickEventType.FirstButton; i <= (int)ClickEventType.ThirdButton; i++) - { - NotificationButtonActionArgBinder.BindObject(eventargs, i); - } - - Interop.NotificationEventListener.GetAutoRemove(eventargs.Handle, out autoRemove); - activeStyle.IsAutoRemove = autoRemove; - - Interop.NotificationEventListener.GetImage(eventargs.Handle, NotificationImage.Background, out path); - activeStyle.BackgroundImage = path; - - int index; - Interop.NotificationEventListener.GetDefaultButton(eventargs.Handle, out index); - activeStyle.DefaultButton = (ButtonIndex)(index - 1); - - Interop.NotificationEventListener.GetHideTimeout(eventargs.Handle, out timeout); - activeStyle.HideTimeout = timeout; - - try - { - Interop.NotificationEventListener.GetDeleteTimeout(eventargs.Handle, out timeout); - } - catch (TypeLoadException) - { - //To support in API version 3.0 - timeout = 60; - } - activeStyle.DeleteTimeout = timeout; - - appcontrol = null; - Interop.NotificationEventListener.GetExtensionAction(eventargs.Handle, UserEventType.HiddenByUser, out appcontrol); - if (appcontrol != null && appcontrol.IsInvalid == false) - { - activeStyle.HiddenByUserAction = new AppControl(appcontrol); - } - - appcontrol = null; - Interop.NotificationEventListener.GetExtensionAction(eventargs.Handle, UserEventType.HiddenByTimeout, out appcontrol); - if (appcontrol != null && appcontrol.IsInvalid == false) - { - activeStyle.HiddenByTimeoutAction = new AppControl(appcontrol); - } - - appcontrol = null; - Interop.NotificationEventListener.GetExtensionAction(eventargs.Handle, UserEventType.HiddenByExternal, out appcontrol); - if (appcontrol != null && appcontrol.IsInvalid == false) - { - activeStyle.HiddenByExternalAction = new AppControl(appcontrol); - } - - NotificationReplyActionArgBinder.BindObject(eventargs); - } - - if ((styleList & (int)NotificationDisplayApplist.Lock) != 0) - { - NotificationEventArgs.LockStyleArgs lockStyle = new NotificationEventArgs.LockStyleArgs(); - eventargs.Style.Add(lockStyle.Key, lockStyle); - - Interop.NotificationEventListener.GetImage(eventargs.Handle, NotificationImage.Lockscreen, out path); - lockStyle.IconPath = path; - - Interop.NotificationEventListener.GetImage(eventargs.Handle, NotificationImage.ThumbnailLockscreen, out path); - lockStyle.Thumbnail = path; - } - - if ((styleList & (int)NotificationDisplayApplist.Ticker) != 0 || (styleList & (int)NotificationDisplayApplist.Indicator) != 0) - { - NotificationEventArgs.IndicatorStyleArgs indicatorStyle = new NotificationEventArgs.IndicatorStyleArgs(); - eventargs.Style.Add(indicatorStyle.Key, indicatorStyle); - - Interop.NotificationEventListener.GetImage(eventargs.Handle, NotificationImage.Indicator, out path); - indicatorStyle.IconPath = path; - - Interop.NotificationEventListener.GetText(eventargs.Handle, NotificationText.FirstMainText, out path); - indicatorStyle.SubText = path; - } - } - } -} diff --git a/src/Tizen.Applications.PackageManager/Interop/Interop.Libraries.cs b/src/Tizen.Applications.PackageManager/Interop/Interop.Libraries.cs deleted file mode 100755 index 83cbc6e76..000000000 --- a/src/Tizen.Applications.PackageManager/Interop/Interop.Libraries.cs +++ /dev/null @@ -1,23 +0,0 @@ -/* - * 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 PackageManager = "libcapi-appfw-package-manager.so.0"; - } -} diff --git a/src/Tizen.Applications.PackageManager/Interop/Interop.Package.cs b/src/Tizen.Applications.PackageManager/Interop/Interop.Package.cs deleted file mode 100644 index 67de93045..000000000 --- a/src/Tizen.Applications.PackageManager/Interop/Interop.Package.cs +++ /dev/null @@ -1,115 +0,0 @@ -/* - * 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; - -using ErrorCode = Interop.PackageManager.ErrorCode; -using StorageType = Interop.PackageManager.StorageType; -using CertCompareResultType = Interop.PackageManager.CertCompareResultType; - -internal static partial class Interop -{ - internal static partial class Package - { - [UnmanagedFunctionPointerAttribute(CallingConvention.Cdecl)] - internal delegate bool PackageInfoAppInfoCallback(AppType appType, string appId, IntPtr userData); - - [UnmanagedFunctionPointerAttribute(CallingConvention.Cdecl)] - internal delegate bool PackageInfoCertificateInfoCallback(IntPtr handle, CertificateType certType, string certValue, IntPtr userData); - - [UnmanagedFunctionPointerAttribute(CallingConvention.Cdecl)] - internal delegate bool PackageInfoPrivilegeInfoCallback(string privilege, IntPtr userData); - - // Any change here might require changes in Tizen.Applications.AppType enum - internal enum AppType - { - All = 0, - Ui = 1, - Service = 2 - } - - internal enum CertificateType - { - AuthorRootCertificate = 0, - AuthorIntermediateCertificate = 1, - AuthorSignerCertificate = 2, - DistributorRootCertificate = 3, - DistributorIntermediateCertificate = 4, - DistributorSignerCertificate = 5, - Distributor2RootCertificate = 6, - Distributor2IntermediateCertificate = 7, - Distributor2SignerCertificate = 8 - } - - [DllImport(Libraries.PackageManager, EntryPoint = "package_info_foreach_app_from_package")] - internal static extern ErrorCode PackageInfoForeachAppInfo(IntPtr handle, AppType appType, PackageInfoAppInfoCallback callback, IntPtr userData); - - [DllImport(Libraries.PackageManager, EntryPoint = "package_info_foreach_cert_info")] - internal static extern ErrorCode PackageInfoForeachCertificateInfo(IntPtr handle, PackageInfoCertificateInfoCallback callback, IntPtr user_data); - - [DllImport(Libraries.PackageManager, EntryPoint = "package_info_foreach_privilege_info")] - internal static extern ErrorCode PackageInfoForeachPrivilegeInfo(IntPtr handle, PackageInfoPrivilegeInfoCallback callback, IntPtr userData); - - [DllImport(Libraries.PackageManager, EntryPoint = "package_info_create")] - internal static extern ErrorCode PackageInfoCreate(string packageId, out IntPtr handle); - - [DllImport(Libraries.PackageManager, EntryPoint = "package_info_destroy")] - internal static extern ErrorCode PackageInfoDestroy(IntPtr handle); - - [DllImport(Libraries.PackageManager, EntryPoint = "package_info_get_package")] - internal static extern ErrorCode PackageInfoGetPackage(IntPtr handle, out string packageId); - - [DllImport(Libraries.PackageManager, EntryPoint = "package_info_get_label")] - internal static extern ErrorCode PackageInfoGetLabel(IntPtr handle, out string label); - - [DllImport(Libraries.PackageManager, EntryPoint = "package_info_get_icon")] - internal static extern ErrorCode PackageInfoGetIconPath(IntPtr handle, out string path); - - [DllImport(Libraries.PackageManager, EntryPoint = "package_info_get_version")] - internal static extern ErrorCode PackageInfoGetVersion(IntPtr handle, out string version); - - [DllImport(Libraries.PackageManager, EntryPoint = "package_info_get_type")] - internal static extern ErrorCode PackageInfoGetType(IntPtr handle, out string type); - - [DllImport(Libraries.PackageManager, EntryPoint = "package_info_get_installed_storage")] - internal static extern ErrorCode PackageInfoGetInstalledStorage(IntPtr handle, out StorageType storage); - - [DllImport(Libraries.PackageManager, EntryPoint = "package_info_get_root_path")] - internal static extern ErrorCode PackageInfoGetRootPath(IntPtr handle, out string path); - - [DllImport(Libraries.PackageManager, EntryPoint = "package_info_get_tep_name")] - internal static extern ErrorCode PackageInfoGetTepName(IntPtr handle, out string name); - - [DllImport(Libraries.PackageManager, EntryPoint = "package_info_is_system_package")] - internal static extern ErrorCode PackageInfoIsSystemPackage(IntPtr handle, out bool system); - - [DllImport(Libraries.PackageManager, EntryPoint = "package_info_is_removable_package")] - internal static extern ErrorCode PackageInfoIsRemovablePackage(IntPtr handle, out bool removable); - - [DllImport(Libraries.PackageManager, EntryPoint = "package_info_is_preload_package")] - internal static extern ErrorCode PackageInfoIsPreloadPackage(IntPtr handle, out bool preload); - - [DllImport(Libraries.PackageManager, EntryPoint = "package_info_is_accessible")] - internal static extern ErrorCode PackageInfoIsAccessible(IntPtr handle, out bool accessible); - - [DllImport(Libraries.PackageManager, EntryPoint = "package_info_get_installed_time")] - internal static extern ErrorCode PackageInfoGetInstalledTime(IntPtr handle, out int installedTime); - - [DllImport(Libraries.PackageManager, EntryPoint = "package_manager_compare_package_cert_info")] - internal static extern ErrorCode PackageCompareCertInfo(string lhsPackageId, string rhsPackageId, out CertCompareResultType result); - } -} diff --git a/src/Tizen.Applications.PackageManager/Interop/Interop.PackageManager.cs b/src/Tizen.Applications.PackageManager/Interop/Interop.PackageManager.cs deleted file mode 100755 index 92ad54e8f..000000000 --- a/src/Tizen.Applications.PackageManager/Interop/Interop.PackageManager.cs +++ /dev/null @@ -1,231 +0,0 @@ -/* - * 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; -using Tizen.Applications; - -internal static partial class Interop -{ - internal static partial class PackageManager - { - [UnmanagedFunctionPointerAttribute(CallingConvention.Cdecl)] - internal delegate void PackageManagerEventCallback(string type, string packageId, EventType eventType, PackageEventState eventState, int progress, ErrorCode error, IntPtr userData); - - [UnmanagedFunctionPointerAttribute(CallingConvention.Cdecl)] - internal delegate bool PackageManagerPackageInfoCallback(IntPtr handle, IntPtr userData); - - [UnmanagedFunctionPointerAttribute(CallingConvention.Cdecl)] - internal delegate void PackageManagerSizeInfoCallback(string packageId, IntPtr sizeInfoHandle, IntPtr userData); - - [UnmanagedFunctionPointerAttribute(CallingConvention.Cdecl)] - internal delegate void PackageManagerTotalSizeInfoCallback(IntPtr sizeInfoHandle, IntPtr userData); - - [UnmanagedFunctionPointerAttribute(CallingConvention.Cdecl)] - internal delegate void PackageManagerRequestEventCallback(int requestId, string type, string packageId, EventType eventType, PackageEventState eventState, int progress, ErrorCode error, IntPtr userData); - - // Any change here might require changes in Tizen.Applications.PackageManagerEventError enum - internal enum ErrorCode - { - None = Tizen.Internals.Errors.ErrorCode.None, - InvalidParameter = Tizen.Internals.Errors.ErrorCode.InvalidParameter, - OutOfMemory = Tizen.Internals.Errors.ErrorCode.OutOfMemory, - IoError = Tizen.Internals.Errors.ErrorCode.IoError, - NoSuchPackage = -0x01150000 | 0x71, - SystemError = -0x01150000 | 0x72, - PermissionDenied = Tizen.Internals.Errors.ErrorCode.PermissionDenied - } - - // Any change here might require changes in Tizen.Applications.PackageEventState enum - internal enum PackageEventState - { - Started = 0, - Processing = 1, - Completed = 2, - Failed = 3 - } - - [Flags] - internal enum EventStatus - { - All = 0x00, - Install = 0x01, - Uninstall = 0x02, - Upgrade = 0x04, - Move = 0x08, - ClearData = 0x10, - Progress = 0x20, - } - - internal enum EventType - { - Install = 0, - Uninstall = 1, - Update = 2, - Move = 3, - ClearData = 4 - } - - internal enum CertCompareResultType - { - Match = 0, - Mismatch, - LhsNoCert, - RhsNoCert, - BothNoCert - } - - internal enum PackageManagerPermissionType - { - Normal = 0, - Signature, - Privilege - } - - // Any change here might require changes in Tizen.Applications.StorageType enum - internal enum StorageType - { - Internal = 0, - External = 1 - } - - [DllImport(Libraries.PackageManager, EntryPoint = "package_manager_create")] - internal static extern ErrorCode PackageManagerCreate(out SafePackageManagerHandle managerHandle); - - [DllImport(Libraries.PackageManager, EntryPoint = "package_manager_destroy")] - internal static extern ErrorCode PackageManagerDestroy(IntPtr managerHandle); - - [DllImport(Libraries.PackageManager, EntryPoint = "package_manager_set_event_status")] - internal static extern ErrorCode PackageManagerSetEvenStatus(SafePackageManagerHandle managerHandle, EventStatus eventStatus); - - [DllImport(Libraries.PackageManager, EntryPoint = "package_manager_set_event_cb")] - internal static extern ErrorCode PackageManagerSetEvent(SafePackageManagerHandle managerHandle, PackageManagerEventCallback callback, IntPtr userData); - - [DllImport(Libraries.PackageManager, EntryPoint = "package_manager_unset_event_cb")] - internal static extern ErrorCode PackageManagerUnsetEvent(SafePackageManagerHandle managerHandle); - - [DllImport(Libraries.PackageManager, EntryPoint = "package_manager_foreach_package_info")] - internal static extern ErrorCode PackageManagerForeachPackageInfo(PackageManagerPackageInfoCallback callback, IntPtr userData); - - [DllImport(Libraries.PackageManager, EntryPoint = "package_manager_get_package_size_info")] - internal static extern ErrorCode PackageManagerGetSizeInfo(string packageId, PackageManagerSizeInfoCallback callback, IntPtr userData); - - [DllImport(Libraries.PackageManager, EntryPoint = "package_manager_get_total_package_size_info")] - internal static extern ErrorCode PackageManagerGetTotalSizeInfo(PackageManagerTotalSizeInfoCallback callback, IntPtr userData); - - [DllImport(Libraries.PackageManager, EntryPoint = "package_manager_get_package_id_by_app_id")] - internal static extern ErrorCode PackageManageGetPackageIdByAppId(string app_id, out string package_id); - - [DllImport(Libraries.PackageManager, EntryPoint = "package_manager_get_package_info")] - internal static extern ErrorCode PackageManagerGetPackageInfo(string packageId, out IntPtr packageInfoHandle); - - [DllImport(Libraries.PackageManager, EntryPoint = "package_manager_clear_cache_dir")] - internal static extern ErrorCode PackageManagerClearCacheDir(string packageId); - - [DllImport(Libraries.PackageManager, EntryPoint = "package_manager_clear_all_cache_dir")] - internal static extern ErrorCode PackageManagerClearAllCacheDir(); - - [DllImport(Libraries.PackageManager, EntryPoint = "package_manager_clear_data_dir")] - internal static extern ErrorCode PackageManagerClearDataDir(string packageId); - - [DllImport(Libraries.PackageManager, EntryPoint = "package_manager_filter_create")] - internal static extern ErrorCode PackageManagerFilterCreate(out IntPtr handle); - - [DllImport(Libraries.PackageManager, EntryPoint = "package_manager_filter_destroy")] - internal static extern ErrorCode PackageManagerFilterDestroy(IntPtr handle); - - [DllImport(Libraries.PackageManager, EntryPoint = "package_manager_filter_add_bool")] - internal static extern ErrorCode PackageManagerFilterAdd(IntPtr handle, string property, bool value); - - [DllImport(Libraries.PackageManager, EntryPoint = "package_manager_filter_foreach_package_info")] - internal static extern ErrorCode PackageManagerFilterForeachPackageInfo(IntPtr handle, PackageManagerPackageInfoCallback callback, IntPtr userData); - - [DllImport(Libraries.PackageManager, EntryPoint = "package_size_info_get_data_size")] - internal static extern ErrorCode PackageSizeInfoGetDataSize(IntPtr handle, out long dataSize); - - [DllImport(Libraries.PackageManager, EntryPoint = "package_size_info_get_cache_size")] - internal static extern ErrorCode PackageSizeInfoGetCacheSize(IntPtr handle, out long cacheSize); - - [DllImport(Libraries.PackageManager, EntryPoint = "package_size_info_get_app_size")] - internal static extern ErrorCode PackageSizeInfoGetAppSize(IntPtr handle, out long appSize); - - [DllImport(Libraries.PackageManager, EntryPoint = "package_size_info_get_external_data_size")] - internal static extern ErrorCode PackageSizeInfoGetExtDataSize(IntPtr handle, out long extDataSize); - - [DllImport(Libraries.PackageManager, EntryPoint = "package_size_info_get_external_cache_size")] - internal static extern ErrorCode PackageSizeInfoGetExtCacheSize(IntPtr handle, out long extCacheSize); - - [DllImport(Libraries.PackageManager, EntryPoint = "package_size_info_get_external_app_size")] - internal static extern ErrorCode PackageSizeInfoGetExtAppSize(IntPtr handle, out long extAppSize); - - [DllImport(Libraries.PackageManager, EntryPoint = "package_manager_request_create")] - internal static extern ErrorCode PackageManagerRequestCreate(out SafePackageManagerRequestHandle requestHandle); - - [DllImport(Libraries.PackageManager, EntryPoint = "package_manager_request_destroy")] - internal static extern ErrorCode PackageManagerRequestDestroy(IntPtr requestHandle); - - [DllImport(Libraries.PackageManager, EntryPoint = "package_manager_request_set_type")] - internal static extern ErrorCode PackageManagerRequestSetType(SafePackageManagerRequestHandle requestHandle, string type); - - [DllImport(Libraries.PackageManager, EntryPoint = "package_manager_request_set_tep")] - internal static extern ErrorCode PackageManagerRequestSetTepPath(SafePackageManagerRequestHandle requestHandle, string tepPath); - - [DllImport(Libraries.PackageManager, EntryPoint = "package_manager_request_install")] - internal static extern ErrorCode PackageManagerRequestInstall(SafePackageManagerRequestHandle requestHandle, string path, out int id); - - [DllImport(Libraries.PackageManager, EntryPoint = "package_manager_request_mount_install")] - internal static extern ErrorCode PackageManagerRequestMountInstall(SafePackageManagerRequestHandle requestHandle, string path, out int id); - - [DllImport(Libraries.PackageManager, EntryPoint = "package_manager_request_uninstall")] - internal static extern ErrorCode PackageManagerRequestUninstall(SafePackageManagerRequestHandle requestHandle, string name, out int id); - - [DllImport(Libraries.PackageManager, EntryPoint = "package_manager_request_move")] - internal static extern ErrorCode PackageManagerRequestMove(SafePackageManagerRequestHandle requestHandle, string name, StorageType moveToStorageType); - - [DllImport(Libraries.PackageManager, EntryPoint = "package_manager_compare_package_cert_info")] - internal static extern ErrorCode PackageManagerCompareCertInfo(string lhsPackageId, string rhsPackageId, out CertCompareResultType CompareResult); - - [DllImport(Libraries.PackageManager, EntryPoint = "package_manager_compare_app_cert_info")] - internal static extern ErrorCode PackageManagerCompareCertInfoByApplicationId(string lhsPackageId, string rhsPackageId, out CertCompareResultType CompareResult); - - [DllImport(Libraries.PackageManager, EntryPoint = "package_manager_is_preload_package_by_app_id")] - internal static extern ErrorCode PackageManagerIsPreloadPackageByApplicationId(string ApplicationId, out bool IsPreload); - - [DllImport(Libraries.PackageManager, EntryPoint = "package_manager_get_permission_type")] - internal static extern ErrorCode PackageManagerGetPermissionType(string ApplicationId, out PackageManagerPermissionType PermissionType); - - [DllImport(Libraries.PackageManager, EntryPoint = "package_manager_drm_generate_license_request")] - internal static extern ErrorCode PackageManagerDrmGenerateLicenseRequest(string responseData, out string requestData, out string licenseUrl); - - [DllImport(Libraries.PackageManager, EntryPoint = "package_manager_drm_register_license")] - internal static extern ErrorCode PackageManagerDrmRegisterLicense(string responseData); - - [DllImport(Libraries.PackageManager, EntryPoint = "package_manager_drm_decrypt_package")] - internal static extern ErrorCode PackageManagerDrmDecryptPackage(string drmFilePath, string decryptedFilePath); - - [DllImport(Libraries.PackageManager, EntryPoint = "package_manager_request_install_with_cb")] - internal static extern ErrorCode PackageManagerRequestInstallWithCB(SafePackageManagerRequestHandle requestHandle, string path, PackageManagerRequestEventCallback callback, IntPtr userData, out int id); - - [DllImport(Libraries.PackageManager, EntryPoint = "package_manager_request_mount_install_with_cb")] - internal static extern ErrorCode PackageManagerRequestMountInstallWithCB(SafePackageManagerRequestHandle requestHandle, string path, PackageManagerRequestEventCallback callback, IntPtr userData, out int id); - - [DllImport(Libraries.PackageManager, EntryPoint = "package_manager_request_uninstall_with_cb")] - internal static extern ErrorCode PackageManagerRequestUninstallWithCB(SafePackageManagerRequestHandle requestHandle, string name, PackageManagerRequestEventCallback callback, IntPtr userData, out int id); - - [DllImport(Libraries.PackageManager, EntryPoint = "package_manager_request_move_with_cb")] - internal static extern ErrorCode PackageManagerRequestMoveWithCB(SafePackageManagerRequestHandle requestHandle, string name, StorageType moveToStorageType, PackageManagerRequestEventCallback callback, IntPtr userData, out int id); - } -} diff --git a/src/Tizen.Applications.PackageManager/Tizen.Applications.PackageManager.csproj b/src/Tizen.Applications.PackageManager/Tizen.Applications.PackageManager.csproj deleted file mode 100755 index 020b2cb3d..000000000 --- a/src/Tizen.Applications.PackageManager/Tizen.Applications.PackageManager.csproj +++ /dev/null @@ -1,11 +0,0 @@ - - - - netstandard2.0 - - - - - - - diff --git a/src/Tizen.Applications.PackageManager/Tizen.Applications.PackageManager.sln b/src/Tizen.Applications.PackageManager/Tizen.Applications.PackageManager.sln deleted file mode 100755 index cf2eb9aa1..000000000 --- a/src/Tizen.Applications.PackageManager/Tizen.Applications.PackageManager.sln +++ /dev/null @@ -1,40 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26430.12 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Applications.PackageManager", "Tizen.Applications.PackageManager.csproj", "{A24D1896-459A-4501-AC43-D574873076E2}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen", "..\Tizen\Tizen.csproj", "{826EC12D-620E-44BE-870D-43BFD31683B4}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Log", "..\Tizen.Log\Tizen.Log.csproj", "{979167CF-651A-4423-BEB8-7D9F7770498C}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Applications.Common", "..\Tizen.Applications.Common\Tizen.Applications.Common.csproj", "{BB8D64C7-89A1-4297-B537-A37F499D469B}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {A24D1896-459A-4501-AC43-D574873076E2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A24D1896-459A-4501-AC43-D574873076E2}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A24D1896-459A-4501-AC43-D574873076E2}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A24D1896-459A-4501-AC43-D574873076E2}.Release|Any CPU.Build.0 = Release|Any CPU - {826EC12D-620E-44BE-870D-43BFD31683B4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {826EC12D-620E-44BE-870D-43BFD31683B4}.Debug|Any CPU.Build.0 = Debug|Any CPU - {826EC12D-620E-44BE-870D-43BFD31683B4}.Release|Any CPU.ActiveCfg = Release|Any CPU - {826EC12D-620E-44BE-870D-43BFD31683B4}.Release|Any CPU.Build.0 = Release|Any CPU - {979167CF-651A-4423-BEB8-7D9F7770498C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {979167CF-651A-4423-BEB8-7D9F7770498C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {979167CF-651A-4423-BEB8-7D9F7770498C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {979167CF-651A-4423-BEB8-7D9F7770498C}.Release|Any CPU.Build.0 = Release|Any CPU - {BB8D64C7-89A1-4297-B537-A37F499D469B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {BB8D64C7-89A1-4297-B537-A37F499D469B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {BB8D64C7-89A1-4297-B537-A37F499D469B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {BB8D64C7-89A1-4297-B537-A37F499D469B}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/src/Tizen.Applications.PackageManager/Tizen.Applications/CertCompareResultType.cs b/src/Tizen.Applications.PackageManager/Tizen.Applications/CertCompareResultType.cs deleted file mode 100644 index a702091db..000000000 --- a/src/Tizen.Applications.PackageManager/Tizen.Applications/CertCompareResultType.cs +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2017 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.Applications -{ - /// - /// Enumeration for the certificate compare result type. - /// - public enum CertCompareResultType - { - /// - /// Certificates are matched. - /// - Match = Interop.PackageManager.CertCompareResultType.Match, - /// - /// Certificates are not matched. - /// - Mismatch = Interop.PackageManager.CertCompareResultType.Mismatch, - /// - /// First package does not have the certificate. - /// - LhsNoCert = Interop.PackageManager.CertCompareResultType.LhsNoCert, - /// - /// Second package does not have the certificate. - /// - RhsNoCert = Interop.PackageManager.CertCompareResultType.RhsNoCert, - /// - /// Certificates for both the packages do not exist. - /// - BothNoCert = Interop.PackageManager.CertCompareResultType.BothNoCert - } -} diff --git a/src/Tizen.Applications.PackageManager/Tizen.Applications/CertificateType.cs b/src/Tizen.Applications.PackageManager/Tizen.Applications/CertificateType.cs deleted file mode 100755 index 912fca1ce..000000000 --- a/src/Tizen.Applications.PackageManager/Tizen.Applications/CertificateType.cs +++ /dev/null @@ -1,37 +0,0 @@ -/* - * 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. - */ - -namespace Tizen.Applications -{ - /// - /// Enumeration for the certification types. - /// - public enum CertificateType - { - /// - /// Author certificate. - /// - Author, - /// - /// Distributor certificate. - /// - Distributor, - /// - /// Distributor2 certificate. - /// - Distributor2, - } -} \ No newline at end of file diff --git a/src/Tizen.Applications.PackageManager/Tizen.Applications/InstallationMode.cs b/src/Tizen.Applications.PackageManager/Tizen.Applications/InstallationMode.cs deleted file mode 100755 index da643db91..000000000 --- a/src/Tizen.Applications.PackageManager/Tizen.Applications/InstallationMode.cs +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) 2017 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. - */ - -namespace Tizen.Applications -{ - /// - /// Enumeration for installation mode. - /// - public enum InstallationMode - { - /// - /// Normal Mode. - /// - Normal, - /// - /// Mount Mode. - /// - Mount - } -} diff --git a/src/Tizen.Applications.PackageManager/Tizen.Applications/Package.cs b/src/Tizen.Applications.PackageManager/Tizen.Applications/Package.cs deleted file mode 100755 index df075dfb4..000000000 --- a/src/Tizen.Applications.PackageManager/Tizen.Applications/Package.cs +++ /dev/null @@ -1,348 +0,0 @@ -/* - * 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.Collections.Generic; -using System.Runtime.InteropServices; -using System.Threading.Tasks; - -namespace Tizen.Applications -{ - /// - /// This class provides the methods and properties to get information about the packages. - /// - public class Package - { - private const string LogTag = "Tizen.Applications"; - - private string _id = string.Empty; - private string _label = string.Empty; - private string _iconPath = string.Empty; - private string _version = string.Empty; - private PackageType _type; - private Interop.PackageManager.StorageType _installedStorageType; - private string _rootPath = string.Empty; - private string _expansionPackageName = string.Empty; - private bool _isSystemPackage; - private bool _isRemovable; - private bool _isPreloaded; - private bool _isAccessible; - private IReadOnlyDictionary _certificates; - private List _privileges; - private int _installedTime; - - private Package(string pkgId) - { - _id = pkgId; - } - - /// - /// The package ID. - /// - public string Id { get { return _id; } } - - /// - /// Label of the package. - /// - public string Label { get { return _label; } } - - /// - /// Absolute path to the icon image. - /// - public string IconPath { get { return _iconPath; } } - - /// - /// Version of the package. - /// - public string Version { get { return _version; } } - - /// - /// Type of the package. - /// - public PackageType PackageType { get { return _type; } } - - /// - /// Installed storage type for the package. - /// - public StorageType InstalledStorageType { get { return (StorageType)_installedStorageType; } } - - /// - /// Root path for the package. - /// - public string RootPath { get { return _rootPath; } } - - /// - /// Expansion package name for the package. - /// - /// http://tizen.org/privilege/packagemanager.admin - /// platform - public string TizenExpansionPackageName { get { return _expansionPackageName; } } - - /// - /// Checks whether the package is a system package. - /// - public bool IsSystemPackage { get { return _isSystemPackage; } } - - /// - /// Checks whether the package is removable. - /// - public bool IsRemovable { get { return _isRemovable; } } - - /// - /// Checks whether the package is preloaded. - /// - public bool IsPreloaded { get { return _isPreloaded; } } - - /// - /// Checks whether the current package is accessible. - /// - public bool IsAccessible { get { return _isAccessible; } } - - /// - /// Certificate information for the package. - /// - public IReadOnlyDictionary Certificates { get { return _certificates; } } - - /// - /// Requested privilege for the package. - /// - public IEnumerable Privileges { get { return _privileges; } } - - /// - /// Installed time of the package. - /// - public int InstalledTime { get { return _installedTime; } } - - /// - /// Retrieves all the application IDs of this package. - /// - /// Returns a dictionary containing all the application information for a given application type. - public IEnumerable GetApplications() - { - return GetApplications(ApplicationType.All); - } - - /// - /// Retrieves all the application IDs of this package. - /// - /// Optional: AppType enumeration value. - /// Returns a dictionary containing all the application information for a given application type. - public IEnumerable GetApplications(ApplicationType type) - { - List appInfoList = new List(); - Interop.Package.PackageInfoAppInfoCallback cb = (Interop.Package.AppType appType, string appId, IntPtr userData) => - { - appInfoList.Add(new ApplicationInfo(appId)); - return true; - }; - - IntPtr packageInfoHandle; - Interop.PackageManager.ErrorCode err = Interop.Package.PackageInfoCreate(Id, out packageInfoHandle); - if (err != Interop.PackageManager.ErrorCode.None) - { - Log.Warn(LogTag, string.Format("Failed to create native handle for package info of {0}. err = {1}", Id, err)); - } - - err = Interop.Package.PackageInfoForeachAppInfo(packageInfoHandle, (Interop.Package.AppType)type, cb, IntPtr.Zero); - if (err != Interop.PackageManager.ErrorCode.None) - { - Log.Warn(LogTag, string.Format("Failed to application info of {0}. err = {1}", Id, err)); - } - - err = Interop.Package.PackageInfoDestroy(packageInfoHandle); - if (err != Interop.PackageManager.ErrorCode.None) - { - Log.Warn(LogTag, string.Format("Failed to destroy native handle for package info of {0}. err = {1}", Id, err)); - } - return appInfoList; - } - - /// - /// Gets the package size information. - /// - /// Package size information. - /// http://tizen.org/privilege/packagemanager.info - public async Task GetSizeInformationAsync() - { - TaskCompletionSource tcs = new TaskCompletionSource(); - Interop.PackageManager.PackageManagerSizeInfoCallback sizeInfoCb = (pkgId, sizeInfoHandle, userData) => - { - if (sizeInfoHandle != IntPtr.Zero && Id == pkgId) - { - var pkgSizeInfo = PackageSizeInformation.GetPackageSizeInformation(sizeInfoHandle); - tcs.TrySetResult(pkgSizeInfo); - } - }; - - Interop.PackageManager.ErrorCode err = Interop.PackageManager.PackageManagerGetSizeInfo(Id, sizeInfoCb, IntPtr.Zero); - if (err != Interop.PackageManager.ErrorCode.None) - { - tcs.TrySetException(PackageManagerErrorFactory.GetException(err, "Failed to get total package size info of " + Id)); - } - return await tcs.Task.ConfigureAwait(false); - } - - /// - /// Compares the certificate information with the given package ID. - /// - /// ID of the package. - /// Certificate comparison result. - /// Thrown when a failed input package ID is invalid. - /// Thrown when the method failed due to an internal I/O error. - public CertCompareResultType CompareCertInfo(string packageId) - { - Interop.PackageManager.CertCompareResultType compareResult; - Interop.PackageManager.ErrorCode err = Interop.PackageManager.PackageManagerCompareCertInfo(Id, packageId, out compareResult); - if (err != Interop.PackageManager.ErrorCode.None) - { - throw PackageManagerErrorFactory.GetException(err, "Failed to compare package cert info"); - } - - return (CertCompareResultType)compareResult; - } - - // This method assumes that given arguments are already validated and have valid values. - internal static Package CreatePackage(IntPtr handle, string pkgId) - { - Package package = new Package(pkgId); - - var err = Interop.PackageManager.ErrorCode.None; - err = Interop.Package.PackageInfoGetLabel(handle, out package._label); - if (err != Interop.PackageManager.ErrorCode.None) - { - Log.Warn(LogTag, "Failed to get package label of " + pkgId); - } - err = Interop.Package.PackageInfoGetIconPath(handle, out package._iconPath); - if (err != Interop.PackageManager.ErrorCode.None) - { - Log.Warn(LogTag, "Failed to get package icon path of " + pkgId); - } - err = Interop.Package.PackageInfoGetVersion(handle, out package._version); - if (err != Interop.PackageManager.ErrorCode.None) - { - Log.Warn(LogTag, "Failed to get package version of " + pkgId); - } - - string type; - Interop.Package.PackageInfoGetType(handle, out type); - if (Enum.TryParse(type, true, out package._type) == false) - { - Log.Warn(LogTag, "Failed to get package type of " + pkgId); - } - err = Interop.Package.PackageInfoGetRootPath(handle, out package._rootPath); - if (err != Interop.PackageManager.ErrorCode.None) - { - Log.Warn(LogTag, "Failed to get package root directory of " + pkgId); - } - err = Interop.Package.PackageInfoGetTepName(handle, out package._expansionPackageName); - if (err != Interop.PackageManager.ErrorCode.None) - { - Log.Warn(LogTag, "Failed to get expansion package name of " + pkgId); - package._expansionPackageName = string.Empty; - } - - err = Interop.Package.PackageInfoGetInstalledStorage(handle, out package._installedStorageType); - if (err != Interop.PackageManager.ErrorCode.None) - { - Log.Warn(LogTag, "Failed to get installed storage type of " + pkgId); - } - Interop.Package.PackageInfoIsSystemPackage(handle, out package._isSystemPackage); - if (err != Interop.PackageManager.ErrorCode.None) - { - Log.Warn(LogTag, "Failed to get whether package " + pkgId + " is system package or not"); - } - Interop.Package.PackageInfoIsRemovablePackage(handle, out package._isRemovable); - if (err != Interop.PackageManager.ErrorCode.None) - { - Log.Warn(LogTag, "Failed to get whether package " + pkgId + " is removable or not"); - } - Interop.Package.PackageInfoIsPreloadPackage(handle, out package._isPreloaded); - if (err != Interop.PackageManager.ErrorCode.None) - { - Log.Warn(LogTag, "Failed to get whether package " + pkgId + " is preloaded or not"); - } - Interop.Package.PackageInfoIsAccessible(handle, out package._isAccessible); - if (err != Interop.PackageManager.ErrorCode.None) - { - Log.Warn(LogTag, "Failed to get whether package " + pkgId + " is accessible or not"); - } - try - { - Interop.Package.PackageInfoGetInstalledTime(handle, out package._installedTime); - if (err != Interop.PackageManager.ErrorCode.None) - { - Log.Warn(LogTag, "Failed to get installed time of " + pkgId); - } - } - catch (TypeLoadException) - { - // To support in API vesion 3.0 - package._installedTime = 0; - } - - package._certificates = PackageCertificate.GetPackageCertificates(handle); - package._privileges = GetPackagePrivilegeInformation(handle); - return package; - } - - internal static Package GetPackage(string packageId) - { - IntPtr packageInfoHandle; - Interop.PackageManager.ErrorCode err = Interop.Package.PackageInfoCreate(packageId, out packageInfoHandle); - if (err != Interop.PackageManager.ErrorCode.None) - { - throw PackageManagerErrorFactory.GetException(err, string.Format("Failed to create native handle for package info of {0}", packageId)); - } - - Package package = CreatePackage(packageInfoHandle, packageId); - - err = Interop.Package.PackageInfoDestroy(packageInfoHandle); - if (err != Interop.PackageManager.ErrorCode.None) - { - Log.Warn(LogTag, string.Format("Failed to destroy native handle for package info of {0}. err = {1}", packageId, err)); - } - return package; - } - - internal static Package GetPackage(IntPtr packageInfoHandle) - { - String packageId; - Interop.PackageManager.ErrorCode err = Interop.Package.PackageInfoGetPackage(packageInfoHandle, out packageId); - if (err != Interop.PackageManager.ErrorCode.None) - { - throw PackageManagerErrorFactory.GetException(err, "Failed to get package id for given package handle."); - } - return CreatePackage(packageInfoHandle, packageId); - } - - private static List GetPackagePrivilegeInformation(IntPtr packageInfoHandle) - { - List privileges = new List(); - Interop.Package.PackageInfoPrivilegeInfoCallback privilegeInfoCb = (privilege, userData) => - { - privileges.Add(privilege); - return true; - }; - - Interop.PackageManager.ErrorCode err = Interop.Package.PackageInfoForeachPrivilegeInfo(packageInfoHandle, privilegeInfoCb, IntPtr.Zero); - if (err != Interop.PackageManager.ErrorCode.None) - { - Log.Warn(LogTag, string.Format("Failed to get privilage info. err = {0}", err)); - } - return privileges; - } - } -} diff --git a/src/Tizen.Applications.PackageManager/Tizen.Applications/PackageCertificate.cs b/src/Tizen.Applications.PackageManager/Tizen.Applications/PackageCertificate.cs deleted file mode 100755 index 264db10f0..000000000 --- a/src/Tizen.Applications.PackageManager/Tizen.Applications/PackageCertificate.cs +++ /dev/null @@ -1,98 +0,0 @@ -/* - * 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.Collections.Generic; -using System.Runtime.InteropServices; - -namespace Tizen.Applications -{ - /// - /// This class provides information about the package certification. - /// - public class PackageCertificate - { - private const string LogTag = "Tizen.Applications"; - - private readonly string _root; - private readonly string _intermediate; - private readonly string _signer; - - internal PackageCertificate(string root, string intermediate, string signer) - { - _root = root; - _intermediate = intermediate; - _signer = signer; - } - - /// - /// Root certificate. - /// - public string Root { get { return _root; } } - - /// - /// Intermediate certificate. - /// - public string Intermediate { get { return _intermediate; } } - - /// - /// Signer certificate. - /// - public string Signer { get { return _signer; } } - - internal static IReadOnlyDictionary GetPackageCertificates(IntPtr packageInfoHandle) - { - Dictionary nativeCertificates = new Dictionary(); - Interop.Package.PackageInfoCertificateInfoCallback certificateInfoCb = (handle, certType, certValue, userData) => - { - if (certValue == null) certValue = string.Empty; - nativeCertificates.Add(certType, certValue); - return true; - }; - - Interop.PackageManager.ErrorCode err = Interop.Package.PackageInfoForeachCertificateInfo(packageInfoHandle, certificateInfoCb, IntPtr.Zero); - if (err != Interop.PackageManager.ErrorCode.None) - { - Log.Warn(LogTag, string.Format("Failed to get certificate info. err = {0}", err)); - } - - Dictionary certificates = new Dictionary(); - string authorRootCertificate = GetValue(nativeCertificates, Interop.Package.CertificateType.AuthorRootCertificate); - string authorIntermediateCertificate = GetValue(nativeCertificates, Interop.Package.CertificateType.AuthorIntermediateCertificate); - string aurthorSignerCertificate = GetValue(nativeCertificates, Interop.Package.CertificateType.AuthorSignerCertificate); - certificates.Add(CertificateType.Author, new PackageCertificate(authorRootCertificate, authorIntermediateCertificate, aurthorSignerCertificate)); - - string distRootCertificate = GetValue(nativeCertificates, Interop.Package.CertificateType.DistributorRootCertificate); - string distIntermediateCertificate = GetValue(nativeCertificates, Interop.Package.CertificateType.DistributorIntermediateCertificate); - string distSignerCertificate = GetValue(nativeCertificates, Interop.Package.CertificateType.DistributorSignerCertificate); - certificates.Add(CertificateType.Distributor, new PackageCertificate(distRootCertificate, distIntermediateCertificate, distSignerCertificate)); - - string dist2RootCertificate = GetValue(nativeCertificates, Interop.Package.CertificateType.Distributor2RootCertificate); - string dist2IntermediateCertificate = GetValue(nativeCertificates, Interop.Package.CertificateType.Distributor2IntermediateCertificate); - string dist2SignerCertificate = GetValue(nativeCertificates, Interop.Package.CertificateType.Distributor2SignerCertificate); - certificates.Add(CertificateType.Distributor2, new PackageCertificate(dist2RootCertificate, dist2IntermediateCertificate, dist2SignerCertificate)); - - return certificates; - } - - private static string GetValue(IDictionary dict, Interop.Package.CertificateType key) - { - string value; - dict.TryGetValue(key, out value); - return value; - } - } -} \ No newline at end of file diff --git a/src/Tizen.Applications.PackageManager/Tizen.Applications/PackageDrm.cs b/src/Tizen.Applications.PackageManager/Tizen.Applications/PackageDrm.cs deleted file mode 100644 index bfc959c41..000000000 --- a/src/Tizen.Applications.PackageManager/Tizen.Applications/PackageDrm.cs +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright (c) 2017 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.Collections.Generic; -using System.Runtime.InteropServices; -using System.Threading.Tasks; - -namespace Tizen.Applications -{ - /// - /// This class provides the methods and properties for the DRM operation. - /// - public class PackageDrm - { - private string _responseData; - private string _requestData; - private string _licenseUrl; - private PackageDrm(string responseData, string requestData, string licenseUrl) - { - _responseData = responseData; - _requestData = requestData; - _licenseUrl = licenseUrl; - } - - /// - /// Returns the response data. - /// - /// Returns the response data which is given when GenerateLicenseRequest has been invoked. - public string ResponseData { get { return _responseData; } } - - /// - /// Returns the request data. - /// - /// Returns the request data which is generated when GenerateLicenseRequest has been invoked. - public string RequestData { get { return _requestData; } } - - /// - /// Returns the license URL. - /// - /// Returns the license URL which is generated when GenerateLicenseRequest has been invoked. - public string LicenseUrl { get { return _licenseUrl; } } - - internal static PackageDrm CreateDrmRequest(string responseData, string requestData, string licenseUrl) - { - PackageDrm packageDrm = new PackageDrm(responseData, requestData, licenseUrl); - return packageDrm; - } - - internal static PackageDrm GenerateLicenseRequest(string responseData) - { - string requestData; - string licenseUrl; - Interop.PackageManager.ErrorCode err = Interop.PackageManager.PackageManagerDrmGenerateLicenseRequest(responseData, out requestData, out licenseUrl); - if (err != Interop.PackageManager.ErrorCode.None) - { - throw PackageManagerErrorFactory.GetException(err, "Failed to generate license request"); - } - - PackageDrm packageDrm = CreateDrmRequest(responseData, requestData, licenseUrl); - return packageDrm; - } - } -} diff --git a/src/Tizen.Applications.PackageManager/Tizen.Applications/PackageEventState.cs b/src/Tizen.Applications.PackageManager/Tizen.Applications/PackageEventState.cs deleted file mode 100755 index e8bcbb7b5..000000000 --- a/src/Tizen.Applications.PackageManager/Tizen.Applications/PackageEventState.cs +++ /dev/null @@ -1,41 +0,0 @@ -/* - * 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. - */ - -namespace Tizen.Applications -{ - /// - /// Enumeration for the package manager event state. - /// - public enum PackageEventState - { - /// - /// Processing started. - /// - Started = Interop.PackageManager.PackageEventState.Started, - /// - /// Processing state. - /// - Processing = Interop.PackageManager.PackageEventState.Processing, - /// - /// Processing completed. - /// - Completed = Interop.PackageManager.PackageEventState.Completed, - /// - /// Processing failed. - /// - Failed = Interop.PackageManager.PackageEventState.Failed - } -} \ No newline at end of file diff --git a/src/Tizen.Applications.PackageManager/Tizen.Applications/PackageEventType.cs b/src/Tizen.Applications.PackageManager/Tizen.Applications/PackageEventType.cs deleted file mode 100755 index 5b9ea4e22..000000000 --- a/src/Tizen.Applications.PackageManager/Tizen.Applications/PackageEventType.cs +++ /dev/null @@ -1,45 +0,0 @@ -/* - * 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. - */ - -namespace Tizen.Applications -{ - /// - /// Enumeration for the package manager event types. - /// - public enum PackageEventType - { - /// - /// Install event. - /// - Install = Interop.PackageManager.EventType.Install, - /// - /// Uninstall event. - /// - Uninstall = Interop.PackageManager.EventType.Uninstall, - /// - /// Update event. - /// - Update = Interop.PackageManager.EventType.Update, - /// - /// Move event. - /// - Move = Interop.PackageManager.EventType.Move, - /// - /// ClearData event. - /// - ClearData = Interop.PackageManager.EventType.ClearData - } -} diff --git a/src/Tizen.Applications.PackageManager/Tizen.Applications/PackageFilter.cs b/src/Tizen.Applications.PackageManager/Tizen.Applications/PackageFilter.cs deleted file mode 100755 index b20f495b0..000000000 --- a/src/Tizen.Applications.PackageManager/Tizen.Applications/PackageFilter.cs +++ /dev/null @@ -1,82 +0,0 @@ -/* - * 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.Collections.Generic; - -namespace Tizen.Applications -{ - /// - /// This class is a parameter of the PackageManager::GetPackages method. - /// - public class PackageFilter - { - private IDictionary _filter; - - /// - /// The default constructor with an empty filter list. All the installed applications will satisfy this filter unless updated with more specific filters. - /// - public PackageFilter() - { - _filter = new Dictionary(); - } - - /// - /// The constructor with specific filters. Using this will filter out the installed packages which do not meet the filter criteria. - /// - public PackageFilter(IDictionary filter) - { - _filter = filter; - } - - /// - /// Filters to be used in the GetPackages method. - /// - public IDictionary Filters - { - get - { - return _filter; - } - } - - /// - /// This class contains possible keys for the filter to be used in the GetPackages method. - /// - public static class Keys - { - /// - /// Key of the boolean property for filtering if the package is removable. - /// - public const string Removable = "PMINFO_PKGINFO_PROP_PACKAGE_REMOVABLE"; - /// - /// Key of the boolean property for filtering if the package is read-only. - /// - public const string ReadOnly = "PMINFO_PKGINFO_PROP_PACKAGE_READONLY"; - /// - /// Key of the boolean property for filtering if the package supports disabling. - /// - public const string SupportsDisable = "PMINFO_PKGINFO_PROP_PACKAGE_SUPPORT_DISABLE"; - /// - /// Key of the boolean property for filtering if the package is disabled. - /// - public const string Disable = "PMINFO_PKGINFO_PROP_PACKAGE_DISABLE"; - /// - /// Key of the boolean property for filtering if the package is preloaded. - /// - public const string Preload = "PMINFO_PKGINFO_PROP_PACKAGE_PRELOAD"; - } - } -} diff --git a/src/Tizen.Applications.PackageManager/Tizen.Applications/PackageManager.cs b/src/Tizen.Applications.PackageManager/Tizen.Applications/PackageManager.cs deleted file mode 100755 index dcabacc28..000000000 --- a/src/Tizen.Applications.PackageManager/Tizen.Applications/PackageManager.cs +++ /dev/null @@ -1,1152 +0,0 @@ -/* - * 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.Collections.Generic; -using System.Threading.Tasks; -using System.IO; - -namespace Tizen.Applications -{ - /// - /// PackageManager class. This class has the methods and events of the PackageManager. - /// - /// - /// The package manager is one of the core modules of the Tizen application framework and responsible for getting their information. - /// You can also retrieve information related to the packages that are installed on the device. - /// - public static class PackageManager - { - private const string LogTag = "Tizen.Applications.PackageManager"; - - private static SafePackageManagerHandle s_handle = new SafePackageManagerHandle(); - private static Interop.PackageManager.EventStatus s_eventStatus = Interop.PackageManager.EventStatus.All; - private static event EventHandler s_installEventHandler; - private static event EventHandler s_uninstallEventHandler; - private static event EventHandler s_updateEventHandler; - private static event EventHandler s_moveEventHandler; - private static event EventHandler s_clearDataEventHandler; - - private static Interop.PackageManager.PackageManagerEventCallback s_packageManagerEventCallback; - - /// - /// Event callback method for the request. - /// - /// Type of the package which was requested. - /// ID of the package which was requested. - /// Event type of the request. - /// Current event state of the request. - /// Progress for the request being processed by the package manager (in percent). - public delegate void RequestEventCallback(string type, string packageId, PackageEventType eventType, PackageEventState eventState, int progress); - - private static Dictionary RequestCallbacks = new Dictionary(); - private static Dictionary RequestHandles = new Dictionary(); - - private delegate Interop.PackageManager.ErrorCode InstallMethodWithCallback(SafePackageManagerRequestHandle requestHandle, string pkgPath, Interop.PackageManager.PackageManagerRequestEventCallback requestCallback, IntPtr userData, out int requestID); - private delegate Interop.PackageManager.ErrorCode InstallMethod(SafePackageManagerRequestHandle requestHandle, string pkgPath, out int requestID); - - /// - /// InstallProgressChanged event. This event occurs when a package is getting installed and the progress of the request to the package manager is changed. - /// - public static event EventHandler InstallProgressChanged - { - add - { - SetPackageManagerEventStatus(Interop.PackageManager.EventStatus.Install); - RegisterPackageManagerEventIfNeeded(); - s_installEventHandler += value; - } - remove - { - s_installEventHandler -= value; - UnregisterPackageManagerEventIfNeeded(); - UnsetPackageManagerEventStatus(); - } - } - - /// - /// UninstallProgressChanged event. This event occurs when a package is getting uninstalled and the progress of the request to the package manager is changed. - /// - public static event EventHandler UninstallProgressChanged - { - add - { - SetPackageManagerEventStatus(Interop.PackageManager.EventStatus.Uninstall); - RegisterPackageManagerEventIfNeeded(); - s_uninstallEventHandler += value; - } - remove - { - s_uninstallEventHandler -= value; - UnregisterPackageManagerEventIfNeeded(); - UnsetPackageManagerEventStatus(); - } - } - - /// - /// UpdateProgressChanged event. This event occurs when a package is getting updated and the progress of the request to the package manager is changed. - /// - public static event EventHandler UpdateProgressChanged - { - add - { - SetPackageManagerEventStatus(Interop.PackageManager.EventStatus.Upgrade); - RegisterPackageManagerEventIfNeeded(); - s_updateEventHandler += value; - } - remove - { - s_updateEventHandler -= value; - UnregisterPackageManagerEventIfNeeded(); - UnsetPackageManagerEventStatus(); - } - } - - /// - /// MoveProgressChanged event. This event occurs when a package is getting moved and the progress of the request to the package manager is changed. - /// - public static event EventHandler MoveProgressChanged - { - add - { - SetPackageManagerEventStatus(Interop.PackageManager.EventStatus.Move); - RegisterPackageManagerEventIfNeeded(); - s_moveEventHandler += value; - } - remove - { - s_moveEventHandler -= value; - UnregisterPackageManagerEventIfNeeded(); - UnsetPackageManagerEventStatus(); - } - } - - /// - /// ClearDataProgressChanged event. This event occurs when data directories are cleared in the given package. - /// - public static event EventHandler ClearDataProgressChanged - { - add - { - SetPackageManagerEventStatus(Interop.PackageManager.EventStatus.ClearData); - RegisterPackageManagerEventIfNeeded(); - s_clearDataEventHandler += value; - } - remove - { - s_clearDataEventHandler -= value; - UnregisterPackageManagerEventIfNeeded(); - UnsetPackageManagerEventStatus(); - } - } - - private static SafePackageManagerHandle Handle - { - get - { - if (s_handle.IsInvalid) - { - var err = Interop.PackageManager.PackageManagerCreate(out s_handle); - if (err != Interop.PackageManager.ErrorCode.None) - { - Log.Warn(LogTag, string.Format("Failed to create package manager handle. err = {0}", err)); - } - } - return s_handle; - } - } - - private static Interop.PackageManager.PackageManagerRequestEventCallback internalRequestEventCallback = (id, packageType, packageId, eventType, eventState, progress, error, userData) => - { - if (RequestCallbacks.ContainsKey(id)) - { - try - { - RequestCallbacks[id](packageType, packageId, (PackageEventType)eventType, (PackageEventState)eventState, progress); - if (eventState == Interop.PackageManager.PackageEventState.Completed || eventState == Interop.PackageManager.PackageEventState.Failed) - { - Log.Debug(LogTag, string.Format("release request handle for id : {0}", id)); - RequestHandles[id].Dispose(); - RequestHandles.Remove(id); - RequestCallbacks.Remove(id); - } - } - catch (Exception e) - { - Log.Warn(LogTag, e.Message); - RequestHandles[id].Dispose(); - RequestHandles.Remove(id); - RequestCallbacks.Remove(id); - } - } - }; - - /// - /// Gets the package ID for the given application ID. - /// - /// The ID of the application. - /// Returns the ID of the package. Empty string if the application ID does not exist. - /// Thrown when there is not enough memory to continue the execution of the method. - /// Thrown when an application does not have the privilege to access this method. - /// http://tizen.org/privilege/packagemanager.info - public static string GetPackageIdByApplicationId(string applicationId) - { - string packageId; - var err = Interop.PackageManager.PackageManageGetPackageIdByAppId(applicationId, out packageId); - if (err != Interop.PackageManager.ErrorCode.None) - { - Log.Warn(LogTag, string.Format("Failed to get package Id of {0}. err = {1}", applicationId, err)); - if (err != Interop.PackageManager.ErrorCode.InvalidParameter) - { - throw PackageManagerErrorFactory.GetException(err, "Failed to get package Id"); - } - } - return packageId; - } - - /// - /// Gets the package information for the given package. - /// - /// The ID of the package. - /// Returns the package information for the given package ID. - /// Thrown when the failed input package ID is invalid. - /// Thrown when there is not enough memory to continue the execution of the method. - /// Thrown when the method fails due to an internal I/O error. - /// Thrown when an application does not have the privilege to access this method. - /// http://tizen.org/privilege/packagemanager.info - public static Package GetPackage(string packageId) - { - return Package.GetPackage(packageId); - } - - /// - /// Clears the application's internal and external cache directories. - /// - /// ID of the package. - /// Thrown when there is not enough memory to continue the execution of the method. - /// Thrown when the method fails due to an internal I/O error. - /// Thrown when an application does not have the privilege to access this method. - /// Thrown when the method failed due to an internal system error. - /// http://tizen.org/privilege/packagemanager.clearcache - public static void ClearCacheDirectory(string packageId) - { - Interop.PackageManager.ErrorCode err = Interop.PackageManager.PackageManagerClearCacheDir(packageId); - if (err != Interop.PackageManager.ErrorCode.None) - { - Log.Warn(LogTag, string.Format("Failed to clear cache directory for {0}. err = {1}", packageId, err)); - throw PackageManagerErrorFactory.GetException(err, "Failed to clear cache directory"); - } - } - - /// - /// Clears all the application's internal and external cache directories. - /// - /// Thrown when there is not enough memory to continue the execution of the method. - /// Thrown when the method fails due to an internal IO error. - /// Thrown when an application does not have the privilege to access this method. - /// Thrown when the method failed due to an internal system error. - /// http://tizen.org/privilege/packagemanager.admin - /// platform - public static void ClearAllCacheDirectory() - { - var err = Interop.PackageManager.PackageManagerClearAllCacheDir(); - if (err != Interop.PackageManager.ErrorCode.None) - { - Log.Warn(LogTag, string.Format("Failed to clear all cache directories. err = {0}", err)); - throw PackageManagerErrorFactory.GetException(err, "Failed to clear all cache directories"); - } - } - - /// - /// Clears the application's internal and external data directories. - /// - /// - /// All files under data, shared/data, and shared/trusted in the internal storage are removed. - /// And, if the external storage exists, then all files under data and shared/trusted in the external storage are removed. - /// - /// ID of the package. - /// Thrown when there is not enough memory to continue the execution of the method. - /// Thrown when the method failed due to an internal IO error. - /// Thrown when an application does not have the privilege to access this method. - /// Thrown when the method failed due to an internal system error. - /// http://tizen.org/privilege/packagemanager.admin - /// platform - public static void ClearDataDirectory(string packageId) - { - Interop.PackageManager.ErrorCode err = Interop.PackageManager.PackageManagerClearDataDir(packageId); - if (err != Interop.PackageManager.ErrorCode.None) - { - Log.Warn(LogTag, string.Format("Failed to clear data directory for {0}. err = {1}", packageId, err)); - throw PackageManagerErrorFactory.GetException(err, "Failed to clear data directory"); - } - } - - /// - /// Retrieves the package information of all installed packages. - /// - /// Returns the list of packages. - /// http://tizen.org/privilege/packagemanager.info - public static IEnumerable GetPackages() - { - return GetPackages(null); - } - - /// - /// Retrieves the package information of all the installed packages satisfying the filter conditions. - /// - /// Optional - package filters. - /// Returns the list of packages. - /// http://tizen.org/privilege/packagemanager.info - public static IEnumerable GetPackages(PackageFilter filter) - { - List packageList = new List(); - - IntPtr filterHandle; - var err = Interop.PackageManager.PackageManagerFilterCreate(out filterHandle); - if (err != Interop.PackageManager.ErrorCode.None) - { - Log.Warn(LogTag, string.Format("Failed to create package filter handle. err = {0}", err)); - return packageList; - } - - if (filter != null && filter.Filters != null) - { - foreach (KeyValuePair entry in filter?.Filters) - { - err = Interop.PackageManager.PackageManagerFilterAdd(filterHandle, entry.Key, entry.Value); - if (err != Interop.PackageManager.ErrorCode.None) - { - Log.Warn(LogTag, string.Format("Failed to configure package filter. err = {0}", err)); - break; - } - } - } - - if (err == Interop.PackageManager.ErrorCode.None) - { - Interop.PackageManager.PackageManagerPackageInfoCallback cb = (handle, userData) => - { - packageList.Add(Package.GetPackage(handle)); - return true; - }; - - err = Interop.PackageManager.PackageManagerFilterForeachPackageInfo(filterHandle, cb, IntPtr.Zero); - if (err != Interop.PackageManager.ErrorCode.None) - { - Log.Warn(LogTag, string.Format("Failed to get package Informations. err = {0}", err)); - } - } - - err = Interop.PackageManager.PackageManagerFilterDestroy(filterHandle); - if (err != Interop.PackageManager.ErrorCode.None) - { - Log.Warn(LogTag, string.Format("Failed to destroy package filter handle. err = {0}", err)); - } - return packageList; - } - - /// - /// Gets the total package size information. - /// - /// Returns the total package size information asynchronously. - /// http://tizen.org/privilege/packagemanager.info - public static async Task GetTotalSizeInformationAsync() - { - TaskCompletionSource tcs = new TaskCompletionSource(); - Interop.PackageManager.PackageManagerTotalSizeInfoCallback cb = (handle, userData) => - { - if (handle != IntPtr.Zero) - { - tcs.TrySetResult(PackageSizeInformation.GetPackageSizeInformation(handle)); - } - }; - - var err = Interop.PackageManager.PackageManagerGetTotalSizeInfo(cb, IntPtr.Zero); - if (err != Interop.PackageManager.ErrorCode.None) - { - tcs.TrySetException(PackageManagerErrorFactory.GetException(err, "Failed to get total package size info")); - } - return await tcs.Task.ConfigureAwait(false); - } - - /// - /// Installs the package located at the given path. - /// - /// Absolute path for the package to be installed. - /// Returns true if the installation request is successful, otherwise false. - /// - /// The 'true' means that the request for installation is successful. - /// To check the result of the installation, the caller should check the progress using the InstallProgressChanged event. - /// - /// http://tizen.org/privilege/packagemanager.admin - /// platform - public static bool Install(string packagePath, InstallationMode installMode = InstallationMode.Normal) - { - return Install(packagePath, null, PackageType.UNKNOWN, null, installMode); - } - - /// - /// Installs the package located at the given path. - /// - /// Absolute path for the package to be installed. - /// The event callback will be invoked only for the current request. - /// Optional parameter to indicate special installation mode. - /// Returns true if installtion request is successful, false otherwise. - /// - /// The 'true' means that the request for installation is successful. - /// To check the result of installation, the caller should check the progress using the InstallProgressChanged event or eventCallback. - /// - /// http://tizen.org/privilege/packagemanager.admin - /// platform - public static bool Install(string packagePath, RequestEventCallback eventCallback, InstallationMode installMode = InstallationMode.Normal) - { - return Install(packagePath, null, PackageType.UNKNOWN, eventCallback, installMode); - } - - /// - /// Installs the package located at the given path. - /// - /// Absolute path for the package to be installed. - /// Package type for the package to be installed. - /// Optional parameter to indicate special installation mode. - /// Returns true if installtion request is successful, false otherwise. - /// - /// The 'true' means that the request for installation is successful. - /// To check the result of installation, the caller should check the progress using the InstallProgressChanged event. - /// - /// http://tizen.org/privilege/packagemanager.admin - /// platform - public static bool Install(string packagePath, PackageType type, InstallationMode installMode = InstallationMode.Normal) - { - return Install(packagePath, null, type, null, installMode); - } - - /// - /// Installs the package located at the given path. - /// - /// Absolute path for the package to be installed. - /// Absolute path for the expansion package to be installed. - /// Optional parameter to indicate special installation mode. - /// Returns true if installtion request is successful, false otherwise. - /// - /// The 'true' means that the request for installation is successful. - /// To check the result of installation, the caller should check the progress using the InstallProgressChanged event. - /// - /// http://tizen.org/privilege/packagemanager.admin - /// platform - public static bool Install(string packagePath, string expansionPackagePath, InstallationMode installMode = InstallationMode.Normal) - { - return Install(packagePath, expansionPackagePath, PackageType.UNKNOWN, null, installMode); - } - - /// - /// Installs the package located at the given path. - /// - /// Absolute path for the package to be installed. - /// Package type for the package to be installed. - /// The event callback will be invoked only for the current request. - /// Optional parameter to indicate special installation mode. - /// Returns true if installtion request is successful, false otherwise. - /// - /// The 'true' means that the request for installation is successful. - /// To check the result of installation, the caller should check the progress using the InstallProgressChanged event or eventCallback. - /// - /// http://tizen.org/privilege/packagemanager.admin - /// platform - public static bool Install(string packagePath, PackageType type, RequestEventCallback eventCallback, InstallationMode installMode = InstallationMode.Normal) - { - return Install(packagePath, null, type, eventCallback, installMode); - } - - /// - /// Installs the package located at the given path. - /// - /// Absolute path for the package to be installed. - /// Absolute path for the expansion package to be installed. - /// The event callback will be invoked only for the current request. - /// Optional parameter to indicate special installation mode. - /// Returns true if installtion request is successful, false otherwise. - /// - /// The 'true' means that the request for installation is successful. - /// To check the result of installation, the caller should check the progress using the InstallProgressChanged event or eventCallback. - /// - /// http://tizen.org/privilege/packagemanager.admin - /// platform - public static bool Install(string packagePath, string expansionPackagePath, RequestEventCallback eventCallback, InstallationMode installMode = InstallationMode.Normal) - { - return Install(packagePath, expansionPackagePath, PackageType.UNKNOWN, eventCallback, installMode); - } - - /// - /// Installs the package located at the given path. - /// - /// Absolute path for the package to be installed. - /// Absolute path for the expansion package to be installed. - /// Package type for the package to be installed. - /// Optional parameter to indicate special installation mode. - /// Returns true if installtion request is successful, false otherwise. - /// - /// The 'true' means that the request for installation is successful. - /// To check the result of installation, the caller should check the progress using the InstallProgressChanged event. - /// - /// http://tizen.org/privilege/packagemanager.admin - /// platform - public static bool Install(string packagePath, string expansionPackagePath, PackageType type, InstallationMode installMode = InstallationMode.Normal) - { - return Install(packagePath, expansionPackagePath, type, null, installMode); - } - - /// - /// Installs the package located at the given path. - /// - /// Absolute path for the package to be installed. - /// Absolute path for the expansion package to be installed. - /// Package type for the package to be installed. - /// The event callback will be invoked only for the current request. - /// Optional parameter to indicate special installation mode. - /// Returns true if installtion request is successful, false otherwise. - /// - /// The 'true' means that the request for installation is successful. - /// To check the result of installation, the caller should check the progress using the InstallProgressChanged event or eventCallback. - /// - /// http://tizen.org/privilege/packagemanager.admin - /// platform - public static bool Install(string packagePath, string expansionPackagePath, PackageType type, RequestEventCallback eventCallback, InstallationMode installMode = InstallationMode.Normal) - { - SafePackageManagerRequestHandle RequestHandle; - var err = Interop.PackageManager.PackageManagerRequestCreate(out RequestHandle); - if (err != Interop.PackageManager.ErrorCode.None) - { - Log.Warn(LogTag, string.Format("Failed to install package {0}. Error in creating package manager request handle. err = {1}", packagePath, err)); - return false; - } - - try - { - if (type != PackageType.UNKNOWN) - { - err = Interop.PackageManager.PackageManagerRequestSetType(RequestHandle, type.ToString().ToLower()); - if (err != Interop.PackageManager.ErrorCode.None) - { - Log.Warn(LogTag, string.Format("Failed to install package {0}. Error in setting request package type. err = {1}", packagePath, err)); - RequestHandle.Dispose(); - return false; - } - } - - if (!string.IsNullOrEmpty(expansionPackagePath)) - { - err = Interop.PackageManager.PackageManagerRequestSetTepPath(RequestHandle, expansionPackagePath); - if (err != Interop.PackageManager.ErrorCode.None) - { - Log.Warn(LogTag, string.Format("Failed to install package {0}. Error in setting request package mode. err = {1}", packagePath, err)); - RequestHandle.Dispose(); - return false; - } - } - - int requestId; - if (eventCallback != null) - { - InstallMethodWithCallback install; - if (installMode == InstallationMode.Mount) - { - install = Interop.PackageManager.PackageManagerRequestMountInstallWithCB; - } - else - { - install = Interop.PackageManager.PackageManagerRequestInstallWithCB; - } - err = install(RequestHandle, packagePath, internalRequestEventCallback, IntPtr.Zero, out requestId); - if (err == Interop.PackageManager.ErrorCode.None) - { - RequestCallbacks.Add(requestId, eventCallback); - RequestHandles.Add(requestId, RequestHandle); - } - else - { - Log.Warn(LogTag, string.Format("Failed to install package {0}. err = {1}", packagePath, err)); - RequestHandle.Dispose(); - return false; - } - } - else - { - InstallMethod install; - if (installMode == InstallationMode.Mount) - { - install = Interop.PackageManager.PackageManagerRequestMountInstall; - } - else - { - install = Interop.PackageManager.PackageManagerRequestInstall; - } - err = install(RequestHandle, packagePath, out requestId); - if (err != Interop.PackageManager.ErrorCode.None) - { - Log.Warn(LogTag, string.Format("Failed to install package {0}. err = {1}", packagePath, err)); - RequestHandle.Dispose(); - return false; - } - // RequestHandle isn't necessary when this method is called without 'eventCallback' parameter. - RequestHandle.Dispose(); - } - return true; - } - catch (Exception e) - { - Log.Warn(LogTag, e.Message); - RequestHandle.Dispose(); - return false; - } - } - - /// - /// Uninstalls the package with the given name. - /// - /// ID of the package to be uninstalled. - /// Returns true if the uninstallation request is successful, false otherwise. - /// - /// The 'true' means that the request for uninstallation is successful. - /// To check the result of uninstallation, the caller should check the progress using the UninstallProgressChanged event. - /// - /// http://tizen.org/privilege/packagemanager.admin - /// platform - public static bool Uninstall(string packageId) - { - return Uninstall(packageId, PackageType.UNKNOWN, null); - } - - /// - /// Uninstalls package with the given names. - /// - /// ID of the package to be uninstalled. - /// Optional - Package type for the package to be uninstalled. - /// Returns true if the uninstalltion request is successful, false otherwise. - /// - /// The 'true' means that the request for uninstallation is successful. - /// To check the result of uninstallation, the caller should check the progress using the UninstallProgressChanged event. - /// - /// http://tizen.org/privilege/packagemanager.admin - /// platform - public static bool Uninstall(string packageId, PackageType type) - { - return Uninstall(packageId, type, null); - } - - /// - /// Uninstalls the package with the given name. - /// - /// ID of the package to be uninstalled. - /// Optional - The event callback will be invoked only for the current request. - /// Returns true if the uninstallation request is successful, false otherwise. - /// - /// The 'true' means that the request for uninstallation is successful. - /// To check the result of uninstallation, the caller should check the progress using the UninstallProgressChanged event or eventCallback. - /// - /// http://tizen.org/privilege/packagemanager.admin - /// platform - public static bool Uninstall(string packageId, RequestEventCallback eventCallback) - { - return Uninstall(packageId, PackageType.UNKNOWN, eventCallback); - } - - /// - /// Uninstalls the package with the given name. - /// - /// ID of the package to be uninstalled - /// Optional - Package type for the package to be uninstalled. - /// Optional - The event callback will be invoked only for the current request. - /// Returns true if the uninstallation request is successful, false otherwise. - /// - /// The 'true' means that the request for uninstallation is successful. - /// To check the result of uninstallation, the caller should check the progress using the UninstallProgressChanged event or eventCallback. - /// - /// http://tizen.org/privilege/packagemanager.admin - /// platform - public static bool Uninstall(string packageId, PackageType type, RequestEventCallback eventCallback) - { - SafePackageManagerRequestHandle RequestHandle; - var err = Interop.PackageManager.PackageManagerRequestCreate(out RequestHandle); - if (err != Interop.PackageManager.ErrorCode.None) - { - Log.Warn(LogTag, string.Format("Failed to uninstall package {0}. Error in creating package manager request handle. err = {1}", packageId, err)); - return false; - } - - try - { - err = Interop.PackageManager.PackageManagerRequestSetType(RequestHandle, type.ToString().ToLower()); - if (err != Interop.PackageManager.ErrorCode.None) - { - Log.Warn(LogTag, string.Format("Failed to uninstall package {0}. Error in setting request package type. err = {1}", packageId, err)); - RequestHandle.Dispose(); - return false; - } - - int requestId; - if (eventCallback != null) - { - err = Interop.PackageManager.PackageManagerRequestUninstallWithCB(RequestHandle, packageId, internalRequestEventCallback, IntPtr.Zero, out requestId); - if (err == Interop.PackageManager.ErrorCode.None) - { - RequestCallbacks.Add(requestId, eventCallback); - RequestHandles.Add(requestId, RequestHandle); - } - else - { - Log.Warn(LogTag, string.Format("Failed to uninstall package {0}. err = {1}", packageId, err)); - RequestHandle.Dispose(); - return false; - } - } - else - { - err = Interop.PackageManager.PackageManagerRequestUninstall(RequestHandle, packageId, out requestId); - if (err != Interop.PackageManager.ErrorCode.None) - { - Log.Warn(LogTag, string.Format("Failed to uninstall package. err = {0}", err)); - RequestHandle.Dispose(); - return false; - } - // RequestHandle isn't necessary when this method is called without 'eventCallback' parameter. - RequestHandle.Dispose(); - } - return true; - } - catch (Exception e) - { - Log.Warn(LogTag, e.Message); - RequestHandle.Dispose(); - return false; - } - } - - /// - /// Moves the package to the given storage. - /// - /// ID of the package to be moved. - /// Storage package should be moved to. - /// Returns true if the move request is successful, false otherwise. - /// - /// The 'true' means that the request for move is successful. - /// To check the result of move, the caller should check the progress using the MoveProgressChanged event. - /// - /// http://tizen.org/privilege/packagemanager.admin - /// platform - public static bool Move(string packageId, StorageType newStorage) - { - return Move(packageId, PackageType.UNKNOWN, newStorage, null); - } - - /// - /// Moves the package to the given storage. - /// - /// ID of the package to be moved. - /// Optional - Package type for the package to be moved. - /// Storage package should be moved to. - /// Returns true if the move request is successful, false otherwise. - /// - /// The 'true' means that the request for move is successful. - /// To check the result of move, the caller should check the progress using the MoveProgressChanged event. - /// - /// http://tizen.org/privilege/packagemanager.admin - /// platform - public static bool Move(string packageId, PackageType type, StorageType newStorage) - { - return Move(packageId, type, newStorage, null); - } - - /// - /// Moves the package to the given storage. - /// - /// ID of the package to be moved. - /// Storage package should be moved to. - /// Optional - The event callback will be invoked only for the current request. - /// Returns true if move request is successful, false otherwise. - /// - /// The 'true' means that the request for move is successful. - /// To check the result of move, the caller should check the progress using the MoveProgressChanged event. - /// - /// http://tizen.org/privilege/packagemanager.admin - /// platform - public static bool Move(string packageId, StorageType newStorage, RequestEventCallback eventCallback) - { - return Move(packageId, PackageType.UNKNOWN, newStorage, eventCallback); - } - - /// - /// Moves the package to the given storage. - /// - /// ID of the package to be moved. - /// Optional - Package type for the package to be moved. - /// Storage, package should be moved to. - /// Optional - The event callback will be invoked only for the current request. - /// Returns true if move request is successful, false otherwise. - /// - /// The 'true' means that the request for move is successful. - /// To check the result of move, the caller should check the progress using the MoveProgressChanged event. - /// - /// http://tizen.org/privilege/packagemanager.admin - /// platform - public static bool Move(string packageId, PackageType type, StorageType newStorage, RequestEventCallback eventCallback) - { - SafePackageManagerRequestHandle RequestHandle; - var err = Interop.PackageManager.PackageManagerRequestCreate(out RequestHandle); - if (err != Interop.PackageManager.ErrorCode.None) - { - Log.Warn(LogTag, string.Format("Failed to create package manager request handle. err = {0}", err)); - return false; - } - - try - { - bool result = true; - err = Interop.PackageManager.PackageManagerRequestSetType(RequestHandle, type.ToString().ToLower()); - if (err != Interop.PackageManager.ErrorCode.None) - { - Log.Warn(LogTag, string.Format("Failed to move package. Error in setting request package type. err = {0}", err)); - RequestHandle.Dispose(); - return false; - } - - if (eventCallback != null) - { - int requestId; - err = Interop.PackageManager.PackageManagerRequestMoveWithCB(RequestHandle, packageId, (Interop.PackageManager.StorageType)newStorage, internalRequestEventCallback, IntPtr.Zero, out requestId); - if (err == Interop.PackageManager.ErrorCode.None) - { - RequestCallbacks.Add(requestId, eventCallback); - RequestHandles.Add(requestId, RequestHandle); - } - else - { - Log.Warn(LogTag, string.Format("Failed to move package to requested location. err = {0}", err)); - RequestHandle.Dispose(); - result = false; - } - } - else - { - err = Interop.PackageManager.PackageManagerRequestMove(RequestHandle, packageId, (Interop.PackageManager.StorageType)newStorage); - if (err != Interop.PackageManager.ErrorCode.None) - { - Log.Warn(LogTag, string.Format("Failed to move package to requested location. err = {0}", err)); - RequestHandle.Dispose(); - result = false; - } - // RequestHandle isn't necessary when this method is called without 'eventCallback' parameter. - RequestHandle.Dispose(); - } - return result; - } - catch (Exception e) - { - Log.Warn(LogTag, e.Message); - RequestHandle.Dispose(); - return false; - } - } - - /// - /// Gets the permission type of the package which has a given application ID. - /// - /// ID of the application. - /// Returns the permission type. - /// http://tizen.org/privilege/packagemanager.info - /// Thrown when the failed input package ID is invalid. - /// Thrown when an application does not have the privilege to access this method. - public static PermissionType GetPermissionTypeByApplicationId(string applicationId) - { - Interop.PackageManager.PackageManagerPermissionType permissionType; - Interop.PackageManager.ErrorCode err = Interop.PackageManager.PackageManagerGetPermissionType(applicationId, out permissionType); - if (err != Interop.PackageManager.ErrorCode.None) - { - throw PackageManagerErrorFactory.GetException(err, "Failed to get permission type."); - } - - return (PermissionType)permissionType; - } - - /// - /// Gets the package's preload attribute which contains a given application ID. - /// - /// ID of the application. - /// Returns true if the package is preloaded, otherwise false. - /// http://tizen.org/privilege/packagemanager.info - /// Thrown when the failed input package ID is invalid. - /// Thrown when an application does not have the privilege to access this method. - public static bool IsPreloadPackageByApplicationId(string applicationId) - { - bool isPreloadPackage; - Interop.PackageManager.ErrorCode err = Interop.PackageManager.PackageManagerIsPreloadPackageByApplicationId(applicationId, out isPreloadPackage); - if (err != Interop.PackageManager.ErrorCode.None) - { - throw PackageManagerErrorFactory.GetException(err, "Failed to get preload info"); - } - - return isPreloadPackage; - } - - /// - /// Compares the certificate of the two packages. - /// - /// Package ID to compare. - /// Package ID to be compared. - /// Returns certificate comparison result. - /// Thrown when the failed input package ID is invalid. - /// Thrown when the method failed due to an internal I/O error. - public static CertCompareResultType CompareCertInfo(string lhsPackageId, string rhsPackageId) - { - Interop.PackageManager.CertCompareResultType compareResult; - Interop.PackageManager.ErrorCode err = Interop.PackageManager.PackageManagerCompareCertInfo(lhsPackageId, rhsPackageId, out compareResult); - if (err != Interop.PackageManager.ErrorCode.None) - { - throw PackageManagerErrorFactory.GetException(err, "Failed to compare cert info"); - } - - return (CertCompareResultType)compareResult; - } - - /// - /// Compares the certificate of the two packages which contain each given application ID. - /// - /// Application ID to compare. - /// Application ID to be compared. - /// Returns certificate comparison result. - /// Thrown when the failed input package ID is invalid. - /// Thrown when the method failed due to an internal I/O error. - public static CertCompareResultType CompareCertInfoByApplicationId(string lhsApplicationId, string rhsApplicationId) - { - Interop.PackageManager.CertCompareResultType compareResult; - Interop.PackageManager.ErrorCode err = Interop.PackageManager.PackageManagerCompareCertInfoByApplicationId(lhsApplicationId, rhsApplicationId, out compareResult); - if (err != Interop.PackageManager.ErrorCode.None) - { - throw PackageManagerErrorFactory.GetException(err, "Failed to compare cert info by application id"); - } - - return (CertCompareResultType)compareResult; - } - - /// - /// Drm nested class. This class has the PackageManager's drm related methods. - /// - public static class Drm - { - /// - /// Generates a request for getting the license. - /// - /// Response data string of the purchase request. - /// Returns the package DRM information of a given response data which contains the required data and license URL. - /// http://tizen.org/privilege/packagemanager.admin - /// platform - /// Thrown when failed when input package ID is invalid. - /// Thrown when there is not enough memory to continue the execution of the method. - /// Thrown when an application does not have the privilege to access this method. - /// Thrown when the method failed due to an internal system error. - public static PackageDrm GenerateLicenseRequest(string responseData) - { - return PackageDrm.GenerateLicenseRequest(responseData); - - } - - /// - /// Registers the encrypted license. - /// - /// The response data string of the rights request. - /// Returns true if succeeds, otherwise false. - /// http://tizen.org/privilege/packagemanager.admin - /// platform - /// Thrown when failed when input package ID is invalid. - /// Thrown when there is not enough memory to continue the execution of the method. - /// Thrown when an application does not have the privilege to access this method. - /// Thrown when the method failed due to internal system error. - public static bool RegisterLicense(string responseData) - { - Interop.PackageManager.ErrorCode err = Interop.PackageManager.PackageManagerDrmRegisterLicense(responseData); - if (err != Interop.PackageManager.ErrorCode.None) - { - throw PackageManagerErrorFactory.GetException(err, "Failed to register drm license"); - } - - return true; - } - - /// - /// Decrypts the contents which are encrypted. - /// - /// Drm file path. - /// Decrypted file path. - /// Returns true if succeeds, otherwise false. - /// http://tizen.org/privilege/packagemanager.admin - /// platform - /// Thrown when failed when input package ID is invalid. - /// Thrown when there is not enough memory to continue the execution of the method. - /// Thrown when an application does not have the privilege to access this method. - /// Thrown when the method failed due to an internal system error. - public static bool DecryptPackage(string drmFilePath, string decryptedFilePath) - { - Interop.PackageManager.ErrorCode err = Interop.PackageManager.PackageManagerDrmDecryptPackage(drmFilePath, decryptedFilePath); - if (err != Interop.PackageManager.ErrorCode.None) - { - throw PackageManagerErrorFactory.GetException(err, "Failed to decrypt drm package"); - } - - return true; - } - } - - private static void SetPackageManagerEventStatus(Interop.PackageManager.EventStatus status) - { - if (Handle.IsInvalid) return; - - Interop.PackageManager.EventStatus eventStatus = s_eventStatus; - eventStatus |= status; - if (eventStatus != Interop.PackageManager.EventStatus.All) - eventStatus |= Interop.PackageManager.EventStatus.Progress; - - var err = Interop.PackageManager.ErrorCode.None; - if (s_eventStatus != eventStatus) - { - err = Interop.PackageManager.PackageManagerSetEvenStatus(Handle, eventStatus); - if (err == Interop.PackageManager.ErrorCode.None) - { - s_eventStatus = eventStatus; - Log.Debug(LogTag, string.Format("New Event Status flag: {0}", s_eventStatus)); - return; - } - Log.Debug(LogTag, string.Format("Failed to set flag for {0} event. err = {1}", eventStatus, err)); - } - } - - private static void UnsetPackageManagerEventStatus() - { - if (Handle.IsInvalid) return; - - Interop.PackageManager.EventStatus eventStatus = Interop.PackageManager.EventStatus.All; - if (s_installEventHandler != null) eventStatus |= Interop.PackageManager.EventStatus.Install; - if (s_uninstallEventHandler != null) eventStatus |= Interop.PackageManager.EventStatus.Uninstall; - if (s_updateEventHandler != null) eventStatus |= Interop.PackageManager.EventStatus.Upgrade; - if (s_moveEventHandler != null) eventStatus |= Interop.PackageManager.EventStatus.Move; - if (s_clearDataEventHandler != null) eventStatus |= Interop.PackageManager.EventStatus.ClearData; - if (eventStatus != Interop.PackageManager.EventStatus.All) - eventStatus |= Interop.PackageManager.EventStatus.Progress; - - var err = Interop.PackageManager.ErrorCode.None; - if (s_eventStatus != eventStatus) - { - err = Interop.PackageManager.PackageManagerSetEvenStatus(Handle, eventStatus); - if (err == Interop.PackageManager.ErrorCode.None) - { - s_eventStatus = eventStatus; - Log.Debug(LogTag, string.Format("New Event Status flag: {0}", s_eventStatus)); - return; - } - Log.Debug(LogTag, string.Format("Failed to set flag for {0} event. err = {1}", eventStatus, err)); - } - } - - private static void RegisterPackageManagerEventIfNeeded() - { - if (s_installEventHandler != null && s_uninstallEventHandler != null && s_updateEventHandler != null && s_moveEventHandler != null && s_clearDataEventHandler != null) - { - return; - } - - var err = Interop.PackageManager.ErrorCode.None; - s_packageManagerEventCallback = (packageType, packageId, eventType, eventState, progress, error, user_data) => - { - try - { - if (eventType == Interop.PackageManager.EventType.Install) - { - s_installEventHandler?.Invoke(null, new PackageManagerEventArgs(packageType, packageId, (PackageEventState)eventState, progress)); - } - else if (eventType == Interop.PackageManager.EventType.Uninstall) - { - s_uninstallEventHandler?.Invoke(null, new PackageManagerEventArgs(packageType, packageId, (PackageEventState)eventState, progress)); - } - else if (eventType == Interop.PackageManager.EventType.Update) - { - s_updateEventHandler?.Invoke(null, new PackageManagerEventArgs(packageType, packageId, (PackageEventState)eventState, progress)); - } - else if (eventType == Interop.PackageManager.EventType.Move) - { - s_moveEventHandler?.Invoke(null, new PackageManagerEventArgs(packageType, packageId, (PackageEventState)eventState, progress)); - } - else if (eventType == Interop.PackageManager.EventType.ClearData) - { - s_clearDataEventHandler?.Invoke(null, new PackageManagerEventArgs(packageType, packageId, (PackageEventState)eventState, progress)); - } - } - catch (Exception e) - { - Log.Warn(LogTag, e.Message); - } - }; - - if (!Handle.IsInvalid) - { - Log.Debug(LogTag, "Reset Package Event"); - err = Interop.PackageManager.PackageManagerUnsetEvent(Handle); - if (err != Interop.PackageManager.ErrorCode.None) - { - throw PackageManagerErrorFactory.GetException(err, "Failed to unregister package manager event event."); - } - - err = Interop.PackageManager.PackageManagerSetEvent(Handle, s_packageManagerEventCallback, IntPtr.Zero); - } - if (err != Interop.PackageManager.ErrorCode.None) - { - Log.Warn(LogTag, string.Format("Failed to register callback for package manager event. err = {0}", err)); - } - } - - private static void UnregisterPackageManagerEventIfNeeded() - { - if (Handle.IsInvalid || s_installEventHandler != null || s_uninstallEventHandler != null || s_updateEventHandler != null || s_moveEventHandler != null || s_clearDataEventHandler != null) - { - return; - } - - var err = Interop.PackageManager.PackageManagerUnsetEvent(Handle); - if (err != Interop.PackageManager.ErrorCode.None) - { - throw PackageManagerErrorFactory.GetException(err, "Failed to unregister package manager event event."); - } - } - } - - internal static class PackageManagerErrorFactory - { - internal static Exception GetException(Interop.PackageManager.ErrorCode err, string message) - { - string errMessage = string.Format("{0} err = {1}", message, err); - switch (err) - { - case Interop.PackageManager.ErrorCode.InvalidParameter: - case Interop.PackageManager.ErrorCode.NoSuchPackage: - return new ArgumentException(errMessage); - case Interop.PackageManager.ErrorCode.PermissionDenied: - return new UnauthorizedAccessException(errMessage); - case Interop.PackageManager.ErrorCode.IoError: - return new global::System.IO.IOException(errMessage); - default: - return new InvalidOperationException(errMessage); - } - } - } -} diff --git a/src/Tizen.Applications.PackageManager/Tizen.Applications/PackageManagerEventArgs.cs b/src/Tizen.Applications.PackageManager/Tizen.Applications/PackageManagerEventArgs.cs deleted file mode 100755 index c84097049..000000000 --- a/src/Tizen.Applications.PackageManager/Tizen.Applications/PackageManagerEventArgs.cs +++ /dev/null @@ -1,59 +0,0 @@ -/* - * 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.Applications -{ - /// - /// PackageManagerEventArgs class. This class is an event arguments of the InstallProgressChanged, UninstallProgressChanged, and UpdateProgressChanged events. - /// - public class PackageManagerEventArgs : EventArgs - { - private readonly PackageType _packageType; - private readonly string _packageId; - private readonly PackageEventState _state; - private readonly int _progress; - - internal PackageManagerEventArgs(string packageType, string packageId, PackageEventState state, int progress) - { - _packageType = PackageTypeMethods.ToPackageType(packageType); - _packageId = packageId; - _state = state; - _progress = progress; - } - - /// - /// Type of the package to be installed, uninstalled, or updated. - /// - public PackageType PackageType { get { return _packageType; } } - - /// - /// Package ID to be installed, uninstalled, or updated. - /// - public string PackageId { get { return _packageId; } } - - /// - /// Current state of the request to the package manager. - /// - public PackageEventState State { get { return _state; } } - - /// - /// Progress for the request being processed by the package manager (in percent). - /// - public int Progress { get { return _progress; } } - } -} diff --git a/src/Tizen.Applications.PackageManager/Tizen.Applications/PackageSizeInformation.cs b/src/Tizen.Applications.PackageManager/Tizen.Applications/PackageSizeInformation.cs deleted file mode 100755 index b7d4b1582..000000000 --- a/src/Tizen.Applications.PackageManager/Tizen.Applications/PackageSizeInformation.cs +++ /dev/null @@ -1,78 +0,0 @@ -/* - * 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.Applications -{ - /// - /// This class has read-only properties to get the package size information. - /// - public class PackageSizeInformation - { - private long _dataSize; - private long _cacheSize; - private long _appSize; - private long _externalDataSize; - private long _externalCacheSize; - private long _externalAppSize; - - private PackageSizeInformation() { } - - /// - /// Data size for the package. - /// - public long DataSize { get { return _dataSize; } } - - /// - /// Cache size for the package. - /// - public long CacheSize { get { return _cacheSize; } } - - /// - /// Application size for the package. - /// - public long AppSize { get { return _appSize; } } - - /// - /// External data size for the package. - /// - public long ExternalDataSize { get { return _externalDataSize; } } - - /// - /// External cache size for the package. - /// - public long ExternalCacheSize { get { return _externalCacheSize; } } - - /// - /// External application size for the package. - /// - public long ExternalAppSize { get { return _externalAppSize; } } - - // This method assumes that pass handle is already validated - internal static PackageSizeInformation GetPackageSizeInformation(IntPtr handle) - { - var pkgSizeInfo = new PackageSizeInformation(); - Interop.PackageManager.PackageSizeInfoGetDataSize(handle, out pkgSizeInfo._dataSize); - Interop.PackageManager.PackageSizeInfoGetCacheSize(handle, out pkgSizeInfo._cacheSize); - Interop.PackageManager.PackageSizeInfoGetAppSize(handle, out pkgSizeInfo._appSize); - Interop.PackageManager.PackageSizeInfoGetExtDataSize(handle, out pkgSizeInfo._externalDataSize); - Interop.PackageManager.PackageSizeInfoGetExtCacheSize(handle, out pkgSizeInfo._externalCacheSize); - Interop.PackageManager.PackageSizeInfoGetExtAppSize(handle, out pkgSizeInfo._externalAppSize); - return pkgSizeInfo; - } - } -} \ No newline at end of file diff --git a/src/Tizen.Applications.PackageManager/Tizen.Applications/PackageType.cs b/src/Tizen.Applications.PackageManager/Tizen.Applications/PackageType.cs deleted file mode 100755 index 227db5f02..000000000 --- a/src/Tizen.Applications.PackageManager/Tizen.Applications/PackageType.cs +++ /dev/null @@ -1,70 +0,0 @@ -/* - * 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.Applications -{ - /// - /// Enumeration for the package types. - /// - public enum PackageType - { - UNKNOWN, - /// - /// Tizen native application package. - /// - TPK, - /// - /// Tizen web/hybrid application package. - /// - WGT, - /// - /// A special meaning type to represent the Tizen application package which is installed using the RPM spec. - /// Only some preloaded packages can have this type. - /// - RPM - } - - internal static class PackageTypeMethods - { - internal static PackageType ToPackageType(string type) - { - if (string.IsNullOrEmpty(type)) - { - throw PackageManagerErrorFactory.GetException(Interop.PackageManager.ErrorCode.InvalidParameter, "type can't be null or empty"); - } - - string lowerType = type.ToLower(); - if (lowerType == "tpk") - { - return PackageType.TPK; - } - else if (lowerType == "wgt") - { - return PackageType.WGT; - } - else if (lowerType == "rpm") - { - return PackageType.RPM; - } - else - { - throw PackageManagerErrorFactory.GetException(Interop.PackageManager.ErrorCode.InvalidParameter, "type should be tpk or wgt"); - } - } - } -} diff --git a/src/Tizen.Applications.PackageManager/Tizen.Applications/PermissionType.cs b/src/Tizen.Applications.PackageManager/Tizen.Applications/PermissionType.cs deleted file mode 100644 index d9e208308..000000000 --- a/src/Tizen.Applications.PackageManager/Tizen.Applications/PermissionType.cs +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) 2017 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.Applications -{ - /// - /// Enumeration for the permission types. - /// - public enum PermissionType - { - /// - /// Permission is normal. - /// - Normal, - /// - /// Permission is signature. - /// - Signature, - /// - /// Permission is privilege. - /// - Privilege - } -} diff --git a/src/Tizen.Applications.PackageManager/Tizen.Applications/SafePackageManagerHandle.cs b/src/Tizen.Applications.PackageManager/Tizen.Applications/SafePackageManagerHandle.cs deleted file mode 100755 index c05653b1e..000000000 --- a/src/Tizen.Applications.PackageManager/Tizen.Applications/SafePackageManagerHandle.cs +++ /dev/null @@ -1,50 +0,0 @@ -/* - * 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; - -namespace Tizen.Applications -{ - internal class SafePackageManagerHandle : SafeHandle - { - /// - /// Initializes a new instance of the SafePackageManagerHandle class. - /// - public SafePackageManagerHandle() : base(IntPtr.Zero, true) - { - } - - /// - /// Gets a value that indicates whether the handle is invalid. - /// - public override bool IsInvalid - { - get { return handle == IntPtr.Zero; } - } - - /// - /// Executes the code required to free the SafePackageManagerHandle. - /// - /// True if the handle is released successfully. - protected override bool ReleaseHandle() - { - Interop.PackageManager.PackageManagerDestroy(handle); - this.SetHandle(IntPtr.Zero); - return true; - } - } -} diff --git a/src/Tizen.Applications.PackageManager/Tizen.Applications/SafePackageManagerRequestHandle.cs b/src/Tizen.Applications.PackageManager/Tizen.Applications/SafePackageManagerRequestHandle.cs deleted file mode 100755 index 60a2bfd83..000000000 --- a/src/Tizen.Applications.PackageManager/Tizen.Applications/SafePackageManagerRequestHandle.cs +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) 2017 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; - -namespace Tizen.Applications -{ - internal class SafePackageManagerRequestHandle : SafeHandle - { - /// - /// Initializes a new instance of the SafePackageManagerRequestHandle class. - /// - public SafePackageManagerRequestHandle() : base(IntPtr.Zero, true) - { - } - - /// - /// Gets a value that indicates whether the handle is invalid. - /// - public override bool IsInvalid - { - get { return handle == IntPtr.Zero; } - } - - /// - /// Executes the code required to free the SafePackageManagerRequestHandle. - /// - /// True if the handle is released successfully. - protected override bool ReleaseHandle() - { - Interop.PackageManager.PackageManagerRequestDestroy(handle); - this.SetHandle(IntPtr.Zero); - return true; - } - } -} \ No newline at end of file diff --git a/src/Tizen.Applications.PackageManager/Tizen.Applications/StorageType.cs b/src/Tizen.Applications.PackageManager/Tizen.Applications/StorageType.cs deleted file mode 100755 index 040c1fb45..000000000 --- a/src/Tizen.Applications.PackageManager/Tizen.Applications/StorageType.cs +++ /dev/null @@ -1,33 +0,0 @@ -/* - * 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. - */ - -namespace Tizen.Applications -{ - /// - /// Enumeration for the storage types. - /// - public enum StorageType - { - /// - /// Internal storage. - /// - Internal = Interop.PackageManager.StorageType.Internal, - /// - /// External storage. - /// - External = Interop.PackageManager.StorageType.External - } -} \ No newline at end of file diff --git a/src/Tizen.Applications.Preference/Interop/Interop.Libraries.cs b/src/Tizen.Applications.Preference/Interop/Interop.Libraries.cs deleted file mode 100755 index d65c74253..000000000 --- a/src/Tizen.Applications.Preference/Interop/Interop.Libraries.cs +++ /dev/null @@ -1,23 +0,0 @@ -/* - * 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 Preference = "libcapi-appfw-preference.so.0"; - } -} diff --git a/src/Tizen.Applications.Preference/Interop/Interop.Preference.cs b/src/Tizen.Applications.Preference/Interop/Interop.Preference.cs deleted file mode 100755 index 96958eb16..000000000 --- a/src/Tizen.Applications.Preference/Interop/Interop.Preference.cs +++ /dev/null @@ -1,77 +0,0 @@ -/* - * 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; -using Tizen.Applications; - -/// -/// Contains interop declarations of the preference classes. -/// -internal static partial class Interop -{ - /// - /// Contains interop declarations of the preference device API. - /// - internal static partial class Preference - { - internal delegate void ChangedCallback(string key, IntPtr userData); - - internal delegate bool ItemCallback(string key, IntPtr userData); - - [DllImport(Libraries.Preference, EntryPoint = "preference_set_int")] - internal static extern int SetInt(string key, int value); - - [DllImport(Libraries.Preference, EntryPoint = "preference_get_int")] - internal static extern int GetInt(string key, out int value); - - [DllImport(Libraries.Preference, EntryPoint = "preference_set_double")] - internal static extern int SetDouble(string key, double value); - - [DllImport(Libraries.Preference, EntryPoint = "preference_get_double")] - internal static extern int GetDouble(string key, out double value); - - [DllImport(Libraries.Preference, EntryPoint = "preference_set_string")] - internal static extern int SetString(string key, string value); - - [DllImport(Libraries.Preference, EntryPoint = "preference_get_string")] - internal static extern int GetString(string key, out string value); - - [DllImport(Libraries.Preference, EntryPoint = "preference_set_boolean")] - internal static extern int SetBoolean(string key, bool value); - - [DllImport(Libraries.Preference, EntryPoint = "preference_get_boolean")] - internal static extern int GetBoolean(string key, out bool value); - - [DllImport(Libraries.Preference, EntryPoint = "preference_remove")] - internal static extern int Remove(string key); - - [DllImport(Libraries.Preference, EntryPoint = "preference_is_existing")] - internal static extern int IsExisting(string key, out bool existing); - - [DllImport(Libraries.Preference, EntryPoint = "preference_remove_all")] - internal static extern int RemoveAll(); - - [DllImport(Libraries.Preference, EntryPoint = "preference_set_changed_cb")] - internal static extern int SetChangedCb(string key, ChangedCallback callback, IntPtr userData); - - [DllImport(Libraries.Preference, EntryPoint = "preference_unset_changed_cb")] - internal static extern int UnsetChangedCb(string key); - - [DllImport(Libraries.Preference, EntryPoint = "preference_foreach_item")] - internal static extern int ForeachItem(ItemCallback callback, IntPtr userData); - } -} diff --git a/src/Tizen.Applications.Preference/Tizen.Applications.Preference.csproj b/src/Tizen.Applications.Preference/Tizen.Applications.Preference.csproj deleted file mode 100755 index 7f4584ffe..000000000 --- a/src/Tizen.Applications.Preference/Tizen.Applications.Preference.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - netstandard2.0 - - - - - - - - diff --git a/src/Tizen.Applications.Preference/Tizen.Applications.Preference.sln b/src/Tizen.Applications.Preference/Tizen.Applications.Preference.sln deleted file mode 100755 index 2eff8e74d..000000000 --- a/src/Tizen.Applications.Preference/Tizen.Applications.Preference.sln +++ /dev/null @@ -1,34 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26430.12 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Applications.Preference", "Tizen.Applications.Preference.csproj", "{552DE9C5-1CE3-4C9F-AE29-13D8A8455E94}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen", "..\Tizen\Tizen.csproj", "{7E1029E6-9699-49EF-A3CE-ABD198FB138B}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Log", "..\Tizen.Log\Tizen.Log.csproj", "{9533C92C-0AA3-4798-AB7D-31FD9D9BEE9C}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {552DE9C5-1CE3-4C9F-AE29-13D8A8455E94}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {552DE9C5-1CE3-4C9F-AE29-13D8A8455E94}.Debug|Any CPU.Build.0 = Debug|Any CPU - {552DE9C5-1CE3-4C9F-AE29-13D8A8455E94}.Release|Any CPU.ActiveCfg = Release|Any CPU - {552DE9C5-1CE3-4C9F-AE29-13D8A8455E94}.Release|Any CPU.Build.0 = Release|Any CPU - {7E1029E6-9699-49EF-A3CE-ABD198FB138B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7E1029E6-9699-49EF-A3CE-ABD198FB138B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7E1029E6-9699-49EF-A3CE-ABD198FB138B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7E1029E6-9699-49EF-A3CE-ABD198FB138B}.Release|Any CPU.Build.0 = Release|Any CPU - {9533C92C-0AA3-4798-AB7D-31FD9D9BEE9C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {9533C92C-0AA3-4798-AB7D-31FD9D9BEE9C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {9533C92C-0AA3-4798-AB7D-31FD9D9BEE9C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {9533C92C-0AA3-4798-AB7D-31FD9D9BEE9C}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/src/Tizen.Applications.Preference/Tizen.Applications/Preference.cs b/src/Tizen.Applications.Preference/Tizen.Applications/Preference.cs deleted file mode 100755 index 742f1329e..000000000 --- a/src/Tizen.Applications.Preference/Tizen.Applications/Preference.cs +++ /dev/null @@ -1,463 +0,0 @@ -/* - * 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.Collections.Generic; -using Tizen.Internals.Errors; - -namespace Tizen.Applications -{ - /// - /// The preference class provides APIs to store and retrieve an application specific data/preference. A preference is saved in the form of a key-value pair. - /// Keys are always text strings and the value can be any one of the four types: integer, double, string, and boolean. - /// - public static class Preference - { - private const string LogTag = "Tizen.Applications"; - private static Interop.Preference.ChangedCallback s_preferenceChangedCallback; - private static IDictionary s_eventMap = new Dictionary(); - - static Preference() - { - s_preferenceChangedCallback = (string key, IntPtr userData) => - { - try - { - s_eventMap[key]?.FireEvent(); - } - catch (Exception e) - { - Log.Warn(LogTag, e.Message); - } - }; - } - - /// - /// Retrieves all keys of the application preferences. - /// - /// - /// The list of keys. - /// - /// - /// - /// Preference.Set("Option_enabled", true); - /// Preference.Set("active_user", "Joe"); - /// Preference.Set("default_volume", 10); - /// Preference.Set("brightness", "0.6"); - /// foreach(string key in Preference.Keys) - /// { - /// Console.WriteLine("key {0}", key); - /// } - /// - /// - public static IEnumerable Keys - { - get - { - var collection = new List(); - Interop.Preference.ItemCallback itemsCallback = (string key, IntPtr userData) => - { - collection.Add(key); - return true; - }; - Interop.Preference.ForeachItem(itemsCallback, IntPtr.Zero); - return collection; - } - } - - /// - /// Gets the event context for the given key. - /// - /// - /// The preference key. - /// The event context of respective key. - /// Thrown if the key is not found. - /// Thrown if the key is invalid parameter. - /// - /// - /// private static void Preference_PreferenceChanged(object sender, PreferenceChangedEventArgs e) - /// { - /// Console.WriteLine("key {0}", e.Key); - /// } - /// - /// Preference.EventContext context = null; - /// Preference.GetEventContext("active_user").TryGetTarget(out context); - /// if(context != null) - /// { - /// context.Changed += Preference_PreferenceChanged; - /// } - /// - /// Preference.Set("active_user", "Poe"); - /// - /// Preference.GetEventContext("active_user").TryGetTarget(out context); - /// if (context != null) - /// { - /// context.Changed -= Preference_PreferenceChanged; - /// } - /// - /// - public static WeakReference GetEventContext(string key) - { - if (!s_eventMap.ContainsKey(key)) - { - if (Contains(key)) - { - s_eventMap[key] = new EventContext(key); - } - else - { - throw PreferenceErrorFactory.GetException((int)PreferenceErrorFactory.PreferenceError.KeyNotAvailable); - } - } - - return new WeakReference(s_eventMap[key]); - } - - /// - /// Checks whether the given key exists in the preference. - /// - /// The name of the key to check. - /// True if the key exists in the preference, otherwise false. - /// Thrown if the key is an invalid parameter. - /// Thrown when the method failed due to an internal I/O error. - /// - /// - /// Preference.Set("active_user", "Joe"); - /// bool exists = Preference.Contains("active_user"); - /// if (exists) - /// { - /// string value = Preference.Get("active_user"); - /// Console.WriteLine("user {0}", value); - /// } - /// - /// - public static bool Contains(string key) - { - bool contains; - int ret = Interop.Preference.IsExisting(key, out contains); - if (ret != (int)PreferenceErrorFactory.PreferenceError.None) - { - Log.Error(LogTag, "Failed to find key"); - throw PreferenceErrorFactory.GetException(ret); - } - - return contains; - } - - /// - /// Sets a key-value pair representing the preference. - /// - /// - /// If the key already exists in the preference, the old value will be overwritten with a new value. - /// Data types for supported values are: integer, double, string, and bool. - /// - /// The name of the key to create/modify./param> - /// The value corresponding to the key. - /// Thrown if the key is an invalid parameter. - /// Thrown when the method failed due to an internal I/O error. - /// - /// - /// Preference.Set("Option_enabled", true); - /// Preference.Set("active_user", "Joe"); - /// Preference.Set("default_volume", 10); - /// Preference.Set("brightness", "0.6"); - /// - /// - public static void Set(string key, object value) - { - int ret = 0; - if (value is int) - { - ret = Interop.Preference.SetInt(key, (int)value); - if (ret != (int)PreferenceErrorFactory.PreferenceError.None) - { - Log.Error(LogTag, "Failed to find key"); - throw PreferenceErrorFactory.GetException(ret); - } - } - else if (value is double) - { - ret = Interop.Preference.SetDouble(key, (double)value); - if (ret != (int)PreferenceErrorFactory.PreferenceError.None) - { - Log.Error(LogTag, "Failed to find key"); - throw PreferenceErrorFactory.GetException(ret); - } - } - else if (value is string) - { - ret = Interop.Preference.SetString(key, (string)value); - if (ret != (int)PreferenceErrorFactory.PreferenceError.None) - { - Log.Error(LogTag, "Failed to find key"); - throw PreferenceErrorFactory.GetException(ret); - } - } - else if (value is bool) - { - ret = Interop.Preference.SetBoolean(key, (bool)value); - if (ret != (int)PreferenceErrorFactory.PreferenceError.None) - { - Log.Error(LogTag, "Failed to find key"); - throw PreferenceErrorFactory.GetException(ret); - } - } - else - { - Log.Error(LogTag, "Failed to Set"); - throw new ArgumentException("Invalid parameter"); - } - } - - /// - /// Gets the value of a preference item with the specified key. - /// Note that this is a generic method. - /// - /// The generic type to return. - /// The key of the preference. - /// The value of the preference item if it is of the specified generic type. - /// Thrown if the key is not found. - /// Thrown if the key is an invalid parameter. - /// Thrown when the method failed due to an internal I/O error. - /// - /// - /// bool exists = Preference.Contains("active_user"); - /// if (exists) - /// { - /// string value = Preference.Get("active_user"); - /// Console.WriteLine("user {0}", value); - /// } - /// - /// - public static T Get(string key) - { - object result = null; - int ret = (int)PreferenceErrorFactory.PreferenceError.None; - if (typeof(T) == typeof(bool)) - { - bool val; - ret = Interop.Preference.GetBoolean(key, out val); - result = val; - } - else if (typeof(T) == typeof(int)) - { - int val; - ret = Interop.Preference.GetInt(key, out val); - result = val; - } - else if (typeof(T) == typeof(string)) - { - string val; - ret = Interop.Preference.GetString(key, out val); - result = val; - } - else if (typeof(T) == typeof(double)) - { - double val; - ret = Interop.Preference.GetDouble(key, out val); - result = val; - } - else - { - Log.Error(LogTag, "Failed to remove key"); - throw new ArgumentException("Invalid parameter"); - } - - if (ret != (int)PreferenceErrorFactory.PreferenceError.None) - { - Log.Error(LogTag, "Failed to remove key"); - throw PreferenceErrorFactory.GetException(ret); - } - - return (result != null) ? (T)result : default(T); - } - - /// - /// Removes any preference value with the given key. - /// - /// The key to remove. - /// Thrown if the key is not found. - /// Thrown when the method failed due to an internal I/O error. - /// - /// - /// bool exists = Preference.Contains("active_user"); - /// if (exists) - /// { - /// string value = Preference.Remove("active_user"); - /// } - /// - /// - public static void Remove(string key) - { - int ret = Interop.Preference.Remove(key); - if (ret != (int)PreferenceErrorFactory.PreferenceError.None) - { - Log.Error(LogTag, "Failed to remove key"); - throw PreferenceErrorFactory.GetException(ret); - } - } - - /// - /// Removes all the key-value pairs from the preference. - /// - /// Thrown when the method failed due to an internal I/O error. - /// - /// - /// Preference.Set("Option_enabled", true); - /// Preference.Set("active_user", "Joe"); - /// Preference.Set("default_volume", 10); - /// Preference.Set("brightness", "0.6"); - /// Preference.RemoveAll(); - /// - /// - public static void RemoveAll() - { - int ret = Interop.Preference.RemoveAll(); - if (ret != (int)PreferenceErrorFactory.PreferenceError.None) - { - Log.Error(LogTag, "Failed to remove all keys"); - throw PreferenceErrorFactory.GetException(ret); - } - } - - private static void AllowChangeNotifications(string key) - { - int ret = Interop.Preference.SetChangedCb(key, s_preferenceChangedCallback, IntPtr.Zero); - if (ret != (int)PreferenceErrorFactory.PreferenceError.None) - { - Log.Error(LogTag, "Failed to set key notification"); - throw PreferenceErrorFactory.GetException(ret); - } - } - - private static void DisallowChangeNotifications(string key) - { - int ret = Interop.Preference.UnsetChangedCb(key); - if (ret != (int)PreferenceErrorFactory.PreferenceError.None) - { - Log.Error(LogTag, "Failed to remove key notification"); - throw PreferenceErrorFactory.GetException(ret); - } - } - - /// - /// The class manages event handlers of the preference keys. The class enables having event handlers for individual preference keys. - /// - public class EventContext - { - private string _key; - - internal EventContext(string key) - { - _key = key; - } - - /// - /// Occurs whenever there is a change in the value of a preference key. - /// - /// Thrown when the key does not exist or when there is an invalid parameter. - /// Thrown when the bundle instance has been disposed. - /// - /// - /// private static void Preference_PreferenceChanged(object sender, PreferenceChangedEventArgs e) - /// { - /// Console.WriteLine("key {0}", e.Key); - /// } - /// Preference.EventContext context = null; - /// Preference.GetEventContext("active_user").TryGetTarget(out context); - /// if(context != null) - /// { - /// context.Changed += Preference_PreferenceChanged; - /// } - /// - /// Preference.Set("active_user", "Poe"); - /// - /// Preference.GetEventContext("active_user").TryGetTarget(out context); - /// if (context != null) - /// { - /// context.Changed -= Preference_PreferenceChanged; - /// } - /// - /// - public event EventHandler Changed - { - add - { - if (_changed == null) - { - AllowChangeNotifications(_key); - } - - _changed += value; - } - - remove - { - _changed -= value; - if (_changed == null) - { - DisallowChangeNotifications(_key); - s_eventMap.Remove(_key); - } - } - } - - private event EventHandler _changed; - - internal void FireEvent() - { - _changed?.Invoke(null, new PreferenceChangedEventArgs() { Key = _key }); - } - } - - } - - internal static class PreferenceErrorFactory - { - internal enum PreferenceError - { - None = ErrorCode.None, - OutOfMemory = ErrorCode.OutOfMemory, - InvalidParameter = ErrorCode.InvalidParameter, - KeyNotAvailable = -0x01100000 | 0x30, - IoError = ErrorCode.IoError - } - - static internal Exception GetException(int error) - { - if ((PreferenceError)error == PreferenceError.OutOfMemory) - { - return new OutOfMemoryException("Out of memory"); - } - else if ((PreferenceError)error == PreferenceError.InvalidParameter) - { - return new ArgumentException("Invalid parameter"); - } - else if ((PreferenceError)error == PreferenceError.KeyNotAvailable) - { - return new KeyNotFoundException("Key does not exist in the bundle"); - } - else if ((PreferenceError)error == PreferenceError.IoError) - { - return new System.IO.IOException("I/O Error"); - } - else - { - return new ArgumentException("Unknown error"); - } - } - } -} diff --git a/src/Tizen.Applications.Preference/Tizen.Applications/PreferenceChangedEventArgs.cs b/src/Tizen.Applications.Preference/Tizen.Applications/PreferenceChangedEventArgs.cs deleted file mode 100755 index 99f81dd18..000000000 --- a/src/Tizen.Applications.Preference/Tizen.Applications/PreferenceChangedEventArgs.cs +++ /dev/null @@ -1,31 +0,0 @@ -/* - * 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.Applications -{ - /// - /// This class is an event argument of the PreferenceChanged event. - /// - public class PreferenceChangedEventArgs : EventArgs - { - /// - /// The key of the preference whose value is changed. - /// - public string Key { get; internal set; } - } -} diff --git a/src/Tizen.Applications.RemoteView/Interop/Interop.Libraries.cs b/src/Tizen.Applications.RemoteView/Interop/Interop.Libraries.cs deleted file mode 100755 index 309f4e406..000000000 --- a/src/Tizen.Applications.RemoteView/Interop/Interop.Libraries.cs +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2017 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 WidgetViewerEvas = "libwidget_viewer_evas.so.1"; - } -} diff --git a/src/Tizen.Applications.RemoteView/Interop/Interop.WidgetViewerEvas.cs b/src/Tizen.Applications.RemoteView/Interop/Interop.WidgetViewerEvas.cs deleted file mode 100755 index 30ca17152..000000000 --- a/src/Tizen.Applications.RemoteView/Interop/Interop.WidgetViewerEvas.cs +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Copyright (c) 2017 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; - -using Tizen.Applications; - -internal static partial class Interop -{ - internal static partial class WidgetViewerEvas - { - internal enum ErrorCode : int - { - None = Tizen.Internals.Errors.ErrorCode.None, - InvalidParameter = Tizen.Internals.Errors.ErrorCode.InvalidParameter, - OutOfMemory = Tizen.Internals.Errors.ErrorCode.OutOfMemory, - ResourceBusy = Tizen.Internals.Errors.ErrorCode.ResourceBusy, - PermissionDenied = Tizen.Internals.Errors.ErrorCode.PermissionDenied, - Canceled = Tizen.Internals.Errors.ErrorCode.Canceled, - IoError = Tizen.Internals.Errors.ErrorCode.IoError, - TimedOut = Tizen.Internals.Errors.ErrorCode.TimedOut, - NotSupported = Tizen.Internals.Errors.ErrorCode.NotSupported, - FileNoSpaceOnDevice = Tizen.Internals.Errors.ErrorCode.FileNoSpaceOnDevice, - Fault = -0x02F40000 | 0x0001, - AlreadyExist = -0x02F40000 | 0x0002, - AlreadyStarted = -0x02F40000 | 0x0004, - NotExist = -0x02F40000 | 0x0008, - Disabled = -0x02F40000 | 0x0010, - MaxExceeded = -0x02F40000 | 0x0011, - } - - [DllImport(Libraries.WidgetViewerEvas, EntryPoint = "widget_viewer_evas_init")] - internal static extern ErrorCode Init(IntPtr win); - - [DllImport(Libraries.WidgetViewerEvas, EntryPoint = "widget_viewer_evas_fini")] - internal static extern ErrorCode Fini(); - - [DllImport(Libraries.WidgetViewerEvas, EntryPoint = "widget_viewer_evas_add_widget")] - internal static extern IntPtr AddWidget(IntPtr parent, string widgetId, string content, double period); - - [DllImport(Libraries.WidgetViewerEvas, EntryPoint = "widget_viewer_evas_notify_resumed_status_of_viewer")] - internal static extern ErrorCode NotifyResumedStatusOfViewer(); - - [DllImport(Libraries.WidgetViewerEvas, EntryPoint = "widget_viewer_evas_notify_paused_status_of_viewer")] - internal static extern ErrorCode NotifyPausedStatusOfViewer(); - - [DllImport(Libraries.WidgetViewerEvas, EntryPoint = "widget_viewer_evas_pause_widget")] - internal static extern ErrorCode PauseWidget(IntPtr widget); - - [DllImport(Libraries.WidgetViewerEvas, EntryPoint = "widget_viewer_evas_resume_widget")] - internal static extern ErrorCode ResumeWidget(IntPtr widget); - - [DllImport(Libraries.WidgetViewerEvas, EntryPoint = "widget_viewer_evas_get_content_info")] - internal static extern IntPtr GetContentInfo(IntPtr widget); - - [DllImport(Libraries.WidgetViewerEvas, EntryPoint = "widget_viewer_evas_get_title_string")] - internal static extern IntPtr GetTitleString(IntPtr widget); - - [DllImport(Libraries.WidgetViewerEvas, EntryPoint = "widget_viewer_evas_get_widget_id")] - internal static extern IntPtr GetWidgetId(IntPtr widget); - - [DllImport(Libraries.WidgetViewerEvas, EntryPoint = "widget_viewer_evas_get_period")] - internal static extern double GetPeriod(IntPtr widget); - - [DllImport(Libraries.WidgetViewerEvas, EntryPoint = "widget_viewer_evas_cancel_click_event")] - internal static extern void CancelClickEvent(IntPtr widget); - - [DllImport(Libraries.WidgetViewerEvas, EntryPoint = "widget_viewer_evas_disable_loading")] - internal static extern void DisableLoading(IntPtr widget); - - [DllImport(Libraries.WidgetViewerEvas, EntryPoint = "widget_viewer_evas_feed_mouse_up_event")] - internal static extern ErrorCode FeedMouseUpEvent(IntPtr widget); - - [DllImport(Libraries.WidgetViewerEvas, EntryPoint = "widget_viewer_evas_disable_preview")] - internal static extern void DisablePreview(IntPtr widget); - - [DllImport(Libraries.WidgetViewerEvas, EntryPoint = "widget_viewer_evas_disable_overlay_text")] - internal static extern void DisableOverlayText(IntPtr widget); - - } -} diff --git a/src/Tizen.Applications.RemoteView/Tizen.Applications.RemoteView.csproj b/src/Tizen.Applications.RemoteView/Tizen.Applications.RemoteView.csproj deleted file mode 100644 index f47359d6b..000000000 --- a/src/Tizen.Applications.RemoteView/Tizen.Applications.RemoteView.csproj +++ /dev/null @@ -1,13 +0,0 @@ - - - - netstandard2.0 - - - - - - - - - diff --git a/src/Tizen.Applications.RemoteView/Tizen.Applications.RemoteView.sln b/src/Tizen.Applications.RemoteView/Tizen.Applications.RemoteView.sln deleted file mode 100755 index 3672ee72e..000000000 --- a/src/Tizen.Applications.RemoteView/Tizen.Applications.RemoteView.sln +++ /dev/null @@ -1,40 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26430.12 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Applications.RemoteView", "Tizen.Applications.RemoteView.csproj", "{9570A755-64BB-438F-9159-A23EBF578DC3}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ElmSharp", "..\ElmSharp\ElmSharp.csproj", "{F5CBED3B-5663-457F-90FF-54FB36DD2F94}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen", "..\Tizen\Tizen.csproj", "{A3374C5B-ECF6-4124-9A96-C93F2C315046}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Log", "..\Tizen.Log\Tizen.Log.csproj", "{EBF82A76-BC04-4404-AD72-C4E1E7BB48BE}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {9570A755-64BB-438F-9159-A23EBF578DC3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {9570A755-64BB-438F-9159-A23EBF578DC3}.Debug|Any CPU.Build.0 = Debug|Any CPU - {9570A755-64BB-438F-9159-A23EBF578DC3}.Release|Any CPU.ActiveCfg = Release|Any CPU - {9570A755-64BB-438F-9159-A23EBF578DC3}.Release|Any CPU.Build.0 = Release|Any CPU - {F5CBED3B-5663-457F-90FF-54FB36DD2F94}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F5CBED3B-5663-457F-90FF-54FB36DD2F94}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F5CBED3B-5663-457F-90FF-54FB36DD2F94}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F5CBED3B-5663-457F-90FF-54FB36DD2F94}.Release|Any CPU.Build.0 = Release|Any CPU - {A3374C5B-ECF6-4124-9A96-C93F2C315046}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A3374C5B-ECF6-4124-9A96-C93F2C315046}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A3374C5B-ECF6-4124-9A96-C93F2C315046}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A3374C5B-ECF6-4124-9A96-C93F2C315046}.Release|Any CPU.Build.0 = Release|Any CPU - {EBF82A76-BC04-4404-AD72-C4E1E7BB48BE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {EBF82A76-BC04-4404-AD72-C4E1E7BB48BE}.Debug|Any CPU.Build.0 = Debug|Any CPU - {EBF82A76-BC04-4404-AD72-C4E1E7BB48BE}.Release|Any CPU.ActiveCfg = Release|Any CPU - {EBF82A76-BC04-4404-AD72-C4E1E7BB48BE}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/src/Tizen.Applications.RemoteView/Tizen.Applications/RemoteView.cs b/src/Tizen.Applications.RemoteView/Tizen.Applications/RemoteView.cs deleted file mode 100755 index f20e8bb27..000000000 --- a/src/Tizen.Applications.RemoteView/Tizen.Applications/RemoteView.cs +++ /dev/null @@ -1,231 +0,0 @@ -/* - * Copyright (c) 2017 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 ElmSharp; -using System; -using System.Runtime.InteropServices; - -namespace Tizen.Applications -{ - /// - /// Represents the proxy class for the widget application. - /// - public class RemoteView - { - /// - /// The event types to send. - /// - public enum Event - { - /// - /// Type for feeding the mouse-up event to the widget application. - /// - FeedMouseUp, - - /// - /// Type for canceling the click event procedure. - /// - CancelClick - } - - /// - /// Layout object including preview image, overlay text, loading text, and remote screen image. - /// - /// http://tizen.org/privilege/widget.viewer - public Layout Layout { get; internal set; } - - /// - /// The widget ID. - /// - /// http://tizen.org/privilege/widget.viewer - public string Id - { - get - { - IntPtr ptr = Interop.WidgetViewerEvas.GetWidgetId(Layout); - - return Marshal.PtrToStringAnsi(ptr); - } - } - - /// - /// The update period. - /// - /// http://tizen.org/privilege/widget.viewer - public double Period - { - get - { - return Interop.WidgetViewerEvas.GetPeriod(Layout); - } - } - - /// - /// Contents of the widget. - /// - /// - /// This string can be used for creating contents of the widget again after rebooting a device or it can be recovered from a crash (abnormal status). - /// - /// http://tizen.org/privilege/widget.viewer - public string Content - { - get - { - IntPtr ptr = Interop.WidgetViewerEvas.GetContentInfo(Layout); - - return Marshal.PtrToStringAnsi(ptr); - } - } - - /// - /// Summarized string of the widget content for accessibility. - /// - /// http://tizen.org/privilege/widget.viewer - public string Title - { - get - { - IntPtr ptr = Interop.WidgetViewerEvas.GetTitleString(Layout); - - return Marshal.PtrToStringAnsi(ptr); - } - } - - internal RemoteView() - { - } - - internal static void CheckException(Interop.WidgetViewerEvas.ErrorCode err) - { - switch (err) - { - case Interop.WidgetViewerEvas.ErrorCode.Fault: - throw new InvalidOperationException("Fault at unmanaged code"); - - case Interop.WidgetViewerEvas.ErrorCode.PermissionDenied: - throw new UnauthorizedAccessException(); - - case Interop.WidgetViewerEvas.ErrorCode.NotSupported: - throw new NotSupportedException(); - - case Interop.WidgetViewerEvas.ErrorCode.InvalidParameter: - throw new InvalidOperationException("Invalid parameter error at unmanaged code"); - - case Interop.WidgetViewerEvas.ErrorCode.AlreadyExist: - throw new InvalidOperationException("Already exist"); - - case Interop.WidgetViewerEvas.ErrorCode.MaxExceeded: - throw new InvalidOperationException("Max exceeded"); - } - } - - /// - /// Pauses all the connected widget applications. - /// - /// http://tizen.org/privilege/widget.viewer - /// Thrown when this operation failed. - /// Thrown when this operation is denied. - /// Thrown when this operation is not supported for this device. - public static void PauseAll() - { - CheckException(Interop.WidgetViewerEvas.NotifyPausedStatusOfViewer()); - } - - /// - /// Resumes all the connected widget applications. - /// - /// http://tizen.org/privilege/widget.viewer - /// Thrown when this operation failed. - /// Thrown when this operation is denied. - /// Thrown when this operation is not supported for this device<./exception> - public static void ResumeAll() - { - CheckException(Interop.WidgetViewerEvas.NotifyResumedStatusOfViewer()); - } - - /// - /// Pauses the widget application which is connected on this proxy. - /// - /// http://tizen.org/privilege/widget.viewer - /// Thrown when this operation failed. - /// Thrown when this operation is denied. - /// Thrown when this operation is not supported for this device. - public void Pause() - { - CheckException(Interop.WidgetViewerEvas.PauseWidget(Layout)); - } - - /// - /// Resumes the widget application which is connected on this proxy. - /// - /// http://tizen.org/privilege/widget.viewer - /// Thrown when this operation failed. - /// Thrown when this operation is denied. - /// Thrown when this operation is not supported for this device. - public void Resume() - { - CheckException(Interop.WidgetViewerEvas.ResumeWidget(Layout)); - } - - /// - /// Sends the event to the widget application which is connected on this proxy. - /// - /// http://tizen.org/privilege/widget.viewer - /// Thrown when this operation is denied. - /// Thrown when this operation is not supported for this device. - public void SendEvent(Event ev) - { - switch (ev) - { - case Event.FeedMouseUp: - Interop.WidgetViewerEvas.FeedMouseUpEvent(Layout); - break; - - case Event.CancelClick: - Interop.WidgetViewerEvas.CancelClickEvent(Layout); - break; - - default: - throw new NotSupportedException("Not supported event type"); - } - - int err = Internals.Errors.ErrorFacts.GetLastResult(); - CheckException((Interop.WidgetViewerEvas.ErrorCode)err); - } - - internal void HideLoadingMessage() - { - Interop.WidgetViewerEvas.DisableLoading(Layout); - int err = Internals.Errors.ErrorFacts.GetLastResult(); - CheckException((Interop.WidgetViewerEvas.ErrorCode)err); - } - - internal void HidePreviewImage() - { - Interop.WidgetViewerEvas.DisablePreview(Layout); - int err = Internals.Errors.ErrorFacts.GetLastResult(); - CheckException((Interop.WidgetViewerEvas.ErrorCode)err); - } - - internal void HideOverlayText() - { - Interop.WidgetViewerEvas.DisableOverlayText(Layout); - int err = Internals.Errors.ErrorFacts.GetLastResult(); - CheckException((Interop.WidgetViewerEvas.ErrorCode)err); - } - - } -} diff --git a/src/Tizen.Applications.RemoteView/Tizen.Applications/RemoteViewFactory.cs b/src/Tizen.Applications.RemoteView/Tizen.Applications/RemoteViewFactory.cs deleted file mode 100755 index 0820a5ed7..000000000 --- a/src/Tizen.Applications.RemoteView/Tizen.Applications/RemoteViewFactory.cs +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Copyright (c) 2017 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 ElmSharp; -using System; - -namespace Tizen.Applications -{ - /// - /// Represents a factory class for making the RemoteView objects. - /// - public static class RemoteViewFactory - { - private static bool _ready; - - /// - /// Initializes RemoteViewFactory. - /// - /// Window object that will contain RemoteViews that are generated by RemoteViewFactory. - /// All the remote views will be located in the specified window object. - /// - /// http://tizen.org/privilege/widget.viewer - /// Thrown when this operation failed. - /// Thrown when this operation is denied. - /// Thrown when this operation is not supported for this device. - public static void Init(EvasObject win) - { - if (_ready) - throw new InvalidOperationException("Already initialized"); - RemoteView.CheckException(Interop.WidgetViewerEvas.Init(win)); - _ready = true; - } - - /// - /// Creates a RemoteView object. - /// - /// Parent object. - /// Widget ID. - /// Contents that will be given to the widget instance. - /// Update period. - /// True if you want to show the preview image. - /// True if you want to show the overlay text. - /// True if you want to show the loading message. - /// RemoteView object. - /// http://tizen.org/privilege/widget.viewer - /// Thrown when this operation failed. - /// Thrown when this operation is denied. - /// Thrown when this operation is not supported for this device. - public static RemoteView Create(EvasObject parent, string widgetId, string content, double period, - bool previewImage = true, bool overlayText = true, bool loadingMessage = true) - { - if (!_ready) - throw new InvalidOperationException("Not initialized"); - - var obj = new RemoteView() - { - Layout = new RemoteWindow(parent, widgetId, content, period) - }; - - if (!previewImage) - obj.HidePreviewImage(); - - if (!overlayText) - obj.HideOverlayText(); - - if (!loadingMessage) - obj.HideLoadingMessage(); - - return obj; - } - - /// - /// Finalizes the RemoteViewFactory. - /// - /// http://tizen.org/privilege/widget.viewer - /// Thrown when this operation failed. - /// Thrown when this operation is denied. - /// Thrown when this operation is not supported for this device. - public static void Shutdown() - { - if (!_ready) - throw new InvalidOperationException("Not initialized"); - RemoteView.CheckException(Interop.WidgetViewerEvas.Fini()); - _ready = false; - } - - } -} diff --git a/src/Tizen.Applications.RemoteView/Tizen.Applications/RemoteWindow.cs b/src/Tizen.Applications.RemoteView/Tizen.Applications/RemoteWindow.cs deleted file mode 100755 index c3874fb52..000000000 --- a/src/Tizen.Applications.RemoteView/Tizen.Applications/RemoteWindow.cs +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (c) 2017 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 ElmSharp; -using System; - -namespace Tizen.Applications -{ - internal class RemoteWindow : Layout - { - private static IntPtr _handle; - - private static EvasObject PrepareHandle(EvasObject parent, string widgetId, string content, double period) - { - _handle = Interop.WidgetViewerEvas.AddWidget(parent, widgetId, content, period); - - int err = Internals.Errors.ErrorFacts.GetLastResult(); - RemoteView.CheckException((Interop.WidgetViewerEvas.ErrorCode)err); - - if (_handle == IntPtr.Zero) - throw new InvalidOperationException("Return null pointer"); - - return parent; - } - - internal RemoteWindow(EvasObject parent, string widgetId, string content, double period) - : base(PrepareHandle(parent, widgetId, content, period)) - { - } - - protected override IntPtr CreateHandle(EvasObject parent) - { - IntPtr handle = _handle; - - _handle = IntPtr.Zero; - return handle; - } - } -} - diff --git a/src/Tizen.Applications.Service/Interop/Interop.Libraries.cs b/src/Tizen.Applications.Service/Interop/Interop.Libraries.cs deleted file mode 100755 index 145ff340b..000000000 --- a/src/Tizen.Applications.Service/Interop/Interop.Libraries.cs +++ /dev/null @@ -1,23 +0,0 @@ -/* - * 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 AppcoreAgent = "libappcore-agent.so.1"; - } -} diff --git a/src/Tizen.Applications.Service/Interop/Interop.Service.cs b/src/Tizen.Applications.Service/Interop/Interop.Service.cs deleted file mode 100755 index d4cd60dda..000000000 --- a/src/Tizen.Applications.Service/Interop/Interop.Service.cs +++ /dev/null @@ -1,54 +0,0 @@ -/* - * 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; -using Tizen.Applications.CoreBackend; -using Tizen.Internals.Errors; - -internal static partial class Interop -{ - internal static partial class Service - { - internal delegate void AppEventCallback(IntPtr handle, IntPtr data); - - internal delegate bool ServiceAppCreateCallback(IntPtr userData); - - internal delegate void ServiceAppTerminateCallback(IntPtr userData); - - internal delegate void ServiceAppControlCallback(IntPtr appControl, IntPtr userData); - - [DllImport(Libraries.AppcoreAgent, EntryPoint = "service_app_main")] - internal static extern ErrorCode Main(int argc, string[] argv, ref ServiceAppLifecycleCallbacks callback, IntPtr userData); - - [DllImport(Libraries.AppcoreAgent, EntryPoint = "service_app_exit")] - internal static extern void Exit(); - - [DllImport(Libraries.AppcoreAgent, EntryPoint = "service_app_add_event_handler")] - internal static extern ErrorCode AddEventHandler(out IntPtr handle, DefaultCoreBackend.AppEventType eventType, AppEventCallback callback, IntPtr data); - - [DllImport(Libraries.AppcoreAgent, EntryPoint = "service_app_remove_event_handler")] - internal static extern ErrorCode RemoveEventHandler(IntPtr handle); - - [StructLayoutAttribute(LayoutKind.Sequential)] - internal struct ServiceAppLifecycleCallbacks - { - public ServiceAppCreateCallback OnCreate; - public ServiceAppTerminateCallback OnTerminate; - public ServiceAppControlCallback OnAppControl; - } - } -} diff --git a/src/Tizen.Applications.Service/Tizen.Applications.CoreBackend/ServiceCoreBackend.cs b/src/Tizen.Applications.Service/Tizen.Applications.CoreBackend/ServiceCoreBackend.cs deleted file mode 100755 index bc1a0968f..000000000 --- a/src/Tizen.Applications.Service/Tizen.Applications.CoreBackend/ServiceCoreBackend.cs +++ /dev/null @@ -1,190 +0,0 @@ -/* - * 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.Applications.CoreBackend -{ - internal class ServiceCoreBackend : DefaultCoreBackend - { - private Interop.Service.ServiceAppLifecycleCallbacks _callbacks; - private IntPtr _lowMemoryEventHandle = IntPtr.Zero; - private IntPtr _lowBatteryEventHandle = IntPtr.Zero; - private IntPtr _localeChangedEventHandle = IntPtr.Zero; - private IntPtr _regionChangedEventHandle = IntPtr.Zero; - private IntPtr _deviceOrientationChangedEventHandle = IntPtr.Zero; - private bool _disposedValue = false; - private Interop.Service.AppEventCallback _onLowMemoryNative; - private Interop.Service.AppEventCallback _onLowBatteryNative; - private Interop.Service.AppEventCallback _onLocaleChangedNative; - private Interop.Service.AppEventCallback _onRegionChangedNative; - private Interop.Service.AppEventCallback _onDeviceOrientationChangedNative; - - public ServiceCoreBackend() - { - _callbacks.OnCreate = new Interop.Service.ServiceAppCreateCallback(OnCreateNative); - _callbacks.OnTerminate = new Interop.Service.ServiceAppTerminateCallback(OnTerminateNative); - _callbacks.OnAppControl = new Interop.Service.ServiceAppControlCallback(OnAppControlNative); - - _onLowMemoryNative = new Interop.Service.AppEventCallback(OnLowMemoryNative); - _onLowBatteryNative = new Interop.Service.AppEventCallback(OnLowBatteryNative); - _onLocaleChangedNative = new Interop.Service.AppEventCallback(OnLocaleChangedNative); - _onRegionChangedNative = new Interop.Service.AppEventCallback(OnRegionChangedNative); - _onDeviceOrientationChangedNative = new Interop.Service.AppEventCallback(OnDeviceOrientationChangedNative); - } - - public override void Exit() - { - Interop.Service.Exit(); - } - - public override void Run(string[] args) - { - base.Run(args); - - ErrorCode err = ErrorCode.None; - err = Interop.Service.AddEventHandler(out _lowMemoryEventHandle, AppEventType.LowMemory, _onLowMemoryNative, IntPtr.Zero); - if (err != ErrorCode.None) - { - Log.Error(LogTag, "Failed to add event handler for LowMemory event. Err = " + err); - } - err = Interop.Service.AddEventHandler(out _lowBatteryEventHandle, AppEventType.LowBattery, _onLowBatteryNative, IntPtr.Zero); - if (err != ErrorCode.None) - { - Log.Error(LogTag, "Failed to add event handler for LowBattery event. Err = " + err); - } - - err = Interop.Service.AddEventHandler(out _localeChangedEventHandle, AppEventType.LanguageChanged, _onLocaleChangedNative, IntPtr.Zero); - if (err != ErrorCode.None) - { - Log.Error(LogTag, "Failed to add event handler for LocaleChanged event. Err = " + err); - } - - err = Interop.Service.AddEventHandler(out _regionChangedEventHandle, AppEventType.RegionFormatChanged, _onRegionChangedNative, IntPtr.Zero); - if (err != ErrorCode.None) - { - Log.Error(LogTag, "Failed to add event handler for RegionFormatChanged event. Err = " + err); - } - - err = Interop.Service.AddEventHandler(out _deviceOrientationChangedEventHandle, AppEventType.DeviceOrientationChanged, _onDeviceOrientationChangedNative, IntPtr.Zero); - if (err != ErrorCode.None) - { - Log.Error(LogTag, "Failed to add event handler for DeviceOrientationChanged event. Err = " + err); - } - - err = Interop.Service.Main(args.Length, args, ref _callbacks, IntPtr.Zero); - if (err != ErrorCode.None) - { - Log.Error(LogTag, "Failed to run the application. Err = " + err); - } - } - - protected override void Dispose(bool disposing) - { - if (!_disposedValue) - { - if (disposing) - { - // Release disposable objects - } - - if (_lowMemoryEventHandle != IntPtr.Zero) - { - Interop.Service.RemoveEventHandler(_lowMemoryEventHandle); - } - if (_lowBatteryEventHandle != IntPtr.Zero) - { - Interop.Service.RemoveEventHandler(_lowBatteryEventHandle); - } - if (_localeChangedEventHandle != IntPtr.Zero) - { - Interop.Service.RemoveEventHandler(_localeChangedEventHandle); - } - if (_regionChangedEventHandle != IntPtr.Zero) - { - Interop.Service.RemoveEventHandler(_regionChangedEventHandle); - } - - if (_deviceOrientationChangedEventHandle != IntPtr.Zero) - { - Interop.Service.RemoveEventHandler(_deviceOrientationChangedEventHandle); - } - - _disposedValue = true; - } - } - - private bool OnCreateNative(IntPtr data) - { - if (Handlers.ContainsKey(EventType.Created)) - { - var handler = Handlers[EventType.Created] as Action; - handler?.Invoke(); - } - return true; - } - - private void OnTerminateNative(IntPtr data) - { - if (Handlers.ContainsKey(EventType.Terminated)) - { - var handler = Handlers[EventType.Terminated] as Action; - handler?.Invoke(); - } - } - - private void OnAppControlNative(IntPtr appControlHandle, IntPtr data) - { - if (Handlers.ContainsKey(EventType.AppControlReceived)) - { - // Create a SafeAppControlHandle but the ownsHandle is false, - // because the appControlHandle will be closed by native appfw after this method automatically. - SafeAppControlHandle safeHandle = new SafeAppControlHandle(appControlHandle, false); - - var handler = Handlers[EventType.AppControlReceived] as Action; - handler?.Invoke(new AppControlReceivedEventArgs(new ReceivedAppControl(safeHandle))); - } - } - - protected override void OnLowMemoryNative(IntPtr infoHandle, IntPtr data) - { - base.OnLowMemoryNative(infoHandle, data); - } - - protected override void OnLowBatteryNative(IntPtr infoHandle, IntPtr data) - { - base.OnLowBatteryNative(infoHandle, data); - } - - protected override void OnLocaleChangedNative(IntPtr infoHandle, IntPtr data) - { - base.OnLocaleChangedNative(infoHandle, data); - } - - protected override void OnRegionChangedNative(IntPtr infoHandle, IntPtr data) - { - base.OnRegionChangedNative(infoHandle, data); - } - - protected override void OnDeviceOrientationChangedNative(IntPtr infoHandle, IntPtr data) - { - base.OnDeviceOrientationChangedNative(infoHandle, data); - } - - } -} diff --git a/src/Tizen.Applications.Service/Tizen.Applications.Service.csproj b/src/Tizen.Applications.Service/Tizen.Applications.Service.csproj deleted file mode 100755 index 020b2cb3d..000000000 --- a/src/Tizen.Applications.Service/Tizen.Applications.Service.csproj +++ /dev/null @@ -1,11 +0,0 @@ - - - - netstandard2.0 - - - - - - - diff --git a/src/Tizen.Applications.Service/Tizen.Applications.Service.sln b/src/Tizen.Applications.Service/Tizen.Applications.Service.sln deleted file mode 100755 index 7e6b89fa0..000000000 --- a/src/Tizen.Applications.Service/Tizen.Applications.Service.sln +++ /dev/null @@ -1,40 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26430.12 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Applications.Service", "Tizen.Applications.Service.csproj", "{BDA074BC-34BC-4CE4-B81B-4E06B29CA1FE}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen", "..\Tizen\Tizen.csproj", "{4201665E-B641-4BDD-B5D1-5354AEDBE902}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Log", "..\Tizen.Log\Tizen.Log.csproj", "{E0E7023E-23E0-4B1B-A9D4-92A551771C55}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Applications.Common", "..\Tizen.Applications.Common\Tizen.Applications.Common.csproj", "{C4B7B05A-8B70-40C9-B19C-CF11131520D6}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {BDA074BC-34BC-4CE4-B81B-4E06B29CA1FE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {BDA074BC-34BC-4CE4-B81B-4E06B29CA1FE}.Debug|Any CPU.Build.0 = Debug|Any CPU - {BDA074BC-34BC-4CE4-B81B-4E06B29CA1FE}.Release|Any CPU.ActiveCfg = Release|Any CPU - {BDA074BC-34BC-4CE4-B81B-4E06B29CA1FE}.Release|Any CPU.Build.0 = Release|Any CPU - {4201665E-B641-4BDD-B5D1-5354AEDBE902}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {4201665E-B641-4BDD-B5D1-5354AEDBE902}.Debug|Any CPU.Build.0 = Debug|Any CPU - {4201665E-B641-4BDD-B5D1-5354AEDBE902}.Release|Any CPU.ActiveCfg = Release|Any CPU - {4201665E-B641-4BDD-B5D1-5354AEDBE902}.Release|Any CPU.Build.0 = Release|Any CPU - {E0E7023E-23E0-4B1B-A9D4-92A551771C55}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E0E7023E-23E0-4B1B-A9D4-92A551771C55}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E0E7023E-23E0-4B1B-A9D4-92A551771C55}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E0E7023E-23E0-4B1B-A9D4-92A551771C55}.Release|Any CPU.Build.0 = Release|Any CPU - {C4B7B05A-8B70-40C9-B19C-CF11131520D6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C4B7B05A-8B70-40C9-B19C-CF11131520D6}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C4B7B05A-8B70-40C9-B19C-CF11131520D6}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C4B7B05A-8B70-40C9-B19C-CF11131520D6}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/src/Tizen.Applications.Service/Tizen.Applications/ServiceApplication.cs b/src/Tizen.Applications.Service/Tizen.Applications/ServiceApplication.cs deleted file mode 100755 index e039c7022..000000000 --- a/src/Tizen.Applications.Service/Tizen.Applications/ServiceApplication.cs +++ /dev/null @@ -1,42 +0,0 @@ -/* - * 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 Tizen.Applications.CoreBackend; - -namespace Tizen.Applications -{ - /// - /// Represents the service applications. - /// - public class ServiceApplication : CoreApplication - { - /// - /// Initializes the ServiceApplication class. - /// - public ServiceApplication() : base(new ServiceCoreBackend()) - { - } - - /// - /// Runs the service application's main loop. - /// - /// Arguments from commandline. - public override void Run(string[] args) - { - base.Run(args); - } - } -} diff --git a/src/Tizen.Applications.Shortcut/Tizen.Applications.Shortcut.csproj b/src/Tizen.Applications.Shortcut/Tizen.Applications.Shortcut.csproj deleted file mode 100644 index 14075017f..000000000 --- a/src/Tizen.Applications.Shortcut/Tizen.Applications.Shortcut.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - netstandard2.0 - - - - - - - - diff --git a/src/Tizen.Applications.Shortcut/Tizen.Applications.Shortcut.sln b/src/Tizen.Applications.Shortcut/Tizen.Applications.Shortcut.sln deleted file mode 100755 index 6899c5ead..000000000 --- a/src/Tizen.Applications.Shortcut/Tizen.Applications.Shortcut.sln +++ /dev/null @@ -1,21 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26430.6 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Applications.Shortcut", "Tizen.Applications.Shortcut.csproj", "{002C0868-E774-4ACA-B033-83B91C3B2C57}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {002C0868-E774-4ACA-B033-83B91C3B2C57}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {002C0868-E774-4ACA-B033-83B91C3B2C57}.Debug|Any CPU.Build.0 = Debug|Any CPU - {002C0868-E774-4ACA-B033-83B91C3B2C57}.Release|Any CPU.ActiveCfg = Release|Any CPU - {002C0868-E774-4ACA-B033-83B91C3B2C57}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/src/Tizen.Applications.Shortcut/Tizen.Applications.Shortcut/HomeShortcutInfo.cs b/src/Tizen.Applications.Shortcut/Tizen.Applications.Shortcut/HomeShortcutInfo.cs deleted file mode 100755 index 2cbc7c2ef..000000000 --- a/src/Tizen.Applications.Shortcut/Tizen.Applications.Shortcut/HomeShortcutInfo.cs +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (c) 2017 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. - */ - -namespace Tizen.Applications.Shortcut -{ - /// - /// A class that contains shortcut information. - /// - public class HomeShortcutInfo : ShortcutInfo - { - /// - /// Gets or sets the specific information for delivering to the viewer for creating a shortcut. - /// - public string Uri { get; set; } = string.Empty; - } -} \ No newline at end of file diff --git a/src/Tizen.Applications.Shortcut/Tizen.Applications.Shortcut/ShortcutEnumerations.cs b/src/Tizen.Applications.Shortcut/Tizen.Applications.Shortcut/ShortcutEnumerations.cs deleted file mode 100755 index c9c52cb2d..000000000 --- a/src/Tizen.Applications.Shortcut/Tizen.Applications.Shortcut/ShortcutEnumerations.cs +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Copyright (c) 2017 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. - */ - -namespace Tizen.Applications.Shortcut -{ - /// - /// Enumeration for sizes of shortcut widget. - /// - public enum ShortcutWidgetSize - { - /// - /// Type mask for the normal mode widget , don't use this value for specific size. - /// - WidgetDefault = 0x10000000, - - /// - /// 1by1 - /// - Widget1by1 = 0x10010000, - - /// - /// 2by1 - /// - Widget2by1 = 0x10020000, - - /// - /// 2by2 - /// - Widget2by2 = 0x10040000, - - /// - /// 4by1 - /// - Widget4by1 = 0x10080000, - - /// - /// 4by2 - /// - Widget4by2 = 0x10100000, - - /// - /// 4by3 - /// - Widget4by3 = 0x10200000, - - /// - /// 4by4 - /// - Widget4by4 = 0x10400000, - - /// - /// 4by5 - /// - Widget4by5 = 0x11000000, - - /// - /// 4by6 - /// - Widget4by6 = 0x12000000, - - /// - /// Type mask for the easy mode widget, don't use this value for specific size. - /// - EasyDefault = 0x30000000, - - /// - /// Easy mode 1by1 - /// - Easy1by1 = 0x30010000, - - /// - /// Easy mode 3by2 - /// - Easy3by1 = 0x30020000, - - /// - /// Easy mode 3by3 - /// - Easy3by3 = 0x30040000, - } - - /// - /// Enumeration for shortcut types. - /// - internal enum ShortcutType - { - /// - /// Launch the application itself. - /// - LaunchByApp = 0x00000000, - - /// - /// Launch the application with the given data(URI). - /// - LaunchByUri = 0x00000001, - } -} \ No newline at end of file diff --git a/src/Tizen.Applications.Shortcut/Tizen.Applications.Shortcut/ShortcutErrorFactory.cs b/src/Tizen.Applications.Shortcut/Tizen.Applications.Shortcut/ShortcutErrorFactory.cs deleted file mode 100755 index 26c0656a7..000000000 --- a/src/Tizen.Applications.Shortcut/Tizen.Applications.Shortcut/ShortcutErrorFactory.cs +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2017 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. - */ - -namespace Tizen.Applications.Shortcut -{ - using System; - - internal static class ShortcutErrorFactory - { - private const string LogTag = "Tizen.Applications.Shortcut"; - - internal static Exception GetException(Interop.Shortcut.ErrorCode err, string msg) - { - switch (err) - { - case Interop.Shortcut.ErrorCode.InvalidParameter: - return new ArgumentException(err + " error occurred."); - case Interop.Shortcut.ErrorCode.PermissionDenied: - return new UnauthorizedAccessException(err + " Permission denied (http://tizen.org/privilege/shortcut)"); - case Interop.Shortcut.ErrorCode.NotSupported: - return new NotSupportedException(err + " Not Supported (http://tizen.org/feature/shortcut)"); - case Interop.Shortcut.ErrorCode.OutOfMemory: - return new OutOfMemoryException(err + " error occurred."); - default: - Log.Error(LogTag, msg); - return new InvalidOperationException(err + " error occurred."); - } - } - } -} diff --git a/src/Tizen.Applications.Shortcut/Tizen.Applications.Shortcut/ShortcutInfo.cs b/src/Tizen.Applications.Shortcut/Tizen.Applications.Shortcut/ShortcutInfo.cs deleted file mode 100755 index 63fb8a6e6..000000000 --- a/src/Tizen.Applications.Shortcut/Tizen.Applications.Shortcut/ShortcutInfo.cs +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) 2017 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. - */ - -namespace Tizen.Applications.Shortcut -{ - /// - /// A class to get information of the Shortcut. - /// - public class ShortcutInfo - { - /// - /// Gets or sets the name of the created shortcut icon. - /// - public string ShortcutName { get; set; } = string.Empty; - - /// - /// Gets or sets the absolute path of an icon file for this shortcut. - /// - public string IconPath { get; set; } = string.Empty; - - /// - /// Gets or sets a value indicating whether to allow or not to allow duplication. - /// - public bool IsAllowDuplicate { get; set; } - } -} \ No newline at end of file diff --git a/src/Tizen.Applications.Shortcut/Tizen.Applications.Shortcut/ShortcutManager.cs b/src/Tizen.Applications.Shortcut/Tizen.Applications.Shortcut/ShortcutManager.cs deleted file mode 100755 index f27507d39..000000000 --- a/src/Tizen.Applications.Shortcut/Tizen.Applications.Shortcut/ShortcutManager.cs +++ /dev/null @@ -1,219 +0,0 @@ -/* - * Copyright (c) 2017 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. - */ - -namespace Tizen.Applications.Shortcut -{ - using System; - - /// - /// This class provides the some functions to add, delete shortcut. - /// - public static class ShortcutManager - { - private const string LogTag = "Tizen.Applications.Shortcut"; - - private static Interop.Shortcut.ResultCallback shortcutAddResult = null; - - private static Interop.Shortcut.ResultCallback widgetAddResult = null; - - private static Interop.Shortcut.ResultCallback shortcutDeleteResult = null; - - /// - /// Adds a shortcut on home-screen. - /// - /// 3 - /// Object that contain shortcut info. - /// http://tizen.org/feature/shortcut - /// http://tizen.org/privilege/shortcut - /// Thrown when argument is invalid. - /// Thrown in case of permission denied. - /// Thrown when Shortcut is not supported. - /// Thrown in case of out of memory. - /// Thrown in case of any internal error. - public static void Add(HomeShortcutInfo shortcut) - { - Interop.Shortcut.ErrorCode err = Interop.Shortcut.ErrorCode.None; - - try - { - int type; - - if (shortcut.Uri == null || shortcut.Uri == String.Empty) - { - type = 0; - } - else - { - type = 1; - } - - if (shortcutAddResult == null) - { - shortcutAddResult = new Interop.Shortcut.ResultCallback(ShortcutAddResultCallback); - } - - err = Interop.Shortcut.AddToHome(shortcut.ShortcutName, type, shortcut.Uri, shortcut.IconPath, Convert.ToInt32(shortcut.IsAllowDuplicate), shortcutAddResult, IntPtr.Zero); - if (err != Interop.Shortcut.ErrorCode.None) - { - throw ShortcutErrorFactory.GetException(err, "unable to add shortcut"); - } - } - catch (Exception e) - { - throw ShortcutErrorFactory.GetException(Interop.Shortcut.ErrorCode.IoError, e.Message); - } - } - - /// - /// Adds a shortcut on home-screen. - /// - /// 3 - /// Object that contain shortcut info. - /// http://tizen.org/feature/shortcut - /// http://tizen.org/privilege/shortcut - /// Thrown when argument is invalid. - /// Thrown in case of permission denied. - /// Thrown when Shortcut is not supported. - /// Thrown in case of out of memory. - /// Thrown in case of any internal error. - public static void Add(WidgetShortcutInfo shortcut) - { - Interop.Shortcut.ErrorCode err = Interop.Shortcut.ErrorCode.None; - - if (shortcut.Period < 0.0) - { - throw ShortcutErrorFactory.GetException(Interop.Shortcut.ErrorCode.InvalidParameter, "Invalid parameter"); - } - - try - { - if (widgetAddResult == null) - { - widgetAddResult = new Interop.Shortcut.ResultCallback(WidgetAddResultCallback); - } - - err = Interop.Shortcut.AddToWidget(shortcut.ShortcutName, shortcut.WidgetSize, shortcut.WidgetId, shortcut.IconPath, shortcut.Period, Convert.ToInt32(shortcut.IsAllowDuplicate), null, IntPtr.Zero); - if (err != Interop.Shortcut.ErrorCode.None) - { - throw ShortcutErrorFactory.GetException(err, "unable to add shortcut"); - } - } - catch (Exception e) - { - throw ShortcutErrorFactory.GetException(Interop.Shortcut.ErrorCode.IoError, e.Message); - } - } - - /// - /// Removes a shortcut from home by ShortcutName. - /// - /// 3 - /// Shortcut name string. - /// http://tizen.org/feature/shortcut - /// http://tizen.org/privilege/shortcut - /// Thrown when argument is invalid. - /// Thrown in case of permission denied. - /// Thrown when Shortcut is not supported. - /// Thrown in case of out of memory. - /// Thrown in case of any internal error. - public static void Delete(string shortcutName) - { - Interop.Shortcut.ErrorCode err = Interop.Shortcut.ErrorCode.None; - - if (shortcutName == null) - { - throw ShortcutErrorFactory.GetException(Interop.Shortcut.ErrorCode.InvalidParameter, "Invalid parameter"); - } - - try - { - if (shortcutDeleteResult == null) - { - shortcutDeleteResult = new Interop.Shortcut.ResultCallback(DeleteResultCallback); - } - - err = Interop.Shortcut.Delete(shortcutName, shortcutDeleteResult, IntPtr.Zero); - if (err != Interop.Shortcut.ErrorCode.None) - { - throw ShortcutErrorFactory.GetException(err, "unable to delete shortcut"); - } - } - catch (Exception e) - { - throw ShortcutErrorFactory.GetException(Interop.Shortcut.ErrorCode.IoError, e.Message); - } - } - - /// - /// Removes a shortcut from home by ShortcutInfo. - /// - /// 3 - /// Object that contain shortcut info. - /// http://tizen.org/feature/shortcut - /// http://tizen.org/privilege/shortcut - /// Thrown when argument is invalid. - /// Thrown in case of permission denied. - /// Thrown when Shortcut is not supported. - /// Thrown in case of out of memory. - /// Thrown in case of any internal error. - public static void Delete(ShortcutInfo shortcut) - { - if (shortcut == null) - { - throw ShortcutErrorFactory.GetException(Interop.Shortcut.ErrorCode.InvalidParameter, "Invalid parameter"); - } - - try - { - Delete(shortcut.ShortcutName); - } - catch (Exception e) - { - throw ShortcutErrorFactory.GetException(Interop.Shortcut.ErrorCode.IoError, e.Message); - } - } - - private static int ShortcutAddResultCallback(int ret, IntPtr data) - { - if (ret != (int)Interop.Shortcut.ErrorCode.None) - { - throw ShortcutErrorFactory.GetException((Interop.Shortcut.ErrorCode)ret, "unable to add shortcut"); - } - - return 0; - } - - private static int WidgetAddResultCallback(int ret, IntPtr data) - { - if (ret != (int)Interop.Shortcut.ErrorCode.None) - { - throw ShortcutErrorFactory.GetException((Interop.Shortcut.ErrorCode)ret, "unable to add widget"); - } - - return 0; - } - - private static int DeleteResultCallback(int ret, IntPtr data) - { - if (ret != (int)Interop.Shortcut.ErrorCode.None) - { - throw ShortcutErrorFactory.GetException((Interop.Shortcut.ErrorCode)ret, "unable to delete shortcut"); - } - - return 0; - } - } -} diff --git a/src/Tizen.Applications.Shortcut/Tizen.Applications.Shortcut/WidgetShortcutInfo.cs b/src/Tizen.Applications.Shortcut/Tizen.Applications.Shortcut/WidgetShortcutInfo.cs deleted file mode 100755 index 4676c7cbc..000000000 --- a/src/Tizen.Applications.Shortcut/Tizen.Applications.Shortcut/WidgetShortcutInfo.cs +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) 2017 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. - */ - -namespace Tizen.Applications.Shortcut -{ - /// - /// A class that contains information about the widget. - /// - public class WidgetShortcutInfo : ShortcutInfo - { - /// - /// Gets or sets the Widget ID. - /// - public string WidgetId { get; set; } = string.Empty; - - /// - /// Gets or sets the size of widget. - /// - public ShortcutWidgetSize WidgetSize { get; set; } - - /// - /// Gets or sets the Update period in seconds. - /// - public double Period { get; set; } - } -} \ No newline at end of file diff --git a/src/Tizen.Applications.Shortcut/Tizen.Applications.ShortcutEvent/HomeShortcutAddedInfo.cs b/src/Tizen.Applications.Shortcut/Tizen.Applications.ShortcutEvent/HomeShortcutAddedInfo.cs deleted file mode 100755 index 91038a1ab..000000000 --- a/src/Tizen.Applications.Shortcut/Tizen.Applications.ShortcutEvent/HomeShortcutAddedInfo.cs +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2017 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. - */ - -namespace Tizen.Applications.Shortcut -{ - /// - /// A class that contains shortcut information. - /// - public class HomeShortcutAddedInfo : ShortcutAddedInfo - { - /// - /// Gets the name of application. - /// - public string AppId { get; internal set; } - - /// - /// Gets the specific information for creating a new shortcut. - /// - public string Uri { get; internal set; } - } -} \ No newline at end of file diff --git a/src/Tizen.Applications.Shortcut/Tizen.Applications.ShortcutEvent/ShortcutAddedInfo.cs b/src/Tizen.Applications.Shortcut/Tizen.Applications.ShortcutEvent/ShortcutAddedInfo.cs deleted file mode 100755 index 889e3cb09..000000000 --- a/src/Tizen.Applications.Shortcut/Tizen.Applications.ShortcutEvent/ShortcutAddedInfo.cs +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) 2017 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. - */ - -namespace Tizen.Applications.Shortcut -{ - /// - /// A class for getting information of the Shortcut. - /// - public class ShortcutAddedInfo - { - /// - /// Gets the name of the created shortcut icon. - /// - public string ShortcutName { get; internal set; } - - /// - /// Gets the absolute path of an icon file for this shortcut. - /// - public string IconPath { get; internal set; } - - /// - /// Gets a value indicating whether to allow or not to allow duplication. - /// - public bool IsAllowDuplicate { get; internal set; } - } -} \ No newline at end of file diff --git a/src/Tizen.Applications.Shortcut/Tizen.Applications.ShortcutEvent/ShortcutDeletedInfo.cs b/src/Tizen.Applications.Shortcut/Tizen.Applications.ShortcutEvent/ShortcutDeletedInfo.cs deleted file mode 100755 index 73786f9eb..000000000 --- a/src/Tizen.Applications.Shortcut/Tizen.Applications.ShortcutEvent/ShortcutDeletedInfo.cs +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2017 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. - */ - -namespace Tizen.Applications.Shortcut -{ - /// - /// A class for getting information of the Shortcut. - /// - public class ShortcutDeletedInfo - { - /// - /// Gets the name of package. - /// - public string AppId { get; internal set; } - - /// - /// Gets the name of the created shortcut icon. - /// - public string ShortcutName { get; internal set; } - } -} \ No newline at end of file diff --git a/src/Tizen.Applications.Shortcut/Tizen.Applications.ShortcutEvent/ShortcutEventEnumerations.cs b/src/Tizen.Applications.Shortcut/Tizen.Applications.ShortcutEvent/ShortcutEventEnumerations.cs deleted file mode 100755 index 9dc4e40db..000000000 --- a/src/Tizen.Applications.Shortcut/Tizen.Applications.ShortcutEvent/ShortcutEventEnumerations.cs +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2017 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. - */ - -namespace Tizen.Applications.Shortcut -{ - /// - /// Enumeration for values of shortcut response types. - /// - public enum ShortcutError - { - /// - /// Successful. - /// - None = Tizen.Internals.Errors.ErrorCode.None, - - /// - /// Invalid function parameter. - /// - InvalidParameter = Tizen.Internals.Errors.ErrorCode.InvalidParameter, - - /// - /// Out of memory. - /// - OutOfMemory = Tizen.Internals.Errors.ErrorCode.OutOfMemory, - - /// - /// I/O Error. - /// - IoError = Tizen.Internals.Errors.ErrorCode.IoError, - - /// - /// There is no space to add a new shortcut. - /// - NoSpace = -0x01160000 | 0x01, - - /// - /// Shortcut is already added. - /// - Exist = -0x01160000 | 0x02, - - /// - /// Not exist shortcut. - /// - NotExist = -0x01160000 | 0x08, - } -} diff --git a/src/Tizen.Applications.Shortcut/Tizen.Applications.ShortcutEvent/ShortcutEventManager.cs b/src/Tizen.Applications.Shortcut/Tizen.Applications.ShortcutEvent/ShortcutEventManager.cs deleted file mode 100755 index fba8ab15a..000000000 --- a/src/Tizen.Applications.Shortcut/Tizen.Applications.ShortcutEvent/ShortcutEventManager.cs +++ /dev/null @@ -1,305 +0,0 @@ -/* - * Copyright (c) 2017 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. - */ - -namespace Tizen.Applications.Shortcut -{ - using System; - using System.Collections.Generic; - using Tizen.Internals.Errors; - - /// - /// The callback function that is invoked when add request occurred - /// - /// Object that contain shortcut info to add. - /// The result of handling a shortcut add request - public delegate ShortcutError ShortcutAdded(ShortcutAddedInfo args); - - /// - /// The callback function that is invoked when delete request occurred - /// - /// Object that contain shortcut info to delete. - /// The result of handling a shortcut delete request - public delegate ShortcutError ShortcutDeleted(ShortcutDeletedInfo args); - - /// - /// This class provides a way to register callback function for shortcut add, delete events. - /// - public static class ShortcutEventManager - { - private static Interop.Shortcut.AddCallback shortcutAddCallback; - - private static Interop.Shortcut.DeleteCallback shortcutDeleteCallback; - - private static IList shortcutTemplates = new List(); - - private static ShortcutAdded shortcutAdded = null; - - private static ShortcutDeleted shortcutDeleted = null; - - /// - /// Registers a callback function to listen requests from applications. - /// - /// 3 - /// The callback function pointer that is invoked when Add() is requested - /// http://tizen.org/feature/shortcut - /// http://tizen.org/privilege/shortcut - /// - /// Previous registered delegate function should be unregister. - /// - /// Thrown when argument is invalid. - /// Thrown in case of permission denied. - /// Thrown when Shortcut is not supported. - /// Thrown in case of out of memory. - /// Thrown in case of any internal error. - public static void RegisterEventHandler(ShortcutAdded addedEvent) - { - shortcutAdded = addedEvent; - - if (shortcutAddCallback == null) - { - shortcutAddCallback = new Interop.Shortcut.AddCallback(AddCallback); - - Interop.Shortcut.ErrorCode err = Interop.Shortcut.SetShortcutAddCallback(shortcutAddCallback, IntPtr.Zero); - if (err != Interop.Shortcut.ErrorCode.None) - { - throw ShortcutErrorFactory.GetException(err, "unable to register callback"); - } - } - } - - /// - /// Registers a callback function to listen requests from applications. - /// - /// 3 - /// The callback function pointer that is invoked when Delete() is requested - /// http://tizen.org/feature/shortcut - /// http://tizen.org/privilege/shortcut - /// - /// Previous registered delegate function should be unregister. - /// - /// Thrown when argument is invalid. - /// Thrown in case of permission denied. - /// Thrown when Shortcut is not supported. - /// Thrown in case of out of memory. - /// Thrown in case of any internal error. - public static void RegisterEventHandler(ShortcutDeleted deletedEvent) - { - shortcutDeleted = deletedEvent; - - if (shortcutDeleteCallback == null) - { - shortcutDeleteCallback = new Interop.Shortcut.DeleteCallback(DeleteCallback); - - Interop.Shortcut.ErrorCode err = Interop.Shortcut.SetShortcutDeleteCallback(shortcutDeleteCallback, IntPtr.Zero); - if (err != Interop.Shortcut.ErrorCode.None) - { - throw ShortcutErrorFactory.GetException(err, "unable to register callback"); - } - } - } - - /// - /// Unregisters a callback for the shortcut request. - /// - /// 3 - /// The callback function pointer that used for RegisterCallback - /// http://tizen.org/feature/shortcut - /// http://tizen.org/privilege/shortcut - /// Thrown when argument is invalid. - /// Thrown in case of permission denied. - /// Thrown when Shortcut is not supported. - public static void UnregisterEventHandler(ShortcutAdded addedEvent) - { - if (shortcutAdded.Equals(addedEvent)) - { - shortcutAdded = null; - - if (shortcutAddCallback != null) - { - Interop.Shortcut.UnsetShortcutAddCallback(); - shortcutAddCallback = null; - - int err = ErrorFacts.GetLastResult(); - if (err != (int)Interop.Shortcut.ErrorCode.None) - { - throw ShortcutErrorFactory.GetException((Interop.Shortcut.ErrorCode)err, "unable to unregister callback"); - } - } - } - else - { - throw ShortcutErrorFactory.GetException(Interop.Shortcut.ErrorCode.InvalidParameter, null); - } - } - - /// - /// Unregisters a callback for the shortcut request. - /// - /// 3 - /// The callback function pointer that used for RegisterCallback - /// http://tizen.org/feature/shortcut - /// http://tizen.org/privilege/shortcut - /// Thrown when argument is invalid. - /// Thrown in case of permission denied. - /// Thrown when Shortcut is not supported. - public static void UnregisterEventHandler(ShortcutDeleted deletedEvent) - { - if (shortcutDeleted.Equals(deletedEvent)) - { - shortcutDeleted = null; - - if (shortcutDeleteCallback != null) - { - - Interop.Shortcut.UnsetShortcutDeleteCallback(); - shortcutDeleteCallback = null; - - int err = ErrorFacts.GetLastResult(); - if (err != (int)Interop.Shortcut.ErrorCode.None) - { - throw ShortcutErrorFactory.GetException((Interop.Shortcut.ErrorCode) err, "unable to unregister callback"); - } - } - } - else - { - throw ShortcutErrorFactory.GetException(Interop.Shortcut.ErrorCode.InvalidParameter, null); - } - } - - /// - /// Gets the preset list of shortcut template from the installed package. - /// - /// 3 - /// Application ID. - /// The List of ShortcutTemplate. - /// http://tizen.org/feature/shortcut - /// http://tizen.org/privilege/shortcut - /// Thrown when argument is invalid. - /// Thrown in case of permission denied. - /// Thrown when Shortcut is not supported. - /// Thrown in case of out of memory. - /// Thrown in case of any internal error. - public static IEnumerable GetTemplateList(string appId) - { - shortcutTemplates.Clear(); - - if (string.IsNullOrEmpty(appId)) - { - throw ShortcutErrorFactory.GetException(Interop.Shortcut.ErrorCode.InvalidParameter, null); - } - - Interop.Shortcut.ListCallback callback = (appName, iconPath, shortcutName, extrakey, extraData, user_data) => - { - ShortcutTemplate template = new ShortcutTemplate - { - AppId = appName, - ShortcutName = shortcutName, - IconPath = iconPath, - ExtraKey = extrakey, - ExtraData = extraData, - }; - - shortcutTemplates.Add(template); - - return 0; - }; - - Interop.Shortcut.ErrorCode err = Interop.Shortcut.GetList(appId, callback, IntPtr.Zero); - if (err < Interop.Shortcut.ErrorCode.None) - { - throw ShortcutErrorFactory.GetException(err, "unable to get ShortcutTemplate Lists"); - } - - return shortcutTemplates; - } - - private static int AddCallback(string appId, string shortcutName, int type, string contentInfo, string iconPath, int processId, double period, bool isAllowDuplicate, IntPtr data) - { - ShortcutError err; - - if (type == (int)ShortcutType.LaunchByApp || type == (int)ShortcutType.LaunchByUri) - { - HomeShortcutAddedInfo shortcutInfo = new HomeShortcutAddedInfo - { - ShortcutName = shortcutName, - IconPath = iconPath, - IsAllowDuplicate = isAllowDuplicate, - AppId = appId, - }; - - if (contentInfo != null && contentInfo != String.Empty) - { - shortcutInfo.Uri = contentInfo; - } - - if (shortcutAdded != null) - { - err = shortcutAdded(shortcutInfo); - } - else - { - err = ShortcutError.IoError; - } - } - else - { - WidgetShortcutAddedInfo shortcutInfo = new WidgetShortcutAddedInfo - { - ShortcutName = shortcutName, - IconPath = iconPath, - IsAllowDuplicate = isAllowDuplicate, - WidgetId = appId, - WidgetSize = (ShortcutWidgetSize)type, - Period = period, - }; - - if (shortcutAdded != null) - { - err = shortcutAdded(shortcutInfo); - } - else - { - err = ShortcutError.IoError; - } - } - - return (int)err; - } - - private static int DeleteCallback(string appId, string shortcutName, int processId, IntPtr data) - { - ShortcutError err = ShortcutError.None; - - ShortcutDeletedInfo deletedInfo = new ShortcutDeletedInfo - { - AppId = appId, - ShortcutName = shortcutName, - }; - - if (shortcutDeleted != null) - { - err = shortcutDeleted(deletedInfo); - } - else - { - err = ShortcutError.IoError; - } - - return (int)err; - } - } -} diff --git a/src/Tizen.Applications.Shortcut/Tizen.Applications.ShortcutEvent/ShortcutTemplate.cs b/src/Tizen.Applications.Shortcut/Tizen.Applications.ShortcutEvent/ShortcutTemplate.cs deleted file mode 100755 index 05fcb9911..000000000 --- a/src/Tizen.Applications.Shortcut/Tizen.Applications.ShortcutEvent/ShortcutTemplate.cs +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) 2017 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. - */ - -namespace Tizen.Applications.Shortcut -{ - /// - /// A class that contains the preset list of shortcut template from the installed package. - /// - public class ShortcutTemplate - { - /// - /// Gets the Application ID. - /// - public string AppId { get; internal set; } - - /// - /// Gets the name of the created shortcut icon. - /// - public string ShortcutName { get; internal set; } - - /// - /// Gets the absolute path of an icon file for this shortcut. - /// - public string IconPath { get; internal set; } - - /// - /// Gets the user data. A property of shortcut element in manifest file. - /// - public string ExtraKey { get; internal set; } - - /// - /// Gets the user data. A property of shortcut element in manifest file. - /// - public string ExtraData { get; internal set; } - } -} \ No newline at end of file diff --git a/src/Tizen.Applications.Shortcut/Tizen.Applications.ShortcutEvent/WidgetShortcutAddedInfo.cs b/src/Tizen.Applications.Shortcut/Tizen.Applications.ShortcutEvent/WidgetShortcutAddedInfo.cs deleted file mode 100755 index eed1e4f52..000000000 --- a/src/Tizen.Applications.Shortcut/Tizen.Applications.ShortcutEvent/WidgetShortcutAddedInfo.cs +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) 2017 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. - */ - -namespace Tizen.Applications.Shortcut -{ - /// - /// A class that contains information about the widget. - /// - public class WidgetShortcutAddedInfo : ShortcutAddedInfo - { - /// - /// Gets the Widget ID. - /// - public string WidgetId { get; internal set; } - - /// - /// Gets the size of widget. - /// - public ShortcutWidgetSize WidgetSize { get; internal set; } - - /// - /// Gets the Update period in seconds. - /// - public double Period { get; internal set; } - } -} \ No newline at end of file diff --git a/src/Tizen.Applications.Shortcut/interop/Interop.Libraries.cs b/src/Tizen.Applications.Shortcut/interop/Interop.Libraries.cs deleted file mode 100755 index 55784e171..000000000 --- a/src/Tizen.Applications.Shortcut/interop/Interop.Libraries.cs +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2017 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 Shortcut = "libshortcut.so.0"; - } -} diff --git a/src/Tizen.Applications.Shortcut/interop/Interop.Shortcut.cs b/src/Tizen.Applications.Shortcut/interop/Interop.Shortcut.cs deleted file mode 100755 index 95ad3b5ac..000000000 --- a/src/Tizen.Applications.Shortcut/interop/Interop.Shortcut.cs +++ /dev/null @@ -1,124 +0,0 @@ -/* - * Copyright (c) 2017 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; - -using Tizen.Applications.Shortcut; - -internal static partial class Interop -{ - internal static partial class Shortcut - { - internal delegate int AddCallback(string appId, string shortcutName, int type, string contentInfo, string iconPath, int processId, double period, bool isAllowDuplicate, IntPtr data); - - internal delegate int DeleteCallback(string appId, string shortcutName, int processId, IntPtr data); - - internal delegate int ResultCallback(int ret, IntPtr data); - - internal delegate int ListCallback(string package_name, string icon, string name, string extra_key, string extra_data, IntPtr user_data); - - /// - /// Enumeration for values of shortcut response types. - /// - internal enum ErrorCode : int - { - /// - /// Successful - /// - None = Tizen.Internals.Errors.ErrorCode.None, - - /// - /// Invalid function parameter - /// - InvalidParameter = Tizen.Internals.Errors.ErrorCode.InvalidParameter, - - /// - /// Out of memory - /// - OutOfMemory = Tizen.Internals.Errors.ErrorCode.OutOfMemory, - - /// - /// Permission denied - /// - PermissionDenied = Tizen.Internals.Errors.ErrorCode.PermissionDenied, - - /// - /// I/O Error - /// - IoError = Tizen.Internals.Errors.ErrorCode.IoError, - - /// - /// Not supported - /// - NotSupported = Tizen.Internals.Errors.ErrorCode.NotSupported, - - /// - /// Device or resource busy - /// - ResourceBusy = Tizen.Internals.Errors.ErrorCode.ResourceBusy, - - /// - /// There is no space to add a new shortcut - /// - NoSpace = -0x01160000 | 0x01, - - /// - /// Shortcut is already added - /// - Exist = -0x01160000 | 0x02, - - /// - /// Unrecoverable error - /// - Fault = -0x01160000 | 0x04, - - /// - /// Not exist shortcut - /// - NotExist = -0x01160000 | 0x08, - - /// - /// Connection not established or communication problem - /// - COMM = -0x01160000 | 0x40 - } - - [DllImport(Libraries.Shortcut, EntryPoint = "shortcut_add_to_home")] - internal static extern ErrorCode AddToHome(string name, int type, string uri, string icon, int dubplicate, ResultCallback result, IntPtr data); - - [DllImport(Libraries.Shortcut, EntryPoint = "shortcut_add_to_home_widget")] - internal static extern ErrorCode AddToWidget(string name, ShortcutWidgetSize size, string widgetId, string icon, double period, int dubplicate, ResultCallback result, IntPtr data); - - [DllImport(Libraries.Shortcut, EntryPoint = "shortcut_remove_from_home")] - internal static extern ErrorCode Delete(string name, ResultCallback result, IntPtr data); - - [DllImport(Libraries.Shortcut, EntryPoint = "shortcut_get_list")] - internal static extern ErrorCode GetList(string name, ListCallback list, IntPtr data); - - [DllImport(Libraries.Shortcut, EntryPoint = "shortcut_set_request_cb")] - internal static extern ErrorCode SetShortcutAddCallback(AddCallback cb, IntPtr data); - - [DllImport(Libraries.Shortcut, EntryPoint = "shortcut_unset_request_cb")] - internal static extern ErrorCode UnsetShortcutAddCallback(); - - [DllImport(Libraries.Shortcut, EntryPoint = "shortcut_set_remove_cb")] - internal static extern ErrorCode SetShortcutDeleteCallback(DeleteCallback cb, IntPtr data); - - [DllImport(Libraries.Shortcut, EntryPoint = "shortcut_unset_remove_cb")] - internal static extern ErrorCode UnsetShortcutDeleteCallback(); - } -} diff --git a/src/Tizen.Applications.ToastMessage/Interop/Interop.Libraries.cs b/src/Tizen.Applications.ToastMessage/Interop/Interop.Libraries.cs deleted file mode 100755 index c284ac5fe..000000000 --- a/src/Tizen.Applications.ToastMessage/Interop/Interop.Libraries.cs +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2017 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 ToastMessage = "libnotification.so.0"; - } -} diff --git a/src/Tizen.Applications.ToastMessage/Interop/Interop.ToastMessage.cs b/src/Tizen.Applications.ToastMessage/Interop/Interop.ToastMessage.cs deleted file mode 100755 index 69e49dbeb..000000000 --- a/src/Tizen.Applications.ToastMessage/Interop/Interop.ToastMessage.cs +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2017 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; -using Tizen.Applications; - -internal static partial class Interop -{ - internal static class ToastMessage - { - [DllImport(Libraries.ToastMessage, EntryPoint = "notification_status_message_post")] - internal static extern int ToastMessagePost(string message); - } -} diff --git a/src/Tizen.Applications.ToastMessage/Tizen.Applications.ToastMessage.csproj b/src/Tizen.Applications.ToastMessage/Tizen.Applications.ToastMessage.csproj deleted file mode 100755 index 020b2cb3d..000000000 --- a/src/Tizen.Applications.ToastMessage/Tizen.Applications.ToastMessage.csproj +++ /dev/null @@ -1,11 +0,0 @@ - - - - netstandard2.0 - - - - - - - diff --git a/src/Tizen.Applications.ToastMessage/Tizen.Applications.ToastMessage.sln b/src/Tizen.Applications.ToastMessage/Tizen.Applications.ToastMessage.sln deleted file mode 100755 index f52e1fe7d..000000000 --- a/src/Tizen.Applications.ToastMessage/Tizen.Applications.ToastMessage.sln +++ /dev/null @@ -1,40 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26430.12 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Applications.ToastMessage", "Tizen.Applications.ToastMessage.csproj", "{E0083399-45B6-4045-90CC-ED72F1EC2472}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen", "..\Tizen\Tizen.csproj", "{A4E9A04D-78B1-4733-8E0E-9FB3F8D07560}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Log", "..\Tizen.Log\Tizen.Log.csproj", "{3EEF8883-6470-4972-A3A2-27156897EB8F}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Applications.Common", "..\Tizen.Applications.Common\Tizen.Applications.Common.csproj", "{54C52299-BDF4-4934-889E-2D6B2340DBAD}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {E0083399-45B6-4045-90CC-ED72F1EC2472}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E0083399-45B6-4045-90CC-ED72F1EC2472}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E0083399-45B6-4045-90CC-ED72F1EC2472}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E0083399-45B6-4045-90CC-ED72F1EC2472}.Release|Any CPU.Build.0 = Release|Any CPU - {A4E9A04D-78B1-4733-8E0E-9FB3F8D07560}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A4E9A04D-78B1-4733-8E0E-9FB3F8D07560}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A4E9A04D-78B1-4733-8E0E-9FB3F8D07560}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A4E9A04D-78B1-4733-8E0E-9FB3F8D07560}.Release|Any CPU.Build.0 = Release|Any CPU - {3EEF8883-6470-4972-A3A2-27156897EB8F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {3EEF8883-6470-4972-A3A2-27156897EB8F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {3EEF8883-6470-4972-A3A2-27156897EB8F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {3EEF8883-6470-4972-A3A2-27156897EB8F}.Release|Any CPU.Build.0 = Release|Any CPU - {54C52299-BDF4-4934-889E-2D6B2340DBAD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {54C52299-BDF4-4934-889E-2D6B2340DBAD}.Debug|Any CPU.Build.0 = Debug|Any CPU - {54C52299-BDF4-4934-889E-2D6B2340DBAD}.Release|Any CPU.ActiveCfg = Release|Any CPU - {54C52299-BDF4-4934-889E-2D6B2340DBAD}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/src/Tizen.Applications.ToastMessage/Tizen.Applications/ToastMessage.cs b/src/Tizen.Applications.ToastMessage/Tizen.Applications/ToastMessage.cs deleted file mode 100755 index d490b2c64..000000000 --- a/src/Tizen.Applications.ToastMessage/Tizen.Applications/ToastMessage.cs +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2017 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.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tizen.Applications -{ - /// - /// The class helps you to create and show the ToastMessage which is a view quick message for the user. - /// - public sealed class ToastMessage - { - - /// - /// Gets and sets a message to post the ToastMessage. - /// - public string Message { get; set; } - - /// - /// Posts a message on a toast pop-up. - /// - /// Thrown when the message is null. - /// - /// - /// ToastMessage toast = new ToastMessage - /// { - /// Message = "Hello TIzen" - /// }; - /// toast.Post(); - /// - /// - public void Post() - { - int ret = Interop.ToastMessage.ToastMessagePost(Message); - if (ret != (int)ToastMessageError.None) - { - throw ToastMessageErrorFactory.GetException((ToastMessageError)ret, "post toast message failed"); - } - } - } - -} diff --git a/src/Tizen.Applications.ToastMessage/Tizen.Applications/ToastMessageErrorFactory.cs b/src/Tizen.Applications.ToastMessage/Tizen.Applications/ToastMessageErrorFactory.cs deleted file mode 100755 index cd2eebc4f..000000000 --- a/src/Tizen.Applications.ToastMessage/Tizen.Applications/ToastMessageErrorFactory.cs +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) 2017 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.Applications -{ - internal enum ToastMessageError - { - None = Tizen.Internals.Errors.ErrorCode.None, - InvalidParameter = Tizen.Internals.Errors.ErrorCode.InvalidParameter, - DBusError = -0x01140000 | 0x03, - } - - internal class ToastMessageErrorFactory - { - private const string _logTag = "Tizen.Applications.ToastMessage"; - - internal static Exception GetException(ToastMessageError ret, string msg) - { - switch (ret) - { - case ToastMessageError.InvalidParameter: - Log.Error(_logTag, msg); - return new ArgumentException(ret + " error occurred."); - default: - Log.Error(_logTag, msg); - return new InvalidOperationException(ret + " error occurred."); - } - } - } -} diff --git a/src/Tizen.Applications.UI/Interop/Interop.Application.cs b/src/Tizen.Applications.UI/Interop/Interop.Application.cs deleted file mode 100755 index 177bfea06..000000000 --- a/src/Tizen.Applications.UI/Interop/Interop.Application.cs +++ /dev/null @@ -1,61 +0,0 @@ -/* - * 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; -using Tizen.Applications.CoreBackend; -using Tizen.Internals.Errors; - -internal static partial class Interop -{ - internal static partial class Application - { - internal delegate void AppEventCallback(IntPtr handle, IntPtr data); - - internal delegate bool AppCreateCallback(IntPtr userData); - - internal delegate void AppPauseCallback(IntPtr userData); - - internal delegate void AppResumeCallback(IntPtr userData); - - internal delegate void AppTerminateCallback(IntPtr userData); - - internal delegate void AppControlCallback(IntPtr appControl, IntPtr userData); - - [DllImport(Libraries.Application, EntryPoint = "ui_app_main")] - internal static extern ErrorCode Main(int argc, string[] argv, ref UIAppLifecycleCallbacks callback, IntPtr userData); - - [DllImport(Libraries.Application, EntryPoint = "ui_app_exit")] - internal static extern void Exit(); - - [DllImport(Libraries.Application, EntryPoint = "ui_app_add_event_handler")] - internal static extern ErrorCode AddEventHandler(out IntPtr handle, DefaultCoreBackend.AppEventType eventType, AppEventCallback callback, IntPtr data); - - [DllImport(Libraries.Application, EntryPoint = "ui_app_remove_event_handler")] - internal static extern ErrorCode RemoveEventHandler(IntPtr handle); - - [StructLayout(LayoutKind.Sequential)] - internal struct UIAppLifecycleCallbacks - { - public AppCreateCallback OnCreate; - public AppTerminateCallback OnTerminate; - public AppPauseCallback OnPause; - public AppResumeCallback OnResume; - public AppControlCallback OnAppControl; - } - } -} - diff --git a/src/Tizen.Applications.UI/Interop/Interop.Libraries.cs b/src/Tizen.Applications.UI/Interop/Interop.Libraries.cs deleted file mode 100755 index 03047b195..000000000 --- a/src/Tizen.Applications.UI/Interop/Interop.Libraries.cs +++ /dev/null @@ -1,23 +0,0 @@ -/* - * 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 Application = "libcapi-appfw-application.so.0"; - } -} diff --git a/src/Tizen.Applications.UI/Tizen.Applications.CoreBackend/UICoreBackend.cs b/src/Tizen.Applications.UI/Tizen.Applications.CoreBackend/UICoreBackend.cs deleted file mode 100755 index 933a4e058..000000000 --- a/src/Tizen.Applications.UI/Tizen.Applications.CoreBackend/UICoreBackend.cs +++ /dev/null @@ -1,214 +0,0 @@ -/* - * 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.Applications.CoreBackend -{ - internal class UICoreBackend : DefaultCoreBackend - { - private Interop.Application.UIAppLifecycleCallbacks _callbacks; - private IntPtr _lowMemoryEventHandle = IntPtr.Zero; - private IntPtr _lowBatteryEventHandle = IntPtr.Zero; - private IntPtr _localeChangedEventHandle = IntPtr.Zero; - private IntPtr _regionChangedEventHandle = IntPtr.Zero; - private IntPtr _deviceOrientationChangedEventHandle = IntPtr.Zero; - private bool _disposedValue = false; - private Interop.Application.AppEventCallback _onLowMemoryNative; - private Interop.Application.AppEventCallback _onLowBatteryNative; - private Interop.Application.AppEventCallback _onLocaleChangedNative; - private Interop.Application.AppEventCallback _onRegionChangedNative; - private Interop.Application.AppEventCallback _onDeviceOrientationChangedNative; - - public UICoreBackend() - { - _callbacks.OnCreate = new Interop.Application.AppCreateCallback(OnCreateNative); - _callbacks.OnTerminate = new Interop.Application.AppTerminateCallback(OnTerminateNative); - _callbacks.OnAppControl = new Interop.Application.AppControlCallback(OnAppControlNative); - _callbacks.OnResume = new Interop.Application.AppResumeCallback(OnResumeNative); - _callbacks.OnPause = new Interop.Application.AppPauseCallback(OnPauseNative); - - _onLowMemoryNative = new Interop.Application.AppEventCallback(OnLowMemoryNative); - _onLowBatteryNative = new Interop.Application.AppEventCallback(OnLowBatteryNative); - _onLocaleChangedNative = new Interop.Application.AppEventCallback(OnLocaleChangedNative); - _onRegionChangedNative = new Interop.Application.AppEventCallback(OnRegionChangedNative); - _onDeviceOrientationChangedNative = new Interop.Application.AppEventCallback(OnDeviceOrientationChangedNative); - } - - public override void Exit() - { - Interop.Application.Exit(); - } - - public override void Run(string[] args) - { - base.Run(args); - - ErrorCode err = ErrorCode.None; - err = Interop.Application.AddEventHandler(out _lowMemoryEventHandle, AppEventType.LowMemory, _onLowMemoryNative, IntPtr.Zero); - if (err != ErrorCode.None) - { - Log.Error(LogTag, "Failed to add event handler for LowMemory event. Err = " + err); - } - err = Interop.Application.AddEventHandler(out _lowBatteryEventHandle, AppEventType.LowBattery, _onLowBatteryNative, IntPtr.Zero); - if (err != ErrorCode.None) - { - Log.Error(LogTag, "Failed to add event handler for LowBattery event. Err = " + err); - } - - err = Interop.Application.AddEventHandler(out _localeChangedEventHandle, AppEventType.LanguageChanged, _onLocaleChangedNative, IntPtr.Zero); - if (err != ErrorCode.None) - { - Log.Error(LogTag, "Failed to add event handler for LocaleChanged event. Err = " + err); - } - - err = Interop.Application.AddEventHandler(out _regionChangedEventHandle, AppEventType.RegionFormatChanged, _onRegionChangedNative, IntPtr.Zero); - if (err != ErrorCode.None) - { - Log.Error(LogTag, "Failed to add event handler for RegionFormatChanged event. Err = " + err); - } - - err = Interop.Application.AddEventHandler(out _deviceOrientationChangedEventHandle, AppEventType.DeviceOrientationChanged, _onDeviceOrientationChangedNative, IntPtr.Zero); - if (err != ErrorCode.None) - { - Log.Error(LogTag, "Failed to add event handler for DeviceOrientationChanged event. Err = " + err); - } - - err = Interop.Application.Main(args.Length, args, ref _callbacks, IntPtr.Zero); - if (err != ErrorCode.None) - { - Log.Error(LogTag, "Failed to run the application. Err = " + err); - } - } - - protected override void Dispose(bool disposing) - { - if (!_disposedValue) - { - if (disposing) - { - // Release disposable objects - } - - if (_lowMemoryEventHandle != IntPtr.Zero) - { - Interop.Application.RemoveEventHandler(_lowMemoryEventHandle); - } - if (_lowBatteryEventHandle != IntPtr.Zero) - { - Interop.Application.RemoveEventHandler(_lowBatteryEventHandle); - } - if (_localeChangedEventHandle != IntPtr.Zero) - { - Interop.Application.RemoveEventHandler(_localeChangedEventHandle); - } - if (_regionChangedEventHandle != IntPtr.Zero) - { - Interop.Application.RemoveEventHandler(_regionChangedEventHandle); - } - if (_deviceOrientationChangedEventHandle != IntPtr.Zero) - { - Interop.Application.RemoveEventHandler(_deviceOrientationChangedEventHandle); - } - - _disposedValue = true; - } - } - - private bool OnCreateNative(IntPtr data) - { - if (Handlers.ContainsKey(EventType.PreCreated)) - { - var handler = Handlers[EventType.PreCreated] as Action; - handler?.Invoke(); - } - - if (Handlers.ContainsKey(EventType.Created)) - { - var handler = Handlers[EventType.Created] as Action; - handler?.Invoke(); - } - return true; - } - - private void OnTerminateNative(IntPtr data) - { - if (Handlers.ContainsKey(EventType.Terminated)) - { - var handler = Handlers[EventType.Terminated] as Action; - handler?.Invoke(); - } - } - - private void OnAppControlNative(IntPtr appControlHandle, IntPtr data) - { - if (Handlers.ContainsKey(EventType.AppControlReceived)) - { - // Create a SafeAppControlHandle but the ownsHandle is false, - // because the appControlHandle will be closed by native appfw after this method automatically. - SafeAppControlHandle safeHandle = new SafeAppControlHandle(appControlHandle, false); - - var handler = Handlers[EventType.AppControlReceived] as Action; - handler?.Invoke(new AppControlReceivedEventArgs(new ReceivedAppControl(safeHandle))); - } - } - - private void OnResumeNative(IntPtr data) - { - if (Handlers.ContainsKey(EventType.Resumed)) - { - var handler = Handlers[EventType.Resumed] as Action; - handler?.Invoke(); - } - } - - private void OnPauseNative(IntPtr data) - { - if (Handlers.ContainsKey(EventType.Paused)) - { - var handler = Handlers[EventType.Paused] as Action; - handler?.Invoke(); - } - } - - protected override void OnLowMemoryNative(IntPtr infoHandle, IntPtr data) - { - base.OnLowMemoryNative(infoHandle, data); - } - - protected override void OnLowBatteryNative(IntPtr infoHandle, IntPtr data) - { - base.OnLowBatteryNative(infoHandle, data); - } - - protected override void OnLocaleChangedNative(IntPtr infoHandle, IntPtr data) - { - base.OnLocaleChangedNative(infoHandle, data); - } - - protected override void OnRegionChangedNative(IntPtr infoHandle, IntPtr data) - { - base.OnRegionChangedNative(infoHandle, data); - } - - protected override void OnDeviceOrientationChangedNative(IntPtr infoHandle, IntPtr data) - { - base.OnDeviceOrientationChangedNative(infoHandle, data); - } - } -} diff --git a/src/Tizen.Applications.UI/Tizen.Applications.UI.csproj b/src/Tizen.Applications.UI/Tizen.Applications.UI.csproj deleted file mode 100755 index 020b2cb3d..000000000 --- a/src/Tizen.Applications.UI/Tizen.Applications.UI.csproj +++ /dev/null @@ -1,11 +0,0 @@ - - - - netstandard2.0 - - - - - - - diff --git a/src/Tizen.Applications.UI/Tizen.Applications.UI.sln b/src/Tizen.Applications.UI/Tizen.Applications.UI.sln deleted file mode 100755 index 43d25c7aa..000000000 --- a/src/Tizen.Applications.UI/Tizen.Applications.UI.sln +++ /dev/null @@ -1,40 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26430.12 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Applications.UI", "Tizen.Applications.UI.csproj", "{560A2284-1C3F-4799-8DE5-9A568F44195F}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen", "..\Tizen\Tizen.csproj", "{8A262C69-7E99-4605-83E2-A7F875B17EFB}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Log", "..\Tizen.Log\Tizen.Log.csproj", "{C7D0B251-3102-4A26-BC2E-0220C2DB45DB}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Applications.Common", "..\Tizen.Applications.Common\Tizen.Applications.Common.csproj", "{3B366840-7B06-4774-A7A0-E77E92F83BB4}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {560A2284-1C3F-4799-8DE5-9A568F44195F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {560A2284-1C3F-4799-8DE5-9A568F44195F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {560A2284-1C3F-4799-8DE5-9A568F44195F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {560A2284-1C3F-4799-8DE5-9A568F44195F}.Release|Any CPU.Build.0 = Release|Any CPU - {8A262C69-7E99-4605-83E2-A7F875B17EFB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {8A262C69-7E99-4605-83E2-A7F875B17EFB}.Debug|Any CPU.Build.0 = Debug|Any CPU - {8A262C69-7E99-4605-83E2-A7F875B17EFB}.Release|Any CPU.ActiveCfg = Release|Any CPU - {8A262C69-7E99-4605-83E2-A7F875B17EFB}.Release|Any CPU.Build.0 = Release|Any CPU - {C7D0B251-3102-4A26-BC2E-0220C2DB45DB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C7D0B251-3102-4A26-BC2E-0220C2DB45DB}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C7D0B251-3102-4A26-BC2E-0220C2DB45DB}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C7D0B251-3102-4A26-BC2E-0220C2DB45DB}.Release|Any CPU.Build.0 = Release|Any CPU - {3B366840-7B06-4774-A7A0-E77E92F83BB4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {3B366840-7B06-4774-A7A0-E77E92F83BB4}.Debug|Any CPU.Build.0 = Debug|Any CPU - {3B366840-7B06-4774-A7A0-E77E92F83BB4}.Release|Any CPU.ActiveCfg = Release|Any CPU - {3B366840-7B06-4774-A7A0-E77E92F83BB4}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/src/Tizen.Applications.UI/Tizen.Applications/CoreUIApplication.cs b/src/Tizen.Applications.UI/Tizen.Applications/CoreUIApplication.cs deleted file mode 100755 index e036c1477..000000000 --- a/src/Tizen.Applications.UI/Tizen.Applications/CoreUIApplication.cs +++ /dev/null @@ -1,96 +0,0 @@ -/* - * 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.Applications.CoreBackend; - -namespace Tizen.Applications -{ - /// - /// Represents an application that has an UI screen. The events for resuming and pausing are provided. - /// - public class CoreUIApplication : CoreApplication - { - /// - /// Initializes the CoreUIApplication class. - /// - /// - /// The default backend for the UI application will be used. - /// - public CoreUIApplication() : base(new UICoreBackend()) - { - } - - /// - /// Initializes the CoreUIApplication class. - /// - /// - /// If you want to change the backend, use this constructor. - /// - /// The backend instance implementing the ICoreBacked interface. - public CoreUIApplication(ICoreBackend backend) : base(backend) - { - } - - /// - /// Occurs whenever the application is resumed. - /// - public event EventHandler Resumed; - - /// - /// Occurs whenever the application is paused. - /// - public event EventHandler Paused; - - /// - /// Runs the UI application's main loop. - /// - /// Arguments from the commandline. - public override void Run(string[] args) - { - Backend.AddEventHandler(EventType.PreCreated, OnPreCreate); - Backend.AddEventHandler(EventType.Resumed, OnResume); - Backend.AddEventHandler(EventType.Paused, OnPause); - base.Run(args); - } - - /// - /// Overrides this method if you want to handle the behavior before calling OnCreate(). - /// - protected virtual void OnPreCreate() - { - } - - /// - /// Overrides this method if you want to handle the behavior when the application is resumed. - /// If base.OnResume() is not called, the event 'Resumed' will not be emitted. - /// - protected virtual void OnResume() - { - Resumed?.Invoke(this, EventArgs.Empty); - } - - /// - /// Overrides this method if you want to handle the behavior when the application is paused. - /// If base.OnPause() is not called, the event 'Paused' will not be emitted. - /// - protected virtual void OnPause() - { - Paused?.Invoke(this, EventArgs.Empty); - } - } -} diff --git a/src/Tizen.Applications.WatchApplication/Interop/Interop.Libraries.cs b/src/Tizen.Applications.WatchApplication/Interop/Interop.Libraries.cs deleted file mode 100755 index 77c0b484e..000000000 --- a/src/Tizen.Applications.WatchApplication/Interop/Interop.Libraries.cs +++ /dev/null @@ -1,24 +0,0 @@ -/* - * 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 AppCommon = "libcapi-appfw-app-common.so.0"; - public const string AppCoreWatch = "libappcore-watch.so.1"; - } -} \ No newline at end of file diff --git a/src/Tizen.Applications.WatchApplication/Interop/Interop.Watch.cs b/src/Tizen.Applications.WatchApplication/Interop/Interop.Watch.cs deleted file mode 100755 index b4ffa339b..000000000 --- a/src/Tizen.Applications.WatchApplication/Interop/Interop.Watch.cs +++ /dev/null @@ -1,158 +0,0 @@ -/* - * 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; -using Tizen.Applications; - -internal static partial class Interop -{ - internal static partial class Watch - { - internal enum AppEventType - { - LowMemory = 0, - LowBattery, - LanguageChanged, - DeviceOrientationChanged, - RegionFormatChanged, - SuspendedStateChanged - } - - internal enum ErrorCode - { - None = Tizen.Internals.Errors.ErrorCode.None, - InvalidParameter = Tizen.Internals.Errors.ErrorCode.InvalidParameter, - OutOfMemory = Tizen.Internals.Errors.ErrorCode.OutOfMemory, - InvalidContext = -0x01100000 | 0x01, - NoSuchFile = Tizen.Internals.Errors.ErrorCode.NoSuchFile, - AlreadyRunning = Tizen.Internals.Errors.ErrorCode.AlreadyInProgress - } - - internal delegate void AppEventCallback(IntPtr handle, IntPtr data); - - internal delegate bool WatchAppCreateCallback(int width, int height, IntPtr userData); - - internal delegate void WatchAppPauseCallback(IntPtr userData); - - internal delegate void WatchAppResumeCallback(IntPtr userData); - - internal delegate void WatchAppTerminateCallback(IntPtr userData); - - internal delegate void WatchAppControlCallback(IntPtr appControl, IntPtr userData); - - internal delegate void WatchAppTimeTickCallback(IntPtr watchTime, IntPtr userData); - - internal delegate void WatchAppAmbientTickCallback(IntPtr watchTime, IntPtr userData); - - internal delegate void WatchAppAmbientChangedCallback(bool ambientMode, IntPtr userData); - - [StructLayout(LayoutKind.Sequential)] - internal struct WatchAppLifecycleCallbacks - { - public WatchAppCreateCallback OnCreate; - public WatchAppControlCallback OnAppControl; - public WatchAppPauseCallback OnPause; - public WatchAppResumeCallback OnResume; - public WatchAppTerminateCallback OnTerminate; - public WatchAppTimeTickCallback OnTick; - public WatchAppAmbientTickCallback OnAmbientTick; - public WatchAppAmbientChangedCallback OnAmbientChanged; - } - - [DllImport(Libraries.AppCoreWatch, EntryPoint = "watch_app_main")] - internal static extern ErrorCode Main(int argc, string[] argv, ref WatchAppLifecycleCallbacks callback, IntPtr userData); - - [DllImport(Libraries.AppCoreWatch, EntryPoint = "watch_app_exit")] - internal static extern void Exit(); - - [DllImport(Libraries.AppCoreWatch, EntryPoint = "watch_app_add_event_handler")] - internal static extern ErrorCode AddEventHandler(out IntPtr handle, AppEventType eventType, AppEventCallback callback, IntPtr userData); - - [DllImport(Libraries.AppCoreWatch, EntryPoint = "watch_app_remove_event_handler")] - internal static extern ErrorCode RemoveEventHandler(IntPtr handle); - - // tizen 3.0 - [DllImport(Libraries.AppCoreWatch, EntryPoint = "watch_app_set_time_tick_frequency")] - internal static extern ErrorCode SetTimeTickFrequency(int ticks, TimeTickResolution type); - - // tizen 3.0 - [DllImport(Libraries.AppCoreWatch, EntryPoint = "watch_app_get_time_tick_frequency")] - internal static extern ErrorCode GetTimeTickFrequency(out int ticks, out TimeTickResolution type); - - [DllImport(Libraries.AppCoreWatch, EntryPoint = "watch_app_set_ambient_tick_type")] - internal static extern ErrorCode SetAmbientTickType(AmbientTickType type); - - [DllImport(Libraries.AppCoreWatch, EntryPoint = "watch_app_get_ambient_tick_type")] - internal static extern ErrorCode GetAmbientTickType(out AmbientTickType type); - - [DllImport(Libraries.AppCoreWatch, EntryPoint = "watch_time_delete")] - internal static extern ErrorCode WatchTimeDelete(IntPtr watchTime); - - [DllImport(Libraries.AppCoreWatch, EntryPoint = "watch_time_get_year")] - internal static extern ErrorCode WatchTimeGetYear(SafeWatchTimeHandle handle, out int year); - - [DllImport(Libraries.AppCoreWatch, EntryPoint = "watch_time_get_month")] - internal static extern ErrorCode WatchTimeGetMonth(SafeWatchTimeHandle handle, out int month); - - [DllImport(Libraries.AppCoreWatch, EntryPoint = "watch_time_get_day")] - internal static extern ErrorCode WatchTimeGetDay(SafeWatchTimeHandle handle, out int day); - - [DllImport(Libraries.AppCoreWatch, EntryPoint = "watch_time_get_day_of_week")] - internal static extern ErrorCode WatchTimeGetDayOfWeek(SafeWatchTimeHandle handle, out int day_of_week); - - [DllImport(Libraries.AppCoreWatch, EntryPoint = "watch_time_get_hour")] - internal static extern ErrorCode WatchTimeGetHour(SafeWatchTimeHandle handle, out int hour); - - [DllImport(Libraries.AppCoreWatch, EntryPoint = "watch_time_get_hour24")] - internal static extern ErrorCode WatchTimeGetHour24(SafeWatchTimeHandle handle, out int hour24); - - [DllImport(Libraries.AppCoreWatch, EntryPoint = "watch_time_get_minute")] - internal static extern ErrorCode WatchTimeGetMinute(SafeWatchTimeHandle handle, out int minute); - - [DllImport(Libraries.AppCoreWatch, EntryPoint = "watch_time_get_second")] - internal static extern ErrorCode WatchTimeGetSecond(SafeWatchTimeHandle handle, out int second); - - [DllImport(Libraries.AppCoreWatch, EntryPoint = "watch_time_get_millisecond")] - internal static extern ErrorCode WatchTimeGetMillisecond(SafeWatchTimeHandle handle, out int millisecond); - - [DllImport(Libraries.AppCoreWatch, EntryPoint = "watch_app_get_elm_win")] - internal static extern ErrorCode GetWin(out IntPtr win); - - [DllImport(Libraries.AppCoreWatch, EntryPoint = "watch_time_get_utc_timestamp")] - internal static extern ErrorCode WatchTimeGetUtcTimestamp(SafeWatchTimeHandle handle, out long utc_timestamp); - - [DllImport(Libraries.AppCoreWatch, EntryPoint = "watch_time_get_time_zone")] - internal static extern ErrorCode WatchTimeGetTimeZone(SafeWatchTimeHandle handle, out string time_zone_id); - - [DllImport(Libraries.AppCoreWatch, EntryPoint = "watch_time_get_current_time")] - internal static extern ErrorCode WatchTimeGetCurrentTime(out SafeWatchTimeHandle handle); - - // app common - [DllImport(Libraries.AppCommon, EntryPoint = "app_event_get_low_memory_status")] - internal static extern Tizen.Internals.Errors.ErrorCode AppEventGetLowMemoryStatus(IntPtr handle, out LowMemoryStatus status); - - [DllImport(Libraries.AppCommon, EntryPoint = "app_event_get_low_battery_status")] - internal static extern Tizen.Internals.Errors.ErrorCode AppEventGetLowBatteryStatus(IntPtr handle, out LowBatteryStatus status); - - [DllImport(Libraries.AppCommon, EntryPoint = "app_event_get_language")] - internal static extern Tizen.Internals.Errors.ErrorCode AppEventGetLanguage(IntPtr handle, out string lang); - - [DllImport(Libraries.AppCommon, EntryPoint = "app_event_get_region_format")] - internal static extern Tizen.Internals.Errors.ErrorCode AppEventGetRegionFormat(IntPtr handle, out string region); - - } -} diff --git a/src/Tizen.Applications.WatchApplication/Tizen.Applications.CoreBackend/WatchCoreBackend.cs b/src/Tizen.Applications.WatchApplication/Tizen.Applications.CoreBackend/WatchCoreBackend.cs deleted file mode 100755 index 01f0bc1a5..000000000 --- a/src/Tizen.Applications.WatchApplication/Tizen.Applications.CoreBackend/WatchCoreBackend.cs +++ /dev/null @@ -1,300 +0,0 @@ -/* - * 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.Collections.Generic; -using Tizen.Internals.Errors; - -namespace Tizen.Applications.CoreBackend -{ - internal class WatchCoreBackend : ICoreBackend - { - private const string LOGTAG = "Tizen.Applications.WatchApplication"; - - private Dictionary _handlers = new Dictionary(); - - private bool _disposedValue = false; - - private Interop.Watch.AppEventCallback _lowMemoryCallback; - private Interop.Watch.AppEventCallback _lowBatteryCallback; - private Interop.Watch.AppEventCallback _localeChangedCallback; - private Interop.Watch.AppEventCallback _regionChnagedCallback; - - private IntPtr _lowMemoryEventHandle = IntPtr.Zero; - private IntPtr _lowBatteryEventHandle = IntPtr.Zero; - private IntPtr _localeChangedEventHandle = IntPtr.Zero; - private IntPtr _regionChnagedEventHandle = IntPtr.Zero; - - private Interop.Watch.WatchAppLifecycleCallbacks _callbacks; - - public WatchCoreBackend() - { - _lowMemoryCallback = new Interop.Watch.AppEventCallback(OnLowMemoryNative); - _lowBatteryCallback = new Interop.Watch.AppEventCallback(OnLowBatteryNative); - _localeChangedCallback = new Interop.Watch.AppEventCallback(OnLocaleChangedNative); - _regionChnagedCallback = new Interop.Watch.AppEventCallback(OnRegionChangedNative); - - _callbacks.OnCreate = new Interop.Watch.WatchAppCreateCallback(OnCreateNative); - _callbacks.OnTerminate = new Interop.Watch.WatchAppTerminateCallback(OnTerminateNative); - _callbacks.OnResume = new Interop.Watch.WatchAppResumeCallback(OnResumeNative); - _callbacks.OnPause = new Interop.Watch.WatchAppPauseCallback(OnPauseNative); - _callbacks.OnAppControl = new Interop.Watch.WatchAppControlCallback(OnAppControlNative); - - _callbacks.OnTick = new Interop.Watch.WatchAppTimeTickCallback(OnTimeTickNative); - _callbacks.OnAmbientTick = new Interop.Watch.WatchAppAmbientTickCallback(OnAmbientTickNative); - _callbacks.OnAmbientChanged = new Interop.Watch.WatchAppAmbientChangedCallback(OnAmbientChangedNative); - } - - ~WatchCoreBackend() - { - Dispose(false); - } - - public void AddEventHandler(EventType evType, Action handler) - { - _handlers.Add(evType, handler); - } - - public void AddEventHandler(EventType evType, Action handler) where TEventArgs : EventArgs - { - _handlers.Add(evType, handler); - } - - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - - protected virtual void Dispose(bool disposing) - { - if (!_disposedValue) - { - if (disposing) - { - // Release disposable objects - } - - if (_lowMemoryEventHandle != IntPtr.Zero) - { - Interop.Watch.RemoveEventHandler(_lowMemoryEventHandle); - } - if (_lowBatteryEventHandle != IntPtr.Zero) - { - Interop.Watch.RemoveEventHandler(_lowBatteryEventHandle); - } - if (_localeChangedEventHandle != IntPtr.Zero) - { - Interop.Watch.RemoveEventHandler(_localeChangedEventHandle); - } - if (_regionChnagedEventHandle != IntPtr.Zero) - { - Interop.Watch.RemoveEventHandler(_regionChnagedEventHandle); - } - - _disposedValue = true; - } - } - - public void Exit() - { - Interop.Watch.Exit(); - } - - public void Run(string[] args) - { - Interop.Watch.ErrorCode err = Interop.Watch.ErrorCode.None; - - err = Interop.Watch.AddEventHandler(out _lowMemoryEventHandle, Interop.Watch.AppEventType.LowMemory, _lowMemoryCallback, IntPtr.Zero); - if (err != Interop.Watch.ErrorCode.None) - { - Log.Error(LOGTAG, "Failed to add event handler for LowMemory event, Err = " + err); - } - - err = Interop.Watch.AddEventHandler(out _lowBatteryEventHandle, Interop.Watch.AppEventType.LowBattery, _lowBatteryCallback, IntPtr.Zero); - if (err != Interop.Watch.ErrorCode.None) - { - Log.Error(LOGTAG, "Failed to add event handler for LowBattery event, Err = " + err); - } - - err = Interop.Watch.AddEventHandler(out _localeChangedEventHandle, Interop.Watch.AppEventType.LanguageChanged, _localeChangedCallback, IntPtr.Zero); - if (err != Interop.Watch.ErrorCode.None) - { - Log.Error(LOGTAG, "Failed to add event handler for LocaleChanged event, Err = " + err); - } - - err = Interop.Watch.AddEventHandler(out _regionChnagedEventHandle, Interop.Watch.AppEventType.RegionFormatChanged, _regionChnagedCallback, IntPtr.Zero); - if (err != Interop.Watch.ErrorCode.None) - { - Log.Error(LOGTAG, "Failed to add event handler for RegionFormatChanged event, Err = " + err); - } - - err = Interop.Watch.Main(args.Length, args, ref _callbacks, IntPtr.Zero); - if (err != Interop.Watch.ErrorCode.None) - { - Log.Error(LOGTAG, "Failed to run the Watch application, Err = " + err); - } - } - - private void OnLowMemoryNative(IntPtr infoHandle, IntPtr data) - { - LowMemoryStatus status = LowMemoryStatus.None; - ErrorCode err = Interop.Watch.AppEventGetLowMemoryStatus(infoHandle, out status); - if (err != ErrorCode.None) - { - Log.Error(LOGTAG, "Failed to get memory status, Err = " + err); - } - if (_handlers.ContainsKey(WatchEventType.LowMemory)) - { - var handler = _handlers[WatchEventType.LowMemory] as Action; - handler?.Invoke(new LowMemoryEventArgs(status)); - } - } - - private void OnLowBatteryNative(IntPtr infoHandle, IntPtr data) - { - LowBatteryStatus status = LowBatteryStatus.None; - ErrorCode err = Interop.Watch.AppEventGetLowBatteryStatus(infoHandle, out status); - if (err != Tizen.Internals.Errors.ErrorCode.None) - { - Log.Error(LOGTAG, "Failed to get battery status, Err = " + err); - } - if (_handlers.ContainsKey(WatchEventType.LowBattery)) - { - var handler = _handlers[WatchEventType.LowBattery] as Action; - handler?.Invoke(new LowBatteryEventArgs(status)); - } - } - private void OnLocaleChangedNative(IntPtr infoHandle, IntPtr data) - { - string lang; - ErrorCode err = Interop.Watch.AppEventGetLanguage(infoHandle, out lang); - if (err != ErrorCode.None) - { - Log.Error(LOGTAG, "Failed to get changed language. Err = " + err); - } - if (_handlers.ContainsKey(WatchEventType.LocaleChanged)) - { - var handler = _handlers[WatchEventType.LocaleChanged] as Action; - handler?.Invoke(new LocaleChangedEventArgs(lang)); - } - } - private void OnRegionChangedNative(IntPtr infoHandle, IntPtr data) - { - string region; - ErrorCode err = Interop.Watch.AppEventGetRegionFormat(infoHandle, out region); - if (err != ErrorCode.None) - { - Log.Error(LOGTAG, "Failed to get changed region format. Err = " + err); - } - if (_handlers.ContainsKey(WatchEventType.RegionFormatChanged)) - { - var handler = _handlers[WatchEventType.RegionFormatChanged] as Action; - handler?.Invoke(new RegionFormatChangedEventArgs(region)); - } - } - private bool OnCreateNative(int width, int height, IntPtr data) - { - if (_handlers.ContainsKey(WatchEventType.PreCreated)) - { - var handler = _handlers[WatchEventType.PreCreated] as Action; - handler?.Invoke(); - } - - if (_handlers.ContainsKey(WatchEventType.Created)) - { - var handler = _handlers[WatchEventType.Created] as Action; - handler?.Invoke(); - } - return true; - } - - private void OnTerminateNative(IntPtr data) - { - if (_handlers.ContainsKey(WatchEventType.Terminated)) - { - var handler = _handlers[WatchEventType.Terminated] as Action; - handler?.Invoke(); - } - } - - private void OnAppControlNative(IntPtr appControlHandle, IntPtr data) - { - if (_handlers.ContainsKey(WatchEventType.AppControlReceived)) - { - SafeAppControlHandle safeHandle = new SafeAppControlHandle(appControlHandle, false); - - var handler = _handlers[WatchEventType.AppControlReceived] as Action; - - handler?.Invoke(new AppControlReceivedEventArgs(new ReceivedAppControl(safeHandle))); - } - } - - private void OnResumeNative(IntPtr data) - { - if (_handlers.ContainsKey(WatchEventType.Resumed)) - { - var handler = _handlers[WatchEventType.Resumed] as Action; - handler?.Invoke(); - } - } - - private void OnPauseNative(IntPtr data) - { - if (_handlers.ContainsKey(WatchEventType.Paused)) - { - var handler = _handlers[WatchEventType.Paused] as Action; - handler?.Invoke(); - } - } - - private void OnTimeTickNative(IntPtr watchTime, IntPtr userData) - { - if (_handlers.ContainsKey(WatchEventType.TimeTick)) - { - var handler = _handlers[WatchEventType.TimeTick] as Action; - handler?.Invoke(new TimeEventArgs() - { - Time = new WatchTime(new SafeWatchTimeHandle(watchTime, false)) - }); - } - } - - private void OnAmbientTickNative(IntPtr watchTime, IntPtr userData) - { - if (_handlers.ContainsKey(WatchEventType.AmbientTick)) - { - var handler = _handlers[WatchEventType.AmbientTick] as Action; - handler?.Invoke(new TimeEventArgs() - { - Time = new WatchTime(new SafeWatchTimeHandle(watchTime, false)) - }); - } - } - - private void OnAmbientChangedNative(bool ambientMode, IntPtr userData) - { - if (_handlers.ContainsKey(WatchEventType.AmbientChanged)) - { - var handler = _handlers[WatchEventType.AmbientChanged] as Action; - handler?.Invoke(new AmbientEventArgs() - { - Enabled = ambientMode - }); - } - } - } -} diff --git a/src/Tizen.Applications.WatchApplication/Tizen.Applications.CoreBackend/WatchEventType.cs b/src/Tizen.Applications.WatchApplication/Tizen.Applications.CoreBackend/WatchEventType.cs deleted file mode 100755 index c99602963..000000000 --- a/src/Tizen.Applications.WatchApplication/Tizen.Applications.CoreBackend/WatchEventType.cs +++ /dev/null @@ -1,59 +0,0 @@ -/* - * 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.Collections.Generic; -using Tizen.Applications.CoreBackend; - -namespace Tizen.Applications.CoreBackend -{ - /// - /// Class that represents the type of event for backends. This class can be converted from string type. - /// - public class WatchEventType : EventType - { - /// - /// Pre-defined event type. "Created" - /// - public static readonly WatchEventType TimeTick = "TimeTick"; - - /// - /// Pre-defined event type. "AmbientTick" - /// - public static readonly WatchEventType AmbientTick = "AmbientTick"; - - /// - /// Pre-defined event type. "AmbientChanged" - /// - public static readonly WatchEventType AmbientChanged = "AmbientChanged"; - - /// - /// Initializes the WatchEventType class. - /// - /// The name of watch event type. - public WatchEventType(string name) : base(name) - { - } - - /// - /// Converts a string to WatchEventType instance. - /// - public static implicit operator WatchEventType(string value) - { - return new WatchEventType(value); - } - } -} diff --git a/src/Tizen.Applications.WatchApplication/Tizen.Applications.WatchApplication.csproj b/src/Tizen.Applications.WatchApplication/Tizen.Applications.WatchApplication.csproj deleted file mode 100644 index e56b74e97..000000000 --- a/src/Tizen.Applications.WatchApplication/Tizen.Applications.WatchApplication.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - netstandard2.0 - - - - - - - - diff --git a/src/Tizen.Applications.WatchApplication/Tizen.Applications.WatchApplication.sln b/src/Tizen.Applications.WatchApplication/Tizen.Applications.WatchApplication.sln deleted file mode 100755 index 63347ebfe..000000000 --- a/src/Tizen.Applications.WatchApplication/Tizen.Applications.WatchApplication.sln +++ /dev/null @@ -1,46 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26430.12 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Applications.WatchApplication", "Tizen.Applications.WatchApplication.csproj", "{8BF860DC-DCBC-4889-938F-7515C5282D95}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen", "..\Tizen\Tizen.csproj", "{34997257-2357-4915-BE87-462750971990}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Log", "..\Tizen.Log\Tizen.Log.csproj", "{B659B1EF-6967-4FB9-B398-30D964410272}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Applications.Common", "..\Tizen.Applications.Common\Tizen.Applications.Common.csproj", "{F993FF87-2DC9-4282-B88A-E99C8CECB320}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ElmSharp", "..\ElmSharp\ElmSharp.csproj", "{66EC3D92-AD41-4906-A1A9-3C414B2107F5}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {8BF860DC-DCBC-4889-938F-7515C5282D95}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {8BF860DC-DCBC-4889-938F-7515C5282D95}.Debug|Any CPU.Build.0 = Debug|Any CPU - {8BF860DC-DCBC-4889-938F-7515C5282D95}.Release|Any CPU.ActiveCfg = Release|Any CPU - {8BF860DC-DCBC-4889-938F-7515C5282D95}.Release|Any CPU.Build.0 = Release|Any CPU - {34997257-2357-4915-BE87-462750971990}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {34997257-2357-4915-BE87-462750971990}.Debug|Any CPU.Build.0 = Debug|Any CPU - {34997257-2357-4915-BE87-462750971990}.Release|Any CPU.ActiveCfg = Release|Any CPU - {34997257-2357-4915-BE87-462750971990}.Release|Any CPU.Build.0 = Release|Any CPU - {B659B1EF-6967-4FB9-B398-30D964410272}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B659B1EF-6967-4FB9-B398-30D964410272}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B659B1EF-6967-4FB9-B398-30D964410272}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B659B1EF-6967-4FB9-B398-30D964410272}.Release|Any CPU.Build.0 = Release|Any CPU - {F993FF87-2DC9-4282-B88A-E99C8CECB320}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F993FF87-2DC9-4282-B88A-E99C8CECB320}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F993FF87-2DC9-4282-B88A-E99C8CECB320}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F993FF87-2DC9-4282-B88A-E99C8CECB320}.Release|Any CPU.Build.0 = Release|Any CPU - {66EC3D92-AD41-4906-A1A9-3C414B2107F5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {66EC3D92-AD41-4906-A1A9-3C414B2107F5}.Debug|Any CPU.Build.0 = Debug|Any CPU - {66EC3D92-AD41-4906-A1A9-3C414B2107F5}.Release|Any CPU.ActiveCfg = Release|Any CPU - {66EC3D92-AD41-4906-A1A9-3C414B2107F5}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/src/Tizen.Applications.WatchApplication/Tizen.Applications/AmbientEventArgs.cs b/src/Tizen.Applications.WatchApplication/Tizen.Applications/AmbientEventArgs.cs deleted file mode 100755 index aa9e7b5e0..000000000 --- a/src/Tizen.Applications.WatchApplication/Tizen.Applications/AmbientEventArgs.cs +++ /dev/null @@ -1,36 +0,0 @@ -/* - * 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 ElmSharp; -using System; - -namespace Tizen.Applications -{ - /// - /// Arguments for the event that reaised when the device enters or exits the ambient mode. - /// - public class AmbientEventArgs : EventArgs - { - /// - /// The received Ambient mode - /// - public bool Enabled { get; internal set; } - - internal AmbientEventArgs() - { - } - } -} \ No newline at end of file diff --git a/src/Tizen.Applications.WatchApplication/Tizen.Applications/AmbientTickType.cs b/src/Tizen.Applications.WatchApplication/Tizen.Applications/AmbientTickType.cs deleted file mode 100755 index c82656e35..000000000 --- a/src/Tizen.Applications.WatchApplication/Tizen.Applications/AmbientTickType.cs +++ /dev/null @@ -1,67 +0,0 @@ -/* - * 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.Applications -{ - /// - /// Enumeration for Ambient tick type. - /// - public enum AmbientTickType - { - /// - /// No peridoic ambient tick. - /// - NoTick, - /// - /// Every minute. - /// - EveryMinute, - /// - /// Every 5 minutes. - /// - EveryFiveMinutes, - /// - /// Every 15 minutes. - /// - EveryFiftenMinutes, - /// - /// Every 30 minutes. - /// - EveryThirtyMinutes, - /// - /// Every hour. - /// - EveryHour, - /// - /// Every 3 hours. - /// - EveryThreeHours, - /// - /// Every 6 hours. - /// - EverySixHours, - /// - /// Every 12 hours. - /// - EveryTwelveHours, - /// - /// Every day. - /// - EveryDay - } -} diff --git a/src/Tizen.Applications.WatchApplication/Tizen.Applications/SafeWatchTimeHandle.cs b/src/Tizen.Applications.WatchApplication/Tizen.Applications/SafeWatchTimeHandle.cs deleted file mode 100755 index f87501cdc..000000000 --- a/src/Tizen.Applications.WatchApplication/Tizen.Applications/SafeWatchTimeHandle.cs +++ /dev/null @@ -1,45 +0,0 @@ -/* - * 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; - -namespace Tizen.Applications -{ - internal sealed class SafeWatchTimeHandle : SafeHandle - { - internal SafeWatchTimeHandle() : base(IntPtr.Zero, true) - { - } - - internal SafeWatchTimeHandle(IntPtr existingHandle, bool ownHandle) : base(IntPtr.Zero, ownHandle) - { - SetHandle(existingHandle); - } - - public override bool IsInvalid - { - get { return this.handle == IntPtr.Zero; } - } - - protected override bool ReleaseHandle() - { - Interop.Watch.WatchTimeDelete(this.handle); - this.SetHandle(IntPtr.Zero); - return true; - } - } -} \ No newline at end of file diff --git a/src/Tizen.Applications.WatchApplication/Tizen.Applications/TimeEventArgs.cs b/src/Tizen.Applications.WatchApplication/Tizen.Applications/TimeEventArgs.cs deleted file mode 100755 index 1d100fed9..000000000 --- a/src/Tizen.Applications.WatchApplication/Tizen.Applications/TimeEventArgs.cs +++ /dev/null @@ -1,35 +0,0 @@ -/* - * 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.Applications -{ - /// - /// Arguments for the event that reaised when the time tick comes. - /// - public class TimeEventArgs : EventArgs - { - /// - /// The received WatchTime. - /// - public WatchTime Time { get; internal set; } - - internal TimeEventArgs() - { - } - } -} diff --git a/src/Tizen.Applications.WatchApplication/Tizen.Applications/TimeTickResolution.cs b/src/Tizen.Applications.WatchApplication/Tizen.Applications/TimeTickResolution.cs deleted file mode 100755 index 79c1b290d..000000000 --- a/src/Tizen.Applications.WatchApplication/Tizen.Applications/TimeTickResolution.cs +++ /dev/null @@ -1,39 +0,0 @@ -/* - * 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.Applications -{ - /// - /// Enumeration for Time tick resolution. - /// - public enum TimeTickResolution - { - /// - /// 1 ~ 60 ticks per second. - /// - TimeTicksPerSecond, - /// - /// 1 ~ 60 ticks per minute. - /// - TimeTicksPerMinute, - /// - /// 1 ~ 60 ticks per hour. - /// - TimeTicksPerHour - } -} diff --git a/src/Tizen.Applications.WatchApplication/Tizen.Applications/WatchApplication.cs b/src/Tizen.Applications.WatchApplication/Tizen.Applications/WatchApplication.cs deleted file mode 100755 index 43cdbcab9..000000000 --- a/src/Tizen.Applications.WatchApplication/Tizen.Applications/WatchApplication.cs +++ /dev/null @@ -1,343 +0,0 @@ -/* - * 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.Applications.CoreBackend; -using ElmSharp; - -namespace Tizen.Applications -{ - /// - /// The class that represents a Tizen watch application. - /// - public class WatchApplication : CoreApplication - { - /// - /// Initialize the WatchApplication class - /// - /// - /// Default backend for Watch application will be used. - /// - public WatchApplication() : base(new WatchCoreBackend()) - { - } - - /// - /// Initialize the WatchApplication class - /// - /// - /// If want to change the backend , use this constructor - /// - /// The backend instance implementing ICoreBackend interface. - public WatchApplication(ICoreBackend backend) : base(backend) - { - } - - /// - /// Instance for the window - /// - protected Window Window; - - /// - /// Occurs whenever the application is resumed. - /// - public event EventHandler Resumed; - - /// - /// Occurs whenever the application is paused. - /// - public event EventHandler Paused; - - /// - /// Occurs whenever the time tick comes. - /// - public event EventHandler TimeTick; - - /// - /// Occurs whenever the time tick comes in ambient mode. - /// - public event EventHandler AmbientTick; - - /// - /// Occurs when the ambient mode is changed. - /// - public event EventHandler AmbientChanged; - - /// - /// Runs the UI applications' main loop. - /// - /// Arguments from commandline. - public override void Run(string[] args) - { - Backend.AddEventHandler(EventType.Resumed, OnResume); - Backend.AddEventHandler(EventType.Paused, OnPause); - - Backend.AddEventHandler(WatchEventType.TimeTick, OnTick); - Backend.AddEventHandler(WatchEventType.AmbientTick, OnAmbientTick); - Backend.AddEventHandler(WatchEventType.AmbientChanged, OnAmbientChanged); - - base.Run(args); - } - - /// - /// Overrides this method if want to handle behavior when the application is launched. - /// If base.OnCreate() is not called, the event 'Created' will not be emitted. - /// - protected override void OnCreate() - { - base.OnCreate(); - IntPtr win; - - Interop.Watch.GetWin(out win); - Window = new WatchWindow(win); - Window.Show(); - } - - /// - /// Overrides this method if want to handle behavior when the application is resumed. - /// If base.OnResume() is not called, the event 'Resumed' will not be emitted. - /// - protected virtual void OnResume() - { - Resumed?.Invoke(this, EventArgs.Empty); - } - - /// - /// Overrides this method if want to handle behavior when the application is paused. - /// If base.OnPause() is not called, the event 'Paused' will not be emitted. - /// - protected virtual void OnPause() - { - Paused?.Invoke(this, EventArgs.Empty); - } - - /// - /// Overrides this method if want to handle behavior when the time tick event comes. - /// If base.OnTick() is not called, the event 'TimeTick' will not be emitted. - /// - /// The received TimeEventArgs to get time information. - protected virtual void OnTick(TimeEventArgs time) - { - TimeTick?.Invoke(this, time); - } - - /// - /// Overrides this method if want to handle behavior when the time tick event comes in ambient mode. - /// If base.OnAmbientTick() is not called, the event 'AmbientTick' will not be emitted. - /// - /// The received TimeEventArgs to get time information. - /// http://tizen.org/privilege/alarm.set - protected virtual void OnAmbientTick(TimeEventArgs time) - { - AmbientTick?.Invoke(this, time); - } - - /// - /// Overrides this method if want to handle behavior when the ambient mode is changed. - /// If base.OnAmbientChanged() is not called, the event 'AmbientChanged' will not be emitted. - /// - /// The received AmbientEventArgs - protected virtual void OnAmbientChanged(AmbientEventArgs mode) - { - AmbientChanged?.Invoke(this, mode); - } - - /// - /// Gets the current time - /// - /// WatchTime - /// Thrown when failed to get current time because of invalid parameter. - /// Thrown when failed to get current time because memory is not enough. - /// - /// - /// class MyApp : WatchApplication - /// { - /// ... - /// public void TestMethod() - /// { - /// WatchTime wt; - /// try - /// { - /// wt = GetCurrentTime(); - /// } - /// catch - /// { - /// } - /// } - /// } - /// - /// - protected WatchTime GetCurrentTime() - { - SafeWatchTimeHandle handle; - - Interop.Watch.ErrorCode err = Interop.Watch.WatchTimeGetCurrentTime(out handle); - if (err != Interop.Watch.ErrorCode.None) - { - if (err == Interop.Watch.ErrorCode.InvalidParameter) - throw new InvalidOperationException("Failed to get current time. err : " + err); - else if (err == Interop.Watch.ErrorCode.OutOfMemory) - throw new OutOfMemoryException("Failed to get current time. err : " + err); - } - return new WatchTime(handle); - } - - /// - /// Gets the type of periodic ambient tick. - /// - /// AmbientTickType - /// Thrown when failed to get ambient tick type. - /// - /// - /// class MyApp : WatchApplication - /// { - /// ... - /// public void TestMethod() - /// { - /// AmbientTickType atType; - /// try - /// { - /// atType = GetAmbientTickType(); - /// } - /// catch - /// { - /// } - /// } - /// } - /// - /// - protected AmbientTickType GetAmbientTickType() - { - AmbientTickType ambientTickType; - - Interop.Watch.ErrorCode err = Interop.Watch.GetAmbientTickType(out ambientTickType); - - if(err != Interop.Watch.ErrorCode.None) - { - throw new InvalidOperationException("Failed to get ambient tick type. err : " + err); - } - - return ambientTickType; - } - - /// - /// Sets the type of periodic ambient tick. - /// OnAmbientTick will be called following settings. - /// If SetAmbientTickType is not called, OnAmbientTick will be called every minute. - /// - /// the type of ambient tick - /// Thrown when failed to set ambient tick type. - /// - /// - /// class MyApp : WatchApplication - /// { - /// ... - /// public void TestMethod() - /// { - /// try - /// { - /// SetAmbientTickType(AmbientTickType.EveryMinute); - /// } - /// catch - /// { - /// } - /// } - /// } - /// - /// - protected void SetAmbientTickType(AmbientTickType ambientTickType) - { - Interop.Watch.ErrorCode err = Interop.Watch.SetAmbientTickType(ambientTickType); - - if(err != Interop.Watch.ErrorCode.None) - { - throw new InvalidOperationException("Failed to set ambient tick type. err : " + err); - } - } - - /// - /// Sets the frequency of time tick. - /// OnTick will be called following settings. - /// If SetTimeTickFrequency is not called, OnTick will be called every second. - /// - /// Ticks the number of ticks per given resolution type - /// Type of the resolution type - /// Thrown when failed to set time tick frequency. - /// - /// - /// class MyApp : WatchApplication - /// { - /// ... - /// public void TestMethod() - /// { - /// try - /// { - /// SetTimeTickFrequency(1, TimeTickResolution.TimeTicksPerMinute); - /// } - /// catch - /// { - /// } - /// } - /// } - /// - /// - protected void SetTimeTickFrequency(int ticks, TimeTickResolution type) - { - Interop.Watch.ErrorCode err = Interop.Watch.SetTimeTickFrequency(ticks, type); - - if (err != Interop.Watch.ErrorCode.None) - { - throw new InvalidOperationException("Failed to set time tick frequency. err : " + err); - } - } - - /// - /// Gets the frequency fo time tick. - /// - /// Ticks the number of ticks per given resolution type - /// Type of the resolution type - /// Thrown when failed to get time tick frequency. - /// - /// - /// class MyApp : WatchApplication - /// { - /// ... - /// public void TestMethod() - /// { - /// int tick; - /// TimeTickResolution tType; - /// try - /// { - /// GetTimeTickFrequency(out tick, out tType); - /// } - /// catch - /// { - /// } - /// } - /// } - /// - /// - protected void GetTimeTickFrequency(out int ticks, out TimeTickResolution type) - { - Interop.Watch.ErrorCode err = Interop.Watch.GetTimeTickFrequency(out ticks, out type); - - if (err != Interop.Watch.ErrorCode.None) - { - throw new InvalidOperationException("Failed to get time tick frequency. err : " + err); - } - } - } -} diff --git a/src/Tizen.Applications.WatchApplication/Tizen.Applications/WatchTime.cs b/src/Tizen.Applications.WatchApplication/Tizen.Applications/WatchTime.cs deleted file mode 100755 index 94ce435a4..000000000 --- a/src/Tizen.Applications.WatchApplication/Tizen.Applications/WatchTime.cs +++ /dev/null @@ -1,234 +0,0 @@ -/* - * 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.Applications -{ - /// - /// The information of Watch Time - /// - public class WatchTime - { - private readonly SafeWatchTimeHandle _handle; - private static readonly string LOGTAG = "Tizen.Applications.WatchApplication"; - - internal WatchTime(SafeWatchTimeHandle handle) - { - _handle = handle; - } - - /// - /// The information of year - /// - public int Year - { - get - { - int year; - Interop.Watch.ErrorCode err = Interop.Watch.WatchTimeGetYear(_handle, out year); - - if (err != Interop.Watch.ErrorCode.None) - { - Log.Error(LOGTAG, "Failed to get Year err : " + err); - } - return year; - } - } - - /// - /// The information fo month - /// - public int Month - { - get - { - int month; - Interop.Watch.ErrorCode err = Interop.Watch.WatchTimeGetMonth(_handle, out month); - - if (err != Interop.Watch.ErrorCode.None) - { - Log.Error(LOGTAG, "Failed to get Month err : " + err); - } - return month; - } - } - - /// - /// The information of day - /// - public int Day - { - get - { - int day; - Interop.Watch.ErrorCode err = Interop.Watch.WatchTimeGetDay(_handle, out day); - - if (err != Interop.Watch.ErrorCode.None) - { - Log.Error(LOGTAG, "Failed to get Day err : " + err); - } - return day; - } - } - - /// - /// The information of day of week - /// - public int DayOfWeek - { - get - { - int dayOfWeek; - Interop.Watch.ErrorCode err = Interop.Watch.WatchTimeGetDayOfWeek(_handle, out dayOfWeek); - - if (err != Interop.Watch.ErrorCode.None) - { - Log.Error(LOGTAG, "Failed to get Second err : " + err); - } - return dayOfWeek; - } - } - - /// - /// The information of hour - /// - public int Hour - { - get - { - int hour; - Interop.Watch.ErrorCode err = Interop.Watch.WatchTimeGetHour(_handle, out hour); - - if (err != Interop.Watch.ErrorCode.None) - { - Log.Error(LOGTAG, "Failed to get Hour err : " + err); - } - return hour; - } - } - - /// - /// The information of hour for 24 hour form - /// - public int Hour24 - { - get - { - int hour24; - Interop.Watch.ErrorCode err = Interop.Watch.WatchTimeGetHour24(_handle, out hour24); - - if (err != Interop.Watch.ErrorCode.None) - { - Log.Error(LOGTAG, "Failed to get Hour24 err : " + err); - } - return hour24; - } - } - - /// - /// The information of Minute - /// - public int Minute - { - get - { - int minute; - Interop.Watch.ErrorCode err = Interop.Watch.WatchTimeGetMinute(_handle, out minute); - - if (err != Interop.Watch.ErrorCode.None) - { - Log.Error(LOGTAG, "Failed to get Minute err : " + err); - } - return minute; - } - } - - /// - /// The information of second - /// - public int Second - { - get - { - int second; - Interop.Watch.ErrorCode err = Interop.Watch.WatchTimeGetSecond(_handle, out second); - - if (err != Interop.Watch.ErrorCode.None) - { - Log.Error(LOGTAG, "Failed to get Second err : " + err); - } - return second; - } - } - - /// - /// The information of millisecond - /// - public int Millisecond - { - get - { - int ms; - Interop.Watch.ErrorCode err = Interop.Watch.WatchTimeGetMillisecond(_handle, out ms); - - if (err != Interop.Watch.ErrorCode.None) - { - Log.Error(LOGTAG, "Failed to get Second err : " + err); - } - return ms; - } - } - - /// - /// The information of timezone - /// - public string TimeZone - { - get - { - string zone; - Interop.Watch.ErrorCode err = Interop.Watch.WatchTimeGetTimeZone(_handle, out zone); - - if (err != Interop.Watch.ErrorCode.None) - { - Log.Error(LOGTAG, "Failed to get Second err : " + err); - } - return zone; - } - } - - /// - /// The information of UTC time stamp - /// - public DateTime UtcTimestamp - { - get - { - long ts = 0; - - Interop.Watch.ErrorCode err = Interop.Watch.WatchTimeGetUtcTimestamp(_handle, out ts); - - if (err != Interop.Watch.ErrorCode.None) - { - Log.Error(LOGTAG, "Failed to get UtcTimestamp err : " + err); - } - - return (new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc)).AddSeconds(ts).ToLocalTime(); - } - } - } -} diff --git a/src/Tizen.Applications.WatchApplication/Tizen.Applications/WatchWindow.cs b/src/Tizen.Applications.WatchApplication/Tizen.Applications/WatchWindow.cs deleted file mode 100755 index ef9ac4503..000000000 --- a/src/Tizen.Applications.WatchApplication/Tizen.Applications/WatchWindow.cs +++ /dev/null @@ -1,37 +0,0 @@ -/* - * 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 ElmSharp; -using System; - -namespace Tizen.Applications -{ - internal class WatchWindow : Window - { - private IntPtr _handle; - - internal WatchWindow(IntPtr handle) : base() - { - _handle = handle; - Realize(null); - } - - protected override IntPtr CreateHandle(EvasObject parent) - { - return _handle; - } - } -} \ No newline at end of file diff --git a/src/Tizen.Applications.WidgetApplication/Interop/Interop.Libraries.cs b/src/Tizen.Applications.WidgetApplication/Interop/Interop.Libraries.cs deleted file mode 100755 index 7b43b3837..000000000 --- a/src/Tizen.Applications.WidgetApplication/Interop/Interop.Libraries.cs +++ /dev/null @@ -1,25 +0,0 @@ -/* - * 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 AppCommon = "libcapi-appfw-app-common.so.0"; - public const string AppcoreWidget = "libcapi-appfw-widget-application.so.1"; - public const string WidgetService = "libwidget_service.so.1"; - } -} diff --git a/src/Tizen.Applications.WidgetApplication/Interop/Interop.Widget.cs b/src/Tizen.Applications.WidgetApplication/Interop/Interop.Widget.cs deleted file mode 100755 index 390227d2a..000000000 --- a/src/Tizen.Applications.WidgetApplication/Interop/Interop.Widget.cs +++ /dev/null @@ -1,140 +0,0 @@ -/* - * 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; - -using Tizen.Applications; - -internal static partial class Interop -{ - internal static partial class Widget - { - internal enum WidgetAppDestroyType - { - Permanent = 0, - Temporary - } - - internal enum AppEventType - { - LowMemory = 0, - LowBattery, - LanguageChanged, - DeviceOrientationChanged, - RegionFormatChanged, - SuspendedStateChanged - } - - internal enum ErrorCode : int - { - None = Tizen.Internals.Errors.ErrorCode.None, - InvalidParameter = Tizen.Internals.Errors.ErrorCode.InvalidParameter, - OutOfMemory = Tizen.Internals.Errors.ErrorCode.OutOfMemory, - ResourceBusy = Tizen.Internals.Errors.ErrorCode.ResourceBusy, - PermissionDenied = Tizen.Internals.Errors.ErrorCode.PermissionDenied, - Canceled = Tizen.Internals.Errors.ErrorCode.Canceled, - IoError = Tizen.Internals.Errors.ErrorCode.IoError, - TimedOut = Tizen.Internals.Errors.ErrorCode.TimedOut, - NotSupported = Tizen.Internals.Errors.ErrorCode.NotSupported, - FileNoSpaceOnDevice = Tizen.Internals.Errors.ErrorCode.FileNoSpaceOnDevice, - Fault = -0x02F40000 | 0x0001, - AlreadyExist = -0x02F40000 | 0x0002, - AlreadyStarted = -0x02F40000 | 0x0004, - NotExist = -0x02F40000 | 0x0008, - Disabled = -0x02F40000 | 0x0010, - MaxExceeded = -0x02F40000 | 0x0011, - } - - internal delegate void AppEventCallback(IntPtr handle, IntPtr data); - - internal delegate IntPtr WidgetAppCreateCallback(IntPtr userData); - - internal delegate void WidgetAppTerminateCallback(IntPtr userData); - - internal delegate int WidgetInstanceCreateCallback(IntPtr context, IntPtr content, int w, int h, IntPtr userData); - - internal delegate int WidgetInstanceDestroyCallback(IntPtr context, WidgetAppDestroyType reason, IntPtr content, IntPtr userData); - - internal delegate int WidgetInstancePauseCallback(IntPtr context, IntPtr userData); - - internal delegate int WidgetInstanceResumeCallback(IntPtr context, IntPtr userData); - - internal delegate int WidgetInstanceResizeCallback(IntPtr context, int w, int h, IntPtr userData); - - internal delegate int WidgetInstanceUpdateCallback(IntPtr context, IntPtr content, int force, IntPtr userData); - - [DllImport(Libraries.AppcoreWidget, EntryPoint = "widget_app_main")] - internal static extern ErrorCode Main(int argc, string[] argv, ref WidgetAppLifecycleCallbacks callback, IntPtr userData); - - [DllImport(Libraries.AppcoreWidget, EntryPoint = "widget_app_exit")] - internal static extern void Exit(); - - [DllImport(Libraries.AppcoreWidget, EntryPoint = "widget_app_add_event_handler")] - internal static extern ErrorCode AddEventHandler(out IntPtr handle, AppEventType eventType, AppEventCallback callback, IntPtr data); - - [DllImport(Libraries.AppcoreWidget, EntryPoint = "widget_app_remove_event_handler")] - internal static extern ErrorCode RemoveEventHandler(IntPtr handle); - - [DllImport(Libraries.AppcoreWidget, EntryPoint = "widget_app_class_create")] - internal static extern IntPtr CreateClass(WidgetiInstanceLifecycleCallbacks callback, IntPtr userData); - - [DllImport(Libraries.AppcoreWidget, EntryPoint = "widget_app_class_add")] - internal static extern IntPtr AddClass(IntPtr handle, string classId, WidgetiInstanceLifecycleCallbacks callback, IntPtr userData); - - [DllImport(Libraries.AppcoreWidget, EntryPoint = "widget_app_terminate_context")] - internal static extern ErrorCode TerminateContext(IntPtr handle); - - [DllImport(Libraries.AppcoreWidget, EntryPoint = "widget_app_context_set_content_info")] - internal static extern ErrorCode SetContent(IntPtr handle, SafeBundleHandle content); - - [DllImport(Libraries.AppcoreWidget, EntryPoint = "widget_app_context_set_title")] - internal static extern ErrorCode SetTitle(IntPtr handle, string title); - - [DllImport(Libraries.AppcoreWidget, EntryPoint = "widget_app_get_elm_win")] - internal static extern ErrorCode GetWin(IntPtr handle, out IntPtr win); - - [DllImport(Libraries.AppCommon, EntryPoint = "app_event_get_low_memory_status")] - internal static extern Tizen.Internals.Errors.ErrorCode AppEventGetLowMemoryStatus(IntPtr handle, out LowMemoryStatus status); - - [DllImport(Libraries.AppCommon, EntryPoint = "app_event_get_low_battery_status")] - internal static extern Tizen.Internals.Errors.ErrorCode AppEventGetLowBatteryStatus(IntPtr handle, out LowBatteryStatus status); - - [DllImport(Libraries.AppCommon, EntryPoint = "app_event_get_language")] - internal static extern Tizen.Internals.Errors.ErrorCode AppEventGetLanguage(IntPtr handle, out string lang); - - [DllImport(Libraries.AppCommon, EntryPoint = "app_event_get_region_format")] - internal static extern Tizen.Internals.Errors.ErrorCode AppEventGetRegionFormat(IntPtr handle, out string region); - - [StructLayoutAttribute(LayoutKind.Sequential)] - internal struct WidgetAppLifecycleCallbacks - { - public WidgetAppCreateCallback OnCreate; - public WidgetAppTerminateCallback OnTerminate; - } - - [StructLayoutAttribute(LayoutKind.Sequential)] - internal struct WidgetiInstanceLifecycleCallbacks - { - public WidgetInstanceCreateCallback OnCreate; - public WidgetInstanceDestroyCallback OnDestroy; - public WidgetInstancePauseCallback OnPause; - public WidgetInstanceResumeCallback OnResume; - public WidgetInstanceResizeCallback OnResize; - public WidgetInstanceUpdateCallback OnUpdate; - } - } -} diff --git a/src/Tizen.Applications.WidgetApplication/Tizen.Applications.CoreBackend/WidgetCoreBackend.cs b/src/Tizen.Applications.WidgetApplication/Tizen.Applications.CoreBackend/WidgetCoreBackend.cs deleted file mode 100755 index eee864b64..000000000 --- a/src/Tizen.Applications.WidgetApplication/Tizen.Applications.CoreBackend/WidgetCoreBackend.cs +++ /dev/null @@ -1,238 +0,0 @@ -/* - * 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.Collections.Generic; -using Tizen.Internals.Errors; - -namespace Tizen.Applications.CoreBackend -{ - internal class WidgetCoreBackend : ICoreBackend - { - protected static readonly string LogTag = typeof(WidgetCoreBackend).Namespace; - - private Dictionary _handlers = new Dictionary(); - - private bool _disposedValue = false; - - private Interop.Widget.AppEventCallback _lowMemoryCallback; - private Interop.Widget.AppEventCallback _lowBatteryCallback; - private Interop.Widget.AppEventCallback _localeChangedCallback; - private Interop.Widget.AppEventCallback _regionChangedCallback; - - private IntPtr _lowMemoryEventHandle = IntPtr.Zero; - private IntPtr _lowBatteryEventHandle = IntPtr.Zero; - private IntPtr _localeChangedEventHandle = IntPtr.Zero; - private IntPtr _regionChangedEventHandle = IntPtr.Zero; - - private Interop.Widget.WidgetAppLifecycleCallbacks _callbacks; - - internal IList WidgetTypes = new List(); - - public WidgetCoreBackend() - { - _lowMemoryCallback = new Interop.Widget.AppEventCallback(OnLowMemoryNative); - _lowBatteryCallback = new Interop.Widget.AppEventCallback(OnLowBatteryNative); - _localeChangedCallback = new Interop.Widget.AppEventCallback(OnLocaleChangedNative); - _regionChangedCallback = new Interop.Widget.AppEventCallback(OnRegionChangedNative); - - _callbacks.OnCreate = new Interop.Widget.WidgetAppCreateCallback(OnCreateNative); - _callbacks.OnTerminate = new Interop.Widget.WidgetAppTerminateCallback(OnTerminateNative); - } - - ~WidgetCoreBackend() - { - Dispose(false); - } - - internal void CreateWidgetTypes(IDictionary typeInfo) - { - foreach (Type w in typeInfo.Keys) - { - WidgetTypes.Add(new WidgetType(w, typeInfo[w])); - } - } - - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - - protected virtual void Dispose(bool disposing) - { - if (!_disposedValue) - { - if (disposing) - { - // Release disposable objects - } - - if (_lowMemoryEventHandle != IntPtr.Zero) - { - Interop.Widget.RemoveEventHandler(_lowMemoryEventHandle); - } - if (_lowBatteryEventHandle != IntPtr.Zero) - { - Interop.Widget.RemoveEventHandler(_lowBatteryEventHandle); - } - if (_localeChangedEventHandle != IntPtr.Zero) - { - Interop.Widget.RemoveEventHandler(_localeChangedEventHandle); - } - if (_regionChangedEventHandle != IntPtr.Zero) - { - Interop.Widget.RemoveEventHandler(_regionChangedEventHandle); - } - - _disposedValue = true; - } - } - - public void Exit() - { - Interop.Widget.Exit(); - } - - public void Run(string[] args) - { - Interop.Widget.ErrorCode err = Interop.Widget.ErrorCode.None; - err = Interop.Widget.AddEventHandler(out _lowMemoryEventHandle, Interop.Widget.AppEventType.LowMemory, _lowMemoryCallback, IntPtr.Zero); - if (err != Interop.Widget.ErrorCode.None) - { - Log.Error(LogTag, "Failed to add event handler for LowMemory event. Err = " + err); - } - err = Interop.Widget.AddEventHandler(out _lowBatteryEventHandle, Interop.Widget.AppEventType.LowBattery, _lowBatteryCallback, IntPtr.Zero); - if (err != Interop.Widget.ErrorCode.None) - { - Log.Error(LogTag, "Failed to add event handler for LowBattery event. Err = " + err); - } - - err = Interop.Widget.AddEventHandler(out _localeChangedEventHandle, Interop.Widget.AppEventType.LanguageChanged, _localeChangedCallback, IntPtr.Zero); - if (err != Interop.Widget.ErrorCode.None) - { - Log.Error(LogTag, "Failed to add event handler for LocaleChanged event. Err = " + err); - } - - err = Interop.Widget.AddEventHandler(out _regionChangedEventHandle, Interop.Widget.AppEventType.RegionFormatChanged, _regionChangedCallback, IntPtr.Zero); - if (err != Interop.Widget.ErrorCode.None) - { - Log.Error(LogTag, "Failed to add event handler for RegionFormatChanged event. Err = " + err); - } - - err = Interop.Widget.Main(args.Length, args, ref _callbacks, IntPtr.Zero); - if (err != Interop.Widget.ErrorCode.None) - { - Log.Error(LogTag, "Failed to run the application. Err = " + err); - } - } - - private IntPtr OnCreateNative(IntPtr data) - { - if (_handlers.ContainsKey(EventType.Created)) - { - var handler = _handlers[EventType.Created] as Action; - handler?.Invoke(); - } - - IntPtr h = IntPtr.Zero; - foreach (WidgetType type in WidgetTypes) - h = type.Bind(h); - - return h; - } - - private void OnTerminateNative(IntPtr data) - { - if (_handlers.ContainsKey(EventType.Terminated)) - { - var handler = _handlers[EventType.Terminated] as Action; - handler?.Invoke(); - } - } - - public void AddEventHandler(EventType evType, Action handler) - { - _handlers.Add(evType, handler); - } - - public void AddEventHandler(EventType evType, Action handler) where TEventArgs : EventArgs - { - _handlers.Add(evType, handler); - } - - private void OnLowMemoryNative(IntPtr infoHandle, IntPtr data) - { - LowMemoryStatus status = LowMemoryStatus.None; - ErrorCode err = Interop.Widget.AppEventGetLowMemoryStatus(infoHandle, out status); - if (err != ErrorCode.None) - { - Log.Error(LogTag, "Failed to get memory status. Err = " + err); - } - if (_handlers.ContainsKey(EventType.LowMemory)) - { - var handler = _handlers[EventType.LowMemory] as Action; - handler?.Invoke(new LowMemoryEventArgs(status)); - } - } - - private void OnLowBatteryNative(IntPtr infoHandle, IntPtr data) - { - LowBatteryStatus status = LowBatteryStatus.None; - ErrorCode err = Interop.Widget.AppEventGetLowBatteryStatus(infoHandle, out status); - if (err != ErrorCode.None) - { - Log.Error(LogTag, "Failed to get battery status. Err = " + err); - } - if (_handlers.ContainsKey(EventType.LowBattery)) - { - var handler = _handlers[EventType.LowBattery] as Action; - handler?.Invoke(new LowBatteryEventArgs(status)); - } - } - - private void OnLocaleChangedNative(IntPtr infoHandle, IntPtr data) - { - string lang; - ErrorCode err = Interop.Widget.AppEventGetLanguage(infoHandle, out lang); - if (err != ErrorCode.None) - { - Log.Error(LogTag, "Failed to get changed language. Err = " + err); - } - if (_handlers.ContainsKey(EventType.LocaleChanged)) - { - var handler = _handlers[EventType.LocaleChanged] as Action; - handler?.Invoke(new LocaleChangedEventArgs(lang)); - } - } - - private void OnRegionChangedNative(IntPtr infoHandle, IntPtr data) - { - string region; - ErrorCode err = Interop.Widget.AppEventGetRegionFormat(infoHandle, out region); - if (err != ErrorCode.None) - { - Log.Error(LogTag, "Failed to get changed region format. Err = " + err); - } - if (_handlers.ContainsKey(EventType.RegionFormatChanged)) - { - var handler = _handlers[EventType.RegionFormatChanged] as Action; - handler?.Invoke(new RegionFormatChangedEventArgs(region)); - } - } - - } -} diff --git a/src/Tizen.Applications.WidgetApplication/Tizen.Applications.WidgetApplication.csproj b/src/Tizen.Applications.WidgetApplication/Tizen.Applications.WidgetApplication.csproj deleted file mode 100644 index e56b74e97..000000000 --- a/src/Tizen.Applications.WidgetApplication/Tizen.Applications.WidgetApplication.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - netstandard2.0 - - - - - - - - diff --git a/src/Tizen.Applications.WidgetApplication/Tizen.Applications.WidgetApplication.sln b/src/Tizen.Applications.WidgetApplication/Tizen.Applications.WidgetApplication.sln deleted file mode 100755 index 0fb9d731b..000000000 --- a/src/Tizen.Applications.WidgetApplication/Tizen.Applications.WidgetApplication.sln +++ /dev/null @@ -1,46 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26430.12 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Applications.WidgetApplication", "Tizen.Applications.WidgetApplication.csproj", "{9E43466E-58AB-416C-98DB-9B576706223F}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ElmSharp", "..\ElmSharp\ElmSharp.csproj", "{B4B467DD-7FE6-433F-B759-01AA60A9F4DD}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen", "..\Tizen\Tizen.csproj", "{747177C6-A318-4C78-9248-841178EDB499}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Log", "..\Tizen.Log\Tizen.Log.csproj", "{63FAA012-D280-4BD3-9069-0FA056F688D7}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Applications.Common", "..\Tizen.Applications.Common\Tizen.Applications.Common.csproj", "{248EA228-52A0-4A65-B236-2311C8895DEB}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {9E43466E-58AB-416C-98DB-9B576706223F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {9E43466E-58AB-416C-98DB-9B576706223F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {9E43466E-58AB-416C-98DB-9B576706223F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {9E43466E-58AB-416C-98DB-9B576706223F}.Release|Any CPU.Build.0 = Release|Any CPU - {B4B467DD-7FE6-433F-B759-01AA60A9F4DD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B4B467DD-7FE6-433F-B759-01AA60A9F4DD}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B4B467DD-7FE6-433F-B759-01AA60A9F4DD}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B4B467DD-7FE6-433F-B759-01AA60A9F4DD}.Release|Any CPU.Build.0 = Release|Any CPU - {747177C6-A318-4C78-9248-841178EDB499}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {747177C6-A318-4C78-9248-841178EDB499}.Debug|Any CPU.Build.0 = Debug|Any CPU - {747177C6-A318-4C78-9248-841178EDB499}.Release|Any CPU.ActiveCfg = Release|Any CPU - {747177C6-A318-4C78-9248-841178EDB499}.Release|Any CPU.Build.0 = Release|Any CPU - {63FAA012-D280-4BD3-9069-0FA056F688D7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {63FAA012-D280-4BD3-9069-0FA056F688D7}.Debug|Any CPU.Build.0 = Debug|Any CPU - {63FAA012-D280-4BD3-9069-0FA056F688D7}.Release|Any CPU.ActiveCfg = Release|Any CPU - {63FAA012-D280-4BD3-9069-0FA056F688D7}.Release|Any CPU.Build.0 = Release|Any CPU - {248EA228-52A0-4A65-B236-2311C8895DEB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {248EA228-52A0-4A65-B236-2311C8895DEB}.Debug|Any CPU.Build.0 = Debug|Any CPU - {248EA228-52A0-4A65-B236-2311C8895DEB}.Release|Any CPU.ActiveCfg = Release|Any CPU - {248EA228-52A0-4A65-B236-2311C8895DEB}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/src/Tizen.Applications.WidgetApplication/Tizen.Applications/WidgetApplication.cs b/src/Tizen.Applications.WidgetApplication/Tizen.Applications/WidgetApplication.cs deleted file mode 100755 index ba8edc14e..000000000 --- a/src/Tizen.Applications.WidgetApplication/Tizen.Applications/WidgetApplication.cs +++ /dev/null @@ -1,82 +0,0 @@ -/* - * 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.Collections.Generic; -using Tizen.Applications.CoreBackend; - -namespace Tizen.Applications -{ - /// - /// Represents a widget application. - /// - public class WidgetApplication : CoreApplication - { - /// - /// Initializes the WidgetApplication class with the type and application ID. - /// - /// Map structure for the derived class type and widget ID. - public WidgetApplication(IDictionary typeInfo) : base(new WidgetCoreBackend()) - { - WidgetCoreBackend core = Backend as WidgetCoreBackend; - - core?.CreateWidgetTypes(typeInfo); - } - - /// - /// Initializes the WidgetApplication class with the type. - /// - /// Widget ID will be replaced as the application ID. - /// Derived class type. - public WidgetApplication(Type type) : base(new WidgetCoreBackend()) - { - WidgetCoreBackend core = Backend as WidgetCoreBackend; - - core?.CreateWidgetTypes(new Dictionary() { {type, ApplicationInfo.ApplicationId } }); - } - - /// - /// Gets all instances of the widget associated with the type. - /// - /// Class type for the widget. - public IEnumerable GetInstances(Type type) - { - WidgetCoreBackend core = Backend as WidgetCoreBackend; - - if (core == null) - return null; - - foreach (WidgetType w in core.WidgetTypes) - { - if (w.ClassType == type) - { - return w.WidgetInstances; - } - } - - return null; - } - - /// - /// Runs the widget application's main loop. - /// - /// Arguments from the commandline. - public override void Run(string[] args) - { - base.Run(args); - } - } -} diff --git a/src/Tizen.Applications.WidgetApplication/Tizen.Applications/WidgetBase.cs b/src/Tizen.Applications.WidgetApplication/Tizen.Applications/WidgetBase.cs deleted file mode 100755 index 663933f21..000000000 --- a/src/Tizen.Applications.WidgetApplication/Tizen.Applications/WidgetBase.cs +++ /dev/null @@ -1,210 +0,0 @@ -/* - * 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 ElmSharp; -using System; - -namespace Tizen.Applications -{ - /// - /// The abstract class for widget instances. - /// - public abstract class WidgetBase - { - internal IntPtr Handle; - internal string Id; - protected static readonly string LogTag = typeof(WidgetBase).Namespace; - - /// - /// Window object for this widget instance. - /// It will be created after OnCreate method is invoked. - /// - protected Window Window; - - /// - /// Delete type. - /// - public enum WidgetDestroyType - { - /// - /// User deleted this widget from the viewer. - /// - Permanent = 0, - - /// - /// Widget is deleted because of other reasons. (For example, widget process is terminated temporarily by the system) - /// - Temporary - } - - /// - /// Constructor. - /// - public WidgetBase() - { - } - - /// - /// Sets the content information to the widget. - /// - /// The data set to save. - /// Thrown when failed because of an invalid argument. - /// Thrown when the API is not supported in this device. - /// Thrown in case of an unrecoverable error. - public void SetContent(Bundle info) - { - Interop.Widget.ErrorCode err = Interop.Widget.SetContent(Handle, info.SafeBundleHandle); - - if (err != Interop.Widget.ErrorCode.None) - { - Log.Error(LogTag, "Failed to set content. Err = " + err); - - switch(err) - { - case Interop.Widget.ErrorCode.InvalidParameter: - throw new ArgumentException("Invalid parameter of SetContent()"); - - case Interop.Widget.ErrorCode.NotSupported: - throw new NotSupportedException(); - - case Interop.Widget.ErrorCode.OutOfMemory: - case Interop.Widget.ErrorCode.Fault: - throw new InvalidOperationException(); - } - - } - } - - /// - /// Sends the title to the widget. - /// - /// When an accessibility mode is turned on, this string will be read. - /// Thrown when failed because of an invalid argument. - /// Thrown when the API is not supported in this device. - /// Thrown in case of an unrecoverable error. - public void SetTitle(string title) - { - Interop.Widget.ErrorCode err = Interop.Widget.SetTitle(Handle, title); - - if (err != Interop.Widget.ErrorCode.None) - { - Log.Error(LogTag, "Failed to set title. Err = " + err); - - switch (err) - { - case Interop.Widget.ErrorCode.InvalidParameter: - throw new ArgumentException("Invalid parameter of SetContent()"); - - case Interop.Widget.ErrorCode.NotSupported: - throw new NotSupportedException(); - - case Interop.Widget.ErrorCode.OutOfMemory: - case Interop.Widget.ErrorCode.Fault: - throw new InvalidOperationException(); - } - } - } - - /// - /// Finishes the context for the widget instance. - /// - /// Thrown when the API is not supported in this device. - /// Thrown in case of an unrecoverable error. - public void Exit() - { - Interop.Widget.ErrorCode err = Interop.Widget.TerminateContext(Handle); - - if (err != Interop.Widget.ErrorCode.None) - { - Log.Error(LogTag, "Failed to terminate context. Err = " + err); - - switch (err) - { - case Interop.Widget.ErrorCode.NotSupported: - throw new NotSupportedException(); - - case Interop.Widget.ErrorCode.InvalidParameter: - case Interop.Widget.ErrorCode.Fault: - throw new InvalidOperationException(); - } - } - } - - internal void Bind(IntPtr handle, string id) - { - Handle = handle; - Id = id; - } - - /// - /// Overrides this method if want to handle the behavior when the widget instance is started. - /// - /// The data set for the previous status. - /// The pixel value for the widget width. - /// The pixel value for the widget height. - public virtual void OnCreate(Bundle content, int w, int h) - { - IntPtr win; - - Interop.Widget.GetWin(Handle, out win); - Window = new WidgetWindow(win); - Window.Resize(w, h); - Window.Show(); - } - - /// - /// Overrides this method if want to handle the behavior when the widget instance is destroyed. - /// - /// The reason for destruction. - /// The data set to save. - public virtual void OnDestroy(WidgetDestroyType reason, Bundle content) - { - } - - /// - /// Overrides this method if want to handle the behavior when the widget instance is paused. - /// - public virtual void OnPause() - { - } - - /// - /// Overrides this method if want to handle the behavior when the widget instance is resumed. - /// - public virtual void OnResume() - { - } - - /// - /// Overrides this method if want to handle the behavior when the widget instance is resized. - /// - /// Widget width. - /// Widget height. - public virtual void OnResize(int w, int h) - { - } - - /// - /// Overrides this method if want to handle the behavior when the widget instance is updated. - /// - /// The data set for updating this widget will be provided by the requester. - /// Although the widget is paused, if it is true, the widget can be updated. - public virtual void OnUpdate(Bundle content, bool isForce) - { - } - - } -} diff --git a/src/Tizen.Applications.WidgetApplication/Tizen.Applications/WidgetType.cs b/src/Tizen.Applications.WidgetApplication/Tizen.Applications/WidgetType.cs deleted file mode 100755 index c19e81ee4..000000000 --- a/src/Tizen.Applications.WidgetApplication/Tizen.Applications/WidgetType.cs +++ /dev/null @@ -1,143 +0,0 @@ -/* - * 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.Collections.Generic; - -namespace Tizen.Applications -{ - internal class WidgetType - { - internal readonly Type ClassType; - internal readonly string Id; - internal IList WidgetInstances = new List(); - - private Interop.Widget.WidgetiInstanceLifecycleCallbacks _callbacks; - - internal WidgetType(Type ctype, string id) - { - ClassType = ctype; - Id = id; - _callbacks.OnCreate = new Interop.Widget.WidgetInstanceCreateCallback(OnCreate); - _callbacks.OnDestroy = new Interop.Widget.WidgetInstanceDestroyCallback(OnDestroy); - _callbacks.OnPause = new Interop.Widget.WidgetInstancePauseCallback(OnPause); - _callbacks.OnResume = new Interop.Widget.WidgetInstanceResumeCallback(OnResume); - _callbacks.OnResize = new Interop.Widget.WidgetInstanceResizeCallback(OnResize); - _callbacks.OnUpdate = new Interop.Widget.WidgetInstanceUpdateCallback(OnUpdate); - } - - internal IntPtr Bind(IntPtr h) - { - return Interop.Widget.AddClass(h, Id, _callbacks, IntPtr.Zero); - } - - private int OnCreate(IntPtr context, IntPtr content, int w, int h, IntPtr userData) - { - WidgetBase b = Activator.CreateInstance(ClassType) as WidgetBase; - Bundle bundle = null; - - if (b == null) - return 0; - - b.Bind(context, Id); - WidgetInstances.Add(b); - if (content != IntPtr.Zero) - bundle = new Bundle(new SafeBundleHandle(content, false)); - b.OnCreate(bundle, w, h); - - return 0; - } - - private int OnDestroy(IntPtr context, Interop.Widget.WidgetAppDestroyType reason, IntPtr content, IntPtr userData) - { - foreach (WidgetBase w in WidgetInstances) - { - if(w.Handle == context) - { - Bundle bundle = null; - - if (content != IntPtr.Zero) - bundle = new Bundle(new SafeBundleHandle(content, false)); - - w.OnDestroy(reason == Interop.Widget.WidgetAppDestroyType.Permanent ? - WidgetBase.WidgetDestroyType.Permanent : - WidgetBase.WidgetDestroyType.Temporary, bundle); - WidgetInstances.Remove(w); - break; - } - } - - return 0; - } - - private int OnPause(IntPtr context, IntPtr userData) - { - foreach (WidgetBase w in WidgetInstances) - { - if (w.Handle == context) - { - w.OnPause(); - break; - } - } - return 0; - } - - private int OnResume(IntPtr context, IntPtr userData) - { - foreach (WidgetBase w in WidgetInstances) - { - if (w.Handle == context) - { - w.OnResume(); - break; - } - } - return 0; - } - - private int OnResize(IntPtr context, int w, int h, IntPtr userData) - { - foreach (WidgetBase o in WidgetInstances) - { - if (o.Handle == context) - { - o.OnResize(w, h); - break; - } - } - return 0; - } - - private int OnUpdate(IntPtr context, IntPtr content, int force, IntPtr userData) - { - foreach (WidgetBase o in WidgetInstances) - { - if (o.Handle == context) - { - Bundle bundle = null; - - if (content != IntPtr.Zero) - bundle = new Bundle(new SafeBundleHandle(content, false)); - o.OnUpdate(bundle, force != 0 ? true : false); - break; - } - } - return 0; - } - } -} - diff --git a/src/Tizen.Applications.WidgetApplication/Tizen.Applications/WidgetWindow.cs b/src/Tizen.Applications.WidgetApplication/Tizen.Applications/WidgetWindow.cs deleted file mode 100755 index 870e11dd8..000000000 --- a/src/Tizen.Applications.WidgetApplication/Tizen.Applications/WidgetWindow.cs +++ /dev/null @@ -1,39 +0,0 @@ -/* - * 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 ElmSharp; -using System; -using System.Collections.Generic; - -namespace Tizen.Applications -{ - internal class WidgetWindow : Window - { - private IntPtr _handle; - - internal WidgetWindow(IntPtr handle) : base() - { - _handle = handle; - Realize(null); - } - - protected override IntPtr CreateHandle(EvasObject parent) - { - return _handle; - } - } -} - diff --git a/src/Tizen.Applications.WidgetControl/Interop/Interop.Libraries.cs b/src/Tizen.Applications.WidgetControl/Interop/Interop.Libraries.cs deleted file mode 100755 index e447fa6f2..000000000 --- a/src/Tizen.Applications.WidgetControl/Interop/Interop.Libraries.cs +++ /dev/null @@ -1,23 +0,0 @@ -/* - * 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 WidgetService = "libwidget_service.so.1"; - } -} diff --git a/src/Tizen.Applications.WidgetControl/Interop/Interop.WidgetService.cs b/src/Tizen.Applications.WidgetControl/Interop/Interop.WidgetService.cs deleted file mode 100755 index b49e8595e..000000000 --- a/src/Tizen.Applications.WidgetControl/Interop/Interop.WidgetService.cs +++ /dev/null @@ -1,106 +0,0 @@ -/* - * 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; -using Tizen.Applications; - -internal static partial class Interop -{ - internal static partial class WidgetService - { - internal enum ErrorCode : int - { - None = Tizen.Internals.Errors.ErrorCode.None, - InvalidParameter = Tizen.Internals.Errors.ErrorCode.InvalidParameter, - OutOfMemory = Tizen.Internals.Errors.ErrorCode.OutOfMemory, - ResourceBusy = Tizen.Internals.Errors.ErrorCode.ResourceBusy, - PermissionDenied = Tizen.Internals.Errors.ErrorCode.PermissionDenied, - Canceled = Tizen.Internals.Errors.ErrorCode.Canceled, - IoError = Tizen.Internals.Errors.ErrorCode.IoError, - TimedOut = Tizen.Internals.Errors.ErrorCode.TimedOut, - NotSupported = Tizen.Internals.Errors.ErrorCode.NotSupported, - FileNoSpaceOnDevice = Tizen.Internals.Errors.ErrorCode.FileNoSpaceOnDevice, - Fault = -0x02F40000 | 0x0001, - AlreadyExist = -0x02F40000 | 0x0002, - AlreadyStarted = -0x02F40000 | 0x0004, - NotExist = -0x02F40000 | 0x0008, - Disabled = -0x02F40000 | 0x0010, - MaxExceeded = -0x02F40000 | 0x0011, - } - - internal enum LifecycleEvent : int - { - AppDead = 0, - Created = 1, - Destroyed = 2, - Paused = 3, - Resumed = 4, - Max = 5 - } - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void InstanceCallback(string widgetId, string instanceId, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void LifecycleCallback(string widgetId, LifecycleEvent e, string instanceId, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void WidgetListCallback(string widgetId, int isPrime, IntPtr userData); - - [DllImport(Libraries.WidgetService, EntryPoint = "widget_service_get_icon")] - internal static extern string GetIcon(string pkgId, string lang); - - [DllImport(Libraries.WidgetService, EntryPoint = "widget_service_get_name")] - internal static extern string GetName(string widgetId, string lang); - - [DllImport(Libraries.WidgetService, EntryPoint = "widget_service_get_nodisplay")] - internal static extern int GetNoDisplay(string widgetId); - - [DllImport(Libraries.WidgetService, EntryPoint = "widget_service_get_widget_instance_list")] - internal static extern ErrorCode GetInstances(string widgetId, InstanceCallback callback, IntPtr userData); - - [DllImport(Libraries.WidgetService, EntryPoint = "widget_service_set_lifecycle_event_cb")] - internal static extern ErrorCode SetLifecycleEvent(string widgetId, LifecycleCallback callback, IntPtr userData); - - [DllImport(Libraries.WidgetService, EntryPoint = "widget_service_unset_lifecycle_event_cb")] - internal static extern ErrorCode UnsetLifecycleEvent(string widgetId, IntPtr userData); - - [DllImport(Libraries.WidgetService, EntryPoint = "widget_service_trigger_update")] - internal static extern ErrorCode UpdateContent(string widgetId, string instanceId, SafeBundleHandle bundle, int force); - - [DllImport(Libraries.WidgetService, EntryPoint = "widget_service_change_period")] - internal static extern ErrorCode ChangePeriod(string widgetId, string instanceId, double period); - - [DllImport(Libraries.WidgetService, EntryPoint = "widget_service_get_content_of_widget_instance")] - internal static extern ErrorCode GetContent(string widgetId, string instanceId, out IntPtr bundle); - - [DllImport(Libraries.WidgetService, EntryPoint = "widget_service_get_package_id")] - internal static extern string GetPkgId(string widgetId); - - [DllImport(Libraries.WidgetService, EntryPoint = "widget_service_get_supported_sizes")] - internal static extern ErrorCode GetSupportedSizes(string widgetId, ref int cnt, out int[] w, out int[] h); - - [DllImport(Libraries.WidgetService, EntryPoint = "widget_service_get_supported_size_types")] - internal static extern ErrorCode GetSupportedSizeTypes(string widgetId, ref int cnt, out int[] types); - - [DllImport(Libraries.WidgetService, EntryPoint = "widget_service_get_preview_image_path")] - internal static extern string GetPreviewImagePath(string widgetId, int sizeType); - - [DllImport(Libraries.WidgetService, EntryPoint = "widget_service_get_widget_list_by_pkgid")] - internal static extern ErrorCode GetWidgetListByPkgId(string pkgId, WidgetListCallback callback, IntPtr userData); - } -} diff --git a/src/Tizen.Applications.WidgetControl/Tizen.Applications.WidgetControl.csproj b/src/Tizen.Applications.WidgetControl/Tizen.Applications.WidgetControl.csproj deleted file mode 100644 index 020b2cb3d..000000000 --- a/src/Tizen.Applications.WidgetControl/Tizen.Applications.WidgetControl.csproj +++ /dev/null @@ -1,11 +0,0 @@ - - - - netstandard2.0 - - - - - - - diff --git a/src/Tizen.Applications.WidgetControl/Tizen.Applications.WidgetControl.sln b/src/Tizen.Applications.WidgetControl/Tizen.Applications.WidgetControl.sln deleted file mode 100755 index 66d5bd724..000000000 --- a/src/Tizen.Applications.WidgetControl/Tizen.Applications.WidgetControl.sln +++ /dev/null @@ -1,40 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26430.12 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Applications.WidgetControl", "Tizen.Applications.WidgetControl.csproj", "{E26FA846-98DF-4FDC-94B2-6857CC5DA810}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen", "..\Tizen\Tizen.csproj", "{F0E88DE4-4979-410B-A3C3-163F17927C4A}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Log", "..\Tizen.Log\Tizen.Log.csproj", "{1476ED0F-D5B1-447E-84C6-1955D2715755}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Applications.Common", "..\Tizen.Applications.Common\Tizen.Applications.Common.csproj", "{38DF06B7-F031-434F-A415-F1240671F81D}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {E26FA846-98DF-4FDC-94B2-6857CC5DA810}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E26FA846-98DF-4FDC-94B2-6857CC5DA810}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E26FA846-98DF-4FDC-94B2-6857CC5DA810}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E26FA846-98DF-4FDC-94B2-6857CC5DA810}.Release|Any CPU.Build.0 = Release|Any CPU - {F0E88DE4-4979-410B-A3C3-163F17927C4A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F0E88DE4-4979-410B-A3C3-163F17927C4A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F0E88DE4-4979-410B-A3C3-163F17927C4A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F0E88DE4-4979-410B-A3C3-163F17927C4A}.Release|Any CPU.Build.0 = Release|Any CPU - {1476ED0F-D5B1-447E-84C6-1955D2715755}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1476ED0F-D5B1-447E-84C6-1955D2715755}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1476ED0F-D5B1-447E-84C6-1955D2715755}.Release|Any CPU.ActiveCfg = Release|Any CPU - {1476ED0F-D5B1-447E-84C6-1955D2715755}.Release|Any CPU.Build.0 = Release|Any CPU - {38DF06B7-F031-434F-A415-F1240671F81D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {38DF06B7-F031-434F-A415-F1240671F81D}.Debug|Any CPU.Build.0 = Debug|Any CPU - {38DF06B7-F031-434F-A415-F1240671F81D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {38DF06B7-F031-434F-A415-F1240671F81D}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/src/Tizen.Applications.WidgetControl/Tizen.Applications/WidgetControl.cs b/src/Tizen.Applications.WidgetControl/Tizen.Applications/WidgetControl.cs deleted file mode 100755 index 9407e0de8..000000000 --- a/src/Tizen.Applications.WidgetControl/Tizen.Applications/WidgetControl.cs +++ /dev/null @@ -1,708 +0,0 @@ -/* - * 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.Collections.Generic; -using Tizen.Applications; - -namespace Tizen.Applications -{ - /// - /// The class for receiving widget events and sending data to the widget. - /// - public class WidgetControl : IDisposable - { - /// - /// Class for the widget instance. - /// - public class Instance - { - private string _widgetId; - - internal Instance(string widgetId) - { - _widgetId = widgetId; - } - - /// - /// The widget ID. - /// - /// 3 - public string Id { get; internal set; } - - /// - /// Gets the widget content. - /// - /// 3 - /// Thrown in case of failed conditions. - public Bundle GetContent() - { - IntPtr h; - - Interop.WidgetService.ErrorCode err = Interop.WidgetService.GetContent(_widgetId, Id, out h); - - switch (err) - { - case Interop.WidgetService.ErrorCode.InvalidParameter: - throw new InvalidOperationException("Invalid parameter at unmanaged code"); - - case Interop.WidgetService.ErrorCode.IoError: - throw new InvalidOperationException("Failed to access DB"); - } - - return new Bundle(new SafeBundleHandle(h, true)); - } - - /// - /// Changes the content for the widget instance. - /// - /// 3 - /// Content to be changed. - /// True if you want to update your widget even if the provider is paused, otherwise false. - /// Thrown when failed because of an invalid argument. - /// Thrown in case of failed conditions. - /// Thrown when an application does not have the privilege to access this method. - public void ChangeContent(Bundle content, bool force) - { - Interop.WidgetService.ErrorCode err = Interop.WidgetService.UpdateContent(_widgetId, Id, content.SafeBundleHandle, force ? 1 : 0); - - switch (err) - { - case Interop.WidgetService.ErrorCode.InvalidParameter: - throw new ArgumentException("Invalid parameter"); - - case Interop.WidgetService.ErrorCode.Canceled: - throw new InvalidOperationException("Provider is paused, so this update request is canceld"); - - case Interop.WidgetService.ErrorCode.OutOfMemory: - throw new InvalidOperationException("Out-of-memory at unmanaged code"); - - case Interop.WidgetService.ErrorCode.Fault: - throw new InvalidOperationException("Failed to create a request packet"); - - case Interop.WidgetService.ErrorCode.PermissionDenied: - throw new UnauthorizedAccessException(); - } - } - - /// - /// Changes the update period for the widget instance. - /// - /// 3 - /// Thrown when failed because of an invalid argument. - /// Thrown in case of failed conditions. - /// Thrown when an application does not have the privilege to access this method. - public void ChangePeriod(double period) - { - Interop.WidgetService.ErrorCode err = Interop.WidgetService.ChangePeriod(_widgetId, Id, period); - - switch (err) - { - case Interop.WidgetService.ErrorCode.InvalidParameter: - throw new ArgumentException("Invalid parameter"); - - case Interop.WidgetService.ErrorCode.OutOfMemory: - throw new InvalidOperationException("Out-of-memory at unmanaged code"); - - case Interop.WidgetService.ErrorCode.Fault: - throw new InvalidOperationException("Failed to create a request packet"); - - case Interop.WidgetService.ErrorCode.PermissionDenied: - throw new UnauthorizedAccessException(); - } - } - } - - /// - /// The class for the widget size information. - /// - public class Scale - { - - internal Scale() - { - } - - /// - /// Enumeration for the types of widget size. - /// - /// 3 - public enum SizeType : int - { - /// - /// 175x175 based on 720x1280 resolution. - /// - Basic1x1 = 0x0001, - - /// - /// 354x175 based on 720x1280 resolution. - /// - Basic2x1 = 0x0002, - - /// - /// 354x354 based on 720x1280 resolution. - /// - Basic2x2 = 0x0004, - - /// - /// 712x175 based on 720x1280 resolution. - /// - Basic4x1 = 0x0008, - - /// - /// 712x354 based on 720x1280 resolution. - /// - Basic4x2 = 0x0010, - - /// - /// 712x533 based on 720x1280 resolution. - /// - Basic4x3 = 0x0020, - - /// - /// 712x712 based on 720x1280 resolution. - /// - Basic4x4 = 0x0040, - - /// - /// 712x891 based on 720x1280 resolution. - /// - Basic4x5 = 0x0080, - - /// - /// 712x1070 based on 720x1280 resolution. - /// - Basic4x6 = 0x0100, - - - /// - /// 224x215 based on 720x1280 resolution. - /// - Easy1x1 = 0x1000, - - /// - /// 680x215 based on 720x1280 resolution. - /// - Easy1x2 = 0x2000, - - /// - /// 680x653 based on 720x1280 resolution. - /// - Easy1x3 = 0x4000, - - /// - /// 720x1280 based on 720x1280 resolution. - /// - Full = 0x0800, - } - - /// - /// Widget width. - /// - /// 3 - public int Width { get; internal set; } - - /// - ///Widget height. - /// - /// 3 - public int Height { get; internal set; } - - /// - /// The path for the widget preview image file. - /// - /// 3 - public string PreviewImagePath { get; internal set; } - - /// - /// The size type of the widget. - /// - /// 3 - public SizeType Type { get; internal set; } - } - - private event EventHandler _created; - private event EventHandler _resumed; - private event EventHandler _paused; - private event EventHandler _destroyed; - private bool _disposedValue = false; - private static IDictionary s_lifecycleEventRefCnt = new Dictionary(); - private static IList s_eventObjects = new List(); - - /// - /// Factory method for the WidgetControl. - /// It will create all the objects of WidgetControl based on the package ID. - /// - /// 3 - /// Package ID. - /// http://tizen.org/privilege/widget.viewer - /// Thrown when failed because of an invalid argument. - /// Thrown in case of failed conditions. - /// Thrown when an application does not have the privilege to access this method. - public static WidgetControl[] CreateAll(string pkgId) - { - List list = new List(); - - Interop.WidgetService.ErrorCode err = Interop.WidgetService.GetWidgetListByPkgId(pkgId, (widgetId, isPrime, userData) => - { - list.Add(new WidgetControl(widgetId)); - }, IntPtr.Zero); - - switch (err) - { - case Interop.WidgetService.ErrorCode.InvalidParameter: - throw new ArgumentException("Invalid parameter"); - - case Interop.WidgetService.ErrorCode.IoError: - throw new InvalidOperationException("Failed to access DB"); - - case Interop.WidgetService.ErrorCode.PermissionDenied: - throw new UnauthorizedAccessException(); - } - - return list.ToArray(); - } - - /// - /// Gets all the widget IDs by the package ID. - /// - /// 3 - /// http://tizen.org/privilege/widget.viewer - /// Thrown when failed because of an invalid argument. - /// Thrown in case of failed conditions. - /// Thrown when an application does not have the privilege to access this method. - public static string[] GetWidgetIds(string pkgId) - { - List list = new List(); - - Interop.WidgetService.ErrorCode err = Interop.WidgetService.GetWidgetListByPkgId(pkgId, (widgetId, isPrime, userData) => - { - list.Add(widgetId); - }, IntPtr.Zero); - - switch (err) - { - case Interop.WidgetService.ErrorCode.InvalidParameter: - throw new ArgumentException("Invalid parameter"); - - case Interop.WidgetService.ErrorCode.IoError: - throw new InvalidOperationException("Failed to access DB"); - - case Interop.WidgetService.ErrorCode.PermissionDenied: - throw new UnauthorizedAccessException(); - } - - return list.ToArray(); - } - - /// - /// The widget ID. - /// - /// 3 - public string Id { get; internal set; } - - /// - /// The flag value for "nodisplay". - /// - /// 3 - /// http://tizen.org/privilege/widget.viewer - public bool IsNoDisplay - { - get - { - if (Interop.WidgetService.GetNoDisplay(Id) != 0) - return true; - - return false; - } - } - - /// - /// The event handler for a created widget instance. - /// - /// 3 - /// Thrown in case of failed conditions. - /// Thrown when an application does not have the privilege to access this method. - public event EventHandler Created - { - add - { - RegisterLifecycleEvent(); - _created += value; - } - remove - { - _created -= value; - UnregisterLifecycleEvent(); - } - } - - /// - /// The event handler for a resumed widget instance. - /// - /// 3 - /// Thrown in case of failed conditions. - /// Thrown when an application does not have the privilege to access this method. - public event EventHandler Resumed - { - add - { - RegisterLifecycleEvent(); - _resumed += value; - } - remove - { - _resumed -= value; - UnregisterLifecycleEvent(); - } - } - - /// - /// The event handler for a paused widget instance. - /// - /// 3 - /// Thrown in case of failed conditions. - /// Thrown when an application does not have the privilege to access this method. - public event EventHandler Paused - { - add - { - RegisterLifecycleEvent(); - _paused += value; - } - remove - { - _paused -= value; - UnregisterLifecycleEvent(); - } - } - - /// - /// The event handler for a destroyed widget instance. - /// - /// 3 - /// Thrown in case of failed conditions. - /// Thrown when an application does not have the privilege to access this method. - public event EventHandler Destroyed - { - add - { - RegisterLifecycleEvent(); - _destroyed += value; - } - remove - { - _destroyed -= value; - UnregisterLifecycleEvent(); - } - } - - /// - /// The constructor of the WidgetControl object. - /// - /// 3 - /// Widget ID. - public WidgetControl(string widgetId) - { - Id = widgetId; - } - - /// - /// Finalizer of the WidgetControl class. - /// - ~WidgetControl() - { - Dispose(false); - } - - /// - /// Gets the objects for widget instance information. - /// - /// 3 - /// Thrown in case of failed conditions. - /// Thrown when the API is not supported in this device. - /// Thrown when an application does not have the privilege to access this method. - public IEnumerable GetInstances() - { - IList instances = new List(); - Interop.WidgetService.ErrorCode err = Interop.WidgetService.GetInstances(Id, (widgetId, instanceId, userData) => - { - instances.Add(new Instance(widgetId) { Id = instanceId }); - }, IntPtr.Zero); - - switch (err) - { - case Interop.WidgetService.ErrorCode.InvalidParameter: - throw new InvalidOperationException("Invalid parameter at unmanaged code"); - - case Interop.WidgetService.ErrorCode.NotSupported: - throw new NotSupportedException(); - - case Interop.WidgetService.ErrorCode.PermissionDenied: - throw new UnauthorizedAccessException(); - } - - return instances; - } - - /// - /// Gets the objects for widget scale information. - /// - /// 3 - /// http://tizen.org/privilege/widget.viewer - /// Thrown in case of failed conditions. - /// Thrown when an application does not have the privilege to access this method. - public IEnumerable GetScales() - { - int[] w = new int[100]; - int[] h = new int[100]; - int[] types = new int[100]; - int cnt1 = 100; - int cnt2 = 100; - IList scales = new List(); - - Interop.WidgetService.ErrorCode err = Interop.WidgetService.GetSupportedSizes(Id, ref cnt1, out w, out h); - - switch (err) - { - case Interop.WidgetService.ErrorCode.InvalidParameter: - throw new InvalidOperationException("Invalid parameter at unmanaged code"); - - case Interop.WidgetService.ErrorCode.IoError: - throw new InvalidOperationException("Failed to access DB"); - - case Interop.WidgetService.ErrorCode.PermissionDenied: - throw new UnauthorizedAccessException(); - } - - err = Interop.WidgetService.GetSupportedSizeTypes(Id, ref cnt2, out types); - - switch (err) - { - case Interop.WidgetService.ErrorCode.InvalidParameter: - throw new InvalidOperationException("Invalid parameter at unmanaged code"); - - case Interop.WidgetService.ErrorCode.IoError: - throw new InvalidOperationException("Failed to access DB"); - - case Interop.WidgetService.ErrorCode.PermissionDenied: - throw new UnauthorizedAccessException(); - } - - if (cnt1 != cnt2) - return null; - - for (int i = 0; i < cnt1; i++) - { - string prev = Interop.WidgetService.GetPreviewImagePath(Id, types[i]); - - scales.Add(new Scale() - { - Width = w[i], - Height = h[i], - PreviewImagePath = prev, - Type = (Scale.SizeType)types[i] - }); - } - return scales; - } - - /// - /// Gets the widget name. - /// - /// 3 - /// Language. - /// http://tizen.org/privilege/widget.viewer - /// Thrown when the argument is null. - public string GetName(string lang) - { - if (lang == null) - throw new ArgumentNullException(); - - return Interop.WidgetService.GetName(Id, lang); - } - - /// - /// Gets the widget icon path. - /// - /// 3 - /// Language. - /// http://tizen.org/privilege/widget.viewer - /// Thrown when the argument is null. - public string GetIconPath(string lang) - { - if (lang == null) - throw new ArgumentNullException(); - - string pkgId = Interop.WidgetService.GetPkgId(Id); - - return Interop.WidgetService.GetIcon(pkgId, lang); - } - - /// - /// Releases all the resources used by the WidgetControl class. - /// - /// 3 - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - - private void Dispose(bool disposing) - { - if (!_disposedValue) - { - if (disposing) - { - } - - _created = null; - _resumed = null; - _paused = null; - _destroyed = null; - UnregisterLifecycleEvent(); - - _disposedValue = true; - } - } - - private void RegisterLifecycleEvent() - { - if (!s_lifecycleEventRefCnt.ContainsKey(Id)) - s_lifecycleEventRefCnt[Id] = 0; - - if (_created != null || _paused != null || _resumed != null || _destroyed != null) - return; - - if (s_lifecycleEventRefCnt[Id] == 0) - { - Interop.WidgetService.ErrorCode err = Interop.WidgetService.SetLifecycleEvent(Id, OnLifecycleEvent, IntPtr.Zero); - - switch (err) - { - case Interop.WidgetService.ErrorCode.InvalidParameter: - throw new InvalidOperationException("Invalid parameter at unmanaged code"); - - case Interop.WidgetService.ErrorCode.PermissionDenied: - throw new UnauthorizedAccessException(); - } - } - - s_lifecycleEventRefCnt[Id]++; - s_eventObjects.Add(this); - } - - private void UnregisterLifecycleEvent() - { - if (!s_lifecycleEventRefCnt.ContainsKey(Id)) - return; - - if (s_lifecycleEventRefCnt[Id] <= 0) - return; - - if (_created != null || _paused != null || _resumed != null || _destroyed != null) - return; - - if (s_lifecycleEventRefCnt[Id] == 1) - { - Interop.WidgetService.ErrorCode err = Interop.WidgetService.UnsetLifecycleEvent(Id, IntPtr.Zero); - - switch (err) - { - case Interop.WidgetService.ErrorCode.InvalidParameter: - throw new InvalidOperationException("Invalid parameter at unmanaged code"); - - case Interop.WidgetService.ErrorCode.PermissionDenied: - throw new UnauthorizedAccessException(); - - case Interop.WidgetService.ErrorCode.NotExist: - throw new InvalidOperationException("Event handler is not exist"); - } - } - - s_eventObjects.Remove(this); - s_lifecycleEventRefCnt[Id]--; - } - - private static void OnLifecycleEvent(string widgetId, Interop.WidgetService.LifecycleEvent e, string instanceId, IntPtr userData) - { - switch (e) - { - case Interop.WidgetService.LifecycleEvent.Created: - foreach (WidgetControl c in s_eventObjects) - { - if (c.Id.CompareTo(widgetId) == 0) - { - c._created?.Invoke(null, new WidgetLifecycleEventArgs() - { - WidgetId = widgetId, - InstanceId = instanceId, - Type = WidgetLifecycleEventArgs.EventType.Created - }); - } - } - break; - - case Interop.WidgetService.LifecycleEvent.Resumed: - foreach (WidgetControl c in s_eventObjects) - { - if (c.Id.CompareTo(widgetId) == 0) - { - c._resumed?.Invoke(null, new WidgetLifecycleEventArgs() - { - WidgetId = widgetId, - InstanceId = instanceId, - Type = WidgetLifecycleEventArgs.EventType.Resumed - }); - } - } - break; - - case Interop.WidgetService.LifecycleEvent.Paused: - foreach (WidgetControl c in s_eventObjects) - { - if (c.Id.CompareTo(widgetId) == 0) - { - c._paused?.Invoke(null, new WidgetLifecycleEventArgs() - { - WidgetId = widgetId, - InstanceId = instanceId, - Type = WidgetLifecycleEventArgs.EventType.Paused - }); - } - } - break; - - case Interop.WidgetService.LifecycleEvent.Destroyed: - foreach (WidgetControl c in s_eventObjects) - { - if (c.Id.CompareTo(widgetId) == 0) - { - c._destroyed?.Invoke(null, new WidgetLifecycleEventArgs() - { - WidgetId = widgetId, - InstanceId = instanceId, - Type = WidgetLifecycleEventArgs.EventType.Destroyed - }); - } - } - break; - } - - } - } -} diff --git a/src/Tizen.Applications.WidgetControl/Tizen.Applications/WidgetLifecycleEventArgs.cs b/src/Tizen.Applications.WidgetControl/Tizen.Applications/WidgetLifecycleEventArgs.cs deleted file mode 100755 index 87ffc591c..000000000 --- a/src/Tizen.Applications.WidgetControl/Tizen.Applications/WidgetLifecycleEventArgs.cs +++ /dev/null @@ -1,71 +0,0 @@ -/* - * 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.Applications -{ - /// - /// The class for event arguments of the widget lifecycle. - /// - public class WidgetLifecycleEventArgs : EventArgs - { - internal WidgetLifecycleEventArgs() - { - } - - /// - /// Enumeration for the event type. - /// - public enum EventType - { - /// - /// The widget is created. - /// - Created, - - /// - /// The widget is destroyed. - /// - Destroyed, - - /// - /// The widget is paused. - /// - Paused, - - /// - /// The widget is resumed. - /// - Resumed - } - - /// - /// The widget ID. - /// - public string WidgetId { get; internal set; } - - /// - /// The widget instance ID. - /// - public string InstanceId { get; internal set; } - - /// - /// The event type. - /// - public EventType Type { get; internal set; } - } -} diff --git a/src/Tizen.CallManager/Interop/Interop.CallManager.cs b/src/Tizen.CallManager/Interop/Interop.CallManager.cs deleted file mode 100755 index f4d3c4bec..000000000 --- a/src/Tizen.CallManager/Interop/Interop.CallManager.cs +++ /dev/null @@ -1,227 +0,0 @@ -/* - * 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; -using Tizen.CallManager; - -/// -/// Interop class for CallManager -/// -internal static partial class Interop -{ - /// - /// CallManager Native Apis - /// - internal static partial class CallManager - { - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void CallStatusChangedCallback(CallStatus callStatus, string number, IntPtr userData); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void CallMuteStatusChangedCallback(CallMuteStatus muteStatus, IntPtr userData); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void DialStatusChangedCallback(DialStatus dialStatus, IntPtr userData); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void DtmfIndicationChangedCallback(DtmfIndication indiType, string number, IntPtr userData); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void AudioStateChangedCallback(AudioState state, IntPtr userData); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void GoForegroundCallback(IntPtr userData); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void VoiceRecordStatusChangedCallback(VrStatus vrStatus, VrStatusExtraType extraType, IntPtr userData); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void CallEventNotificationCallback(CallEvent callEvent, IntPtr eventData, IntPtr userData); - - [DllImport(Libraries.CallManager, EntryPoint = "cm_init")] - internal static extern int InitCm(out IntPtr handle); - [DllImport(Libraries.CallManager, EntryPoint = "cm_deinit")] - internal static extern int DeinitCm(IntPtr handle); - [DllImport(Libraries.CallManager, EntryPoint = "cm_reject_call")] - internal static extern int RejectCall(IntPtr handle); - [DllImport(Libraries.CallManager, EntryPoint = "cm_stop_alert")] - internal static extern int StopAlert(IntPtr handle); - [DllImport(Libraries.CallManager, EntryPoint = "cm_get_call_status")] - internal static extern int GetStatus(IntPtr handle, out CallStatus callStatus); - [DllImport(Libraries.CallManager, EntryPoint = "cm_set_call_status_cb")] - internal static extern int SetCallStatusCallback(IntPtr handle, CallStatusChangedCallback callback, IntPtr userData); - [DllImport(Libraries.CallManager, EntryPoint = "cm_unset_call_status_cb")] - internal static extern int UnsetCallstatusCallback(IntPtr handle); - [DllImport(Libraries.CallManager, EntryPoint = "cm_get_mute_status")] - internal static extern int GetMuteStatus(IntPtr handle, out CallMuteStatus muteStatus); - [DllImport(Libraries.CallManager, EntryPoint = "cm_set_mute_status_cb")] - internal static extern int SetCallMuteStatusCallback(IntPtr handle, CallMuteStatusChangedCallback callback, IntPtr userData); - [DllImport(Libraries.CallManager, EntryPoint = "cm_unset_mute_status_cb")] - internal static extern int UnsetCallMuteStatusCallback(IntPtr handle); - [DllImport(Libraries.CallManager, EntryPoint = "cm_enable_recovery")] - internal static extern int EnableRecovery(IntPtr handle, string appId); - [DllImport(Libraries.CallManager, EntryPoint = "cm_dial_call")] - internal static extern int DialCall(IntPtr handle, string number, CallType type, MultiSimSlot simSlot); - [DllImport(Libraries.CallManager, EntryPoint = "cm_swap_call")] - internal static extern int SwapCall(IntPtr handle); - [DllImport(Libraries.CallManager, EntryPoint = "cm_join_call")] - internal static extern int JoinCall(IntPtr handle); - [DllImport(Libraries.CallManager, EntryPoint = "cm_split_call")] - internal static extern int SplitCall(IntPtr handle, uint callId); - [DllImport(Libraries.CallManager, EntryPoint = "cm_transfer_call")] - internal static extern int TransferCall(IntPtr handle); - [DllImport(Libraries.CallManager, EntryPoint = "cm_answer_call_ex")] - internal static extern int AnswerCallEx(IntPtr handle, CallAnswerType answerType, CallType callType); - [DllImport(Libraries.CallManager, EntryPoint = "cm_answer_call")] - internal static extern int AnswerCall(IntPtr handle, CallAnswerType answerType); - [DllImport(Libraries.CallManager, EntryPoint = "cm_upgrade_call")] - internal static extern int UpgradeCall(IntPtr handle); - [DllImport(Libraries.CallManager, EntryPoint = "cm_downgrade_call")] - internal static extern int DowngradeCall(IntPtr handle); - [DllImport(Libraries.CallManager, EntryPoint = "cm_confirm_upgrade_call")] - internal static extern int ConfirmUpgradeCall(IntPtr handle, CallUpgradeResponseType respType); - [DllImport(Libraries.CallManager, EntryPoint = "cm_speaker_on")] - internal static extern int SpeakerOn(IntPtr handle); - [DllImport(Libraries.CallManager, EntryPoint = "cm_speaker_off")] - internal static extern int SpeakerOff(IntPtr handle); - [DllImport(Libraries.CallManager, EntryPoint = "cm_bluetooth_on")] - internal static extern int BluetoothOn(IntPtr handle); - [DllImport(Libraries.CallManager, EntryPoint = "cm_bluetooth_off")] - internal static extern int BluetoothOff(IntPtr handle); - [DllImport(Libraries.CallManager, EntryPoint = "cm_set_extra_vol")] - internal static extern int SetExtraVolume(IntPtr handle, bool isExtraVolume); - [DllImport(Libraries.CallManager, EntryPoint = "cm_set_noise_reduction")] - internal static extern int SetNoiseReduction(IntPtr handle, bool isNoiseReduction); - [DllImport(Libraries.CallManager, EntryPoint = "cm_set_mute_state")] - internal static extern int SetMuteState(IntPtr handle, bool isMuteState); - [DllImport(Libraries.CallManager, EntryPoint = "cm_start_dtmf")] - internal static extern int StartDtmf(IntPtr handle, byte dtmfDigit); - [DllImport(Libraries.CallManager, EntryPoint = "cm_stop_dtmf")] - internal static extern int StopDtmf(IntPtr handle); - [DllImport(Libraries.CallManager, EntryPoint = "cm_burst_dtmf")] - internal static extern int BurstDtmf(IntPtr handle, string dtmfDigits); - [DllImport(Libraries.CallManager, EntryPoint = "cm_send_dtmf_resp")] - internal static extern int SendDtmfResponse(IntPtr handle, DtmfResponseType respType); - [DllImport(Libraries.CallManager, EntryPoint = "cm_get_audio_state")] - internal static extern int GetAudioState(IntPtr handle, out AudioState state); - [DllImport(Libraries.CallManager, EntryPoint = "cm_activate_ui")] - internal static extern int ActivateUi(IntPtr handle); - [DllImport(Libraries.CallManager, EntryPoint = "cm_set_lcd_timeout")] - internal static extern int SetLcdTimeOut(IntPtr handle, LcdTimeOut timeOut); - [DllImport(Libraries.CallManager, EntryPoint = "cm_get_all_call_list")] - internal static extern int GetAllCallList(IntPtr handle, out IntPtr list); - [DllImport(Libraries.CallManager, EntryPoint = "cm_get_conference_call_list")] - internal static extern int GetConferenceCallList(IntPtr handle, out IntPtr list); - [DllImport(Libraries.CallManager, EntryPoint = "cm_get_all_calldata")] - internal static extern int GetAllCallData(IntPtr handle, out IntPtr incoming, out IntPtr active, out IntPtr held); - [DllImport(Libraries.CallManager, EntryPoint = "cm_start_voice_record")] - internal static extern int StartVoiceRecord(IntPtr handle, string number); - [DllImport(Libraries.CallManager, EntryPoint = "cm_stop_voice_record")] - internal static extern int StopVoiceRecord(IntPtr handle); - [DllImport(Libraries.CallManager, EntryPoint = "cm_set_dial_status_cb")] - internal static extern int SetDialStatusCb(IntPtr handle, DialStatusChangedCallback callback, IntPtr userData); - [DllImport(Libraries.CallManager, EntryPoint = "cm_unset_dial_status_cb")] - internal static extern int UnsetDialStatusCb(IntPtr handle); - [DllImport(Libraries.CallManager, EntryPoint = "cm_set_audio_state_changed_cb")] - internal static extern int SetAudioStateChangedCb(IntPtr handle, AudioStateChangedCallback callback, IntPtr userData); - [DllImport(Libraries.CallManager, EntryPoint = "cm_unset_audio_state_changed_cb")] - internal static extern int UnsetAudioStateChangedCb(IntPtr handle); - [DllImport(Libraries.CallManager, EntryPoint = "cm_set_dtmf_indication_cb")] - internal static extern int SetDtmfIndicationCb(IntPtr handle, DtmfIndicationChangedCallback callback, IntPtr userData); - [DllImport(Libraries.CallManager, EntryPoint = "cm_unset_dtmf_indication_cb")] - internal static extern int UnsetDtmfIndicationCb(IntPtr handle); - [DllImport(Libraries.CallManager, EntryPoint = "cm_set_foreground_cb")] - internal static extern int SetForegroundCb(IntPtr handle, GoForegroundCallback callback, IntPtr userData); - [DllImport(Libraries.CallManager, EntryPoint = "cm_unset_foreground_cb")] - internal static extern int UnsetForegroundCb(IntPtr handle); - [DllImport(Libraries.CallManager, EntryPoint = "cm_set_voice_record_status_cb")] - internal static extern int SetVoiceRecordStatusCb(IntPtr handle, VoiceRecordStatusChangedCallback callback, IntPtr userData); - [DllImport(Libraries.CallManager, EntryPoint = "cm_unset_voice_record_status_cb")] - internal static extern int UnsetVoiceRecordStatusCb(IntPtr handle); - [DllImport(Libraries.CallManager, EntryPoint = "cm_call_data_get_person_id")] - internal static extern int GetPersonId(IntPtr handle, out int personId); - [DllImport(Libraries.CallManager, EntryPoint = "cm_call_data_get_call_member_count")] - internal static extern int GetCallMemberCount(IntPtr handle, out int memberCount); - [DllImport(Libraries.CallManager, EntryPoint = "cm_call_data_is_emergency_call")] - internal static extern int IsEmergencyCall(IntPtr handle, out bool isEmergency); - [DllImport(Libraries.CallManager, EntryPoint = "cm_call_data_is_voicemail_number")] - internal static extern int IsVoiceMailNumber(IntPtr handle, out bool isVoiceMailNumber); - [DllImport(Libraries.CallManager, EntryPoint = "cm_call_data_get_start_time")] - internal static extern int GetStartTime(IntPtr handle, out long startTime); - [DllImport(Libraries.CallManager, EntryPoint = "cm_call_data_get_session_id")] - internal static extern int GetSessionId(IntPtr handle, out int sessionId); - [DllImport(Libraries.CallManager, EntryPoint = "cm_call_data_get_hd_icon_state")] - internal static extern int GetHdIconState(IntPtr handle, out int IsHdEnable); - [DllImport(Libraries.CallManager, EntryPoint = "cm_call_data_get_is_wifi_calling")] - internal static extern int IsWiFiCalling(IntPtr handle, out int isWiFiCalling); - [DllImport(Libraries.CallManager, EntryPoint = "cm_call_data_get_upgrade_downgrade_state")] - internal static extern int GetUpgradeDowngradeState(IntPtr handle, out int isUpgradeDowngradeEnable); - [DllImport(Libraries.CallManager, EntryPoint = "cm_call_data_get_is_added_to_conf")] - internal static extern int IsAddedToConference(IntPtr handle, out int isAddedToConf); - [DllImport(Libraries.CallManager, EntryPoint = "cm_call_data_get_is_remote_on_hold")] - internal static extern int IsRemoteOnHold(IntPtr handle, out int isRemoteOnHold); - [DllImport(Libraries.CallManager, EntryPoint = "cm_conf_call_data_get_call_id")] - internal static extern int GetConfCallId(IntPtr handle, out uint callId); - [DllImport(Libraries.CallManager, EntryPoint = "cm_conf_call_data_get_call_number")] - internal static extern int GetConfCallNumber(IntPtr handle, out string number); - [DllImport(Libraries.CallManager, EntryPoint = "cm_conf_call_data_get_person_id")] - internal static extern int GetConfCallPersonId(IntPtr handle, out int personId); - [DllImport(Libraries.CallManager, EntryPoint = "cm_conf_call_data_get_name_mode")] - internal static extern int GetConfCallNameMode(IntPtr handle, out CallNameMode nameMode); - [DllImport(Libraries.CallManager, EntryPoint = "cm_conf_call_data_free")] - internal static extern int FreeConfCallData(IntPtr handle); - [DllImport(Libraries.CallManager, EntryPoint = "cm_set_lcd_state")] - internal static extern int SetLcdState(LcdControlState state); - [DllImport(Libraries.CallManager, EntryPoint = "cm_start_alert")] - internal static extern int StartAlert(IntPtr handle); - [DllImport(Libraries.CallManager, EntryPoint = "cm_set_call_event_cb")] - internal static extern int SetCallEventCb(IntPtr handle, CallEventNotificationCallback callback, IntPtr userData); - [DllImport(Libraries.CallManager, EntryPoint = "cm_unset_call_event_cb")] - internal static extern int UnsetCallEventCb(IntPtr handle); - [DllImport(Libraries.CallManager, EntryPoint = "cm_call_data_free")] - internal static extern int FreeCallData(IntPtr handle); - [DllImport(Libraries.CallManager, EntryPoint = "cm_call_data_get_call_id")] - internal static extern int GetCallId(IntPtr handle, out uint callId); - [DllImport(Libraries.CallManager, EntryPoint = "cm_call_data_get_call_direction")] - internal static extern int GetCallDirection(IntPtr handle, out CallDirection direction); - [DllImport(Libraries.CallManager, EntryPoint = "cm_call_data_get_call_number")] - internal static extern int GetCallNumber(IntPtr handle, out string number); - [DllImport(Libraries.CallManager, EntryPoint = "cm_call_data_get_calling_name")] - internal static extern int GetCallingName(IntPtr handle, out string name); - [DllImport(Libraries.CallManager, EntryPoint = "cm_call_data_get_call_type")] - internal static extern int GetCallType(IntPtr handle, out CallType type); - [DllImport(Libraries.CallManager, EntryPoint = "cm_call_data_get_call_state")] - internal static extern int GetCallState(IntPtr handle, out CallState state); - [DllImport(Libraries.CallManager, EntryPoint = "cm_call_data_get_call_domain")] - internal static extern int GetCallDomain(IntPtr handle, out CallDomain domain); - [DllImport(Libraries.CallManager, EntryPoint = "cm_call_data_get_name_mode")] - internal static extern int GetNameMode(IntPtr handle, out CallNameMode nameMode); - [DllImport(Libraries.CallManager, EntryPoint = "cm_call_data_get_mt_forwarded")] - internal static extern int IsForwardedCall(IntPtr handle, out bool isForwarded); - [DllImport(Libraries.CallManager, EntryPoint = "cm_call_event_data_get_sim_slot")] - internal static extern int GetSimSlot(IntPtr handle, out MultiSimSlot simSlot); - [DllImport(Libraries.CallManager, EntryPoint = "cm_call_event_data_get_incom_call")] - internal static extern int GetIncomingCallData(IntPtr handle, out IntPtr incomCall); - [DllImport(Libraries.CallManager, EntryPoint = "cm_call_event_data_get_call_id")] - internal static extern int GetEventDataCallId(IntPtr handle, out uint callId); - [DllImport(Libraries.CallManager, EntryPoint = "cm_call_event_data_get_active_call")] - internal static extern int GetActiveCall(IntPtr handle, out IntPtr activeCall); - [DllImport(Libraries.CallManager, EntryPoint = "cm_call_event_data_get_held_call")] - internal static extern int GetHeldCall(IntPtr handle, out IntPtr heldCall); - [DllImport(Libraries.CallManager, EntryPoint = "cm_call_event_data_get_end_cause")] - internal static extern int GetEndCause(IntPtr handle, out CallEndCause endCause); - [DllImport(Libraries.CallManager, EntryPoint = "cm_hold_call")] - internal static extern int HoldCall(IntPtr handle); - [DllImport(Libraries.CallManager, EntryPoint = "cm_unhold_call")] - internal static extern int UnholdCall(IntPtr handle); - [DllImport(Libraries.CallManager, EntryPoint = "cm_end_call")] - internal static extern int EndCall(IntPtr handle, uint callId, CallReleaseType releaseType); - } -} diff --git a/src/Tizen.CallManager/Interop/Interop.Libraries.cs b/src/Tizen.CallManager/Interop/Interop.Libraries.cs deleted file mode 100755 index 1a59b3691..000000000 --- a/src/Tizen.CallManager/Interop/Interop.Libraries.cs +++ /dev/null @@ -1,25 +0,0 @@ -/* - * 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 CallManager = "libcall-manager.so.0"; - public const string Glib = "libglib-2.0.so.0"; - public const string Libc = "libc.so.6"; - } -} diff --git a/src/Tizen.CallManager/Tizen.CallManager.csproj b/src/Tizen.CallManager/Tizen.CallManager.csproj deleted file mode 100644 index 7f4584ffe..000000000 --- a/src/Tizen.CallManager/Tizen.CallManager.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - netstandard2.0 - - - - - - - - diff --git a/src/Tizen.CallManager/Tizen.CallManager.sln b/src/Tizen.CallManager/Tizen.CallManager.sln deleted file mode 100755 index 983c733d9..000000000 --- a/src/Tizen.CallManager/Tizen.CallManager.sln +++ /dev/null @@ -1,61 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26430.13 -MinimumVisualStudioVersion = 15.0.26124.0 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.CallManager", "Tizen.CallManager.csproj", "{18DF1A45-32B3-4577-84DF-BB3A1537ADC9}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen", "..\Tizen\Tizen.csproj", "{D06D0004-6A5F-4D6C-98C4-ADD3766A867A}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Log", "..\Tizen.Log\Tizen.Log.csproj", "{78875590-41AB-4382-B64E-73A50DE0851C}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 - Release|Any CPU = Release|Any CPU - Release|x64 = Release|x64 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {18DF1A45-32B3-4577-84DF-BB3A1537ADC9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {18DF1A45-32B3-4577-84DF-BB3A1537ADC9}.Debug|Any CPU.Build.0 = Debug|Any CPU - {18DF1A45-32B3-4577-84DF-BB3A1537ADC9}.Debug|x64.ActiveCfg = Debug|Any CPU - {18DF1A45-32B3-4577-84DF-BB3A1537ADC9}.Debug|x64.Build.0 = Debug|Any CPU - {18DF1A45-32B3-4577-84DF-BB3A1537ADC9}.Debug|x86.ActiveCfg = Debug|Any CPU - {18DF1A45-32B3-4577-84DF-BB3A1537ADC9}.Debug|x86.Build.0 = Debug|Any CPU - {18DF1A45-32B3-4577-84DF-BB3A1537ADC9}.Release|Any CPU.ActiveCfg = Release|Any CPU - {18DF1A45-32B3-4577-84DF-BB3A1537ADC9}.Release|Any CPU.Build.0 = Release|Any CPU - {18DF1A45-32B3-4577-84DF-BB3A1537ADC9}.Release|x64.ActiveCfg = Release|Any CPU - {18DF1A45-32B3-4577-84DF-BB3A1537ADC9}.Release|x64.Build.0 = Release|Any CPU - {18DF1A45-32B3-4577-84DF-BB3A1537ADC9}.Release|x86.ActiveCfg = Release|Any CPU - {18DF1A45-32B3-4577-84DF-BB3A1537ADC9}.Release|x86.Build.0 = Release|Any CPU - {D06D0004-6A5F-4D6C-98C4-ADD3766A867A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D06D0004-6A5F-4D6C-98C4-ADD3766A867A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D06D0004-6A5F-4D6C-98C4-ADD3766A867A}.Debug|x64.ActiveCfg = Debug|Any CPU - {D06D0004-6A5F-4D6C-98C4-ADD3766A867A}.Debug|x64.Build.0 = Debug|Any CPU - {D06D0004-6A5F-4D6C-98C4-ADD3766A867A}.Debug|x86.ActiveCfg = Debug|Any CPU - {D06D0004-6A5F-4D6C-98C4-ADD3766A867A}.Debug|x86.Build.0 = Debug|Any CPU - {D06D0004-6A5F-4D6C-98C4-ADD3766A867A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D06D0004-6A5F-4D6C-98C4-ADD3766A867A}.Release|Any CPU.Build.0 = Release|Any CPU - {D06D0004-6A5F-4D6C-98C4-ADD3766A867A}.Release|x64.ActiveCfg = Release|Any CPU - {D06D0004-6A5F-4D6C-98C4-ADD3766A867A}.Release|x64.Build.0 = Release|Any CPU - {D06D0004-6A5F-4D6C-98C4-ADD3766A867A}.Release|x86.ActiveCfg = Release|Any CPU - {D06D0004-6A5F-4D6C-98C4-ADD3766A867A}.Release|x86.Build.0 = Release|Any CPU - {78875590-41AB-4382-B64E-73A50DE0851C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {78875590-41AB-4382-B64E-73A50DE0851C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {78875590-41AB-4382-B64E-73A50DE0851C}.Debug|x64.ActiveCfg = Debug|Any CPU - {78875590-41AB-4382-B64E-73A50DE0851C}.Debug|x64.Build.0 = Debug|Any CPU - {78875590-41AB-4382-B64E-73A50DE0851C}.Debug|x86.ActiveCfg = Debug|Any CPU - {78875590-41AB-4382-B64E-73A50DE0851C}.Debug|x86.Build.0 = Debug|Any CPU - {78875590-41AB-4382-B64E-73A50DE0851C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {78875590-41AB-4382-B64E-73A50DE0851C}.Release|Any CPU.Build.0 = Release|Any CPU - {78875590-41AB-4382-B64E-73A50DE0851C}.Release|x64.ActiveCfg = Release|Any CPU - {78875590-41AB-4382-B64E-73A50DE0851C}.Release|x64.Build.0 = Release|Any CPU - {78875590-41AB-4382-B64E-73A50DE0851C}.Release|x86.ActiveCfg = Release|Any CPU - {78875590-41AB-4382-B64E-73A50DE0851C}.Release|x86.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/src/Tizen.CallManager/Tizen.CallManager/CallData.cs b/src/Tizen.CallManager/Tizen.CallManager/CallData.cs deleted file mode 100755 index 8f7b2da8f..000000000 --- a/src/Tizen.CallManager/Tizen.CallManager/CallData.cs +++ /dev/null @@ -1,271 +0,0 @@ -/* - * 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.CallManager -{ - /// - /// A class which defines the properties of call. - /// - public class CallData - { - internal uint CallId; - internal CallDirection CallDirection; - internal string Number; - internal string Name; - internal CallType CallType; - internal CallState CallState; - internal int Count; - internal bool IsEcc; - internal bool IsVoiceMail; - internal CallDomain CallDomain; - internal int PersonIndex; - internal long CallStartTime; - internal CallNameMode CallNameMode; - internal int SessionIdIms; - internal bool IsHdEnableIms; - internal bool IsWiFiCall; - internal bool IsUpgradeDowngrade; - internal bool IsRemoteHold; - internal bool IsAddedToConf; - internal bool IsForwardedCall; - - internal CallData() - { - } - - /// - /// Gets call id. - /// - public uint Id - { - get - { - return CallId; - } - } - - /// - /// Gets call direction(MO or MT). - /// - public CallDirection Direction - { - get - { - return CallDirection; - } - } - - /// - /// Get the call number. - /// - public string CallNumber - { - get - { - return Number; - } - } - - /// - /// Get the contact name of calling number. - /// - public string CallingName - { - get - { - return Name; - } - } - - /// - /// Get the call type(Voice call or Video call). - /// - public CallType Type - { - get - { - return CallType; - } - } - - /// - /// Get the call state(Incoming, Active, etc). - /// - public CallState State - { - get - { - return CallState; - } - } - - /// - /// Get the member count. - /// - public int MemberCount - { - get - { - return Count; - } - } - - /// - /// Checks if the call is emergency call. - /// - public bool IsEmergency - { - get - { - return IsEcc; - } - } - - /// - /// Checks if the number is voice mail number. - /// - public bool IsVoiceMailNumber - { - get - { - return IsVoiceMail; - } - } - - /// - /// Get the call domain(PS call, CS call, etc). - /// - public CallDomain Domain - { - get - { - return CallDomain; - } - } - - /// - /// Get the person ID. - /// - public int PersonId - { - get - { - return PersonIndex; - } - } - - /// - /// Get the start time of the call. - /// - public long StartTime - { - get - { - return CallStartTime; - } - } - - /// - /// Get the contact name mode. - /// - public CallNameMode Mode - { - get - { - return CallNameMode; - } - } - - /// - /// Get the session ID of the call. - /// - public int SessionId - { - get - { - return SessionIdIms; - } - } - - /// - /// Checks if HD is enabled for calling. - /// - public bool IsHdEnable - { - get - { - return IsHdEnableIms; - } - } - - /// - /// Checks if the call is a WiFi call. - /// - public bool IsWiFiCalling - { - get - { - return IsWiFiCall; - } - } - - /// - /// Checks if upgrade/downgrade is enabled. - /// - public bool IsUpgradeDowngradeEnable - { - get - { - return IsUpgradeDowngrade; - } - } - - /// - /// Checks if the remote call is on hold. - /// - public bool IsRemoteOnHold - { - get - { - return IsRemoteHold; - } - } - - /// - /// Checks if the call is added to conference. - /// - public bool IsAddedToConference - { - get - { - return IsAddedToConf; - } - } - - /// - /// Checks if the incoming call is a forwarded call. - /// - public bool IsMtForwarded - { - get - { - return IsForwardedCall; - } - } - } -} diff --git a/src/Tizen.CallManager/Tizen.CallManager/CallEventData.cs b/src/Tizen.CallManager/Tizen.CallManager/CallEventData.cs deleted file mode 100755 index dce2d9fd8..000000000 --- a/src/Tizen.CallManager/Tizen.CallManager/CallEventData.cs +++ /dev/null @@ -1,102 +0,0 @@ -/* - * 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.CallManager -{ - /// - /// A class which contains information about call event data. - /// - public class CallEventData - { - internal uint EventId; - internal MultiSimSlot Slot; - internal CallEndCause Cause; - internal CallData Incoming; - internal CallData Active; - internal CallData Held; - internal CallEventData() - { - } - - /// - /// Get the Call id of the number for which Call event has occurred. - /// - public uint Id - { - get - { - return EventId; - } - } - - /// - /// Get the Sim slot type. - /// - public MultiSimSlot SimSlot - { - get - { - return Slot; - } - } - - /// - /// Get call end cause type. - /// - public CallEndCause EndCause - { - get - { - return Cause; - } - } - - /// - /// Get incoming call data. - /// - public CallData IncomingData - { - get - { - return Incoming; - } - } - - /// - /// Get active call data. - /// - public CallData ActiveData - { - get - { - return Active; - } - } - - /// - /// Get the call data for held call. - /// - public CallData HeldData - { - get - { - return Held; - } - } - } -} diff --git a/src/Tizen.CallManager/Tizen.CallManager/CallManager.cs b/src/Tizen.CallManager/Tizen.CallManager/CallManager.cs deleted file mode 100755 index 4a555f874..000000000 --- a/src/Tizen.CallManager/Tizen.CallManager/CallManager.cs +++ /dev/null @@ -1,83 +0,0 @@ -/* - * 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.CallManager -{ - /// - /// A class which manages the use of Call Manager APIs. - /// - public static class CallManager - { - /// - /// Initializes the call manager. - /// - /// An instance of CmClientHandle class to use call manager APIs. - /// http://tizen.org/feature/network.telephony - /// Thrown when telephony feature is not supported. - /// Thrown when method failed due to invalid operation. - public static CmClientHandle InitCm() - { - int ret = Interop.CallManager.InitCm(out IntPtr handle); - if (ret != (int)CmError.None) - { - Log.Error(CmUtility.LogTag, "Failed to initialize call manager, Error: " + (CmError)ret); - CmUtility.ThrowCmException(ret); - } - - return new CmClientHandle(handle); - } - - /// - /// Deinitializes the Call Manager handle. - /// - /// The Call Manager handle to be deinitialized. - /// Thrown when CmClientHandle is passed as null. - /// Thrown when method failed due to invalid operation. - public static void DeinitCm(CmClientHandle handle) - { - if (handle == null) - { - throw new ArgumentNullException("Call manager client handle is null"); - } - - int ret = Interop.CallManager.DeinitCm(handle._handle); - if (ret != (int)CmError.None) - { - Log.Error(CmUtility.LogTag, "Failed to deinitialize call manager, Error: " + (CmError)ret); - CmUtility.ThrowCmException(ret, handle._handle); - } - - handle._handle = IntPtr.Zero; - } - - /// - /// Sets LCD state for the device display. - /// - /// LCD state to be set. - /// Thrown when method failed due to invalid operation. - public static void SetLcdState(LcdControlState state) - { - int ret = Interop.CallManager.SetLcdState(state); - if (ret != (int)CmError.None) - { - Log.Error(CmUtility.LogTag, "Failed to set LCD state, Error: " + (CmError)ret); - CmUtility.ThrowCmException(ret); - } - } - } -} diff --git a/src/Tizen.CallManager/Tizen.CallManager/CmClientHandle.cs b/src/Tizen.CallManager/Tizen.CallManager/CmClientHandle.cs deleted file mode 100755 index c41dc82bd..000000000 --- a/src/Tizen.CallManager/Tizen.CallManager/CmClientHandle.cs +++ /dev/null @@ -1,1087 +0,0 @@ -/* - * 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.Collections.Generic; -using System.Runtime.InteropServices; - -namespace Tizen.CallManager -{ - /// - /// A class which manages call manager events, properties and functions. - /// - public class CmClientHandle - { - internal IntPtr _handle = IntPtr.Zero; - private event EventHandler _callStatusChanged; - private event EventHandler _callMuteStatusChanged; - private event EventHandler _callEvent; - private event EventHandler _dialStatusChanged; - private event EventHandler _audioStateChanged; - private event EventHandler _dtmfIndication; - private event EventHandler _goForeGround; - private event EventHandler _voiceRecordStatusChanged; - - private Interop.CallManager.CallStatusChangedCallback _callStatusChangedCb; - private Interop.CallManager.CallMuteStatusChangedCallback _callMuteStatusChangedCb; - private Interop.CallManager.CallEventNotificationCallback _callEventCb; - private Interop.CallManager.DialStatusChangedCallback _dialStatusChangedCb; - private Interop.CallManager.AudioStateChangedCallback _audioStateChangedCb; - private Interop.CallManager.DtmfIndicationChangedCallback _dtmfIndicationChangedCb; - private Interop.CallManager.GoForegroundCallback _goForeGroundCb; - private Interop.CallManager.VoiceRecordStatusChangedCallback _voiceRecordStatusChangedCb; - - internal CmClientHandle(IntPtr handle) - { - _handle = handle; - } - - /// - /// This event is raised when call status changes. - /// - public event EventHandler CallStatusChanged - { - add - { - if (_callStatusChanged == null) - { - RegisterCallStatusChangedEvent(); - } - - _callStatusChanged += value; - } - - remove - { - _callStatusChanged -= value; - if (_callStatusChanged == null) - { - UnregisterCallStatusChangedEvent(); - } - } - } - - /// - /// This event is raised when the mute status changes. - /// - public event EventHandler CallMuteStatusChanged - { - add - { - if (_callMuteStatusChanged == null) - { - RegisterCallMuteStatusChangedEvent(); - } - - _callMuteStatusChanged += value; - } - - remove - { - _callMuteStatusChanged -= value; - if (_callMuteStatusChanged == null) - { - UnregisterCallMuteStatusChangedEvent(); - } - } - } - - /// - /// This event is raised when call events change. - /// - public event EventHandler CallEvent - { - add - { - if (_callEvent == null) - { - RegisterCallEventNotification(); - } - - _callEvent += value; - } - - remove - { - _callEvent -= value; - if (_callEvent == null) - { - UnregisterCallEventNotification(); - } - } - } - - /// - /// This event is raised when dial status changes. - /// - public event EventHandler DialStatusChanged - { - add - { - if (_dialStatusChanged == null) - { - RegisterDialStatusEvent(); - } - - _dialStatusChanged += value; - } - - remove - { - _dialStatusChanged -= value; - if (_dialStatusChanged == null) - { - UnregisterDialStatusEvent(); - } - } - } - - /// - /// This event is raised when audio status changes. - /// - public event EventHandler AudioStateChanged - { - add - { - if (_audioStateChanged == null) - { - RegisterAudioStateChangedEvent(); - } - - _audioStateChanged += value; - } - - remove - { - _audioStateChanged -= value; - if (_audioStateChanged == null) - { - UnregisterAudioStateChangedEvent(); - } - } - } - - /// - /// This event is raised during DTMF indication. - /// - public event EventHandler DtmfIndication - { - add - { - if (_dtmfIndication == null) - { - RegisterDtmfIndicationEvent(); - } - - _dtmfIndication += value; - } - - remove - { - _dtmfIndication -= value; - if (_dtmfIndication == null) - { - UnregisterDtmfIndicationEvent(); - } - } - } - - /// - /// This event is raised when call comes to foreground. - /// - public event EventHandler GoForeground - { - add - { - if (_goForeGround == null) - { - RegisterGoForegroundEvent(); - } - - _goForeGround += value; - } - - remove - { - _goForeGround -= value; - if (_goForeGround == null) - { - UnregisterGoForegroundEvent(); - } - } - } - - /// - /// This event is raised when voice record status is changed. - /// - public event EventHandler VoiceRecordStatusChanged - { - add - { - if (_voiceRecordStatusChanged == null) - { - RegisterVoiceRecordStatusEvent(); - } - - _voiceRecordStatusChanged += value; - } - - remove - { - _voiceRecordStatusChanged -= value; - if (_voiceRecordStatusChanged == null) - { - UnregisterVoiceRecordStatusEvent(); - } - } - } - - private void RegisterCallStatusChangedEvent() - { - _callStatusChangedCb = (CallStatus status, string number, IntPtr userData) => - { - _callStatusChanged?.Invoke(null, new CallStatusChangedEventArgs(status, number)); - }; - int ret = Interop.CallManager.SetCallStatusCallback(_handle, _callStatusChangedCb, IntPtr.Zero); - if (ret != (int)CmError.None) - { - Log.Error(CmUtility.LogTag, "Failed to set call status changed callback, Error: " + (CmError)ret); - CmUtility.ThrowCmException(ret, _handle); - } - } - - private void UnregisterCallStatusChangedEvent() - { - int ret = Interop.CallManager.UnsetCallstatusCallback(_handle); - if (ret != (int)CmError.None) - { - Log.Error(CmUtility.LogTag, "Failed to unset call status changed callback, Error: " + (CmError)ret); - CmUtility.ThrowCmException(ret, _handle); - } - } - - private void RegisterCallMuteStatusChangedEvent() - { - _callMuteStatusChangedCb = (CallMuteStatus muteStatus, IntPtr userData) => - { - _callMuteStatusChanged?.Invoke(null, new CallMuteStatusChangedEventArgs(muteStatus)); - }; - int ret = Interop.CallManager.SetCallMuteStatusCallback(_handle, _callMuteStatusChangedCb, IntPtr.Zero); - if (ret != (int)CmError.None) - { - Log.Error(CmUtility.LogTag, "Failed to set call mute status changed callback, Error: " + (CmError)ret); - CmUtility.ThrowCmException(ret, _handle); - } - } - - private void UnregisterCallMuteStatusChangedEvent() - { - int ret = Interop.CallManager.UnsetCallMuteStatusCallback(_handle); - if (ret != (int)CmError.None) - { - Log.Error(CmUtility.LogTag, "Failed to unset call mute status changed callback, Error: " + (CmError)ret); - CmUtility.ThrowCmException(ret, _handle); - } - } - - private void RegisterCallEventNotification() - { - _callEventCb = (CallEvent callEvent, IntPtr eventData, IntPtr userData) => - { - _callEvent?.Invoke(null, new CallEventEventArgs(callEvent, CmUtility.GetCallEventData(eventData))); - }; - int ret = Interop.CallManager.SetCallEventCb(_handle, _callEventCb, IntPtr.Zero); - if (ret != (int)CmError.None) - { - Log.Error(CmUtility.LogTag, "Failed to set call event notification callback, Error: " + (CmError)ret); - CmUtility.ThrowCmException(ret, _handle); - } - } - - private void UnregisterCallEventNotification() - { - int ret = Interop.CallManager.UnsetCallEventCb(_handle); - if (ret != (int)CmError.None) - { - Log.Error(CmUtility.LogTag, "Failed to unset call event notification callback, Error: " + (CmError)ret); - CmUtility.ThrowCmException(ret, _handle); - } - } - - private void RegisterDialStatusEvent() - { - _dialStatusChangedCb = (DialStatus status, IntPtr userData) => - { - _dialStatusChanged?.Invoke(null, new DialStatusEventArgs(status)); - }; - int ret = Interop.CallManager.SetDialStatusCb(_handle, _dialStatusChangedCb, IntPtr.Zero); - if (ret != (int)CmError.None) - { - Log.Error(CmUtility.LogTag, "Failed to set dial status changed callback, Error: " + (CmError)ret); - CmUtility.ThrowCmException(ret, _handle); - } - } - - private void UnregisterDialStatusEvent() - { - int ret = Interop.CallManager.UnsetDialStatusCb(_handle); - if (ret != (int)CmError.None) - { - Log.Error(CmUtility.LogTag, "Failed to unset dial status changed callback, Error: " + (CmError)ret); - CmUtility.ThrowCmException(ret, _handle); - } - } - - private void RegisterAudioStateChangedEvent() - { - _audioStateChangedCb = (AudioState state, IntPtr userData) => - { - _audioStateChanged?.Invoke(null, new AudioStatusChangedEventArgs(state)); - }; - int ret = Interop.CallManager.SetAudioStateChangedCb(_handle, _audioStateChangedCb, IntPtr.Zero); - if (ret != (int)CmError.None) - { - Log.Error(CmUtility.LogTag, "Failed to set audio state changed callback, Error: " + (CmError)ret); - CmUtility.ThrowCmException(ret, _handle); - } - } - - private void UnregisterAudioStateChangedEvent() - { - int ret = Interop.CallManager.UnsetAudioStateChangedCb(_handle); - if (ret != (int)CmError.None) - { - Log.Error(CmUtility.LogTag, "Failed to unset audio state changed callback, Error: " + (CmError)ret); - CmUtility.ThrowCmException(ret, _handle); - } - } - - private void RegisterDtmfIndicationEvent() - { - _dtmfIndicationChangedCb = (DtmfIndication indiType, string number, IntPtr userData) => - { - _dtmfIndication?.Invoke(null, new DtmfIndicationEventArgs(indiType, number)); - }; - int ret = Interop.CallManager.SetDtmfIndicationCb(_handle, _dtmfIndicationChangedCb, IntPtr.Zero); - if (ret != (int)CmError.None) - { - Log.Error(CmUtility.LogTag, "Failed to set DTMF indication changed callback, Error: " + (CmError)ret); - CmUtility.ThrowCmException(ret, _handle); - } - } - - private void UnregisterDtmfIndicationEvent() - { - int ret = Interop.CallManager.UnsetDtmfIndicationCb(_handle); - if (ret != (int)CmError.None) - { - Log.Error(CmUtility.LogTag, "Failed to unset DTMF indication changed callback, Error: " + (CmError)ret); - CmUtility.ThrowCmException(ret, _handle); - } - } - - private void RegisterGoForegroundEvent() - { - _goForeGroundCb = (IntPtr userData) => - { - _goForeGround?.Invoke(null, EventArgs.Empty); - }; - int ret = Interop.CallManager.SetForegroundCb(_handle, _goForeGroundCb, IntPtr.Zero); - if (ret != (int)CmError.None) - { - Log.Error(CmUtility.LogTag, "Failed to set go foreground callback, Error: " + (CmError)ret); - CmUtility.ThrowCmException(ret, _handle); - } - } - - private void UnregisterGoForegroundEvent() - { - int ret = Interop.CallManager.UnsetForegroundCb(_handle); - if (ret != (int)CmError.None) - { - Log.Error(CmUtility.LogTag, "Failed to unset go foreground callback, Error: " + (CmError)ret); - CmUtility.ThrowCmException(ret, _handle); - } - } - - private void RegisterVoiceRecordStatusEvent() - { - _voiceRecordStatusChangedCb = (VrStatus vrStatus, VrStatusExtraType extraType, IntPtr userData) => - { - _voiceRecordStatusChanged?.Invoke(null, new VoiceRecordStatusEventArgs(vrStatus, extraType)); - }; - int ret = Interop.CallManager.SetVoiceRecordStatusCb(_handle, _voiceRecordStatusChangedCb, IntPtr.Zero); - if (ret != (int)CmError.None) - { - Log.Error(CmUtility.LogTag, "Failed to set voice record status changed callback, Error: " + (CmError)ret); - CmUtility.ThrowCmException(ret, _handle); - } - } - - private void UnregisterVoiceRecordStatusEvent() - { - int ret = Interop.CallManager.UnsetVoiceRecordStatusCb(_handle); - if (ret != (int)CmError.None) - { - Log.Error(CmUtility.LogTag, "Failed to unset voice record status changed callback, Error: " + (CmError)ret); - CmUtility.ThrowCmException(ret, _handle); - } - } - - public CallStatus CallStatus - { - get - { - int ret = Interop.CallManager.GetStatus(_handle, out CallStatus status); - if (ret != (int)CmError.None) - { - Log.Error(CmUtility.LogTag, "Failed to get call status, Error: " + (CmError)ret); - return default(CallStatus); - } - - return status; - } - } - - /// - /// Gets the mute status. - /// - public CallMuteStatus CallMuteStatus - { - get - { - int ret = Interop.CallManager.GetMuteStatus(_handle, out CallMuteStatus status); - if (ret != (int)CmError.None) - { - Log.Error(CmUtility.LogTag, "Failed to get call mute status, Error: " + (CmError)ret); - return default(CallMuteStatus); - } - - return status; - } - } - - /// - /// Gets the audio state. - /// - public AudioState AudioState - { - get - { - int ret = Interop.CallManager.GetAudioState(_handle, out AudioState state); - if (ret != (int)CmError.None) - { - Log.Error(CmUtility.LogTag, "Failed to get audio state, Error: " + (CmError)ret); - return default(AudioState); - } - - return state; - } - } - - /// - /// Gets the list of call data. - /// - public IEnumerable AllCalls - { - get - { - int ret = Interop.CallManager.GetAllCallList(_handle, out IntPtr list); - if (ret != (int)CmError.None) - { - Log.Error(CmUtility.LogTag, "Failed to get all call list, Error: " + (CmError)ret); - return null; - } - - List callList = new List(); - int offset = 0; - IntPtr data = Marshal.ReadIntPtr(list, offset); - if (data != IntPtr.Zero) - { - do - { - offset += Marshal.SizeOf(data); - callList.Add(CmUtility.GetCallData(data)); - Interop.CallManager.FreeCallData(data); - data = IntPtr.Zero; - } - - while ((data = Marshal.ReadIntPtr(list, offset)) != IntPtr.Zero); - } - - return callList; - } - } - - /// - /// Gets the list of conference call data. - /// - public IEnumerable AllConferenceCalls - { - get - { - int ret = Interop.CallManager.GetConferenceCallList(_handle, out IntPtr list); - if (ret != (int)CmError.None) - { - Log.Error(CmUtility.LogTag, "Failed to get conference call list, Error: " + (CmError)ret); - return null; - } - - List confList = new List(); - int offset = 0; - IntPtr data = Marshal.ReadIntPtr(list, offset); - if (data != IntPtr.Zero) - { - do - { - offset += Marshal.SizeOf(data); - confList.Add(CmUtility.GetConfCallData(data)); - Interop.CallManager.FreeConfCallData(data); - data = IntPtr.Zero; - } - - while ((data = Marshal.ReadIntPtr(list, offset)) != IntPtr.Zero); - } - - return confList; - } - } - - /// - /// Rejects the incoming call. - /// - /// partner - /// http://developer.samsung.com/tizen/privilege/call.reject - /// Thrown when privilege access is denied. - /// Thrown when method failed due to invalid operation. - public void RejectCall() - { - int ret = Interop.CallManager.RejectCall(_handle); - if (ret != (int)CmError.None) - { - Log.Error(CmUtility.LogTag, "Failed to reject call, Error: " + (CmError)ret); - CmUtility.ThrowCmException(ret, _handle, "http://developer.samsung.com/tizen/privilege/call.reject"); - } - } - - /// - /// Starts incoming call alert ringtone. - /// - /// Thrown when privilege access is denied. - /// Thrown when method failed due to invalid operation. - public void StartAlert() - { - int ret = Interop.CallManager.StartAlert(_handle); - if (ret != (int)CmError.None) - { - Log.Error(CmUtility.LogTag, "Failed to start incoming call alert, Error: " + (CmError)ret); - CmUtility.ThrowCmException(ret, _handle); - } - } - - /// - /// Stops incoming call alert ringtone. - /// - /// partner - /// http://developer.samsung.com/tizen/privilege/call.reject - /// Thrown when privilege access is denied. - /// Thrown when method failed due to invalid operation. - public void StopAlert() - { - int ret = Interop.CallManager.StopAlert(_handle); - if (ret != (int)CmError.None) - { - Log.Error(CmUtility.LogTag, "Failed to stop incoming call alert, Error: " + (CmError)ret); - CmUtility.ThrowCmException(ret, _handle, "http://developer.samsung.com/tizen/privilege/call.reject"); - } - } - - /// - /// Enables call recovery. - /// - /// App ID to be recovered. - /// Thrown appId is passed as null. - /// Thrown when method failed due to invalid operation. - public void EnableRecovery(string appId) - { - if (appId == null) - { - throw new ArgumentNullException("App ID is null"); - } - - int ret = Interop.CallManager.EnableRecovery(_handle, appId); - if (ret != (int)CmError.None) - { - Log.Error(CmUtility.LogTag, "Failed to enable recovery, Error: " + (CmError)ret); - CmUtility.ThrowCmException(ret, _handle); - } - } - - /// - /// Dials a call. - /// - /// Calling number to be dialed. - /// Type of the call to be dialed. - /// Multi sim slot type in which the call is dialed. - /// Thrown when privilege access is denied. - /// Thrown number is passed as null. - /// Thrown when method failed due to invalid operation. - public void DialCall(string number, CallType type, MultiSimSlot slot) - { - if (number == null) - { - throw new ArgumentNullException("Calling number is null"); - } - - int ret = Interop.CallManager.DialCall(_handle, number, type, slot); - if (ret != (int)CmError.None) - { - Log.Error(CmUtility.LogTag, "Failed to dial call, Error: " + (CmError)ret); - CmUtility.ThrowCmException(ret, _handle); - } - } - - /// - /// Swaps the calls. - /// - /// Thrown when method failed due to invalid operation. - public void SwapCall() - { - int ret = Interop.CallManager.SwapCall(_handle); - if (ret != (int)CmError.None) - { - Log.Error(CmUtility.LogTag, "Failed to swap call, Error: " + (CmError)ret); - CmUtility.ThrowCmException(ret, _handle); - } - } - - /// - /// Joins a call with another. - /// - /// Thrown when method failed due to invalid operation. - public void JoinCall() - { - int ret = Interop.CallManager.JoinCall(_handle); - if (ret != (int)CmError.None) - { - Log.Error(CmUtility.LogTag, "Failed to join call, Error: " + (CmError)ret); - CmUtility.ThrowCmException(ret, _handle); - } - } - - /// - /// Splits a call. - /// - /// Call id to be splitted. - /// Thrown when method failed due to invalid operation. - public void SplitCall(uint id) - { - int ret = Interop.CallManager.SplitCall(_handle, id); - if (ret != (int)CmError.None) - { - Log.Error(CmUtility.LogTag, "Failed to split call, Error: " + (CmError)ret); - CmUtility.ThrowCmException(ret, _handle); - } - } - - /// - /// Transfers a call. - /// - /// Thrown when method failed due to invalid operation. - public void TransferCall() - { - int ret = Interop.CallManager.TransferCall(_handle); - if (ret != (int)CmError.None) - { - Log.Error(CmUtility.LogTag, "Failed to transfer call, Error: " + (CmError)ret); - CmUtility.ThrowCmException(ret, _handle); - } - } - - /// - /// Accepts MT ViLTE call as VoLTE. - /// - /// Call answer type. - /// Call type. - /// Thrown when method failed due to invalid operation. - public void AnswerCallEx(CallAnswerType answerType, CallType type) - { - int ret = Interop.CallManager.AnswerCallEx(_handle, answerType, type); - if (ret != (int)CmError.None) - { - Log.Error(CmUtility.LogTag, "Failed to answer call, Error: " + (CmError)ret); - CmUtility.ThrowCmException(ret, _handle); - } - } - - /// - /// Answers an incoming call. - /// - /// Call answer type. - /// Thrown when method failed due to invalid operation. - public void AnswerCall(CallAnswerType answerType) - { - int ret = Interop.CallManager.AnswerCall(_handle, answerType); - if (ret != (int)CmError.None) - { - Log.Error(CmUtility.LogTag, "Failed to answer call, Error: " + (CmError)ret); - CmUtility.ThrowCmException(ret, _handle); - } - } - - /// - /// Upgrades a call. - /// - /// Thrown when method failed due to invalid operation. - public void UpgradeCall() - { - int ret = Interop.CallManager.UpgradeCall(_handle); - if (ret != (int)CmError.None) - { - Log.Error(CmUtility.LogTag, "Failed to upgrade call, Error: " + (CmError)ret); - CmUtility.ThrowCmException(ret, _handle); - } - } - - /// - /// Downgrades a call. - /// - /// Thrown when method failed due to invalid operation. - public void DowngradeCall() - { - int ret = Interop.CallManager.DowngradeCall(_handle); - if (ret != (int)CmError.None) - { - Log.Error(CmUtility.LogTag, "Failed to downgrade call, Error: " + (CmError)ret); - CmUtility.ThrowCmException(ret, _handle); - } - } - - /// - /// Confirms upgrade call request. - /// - /// Upgrade response type. - /// Thrown when method failed due to invalid operation. - public void ConfirmUpgradeCall(CallUpgradeResponseType response) - { - int ret = Interop.CallManager.ConfirmUpgradeCall(_handle, response); - if (ret != (int)CmError.None) - { - Log.Error(CmUtility.LogTag, "Failed to confirm upgrade call, Error: " + (CmError)ret); - CmUtility.ThrowCmException(ret, _handle); - } - } - - /// - /// Sets the speaker on/off. - /// - /// Status of the speaker to be set. - /// Thrown when method failed due to invalid operation. - public void ManageSpeaker(FeatureStatus status) - { - int ret = -1; - if (status == FeatureStatus.Off) - { - ret = Interop.CallManager.SpeakerOff(_handle); - } - - else if (status == FeatureStatus.On) - { - ret = Interop.CallManager.SpeakerOn(_handle); - } - - if (ret != (int)CmError.None) - { - Log.Error(CmUtility.LogTag, "Failed to manage speaker, Error: " + (CmError)ret); - CmUtility.ThrowCmException(ret, _handle); - } - } - - /// - /// Sets the bluetooth feature on/off. - /// - /// Status of the bluetooth to be set. - /// Thrown when method failed due to invalid operation. - public void ManageBluetooth(FeatureStatus status) - { - int ret = -1; - if (status == FeatureStatus.Off) - { - ret = Interop.CallManager.BluetoothOff(_handle); - } - - else if (status == FeatureStatus.On) - { - ret = Interop.CallManager.BluetoothOn(_handle); - } - - if (ret != (int)CmError.None) - { - Log.Error(CmUtility.LogTag, "Failed to manage bluetooth, Error: " + (CmError)ret); - CmUtility.ThrowCmException(ret, _handle); - } - } - - /// - /// Sets extra volume if needed. - /// - /// Boolean value to indicate if the call is set to have extra volume. - /// Thrown when method failed due to invalid operation. - public void SetExtraVolume(bool isExtraVolume) - { - int ret = Interop.CallManager.SetExtraVolume(_handle, isExtraVolume); - if (ret != (int)CmError.None) - { - Log.Error(CmUtility.LogTag, "Failed to set extra volume, Error: " + (CmError)ret); - CmUtility.ThrowCmException(ret, _handle); - } - } - - /// - /// Sets the noise reduction feature during call. - /// - /// Boolean value to indicate whether the call needs noise reduction. - /// Thrown when method failed due to invalid operation. - public void SetNoiseReduction(bool isNoiceReduction) - { - int ret = Interop.CallManager.SetNoiseReduction(_handle, isNoiceReduction); - if (ret != (int)CmError.None) - { - Log.Error(CmUtility.LogTag, "Failed to set noise reduction, Error: " + (CmError)ret); - CmUtility.ThrowCmException(ret, _handle); - } - } - - /// - /// Sets the mute state of the call. - /// - /// Mute state to be set. - /// Thrown when method failed due to invalid operation. - public void SetMuteState(bool isMuteState) - { - int ret = Interop.CallManager.SetMuteState(_handle, isMuteState); - if (ret != (int)CmError.None) - { - Log.Error(CmUtility.LogTag, "Failed to set mute state, Error: " + (CmError)ret); - CmUtility.ThrowCmException(ret, _handle); - } - } - - /// - /// Starts sending signal through DTMF digit. - /// - /// DTMF digit to be pressed on the phone. - /// Thrown when method failed due to invalid parameter. - /// Thrown when method failed due to invalid operation. - public void StartDtmf(byte dtmfDigit) - { - int ret = Interop.CallManager.StartDtmf(_handle, dtmfDigit); - if (ret != (int)CmError.None) - { - Log.Error(CmUtility.LogTag, "Failed to start DTMF, Error: " + (CmError)ret); - CmUtility.ThrowCmException(ret, _handle); - } - } - - /// - /// Stops sending DTMF signal. - /// - /// Thrown when method failed due to invalid operation. - public void StopDtmf() - { - int ret = Interop.CallManager.StopDtmf(_handle); - if (ret != (int)CmError.None) - { - Log.Error(CmUtility.LogTag, "Failed to stop DTMF, Error: " + (CmError)ret); - CmUtility.ThrowCmException(ret, _handle); - } - } - - /// - /// Sends signal through DTMF digits. - /// - /// DTMF digits. - /// Thrown when dtmfDigits is passed as null. - /// Thrown when method failed due to invalid operation. - public void BurstDtmf(string dtmfDigits) - { - if (dtmfDigits == null) - { - throw new ArgumentNullException("DTMF digits is null"); - } - - int ret = Interop.CallManager.BurstDtmf(_handle, dtmfDigits); - if (ret != (int)CmError.None) - { - Log.Error(CmUtility.LogTag, "Failed to burst DTMF, Error: " + (CmError)ret); - CmUtility.ThrowCmException(ret, _handle); - } - } - - /// - /// Sends DTMF response. - /// - /// DTMF response type. - /// Thrown when method failed due to invalid operation. - public void SendDtmfResponse(DtmfResponseType response) - { - int ret = Interop.CallManager.SendDtmfResponse(_handle, response); - if (ret != (int)CmError.None) - { - Log.Error(CmUtility.LogTag, "Failed to send DTMF response, Error: " + (CmError)ret); - CmUtility.ThrowCmException(ret, _handle); - } - } - - /// - /// Activates call manager UI. - /// - /// Thrown when method failed due to invalid operation. - public void ActivateUi() - { - int ret = Interop.CallManager.ActivateUi(_handle); - if (ret != (int)CmError.None) - { - Log.Error(CmUtility.LogTag, "Failed to activate UI, Error: " + (CmError)ret); - CmUtility.ThrowCmException(ret, _handle); - } - } - - /// - /// Sets device LCD time out. - /// - /// LCD timeout to be set. - /// Thrown when method failed due to invalid operation. - public void SetLcdTimeout(LcdTimeOut timeout) - { - int ret = Interop.CallManager.SetLcdTimeOut(_handle, timeout); - if (ret != (int)CmError.None) - { - Log.Error(CmUtility.LogTag, "Failed to set LCD timeout, Error: " + (CmError)ret); - CmUtility.ThrowCmException(ret, _handle); - } - } - - /// - /// Starts voice recording. - /// - /// Call number. - /// Thrown when number is passed as null. - /// Thrown when method failed due to invalid operation. - public void StartVoiceRecord(string number) - { - if (number == null) - { - throw new ArgumentNullException("Call number is null"); - } - - int ret = Interop.CallManager.StartVoiceRecord(_handle, number); - if (ret != (int)CmError.None) - { - Log.Error(CmUtility.LogTag, "Failed to start voice record, Error: " + (CmError)ret); - CmUtility.ThrowCmException(ret, _handle); - } - } - - /// - /// Stops voice record. - /// - /// Thrown when method failed due to invalid operation. - public void StopVoiceRecord() - { - int ret = Interop.CallManager.StopVoiceRecord(_handle); - if (ret != (int)CmError.None) - { - Log.Error(CmUtility.LogTag, "Failed to stop voice record, Error: " + (CmError)ret); - CmUtility.ThrowCmException(ret, _handle); - } - } - - /// - /// Gets all current call data. - /// - /// Incoming calldata instance to be filled. - /// Active calldata instance to be filled. - /// Held calldata instance to be filled. - /// Thrown when method failed due to invalid operation. - public void GetAllCallData(out CallData incoming, out CallData active, out CallData held) - { - int ret = Interop.CallManager.GetAllCallData(_handle, out IntPtr incomingCall, out IntPtr activeCall, out IntPtr heldCall); - if (ret != (int)CmError.None) - { - Log.Error(CmUtility.LogTag, "Failed to get all call data, Error: " + (CmError)ret); - CmUtility.ThrowCmException(ret, _handle); - } - - incoming = CmUtility.GetCallData(incomingCall); - active = CmUtility.GetCallData(activeCall); - held = CmUtility.GetCallData(heldCall); - } - - /// - /// Holds the active call. - /// - /// platform - /// http://developer.samsung.com/tizen/privilege/call.admin - /// Thrown when privilege access is denied. - /// Thrown when method failed due to invalid operation. - public void HoldCall() - { - int ret = Interop.CallManager.HoldCall(_handle); - if (ret != (int)CmError.None) - { - Log.Error(CmUtility.LogTag, "Failed to hold call, Error: " + (CmError)ret); - CmUtility.ThrowCmException(ret, _handle, "http://developer.samsung.com/tizen/privilege/call.admin"); - } - } - - /// - /// Unholds the active call. - /// - /// platform - /// http://developer.samsung.com/tizen/privilege/call.admin - /// Thrown when privilege access is denied. - /// Thrown when method failed due to invalid operation. - public void UnholdCall() - { - int ret = Interop.CallManager.UnholdCall(_handle); - if (ret != (int)CmError.None) - { - Log.Error(CmUtility.LogTag, "Failed to unhold call, Error: " + (CmError)ret); - CmUtility.ThrowCmException(ret, _handle, "http://developer.samsung.com/tizen/privilege/call.admin"); - } - } - - /// - /// Ends ongoing call. - /// - /// ID of the call which is to be ended. - /// Call release type. - /// platform - /// http://developer.samsung.com/tizen/privilege/call.admin - /// Thrown when privilege access is denied. - /// Thrown when method failed due to invalid operation. - public void EndCall(uint id, CallReleaseType type) - { - int ret = Interop.CallManager.EndCall(_handle, id, type); - if (ret != (int)CmError.None) - { - Log.Error(CmUtility.LogTag, "Failed to end call, Error: " + (CmError)ret); - CmUtility.ThrowCmException(ret, _handle, "http://developer.samsung.com/tizen/privilege/call.admin"); - } - } - } -} diff --git a/src/Tizen.CallManager/Tizen.CallManager/CmEnumerations.cs b/src/Tizen.CallManager/Tizen.CallManager/CmEnumerations.cs deleted file mode 100755 index a7965dd36..000000000 --- a/src/Tizen.CallManager/Tizen.CallManager/CmEnumerations.cs +++ /dev/null @@ -1,692 +0,0 @@ -/* - * 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. - */ - -namespace Tizen.CallManager -{ - /// - /// Enumeration for Call status. - /// - public enum CallStatus - { - /// - /// Call is in idle state. - /// - Idle, - /// - /// A new call arrived and is ringing or waiting. - /// - Ringing, - /// - /// At least one call exist that is in dialing, alerting, active, on hold state. - /// - OffHook, - /// - /// Max state. - /// - Max - } - - /// - /// Enumeration for Mute status. - /// - public enum CallMuteStatus - { - /// - /// Mute state is off. - /// - Off, - /// - /// Mute state is on. - /// - On, - /// - /// Max status. - /// - Max - } - - /// - /// Enumeration for call dial status. - /// - public enum DialStatus - { - /// - /// Dial status is success. - /// - Success = 0, - /// - /// Dial status is cancel. - /// - Cancel, - /// - /// Dial status is fail. - /// - Fail, - /// - /// Dial status is fail SS. - /// - FailSS, - /// - /// Dial status is fail FDN. - /// - FailFdn, - /// - /// Dial status is fail flight mode. - /// - FailFlightMode - } - - /// - /// Enumeration for DTMF indication type. - /// - public enum DtmfIndication - { - /// - /// DTMF indication type is idle. - /// - Idle = 0, - /// - /// DTMF indication type is progressing. - /// - Progressing, - /// - /// DTMF indication type is wait. - /// - Wait - } - - /// - /// Enumeration for audio state type. - /// - public enum AudioState - { - /// - /// None. - /// - None, - /// - /// System LoudSpeaker path. - /// - Speaker, - /// - /// System Receiver. - /// - Receiver, - /// - /// Earjack path. - /// - EarJack, - /// - /// System BT Headset path. - /// - BTHeadset - } - - /// - /// Enumeration for video record status. - /// - public enum VrStatus - { - /// - /// Video recording is started. - /// - Started = 0, - /// - /// Video recording is stopped. - /// - Stopped - } - - /// - /// Enumeration for Video record status extra type. - /// - public enum VrStatusExtraType - { - /// - /// Start. - /// - Start = 0x00, - /// - /// Normal recording. - /// - StartNormal, - /// - /// Answering message. - /// - StartAnswerMessage, - /// - /// Start max. - /// - StartMax = 0x0f, - /// - /// Stop. - /// - Stop = 0x10, - /// - /// Stop by normal. - /// - StopByNormal, - /// - /// Stop by max size. - /// - StopByMaxSize, - /// - /// Stop by no free space. - /// - StopByNoFreeSpace, - /// - /// Stop by time limit. - /// - StopByTimeLimit, - /// - /// Error. - /// - StopError, - /// - /// Stop by max. - /// - StopMax = 0x1f - } - - /// - /// Enumeration for call type. - /// - public enum CallType - { - /// - /// Voice call type. - /// - Voice, - /// - /// Video call type. - /// - Video, - /// - /// Invalid call type. - /// - Invalid - } - - /// - /// Enumeration for sim slot type. - /// - public enum MultiSimSlot - { - /// - /// Sim slot 1. - /// - Slot1, - /// - /// Sim slot 2. - /// - Slot2, - /// - /// Follow system configuration. - /// - Default - } - - /// - /// Enumeration for call answer types for accepting the incoming call. - /// - public enum CallAnswerType - { - /// - /// Only single call exist, Accept the Incoming call. - /// - Normal = 0, - /// - /// Put the active call on hold and accepts the call. - /// - HoldActiveAndAccept, - /// - /// Releases the active call and accept the call. - /// - ReleaseActiveAndAccept, - /// - /// Releases the held call and accept the call. - /// - ReleaseHoldAndAccept, - /// - /// Releases all calls and accept the call. - /// - ReleaseAllAndAccept - } - - /// - /// Enumeration for call upgrade response type while receiving upgrade request. - /// - public enum CallUpgradeResponseType - { - /// - /// Accept incoming upgrade request. - /// - Accept, - /// - /// Reject Incoming upgrade request. - /// - Reject - } - - /// - /// Enumeration for feature(speaker/bluetooth) status. - /// - public enum FeatureStatus - { - /// - /// On. - /// - On, - /// - /// Off. - /// - Off - } - - /// - /// Enumeration for DTMF response type. - /// - public enum DtmfResponseType - { - /// - /// Cancel. - /// - Cancel = 0, - /// - /// Continue. - /// - Continue - } - - /// - /// Enumeration for LCD time out. - /// - public enum LcdTimeOut - { - /// - /// Set. - /// - Set = 1, - /// - /// Unset. - /// - Unset, - /// - /// After lock-screen comes in Connected state LCD goes to OFF in 5 secs. - /// - LockscreenSet, - /// - /// When Keypad is ON, LCD goes to DIM in 3 secs then goes to OFF in 5 secs. - /// - KeypadSet, - /// - /// Default. - /// - Default - } - - /// - /// Enumeration for contact name mode. - /// - public enum CallNameMode - { - /// - /// None. - /// - None, - /// - /// Unknown. - /// - Unknown, - /// - /// Private. - /// - Private, - /// - /// Payphone. - /// - PayPhone - } - - /// - /// Enumeration for LCD control state. - /// - public enum LcdControlState - { - /// - /// Off. - /// - Off = 1, - /// - /// On. - /// - On, - /// - /// On lock. - /// - OnLock, - /// - /// On unlock. - /// - OnUnlock, - /// - /// Off sleep lock. - /// - OffSleepLock, - /// - /// Off sleep unlock. - /// - OffSleepUnlock - } - - /// - /// Enumeration for call event type. - /// - public enum CallEvent - { - /// - /// Call Idle event. - /// - Idle = 0, - /// - /// Call Dialling event. - /// - Dialing, - /// - /// Call Active event. - /// - Active, - /// - /// Call Held event. - /// - Held, - /// - /// Call Alert event. - /// - Alert, - /// - /// Call Incoming event. - /// - Incoming, - /// - /// Call Waiting event. - /// - Waiting, - /// - /// Call Join event. - /// - Join, - /// - /// Call Split event. - /// - Split, - /// - /// Call Swapped event. - /// - Swapped, - /// - /// Call Retrieved event. - /// - Retrieved, - /// - /// Sat call control event. - /// - SatCallControl, - /// - /// Call upgrade request event. - /// - UpgradeRequest, - /// - /// Call downgraded event. - /// - Downgraded, - /// - /// Call upgrade success event. - /// - UpgradeSuccess, - /// - /// Call upgrade failure event. - /// - UpgradeFailure, - /// - /// Call downgrade success event. - /// - DowngradeSuccess, - /// - /// Call downgrade failure event. - /// - DowngradeFailure, - /// - /// Call confirm upgrade success event. - /// - ConfirmUpgradeSuccess, - /// - /// Call confirm upgrade failure event. - /// - ConfirmUpgradeFailure, - /// - /// VoWiFi ~ LTE hand-over update event. - /// - VoWiFiLteHandoverUpdate - } - - /// - /// Enumeration for call direction - /// - public enum CallDirection - { - /// - /// MO call. - /// - MO, - /// - /// MT call. - /// - MT - } - - /// - /// Enumeration for the call state. - /// - public enum CallState - { - /// - /// Call is in idle state. - /// - Idle, - /// - /// Call is in connected and conversation state. - /// - Active, - /// - /// Call is in held state. - /// - Held, - /// - /// Call is in dialing state. - /// - Dialing, - /// - /// Call is in alerting state. - /// - Alert, - /// - /// Call is in incoming state. - /// - Incoming, - /// - /// Call is in answered state, and waiting for connected indication event. - /// - Waiting - } - - /// - /// Enumeration for call domain. - /// - public enum CallDomain - { - /// - /// CS call domain. - /// - Cs, - /// - /// PS call domain. - /// - Ps, - /// - /// Wearable call through BT handsfree profile. - /// - Hfp - } - - /// - /// Enumeration for call end cause type. - /// - public enum CallEndCause - { - /// - /// Call ended. - /// - Ended, - /// - /// Call disconnected. - /// - Disconnected, - /// - /// Service not allowed. - /// - ServiceNotAllowed, - /// - /// Call barred. - /// - Barred, - /// - /// No service. - /// - NoService, - /// - /// Network busy. - /// - NwBusy, - /// - /// Network failed. - /// - NwFailed, - /// - /// No answer from other party. - /// - NoAnswer, - /// - /// No credit available. - /// - NoCredit, - /// - /// Call rejected. - /// - Rejected, - /// - /// User busy. - /// - UserBusy, - /// - /// Wrong group. - /// - WrongGroup, - /// - /// Call not allowed. - /// - NotAllowed, - /// - /// Tapi error. - /// - TapiError, - /// - /// Call failed. - /// - Failed, - /// - /// User not responding. - /// - NoUserResponding, - /// - /// User alerting no answer. - /// - UserAlertingNoAnswer, - /// - /// Circuit Channel Unavailable,Network is out of Order,Switching equipment congestion,Temporary Failure. - /// - ServiceTempUnavailable, - /// - /// Called Party Rejects the Call. - /// - UserUnavailable, - /// - /// Entered number is invalid or incomplete. - /// - InvalidNumberFormat, - /// - /// Entered number has been changed. - /// - NumberChanged, - /// - /// Unassigned/Unallocated number. - /// - UnassignedNumber, - /// - /// Called Party does not respond. - /// - UserDoesNotRespond, - /// - /// IMEI rejected. - /// - ImeiRejected, - /// - /// FDN number only. - /// - FixedDialingNumberOnly, - /// - /// SAT call control reject. - /// - SatCallControlReject, - /// - /// This number cannot receive video calls. - /// - CannotReceiveVideoCall - } - - /// - /// Enumeration for call release type. - /// - public enum CallReleaseType - { - /// - /// Release call using given call handle. - /// - ByCallHandle = 0, - /// - /// Release all Calls. - /// - AllCalls, - /// - /// Releases all hold calls. - /// - AllHoldCalls, - /// - /// Releases all active calls. - /// - AllActiveCalls - } -} diff --git a/src/Tizen.CallManager/Tizen.CallManager/CmEventArgs.cs b/src/Tizen.CallManager/Tizen.CallManager/CmEventArgs.cs deleted file mode 100755 index 77a69fd99..000000000 --- a/src/Tizen.CallManager/Tizen.CallManager/CmEventArgs.cs +++ /dev/null @@ -1,240 +0,0 @@ -/* - * 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.CallManager -{ - /// - /// An extended EventArgs class which contains information about DTMF indication. - /// - public class DtmfIndicationEventArgs : EventArgs - { - private DtmfIndication _indication; - private string _dtmfNumber; - - internal DtmfIndicationEventArgs(DtmfIndication indication, string dtmfNumber) - { - _indication = indication; - _dtmfNumber = dtmfNumber; - } - - /// - /// DTMF indication. - /// - public DtmfIndication Indication - { - get - { - return _indication; - } - } - - /// - /// DTMF number. - /// - public string DtmfNumber - { - get - { - return _dtmfNumber; - } - } - } - - /// - /// An extended EventArgs class which contains changed audio status. - /// - public class AudioStatusChangedEventArgs : EventArgs - { - private AudioState _state; - - internal AudioStatusChangedEventArgs(AudioState state) - { - _state = state; - } - - /// - /// Audio state. - /// - public AudioState State - { - get - { - return _state; - } - } - } - - /// - /// An extended EventArgs class which contains changed voice record status. - /// - public class VoiceRecordStatusEventArgs : EventArgs - { - private VrStatus _status; - private VrStatusExtraType _extraType; - - internal VoiceRecordStatusEventArgs(VrStatus status, VrStatusExtraType extraType) - { - _status = status; - _extraType = extraType; - } - - /// - /// Voice record status. - /// - public VrStatus Status - { - get - { - return _status; - } - } - - /// - /// Voice record status extra type. - /// - public VrStatusExtraType ExtraType - { - get - { - return _extraType; - } - } - } - - /// - /// An extended EventArgs class which contains changed call mute status. - /// - public class CallMuteStatusChangedEventArgs : EventArgs - { - private CallMuteStatus _Status; - - internal CallMuteStatusChangedEventArgs(CallMuteStatus status) - { - _Status = status; - } - - /// - /// Call mute status. - /// - public CallMuteStatus Status - { - get - { - return _Status; - } - } - } - - /// - /// An extended EventArgs class which contains changed call status. - /// - public class CallStatusChangedEventArgs : EventArgs - { - private CallStatus _status; - private string _callNumber; - - internal CallStatusChangedEventArgs(CallStatus status, string number) - { - _status = status; - _callNumber = number; - } - - /// - /// Call status. - /// - public CallStatus Status - { - get - { - return _status; - } - } - - /// - /// Call number. - /// - public string CallNumber - { - get - { - return _callNumber; - } - } - } - - /// - /// An extended EventArgs class which contains changed dial status. - /// - public class DialStatusEventArgs : EventArgs - { - private DialStatus _status; - - internal DialStatusEventArgs(DialStatus status) - { - _status = status; - } - - /// - /// Dial status. - /// - public DialStatus Status - { - get - { - return _status; - } - } - } - - /// - /// An extended EventArgs class which contains changed call event. - /// - public class CallEventEventArgs : EventArgs - { - private CallEvent _event; - private CallEventData _eventData; - - internal CallEventEventArgs(CallEvent callEvent, CallEventData data) - { - _event = callEvent; - _eventData = data; - } - - /// - /// Call event. - /// - public CallEvent Event - { - get - { - return _event; - } - } - - /// - /// Call event data. - /// - public CallEventData EventData - { - get - { - return _eventData; - } - } - } -} diff --git a/src/Tizen.CallManager/Tizen.CallManager/CmUtility.cs b/src/Tizen.CallManager/Tizen.CallManager/CmUtility.cs deleted file mode 100755 index 91d2c490a..000000000 --- a/src/Tizen.CallManager/Tizen.CallManager/CmUtility.cs +++ /dev/null @@ -1,425 +0,0 @@ -/* - * 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.CallManager -{ - internal enum CmError - { - None = ErrorCode.None, - OutOfMemory = ErrorCode.OutOfMemory, - InvalidParameter = ErrorCode.InvalidParameter, - PermissionDenied = ErrorCode.PermissionDenied, - NotSupported = ErrorCode.NotSupported, - NotRegistered = -0x00000000 | 0x01, - AlreadyRegistered = -0x00000000 | 0x02, - OperationFailed = -0x00000000 | 0x03, - InvalidState = -0x00000000 | 0x04 - } - - internal static class CmUtility - { - internal const string LogTag = "Tizen.CallManager"; - - internal static CallData GetCallData(IntPtr handle) - { - CallData data = new CallData(); - int ret = Interop.CallManager.GetCallId(handle, out uint id); - if (ret != (int)CmError.None) - { - Log.Error(CmUtility.LogTag, "Failed to get call ID from call data, Error: " + (CmError)ret); - } - - else - { - data.CallId = id; - } - - ret = Interop.CallManager.GetCallDirection(handle, out CallDirection direction); - if (ret != (int)CmError.None) - { - Log.Error(CmUtility.LogTag, "Failed to get call direction from call data, Error: " + (CmError)ret); - } - - else - { - data.CallDirection = direction; - } - - ret = Interop.CallManager.GetCallNumber(handle, out string number); - if (ret != (int)CmError.None) - { - Log.Error(CmUtility.LogTag, "Failed to get call number from call data, Error: " + (CmError)ret); - } - - else - { - data.Number = number; - } - - ret = Interop.CallManager.GetCallingName(handle, out string name); - if (ret != (int)CmError.None) - { - Log.Error(CmUtility.LogTag, "Failed to get calling name from call data, Error: " + (CmError)ret); - } - - else - { - data.Name = name; - } - - ret = Interop.CallManager.GetCallType(handle, out CallType type); - if (ret != (int)CmError.None) - { - Log.Error(CmUtility.LogTag, "Failed to get call type from call data, Error: " + (CmError)ret); - } - - else - { - data.CallType = type; - } - - ret = Interop.CallManager.GetCallState(handle, out CallState state); - if (ret != (int)CmError.None) - { - Log.Error(CmUtility.LogTag, "Failed to get call state from call data, Error: " + (CmError)ret); - } - - else - { - data.CallState = state; - } - - ret = Interop.CallManager.GetCallMemberCount(handle, out int count); - if (ret != (int)CmError.None) - { - Log.Error(CmUtility.LogTag, "Failed to get call member count from call data, Error: " + (CmError)ret); - } - - else - { - data.Count = count; - } - - ret = Interop.CallManager.IsEmergencyCall(handle, out bool isEmergency); - if (ret != (int)CmError.None) - { - Log.Error(CmUtility.LogTag, "Failed to check if the call is emergency from call data, Error: " + (CmError)ret); - } - - else - { - data.IsEcc = isEmergency; - } - - ret = Interop.CallManager.IsVoiceMailNumber(handle, out bool isVoiceMail); - if (ret != (int)CmError.None) - { - Log.Error(CmUtility.LogTag, "Failed to check if the number is voicemail number from call data, Error: " + (CmError)ret); - } - - else - { - data.IsVoiceMail = isVoiceMail; - } - - ret = Interop.CallManager.GetCallDomain(handle, out CallDomain domain); - if (ret != (int)CmError.None) - { - Log.Error(CmUtility.LogTag, "Failed to get call domain from call data, Error: " + (CmError)ret); - } - - else - { - data.CallDomain = domain; - } - - ret = Interop.CallManager.GetPersonId(handle, out int personId); - if (ret != (int)CmError.None) - { - Log.Error(CmUtility.LogTag, "Failed to get person ID from call data, Error: " + (CmError)ret); - } - - else - { - data.PersonIndex = personId; - } - - ret = Interop.CallManager.GetStartTime(handle, out long startTime); - if (ret != (int)CmError.None) - { - Log.Error(CmUtility.LogTag, "Failed to get start time from call data, Error: " + (CmError)ret); - } - - else - { - data.CallStartTime = startTime; - } - - ret = Interop.CallManager.GetNameMode(handle, out CallNameMode nameMode); - if (ret != (int)CmError.None) - { - Log.Error(CmUtility.LogTag, "Failed to get name mode from call data, Error: " + (CmError)ret); - } - - else - { - data.CallNameMode = nameMode; - } - - ret = Interop.CallManager.GetSessionId(handle, out int sessionId); - if (ret != (int)CmError.None) - { - Log.Error(CmUtility.LogTag, "Failed to get session ID from call data, Error: " + (CmError)ret); - } - - else - { - data.SessionIdIms = sessionId; - } - - ret = Interop.CallManager.GetHdIconState(handle, out int isHdEnable); - if (ret != (int)CmError.None) - { - Log.Error(CmUtility.LogTag, "Failed to get HD icon state from call data, Error: " + (CmError)ret); - } - - else - { - data.IsHdEnableIms = (isHdEnable == 1) ? true : false; - } - - ret = Interop.CallManager.IsWiFiCalling(handle, out int isWiFiCalling); - if (ret != (int)CmError.None) - { - Log.Error(CmUtility.LogTag, "Failed to identify WiFi calling from call data, Error: " + (CmError)ret); - } - - else - { - data.IsWiFiCall = (isWiFiCalling == 1) ? true : false; - } - - ret = Interop.CallManager.GetUpgradeDowngradeState(handle, out int isEnable); - if (ret != (int)CmError.None) - { - Log.Error(CmUtility.LogTag, "Failed to get updagrade downgrade state from call data, Error: " + (CmError)ret); - } - - else - { - data.IsUpgradeDowngrade = (isEnable == 1) ? true : false; - } - - ret = Interop.CallManager.IsRemoteOnHold(handle, out int isHold); - if (ret != (int)CmError.None) - { - Log.Error(CmUtility.LogTag, "Failed to get remote on hold state from call data, Error: " + (CmError)ret); - } - - else - { - data.IsRemoteHold = (isHold == 1) ? true : false; - } - - ret = Interop.CallManager.IsAddedToConference(handle, out int isAdded); - if (ret != (int)CmError.None) - { - Log.Error(CmUtility.LogTag, "Failed to check if the call is in conf state from call data, Error: " + (CmError)ret); - } - - else - { - data.IsAddedToConf = (isAdded == 1) ? true : false; - } - - ret = Interop.CallManager.IsForwardedCall(handle, out bool isForwarded); - if (ret != (int)CmError.None) - { - Log.Error(CmUtility.LogTag, "Failed to check if the call is forwarded call from call data, Error: " + (CmError)ret); - } - - else - { - data.IsForwardedCall = isForwarded; - } - - return data; - } - - internal static ConferenceCallData GetConfCallData(IntPtr handle) - { - ConferenceCallData confData = new ConferenceCallData(); - int ret = Interop.CallManager.GetConfCallId(handle, out uint callId); - if (ret != (int)CmError.None) - { - Log.Error(CmUtility.LogTag, "Failed to get conf call ID, Error: " + (CmError)ret); - } - - else - { - confData.CallId = callId; - } - - ret = Interop.CallManager.GetConfCallNumber(handle, out string number); - if (ret != (int)CmError.None) - { - Log.Error(CmUtility.LogTag, "Failed to get conf call number, Error: " + (CmError)ret); - } - - else - { - confData.Number = number; - } - - ret = Interop.CallManager.GetConfCallPersonId(handle, out int personId); - if (ret != (int)CmError.None) - { - Log.Error(CmUtility.LogTag, "Failed to get conf call person ID, Error: " + (CmError)ret); - } - - else - { - confData.PersonIndex = personId; - } - - ret = Interop.CallManager.GetConfCallNameMode(handle, out CallNameMode nameMode); - if (ret != (int)CmError.None) - { - Log.Error(CmUtility.LogTag, "Failed to get conf call name mode, Error: " + (CmError)ret); - } - - else - { - confData.NameMode = nameMode; - } - - return confData; - } - - internal static CallEventData GetCallEventData(IntPtr handle) - { - CallEventData eventData = new CallEventData(); - int ret = Interop.CallManager.GetEventDataCallId(handle, out uint id); - if (ret != (int)CmError.None) - { - Log.Error(CmUtility.LogTag, "Failed to get event data call ID, Error: " + (CmError)ret); - } - - else - { - eventData.EventId = id; - } - - ret = Interop.CallManager.GetSimSlot(handle, out MultiSimSlot simSlot); - if (ret != (int)CmError.None) - { - Log.Error(CmUtility.LogTag, "Failed to get event data sim slot, Error: " + (CmError)ret); - } - - else - { - eventData.Slot = simSlot; - } - - ret = Interop.CallManager.GetEndCause(handle, out CallEndCause endCause); - if (ret != (int)CmError.None) - { - Log.Error(CmUtility.LogTag, "Failed to get end cause, Error: " + (CmError)ret); - } - - else - { - eventData.Cause = endCause; - } - - ret = Interop.CallManager.GetIncomingCallData(handle, out IntPtr incoming); - if (ret != (int)CmError.None) - { - Log.Error(CmUtility.LogTag, "Failed to get incoming call data, Error: " + (CmError)ret); - } - - else - { - eventData.Incoming = GetCallData(incoming); - } - - ret = Interop.CallManager.GetActiveCall(handle, out IntPtr active); - if (ret != (int)CmError.None) - { - Log.Error(CmUtility.LogTag, "Failed to get active call data, Error: " + (CmError)ret); - } - - else - { - eventData.Active = GetCallData(active); - } - - ret = Interop.CallManager.GetHeldCall(handle, out IntPtr held); - if (ret != (int)CmError.None) - { - Log.Error(CmUtility.LogTag, "Failed to get held call data, Error: " + (CmError)ret); - } - - else - { - eventData.Held = GetCallData(held); - } - - return eventData; - } - - internal static void ThrowCmException(int exception) - { - _throwException(exception, false, ""); - } - - internal static void ThrowCmException(int exception, IntPtr handle) - { - _throwException(exception, (handle == IntPtr.Zero), ""); - } - - internal static void ThrowCmException(int exception, IntPtr handle, string message) - { - _throwException(exception, (handle == IntPtr.Zero), message); - } - - private static void _throwException(int exception, bool isHandleNull, string message) - { - CmError _error = (CmError)exception; - switch(_error) - { - case CmError.NotSupported: - throw new NotSupportedException("Unsupported feature: http://tizen.org/feature/network.telephony"); - case CmError.PermissionDenied: - throw new UnauthorizedAccessException("Permission denied: " + message); - case CmError.OutOfMemory: - throw new OutOfMemoryException("System out of memory"); - case CmError.InvalidParameter: - if (isHandleNull) - { - throw new InvalidOperationException("Invalid instance (object may have been disposed or released)"); - } - - throw new ArgumentException("Invalid parameter"); - default: - throw new InvalidOperationException(_error.ToString()); - } - } - } -} diff --git a/src/Tizen.CallManager/Tizen.CallManager/ConferenceCallData.cs b/src/Tizen.CallManager/Tizen.CallManager/ConferenceCallData.cs deleted file mode 100755 index dcf83ae46..000000000 --- a/src/Tizen.CallManager/Tizen.CallManager/ConferenceCallData.cs +++ /dev/null @@ -1,78 +0,0 @@ -/* - * 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.CallManager -{ - /// - /// A class which defines the properties of conference call. - /// - public class ConferenceCallData - { - internal uint CallId; - internal string Number; - internal int PersonIndex; - internal CallNameMode NameMode; - internal ConferenceCallData() - { - } - - /// - /// Conference call ID. - /// - public uint Id - { - get - { - return CallId; - } - } - - /// - /// Call number. - /// - public string CallNumber - { - get - { - return Number; - } - } - - /// - /// Person ID. - /// - public int PersonId - { - get - { - return PersonIndex; - } - } - - /// - /// Call name mode. - /// - public CallNameMode Mode - { - get - { - return NameMode; - } - } - } -} diff --git a/src/Tizen.Content.Download/Interop/Interop.Download.cs b/src/Tizen.Content.Download/Interop/Interop.Download.cs deleted file mode 100755 index 839ee635e..000000000 --- a/src/Tizen.Content.Download/Interop/Interop.Download.cs +++ /dev/null @@ -1,110 +0,0 @@ -/* -* 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; -using Tizen.Applications; - -internal static partial class Interop -{ - internal static partial class Download - { - // Request class - - [UnmanagedFunctionPointerAttribute(CallingConvention.Cdecl)] - internal delegate void StateChangedCallback(int requestId, int state, IntPtr userData); - [UnmanagedFunctionPointerAttribute(CallingConvention.Cdecl)] - internal delegate void ProgressChangedCallback(int requestId, ulong receivedSize, IntPtr userData); - - [DllImport(Libraries.Download, EntryPoint = "download_create")] - internal static extern int CreateRequest(out int requestId); - [DllImport(Libraries.Download, EntryPoint = "download_destroy")] - internal static extern int DestroyRequest(int requestId); - [DllImport(Libraries.Download, EntryPoint = "download_set_url")] - internal static extern int SetUrl(int requestId, string url); - [DllImport(Libraries.Download, EntryPoint = "download_get_url")] - internal static extern int GetUrl(int requestId, out string url); - [DllImport(Libraries.Download, EntryPoint = "download_set_network_type")] - internal static extern int SetNetworkType(int requestId, int networkType); - [DllImport(Libraries.Download, EntryPoint = "download_get_network_type")] - internal static extern int GetNetworkType(int requestId, out int networkType); - [DllImport(Libraries.Download, EntryPoint = "download_set_destination")] - internal static extern int SetDestination(int requestId, string path); - [DllImport(Libraries.Download, EntryPoint = "download_get_destination")] - internal static extern int GetDestination(int requestId, out string path); - [DllImport(Libraries.Download, EntryPoint = "download_set_file_name")] - internal static extern int SetFileName(int requestId, string fileName); - [DllImport(Libraries.Download, EntryPoint = "download_get_file_name")] - internal static extern int GetFileName(int requestId, out string path); - [DllImport(Libraries.Download, EntryPoint = "download_set_auto_download")] - internal static extern int SetAutoDownload(int requestId, bool value); - [DllImport(Libraries.Download, EntryPoint = "download_get_auto_download")] - internal static extern int GetAutoDownload(int requestId, out bool value); - [DllImport(Libraries.Download, EntryPoint = "download_set_temp_file_path")] - internal static extern int SetTempFilePath(int requestId, string tempPath); - [DllImport(Libraries.Download, EntryPoint = "download_get_temp_path")] - internal static extern int GetTempFilePath(int requestId, out string tempPath); - [DllImport(Libraries.Download, EntryPoint = "download_add_http_header_field")] - internal static extern int AddHttpHeaderField(int requestId, string field, string value); - [DllImport(Libraries.Download, EntryPoint = "download_get_downloaded_file_path")] - internal static extern int GetDownloadedPath(int requestId, out string downloadedPath); - [DllImport(Libraries.Download, EntryPoint = "download_get_mime_type")] - internal static extern int GetMimeType(int requestId, out string mimeType); - [DllImport(Libraries.Download, EntryPoint = "download_get_state")] - internal static extern int GetState(int requestId, out int downloadState); - [DllImport(Libraries.Download, EntryPoint = "download_get_content_name")] - internal static extern int GetContentName(int requestId, out string contentName); - [DllImport(Libraries.Download, EntryPoint = "download_get_content_size")] - internal static extern int GetContentSize(int requestId, out ulong size); - [DllImport(Libraries.Download, EntryPoint = "download_get_http_status")] - internal static extern int GetHttpStatus(int requestId, out int httpStatus); - [DllImport(Libraries.Download, EntryPoint = "download_get_etag")] - internal static extern int GetETag(int requestId, out string etag); - [DllImport(Libraries.Download, EntryPoint = "download_start")] - internal static extern int StartDownload(int requestId); - [DllImport(Libraries.Download, EntryPoint = "download_pause")] - internal static extern int PauseDownload(int requestId); - [DllImport(Libraries.Download, EntryPoint = "download_cancel")] - internal static extern int CancelDownload(int requestId); - [DllImport(Libraries.Download, EntryPoint = "download_set_state_changed_cb")] - internal static extern int SetStateChangedCallback(int requestId, StateChangedCallback callback, IntPtr userData); - [DllImport(Libraries.Download, EntryPoint = "download_unset_state_changed_cb")] - internal static extern int UnsetStateChangedCallback(int requestId); - [DllImport(Libraries.Download, EntryPoint = "download_set_progress_cb")] - internal static extern int SetProgressCallback(int requestId, ProgressChangedCallback callback, IntPtr userData); - [DllImport(Libraries.Download, EntryPoint = "download_unset_progress_cb")] - internal static extern int UnsetProgressCallback(int requestId); - - // Notification class - - [DllImport(Libraries.Download, EntryPoint = "download_set_notification_title")] - internal static extern int SetNotificationTitle(int requestId, string title); - [DllImport(Libraries.Download, EntryPoint = "download_get_notification_title")] - internal static extern int GetNotificationTitle(int requestId, out string title); - [DllImport(Libraries.Download, EntryPoint = "download_set_notification_description")] - internal static extern int SetNotificationDescription(int requestId, string description); - [DllImport(Libraries.Download, EntryPoint = "download_get_notification_description")] - internal static extern int GetNotificationDescription(int requestId, out string description); - [DllImport(Libraries.Download, EntryPoint = "download_set_notification_type")] - internal static extern int SetNotificationType(int requestId, int type); - [DllImport(Libraries.Download, EntryPoint = "download_get_notification_type")] - internal static extern int GetNotificationType(int requestId, out int type); - [DllImport(Libraries.Download, EntryPoint = "download_set_notification_app_control")] - internal static extern int SetNotificationAppControl(int requestId, int appControlType, SafeAppControlHandle handle); - [DllImport(Libraries.Download, EntryPoint = "download_get_notification_app_control")] - internal static extern int GetNotificationAppControl(int requestId, int appControlType, out SafeAppControlHandle handle); - } -} diff --git a/src/Tizen.Content.Download/Interop/Interop.Libraries.cs b/src/Tizen.Content.Download/Interop/Interop.Libraries.cs deleted file mode 100755 index c634bfd9b..000000000 --- a/src/Tizen.Content.Download/Interop/Interop.Libraries.cs +++ /dev/null @@ -1,24 +0,0 @@ -/* -* 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 Download = "libcapi-web-url-download.so.0"; - public const string Libc = "libc.so.6"; - } -} diff --git a/src/Tizen.Content.Download/Tizen.Content.Download.csproj b/src/Tizen.Content.Download/Tizen.Content.Download.csproj deleted file mode 100644 index 020b2cb3d..000000000 --- a/src/Tizen.Content.Download/Tizen.Content.Download.csproj +++ /dev/null @@ -1,11 +0,0 @@ - - - - netstandard2.0 - - - - - - - diff --git a/src/Tizen.Content.Download/Tizen.Content.Download.sln b/src/Tizen.Content.Download/Tizen.Content.Download.sln deleted file mode 100755 index c93543619..000000000 --- a/src/Tizen.Content.Download/Tizen.Content.Download.sln +++ /dev/null @@ -1,40 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26430.12 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Content.Download", "Tizen.Content.Download.csproj", "{8AE83F8F-ECA3-4BB6-BFB7-449F35B3CA77}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen", "..\Tizen\Tizen.csproj", "{F3849F99-B4B6-4C3C-B1C9-A32BDF5C2F2B}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Log", "..\Tizen.Log\Tizen.Log.csproj", "{AAEF5DAB-DA71-4E28-A20F-71B8F4E5CAB1}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Applications.Common", "..\Tizen.Applications.Common\Tizen.Applications.Common.csproj", "{7B3ABA8E-30F6-4F4D-8DA9-5109DCC54B77}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {8AE83F8F-ECA3-4BB6-BFB7-449F35B3CA77}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {8AE83F8F-ECA3-4BB6-BFB7-449F35B3CA77}.Debug|Any CPU.Build.0 = Debug|Any CPU - {8AE83F8F-ECA3-4BB6-BFB7-449F35B3CA77}.Release|Any CPU.ActiveCfg = Release|Any CPU - {8AE83F8F-ECA3-4BB6-BFB7-449F35B3CA77}.Release|Any CPU.Build.0 = Release|Any CPU - {F3849F99-B4B6-4C3C-B1C9-A32BDF5C2F2B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F3849F99-B4B6-4C3C-B1C9-A32BDF5C2F2B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F3849F99-B4B6-4C3C-B1C9-A32BDF5C2F2B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F3849F99-B4B6-4C3C-B1C9-A32BDF5C2F2B}.Release|Any CPU.Build.0 = Release|Any CPU - {AAEF5DAB-DA71-4E28-A20F-71B8F4E5CAB1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {AAEF5DAB-DA71-4E28-A20F-71B8F4E5CAB1}.Debug|Any CPU.Build.0 = Debug|Any CPU - {AAEF5DAB-DA71-4E28-A20F-71B8F4E5CAB1}.Release|Any CPU.ActiveCfg = Release|Any CPU - {AAEF5DAB-DA71-4E28-A20F-71B8F4E5CAB1}.Release|Any CPU.Build.0 = Release|Any CPU - {7B3ABA8E-30F6-4F4D-8DA9-5109DCC54B77}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7B3ABA8E-30F6-4F4D-8DA9-5109DCC54B77}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7B3ABA8E-30F6-4F4D-8DA9-5109DCC54B77}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7B3ABA8E-30F6-4F4D-8DA9-5109DCC54B77}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/src/Tizen.Content.Download/Tizen.Content.Download/DownloadEnumerator.cs b/src/Tizen.Content.Download/Tizen.Content.Download/DownloadEnumerator.cs deleted file mode 100755 index 40f8839c0..000000000 --- a/src/Tizen.Content.Download/Tizen.Content.Download/DownloadEnumerator.cs +++ /dev/null @@ -1,129 +0,0 @@ -/* -* 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. -*/ - -namespace Tizen.Content.Download -{ - /// - /// Enumeration for the download states. - /// - /// 3 - public enum DownloadState - { - /// - /// Unhandled exception. - /// - /// 3 - None = 0, - /// - /// Ready to download. - /// - /// 3 - Ready, - /// - /// Queued to start downloading. - /// - /// 3 - Queued, - /// - /// Currently downloading. - /// - /// 3 - Downloading, - /// - /// The download is paused and can be resumed. - /// - /// 3 - Paused, - /// - /// The download is completed. - /// - /// 3 - Completed, - /// - /// The download failed. - /// - /// 3 - Failed, - /// - /// A user canceled the download request. - /// - /// 3 - Canceled - } - - /// - /// Enumeration for the network types. - /// - /// 3 - public enum NetworkType - { - /// - /// The download is available through data network. - /// - /// 3 - DataNetwork = 0, - /// - /// The download is available through Wi-Fi. - /// - /// 3 - Wifi, - /// - /// The download is available through Wi-Fi Direct. - /// - /// 3 - WifiDirect, - /// - /// The download is available either through data network or Wi-Fi. - /// - /// 3 - All - } - - /// - /// Enumeration for the notification types. - /// - /// 3 - public enum NotificationType - { - /// - /// Do not register notification. - /// - /// 3 - None = 0, - /// - /// Completion notification for success state and failed state. - /// - /// 3 - CompleteOnly, - /// - /// All download notifications for ongoing state, success state, and failed state. - /// - /// 3 - All - } - - internal enum NotificationAppControlType - { - Downloading = 0, - Completed, - Failed - } - - internal static class Globals - { - internal const string LogTag = "Tizen.Content.Download"; - } -} diff --git a/src/Tizen.Content.Download/Tizen.Content.Download/DownloadErrorFactory.cs b/src/Tizen.Content.Download/Tizen.Content.Download/DownloadErrorFactory.cs deleted file mode 100755 index b6fd77fa9..000000000 --- a/src/Tizen.Content.Download/Tizen.Content.Download/DownloadErrorFactory.cs +++ /dev/null @@ -1,94 +0,0 @@ -/* -* 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.Content.Download -{ - internal enum DownloadError - { - DownloadErrorCommonCode = -0x02A00000, - None = ErrorCode.None, - InvalidParameter = ErrorCode.InvalidParameter, - OutOfMemory = ErrorCode.OutOfMemory, - NetworkUnreachable = ErrorCode.NetworkUnreachable, - ConnectionTimedOut = ErrorCode.ConnectionTimeout, - NoSpace = ErrorCode.FileNoSpaceOnDevice, - PermissionDenied = ErrorCode.PermissionDenied, - NotSupported = ErrorCode.NotSupported, - InvalidState = DownloadErrorCommonCode | 0x21, - ConnectionFailed = DownloadErrorCommonCode | 0x22, - InvalidUrl = DownloadErrorCommonCode | 0x24, - InvalidDestination = DownloadErrorCommonCode | 0x25, - TooManyDownloads = DownloadErrorCommonCode | 0x26, - QueueFull = DownloadErrorCommonCode | 0x27, - AlreadyCompleted = DownloadErrorCommonCode | 0x28, - FileAlreadyExists = DownloadErrorCommonCode | 0x29, - CannotResume = DownloadErrorCommonCode | 0x2a, - FieldNotFound = DownloadErrorCommonCode | 0x2b, - TooManyRedirects = DownloadErrorCommonCode | 0x30, - UnhandledHttpCode = DownloadErrorCommonCode | 0x31, - RequestTimeout = DownloadErrorCommonCode | 0x32, - ResponseTimeout = DownloadErrorCommonCode | 0x33, - SystemDown = DownloadErrorCommonCode | 0x34, - IdNotFound = DownloadErrorCommonCode | 0x35, - InvalidNetworkType = DownloadErrorCommonCode | 0x36, - NoData = ErrorCode.NoData, - IoError = ErrorCode.IoError - } - - internal static class DownloadErrorFactory - { - internal static void ThrowException(int errorCode, string errorMessage = null, string paramName = null) - { - DownloadError err = (DownloadError)errorCode; - if (String.IsNullOrEmpty(errorMessage)) - { - errorMessage = err.ToString(); - } - switch ((DownloadError)errorCode) - { - case DownloadError.InvalidParameter: - case DownloadError.InvalidUrl: - case DownloadError.InvalidDestination: - case DownloadError.InvalidNetworkType: throw new ArgumentException(errorMessage, paramName); - case DownloadError.OutOfMemory: - case DownloadError.NetworkUnreachable: - case DownloadError.ConnectionTimedOut: - case DownloadError.NoSpace: - case DownloadError.InvalidState: - case DownloadError.ConnectionFailed: - case DownloadError.TooManyDownloads: - case DownloadError.QueueFull: - case DownloadError.AlreadyCompleted: - case DownloadError.FileAlreadyExists: - case DownloadError.CannotResume: - case DownloadError.FieldNotFound: - case DownloadError.TooManyRedirects: - case DownloadError.UnhandledHttpCode: - case DownloadError.RequestTimeout: - case DownloadError.ResponseTimeout: - case DownloadError.SystemDown: - case DownloadError.IdNotFound: - case DownloadError.NoData: - case DownloadError.IoError: throw new InvalidOperationException(errorMessage); - case DownloadError.NotSupported: throw new NotSupportedException(errorMessage); - case DownloadError.PermissionDenied: throw new UnauthorizedAccessException(errorMessage); - } - } - } -} diff --git a/src/Tizen.Content.Download/Tizen.Content.Download/Notification.cs b/src/Tizen.Content.Download/Tizen.Content.Download/Notification.cs deleted file mode 100755 index b65dede91..000000000 --- a/src/Tizen.Content.Download/Tizen.Content.Download/Notification.cs +++ /dev/null @@ -1,249 +0,0 @@ -/* -* 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.Applications; - -namespace Tizen.Content.Download -{ - /// - /// The Notification class consists of all the properties required to set notifications for the download operation. - /// - /// 3 - public class Notification - { - private int _downloadId; - - internal Notification(int requestId) - { - _downloadId = requestId; - } - - /// - /// Title of the notification. - /// If a user tries to get before the setting, an empty string is returned. - /// - /// 3 - /// http://tizen.org/privilege/download - /// http://tizen.org/feature/download - /// Thrown when it is failed due to an invalid parameter. - /// Thrown when it is failed due to an invalid operation. - /// Thrown when a permission is denied. - /// Thrown when feature is not supported. - public string Title - { - get - { - string title; - int ret = Interop.Download.GetNotificationTitle(_downloadId, out title); - if (ret != (int)DownloadError.None) - { - Log.Error(Globals.LogTag, "Failed to get Notification Title, " + (DownloadError)ret); - return String.Empty; - } - return title; - } - set - { - int ret = Interop.Download.SetNotificationTitle(_downloadId, value.ToString()); - if (ret != (int)DownloadError.None) - { - DownloadErrorFactory.ThrowException(ret, "Failed to set Notification Title"); - } - } - } - - /// - /// Description of the notification. - /// If a user tries to get before the setting, an empty string is returned. - /// - /// 3 - /// http://tizen.org/privilege/download - /// http://tizen.org/feature/download - /// Thrown when it is failed due to an invalid parameter. - /// Thrown when it is failed due to an invalid operation. - /// Thrown when a permission is denied. - /// Thrown when feature is not supported. - public string Description - { - get - { - string description; - int ret = Interop.Download.GetNotificationDescription(_downloadId, out description); - if (ret != (int)DownloadError.None) - { - Log.Error(Globals.LogTag, "Failed to get Notification Description, " + (DownloadError)ret); - return String.Empty; - } - return description; - } - set - { - int ret = Interop.Download.SetNotificationDescription(_downloadId, value.ToString()); - if (ret != (int)DownloadError.None) - { - DownloadErrorFactory.ThrowException(ret, "Failed to set Notification Description"); - } - } - } - - /// - /// Type of the notification. - /// If a user tries to get before the setting, the default NotificationType none is returned. - /// - /// 3 - /// http://tizen.org/privilege/download - /// http://tizen.org/feature/download - /// Thrown when it is failed due to an invalid parameter. - /// Thrown when it is failed due to an invalid operation. - /// Thrown when a permission is denied. - /// Thrown when feature is not supported. - public NotificationType Type - { - get - { - int type; - int ret = Interop.Download.GetNotificationType(_downloadId, out type); - if (ret != (int)DownloadError.None) - { - Log.Error(Globals.LogTag, "Failed to get NotificationType, " + (DownloadError)ret); - return 0; - } - return (NotificationType)type; - } - set - { - int ret = Interop.Download.SetNotificationType(_downloadId, (int)value); - if (ret != (int)DownloadError.None) - { - DownloadErrorFactory.ThrowException(ret, "Failed to set NotificationType"); - } - } - } - - /// - /// AppControl for an ongoing download notification. - /// If a user tries to get before the setting, null is returned. - /// - /// 3 - /// http://tizen.org/privilege/download - /// http://tizen.org/feature/download - /// - /// When the notification message is clicked, the action is decided by the application control. - /// - /// Thrown when it is failed due to an invalid parameter. - /// Thrown when it is failed due to an invalid operation. - /// Thrown when a permission is denied. - /// Thrown when feature is not supported. - public AppControl AppControlOngoing - { - get - { - SafeAppControlHandle handle; - int ret = Interop.Download.GetNotificationAppControl(_downloadId, (int)NotificationAppControlType.Downloading, out handle); - if (ret != (int)DownloadError.None) - { - Log.Error(Globals.LogTag, "Failed to get Ongoing type NotificationAppControl, " + (DownloadError)ret); - return null; - } - return new AppControl(handle); - } - set - { - int ret = Interop.Download.SetNotificationAppControl(_downloadId, (int)NotificationAppControlType.Downloading, value.SafeAppControlHandle); - if (ret != (int)DownloadError.None) - { - DownloadErrorFactory.ThrowException(ret, "Failed to set Ongoing type NotificationAppControl"); - } - } - } - - /// - /// AppControl for a completed download notification. - /// If a user tries to get before the setting, null is returned. - /// - /// 3 - /// http://tizen.org/privilege/download - /// http://tizen.org/feature/download - /// - /// When the notification message is clicked, the action is decided by the application control. - /// - /// Thrown when it is failed due to an invalid parameter. - /// Thrown when it is failed due to an invalid operation. - /// Thrown when a permission is denied. - /// Thrown when feature is not supported. - public AppControl AppControlCompleted - { - get - { - SafeAppControlHandle handle; - int ret = Interop.Download.GetNotificationAppControl(_downloadId, (int)NotificationAppControlType.Completed, out handle); - if (ret != (int)DownloadError.None) - { - Log.Error(Globals.LogTag, "Failed to get Complete type NotificationAppControl, " + (DownloadError)ret); - return null; - } - return new AppControl(handle); - } - set - { - int ret = Interop.Download.SetNotificationAppControl(_downloadId, (int)NotificationAppControlType.Completed, value.SafeAppControlHandle); - if (ret != (int)DownloadError.None) - { - DownloadErrorFactory.ThrowException(ret, "Failed to set Complete type NotificationAppControl"); - } - } - } - - /// - /// AppControl for a failed download notification. - /// If a user tries to get before the setting, null is returned. - /// - /// 3 - /// http://tizen.org/privilege/download - /// http://tizen.org/feature/download - /// - /// When the notification message is clicked, the action is decided by the application control. - /// - /// Thrown when it is failed due to an invalid parameter. - /// Thrown when it is failed due to an invalid operation. - /// Thrown when a permission is denied. - /// Thrown when feature is not supported. - public AppControl AppControlFailed - { - get - { - SafeAppControlHandle handle; - int ret = Interop.Download.GetNotificationAppControl(_downloadId, (int)NotificationAppControlType.Failed, out handle); - if (ret != (int)DownloadError.None) - { - Log.Error(Globals.LogTag, "Failed to get Fail type NotificationAppControl, " + (DownloadError)ret); - return null; - } - return new AppControl(handle); - } - set - { - int ret = Interop.Download.SetNotificationAppControl(_downloadId, (int)NotificationAppControlType.Failed, value.SafeAppControlHandle); - if (ret != (int)DownloadError.None) - { - DownloadErrorFactory.ThrowException(ret, "Failed to set Fail type NotificationAppControl"); - } - } - } - } -} - diff --git a/src/Tizen.Content.Download/Tizen.Content.Download/ProgressChangedEventArgs.cs b/src/Tizen.Content.Download/Tizen.Content.Download/ProgressChangedEventArgs.cs deleted file mode 100755 index 3a20222a0..000000000 --- a/src/Tizen.Content.Download/Tizen.Content.Download/ProgressChangedEventArgs.cs +++ /dev/null @@ -1,46 +0,0 @@ -/* -* 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.Content.Download -{ - /// - /// An extended EventArgs class which contains the size of received data in bytes. - /// - /// 3 - public class ProgressChangedEventArgs : EventArgs - { - private ulong _size = 0; - - internal ProgressChangedEventArgs(ulong size) - { - _size = size; - } - - /// - /// The received data size in bytes. - /// - /// 3 - public ulong ReceivedDataSize - { - get - { - return _size; - } - } - } -} diff --git a/src/Tizen.Content.Download/Tizen.Content.Download/Request.cs b/src/Tizen.Content.Download/Tizen.Content.Download/Request.cs deleted file mode 100755 index 11c96a2ab..000000000 --- a/src/Tizen.Content.Download/Tizen.Content.Download/Request.cs +++ /dev/null @@ -1,858 +0,0 @@ -/* -* 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.Collections.Generic; -using System.Runtime.InteropServices; - -namespace Tizen.Content.Download -{ - /// - /// The Request class provides the functions to create and manage a single download request. - /// - /// 3 - public class Request : IDisposable - { - private int _downloadId; - private Notification _notificationProperties; - private IDictionary _httpHeaders; - private EventHandler _downloadStateChanged; - private Interop.Download.StateChangedCallback _downloadStateChangedCallback; - private EventHandler _downloadProgressChanged; - private Interop.Download.ProgressChangedCallback _downloadProgressChangedCallback; - private bool _disposed = false; - - /// - /// Creates a Request object. - /// - /// 3 - /// The URL to download. - /// http://tizen.org/privilege/download - /// Thrown when it is failed due to an invalid parameter. - /// Thrown when it is failed due to an invalid operation. - /// Thrown when a permission is denied. - public Request(string url) - { - if (String.IsNullOrEmpty(url)) - { - DownloadErrorFactory.ThrowException((int)DownloadError.InvalidParameter, "url cannot be null or empty"); - } - int ret = Interop.Download.CreateRequest(out _downloadId); - if (ret != (int)DownloadError.None) - { - DownloadErrorFactory.ThrowException(ret, "Request creation failed"); - } - ret = Interop.Download.SetUrl(_downloadId, url); - if (ret != (int)DownloadError.None) - { - DownloadErrorFactory.ThrowException(ret, "Setting Url failed"); - } - _notificationProperties = new Notification(_downloadId); - _httpHeaders = new Dictionary(); - } - - /// - /// Creates a Request object. - /// - /// 3 - /// The URL to download - /// The directory path where downloaded file is stored. - /// The name of the downloaded file. - /// The network type which the download request must adhere to. - /// http://tizen.org/privilege/download - /// http://tizen.org/feature/network.wifi - /// http://tizen.org/feature/network.wifi.direct - /// http://tizen.org/feature/network.telephony - /// Thrown when it is failed due to an invalid parameter. - /// Thrown when it is failed due to an invalid operation. - /// Thrown when a permission is denied. - /// Thrown when a feature is not supported. - public Request(string url, string destinationPath, string fileName, NetworkType type) - { - if (String.IsNullOrEmpty(url)) - { - DownloadErrorFactory.ThrowException((int)DownloadError.InvalidParameter, "url cannot be null or empty"); - } - int ret = Interop.Download.CreateRequest(out _downloadId); - if (ret != (int)DownloadError.None) - { - DownloadErrorFactory.ThrowException(ret, "Request creation failed"); - } - - ret = Interop.Download.SetUrl(_downloadId, url); - if (ret != (int)DownloadError.None) - { - DownloadErrorFactory.ThrowException(ret, "Setting Url failed"); - } - - ret = Interop.Download.SetDestination(_downloadId, destinationPath); - if (ret != (int)DownloadError.None) - { - DownloadErrorFactory.ThrowException(ret, "Setting DestinationPath failed"); - } - - ret = Interop.Download.SetFileName(_downloadId, fileName); - if (ret != (int)DownloadError.None) - { - DownloadErrorFactory.ThrowException(ret, "Setting FileName failed"); - } - - ret = Interop.Download.SetNetworkType(_downloadId, (int)type); - if (ret != (int)DownloadError.None) - { - DownloadErrorFactory.ThrowException(ret, "Setting NetworkType failed"); - } - - _notificationProperties = new Notification(_downloadId); - _httpHeaders = new Dictionary(); - } - - /// - /// Creates a Request object. - /// - /// 3 - /// The URL to download. - /// The directory path where the downloaded file is stored. - /// The name of the downloaded file. - /// The network type which the download request must adhere to. - /// HTTP header fields for the download request. - /// http://tizen.org/privilege/download - /// http://tizen.org/feature/network.wifi - /// http://tizen.org/feature/network.wifi.direct - /// http://tizen.org/feature/network.telephony - /// Thrown when it is failed due to an invalid parameter. - /// Thrown when it is failed due to an invalid operation. - /// Thrown when a permission is denied. - /// Thrown when a feature is not supported. - public Request(string url, string destinationPath, string fileName, NetworkType type, IDictionary httpHeaders) - { - if (String.IsNullOrEmpty(url)) - { - DownloadErrorFactory.ThrowException((int)DownloadError.InvalidParameter, "url cannot be null or empty"); - } - int ret = Interop.Download.CreateRequest(out _downloadId); - if (ret != (int)DownloadError.None) - { - DownloadErrorFactory.ThrowException(ret, "Request creation failed"); - } - - ret = Interop.Download.SetUrl(_downloadId, url); - if (ret != (int)DownloadError.None) - { - DownloadErrorFactory.ThrowException(ret, "Setting Url failed"); - } - - ret = Interop.Download.SetDestination(_downloadId, destinationPath); - if (ret != (int)DownloadError.None) - { - DownloadErrorFactory.ThrowException(ret, "Setting DestinationPath failed"); - } - - ret = Interop.Download.SetFileName(_downloadId, fileName); - if (ret != (int)DownloadError.None) - { - DownloadErrorFactory.ThrowException(ret, "Setting FileName failed"); - } - - ret = Interop.Download.SetNetworkType(_downloadId, (int)type); - if (ret != (int)DownloadError.None) - { - DownloadErrorFactory.ThrowException(ret, "Setting NetworkType failed"); - } - - _notificationProperties = new Notification(_downloadId); - _httpHeaders = httpHeaders; - } - - ~Request() - { - Dispose(false); - } - - /// - /// An event that occurs when the download state changes. - /// - /// 3 - /// http://tizen.org/privilege/download - /// Thrown when it is failed due to an invalid parameter. - /// Thrown when it is failed due to an invalid operation. - /// Thrown when a permission is denied. - public event EventHandler StateChanged - { - add - { - if (_downloadStateChanged == null) - { - RegisterStateChangedEvent(); - } - _downloadStateChanged += value; - } - remove - { - _downloadStateChanged -= value; - if (_downloadStateChanged == null) - { - UnregisterStateChangedEvent(); - } - } - } - - /// - /// An event that occurs when the download progress changes. - /// - /// 3 - /// http://tizen.org/privilege/download - /// Thrown when it is failed due to an invalid parameter. - /// Thrown when it is failed due to an invalid operation. - /// Thrown when a permission is denied. - public event EventHandler ProgressChanged - { - add - { - if (_downloadProgressChanged == null) - { - RegisterProgressChangedEvent(); - } - _downloadProgressChanged += value; - } - remove - { - _downloadProgressChanged -= value; - if (_downloadProgressChanged == null) - { - UnregisterProgressChangedEvent(); - } - } - } - - /// - /// The absolute path where the file will be downloaded. - /// If you try to get this property value before calling Start(), an empty string is returned. - /// - /// 3 - /// http://tizen.org/privilege/download - /// - /// Returns an empty string if the download is not completed or if a state has not yet changed to completed or if any other error occurs. - /// - /// Thrown when it is failed due to an invalid parameter. - /// Thrown when it is failed due to an invalid operation. - /// Thrown when a permission is denied. - public string DownloadedPath - { - get - { - string path; - int ret = Interop.Download.GetDownloadedPath(_downloadId, out path); - if (ret != (int)DownloadError.None) - { - Log.Error(Globals.LogTag, "Failed to get DownloadedPath, " + (DownloadError)ret); - return String.Empty; - } - return path; - } - } - - /// - /// The MIME type of the downloaded content. - /// If you try to get this property value before calling Start(), an empty string is returned. - /// - /// 3 - /// http://tizen.org/privilege/download - /// Thrown when it is failed due to an invalid parameter. - /// Thrown when it is failed due to an invalid operation. - /// Thrown when a permission is denied. - public string MimeType - { - get - { - string mime; - int ret = Interop.Download.GetMimeType(_downloadId, out mime); - if (ret != (int)DownloadError.None) - { - Log.Error(Globals.LogTag, "Failed to get MimeType, " + (DownloadError)ret); - return String.Empty; - } - return mime; - } - } - - /// - /// The current state of the download. - /// - /// 3 - /// http://tizen.org/privilege/download - /// Thrown when it is failed due to an invalid parameter. - /// Thrown when it is failed due to an invalid operation. - /// Thrown when a permission is denied. - public DownloadState State - { - get - { - int state; - int ret = Interop.Download.GetState(_downloadId, out state); - if (ret != (int)DownloadError.None) - { - Log.Error(Globals.LogTag, "Failed to get DownloadState, " + (DownloadError)ret); - return DownloadState.None; - } - return (DownloadState)state; - } - } - - /// - /// The content name of the downloaded file. - /// This can be defined with reference of the HTTP response header data. The content name can be received when the HTTP response header is received. - /// If you try to get this property value before calling Start(), an empty string is returned. - /// - /// 3 - /// http://tizen.org/privilege/download - /// Thrown when it is failed due to an invalid parameter. - /// Thrown when it is failed due to an invalid operation. - /// Thrown when a permission is denied. - public string ContentName - { - get - { - string name; - int ret = Interop.Download.GetContentName(_downloadId, out name); - if (ret != (int)DownloadError.None) - { - Log.Error(Globals.LogTag, "Failed to get ContentName, " + (DownloadError)ret); - return String.Empty; - } - return name; - } - } - - /// - /// The total size of the downloaded content. - /// This information is received from the server. If the server does not send the total size of the content, the content size is set to zero. - /// If you try to get this property value before calling Start(), 0 is returned. - /// - /// 3 - /// http://tizen.org/privilege/download - /// Thrown when it is failed due to an invalid parameter. - /// Thrown when it is failed due to an invalid operation. - /// Thrown when a permission is denied. - public ulong ContentSize - { - get - { - ulong size; - int ret = Interop.Download.GetContentSize(_downloadId, out size); - if (ret != (int)DownloadError.None) - { - Log.Error(Globals.LogTag, "Failed to get ContentSize, " + (DownloadError)ret); - return 0; - } - return size; - } - } - - /// - /// The HTTP status code when a download exception occurs. - /// If you try to get this property value before calling Start(), 0 is returned. - /// - /// 3 - /// http://tizen.org/privilege/download - /// - /// The state of the download request must be DownlodState.Failed. - /// - /// Thrown when it is failed due to an invalid parameter. - /// Thrown when it is failed due to an invalid operation. - /// Thrown when a permission is denied. - public int HttpStatus - { - get - { - int status; - int ret = Interop.Download.GetHttpStatus(_downloadId, out status); - if (ret != (int)DownloadError.None) - { - Log.Error(Globals.LogTag, "Failed to get HttpStatus, " + (DownloadError)ret); - return 0; - } - return status; - } - } - - /// - /// The ETag value from the HTTP response header when making a HTTP request for resume. - /// If you try to get this property value before calling Start() or if any other error occurs, an empty string is returned. - /// - /// 3 - /// http://tizen.org/privilege/download - /// - /// The ETag value is either available or not dependent on the web server. If not available, then, on getting the property, a null value is returned. - /// After the download is started, it can get the ETag value. - /// - /// Thrown when it is failed due to an invalid parameter. - /// Thrown when it is failed due to an invalid operation - /// Thrown when a permission is denied. - public string ETagValue - { - get - { - string etag; - int ret = Interop.Download.GetETag(_downloadId, out etag); - if (ret != (int)DownloadError.None) - { - Log.Error(Globals.LogTag, "Failed to get ETagValue, " + (DownloadError)ret); - return String.Empty; - } - return etag; - } - } - - /// - /// Contains properties required for creating download notifications. - /// - /// 3 - /// - /// When the notification message is clicked, the action taken by the system is decided by the application control properties of the NotificationProperties instance. - /// If the app control is not set, the following default operation is executed when the notification message is clicked: - /// 1) The download completed state - the viewer application is executed according to the extension name of the downloaded content. - /// 2) The download failed state and ongoing state - the client application is executed. - /// This property should be set before calling Start(). - /// - public Notification NotificationProperties - { - get - { - return _notificationProperties; - } - } - - /// - /// The full path of the temporary file stores the downloaded content. - /// - /// 3 - /// http://tizen.org/privilege/download - /// - /// The download state must be one of the states after downloading. - /// - /// Thrown when it is failed due to an invalid parameter. - /// Thrown when it is failed due to an invalid operation. - /// Thrown when a permission is denied. - public string TemporaryPath - { - get - { - string path; - int ret = Interop.Download.GetTempFilePath(_downloadId, out path); - if (ret != (int)DownloadError.None) - { - Log.Error(Globals.LogTag, "Failed to get TemporaryPath, " + (DownloadError)ret); - return String.Empty; - } - return path; - } - } - - /// - /// The URL to download. - /// - /// 3 - /// http://tizen.org/privilege/download - /// - /// Should be set before calling Start(). - /// If you try to get this property value before setting or if any other error occurs, an empty string is returned. - /// - /// Thrown when it is failed due to an invalid parameter. - /// Thrown when it is failed due to an invalid operation. - /// Thrown when a permission is denied. - public string Url - { - get - { - string url; - int ret = Interop.Download.GetUrl(_downloadId, out url); - if (ret != (int)DownloadError.None) - { - Log.Error(Globals.LogTag, "Failed to get Url, " + (DownloadError)ret); - return String.Empty; - } - return url; - } - set - { - int ret = Interop.Download.SetUrl(_downloadId, value); - if (ret != (int)DownloadError.None) - { - DownloadErrorFactory.ThrowException(ret, "Failed to set Url"); - } - } - } - - /// - /// The allowed network type for downloading the file. - /// The file will be downloaded only under the allowed network. - /// If you try to get this property value before setting or if any other error occurs, the default value NetworkType All is returned. - /// - /// 3 - /// http://tizen.org/privilege/download - /// http://tizen.org/feature/network.wifi - /// http://tizen.org/feature/network.wifi.direct - /// http://tizen.org/feature/network.telephony - /// - /// Should be set before calling Start(). - /// - /// Thrown when it is failed due to an invalid parameter. - /// Thrown when it is failed due to an invalid operation. - /// Thrown when a permission is denied. - /// Thrown when feature is not supported. - public NetworkType AllowedNetworkType - { - get - { - int type; - int ret = Interop.Download.GetNetworkType(_downloadId, out type); - if (ret != (int)DownloadError.None) - { - Log.Error(Globals.LogTag, "Failed to get AllowedNetworkType, " + (DownloadError)ret); - return NetworkType.All; - } - return (NetworkType)type; - } - set - { - int ret = Interop.Download.SetNetworkType(_downloadId, (int)value); - if (ret != (int)DownloadError.None) - { - DownloadErrorFactory.ThrowException(ret, "Failed to set AllowedNetworkType"); - } - } - } - - /// - /// The file will be downloaded to the set the destination file path. The downloaded file is saved to an auto-generated file name in the destination. If the destination is not specified, the file will be downloaded to the default storage. - /// If you try to get this property value before setting or if any other error occurs, an empty string is returned. - /// - /// 3 - /// http://tizen.org/privilege/download - /// - /// Should be set before calling Start(). - /// - /// Thrown when it is failed due to an invalid parameter. - /// Thrown when it is failed due to an invalid operation. - /// Thrown when a permission is denied. - public string DestinationPath - { - get - { - string path; - int ret = Interop.Download.GetDestination(_downloadId, out path); - if (ret != (int)DownloadError.None) - { - Log.Error(Globals.LogTag, "Failed to get DestinationPath, " + (DownloadError)ret); - return String.Empty; - } - return path; - } - set - { - int ret = Interop.Download.SetDestination(_downloadId, value.ToString()); - if (ret != (int)DownloadError.None) - { - DownloadErrorFactory.ThrowException(ret, "Failed to set DestinationPath"); - } - } - } - - /// - /// The file will be saved in the specified destination or the default storage with the set file name. If the file name is not specified, the downloaded file will be saved with an auto-generated file name in the destination. - /// If you try to get this property value before setting or if any other error occurs, an empty string is returned. - /// - /// 3 - /// http://tizen.org/privilege/download - /// - /// Should be set before calling Start(). - /// - /// Thrown when it is failed due to an invalid parameter. - /// Thrown when it is failed due to an invalid operation. - /// Thrown when a permission is denied. - public string FileName - { - get - { - string name; - int ret = Interop.Download.GetFileName(_downloadId, out name); - if (ret != (int)DownloadError.None) - { - Log.Error(Globals.LogTag, "Failed to get FileName, " + (DownloadError)ret); - return String.Empty; - } - return name; - } - set - { - int ret = Interop.Download.SetFileName(_downloadId, value.ToString()); - if (ret != (int)DownloadError.None) - { - DownloadErrorFactory.ThrowException(ret, "Failed to set FileName"); - } - } - } - - /// - /// Enables or disables auto download. - /// If this option is enabled, the previous downloading item is restarted automatically as soon as the download daemon is restarted. The download progress continues after the client process is terminated. - /// If you try to get this property value before setting, the default value false is returned. - /// - /// 3 - /// http://tizen.org/privilege/download - /// - /// The default value is false. - /// - /// Thrown when it is failed due to an invalid parameter. - /// Thrown when it is failed due to an invalid operation. - /// Thrown when a permission is denied. - public bool AutoDownload - { - get - { - bool value; - int ret = Interop.Download.GetAutoDownload(_downloadId, out value); - if (ret != (int)DownloadError.None) - { - Log.Error(Globals.LogTag, "Failed to get AutoDownload, " + (DownloadError)ret); - return false; - } - return value; - } - set - { - int ret = Interop.Download.SetAutoDownload(_downloadId, value); - if (ret != (int)DownloadError.None) - { - DownloadErrorFactory.ThrowException(ret, "Failed to set AutoDownload"); - } - } - } - - /// - /// The HTTP header field and value pairs to the download request. - /// The HTTP header <field,value> pair is the <key,value> pair in the dictionary HttpHeaders. - /// The given HTTP header field will be included with the HTTP request of the download request. - /// If you try to get this property value before setting, an empty dictionary is returned. - /// - /// 3 - /// - /// HTTP header fields should be set before calling Start(). - /// HTTP header fields can be removed before calling Start(). - /// - public IDictionary HttpHeaders - { - get - { - return _httpHeaders; - } - } - - /// - /// Sets the directory path of a temporary file used in a previous download request. - /// This is only useful when resuming download to make the HTTP request header at the client side. Otherwise, the path is ignored. - /// - /// 3 - /// http://tizen.org/privilege/download - /// - /// If the ETag value is not present in the download database, it is not useful to set the temporary file path. - /// When resuming the download request, the data is attached at the end of this temporary file. - /// - /// Thrown when it is failed due to an invalid parameter. - /// Thrown when it is failed due to an invalid operation. - /// Thrown when a permission is denied. - public void SetTemporaryFilePath(string path) - { - int ret = Interop.Download.SetTempFilePath(_downloadId, path); - if (ret != (int)DownloadError.None) - { - DownloadErrorFactory.ThrowException(ret, "Failed to set TemporaryFilePath"); - } - } - - /// - /// Starts or resumes the download. - /// Starts to download the current URL, or resumes the download if paused. - /// - /// 3 - /// http://tizen.org/privilege/download - /// - /// The URL is the mandatory information to start the download. - /// - /// Thrown when it is failed due to an invalid parameter. - /// Thrown when it is failed due to an invalid operation. - /// Thrown when a permission is denied. - public void Start() - { - int ret = (int)DownloadError.None; - foreach (KeyValuePair entry in _httpHeaders) - { - ret = Interop.Download.AddHttpHeaderField(_downloadId, entry.Key, entry.Value); - if (ret != (int)DownloadError.None) - { - DownloadErrorFactory.ThrowException(ret, "Failed to set HttpHeaders"); - } - } - - ret = Interop.Download.StartDownload(_downloadId); - if (ret != (int)DownloadError.None) - { - DownloadErrorFactory.ThrowException(ret, "Failed to start download request"); - } - } - - /// - /// Pauses the download request. - /// - /// 3 - /// http://tizen.org/privilege/download - /// - /// The paused download request can be restarted with Start() or canceled with Cancel(). - /// - /// Thrown when it is failed due to an invalid parameter. - /// Thrown when it is failed due to an invalid operation. - /// Thrown when a permission is denied. - public void Pause() - { - int ret = Interop.Download.PauseDownload(_downloadId); - if (ret != (int)DownloadError.None) - { - DownloadErrorFactory.ThrowException(ret, "Failed to pause download request"); - } - } - - /// - /// Cancels the download request. - /// - /// 3 - /// http://tizen.org/privilege/download - /// - /// The canceled download can be restarted with Start(). - /// - /// Thrown when it is failed due to an invalid parameter. - /// Thrown when it is failed due to an invalid operation. - /// Thrown when a permission is denied. - public void Cancel() - { - int ret = Interop.Download.CancelDownload(_downloadId); - if (ret != (int)DownloadError.None) - { - DownloadErrorFactory.ThrowException(ret, "Failed to cancel download request"); - } - } - - /// - /// Releases all the resources used by the Request class. - /// - /// 3 - /// http://tizen.org/privilege/download - /// - /// After calling this method, the download request related data exists in the download database for a certain period of time. Within that time, it is possible to use other APIs with this data. - /// - /// Thrown when it is failed due to an invalid parameter. - /// Thrown when it is failed due to an invalid operation. - /// Thrown when a permission is denied. - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - - /// - /// Deletes the corresponding download request. - /// - /// 3 - /// http://tizen.org/privilege/download - /// Thrown when it is failed due to an invalid parameter. - /// Thrown when it is failed due to an invalid operation. - /// Thrown when a permission is denied. - protected virtual void Dispose(bool disposing) - { - if (_disposed) - return; - - if (disposing) - { - // Free managed objects. - } - Interop.Download.DestroyRequest(_downloadId); - _disposed = true; - } - - static private void IntPtrToStringArray(IntPtr unmanagedArray, int size, out string[] managedArray) - { - managedArray = new string[size]; - IntPtr[] IntPtrArray = new IntPtr[size]; - - Marshal.Copy(unmanagedArray, IntPtrArray, 0, size); - - for (int iterator = 0; iterator < size; iterator++) - { - managedArray[iterator] = Marshal.PtrToStringAnsi(IntPtrArray[iterator]); - } - } - - private void RegisterStateChangedEvent() - { - _downloadStateChangedCallback = (int downloadId, int downloadState, IntPtr userData) => - { - StateChangedEventArgs eventArgs = new StateChangedEventArgs((DownloadState)downloadState); - _downloadStateChanged?.Invoke(this, eventArgs); - }; - - int ret = Interop.Download.SetStateChangedCallback(_downloadId, _downloadStateChangedCallback, IntPtr.Zero); - if (ret != (int)DownloadError.None) - { - DownloadErrorFactory.ThrowException(ret, "Setting StateChanged callback failed"); - } - } - - private void UnregisterStateChangedEvent() - { - int ret = Interop.Download.UnsetStateChangedCallback(_downloadId); - if (ret != (int)DownloadError.None) - { - DownloadErrorFactory.ThrowException(ret, "Unsetting StateChanged callback failed"); - } - } - - private void RegisterProgressChangedEvent() - { - _downloadProgressChangedCallback = (int downloadId, ulong size, IntPtr userData) => - { - ProgressChangedEventArgs eventArgs = new ProgressChangedEventArgs(size); - _downloadProgressChanged?.Invoke(this, eventArgs); - }; - - int ret = Interop.Download.SetProgressCallback(_downloadId, _downloadProgressChangedCallback, IntPtr.Zero); - if (ret != (int)DownloadError.None) - { - DownloadErrorFactory.ThrowException(ret, "Setting ProgressChanged callback failed"); - } - } - - private void UnregisterProgressChangedEvent() - { - int ret = Interop.Download.UnsetProgressCallback(_downloadId); - if (ret != (int)DownloadError.None) - { - DownloadErrorFactory.ThrowException(ret, "Unsetting ProgressChanged callback failed"); - } - } - } -} - diff --git a/src/Tizen.Content.Download/Tizen.Content.Download/StateChangedEventArgs.cs b/src/Tizen.Content.Download/Tizen.Content.Download/StateChangedEventArgs.cs deleted file mode 100755 index 52cdf11f8..000000000 --- a/src/Tizen.Content.Download/Tizen.Content.Download/StateChangedEventArgs.cs +++ /dev/null @@ -1,46 +0,0 @@ -/* -* 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.Content.Download -{ - /// - /// An extended EventArgs class which contains the changed download state. - /// - /// 3 - public class StateChangedEventArgs : EventArgs - { - private DownloadState _state; - - internal StateChangedEventArgs(DownloadState downloadState) - { - _state = downloadState; - } - - /// - /// The present download state. - /// - /// 3 - public DownloadState State - { - get - { - return _state; - } - } - } -} diff --git a/src/Tizen.Content.MediaContent/Interop/Interop.Album.cs b/src/Tizen.Content.MediaContent/Interop/Interop.Album.cs deleted file mode 100644 index 38bece82e..000000000 --- a/src/Tizen.Content.MediaContent/Interop/Interop.Album.cs +++ /dev/null @@ -1,60 +0,0 @@ -/* - * 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; -using Tizen.Content.MediaContent; - -internal static partial class Interop -{ - internal static partial class Album - { - [DllImport(Libraries.MediaContent, EntryPoint = "media_album_get_album_count_from_db")] - internal static extern MediaContentError GetAlbumCountFromDb(FilterHandle filter, out int count); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_album_get_media_count_from_db")] - internal static extern MediaContentError GetMediaCountFromDb(int albumId, FilterHandle filter, out int count); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_album_destroy")] - internal static extern MediaContentError Destroy(IntPtr album); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_album_clone")] - internal static extern MediaContentError Clone(out IntPtr dst, IntPtr src); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_album_get_album_id")] - internal static extern MediaContentError GetId(IntPtr album, out int albumId); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_album_get_name")] - internal static extern MediaContentError GetName(IntPtr album, out IntPtr value); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_album_get_artist")] - internal static extern MediaContentError GetArtist(IntPtr album, out IntPtr value); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_album_get_album_art")] - internal static extern MediaContentError GetAlbumArt(IntPtr album, out IntPtr value); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_album_get_album_from_db")] - internal static extern MediaContentError GetAlbumFromDb(int albumId, out IntPtr album); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_album_foreach_album_from_db")] - internal static extern MediaContentError ForeachAlbumFromDb(FilterHandle filter, - Common.ItemCallback cb, IntPtr userData = default(IntPtr)); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_album_foreach_media_from_db")] - internal static extern MediaContentError ForeachMediaFromDb(int albumId, FilterHandle filter, - Common.ItemCallback callback, IntPtr userData = default(IntPtr)); - } -} diff --git a/src/Tizen.Content.MediaContent/Interop/Interop.AudioInfo.cs b/src/Tizen.Content.MediaContent/Interop/Interop.AudioInfo.cs deleted file mode 100644 index f61f13451..000000000 --- a/src/Tizen.Content.MediaContent/Interop/Interop.AudioInfo.cs +++ /dev/null @@ -1,70 +0,0 @@ -/* - * 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; -using Tizen.Content.MediaContent; - -internal static partial class Interop -{ - internal static partial class AudioInfo - { - [DllImport(Libraries.MediaContent, EntryPoint = "audio_meta_destroy", CallingConvention = CallingConvention.Cdecl)] - internal static extern MediaContentError Destroy(IntPtr handle); - - [DllImport(Libraries.MediaContent, EntryPoint = "audio_meta_get_album", CallingConvention = CallingConvention.Cdecl)] - internal static extern MediaContentError GetAlbum(IntPtr handle, out IntPtr albumName); - - [DllImport(Libraries.MediaContent, EntryPoint = "audio_meta_get_artist", CallingConvention = CallingConvention.Cdecl)] - internal static extern MediaContentError GetArtist(IntPtr handle, out IntPtr artistName); - - [DllImport(Libraries.MediaContent, EntryPoint = "audio_meta_get_album_artist", CallingConvention = CallingConvention.Cdecl)] - internal static extern MediaContentError GetAlbumArtist(IntPtr handle, out IntPtr albumArtistName); - - [DllImport(Libraries.MediaContent, EntryPoint = "audio_meta_get_genre", CallingConvention = CallingConvention.Cdecl)] - internal static extern MediaContentError GetGenre(IntPtr handle, out IntPtr genreName); - - [DllImport(Libraries.MediaContent, EntryPoint = "audio_meta_get_composer", CallingConvention = CallingConvention.Cdecl)] - internal static extern MediaContentError GetComposer(IntPtr handle, out IntPtr composerName); - - [DllImport(Libraries.MediaContent, EntryPoint = "audio_meta_get_year", CallingConvention = CallingConvention.Cdecl)] - internal static extern MediaContentError GetYear(IntPtr handle, out IntPtr year); - - [DllImport(Libraries.MediaContent, EntryPoint = "audio_meta_get_recorded_date", CallingConvention = CallingConvention.Cdecl)] - internal static extern MediaContentError GetRecordedDate(IntPtr handle, out IntPtr recordedDate); - - [DllImport(Libraries.MediaContent, EntryPoint = "audio_meta_get_copyright", CallingConvention = CallingConvention.Cdecl)] - internal static extern MediaContentError GetCopyright(IntPtr handle, out IntPtr copyright); - - [DllImport(Libraries.MediaContent, EntryPoint = "audio_meta_get_track_num", CallingConvention = CallingConvention.Cdecl)] - internal static extern MediaContentError GetTrackNum(IntPtr handle, out IntPtr trackNum); - - [DllImport(Libraries.MediaContent, EntryPoint = "audio_meta_get_bit_rate", CallingConvention = CallingConvention.Cdecl)] - internal static extern MediaContentError GetBitRate(IntPtr handle, out int bitRate); - - [DllImport(Libraries.MediaContent, EntryPoint = "audio_meta_get_bitpersample", CallingConvention = CallingConvention.Cdecl)] - internal static extern MediaContentError GetBitPerSample(IntPtr handle, out int bitPerSample); - - [DllImport(Libraries.MediaContent, EntryPoint = "audio_meta_get_sample_rate", CallingConvention = CallingConvention.Cdecl)] - internal static extern MediaContentError GetSampleRate(IntPtr handle, out int sampleRate); - - [DllImport(Libraries.MediaContent, EntryPoint = "audio_meta_get_channel", CallingConvention = CallingConvention.Cdecl)] - internal static extern MediaContentError GetChannel(IntPtr handle, out int channel); - - [DllImport(Libraries.MediaContent, EntryPoint = "audio_meta_get_duration", CallingConvention = CallingConvention.Cdecl)] - internal static extern MediaContentError GetDuration(IntPtr handle, out int duration); - } -} diff --git a/src/Tizen.Content.MediaContent/Interop/Interop.Bookmark.cs b/src/Tizen.Content.MediaContent/Interop/Interop.Bookmark.cs deleted file mode 100644 index 3ea9f99eb..000000000 --- a/src/Tizen.Content.MediaContent/Interop/Interop.Bookmark.cs +++ /dev/null @@ -1,62 +0,0 @@ -/* - * 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; -using Tizen.Content.MediaContent; - -internal partial class Interop -{ - internal static partial class Bookmark - { - [DllImport(Libraries.MediaContent, EntryPoint = "media_bookmark_create")] - internal static extern MediaContentError Create(string mediaId, int time, out IntPtr handle); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_bookmark_insert_to_db_v2")] - internal static extern MediaContentError Insert(IntPtr handle); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_bookmark_delete_from_db")] - internal static extern MediaContentError Delete(int id); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_bookmark_get_bookmark_count_from_db")] - internal static extern MediaContentError GetCount(FilterHandle filter, out int count); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_bookmark_destroy")] - internal static extern MediaContentError Destroy(IntPtr bookmark); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_bookmark_get_bookmark_id")] - internal static extern MediaContentError GetId(IntPtr bookmark, out int id); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_bookmark_get_marked_time")] - internal static extern MediaContentError GetMarkedTime(IntPtr bookmark, out int time); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_bookmark_get_thumbnail_path")] - internal static extern MediaContentError GetThumbnailPath(IntPtr bookmark, out IntPtr filePath); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_bookmark_set_thumbnail_path")] - internal static extern MediaContentError SetThumbnailPath(IntPtr bookmark, string filePath); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_bookmark_get_name")] - internal static extern MediaContentError GetName(IntPtr bookmark, out IntPtr name); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_bookmark_set_name")] - internal static extern MediaContentError SetName(IntPtr bookmark, string name); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_bookmark_foreach_bookmark_from_db")] - internal static extern MediaContentError ForeachFromDb(FilterHandle filter, - Common.ItemCallback callback, IntPtr userData = default(IntPtr)); - } -} diff --git a/src/Tizen.Content.MediaContent/Interop/Interop.Common.cs b/src/Tizen.Content.MediaContent/Interop/Interop.Common.cs deleted file mode 100644 index d6dc8a920..000000000 --- a/src/Tizen.Content.MediaContent/Interop/Interop.Common.cs +++ /dev/null @@ -1,27 +0,0 @@ -/* - * 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 Common - { - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool ItemCallback(IntPtr itemHandle, IntPtr data); - } -} diff --git a/src/Tizen.Content.MediaContent/Interop/Interop.Face.cs b/src/Tizen.Content.MediaContent/Interop/Interop.Face.cs deleted file mode 100644 index ca3df6b6c..000000000 --- a/src/Tizen.Content.MediaContent/Interop/Interop.Face.cs +++ /dev/null @@ -1,72 +0,0 @@ -/* - * 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; -using Tizen.Content.MediaContent; - -internal static partial class Interop -{ - internal static partial class Face - { - [DllImport(Libraries.MediaContent, EntryPoint = "media_face_clone")] - internal static extern MediaContentError Clone(out IntPtr dst, IntPtr src); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_face_destroy")] - internal static extern MediaContentError Destroy(IntPtr face); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_face_get_face_id")] - internal static extern MediaContentError GetId(IntPtr face, out IntPtr faceId); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_face_get_media_id")] - internal static extern MediaContentError GetMediaId(IntPtr face, out IntPtr mediaId); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_face_get_face_rect")] - internal static extern MediaContentError GetFaceRect(IntPtr face, - out int x, out int y, out int w, out int h); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_face_get_orientation")] - internal static extern MediaContentError GetOrientation(IntPtr face, out Orientation orientation); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_face_get_tag")] - internal static extern MediaContentError GetTag(IntPtr face, out IntPtr tag); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_face_create")] - internal static extern MediaContentError Create(string mediaId, out IntPtr face); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_face_set_face_rect")] - internal static extern MediaContentError SetFaceRect(IntPtr face, int x, int y, int w, int h); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_face_set_orientation")] - internal static extern MediaContentError SetOrientation(IntPtr face, Orientation orientation); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_face_set_tag")] - internal static extern MediaContentError SetTag(IntPtr face, string tag); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_face_insert_to_db")] - internal static extern MediaContentError InsertToDb(IntPtr handle); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_face_update_to_db")] - internal static extern MediaContentError Update(IntPtr face); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_face_delete_from_db")] - internal static extern MediaContentError DeleteFromDb(string faceId); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_face_foreach_face_from_db")] - internal static extern MediaContentError ForeachFromDb(FilterHandle filter, - Common.ItemCallback callback, IntPtr userData = default(IntPtr)); - } -} diff --git a/src/Tizen.Content.MediaContent/Interop/Interop.Filter.cs b/src/Tizen.Content.MediaContent/Interop/Interop.Filter.cs deleted file mode 100644 index d2656811d..000000000 --- a/src/Tizen.Content.MediaContent/Interop/Interop.Filter.cs +++ /dev/null @@ -1,55 +0,0 @@ -/* - * 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; -using Tizen; -using Tizen.Content.MediaContent; - -internal static partial class Interop -{ - internal static partial class Filter - { - [DllImport(Libraries.MediaContent, EntryPoint = "media_filter_create")] - internal static extern MediaContentError Create(out FilterHandle filter); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_filter_destroy")] - internal static extern MediaContentError Destroy(IntPtr filter); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_filter_set_offset")] - internal static extern MediaContentError SetOffset(FilterHandle filter, int offset, int count); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_filter_set_condition")] - internal static extern MediaContentError SetCondition(FilterHandle filter, string condition, - Collation type); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_filter_set_order_v2")] - internal static extern MediaContentError SetOrder(FilterHandle filter, string orderExpression); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_filter_set_storage")] - internal static extern MediaContentError SetStorage(FilterHandle filter, string storageId); - } - - internal class FilterHandle : MediaContentCriticalHandle - { - public static readonly FilterHandle Null = new FilterHandle(); - - protected override MediaContentError DestroyHandle() - { - return Filter.Destroy(handle); - } - } -} diff --git a/src/Tizen.Content.MediaContent/Interop/Interop.Folder.cs b/src/Tizen.Content.MediaContent/Interop/Interop.Folder.cs deleted file mode 100644 index dbd989012..000000000 --- a/src/Tizen.Content.MediaContent/Interop/Interop.Folder.cs +++ /dev/null @@ -1,83 +0,0 @@ -/* - * 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; -using Tizen.Content.MediaContent; - -internal static partial class Interop -{ - internal static partial class Folder - { - [DllImport(Libraries.MediaContent, EntryPoint = "media_folder_get_folder_count_from_db")] - internal static extern MediaContentError GetFolderCountFromDb(FilterHandle filter, out int count); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_folder_get_media_count_from_db")] - internal static extern MediaContentError GetMediaCountFromDb(string folder_id, FilterHandle filter, out int count); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_folder_clone")] - internal static extern MediaContentError Clone(out IntPtr dst, IntPtr src); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_folder_destroy")] - internal static extern MediaContentError Destroy(IntPtr folder); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_folder_get_folder_id")] - internal static extern MediaContentError GetFolderId(IntPtr folder, out IntPtr folder_id); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_folder_get_parent_folder_id")] - internal static extern MediaContentError GetParentFolderId(IntPtr folder, out IntPtr parent_folder_id); - - - [DllImport(Libraries.MediaContent, EntryPoint = "media_folder_get_path")] - internal static extern MediaContentError GetPath(IntPtr folder, out IntPtr folderPath); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_folder_get_name")] - internal static extern MediaContentError GetName(IntPtr folder, out IntPtr folder_name); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_folder_get_modified_time")] - internal static extern MediaContentError GetModifiedTime(IntPtr folder, out IntPtr date); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_folder_get_storage_type")] - internal static extern MediaContentError GetStorageType(IntPtr folder, out StorageType storage_type); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_folder_get_storage_id")] - internal static extern MediaContentError GetStorageId(IntPtr folder, out IntPtr storage_id); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_folder_get_order")] - internal static extern MediaContentError GetOrder(IntPtr folder, out int order); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_folder_get_folder_from_db")] - internal static extern MediaContentError GetFolderFromDb(string id, out IntPtr folder); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_folder_set_name")] - internal static extern MediaContentError SetName(IntPtr folder, string name); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_folder_set_order")] - internal static extern MediaContentError SetOrder(IntPtr folder, int order); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_folder_update_to_db")] - internal static extern MediaContentError UpdateToDb(IntPtr folder); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_folder_foreach_folder_from_db")] - internal static extern MediaContentError ForeachFolderFromDb(FilterHandle filter, - Common.ItemCallback callback, IntPtr userData = default(IntPtr)); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_folder_foreach_media_from_db")] - internal static extern MediaContentError ForeachMediaFromDb(string id, FilterHandle filter, - Common.ItemCallback callback, IntPtr user_data); - } -} diff --git a/src/Tizen.Content.MediaContent/Interop/Interop.Group.cs b/src/Tizen.Content.MediaContent/Interop/Interop.Group.cs deleted file mode 100644 index f94936400..000000000 --- a/src/Tizen.Content.MediaContent/Interop/Interop.Group.cs +++ /dev/null @@ -1,44 +0,0 @@ -/* - * 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; -using Tizen.Content.MediaContent; - -internal static partial class Interop -{ - internal static partial class Group - { - [DllImport(Libraries.MediaContent, EntryPoint = "media_group_get_group_count_from_db")] - internal static extern MediaContentError GetGroupCount(FilterHandle filter, - MediaInfoColumnKey group, out int count); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_group_get_media_count_from_db")] - internal static extern MediaContentError GetMediaCount(string groupName, - MediaInfoColumnKey groupType, FilterHandle filter, out int count); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool MediaGroupCallback(string groupName, IntPtr data); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_group_foreach_group_from_db")] - internal static extern MediaContentError ForeachGroup(FilterHandle filter, - MediaInfoColumnKey group, MediaGroupCallback callback, IntPtr userData = default(IntPtr)); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_group_foreach_media_from_db")] - internal static extern MediaContentError ForeachMedia(string groupName, MediaInfoColumnKey group, - FilterHandle filter, Common.ItemCallback callback, IntPtr userData = default(IntPtr)); - } -} diff --git a/src/Tizen.Content.MediaContent/Interop/Interop.ImageInfo.cs b/src/Tizen.Content.MediaContent/Interop/Interop.ImageInfo.cs deleted file mode 100644 index c7d5ff83d..000000000 --- a/src/Tizen.Content.MediaContent/Interop/Interop.ImageInfo.cs +++ /dev/null @@ -1,61 +0,0 @@ -/* - * 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; -using Tizen.Content.MediaContent; - -internal static partial class Interop -{ - internal static partial class ImageInfo - { - [DllImport(Libraries.MediaContent, EntryPoint = "image_meta_destroy", CallingConvention = CallingConvention.Cdecl)] - internal static extern MediaContentError Destroy(IntPtr media); - - [DllImport(Libraries.MediaContent, EntryPoint = "image_meta_get_orientation", CallingConvention = CallingConvention.Cdecl)] - internal static extern MediaContentError GetOrientation(IntPtr handle, out Orientation orientation); - - [DllImport(Libraries.MediaContent, EntryPoint = "image_meta_get_date_taken", CallingConvention = CallingConvention.Cdecl)] - internal static extern MediaContentError GetDateTaken(IntPtr handle, out IntPtr dateTaken); - - [DllImport(Libraries.MediaContent, EntryPoint = "image_meta_get_burst_id", CallingConvention = CallingConvention.Cdecl)] - internal static extern MediaContentError GetBurstId(IntPtr handle, out IntPtr burstId); - - [DllImport(Libraries.MediaContent, EntryPoint = "image_meta_get_exposure_time", CallingConvention = CallingConvention.Cdecl)] - internal static extern MediaContentError GetExposureTime(IntPtr handle, out IntPtr exposureTime); - - [DllImport(Libraries.MediaContent, EntryPoint = "image_meta_get_fnumber", CallingConvention = CallingConvention.Cdecl)] - internal static extern MediaContentError GetFNumber(IntPtr handle, out double fNumber); - - [DllImport(Libraries.MediaContent, EntryPoint = "image_meta_get_iso", CallingConvention = CallingConvention.Cdecl)] - internal static extern MediaContentError GetISO(IntPtr handle, out int iso); - - [DllImport(Libraries.MediaContent, EntryPoint = "image_meta_get_model", CallingConvention = CallingConvention.Cdecl)] - internal static extern MediaContentError GetModel(IntPtr handle, out IntPtr model); - - [DllImport(Libraries.MediaContent, EntryPoint = "image_meta_is_burst_shot", CallingConvention = CallingConvention.Cdecl)] - internal static extern MediaContentError IsBurstShot(IntPtr handle, out bool isBurstShot); - - [DllImport(Libraries.MediaContent, EntryPoint = "image_meta_get_media_id", CallingConvention = CallingConvention.Cdecl)] - internal static extern MediaContentError GetMediaId(IntPtr handle, out IntPtr mediaId); - - [DllImport(Libraries.MediaContent, EntryPoint = "image_meta_get_width", CallingConvention = CallingConvention.Cdecl)] - internal static extern MediaContentError GetWidth(IntPtr handle, out int width); - - [DllImport(Libraries.MediaContent, EntryPoint = "image_meta_get_height", CallingConvention = CallingConvention.Cdecl)] - internal static extern MediaContentError GetHeight(IntPtr handle, out int width); - } -} diff --git a/src/Tizen.Content.MediaContent/Interop/Interop.Libc.cs b/src/Tizen.Content.MediaContent/Interop/Interop.Libc.cs deleted file mode 100755 index 825599e27..000000000 --- a/src/Tizen.Content.MediaContent/Interop/Interop.Libc.cs +++ /dev/null @@ -1,27 +0,0 @@ -/* - * 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 Libc - { - [DllImport(Libraries.Libc, EntryPoint = "free", CallingConvention = CallingConvention.Cdecl)] - internal static extern int Free(IntPtr ptr); - } -} diff --git a/src/Tizen.Content.MediaContent/Interop/Interop.Libraries.cs b/src/Tizen.Content.MediaContent/Interop/Interop.Libraries.cs deleted file mode 100755 index 67fdba79d..000000000 --- a/src/Tizen.Content.MediaContent/Interop/Interop.Libraries.cs +++ /dev/null @@ -1,24 +0,0 @@ -/* - * 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 MediaContent = "libcapi-content-media-content.so.0"; - public const string Libc = "libc.so.6"; - } -} diff --git a/src/Tizen.Content.MediaContent/Interop/Interop.MediaContent.cs b/src/Tizen.Content.MediaContent/Interop/Interop.MediaContent.cs deleted file mode 100755 index a90817ce0..000000000 --- a/src/Tizen.Content.MediaContent/Interop/Interop.MediaContent.cs +++ /dev/null @@ -1,55 +0,0 @@ -/* - * 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; -using Tizen.Content.MediaContent; - -internal static partial class Interop -{ - internal static partial class Content - { - [DllImport(Libraries.MediaContent, EntryPoint = "media_content_connect")] - internal static extern MediaContentError Connect(); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_content_disconnect")] - internal static extern MediaContentError Disconnect(); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_content_scan_file")] - internal static extern MediaContentError ScanFile(string filePath); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_content_cancel_scan_folder")] - internal static extern MediaContentError CancelScanFolder(string folderPath); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void MediaScanCompletedCallback(MediaContentError error, IntPtr data); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void MediaContentDBUpdatedCallback(MediaContentError error, int pid, ItemType updateItem, - OperationType updateType, MediaType mediaType, string uuid, string filePath, string mimeType, IntPtr data); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_content_scan_folder")] - internal static extern MediaContentError ScanFolder(string folderPath, - bool recursive, MediaScanCompletedCallback scanCompletedCallback, IntPtr userData = default(IntPtr)); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_content_add_db_updated_cb")] - internal static extern MediaContentError AddDbUpdatedCb(MediaContentDBUpdatedCallback mediaContentDBUpdatedCallback, - IntPtr userData, out IntPtr notiHandle); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_content_remove_db_updated_cb")] - internal static extern MediaContentError RemoveDbUpdatedCb(IntPtr notiHandle); - } -} diff --git a/src/Tizen.Content.MediaContent/Interop/Interop.MediaContentHandle.cs b/src/Tizen.Content.MediaContent/Interop/Interop.MediaContentHandle.cs deleted file mode 100644 index 09c8481d3..000000000 --- a/src/Tizen.Content.MediaContent/Interop/Interop.MediaContentHandle.cs +++ /dev/null @@ -1,46 +0,0 @@ -/* - * 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; -using Tizen; -using Tizen.Content.MediaContent; - -internal static partial class Interop -{ - internal abstract class MediaContentCriticalHandle : CriticalHandle - { - public MediaContentCriticalHandle() : base(IntPtr.Zero) - { - } - - public override bool IsInvalid => handle == IntPtr.Zero; - - protected override bool ReleaseHandle() - { - var result = DestroyHandle(); - if (result != MediaContentError.None) - { - Log.Error(GetType().Name, $"Failed to destroy handle : {result}"); - return false; - } - - return true; - } - - protected abstract MediaContentError DestroyHandle(); - } -} diff --git a/src/Tizen.Content.MediaContent/Interop/Interop.MediaInfo.cs b/src/Tizen.Content.MediaContent/Interop/Interop.MediaInfo.cs deleted file mode 100644 index 244e98aa9..000000000 --- a/src/Tizen.Content.MediaContent/Interop/Interop.MediaInfo.cs +++ /dev/null @@ -1,236 +0,0 @@ -/* - * 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; -using Tizen.Content.MediaContent; - -internal static partial class Interop -{ - internal static partial class MediaInfo - { - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void ThumbnailCompletedCallback(MediaContentError error, string filePath, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void FaceDetectionCompletedCallback(MediaContentError error, int count, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void InsertCompletedCallback(MediaContentError error, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void InsertBurstShotCompletedCallback(MediaContentError error, IntPtr userData); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_info_insert_to_db")] - internal static extern MediaContentError Insert(string filePath, out MediaInfoHandle info); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_info_insert_batch_to_db")] - internal static extern MediaContentError BatchInsert(string[] filePathArray, int arrayLength, - InsertCompletedCallback callback, IntPtr userData = default(IntPtr)); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_info_insert_burst_shot_to_db")] - internal static extern MediaContentError BurstShotInsert(string[] filePathArray, int arrayLength, - InsertBurstShotCompletedCallback callback, IntPtr userData = default(IntPtr)); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_info_delete_from_db")] - internal static extern MediaContentError Delete(string mediaId); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_info_delete_batch_from_db")] - internal static extern MediaContentError BatchDelete(FilterHandle filter); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_info_destroy")] - internal static extern MediaContentError Destroy(IntPtr handle); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_info_get_media_count_from_db")] - internal static extern MediaContentError GetMediaCount(FilterHandle filter, out int mediaCount); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_info_foreach_media_from_db")] - internal static extern MediaContentError ForeachMedia(FilterHandle filter, Common.ItemCallback callback, - IntPtr userData = default(IntPtr)); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_info_get_tag_count_from_db")] - internal static extern MediaContentError GetTagCount(string mediaId, FilterHandle filter, out int tagCount); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_info_foreach_tag_from_db")] - internal static extern MediaContentError ForeachTags(string mediaId, FilterHandle filter, - Common.ItemCallback callback, IntPtr userData = default(IntPtr)); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_info_get_bookmark_count_from_db")] - internal static extern MediaContentError GetBookmarkCount(string mediaId, FilterHandle filter, out int bookmarkCount); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_info_foreach_bookmark_from_db")] - internal static extern MediaContentError ForeachBookmarks(string mediaId, FilterHandle filter, - Common.ItemCallback callback, IntPtr userData = default(IntPtr)); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_info_get_face_count_from_db")] - internal static extern MediaContentError GetFaceCount(string mediaId, FilterHandle filter, out int bookmarkCount); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_info_foreach_face_from_db")] - internal static extern MediaContentError ForeachFaces(string mediaId, FilterHandle filter, - Common.ItemCallback callback, IntPtr userData = default(IntPtr)); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_info_get_image")] - internal static extern MediaContentError GetImage(MediaInfoHandle handle, out IntPtr imageHandle); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_info_get_video")] - internal static extern MediaContentError GetVideo(MediaInfoHandle handle, out IntPtr videoHandle); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_info_get_audio")] - internal static extern MediaContentError GetAudio(MediaInfoHandle handle, out IntPtr audioHandle); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_info_get_media_id")] - internal static extern MediaContentError GetMediaId(MediaInfoHandle mediaInformationHandle, out IntPtr mediaId); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_info_get_file_path")] - internal static extern MediaContentError GetFilePath(MediaInfoHandle mediaInformationHandle, out IntPtr filePath); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_info_get_display_name")] - internal static extern MediaContentError GetDisplayName(MediaInfoHandle mediaInformationHandle, out IntPtr name); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_info_get_media_type")] - internal static extern MediaContentError GetMediaType(MediaInfoHandle mediaInformationHandle, out MediaType type); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_info_get_mime_type")] - internal static extern MediaContentError GetMimeType(MediaInfoHandle mediaInformationHandle, out IntPtr mimeType); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_info_get_size")] - internal static extern MediaContentError GetSize(MediaInfoHandle mediaInformationHandle, out long size); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_info_get_added_time")] - internal static extern MediaContentError GetAddedTime(MediaInfoHandle handle, out IntPtr posixTime); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_info_get_modified_time")] - internal static extern MediaContentError GetModifiedTime(MediaInfoHandle handle, out IntPtr posixTime); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_info_get_timeline")] - internal static extern MediaContentError GetTimeline(MediaInfoHandle handle, out IntPtr posixTime); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_info_get_thumbnail_path")] - internal static extern MediaContentError GetThumbnailPath(MediaInfoHandle mediaInformationHandle, out IntPtr filePath); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_info_get_description")] - internal static extern MediaContentError GetDescription(MediaInfoHandle mediaInformationHandle, out IntPtr description); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_info_get_longitude")] - internal static extern MediaContentError GetLongitude(MediaInfoHandle mediaInformationHandle, out double longitude); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_info_get_latitude")] - internal static extern MediaContentError GetLatitude(MediaInfoHandle mediaInformationHandle, out double latitude); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_info_get_altitude")] - internal static extern MediaContentError GetAltitude(MediaInfoHandle mediaInformationHandle, out double altitude); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_info_get_weather")] - internal static extern MediaContentError GetWeather(MediaInfoHandle mediaInformationHandle, out IntPtr weather); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_info_get_rating")] - internal static extern MediaContentError GetRating(MediaInfoHandle mediaInformationHandle, out int rating); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_info_get_favorite")] - internal static extern MediaContentError GetFavorite(MediaInfoHandle mediaInformationHandle, out bool favorite); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_info_get_provider")] - internal static extern MediaContentError GetProvider(MediaInfoHandle mediaInformationHandle, out IntPtr provider); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_info_get_title")] - internal static extern MediaContentError GetTitle(MediaInfoHandle mediaInformationHandle, out IntPtr title); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_info_get_category")] - internal static extern MediaContentError GetCategory(MediaInfoHandle mediaInformationHandle, out IntPtr category); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_info_get_location_tag")] - internal static extern MediaContentError GetLocationTag(MediaInfoHandle mediaInformationHandle, out IntPtr locationTag); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_info_get_age_rating")] - internal static extern MediaContentError GetAgeRating(MediaInfoHandle mediaInformationHandle, out IntPtr ageRating); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_info_get_storage_id")] - internal static extern MediaContentError GetStorageId(MediaInfoHandle mediaInformationHandle, out IntPtr storageId); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_info_is_drm")] - internal static extern MediaContentError IsDrm(MediaInfoHandle mediaInformationHandle, out bool isDrm); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_info_get_storage_type")] - internal static extern MediaContentError GetStorageType(MediaInfoHandle mediaInformationHandle, out StorageType storageType); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_info_get_media_from_db")] - internal static extern MediaContentError GetMediaFromDB(string mediaId, out MediaInfoHandle handle); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_info_set_weather")] - internal static extern MediaContentError SetWeather(MediaInfoHandle mediaInformationHandle, string weather); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_info_set_favorite")] - internal static extern MediaContentError SetFavorite(MediaInfoHandle mediaInformationHandle, bool favorite); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_info_set_provider")] - internal static extern MediaContentError SetProvider(MediaInfoHandle mediaInformationHandle, string provider); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_info_set_category")] - internal static extern MediaContentError SetCategory(MediaInfoHandle mediaInformationHandle, string category); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_info_set_location_tag")] - internal static extern MediaContentError SetLocationTag(MediaInfoHandle mediaInformationHandle, string locationTag); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_info_set_age_rating")] - internal static extern MediaContentError SetAgeRating(MediaInfoHandle mediaInformationHandle, string ageRating); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_info_update_to_db")] - internal static extern MediaContentError UpdateToDB(MediaInfoHandle mediaInformationHandle); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_info_move_to_db")] - internal static extern MediaContentError MoveToDB(MediaInfoHandle mediaInformationHandle, string dstPath); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_info_create_thumbnail")] - internal static extern MediaContentError CreateThumbnail(MediaInfoHandle handle, - ThumbnailCompletedCallback callback, IntPtr userData = default(IntPtr)); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_info_cancel_thumbnail")] - internal static extern MediaContentError CancelThumbnail(MediaInfoHandle mediaInformationHandle); - - - [DllImport(Libraries.MediaContent, EntryPoint = "media_info_start_face_detection")] - internal static extern MediaContentError StartFaceDetection(MediaInfoHandle handle, - FaceDetectionCompletedCallback callback, IntPtr userData = default(IntPtr)); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_info_cancel_face_detection")] - internal static extern MediaContentError CancelFaceDetection(MediaInfoHandle handle); - } - - internal sealed class MediaInfoHandle : SafeHandle - { - public MediaInfoHandle() - : base(IntPtr.Zero, true) - { - } - - public MediaInfoHandle(IntPtr handle) - : this() - { - SetHandle(handle); - } - - public override bool IsInvalid - { - get { return handle == IntPtr.Zero; } - } - - protected override bool ReleaseHandle() - { - MediaInfo.Destroy(handle); - return true; - } - } -} diff --git a/src/Tizen.Content.MediaContent/Interop/Interop.Playlist.cs b/src/Tizen.Content.MediaContent/Interop/Interop.Playlist.cs deleted file mode 100644 index 4f136eb5c..000000000 --- a/src/Tizen.Content.MediaContent/Interop/Interop.Playlist.cs +++ /dev/null @@ -1,97 +0,0 @@ -/* - * 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; -using Tizen.Content.MediaContent; - -internal static partial class Interop -{ - internal static partial class Playlist - { - [DllImport(Libraries.MediaContent, EntryPoint = "media_playlist_create")] - internal static extern MediaContentError Create(out IntPtr handle); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_playlist_get_playlist_count_from_db")] - internal static extern MediaContentError GetPlaylistCount(FilterHandle filter, out int count); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_playlist_get_media_count_from_db")] - internal static extern MediaContentError GetMediaCountFromDb(int playlistId, - FilterHandle filter, out int count); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_playlist_insert_to_db_v2")] - internal static extern MediaContentError Insert(IntPtr playlist); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_playlist_delete_from_db")] - internal static extern MediaContentError Delete(int id); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_playlist_update_to_db_v2")] - internal static extern MediaContentError Update(int id, IntPtr playlist); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_playlist_get_playlist_from_db")] - internal static extern MediaContentError GetPlaylistFromDb(int id, out IntPtr playlist); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_playlist_destroy")] - internal static extern MediaContentError Destroy(IntPtr playlist); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_playlist_clone")] - internal static extern MediaContentError Clone(out IntPtr dst, IntPtr src); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_playlist_get_playlist_id")] - internal static extern MediaContentError GetId(IntPtr playlist, out int id); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_playlist_get_name")] - internal static extern MediaContentError GetName(IntPtr playlist, out IntPtr name); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_playlist_set_name")] - internal static extern MediaContentError SetName(IntPtr playlist, string name); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_playlist_get_thumbnail_path")] - internal static extern MediaContentError GetThumbnailPath(IntPtr playlist, out IntPtr filePath); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_playlist_set_thumbnail_path")] - internal static extern MediaContentError SetThumbnailPath(IntPtr playlist, string filePath); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_playlist_set_play_order")] - internal static extern MediaContentError SetPlayOrder(IntPtr playlist, int memberId, int order); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_playlist_add_media")] - internal static extern MediaContentError AddMedia(IntPtr playlist, string mediaId); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_playlist_remove_media")] - internal static extern MediaContentError RemoveMedia(IntPtr playlist, int memberId); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_playlist_get_play_order_v2")] - internal static extern MediaContentError GetPlayOrder(int playlistId, int memberId, out int order); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_playlist_import_from_file")] - internal static extern MediaContentError ImportFromFile(string path, string name, out IntPtr playlist); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_playlist_export_to_file")] - internal static extern MediaContentError ExportToFile(IntPtr playlist, string filePath); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool PlaylistMemberCallback(int memberId, IntPtr mediaInfo, IntPtr data); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_playlist_foreach_playlist_from_db")] - internal static extern MediaContentError ForeachPlaylistFromDb(FilterHandle filter, - Common.ItemCallback callback, IntPtr userData = default(IntPtr)); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_playlist_foreach_media_from_db")] - internal static extern MediaContentError ForeachMediaFromDb(int playlistId, FilterHandle filter, - PlaylistMemberCallback callback, IntPtr userData = default(IntPtr)); - } -} diff --git a/src/Tizen.Content.MediaContent/Interop/Interop.Storage.cs b/src/Tizen.Content.MediaContent/Interop/Interop.Storage.cs deleted file mode 100644 index c3eb7dc93..000000000 --- a/src/Tizen.Content.MediaContent/Interop/Interop.Storage.cs +++ /dev/null @@ -1,54 +0,0 @@ -/* - * 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; -using Tizen.Content.MediaContent; - -internal static partial class Interop -{ - internal static class Storage - { - [DllImport(Libraries.MediaContent, EntryPoint = "media_storage_get_storage_info_from_db")] - internal static extern MediaContentError GetStorageInfoFromDb(string id, out IntPtr storage); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_storage_get_storage_count_from_db")] - internal static extern MediaContentError GetStorageCountFromDb(FilterHandle filter, out int count); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_storage_get_media_count_from_db")] - internal static extern MediaContentError GetMediaCountFromDb(string id, FilterHandle filter, out int count); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_storage_destroy")] - internal static extern MediaContentError Destroy(IntPtr storage); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_storage_get_id")] - internal static extern MediaContentError GetId(IntPtr storage, out IntPtr id); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_storage_get_path")] - internal static extern MediaContentError GetPath(IntPtr storage, out IntPtr path); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_storage_get_type")] - internal static extern MediaContentError GetType(IntPtr storage, out StorageType type); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_storage_foreach_storage_from_db")] - internal static extern MediaContentError ForeachStorageFromDb(FilterHandle filter, Common.ItemCallback callback, - IntPtr userData = default(IntPtr)); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_storage_foreach_media_from_db")] - internal static extern MediaContentError ForeachMediaFromDb(string id, FilterHandle filter, - Common.ItemCallback callback, IntPtr userData = default(IntPtr)); - } -} diff --git a/src/Tizen.Content.MediaContent/Interop/Interop.Tag.cs b/src/Tizen.Content.MediaContent/Interop/Interop.Tag.cs deleted file mode 100644 index 596ec9469..000000000 --- a/src/Tizen.Content.MediaContent/Interop/Interop.Tag.cs +++ /dev/null @@ -1,72 +0,0 @@ -/* - * 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; -using Tizen.Content.MediaContent; - -internal static partial class Interop -{ - internal static partial class Tag - { - [DllImport(Libraries.MediaContent, EntryPoint = "media_tag_create")] - internal static extern MediaContentError Create(out IntPtr handle); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_tag_insert_to_db")] - internal static extern MediaContentError Insert(string name, out IntPtr handle); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_tag_delete_from_db")] - internal static extern MediaContentError Delete(int tagId); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_tag_update_to_db_v2")] - internal static extern MediaContentError Update(int tagId, IntPtr tag); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_tag_get_tag_from_db")] - internal static extern MediaContentError GetTagFromDb(int tagId, out IntPtr tag); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_tag_get_tag_count_from_db")] - internal static extern MediaContentError GetTagCount(FilterHandle filter, out int count); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_tag_get_media_count_from_db")] - internal static extern MediaContentError GetMediaCount(int tagId, FilterHandle filter, out int count); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_tag_destroy")] - internal static extern MediaContentError Destroy(IntPtr tag); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_tag_get_tag_id")] - internal static extern MediaContentError GetId(IntPtr tag, out int value); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_tag_get_name")] - internal static extern MediaContentError GetName(IntPtr tag, out IntPtr value); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_tag_set_name")] - internal static extern MediaContentError SetName(IntPtr tag, string value); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_tag_add_media")] - internal static extern MediaContentError AddMedia(IntPtr tag, string mediaId); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_tag_remove_media")] - internal static extern MediaContentError RemoveMedia(IntPtr tag, string mediaId); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_tag_foreach_tag_from_db")] - internal static extern MediaContentError ForeachTagFromDb(FilterHandle filter, - Common.ItemCallback callback, IntPtr userData = default(IntPtr)); - - [DllImport(Libraries.MediaContent, EntryPoint = "media_tag_foreach_media_from_db")] - internal static extern MediaContentError ForeachMediaFromDb(int tagId, FilterHandle filter, - Common.ItemCallback callback, IntPtr userData = default(IntPtr)); - } -} diff --git a/src/Tizen.Content.MediaContent/Interop/Interop.VideoInfo.cs b/src/Tizen.Content.MediaContent/Interop/Interop.VideoInfo.cs deleted file mode 100644 index 4fc7f9486..000000000 --- a/src/Tizen.Content.MediaContent/Interop/Interop.VideoInfo.cs +++ /dev/null @@ -1,67 +0,0 @@ -/* - * 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; -using Tizen.Content.MediaContent; - -internal static partial class Interop -{ - internal static partial class VideoInfo - { - [DllImport(Libraries.MediaContent, EntryPoint = "video_meta_destroy", CallingConvention = CallingConvention.Cdecl)] - internal static extern MediaContentError Destroy(IntPtr handle); - - [DllImport(Libraries.MediaContent, EntryPoint = "video_meta_get_album", CallingConvention = CallingConvention.Cdecl)] - internal static extern MediaContentError GetAlbum(IntPtr handle, out IntPtr albumName); - - [DllImport(Libraries.MediaContent, EntryPoint = "video_meta_get_artist", CallingConvention = CallingConvention.Cdecl)] - internal static extern MediaContentError GetArtist(IntPtr handle, out IntPtr artistName); - - [DllImport(Libraries.MediaContent, EntryPoint = "video_meta_get_album_artist", CallingConvention = CallingConvention.Cdecl)] - internal static extern MediaContentError GetAlbumArtist(IntPtr handle, out IntPtr albumArtistName); - - [DllImport(Libraries.MediaContent, EntryPoint = "video_meta_get_genre", CallingConvention = CallingConvention.Cdecl)] - internal static extern MediaContentError GetGenre(IntPtr handle, out IntPtr genreName); - - [DllImport(Libraries.MediaContent, EntryPoint = "video_meta_get_composer", CallingConvention = CallingConvention.Cdecl)] - internal static extern MediaContentError GetComposer(IntPtr handle, out IntPtr composerName); - - [DllImport(Libraries.MediaContent, EntryPoint = "video_meta_get_year", CallingConvention = CallingConvention.Cdecl)] - internal static extern MediaContentError GetYear(IntPtr handle, out IntPtr year); - - [DllImport(Libraries.MediaContent, EntryPoint = "video_meta_get_recorded_date", CallingConvention = CallingConvention.Cdecl)] - internal static extern MediaContentError GetRecordedDate(IntPtr handle, out IntPtr recordedDate); - - [DllImport(Libraries.MediaContent, EntryPoint = "video_meta_get_copyright", CallingConvention = CallingConvention.Cdecl)] - internal static extern MediaContentError GetCopyright(IntPtr handle, out IntPtr copyright); - - [DllImport(Libraries.MediaContent, EntryPoint = "video_meta_get_track_num", CallingConvention = CallingConvention.Cdecl)] - internal static extern MediaContentError GetTrackNum(IntPtr handle, out IntPtr trackNum); - - [DllImport(Libraries.MediaContent, EntryPoint = "video_meta_get_bit_rate", CallingConvention = CallingConvention.Cdecl)] - internal static extern MediaContentError GetBitRate(IntPtr handle, out int bitRate); - - [DllImport(Libraries.MediaContent, EntryPoint = "video_meta_get_duration", CallingConvention = CallingConvention.Cdecl)] - internal static extern MediaContentError GetDuration(IntPtr handle, out int duration); - - [DllImport(Libraries.MediaContent, EntryPoint = "video_meta_get_width", CallingConvention = CallingConvention.Cdecl)] - internal static extern MediaContentError GetWidth(IntPtr handle, out int width); - - [DllImport(Libraries.MediaContent, EntryPoint = "video_meta_get_height", CallingConvention = CallingConvention.Cdecl)] - internal static extern MediaContentError GetHeight(IntPtr handle, out int width); - } -} diff --git a/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent.csproj b/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent.csproj deleted file mode 100644 index fbac84167..000000000 --- a/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent.csproj +++ /dev/null @@ -1,13 +0,0 @@ - - - - netstandard2.0 - - - - - - - - - diff --git a/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent.sln b/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent.sln deleted file mode 100755 index 5a6ff4054..000000000 --- a/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent.sln +++ /dev/null @@ -1,34 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26430.12 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Content.MediaContent", "Tizen.Content.MediaContent.csproj", "{45518596-2EC9-4624-9AE9-D9A0E6708B8C}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen", "..\Tizen\Tizen.csproj", "{7F2897B0-FECF-493B-B988-590ADB8B5AC8}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Log", "..\Tizen.Log\Tizen.Log.csproj", "{4FCA7B32-660F-46BF-820F-EBA7C039733F}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {45518596-2EC9-4624-9AE9-D9A0E6708B8C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {45518596-2EC9-4624-9AE9-D9A0E6708B8C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {45518596-2EC9-4624-9AE9-D9A0E6708B8C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {45518596-2EC9-4624-9AE9-D9A0E6708B8C}.Release|Any CPU.Build.0 = Release|Any CPU - {7F2897B0-FECF-493B-B988-590ADB8B5AC8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7F2897B0-FECF-493B-B988-590ADB8B5AC8}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7F2897B0-FECF-493B-B988-590ADB8B5AC8}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7F2897B0-FECF-493B-B988-590ADB8B5AC8}.Release|Any CPU.Build.0 = Release|Any CPU - {4FCA7B32-660F-46BF-820F-EBA7C039733F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {4FCA7B32-660F-46BF-820F-EBA7C039733F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {4FCA7B32-660F-46BF-820F-EBA7C039733F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {4FCA7B32-660F-46BF-820F-EBA7C039733F}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/Album.cs b/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/Album.cs deleted file mode 100755 index 9bb2d2b87..000000000 --- a/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/Album.cs +++ /dev/null @@ -1,69 +0,0 @@ -/* - * 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.Content.MediaContent -{ - /// - /// Represents a logical collection grouping of related media information. - /// - /// - public class Album - { - internal Album(IntPtr handle) - { - Id = InteropHelper.GetValue(handle, Interop.Album.GetId); - - Artist = InteropHelper.GetString(handle, Interop.Album.GetArtist); - AlbumArtPath = InteropHelper.GetString(handle, Interop.Album.GetAlbumArt); - Name = InteropHelper.GetString(handle, Interop.Album.GetName); - } - - internal static Album FromHandle(IntPtr handle) => new Album(handle); - - /// - /// Gets the ID of the album. - /// - /// The unique ID of the album. - public int Id { get; } - - /// - /// Gets the artist name of the album. - /// - /// The artist name. - public string Artist { get; } - - /// - /// Gets the path to the album art. - /// - /// The path to the album art. - public string AlbumArtPath { get; } - - /// - /// Gets the name of the album. - /// - /// The album name. - public string Name { get; } - - /// - /// Returns a string representation of the album. - /// - /// A string representation of the current album. - public override string ToString() => - $"Id={Id}, Name={Name}, Artist={Artist}, AlbumArtPath={AlbumArtPath}"; - } -} diff --git a/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/AlbumCommand.cs b/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/AlbumCommand.cs deleted file mode 100644 index 42abf3d23..000000000 --- a/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/AlbumCommand.cs +++ /dev/null @@ -1,195 +0,0 @@ -/* - * 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.Content.MediaContent -{ - /// - /// Provides commands to manage albums in the database. - /// - /// - public class AlbumCommand : MediaCommand - { - /// - /// Initializes a new instance of the class with the specified . - /// - /// The that the commands run on. - /// is null. - /// has already been disposed of. - public AlbumCommand(MediaDatabase database) : base(database) - { - } - - /// - /// Retrieves the number of albums. - /// - /// The number of albums. - /// The is disconnected. - /// The has already been disposed of. - /// An error occurred while executing the command. - public int Count() - { - return Count(null); - } - - /// - /// Retrieves the number of albums with . - /// - /// The criteria to use to filter. This value can be null. - /// The number of albums. - /// The is disconnected. - /// The has already been disposed of. - /// An error occurred while executing the command. - public int Count(CountArguments arguments) - { - ValidateDatabase(); - - return CommandHelper.Count(Interop.Album.GetAlbumCountFromDb, arguments); - } - - /// - /// Retrieves all the albums. - /// - /// The containing the results. - /// The is disconnected. - /// The has already been disposed of. - /// An error occurred while executing the command. - public MediaDataReader Select() - { - return Select(null); - } - - /// - /// Retrieves the albums with . - /// - /// The criteria to use to filter. This value can be null. - /// The containing the results. - /// The is disconnected. - /// The has already been disposed of. - /// An error occurred while executing the command. - public MediaDataReader Select(SelectArguments filter) - { - ValidateDatabase(); - - return CommandHelper.Select(filter, Interop.Album.ForeachAlbumFromDb, Album.FromHandle); - } - - /// - /// Retrieves an album with the album ID. - /// - /// The ID of the album to query with. - /// The if exists, otherwise null. - /// The is disconnected. - /// The has already been disposed of. - /// is equal to or less than zero. - /// An error occurred while executing the command. - public Album Select(int albumId) - { - ValidateDatabase(); - - if (albumId <= 0) - { - throw new ArgumentOutOfRangeException(nameof(albumId), albumId, - "The album id can't be equal to or less than zero."); - } - - IntPtr handle = IntPtr.Zero; - try - { - Interop.Album.GetAlbumFromDb(albumId, out handle).ThrowIfError("Failed to query"); - - return handle == IntPtr.Zero ? null : new Album(handle); - } - finally - { - Interop.Album.Destroy(handle); - } - } - - /// - /// Retrieves the number of media information that belongs to the album. - /// - /// The ID of the album to query with. - /// The number of media information. - /// The is disconnected. - /// The has already been disposed of. - /// is equal to or less than zero. - /// An error occurred while executing the command. - public int CountMember(int albumId) - { - return CountMember(albumId, null); - } - - /// - /// Retrieves the number of media information that belongs to the album with . - /// - /// The ID of the album to count media. - /// The criteria to use to filter. This value can be null. - /// The number of media information. - /// The is disconnected. - /// The has already been disposed of. - /// is equal to or less than zero. - /// An error occurred while executing the command. - public int CountMember(int albumId, CountArguments arguments) - { - ValidateDatabase(); - - if (albumId <= 0) - { - throw new ArgumentOutOfRangeException(nameof(albumId), albumId, - "The album id can't be equal to or less than zero."); - } - - return CommandHelper.Count(Interop.Album.GetMediaCountFromDb, albumId, arguments); - } - - /// - /// Retrieves the media information of the album. - /// - /// The ID of the album to select media. - /// The containing the results. - /// The is disconnected. - /// The has already been disposed of. - /// An error occurred while executing the command. - public MediaDataReader SelectMember(int albumId) - { - return SelectMember(albumId, null); - } - - /// - /// Retrieves the media information of the album with . - /// - /// The ID of the album to query with. - /// The criteria to use to filter. This value can be null. - /// The containing the results. - /// The is disconnected. - /// The has already been disposed of. - /// An error occurred while executing the command. - public MediaDataReader SelectMember(int albumId, SelectArguments filter) - { - ValidateDatabase(); - - if (albumId <= 0) - { - throw new ArgumentOutOfRangeException(nameof(albumId), albumId, - "The album id can't be equal to or less than zero."); - } - - return CommandHelper.SelectMedia(Interop.Album.ForeachMediaFromDb, albumId, filter); - } - } -} diff --git a/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/AudioInfo.cs b/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/AudioInfo.cs deleted file mode 100644 index ecfda74f3..000000000 --- a/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/AudioInfo.cs +++ /dev/null @@ -1,144 +0,0 @@ -/* - * 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.Diagnostics; - -namespace Tizen.Content.MediaContent -{ - /// - /// Represents the audio media information. - /// - public class AudioInfo : MediaInfo - { - internal AudioInfo(Interop.MediaInfoHandle handle) : base(handle) - { - IntPtr audioHandle = IntPtr.Zero; - - try - { - Interop.MediaInfo.GetAudio(handle, out audioHandle).ThrowIfError("Failed to retrieve data"); - - Debug.Assert(audioHandle != IntPtr.Zero); - - Album = InteropHelper.GetString(audioHandle, Interop.AudioInfo.GetAlbum); - Artist = InteropHelper.GetString(audioHandle, Interop.AudioInfo.GetArtist); - AlbumArtist = InteropHelper.GetString(audioHandle, Interop.AudioInfo.GetAlbumArtist); - Genre = InteropHelper.GetString(audioHandle, Interop.AudioInfo.GetGenre); - Composer = InteropHelper.GetString(audioHandle, Interop.AudioInfo.GetComposer); - Year = InteropHelper.GetString(audioHandle, Interop.AudioInfo.GetYear); - DateRecorded = InteropHelper.GetString(audioHandle, Interop.AudioInfo.GetRecordedDate); - Copyright = InteropHelper.GetString(audioHandle, Interop.AudioInfo.GetCopyright); - TrackNumber = InteropHelper.GetString(audioHandle, Interop.AudioInfo.GetTrackNum); - - BitRate = InteropHelper.GetValue(audioHandle, Interop.AudioInfo.GetBitRate); - BitPerSample = InteropHelper.GetValue(audioHandle, Interop.AudioInfo.GetBitPerSample); - SampleRate = InteropHelper.GetValue(audioHandle, Interop.AudioInfo.GetSampleRate); - Channels = InteropHelper.GetValue(audioHandle, Interop.AudioInfo.GetChannel); - - Duration = InteropHelper.GetValue(audioHandle, Interop.AudioInfo.GetDuration); - } - finally - { - Interop.AudioInfo.Destroy(audioHandle); - } - } - - /// - /// Gets the album name. - /// - /// The album from the metadata. - public string Album { get; } - - /// - /// Gets the artist name. - /// - /// The artist from the metadata. - public string Artist { get; } - - /// - /// Gets the album artist name. - /// - /// The album artist from the metadata. - public string AlbumArtist { get; } - - /// - /// Gets the genre. - /// - /// The genre from the metadata. - public string Genre { get; } - - /// - /// Gets the composer. - /// - /// The composer from the metadata. - public string Composer { get; } - - /// - /// Gets the year. - /// - /// The year from the metadata. - public string Year { get; } - - /// - /// Gets the recorded date. - /// - /// The recorded date from the metadata. - public string DateRecorded { get; } - - /// - /// Gets the copyright. - /// - /// The copyright from the metadata. - public string Copyright { get; } - - /// - /// Gets the track number. - /// - /// The track number from the metadata. - public string TrackNumber { get; } - - /// - /// Gets the bit rate in bit per second. - /// - /// The bit rate in bit per second. - public int BitRate { get; } - - /// - /// Gets the bit per sample. - /// - /// The bit per sample. - public int BitPerSample { get; } - - /// - /// Gets the sample rate in hertz. - /// - /// The sample rate in hertz. - public int SampleRate { get; } - - /// - /// Gets the number of channels. - /// - /// The number of channels. - public int Channels { get; } - - /// - /// Gets the track duration in milliseconds. - /// - /// The track duration in milliseconds. - public int Duration { get; } - } -} diff --git a/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/Bookmark.cs b/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/Bookmark.cs deleted file mode 100644 index f1c8d5f6a..000000000 --- a/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/Bookmark.cs +++ /dev/null @@ -1,68 +0,0 @@ -/* - * 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.Content.MediaContent -{ - /// - /// Represents the media bookmark that allows you to mark an interesting moment - /// in media (video and audio) to enable fast searching. - /// - public class Bookmark - { - internal Bookmark(IntPtr handle) - { - Id = InteropHelper.GetValue(handle, Interop.Bookmark.GetId); - ThumbnailPath = InteropHelper.GetString(handle, Interop.Bookmark.GetThumbnailPath); - Offset = InteropHelper.GetValue(handle, Interop.Bookmark.GetMarkedTime); - Name = InteropHelper.GetString(handle, Interop.Bookmark.GetName); - } - - /// - /// Gets the ID of the bookmark. - /// - /// The ID of the bookmark. - public int Id { get; } - - /// - /// Gets the thumbnail path of the bookmark. - /// - /// The thumbnail path of the bookmark. - public string ThumbnailPath { get; } - - /// - /// Gets the offset in milliseconds. - /// - /// The offset of the bookmark in media in milliseconds. - public int Offset { get; } - - /// - /// Gets the name of the bookmark. - /// - /// The name of the bookmark. - public string Name { get; } - - internal static Bookmark FromHandle(IntPtr handle) => new Bookmark(handle); - - /// - /// Returns a string representation of the bookmark. - /// - /// A string representation of the current bookmark. - public override string ToString() => - $"Id={Id}, Name={Name}, ThumbnailPath={ThumbnailPath}, Offset={Offset}"; - } -} diff --git a/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/BookmarkCommand.cs b/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/BookmarkCommand.cs deleted file mode 100644 index a99383aef..000000000 --- a/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/BookmarkCommand.cs +++ /dev/null @@ -1,208 +0,0 @@ -/* - * 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.Content.MediaContent -{ - /// - /// Provides commands to manage bookmarks in the database. - /// - /// - public class BookmarkCommand : MediaCommand - { - /// - /// Initializes a new instance of the class with the specified . - /// - /// The that the commands run on. - /// is null. - /// has already been disposed of. - public BookmarkCommand(MediaDatabase database) : base(database) - { - } - - /// - /// Retrieves the number of bookmarks. - /// - /// The number of bookmarks. - /// The is disconnected. - /// The has already been disposed of. - /// An error occurred while executing the command. - public int Count() - { - return Count(null); - } - - /// - /// Retrieves the number of bookmarks with . - /// - /// The criteria to use to filter. This value can be null. - /// The number of bookmarks. - /// The is disconnected. - /// The has already been disposed of. - /// An error occurred while executing the command. - public int Count(CountArguments arguments) - { - ValidateDatabase(); - - return CommandHelper.Count(Interop.Bookmark.GetCount, arguments); - } - - /// - /// Inserts a new bookmark into the database with the specified media and offset. - /// - /// http://tizen.org/privilege/content.write - /// The media ID to be associated with. - /// The time offset in milliseconds. - /// The instance that contains the record information inserted. - /// The is disconnected. - /// The has already been disposed of. - /// An error occurred while executing the command. - /// is null. - /// is a zero-length string, contains only white space. - /// The caller has no required privilege. - public Bookmark Insert(string mediaId, int offset) - { - return Insert(mediaId, offset, null); - } - - /// - /// Inserts a new bookmark into the database with the specified media ID, offset, and name. - /// - /// http://tizen.org/privilege/content.write - /// The media ID to be associated with. - /// The time offset in milliseconds. - /// The name of the bookmark. This value can be null. - /// The instance that contains the record information inserted. - /// The is disconnected. - /// The has already been disposed of. - /// An error occurred while executing the command. - /// is null. - /// is a zero-length string, contains only white space. - /// The caller has no required privilege. - public Bookmark Insert(string mediaId, int offset, string name) - { - return Insert(mediaId, offset, name, null); - } - - /// - /// Inserts a new bookmark into the database with the specified media ID, offset, name, and thumbnail path. - /// - /// http://tizen.org/privilege/content.write - /// - /// The thumbnail may be useful only when the media is video. - /// - /// The media ID to be associated with. - /// The time offset in milliseconds. - /// The name of the bookmark. This value can be null. - /// The thumbnail path of the bookmark. This value can be null. - /// The instance that contains the record information inserted. - /// The is disconnected. - /// The has already been disposed of. - /// An error occurred while executing the command. - /// is null. - /// is a zero-length string, contains only white space. - /// The caller has no required privilege. - public Bookmark Insert(string mediaId, int offset, string name, string thumbnailPath) - { - ValidateDatabase(); - - ValidationUtil.ValidateNotNullOrEmpty(mediaId, nameof(mediaId)); - - Interop.Bookmark.Create(mediaId, offset, out var handle).ThrowIfError("Failed to insert new bookmark"); - - try - { - Interop.Bookmark.SetName(handle, name).ThrowIfError("Failed to insert new bookmark"); - - if (thumbnailPath != null) - { - Interop.Bookmark.SetThumbnailPath(handle, thumbnailPath). - ThrowIfError("Failed to insert new bookmark"); - } - - Interop.Bookmark.Insert(handle).ThrowIfError("Failed to insert new bookmark"); - - return new Bookmark(handle); - } - finally - { - Interop.Bookmark.Destroy(handle); - } - } - - /// - /// Deletes a bookmark from the database. - /// - /// http://tizen.org/privilege/content.write - /// The bookmark ID to delete. - /// true if the matched record was found and deleted, otherwise false. - /// The is disconnected. - /// The has already been disposed of. - /// An error occurred while executing the command. - /// is less than zero. - /// The caller has no required privilege. - public bool Delete(int bookmarkId) - { - ValidateDatabase(); - - if (bookmarkId < 0) - { - throw new ArgumentOutOfRangeException(nameof(bookmarkId), bookmarkId, - "Bookmark id shouldn't be negative."); - } - - if (CommandHelper.Count(Interop.Bookmark.GetCount, $"{BookmarkColumns.Id}={bookmarkId}") == 0) - { - return false; - } - - CommandHelper.Delete(Interop.Bookmark.Delete, bookmarkId); - - return true; - } - - - /// - /// Retrieves the bookmarks. - /// - /// The containing the results. - /// The is disconnected. - /// The has already been disposed of. - /// An error occurred while executing the command. - public MediaDataReader Select() - { - return Select(null); - } - - /// - /// Retrieves the bookmarks with . - /// - /// The criteria to use to filter. This value can be null. - /// The containing the results. - /// The is disconnected. - /// The has already been disposed of. - /// An error occurred while executing the command. - public MediaDataReader Select(SelectArguments filter) - { - ValidateDatabase(); - - return CommandHelper.Select(filter, Interop.Bookmark.ForeachFromDb, Bookmark.FromHandle); - } - - } - -} diff --git a/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/Columns.cs b/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/Columns.cs deleted file mode 100644 index e3346d226..000000000 --- a/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/Columns.cs +++ /dev/null @@ -1,838 +0,0 @@ -/* - * 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. - */ - -namespace Tizen.Content.MediaContent -{ - /// - /// Provides the column names that can be used for Select and Count commands. - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - public static class MediaInfoColumns - { - /// - /// Gets the column name for the ID of media. - /// - /// The column name for the ID of media. - /// The value type is string. - /// - public static string Id => "MEDIA_ID"; - - /// - /// Gets the column name for the path of media. - /// - /// The column name for the file path of media. - /// The value type is string. - /// - public static string Path => "MEDIA_PATH"; - - /// - /// Gets the column name for the display name of media. - /// - /// The column name for the display name of media. - /// The value type is string. - /// - public static string DisplayName => "MEDIA_DISPLAY_NAME"; - - /// - /// Gets the column name for the type of media. - /// - /// The column name for the type of media. - /// - /// The value type is integer. - /// The value should be an integer that is one of the values. - /// - /// - public static string MediaType => "MEDIA_TYPE"; - - /// - /// Gets the column name for the mime type of media. - /// - /// The column name for the mime type of media. - /// The value type is string. - /// - public static string MimeType => "MEDIA_MIME_TYPE"; - - /// - /// Gets the column name for the file size of media. - /// - /// The column name for the file size of media. - /// The value type is integer. - /// - public static string FileSize => "MEDIA_SIZE"; - - /// - /// Gets the column name for the date added of media. - /// - /// The column name for the date added of media. - /// - /// The value type is integer. - /// needs to be converted into the unix time. - /// - /// - /// - public static string DateAdded => "MEDIA_ADDED_TIME"; - - /// - /// Gets the column name for the date modified of media. - /// - /// The column name for the date modified of media. - /// - /// The value type is integer. - /// needs to be converted into the unix time. - /// - /// - /// - public static string DateModified => "MEDIA_MODIFIED_TIME"; - - /// - /// Gets the column name for the timeline of media. - /// - /// The column name for the timeline of media. - /// - /// The value type is integer. - /// needs to be converted into the unix time. - /// - /// - /// - public static string Timeline => "MEDIA_TIMELINE"; - - /// - /// Gets the column name for the thumbnail path of media. - /// - /// The column name for the thumbnail path of media. - /// - /// The value type is string. - /// - /// - public static string ThumbnailPath => "MEDIA_THUMBNAIL_PATH"; - - /// - /// Gets the column name for the title of media. - /// - /// The column name for the title of media. - /// - /// The value type is string. - /// - /// - public static string Title => "MEDIA_TITLE"; - - /// - /// Gets the column name for the album of media. - /// - /// The column name for the album of media. - /// - /// The value type is string. - /// - /// - public static string Album => "MEDIA_ALBUM"; - - /// - /// Gets the column name for the artist of media. - /// - /// The column name for the artist of media. - /// - /// The value type is string. - /// - /// - /// - public static string Artist => "MEDIA_ARTIST"; - - /// - /// Gets the column name for the album artist of media. - /// - /// The column name for the album artist of media. - /// - /// The value type is string. - /// - /// - /// - public static string AlbumArtist => "MEDIA_ALBUM_ARTIST"; - - /// - /// Gets the column name for the genre of media. - /// - /// The column name for the genre of media. - /// - /// The value type is string. - /// - /// - /// - public static string Genre => "MEDIA_GENRE"; - - /// - /// Gets the column name for the composer of media. - /// - /// The column name for the composer of media. - /// - /// The value type is string. - /// - /// - /// - public static string Composer => "MEDIA_COMPOSER"; - - /// - /// Gets the column name for the year of media. - /// - /// The column name for the year of media. - /// - /// The value type is string. - /// - /// - /// - public static string Year => "MEDIA_YEAR"; - - /// - /// Gets the column name for the date recorded of media. - /// - /// The column name for the date recorded of media. - /// - /// The value type is string. - /// - /// - /// - public static string DateRecorded => "MEDIA_RECORDED_DATE"; - - /// - /// Gets the column name for the copyright of media. - /// - /// The column name for the copyright of media. - /// - /// The value type is string. - /// - /// - /// - public static string Copyright => "MEDIA_COPYRIGHT"; - - /// - /// Gets the column name for the track number of media. - /// - /// The column name for the track number of media. - /// - /// The value type is string. - /// - /// - /// - public static string TrackNumber => "MEDIA_TRACK_NUM"; - - /// - /// Gets the column name for the description of media. - /// - /// The column name for the description of media. - /// - /// The value type is string. - /// - /// - public static string Description => "MEDIA_DESCRIPTION"; - - /// - /// Gets the column name for the bit rate of media. - /// - /// The column name for the bit rate of media. - /// - /// The value type is integer. - /// - /// - /// - public static string BitRate => "MEDIA_BITRATE"; - - /// - /// Gets the column name for the bit per sample of media. - /// - /// The column name for the bit per sample of media. - /// - /// The value type is integer. - /// - /// - public static string BitPerSample => "MEDIA_BITPERSAMPLE"; - - /// - /// Gets the column name for the sample rate of media. - /// - /// The column name for the sample rate of media. - /// - /// The value type is integer. - /// - /// - public static string SampleRate => "MEDIA_SAMPLERATE"; - - /// - /// Gets the column name for the channels of media. - /// - /// The column name for the channels of media. - /// - /// The value type is integer. - /// - /// - public static string Channels => "MEDIA_CHANNEL"; - - /// - /// Gets the column name for the duration of media. - /// - /// The column name for the duration of media. - /// - /// The value type is integer. - /// - /// - /// - public static string Duration => "MEDIA_DURATION"; - - /// - /// Gets the column name for the longitude of media. - /// - /// The column name for the longitude of media. - /// - /// The value type is real. - /// - /// - public static string Longitude => "MEDIA_LONGITUDE"; - - /// - /// Gets the column name for the latitude of media. - /// - /// The column name for the latitude of media. - /// - /// The value type is real. - /// - /// - public static string Latitude => "MEDIA_LATITUDE"; - - /// - /// Gets the column name for the altitude of media. - /// - /// The column name for the altitude of media. - /// - /// The value type is real. - /// - /// - public static string Altitude => "MEDIA_ALTITUDE"; - - /// - /// Gets the column name for the width of media. - /// - /// The column name for the width of media. - /// - /// The value type is integer. - /// - /// - /// - public static string Width => "MEDIA_WIDTH"; - - /// - /// Gets the column name for the height of media. - /// - /// The column name for the height of media. - /// - /// The value type is integer. - /// - /// - /// - public static string Height => "MEDIA_HEIGHT"; - - /// - /// Gets the column name for the date taken of media. - /// - /// The column name for the date taken of media. - /// - /// The value type is integer. - /// - /// - public static string DateTaken => "MEDIA_DATETAKEN"; - - /// - /// Gets the column name for the orientation of media. - /// - /// The column name for the orientation of media. - /// - /// The value type is integer. - /// The value should be an integer that is one of the values. - /// - /// - /// - public static string Orientation => "MEDIA_ORIENTATION"; - - /// - /// Gets the column name for the burst ID of media. - /// - /// The column name for the burst ID of media. - /// - /// The value type is string. - /// - /// - public static string BurstId => "BURST_ID"; - - /// - /// Gets the column name for the rating of media. - /// - /// The column name for the rating of media. - /// - /// The value type is integer. - /// - /// - public static string Rating => "MEDIA_RATING"; - - /// - /// Gets the column name for the favorite status of media. - /// - /// The column name for the favorite status of media. - /// - /// The value type is integer (1 : true, 0 : false). - /// - /// - public static string Favorite => "MEDIA_FAVOURITE"; - - /// - /// Gets the column name for the provider of media. - /// - /// The column name for the provider of media. - /// - /// The value type is string. - /// - /// - public static string Provider => "MEDIA_PROVIDER"; - - /// - /// Gets the column name for the category of media. - /// - /// The column name for the category of media. - /// - /// The value type is string. - /// - /// - public static string Category => "MEDIA_CATEGORY"; - - - /// - /// Gets the column name for the location tag of media. - /// - /// The column name for the location tag of media. - /// - /// The value type is string. - /// - /// - public static string LocationTag => "MEDIA_LOCATION_TAG"; - - /// - /// Gets the column name for the age rating of media. - /// - /// The column name for the age rating of media. - /// - /// The value type is string. - /// - /// > - public static string AgeRating => "MEDIA_AGE_RATING"; - - /// - /// Gets the column name for the weather information of media. - /// - /// The column name for the weather information of media. - /// - /// The value type is string. - /// - /// - public static string Weather => "MEDIA_WEATHER"; - - /// - /// Gets the column name for the drm of media. - /// - /// The column name for the drm of media. - /// - /// The value type is integer (1 : true, 0 : false). - /// - /// - public static string IsDrm => "MEDIA_IS_DRM"; - - /// - /// Gets the column name for the storage type of media. - /// - /// The column name for the storage type of media. - /// - /// The value type is integer. - /// The value should be an integer that is one of the values. - /// - /// - public static string StorageType => "MEDIA_STORAGE_TYPE"; - - /// - /// Gets the column name for the exposure time of media. - /// - /// The column name for the exposure time of media. - /// - /// The value type is integer. - /// - /// - public static string ExposureTime => "MEDIA_EXPOSURE_TIME"; - - /// - /// Gets the column name for the FNumber of media. - /// - /// The column name for the FNumber of media. - /// - /// The value type is integer. - /// - /// - public static string FNumber => "MEDIA_FNUMBER"; - - /// - /// Gets the column name for the ISO of media. - /// - /// The column name for the ISO of media. - /// - /// The value type is integer. - /// - /// - public static string Iso => "MEDIA_ISO"; - - /// - /// Gets the column name for the model of media. - /// - /// The column name for the model of media. - /// - /// The value type is string. - /// - /// - public static string Model => "MEDIA_MODEL"; - } - - - /// - /// Provides the folder column names that can be used for Select and Count commands. - /// - /// - /// - /// - /// - /// - /// - public static class AlbumColumns - { - /// - /// Gets the column name for the name of album. - /// - /// The column name for the name of album. - /// - /// The value type is string. - /// - /// - public static string Name => "MEDIA_ALBUM"; - - /// - /// Gets the column name for the artist of album. - /// - /// The column name for the artist of album. - /// - /// The value type is string. - /// - /// - public static string Artist => "MEDIA_ARTIST"; - } - - /// - /// Provides the folder column names that can be used for Select and Count commands. - /// - /// - /// - /// - /// - /// - /// - public static class FolderColumns - { - /// - /// Gets the column name for the ID of folder. - /// - /// The column name for the ID of folder. - /// - /// The value type is string. - /// - /// - public static string Id => "FOLDER_ID"; - - /// - /// Gets the column name for the path of folder. - /// - /// The column name for the path of folder. - /// - /// The value type is string. - /// - /// - public static string Path => "FOLDER_PATH"; - - /// - /// Gets the column name for the name of folder. - /// - /// The column name for the name of folder. - /// - /// The value type is string. - /// - /// - public static string Name => "FOLDER_NAME"; - - /// - /// Gets the column name for the storage type of folder. - /// - /// The column name for the storage type of folder. - /// - /// The value type is integer. - /// The value should be an integer that is one of the values. - /// - /// - public static string StorageType => "FOLDER_STORAGE_TYPE"; - } - - /// - /// Provides the playlist column names that can be used for Select and Count commands. - /// - /// - /// - /// - /// - /// - /// - public static class PlaylistColumns - { - /// - /// Gets the column name for the name of playlist. - /// - /// The column name for the name of playlist. - /// - /// The value type is string. - /// - /// - public static string Name => "PLAYLIST_NAME"; - - /// - /// Gets the column name for the ID of playlist. - /// - /// The column name for the ID of playlist. - /// - /// The value type is integer. - /// - /// - public static string Id => "PLAYLIST_ID"; - - /// - /// Gets the column name for the member order of playlist. - /// - /// The column name for the member order of playlist. - /// - /// The value type is integer. - /// - /// - public static string MemberOrder => "PLAYLIST_MEMBER_ORDER"; - - /// - /// Gets the column name for the number of members of playlist. - /// - /// The column name for the number of members of playlist. - /// - /// The value type is integer. - /// - /// - /// - public static string Count => "PLAYLIST_MEDIA_COUNT"; - } - - /// - /// Provides the tag column names that can be used for the . - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - /// - public static class TagColumns - { - /// - /// Gets the column name for the name of tag. - /// - /// The column name for the name of tag. - /// - /// The value type is string. - /// - /// - public static string Name => "TAG_NAME"; - - /// - /// Gets the column name for the number of media of tag. - /// - /// The column name for the number of media of tag. - /// - /// The value type is integer. - /// - /// - /// - public static string Count => "TAG_MEDIA_COUNT"; - - /// - /// Gets the column name for the ID of tag. - /// - /// The column name for the ID of tag. - /// - /// The value type is integer. - /// - /// - public static string Id => "TAG_ID"; - } - - /// - /// Provides the bookmark column names that can be used for Select and Count commands. - /// - /// - /// - /// - /// - /// - /// - /// - /// - public static class BookmarkColumns - { - /// - /// Gets the column name for the offset of the bookmark. - /// - /// The column name for the offset of the bookmark. - /// - /// The value type is integer. - /// - /// - public static string Offset => "BOOKMARK_MARKED_TIME"; - - /// - /// Gets the column name for the ID of the bookmark. - /// - /// The column name for the ID of the bookmark. - /// - /// The value type is integer. - /// - /// - public static string Id => "BOOKMARK_ID"; - - /// - /// Gets the column name for the name of the bookmark. - /// - /// The column name for the name of the bookmark. - /// - /// The value type is string. - /// - /// - public static string Name => "BOOKMARK_NAME"; - } - - /// - /// Provides the face info column names that can be used for Select and Count commands. - /// - /// - /// - /// - /// - /// - /// - /// - public static class FaceInfoColumns - { - /// - /// Gets the column name for the tag of face information. - /// - /// The column name for the tag of face information. - /// - /// The value type is string. - /// - /// - public static string Tag => "MEDIA_FACE_TAG"; - - /// - /// Gets the column name for the ID of face information. - /// - /// The column name for the ID of face information. - /// - /// The value type is string. - /// - /// - public static string Id => "MEDIA_FACE_ID"; - } - - /// - /// Provides the storage column names that can be used for Select and Count commands. - /// - /// - /// - /// - /// - /// - /// - public static class StorageColumns - { - /// - /// Gets the column name for the ID of storage. - /// - /// The column name for the ID of storage. - /// - /// The value type is string. - /// - /// - public static string Id => "STORAGE_ID"; - - /// - /// Gets the column name for the path of storage. - /// - /// The column name for the path of storage. - /// - /// The value type is string. - /// - /// - public static string Path => "STORAGE_PATH"; - - /// - /// Gets the column name for the type of storage. - /// - /// The column name for the type of storage. - /// - /// The value type is integer. - /// The value should be an integer that is one of the values. - /// - /// - public static string Type => "MEDIA_STORAGE_TYPE"; - } -} diff --git a/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/CommandHelper.cs b/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/CommandHelper.cs deleted file mode 100644 index b244cf5df..000000000 --- a/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/CommandHelper.cs +++ /dev/null @@ -1,183 +0,0 @@ -/* - * 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.Collections.Generic; -using FilterHandle = Interop.FilterHandle; - -namespace Tizen.Content.MediaContent -{ - internal static class CommandHelper - { - internal delegate MediaContentError CountFunc(FilterHandle filter, out int count); - - internal delegate MediaContentError CountFunc(T param, FilterHandle filter, - out int count); - - internal static int Count(CountFunc countFunc, CountArguments arguments) - { - using (var filter = QueryArguments.ToNativeHandle(arguments)) - { - countFunc(filter, out var count).ThrowIfError("Failed to query count"); - return count; - } - } - - internal static int Count(CountFunc countFunc, string filter) - { - return Count(countFunc, new CountArguments { FilterExpression = filter }); - } - - internal static int Count(CountFunc countFunc, T param, CountArguments arguments) - { - using (var filter = QueryArguments.ToNativeHandle(arguments)) - { - countFunc(param, filter, out var count).ThrowIfError("Failed to query count"); - return count; - } - } - - internal static void Delete(Func func, T param) - { - func(param).ThrowIfError("Failed to execute the command"); - } - - internal delegate MediaContentError ForeachFunc(T param, FilterHandle filter, - Interop.Common.ItemCallback callback, IntPtr data = default(IntPtr)); - - internal static MediaDataReader SelectMedia(ForeachFunc func, T param, - SelectArguments arguments) - { - using (var filter = QueryArguments.ToNativeHandle(arguments)) - { - var items = new List(); - Exception exception = null; - - func(param, filter, (mediaInfoHandle, _) => - { - try - { - items.Add(MediaInfo.FromHandle(mediaInfoHandle)); - return true; - } - catch (Exception e) - { - exception = e; - return false; - } - }).ThrowIfError("Failed to query"); - - if (exception != null) - { - throw exception; - } - - return new MediaDataReader(items); - } - } - - internal delegate MediaContentError ForeachFunc(FilterHandle filter, - Interop.Common.ItemCallback callback, IntPtr data = default(IntPtr)); - - internal static MediaDataReader Select(SelectArguments arguments, - ForeachFunc foreachFunc, - Func factoryFunc) - { - using (var filter = QueryArguments.ToNativeHandle(arguments)) - { - Exception caught = null; - var items = new List(); - - foreachFunc(filter, (itemHandle, _) => - { - try - { - items.Add(factoryFunc(itemHandle)); - return true; - } - catch (Exception e) - { - caught = e; - return false; - } - }).ThrowIfError("Failed to execute query"); - - if (caught != null) - { - throw caught; - } - - return new MediaDataReader(items); - } - } - - - internal delegate MediaContentError CloneFunc(out IntPtr output, IntPtr input); - - internal static IntPtr SelectScalar(ForeachFunc foreachFunc, string filterExpression, - CloneFunc cloneFunc) - { - using (var filter = QueryArguments.CreateNativeHandle(filterExpression)) - { - IntPtr handle = IntPtr.Zero; - - foreachFunc(filter, (itemHandle, _) => - { - cloneFunc(out handle, itemHandle); - return false; - }).ThrowIfError("Failed to execute query"); - - return handle; - } - } - - internal delegate MediaContentError ForeachMemberFunc(TParam param, - FilterHandle filter, Interop.Common.ItemCallback callback, IntPtr data = default(IntPtr)); - - internal static MediaDataReader SelectMembers(TParam param, - SelectArguments arguments, ForeachMemberFunc foreachFunc, - Func factoryFunc) - { - using (var filter = QueryArguments.ToNativeHandle(arguments)) - { - Exception caught = null; - var items = new List(); - - foreachFunc(param, filter, (itemHandle, _) => - { - try - { - items.Add(factoryFunc(itemHandle)); - - return true; - } - catch (Exception e) - { - caught = e; - return false; - } - }).ThrowIfError("Failed to execute query"); - - if (caught != null) - { - throw caught; - } - - return new MediaDataReader(items); - } - } - } -} diff --git a/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/Enums.cs b/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/Enums.cs deleted file mode 100644 index f020dfcb4..000000000 --- a/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/Enums.cs +++ /dev/null @@ -1,167 +0,0 @@ -/* - * 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. - */ - -namespace Tizen.Content.MediaContent -{ - /// - /// Specifies how the strings are compared. - /// - internal enum Collation - { - /// - /// Default collation, binary. - /// - Default, - /// - /// Case-insensitive. - /// - NoCase, - /// - /// Trailing space characters are ignored. - /// - Rtrim, - /// - /// Localized, NoCase also applied. - /// - Localized - } - - /// - /// Specifies the storage types. - /// - public enum StorageType - { - /// - /// The device's internal storage. - /// - Internal = 0, - - /// - /// The device's external storage like SD card. - /// - External = 1, - - /// - /// The external USB storage. - /// - ExternalUsb = 2 - } - - /// - /// Specifies database operation types. - /// - public enum OperationType - { - /// - /// Insert operation. - /// - Insert, - - /// - /// Delete operation. - /// - Delete, - - /// - /// Update operation. - /// - Update - } - - internal enum ItemType - { - File, - Directory - } - - /// - /// Specifies types of the . - /// - public enum MediaType - { - /// - /// The type of an image. - /// - /// - Image = 0, - - /// - /// The type of a video. - /// - /// - Video = 1, - - /// - /// The type of sound. - /// - /// - Sound = 2, - - /// - /// The type of music. - /// - /// - Music = 3, - - /// - /// The type of other. - /// - Other = 4 - } - - /// - /// Specifies orientation types of media. - /// - public enum Orientation - { - /// - /// None. - /// - Rotate0 = 0, - /// - /// Normal. - /// - Normal = 1, - /// - /// Rotate 90 degrees. - /// - Rotate90 = 6, - /// - /// Rotate 180 degrees. - /// - Rotate180 = 3, - /// - /// Rotate 270 degrees. - /// - Rotate270 = 8, - /// - /// Flip horizontal. - /// - FlipHorizontal = 2, - /// - /// Flip vertical. - /// - FlipVertical = 4, - /// - /// Transpose. - /// - Transpose = 5, - /// - /// Transverse. - /// - Transverse = 7, - } -} diff --git a/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/EventArgs.cs b/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/EventArgs.cs deleted file mode 100644 index b2c7eab0d..000000000 --- a/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/EventArgs.cs +++ /dev/null @@ -1,135 +0,0 @@ -/* - * 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.Content.MediaContent -{ - - /// - /// Provides data for the event. - /// - public class MediaInfoUpdatedEventArgs : EventArgs - { - internal MediaInfoUpdatedEventArgs(int pid, - OperationType operationType, MediaType mediaType, string id, string path, string mimeType) - { - ProcessId = pid; - OperationType = operationType; - Id = id; - Path = path; - - MediaType = mediaType; - MimeType = mimeType; - } - - /// - /// Gets the process ID which triggers the event. - /// - /// The process ID which triggers the event. - public int ProcessId - { - get; - } - - /// - /// Gets the operation type. - /// - /// The operation type which triggers the event. - public OperationType OperationType - { - get; - } - - /// - /// Gets the ID of the media updated. - /// - /// The ID of the media updated. - public string Id - { - get; - } - - /// - /// Gets the path of the media updated. - /// - /// The path of the media updated. - public string Path - { - get; - } - - /// - /// Gets the type of the media updated. - /// - /// The of the media updated. - public MediaType MediaType - { - get; - } - - /// - /// The MIME type of the media updated. - /// - /// The MIME type of the media updated. - public string MimeType - { - get; - } - } - - - /// - /// Provides data for the event. - /// - public class FolderUpdatedEventArgs : EventArgs - { - internal FolderUpdatedEventArgs(OperationType operationType, string id, string path) - { - OperationType = operationType; - Id = id; - Path = path; - } - - /// - /// Gets the operation type. - /// - /// The operation type which triggers the event. - public OperationType OperationType - { - get; - } - - /// - /// Gets the ID of the folder updated. - /// - /// The ID of the folder updated. - public string Id - { - get; - } - - /// - /// Gets the path of the folder updated. - /// - /// The path of the folder updated. - public string Path - { - get; - } - } - -} diff --git a/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/FaceInfo.cs b/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/FaceInfo.cs deleted file mode 100644 index a1b490145..000000000 --- a/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/FaceInfo.cs +++ /dev/null @@ -1,89 +0,0 @@ -/* - * 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.Content.MediaContent -{ - /// - /// Represents the face information for the media. - /// - public class FaceInfo - { - internal FaceInfo(IntPtr handle) - { - Id = InteropHelper.GetString(handle, Interop.Face.GetId); - MediaInfoId = InteropHelper.GetString(handle, Interop.Face.GetMediaId); - - Tag = InteropHelper.GetString(handle, Interop.Face.GetTag); - Orientation = InteropHelper.GetValue(handle, Interop.Face.GetOrientation); - - Rect = GetRect(handle); - } - - private static Rectangle GetRect(IntPtr faceHandle) - { - Interop.Face.GetFaceRect(faceHandle, out var x, out var y, out var width, out var height). - ThrowIfError("Failed to get rect for the face info"); - - return new Rectangle(x, y, width, height); - } - - /// - /// Gets the region. - /// - /// The region of face in the media. - /// - /// The coordinates of the rectangle are orientation-applied values. - /// - public Rectangle Rect { get; } - - /// - /// Gets the ID of face information. - /// - public string Id { get; } - - /// - /// Gets the media ID that the face information is added. - /// - /// The media ID that the face information is added. - public string MediaInfoId { get; } - - /// - /// Gets the tag name. - /// - /// The tag name of face information. - public string Tag { get; } - - /// - /// Gets the orientation of face information. - /// - /// The orientation of face information. - public Orientation Orientation { get; } - - internal static FaceInfo FromHandle(IntPtr handle) - { - return new FaceInfo(handle); - } - - /// - /// Returns a string representation of the face information. - /// - /// A string representation of the current face info. - public override string ToString() => - $"Id={Id}, MediaInfoId={MediaInfoId}, Rect=({Rect}), Tag={Tag}"; - } -} diff --git a/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/FaceInfoCommand.cs b/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/FaceInfoCommand.cs deleted file mode 100644 index 8b3f8dc18..000000000 --- a/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/FaceInfoCommand.cs +++ /dev/null @@ -1,139 +0,0 @@ -/* - * 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.Content.MediaContent -{ - /// - /// Provides commands to manage face information in the database. - /// - /// - public class FaceInfoCommand : MediaCommand - { - /// - /// Initializes a new instance of the class with the specified . - /// - /// The that the commands run on. - /// is null. - /// has already been disposed of. - public FaceInfoCommand(MediaDatabase database) : base(database) - { - } - - /// - /// Deletes the face information from the database. - /// - /// http://tizen.org/privilege/content.write - /// The face information ID to delete. - /// true if the matched record was found and deleted, otherwise false. - /// The is disconnected. - /// The has already been disposed of. - /// An error occurred while executing the command. - /// is null. - /// is a zero-length string, contains only white space. - /// The caller has no required privilege. - public bool Delete(string faceInfoId) - { - ValidateDatabase(); - - ValidationUtil.ValidateNotNullOrEmpty(faceInfoId, nameof(faceInfoId)); - - var reader = Select(new SelectArguments { FilterExpression = $"{FaceInfoColumns.Id}='{faceInfoId}'" }); - - if (reader.Read() == false) - { - return false; - } - - CommandHelper.Delete(Interop.Face.DeleteFromDb, faceInfoId); - return true; - } - - /// - /// Retrieves the face information. - /// - /// The containing the results. - /// The is disconnected. - /// The has already been disposed of. - /// An error occurred while executing the command. - public MediaDataReader Select() - { - return Select(null); - } - - /// - /// Retrieves the face information with the . - /// - /// The criteria to use to filter. This value can be null. - /// The containing the results. - /// The is disconnected. - /// The has already been disposed of. - /// An error occurred while executing the command. - public MediaDataReader Select(SelectArguments filter) - { - ValidateDatabase(); - - return CommandHelper.Select(filter, Interop.Face.ForeachFromDb, FaceInfo.FromHandle); - } - - /// - /// Updates a tag with the specified tag. - /// - /// http://tizen.org/privilege/content.write - /// The face information ID to update. - /// The tag value for update. - /// true if the matched record was found and updated, otherwise false. - /// Only values set in the are updated. - /// The is disconnected. - /// The has already been disposed of. - /// An error occurred while executing the command. - /// is null. - /// is a zero-length string, contains only white space. - /// The caller has no required privilege. - public bool UpdateTag(string faceInfoId, string tag) - { - ValidateDatabase(); - - ValidationUtil.ValidateNotNullOrEmpty(faceInfoId, nameof(faceInfoId)); - - if (tag == null) - { - throw new ArgumentNullException(nameof(tag)); - } - - var handle = CommandHelper.SelectScalar(Interop.Face.ForeachFromDb, $"{FaceInfoColumns.Id}='{faceInfoId}'", - Interop.Face.Clone); - - if (handle == IntPtr.Zero) - { - return false; - } - - try - { - Interop.Face.SetTag(handle, tag).ThrowIfError("Failed to update(setting tag)"); - - Interop.Face.Update(handle).ThrowIfError("Failed to update(executing query)"); - return true; - } - finally - { - Interop.Face.Destroy(handle); - } - } - } -} diff --git a/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/Features.cs b/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/Features.cs deleted file mode 100755 index e0c2d23a0..000000000 --- a/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/Features.cs +++ /dev/null @@ -1,31 +0,0 @@ -/* - * 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 Tizen.System; - -static internal class Features -{ - internal const string FaceRecognition = "http://tizen.org/feature/vision.face_recognition"; - - internal static bool IsSupported(string key) - { - if (Information.TryGetValue(key, out bool value)) - { - return value; - } - return false; - } -} \ No newline at end of file diff --git a/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/Folder.cs b/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/Folder.cs deleted file mode 100644 index 3aed397e7..000000000 --- a/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/Folder.cs +++ /dev/null @@ -1,79 +0,0 @@ -/* -* 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.Content.MediaContent -{ - /// - /// Represents the folder information for the media. - /// - /// - /// The is used to organize media content files, i.e., image, audio, and video files, - /// in the physical storage of the device. - /// - public class Folder - { - internal Folder(IntPtr handle) - { - Id = InteropHelper.GetString(handle, Interop.Folder.GetFolderId); - Path = InteropHelper.GetString(handle, Interop.Folder.GetPath); - Name = InteropHelper.GetString(handle, Interop.Folder.GetName); - - StorageType = InteropHelper.GetValue(handle, Interop.Folder.GetStorageType); - StorageId = InteropHelper.GetString(handle, Interop.Folder.GetStorageId); - } - - internal static Folder FromHandle(IntPtr handle) => new Folder(handle); - - /// - /// Gets the ID of the folder. - /// - /// The unique ID of the folder. - public string Id { get; } - - /// - /// Gets the path of the folder. - /// - /// The path of the folder. - public string Path { get; } - - /// - /// Gets the name of the folder. - /// - /// The name of the folder. - public string Name { get; } - - /// - /// Gets the of the storage that the folder exists. - /// - /// The of the storage that the folder exists. - public StorageType StorageType { get; } - - /// - /// Gets the storage ID of the storage that the folder exists. - /// - /// The storage ID of the storage that the folder exists. - public string StorageId { get; } - - /// - /// Returns a string representation of the folder. - /// - /// A string representation of the current folder. - public override string ToString() => - $"Id={Id}, Name={Name}, Path={Path}, StorageType={StorageType}, StorageId={StorageType}"; - } -} diff --git a/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/FolderCommand.cs b/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/FolderCommand.cs deleted file mode 100644 index abfdd12e8..000000000 --- a/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/FolderCommand.cs +++ /dev/null @@ -1,193 +0,0 @@ -/* - * 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.Content.MediaContent -{ - /// - /// Provides commands to manage folders and query related media items in the database. - /// - public class FolderCommand : MediaCommand - { - /// - /// Initializes a new instance of the class with the specified . - /// - /// The that the commands run on. - /// is null. - /// has already been disposed of. - public FolderCommand(MediaDatabase database) : base(database) - { - } - - /// - /// Retrieves the number of folders. - /// - /// The number of folders. - /// The is disconnected. - /// The has already been disposed of. - /// An error occurred while executing the command. - public int Count() - { - return Count(null); - } - - /// - /// Retrieves the number of folders with the . - /// - /// The criteria to use to filter. This value can be null. - /// The number of folders. - /// The is disconnected. - /// The has already been disposed of. - /// An error occurred while executing the command. - public int Count(CountArguments arguments) - { - ValidateDatabase(); - - return CommandHelper.Count(Interop.Folder.GetFolderCountFromDb, arguments); - } - - /// - /// Retrieves the folders. - /// - /// The containing the results. - /// The is disconnected. - /// The has already been disposed of. - /// An error occurred while executing the command. - public MediaDataReader Select() - { - return Select(arguments: null); - } - - /// - /// Retrieves the folders with the . - /// - /// The criteria to use to filter. This value can be null. - /// The containing the results. - /// The is disconnected. - /// The has already been disposed of. - /// An error occurred while executing the command. - public MediaDataReader Select(SelectArguments arguments) - { - ValidateDatabase(); - - return CommandHelper.Select(arguments, Interop.Folder.ForeachFolderFromDb, Folder.FromHandle); - } - - /// - /// Retrieves the folder. - /// - /// The folder ID to query with. - /// The instance if the matched record was found in the database, otherwise null. - /// The is disconnected. - /// The has already been disposed of. - /// An error occurred while executing the command. - /// is null. - /// is a zero-length string, contains only white space. - public Folder Select(string folderId) - { - ValidateDatabase(); - - ValidationUtil.ValidateNotNullOrEmpty(folderId, nameof(folderId)); - - Interop.Folder.GetFolderFromDb(folderId, out var handle).ThrowIfError("Failed to query"); - - if (handle == IntPtr.Zero) - { - return null; - } - - try - { - return new Folder(handle); - } - finally - { - Interop.Folder.Destroy(handle); - } - } - - /// - /// Retrieves the number of media information under the folder. - /// - /// The ID of the folder to count media in the folder. - /// The number of media information. - /// The is disconnected. - /// The has already been disposed of. - /// An error occurred while executing the command. - /// is null. - /// is a zero-length string, contains only white space. - public int CountMedia(string folderId) - { - return CountMedia(folderId, null); - } - - /// - /// Retrieves the number of media information under the folder with the . - /// - /// The ID of the folder to count media in the folder. - /// The criteria to use to filter. This value can be null. - /// The number of media information. - /// The is disconnected. - /// The has already been disposed of. - /// An error occurred while executing the command. - /// is null. - /// is a zero-length string, contains only white space. - public int CountMedia(string folderId, CountArguments arguments) - { - ValidateDatabase(); - - ValidationUtil.ValidateNotNullOrEmpty(folderId, nameof(folderId)); - - return CommandHelper.Count(Interop.Folder.GetMediaCountFromDb, folderId, arguments); - } - - /// - /// Retrieves the media information under the folder. - /// - /// The ID of the folder to select media in the folder. - /// The containing the results. - /// The is disconnected. - /// The has already been disposed of. - /// An error occurred while executing the command. - /// is null. - /// is a zero-length string, contains only white space. - public MediaDataReader SelectMedia(string folderId) - { - return SelectMedia(folderId, null); - } - - /// - /// Retrieves the media information under the folder with the . - /// - /// The ID of the folder to select media in the folder. - /// The criteria to use to filter. This value can be null. - /// The containing the results. - /// The is disconnected. - /// The has already been disposed of. - /// An error occurred while executing the command. - /// is null. - /// is a zero-length string, contains only white space. - public MediaDataReader SelectMedia(string folderId, SelectArguments filter) - { - ValidateDatabase(); - - ValidationUtil.ValidateNotNullOrEmpty(folderId, nameof(folderId)); - - return CommandHelper.SelectMedia(Interop.Folder.ForeachMediaFromDb, folderId, filter); - } - } -} diff --git a/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/ImageInfo.cs b/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/ImageInfo.cs deleted file mode 100644 index 0a60625a2..000000000 --- a/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/ImageInfo.cs +++ /dev/null @@ -1,121 +0,0 @@ -/* - * 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.Diagnostics; - -namespace Tizen.Content.MediaContent -{ - /// - /// Represents the image media stored in the device. - /// - public class ImageInfo : MediaInfo - { - internal ImageInfo(Interop.MediaInfoHandle handle) : base(handle) - { - IntPtr imageHandle = IntPtr.Zero; - - try - { - Interop.MediaInfo.GetImage(handle, out imageHandle).ThrowIfError("Failed to retrieve data"); - - Debug.Assert(imageHandle != IntPtr.Zero); - - Width = InteropHelper.GetValue(imageHandle, Interop.ImageInfo.GetWidth); - Height = InteropHelper.GetValue(imageHandle, Interop.ImageInfo.GetHeight); - - Orientation = InteropHelper.GetValue(imageHandle, Interop.ImageInfo.GetOrientation); - - DateTaken = InteropHelper.GetString(imageHandle, Interop.ImageInfo.GetDateTaken); - BurstId = InteropHelper.GetString(imageHandle, Interop.ImageInfo.GetBurstId); - ExposureTime = InteropHelper.GetString(imageHandle, Interop.ImageInfo.GetExposureTime); - - FNumber = InteropHelper.GetValue(imageHandle, Interop.ImageInfo.GetFNumber); - Iso = InteropHelper.GetValue(imageHandle, Interop.ImageInfo.GetISO); - - Model = InteropHelper.GetString(imageHandle, Interop.ImageInfo.GetModel); - - IsBurstShot = InteropHelper.GetValue(imageHandle, Interop.ImageInfo.IsBurstShot); - - } - finally - { - Interop.ImageInfo.Destroy(imageHandle); - } - } - - /// - /// Gets the image width in pixels. - /// - /// The image width in pixels. - public int Width { get; } - - /// - /// Gets the image height in pixels. - /// - /// The image height in pixels. - public int Height { get; } - - /// - /// Gets the orientation of image. - /// - /// The orientation of image. - public Orientation Orientation { get; } - - /// - /// Gets the date of the creation time as a formatted string. - /// - /// The date of the creation time as a formatted string. - public string DateTaken { get; } - - /// - /// Gets the burst shot ID. - /// - /// The burst shot ID if it is a burst shot, otherwise an empty string. - /// - public string BurstId { get; } - - /// - /// Gets the exposure time from EXIF. - /// - /// The exposure time from EXIF. - public string ExposureTime { get; } - - /// - /// Gets the FNumber from EXIF. - /// - /// The FNumber from exif. - public double FNumber { get; } - - /// - /// Gets the ISO from EXIF. - /// - /// The iso from EXIF. - public int Iso { get; } - - /// - /// Gets the model from EXIF. - /// - /// The model from EXIF. - public string Model { get; } - - /// - /// Gets the value indicating whether the media is a burst shot image. - /// - /// true if the media is a burst shot image, otherwise false. - public bool IsBurstShot { get; } - } -} diff --git a/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/InteropHelper.cs b/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/InteropHelper.cs deleted file mode 100644 index e40b1f55a..000000000 --- a/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/InteropHelper.cs +++ /dev/null @@ -1,80 +0,0 @@ -/* - * 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; - -namespace Tizen.Content.MediaContent -{ - internal static class InteropHelper - { - internal delegate MediaContentError GetStringFunc(T handle, out IntPtr value); - - internal static string GetString(T handle, GetStringFunc func, bool nullable = false) - { - IntPtr val = IntPtr.Zero; - try - { - func(handle, out val).ThrowIfError("Failed to get value"); - - if (val == IntPtr.Zero) - { - return nullable ? null : string.Empty; - } - - return Marshal.PtrToStringAnsi(val); - } - finally - { - Interop.Libc.Free(val); - } - } - - internal delegate MediaContentError GetValueFunc(T handle, out TValue value); - - internal static TValue GetValue(T handle, GetValueFunc func) - { - func(handle, out var val).ThrowIfError("Failed to get value"); - - return val; - } - - internal static TValue GetValue(IntPtr handle, GetValueFunc func) - { - func(handle, out var val).ThrowIfError("Failed to get value"); - - return val; - } - - internal static TValue GetValue(Interop.MediaInfoHandle handle, - GetValueFunc func) - { - func(handle, out var val).ThrowIfError("Failed to get value"); - - return val; - } - - internal static DateTimeOffset GetDateTime(T handle, - GetValueFunc func) - { - IntPtr time = IntPtr.Zero; - - func(handle, out time).ThrowIfError("Failed to get value"); - - return DateTimeOffset.FromUnixTimeSeconds(time.ToInt64()); - } - } -} diff --git a/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/MediaCommand.cs b/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/MediaCommand.cs deleted file mode 100644 index 41e5e36b8..000000000 --- a/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/MediaCommand.cs +++ /dev/null @@ -1,143 +0,0 @@ -/* - * 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.Collections.Generic; - -namespace Tizen.Content.MediaContent -{ - /// - /// The is a base class for command classes. - /// - public abstract class MediaCommand - { - /// - /// Initializes a new instance of the class with the specified . - /// - /// The that the commands run on. - /// is null. - /// has already been disposed of. - protected MediaCommand(MediaDatabase database) - { - Database = database ?? throw new ArgumentNullException(nameof(database)); - - if (database.IsDisposed) - { - throw new ObjectDisposedException(nameof(database)); - } - } - - internal void ValidateDatabase() - { - Database.ValidateState(); - } - - /// - /// Gets the . - /// - /// The which commands execute on. - public MediaDatabase Database { get; } - } - - /// - /// Provides a means of reading results obtained by executing a query. - /// - public interface IMediaDataReader - { - /// - /// Advances to the next record. - /// - /// true if there are more rows; otherwise false. - bool Read(); - - /// - /// Gets the current record. - /// - /// The current record object. - object Current { get; } - } - - /// - /// Provides a means of reading results obtained by executing a query. - /// - /// - public class MediaDataReader : IMediaDataReader, IDisposable - { - private readonly IEnumerator _enumerator; - - internal MediaDataReader(IEnumerable items) - { - _enumerator = items.GetEnumerator(); - } - - /// - /// Gets the current record. - /// - /// The current record if the position is valid; otherwise null. - public TRecord Current - { - get - { - ValidateNotDisposed(); - return _enumerator.Current; - } - } - - /// - /// Advances to the next record. - /// - /// true if there are more rows; otherwise false. - public bool Read() - { - ValidateNotDisposed(); - return _enumerator.MoveNext(); - } - - object IMediaDataReader.Current => Current; - - #region IDisposable Support - private bool _disposed = false; - - /// - /// Disposes of the resources (other than memory) used by the MediaDataReader. - /// - /// true to release both managed and unmanaged resources; false to release only unmanaged resources. - protected virtual void Dispose(bool disposing) - { - if (!_disposed) - { - _disposed = true; - } - } - - /// - /// Releases all resources used by the current instance. - /// - public void Dispose() - { - Dispose(true); - } - - internal void ValidateNotDisposed() - { - if (_disposed) - { - throw new ObjectDisposedException(GetType().Name); - } - } - #endregion - } -} diff --git a/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/MediaContentError.cs b/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/MediaContentError.cs deleted file mode 100755 index 5e0cd5dbc..000000000 --- a/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/MediaContentError.cs +++ /dev/null @@ -1,93 +0,0 @@ -/* - * 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.Diagnostics; -using System.IO; -using System.Linq; -using Tizen.Internals.Errors; - -namespace Tizen.Content.MediaContent -{ - internal enum MediaContentError - { - None = ErrorCode.None, - InvalidParameter = ErrorCode.InvalidParameter, - OutOfMemory = ErrorCode.OutOfMemory, - InvalidOperation = ErrorCode.InvalidOperation, - FileNoSpaceOnDevice = ErrorCode.FileNoSpaceOnDevice, - PermissionDenied = ErrorCode.PermissionDenied, - TizenMediaContentError = -0x01610000, - DatabaseFailed = TizenMediaContentError | 0x01, - DatabaseBusy = TizenMediaContentError | 0x02, - NetworkFailed = TizenMediaContentError | 0x03, - UnsupportedContent = TizenMediaContentError | 0x04, - NotSupported = ErrorCode.NotSupported, - } - - internal static class MediaContentErrorExtensions - { - internal static MediaContentError Ignore(this MediaContentError err, params MediaContentError[] ignores) - { - if (ignores.Contains(err)) - { - return MediaContentError.None; - } - return err; - } - - - internal static void ThrowIfError(this MediaContentError err, string msg) - { - if (err == MediaContentError.None) - { - return; - } - - throw err.AsException(msg); - } - - internal static Exception AsException(this MediaContentError err, string msg) - { - Debug.Assert(err != MediaContentError.None); - - switch (err) - { - case MediaContentError.InvalidParameter: - return new ArgumentException($"{msg}."); - case MediaContentError.OutOfMemory: - return new OutOfMemoryException($"{msg}."); - case MediaContentError.InvalidOperation: - return new InvalidOperationException($"{msg}."); - case MediaContentError.FileNoSpaceOnDevice: - return new IOException($"{msg} : {err}."); - case MediaContentError.PermissionDenied: - return new UnauthorizedAccessException($"{msg}."); - case MediaContentError.DatabaseFailed: - return new MediaDatabaseException(MediaDatabaseError.OperationFailed); - case MediaContentError.DatabaseBusy: - return new MediaDatabaseException(MediaDatabaseError.DatabaseBusy); - case MediaContentError.NetworkFailed: - return new InvalidOperationException($"{msg} : {err}."); - case MediaContentError.UnsupportedContent: - return new UnsupportedContentException(); - - default: - return new InvalidOperationException($"Unknown Error : {err.ToString()}, {msg}."); - } - } - } -} diff --git a/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/MediaDatabase.cs b/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/MediaDatabase.cs deleted file mode 100644 index 847436459..000000000 --- a/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/MediaDatabase.cs +++ /dev/null @@ -1,472 +0,0 @@ -/* - * 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.Linq; -using System.Threading; -using System.Threading.Tasks; - -namespace Tizen.Content.MediaContent -{ - /// - /// Provides the ability to connect to and manage the database. - /// - public class MediaDatabase : IDisposable - { - /// - /// Initializes a new instance of the class. - /// - public MediaDatabase() - { - } - - private object _lock = new object(); - - /// - /// Connects to the database. - /// - /// The database is already connected. - /// The has already been disposed of. - /// An error occurred while connecting. - public void Connect() - { - ValidateNotDisposed(); - - lock (_lock) - { - if (IsConnected) - { - throw new InvalidOperationException("The database is already connected."); - } - - Interop.Content.Connect().ThrowIfError("Failed to connect"); - - IsConnected = true; - } - } - - /// - /// Disconnects from the media database. - /// - /// The database is not connected. - /// The has already been disposed of. - /// An error occurred while connecting. - public void Disconnect() - { - ValidateNotDisposed(); - - lock (_lock) - { - if (!IsConnected) - { - throw new InvalidOperationException("The database is not connected."); - } - - Interop.Content.Disconnect().ThrowIfError("Failed to disconnect"); - - IsConnected = false; - } - } - - private static readonly Interop.Content.MediaContentDBUpdatedCallback _mediaInfoUpdatedCb = ( - MediaContentError error, int pid, ItemType updateItem, OperationType updateType, - MediaType mediaType, string uuid, string filePath, string mimeType, IntPtr _) => - { - if (updateItem == ItemType.Directory) - { - return; - } - - _mediaInfoUpdated?.Invoke( - null, new MediaInfoUpdatedEventArgs(pid, updateType, mediaType, uuid, filePath, mimeType)); - }; - - private static IntPtr _mediaInfoUpdatedHandle = IntPtr.Zero; - private static event EventHandler _mediaInfoUpdated; - private static readonly object _mediaInfoUpdatedLock = new object(); - - /// - /// Occurs when there is a change for media in the database. - /// - public static event EventHandler MediaInfoUpdated - { - add - { - lock (_mediaInfoUpdatedLock) - { - if (_mediaInfoUpdated == null) - { - Interop.Content.AddDbUpdatedCb(_mediaInfoUpdatedCb, IntPtr.Zero, - out _mediaInfoUpdatedHandle).ThrowIfError("Failed to register an event handler"); - } - - _mediaInfoUpdated += value; - } - } - remove - { - if (value == null) - { - return; - } - - lock (_mediaInfoUpdatedLock) - { - if (_mediaInfoUpdated == value) - { - Interop.Content.RemoveDbUpdatedCb(_mediaInfoUpdatedHandle).ThrowIfError("Failed to unregister"); - } - - _mediaInfoUpdated -= value; - } - } - } - - - private static readonly Interop.Content.MediaContentDBUpdatedCallback _folderUpdatedCb = ( - MediaContentError error, int pid, ItemType updateItem, OperationType updateType, - MediaType mediaType, string uuid, string filePath, string mimeType, IntPtr _) => - { - if (updateItem == ItemType.File) - { - return; - } - - _folderUpdated?.Invoke(null, new FolderUpdatedEventArgs(updateType, uuid, filePath)); - }; - - private static IntPtr _folderUpdatedHandle = IntPtr.Zero; - private static event EventHandler _folderUpdated; - private static readonly object _folderUpdatedLock = new object(); - - /// - /// Occurs when there is a change for the folder in the database. - /// - public static event EventHandler FolderUpdated - { - add - { - lock (_folderUpdatedLock) - { - if (_folderUpdated == null) - { - Interop.Content.AddDbUpdatedCb(_folderUpdatedCb, IntPtr.Zero, - out _folderUpdatedHandle).ThrowIfError("Failed to register an event handler"); - } - - _folderUpdated += value; - } - } - remove - { - if (value == null) - { - return; - } - - lock (_folderUpdatedLock) - { - if (_folderUpdated == value) - { - Interop.Content.RemoveDbUpdatedCb(_folderUpdatedHandle).ThrowIfError("Failed to unregister"); - } - - _folderUpdated -= value; - } - } - } - - /// - /// Requests to scan a media file. - /// - /// The path of the media to be scanned. - /// - /// It requests to scan a media file to the media server.\n - /// If the specified file is not registered to the database yet, - /// the media file information will be added to the database.\n - /// If it is already registered to the database, the media information is refreshed.\n - /// If the specified file does not exist, - /// the record of the media file will be deleted from the database.\n - /// \n - /// If you want to access internal storage, you should add privilege http://tizen.org/privilege/mediastorage.\n - /// If you want to access external storage, you should add privilege http://tizen.org/privilege/externalstorage. - /// - /// http://tizen.org/privilege/content.write - /// http://tizen.org/privilege/mediastorage - /// http://tizen.org/privilege/externalstorage - /// The database is not connected. - /// The has already been disposed of. - /// is null. - /// - /// is a zero-length string, contains only white space.\n - /// -or-\n - /// contains a hidden path that starts with '.'.\n - /// -or-\n - /// contains a directory containing the ".scan_ignore" file. - /// - /// The caller has no required privilege. - public void ScanFile(string path) - { - ValidateState(); - - ValidationUtil.ValidateNotNullOrEmpty(path, nameof(path)); - - Interop.Content.ScanFile(path).Ignore(MediaContentError.InvalidParameter).ThrowIfError("Failed to scan"); - } - - /// - /// Requests to scan a folder recursively. - /// - /// - /// If you want to access internal storage, you should add privilege http://tizen.org/privilege/mediastorage.\n - /// If you want to access external storage, you should add privilege http://tizen.org/privilege/externalstorage. - /// - /// http://tizen.org/privilege/content.write - /// http://tizen.org/privilege/mediastorage - /// http://tizen.org/privilege/externalstorage - /// The path to scan. - /// Folders that contains a file named ".scan_ignore" will not be scanned. - /// A task that represents the asynchronous scan operation. - /// The database is not connected. - /// The has already been disposed of. - /// The caller has no required privilege. - /// is null. - /// - /// is a zero-length string, contains only white space.\n - /// -or-\n - /// contains a hidden path that starts with '.'.\n - /// -or-\n - /// contains a directory containing the ".scan_ignore" file. - /// - public Task ScanFolderAsync(string folderPath) - { - return ScanFolderAsync(folderPath, true); - } - - /// - /// Requests to scan a folder. - /// - /// - /// If you want to access internal storage, you should add privilege http://tizen.org/privilege/mediastorage.\n - /// If you want to access external storage, you should add privilege http://tizen.org/privilege/externalstorage. - /// - /// http://tizen.org/privilege/content.write - /// http://tizen.org/privilege/mediastorage - /// http://tizen.org/privilege/externalstorage - /// The path to scan. - /// The value indicating if the folder is to be recursively scanned. - /// Folders that contains a file named ".scan_ignore" will not be scanned. - /// A task that represents the asynchronous scan operation. - /// The database is not connected. - /// The has already been disposed of. - /// The caller has no required privilege. - /// is null. - /// - /// is a zero-length string, contains only white space.\n - /// -or-\n - /// contains a hidden path that starts with '.'.\n - /// -or-\n - /// contains a directory containing the ".scan_ignore" file. - /// - public Task ScanFolderAsync(string folderPath, bool recursive) - { - return ScanFolderAsync(folderPath, recursive, CancellationToken.None); - } - - /// - /// Requests to scan a folder recursively. - /// - /// - /// If you want to access internal storage, you should add privilege http://tizen.org/privilege/mediastorage.\n - /// If you want to access external storage, you should add privilege http://tizen.org/privilege/externalstorage. - /// - /// http://tizen.org/privilege/content.write - /// http://tizen.org/privilege/mediastorage - /// http://tizen.org/privilege/externalstorage - /// The path to scan. - /// The token to stop scanning. - /// Folders that contains a file named ".scan_ignore" will not be scanned. - /// A task that represents the asynchronous scan operation. - /// The database is not connected. - /// The has already been disposed of. - /// The caller has no required privilege. - /// is null. - /// - /// is a zero-length string, contains only white space.\n - /// -or-\n - /// contains a hidden path that starts with '.'.\n - /// -or-\n - /// contains a directory containing the ".scan_ignore" file. - /// - public Task ScanFolderAsync(string folderPath, CancellationToken cancellationToken) - { - return ScanFolderAsync(folderPath, true, cancellationToken); - } - - /// - /// Requests to scan a folder recursively. - /// - /// - /// If you want to access internal storage, you should add privilege http://tizen.org/privilege/mediastorage.\n - /// If you want to access external storage, you should add privilege http://tizen.org/privilege/externalstorage. - /// - /// http://tizen.org/privilege/content.write - /// http://tizen.org/privilege/mediastorage - /// http://tizen.org/privilege/externalstorage - /// The path to scan. - /// The value indicating if the folder is to be recursively scanned. - /// The token to stop scanning. - /// Folders that contains a file named ".scan_ignore" will not be scanned. - /// A task that represents the asynchronous scan operation. - /// The database is not connected. - /// The has already been disposed of. - /// The caller has no required privilege. - /// is null. - /// - /// is a zero-length string, contains only white space.\n - /// -or-\n - /// contains a hidden path that starts with '.'.\n - /// -or-\n - /// contains a directory containing the ".scan_ignore" file. - /// - public Task ScanFolderAsync(string folderPath, bool recursive, CancellationToken cancellationToken) - { - ValidateState(); - - ValidationUtil.ValidateNotNullOrEmpty(folderPath, nameof(folderPath)); - - return cancellationToken.IsCancellationRequested ? Task.FromCanceled(cancellationToken) : - ScanFolderAsyncCore(folderPath, recursive, cancellationToken); - } - - private async Task ScanFolderAsyncCore(string folderPath, bool recursive, CancellationToken cancellationToken) - { - var tcs = new TaskCompletionSource(); - - using (var cbKeeper = ObjectKeeper.Get(GetScanCompletedCallback(tcs, cancellationToken))) - using (RegisterCancellationAction(tcs, folderPath, cancellationToken)) - { - Interop.Content.ScanFolder(folderPath, recursive, cbKeeper.Target) - .ThrowIfError("Failed to scan"); - - await tcs.Task; - } - } - - private static Interop.Content.MediaScanCompletedCallback GetScanCompletedCallback(TaskCompletionSource tcs, - CancellationToken cancellationToken) - { - return (scanResult, _) => - { - if (scanResult == MediaContentError.None) - { - if (cancellationToken.IsCancellationRequested) - { - tcs.TrySetCanceled(); - } - else - { - tcs.TrySetResult(true); - } - } - else - { - tcs.TrySetException(scanResult.AsException("Failed to scan")); - } - }; - } - - private static IDisposable RegisterCancellationAction(TaskCompletionSource tcs, - string folderPath, CancellationToken cancellationToken) - { - if (cancellationToken.CanBeCanceled == false) - { - return null; - } - - return cancellationToken.Register(() => - { - if (tcs.Task.IsCompleted) - { - return; - } - - Interop.Content.CancelScanFolder(folderPath).ThrowIfError("Failed to cancel scanning"); - }); - } - - internal bool IsConnected { get; set; } - - internal void ValidateState() - { - ValidateNotDisposed(); - - if (IsConnected == false) - { - throw new InvalidOperationException("Database is not connected."); - } - } - - private void ValidateNotDisposed() - { - if (IsDisposed) - { - throw new ObjectDisposedException(nameof(MediaDatabase)); - } - } - - #region IDisposable Support - private bool _disposed = false; - - /// - /// Disposes of the resources (other than memory) used by the MediaDatabase. - /// - /// true to release both managed and unmanaged resources; false to release only unmanaged resources. - protected virtual void Dispose(bool disposing) - { - if (!_disposed) - { - if (IsConnected) - { - var disconnectResult = Interop.Content.Disconnect(); - - if (disconnectResult != MediaContentError.None) - { - Log.Warn(nameof(MediaDatabase), $"Failed to disconnect {disconnectResult.ToString()}."); - } - } - - _disposed = true; - } - } - - /// - /// Releases all the resources. - /// - public void Dispose() - { - Dispose(true); - } - - /// - /// Gets the value indicating whether the database has been disposed of. - /// - /// true if the database has been disposed of; otherwise, false. - public bool IsDisposed => _disposed; - #endregion - - } -} diff --git a/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/MediaDatabaseException.cs b/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/MediaDatabaseException.cs deleted file mode 100644 index c94a5fe1d..000000000 --- a/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/MediaDatabaseException.cs +++ /dev/null @@ -1,62 +0,0 @@ -/* - * 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.Content.MediaContent -{ - /// - /// Specifies the database errors. - /// - public enum MediaDatabaseError - { - /// - /// Operation failed. - /// - OperationFailed, - - /// - /// Operation failed because the database is busy. - /// - DatabaseBusy - } - - /// - /// The exception that is thrown when a database operation failed. - /// - public class MediaDatabaseException : Exception - { - internal MediaDatabaseException(MediaDatabaseError error) : this(error, error.ToString()) - { - } - - internal MediaDatabaseException(MediaDatabaseError error, string message) : this(error, message, null) - { - } - - internal MediaDatabaseException(MediaDatabaseError error, string message, Exception innerException) : - base(message, innerException) - { - Error = error; - } - - /// - /// Gets the error that causes the exception. - /// - /// The that causes the exception. - public MediaDatabaseError Error { get; } - } -} diff --git a/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/MediaInfo.cs b/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/MediaInfo.cs deleted file mode 100644 index b83a6c696..000000000 --- a/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/MediaInfo.cs +++ /dev/null @@ -1,264 +0,0 @@ -/* - * 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.Content.MediaContent -{ - - /// - /// Represents the information related to the media stored. - /// - /// - /// - public class MediaInfo - { - internal MediaInfo(Interop.MediaInfoHandle handle) - { - Id = InteropHelper.GetString(handle, Interop.MediaInfo.GetMediaId); - - Path = InteropHelper.GetString(handle, Interop.MediaInfo.GetFilePath); - DisplayName = InteropHelper.GetString(handle, Interop.MediaInfo.GetDisplayName); - - MediaType = InteropHelper.GetValue(handle, Interop.MediaInfo.GetMediaType); - - MimeType = InteropHelper.GetString(handle, Interop.MediaInfo.GetMimeType); - - FileSize = InteropHelper.GetValue(handle, Interop.MediaInfo.GetSize); - - DateAdded = InteropHelper.GetDateTime(handle, Interop.MediaInfo.GetAddedTime); - DateModified = InteropHelper.GetDateTime(handle, Interop.MediaInfo.GetModifiedTime); - Timeline = InteropHelper.GetDateTime(handle, Interop.MediaInfo.GetTimeline); - - ThumbnailPath = InteropHelper.GetString(handle, Interop.MediaInfo.GetThumbnailPath, true); - Description = InteropHelper.GetString(handle, Interop.MediaInfo.GetDescription); - - Longitude = InteropHelper.GetValue(handle, Interop.MediaInfo.GetLongitude); - Latitude = InteropHelper.GetValue(handle, Interop.MediaInfo.GetLatitude); - Altitude = InteropHelper.GetValue(handle, Interop.MediaInfo.GetAltitude); - - Weather = InteropHelper.GetString(handle, Interop.MediaInfo.GetWeather); - Rating = InteropHelper.GetValue(handle, Interop.MediaInfo.GetRating); - IsFavorite = InteropHelper.GetValue(handle, Interop.MediaInfo.GetFavorite); - Provider = InteropHelper.GetString(handle, Interop.MediaInfo.GetProvider); - Title = InteropHelper.GetString(handle, Interop.MediaInfo.GetTitle); - Category = InteropHelper.GetString(handle, Interop.MediaInfo.GetCategory); - LocationTag = InteropHelper.GetString(handle, Interop.MediaInfo.GetLocationTag); - AgeRating = InteropHelper.GetString(handle, Interop.MediaInfo.GetAgeRating); - StorageId = InteropHelper.GetString(handle, Interop.MediaInfo.GetStorageId); - IsDrm = InteropHelper.GetValue(handle, Interop.MediaInfo.IsDrm); - - StorageType = InteropHelper.GetValue(handle, Interop.MediaInfo.GetStorageType); - } - - /// - /// Gets the ID of media. - /// - /// The unique ID of media. - public string Id { get; } - - /// - /// Gets the path to media. - /// - /// The full path of the media file. - public string Path { get; } - - /// - /// Gets the name of media. - /// - /// The base name of the media file. - public string DisplayName { get; } - - /// - /// Gets the of media. - /// - /// The of media. - public MediaType MediaType { get; } - - /// - /// Gets the mime type from media. - /// - /// The mime type of media. - public string MimeType { get; } - - /// - /// Gets the file size of media in bytes. - /// - /// The file size of media in bytes. - public long FileSize { get; } - - /// - /// Gets the date of addition of media. - /// - /// The date of addition of media. - public DateTimeOffset DateAdded { get; } - - /// - /// Gets the date of modification of media. - /// - /// The date of modification of media. - public DateTimeOffset DateModified { get; } - - /// - /// Gets the timeline of media. - /// - /// - /// The creation date if the file has the creation information (like recorded date or image creation date), - /// otherwise the modified date. - /// - public DateTimeOffset Timeline { get; } - - /// - /// Gets the thumbnail of media. - /// - /// The thumbnail path of media. - public string ThumbnailPath { get; } - - /// - /// Gets the description of media. - /// - /// The description from the metadata. - public string Description { get; } - - /// - /// Gets the longitude of media. - /// - /// The longitude. - public double Longitude { get; } - - /// - /// Gets the latitude of media. - /// - /// The latitude. - public double Latitude { get; } - - /// - /// Gets the altitude of media. - /// - /// The altitude. - public double Altitude { get; } - - /// - /// Gets the weather information of media. - /// - /// The weather information which a user sets. - public string Weather { get; } - - /// - /// Gets the rating of media. - /// - /// The rating from the metadata. - public int Rating { get; } - - /// - /// Gets the favorite status of media. - /// - /// true if media is set as favorite, otherwise false. - public bool IsFavorite { get; } - - /// - /// Gets the provider of media. - /// - /// The provider which a user sets. - public string Provider { get; } - - /// - /// Gets the title of media. - /// - /// The title of media. - public string Title { get; } - - /// - /// Gets the category of media. - /// - /// The category which a user sets. - public string Category { get; } - - /// - /// Gets the location tag of media. - /// - /// The location tag which a user sets. - public string LocationTag { get; } - - /// - /// Gets the age rating of media. - /// - /// The age rating which a user sets. - public string AgeRating { get; } - - /// - /// Gets the storage ID of the storage that the media is stored on. - /// - /// The storage ID of the storage that the media is stored on. - public string StorageId { get; } - - /// - /// Gets the value indicating whether the media is DRM-protected. - /// - /// A bool value indicating whether the media is DRM-protected. - public bool IsDrm { get; } - - /// - /// Gets the storage type of the storage that the media is stored on. - /// - /// The storage type of the storage that the media is stored on. - public StorageType StorageType { get; } - - /// - /// Returns a string representation of the media information. - /// - /// A string representation of the current media information. - public override string ToString() => $"Id={Id}, Path={Path}, MediaType={MediaType}"; - - internal static MediaInfo FromHandle(Interop.MediaInfoHandle handle) - { - if (handle == null || handle.IsInvalid) - { - return null; - } - - var type = InteropHelper.GetValue(handle, Interop.MediaInfo.GetMediaType); - - switch (type) - { - case MediaType.Image: - return new ImageInfo(handle); - - case MediaType.Music: - case MediaType.Sound: - return new AudioInfo(handle); - - case MediaType.Video: - return new VideoInfo(handle); - } - - return new MediaInfo(handle); - } - - internal static MediaInfo FromHandle(IntPtr handle) - { - var safeHandle = new Interop.MediaInfoHandle(handle); - try - { - return FromHandle(safeHandle); - } - finally - { - safeHandle.SetHandleAsInvalid(); - } - } - } -} diff --git a/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/MediaInfoColumnKey.cs b/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/MediaInfoColumnKey.cs deleted file mode 100644 index 12f536450..000000000 --- a/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/MediaInfoColumnKey.cs +++ /dev/null @@ -1,131 +0,0 @@ -/* - * 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. - */ - -namespace Tizen.Content.MediaContent -{ - /// - /// Specifies the group keys for . - /// - public enum MediaInfoColumnKey - { - /// - /// Display name. - /// - DisplayName, - /// - /// Media type. - /// - Type, - /// - /// Mime type. - /// - MimeType, - /// - /// File size. - /// - Size, - /// - /// Date added. - /// - DateAdded, - /// - /// Date modified. - /// - DateModified, - /// - /// Content title. - /// - Title, - /// - /// Artist. - /// - Artist, - /// - /// Album artist. - /// - AlbumArtist, - /// - /// Genre. - /// - Genre, - /// - /// Composer. - /// - Composer = 10, - /// - /// Year. - /// - Year, - /// - /// Date recorded. - /// - DateRecorded, - /// - /// Copyright. - /// - Copyright, - /// - /// Track number. - /// - TrackNumber, - /// - /// Description. - /// - Description, - /// - /// Longitude. - /// - Longitude, - /// - /// Latitude. - /// - Latitude, - /// - /// Altitude. - /// - Altitude, - /// - /// Burst shot. - /// - BurstImage, - /// - /// Rating. - /// - Rating = 20, - - /// - /// Provider. - /// - Provider = 22, - - /// - /// Category. - /// - Category = 24, - /// - /// Location tag. - /// - LocationTag, - /// - /// Age rating. - /// - AgeRating, - /// - /// Weather. - /// - Weather = 28 - } -} diff --git a/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/MediaInfoCommand.cs b/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/MediaInfoCommand.cs deleted file mode 100644 index 7eb2be43c..000000000 --- a/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/MediaInfoCommand.cs +++ /dev/null @@ -1,1129 +0,0 @@ -/* - * 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.Collections.Generic; -using System.IO; -using System.Linq; -using System.Threading; -using System.Threading.Tasks; - -namespace Tizen.Content.MediaContent -{ - /// - /// Provides commands to manage the media information and query related items in the database. - /// - public class MediaInfoCommand : MediaCommand - { - /// - /// Initializes a new instance of the class with the specified . - /// - /// The that the commands run on. - /// is null. - /// has already been disposed of. - public MediaInfoCommand(MediaDatabase database) : base(database) - { - } - - /// - /// Retrieves the number of the bookmarks added to the media. - /// - /// The media ID to count the bookmarks added to the media. - /// The number of the bookmarks. - /// The is disconnected. - /// The has already been disposed of. - /// An error occurred while executing the command. - /// is null. - /// is a zero-length string, contains only white space. - public int CountBookmark(string mediaId) - { - return CountBookmark(mediaId, null); - } - - /// - /// Retrieves the number of the bookmarks added to the media with the . - /// - /// The media ID to count the bookmarks added to the media. - /// The criteria to use to filter. This value can be null. - /// The number of the bookmarks. - /// The is disconnected. - /// The has already been disposed of. - /// An error occurred while executing the command. - /// is null. - /// is a zero-length string, contains only white space. - public int CountBookmark(string mediaId, CountArguments arguments) - { - ValidateDatabase(); - - ValidationUtil.ValidateNotNullOrEmpty(mediaId, nameof(mediaId)); - - return CommandHelper.Count(Interop.MediaInfo.GetBookmarkCount, mediaId, arguments); - } - - /// - /// Retrieves the bookmarks added to the media. - /// - /// The media ID to select the bookmarks added to the media. - /// The containing the results. - /// The is disconnected. - /// The has already been disposed of. - /// An error occurred while executing the command. - /// is null. - /// is a zero-length string, contains only white space. - public MediaDataReader SelectBookmark(string mediaId) - { - return SelectBookmark(mediaId, null); - } - - /// - /// Retrieves the bookmarks added to the media with the . - /// - /// The media ID to select the bookmarks added to the media. - /// The criteria to use to filter. This value can be null. - /// The containing the results. - /// The is disconnected. - /// The has already been disposed of. - /// An error occurred while executing the command. - /// is null. - /// is a zero-length string, contains only white space. - public MediaDataReader SelectBookmark(string mediaId, SelectArguments filter) - { - ValidateDatabase(); - - ValidationUtil.ValidateNotNullOrEmpty(mediaId, nameof(mediaId)); - - return CommandHelper.SelectMembers(mediaId, filter, Interop.MediaInfo.ForeachBookmarks, - Bookmark.FromHandle); - } - - - /// - /// Retrieves the number of the face information added to or detected from the media. - /// - /// The media ID to count face information added to the media. - /// The number of the face information. - /// The is disconnected. - /// The has already been disposed of. - /// An error occurred while executing the command. - /// is null. - /// is a zero-length string, contains only white space. - public int CountFaceInfo(string mediaId) - { - return CountFaceInfo(mediaId, null); - } - - /// - /// Retrieves the number of the face information added to or detected from the media with filter. - /// - /// The media ID to count the face information added to the media. - /// The criteria to use to filter. This value can be null. - /// The number of the face information. - /// The is disconnected. - /// The has already been disposed of. - /// An error occurred while executing the command. - /// is null. - /// is a zero-length string, contains only white space. - public int CountFaceInfo(string mediaId, CountArguments arguments) - { - ValidateDatabase(); - - ValidationUtil.ValidateNotNullOrEmpty(mediaId, nameof(mediaId)); - - return CommandHelper.Count(Interop.MediaInfo.GetFaceCount, mediaId, arguments); - } - - /// - /// Retrieves the face information added to or detected from the media. - /// - /// The media ID to select face information added to the media. - /// The containing the results. - /// The is disconnected. - /// The has already been disposed of. - /// An error occurred while executing the command. - /// is null. - /// is a zero-length string, contains only white space. - public MediaDataReader SelectFaceInfo(string mediaId) - { - return SelectFaceInfo(mediaId, null); - } - - /// - /// Retrieves the face information added to or detected from the media with the . - /// - /// The media ID to select the face information added to the media. - /// The criteria to use to filter. This value can be null. - /// The containing the results. - /// The is disconnected. - /// The has already been disposed of. - /// An error occurred while executing the command. - /// is null. - /// is a zero-length string, contains only white space. - public MediaDataReader SelectFaceInfo(string mediaId, SelectArguments arguments) - { - ValidateDatabase(); - - ValidationUtil.ValidateNotNullOrEmpty(mediaId, nameof(mediaId)); - - return CommandHelper.SelectMembers(mediaId, arguments, Interop.MediaInfo.ForeachFaces, - FaceInfo.FromHandle); - } - - /// - /// Retrieves the number of tags that the media has. - /// - /// The number of tags. - /// The media ID to count tags added to the media. - /// The is disconnected. - /// The has already been disposed of. - /// An error occurred while executing the command. - /// is null. - /// is a zero-length string, contains only white space. - public int CountTag(string mediaId) - { - return CountTag(mediaId, null); - } - - /// - /// Retrieves the number of tags that the media has with the . - /// - /// The media ID to count tags added to the media. - /// The criteria to use to filter. This value can be null. - /// The number of tags. - /// The is disconnected. - /// The has already been disposed of. - /// An error occurred while executing the command. - /// is null. - /// is a zero-length string, contains only white space. - public int CountTag(string mediaId, CountArguments arguments) - { - ValidateDatabase(); - - ValidationUtil.ValidateNotNullOrEmpty(mediaId, nameof(mediaId)); - - return CommandHelper.Count(Interop.MediaInfo.GetTagCount, mediaId, arguments); - } - - /// - /// Retrieves the tags that the media has. - /// - /// The media ID to select tags added to the media. - /// The containing the results. - /// The is disconnected. - /// The has already been disposed of. - /// An error occurred while executing the command. - /// is null. - /// is a zero-length string, contains only white space. - public MediaDataReader SelectTag(string mediaId) - { - return SelectTag(mediaId, null); - } - - /// - /// Retrieves the tags that the media has with the . - /// - /// The media ID to select tags added to the media. - /// The criteria to use to filter. This value can be null. - /// The containing the results. - /// The is disconnected. - /// The has already been disposed of. - /// An error occurred while executing the command. - /// is null. - /// is a zero-length string, contains only white space. - public MediaDataReader SelectTag(string mediaId, SelectArguments filter) - { - ValidateDatabase(); - - ValidationUtil.ValidateNotNullOrEmpty(mediaId, nameof(mediaId)); - - return CommandHelper.SelectMembers(mediaId, filter, Interop.MediaInfo.ForeachTags, - Tag.FromHandle); - } - - - /// - /// Retrieves the number of the media information. - /// - /// The number of the media information. - /// The is disconnected. - /// The has already been disposed of. - /// An error occurred while executing the command. - public int CountMedia() - { - return CountMedia(null); - } - - /// - /// Retrieves the number of the media information with the . - /// - /// The criteria to use to filter. This value can be null. - /// The number of media information. - /// The is disconnected. - /// The has already been disposed of. - /// An error occurred while executing the command. - public int CountMedia(CountArguments arguments) - { - ValidateDatabase(); - - return CommandHelper.Count(Interop.MediaInfo.GetMediaCount, arguments); - } - - /// - /// Retrieves the media. - /// - /// The media ID to retrieve. - /// The instance if the matched record was found in the database, otherwise null. - /// The is disconnected. - /// The has already been disposed of. - /// An error occurred while executing the command. - /// is null. - /// is a zero-length string, contains only white space. - public MediaInfo SelectMedia(string mediaId) - { - ValidateDatabase(); - - ValidationUtil.ValidateNotNullOrEmpty(mediaId, nameof(mediaId)); - - Interop.MediaInfo.GetMediaFromDB(mediaId, out var handle).Ignore(MediaContentError.InvalidParameter). - ThrowIfError("Failed to query"); - - try - { - return MediaInfo.FromHandle(handle); - } - finally - { - handle.Dispose(); - } - } - - /// - /// Retrieves the number of values grouped by the specified column with the . - /// - /// The column key. - /// The number of groups. - /// The is disconnected. - /// The has already been disposed of. - /// An error occurred while executing the command. - /// is invalid. - public int CountGroupBy(MediaInfoColumnKey columnKey) - { - return CountGroupBy(columnKey, null); - } - - /// - /// Retrieves the number of values grouped by the specified column with the . - /// - /// The column key. - /// The criteria to use to filter. This value can be null. - /// The number of groups. - /// The is disconnected. - /// The has already been disposed of. - /// An error occurred while executing the command. - /// is invalid. - public int CountGroupBy(MediaInfoColumnKey columnKey, CountArguments arguments) - { - ValidateDatabase(); - - ValidationUtil.ValidateEnum(typeof(MediaInfoColumnKey), columnKey, nameof(columnKey)); - - using (var filter = QueryArguments.ToNativeHandle(arguments)) - { - Interop.Group.GetGroupCount(filter, columnKey, out var count).ThrowIfError("Failed to query count"); - return count; - } - } - - /// - /// Retrieves the group values of the specified column. - /// - /// The column key. - /// The containing the results. - /// The is disconnected. - /// The has already been disposed of. - /// An error occurred while executing the command. - /// is invalid. - public MediaDataReader SelectGroupBy(MediaInfoColumnKey columnKey) - { - return SelectGroupBy(columnKey, null); - } - - /// - /// Retrieves the group values of the specified column with the . - /// - /// The column key. - /// The criteria to use to filter. This value can be null. - /// The containing the results. - /// The is disconnected. - /// The has already been disposed of. - /// An error occurred while executing the command. - /// is invalid. - public MediaDataReader SelectGroupBy(MediaInfoColumnKey columnKey, SelectArguments arguments) - { - ValidateDatabase(); - - ValidationUtil.ValidateEnum(typeof(MediaInfoColumnKey), columnKey, nameof(columnKey)); - - List list = new List(); - - using (var filter = QueryArguments.ToNativeHandle(arguments)) - { - Interop.Group.ForeachGroup(filter, columnKey, (name, _) => - { - list.Add(name); - - return true; - }).ThrowIfError("Failed to query"); - - return new MediaDataReader(list); - } - } - - /// - /// Retrieves all the media. - /// - /// The containing the results. - /// The is disconnected. - /// The has already been disposed of. - /// An error occurred while executing the command. - public MediaDataReader SelectMedia() - { - return SelectMedia(arguments: null); - } - - /// - /// Retrieves the media with the . - /// - /// The criteria to use to filter. This value can be null. - /// The containing the results. - /// The is disconnected. - /// The has already been disposed of. - /// An error occurred while executing the command. - public MediaDataReader SelectMedia(SelectArguments arguments) - { - ValidateDatabase(); - - return new MediaDataReader(QueryMedia(arguments)); - } - - private static List QueryMedia(SelectArguments arguments) - { - using (var filter = QueryArguments.ToNativeHandle(arguments)) - { - List list = new List(); - - Exception caught = null; - - Interop.MediaInfo.ForeachMedia(filter, (handle, _) => - { - try - { - list.Add(MediaInfo.FromHandle(handle)); - return true; - } - catch (Exception e) - { - caught = e; - return false; - } - }); - - if (caught != null) - { - throw caught; - } - - return list; - } - } - - /// - /// Deletes the media from the database. - /// - /// http://tizen.org/privilege/content.write - /// The media ID to delete. - /// true if the matched record was found and deleted, otherwise false. - /// The or the can be used instead. - /// The is disconnected. - /// The has already been disposed of. - /// An error occurred while executing the command. - /// is null. - /// is a zero-length string, contains only white space. - /// The caller has no required privilege. - public bool Delete(string mediaId) - { - ValidateDatabase(); - - ValidationUtil.ValidateNotNullOrEmpty(mediaId, nameof(mediaId)); - - if (CommandHelper.Count( - Interop.MediaInfo.GetMediaCount, $"{MediaInfoColumns.Id}='{mediaId}'") == 0) - { - return false; - } - - CommandHelper.Delete(Interop.MediaInfo.Delete, mediaId); - return true; - } - - /// - /// Adds the media to the database. - /// - /// The file path to add. - /// The instance that contains the record information in the database. - /// - /// If the media already exists in the database, it returns the existing information.\n - /// \n - /// The or the can be used instead.\n - /// \n - /// If you want to access internal storage, you should add privilege http://tizen.org/privilege/mediastorage.\n - /// If you want to access external storage, you should add privilege http://tizen.org/privilege/externalstorage. - /// - /// http://tizen.org/privilege/content.write - /// http://tizen.org/privilege/mediastorage - /// http://tizen.org/privilege/externalstorage - /// The is disconnected. - /// The has already been disposed of. - /// An error occurred while executing the command. - /// is null. - /// - /// is a zero-length string, contains only white space.\n - /// -or-\n - /// contains a hidden path that starts with '.'.\n - /// -or-\n - /// contains a directory containing the ".scan_ignore" file. - /// - /// does not exists. - /// The caller has no required privilege. - public MediaInfo Add(string path) - { - ValidateDatabase(); - - ValidationUtil.ValidateNotNullOrEmpty(path, nameof(path)); - - if (File.Exists(path) == false) - { - throw new FileNotFoundException("destination is not valid path.", path); - } - - if (File.GetAttributes(path).HasFlag(FileAttributes.Hidden)) - { - throw new ArgumentException($"{nameof(path)} contains a hidden path.", nameof(path)); - } - - Interop.MediaInfoHandle handle = null; - - try - { - Interop.MediaInfo.Insert(path, out handle).ThrowIfError("Failed to insert"); - - return MediaInfo.FromHandle(handle); - } - finally - { - if (handle != null) - { - handle.Dispose(); - } - } - } - - private static void ValidatePaths(IEnumerable paths) - { - if (paths == null) - { - throw new ArgumentNullException(nameof(paths)); - } - - if (paths.Count() > 300) - { - throw new ArgumentException("Too many paths to add."); - } - - foreach (var path in paths) - { - if (path == null) - { - throw new ArgumentException($"{nameof(paths)} contains null.", nameof(paths)); - } - - if (File.Exists(path) == false) - { - throw new FileNotFoundException($"{nameof(paths)} contains a path that does not exist. Path={path}.", path); - } - } - - } - - /// - /// Adds media files into the media database. - /// - /// - /// The paths that already exist in the database will be ignored.\n - /// At most 300 items can be added at once.\n - /// \n - /// If you want to access internal storage, you should add privilege http://tizen.org/privilege/mediastorage.\n - /// If you want to access external storage, you should add privilege http://tizen.org/privilege/externalstorage. - /// - /// http://tizen.org/privilege/content.write - /// http://tizen.org/privilege/mediastorage - /// http://tizen.org/privilege/externalstorage - /// The paths of the media files to add. - /// A task that represents the asynchronous add operation. - /// The is disconnected. - /// The has already been disposed of. - /// An error occurred while executing the command. - /// is null. - /// - /// contains null.\n - /// -or-\n - /// contains the invalid path.\n - /// -or-\n - /// The number of is 300 or more items. - /// - /// contains a path that does not exist. - /// The caller has no required privilege. - public async Task AddAsync(IEnumerable paths) - { - ValidateDatabase(); - - ValidatePaths(paths); - - var pathArray = paths.ToArray(); - var tcs = new TaskCompletionSource(); - - Interop.MediaInfo.InsertCompletedCallback callback = (error, _) => - { - if (error == MediaContentError.None) - { - tcs.TrySetResult(true); - } - else - { - tcs.TrySetException(error.AsException("Failed to add")); - } - }; - - using (ObjectKeeper.Get(callback)) - { - Interop.MediaInfo.BatchInsert(pathArray, pathArray.Length, callback).ThrowIfError("Failed to add"); - - await tcs.Task; - } - } - - /// - /// Adds burst shot images into the media database. - /// - /// The paths of the burst shot images to add. - /// A task that represents the asynchronous add operation. - /// - /// The paths that already exist in the database.\n - /// At most 300 items can be added at once. - /// \n - /// If you want to access internal storage, you should add privilege http://tizen.org/privilege/mediastorage.\n - /// If you want to access external storage, you should add privilege http://tizen.org/privilege/externalstorage. - /// - /// http://tizen.org/privilege/content.write - /// http://tizen.org/privilege/mediastorage - /// http://tizen.org/privilege/externalstorage - /// The is disconnected. - /// The has already been disposed of. - /// An error occurred while executing the command. - /// is null. - /// - /// contains null.\n - /// -or-\n - /// contains the invalid path.\n - /// -or-\n - /// The number of is 300 or more items. - /// - /// contains a path that does not exist. - /// The caller has no required privilege. - public async Task AddBurstShotImagesAsync(IEnumerable paths) - { - ValidateDatabase(); - - ValidatePaths(paths); - - var tcs = new TaskCompletionSource(); - string[] pathArray = paths.ToArray(); - - Interop.MediaInfo.InsertBurstShotCompletedCallback callback = (error, _) => - { - if (error == MediaContentError.None) - { - tcs.TrySetResult(true); - } - else - { - tcs.TrySetException(error.AsException("Failed to add burst shot images")); - } - }; - - using (ObjectKeeper.Get(callback)) - { - Interop.MediaInfo.BurstShotInsert(pathArray, pathArray.Length, callback). - ThrowIfError("Failed to add burst shots to db"); - - await tcs.Task; - } - } - - private static void SetUpdateValue(Interop.MediaInfoHandle handle, T value, - Func func) - { - if (value != null) - { - func(handle, value).ThrowIfError("Failed to update"); - } - } - - - private static void SetUpdateValue(Interop.MediaInfoHandle handle, Nullable value, - Func func) where T : struct - { - if (value.HasValue) - { - func(handle, value.Value).ThrowIfError("Failed to update"); - } - } - - /// - /// Updates the media with the specified values. - /// - /// http://tizen.org/privilege/content.write - /// The media ID to update. - /// The values for update. - /// true if the matched record was found and updated, otherwise false. - /// Only values set in the are updated. - /// The is disconnected. - /// The has already been disposed of. - /// An error occurred while executing the command. - /// - /// is null.\n - /// -or-\n - /// is null. - /// - /// is a zero-length string, contains only white space. - /// The caller has no required privilege. - public bool Update(string mediaId, MediaInfoUpdateValues values) - { - ValidateDatabase(); - - ValidationUtil.ValidateNotNullOrEmpty(mediaId, nameof(mediaId)); - - if (values == null) - { - throw new ArgumentNullException(nameof(values)); - } - - if (CommandHelper.Count( - Interop.MediaInfo.GetMediaCount, $"{MediaInfoColumns.Id}='{mediaId}'") == 0) - { - return false; - } - - Interop.MediaInfo.GetMediaFromDB(mediaId, out var handle).ThrowIfError("Failed to update"); - - if (handle.IsInvalid) - { - return false; - } - - try - { - SetUpdateValue(handle, values.Weather, Interop.MediaInfo.SetWeather); - SetUpdateValue(handle, values.IsFavorite, Interop.MediaInfo.SetFavorite); - SetUpdateValue(handle, values.Provider, Interop.MediaInfo.SetProvider); - SetUpdateValue(handle, values.Category, Interop.MediaInfo.SetCategory); - SetUpdateValue(handle, values.LocationTag, Interop.MediaInfo.SetLocationTag); - SetUpdateValue(handle, values.AgeRating, Interop.MediaInfo.SetAgeRating); - - Interop.MediaInfo.UpdateToDB(handle).ThrowIfError("Failed to update"); - return true; - } - finally - { - handle.Dispose(); - } - } - - /// - /// Updates the path of the media to the specified destination path in the database. - /// - /// http://tizen.org/privilege/content.write - /// http://tizen.org/privilege/mediastorage - /// http://tizen.org/privilege/externalstorage - /// The media ID to move. - /// The path that the media has been moved to. - /// true if the matched record was found and updated, otherwise false. - /// - /// Usually, it is used after the media file is moved to the another path.\n - /// \n - /// If you want to access internal storage, you should add privilege http://tizen.org/privilege/mediastorage.\n - /// If you want to access external storage, you should add privilege http://tizen.org/privilege/externalstorage. - /// - /// The is disconnected. - /// The has already been disposed of. - /// An error occurred while executing the command. - /// - /// is null.\n - /// -or-\n - /// is null. - /// - /// - /// is a zero-length string, contains only white space.\n - /// -or-\n - /// is a zero-length string, contains only white space.\n - /// -or-\n - /// contains a hidden directory that starts with '.'.\n - /// -or-\n - /// contains a directory containing the ".scan_ignore" file. - /// - /// does not exists. - /// The caller has no required privilege. - public bool Move(string mediaId, string newPath) - { - ValidateDatabase(); - - ValidationUtil.ValidateNotNullOrEmpty(mediaId, nameof(mediaId)); - - ValidationUtil.ValidateNotNullOrEmpty(newPath, nameof(newPath)); - - if (File.Exists(newPath) == false) - { - throw new FileNotFoundException("destination is not valid path.", newPath); - } - - if (File.GetAttributes(newPath).HasFlag(FileAttributes.Hidden)) - { - throw new ArgumentException($"{nameof(newPath)} contains a hidden path.", nameof(newPath)); - } - - //TODO can be improved if MoveToDB supports result value. - Interop.MediaInfo.GetMediaFromDB(mediaId, out var handle). - Ignore(MediaContentError.InvalidParameter).ThrowIfError("Failed to move"); - - if (handle.IsInvalid) - { - return false; - } - - try - { - Interop.MediaInfo.MoveToDB(handle, newPath).ThrowIfError("Failed to move"); - } - finally - { - handle.Dispose(); - } - - return true; - } - - #region CreateThumbnailAsync - /// - /// Creates the thumbnail image for the given media. - /// If the thumbnail already exists for the given media, the existing path will be returned. - /// - /// http://tizen.org/privilege/content.write - /// The media ID to create the thumbnail. - /// A task that represents the asynchronous operation. The task result contains the thumbnail path. - /// - /// The is disconnected.\n - /// -or-\n - /// An internal error occurred while executing. - /// - /// The has already been disposed of. - /// An error occurred while executing the command. - /// is null. - /// does not exist in the database. - /// - /// is a zero-length string, contains only white space. - /// - /// The file of the media does not exists; moved or deleted. - /// - /// The thumbnail is not available for the given media.\n - /// -or-\n - /// The media is in the external USB storage ( is ). - /// - public Task CreateThumbnailAsync(string mediaId) - { - return CreateThumbnailAsync(mediaId, CancellationToken.None); - } - - /// - /// Creates the thumbnail image for the given media. - /// If the thumbnail already exists for the given media, the existing path will be returned. - /// - /// http://tizen.org/privilege/content.write - /// The media ID to create the thumbnail. - /// The token to cancel the operation. - /// A task that represents the asynchronous operation. The task result contains the thumbnail path. - /// - /// The is disconnected.\n - /// -or-\n - /// An internal error occurred while executing. - /// - /// The has already been disposed of. - /// An error occurred while executing the command. - /// is null. - /// does not exist in the database. - /// - /// is a zero-length string, contains only white space. - /// - /// The file of the media does not exists; moved or deleted. - /// - /// The thumbnail is not available for the given media.\n - /// -or-\n - /// The media is in the external USB storage ( is ). - /// - public Task CreateThumbnailAsync(string mediaId, CancellationToken cancellationToken) - { - ValidateDatabase(); - - return cancellationToken.IsCancellationRequested ? Task.FromCanceled(cancellationToken) : - CreateThumbnailAsyncCore(mediaId, cancellationToken); - } - - private async Task CreateThumbnailAsyncCore(string mediaId, CancellationToken cancellationToken) - { - ValidationUtil.ValidateNotNullOrEmpty(mediaId, nameof(mediaId)); - - var tcs = new TaskCompletionSource(); - - Interop.MediaInfo.GetMediaFromDB(mediaId, out var handle).ThrowIfError("Failed to create thumbnail"); - - if (handle.IsInvalid) - { - throw new RecordNotFoundException("Media does not exist."); - } - - using (handle) - { - if (InteropHelper.GetValue(handle, Interop.MediaInfo.GetStorageType) == StorageType.ExternalUsb) - { - throw new UnsupportedContentException("The media is in external usb storage."); - } - - var path = InteropHelper.GetString(handle, Interop.MediaInfo.GetFilePath); - - if (File.Exists(path) == false) - { - throw new FileNotFoundException($"The media file does not exist. Path={path}.", path); - } - - using (RegisterCancelThumbnail(cancellationToken, tcs, handle)) - using (var cbKeeper = ObjectKeeper.Get(GetCreateThumbnailCallback(tcs))) - { - Interop.MediaInfo.CreateThumbnail(handle, cbKeeper.Target).ThrowIfError("Failed to create thumbnail"); - - return await tcs.Task; - } - } - } - - private static Interop.MediaInfo.ThumbnailCompletedCallback GetCreateThumbnailCallback( - TaskCompletionSource tcs) - { - return (error, path, _) => - { - if (error != MediaContentError.None) - { - tcs.TrySetException(error.AsException("Failed to create thumbnail")); - } - else - { - tcs.TrySetResult(path); - } - }; - } - - private static IDisposable RegisterCancelThumbnail(CancellationToken cancellationToken, - TaskCompletionSource tcs, Interop.MediaInfoHandle handle) - { - if (cancellationToken.CanBeCanceled == false) - { - return null; - } - - return cancellationToken.Register(() => - { - if (tcs.Task.IsCompleted) - { - return; - } - - Interop.MediaInfo.CancelThumbnail(handle).ThrowIfError("Failed to cancel"); - tcs.TrySetCanceled(); - }); - } - #endregion - - #region DetectFaceAsync - /// - /// Detects faces from the given media. - /// If the thumbnail already exists for the given media, the existing path will be returned. - /// - /// http://tizen.org/privilege/content.write - /// http://tizen.org/feature/vision.face_recognition - /// The media ID to create the thumbnail. - /// A task that represents the asynchronous add operation. The task result contains the number of faces detected. - /// - /// The is disconnected.\n - /// -or-\n - /// An internal error occurred while executing. - /// - /// The has already been disposed of. - /// An error occurred while executing the command. - /// is null. - /// does not exist in the database. - /// - /// is a zero-length string, contains only white space. - /// - /// The file of the media does not exists; moved or deleted. - /// Face detection is not available for the given media. - /// The required feature is not supported. - /// The caller has no required privilege. - public Task DetectFaceAsync(string mediaId) - { - return DetectFaceAsync(mediaId, CancellationToken.None); - } - - /// - /// Creates the thumbnail image for the given media. - /// If the thumbnail already exists for the given media, the existing path will be returned. - /// - /// - /// Media in the external storage is not supported, with the exception of MMC. - /// - /// http://tizen.org/privilege/content.write - /// http://tizen.org/feature/vision.face_recognition - /// The media ID to create the thumbnail. - /// The token to cancel the operation. - /// A task that represents the asynchronous operation. The task result contains the number of faces detected. - /// - /// The is disconnected.\n - /// -or-\n - /// An internal error occurred while executing. - /// - /// The has already been disposed of. - /// An error occurred while executing the command. - /// is null. - /// does not exist in the database. - /// - /// is a zero-length string, contains only white space. - /// - /// The file of the media does not exists; moved or deleted. - /// - /// Face detection is not available for the given media.\n - /// -or-\n - /// The media is in the external USB storage ( is ). - /// - /// The required feature is not supported. - public Task DetectFaceAsync(string mediaId, CancellationToken cancellationToken) - { - if (Features.IsSupported(Features.FaceRecognition) == false) - { - throw new NotSupportedException($"The feature({Features.FaceRecognition}) is not supported."); - } - - ValidateDatabase(); - - return cancellationToken.IsCancellationRequested ? Task.FromCanceled(cancellationToken) : - DetectFaceAsyncCore(mediaId, cancellationToken); - } - - private static async Task DetectFaceAsyncCore(string mediaId, CancellationToken cancellationToken) - { - ValidationUtil.ValidateNotNullOrEmpty(mediaId, nameof(mediaId)); - - var tcs = new TaskCompletionSource(); - - Interop.MediaInfo.GetMediaFromDB(mediaId, out var handle).ThrowIfError("Failed to detect faces"); - - if (handle.IsInvalid) - { - throw new RecordNotFoundException("Media does not exist."); - } - - using (handle) - { - if (InteropHelper.GetValue(handle, Interop.MediaInfo.GetStorageType) == StorageType.ExternalUsb) - { - throw new UnsupportedContentException("The media is in external usb storage."); - } - - if (InteropHelper.GetValue(handle, Interop.MediaInfo.GetMediaType) != MediaType.Image) - { - throw new UnsupportedContentException("Only image is supported."); - } - - var path = InteropHelper.GetString(handle, Interop.MediaInfo.GetFilePath); - - if (File.Exists(path) == false) - { - throw new FileNotFoundException($"The media file does not exist. Path={path}.", path); - } - - using (RegisterCancelFaceDetection(cancellationToken, tcs, handle)) - using (var cbKeeper = ObjectKeeper.Get(GetFaceDetectionCallback(tcs))) - { - Interop.MediaInfo.StartFaceDetection(handle, cbKeeper.Target).ThrowIfError("Failed to detect faces"); - - return await tcs.Task; - } - } - } - - private static Interop.MediaInfo.FaceDetectionCompletedCallback GetFaceDetectionCallback( - TaskCompletionSource tcs) - { - return (error, count, _) => - { - if (error != MediaContentError.None) - { - tcs.TrySetException(error.AsException("Failed to detect faces")); - } - else - { - tcs.TrySetResult(count); - } - }; - } - - private static IDisposable RegisterCancelFaceDetection(CancellationToken cancellationToken, - TaskCompletionSource tcs, Interop.MediaInfoHandle handle) - { - if (cancellationToken.CanBeCanceled == false) - { - return null; - } - - return cancellationToken.Register(() => - { - if (tcs.Task.IsCompleted) - { - return; - } - - Interop.MediaInfo.CancelFaceDetection(handle).ThrowIfError("Failed to cancel"); - tcs.TrySetCanceled(); - }); - } - #endregion - } -} diff --git a/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/MediaInfoUpdateValues.cs b/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/MediaInfoUpdateValues.cs deleted file mode 100644 index 38a528ad9..000000000 --- a/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/MediaInfoUpdateValues.cs +++ /dev/null @@ -1,73 +0,0 @@ -/* - * 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.Content.MediaContent -{ - /// - /// Provides means to set values used for the update command. - /// - /// - /// The values only set in the object will be affected to the update command. - /// - /// - public class MediaInfoUpdateValues - { - /// - /// Gets or sets the weather information for an update. - /// - /// If the value is null, the update operation will have no effect on the field. - /// A string for weather; the field will not be updated if null. - public string Weather { get; set; } - - /// - /// Gets or sets the favorite status for an update. - /// - /// If the value is null, the update operation will have no effect on the field. - /// A value indicating whether the media is favorite; the field will not be updated if null. - public bool? IsFavorite { get; set; } - - /// - /// Gets or sets the provider information for an update. - /// - /// If the value is null, the update operation will have no effect on the field. - /// A string for provider; the field will not be updated if null. - public string Provider { get; set; } - - /// - /// Gets or sets the category information for an update. - /// - /// If the value is null, the update operation will have no effect on the field. - /// A string for category; the field will not be updated if null. - public string Category { get; set; } - - - /// - /// Gets or sets the location tag for an update. - /// - /// If the value is null, the update operation will have no effect on the field. - /// A string for location tag; the field will not be updated if null. - public string LocationTag { get; set; } - - /// - /// Gets or sets the age rating information for an update. - /// - /// If the value is null, the update operation will have no effect on the field. - /// A string for age rating; the field will not be updated if null. - public string AgeRating { get; set; } - } -} diff --git a/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/NamespaceDoc.cs b/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/NamespaceDoc.cs deleted file mode 100644 index 817c9b743..000000000 --- a/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/NamespaceDoc.cs +++ /dev/null @@ -1,26 +0,0 @@ -/* - * 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. - */ - -/// -/// The Tizen.Content.MediaContent namespace provides types used in the entire content service. -/// The information about media items (i.e. image, audio, and video) are managed in the content database -/// and operations that involve database require an active connection with the media content service. -/// During media scanning, the media content service extracts the media information automatically. The media information -/// includes basic file information like path, size, modified time, etc. and some metadata like ID3 tag, EXIF, -/// thumbnail, etc. (thumbnail extracted only in the internal and the SD card storage. -/// -/// The media content service does not manage hidden files. -namespace Tizen.Content.MediaContent { } \ No newline at end of file diff --git a/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/ObjectKeeper.cs b/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/ObjectKeeper.cs deleted file mode 100644 index 06d9b8ce9..000000000 --- a/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/ObjectKeeper.cs +++ /dev/null @@ -1,77 +0,0 @@ -/* - * 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; - -namespace Tizen.Content.MediaContent -{ - internal abstract class ObjectKeeper : IDisposable - { - private ObjectKeeper() - { - } - - public abstract void Dispose(); - - public static ObjectKeeperImpl Get(T target) - { - return new ObjectKeeperImpl(target); - } - - internal class ObjectKeeperImpl : ObjectKeeper - { - private readonly GCHandle _handle; - - internal ObjectKeeperImpl(T obj) - { - Target = obj; - _handle = GCHandle.Alloc(obj); - } - - ~ObjectKeeperImpl() - { - Dispose(false); - } - - private bool disposedValue = false; - - protected virtual void Dispose(bool disposing) - { - if (!disposedValue) - { - if (disposing) - { - _handle.Free(); - } - - disposedValue = true; - } - } - - public override void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - - public T Target - { - get; - } - } - } -} diff --git a/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/PlayList.cs b/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/PlayList.cs deleted file mode 100755 index ccc3ec28c..000000000 --- a/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/PlayList.cs +++ /dev/null @@ -1,153 +0,0 @@ -/* - * 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.Content.MediaContent -{ - /// - /// Represents the playlist that is a group of media (usually songs). - /// - public class Playlist - { - internal Playlist(IntPtr handle) - { - Name = InteropHelper.GetString(handle, Interop.Playlist.GetName); - ThumbnailPath = InteropHelper.GetString(handle, Interop.Playlist.GetThumbnailPath); - - Id = InteropHelper.GetValue(handle, Interop.Playlist.GetId); - } - - internal static Playlist FromHandle(IntPtr handle) => new Playlist(handle); - - /// - /// Gets the ID of the playlist. - /// - /// The unique ID of the playlist. - public int Id { get; } - - /// - /// Gets the name of the playlist. - /// - /// The name of the playlist. - public string Name { get; } - - /// - /// Gets the path to the thumbnail. - /// - /// The path to the thumbnail. - public string ThumbnailPath { get; } - - /// - /// Returns a string representation of the playlist. - /// - /// A string representation of the current playlist. - public override string ToString() => - $"Id={Id}, Name={Name}, ThumbnailPath={ThumbnailPath}"; - } - - /// - /// Provides means to set values used for the update command. - /// - /// - /// The values only set in the object will be affected to the update command. - /// - /// - public class PlaylistUpdateValues - { - /// - /// Gets or sets the name of the playlist for an update. - /// - /// If the value is null, the update operation will have no effect on the field. - /// A string for name; the field will not be updated if null. - public string Name { get; set; } - - /// - /// Gets or sets the thumbnail path of the playlist for an update. - /// - /// If the value is null, the update operation will have no effect on the field. - /// A string for the thumbnail path; the field will not be updated if null. - public string ThumbnailPath { get; set; } - } - - /// - /// Represents an order of a member of the playlist. - /// - public class PlayOrder - { - /// - /// Initializes a new instance of the class with the specified member ID and the order value. - /// - /// The ID of the member. - /// The order value. - /// - /// is less than or equal to zero.\n - /// -or-\n - /// is less than zero. - /// - public PlayOrder(int memberId, int orderValue) - { - MemberId = memberId; - Value = orderValue; - } - - private int _memberId; - - /// - /// Gets or sets the member ID. - /// - /// The member ID. - /// - /// is less than or equal to zero. - /// - public int MemberId - { - get => _memberId; - set - { - if (value <= 0) - { - throw new ArgumentOutOfRangeException(nameof(value), value, - "Member id can't be less than or equal to zero."); - } - _memberId = value; - } - } - - private int _value; - - /// - /// Gets or sets the value indicating the order of the member in the playlist. - /// - /// An integer value indicating the order of the member in the playlist. - /// - /// is less than zero. - /// - public int Value - { - get => _value; - set - { - if (value < 0) - { - throw new ArgumentOutOfRangeException(nameof(value), value, - "Order can't be less than zero."); - } - _value = value; - } - } - } -} diff --git a/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/PlaylistCommand.cs b/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/PlaylistCommand.cs deleted file mode 100644 index 51b2de83b..000000000 --- a/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/PlaylistCommand.cs +++ /dev/null @@ -1,872 +0,0 @@ -/* - * 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.Collections.Generic; -using System.IO; -using System.Linq; - -namespace Tizen.Content.MediaContent -{ - /// - /// Provides the commands to manage playlists in the database. - /// - /// - public class PlaylistCommand : MediaCommand - { - /// - /// Initializes a new instance of the class with the specified . - /// - /// A that the commands run on. - /// is null. - /// has already been disposed of. - public PlaylistCommand(MediaDatabase database) : base(database) - { - } - - /// - /// Retrieves the number of playlists. - /// - /// The number of playlists. - /// The is disconnected. - /// The has already been disposed of. - /// An error occurred while executing the command. - public int Count() - { - return Count(null); - } - - /// - /// Retrieves the number of playlists with the . - /// - /// The criteria to use to filter. This value can be null. - /// The number of playlists. - /// The is disconnected. - /// The has already been disposed of. - /// An error occurred while executing the command. - public int Count(CountArguments arguments) - { - ValidateDatabase(); - - return CommandHelper.Count(Interop.Playlist.GetPlaylistCount, arguments); - } - - /// - /// Retrieves the play order of the member. - /// - /// The playlist ID. - /// The member ID of the playlist. - /// The containing the results. - /// The is disconnected. - /// The has already been disposed of. - /// An error occurred while executing the command. - /// - /// is less than or equal to zero.\n - /// -or-\n - /// is less than or equal to zero. - /// - public int GetPlayOrder(int playlistId, int memberId) - { - ValidateDatabase(); - - if (playlistId <= 0) - { - throw new ArgumentOutOfRangeException(nameof(playlistId), playlistId, - "Playlist id can't be less than or equal to zero."); - } - - if (memberId <= 0) - { - throw new ArgumentOutOfRangeException(nameof(memberId), memberId, - "Member id can't be less than or equal to zero."); - } - - Interop.Playlist.GetPlayOrder(playlistId, memberId, out var order).ThrowIfError("Failed to query"); - - return order; - } - - /// - /// Deletes a playlist from the database. - /// - /// http://tizen.org/privilege/content.write - /// The playlist ID to delete. - /// true if the matched record was found and deleted, otherwise false. - /// The is disconnected. - /// The has already been disposed of. - /// An error occurred while executing the command. - /// is less than or equal to zero. - /// The caller has no required privilege. - public bool Delete(int playlistId) - { - ValidateDatabase(); - - if (playlistId <= 0) - { - throw new ArgumentOutOfRangeException(nameof(playlistId), playlistId, - "Playlist id can't be less than or equal to zero."); - } - - if (Select(playlistId) == null) - { - return false; - } - - CommandHelper.Delete(Interop.Playlist.Delete, playlistId); - return true; - } - - /// - /// Inserts the playlist into the database from the specified M3U file. - /// - /// - /// If you want to access an internal storage, you should add privilege http://tizen.org/privilege/mediastorage.\n - /// If you want to access an external storage, you should add privilege http://tizen.org/privilege/externalstorage. - /// - /// http://tizen.org/privilege/content.write - /// http://tizen.org/privilege/mediastorage - /// http://tizen.org/privilege/externalstorage - /// The name of the playlist. - /// The path to a M3U file to import. - /// The instance that contains the record information inserted. - /// The is disconnected. - /// The has already been disposed of. - /// An error occurred while executing the command. - /// - /// is null.\n - /// -or-\n - /// is null. - /// - /// - /// is a zero-length string.\n - /// -or-\n - /// is a zero-length string, contains only white space. - /// - /// does not exists. - /// The caller has no required privilege. - public Playlist InsertFromFile(string name, string path) - { - ValidateDatabase(); - - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - if (name.Length == 0) - { - throw new ArgumentException("Playlist name can't be an empty string."); - } - - ValidationUtil.ValidateNotNullOrEmpty(path, nameof(path)); - - if (File.Exists(path) == false) - { - throw new FileNotFoundException("The specified path does not exists.", path); - } - - IntPtr handle = IntPtr.Zero; - Interop.Playlist.ImportFromFile(path, name, out handle).ThrowIfError("Failed to insert"); - - try - { - return new Playlist(handle); - } - finally - { - if (handle != IntPtr.Zero) - { - Interop.Playlist.Destroy(handle); - } - } - } - /// - /// Exports the playlist to a M3U file. - /// - /// - /// If the file already exists in the file system, then it will be overwritten.\n - /// \n - /// If you want to access an internal storage, you should add privilege http://tizen.org/privilege/mediastorage.\n - /// If you want to access an external storage, you should add privilege http://tizen.org/privilege/externalstorage. - /// - /// http://tizen.org/privilege/mediastorage - /// http://tizen.org/privilege/externalstorage - /// The playlist ID to export. - /// The path to a M3U file. - /// The is disconnected. - /// The has already been disposed of. - /// An error occurred while executing the command. - /// is null. - /// is a zero-length string, contains only white space. - /// is less than or equal to zero. - /// No matching playlist exists. - /// The caller has no required privilege. - public void ExportToFile(int playlistId, string path) - { - ValidateDatabase(); - - ValidationUtil.ValidateNotNullOrEmpty(path, nameof(path)); - - if (playlistId <= 0) - { - throw new ArgumentOutOfRangeException(nameof(playlistId), playlistId, - "Playlist id can't be less than or equal to zero."); - } - - IntPtr handle = IntPtr.Zero; - try - { - Interop.Playlist.GetPlaylistFromDb(playlistId, out handle).ThrowIfError("Failed to query"); - - if (handle == IntPtr.Zero) - { - throw new RecordNotFoundException("No matching playlist exists."); - } - - Interop.Playlist.ExportToFile(handle, path).ThrowIfError("Failed to export"); - } - finally - { - if (handle != IntPtr.Zero) - { - Interop.Playlist.Destroy(handle); - } - } - } - - /// - /// Inserts the playlist into the database with the specified name. - /// - /// http://tizen.org/privilege/content.write - /// The name of the playlist. - /// The instance that contains the record information inserted. - /// The is disconnected. - /// The has already been disposed of. - /// An error occurred while executing the command. - /// is null. - /// is a zero-length string. - /// The caller has no required privilege. - public Playlist Insert(string name) - { - return Insert(name, null); - } - - /// - /// Inserts the playlist into the database with the specified name and the thumbnail path. - /// - /// http://tizen.org/privilege/content.write - /// The name of the playlist. - /// The path of the thumbnail for the playlist. This value can be null. - /// The instance that contains the record information inserted. - /// The is disconnected. - /// The has already been disposed of. - /// An error occurred while executing the command. - /// is null. - /// is a zero-length string. - /// The caller has no required privilege. - public Playlist Insert(string name, string thumbnailPath) - { - ValidateDatabase(); - - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - if (name.Length == 0) - { - throw new ArgumentException("Playlist name can't be an empty string."); - } - - IntPtr handle = IntPtr.Zero; - Interop.Playlist.Create(out handle).ThrowIfError("Failed to insert"); - - try - { - Interop.Playlist.SetName(handle, name).ThrowIfError("Failed to insert"); - - if (thumbnailPath != null) - { - Interop.Playlist.SetThumbnailPath(handle, thumbnailPath).ThrowIfError("Failed to insert"); - } - - Interop.Playlist.Insert(handle).ThrowIfError("Failed to insert"); - return new Playlist(handle); - } - finally - { - if (handle != IntPtr.Zero) - { - Interop.Playlist.Destroy(handle); - } - } - } - - /// - /// Retrieves the playlists. - /// - /// The containing the results. - /// The is disconnected. - /// The has already been disposed of. - /// An error occurred while executing the command. - public MediaDataReader Select() - { - return Select(null); - } - - /// - /// Retrieves the playlists with the . - /// - /// The criteria to use to filter. This value can be null. - /// The containing the results. - /// The is disconnected. - /// The has already been disposed of. - /// An error occurred while executing the command. - public MediaDataReader Select(SelectArguments filter) - { - ValidateDatabase(); - - return CommandHelper.Select(filter, Interop.Playlist.ForeachPlaylistFromDb, - Playlist.FromHandle); - } - - /// - /// Retrieves the playlist with the specified playlist ID. - /// - /// The playlist ID to select. - /// The instance if the matched record was found in the database, otherwise null. - /// The is disconnected. - /// The has already been disposed of. - /// An error occurred while executing the command. - /// is less than or equal to zero. - public Playlist Select(int playlistId) - { - ValidateDatabase(); - - if (playlistId <= 0) - { - throw new ArgumentOutOfRangeException(nameof(playlistId), playlistId, - "Playlist id can't be less than or equal to zero."); - } - - IntPtr handle = IntPtr.Zero; - - try - { - Interop.Playlist.GetPlaylistFromDb(playlistId, out handle).ThrowIfError("Failed to query"); - - if (handle == IntPtr.Zero) - { - return null; - } - - return new Playlist(handle); - } - finally - { - if (handle != IntPtr.Zero) - { - Interop.Playlist.Destroy(handle); - } - } - } - - /// - /// Retrieves the number of media information of the playlist. - /// - /// The playlist ID to count media added to the playlist. - /// The number of media information. - /// The is disconnected. - /// The has already been disposed of. - /// An error occurred while executing the command. - /// is less than or equal to zero. - public int CountMember(int playlistId) - { - return CountMember(playlistId, null); - } - - /// - /// Retrieves the number of media information of the playlist with the . - /// - /// The playlist ID to count the media added to the playlist. - /// The criteria to use to filter. This value can be null. - /// The number of media information. - /// The is disconnected. - /// The has already been disposed of. - /// An error occurred while executing the command. - /// is less than or equal to zero. - public int CountMember(int playlistId, CountArguments arguments) - { - ValidateDatabase(); - - if (playlistId <= 0) - { - throw new ArgumentOutOfRangeException(nameof(playlistId), playlistId, - "Playlist id can't be less than or equal to zero."); - } - - return CommandHelper.Count(Interop.Playlist.GetMediaCountFromDb, playlistId, arguments); - - } - - private static List GetMembers(int playlistId, SelectArguments arguments) - { - using (var filter = QueryArguments.ToNativeHandle(arguments)) - { - Exception caught = null; - List list = new List(); - - Interop.Playlist.ForeachMediaFromDb(playlistId, filter, (memberId, mediaInfoHandle, _) => - { - try - { - list.Add(new PlaylistMember(memberId, MediaInfo.FromHandle(mediaInfoHandle))); - - return true; - } - catch (Exception e) - { - caught = e; - return false; - } - }).ThrowIfError("Failed to query"); - - if (caught != null) - { - throw caught; - } - - return list; - } - } - - /// - /// Retrieves the member ID of the media in the playlist. - /// - /// The playlist ID. - /// The media ID. - /// The member ID if the member was found in the playlist, otherwise -1. - /// The is disconnected. - /// The has already been disposed of. - /// An error occurred while executing the command. - /// is less than or equal to zero. - /// is null. - /// is a zero-length string, contains only white space. - public int GetMemberId(int playlistId, string mediaId) - { - ValidateDatabase(); - - ValidationUtil.ValidateNotNullOrEmpty(mediaId, nameof(mediaId)); - - if (playlistId <= 0) - { - throw new ArgumentOutOfRangeException(nameof(playlistId), playlistId, - "Playlist id can't be less than or equal to zero."); - } - - var reader = SelectMember(playlistId, new SelectArguments() - { - FilterExpression = $"{MediaInfoColumns.Id}='{mediaId}'" - }); - reader.Read(); - - return reader.Current?.MemberId ?? -1; - } - - /// - /// Retrieves the media information of the playlist. - /// - /// The playlist ID to query with. - /// The containing the results. - /// The is disconnected. - /// The has already been disposed of. - /// An error occurred while executing the command. - /// is less than or equal to zero. - public MediaDataReader SelectMember(int playlistId) - { - return SelectMember(playlistId, null); - } - - /// - /// Retrieves the media information of the playlist with the . - /// - /// The playlist ID to query with. - /// The criteria to use to filter. This value can be null. - /// The containing the results. - /// The is disconnected. - /// The has already been disposed of. - /// An error occurred while executing the command. - /// is less than or equal to zero. - public MediaDataReader SelectMember(int playlistId, SelectArguments filter) - { - ValidateDatabase(); - - if (playlistId <= 0) - { - throw new ArgumentOutOfRangeException(nameof(playlistId), playlistId, - "Playlist id can't be less than or equal to zero."); - } - - return new MediaDataReader(GetMembers(playlistId, filter)); - } - - /// - /// Updates the playlist with the specified values. - /// - /// http://tizen.org/privilege/content.write - /// The playlist ID to update. - /// The values for the update. - /// true if the matched record was found and updated, otherwise false. - /// Only values set in the are updated. - /// The is disconnected. - /// The has already been disposed of. - /// An error occurred while executing the command. - /// is null. - /// is less than or equal to zero. - /// The caller has no required privilege. - public bool Update(int playlistId, PlaylistUpdateValues values) - { - ValidateDatabase(); - - if (playlistId <= 0) - { - throw new ArgumentOutOfRangeException(nameof(playlistId), playlistId, - "Playlist id can't be less than or equal to zero."); - } - - if (values == null) - { - throw new ArgumentNullException(nameof(values)); - } - - if (CommandHelper.Count( - Interop.Playlist.GetPlaylistCount, $"{PlaylistColumns.Id}={playlistId}") == 0) - { - return false; - } - - Interop.Playlist.Create(out var handle).ThrowIfError("Failed to update"); - - try - { - if (values.Name != null) - { - Interop.Playlist.SetName(handle, values.Name).ThrowIfError("Failed to update"); - } - - if (values.ThumbnailPath != null) - { - Interop.Playlist.SetThumbnailPath(handle, values.ThumbnailPath).ThrowIfError("Failed to update"); - } - - Interop.Playlist.Update(playlistId, handle).ThrowIfError("Failed to update"); - return true; - } - finally - { - if (handle != IntPtr.Zero) - { - Interop.Playlist.Destroy(handle); - } - } - } - - /// - /// Adds the media to the playlist. - /// - /// The playlist ID that the media will be added to. - /// The media ID to add to the playlist. - /// true if the matched record was found and updated, otherwise false. - /// The invalid media ID will be ignored. - /// The is disconnected. - /// The has already been disposed of. - /// An error occurred while executing the command. - /// is null. - /// is a zero-length string, contains only white space. - /// is less than or equal to zero. - public bool AddMember(int playlistId, string mediaId) - { - ValidationUtil.ValidateNotNullOrEmpty(mediaId, nameof(mediaId)); - - return AddMembers(playlistId, new string[] { mediaId }); - } - - /// - /// Adds the media set to the playlist. - /// - /// The playlist ID that the media will be added to. - /// The collection of media ID to add to the playlist. - /// true if the matched record was found and updated, otherwise false. - /// The invalid media IDs will be ignored. - /// The is disconnected. - /// The has already been disposed of. - /// An error occurred while executing the command. - /// is null. - /// - /// has no element.\n - /// -or-\n - /// contains null value.\n - /// -or-\n - /// contains a zero-length string or white space.\n - /// - /// is less than or equal to zero. - public bool AddMembers(int playlistId, IEnumerable mediaIds) - { - ValidateDatabase(); - - if (playlistId <= 0) - { - throw new ArgumentOutOfRangeException(nameof(playlistId), playlistId, - "Playlist id can't be less than or equal to zero."); - } - - if (mediaIds == null) - { - throw new ArgumentNullException(nameof(mediaIds)); - } - - if (mediaIds.Count() == 0) - { - throw new ArgumentException("mediaIds has no element.", nameof(mediaIds)); - } - - if (CommandHelper.Count( - Interop.Playlist.GetPlaylistCount, $"{PlaylistColumns.Id}={playlistId}") == 0) - { - return false; - } - - IntPtr handle = IntPtr.Zero; - Interop.Playlist.Create(out handle).ThrowIfError("Failed to add member"); - - try - { - foreach (var mediaId in mediaIds) - { - if (mediaId == null) - { - throw new ArgumentException("Media id should not be null.", nameof(mediaIds)); - } - - if (string.IsNullOrWhiteSpace(mediaId)) - { - throw new ArgumentException("Media id should not be empty.", nameof(mediaId)); - } - - Interop.Playlist.AddMedia(handle, mediaId).ThrowIfError("Failed to add member"); - } - - Interop.Playlist.Update(playlistId, handle).ThrowIfError("Failed to add member"); - return true; - } - finally - { - if (handle != IntPtr.Zero) - { - Interop.Playlist.Destroy(handle); - } - } - } - - /// - /// Removes a member from the playlist. - /// - /// The playlist ID. - /// The member ID to be removed. - /// true if the matched record was found and updated, otherwise false. - /// The invalid ID will be ignored. - /// The is disconnected. - /// The has already been disposed of. - /// An error occurred while executing the command. - /// - /// is less than or equal to zero.\n - /// -or-\n - /// is less than or equal to zero.\n - /// - public bool RemoveMember(int playlistId, int memberId) - { - if (memberId <= 0) - { - throw new ArgumentOutOfRangeException(nameof(memberId), memberId, - "Member id can't be less than or equal to zero."); - } - - return RemoveMembers(playlistId, new int[] { memberId }); - } - - /// - /// Removes a media set from the playlist. - /// - /// The playlist ID. - /// The collection of member ID to remove from to the playlist. - /// true if the matched record was found and updated, otherwise false. - /// The invalid IDs will be ignored. - /// The is disconnected. - /// The has already been disposed of. - /// An error occurred while executing the command. - /// is null. - /// - /// has no element.\n - /// -or-\n - /// contains a value which is less than or equal to zero. - /// - /// is less than or equal to zero. - public bool RemoveMembers(int playlistId, IEnumerable memberIds) - { - ValidateDatabase(); - - if (playlistId <= 0) - { - throw new ArgumentOutOfRangeException(nameof(playlistId), playlistId, - "Playlist id can't be less than or equal to zero."); - } - - if (memberIds == null) - { - throw new ArgumentNullException(nameof(memberIds)); - } - - if (memberIds.Count() == 0) - { - throw new ArgumentException("memberIds has no element.", nameof(memberIds)); - } - - if (CommandHelper.Count( - Interop.Playlist.GetPlaylistCount, $"{PlaylistColumns.Id}={playlistId}") == 0) - { - return false; - } - - IntPtr handle = IntPtr.Zero; - Interop.Playlist.Create(out handle).ThrowIfError("Failed to add member"); - - try - { - foreach (var memberId in memberIds) - { - if (memberId <= 0) - { - throw new ArgumentException(nameof(memberIds), - "Member id can't be less than or equal to zero."); - } - - Interop.Playlist.RemoveMedia(handle, memberId).ThrowIfError("Failed to add member"); - } - - Interop.Playlist.Update(playlistId, handle).ThrowIfError("Failed to add member"); - return true; - } - finally - { - if (handle != IntPtr.Zero) - { - Interop.Playlist.Destroy(handle); - } - } - } - - /// - /// Updates a play order of the playlist. - /// - /// The playlist ID. - /// The to apply. - /// true if the matched record was found and updated, otherwise false. - /// The that is invalid will be ignored. - /// The is disconnected. - /// The has already been disposed of. - /// An error occurred while executing the command. - /// is null. - /// is less than or equal to zero. - public bool UpdatePlayOrder(int playlistId, PlayOrder playOrder) - { - if (playOrder == null) - { - throw new ArgumentNullException(nameof(playOrder)); - } - return UpdatePlayOrders(playlistId, new PlayOrder[] { playOrder }); - } - - /// - /// Updates play orders of the playlist. - /// - /// The playlist ID. - /// The collection of the to apply. - /// true if the matched record was found and updated, otherwise false. - /// The that is invalid will be ignored. - /// The is disconnected. - /// The has already been disposed of. - /// An error occurred while executing the command. - /// is null. - /// - /// has no element.\n - /// -or-\n - /// contains a null value. - /// - /// is less than or equal to zero. - public bool UpdatePlayOrders(int playlistId, IEnumerable orders) - { - ValidateDatabase(); - - if (playlistId <= 0) - { - throw new ArgumentOutOfRangeException(nameof(playlistId), playlistId, - "Playlist id can't be less than or equal to zero."); - } - - if (orders == null) - { - throw new ArgumentNullException(nameof(orders)); - } - - if (orders.Count() == 0) - { - throw new ArgumentException("memberIds has no element.", nameof(orders)); - } - - if (CommandHelper.Count( - Interop.Playlist.GetPlaylistCount, $"{PlaylistColumns.Id}={playlistId}") == 0) - { - return false; - } - - IntPtr handle = IntPtr.Zero; - Interop.Playlist.Create(out handle).ThrowIfError("Failed to add member"); - - try - { - foreach (var order in orders) - { - if (order == null) - { - throw new ArgumentException(nameof(orders), - "orders should not contain null value."); - } - Interop.Playlist.SetPlayOrder(handle, order.MemberId, order.Value).ThrowIfError("Failed to add member"); - } - - Interop.Playlist.Update(playlistId, handle).ThrowIfError("Failed to add member"); - return true; - } - finally - { - if (handle != IntPtr.Zero) - { - Interop.Playlist.Destroy(handle); - } - } - } - } -} \ No newline at end of file diff --git a/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/PlaylistMember.cs b/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/PlaylistMember.cs deleted file mode 100644 index 9d93dbd09..000000000 --- a/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/PlaylistMember.cs +++ /dev/null @@ -1,42 +0,0 @@ -/* - * 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. - */ - -namespace Tizen.Content.MediaContent -{ - /// - /// Represents a member of the . - /// - public class PlaylistMember - { - /// - /// Gets the member ID. - /// - /// The member ID of the playlist. - public int MemberId { get; } - - /// - /// Gets the media information of the member. - /// - /// The of the member. - public MediaInfo MediaInfo { get; } - - internal PlaylistMember(int memberId, MediaInfo mediaInfo) - { - MemberId = memberId; - MediaInfo = mediaInfo; - } - } -} diff --git a/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/QueryArguments.cs b/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/QueryArguments.cs deleted file mode 100644 index d7272a6bc..000000000 --- a/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/QueryArguments.cs +++ /dev/null @@ -1,282 +0,0 @@ -/* - * 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.Diagnostics; -using FilterHandle = Interop.FilterHandle; - -namespace Tizen.Content.MediaContent -{ - /// - /// The Base class for query arguments. - /// - /// - /// A filter is required for filtering information associated with Album, Folder, Tag, Bookmark, Playlist, - /// and MediaInfo on the basis of details like limit, order, and condition. - /// - public class QueryArguments - { - private string _filter; - - /// - /// Gets or sets the filtering expression that is applied. - /// - /// A string that represents a filtering expression applied when data is retrieved. - /// - /// Expressions for the filter can be one of the following forms: - /// - /// column = value - /// column > value - /// column >= value - /// column < value - /// column <= value - /// value = column - /// value >= column - /// value < column - /// value <= column - /// column IN (value) - /// column IN(value-list) - /// column NOT IN(value) - /// column NOT IN(value-list) - /// column LIKE value - /// expression COLLATE NOCASE - /// expression COLLATE RTRIM - /// expression COLLATE LOCALIZED - /// expression1 AND expression2 OR expression3 ... - /// - /// - /// Note that if you want to set quotation (" ' " or " " ") as value of LIKE operator, you should use two times. (" '' " or " "" "). - /// And the optional ESCAPE clause is supported. Both percent symbol("%") and underscore symbol("_") are used in the LIKE pattern. - /// If these characters are used as values of the LIKE operation, then the expression following the ESCAPE clause of sqlite will be ignored.\n - /// \n - /// For example,\n - /// - column LIKE ('#%') ESCAPE ('#') - "#" is an escape character, it will be ignored. - /// - /// is a zero-length string, contains only white space. - /// - /// - /// - /// - /// - /// - /// - public string FilterExpression - { - get => _filter; - set - { - if (value != null) - { - ValidationUtil.ValidateNotNullOrEmpty(value, nameof(value)); - } - - _filter = value; - } - } - - private string _storageId; - - /// - /// Gets or sets the storage ID for the given filter. - /// You can use this property when you want to search items only in the specific storage. - /// - /// The storage ID to restrict storage to search, or null for all storages. - /// is a zero-length string, contains only white space. - public string StorageId - { - get => _storageId; - set - { - if (value != null) - { - ValidationUtil.ValidateNotNullOrEmpty(value, nameof(value)); - } - - _storageId = value; - } - } - - internal static FilterHandle ToNativeHandle(QueryArguments arguments) - { - if (arguments == null || arguments.IsEmpty()) - { - return FilterHandle.Null; - } - - Interop.Filter.Create(out var handle).ThrowIfError("Failed to apply arguments."); - - try - { - arguments.FillHandle(handle); - } - catch (Exception) - { - handle.Dispose(); - throw; - } - - return handle; - } - - internal static FilterHandle CreateNativeHandle(string filterExpression) - { - Debug.Assert(filterExpression != null); - - Interop.Filter.Create(out var handle).ThrowIfError("Failed to apply arguments."); - - Interop.Filter.SetCondition(handle, filterExpression, Collation.Default). - ThrowIfError("Failed to create filter handle."); - - return handle; - } - - internal virtual bool IsEmpty() - { - return StorageId == null && FilterExpression == null; - } - - internal virtual void FillHandle(FilterHandle handle) - { - if (FilterExpression != null) - { - Interop.Filter.SetCondition(handle, FilterExpression, Collation.Default). - ThrowIfError("Failed to create filter handle(condition)"); - } - - if (StorageId != null) - { - Interop.Filter.SetStorage(handle, StorageId). - ThrowIfError("Failed to create filter handle(storage id)"); ; - } - } - } - - /// - /// Provides the ability to filter the result of a Select command. - /// - /// - /// A filter is required for filtering information associated with Album, Folder, Tag, Bookmark, Playlist, - /// and MediaInfo. - /// - public class SelectArguments : QueryArguments - { - private int _startRowIndex; - - /// - /// Gets or sets the starting row position of a query (starting from zero). - /// - /// An integer value that indicates the starting row position of a query. - /// is less than zero.\n - public int StartRowIndex - { - get => _startRowIndex; - set - { - if (value < 0) - { - throw new ArgumentOutOfRangeException(nameof(value), value, "StartRowIndex can't be less than zero."); - } - - _startRowIndex = value; - } - } - - private int _totalRowCount; - - /// - /// Gets or sets the number of rows to be retrieved. - /// - /// An integer value that indicates the limit of rows of the result. - /// is less than zero. - public int TotalRowCount - { - get => _totalRowCount; - set - { - if (value < 0) - { - throw new ArgumentOutOfRangeException(nameof(value), value, "TotalRowCount can't be less than zero."); - } - - _totalRowCount = value; - } - } - - private string _sortOrder; - - /// - /// Gets or sets the sort order of the results. - /// - /// The expression for the sort order. - /// - /// Expressions for the sort order can be:\n - /// column [COLLATE NOCASE/RTRIM/LOCALIZED] [ASC/DESC], column2 ... - /// - /// is a zero-length string, contains only white space. - /// - /// - /// - /// - /// - /// - /// - public string SortOrder - { - get => _sortOrder; - set - { - if (value != null) - { - ValidationUtil.ValidateNotNullOrEmpty(value, nameof(value)); - } - - _sortOrder = value; - } - } - - internal override bool IsEmpty() - { - return base.IsEmpty() && StartRowIndex == 0 && TotalRowCount == 0 && SortOrder == null; - } - - internal override void FillHandle(FilterHandle handle) - { - base.FillHandle(handle); - - if (StartRowIndex != 0 || TotalRowCount != 0) - { - Interop.Filter.SetOffset(handle, StartRowIndex, TotalRowCount). - ThrowIfError("Failed to create filter handle(limit)"); - } - - if (SortOrder != null) - { - Interop.Filter.SetOrder(handle, SortOrder).ThrowIfError("Failed to create filter handle(order)"); - } - } - } - - /// - /// Provides the ability to filter the result of the Count command. - /// - /// - /// A filter is required for filtering information associated with Album, Folder, Tag, Bookmark, Playlist, - /// and MediaInfo. - /// - public class CountArguments : QueryArguments - { - } -} diff --git a/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/RecordNotFoundException.cs b/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/RecordNotFoundException.cs deleted file mode 100644 index 452fb0f3e..000000000 --- a/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/RecordNotFoundException.cs +++ /dev/null @@ -1,51 +0,0 @@ -/* - * 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.Content.MediaContent -{ - /// - /// The exception that is thrown when no record is found in the database. - /// - public class RecordNotFoundException : Exception - { - /// - /// Initializes a new instance of the class. - /// - public RecordNotFoundException() : base("No record found.") - { - } - - /// - /// Initializes a new instance of the class with a specified error message. - /// - /// The message that describes the error. - public RecordNotFoundException(string message) : base(message) - { - } - - /// - /// Initializes a new instance of the class with a specified error message - /// and a reference to the inner exception that is the cause of this exception. - /// - /// The message that describes the error. - /// The exception that is the cause of the current exception. - public RecordNotFoundException(string message, Exception innerException) : base(message, innerException) - { - } - } -} diff --git a/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/Rectangle.cs b/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/Rectangle.cs deleted file mode 100644 index 822a68929..000000000 --- a/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/Rectangle.cs +++ /dev/null @@ -1,130 +0,0 @@ -/* - * 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.Content.MediaContent -{ - /// - /// Represents the location of the object bounded by the rectangle defined by - /// coordinates of top left corner, width, and height. - /// - public struct Rectangle - { - /// - /// Initializes a new instance of the rectangle with the specified values. - /// - /// The x-coordinate of the upper-left corner of the rectangle. - /// The y-coordinate of the upper-left corner of the rectangle. - /// The width of the rectangle. - /// The height of the rectangle. - public Rectangle(int x, int y, int width, int height) - { - X = x; - Y = y; - Width = width; - Height = height; - } - - /// - /// Gets or sets the x-coordinate of the upper-left corner of the rectangle. - /// - /// The x-coordinate of the upper-left edge of the rectangle. - public int X { get; set; } - - /// - /// Gets or sets the y-coordinate of the upper-left corner of the rectangle. - /// - /// The y-coordinate of the upper-left edge of the rectangle. - public int Y { get; set; } - - /// - /// Gets or sets the width of the rectangle. - /// - /// The width of the rectangle. - public int Width { get; set; } - - /// - /// Gets or sets the height of the rectangle. - /// - /// The height of the rectangle. - public int Height { get; set; } - - /// - /// Gets the x-coordinate of the left edge of the rectangle. - /// - /// The x-coordinate of the left edge of the rectangle. - public int Left => X; - - /// - /// Gets the y-coordinate of the top edge of the rectangle. - /// - /// The y-coordinate of the top edge of the rectangle. - public int Top => Y; - - /// - /// Gets the x-coordinate of the right edge of the rectangle. - /// - /// The x-coordinate of the right edge of the rectangle. - public int Right => X + Width; - - /// - /// Gets the y-coordinate of the bottom edge of the rectangle. - /// - /// The y-coordinate of the bottom edge of the rectangle. - public int Bottom => Y + Height; - - /// - /// Returns a string representation of the rectangle. - /// - /// A string representation of the current rectangle. - public override string ToString() => - $"X={X.ToString()}, Y={Y.ToString()}, Width={Width.ToString()}, Height={Height.ToString()}"; - - /// - /// Returns the hash code for this rectangle structure. - /// - /// An integer that represents the hash code for this rectangle. - public override int GetHashCode() => new { X, Y, Width, Height }.GetHashCode(); - - /// - /// Tests whether object is a rectangle structure with the same location and size of this rectangle structure. - /// - /// The to compare. - /// - /// true if object is a rectangle structure and its x, y, width, and height properties are - /// equal to the corresponding properties of this rectangle structure; otherwise, false. - /// - public override bool Equals(object obj) => obj is Rectangle && this == (Rectangle)obj; - - /// - /// Tests whether two rectangle structures have equal location and size. - /// - /// The to compare. - /// The to compare. - /// true if the two rectangle structures have equal x, y, width, and height properties; otherwise, false. - public static bool operator ==(Rectangle rect1, Rectangle rect2) - => rect1.X == rect2.X && rect1.Y == rect2.Y && rect1.Width == rect2.Width && rect1.Height == rect2.Height; - - /// - /// Tests whether two rectangle structures differ in location or size. - /// - /// The to compare. - /// The to compare. - /// true if any of the x, y, width, or height properties of the two rectangle structures are unequal; otherwise false. - public static bool operator !=(Rectangle rect1, Rectangle rect2) => !(rect1 == rect2); - } -} diff --git a/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/Storage.cs b/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/Storage.cs deleted file mode 100755 index 0db0876fd..000000000 --- a/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/Storage.cs +++ /dev/null @@ -1,64 +0,0 @@ -/* - * 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.Content.MediaContent -{ - /// - /// Represents the storage information for media. - /// - /// - /// The system generates the storage ID when the external storage is added and manages the media information - /// in each of the storage by using the storage ID. - /// - public class Storage - { - internal Storage(IntPtr handle) - { - Path = InteropHelper.GetString(handle, Interop.Storage.GetPath); - Id = InteropHelper.GetString(handle, Interop.Storage.GetId); - Type = InteropHelper.GetValue(handle, Interop.Storage.GetType); - } - - internal static Storage FromHandle(IntPtr handle) => new Storage(handle); - - /// - /// Gets the ID of the storage. - /// - /// The unique ID of the storage. - public string Id { get; } - - /// - /// Gets the path of the storage. - /// - /// The path of the storage. - public string Path { get; } - - /// - /// Gets the type of the storage. - /// - /// The type of the storage. - public StorageType Type { get; } - - /// - /// Returns a string representation of the storage. - /// - /// A string representation of the current storage. - public override string ToString() => - $"Id={Id}, Path={Path}, Type={Type}"; - } -} diff --git a/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/StorageCommand.cs b/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/StorageCommand.cs deleted file mode 100644 index 7cda0ec30..000000000 --- a/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/StorageCommand.cs +++ /dev/null @@ -1,197 +0,0 @@ -/* - * 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.Content.MediaContent -{ - /// - /// Provides the commands to manage external storages in the database. - /// - /// - /// The internal storage is not managed. - /// - /// - public class StorageCommand : MediaCommand - { - /// - /// Initializes a new instance of the class with the specified . - /// - /// The that the commands run on. - /// is null. - /// has already been disposed of. - public StorageCommand(MediaDatabase database) : base(database) - { - } - - /// - /// Retrieves the number of storages. - /// - /// The number of storages. - /// The is disconnected. - /// The has already been disposed of. - /// An error occurred while executing the command. - public int Count() => Count(arguments: null); - - /// - /// Retrieves the number of storages with the . - /// - /// The criteria to use to filter. This value can be null. - /// The number of storages filtered. - /// The is disconnected. - /// The has already been disposed of. - /// An error occurred while executing the command. - public int Count(CountArguments arguments) - { - ValidateDatabase(); - - return CommandHelper.Count(Interop.Storage.GetStorageCountFromDb, arguments); - } - - /// - /// Retrieves the storage with the specified ID. - /// - /// The storage ID to select. - /// The instance if the matched record was found in the database, otherwise null. - /// The is disconnected. - /// The has already been disposed of. - /// An error occurred while executing the command. - /// is null. - /// is a zero-length string, contains only white space. - public Storage Select(string storageId) - { - ValidateDatabase(); - - ValidationUtil.ValidateNotNullOrEmpty(storageId, nameof(storageId)); - - IntPtr handle = IntPtr.Zero; - - try - { - Interop.Storage.GetStorageInfoFromDb(storageId, out handle).ThrowIfError("Failed to query"); - - return handle == IntPtr.Zero ? null : new Storage(handle); - } - finally - { - if (handle != IntPtr.Zero) - { - Interop.Storage.Destroy(handle); - } - } - } - - /// - /// Retrieves all the storages. - /// - /// The containing the results. - /// The is disconnected. - /// The has already been disposed of. - /// An error occurred while executing the command. - public MediaDataReader Select() => Select(arguments: null); - - /// - /// Retrieves the storages with the . - /// - /// The criteria to use to filter. This value can be null. - /// The containing the results. - /// The is disconnected. - /// The has already been disposed of. - /// An error occurred while executing the command. - public MediaDataReader Select(SelectArguments arguments) - { - ValidateDatabase(); - - return CommandHelper.Select(arguments, Interop.Storage.ForeachStorageFromDb, Storage.FromHandle); - } - - private bool Exists(string storageId) - { - ValidateDatabase(); - - ValidationUtil.ValidateNotNullOrEmpty(storageId, nameof(storageId)); - - return Count(new CountArguments { FilterExpression = $"{StorageColumns.Id}='{storageId}'" }) != 0; - } - - /// - /// Retrieves the number of media information of the storage. - /// - /// The storage ID. - /// The number of media information. - /// The is disconnected. - /// The has already been disposed of. - /// An error occurred while executing the command. - /// is null. - /// is a zero-length string, contains only white space. - public int CountMedia(string storageId) => CountMedia(storageId, null); - - /// - /// Retrieves the number of media information of the storage with the . - /// - /// The storage ID to query with. - /// The criteria to use to filter. This value can be null. - /// The number of media information. - /// The is disconnected. - /// The has already been disposed of. - /// An error occurred while executing the command. - /// is null. - /// is a zero-length string, contains only white space. - public int CountMedia(string storageId, CountArguments arguments) - { - if (Exists(storageId) == false) - { - return 0; - } - - return CommandHelper.Count(Interop.Storage.GetMediaCountFromDb, storageId, arguments); - } - - /// - /// Retrieves the media information of the storage. - /// - /// The storage ID. - /// The containing the results. - /// The is disconnected. - /// The has already been disposed of. - /// An error occurred while executing the command. - /// is null. - /// is a zero-length string, contains only white space. - public MediaDataReader SelectMedia(string storageId) => SelectMedia(storageId, null); - - /// - /// Retrieves the media information of the storage with the . - /// - /// The storage ID. - /// The criteria to use to filter. This value can be null. - /// The containing the results. - /// The is disconnected. - /// The has already been disposed of. - /// An error occurred while executing the command. - /// is null. - /// is a zero-length string, contains only white space. - public MediaDataReader SelectMedia(string storageId, SelectArguments filter) - { - if (Exists(storageId) == false) - { - return new MediaDataReader(new MediaInfo[0]); - } - - return CommandHelper.SelectMedia(Interop.Storage.ForeachMediaFromDb, storageId, filter); - } - - } -} diff --git a/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/Tag.cs b/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/Tag.cs deleted file mode 100755 index e3ea3cdae..000000000 --- a/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/Tag.cs +++ /dev/null @@ -1,55 +0,0 @@ -/* - * 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.Content.MediaContent -{ - /// - /// Represents a special piece of information that may be associated with media. - /// Tagging allows a user to organize large number of items into logical groups providing - /// a simplified and faster way of accessing media items. - /// - public class Tag - { - internal Tag(IntPtr handle) - { - Name = InteropHelper.GetString(handle, Interop.Tag.GetName); - Id = InteropHelper.GetValue(handle, Interop.Tag.GetId); - } - - /// - /// Gets the ID of the tag. - /// - /// The unique ID of the tag. - public int Id { get; } - - /// - /// Gets the name of the tag. - /// - /// The name of the tag. - public string Name { get; } - - internal static Tag FromHandle(IntPtr handle) => new Tag(handle); - - /// - /// Returns a string representation of the tag. - /// - /// A string representation of the current tag. - public override string ToString() => $"Id={Id}, Name={Name}"; - - } -} diff --git a/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/TagCommand.cs b/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/TagCommand.cs deleted file mode 100644 index 3f115540a..000000000 --- a/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/TagCommand.cs +++ /dev/null @@ -1,471 +0,0 @@ -/* - * 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.Collections.Generic; -using System.Linq; - -namespace Tizen.Content.MediaContent -{ - /// - /// Provides the commands to manage tags in the database. - /// - /// - public class TagCommand : MediaCommand - { - /// - /// Initializes a new instance of the class with the specified . - /// - /// The that the commands run on. - /// is null. - /// has already been disposed of. - public TagCommand(MediaDatabase database) : base(database) - { - } - - /// - /// Retrieves the number of tags. - /// - /// The number of tags. - /// The is disconnected. - /// The has already been disposed of. - /// An error occurred while executing the command. - public int Count() - { - return Count(arguments: null); - } - - /// - /// Retrieves the number of tags with the . - /// - /// The criteria to use to filter. This value can be null. - /// The number of tags filtered. - /// The is disconnected. - /// The has already been disposed of. - /// An error occurred while executing the command. - public int Count(CountArguments arguments) - { - ValidateDatabase(); - - return CommandHelper.Count(Interop.Tag.GetTagCount, arguments); - } - - - /// - /// Deletes a tag from the database. - /// - /// http://tizen.org/privilege/content.write - /// The tag ID to delete. - /// true if the matched record was found and deleted, otherwise false. - /// The is disconnected. - /// The has already been disposed of. - /// An error occurred while executing the command. - /// is less than or equal to zero. - /// The caller has no required privilege. - public bool Delete(int tagId) - { - ValidateDatabase(); - - if (tagId <= 0) - { - throw new ArgumentOutOfRangeException(nameof(tagId), tagId, - "Tag id can't be less than or equal to zero."); - } - - if (CommandHelper.Count(Interop.Tag.GetTagCount, $"{TagColumns.Id}={tagId}") == 0) - { - return false; - } - - CommandHelper.Delete(Interop.Tag.Delete, tagId); - return true; - } - - - /// - /// Inserts a tag into the database with the specified name. - /// - /// http://tizen.org/privilege/content.write - /// The name of tag. - /// The instance that contains the record information inserted. - /// The is disconnected. - /// The has already been disposed of. - /// An error occurred while executing the command. - /// is null. - /// The caller has no required privilege. - public Tag Insert(string name) - { - ValidateDatabase(); - - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - if (name.Length == 0) - { - throw new ArgumentException("Tag name can't be an empty string."); - } - - Interop.Tag.Insert(name, out var handle).ThrowIfError("Failed to insert a new tag"); - - try - { - return new Tag(handle); - } - finally - { - Interop.Tag.Destroy(handle); - } - } - - /// - /// Updates a tag with the specified name. - /// - /// http://tizen.org/privilege/content.write - /// The tag ID to update. - /// The new name. - /// true if the matched record was found and updated, otherwise false. - /// The is disconnected. - /// The has already been disposed of. - /// An error occurred while executing the command. - /// is null. - /// is less than or equal to zero. - /// The caller has no required privilege. - public bool UpdateName(int tagId, string name) - { - ValidateDatabase(); - - if (tagId <= 0) - { - throw new ArgumentOutOfRangeException(nameof(tagId), tagId, - "Tag id can't be less than or equal to zero."); - } - - if (name == null) - { - throw new ArgumentNullException(nameof(name)); - } - - if (CommandHelper.Count(Interop.Tag.GetTagCount, $"{TagColumns.Id}={tagId}") == 0) - { - return false; - } - - Interop.Tag.Create(out var handle).ThrowIfError("Failed to update"); - - try - { - Interop.Tag.SetName(handle, name).ThrowIfError("Failed to update"); - Interop.Tag.Update(tagId, handle).ThrowIfError("Failed to update"); - - return true; - } - finally - { - Interop.Tag.Destroy(handle); - } - } - - /// - /// Retrieves the tag with the specified ID. - /// - /// The tag ID to select. - /// The instance if the matched record was found in the database, otherwise null. - /// The is disconnected. - /// The has already been disposed of. - /// An error occurred while executing the command. - /// is less than or equal to zero. - public Tag Select(int tagId) - { - ValidateDatabase(); - - if (tagId <= 0) - { - throw new ArgumentOutOfRangeException(nameof(tagId), tagId, - "Tag id can't be less than or equal to zero."); - } - - IntPtr handle = IntPtr.Zero; - - try - { - Interop.Tag.GetTagFromDb(tagId, out handle).ThrowIfError("Failed to query"); - - if (handle == IntPtr.Zero) - { - return null; - } - return new Tag(handle); - } - finally - { - if (handle != IntPtr.Zero) - { - Interop.Tag.Destroy(handle); - } - } - - } - - /// - /// Retrieves all the tags. - /// - /// The containing the results. - /// The is disconnected. - /// The has already been disposed of. - /// An error occurred while executing the command. - public MediaDataReader Select() - { - return Select(arguments: null); - } - - /// - /// Retrieves the tags with the . - /// - /// The criteria to use to filter. This value can be null. - /// The containing the results. - /// The is disconnected. - /// The has already been disposed of. - /// An error occurred while executing the command. - public MediaDataReader Select(SelectArguments arguments) - { - ValidateDatabase(); - - return CommandHelper.Select(arguments, Interop.Tag.ForeachTagFromDb, Tag.FromHandle); - } - - /// - /// Retrieves the number of media info of the tag. - /// - /// The tag ID. - /// The number of the media information. - /// The is disconnected. - /// The has already been disposed of. - /// An error occurred while executing the command. - /// is less than or equal to zero. - public int CountMedia(int tagId) - { - return CountMedia(tagId, null); - } - - /// - /// Retrieves the number of the media information of the tag with the . - /// - /// The tag ID to query with. - /// The criteria to use to filter. This value can be null. - /// The number of the media information. - /// The is disconnected. - /// The has already been disposed of. - /// An error occurred while executing the command. - /// is less than or equal to zero. - public int CountMedia(int tagId, CountArguments arguments) - { - ValidateDatabase(); - - if (tagId <= 0) - { - throw new ArgumentOutOfRangeException(nameof(tagId), tagId, - "Tag id can't be less than or equal to zero."); - } - - return CommandHelper.Count(Interop.Tag.GetMediaCount, tagId, arguments); - } - - /// - /// Retrieves the media information of the tag. - /// - /// The tag ID. - /// The containing the results. - /// The is disconnected. - /// The has already been disposed of. - /// An error occurred while executing the command. - /// is less than or equal to zero. - public MediaDataReader SelectMedia(int tagId) - { - return SelectMedia(tagId, null); - } - - /// - /// Retrieves the media information of the tag with the . - /// - /// The tag ID. - /// The criteria to use to filter. This value can be null. - /// The containing the results. - /// The is disconnected. - /// The has already been disposed of. - /// An error occurred while executing the command. - /// is less than or equal to zero. - public MediaDataReader SelectMedia(int tagId, SelectArguments filter) - { - ValidateDatabase(); - - if (tagId <= 0) - { - throw new ArgumentOutOfRangeException(nameof(tagId), tagId, - "Tag id can't be less than or equal to zero."); - } - - return CommandHelper.SelectMedia(Interop.Tag.ForeachMediaFromDb, tagId, filter); - } - - private bool UpdateMember(int tagId, IEnumerable mediaIds, - Func func) - { - ValidateDatabase(); - - if (tagId <= 0) - { - throw new ArgumentOutOfRangeException(nameof(tagId), tagId, - "Tag id can't be less than or equal to zero."); - } - - if (mediaIds == null) - { - throw new ArgumentNullException(nameof(mediaIds)); - } - - if (mediaIds.Count() == 0) - { - throw new ArgumentException("mediaIds has no element.", nameof(mediaIds)); - } - - if (CommandHelper.Count(Interop.Tag.GetTagCount, $"{TagColumns.Id}={tagId}") == 0) - { - return false; - } - - IntPtr handle = IntPtr.Zero; - Interop.Tag.Create(out handle).ThrowIfError("Failed to initialize update member operation"); - - try - { - foreach (var mediaId in mediaIds) - { - if (mediaId == null) - { - throw new ArgumentException("Media id should not be null.", nameof(mediaIds)); - } - - if (string.IsNullOrWhiteSpace(mediaId)) - { - throw new ArgumentException("Media id should not be a zero-length string.", nameof(mediaId)); - } - - func(handle, mediaId).ThrowIfError("Failed to update member"); - } - - Interop.Tag.Update(tagId, handle).ThrowIfError("Failed to run member update"); - return true; - } - finally - { - if (handle != IntPtr.Zero) - { - Interop.Tag.Destroy(handle); - } - } - } - - /// - /// Adds the media to a tag. - /// - /// The tag ID that the media will be added to. - /// The media ID to add to the tag. - /// true if the matched record was found and updated, otherwise false. - /// The invalid media ID will be ignored. - /// The is disconnected. - /// The has already been disposed of. - /// An error occurred while executing the command. - /// is null. - /// is a zero-length string, contains only white space. - /// is less than or equal to zero. - public bool AddMedia(int tagId, string mediaId) - { - ValidationUtil.ValidateNotNullOrEmpty(mediaId, nameof(mediaId)); - - return AddMedia(tagId, new string[] { mediaId }); - } - - /// - /// Adds the media set to a tag. - /// - /// The tag ID that the media will be added to. - /// The media ID to add to the tag. - /// true if the matched record was found and updated, otherwise false. - /// The invalid media IDs will be ignored. - /// The is disconnected. - /// The has already been disposed of. - /// An error occurred while executing the command. - /// is null. - /// - /// has no element.\n - /// -or-\n - /// contains null value.\n - /// -or-\n - /// contains a zero-length string, contains only white space.\n - /// - /// is less than or equal to zero. - public bool AddMedia(int tagId, IEnumerable mediaIds) - { - return UpdateMember(tagId, mediaIds, Interop.Tag.AddMedia); - } - - /// - /// Removes the media from a tag. - /// - /// The tag ID. - /// The media ID to remove from the tag. - /// true if the matched record was found and updated, otherwise false. - /// The invalid media ID will be ignored. - /// The is disconnected. - /// The has already been disposed of. - /// An error occurred while executing the command. - /// is null. - /// is a zero-length string, contains only white space. - /// is less than or equal to zero. - public bool RemoveMedia(int tagId, string mediaId) - { - ValidationUtil.ValidateNotNullOrEmpty(mediaId, nameof(mediaId)); - - return RemoveMedia(tagId, new string[] { mediaId }); - } - - /// - /// Removes the media set from a tag. - /// - /// The tag ID. - /// The collection of media ID to remove from the tag. - /// true if the matched record was found and updated, otherwise false. - /// The invalid IDs will be ignored. - /// The is disconnected. - /// The has already been disposed of. - /// An error occurred while executing the command. - /// is null. - /// - /// has no element.\n - /// -or-\n - /// contains null value.\n - /// -or-\n - /// contains a zero-length string or white space.\n - /// - /// is less than or equal to zero. - public bool RemoveMedia(int tagId, IEnumerable mediaIds) - { - return UpdateMember(tagId, mediaIds, Interop.Tag.RemoveMedia); - } - } -} diff --git a/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/UnsupportedContentException.cs b/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/UnsupportedContentException.cs deleted file mode 100644 index a0b1b691f..000000000 --- a/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/UnsupportedContentException.cs +++ /dev/null @@ -1,51 +0,0 @@ -/* - * 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.Content.MediaContent -{ - /// - /// The exception that is thrown when a requested operation is not supported for content. - /// - public class UnsupportedContentException : Exception - { - /// - /// Initializes a new instance of the class. - /// - public UnsupportedContentException() : base("The operation is not supported for the given media.") - { - } - - /// - /// Initializes a new instance of the class with a specified error message. - /// - /// The message that describes the error. - public UnsupportedContentException(string message) : base(message) - { - } - - /// - /// Initializes a new instance of the class with a specified error message - /// and a reference to the inner exception that is the cause of this exception. - /// - /// The message that describes the error. - /// The exception that is the cause of the current exception. - public UnsupportedContentException(string message, Exception innerException) : base(message, innerException) - { - } - } -} diff --git a/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/ValdiationUtil.cs b/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/ValdiationUtil.cs deleted file mode 100644 index 30c3644a3..000000000 --- a/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/ValdiationUtil.cs +++ /dev/null @@ -1,44 +0,0 @@ -/* - * 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.Content.MediaContent -{ - internal static class ValidationUtil - { - internal static void ValidateEnum(Type enumType, object value, string paramName) - { - if (!Enum.IsDefined(enumType, value)) - { - throw new ArgumentException($"Invalid { enumType.Name } value : { value }", paramName); - } - } - - internal static void ValidateNotNullOrEmpty(string value, string paramName) - { - if (value == null) - { - throw new ArgumentNullException(paramName); - } - - if (string.IsNullOrWhiteSpace(value)) - { - throw new ArgumentException($"{paramName} is a zero-length string.", paramName); - } - } - } -} diff --git a/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/VideoInfo.cs b/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/VideoInfo.cs deleted file mode 100644 index bca5890f5..000000000 --- a/src/Tizen.Content.MediaContent/Tizen.Content.MediaContent/VideoInfo.cs +++ /dev/null @@ -1,137 +0,0 @@ -/* - * 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.Diagnostics; - -namespace Tizen.Content.MediaContent -{ - /// - /// Represents a video media information. - /// - public class VideoInfo : MediaInfo - { - internal VideoInfo(Interop.MediaInfoHandle handle) : base(handle) - { - IntPtr videoHandle = IntPtr.Zero; - - try - { - Interop.MediaInfo.GetVideo(handle, out videoHandle).ThrowIfError("Failed to retrieve data"); - - Debug.Assert(videoHandle != IntPtr.Zero); - - Album = InteropHelper.GetString(videoHandle, Interop.VideoInfo.GetAlbum); - Artist = InteropHelper.GetString(videoHandle, Interop.VideoInfo.GetArtist); - AlbumArtist = InteropHelper.GetString(videoHandle, Interop.VideoInfo.GetAlbumArtist); - Genre = InteropHelper.GetString(videoHandle, Interop.VideoInfo.GetGenre); - Composer = InteropHelper.GetString(videoHandle, Interop.VideoInfo.GetComposer); - Year = InteropHelper.GetString(videoHandle, Interop.VideoInfo.GetYear); - DateRecorded = InteropHelper.GetString(videoHandle, Interop.VideoInfo.GetRecordedDate); - Copyright = InteropHelper.GetString(videoHandle, Interop.VideoInfo.GetCopyright); - TrackNumber = InteropHelper.GetString(videoHandle, Interop.VideoInfo.GetTrackNum); - - BitRate = InteropHelper.GetValue(videoHandle, Interop.VideoInfo.GetBitRate); - Duration = InteropHelper.GetValue(videoHandle, Interop.VideoInfo.GetDuration); - Width = InteropHelper.GetValue(videoHandle, Interop.VideoInfo.GetWidth); - Height = InteropHelper.GetValue(videoHandle, Interop.VideoInfo.GetHeight); - } - finally - { - Interop.VideoInfo.Destroy(videoHandle); - } - } - - /// - /// Gets the album name. - /// - /// The album name from the metadata. - public string Album { get; } - - /// - /// Gets the artist name. - /// - /// The artist name from the metadata. - public string Artist { get; } - - /// - /// Gets the album artist name. - /// - /// The album artist name from the metadata. - public string AlbumArtist { get; } - - /// - /// Gets the genre. - /// - /// The genre name from the metadata. - public string Genre { get; } - - /// - /// Gets the composer name. - /// - /// The composer name from the metadata. - public string Composer { get; } - - /// - /// Gets the year. - /// - /// The year from the metadata. - public string Year { get; } - - /// - /// Gets the recorded date. - /// - /// The recorded date information from the metadata if exists; otherwise, the modified date of the file. - public string DateRecorded { get; } - - /// - /// Gets the copyright notice. - /// - /// The copyright notice from the metadata. - public string Copyright { get; } - - /// - /// Gets the track number. - /// - /// The track number from the metadata. - public string TrackNumber { get; } - - /// - /// Gets the bitrate in bit per second. - /// - /// The bit rate of the video. - public int BitRate { get; } - - /// - /// Gets the track duration in milliseconds. - /// - /// The track duration of the video in milliseconds. - public int Duration { get; } - - /// - /// Gets the video width in pixels. - /// - /// The width of the video in pixels. - public int Width { get; } - - /// - /// Gets the video height in pixels. - /// - /// The height of the video in pixels. - public int Height { get; } - - } -} diff --git a/src/Tizen.Content.MimeType/Interop/Interop.Glib.cs b/src/Tizen.Content.MimeType/Interop/Interop.Glib.cs deleted file mode 100755 index 576a6e287..000000000 --- a/src/Tizen.Content.MimeType/Interop/Interop.Glib.cs +++ /dev/null @@ -1,30 +0,0 @@ -/* - * 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 Glib - { - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool GSourceFunc(IntPtr userData); - - [DllImport(Libraries.Glib, EntryPoint = "g_idle_add", CallingConvention = CallingConvention.Cdecl)] - internal static extern uint IdleAdd(GSourceFunc d, IntPtr data); - } -} diff --git a/src/Tizen.Content.MimeType/Interop/Interop.Libc.cs b/src/Tizen.Content.MimeType/Interop/Interop.Libc.cs deleted file mode 100755 index 825599e27..000000000 --- a/src/Tizen.Content.MimeType/Interop/Interop.Libc.cs +++ /dev/null @@ -1,27 +0,0 @@ -/* - * 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 Libc - { - [DllImport(Libraries.Libc, EntryPoint = "free", CallingConvention = CallingConvention.Cdecl)] - internal static extern int Free(IntPtr ptr); - } -} diff --git a/src/Tizen.Content.MimeType/Interop/Interop.Libraries.cs b/src/Tizen.Content.MimeType/Interop/Interop.Libraries.cs deleted file mode 100755 index 365b82e95..000000000 --- a/src/Tizen.Content.MimeType/Interop/Interop.Libraries.cs +++ /dev/null @@ -1,25 +0,0 @@ -/* - * 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 Mime = "libcapi-content-mime-type.so.0"; - public const string Glib = "libglib-2.0.so.0"; - public const string Libc = "libc.so.6"; - } -} diff --git a/src/Tizen.Content.MimeType/Interop/Interop.Mime.cs b/src/Tizen.Content.MimeType/Interop/Interop.Mime.cs deleted file mode 100755 index 048c77381..000000000 --- a/src/Tizen.Content.MimeType/Interop/Interop.Mime.cs +++ /dev/null @@ -1,36 +0,0 @@ -/* - * 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 Mime - { - [DllImport(Libraries.Mime, EntryPoint = "mime_type_get_mime_type", CallingConvention = CallingConvention.Cdecl)] - internal static extern int GetMime( - [System.Runtime.InteropServices.InAttribute()] - [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.LPStr)] string file_extension - , out string mime_type); - - [DllImport(Libraries.Mime, EntryPoint = "mime_type_get_file_extension", CallingConvention = CallingConvention.Cdecl)] - internal static extern int GetFile( - [System.Runtime.InteropServices.InAttribute()] - [System.Runtime.InteropServices.MarshalAsAttribute(System.Runtime.InteropServices.UnmanagedType.LPStr)] string mime_type - , out System.IntPtr file_extension, out int length); - } -} diff --git a/src/Tizen.Content.MimeType/Tizen.Content.MimeType.csproj b/src/Tizen.Content.MimeType/Tizen.Content.MimeType.csproj deleted file mode 100644 index 7f4584ffe..000000000 --- a/src/Tizen.Content.MimeType/Tizen.Content.MimeType.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - netstandard2.0 - - - - - - - - diff --git a/src/Tizen.Content.MimeType/Tizen.Content.MimeType.sln b/src/Tizen.Content.MimeType/Tizen.Content.MimeType.sln deleted file mode 100755 index e42091e1e..000000000 --- a/src/Tizen.Content.MimeType/Tizen.Content.MimeType.sln +++ /dev/null @@ -1,34 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26430.12 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Content.MimeType", "Tizen.Content.MimeType.csproj", "{8CC8944C-8D75-49ED-9763-536302043697}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen", "..\Tizen\Tizen.csproj", "{B57AB483-78A7-43BC-840F-CAD0836B6018}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Log", "..\Tizen.Log\Tizen.Log.csproj", "{40771996-CF47-4336-A8F1-484F3CA6D996}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {8CC8944C-8D75-49ED-9763-536302043697}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {8CC8944C-8D75-49ED-9763-536302043697}.Debug|Any CPU.Build.0 = Debug|Any CPU - {8CC8944C-8D75-49ED-9763-536302043697}.Release|Any CPU.ActiveCfg = Release|Any CPU - {8CC8944C-8D75-49ED-9763-536302043697}.Release|Any CPU.Build.0 = Release|Any CPU - {B57AB483-78A7-43BC-840F-CAD0836B6018}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B57AB483-78A7-43BC-840F-CAD0836B6018}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B57AB483-78A7-43BC-840F-CAD0836B6018}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B57AB483-78A7-43BC-840F-CAD0836B6018}.Release|Any CPU.Build.0 = Release|Any CPU - {40771996-CF47-4336-A8F1-484F3CA6D996}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {40771996-CF47-4336-A8F1-484F3CA6D996}.Debug|Any CPU.Build.0 = Debug|Any CPU - {40771996-CF47-4336-A8F1-484F3CA6D996}.Release|Any CPU.ActiveCfg = Release|Any CPU - {40771996-CF47-4336-A8F1-484F3CA6D996}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/src/Tizen.Content.MimeType/Tizen.Content.MimeType/MimeExceptionFactory.cs b/src/Tizen.Content.MimeType/Tizen.Content.MimeType/MimeExceptionFactory.cs deleted file mode 100755 index d3161984f..000000000 --- a/src/Tizen.Content.MimeType/Tizen.Content.MimeType/MimeExceptionFactory.cs +++ /dev/null @@ -1,55 +0,0 @@ -/* - * 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.Collections.Generic; -using System.Linq; -using System.Text; - -namespace Tizen.Content.MimeType -{ - internal class MimeExceptionFactory - { - internal static Exception CreateException(MimeUtil.MimeError err) - { - Exception exp; - switch (err) - { - case MimeUtil.MimeError.InvalidParameter: - { - exp = new ArgumentException("Invalid Parameters Provided"); - break; - } - case MimeUtil.MimeError.IoError: - { - exp = new InvalidOperationException("I/O Error Occured"); - break; - } - case MimeUtil.MimeError.OutOfMemory: - { - exp = new InvalidOperationException("Out Of Memory"); - break; - } - default: - { - exp = new InvalidOperationException(""); - break; - } - } - return exp; - } - } -} diff --git a/src/Tizen.Content.MimeType/Tizen.Content.MimeType/MimeUtil.cs b/src/Tizen.Content.MimeType/Tizen.Content.MimeType/MimeUtil.cs deleted file mode 100755 index 98aab3e41..000000000 --- a/src/Tizen.Content.MimeType/Tizen.Content.MimeType/MimeUtil.cs +++ /dev/null @@ -1,96 +0,0 @@ -/* - * 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.Collections.Generic; -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.Runtime.InteropServices; - -namespace Tizen.Content.MimeType -{ - /// - /// The MimeUtil API provides functions to map the MIME types to file extensions and vice versa. - /// - /// Conversions are provided from the file extensions to MIME types and from the MIME types to file extensions. - public static class MimeUtil - { - /// - /// Gets the MIME type for the given file extension. - /// The MIME type is 'application/octet-stream' if the given file extension is not associated with specific file formats. - /// - /// The file extension. - /// - /// - /// string mimeType = MimeUtil.GetMimeType("png"); - /// - /// - public static string GetMimeType(string fileExtension) - { - string mime; - int res = Interop.Mime.GetMime(fileExtension, out mime); - if (res != (int)MimeError.None) - { - throw MimeExceptionFactory.CreateException((MimeError)res); - } - return mime; - } - - /// - /// Gets the file extensions for the given MIME type. - /// - /// If successful, returns the list of file extension strings for the given MIME type. - /// The array of file extension is without the leading dot ('.'). - /// The MIME type. - /// - /// - /// IEnumerable extColl = MimeUtil.GetFileExtension("video/mpeg"); - /// foreach ( string obj in extColl ) - /// { - /// Console.WriteLine(obj); - /// } - /// - /// - public static IEnumerable GetFileExtension(string mime) - { - IntPtr extensionArray = IntPtr.Zero; - int length = -1; - int res = Interop.Mime.GetFile(mime, out extensionArray, out length); - if (res != (int)MimeError.None) - { - throw MimeExceptionFactory.CreateException((MimeError)res); - } - IntPtr[] extensionList = new IntPtr[length]; - Marshal.Copy(extensionArray, extensionList, 0, length); - Collection coll = new Collection(); - foreach (IntPtr extension in extensionList) - { - coll.Add(Marshal.PtrToStringAnsi(extension)); - Interop.Libc.Free(extension); - } - Interop.Libc.Free(extensionArray); - return coll; - } - - internal enum MimeError : int - { - None = Tizen.Internals.Errors.ErrorCode.None, /**< Successful */ - InvalidParameter = Tizen.Internals.Errors.ErrorCode.InvalidParameter, /**< Invalid parameter */ - OutOfMemory = Tizen.Internals.Errors.ErrorCode.OutOfMemory, /**< Out of memory */ - IoError = Tizen.Internals.Errors.ErrorCode.IoError, /**< Internal I/O error */ - } - } -} diff --git a/src/Tizen.Context/Interop/Interop.AppHistory.cs b/src/Tizen.Context/Interop/Interop.AppHistory.cs deleted file mode 100644 index b6cdec222..000000000 --- a/src/Tizen.Context/Interop/Interop.AppHistory.cs +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (c) 2017 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 CtxHistory - { - [DllImport(Library.AppHistory, EntryPoint = "ctx_history_query")] - internal static extern int Query(string uri, Int64 startTime, Int64 endTime, uint resultSize, out IntPtr cursor); - - [DllImport(Library.AppHistory, EntryPoint = "ctx_history_is_supported")] - internal static extern int IsSupported(string subject, out bool supported); - - [DllImport(Library.AppHistory, EntryPoint = "ctx_history_get_last_fully_charged_time")] - internal static extern int GetLastFullyChargedTime(out Int64 timestamp); - - } - internal static partial class CtxHistoryCursor - { - [DllImport(Library.AppHistory, EntryPoint = "ctx_history_cursor_destroy")] - internal static extern void Destroy(IntPtr cursor); - - [DllImport(Library.AppHistory, EntryPoint = "ctx_history_cursor_get_count")] - internal static extern int GetCount(IntPtr cursor, out int count); - - [DllImport(Library.AppHistory, EntryPoint = "ctx_history_cursor_get_position")] - internal static extern int GetPosition(IntPtr cursor, out int position); - - [DllImport(Library.AppHistory, EntryPoint = "ctx_history_cursor_set_position")] - internal static extern int SetPosition(IntPtr cursor, int position); - - [DllImport(Library.AppHistory, EntryPoint = "ctx_history_cursor_first")] - internal static extern int First(IntPtr cursor); - - [DllImport(Library.AppHistory, EntryPoint = "ctx_history_cursor_last")] - internal static extern int Last(IntPtr cursor); - - [DllImport(Library.AppHistory, EntryPoint = "ctx_history_cursor_next")] - internal static extern int Next(IntPtr cursor); - - [DllImport(Library.AppHistory, EntryPoint = "ctx_history_cursor_prev")] - internal static extern int Prev(IntPtr cursor); - - [DllImport(Library.AppHistory, EntryPoint = "ctx_history_cursor_get_int64")] - internal static extern int GetInt64(IntPtr cursor, string key, out Int64 value); - - [DllImport(Library.AppHistory, EntryPoint = "ctx_history_cursor_get_double")] - internal static extern int GetDouble(IntPtr cursor, string key, out double value); - - [DllImport(Library.AppHistory, EntryPoint = "ctx_history_cursor_get_string")] - internal static extern int GetString(IntPtr cursor, string key, out string value); - } -} diff --git a/src/Tizen.Context/Interop/Interop.Libraries.cs b/src/Tizen.Context/Interop/Interop.Libraries.cs deleted file mode 100644 index 8970f55b9..000000000 --- a/src/Tizen.Context/Interop/Interop.Libraries.cs +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2017 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 Library - { - public const string AppHistory = "libcontext-app-history-client.so.4"; - } -} diff --git a/src/Tizen.Context/Tizen.Context.AppHistory/AppHistoryErrorFactory.cs b/src/Tizen.Context/Tizen.Context.AppHistory/AppHistoryErrorFactory.cs deleted file mode 100644 index d99082842..000000000 --- a/src/Tizen.Context/Tizen.Context.AppHistory/AppHistoryErrorFactory.cs +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2017 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.Context.AppHistory -{ - internal enum AppHistoryError - { - None = ErrorCode.None, - InvalidParameter = ErrorCode.InvalidParameter, - OutOfMemory = ErrorCode.OutOfMemory, - PermissionDenied = ErrorCode.PermissionDenied, - NotSupported = ErrorCode.NotSupported, - NoData = ErrorCode.NoData, - OperationFailed = -0x02480000 | 0x04, - } - - internal static class AppHistoryErrorFactory - { - internal const string LogTag = "Tizen.Context.AppHistory"; - - internal static Exception CheckAndThrowException(AppHistoryError error, string msg) - { - switch (error) - { - case AppHistoryError.None: - return null; - case AppHistoryError.InvalidParameter: - return new ArgumentException("Invalid Parameter: " + msg); - case AppHistoryError.OutOfMemory: - return new OutOfMemoryException("Out of Memory: " + msg); - case AppHistoryError.PermissionDenied: - return new UnauthorizedAccessException("Permission Denied: " + msg); - case AppHistoryError.NotSupported: - return new NotSupportedException("Not Supported: " + msg); - case AppHistoryError.OperationFailed: - return new InvalidOperationException("Operation Failed: " + msg); - default: - return new InvalidOperationException("Unknown Error Code: " + msg); - } - } - } -} diff --git a/src/Tizen.Context/Tizen.Context.AppHistory/AppStatistics.cs b/src/Tizen.Context/Tizen.Context.AppHistory/AppStatistics.cs deleted file mode 100644 index c25b49335..000000000 --- a/src/Tizen.Context/Tizen.Context.AppHistory/AppStatistics.cs +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright (c) 2017 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.Context.AppHistory -{ - /// - /// Base class for application statistics. - /// - public abstract class AppStatistics - { - internal const string AppStatsQueryResult = "QueryResult"; - internal const string AppStatsStartTime = "StartTime"; - internal const string AppStatsEndTime = "EndTime"; - internal const string AppStatsResultSize = "ResultSize"; - internal const string AppStatsAppId = "AppId"; - internal const int DefaultResultSize = 5; - - internal string Uri; - - internal AppStatistics() - { - } - - internal static long ConvertDateTimeToUnixTimestamp(DateTime dateTime) - { - DateTime unixStart = new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc); - long unixTimestampInTicks = (dateTime.ToUniversalTime() - unixStart).Ticks; - return unixTimestampInTicks / TimeSpan.TicksPerSecond; - } - - internal static DateTime ConvertUnixTimestampToDateTime(long unixTime) - { - DateTime unixStart = new DateTime(1970, 1, 1, 0, 0, 0, 0, System.DateTimeKind.Utc); - long unixTimeStampInTicks = unixTime * TimeSpan.TicksPerSecond; - return new DateTime(unixStart.Ticks + unixTimeStampInTicks, System.DateTimeKind.Utc).ToLocalTime(); - } - - internal static void CheckTimeSpan(DateTime startTime, DateTime endTime) - { - if (startTime > endTime) - { - Log.Error(AppHistoryErrorFactory.LogTag, "endTime should be greater than startTime"); - throw AppHistoryErrorFactory.CheckAndThrowException(AppHistoryError.InvalidParameter, "endTime should be greater than startTime"); - } - } - - internal static void CheckResultSize(uint resultSize) - { - if (resultSize <= 0) - { - Log.Error(AppHistoryErrorFactory.LogTag, "resultSize should be greater than 0"); - throw AppHistoryErrorFactory.CheckAndThrowException(AppHistoryError.InvalidParameter, "resultSize should be greater than 0"); - } - } - - internal abstract string ConvertSortOrderToString(int order); - } -} diff --git a/src/Tizen.Context/Tizen.Context.AppHistory/AppStatisticsData.cs b/src/Tizen.Context/Tizen.Context.AppHistory/AppStatisticsData.cs deleted file mode 100644 index ed46f8c59..000000000 --- a/src/Tizen.Context/Tizen.Context.AppHistory/AppStatisticsData.cs +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright (c) 2017 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. - */ - -namespace Tizen.Context.AppHistory -{ - /// - /// Base class which contains application statistics query result. - /// - public abstract class AppStatisticsData - { - internal AppStatisticsData() - { - } - - /// - /// Gets the application id. - /// - /// The application id. - public string AppId { get; protected set; } - } -} diff --git a/src/Tizen.Context/Tizen.Context.AppHistory/BatteryStatistics.cs b/src/Tizen.Context/Tizen.Context.AppHistory/BatteryStatistics.cs deleted file mode 100644 index 7f6259062..000000000 --- a/src/Tizen.Context/Tizen.Context.AppHistory/BatteryStatistics.cs +++ /dev/null @@ -1,212 +0,0 @@ -/* - * Copyright (c) 2017 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.Collections.Generic; - -namespace Tizen.Context.AppHistory -{ - /// - /// This class provides APIs to query battery consumption per application. - /// - public class BatteryStatistics : AppStatistics - { - private const string AppStatsConsumption = "TotalAmount"; - - /// - /// The default constructor of BatteryStatistics class. - /// - /// http://tizen.org/feature/app_history - /// http://tizen.org/feature/battery - /// Thrown when method fail due to internal error. - /// Thrown when the features are not supported. - public BatteryStatistics() - { - SortOrder = SortOrderType.ConsumptionMost; - Uri = ConvertSortOrderToString((int)SortOrder); - - bool isSupported = false; - int error = Interop.CtxHistory.IsSupported(Uri, out isSupported); - if ((AppHistoryError)error != AppHistoryError.None) - { - throw AppHistoryErrorFactory.CheckAndThrowException((AppHistoryError)error, Uri); - } - - if (!isSupported) - { - throw AppHistoryErrorFactory.CheckAndThrowException(AppHistoryError.NotSupported, Uri); - } - } - - /// - /// The constructor of BatteryStatistics class. - /// - /// The criteria of the battery statistics sorted by. - /// http://tizen.org/feature/app_history - /// http://tizen.org/feature/battery - /// Thrown when an invalid argument is used. - /// Thrown when method fail due to internal error. - /// Thrown when the features are not supported. - public BatteryStatistics(SortOrderType order) - { - SortOrder = order; - Uri = ConvertSortOrderToString((int)SortOrder); - - if (Uri == null) - { - throw AppHistoryErrorFactory.CheckAndThrowException(AppHistoryError.InvalidParameter, "Invalid SortOrderType"); - } - - bool isSupported = false; - int error = Interop.CtxHistory.IsSupported(Uri, out isSupported); - if ((AppHistoryError)error != AppHistoryError.None) - { - throw AppHistoryErrorFactory.CheckAndThrowException((AppHistoryError)error, Uri); - } - - if (!isSupported) - { - throw AppHistoryErrorFactory.CheckAndThrowException(AppHistoryError.NotSupported, Uri); - } - } - - /// - /// Retrieves a given type of battery statistics. - /// - /// The start time of the data to be aggregated. - /// The end time of the data to be aggregated. - /// Battery statistics data retrieved. - /// http://tizen.org/privilege/apphistory.read - /// http://tizen.org/feature/app_history - /// http://tizen.org/feature/battery - /// Thrown when an invalid argument is used. - /// Thrown when invalid operation occurs. - /// Thrown when the features are not supported. - /// Thrown when the app has no privilege to retrieve app history. - public IReadOnlyList Query(DateTime startTime, DateTime endTime) - { - CheckTimeSpan(startTime, endTime); - - return Query(startTime, endTime, DefaultResultSize); - } - - /// - /// Retrieves a given type of battery statistics. - /// - /// The start time of the data to be aggregated. - /// The end time of the data to be aggregated. - /// The number of data records to be retrieved. - /// Battery statistics data retrieved. - /// http://tizen.org/privilege/apphistory.read - /// http://tizen.org/feature/app_history - /// http://tizen.org/feature/battery - /// Thrown when an invalid argument is used. - /// Thrown when invalid operation occurs. - /// Thrown when the features are not supported. - /// Thrown when the app has no privilege to retrieve app history. - public IReadOnlyList Query(DateTime startTime, DateTime endTime, uint resultSize) - { - CheckTimeSpan(startTime, endTime); - CheckResultSize(resultSize); - - List result = new List(); - - IntPtr cursor = IntPtr.Zero; - int error = Interop.CtxHistory.Query(Uri, (int)ConvertDateTimeToUnixTimestamp(startTime), (int)ConvertDateTimeToUnixTimestamp(endTime), resultSize, out cursor); - if ((AppHistoryError)error == AppHistoryError.NoData) - { - return result.AsReadOnly(); - } - else if ((AppHistoryError)error != AppHistoryError.None) - { - Log.Error(AppHistoryErrorFactory.LogTag, "Failed to request query battery statistics"); - throw AppHistoryErrorFactory.CheckAndThrowException((AppHistoryError)error, "Failed to request query battery statistics"); - } - - int size; - error = Interop.CtxHistoryCursor.GetCount(cursor, out size); - Interop.CtxHistoryCursor.First(cursor); - - for (int i = 0; i < size; i++) - { - result.Add(ConvertOutputToStatsData(cursor)); - Interop.CtxHistoryCursor.Next(cursor); - } - Interop.CtxHistoryCursor.Destroy(cursor); - - return result.AsReadOnly(); - } - - /// - /// Gets the last time when the device was fully charged. - /// - /// The last time when the device was fully charged. - /// http://tizen.org/feature/app_history - /// http://tizen.org/feature/battery - /// Thrown when the statistics is not supported. - public static DateTime GetLastFullyChargedTime() - { - Int64 timestamp; - int error = Interop.CtxHistory.GetLastFullyChargedTime(out timestamp); - if ((AppHistoryError)error != AppHistoryError.None) - { - Log.Error(AppHistoryErrorFactory.LogTag, "Failed to request get last fully charged time"); - throw AppHistoryErrorFactory.CheckAndThrowException((AppHistoryError)error, "Failed to request get last fully charged time"); - } - - return ConvertUnixTimestampToDateTime(timestamp); - } - - internal override string ConvertSortOrderToString(int order) - { - switch ((SortOrderType)order) - { - case SortOrderType.ConsumptionMost: - return "stats/battery/history"; - default: - return null; - } - } - - private static BatteryStatisticsData ConvertOutputToStatsData(IntPtr cursor) - { - string appId; - double consumption; - - Interop.CtxHistoryCursor.GetString(cursor, AppStatsAppId, out appId); - Interop.CtxHistoryCursor.GetDouble(cursor, AppStatsConsumption, out consumption); - - return new BatteryStatisticsData(appId, consumption); - } - - /// - /// Gets the criteria of battery statistics sorted by. - /// - /// The criteria of battery statistics sorted by. - public SortOrderType SortOrder { get; private set; } - - /// - /// Sort order type of battery statistics. - /// - public enum SortOrderType - { - /// - /// Sorts apps by consumption, the most battery consuming apps appear first. (Default) - /// - ConsumptionMost = 0 - } - } -} diff --git a/src/Tizen.Context/Tizen.Context.AppHistory/BatteryStatisticsData.cs b/src/Tizen.Context/Tizen.Context.AppHistory/BatteryStatisticsData.cs deleted file mode 100644 index 9dd6e4c95..000000000 --- a/src/Tizen.Context/Tizen.Context.AppHistory/BatteryStatisticsData.cs +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) 2017 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. - */ - -namespace Tizen.Context.AppHistory -{ - /// - /// The class contains battery statistics information retrieved by BatteryStatistics. - /// - public class BatteryStatisticsData : AppStatisticsData - { - internal BatteryStatisticsData(string appId, double consumption) - { - AppId = appId; - Consumption = consumption; - } - - /// - /// Gets how many percentage of battery capacity was used by the application. - /// - /// Battery consumption used by the application. - public double Consumption { get; private set; } - } -} diff --git a/src/Tizen.Context/Tizen.Context.AppHistory/UsageStatistics.cs b/src/Tizen.Context/Tizen.Context.AppHistory/UsageStatistics.cs deleted file mode 100644 index 9a96f29c8..000000000 --- a/src/Tizen.Context/Tizen.Context.AppHistory/UsageStatistics.cs +++ /dev/null @@ -1,199 +0,0 @@ -/* - * Copyright (c) 2017 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.Collections.Generic; - -namespace Tizen.Context.AppHistory -{ - /// - /// This class provides APIs to query application launch history. - /// - public class UsageStatistics : AppStatistics - { - private const string AppStatsDuration = "TotalDuration"; - private const string AppStatsLaunchCount = "TotalCount"; - private const string AppStatsLastLaunchTime = "LastTime"; - - /// - /// The default constructor of UsageStatistics class. - /// - /// http://tizen.org/feature/app_history - /// Thrown when method fail due to internal error. - /// Thrown when the feature is not supported. - public UsageStatistics() - { - SortOrder = SortOrderType.LastLaunchTimeNewest; - Uri = ConvertSortOrderToString((int)SortOrder); - - bool isSupported = false; - int error = Interop.CtxHistory.IsSupported(Uri, out isSupported); - if ((AppHistoryError)error != AppHistoryError.None) - { - throw AppHistoryErrorFactory.CheckAndThrowException((AppHistoryError)error, Uri); - } - - if (!isSupported) - { - throw AppHistoryErrorFactory.CheckAndThrowException(AppHistoryError.OperationFailed, Uri); - } - } - - /// - /// The constructor of UsageStatistics class. - /// - /// The criteria of the usage statistics sorted by. - /// http://tizen.org/feature/app_history - /// Thrown when an invalid argument is used. - /// Thrown when method fail due to internal error. - /// Thrown when the feature is not supported. - public UsageStatistics(SortOrderType order) - { - SortOrder = order; - Uri = ConvertSortOrderToString((int)SortOrder); - - if (Uri== null) - { - throw AppHistoryErrorFactory.CheckAndThrowException(AppHistoryError.InvalidParameter, "Invalid SortOrderType"); - } - - bool isSupported = false; - int error = Interop.CtxHistory.IsSupported(Uri, out isSupported); - if ((AppHistoryError)error != AppHistoryError.None) - { - throw AppHistoryErrorFactory.CheckAndThrowException((AppHistoryError)error, Uri); - } - - if (!isSupported) - { - throw AppHistoryErrorFactory.CheckAndThrowException(AppHistoryError.OperationFailed, Uri); - } - } - - /// - /// Retrieves a given type of usage statistics. - /// - /// The start time of the data to be aggregated. - /// The end time of the data to be aggregated. - /// Usage statistics data retrieved. - /// http://tizen.org/privilege/apphistory.read - /// http://tizen.org/feature/app_history - /// Thrown when an invalid argument is used. - /// Thrown when invalid operation occurs. - /// Thrown when the feature is not supported. - /// Thrown when the app has no privilege to retrieve app history. - public IReadOnlyList Query(DateTime startTime, DateTime endTime) - { - CheckTimeSpan(startTime, endTime); - - return Query(startTime, endTime, DefaultResultSize); - } - - /// - /// Retrieves a given type of usage statistics. - /// - /// The start time of the data to be aggregated. - /// The end time of the data to be aggregated. - /// The number of data records to be retrieved. - /// Usage statistics data retrieved. - /// http://tizen.org/privilege/apphistory.read - /// http://tizen.org/feature/app_history - /// Thrown when an invalid argument is used. - /// Thrown when invalid operation occurs. - /// Thrown when the feature is not supported. - /// Thrown when the app has no privilege to retrieve app history. - public IReadOnlyList Query(DateTime startTime, DateTime endTime, uint resultSize) - { - CheckTimeSpan(startTime, endTime); - CheckResultSize(resultSize); - - List result = new List(); - - IntPtr cursor = IntPtr.Zero; - int error = Interop.CtxHistory.Query(Uri, ConvertDateTimeToUnixTimestamp(startTime), ConvertDateTimeToUnixTimestamp(endTime), resultSize, out cursor); - if ((AppHistoryError)error == AppHistoryError.NoData) - { - return result.AsReadOnly(); - } else if ((AppHistoryError)error != AppHistoryError.None) - { - Log.Error(AppHistoryErrorFactory.LogTag, "Failed to request query usage statistics"); - throw AppHistoryErrorFactory.CheckAndThrowException((AppHistoryError)error, "Failed to request query usage statistics"); - } - - int size; - error = Interop.CtxHistoryCursor.GetCount(cursor, out size); - Interop.CtxHistoryCursor.First(cursor); - - for (int i = 0; i < size; i++) - { - result.Add(ConvertOutputToStatsData(cursor)); - Interop.CtxHistoryCursor.Next(cursor); - } - Interop.CtxHistoryCursor.Destroy(cursor); - - return result.AsReadOnly(); - } - - internal override string ConvertSortOrderToString(int order) - { - switch ((SortOrderType)order) - { - case SortOrderType.LastLaunchTimeNewest: - return "stats/app/recently"; - case SortOrderType.LaunchCountMost: - return "stats/app/often"; - default: - return null; - } - } - - private static UsageStatisticsData ConvertOutputToStatsData(IntPtr cursor) - { - string appId; - Int64 duration = 1; - Int64 launchCount = 1; - Int64 lastLaunchTime; - - Interop.CtxHistoryCursor.GetString(cursor, AppStatsAppId, out appId); - Interop.CtxHistoryCursor.GetInt64(cursor, AppStatsDuration, out duration); - Interop.CtxHistoryCursor.GetInt64(cursor, AppStatsLaunchCount, out launchCount); - Interop.CtxHistoryCursor.GetInt64(cursor, AppStatsLastLaunchTime, out lastLaunchTime); - - return new UsageStatisticsData(appId, (int)duration, (int)launchCount, ConvertUnixTimestampToDateTime(lastLaunchTime)); - } - - /// - /// Gets the criteria of usage statistics sorted by. - /// - /// The criteria of usage statistics sorted by. - public SortOrderType SortOrder { get; private set; } - - /// - /// Sort order type of usage statistics - /// - public enum SortOrderType - { - /// - /// Sorts apps by the last launch time, the most recently launched apps appear first. (Default) - /// - LastLaunchTimeNewest = 0, - /// - /// Sorts apps by the launch count of being launched, the most frequently launched apps appear first. - /// - LaunchCountMost - } - } -} diff --git a/src/Tizen.Context/Tizen.Context.AppHistory/UsageStatisticsData.cs b/src/Tizen.Context/Tizen.Context.AppHistory/UsageStatisticsData.cs deleted file mode 100644 index c090e9018..000000000 --- a/src/Tizen.Context/Tizen.Context.AppHistory/UsageStatisticsData.cs +++ /dev/null @@ -1,52 +0,0 @@ -/* - * Copyright (c) 2017 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.Context.AppHistory -{ - /// - /// The class contains application usage statistics information retrieved by UsageStatistics. - /// - public class UsageStatisticsData : AppStatisticsData - { - internal UsageStatisticsData(string appId, int duration, int launchCount, DateTime lastLaunchTime) - { - AppId = appId; - Duration = duration; - LaunchCount = launchCount; - LastLaunchTime = lastLaunchTime; - } - - /// - /// Gets the time which the application is being displayed in the foreground in seconds. - /// - /// Duration which the application is used in the foreground in seconds. - public int Duration { get; private set; } - - /// - /// Gets how many times the application is used in the foreground. - /// - /// How many times the application is used in the foreground. - public int LaunchCount { get; private set; } - - /// - /// Gets the last time when the application has been used. - /// - /// The last time when the application has been used. - public DateTime LastLaunchTime { get; private set; } - } -} diff --git a/src/Tizen.Context/Tizen.Context.csproj b/src/Tizen.Context/Tizen.Context.csproj deleted file mode 100644 index 7f4584ffe..000000000 --- a/src/Tizen.Context/Tizen.Context.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - netstandard2.0 - - - - - - - - diff --git a/src/Tizen.Context/Tizen.Context.sln b/src/Tizen.Context/Tizen.Context.sln deleted file mode 100755 index d898ec91a..000000000 --- a/src/Tizen.Context/Tizen.Context.sln +++ /dev/null @@ -1,34 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26430.12 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Context", "Tizen.Context.csproj", "{889CEA8B-5F27-4744-81E1-93AEB9A9D99A}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen", "..\Tizen\Tizen.csproj", "{97D7D638-8AF5-4D07-83DC-A613285D77B2}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Log", "..\Tizen.Log\Tizen.Log.csproj", "{CEC858B1-A52B-479A-8BF4-2691CCB64719}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {889CEA8B-5F27-4744-81E1-93AEB9A9D99A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {889CEA8B-5F27-4744-81E1-93AEB9A9D99A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {889CEA8B-5F27-4744-81E1-93AEB9A9D99A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {889CEA8B-5F27-4744-81E1-93AEB9A9D99A}.Release|Any CPU.Build.0 = Release|Any CPU - {97D7D638-8AF5-4D07-83DC-A613285D77B2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {97D7D638-8AF5-4D07-83DC-A613285D77B2}.Debug|Any CPU.Build.0 = Debug|Any CPU - {97D7D638-8AF5-4D07-83DC-A613285D77B2}.Release|Any CPU.ActiveCfg = Release|Any CPU - {97D7D638-8AF5-4D07-83DC-A613285D77B2}.Release|Any CPU.Build.0 = Release|Any CPU - {CEC858B1-A52B-479A-8BF4-2691CCB64719}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {CEC858B1-A52B-479A-8BF4-2691CCB64719}.Debug|Any CPU.Build.0 = Debug|Any CPU - {CEC858B1-A52B-479A-8BF4-2691CCB64719}.Release|Any CPU.ActiveCfg = Release|Any CPU - {CEC858B1-A52B-479A-8BF4-2691CCB64719}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/src/Tizen.Convergence/Interop/Interop.Common.cs b/src/Tizen.Convergence/Interop/Interop.Common.cs deleted file mode 100755 index bad120bd0..000000000 --- a/src/Tizen.Convergence/Interop/Interop.Common.cs +++ /dev/null @@ -1,41 +0,0 @@ -// Copyright 2016 by Samsung Electronics, Inc., -// -// This software is the confidential and proprietary information -// of Samsung Electronics, Inc. ("Confidential Information"). You -// shall not disclose such Confidential Information and shall use -// it only in accordance with the terms of the license agreement -// you entered into with Samsung. - -using System; -using System.Runtime.InteropServices; - -internal static partial class Interop -{ - internal abstract class TizenSafeHandle : SafeHandle - { - public abstract void Destroy(); - - public TizenSafeHandle() : base(IntPtr.Zero, true) - { - } - - public TizenSafeHandle(IntPtr handle) : base(handle, true) - { - } - - public override bool IsInvalid - { - get - { - return handle == IntPtr.Zero; - } - } - - protected override bool ReleaseHandle() - { - Destroy(); - SetHandle(IntPtr.Zero); - return true; - } - } -} diff --git a/src/Tizen.Convergence/Interop/Interop.Internal.Conv.Channel.cs b/src/Tizen.Convergence/Interop/Interop.Internal.Conv.Channel.cs deleted file mode 100755 index 4a8a2823f..000000000 --- a/src/Tizen.Convergence/Interop/Interop.Internal.Conv.Channel.cs +++ /dev/null @@ -1,67 +0,0 @@ -// Copyright 2016 by Samsung Electronics, Inc., -// -// This software is the confidential and proprietary information -// of Samsung Electronics, Inc. ("Confidential Information"). You -// shall not disclose such Confidential Information and shall use -// it only in accordance with the terms of the license agreement -// you entered into with Samsung. - -using System; -using System.Runtime.InteropServices; -using Tizen; -using Tizen.Convergence; - -internal static partial class Interop -{ - internal static partial class Internal - { - internal static partial class ConvChannel - { - [DllImport(Libraries.Convergence, EntryPoint = "conv_channel_create")] - internal static extern int Create(out ConvChannelHandle /* conv_channel_h */ handle); - - [DllImport(Libraries.Convergence, EntryPoint = "conv_channel_destroy")] - internal static extern int Destroy(IntPtr /* conv_channel_h */ handle); - - [DllImport(Libraries.Convergence, EntryPoint = "conv_channel_get_string")] - internal static extern int GetString(ConvChannelHandle /* conv_channel_h */ handle, string key, out IntPtr value); - - [DllImport(Libraries.Convergence, EntryPoint = "conv_channel_set_string")] - internal static extern int SetString(ConvChannelHandle /* conv_channel_h */ handle, string key, string value); - } - - internal class ConvChannelHandle : TizenSafeHandle - { - private bool _ownsHandle = true; - - public ConvChannelHandle(): base() - { - - } - - public ConvChannelHandle(IntPtr handle) - : base(handle) - { - } - - public ConvChannelHandle(IntPtr handle, bool ownsHandle) - : base(handle) - { - _ownsHandle = ownsHandle; - } - - public override void Destroy() - { - if (_ownsHandle && handle != IntPtr.Zero) - { - var err = ConvChannel.Destroy(this.handle); - if (err != (int)ConvErrorCode.None) - { - Log.Error(ErrorFactory.LogTag, "Failed to destroy conv channel handle"); - throw ErrorFactory.GetException(err); - } - } - } - } - } -} diff --git a/src/Tizen.Convergence/Interop/Interop.Internal.Conv.Device.cs b/src/Tizen.Convergence/Interop/Interop.Internal.Conv.Device.cs deleted file mode 100755 index cbee84962..000000000 --- a/src/Tizen.Convergence/Interop/Interop.Internal.Conv.Device.cs +++ /dev/null @@ -1,62 +0,0 @@ -// Copyright 2016 by Samsung Electronics, Inc., -// -// This software is the confidential and proprietary information -// of Samsung Electronics, Inc. ("Confidential Information"). You -// shall not disclose such Confidential Information and shall use -// it only in accordance with the terms of the license agreement -// you entered into with Samsung. - -using System; -using System.Runtime.InteropServices; -using Tizen; -using Tizen.Convergence; - -internal static partial class Interop -{ - internal static partial class Internal - { - internal static partial class ConvDevice - { - [DllImport(Libraries.Convergence, EntryPoint = "conv_device_clone")] - internal static extern int Clone(IntPtr /* conv_device_h */ originalHandle, out ConvDeviceHandle /* conv_device_h */ targetHandle); - - [DllImport(Libraries.Convergence, EntryPoint = "conv_device_destroy")] - internal static extern int Destroy(IntPtr /* conv_device_h */ handle); - - [DllImport(Libraries.Convergence, EntryPoint = "conv_device_get_property_string")] - internal static extern int GetPropertyString(ConvDeviceHandle /* conv_device_h */ handle, string key, out IntPtr value); - - [DllImport(Libraries.Convergence, EntryPoint = "conv_device_foreach_service")] - internal static extern int ForeachService(ConvDeviceHandle /* conv_device_h */ handle, ConvServiceForeachCallback cb, IntPtr /* void */ userData); - - [UnmanagedFunctionPointerAttribute(CallingConvention.Cdecl)] - internal delegate void ConvServiceForeachCallback(IntPtr serviceHandle, IntPtr /* void */ userData); - } - - internal class ConvDeviceHandle : TizenSafeHandle - { - public ConvDeviceHandle() : base() - { - - } - - public ConvDeviceHandle(IntPtr handle) - : base(handle) - { - } - - public override void Destroy() - { - if (handle != IntPtr.Zero) - { - var err = ConvDevice.Destroy(this.handle); - if (err != (int)ConvErrorCode.None) - { - Log.Error(ErrorFactory.LogTag, "Failed to destroy conv device handle"); - throw ErrorFactory.GetException(err); - } - } - } - } - } -} diff --git a/src/Tizen.Convergence/Interop/Interop.Internal.Conv.Manager.cs b/src/Tizen.Convergence/Interop/Interop.Internal.Conv.Manager.cs deleted file mode 100755 index cfdc9e562..000000000 --- a/src/Tizen.Convergence/Interop/Interop.Internal.Conv.Manager.cs +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright 2016 by Samsung Electronics, Inc., -// -// This software is the confidential and proprietary information -// of Samsung Electronics, Inc. ("Confidential Information"). You -// shall not disclose such Confidential Information and shall use -// it only in accordance with the terms of the license agreement -// you entered into with Samsung. - -using System; -using System.Runtime.InteropServices; -using Tizen; -using Tizen.Convergence; - -internal static partial class Interop -{ - internal static partial class Internal - { - public enum ConvDiscoveryResult - { - /// - /// Discovery Error - /// - Error = -1, - /// - /// Discovery Success - /// - Success = 0, - /// - /// Discovery finished - /// - Finished, - /// - /// Discovery lost - /// - Lost, - } - - internal static partial class ConvManager - { - [DllImport(Libraries.Convergence, EntryPoint = "conv_create")] - internal static extern int ConvCreate(out ConvManagerHandle /* conv_h */ handle); - - [DllImport(Libraries.Convergence, EntryPoint = "conv_destroy")] - internal static extern int ConvDestroy(IntPtr /* conv_h */ handle); - - [DllImport(Libraries.Convergence, EntryPoint = "conv_discovery_start")] - internal static extern int ConvDiscoveryStart(ConvManagerHandle /* conv_h */ handle, int timeoutSeconds, ConvDiscoveryCallback callback, IntPtr /* void */ userData); - - [DllImport(Libraries.Convergence, EntryPoint = "conv_discovery_stop")] - internal static extern int ConvDiscoveryStop(ConvManagerHandle /* conv_h */ handle); - - [UnmanagedFunctionPointerAttribute(CallingConvention.Cdecl)] - internal delegate void ConvDiscoveryCallback(IntPtr /* conv_device_h */ deviceHandle, ConvDiscoveryResult /* conv_discovery_result_e */ result, IntPtr /* void */ userData); - } - - internal class ConvManagerHandle : TizenSafeHandle - { - public ConvManagerHandle() : base() - { - - } - - public ConvManagerHandle(IntPtr handle) - : base(handle) - { - } - - public override void Destroy() - { - var err = ConvManager.ConvDestroy(this.handle); - if (err != (int)ConvErrorCode.None) - { - Log.Error(ErrorFactory.LogTag, "Failed to destroy conv manager handle"); - throw ErrorFactory.GetException(err); - } - } - } - } -} \ No newline at end of file diff --git a/src/Tizen.Convergence/Interop/Interop.Internal.Conv.Payload.cs b/src/Tizen.Convergence/Interop/Interop.Internal.Conv.Payload.cs deleted file mode 100755 index 902e5e018..000000000 --- a/src/Tizen.Convergence/Interop/Interop.Internal.Conv.Payload.cs +++ /dev/null @@ -1,79 +0,0 @@ -// Copyright 2016 by Samsung Electronics, Inc., -// -// This software is the confidential and proprietary information -// of Samsung Electronics, Inc. ("Confidential Information"). You -// shall not disclose such Confidential Information and shall use -// it only in accordance with the terms of the license agreement -// you entered into with Samsung. - -using System; -using System.Runtime.InteropServices; -using Tizen; -using Tizen.Convergence; - -internal static partial class Interop -{ - internal static partial class Internal - { - internal static partial class ConvPayload - { - [DllImport(Libraries.Convergence, EntryPoint = "conv_payload_create")] - internal static extern int Create(out ConvPayloadHandle /* conv_payload_h */ handle); - - [DllImport(Libraries.Convergence, EntryPoint = "conv_payload_destroy")] - internal static extern int Destroy(IntPtr /* conv_payload_h */ handle); - - [DllImport(Libraries.Convergence, EntryPoint = "conv_payload_set_string")] - internal static extern int SetString(ConvPayloadHandle /* conv_payload_h */ handle, string key, string value); - - [DllImport(Libraries.Convergence, EntryPoint = "conv_payload_get_string")] - internal static extern int GetString(ConvPayloadHandle /* conv_payload_h */ handle, string key, out IntPtr value); - - [DllImport(Libraries.Convergence, EntryPoint = "conv_payload_set_byte")] - internal static extern int SetByte(ConvPayloadHandle /* conv_payload_h */ handle, string key, int length, byte[] value); - - [DllImport(Libraries.Convergence, EntryPoint = "conv_payload_get_byte")] - internal static extern int GetByte(ConvPayloadHandle /* conv_payload_h */ handle, string key, out int length, out IntPtr value); - - [DllImport(Libraries.Convergence, EntryPoint = "conv_payload_set_binary")] - internal static extern int SetBinary(ConvPayloadHandle /* conv_payload_h */ handle, int length, byte[] value); - - [DllImport(Libraries.Convergence, EntryPoint = "conv_payload_get_binary")] - internal static extern int GetBinary(ConvPayloadHandle /* conv_payload_h */ handle, out int length, out IntPtr value); - } - - internal class ConvPayloadHandle : TizenSafeHandle - { - private bool _ownsHandle = true; - - public ConvPayloadHandle(): base() - { - - } - - public ConvPayloadHandle(IntPtr handle) - : base(handle) - { - } - - public ConvPayloadHandle(IntPtr handle, bool ownsHandle) - : base(handle) - { - _ownsHandle = ownsHandle; - } - - public override void Destroy() - { - if (_ownsHandle && handle != IntPtr.Zero) - { - var err = ConvPayload.Destroy(this.handle); - if (err != (int)ConvErrorCode.None) - { - Log.Error(ErrorFactory.LogTag, "Failed to destroy conv payload handle"); - throw ErrorFactory.GetException(err); - } - } - } - } - } -} \ No newline at end of file diff --git a/src/Tizen.Convergence/Interop/Interop.Internal.Conv.Service.cs b/src/Tizen.Convergence/Interop/Interop.Internal.Conv.Service.cs deleted file mode 100755 index e99233add..000000000 --- a/src/Tizen.Convergence/Interop/Interop.Internal.Conv.Service.cs +++ /dev/null @@ -1,107 +0,0 @@ -// Copyright 2016 by Samsung Electronics, Inc., -// -// This software is the confidential and proprietary information -// of Samsung Electronics, Inc. ("Confidential Information"). You -// shall not disclose such Confidential Information and shall use -// it only in accordance with the terms of the license agreement -// you entered into with Samsung. - -using System; -using System.Runtime.InteropServices; -using Tizen; -using Tizen.Convergence; - -internal static partial class Interop -{ - internal static partial class Internal - { - internal enum ServiceType - { - /// - /// Undefined service - /// - None = -1, - - /// - /// App-to-app communication service - /// - AppCommunication = 0, - - /// - /// Remote app-control service - /// - RemoteAppControl, - } - - internal static partial class ConvService - { - [DllImport(Libraries.Convergence, EntryPoint = "conv_service_create")] - internal static extern int Create(out ConvServiceHandle /* conv_service_h */ handle); - - [DllImport(Libraries.Convergence, EntryPoint = "conv_service_clone")] - internal static extern int Clone(IntPtr /* conv_service_h */ originalHandle, out ConvServiceHandle /* conv_service_h */ targetHandle); - - [DllImport(Libraries.Convergence, EntryPoint = "conv_service_destroy")] - internal static extern int Destroy(IntPtr /* conv_service_h */ handle); - - [DllImport(Libraries.Convergence, EntryPoint = "conv_service_get_property_string")] - internal static extern int GetPropertyString(ConvServiceHandle /* conv_service_h */ handle, string key, out IntPtr value); - - [DllImport(Libraries.Convergence, EntryPoint = "conv_service_set_property_string")] - internal static extern int SetPropertyString(ConvServiceHandle /* conv_service_h */ handle, string key, string value); - - [DllImport(Libraries.Convergence, EntryPoint = "conv_service_get_type")] - internal static extern int GetType(IntPtr /* conv_service_h */ handle, out int /* conv_service_e */ value); - - [DllImport(Libraries.Convergence, EntryPoint = "conv_service_set_type")] - internal static extern int SetType(ConvServiceHandle /* conv_service_h */ handle, int /* conv_service_e */ value); - - [DllImport(Libraries.Convergence, EntryPoint = "conv_service_start")] - internal static extern int Start(ConvServiceHandle /* conv_service_h */ handle, ConvChannelHandle channel, ConvPayloadHandle payload); - - [DllImport(Libraries.Convergence, EntryPoint = "conv_service_read")] - internal static extern int Read(ConvServiceHandle /* conv_service_h */ handle, ConvChannelHandle channel, ConvPayloadHandle payload); - - [DllImport(Libraries.Convergence, EntryPoint = "conv_service_publish")] - internal static extern int Publish(ConvServiceHandle /* conv_service_h */ handle, ConvChannelHandle channel, ConvPayloadHandle payload); - - [DllImport(Libraries.Convergence, EntryPoint = "conv_service_stop")] - internal static extern int Stop(ConvServiceHandle /* conv_service_h */ handle, ConvChannelHandle channel, ConvPayloadHandle payload); - - [DllImport(Libraries.Convergence, EntryPoint = "conv_service_set_listener_cb")] - internal static extern int SetListenerCb(ConvServiceHandle /* conv_service_h */ handle, ConvServiceListenerCallback callback, IntPtr /* void */ userData); - - [DllImport(Libraries.Convergence, EntryPoint = "conv_service_unset_listener_cb")] - internal static extern int UnsetListenerCb(ConvServiceHandle /* conv_service_h */ handle); - - [UnmanagedFunctionPointerAttribute(CallingConvention.Cdecl)] - internal delegate void ConvServiceListenerCallback(IntPtr /* conv_service_h */ serviceHandle, IntPtr channelHandle, int error, IntPtr result, IntPtr /* void */ userData); - } - - internal class ConvServiceHandle : TizenSafeHandle - { - public ConvServiceHandle(): base() - { - - } - - public ConvServiceHandle(IntPtr handle) - : base(handle) - { - } - - public override void Destroy() - { - if (handle != IntPtr.Zero) - { - var err = ConvService.Destroy(this.handle); - if (err != (int)ConvErrorCode.None) - { - Log.Error(ErrorFactory.LogTag, "Failed to destroy conv service handle"); - throw ErrorFactory.GetException(err); - } - } - } - } - } -} \ No newline at end of file diff --git a/src/Tizen.Convergence/Interop/Interop.Libc.cs b/src/Tizen.Convergence/Interop/Interop.Libc.cs deleted file mode 100755 index 13c7170a0..000000000 --- a/src/Tizen.Convergence/Interop/Interop.Libc.cs +++ /dev/null @@ -1,27 +0,0 @@ -/* - * 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 Libc - { - [DllImport(Libraries.Libc, EntryPoint = "free", CallingConvention = CallingConvention.Cdecl)] - internal static extern int Free(IntPtr ptr); - } -} diff --git a/src/Tizen.Convergence/Interop/Interop.Libraries.cs b/src/Tizen.Convergence/Interop/Interop.Libraries.cs deleted file mode 100755 index 072ed2f88..000000000 --- a/src/Tizen.Convergence/Interop/Interop.Libraries.cs +++ /dev/null @@ -1,28 +0,0 @@ -/* - * 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 -{ - /// - /// Wrapper class for maintaining names of dependent native libraries. - /// - internal static partial class Libraries - { - public const string Convergence = "libd2d-conv-manager.so.0"; - public const string Glib = "libglib-2.0.so.0"; - public const string Libc = "libc.so.6"; - } -} diff --git a/src/Tizen.Convergence/Tizen.Convergence.csproj b/src/Tizen.Convergence/Tizen.Convergence.csproj deleted file mode 100644 index 7f4584ffe..000000000 --- a/src/Tizen.Convergence/Tizen.Convergence.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - netstandard2.0 - - - - - - - - diff --git a/src/Tizen.Convergence/Tizen.Convergence.sln b/src/Tizen.Convergence/Tizen.Convergence.sln deleted file mode 100755 index 6468f53bf..000000000 --- a/src/Tizen.Convergence/Tizen.Convergence.sln +++ /dev/null @@ -1,34 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26430.12 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Convergence", "Tizen.Convergence.csproj", "{2678DBBD-A00B-45EC-970B-10177D421F37}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen", "..\Tizen\Tizen.csproj", "{7E7B653C-4119-43C6-A753-7FF659836862}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Log", "..\Tizen.Log\Tizen.Log.csproj", "{0860A84B-7FAD-434F-9EEB-D59D0FEC145E}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {2678DBBD-A00B-45EC-970B-10177D421F37}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {2678DBBD-A00B-45EC-970B-10177D421F37}.Debug|Any CPU.Build.0 = Debug|Any CPU - {2678DBBD-A00B-45EC-970B-10177D421F37}.Release|Any CPU.ActiveCfg = Release|Any CPU - {2678DBBD-A00B-45EC-970B-10177D421F37}.Release|Any CPU.Build.0 = Release|Any CPU - {7E7B653C-4119-43C6-A753-7FF659836862}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7E7B653C-4119-43C6-A753-7FF659836862}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7E7B653C-4119-43C6-A753-7FF659836862}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7E7B653C-4119-43C6-A753-7FF659836862}.Release|Any CPU.Build.0 = Release|Any CPU - {0860A84B-7FAD-434F-9EEB-D59D0FEC145E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {0860A84B-7FAD-434F-9EEB-D59D0FEC145E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {0860A84B-7FAD-434F-9EEB-D59D0FEC145E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {0860A84B-7FAD-434F-9EEB-D59D0FEC145E}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/src/Tizen.Convergence/Tizen.Convergence/InternalAppCommunicationService.cs b/src/Tizen.Convergence/Tizen.Convergence/InternalAppCommunicationService.cs deleted file mode 100755 index 64b56586d..000000000 --- a/src/Tizen.Convergence/Tizen.Convergence/InternalAppCommunicationService.cs +++ /dev/null @@ -1,163 +0,0 @@ -/* -* 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.ComponentModel; -using Tizen.Internals.Errors; - -namespace Tizen.Convergence -{ - /// - /// The class provides APIs to support App to App communication service which relies on a remote server. - /// The initialization and execution of a server app (the app on the side with the Remote Server, e.g. TV) and a client app (e.g. the app on the mobile or wearable device) are slightly different. - /// On the server side an instance of the App Communication Service should be created and started by the app. Note, on the client side the service handle shouldn’t be created, but obtained during discovery. - /// For more information, refer Tizen D2D convergence specification - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public class InternalAppCommunicationService : InternalService - { - /// - /// The constructor - /// - /// http://tizen.org/feature/convergence.d2d - /// Thrown if the required feature is not supported. - public InternalAppCommunicationService() : - base(Interop.Internal.ServiceType.AppCommunication) - { - - } - - internal InternalAppCommunicationService(IntPtr serviceHandle) : - base(serviceHandle) - { - - } - - /// - /// Starts and initiates the service - /// - /// Channel to specify a logical session for the service - /// Contains additional data for start request. Refer D2D Convergence specification for more information - /// http://tizen.org/privilege/internet - /// http://tizen.org/privilege/bluetooth - /// http://tizen.org/privilege/d2d.datasharing - /// http://tizen.org/feature/convergence.d2d - /// Thrown if the required feature is not supported. - /// Thrown when the request is not supported as per Tizen D2D convergence specification - /// Thrown when any of the arugments are null - /// The result of the request is delivered through this event - public void Start(InternalChannel channel, InternalPayload payload) - { - if (channel == null) - { - throw new ArgumentNullException(); - } - - Interop.Internal.ConvPayloadHandle handle = (payload == null) ? new Interop.Internal.ConvPayloadHandle() : payload._payloadHandle; - int ret = Interop.Internal.ConvService.Start(_serviceHandle, channel._channelHandle, handle); - if (ret != (int)ConvErrorCode.None) - { - Log.Error(ErrorFactory.LogTag, "Interop: Failed to start app communication service:" + ErrorFacts.GetErrorMessage(ret)); - throw ErrorFactory.GetException(ret); - } - } - - /// - /// Reads data from the channel opened on the service - /// - /// Channel representing a logical session on the service - /// Contains additional data for start request. Refer D2D Convergence specification for more information - /// http://tizen.org/privilege/internet - /// http://tizen.org/privilege/bluetooth - /// http://tizen.org/feature/convergence.d2d - /// Thrown if the required feature is not supported. - /// Thrown when the request is not supported as per Tizen D2D convergence specification - /// Thrown when any of the arugments are null - /// The result of the request is delivered through this event - public void Read(InternalChannel channel, InternalPayload payload) - { - if (channel == null) - { - throw new ArgumentNullException(); - } - - Interop.Internal.ConvPayloadHandle handle = (payload == null) ? new Interop.Internal.ConvPayloadHandle() : payload._payloadHandle; - int ret = Interop.Internal.ConvService.Read(_serviceHandle, channel._channelHandle, handle); - if (ret != (int)ConvErrorCode.None) - { - Log.Error(ErrorFactory.LogTag, "Interop: Failed to read app communication service:" + ErrorFacts.GetErrorMessage(ret)); - throw ErrorFactory.GetException(ret); - } - } - - /// - /// Publishes a message to the remote server application - /// - /// Channel representing a logical session on the service - /// Contains additional data for start request. Refer D2D Convergence specification for more information - /// http://tizen.org/privilege/internet - /// http://tizen.org/privilege/bluetooth - /// http://tizen.org/privilege/d2d.datasharing - /// http://tizen.org/feature/convergence.d2d - /// Thrown if the required feature is not supported. - /// Thrown when the request is not supported as per Tizen D2D convergence specification - /// Thrown when any of the arugments are null - /// The result of the request is delivered through this event - public void Publish(InternalChannel channel, InternalPayload payload) - { - if (channel == null) - { - throw new ArgumentNullException(); - } - - Interop.Internal.ConvPayloadHandle handle = (payload == null) ? new Interop.Internal.ConvPayloadHandle() : payload._payloadHandle; - int ret = Interop.Internal.ConvService.Publish(_serviceHandle, channel._channelHandle, handle); - if (ret != (int)ConvErrorCode.None) - { - Log.Error(ErrorFactory.LogTag, "Interop: Failed to publish app communication service:" + ErrorFacts.GetErrorMessage(ret)); - throw ErrorFactory.GetException(ret); - } - } - - /// - /// Stops the channel opened on the remote server application - /// - /// Channel representing a logical session on the service - /// Contains additional data for start request. Refer D2D Convergence specification for more information - /// http://tizen.org/privilege/internet - /// http://tizen.org/privilege/bluetooth - /// http://tizen.org/feature/convergence.d2d - /// Thrown if the required feature is not supported. - /// Thrown when the request is not supported as per Tizen D2D convergence specification - /// Thrown when any of the arugments are null - /// The result of the request is delivered through this event - public void Stop(InternalChannel channel, InternalPayload payload) - { - if (channel == null) - { - throw new ArgumentNullException(); - } - - Interop.Internal.ConvPayloadHandle handle = (payload == null) ? new Interop.Internal.ConvPayloadHandle() : payload._payloadHandle; - int ret = Interop.Internal.ConvService.Stop(_serviceHandle, channel._channelHandle, handle); - if (ret != (int)ConvErrorCode.None) - { - Log.Error(ErrorFactory.LogTag, "Interop: Failed to start stop communication service:" + ErrorFacts.GetErrorMessage(ret)); - throw ErrorFactory.GetException(ret); - } - } - } -} diff --git a/src/Tizen.Convergence/Tizen.Convergence/InternalChannel.cs b/src/Tizen.Convergence/Tizen.Convergence/InternalChannel.cs deleted file mode 100755 index 72b00ec61..000000000 --- a/src/Tizen.Convergence/Tizen.Convergence/InternalChannel.cs +++ /dev/null @@ -1,116 +0,0 @@ -/* -* 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; -using System.ComponentModel; - -namespace Tizen.Convergence -{ - /// - /// The Channel class provies a logical session for communicating with AppCommunicationService. - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public class InternalChannel : IDisposable - { - internal Interop.Internal.ConvChannelHandle _channelHandle; - internal const string ChannelUriKey = "uri"; - internal const string ChannelIdKey = "channel_id"; - - /// - /// The constructor - /// - /// Uri of the server side app - /// Unique identifier - /// http://tizen.org/feature/convergence.d2d - /// Thrown if the required feature is not supported. - /// Throws when the arguments passed are null - public InternalChannel(string uri, string id) - { - if (uri == null || id == null) - { - throw new ArgumentNullException(); - } - - int ret = Interop.Internal.ConvChannel.Create(out _channelHandle); - if (ret != (int)ConvErrorCode.None) - { - Log.Error(ErrorFactory.LogTag, "Failed to create channel"); - throw ErrorFactory.GetException(ret); - } - - ret = Interop.Internal.ConvChannel.SetString(_channelHandle, ChannelUriKey, uri); - if (ret != (int)ConvErrorCode.None) - { - Log.Error(ErrorFactory.LogTag, "Failed to create channel"); - throw ErrorFactory.GetException(ret); - } - - ret = Interop.Internal.ConvChannel.SetString(_channelHandle, ChannelIdKey, id); - if (ret != (int)ConvErrorCode.None) - { - Log.Error(ErrorFactory.LogTag, "Failed to create channel"); - throw ErrorFactory.GetException(ret); - } - - Uri = uri; - Id = id; - } - - internal InternalChannel(IntPtr channelHandle) - { - _channelHandle = new Interop.Internal.ConvChannelHandle(channelHandle, false); - - IntPtr stringPtr = IntPtr.Zero; - int ret = Interop.Internal.ConvChannel.GetString(_channelHandle, ChannelUriKey, out stringPtr); - if (ret != (int)ConvErrorCode.None) - { - Log.Error(ErrorFactory.LogTag, "Failed to create channel"); - throw ErrorFactory.GetException(ret); - } - Uri = Marshal.PtrToStringAnsi(stringPtr); - Interop.Libc.Free(stringPtr); - - ret = Interop.Internal.ConvChannel.GetString(_channelHandle, ChannelIdKey, out stringPtr); - if (ret != (int)ConvErrorCode.None) - { - Log.Error(ErrorFactory.LogTag, "Failed to create channel"); - throw ErrorFactory.GetException(ret); - } - - Id = Marshal.PtrToStringAnsi(stringPtr); - Interop.Libc.Free(stringPtr); - } - - /// - /// Uri of the server side app - /// - public string Uri { get; } - - /// - /// Unique identifier - /// - public string Id { get; } - - /// - /// The dispose method - /// - public void Dispose() - { - _channelHandle.Dispose(); - } - } -} diff --git a/src/Tizen.Convergence/Tizen.Convergence/InternalDevice.cs b/src/Tizen.Convergence/Tizen.Convergence/InternalDevice.cs deleted file mode 100755 index 0676fca17..000000000 --- a/src/Tizen.Convergence/Tizen.Convergence/InternalDevice.cs +++ /dev/null @@ -1,116 +0,0 @@ -/* -* 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.Collections.Generic; -using System.Runtime.InteropServices; -using System.ComponentModel; - -namespace Tizen.Convergence -{ - /// - /// The class encapsulates a D2D convergence compliant device information - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public class InternalDevice : IDisposable - { - internal const string DeviceIdKey = "device_id"; - internal const string DeviceNameKey = "device_name"; - internal const string DeviceTypeKey = "device_type"; - internal Interop.Internal.ConvDeviceHandle _deviceHandle; - internal List _services = new List(); - - /// - /// The Unique ID of the device - /// - public string Id { get;} - - /// - /// Name of the device - /// - public string Name { get;} - - /// - /// The profile of the device - /// - public string Type { get; } - - /// - /// List of services supported by the device - /// - public IEnumerable Services - { - get - { - return _services; - } - } - - internal InternalDevice(IntPtr deviceHandle) - { - int ret = Interop.Internal.ConvDevice.Clone(deviceHandle, out _deviceHandle); - if (ret != (int)ConvErrorCode.None) - { - Log.Error(ErrorFactory.LogTag, "Failed to clone device"); - throw ErrorFactory.GetException(ret); - } - - IntPtr stringPtr = IntPtr.Zero; - ret = Interop.Internal.ConvDevice.GetPropertyString(_deviceHandle, DeviceIdKey, out stringPtr); - if (ret == (int)ConvErrorCode.None) - { - Id = Marshal.PtrToStringAnsi(stringPtr); - Interop.Libc.Free(stringPtr); - } - - ret = Interop.Internal.ConvDevice.GetPropertyString(_deviceHandle, DeviceNameKey, out stringPtr); - if (ret == (int)ConvErrorCode.None) - { - Name = Marshal.PtrToStringAnsi(stringPtr); - Interop.Libc.Free(stringPtr); - } - - ret = Interop.Internal.ConvDevice.GetPropertyString(_deviceHandle, DeviceTypeKey, out stringPtr); - if (ret != (int)ConvErrorCode.None) - { - Type = Marshal.PtrToStringAnsi(stringPtr); - Interop.Libc.Free(stringPtr); - } - - Log.Debug(ErrorFactory.LogTag, "Device ID ,Name, and Type:[" + Id +"," + Name +"," + Type +"]"); - - Interop.Internal.ConvDevice.ConvServiceForeachCallback cb = (IntPtr serviceHandle, IntPtr userData) => - { - _services.Add(InternalService.GetService(serviceHandle)); - }; - - ret = Interop.Internal.ConvDevice.ForeachService(_deviceHandle, cb, IntPtr.Zero); - if (ret != (int)ConvErrorCode.None) - { - Log.Error(ErrorFactory.LogTag, "Failed to get device services"); - throw ErrorFactory.GetException(ret); - } - } - - /// - /// The dispose method - /// - public void Dispose() - { - _deviceHandle.Dispose(); - } - } -} diff --git a/src/Tizen.Convergence/Tizen.Convergence/InternalDeviceFinder.cs b/src/Tizen.Convergence/Tizen.Convergence/InternalDeviceFinder.cs deleted file mode 100755 index aea5f89fd..000000000 --- a/src/Tizen.Convergence/Tizen.Convergence/InternalDeviceFinder.cs +++ /dev/null @@ -1,133 +0,0 @@ -/* -* 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; -using System.Threading; -using System.Threading.Tasks; -using System.ComponentModel; - -namespace Tizen.Convergence -{ - /// - /// DeviceFinder provides API to find all nearby Tizen D2D convergence compliant devices - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public class InternalDeviceFinder : IDisposable - { - internal Interop.Internal.ConvManagerHandle _convManagerHandle; - - /// - /// The constructor - /// - /// http://tizen.org/feature/convergence.d2d - /// Thrown if the required feature is not supported. - public InternalDeviceFinder() - { - int ret = Interop.Internal.ConvManager.ConvCreate(out _convManagerHandle); - if (ret != (int)ConvErrorCode.None) - { - Log.Error(ErrorFactory.LogTag, "Failed to create conv manager handle"); - throw ErrorFactory.GetException(ret); - } - - } - - /// - /// DeviceFound event is triggered when a device is found during discovery procedure - /// - public event EventHandler DeviceFound; - - /// - /// Starts the discovery of nearby devices - /// - /// Seconds for discovery timeout. 0 will use default timeout value - /// Cancellation token required to cancel the current discovery - /// http://tizen.org/privilege/internet - /// http://tizen.org/privilege/bluetooth - /// http://tizen.org/feature/convergence.d2d - /// Thrown if the required feature is not supported. - /// Thrown when the request is not supported as per Tizen D2D convergence specification - /// Devices found are delivered through this event - /// Task with discovery result - public async Task StartFindingAsync(int timeOut, CancellationToken cancellationToken = default(CancellationToken)) - { - var task = new TaskCompletionSource(); - Interop.Internal.ConvManager.ConvDiscoveryCallback discoveredCb = (IntPtr deviceHandle, Interop.Internal.ConvDiscoveryResult result, IntPtr userData) => - { - Log.Debug(ErrorFactory.LogTag, "discovery callback called with result:[" + result + "]"); - switch (result) - { - case Interop.Internal.ConvDiscoveryResult.Success: - { - InternalDevice device = new InternalDevice(deviceHandle); - InternalDeviceFoundEventArgs deviceFoundEventArgs = new InternalDeviceFoundEventArgs() - { - Device = device - }; - DeviceFound?.Invoke(this, deviceFoundEventArgs); - break; - } - case Interop.Internal.ConvDiscoveryResult.Error: - { - task.TrySetException(new InvalidOperationException("Discovery error occured")); - break; - } - case Interop.Internal.ConvDiscoveryResult.Lost: - { - task.TrySetException(new InvalidOperationException("Discovery Lost")); - break; - } - case Interop.Internal.ConvDiscoveryResult.Finished: - { - Log.Debug(ErrorFactory.LogTag, "discovery process finished"); - task.TrySetResult(true); - break; - } - } - }; - int ret = Interop.Internal.ConvManager.ConvDiscoveryStart(_convManagerHandle, timeOut, discoveredCb, IntPtr.Zero); - if (ret != (int)ConvErrorCode.None) - { - Log.Error(ErrorFactory.LogTag, "Failed to start finding devices"); - throw ErrorFactory.GetException(ret); - } - - if (cancellationToken != CancellationToken.None) - { - cancellationToken.Register(() => - { - int error = Interop.Internal.ConvManager.ConvDiscoveryStop(_convManagerHandle); - if (error != (int)ConvErrorCode.None) - { - Log.Error(ErrorFactory.LogTag, "Failed to stop finding devices" + Internals.Errors.ErrorFacts.GetErrorMessage(error)); - throw ErrorFactory.GetException(error); - } - task.TrySetCanceled(); - }); - } - await task.Task; - } - - /// - /// The dispose method - /// - public void Dispose() - { - _convManagerHandle.Dispose(); - } - } -} diff --git a/src/Tizen.Convergence/Tizen.Convergence/InternalDeviceFoundEventArgs.cs b/src/Tizen.Convergence/Tizen.Convergence/InternalDeviceFoundEventArgs.cs deleted file mode 100755 index 60c3df09e..000000000 --- a/src/Tizen.Convergence/Tizen.Convergence/InternalDeviceFoundEventArgs.cs +++ /dev/null @@ -1,35 +0,0 @@ -/* -* 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.ComponentModel; - -namespace Tizen.Convergence -{ - /// - /// Contains arguments for the event DeviceFound. - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public class InternalDeviceFoundEventArgs : EventArgs - { - internal InternalDeviceFoundEventArgs() { } - - /// - /// The device found - /// - public InternalDevice Device { get; internal set; } - } -} diff --git a/src/Tizen.Convergence/Tizen.Convergence/InternalErrorFactory.cs b/src/Tizen.Convergence/Tizen.Convergence/InternalErrorFactory.cs deleted file mode 100755 index 8954997a2..000000000 --- a/src/Tizen.Convergence/Tizen.Convergence/InternalErrorFactory.cs +++ /dev/null @@ -1,71 +0,0 @@ -/* - * 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; -using System.Threading.Tasks; -using System.Threading; - -namespace Tizen.Convergence -{ - internal enum ConvErrorCode - { - None = ErrorCode.None, - OutOfMemory = ErrorCode.OutOfMemory, - InvalidParameter = ErrorCode.InvalidParameter, - InvalidOperation = ErrorCode.InvalidOperation, - NoData = ErrorCode.NoData, - NotSupported = ErrorCode.NotSupported, - PermissionDenied = ErrorCode.PermissionDenied, - } - - internal class ErrorFactory - { - internal static string LogTag = "Tizen.Convergence"; - - internal static Exception GetException(int error) - { - if ((ConvErrorCode)error == ConvErrorCode.OutOfMemory) - { - return new OutOfMemoryException("Out of memory"); - } - else if ((ConvErrorCode)error == ConvErrorCode.InvalidParameter) - { - return new ArgumentException("Invalid parameter"); - } - else if ((ConvErrorCode)error == ConvErrorCode.InvalidOperation) - { - return new InvalidOperationException("Invalid operation"); - } - else if ((ConvErrorCode)error == ConvErrorCode.NotSupported) - { - return new NotSupportedException("Unsupported feature http://tizen.org/feature/convergence.d2d"); - } - else if ((ConvErrorCode)error == ConvErrorCode.PermissionDenied) - { - return new UnauthorizedAccessException("Permission denied. (http://tizen.org/privilege/internet, http://tizen.org/privilege/bluetooth, http://tizen.org/privilege/d2d.datasharing)"); - } - else if ((ConvErrorCode)error == ConvErrorCode.NoData) - { - return new InvalidOperationException("The payload is empty"); - } - else - { - return new Exception("Unknown error"); - } - } - } -} diff --git a/src/Tizen.Convergence/Tizen.Convergence/InternalPayload.cs b/src/Tizen.Convergence/Tizen.Convergence/InternalPayload.cs deleted file mode 100755 index d5df0a86f..000000000 --- a/src/Tizen.Convergence/Tizen.Convergence/InternalPayload.cs +++ /dev/null @@ -1,219 +0,0 @@ -/* -* 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; -using System.ComponentModel; - -namespace Tizen.Convergence -{ - /// - /// Represents a payload used in Tizen D2D convergence - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public class InternalPayload : IDisposable - { - internal Interop.Internal.ConvPayloadHandle _payloadHandle; - - /// - /// The constructor - /// - /// http://tizen.org/feature/convergence.d2d - /// Thrown if the required feature is not supported. - public InternalPayload() - { - int ret = Interop.Internal.ConvPayload.Create(out _payloadHandle); - if (ret != (int)ConvErrorCode.None) - { - Log.Error(ErrorFactory.LogTag, "Failed to create payload"); - throw ErrorFactory.GetException(ret); - } - } - - internal InternalPayload(IntPtr payloadHandle) - { - _payloadHandle = new Interop.Internal.ConvPayloadHandle(payloadHandle, false); - } - - /// - /// Adds a key-value pair to payload - /// - /// The key of the attribute - /// The value of the attribute - /// http://tizen.org/feature/convergence.d2d - /// Thrown if the required feature is not supported. - /// Thrown if the arguments passed are null - public void Set(string key, string value) - { - if(key == null || value == null) - { - throw new ArgumentNullException(); - } - - int ret = 0; - if (value is string) - { - ret = Interop.Internal.ConvPayload.SetString(_payloadHandle, key, value); - if (ret != (int)ConvErrorCode.None) - { - Log.Error(ErrorFactory.LogTag, "Failed to add string to payload"); - throw ErrorFactory.GetException(ret); - } - } - } - - /// - /// Adds a key-value pair to payload - /// - /// The key of the attribute - /// The value of the attribute - /// http://tizen.org/feature/convergence.d2d - /// Thrown if the required feature is not supported. - /// Thrown if the arguments passed are null - public void Set(string key, byte[] value) - { - if (key == null || value == null) - { - throw new ArgumentNullException(); - } - - int ret = 0; - ret = Interop.Internal.ConvPayload.SetByte(_payloadHandle, key, value.Length, value); - if (ret != (int)ConvErrorCode.None) - { - Log.Error(ErrorFactory.LogTag, "Failed to add string to payload"); - throw ErrorFactory.GetException(ret); - } - } - - - /// - /// Sets binary to payload. - /// - /// The binary to set - /// http://tizen.org/feature/convergence.d2d - /// Thrown if the required feature is not supported. - /// Thrown if the arguments passed are null - public void Set(byte[] value) - { - if (value == null) - { - throw new ArgumentNullException(); - } - - int ret = 0; - ret = Interop.Internal.ConvPayload.SetBinary(_payloadHandle, value.Length, value); - if (ret != (int)ConvErrorCode.None) - { - Log.Error(ErrorFactory.LogTag, "Failed to add binary to payload"); - throw ErrorFactory.GetException(ret); - } - } - - /// - /// Gets the value of the key from payload - /// - /// The key of the attribute - /// The value of the attribute - /// http://tizen.org/feature/convergence.d2d - /// Thrown if the required feature is not supported. - /// Thrown if the arguments passed are null - /// Thrown if the key is not found - public void Get(string key, out string value) - { - if (key == null) - { - throw new ArgumentNullException(); - } - - IntPtr stringPtr = IntPtr.Zero; - int ret = 0; - ret = Interop.Internal.ConvPayload.GetString(_payloadHandle, key, out stringPtr); - if (ret != (int)ConvErrorCode.None) - { - Log.Error(ErrorFactory.LogTag, "Failed to add string to payload"); - throw ErrorFactory.GetException(ret); - } - - value = Marshal.PtrToStringAnsi(stringPtr); - Interop.Libc.Free(stringPtr); - } - - /// - /// Gets the value of the key from payload - /// - /// The key of the attribute - /// The value of the attribute - /// http://tizen.org/feature/convergence.d2d - /// Thrown if the required feature is not supported. - /// Thrown if the arguments passed are null - /// Thrown if the key is not found - public void Get(string key, out byte[] value) - { - if (key == null) - { - throw new ArgumentNullException(); - } - - int ret = 0; - IntPtr byteArrayPtr; - int byteArraySize; - ret = Interop.Internal.ConvPayload.GetByte(_payloadHandle, key, out byteArraySize, out byteArrayPtr); - if (ret != (int)ConvErrorCode.None) - { - Log.Error(ErrorFactory.LogTag, "Failed to add string to payload"); - throw ErrorFactory.GetException(ret); - } - - byte[] byteArray = new byte[byteArraySize]; - Marshal.Copy(byteArrayPtr, byteArray, 0, byteArraySize); - value = byteArray; - Interop.Libc.Free(byteArrayPtr); - } - - /// - /// Gets binary from payload - /// - /// The result value - /// http://tizen.org/feature/convergence.d2d - /// Thrown if the required feature is not supported. - public void Get(out byte[] value) - { - int ret = 0; - IntPtr byteArrayPtr; - int byteArraySize; - ret = Interop.Internal.ConvPayload.GetBinary(_payloadHandle, out byteArraySize, out byteArrayPtr); - if (ret != (int)ConvErrorCode.None) - { - Log.Error(ErrorFactory.LogTag, "Failed to get binary from payload"); - throw ErrorFactory.GetException(ret); - } - - byte[] byteArray = new byte[byteArraySize]; - Marshal.Copy(byteArrayPtr, byteArray, 0, byteArraySize); - value = byteArray; - Interop.Libc.Free(byteArrayPtr); - } - - /// - /// The dispose method - /// - public void Dispose() - { - _payloadHandle.Dispose(); - } - } -} diff --git a/src/Tizen.Convergence/Tizen.Convergence/InternalService.cs b/src/Tizen.Convergence/Tizen.Convergence/InternalService.cs deleted file mode 100755 index 674023140..000000000 --- a/src/Tizen.Convergence/Tizen.Convergence/InternalService.cs +++ /dev/null @@ -1,192 +0,0 @@ -/* -* 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; -using System.ComponentModel; - -namespace Tizen.Convergence -{ - /// - /// The class abstracts the features provided by Tizen D2D Convergence. - /// - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public abstract class InternalService : IDisposable - { - internal Interop.Internal.ConvServiceHandle _serviceHandle; - internal const string ServiceIdKey = "service_id"; - internal const string ServiceVersionKey = "service_version"; - - private event EventHandler _serviceEventOccured; - - internal InternalService(Interop.Internal.ServiceType type) - { - int ret = Interop.Internal.ConvService.Create(out _serviceHandle); - if (ret != (int)ConvErrorCode.None) - { - Log.Error(ErrorFactory.LogTag, "Failed to create service handle"); - throw ErrorFactory.GetException(ret); - } - - ret = Interop.Internal.ConvService.SetType(_serviceHandle, (int)type); - if (ret != (int)ConvErrorCode.None) - { - Log.Error(ErrorFactory.LogTag, "Failed to create service handle"); - throw ErrorFactory.GetException(ret); - } - } - - internal InternalService(IntPtr existingServiceHandle) - { - int ret = Interop.Internal.ConvService.Clone(existingServiceHandle, out _serviceHandle); - if (ret != (int)ConvErrorCode.None) - { - Log.Error(ErrorFactory.LogTag, "Failed to clone device"); - throw ErrorFactory.GetException(ret); - } - - IntPtr stringPtr = IntPtr.Zero; - ret = Interop.Internal.ConvService.GetPropertyString(_serviceHandle, ServiceIdKey, out stringPtr); - if (ret != (int)ConvErrorCode.None) - { - Log.Error(ErrorFactory.LogTag, "Failed to get service Id"); - throw ErrorFactory.GetException(ret); - } - - Id = Marshal.PtrToStringAnsi(stringPtr); - Interop.Libc.Free(stringPtr); - - ret = Interop.Internal.ConvService.GetPropertyString(_serviceHandle, ServiceVersionKey, out stringPtr); - if (ret != (int)ConvErrorCode.None) - { - Log.Error(ErrorFactory.LogTag, "Failed to get service version"); - throw ErrorFactory.GetException(ret); - } - - Version = Marshal.PtrToStringAnsi(stringPtr); - Interop.Libc.Free(stringPtr); - } - - /// - /// The ID of the service - /// - public string Id { get; } - - /// - /// The Version of the service - /// - public string Version { get; } - - /// - /// The event handler for Service Events(Start/Publish/Read/Stop) - /// - public event EventHandler ServiceEventOccurred - { - add - { - if (_serviceEventOccured == null) - { - RegisterServiceEventListener(); - } - _serviceEventOccured += value; - } - remove - { - _serviceEventOccured -= value; - if (_serviceEventOccured == null) - { - UnregisterServiceEventListener(); - } - } - } - - /// - /// The event handler for service error events - /// - public event EventHandler ServiceErrorOccured; - - /// - /// The dispose method - /// - public void Dispose() - { - _serviceHandle.Dispose(); - } - - internal static InternalService GetService(IntPtr serviceHandle) - { - InternalService service = null; - int serviceType; - int ret = Interop.Internal.ConvService.GetType(serviceHandle, out serviceType); - if (ret != (int)ConvErrorCode.None) - { - Log.Error(ErrorFactory.LogTag, "Failed to get service version"); - throw ErrorFactory.GetException(ret); - } - if (serviceType == (int)Interop.Internal.ServiceType.AppCommunication) - { - service = new InternalAppCommunicationService(serviceHandle); - } - - return service; - } - - private void RegisterServiceEventListener() - { - int ret = Interop.Internal.ConvService.SetListenerCb(_serviceHandle, serviceEventsCb, IntPtr.Zero); - if (ret != (int)ConvErrorCode.None) - { - Log.Error(ErrorFactory.LogTag, "Failed to set listener for service events"); - throw ErrorFactory.GetException(ret); - } - } - - private void UnregisterServiceEventListener() - { - int ret = Interop.Internal.ConvService.UnsetListenerCb(_serviceHandle); - if (ret != (int)ConvErrorCode.None) - { - Log.Error(ErrorFactory.LogTag, "Failed to unset listener for service events"); - throw ErrorFactory.GetException(ret); - } - } - - private void serviceEventsCb(IntPtr serviceHandle, IntPtr channelHandle, int error, IntPtr resultPayloadHandle, IntPtr userData) - { - Log.Debug(ErrorFactory.LogTag, "service event occured. error code :[" + error + "]"); - - if (error == (int)ConvErrorCode.None) - { - var channel = (channelHandle == IntPtr.Zero) ? null : new InternalChannel(channelHandle); - var payload = (resultPayloadHandle == IntPtr.Zero) ? null : new InternalPayload(resultPayloadHandle); - _serviceEventOccured?.Invoke(this, new InternalServiceEventOccuredEventArgs() - { - Payload = payload, - Channel = channel - }); - } - else - { - var eventArgs = new InternalServiceErrorOccuredEventArgs() - { - Exception = ErrorFactory.GetException(error) - }; - ServiceErrorOccured?.Invoke(this, eventArgs); - } - } - } -} diff --git a/src/Tizen.Convergence/Tizen.Convergence/InternalServiceErrorOccuredEventArgs.cs b/src/Tizen.Convergence/Tizen.Convergence/InternalServiceErrorOccuredEventArgs.cs deleted file mode 100755 index 104a05bae..000000000 --- a/src/Tizen.Convergence/Tizen.Convergence/InternalServiceErrorOccuredEventArgs.cs +++ /dev/null @@ -1,35 +0,0 @@ -/* -* 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.ComponentModel; - -namespace Tizen.Convergence -{ - /// - /// Contains arguments for the event ServiceErrorOccured. - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public class InternalServiceErrorOccuredEventArgs : EventArgs - { - internal InternalServiceErrorOccuredEventArgs() { } - - /// - /// The exception - /// - public Exception Exception { get; internal set; } - } -} diff --git a/src/Tizen.Convergence/Tizen.Convergence/InternalServiceEventOccuredEventArgs.cs b/src/Tizen.Convergence/Tizen.Convergence/InternalServiceEventOccuredEventArgs.cs deleted file mode 100755 index e07c9e356..000000000 --- a/src/Tizen.Convergence/Tizen.Convergence/InternalServiceEventOccuredEventArgs.cs +++ /dev/null @@ -1,40 +0,0 @@ -/* -* 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.ComponentModel; - -namespace Tizen.Convergence -{ - /// - /// Contains arguments for ServiceEventOccured - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public class InternalServiceEventOccuredEventArgs : EventArgs - { - internal InternalServiceEventOccuredEventArgs() { } - - /// - /// The channel on which the event occured - /// - public InternalChannel Channel { get; internal set; } - - /// - /// The payload containing the result - /// - public InternalPayload Payload { get; internal set; } - } -} diff --git a/src/Tizen.Location.Geofence/Interop/Interop.Libraries.cs b/src/Tizen.Location.Geofence/Interop/Interop.Libraries.cs deleted file mode 100755 index 40b8453b4..000000000 --- a/src/Tizen.Location.Geofence/Interop/Interop.Libraries.cs +++ /dev/null @@ -1,24 +0,0 @@ -/* - * 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 - { - internal const string Geofence = "libcapi-geofence-manager.so.0"; - internal const string Libc = "libc.so.6"; - } -} diff --git a/src/Tizen.Location.Geofence/Interop/Interop.Location.cs b/src/Tizen.Location.Geofence/Interop/Interop.Location.cs deleted file mode 100755 index 89eed6a3f..000000000 --- a/src/Tizen.Location.Geofence/Interop/Interop.Location.cs +++ /dev/null @@ -1,157 +0,0 @@ -/* - * 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; -using Tizen.Location.Geofence; - -internal static partial class Interop -{ - internal static partial class Geofence - { - [DllImport(Libraries.Geofence, EntryPoint = "geofence_create_geopoint")] - internal static extern int CreateGPSFence(int placeId, double latitude, double longitude, int radius, string address, out IntPtr handle); - - [DllImport(Libraries.Geofence, EntryPoint = "geofence_create_bluetooth")] - internal static extern int CreateBTFence(int placeId, string bssid, string ssid, out IntPtr handle); - - [DllImport(Libraries.Geofence, EntryPoint = "geofence_create_wifi")] - internal static extern int CreateWiFiFence(int placeId, string bssid, string ssid, out IntPtr handle); - - [DllImport(Libraries.Geofence, EntryPoint = "geofence_destroy")] - internal static extern int Destroy(IntPtr handle); - - [DllImport(Libraries.Geofence, EntryPoint = "geofence_get_type")] - internal static extern int FenceType(IntPtr handle, out FenceType type); - - [DllImport(Libraries.Geofence, EntryPoint = "geofence_get_place_id")] - internal static extern int FencePlaceID(IntPtr handle, out int placeId); - - [DllImport(Libraries.Geofence, EntryPoint = "geofence_get_latitude")] - internal static extern int FenceLatitude(IntPtr handle, out double latitude); - - [DllImport(Libraries.Geofence, EntryPoint = "geofence_get_longitude")] - internal static extern int FenceLongitude(IntPtr handle, out double longitude); - - [DllImport(Libraries.Geofence, EntryPoint = "geofence_get_radius")] - internal static extern int FenceRadius(IntPtr handle, out int radius); - - [DllImport(Libraries.Geofence, EntryPoint = "geofence_get_address")] - internal static extern int FenceAddress(IntPtr handle, out string address); - - [DllImport(Libraries.Geofence, EntryPoint = "geofence_get_bssid")] - internal static extern int FenceBSSID(IntPtr handle, out string bssid); - - [DllImport(Libraries.Geofence, EntryPoint = "geofence_get_ssid")] - internal static extern int FenceSSID(IntPtr handle, out string ssid); - } - - internal static partial class GeofenceStatus - { - [DllImport(Libraries.Geofence, EntryPoint = "geofence_status_create")] - internal static extern int Create(int fenceId, out IntPtr statusHandle); - - [DllImport(Libraries.Geofence, EntryPoint = "geofence_status_destroy")] - internal static extern int Destroy(IntPtr statusHandle); - - [DllImport(Libraries.Geofence, EntryPoint = "geofence_status_get_state")] - internal static extern int State(IntPtr statusHandle, out GeofenceState state); - - [DllImport(Libraries.Geofence, EntryPoint = "geofence_status_get_duration")] - internal static extern int Duration(IntPtr statusHandle, out int seconds); - } - - internal static partial class GeofenceManager - { - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool StateChangedCallback(int fenceId, GeofenceState state, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool ProximityStateChangedCallback(int fenceId, ProximityState state, ProximityProvider provider, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool GeofenceEventCallback(int placeId, int fenceId, GeofenceError error, GeofenceEventType eventType, IntPtr userData); - - [DllImport(Libraries.Geofence, EntryPoint = "geofence_manager_is_supported")] - internal static extern int IsSupported(out bool supported); - - [DllImport(Libraries.Geofence, EntryPoint = "geofence_manager_create")] - internal static extern int Create(out IntPtr handle); - - [DllImport(Libraries.Geofence, EntryPoint = "geofence_manager_destroy")] - internal static extern int Destroy(IntPtr handle); - - [DllImport(Libraries.Geofence, EntryPoint = "geofence_manager_start")] - internal static extern int Start(IntPtr handle, int fenceId); - - [DllImport(Libraries.Geofence, EntryPoint = "geofence_manager_stop")] - internal static extern int Stop(IntPtr handle, int fenceId); - - [DllImport(Libraries.Geofence, EntryPoint = "geofence_manager_set_geofence_state_changed_cb")] - internal static extern int SetStateChangedCB(IntPtr handle, StateChangedCallback callback, IntPtr userData); - - [DllImport(Libraries.Geofence, EntryPoint = "geofence_manager_unset_geofence_state_changed_cb")] - internal static extern int UnsetStateChangedCB(IntPtr handle); - - [DllImport(Libraries.Geofence, EntryPoint = "geofence_manager_set_geofence_proximity_state_changed_cb")] - internal static extern int SetProximityStateCB(IntPtr handle, ProximityStateChangedCallback callback, IntPtr userData); - - [DllImport(Libraries.Geofence, EntryPoint = "geofence_manager_unset_geofence_proximity_state_changed_cb")] - internal static extern int UnsetProximityStateCB(IntPtr handle); - - [DllImport(Libraries.Geofence, EntryPoint = "geofence_manager_set_geofence_event_cb")] - internal static extern int SetGeofenceEventCB(IntPtr handle, GeofenceEventCallback callback, IntPtr userData); - - [DllImport(Libraries.Geofence, EntryPoint = "geofence_manager_unset_geofence_event_cb")] - internal static extern int UnsetGeofenceEventCB(IntPtr handle); - } - - internal static partial class VirtualPerimeter - { - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool ForEachPlaceListCallback(int placeId, string placeName, int placeIndex, int placeCount, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool ForEachFenceListCallback(int fenceId, IntPtr fenceHandle, int placeIndex, int placeCount, IntPtr userData); - - [DllImport(Libraries.Geofence, EntryPoint = "geofence_manager_add_place")] - internal static extern int AddPlace(IntPtr handle, string placeName, out int placeId); - - [DllImport(Libraries.Geofence, EntryPoint = "geofence_manager_update_place")] - internal static extern int UpdatePlace(IntPtr handle, int placeId, string placeName); - - [DllImport(Libraries.Geofence, EntryPoint = "geofence_manager_remove_place")] - internal static extern int RemovePlace(IntPtr handle, int placeId); - - [DllImport(Libraries.Geofence, EntryPoint = "geofence_manager_add_fence")] - internal static extern int AddFence(IntPtr handle, IntPtr fenceHandle, out int fenceId); - - [DllImport(Libraries.Geofence, EntryPoint = "geofence_manager_remove_fence")] - internal static extern int RemoveFence(IntPtr handle, int fenceId); - - [DllImport(Libraries.Geofence, EntryPoint = "geofence_manager_foreach_geofence_list")] - internal static extern int GetForEachFenceList(IntPtr handle, ForEachFenceListCallback callback, IntPtr userData); - - [DllImport(Libraries.Geofence, EntryPoint = "geofence_manager_foreach_place_geofence_list")] - internal static extern int GetForEachPlaceFenceList(IntPtr handle, int placeId, ForEachFenceListCallback callback, IntPtr userData); - - [DllImport(Libraries.Geofence, EntryPoint = "geofence_manager_foreach_place_list")] - internal static extern int GetForEachPlaceList(IntPtr handle, ForEachPlaceListCallback callback, IntPtr userData); - - [DllImport(Libraries.Geofence, EntryPoint = "geofence_manager_get_place_name")] - internal static extern int GetPlaceName(IntPtr handle, int placeId, out string placeName); - } -} diff --git a/src/Tizen.Location.Geofence/Tizen.Location.Geofence.csproj b/src/Tizen.Location.Geofence/Tizen.Location.Geofence.csproj deleted file mode 100644 index 7f4584ffe..000000000 --- a/src/Tizen.Location.Geofence/Tizen.Location.Geofence.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - netstandard2.0 - - - - - - - - diff --git a/src/Tizen.Location.Geofence/Tizen.Location.Geofence.sln b/src/Tizen.Location.Geofence/Tizen.Location.Geofence.sln deleted file mode 100755 index 6d1373d09..000000000 --- a/src/Tizen.Location.Geofence/Tizen.Location.Geofence.sln +++ /dev/null @@ -1,34 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26430.12 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Location.Geofence", "Tizen.Location.Geofence.csproj", "{006D46B2-2A19-450F-92FC-872553636B97}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen", "..\Tizen\Tizen.csproj", "{29BF6014-4845-4260-B24A-8CD532CF0FCC}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Log", "..\Tizen.Log\Tizen.Log.csproj", "{D706B5E3-88AE-4231-A81D-0BCA59C45FE7}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {006D46B2-2A19-450F-92FC-872553636B97}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {006D46B2-2A19-450F-92FC-872553636B97}.Debug|Any CPU.Build.0 = Debug|Any CPU - {006D46B2-2A19-450F-92FC-872553636B97}.Release|Any CPU.ActiveCfg = Release|Any CPU - {006D46B2-2A19-450F-92FC-872553636B97}.Release|Any CPU.Build.0 = Release|Any CPU - {29BF6014-4845-4260-B24A-8CD532CF0FCC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {29BF6014-4845-4260-B24A-8CD532CF0FCC}.Debug|Any CPU.Build.0 = Debug|Any CPU - {29BF6014-4845-4260-B24A-8CD532CF0FCC}.Release|Any CPU.ActiveCfg = Release|Any CPU - {29BF6014-4845-4260-B24A-8CD532CF0FCC}.Release|Any CPU.Build.0 = Release|Any CPU - {D706B5E3-88AE-4231-A81D-0BCA59C45FE7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D706B5E3-88AE-4231-A81D-0BCA59C45FE7}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D706B5E3-88AE-4231-A81D-0BCA59C45FE7}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D706B5E3-88AE-4231-A81D-0BCA59C45FE7}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/src/Tizen.Location.Geofence/Tizen.Location.Geofence/Fence.cs b/src/Tizen.Location.Geofence/Tizen.Location.Geofence/Fence.cs deleted file mode 100755 index 7dbe95b7d..000000000 --- a/src/Tizen.Location.Geofence/Tizen.Location.Geofence/Fence.cs +++ /dev/null @@ -1,302 +0,0 @@ -/* - * 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.Location.Geofence -{ - /// - /// Geofence defines a virtual perimeter for a real-world geographic area. - /// If you create a geofence, you can trigger some activities when a device enters (or exits) the geofences defined by you. - /// You can create a geofence with the information of the Geopoint, Wi-Fi, or BT. - /// - /// Geopoint: Geofence is specified by the coordinates (Latitude and Longitude) and radius. - /// WIFI: Geofence is specified by the BSSID of the Wi-Fi access point. - /// BT: Geofence is specified by the Bluetooth address. - /// - /// The Basic service set identifier (BSSID) is the MAC address of the wireless access point (WAP) generated by combining the 24-bit Organization Unique Identifier (the manufacturer's identity) - /// and the manufacturer's assigned 24-bit identifier for the radio chipset in the WAP. - /// - /// 3 - public class Fence : IDisposable - { - private bool _disposed = false; - - internal IntPtr Handle - { - get; - set; - } - - internal Fence(IntPtr handle) - { - Handle = handle; - } - - ~Fence() - { - Dispose(false); - } - - /// - /// Gets the type of geofence. - /// - /// 3 - public FenceType Type - { - get - { - FenceType val; - GeofenceError ret = (GeofenceError)Interop.Geofence.FenceType(Handle, out val); - if (ret != GeofenceError.None) - { - Tizen.Log.Error(GeofenceErrorFactory.LogTag, "Failed to get GeofenceType"); - } - - return val; - } - } - - /// - /// Gets the ID of the place. - /// - /// 3 - public int PlaceId - { - get - { - int result = -1; - GeofenceError ret = (GeofenceError)Interop.Geofence.FencePlaceID(Handle, out result); - if (ret != GeofenceError.None) - { - Tizen.Log.Error(GeofenceErrorFactory.LogTag, "Failed to get PlaceId"); - } - - return result; - } - } - - /// - /// Gets the longitude of geofence. - /// - /// 3 - public double Longitude - { - get - { - double result = -1; - GeofenceError ret = (GeofenceError)Interop.Geofence.FenceLongitude(Handle, out result); - if (ret != GeofenceError.None) - { - Tizen.Log.Error(GeofenceErrorFactory.LogTag, "Failed to get Longitude"); - } - - return result; - - } - } - - /// - /// Gets the latitude of geofence. - /// - /// 3 - public double Latitude - { - get - { - double result = -1; - GeofenceError ret = (GeofenceError)Interop.Geofence.FenceLatitude(Handle, out result); - if (ret != GeofenceError.None) - { - Tizen.Log.Error(GeofenceErrorFactory.LogTag, "Failed to get Latitude"); - } - - return result; - } - } - - /// - /// Gets the radius of geofence. - /// - /// 3 - public int Radius - { - get - { - int result = -1; - GeofenceError ret = (GeofenceError)Interop.Geofence.FenceRadius(Handle, out result); - if (ret != GeofenceError.None) - { - Tizen.Log.Error(GeofenceErrorFactory.LogTag, "Failed to get Radius"); - } - - return result; - } - } - - /// - /// Gets the address of geofence. - /// - /// 3 - public string Address - { - get - { - string result = ""; - GeofenceError ret = (GeofenceError)Interop.Geofence.FenceAddress(Handle, out result); - if (ret != GeofenceError.None) - { - Tizen.Log.Error(GeofenceErrorFactory.LogTag, "Failed to get Adress"); - } - - return result; - } - } - - /// - /// Gets the BSSID of geofence. - /// - /// 3 - public string Bssid - { - get - { - string result = ""; - GeofenceError ret = (GeofenceError)Interop.Geofence.FenceBSSID(Handle, out result); - if (ret != GeofenceError.None) - { - Tizen.Log.Error(GeofenceErrorFactory.LogTag, "Failed to get Bssid"); - } - - return result; - } - } - - /// - /// Gets the SSID of geofence. - /// - /// 3 - public string Ssid - { - get - { - string result = ""; - GeofenceError ret = (GeofenceError)Interop.Geofence.FenceSSID(Handle, out result); - if (ret != GeofenceError.None) - { - Tizen.Log.Error(GeofenceErrorFactory.LogTag, "Failed to get Ssid"); - } - - return result; - } - } - - /// - /// Creates a geopoint type of the new geofence. - /// - /// 3 - /// The current place ID. - /// Specifies the value of latitude of the geofence [-90.0 ~ 90.0] (degrees). - /// Specifies the value of longitude of the geofence [-180.0 ~ 180.0] (degrees). - /// Specifies the value of radius of the geofence [100 ~ 500](meter). - /// Specifies the value of the address. - /// The newly created geofence instance. - /// In case of an invalid parameter. - /// In case of any system error. - /// In case the geofence is not supported. - public static Fence CreateGPSFence(int placeId, int latitude, int longitude, int radius, string address) - { - IntPtr handle = IntPtr.Zero; - GeofenceError ret = (GeofenceError)Interop.Geofence.CreateGPSFence(placeId, latitude, longitude, radius,address, out handle); - if (ret != GeofenceError.None) - { - throw GeofenceErrorFactory.CreateException(ret, "Failed to create Geofence from GPS Data for " + placeId); - } - - return new Fence(handle); - } - - /// - /// Creates a Wi-Fi type of the new geofence. - /// - /// 3 - /// The current place ID. - /// Specifies the value of BSSID of the Wi-Fi MAC address. - /// Specifies the value of SSID of the Wi-Fi device. - /// The newly created geofence instance. - /// In case of an invalid parameter. - /// In case of any system error. - /// In case the geofence is not supported. - public static Fence CreateWifiFence(int placeId, string bssid, string ssid) - { - IntPtr handle = IntPtr.Zero; - GeofenceError ret = (GeofenceError)Interop.Geofence.CreateWiFiFence(placeId, bssid, ssid, out handle); - if (ret != GeofenceError.None) - { - throw GeofenceErrorFactory.CreateException(ret, "Failed to create Geofence from Wifi Data for " + placeId); - } - - return new Fence(handle); - } - - /// - /// Creates a Bluetooth type of the new geofence. - /// - /// 3 - /// The current place ID. - /// Specifies the value of BSSID of BT MAC address. - /// Specifies the value of SSID of BT Device. - /// The newly created geofence instance. - /// In case of an invalid parameter. - /// In case of any system error. - /// In case the geofence is not supported. - public static Fence CreateBTFence(int placeId, string bssid, string ssid) - { - IntPtr handle = IntPtr.Zero; - GeofenceError ret = (GeofenceError)Interop.Geofence.CreateBTFence(placeId, bssid, ssid, out handle); - if (ret != GeofenceError.None) - { - throw GeofenceErrorFactory.CreateException(ret, "Failed to create Geofence from Bluetooth Data for " + placeId); - } - - return new Fence(handle); - } - - /// - /// The overloaded Dispose API for destroying the fence handle. - /// - /// 3 - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - - private void Dispose(bool disposing) - { - if (_disposed) - return; - - if (Handle != IntPtr.Zero) - { - Interop.Geofence.Destroy(Handle); - Handle = IntPtr.Zero; - } - - _disposed = true; - } - } -} diff --git a/src/Tizen.Location.Geofence/Tizen.Location.Geofence/FenceData.cs b/src/Tizen.Location.Geofence/Tizen.Location.Geofence/FenceData.cs deleted file mode 100755 index d328f4e4f..000000000 --- a/src/Tizen.Location.Geofence/Tizen.Location.Geofence/FenceData.cs +++ /dev/null @@ -1,129 +0,0 @@ -/* - * 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.Location.Geofence -{ - /// - /// Represents the geofence list item data. - /// - /// 3 - public class FenceData - { - internal FenceData(int fenceId, IntPtr handle, int index, int count) - { - GeofenceId = fenceId; - Fence = new Fence(handle); - Index = index; - Count = count; - } - /// - /// The geofence instance. - /// - /// 3 - public Fence Fence - { - get; - internal set; - } - - /// - /// The geofence ID. - /// - /// 3 - public int GeofenceId - { - get; - internal set; - } - - /// - /// The index number of fences in the list. - /// - /// 3 - /// The index value starts from 1. - public int Index - { - get; - internal set; - } - - /// - /// The total number of fences that exists for the requester. - /// - /// 3 - public int Count - { - get; - internal set; - } - }; - - /// - /// Represents the place list item data. - /// - /// 3 - public class PlaceData - { - internal PlaceData(int id, string name, int index, int count) - { - PlaceId = id; - Name = name; - Index = index; - Count = count; - } - /// - /// The current place ID. - /// - /// 3 - public int PlaceId - { - get; - internal set; - } - - /// - /// The current place name. - /// - /// 3 - public string Name - { - get; - internal set; - } - - /// - /// The index number of places in the list. - /// - /// 3 - /// The index value starts from 1. - public int Index - { - get; - internal set; - } - - /// - /// The total number of places that exists for the requester. - /// - /// 3 - public int Count - { - get; - internal set; - } - }; -} diff --git a/src/Tizen.Location.Geofence/Tizen.Location.Geofence/FenceStatus.cs b/src/Tizen.Location.Geofence/Tizen.Location.Geofence/FenceStatus.cs deleted file mode 100644 index c430ca1b6..000000000 --- a/src/Tizen.Location.Geofence/Tizen.Location.Geofence/FenceStatus.cs +++ /dev/null @@ -1,126 +0,0 @@ -/* - * 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.Location.Geofence -{ - /// - /// The geofence status describes the current state and duration of a geofence. - /// - /// State: The state is specified by the current state of the fence. - /// Duration: Geofence is specified by the duration of the current state. - /// - /// - /// 3 - public class FenceStatus : IDisposable - { - private bool _disposed = false; - - internal IntPtr Handle - { - get; - set; - } - - /// - /// Creates a new geofence status. - /// - /// 3 - /// In case of an invalid parameter. - /// In case of geofence is not supported. - public FenceStatus(int fenceId) - { - IntPtr handle; - GeofenceError ret = (GeofenceError)Interop.GeofenceStatus.Create(fenceId, out handle); - if (ret != GeofenceError.None) - { - throw GeofenceErrorFactory.CreateException(ret, "Failed to create Geofence Status instance"); - } - - Handle = handle; - } - - ~FenceStatus() - { - Dispose(false); - } - - /// - /// Gets the state of geofence. - /// - /// 3 - /// In case the geofence is not supported. - public GeofenceState State - { - get - { - GeofenceState state; - GeofenceError ret = (GeofenceError)Interop.GeofenceStatus.State(Handle, out state); - if (ret != GeofenceError.None) - { - Tizen.Log.Error(GeofenceErrorFactory.LogTag, "Failed to get FenceState"); - } - - return state; - } - } - - /// - /// Gets the amount of seconds, the geofence is in the current state. - /// - /// 3 - /// In case the geofence is not supported. - public int Duration - { - get - { - int result = -1; - GeofenceError ret = (GeofenceError)Interop.GeofenceStatus.Duration(Handle, out result); - if (ret != GeofenceError.None) - { - Tizen.Log.Error(GeofenceErrorFactory.LogTag, "Failed to get FenceDuration"); - } - - return result; - } - } - - /// - /// The overloaded Dispose API for destroying the fence handle. - /// - /// 3 - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - - private void Dispose(bool disposing) - { - if (_disposed) - return; - - if (Handle != IntPtr.Zero) - { - Interop.GeofenceStatus.Destroy(Handle); - Handle = IntPtr.Zero; - } - - _disposed = true; - } - } -} diff --git a/src/Tizen.Location.Geofence/Tizen.Location.Geofence/GeofenceEnum.cs b/src/Tizen.Location.Geofence/Tizen.Location.Geofence/GeofenceEnum.cs deleted file mode 100755 index 9f18ecabd..000000000 --- a/src/Tizen.Location.Geofence/Tizen.Location.Geofence/GeofenceEnum.cs +++ /dev/null @@ -1,197 +0,0 @@ -/* - * 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. - */ - -namespace Tizen.Location.Geofence -{ - /// - /// Enumeration for the geofence types. - /// - /// 3 - public enum FenceType - { - /// - /// Geofence is specified by the geospatial coordinate. - /// - /// 3 - GeoPoint = 1, - - /// - /// Geofence is specified by the Wi-Fi access point. - /// - /// 3 - Wifi, - - /// - /// Geofence is specified by the Bluetooth device. - /// - /// 3 - Bluetooth - }; - - /// - /// Enumeration for the state of geofence. - /// - /// 3 - public enum GeofenceState - { - /// - /// Uncertain state of geofence. - /// - /// 3 - Uncertain = 0, - - /// - /// Geofence In state. - /// - /// 3 - In, - - /// - /// Geofence Out state. - /// - /// 3 - Out - }; - - /// - /// Enumeration for the geofence management events. - /// - /// 3 - public enum GeofenceEventType - { - /// - /// Geofence is added. - /// - /// 3 - FenceAdded = 0, - - /// - /// Geofence is removed. - /// - /// 3 - FenceRemoved, - - /// - /// Geofencing is started. - /// - /// 3 - FenceStarted, - - /// - /// Geofencing is stopped. - /// - /// 3 - FenceStopped, - - /// - /// Place is added. - /// - /// 3 - PlaceAdded = 0x10, - - /// - /// Place is removed. - /// - /// 3 - PlaceRemoved, - - /// - /// Place is updated. - /// - /// 3 - PlaceUpdated, - - /// - /// Setting for geofencing is enabled. - /// - /// 3 - SettingEnabled = 0x20, - - /// - /// Setting for geofencing is disabled. - /// - /// 3 - SettingDisabled - }; - - /// - /// Enumeration for the provider of proximity. - /// - /// 3 - public enum ProximityProvider - { - /// - /// Proximity is specified by the geospatial coordinate. - /// - /// 3 - Location = 0, - - /// - /// Proximity is specified by the Wi-Fi access point. - /// - /// 3 - Wifi, - - /// - /// Proximity is specified by the Bluetooth device. - /// - /// 3 - Bluetooth, - - /// - /// Proximity is specified by the Bluetooth low-energy device. - /// - /// 3 - BLE, - - /// - /// Proximity is specified by the sensor. - /// - /// 3 - Sensor - } - - /// - /// Enumeration for the state of proximity. - /// - /// 3 - public enum ProximityState - { - /// - /// Uncertain state of proximity. - /// - /// 3 - Uncertain = 0, - - /// - /// Far state of proximity. - /// - /// 3 - Far, - - /// - /// Far state of proximity. - /// - /// 3 - Near, - - /// - /// Immediate state of proximity. - /// - /// 3 - Immediate - } -} diff --git a/src/Tizen.Location.Geofence/Tizen.Location.Geofence/GeofenceErrorFactory.cs b/src/Tizen.Location.Geofence/Tizen.Location.Geofence/GeofenceErrorFactory.cs deleted file mode 100755 index a48e00749..000000000 --- a/src/Tizen.Location.Geofence/Tizen.Location.Geofence/GeofenceErrorFactory.cs +++ /dev/null @@ -1,174 +0,0 @@ -/* - * 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; - - -namespace Tizen.Location.Geofence -{ - /// - /// Enumeration for the types of error occured, if any. - /// - /// 3 - public enum GeofenceError - { - /// - /// Successful. - /// - /// 3 - None = Tizen.Internals.Errors.ErrorCode.None, - - /// - /// Out of memory. - /// - /// 3 - OutOfMemory = Tizen.Internals.Errors.ErrorCode.OutOfMemory, - - /// - /// Invalid parameter. - /// - /// 3 - InvalidParameter = Tizen.Internals.Errors.ErrorCode.InvalidParameter, - - /// - /// Permission denied. - /// - /// 3 - PermissionDenied = Tizen.Internals.Errors.ErrorCode.PermissionDenied, - - /// - /// Not Supported. - /// - /// 3 - NotSupported = Tizen.Internals.Errors.ErrorCode.NotSupported, - - /// - /// Geofence manager is not initialized. - /// - /// 3 - NotInitialized = -0x02C10000 | 0x01, - - /// - /// Invalid geofence ID. - /// - /// 3 - InvalidID = -0x02C10000 | 0x02, - - /// - /// Exception occurs. - /// - /// 3 - Exception = -0x02C10000 | 0x03, - - /// - /// Geofencing is already started. - /// - /// 3 - AlreadyStarted = -0x02C10000 | 0x04, - - /// - /// Too many geofence. - /// - /// 3 - TooManyGeofence = -0x02C10000 | 0x05, - - /// - /// Error in GPS, Wi-Fi, or BT. - /// - /// 3 - IPC = -0x02C10000 | 0x06, - - /// - /// DB error in the server side. - /// - /// 3 - DBFailed = -0x02C10000 | 0x07, - - /// - /// Access to the specified place is denied. - /// - /// 3 - PlaceAccessDenied = -0x02C10000 | 0x08, - - /// - /// Access to the specified geofence is denied. - /// - /// 3 - GeofenceAccessDenied = -0x02C10000 | 0x09 - }; - - internal class GeofenceErrorFactory - { - internal const string LogTag = "Tizen.Location.Geofence"; - - internal static Exception CreateException(GeofenceError err, string msg) - { - Log.Info(LogTag, "Got Error " + err + " throwing Exception with msg " + msg); - Exception exp; - switch (err) - { - case GeofenceError.InvalidParameter: - { - exp = new ArgumentException(msg + " Invalid Parameters Provided"); - break; - } - - case GeofenceError.OutOfMemory: - { - exp = new OutOfMemoryException(msg + " Out Of Memory"); - break; - } - - case GeofenceError.NotInitialized: - { - exp = new InvalidOperationException(msg + " Not initializded"); - break; - } - - case GeofenceError.NotSupported: - { - exp = new NotSupportedException(msg + " Not supported"); - break; - } - - case GeofenceError.PermissionDenied: - // fall through - case GeofenceError.GeofenceAccessDenied: - //fall through - case GeofenceError.PlaceAccessDenied: - { - exp = new UnauthorizedAccessException(msg + " Permission Denied"); - break; - } - - case GeofenceError.DBFailed: - { - exp = new InvalidOperationException(msg + " DataBase Failed"); - break; - } - - default: - { - exp = new InvalidOperationException(msg); - break; - } - } - - return exp; - } - } -} diff --git a/src/Tizen.Location.Geofence/Tizen.Location.Geofence/GeofenceEventArgs.cs b/src/Tizen.Location.Geofence/Tizen.Location.Geofence/GeofenceEventArgs.cs deleted file mode 100755 index b16ee117c..000000000 --- a/src/Tizen.Location.Geofence/Tizen.Location.Geofence/GeofenceEventArgs.cs +++ /dev/null @@ -1,164 +0,0 @@ -/* - * 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.Location.Geofence -{ - /// - /// Event arguments are passed when an event is triggered to notify the proximity state change. - /// - /// 3 - public class ProximityStateEventArgs : EventArgs - { - /// - /// The internal constructor. - /// - /// 3 - /// The geofence ID. - /// The proximity state. - /// The proximity provider. - internal ProximityStateEventArgs(int id, ProximityState state, ProximityProvider provider) - { - GeofenceId = id; - State = state; - Provider = provider; - } - - /// - /// The geofence ID. - /// - /// 3 - public int GeofenceId - { - get; - } - - /// - /// The proximity state. - /// - /// 3 - public ProximityState State - { - get; - } - - /// - /// The proximity provider. - /// - /// 3 - public ProximityProvider Provider - { - get; - } - }; - - /// - /// Event arguments are passed when an event is triggered to notify the geofence state change. - /// - /// 3 - public class GeofenceStateEventArgs : EventArgs - { - /// - /// The internal constructor. - /// - /// 3 - /// The specified geofence ID. - /// The geofence state. - internal GeofenceStateEventArgs(int fenceId, GeofenceState state) - { - GeofenceId = fenceId; - State = state; - } - - /// - /// The specified geofence ID. - /// - /// 3 - public int GeofenceId - { - get; - } - - /// - /// The geofence state. - /// - /// 3 - public GeofenceState State - { - get; - } - } - - /// - /// Event arguments are passed when an event occurs in geofence and the place, such as add, update, etc.. - /// - /// 3 - public class GeofenceResponseEventArgs : EventArgs - { - /// - /// The internal constructor. - /// - /// 3 - /// The place ID. - /// The specified geofence ID. - /// The error code for the particular action. - /// The result code for the particular place and geofence management. - internal GeofenceResponseEventArgs(int placeId, int fenceId, GeofenceError error, GeofenceEventType eventType) - { - PlaceId = placeId; - FenceId = fenceId; - ErrorCode = error; - EventType = eventType; - } - - /// - /// The place ID. - /// - /// 3 - public int PlaceId - { - get; - } - - /// - /// The specified geofence ID. - /// - /// 3 - public int FenceId - { - get; - } - - /// - /// The error code for the particular action. - /// - /// 3 - public GeofenceError ErrorCode - { - get; - } - - /// - /// The result code for the particular place and geofence management. - /// - /// 3 - public GeofenceEventType EventType - { - get; - } - }; -} diff --git a/src/Tizen.Location.Geofence/Tizen.Location.Geofence/GeofenceManager.cs b/src/Tizen.Location.Geofence/Tizen.Location.Geofence/GeofenceManager.cs deleted file mode 100755 index 20750f765..000000000 --- a/src/Tizen.Location.Geofence/Tizen.Location.Geofence/GeofenceManager.cs +++ /dev/null @@ -1,298 +0,0 @@ -/* - * 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.Location.Geofence -{ - /// - /// The Geofence Manager API provides service related to geofence (geo-fence). - /// Geofence is a virtual perimeter for a real-world geographic area. - /// This API provides functions to set geofence with a geopoint, MAC address of Wi-Fi, and Bluetooth address. - /// Also, notifications on events like changing in service status are provided. - /// There are two kinds of places and fences: - /// - /// Public places and fences are created by the MyPlace application that can be used by all applications. - /// Private places and fences are created by the specified application that can be used by the same application. - /// - /// Notifications can be received about the following events: - /// - /// Zone in when a device enters a specific area. - /// Zone out when a device exits a specific area. - /// Results and errors for each event requested to the geofence module. - /// - /// - /// 3 - public class GeofenceManager : IDisposable - { - private bool _disposed = false; - - internal IntPtr Handle - { - get; - set; - } - - /// - /// Creates a new Geofence manager. - /// - /// 3 - /// In case of out of memory condition. - /// In case of any system error. - /// In case the geofence is not supported. - public GeofenceManager() - { - IntPtr handle; - GeofenceError ret = (GeofenceError) Interop.GeofenceManager.Create(out handle); - if(ret != GeofenceError.None) - { - throw GeofenceErrorFactory.CreateException(ret, "Failed to create Geofence Manager instance"); - } - - Handle = handle; - } - - ~GeofenceManager() - { - Dispose(false); - } - - /// - /// Checks whether the Geofence manager is available or not. - /// - /// 3 - public static bool IsSupported - { - get - { - bool ret = false; - GeofenceError res= (GeofenceError)Interop.GeofenceManager.IsSupported(out ret); - if(res != GeofenceError.None) - { - Tizen.Log.Error(GeofenceErrorFactory.LogTag, "Failed to get IsSupported feature for Geofence manager"); - } - - return ret; - } - } - - /// - /// Starts the geofencing service. - /// - /// 3 - /// The specified geofence ID. - /// http://tizen.org/privilege/location - /// - /// When the location service is enabled, the StateChanged event is invoked and the service starts. - /// - /// In case of an invalid parameter. - /// In case of any system error. - /// In case privileges are not defined. - /// In case the geofence is not supported. - public void Start(int geofenceId) - { - GeofenceError ret = (GeofenceError)Interop.GeofenceManager.Start(Handle, geofenceId); - if (ret != GeofenceError.None) - { - throw GeofenceErrorFactory.CreateException(ret, "Failed to start service for " + geofenceId); - } - } - - /// - /// Stops the geofenceing service. - /// - /// 3 - /// The specified geofence ID. - /// http://tizen.org/privilege/location - /// - /// This function initiates the process of stopping the service. - /// You can stop and start the Geofence manager as needed. - /// - /// In case of an invalid parameter. - /// In case of any system error. - /// In case privileges are not defined. - /// In case the geofence is not supported. - public void Stop(int geofenceId) - { - GeofenceError ret = (GeofenceError)Interop.GeofenceManager.Stop(Handle, geofenceId); - if (ret != GeofenceError.None) - { - throw GeofenceErrorFactory.CreateException(ret, "Failed to stop service for " + geofenceId); - } - } - - private static readonly Interop.GeofenceManager.StateChangedCallback s_stateChangedCallback = (int fenceId, GeofenceState state, IntPtr data) => - { - GeofenceStateEventArgs evenArgs = new GeofenceStateEventArgs(fenceId, state); - s_stateChanged?.Invoke(null, evenArgs); - return true; - }; - - private static event EventHandler s_stateChanged = null; - - /// - /// Invokes when a device enters or exits the given geofence if this event is registered. - /// - /// 3 - /// - /// Call to Start() will invoke this event. - /// - /// In case the feature is not supported. - public event EventHandler StateChanged - { - add - { - if(s_stateChanged == null) - { - GeofenceError ret = (GeofenceError)Interop.GeofenceManager.SetStateChangedCB(Handle, s_stateChangedCallback, IntPtr.Zero); - if (ret != GeofenceError.None) - { - throw GeofenceErrorFactory.CreateException(ret, "Failed to register state change callback"); - } - } - s_stateChanged += value; - } - remove - { - s_stateChanged -= value; - if (s_stateChanged == null) - { - GeofenceError ret = (GeofenceError)Interop.GeofenceManager.UnsetStateChangedCB(Handle); - if (ret != GeofenceError.None) - { - throw GeofenceErrorFactory.CreateException(ret, "Failed to unregister state change callback"); - } - } - } - } - - private static readonly Interop.GeofenceManager.ProximityStateChangedCallback s_proximityChangedCallback = (int fenceId, ProximityState state, ProximityProvider provider, IntPtr data) => - { - ProximityStateEventArgs evenArgs = new ProximityStateEventArgs(fenceId, state, provider); - s_proximityChanged?.Invoke(null, evenArgs); - return true; - }; - - private static event EventHandler s_proximityChanged; - - /// - /// Called when the proximity state of a device is changed. - /// - /// 3 - /// - /// Call to Start() will invoke this event. - /// - /// In case the feature is not supported. - public event EventHandler ProximityChanged - { - add - { - if (s_proximityChanged == null) - { - GeofenceError ret = (GeofenceError)Interop.GeofenceManager.SetProximityStateCB(Handle, s_proximityChangedCallback, IntPtr.Zero); - if (ret != GeofenceError.None) - { - throw GeofenceErrorFactory.CreateException(ret, "Failed to register proximity change callback"); - } - s_proximityChanged += value; - } - } - remove - { - s_proximityChanged -= value; - if (s_proximityChanged == null) - { - GeofenceError ret = (GeofenceError)Interop.GeofenceManager.UnsetProximityStateCB(Handle); - if (ret != GeofenceError.None) - { - throw GeofenceErrorFactory.CreateException(ret, "Failed to un register proximity change callback"); - } - } - } - } - - private static readonly Interop.GeofenceManager.GeofenceEventCallback s_geofenceEventCallback = (int placeId, int fenceId, GeofenceError error, GeofenceEventType eventType, IntPtr data) => - { - GeofenceResponseEventArgs evenArgs = new GeofenceResponseEventArgs(placeId, fenceId, error, eventType); - s_geofenceEventChanged?.Invoke(null, evenArgs); - return true; - }; - - private static event EventHandler s_geofenceEventChanged; - - /// - /// Called when some event occurs in the geofence and the place, such as add, update, etc.. - /// The events of public geofence is also received if there are public geofences. - /// - /// 3 - /// - /// Call to Start() will invoke this event. - /// The value of place_id or geofence_id is -1 when the place ID or geofence ID is not assigned. - /// - /// In case the feature is not supported. - public event EventHandler GeofenceEventChanged - { - add - { - if (s_geofenceEventChanged == null) - { - GeofenceError ret = (GeofenceError)Interop.GeofenceManager.SetGeofenceEventCB(Handle, s_geofenceEventCallback, IntPtr.Zero); - if (ret != GeofenceError.None) - { - throw GeofenceErrorFactory.CreateException(ret, "Failed to register geofence event change callback"); - } - s_geofenceEventChanged += value; - } - } - remove - { - s_geofenceEventChanged -= value; - if (s_geofenceEventChanged == null) - { - GeofenceError ret = (GeofenceError)Interop.GeofenceManager.UnsetGeofenceEventCB(Handle); - if (ret != GeofenceError.None) - { - throw GeofenceErrorFactory.CreateException(ret, "Failed to unregister geofence event change callback"); - } - } - } - } - - /// - /// The overloaded Dispose API for destroying the GeofenceManager handle. - /// - /// 3 - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - - private void Dispose(bool disposing) - { - if (_disposed) - return; - - if (Handle != IntPtr.Zero) - { - Interop.GeofenceManager.Destroy(Handle); - Handle = IntPtr.Zero; - } - - _disposed = true; - } - } -} diff --git a/src/Tizen.Location.Geofence/Tizen.Location.Geofence/NamespaceDoc.cs b/src/Tizen.Location.Geofence/Tizen.Location.Geofence/NamespaceDoc.cs deleted file mode 100755 index 7944fc4c0..000000000 --- a/src/Tizen.Location.Geofence/Tizen.Location.Geofence/NamespaceDoc.cs +++ /dev/null @@ -1,33 +0,0 @@ -/** - -The Tizen.Location.Geofence namespace provides classes for virtual perimeter. - - - -

Overview

- -This API provides functions to set the gofence with a geopoint, MAC address of Wi-Fi, and Bluetooth address. -Also, notifications on events like changing in service status are provided.

-There are two kinds of places and fences:
-- Public places and fences that are created by the MyPlace application can be used by all applications.
-- Private places and fences that are created by the specified application can be used by the same application.

-Notifications can be received about the following events:
-- Zone in when a device enters a specific area.
-- Zone out when a device exits a specific area.
-- Results and errors for each event requested to geofence module.

-The Geofence manager has the following properties:
-- The geofence type.
-- The status.
-- 'Service state change' callback - - -

Related Features

-To guarantee that the geofence application runs on a device with the geofence profile feature, -declare the following feature requirements in the config file:
-http://tizen.org/feature/location
-http://tizen.org/feature/location.Geofence
-http://tizen.org/feature/location.wps -
-
-*/ -namespace Tizen.Location.Geofence {} diff --git a/src/Tizen.Location.Geofence/Tizen.Location.Geofence/VirtualPerimeter.cs b/src/Tizen.Location.Geofence/Tizen.Location.Geofence/VirtualPerimeter.cs deleted file mode 100755 index 3923657bc..000000000 --- a/src/Tizen.Location.Geofence/Tizen.Location.Geofence/VirtualPerimeter.cs +++ /dev/null @@ -1,269 +0,0 @@ -/* - * 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.Collections.Generic; - -namespace Tizen.Location.Geofence -{ - /// - /// Allows to create a virtual fence as geofence using the GeofenceManager instance. - /// A user can manage all the geofence or place related data and events. - /// - /// 3 - public class VirtualPerimeter - { - private IntPtr Handle; - - /// - /// Creates a VirtualPerimeter which can be used to create a virtual fence. - /// - /// 3 - /// The GeofenceManager instance. - /// In case of an invalid parameter. - public VirtualPerimeter(GeofenceManager manager) - { - if (manager == null) - { - throw GeofenceErrorFactory.CreateException(GeofenceError.InvalidParameter, "Invalid GeofenceManager instance"); - } - else - { - Handle = manager.Handle; - } - } - - /// - /// Creates a new place for the geofencing service. - /// - /// 3 - /// A place name to be created. - /// The place ID to be newly created on success. - /// http://tizen.org/privilege/location - /// In case of an invalid parameter. - /// In case of any system error. - /// In case privileges are not defined. - /// In case the geofence is not supported. - public int AddPlaceName(string name) - { - int placeId = 0; - GeofenceError ret = (GeofenceError)Interop.VirtualPerimeter.AddPlace(Handle, name, out placeId); - if (ret != GeofenceError.None) - { - throw GeofenceErrorFactory.CreateException(ret, "Failed to add place to Geofence Manager for " + name); - } - - return placeId; - } - - /// - /// Updates the place name of a given place ID. - /// - /// 3 - /// The specified place ID. - /// A new place name of the place ID. - /// http://tizen.org/privilege/location - /// In case of an invalid parameter. - /// In case of any System error. - /// In case privileges are not defined. - /// In case the geofence is not supported. - public void UpdatePlace(int placeId, string name) - { - GeofenceError ret = (GeofenceError)Interop.VirtualPerimeter.UpdatePlace(Handle, placeId, name); - if (ret != GeofenceError.None) - { - throw GeofenceErrorFactory.CreateException(ret, "Failed to update place to Geofence Manager for " + placeId); - } - } - - /// - /// Removes the specific place for the geofencing service. - /// - /// 3 - /// The specified place ID. - /// http://tizen.org/privilege/location - /// Incase of an invalid parameter. - /// In case of any system error. - /// In case privileges are not defined. - /// In case the geofence is not supported. - public void RemovePlace(int placeId) - { - GeofenceError ret = (GeofenceError)Interop.VirtualPerimeter.RemovePlace(Handle, placeId); - if (ret != GeofenceError.None) - { - throw GeofenceErrorFactory.CreateException(ret, "Failed to remove place from Geofence Manager for " + placeId); - } - } - - /// - /// Adds the geofence for a given Geofence manager. - /// - /// 3 - /// The geofence instance to be added. - /// The geofence ID to be newly created on success. - /// The return value will always be a number greater than zero. - /// http://tizen.org/privilege/location - /// In case of an invalid parameter. - /// In case of any system error. - /// In case privileges are not defined. - /// In case the geofence is not supported. - public int AddGeofence(Fence fence) - { - int fenceId = 0; - GeofenceError ret = (GeofenceError)Interop.VirtualPerimeter.AddFence(Handle, fence.Handle, out fenceId); - if (ret != GeofenceError.None) - { - throw GeofenceErrorFactory.CreateException(ret, "Failed to add fence to Geofence Manager "); - } - - return fenceId; - } - - /// - /// Removes the geofence with a given geofence ID. - /// - /// 3 - /// The specified geofence ID. - /// http://tizen.org/privilege/location - /// In case of an invalid parameter. - /// In case of any system error. - /// In case privileges are not defined. - /// In case the geofence is not supported. - public void RemoveGeofence(int fenceId) - { - GeofenceError ret = (GeofenceError)Interop.VirtualPerimeter.RemoveFence(Handle, fenceId); - if (ret != GeofenceError.None) - { - throw GeofenceErrorFactory.CreateException(ret, "Failed to remove geofence from Geofence Manager for " + fenceId); - } - } - - /// - /// Gets the name of place. - /// - /// 3 - /// The place ID. - /// The name of the place. - /// http://tizen.org/privilege/location - /// In case of an invalid parameter. - /// In case of any system error. - /// In case privileges are not defined. - /// In case the geofence is not supported. - public string GetPlaceName(int placeId) - { - string name = ""; - GeofenceError ret = (GeofenceError)Interop.VirtualPerimeter.GetPlaceName(Handle, placeId, out name); - if (ret != GeofenceError.None) - { - throw GeofenceErrorFactory.CreateException(ret, "Failed to get placenamefrom Geofence Manager for " + placeId); - } - - return name; - } - - /// - /// Retrieves a list of places registered in the specified Geofence manager. - /// - /// 3 - /// List of places registered as the PlaceData instance list. - /// http://tizen.org/privilege/location - /// In case of any system error. - /// In case privileges are not defined. - /// In case the geofence is not supported. - public IEnumerable GetPlaceDataList() - { - List places = new List(); - Interop.VirtualPerimeter.ForEachPlaceListCallback placeCallback = (int placeId, string name, int index, int count, IntPtr data) => - { - if (count != 0) - { - PlaceData place = new PlaceData(placeId, name, index, count); - places.Add(place); - } - return true; - }; - - GeofenceError ret = (GeofenceError)Interop.VirtualPerimeter.GetForEachPlaceList(Handle, placeCallback, IntPtr.Zero); - if (ret != GeofenceError.None) - { - throw GeofenceErrorFactory.CreateException(ret, "Failed to get Places list from Geofence Manager "); - } - - return places; - } - - /// - /// Retrieves a list of fences registered in the specified Geofence manager. - /// - /// 3 - /// List of FenceData instances registered for each geofence. - /// http://tizen.org/privilege/location - /// In case of any system error. - /// In case privileges are not defined. - /// In case geofence is not supported. - public IEnumerable GetFenceDataList() - { - List fences = new List(); - Interop.VirtualPerimeter.ForEachFenceListCallback callback = (int fenceId, IntPtr handle, int index, int count, IntPtr data) => - { - if (count != 0) - { - FenceData fence = new FenceData(fenceId, handle, index, count); - fences.Add(fence); - } - return true; - }; - - GeofenceError ret = (GeofenceError)Interop.VirtualPerimeter.GetForEachFenceList(Handle, callback, IntPtr.Zero); - if (ret != GeofenceError.None) - { - throw GeofenceErrorFactory.CreateException(ret, "Failed to get Geofence list from Geofence Manager "); - } - - return fences; - } - - /// - /// Retrieves a list of fences registered in the specified place. - /// - /// 3 - /// The place ID. - /// The list of FenceData instances registered for each geofence for the specified place. - /// http://tizen.org/privilege/location - /// In case of an invalid parameter. - /// In case of any system error. - /// In case privileges are not defined. - /// In case the geofence is not supported. - public IEnumerable GetGeofenceDataListByPlaceId(int placeId) - { - List fences = new List(); - Interop.VirtualPerimeter.ForEachFenceListCallback callback = (int fenceId, IntPtr handle, int index, int count, IntPtr data) => - { - FenceData fence = new FenceData(fenceId, handle, index, count); - fences.Add(fence); - return true; - }; - - GeofenceError ret = (GeofenceError)Interop.VirtualPerimeter.GetForEachPlaceFenceList(Handle, placeId, callback, IntPtr.Zero); - if (ret != GeofenceError.None) - { - throw GeofenceErrorFactory.CreateException(ret, "Failed to get Geofence list from Geofence Manager for " + placeId); - } - - return fences; - } - } -} diff --git a/src/Tizen.Location/Interop/Interop.Libraries.cs b/src/Tizen.Location/Interop/Interop.Libraries.cs deleted file mode 100755 index 7fd22e033..000000000 --- a/src/Tizen.Location/Interop/Interop.Libraries.cs +++ /dev/null @@ -1,24 +0,0 @@ -/* - * 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 - { - internal const string Location = "libcapi-location-manager.so.0"; - internal const string Libc = "libc.so.6"; - } -} \ No newline at end of file diff --git a/src/Tizen.Location/Interop/Interop.Location.cs b/src/Tizen.Location/Interop/Interop.Location.cs deleted file mode 100755 index dd9e568ad..000000000 --- a/src/Tizen.Location/Interop/Interop.Location.cs +++ /dev/null @@ -1,215 +0,0 @@ -/* - * 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; -using Tizen.Location; - -internal static partial class Interop -{ - internal static partial class Locator - { - [DllImport(Libraries.Location, EntryPoint = "location_manager_create")] - internal static extern int Create(int locationMethod, out IntPtr handle); - - [DllImport(Libraries.Location, EntryPoint = "location_manager_destroy")] - internal static extern int Destroy(IntPtr handle); - - [DllImport(Libraries.Location, EntryPoint = "location_manager_start")] - internal static extern int Start(IntPtr handle); - - [DllImport(Libraries.Location, EntryPoint = "location_manager_stop")] - internal static extern int Stop(IntPtr handle); - - [DllImport(Libraries.Location, EntryPoint = "location_manager_start_batch")] - internal static extern int StartBatch(IntPtr handle); - - [DllImport(Libraries.Location, EntryPoint = "location_manager_stop_batch")] - internal static extern int StopBatch(IntPtr handle); - - [DllImport(Libraries.Location, EntryPoint = "location_manager_is_enabled_mock_location")] - internal static extern int IsEnabledMock(out bool status); - - [DllImport(Libraries.Location, EntryPoint = "location_manager_enable_mock_location")] - internal static extern int EnableMock(bool enable); - - [DllImport(Libraries.Location, EntryPoint = "location_manager_set_mock_location")] - internal static extern int SetMockLocation(IntPtr handle, double latitude, double longitude, double altitude, double speed, double direction, double accuracy); - - [DllImport(Libraries.Location, EntryPoint = "location_manager_clear_mock_location")] - internal static extern int ClearMock(IntPtr handle); - - [DllImport(Libraries.Location, EntryPoint = "location_manager_get_location")] - internal static extern int GetLocation(IntPtr handle, out double altitude, out double latitude, out double longitude, out double climb, out double direction, out double speed, out int level, out double horizontal, out double vertical, out int timestamp); - - [DllImport(Libraries.Location, EntryPoint = "location_manager_get_last_location")] - internal static extern int GetLastLocation(IntPtr handle, out double altitude, out double latitude, out double longitude, out double climb, out double direction, out double speed, out int level, out double horizontal, out double vertical, out int timestamp); - - [DllImport(Libraries.Location, EntryPoint = "location_manager_add_boundary")] - internal static extern int AddBoundary(IntPtr managerHandle, IntPtr boundsHandle); - - [DllImport(Libraries.Location, EntryPoint = "location_manager_remove_boundary")] - internal static extern int RemoveBoundary(IntPtr managerHandle, IntPtr boundsHandle); - } - - internal static partial class LocatorHelper - { - [DllImport(Libraries.Location, EntryPoint = "location_manager_is_enabled_method")] - internal static extern int IsEnabled(int locationMethod, out bool status); - - [DllImport(Libraries.Location, EntryPoint = "location_manager_enable_method")] - internal static extern int EnableType(int locationMethod, bool status); - - [DllImport(Libraries.Location, EntryPoint = "location_manager_is_supported_method")] - internal static extern bool IsSupported(int locationMethod); - } - - internal static partial class Location - { - [DllImport(Libraries.Location, EntryPoint = "location_manager_get_distance")] - internal static extern int GetDistanceBetween(double startLatitude, double startLongitude, double endLatitude, double endLongitude, out double distance); - } - - internal static partial class LocatorEvent - { - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void ServiceStatechangedCallback(ServiceState state, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void ZonechangedCallback(BoundaryState state, double latitude, double longitude, double altitude, int timesatmp, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void SettingchangedCallback(LocationType method, bool enable, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void LocationchangedCallback(double latitude, double longitude, double altitude, double speed, double direction, double accuracy, int timeStamp, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void LocationUpdatedCallback(LocationError error, double latitude, double longitude, double altitude, int timestamp, double speed, double direction, double climb, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void LocationBatchCallback(int batch_size, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void LocationBatchGetCallback(double latitude, double longitude, double altitude, double speed, double direction, double horizontal, double vertical, int timeStamp, IntPtr userData); - - [DllImport(Libraries.Location, EntryPoint = "location_manager_set_service_state_changed_cb")] - internal static extern int SetServiceStateChangedCallback(IntPtr handle, ServiceStatechangedCallback callback, IntPtr userData); - - [DllImport(Libraries.Location, EntryPoint = "location_manager_unset_service_state_changed_cb")] - internal static extern int UnSetServiceStateChangedCallback(IntPtr handle); - - [DllImport(Libraries.Location, EntryPoint = "location_manager_set_zone_changed_cb")] - internal static extern int SetZoneChangedCallback(IntPtr handle, ZonechangedCallback callback, IntPtr userData); - - [DllImport(Libraries.Location, EntryPoint = "location_manager_unset_zone_changed_cb")] - internal static extern int UnSetZoneChangedCallback(IntPtr handle); - - [DllImport(Libraries.Location, EntryPoint = "location_manager_set_setting_changed_cb")] - internal static extern int SetSettingChangedCallback(int method, SettingchangedCallback callback, IntPtr userData); - - [DllImport(Libraries.Location, EntryPoint = "location_manager_unset_setting_changed_cb")] - internal static extern int UnSetSettingChangedCallback(int method); - - [DllImport(Libraries.Location, EntryPoint = "location_manager_set_distance_based_location_changed_cb")] - internal static extern int SetDistanceBasedLocationChangedCallback(IntPtr handle, LocationchangedCallback callback, int interval, double distance, IntPtr userData); - - [DllImport(Libraries.Location, EntryPoint = "location_manager_unset_distance_based_location_changed_cb")] - internal static extern int UnSetDistanceBasedLocationChangedCallback(IntPtr handle); - - [DllImport(Libraries.Location, EntryPoint = "location_manager_set_location_changed_cb")] - internal static extern int SetLocationChangedCallback(IntPtr handle, LocationchangedCallback callback, int interval, IntPtr userData); - - [DllImport(Libraries.Location, EntryPoint = "location_manager_unset_location_changed_cb")] - internal static extern int UnSetLocationChangedCallback(IntPtr handle); - - [DllImport(Libraries.Location, EntryPoint = "location_manager_set_location_batch_cb")] - internal static extern int SetLocationBatchCallback(IntPtr handle, LocationBatchCallback callback, int batchInterval, int batchPeriod, IntPtr userData); - - [DllImport(Libraries.Location, EntryPoint = "location_manager_unset_location_batch_cb")] - internal static extern int UnSetLocationBatchCallback(IntPtr handle); - - [DllImport(Libraries.Location, EntryPoint = "location_manager_foreach_location_batch")] - internal static extern int GetLocationBatch(IntPtr handle, LocationBatchGetCallback callback, IntPtr userData); - - [DllImport(Libraries.Location, EntryPoint = "location_manager_request_single_location")] - internal static extern int GetSingleLocation(IntPtr handle, int timeout, LocationUpdatedCallback callback, IntPtr userData); - } - - internal static partial class LocationBoundary - { - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool PolygonCoordinatesCallback(Coordinate coordinates, IntPtr userData); - - [DllImport(Libraries.Location, EntryPoint = "location_bounds_create_rect")] - internal static extern int CreateRectangularBoundary(Coordinate topLeft, Coordinate bottomLeft, out IntPtr boundsHandle); - - [DllImport(Libraries.Location, EntryPoint = "location_bounds_create_circle")] - internal static extern int CreateCircleBoundary(Coordinate center, double radius, out IntPtr boundsHandle); - - [DllImport(Libraries.Location, EntryPoint = "location_bounds_create_polygon")] - internal static extern int CreatePolygonBoundary(IntPtr list, int listLength, out IntPtr boundsHandle); - - [DllImport(Libraries.Location, EntryPoint = "location_bounds_get_rect_coords")] - internal static extern int GetRectangleCoordinates(IntPtr handle, out Coordinate topLeft, out Coordinate bottomRight); - - [DllImport(Libraries.Location, EntryPoint = "location_bounds_get_circle_coords")] - internal static extern int GetCircleCoordinates(IntPtr handle, out Coordinate center, out double radius); - - [DllImport(Libraries.Location, EntryPoint = "location_bounds_foreach_polygon_coords")] - internal static extern int GetForEachPolygonCoordinates(IntPtr handle, PolygonCoordinatesCallback callback, IntPtr userData); - - [DllImport(Libraries.Location, EntryPoint = "location_bounds_contains_coordinates")] - internal static extern bool IsValidCoordinates(IntPtr handle, Coordinate coordinate); - - [DllImport(Libraries.Location, EntryPoint = "location_bounds_destroy")] - internal static extern int DestroyBoundary(IntPtr handle); - } - - internal static partial class GpsSatellite - { - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void SatelliteStatuschangedCallback(uint numActive, uint numInView, int timeStamp, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool SatelliteStatusinfomationCallback(uint azimuth, uint elevation, uint prn, uint snr, bool active, IntPtr userData); - - [DllImport(Libraries.Location, EntryPoint = "gps_status_get_nmea")] - internal static extern int GetNMEAData(IntPtr handle, out string nmea); - - [DllImport(Libraries.Location, EntryPoint = "gps_status_get_satellite")] - internal static extern int GetSatelliteStatus(IntPtr handle, out uint numberOfActive, out uint numberInView, out int timestamp); - - [DllImport(Libraries.Location, EntryPoint = "gps_status_set_satellite_updated_cb")] - internal static extern int SetSatelliteStatusChangedCallback(IntPtr handle, SatelliteStatuschangedCallback callback, int interval, IntPtr userData); - - [DllImport(Libraries.Location, EntryPoint = "gps_status_unset_satellite_updated_cb")] - internal static extern int UnSetSatelliteStatusChangedCallback(IntPtr handle); - - [DllImport(Libraries.Location, EntryPoint = "gps_status_foreach_satellites_in_view")] - internal static extern int GetForEachSatelliteInView(IntPtr handle, SatelliteStatusinfomationCallback callback, IntPtr userData); - } - - internal static DateTime ConvertDateTime(int timestamp) - { - DateTime dateTime = DateTime.Now; - - DateTime start = DateTime.SpecifyKind(new DateTime(1970, 1, 1).AddSeconds(timestamp), DateTimeKind.Utc); - dateTime = start.ToLocalTime(); - - return dateTime; - } -} diff --git a/src/Tizen.Location/Tizen.Location.csproj b/src/Tizen.Location/Tizen.Location.csproj deleted file mode 100644 index 7f4584ffe..000000000 --- a/src/Tizen.Location/Tizen.Location.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - netstandard2.0 - - - - - - - - diff --git a/src/Tizen.Location/Tizen.Location.sln b/src/Tizen.Location/Tizen.Location.sln deleted file mode 100755 index 98a5ac65d..000000000 --- a/src/Tizen.Location/Tizen.Location.sln +++ /dev/null @@ -1,34 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26430.12 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Location", "Tizen.Location.csproj", "{930A56B0-AE35-470A-8A56-6F762B4964AC}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen", "..\Tizen\Tizen.csproj", "{53D6289A-C30A-4D18-A49F-BB3C3ECC15A8}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Log", "..\Tizen.Log\Tizen.Log.csproj", "{B75B5672-8C3C-433E-9A5D-20A7CC70E4F9}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {930A56B0-AE35-470A-8A56-6F762B4964AC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {930A56B0-AE35-470A-8A56-6F762B4964AC}.Debug|Any CPU.Build.0 = Debug|Any CPU - {930A56B0-AE35-470A-8A56-6F762B4964AC}.Release|Any CPU.ActiveCfg = Release|Any CPU - {930A56B0-AE35-470A-8A56-6F762B4964AC}.Release|Any CPU.Build.0 = Release|Any CPU - {53D6289A-C30A-4D18-A49F-BB3C3ECC15A8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {53D6289A-C30A-4D18-A49F-BB3C3ECC15A8}.Debug|Any CPU.Build.0 = Debug|Any CPU - {53D6289A-C30A-4D18-A49F-BB3C3ECC15A8}.Release|Any CPU.ActiveCfg = Release|Any CPU - {53D6289A-C30A-4D18-A49F-BB3C3ECC15A8}.Release|Any CPU.Build.0 = Release|Any CPU - {B75B5672-8C3C-433E-9A5D-20A7CC70E4F9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B75B5672-8C3C-433E-9A5D-20A7CC70E4F9}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B75B5672-8C3C-433E-9A5D-20A7CC70E4F9}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B75B5672-8C3C-433E-9A5D-20A7CC70E4F9}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/src/Tizen.Location/Tizen.Location/GpsSatellite.cs b/src/Tizen.Location/Tizen.Location/GpsSatellite.cs deleted file mode 100755 index 254bfb64f..000000000 --- a/src/Tizen.Location/Tizen.Location/GpsSatellite.cs +++ /dev/null @@ -1,353 +0,0 @@ -/* - * 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.Collections.Generic; -using System.Runtime.InteropServices; - -namespace Tizen.Location -{ - /// - /// This class contains the functionality for obtaining information about GPS satellites in the range and in use. - /// - /// 3 - public class GpsSatellite - { - private int _interval = 1; - private Locator _locator; - private EventHandler _satelliteStatusChanged; - private IntPtr _handle = IntPtr.Zero; - - private Interop.GpsSatellite.SatelliteStatuschangedCallback _satelliteStatuschangedCallback; - private Interop.GpsSatellite.SatelliteStatusinfomationCallback _satelliteStatusinfomationCallback; - - /// - /// The time interval between callback updates. - /// Should be in the range of 1~120 seconds. - /// - /// 3 - /// Thrown when an an invalid argument is used. - public int Interval - { - get - { - Log.Info(Globals.LogTag, "Getting the Callback Interval"); - return _interval; - } - set - { - Log.Info(Globals.LogTag, "Setting the Callback Interval"); - if (value > 0 && value <= 120) - { - _interval = value; - } - else - { - Log.Error(Globals.LogTag, "Error Setting the Callback Interval"); - throw LocationErrorFactory.ThrowLocationException((int)LocationError.InvalidParameter); - } - } - } - - /// - /// The NMEA data from the satellite. - /// - /// 3 - /// Thrown when the operation is invalid for the current state. - /// Thrown when an invalid argument is used. - /// Thrown when the application has no privilege to use the location. - /// Thrown when the location is not supported. - public string Nmea - { - get - { - Log.Info(Globals.LogTag, "Getting NMEAData"); - return GetNmea(); - } - } - - private string GetNmea() - { - string value = null; - int ret = Interop.GpsSatellite.GetNMEAData(_handle, out value); - if (((LocationError)ret != LocationError.None)) - { - Log.Error(Globals.LogTag, "Error getting the NMEAData," + (LocationError)ret); - throw LocationErrorFactory.ThrowLocationException(ret); - } - - return value; - } - - - /// - /// The count of active satellites. - /// - /// 3 - /// http://tizen.org/privilege/location - /// Thrown when the operation is invalid for the current state. - /// Thrown when an invalid argument is used. - /// Thrown when the application has no privilege to use the location. - /// Thrown when the location is not supported. - public int ActiveCount - { - get - { - return (int)GetActiveCount(); - } - } - - private uint GetActiveCount() - { - Log.Info(Globals.LogTag, "Getting the ActiveCount of satellites"); - uint numActive = 0; - uint numInView; - int timestamp; - int ret = Interop.GpsSatellite.GetSatelliteStatus(_handle, out numActive, out numInView, out timestamp); - if (((LocationError)ret != LocationError.None)) - { - Log.Error(Globals.LogTag, "Error getting the satellite" + (LocationError)ret); - throw LocationErrorFactory.ThrowLocationException(ret); - } - return numActive; - } - - /// - /// The count of satellites in view. - /// - /// 3 - /// http://tizen.org/privilege/location - /// Thrown when the operation is invalid for the current state. - /// Thrown when an invalid argument is used. - /// Thrown when the application has no privilege to use the location. - /// Thrown when the location is not supported. - public int InViewCount - { - get - { - return (int)GetInViewCount(); - } - } - - private uint GetInViewCount() - { - Log.Info(Globals.LogTag, "Getting the In view count of satellites"); - uint numActive; - uint numInView = 0; - int timestamp; - int ret = Interop.GpsSatellite.GetSatelliteStatus(_handle, out numActive, out numInView, out timestamp); - if (((LocationError)ret != LocationError.None)) - { - Log.Error(Globals.LogTag, "Error getting the satellite" + (LocationError)ret); - throw LocationErrorFactory.ThrowLocationException(ret); - } - return numInView; - } - - /// - /// The list of satellites or last recorded satellites in view. - /// - /// 3 - /// http://tizen.org/privilege/location - /// Thrown when the operation is invalid for the current state. - /// Thrown when an invalid argument is used. - /// Thrown when the application has no privilege to use the location. - /// Thrown when the location is not supported. - public IList Satellites - { - get - { - return GetSatellites(); - } - } - - private IList GetSatellites() - { - List satelliteList = new List(); - Log.Info(Globals.LogTag, "Getting the list of satellites"); - - _satelliteStatusinfomationCallback = (azimuth, elevation, prn, snr, active, userData) => - { - SatelliteInformation satellite = new SatelliteInformation(azimuth, elevation, prn, snr, active); - satelliteList.Add(satellite); - return true; - }; - - int ret = Interop.GpsSatellite.GetForEachSatelliteInView(_handle, _satelliteStatusinfomationCallback, IntPtr.Zero); - if (((LocationError)ret != LocationError.None)) - { - Log.Error(Globals.LogTag, "Error getting the satellite" + (LocationError)ret); - throw LocationErrorFactory.ThrowLocationException(ret); - } - return satelliteList; - } - - /// - /// The constructor of the GpsSatellite class. - /// - /// 3 - /// The locator object initilized using GPS. - /// Thrown when an invalid argument is used. - public GpsSatellite(Locator locator) - { - Log.Info(Globals.LogTag, "Calling GpsSatellite constructor"); - if (locator == null) - { - Log.Error(Globals.LogTag, "locator is null"); - throw LocationErrorFactory.ThrowLocationException((int)LocationError.InvalidParameter); - } - - LocationType method = locator.LocationType; - if (method.Equals(LocationType.Gps) || method.Equals(LocationType.Hybrid)) - { - _locator = locator; - _handle = _locator.GetHandle(); - } - else - { - Log.Error(Globals.LogTag, "Error constructing GpsSatellite class"); - throw LocationErrorFactory.ThrowLocationException((int)LocationError.InvalidParameter); - } - } - - /// - /// The SatelliteStatusUpdated event is raised whenever the satellite information is updated. - /// The callback will be invoked periodically (every Interval seconds). - /// - /// 3 - /// http://tizen.org/privilege/location - /// Thrown when an invalid argument is used. - /// Thrown when the application has no privilege to use the location. - /// Thrown when the location is not supported. - public event EventHandler SatelliteStatusUpdated - { - add - { - Log.Info(Globals.LogTag, "SatelliteStatusUpdated Add called"); - if (_satelliteStatusChanged == null) - { - Log.Info(Globals.LogTag, "SetSatelliteStatusChangeCallback called"); - SetSatelliteStatusChangeCallback(); - } - _satelliteStatusChanged += value; - } - remove - { - Log.Info(Globals.LogTag, "SatelliteStatusUpdated Remove called"); - _satelliteStatusChanged -= value; - if (_satelliteStatusChanged == null) - { - Log.Info(Globals.LogTag, "UnSetSatelliteStatusChangeCallback called"); - UnSetSatelliteStatusChangeCallback(); - } - } - } - - private void SetSatelliteStatusChangeCallback() - { - Log.Info(Globals.LogTag, "SetSatelliteStatusChangeCallback"); - if (_satelliteStatuschangedCallback == null) - { - _satelliteStatuschangedCallback = (numActive, numInView, timestamp, userData) => - { - Log.Info(Globals.LogTag, "Inside SatelliteStatusChangedCallback"); - DateTime timeStamp = DateTime.Now; - - if (timestamp != 0) - { - DateTime start = DateTime.SpecifyKind(new DateTime(1970, 1, 1).AddSeconds(timestamp), DateTimeKind.Utc); - timeStamp = start.ToLocalTime(); - } - _satelliteStatusChanged?.Invoke(_handle, new SatelliteStatusChangedEventArgs(numActive, numInView, timeStamp)); - }; - } - - GCHandle handle = GCHandle.Alloc(this); - int ret = Interop.GpsSatellite.SetSatelliteStatusChangedCallback(_handle, _satelliteStatuschangedCallback, _interval, GCHandle.ToIntPtr(handle)); - if (((LocationError)ret != LocationError.None)) - { - Log.Error(Globals.LogTag, "Error in setting satellite status changed callback," + (LocationError)ret); - throw LocationErrorFactory.ThrowLocationException(ret); - } - } - - private void UnSetSatelliteStatusChangeCallback() - { - Log.Info(Globals.LogTag, "UnSetSatelliteStatusChangeCallback"); - int ret = Interop.GpsSatellite.UnSetSatelliteStatusChangedCallback(_handle); - if (((LocationError)ret != LocationError.None)) - { - Log.Error(Globals.LogTag, "Error in Getting Unsetting satellite status changed callback," + (LocationError)ret); - throw LocationErrorFactory.ThrowLocationException(ret); - } - } - } - - /// - /// This class contains the information of the satellite under consideration. - /// - /// 3 - public class SatelliteInformation - { - /// - /// The Class constructor for the SatelliteInformation class. - /// - /// 3 - /// The azimuth value of the satellite in degrees. - /// The elevation of the satellite in meters. - /// The PRN value of the satellite. - /// The SNR value of the satellite in dB. - /// The flag signaling if the satellite is in use. - public SatelliteInformation(uint azimuth, uint elevation, uint prn, uint snr, bool active) - { - Azimuth = azimuth; - Elevation = elevation; - Prn = prn; - Snr = snr; - Active = active; - } - - /// - /// The azimuth information of the satellite. - /// - /// 3 - public uint Azimuth { get; private set; } - - /// - /// The elevation information of the satellite. - /// - /// 3 - public uint Elevation { get; private set; } - - /// - /// The PRN of the satellite. - /// - /// 3 - public uint Prn { get; private set; } - - /// - /// The SNR of the satellite. - /// - /// 3 - public uint Snr { get; private set; } - - /// - /// The operational status of the satellite. - /// - /// 3 - public bool Active { get; private set; } - } -} diff --git a/src/Tizen.Location/Tizen.Location/Location.cs b/src/Tizen.Location/Tizen.Location/Location.cs deleted file mode 100755 index 6b37212e2..000000000 --- a/src/Tizen.Location/Tizen.Location/Location.cs +++ /dev/null @@ -1,246 +0,0 @@ -/* - * 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.Collections.Generic; - -namespace Tizen.Location -{ - /// - /// This class contains details of the location requested. - /// Includes the functionality to get the distance between locations. - /// - /// 3 - public class Location - { - private double _latitude; - private double _longitude; - private double _altitude; - private double _speed; - private double _direction; - private double _accuracy; - internal int _timestamp; - - /// - /// The default constructor of the Location class. - /// - /// 3 - public Location() - { - } - - /// - /// The parameterized constructor of the Location class. - /// - /// 3 - /// The latitude component of the device co-ordinate [-90.0 ~ 90.0] (degrees). - /// The longitude component of the device co-ordinate[-180.0 ~ 180.0] (degrees). - /// The altitude value. - /// The accuracy in meters. - /// The device speed. - /// The device direction with respect to the north. - /// Time when the measurement took place. - /// Thrown when an invalid argument is used. - public Location(double latitude, double longitude, double altitude, double speed, double direction, double accuracy, int timestamp) - { - _latitude = latitude; - _longitude = longitude; - _altitude = altitude; - _speed = speed; - _direction = direction; - _accuracy = accuracy; - _timestamp = timestamp; - } - - /// - /// The current latitude [-90.0 ~ 90.0] (degrees). - /// - /// 3 - public double Latitude - { - get - { - Log.Info(Globals.LogTag, "Getting the latitude"); - return _latitude; - } - set - { - Log.Info(Globals.LogTag, "Setting the latitude"); - if (value >= -90.0 && value <= 90.0) - { - _latitude = value; - } - else - { - Log.Error(Globals.LogTag, "Error setting latitude"); - throw LocationErrorFactory.ThrowLocationException((int)LocationError.InvalidParameter); - } - } - } - - /// - /// The current longitude [-180.0 ~ 180.0] (degrees). - /// - /// 3 - public double Longitude - { - get - { - Log.Info(Globals.LogTag, "Getting the longitude"); - return _longitude; - } - set - { - Log.Info(Globals.LogTag, "Setting the longitude"); - if (value >= -180.0 && value <= 180.0) - { - _longitude = value; - } - else - { - Log.Error(Globals.LogTag, "Error setting longitude"); - throw LocationErrorFactory.ThrowLocationException((int)LocationError.InvalidParameter); - } - } - } - - /// - /// The current altitude (meters). - /// - /// 3 - public double Altitude - { - get - { - return _altitude; - } - set - { - _altitude = value; - } - } - - /// - /// The device speed (km/h). - /// - /// 3 - public double Speed - { - get - { - return _speed; - } - set - { - _speed = value; - } - } - - /// - /// The direction and degrees from the north. - /// - /// 3 - public double Direction - { - get - { - return _direction; - } - set - { - _direction = value; - } - } - - /// - /// The accuracy. - /// - /// 3 - public double Accuracy - { - get - { - return _accuracy; - } - set - { - _accuracy = value; - } - } - - /// - /// The time value when the measurement was done. - /// - /// 3 - public DateTime Timestamp - { - get - { - return Interop.ConvertDateTime(_timestamp); - } - internal set - { - Timestamp = value; - } - - } - - /// - /// Gets the distance between the two given coordinates. - /// - /// 3 - /// The latitude of the source location [-90.0 ~ 90.0] (degrees). - /// The longitude of the source location[-180.0 ~ 180.0] (degrees). - /// The latitude of the source location [-90.0 ~ 90.0] (degrees). - /// The longitude of the source location[-180.0 ~ 180.0] (degrees). - /// Returns the distance between the source and the destination. - /// Thrown when an invalid argument is used. - /// Thrown when the location is not supported. - public static double GetDistanceBetween(double startLatitude, double startLongitude, double endLatitude, double endLongitude) - { - double result; - Log.Info(Globals.LogTag, "Calling GetDistanceBetween"); - int ret = Interop.Location.GetDistanceBetween(startLatitude, startLongitude, endLatitude, endLongitude, out result); - if (((LocationError)ret != LocationError.None)) - { - Log.Error(Globals.LogTag, "Error getting single distance information ," + (LocationError)ret); - throw LocationErrorFactory.ThrowLocationException(ret); - } - return result; - } - - /// - /// Gets the distance between the current and the specified location. - /// - /// 3 - /// The location object to which distance is to be calculated. - /// Returns the distance to the specified location. - /// Thrown when an invalid argument is used. - /// Thrown when the location is not supported. - public double GetDistanceTo(Location location) - { - double result; - Log.Info(Globals.LogTag, "Calling GetDistanceTo"); - int ret = Interop.Location.GetDistanceBetween(this.Latitude, this.Longitude, location.Latitude, location.Longitude, out result); - if (((LocationError)ret != LocationError.None)) - { - Log.Error(Globals.LogTag, "Error getting distance information to the specifed location," + (LocationError)ret); - throw LocationErrorFactory.ThrowLocationException(ret); - } - return result; - } - } -} diff --git a/src/Tizen.Location/Tizen.Location/LocationBoundary.cs b/src/Tizen.Location/Tizen.Location/LocationBoundary.cs deleted file mode 100755 index d8991e412..000000000 --- a/src/Tizen.Location/Tizen.Location/LocationBoundary.cs +++ /dev/null @@ -1,364 +0,0 @@ -/* - * 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.Collections.Generic; -using System.Runtime.InteropServices; - -namespace Tizen.Location -{ - /// - /// The LocationBoundary class is an abstract class that provides functions related to the geographic bounds information. - /// - /// 3 - public abstract class LocationBoundary : IDisposable - { - internal IntPtr handle; - private bool _disposed = false; - - /// - /// Gets the location boundary type. - /// - /// 3 - public BoundaryType BoundaryType{ get; internal set; } - - internal LocationBoundary() { } - /// - /// The destructor of the LocationBoundary class. - /// - /// 3 - ~LocationBoundary() - { - Log.Info(Globals.LogTag, "The destructor of LocationBoundary class"); - Dispose(false); - } - - internal IntPtr GetHandle() - { - return handle; - } - - /// - /// Checks if the boundary contains the specified geographical coordinates. - /// - /// 3 - /// The coordinate which needs to be checked. - /// Returns a boolean value indicating whether or not the specified coordinate lies in the geographical area. - public bool BoundaryContainsCoordinates(Coordinate coordinate) - { - Log.Info(Globals.LogTag, "Checking if coordinates are contained within boundary"); - return Interop.LocationBoundary.IsValidCoordinates(handle, coordinate); - } - - /// - /// The overidden Dispose method of the IDisposable class. - /// - /// 3 - /// Thrown when an invalid argument is used. - /// Thrown when the location is not supported. - public void Dispose() - { - Log.Info(Globals.LogTag, "Dispose"); - Dispose(true); - GC.SuppressFinalize(this); - } - - protected virtual void Dispose(bool disposing) - { - Log.Info(Globals.LogTag, "Dispose"); - if (_disposed) - return; - - if (disposing) - DestroyHandle(); - - _disposed = true; - } - - private void DestroyHandle() - { - Log.Info(Globals.LogTag, "DestroyBoundaryHandle"); - int ret = Interop.LocationBoundary.DestroyBoundary(handle); - if (((LocationError)ret != LocationError.None)) - { - Log.Error(Globals.LogTag, "Error in DestroyBoundary handle" + (LocationError)ret); - throw LocationErrorFactory.ThrowLocationException(ret); - } - } - } - - /// - /// This class represents a rectangular location boundary. - /// Inherits the Abstract LocationBoundary class. - /// - /// 3 - public class RectangleBoundary : LocationBoundary - { - /// - /// The constructor of the Rectangle boundary class. - /// - /// 3 - /// The coordinate which constitutes the top-left handside of the rectangular boundary. - /// The coordinate which constitutes the bottom-right handside of the rectangular boundary. - /// Thrown when the operation is invalid for the current state. - /// Thrown when an invalid argument is used. - /// Thrown when the location is not supported. - public RectangleBoundary(Coordinate topLeft, Coordinate bottomRight) - { - Log.Info(Globals.LogTag, "Calling RectangleBoundary constructor"); - BoundaryType = BoundaryType.Rectangle; - IntPtr boundsHandle; - int ret = Interop.LocationBoundary.CreateRectangularBoundary(topLeft, bottomRight, out boundsHandle); - if ((LocationBoundError)ret != LocationBoundError.None) - { - Log.Error(Globals.LogTag, "Error Creating Rectangular Boundary," + (LocationBoundError)ret); - throw LocationErrorFactory.ThrowLocationBoundaryException(ret); - } - handle = boundsHandle; - } - - /// - /// Gets the top-left handside coordinate of a rectangular boundary. - /// - /// 3 - public Coordinate TopLeft - { - get - { - Log.Info(Globals.LogTag, "Calling to get CoordinateItem TopLeft"); - return GetRectangleCoordinate("TopLeft"); - } - } - - /// - /// Gets the bottom-right handside coordinate of a rectangular boundary. - /// - /// 3 - public Coordinate BottomRight - { - get - { - Log.Info(Globals.LogTag, "Calling to get CoordinateItem BottomRight"); - return GetRectangleCoordinate("BottomRight"); - } - } - - private Coordinate GetRectangleCoordinate(string tag) - { - Coordinate topLeft; - Coordinate bottomRight; - - Interop.LocationBoundary.GetRectangleCoordinates(handle, out topLeft, out bottomRight); - - if (tag.Equals("TopLeft")) - { - return topLeft; - } - else - { - return bottomRight; - } - } - } - - /// - /// This class represents a circular location boundary. - /// Inherits the Abstract LocationBoundary class. - /// - /// 3 - public class CircleBoundary : LocationBoundary - { - /// - /// The constructor of the Circular boundary class. - /// - /// 3 - /// The coordinates which constitute the center of the circular boundary. - /// The radius value of the circular boundary. - /// Thrown when the operation is invalid for the current state. - /// Thrown when an invalid argument is used. - /// Thrown when the location is not supported. - public CircleBoundary(Coordinate coordinate, double radius) - { - Log.Info(Globals.LogTag, "Calling CircleBoundary constructor"); - BoundaryType = BoundaryType.Circle; - IntPtr boundsHandle; - int ret = Interop.LocationBoundary.CreateCircleBoundary(coordinate, radius, out boundsHandle); - if ((LocationBoundError)ret != LocationBoundError.None) - { - Log.Error(Globals.LogTag, "Error Creating Circular Boundary," + (LocationBoundError)ret); - throw LocationErrorFactory.ThrowLocationBoundaryException(ret); - } - handle = boundsHandle; - } - - /// - /// Gets the coordinate of the center of a circular boundary. - /// - /// 3 - /// Thrown when the operation is invalid for the current state. - /// Thrown when an invalid argument is used. - /// Thrown when the location is not supported. - public Coordinate Center - { - get - { - return GetCircleCenter(); - } - } - - /// - /// Gets the radius of a circular boundary. - /// - /// 3 - /// Thrown when the operation is invalid for the current state. - /// Thrown when an invalid argument is used. - /// Thrown when the location is not supported. - public double Radius - { - get - { - return GetRadius(); - } - } - - private Coordinate GetCircleCenter() - { - Log.Info(Globals.LogTag, "Calling to get CoordinateItem Center"); - Coordinate center; - double radius; - int ret = Interop.LocationBoundary.GetCircleCoordinates(handle, out center, out radius); - if ((LocationBoundError)ret != LocationBoundError.None) - { - Log.Error(Globals.LogTag, "Error Get Circle Center," + (LocationBoundError)ret); - throw LocationErrorFactory.ThrowLocationBoundaryException(ret); - } - return center; - } - - private double GetRadius() - { - Coordinate center; - double radius = 0; - int ret = Interop.LocationBoundary.GetCircleCoordinates(handle, out center, out radius); - if ((LocationBoundError)ret != LocationBoundError.None) - { - Log.Error(Globals.LogTag, "Error Get Radius," + (LocationBoundError)ret); - throw LocationErrorFactory.ThrowLocationBoundaryException(ret); - } - return radius; - } - } - - /// - /// This class represents a polygonal location boundary. - /// Inherits the Abstract LocationBoundary class. - /// - /// 3 - public class PolygonBoundary : LocationBoundary - { - /// - /// The constructor of the Polygon Boundary class. - /// - /// 3 - /// The coordinates which constitute the polgonal boundary. - /// Thrown when the operation is invalid for the current state. - /// Thrown when an invalid argument is used. - /// Thrown when the location is not supported. - public PolygonBoundary(IList coordinates) - { - Log.Info(Globals.LogTag, "Calling PolygonBoundary Constructor"); - if (coordinates == null) - { - Log.Error(Globals.LogTag, "coordingtes list is null"); - throw LocationErrorFactory.ThrowLocationException((int)LocationError.InvalidParameter); - } - - BoundaryType = BoundaryType.Polygon; - IntPtr listPointer = Marshal.AllocHGlobal(Marshal.SizeOf(coordinates[0]) * coordinates.Count); - IntPtr boundsHandle; - for (int i = 0; i < coordinates.Count; i++) - { - Marshal.StructureToPtr(coordinates[i], listPointer + i * Marshal.SizeOf(coordinates[0]), false); - } - int ret = Interop.LocationBoundary.CreatePolygonBoundary(listPointer, coordinates.Count, out boundsHandle); - if ((LocationBoundError)ret != LocationBoundError.None) - { - Log.Error(Globals.LogTag, "Error Creating Polygon Boundary," + (LocationBoundError)ret); - throw LocationErrorFactory.ThrowLocationBoundaryException(ret); - } - handle = boundsHandle; - } - - /// - /// Gets the list of coordinates which constitute a polygonal boundary. - /// - /// 3 - /// Thrown when the operation is invalid for the current state. - /// Thrown when an invalid argument is used. - /// Thrown when the location is not supported. - public IList Coordinates - { - get - { - return GetCoordinates(); - } - } - - private IList GetCoordinates() - { - Log.Info(Globals.LogTag, "Calling to get Polygon coordinates"); - List coordinateList = new List(); - Interop.LocationBoundary.PolygonCoordinatesCallback callback = (Coordinate coordinate, IntPtr userData) => - { - Coordinate item; - item.Latitude = coordinate.Latitude; - item.Longitude = coordinate.Longitude; - coordinateList.Add(item); - return true; - }; - - int ret = Interop.LocationBoundary.GetForEachPolygonCoordinates(handle, callback, IntPtr.Zero); - if ((LocationBoundError)ret != LocationBoundError.None) - { - Log.Error(Globals.LogTag, "Error Get foreach Boundary," + (LocationBoundError)ret); - throw LocationErrorFactory.ThrowLocationBoundaryException(ret); - } - return coordinateList; - } - } - - /// - /// This structure represents the coordinates of a geographical location. - /// - /// 3 - [StructLayout(LayoutKind.Sequential)] - public struct Coordinate - { - /// - /// Latitude component of the coordinate. - /// Should have a value between [-90.0 ~ 90.0] (degrees). - /// - /// 3 - public double Latitude; - - /// - /// Longitude component of the coordinate. - /// Should have a value between [-180.0 ~ 180.0] (degrees). - /// - /// 3 - public double Longitude; - } -} diff --git a/src/Tizen.Location/Tizen.Location/LocationChangedEventArgs.cs b/src/Tizen.Location/Tizen.Location/LocationChangedEventArgs.cs deleted file mode 100755 index 8774d0b19..000000000 --- a/src/Tizen.Location/Tizen.Location/LocationChangedEventArgs.cs +++ /dev/null @@ -1,44 +0,0 @@ -/* - * 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.Location -{ - /// - /// An extended EventArgs class which contains the changed location information. - /// - /// 3 - public class LocationChangedEventArgs : EventArgs - { - - /// - /// The class constructor for the LocationUpdatedEventArgs class. - /// - /// 3 - /// Object of the Location class. - public LocationChangedEventArgs(Location location) - { - Location = location; - } - - /// - /// Gets the location update information. - /// - /// 3 - public Location Location { get; private set; } - } -} diff --git a/src/Tizen.Location/Tizen.Location/LocationError.cs b/src/Tizen.Location/Tizen.Location/LocationError.cs deleted file mode 100755 index 3f2f633e3..000000000 --- a/src/Tizen.Location/Tizen.Location/LocationError.cs +++ /dev/null @@ -1,111 +0,0 @@ -/* - * 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.Location -{ - internal static class LocationManagerError - { - public const int Base = -0x02C00000; - public const int BoundsBase = -0x02C00000 | 0x20; - } - - /// - /// Location Manager error codes. - /// - /// 3 - public enum LocationError - { - None = ErrorCode.None,/**< Successful */ - OutOfMemory = ErrorCode.OutOfMemory,/**< Out of memory error */ - InvalidParameter = ErrorCode.InvalidParameter,/**< Invalid parameter */ - AcessibilityNotallowed = ErrorCode.PermissionDenied,/**< Permission denied */ - NotSupported = ErrorCode.NotSupported,/**< Address family not supported */ - IncorrectMethod = LocationManagerError.Base | 0x01,/**< Location manager contains incorrect method for a given call */ - NetworkFailed = LocationManagerError.Base | 0x02,/**< Network unavailable */ - ServiceNotAvailable = LocationManagerError.Base | 0x03,/**< Location service is not available */ - SettingOff = LocationManagerError.Base | 0x04,/**< GPS/WPS, or MOCK setting is not enabled */ - SecuirtyRestricted = LocationManagerError.Base | 0x05,/**< Restricted by security system policy */ - } - - /// - /// Location Boundary error codes. - /// - /// 3 - public enum LocationBoundError - { - None = ErrorCode.None,/**< Successful */ - OutOfMemory = ErrorCode.OutOfMemory,/**< Out of memory error */ - InvalidParameter = ErrorCode.InvalidParameter,/**< Invalid parameter */ - NotSupported = ErrorCode.NotSupported,/**< Not supported */ - IncorrectType = LocationManagerError.BoundsBase | 0x01,/**< Incorrect bounds type for a given call */ - IsAdded = LocationManagerError.BoundsBase | 0x02/**< Cannot remove bounds handle from location manager */ - } - - internal static class LocationErrorFactory - { - internal static Exception ThrowLocationException(int errCode) - { - Log.Error(Globals.LogTag, "Throw Location Exception : " + errCode); - LocationError error = (LocationError)errCode; - switch (error) - { - case LocationError.OutOfMemory: - return new InvalidOperationException("Out of memory"); - case LocationError.InvalidParameter: - return new ArgumentException("Invalid Parameter passed"); - case LocationError.AcessibilityNotallowed: - return new UnauthorizedAccessException("Accesibility not allowed"); - case LocationError.NotSupported: - return new NotSupportedException("Not supported"); - case LocationError.IncorrectMethod: - return new InvalidOperationException("Incorrect method used"); - case LocationError.NetworkFailed: - return new InvalidOperationException("Network failed"); - case LocationError.ServiceNotAvailable: - return new InvalidOperationException("Service not available"); - case LocationError.SettingOff: - return new InvalidOperationException("Current locationtype setting is off"); - case LocationError.SecuirtyRestricted: - return new InvalidOperationException("Security Restricted"); - default: - return new InvalidOperationException("Unknown Error"); - } - } - - internal static Exception ThrowLocationBoundaryException(int errCode) - { - LocationBoundError error = (LocationBoundError)errCode; - switch (error) - { - case LocationBoundError.OutOfMemory: - return new InvalidOperationException("Out of memory exception"); - case LocationBoundError.InvalidParameter: - return new ArgumentException("Invalid parameter passed"); - case LocationBoundError.NotSupported: - return new NotSupportedException("Not supported"); - case LocationBoundError.IncorrectType: - return new InvalidOperationException("Incorrect type passed"); - case LocationBoundError.IsAdded: - return new InvalidOperationException("Boundary is not addded"); - default: - return new InvalidOperationException("Unknown Error"); - } - } - } -} diff --git a/src/Tizen.Location/Tizen.Location/Locator.cs b/src/Tizen.Location/Tizen.Location/Locator.cs deleted file mode 100755 index 9a72fff2b..000000000 --- a/src/Tizen.Location/Tizen.Location/Locator.cs +++ /dev/null @@ -1,966 +0,0 @@ -/* - * 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.Collections.Generic; -using System.Threading.Tasks; -using Tizen.Internals.Errors; -using System.Runtime.InteropServices; - -namespace Tizen.Location -{ - static internal class Globals - { - internal const string LogTag = "Tizen.Location"; - } - - /// - /// This class contains the functionality for obtaining the geographical information and setting the boundary condition. - /// Notifications on events like service becoming enabled or disabled, new position data being available, - /// and others can also be acquired. - /// - /// 3 - public class Locator : IDisposable - { - private int _interval = 1; - private int _stayInterval = 120; - private int _batchInterval = 0; - private int _batchPeriod = 0; - private int _requestId = 0; - private double _distance = 120.0; - private bool _isEnableMock = false; - private bool _disposed = false; - private bool _isStarted = false; - private IntPtr _handle; - private LocationType _locationType; - private Location _location = null; - private Dictionary _callback_map = new Dictionary(); - - private Interop.LocatorEvent.ServiceStatechangedCallback _serviceStateChangedCallback; - private Interop.LocatorEvent.ZonechangedCallback _zoneChangedCallback; - private Interop.LocatorEvent.SettingchangedCallback _settingChangedCallback; - private Interop.LocatorEvent.LocationchangedCallback _distanceBasedLocationChangedCallback; - private Interop.LocatorEvent.LocationchangedCallback _locationChangedCallback; - private Interop.LocatorEvent.LocationBatchCallback _locationBatchCallback; - private Interop.LocatorEvent.LocationBatchGetCallback _locationBatchGetCallback; - - private EventHandler _zoneChanged; - private EventHandler _serviceStateChanged; - private EventHandler _settingChanged; - private EventHandler _distanceBasedLocationChanged; - private EventHandler _locationChanged; - - /// - /// The constructor of the Locator class. - /// - /// 3 - /// The back-end positioning method to be used for LBS. - /// http://tizen.org/feature/location.gps - /// http://tizen.org/feature/location.wps - /// Thrown when the operation is invalid for the current state. - /// Thrown when an invalid argument is used. - /// Thrown when the location is not supported. - public Locator(LocationType locationType) - { - Log.Info(Globals.LogTag, "Locator Constructor"); - int ret = Interop.Locator.Create((int)locationType, out _handle); - if (((LocationError)ret != LocationError.None)) - { - Log.Error(Globals.LogTag, "Error creating Location Manager," + (LocationError)ret); - throw LocationErrorFactory.ThrowLocationException(ret); - } - _location = new Location(); - _locationType = locationType; - } - - /// - /// The destructor of the Locator class. - /// - /// 3 - ~Locator() - { - Dispose(false); - } - - /// - /// The time interval between callback updates. - /// Should be in the range of 1~120 seconds. - /// - /// 3 - /// Thrown when an invalid argument is used. - public int Interval - { - get - { - Log.Info(Globals.LogTag, "Getting the Callback Interval"); - return _interval; - } - set - { - Log.Info(Globals.LogTag, "Setting the Callback Interval"); - if (value > 0 && value <= 120) - { - _interval = value; - } - else - { - Log.Error(Globals.LogTag, "Error setting Callback Interval"); - throw LocationErrorFactory.ThrowLocationException((int)LocationError.InvalidParameter); - } - } - } - - /// - /// The time interval between the distance-based location callback updates. - /// Should be in the range of 1~120 seconds. - /// - /// 3 - /// Thrown when an invalid argument is used. - public int StayInterval - { - get - { - Log.Info(Globals.LogTag, "Getting the StayInterval"); - return _stayInterval; - } - set - { - Log.Info(Globals.LogTag, "Setting the StayInterval"); - if (value > 0 && value <= 120) - { - _stayInterval = value; - } - else - { - Log.Error(Globals.LogTag, "Error Setting the StayInterval"); - throw LocationErrorFactory.ThrowLocationException((int)LocationError.InvalidParameter); - } - } - } - - /// - /// The time interval between the position collection in batch mode. - /// Should be in the range of 1~255 seconds. - /// - /// 3 - /// Thrown when an invalid argument is used. - public int BatchInterval - { - get - { - Log.Info(Globals.LogTag, "Getting the Batch Interval"); - return _batchInterval; - } - set - { - Log.Info(Globals.LogTag, "Setting the Batch Interval"); - if (value > 0 && value <= 255) - { - _batchInterval = value; - } - else - { - Log.Error(Globals.LogTag, "Error setting Callback Interval"); - throw LocationErrorFactory.ThrowLocationException((int)LocationError.InvalidParameter); - } - } - } - - /// - /// The time interval between batch callback updates. The BatchPeriod should be greater than or equal to the BatchInterval. If the BatchPeriod is zero or smaller than the BatchInterval, then the batch mode will not work. In addition, sometimes the period may not work as you intended, the maximum permissible value for the batch period is device specific. - /// Should be in the range of 0~60000 seconds. - /// - /// 3 - /// Thrown when an invalid argument is used. - public int BatchPeriod - { - get - { - Log.Info(Globals.LogTag, "Getting the Batch Period"); - return _batchPeriod; - } - set - { - Log.Info(Globals.LogTag, "Setting the Batch Period"); - if (value >= 0 && value <= 60000) - { - _batchPeriod = value; - } - else - { - Log.Error(Globals.LogTag, "Error setting Batch Period"); - throw LocationErrorFactory.ThrowLocationException((int)LocationError.InvalidParameter); - } - } - } - - /// - /// The distance between callback updates. - /// Should be in the range of 1-120 meters. - /// - /// 3 - /// Thrown when an invalid argument is used. - public double Distance - { - get - { - Log.Info(Globals.LogTag, "Getting the Distance Interval"); - return _distance; - } - set - { - Log.Info(Globals.LogTag, "Setting the Distance Interval"); - if (value > 0 && value <= 120) - { - _distance = value; - } - else - { - Log.Error(Globals.LogTag, "Error Setting the Distance"); - throw LocationErrorFactory.ThrowLocationException((int)LocationError.InvalidParameter); - } - } - } - - /// - /// Gets the location object. - /// - /// 3 - public Location Location - { - get - { - Log.Info(Globals.LogTag, "Getting location details"); - return _location; - } - } - - /// - /// Gets the type used to obtain the location data. - /// - /// 3 - public LocationType LocationType - { - get - { - Log.Info(Globals.LogTag, "Getting LocationType"); - return _locationType; - } - } - - /// - /// Gets the status whether the mock location is enabled or not. - /// - /// 3 - /// http://tizen.org/privilege/location - /// Thrown when the application has no privilege to use the location. - /// Thrown when the location is not supported. - public bool EnableMock - { - get - { - Log.Info(Globals.LogTag, "Getting getting Mock"); - _isEnableMock = GetEnableMock(); - return _isEnableMock; - } - set - { - _isEnableMock = value; - SetEnableMock(); - } - } - - internal IntPtr GetHandle() - { - return _handle; - } - - private bool GetEnableMock() - { - bool status = false; - int ret = Interop.Locator.IsEnabledMock(out status); - if (((LocationError)ret != LocationError.None)) - { - Log.Error(Globals.LogTag, "Error Get Enable Mock Status," + (LocationError)ret); - throw LocationErrorFactory.ThrowLocationException(ret); - } - return status; - } - - private void SetEnableMock() - { - int ret = Interop.Locator.EnableMock(_isEnableMock); - if (((LocationError)ret != LocationError.None)) - { - Log.Error(Globals.LogTag, "Error Set Enable Mock Status," + (LocationError)ret); - throw LocationErrorFactory.ThrowLocationException(ret); - } - } - - /// - /// Starts the Location Manager which has been created using the specified method. - /// - /// 3 - /// http://tizen.org/privilege/location - /// Thrown when the operation is invalid for the current state. - /// Thrown when an invalid argument is used. - /// Thrown when the application has no privilege to use the location. - /// Thrown when the location is not supported. - public void Start() - { - Log.Info(Globals.LogTag, "Starting Location Manager"); - if (_batchPeriod > 0 && _batchPeriod > _batchInterval) - { - int ret = Interop.Locator.StartBatch(_handle); - if (((LocationError)ret != LocationError.None)) - { - Log.Error(Globals.LogTag, "Error Starting Location Batch mode," + (LocationError)ret); - throw LocationErrorFactory.ThrowLocationException(ret); - } - } - else - { - int ret = Interop.Locator.Start(_handle); - if (((LocationError)ret != LocationError.None)) - { - Log.Error(Globals.LogTag, "Error Starting Location Manager," + (LocationError)ret); - throw LocationErrorFactory.ThrowLocationException(ret); - } - } - _isStarted = true; - } - - /// - /// Stops the Location Manager which has been activated using the specified method. - /// Does not destroy the manager. - /// - /// 3 - /// Thrown when the operation is invalid for the current state. - /// Thrown when an invalid argument is used. - /// Thrown when the location is not supported. - public void Stop() - { - Log.Info(Globals.LogTag, "Stopping Location Manager"); - int ret = Interop.Locator.Stop(_handle); - if (((LocationError)ret != LocationError.None)) - { - Log.Error(Globals.LogTag, "Error stopping Location Manager," + (LocationError)ret); - throw LocationErrorFactory.ThrowLocationException(ret); - } - _isStarted = false; - } - - /// - /// Sets a mock location for the given location method. - /// - /// 3 - /// The location object containing the mock location details. - /// http://tizen.org/privilege/location - /// Thrown when the operation is invalid for the current state. - /// Thrown when an invalid argument is used. - /// Thrown when the application has no privilege to use the location. - /// Thrown when the location is not supported. - public void SetMockLocation(Location location) - { - Log.Info(Globals.LogTag, "Setting mock location"); - int ret = Interop.Locator.SetMockLocation(_handle, location.Latitude, location.Longitude, location.Altitude, location.Speed, location.Direction, location.Accuracy); - if (((LocationError)ret == LocationError.None)) - { - _location.Latitude = location.Latitude; - _location.Longitude = location.Longitude; - _location.Altitude = location.Altitude; - _location.Speed = location.Speed; - _location.Direction = location.Direction; - _location.Accuracy = location.Accuracy; - } - else - { - Log.Error(Globals.LogTag, "Error in setting up location mocking," + (LocationError)ret); - throw LocationErrorFactory.ThrowLocationException(ret); - } - } - - /// - /// Clears a mock location for the given location method. - /// - /// 3 - /// http://tizen.org/privilege/location - /// Thrown when the operation is invalid for the current state. - /// Thrown when an invalid argument is used. - /// Thrown when the application has no privilege to use the location. - /// Thrown when the location is not supported. - public void ClearMock() - { - Log.Info(Globals.LogTag, "Clear mock location"); - int ret = Interop.Locator.ClearMock(_handle); - if (((LocationError)ret != LocationError.None)) - { - Log.Error(Globals.LogTag, "Error in clear up location mocking," + (LocationError)ret); - throw LocationErrorFactory.ThrowLocationException(ret); - } - } - - /// - /// Gets the details of the location asynchronously. - /// - /// 3 - /// Timeout to stop requesting a single location after (seconds). - /// A task which contains the current location details. - /// http://tizen.org/privilege/location - /// Thrown when the operation is invalid for the current state. - /// Thrown when an invalid argument is used. - /// Thrown when the application has no privilege to use the location. - /// Thrown when the location is not supported. - public Task GetLocationAsync(int timeout) - { - var task = new TaskCompletionSource(); - IntPtr id = IntPtr.Zero; - lock (_callback_map) - { - id = (IntPtr)_requestId++; - _callback_map[id] = (LocationError error, double latitude, double longitude, double altitude, int timestamp, double speed, double direction, double climb, IntPtr userData) => - { - if (error != LocationError.None) - { - Log.Error(Globals.LogTag, "Error in getting up location information," + (LocationError)error); - } - else - { - Log.Info(Globals.LogTag, "Creating a current location object"); - _location = new Location(latitude, longitude, altitude, speed, direction, 0.0, timestamp); - task.SetResult(_location); - } - lock (_callback_map) - { - _callback_map.Remove(userData); - } - }; - } - - int ret = Interop.LocatorEvent.GetSingleLocation(_handle, timeout, _callback_map[id], id); - if (((LocationError)ret != LocationError.None)) - { - Log.Error(Globals.LogTag, "Error in setting up location mocking," + (LocationError)ret); - throw LocationErrorFactory.ThrowLocationException(ret); - } - return task.Task; - } - - - /// - /// Gets the details of the location. - /// - /// 3 - /// Which contains the current location details. - /// http://tizen.org/privilege/location - /// Thrown when the operation is invalid for the current state. - /// Thrown when an invalid argument is used. - /// Thrown when the application has no privilege to use the location. - /// Thrown when the location is not supported. - public Location GetLocation() - { - double latitude = 0; - double longitude = 0; - double altitude = 0; - double climb = 0; - double speed = 0; - double direction = 0; - int level = 0; - double accuracy = 0; - double vertical = 0; - int timestamp = 0; - - if (_isStarted) - { - Log.Info(Globals.LogTag, "Get current location information"); - int ret = Interop.Locator.GetLocation(_handle, out altitude, out latitude, out longitude, out climb, out direction, out speed, out level, out accuracy, out vertical, out timestamp); - if (((LocationError)ret != LocationError.None)) - { - Log.Error(Globals.LogTag, "Error in get current location information," + (LocationError)ret); - throw LocationErrorFactory.ThrowLocationException(ret); - } - } - else - { - Log.Info(Globals.LogTag, "Get last location information"); - int ret = Interop.Locator.GetLastLocation(_handle, out altitude, out latitude, out longitude, out climb, out direction, out speed, out level, out accuracy, out vertical, out timestamp); - if (((LocationError)ret != LocationError.None)) - { - Log.Error(Globals.LogTag, "Error in get last location information," + (LocationError)ret); - throw LocationErrorFactory.ThrowLocationException(ret); - } - } - - Location location = new Location(latitude, longitude, altitude, speed, direction, accuracy, timestamp); - _location = location; - - return location; - } - - - /// - /// Adds a bound for a given locator. - /// - /// 3 - /// The boundary object to be added to the locator. - /// Thrown when the operation is invalid for the current state. - /// Thrown when an invalid argument is used. - /// Thrown when the location is not supported. - public void AddBoundary(LocationBoundary locationBoundary) - { - Log.Info(Globals.LogTag, "AddBoundary called"); - - int ret = Interop.Locator.AddBoundary(_handle, locationBoundary.GetHandle()); - if ((LocationBoundError)ret != LocationBoundError.None) - { - Log.Error(Globals.LogTag, "Error Adding Boundary," + (LocationBoundError)ret); - throw LocationErrorFactory.ThrowLocationBoundaryException(ret); - } - } - - /// - /// Deletes a bound for a given locator. - /// - /// 3 - /// The boundary object to be removed from the locator. - /// Thrown when the operation is invalid for the current state. - /// Thrown when an invalid argument is used. - /// Thrown when the location is not supported. - public void RemoveBoundary(LocationBoundary locationBoundary) - { - Log.Info(Globals.LogTag, "RemoveBoundary called"); - int ret = Interop.Locator.RemoveBoundary(_handle, locationBoundary.GetHandle()); - if ((LocationBoundError)ret != LocationBoundError.None) - { - Log.Error(Globals.LogTag, "Error Removing Boundary," + (LocationBoundError)ret); - throw LocationErrorFactory.ThrowLocationBoundaryException(ret); - } - } - - /// - /// The overidden Dispose method of the IDisposable class. - /// - /// 3 - /// Thrown when an invalid argument is used. - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - - protected virtual void Dispose(bool disposing) - { - if (_disposed) - return; - - if (disposing) - DestroyHandle(); - - _disposed = true; - } - - private void DestroyHandle() - { - int ret = Interop.Locator.Destroy(_handle); - if (((LocationError)ret != LocationError.None)) - { - Log.Error(Globals.LogTag, "Error in Destroy handle, " + (LocationError)ret); - throw LocationErrorFactory.ThrowLocationException(ret); - } - } - - /// - /// The ServiceStateChanged event is invoked when the location service state is changed. - /// - /// 3 - /// Thrown when an invalid argument is used. - /// Thrown when the location is not supported. - public event EventHandler ServiceStateChanged - { - add - { - Log.Info(Globals.LogTag, "ServiceStateChanged called"); - if (_serviceStateChanged == null) - { - Log.Info(Globals.LogTag, "Calling function SetServiceStateChangedCallback"); - SetServiceStateChangedCallback(); - } - _serviceStateChanged += value; - } - remove - { - Log.Info(Globals.LogTag, "Callback removed"); - _serviceStateChanged -= value; - - if (_serviceStateChanged == null) - { - Log.Info(Globals.LogTag, "Calling function UnSetServiceStateChangedCallback"); - UnSetServiceStateChangedCallback(); - } - } - } - - private void SetServiceStateChangedCallback() - { - Log.Info(Globals.LogTag, "Calling Interop.LocatorEvent.SetServiceStateChangedCallback"); - if (_serviceStateChangedCallback == null) - { - _serviceStateChangedCallback = (state, userData) => - { - Log.Info(Globals.LogTag, "Inside ServiceStateChangedCallback"); - _serviceStateChanged?.Invoke(this, new ServiceStateChangedEventArgs(state)); - }; - } - - int ret = Interop.LocatorEvent.SetServiceStateChangedCallback(_handle, _serviceStateChangedCallback, IntPtr.Zero); - if (((LocationError)ret != LocationError.None)) - { - Log.Error(Globals.LogTag, "Error in Setting Service State Changed Callback," + (LocationError)ret); - throw LocationErrorFactory.ThrowLocationException(ret); - } - } - - private void UnSetServiceStateChangedCallback() - { - Log.Info(Globals.LogTag, "Calling Interop.LocatorEvent.UnSetServiceStateChangedCallback"); - int ret = Interop.LocatorEvent.UnSetServiceStateChangedCallback(_handle); - if (((LocationError)ret != LocationError.None)) - { - Log.Error(Globals.LogTag, "Error in UnSetting Service State Changed Callback," + (LocationError)ret); - throw LocationErrorFactory.ThrowLocationException(ret); - } - } - - /// - /// The ZoneChanged event is invoked when the previously set boundary area is entered or left. - /// - /// 3 - /// Thrown when an invalid argument is used. - /// Thrown when the location is not supported. - public event EventHandler ZoneChanged - { - add - { - Log.Info(Globals.LogTag, "ZoneChanged called"); - if (_zoneChanged == null) - { - Log.Info(Globals.LogTag, "Calling function SetZoneChangedCallback"); - SetZoneChangedCallback(); - } - _zoneChanged += value; - } - remove - { - Log.Info(Globals.LogTag, "Callback removed"); - _zoneChanged -= value; - - if (_zoneChanged == null) - { - Log.Info(Globals.LogTag, "Calling function UnSetZoneChangedCallback"); - UnSetZoneChangedCallback(); - } - } - } - - private void SetZoneChangedCallback() - { - Log.Info(Globals.LogTag, "Inside SetZoneChangedCallback"); - if (_zoneChangedCallback == null) - { - _zoneChangedCallback = (state, latitude, longitude, altitude, timestamp, userData) => - { - Log.Info(Globals.LogTag, "Inside ZoneChangedCallback"); - DateTime timeStamp = DateTime.Now; - if (timestamp != 0) - { - DateTime start = DateTime.SpecifyKind(new DateTime(1970, 1, 1).AddSeconds(timestamp), DateTimeKind.Utc); - timeStamp = start.ToLocalTime(); - } - _zoneChanged?.Invoke(this, new ZoneChangedEventArgs(state, latitude, longitude, altitude, timeStamp)); - }; - } - - int ret = Interop.LocatorEvent.SetZoneChangedCallback(_handle, _zoneChangedCallback, IntPtr.Zero); - if (((LocationError)ret != LocationError.None)) - { - Log.Error(Globals.LogTag, "Error in Setting Zone Changed Callback," + (LocationError)ret); - throw LocationErrorFactory.ThrowLocationException(ret); - } - } - - private void UnSetZoneChangedCallback() - { - Log.Info(Globals.LogTag, "Inside UnSetZoneChangedCallback"); - int ret = Interop.LocatorEvent.UnSetZoneChangedCallback(_handle); - if (((LocationError)ret != LocationError.None)) - { - Log.Error(Globals.LogTag, "Error in UnSetting Zone Changed Callback," + (LocationError)ret); - } - } - - /// - /// The SetttingChanged event is raised when the location setting is changed. - /// - /// 3 - /// Thrown when the operation is invalid for the current state. - /// Thrown when an invalid argument is used. - /// Thrown when the location is not supported. - public event EventHandler SettingChanged - { - add - { - Log.Info(Globals.LogTag, "Adding SettingChanged EventHandler"); - if (_settingChanged == null) - { - Log.Info(Globals.LogTag, "Calling function SetSettingChangedCallback"); - SetSettingChangedCallback(); - } - _settingChanged += value; - } - remove - { - Log.Info(Globals.LogTag, "Removing SettingChanged EventHandler"); - _settingChanged -= value; - - if (_settingChanged == null) - { - Log.Info(Globals.LogTag, "Calling function UnSetSettingChangedCallback"); - UnSetSettingChangedCallback(); - } - } - } - - private void SetSettingChangedCallback() - { - Log.Info(Globals.LogTag, "Calling SetSettingChangedCallback"); - if (_settingChangedCallback == null) - { - _settingChangedCallback = (method, enable, userData) => - { - Log.Info(Globals.LogTag, "Calling SettingChangedCallback"); - _settingChanged?.Invoke(this, new SettingChangedEventArgs(method, enable)); - }; - } - - int ret = Interop.LocatorEvent.SetSettingChangedCallback((int)_locationType, _settingChangedCallback, IntPtr.Zero); - if (((LocationError)ret != LocationError.None)) - { - Log.Error(Globals.LogTag, "Error in Setting Changed Callback," + (LocationError)ret); - throw LocationErrorFactory.ThrowLocationException(ret); - } - } - - private void UnSetSettingChangedCallback() - { - Log.Info(Globals.LogTag, "Calling UnSetSettingChangedCallback"); - int ret = Interop.LocatorEvent.UnSetSettingChangedCallback((int)_locationType); - if (((LocationError)ret != LocationError.None)) - { - Log.Error(Globals.LogTag, "Error in Unsetting Setting's Callback," + (LocationError)ret); - throw LocationErrorFactory.ThrowLocationException(ret); - } - } - - /// - /// The DistanceBasedLocationChanged event is raised with the updated location information. - /// The callback will be invoked at a minimum interval or minimum distance with the updated position information. - /// - /// 3 - /// Thrown when an invalid argument is used. - /// Thrown when the location is not supported. - public event EventHandler DistanceBasedLocationChanged - { - add - { - Log.Info(Globals.LogTag, "Adding DistanceBasedLocationChanged EventHandler"); - //if (_distanceBasedLocationChanged == null) - { - Log.Info(Globals.LogTag, "Calling function SetDistanceBasedLocationChangedCallback"); - SetDistanceBasedLocationChangedCallback(); - } - _distanceBasedLocationChanged += value; - } - remove - { - Log.Info(Globals.LogTag, "Removing DistanceBasedLocationChanged EventHandler"); - _distanceBasedLocationChanged -= value; - - if (_distanceBasedLocationChanged == null) - { - Log.Info(Globals.LogTag, "Calling function UnSetDistanceBasedLocationChangedCallback"); - UnSetDistanceBasedLocationChangedCallback(); - } - } - } - - private void SetDistanceBasedLocationChangedCallback() - { - Log.Info(Globals.LogTag, "SetDistanceBasedLocationChangedCallback"); - if (_distanceBasedLocationChangedCallback == null) { - _distanceBasedLocationChangedCallback = (latitude, longitude, altitude, speed, direction, accuracy, timestamp, userData) => - { - Log.Info(Globals.LogTag, "DistanceBasedLocationChangedCallback #1"); - Location location = new Location(latitude, longitude, altitude, speed, direction, accuracy, timestamp); - Log.Info(Globals.LogTag, "DistanceBasedLocationChangedCallback #2"); - _distanceBasedLocationChanged?.Invoke(this, new LocationChangedEventArgs(location)); - Log.Info(Globals.LogTag, "DistanceBasedLocationChangedCallback #3"); - }; - } - - int ret = Interop.LocatorEvent.SetDistanceBasedLocationChangedCallback(_handle, _distanceBasedLocationChangedCallback, _stayInterval, _distance, IntPtr.Zero); - if (((LocationError)ret != LocationError.None)) - { - Log.Error(Globals.LogTag, "Error in Setting Distance based location changed Callback," + (LocationError)ret); - throw LocationErrorFactory.ThrowLocationException(ret); - } - } - - private void UnSetDistanceBasedLocationChangedCallback() - { - Log.Info(Globals.LogTag, "UnSetDistanceBasedLocationChangedCallback"); - int ret = Interop.LocatorEvent.UnSetDistanceBasedLocationChangedCallback(_handle); - if (((LocationError)ret != LocationError.None)) - { - Log.Error(Globals.LogTag, "Error in UnSetting Distance based location changed Callback," + (LocationError)ret); - throw LocationErrorFactory.ThrowLocationException(ret); - } - _distanceBasedLocationChanged = null; - } - - /// - /// The LocationUpdated event is raised at defined intervals of time with the updated location information. - /// The callback will be invoked periodically. - /// - /// 3 - /// Thrown when an invalid argument is used. - /// Thrown when the location is not supported. - public event EventHandler LocationChanged - { - add - { - Log.Info(Globals.LogTag, "Adding LocationChanged EventHandler"); - if (_batchPeriod > 0 && _batchPeriod > _batchInterval) - { - Log.Info(Globals.LogTag, "Calling function SetLocationBatchCallback"); - SetLocationBatchCallback(); - } - else - { - Log.Info(Globals.LogTag, "Calling function SetLocationChangedCallback"); - SetLocationChangedCallback(); - } - _locationChanged += value; - } - remove - { - Log.Info(Globals.LogTag, "Removing LocationChanged EventHandler"); - _locationChanged -= value; - - if (_locationChanged == null) - { - if (_batchPeriod > 0 && _batchPeriod > _batchInterval) - { - Log.Info(Globals.LogTag, "Calling function UnSetLocationBatchCallback"); - UnSetLocationBatchCallback(); - } - else - { - Log.Info(Globals.LogTag, "Calling function UnSetLocationChangedCallback"); - UnSetLocationChangedCallback(); - } - } - } - } - - private void SetLocationChangedCallback() - { - Log.Info(Globals.LogTag, "Calling SetLocationChangedCallback"); - - if (_locationChangedCallback == null) { - _locationChangedCallback = (latitude, longitude, altitude, speed, direction, accuracy, timestamp, userData) => - { - Log.Info(Globals.LogTag, "LocationChangedCallback has been called"); - Location location = new Location(latitude, longitude, altitude, speed, direction, accuracy, timestamp); - _location = location; - _locationChanged?.Invoke(this, new LocationChangedEventArgs(location)); - }; - } - - int ret = Interop.LocatorEvent.SetLocationChangedCallback(_handle, _locationChangedCallback, _interval, IntPtr.Zero); - if (((LocationError)ret != LocationError.None)) - { - Log.Error(Globals.LogTag, "Error in Setting location changed Callback," + (LocationError)ret); - throw LocationErrorFactory.ThrowLocationException(ret); - } - } - - private void UnSetLocationChangedCallback() - { - Log.Info(Globals.LogTag, "Calling UnSetLocationChangedCallback"); - int ret = Interop.LocatorEvent.UnSetLocationChangedCallback(_handle); - if (((LocationError)ret != LocationError.None)) - { - Log.Error(Globals.LogTag, "Error in UnSetting location changed Callback," + (LocationError)ret); - throw LocationErrorFactory.ThrowLocationException(ret); - } - } - - private void SetLocationBatchCallback() - { - Log.Info(Globals.LogTag, "Calling SetLocationBatchCallback"); - int ret; - if (_locationBatchCallback == null) { - _locationBatchCallback = (batch_size, userData) => - { - Log.Info(Globals.LogTag, "LocationBatchCallback has been called, size : " + batch_size); - - _locationBatchGetCallback = (latitude, longitude, altitude, speed, direction, horizontal, vertical, timestamp, batchUserData) => - { - Log.Info(Globals.LogTag, "GetLocationBatch has been called"); - Location location = new Location(latitude, longitude, altitude, speed, direction, horizontal, timestamp); - _location = location; - _locationChanged?.Invoke(this, new LocationChangedEventArgs(location)); - }; - - ret = Interop.LocatorEvent.GetLocationBatch(_handle, _locationBatchGetCallback, IntPtr.Zero); - if (((LocationError)ret != LocationError.None)) - { - Log.Error(Globals.LogTag, "Error in Setting location batch Callback," + (LocationError)ret); - throw LocationErrorFactory.ThrowLocationException(ret); - } - }; - } - - ret = Interop.LocatorEvent.SetLocationBatchCallback(_handle, _locationBatchCallback, _batchInterval, _batchPeriod, IntPtr.Zero); - if (((LocationError)ret != LocationError.None)) - { - Log.Error(Globals.LogTag, "Error in Setting location batch Callback," + (LocationError)ret); - throw LocationErrorFactory.ThrowLocationException(ret); - } - } - - private void UnSetLocationBatchCallback() - { - Log.Info(Globals.LogTag, "Calling UnSetLocationBatchCallback"); - int ret = Interop.LocatorEvent.UnSetLocationBatchCallback(_handle); - if (((LocationError)ret != LocationError.None)) - { - Log.Error(Globals.LogTag, "Error in UnSetting location batch Callback," + (LocationError)ret); - throw LocationErrorFactory.ThrowLocationException(ret); - } - } - } -} diff --git a/src/Tizen.Location/Tizen.Location/LocatorEnumerations.cs b/src/Tizen.Location/Tizen.Location/LocatorEnumerations.cs deleted file mode 100755 index 9de03cc53..000000000 --- a/src/Tizen.Location/Tizen.Location/LocatorEnumerations.cs +++ /dev/null @@ -1,64 +0,0 @@ -/* - * 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.Collections.Generic; - -namespace Tizen.Location -{ - /// - /// Enumeration for the state of the location service. - /// - /// 3 - public enum ServiceState - { - Disabled = 0, /** - /// Enumeration for the type of connection used in acquiring the location data. - /// - /// 3 - public enum LocationType - { - Hybrid = 0, /** - /// Enumeration for the created boundary type. - /// - /// 3 - public enum BoundaryType - { - Rectangle = 0, /** - /// Enumeration for the error code for location manager. - /// - /// 3 - public enum BoundaryState - { - In = 0, /**< Boundary In (Zone In) */ - Out /**< Boundary Out (Zone Out) */ - } -} diff --git a/src/Tizen.Location/Tizen.Location/LocatorHelper.cs b/src/Tizen.Location/Tizen.Location/LocatorHelper.cs deleted file mode 100755 index 4bb7a7f08..000000000 --- a/src/Tizen.Location/Tizen.Location/LocatorHelper.cs +++ /dev/null @@ -1,92 +0,0 @@ -/* - * 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.Location -{ - /// - /// This class contains the functionality for obtaining the geographical positioning type. - /// - /// 3 - public static class LocatorHelper - { - /// - /// Checks if the specified geographical positioning type is supported or not. - /// - /// 3 - /// The back-end positioning method to be used for LBS. - /// http://tizen.org/feature/location.gps - /// http://tizen.org/feature/location.wps - /// Returns a boolean value indicating whether or not the specified method is supported. - /// Thrown when an invalid argument is used. - /// Thrown when the location is not supported. - public static bool IsSupportedType(LocationType locationType) - { - bool status = Interop.LocatorHelper.IsSupported((int)locationType); - Log.Info(Globals.LogTag, "Checking if the Location Manager type is supported ," + status); - return status; - } - - /// - /// Checks if the specified geographical positioning type is enabled or not. - /// - /// 3 - /// The back-end positioning method to be used for LBS. - /// http://tizen.org/feature/location.gps - /// http://tizen.org/feature/location.wps - /// Returns a boolean value indicating whether or not the specified method is supported. - /// Thrown when the operation is invalid for the current state. - /// Thrown when an invalid argument is used. - /// Thrown when the location is not supported. - public static bool IsEnabledType(LocationType locationType) - { - Log.Info(Globals.LogTag, "Checking if the Location Manager type is Enabled"); - bool status; - int ret = Interop.LocatorHelper.IsEnabled((int)locationType, out status); - if (((LocationError)ret != LocationError.None)) - { - Log.Error(Globals.LogTag, "Error Checking the Location Manager type is Enabled," + (LocationError)ret); - throw LocationErrorFactory.ThrowLocationException(ret); - } - return status; - } - - /// - /// Sets the specified geographical positioning type. - /// - /// 3 - /// http://tizen.org/privilege/location.enable - /// platform - /// The back-end positioning method to be used for LBS. - /// The location setting value. - /// http://tizen.org/feature/location.gps - /// http://tizen.org/feature/location.wps - /// Thrown when the operation is invalid for the current state. - /// Thrown when an invalid argument is used. - /// Thrown when the location is not supported. - public static void EnableType(LocationType locationType, bool status) - { - Log.Info(Globals.LogTag, "Sets the location setting status"); - int ret = Interop.LocatorHelper.EnableType((int)locationType, status); - if (((LocationError)ret != LocationError.None)) - { - Log.Error(Globals.LogTag, "Error Sets the Location type," + (LocationError)ret); - throw LocationErrorFactory.ThrowLocationException(ret); - } - } - } -} diff --git a/src/Tizen.Location/Tizen.Location/NamespaceDoc.cs b/src/Tizen.Location/Tizen.Location/NamespaceDoc.cs deleted file mode 100755 index 697cfd18b..000000000 --- a/src/Tizen.Location/Tizen.Location/NamespaceDoc.cs +++ /dev/null @@ -1,21 +0,0 @@ -/** - -The Tizen.Location namespace provides classes for obtaining information related to the geographical location. -Notifications on events like service becoming enabled or disabled, -new position data being available, and others can also be acquired. - - -

Overview

-The Tizen.Location namespace provides classes for obtaining information related to the geographical location. -Notifications on events like service becoming enabled or disabled, -new position data being available, and others can also be acquired. -

Related Features

-To guarantee that the location application runs on a device with the location profile feature, -declare the following feature requirements in the config file:
-http://tizen.org/feature/location
-http://tizen.org/feature/location.gps
-http://tizen.org/feature/location.wps -
-
-*/ -namespace Tizen.Location {} diff --git a/src/Tizen.Location/Tizen.Location/SatelliteStatusChangedEventArgs.cs b/src/Tizen.Location/Tizen.Location/SatelliteStatusChangedEventArgs.cs deleted file mode 100755 index aa27203ad..000000000 --- a/src/Tizen.Location/Tizen.Location/SatelliteStatusChangedEventArgs.cs +++ /dev/null @@ -1,55 +0,0 @@ -/* - * 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.Location -{ - public class SatelliteStatusChangedEventArgs : EventArgs - { - /// - /// The class constructor for the SatelliteStatusChangedEventArgs class. - /// - /// 3 - /// The number of active satellites. - /// The number of satellites in view. - /// The time at which the data has been extracted. - public SatelliteStatusChangedEventArgs(uint activeCount, uint inviewCount, DateTime timestamp) - { - ActiveCount = activeCount; - InViewCount = inviewCount; - Timestamp = timestamp; - } - - /// - /// Gets the number of active satellites. - /// - /// 3 - public uint ActiveCount { get; private set; } - - /// - /// Gets the number of satellites in view. - /// - /// 3 - public uint InViewCount { get; private set; } - - /// - /// Get the timestamp. - /// - /// 3 - public DateTime Timestamp { get; private set; } - } -} diff --git a/src/Tizen.Location/Tizen.Location/ServiceStateChangedEventArgs.cs b/src/Tizen.Location/Tizen.Location/ServiceStateChangedEventArgs.cs deleted file mode 100755 index 7059849ba..000000000 --- a/src/Tizen.Location/Tizen.Location/ServiceStateChangedEventArgs.cs +++ /dev/null @@ -1,42 +0,0 @@ -/* - * 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.Location -{ - /// - /// An extended EventArgs class contains the changed location service state. - /// - public class ServiceStateChangedEventArgs : EventArgs - { - /// - /// The class constructor for the ServiceStateChangedEventArgs class. - /// - /// 3 - /// An enumeration of type LocationServiceState. - public ServiceStateChangedEventArgs(ServiceState state) - { - ServiceState = state; - } - - /// - /// Get the service state. - /// - /// 3 - public ServiceState ServiceState { get; private set; } - } -} diff --git a/src/Tizen.Location/Tizen.Location/SettingChangedEventArgs.cs b/src/Tizen.Location/Tizen.Location/SettingChangedEventArgs.cs deleted file mode 100755 index 36e8c9379..000000000 --- a/src/Tizen.Location/Tizen.Location/SettingChangedEventArgs.cs +++ /dev/null @@ -1,47 +0,0 @@ -/* - * 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.Location -{ - public class SettingChangedEventArgs : EventArgs - { - /// - /// The class constructor for the SettingChangedEventArgs class. - /// - /// 3 - /// The positioing method used for the location information. - /// The status of the method. - public SettingChangedEventArgs(LocationType type, bool enable) - { - LocationType = type; - IsEnabled = enable; - } - - /// - /// Gets the currently used location method. - /// - /// 3 - public LocationType LocationType { get; private set; } - - /// - /// Method to get the setting value changed. - /// - /// 3 - public bool IsEnabled { get; private set; } - } -} diff --git a/src/Tizen.Location/Tizen.Location/ZoneChangedEventArgs.cs b/src/Tizen.Location/Tizen.Location/ZoneChangedEventArgs.cs deleted file mode 100755 index 81a45d782..000000000 --- a/src/Tizen.Location/Tizen.Location/ZoneChangedEventArgs.cs +++ /dev/null @@ -1,71 +0,0 @@ -/* - * 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.Location -{ - public class ZoneChangedEventArgs : EventArgs - { - /// - /// The class constructor for the ZoneChangedEventArgs class. - /// - /// 3 - /// An enumeration of type BoundaryState. - /// The latitude value [-90.0 ~ 90.0] (degrees). - /// The longitude value [-180.0 ~ 180.0] (degrees). - /// The altitude value. - /// The timestamp value. - public ZoneChangedEventArgs(BoundaryState state, double latitude, double longitude, double altitude, DateTime timestamp) - { - BoundState = state; - Latitude = latitude; - Longitude = longitude; - Altitude = altitude; - Timestamp = timestamp; - } - - /// - /// Gets the boundary state. - /// - /// 3 - public BoundaryState BoundState { get; private set; } - - /// - /// Gets the latitude. - /// - /// 3 - public double Latitude { get; private set; } - - /// - /// Gets the longitude. - /// - /// 3 - public double Longitude { get; private set; } - - /// - /// Gets the altitude. - /// - /// 3 - public double Altitude { get; private set; } - - /// - /// Method to get the timestamp. - /// - /// 3 - public DateTime Timestamp { get; private set; } - } -} diff --git a/src/Tizen.Log/Interop/Interop.Dlog.cs b/src/Tizen.Log/Interop/Interop.Dlog.cs deleted file mode 100644 index db1253556..000000000 --- a/src/Tizen.Log/Interop/Interop.Dlog.cs +++ /dev/null @@ -1,67 +0,0 @@ -/* - * 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.Runtime.InteropServices; - -internal static partial class Interop -{ - internal static partial class Libraries - { - public const string Dlog = "libdlog.so.0"; - } - - internal static partial class Dlog - { - internal enum LogID : int - { - LOG_ID_INVALID = -1, - LOG_ID_MAIN, - LOG_ID_RADIO, - LOG_ID_SYSTEM, - LOG_ID_APPS, - LOG_ID_KMSG, - LOG_ID_MAX - } - - internal enum LogPriority : int - { - DLOG_UNKNOWN = 0, - DLOG_DEFAULT, - DLOG_VERBOSE, - DLOG_DEBUG, - DLOG_INFO, - DLOG_WARN, - DLOG_ERROR, - DLOG_FATAL, - DLOG_SILENT, - DLOG_PRIO_MAX, - } - - [DllImport(Libraries.Dlog, EntryPoint = "dlog_print", CallingConvention = CallingConvention.Cdecl)] - internal static extern int Print(LogPriority prio, string tag, string fmt, string msg); - - [DllImport(Libraries.Dlog, EntryPoint = "dlog_print", CallingConvention = CallingConvention.Cdecl)] - internal static extern int Print(LogPriority prio, string tag, string fmt, string file, string func, int line, string msg); - - [DllImport(Libraries.Dlog, EntryPoint = "__dlog_print", CallingConvention = CallingConvention.Cdecl)] - internal static extern int InternalPrint(LogID log_id, LogPriority prio, string tag, string fmt, string msg); - - [DllImport(Libraries.Dlog, EntryPoint = "__dlog_print", CallingConvention = CallingConvention.Cdecl)] - internal static extern int InternalPrint(LogID log_id, LogPriority prio, string tag, string fmt, string file, string func, int line, string msg); - - } -} - diff --git a/src/Tizen.Log/Tizen.Log.csproj b/src/Tizen.Log/Tizen.Log.csproj deleted file mode 100644 index dbdcea46b..000000000 --- a/src/Tizen.Log/Tizen.Log.csproj +++ /dev/null @@ -1,7 +0,0 @@ - - - - netstandard2.0 - - - diff --git a/src/Tizen.Log/Tizen.Log.sln b/src/Tizen.Log/Tizen.Log.sln deleted file mode 100755 index 6e96adae0..000000000 --- a/src/Tizen.Log/Tizen.Log.sln +++ /dev/null @@ -1,22 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26430.12 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Log", "Tizen.Log.csproj", "{D177F87F-B680-46DE-8EEB-2386BF76D2FA}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {D177F87F-B680-46DE-8EEB-2386BF76D2FA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D177F87F-B680-46DE-8EEB-2386BF76D2FA}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D177F87F-B680-46DE-8EEB-2386BF76D2FA}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D177F87F-B680-46DE-8EEB-2386BF76D2FA}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/src/Tizen.Log/Tizen/Log.cs b/src/Tizen.Log/Tizen/Log.cs deleted file mode 100644 index da673e7ac..000000000 --- a/src/Tizen.Log/Tizen/Log.cs +++ /dev/null @@ -1,224 +0,0 @@ -/* - * 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.IO; -using System.Runtime.CompilerServices; -using System.ComponentModel; - -namespace Tizen -{ - /// - /// Provides methods to print log messages to the Tizen logging system. - /// - public class Log - { - /// - /// Prints a log message with the VERBOSE priority. - /// - /// 3 - /// The tag name of the log message. - /// The log message to print. - /// The source file path of the caller function. This argument will be set automatically by the compiler. - /// The function name of the caller function. This argument will be set automatically by the compiler. - /// The line number of the calling position. This argument will be set automatically by the compiler. - public static void Verbose(string tag, string message, [CallerFilePath] string file = "", [CallerMemberName] string func = "", [CallerLineNumber] int line = 0) - { - Print(Interop.Dlog.LogPriority.DLOG_VERBOSE, tag, message, file, func, line); - } - - /// - /// Prints a log message with the DEBUG priority. - /// - /// 3 - /// The tag name of the log message. - /// The log message to print. - /// The source file path of the caller function. This argument will be set automatically by the compiler. - /// The function name of the caller function. This argument will be set automatically by the compiler. - /// The line number of the calling position. This argument will be set automatically by the compiler. - public static void Debug(string tag, string message, [CallerFilePath] string file = "", [CallerMemberName] string func = "", [CallerLineNumber] int line = 0) - { - Print(Interop.Dlog.LogPriority.DLOG_DEBUG, tag, message, file, func, line); - } - - /// - /// Prints a log message with the INFO priority. - /// - /// 3 - /// The tag name of the log message. - /// The log message to print. - /// The source file path of the caller function. This argument will be set automatically by the compiler. - /// The function name of the caller function. This argument will be set automatically by the compiler. - /// The line number of the calling position. This argument will be set automatically by the compiler. - public static void Info(string tag, string message, [CallerFilePath] string file = "", [CallerMemberName] string func = "", [CallerLineNumber] int line = 0) - { - Print(Interop.Dlog.LogPriority.DLOG_INFO, tag, message, file, func, line); - } - - /// - /// Prints a log message with the WARNING priority. - /// - /// 3 - /// The tag name of the log message. - /// The log message to print. - /// The source file path of the caller function. This argument will be set automatically by the compiler. - /// The function name of the caller function. This argument will be set automatically by the compiler. - /// The line number of the calling position. This argument will be set automatically by the compiler. - public static void Warn(string tag, string message, [CallerFilePath] string file = "", [CallerMemberName] string func = "", [CallerLineNumber] int line = 0) - { - Print(Interop.Dlog.LogPriority.DLOG_WARN, tag, message, file, func, line); - } - - /// - /// Prints a log message with the ERROR priority. - /// - /// 3 - /// The tag name of the log message. - /// The log message to print. - /// The source file path of the caller function. This argument will be set automatically by the compiler. - /// The function name of the caller function. This argument will be set automatically by the compiler. - /// The line number of the calling position. This argument will be set automatically by the compiler. - public static void Error(string tag, string message, [CallerFilePath] string file = "", [CallerMemberName] string func = "", [CallerLineNumber] int line = 0) - { - Print(Interop.Dlog.LogPriority.DLOG_ERROR, tag, message, file, func, line); - } - - /// - /// Prints a log message with the FATAL priority. - /// - /// 3 - /// The tag name of the log message. - /// The log message to print. - /// The source file path of the caller function. This argument will be set automatically by the compiler. - /// The function name of the caller function. This argument will be set automatically by the compiler. - /// The line number of the calling position. This argument will be set automatically by the compiler. - public static void Fatal(string tag, string message, [CallerFilePath] string file = "", [CallerMemberName] string func = "", [CallerLineNumber] int line = 0) - { - Print(Interop.Dlog.LogPriority.DLOG_FATAL, tag, message, file, func, line); - } - - static void Print(Interop.Dlog.LogPriority priority, string tag, string message, string file, string func, int line) - { - if (String.IsNullOrEmpty(file)) - { - Interop.Dlog.Print(priority, tag, "%s", message); - } - else - { - Uri f = new Uri("file://" + file); - Interop.Dlog.Print(priority, tag, "%s: %s(%d) > %s", Path.GetFileName(f.AbsolutePath), func, line, message); - } - } - } - - [EditorBrowsable(EditorBrowsableState.Never)] - public class InternalLog - { - public static void Verbose(string tag, string message, [CallerFilePath] string file = "", [CallerMemberName] string func = "", [CallerLineNumber] int line = 0) - { - // For internal dlog APIs, Verbose level log is disabled - // Print(Interop.Dlog.LogID.LOG_ID_MAIN, Interop.Dlog.LogPriority.DLOG_VERBOSE, tag, message, file, func, line); - } - - public static void Debug(string tag, string message, [CallerFilePath] string file = "", [CallerMemberName] string func = "", [CallerLineNumber] int line = 0) - { - Print(Interop.Dlog.LogID.LOG_ID_MAIN, Interop.Dlog.LogPriority.DLOG_DEBUG, tag, message, file, func, line); - } - - public static void Info(string tag, string message, [CallerFilePath] string file = "", [CallerMemberName] string func = "", [CallerLineNumber] int line = 0) - { - Print(Interop.Dlog.LogID.LOG_ID_MAIN, Interop.Dlog.LogPriority.DLOG_INFO, tag, message, file, func, line); - } - - public static void Warn(string tag, string message, [CallerFilePath] string file = "", [CallerMemberName] string func = "", [CallerLineNumber] int line = 0) - { - Print(Interop.Dlog.LogID.LOG_ID_MAIN, Interop.Dlog.LogPriority.DLOG_WARN, tag, message, file, func, line); - } - - public static void Error(string tag, string message, [CallerFilePath] string file = "", [CallerMemberName] string func = "", [CallerLineNumber] int line = 0) - { - Print(Interop.Dlog.LogID.LOG_ID_MAIN, Interop.Dlog.LogPriority.DLOG_ERROR, tag, message, file, func, line); - } - - public static void Fatal(string tag, string message, [CallerFilePath] string file = "", [CallerMemberName] string func = "", [CallerLineNumber] int line = 0) - { - Print(Interop.Dlog.LogID.LOG_ID_MAIN, Interop.Dlog.LogPriority.DLOG_FATAL, tag, message, file, func, line); - } - - static void Print(Interop.Dlog.LogID log_id, Interop.Dlog.LogPriority priority, string tag, string message, string file, string func, int line) - { - if (String.IsNullOrEmpty(file)) - { - Interop.Dlog.InternalPrint(log_id, priority, tag, "%s", message); - } - else - { - Uri f = new Uri("file://" + file); - Interop.Dlog.InternalPrint(log_id, priority, tag, "%s: %s(%d) > %s", Path.GetFileName(f.AbsolutePath), func, line, message); - } - } - } - - [EditorBrowsable(EditorBrowsableState.Never)] - public class SecureLog - { - public static void Verbose(string tag, string message, [CallerFilePath] string file = "", [CallerMemberName] string func = "", [CallerLineNumber] int line = 0) - { - // For internal dlog APIs, Verbose level log is disabled - // Print(Interop.Dlog.LogID.LOG_ID_MAIN, Interop.Dlog.LogPriority.DLOG_VERBOSE, tag, message, file, func, line); - } - - public static void Debug(string tag, string message, [CallerFilePath] string file = "", [CallerMemberName] string func = "", [CallerLineNumber] int line = 0) - { - Print(Interop.Dlog.LogID.LOG_ID_MAIN, Interop.Dlog.LogPriority.DLOG_DEBUG, tag, message, file, func, line); - } - - public static void Info(string tag, string message, [CallerFilePath] string file = "", [CallerMemberName] string func = "", [CallerLineNumber] int line = 0) - { - Print(Interop.Dlog.LogID.LOG_ID_MAIN, Interop.Dlog.LogPriority.DLOG_INFO, tag, message, file, func, line); - } - - public static void Warn(string tag, string message, [CallerFilePath] string file = "", [CallerMemberName] string func = "", [CallerLineNumber] int line = 0) - { - Print(Interop.Dlog.LogID.LOG_ID_MAIN, Interop.Dlog.LogPriority.DLOG_WARN, tag, message, file, func, line); - } - - public static void Error(string tag, string message, [CallerFilePath] string file = "", [CallerMemberName] string func = "", [CallerLineNumber] int line = 0) - { - Print(Interop.Dlog.LogID.LOG_ID_MAIN, Interop.Dlog.LogPriority.DLOG_ERROR, tag, message, file, func, line); - } - - public static void Fatal(string tag, string message, [CallerFilePath] string file = "", [CallerMemberName] string func = "", [CallerLineNumber] int line = 0) - { - Print(Interop.Dlog.LogID.LOG_ID_MAIN, Interop.Dlog.LogPriority.DLOG_FATAL, tag, message, file, func, line); - } - - static void Print(Interop.Dlog.LogID log_id, Interop.Dlog.LogPriority priority, string tag, string message, string file, string func, int line) - { -#if !DISABLE_SECURELOG - if (String.IsNullOrEmpty(file)) - { - Interop.Dlog.InternalPrint(log_id, priority, tag, "[SECURE_LOG] %s", message); - } - else - { - Uri f = new Uri("file://" + file); - Interop.Dlog.InternalPrint(log_id, priority, tag, "%s: %s(%d) > [SECURE_LOG] %s", Path.GetFileName(f.AbsolutePath), func, line, message); - } -#endif - } - } -} diff --git a/src/Tizen.Maps/Interop/Interop.Address.cs b/src/Tizen.Maps/Interop/Interop.Address.cs deleted file mode 100755 index 90840c06a..000000000 --- a/src/Tizen.Maps/Interop/Interop.Address.cs +++ /dev/null @@ -1,174 +0,0 @@ -/* - * 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 -{ - [DllImport(Libraries.MapService, EntryPoint = "maps_address_get_building_number")] - internal static extern ErrorCode GetBuildingNumber(this AddressHandle /* maps_address_h */ address, out string buildingNumber); - - [DllImport(Libraries.MapService, EntryPoint = "maps_address_set_building_number")] - internal static extern ErrorCode SetBuildingNumber(this AddressHandle /* maps_address_h */ address, string buildingNumber); - - [DllImport(Libraries.MapService, EntryPoint = "maps_address_get_street")] - internal static extern ErrorCode GetStreet(this AddressHandle /* maps_address_h */ address, out string street); - - [DllImport(Libraries.MapService, EntryPoint = "maps_address_set_street")] - internal static extern ErrorCode SetStreet(this AddressHandle /* maps_address_h */ address, string street); - - [DllImport(Libraries.MapService, EntryPoint = "maps_address_get_district")] - internal static extern ErrorCode GetDistrict(this AddressHandle /* maps_address_h */ address, out string district); - - [DllImport(Libraries.MapService, EntryPoint = "maps_address_set_district")] - internal static extern ErrorCode SetDistrict(this AddressHandle /* maps_address_h */ address, string district); - - [DllImport(Libraries.MapService, EntryPoint = "maps_address_get_city")] - internal static extern ErrorCode GetCity(this AddressHandle /* maps_address_h */ address, out string city); - - [DllImport(Libraries.MapService, EntryPoint = "maps_address_set_city")] - internal static extern ErrorCode SetCity(this AddressHandle /* maps_address_h */ address, string city); - - [DllImport(Libraries.MapService, EntryPoint = "maps_address_get_state")] - internal static extern ErrorCode GetState(this AddressHandle /* maps_address_h */ address, out string state); - - [DllImport(Libraries.MapService, EntryPoint = "maps_address_set_state")] - internal static extern ErrorCode SetState(this AddressHandle /* maps_address_h */ address, string state); - - [DllImport(Libraries.MapService, EntryPoint = "maps_address_get_country")] - internal static extern ErrorCode GetCountry(this AddressHandle /* maps_address_h */ address, out string country); - - [DllImport(Libraries.MapService, EntryPoint = "maps_address_set_country")] - internal static extern ErrorCode SetCountry(this AddressHandle /* maps_address_h */ address, string country); - - [DllImport(Libraries.MapService, EntryPoint = "maps_address_get_country_code")] - internal static extern ErrorCode GetCountryCode(this AddressHandle /* maps_address_h */ address, out string countryCode); - - [DllImport(Libraries.MapService, EntryPoint = "maps_address_set_country_code")] - internal static extern ErrorCode SetCountryCode(this AddressHandle /* maps_address_h */ address, string countryCode); - - [DllImport(Libraries.MapService, EntryPoint = "maps_address_get_county")] - internal static extern ErrorCode GetCounty(this AddressHandle /* maps_address_h */ address, out string county); - - [DllImport(Libraries.MapService, EntryPoint = "maps_address_set_county")] - internal static extern ErrorCode SetCounty(this AddressHandle /* maps_address_h */ address, string county); - - [DllImport(Libraries.MapService, EntryPoint = "maps_address_get_postal_code")] - internal static extern ErrorCode GetPostalCode(this AddressHandle /* maps_address_h */ address, out string postalCode); - - [DllImport(Libraries.MapService, EntryPoint = "maps_address_set_postal_code")] - internal static extern ErrorCode SetPostalCode(this AddressHandle /* maps_address_h */ address, string postalCode); - - [DllImport(Libraries.MapService, EntryPoint = "maps_address_get_freetext")] - internal static extern ErrorCode GetFreeText(this AddressHandle /* maps_address_h */ address, out string freetext); - - [DllImport(Libraries.MapService, EntryPoint = "maps_address_set_freetext")] - internal static extern ErrorCode SetFreeText(this AddressHandle /* maps_address_h */ address, string freetext); - - internal class AddressHandle : SafeMapsHandle - { - [DllImport(Libraries.MapService, EntryPoint = "maps_address_create")] - internal static extern ErrorCode Create(out IntPtr /* maps_address_h */ address); - - [DllImport(Libraries.MapService, EntryPoint = "maps_address_destroy")] - internal static extern ErrorCode Destroy(IntPtr /* maps_address_h */ address); - - [DllImport(Libraries.MapService, EntryPoint = "maps_address_clone")] - internal static extern ErrorCode Clone(IntPtr /* maps_address_h */ origin, out IntPtr /* maps_address_h */ cloned); - - internal string Building - { - get { return NativeGet(this.GetBuildingNumber); } - set { NativeSet(this.SetBuildingNumber, value); } - } - - internal string Street - { - get { return NativeGet(this.GetStreet); } - set { NativeSet(this.SetStreet, value); } - } - - internal string City - { - get { return NativeGet(this.GetCity); } - set { NativeSet(this.SetCity, value); } - } - - internal string District - { - get { return NativeGet(this.GetDistrict); } - set { NativeSet(this.SetDistrict, value); } - } - - internal string State - { - get { return NativeGet(this.GetState); } - set { NativeSet(this.SetState, value); } - } - - internal string Country - { - get { return NativeGet(this.GetCountry); } - set { NativeSet(this.SetCountry, value); } - } - - internal string CountryCode - { - get { return NativeGet(this.GetCountryCode); } - set { NativeSet(this.SetCountryCode, value); } - } - - internal string County - { - get { return NativeGet(this.GetCounty); } - set { NativeSet(this.SetCounty, value); } - } - - internal string PostalCode - { - get { return NativeGet(this.GetPostalCode); } - set { NativeSet(this.SetPostalCode, value); } - } - - internal string FreeText - { - get { return NativeGet(this.GetFreeText); } - set { NativeSet(this.SetFreeText, value); } - } - - internal AddressHandle(IntPtr handle, bool needToRelease) : base(handle, needToRelease, Destroy) - { - } - - internal AddressHandle() : this(IntPtr.Zero, true) - { - Create(out handle).ThrowIfFailed("Failed to create native handle"); - } - - internal static AddressHandle CloneFrom(IntPtr nativeHandle) - { - IntPtr handle; - Clone(nativeHandle, out handle).ThrowIfFailed("Failed to clone native handle"); - return new AddressHandle(handle, true); - } - - internal static AddressHandle Create(IntPtr nativeHandle) - { - return new AddressHandle(nativeHandle, true); - } - } -} diff --git a/src/Tizen.Maps/Interop/Interop.AddressList.cs b/src/Tizen.Maps/Interop/Interop.AddressList.cs deleted file mode 100755 index ebbc6d3d7..000000000 --- a/src/Tizen.Maps/Interop/Interop.AddressList.cs +++ /dev/null @@ -1,66 +0,0 @@ -/* - * 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 -{ - [DllImport(Libraries.MapService, EntryPoint = "maps_address_list_append")] - internal static extern ErrorCode ListAppend(this AddressListHandle /* maps_address_list_h */ addressList, AddressHandle /* maps_address_h */ address); - - [DllImport(Libraries.MapService, EntryPoint = "maps_address_list_remove")] - internal static extern ErrorCode ListRemove(this AddressListHandle /* maps_address_list_h */ addressList, AddressHandle /* maps_address_h */ address); - - [DllImport(Libraries.MapService, EntryPoint = "maps_address_list_get_length")] - internal static extern ErrorCode ListGetLength(this AddressListHandle /* maps_address_list_h */ addressList, out int length); - - - internal class AddressListHandle : SafeMapsHandle - { - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool AddressCallback(int index, IntPtr /* maps_address_h */ addressHandle, IntPtr /* void */ userData); - - [DllImport(Libraries.MapService, EntryPoint = "maps_address_list_create")] - internal static extern ErrorCode Create(out IntPtr /* maps_address_list_h */ addressList); - - [DllImport(Libraries.MapService, EntryPoint = "maps_address_list_destroy")] - internal static extern ErrorCode Destroy(IntPtr /* maps_address_list_h */ addressList); - - [DllImport(Libraries.MapService, EntryPoint = "maps_address_list_foreach")] - internal static extern ErrorCode Foreach(IntPtr /* maps_address_list_h */ addressList, AddressCallback callback, IntPtr /* void */ userData); - - internal AddressListHandle() : base(IntPtr.Zero, true, Destroy) - { - Create(out handle).ThrowIfFailed("Failed to create native handle"); - } - - internal AddressListHandle(IntPtr handle, bool needToRelease) : base(handle, needToRelease, Destroy) - { - } - - internal void Foreach(Action action) - { - AddressCallback callback = (index, handle, userData) => - { - action(AddressHandle.CloneFrom(handle)); - return true; - }; - - Foreach(handle, callback, IntPtr.Zero).WarnIfFailed("Failed to get address list from native handle"); - } - } -} diff --git a/src/Tizen.Maps/Interop/Interop.Area.cs b/src/Tizen.Maps/Interop/Interop.Area.cs deleted file mode 100755 index cf568325a..000000000 --- a/src/Tizen.Maps/Interop/Interop.Area.cs +++ /dev/null @@ -1,65 +0,0 @@ -/* - * 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 class AreaHandle : SafeMapsHandle - { - [DllImport(Libraries.MapService, EntryPoint = "maps_area_create_rectangle")] - internal static extern ErrorCode CreateRectangle(IntPtr /* maps_coordinates_h */ topLeft, IntPtr /* maps_coordinates_h */ bottomRight, out IntPtr /* maps_area_h */ area); - - [DllImport(Libraries.MapService, EntryPoint = "maps_area_create_circle")] - internal static extern ErrorCode CreateCircle(IntPtr /* maps_coordinates_h */ center, double radius, out IntPtr /* maps_area_h */ area); - - [DllImport(Libraries.MapService, EntryPoint = "maps_area_destroy")] - internal static extern ErrorCode Destroy(IntPtr /* maps_area_h */ area); - - [DllImport(Libraries.MapService, EntryPoint = "maps_area_clone")] - internal static extern ErrorCode Clone(IntPtr /* maps_area_h */ origin, out IntPtr /* maps_area_h */ cloned); - - internal AreaHandle(IntPtr handle, bool needToRelease) : base(handle, needToRelease, Destroy) - { - } - - internal AreaHandle(CoordinatesHandle topLeft, CoordinatesHandle bottomRight) : this(IntPtr.Zero, true) - { - IntPtr _topLeft = (topLeft != null ? topLeft : IntPtr.Zero); - IntPtr _bottomRight = (bottomRight != null ? bottomRight : IntPtr.Zero); - CreateRectangle(_topLeft, _bottomRight, out handle).ThrowIfFailed("Failed to create native handle"); - } - - internal AreaHandle(CoordinatesHandle center, double radius) : this(IntPtr.Zero, true) - { - IntPtr _center = (center != null ? center : IntPtr.Zero); - CreateCircle(_center, radius, out handle).ThrowIfFailed("Failed to create native handle"); - } - - internal static AreaHandle CloneFrom(IntPtr nativeHandle) - { - IntPtr handle; - Clone(nativeHandle, out handle).ThrowIfFailed("Failed to clone native handle"); - return new AreaHandle(handle, true); - } - - internal static AreaHandle Create(IntPtr nativeHandle) - { - return new AreaHandle(nativeHandle, true); - } - } -} diff --git a/src/Tizen.Maps/Interop/Interop.Coordinates.cs b/src/Tizen.Maps/Interop/Interop.Coordinates.cs deleted file mode 100755 index 6a06431c0..000000000 --- a/src/Tizen.Maps/Interop/Interop.Coordinates.cs +++ /dev/null @@ -1,75 +0,0 @@ -/* - * 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 -{ - [DllImport(Libraries.MapService, EntryPoint = "maps_coordinates_get_latitude")] - internal static extern ErrorCode GetLatitude(this CoordinatesHandle /* maps_coordinates_h */ coordinates, out double latitude); - - [DllImport(Libraries.MapService, EntryPoint = "maps_coordinates_get_longitude")] - internal static extern ErrorCode GetLongitude(this CoordinatesHandle /* maps_coordinates_h */ coordinates, out double longitude); - - internal class CoordinatesHandle : SafeMapsHandle - { - [DllImport(Libraries.MapService, EntryPoint = "maps_coordinates_create")] - internal static extern ErrorCode Create(double latitude, double longitude, out IntPtr /* maps_coordinates_h */ coordinates); - - [DllImport(Libraries.MapService, EntryPoint = "maps_coordinates_destroy")] - internal static extern ErrorCode Destroy(IntPtr /* maps_coordinates_h */ coordinates); - - [DllImport(Libraries.MapService, EntryPoint = "maps_coordinates_clone")] - internal static extern ErrorCode Clone(IntPtr /* maps_coordinates_h */ origin, out IntPtr /* maps_coordinates_h */ cloned); - - internal double Latitude - { - get { return NativeGet(this.GetLatitude); } - } - - internal double Longitude - { - get { return NativeGet(this.GetLongitude); } - } - - internal CoordinatesHandle(IntPtr handle, bool needToRelease) : base(handle, needToRelease, Destroy) - { - } - - internal CoordinatesHandle(double latitude, double longitude) : this(IntPtr.Zero, true) - { - Create(latitude, longitude, out handle).ThrowIfFailed("Failed to create native handle"); - } - - internal static CoordinatesHandle CloneFrom(IntPtr nativeHandle) - { - IntPtr handle; - Clone(nativeHandle, out handle).ThrowIfFailed("Failed to clone native handle"); - return new CoordinatesHandle(handle, true); - } - - internal static CoordinatesHandle Create(IntPtr nativeHandle) - { - return new CoordinatesHandle(nativeHandle, true); - } - - public override string ToString() - { - return $"[{Latitude}, {Longitude}]"; - } - } -} diff --git a/src/Tizen.Maps/Interop/Interop.CoordinatesList.cs b/src/Tizen.Maps/Interop/Interop.CoordinatesList.cs deleted file mode 100755 index 5c31cf9eb..000000000 --- a/src/Tizen.Maps/Interop/Interop.CoordinatesList.cs +++ /dev/null @@ -1,72 +0,0 @@ -/* - * 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 -{ - [DllImport(Libraries.MapService, EntryPoint = "maps_coordinates_list_append")] - internal static extern ErrorCode Append(this CoordinatesListHandle /* maps_coordinates_list_h */ coordinatesList, IntPtr /* maps_coordinates_h */ coordinates); - - [DllImport(Libraries.MapService, EntryPoint = "maps_coordinates_list_remove")] - internal static extern ErrorCode Remove(this CoordinatesListHandle /* maps_coordinates_list_h */ coordinatesList, CoordinatesHandle /* maps_coordinates_h */ coordinates); - - - internal class CoordinatesListHandle : SafeMapsHandle - { - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool CoordinatesCallback(int index, IntPtr /* maps_coordinates_h */ coordinates, IntPtr /* void */ userData); - - [DllImport(Libraries.MapService, EntryPoint = "maps_coordinates_list_create")] - internal static extern ErrorCode Create(out IntPtr /* maps_coordinates_list_h */ coordinatesList); - - [DllImport(Libraries.MapService, EntryPoint = "maps_coordinates_list_destroy")] - internal static extern ErrorCode Destroy(IntPtr /* maps_coordinates_list_h */ coordinatesList); - - [DllImport(Libraries.MapService, EntryPoint = "maps_coordinates_list_foreach")] - internal static extern ErrorCode Foreach(IntPtr /* maps_coordinates_list_h */ coordinatesList, CoordinatesCallback callback, IntPtr /* void */ userData); - - internal CoordinatesListHandle(IntPtr handle, bool needToRelease) : base(handle, needToRelease, Destroy) { } - - internal CoordinatesListHandle(bool needToRelease = true) : this(IntPtr.Zero, needToRelease) - { - Create(out handle).ThrowIfFailed("Failed to create native handle"); - } - - internal void Add(CoordinatesHandle handleToAdd) - { - using (var clonedHandle = CoordinatesHandle.CloneFrom(handleToAdd)) - { - if (this.Append(clonedHandle).WarnIfFailed("Failed to add coordinates to the list")) - { - clonedHandle.HasOwnership = false; - } - } - } - - internal void ForEach(Action action) - { - CoordinatesCallback callback = (index, handle, userData) => - { - action(CoordinatesHandle.CloneFrom(handle)); - return true; - }; - - Foreach(handle, callback, IntPtr.Zero).WarnIfFailed("Failed to get coordinates list from native handle"); - } - } -} diff --git a/src/Tizen.Maps/Interop/Interop.ErrorCode.cs b/src/Tizen.Maps/Interop/Interop.ErrorCode.cs deleted file mode 100755 index 89d4916ec..000000000 --- a/src/Tizen.Maps/Interop/Interop.ErrorCode.cs +++ /dev/null @@ -1,107 +0,0 @@ -/* - * 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.CompilerServices; -using Tizen; - -internal static partial class Interop -{ - internal enum ErrorCode - { - None = Tizen.Internals.Errors.ErrorCode.None, - PermissionDenied = Tizen.Internals.Errors.ErrorCode.PermissionDenied, - OutOfMemory = Tizen.Internals.Errors.ErrorCode.OutOfMemory, - InvalidParameter = Tizen.Internals.Errors.ErrorCode.InvalidParameter, - NotSupported = Tizen.Internals.Errors.ErrorCode.NotSupported, - ConnectionTimeOut = Tizen.Internals.Errors.ErrorCode.ConnectionTimeout, - NetworkUnreachable = Tizen.Internals.Errors.ErrorCode.NetworkUnreachable, - InvalidOperation = Tizen.Internals.Errors.ErrorCode.InvalidOperation, - KeyNotAvailable = Tizen.Internals.Errors.ErrorCode.KeyNotAvailable, - ResourceBusy = Tizen.Internals.Errors.ErrorCode.ResourceBusy, - Canceled = Tizen.Internals.Errors.ErrorCode.Canceled, - Unknown = Tizen.Internals.Errors.ErrorCode.Unknown, - UserNotConsented = Tizen.Internals.Errors.ErrorCode.UserNotConsented, - ServiceNotAvailable = -0x02C20000 | 0x01, // MAPS_ERROR_SERVICE_NOT_AVAILABLE - NotFound = -0x02C20000 | 0x02, // MAPS_ERROR_NOT_FOUND - } -} - -internal static class ErrorCodeExtensions -{ - private const string LogTag = "Tizen.Maps"; - - internal static bool IsSuccess(this Interop.ErrorCode err) - { - return err == Interop.ErrorCode.None; - } - - internal static bool IsFailed(this Interop.ErrorCode err) - { - return !err.IsSuccess(); - } - - /// - /// The utility method to check for an error. Returns false on failure and prints warning messages. - /// - /// Returns true in case of no error, otherwise false. - internal static bool WarnIfFailed(this Interop.ErrorCode err, string msg, [CallerFilePath] string file = "", [CallerMemberName] string func = "", [CallerLineNumber] int line = 0) - { - if (err.IsFailed()) - { - Log.Debug(LogTag, $"{msg}, err: {err.ToString()}", file, func, line); - return false; - } - return true; - } - - /// - /// The utility method to check for an error. Returns false on failure and throws an exception. - /// - /// Returns true in case of no error, otherwise false. - internal static bool ThrowIfFailed(this Interop.ErrorCode err, string msg, [CallerFilePath] string file = "", [CallerMemberName] string func = "", [CallerLineNumber] int line = 0) - { - if (err.IsFailed()) - { - Log.Error(LogTag, $"{msg}, err: {err.ToString()}", file, func, line); - throw err.GetException(msg); - } - return true; - } - - internal static Exception GetException(this Interop.ErrorCode err, string message) - { - string errMessage = $"{message}, err: {err.ToString()}"; - switch (err) - { - //case ErrorCode.None: - case Interop.ErrorCode.PermissionDenied: return new System.UnauthorizedAccessException(errMessage); - case Interop.ErrorCode.InvalidParameter: return new System.ArgumentException(errMessage); - case Interop.ErrorCode.OutOfMemory: - case Interop.ErrorCode.NotSupported: - case Interop.ErrorCode.ConnectionTimeOut: - case Interop.ErrorCode.NetworkUnreachable: - case Interop.ErrorCode.InvalidOperation: - case Interop.ErrorCode.KeyNotAvailable: - case Interop.ErrorCode.ResourceBusy: - case Interop.ErrorCode.Canceled: - case Interop.ErrorCode.Unknown: - case Interop.ErrorCode.ServiceNotAvailable: - case Interop.ErrorCode.NotFound: - default: return new System.InvalidOperationException(errMessage); - } - } -} diff --git a/src/Tizen.Maps/Interop/Interop.Libraries.cs b/src/Tizen.Maps/Interop/Interop.Libraries.cs deleted file mode 100755 index 03be6b6f6..000000000 --- a/src/Tizen.Maps/Interop/Interop.Libraries.cs +++ /dev/null @@ -1,23 +0,0 @@ -/* - * 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 class Libraries - { - internal const string MapService = "capi-maps-service.so.0"; - } -} \ No newline at end of file diff --git a/src/Tizen.Maps/Interop/Interop.Place.Attribute.cs b/src/Tizen.Maps/Interop/Interop.Place.Attribute.cs deleted file mode 100755 index f7e7c787b..000000000 --- a/src/Tizen.Maps/Interop/Interop.Place.Attribute.cs +++ /dev/null @@ -1,55 +0,0 @@ -/* - * 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 -{ - [DllImport(Libraries.MapService, EntryPoint = "maps_place_attribute_get_id")] - internal static extern ErrorCode GetId(this PlaceAttributeHandle /* maps_place_attribute_h */ attribute, out string id); - - [DllImport(Libraries.MapService, EntryPoint = "maps_place_attribute_get_label")] - internal static extern ErrorCode GetLabel(this PlaceAttributeHandle /* maps_place_attribute_h */ attribute, out string label); - - [DllImport(Libraries.MapService, EntryPoint = "maps_place_attribute_get_text")] - internal static extern ErrorCode GetText(this PlaceAttributeHandle /* maps_place_attribute_h */ attribute, out string text); - - internal class PlaceAttributeHandle : SafeMapsHandle - { - [DllImport(Libraries.MapService, EntryPoint = "maps_place_attribute_destroy")] - internal static extern ErrorCode Destroy(IntPtr /* maps_place_attribute_h */ attribute); - - internal string Id - { - get { return NativeGet(this.GetId); } - } - - internal string Label - { - get { return NativeGet(this.GetLabel); } - } - - internal string Text - { - get { return NativeGet(this.GetText); } - } - - public PlaceAttributeHandle(IntPtr handle, bool needToRelease) : base(handle, needToRelease, Destroy) - { - } - } -} diff --git a/src/Tizen.Maps/Interop/Interop.Place.Category.cs b/src/Tizen.Maps/Interop/Interop.Place.Category.cs deleted file mode 100755 index 7265409c7..000000000 --- a/src/Tizen.Maps/Interop/Interop.Place.Category.cs +++ /dev/null @@ -1,80 +0,0 @@ -/* - * 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 -{ - [DllImport(Libraries.MapService, EntryPoint = "maps_place_category_get_id")] - internal static extern ErrorCode GetId(this PlaceCategoryHandle /* maps_place_category_h */ category, out string id); - - [DllImport(Libraries.MapService, EntryPoint = "maps_place_category_set_id")] - internal static extern ErrorCode SetId(this PlaceCategoryHandle /* maps_place_category_h */ category, string id); - - [DllImport(Libraries.MapService, EntryPoint = "maps_place_category_get_name")] - internal static extern ErrorCode GetName(this PlaceCategoryHandle /* maps_place_category_h */ category, out string name); - - [DllImport(Libraries.MapService, EntryPoint = "maps_place_category_set_name")] - internal static extern ErrorCode SetName(this PlaceCategoryHandle /* maps_place_category_h */ category, string name); - - [DllImport(Libraries.MapService, EntryPoint = "maps_place_category_get_url")] - internal static extern ErrorCode GetUrl(this PlaceCategoryHandle /* maps_place_category_h */ category, out string url); - - [DllImport(Libraries.MapService, EntryPoint = "maps_place_category_set_url")] - internal static extern ErrorCode SetUrl(this PlaceCategoryHandle /* maps_place_category_h */ category, string url); - - internal class PlaceCategoryHandle : SafeMapsHandle - { - [DllImport(Libraries.MapService, EntryPoint = "maps_place_category_create")] - internal static extern ErrorCode Create(out IntPtr /* maps_place_category_h */ category); - - [DllImport(Libraries.MapService, EntryPoint = "maps_place_category_destroy")] - internal static extern ErrorCode Destroy(IntPtr /* maps_place_category_h */ category); - - internal string Id - { - get { return NativeGet(this.GetId); } - set { NativeSet(this.SetId, value); } - } - - internal string Name - { - get { return NativeGet(this.GetName); } - set { NativeSet(this.SetName, value); } - } - - internal string Url - { - get { return NativeGet(this.GetUrl); } - set { NativeSet(this.SetUrl, value); } - } - - public PlaceCategoryHandle(IntPtr handle, bool needToRelease) : base(handle, needToRelease, Destroy) - { - } - - internal PlaceCategoryHandle() : this(IntPtr.Zero, true) - { - Create(out handle).ThrowIfFailed("Failed to create native handle"); - } - - internal static PlaceCategoryHandle Create(IntPtr nativeHandle) - { - return new PlaceCategoryHandle(nativeHandle, true); - } - } -} diff --git a/src/Tizen.Maps/Interop/Interop.Place.Contact.cs b/src/Tizen.Maps/Interop/Interop.Place.Contact.cs deleted file mode 100755 index bd6b61f2f..000000000 --- a/src/Tizen.Maps/Interop/Interop.Place.Contact.cs +++ /dev/null @@ -1,55 +0,0 @@ -/* - * 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 -{ - [DllImport(Libraries.MapService, EntryPoint = "maps_place_contact_get_label")] - internal static extern ErrorCode GetLabel(this PlaceContactHandle /* maps_place_contact_h */ contact, out string label); - - [DllImport(Libraries.MapService, EntryPoint = "maps_place_contact_get_type")] - internal static extern ErrorCode GetType(this PlaceContactHandle /* maps_place_contact_h */ contact, out string type); - - [DllImport(Libraries.MapService, EntryPoint = "maps_place_contact_get_value")] - internal static extern ErrorCode GetValue(this PlaceContactHandle /* maps_place_contact_h */ contact, out string value); - - internal class PlaceContactHandle : SafeMapsHandle - { - [DllImport(Libraries.MapService, EntryPoint = "maps_place_contact_destroy")] - internal static extern ErrorCode Destroy(IntPtr /* maps_place_contact_h */ contact); - - internal string Label - { - get { return NativeGet(this.GetLabel); } - } - - internal string Type - { - get { return NativeGet(this.GetType); } - } - - internal string Value - { - get { return NativeGet(this.GetValue); } - } - - public PlaceContactHandle(IntPtr handle, bool needToRelease) : base(handle, needToRelease, Destroy) - { - } - } -} diff --git a/src/Tizen.Maps/Interop/Interop.Place.Editorial.cs b/src/Tizen.Maps/Interop/Interop.Place.Editorial.cs deleted file mode 100755 index 6af3dbae6..000000000 --- a/src/Tizen.Maps/Interop/Interop.Place.Editorial.cs +++ /dev/null @@ -1,55 +0,0 @@ -/* - * 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 -{ - [DllImport(Libraries.MapService, EntryPoint = "maps_place_editorial_get_description")] - internal static extern ErrorCode GetDescription(this PlaceEditorialHandle /* maps_place_editorial_h */ editorial, out string description); - - [DllImport(Libraries.MapService, EntryPoint = "maps_place_editorial_get_language")] - internal static extern ErrorCode GetLanguage(this PlaceEditorialHandle /* maps_place_editorial_h */ editorial, out string language); - - [DllImport(Libraries.MapService, EntryPoint = "maps_place_editorial_get_media")] - internal static extern ErrorCode GetMedia(this PlaceEditorialHandle /* maps_place_editorial_h */ editorial, out IntPtr /* maps_place_media_h */ media); - - internal class PlaceEditorialHandle : SafeMapsHandle - { - [DllImport(Libraries.MapService, EntryPoint = "maps_place_editorial_destroy")] - internal static extern ErrorCode Destroy(IntPtr /* maps_place_editorial_h */ editorial); - - internal string Description - { - get { return NativeGet(this.GetDescription); } - } - - internal string Language - { - get { return NativeGet(this.GetLanguage); } - } - - internal PlaceMediaHandle Media - { - get { return NativeGet(this.GetMedia, PlaceMediaHandle.Create); } - } - - public PlaceEditorialHandle(IntPtr handle, bool needToRelease) : base(handle, needToRelease, Destroy) - { - } - } -} diff --git a/src/Tizen.Maps/Interop/Interop.Place.Filter.cs b/src/Tizen.Maps/Interop/Interop.Place.Filter.cs deleted file mode 100755 index 20dc6a923..000000000 --- a/src/Tizen.Maps/Interop/Interop.Place.Filter.cs +++ /dev/null @@ -1,111 +0,0 @@ -/* - * 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 -{ - [DllImport(Libraries.MapService, EntryPoint = "maps_place_filter_get")] - internal static extern ErrorCode Get(this PlaceFilterHandle /* maps_place_filter_h */ filter, string key, out string value); - - [DllImport(Libraries.MapService, EntryPoint = "maps_place_filter_set")] - internal static extern ErrorCode Set(this PlaceFilterHandle /* maps_place_filter_h */ filter, string key, string value); - - [DllImport(Libraries.MapService, EntryPoint = "maps_place_filter_get_keyword")] - internal static extern ErrorCode GetKeyword(this PlaceFilterHandle /* maps_place_filter_h */ filter, out string keyword); - - [DllImport(Libraries.MapService, EntryPoint = "maps_place_filter_set_keyword")] - internal static extern ErrorCode SetKeyword(this PlaceFilterHandle /* maps_place_filter_h */ filter, string keyword); - - [DllImport(Libraries.MapService, EntryPoint = "maps_place_filter_get_place_name")] - internal static extern ErrorCode GetPlaceName(this PlaceFilterHandle /* maps_place_filter_h */ filter, out string placeName); - - [DllImport(Libraries.MapService, EntryPoint = "maps_place_filter_set_place_name")] - internal static extern ErrorCode SetPlaceName(this PlaceFilterHandle /* maps_place_filter_h */ filter, string placeName); - - [DllImport(Libraries.MapService, EntryPoint = "maps_place_filter_get_category")] - internal static extern ErrorCode GetCategory(this PlaceFilterHandle /* maps_place_filter_h */ filter, out IntPtr /* maps_place_category_h */ category); - - [DllImport(Libraries.MapService, EntryPoint = "maps_place_filter_set_category")] - internal static extern ErrorCode SetCategory(this PlaceFilterHandle /* maps_place_filter_h */ filter, PlaceCategoryHandle /* maps_place_category_h */ category); - - [DllImport(Libraries.MapService, EntryPoint = "maps_place_filter_get_place_address")] - internal static extern ErrorCode GetPlaceAddress(this PlaceFilterHandle /* maps_place_filter_h */ filter, out string placeAddress); - - [DllImport(Libraries.MapService, EntryPoint = "maps_place_filter_set_place_address")] - internal static extern ErrorCode SetPlaceAddress(this PlaceFilterHandle /* maps_place_filter_h */ filter, string placeAddress); - - internal class PlaceFilterHandle : SafeMapsHandle - { - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool PlaceFilterPropertiesCallback(int index, int total, string key, IntPtr /* void */ value, IntPtr /* void */ userData); - - [DllImport(Libraries.MapService, EntryPoint = "maps_place_filter_foreach_property")] - internal static extern ErrorCode ForeachProperty(IntPtr /* maps_place_filter_h */ filter, PlaceFilterPropertiesCallback callback, IntPtr /* void */ userData); - - - [DllImport(Libraries.MapService, EntryPoint = "maps_place_filter_create")] - internal static extern ErrorCode Create(out IntPtr /* maps_place_filter_h */ filter); - - [DllImport(Libraries.MapService, EntryPoint = "maps_place_filter_destroy")] - internal static extern ErrorCode Destroy(IntPtr /* maps_place_filter_h */ filter); - - internal string Keyword - { - get { return NativeGet(this.GetKeyword); } - set { NativeSet(this.SetKeyword, value); } - } - - internal string PlaceName - { - get { return NativeGet(this.GetPlaceName); } - set { NativeSet(this.SetPlaceName, value); } - } - - internal string PlaceAddress - { - get { return NativeGet(this.GetPlaceAddress); } - set { NativeSet(this.SetPlaceAddress, value); } - } - - internal PlaceCategoryHandle Category - { - get { return NativeGet(this.GetCategory, PlaceCategoryHandle.Create); } - set { NativeSet(this.SetCategory, value); } - } - - public PlaceFilterHandle(IntPtr handle, bool needToRelease) : base(handle, needToRelease, Destroy) - { - } - - public PlaceFilterHandle() : this(IntPtr.Zero, true) - { - Create(out handle).ThrowIfFailed("Failed to create native handle"); - } - - internal void ForeachProperty(Action action) - { - PlaceFilterPropertiesCallback callback = (index, total, key, value, userData) => - { - action(key, Marshal.PtrToStringUni(value)); - return true; - }; - - ForeachProperty(handle, callback, IntPtr.Zero).WarnIfFailed("Failed to get address list from native handle"); - } - } -} diff --git a/src/Tizen.Maps/Interop/Interop.Place.Image.cs b/src/Tizen.Maps/Interop/Interop.Place.Image.cs deleted file mode 100755 index ff96f6b50..000000000 --- a/src/Tizen.Maps/Interop/Interop.Place.Image.cs +++ /dev/null @@ -1,79 +0,0 @@ -/* - * 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 -{ - [DllImport(Libraries.MapService, EntryPoint = "maps_place_image_get_id")] - internal static extern ErrorCode GetId(this PlaceImageHandle /* maps_place_image_h */ image, out string id); - - [DllImport(Libraries.MapService, EntryPoint = "maps_place_image_get_url")] - internal static extern ErrorCode GetUrl(this PlaceImageHandle /* maps_place_image_h */ image, out string url); - - [DllImport(Libraries.MapService, EntryPoint = "maps_place_image_get_width")] - internal static extern ErrorCode GetWidth(this PlaceImageHandle /* maps_place_image_h */ image, out int width); - - [DllImport(Libraries.MapService, EntryPoint = "maps_place_image_get_height")] - internal static extern ErrorCode GetHeight(this PlaceImageHandle /* maps_place_image_h */ image, out int height); - - [DllImport(Libraries.MapService, EntryPoint = "maps_place_image_get_user_link")] - internal static extern ErrorCode GetUserLink(this PlaceImageHandle /* maps_place_image_h */ image, out IntPtr /* maps_place_link_object_h */ user); - - [DllImport(Libraries.MapService, EntryPoint = "maps_place_image_get_media")] - internal static extern ErrorCode GetMedia(this PlaceImageHandle /* maps_place_image_h */ image, out IntPtr /* maps_place_media_h */ media); - - internal class PlaceImageHandle : SafeMapsHandle - { - [DllImport(Libraries.MapService, EntryPoint = "maps_place_image_destroy")] - internal static extern ErrorCode Destroy(IntPtr /* maps_place_image_h */ image); - - internal string Id - { - get { return NativeGet(this.GetId); } - } - - internal string Url - { - get { return NativeGet(this.GetUrl); } - } - - internal int Width - { - get { return NativeGet(this.GetWidth); } - } - - internal int Height - { - get { return NativeGet(this.GetHeight); } - } - - internal PlaceLinkObjectHandle User - { - get { return NativeGet(this.GetUserLink, PlaceLinkObjectHandle.Create); } - } - - internal PlaceMediaHandle Media - { - get { return NativeGet(this.GetMedia, PlaceMediaHandle.Create); } - } - - public PlaceImageHandle(IntPtr handle, bool needToRelease) : base(handle, needToRelease, Destroy) - { - } - } -} diff --git a/src/Tizen.Maps/Interop/Interop.Place.Link.Object.cs b/src/Tizen.Maps/Interop/Interop.Place.Link.Object.cs deleted file mode 100755 index ac170b1b0..000000000 --- a/src/Tizen.Maps/Interop/Interop.Place.Link.Object.cs +++ /dev/null @@ -1,68 +0,0 @@ -/* - * 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 -{ - [DllImport(Libraries.MapService, EntryPoint = "maps_place_link_object_get_id")] - internal static extern ErrorCode GetId(this PlaceLinkObjectHandle /* maps_place_link_object_h */ link, out string id); - - [DllImport(Libraries.MapService, EntryPoint = "maps_place_link_object_get_name")] - internal static extern ErrorCode GetName(this PlaceLinkObjectHandle /* maps_place_link_object_h */ link, out string name); - - [DllImport(Libraries.MapService, EntryPoint = "maps_place_link_object_get_string")] - internal static extern ErrorCode GetLink(this PlaceLinkObjectHandle /* maps_place_link_object_h */ link, out string linkString); - - [DllImport(Libraries.MapService, EntryPoint = "maps_place_link_object_get_type")] - internal static extern ErrorCode GetType(this PlaceLinkObjectHandle /* maps_place_link_object_h */ link, out string type); - - internal class PlaceLinkObjectHandle : SafeMapsHandle - { - [DllImport(Libraries.MapService, EntryPoint = "maps_place_link_object_destroy")] - internal static extern ErrorCode Destroy(IntPtr /* maps_place_link_object_h */ link); - - internal string Id - { - get { return NativeGet(this.GetId); } - } - - internal string Name - { - get { return NativeGet(this.GetName); } - } - - internal string Link - { - get { return NativeGet(this.GetLink); } - } - - internal string Type - { - get { return NativeGet(this.GetType); } - } - - public PlaceLinkObjectHandle(IntPtr handle, bool needToRelease) : base(handle, needToRelease, Destroy) - { - } - - internal static PlaceLinkObjectHandle Create(IntPtr nativeHandle) - { - return new PlaceLinkObjectHandle(nativeHandle, true); - } - } -} diff --git a/src/Tizen.Maps/Interop/Interop.Place.Media.cs b/src/Tizen.Maps/Interop/Interop.Place.Media.cs deleted file mode 100755 index 14145b805..000000000 --- a/src/Tizen.Maps/Interop/Interop.Place.Media.cs +++ /dev/null @@ -1,60 +0,0 @@ -/* - * 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 -{ - [DllImport(Libraries.MapService, EntryPoint = "maps_place_media_get_attribution")] - internal static extern ErrorCode GetAttribution(this PlaceMediaHandle /* maps_place_media_h */ media, out string attribution); - - [DllImport(Libraries.MapService, EntryPoint = "maps_place_media_get_supplier")] - internal static extern ErrorCode GetSupplier(this PlaceMediaHandle /* maps_place_media_h */ media, out IntPtr /* maps_place_link_object_h */ supplier); - - [DllImport(Libraries.MapService, EntryPoint = "maps_place_media_get_via")] - internal static extern ErrorCode GetVia(this PlaceMediaHandle /* maps_place_media_h */ media, out IntPtr /* maps_place_link_object_h */ via); - - internal class PlaceMediaHandle : SafeMapsHandle - { - [DllImport(Libraries.MapService, EntryPoint = "maps_place_media_destroy")] - internal static extern ErrorCode Destroy(IntPtr /* maps_place_media_h */ media); - - internal string Attribution - { - get { return NativeGet(this.GetAttribution); } - } - - internal PlaceLinkObjectHandle Supplier - { - get { return NativeGet(this.GetSupplier, PlaceLinkObjectHandle.Create); } - } - - internal PlaceLinkObjectHandle Via - { - get { return NativeGet(this.GetVia, PlaceLinkObjectHandle.Create); } - } - - public PlaceMediaHandle(IntPtr handle, bool needToRelease) : base(handle, needToRelease, Destroy) - { - } - - internal static PlaceMediaHandle Create(IntPtr nativeHandle) - { - return new PlaceMediaHandle(nativeHandle, true); - } - } -} diff --git a/src/Tizen.Maps/Interop/Interop.Place.Rating.cs b/src/Tizen.Maps/Interop/Interop.Place.Rating.cs deleted file mode 100755 index acefe9e4d..000000000 --- a/src/Tizen.Maps/Interop/Interop.Place.Rating.cs +++ /dev/null @@ -1,53 +0,0 @@ -/* - * 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 -{ - [DllImport(Libraries.MapService, EntryPoint = "maps_place_rating_get_count")] - internal static extern ErrorCode GetCount(this PlaceRatingHandle /* maps_place_rating_h */ rating, out int count); - - [DllImport(Libraries.MapService, EntryPoint = "maps_place_rating_get_average")] - internal static extern ErrorCode GetAverage(this PlaceRatingHandle /* maps_place_rating_h */ rating, out double average); - - internal class PlaceRatingHandle : SafeMapsHandle - { - [DllImport(Libraries.MapService, EntryPoint = "maps_place_rating_destroy")] - internal static extern ErrorCode Destroy(IntPtr /* maps_place_rating_h */ rating); - - internal int Count - { - get { return NativeGet(this.GetCount); } - } - - internal double Average - { - get { return NativeGet(this.GetAverage); } - } - - - public PlaceRatingHandle(IntPtr handle, bool needToRelease) : base(handle, needToRelease, Destroy) - { - } - - internal static PlaceRatingHandle Create(IntPtr nativeHandle) - { - return new PlaceRatingHandle(nativeHandle, true); - } - } -} diff --git a/src/Tizen.Maps/Interop/Interop.Place.Review.cs b/src/Tizen.Maps/Interop/Interop.Place.Review.cs deleted file mode 100755 index 7cb111183..000000000 --- a/src/Tizen.Maps/Interop/Interop.Place.Review.cs +++ /dev/null @@ -1,84 +0,0 @@ -/* - * 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 -{ - [DllImport(Libraries.MapService, EntryPoint = "maps_place_review_get_date")] - internal static extern ErrorCode GetDate(this PlaceReviewHandle /* maps_place_review_h */ review, out string date); - - [DllImport(Libraries.MapService, EntryPoint = "maps_place_review_get_title")] - internal static extern ErrorCode GetTitle(this PlaceReviewHandle /* maps_place_review_h */ review, out string title); - - [DllImport(Libraries.MapService, EntryPoint = "maps_place_review_get_rating")] - internal static extern ErrorCode GetRating(this PlaceReviewHandle /* maps_place_review_h */ review, out double rating); - - [DllImport(Libraries.MapService, EntryPoint = "maps_place_review_get_description")] - internal static extern ErrorCode GetDescription(this PlaceReviewHandle /* maps_place_review_h */ review, out string description); - - [DllImport(Libraries.MapService, EntryPoint = "maps_place_review_get_language")] - internal static extern ErrorCode GetLanguage(this PlaceReviewHandle /* maps_place_review_h */ review, out string language); - - [DllImport(Libraries.MapService, EntryPoint = "maps_place_review_get_media")] - internal static extern ErrorCode GetMedia(this PlaceReviewHandle /* maps_place_review_h */ review, out IntPtr /* maps_place_media_h */ media); - - [DllImport(Libraries.MapService, EntryPoint = "maps_place_review_get_user_link")] - internal static extern ErrorCode GetUserLink(this PlaceReviewHandle /* maps_place_review_h */ review, out IntPtr /* maps_place_link_object_h */ user); - - internal class PlaceReviewHandle : SafeMapsHandle - { - [DllImport(Libraries.MapService, EntryPoint = "maps_place_review_destroy")] - internal static extern ErrorCode Destroy(IntPtr /* maps_place_review_h */ review); - - internal string Date - { - get { return NativeGet(this.GetDate); } - } - - internal string Title - { - get { return NativeGet(this.GetTitle); } - } - internal string Language - { - get { return NativeGet(this.GetLanguage); } - } - internal string Description - { - get { return NativeGet(this.GetDescription); } - } - internal double Rating - { - get { return NativeGet(this.GetRating); } - } - - internal PlaceLinkObjectHandle User - { - get { return NativeGet(this.GetUserLink, PlaceLinkObjectHandle.Create); } - } - - internal PlaceMediaHandle Media - { - get { return NativeGet(this.GetMedia, PlaceMediaHandle.Create); } - } - - public PlaceReviewHandle(IntPtr handle, bool needToRelease) : base(handle, needToRelease, Destroy) - { - } - } -} diff --git a/src/Tizen.Maps/Interop/Interop.Place.cs b/src/Tizen.Maps/Interop/Interop.Place.cs deleted file mode 100755 index 9d8a898bc..000000000 --- a/src/Tizen.Maps/Interop/Interop.Place.cs +++ /dev/null @@ -1,239 +0,0 @@ -/* - * 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 -{ - [DllImport(Libraries.MapService, EntryPoint = "maps_place_get_id")] - internal static extern ErrorCode GetId(this PlaceHandle /* maps_place_h */ place, out string id); - - [DllImport(Libraries.MapService, EntryPoint = "maps_place_get_name")] - internal static extern ErrorCode GetName(this PlaceHandle /* maps_place_h */ place, out string name); - - [DllImport(Libraries.MapService, EntryPoint = "maps_place_get_uri")] - internal static extern ErrorCode GetUri(this PlaceHandle /* maps_place_h */ place, out string uri); - - [DllImport(Libraries.MapService, EntryPoint = "maps_place_get_distance")] - internal static extern ErrorCode GetDistance(this PlaceHandle /* maps_place_h */ place, out int distance); - - [DllImport(Libraries.MapService, EntryPoint = "maps_place_get_location")] - internal static extern ErrorCode GetLocation(this PlaceHandle /* maps_place_h */ place, out IntPtr /* maps_coordinates_h */ location); - - [DllImport(Libraries.MapService, EntryPoint = "maps_place_get_address")] - internal static extern ErrorCode GetAddress(this PlaceHandle /* maps_place_h */ place, out IntPtr /* maps_address_h */ address); - - [DllImport(Libraries.MapService, EntryPoint = "maps_place_get_rating")] - internal static extern ErrorCode GetRating(this PlaceHandle /* maps_place_h */ place, out IntPtr /* maps_place_rating_h */ rating); - - [DllImport(Libraries.MapService, EntryPoint = "maps_place_get_supplier_link")] - internal static extern ErrorCode GetSupplierLink(this PlaceHandle /* maps_place_h */ place, out IntPtr /* maps_place_link_object_h */ supplier); - - [DllImport(Libraries.MapService, EntryPoint = "maps_place_get_related_link")] - internal static extern ErrorCode GetRelatedLink(this PlaceHandle /* maps_place_h */ place, out IntPtr /* maps_place_link_object_h */ related); - - internal class PlaceHandle : SafeMapsHandle - { - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool PropertiesCallback(int index, int total, string key, string /* void */ value, IntPtr /* void */ userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool CategoriesCallback(int index, int total, IntPtr /* maps_place_category_h */ category, IntPtr /* void */ userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool AttributesCallback(int index, int total, IntPtr /* maps_place_attribute_h */ attribute, IntPtr /* void */ userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool ContactsCallback(int index, int total, IntPtr /* maps_place_contact_h */ contact, IntPtr /* void */ userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool EditorialsCallback(int index, int total, IntPtr /* maps_place_editorial_h */ editorial, IntPtr /* void */ userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool ImagesCallback(int index, int total, IntPtr /* maps_place_image_h */ image, IntPtr /* void */ userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool ReviewsCallback(int index, int total, IntPtr /* maps_place_review_h */ review, IntPtr /* void */ userData); - - [DllImport(Libraries.MapService, EntryPoint = "maps_place_foreach_property")] - internal static extern ErrorCode ForeachProperty(IntPtr /* maps_place_h */ place, PropertiesCallback callback, IntPtr /* void */ userData); - - [DllImport(Libraries.MapService, EntryPoint = "maps_place_foreach_category")] - internal static extern ErrorCode ForeachCategory(IntPtr /* maps_place_h */ place, CategoriesCallback callback, IntPtr /* void */ userData); - - [DllImport(Libraries.MapService, EntryPoint = "maps_place_foreach_attribute")] - internal static extern ErrorCode ForeachAttribute(IntPtr /* maps_place_h */ place, AttributesCallback callback, IntPtr /* void */ userData); - - [DllImport(Libraries.MapService, EntryPoint = "maps_place_foreach_contact")] - internal static extern ErrorCode ForeachContact(IntPtr /* maps_place_h */ place, ContactsCallback callback, IntPtr /* void */ userData); - - [DllImport(Libraries.MapService, EntryPoint = "maps_place_foreach_editorial")] - internal static extern ErrorCode ForeachEditorial(IntPtr /* maps_place_h */ place, EditorialsCallback callback, IntPtr /* void */ userData); - - [DllImport(Libraries.MapService, EntryPoint = "maps_place_foreach_image")] - internal static extern ErrorCode ForeachImage(IntPtr /* maps_place_h */ place, ImagesCallback callback, IntPtr /* void */ userData); - - [DllImport(Libraries.MapService, EntryPoint = "maps_place_foreach_review")] - internal static extern ErrorCode ForeachReview(IntPtr /* maps_place_h */ place, ReviewsCallback callback, IntPtr /* void */ userData); - - [DllImport(Libraries.MapService, EntryPoint = "maps_place_destroy")] - internal static extern ErrorCode Destroy(IntPtr /* maps_place_h */ place); - - [DllImport(Libraries.MapService, EntryPoint = "maps_place_clone")] - internal static extern ErrorCode Clone(IntPtr /* maps_place_h */ origin, out IntPtr /* maps_place_h */ cloned); - - internal string Id - { - get { return NativeGet(this.GetId); } - } - - internal string Name - { - get { return NativeGet(this.GetName); } - } - - internal string Uri - { - get { return NativeGet(this.GetUri); } - } - - internal int Distance - { - get { return NativeGet(this.GetDistance); } - } - - internal CoordinatesHandle Coordinates - { - get { return NativeGet(this.GetLocation, CoordinatesHandle.Create); } - } - - internal AddressHandle Address - { - get { return NativeGet(this.GetAddress, AddressHandle.Create); } - } - - internal PlaceRatingHandle Rating - { - get { return NativeGet(this.GetRating, PlaceRatingHandle.Create); } - } - - internal PlaceLinkObjectHandle Supplier - { - get { return NativeGet(this.GetSupplierLink, PlaceLinkObjectHandle.Create); } - } - - internal PlaceLinkObjectHandle Related - { - get { return NativeGet(this.GetRelatedLink, PlaceLinkObjectHandle.Create); } - } - - public PlaceHandle(IntPtr handle, bool needToRelease) : base(handle, needToRelease, Destroy) - { - } - - internal static PlaceHandle CloneFrom(IntPtr nativeHandle) - { - IntPtr handle; - Clone(nativeHandle, out handle).ThrowIfFailed("Failed to clone native handle"); - return new PlaceHandle(handle, true); - } - - - internal void ForeachProperty(Action action) - { - PropertiesCallback callback = (index, total, key, value, userData) => - { - action(key, value); - return true; - }; - - ForeachProperty(handle, callback, IntPtr.Zero).WarnIfFailed("Failed to get property list from native handle"); - } - - internal void ForeachCategory(Action action) - { - // PlaceCategoryHandle is valid only in this callback and users should not keep its reference - CategoriesCallback callback = (index, total, handle, userData) => - { - action(new PlaceCategoryHandle(handle, true)); - return true; - }; - - ForeachCategory(handle, callback, IntPtr.Zero).WarnIfFailed("Failed to get category list from native handle"); - } - - internal void ForeachAttribute(Action action) - { - // PlaceAttributeHandle is valid only in this callback and users should not keep its reference - AttributesCallback callback = (index, total, handle, userData) => - { - action(new PlaceAttributeHandle(handle, true)); - return true; - }; - - ForeachAttribute(handle, callback, IntPtr.Zero).WarnIfFailed("Failed to get attributes list from native handle"); - } - - internal void ForeachContact(Action action) - { - // PlaceContactHandle is valid only in this callback and users should not keep its reference - ContactsCallback callback = (index, total, handle, userData) => - { - action(new PlaceContactHandle(handle, true)); - return true; - }; - - ForeachContact(handle, callback, IntPtr.Zero).WarnIfFailed("Failed to get contacts list from native handle"); - } - - internal void ForeachEditorial(Action action) - { - // PlaceEditorialHandle is valid only in this callback and users should not keep its reference - EditorialsCallback callback = (index, total, handle, userData) => - { - action(new PlaceEditorialHandle(handle, true)); - return true; - }; - - ForeachEditorial(handle, callback, IntPtr.Zero).WarnIfFailed("Failed to get editorial list from native handle"); - } - - internal void ForeachImage(Action action) - { - // PlaceImageHandle is valid only in this callback and users should not keep its reference - ImagesCallback callback = (index, total, handle, userData) => - { - action(new PlaceImageHandle(handle, true)); - return true; - }; - - ForeachImage(handle, callback, IntPtr.Zero).WarnIfFailed("Failed to get image list from native handle"); - } - - internal void ForeachReview(Action action) - { - // PlaceReviewHandle is valid only in this callback and users should not keep its reference - ReviewsCallback callback = (index, total, handle, userData) => - { - action(new PlaceReviewHandle(handle, true)); - return true; - }; - - ForeachReview(handle, callback, IntPtr.Zero).WarnIfFailed("Failed to get review list from native handle"); - } - } -} diff --git a/src/Tizen.Maps/Interop/Interop.PlaceList.cs b/src/Tizen.Maps/Interop/Interop.PlaceList.cs deleted file mode 100755 index 8edf5b857..000000000 --- a/src/Tizen.Maps/Interop/Interop.PlaceList.cs +++ /dev/null @@ -1,46 +0,0 @@ -/* - * 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 class PlaceListHandle : SafeMapsHandle - { - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool PlaceCallback(int index, IntPtr /* maps_place_h */ place, IntPtr /* void */ userData); - - [DllImport(Libraries.MapService, EntryPoint = "maps_place_list_destroy")] - internal static extern ErrorCode Destroy(IntPtr /* maps_place_list_h */ placeList); - - [DllImport(Libraries.MapService, EntryPoint = "maps_place_list_foreach")] - internal static extern ErrorCode Foreach(IntPtr /* maps_place_list_h */ placeList, PlaceCallback callback, IntPtr /* void */ userData); - - public PlaceListHandle(IntPtr handle, bool needToRelease) : base(handle, needToRelease, Destroy) { } - - internal void Foreach(Action action) - { - PlaceCallback callback = (index, handle, userData) => - { - action(PlaceHandle.CloneFrom(handle)); - return true; - }; - - Foreach(handle, callback, IntPtr.Zero).WarnIfFailed("Failed to get place list from native handle"); - } - } -} diff --git a/src/Tizen.Maps/Interop/Interop.Preference.cs b/src/Tizen.Maps/Interop/Interop.Preference.cs deleted file mode 100755 index f309cad0a..000000000 --- a/src/Tizen.Maps/Interop/Interop.Preference.cs +++ /dev/null @@ -1,227 +0,0 @@ -/* - * 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 enum DistanceUnit - { - Meter, // MAPS_DISTANCE_UNIT_M - Kilometer, // MAPS_DISTANCE_UNIT_KM - Foot, // MAPS_DISTANCE_UNIT_FT - Yard, // MAPS_DISTANCE_UNIT_YD - } - - internal enum RouteOptimization - { - Fastest, // MAPS_ROUTE_TYPE_FASTEST - Shortest, // MAPS_ROUTE_TYPE_SHORTEST - Economic, // MAPS_ROUTE_TYPE_ECONOMIC - Scenic, // MAPS_ROUTE_TYPE_SCENIC - FastestNow, // MAPS_ROUTE_TYPE_FASTESTNOW - DirectDrive, // MAPS_ROUTE_TYPE_DIRECTDRIVE - } - - internal enum RouteTransportMode - { - Car, // MAPS_ROUTE_TRANSPORT_MODE_CAR - Pedestrian, // MAPS_ROUTE_TRANSPORT_MODE_PEDESTRIAN - Bicycle, // MAPS_ROUTE_TRANSPORT_MODE_BICYCLE - PublicTransit, // MAPS_ROUTE_TRANSPORT_MODE_PUBLICTRANSIT - Truck, // MAPS_ROUTE_TRANSPORT_MODE_TRUCK - } - - internal enum RouteFeatureWeight - { - Normal, // MAPS_ROUTE_FEATURE_WEIGHT_NORMAL - Prefer, // MAPS_ROUTE_FEATURE_WEIGHT_PREFER - Avoid, // MAPS_ROUTE_FEATURE_WEIGHT_AVOID - SoftExclude, // MAPS_ROUTE_FEATURE_WEIGHT_SOFTEXCLUDE - StrictExclude, // MAPS_ROUTE_FEATURE_WEIGHT_STRICTEXCLUDE - } - - internal enum RouteRequestFeature - { - None, // MAPS_ROUTE_FEATURE_NO - Toll, // MAPS_ROUTE_FEATURE_TOLL - MotorWay, // MAPS_ROUTE_FEATURE_MOTORWAY - BoatFerry, // MAPS_ROUTE_FEATURE_BOATFERRY - RailFerry, // MAPS_ROUTE_FEATURE_RAILFERRY - PublicTransit, // MAPS_ROUTE_FEATURE_PUBLICTTRANSIT - Tunnel, // MAPS_ROUTE_FEATURE_TUNNEL - DirtRoad, // MAPS_ROUTE_FEATURE_DIRTROAD - Parks, // MAPS_ROUTE_FEATURE_PARKS - Hovlane, // MAPS_ROUTE_FEATURE_HOVLANE - Stairs, // MAPS_ROUTE_FEATURE_STAIRS - } - - [DllImport(Libraries.MapService, EntryPoint = "maps_preference_get_distance_unit")] - internal static extern ErrorCode GetDistanceUnit(this PreferenceHandle /* maps_preference_h */ preference, out DistanceUnit /* maps_distance_unit_e */ unit); - - [DllImport(Libraries.MapService, EntryPoint = "maps_preference_set_distance_unit")] - internal static extern ErrorCode SetDistanceUnit(this PreferenceHandle /* maps_preference_h */ preference, DistanceUnit /* maps_distance_unit_e */ unit); - - [DllImport(Libraries.MapService, EntryPoint = "maps_preference_get_language")] - internal static extern ErrorCode GetLanguage(this PreferenceHandle /* maps_preference_h */ preference, out string language); - - [DllImport(Libraries.MapService, EntryPoint = "maps_preference_set_language")] - internal static extern ErrorCode SetLanguage(this PreferenceHandle /* maps_preference_h */ preference, string language); - - [DllImport(Libraries.MapService, EntryPoint = "maps_preference_get_max_results")] - internal static extern ErrorCode GetMaxResults(this PreferenceHandle /* maps_preference_h */ preference, out int maxResults); - - [DllImport(Libraries.MapService, EntryPoint = "maps_preference_set_max_results")] - internal static extern ErrorCode SetMaxResults(this PreferenceHandle /* maps_preference_h */ preference, int maxResults); - - [DllImport(Libraries.MapService, EntryPoint = "maps_preference_get_country_code")] - internal static extern ErrorCode GetCountryCode(this PreferenceHandle /* maps_preference_h */ preference, out string countryCode); - - [DllImport(Libraries.MapService, EntryPoint = "maps_preference_set_country_code")] - internal static extern ErrorCode SetCountryCode(this PreferenceHandle /* maps_preference_h */ preference, string countryCode); - - [DllImport(Libraries.MapService, EntryPoint = "maps_preference_get_route_optimization")] - internal static extern ErrorCode GetRouteOptimization(this PreferenceHandle /* maps_preference_h */ preference, out RouteOptimization /* maps_route_optimization_e */ optimization); - - [DllImport(Libraries.MapService, EntryPoint = "maps_preference_set_route_optimization")] - internal static extern ErrorCode SetRouteOptimization(this PreferenceHandle /* maps_preference_h */ preference, RouteOptimization /* maps_route_optimization_e */ optimization); - - [DllImport(Libraries.MapService, EntryPoint = "maps_preference_get_route_transport_mode")] - internal static extern ErrorCode GetRouteTransportMode(this PreferenceHandle /* maps_preference_h */ preference, out RouteTransportMode /* maps_route_transport_mode_e */ transportMode); - - [DllImport(Libraries.MapService, EntryPoint = "maps_preference_set_route_transport_mode")] - internal static extern ErrorCode SetRouteTransportMode(this PreferenceHandle /* maps_preference_h */ preference, RouteTransportMode /* maps_route_transport_mode_e */ transportMode); - - [DllImport(Libraries.MapService, EntryPoint = "maps_preference_get_route_feature_weight")] - internal static extern ErrorCode GetRouteFeatureWeight(this PreferenceHandle /* maps_preference_h */ preference, out RouteFeatureWeight /* maps_route_feature_weight_e */ featureWeight); - - [DllImport(Libraries.MapService, EntryPoint = "maps_preference_set_route_feature_weight")] - internal static extern ErrorCode SetRouteFeatureWeight(this PreferenceHandle /* maps_preference_h */ preference, RouteFeatureWeight /* maps_route_feature_weight_e */ featureWeight); - - [DllImport(Libraries.MapService, EntryPoint = "maps_preference_get_route_feature")] - internal static extern ErrorCode GetRouteFeature(this PreferenceHandle /* maps_preference_h */ preference, out RouteRequestFeature /* maps_route_feature_e */ feature); - - [DllImport(Libraries.MapService, EntryPoint = "maps_preference_set_route_feature")] - internal static extern ErrorCode SetRouteFeature(this PreferenceHandle /* maps_preference_h */ preference, RouteRequestFeature /* maps_route_feature_e */ feature); - - [DllImport(Libraries.MapService, EntryPoint = "maps_preference_get_route_alternatives_enabled")] - internal static extern ErrorCode GetRouteAlternativesEnabled(this PreferenceHandle /* maps_preference_h */ preference, out bool enable); - - [DllImport(Libraries.MapService, EntryPoint = "maps_preference_set_route_alternatives_enabled")] - internal static extern ErrorCode SetRouteAlternativesEnabled(this PreferenceHandle /* maps_preference_h */ preference, bool enable); - - [DllImport(Libraries.MapService, EntryPoint = "maps_preference_get")] - internal static extern ErrorCode GetProperty(this PreferenceHandle /* maps_preference_h */ preference, string key, out string value); - - [DllImport(Libraries.MapService, EntryPoint = "maps_preference_set_property")] - internal static extern ErrorCode SetProperty(this PreferenceHandle /* maps_preference_h */ preference, string key, string value); - - internal class PreferenceHandle : SafeMapsHandle - { - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool PropertiesCallback(int index, int total, string key, string value, IntPtr /* void */ userData); - - [DllImport(Libraries.MapService, EntryPoint = "maps_preference_foreach_property")] - internal static extern ErrorCode ForeachProperty(IntPtr /* maps_preference_h */ preference, PropertiesCallback callback, IntPtr /* void */ userData); - - - [DllImport(Libraries.MapService, EntryPoint = "maps_preference_create")] - internal static extern ErrorCode Create(out IntPtr /* maps_preference_h */ preference); - - [DllImport(Libraries.MapService, EntryPoint = "maps_preference_destroy")] - internal static extern ErrorCode Destroy(IntPtr /* maps_preference_h */ preference); - - internal DistanceUnit Unit - { - get { return NativeGet(this.GetDistanceUnit); } - set { NativeSet(this.SetDistanceUnit, value); } - } - - internal string Language - { - get { return NativeGet(this.GetLanguage); } - set { NativeSet(this.SetLanguage, value); } - } - - internal int MaxResult - { - get { return NativeGet(this.GetMaxResults); } - set { NativeSet(this.SetMaxResults, value); } - } - - internal string CountryCode - { - get { return NativeGet(this.GetCountryCode); } - set { NativeSet(this.SetCountryCode, value); } - } - - internal RouteOptimization Optimization - { - get { return NativeGet(this.GetRouteOptimization); } - set { NativeSet(this.SetRouteOptimization, value); } - } - - internal RouteTransportMode TransportMode - { - get { return NativeGet(this.GetRouteTransportMode); } - set { NativeSet(this.SetRouteTransportMode, value); } - } - - internal RouteRequestFeature Feature - { - get { return NativeGet(this.GetRouteFeature); } - set { NativeSet(this.SetRouteFeature, value); } - } - - internal RouteFeatureWeight FeatureWeight - { - get { return NativeGet(this.GetRouteFeatureWeight); } - set { NativeSet(this.SetRouteFeatureWeight, value); } - } - - internal bool AlternativesEnabled - { - get { return NativeGet(this.GetRouteAlternativesEnabled); } - set { NativeSet(this.SetRouteAlternativesEnabled, value); } - } - - internal PreferenceHandle(IntPtr handle, bool needToRelease) : base(handle, needToRelease, Destroy) - { - } - - internal PreferenceHandle() : this(IntPtr.Zero, true) - { - Create(out handle).ThrowIfFailed("Failed to create native handle"); - } - - internal void ForeachProperty(Action action) - { - PropertiesCallback callback = (index, total, key, value, userData) => - { - action(key, value); - return true; - }; - - ForeachProperty(handle, callback, IntPtr.Zero).WarnIfFailed("Failed to get property list from native handle"); - } - - internal static PreferenceHandle Create(IntPtr nativeHandle) - { - return new PreferenceHandle(nativeHandle, true); - } - } -} diff --git a/src/Tizen.Maps/Interop/Interop.Route.Maneuver.cs b/src/Tizen.Maps/Interop/Interop.Route.Maneuver.cs deleted file mode 100755 index a2c6216a4..000000000 --- a/src/Tizen.Maps/Interop/Interop.Route.Maneuver.cs +++ /dev/null @@ -1,137 +0,0 @@ -/* - * 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 enum RouteDirection - { - None, // MAPS_ROUTE_DIRECTION_NONE - North, // MAPS_ROUTE_DIRECTION_NORTH - NorthWest, // MAPS_ROUTE_DIRECTION_NORTHWEST - NorthEast, // MAPS_ROUTE_DIRECTION_NORTHEAST - South, // MAPS_ROUTE_DIRECTION_SOUTH - SouthEast, // MAPS_ROUTE_DIRECTION_SOUTHEAST - SouthWest, // MAPS_ROUTE_DIRECTION_SOUTHWEST - West, // MAPS_ROUTE_DIRECTION_WEST - East, // MAPS_ROUTE_DIRECTION_EAST - } - - internal enum RouteTurnType - { - None, // MAPS_ROUTE_TURN_TYPE_NONE - Straight, // MAPS_ROUTE_TURN_TYPE_STRAIGHT - BearRight, // MAPS_ROUTE_TURN_TYPE_BEAR_RIGHT - LightRight, // MAPS_ROUTE_TURN_TYPE_LIGHT_RIGHT - Right, // MAPS_ROUTE_TURN_TYPE_RIGHT - HardRight, // MAPS_ROUTE_TURN_TYPE_HARD_RIGHT - UturnRight, // MAPS_ROUTE_TURN_TYPE_UTURN_RIGHT - UturnLeft, // MAPS_ROUTE_TURN_TYPE_UTURN_LEFT - HardLeft, // MAPS_ROUTE_TURN_TYPE_HARD_LEFT - Left, // MAPS_ROUTE_TURN_TYPE_LEFT - LightLeft, // MAPS_ROUTE_TURN_TYPE_LIGHT_LEFT - BearLeft, // MAPS_ROUTE_TURN_TYPE_BEAR_LEFT - RightFork, // MAPS_ROUTE_TURN_TYPE_RIGHT_FORK - LeftFork, // MAPS_ROUTE_TURN_TYPE_LEFT_FORK - StraightFork, // MAPS_ROUTE_TURN_TYPE_STRAIGHT_FORK - } - - [DllImport(Libraries.MapService, EntryPoint = "maps_route_maneuver_get_direction_id")] - internal static extern ErrorCode GetDirectionId(this RouteManeuverHandle /* maps_route_maneuver_h */ maneuver, out RouteDirection /* maps_route_direction_e */ directionId); - - [DllImport(Libraries.MapService, EntryPoint = "maps_route_maneuver_get_turn_type")] - internal static extern ErrorCode GetTurnType(this RouteManeuverHandle /* maps_route_maneuver_h */ maneuver, out RouteTurnType /* maps_route_turn_type_e */ turnType); - - [DllImport(Libraries.MapService, EntryPoint = "maps_route_maneuver_get_position")] - internal static extern ErrorCode GetPosition(this RouteManeuverHandle /* maps_route_maneuver_h */ maneuver, out IntPtr /* maps_coordinates_h */ position); - - [DllImport(Libraries.MapService, EntryPoint = "maps_route_maneuver_get_road_name")] - internal static extern ErrorCode GetRoadName(this RouteManeuverHandle /* maps_route_maneuver_h */ maneuver, out string roadName); - - [DllImport(Libraries.MapService, EntryPoint = "maps_route_maneuver_get_instruction_text")] - internal static extern ErrorCode GetInstructionText(this RouteManeuverHandle /* maps_route_maneuver_h */ maneuver, out string instructionText); - - [DllImport(Libraries.MapService, EntryPoint = "maps_route_maneuver_get_locale")] - internal static extern ErrorCode GetLocale(this RouteManeuverHandle /* maps_route_maneuver_h */ maneuver, out string locale); - - [DllImport(Libraries.MapService, EntryPoint = "maps_route_maneuver_get_time_to_next_instruction")] - internal static extern ErrorCode GetTimeToNextInstruction(this RouteManeuverHandle /* maps_route_maneuver_h */ maneuver, out int timeToNextInstruction); - - [DllImport(Libraries.MapService, EntryPoint = "maps_route_maneuver_get_distance_to_next_instruction")] - internal static extern ErrorCode GetDistanceToNextInstruction(this RouteManeuverHandle /* maps_route_maneuver_h */ maneuver, out double distanceToNextInstruction); - - internal class RouteManeuverHandle : SafeMapsHandle - { - [DllImport(Libraries.MapService, EntryPoint = "maps_route_maneuver_destroy")] - internal static extern ErrorCode Destroy(IntPtr /* maps_route_maneuver_h */ maneuver); - - [DllImport(Libraries.MapService, EntryPoint = "maps_route_maneuver_clone")] - internal static extern ErrorCode Clone(IntPtr /* maps_route_maneuver_h */ origin, out IntPtr /* maps_route_maneuver_h */ cloned); - - internal string RoadName - { - get { return NativeGet(this.GetRoadName); } - } - - internal string Instruction - { - get { return NativeGet(this.GetInstructionText); } - } - - internal string Locale - { - get { return NativeGet(this.GetLocale); } - } - - internal int TimeToNextInstruction - { - get { return NativeGet(this.GetTimeToNextInstruction); } - } - - internal double DistanceToNextInstruction - { - get { return NativeGet(this.GetDistanceToNextInstruction); } - } - - internal RouteDirection Direction - { - get { return NativeGet(this.GetDirectionId); } - } - - internal RouteTurnType TurnType - { - get { return NativeGet(this.GetTurnType); } - } - - internal CoordinatesHandle Coordinates - { - get { return NativeGet(this.GetPosition, CoordinatesHandle.Create); } - } - - public RouteManeuverHandle(IntPtr handle, bool needToRelease) : base(handle, needToRelease, Destroy) - { - } - - internal static RouteManeuverHandle CloneFrom(IntPtr nativeHandle) - { - IntPtr handle; - Clone(nativeHandle, out handle).ThrowIfFailed("Failed to clone native handle"); - return new RouteManeuverHandle(handle, true); - } - } -} diff --git a/src/Tizen.Maps/Interop/Interop.Route.Segment.cs b/src/Tizen.Maps/Interop/Interop.Route.Segment.cs deleted file mode 100755 index 7aa649390..000000000 --- a/src/Tizen.Maps/Interop/Interop.Route.Segment.cs +++ /dev/null @@ -1,124 +0,0 @@ -/* - * 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 -{ - [DllImport(Libraries.MapService, EntryPoint = "maps_route_segment_get_origin")] - internal static extern ErrorCode GetOrigin(this RouteSegmentHandle /* maps_route_segment_h */ segment, out IntPtr /* maps_coordinates_h */ origin); - - [DllImport(Libraries.MapService, EntryPoint = "maps_route_segment_get_destination")] - internal static extern ErrorCode GetDestination(this RouteSegmentHandle /* maps_route_segment_h */ segment, out IntPtr /* maps_coordinates_h */ destination); - - [DllImport(Libraries.MapService, EntryPoint = "maps_route_segment_get_bounding_box")] - internal static extern ErrorCode GetBoundingBox(this RouteSegmentHandle /* maps_route_segment_h */ segment, out IntPtr /* maps_area_h */ boundingBox); - - [DllImport(Libraries.MapService, EntryPoint = "maps_route_segment_get_distance")] - internal static extern ErrorCode GetDistance(this RouteSegmentHandle /* maps_route_segment_h */ segment, out double distance); - - [DllImport(Libraries.MapService, EntryPoint = "maps_route_segment_get_duration")] - internal static extern ErrorCode GetDuration(this RouteSegmentHandle /* maps_route_segment_h */ segment, out long duration); - - internal class RouteSegmentHandle : SafeMapsHandle - { - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool PathCallback(int index, int total, IntPtr /* maps_coordinates_h */ coordinates, IntPtr /* void */ userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool ManeuverCallback(int index, int total, IntPtr /* maps_route_maneuver_h */ maneuver, IntPtr /* void */ userData); - - [DllImport(Libraries.MapService, EntryPoint = "maps_route_segment_foreach_path")] - internal static extern ErrorCode ForeachPath(IntPtr /* maps_route_segment_h */ segment, PathCallback callback, IntPtr /* void */ userData); - - [DllImport(Libraries.MapService, EntryPoint = "maps_route_segment_foreach_maneuver")] - internal static extern ErrorCode ForeachManeuver(IntPtr /* maps_route_segment_h */ segment, ManeuverCallback callback, IntPtr /* void */ userData); - - - [DllImport(Libraries.MapService, EntryPoint = "maps_route_segment_destroy")] - internal static extern ErrorCode Destroy(IntPtr /* maps_route_segment_h */ segment); - - [DllImport(Libraries.MapService, EntryPoint = "maps_route_segment_clone")] - internal static extern ErrorCode Clone(IntPtr /* maps_route_segment_h */ origin, out IntPtr /* maps_route_segment_h */ cloned); - - internal double Distance - { - get { return NativeGet(this.GetDistance); } - } - - internal long Duration - { - get { return NativeGet(this.GetDuration); } - } - - internal CoordinatesHandle Origin - { - get { return NativeGet(this.GetOrigin, CoordinatesHandle.Create); } - } - - internal CoordinatesHandle Destination - { - get { return NativeGet(this.GetDestination, CoordinatesHandle.Create); } - } - - internal AreaHandle BoundingBox - { - get { return NativeGet(this.GetBoundingBox, AreaHandle.Create); } - } - - public RouteSegmentHandle(IntPtr handle, bool needToRelease) : base(handle, needToRelease, Destroy) - { - } - - internal static RouteSegmentHandle CloneFrom(IntPtr nativeHandle) - { - IntPtr handle; - Clone(nativeHandle, out handle).ThrowIfFailed("Failed to clone native handle"); - return new RouteSegmentHandle(handle, true); - } - - internal void ForeachPath(Action action) - { - PathCallback callback = (index, total, nativeHandle, userData) => - { - if (handle != IntPtr.Zero) - { - action(CoordinatesHandle.CloneFrom(nativeHandle)); - //Destroy(nativeHandle); - } - return true; - }; - - ForeachPath(handle, callback, IntPtr.Zero).WarnIfFailed("Failed to get path coordinates list from native handle"); - } - - internal void ForeachManeuver(Action action) - { - ManeuverCallback callback = (index, total, nativeHandle, userData) => - { - if (handle != IntPtr.Zero) - { - action(RouteManeuverHandle.CloneFrom(nativeHandle)); - //Destroy(nativeHandle); - } - return true; - }; - - ForeachManeuver(handle, callback, IntPtr.Zero).WarnIfFailed("Failed to get segment list from native handle"); - } - } -} diff --git a/src/Tizen.Maps/Interop/Interop.Route.cs b/src/Tizen.Maps/Interop/Interop.Route.cs deleted file mode 100755 index 52eac7d55..000000000 --- a/src/Tizen.Maps/Interop/Interop.Route.cs +++ /dev/null @@ -1,154 +0,0 @@ -/* - * 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 -{ - [DllImport(Libraries.MapService, EntryPoint = "maps_route_get_route_id")] - internal static extern ErrorCode GetRouteId(this RouteHandle /* maps_route_h */ route, out string routeId); - - [DllImport(Libraries.MapService, EntryPoint = "maps_route_get_origin")] - internal static extern ErrorCode GetOrigin(this RouteHandle /* maps_route_h */ route, out IntPtr /* maps_coordinates_h */ origin); - - [DllImport(Libraries.MapService, EntryPoint = "maps_route_get_destination")] - internal static extern ErrorCode GetDestination(this RouteHandle /* maps_route_h */ route, out IntPtr /* maps_coordinates_h */ destination); - - [DllImport(Libraries.MapService, EntryPoint = "maps_route_get_bounding_box")] - internal static extern ErrorCode GetBoundingBox(this RouteHandle /* maps_route_h */ route, out IntPtr /* maps_area_h */ boundingBox); - - [DllImport(Libraries.MapService, EntryPoint = "maps_route_get_transport_mode")] - internal static extern ErrorCode GetTransportMode(this RouteHandle /* maps_route_h */ route, out RouteTransportMode /* maps_route_transport_mode_e */ transportMode); - - [DllImport(Libraries.MapService, EntryPoint = "maps_route_get_total_distance")] - internal static extern ErrorCode GetTotalDistance(this RouteHandle /* maps_route_h */ route, out double totalDistance); - - [DllImport(Libraries.MapService, EntryPoint = "maps_route_get_total_duration")] - internal static extern ErrorCode GetTotalDuration(this RouteHandle /* maps_route_h */ route, out long totalDuration); - - [DllImport(Libraries.MapService, EntryPoint = "maps_route_get_distance_unit")] - internal static extern ErrorCode GetDistanceUnit(this RouteHandle /* maps_route_h */ route, out DistanceUnit /* maps_distance_unit_e */ distanceUnit); - - internal class RouteHandle : SafeMapsHandle - { - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool PropertiesCallback(int index, int total, string key, string /* void */ value, IntPtr /* void */ userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool PathCallback(int index, int total, IntPtr /* maps_coordinates_h */ coordinates, IntPtr /* void */ userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool SegmentCallback(int index, int total, IntPtr /* maps_route_segment_h */ segment, IntPtr /* void */ userData); - - [DllImport(Libraries.MapService, EntryPoint = "maps_route_foreach_property")] - internal static extern ErrorCode ForeachProperty(IntPtr /* maps_route_h */ route, PropertiesCallback callback, IntPtr /* void */ userData); - - [DllImport(Libraries.MapService, EntryPoint = "maps_route_foreach_path")] - internal static extern ErrorCode ForeachPath(IntPtr /* maps_route_h */ route, PathCallback callback, IntPtr /* void */ userData); - - [DllImport(Libraries.MapService, EntryPoint = "maps_route_foreach_segment")] - internal static extern ErrorCode ForeachSegment(IntPtr /* maps_route_h */ route, SegmentCallback callback, IntPtr /* void */ userData); - - [DllImport(Libraries.MapService, EntryPoint = "maps_route_destroy")] - internal static extern ErrorCode Destroy(IntPtr /* maps_route_h */ route); - - internal string Id - { - get { return NativeGet(this.GetRouteId); } - } - - internal double Distance - { - get { return NativeGet(this.GetTotalDistance); } - } - - internal long Duration - { - get { return NativeGet(this.GetTotalDuration); } - } - - internal DistanceUnit Unit - { - get { return NativeGet(this.GetDistanceUnit); } - } - - internal RouteTransportMode TransportMode - { - get { return NativeGet(this.GetTransportMode); } - } - - internal CoordinatesHandle Origin - { - get { return NativeGet(this.GetOrigin, CoordinatesHandle.Create); } - } - - internal CoordinatesHandle Destination - { - get { return NativeGet(this.GetDestination, CoordinatesHandle.Create); } - } - - internal AreaHandle BoundingBox - { - get { return NativeGet(this.GetBoundingBox, AreaHandle.Create); } - } - - public RouteHandle(IntPtr handle, bool needToRelease) : base(handle, needToRelease, Destroy) - { - } - - internal void ForeachProperty(Action action) - { - PropertiesCallback callback = (index, total, key, value, userData) => - { - action(key, value); - return true; - }; - - ForeachProperty(handle, callback, IntPtr.Zero).WarnIfFailed("Failed to get property list from native handle"); - } - - internal void ForeachPath(Action action) - { - PathCallback callback = (index, total, nativeHandle, userData) => - { - if (handle != IntPtr.Zero) - { - action(CoordinatesHandle.CloneFrom(nativeHandle)); - //Destroy(nativeHandle); - } - return true; - }; - - ForeachPath(handle, callback, IntPtr.Zero).WarnIfFailed("Failed to get path coordinates list from native handle"); - } - - internal void ForeachSegment(Action action) - { - SegmentCallback callback = (index, total, nativeHandle, userData) => - { - if (handle != IntPtr.Zero) - { - action(RouteSegmentHandle.CloneFrom(nativeHandle)); - //Destroy(nativeHandle); - } - return true; - }; - - ForeachSegment(handle, callback, IntPtr.Zero).WarnIfFailed("Failed to get segment list from native handle"); - } - } -} diff --git a/src/Tizen.Maps/Interop/Interop.SafeMapsHandle.cs b/src/Tizen.Maps/Interop/Interop.SafeMapsHandle.cs deleted file mode 100755 index 6f915cc74..000000000 --- a/src/Tizen.Maps/Interop/Interop.SafeMapsHandle.cs +++ /dev/null @@ -1,103 +0,0 @@ -/* - * 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.CompilerServices; -using System.Runtime.InteropServices; - - -internal static partial class Interop -{ - private const string LogTag = "Tizen.Maps"; - - public delegate ErrorCode GetterMethod(out T value); - public delegate ErrorCode GetterPtrMethod(out IntPtr value); - public delegate ErrorCode SetterMethod(T value); - - internal static T NativeGet(GetterMethod getter, [CallerMemberName] string propertyName = "") - { - T value; - var err = getter(out value); - if (err.IsSuccess()) - { - return value; - } - - //err.WarnIfFailed($"Native getter for {propertyName} failed"); - return default(T); - } - - internal static T NativeGet(GetterMethod getter, Func ctor, [CallerMemberName] string propertyName = "") where T : SafeMapsHandle - { - return ctor(NativeGet(getter, propertyName)); - } - - internal static T NativeGet(GetterMethod getter, Func ctor, bool hasOwnership, [CallerMemberName] string propertyName = "") where T : SafeMapsHandle - { - return ctor(NativeGet(getter, propertyName), hasOwnership); - } - - internal static string NativeGet(GetterMethod getter, [CallerMemberName] string propertyName = "") - { - string value; - var err = getter(out value); - if (err.IsSuccess()) - { - return value; - } - - //err.WarnIfFailed($"Native getter for {propertyName} failed"); - return string.Empty; - } - - internal static void NativeSet(SetterMethod setter, T value, [CallerMemberName] string propertyName = "") - { - setter(value).WarnIfFailed($"Native setter for {propertyName} failed"); - } - - internal abstract class SafeMapsHandle : SafeHandle - { - protected delegate ErrorCode DestroyNativeHandleMethod(IntPtr handle); - protected DestroyNativeHandleMethod DestroyHandle; - - protected SafeMapsHandle(IntPtr handle, bool needToRelease, DestroyNativeHandleMethod destroy) : base(handle, true) - { - HasOwnership = needToRelease; - DestroyHandle = destroy; - } - - internal bool HasOwnership { get; set; } - - public override bool IsInvalid { get { return handle == IntPtr.Zero; } } - - protected override bool ReleaseHandle() - { - if (HasOwnership) - { - var err = DestroyHandle(handle); - err.WarnIfFailed($"Failed to delete native {GetType()} handle"); - } - - SetHandle(IntPtr.Zero); - return true; - } - - public static implicit operator IntPtr(SafeMapsHandle otherHandle) - { - return otherHandle.handle; - } - } -} diff --git a/src/Tizen.Maps/Interop/Interop.Service.cs b/src/Tizen.Maps/Interop/Interop.Service.cs deleted file mode 100755 index 021b4b4a8..000000000 --- a/src/Tizen.Maps/Interop/Interop.Service.cs +++ /dev/null @@ -1,202 +0,0 @@ -/* - * 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 enum ServiceType - { - Geocode, // MAPS_SERVICE_GEOCODE - GeocodeInsideArea, // MAPS_SERVICE_GEOCODE_INSIDE_AREA - GeocodeByStructuredAddress, // MAPS_SERVICE_GEOCODE_BY_STRUCTURED_ADDRESS - ReverseGeocode, // MAPS_SERVICE_REVERSE_GEOCODE - SearchPlace, // MAPS_SERVICE_SEARCH_PLACE - SearchPlaceByArea, // MAPS_SERVICE_SEARCH_PLACE_BY_AREA - SearchPlaceByAddress, // MAPS_SERVICE_SEARCH_PLACE_BY_ADDRESS - SearchRoute, // MAPS_SERVICE_SEARCH_ROUTE - SearchRouteWaypoints, // MAPS_SERVICE_SEARCH_ROUTE_WAYPOINTS - CancelRequest, // MAPS_SERVICE_CANCEL_REQUEST - MultiReverseGeocode, // MAPS_SERVICE_MULTI_REVERSE_GEOCODE - SearchPlaceList, // MAPS_SERVICE_SEARCH_PLACE_LIST - SearchGetPlaceDetails, // MAPS_SERVICE_SEARCH_GET_PLACE_DETAILS - View = 0x100, // MAPS_SERVICE_VIEW - ViewSnapshot, // MAPS_SERVICE_VIEW_SNAPSHOT - } - - internal enum ServiceData - { - PlaceAddress, // MAPS_PLACE_ADDRESS - PlaceRating, // MAPS_PLACE_RATING - PlaceCategories, // MAPS_PLACE_CATEGORIES - PlaceAttributes, // MAPS_PLACE_ATTRIBUTES - PlaceContacts, // MAPS_PLACE_CONTACTS - PlaceEditorials, // MAPS_PLACE_EDITORIALS - PlaceReviews, // MAPS_PLACE_REVIEWS - PlaceImage, // MAPS_PLACE_IMAGE - PlaceSupplier, // MAPS_PLACE_SUPPLIER - PlaceRelated, // MAPS_PLACE_RELATED - RoutePath, // MAPS_ROUTE_PATH - RouteSegmentsPath, // MAPS_ROUTE_SEGMENTS_PATH - RouteSegmentsManeuvers, // MAPS_ROUTE_SEGMENTS_MANEUVERS - ViewTraffic = 0x100, // MAPS_VIEW_TRAFFIC - ViewPublicTransit, // MAPS_VIEW_PUBLIC_TRANSIT - ViewBuilding, // MAPS_VIEW_BUILDING - ViewScaleBar, // MAPS_VIEW_SCALEBAR - } - - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool GeocodeCallback(ErrorCode /* maps_error_e */ result, int requestId, int index, int total, IntPtr /* maps_coordinates_h */ coordinates, IntPtr /* void */ userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void ReverseGeocodeCallback(ErrorCode /* maps_error_e */ result, int requestId, int index, int total, IntPtr /* maps_address_h */ address, IntPtr /* void */ userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool MultiReverseGeocodeCallback(ErrorCode /* maps_error_e */ result, int requestId, int total, IntPtr /* maps_address_list_h */ addressList, IntPtr /* void */ userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool SearchPlaceCallback(ErrorCode /* maps_error_e */ error, int requestId, int index, int total, IntPtr /* maps_place_h */ place, IntPtr /* void */ userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void SearchPlaceListCallback(ErrorCode /* maps_error_e */ error, int requestId, int total, IntPtr /* maps_place_list_h */ placeList, IntPtr /* void */ userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void GetPlaceDetailsCallback(ErrorCode /* maps_error_e */ error, int requestId, IntPtr /* maps_place_h */ place, IntPtr /* void */ userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool SearchRouteCallback(ErrorCode /* maps_error_e */ error, int requestId, int index, int total, IntPtr /* maps_route_h */ route, IntPtr /* void */ userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void RequestUserConsentwithHandleCallback(bool consented, IntPtr /* void */ userData); - - - [DllImport(Libraries.MapService, EntryPoint = "maps_service_cancel_request")] - internal static extern ErrorCode CancelRequest(this ServiceHandle /* maps_service_h */ maps, int requestId); - - [DllImport(Libraries.MapService, EntryPoint = "maps_service_geocode")] - internal static extern ErrorCode Geocode(this ServiceHandle /* maps_service_h */ maps, string address, PreferenceHandle /* maps_preference_h */ preference, GeocodeCallback callback, IntPtr /* void */ userData, out int requestId); - - [DllImport(Libraries.MapService, EntryPoint = "maps_service_geocode_inside_area")] - internal static extern ErrorCode GeocodeInsideArea(this ServiceHandle /* maps_service_h */ maps, string address, AreaHandle /* maps_area_h */ bounds, PreferenceHandle /* maps_preference_h */ preference, GeocodeCallback callback, IntPtr /* void */ userData, out int requestId); - - [DllImport(Libraries.MapService, EntryPoint = "maps_service_geocode_by_structured_address")] - internal static extern ErrorCode GeocodeByStructuredAddress(this ServiceHandle /* maps_service_h */ maps, AddressHandle /* maps_address_h */ address, PreferenceHandle /* maps_preference_h */ preference, GeocodeCallback callback, IntPtr /* void */ userData, out int requestId); - - [DllImport(Libraries.MapService, EntryPoint = "maps_service_reverse_geocode")] - internal static extern ErrorCode ReverseGeocode(this ServiceHandle /* maps_service_h */ maps, double latitude, double longitude, PreferenceHandle /* maps_preference_h */ preference, ReverseGeocodeCallback callback, IntPtr /* void */ userData, out int requestId); - - [DllImport(Libraries.MapService, EntryPoint = "maps_service_multi_reverse_geocode")] - internal static extern ErrorCode MultiReverseGeocode(this ServiceHandle /* maps_service_h */ maps, CoordinatesListHandle /* maps_coordinates_list_h */ coordinatesList, PreferenceHandle /* maps_preference_h */ preference, MultiReverseGeocodeCallback callback, IntPtr /* void */ userData, out int requestId); - - [DllImport(Libraries.MapService, EntryPoint = "maps_service_search_place")] - internal static extern ErrorCode SearchPlace(this ServiceHandle /* maps_service_h */ maps, CoordinatesHandle /* maps_coordinates_h */ position, int distance, PlaceFilterHandle /* maps_place_filter_h */ filter, PreferenceHandle /* maps_preference_h */ preference, SearchPlaceCallback callback, IntPtr /* void */ userData, out int requestId); - - [DllImport(Libraries.MapService, EntryPoint = "maps_service_search_place_by_area")] - internal static extern ErrorCode SearchPlaceByArea(this ServiceHandle /* maps_service_h */ maps, AreaHandle /* maps_area_h */ boundary, PlaceFilterHandle /* maps_place_filter_h */ filter, PreferenceHandle /* maps_preference_h */ preference, SearchPlaceCallback callback, IntPtr /* void */ userData, out int requestId); - - [DllImport(Libraries.MapService, EntryPoint = "maps_service_search_place_by_address")] - internal static extern ErrorCode SearchPlaceByAddress(this ServiceHandle /* maps_service_h */ maps, string address, AreaHandle /* maps_area_h */ boundary, PlaceFilterHandle /* maps_place_filter_h */ filter, PreferenceHandle /* maps_preference_h */ preference, SearchPlaceCallback callback, IntPtr /* void */ userData, out int requestId); - - [DllImport(Libraries.MapService, EntryPoint = "maps_service_search_place_list")] - internal static extern ErrorCode SearchPlaceList(this ServiceHandle /* maps_service_h */ maps, AreaHandle /* maps_area_h */ boundary, PlaceFilterHandle /* maps_place_filter_h */ filter, PreferenceHandle /* maps_preference_h */ preference, SearchPlaceListCallback callback, IntPtr /* void */ userData, out int requestId); - - [DllImport(Libraries.MapService, EntryPoint = "maps_service_get_place_details")] - internal static extern ErrorCode GetPlaceDetails(this ServiceHandle /* maps_service_h */ maps, string uri, GetPlaceDetailsCallback callback, IntPtr /* void */ userData, out int requestId); - - [DllImport(Libraries.MapService, EntryPoint = "maps_service_search_route")] - internal static extern ErrorCode SearchRoute(this ServiceHandle /* maps_service_h */ maps, CoordinatesHandle /* maps_coordinates_h */ origin, CoordinatesHandle /* maps_coordinates_h */ destination, PreferenceHandle /* maps_preference_h */ preference, SearchRouteCallback callback, IntPtr /* void */ userData, out int requestId); - - [DllImport(Libraries.MapService, EntryPoint = "maps_service_search_route_waypoints")] - internal static extern ErrorCode SearchRouteWaypoints(this ServiceHandle /* maps_service_h */ maps, [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 2)] [In] IntPtr[] /* maps_coordinates_h */ waypointList, int waypointNum, PreferenceHandle /* maps_preference_h */ preference, SearchRouteCallback callback, IntPtr /* void */ userData, out int requestId); - - [DllImport(Libraries.MapService, EntryPoint = "maps_service_get_user_consent")] - internal static extern ErrorCode GetUserConsent(this ServiceHandle /* maps_service_h */ maps, out bool consent); - - [DllImport(Libraries.MapService, EntryPoint = "maps_service_set_provider_key")] - internal static extern ErrorCode SetProviderKey(this ServiceHandle /* maps_service_h */ maps, string providerKey); - - [DllImport(Libraries.MapService, EntryPoint = "maps_service_get_provider_key")] - internal static extern ErrorCode GetProviderKey(this ServiceHandle /* maps_service_h */ maps, out string providerKey); - - [DllImport(Libraries.MapService, EntryPoint = "maps_service_set_preference")] - internal static extern ErrorCode SetPreference(this ServiceHandle /* maps_service_h */ maps, PreferenceHandle /* maps_preference_h */ preference); - - [DllImport(Libraries.MapService, EntryPoint = "maps_service_get_preference")] - internal static extern ErrorCode GetPreference(this ServiceHandle /* maps_service_h */ maps, out IntPtr /* maps_preference_h */ preference); - - [DllImport(Libraries.MapService, EntryPoint = "maps_service_provider_is_service_supported")] - internal static extern ErrorCode IsServiceSupported(this ServiceHandle /* maps_service_h */ maps, ServiceType /* maps_service_e */ service, out bool supported); - - [DllImport(Libraries.MapService, EntryPoint = "maps_service_provider_is_data_supported")] - internal static extern ErrorCode IsDataSupported(this ServiceHandle /* maps_service_h */ maps, ServiceData /* maps_service_data_e */ data, out bool supported); - - [DllImport(Libraries.MapService, EntryPoint = "maps_service_request_user_consent_with_handle")] - internal static extern ErrorCode RequestUserConsent(this ServiceHandle /* maps_service_h */ maps, RequestUserConsentwithHandleCallback callback, IntPtr /* void */ userData); - - internal class ServiceHandle : SafeMapsHandle - { - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool ProviderInfoCallback(string mapsProvider, IntPtr /* void */ userData); - - [DllImport(Libraries.MapService, EntryPoint = "maps_service_foreach_provider")] - internal static extern ErrorCode ForeachProvider(ProviderInfoCallback callback, IntPtr /* void */ userData); - - [DllImport(Libraries.MapService, EntryPoint = "maps_service_create_without_user_consent")] - internal static extern ErrorCode Create(string provider, out IntPtr /* maps_service_h */ maps); - - [DllImport(Libraries.MapService, EntryPoint = "maps_service_destroy")] - internal static extern ErrorCode Destroy(IntPtr /* maps_service_h */ maps); - - internal bool UserConsented - { - get { return NativeGet(this.GetUserConsent); } - } - - internal string ProviderKey - { - get { return NativeGet(this.GetProviderKey); } - set { NativeSet(this.SetProviderKey, value); } - } - - internal PreferenceHandle Preferences - { - get { return NativeGet(this.GetPreference, PreferenceHandle.Create); } - set { NativeSet(this.SetPreference, value); } - } - - public ServiceHandle(IntPtr handle, bool needToRelease) : base(handle, needToRelease, Destroy) - { - } - - public ServiceHandle(string serviceProvider) : this(IntPtr.Zero, true) - { - Create(serviceProvider, out handle).ThrowIfFailed($"Failed to create native handle for {serviceProvider}"); - } - - internal static void ForeachProvider(Action action) - { - ProviderInfoCallback callback = (provider, userData) => - { - action(provider); - return true; - }; - - ForeachProvider(callback, IntPtr.Zero).WarnIfFailed("Failed to get provider list from native handle"); - } - } -} diff --git a/src/Tizen.Maps/Interop/Interop.View.Event.Data.cs b/src/Tizen.Maps/Interop/Interop.View.Event.Data.cs deleted file mode 100755 index dd5fd6ad7..000000000 --- a/src/Tizen.Maps/Interop/Interop.View.Event.Data.cs +++ /dev/null @@ -1,179 +0,0 @@ -/* - * 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; -using ElmSharp; - -internal static partial class Interop -{ - internal enum ViewAction - { - None, // MAPS_VIEW_ACTION_NONE - Scroll, // MAPS_VIEW_ACTION_SCROLL - Zoom, // MAPS_VIEW_ACTION_ZOOM - ZoomIn, // MAPS_VIEW_ACTION_ZOOM_IN - ZoomOut, // MAPS_VIEW_ACTION_ZOOM_OUT - ZoomAndScroll, // MAPS_VIEW_ACTION_ZOOM_AND_SCROLL - Rotate, // MAPS_VIEW_ACTION_ROTATE - } - - internal enum ViewGesture - { - None, // MAPS_VIEW_GESTURE_NONE - Scroll, // MAPS_VIEW_GESTURE_SCROLL - Zoom, // MAPS_VIEW_GESTURE_ZOOM - Click, // MAPS_VIEW_GESTURE_TAP - DoubleClick, // MAPS_VIEW_GESTURE_DOUBLE_TAP - TwoFingerClick, // MAPS_VIEW_GESTURE_2_FINGER_TAP - Rotation, // MAPS_VIEW_GESTURE_ROTATE - LongPress, // MAPS_VIEW_GESTURE_LONG_PRESS - } - - internal enum ViewEventType - { - Gesture, // MAPS_VIEW_EVENT_GESTURE - Action, // MAPS_VIEW_EVENT_ACTION - Object, // MAPS_VIEW_EVENT_OBJECT - Ready, // MAPS_VIEW_EVENT_READY - } - - internal static partial class ViewEventData - { - [DllImport(Libraries.MapService, EntryPoint = "maps_view_event_data_clone")] - internal static extern ErrorCode Clone(IntPtr /* maps_view_event_data_h */ origin, out IntPtr /* maps_view_event_data_h */ cloned); - - [DllImport(Libraries.MapService, EntryPoint = "maps_view_event_data_get_center")] - internal static extern ErrorCode GetCenter(IntPtr /* maps_view_event_data_h */ viewEvent, out IntPtr /* maps_coordinates_h */ center); - - [DllImport(Libraries.MapService, EntryPoint = "maps_view_event_data_get_delta")] - internal static extern ErrorCode GetDelta(IntPtr /* maps_view_event_data_h */ viewEvent, out int deltaX, out int deltaY); - } - - [DllImport(Libraries.MapService, EntryPoint = "maps_view_event_data_get_type")] - internal static extern ErrorCode GetType(this EventDataHandle /* maps_view_event_data_h */ viewEvent, out ViewEventType /* maps_view_event_type_e */ eventType); - - [DllImport(Libraries.MapService, EntryPoint = "maps_view_event_data_get_gesture_type")] - internal static extern ErrorCode GetGestureType(this EventDataHandle /* maps_view_event_data_h */ viewEvent, out ViewGesture /* maps_view_gesture_e */ gestureType); - - [DllImport(Libraries.MapService, EntryPoint = "maps_view_event_data_get_action_type")] - internal static extern ErrorCode GetActionType(this EventDataHandle /* maps_view_event_data_h */ viewEvent, out ViewAction /* maps_view_action_e */ actionType); - - [DllImport(Libraries.MapService, EntryPoint = "maps_view_event_data_get_position")] - internal static extern ErrorCode GetPosition(this EventDataHandle /* maps_view_event_data_h */ viewEvent, out int x, out int y); - - [DllImport(Libraries.MapService, EntryPoint = "maps_view_event_data_get_fingers")] - internal static extern ErrorCode GetFingers(this EventDataHandle /* maps_view_event_data_h */ viewEvent, out int fingers); - - [DllImport(Libraries.MapService, EntryPoint = "maps_view_event_data_get_object")] - internal static extern ErrorCode GetObject(this EventDataHandle /* maps_view_event_data_h */ viewEvent, out IntPtr /* maps_view_object_h */ viewEventDataObject); - - [DllImport(Libraries.MapService, EntryPoint = "maps_view_event_data_get_coordinates")] - internal static extern ErrorCode GetCoordinates(this EventDataHandle /* maps_view_event_data_h */ viewEvent, out IntPtr /* maps_coordinates_h */ coordinates); - - [DllImport(Libraries.MapService, EntryPoint = "maps_view_event_data_get_zoom_factor")] - internal static extern ErrorCode GetZoomFactor(this EventDataHandle /* maps_view_event_data_h */ viewEvent, out double zoomFactor); - - [DllImport(Libraries.MapService, EntryPoint = "maps_view_event_data_get_rotation_angle")] - internal static extern ErrorCode GetRotationAngle(this EventDataHandle /* maps_view_event_data_h */ viewEvent, out double rotationAngle); - - internal static ErrorCode GetPosition(this EventDataHandle /* maps_view_event_data_h */ viewEvent, out Point position) - { - position = new Point(); - return GetPosition(viewEvent, out position.X, out position.Y); - } - - internal class EventDataHandle : SafeMapsHandle - { - [DllImport(Libraries.MapService, EntryPoint = "maps_view_event_data_destroy")] - internal static extern ErrorCode Destroy(IntPtr /* maps_view_event_data_h */ viewEvent); - - internal ViewEventType Type - { - get { return NativeGet(this.GetType); } - } - - // event_data will be released automatically after this callback is terminated. - internal EventDataHandle(IntPtr handle) : base(handle, false, Destroy) - { - } - } - - internal class ObjectEventDataHandle : EventDataHandle - { - internal ViewGesture GestureType - { - get { return NativeGet(this.GetGestureType); } - } - - internal Point Position - { - get { return NativeGet(this.GetPosition); } - } - - internal int FingerCount - { - get { return NativeGet(this.GetFingers); } - } - - internal ViewObjectHandle ViewObject - { - get { return NativeGet(this.GetObject, ViewObjectHandle.Create, false ); } - } - - // event_data will be released automatically after this callback is terminated. - internal ObjectEventDataHandle(IntPtr handle) : base(handle) - { - } - } - - internal class GestureEventDataHandle : EventDataHandle - { - internal ViewGesture GestureType - { - get { return NativeGet(this.GetGestureType); } - } - - internal Point Position - { - get { return NativeGet(this.GetPosition); } - } - - internal int FingerCount - { - get { return NativeGet(this.GetFingers); } - } - - internal double ZoomFactor - { - get { return NativeGet(this.GetZoomFactor); } - } - - internal double RotationAngle - { - get { return NativeGet(this.GetRotationAngle); } - } - - internal CoordinatesHandle Coordinates - { - get { return NativeGet(this.GetCoordinates, CoordinatesHandle.Create); } - } - - internal GestureEventDataHandle(IntPtr handle) : base(handle) - { - } - } -} diff --git a/src/Tizen.Maps/Interop/Interop.View.Marker.cs b/src/Tizen.Maps/Interop/Interop.View.Marker.cs deleted file mode 100755 index f92ef87d7..000000000 --- a/src/Tizen.Maps/Interop/Interop.View.Marker.cs +++ /dev/null @@ -1,102 +0,0 @@ -/* - * 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; -using ElmSharp; - -internal static partial class Interop -{ - [DllImport(Libraries.MapService, EntryPoint = "maps_view_object_marker_get_type")] - internal static extern ErrorCode GetType(this MarkerHandle /* maps_view_object_h */ marker, out ViewMarkerType /* maps_view_marker_type_e */ type); - - [DllImport(Libraries.MapService, EntryPoint = "maps_view_object_marker_get_coordinates")] - internal static extern ErrorCode GetCoordinates(this MarkerHandle /* maps_view_object_h */ marker, out IntPtr /* maps_coordinates_h */ coordinates); - - [DllImport(Libraries.MapService, EntryPoint = "maps_view_object_marker_set_coordinates")] - internal static extern ErrorCode SetCoordinates(this MarkerHandle /* maps_view_object_h */ marker, CoordinatesHandle /* maps_coordinates_h */ coordinates); - - [DllImport(Libraries.MapService, EntryPoint = "maps_view_object_marker_get_image_file")] - internal static extern ErrorCode GetImageFile(this MarkerHandle /* maps_view_object_h */ marker, out string filePath); - - [DllImport(Libraries.MapService, EntryPoint = "maps_view_object_marker_set_image_file")] - internal static extern ErrorCode SetImageFile(this MarkerHandle /* maps_view_object_h */ marker, string filePath); - - [DllImport(Libraries.MapService, EntryPoint = "maps_view_object_marker_get_z_order")] - internal static extern ErrorCode GetZOrder(this MarkerHandle /* maps_view_object_h */ marker, out int zOrder); - - [DllImport(Libraries.MapService, EntryPoint = "maps_view_object_marker_set_z_order")] - internal static extern ErrorCode SetZOrder(this MarkerHandle /* maps_view_object_h */ marker, int zOrder); - - [DllImport(Libraries.MapService, EntryPoint = "maps_view_object_marker_get_size")] - internal static extern ErrorCode GetSize(this MarkerHandle /* maps_view_object_h */ marker, out int width, out int height); - - [DllImport(Libraries.MapService, EntryPoint = "maps_view_object_marker_resize")] - internal static extern ErrorCode Resize(this MarkerHandle /* maps_view_object_h */ marker, int width, int height); - - internal static ErrorCode GetSize(this MarkerHandle /* maps_view_object_h */ marker, out Size size) - { - size = new Size(0, 0); - return GetSize(marker, out size.Width, out size.Height); - } - - internal static ErrorCode SetSize(this MarkerHandle /* maps_view_object_h */ marker, Size size) - { - return Resize(marker, size.Width, size.Height); - } - - internal class MarkerHandle : ViewObjectHandle - { - [DllImport(Libraries.MapService, EntryPoint = "maps_view_object_create_marker")] - internal static extern ErrorCode CreateMarker(CoordinatesHandle /* maps_coordinates_h */ coordinates, string imageFilePath, ViewMarkerType /* maps_view_marker_type_e */ type, out IntPtr /* maps_view_object_h */ marker); - - internal ViewMarkerType Type - { - get { return NativeGet(this.GetType); } - } - - internal string ImageFile - { - get { return NativeGet(this.GetImageFile); } - set { NativeSet(this.SetImageFile, value); } - } - - internal int ZOrder - { - get { return NativeGet(this.GetZOrder); } - set { NativeSet(this.SetZOrder, value); } - } - - internal Size MarkerSize - { - get { return NativeGet(this.GetSize); } - set { NativeSet(this.SetSize, value); } - } - - internal CoordinatesHandle Coordinates - { - get { return NativeGet(this.GetCoordinates, CoordinatesHandle.Create); } - set { NativeSet(this.SetCoordinates, value); } - } - - internal MarkerHandle(CoordinatesHandle coordinates, string imagePath, ViewMarkerType type) : base(IntPtr.Zero, true) - { - var clonedCoordinatesHandle = CoordinatesHandle.CloneFrom(coordinates); - CreateMarker(clonedCoordinatesHandle, imagePath, type, out handle).ThrowIfFailed("Failed to create native handle for marker"); - clonedCoordinatesHandle.HasOwnership = false; - } - } -} diff --git a/src/Tizen.Maps/Interop/Interop.View.Object.cs b/src/Tizen.Maps/Interop/Interop.View.Object.cs deleted file mode 100755 index af2834f3b..000000000 --- a/src/Tizen.Maps/Interop/Interop.View.Object.cs +++ /dev/null @@ -1,73 +0,0 @@ -/* - * 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; -using ElmSharp; - -internal static partial class Interop -{ - internal enum ViewObjectType - { - Polyline, // MAPS_VIEW_OBJECT_POLYLINE - Polygon, // MAPS_VIEW_OBJECT_POLYGON - Marker, // MAPS_VIEW_OBJECT_MARKER - Overlay, // MAPS_VIEW_OBJECT_OVERLAY - } - - internal enum ViewMarkerType - { - Pin, // MAPS_VIEW_MARKER_PIN - Sticker, // MAPS_VIEW_MARKER_STICKER - } - - internal enum ViewOverlayType - { - Normal, // MAPS_VIEW_OVERLAY_NORMAL - Bubble, // MAPS_VIEW_OVERLAY_BUBBLE - Box, // MAPS_VIEW_OVERLAY_BOX - } - - [DllImport(Libraries.MapService, EntryPoint = "maps_view_object_get_type")] - internal static extern ErrorCode GetType(this ViewObjectHandle /* maps_view_object_h */ viewObject, out ViewObjectType /* maps_view_object_type_e */ type); - - [DllImport(Libraries.MapService, EntryPoint = "maps_view_object_set_visible")] - internal static extern ErrorCode SetVisible(this ViewObjectHandle /* maps_view_object_h */ viewObject, bool visible); - - [DllImport(Libraries.MapService, EntryPoint = "maps_view_object_get_visible")] - internal static extern ErrorCode GetVisible(this ViewObjectHandle /* maps_view_object_h */ viewObject, out bool visible); - - internal class ViewObjectHandle : SafeMapsHandle - { - [DllImport(Libraries.MapService, EntryPoint = "maps_view_object_destroy")] - internal static extern ErrorCode Destroy(IntPtr /* maps_view_object_h */ viewObject); - - internal bool IsVisible - { - get { return NativeGet(this.GetVisible); } - set { NativeSet(this.SetVisible, value); } - } - - public ViewObjectHandle(IntPtr handle, bool needToRelease) : base(handle, needToRelease, Destroy) - { - } - - internal static ViewObjectHandle Create(IntPtr nativeHandle, bool needToRelease) - { - return new ViewObjectHandle(nativeHandle, needToRelease); - } - } -} diff --git a/src/Tizen.Maps/Interop/Interop.View.Overlay.cs b/src/Tizen.Maps/Interop/Interop.View.Overlay.cs deleted file mode 100755 index 27ed8b79c..000000000 --- a/src/Tizen.Maps/Interop/Interop.View.Overlay.cs +++ /dev/null @@ -1,72 +0,0 @@ -/* - * 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; -using ElmSharp; - -internal static partial class Interop -{ - [DllImport(Libraries.MapService, EntryPoint = "maps_view_object_overlay_set_coordinates")] - internal static extern ErrorCode SetCoordinates(this OverlayHandle /* maps_view_object_h */ overlay, CoordinatesHandle /* maps_coordinates_h */ coordinates); - - [DllImport(Libraries.MapService, EntryPoint = "maps_view_object_overlay_get_coordinates")] - internal static extern ErrorCode GetCoordinates(this OverlayHandle /* maps_view_object_h */ overlay, out IntPtr /* maps_coordinates_h */ coordinates); - - [DllImport(Libraries.MapService, EntryPoint = "maps_view_object_overlay_set_min_zoom_level")] - internal static extern ErrorCode SetMinZoomLevel(this OverlayHandle /* maps_view_object_h */ overlay, int zoom); - - [DllImport(Libraries.MapService, EntryPoint = "maps_view_object_overlay_get_min_zoom_level")] - internal static extern ErrorCode GetMinZoomLevel(this OverlayHandle /* maps_view_object_h */ overlay, out int zoom); - - [DllImport(Libraries.MapService, EntryPoint = "maps_view_object_overlay_set_max_zoom_level")] - internal static extern ErrorCode SetMaxZoomLevel(this OverlayHandle /* maps_view_object_h */ overlay, int zoom); - - [DllImport(Libraries.MapService, EntryPoint = "maps_view_object_overlay_get_max_zoom_level")] - internal static extern ErrorCode GetMaxZoomLevel(this OverlayHandle /* maps_view_object_h */ overlay, out int zoom); - - internal class OverlayHandle : ViewObjectHandle - { - [DllImport(Libraries.MapService, EntryPoint = "maps_view_object_create_overlay")] - internal static extern ErrorCode CreateOverlay(CoordinatesHandle /* maps_coordinates_h */ coordinates, IntPtr viewObject, ViewOverlayType /* maps_view_overlay_type_e */ type, out IntPtr /* maps_view_object_h */ overlay); - - internal int MinZoomLevel - { - get { return NativeGet(this.GetMinZoomLevel); } - set { NativeSet(this.SetMinZoomLevel, value); } - } - - internal int MaxZoomLevel - { - get { return NativeGet(this.GetMaxZoomLevel); } - set { NativeSet(this.SetMaxZoomLevel, value); } - } - - - internal CoordinatesHandle Coordinates - { - get { return NativeGet(this.GetCoordinates, CoordinatesHandle.Create); } - set { NativeSet(this.SetCoordinates, value); } - } - - internal OverlayHandle(CoordinatesHandle coordinates, EvasObject viewObject, ViewOverlayType type) : base(IntPtr.Zero, true) - { - var clonedCoordinatesHandle = CoordinatesHandle.CloneFrom(coordinates); - CreateOverlay(clonedCoordinatesHandle, viewObject, type, out handle).ThrowIfFailed("Failed to create native overlay handle"); - clonedCoordinatesHandle.HasOwnership = false; - } - } -} diff --git a/src/Tizen.Maps/Interop/Interop.View.Polygon.cs b/src/Tizen.Maps/Interop/Interop.View.Polygon.cs deleted file mode 100755 index 5699b0ea5..000000000 --- a/src/Tizen.Maps/Interop/Interop.View.Polygon.cs +++ /dev/null @@ -1,79 +0,0 @@ -/* - * 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; -using ElmSharp; - -internal static partial class Interop -{ - [DllImport(Libraries.MapService, EntryPoint = "maps_view_object_polygon_set_polygon")] - internal static extern ErrorCode SetPolygon(this PolygonHandle /* maps_view_object_h */ polygon, CoordinatesListHandle /* maps_coordinates_list_h */ points); - - [DllImport(Libraries.MapService, EntryPoint = "maps_view_object_polygon_get_fill_color")] - internal static extern ErrorCode GetFillColor(this PolygonHandle /* maps_view_object_h */ polygon, out byte r, out byte g, out byte b, out byte a); - - [DllImport(Libraries.MapService, EntryPoint = "maps_view_object_polygon_set_fill_color")] - internal static extern ErrorCode SetFillColor(this PolygonHandle /* maps_view_object_h */ polygon, byte r, byte g, byte b, byte a); - - internal static ErrorCode GetFillColor(this PolygonHandle /* maps_view_object_h */ polygon, out Color color) - { - byte r, g, b, a; - var err = polygon.GetFillColor(out r, out g, out b, out a); - color = new Color(r, g, b, a); - return err; - } - - internal static ErrorCode SetFillColor(this PolygonHandle /* maps_view_object_h */ polygon, Color color) - { - return polygon.SetFillColor((byte)color.R, (byte)color.G, (byte)color.B, (byte)color.A); - } - - internal class PolygonHandle : ViewObjectHandle - { - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool CoordinatesCallback(int index, IntPtr /* maps_coordinates_h */ coordinates, IntPtr /* void */ userData); - - [DllImport(Libraries.MapService, EntryPoint = "maps_view_object_polygon_foreach_point")] - internal static extern ErrorCode ForeachPoint(IntPtr /* maps_view_object_h */ polygon, CoordinatesCallback callback, IntPtr /* void */ userData); - - [DllImport(Libraries.MapService, EntryPoint = "maps_view_object_create_polygon")] - internal static extern ErrorCode CreatePolygon(CoordinatesListHandle /* maps_coordinates_list_h */ coordinates, byte r, byte g, byte b, byte a, out IntPtr /* maps_view_object_h */ polygon); - - internal Color FillColor - { - get { return NativeGet(this.GetFillColor); } - set { NativeSet(this.SetFillColor, value); } - } - - internal PolygonHandle(CoordinatesListHandle coordinates, Color color) : base(IntPtr.Zero, true) - { - CreatePolygon(coordinates, (byte)color.R, (byte)color.G, (byte)color.B, (byte)color.A, out handle).ThrowIfFailed("Failed to create native polygon handle"); - coordinates.HasOwnership = false; - } - - internal void ForeachPoint(Action action) - { - CoordinatesCallback callback = (index, handle, userData) => - { - action(CoordinatesHandle.CloneFrom(handle)); - return true; - }; - - ForeachPoint(handle, callback, IntPtr.Zero).WarnIfFailed("Failed to get coordinates list from native handle"); - } - } -} diff --git a/src/Tizen.Maps/Interop/Interop.View.Polyline.cs b/src/Tizen.Maps/Interop/Interop.View.Polyline.cs deleted file mode 100755 index 0ceae65c5..000000000 --- a/src/Tizen.Maps/Interop/Interop.View.Polyline.cs +++ /dev/null @@ -1,91 +0,0 @@ -/* - * 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; -using ElmSharp; - -internal static partial class Interop -{ - [DllImport(Libraries.MapService, EntryPoint = "maps_view_object_polyline_set_polyline")] - internal static extern ErrorCode SetPolyline(this PolylineHandle /* maps_view_object_h */ polyline, CoordinatesListHandle /* maps_coordinates_list_h */ points); - - [DllImport(Libraries.MapService, EntryPoint = "maps_view_object_polyline_set_color")] - internal static extern ErrorCode SetColor(this PolylineHandle /* maps_view_object_h */ polyline, byte r, byte g, byte b, byte a); - - [DllImport(Libraries.MapService, EntryPoint = "maps_view_object_polyline_get_color")] - internal static extern ErrorCode GetColor(this PolylineHandle /* maps_view_object_h */ polyline, out byte r, out byte g, out byte b, out byte a); - - [DllImport(Libraries.MapService, EntryPoint = "maps_view_object_polyline_set_width")] - internal static extern ErrorCode SetWidth(this PolylineHandle /* maps_view_object_h */ polyline, int width); - - [DllImport(Libraries.MapService, EntryPoint = "maps_view_object_polyline_get_width")] - internal static extern ErrorCode GetWidth(this PolylineHandle /* maps_view_object_h */ polyline, out int width); - - internal static ErrorCode GetColor(this PolylineHandle /* maps_view_object_h */ polyline, out Color color) - { - byte r, g, b, a; - var err = polyline.GetColor(out r, out g, out b, out a); - color = new Color(r, g, b, a); - return err; - } - - internal static ErrorCode SetColor(this PolylineHandle /* maps_view_object_h */ polyline, Color color) - { - return polyline.SetColor((byte)color.R, (byte)color.G, (byte)color.B, (byte)color.A); - } - - internal class PolylineHandle : ViewObjectHandle - { - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool CoordinatesCallback(int index, IntPtr /* maps_coordinates_h */ coordinates, IntPtr /* void */ userData); - - [DllImport(Libraries.MapService, EntryPoint = "maps_view_object_create_polyline")] - internal static extern ErrorCode CreatePolyline(CoordinatesListHandle /* maps_coordinates_list_h */ coordinates, byte r, byte g, byte b, byte a, int width, out IntPtr /* maps_view_object_h */ polyline); - - [DllImport(Libraries.MapService, EntryPoint = "maps_view_object_polyline_foreach_point")] - internal static extern ErrorCode ForeachPoint(IntPtr /* maps_view_object_h */ polyline, CoordinatesCallback callback, IntPtr /* void */ userData); - - internal Color LineColor - { - get { return NativeGet(this.GetColor); } - set { NativeSet(this.SetColor, value); } - } - - internal int LineWidth - { - get { return NativeGet(this.GetWidth); } - set { NativeSet(this.SetWidth, value); } - } - - internal PolylineHandle(CoordinatesListHandle coordinates, Color color, int width) : base(IntPtr.Zero, true) - { - CreatePolyline(coordinates, (byte)color.R, (byte)color.G, (byte)color.B, (byte)color.A, width, out handle).ThrowIfFailed("Failed to create native polyline handle"); - coordinates.HasOwnership = false; - } - - internal void ForeachPoint(Action action) - { - CoordinatesCallback callback = (index, handle, userData) => - { - action(CoordinatesHandle.CloneFrom(handle)); - return true; - }; - - ForeachPoint(handle, callback, IntPtr.Zero).WarnIfFailed("Failed to get coordinates list from native handle"); - } - } -} diff --git a/src/Tizen.Maps/Interop/Interop.View.Snapshot.cs b/src/Tizen.Maps/Interop/Interop.View.Snapshot.cs deleted file mode 100755 index d6403c6fb..000000000 --- a/src/Tizen.Maps/Interop/Interop.View.Snapshot.cs +++ /dev/null @@ -1,32 +0,0 @@ -/* - * 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.Runtime.InteropServices; - -internal static partial class Interop -{ - internal enum ViewSnapshotFormatType - { - ViewSnapshotBmp, // MAPS_VIEW_SNAPSHOT_BMP - ViewSnapshotJpeg, // MAPS_VIEW_SNAPSHOT_JPEG - } - - internal static partial class ViewSnapshot - { - [DllImport(Libraries.MapService, EntryPoint = "maps_view_capture_snapshot")] - internal static extern ErrorCode ViewCaptureSnapshot(ViewHandle /* maps_view_h */ view, ViewSnapshotFormatType /* maps_view_snapshot_format_type_e */ type, int quality, string path); - } -} diff --git a/src/Tizen.Maps/Interop/Interop.View.cs b/src/Tizen.Maps/Interop/Interop.View.cs deleted file mode 100755 index c48224a7e..000000000 --- a/src/Tizen.Maps/Interop/Interop.View.cs +++ /dev/null @@ -1,258 +0,0 @@ -/* - * 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; -using ElmSharp; - -internal static partial class Interop -{ - internal enum ViewType - { - Normal, // MAPS_VIEW_TYPE_NORMAL - Satellite, // MAPS_VIEW_TYPE_SATELLITE - Terrain, // MAPS_VIEW_TYPE_TERRAIN - Hybrid, // MAPS_VIEW_TYPE_HYBRID - } - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void ViewOnEventCallback(ViewEventType /* maps_view_event_type_e */ type, IntPtr /* maps_view_event_data_h */ eventData, IntPtr /* void */ userData); - - - [DllImport(Libraries.MapService, EntryPoint = "maps_view_get_zoom_level")] - internal static extern ErrorCode GetZoomLevel(this ViewHandle /* maps_view_h */ view, out int level); - - [DllImport(Libraries.MapService, EntryPoint = "maps_view_set_zoom_level")] - internal static extern ErrorCode SetZoomLevel(this ViewHandle /* maps_view_h */ view, int level); - - [DllImport(Libraries.MapService, EntryPoint = "maps_view_get_min_zoom_level")] - internal static extern ErrorCode GetMinZoomLevel(this ViewHandle /* maps_view_h */ view, out int minZoomLevel); - - [DllImport(Libraries.MapService, EntryPoint = "maps_view_set_min_zoom_level")] - internal static extern ErrorCode SetMinZoomLevel(this ViewHandle /* maps_view_h */ view, int minZoomLevel); - - [DllImport(Libraries.MapService, EntryPoint = "maps_view_get_max_zoom_level")] - internal static extern ErrorCode GetMaxZoomLevel(this ViewHandle /* maps_view_h */ view, out int maxZoomLevel); - - [DllImport(Libraries.MapService, EntryPoint = "maps_view_set_max_zoom_level")] - internal static extern ErrorCode SetMaxZoomLevel(this ViewHandle /* maps_view_h */ view, int maxZoomLevel); - - [DllImport(Libraries.MapService, EntryPoint = "maps_view_get_orientation")] - internal static extern ErrorCode GetOrientation(this ViewHandle /* maps_view_h */ view, out double rotationAngle); - - [DllImport(Libraries.MapService, EntryPoint = "maps_view_set_orientation")] - internal static extern ErrorCode SetOrientation(this ViewHandle /* maps_view_h */ view, double rotationAngle); - - [DllImport(Libraries.MapService, EntryPoint = "maps_view_get_language")] - internal static extern ErrorCode GetLanguage(this ViewHandle /* maps_view_h */ view, out string language); - - [DllImport(Libraries.MapService, EntryPoint = "maps_view_set_language")] - internal static extern ErrorCode SetLanguage(this ViewHandle /* maps_view_h */ view, string language); - - [DllImport(Libraries.MapService, EntryPoint = "maps_view_set_type")] - internal static extern ErrorCode SetMapType(this ViewHandle /* maps_view_h */ view, ViewType /* maps_view_type_e */ type); - - [DllImport(Libraries.MapService, EntryPoint = "maps_view_get_type")] - internal static extern ErrorCode GetMapType(this ViewHandle /* maps_view_h */ view, out ViewType /* maps_view_type_e */ type); - - [DllImport(Libraries.MapService, EntryPoint = "maps_view_get_buildings_enabled")] - internal static extern ErrorCode GetBuildingsEnabled(this ViewHandle /* maps_view_h */ view, out bool enable); - - [DllImport(Libraries.MapService, EntryPoint = "maps_view_set_buildings_enabled")] - internal static extern ErrorCode SetBuildingsEnabled(this ViewHandle /* maps_view_h */ view, bool enable); - - [DllImport(Libraries.MapService, EntryPoint = "maps_view_get_traffic_enabled")] - internal static extern ErrorCode GetTrafficEnabled(this ViewHandle /* maps_view_h */ view, out bool enable); - - [DllImport(Libraries.MapService, EntryPoint = "maps_view_set_traffic_enabled")] - internal static extern ErrorCode SetTrafficEnabled(this ViewHandle /* maps_view_h */ view, bool enable); - - [DllImport(Libraries.MapService, EntryPoint = "maps_view_get_public_transit_enabled")] - internal static extern ErrorCode GetPublicTransitEnabled(this ViewHandle /* maps_view_h */ view, out bool enable); - - [DllImport(Libraries.MapService, EntryPoint = "maps_view_set_public_transit_enabled")] - internal static extern ErrorCode SetPublicTransitEnabled(this ViewHandle /* maps_view_h */ view, bool enable); - - [DllImport(Libraries.MapService, EntryPoint = "maps_view_get_scalebar_enabled")] - internal static extern ErrorCode GetScaleBarEnabled(this ViewHandle /* maps_view_h */ view, out bool enabled); - - [DllImport(Libraries.MapService, EntryPoint = "maps_view_set_scalebar_enabled")] - internal static extern ErrorCode SetScaleBarEnabled(this ViewHandle /* maps_view_h */ view, bool enable); - - [DllImport(Libraries.MapService, EntryPoint = "maps_view_get_screen_location")] - internal static extern ErrorCode GetScreenLocation(this ViewHandle /* maps_view_h */ view, out int x, out int y, out int width, out int height); - - [DllImport(Libraries.MapService, EntryPoint = "maps_view_set_screen_location")] - internal static extern ErrorCode SetScreenLocation(this ViewHandle /* maps_view_h */ view, int x, int y, int width, int height); - - [DllImport(Libraries.MapService, EntryPoint = "maps_view_get_visibility")] - internal static extern ErrorCode GetVisibility(this ViewHandle /* maps_view_h */ view, out bool visible); - - [DllImport(Libraries.MapService, EntryPoint = "maps_view_set_visibility")] - internal static extern ErrorCode SetVisibility(this ViewHandle /* maps_view_h */ view, bool visible); - - [DllImport(Libraries.MapService, EntryPoint = "maps_view_get_viewport")] - internal static extern ErrorCode GetViewport(this ViewHandle /* maps_view_h */ view, out IntPtr viewport); - - [DllImport(Libraries.MapService, EntryPoint = "maps_view_get_center")] - internal static extern ErrorCode GetCenter(this ViewHandle /* maps_view_h */ view, out IntPtr /* maps_coordinates_h */ coordinates); - - [DllImport(Libraries.MapService, EntryPoint = "maps_view_set_center")] - internal static extern ErrorCode SetCenter(this ViewHandle /* maps_view_h */ view, CoordinatesHandle /* maps_coordinates_h */ coordinates); - - - [DllImport(Libraries.MapService, EntryPoint = "maps_view_get_gesture_enabled")] - internal static extern ErrorCode GetGestureEnabled(this ViewHandle /* maps_view_h */ view, ViewGesture /* maps_view_gesture_e */ gesture, out bool enabled); - - [DllImport(Libraries.MapService, EntryPoint = "maps_view_set_gesture_enabled")] - internal static extern ErrorCode SetGestureEnabled(this ViewHandle /* maps_view_h */ view, ViewGesture /* maps_view_gesture_e */ gesture, bool enabled); - - [DllImport(Libraries.MapService, EntryPoint = "maps_view_set_event_cb")] - internal static extern ErrorCode SetEventCb(this ViewHandle /* maps_view_h */ view, ViewEventType /* maps_view_event_type_e */ type, ViewOnEventCallback callback, IntPtr /* void */ userData); - - [DllImport(Libraries.MapService, EntryPoint = "maps_view_unset_event_cb")] - internal static extern ErrorCode UnsetEventCb(this ViewHandle /* maps_view_h */ view, ViewEventType /* maps_view_event_type_e */ type); - - [DllImport(Libraries.MapService, EntryPoint = "maps_view_screen_to_geolocation")] - internal static extern ErrorCode ScreenToGeolocation(this ViewHandle /* maps_view_h */ view, int x, int y, out IntPtr /* maps_coordinates_h */ coordinates); - - [DllImport(Libraries.MapService, EntryPoint = "maps_view_geolocation_to_screen")] - internal static extern ErrorCode GeolocationToScreen(this ViewHandle /* maps_view_h */ view, CoordinatesHandle /* maps_coordinates_h */ coordinates, out int x, out int y); - - [DllImport(Libraries.MapService, EntryPoint = "maps_view_move")] - internal static extern ErrorCode Move(this ViewHandle /* maps_view_h */ view, int x, int y); - - [DllImport(Libraries.MapService, EntryPoint = "maps_view_resize")] - internal static extern ErrorCode Resize(this ViewHandle /* maps_view_h */ view, int width, int height); - - [DllImport(Libraries.MapService, EntryPoint = "maps_view_add_object")] - internal static extern ErrorCode AddObject(this ViewHandle /* maps_view_h */ view, ViewObjectHandle /* maps_view_object_h */ viewObject); - - [DllImport(Libraries.MapService, EntryPoint = "maps_view_remove_object")] - internal static extern ErrorCode RemoveObject(this ViewHandle /* maps_view_h */ view, ViewObjectHandle /* maps_view_object_h */ viewObject); - - [DllImport(Libraries.MapService, EntryPoint = "maps_view_remove_all_objects")] - internal static extern ErrorCode RemoveAllObjects(this ViewHandle /* maps_view_h */ view); - - internal class ViewHandle : SafeMapsHandle - { - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool ViewObjectCallback(int index, int total, IntPtr /* maps_view_object_h */ viewObject, IntPtr /* void */ userData); - - [DllImport(Libraries.MapService, EntryPoint = "maps_view_foreach_object")] - internal static extern ErrorCode ForeachObject(ViewHandle /* maps_view_h */ view, ViewObjectCallback callback, IntPtr /* void */ userData); - - [DllImport(Libraries.MapService, EntryPoint = "maps_view_create")] - internal static extern ErrorCode Create(ServiceHandle /* maps_service_h */ maps, IntPtr obj, out IntPtr /* maps_view_h */ view); - - [DllImport(Libraries.MapService, EntryPoint = "maps_view_destroy")] - internal static extern ErrorCode Destroy(IntPtr /* maps_view_h */ view); - - internal int ZoomLevel - { - get { return NativeGet(this.GetZoomLevel); } - set { NativeSet(this.SetZoomLevel, value); } - } - - internal int MinimumZoomLevel - { - get { return NativeGet(this.GetMinZoomLevel); } - set { NativeSet(this.SetMinZoomLevel, value); } - } - - internal int MaximumZoomLevel - { - get { return NativeGet(this.GetMaxZoomLevel); } - set { NativeSet(this.SetMaxZoomLevel, value); } - } - - internal double Orientation - { - get { return NativeGet(this.GetOrientation); } - set { NativeSet(this.SetOrientation, value); } - } - - internal ViewType MapType - { - get { return NativeGet(this.GetMapType); } - set { NativeSet(this.SetMapType, value); } - } - - internal bool BuildingsEnabled - { - get { return NativeGet(this.GetBuildingsEnabled); } - set { NativeSet(this.SetBuildingsEnabled, value); } - } - - internal bool TrafficEnabled - { - get { return NativeGet(this.GetTrafficEnabled); } - set { NativeSet(this.SetTrafficEnabled, value); } - } - - internal bool PublicTransitEnabled - { - get { return NativeGet(this.GetPublicTransitEnabled); } - set { NativeSet(this.SetPublicTransitEnabled, value); } - } - internal bool ScaleBarEnabled - { - get { return NativeGet(this.GetScaleBarEnabled); } - set { NativeSet(this.SetScaleBarEnabled, value); } - } - - internal string Language - { - get { return NativeGet(this.GetLanguage); } - set { NativeSet(this.SetLanguage, value); } - } - - internal bool IsVisible - { - get { return NativeGet(this.GetVisibility); } - set { NativeSet(this.SetVisibility, value); } - } - - internal CoordinatesHandle Center - { - get { return NativeGet(this.GetCenter, CoordinatesHandle.Create); } - set { NativeSet(this.SetCenter, value); } - } - - public ViewHandle(IntPtr handle, bool needToRelease) : base(handle, needToRelease, Destroy) - { - } - - public ViewHandle(ServiceHandle maps, IntPtr evasObject) : this(IntPtr.Zero, true) - { - Create(maps, evasObject, out handle).ThrowIfFailed("Failed to create native handle"); - } - - internal CoordinatesHandle ScreenToGeolocation(Point position) - { - IntPtr coordinates; - this.ScreenToGeolocation(position.X, position.Y, out coordinates).WarnIfFailed("Failed to convert screen position to geocoordinates"); - return CoordinatesHandle.Create(coordinates); - } - - internal Point GeolocationToScreen(CoordinatesHandle coordinates) - { - int x, y; - this.GeolocationToScreen(coordinates, out x, out y).WarnIfFailed("Failed to convert geocoordinates to screen position"); - return new Point() { X = x, Y = y }; - } - } -} diff --git a/src/Tizen.Maps/Tizen.Maps.csproj b/src/Tizen.Maps/Tizen.Maps.csproj deleted file mode 100644 index ae920483b..000000000 --- a/src/Tizen.Maps/Tizen.Maps.csproj +++ /dev/null @@ -1,28 +0,0 @@ - - - - netstandard2.0 - - - - - - - - - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - PreserveNewest - - - - diff --git a/src/Tizen.Maps/Tizen.Maps.sln b/src/Tizen.Maps/Tizen.Maps.sln deleted file mode 100755 index a65ea71c8..000000000 --- a/src/Tizen.Maps/Tizen.Maps.sln +++ /dev/null @@ -1,40 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26430.12 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Maps", "Tizen.Maps.csproj", "{52206925-326A-4D67-8010-8C9CB5CDAB0F}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen", "..\Tizen\Tizen.csproj", "{ED77D1C5-2ABB-4FBE-A042-DFBACB334A9C}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ElmSharp", "..\ElmSharp\ElmSharp.csproj", "{18913535-3C08-4EB5-AC27-25D2EDFC2A1A}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Log", "..\Tizen.Log\Tizen.Log.csproj", "{2A8BBBC1-AEDF-4099-A60E-D9E6C644F4A9}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {52206925-326A-4D67-8010-8C9CB5CDAB0F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {52206925-326A-4D67-8010-8C9CB5CDAB0F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {52206925-326A-4D67-8010-8C9CB5CDAB0F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {52206925-326A-4D67-8010-8C9CB5CDAB0F}.Release|Any CPU.Build.0 = Release|Any CPU - {ED77D1C5-2ABB-4FBE-A042-DFBACB334A9C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {ED77D1C5-2ABB-4FBE-A042-DFBACB334A9C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {ED77D1C5-2ABB-4FBE-A042-DFBACB334A9C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {ED77D1C5-2ABB-4FBE-A042-DFBACB334A9C}.Release|Any CPU.Build.0 = Release|Any CPU - {18913535-3C08-4EB5-AC27-25D2EDFC2A1A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {18913535-3C08-4EB5-AC27-25D2EDFC2A1A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {18913535-3C08-4EB5-AC27-25D2EDFC2A1A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {18913535-3C08-4EB5-AC27-25D2EDFC2A1A}.Release|Any CPU.Build.0 = Release|Any CPU - {2A8BBBC1-AEDF-4099-A60E-D9E6C644F4A9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {2A8BBBC1-AEDF-4099-A60E-D9E6C644F4A9}.Debug|Any CPU.Build.0 = Debug|Any CPU - {2A8BBBC1-AEDF-4099-A60E-D9E6C644F4A9}.Release|Any CPU.ActiveCfg = Release|Any CPU - {2A8BBBC1-AEDF-4099-A60E-D9E6C644F4A9}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/src/Tizen.Maps/Tizen.Maps/Area.cs b/src/Tizen.Maps/Tizen.Maps/Area.cs deleted file mode 100755 index a60be0ebd..000000000 --- a/src/Tizen.Maps/Tizen.Maps/Area.cs +++ /dev/null @@ -1,85 +0,0 @@ -/* - * 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.Maps -{ - /// - /// The class representing a geographical area. - /// - /// 3 - public class Area : IDisposable - { - internal Interop.AreaHandle handle; - - /// - /// Constructs a rectangular area. - /// - /// 3 - /// Top-left coordinates of the area. - /// Bottom-left coordinates of the area. - /// Thrown when the required feature is not supported. - /// Thrown when input coordinates are invalid. - /// Thrown when a native operation fails to allocate memory. - public Area(Geocoordinates topLeft, Geocoordinates bottomRight) - { - handle = new Interop.AreaHandle(topLeft?.handle, bottomRight?.handle); - } - - /// - /// Constructs a circular area. - /// - /// 3 - /// Coordinates for center of the area. - /// Radius of the area. - /// Thrown when the required feature is not supported. - /// Thrown when input coordinates are invalid. - /// Thrown when a native operation fails to allocate memory. - public Area(Geocoordinates center, double radius) - { - handle = new Interop.AreaHandle(center?.handle, radius); - } - - internal Area(Interop.AreaHandle nativeHandle) - { - handle = nativeHandle; - } - - #region IDisposable Support - private bool _disposedValue = false; - - protected virtual void Dispose(bool disposing) - { - if (!_disposedValue) - { - handle.Dispose(); - _disposedValue = true; - } - } - - /// - /// Releases all the resources used by this object. - /// - /// 3 - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - #endregion - } -} diff --git a/src/Tizen.Maps/Tizen.Maps/Direction.cs b/src/Tizen.Maps/Tizen.Maps/Direction.cs deleted file mode 100755 index e479d8ab3..000000000 --- a/src/Tizen.Maps/Tizen.Maps/Direction.cs +++ /dev/null @@ -1,62 +0,0 @@ -/* - * 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. - */ - -namespace Tizen.Maps -{ - /// - /// The direction types for route maneuver. - /// - /// 3 - public enum DirectionType - { - /// - /// Indicates an unknown direction. - /// - None = Interop.RouteDirection.None, - /// - /// Indicates the North direction. - /// - North = Interop.RouteDirection.North, - /// - /// Indicates the Northwest direction. - /// - NorthWest = Interop.RouteDirection.NorthWest, - /// - /// Indicates the Northeast direction. - /// - NorthEast = Interop.RouteDirection.NorthEast, - /// - /// Indicates the South direction. - /// - South = Interop.RouteDirection.South, - /// - /// Indicates the Southeast direction. - /// - SouthEast = Interop.RouteDirection.SouthEast, - /// - /// Indicates the Southwest direction. - /// - SouthWest = Interop.RouteDirection.SouthWest, - /// - /// Indicates the West direction. - /// - West = Interop.RouteDirection.West, - /// - /// Indicates the East direction. - /// - East = Interop.RouteDirection.East, - } -} diff --git a/src/Tizen.Maps/Tizen.Maps/DistanceUnit.cs b/src/Tizen.Maps/Tizen.Maps/DistanceUnit.cs deleted file mode 100755 index f96b13d73..000000000 --- a/src/Tizen.Maps/Tizen.Maps/DistanceUnit.cs +++ /dev/null @@ -1,42 +0,0 @@ -/* - * 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. - */ - -namespace Tizen.Maps -{ - /// - /// The allowed distance units. - /// - /// 3 - public enum DistanceUnit - { - /// - /// Indicates meter unit. - /// - Meter = Interop.DistanceUnit.Meter, - /// - /// Indicates kilometer unit. - /// - Kilometer = Interop.DistanceUnit.Kilometer, - /// - /// Indicates foot unit. - /// - Foot = Interop.DistanceUnit.Foot, - /// - /// Indicates yard unit. - /// - Yard = Interop.DistanceUnit.Yard, - } -} diff --git a/src/Tizen.Maps/Tizen.Maps/GeocodeRequest.cs b/src/Tizen.Maps/Tizen.Maps/GeocodeRequest.cs deleted file mode 100755 index bf588855d..000000000 --- a/src/Tizen.Maps/Tizen.Maps/GeocodeRequest.cs +++ /dev/null @@ -1,102 +0,0 @@ -/* - * 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.Collections.Generic; - -namespace Tizen.Maps -{ - /// - /// Geocode request for the map service. - /// - /// 3 - public class GeocodeRequest : MapServiceRequest - { - private Interop.GeocodeCallback _geocodeCallback; - private List _coordinateList = new List(); - - internal GeocodeRequest(MapService service, string address) : this(service, ServiceRequestType.Geocode) - { - startExecutionAction = new Action(() => - { - int requestID; - errMessage = $"Failed to get coordinates for given address {address}"; - errorCode = _service.handle.Geocode(address, _service.Preferences.handle, _geocodeCallback, IntPtr.Zero, out requestID); - if (errorCode.IsFailed() && errorCode != Interop.ErrorCode.Canceled) - { - _requestTask?.TrySetException(errorCode.GetException(errMessage)); - } - _requestID = requestID; - }); - } - - internal GeocodeRequest(MapService service, string address, Area boundry) : this(service, ServiceRequestType.GeocodeInsideArea) - { - startExecutionAction = new Action(() => - { - int requestID; - errMessage = $"Failed to get coordinates for given address {address}"; - errorCode = _service.handle.GeocodeInsideArea(address, boundry.handle, _service.Preferences.handle, _geocodeCallback, IntPtr.Zero, out requestID); - if (errorCode.IsFailed() && errorCode != Interop.ErrorCode.Canceled) - { - _requestTask?.TrySetException(errorCode.GetException(errMessage)); - } - _requestID = requestID; - }); - } - - internal GeocodeRequest(MapService service, PlaceAddress address) : this(service, ServiceRequestType.GeocodeByStructuredAddress) - { - startExecutionAction = new Action(() => - { - int requestID; - errMessage = $"Failed to get coordinates for given address {address}"; - errorCode = _service.handle.GeocodeByStructuredAddress(address.handle, _service.Preferences.handle, _geocodeCallback, IntPtr.Zero, out requestID); - if (errorCode.IsFailed() && errorCode != Interop.ErrorCode.Canceled) - { - _requestTask?.TrySetException(errorCode.GetException(errMessage)); - } - _requestID = requestID; - }); - } - - private GeocodeRequest(MapService service, ServiceRequestType type) : base(service, type) - { - // The Maps Service invokes this callback while iterating through the list of obtained coordinates of the specified place. - _geocodeCallback = (result, id, index, total, coordinates, userData) => - { - errorCode = result; - if (result.IsSuccess()) - { - // The parameter coordinates must be released using maps_coordinates_destroy() - var coordinatesHandle = new Interop.CoordinatesHandle(coordinates, needToRelease: true); - _coordinateList.Add(new Geocoordinates(coordinatesHandle)); - if (_coordinateList.Count == total) - { - _requestTask?.TrySetResult(_coordinateList); - } - return true; - } - else - { - // If the search fails, the value of total is 0 and coordinates is NULL. - _requestTask?.TrySetException(result.GetException(errMessage)); - return false; - } - }; - } - } -} diff --git a/src/Tizen.Maps/Tizen.Maps/Geocoordinates.cs b/src/Tizen.Maps/Tizen.Maps/Geocoordinates.cs deleted file mode 100755 index 848dfaec2..000000000 --- a/src/Tizen.Maps/Tizen.Maps/Geocoordinates.cs +++ /dev/null @@ -1,104 +0,0 @@ -/* - * 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.Maps -{ - /// - /// A class representing geographical coordinates. - /// - /// 3 - public class Geocoordinates : IDisposable - { - internal Interop.CoordinatesHandle handle; - - /// - /// Constructs the map coordinates object. - /// - /// 3 - /// Latitude value must be between (-90.0 ~ 90.0) degrees. - /// Longitude value must be between (-180.0 ~ 180.0) degrees. - /// Thrown when values for latitude and longitude are not valid. - /// Thrown when a native operation fails to allocate memory. - public Geocoordinates(double latitude, double longitude) - { - handle = new Interop.CoordinatesHandle(latitude, longitude); - } - - internal Geocoordinates(Interop.CoordinatesHandle nativeHandle) - { - handle = nativeHandle; - } - - /// - /// Gets the latitude coordinates. - /// - /// 3 - public double Latitude - { - get - { - return handle.Latitude; - } - } - - /// - /// Gets the longitude coordinates. - /// - /// 3 - public double Longitude - { - get - { - return handle.Longitude; - } - } - - /// - /// Returns a string that represents this object. - /// - /// 3 - /// Returns a string that represents this object. - public override string ToString() - { - return $"[{Latitude}, {Longitude}]"; - } - - #region IDisposable Support - private bool _disposedValue = false; - - protected virtual void Dispose(bool disposing) - { - if (!_disposedValue) - { - handle.Dispose(); - _disposedValue = true; - } - } - - /// - /// Releases all the resources used by this object. - /// - /// 3 - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - #endregion - } -} diff --git a/src/Tizen.Maps/Tizen.Maps/GeocoordinatesList.cs b/src/Tizen.Maps/Tizen.Maps/GeocoordinatesList.cs deleted file mode 100755 index 801996b0b..000000000 --- a/src/Tizen.Maps/Tizen.Maps/GeocoordinatesList.cs +++ /dev/null @@ -1,74 +0,0 @@ -/* - * 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.Collections.Generic; - -namespace Tizen.Maps -{ - /// - /// List of objects to be used in APIs. - /// - internal class GeocoordinatesList : IDisposable - { - internal Interop.CoordinatesListHandle handle; - - internal GeocoordinatesList(IEnumerable coordinateList, bool ownerShip = false) - { - handle = new Interop.CoordinatesListHandle(ownerShip); - foreach (var coordinates in coordinateList) - { - handle.Add(coordinates.handle); - } - } - - /// - /// The iterator for coordinates in this list. - /// - internal IEnumerable Coordinates - { - get - { - List list = new List(); - handle.ForEach(coordinateHandle => list.Add(new Geocoordinates(coordinateHandle))); - return list; - } - } - - #region IDisposable Support - private bool _disposedValue = false; - - protected virtual void Dispose(bool disposing) - { - if (!_disposedValue) - { - handle.Dispose(); - _disposedValue = true; - } - } - - /// - /// Releases all the resources used by this object. - /// - /// 3 - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - #endregion - } -} diff --git a/src/Tizen.Maps/Tizen.Maps/GestureType.cs b/src/Tizen.Maps/Tizen.Maps/GestureType.cs deleted file mode 100755 index b17b4f015..000000000 --- a/src/Tizen.Maps/Tizen.Maps/GestureType.cs +++ /dev/null @@ -1,58 +0,0 @@ -/* - * 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. - */ - -namespace Tizen.Maps -{ - /// - /// Enumeration for the user gesture over a map view. - /// - /// 3 - public enum GestureType - { - /// - /// Indicates the empty gesture. - /// - None = Interop.ViewGesture.None, - /// - /// Indicates the move map user gesture. - /// - Scroll = Interop.ViewGesture.Scroll, - /// - /// Indicates the zoom user gesture. - /// - Zoom = Interop.ViewGesture.Zoom, - /// - /// Indicates the click user gesture. - /// - Click = Interop.ViewGesture.Click, - /// - /// Indicates the double click user gesture. - /// - DoubleClick = Interop.ViewGesture.DoubleClick, - /// - /// Indicates the two-finger click user gesture. - /// - TwoFingerClick = Interop.ViewGesture.TwoFingerClick, - /// - /// Indicates the rotation user gesture. - /// - Rotation = Interop.ViewGesture.Rotation, - /// - /// Indicates the long press user gesture. - /// - LongPress = Interop.ViewGesture.LongPress, - } -} diff --git a/src/Tizen.Maps/Tizen.Maps/IGeocodePreference.cs b/src/Tizen.Maps/Tizen.Maps/IGeocodePreference.cs deleted file mode 100755 index a0fdf0d2a..000000000 --- a/src/Tizen.Maps/Tizen.Maps/IGeocodePreference.cs +++ /dev/null @@ -1,41 +0,0 @@ -/* - * 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. - */ - - -namespace Tizen.Maps -{ - /// - /// The preference for geocode searches. - /// - /// 3 - public interface IGeocodePreference - { - /// - /// Gets or sets a string that presents the preferred language. - /// - /// 3 - /// Language should be specified as an ISO 3166 alpha-2 two-letter country-code - /// followed by ISO 639-1 for the two-letter language code.
e.g. "ko-KR", "en-US".
- string Language { get; set; } - - /// - /// Gets or sets the maximum number of results. - /// - /// 3 - /// Setting a negative value will not have any effect on MaxResults value. - int MaxResults { get; set; } - } -} diff --git a/src/Tizen.Maps/Tizen.Maps/IPlaceSearchPreference.cs b/src/Tizen.Maps/Tizen.Maps/IPlaceSearchPreference.cs deleted file mode 100755 index bb6cab461..000000000 --- a/src/Tizen.Maps/Tizen.Maps/IPlaceSearchPreference.cs +++ /dev/null @@ -1,60 +0,0 @@ -/* - * 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.Collections.Generic; - -namespace Tizen.Maps -{ - /// - /// The preferences for a place search. - /// - /// 3 - public interface IPlaceSearchPreference - { - /// - /// Gets or sets the distance unit. - /// - /// 3 - DistanceUnit Unit { get; set; } - - /// - /// Gets or sets the preferred language. - /// - /// 3 - /// Language should be specified as an ISO 3166 alpha-2 two letter country-code - /// followed by ISO 639-1 for the two-letter language code.
e.g. "ko-KR", "en-US".
- string Language { get; set; } - - /// - /// Gets or sets the maximum number of results. - /// - /// 3 - int MaxResults { get; set; } - - /// - /// Gets or sets a string that represents the code of a preferred country. - /// - /// 3 - string CountryCode { get; set; } - - /// - /// Gets or sets the search properties as a key value pair. - /// - /// 3 - IReadOnlyDictionary Properties { get; set; } - } -} diff --git a/src/Tizen.Maps/Tizen.Maps/IRouteSearchPreference.cs b/src/Tizen.Maps/Tizen.Maps/IRouteSearchPreference.cs deleted file mode 100755 index 31a34cf50..000000000 --- a/src/Tizen.Maps/Tizen.Maps/IRouteSearchPreference.cs +++ /dev/null @@ -1,62 +0,0 @@ -/* - * 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. - */ - - -namespace Tizen.Maps -{ - /// - /// The preferences for route search. - /// - /// 3 - public interface IRouteSearchPreference - { - /// - /// Gets or sets the distance unit. - /// - /// 3 - DistanceUnit Unit { get; set; } - - /// - /// Gets or sets the route optimization. - /// - /// 3 - RouteOptimization Optimization { get; set; } - - /// - /// Gets or sets the route transport mode. - /// - /// 3 - TransportMode Mode { get; set; } - - /// - /// Gets or sets the route feature weight. - /// - /// 3 - RouteFeatureWeight RouteFeatureWeight { get; set; } - - /// - /// Gets or sets the route feature. - /// - /// 3 - RouteFeature RouteFeature { get; set; } - - /// - /// Gets or sets if a search for alternative routes is enabled. - /// - /// 3 - bool SearchAlternativeRoutes { get; set; } - } -} diff --git a/src/Tizen.Maps/Tizen.Maps/Log.cs b/src/Tizen.Maps/Tizen.Maps/Log.cs deleted file mode 100755 index 8340d2e5e..000000000 --- a/src/Tizen.Maps/Tizen.Maps/Log.cs +++ /dev/null @@ -1,56 +0,0 @@ -/* - * 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.CompilerServices; - -namespace Tizen.Maps -{ - internal static class Log - { - private static String tag = "Tizen.Maps"; - - public static void Debug(string message, [CallerFilePath] string file = "", [CallerMemberName] string func = "", [CallerLineNumber] int line = 0) - { - Tizen.Log.Debug(tag, message, file, func, line); - } - - public static void Error(string message, [CallerFilePath] string file = "", [CallerMemberName] string func = "", [CallerLineNumber] int line = 0) - { - Tizen.Log.Error(tag, message, file, func, line); - } - - public static void Fatal(string message, [CallerFilePath] string file = "", [CallerMemberName] string func = "", [CallerLineNumber] int line = 0) - { - Tizen.Log.Fatal(tag, message, file, func, line); - } - - public static void Info(string message, [CallerFilePath] string file = "", [CallerMemberName] string func = "", [CallerLineNumber] int line = 0) - { - Tizen.Log.Info(tag, message, file, func, line); - } - - public static void Verbose(string message, [CallerFilePath] string file = "", [CallerMemberName] string func = "", [CallerLineNumber] int line = 0) - { - Tizen.Log.Verbose(tag, message, file, func, line); - } - - public static void Warn(string message, [CallerFilePath] string file = "", [CallerMemberName] string func = "", [CallerLineNumber] int line = 0) - { - Tizen.Log.Warn(tag, message, file, func, line); - } - } -} diff --git a/src/Tizen.Maps/Tizen.Maps/MapGestureEventArgs.cs b/src/Tizen.Maps/Tizen.Maps/MapGestureEventArgs.cs deleted file mode 100755 index ba7789b61..000000000 --- a/src/Tizen.Maps/Tizen.Maps/MapGestureEventArgs.cs +++ /dev/null @@ -1,77 +0,0 @@ -/* - * 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 ElmSharp; - -namespace Tizen.Maps -{ - /// - /// Event arguments for gesture type map events. - /// - /// 3 - public class MapGestureEventArgs : EventArgs - { - internal MapGestureEventArgs(IntPtr nativeHandle) - { - using (var handle = new Interop.GestureEventDataHandle(nativeHandle)) - { - GestureType = (GestureType)handle.GestureType; - Position = handle.Position; - TouchCount = handle.FingerCount; - ZoomFactor = handle.ZoomFactor; - RotationAngle = handle.RotationAngle; - Geocoordinates = new Geocoordinates(handle.Coordinates); - } - } - - /// - /// Gets the type of gesture event. - /// - /// 3 - public GestureType GestureType { get; } - - /// - /// Gets screen coordinates in the event. - /// - /// 3 - public Point Position { get; } - - /// - /// Gets the number of fingers detected in the event. - /// - /// 3 - public int TouchCount { get; } - - /// - /// Gets the zoom factor for zoom gesture event. - /// - /// 3 - public double ZoomFactor { get; } - - /// - /// Gets the angle of rotation for rotate gesture event. - /// - /// 3 - public double RotationAngle { get; } - - /// - /// Gets the geographical coordinates for the event. - /// - /// 3 - public Geocoordinates Geocoordinates { get; } - } -} diff --git a/src/Tizen.Maps/Tizen.Maps/MapObject.cs b/src/Tizen.Maps/Tizen.Maps/MapObject.cs deleted file mode 100755 index 4b4b9a672..000000000 --- a/src/Tizen.Maps/Tizen.Maps/MapObject.cs +++ /dev/null @@ -1,40 +0,0 @@ -/* - * 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. - */ - - -namespace Tizen.Maps -{ - /// - /// The map object. - /// - /// 3 - public abstract class MapObject - { - internal MapObject() { } - - /// - /// Gets or sets visibility of the map object. - /// - /// 3 - public abstract bool IsVisible { get; set; } - - internal abstract void HandleClickedEvent(); - - internal abstract void InvalidateMapObject(); - - internal abstract Interop.ViewObjectHandle GetHandle(); - } -} diff --git a/src/Tizen.Maps/Tizen.Maps/MapService.cs b/src/Tizen.Maps/Tizen.Maps/MapService.cs deleted file mode 100755 index 32949be00..000000000 --- a/src/Tizen.Maps/Tizen.Maps/MapService.cs +++ /dev/null @@ -1,385 +0,0 @@ -/* - * 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.Collections.Generic; -using System.Threading.Tasks; - -namespace Tizen.Maps -{ - /// - /// Map service class for service request. - /// - /// 3 - public partial class MapService : IDisposable - { - internal Interop.ServiceHandle handle; - - private PlaceFilter _filter; - private SearchPreference _searchPreference; - - private static List s_providers; - private string _serviceProvider; - - - /// - /// Creates a new maps service object for given service provider. - /// - /// 3 - /// A string representing the name of the map service provider. - /// A string representing a certificate key to use the map service provider. - /// http://tizen.org/privilege/mapservice - /// http://tizen.org/privilege/network.get - /// Thrown when the required feature is not supported. - /// Thrown when parameters are invalid. - /// Thrown when a native operation failed to allocate memory and connect to the service. - /// Thrown when application does not have some privilege to access this method. - public MapService(string serviceProvider, string serviceProviderKey) - { - _serviceProvider = serviceProvider; - handle = new Interop.ServiceHandle(serviceProvider); - ProviderKey = serviceProviderKey; - PlaceSearchFilter = new PlaceFilter(); - Preferences = new SearchPreference(); - } - - /// - /// Gets the list of available map service providers. - /// - /// 3 - /// The list of map service providers. - /// http://tizen.org/privilege/mapservice - /// Thrown when the required feature is not supported. - /// Thrown when application does not have privilege to access this property. - public static IEnumerable Providers - { - get - { - if (s_providers != null) return s_providers; - - s_providers = new List(); - Interop.ServiceHandle.ForeachProvider(provider => s_providers.Add(provider)); - return s_providers; - } - } - - /// - /// Gets the name of the map service provider. - /// - /// 3 - public string Provider { get { return _serviceProvider; } } - - /// - /// Gets a user consent for the map service provider - /// - /// 3 - /// http://tizen.org/privilege/mapservice - public bool UserConsented - { - get - { - return handle.UserConsented; - } - } - - /// - /// Gets and sets a string representing keys for the map service provider. - /// - /// 3 - /// Typically, the provider key is issued by each maps provider after signing up for a plan in the website. - /// Depending on the plan and its provider which you have signed, you might have to pay for the network traffic. - public string ProviderKey - { - get - { - return handle.ProviderKey; - } - set - { - handle.ProviderKey = value; - } - } - - /// - /// Gets and sets a filter used for the place search result. - /// - /// 3 - public PlaceFilter PlaceSearchFilter - { - get - { - return _filter; - } - set - { - if (value != null) - { - _filter = value; - } - } - } - - /// - /// Gets the search preferences used for or . - /// - /// 3 - public IGeocodePreference GeocodePreferences - { - get - { - return Preferences as IGeocodePreference; - } - } - - /// - /// Gets the search preferences used for . - /// - /// 3 - public IPlaceSearchPreference PlaceSearchPreferences - { - get - { - return Preferences as IPlaceSearchPreference; - } - } - - /// - /// Gets the search preferences used for . - /// - /// 3 - public IRouteSearchPreference RouteSearchPreferences - { - get - { - return Preferences as IRouteSearchPreference; - } - } - - /// - /// Gets and sets the search preferences. - /// - /// 3 - public SearchPreference Preferences - { - get - { - if (_searchPreference == null) - { - _searchPreference = new SearchPreference(handle.Preferences); - } - return _searchPreference; - } - set - { - if (value != null) - { - handle.Preferences = value.handle; - _searchPreference = value; - } - } - } - - /// - /// Gets the user's consent to use maps data. - /// - /// 3 - /// Returns true if user agreed that the application can use maps data, otherwise false. - /// http://tizen.org/privilege/mapservice - /// Thrown when the required feature is not supported. - /// Thrown when application does not have some privilege to access this method. - public async Task RequestUserConsent() - { - TaskCompletionSource tcs = new TaskCompletionSource(); - Interop.RequestUserConsentwithHandleCallback cb = (consented, userData) => - { - tcs.TrySetResult(consented); - }; - - var err = handle.RequestUserConsent(cb, IntPtr.Zero); - if (err.IsFailed()) - { - tcs.TrySetException(err.GetException("Failed to get user consent")); - } - return await tcs.Task.ConfigureAwait(false); - } - - /// - /// Checks if the maps service supports the given request. - /// - /// 3 - /// Request type to check - /// Returns true if the maps service supports a request, otherwise false. - /// http://tizen.org/privilege/mapservice - /// Thrown when the required feature is not supported. - /// Thrown when application does not have some privilege to access this method. - public bool IsSupported(ServiceRequestType type) - { - bool result; - var err = handle.IsServiceSupported((Interop.ServiceType)type, out result); - err.WarnIfFailed($"Failed to get if {type} is supported"); - return (err.IsSuccess()) ? result : false; - } - - /// - /// Checks if the maps service supports a given data feature. - /// - /// 3 - /// Data feature to check. - /// Returns true if the maps service supports a data feature, otherwise false. - /// http://tizen.org/privilege/mapservice - /// Thrown when the required feature is not supported. - /// Thrown when application does not have some privilege to access this method. - public bool IsSupported(ServiceData data) - { - bool result; - var err = handle.IsDataSupported((Interop.ServiceData)data, out result); - err.WarnIfFailed($"Failed to get if {data} data is supported"); - return (err.IsSuccess()) ? result : false; - } - - /// - /// Creates a geocode search request for the given free-formed address string. - /// - /// 3 - /// A string representing free-formed address. - /// Returns a GeocodeRequest object created with an address string. - public GeocodeRequest CreateGeocodeRequest(string address) - { - return new GeocodeRequest(this, address); - } - - /// - /// Creates a geocode search request for the given free-formed address string, within the specified boundary. - /// - /// 3 - /// A string representing the free-formed address. - /// An instance of Area object representing the interested area. - /// - /// Returns a GeocodeRequest object created with an address string and a specified boundary. - public GeocodeRequest CreateGeocodeRequest(string address, Area boundary) - { - return new GeocodeRequest(this, address, boundary); - } - - /// - /// Creates a geocode search request for the given structured address. - /// - /// 3 - /// A string representing the address of interest. - /// Returns a GeocodeRequest object created with a structured address. - public GeocodeRequest CreateGeocodeRequest(PlaceAddress address) - { - return new GeocodeRequest(this, address); - } - - /// - /// Creates a reverse geocode search request for the given latitude and longitude. - /// - /// 3 - /// Latitude of the interested place. - /// Longitude of the interested place. - /// Returns a ReverseGeocodeRequest object created with the location coordinates. - public ReverseGeocodeRequest CreateReverseGeocodeRequest(double latitude, double longitude) - { - return new ReverseGeocodeRequest(this, latitude, longitude); - } - - /// - /// Creates a reverse geocode search request for the given position coordinates list. - /// - /// 3 - /// Coordinates list with [2 ~ 100] coordinates. - /// Returns a MultiReverseGeocodeRequest object created with a list of location coordinates. - public MultiReverseGeocodeRequest CreateMultiReverseGeocodeRequest(IEnumerable coordinates) - { - return new MultiReverseGeocodeRequest(this, coordinates); - } - - /// - /// Creates a route search request for the origin and destination points. - /// - /// 3 - /// Starting point. - /// Destination. - /// Returns a RouteSearchRequest object created with the origin and destination coordinates. - public RouteSearchRequest CreateRouteSearchRequest(Geocoordinates from, Geocoordinates to) - { - return new RouteSearchRequest(this, from, to); - } - - /// - /// Creates a place search request for a specified search radius around a given coordinates position. - /// - /// 3 - /// Geographical coordinates of the center. - /// A double value representing the radius of an area to search places. - /// Returns a PlaceSearchRequest object created with the location coordinates and search radius. - public PlaceSearchRequest CreatePlaceSearchRequest(Geocoordinates coordinates, int distance) - { - return new PlaceSearchRequest(this, coordinates, distance); - } - - /// - /// Creates a place search request for places within a specified boundary. - /// - /// 3 - /// An instance of Area object representing and area to search interested places. - /// Returns a PlaceSearchRequest object created with a specified boundary. - public PlaceSearchRequest CreatePlaceSearchRequest(Area boundary) - { - return new PlaceSearchRequest(this, boundary); - } - - /// - /// Creates a place search request for a free-formed address within the boundary. - /// - /// 3 - /// A string which represents a free-formed address. - /// An instance of area object representing an area to search interested places. - /// Returns a PlaceSearchRequest object created with an address string and a specified boundary. - public PlaceSearchRequest CreatePlaceSearchRequest(string address, Area boundary) - { - return new PlaceSearchRequest(this, address, boundary); - } - - #region IDisposable Support - private bool _disposedValue = false; - protected virtual void Dispose(bool disposing) - { - if (!_disposedValue) - { - if (disposing) - { - _filter.Dispose(); - _searchPreference.Dispose(); - } - handle.Dispose(); - _disposedValue = true; - } - } - - /// - /// Releases all the resources used by this object. - /// - /// 3 - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - #endregion - } -} diff --git a/src/Tizen.Maps/Tizen.Maps/MapServiceRequest.cs b/src/Tizen.Maps/Tizen.Maps/MapServiceRequest.cs deleted file mode 100755 index 6aaaa8628..000000000 --- a/src/Tizen.Maps/Tizen.Maps/MapServiceRequest.cs +++ /dev/null @@ -1,118 +0,0 @@ -/* - * 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.Collections.Generic; -using System.Threading.Tasks; - -namespace Tizen.Maps -{ - /// - /// Base class for a map service request. - /// - /// 3 - /// - public abstract class MapServiceRequest : IDisposable - { - protected TaskCompletionSource> _requestTask; - protected string errMessage; - protected int? _requestID; - protected ServiceRequestType _type; - - internal Action startExecutionAction; - internal Interop.ErrorCode errorCode; - - internal MapService _service; - - /// - /// Creates a map service request. - /// - /// Map service object. - /// Request type. - internal MapServiceRequest(MapService service, ServiceRequestType type) - { - _service = service; - _type = type; - } - - /// - /// Sends a request to the map service provider. - /// - /// 3 - /// Response from the map service provider. - /// http://tizen.org/privilege/mapservice - /// http://tizen.org/privilege/internet - /// http://tizen.org/privilege/network.get - /// Thrown when the required feature is not supported. - /// Thrown when application does not have some privilege to access this method. - /// Thrown when the result is invalid. - /// Thrown when arguments are invalid. - public async Task> GetResponseAsync() - { - IEnumerable task = null; - if (_requestTask == null || _requestTask.Task.IsCanceled) - { - _requestTask = new TaskCompletionSource>(); - startExecutionAction(); - task = await _requestTask.Task.ConfigureAwait(false); - } - errorCode.WarnIfFailed(errMessage); - return task; - } - - internal void Cancel() - { - if (_requestTask?.Task.IsCompleted == false) - { - _requestTask?.SetCanceled(); - if (_requestID != null) - { - var err = Interop.CancelRequest(_service.handle, (int)_requestID); - err.ThrowIfFailed($"Unable to cancel service request, Type: {_type}, ID: {_requestID}"); - } - - errorCode = Interop.ErrorCode.Canceled; - } - } - - #region IDisposable Support - private bool _disposedValue = false; - - protected virtual void Dispose(bool disposing) - { - if (!_disposedValue) - { - if (disposing) - { - Cancel(); - _service.Dispose(); - } - _disposedValue = true; - } - } - - /// - /// Releases all the resources used by this object. - /// - /// 3 - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - #endregion - } -} diff --git a/src/Tizen.Maps/Tizen.Maps/MapTypes.cs b/src/Tizen.Maps/Tizen.Maps/MapTypes.cs deleted file mode 100755 index 90bfd4375..000000000 --- a/src/Tizen.Maps/Tizen.Maps/MapTypes.cs +++ /dev/null @@ -1,42 +0,0 @@ -/* - * 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. - */ - -namespace Tizen.Maps -{ - /// - /// The map view type (theme). - /// - /// 3 - public enum MapTypes - { - /// - /// Indicates the normal street theme. - /// - Normal = Interop.ViewType.Normal, - /// - /// Indicates the satellite theme. - /// - Satellite = Interop.ViewType.Satellite, - /// - /// Indicates the terrain theme. - /// - Terrain = Interop.ViewType.Terrain, - /// - /// Indicates the hybrid theme that has both satellite and normal theme. - /// - Hybrid = Interop.ViewType.Hybrid, - } -} diff --git a/src/Tizen.Maps/Tizen.Maps/MapView.cs b/src/Tizen.Maps/Tizen.Maps/MapView.cs deleted file mode 100755 index 2b0219fda..000000000 --- a/src/Tizen.Maps/Tizen.Maps/MapView.cs +++ /dev/null @@ -1,780 +0,0 @@ -/* - * 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 ElmSharp; -using Layout = ElmSharp.Layout; -using EvasObject = ElmSharp.EvasObject; -using System.Collections.Generic; - -namespace Tizen.Maps -{ - /// - /// Map View class to show a map on the screen. - /// - /// 3 - public class MapView : Layout, IDisposable - { - internal Interop.ViewHandle handle; - private MapService _service; - - private Dictionary _handleToObjectTable = new Dictionary(); - - private Interop.ViewOnEventCallback _gestureEventCallback; - private Interop.ViewOnEventCallback _objectEventCallback; - private Interop.ViewOnEventCallback _viewReadyEventCallback; - - private event EventHandler _scrolledEventHandler; - private event EventHandler _twoFingerZoomedEventHandler; - private event EventHandler _clickedEventHandler; - private event EventHandler _doubleClickedEventHandler; - private event EventHandler _twoFingerClickedEventHandler; - private event EventHandler _twoFingerRotatedEventHandler; - private event EventHandler _longPressedEventHandler; - private event EventHandler _viewReadyEventHandler; - - /// - /// Creates a view and links it to the instance of a map service. - /// - /// 3 - /// An instance of object for which a map view will be drawn. - /// An instance of object. - /// http://tizen.org/privilege/mapservice - /// Thrown when the required feature is not supported. - /// Thrown when application does not have some privilege to access this method. - /// Thrown when parameters are invalid. - /// Thrown when a native operation failed to allocate memory, and connect to the service. - public MapView(EvasObject parent, MapService service) : base(parent) - { - handle = new Interop.ViewHandle(service.handle, this); - Log.Info(string.Format("MapView is created")); - - _service = service; - this.Resize(1, 1); - - // We need to keep Gesture Tap event enabled for object event to work - handle.SetGestureEnabled(Interop.ViewGesture.Click, true); - SetObjectEventCallback(); - } - - /// - /// Adds or removes event handlers to deliver a scrolled gesture event. - /// - /// Event handlers to get a scrolled gesture event. - /// 3 - /// Thrown when the required feature is not supported. - public event EventHandler Scrolled - { - add - { - SetGestureEventCallback(); - handle.SetGestureEnabled(Interop.ViewGesture.Scroll, true); - _scrolledEventHandler += value; - Log.Info(string.Format("Scrolled event handler is added")); - } - remove - { - _scrolledEventHandler -= value; - Log.Info(string.Format("Scrolled event handler is removed")); - if (_scrolledEventHandler == null) - { - handle.SetGestureEnabled(Interop.ViewGesture.Scroll, false); - UnsetGestureEventCallback(); - } - } - } - - /// - /// Adds or removes event handlers to deliver a zoomed gesture event. - /// - /// Event handlers to get a zoomed gesture event. - /// 3 - /// Thrown when the required feature is not supported. - public event EventHandler TwoFingerZoomed - { - add - { - SetGestureEventCallback(); - handle.SetGestureEnabled(Interop.ViewGesture.Zoom, true); - _twoFingerZoomedEventHandler += value; - Log.Info(string.Format("TwoFingerZoomed event handler is added")); - } - remove - { - _twoFingerZoomedEventHandler -= value; - Log.Info(string.Format("TwoFingerZoomed event handler is removed")); - if (_twoFingerZoomedEventHandler == null) - { - handle.SetGestureEnabled(Interop.ViewGesture.Zoom, false); - UnsetGestureEventCallback(); - } - } - } - - /// - /// Adds or removes event handlers to deliver a clicked gesture event. - /// - /// Event handlers to get a clicked gesture event. - /// 3 - /// Thrown when the required feature is not supported. - public event EventHandler Clicked - { - add - { - SetGestureEventCallback(); - //handle.SetGestureEnabled(Interop.ViewGesture.Click, true); - _clickedEventHandler += value; - Log.Info(string.Format("Clicked event handler is added")); - } - remove - { - _clickedEventHandler -= value; - Log.Info(string.Format("Clicked event handler is removed")); - if (_clickedEventHandler == null) - { - //handle.SetGestureEnabled(Interop.ViewGesture.Click, false); - UnsetGestureEventCallback(); - } - } - } - - /// - /// Adds or removes event handlers to deliver a double-clicked gesture event. - /// - /// Event handlers to get a double-clicked gesture event. - /// 3 - /// Thrown when the required feature is not supported. - public event EventHandler DoubleClicked - { - add - { - SetGestureEventCallback(); - handle.SetGestureEnabled(Interop.ViewGesture.DoubleClick, true); - _doubleClickedEventHandler += value; - Log.Info(string.Format("DoubleClicked event handler is removed")); - } - remove - { - _doubleClickedEventHandler -= value; - Log.Info(string.Format("DoubleClicked event handler is removed")); - if (_doubleClickedEventHandler == null) - { - handle.SetGestureEnabled(Interop.ViewGesture.DoubleClick, false); - UnsetGestureEventCallback(); - } - } - } - - /// - /// Adds or removes event handlers to deliver a clicked gesture event with two-fingers. - /// - /// Event handlers to get a clicked gesture event. - /// 3 - /// Thrown when the required feature is not supported. - public event EventHandler TwoFingerClicked - { - add - { - SetGestureEventCallback(); - handle.SetGestureEnabled(Interop.ViewGesture.TwoFingerClick, true); - _twoFingerClickedEventHandler += value; - Log.Info(string.Format("TwoFingerClicked event handler is added")); - } - remove - { - _twoFingerClickedEventHandler -= value; - Log.Info(string.Format("TwoFingerClicked event handler is removed")); - if (_twoFingerClickedEventHandler == null) - { - handle.SetGestureEnabled(Interop.ViewGesture.TwoFingerClick, false); - UnsetGestureEventCallback(); - } - } - } - - /// - /// Adds or removes event handlers to deliver a rotated gesture event. - /// - /// Event handlers to get a rotated gesture event. - /// 3 - /// Thrown when the required feature is not supported. - public event EventHandler TwoFingerRotated - { - add - { - SetGestureEventCallback(); - handle.SetGestureEnabled(Interop.ViewGesture.Rotation, true); - _twoFingerRotatedEventHandler += value; - Log.Info(string.Format("Rotated event handler is added")); - } - remove - { - _twoFingerRotatedEventHandler -= value; - Log.Info(string.Format("Rotated event handler is removed")); - if (_twoFingerRotatedEventHandler == null) - { - handle.SetGestureEnabled(Interop.ViewGesture.Rotation, false); - UnsetGestureEventCallback(); - } - } - } - - - /// - /// Adds or removes event handlers to deliver a long-pressed gesture event. - /// - /// Event handlers to get a long-pressed gesture event. - /// 3 - /// Thrown when the required feature is not supported. - public event EventHandler LongPressed - { - add - { - SetGestureEventCallback(); - handle.SetGestureEnabled(Interop.ViewGesture.LongPress, true); - _longPressedEventHandler += value; - Log.Info(string.Format("LongPressed event handler is added")); - } - remove - { - _longPressedEventHandler -= value; - Log.Info(string.Format("LongPressed event handler is removed")); - if (_longPressedEventHandler == null) - { - handle.SetGestureEnabled(Interop.ViewGesture.LongPress, false); - UnsetGestureEventCallback(); - } - } - } - - /// - /// Adds or removes event handlers to deliver an event representing a view ready to be used. - /// - /// Event handlers to get a view ready event. - /// 3 - /// Thrown when the required feature is not supported. - public event EventHandler ViewReady - { - add - { - SetViewReadyEventCallback(); - _viewReadyEventHandler += value; - Log.Info(string.Format("ViewReady event handler is added")); - } - remove - { - _viewReadyEventHandler -= value; - Log.Info(string.Format("ViewReady event handler is removed")); - UnsetGestureEventCallback(); - } - } - - /// - /// Gets or sets the current zoom level. - /// - /// It is an integer value representing the current zoom level. - /// 3 - /// http://tizen.org/privilege/mapservice - /// http://tizen.org/privilege/internet - /// http://tizen.org/privilege/network.get - /// Thrown when the required feature is not supported. - /// Thrown when application does not have some privilege to access this method. - public int ZoomLevel - { - get - { - return handle.ZoomLevel; - } - set - { - Log.Info(string.Format("ZoomLevel is changed from {0} to {1}", handle.ZoomLevel, value)); - handle.ZoomLevel = value; - } - } - - /// - /// Gets or sets the minimum zoom level. - /// - /// It is an integer value that limits minimal zoom level within a range of the current map plug-in support. - /// 3 - /// http://tizen.org/privilege/mapservice - /// http://tizen.org/privilege/internet - /// http://tizen.org/privilege/network.get - /// Thrown when the required feature is not supported. - /// Thrown when application does not have some privilege to access this method. - public int MinimumZoomLevel - { - get - { - return handle.MinimumZoomLevel; - } - set - { - Log.Info(string.Format("MinimumZoomLevel is changed from {0} to {1}", handle.MinimumZoomLevel, value)); - handle.MinimumZoomLevel = value; - } - } - - /// - /// Gets or sets the maximum zoom level. - /// - /// It is an integer value that limits maximum zoom level within a range of the current map plug-in support. - /// 3 - /// http://tizen.org/privilege/mapservice - /// http://tizen.org/privilege/internet - /// http://tizen.org/privilege/network.get - /// Thrown when the required feature is not supported. - /// Thrown when application does not have some privilege to access this method. - public int MaximumZoomLevel - { - get - { - return handle.MaximumZoomLevel; - } - set - { - Log.Info(string.Format("MaximumZoomLevel is changed from {0} to {1}", handle.MaximumZoomLevel, value)); - handle.MaximumZoomLevel = value; - } - } - - /// - /// Gets or sets the orientation on the map view. - /// - /// It is an integer value from 0 to 360 that indicates the orientation of the map view. - /// 3 - /// http://tizen.org/privilege/mapservice - /// http://tizen.org/privilege/internet - /// http://tizen.org/privilege/network.get - /// Thrown when the required feature is not supported. - /// Thrown when application does not have some privilege to access this method. - public double Orientation - { - get - { - return handle.Orientation; - } - set - { - Log.Info(string.Format("Orientation is changed from {0} to {1}", handle.Orientation, value)); - handle.Orientation = value; - } - } - - /// - /// Gets or sets theme type of the map view. - /// - /// 3 - /// http://tizen.org/privilege/mapservice - /// http://tizen.org/privilege/internet - /// http://tizen.org/privilege/network.get - /// Thrown when the required feature is not supported. - /// Thrown when application does not have some privilege to access this method. - public MapTypes MapType - { - get - { - return (MapTypes)handle.MapType; - } - set - { - Log.Info(string.Format("MapType is changed from {0} to {1}", handle.MapType, value)); - handle.MapType = (Interop.ViewType)value; - } - } - - /// - /// Indicates whether the map should show the 3D buildings layer. - /// - /// 3 - /// http://tizen.org/privilege/mapservice - /// http://tizen.org/privilege/internet - /// http://tizen.org/privilege/network.get - /// Thrown when the required feature is not supported. - /// Thrown when application does not have some privilege to access this method. - public bool BuildingsEnabled - { - get - { - return handle.BuildingsEnabled; - } - set - { - Log.Info(string.Format("Showing the 3D buildings is {0}", (value ? "enabled" : "disabled"))); - handle.BuildingsEnabled = value; - } - } - - /// - /// Indicates whether the map should show the traffic layer. - /// - /// 3 - /// http://tizen.org/privilege/mapservice - /// http://tizen.org/privilege/internet - /// http://tizen.org/privilege/network.get - /// Thrown when the required feature is not supported. - /// Thrown when application does not have some privilege to access this method. - public bool TrafficEnabled - { - get - { - return handle.TrafficEnabled; - } - set - { - Log.Info(string.Format("Showing the traffic is {0}", (value ? "enabled" : "disabled"))); - handle.TrafficEnabled = value; - } - } - - /// - /// Indicates whether the map should show the public transit layer. - /// - /// 3 - /// http://tizen.org/privilege/mapservice - /// http://tizen.org/privilege/internet - /// http://tizen.org/privilege/network.get - /// Thrown when the required feature is not supported. - /// Thrown when application does not have some privilege to access this method. - public bool PublicTransitEnabled - { - get - { - return handle.PublicTransitEnabled; - } - set - { - Log.Info(string.Format("Showing the public transit is {0}", (value ? "enabled" : "disabled"))); - handle.PublicTransitEnabled = value; - } - } - - /// - /// Indicates whether the scale-bar is enabled or not. - /// - /// 3 - /// http://tizen.org/privilege/mapservice - /// http://tizen.org/privilege/internet - /// http://tizen.org/privilege/network.get - /// Thrown when the required feature is not supported. - /// Thrown when application does not have some privilege to access this method. - public bool ScaleBarEnabled - { - get - { - return handle.ScaleBarEnabled; - } - set - { - Log.Info(string.Format("Showing the scale-bar is {0}", (value ? "enabled" : "disabled"))); - handle.ScaleBarEnabled = value; - } - } - - /// - /// Sets language of map view. - /// - /// The display language in the map. - /// A language is specified as an ISO 3166 alpha-2 two letter country-code - /// followed by ISO 639-1 for the two-letter language code. - /// Each language tag is composed of one or more "subtags" separated by hyphens (-). - /// Each subtag is composed of basic Latin letters or digits only. - /// For example, "ko-KR" for Korean, "en-US" for American English. - /// 3 - /// http://tizen.org/privilege/mapservice - /// http://tizen.org/privilege/internet - /// http://tizen.org/privilege/network.get - /// Thrown when the required feature is not supported. - /// Thrown when application does not have some privilege to access this method. - /// Thrown when the value is invalid. - public string Language - { - get - { - return handle.Language; - } - set - { - Log.Info(string.Format("Language is changed from {0} to {1}", handle.Language, value)); - handle.Language = value; - } - } - - /// - /// Gets or sets geographical coordinates for map view's center. - /// - /// 3 - /// http://tizen.org/privilege/mapservice - /// http://tizen.org/privilege/internet - /// http://tizen.org/privilege/network.get - /// Thrown when the required feature is not supported. - /// Thrown when application does not have some privilege to access this method. - /// Thrown when the value is invalid. - public Geocoordinates Center - { - get - { - return new Geocoordinates(handle.Center); - } - set - { - Log.Info(string.Format("Center is changed from {0} to {1}", handle.Center.ToString(), value.ToString())); - handle.Center = value.handle; - } - } - - /// - /// Gets a list of the map object added to map view. - /// - /// 3 - public new IEnumerable Children - { - get - { - return _handleToObjectTable.Values; - } - } - - /// - /// Changes the geographical coordinates to screen coordinates. - /// - /// 3 - /// Geographical coordinates. - /// Returns an instance of the screen coordinates on the current screen. - /// http://tizen.org/privilege/mapservice - /// Thrown when the required feature is not supported. - /// Thrown when application does not have some privilege to access this method. - /// Thrown when the value is invalid. - /// Thrown when a native operation failed to allocate memory and connect to the service. - public Point GeolocationToScreen(Geocoordinates coordinates) - { - return handle.GeolocationToScreen(coordinates.handle); - } - - /// - /// Changes the screen coordinates to geographical coordinates. - /// - /// 3 - /// Screen coordinates. - /// Returns an instance of the geographical coordinates object. - /// http://tizen.org/privilege/mapservice - /// Thrown when the required feature is not supported. - /// Thrown when application does not have some privilege to access this method. - /// Thrown when the value is invalid. - /// Thrown when a native operation failed to allocate memory and connect to the service. - public Geocoordinates ScreenToGeolocation(Point screenCoordinates) - { - return new Geocoordinates(handle.ScreenToGeolocation(screenCoordinates)); - } - - /// - /// Adds a map object to map view. - /// - /// 3 - /// An instance of the map object to be added. - /// http://tizen.org/privilege/mapservice - /// Thrown when the required feature is not supported. - /// Thrown when application does not have some privilege to access this method. - /// Thrown when the value is invalid. - /// Thrown when a native operation failed to allocate memory and connect to the service. - public void Add(MapObject child) - { - Log.Info(string.Format("Add a object")); - var objectHandle = child.GetHandle(); - if (!_handleToObjectTable.ContainsKey(objectHandle)) - { - _handleToObjectTable[objectHandle] = child; - handle.AddObject(objectHandle); - - // MapView take ownership of added map objects - objectHandle.HasOwnership = false; - } - } - - /// - /// Removes a map object from the map view. - /// - /// 3 - /// An instance of the map object to be removed. - /// Once removed, the child object will be become invalid. - /// http://tizen.org/privilege/mapservice - /// Thrown when the required feature is not supported. - /// Thrown when application does not have some privilege to access this method. - /// Thrown when the value is invalid. - /// Thrown when native operation failed to allocate memory and connect to the service. - public void Remove(MapObject child) - { - Log.Info(string.Format("Remove a object")); - var objectHandle = child.GetHandle(); - if (_handleToObjectTable.Remove(objectHandle)) - { - handle.RemoveObject(child.GetHandle()); - - // The object handle will be released automatically by the View, once RemoveObject call is successful - child.InvalidateMapObject(); - } - } - - /// - /// Removes all map objects from the map view. - /// - /// 3 - /// http://tizen.org/privilege/mapservice - /// Thrown when the required feature is not supported. - /// Thrown when application does not have some privilege to access this method. - /// Thrown when a native operation failed to allocate memory and connect to the service. - public void RemoveAll() - { - Log.Info(string.Format("Remove all of objects")); - foreach (var child in _handleToObjectTable.Values) - { - child.InvalidateMapObject(); - } - _handleToObjectTable.Clear(); - handle.RemoveAllObjects(); - } - - /// - /// Captures a snapshot of the map view. - /// - /// 3 - /// Type of file format. - /// An integer value representing the quality for encoding from 1 to 100. - /// A string representing the file path for a snapshot. - /// http://tizen.org/privilege/mapservice - /// Thrown when the required feature is not supported. - /// Thrown when application does not have some privilege to access this method. - /// Thrown when the value is invalid. - /// Thrown when a native operation failed to allocate memory and connect to the service. - public void CaptureSnapshot(SnapshotType type, int quality, string path) - { - var err = Interop.ViewSnapshot.ViewCaptureSnapshot(handle, (Interop.ViewSnapshotFormatType)type, quality, path); - err.ThrowIfFailed("Failed to create snapshot for the view"); - } - - private void SetGestureEventCallback() - { - if (_gestureEventCallback == null) - { - _gestureEventCallback = (type, eventData, userData) => - { - if (type != Interop.ViewEventType.Gesture) return; - var eventArg = new MapGestureEventArgs(eventData); - switch (eventArg.GestureType) - { - case GestureType.Scroll: _scrolledEventHandler?.Invoke(this, eventArg); break; - case GestureType.Zoom: _twoFingerZoomedEventHandler?.Invoke(this, eventArg); break; - case GestureType.Click: _clickedEventHandler?.Invoke(this, eventArg); break; - case GestureType.DoubleClick: _doubleClickedEventHandler?.Invoke(this, eventArg); break; - case GestureType.TwoFingerClick: _twoFingerClickedEventHandler?.Invoke(this, eventArg); break; - case GestureType.Rotation: _twoFingerRotatedEventHandler?.Invoke(this, eventArg); break; - case GestureType.LongPress: _longPressedEventHandler?.Invoke(this, eventArg); break; - } - }; - handle.SetEventCb(Interop.ViewEventType.Gesture, _gestureEventCallback, IntPtr.Zero); - Log.Info(string.Format("Gesture event callback is set")); - } - } - - private void UnsetGestureEventCallback() - { - if (_scrolledEventHandler != null || _twoFingerZoomedEventHandler != null - || _clickedEventHandler != null || _doubleClickedEventHandler != null - || _twoFingerClickedEventHandler != null || _twoFingerRotatedEventHandler != null - || _longPressedEventHandler != null) - { - return; - } - - handle.UnsetEventCb(Interop.ViewEventType.Gesture); - _gestureEventCallback = null; - Log.Info(string.Format("Gesture event callback is unset")); - } - - private void SetObjectEventCallback() - { - if (_objectEventCallback == null) - { - _objectEventCallback = (type, eventData, userData) => - { - if (type != Interop.ViewEventType.Object) return; - var eventArg = new Interop.ObjectEventDataHandle(eventData); - switch (eventArg.GestureType) - { - case Interop.ViewGesture.Click: - { - var mapObject = _handleToObjectTable[eventArg.ViewObject]; - mapObject?.HandleClickedEvent(); - break; - } - } - }; - handle.SetEventCb(Interop.ViewEventType.Object, _objectEventCallback, IntPtr.Zero); - Log.Info(string.Format("Object event callback is set")); - } - } - - private void SetViewReadyEventCallback() - { - if (_viewReadyEventCallback == null) - { - _viewReadyEventCallback = (type, eventData, userData) => - { - _viewReadyEventHandler?.Invoke(this, EventArgs.Empty); - }; - handle.SetEventCb(Interop.ViewEventType.Ready, _viewReadyEventCallback, IntPtr.Zero); - Log.Info(string.Format("ViewReady event callback is set")); - } - } - - private void UnsetViewReadyEventCallback() - { - if (_viewReadyEventHandler == null) - { - handle.UnsetEventCb(Interop.ViewEventType.Ready); - _viewReadyEventCallback = null; - Log.Info(string.Format("ViewReady event callback is unset")); - } - } - - #region IDisposable Support - private bool _disposedValue = false; - - protected virtual void Dispose(bool disposing) - { - if (!_disposedValue) - { - if (disposing) - { - _service.Dispose(); - } - handle.Dispose(); - _disposedValue = true; - } - } - - /// - /// Releases all the resources used by this object. - /// - /// 3 - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - #endregion - } -} diff --git a/src/Tizen.Maps/Tizen.Maps/Marker.cs b/src/Tizen.Maps/Tizen.Maps/Marker.cs deleted file mode 100755 index 45f6c1143..000000000 --- a/src/Tizen.Maps/Tizen.Maps/Marker.cs +++ /dev/null @@ -1,266 +0,0 @@ -/* - * 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 ElmSharp; - -namespace Tizen.Maps -{ - /// - /// The marker map object. - /// - /// 3 - public class Marker : MapObject, IDisposable - { - internal Interop.MarkerHandle handle; - - internal Marker(Geocoordinates coordinates, string imagePath, Interop.ViewMarkerType type) - { - var err = Interop.ErrorCode.InvalidParameter; - if (coordinates == null || imagePath == null) - { - err.ThrowIfFailed("given coordinates or imagePath is null"); - } - handle = new Interop.MarkerHandle(coordinates.handle, imagePath, type); - } - - /// - /// Gets or sets the clicked event handlers. - /// - /// 3 - public event EventHandler Clicked; - - /// - /// Gets or sets the marker's visibility. - /// - /// 3 - public override bool IsVisible - { - get - { - return handle.IsVisible; - } - set - { - handle.IsVisible = value; - } - } - - /// - /// Gets or sets the geographical coordinates for this marker. - /// - /// 3 - public Geocoordinates Coordinates - { - get - { - return new Geocoordinates(handle.Coordinates); - } - set - { - handle.Coordinates = value.handle; - - // Marker takes ownership of the native handle. - value.handle.HasOwnership = false; - } - } - - /// - /// Gets or sets a string representing the image file path for this marker. - /// - /// 3 - public string ImagePath - { - get - { - return handle.ImageFile; - } - set - { - handle.ImageFile = value; - } - } - - /// - /// Gets or sets the screen size for this marker. - /// - /// 3 - public Size MarkerSize - { - get - { - return handle.MarkerSize; - } - set - { - handle.MarkerSize = value; - } - } - - /// - /// Gets or sets the z-order for this marker. - /// - /// 3 - /// The integer value is 0 by default, and must be in the range of -100 to 100. - public int ZOrder - { - get - { - return handle.ZOrder; - } - set - { - handle.ZOrder = value; - } - } - - /// - /// Changes the marker size. - /// - /// 3 - /// New size. - public void Resize(Size newSize) - { - MarkerSize = newSize; - } - - /// - /// Changes the marker coordinates. - /// - /// 3 - /// New position for the marker. - public void Move(Geocoordinates newPosition) - { - Coordinates = newPosition; - } - - internal override void HandleClickedEvent() - { - Clicked?.Invoke(this, EventArgs.Empty); - } - - internal override void InvalidateMapObject() - { - handle = null; - } - - internal override Interop.ViewObjectHandle GetHandle() - { - return handle; - } - - #region IDisposable Support - private bool _disposedValue = false; - - protected virtual void Dispose(bool disposing) - { - if (!_disposedValue) - { - handle.Dispose(); - _disposedValue = true; - } - } - - /// - /// Releases all the resources used by this object. - /// - /// 3 - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - - - #endregion - } - - /// - /// Pin type the marker map object. - /// - /// 3 - public class Pin : Marker - { - private const string defaultImagePath = "/usr/share/dotnet.tizen/framework/res/maps_marker_pin_48.png"; - - /// - /// Creates a pin type marker. - /// - /// 3 - /// Marker coordinates. - /// Thrown when input coordinates are invalid. - public Pin(Geocoordinates coordinates) - : base(coordinates, defaultImagePath, Interop.ViewMarkerType.Pin) - { - } - - /// - /// Creates a pin type marker. - /// - /// 3 - /// Marker coordinates. - /// Image file path for the Marker. - /// - /// http://tizen.org/privilege/mediastorage is needed if the file path is relevant to media storage. - /// http://tizen.org/privilege/externalstorage is needed if the file path is relevant to external storage. - /// - /// Thrown when the required feature is not supported. - /// Thrown when application does not have some privilege to access this method. - /// Thrown when the input coordinates or imagePath is invalid. - public Pin(Geocoordinates coordinates, string imagePath) - : base(coordinates, imagePath, Interop.ViewMarkerType.Pin) - { - } - } - - /// - /// Sticker type marker map object. - /// - /// 3 - public class Sticker : Marker - { - private const string defaultImagePath = "/usr/share/dotnet.tizen/framework/res/maps_marker_sticker_48.png"; - - /// - /// Creates a sticker type marker. - /// - /// 3 - /// Marker coordinates. - /// Thrown when input coordinates are invalid. - public Sticker(Geocoordinates coordinates) - : base(coordinates, defaultImagePath, Interop.ViewMarkerType.Sticker) - { - } - - /// - /// Creates a sticker type marker. - /// - /// 3 - /// Marker coordinates. - /// Image file path for Marker. - /// - /// http://tizen.org/privilege/mediastorage is needed if the input or output path are relevant to media storage. - /// http://tizen.org/privilege/externalstorage is needed if the input or output path are relevant to external storage. - /// - /// Thrown when the required feature is not supported. - /// Thrown when application does not have some privilege to access this method. - /// Thrown when the input coordinates or imagePath is invalid. - public Sticker(Geocoordinates coordinates, string imagePath) - : base(coordinates, imagePath, Interop.ViewMarkerType.Sticker) - { - } - } -} diff --git a/src/Tizen.Maps/Tizen.Maps/MultiReverseGeocodeRequest.cs b/src/Tizen.Maps/Tizen.Maps/MultiReverseGeocodeRequest.cs deleted file mode 100755 index ac1a58d5d..000000000 --- a/src/Tizen.Maps/Tizen.Maps/MultiReverseGeocodeRequest.cs +++ /dev/null @@ -1,67 +0,0 @@ -/* - * 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.Collections.Generic; - -namespace Tizen.Maps -{ - /// - /// Multiple reverse geocode request for Tizen map service. - /// - /// 3 - public class MultiReverseGeocodeRequest : MapServiceRequest - { - private Interop.MultiReverseGeocodeCallback _geocodeCallback; - private List _addressesList = new List(); - - internal MultiReverseGeocodeRequest(MapService service, IEnumerable coordinates) : base(service, ServiceRequestType.ReverseGeocode) - { - // The Maps Service invokes this callback once when gets the response from map service provider - // The value of total is same with requested coordinates list size. Even though one of address is not provided valid address handle is retrieved. - _geocodeCallback = (result, id, total, handle, userData) => - { - errorCode = result; - if (result.IsSuccess()) - { - var addressListHandle = new Interop.AddressListHandle(handle, needToRelease: true); - var addressList = new PlaceAddressList(addressListHandle); - _addressesList = addressList.Addresses as List; - _requestTask?.TrySetResult(_addressesList); - return true; - } - else - { - _requestTask?.TrySetException(errorCode.GetException(errMessage)); - return false; - } - }; - - var coordinateList = new GeocoordinatesList(coordinates); - startExecutionAction = new Action(() => - { - int requestID; - errMessage = "Failed to get address list for given co-ordinate list"; - errorCode = _service.handle.MultiReverseGeocode(coordinateList.handle, _service.Preferences.handle, _geocodeCallback, IntPtr.Zero, out requestID); - if (errorCode.IsFailed() && errorCode != Interop.ErrorCode.Canceled) - { - _requestTask?.TrySetException(errorCode.GetException(errMessage)); - } - _requestID = requestID; - }); - } - } -} diff --git a/src/Tizen.Maps/Tizen.Maps/NamespaceDoc.cs b/src/Tizen.Maps/Tizen.Maps/NamespaceDoc.cs deleted file mode 100755 index ff35212f7..000000000 --- a/src/Tizen.Maps/Tizen.Maps/NamespaceDoc.cs +++ /dev/null @@ -1,132 +0,0 @@ -/** - -The Tizen.Maps namespace provides classes to get the information of Place, Geocoding, Route by querying, -or to show them on the map view with interactive gestural interface. - - - - - - -

Overview

- -Maps API provides a developer with a set of functions, helping to create Maps aware applications.

- -Maps API comprises of following features:
-- Geocoding and reverse Geocoding
-- Discoverying Place information
-- Calculating Route
-- View - - - - -Maps API allows a Developer to choose one of Map Providers which are being included as plugins.

- - -

Geocoding

-The Maps Geocoding API allows translating an address to its geographical -location defined in terms of latitude and longitude; the input can be a -qualified and structured address or a free-formed search text with full or -partial address information.

- -The example below shows a structured address:
- - housenumber=117,
- - street=Invaliden street
- - city=Berlin,
- - postalcode=10115,
- - country=Germany,
- - state=Berlin - - - - -

Reverse Geocoding

-The Maps Reverse Geocoding API allows to inverse translating a geographical -location (longitude, latitude) to an address; it can be used to answer the -question "Where am I?". -
- - - -

Route

-The Maps Route API provides ways to calculate a route that defines a path -between a start and a destination and may, optionally, pass through specific -intermediate locations.

- -Route Preferences:
- - Travel Mode (car, pedestrian, public transit, truck),
- - Optimization (fastest, shortest),
- - Avoid/Prefer Preferences (toll road, motorway, ferry, public transit, - tunnel, dirt road, parks, car-pool lane).
- - Route Calculations
- - Way points and preferences as input values,
- - Route geometry and maneuver (instructions for guidance) as result values: - Geometry consists of points that visually represent the determined route, - Maneuver contains turn-by-turn instruction and position. - - - - -

Places

-The Maps Place API allows you to find place information.

- -Place search
- - Depending on the location context, the number of relevant places might - be large. Therefore this query may not only return places, but also - suggestions for additional filter criteria that allow users to interactively - refine the classes of places they are interested in.
- - Nearby Search: search for places within a specified area. - You can refine your search request by supplying keywords, Name of Points - of Interests, or Proximity.
- - Category Search: search for popular places for the given location context and matching the category filter criteria. - You can refine your search request by specifying the categories of place you are searching for.
-Result item type of searching
- - ID, name, location, distance, URI, rating, category.
-Place information allows to fetch details about a place. The following place content is supported:
- - Base Attribute includes name, location, categories, contacts, ID, ratings, icon path, - image content, review content, and editorial content.
- - Extended Attribute refers to opening hours, payment methods, annual closings, disabled access. - - - - -

View

-The Maps View API provides a developer with a set of functions, bringing -basic interactive visual user interface in maps applications.

- -View widget: Drawing a map image on the map port, the specified rectangular -area of the maps application GUI.

- -Zoom and rotation: Changing zoom and orientation of the view in response -to user gestures, such as scrolling, tapping, zooming, rotating, etc.

- -Conversion of screen coordinates to geographical and vice versa.

- -User's gesture support:
- - Receive the event of the user gesture.
- - Enable or disable the specified gesture.
- - Re-assign the action, which should be taken in response to the user's gesture.

- -Various Properties:
- - Visibility and size on the screen.
- - Theme: Day, satellite, or terrain.
- - Language: English, Russian, Chinese, Italian, German, Spanish, etc. - - - - - -

Related Features

- -To guarantee that the Maps application runs on a device with Maps profile feature, -declare the following feature requirements in the config file:
-http://tizen.org/feature/maps
-http://tizen.org/feature/internet -
- -
-*/ - -namespace Tizen.Maps {} - diff --git a/src/Tizen.Maps/Tizen.Maps/Overlay.cs b/src/Tizen.Maps/Tizen.Maps/Overlay.cs deleted file mode 100755 index d84e8a06c..000000000 --- a/src/Tizen.Maps/Tizen.Maps/Overlay.cs +++ /dev/null @@ -1,191 +0,0 @@ -/* - * 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 EvasObject = ElmSharp.EvasObject; - -namespace Tizen.Maps -{ - /// - /// Overlay map object. - /// - /// 3 - public class Overlay : MapObject, IDisposable - { - internal Interop.OverlayHandle handle; - - /// - /// Creates a normal overlay map object. - /// - /// 3 - /// - /// - /// Thrown when the input coordinates or objectToContain are invalid. - public Overlay(Geocoordinates coordinates, EvasObject objectToContain) - : this(coordinates, objectToContain, Interop.ViewOverlayType.Normal) - { - } - - internal Overlay(Geocoordinates coordinates, EvasObject objectToContain, Interop.ViewOverlayType type) - { - var err = Interop.ErrorCode.InvalidParameter; - if (coordinates == null || objectToContain == null) - { - err.ThrowIfFailed("given coordinates or parent evas object is null"); - } - handle = new Interop.OverlayHandle(coordinates.handle, objectToContain, type); - } - - /// - /// Gets or sets the visibility of an overlay map object. - /// - /// 3 - public override bool IsVisible - { - get { return handle.IsVisible; } - set { handle.IsVisible = value; } - } - - /// - /// Gets or sets geographical coordinates for an overlay map object. - /// - /// 3 - public Geocoordinates Coordinates - { - get - { - return new Geocoordinates(handle.Coordinates); - } - set - { - // Overlay takes ownership of the native handle. - handle.Coordinates = value.handle; - value.handle.HasOwnership = false; - } - } - - /// - /// Gets or sets minimum zoom level for an overlay map object. - /// - /// 3 - public int MinimumZoomLevel - { - get - { - return handle.MinZoomLevel; - } - set - { - handle.MinZoomLevel = value; - } - } - - /// - /// Gets or sets maximum zoom lever for an overlay map object. - /// - /// 3 - public int MaximumZoomLevel - { - get - { - return handle.MaxZoomLevel; - } - set - { - handle.MaxZoomLevel = value; - } - } - - // Overlay object does not support click events - internal override void HandleClickedEvent() - { - throw new NotSupportedException("Overlay object does not support click events"); - } - - internal override void InvalidateMapObject() - { - handle = null; - } - - internal override Interop.ViewObjectHandle GetHandle() - { - return handle; - } - - #region IDisposable Support - private bool _disposedValue = false; - - protected virtual void Dispose(bool disposing) - { - if (!_disposedValue) - { - handle.Dispose(); - _disposedValue = true; - } - } - - /// - /// Releases all the resources used by this object. - /// - /// 3 - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - #endregion - } - - /// - /// The bubble overlay map object. - /// - /// 3 - public class BubbleOverlay : Overlay - { - /// - /// Creates a bubble overlay. - /// - /// 3 - /// The geographical coordinates to be pointed. - /// The EvasObject to be shown. - /// Thrown when the required feature is not supported. - /// Thrown when the input coordinates or objectToContain are invalid. - public BubbleOverlay(Geocoordinates coordinates, EvasObject objectToContain) - : base(coordinates, objectToContain, Interop.ViewOverlayType.Bubble) - { - } - } - - /// - /// The box overlay map object. - /// - /// 3 - public class BoxOverlay : Overlay - { - /// - /// Creates a box overlay. - /// - /// 3 - /// The geographical coordinates to be pointed. - /// The EvasObject to be shown. - /// Thrown when the required feature is not supported. - /// Thrown when the input coordinates or objectToContain are invalid - public BoxOverlay(Geocoordinates coordinates, EvasObject objectToContain) - : base(coordinates, objectToContain, Interop.ViewOverlayType.Box) - { - } - } -} diff --git a/src/Tizen.Maps/Tizen.Maps/Place.cs b/src/Tizen.Maps/Tizen.Maps/Place.cs deleted file mode 100755 index d9a7dfb6c..000000000 --- a/src/Tizen.Maps/Tizen.Maps/Place.cs +++ /dev/null @@ -1,264 +0,0 @@ -/* - * 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.Collections.Generic; - -namespace Tizen.Maps -{ - /// - /// Place information, used in place discovery and search requests. - /// - /// 3 - public class Place : IDisposable - { - internal Interop.PlaceHandle handle; - - internal Place(Interop.PlaceHandle nativeHandle) - { - handle = nativeHandle; - } - - /// - /// Gets an ID string for the place. - /// - /// 3 - public string Id - { - get - { - return handle.Id; - } - } - - /// - /// Gets name string for the place. - /// - /// 3 - public string Name - { - get - { - return handle.Name; - } - } - - /// - /// Gets a view URI for the place. - /// - /// 3 - public string Uri - { - get - { - return handle.Uri; - } - } - - /// - /// Gets a distance for the place from the center. - /// - /// 3 - public int Distance - { - get - { - return handle.Distance; - } - } - - /// - /// Gets a geographical location for the place. - /// - /// 3 - public Geocoordinates Coordinates - { - get - { - return new Geocoordinates(handle.Coordinates); - } - } - - /// - /// Gets an address for the place. - /// - /// 3 - public PlaceAddress Address - { - get - { - return new PlaceAddress(handle.Address); - } - } - - /// - /// Gets a rating for the place. - /// - /// 3 - public PlaceRating Rating - { - get - { - return new PlaceRating(handle.Rating); - } - } - - /// - /// Gets a supplier link for the place. - /// - /// 3 - public PlaceLink Supplier - { - get - { - return new PlaceLink(handle.Supplier); - } - } - - /// - /// Gets a related link for the place. - /// - /// 3 - public PlaceLink Related - { - get - { - return new PlaceLink(handle.Related); - } - } - - /// - /// Gets all the properties attached to this place. - /// - /// 3 - public IDictionary Properties - { - get - { - var properties = new Dictionary(); - handle.ForeachProperty((key, value) => properties[key] = value); - return properties; - } - } - - /// - /// Gets all the categories attached to this place. - /// - /// 3 - public IEnumerable Categories - { - get - { - var categories = new List(); - handle.ForeachCategory((categoryHandle) => categories.Add(new PlaceCategory(categoryHandle))); - return categories; - } - } - - /// - /// Gets all the attributes attached to this place. - /// - /// 3 - public IEnumerable Attributes - { - get - { - var attributes = new List(); - handle.ForeachAttribute((attributeHandle) => attributes.Add(new PlaceAttribute(attributeHandle))); - return attributes; - } - } - - /// - /// Gets all the contacts attached to this place. - /// - /// 3 - public IEnumerable Contacts - { - get - { - var contacts = new List(); - handle.ForeachContact((contactHandle) => contacts.Add(new PlaceContact(contactHandle))); - return contacts; - } - } - - /// - /// Gets all the editorials attached to this place. - /// - /// 3 - public IEnumerable Editorials - { - get - { - var editorials = new List(); - handle.ForeachEditorial((editorialHandle) => editorials.Add(new PlaceEditorial(editorialHandle))); - return editorials; - } - } - - /// - /// Gets all the images attached to this place. - /// - /// 3 - public IEnumerable Images - { - get - { - var images = new List(); - handle.ForeachImage((imageHandle) => images.Add(new PlaceImage(imageHandle))); - return images; - } - } - - /// - /// Gets all the reviews attached to this place. - /// - /// 3 - public IEnumerable Reviews - { - get - { - var reviews = new List(); - handle.ForeachReview((reviewHandle) => reviews.Add(new PlaceReview(reviewHandle))); - return reviews; - } - } - - #region IDisposable Support - private bool _disposedValue = false; - - protected virtual void Dispose(bool disposing) - { - if (!_disposedValue) - { - handle.Dispose(); - _disposedValue = true; - } - } - - /// - /// Releases all the resources used by this object. - /// - /// 3 - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - #endregion - } -} diff --git a/src/Tizen.Maps/Tizen.Maps/PlaceAddress.cs b/src/Tizen.Maps/Tizen.Maps/PlaceAddress.cs deleted file mode 100755 index a51c37ee2..000000000 --- a/src/Tizen.Maps/Tizen.Maps/PlaceAddress.cs +++ /dev/null @@ -1,252 +0,0 @@ -/* - * 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.ComponentModel; - -namespace Tizen.Maps -{ - /// - /// Address information for the map point used in geocode and reverse geocode requests. - /// - /// 3 - public class PlaceAddress : IDisposable - { - internal Interop.AddressHandle handle; - - /// - /// Constructs a map address object. - /// - /// 3 - /// Thrown when native operation failed to allocate memory. - public PlaceAddress() - { - handle = new Interop.AddressHandle(); - } - - internal PlaceAddress(Interop.AddressHandle nativeHandle) - { - handle = nativeHandle; - } - - /// - /// Gets a building number for this address. - /// - /// 3 - public string Building - { - get - { - return handle.Building; - } - set - { - handle.Building = value; - } - } - - /// - /// Gets a city name for this address. - /// - /// 3 - public string City - { - get - { - return handle.City; - } - set - { - handle.City = value; - } - } - - /// - /// Gets a country name for this address. - /// - /// 3 - public string Country - { - get - { - return handle.Country; - } - set - { - handle.Country = value; - } - } - - /// - /// Gets a country code for this address. - /// - /// 3 - public string CountryCode - { - get - { - return handle.CountryCode; - } - set - { - handle.CountryCode = value; - } - } - - /// - /// Gets a county for this address. - /// - /// 3 - public string County - { - get - { - return handle.County; - } - set - { - handle.County = value; - } - } - - /// - /// Gets a district name for this address. - /// - /// 3 - public string District - { - get - { - return handle.District; - } - set - { - handle.District = value; - } - } - - /// - /// Gets a free text associated with this address. - /// - /// 3 - public string FreeText - { - get - { - return handle.FreeText; - } - set - { - handle.FreeText = value; - } - } - - [EditorBrowsableAttribute(EditorBrowsableState.Never)] - [Obsolete("Freetext is deprecated. Please use FreeText instead.")] - public string Freetext - { - get - { - return FreeText; - } - set - { - FreeText = value; - } - } - - /// - /// Gets a postal code for this address. - /// - /// 3 - public string PostalCode - { - get - { - return handle.PostalCode; - } - set - { - handle.PostalCode = value; - } - } - - /// - /// Gets a state name for this address. - /// - /// 3 - public string State - { - get - { - return handle.State; - } - set - { - handle.State = value; - } - } - - /// - /// Gets a street name for this address. - /// - /// 3 - public string Street - { - get - { - return handle.Street; - } - set - { - handle.Street = value; - } - } - - /// - /// Returns a string that represents this object. - /// - /// 3 - /// Returns a string which presents this object. - public override string ToString() - { - return $"{FreeText}"; - } - - #region IDisposable Support - private bool _disposedValue = false; - - protected virtual void Dispose(bool disposing) - { - if (!_disposedValue) - { - handle.Dispose(); - _disposedValue = true; - } - } - - /// - /// Releases all the resources used by this object. - /// - /// 3 - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - #endregion - } -} diff --git a/src/Tizen.Maps/Tizen.Maps/PlaceAddressList.cs b/src/Tizen.Maps/Tizen.Maps/PlaceAddressList.cs deleted file mode 100755 index c09ef3cd2..000000000 --- a/src/Tizen.Maps/Tizen.Maps/PlaceAddressList.cs +++ /dev/null @@ -1,84 +0,0 @@ -/* - * 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.Collections.Generic; - -namespace Tizen.Maps -{ - /// - /// List of objects to be used in APIs. - /// - internal class PlaceAddressList : IDisposable - { - internal Interop.AddressListHandle handle; - private List _list; - - /// - /// Constructs a map address list object. - /// - /// Thrown when the required feature is not supported. - /// Thrown when native operation failed to allocate memory. - public PlaceAddressList() - { - handle = new Interop.AddressListHandle(); - } - - internal PlaceAddressList(Interop.AddressListHandle nativeHandle) - { - handle = nativeHandle; - } - - /// - /// Gets an iterator for addresses in this list. - /// - public IEnumerable Addresses - { - get - { - if (_list == null) - { - _list = new List(); - handle.Foreach(addressHandle => _list.Add(new PlaceAddress(addressHandle))); - } - return _list; - } - } - - #region IDisposable Support - private bool _disposedValue = false; - - protected virtual void Dispose(bool disposing) - { - if (!_disposedValue) - { - handle.Dispose(); - _disposedValue = true; - } - } - - /// - /// Releases all the resources used by this object. - /// - /// 3 - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - #endregion - } -} diff --git a/src/Tizen.Maps/Tizen.Maps/PlaceAttribute.cs b/src/Tizen.Maps/Tizen.Maps/PlaceAttribute.cs deleted file mode 100755 index ac6f7e2e0..000000000 --- a/src/Tizen.Maps/Tizen.Maps/PlaceAttribute.cs +++ /dev/null @@ -1,71 +0,0 @@ -/* - * 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.Maps -{ - /// - /// Place attributes information, used in place discovery and search requests. - /// - /// 3 - public class PlaceAttribute - { - private string _id; - private string _label; - private string _text; - - internal PlaceAttribute(Interop.PlaceAttributeHandle nativeHandle) - { - _id = nativeHandle.Id; - _label = nativeHandle.Label; - _text = nativeHandle.Text; - } - - internal PlaceAttribute(IntPtr nativeHandle, bool needToRelease) - : this(new Interop.PlaceAttributeHandle(nativeHandle, needToRelease)) - { - } - - /// - /// Gets an ID for the place attribute. - /// - /// 3 - public string Id { get { return _id; } } - - /// - /// Gets a label for the place attribute. - /// - /// 3 - public string Label { get { return _label; } } - - /// - /// Gets a text for the place attribute. - /// - /// 3 - public string Text { get { return _text; } } - - /// - /// Returns a string that represents this object. - /// - /// 3 - /// Returns a string which presents this object. - public override string ToString() - { - return $"{Label}: {Text}"; - } - } -} diff --git a/src/Tizen.Maps/Tizen.Maps/PlaceCategory.cs b/src/Tizen.Maps/Tizen.Maps/PlaceCategory.cs deleted file mode 100755 index 30133974b..000000000 --- a/src/Tizen.Maps/Tizen.Maps/PlaceCategory.cs +++ /dev/null @@ -1,108 +0,0 @@ -/* - * 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.Maps -{ - /// - /// Place category information, used in place discovery and search requests. - /// - /// 3 - public class PlaceCategory : IDisposable - { - internal Interop.PlaceCategoryHandle handle; - - /// - /// Constructs a search category object. - /// - /// 3 - /// Thrown when native operation failed to allocate memory. - public PlaceCategory() - { - handle = new Interop.PlaceCategoryHandle(); - } - - internal PlaceCategory(Interop.PlaceCategoryHandle nativeHandle) - { - handle = nativeHandle; - } - - - /// - /// Gets or sets an ID for this category. - /// - /// 3 - public string Id - { - get { return handle.Id; } - set { handle.Id = value; } - } - - /// - /// Gets or sets a name for this category. - /// - /// 3 - public string Name - { - get { return handle.Name; } - set { handle.Name = value; } - } - - /// - /// Gets or sets a URL for this category. - /// - /// 3 - public string Url - { - get { return handle.Url; } - set { handle.Url = value; } - } - - /// - /// Returns a string that represents this object. - /// - /// 3 - /// Returns a string which presents this object. - public override string ToString() - { - return $"{Name}"; - } - - #region IDisposable Support - private bool _disposedValue = false; - - protected virtual void Dispose(bool disposing) - { - if (!_disposedValue) - { - handle.Dispose(); - _disposedValue = true; - } - } - - /// - /// Releases all the resources used by this object. - /// - /// 3 - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - #endregion - } -} diff --git a/src/Tizen.Maps/Tizen.Maps/PlaceContact.cs b/src/Tizen.Maps/Tizen.Maps/PlaceContact.cs deleted file mode 100755 index 5cccc5ffe..000000000 --- a/src/Tizen.Maps/Tizen.Maps/PlaceContact.cs +++ /dev/null @@ -1,71 +0,0 @@ -/* - * 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.Maps -{ - /// - /// Place contact information, used in place discovery and search requests. - /// - /// 3 - public class PlaceContact - { - private string _label; - private string _type; - private string _value; - - internal PlaceContact(Interop.PlaceContactHandle handle) - { - _label = handle.Label; - _type = handle.Type; - _value = handle.Value; - } - - internal PlaceContact(IntPtr nativeHandle, bool needToRelease) : this(new Interop.PlaceContactHandle(nativeHandle, needToRelease)) - { - } - - /// - /// Gets an ID for this place contact. - /// - /// 3 - public string Id { get { return _type; } } - - /// - /// Gets a label for this place contact. - /// - /// 3 - public string Label { get { return _label; } } - - /// - /// Gets a value for this place contact. - /// - /// 3 - public string Value { get { return _value; } } - - /// - /// Returns a string that represents this object. - /// - /// 3 - /// Returns a string which presents this object. - public override string ToString() - { - return $"{Label}: {Value}"; - } - } -} diff --git a/src/Tizen.Maps/Tizen.Maps/PlaceEditorial.cs b/src/Tizen.Maps/Tizen.Maps/PlaceEditorial.cs deleted file mode 100755 index d206b9300..000000000 --- a/src/Tizen.Maps/Tizen.Maps/PlaceEditorial.cs +++ /dev/null @@ -1,70 +0,0 @@ -/* - * 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.Maps -{ - /// - /// Place editorial information, used in place discovery and search requests. - /// - /// 3 - public class PlaceEditorial - { - private string _description; - private string _language; - private PlaceMedia _media; - - internal PlaceEditorial(Interop.PlaceEditorialHandle handle) - { - _description = handle.Description; - _language = handle.Language; - _media = new PlaceMedia(handle.Media); - } - - internal PlaceEditorial(IntPtr nativeHandle, bool needToRelease) : this(new Interop.PlaceEditorialHandle(nativeHandle, needToRelease)) - { - } - - /// - /// Gets a description for this place editorial. - /// - /// 3 - public string Description { get { return _description; } } - - /// - /// Gets a language for this place editorial. - /// - /// 3 - public string Language { get { return _language; } } - - /// - /// Gets an instance of object which representing media for this place editorial. - /// - /// 3 - public PlaceMedia Media { get { return _media; } } - - /// - /// Returns a string that represents this object. - /// - /// 3 - /// Returns a string which presents this object. - public override string ToString() - { - return $"{Description}"; - } - } -} diff --git a/src/Tizen.Maps/Tizen.Maps/PlaceFilter.cs b/src/Tizen.Maps/Tizen.Maps/PlaceFilter.cs deleted file mode 100755 index 591bd16d6..000000000 --- a/src/Tizen.Maps/Tizen.Maps/PlaceFilter.cs +++ /dev/null @@ -1,135 +0,0 @@ -/* - * 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.Maps -{ - /// - /// Place filter information, used in place discovery and search requests. - /// - /// 3 - public class PlaceFilter : IDisposable - { - internal Interop.PlaceFilterHandle handle; - - /// - /// Constructs a new place filter. - /// - /// 3 - /// Thrown when native operation failed to allocate memory. - public PlaceFilter() - { - handle = new Interop.PlaceFilterHandle(); - } - - /// - /// Gets or sets a free-formed address string for this place filter. - /// - /// 3 - /// Depending on maps provider which the application has selected, - /// it may treat , and - /// as the same kind of strings to search places. - public string Address - { - get - { - return handle.PlaceAddress; - } - set - { - handle.PlaceAddress = value; - } - } - - /// - /// Gets or sets an instance of object for this place filter. - /// - /// 3 - public PlaceCategory Category - { - get - { - return new PlaceCategory(handle.Category); - } - set - { - handle.Category = value.handle; - } - } - - /// - /// Gets or sets a keyword for this place filter. - /// - /// 3 - /// Depending on maps provider which the application has selected, - /// it may treat , and - /// as the same kind of strings to search places. - public string Keyword - { - get - { - return handle.Keyword; - } - set - { - handle.Keyword = value; - } - } - - /// - /// Gets or sets a name for this place filter. - /// - /// 3 - /// Depending on maps provider which the application has selected, - /// it may treat , and - /// as the same kind of strings to search places. - public string Name - { - get - { - return handle.PlaceName; - } - set - { - handle.PlaceName = value; - } - } - - #region IDisposable Support - private bool _disposedValue = false; - - protected virtual void Dispose(bool disposing) - { - if (!_disposedValue) - { - handle.Dispose(); - _disposedValue = true; - } - } - - /// - /// Releases all the resources used by this object. - /// - /// 3 - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - #endregion - } -} diff --git a/src/Tizen.Maps/Tizen.Maps/PlaceImage.cs b/src/Tizen.Maps/Tizen.Maps/PlaceImage.cs deleted file mode 100755 index 4d35d33a1..000000000 --- a/src/Tizen.Maps/Tizen.Maps/PlaceImage.cs +++ /dev/null @@ -1,80 +0,0 @@ -/* - * 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.Maps -{ - /// - /// Place image information, used in place discovery and search requests. - /// - /// 3 - public class PlaceImage - { - private string _id; - private string _url; - private int _width; - private int _height; - private PlaceLink _userLink; - private PlaceMedia _media; - - internal PlaceImage(Interop.PlaceImageHandle handle) - { - _id = handle.Id; - _url = handle.Url; - _width = handle.Width; - _height = handle.Height; - _userLink = new PlaceLink(handle.User); - _media = new PlaceMedia(handle.Media); - } - - /// - /// Gets an ID for this place image. - /// - /// 3 - public string Id { get { return _id; } } - - /// - /// Gets an URL for this place image. - /// - /// 3 - public string Url { get { return _url; } } - - /// - /// Gets the width for this place image. - /// - /// 3 - public int Width { get { return _width; } } - - /// - /// Gets the height for this place image. - /// - /// 3 - public int Height { get { return _height; } } - - /// - /// Gets an object representing the user link for this place image. - /// - /// 3 - public PlaceLink UserLink { get { return _userLink; } } - - /// - /// Gets an object representing the image media for this place image. - /// - /// 3 - public PlaceMedia ImageMedia { get { return _media; } } - } -} diff --git a/src/Tizen.Maps/Tizen.Maps/PlaceLink.cs b/src/Tizen.Maps/Tizen.Maps/PlaceLink.cs deleted file mode 100755 index b81622df7..000000000 --- a/src/Tizen.Maps/Tizen.Maps/PlaceLink.cs +++ /dev/null @@ -1,65 +0,0 @@ -/* - * 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.Maps -{ - /// - /// Place link object information, used in place discovery and search requests. - /// - /// 3 - public class PlaceLink - { - private string _id; - private string _name; - private string _link; - private string _type; - - internal PlaceLink(Interop.PlaceLinkObjectHandle handle) - { - _id = handle.Id; - _name = handle.Name; - _link = handle.Link; - _type = handle.Type; - } - - /// - /// Gets a string representing the ID for this place link. - /// - /// 3 - public string Id { get { return _id; } } - - /// - /// Gets a string representing the name for this place link. - /// - /// 3 - public string Name { get { return _name; } } - - /// - /// Gets a string representing the link for this place link. - /// - /// 3 - public string Link { get { return _link; } } - - /// - /// Gets a string representing the type for this place link. - /// - /// 3 - public string Type { get { return _type; } } - } -} diff --git a/src/Tizen.Maps/Tizen.Maps/PlaceList.cs b/src/Tizen.Maps/Tizen.Maps/PlaceList.cs deleted file mode 100755 index 6c9cc634a..000000000 --- a/src/Tizen.Maps/Tizen.Maps/PlaceList.cs +++ /dev/null @@ -1,74 +0,0 @@ -/* - * 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.Collections.Generic; - -namespace Tizen.Maps -{ - /// - /// List of objects to be used in APIs. - /// - internal class PlaceList : IDisposable - { - internal Interop.PlaceListHandle handle; - private List _list; - - internal PlaceList(Interop.PlaceListHandle nativeHandle) - { - handle = nativeHandle; - } - - /// - /// Gets an iterator for the addresses in this list. - /// - public IEnumerable Places - { - get - { - if (_list == null) - { - _list = new List(); - handle.Foreach(placeHandle => _list.Add(new Place(placeHandle))); - } - return _list; - } - } - - #region IDisposable Support - private bool _disposedValue = false; - - protected virtual void Dispose(bool disposing) - { - if (!_disposedValue) - { - handle.Dispose(); - _disposedValue = true; - } - } - - /// - /// Releases all the resources used by this object. - /// - /// 3 - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - #endregion - } -} diff --git a/src/Tizen.Maps/Tizen.Maps/PlaceMedia.cs b/src/Tizen.Maps/Tizen.Maps/PlaceMedia.cs deleted file mode 100755 index d1111f5da..000000000 --- a/src/Tizen.Maps/Tizen.Maps/PlaceMedia.cs +++ /dev/null @@ -1,56 +0,0 @@ -/* - * 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.Maps -{ - /// - /// Place media information, used in place discovery and search requests. - /// - /// 3 - public class PlaceMedia - { - private string _attribution; - private PlaceLink _supplier; - private PlaceLink _via; - - internal PlaceMedia(Interop.PlaceMediaHandle handle) - { - _attribution = handle.Attribution; - _supplier = new PlaceLink(handle.Supplier); - _via = new PlaceLink(handle.Via); - } - - /// - /// Gets a string representing the attribution for this place media. - /// - /// 3 - public string Attribution { get { return _attribution; } } - - /// - /// Gets an instance of object representing the supplier for this place media. - /// - /// 3 - public PlaceLink Supplier { get { return _supplier; } } - - /// - /// Gets an instance of object representing via data for this place media. - /// - /// 3 - public PlaceLink Via { get { return _via; } } - } -} diff --git a/src/Tizen.Maps/Tizen.Maps/PlaceRating.cs b/src/Tizen.Maps/Tizen.Maps/PlaceRating.cs deleted file mode 100755 index 0b37e232a..000000000 --- a/src/Tizen.Maps/Tizen.Maps/PlaceRating.cs +++ /dev/null @@ -1,58 +0,0 @@ -/* - * 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.Maps -{ - /// - /// Place rating information, used in place discovery and search requests. - /// - /// 3 - public class PlaceRating - { - private int _count; - private double _average; - - internal PlaceRating(Interop.PlaceRatingHandle handle) - { - _count = handle.Count; - _average = handle.Average; - } - - /// - /// Gets the number of users rated for this place rating. - /// - /// 3 - public int UserCount { get { return _count; } } - - /// - /// Gets the average value of this place rating. - /// - /// 3 - public double Average { get { return _average; } } - - /// - /// Returns a string that represents this object. - /// - /// 3 - /// Returns a string which presents this object. - public override string ToString() - { - return $"{Average}({UserCount} reviews)"; - } - } -} diff --git a/src/Tizen.Maps/Tizen.Maps/PlaceReview.cs b/src/Tizen.Maps/Tizen.Maps/PlaceReview.cs deleted file mode 100755 index 7431fe5fa..000000000 --- a/src/Tizen.Maps/Tizen.Maps/PlaceReview.cs +++ /dev/null @@ -1,93 +0,0 @@ -/* - * 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.Maps -{ - /// - /// Place review information, used in place discovery and search requests. - /// - /// 3 - public class PlaceReview - { - private DateTime _date; - private string _title; - private double _rating; - private string _description; - private string _language; - private PlaceMedia _media; - private PlaceLink _userLink; - - internal PlaceReview(Interop.PlaceReviewHandle handle) - { - string date = handle.Date; - if (DateTime.TryParse(date, out _date) == false) - { - Interop.ErrorCode.InvalidParameter.WarnIfFailed($"Wrong date format: {date}"); - } - - _title = handle.Title; - _rating = handle.Rating; - _description = handle.Description; - _language = handle.Language; - _media = new PlaceMedia(handle.Media); - _userLink = new PlaceLink(handle.User); - } - - /// - /// Gets an instance of object representing the time of this review. - /// - /// 3 - public DateTime Date { get { return _date; } } - - /// - /// Gets a string representing the title of this review. - /// - /// 3 - public string Title { get { return _title; } } - - /// - /// Gets a value representing the rating of this review. - /// - /// 3 - public double Rating { get { return _rating; } } - - /// - /// Gets a string representing the description of this review. - /// - /// 3 - public string Description { get { return _description; } } - - /// - /// Gets a string representing the language of this review. - /// - /// 3 - public string Language { get { return _language; } } - - /// - /// Gets an instance of object representing the review media of this review. - /// - /// 3 - public PlaceMedia ReviewMedia { get { return _media; } } - - /// - /// Gets an instance of object representing the user link of this review. - /// - /// 3 - public PlaceLink UserLink { get { return _userLink; } } - } -} diff --git a/src/Tizen.Maps/Tizen.Maps/PlaceSearchRequest.cs b/src/Tizen.Maps/Tizen.Maps/PlaceSearchRequest.cs deleted file mode 100755 index c4550b65f..000000000 --- a/src/Tizen.Maps/Tizen.Maps/PlaceSearchRequest.cs +++ /dev/null @@ -1,102 +0,0 @@ -/* - * 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.Collections.Generic; - -namespace Tizen.Maps -{ - /// - /// Place search request for Tizen map service. - /// - /// 3 - public class PlaceSearchRequest : MapServiceRequest - { - private Interop.SearchPlaceCallback _placeCallback; - private List _placeList = new List(); - - internal PlaceSearchRequest(MapService service, Geocoordinates position, int distance) : this(service, ServiceRequestType.SearchPlace) - { - startExecutionAction = new Action(() => - { - int requestID; - errMessage = $"Failed to get place list for given co-ordinate {position} and distance {distance}"; - errorCode = _service.handle.SearchPlace(position.handle, distance, _service.PlaceSearchFilter.handle, _service.Preferences.handle, _placeCallback, IntPtr.Zero, out requestID); - if (errorCode.IsFailed() && errorCode != Interop.ErrorCode.Canceled) - { - _requestTask?.TrySetException(errorCode.GetException(errMessage)); - } - _requestID = requestID; - }); - } - - internal PlaceSearchRequest(MapService service, Area boundary) : this(service, ServiceRequestType.SearchPlaceByArea) - { - startExecutionAction = new Action(() => - { - int requestID; - errMessage = $"Failed to get place list for given boundary"; - errorCode = _service.handle.SearchPlaceByArea(boundary.handle, _service.PlaceSearchFilter.handle, _service.Preferences.handle, _placeCallback, IntPtr.Zero, out requestID); - if (errorCode.IsFailed() && errorCode != Interop.ErrorCode.Canceled) - { - _requestTask?.TrySetException(errorCode.GetException(errMessage)); - } - _requestID = requestID; - }); - } - - internal PlaceSearchRequest(MapService service, string address, Area boundary) : this(service, ServiceRequestType.SearchPlaceByAddress) - { - startExecutionAction = new Action(() => - { - int requestID; - errMessage = $"Failed to get coordinates for address {address} in given boundary"; - errorCode = _service.handle.SearchPlaceByAddress(address, boundary.handle, _service.PlaceSearchFilter.handle, _service.Preferences.handle, _placeCallback, IntPtr.Zero, out requestID); - if (errorCode.IsFailed() && errorCode != Interop.ErrorCode.Canceled) - { - _requestTask?.TrySetException(errorCode.GetException(errMessage)); - } - _requestID = requestID; - }); - } - - private PlaceSearchRequest(MapService service, ServiceRequestType type) : base(service, type) - { - // The Maps Service invokes this callback while iterating through the set of obtained Place data. - _placeCallback = (result, id, index, total, place, userData) => - { - errorCode = result; - if (result.IsSuccess()) - { - // The parameter place must be released using maps_place_destroy(). - var placeHandle = new Interop.PlaceHandle(place, needToRelease: true); - _placeList.Add(new Place(placeHandle)); - if (_placeList.Count == total) - { - _requestTask?.TrySetResult(_placeList); - } - return true; - } - else - { - // If search is failed, the value of total is 0 and place is NULL - _requestTask?.TrySetException(errorCode.GetException(errMessage)); - return false; - } - }; - } - } -} diff --git a/src/Tizen.Maps/Tizen.Maps/Polygon.cs b/src/Tizen.Maps/Tizen.Maps/Polygon.cs deleted file mode 100755 index d0d97b583..000000000 --- a/src/Tizen.Maps/Tizen.Maps/Polygon.cs +++ /dev/null @@ -1,154 +0,0 @@ -/* - * 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.Collections.Generic; -using System.Linq; - -using Color = ElmSharp.Color; - -namespace Tizen.Maps -{ - /// - /// The polygon map object. - /// - /// 3 - public class Polygon : MapObject, IDisposable - { - internal Interop.PolygonHandle handle; - private List _coordinateList; - - /// - /// Creates a polygon visual object. - /// - /// 3 - /// List of geographical coordinates. - /// Background color. - /// Thrown when input values are invalid. - public Polygon(IEnumerable coordinates, Color color) : base() - { - var err = Interop.ErrorCode.InvalidParameter; - if (coordinates == null || coordinates.Count() < 3) - { - err.ThrowIfFailed("given coordinates list should contain at least 3 coordinates"); - } - _coordinateList = coordinates.ToList(); - var geocoordinateList = new GeocoordinatesList(_coordinateList, false); - handle = new Interop.PolygonHandle(geocoordinateList.handle, color); - } - - /// - /// Adds or removes the clicked event handlers. - /// - /// 3 - public event EventHandler Clicked; - - /// - /// Gets or sets visibility for the polygon. - /// - /// 3 - public override bool IsVisible - { - get { return handle.IsVisible; } - set { handle.IsVisible = value; } - } - - /// - /// Gets or sets a list of geographical coordinates for polygon vertices. - /// - /// 3 - public IEnumerable Coordinates - { - get - { - return _coordinateList; - } - set - { - var coordinates = value.ToList(); - var err = Interop.ErrorCode.InvalidParameter; - if (coordinates == null || coordinates.Count() < 3) - { - err.ThrowIfFailed("given coordinates list should contain at least 3 coordinates"); - } - - var geocoordinateList = new GeocoordinatesList(coordinates, false); - if (handle.SetPolygon(geocoordinateList.handle).IsSuccess()) - { - _coordinateList = coordinates; - } - } - } - - /// - /// Gets or sets a background color to fill the polygon. - /// - /// 3 - public Color FillColor - { - get - { - return handle.FillColor; - } - set - { - handle.FillColor = value; - } - } - - internal override void HandleClickedEvent() - { - Clicked?.Invoke(this, EventArgs.Empty); - } - - internal override void InvalidateMapObject() - { - handle = null; - } - - internal override Interop.ViewObjectHandle GetHandle() - { - return handle; - } - - #region IDisposable Support - private bool _disposedValue = false; - - protected virtual void Dispose(bool disposing) - { - if (!_disposedValue) - { - if (disposing) - { - _coordinateList.Clear(); - } - handle.Dispose(); - _disposedValue = true; - } - } - - /// - /// Releases all the resources used by this object. - /// - /// 3 - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - #endregion - } -} diff --git a/src/Tizen.Maps/Tizen.Maps/Polyline.cs b/src/Tizen.Maps/Tizen.Maps/Polyline.cs deleted file mode 100755 index 75424805f..000000000 --- a/src/Tizen.Maps/Tizen.Maps/Polyline.cs +++ /dev/null @@ -1,171 +0,0 @@ -/* - * 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.Collections.Generic; -using System.Linq; - -using Color = ElmSharp.Color; - -namespace Tizen.Maps -{ - /// - /// The polyline map object. - /// - /// 3 - public class Polyline : MapObject, IDisposable - { - internal Interop.PolylineHandle handle; - private List _coordinateList; - - /// - /// Creates polyline visual object. - /// - /// 3 - /// List of geographical coordinates. - /// Line color. - /// The width of line [1 ~ 100] (pixels). - /// Thrown when input values are invalid. - public Polyline(List coordinates, Color color, int width) : base() - { - var err = Interop.ErrorCode.InvalidParameter; - if (coordinates == null || coordinates.Count() < 2) - { - err.ThrowIfFailed("given coordinates list should contain at least 2 coordinates"); - } - _coordinateList = coordinates.ToList(); - var geocoordinateList = new GeocoordinatesList(_coordinateList); - handle = new Interop.PolylineHandle(geocoordinateList.handle, color, width); - } - - /// - /// Adds or removes the clicked event handlers. - /// - /// 3 - public event EventHandler Clicked; - - /// - /// Gets or sets the visibility for polyline. - /// - /// 3 - public override bool IsVisible - { - get { return handle.IsVisible; } - set { handle.IsVisible = value; } - } - - /// - /// Gets or sets a list of geographical coordinates for polyline vertices. - /// - /// 3 - public IEnumerable Coordinates - { - get - { - return _coordinateList; - } - set - { - var coordinates = value.ToList(); - var err = Interop.ErrorCode.InvalidParameter; - if (coordinates == null || coordinates.Count() < 2) - { - err.ThrowIfFailed("given coordinates list should contain at least 2 coordinates"); - } - - var geocoordinateList = new GeocoordinatesList(coordinates, false); - if (handle.SetPolyline(geocoordinateList.handle).IsSuccess()) - { - _coordinateList = coordinates; - } - } - } - - /// - /// Gets or sets the line color. - /// - /// 3 - public Color LineColor - { - get - { - return handle.LineColor; - } - set - { - handle.LineColor = value; - } - } - - /// - /// Gets or sets the line width from 1 to 100 pixels. - /// - /// 3 - public int Width - { - get - { - return handle.LineWidth; - } - set - { - handle.LineWidth = value; - } - } - - internal override void HandleClickedEvent() - { - Clicked?.Invoke(this, EventArgs.Empty); - } - - internal override void InvalidateMapObject() - { - handle = null; - } - - internal override Interop.ViewObjectHandle GetHandle() - { - return handle; - } - - #region IDisposable Support - private bool _disposedValue = false; - - protected virtual void Dispose(bool disposing) - { - if (!_disposedValue) - { - if (disposing) - { - _coordinateList.Clear(); - } - handle.Dispose(); - _disposedValue = true; - } - } - - /// - /// Releases all the resources used by this object. - /// - /// 3 - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - #endregion - } -} diff --git a/src/Tizen.Maps/Tizen.Maps/ReverseGeocodeRequest.cs b/src/Tizen.Maps/Tizen.Maps/ReverseGeocodeRequest.cs deleted file mode 100755 index 985372be4..000000000 --- a/src/Tizen.Maps/Tizen.Maps/ReverseGeocodeRequest.cs +++ /dev/null @@ -1,67 +0,0 @@ -/* - * 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.Collections.Generic; - -namespace Tizen.Maps -{ - /// - /// Reverses the geocode request for a map service. - /// - /// 3 - public class ReverseGeocodeRequest : MapServiceRequest - { - private Interop.ReverseGeocodeCallback _geocodeCallback; - private List _addressList = new List(); - - internal ReverseGeocodeRequest(MapService service, double latitude, double longitute) : base(service, ServiceRequestType.ReverseGeocode) - { - // The Maps Service invokes this callback when the address is obtained from the specified coordinates. - _geocodeCallback = (result, id, index, total, address, userData) => - { - errorCode = result; - if (result.IsSuccess()) - { - // The parameter address must be released using maps_address_destroy(). - var addressHandle = new Interop.AddressHandle(address, needToRelease: true); - _addressList.Add(new PlaceAddress(addressHandle)); - if (_addressList.Count == total) - { - _requestTask?.TrySetResult(_addressList); - } - } - else - { - // If search is failed, the value of total is 0 and address is NULL - _requestTask?.TrySetException(errorCode.GetException(errMessage)); - } - }; - - startExecutionAction = new Action(() => - { - int requestID; - errMessage = $"Failed to get coordinates for given coordinates: {latitude}:{longitute}"; - errorCode = _service.handle.ReverseGeocode(latitude, longitute, _service.Preferences.handle, _geocodeCallback, IntPtr.Zero, out requestID); - if (errorCode.IsFailed() && errorCode != Interop.ErrorCode.Canceled) - { - _requestTask?.TrySetException(errorCode.GetException(errMessage)); - } - _requestID = requestID; - }); - } - } -} diff --git a/src/Tizen.Maps/Tizen.Maps/Route.cs b/src/Tizen.Maps/Tizen.Maps/Route.cs deleted file mode 100755 index 618872b60..000000000 --- a/src/Tizen.Maps/Tizen.Maps/Route.cs +++ /dev/null @@ -1,182 +0,0 @@ -/* - * 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.Collections.Generic; - -namespace Tizen.Maps -{ - /// - /// Route information, used in Route Search requests. - /// - /// 3 - public class Route : IDisposable - { - internal Interop.RouteHandle handle; - - internal Route(Interop.RouteHandle nativeHandle) - { - handle = nativeHandle; - } - - /// - /// Gets an instance of object representing destination coordinates for this route. - /// - /// 3 - public Geocoordinates Destination - { - get - { - return new Geocoordinates(handle.Destination); - } - } - - /// - /// Gets the total distance for this route. - /// - /// 3 - public double Distance - { - get - { - return handle.Distance; - } - } - - /// - /// Get the total duration to cover this route. - /// - /// 3 - public double Duration - { - get - { - return handle.Duration; - } - } - - /// - /// Gets an ID for this route. - /// - /// 3 - public string Id - { - get - { - return handle.Id; - } - } - - /// - /// Gets the transport mode for this route. - /// - /// 3 - public TransportMode Mode - { - get - { - return (TransportMode)handle.TransportMode; - } - } - - /// - /// Gets the origin coordinates for this route. - /// - /// 3 - public Geocoordinates Origin - { - get - { - return new Geocoordinates(handle.Origin); - } - } - - /// - /// Gets a coordinates list for this route. - /// - /// 3 - public IEnumerable Path - { - get - { - var path = new List(); - handle.ForeachPath(coordinateHandle => path.Add(new Geocoordinates(coordinateHandle))); - return path; - } - } - - /// - /// Gets a segment list for this route. - /// - /// 3 - public IEnumerable Segments - { - get - { - var segments = new List(); - handle.ForeachSegment(segmentHandle => segments.Add(new RouteSegment(segmentHandle))); - return segments; - } - } - - /// - /// Gets the distance unit for this route. - /// - /// 3 - public DistanceUnit Unit - { - get - { - return (DistanceUnit)handle.Unit; - } - } - - /// - /// Gets an instance of object which representing bounding area for this route. - /// - private Area BoundingBox - { - get - { - return new Area(handle.BoundingBox); - } - } - - #region IDisposable Support - private bool _disposedValue = false; - - protected virtual void Dispose(bool disposing) - { - if (!_disposedValue) - { - handle.Dispose(); - _disposedValue = true; - } - } - - /// - /// Releases all the resources used by this object. - /// - /// 3 - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - #endregion - } -} diff --git a/src/Tizen.Maps/Tizen.Maps/RouteFeature.cs b/src/Tizen.Maps/Tizen.Maps/RouteFeature.cs deleted file mode 100755 index 063f28e4a..000000000 --- a/src/Tizen.Maps/Tizen.Maps/RouteFeature.cs +++ /dev/null @@ -1,70 +0,0 @@ -/* - * 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. - */ - -namespace Tizen.Maps -{ - /// - /// Route features used for route search requests. - /// - /// 3 - public enum RouteFeature - { - /// - /// Indicates no route features are selected. - /// - None = Interop.RouteRequestFeature.None, - /// - /// Indicates toll roads (toll gates/booths). - /// - Toll = Interop.RouteRequestFeature.Toll, - /// - /// Indicates a motorway. - /// - Motorway = Interop.RouteRequestFeature.MotorWay, - /// - /// Indicates a boat ferry. - /// - BoatFerry = Interop.RouteRequestFeature.BoatFerry, - /// - /// Indicates a rail (train) ferry. - /// - RailFerry = Interop.RouteRequestFeature.RailFerry, - /// - /// Indicates a public transport. - /// - PublicTransit = Interop.RouteRequestFeature.PublicTransit, - /// - /// Indicates a tunnel. - /// - Tunnel = Interop.RouteRequestFeature.Tunnel, - /// - /// Indicates a dirt road. - /// - DirtRoad = Interop.RouteRequestFeature.DirtRoad, - /// - /// Indicates a park. - /// - Parks = Interop.RouteRequestFeature.Parks, - /// - /// Indicates a high-occupancy vehicle lane. - /// - Hovlane = Interop.RouteRequestFeature.Hovlane, - /// - /// Indicates stairs. - /// - Stairs = Interop.RouteRequestFeature.Stairs, - } -} diff --git a/src/Tizen.Maps/Tizen.Maps/RouteFeatureWeight.cs b/src/Tizen.Maps/Tizen.Maps/RouteFeatureWeight.cs deleted file mode 100755 index 513d4f723..000000000 --- a/src/Tizen.Maps/Tizen.Maps/RouteFeatureWeight.cs +++ /dev/null @@ -1,46 +0,0 @@ -/* - * 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. - */ - -namespace Tizen.Maps -{ - /// - /// Route feature weights used in route search requests. - /// - /// 3 - public enum RouteFeatureWeight - { - /// - /// Indicates normal weighting. - /// - Normal = Interop.RouteFeatureWeight.Normal, - /// - /// Indicates that a feature is preferred. - /// - Prefer = Interop.RouteFeatureWeight.Prefer, - /// - /// Indicates that a feature is to be avoided. - /// - Avoid = Interop.RouteFeatureWeight.Avoid, - /// - /// Indicates that soft-exclude applies to the feature. - /// - SoftExclude = Interop.RouteFeatureWeight.SoftExclude, - /// - /// Indicates that the feature is to be strictly excluded. - /// - StrictExclude = Interop.RouteFeatureWeight.StrictExclude, - } -} diff --git a/src/Tizen.Maps/Tizen.Maps/RouteManeuver.cs b/src/Tizen.Maps/Tizen.Maps/RouteManeuver.cs deleted file mode 100755 index d6befd8a2..000000000 --- a/src/Tizen.Maps/Tizen.Maps/RouteManeuver.cs +++ /dev/null @@ -1,96 +0,0 @@ -/* - * 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.Maps -{ - /// - /// Route maneuver information used in route search requests. - /// - /// 3 - public class RouteManeuver - { - private Interop.RouteDirection _direction; - private Interop.RouteTurnType _turntype; - private Geocoordinates _coordinates; - private string _road; - private string _instruction; - private string _locale; - private int _timeToNextInstruction; - private double _distanceToNextInstruction; - - internal RouteManeuver(Interop.RouteManeuverHandle handle) - { - _direction = handle.Direction; - _turntype = handle.TurnType; - _coordinates = new Geocoordinates(handle.Coordinates); - _road = handle.RoadName; - _instruction = handle.Instruction; - _locale = handle.Locale; - _timeToNextInstruction = handle.TimeToNextInstruction; - _distanceToNextInstruction = handle.DistanceToNextInstruction; - } - - /// - /// Gets the direction type for this maneuver. - /// - /// 3 - public DirectionType Direction { get { return (DirectionType)_direction; } } - - /// - /// Gets the turn type for this maneuver. - /// - /// 3 - public TurnInstruction Turn { get { return (TurnInstruction)_turntype; } } - - /// - /// Gets a geographical coordinates position for this maneuver. - /// - /// 3 - public Geocoordinates Position { get { return _coordinates; } } - - /// - /// Gets a name of the road for this maneuver. - /// - /// 3 - public string Road { get { return _road; } } - - /// - /// Gets an instruction text for this maneuver. - /// - /// 3 - public string Instruction { get { return _instruction; } } - - /// - /// Gets a locale for this maneuver. - /// - /// 3 - public string Locale { get { return _locale; } } - - /// - /// Gets the time to next instruction for this maneuver. - /// - /// 3 - public int TimeToNextInstruction { get { return _timeToNextInstruction; } } - - /// - /// Gets the distance to next instruction for this maneuver. - /// - /// 3 - public double DistanceToNextInstruction { get { return _distanceToNextInstruction; } } - } -} diff --git a/src/Tizen.Maps/Tizen.Maps/RouteOptimization.cs b/src/Tizen.Maps/Tizen.Maps/RouteOptimization.cs deleted file mode 100755 index 87d77d942..000000000 --- a/src/Tizen.Maps/Tizen.Maps/RouteOptimization.cs +++ /dev/null @@ -1,53 +0,0 @@ -/* - * 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. - */ - -namespace Tizen.Maps -{ - /// - /// Allowed route optimization option used in route search requests. - /// - /// 3 - /// - /// Depending on the loaded maps plug-in using , some features might have no effect or differences with the descriptions. - /// - public enum RouteOptimization - { - /// - /// Indicates searching for the fastest routes. - /// - Fastest = Interop.RouteOptimization.Fastest, - /// - /// Indicates searching for the shortest routes (car mode only). - /// - Shortest = Interop.RouteOptimization.Shortest, - /// - /// Indicates searching for the most economic routes (car mode only). - /// - Economic = Interop.RouteOptimization.Economic, - /// - /// Indicates searching for the most scenic routes. - /// - Scenic = Interop.RouteOptimization.Scenic, - /// - /// Indicates searching for most the fastest routes now, based on the current traffic condition. - /// - FastestNow = Interop.RouteOptimization.FastestNow, - /// - /// Indicates searching for the direct drive routes. - /// - DirectDrive = Interop.RouteOptimization.DirectDrive, - } -} diff --git a/src/Tizen.Maps/Tizen.Maps/RouteSearchRequest.cs b/src/Tizen.Maps/Tizen.Maps/RouteSearchRequest.cs deleted file mode 100755 index 3f4187923..000000000 --- a/src/Tizen.Maps/Tizen.Maps/RouteSearchRequest.cs +++ /dev/null @@ -1,123 +0,0 @@ -/* - * 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.Collections.Generic; -using System.Linq; - -namespace Tizen.Maps -{ - /// - /// Routes the search request for Tizen map service requests. - /// - /// 3 - public class RouteSearchRequest : MapServiceRequest - { - private Interop.SearchRouteCallback _routeCallback; - private List _routeList = new List(); - - private Geocoordinates _to; - private Geocoordinates _from; - private List _waypoints = new List(); - - internal RouteSearchRequest(MapService service, Geocoordinates from, Geocoordinates to) : this(service, ServiceRequestType.SearchRoute) - { - _to = to; - _from = from; - startExecutionAction = new Action(() => - { - int requestID; - errMessage = $"Failed to get route list for given origin {_from} and destination {_to}"; - if (_waypoints?.Count == 0) - { - _type = ServiceRequestType.SearchRoute; - errorCode = _service.handle.SearchRoute(_from.handle, _to.handle, _service.Preferences.handle, _routeCallback, IntPtr.Zero, out requestID); - if (errorCode.IsFailed() && errorCode != Interop.ErrorCode.Canceled) - { - _requestTask?.TrySetException(errorCode.GetException(errMessage)); - } - } - else - { - _type = ServiceRequestType.SearchRouteWithWaypoints; - - var waypoints = GetCoordinateListForWaypoints(); - errorCode = _service.handle.SearchRouteWaypoints(waypoints, waypoints.Length, _service.Preferences.handle, _routeCallback, IntPtr.Zero, out requestID); - if (errorCode.IsFailed() && errorCode != Interop.ErrorCode.Canceled) - { - _requestTask?.TrySetException(errorCode.GetException(errMessage)); - } - } - _requestID = requestID; - }); - } - - - private RouteSearchRequest(MapService service, ServiceRequestType type) : base(service, type) - { - // The Maps Service invokes this callback while iterating through the set of obtained Routes. - _routeCallback = (result, id, index, total, route, userData) => - { - errorCode = result; - if (result.IsSuccess()) - { - // The parameter route must be released using maps_route_destroy(). - var routeHandle = new Interop.RouteHandle(route, needToRelease: true); - _routeList.Add(new Route(routeHandle)); - if (_routeList.Count == total) - { - _requestTask?.TrySetResult(_routeList); - } - return true; - } - else - { - // If search is failed, the value of total is 0 and route is NULL. - _requestTask?.TrySetException(errorCode.GetException(errMessage)); - return false; - } - }; - } - - /// - /// Gets or sets a list of way-points to cover between the origin and destination. - /// - /// 3 - public IEnumerable Waypoints - { - get - { - return _waypoints; - } - set - { - _waypoints = value.ToList(); - } - } - - private IntPtr[] GetCoordinateListForWaypoints() - { - var waypoints = new IntPtr[_waypoints.Count + 2]; - waypoints[0] = _from.handle; - for (int i = 0; i < _waypoints.Count; ++i) - { - waypoints[i + 1] = _waypoints[i].handle; - } - waypoints[waypoints.Length - 1] = _to.handle; - return waypoints; - } - } -} diff --git a/src/Tizen.Maps/Tizen.Maps/RouteSegment.cs b/src/Tizen.Maps/Tizen.Maps/RouteSegment.cs deleted file mode 100755 index f2257a119..000000000 --- a/src/Tizen.Maps/Tizen.Maps/RouteSegment.cs +++ /dev/null @@ -1,88 +0,0 @@ -/* - * 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.Collections.Generic; - -namespace Tizen.Maps -{ - /// - /// Place Segment information used in Route Search requests. - /// - /// 3 - public class RouteSegment - { - private Geocoordinates _origin; - private Geocoordinates _destination; - private double _distance; - private double _duration; - private Area _boundingBox; - - private List _maneuvers = new List(); - private List _path = new List(); - - internal RouteSegment(Interop.RouteSegmentHandle handle) - { - _origin = new Geocoordinates(handle.Origin); - _destination = new Geocoordinates(handle.Destination); - _distance = handle.Distance; - _duration = handle.Duration; - _boundingBox = new Area(handle.BoundingBox); - - handle.ForeachManeuver(maneuverHandle => _maneuvers.Add(new RouteManeuver(maneuverHandle))); - handle.ForeachPath(pathHandle => _path.Add(new Geocoordinates(pathHandle))); - } - - /// - /// Gets the origin coordinates for this segment. - /// - /// 3 - public Geocoordinates Origin { get { return _origin; } } - - /// - /// Gets the destination coordinates for this segment. - /// - /// 3 - public Geocoordinates Destination { get { return _destination; } } - - /// - /// Gets the total distance for this segment. - /// - /// 3 - public double Distance { get { return _distance; } } - - /// - /// Gets the total duration to cover this segment. - /// - /// 3 - public double Duration { get { return _duration; } } - - /// - /// Gets the maneuver list for this segment. - /// - /// 3 - public IEnumerable Maneuvers { get { return _maneuvers; } } - - /// - /// Gets the coordinates list for this segment. - /// - /// 3 - public IEnumerable Path { get { return _path; } } - - private Area BoundingBox { get { return _boundingBox; } } - } -} diff --git a/src/Tizen.Maps/Tizen.Maps/SearchPreference.cs b/src/Tizen.Maps/Tizen.Maps/SearchPreference.cs deleted file mode 100755 index 3ab84d4aa..000000000 --- a/src/Tizen.Maps/Tizen.Maps/SearchPreference.cs +++ /dev/null @@ -1,254 +0,0 @@ -/* - * 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.Collections.Generic; - -namespace Tizen.Maps -{ - /// - /// Preferences for route search requests. - /// - /// 3 - public class SearchPreference : IGeocodePreference, IPlaceSearchPreference, IRouteSearchPreference, IDisposable - { - internal Interop.PreferenceHandle handle; - private IDictionary _properties = new Dictionary(); - - /// - /// Constructor for a new search preference. - /// - /// 3 - public SearchPreference() - { - handle = new Interop.PreferenceHandle(); - } - - /// - /// Constructor for a new search preference. - /// - internal SearchPreference(Interop.PreferenceHandle nativeHandle) - { - handle = nativeHandle; - } - - /// - /// Gets or sets a preferred language. - /// - /// 3 - /// Language should be specified as an ISO 3166 alpha-2 two letter country-code - /// followed by ISO 639-1 for the two-letter language code.
e.g. "ko-KR", "en-US".
- public string Language - { - get - { - return handle.Language; - } - set - { - Log.Info(string.Format("Language is changed from {0} to {1}", handle.Language, value)); - handle.Language = value; - } - } - - /// - /// Gets or sets the maximum result count for each service request. - /// - /// 3 - /// Setting negative value will not have any effect on MaxResults value. - public int MaxResults - { - get - { - return handle.MaxResult; - } - set - { - Log.Info(string.Format("MaxResult is changed from {0} to {1}", handle.MaxResult, value)); - handle.MaxResult = value; - } - } - - /// - /// Gets or sets the distance unit. - /// - /// 3 - public DistanceUnit Unit - { - get - { - return (DistanceUnit)handle.Unit; - } - set - { - Log.Info(string.Format("Unit is changed from {0} to {1}", handle.Unit, value)); - handle.Unit = (Interop.DistanceUnit)value; - } - } - - /// - /// Gets or sets the preferred country. - /// - /// 3 - public string CountryCode - { - get - { - return handle.CountryCode; - } - set - { - Log.Info(string.Format("CountryCode is changed from {0} to {1}", handle.CountryCode, value)); - handle.CountryCode = value; - } - } - - /// - /// Gets or sets the search properties as a key value pair. - /// - /// 3 - public IReadOnlyDictionary Properties - { - get - { - Action action = (key, value) => - { - _properties[key] = value; - }; - - handle.ForeachProperty(action); - return (IReadOnlyDictionary)_properties; - } - set - { - foreach (var prop in value) - { - _properties[prop.Key] = prop.Value; - handle.SetProperty(prop.Key, prop.Value); - Log.Info(string.Format("Properties is changed to [{0}, {1}]", prop.Key, prop.Value)); - } - } - } - - /// - /// Gets or sets the route optimization. - /// - /// 3 - public RouteOptimization Optimization - { - get - { - return (RouteOptimization)handle.Optimization; - } - set - { - Log.Info(string.Format("Optimization is changed from {0} to {1}", handle.Optimization, value)); - handle.Optimization = (Interop.RouteOptimization)value; - } - } - - /// - /// Gets or sets the route transport mode. - /// - /// 3 - public TransportMode Mode - { - get - { - return (TransportMode)handle.TransportMode; - } - set - { - Log.Info(string.Format("TransportMode is changed from {0} to {1}", handle.TransportMode, value)); - handle.TransportMode = (Interop.RouteTransportMode)value; - } - } - - /// - /// Gets or sets the route feature weight. - /// - /// 3 - public RouteFeatureWeight RouteFeatureWeight - { - get - { - return (RouteFeatureWeight)handle.FeatureWeight; - } - set - { - Log.Info(string.Format("RouteFeatureWeight is changed from {0} to {1}", handle.FeatureWeight, value)); - handle.FeatureWeight = (Interop.RouteFeatureWeight)value; - } - } - - /// - /// Gets or sets the route feature. - /// - /// 3 - public RouteFeature RouteFeature - { - get - { - return (RouteFeature)handle.Feature; - } - set - { - Log.Info(string.Format("RouteFeature is changed from {0} to {1}", handle.Feature, value)); - handle.Feature = (Interop.RouteRequestFeature)value; - } - } - - /// - /// Gets or sets if the searching for alternative routes is enabled. - /// - /// 3 - public bool SearchAlternativeRoutes - { - get - { - return handle.AlternativesEnabled; - } - set - { - Log.Info(string.Format("SearchAlternativeRoutes is {0}", (value ? "enabled" : "disabled"))); - handle.AlternativesEnabled = value; - } - } - - #region IDisposable Support - private bool _disposedValue = false; - - protected virtual void Dispose(bool disposing) - { - if (!_disposedValue) - { - handle.Dispose(); - _disposedValue = true; - } - } - - /// - /// Releases all the resources used by this object. - /// - /// 3 - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - #endregion - } -} diff --git a/src/Tizen.Maps/Tizen.Maps/ServiceData.cs b/src/Tizen.Maps/Tizen.Maps/ServiceData.cs deleted file mode 100755 index 7772c840a..000000000 --- a/src/Tizen.Maps/Tizen.Maps/ServiceData.cs +++ /dev/null @@ -1,96 +0,0 @@ -/* - * 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. - */ - -namespace Tizen.Maps -{ - /// - /// Features available in the map service. - /// - /// 3 - public enum ServiceData - { - /// - /// Indicates availability of address value in the place data. - /// - PlaceAddress = Interop.ServiceData.PlaceAddress, - /// - /// Indicates availability of rating value in the place data. - /// - PlaceRating = Interop.ServiceData.PlaceRating, - /// - /// Indicates availability of place category list in the place data. - /// - PlaceCategories = Interop.ServiceData.PlaceCategories, - /// - /// Indicates availability of place attribute list in the place data. - /// - PlaceAttributes = Interop.ServiceData.PlaceAttributes, - /// - /// Indicates availability of place contact list in the place data. - /// - PlaceContacts = Interop.ServiceData.PlaceContacts, - /// - /// Indicates availability of place editorial list in the place data. - /// - PlaceEditorials = Interop.ServiceData.PlaceEditorials, - /// - /// Indicates availability of place review list in the place data. - /// - PlaceReviews = Interop.ServiceData.PlaceReviews, - /// - /// Indicates availability of place image in the place data. - /// - PlaceImage = Interop.ServiceData.PlaceImage, - /// - /// Indicates availability of place supplier link value in the place data. - /// - PlaceSupplier = Interop.ServiceData.PlaceSupplier, - /// - /// Indicates availability of a related place link in the place data. - /// - PlaceRelated = Interop.ServiceData.PlaceRelated, - - /// - /// Indicates that the route data structure is defined as a path (a list of geographical coordinates). - /// - RoutePath = Interop.ServiceData.RoutePath, - /// - /// Indicates that the route data structure is defined as a list of segments while each segment is defined as a path. - /// - RouteSegmentsPath = Interop.ServiceData.RouteSegmentsPath, - /// - /// Indicates that the route data structure is defined as a list of segments while each segment is defined as a list of maneuvers. - /// - RouteSegmentsManeuvers = Interop.ServiceData.RouteSegmentsManeuvers, - - /// - /// Indicates availability of traffic information on the map. - /// - ViewTraffic = Interop.ServiceData.ViewTraffic, - /// - /// Indicates availability of public transit information on the map. - /// - ViewPublicTransit = Interop.ServiceData.ViewPublicTransit, - /// - /// Indicates availability of 3D building drawable on the map. - /// - ViewBuilding = Interop.ServiceData.ViewBuilding, - /// - /// Indicates availability of scale bar on the map. - /// - ViewScaleBar = Interop.ServiceData.ViewScaleBar, - } -} diff --git a/src/Tizen.Maps/Tizen.Maps/ServiceRequestType.cs b/src/Tizen.Maps/Tizen.Maps/ServiceRequestType.cs deleted file mode 100755 index 782447177..000000000 --- a/src/Tizen.Maps/Tizen.Maps/ServiceRequestType.cs +++ /dev/null @@ -1,85 +0,0 @@ -/* - * 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. - */ - -namespace Tizen.Maps -{ - /// - /// Service requests available in the maps service. - /// - /// 3 - public enum ServiceRequestType - { - /// - /// Indicates the service request to get position for a given free-formed address string is allowed. - /// - Geocode = Interop.ServiceType.Geocode, - /// - /// Indicates that service request to get position for a given address, within the specified bounding , is allowed. - /// - GeocodeInsideArea = Interop.ServiceType.GeocodeInsideArea, - /// - /// Indicates that service request to get position for a given is allowed. - /// - GeocodeByStructuredAddress = Interop.ServiceType.GeocodeByStructuredAddress, - /// - /// Indicates that service request to get for a given is allowed. - /// - ReverseGeocode = Interop.ServiceType.ReverseGeocode, - /// - /// Indicates that service request to get for a given is allowed. - /// - MultiReverseGeocode = Interop.ServiceType.MultiReverseGeocode, - - /// - /// Indicates that service request to query information for a given is allowed. - /// - SearchPlace = Interop.ServiceType.SearchPlace, - /// - /// Indicates that service request to query information for a given is allowed. - /// - SearchPlaceByArea = Interop.ServiceType.SearchPlaceByArea, - /// - /// Indicates that service request to query information for a given free-formed address string is allowed. - /// - SearchPlaceByAddress = Interop.ServiceType.SearchPlaceByAddress, - /// - /// Indicates that service request to query information list for all places in a given is allowed. - /// - SearchPlaceList = Interop.ServiceType.SearchPlaceList, - /// - /// Indicates that service request to get detailed information for a given is allowed. - /// - SearchGetPlaceDetails = Interop.ServiceType.SearchGetPlaceDetails, - - /// - /// Indicates that service request to query information from a given origin and destination is allowed. - /// - SearchRoute = Interop.ServiceType.SearchRoute, - /// - /// Indicates that service request to query information passing through specified way-points is allowed. - /// - SearchRouteWithWaypoints = Interop.ServiceType.SearchRouteWaypoints, - - /// - /// Indicates that map view service is allowed. - /// - View = Interop.ServiceType.View, - /// - /// Indicates that map view snapshot service is allowed. - /// - ViewSnapshot = Interop.ServiceType.ViewSnapshot, - } -} diff --git a/src/Tizen.Maps/Tizen.Maps/SnapshotType.cs b/src/Tizen.Maps/Tizen.Maps/SnapshotType.cs deleted file mode 100755 index dd3fdd0d4..000000000 --- a/src/Tizen.Maps/Tizen.Maps/SnapshotType.cs +++ /dev/null @@ -1,34 +0,0 @@ -/* - * 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. - */ - -namespace Tizen.Maps -{ - /// - /// Enumeration for the snapshot file formats. - /// - /// 3 - public enum SnapshotType - { - /// - /// Indicates the BMP file format. - /// - BMP = Interop.ViewSnapshotFormatType.ViewSnapshotBmp, - /// - /// Indicates the JPEG file format. - /// - JPEG = Interop.ViewSnapshotFormatType.ViewSnapshotJpeg, - } -} diff --git a/src/Tizen.Maps/Tizen.Maps/TransportMode.cs b/src/Tizen.Maps/Tizen.Maps/TransportMode.cs deleted file mode 100755 index 9d947811d..000000000 --- a/src/Tizen.Maps/Tizen.Maps/TransportMode.cs +++ /dev/null @@ -1,46 +0,0 @@ -/* - * 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. - */ - -namespace Tizen.Maps -{ - /// - /// Route types. - /// - /// 3 - public enum TransportMode - { - /// - /// Indicates that the route is to be traveled by a car. - /// - Car = Interop.RouteTransportMode.Car, - /// - /// Indicates that the route is for a pedestrian. - /// - Pedestrian = Interop.RouteTransportMode.Pedestrian, - /// - /// Indicates that the route is for a cyclist. - /// - Bicycle = Interop.RouteTransportMode.Bicycle, - /// - /// Indicates that the route is to be traveled using public transport. - /// - PublicTransit = Interop.RouteTransportMode.PublicTransit, - /// - /// Indicates that the route is for a truck. - /// - Truck = Interop.RouteTransportMode.Truck, - } -} diff --git a/src/Tizen.Maps/Tizen.Maps/TurnInstruction.cs b/src/Tizen.Maps/Tizen.Maps/TurnInstruction.cs deleted file mode 100755 index b3fe5fa3b..000000000 --- a/src/Tizen.Maps/Tizen.Maps/TurnInstruction.cs +++ /dev/null @@ -1,86 +0,0 @@ -/* - * 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. - */ - -namespace Tizen.Maps -{ - /// - /// Turns the Instruction type for route maneuver. - /// - /// 3 - public enum TurnInstruction - { - /// - /// Indicates an unknown instruction. - /// - None = Interop.RouteTurnType.None, - /// - /// Indicates instruction to move straight. - /// - Straight = Interop.RouteTurnType.Straight, - /// - /// Indicates instruction to bear right. - /// - BearRight = Interop.RouteTurnType.BearRight, - /// - /// Indicates instruction to turn slightly to the right. - /// - LightRight = Interop.RouteTurnType.LightRight, - /// - /// Indicates instruction to turn right. - /// - Right = Interop.RouteTurnType.Right, - /// - /// Indicates instruction to turn hard to the right. - /// - HardRight = Interop.RouteTurnType.HardRight, - /// - /// Indicates instruction to U-turn to the right. - /// - UturnRight = Interop.RouteTurnType.UturnRight, - /// - /// Indicates instruction to U-turn to the left. - /// - UturnLeft = Interop.RouteTurnType.UturnLeft, - /// - /// Indicates instruction to turn hard to the left. - /// - HardLeft = Interop.RouteTurnType.HardLeft, - /// - /// Indicates instruction to turn left. - /// - Left = Interop.RouteTurnType.Left, - /// - /// Indicates instruction to turn slightly to the left. - /// - LightLeft = Interop.RouteTurnType.LightLeft, - /// - /// Indicates instruction to bear left. - /// - BearLeft = Interop.RouteTurnType.BearLeft, - /// - /// Indicates instruction to take right fork. - /// - RightFork = Interop.RouteTurnType.RightFork, - /// - /// Indicates instruction to take left fork. - /// - LeftFork = Interop.RouteTurnType.LeftFork, - /// - /// Indicates instruction to take straight fork. - /// - StraightFork = Interop.RouteTurnType.StraightFork, - } -} diff --git a/src/Tizen.Maps/res/maps_marker_pin_48.png b/src/Tizen.Maps/res/maps_marker_pin_48.png deleted file mode 100755 index a07d693cf..000000000 Binary files a/src/Tizen.Maps/res/maps_marker_pin_48.png and /dev/null differ diff --git a/src/Tizen.Maps/res/maps_marker_pin_72.png b/src/Tizen.Maps/res/maps_marker_pin_72.png deleted file mode 100755 index bc09c65c6..000000000 Binary files a/src/Tizen.Maps/res/maps_marker_pin_72.png and /dev/null differ diff --git a/src/Tizen.Maps/res/maps_marker_sticker_48.png b/src/Tizen.Maps/res/maps_marker_sticker_48.png deleted file mode 100755 index 93d3fb630..000000000 Binary files a/src/Tizen.Maps/res/maps_marker_sticker_48.png and /dev/null differ diff --git a/src/Tizen.Maps/res/maps_marker_sticker_72.png b/src/Tizen.Maps/res/maps_marker_sticker_72.png deleted file mode 100755 index c2e20600a..000000000 Binary files a/src/Tizen.Maps/res/maps_marker_sticker_72.png and /dev/null differ diff --git a/src/Tizen.Messaging.Push/Interop/Interop.Glib.cs b/src/Tizen.Messaging.Push/Interop/Interop.Glib.cs deleted file mode 100644 index ace5ae25e..000000000 --- a/src/Tizen.Messaging.Push/Interop/Interop.Glib.cs +++ /dev/null @@ -1,30 +0,0 @@ - /* - * 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 Glib - { - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool GSourceFunc(IntPtr userData); - - [DllImport(Libraries.Glib, EntryPoint = "g_idle_add", CallingConvention = CallingConvention.Cdecl)] - internal static extern uint IdleAdd(GSourceFunc d, IntPtr data); - } -} diff --git a/src/Tizen.Messaging.Push/Interop/Interop.Libc.cs b/src/Tizen.Messaging.Push/Interop/Interop.Libc.cs deleted file mode 100644 index 109ec1c3f..000000000 --- a/src/Tizen.Messaging.Push/Interop/Interop.Libc.cs +++ /dev/null @@ -1,27 +0,0 @@ - /* - * 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 Libc - { - [DllImport(Libraries.Libc, EntryPoint = "free", CallingConvention = CallingConvention.Cdecl)] - internal static extern int Free(IntPtr ptr); - } -} diff --git a/src/Tizen.Messaging.Push/Interop/Interop.Libraries.cs b/src/Tizen.Messaging.Push/Interop/Interop.Libraries.cs deleted file mode 100644 index bde641a57..000000000 --- a/src/Tizen.Messaging.Push/Interop/Interop.Libraries.cs +++ /dev/null @@ -1,25 +0,0 @@ - /* - * 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 Push = "libpush.so.0"; - public const string Glib = "libglib-2.0.so.0"; - public const string Libc = "libc.so.6"; - } -} diff --git a/src/Tizen.Messaging.Push/Interop/Interop.PushClient.cs b/src/Tizen.Messaging.Push/Interop/Interop.PushClient.cs deleted file mode 100644 index 9149db73c..000000000 --- a/src/Tizen.Messaging.Push/Interop/Interop.PushClient.cs +++ /dev/null @@ -1,113 +0,0 @@ - /* - * 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 PushClient - { - internal static string LogTag = "Tizen.Messaging.Push"; - - internal enum Result - { - Success = 0, - Timeout = 1, - ServerError = 2, - SystemError = 3 - }; - - internal enum ServiceError - { - None = Tizen.Internals.Errors.ErrorCode.None, - OutOfMemory = Tizen.Internals.Errors.ErrorCode.OutOfMemory, - InvalidParameter = Tizen.Internals.Errors.ErrorCode.InvalidParameter, - NotConnected = Tizen.Internals.Errors.ErrorCode.EndpointNotConnected, - NoData = Tizen.Internals.Errors.ErrorCode.NoData, - OpearationFailed = Tizen.Internals.Errors.ErrorCode.Unknown, - PermissionDenied = Tizen.Internals.Errors.ErrorCode.PermissionDenied, - NotSupported = Tizen.Internals.Errors.ErrorCode.NotSupported - }; - - internal enum State - { - Registered, - Unregistered, - ProvisioningIPChange, - PingChange, - StateError - }; - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void VoidStateChangedCallback(int state, string err, IntPtr userData); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void VoidNotifyCallback(IntPtr notification, IntPtr userData); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void VoidResultCallback(Result result, IntPtr msg, IntPtr userData); - - [DllImport(Libraries.Push, EntryPoint = "push_service_connect", CallingConvention = CallingConvention.Cdecl)] - internal static extern Interop.PushClient.ServiceError ServiceConnect(string pushAppID, VoidStateChangedCallback stateCallback, VoidNotifyCallback notifyCallback, IntPtr userData, out IntPtr connection); - - [DllImport(Libraries.Push, EntryPoint = "push_service_disconnect", CallingConvention = CallingConvention.Cdecl)] - internal static extern void ServiceDisconnect(IntPtr connection); - - [DllImport(Libraries.Push, EntryPoint = "push_service_register", CallingConvention = CallingConvention.Cdecl)] - internal static extern Interop.PushClient.ServiceError ServiceRegister(IntPtr connection, VoidResultCallback callback, IntPtr UserData); - - [DllImport(Libraries.Push, EntryPoint = "push_service_deregister", CallingConvention = CallingConvention.Cdecl)] - internal static extern Interop.PushClient.ServiceError ServiceDeregister(IntPtr connection, VoidResultCallback callback, IntPtr UserData); - - [DllImport(Libraries.Push, EntryPoint = "push_service_app_control_to_noti_data", CallingConvention = CallingConvention.Cdecl)] - internal static extern string AppControlToNotiData(IntPtr appControl, string operation); - - [DllImport(Libraries.Push, EntryPoint = "push_service_app_control_to_notification", CallingConvention = CallingConvention.Cdecl)] - internal static extern Interop.PushClient.ServiceError AppControlToNotification(IntPtr appControl, string operation, out IntPtr noti); - - [DllImport(Libraries.Push, EntryPoint = "push_service_get_notification_data", CallingConvention = CallingConvention.Cdecl)] - internal static extern Interop.PushClient.ServiceError GetNotificationData(IntPtr notification, out string data); - - [DllImport(Libraries.Push, EntryPoint = "push_service_get_notification_message", CallingConvention = CallingConvention.Cdecl)] - internal static extern Interop.PushClient.ServiceError GetNotificationMessage(IntPtr notification, out string data); - - [DllImport(Libraries.Push, EntryPoint = "push_service_get_notification_time", CallingConvention = CallingConvention.Cdecl)] - internal static extern Interop.PushClient.ServiceError GetNotificationTime(IntPtr notification, out int receivedTime); - - [DllImport(Libraries.Push, EntryPoint = "push_service_get_notification_sender", CallingConvention = CallingConvention.Cdecl)] - internal static extern Interop.PushClient.ServiceError GetNotificationSender(IntPtr notification, out string sender); - - [DllImport(Libraries.Push, EntryPoint = "push_service_get_notification_session_info", CallingConvention = CallingConvention.Cdecl)] - internal static extern Interop.PushClient.ServiceError GetNotificationSessionInfo(IntPtr notification, out string sessionInfo); - - [DllImport(Libraries.Push, EntryPoint = "push_service_get_notification_request_id", CallingConvention = CallingConvention.Cdecl)] - internal static extern Interop.PushClient.ServiceError GetNotificationRequestId(IntPtr notification, out string requestID); - - [DllImport(Libraries.Push, EntryPoint = "push_service_get_notification_type", CallingConvention = CallingConvention.Cdecl)] - internal static extern Interop.PushClient.ServiceError GetNotificationType(IntPtr notification, out int type); - - [DllImport(Libraries.Push, EntryPoint = "push_service_get_unread_notification", CallingConvention = CallingConvention.Cdecl)] - internal static extern Interop.PushClient.ServiceError GetUnreadNotification(IntPtr connection, out IntPtr noti); - - [DllImport(Libraries.Push, EntryPoint = "push_service_request_unread_notification", CallingConvention = CallingConvention.Cdecl)] - internal static extern Interop.PushClient.ServiceError RequestUnreadNotification(IntPtr connection); - - [DllImport(Libraries.Push, EntryPoint = "push_service_get_registration_id", CallingConvention = CallingConvention.Cdecl)] - internal static extern Interop.PushClient.ServiceError GetRegistrationId(IntPtr connection, out string regID); - - [DllImport(Libraries.Push, EntryPoint = "push_service_free_notification", CallingConvention = CallingConvention.Cdecl)] - internal static extern Interop.PushClient.ServiceError FreeNotification(IntPtr connection); - } -} \ No newline at end of file diff --git a/src/Tizen.Messaging.Push/Tizen.Messaging.Push.csproj b/src/Tizen.Messaging.Push/Tizen.Messaging.Push.csproj deleted file mode 100644 index 7f4584ffe..000000000 --- a/src/Tizen.Messaging.Push/Tizen.Messaging.Push.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - netstandard2.0 - - - - - - - - diff --git a/src/Tizen.Messaging.Push/Tizen.Messaging.Push.sln b/src/Tizen.Messaging.Push/Tizen.Messaging.Push.sln deleted file mode 100755 index 6a2d5e48e..000000000 --- a/src/Tizen.Messaging.Push/Tizen.Messaging.Push.sln +++ /dev/null @@ -1,34 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26430.12 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Messaging.Push", "Tizen.Messaging.Push.csproj", "{B31AE42B-4C42-468E-8C1A-AAB11564EDD8}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen", "..\Tizen\Tizen.csproj", "{0C7D8B15-AE88-4AA4-9692-CD49CE9FEFED}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Log", "..\Tizen.Log\Tizen.Log.csproj", "{6A5AD3AA-AFF5-472F-BE3F-8D82A2BB51D7}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {B31AE42B-4C42-468E-8C1A-AAB11564EDD8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B31AE42B-4C42-468E-8C1A-AAB11564EDD8}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B31AE42B-4C42-468E-8C1A-AAB11564EDD8}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B31AE42B-4C42-468E-8C1A-AAB11564EDD8}.Release|Any CPU.Build.0 = Release|Any CPU - {0C7D8B15-AE88-4AA4-9692-CD49CE9FEFED}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {0C7D8B15-AE88-4AA4-9692-CD49CE9FEFED}.Debug|Any CPU.Build.0 = Debug|Any CPU - {0C7D8B15-AE88-4AA4-9692-CD49CE9FEFED}.Release|Any CPU.ActiveCfg = Release|Any CPU - {0C7D8B15-AE88-4AA4-9692-CD49CE9FEFED}.Release|Any CPU.Build.0 = Release|Any CPU - {6A5AD3AA-AFF5-472F-BE3F-8D82A2BB51D7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6A5AD3AA-AFF5-472F-BE3F-8D82A2BB51D7}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6A5AD3AA-AFF5-472F-BE3F-8D82A2BB51D7}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6A5AD3AA-AFF5-472F-BE3F-8D82A2BB51D7}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/src/Tizen.Messaging.Push/Tizen.Messaging.Push/PushClient.cs b/src/Tizen.Messaging.Push/Tizen.Messaging.Push/PushClient.cs deleted file mode 100644 index 3e9dd9061..000000000 --- a/src/Tizen.Messaging.Push/Tizen.Messaging.Push/PushClient.cs +++ /dev/null @@ -1,191 +0,0 @@ - /* - * 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.Threading.Tasks; - -namespace Tizen.Messaging.Push -{ - /// - /// The PushClient API provides functions to connect to push service for receiving push messages. - /// - /// 3 - /// - /// The PushClient API provides the way to connect with the push service. - /// It provides APIs to connect/disconnect from the push service. - /// APIs are provided so that an application can register itself - /// with the push server along with APIs to request push message. - /// - /// - /// - /// public class Program - /// { - /// static void Main(string[] args) - /// { - /// PushClient.PushServiceConnect("xxxxx"); - /// Task tr = PushClient.PushServerRegister(); - /// tr.GetAwaiter().OnCompleted(() => { - /// ServerResponse res = tr.Result; - /// PushClient.GetUnreadNotifications(); - /// Task tu = PushClient.PushServerUnregister(); - /// tu.GetAwaiter().OnCompleted(() => { - /// PushClient.PushServiceDisconnect(); - /// }); - /// }); - /// PushClient.NotificationReceived += EventHandlerNotificationReceived; - /// PushClient.StateChanged += EventHandlerStateChanged; - /// } - /// } - /// static void EventHandlerNotificationReceived(object sender, PushMessageEventArgs e) - /// { - /// // any user code - /// } - /// static void EventHandlerStateChanged(object sender, PushConnectionStateEventArgs e) - /// { - /// // any user code - /// } - /// - /// - public static class PushClient - { - /// - /// Event Handler for receiving the notifications. - /// - /// 3 - public static event EventHandler NotificationReceived - { - add - { - lock (_lock) - { - _notificationReceived += value; - } - } - remove - { - lock (_lock) - { - _notificationReceived -= value; - } - } - } - - /// - /// Event Handler for receiving changes in States of the connection. - /// - /// 3 - public static event EventHandler StateChanged - { - add - { - lock (_lock) - { - _stateChanged += value; - } - } - remove - { - lock (_lock) - { - _stateChanged -= value; - } - } - } - - /// - /// API to connect with the push service. - /// - /// 3 - /// http://tizen.org/privilege/push - /// In case of privilege not defined. - /// The Push Application ID Registered with the server. - public static void PushServiceConnect(string pushAppId) - { - PushImpl.Instance.PushServiceConnect(pushAppId); - } - - /// - /// API to disconnect from the push service. - /// - /// 3 - public static void PushServiceDisconnect() - { - PushImpl.Instance.PushServiceDisconnect(); - //PushImpl.Reset(); - } - - - /// - /// API to Register the application with the push server. - /// - /// 3 - /// - /// The method returns a task, which on completion will give a ServerResponse Object. - /// - public static Task PushServerRegister() - { - return PushImpl.Instance.PushServerRegister(); - } - - /// - /// API to Deregister the application from the push server. - /// - /// 3 - /// - /// The method returns a task, which on completion will give a ServerResponse Object. - /// - public static Task PushServerUnregister() - { - return PushImpl.Instance.PushServerUnregister(); - } - - /// - /// Gets the unread notifications for the application. - /// - /// 3 - public static void GetUnreadNotifications() - { - PushImpl.Instance.GetUnreadNotifications(); - } - - /// - /// registration ID received from server. - /// 3 - /// - /// It is the string, which is the ID received from the server. - /// - public static string GetRegistrationId() - { - return PushImpl.Instance.GetRegistrationId(); - } - - internal static void StateChange(PushConnectionStateEventArgs args) - { - if (_stateChanged != null) - _stateChanged(null, args); - } - - internal static void Notify(PushMessageEventArgs args) - { - if (_notificationReceived != null) - _notificationReceived(null, args); - } - - private static object _lock = new object(); - private static event EventHandler _notificationReceived; - private static event EventHandler _stateChanged; - } -} diff --git a/src/Tizen.Messaging.Push/Tizen.Messaging.Push/PushConnectionStateEventArgs.cs b/src/Tizen.Messaging.Push/Tizen.Messaging.Push/PushConnectionStateEventArgs.cs deleted file mode 100644 index d0983f5a5..000000000 --- a/src/Tizen.Messaging.Push/Tizen.Messaging.Push/PushConnectionStateEventArgs.cs +++ /dev/null @@ -1,85 +0,0 @@ - /* - * 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.Messaging.Push -{ - /// - /// An extended EventArgs class, which contains the State Information. - /// - /// 3 - public class PushConnectionStateEventArgs : EventArgs - { - /// - /// Enumeration for the different states. - /// - /// 3 - public enum PushState - { - /// - /// Registered with the Server. - /// - Registered = 0, - /// - /// Unregistered. - /// - Unregistered = 1, - /// - /// To change the provisioning server IP. - /// - ProvisioningIPChanged = 2, - /// - /// Ping interval is changing. - /// - PingChanged = 3, - /// - /// Error Occured in Changing State. - /// - StateError = 4 - } - - /// - /// Gives the current state. - /// - /// 3 - /// - /// It is the current state. - public PushState State - { - get; - internal set; - } - - /// - /// Gives information about the error if set. - /// - /// 3 - /// - /// It is the string, which contains the error string if set. - public string Error - { - get; - internal set; - } - - internal PushConnectionStateEventArgs(PushState state, string error) - { - State = state; - Error = error; - } - } -} diff --git a/src/Tizen.Messaging.Push/Tizen.Messaging.Push/PushExceptionFactory.cs b/src/Tizen.Messaging.Push/Tizen.Messaging.Push/PushExceptionFactory.cs deleted file mode 100644 index 465e66117..000000000 --- a/src/Tizen.Messaging.Push/Tizen.Messaging.Push/PushExceptionFactory.cs +++ /dev/null @@ -1,83 +0,0 @@ - /* - * 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.Collections.Generic; -using System.Linq; -using System.Text; - -namespace Tizen.Messaging.Push -{ - class PushExceptionFactory - { - internal static Exception CreateResponseException(Interop.PushClient.ServiceError result) - { - Exception exp; - switch (result) - { - case Interop.PushClient.ServiceError.OutOfMemory: - { - Tizen.Log.Error(Interop.PushClient.LogTag, "Interop.PushClient.ServiceError.OutOfMemory"); - exp = new InvalidOperationException("Memory Not Sufficient for the current operation"); - break; - } - case Interop.PushClient.ServiceError.InvalidParameter: - { - Tizen.Log.Error(Interop.PushClient.LogTag, "Interop.PushClient.ServiceError.InvalidParameter"); - exp = new InvalidOperationException("The Parameter Passed was Invalid or Invalid Operation Intented"); - break; - } - case Interop.PushClient.ServiceError.NotConnected: - { - Tizen.Log.Error(Interop.PushClient.LogTag, "Interop.PushClient.ServiceError.NotConnected"); - exp = new InvalidOperationException("Not Connected to Server"); - break; - } - case Interop.PushClient.ServiceError.NoData: - { - Tizen.Log.Error(Interop.PushClient.LogTag, "Interop.PushClient.ServiceError.NoData"); - exp = new InvalidOperationException("No Data"); - break; - } - case Interop.PushClient.ServiceError.OpearationFailed: - { - Tizen.Log.Error(Interop.PushClient.LogTag, "Interop.PushClient.ServiceError.OpearationFailed"); - exp = new InvalidOperationException("Operation Failed"); - break; - } - case Interop.PushClient.ServiceError.PermissionDenied: - { - Tizen.Log.Error(Interop.PushClient.LogTag, "Interop.PushClient.ServiceError.PermissionDenied"); - exp = new InvalidOperationException("Permission Denied"); - break; - } - case Interop.PushClient.ServiceError.NotSupported: - { - Tizen.Log.Error(Interop.PushClient.LogTag, "Interop.PushClient.ServiceError.NotSupported"); - exp = new InvalidOperationException("Not Supported"); - break; - } - default: - { - Tizen.Log.Error(Interop.PushClient.LogTag, "Creating Exception for Default case for error code " + result); - exp = new Exception(); - break; - } - } - return exp; - } - } -} diff --git a/src/Tizen.Messaging.Push/Tizen.Messaging.Push/PushImpl.cs b/src/Tizen.Messaging.Push/Tizen.Messaging.Push/PushImpl.cs deleted file mode 100644 index c56940502..000000000 --- a/src/Tizen.Messaging.Push/Tizen.Messaging.Push/PushImpl.cs +++ /dev/null @@ -1,245 +0,0 @@ - /* - * 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.Collections.Generic; -using System.Threading.Tasks; -using System.Runtime.InteropServices; -using Tizen; - -namespace Tizen.Messaging.Push -{ - internal class PushImpl - { - private static readonly object _lock = new object(); - private static PushImpl _instance; - private Interop.PushClient.VoidResultCallback registerResult; - private Interop.PushClient.VoidResultCallback unregisterResult; - - internal static PushImpl Instance - { - get - { - lock (_lock) - { - if (_instance == null) - { - Log.Info(Interop.PushClient.LogTag, "Creating New Instance"); - _instance = new PushImpl(); - } - } - return _instance; - } - } - - internal PushImpl() - { - //Empty - } - - private IntPtr _connection; - - internal void PushServiceConnect(string pushAppId) - { - Interop.PushClient.VoidStateChangedCallback stateDelegate = (int state, string err, IntPtr userData) => - { - if (err == null) - { - err = ""; - } - PushConnectionStateEventArgs args = new PushConnectionStateEventArgs((PushConnectionStateEventArgs.PushState)state, err); - PushClient.StateChange(args); - }; - Interop.PushClient.VoidNotifyCallback notifyDelegate = (IntPtr notification, IntPtr userData) => - { - Interop.PushClient.ServiceError result; - PushMessageEventArgs ob = new PushMessageEventArgs(); - string data; - result = Interop.PushClient.GetNotificationData(notification, out data); - if ((result == Interop.PushClient.ServiceError.None) && !(String.IsNullOrEmpty(data))) - { - ob.AppData = data; - } - else - { - ob.AppData = ""; - } - string message; - result = Interop.PushClient.GetNotificationMessage(notification, out message); - if ((result == Interop.PushClient.ServiceError.None) && !(String.IsNullOrEmpty(message))) - { - ob.Message = message; - } - else - { - ob.Message = ""; - } - string sender; - result = Interop.PushClient.GetNotificationSender(notification, out sender); - if ((result == Interop.PushClient.ServiceError.None) && !(String.IsNullOrEmpty(sender))) - { - ob.Sender = sender; - } - else - { - ob.Sender = ""; - } - string sessioninfo; - result = Interop.PushClient.GetNotificationSessionInfo(notification, out sessioninfo); - if ((result == Interop.PushClient.ServiceError.None) && !(String.IsNullOrEmpty(sessioninfo))) - { - ob.SessionInfo = sessioninfo; - } - else - { - ob.SessionInfo = ""; - } - string requestid; - result = Interop.PushClient.GetNotificationRequestId(notification, out requestid); - if ((result == Interop.PushClient.ServiceError.None) && !(String.IsNullOrEmpty(requestid))) - { - ob.RequestId = requestid; - } - else - { - ob.RequestId = ""; - } - int time; - result = Interop.PushClient.GetNotificationTime(notification, out time); - DateTime utc; - if ((result == Interop.PushClient.ServiceError.None) && (time != 0)) - { - Log.Info(Interop.PushClient.LogTag, "Ticks received: " + time); - utc = DateTime.SpecifyKind(new DateTime(1970, 1, 1).AddSeconds(time), DateTimeKind.Utc); - ob.ReceivedAt = utc.ToLocalTime(); - } - else - { - Log.Info(Interop.PushClient.LogTag, "No Date received"); - ob.ReceivedAt = DateTime.Now; - } - int type = -1; - result = Interop.PushClient.GetNotificationType(notification, out type); - if (result == Interop.PushClient.ServiceError.None) - { - ob.Type = type; - } - PushClient.Notify(ob); - //Interop.PushClient.FreeNotification(notification); - Log.Info(Interop.PushClient.LogTag, "Free Notification Done"); - }; - Interop.PushClient.ServiceError connectResult = Interop.PushClient.ServiceConnect(pushAppId, stateDelegate, notifyDelegate, IntPtr.Zero, out _connection); - if (connectResult != Interop.PushClient.ServiceError.None) - { - Log.Error(Interop.PushClient.LogTag, "Connect failed with " + connectResult); - throw PushExceptionFactory.CreateResponseException(connectResult); - } - } - - internal void PushServiceDisconnect() - { - Interop.PushClient.ServiceDisconnect(_connection); - Log.Info(Interop.PushClient.LogTag, "PushServiceDisconnect Completed"); - } - - internal async Task PushServerRegister() - { - Log.Info(Interop.PushClient.LogTag, "Register Called"); - var task = new TaskCompletionSource(); - registerResult = (Interop.PushClient.Result regResult, IntPtr msgPtr, IntPtr userData) => - { - Log.Info(Interop.PushClient.LogTag, "Register Callback Called with " + regResult); - string msg = ""; - if (msgPtr != IntPtr.Zero) - { - msg = Marshal.PtrToStringAnsi(msgPtr); - } - ServerResponse response = new ServerResponse(); - response.ServerResult = (ServerResponse.Result)regResult; - response.ServerMessage = msg; - if (task.TrySetResult(response) == false) - { - Log.Error(Interop.PushClient.LogTag, "Unable to set the Result for register"); - } - }; - Interop.PushClient.ServiceError result = Interop.PushClient.ServiceRegister(_connection, registerResult, IntPtr.Zero); - Log.Info(Interop.PushClient.LogTag, "Interop.PushClient.ServiceRegister Completed"); - if (result != Interop.PushClient.ServiceError.None) - { - Log.Error(Interop.PushClient.LogTag, "Register failed with " + result); - task.SetException(PushExceptionFactory.CreateResponseException(result)); - } - return await task.Task; - } - - internal async Task PushServerUnregister() - { - var task = new TaskCompletionSource(); - unregisterResult = (Interop.PushClient.Result regResult, IntPtr msgPtr, IntPtr userData) => - { - Log.Info(Interop.PushClient.LogTag, "Unregister Callback Called"); - string msg = ""; - if (msgPtr != IntPtr.Zero) - { - msg = Marshal.PtrToStringAnsi(msgPtr); - } - ServerResponse response = new ServerResponse(); - response.ServerResult = (ServerResponse.Result)regResult; - response.ServerMessage = msg; - if (task.TrySetResult(response) == false) - { - Log.Error(Interop.PushClient.LogTag, "Unable to set the Result for Unregister"); - } - }; - Interop.PushClient.ServiceError result = Interop.PushClient.ServiceDeregister(_connection, unregisterResult, IntPtr.Zero); - if (result != Interop.PushClient.ServiceError.None) - { - task.SetException(PushExceptionFactory.CreateResponseException(result)); - } - return await task.Task; - } - - internal string GetRegistrationId() - { - string regID = ""; - Interop.PushClient.ServiceError result = Interop.PushClient.GetRegistrationId(_connection, out regID); - if (result != Interop.PushClient.ServiceError.None) - { - throw PushExceptionFactory.CreateResponseException(result); - } - Log.Info(Interop.PushClient.LogTag, "Returning Reg Id: " + regID); - return regID; - } - - internal void GetUnreadNotifications() - { - Interop.PushClient.ServiceError result = Interop.PushClient.RequestUnreadNotification(_connection); - if (result != Interop.PushClient.ServiceError.None) - { - throw PushExceptionFactory.CreateResponseException(result); - } - } - - internal static void Reset() - { - lock (_lock) - { - Log.Info(Interop.PushClient.LogTag, "Making _instance as null"); - _instance = null; - } - } - } -} diff --git a/src/Tizen.Messaging.Push/Tizen.Messaging.Push/PushMessageEventArgs.cs b/src/Tizen.Messaging.Push/Tizen.Messaging.Push/PushMessageEventArgs.cs deleted file mode 100644 index eba6c0e47..000000000 --- a/src/Tizen.Messaging.Push/Tizen.Messaging.Push/PushMessageEventArgs.cs +++ /dev/null @@ -1,121 +0,0 @@ - /* - * 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.Messaging.Push -{ - /// - /// An extended EventArgs class, which contains the message received. - /// - /// 3 - public class PushMessageEventArgs : EventArgs - { - /// - /// Gives the Application Data recieved. - /// 3 - /// - /// It is the string, which stores the application data. - public string AppData - { - get; - internal set; - } - - /// - /// Gives the Message Received Field. - /// - /// 3 - /// - /// It is the string, which stores the message field. - public string Message - { - get; - internal set; - } - - /// - /// Gives the time at which the Notification was received. - /// - /// 3 - /// - /// It is the DateTime field representing the time at which the Notification was received. - public DateTime ReceivedAt - { - get; - internal set; - } - - /// - /// Gives the Sender of the notification. - /// - /// 3 - /// - /// It is a string value representing the Sender of the Notification. - public string Sender - { - get; - internal set; - } - - /// - /// Gives the session ID of the notification. - /// - /// 3 - /// - /// It is a string value representing the session ID of the Notification. - public string SessionInfo - { - get; - internal set; - } - - /// - /// Gives the request ID of the notification. - /// - /// 3 - /// - /// It is a string value representing the request ID of the Notification. - public string RequestId - { - get; - internal set; - } - - /// - /// Gives the value in the type field of the notification. - /// - /// 3 - /// - /// It is an integer value representing the type field of the notification. - public int Type - { - get; - internal set; - } - - internal PushMessageEventArgs() - { - // Giving Default Values - AppData = ""; - Message = ""; - ReceivedAt = new DateTime(); - Sender = ""; - SessionInfo= ""; - RequestId = ""; - } - } -} diff --git a/src/Tizen.Messaging.Push/Tizen.Messaging.Push/ServerResponse.cs b/src/Tizen.Messaging.Push/Tizen.Messaging.Push/ServerResponse.cs deleted file mode 100644 index e0d895b22..000000000 --- a/src/Tizen.Messaging.Push/Tizen.Messaging.Push/ServerResponse.cs +++ /dev/null @@ -1,73 +0,0 @@ - /* - * 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. - */ - -namespace Tizen.Messaging.Push -{ - /// - /// The ServerResponse structure provides the result and the server response if any. - /// - /// 3 - public struct ServerResponse - { - /// - /// Enumeration for the Result from the server. - /// - /// 3 - public enum Result - { - /// - /// Successful. - /// - Success = 0, - /// - /// Time Out Occured. - /// - Timeout = 1, - /// - /// Server Error Occured. - /// - ServerError = 2, - /// - /// System Error Occured. - /// - SystemError = 3 - } - - /// - /// Gives the Result of the opeartion. - /// - /// 3 - /// - /// It is the Result state of the operation performed. - public Result ServerResult - { - get; - internal set; - } - - /// - /// Gives the Message from the server. - /// - /// 3 - /// - /// It is the Message sent by the server. - public string ServerMessage - { - get; - internal set; - } - } -} diff --git a/src/Tizen.Messaging/Interop/Interop.Email.cs b/src/Tizen.Messaging/Interop/Interop.Email.cs deleted file mode 100755 index 28601a9ad..000000000 --- a/src/Tizen.Messaging/Interop/Interop.Email.cs +++ /dev/null @@ -1,70 +0,0 @@ -/* - * 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 enum EmailRecipientType - { - To = 1, - Cc = 2, - Bcc = 3 - } - - internal static partial class Email - { - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void EmailSentCallback(IntPtr handle, int result, IntPtr userData); - - [DllImport(Libraries.Email, EntryPoint = "email_create_message")] - internal static extern int CreateEmail(out IntPtr EmailHandle); - - [DllImport(Libraries.Email, EntryPoint = "email_destroy_message")] - internal static extern int DestroyEmail(IntPtr EmailHandle); - - [DllImport(Libraries.Email, EntryPoint = "email_set_subject")] - internal static extern int SetSubject(IntPtr EmailHandle, string text); - - [DllImport(Libraries.Email, EntryPoint = "email_set_body")] - internal static extern int SetBody(IntPtr EmailHandle, string text); - - [DllImport(Libraries.Email, EntryPoint = "email_add_recipient")] - internal static extern int AddRecipient(IntPtr EmailHandle, int type, string text); - - [DllImport(Libraries.Email, EntryPoint = "email_remove_all_recipients")] - internal static extern int RemoveRecipient(IntPtr EmailHandle); - - [DllImport(Libraries.Email, EntryPoint = "email_add_attach")] - internal static extern int AddAttachment(IntPtr EmailHandle, string text); - - [DllImport(Libraries.Email, EntryPoint = "email_remove_all_attachments")] - internal static extern int RemoveAttachments(IntPtr EmailHandle); - - [DllImport(Libraries.Email, EntryPoint = "email_save_message")] - internal static extern int SaveEmail(IntPtr EmailHandle); - - [DllImport(Libraries.Email, EntryPoint = "email_send_message")] - internal static extern int SendEmail(IntPtr EmailHandle, bool SaveToSentBox); - - [DllImport(Libraries.Email, EntryPoint = "email_set_message_sent_cb")] - internal static extern int SetCb(IntPtr EmailHandle, EmailSentCallback Cb, IntPtr UserData); - - [DllImport(Libraries.Email, EntryPoint = "email_unset_message_sent_cb")] - internal static extern int UnsetCb(IntPtr EmailHandle); - } -} diff --git a/src/Tizen.Messaging/Interop/Interop.Libraries.cs b/src/Tizen.Messaging/Interop/Interop.Libraries.cs deleted file mode 100644 index 64170be93..000000000 --- a/src/Tizen.Messaging/Interop/Interop.Libraries.cs +++ /dev/null @@ -1,24 +0,0 @@ -/* - * 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 Messages = "libcapi-messaging-messages.so.0"; - public const string Email = "libcapi-messaging-email.so.0"; - } -} diff --git a/src/Tizen.Messaging/Interop/Interop.Messages.cs b/src/Tizen.Messaging/Interop/Interop.Messages.cs deleted file mode 100755 index 76972621a..000000000 --- a/src/Tizen.Messaging/Interop/Interop.Messages.cs +++ /dev/null @@ -1,124 +0,0 @@ -/* - * 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 Messages - { - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void MessageIncomingCallback(IntPtr messageHandle, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void MessageSentCallback(int result, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool MessageSearchCallback(IntPtr messageHandle, int index, int resultCount, int totalCount, IntPtr userData); - - [DllImport(Libraries.Messages, EntryPoint = "messages_open_service")] - internal static extern int OpenService(out IntPtr serviceHandle); - - [DllImport(Libraries.Messages, EntryPoint = "messages_close_service")] - internal static extern int CloseService(IntPtr serviceHandle); - - [DllImport(Libraries.Messages, EntryPoint = "messages_create_message")] - internal static extern int CreateMessage(int type, out IntPtr messageHandle); - - [DllImport(Libraries.Messages, EntryPoint = "messages_destroy_message")] - internal static extern int DestroyMessage(IntPtr messageHandle); - - [DllImport(Libraries.Messages, EntryPoint = "messages_get_message_id")] - internal static extern int GetMessageId(IntPtr messageHandle, out int messageId); - - [DllImport(Libraries.Messages, EntryPoint = "messages_set_sim_id")] - internal static extern int SetSimId(IntPtr messageHandle, int simId); - - [DllImport(Libraries.Messages, EntryPoint = "messages_get_sim_id")] - internal static extern int GetSimId(IntPtr messageHandle, out int simId); - - [DllImport(Libraries.Messages, EntryPoint = "messages_set_mbox_type")] - internal static extern int SetMboxType(IntPtr messageHandle, int mboxType); - - [DllImport(Libraries.Messages, EntryPoint = "messages_get_mbox_type")] - internal static extern int GetMboxType(IntPtr messageHandle, out int mboxType); - - [DllImport(Libraries.Messages, EntryPoint = "messages_get_message_port")] - internal static extern int GetMessagePort(IntPtr messageHandle, out int messagePort); - - [DllImport(Libraries.Messages, EntryPoint = "messages_get_message_type")] - internal static extern int GetMessageType(IntPtr messageHandle, out int messageType); - - [DllImport(Libraries.Messages, EntryPoint = "messages_set_text")] - internal static extern int SetText(IntPtr messageHandle, string text); - - [DllImport(Libraries.Messages, EntryPoint = "messages_get_text")] - internal static extern int GetText(IntPtr messageHandle, out string text); - - [DllImport(Libraries.Messages, EntryPoint = "messages_set_time")] - internal static extern int SetTime(IntPtr messageHandle, int time); - - [DllImport(Libraries.Messages, EntryPoint = "messages_get_time")] - internal static extern int GetTime(IntPtr messageHandle, out int time); - - [DllImport(Libraries.Messages, EntryPoint = "messages_mms_set_subject")] - internal static extern int SetSubject(IntPtr messageHandle, string subject); - - [DllImport(Libraries.Messages, EntryPoint = "messages_mms_get_subject")] - internal static extern int GetSubject(IntPtr messageHandle, out string subject); - - [DllImport(Libraries.Messages, EntryPoint = "messages_add_address")] - internal static extern int AddAddress(IntPtr messageHandle, string address, int type); - - [DllImport(Libraries.Messages, EntryPoint = "messages_get_address_count")] - internal static extern int GetAddressCount(IntPtr messageHandle, out int count); - - [DllImport(Libraries.Messages, EntryPoint = "messages_get_address")] - internal static extern int GetAddress(IntPtr messageHandle, int index, out string address, out int type); - - [DllImport(Libraries.Messages, EntryPoint = "messages_remove_all_addresses")] - internal static extern int RemoveAllAddress(IntPtr messageHandle); - - [DllImport(Libraries.Messages, EntryPoint = "messages_mms_add_attachment")] - internal static extern int AddAttachment(IntPtr messageHandle, int type, string path); - - [DllImport(Libraries.Messages, EntryPoint = "messages_mms_get_attachment_count")] - internal static extern int GetAttachmentCount(IntPtr messageHandle, out int count); - - [DllImport(Libraries.Messages, EntryPoint = "messages_mms_get_attachment")] - internal static extern int GetAttachment(IntPtr messageHandle, int index, out int type, out string path); - - [DllImport(Libraries.Messages, EntryPoint = "messages_mms_remove_all_attachments")] - internal static extern int RemoveAllAttachment(IntPtr messageHandle); - - [DllImport(Libraries.Messages, EntryPoint = "messages_set_message_incoming_cb")] - internal static extern int SetMessageIncomingCb(IntPtr serviceHandle, MessageIncomingCallback cb, IntPtr userData); - - [DllImport(Libraries.Messages, EntryPoint = "messages_unset_message_incoming_cb")] - internal static extern int UnsetMessageIncomingCb(IntPtr serviceHandle); - - [DllImport(Libraries.Messages, EntryPoint = "messages_send_message")] - internal static extern int SendMessage(IntPtr serviceHandle, IntPtr messageHandle, bool saveToSentbox, MessageSentCallback cb, IntPtr userData); - - [DllImport(Libraries.Messages, EntryPoint = "messages_search_message_by_id")] - internal static extern int GetMessageById(IntPtr serviceHandle, int msgId, out IntPtr messageHandle); - - [DllImport(Libraries.Messages, EntryPoint = "messages_foreach_message")] - internal static extern int SearchMessage(IntPtr serviceHandle, int mbox, int messageType, string textKeyword, string addressKeyword, int offset, int limit, MessageSearchCallback cb, IntPtr userData); - - } -} diff --git a/src/Tizen.Messaging/Tizen.Messaging.Email/EmailAttachment.cs b/src/Tizen.Messaging/Tizen.Messaging.Email/EmailAttachment.cs deleted file mode 100644 index 357e1447f..000000000 --- a/src/Tizen.Messaging/Tizen.Messaging.Email/EmailAttachment.cs +++ /dev/null @@ -1,36 +0,0 @@ -/* - * 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. - */ - -namespace Tizen.Messaging.Email -{ - /// - /// Represents an email attachment. - /// - public class EmailAttachment - { - /// - /// The absolute full path of the file to be attached. - /// - public string FilePath { get; set; } - /// - /// The constructor. - /// - public EmailAttachment() - { - - } - } -} diff --git a/src/Tizen.Messaging/Tizen.Messaging.Email/EmailEnumerations.cs b/src/Tizen.Messaging/Tizen.Messaging.Email/EmailEnumerations.cs deleted file mode 100755 index 45fa335d8..000000000 --- a/src/Tizen.Messaging/Tizen.Messaging.Email/EmailEnumerations.cs +++ /dev/null @@ -1,34 +0,0 @@ -/* -* 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. -*/ - -namespace Tizen.Messaging.Email -{ - /// - /// Result of sending the email. - /// - public enum EmailSendResult - { - /// - /// Failed to send the message. - /// - Failure = -1, - - /// - /// Email sent successfully. - /// - Success = 0 - } -} diff --git a/src/Tizen.Messaging/Tizen.Messaging.Email/EmailErrorFactory.cs b/src/Tizen.Messaging/Tizen.Messaging.Email/EmailErrorFactory.cs deleted file mode 100755 index 90dbe54e3..000000000 --- a/src/Tizen.Messaging/Tizen.Messaging.Email/EmailErrorFactory.cs +++ /dev/null @@ -1,96 +0,0 @@ -/* - * 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.IO; -using Tizen.Internals.Errors; - -namespace Tizen.Messaging.Email -{ - internal enum EmailError - { - None = ErrorCode.None, - OutOfMemory = ErrorCode.OutOfMemory, - InvalidParameter = ErrorCode.InvalidParameter, - ServerNotReady = -0x01710000 | 0x501, - CommunicationWithServerFailed = -0x01710000 | 0x502, - OutOfRange = -0x01710000 | 0x503, - SendingFailed = -0x01710000 | 0x504, - OperationFailed = -0x01710000 | 0x505, - NoSimCard = -0x01710000 | 0x506, - NoData = -0x01710000 | 0x507, - PermissionDenied = ErrorCode.PermissionDenied, - NotSupported = ErrorCode.NotSupported - } - - internal static class EmailErrorFactory - { - internal const string LogTag = "Tizen.Messaging.Email"; - - internal static Exception GetException(int err) - { - EmailError error = (EmailError)err; - if (error == EmailError.OutOfMemory) - { - return new OutOfMemoryException("Out of memory"); - } - else if (error == EmailError.InvalidParameter) - { - return new ArgumentException("Invalid parameter"); - } - else if (error == EmailError.ServerNotReady) - { - return new IOException("Server not ready yet"); ; - } - else if (error == EmailError.NoData) - { - return new InvalidDataException("No data found"); - } - else if (error == EmailError.CommunicationWithServerFailed) - { - return new TimeoutException("timed out"); - } - else if (error == EmailError.PermissionDenied) - { - return new UnauthorizedAccessException("Permission denied"); - } - else if (error == EmailError.NotSupported) - { - return new NotSupportedException("Not supported"); - } - else if (error == EmailError.OutOfRange) - { - return new IndexOutOfRangeException("Out of range"); - } - else if (error == EmailError.SendingFailed) - { - return new Exception("Sending failed"); - } - else if (error == EmailError.OperationFailed) - { - return new InvalidOperationException("operation failed"); - } - else if (error == EmailError.NoSimCard) - { - return new Exception("No sim card found"); - } - else - { - return new Exception("System operation"); - } - } - } -} diff --git a/src/Tizen.Messaging/Tizen.Messaging.Email/EmailMessage.cs b/src/Tizen.Messaging/Tizen.Messaging.Email/EmailMessage.cs deleted file mode 100644 index e4b9d9fe7..000000000 --- a/src/Tizen.Messaging/Tizen.Messaging.Email/EmailMessage.cs +++ /dev/null @@ -1,229 +0,0 @@ -/* -* 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.Collections.Generic; -using System.Collections.ObjectModel; - -namespace Tizen.Messaging.Email -{ - /// - /// This class contains the Messaging API to support sending email messages. - /// - public class EmailMessage : IDisposable - { - internal IntPtr _emailHandle = IntPtr.Zero; - private bool _disposed = false; - private String _subject; - private String _body; - private IList _attachments = new List(); - private ICollection _to = new Collection(); - private ICollection _cc = new Collection(); - private ICollection _bcc = new Collection(); - - /// - /// The constructor. - /// - public EmailMessage() - { - int ret = Interop.Email.CreateEmail(out _emailHandle); - if (ret != (int)EmailError.None) - { - Log.Error(EmailErrorFactory.LogTag, "Failed to create message handle, Error code: " + (EmailError)ret); - throw EmailErrorFactory.GetException(ret); - } - } - - /// - /// The subject of the email message. - /// - public string Subject - { - set - { - _subject = value; - int ret = Interop.Email.SetSubject(_emailHandle, _subject); - if (ret != (int)EmailError.None) - { - Log.Error(EmailErrorFactory.LogTag, "Failed to set subject, Error code: " + (EmailError)ret); - throw EmailErrorFactory.GetException(ret); - } - } - get - { - return _subject; - } - - } - - /// - /// The body of the email message. - /// - public string Body - { - set - { - _body = value; - int ret = Interop.Email.SetBody(_emailHandle, _body); - if (ret != (int)EmailError.None) - { - Log.Error(EmailErrorFactory.LogTag, "Failed to set body, Error code: " + (EmailError)ret); - throw EmailErrorFactory.GetException(ret); - } - } - get - { - return _body; - } - } - - /// - /// The list of file attachments. - /// - public IList Attachments - { - get - { - return _attachments; - } - } - - /// - /// The collection of normal email recipients. - /// - /// - /// The email address should be in the standard format (as described in the Internet standards RFC 5321 and RFC 5322). - /// - public ICollection To - { - get - { - return _to; - } - } - - /// - /// The collection of CC (carbon copy) email recipients. - /// - /// - /// The email address should be in the standard format (as described in the Internet standards RFC 5321 and RFC 5322). - /// - public ICollection Cc - { - get - { - return _cc; - } - } - - /// - /// The collection of BCC (blind carbon copy) email recipients. - /// - /// - /// The email address should be in the standard format (as described in the Internet standards RFC 5321 and RFC 5322). - /// - public ICollection Bcc - { - get - { - return _bcc; - } - } - - - internal void Save() - { - int ret; - FillHandle(); - - ret = Interop.Email.SaveEmail(_emailHandle); - if (ret != (int)EmailError.None) - { - Log.Error(EmailErrorFactory.LogTag, "Failed to save email, Error code: " + (EmailError)ret); - throw EmailErrorFactory.GetException(ret); - } - } - - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - - protected virtual void Dispose(bool disposing) - { - if (_disposed) - return; - - if (disposing) - { - - } - - if (_emailHandle != IntPtr.Zero) - { - Interop.Email.DestroyEmail(_emailHandle); - _emailHandle = IntPtr.Zero; - } - _disposed = true; - } - - internal void FillHandle() - { - int ret = (int)EmailError.None; - foreach (EmailAttachment it in Attachments) - { - Console.WriteLine(it.FilePath); - ret = Interop.Email.AddAttachment(_emailHandle, it.FilePath); - if (ret != (int)EmailError.None) - { - Log.Error(EmailErrorFactory.LogTag, "Failed to add attachment, Error code: " + (EmailError)ret); - throw EmailErrorFactory.GetException(ret); - } - } - - foreach (EmailRecipient it in To) - { - ret = Interop.Email.AddRecipient(_emailHandle, (int)Interop.EmailRecipientType.To, it.Address); - if (ret != (int)EmailError.None) - { - Log.Error(EmailErrorFactory.LogTag, "Failed to add recipients, Error code: " + (EmailError)ret); - throw EmailErrorFactory.GetException(ret); - } - } - - foreach (EmailRecipient it in Cc) - { - ret = Interop.Email.AddRecipient(_emailHandle, (int)Interop.EmailRecipientType.Cc, it.Address); - if (ret != (int)EmailError.None) - { - Log.Error(EmailErrorFactory.LogTag, "Failed to add recipients, Error code: " + (EmailError)ret); - throw EmailErrorFactory.GetException(ret); - } - } - - foreach (EmailRecipient it in Bcc) - { - ret = Interop.Email.AddRecipient(_emailHandle, (int)Interop.EmailRecipientType.Bcc, it.Address); - if (ret != (int)EmailError.None) - { - Log.Error(EmailErrorFactory.LogTag, "Failed to add recipients, Error code: " + (EmailError)ret); - throw EmailErrorFactory.GetException(ret); - } - } - } - } -} diff --git a/src/Tizen.Messaging/Tizen.Messaging.Email/EmailRecipient.cs b/src/Tizen.Messaging/Tizen.Messaging.Email/EmailRecipient.cs deleted file mode 100644 index 99d5de381..000000000 --- a/src/Tizen.Messaging/Tizen.Messaging.Email/EmailRecipient.cs +++ /dev/null @@ -1,36 +0,0 @@ -/* - * 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. - */ - -namespace Tizen.Messaging.Email -{ - /// - /// This class represents recipients of an email. - /// - public class EmailRecipient - { - /// - /// The email address of the recipient. - /// - public string Address { get; set; } - /// - /// The constructor. - /// - public EmailRecipient() - { - - } - } -} diff --git a/src/Tizen.Messaging/Tizen.Messaging.Email/EmailSender.cs b/src/Tizen.Messaging/Tizen.Messaging.Email/EmailSender.cs deleted file mode 100644 index 5c75996fe..000000000 --- a/src/Tizen.Messaging/Tizen.Messaging.Email/EmailSender.cs +++ /dev/null @@ -1,72 +0,0 @@ -/* - * 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.Threading.Tasks; - -namespace Tizen.Messaging.Email -{ - /// - /// This class is used to send email messages. - /// - public static class EmailSender - { - /// - /// Sends the email message. - /// - /// The email message. - /// Failure if the email sending activity failed, otherwise Success. - public static async Task SendAsync(EmailMessage email) - { - var task = new TaskCompletionSource(); - int ret = (int)EmailError.None; - bool saveToSentBox = false; - - email.FillHandle(); - email.Save(); - - Interop.Email.EmailSentCallback _emailSendingCallback = (IntPtr handle, int result, IntPtr userData) => - { - task.SetResult((EmailSendResult)result); - }; - - ret = Interop.Email.SetCb(email._emailHandle, _emailSendingCallback, IntPtr.Zero); - if (ret != (int)EmailError.None) - { - Log.Error(EmailErrorFactory.LogTag, "Failed to set email incoming callback, Error code: " + (EmailError)ret); - throw EmailErrorFactory.GetException(ret); - } - - ret = Interop.Email.SendEmail(email._emailHandle, saveToSentBox); - if (ret != (int)EmailError.None) - { - Log.Error(EmailErrorFactory.LogTag, "Failed to send email, Error code: " + (EmailError)ret); - throw EmailErrorFactory.GetException(ret); - } - - var sendResult = await task.Task; - - ret = Interop.Email.UnsetCb(email._emailHandle); - if (ret != (int)EmailError.None) - { - Log.Error(EmailErrorFactory.LogTag, "Failed to set email incoming callback, Error code: " + (EmailError)ret); - throw EmailErrorFactory.GetException(ret); - } - - return sendResult; - } - } -} diff --git a/src/Tizen.Messaging/Tizen.Messaging.Email/NamespaceDoc.cs b/src/Tizen.Messaging/Tizen.Messaging.Email/NamespaceDoc.cs deleted file mode 100755 index 8afebcb03..000000000 --- a/src/Tizen.Messaging/Tizen.Messaging.Email/NamespaceDoc.cs +++ /dev/null @@ -1,26 +0,0 @@ -/* - * 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. - */ - - -/// -/// The Tizen.Messaging.Email namespace contains classes providing the functionality to send emails. -/// -/// -/// The Tizen.Messaging.Email namespace contains classes providing the functionality to send emails. -/// -namespace Tizen.Messaging.Email -{ -} diff --git a/src/Tizen.Messaging/Tizen.Messaging.Messages/CBMessage.cs b/src/Tizen.Messaging/Tizen.Messaging.Messages/CBMessage.cs deleted file mode 100755 index 88d1f387e..000000000 --- a/src/Tizen.Messaging/Tizen.Messaging.Messages/CBMessage.cs +++ /dev/null @@ -1,30 +0,0 @@ -/* - * 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.Messaging.Messages -{ - /// - /// This class represents the cell broadcast messages. - /// - public class CBMessage : Message - { - internal CBMessage(IntPtr messageHandle) : base(messageHandle) - { - } - } -} diff --git a/src/Tizen.Messaging/Tizen.Messaging.Messages/Message.cs b/src/Tizen.Messaging/Tizen.Messaging.Messages/Message.cs deleted file mode 100755 index 38f0f5eee..000000000 --- a/src/Tizen.Messaging/Tizen.Messaging.Messages/Message.cs +++ /dev/null @@ -1,335 +0,0 @@ -/* -* 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.Collections.Generic; -using System.Collections.ObjectModel; - -namespace Tizen.Messaging.Messages -{ - /// - /// This class represents all the messages. - /// - public abstract class Message : IDisposable - { - internal IntPtr _messageHandle = IntPtr.Zero; - private bool disposed = false; - private int _memoryPressureSize = IntPtr.Size * 11 + sizeof(int) * 5 + sizeof(bool) * 5 + sizeof(short) * 2 + sizeof(byte) * 1176; - - private ICollection _from = new Collection(); - internal ICollection _to = new Collection(); - internal ICollection _cc = new Collection(); - internal ICollection _bcc = new Collection(); - - internal Message(MessageType type) - { - int ret = Interop.Messages.CreateMessage((int)type, out _messageHandle); - if (ret != (int)MessagesError.None) - { - Log.Error(Globals.LogTag, "Failed to create message handle, Error - " + (MessagesError)ret); - MessagesErrorFactory.ThrowMessagesException(ret); - } - - GC.AddMemoryPressure(_memoryPressureSize); - } - - internal Message(IntPtr messageHandle) - { - _messageHandle = messageHandle; - GetAllAddresses(); - GC.AddMemoryPressure(_memoryPressureSize); - } - - internal void FillHandle() - { - SetAddresses(); - (this as MmsMessage)?.SetAttachments(); - } - - ~Message() - { - Dispose(false); - } - - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - GC.RemoveMemoryPressure(_memoryPressureSize); - } - - private void Dispose(bool disposing) - { - if (disposed) - return; - - if (disposing) - { - // Free managed objects - } - - // Free unmanaged objects - if (_messageHandle != IntPtr.Zero) - { - Interop.Messages.DestroyMessage(_messageHandle); - _messageHandle = IntPtr.Zero; - } - disposed = true; - } - - internal IntPtr GetHandle() - { - return _messageHandle; - } - - private void SetAddresses() - { - foreach (var it in _to) - { - AddAddress(it); - } - - foreach (var it in _cc) - { - AddAddress(it); - } - - foreach (var it in _bcc) - { - AddAddress(it); - } - } - - private void AddAddress(MessagesAddress address) - { - int ret = Interop.Messages.AddAddress(_messageHandle, address.Number, (int)address.Type); - if (ret != (int)MessagesError.None) - { - Log.Error(Globals.LogTag, "Failed to add address, Error - " + (MessagesError)ret); - MessagesErrorFactory.ThrowMessagesException(ret, _messageHandle); - } - } - - private void GetAllAddresses() - { - int count; - - int ret = Interop.Messages.GetAddressCount(_messageHandle, out count); - if (ret != (int)MessagesError.None) - { - Log.Error(Globals.LogTag, "Failed to get address count, Error - " + (MessagesError)ret); - MessagesErrorFactory.ThrowMessagesException(ret, _messageHandle); - } - - string number; - int type; - var To = new Collection(); - var Cc = new Collection(); - var Bcc = new Collection(); - var From = new Collection(); - - for (int i = 0; i < count; i++) - { - ret = Interop.Messages.GetAddress(_messageHandle, i, out number, out type); - if (ret != (int)MessagesError.None) - { - Log.Error(Globals.LogTag, "Failed to get address, Error - " + (MessagesError)ret); - MessagesErrorFactory.ThrowMessagesException(ret, _messageHandle); - } - - var addressItem = new MessagesAddress((RecipientType)type, number); - switch ((RecipientType)type) - { - case RecipientType.To: - To.Add(addressItem); - break; - case RecipientType.Cc: - Cc.Add(addressItem); - break; - case RecipientType.Bcc: - Bcc.Add(addressItem); - break; - default: - From.Add(addressItem); - break; - } - } - - _to = To; - _cc = Cc; - _bcc = Bcc; - _from = From; - } - - /// - /// The message ID. - /// - /// - /// After creating the Message object, the default value of this property is 0. After sending, this value is changed. - /// - public int Id - { - get - { - int id = 0; - int ret = Interop.Messages.GetMessageId(_messageHandle, out id); - if (ret != (int)MessagesError.None) - { - Log.Error(Globals.LogTag, "Failed to get message id, Error - " + (MessagesError)ret); - } - - return id; - } - } - - /// - /// The destination port of the message. - /// - public int Port - { - get - { - int port = 0; - int ret = Interop.Messages.GetMessagePort(_messageHandle, out port); - if (ret != (int)MessagesError.None) - { - Log.Error(Globals.LogTag, "Failed to get message port, Error - " + (MessagesError)ret); - } - - return port; - } - } - - /// - /// The message box type. - /// - public MessageBoxType BoxType - { - get - { - int boxType = (int)MessageBoxType.All; - int ret = Interop.Messages.GetMboxType(_messageHandle, out boxType); - if (ret != (int)MessagesError.None) - { - Log.Error(Globals.LogTag, "Failed to get message box type, Error - " + (MessagesError)ret); - } - - return (MessageBoxType)boxType; - } - set - { - int ret = Interop.Messages.SetMboxType(_messageHandle, (int)value); - if (ret != (int)MessagesError.None) - { - Log.Error(Globals.LogTag, "Failed to set message box type, Error - " + (MessagesError)ret); - MessagesErrorFactory.ThrowMessagesException(ret, _messageHandle); - } - } - } - - /// - /// The text of the message. - /// - public string Text - { - get - { - string text = null; - int ret = Interop.Messages.GetText(_messageHandle, out text); - if (ret != (int)MessagesError.None) - { - Log.Error(Globals.LogTag, "Failed to get text, Error - " + (MessagesError)ret); - } - - return text; - } - set - { - int ret = Interop.Messages.SetText(_messageHandle, value); - if (ret != (int)MessagesError.None) - { - Log.Error(Globals.LogTag, "Failed to set text, Error - " + (MessagesError)ret); - MessagesErrorFactory.ThrowMessagesException(ret, _messageHandle); - } - } - } - - /// - /// The time of the message. - /// - public DateTime Time - { - get - { - int time = 0; - int ret = Interop.Messages.GetTime(_messageHandle, out time); - if (ret != (int)MessagesError.None) - { - Log.Error(Globals.LogTag, "Failed to get time, Error - " + (MessagesError)ret); - } - - return (new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc)).AddSeconds(time).ToLocalTime(); - } - set - { - int ret = Interop.Messages.SetTime(_messageHandle, (int)(value.ToUniversalTime().Subtract(new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc)).TotalSeconds)); - if (ret != (int)MessagesError.None) - { - Log.Error(Globals.LogTag, "Failed to set time, Error - " + (MessagesError)ret); - MessagesErrorFactory.ThrowMessagesException(ret, _messageHandle); - } - } - } - - /// - /// The SIM slot index of the message. - /// - public SimSlotId SimId - { - get - { - int simId = (int)SimSlotId.Unknown; - int ret = Interop.Messages.GetSimId(_messageHandle, out simId); - if (ret != (int)MessagesError.None) - { - Log.Error(Globals.LogTag, "Failed to get simId, Error - " + (MessagesError)ret); - } - - return (SimSlotId)simId; - } - set - { - int ret = Interop.Messages.SetSimId(_messageHandle, (int)value); - if (ret != (int)MessagesError.None) - { - Log.Error(Globals.LogTag, "Failed to set simId, Error - " + (MessagesError)ret); - MessagesErrorFactory.ThrowMessagesException(ret, _messageHandle); - } - } - } - - /// - /// Indicates the sender of the message. - /// - public IReadOnlyCollection From - { - get - { - return _from as IReadOnlyCollection; - } - } - } -} diff --git a/src/Tizen.Messaging/Tizen.Messaging.Messages/MessageReceivedEventArgs.cs b/src/Tizen.Messaging/Tizen.Messaging.Messages/MessageReceivedEventArgs.cs deleted file mode 100755 index f98bc6fc2..000000000 --- a/src/Tizen.Messaging/Tizen.Messaging.Messages/MessageReceivedEventArgs.cs +++ /dev/null @@ -1,44 +0,0 @@ -/* - * 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.Messaging.Messages -{ - /// - /// An extended EventArgs class, which contains a received message. - /// - public class MessageReceivedEventArgs : EventArgs - { - private Message _message; - - internal MessageReceivedEventArgs(Message message) - { - _message = message; - } - - /// - /// The received message. - /// - public Message ReceivedMessage - { - get - { - return _message; - } - } - } -} diff --git a/src/Tizen.Messaging/Tizen.Messaging.Messages/MessagesAddress.cs b/src/Tizen.Messaging/Tizen.Messaging.Messages/MessagesAddress.cs deleted file mode 100755 index 3e1349465..000000000 --- a/src/Tizen.Messaging/Tizen.Messaging.Messages/MessagesAddress.cs +++ /dev/null @@ -1,45 +0,0 @@ -/* - * 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. - */ - -namespace Tizen.Messaging.Messages -{ - /// - /// This class is used to manage the information of the message address. - /// - public class MessagesAddress - { - internal RecipientType Type; - /// - /// The address of the sender/recipient. - /// - public string Number { get; } - - /// - /// Creates a message address. - /// - /// The recipient's address to receive a message. - public MessagesAddress(string number) - { - Number = number; - } - - internal MessagesAddress(RecipientType type, string number) - { - Type = type; - Number = number; - } - } -} diff --git a/src/Tizen.Messaging/Tizen.Messaging.Messages/MessagesAttachment.cs b/src/Tizen.Messaging/Tizen.Messaging.Messages/MessagesAttachment.cs deleted file mode 100755 index c37428e41..000000000 --- a/src/Tizen.Messaging/Tizen.Messaging.Messages/MessagesAttachment.cs +++ /dev/null @@ -1,45 +0,0 @@ -/* - * 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. - */ - -namespace Tizen.Messaging.Messages -{ - /// - /// This class is used to manage the information of the message attachment. - /// - public class MessagesAttachment - { - /// - /// The media type of the attachment. - /// - public MediaType Type { get; } - - /// - /// The file path of the attachment. - /// - public string FilePath { get; } - - /// - /// Creates an attachment. - /// - /// The attachment's type. - /// The file path to attach. - public MessagesAttachment(MediaType type, string filePath) - { - Type = type; - FilePath = filePath; - } - } -} diff --git a/src/Tizen.Messaging/Tizen.Messaging.Messages/MessagesEnumerations.cs b/src/Tizen.Messaging/Tizen.Messaging.Messages/MessagesEnumerations.cs deleted file mode 100755 index 2fa1626b2..000000000 --- a/src/Tizen.Messaging/Tizen.Messaging.Messages/MessagesEnumerations.cs +++ /dev/null @@ -1,152 +0,0 @@ -/* -* 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. -*/ - -namespace Tizen.Messaging.Messages -{ - /// - /// Enumeration for the result of sending a message. - /// - public enum SentResult - { - /// - /// Message sending failed. - /// - Failed = -1, - /// - /// Message sending succeeded. - /// - Success = 0 - } - - /// - /// Enumeration for the message type. - /// - public enum MessageType - { - /// - /// The unknown type. - /// - Unknown = 0, - /// - /// The SMS type. - /// - Sms = 1, - /// - /// The MMS type. - /// - Mms = 2, - /// - /// The CB(Cell Broadcast) type. - /// - CellBroadcast = Sms | 1 << 4, - /// - /// The WAP Push type. - /// - Push = Sms | 10 << 4 - } - - /// - /// Enumeration for the message box type. - /// - public enum MessageBoxType - { - /// - /// All message box type. - /// - All = 0, - /// - /// The Inbox type. - /// - Inbox = 1, - /// - /// The Outbox type. - /// - Outbox = 2, - /// - /// The Sentbox type. - /// - Sentbox = 3, - /// - /// The Draft type. - /// - Draft = 4 - } - - /// - /// Enumeration for the SIM slot index of a message. - /// - public enum SimSlotId - { - /// - /// Unknown SIM Slot. - /// - Unknown = 0, - /// - /// SIM Slot 1. - /// - Sim1 = 1, - /// - /// SIM Slot 2. - /// - Sim2 = 2 - } - - /// - /// Enumeration for the recipient type of a message. - /// - internal enum RecipientType - { - /// - /// Unknown. - /// - Unknown = 0, - /// - /// 'To' recipient. - /// - To = 1, - /// - /// 'Cc' (carbon copy) recipient. - /// - Cc = 2, - /// - /// 'Bcc' (blind carbon copy) recipient. - /// - Bcc = 3 - } - - /// - /// Enumeration for the attachment type for the MMS messaging. - /// - public enum MediaType - { - /// - /// Unknown. - /// - Unknown = 0, - /// - /// The image. - /// - Image = 1, - /// - /// The audio. - /// - Audio = 2, - /// - /// The video. - /// - Video = 3 - } -} diff --git a/src/Tizen.Messaging/Tizen.Messaging.Messages/MessagesErrorFactory.cs b/src/Tizen.Messaging/Tizen.Messaging.Messages/MessagesErrorFactory.cs deleted file mode 100755 index c331aabc7..000000000 --- a/src/Tizen.Messaging/Tizen.Messaging.Messages/MessagesErrorFactory.cs +++ /dev/null @@ -1,74 +0,0 @@ -/* - * 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.Messaging.Messages -{ - internal enum MessagesError - { - None = ErrorCode.None, - OutOfMemory = ErrorCode.OutOfMemory, - InvalidParameter = ErrorCode.InvalidParameter, - ServerNotReady = -0x01710000 | 0x501, - CommunicationWithServerFailed = -0x01710000 | 0x502, - OutOfRange = -0x01710000 | 0x503, - SendingFailed = -0x01710000 | 0x504, - OperationFailed = -0x01710000 | 0x505, - NoSimCard = -0x01710000 | 0x506, - NoData = -0x01710000 | 0x507, - PermissionDenied = ErrorCode.PermissionDenied, - NotSupported = ErrorCode.NotSupported - } - - internal static class MessagesErrorFactory - { - static internal void ThrowMessagesException(int e) - { - ThrowException(e, false); - } - - static internal void ThrowMessagesException(int e, IntPtr handle) - { - ThrowException(e, (handle == IntPtr.Zero)); - } - - static private void ThrowException(int e, bool isHandleNull) - { - MessagesError err = (MessagesError)e; - - if (isHandleNull) - { - throw new InvalidOperationException("Invalid instance (object may have been disposed or release)"); - } - - switch (err) - { - case MessagesError.OutOfMemory: - throw new OutOfMemoryException(err.ToString()); - case MessagesError.InvalidParameter: - throw new ArgumentException(err.ToString()); - case MessagesError.PermissionDenied: - throw new UnauthorizedAccessException(err.ToString()); - case MessagesError.NotSupported: - throw new NotSupportedException(err.ToString()); - default: - throw new InvalidOperationException(err.ToString()); - } - } - } -} diff --git a/src/Tizen.Messaging/Tizen.Messaging.Messages/MessagesEvent.cs b/src/Tizen.Messaging/Tizen.Messaging.Messages/MessagesEvent.cs deleted file mode 100755 index dd0d61678..000000000 --- a/src/Tizen.Messaging/Tizen.Messaging.Messages/MessagesEvent.cs +++ /dev/null @@ -1,125 +0,0 @@ -/* - * 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.Messaging.Messages -{ - internal partial class MessagesManagerImpl - { - private event EventHandler _messageReceived; - - private Interop.Messages.MessageIncomingCallback _messageReceivedCallback; - - internal event EventHandler _MessageReceived - { - add - { - if (_messageReceived == null) - { - RegisterMessageReceivedEvent(); - } - _messageReceived += value; - } - remove - { - _messageReceived -= value; - if (_messageReceived == null) - { - UnregisterMessageReceivedEvent(); - } - } - } - - private void RegisterMessageReceivedEvent() - { - _messageReceivedCallback = (IntPtr messageHandle, IntPtr userData) => - { - try - { - IntPtr duplicatedMessageHandle = IntPtr.Zero; - - DuplicateMessageHandle(messageHandle, out duplicatedMessageHandle); - if (duplicatedMessageHandle != IntPtr.Zero) - { - int type = (int)MessageType.Unknown; - int result = Interop.Messages.GetMessageType(duplicatedMessageHandle, out type); - if (result != (int)MessagesError.None) - { - Log.Error(Globals.LogTag, "Failed to get message type, Error - " + (MessagesError)result); - } - - switch ((MessageType)type) - { - case MessageType.Sms: - { - var receivedMessage = new SmsMessage(duplicatedMessageHandle); - MessageReceivedEventArgs args = new MessageReceivedEventArgs(receivedMessage); - _messageReceived?.Invoke(null, args); - break; - } - case MessageType.Mms: - { - var receivedMessage = new MmsMessage(duplicatedMessageHandle); - MessageReceivedEventArgs args = new MessageReceivedEventArgs(receivedMessage); - _messageReceived?.Invoke(null, args); - break; - } - case MessageType.CellBroadcast: - { - var receivedMessage = new CBMessage(duplicatedMessageHandle); - MessageReceivedEventArgs args = new MessageReceivedEventArgs(receivedMessage); - _messageReceived?.Invoke(null, args); - break; - } - case MessageType.Push: - { - var receivedMessage = new PushMessage(duplicatedMessageHandle); - MessageReceivedEventArgs args = new MessageReceivedEventArgs(receivedMessage); - _messageReceived?.Invoke(null, args); - break; - } - default: - { - Log.Error(Globals.LogTag, "Invaild message type - " + type); - break; - } - } - } - } - catch - { - Log.Error(Globals.LogTag, "Exception in Callback"); - } - }; - - int ret = Interop.Messages.SetMessageIncomingCb(_MessageServiceHandle, _messageReceivedCallback, IntPtr.Zero); - if (ret != (int)MessagesError.None) - { - Log.Error(Globals.LogTag, "Failed to set message incoming callback, Error - " + (MessagesError)ret); - } - } - - private void UnregisterMessageReceivedEvent() - { - int ret = Interop.Messages.UnsetMessageIncomingCb(_MessageServiceHandle); - if (ret != (int)MessagesError.None) - { - Log.Error(Globals.LogTag, "Failed to unset message incoming callback, Error - " + (MessagesError)ret); - } - } - } -} diff --git a/src/Tizen.Messaging/Tizen.Messaging.Messages/MessagesManager.cs b/src/Tizen.Messaging/Tizen.Messaging.Messages/MessagesManager.cs deleted file mode 100755 index e9571bdf6..000000000 --- a/src/Tizen.Messaging/Tizen.Messaging.Messages/MessagesManager.cs +++ /dev/null @@ -1,77 +0,0 @@ -/* - * 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.Collections.Generic; -using System.Threading.Tasks; - -namespace Tizen.Messaging.Messages -{ - /// - /// This class is used for the message management. It allows applications to use the message service. - /// - /// http://tizen.org/privilege/message.read - public static class MessagesManager - { - /// - /// Sends a message. - /// - /// http://tizen.org/privilege/message.write - /// The message to be sent. - /// The boolean variable used to indicate whether the sent message should be saved in the sentbox or not. - /// A task containing the result of message sending. - /// Thrown when the method failed due to an invalid operation. - /// Thrown when the message service is not supported. - /// Thrown when input coordinates are invalid. - /// Thrown when an application does not have proper privileges. - public static Task SendMessageAsync(Message message, bool saveToSentbox) - { - return MessagesManagerImpl.Instance.SendMessageAsync(message, saveToSentbox); - } - - /// - /// Searches for messages. - /// - /// http://tizen.org/privilege/message.read - /// The search filter for searching messages. - /// A task containing the messages, which match the search filter. - /// Thrown when the method failed due to an invalid operation. - /// Thrown when the message service is not supported. - /// Thrown when input coordinates are invalid. - /// Thrown when failed due to out of memory. - /// Thrown when an application does not have proper privileges. - public static Task> SearchMessageAsync(MessagesSearchFilter filter) - { - return MessagesManagerImpl.Instance.SearchMessageAsync(filter); - } - - /// - /// The MessageReceived event that is raised when receiving a message. - /// - /// http://tizen.org/privilege/message.read - static public event EventHandler MessageReceived - { - add - { - MessagesManagerImpl.Instance._MessageReceived += value; - } - remove - { - MessagesManagerImpl.Instance._MessageReceived -= value; - } - } - } -} diff --git a/src/Tizen.Messaging/Tizen.Messaging.Messages/MessagesManagerImpl.cs b/src/Tizen.Messaging/Tizen.Messaging.Messages/MessagesManagerImpl.cs deleted file mode 100755 index 63cd9fca5..000000000 --- a/src/Tizen.Messaging/Tizen.Messaging.Messages/MessagesManagerImpl.cs +++ /dev/null @@ -1,233 +0,0 @@ -/* - * 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.Collections.Generic; -using System.Threading.Tasks; - -namespace Tizen.Messaging.Messages -{ - static internal class Globals - { - internal const string LogTag = "Tizen.Messaging.Messages"; - } - - internal partial class MessagesManagerImpl : IDisposable - { - private static readonly MessagesManagerImpl _instance = new MessagesManagerImpl(); - private bool disposed = false; - - private static IntPtr _MessageServiceHandle; - - private Interop.Messages.MessageSentCallback _messageSentCallback; - - internal static MessagesManagerImpl Instance - { - get - { - return _instance; - } - } - - private MessagesManagerImpl() - { - initialize(); - } - - ~MessagesManagerImpl() - { - Dispose(false); - } - - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - - private void Dispose(bool disposing) - { - if (disposed) - return; - - if (disposing) - { - // Free managed objects - } - - // Free unmanaged objects - deinitialize(); - disposed = true; - } - - private void initialize() - { - int ret; - - ret = Interop.Messages.OpenService(out _MessageServiceHandle); - if (ret != (int)MessagesError.None) - { - Log.Error(Globals.LogTag, "Failed to open service, Error - " + (MessagesError)ret); - MessagesErrorFactory.ThrowMessagesException(ret); - } - } - - private void deinitialize() - { - if (_MessageServiceHandle != IntPtr.Zero) - { - int ret; - - ret = Interop.Messages.CloseService(_MessageServiceHandle); - if (ret != (int)MessagesError.None) - { - Log.Error(Globals.LogTag, "Failed to close service, Error - " + (MessagesError)ret); - } - - _MessageServiceHandle = IntPtr.Zero; - } - } - - internal Task SendMessageAsync(Message message, bool saveToSentbox) - { - var task = new TaskCompletionSource(); - - _messageSentCallback = (int result, IntPtr data) => - { - task.SetResult((SentResult)result); - }; - - message.FillHandle(); - - int ret; - IntPtr messageHandle = message.GetHandle(); - - ret = Interop.Messages.SendMessage(_MessageServiceHandle, messageHandle, saveToSentbox, _messageSentCallback, IntPtr.Zero); - if (ret != (int)MessagesError.None) - { - Log.Error(Globals.LogTag, "Failed to send message, Error - " + (MessagesError)ret); - MessagesErrorFactory.ThrowMessagesException(ret, _MessageServiceHandle); - } - - return task.Task; - } - - internal Task> SearchMessageAsync(MessagesSearchFilter filter) - { - return Task.Run>(() => - { - List messageList = new List(); - int ret; - - Interop.Messages.MessageSearchCallback callback = (IntPtr messageHandle, int index, int resultCount, int totalCount, IntPtr userData) => - { - try - { - if (messageHandle != IntPtr.Zero) - { - IntPtr duplicatedMessageHandle = IntPtr.Zero; - - DuplicateMessageHandle(messageHandle, out duplicatedMessageHandle); - if (duplicatedMessageHandle != IntPtr.Zero) - { - int type = (int)MessageType.Unknown; - int result = Interop.Messages.GetMessageType(duplicatedMessageHandle, out type); - if (result != (int)MessagesError.None) - { - Log.Error(Globals.LogTag, "Failed to get message type, Error - " + (MessagesError)result); - } - - switch ((MessageType)type) - { - case MessageType.Sms: - { - var messageItem = new SmsMessage(duplicatedMessageHandle); - messageList.Add(messageItem); - break; - } - case MessageType.Mms: - { - var messageItem = new MmsMessage(duplicatedMessageHandle); - messageList.Add(messageItem); - break; - } - case MessageType.CellBroadcast: - { - var messageItem = new CBMessage(duplicatedMessageHandle); - messageList.Add(messageItem); - break; - } - case MessageType.Push: - { - var messageItem = new PushMessage(duplicatedMessageHandle); - messageList.Add(messageItem); - break; - } - default: - { - Log.Error(Globals.LogTag, "Invaild message type - " + type); - break; - } - } - - return true; - } - } - } - catch - { - Log.Error(Globals.LogTag, "Exception in Callback"); - } - - return false; - }; - - ret = Interop.Messages.SearchMessage(_MessageServiceHandle, (int)filter.MessageBoxType, (int)filter.MessageType, filter.TextKeyword, filter.AddressKeyword, 0, 0, callback, IntPtr.Zero); - if (ret != (int)MessagesError.None) - { - Log.Error(Globals.LogTag, "Failed to search message, Error - " + (MessagesError)ret); - MessagesErrorFactory.ThrowMessagesException(ret, _MessageServiceHandle); - } - - return messageList; - }); - } - - private void DuplicateMessageHandle(IntPtr sourceHandle, out IntPtr clonedHandle) - { - int msgId; - IntPtr returnedHandle = IntPtr.Zero; - - int ret = Interop.Messages.GetMessageId(sourceHandle, out msgId); - if (ret == (int)MessagesError.None) - { - ret = Interop.Messages.GetMessageById(_MessageServiceHandle, msgId, out returnedHandle); - if (ret != (int)MessagesError.None) - { - Log.Error(Globals.LogTag, "Failed to get message by id, Error - " + (MessagesError)ret); - MessagesErrorFactory.ThrowMessagesException(ret, _MessageServiceHandle); - } - } - else - { - Log.Error(Globals.LogTag, "Failed to get message id, Error - " + (MessagesError)ret); - MessagesErrorFactory.ThrowMessagesException(ret, _MessageServiceHandle); - } - - clonedHandle = returnedHandle; - } - } -} diff --git a/src/Tizen.Messaging/Tizen.Messaging.Messages/MessagesSearchFilter.cs b/src/Tizen.Messaging/Tizen.Messaging.Messages/MessagesSearchFilter.cs deleted file mode 100755 index 0d8c80b75..000000000 --- a/src/Tizen.Messaging/Tizen.Messaging.Messages/MessagesSearchFilter.cs +++ /dev/null @@ -1,48 +0,0 @@ -/* - * 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. - */ - -namespace Tizen.Messaging.Messages -{ - /// - /// This class represents message search filters. - /// - public class MessagesSearchFilter - { - /// - /// Creates a search filter for searching messages. - /// - public MessagesSearchFilter() - { - } - - /// - /// The message box type. - /// - public MessageBoxType MessageBoxType { get; set; } - /// - /// The message type. - /// - public MessageType MessageType { get; set; } - /// - /// The keyword to search in the text and the subject. - /// - public string TextKeyword { get; set; } - /// - /// The recipient address. - /// - public string AddressKeyword { get; set; } - } -} diff --git a/src/Tizen.Messaging/Tizen.Messaging.Messages/MmsMessage.cs b/src/Tizen.Messaging/Tizen.Messaging.Messages/MmsMessage.cs deleted file mode 100755 index 88a01ca43..000000000 --- a/src/Tizen.Messaging/Tizen.Messaging.Messages/MmsMessage.cs +++ /dev/null @@ -1,162 +0,0 @@ -/* - * 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.Collections.Generic; - -namespace Tizen.Messaging.Messages -{ - /// - /// This class represents multimedia messages. - /// - public class MmsMessage : Message - { - private IList _attachment = new List(); - - /// - /// Creates a multimedia message. - /// - public MmsMessage() : base(MessageType.Mms) - { - } - - internal MmsMessage(IntPtr messageHandle) : base(messageHandle) - { - GetAllAttachments(); - } - - /// - /// The subject of the multimedia message. - /// - public string Subject - { - get - { - string subject = null; - int ret = Interop.Messages.GetSubject(_messageHandle, out subject); - if (ret != (int)MessagesError.None) - { - Log.Error(Globals.LogTag, "Failed to get subject, Error - " + (MessagesError)ret); - } - - return subject; - } - set - { - int ret = Interop.Messages.SetSubject(_messageHandle, value); - if (ret != (int)MessagesError.None) - { - Log.Error(Globals.LogTag, "Failed to set subject, Error - " + (MessagesError)ret); - MessagesErrorFactory.ThrowMessagesException(ret, _messageHandle); - } - } - } - - /// - /// The collection of normal message recipients. - /// - public ICollection To - { - get - { - return _to; - } - } - - /// - /// The collection of CC (carbon copy) message recipients. - /// - public ICollection Cc - { - get - { - return _cc; - } - } - - /// - /// The collection of BCC (blind carbon copy) message recipients. - /// - public ICollection Bcc - { - get - { - return _bcc; - } - } - - /// - /// The list of attachment files. - /// - public IList Attachments - { - get - { - return _attachment; - } - } - - internal void SetAttachments() - { - foreach (var it in _attachment) - { - AddAttachment(it); - } - } - - private void AddAttachment(MessagesAttachment attach) - { - int ret = Interop.Messages.AddAttachment(_messageHandle, (int)attach.Type, attach.FilePath); - if (ret != (int)MessagesError.None) - { - Log.Error(Globals.LogTag, "Failed to add attachment, Error - " + (MessagesError)ret); - MessagesErrorFactory.ThrowMessagesException(ret, _messageHandle); - } - } - - private void GetAllAttachments() - { - int count; - - int ret = Interop.Messages.GetAttachmentCount(_messageHandle, out count); - if (ret != (int)MessagesError.None) - { - Log.Error(Globals.LogTag, "Failed to get attachment count, Error - " + (MessagesError)ret); - MessagesErrorFactory.ThrowMessagesException(ret, _messageHandle); - } - - string path; - int type; - var attachmentList = new List(); - - for (int i = 0; i < count; i++) - { - ret = Interop.Messages.GetAttachment(_messageHandle, i, out type, out path); - if (ret != (int)MessagesError.None) - { - Log.Error(Globals.LogTag, "Failed to get attachment, Error - " + (MessagesError)ret); - MessagesErrorFactory.ThrowMessagesException(ret, _messageHandle); - } - - var attachmentItem = new MessagesAttachment((MediaType)type, path); - attachmentList.Add(attachmentItem); - } - - _attachment = attachmentList; - } - - } -} diff --git a/src/Tizen.Messaging/Tizen.Messaging.Messages/NamespaceDoc.cs b/src/Tizen.Messaging/Tizen.Messaging.Messages/NamespaceDoc.cs deleted file mode 100755 index 79377edd3..000000000 --- a/src/Tizen.Messaging/Tizen.Messaging.Messages/NamespaceDoc.cs +++ /dev/null @@ -1,25 +0,0 @@ -/* - * 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. - */ - -/// -/// The Tizen.Messaging.Messages namespace contains classes providing the functionality to send, receive, and search messages. -/// -/// -/// The Tizen.Messaging.Messages namespace contains classes providing the functionality to send, receive, and search messages. -/// -namespace Tizen.Messaging.Messages -{ -} diff --git a/src/Tizen.Messaging/Tizen.Messaging.Messages/PushMessage.cs b/src/Tizen.Messaging/Tizen.Messaging.Messages/PushMessage.cs deleted file mode 100755 index d14f3c175..000000000 --- a/src/Tizen.Messaging/Tizen.Messaging.Messages/PushMessage.cs +++ /dev/null @@ -1,30 +0,0 @@ -/* - * 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.Messaging.Messages -{ - /// - /// This class represents the WAP push messages. - /// - public class PushMessage : Message - { - internal PushMessage(IntPtr messageHandle) : base(messageHandle) - { - } - } -} diff --git a/src/Tizen.Messaging/Tizen.Messaging.Messages/SmsMessage.cs b/src/Tizen.Messaging/Tizen.Messaging.Messages/SmsMessage.cs deleted file mode 100755 index 456962cdf..000000000 --- a/src/Tizen.Messaging/Tizen.Messaging.Messages/SmsMessage.cs +++ /dev/null @@ -1,49 +0,0 @@ -/* - * 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.Collections.Generic; - -namespace Tizen.Messaging.Messages -{ - /// - /// This class represents short text messages. - /// - public class SmsMessage : Message - { - /// - /// Creates a short text message. - /// - public SmsMessage() : base(MessageType.Sms) - { - } - - internal SmsMessage(IntPtr messageHandle) : base(messageHandle) - { - } - - /// - /// The collection of normal message recipients. - /// - public ICollection To - { - get - { - return _to; - } - } - } -} diff --git a/src/Tizen.Messaging/Tizen.Messaging.csproj b/src/Tizen.Messaging/Tizen.Messaging.csproj deleted file mode 100644 index 7f4584ffe..000000000 --- a/src/Tizen.Messaging/Tizen.Messaging.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - netstandard2.0 - - - - - - - - diff --git a/src/Tizen.Messaging/Tizen.Messaging.sln b/src/Tizen.Messaging/Tizen.Messaging.sln deleted file mode 100755 index 2c1202c12..000000000 --- a/src/Tizen.Messaging/Tizen.Messaging.sln +++ /dev/null @@ -1,34 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26430.12 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Messaging", "Tizen.Messaging.csproj", "{B7415EEB-5E65-49FB-9DBB-3A014B25AA67}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen", "..\Tizen\Tizen.csproj", "{199F2770-77CB-4F49-AA99-EF30513C48CB}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Log", "..\Tizen.Log\Tizen.Log.csproj", "{544A7066-3180-4A93-A14D-4E33A79CB6B8}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {B7415EEB-5E65-49FB-9DBB-3A014B25AA67}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B7415EEB-5E65-49FB-9DBB-3A014B25AA67}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B7415EEB-5E65-49FB-9DBB-3A014B25AA67}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B7415EEB-5E65-49FB-9DBB-3A014B25AA67}.Release|Any CPU.Build.0 = Release|Any CPU - {199F2770-77CB-4F49-AA99-EF30513C48CB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {199F2770-77CB-4F49-AA99-EF30513C48CB}.Debug|Any CPU.Build.0 = Debug|Any CPU - {199F2770-77CB-4F49-AA99-EF30513C48CB}.Release|Any CPU.ActiveCfg = Release|Any CPU - {199F2770-77CB-4F49-AA99-EF30513C48CB}.Release|Any CPU.Build.0 = Release|Any CPU - {544A7066-3180-4A93-A14D-4E33A79CB6B8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {544A7066-3180-4A93-A14D-4E33A79CB6B8}.Debug|Any CPU.Build.0 = Debug|Any CPU - {544A7066-3180-4A93-A14D-4E33A79CB6B8}.Release|Any CPU.ActiveCfg = Release|Any CPU - {544A7066-3180-4A93-A14D-4E33A79CB6B8}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/src/Tizen.Multimedia.AudioIO/AudioIO/AudioCapture.cs b/src/Tizen.Multimedia.AudioIO/AudioIO/AudioCapture.cs deleted file mode 100644 index bde809d83..000000000 --- a/src/Tizen.Multimedia.AudioIO/AudioIO/AudioCapture.cs +++ /dev/null @@ -1,396 +0,0 @@ -/* - * 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; -using static Interop.AudioIO; - -namespace Tizen.Multimedia -{ - /// - /// Provides the ability to directly manage the system audio input devices. - /// - /// http://tizen.org/privilege/recorder - public abstract class AudioCaptureBase : IDisposable - { - /// - /// Specifies the minimum value allowed for the audio capture, in Hertz (Hz). - /// - /// - public static readonly int MinSampleRate = 8000; - - /// - /// Specifies the maximum value allowed for the audio capture, in Hertz (Hz). - /// - /// - public static readonly int MaxSampleRate = 48000; - - internal IntPtr _handle = IntPtr.Zero; - - private AudioIOState _state = AudioIOState.Idle; - - internal AudioCaptureBase(int sampleRate, AudioChannel channel, AudioSampleType sampleType) - { - if (sampleRate < MinSampleRate || MaxSampleRate < sampleRate) - { - throw new ArgumentOutOfRangeException(nameof(sampleRate), sampleRate, - $"Valid sampleRate range is { MinSampleRate } <= x <= { MaxSampleRate }."); - } - - ValidationUtil.ValidateEnum(typeof(AudioChannel), channel, nameof(channel)); - ValidationUtil.ValidateEnum(typeof(AudioSampleType), sampleType, nameof(sampleType)); - - SampleRate = sampleRate; - Channel = channel; - SampleType = sampleType; - - AudioIOUtil.ThrowIfError( - AudioInput.Create(SampleRate, (int)Channel, (int)SampleType, out _handle)); - - RegisterStateChangedCallback(); - } - - ~AudioCaptureBase() - { - Dispose(false); - } - - /// - /// Occurs when the state of the AudioCapture is changed. - /// - public event EventHandler StateChanged; - - private AudioStateChangedCallback _stateChangedCallback; - - private void RegisterStateChangedCallback() - { - _stateChangedCallback = (IntPtr handle, int previous, int current, bool byPolicy, IntPtr _) => - { - _state = (AudioIOState)current; - - StateChanged?.Invoke(this, - new AudioIOStateChangedEventArgs((AudioIOState)previous, _state, byPolicy)); - }; - - AudioIOUtil.ThrowIfError( - AudioInput.SetStateChangedCallback(_handle, _stateChangedCallback, IntPtr.Zero)); - } - - #region Dispose support - private bool _isDisposed = false; - - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - - protected virtual void Dispose(bool disposing) - { - if (_isDisposed) - { - return; - } - - if (_handle != IntPtr.Zero) - { - if (_state != AudioIOState.Idle) - { - try - { - Unprepare(); - } - catch (Exception) - { - } - } - - AudioInput.Destroy(_handle); - _handle = IntPtr.Zero; - _isDisposed = true; - } - } - - internal void ValidateNotDisposed() - { - if (_isDisposed) - { - throw new ObjectDisposedException(GetType().Name); - } - } - #endregion - - internal void ValidateState(params AudioIOState[] desiredStates) - { - ValidateNotDisposed(); - - AudioIOUtil.ValidateState(_state, desiredStates); - } - - /// - /// Gets the sample rate of the audio input data stream, in Hertz (Hz). - /// - public int SampleRate { get; } - - /// - /// Gets the channel type of the audio input data stream. - /// - public AudioChannel Channel { get; } - - /// - /// Gets the sample type of the audio input data stream. - /// - public AudioSampleType SampleType { get; } - - /// - /// Gets the size allocated for the audio input buffer. - /// - /// The AudioPlayback has already been disposed of. - public int GetBufferSize() - { - AudioIOUtil.ThrowIfError(AudioInput.GetBufferSize(_handle, out var size)); - return size; - } - - /// - /// Prepares the AudioCapture for reading audio data by starting buffering of audio data from the device. - /// - /// - /// Operation failed due to an internal error.\n - /// -or-\n - /// The current state is not . - /// - /// - public void Prepare() - { - ValidateState(AudioIOState.Idle); - - AudioIOUtil.ThrowIfError(AudioInput.Prepare(_handle), - "Failed to prepare the AudioCapture"); - } - - /// - /// Unprepares the AudioCapture. - /// - /// - /// Operation failed due to an internal error.\n - /// -or-\n - /// The current state is . - /// - /// - public void Unprepare() - { - ValidateState(AudioIOState.Running, AudioIOState.Paused); - - AudioIOUtil.ThrowIfError(AudioInput.Unprepare(_handle), - "Failed to unprepare the AudioCapture"); - } - - /// - /// Pauses buffering of audio data from the device. - /// - /// - /// The current state is .\n - /// -or-\n - /// The method is called in the event handler. - /// - /// - public void Pause() - { - if (_state == AudioIOState.Paused) - { - return; - } - ValidateState(AudioIOState.Running); - - AudioIOUtil.ThrowIfError(AudioInput.Pause(_handle)); - } - /// - /// Resumes buffering audio data from the device. - /// - /// - /// The current state is .\n - /// -or-\n - /// The method is called in the event handler. - /// - /// - public void Resume() - { - if (_state == AudioIOState.Running) - { - return; - } - ValidateState(AudioIOState.Paused); - - AudioIOUtil.ThrowIfError(AudioInput.Resume(_handle)); - } - - /// - /// Flushes and discards buffered audio data from the input stream. - /// - /// The current state is . - public void Flush() - { - ValidateState(AudioIOState.Running, AudioIOState.Paused); - - int ret = AudioInput.Flush(_handle); - - MultimediaDebug.AssertNoError(ret); - } - - /// - /// Sets the sound stream information to the audio input. - /// - /// The to apply for the AudioCapture. - /// is null. - /// has already been disposed of. - /// is not supported. - /// Not able to retrieve information from . - public void ApplyStreamPolicy(AudioStreamPolicy streamPolicy) - { - if (streamPolicy == null) - { - throw new ArgumentNullException(nameof(streamPolicy)); - } - - ValidateNotDisposed(); - - AudioIOUtil.ThrowIfError(AudioInput.SetStreamInfo(_handle, streamPolicy.Handle)); - } - } - - /// - /// Provides the ability to record audio from system audio input devices in a synchronous way. - /// - /// http://tizen.org/privilege/recorder - public class AudioCapture : AudioCaptureBase - { - /// - /// Initializes a new instance of the AudioCapture class with the specified sample rate, channel, and sampleType. - /// - /// The audio sample rate (8000 ~ 48000Hz). - /// The audio channel type. - /// The audio sample type. - /// - /// is less than .\n - /// -or-\n - /// is greater than . - /// - /// - /// is invalid.\n - /// -or-\n - /// is invalid. - /// - /// The required privilege is not specified. - /// The system does not support microphone. - public AudioCapture(int sampleRate, AudioChannel channel, AudioSampleType sampleType) - : base(sampleRate, channel, sampleType) - { - } - - /// - /// Reads audio data from the audio input buffer. - /// - /// The number of bytes to be read. - /// The buffer of audio data captured. - /// The current state is not . - /// is equal to or less than zero. - public byte[] Read(int count) - { - if (count <= 0) - { - throw new ArgumentOutOfRangeException(nameof(count), count, - $"{ nameof(count) } can't be equal to or less than zero."); - } - ValidateState(AudioIOState.Running); - - byte[] buffer = new byte[count]; - - AudioIOUtil.ThrowIfError(AudioInput.Read(_handle, buffer, count), - "Failed to read"); - - return buffer; - } - } - - /// - /// Provides the ability to record audio from system audio input devices in an asynchronous way. - /// - /// http://tizen.org/privilege/recorder - public class AsyncAudioCapture : AudioCaptureBase - { - - /// - /// Occurs when audio data is available. - /// - public event EventHandler DataAvailable; - - /// - /// Initializes a new instance of the AsyncAudioCapture class with the specified sample rate, channel and sampleType. - /// - /// The audio sample rate (8000 ~ 48000Hz). - /// The audio channel type. - /// The audio sample type. - /// - /// is less than .\n - /// -or-\n - /// is greater than . - /// - /// - /// is invalid.\n - /// -or-\n - /// is invalid. - /// - /// The required privilege is not specified. - /// The system does not support microphone. - public AsyncAudioCapture(int sampleRate, AudioChannel channel, AudioSampleType sampleType) - : base(sampleRate, channel, sampleType) - { - _streamCallback = (IntPtr handle, uint length, IntPtr _) => { OnInputDataAvailable(handle, length); }; - - AudioIOUtil.ThrowIfError( - AudioInput.SetStreamCallback(_handle, _streamCallback, IntPtr.Zero), - $"Failed to initialize a { nameof(AsyncAudioCapture) }"); - } - - private AudioStreamCallback _streamCallback; - - private void OnInputDataAvailable(IntPtr handle, uint length) - { - if (length == 0U) - { - return; - } - - IntPtr ptr = IntPtr.Zero; - try - { - AudioIOUtil.ThrowIfError(AudioInput.Peek(_handle, out ptr, ref length)); - - byte[] buffer = new byte[length]; - Marshal.Copy(ptr, buffer, 0, (int)length); - - AudioInput.Drop(_handle); - - DataAvailable?.Invoke(this, new AudioDataAvailableEventArgs(buffer)); - } - catch (Exception e) - { - Log.Error(nameof(AsyncAudioCapture), e.Message); - } - } - } -} diff --git a/src/Tizen.Multimedia.AudioIO/AudioIO/AudioDataAvailableEventArgs.cs b/src/Tizen.Multimedia.AudioIO/AudioIO/AudioDataAvailableEventArgs.cs deleted file mode 100644 index 72fbc0a7a..000000000 --- a/src/Tizen.Multimedia.AudioIO/AudioIO/AudioDataAvailableEventArgs.cs +++ /dev/null @@ -1,36 +0,0 @@ -/* - * 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.Multimedia -{ - /// - /// Provides data for the event. - /// - public class AudioDataAvailableEventArgs : EventArgs - { - internal AudioDataAvailableEventArgs(byte[] data) - { - Data = data; - } - - /// - /// Gets the audio data captured. - /// - public byte[] Data { get; } - } -} diff --git a/src/Tizen.Multimedia.AudioIO/AudioIO/AudioIOEnums.cs b/src/Tizen.Multimedia.AudioIO/AudioIO/AudioIOEnums.cs deleted file mode 100644 index 50e9c8440..000000000 --- a/src/Tizen.Multimedia.AudioIO/AudioIO/AudioIOEnums.cs +++ /dev/null @@ -1,79 +0,0 @@ -/* - * 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 Tizen.Internals.Errors; - -namespace Tizen.Multimedia -{ - public enum AudioChannel - { - Mono = 0x80, - Stereo - } - - internal enum AudioIOError - { - None = ErrorCode.None, - OutOfMemory = ErrorCode.OutOfMemory, - InvalidParameter = ErrorCode.InvalidParameter, - InvalidOperation = ErrorCode.InvalidOperation, - PermissionDenied = ErrorCode.PermissionDenied, //Device open error by security - NotSupported = ErrorCode.NotSupported, //Not supported - DevicePolicyRestriction = (-2147483648 / 2) + 4, - DeviceNotOpened = -0x01900000 | 0x01, - DeviceNotClosed = -0x01900000 | 0x02, - InvalidBuffer = -0x01900000 | 0x03, - SoundPolicy = -0x01900000 | 0x04, - InvalidState = -0x01900000 | 0x05, - NotSupportedType = -0x01900000 | 0x06, - } - - /// - /// Specifies the states for the , , and . - /// - public enum AudioIOState - { - /// - /// Not prepared. - /// - Idle = 0, - - /// - /// The stream is running. - /// - Running = 1, - - /// - /// The stream is paused. - /// - Paused = 2 - } - - /// - /// Specifies the audio sample types. - /// - public enum AudioSampleType - { - /// - /// Unsigned 8-bit audio samples. - /// - U8 = 0x70, - /// - /// Signed 16-bit audio samples. - /// - S16Le - } -} \ No newline at end of file diff --git a/src/Tizen.Multimedia.AudioIO/AudioIO/AudioIOStateChangedEventArgs.cs b/src/Tizen.Multimedia.AudioIO/AudioIO/AudioIOStateChangedEventArgs.cs deleted file mode 100644 index 5ade7edb6..000000000 --- a/src/Tizen.Multimedia.AudioIO/AudioIO/AudioIOStateChangedEventArgs.cs +++ /dev/null @@ -1,48 +0,0 @@ -/* - * 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.Multimedia -{ - /// - /// Provides data for the event and the event. - /// - public class AudioIOStateChangedEventArgs : EventArgs - { - internal AudioIOStateChangedEventArgs(AudioIOState previous, AudioIOState current, bool byPolicy) - { - Previous = previous; - Current = current; - ByPolicy = byPolicy; - } - - /// - /// Gets the previous state. - /// - public AudioIOState Previous { get; } - - /// - /// Gets the current state. - /// - public AudioIOState Current { get; } - - /// - /// Gets the value indicating whether the state is changed by a policy or not. - /// - public bool ByPolicy { get; } - } -} diff --git a/src/Tizen.Multimedia.AudioIO/AudioIO/AudioIOUtil.cs b/src/Tizen.Multimedia.AudioIO/AudioIO/AudioIOUtil.cs deleted file mode 100644 index d0b5d136b..000000000 --- a/src/Tizen.Multimedia.AudioIO/AudioIO/AudioIOUtil.cs +++ /dev/null @@ -1,95 +0,0 @@ -/* - * 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.Diagnostics; -using System.Linq; - -namespace Tizen.Multimedia -{ - internal static class AudioIOUtil - { - internal static void ThrowIfError(int errorCode, string msg = null) - { - AudioIOError code = (AudioIOError)errorCode; - // 현재는 에러코드 최상위 exception으로 전달, 추후 상황에 맞게 케이스 처리해야 함. - - msg = (msg == null ? "" : msg + " ") + $": { code }"; - - if (code > 0) - { - Log.Info("Audio", "Code > 0, no error!!!!"); - return; - } - - switch (code) - { - case AudioIOError.None: - break; - case AudioIOError.OutOfMemory: - Log.Info("Audio", "OutOfMemoryException"); - throw new OutOfMemoryException(); - case AudioIOError.InvalidParameter: - Log.Info("Audio", "ArgumentException"); - throw new ArgumentException(msg); - case AudioIOError.InvalidOperation: - throw new InvalidOperationException(msg); - case AudioIOError.PermissionDenied: - Log.Info("Audio", "Permission Denied Error"); - throw new InvalidOperationException(msg); - case AudioIOError.NotSupported: - throw new NotSupportedException(msg); - case AudioIOError.DevicePolicyRestriction: - Log.Info("Audio", "Device_policy_restriction"); - throw new Exception("Device_policy_restriction"); - case AudioIOError.DeviceNotOpened: - Log.Info("Audio", "Device Not Opened Error"); - throw new Exception("Device Not Opened Error"); - case AudioIOError.DeviceNotClosed: - Log.Info("Audio", "Device Not Closed Error"); - throw new Exception("Device Not Closed Error"); - case AudioIOError.InvalidBuffer: - Log.Info("Audio", "Invalid Buffer Error"); - throw new InvalidOperationException(msg); - case AudioIOError.SoundPolicy: - Log.Info("Audio", "Sound Policy Error"); - throw new Exception(msg); - case AudioIOError.InvalidState: - Log.Info("Audio", "Invalid State Error"); - throw new InvalidOperationException(msg); - case AudioIOError.NotSupportedType: - Log.Info("Audio", "Not supported stream type Error"); - throw new NotSupportedException(msg); - default: - Log.Info("Audio", "Unknown Exception" + code); - throw new Exception(msg); - } - } - - internal static void ValidateState(AudioIOState curState, params AudioIOState[] desiredStates) - { - Debug.Assert(desiredStates.Length > 0); - - if (desiredStates.Contains(curState)) - { - return; - } - - throw new InvalidOperationException($"The audio is not in a valid state. " + - $"Current State : { curState }, Valid State : { string.Join(", ", desiredStates) }."); - } - } -} diff --git a/src/Tizen.Multimedia.AudioIO/AudioIO/AudioPlayback.cs b/src/Tizen.Multimedia.AudioIO/AudioIO/AudioPlayback.cs deleted file mode 100644 index 4d935dbef..000000000 --- a/src/Tizen.Multimedia.AudioIO/AudioIO/AudioPlayback.cs +++ /dev/null @@ -1,391 +0,0 @@ -/* - * 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 static Interop.AudioIO; - -namespace Tizen.Multimedia -{ - /// - /// Provides the ability to directly manage the system audio output devices and play the PCM (pulse-code modulation) data. - /// - public class AudioPlayback : IDisposable - { - /// - /// Specifies the minimum value allowed for the audio capture, in Hertz (Hz). - /// - /// - public static readonly int MinSampleRate = 8000; - - /// - /// Specifies the maximum value allowed for the audio capture, in Hertz (Hz). - /// - /// - public static readonly int MaxSampleRate = 48000; - - private IntPtr _handle = IntPtr.Zero; - - private AudioIOState _state = AudioIOState.Idle; - - #region Event - /// - /// Occurs when the audio playback data can be written. - /// - /// - public event EventHandler BufferAvailable; - - private AudioStreamCallback _streamCallback; - - private void RegisterStreamCallback() - { - _streamCallback = (IntPtr handle, uint bytes, IntPtr _) => - { - BufferAvailable?.Invoke(this, new AudioPlaybackBufferAvailableEventArgs((int)bytes)); - }; - - AudioIOUtil.ThrowIfError( - AudioOutput.SetStreamChangedCallback(_handle, _streamCallback, IntPtr.Zero), - $"Failed to create {nameof(AudioPlayback)}"); - } - - /// - /// Occurs when the state of the AudioPlayback is changed. - /// - public event EventHandler StateChanged; - - private AudioStateChangedCallback _stateChangedCallback; - - private void RegisterStateChangedCallback() - { - _stateChangedCallback = (IntPtr handle, int previous, int current, bool byPolicy, IntPtr _) => - { - _state = (AudioIOState)current; - - StateChanged?.Invoke(this, - new AudioIOStateChangedEventArgs((AudioIOState)previous, _state, byPolicy)); - }; - - AudioIOUtil.ThrowIfError( - AudioOutput.SetStateChangedCallback(_handle, _stateChangedCallback, IntPtr.Zero), - $"Failed to create {nameof(AudioPlayback)}"); - } - #endregion - - /// - /// Initializes a new instance of the AudioPlayback class with the specified sample rate, channel, and sample type. - /// - /// The audio sample rate (8000 ~ 48000Hz). - /// The audio channel type. - /// The audio sample type. - /// - /// is less than .\n - /// -or-\n - /// is greater than . - /// - /// - /// is invalid.\n - /// -or-\n - /// is invalid. - /// - public AudioPlayback(int sampleRate, AudioChannel channel, AudioSampleType sampleType) - { - if (sampleRate < MinSampleRate || MaxSampleRate < sampleRate) - { - throw new ArgumentOutOfRangeException(nameof(sampleRate), sampleRate, - $"Valid sampleRate range is { MinSampleRate } <= x <= { MaxSampleRate }."); - } - - ValidationUtil.ValidateEnum(typeof(AudioChannel), channel, nameof(channel)); - ValidationUtil.ValidateEnum(typeof(AudioSampleType), sampleType, nameof(sampleType)); - - SampleRate = sampleRate; - Channel = channel; - SampleType = sampleType; - - AudioIOUtil.ThrowIfError( - AudioOutput.Create(SampleRate, (int)Channel, (int)SampleType, out _handle), - $"Failed to create {nameof(AudioPlayback)}"); - - RegisterStreamCallback(); - RegisterStateChangedCallback(); - } - - ~AudioPlayback() - { - Dispose(false); - } - - #region Dispose support - private bool _isDisposed = false; - - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - - protected virtual void Dispose(bool disposing) - { - if (_isDisposed) - { - return; - } - - if (_handle != IntPtr.Zero) - { - if (_state != AudioIOState.Idle) - { - try - { - Unprepare(); - } - catch (Exception) - { - } - } - - AudioOutput.Destroy(_handle); - _handle = IntPtr.Zero; - _isDisposed = true; - } - } - - private void ValidateNotDisposed() - { - if (_isDisposed) - { - throw new ObjectDisposedException(GetType().Name); - } - } - #endregion - - private void ValidateState(params AudioIOState[] desiredStates) - { - ValidateNotDisposed(); - - AudioIOUtil.ValidateState(_state, desiredStates); - } - - /// - /// Gets the sample rate of the audio output data stream, in Hertz (Hz). - /// - public int SampleRate { get; } - - /// - /// Gets the channel type of the audio output data stream. - /// - public AudioChannel Channel { get; } - - /// - /// Gets the sample type of the audio output data stream. - /// - public AudioSampleType SampleType { get; } - - /// - /// Gets the sound type supported by the audio output device. - /// - /// The AudioPlayback has already been disposed of. - public AudioStreamType StreamType - { - get - { - ValidateNotDisposed(); - - int audioType = 0; - int ret = AudioOutput.GetSoundType(_handle, out audioType); - MultimediaDebug.AssertNoError(ret); - - return (AudioStreamType)audioType; - } - } - - /// - /// Gets the size allocated for the audio output buffer. - /// - /// The AudioPlayback has already been disposed of. - public int GetBufferSize() - { - AudioIOUtil.ThrowIfError(AudioOutput.GetBufferSize(_handle, out var size)); - return size; - } - - /// - /// Drains the buffered audio data from the output stream. - /// It blocks the calling thread until the drain of the stream buffer is complete, for example, at the end of playback. - /// - /// The AudioPlayback has already been disposed of. - /// The current state is . - public void Drain() - { - ValidateState(AudioIOState.Running, AudioIOState.Paused); - - int ret = AudioOutput.Drain(_handle); - - MultimediaDebug.AssertNoError(ret); - } - - /// - /// Starts writing the audio data to the device. - /// - /// The buffer to write. - /// The written size. - /// is null. - /// The length of is zero. - /// The current state is not . - /// The AudioPlayback has already been disposed of. - public int Write(byte[] buffer) - { - ValidateState(AudioIOState.Running); - - if (buffer == null) - { - throw new ArgumentNullException(nameof(buffer)); - } - - if (buffer.Length == 0) - { - throw new ArgumentException("buffer has no data.(the Length is zero.)", nameof(buffer)); - } - - int ret = AudioOutput.Write(_handle, buffer, (uint)buffer.Length); - - AudioIOUtil.ThrowIfError(ret, "Failed to write buffer"); - - return ret; - } - - /// - /// Prepares the AudioPlayback. - /// - /// - /// This must be called before . - /// - /// - /// Operation failed due to an internal error.\n - /// -or-\n - /// The current state is not . - /// - /// The AudioPlayback has already been disposed of. - /// - public void Prepare() - { - ValidateState(AudioIOState.Idle); - - AudioIOUtil.ThrowIfError(AudioOutput.Prepare(_handle), - $"Failed to prepare the {nameof(AudioPlayback)}"); - } - - /// - /// Unprepares the AudioPlayback. - /// - /// - /// Operation failed due to an internal error.\n - /// -or-\n - /// The current state is . - /// - /// The AudioPlayback has already been disposed of. - /// - public void Unprepare() - { - ValidateState(AudioIOState.Running, AudioIOState.Paused); - - AudioIOUtil.ThrowIfError(AudioOutput.Unprepare(_handle), - $"Failed to unprepare the {nameof(AudioPlayback)}"); - } - - /// - /// Pauses feeding of the audio data to the device. - /// - /// It has no effect if the current state is . - /// - /// The current state is .\n - /// -or-\n - /// The method is called in the event handler. - /// - /// The AudioPlayback has already been disposed of. - /// - public void Pause() - { - if (_state == AudioIOState.Paused) - { - return; - } - ValidateState(AudioIOState.Running); - - AudioIOUtil.ThrowIfError(AudioOutput.Pause(_handle)); - } - - /// - /// Resumes feeding of the audio data to the device. - /// - /// It has no effect if the current state is . - /// - /// The current state is .\n - /// -or-\n - /// The method is called in an event handler. - /// - /// The AudioPlayback has already been disposed of. - /// - public void Resume() - { - if (_state == AudioIOState.Running) - { - return; - } - ValidateState(AudioIOState.Paused); - - AudioIOUtil.ThrowIfError(AudioOutput.Resume(_handle)); - } - - /// - /// Flushes and discards the buffered audio data from the output stream. - /// - /// The current state is . - /// The AudioPlayback has already been disposed of. - public void Flush() - { - ValidateState(AudioIOState.Running, AudioIOState.Paused); - - int ret = AudioOutput.Flush(_handle); - - MultimediaDebug.AssertNoError(ret); - } - - /// - /// Applies the sound stream information to the AudioPlayback. - /// - /// The to apply for the AudioPlayback. - /// is null. - /// - /// has already been disposed of.\n - /// -or-\n - /// The AudioPlayback has already been disposed of. - /// - /// is not supported. - /// Not able to retrieve information from . - public void ApplyStreamPolicy(AudioStreamPolicy streamPolicy) - { - if (streamPolicy == null) - { - throw new ArgumentNullException(nameof(streamPolicy)); - } - - ValidateNotDisposed(); - - AudioIOUtil.ThrowIfError(AudioOutput.SetStreamInfo(_handle, streamPolicy.Handle)); - } - } -} diff --git a/src/Tizen.Multimedia.AudioIO/AudioIO/AudioPlaybackBufferAvailableEventArgs.cs b/src/Tizen.Multimedia.AudioIO/AudioIO/AudioPlaybackBufferAvailableEventArgs.cs deleted file mode 100644 index b834894a4..000000000 --- a/src/Tizen.Multimedia.AudioIO/AudioIO/AudioPlaybackBufferAvailableEventArgs.cs +++ /dev/null @@ -1,38 +0,0 @@ -/* - * 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.Multimedia -{ - /// - /// Provides data for the event. - /// - public class AudioPlaybackBufferAvailableEventArgs : EventArgs - { - internal AudioPlaybackBufferAvailableEventArgs(int length) - { - Length = length; - } - - /// - /// Gets the length of the buffer that can be written. - /// - /// The length of the buffer that can be written. - /// - public int Length { get; } - } -} diff --git a/src/Tizen.Multimedia.AudioIO/Interop/Interop.AudioIO.cs b/src/Tizen.Multimedia.AudioIO/Interop/Interop.AudioIO.cs deleted file mode 100644 index 0b75bb8a4..000000000 --- a/src/Tizen.Multimedia.AudioIO/Interop/Interop.AudioIO.cs +++ /dev/null @@ -1,138 +0,0 @@ -/* - * 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; -using Tizen.Multimedia; - -internal static partial class Interop -{ - internal static partial class AudioIO - { - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - public delegate void AudioStreamCallback(IntPtr handle, uint nbytes, IntPtr userdata); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - public delegate void AudioStateChangedCallback(IntPtr handle, int previous, int current, bool byPolicy, IntPtr userData); - - internal static partial class AudioInput - { - [DllImport(Libraries.AudioIO, EntryPoint = "audio_in_set_state_changed_cb")] - internal static extern int SetStateChangedCallback(IntPtr handle, AudioStateChangedCallback callback, IntPtr user_data); - - [DllImport(Libraries.AudioIO, EntryPoint = "audio_in_set_stream_cb")] - internal static extern int SetStreamCallback(IntPtr handle, AudioStreamCallback callback, IntPtr user_data); - - [DllImport(Libraries.AudioIO, EntryPoint = "audio_in_create")] - internal static extern int Create(int sampleRate, int channel, int type, out IntPtr handle); - - [DllImport(Libraries.AudioIO, EntryPoint = "audio_in_destroy")] - internal static extern int Destroy(IntPtr handle); - - [DllImport(Libraries.AudioIO, EntryPoint = "audio_in_set_sound_stream_info")] - internal static extern int SetStreamInfo(IntPtr handle, AudioStreamPolicyHandle streamInfoHandle); - - [DllImport(Libraries.AudioIO, EntryPoint = "audio_in_prepare")] - internal static extern int Prepare(IntPtr handle); - - [DllImport(Libraries.AudioIO, EntryPoint = "audio_in_unprepare")] - internal static extern int Unprepare(IntPtr handle); - - [DllImport(Libraries.AudioIO, EntryPoint = "audio_in_pause")] - internal static extern int Pause(IntPtr handle); - - [DllImport(Libraries.AudioIO, EntryPoint = "audio_in_resume")] - internal static extern int Resume(IntPtr handle); - - [DllImport(Libraries.AudioIO, EntryPoint = "audio_in_flush")] - internal static extern int Flush(IntPtr handle); - - [DllImport(Libraries.AudioIO, EntryPoint = "audio_in_read")] - internal static extern int Read(IntPtr handle, byte[] buffer, int length); - - [DllImport(Libraries.AudioIO, EntryPoint = "audio_in_get_buffer_size")] - internal static extern int GetBufferSize(IntPtr handle, out int size); - - [DllImport(Libraries.AudioIO, EntryPoint = "audio_in_get_sample_rate")] - internal static extern int GetSampleRate(IntPtr handle, out int sampleRate); - - [DllImport(Libraries.AudioIO, EntryPoint = "audio_in_get_channel")] - internal static extern int GetChannel(IntPtr handle, out int channel); - - [DllImport(Libraries.AudioIO, EntryPoint = "audio_in_get_sample_type")] - internal static extern int GetSampleType(IntPtr handle, out int sampleType); - - [DllImport(Libraries.AudioIO, EntryPoint = "audio_in_peek")] - internal static extern int Peek(IntPtr handle, out IntPtr buffer, ref uint length); - - [DllImport(Libraries.AudioIO, EntryPoint = "audio_in_drop")] - internal static extern int Drop(IntPtr handle); - } - internal static partial class AudioOutput - { - [DllImport(Libraries.AudioIO, EntryPoint = "audio_out_set_state_changed_cb")] - internal static extern int SetStateChangedCallback(IntPtr handle, AudioStateChangedCallback callback, IntPtr user_data); - - [DllImport(Libraries.AudioIO, EntryPoint = "audio_out_set_stream_cb")] - internal static extern int SetStreamChangedCallback(IntPtr handle, AudioStreamCallback callback, IntPtr user_data); - - [DllImport(Libraries.AudioIO, EntryPoint = "audio_out_create_new")] - internal static extern int Create(int sampleRate, int channel, int type, out IntPtr handle); - - [DllImport(Libraries.AudioIO, EntryPoint = "audio_out_destroy")] - internal static extern int Destroy(IntPtr handle); - - [DllImport(Libraries.AudioIO, EntryPoint = "audio_out_drain")] - internal static extern int Drain(IntPtr handle); - - [DllImport(Libraries.AudioIO, EntryPoint = "audio_out_flush")] - internal static extern int Flush(IntPtr handle); - - [DllImport(Libraries.AudioIO, EntryPoint = "audio_out_get_buffer_size")] - internal static extern int GetBufferSize(IntPtr handle, out int size); - - [DllImport(Libraries.AudioIO, EntryPoint = "audio_out_get_channel")] - internal static extern int GetChannel(IntPtr handle, out int channel); - - [DllImport(Libraries.AudioIO, EntryPoint = "audio_out_get_sample_rate")] - internal static extern int GetSampleRate(IntPtr handle, out int sampleRate); - - [DllImport(Libraries.AudioIO, EntryPoint = "audio_out_get_sample_type")] - internal static extern int GetSampleType(IntPtr handle, out int sampleType); - - [DllImport(Libraries.AudioIO, EntryPoint = "audio_out_get_sound_type")] - internal static extern int GetSoundType(IntPtr handle, out int soundType); - - [DllImport(Libraries.AudioIO, EntryPoint = "audio_out_pause")] - internal static extern int Pause(IntPtr handle); - - [DllImport(Libraries.AudioIO, EntryPoint = "audio_out_prepare")] - internal static extern int Prepare(IntPtr handle); - - [DllImport(Libraries.AudioIO, EntryPoint = "audio_out_resume")] - internal static extern int Resume(IntPtr handle); - - [DllImport(Libraries.AudioIO, EntryPoint = "audio_out_set_sound_stream_info")] - internal static extern int SetStreamInfo(IntPtr handle, AudioStreamPolicyHandle streamInfoHandle); - - [DllImport(Libraries.AudioIO, EntryPoint = "audio_out_unprepare")] - internal static extern int Unprepare(IntPtr handle); - - [DllImport(Libraries.AudioIO, EntryPoint = "audio_out_write")] - internal static extern int Write(IntPtr handle, byte[] buffer, uint length); - } - } -} diff --git a/src/Tizen.Multimedia.AudioIO/Interop/Interop.Libraries.cs b/src/Tizen.Multimedia.AudioIO/Interop/Interop.Libraries.cs deleted file mode 100644 index 3469f9f8c..000000000 --- a/src/Tizen.Multimedia.AudioIO/Interop/Interop.Libraries.cs +++ /dev/null @@ -1,25 +0,0 @@ -/* - * 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 AudioIO = "libcapi-media-audio-io.so.0"; - public const string WavPlayer = "libcapi-media-wav-player.so.0"; - public const string TonePlayer = "libcapi-media-tone-player.so.0"; - } -} diff --git a/src/Tizen.Multimedia.AudioIO/Interop/Interop.TonePlayer.cs b/src/Tizen.Multimedia.AudioIO/Interop/Interop.TonePlayer.cs deleted file mode 100644 index 14dd2b8d7..000000000 --- a/src/Tizen.Multimedia.AudioIO/Interop/Interop.TonePlayer.cs +++ /dev/null @@ -1,32 +0,0 @@ -/* - * 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.Runtime.InteropServices; -using Tizen.Multimedia; - -internal static partial class Interop -{ - internal static partial class TonePlayer - { - [DllImport(Libraries.TonePlayer, EntryPoint = "tone_player_start_new")] - internal static extern TonePlayerError Start(ToneType tone, AudioStreamPolicyHandle streamInfoHandle, - int durationMs, out int id); - - [DllImport(Libraries.TonePlayer, EntryPoint = "tone_player_stop")] - internal static extern TonePlayerError Stop(int id); - } -} - diff --git a/src/Tizen.Multimedia.AudioIO/Interop/Interop.WavPlayer.cs b/src/Tizen.Multimedia.AudioIO/Interop/Interop.WavPlayer.cs deleted file mode 100644 index 0712ee1c4..000000000 --- a/src/Tizen.Multimedia.AudioIO/Interop/Interop.WavPlayer.cs +++ /dev/null @@ -1,36 +0,0 @@ -/* - * 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; -using Tizen.Multimedia; - -internal static partial class Interop -{ - internal static partial class WavPlayer - { - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void WavPlayerCompletedCallback(int playerId, IntPtr userData); - - [DllImport(Libraries.WavPlayer, EntryPoint = "wav_player_start_new")] - internal static extern WavPlayerError Start(string filePath, AudioStreamPolicyHandle streamInfoHandle, - WavPlayerCompletedCallback completedCallback, IntPtr userData, out int id); - - [DllImport(Libraries.WavPlayer, EntryPoint = "wav_player_stop")] - internal static extern WavPlayerError Stop(int id); - } -} - diff --git a/src/Tizen.Multimedia.AudioIO/Tizen.Multimedia.AudioIO.csproj b/src/Tizen.Multimedia.AudioIO/Tizen.Multimedia.AudioIO.csproj deleted file mode 100644 index ec9bff774..000000000 --- a/src/Tizen.Multimedia.AudioIO/Tizen.Multimedia.AudioIO.csproj +++ /dev/null @@ -1,11 +0,0 @@ - - - - netstandard2.0 - - - - - - - \ No newline at end of file diff --git a/src/Tizen.Multimedia.AudioIO/Tizen.Multimedia.AudioIO.sln b/src/Tizen.Multimedia.AudioIO/Tizen.Multimedia.AudioIO.sln deleted file mode 100755 index 3259fdd0e..000000000 --- a/src/Tizen.Multimedia.AudioIO/Tizen.Multimedia.AudioIO.sln +++ /dev/null @@ -1,72 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26730.12 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Multimedia.AudioIO", "Tizen.Multimedia.AudioIO.csproj", "{6C20E06D-1039-4B5B-B983-A17224B858F5}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Multimedia", "..\Tizen.Multimedia\Tizen.Multimedia.csproj", "{4DE90BF8-94FD-45B5-88E9-B22D627145D2}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen", "..\Tizen\Tizen.csproj", "{219E90A8-248F-473E-884D-BC2E49E02CD1}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ElmSharp", "..\ElmSharp\ElmSharp.csproj", "{9A6470A1-2201-463F-95C4-704924AB8EA6}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Log", "..\Tizen.Log\Tizen.Log.csproj", "{7FEE2C02-DF87-4E31-BF46-984ACE1BBD33}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Applications.Common", "..\Tizen.Applications.Common\Tizen.Applications.Common.csproj", "{539E7A26-C450-464C-A878-D82525218BB3}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.System.Information", "..\Tizen.System.Information\Tizen.System.Information.csproj", "{70D00AC7-C4EB-4067-89DA-2D186AE8223D}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.NUI", "..\Tizen.NUI\Tizen.NUI.csproj", "{F5C30594-8FC3-4D72-81E8-BD8B0CD91D40}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.System.SystemSettings", "..\Tizen.System.SystemSettings\Tizen.System.SystemSettings.csproj", "{3E19AB5E-EDA0-4126-9A71-F04699161E4F}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {6C20E06D-1039-4B5B-B983-A17224B858F5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6C20E06D-1039-4B5B-B983-A17224B858F5}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6C20E06D-1039-4B5B-B983-A17224B858F5}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6C20E06D-1039-4B5B-B983-A17224B858F5}.Release|Any CPU.Build.0 = Release|Any CPU - {4DE90BF8-94FD-45B5-88E9-B22D627145D2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {4DE90BF8-94FD-45B5-88E9-B22D627145D2}.Debug|Any CPU.Build.0 = Debug|Any CPU - {4DE90BF8-94FD-45B5-88E9-B22D627145D2}.Release|Any CPU.ActiveCfg = Release|Any CPU - {4DE90BF8-94FD-45B5-88E9-B22D627145D2}.Release|Any CPU.Build.0 = Release|Any CPU - {219E90A8-248F-473E-884D-BC2E49E02CD1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {219E90A8-248F-473E-884D-BC2E49E02CD1}.Debug|Any CPU.Build.0 = Debug|Any CPU - {219E90A8-248F-473E-884D-BC2E49E02CD1}.Release|Any CPU.ActiveCfg = Release|Any CPU - {219E90A8-248F-473E-884D-BC2E49E02CD1}.Release|Any CPU.Build.0 = Release|Any CPU - {9A6470A1-2201-463F-95C4-704924AB8EA6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {9A6470A1-2201-463F-95C4-704924AB8EA6}.Debug|Any CPU.Build.0 = Debug|Any CPU - {9A6470A1-2201-463F-95C4-704924AB8EA6}.Release|Any CPU.ActiveCfg = Release|Any CPU - {9A6470A1-2201-463F-95C4-704924AB8EA6}.Release|Any CPU.Build.0 = Release|Any CPU - {7FEE2C02-DF87-4E31-BF46-984ACE1BBD33}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7FEE2C02-DF87-4E31-BF46-984ACE1BBD33}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7FEE2C02-DF87-4E31-BF46-984ACE1BBD33}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7FEE2C02-DF87-4E31-BF46-984ACE1BBD33}.Release|Any CPU.Build.0 = Release|Any CPU - {539E7A26-C450-464C-A878-D82525218BB3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {539E7A26-C450-464C-A878-D82525218BB3}.Debug|Any CPU.Build.0 = Debug|Any CPU - {539E7A26-C450-464C-A878-D82525218BB3}.Release|Any CPU.ActiveCfg = Release|Any CPU - {539E7A26-C450-464C-A878-D82525218BB3}.Release|Any CPU.Build.0 = Release|Any CPU - {70D00AC7-C4EB-4067-89DA-2D186AE8223D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {70D00AC7-C4EB-4067-89DA-2D186AE8223D}.Debug|Any CPU.Build.0 = Debug|Any CPU - {70D00AC7-C4EB-4067-89DA-2D186AE8223D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {70D00AC7-C4EB-4067-89DA-2D186AE8223D}.Release|Any CPU.Build.0 = Release|Any CPU - {F5C30594-8FC3-4D72-81E8-BD8B0CD91D40}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F5C30594-8FC3-4D72-81E8-BD8B0CD91D40}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F5C30594-8FC3-4D72-81E8-BD8B0CD91D40}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F5C30594-8FC3-4D72-81E8-BD8B0CD91D40}.Release|Any CPU.Build.0 = Release|Any CPU - {3E19AB5E-EDA0-4126-9A71-F04699161E4F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {3E19AB5E-EDA0-4126-9A71-F04699161E4F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {3E19AB5E-EDA0-4126-9A71-F04699161E4F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {3E19AB5E-EDA0-4126-9A71-F04699161E4F}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {76DC7E80-8ACF-4FF8-854E-DCFF74BEE759} - EndGlobalSection -EndGlobal diff --git a/src/Tizen.Multimedia.AudioIO/TonePlayer/TonePlayer.cs b/src/Tizen.Multimedia.AudioIO/TonePlayer/TonePlayer.cs deleted file mode 100644 index 718c4fe72..000000000 --- a/src/Tizen.Multimedia.AudioIO/TonePlayer/TonePlayer.cs +++ /dev/null @@ -1,137 +0,0 @@ -/* - * 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.Threading; -using System.Threading.Tasks; -using Native = Interop.TonePlayer; - -namespace Tizen.Multimedia -{ - /// - /// Provides the ability to play a tone. - /// - public static class TonePlayer - { - /// - /// Plays a tone, asynchronously. - /// - /// A to play. - /// A . - /// The tone duration in milliseconds. -1 indicates an infinite duration. - /// A task that represents the asynchronous operation. - /// is invalid. - /// is null. - /// is less than -1. - /// Any invalid operations occurred. - /// is not a supported type. - /// has already been disposed of. - public static Task StartAsync(ToneType tone, AudioStreamPolicy streamPolicy, - int durationMilliseconds) - { - return StartAsync(tone, streamPolicy, durationMilliseconds, CancellationToken.None); - } - - /// - /// Plays a tone, asynchronously. - /// - /// A to play. - /// A . - /// The tone duration in milliseconds. -1 indicates an infinite duration. - /// The cancellation token which can be used to stop playing the tone. - /// A task that represents the asynchronous operation. - /// is invalid. - /// is null. - /// is less than -1. - /// Any invalid operations occurred. - /// is not a supported type. - /// has already been disposed of. - public static Task StartAsync(ToneType tone, AudioStreamPolicy streamPolicy, - int durationMilliseconds, CancellationToken cancellationToken) - { - if (durationMilliseconds < -1) - { - throw new ArgumentOutOfRangeException(nameof(durationMilliseconds), durationMilliseconds, - $"{nameof(durationMilliseconds)} can't be less than -1."); - } - - if (streamPolicy == null) - { - throw new ArgumentNullException(nameof(streamPolicy)); - } - - ValidationUtil.ValidateEnum(typeof(ToneType), tone, nameof(tone)); - - if (cancellationToken.IsCancellationRequested) - { - return Task.FromCanceled(cancellationToken); - } - - return StartAsyncCore(tone, streamPolicy, durationMilliseconds, cancellationToken); - } - - private static async Task StartAsyncCore(ToneType tone, AudioStreamPolicy streamPolicy, - int durationMilliseconds, CancellationToken cancellationToken) - { - - var tcs = new TaskCompletionSource(); - - Native.Start(tone, streamPolicy.Handle, durationMilliseconds, out var id). - Validate("Failed to play tone."); - - using (RegisterCancellationAction(tcs, cancellationToken, id)) - { - await WaitForDuration(tcs, cancellationToken, durationMilliseconds); - - await tcs.Task; - } - } - - private static async Task WaitForDuration(TaskCompletionSource tcs, - CancellationToken cancellationToken, int durationMilliseconds) - { - if (durationMilliseconds == -1) - { - return; - } - - try - { - await Task.Delay(durationMilliseconds, cancellationToken); - tcs.TrySetResult(true); - } - catch (TaskCanceledException) - { - } - } - - private static IDisposable RegisterCancellationAction(TaskCompletionSource tcs, - CancellationToken cancellationToken, int id) - { - if (cancellationToken.CanBeCanceled == false) - { - return null; - } - - return cancellationToken.Register(() => - { - Native.Stop(id).Validate("Failed to cancel"); - tcs.TrySetCanceled(); - }); - } - } -} - diff --git a/src/Tizen.Multimedia.AudioIO/TonePlayer/TonePlayerError.cs b/src/Tizen.Multimedia.AudioIO/TonePlayer/TonePlayerError.cs deleted file mode 100644 index e4fd0fa89..000000000 --- a/src/Tizen.Multimedia.AudioIO/TonePlayer/TonePlayerError.cs +++ /dev/null @@ -1,57 +0,0 @@ -/* - * 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.Multimedia -{ - internal enum TonePlayerError - { - None = ErrorCode.None, - InvalidParameter = ErrorCode.InvalidParameter, - InvalidOperation = ErrorCode.InvalidOperation, - TizenErrorTonePlayer = -0x01970000, - TypeNotSupported = TizenErrorTonePlayer | 0x01 - } - - internal static class TonePlayerErrorExtensions - { - internal static void Validate(this TonePlayerError error, string message) - { - if (error == TonePlayerError.None) - { - return; - } - - switch (error) - { - case TonePlayerError.InvalidParameter: - throw new ArgumentException(message); - - case TonePlayerError.TypeNotSupported: - throw new NotSupportedException(message); - - case TonePlayerError.InvalidOperation: - throw new InvalidOperationException(message); - - default: - throw new InvalidOperationException(message); - - } - } - } -} diff --git a/src/Tizen.Multimedia.AudioIO/TonePlayer/ToneType.cs b/src/Tizen.Multimedia.AudioIO/TonePlayer/ToneType.cs deleted file mode 100644 index 1cfc2ecb8..000000000 --- a/src/Tizen.Multimedia.AudioIO/TonePlayer/ToneType.cs +++ /dev/null @@ -1,470 +0,0 @@ -/* - * 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. - */ - -namespace Tizen.Multimedia -{ - /// - /// Specifies the audio codec. - /// - public enum ToneType - { - /// - /// The default tone. - /// - Default = 0, - /// - /// Predefined DTMF 0. - /// - Dtmf0 = 0, - /// - /// Predefined DTMF 1. - /// - Dtmf1, - /// - /// Predefined DTMF 2. - /// - Dtmf2, - /// - /// Predefined DTMF 3. - /// - Dtmf3, - /// - /// Predefined DTMF 4. - /// - Dtmf4, - /// - /// Predefined DTMF 5. - /// - Dtmf5, - /// - /// Predefined DTMF 6. - /// - Dtmf6, - /// - /// Predefined DTMF 7. - /// - Dtmf7, - /// - /// Predefined DTMF 8. - /// - Dtmf8, - /// - /// Predefined DTMF 9. - /// - Dtmf9, - /// - /// Predefined DTMF Star - Asterisk. - /// - DtmfS, - /// - /// Predefined DTMF sharp (#). - /// - DtmfP, - /// - /// Predefined DTMF A (A). - /// - DtmfA, - /// - /// Predefined DTMF B (B). - /// - DtmfB, - /// - /// Predefined DTMF C (C). - /// - DtmfC, - /// - /// Predefined DTMF D (D). - /// - DtmfD, - /// - /// Call supervisory tone, Dial tone: CEPT: 425Hz, continuous. - /// - SupDial, - /// - /// Call supervisory tone, Dial tone: ANSI (IS-95): 350Hz+440Hz, continuous. - /// - AnsiDial, - /// - /// Call supervisory tone, Dial tone: JAPAN: 400Hz, continuous. - /// - JapanDial, - /// - /// Call supervisory tone, Busy: CEPT: 425Hz, 500ms ON, 500ms OFF. - /// - SupBusy, - /// - /// Call supervisory tone, Busy: ANSI (IS-95): 480Hz+620Hz, 500ms ON, 500ms OFF. - /// - AnsiBusy, - /// - /// Call supervisory tone, Busy: JAPAN: 400Hz, 500ms ON, 500ms OFF. - /// - JapanBusy, - /// - /// Call supervisory tone, Congestion: CEPT, JAPAN: 425Hz, 200ms ON, 200ms OFF. - /// - SupCongestion, - /// - /// Call supervisory tone, Congestion: ANSI (IS-95): 480Hz+620Hz, 250ms ON, 250ms OFF. - /// - AnsiCongestion, - /// - /// Call supervisory tone, Radio path acknowledgment : CEPT, ANSI: 425Hz, 200ms ON. - /// - SupRadioAck, - /// - /// Call supervisory tone, Radio path acknowledgment : JAPAN: 400Hz, 1s ON, 2s OFF. - /// - JapanRadioAck, - /// - /// Call supervisory tone, Radio path not available: 425Hz, 200ms ON, 200 OFF 3 bursts. - /// - SupRadioNotAvailable, - /// - /// Call supervisory tone, Error/Special info: 950Hz+1400Hz+1800Hz, 330ms ON, 1s OFF. - /// - SupError, - /// - /// Call supervisory tone, Call Waiting: CEPT, JAPAN: 425Hz, 200ms ON, 600ms OFF, 200ms ON, 3s OFF. - /// - SupCallWaiting, - /// - /// Call supervisory tone, Call Waiting: ANSI (IS-95): 440 Hz, 300 ms ON, 9.7 s OFF, (100 ms ON, 100 ms OFF, 100 ms ON, 9.7s OFF. - /// - AnsiCallWaiting, - /// - /// Call supervisory tone, Ring Tone: CEPT, JAPAN: 425Hz, 1s ON, 4s OFF. - /// - SupRingtone, - /// - /// Call supervisory tone, Ring Tone: ANSI (IS-95): 440Hz + 480Hz, 2s ON, 4s OFF. - /// - AnsiRingtone, - /// - /// General beep: 400Hz+1200Hz, 35ms ON. - /// - PropBeep, - /// - /// Proprietary tone, positive acknowledgment: 1200Hz, 100ms ON, 100ms OFF 2 bursts. - /// - PropAck, - /// - /// Proprietary tone, negative acknowledgment: 300Hz+400Hz+500Hz, 400ms ON. - /// - PropNack, - /// - /// Proprietary tone, prompt tone: 400Hz+1200Hz, 200ms ON. - /// - PropPrompt, - /// - /// Proprietary tone, general double beep: twice 400Hz+1200Hz, 35ms ON, 200ms OFF, 35ms ON. - /// - PropBeep2, - /// - /// Call supervisory tone (IS-95), intercept tone: alternating 440 Hz and 620 Hz tones, each on for 250 ms. - /// - SupIntercept, - /// - /// Call supervisory tone (IS-95), abbreviated intercept: intercept tone limited to 4 seconds. - /// - SupInterceptAbbrev, - /// - /// Call supervisory tone (IS-95), abbreviated congestion: congestion tone limited to 4 seconds. - /// - SupCongestionAbbrev, - /// - /// Call supervisory tone (IS-95), confirm tone: a 350 Hz tone added to a 440 Hz tone repeated 3 times in a 100 ms on, 100 ms off cycle. - /// - SupConfirm, - /// - /// Call supervisory tone (IS-95), pip tone: four bursts of 480 Hz tone (0.1 s on, 0.1 s off). - /// - SupPip, - /// - /// 425Hz continuous. - /// - CdmaDialToneLite, - /// - /// CDMA USA Ringback: 440Hz+480Hz 2s ON, 4000 OFF. - /// - CdmaNetworkUsaRingback, - /// - /// CDMA Intercept tone: 440Hz 250ms ON, 620Hz 250ms ON. - /// - CdmaIntercept, - /// - /// CDMA Abbr Intercept tone: 440Hz 250ms ON, 620Hz 250ms ON. - /// - CdmaAbbrIntercept, - /// - /// CDMA Reorder tone: 480Hz+620Hz 250ms ON, 250ms OFF. - /// - CdmaReorder, - /// - /// CDMA Abbr Reorder tone: 480Hz+620Hz 250ms ON, 250ms OFF repeated for 8 times. - /// - CdmaAbbrReorder, - /// - /// CDMA Network Busy tone: 480Hz+620Hz 500ms ON, 500ms OFF continuous. - /// - CdmaNetworkBusy, - /// - /// CDMA Confirm tone: 350Hz+440Hz 100ms ON, 100ms OFF repeated for 3 times. - /// - CdmaConfirm, - /// - /// CDMA answer tone: silent tone - definition Frequency 0, 0ms ON, 0ms OFF. - /// - CdmaAnswer, - /// - /// CDMA Network Callwaiting tone: 440Hz 300ms ON. - /// - CdmaNetworkCallWaiting, - /// - /// CDMA PIP tone: 480Hz 100ms ON, 100ms OFF repeated for 4 times. - /// - CdmaPip, - /// - /// ISDN Call Signal Normal tone: {2091Hz 32ms ON, 2556 64ms ON} 20 times, 2091 32ms ON, 2556 48ms ON, 4s OFF. - /// - CdmaCallSignalIsdnNormal, - /// - /// ISDN Call Signal Intergroup tone: {2091Hz 32ms ON, 2556 64ms ON} 8 times, 2091Hz 32ms ON, 400ms OFF, {2091Hz 32ms ON, 2556Hz 64ms ON} 8times, 2091Hz 32ms ON, 4s OFF. - /// - CdmaCallSignalIsdnIntergroup, - /// - /// ISDN Call Signal SP PRI tone:{2091Hz 32ms ON, 2556 64ms ON} 4 times 2091Hz 16ms ON, 200ms OFF, {2091Hz 32ms ON, 2556Hz 64ms ON} 4 times, 2091Hz 16ms ON, 200ms OFF. - /// - CdmaCallSignalIsdnSpPri, - /// - /// ISDN Call sign PAT3 tone: silent tone. - /// - CdmaCallSignalIsdnPat3, - /// - /// ISDN Ping Ring tone: {2091Hz 32ms ON, 2556Hz 64ms ON} 5 times 2091Hz 20ms ON. - /// - CdmaCallSignalIsdnPingRing, - /// - /// ISDN Pat5 tone: silent tone. - /// - CdmaCallSignalIsdnPat5, - /// - /// ISDN Pat6 tone: silent tone. - /// - CdmaCallSignalIsdnPat6, - /// - /// ISDN Pat7 tone: silent tone. - /// - CdmaCallSignalIsdnPat7, - /// - /// TONE_CDMA_HIGH_L tone: {3700Hz 25ms, 4000Hz 25ms} 40 times 4000ms OFF, Repeat. - /// - CdmaHighL, - /// - /// TONE_CDMA_MED_L tone: {2600Hz 25ms, 2900Hz 25ms} 40 times 4000ms OFF, Repeat. - /// - CdmaMedL, - /// - /// TONE_CDMA_LOW_L tone: {1300Hz 25ms, 1450Hz 25ms} 40 times, 4000ms OFF, Repeat. - /// - CdmaLowL, - /// - /// CDMA HIGH SS tone: {3700Hz 25ms, 4000Hz 25ms} repeat 16 times, 400ms OFF, repeat. - /// - CdmaHighSs, - /// - /// CDMA MED SS tone: {2600Hz 25ms, 2900Hz 25ms} repeat 16 times, 400ms OFF, repeat. - /// - CdmaMedSs, - /// - /// CDMA LOW SS tone: {1300z 25ms, 1450Hz 25ms} repeat 16 times, 400ms OFF, repeat. - /// - CdmaLowSs, - /// - /// CDMA HIGH SSL tone: {3700Hz 25ms, 4000Hz 25ms} 8 times, 200ms OFF, {3700Hz 25ms, 4000Hz 25ms} repeat 8 times, 200ms OFF, {3700Hz 25ms, 4000Hz 25ms} repeat 16 times, 4000ms OFF, repeat. - /// - CdmaHighSsl, - /// - /// CDMA MED SSL tone: {2600Hz 25ms, 2900Hz 25ms} 8 times, 200ms OFF, {2600Hz 25ms, 2900Hz 25ms} repeat 8 times, 200ms OFF, {2600Hz 25ms, 2900Hz 25ms} repeat 16 times, 4000ms OFF, repeat. - /// - CdmaMedSsl, - /// - /// CDMA LOW SSL tone: {1300Hz 25ms, 1450Hz 25ms} 8 times, 200ms OFF, {1300Hz 25ms, 1450Hz 25ms} repeat 8 times, 200ms OFF, {1300Hz 25ms, 1450Hz 25ms} repeat 16 times, 4000ms OFF, repeat. - /// - CdmaLowSsl, - /// - /// CDMA HIGH SS2 tone: {3700Hz 25ms, 4000Hz 25ms} 20 times, 1000ms OFF, {3700Hz 25ms, 4000Hz 25ms} 20 times, 3000ms OFF, repeat. - /// - CdmaHighSs2, - /// - /// CDMA MED SS2 tone: {2600Hz 25ms, 2900Hz 25ms} 20 times, 1000ms OFF, {2600Hz 25ms, 2900Hz 25ms} 20 times, 3000ms OFF, repeat. - /// - CdmaMedSs2, - /// - /// CDMA LOW SS2 tone: {1300Hz 25ms, 1450Hz 25ms} 20 times, 1000ms OFF, {1300Hz 25ms, 1450Hz 25ms} 20 times, 3000ms OFF, repeat. - /// - CdmaLowSs2, - /// - /// CDMA HIGH SLS tone: {3700Hz 25ms, 4000Hz 25ms} 10 times, 500ms OFF, {3700Hz 25ms, 4000Hz 25ms} 20 times, 500ms OFF, {3700Hz 25ms, 4000Hz 25ms} 10 times, 3000ms OFF, REPEAT. - /// - CdmaHighSls, - /// - /// CDMA MED SLS tone: {2600Hz 25ms, 2900Hz 25ms} 10 times, 500ms OFF, {2600Hz 25ms, 2900Hz 25ms} 20 times, 500ms OFF, {2600Hz 25ms, 2900Hz 25ms} 10 times, 3000ms OFF, REPEAT. - /// - CdmaMedSls, - /// - /// CDMA LOW SLS tone: {1300Hz 25ms, 1450Hz 25ms} 10 times, 500ms OFF, {1300Hz 25ms, 1450Hz 25ms} 20 times, 500ms OFF, {1300Hz 25ms, 1450Hz 25ms} 10 times, 3000ms OFF, REPEAT. - /// - CdmaLowSls, - /// - /// CDMA HIGH S X4 tone: {3700Hz 25ms, 4000Hz 25ms} 10 times, 500ms OFF, {3700Hz 25ms, 4000Hz 25ms} 10 times, 500ms OFF, {3700Hz 25ms, 4000Hz 25ms} 10 times, 500ms OFF, {3700Hz 25ms, 4000Hz 25ms} 10 times, 2500ms OFF, REPEAT. - /// - CdmaHighSx4, - /// - /// CDMA MED S X4 tone: {2600Hz 25ms, 2900Hz 25ms} 10 times, 500ms OFF, {2600Hz 25ms, 2900Hz 25ms} 10 times, 500ms OFF, {2600Hz 25ms, 2900Hz 25ms} 10 times, 500ms OFF, {2600Hz 25ms, 2900Hz 25ms} 10 times, 2500ms OFF, REPEAT. - /// - CdmaMedSX4, - /// - /// CDMA LOW S X4 tone: {2600Hz 25ms, 2900Hz 25ms} 10 times, 500ms OFF, {2600Hz 25ms, 2900Hz 25ms} 10 times, 500ms OFF, {2600Hz 25ms, 2900Hz 25ms} 10 times, 500ms OFF, {2600Hz 25ms, 2900Hz 25ms} 10 times, 2500ms OFF, REPEAT. - /// - CdmaLowSX4, - /// - /// CDMA HIGH PBX L: {3700Hz 25ms, 4000Hz 25ms}20 times, 2000ms OFF, REPEAT. - /// - CdmaHighPbxL, - /// - /// CDMA MED PBX L: {2600Hz 25ms, 2900Hz 25ms}20 times, 2000ms OFF, REPEAT. - /// - CdmaMedPbxL, - /// - /// CDMA LOW PBX L: {1300Hz 25ms,1450Hz 25ms}20 times, 2000ms OFF, REPEAT. - /// - CdmaLowPbxL, - /// - /// CDMA HIGH PBX SS tone: {3700Hz 25ms, 4000Hz 25ms} 8 times 200 ms OFF, {3700Hz 25ms 4000Hz 25ms}8 times, 2000ms OFF, REPEAT. - /// - CdmaHighPbxSs, - /// - /// CDMA MED PBX SS tone: {2600Hz 25ms, 2900Hz 25ms} 8 times 200 ms OFF, {2600Hz 25ms 2900Hz 25ms}8 times, 2000ms OFF, REPEAT. - /// - CdmaMedPbxSs, - /// - /// CDMA LOW PBX SS tone: {1300Hz 25ms, 1450Hz 25ms} 8 times 200 ms OFF, {1300Hz 25ms 1450Hz 25ms}8 times, 2000ms OFF, REPEAT. - /// - CdmaLowPbxSs, - /// - /// CDMA HIGH PBX SSL tone:{3700Hz 25ms, 4000Hz 25ms} 8 times 200ms OFF, {3700Hz 25ms, 4000Hz 25ms} 8 times, 200ms OFF, {3700Hz 25ms, 4000Hz 25ms} 16 times, 1000ms OFF, REPEAT. - /// - CdmaHighPbxSsl, - /// - /// CDMA MED PBX SSL tone:{2600Hz 25ms, 2900Hz 25ms} 8 times 200ms OFF, {2600Hz 25ms, 2900Hz 25ms} 8 times, 200ms OFF, {2600Hz 25ms, 2900Hz 25ms} 16 times, 1000ms OFF, REPEAT. - /// - CdmaMedPbxSsl, - /// - /// CDMA LOW PBX SSL tone:{1300Hz 25ms, 1450Hz 25ms} 8 times 200ms OFF, {1300Hz 25ms, 1450Hz 25ms} 8 times, 200ms OFF, {1300Hz 25ms, 1450Hz 25ms} 16 times, 1000ms OFF, REPEAT. - /// - CdmaLowPbxSsl, - /// - /// CDMA HIGH PBX SLS tone:{3700Hz 25ms, 4000Hz 25ms} 8 times 200ms OFF, {3700Hz 25ms, 4000Hz 25ms} 16 times, 200ms OFF, {3700Hz 25ms, 4000Hz 25ms} 8 times, 1000ms OFF, REPEAT. - /// - CdmaHighPbxSls, - /// - /// CDMA MED PBX SLS tone:{2600Hz 25ms, 2900Hz 25ms} 8 times 200ms OFF, {2600Hz 25ms, 2900Hz 25ms} 16 times, 200ms OFF, {2600Hz 25ms, 2900Hz 25ms} 8 times, 1000ms OFF, REPEAT. - /// - CdmaMedPbxSls, - /// - /// CDMA LOW PBX SLS tone:{1300Hz 25ms, 1450Hz 25ms} 8 times 200ms OFF, {1300Hz 25ms, 1450Hz 25ms} 16 times, 200ms OFF, {1300Hz 25ms, 1450Hz 25ms} 8 times, 1000ms OFF, REPEAT. - /// - CdmaLowPbxSls, - /// - /// CDMA HIGH PBX X S4 tone: {3700Hz 25ms 4000Hz 25ms} 8 times, 200ms OFF, {3700Hz 25ms 4000Hz 25ms} 8 times, 200ms OFF, {3700Hz 25ms 4000Hz 25ms} 8 times, 200ms OFF, {3700Hz 25ms 4000Hz 25ms} 8 times, 800ms OFF, REPEAT. - /// - CdmaHighPbxSX4, - /// - /// CDMA MED PBX X S4 tone: {2600Hz 25ms 2900Hz 25ms} 8 times, 200ms OFF, {2600Hz 25ms 2900Hz 25ms} 8 times, 200ms OFF, {2600Hz 25ms 2900Hz 25ms} 8 times, 200ms OFF, {2600Hz 25ms 2900Hz 25ms} 8 times, 800ms OFF, REPEAT. - /// - CdmaMedPbxSX4, - /// - /// CDMA LOW PBX X S4 tone: {1300Hz 25ms 1450Hz 25ms} 8 times, 200ms OFF, {1300Hz 25ms 1450Hz 25ms} 8 times, 200ms OFF, {1300Hz 25ms 1450Hz 25ms} 8 times, 200ms OFF, {1300Hz 25ms 1450Hz 25ms} 8 times, 800ms OFF, REPEAT. - /// - CdmaLowPbxSX4, - /// - /// CDMA Alert Network Lite tone: 1109Hz 62ms ON, 784Hz 62ms ON, 740Hz 62ms ON 622Hz 62ms ON, 1109Hz 62ms ON. - /// - CdmaAlertNetworkLite, - /// - ///CDMA Alert Auto Redial tone: {1245Hz 62ms ON, 659Hz 62ms ON} 3 times, 1245 62ms ON. - /// - CdmaAlertAutoRedialLite, - /// - /// CDMA One Min Beep tone: 1150Hz+770Hz 400ms ON. - /// - CdmaOneMinBeep, - /// - /// CDMA KEYPAD Volume key lite tone: 941Hz+1477Hz 120ms ON. - /// - CdmaKeypadVolumeKeyLite, - /// - /// CDMA PRESSHOLDKEY LITE tone: 587Hz 375ms ON, 1175Hz 125ms ON. - /// - CdmaPressHoldKeyLite, - /// - /// CDMA ALERT INCALL LITE tone: 587Hz 62ms, 784 62ms, 831Hz 62ms, 784Hz 62ms, 1109 62ms, 784Hz 62ms, 831Hz 62ms, 784Hz 62ms. - /// - CdmaAlertIncallLite, - /// - /// CDMA EMERGENCY RINGBACK tone: {941Hz 125ms ON, 10ms OFF} 3times 4990ms OFF, REPEAT. - /// - CdmaEmergencyRingback, - /// - /// CDMA ALERT CALL GUARD tone: {1319Hz 125ms ON, 125ms OFF} 3 times. - /// - CdmaAlertCallGuard, - /// - /// CDMA SOFT ERROR LITE tone: 1047Hz 125ms ON, 370Hz 125ms. - /// - CdmaSoftErrorLite, - /// - /// CDMA CALLDROP LITE tone: 1480Hz 125ms, 1397Hz 125ms, 784Hz 125ms. - /// - CdmaCallDropLite, - /// - /// CDMA_NETWORK_BUSY_ONE_SHOT tone: 425Hz 500ms ON, 500ms OFF. - /// - CdmaNetworkBusyOneShot, - /// - /// CDMA_ABBR_ALERT tone: 1150Hz+770Hz 400ms ON. - /// - CdmaAbbrAlert, - /// - /// CDMA_SIGNAL_OFF - silent tone. - /// - CdmaSignalOff, - /// - /// User Defined Tone: 100Hz continuous. - /// - UserDefinedLowFre, - /// - /// User Defined Tone: 200Hz continuous. - /// - UserDefinedMedFre, - /// - /// User Defined Tone: 300Hz continuous. - /// - UserDefinedHighFre - } -} - diff --git a/src/Tizen.Multimedia.AudioIO/WavPlayer/WavPlayer.cs b/src/Tizen.Multimedia.AudioIO/WavPlayer/WavPlayer.cs deleted file mode 100644 index 6e848fe14..000000000 --- a/src/Tizen.Multimedia.AudioIO/WavPlayer/WavPlayer.cs +++ /dev/null @@ -1,123 +0,0 @@ -/* - * 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.IO; -using System.Threading; -using System.Threading.Tasks; -using Native = Interop.WavPlayer; - -namespace Tizen.Multimedia -{ - /// - /// Provides the ability to play a wav file. - /// - public static class WavPlayer - { - /// - /// Plays a wav file based on the specified . - /// - /// A task that represents the asynchronous operation. - /// A file path to play. - /// A . - /// - /// is null. - /// -or- - /// is null. - /// - /// An internal error occurs. - /// does not exists. - /// The format of is not supported. - /// has already been disposed of. - public static Task StartAsync(string path, AudioStreamPolicy streamPolicy) - { - return StartAsync(path, streamPolicy, CancellationToken.None); - } - - /// - /// Plays a wav file based on the specified . - /// - /// A task that represents the asynchronous operation. - /// A file path to play. - /// A . - /// A cancellation token which can be used to stop. - /// - /// is null. - /// -or- - /// is null. - /// - /// An internal error occurs. - /// does not exists. - /// The format of is not supported. - /// has already been disposed of. - public static Task StartAsync(string path, AudioStreamPolicy streamPolicy, - CancellationToken cancellationToken) - { - if (path == null) - { - throw new ArgumentNullException(nameof(path)); - } - - if (streamPolicy == null) - { - throw new ArgumentNullException(nameof(streamPolicy)); - } - - if (File.Exists(path) == false) - { - throw new FileNotFoundException("File does not exists.", path); - } - - return cancellationToken.IsCancellationRequested ? Task.FromCanceled(cancellationToken) : - StartAsyncCore(path, streamPolicy, cancellationToken); - } - - private static async Task StartAsyncCore(string path, AudioStreamPolicy streamPolicy, - CancellationToken cancellationToken) - { - var tcs = new TaskCompletionSource(); - - Native.WavPlayerCompletedCallback cb = (id_, _) => tcs.TrySetResult(true); - - using (ObjectKeeper.Get(cb)) - { - Native.Start(path, streamPolicy.Handle, cb, IntPtr.Zero, out var id). - Validate("Failed to play."); - - using (RegisterCancellationAction(tcs, cancellationToken, id)) - { - await tcs.Task; - } - } - } - - private static IDisposable RegisterCancellationAction(TaskCompletionSource tcs, - CancellationToken cancellationToken, int id) - { - if (cancellationToken.CanBeCanceled == false) - { - return null; - } - - return cancellationToken.Register(() => - { - Native.Stop(id).Validate("Failed to cancel"); - tcs.TrySetCanceled(); - }); - } - } -} - diff --git a/src/Tizen.Multimedia.AudioIO/WavPlayer/WavPlayerError.cs b/src/Tizen.Multimedia.AudioIO/WavPlayer/WavPlayerError.cs deleted file mode 100644 index 4570b22fe..000000000 --- a/src/Tizen.Multimedia.AudioIO/WavPlayer/WavPlayerError.cs +++ /dev/null @@ -1,58 +0,0 @@ -/* - * 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.Multimedia -{ - internal enum WavPlayerError - { - None = ErrorCode.None, - InvalidParameter = ErrorCode.InvalidParameter, - InvalidOperation = ErrorCode.InvalidOperation, - TizenErrorWavPlayer = -0x01990000, - FormatNotSupported = TizenErrorWavPlayer | 0x01, - NotSupportedType = TizenErrorWavPlayer | 0x02 - } - - internal static class WavPlayerErrorExtensions - { - internal static void Validate(this WavPlayerError error, string message) - { - if (error == WavPlayerError.None) - { - return; - } - - switch (error) - { - case WavPlayerError.InvalidParameter: - throw new ArgumentException(message); - - case WavPlayerError.FormatNotSupported: - throw new FileFormatException(message); - - case WavPlayerError.NotSupportedType: - throw new NotSupportedException(message); - - case WavPlayerError.InvalidOperation: - throw new InvalidOperationException(message); - } - } - } - -} diff --git a/src/Tizen.Multimedia.Camera/Camera/Camera.cs b/src/Tizen.Multimedia.Camera/Camera/Camera.cs deleted file mode 100755 index 91f6c645c..000000000 --- a/src/Tizen.Multimedia.Camera/Camera/Camera.cs +++ /dev/null @@ -1,1007 +0,0 @@ -/* - * 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.Collections.Generic; -using System.Diagnostics; -using System.Linq; -using System.Runtime.InteropServices; -using System.Threading; -using static Interop; -using Native = Interop.Camera; - -namespace Tizen.Multimedia -{ - static internal class CameraLog - { - internal const string Tag = "Tizen.Multimedia.Camera"; - internal const string Enter = "[Enter]"; - internal const string Leave = "[Leave]"; - } - - /// - /// This camera class provides methods to capture photos and supports setting up notifications - /// for state changes of capturing, previewing, focusing, and informing about the resolution and the binary format, - /// and functions for picture manipulations like sepia, negative, and many more. - /// It also notifies you when a significant picture parameter changes, (For example, focus). - /// - public class Camera : IDisposable, IDisplayable - { - private IntPtr _handle = IntPtr.Zero; - private bool _disposed = false; - private CameraState _state = CameraState.None; - - /// - /// Initializes a new instance of the class. - /// - /// 3 - /// The camera device to access. - public Camera(CameraDevice device) - { - CameraErrorFactory.ThrowIfError(Native.Create(device, out _handle), - "Failed to create camera instance"); - - Capabilities = new CameraCapabilities(this); - Settings = new CameraSettings(this); - DisplaySettings = new CameraDisplaySettings(this); - - RegisterCallbacks(); - - SetState(CameraState.Created); - } - - /// - /// Destructor of the camera class. - /// - ~Camera() - { - Dispose(false); - } - - public IntPtr Handle => GetHandle(); - - internal IntPtr GetHandle() - { - ValidateNotDisposed(); - return _handle; - } - - #region Dispose support - /// - /// Releases the unmanaged resources used by the camera. - /// - /// true to release both managed and unmanaged resources; false to release only unmanaged resources. - protected virtual void Dispose(bool disposing) - { - if (!_disposed) - { - if (disposing) - { - // to be used if there are any other disposable objects - } - - if (_handle != IntPtr.Zero) - { - Native.Destroy(_handle); - _handle = IntPtr.Zero; - } - - _disposed = true; - } - } - - /// - /// Releases all resources used by the camera. - /// - /// 3 - public void Dispose() - { - ReplaceDisplay(null); - Dispose(true); - GC.SuppressFinalize(this); - } - - internal void ValidateNotDisposed() - { - if (_disposed) - { - Log.Error(CameraLog.Tag, "Camera handle is disposed."); - throw new ObjectDisposedException(nameof(Camera)); - } - } - #endregion Dispose support - - #region Check camera state - internal void ValidateState(params CameraState[] required) - { - ValidateNotDisposed(); - - Debug.Assert(required.Length > 0); - - var curState = _state; - if (!required.Contains(curState)) - { - throw new InvalidOperationException($"The camera is not in a valid state. " + - $"Current State : { curState }, Valid State : { string.Join(", ", required) }."); - } - } - - internal void SetState(CameraState state) - { - _state = state; - } - #endregion Check camera state - - #region EventHandlers - /// - /// An event that occurs when the camera interrupt is started by the policy. - /// - public event EventHandler InterruptStarted; - private Native.InterruptStartedCallback _interruptStartedCallback; - - /// - /// An event that occurs when an camera is interrupted by the policy. - /// - /// 3 - public event EventHandler Interrupted; - private Native.InterruptedCallback _interruptedCallback; - - /// - /// An event that occurs when there is an asynchronous error. - /// - /// 3 - public event EventHandler ErrorOccurred; - private Native.ErrorCallback _errorCallback; - - /// - /// An event that occurs when the auto focus state is changed. - /// - /// 3 - public event EventHandler FocusStateChanged; - private Native.FocusStateChangedCallback _focusStateChangedCallback; - - /// - /// An event that occurs when a face is detected in the preview frame. - /// - /// 3 - public event EventHandler FaceDetected; - private Native.FaceDetectedCallback _faceDetectedCallback; - - /// - /// An event that occurs during capture of an image. - /// - /// 3 - public event EventHandler Capturing; - private Native.CapturingCallback _capturingCallback; - - /// - /// An event that occurs after the capture of the image. - /// - /// 3 - public event EventHandler CaptureCompleted; - private Native.CaptureCompletedCallback _captureCompletedCallback; - - private Native.HdrCaptureProgressCallback _hdrCaptureProgressCallback; - private event EventHandler _hdrCaptureProgress; - private object _hdrCaptureProgressEventLock = new object(); - - /// - /// An event that occurs when there is a change in the HDR capture progress. - /// Checks whether the is supported or not before adding this EventHandler. - /// - /// 3 - /// In case of HDR feature is not supported. - public event EventHandler HdrCaptureProgress - { - add - { - lock (_hdrCaptureProgressEventLock) - { - if (_hdrCaptureProgress == null) - { - RegisterHdrCaptureProgress(); - } - - _hdrCaptureProgress += value; - } - } - - remove - { - lock (_hdrCaptureProgressEventLock) - { - _hdrCaptureProgress -= value; - - if (_hdrCaptureProgress == null) - { - UnregisterHdrCaptureProgress(); - } - } - } - } - - /// - /// An event that occurs when the camera state is changed. - /// - /// 3 - public event EventHandler StateChanged; - private Native.StateChangedCallback _stateChangedCallback; - - private static Native.DeviceStateChangedCallback _deviceStateChangedCallback; - private static event EventHandler _deviceStateChanged; - private static object _deviceStateChangedEventLock = new object(); - private static int _deviceStateCallbackId; - - /// - /// An event that occurs after the is changed. - /// - /// 3 - /// In case of any invalid operations. - /// In case of this feature is not supported. - /// In case of invalid parameters. - public static event EventHandler DeviceStateChanged - { - add - { - lock (_deviceStateChangedEventLock) - { - if (_deviceStateChanged == null) - { - RegisterDeviceStateChangedCallback(); - } - - _deviceStateChanged += value; - } - } - - remove - { - lock (_deviceStateChangedEventLock) - { - _deviceStateChanged -= value; - - if (_deviceStateChanged == null) - { - UnregisterDeviceStateChangedCallback(); - } - } - } - } - - private Native.PreviewCallback _previewCallback; - private event EventHandler _preview; - private object _previewEventLock = new object(); - /// - /// An event that occurs once per frame when previewing. - /// Preview callback is registered when an user adds a callback explicitly to avoid useless P/Invoke. - /// - /// 3 - public event EventHandler Preview - { - add - { - lock (_previewEventLock) - { - if (_preview == null) - { - RegisterPreviewCallback(); - } - - _preview += value; - } - } - - remove - { - lock (_previewEventLock) - { - _preview -= value; - - if (_preview == null) - { - UnregisterPreviewCallback(); - } - } - } - } - - private Native.MediaPacketPreviewCallback _mediaPacketPreviewCallback; - private EventHandler _mediaPacketPreview; - private object _mediaPacketPreviewEventLock = new object(); - - /// - /// An event that occurs once per frame when previewing. - /// Preview callback is registered when an user adds a callback explicitly to avoid useless P/Invoke. - /// - /// 3 - public event EventHandler MediaPacketPreview - { - add - { - lock (_mediaPacketPreviewEventLock) - { - if (_mediaPacketPreview == null) - { - RegisterMediaPacketPreviewCallback(); - } - - _mediaPacketPreview += value; - } - } - - remove - { - lock (_mediaPacketPreviewEventLock) - { - _mediaPacketPreview -= value; - - if (_mediaPacketPreview == null) - { - UnregisterMediaPacketPreviewCallback(); - } - } - } - } - #endregion EventHandlers - - #region Properties - /// - /// Gets or sets the various camera settings. - /// - /// 3 - public CameraSettings Settings { get; } - - /// - /// Gets the various camera capabilities. - /// - /// 3 - public CameraCapabilities Capabilities { get; } - - /// - /// Get/set various camera display properties. - /// - /// 3 - public CameraDisplaySettings DisplaySettings { get; } - - private Display _display; - - private CameraError SetDisplay(Display display) - { - if (display == null) - { - return CameraDisplay.SetTarget(GetHandle(), DisplayType.None, IntPtr.Zero); - } - - return display.ApplyTo(this); - } - - private void ReplaceDisplay(Display newDisplay) - { - _display?.SetOwner(null); - _display = newDisplay; - _display?.SetOwner(this); - } - - /// - /// Sets or gets the display type and handle to show preview images. - /// The camera must be in the state. - /// - /// 3 - /// - /// This must be set before the StartPreview() method. - /// In custom ROI display mode, DisplayRoiArea property must be set before calling this method. - /// - /// In case of any invalid operations. - /// In case of this feature is not supported. - /// The camera already has been disposed of. - /// In case of access to the resources cannot be granted. - public Display Display - { - get - { - return _display; - } - - set - { - ValidateState(CameraState.Created); - - if (value?.Owner != null) - { - if (ReferenceEquals(this, value.Owner)) - { - return; - } - - throw new ArgumentException("The display has already been assigned to another."); - } - - CameraErrorFactory.ThrowIfError(SetDisplay(value), "Failed to set the camera display"); - - ReplaceDisplay(value); - } - } - - CameraError IDisplayable.ApplyEvasDisplay(DisplayType type, ElmSharp.EvasObject evasObject) - { - Debug.Assert(_disposed == false); - ValidationUtil.ValidateEnum(typeof(DisplayType), type, nameof(type)); - - return CameraDisplay.SetTarget(GetHandle(), type, evasObject); - } - - CameraError IDisplayable.ApplyEcoreWindow(IntPtr windowHandle) - { - throw new NotSupportedException("Camera does not support NUI.Window display."); - } - - /// - /// Gets the state of the camera. - /// - /// 3 - /// None, Created, Preview, Capturing, Captured. - /// The camera already has been disposed of. - public CameraState State - { - get - { - ValidateNotDisposed(); - - CameraState val = CameraState.None; - CameraErrorFactory.ThrowIfError(Native.GetState(_handle, out val), - "Failed to get camera state"); - - return val; - } - } - - /// - /// The hint for the display reuse. - /// If the hint is set to true, the display will be reused when the camera device is changed with - /// the ChangeDevice method. - /// - /// 3 - /// In case of invalid parameters. - /// An invalid state. - /// The camera already has been disposed of. - public bool DisplayReuseHint - { - get - { - ValidateNotDisposed(); - - CameraErrorFactory.ThrowIfError(Native.GetDisplayReuseHint(_handle, out bool val), - "Failed to get camera display reuse hint"); - - return val; - } - - set - { - ValidateState(CameraState.Preview); - - CameraErrorFactory.ThrowIfError(Native.SetDisplayReuseHint(_handle, value), - "Failed to set display reuse hint."); - } - } - - /// - /// Gets the facing direction of the camera module. - /// - /// 3 - /// A that specifies the facing direction of the camera device. - /// The camera already has been disposed of. - public CameraFacingDirection Direction - { - get - { - ValidateNotDisposed(); - - CameraErrorFactory.ThrowIfError(Native.GetFacingDirection(_handle, out var val), - "Failed to get camera direction"); - - return val; - } - } - - /// - /// Gets the camera device count. - /// - /// 3 - /// This returns 2, if the device supports primary and secondary cameras. - /// Otherwise 1, if the device only supports primary camera. - /// The camera already has been disposed of. - public int CameraCount - { - get - { - ValidateNotDisposed(); - - CameraErrorFactory.ThrowIfError(Native.GetDeviceCount(_handle, out int val), - "Failed to get camera device count"); - - return val; - } - } - #endregion Properties - - #region Methods - /// - /// Changes the camera device. - /// - /// 3 - /// The hardware camera to access. - /// - /// If display reuse is set using - /// before stopping the preview, the display will be reused and last frame on the display - /// can be kept even though camera device is changed. - /// The camera must be in the . - /// - /// In case of invalid parameters. - /// In case of any invalid operations. - /// In case of the ChangeDevice feature is not supported. - /// The camera already has been disposed of. - public void ChangeDevice(CameraDevice device) - { - ValidateState(CameraState.Created); - ValidationUtil.ValidateEnum(typeof(CameraDevice), device, nameof(device)); - - CameraErrorFactory.ThrowIfError(Native.ChangeDevice(_handle, device), - "Failed to change the camera device"); - } - - /// - /// Gets the device state. - /// - /// 3 - /// The device to get the state. - /// Returns the state of the camera device. - /// In case of invalid parameters. - /// In case of any invalid operations. - /// In case of this feature is not supported. - public static CameraDeviceState GetDeviceState(CameraDevice device) - { - ValidationUtil.ValidateEnum(typeof(CameraDevice), device, nameof(device)); - - CameraErrorFactory.ThrowIfError(Native.GetDeviceState(device, out var val), - "Failed to get the camera device state."); - - return val; - } - - /// - /// Gets the flash state. - /// - /// 3 - /// The device to get the state. - /// Returns the flash state of the camera device. - /// In case of invalid parameters. - /// In case of any invalid operations. - /// In case of this feature is not supported. - public static CameraFlashState GetFlashState(CameraDevice device) - { - ValidationUtil.ValidateEnum(typeof(CameraDevice), device, nameof(device)); - - CameraErrorFactory.ThrowIfError(Native.GetFlashState(device, out var val), - "Failed to get camera flash state"); - - return val; - } - - /// - /// Starts capturing and drawing preview frames on the screen. - /// The display property must be set using before using this method. - /// If needed set fps , preview resolution - /// , or preview format - /// before using this method. - /// The camera must be in the or the state. - /// - /// 3 - /// - /// http://tizen.org/privilege/camera - /// - /// In case of any invalid operations. - /// In case of this feature is not supported. - /// The camera already has been disposed of. - /// In case of access to the resources cannot be granted. - public void StartPreview() - { - ValidateState(CameraState.Created, CameraState.Captured); - - CameraErrorFactory.ThrowIfError(Native.StartPreview(_handle), - "Failed to start the camera preview."); - - // Update by StateChangedCallback can be delayed for dozens of milliseconds. - SetState(CameraState.Preview); - } - - /// - /// Stops capturing and drawing preview frames on the screen. - /// The camera must be in the state. - /// - /// 3 - /// - /// http://tizen.org/privilege/camera - /// - /// In case of any invalid operations. - /// In case of this feature is not supported. - /// The camera already has been disposed of. - /// In case of access to the resources cannot be granted. - public void StopPreview() - { - ValidateState(CameraState.Preview); - - CameraErrorFactory.ThrowIfError(Native.StopPreview(_handle), - "Failed to stop the camera preview."); - - SetState(CameraState.Created); - } - - /// - /// Starts capturing of still images. - /// EventHandler must be set for capturing using - /// and for completed using before calling this method. - /// The camera must be in the state. - /// - /// 3 - /// - /// http://tizen.org/privilege/camera - /// - /// - /// This function causes the transition of the camera state from capturing to captured - /// automatically and the corresponding EventHandlers will be invoked. - /// The preview should be restarted by calling the method after capture is completed. - /// - /// In case of any invalid operations. - /// In case of this feature is not supported. - /// The camera already has been disposed of. - /// In case of access to the resources cannot be granted. - public void StartCapture() - { - ValidateState(CameraState.Preview); - - CameraErrorFactory.ThrowIfError(Native.StartCapture(_handle, _capturingCallback, _captureCompletedCallback, IntPtr.Zero), - "Failed to start the camera capture."); - - SetState(CameraState.Capturing); - } - - /// - /// Starts continuously capturing still images. - /// EventHandler must be set for capturing using - /// and for completed using before calling this method. - /// The camera must be in the state. - /// - /// 3 - /// - /// http://tizen.org/privilege/camera - /// - /// The number of still images. - /// The interval of the capture(milliseconds). - /// The cancellation token to cancel capturing. - /// - /// - /// If this is not supported, zero shutter lag occurs. The capture resolution could be - /// changed to the preview resolution. This function causes the transition of the camera state - /// from capturing to captured automatically and the corresponding Eventhandlers will be invoked. - /// Each captured image will be delivered through Eventhandler set using the event. - /// The preview should be restarted by calling the method after capture is completed. - /// - /// In case of invalid parameters. - /// In case of any invalid operations. - /// In case of this feature is not supported. - /// The camera already has been disposed of. - /// In case of access to the resources cannot be granted. - public void StartCapture(int count, int interval, CancellationToken cancellationToken) - { - ValidateState(CameraState.Preview); - - if (count < 2) - { - throw new ArgumentOutOfRangeException(nameof(count), count, $"{nameof(count)} should be greater than one."); - } - - if (interval < 0) - { - throw new ArgumentOutOfRangeException(nameof(interval), interval, $"{nameof(interval)} should be greater than or equal to zero."); - } - - //Handle CancellationToken - if (cancellationToken != CancellationToken.None) - { - cancellationToken.Register(() => - { - CameraErrorFactory.ThrowIfError(Native.StopContinuousCapture(_handle), - "Failed to cancel the continuous capture"); - SetState(CameraState.Captured); - }); - } - - CameraErrorFactory.ThrowIfError(Native.StartContinuousCapture(_handle, count, interval, - _capturingCallback, _captureCompletedCallback, IntPtr.Zero), "Failed to start the continuous capture."); - - SetState(CameraState.Capturing); - } - - /// - /// Starts camera auto-focusing, asynchronously. - /// The camera must be in the or the state. - /// - /// 3 - /// Continuous auto focus. - /// - /// http://tizen.org/privilege/camera - /// - /// - /// If continuous status is true, the camera continuously tries to focus. - /// - /// In case of invalid parameters. - /// In case of any invalid operations. - /// In case of this feature is not supported. - /// The camera already has been disposed of. - /// In case of access to the resources cannot be granted. - public void StartFocusing(bool continuous) - { - ValidateState(CameraState.Preview, CameraState.Captured); - - CameraErrorFactory.ThrowIfError(Native.StartFocusing(_handle, continuous), - "Failed to cancel the camera focus."); - } - - /// - /// Stops camera auto focusing. - /// The camera must be in the or the state. - /// - /// 3 - /// - /// http://tizen.org/privilege/camera - /// - /// In case of any invalid operations. - /// In case of this feature is not supported. - /// The camera already has been disposed of. - /// In case of access to the resources cannot be granted. - public void StopFocusing() - { - ValidateState(CameraState.Preview, CameraState.Captured); - - CameraErrorFactory.ThrowIfError(Native.CancelFocusing(_handle), - "Failed to cancel the camera focus."); - } - - /// - /// Starts face detection. - /// The camera must be in the state. - /// - /// 3 - /// - /// http://tizen.org/privilege/camera - /// - /// - /// This should be called after is started. - /// The Eventhandler set using is invoked when the face is detected in the preview frame. - /// Internally, it starts continuously focus and focusing on the detected face. - /// - /// In case of any invalid operations. - /// In case of this feature is not supported. - /// The camera already has been disposed of. - /// In case of access to the resources cannot be granted. - public void StartFaceDetection() - { - ValidateState(CameraState.Preview); - - _faceDetectedCallback = (IntPtr faces, int count, IntPtr userData) => - { - var result = new List(); - IntPtr current = faces; - - for (int i = 0; i < count; i++) - { - result.Add(new FaceDetectionData(current)); - current = IntPtr.Add(current, Marshal.SizeOf()); - } - - FaceDetected?.Invoke(this, new FaceDetectedEventArgs(result)); - }; - CameraErrorFactory.ThrowIfError(Native.StartFaceDetection(_handle, _faceDetectedCallback, IntPtr.Zero), - "Failed to start face detection"); - } - - /// - /// Stops face detection. - /// - /// 3 - /// - /// http://tizen.org/privilege/camera - /// - /// In case of any invalid operations. - /// In case of this feature is not supported. - /// The camera already has been disposed of. - /// In case of access to the resources cannot be granted. - public void StopFaceDetection() - { - if (_faceDetectedCallback == null) - { - throw new InvalidOperationException("The face detection is not started."); - } - - CameraErrorFactory.ThrowIfError(Native.StopFaceDetection(_handle), - "Failed to stop the face detection."); - - _faceDetectedCallback = null; - } - #endregion Methods - - #region Callback registrations - private void RegisterCallbacks() - { - RegisterErrorCallback(); - RegisterFocusStateChanged(); - RegisterInterruptStartedCallback(); - RegisterInterruptedCallback(); - RegisterStateChangedCallback(); - - //Define capturing callback - _capturingCallback = (IntPtr main, IntPtr postview, IntPtr thumbnail, IntPtr userData) => - { - Capturing?.Invoke(this, new CameraCapturingEventArgs(new StillImage(main), - postview == IntPtr.Zero ? null : new StillImage(postview), - thumbnail == IntPtr.Zero ? null : new StillImage(thumbnail))); - }; - - //Define captureCompleted callback - _captureCompletedCallback = _ => - { - SetState(CameraState.Captured); - CaptureCompleted?.Invoke(this, EventArgs.Empty); - }; - } - - private void RegisterInterruptStartedCallback() - { - _interruptStartedCallback = (CameraPolicy policy, CameraState state, IntPtr userData) => - { - InterruptStarted?.Invoke(this, new CameraInterruptStartedEventArgs(policy, state)); - }; - CameraErrorFactory.ThrowIfError(Native.SetInterruptStartedCallback(_handle, _interruptStartedCallback, IntPtr.Zero), - "Failed to set interrupt callback"); - } - - private void RegisterInterruptedCallback() - { - _interruptedCallback = (CameraPolicy policy, CameraState previous, CameraState current, IntPtr userData) => - { - Interrupted?.Invoke(this, new CameraInterruptedEventArgs(policy, previous, current)); - }; - CameraErrorFactory.ThrowIfError(Native.SetInterruptedCallback(_handle, _interruptedCallback, IntPtr.Zero), - "Failed to set interrupt callback"); - } - - private void RegisterErrorCallback() - { - _errorCallback = (CameraErrorCode error, CameraState current, IntPtr userData) => - { - ErrorOccurred?.Invoke(this, new CameraErrorOccurredEventArgs(error, current)); - }; - CameraErrorFactory.ThrowIfError(Native.SetErrorCallback(_handle, _errorCallback, IntPtr.Zero), - "Setting error callback failed"); - } - - private void RegisterStateChangedCallback() - { - _stateChangedCallback = (CameraState previous, CameraState current, bool byPolicy, IntPtr _) => - { - SetState(current); - Log.Info(CameraLog.Tag, "Camera state changed " + previous.ToString() + " -> " + current.ToString()); - StateChanged?.Invoke(this, new CameraStateChangedEventArgs(previous, current, byPolicy)); - }; - CameraErrorFactory.ThrowIfError(Native.SetStateChangedCallback(_handle, _stateChangedCallback, IntPtr.Zero), - "Setting state changed callback failed"); - } - - private static void RegisterDeviceStateChangedCallback() - { - _deviceStateChangedCallback = (CameraDevice device, CameraDeviceState state, IntPtr userData) => - { - _deviceStateChanged?.Invoke(null, new CameraDeviceStateChangedEventArgs(device, state)); - }; - - CameraErrorFactory.ThrowIfError(Native.SetDeviceStateChangedCallback(_deviceStateChangedCallback, IntPtr.Zero, out _deviceStateCallbackId), - "Failed to set device state changed callback"); - - Log.Info(CameraLog.Tag, "add callbackId " + _deviceStateCallbackId.ToString()); - } - - private static void UnregisterDeviceStateChangedCallback() - { - CameraErrorFactory.ThrowIfError(Native.UnsetDeviceStateChangedCallback(_deviceStateCallbackId), - "Unsetting device state changed callback failed"); - _deviceStateChangedCallback = null; - _deviceStateCallbackId = 0; - } - - private void RegisterFocusStateChanged() - { - _focusStateChangedCallback = (CameraFocusState state, IntPtr userData) => - { - FocusStateChanged?.Invoke(this, new CameraFocusStateChangedEventArgs(state)); - }; - CameraErrorFactory.ThrowIfError(Native.SetFocusStateChangedCallback(_handle, _focusStateChangedCallback, IntPtr.Zero), - "Setting focus changed callback failed"); - } - - private void RegisterHdrCaptureProgress() - { - _hdrCaptureProgressCallback = (int percent, IntPtr userData) => - { - _hdrCaptureProgress?.Invoke(this, new HdrCaptureProgressEventArgs(percent)); - }; - CameraErrorFactory.ThrowIfError(Native.SetHdrCaptureProgressCallback(_handle, _hdrCaptureProgressCallback, IntPtr.Zero), - "Setting Hdr capture progress callback failed"); - } - - private void UnregisterHdrCaptureProgress() - { - CameraErrorFactory.ThrowIfError(Native.UnsetHdrCaptureProgressCallback(_handle), - "Unsetting hdr capture progress is failed"); - _hdrCaptureProgressCallback = null; - } - - private void RegisterPreviewCallback() - { - _previewCallback = (IntPtr frame, IntPtr userData) => - { - _preview?.Invoke(this, new PreviewEventArgs(new PreviewFrame(frame))); - }; - CameraErrorFactory.ThrowIfError(Native.SetPreviewCallback(_handle, _previewCallback, IntPtr.Zero), - "Setting preview callback failed"); - } - - private void UnregisterPreviewCallback() - { - CameraErrorFactory.ThrowIfError(Native.UnsetPreviewCallback(_handle), - "Unsetting preview callback failed"); - _previewCallback = null; - } - - private void RegisterMediaPacketPreviewCallback() - { - _mediaPacketPreviewCallback = (IntPtr mediaPacket, IntPtr userData) => - { - MediaPacket packet = MediaPacket.From(mediaPacket); - var eventHandler = _mediaPacketPreview; - - if (eventHandler != null) - { - eventHandler.Invoke(this, new MediaPacketPreviewEventArgs(packet)); - } - else - { - packet.Dispose(); - } - }; - CameraErrorFactory.ThrowIfError(Native.SetMediaPacketPreviewCallback(_handle, _mediaPacketPreviewCallback, IntPtr.Zero), - "Setting media packet preview callback failed"); - } - - private void UnregisterMediaPacketPreviewCallback() - { - CameraErrorFactory.ThrowIfError(Native.UnsetMediaPacketPreviewCallback(_handle), - "Unsetting media packet preview callback failed"); - _mediaPacketPreviewCallback = null; - } - #endregion Callback registrations - } -} diff --git a/src/Tizen.Multimedia.Camera/Camera/CameraCapabilities.cs b/src/Tizen.Multimedia.Camera/Camera/CameraCapabilities.cs deleted file mode 100755 index 1c0002145..000000000 --- a/src/Tizen.Multimedia.Camera/Camera/CameraCapabilities.cs +++ /dev/null @@ -1,796 +0,0 @@ -/* - * 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.Collections.Generic; -using NativeCapabilities = Interop.CameraCapabilities; -using NativeSettings = Interop.CameraSettings; - -namespace Tizen.Multimedia -{ - /// - /// The CameraCapabilities class provides properties - /// to get various capability information of the camera device. - /// - public class CameraCapabilities - { - internal readonly Camera _camera; - - private IList _previewResolutions; - private IList _cameraResolutions; - private IList _captureFormats; - private IList _previewFormats; - private IList _fps; - private IList _autoFocusModes; - private IList _exposureModes; - private IList _isoLevels; - private IList _theaterModes; - private IList _whitebalances; - private IList _flashModes; - private IList _sceneModes; - private IList _effectModes; - private IList _streamRotations; - private IList _streamFlips; - private IList _ptzTypes; - private delegate CameraError GetRangeDelegate(IntPtr handle, out int min, out int max); - private delegate bool IsSupportedDelegate(IntPtr handle); - - internal CameraCapabilities(Camera camera) - { - _camera = camera; - - IsFaceDetectionSupported = IsFeatureSupported(NativeCapabilities.IsFaceDetectionSupported); - IsMediaPacketPreviewCallbackSupported = IsFeatureSupported(NativeCapabilities.IsMediaPacketPreviewCallbackSupported); - IsZeroShutterLagSupported = IsFeatureSupported(NativeCapabilities.IsZeroShutterLagSupported); - IsContinuousCaptureSupported = IsFeatureSupported(NativeCapabilities.IsContinuousCaptureSupported); - IsHdrCaptureSupported = IsFeatureSupported(NativeCapabilities.IsHdrCaptureSupported); - IsAntiShakeSupported = IsFeatureSupported(NativeCapabilities.IsAntiShakeSupported); - IsVideoStabilizationSupported = IsFeatureSupported(NativeCapabilities.IsVideoStabilizationSupported); - IsAutoContrastSupported = IsFeatureSupported(NativeCapabilities.IsAutoContrastSupported); - IsBrigtnessSupported = CheckRangeValid(NativeSettings.GetBrightnessRange); - IsExposureSupported = CheckRangeValid(NativeSettings.GetExposureRange); - IsZoomSupported = CheckRangeValid(NativeSettings.GetZoomRange); - IsPanSupported = CheckRangeValid(NativeSettings.GetPanRange); - IsTiltSupported = CheckRangeValid(NativeSettings.GetTiltRange); - } - - private bool IsFeatureSupported(IsSupportedDelegate func) - { - return func(_camera.GetHandle()); - } - - private bool CheckRangeValid(GetRangeDelegate func) - { - CameraErrorFactory.ThrowIfError(func(_camera.GetHandle(), out int min, out int max), - "Failed to check feature is suported or not."); - - return min < max; - } - - /// - /// Gets the face detection feature's supported state. - /// - /// true if supported, otherwise false. - /// 3 - public bool IsFaceDetectionSupported { get; } - - /// - /// Gets the media packet preview callback feature's supported state. - /// - /// true if supported, otherwise false. - /// 3 - public bool IsMediaPacketPreviewCallbackSupported { get; } - - /// - /// Gets the zero shutter lag feature's supported state. - /// - /// true if supported, otherwise false. - /// 3 - public bool IsZeroShutterLagSupported { get; } - - /// - /// Gets the continuous capture feature's supported state. - /// - /// true if supported, otherwise false. - /// 3 - public bool IsContinuousCaptureSupported { get; } - - /// - /// Gets the support state of the HDR capture. - /// - /// true if supported, otherwise false. - /// 3 - public bool IsHdrCaptureSupported { get; } - - /// - /// Gets the support state of the anti-shake feature. - /// - /// true if supported, otherwise false. - /// 3 - public bool IsAntiShakeSupported { get; } - - /// - /// Gets the support state of the video stabilization feature. - /// - /// true if supported, otherwise false. - /// 3 - public bool IsVideoStabilizationSupported { get; } - - /// - /// Gets the support state of auto contrast feature. - /// - /// true if supported, otherwise false. - /// 3 - public bool IsAutoContrastSupported { get; } - - /// - /// Gets the support state of the brightness feature. - /// - /// true if supported, otherwise false. - /// 3 - public bool IsBrigtnessSupported { get; } - - /// - /// Gets the support state of the exposure feature. - /// - /// true if supported, otherwise false. - /// 3 - public bool IsExposureSupported { get; } - - /// - /// Gets the support state of the zoom feature. - /// - /// true if supported, otherwise false. - /// 3 - public bool IsZoomSupported { get; } - - /// - /// Gets the support state of the pan feature. - /// - /// true if supported, otherwise false. - /// 3 - public bool IsPanSupported { get; } - - /// - /// Gets the support state of the tilt feature. - /// - /// true if supported, otherwise false. - /// 3 - public bool IsTiltSupported { get; } - - /// - /// Retrieves all the preview resolutions supported by the camera. - /// - /// 3 - /// - /// It returns a list containing all the supported preview resolutions. - /// - /// The camera already has been disposed of. - public IEnumerable SupportedPreviewResolutions - { - get - { - if (_previewResolutions == null) - { - _previewResolutions = GetSupportedPreviewResolutions(); - } - - return _previewResolutions; - } - } - - /// - /// Retrieves all the capture resolutions supported by the camera. - /// - /// 3 - /// - /// It returns a list containing all the supported capture resolutions. - /// - /// The camera already has been disposed of. - public IEnumerable SupportedCaptureResolutions - { - get - { - if (_cameraResolutions == null) - { - _cameraResolutions = GetSupportedCaptureResolutions(); - } - - return _cameraResolutions; - } - } - - /// - /// Retrieves all the capture formats supported by the camera. - /// - /// 3 - /// - /// It returns a list containing all the supported . - /// - /// The camera already has been disposed of. - public IEnumerable SupportedCapturePixelFormats - { - get - { - if (_captureFormats == null) - { - _captureFormats = GetSupportedCapturePixelFormats(); - } - - return _captureFormats; - } - } - - /// - /// Retrieves all the preview formats supported by the camera. - /// - /// 3 - /// - /// It returns a list containing all the supported . - /// - /// The camera already has been disposed of. - public IEnumerable SupportedPreviewPixelFormats - { - get - { - if (_previewFormats == null) - { - _previewFormats = GetSupportedPreviewPixelFormats(); - } - - return _previewFormats; - } - } - - /// - /// Retrieves all the fps supported by the camera. - /// - /// 3 - /// - /// It returns a list containing all the supported . - /// - /// The camera already has been disposed of. - public IEnumerable SupportedPreviewFps - { - get - { - if (_fps == null) - { - _fps = GetSupportedPreviewFps(); - } - - return _fps; - } - } - - /// - /// Retrieves all the fps by resolution supported by the camera. - /// - /// 3 - /// The width of required preview resolution. - /// The height of required preview resolution. - /// - /// It returns a list containing all the supported by resolution. - /// - /// The camera already has been disposed of. - public IEnumerable GetSupportedPreviewFpsByResolution(int width, int height) - { - return GetSupportedPreviewFpsByResolutions(width, height); - } - - /// - /// Retrieves all the fps by resolution supported by the camera. - /// - /// 3 - /// The size of required preview resolution. - /// - /// It returns a list containing all the supported by resolution. - /// - /// The camera already has been disposed of. - public IEnumerable GetSupportedPreviewFpsByResolution(Size size) - { - return GetSupportedPreviewFpsByResolutions(size.Width, size.Height); - } - - /// - /// Retrieves all the auto focus modes supported by the camera. - /// - /// 3 - /// - /// It returns a list containing all the supported . - /// - /// The camera already has been disposed of. - public IEnumerable SupportedAutoFocusModes - { - get - { - if (_autoFocusModes == null) - { - _autoFocusModes = GetSupportedAutoFocusModes(); - } - - return _autoFocusModes; - } - } - - /// - /// Retrieves all the exposure modes supported by the camera. - /// - /// 3 - /// - /// It returns a list containing all the supported . - /// - /// The camera already has been disposed of. - public IEnumerable SupportedExposureModes - { - get - { - if (_exposureModes == null) - { - _exposureModes = GetSupportedExposureModes(); - } - - return _exposureModes; - } - } - - /// - /// Retrieves all the ISO levels supported by the camera. - /// - /// 3 - /// - /// It returns a list containing all the supported . - /// - /// The camera already has been disposed of. - public IEnumerable SupportedIsoLevels - { - get - { - if (_isoLevels == null) - { - _isoLevels = GetSupportedIsoLevels(); - } - - return _isoLevels; - } - } - - /// - /// Retrieves all the theater modes supported by the camera. - /// - /// 3 - /// - /// It returns a list containing all the supported . - /// - /// The camera already has been disposed of. - public IEnumerable SupportedTheaterModes - { - get - { - if (_theaterModes == null) - { - _theaterModes = GetSupportedTheaterModes(); - } - - return _theaterModes; - } - } - - /// - /// Retrieves all the white balance modes supported by the camera. - /// - /// 3 - /// - /// It returns a list containing all the supported . - /// - /// The camera already has been disposed of. - public IEnumerable SupportedWhiteBalances - { - get - { - if (_whitebalances == null) - { - _whitebalances = GetSupportedWhitebalances(); - } - - return _whitebalances; - } - } - - /// - /// Retrieves all the flash modes supported by the camera. - /// - /// 3 - /// - /// It returns a list containing all the supported . - /// - /// The camera already has been disposed of. - public IEnumerable SupportedFlashModes - { - get - { - if (_flashModes == null) - { - _flashModes = GetSupportedFlashModes(); - } - - return _flashModes; - } - } - - /// - /// Retrieves all the scene modes supported by the camera. - /// - /// 3 - /// - /// It returns a list containing all the supported . - /// - /// The camera already has been disposed of. - public IEnumerable SupportedSceneModes - { - get - { - if (_sceneModes == null) - { - _sceneModes = GetSupportedSceneModes(); - } - - return _sceneModes; - } - } - - /// - /// Retrieves all the effect modes supported by the camera. - /// - /// 3 - /// - /// It returns a list containing all the supported . - /// - /// The camera already has been disposed of. - public IEnumerable SupportedEffects - { - get - { - if (_effectModes == null) - { - _effectModes = GetSupportedEffects(); - } - - return _effectModes; - } - } - - /// - /// Retrieves all the stream rotations supported by the camera. - /// - /// 3 - /// - /// An IEnumerable containing all the supported . - /// - /// The camera already has been disposed of. - public IEnumerable SupportedStreamRotations - { - get - { - if (_streamRotations == null) - { - _streamRotations = GetSupportedStreamRotations(); - } - - return _streamRotations; - } - } - - /// - /// Retrieves all the flips supported by the camera. - /// - /// 3 - /// - /// It returns a list containing all the supported . - /// - /// The camera already has been disposed of. - public IEnumerable SupportedStreamFlips - { - get - { - if (_streamFlips == null) - { - _streamFlips = GetSupportedStreamFlips(); - } - - return _streamFlips; - } - } - - /// - /// Retrieves all the PTZ types by the camera. - /// - /// 3 - /// - /// It returns a list containing all the supported . - /// - /// The camera already has been disposed of. - public IEnumerable SupportedPtzTypes - { - get - { - if (_ptzTypes.Count == 0) - { - _ptzTypes = GetSupportedPtzTypes(); - } - - return _ptzTypes; - } - } - - #region Methods for getting supported values - private IList GetSupportedPreviewResolutions() - { - List previewResolutions = new List(); - - NativeCapabilities.PreviewResolutionCallback callback = (int width, int height, IntPtr userData) => - { - previewResolutions.Add(new Size(width, height)); - return true; - }; - CameraErrorFactory.ThrowIfError(NativeCapabilities.SupportedPreviewResolutions(_camera.GetHandle(), callback, IntPtr.Zero), - "Failed to get the supported preview resolutions"); - - return previewResolutions.AsReadOnly(); - } - - private IList GetSupportedCaptureResolutions() - { - List cameraResolutions = new List(); - - NativeCapabilities.CaptureResolutionCallback callback = (int width, int height, IntPtr userData) => - { - cameraResolutions.Add(new Size(width, height)); - return true; - }; - CameraErrorFactory.ThrowIfError(NativeCapabilities.SupportedCaptureResolutions(_camera.GetHandle(), callback, IntPtr.Zero), - "Failed to get the supported capture resolutions"); - - return cameraResolutions.AsReadOnly(); - } - - private IList GetSupportedCapturePixelFormats() - { - List captureFormats = new List(); - - NativeCapabilities.CaptureFormatCallback callback = (CameraPixelFormat format, IntPtr userData) => - { - captureFormats.Add(format); - return true; - }; - CameraErrorFactory.ThrowIfError(NativeCapabilities.SupportedCapturePixelFormats(_camera.GetHandle(), callback, IntPtr.Zero), - "Failed to get the supported capture formats."); - - return captureFormats.AsReadOnly(); - } - - private IList GetSupportedPreviewPixelFormats() - { - List previewFormats = new List(); - - NativeCapabilities.PreviewFormatCallback callback = (CameraPixelFormat format, IntPtr userData) => - { - previewFormats.Add(format); - return true; - }; - CameraErrorFactory.ThrowIfError(NativeCapabilities.SupportedPreviewPixelFormats(_camera.GetHandle(), callback, IntPtr.Zero), - "Failed to get the supported preview formats."); - - return previewFormats.AsReadOnly(); - } - - private IList GetSupportedPreviewFps() - { - List previewFps = new List(); - - NativeCapabilities.FpsCallback callback = (CameraFps fps, IntPtr userData) => - { - previewFps.Add(fps); - return true; - }; - CameraErrorFactory.ThrowIfError(NativeCapabilities.SupportedPreviewFps(_camera.GetHandle(), callback, IntPtr.Zero), - "Failed to get the supported camera fps"); - - return previewFps.AsReadOnly(); - } - - private IList GetSupportedPreviewFpsByResolutions(int width, int height) - { - List fpsByResolution = new List(); - - NativeCapabilities.FpsByResolutionCallback callback = (CameraFps fps, IntPtr userData) => - { - fpsByResolution.Add(fps); - return true; - }; - CameraErrorFactory.ThrowIfError(NativeCapabilities.SupportedPreviewFpsByResolution(_camera.GetHandle(), - width, height, callback, IntPtr.Zero), "Failed to get the supported fps by resolutions."); - - return fpsByResolution.AsReadOnly(); - } - - private IList GetSupportedAutoFocusModes() - { - List autoFocusModes = new List(); - - NativeCapabilities.AfModeCallback callback = (CameraAutoFocusMode mode, IntPtr userData) => - { - autoFocusModes.Add(mode); - return true; - }; - CameraErrorFactory.ThrowIfError(NativeCapabilities.SupportedAutoFocusModes(_camera.GetHandle(), callback, IntPtr.Zero), - "Failed to get the supported Auto focus modes."); - - return autoFocusModes.AsReadOnly(); - } - - private IList GetSupportedExposureModes() - { - List exposureModes = new List(); - - NativeCapabilities.ExposureModeCallback callback = (CameraExposureMode mode, IntPtr userData) => - { - exposureModes.Add(mode); - return true; - }; - CameraErrorFactory.ThrowIfError(NativeCapabilities.SupportedExposureModes(_camera.GetHandle(), callback, IntPtr.Zero), - "Failed to get the supported Exposure modes."); - - return exposureModes.AsReadOnly(); - } - - private IList GetSupportedIsoLevels() - { - List isoLevels = new List(); - - NativeCapabilities.IsoCallback callback = (CameraIsoLevel iso, IntPtr userData) => - { - isoLevels.Add(iso); - return true; - }; - CameraErrorFactory.ThrowIfError(NativeCapabilities.SupportedIso(_camera.GetHandle(), callback, IntPtr.Zero), - "Failed to get the supported Iso levels."); - - return isoLevels.AsReadOnly(); - } - - private IList GetSupportedTheaterModes() - { - List theaterModes = new List(); - - NativeCapabilities.TheaterModeCallback callback = (CameraTheaterMode theaterMode, IntPtr userData) => - { - theaterModes.Add(theaterMode); - return true; - }; - CameraErrorFactory.ThrowIfError(NativeCapabilities.SupportedTheaterModes(_camera.GetHandle(), callback, IntPtr.Zero), - "Failed to get the supported theater modes."); - - return theaterModes.AsReadOnly(); - } - - private IList GetSupportedWhitebalances() - { - List whitebalances = new List(); - - NativeCapabilities.WhitebalanceCallback callback = (CameraWhiteBalance whiteBalance, IntPtr userData) => - { - whitebalances.Add(whiteBalance); - return true; - }; - CameraErrorFactory.ThrowIfError(NativeCapabilities.SupportedWhitebalance(_camera.GetHandle(), callback, IntPtr.Zero), - "Failed to get the supported white balance."); - - return whitebalances.AsReadOnly(); - } - - private IList GetSupportedFlashModes() - { - List flashModes = new List(); - - NativeCapabilities.FlashModeCallback callback = (CameraFlashMode flashMode, IntPtr userData) => - { - flashModes.Add(flashMode); - return true; - }; - CameraErrorFactory.ThrowIfError(NativeCapabilities.SupportedFlashModes(_camera.GetHandle(), callback, IntPtr.Zero), - "Failed to get the supported flash modes."); - - return flashModes.AsReadOnly(); - } - - private IList GetSupportedSceneModes() - { - List sceneModes = new List(); - - NativeCapabilities.SceneModeCallback callback = (CameraSceneMode sceneMode, IntPtr userData) => - { - sceneModes.Add(sceneMode); - return true; - }; - CameraErrorFactory.ThrowIfError(NativeCapabilities.SupportedSceneModes(_camera.GetHandle(), callback, IntPtr.Zero), - "Failed to get the supported scene modes."); - - return sceneModes.AsReadOnly(); - } - - private IList GetSupportedEffects() - { - List effectModes = new List(); - - NativeCapabilities.EffectCallback callback = (CameraEffectMode effect, IntPtr userData) => - { - effectModes.Add(effect); - return true; - }; - CameraErrorFactory.ThrowIfError(NativeCapabilities.SupportedEffects(_camera.GetHandle(), callback, IntPtr.Zero), - "Failed to get the supported camera effects."); - - return effectModes.AsReadOnly(); - } - - private IList GetSupportedStreamRotations() - { - List streamRotations = new List(); - - NativeCapabilities.StreamRotationCallback callback = (Rotation streamRotation, IntPtr userData) => - { - streamRotations.Add(streamRotation); - return true; - }; - CameraErrorFactory.ThrowIfError(NativeCapabilities.SupportedStreamRotations(_camera.GetHandle(), callback, IntPtr.Zero), - "Failed to get the supported camera rotations."); - - return streamRotations.AsReadOnly(); - } - - private IList GetSupportedStreamFlips() - { - List streamFlips = new List(); - - NativeCapabilities.StreamFlipCallback callback = (Flips streamFlip, IntPtr userData) => - { - streamFlips.Add(streamFlip); - return true; - }; - CameraErrorFactory.ThrowIfError(NativeCapabilities.SupportedStreamFlips(_camera.GetHandle(), callback, IntPtr.Zero), - "Failed to get the supported camera flips."); - - return streamFlips.AsReadOnly(); - } - - private IList GetSupportedPtzTypes() - { - List ptzTypes = new List(); - - NativeCapabilities.PtzTypeCallback callback = (CameraPtzType ptzType, IntPtr userData) => - { - ptzTypes.Add(ptzType); - return true; - }; - CameraErrorFactory.ThrowIfError(NativeCapabilities.SupportedPtzTypes(_camera.GetHandle(), callback, IntPtr.Zero), - "Failed to get the supported Ptz types."); - - return ptzTypes.AsReadOnly(); - } - #endregion Methods for getting supported values - } -} diff --git a/src/Tizen.Multimedia.Camera/Camera/CameraCapturingEventArgs.cs b/src/Tizen.Multimedia.Camera/Camera/CameraCapturingEventArgs.cs deleted file mode 100755 index befb01257..000000000 --- a/src/Tizen.Multimedia.Camera/Camera/CameraCapturingEventArgs.cs +++ /dev/null @@ -1,51 +0,0 @@ -/* - * 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.Multimedia -{ - /// - /// Provides data for the event. - /// - public class CameraCapturingEventArgs : EventArgs - { - internal CameraCapturingEventArgs(StillImage main, StillImage post, StillImage thumbnail) - { - MainImage = main; - PostView = post; - Thumbnail = thumbnail; - } - - /// - /// Gets the main image data of the captured still image. - /// - /// 3 - public StillImage MainImage { get; } - - /// - /// Gets the image data of the post view. - /// - /// 3 - public StillImage PostView { get; } - - /// - /// Gets the image data of the thumbnail. - /// - /// 3 - public StillImage Thumbnail { get; } - } -} diff --git a/src/Tizen.Multimedia.Camera/Camera/CameraDeviceStateChangedEventArgs.cs b/src/Tizen.Multimedia.Camera/Camera/CameraDeviceStateChangedEventArgs.cs deleted file mode 100755 index b647736b5..000000000 --- a/src/Tizen.Multimedia.Camera/Camera/CameraDeviceStateChangedEventArgs.cs +++ /dev/null @@ -1,44 +0,0 @@ -/* - * 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.Multimedia -{ - /// - /// Provides data for the event. - /// - public class CameraDeviceStateChangedEventArgs : EventArgs - { - internal CameraDeviceStateChangedEventArgs(CameraDevice device, CameraDeviceState state) - { - Device = device; - State = state; - } - - /// - /// Gets the camera device type. - /// - /// 3 - public CameraDevice Device { get; } - - /// - /// Gets the current state of the camera device. - /// - /// 3 - public CameraDeviceState State { get; } - } -} diff --git a/src/Tizen.Multimedia.Camera/Camera/CameraDisplaySettings.cs b/src/Tizen.Multimedia.Camera/Camera/CameraDisplaySettings.cs deleted file mode 100755 index 3f90093db..000000000 --- a/src/Tizen.Multimedia.Camera/Camera/CameraDisplaySettings.cs +++ /dev/null @@ -1,175 +0,0 @@ -/* - * 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 Native = Interop.CameraDisplay; - -namespace Tizen.Multimedia -{ - /// - /// The CameraDisplay class allows you to manage display for the camera. - /// It allows to set and get various display properties, such as - /// rotation, display visibility, and display mode. - /// - public class CameraDisplaySettings - { - internal readonly Camera _camera; - - internal CameraDisplaySettings(Camera camera) - { - _camera = camera; - } - - /// - /// The display mode. - /// - /// 3 - /// - /// This property is meaningful only in overlay or EVAS surface display type. - /// - /// A that specifies the display mode. - /// Display type is incorrect. - /// The camera already has been disposed of. - public CameraDisplayMode Mode - { - get - { - CameraErrorFactory.ThrowIfError(Native.GetMode(_camera.GetHandle(), out var val), - "Failed to get camera display mode"); - - return val; - } - - set - { - ValidationUtil.ValidateEnum(typeof(CameraDisplayMode), value); - CameraErrorFactory.ThrowIfError(Native.SetMode(_camera.GetHandle(), value), - "Failed to set camera display mode."); - } - } - - /// - /// The display visibility. - /// - /// true if camera display is visible, otherwise false. - /// 3 - /// - /// This property is meaningful only in overlay or EVAS surface display type. - /// - /// Display type is incorrect. - /// The camera already has been disposed of. - public bool Visible - { - get - { - CameraErrorFactory.ThrowIfError(Native.GetVisible(_camera.GetHandle(), out bool val), - "Failed to get visible value"); - - return val; - } - - set - { - CameraErrorFactory.ThrowIfError(Native.SetVisible(_camera.GetHandle(), value), - "Failed to set display visible."); - } - } - - /// - /// The display rotation. - /// - /// 3 - /// - /// This property is meaningful only in overlay or EVAS surface display type. - /// - /// A that specifies the rotation of the camera device. - /// Display type is incorrect. - /// The camera already has been disposed of. - public Rotation Rotation - { - get - { - CameraErrorFactory.ThrowIfError(Native.GetRotation(_camera.GetHandle(), out var val), - "Failed to get display rotation"); - - return val; - } - - set - { - ValidationUtil.ValidateEnum(typeof(Rotation), value); - - CameraErrorFactory.ThrowIfError(Native.SetRotation(_camera.GetHandle(), value), - "Failed to set display rotation."); - } - } - - /// - /// The display flip. - /// - /// 3 - /// - /// This property is meaningful only in overlay or EVAS surface display type. - /// - /// A that specifies the camera flip type. - /// Display type is incorrect. - /// The camera already has been disposed of. - public Flips Flip - { - get - { - CameraErrorFactory.ThrowIfError(Native.GetFlip(_camera.GetHandle(), out var val), - "Failed to get display flip"); - - return val; - } - - set - { - ValidationUtil.ValidateFlagsEnum(value, Flips.Horizontal | Flips.Vertical, nameof(Flips)); - - CameraErrorFactory.ThrowIfError(Native.SetFlip(_camera.GetHandle(), value), - "Failed to set display flip."); - } - } - - /// - /// the ROI(Region Of Interest) area of display. - /// - /// 3 - /// - /// This property is meaningful only in overlay or EVAS surface display type. - /// - /// Display type is incorrect. - /// The camera already has been disposed of. - public Rectangle RoiArea - { - get - { - CameraErrorFactory.ThrowIfError(Native.GetRoiArea(_camera.GetHandle(), - out int x, out int y, out int width, out int height), "Failed to get display roi area"); - - return new Rectangle(x, y, width, height); - } - - set - { - CameraErrorFactory.ThrowIfError(Native.SetRoiArea(_camera.GetHandle(), - value.X, value.Y, value.Width, value.Height), "Failed to set display roi area."); - } - } - } -} diff --git a/src/Tizen.Multimedia.Camera/Camera/CameraEnums.cs b/src/Tizen.Multimedia.Camera/Camera/CameraEnums.cs deleted file mode 100644 index 8a5e89837..000000000 --- a/src/Tizen.Multimedia.Camera/Camera/CameraEnums.cs +++ /dev/null @@ -1,860 +0,0 @@ -/* - * 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.Multimedia -{ - /// - /// Enumeration for the camera device. - /// - /// 3 - public enum CameraDevice - { - /// - /// The rear camera device. - /// - Rear, - /// - /// The front camera device. - /// - Front - } - - /// - /// Enumeration for the camera device state. - /// - /// 3 - public enum CameraDeviceState - { - /// - /// Not opened. - /// - NotOpened, - /// - /// Opened. - /// - Opened, - /// - /// Now previewing or capturing or is being used for the video recording. - /// - Working - } - - /// - /// Enumeration for the facing direction of camera module. - /// - /// 3 - public enum CameraFacingDirection - { - /// - /// Rear direction. - /// - Rear, - /// - /// Front direction. - /// - Front - } - - /// - /// Enumeration for the current flash state. - /// - /// 3 - public enum CameraFlashState - { - /// - /// Flash is not used now through the camera API. - /// - NotUsed, - /// - /// Flash is used now through the camera API. - /// - Used - } - - /// - /// Enumeration for the camera focus state. - /// - /// 3 - public enum CameraFocusState - { - /// - /// Focus released. - /// - Released, - /// - /// Focus in progress. - /// - Ongoing, - /// - /// Focus succeeded. - /// - Focused, - /// - /// Focus failed. - /// - Failed - } - - /// - /// Enumeration for the camera pixel format. - /// - /// 3 - public enum CameraPixelFormat - { - /// - /// Invalid pixel format. - /// - Invalid = -1, - /// - /// NV12 pixel format. - /// - Nv12, - /// - /// NV12 tiled pixel format. - /// - Nv12t, - /// - /// NV16 pixel format. - /// - Nv16, - /// - /// NV21 pixel format. - /// - Nv21, - /// - /// YUYV(YUY2) pixel format. - /// - Yuyv, - /// - /// UYVY pixel format. - /// - Uyvy, - /// - /// YUV422(Y:U:V) planar pixel format. - /// - Yuv422Planar, - /// - /// I420 pixel format. - /// - I420, - /// - /// YV12 pixel format. - /// - Yv12, - /// - /// RGB565 pixel format. - /// - Rgb565, - /// - /// RGB565 pixel format. - /// - Rgb888, - /// - /// RGBA pixel format. - /// - Rgba, - /// - /// ARGB pixel format. - /// - Argb, - /// - /// Encoded pixel format. - /// - Jpeg, - /// - /// Encoded pixel format : H264. - /// - H264 = 15 - } - - /// - /// Enumeration for the camera policy. - /// - /// 3 - public enum CameraPolicy - { - /// - /// None. - /// - None, - /// - /// Security policy. - /// - Security = 4, - /// - /// Resource conflict. - /// - ResourceConflict - } - - /// - /// Enumeration for the camera state. - /// - /// 3 - public enum CameraState - { - /// - /// Before creating. - /// - None, - /// - /// Created, but not initialized yet. - /// - Created, - /// - /// Preview. - /// - Preview, - /// - /// While capturing. - /// - Capturing, - /// - /// After capturing. - /// - Captured - } - - /// - /// Enumeration for the auto-focus mode. - /// - /// 3 - public enum CameraAutoFocusMode - { - /// - /// Auto-focus is not set. - /// - None, - /// - /// Auto-focus is in the normal mode. - /// - Normal, - /// - /// Auto-focus is in the macro mode (close distance). - /// - Macro, - /// - /// Auto-focus is in the full mode (all range scan, limited by device spec). - /// - Full - } - - /// - /// Enumeration for the color tone, which provides the impression of looking through a tinted glass. - /// - /// 3 - public enum CameraEffectMode - { - /// - /// None. - /// - None, - /// - /// Mono. - /// - Mono, - /// - /// Sepia. - /// - Sepia, - /// - /// Negative. - /// - Negative, - /// - /// Blue. - /// - Blue, - /// - /// Green. - /// - Green, - /// - /// Aqua. - /// - Aqua, - /// - /// Violet. - /// - Violet, - /// - /// Orange. - /// - Orange, - /// - /// Gray. - /// - Gray, - /// - /// Red. - /// - Red, - /// - /// Antique. - /// - Antique, - /// - /// Warm. - /// - Warm, - /// - /// Pink. - /// - Pink, - /// - /// Yellow. - /// - Yellow, - /// - /// Purple. - /// - Purple, - /// - /// Emboss. - /// - Emboss, - /// - /// Outline. - /// - Outline, - /// - /// Solarization. - /// - Solarization, - /// - /// Sketch. - /// - Sketch, - /// - /// Washed. - /// - Washed, - /// - /// Vintage warm. - /// - VintageWarm, - /// - /// Vintage cold. - /// - VintageCold, - /// - /// Posterization. - /// - Posterization, - /// - /// Cartoon. - /// - Cartoon, - /// - /// Selective color - red. - /// - SelectiveRed, - /// - /// Selective color - green. - /// - SelectiveGreen, - /// - /// Selective color - blue. - /// - SelectiveBlue, - /// - /// Selective color - yellow. - /// - SelectiveYellow, - /// - /// Selective color - red and yellow. - /// - SelectiveRedYellow, - /// - /// Other graphic effects. - /// - OtherGraphics - } - - /// - /// Enumeration for the camera exposure modes. - /// - /// 3 - public enum CameraExposureMode - { - /// - /// Off. - /// - Off, - /// - /// All mode. - /// - All, - /// - /// Center mode. - /// - Center, - /// - /// Spot mode. - /// - Spot, - /// - /// Custom mode. - /// - Custom - } - - /// - /// Enumeration for the flash mode. - /// - /// 3 - public enum CameraFlashMode - { - /// - /// Always off. - /// - Off, - /// - /// Always splashes. - /// - On, - /// - /// Depending on intensity of light, strobe starts to flash. - /// - Auto, - /// - /// Red eye reduction. Multiple flash before capturing. - /// - RedEyeReduction, - /// - /// Slow sync curtain synchronization. - /// - SlowSync, - /// - /// Front curtain synchronization. - /// - FrontCurtain, - /// - /// Rear curtain synchronization. - /// - RearCurtain, - /// - /// Keep turned on until turning off. - /// - Permanent - } - - /// - /// Enumeration for the preview fps. - /// - /// 3 - public enum CameraFps - { - /// - /// Auto fps. - /// - Auto = 0, - /// - /// 7 fps. - /// - Fps7 = 7, - /// - /// 8 fps. - /// - Fps8 = 8, - /// - /// 15 fps. - /// - Fps15 = 15, - /// - /// 20 fps. - /// - Fps20 = 20, - /// - /// 24 fps. - /// - Fps24 = 24, - /// - /// 25 fps. - /// - Fps25 = 25, - /// - /// 30 fps. - /// - Fps30 = 30, - /// - /// 60 fps. - /// - Fps60 = 60, - /// - /// 90 fps. - /// - Fps90 = 90, - /// - /// 120 fps. - /// - Fps120 = 120 - } - - /// - /// Enumeration for the HDR capture mode. - /// - /// 3 - public enum CameraHdrMode - { - /// - /// Disable the HDR capture. - /// - Disable, - /// - /// Enable the HDR capture. - /// - Enable, - /// - /// Enable the HDR capture mode and keep original image data. - /// - KeepOriginal - } - - /// - /// Enumeration for the ISO levels of the camera. - /// - /// 3 - public enum CameraIsoLevel - { - /// - /// ISO auto mode. - /// - Auto, - /// - /// ISO 50. - /// - Iso50, - /// - /// ISO 100. - /// - Iso100, - /// - /// ISO 200. - /// - Iso200, - /// - /// ISO 400. - /// - Iso400, - /// - /// ISO 800. - /// - Iso800, - /// - /// ISO 1600. - /// - Iso1600, - /// - /// ISO 3200. - /// - Iso3200 - } - - /// - /// Enumeration for the PTZ(Pan Tilt Zoom) movement type. - /// - /// 3 - public enum CameraPtzMoveType - { - /// - /// Move to a specific coordinate position. - /// - Absoulute, - /// - /// Move to a specific distance from the current position. - /// - Relative - } - - /// - /// Enumeration for the PTZ(Pan Tilt Zoom) type. - /// - /// 3 - public enum CameraPtzType - { - /// - /// Move the camera device physically. - /// - Mechanical, - /// - /// Zoom digitally and move into portion of the image. - /// - Electronic - } - - /// - /// Enumeration for the camera scene mode. - /// - /// 3 - public enum CameraSceneMode - { - /// - /// Normal. - /// - Normal, - /// - /// Portrait. - /// - Portrait, - /// - /// Landscape. - /// - Landscape, - /// - /// Sports. - /// - Sports, - /// - /// Party and indoor. - /// - PartyAndIndoor, - /// - /// Beach and indoor. - /// - BeachAndIndoor, - /// - /// Sunset. - /// - Sunset, - /// - /// Dusk and dawn. - /// - DuskAndDawn, - /// - /// Fall. - /// - FallColor, - /// - /// Night scene. - /// - NightScene, - /// - /// Firework. - /// - FireWork, - /// - /// Text. - /// - Text, - /// - /// Show window. - /// - ShowWindow, - /// - /// Candle light. - /// - CandleLight, - /// - /// Backlight. - /// - BackLight, - /// - /// Aqua. - /// - Aqua - } - - /// - /// Enumeration for the orientation values of tag. - /// - /// 3 - public enum CameraTagOrientation - { - /// - /// Row #0 is at the top, column #0 is to the left. - /// - TopLeft = 1, - /// - /// Row #0 is at the top, column #0 is to the right. - /// - TopRight = 2, - /// - /// Row #0 is at the bottom, column #0 is to the right. - /// - BottomRight = 3, - /// - /// Row #0 is at the bottom, column #0 is to the left. - /// - BottomLeft = 4, - /// - /// Row #0 is at the left, column #0 is to the top. - /// - LeftTop = 5, - /// - /// Row #0 is at the right, column #0 is to the top. - /// - RightTop = 6, - /// - /// Row #0 is at the right, column #0 is to the bottom. - /// - RightBottom = 7, - /// - /// Row #0 is at the left, column #0 is to the bottom. - /// - LeftBottom = 8 - } - - /// - /// Enumeration for the theater mode. - /// - /// 3 - public enum CameraTheaterMode - { - /// - /// Disable the theater mode - the external display shows same image as the device display. - /// - Disable, - /// - /// Clone the mode - the preview image is displayed on an external display with full screen mode. Also, the preview image is shown by the UI on the device display. - /// - Clone, - /// - /// Enable the theater mode - the preview image is displayed on an external display with full screen mode, but the preview image is not shown on the device display. - /// - Enable - } - - /// - /// Enumeration for the white balance levels of the camera. - /// - /// 3 - public enum CameraWhiteBalance - { - /// - /// None. - /// - None, - /// - /// Automatic. - /// - Automatic, - /// - /// Daylight. - /// - Daylight, - /// - /// Cloudy. - /// - Cloudy, - /// - /// Fluorescent. - /// - Fluorescent, - /// - /// Incandescent. - /// - Incandescent, - /// - /// Shade. - /// - Shade, - /// - /// Horizon. - /// - Horizon, - /// - /// Flash. - /// - Flash, - /// - /// Custom. - /// - Custom - } - - /// - /// Enumeration for the camera display mode. - /// - /// 3 - public enum CameraDisplayMode - { - /// - /// Letter box. - /// - LetterBox, - /// - /// Original size. - /// - OriginSize, - /// - /// Full screen. - /// - Full, - /// - /// Cropped full screen. - /// - CroppedFull, - /// - /// Original size or letter box. - /// - OriginOrLetterBox, - /// - /// Custom ROI. - /// - CustomROI - } - - /// - /// Enumeration for the camera failure error. - /// - /// 3 - public enum CameraErrorCode - { - /// - /// Device Error. - /// - DeviceError = CameraError.DeviceError, - /// - /// Internal error. - /// - InvalidOperation = CameraError.InvalidOperation, - /// - /// Out of memory. - /// - OutOfMemory = CameraError.OutOfMemory, - /// - /// Service is disconnected. - /// - ServiceDisconnected = CameraError.ServiceDisconnected - } - - /// - /// Enumeration for the image datatype. - /// - /// 3 - public enum PlaneType - { - /// - /// Single plane data. - /// - SinglePlane, - /// - /// Double plane data. - /// - DoublePlane, - /// - /// Triple plane data. - /// - TriplePlane, - /// - /// Encoded plane data. - /// - EncodedPlane - } -} diff --git a/src/Tizen.Multimedia.Camera/Camera/CameraErrorFactory.cs b/src/Tizen.Multimedia.Camera/Camera/CameraErrorFactory.cs deleted file mode 100644 index 15862f351..000000000 --- a/src/Tizen.Multimedia.Camera/Camera/CameraErrorFactory.cs +++ /dev/null @@ -1,89 +0,0 @@ -/* - * 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.CompilerServices; -using Tizen.Internals.Errors; - -namespace Tizen.Multimedia -{ - internal enum CameraError - { - TizenErrorCamera = -0x01910000, - CameraErrorClass = TizenErrorCamera, - None = ErrorCode.None, - InvalidParameter = ErrorCode.InvalidParameter, - InvalidState = CameraErrorClass | 0x02, - OutOfMemory = ErrorCode.OutOfMemory, - DeviceError = CameraErrorClass | 0x04, - InvalidOperation = ErrorCode.InvalidOperation, - SecurityRestricted = CameraErrorClass | 0x07, - DeviceBusy = CameraErrorClass | 0x08, - DeviceNotFound = CameraErrorClass | 0x09, - Esd = CameraErrorClass | 0x0c, - PermissionDenied = ErrorCode.PermissionDenied, - NotSupported = ErrorCode.NotSupported, - ResourceConflict = CameraErrorClass | 0x0d, - ServiceDisconnected = CameraErrorClass | 0x0e - } - - internal static class CameraErrorFactory - { - internal static void ThrowIfError(CameraError errorCode, string errorMessage = null, - [CallerMemberName] string caller = null, [CallerLineNumber] int line = 0) - { - if (errorCode == CameraError.None) - { - return; - } - - Log.Info(CameraLog.Tag, "errorCode : " + errorCode.ToString() + ", Caller : " + caller + ", line " + line.ToString()); - - switch (errorCode) - { - case CameraError.InvalidParameter: - throw new ArgumentException(errorMessage); - - case CameraError.OutOfMemory: - throw new OutOfMemoryException(errorMessage); - - case CameraError.DeviceError: - case CameraError.DeviceBusy: - case CameraError.Esd: - throw new CameraDeviceException(errorMessage); - - case CameraError.DeviceNotFound: - throw new CameraDeviceNotFoundException(errorMessage); - - case CameraError.SecurityRestricted: - case CameraError.PermissionDenied: - throw new UnauthorizedAccessException(errorMessage); - - case CameraError.NotSupported: - throw new NotSupportedException(errorMessage); - - case CameraError.InvalidState: - case CameraError.InvalidOperation: - case CameraError.ResourceConflict: - case CameraError.ServiceDisconnected: - throw new InvalidOperationException(errorMessage); - - default: - throw new Exception("Unknown error : " + errorCode); - } - } - } -} diff --git a/src/Tizen.Multimedia.Camera/Camera/CameraErrorOccurredEventArgs.cs b/src/Tizen.Multimedia.Camera/Camera/CameraErrorOccurredEventArgs.cs deleted file mode 100755 index 650288e43..000000000 --- a/src/Tizen.Multimedia.Camera/Camera/CameraErrorOccurredEventArgs.cs +++ /dev/null @@ -1,44 +0,0 @@ -/* - * 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.Multimedia -{ - /// - /// Provides data for the event. - /// - public class CameraErrorOccurredEventArgs : EventArgs - { - internal CameraErrorOccurredEventArgs(CameraErrorCode error, CameraState state) - { - Error = error; - State = state; - } - - /// - /// Gets the camera error. - /// - /// 3 - public CameraErrorCode Error { get; } - - /// - /// Gets the current state of the camera. - /// - /// 3 - public CameraState State { get; } - } -} diff --git a/src/Tizen.Multimedia.Camera/Camera/CameraException.cs b/src/Tizen.Multimedia.Camera/Camera/CameraException.cs deleted file mode 100755 index 40d2a701f..000000000 --- a/src/Tizen.Multimedia.Camera/Camera/CameraException.cs +++ /dev/null @@ -1,53 +0,0 @@ -/* - * 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.Multimedia -{ - public class CameraException : Exception - { - public CameraException() : base() - { - } - - public CameraException(string message) : base(message) - { - } - } - - public class CameraDeviceException : CameraException - { - public CameraDeviceException() : base() - { - } - - public CameraDeviceException(string message) : base(message) - { - } - } - - public class CameraDeviceNotFoundException : CameraException - { - public CameraDeviceNotFoundException() : base() - { - } - - public CameraDeviceNotFoundException(string message) : base(message) - { - } - } -} diff --git a/src/Tizen.Multimedia.Camera/Camera/CameraFocusStateChangedEventArgs.cs b/src/Tizen.Multimedia.Camera/Camera/CameraFocusStateChangedEventArgs.cs deleted file mode 100755 index 63931d466..000000000 --- a/src/Tizen.Multimedia.Camera/Camera/CameraFocusStateChangedEventArgs.cs +++ /dev/null @@ -1,37 +0,0 @@ -/* - * 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.Multimedia -{ - /// - /// Provides data for the event. - /// - public class CameraFocusStateChangedEventArgs : EventArgs - { - internal CameraFocusStateChangedEventArgs(CameraFocusState state) - { - State = state; - } - - /// - /// Gets the focus state of the camera. - /// - /// 3 - public CameraFocusState State { get; } - } -} diff --git a/src/Tizen.Multimedia.Camera/Camera/CameraInterruptStartedEventArgs.cs b/src/Tizen.Multimedia.Camera/Camera/CameraInterruptStartedEventArgs.cs deleted file mode 100755 index ec969cf55..000000000 --- a/src/Tizen.Multimedia.Camera/Camera/CameraInterruptStartedEventArgs.cs +++ /dev/null @@ -1,42 +0,0 @@ -/* - * 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.Multimedia -{ - /// - /// Provides data for the event. - /// - public class CameraInterruptStartedEventArgs : EventArgs - { - internal CameraInterruptStartedEventArgs(CameraPolicy policy, CameraState state) - { - Policy = policy; - State = state; - } - - /// - /// Gets the current state of the camera. - /// - public CameraState State { get; } - - /// - /// Gets the policy that interrupted the camera. - /// - public CameraPolicy Policy { get; } - } -} diff --git a/src/Tizen.Multimedia.Camera/Camera/CameraInterruptedEventArgs.cs b/src/Tizen.Multimedia.Camera/Camera/CameraInterruptedEventArgs.cs deleted file mode 100755 index ec2d277c7..000000000 --- a/src/Tizen.Multimedia.Camera/Camera/CameraInterruptedEventArgs.cs +++ /dev/null @@ -1,51 +0,0 @@ -/* - * 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.Multimedia -{ - /// - /// Provides data for the event. - /// - public class CameraInterruptedEventArgs : EventArgs - { - internal CameraInterruptedEventArgs(CameraPolicy policy, CameraState previous, CameraState current) - { - Policy = policy; - Current = current; - Previous = previous; - } - - /// - /// Gets the previous state of the camera. - /// - /// 3 - public CameraState Previous { get; } - - /// - /// Gets the current state of the camera. - /// - /// 3 - public CameraState Current { get; } - - /// - /// Gets the policy that interrupted the camera. - /// - /// 3 - public CameraPolicy Policy { get; } - } -} diff --git a/src/Tizen.Multimedia.Camera/Camera/CameraSettings.cs b/src/Tizen.Multimedia.Camera/Camera/CameraSettings.cs deleted file mode 100755 index 903f17ccd..000000000 --- a/src/Tizen.Multimedia.Camera/Camera/CameraSettings.cs +++ /dev/null @@ -1,1161 +0,0 @@ -/* - * 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; -using Native = Interop.CameraSettings; -using static Interop.Camera; - -namespace Tizen.Multimedia -{ - /// - /// The camera setting class provides methods/properties to get and - /// set basic camera attributes. - /// - public class CameraSettings - { - internal readonly Camera _camera; - - private readonly Range? _brightnessRange; - private readonly Range? _contrastRange; - private readonly Range? _panRange; - private readonly Range? _tiltRange; - private readonly Range? _exposureRange; - private readonly Range? _zoomRange; - - internal CameraSettings(Camera camera) - { - _camera = camera; - - _contrastRange = GetRange(Native.GetContrastRange); - _brightnessRange = GetRange(Native.GetBrightnessRange); - _exposureRange = GetRange(Native.GetExposureRange); - _zoomRange = GetRange(Native.GetZoomRange); - _panRange = GetRange(Native.GetPanRange); - _tiltRange = GetRange(Native.GetTiltRange); - } - - private delegate CameraError GetRangeDelegate(IntPtr handle, out int min, out int max); - private Range? GetRange(GetRangeDelegate func) - { - CameraErrorFactory.ThrowIfError(func(_camera.GetHandle(), out int min, out int max), - "Failed to initialize the camera settings"); - - if (min > max) - { - return null; - } - - return new Range(min, max); - } - - #region Auto Focus - /// - /// Sets the auto focus area. - /// - /// 3 - /// - /// should not be the . - /// - /// X position. - /// Y position. - /// In case of invalid parameters. - /// In case of any invalid operations. - /// The camera already has been disposed of. - public void SetAutoFocusArea(int x, int y) - { - CameraErrorFactory.ThrowIfError(Native.SetAutoFocusArea(_camera.GetHandle(), x, y), - "Failed to set the autofocus area."); - } - - /// - /// Sets the auto focus area. - /// - /// 3 - /// - /// should not be the . - /// - /// structure including X, Y position. - /// In case of invalid parameters. - /// In case of any invalid operations. - /// The camera already has been disposed of. - public void SetAutoFocusArea(Point pos) - { - CameraErrorFactory.ThrowIfError(Native.SetAutoFocusArea(_camera.GetHandle(), pos.X, pos.Y), - "Failed to set the autofocus area."); - } - - /// - /// Clears the auto focus area. - /// - /// 3 - /// The camera already has been disposed of. - public void ClearFocusArea() - { - CameraErrorFactory.ThrowIfError(Native.ClearAutoFocusArea(_camera.GetHandle()), - "Failed to clear the autofocus area."); - } - - /// - /// The auto focus mode. - /// - /// 3 - /// A that specifies the auto focus mode. - /// The camera already has been disposed of. - public CameraAutoFocusMode AutoFocusMode - { - get - { - CameraAutoFocusMode val = CameraAutoFocusMode.None; - - CameraErrorFactory.ThrowIfError(Native.GetAutoFocusMode(_camera.GetHandle(), out val), - "Failed to get camera autofocus mode"); - - return val; - } - - set - { - ValidationUtil.ValidateEnum(typeof(CameraAutoFocusMode), value); - CameraErrorFactory.ThrowIfError(Native.SetAutoFocusMode(_camera.GetHandle(), value), - "Failed to set camera autofocus mode."); - } - } - #endregion Auto Focus - - #region Contrast - /// - /// The contrast level of the camera. - /// - /// 3 - /// The camera already has been disposed of. - public int Contrast - { - get - { - CameraErrorFactory.ThrowIfError(Native.GetContrast(_camera.GetHandle(), out int val), - "Failed to get camera contrast value"); - - return val; - } - - set - { - CameraErrorFactory.ThrowIfError(Native.SetContrast(_camera.GetHandle(), value), - "Failed to set camera contrast value."); - } - } - - /// - /// The auto contrast. - /// If true auto contrast is enabled, otherwise false. - /// - /// 3 - /// The camera already has been disposed of. - public bool AutoContrast - { - get - { - CameraErrorFactory.ThrowIfError(Native.IsEnabledAutoContrast(_camera.GetHandle(), out bool val), - "Failed to get camera auto contrast"); - - return val; - } - - set - { - CameraErrorFactory.ThrowIfError(Native.EnableAutoContrast(_camera.GetHandle(), value), - "Failed to set camera enable auto contrast."); - } - } - /// - /// Gets the available contrast level. - /// - /// 3 - /// - /// If the mininum value is greater than the maximum value, it means this feature is not supported. - /// - /// In case of this feature is not supported. - public Range ContrastRange - { - get - { - if (!_contrastRange.HasValue) - { - throw new NotSupportedException("Contrast is not supported."); - } - - return _contrastRange.Value; - } - } - #endregion Contrast - - #region Brightness - /// - /// The brightness level of the camera. - /// - /// 3 - /// The camera already has been disposed of. - public int Brightness - { - get - { - CameraErrorFactory.ThrowIfError(Native.GetBrightness(_camera.GetHandle(), out int val), - "Failed to get camera brightness value"); - - return val; - } - - set - { - CameraErrorFactory.ThrowIfError(Native.SetBrightness(_camera.GetHandle(), value), - "Failed to set camera brightness value."); - } - } - - /// - /// Gets the available brightness level. - /// - /// 3 - /// - /// If the minimum value is greater than the maximum value, it means this feature is not supported. - /// - /// In case of this feature is not supported. - public Range BrightnessRange - { - get - { - if (!_brightnessRange.HasValue) - { - throw new NotSupportedException("Brightness is not supported."); - } - - return _brightnessRange.Value; - } - } - #endregion Brightness - - #region Exposure - /// - /// The exposure value. - /// - /// 3 - /// The camera already has been disposed of. - public int Exposure - { - get - { - CameraErrorFactory.ThrowIfError(Native.GetExposure(_camera.GetHandle(), out int val), - "Failed to get camera exposure value"); - - return val; - } - - set - { - CameraErrorFactory.ThrowIfError(Native.SetExposure(_camera.GetHandle(), value), - "Failed to set camera exposure value."); - } - } - - /// - /// The exposure mode. - /// - /// 3 - /// A that specifies the exposure mode. - /// The camera already has been disposed of. - public CameraExposureMode ExposureMode - { - get - { - CameraExposureMode val = CameraExposureMode.Off; - - CameraErrorFactory.ThrowIfError(Native.GetExposureMode(_camera.GetHandle(), out val), - "Failed to get camera exposure mode"); - - return val; - } - - set - { - ValidationUtil.ValidateEnum(typeof(CameraExposureMode), value); - CameraErrorFactory.ThrowIfError(Native.SetExposureMode(_camera.GetHandle(), value), - "Failed to set camera exposure mode."); - } - } - - /// - /// Gets the available exposure value. - /// - /// 3 - /// - /// If the minimum value is greater than the maximum value, it means this feature is not supported. - /// - /// In case of this feature is not supported. - public Range ExposureRange - { - get - { - if (!_exposureRange.HasValue) - { - throw new NotSupportedException("Exposure is not supported."); - } - - return _exposureRange.Value; - } - } - #endregion Exposure - - #region Zoom - /// - /// The zoom level. - /// The range for the zoom level is received from the ZoomRange property. - /// - /// 3 - /// The camera already has been disposed of. - public int ZoomLevel - { - get - { - CameraErrorFactory.ThrowIfError(Native.GetZoom(_camera.GetHandle(), out int val), - "Failed to get zoom level"); - - return val; - } - - set - { - CameraErrorFactory.ThrowIfError(Native.SetZoom(_camera.GetHandle(), value), - "Failed to set zoom level."); - } - } - - /// - /// Gets the available zoom level. - /// - /// 3 - /// - /// If the minimum value is greater than the maximum value, it means this feature is not supported. - /// - /// In case of this feature is not supported. - public Range ZoomRange - { - get - { - if (!_zoomRange.HasValue) - { - throw new NotSupportedException("Zoom is not supported."); - } - - return _zoomRange.Value; - } - } - #endregion Zoom - - /// - /// The white balance mode. - /// - /// 3 - /// A that specifies the white balance mode. - /// The camera already has been disposed of. - public CameraWhiteBalance WhiteBalance - { - get - { - CameraWhiteBalance val = CameraWhiteBalance.None; - - CameraErrorFactory.ThrowIfError(Native.GetWhiteBalance(_camera.GetHandle(), out val), - "Failed to get camera whitebalance"); - - return val; - } - - set - { - ValidationUtil.ValidateEnum(typeof(CameraWhiteBalance), value); - CameraErrorFactory.ThrowIfError(Native.SetWhitebalance(_camera.GetHandle(), value), - "Failed to set camera whitebalance."); - } - } - - /// - /// The ISO level. - /// - /// 3 - /// A that specifies the ISO level. - /// The camera already has been disposed of. - public CameraIsoLevel IsoLevel - { - get - { - CameraIsoLevel val = CameraIsoLevel.Auto; - - CameraErrorFactory.ThrowIfError(Native.GetIso(_camera.GetHandle(), out val), - "Failed to get camera Iso level"); - - return val; - } - - set - { - ValidationUtil.ValidateEnum(typeof(CameraIsoLevel), value); - CameraErrorFactory.ThrowIfError(Native.SetIso(_camera.GetHandle(), value), - "Failed to set camera Iso level."); - } - } - - /// - /// The quality of the image. - /// The range for the image quality is 1 to 100. - /// - /// 3 - /// The camera already has been disposed of. - public int ImageQuality - { - get - { - CameraErrorFactory.ThrowIfError(Native.GetImageQuality(_camera.GetHandle(), out int val), - "Failed to get image quality"); - - return val; - } - - set - { - if (value < 1 || value > 100) - { - throw new ArgumentException("Valid value is from 1(lowest quality) to 100(highest quality)"); - } - - CameraErrorFactory.ThrowIfError(Native.SetImageQuality(_camera.GetHandle(), value), - "Failed to set image quality."); - } - } - - #region Resolution, Format, Fps of preview, capture - /// - /// The preview frame rate. - /// - /// 3 - /// A that specifies the preview frame rate. - /// The camera already has been disposed of. - public CameraFps PreviewFps - { - get - { - CameraErrorFactory.ThrowIfError(Native.GetPreviewFps(_camera.GetHandle(), out var val), - "Failed to get camera preview fps"); - - return val; - } - - set - { - ValidationUtil.ValidateEnum(typeof(CameraFps), value); - CameraErrorFactory.ThrowIfError(Native.SetPreviewFps(_camera.GetHandle(), value), - "Failed to set preview fps."); - } - } - - /// - /// Gets or sets the resolution of the preview. - /// - /// 3 - /// In case of invalid parameters. - /// The camera already has been disposed of. - public Size PreviewResolution - { - get - { - CameraErrorFactory.ThrowIfError(GetPreviewResolution(_camera.GetHandle(), out int width, out int height), - "Failed to get camera preview resolution"); - - return new Size(width, height); - } - - set - { - CameraErrorFactory.ThrowIfError(SetPreviewResolution(_camera.GetHandle(), value.Width, value.Height), - "Failed to set preview resolution."); - } - } - - /// - /// Gets the recommended preview resolution. - /// - /// 3 - /// - /// Depending on the capture resolution aspect ratio and the display resolution, - /// the recommended preview resolution is determined. - /// - /// The camera already has been disposed of. - public Size RecommendedPreviewResolution - { - get - { - CameraErrorFactory.ThrowIfError(GetRecommendedPreviewResolution(_camera.GetHandle(), out int width, out int height), - "Failed to get recommended preview resolution"); - - return new Size(width, height); - } - } - - /// - /// The preview data format. - /// - /// 3 - /// A that specifies the pixel format of the preview data. - /// In case of invalid parameters. - /// The camera already has been disposed of. - public CameraPixelFormat PreviewPixelFormat - { - get - { - CameraErrorFactory.ThrowIfError(GetPreviewPixelFormat(_camera.GetHandle(), out var val), - "Failed to get preview format"); - - return val; - } - - set - { - ValidationUtil.ValidateEnum(typeof(CameraPixelFormat), value); - CameraErrorFactory.ThrowIfError(SetPreviewPixelFormat(_camera.GetHandle(), value), - "Failed to set preview format."); - } - } - - /// - /// Resolution of the captured image. - /// - /// 3 - /// In case of invalid parameters. - /// The camera already has been disposed of. - public Size CaptureResolution - { - get - { - CameraErrorFactory.ThrowIfError(GetCaptureResolution(_camera.GetHandle(), out int width, out int height), - "Failed to get camera capture resolution"); - - return new Size(width, height); - } - - set - { - Size res = value; - - CameraErrorFactory.ThrowIfError(SetCaptureResolution(_camera.GetHandle(), res.Width, res.Height), - "Failed to set capture resolution."); - } - } - - /// - /// Format of an image to be captured. - /// - /// 3 - /// A that specifies the pixel format of captured image. - /// In case of invalid parameters. - /// The camera already has been disposed of. - public CameraPixelFormat CapturePixelFormat - { - get - { - CameraErrorFactory.ThrowIfError(GetCaptureFormat(_camera.GetHandle(), out var val), - "Failed to get camera capture formats"); - - return val; - } - - set - { - ValidationUtil.ValidateEnum(typeof(CameraPixelFormat), value); - CameraErrorFactory.ThrowIfError(SetCaptureFormat(_camera.GetHandle(), value), - "Failed to set capture format."); - } - } - #endregion Resolution, Format, Fps of preview, capture - - #region Encoded preview - /// - /// The bit rate of the encoded preview. - /// - /// 3 - /// The camera already has been disposed of. - public int EncodedPreviewBitrate - { - get - { - CameraErrorFactory.ThrowIfError(Native.GetBitrate(_camera.GetHandle(), out int val), - "Failed to get preview bitrate"); - - return val; - } - - set - { - CameraErrorFactory.ThrowIfError(Native.SetBitrate(_camera.GetHandle(), value), - "Failed to set encoded preview bitrate."); - } - } - - /// - /// The GOP(Group Of Pictures) interval of the encoded preview. - /// - /// 3 - /// The camera already has been disposed of. - public int EncodedPreviewGopInterval - { - get - { - CameraErrorFactory.ThrowIfError(Native.GetGopInterval(_camera.GetHandle(), out int val), - "Failed to get preview gop interval"); - - return val; - } - - set - { - CameraErrorFactory.ThrowIfError(Native.SetGopInterval(_camera.GetHandle(), value), - "Failed to set encoded preview gop intervals."); - } - } - #endregion Encoded preview - - /// - /// The theater mode. - /// - /// 3 - /// A that specifies the theater mode. - /// - /// If you want to display the preview image on the external display with the full screen mode, - /// use this property. - /// - /// The camera already has been disposed of. - public CameraTheaterMode TheaterMode - { - get - { - CameraErrorFactory.ThrowIfError(Native.GetTheaterMode(_camera.GetHandle(), out var val), - "Failed to get camera theater mode"); - - return val; - } - - set - { - ValidationUtil.ValidateEnum(typeof(CameraTheaterMode), value); - CameraErrorFactory.ThrowIfError(Native.SetTheaterMode(_camera.GetHandle(), value), - "Failed to set camera theater mode."); - } - } - - /// - /// The camera effect mode. - /// - /// 3 - /// A that specifies the effect mode. - /// The camera already has been disposed of. - public CameraEffectMode Effect - { - get - { - CameraErrorFactory.ThrowIfError(Native.GetEffect(_camera.GetHandle(), out var val), - "Failed to get camera effect"); - - return val; - } - - set - { - ValidationUtil.ValidateEnum(typeof(CameraEffectMode), value); - CameraErrorFactory.ThrowIfError(Native.SetEffect(_camera.GetHandle(), value), - "Failed to set camera effect."); - } - } - - /// - /// The scene mode. - /// - /// 3 - /// A that specifies the scene mode. - /// The camera already has been disposed of. - public CameraSceneMode SceneMode - { - get - { - CameraErrorFactory.ThrowIfError(Native.GetSceneMode(_camera.GetHandle(), out var val), - "Failed to get camera scene mode"); - - return val; - } - - set - { - ValidationUtil.ValidateEnum(typeof(CameraSceneMode), value); - CameraErrorFactory.ThrowIfError(Native.SetSceneMode(_camera.GetHandle(), value), - "Failed to set camera scene mode."); - } - } - - /// - /// The camera's flash mode. - /// - /// 3 - /// A that specifies the flash mode. - /// The camera already has been disposed of. - public CameraFlashMode FlashMode - { - get - { - CameraErrorFactory.ThrowIfError(Native.GetFlashMode(_camera.GetHandle(), out var val), - "Failed to get camera flash mode"); - - return val; - } - - set - { - ValidationUtil.ValidateEnum(typeof(CameraFlashMode), value); - CameraErrorFactory.ThrowIfError(Native.SetFlashMode(_camera.GetHandle(), value), - "Failed to set camera flash mode."); - } - } - - /// - /// Gets the camera lens orientation angle. - /// - /// 3 - /// The camera already has been disposed of. - public int LensOrientation - { - get - { - CameraErrorFactory.ThrowIfError(Native.GetLensOrientation(_camera.GetHandle(), out var val), - "Failed to get camera lens orientation"); - - return val; - } - } - - /// - /// The stream rotation. - /// - /// 3 - /// A that specifies the rotation of camera device. - /// The camera already has been disposed of. - public Rotation StreamRotation - { - get - { - CameraErrorFactory.ThrowIfError(Native.GetStreamRotation(_camera.GetHandle(), out var val), - "Failed to get camera stream rotation"); - - return val; - } - - set - { - ValidationUtil.ValidateEnum(typeof(Rotation), value); - - CameraErrorFactory.ThrowIfError(Native.SetStreamRotation(_camera.GetHandle(), value), - "Failed to set camera stream rotation."); - } - } - - /// - /// The stream flip. - /// - /// 3 - /// A that specifies the camera flip type. - /// The camera already has been disposed of. - public Flips StreamFlip - { - get - { - CameraErrorFactory.ThrowIfError(Native.GetFlip(_camera.GetHandle(), out var val), - "Failed to get camera stream flip"); - - return val; - } - - set - { - ValidationUtil.ValidateFlagsEnum(value, Flips.Horizontal | Flips.Vertical, nameof(Flips)); - - CameraErrorFactory.ThrowIfError(Native.SetFlip(_camera.GetHandle(), value), - "Failed to set camera flip."); - } - } - - /// - /// The mode of the HDR(High dynamic range) capture. - /// - /// 3 - /// A that specifies the HDR mode. - /// - /// Taking multiple pictures at different exposure levels and intelligently stitching them together, - /// so that we eventually arrive at a picture that is representative in both dark and bright areas. - /// If this attribute is set, then event handler set for the HdrCaptureProgress event is invoked. - /// - /// The camera already has been disposed of. - public CameraHdrMode HdrMode - { - get - { - CameraErrorFactory.ThrowIfError(Native.GetHdrMode(_camera.GetHandle(), out var val), - "Failed to get camera hdr mode"); - - return val; - } - - set - { - ValidationUtil.ValidateEnum(typeof(CameraHdrMode), value); - CameraErrorFactory.ThrowIfError(Native.SetHdrMode(_camera.GetHandle(), value), - "Failed to set camera hdr mode."); - } - } - - /// - /// The anti shake feature. - /// If true, the antishake feature is enabled, otherwise false. - /// - /// 3 - /// The camera already has been disposed of. - public bool AntiShake - { - get - { - CameraErrorFactory.ThrowIfError(Native.IsEnabledAntiShake(_camera.GetHandle(), out bool val), - "Failed to get camera anti shake value"); - - return val; - } - - set - { - CameraErrorFactory.ThrowIfError(Native.EnableAntiShake(_camera.GetHandle(), value), - "Failed to set camera anti shake value."); - } - } - - /// - /// Enables or disables the video stabilization feature. - /// If true, video stabilization is enabled, otherwise false. - /// - /// 3 - /// - /// If video stabilization is enabled, zero shutter lag is disabled. - /// This feature is used to record a video. - /// - /// The camera already has been disposed of. - public bool VideoStabilization - { - get - { - CameraErrorFactory.ThrowIfError(Native.IsEnabledVideoStabilization(_camera.GetHandle(), out bool val), - "Failed to get camera video stabilization"); - - return val; - } - - set - { - CameraErrorFactory.ThrowIfError(Native.EnableVideoStabilization(_camera.GetHandle(), value), - "Failed to set camera video stabilization."); - } - } - - /// - /// Turn the shutter sound on or off, if it is permitted by policy. - /// - /// 3 - /// Shutter sound On/Off flag - /// - /// If this value is true, shutter sound will be disabled, otherwise enabled. - /// In some countries, this operation is not permitted. - /// - /// Disabling shutter sound is not permitted. - /// The camera already has been disposed of. - public void DisableShutterSound(bool shutterSound) - { - CameraErrorFactory.ThrowIfError(Native.DisableShutterSound(_camera.GetHandle(), shutterSound), - "Failed to set disable shutter sound."); - } - - #region PTZ(Pan Tilt Zoom), Pan, Tilt - /// - /// Sets the type of the PTZ(Pan Tilt Zoom). Mechanical or electronic. - /// - /// 3 - /// A that specifies the type of the PTZ. - /// The camera already has been disposed of. - public CameraPtzType PtzType - { - set - { - ValidationUtil.ValidateEnum(typeof(CameraPtzType), value); - - CameraErrorFactory.ThrowIfError(Native.SetPtzType(_camera.GetHandle(), value), - "Failed to set camera ptz type."); - } - } - - /// - /// Sets the position to move horizontally. - /// - /// 3 - /// The PTZ move type. . - /// The pan step. - /// In case of invalid parameters. - /// The camera already has been disposed of. - public void SetPan(CameraPtzMoveType type, int panStep) - { - ValidationUtil.ValidateEnum(typeof(CameraPtzMoveType), type, nameof(type)); - CameraErrorFactory.ThrowIfError(Native.SetPan(_camera.GetHandle(), type, panStep), - "Failed to set the camera pan type."); - } - - /// - /// Gets the current position of the camera. - /// - /// 3 - /// Returns the camera's horizontal position. - /// The camera already has been disposed of. - public int GetPan() - { - CameraErrorFactory.ThrowIfError(Native.GetPan(_camera.GetHandle(), out int val), - "Failed to get the camera pan step."); - - return val; - } - - /// - /// Sets the position to move vertically. - /// - /// 3 - /// the PTZ move type. - /// The tilt step. - /// In case of invalid parameters. - /// The camera already has been disposed of. - public void SetTilt(CameraPtzMoveType type, int tiltStep) - { - ValidationUtil.ValidateEnum(typeof(CameraPtzMoveType), type, nameof(type)); - CameraErrorFactory.ThrowIfError(Native.SetTilt(_camera.GetHandle(), type, tiltStep), - "Failed to set the camera tilt type\t."); - } - - /// - /// Gets the current position of the camera. - /// - /// 3 - /// Returns the current vertical position. - /// The camera already has been disposed of. - public int GetTilt() - { - CameraErrorFactory.ThrowIfError(Native.GetTilt(_camera.GetHandle(), out int val), - "Failed to set the camera current position."); - - return val; - } - - /// - /// Gets the lower limit and the upper limit for the pan position. - /// - /// 3 - /// - /// If the minimum value is greater than the maximum value, it means this feature is not supported. - /// - /// In case of this feature is not supported. - public Range PanRange - { - get - { - if (!_panRange.HasValue) - { - throw new NotSupportedException("Pan is not supported."); - } - - return _panRange.Value; - } - } - - /// - /// Gets the lower limit and the upper limit for the tilt position. - /// - /// 3 - /// - /// If the minimum value is greater than the maximum value, it means this feature is not supported. - /// - /// In case of this feature is not supported. - public Range TiltRange - { - get - { - if (!_tiltRange.HasValue) - { - throw new NotSupportedException("Tilt is not supported."); - } - - return _tiltRange.Value; - } - } - #endregion PTZ(Pan Tilt Zoom), Pan, Tilt - - #region EXIF tag - /// - /// The scene mode. - /// - /// true if EXIF tags are enabled in the JPEG file, otherwise false. - /// 3 - /// The camera already has been disposed of. - public bool EnableTag - { - get - { - CameraErrorFactory.ThrowIfError(Native.IsEnabledTag(_camera.GetHandle(), out bool val), - "Failed to get camera enable tag"); - - return val; - } - - set - { - CameraErrorFactory.ThrowIfError(Native.EnableTag(_camera.GetHandle(), value), - "Failed to set camera enable tag."); - } - } - - /// - /// The camera image description in the EXIF tag. - /// - /// 3 - /// The camera already has been disposed of. - public string ImageDescriptionTag - { - get - { - IntPtr val = IntPtr.Zero; - try - { - CameraErrorFactory.ThrowIfError(Native.GetImageDescription(_camera.GetHandle(), out val), - "Failed to get image description"); - - return Marshal.PtrToStringAnsi(val); - } - finally - { - LibcSupport.Free(val); - } - } - - set - { - CameraErrorFactory.ThrowIfError(Native.SetImageDescription(_camera.GetHandle(), value), - "Failed to set image description."); - } - } - - /// - /// The software information in the EXIF tag. - /// - /// 3 - /// The camera already has been disposed of. - public string SoftwareTag - { - get - { - IntPtr val = IntPtr.Zero; - - try - { - CameraErrorFactory.ThrowIfError(Native.GetTagSoftware(_camera.GetHandle(), out val), - "Failed to get tag software"); - - return Marshal.PtrToStringAnsi(val); - } - finally - { - LibcSupport.Free(val); - } - } - - set - { - CameraErrorFactory.ThrowIfError(Native.SetTagSoftware(_camera.GetHandle(), value), - "Failed to set tag software."); - } - } - - /// - /// The geo tag(GPS data) in the EXIF tag. - /// - /// 3 - /// The camera already has been disposed of. - public Location GeoTag - { - get - { - CameraErrorFactory.ThrowIfError(Native.GetGeotag(_camera.GetHandle(), - out double latitude, out double longitude, out double altitude), "Failed to get tag"); - - return new Location(latitude, longitude, altitude); - } - - set - { - CameraErrorFactory.ThrowIfError(Native.SetGeotag(_camera.GetHandle(), - value.Latitude, value.Longitude, value.Altitude), "Failed to set geo tag."); - } - } - - /// - /// Removes the geo tag(GPS data) in the EXIF(EXchangeable Image File format) tag. - /// - /// 3 - /// The camera already has been disposed of. - public void RemoveGeoTag() - { - CameraErrorFactory.ThrowIfError(Native.RemoveGeotag(_camera.GetHandle()), - "Failed to remove the geotag\t."); - } - - /// - /// The camera orientation in the tag. - /// - /// 3 - /// The camera already has been disposed of. - public CameraTagOrientation OrientationTag - { - get - { - CameraErrorFactory.ThrowIfError(Native.GetTagOrientation(_camera.GetHandle(), out var val), - "Failed to get camera tag orientation"); - - return val; - } - - set - { - ValidationUtil.ValidateEnum(typeof(CameraTagOrientation), value); - CameraErrorFactory.ThrowIfError(Native.SetTagOrientation(_camera.GetHandle(), value), - "Failed to set camera tag orientation."); - } - } - #endregion EXIF tag - } -} diff --git a/src/Tizen.Multimedia.Camera/Camera/CameraStateChangedEventArgs.cs b/src/Tizen.Multimedia.Camera/Camera/CameraStateChangedEventArgs.cs deleted file mode 100755 index 57f872211..000000000 --- a/src/Tizen.Multimedia.Camera/Camera/CameraStateChangedEventArgs.cs +++ /dev/null @@ -1,54 +0,0 @@ -/* - * 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.Multimedia -{ - /// - /// Provides data for the event. - /// - public class CameraStateChangedEventArgs : EventArgs - { - internal CameraStateChangedEventArgs(CameraState previous, CameraState current, bool policy) - { - Previous = previous; - Current = current; - ByPolicy = policy; - } - - /// - /// Gets the previous state of the camera. - /// - /// 3 - public CameraState Previous { get; } - - /// - /// Gets the current state of the camera. - /// - /// 3 - public CameraState Current { get; } - - /// - /// Gets the value indicating whether the state is changed by policy. - /// - /// - /// true if the state changed by policy, such as resource conflict or security, otherwise false. - /// - /// 3 - public bool ByPolicy { get; } - } -} diff --git a/src/Tizen.Multimedia.Camera/Camera/DoublePlane.cs b/src/Tizen.Multimedia.Camera/Camera/DoublePlane.cs deleted file mode 100755 index 887388a40..000000000 --- a/src/Tizen.Multimedia.Camera/Camera/DoublePlane.cs +++ /dev/null @@ -1,47 +0,0 @@ -/* - * 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.Runtime.InteropServices; -using static Interop.Camera; - -namespace Tizen.Multimedia -{ - /// - /// The class containing image data which has two planes. - /// - public class DoublePlane : IPreviewPlane - { - internal DoublePlane(DoublePlaneStruct unmanaged) - { - Y = new byte[unmanaged.YLength]; - UV = new byte[unmanaged.UVLength]; - Marshal.Copy(unmanaged.Y, Y, 0, (int)unmanaged.YLength); - Marshal.Copy(unmanaged.UV, UV, 0, (int)unmanaged.UVLength); - } - - /// - /// The Y plane data. - /// - /// 3 - public byte[] Y { get; } - - /// - /// The UV plane data. - /// - /// 3 - public byte[] UV { get; } - } -} diff --git a/src/Tizen.Multimedia.Camera/Camera/EncodedPlane.cs b/src/Tizen.Multimedia.Camera/Camera/EncodedPlane.cs deleted file mode 100755 index 48524b7f5..000000000 --- a/src/Tizen.Multimedia.Camera/Camera/EncodedPlane.cs +++ /dev/null @@ -1,39 +0,0 @@ -/* - * 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.Runtime.InteropServices; -using static Interop.Camera; - -namespace Tizen.Multimedia -{ - /// - /// The class containing the encoded image data. - /// - public class EncodedPlane : IPreviewPlane - { - internal EncodedPlane(EncodedPlaneStruct unmanagedData) - { - Data = new byte[unmanagedData.DataLength]; - Marshal.Copy(unmanagedData.Data, Data, 0, (int)unmanagedData.DataLength); - } - - /// - /// The buffer containing the encoded image data. - /// - /// 3 - public byte[] Data { get; } - } -} diff --git a/src/Tizen.Multimedia.Camera/Camera/FaceDetectedEventArgs.cs b/src/Tizen.Multimedia.Camera/Camera/FaceDetectedEventArgs.cs deleted file mode 100755 index 3b9e7eb87..000000000 --- a/src/Tizen.Multimedia.Camera/Camera/FaceDetectedEventArgs.cs +++ /dev/null @@ -1,39 +0,0 @@ -/* - * 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.Collections.Generic; - -namespace Tizen.Multimedia -{ - /// - /// Provides data for the event. - /// If the user needs to keep the faces data, the user has to copy the data. - /// - public class FaceDetectedEventArgs : EventArgs - { - internal FaceDetectedEventArgs(List faces) - { - Faces = faces; - } - - /// - /// Gets the list containing faces of type . - /// - /// 3 - public IEnumerable Faces { get; } - } -} diff --git a/src/Tizen.Multimedia.Camera/Camera/FaceDetectionData.cs b/src/Tizen.Multimedia.Camera/Camera/FaceDetectionData.cs deleted file mode 100755 index 0a3f6c0d9..000000000 --- a/src/Tizen.Multimedia.Camera/Camera/FaceDetectionData.cs +++ /dev/null @@ -1,76 +0,0 @@ -/* - * 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; -using static Interop.Camera; - -namespace Tizen.Multimedia -{ - /// - /// The class contains the details of the detected face. - /// - public class FaceDetectionData - { - internal FaceDetectionData(IntPtr ptr) - { - var unmanagedStruct = Marshal.PtrToStructure(ptr); - - Id = unmanagedStruct.Id; - Score = unmanagedStruct.Score; - X = unmanagedStruct.X; - Y = unmanagedStruct.Y; - Width = unmanagedStruct.Width; - Height = unmanagedStruct.Height; - } - - /// - /// The ID of each face. - /// - /// 3 - public int Id { get; } - - /// - /// The confidence level for the detection of the face. - /// - /// 3 - public int Score { get; } - - /// - /// The X co-ordinate of the face. - /// - /// 3 - public int X { get; } - - /// - /// The Y co-ordinate of the face. - /// - /// 3 - public int Y { get; } - - /// - /// The width of the face. - /// - /// 3 - public int Width { get; } - - /// - /// The height of the face. - /// - /// 3 - public int Height { get; } - } -} diff --git a/src/Tizen.Multimedia.Camera/Camera/HdrCaptureProgressEventArgs.cs b/src/Tizen.Multimedia.Camera/Camera/HdrCaptureProgressEventArgs.cs deleted file mode 100755 index cf447656e..000000000 --- a/src/Tizen.Multimedia.Camera/Camera/HdrCaptureProgressEventArgs.cs +++ /dev/null @@ -1,37 +0,0 @@ -/* - * 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.Multimedia -{ - /// - /// Provides data for the event. - /// - public class HdrCaptureProgressEventArgs : EventArgs - { - internal HdrCaptureProgressEventArgs(int percent) - { - Percent = percent; - } - - /// - /// Gets the HDR Capture progress in percent. - /// - /// 3 - public int Percent { get; } - } -} diff --git a/src/Tizen.Multimedia.Camera/Camera/IPreviewPlane.cs b/src/Tizen.Multimedia.Camera/Camera/IPreviewPlane.cs deleted file mode 100755 index d84d07a19..000000000 --- a/src/Tizen.Multimedia.Camera/Camera/IPreviewPlane.cs +++ /dev/null @@ -1,22 +0,0 @@ -/* - * 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. - */ - -namespace Tizen.Multimedia -{ - public interface IPreviewPlane - { - } -} diff --git a/src/Tizen.Multimedia.Camera/Camera/Location.cs b/src/Tizen.Multimedia.Camera/Camera/Location.cs deleted file mode 100755 index 8160f4e92..000000000 --- a/src/Tizen.Multimedia.Camera/Camera/Location.cs +++ /dev/null @@ -1,55 +0,0 @@ -/* - * 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. - */ - -namespace Tizen.Multimedia -{ - /// - /// The location class containing GPS data details. - /// - public class Location - { - /// - /// The public constructor. - /// - /// The latitude data. - /// The longitude data. - /// The altitude data. - public Location(double latitude, double longitude, double altitude) - { - Latitude = latitude; - Longitude = longitude; - Altitude = altitude; - } - - /// - /// The latitude data. - /// - /// 3 - public double Latitude { get; } - - /// - /// The longitude data. - /// - /// 3 - public double Longitude { get; } - - /// - /// The altitude data. - /// - /// 3 - public double Altitude { get; } - } -} diff --git a/src/Tizen.Multimedia.Camera/Camera/MediaPacketPreviewEventArgs.cs b/src/Tizen.Multimedia.Camera/Camera/MediaPacketPreviewEventArgs.cs deleted file mode 100755 index b60083b90..000000000 --- a/src/Tizen.Multimedia.Camera/Camera/MediaPacketPreviewEventArgs.cs +++ /dev/null @@ -1,37 +0,0 @@ -/* - * 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.Multimedia -{ - /// - /// Provides data for the event. - /// - public class MediaPacketPreviewEventArgs : EventArgs - { - internal MediaPacketPreviewEventArgs(MediaPacket packet) - { - Packet = packet; - } - - /// - /// Gets the media packet data. - /// - /// 3 - public MediaPacket Packet { get; } - } -} diff --git a/src/Tizen.Multimedia.Camera/Camera/PreviewEventArgs.cs b/src/Tizen.Multimedia.Camera/Camera/PreviewEventArgs.cs deleted file mode 100755 index fbda63cb1..000000000 --- a/src/Tizen.Multimedia.Camera/Camera/PreviewEventArgs.cs +++ /dev/null @@ -1,37 +0,0 @@ -/* - * 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.Multimedia -{ - /// - /// Provides data for the event. - /// - public class PreviewEventArgs : EventArgs - { - internal PreviewEventArgs(PreviewFrame preview) - { - Preview = preview; - } - - /// - /// Gets the preview frame data. - /// - /// 3 - public PreviewFrame Preview { get; } - } -} diff --git a/src/Tizen.Multimedia.Camera/Camera/PreviewFrame.cs b/src/Tizen.Multimedia.Camera/Camera/PreviewFrame.cs deleted file mode 100755 index 37770181c..000000000 --- a/src/Tizen.Multimedia.Camera/Camera/PreviewFrame.cs +++ /dev/null @@ -1,117 +0,0 @@ -/* - * 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.Diagnostics; -using System.Runtime.InteropServices; -using static Interop.Camera; - -namespace Tizen.Multimedia -{ - /// - /// The class containing the preview image data. - /// - public class PreviewFrame - { - internal PreviewFrame(IntPtr ptr) - { - var unmanagedStruct = Marshal.PtrToStructure(ptr); - - Format = unmanagedStruct.Format; - Resolution = new Size(unmanagedStruct.Width, unmanagedStruct.Height); - TimeStamp = unmanagedStruct.TimeStamp; - PlaneType = GetPlaneType(unmanagedStruct); - Plane = ConvertPlane(unmanagedStruct); - } - - private static IPreviewPlane ConvertPlane(CameraPreviewDataStruct unmanagedStruct) - { - if (unmanagedStruct.NumOfPlanes == 1) - { - if (unmanagedStruct.Format == CameraPixelFormat.H264 || unmanagedStruct.Format == CameraPixelFormat.Jpeg) - { - return new EncodedPlane(unmanagedStruct.Plane.EncodedPlane); - } - else - { - return new SinglePlane(unmanagedStruct.Plane.SinglePlane); - } - } - else if (unmanagedStruct.NumOfPlanes == 2) - { - return new DoublePlane(unmanagedStruct.Plane.DoublePlane); - } - else if (unmanagedStruct.NumOfPlanes == 3) - { - return new TriplePlane(unmanagedStruct.Plane.TriplePlane); - } - - Debug.Fail("Unknown preview data!"); - return null; - } - - private static PlaneType GetPlaneType(CameraPreviewDataStruct unmanagedStruct) - { - if (unmanagedStruct.NumOfPlanes == 1) - { - if (unmanagedStruct.Format == CameraPixelFormat.H264 || unmanagedStruct.Format == CameraPixelFormat.Jpeg) - { - return PlaneType.EncodedPlane; - } - else - { - return PlaneType.SinglePlane; - } - } - else if (unmanagedStruct.NumOfPlanes == 2) - { - return PlaneType.DoublePlane; - } - - return PlaneType.TriplePlane; - } - - /// - /// The pixel format of the image. - /// - /// 3 - public CameraPixelFormat Format { get; } - - /// - /// The resolution of the preview image. - /// - /// 3 - public Size Resolution { get; } - - /// - /// The time stamp of the preview frame. - /// - /// 3 - public uint TimeStamp { get; } - - /// - /// The type of the preview plane. - /// - /// 3 - public PlaneType PlaneType { get; } - - /// - /// The buffer including the preview frame. - /// - /// 3 - public IPreviewPlane Plane { get; } - } -} diff --git a/src/Tizen.Multimedia.Camera/Camera/SinglePlane.cs b/src/Tizen.Multimedia.Camera/Camera/SinglePlane.cs deleted file mode 100755 index d627c5d03..000000000 --- a/src/Tizen.Multimedia.Camera/Camera/SinglePlane.cs +++ /dev/null @@ -1,39 +0,0 @@ -/* - * 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.Runtime.InteropServices; -using static Interop.Camera; - -namespace Tizen.Multimedia -{ - /// - /// The class containing the image data, which has a single plane. - /// - public class SinglePlane : IPreviewPlane - { - internal SinglePlane(SinglePlaneStruct unmanaged) - { - Data = new byte[unmanaged.DataLength]; - Marshal.Copy(unmanaged.Data, Data, 0, (int)unmanaged.DataLength); - } - - /// - /// The YUV plane data. - /// - /// 3 - public byte[] Data { get; } - } -} diff --git a/src/Tizen.Multimedia.Camera/Camera/StillImage.cs b/src/Tizen.Multimedia.Camera/Camera/StillImage.cs deleted file mode 100755 index fabb9ebc3..000000000 --- a/src/Tizen.Multimedia.Camera/Camera/StillImage.cs +++ /dev/null @@ -1,79 +0,0 @@ -/* - * 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.Diagnostics; -using System.Runtime.InteropServices; -using static Interop.Camera; - -namespace Tizen.Multimedia -{ - /// - /// The class containing the captured still image. - /// - public class StillImage - { - internal StillImage(IntPtr ptr) - { - var unmanagedStruct = Marshal.PtrToStructure(ptr); - - Format = unmanagedStruct.Format; - Resolution = new Size(unmanagedStruct.Width, unmanagedStruct.Height); - - if (unmanagedStruct.Data != IntPtr.Zero && unmanagedStruct.DataLength > 0) - { - Data = new byte[unmanagedStruct.DataLength]; - Marshal.Copy(unmanagedStruct.Data, Data, 0, (int)unmanagedStruct.DataLength); - } - else - { - Debug.Fail("CameraStillImage Data is null!"); - } - - //Exif can be null - if (unmanagedStruct.ExifLength > 0) - { - Exif = new byte[unmanagedStruct.ExifLength]; - Marshal.Copy(unmanagedStruct.Exif, Exif, 0, (int)unmanagedStruct.ExifLength); - } - } - - /// - /// The pixel format of the still image. - /// - /// 3 - public CameraPixelFormat Format { get; } - - /// - /// The resolution of the still image. - /// - /// 3 - public Size Resolution { get; } - - /// - /// The buffer containing the still image. - /// - /// 3 - public byte[] Data { get; } - - /// - /// The Exif data describing additional metadata of still image. - /// Please refer Exif specification for more details. - /// - /// 3 - public byte[] Exif { get; } - } -} diff --git a/src/Tizen.Multimedia.Camera/Camera/TriplePlane.cs b/src/Tizen.Multimedia.Camera/Camera/TriplePlane.cs deleted file mode 100755 index 0d5051527..000000000 --- a/src/Tizen.Multimedia.Camera/Camera/TriplePlane.cs +++ /dev/null @@ -1,55 +0,0 @@ -/* - * 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.Runtime.InteropServices; -using static Interop.Camera; - -namespace Tizen.Multimedia -{ - /// - /// The class containing image data which has three planes. - /// - public class TriplePlane : IPreviewPlane - { - internal TriplePlane(TriplePlaneStruct unmanaged) - { - Y = new byte[unmanaged.YLength]; - U = new byte[unmanaged.ULength]; - V = new byte[unmanaged.VLength]; - Marshal.Copy(unmanaged.Y, Y, 0, (int)unmanaged.YLength); - Marshal.Copy(unmanaged.U, U, 0, (int)unmanaged.ULength); - Marshal.Copy(unmanaged.V, V, 0, (int)unmanaged.VLength); - } - - /// - /// The Y plane data. - /// - /// 3 - public byte[] Y { get; } - - /// - /// The U plane data. - /// - /// 3 - public byte[] U { get; } - - /// - /// The V plane data. - /// - /// 3 - public byte[] V { get; } - } -} diff --git a/src/Tizen.Multimedia.Camera/Interop/Interop.Camera.cs b/src/Tizen.Multimedia.Camera/Interop/Interop.Camera.cs deleted file mode 100755 index affcce6a3..000000000 --- a/src/Tizen.Multimedia.Camera/Interop/Interop.Camera.cs +++ /dev/null @@ -1,282 +0,0 @@ -/* - * 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; -using Tizen.Multimedia; - -internal static partial class Interop -{ - internal static partial class Camera - { - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void FaceDetectedCallback(IntPtr faces, int count, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void StateChangedCallback(CameraState previous, CameraState current, bool byPolicy, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void InterruptedCallback(CameraPolicy policy, CameraState previous, CameraState current, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void InterruptStartedCallback(CameraPolicy policy, CameraState state, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void FocusStateChangedCallback(CameraFocusState state, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void ErrorCallback(CameraErrorCode error, CameraState current, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void CapturingCallback(IntPtr image, IntPtr postview, IntPtr thumbnail, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void CaptureCompletedCallback(IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void PreviewCallback(IntPtr frame, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void MediaPacketPreviewCallback(IntPtr mediaPacketHandle, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void HdrCaptureProgressCallback(int percent, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void DeviceStateChangedCallback(CameraDevice device, CameraDeviceState state, IntPtr userData); - - [DllImport(Libraries.Camera, EntryPoint = "camera_create")] - internal static extern CameraError Create(CameraDevice device, out IntPtr handle); - - [DllImport(Libraries.Camera, EntryPoint = "camera_change_device")] - internal static extern CameraError ChangeDevice(IntPtr handle, CameraDevice device); - - [DllImport(Libraries.Camera, EntryPoint = "camera_destroy")] - internal static extern CameraError Destroy(IntPtr handle); - - [DllImport(Libraries.Camera, EntryPoint = "camera_get_device_count")] - internal static extern CameraError GetDeviceCount(IntPtr handle, out int count); - - [DllImport(Libraries.Camera, EntryPoint = "camera_start_preview")] - internal static extern CameraError StartPreview(IntPtr handle); - - [DllImport(Libraries.Camera, EntryPoint = "camera_stop_preview")] - internal static extern CameraError StopPreview(IntPtr handle); - - [DllImport(Libraries.Camera, EntryPoint = "camera_get_device_state")] - internal static extern CameraError GetDeviceState(CameraDevice device, out CameraDeviceState state); - - [DllImport(Libraries.Camera, EntryPoint = "camera_start_capture")] - internal static extern CameraError StartCapture(IntPtr handle, CapturingCallback captureCallback, - CaptureCompletedCallback completedCallback, IntPtr userData); - - [DllImport(Libraries.Camera, EntryPoint = "camera_start_continuous_capture")] - internal static extern CameraError StartContinuousCapture(IntPtr handle, int count, int interval, - CapturingCallback captureCallback, CaptureCompletedCallback completedCallback, IntPtr userData); - - [DllImport(Libraries.Camera, EntryPoint = "camera_stop_continuous_capture")] - internal static extern CameraError StopContinuousCapture(IntPtr handle); - - [DllImport(Libraries.Camera, EntryPoint = "camera_get_state")] - internal static extern CameraError GetState(IntPtr handle, out CameraState state); - - [DllImport(Libraries.Camera, EntryPoint = "camera_start_focusing")] - internal static extern CameraError StartFocusing(IntPtr handle, bool continuous); - - [DllImport(Libraries.Camera, EntryPoint = "camera_cancel_focusing")] - internal static extern CameraError CancelFocusing(IntPtr handle); - - [DllImport(Libraries.Camera, EntryPoint = "camera_set_preview_resolution")] - internal static extern CameraError SetPreviewResolution(IntPtr handle, int width, int height); - - [DllImport(Libraries.Camera, EntryPoint = "camera_get_preview_resolution")] - internal static extern CameraError GetPreviewResolution(IntPtr handle, out int width, out int height); - - [DllImport(Libraries.Camera, EntryPoint = "camera_get_recommended_preview_resolution")] - internal static extern CameraError GetRecommendedPreviewResolution(IntPtr handle, out int width, out int height); - - [DllImport(Libraries.Camera, EntryPoint = "camera_start_face_detection")] - internal static extern CameraError StartFaceDetection(IntPtr handle, FaceDetectedCallback callback, IntPtr userData); - - [DllImport(Libraries.Camera, EntryPoint = "camera_stop_face_detection")] - internal static extern CameraError StopFaceDetection(IntPtr handle); - - [DllImport(Libraries.Camera, EntryPoint = "camera_set_display_reuse_hint")] - internal static extern CameraError SetDisplayReuseHint(IntPtr handle, bool hint); - - [DllImport(Libraries.Camera, EntryPoint = "camera_get_display_reuse_hint")] - internal static extern CameraError GetDisplayReuseHint(IntPtr handle, out bool hint); - - [DllImport(Libraries.Camera, EntryPoint = "camera_set_capture_resolution")] - internal static extern CameraError SetCaptureResolution(IntPtr handle, int width, int height); - - [DllImport(Libraries.Camera, EntryPoint = "camera_get_capture_resolution")] - internal static extern CameraError GetCaptureResolution(IntPtr handle, out int width, out int height); - - [DllImport(Libraries.Camera, EntryPoint = "camera_set_capture_format")] - internal static extern CameraError SetCaptureFormat(IntPtr handle, CameraPixelFormat format); - - [DllImport(Libraries.Camera, EntryPoint = "camera_get_capture_format")] - internal static extern CameraError GetCaptureFormat(IntPtr handle, out CameraPixelFormat format); - - [DllImport(Libraries.Camera, EntryPoint = "camera_set_preview_format")] - internal static extern CameraError SetPreviewPixelFormat(IntPtr handle, CameraPixelFormat format); - - [DllImport(Libraries.Camera, EntryPoint = "camera_get_preview_format")] - internal static extern CameraError GetPreviewPixelFormat(IntPtr handle, out CameraPixelFormat format); - - [DllImport(Libraries.Camera, EntryPoint = "camera_get_facing_direction")] - internal static extern CameraError GetFacingDirection(IntPtr handle, out CameraFacingDirection direction); - - [DllImport(Libraries.Camera, EntryPoint = "camera_get_flash_state")] - internal static extern CameraError GetFlashState(CameraDevice device, out CameraFlashState state); - - [DllImport(Libraries.Camera, EntryPoint = "camera_set_preview_cb")] - internal static extern CameraError SetPreviewCallback(IntPtr handle, PreviewCallback callback, IntPtr userData); - - [DllImport(Libraries.Camera, EntryPoint = "camera_unset_preview_cb")] - internal static extern CameraError UnsetPreviewCallback(IntPtr handle); - - [DllImport(Libraries.Camera, EntryPoint = "camera_set_media_packet_preview_cb")] - internal static extern CameraError SetMediaPacketPreviewCallback(IntPtr handle, MediaPacketPreviewCallback callback, IntPtr userData); - - [DllImport(Libraries.Camera, EntryPoint = "camera_unset_media_packet_preview_cb")] - internal static extern CameraError UnsetMediaPacketPreviewCallback(IntPtr handle); - - [DllImport(Libraries.Camera, EntryPoint = "camera_set_state_changed_cb")] - internal static extern CameraError SetStateChangedCallback(IntPtr handle, StateChangedCallback callback, IntPtr userData); - - [DllImport(Libraries.Camera, EntryPoint = "camera_add_device_state_changed_cb")] - internal static extern CameraError SetDeviceStateChangedCallback(DeviceStateChangedCallback callback, IntPtr userData, out int callbackId); - - [DllImport(Libraries.Camera, EntryPoint = "camera_unset_state_changed_cb")] - internal static extern CameraError UnsetStateChangedCallback(IntPtr handle); - - [DllImport(Libraries.Camera, EntryPoint = "camera_remove_device_state_changed_cb")] - internal static extern CameraError UnsetDeviceStateChangedCallback(int cbId); - - [DllImport(Libraries.Camera, EntryPoint = "camera_set_interrupt_started_cb")] - internal static extern CameraError SetInterruptStartedCallback(IntPtr handle, InterruptStartedCallback callback, IntPtr userData); - - [DllImport(Libraries.Camera, EntryPoint = "camera_unset_interrupt_started_cb")] - internal static extern CameraError UnsetInterruptStartedCallback(IntPtr handle); - - [DllImport(Libraries.Camera, EntryPoint = "camera_set_interrupted_cb")] - internal static extern CameraError SetInterruptedCallback(IntPtr handle, InterruptedCallback callback, IntPtr userData); - - [DllImport(Libraries.Camera, EntryPoint = "camera_unset_interrupted_cb")] - internal static extern CameraError UnsetInterruptedCallback(IntPtr handle); - - [DllImport(Libraries.Camera, EntryPoint = "camera_set_focus_changed_cb")] - internal static extern CameraError SetFocusStateChangedCallback(IntPtr handle, FocusStateChangedCallback callback, IntPtr userData); - - [DllImport(Libraries.Camera, EntryPoint = "camera_unset_focus_changed_cb")] - internal static extern CameraError UnsetFocusChangedCallback(IntPtr handle); - - [DllImport(Libraries.Camera, EntryPoint = "camera_set_error_cb")] - internal static extern CameraError SetErrorCallback(IntPtr handle, ErrorCallback callback, IntPtr userData); - - [DllImport(Libraries.Camera, EntryPoint = "camera_unset_error_cb")] - internal static extern CameraError UnsetErrorCallback(IntPtr handle); - - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_set_hdr_capture_progress_cb")] - internal static extern CameraError SetHdrCaptureProgressCallback(IntPtr handle, HdrCaptureProgressCallback callback, IntPtr userData); - - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_unset_hdr_capture_progress_cb")] - internal static extern CameraError UnsetHdrCaptureProgressCallback(IntPtr handle); - - [StructLayout(LayoutKind.Sequential)] - internal struct StillImageDataStruct - { - internal IntPtr Data; - internal uint DataLength; - internal int Width; - internal int Height; - internal CameraPixelFormat Format; - internal IntPtr Exif; - internal uint ExifLength; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct DetectedFaceStruct - { - internal int Id; - internal int Score; - internal int X; - internal int Y; - internal int Width; - internal int Height; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct SinglePlaneStruct - { - internal IntPtr Data; - internal uint DataLength; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct DoublePlaneStruct - { - internal IntPtr Y; - internal IntPtr UV; - internal uint YLength; - internal uint UVLength; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct TriplePlaneStruct - { - internal IntPtr Y; - internal IntPtr U; - internal IntPtr V; - internal uint YLength; - internal uint ULength; - internal uint VLength; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct EncodedPlaneStruct - { - internal IntPtr Data; - internal uint DataLength; - } - - [StructLayout(LayoutKind.Explicit)] - internal struct PreviewPlaneStruct - { - [FieldOffsetAttribute(0)] - internal SinglePlaneStruct SinglePlane; - [FieldOffsetAttribute(0)] - internal DoublePlaneStruct DoublePlane; - [FieldOffsetAttribute(0)] - internal TriplePlaneStruct TriplePlane; - [FieldOffsetAttribute(0)] - internal EncodedPlaneStruct EncodedPlane; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct CameraPreviewDataStruct - { - internal CameraPixelFormat Format; - internal int Width; - internal int Height; - internal int NumOfPlanes; - internal uint TimeStamp; - internal PreviewPlaneStruct Plane; - } - } -} \ No newline at end of file diff --git a/src/Tizen.Multimedia.Camera/Interop/Interop.CameraCapabilities.cs b/src/Tizen.Multimedia.Camera/Interop/Interop.CameraCapabilities.cs deleted file mode 100755 index f4306e12b..000000000 --- a/src/Tizen.Multimedia.Camera/Interop/Interop.CameraCapabilities.cs +++ /dev/null @@ -1,160 +0,0 @@ -/* - * 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; -using Tizen.Multimedia; - -internal static partial class Interop -{ - internal static partial class CameraCapabilities - { - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool PreviewResolutionCallback(int Width, int Height, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool CaptureResolutionCallback(int Width, int Height, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool CaptureFormatCallback(CameraPixelFormat format, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool PreviewFormatCallback(CameraPixelFormat format, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool FpsCallback(CameraFps fps, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool FpsByResolutionCallback(CameraFps fps, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool AfModeCallback(CameraAutoFocusMode mode, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool ExposureModeCallback(CameraExposureMode mode, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool IsoCallback(CameraIsoLevel iso, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool TheaterModeCallback(CameraTheaterMode mode, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool WhitebalanceCallback(CameraWhiteBalance whitebalance, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool EffectCallback(CameraEffectMode effect, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool SceneModeCallback(CameraSceneMode mode, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool FlashModeCallback(CameraFlashMode mode, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool StreamRotationCallback(Rotation rotation, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool StreamFlipCallback(Flips flip, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool PtzTypeCallback(CameraPtzType type, IntPtr userData); - - - [DllImport(Libraries.Camera, EntryPoint = "camera_is_supported_continuous_capture")] - [return: MarshalAs(UnmanagedType.I1)] - internal static extern bool IsContinuousCaptureSupported(IntPtr handle); - - [DllImport(Libraries.Camera, EntryPoint = "camera_is_supported_face_detection")] - [return: MarshalAs(UnmanagedType.I1)] - internal static extern bool IsFaceDetectionSupported(IntPtr handle); - - [DllImport(Libraries.Camera, EntryPoint = "camera_is_supported_zero_shutter_lag")] - [return: MarshalAs(UnmanagedType.I1)] - internal static extern bool IsZeroShutterLagSupported(IntPtr handle); - - [DllImport(Libraries.Camera, EntryPoint = "camera_is_supported_media_packet_preview_cb")] - [return: MarshalAs(UnmanagedType.I1)] - internal static extern bool IsMediaPacketPreviewCallbackSupported(IntPtr handle); - - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_is_supported_hdr_capture")] - [return: MarshalAs(UnmanagedType.I1)] - internal static extern bool IsHdrCaptureSupported(IntPtr handle); - - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_is_supported_anti_shake")] - [return: MarshalAs(UnmanagedType.I1)] - internal static extern bool IsAntiShakeSupported(IntPtr handle); - - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_is_supported_video_stabilization")] - [return: MarshalAs(UnmanagedType.I1)] - internal static extern bool IsVideoStabilizationSupported(IntPtr handle); - - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_is_supported_auto_contrast")] - [return: MarshalAs(UnmanagedType.I1)] - internal static extern bool IsAutoContrastSupported(IntPtr handle); - - [DllImport(Libraries.Camera, EntryPoint = "camera_foreach_supported_preview_resolution")] - internal static extern CameraError SupportedPreviewResolutions(IntPtr handle, PreviewResolutionCallback callback, IntPtr userData); - - [DllImport(Libraries.Camera, EntryPoint = "camera_foreach_supported_capture_resolution")] - internal static extern CameraError SupportedCaptureResolutions(IntPtr handle, CaptureResolutionCallback callback, IntPtr userData); - - [DllImport(Libraries.Camera, EntryPoint = "camera_foreach_supported_capture_format")] - internal static extern CameraError SupportedCapturePixelFormats(IntPtr handle, CaptureFormatCallback callback, IntPtr userData); - - [DllImport(Libraries.Camera, EntryPoint = "camera_foreach_supported_preview_format")] - internal static extern CameraError SupportedPreviewPixelFormats(IntPtr handle, PreviewFormatCallback callback, IntPtr userData); - - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_foreach_supported_fps")] - internal static extern CameraError SupportedPreviewFps(IntPtr handle, FpsCallback callback, IntPtr userData); - - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_foreach_supported_fps_by_resolution")] - internal static extern CameraError SupportedPreviewFpsByResolution(IntPtr handle, int width, int height, FpsByResolutionCallback callback, IntPtr userData); - - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_foreach_supported_af_mode")] - internal static extern CameraError SupportedAutoFocusModes(IntPtr handle, AfModeCallback callback, IntPtr userData); - - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_foreach_supported_exposure_mode")] - internal static extern CameraError SupportedExposureModes(IntPtr handle, ExposureModeCallback callback, IntPtr userData); - - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_foreach_supported_iso")] - internal static extern CameraError SupportedIso(IntPtr handle, IsoCallback callback, IntPtr userData); - - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_foreach_supported_theater_mode")] - internal static extern CameraError SupportedTheaterModes(IntPtr handle, TheaterModeCallback callback, IntPtr userData); - - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_foreach_supported_whitebalance")] - internal static extern CameraError SupportedWhitebalance(IntPtr handle, WhitebalanceCallback callback, IntPtr userData); - - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_foreach_supported_effect")] - internal static extern CameraError SupportedEffects(IntPtr handle, EffectCallback callback, IntPtr userData); - - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_foreach_supported_scene_mode")] - internal static extern CameraError SupportedSceneModes(IntPtr handle, SceneModeCallback callback, IntPtr userData); - - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_foreach_supported_flash_mode")] - internal static extern CameraError SupportedFlashModes(IntPtr handle, FlashModeCallback callback, IntPtr userData); - - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_foreach_supported_stream_rotation")] - internal static extern CameraError SupportedStreamRotations(IntPtr handle, StreamRotationCallback callback, IntPtr userData); - - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_foreach_supported_stream_flip")] - internal static extern CameraError SupportedStreamFlips(IntPtr handle, StreamFlipCallback callback, IntPtr userData); - - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_foreach_supported_ptz_type")] - internal static extern CameraError SupportedPtzTypes(IntPtr handle, PtzTypeCallback callback, IntPtr userData); - } -} diff --git a/src/Tizen.Multimedia.Camera/Interop/Interop.CameraDisplay.cs b/src/Tizen.Multimedia.Camera/Interop/Interop.CameraDisplay.cs deleted file mode 100644 index 001aa428a..000000000 --- a/src/Tizen.Multimedia.Camera/Interop/Interop.CameraDisplay.cs +++ /dev/null @@ -1,58 +0,0 @@ -/* - * 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; -using Tizen.Multimedia; - -internal static partial class Interop -{ - internal static partial class CameraDisplay - { - [DllImport(Libraries.Camera, EntryPoint = "camera_get_display_mode")] - internal static extern CameraError GetMode(IntPtr handle, out CameraDisplayMode mode); - - [DllImport(Libraries.Camera, EntryPoint = "camera_set_display_mode")] - internal static extern CameraError SetMode(IntPtr handle, CameraDisplayMode mode); - - [DllImport(Libraries.Camera, EntryPoint = "camera_is_display_visible")] - internal static extern CameraError GetVisible(IntPtr handle, out bool visible); - - [DllImport(Libraries.Camera, EntryPoint = "camera_set_display_visible")] - internal static extern CameraError SetVisible(IntPtr handle, bool visible); - - [DllImport(Libraries.Camera, EntryPoint = "camera_get_display_rotation")] - internal static extern CameraError GetRotation(IntPtr handle, out Rotation rotation); - - [DllImport(Libraries.Camera, EntryPoint = "camera_set_display_rotation")] - internal static extern CameraError SetRotation(IntPtr handle, Rotation rotation); - - [DllImport(Libraries.Camera, EntryPoint = "camera_get_display_flip")] - internal static extern CameraError GetFlip(IntPtr handle, out Flips flip); - - [DllImport(Libraries.Camera, EntryPoint = "camera_set_display_flip")] - internal static extern CameraError SetFlip(IntPtr handle, Flips flip); - - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_display_roi_area")] - internal static extern CameraError GetRoiArea(IntPtr handle, out int x, out int y, out int width, out int height); - - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_set_display_roi_area")] - internal static extern CameraError SetRoiArea(IntPtr handle, int x, int y, int width, int height); - - [DllImport(Libraries.Camera, EntryPoint = "camera_set_display")] - internal static extern CameraError SetTarget(IntPtr handle, DisplayType displayType, IntPtr displayHandle); - } -} diff --git a/src/Tizen.Multimedia.Camera/Interop/Interop.CameraSettings.cs b/src/Tizen.Multimedia.Camera/Interop/Interop.CameraSettings.cs deleted file mode 100755 index bec8a0ae3..000000000 --- a/src/Tizen.Multimedia.Camera/Interop/Interop.CameraSettings.cs +++ /dev/null @@ -1,235 +0,0 @@ -/* - * 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; -using Tizen.Multimedia; - -internal static partial class Interop -{ - internal static partial class CameraSettings - { - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_set_preview_fps")] - internal static extern CameraError SetPreviewFps(IntPtr handle, CameraFps fps); - - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_preview_fps")] - internal static extern CameraError GetPreviewFps(IntPtr handle, out CameraFps fps); - - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_set_image_quality")] - internal static extern CameraError SetImageQuality(IntPtr handle, int quality); - - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_image_quality")] - internal static extern CameraError GetImageQuality(IntPtr handle, out int quality); - - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_set_encoded_preview_bitrate")] - internal static extern CameraError SetBitrate(IntPtr handle, int bitrate); - - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_encoded_preview_bitrate")] - internal static extern CameraError GetBitrate(IntPtr handle, out int bitrate); - - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_set_encoded_preview_gop_interval")] - internal static extern CameraError SetGopInterval(IntPtr handle, int interval); - - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_encoded_preview_gop_interval")] - internal static extern CameraError GetGopInterval(IntPtr handle, out int interval); - - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_set_zoom")] - internal static extern CameraError SetZoom(IntPtr handle, int zoom); - - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_zoom")] - internal static extern CameraError GetZoom(IntPtr handle, out int zoom); - - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_zoom_range")] - internal static extern CameraError GetZoomRange(IntPtr handle, out int min, out int max); - - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_set_af_mode")] - internal static extern CameraError SetAutoFocusMode(IntPtr handle, CameraAutoFocusMode mode); - - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_af_mode")] - internal static extern CameraError GetAutoFocusMode(IntPtr handle, out CameraAutoFocusMode mode); - - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_set_af_area")] - internal static extern CameraError SetAutoFocusArea(IntPtr handle, int x, int y); - - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_clear_af_area")] - internal static extern CameraError ClearAutoFocusArea(IntPtr handle); - - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_set_exposure_mode")] - internal static extern CameraError SetExposureMode(IntPtr handle, CameraExposureMode mode); - - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_exposure_mode")] - internal static extern CameraError GetExposureMode(IntPtr handle, out CameraExposureMode mode); - - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_set_exposure")] - internal static extern CameraError SetExposure(IntPtr handle, int value); - - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_exposure")] - internal static extern CameraError GetExposure(IntPtr handle, out int value); - - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_exposure_range")] - internal static extern CameraError GetExposureRange(IntPtr handle, out int min, out int max); - - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_set_iso")] - internal static extern CameraError SetIso(IntPtr handle, CameraIsoLevel iso); - - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_iso")] - internal static extern CameraError GetIso(IntPtr handle, out CameraIsoLevel iso); - - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_set_theater_mode")] - internal static extern CameraError SetTheaterMode(IntPtr handle, CameraTheaterMode mode); - - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_theater_mode")] - internal static extern CameraError GetTheaterMode(IntPtr handle, out CameraTheaterMode mode); - - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_set_brightness")] - internal static extern CameraError SetBrightness(IntPtr handle, int level); - - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_brightness")] - internal static extern CameraError GetBrightness(IntPtr handle, out int level); - - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_brightness_range")] - internal static extern CameraError GetBrightnessRange(IntPtr handle, out int min, out int max); - - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_set_contrast")] - internal static extern CameraError SetContrast(IntPtr handle, int level); - - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_contrast")] - internal static extern CameraError GetContrast(IntPtr handle, out int level); - - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_contrast_range")] - internal static extern CameraError GetContrastRange(IntPtr handle, out int min, out int max); - - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_set_whitebalance")] - internal static extern CameraError SetWhitebalance(IntPtr handle, CameraWhiteBalance level); - - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_whitebalance")] - internal static extern CameraError GetWhiteBalance(IntPtr handle, out CameraWhiteBalance level); - - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_set_effect")] - internal static extern CameraError SetEffect(IntPtr handle, CameraEffectMode mode); - - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_effect")] - internal static extern CameraError GetEffect(IntPtr handle, out CameraEffectMode mode); - - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_set_scene_mode")] - internal static extern CameraError SetSceneMode(IntPtr handle, CameraSceneMode mode); - - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_scene_mode")] - internal static extern CameraError GetSceneMode(IntPtr handle, out CameraSceneMode mode); - - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_enable_tag")] - internal static extern CameraError EnableTag(IntPtr handle, bool enable); - - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_is_enabled_tag")] - internal static extern CameraError IsEnabledTag(IntPtr handle, out bool enabled); - - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_set_tag_image_description")] - internal static extern CameraError SetImageDescription(IntPtr handle, string description); - - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_tag_image_description")] - internal static extern CameraError GetImageDescription(IntPtr handle, out IntPtr description); - - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_set_tag_software")] - internal static extern CameraError SetTagSoftware(IntPtr handle, string software); - - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_tag_software")] - internal static extern CameraError GetTagSoftware(IntPtr handle, out IntPtr software); - - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_set_tag_orientation")] - internal static extern CameraError SetTagOrientation(IntPtr handle, CameraTagOrientation orientation); - - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_tag_orientation")] - internal static extern CameraError GetTagOrientation(IntPtr handle, out CameraTagOrientation orientation); - - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_set_geotag")] - internal static extern CameraError SetGeotag(IntPtr handle, double latitude, double longtitude, double altitude); - - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_geotag")] - internal static extern CameraError GetGeotag(IntPtr handle, out double latitude, out double longtitude, out double altitude); - - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_remove_geotag")] - internal static extern CameraError RemoveGeotag(IntPtr handle); - - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_set_flash_mode")] - internal static extern CameraError SetFlashMode(IntPtr handle, CameraFlashMode mode); - - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_flash_mode")] - internal static extern CameraError GetFlashMode(IntPtr handle, out CameraFlashMode mode); - - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_lens_orientation")] - internal static extern CameraError GetLensOrientation(IntPtr handle, out int angle); - - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_set_stream_rotation")] - internal static extern CameraError SetStreamRotation(IntPtr handle, Rotation mode); - - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_stream_rotation")] - internal static extern CameraError GetStreamRotation(IntPtr handle, out Rotation mode); - - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_set_stream_flip")] - internal static extern CameraError SetFlip(IntPtr handle, Flips flip); - - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_stream_flip")] - internal static extern CameraError GetFlip(IntPtr handle, out Flips flip); - - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_set_hdr_mode")] - internal static extern CameraError SetHdrMode(IntPtr handle, CameraHdrMode hdr); - - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_hdr_mode")] - internal static extern CameraError GetHdrMode(IntPtr handle, out CameraHdrMode hdr); - - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_enable_anti_shake")] - internal static extern CameraError EnableAntiShake(IntPtr handle, bool enable); - - [DllImport(Libraries.Camera, EntryPoint = " camera_attr_is_enabled_anti_shake")] - internal static extern CameraError IsEnabledAntiShake(IntPtr handle, out bool enabled); - - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_enable_video_stabilization")] - internal static extern CameraError EnableVideoStabilization(IntPtr handle, bool enable); - - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_is_enabled_video_stabilization")] - internal static extern CameraError IsEnabledVideoStabilization(IntPtr handle, out bool enabled); - - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_enable_auto_contrast")] - internal static extern CameraError EnableAutoContrast(IntPtr handle, bool enable); - - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_is_enabled_auto_contrast")] - internal static extern CameraError IsEnabledAutoContrast(IntPtr handle, out bool enabled); - - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_disable_shutter_sound")] - internal static extern CameraError DisableShutterSound(IntPtr handle, bool disable); - - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_set_pan")] - internal static extern CameraError SetPan(IntPtr handle, CameraPtzMoveType type, int step); - - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_pan")] - internal static extern CameraError GetPan(IntPtr handle, out int step); - - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_pan_range")] - internal static extern CameraError GetPanRange(IntPtr handle, out int min, out int max); - - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_set_tilt")] - internal static extern CameraError SetTilt(IntPtr handle, CameraPtzMoveType type, int step); - - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_tilt")] - internal static extern CameraError GetTilt(IntPtr handle, out int step); - - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_get_tilt_range")] - internal static extern CameraError GetTiltRange(IntPtr handle, out int min, out int max); - - [DllImport(Libraries.Camera, EntryPoint = "camera_attr_set_ptz_type")] - internal static extern CameraError SetPtzType(IntPtr handle, CameraPtzType type); - } -} diff --git a/src/Tizen.Multimedia.Camera/Interop/Interop.Libraries.cs b/src/Tizen.Multimedia.Camera/Interop/Interop.Libraries.cs deleted file mode 100644 index 624807eca..000000000 --- a/src/Tizen.Multimedia.Camera/Interop/Interop.Libraries.cs +++ /dev/null @@ -1,23 +0,0 @@ -/* - * 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 Camera = "libcapi-media-camera.so.0"; - } -} diff --git a/src/Tizen.Multimedia.Camera/Tizen.Multimedia.Camera.csproj b/src/Tizen.Multimedia.Camera/Tizen.Multimedia.Camera.csproj deleted file mode 100644 index ec9bff774..000000000 --- a/src/Tizen.Multimedia.Camera/Tizen.Multimedia.Camera.csproj +++ /dev/null @@ -1,11 +0,0 @@ - - - - netstandard2.0 - - - - - - - \ No newline at end of file diff --git a/src/Tizen.Multimedia.Camera/Tizen.Multimedia.Camera.sln b/src/Tizen.Multimedia.Camera/Tizen.Multimedia.Camera.sln deleted file mode 100755 index 87c4e6ef1..000000000 --- a/src/Tizen.Multimedia.Camera/Tizen.Multimedia.Camera.sln +++ /dev/null @@ -1,72 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26730.12 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Multimedia.Camera", "Tizen.Multimedia.Camera.csproj", "{1FE7280C-EF8F-4FE1-A52D-735B8C7D3470}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Multimedia", "..\Tizen.Multimedia\Tizen.Multimedia.csproj", "{D2793EA4-C5AB-4550-8CBC-731759D542CA}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.System.Information", "..\Tizen.System.Information\Tizen.System.Information.csproj", "{B504FA02-56F5-4B12-B597-7982633A3185}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen", "..\Tizen\Tizen.csproj", "{5B85A754-78BF-49F0-AFAD-F1919FE82969}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Log", "..\Tizen.Log\Tizen.Log.csproj", "{EF912492-7006-4D31-A270-82B2E3E0E3BA}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ElmSharp", "..\ElmSharp\ElmSharp.csproj", "{47E74EAE-1A0D-49C4-ACCC-56B2D43D7A08}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Applications.Common", "..\Tizen.Applications.Common\Tizen.Applications.Common.csproj", "{D8C8633F-4C82-41F9-84CD-2E6F75F5D7D8}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.NUI", "..\Tizen.NUI\Tizen.NUI.csproj", "{C6053CBC-9E59-4736-8114-D61EB22BC2A1}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.System.SystemSettings", "..\Tizen.System.SystemSettings\Tizen.System.SystemSettings.csproj", "{5252674B-22C9-408E-8581-E8E888DEDE4D}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {1FE7280C-EF8F-4FE1-A52D-735B8C7D3470}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1FE7280C-EF8F-4FE1-A52D-735B8C7D3470}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1FE7280C-EF8F-4FE1-A52D-735B8C7D3470}.Release|Any CPU.ActiveCfg = Release|Any CPU - {1FE7280C-EF8F-4FE1-A52D-735B8C7D3470}.Release|Any CPU.Build.0 = Release|Any CPU - {D2793EA4-C5AB-4550-8CBC-731759D542CA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D2793EA4-C5AB-4550-8CBC-731759D542CA}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D2793EA4-C5AB-4550-8CBC-731759D542CA}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D2793EA4-C5AB-4550-8CBC-731759D542CA}.Release|Any CPU.Build.0 = Release|Any CPU - {B504FA02-56F5-4B12-B597-7982633A3185}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B504FA02-56F5-4B12-B597-7982633A3185}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B504FA02-56F5-4B12-B597-7982633A3185}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B504FA02-56F5-4B12-B597-7982633A3185}.Release|Any CPU.Build.0 = Release|Any CPU - {5B85A754-78BF-49F0-AFAD-F1919FE82969}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {5B85A754-78BF-49F0-AFAD-F1919FE82969}.Debug|Any CPU.Build.0 = Debug|Any CPU - {5B85A754-78BF-49F0-AFAD-F1919FE82969}.Release|Any CPU.ActiveCfg = Release|Any CPU - {5B85A754-78BF-49F0-AFAD-F1919FE82969}.Release|Any CPU.Build.0 = Release|Any CPU - {EF912492-7006-4D31-A270-82B2E3E0E3BA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {EF912492-7006-4D31-A270-82B2E3E0E3BA}.Debug|Any CPU.Build.0 = Debug|Any CPU - {EF912492-7006-4D31-A270-82B2E3E0E3BA}.Release|Any CPU.ActiveCfg = Release|Any CPU - {EF912492-7006-4D31-A270-82B2E3E0E3BA}.Release|Any CPU.Build.0 = Release|Any CPU - {47E74EAE-1A0D-49C4-ACCC-56B2D43D7A08}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {47E74EAE-1A0D-49C4-ACCC-56B2D43D7A08}.Debug|Any CPU.Build.0 = Debug|Any CPU - {47E74EAE-1A0D-49C4-ACCC-56B2D43D7A08}.Release|Any CPU.ActiveCfg = Release|Any CPU - {47E74EAE-1A0D-49C4-ACCC-56B2D43D7A08}.Release|Any CPU.Build.0 = Release|Any CPU - {D8C8633F-4C82-41F9-84CD-2E6F75F5D7D8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D8C8633F-4C82-41F9-84CD-2E6F75F5D7D8}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D8C8633F-4C82-41F9-84CD-2E6F75F5D7D8}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D8C8633F-4C82-41F9-84CD-2E6F75F5D7D8}.Release|Any CPU.Build.0 = Release|Any CPU - {C6053CBC-9E59-4736-8114-D61EB22BC2A1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C6053CBC-9E59-4736-8114-D61EB22BC2A1}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C6053CBC-9E59-4736-8114-D61EB22BC2A1}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C6053CBC-9E59-4736-8114-D61EB22BC2A1}.Release|Any CPU.Build.0 = Release|Any CPU - {5252674B-22C9-408E-8581-E8E888DEDE4D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {5252674B-22C9-408E-8581-E8E888DEDE4D}.Debug|Any CPU.Build.0 = Debug|Any CPU - {5252674B-22C9-408E-8581-E8E888DEDE4D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {5252674B-22C9-408E-8581-E8E888DEDE4D}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {4FFBFBD0-8B30-4B6A-9775-85728F00A886} - EndGlobalSection -EndGlobal diff --git a/src/Tizen.Multimedia.MediaCodec/Interop/Interop.Libraries.cs b/src/Tizen.Multimedia.MediaCodec/Interop/Interop.Libraries.cs deleted file mode 100644 index ba8ac5b91..000000000 --- a/src/Tizen.Multimedia.MediaCodec/Interop/Interop.Libraries.cs +++ /dev/null @@ -1,27 +0,0 @@ -/* - * 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. - */ - -namespace Tizen.Multimedia.MediaCodec -{ - internal static partial class Interop - { - internal static partial class Libraries - { - public const string MediaCodec = "libcapi-media-codec.so.0"; - public const string MediaTool = "libcapi-media-tool.so.0"; - } - } -} diff --git a/src/Tizen.Multimedia.MediaCodec/Interop/Interop.MediaCodec.cs b/src/Tizen.Multimedia.MediaCodec/Interop/Interop.MediaCodec.cs deleted file mode 100644 index 0aad6632d..000000000 --- a/src/Tizen.Multimedia.MediaCodec/Interop/Interop.MediaCodec.cs +++ /dev/null @@ -1,124 +0,0 @@ -/* - * 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; - -namespace Tizen.Multimedia.MediaCodec -{ - internal static partial class Interop - { - internal static class MediaCodec - { - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void InputBufferUsedCallback(IntPtr mediaPacket, IntPtr arg); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void OutputBufferAvailableCallback(IntPtr mediaPacket, IntPtr arg); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void ErrorCallback(int errorCode, IntPtr arg); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void EosCallback(IntPtr arg); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void BufferStatusCallback(int statusCode, IntPtr arg); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool SupportedCodecCallback(int codecType, IntPtr arg); - - [DllImport(Libraries.MediaCodec, EntryPoint = "mediacodec_create")] - internal static extern int Create(out IntPtr handle); - - [DllImport(Libraries.MediaCodec, EntryPoint = "mediacodec_destroy")] - internal static extern int Destroy(IntPtr handle); - - [DllImport(Libraries.MediaCodec, EntryPoint = "mediacodec_set_codec")] - internal static extern int Configure(IntPtr handle, int codecType, int flags); - - [DllImport(Libraries.MediaCodec, EntryPoint = "mediacodec_set_vdec_info")] - internal static extern int SetVideoDecoderInfo(IntPtr handle, int width, int height); - - [DllImport(Libraries.MediaCodec, EntryPoint = "mediacodec_set_venc_info")] - internal static extern int SetVideoEncoderInfo(IntPtr handle, int width, int height, - int fps, int targetBits); - - [DllImport(Libraries.MediaCodec, EntryPoint = "mediacodec_set_adec_info")] - internal static extern int SetAudioDecoderInfo(IntPtr handle, int sampleRate, int channel, - int bit); - - [DllImport(Libraries.MediaCodec, EntryPoint = "mediacodec_set_aenc_info")] - internal static extern int SetAudioEncoderInfo(IntPtr handle, int sampleRate, int channel, - int bit, int bitRate); - - [DllImport(Libraries.MediaCodec, EntryPoint = "mediacodec_prepare")] - internal static extern int Prepare(IntPtr handle); - - [DllImport(Libraries.MediaCodec, EntryPoint = "mediacodec_unprepare")] - internal static extern int Unprepare(IntPtr handle); - - [DllImport(Libraries.MediaCodec, EntryPoint = "mediacodec_process_input")] - internal static extern int Process(IntPtr handle, IntPtr mediaPacket, ulong timeoutInUs); - - [DllImport(Libraries.MediaCodec, EntryPoint = "mediacodec_get_output")] - internal static extern int GetOutput(IntPtr handle, out IntPtr packet, ulong timeoutInUs); - - [DllImport(Libraries.MediaCodec, EntryPoint = "mediacodec_flush_buffers")] - internal static extern int FlushBuffers(IntPtr handle); - - [DllImport(Libraries.MediaCodec, EntryPoint = "mediacodec_set_input_buffer_used_cb")] - internal static extern int SetInputBufferUsedCb(IntPtr handle, - InputBufferUsedCallback cb, IntPtr arg = default(IntPtr)); - - [DllImport(Libraries.MediaCodec, EntryPoint = "mediacodec_unset_input_buffer_used_cb")] - internal static extern int UnsetInputBufferUsedCb(IntPtr handle); - - [DllImport(Libraries.MediaCodec, EntryPoint = "mediacodec_set_output_buffer_available_cb")] - internal static extern int SetOutputBufferAvailableCb(IntPtr handle, - OutputBufferAvailableCallback cb, IntPtr arg = default(IntPtr)); - - [DllImport(Libraries.MediaCodec, EntryPoint = "mediacodec_unset_output_buffer_available_cb")] - internal static extern int UnsetOutputBufferAvailableCb(IntPtr handle); - - [DllImport(Libraries.MediaCodec, EntryPoint = "mediacodec_set_error_cb")] - internal static extern int SetErrorCb(IntPtr handle, ErrorCallback cb, IntPtr arg = default(IntPtr)); - - [DllImport(Libraries.MediaCodec, EntryPoint = "mediacodec_unset_error_cb")] - internal static extern int UnsetErrorCb(IntPtr handle); - - [DllImport(Libraries.MediaCodec, EntryPoint = "mediacodec_set_eos_cb")] - internal static extern int SetEosCb(IntPtr handle, EosCallback cb, IntPtr arg = default(IntPtr)); - - [DllImport(Libraries.MediaCodec, EntryPoint = "mediacodec_unset_eos_cb")] - internal static extern int UnsetEosCb(IntPtr handle); - - [DllImport(Libraries.MediaCodec, EntryPoint = "mediacodec_set_buffer_status_cb")] - internal static extern int SetBufferStatusCb(IntPtr handle, BufferStatusCallback cb, - IntPtr arg = default(IntPtr)); - - [DllImport(Libraries.MediaCodec, EntryPoint = "mediacodec_unset_buffer_status_cb")] - internal static extern int UnsetBufferStatusCb(IntPtr handle); - - [DllImport(Libraries.MediaCodec, EntryPoint = "mediacodec_get_supported_type")] - internal static extern int GetSupportedType(IntPtr handle, int codecType, bool isEncoder, - out int value); - - [DllImport(Libraries.MediaCodec, EntryPoint = "mediacodec_foreach_supported_codec_static")] - internal static extern int ForeachSupportedCodec(SupportedCodecCallback cb, IntPtr arg); - } - } -} diff --git a/src/Tizen.Multimedia.MediaCodec/Interop/Interop.MediaTool.cs b/src/Tizen.Multimedia.MediaCodec/Interop/Interop.MediaTool.cs deleted file mode 100644 index 59d6e7bc3..000000000 --- a/src/Tizen.Multimedia.MediaCodec/Interop/Interop.MediaTool.cs +++ /dev/null @@ -1,30 +0,0 @@ -/* - * 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; - -namespace Tizen.Multimedia.MediaCodec -{ - internal static partial class Interop - { - internal static class MediaPacket - { - [DllImport(Libraries.MediaTool, EntryPoint = "media_packet_destroy")] - internal static extern int Destroy(IntPtr handle); - } - } -} diff --git a/src/Tizen.Multimedia.MediaCodec/MediaCodec/BufferStatusChangedEventArgs.cs b/src/Tizen.Multimedia.MediaCodec/MediaCodec/BufferStatusChangedEventArgs.cs deleted file mode 100644 index d5bb05f30..000000000 --- a/src/Tizen.Multimedia.MediaCodec/MediaCodec/BufferStatusChangedEventArgs.cs +++ /dev/null @@ -1,41 +0,0 @@ -/* - * 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.Multimedia.MediaCodec -{ - /// - /// Provides data for the event. - /// - public class BufferStatusChangedEventArgs : EventArgs - { - /// - /// Initializes a new instance of the BufferStatusChangedEventArgs class. - /// - /// The value representing new status of the codec. - public BufferStatusChangedEventArgs(MediaCodecStatus status) - { - Status = status; - } - - /// - /// Gets the value indicating the new status of the codec. - /// - public MediaCodecStatus Status { get; } - - } -} diff --git a/src/Tizen.Multimedia.MediaCodec/MediaCodec/InputProcessedEventArgs.cs b/src/Tizen.Multimedia.MediaCodec/MediaCodec/InputProcessedEventArgs.cs deleted file mode 100644 index b10d0d3f8..000000000 --- a/src/Tizen.Multimedia.MediaCodec/MediaCodec/InputProcessedEventArgs.cs +++ /dev/null @@ -1,43 +0,0 @@ -/* - * 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.Diagnostics; - -namespace Tizen.Multimedia.MediaCodec -{ - /// - /// Provides data for the event. - /// - public class InputProcessedEventArgs : EventArgs - { - /// - /// Initializes a new instance of the InputProcessedEventArgs class. - /// - /// The packet that the codec has processed. - internal InputProcessedEventArgs(MediaPacket packet) - { - Debug.Assert(packet != null); - - Packet = packet; - } - - /// - /// Gets the packet processed by the codec. - /// - public MediaPacket Packet { get; } - } -} diff --git a/src/Tizen.Multimedia.MediaCodec/MediaCodec/MediaCodec.cs b/src/Tizen.Multimedia.MediaCodec/MediaCodec/MediaCodec.cs deleted file mode 100644 index b01f2452a..000000000 --- a/src/Tizen.Multimedia.MediaCodec/MediaCodec/MediaCodec.cs +++ /dev/null @@ -1,626 +0,0 @@ -/* - * 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.Collections.Generic; -using System.Diagnostics; - -namespace Tizen.Multimedia.MediaCodec -{ - /// - /// Provides the means to encode and decode the video and the audio data. - /// - public class MediaCodec : IDisposable - { - private const int CodecTypeMask = 0xFFFF; - private const int CodecKindMask = 0x3000; - // private const int CodecKindAudio = 0x1000; // Not used - private const int CodecKindVideo = 0x2000; - - private IntPtr _handle; - - /// - /// Initializes a new instance of the MediaCodec class. - /// - public MediaCodec() - { - int ret = Interop.MediaCodec.Create(out _handle); - - if (ret == (int)MediaCodecErrorCode.InvalidOperation) - { - throw new InvalidOperationException("Not able to initialize a new media codec."); - } - - MultimediaDebug.AssertNoError(ret); - - RegisterInputProcessed(); - RegisterErrorOccurred(); - } - - #region IDisposable-support - private bool _isDisposed = false; - - protected virtual void Dispose(bool disposing) - { - if (!_isDisposed) - { - if (_handle != IntPtr.Zero) - { - Interop.MediaCodec.Destroy(_handle); - _handle = IntPtr.Zero; - } - - _isDisposed = true; - } - } - - ~MediaCodec() - { - Dispose(false); - } - - public void Dispose() - { - Dispose(true); - - GC.SuppressFinalize(this); - } - #endregion - - /// - /// Validates if the object has already been disposed of. - /// - /// The current object has been disposed of. - private void ValidateNotDisposed() - { - if (_isDisposed) - { - throw new ObjectDisposedException(nameof(MediaCodec)); - } - } - - private static IEnumerable _supportedVideoCodecs; - - /// - /// Gets the audio codec list that the current device supports. - /// - public static IEnumerable SupportedVideoCodecs - { - get - { - if (_supportedVideoCodecs == null) - { - LoadSupportedCodec(); - } - - return _supportedVideoCodecs; - } - } - - private static IEnumerable _supportedAudioCodecs; - - - /// - /// Gets the audio codec list that the current device supports. - /// - public static IEnumerable SupportedAudioCodecs - { - get - { - if (_supportedAudioCodecs == null) - { - LoadSupportedCodec(); - } - - return _supportedAudioCodecs; - } - } - - private static bool TryGetMimeTypeFromCodecType(int codecType, ref T result) - { - if (codecType == -1) - { - return false; - } - - foreach (T value in Enum.GetValues(typeof(T))) - { - if ((Convert.ToInt32(value) & CodecTypeMask) == codecType) - { - result = value; - return true; - } - } - - Debug.Fail($"Unknown codec : { codecType }."); - return false; - } - - private static void LoadSupportedCodec() - { - var videoCodecList = new List(); - var audioCodecList = new List(); - - Interop.MediaCodec.SupportedCodecCallback cb = (codecType, _) => - { - if ((codecType & CodecKindMask) == CodecKindVideo) - { - MediaFormatVideoMimeType mimeType = 0; - if (TryGetMimeTypeFromCodecType(codecType, ref mimeType)) - { - videoCodecList.Add(mimeType); - } - } - else - { - MediaFormatAudioMimeType mimeType = 0; - if (TryGetMimeTypeFromCodecType(codecType, ref mimeType)) - { - audioCodecList.Add(mimeType); - } - } - - return true; - }; - - int ret = Interop.MediaCodec.ForeachSupportedCodec(cb, IntPtr.Zero); - - MultimediaDebug.AssertNoError(ret); - - _supportedVideoCodecs = videoCodecList.AsReadOnly(); - _supportedAudioCodecs = audioCodecList.AsReadOnly(); - } - - /// - /// Prepares the MediaCodec for encoding or decoding. - /// - /// - /// The codec is not configured yet.\n - /// -or-\n - /// Internal error. - /// - public void Prepare() - { - ValidateNotDisposed(); - - int ret = Interop.MediaCodec.Prepare(_handle); - - if (ret == (int)MediaCodecErrorCode.NotInitialized) - { - throw new InvalidOperationException("The codec is not configured."); - } - if (ret != (int)MediaCodecErrorCode.None) - { - throw new InvalidOperationException("Operation failed."); - } - - MultimediaDebug.AssertNoError(ret); - } - - /// - /// Unprepares the MediaCodec. - /// - public void Unprepare() - { - ValidateNotDisposed(); - - int ret = Interop.MediaCodec.Unprepare(_handle); - - MultimediaDebug.AssertNoError(ret); - } - - /// - /// Configures the MediaCodec. - /// - /// The for properties of media data to decode or encode. - /// The value indicating whether the codec works as an encoder or a decoder. - /// The value indicating whether the codec uses hardware acceleration. - /// is null. - /// - /// is invalid.\n - /// -or-\n - /// is neither audio type nor video type. - /// - /// The mime type of the format is not supported. - /// - /// - public void Configure(MediaFormat format, bool encoder, MediaCodecTypes codecType) - { - ValidateNotDisposed(); - - if (format == null) - { - throw new ArgumentNullException(nameof(format)); - } - - if (codecType != MediaCodecTypes.Hardware && codecType != MediaCodecTypes.Software) - { - throw new ArgumentException("codecType is invalid."); - } - - if (format.Type == MediaFormatType.Audio) - { - ConfigureAudio((AudioMediaFormat)format, encoder, codecType); - } - else if (format.Type == MediaFormatType.Video) - { - ConfigureVideo((VideoMediaFormat)format, encoder, codecType); - } - else - { - throw new ArgumentException("Only video and audio formats are allowed."); - } - } - - private void ConfigureAudio(AudioMediaFormat format, bool encoder, - MediaCodecTypes supportType) - { - int codecType = (int)format.MimeType & CodecTypeMask; - - if (!Enum.IsDefined(typeof(SupportedCodecType), codecType)) - { - throw new NotSupportedException("The format is not supported " + - $"mime type : { Enum.GetName(typeof(MediaFormatAudioMimeType), format.MimeType) }"); - } - - DoConfigure(codecType, encoder, supportType); - - if (encoder) - { - int ret = Interop.MediaCodec.SetAudioEncoderInfo(_handle, format.SampleRate, - format.Channel, format.Bit, format.BitRate); - - MultimediaDebug.AssertNoError(ret); - } - else - { - int ret = Interop.MediaCodec.SetAudioDecoderInfo(_handle, format.SampleRate, - format.Channel, format.Bit); - - MultimediaDebug.AssertNoError(ret); - } - } - - private void ConfigureVideo(VideoMediaFormat format, bool encoder, - MediaCodecTypes supportType) - { - int codecType = (int)format.MimeType & CodecTypeMask; - - if (!Enum.IsDefined(typeof(SupportedCodecType), codecType)) - { - throw new NotSupportedException("The format is not supported." + - $"mime type : { Enum.GetName(typeof(MediaFormatVideoMimeType), format.MimeType) }"); - } - - DoConfigure(codecType, encoder, supportType); - - if (encoder) - { - int ret = Interop.MediaCodec.SetVideoEncoderInfo(_handle, format.Size.Width, - format.Size.Height, format.FrameRate, format.BitRate / 1000); - - MultimediaDebug.AssertNoError(ret); - } - else - { - int ret = Interop.MediaCodec.SetVideoDecoderInfo(_handle, format.Size.Width, format.Size.Height); - - MultimediaDebug.AssertNoError(ret); - } - } - - private void DoConfigure(int codecType, bool encoder, MediaCodecTypes supportType) - { - Debug.Assert(Enum.IsDefined(typeof(SupportedCodecType), codecType)); - - int flags = (int)(encoder ? MediaCodecCodingType.Encoder : MediaCodecCodingType.Decoder); - - flags |= (int)supportType; - - int ret = Interop.MediaCodec.Configure(_handle, codecType, flags); - - if (ret == (int)MediaCodecErrorCode.NotSupportedOnDevice) - { - throw new NotSupportedException("The format is not supported."); - } - MultimediaDebug.AssertNoError(ret); - } - - /// - /// Adds the packet to the internal queue of the codec. - /// - /// The packet to be encoded or decoded. - /// is null. - /// The current codec is not prepared yet. - /// Any attempts to modify the packet will fail until the event for the packet is invoked. - public void ProcessInput(MediaPacket packet) - { - ValidateNotDisposed(); - - if (packet == null) - { - throw new ArgumentNullException(nameof(packet)); - } - - MediaPacket.Lock packetLock = MediaPacket.Lock.Get(packet); - - int ret = Interop.MediaCodec.Process(_handle, packetLock.GetHandle(), 0); - - if (ret == (int)MediaCodecErrorCode.InvalidState) - { - throw new InvalidOperationException("The codec is in invalid state."); - } - - MultimediaDebug.AssertNoError(ret); - } - - /// - /// Flushes both input and output buffers. - /// - public void FlushBuffers() - { - ValidateNotDisposed(); - - int ret = Interop.MediaCodec.FlushBuffers(_handle); - - MultimediaDebug.AssertNoError(ret); - } - - /// - /// Retrieves supported codec types for the specified params. - /// - /// The value indicating encoder or decoder. - /// The mime type to query. - /// The values indicating which codec types are supported on the current device. - /// is invalid. - public MediaCodecTypes GetCodecType(bool encoder, MediaFormatVideoMimeType type) - { - ValidateNotDisposed(); - - if (CheckMimeType(typeof(MediaFormatVideoMimeType), (int)type) == false) - { - return 0; - } - - return GetCodecType((int)type, encoder); - } - - /// - /// Retrieves supported codec types for the specified params. - /// - /// The value indicating encoder or decoder. - /// The mime type to query. - /// The values indicating which codec types are supported on the current device. - /// is invalid. - public MediaCodecTypes GetCodecType(bool encoder, MediaFormatAudioMimeType type) - { - ValidateNotDisposed(); - - if (CheckMimeType(typeof(MediaFormatAudioMimeType), (int)type) == false) - { - return 0; - } - - return GetCodecType((int)type, encoder); - } - - private MediaCodecTypes GetCodecType(int mimeType, bool isEncoder) - { - int codecType = mimeType & CodecTypeMask; - int value = 0; - - int ret = Interop.MediaCodec.GetSupportedType(_handle, codecType, isEncoder, out value); - - MultimediaDebug.AssertNoError(ret); - - return (MediaCodecTypes)value; - } - - private bool CheckMimeType(Type type, int value) - { - int codecType = value & CodecTypeMask; - - if (!Enum.IsDefined(type, value)) - { - throw new ArgumentException($"The mime type value is invalid : { value }."); - } - - return Enum.IsDefined(typeof(SupportedCodecType), codecType); - } - - #region OutputAvailable event - private EventHandler _outputAvailable; - private Interop.MediaCodec.OutputBufferAvailableCallback _outputBufferAvailableCb; - private object _outputAvailableLock = new object(); - - /// - /// Occurs when an output buffer is available. - /// - /// The output packet needs to be disposed after it is used to clean up unmanaged resources. - public event EventHandler OutputAvailable - { - add - { - ValidateNotDisposed(); - - lock (_outputAvailableLock) - { - if (_outputAvailable == null) - { - RegisterOutputAvailableCallback(); - } - _outputAvailable += value; - } - } - remove - { - ValidateNotDisposed(); - - lock (_outputAvailableLock) - { - _outputAvailable -= value; - if (_outputAvailable == null) - { - // We can remove handler first, because we know the method that unregisters callback does not throw. - UnregisterOutputAvailableCallback(); - } - } - } - } - - private void RegisterOutputAvailableCallback() - { - _outputBufferAvailableCb = (packetHandle, _) => - { - if (_outputAvailable == null) - { - Interop.MediaPacket.Destroy(packetHandle); - return; - } - - OutputAvailableEventArgs args = null; - try - { - args = new OutputAvailableEventArgs(packetHandle); - } - catch (Exception e) - { - Interop.MediaPacket.Destroy(packetHandle); - - MultimediaLog.Error(typeof(MediaCodec).FullName, "Failed to raise OutputAvailable event", e); - } - - if (args != null) - { - _outputAvailable?.Invoke(this, args); - } - }; - - int ret = Interop.MediaCodec.SetOutputBufferAvailableCb(_handle, _outputBufferAvailableCb); - - MultimediaDebug.AssertNoError(ret); - } - - private void UnregisterOutputAvailableCallback() - { - int ret = Interop.MediaCodec.UnsetOutputBufferAvailableCb(_handle); - - MultimediaDebug.AssertNoError(ret); - } - #endregion - - #region InputProcessed event - private Interop.MediaCodec.InputBufferUsedCallback _inputBufferUsedCb; - - /// - /// Occurs when an input packet is processed. - /// - /// - public event EventHandler InputProcessed; - - private void RegisterInputProcessed() - { - _inputBufferUsedCb = (lockedPacketHandle, _) => - { - MediaPacket packet = null; - - // Lock must be disposed here, note that the packet won't be disposed. - using (MediaPacket.Lock packetLock = - MediaPacket.Lock.FromHandle(lockedPacketHandle)) - { - Debug.Assert(packetLock != null); - - packet = packetLock.MediaPacket; - } - Debug.Assert(packet != null); - - InputProcessed?.Invoke(this, new InputProcessedEventArgs(packet)); - }; - - int ret = Interop.MediaCodec.SetInputBufferUsedCb(_handle, _inputBufferUsedCb); - - MultimediaDebug.AssertNoError(ret); - } - #endregion - - #region ErrorOccurred event - private Interop.MediaCodec.ErrorCallback _errorCb; - - /// - /// Occurs whenever an error is produced in the codec. - /// - public event EventHandler ErrorOccurred; - - private void RegisterErrorOccurred() - { - _errorCb = (errorCode, _) => - { - MediaCodecError error = (Enum.IsDefined(typeof(MediaCodecError), errorCode)) ? - (MediaCodecError)errorCode : MediaCodecError.InternalError; - - ErrorOccurred?.Invoke(this, new MediaCodecErrorOccurredEventArgs(error)); - }; - int ret = Interop.MediaCodec.SetErrorCb(_handle, _errorCb); - - MultimediaDebug.AssertNoError(ret); - } - #endregion - - #region EosReached event - private Interop.MediaCodec.EosCallback _eosCb; - - /// - /// Occurs when the codec processes all input data. - /// - public event EventHandler EosReached; - - private void RegisterEosReached() - { - _eosCb = _ => EosReached?.Invoke(this, EventArgs.Empty); - - int ret = Interop.MediaCodec.SetEosCb(_handle, _eosCb); - - MultimediaDebug.AssertNoError(ret); - } - - #endregion - - #region BufferStatusChanged event - private Interop.MediaCodec.BufferStatusCallback _bufferStatusCb; - - /// - /// Occurs when the codec needs more data or has enough data. - /// - public event EventHandler BufferStatusChanged; - - private void RegisterBufferStatusChanged() - { - _bufferStatusCb = (statusCode, _) => - { - Debug.Assert(Enum.IsDefined(typeof(MediaCodecStatus), statusCode), - $"{ statusCode } is not defined in MediaCodecStatus!"); - - BufferStatusChanged?.Invoke(this, - new BufferStatusChangedEventArgs((MediaCodecStatus)statusCode)); - }; - - int ret = Interop.MediaCodec.SetBufferStatusCb(_handle, _bufferStatusCb); - - MultimediaDebug.AssertNoError(ret); - } - #endregion - } -} diff --git a/src/Tizen.Multimedia.MediaCodec/MediaCodec/MediaCodecError.cs b/src/Tizen.Multimedia.MediaCodec/MediaCodec/MediaCodecError.cs deleted file mode 100644 index 14508f235..000000000 --- a/src/Tizen.Multimedia.MediaCodec/MediaCodec/MediaCodecError.cs +++ /dev/null @@ -1,54 +0,0 @@ -/* - * 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 Tizen.Internals.Errors; - -namespace Tizen.Multimedia.MediaCodec -{ - internal enum MediaCodecErrorCode - { - CodecDefinedBase = -0x019B0000, - - None = ErrorCode.None, - OutOfMemory = ErrorCode.OutOfMemory, - InvalidParameter = ErrorCode.InvalidParameter, - InvalidOperation = ErrorCode.InvalidParameter, - NotSupportedOnDevice = ErrorCode.NotSupported, - PermissionDenied = ErrorCode.PermissionDenied, - - InvalidState = CodecDefinedBase | 0x01, - InvalidInBuffer = CodecDefinedBase | 0x02, - InvalidOutBuffer = CodecDefinedBase | 0x03, - Internal = CodecDefinedBase | 0x04, - NotInitialized = CodecDefinedBase | 0x05, - InvalidStream = CodecDefinedBase | 0x06, - CodecNotFound = CodecDefinedBase | 0x07, - DecodingError = CodecDefinedBase | 0x08, - OutOfStorage = CodecDefinedBase | 0x09, - StreamNotFound = CodecDefinedBase | 0x0a, - NotSupportedFormat = CodecDefinedBase | 0x0b, - NoAvailableBuffer = CodecDefinedBase | 0x0c, - OverflowInBuffer = CodecDefinedBase | 0x0d, - } - - public enum MediaCodecError - { - NotSupportedFormat = MediaCodecErrorCode.NotSupportedFormat, - InternalError = MediaCodecErrorCode.Internal, - OutOfStorage = MediaCodecErrorCode.OutOfStorage, - InvalidStream = MediaCodecErrorCode.InvalidStream, - } -} diff --git a/src/Tizen.Multimedia.MediaCodec/MediaCodec/MediaCodecErrorOccurredEventArgs.cs b/src/Tizen.Multimedia.MediaCodec/MediaCodec/MediaCodecErrorOccurredEventArgs.cs deleted file mode 100644 index 0113b6a6d..000000000 --- a/src/Tizen.Multimedia.MediaCodec/MediaCodec/MediaCodecErrorOccurredEventArgs.cs +++ /dev/null @@ -1,40 +0,0 @@ -/* - * 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.Multimedia.MediaCodec -{ - /// - /// Provides data for the event. - /// - public class MediaCodecErrorOccurredEventArgs : EventArgs - { - /// - /// Initializes a new instance of the ErrorOccurredEventArgs class. - /// - /// The value representing the type of the error. - public MediaCodecErrorOccurredEventArgs(MediaCodecError error) - { - Error = error; - } - - /// - /// Gets the value indicating what kind of the error. - /// - public MediaCodecError Error { get; } - } -} diff --git a/src/Tizen.Multimedia.MediaCodec/MediaCodec/MediaCodecStatus.cs b/src/Tizen.Multimedia.MediaCodec/MediaCodec/MediaCodecStatus.cs deleted file mode 100644 index 32e453ddd..000000000 --- a/src/Tizen.Multimedia.MediaCodec/MediaCodec/MediaCodecStatus.cs +++ /dev/null @@ -1,34 +0,0 @@ -/* - * 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. - */ - -namespace Tizen.Multimedia.MediaCodec -{ - /// - /// Specifies the status of a codec. - /// - public enum MediaCodecStatus - { - /// - /// Not enough data to decode or encode. - /// - LackOfData, - - /// - /// Enough data to decode or encode. - /// - EnoughData - } -} diff --git a/src/Tizen.Multimedia.MediaCodec/MediaCodec/MediaCodecType.cs b/src/Tizen.Multimedia.MediaCodec/MediaCodec/MediaCodecType.cs deleted file mode 100644 index 2aaf82e02..000000000 --- a/src/Tizen.Multimedia.MediaCodec/MediaCodec/MediaCodecType.cs +++ /dev/null @@ -1,47 +0,0 @@ -/* - * 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.Multimedia.MediaCodec -{ - [Flags] - internal enum MediaCodecCodingType - { - Encoder = 0x1, - Decoder = 0x2 - } - - /// - /// Specifies types of codec. - /// - /// This enumeration has a attribute that allows a bitwise combination of its member values. - /// - /// - [Flags] - public enum MediaCodecTypes - { - /// - /// The hardware-accelerated codec. - /// - Hardware = 0x4, - - /// - /// The software codec. - /// - Software = 0x8 - } -} diff --git a/src/Tizen.Multimedia.MediaCodec/MediaCodec/OutputAvailableEventArgs.cs b/src/Tizen.Multimedia.MediaCodec/MediaCodec/OutputAvailableEventArgs.cs deleted file mode 100644 index 9c84828b7..000000000 --- a/src/Tizen.Multimedia.MediaCodec/MediaCodec/OutputAvailableEventArgs.cs +++ /dev/null @@ -1,37 +0,0 @@ -/* - * 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.Multimedia.MediaCodec -{ - /// - /// Provides data for the event. - /// - /// The output packet needs to be disposed after it is used to clean up unmanaged resources. - public class OutputAvailableEventArgs : EventArgs - { - internal OutputAvailableEventArgs(IntPtr packetHandle) - { - Packet = MediaPacket.From(packetHandle); - } - - /// - /// Gets the result packet. - /// - public MediaPacket Packet { get; } - } -} diff --git a/src/Tizen.Multimedia.MediaCodec/MediaCodec/SupportedCodecType.cs b/src/Tizen.Multimedia.MediaCodec/MediaCodec/SupportedCodecType.cs deleted file mode 100644 index 999808f82..000000000 --- a/src/Tizen.Multimedia.MediaCodec/MediaCodec/SupportedCodecType.cs +++ /dev/null @@ -1,52 +0,0 @@ -/* - * 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. - */ - -namespace Tizen.Multimedia.MediaCodec -{ - internal enum SupportedCodecType - { - // L16 = 0x1010, - // ALaw = 0x1020, - // ULaw = 0x1030, - Amr = 0x1040, - AmrNB = 0x1040, - AmrWb = 0x1041, - // G729 = 0x1050, - Aac = 0x1060, - AacLC = 0x1060, - AacHE = 0x1061, - AacHEPS = 0x1062, - MP3 = 0x1070, - Vorbis = 0x1080, - Flac = 0x1090, - Wma1 = 0x10A0, - Wma2 = 0x10A1, - WmaPro = 0x10A2, - WmaLossless = 0x10A3, - - H261 = 0x2010, - H263 = 0x2020, - H264 = 0x2030, - MJpeg = 0x2040, - Mpeg1 = 0x2050, - Mpeg2 = 0x2060, - Mpeg4 = 0x2070, - // Hevc = 0x2080, - // VP8 = 0x2090, - // VP9 = 0x20A0, - // VC1 = 0x20B0, - } -} diff --git a/src/Tizen.Multimedia.MediaCodec/Tizen.Multimedia.MediaCodec.csproj b/src/Tizen.Multimedia.MediaCodec/Tizen.Multimedia.MediaCodec.csproj deleted file mode 100644 index ec9bff774..000000000 --- a/src/Tizen.Multimedia.MediaCodec/Tizen.Multimedia.MediaCodec.csproj +++ /dev/null @@ -1,11 +0,0 @@ - - - - netstandard2.0 - - - - - - - \ No newline at end of file diff --git a/src/Tizen.Multimedia.MediaCodec/Tizen.Multimedia.MediaCodec.sln b/src/Tizen.Multimedia.MediaCodec/Tizen.Multimedia.MediaCodec.sln deleted file mode 100755 index 9a2a5afdc..000000000 --- a/src/Tizen.Multimedia.MediaCodec/Tizen.Multimedia.MediaCodec.sln +++ /dev/null @@ -1,72 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26730.12 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Multimedia.MediaCodec", "Tizen.Multimedia.MediaCodec.csproj", "{BA07A897-9A81-4D82-BA88-A2F7C92E4237}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Multimedia", "..\Tizen.Multimedia\Tizen.Multimedia.csproj", "{EA824FD1-5996-4C1F-8116-191BD312DCCB}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ElmSharp", "..\ElmSharp\ElmSharp.csproj", "{072466EC-5245-4DB6-9CDA-DC753FC4FA70}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen", "..\Tizen\Tizen.csproj", "{F83DB9A8-9F37-4031-BC48-813B08AEF316}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Log", "..\Tizen.Log\Tizen.Log.csproj", "{E6B5E685-4A5A-4FF2-8474-42DFB49CA663}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.System.Information", "..\Tizen.System.Information\Tizen.System.Information.csproj", "{8E0E98C3-7983-4CA8-8763-79C64464F9D0}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.NUI", "..\Tizen.NUI\Tizen.NUI.csproj", "{E70369D0-2B2B-40FA-B67E-A2EDBE6C5466}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.System.SystemSettings", "..\Tizen.System.SystemSettings\Tizen.System.SystemSettings.csproj", "{1898FC3A-7F71-427B-B382-8DD0B3017B42}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Applications.Common", "..\Tizen.Applications.Common\Tizen.Applications.Common.csproj", "{70653B3B-8178-492A-960B-AD60EF52998B}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {BA07A897-9A81-4D82-BA88-A2F7C92E4237}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {BA07A897-9A81-4D82-BA88-A2F7C92E4237}.Debug|Any CPU.Build.0 = Debug|Any CPU - {BA07A897-9A81-4D82-BA88-A2F7C92E4237}.Release|Any CPU.ActiveCfg = Release|Any CPU - {BA07A897-9A81-4D82-BA88-A2F7C92E4237}.Release|Any CPU.Build.0 = Release|Any CPU - {EA824FD1-5996-4C1F-8116-191BD312DCCB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {EA824FD1-5996-4C1F-8116-191BD312DCCB}.Debug|Any CPU.Build.0 = Debug|Any CPU - {EA824FD1-5996-4C1F-8116-191BD312DCCB}.Release|Any CPU.ActiveCfg = Release|Any CPU - {EA824FD1-5996-4C1F-8116-191BD312DCCB}.Release|Any CPU.Build.0 = Release|Any CPU - {072466EC-5245-4DB6-9CDA-DC753FC4FA70}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {072466EC-5245-4DB6-9CDA-DC753FC4FA70}.Debug|Any CPU.Build.0 = Debug|Any CPU - {072466EC-5245-4DB6-9CDA-DC753FC4FA70}.Release|Any CPU.ActiveCfg = Release|Any CPU - {072466EC-5245-4DB6-9CDA-DC753FC4FA70}.Release|Any CPU.Build.0 = Release|Any CPU - {F83DB9A8-9F37-4031-BC48-813B08AEF316}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F83DB9A8-9F37-4031-BC48-813B08AEF316}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F83DB9A8-9F37-4031-BC48-813B08AEF316}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F83DB9A8-9F37-4031-BC48-813B08AEF316}.Release|Any CPU.Build.0 = Release|Any CPU - {E6B5E685-4A5A-4FF2-8474-42DFB49CA663}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E6B5E685-4A5A-4FF2-8474-42DFB49CA663}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E6B5E685-4A5A-4FF2-8474-42DFB49CA663}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E6B5E685-4A5A-4FF2-8474-42DFB49CA663}.Release|Any CPU.Build.0 = Release|Any CPU - {8E0E98C3-7983-4CA8-8763-79C64464F9D0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {8E0E98C3-7983-4CA8-8763-79C64464F9D0}.Debug|Any CPU.Build.0 = Debug|Any CPU - {8E0E98C3-7983-4CA8-8763-79C64464F9D0}.Release|Any CPU.ActiveCfg = Release|Any CPU - {8E0E98C3-7983-4CA8-8763-79C64464F9D0}.Release|Any CPU.Build.0 = Release|Any CPU - {E70369D0-2B2B-40FA-B67E-A2EDBE6C5466}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E70369D0-2B2B-40FA-B67E-A2EDBE6C5466}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E70369D0-2B2B-40FA-B67E-A2EDBE6C5466}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E70369D0-2B2B-40FA-B67E-A2EDBE6C5466}.Release|Any CPU.Build.0 = Release|Any CPU - {1898FC3A-7F71-427B-B382-8DD0B3017B42}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1898FC3A-7F71-427B-B382-8DD0B3017B42}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1898FC3A-7F71-427B-B382-8DD0B3017B42}.Release|Any CPU.ActiveCfg = Release|Any CPU - {1898FC3A-7F71-427B-B382-8DD0B3017B42}.Release|Any CPU.Build.0 = Release|Any CPU - {70653B3B-8178-492A-960B-AD60EF52998B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {70653B3B-8178-492A-960B-AD60EF52998B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {70653B3B-8178-492A-960B-AD60EF52998B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {70653B3B-8178-492A-960B-AD60EF52998B}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {D11D1196-7C4B-4BE8-97AA-548F160F9A6F} - EndGlobalSection -EndGlobal diff --git a/src/Tizen.Multimedia.MediaPlayer/Interop/Interop.AudioEffect.cs b/src/Tizen.Multimedia.MediaPlayer/Interop/Interop.AudioEffect.cs deleted file mode 100644 index 025b60326..000000000 --- a/src/Tizen.Multimedia.MediaPlayer/Interop/Interop.AudioEffect.cs +++ /dev/null @@ -1,52 +0,0 @@ -/* - * 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; -using Tizen.Multimedia; - -internal static partial class Interop -{ - internal static partial class AudioEffect - { - [DllImport(Libraries.Player, EntryPoint = "player_audio_effect_get_equalizer_bands_count")] - internal static extern PlayerErrorCode GetEqualizerBandsCount(IntPtr player, out int count); - - [DllImport(Libraries.Player, EntryPoint = "player_audio_effect_set_equalizer_band_level")] - internal static extern PlayerErrorCode SetEqualizerBandLevel(IntPtr player, int index, int level); - - [DllImport(Libraries.Player, EntryPoint = "player_audio_effect_get_equalizer_band_level")] - internal static extern PlayerErrorCode GetEqualizerBandLevel(IntPtr player, int index, out int level); - - [DllImport(Libraries.Player, EntryPoint = "player_audio_effect_set_equalizer_all_bands")] - internal static extern PlayerErrorCode SetEqualizerAllBands(IntPtr player, out int band_levels, int length); - - [DllImport(Libraries.Player, EntryPoint = "player_audio_effect_get_equalizer_level_range")] - internal static extern PlayerErrorCode GetEqualizerLevelRange(IntPtr player, out int min, out int max); - - [DllImport(Libraries.Player, EntryPoint = "player_audio_effect_get_equalizer_band_frequency")] - internal static extern PlayerErrorCode GetEqualizerBandFrequency(IntPtr player, int index, out int frequency); - - [DllImport(Libraries.Player, EntryPoint = "player_audio_effect_get_equalizer_band_frequency_range")] - internal static extern PlayerErrorCode GetEqualizerBandFrequencyRange(IntPtr player, int index, out int range); - - [DllImport(Libraries.Player, EntryPoint = "player_audio_effect_equalizer_clear")] - internal static extern PlayerErrorCode EqualizerClear(IntPtr player); - - [DllImport(Libraries.Player, EntryPoint = "player_audio_effect_equalizer_is_available")] - internal static extern PlayerErrorCode EqualizerIsAvailable(IntPtr player, out bool available); - } -} diff --git a/src/Tizen.Multimedia.MediaPlayer/Interop/Interop.Display.cs b/src/Tizen.Multimedia.MediaPlayer/Interop/Interop.Display.cs deleted file mode 100644 index 6c4acc49d..000000000 --- a/src/Tizen.Multimedia.MediaPlayer/Interop/Interop.Display.cs +++ /dev/null @@ -1,54 +0,0 @@ -/* - * 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; -using Tizen.Multimedia; - -internal static partial class Interop -{ - internal static partial class Display - { - [DllImport(Libraries.Player, EntryPoint = "player_set_display_mode")] - internal static extern PlayerErrorCode SetMode(IntPtr player, PlayerDisplayMode mode); - - [DllImport(Libraries.Player, EntryPoint = "player_get_display_mode")] - internal static extern PlayerErrorCode GetMode(IntPtr player, out PlayerDisplayMode mode); - - [DllImport(Libraries.Player, EntryPoint = "player_set_display_visible")] - internal static extern PlayerErrorCode SetVisible(IntPtr player, bool visible); - - [DllImport(Libraries.Player, EntryPoint = "player_is_display_visible")] - internal static extern PlayerErrorCode IsVisible(IntPtr player, out bool visible); - - [DllImport(Libraries.Player, EntryPoint = "player_set_display_rotation")] - internal static extern PlayerErrorCode SetRotation(IntPtr player, Rotation rotation); - - [DllImport(Libraries.Player, EntryPoint = "player_get_display_rotation")] - internal static extern PlayerErrorCode GetRotation(IntPtr player, out Rotation rotation); - - [DllImport(Libraries.Player, EntryPoint = "player_set_display_roi_area")] - internal static extern PlayerErrorCode SetRoi(IntPtr player, int x, int y, int width, int height); - - [DllImport(Libraries.Player, EntryPoint = "player_set_display")] - internal static extern PlayerErrorCode SetDisplay(IntPtr player, PlayerDisplayType type, IntPtr display); - - [DllImport(Libraries.Player, EntryPoint = "player_set_ecore_wl_display")] - internal static extern PlayerErrorCode SetEcoreDisplay(IntPtr player, PlayerDisplayType type, IntPtr - ecoreWindow, int x = 0, int y = 0, int width = 1920, int height = 1080); - - } -} diff --git a/src/Tizen.Multimedia.MediaPlayer/Interop/Interop.Libraries.cs b/src/Tizen.Multimedia.MediaPlayer/Interop/Interop.Libraries.cs deleted file mode 100644 index 1fd87840e..000000000 --- a/src/Tizen.Multimedia.MediaPlayer/Interop/Interop.Libraries.cs +++ /dev/null @@ -1,24 +0,0 @@ -/* - * 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 Player = "libcapi-media-player.so.0"; - } -} - diff --git a/src/Tizen.Multimedia.MediaPlayer/Interop/Interop.Player.cs b/src/Tizen.Multimedia.MediaPlayer/Interop/Interop.Player.cs deleted file mode 100644 index d95e8d5dc..000000000 --- a/src/Tizen.Multimedia.MediaPlayer/Interop/Interop.Player.cs +++ /dev/null @@ -1,284 +0,0 @@ -/* - * 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; -using Tizen; -using Tizen.Multimedia; - -internal static partial class Interop -{ - internal static partial class NativePlayer - { - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void PlaybackCompletedCallback(IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void PlaybackInterruptedCallback(PlaybackInterruptionReason code, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void PlaybackErrorCallback(int code, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void VideoFrameDecodedCallback(IntPtr packetHandle, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void SubtitleUpdatedCallback(uint duration, string text, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void BufferingProgressCallback(int percent, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void VideoStreamChangedCallback(int width, int height, int fps, int bitrate, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void MediaStreamBufferStatusCallback(MediaStreamBufferStatus status, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void MediaStreamSeekCallback(ulong offset, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void VideoCaptureCallback(IntPtr data, int width, int height, uint size, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void PrepareCallback(IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void SeekCompletedCallback(IntPtr userData); - - [DllImport(Libraries.Player, EntryPoint = "player_create")] - internal static extern PlayerErrorCode Create(out PlayerHandle player); - - [DllImport(Libraries.Player, EntryPoint = "player_destroy")] - internal static extern PlayerErrorCode Destroy(IntPtr player); - - [DllImport(Libraries.Player, EntryPoint = "player_prepare")] - internal static extern PlayerErrorCode Prepare(IntPtr player); - - [DllImport(Libraries.Player, EntryPoint = "player_unprepare")] - internal static extern PlayerErrorCode Unprepare(IntPtr player); - - [DllImport(Libraries.Player, EntryPoint = "player_set_uri")] - internal static extern PlayerErrorCode SetUri(IntPtr player, string uri); - - [DllImport(Libraries.Player, EntryPoint = "player_start")] - internal static extern PlayerErrorCode Start(IntPtr player); - - [DllImport(Libraries.Player, EntryPoint = "player_stop")] - internal static extern PlayerErrorCode Stop(IntPtr player); - - [DllImport(Libraries.Player, EntryPoint = "player_pause")] - internal static extern PlayerErrorCode Pause(IntPtr player); - - [DllImport(Libraries.Player, EntryPoint = "player_set_memory_buffer")] - internal static extern PlayerErrorCode SetMemoryBuffer(IntPtr player, byte[] data, int size); - - [DllImport(Libraries.Player, EntryPoint = "player_get_state")] - internal static extern PlayerErrorCode GetState(IntPtr player, out int state); - - [DllImport(Libraries.Player, EntryPoint = "player_set_volume")] - internal static extern PlayerErrorCode SetVolume(IntPtr player, float left, float right); - - [DllImport(Libraries.Player, EntryPoint = "player_get_volume")] - internal static extern PlayerErrorCode GetVolume(IntPtr player, out float left, out float right); - - [DllImport(Libraries.Player, EntryPoint = "player_set_sound_stream_info")] - internal static extern PlayerErrorCode SetAudioPolicyInfo(IntPtr player, AudioStreamPolicyHandle streamInfo); - - [DllImport(Libraries.Player, EntryPoint = "player_set_audio_latency_mode")] - internal static extern PlayerErrorCode SetAudioLatencyMode(IntPtr player, AudioLatencyMode latencyMode); - - [DllImport(Libraries.Player, EntryPoint = "player_get_audio_latency_mode")] - internal static extern PlayerErrorCode GetAudioLatencyMode(IntPtr player, out AudioLatencyMode latencyMode); - - [DllImport(Libraries.Player, EntryPoint = "player_get_play_position")] - internal static extern PlayerErrorCode GetPlayPosition(IntPtr player, out int millisecond); - - [DllImport(Libraries.Player, EntryPoint = "player_set_play_position")] - internal static extern PlayerErrorCode SetPlayPosition(IntPtr player, int millisecond, - bool accurate, SeekCompletedCallback cb, IntPtr userData = default(IntPtr)); - - [DllImport(Libraries.Player, EntryPoint = "player_set_mute")] - internal static extern PlayerErrorCode SetMute(IntPtr player, bool muted); - - [DllImport(Libraries.Player, EntryPoint = "player_is_muted")] - internal static extern PlayerErrorCode IsMuted(IntPtr player, out bool muted); - - [DllImport(Libraries.Player, EntryPoint = "player_set_looping")] - internal static extern PlayerErrorCode SetLooping(IntPtr player, bool looping); - - [DllImport(Libraries.Player, EntryPoint = "player_is_looping")] - internal static extern PlayerErrorCode IsLooping(IntPtr player, out bool looping); - - [DllImport(Libraries.Player, EntryPoint = "player_set_completed_cb")] - internal static extern PlayerErrorCode SetCompletedCb(IntPtr player, - PlaybackCompletedCallback callback, IntPtr userData = default(IntPtr)); - - [DllImport(Libraries.Player, EntryPoint = "player_unset_completed_cb")] - internal static extern PlayerErrorCode UnsetCompletedCb(IntPtr player); - - [DllImport(Libraries.Player, EntryPoint = "player_set_interrupted_cb")] - internal static extern PlayerErrorCode SetInterruptedCb(IntPtr player, - PlaybackInterruptedCallback callback, IntPtr userData = default(IntPtr)); - - [DllImport(Libraries.Player, EntryPoint = "player_unset_interrupted_cb")] - internal static extern PlayerErrorCode UnsetInterruptedCb(IntPtr player); - - [DllImport(Libraries.Player, EntryPoint = "player_set_error_cb")] - internal static extern PlayerErrorCode SetErrorCb(IntPtr player, PlaybackErrorCallback callback, - IntPtr userData = default(IntPtr)); - - [DllImport(Libraries.Player, EntryPoint = "player_unset_error_cb")] - internal static extern PlayerErrorCode UnsetErrorCb(IntPtr player); - - [DllImport(Libraries.Player, EntryPoint = "player_capture_video")] - internal static extern PlayerErrorCode CaptureVideo(IntPtr player, VideoCaptureCallback callback, - IntPtr userData = default(IntPtr)); - - [DllImport(Libraries.Player, EntryPoint = "player_set_media_packet_video_frame_decoded_cb")] - internal static extern PlayerErrorCode SetVideoFrameDecodedCb(IntPtr player, VideoFrameDecodedCallback callback, - IntPtr userData = default(IntPtr)); - - [DllImport(Libraries.Player, EntryPoint = "player_unset_media_packet_video_frame_decoded_cb")] - internal static extern PlayerErrorCode UnsetVideoFrameDecodedCb(IntPtr player); - - [DllImport(Libraries.Player, EntryPoint = "player_set_streaming_cookie")] - internal static extern PlayerErrorCode SetStreamingCookie(IntPtr player, string cookie, int size); - - [DllImport(Libraries.Player, EntryPoint = "player_set_streaming_user_agent")] - internal static extern PlayerErrorCode SetStreamingUserAgent(IntPtr player, string userAgent, int size); - - [DllImport(Libraries.Player, EntryPoint = "player_get_streaming_download_progress")] - internal static extern PlayerErrorCode GetStreamingDownloadProgress(IntPtr player, out int start, out int current); - - [DllImport(Libraries.Player, EntryPoint = "player_set_buffering_cb")] - internal static extern PlayerErrorCode SetBufferingCb(IntPtr player, - BufferingProgressCallback callback, IntPtr userData = default(IntPtr)); - - [DllImport(Libraries.Player, EntryPoint = "player_unset_buffering_cb")] - internal static extern PlayerErrorCode UnsetBufferingCb(IntPtr player); - - [DllImport(Libraries.Player, EntryPoint = "player_set_playback_rate")] - internal static extern PlayerErrorCode SetPlaybackRate(IntPtr player, float rate); - - [DllImport(Libraries.Player, EntryPoint = "player_push_media_stream")] - internal static extern PlayerErrorCode PushMediaStream(IntPtr player, IntPtr packet); - - [DllImport(Libraries.Player, EntryPoint = "player_set_media_stream_info")] - internal static extern PlayerErrorCode SetMediaStreamInfo(IntPtr player, int type, IntPtr format); - - [DllImport(Libraries.Player, EntryPoint = "player_set_media_stream_buffer_status_cb")] - internal static extern PlayerErrorCode SetMediaStreamBufferStatusCb(IntPtr player, StreamType type, - MediaStreamBufferStatusCallback callback, IntPtr userData = default(IntPtr)); - - [DllImport(Libraries.Player, EntryPoint = "player_unset_media_stream_buffer_status_cb")] - internal static extern PlayerErrorCode UnsetMediaStreamBufferStatusCb(IntPtr player, int type); - - [DllImport(Libraries.Player, EntryPoint = "player_set_media_stream_seek_cb")] - internal static extern PlayerErrorCode SetMediaStreamSeekCb(IntPtr player, StreamType type, - MediaStreamSeekCallback callback, IntPtr userData = default(IntPtr)); - - [DllImport(Libraries.Player, EntryPoint = "player_unset_media_stream_seek_cb")] - internal static extern PlayerErrorCode UnsetMediaStreamSeekCb(IntPtr player, int type); - - [DllImport(Libraries.Player, EntryPoint = "player_set_media_stream_buffer_max_size")] - internal static extern PlayerErrorCode SetMediaStreamBufferMaxSize(IntPtr player, StreamType type, ulong maxSize); - - [DllImport(Libraries.Player, EntryPoint = "player_get_media_stream_buffer_max_size")] - internal static extern PlayerErrorCode GetMediaStreamBufferMaxSize(IntPtr player, StreamType type, out ulong maxSize); - - [DllImport(Libraries.Player, EntryPoint = "player_set_media_stream_buffer_min_threshold")] - internal static extern PlayerErrorCode SetMediaStreamBufferMinThreshold(IntPtr player, StreamType type, uint percent); - - [DllImport(Libraries.Player, EntryPoint = "player_get_media_stream_buffer_min_threshold")] - internal static extern PlayerErrorCode GetMediaStreamBufferMinThreshold(IntPtr player, int type, out uint percent); - - [DllImport(Libraries.Player, EntryPoint = "player_get_content_info")] - internal static extern PlayerErrorCode GetContentInfo(IntPtr player, StreamMetadataKey key, out IntPtr value); - - [DllImport(Libraries.Player, EntryPoint = "player_get_codec_info")] - internal static extern PlayerErrorCode GetCodecInfo(IntPtr player, out IntPtr audioCodec, out IntPtr videoCodec); - - [DllImport(Libraries.Player, EntryPoint = "player_get_audio_stream_info")] - internal static extern PlayerErrorCode GetAudioStreamInfo(IntPtr player, out int sampleRate, out int channel, out int bitRate); - - [DllImport(Libraries.Player, EntryPoint = "player_get_video_stream_info")] - internal static extern PlayerErrorCode GetVideoStreamInfo(IntPtr player, out int fps, out int bitRate); - - [DllImport(Libraries.Player, EntryPoint = "player_get_album_art")] - internal static extern PlayerErrorCode GetAlbumArt(IntPtr player, out IntPtr albumArt, out int size); - - [DllImport(Libraries.Player, EntryPoint = "player_get_video_size")] - internal static extern PlayerErrorCode GetVideoSize(IntPtr player, out int width, out int height); - - [DllImport(Libraries.Player, EntryPoint = "player_get_duration")] - internal static extern PlayerErrorCode GetDuration(IntPtr player, out int duration); - - [DllImport(Libraries.Player, EntryPoint = "player_set_subtitle_path")] - internal static extern PlayerErrorCode SetSubtitlePath(IntPtr player, string path); - - [DllImport(Libraries.Player, EntryPoint = "player_set_subtitle_updated_cb")] - internal static extern PlayerErrorCode SetSubtitleUpdatedCb(IntPtr player, - SubtitleUpdatedCallback callback, IntPtr userData = default(IntPtr)); - - [DllImport(Libraries.Player, EntryPoint = "player_unset_subtitle_updated_cb")] - internal static extern PlayerErrorCode UnsetSubtitleUpdatedCb(IntPtr player); - - [DllImport(Libraries.Player, EntryPoint = "player_set_subtitle_position_offset")] - internal static extern PlayerErrorCode SetSubtitlePositionOffset(IntPtr player, int millisecond); - - [DllImport(Libraries.Player, EntryPoint = "player_set_video_stream_changed_cb")] - internal static extern PlayerErrorCode SetVideoStreamChangedCb(IntPtr player, - VideoStreamChangedCallback callback, IntPtr userData = default(IntPtr)); - - [DllImport(Libraries.Player, EntryPoint = "player_unset_video_stream_changed_cb")] - internal static extern PlayerErrorCode UnsetVideoStreamChangedCb(IntPtr player); - - [DllImport(Libraries.Player, EntryPoint = "player_get_track_count")] - internal static extern PlayerErrorCode GetTrackCount(IntPtr player, int type, out int count); - - [DllImport(Libraries.Player, EntryPoint = "player_select_track")] - internal static extern PlayerErrorCode SelectTrack(IntPtr player, int type, int index); - - [DllImport(Libraries.Player, EntryPoint = "player_get_current_track")] - internal static extern PlayerErrorCode GetCurrentTrack(IntPtr player, int type, out int index); - - [DllImport(Libraries.Player, EntryPoint = "player_get_track_language_code")] - internal static extern PlayerErrorCode GetTrackLanguageCode(IntPtr player, int type, int index, out IntPtr code); - } - - internal class PlayerHandle : SafeHandle - { - protected PlayerHandle() : base(IntPtr.Zero, true) - { - } - - public override bool IsInvalid => handle == IntPtr.Zero; - - protected override bool ReleaseHandle() - { - var ret = NativePlayer.Destroy(handle); - if (ret != PlayerErrorCode.None) - { - Log.Debug(GetType().FullName, $"Failed to release native {GetType().Name}"); - return false; - } - - return true; - } - } -} diff --git a/src/Tizen.Multimedia.MediaPlayer/Player/AudioEffect.cs b/src/Tizen.Multimedia.MediaPlayer/Player/AudioEffect.cs deleted file mode 100644 index f47e3b234..000000000 --- a/src/Tizen.Multimedia.MediaPlayer/Player/AudioEffect.cs +++ /dev/null @@ -1,123 +0,0 @@ -/* - * 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 Native = Interop.AudioEffect; - -namespace Tizen.Multimedia -{ - /// - /// Provides the ability to control the audio effects for . - /// - public class AudioEffect - { - private readonly EqualizerBand[] _bands; - - internal AudioEffect(Player owner) - { - Player = owner; - - bool available = false; - - Native.EqualizerIsAvailable(Player.Handle, out available). - ThrowIfFailed("Failed to initialize the AudioEffect"); - - IsAvailable = available; - - if (IsAvailable == false) - { - return; - } - - int count = 0; - Native.GetEqualizerBandsCount(Player.Handle, out count). - ThrowIfFailed("Failed to initialize the AudioEffect"); - - int min = 0; - int max = 0; - Native.GetEqualizerLevelRange(Player.Handle, out min, out max). - ThrowIfFailed("Failed to initialize the AudioEffect"); - - Count = count; - BandLevelRange = new Range(min, max); - - _bands = new EqualizerBand[count]; - } - - /// - /// Gets a at the specified index. - /// - /// The index of the band to get. - /// The has already been disposed of. - /// - /// is less than zero.\n - /// -or-\n - /// is equal to or greater than . - /// - public EqualizerBand this[int index] - { - get - { - Player.ValidateNotDisposed(); - - if (index < 0 || Count <= index) - { - throw new ArgumentOutOfRangeException(nameof(index), index, - $"Valid index is 0 <= x < { nameof(Count) } "); - } - - if (_bands[index] == null) - { - _bands[index] = new EqualizerBand(this, index); - } - Log.Info(PlayerLog.Tag, "get equalizer band : " + _bands[index]); - return _bands[index]; - } - } - - /// - /// Clears the equalizer effect. - /// - /// The has already been disposed of. - public void Clear() - { - Player.ValidateNotDisposed(); - - Native.EqualizerClear(Player.Handle). - ThrowIfFailed("Failed to clear equalizer effect"); - } - - /// - /// Gets the number of items. - /// - public int Count { get; } - - /// - /// Gets the band level range of the bands in the dB. - /// - public Range BandLevelRange { get; } - - /// - /// Gets the value whether the AudioEffect is available or not. - /// - public bool IsAvailable { get; } - - /// - /// Gets the player that this AudioEffect belongs to. - /// - public Player Player { get; } - } -} diff --git a/src/Tizen.Multimedia.MediaPlayer/Player/BufferingProgressChangedEventArgs.cs b/src/Tizen.Multimedia.MediaPlayer/Player/BufferingProgressChangedEventArgs.cs deleted file mode 100644 index 959ec9e36..000000000 --- a/src/Tizen.Multimedia.MediaPlayer/Player/BufferingProgressChangedEventArgs.cs +++ /dev/null @@ -1,49 +0,0 @@ -/* - * 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.Multimedia -{ - /// - /// Provides data for the event. - /// - public class BufferingProgressChangedEventArgs : EventArgs - { - /// - /// Initializes a new instance of the BufferingProgressChangedEventArgs class. - /// - /// The value indicating the buffering percentage. - public BufferingProgressChangedEventArgs(int percent) - { - Percent = percent; - } - - /// - /// Gets the value indicating the buffering percentage. - /// - /// The percentage of the buffering. - public int Percent { get; } - - /// - /// Returns a string that represents the current object. - /// - /// A string that represents the current object. - public override string ToString() - { - return $"Percent={ Percent.ToString() }"; - } - } -} diff --git a/src/Tizen.Multimedia.MediaPlayer/Player/CapturedFrame.cs b/src/Tizen.Multimedia.MediaPlayer/Player/CapturedFrame.cs deleted file mode 100644 index 1bd3cac58..000000000 --- a/src/Tizen.Multimedia.MediaPlayer/Player/CapturedFrame.cs +++ /dev/null @@ -1,47 +0,0 @@ -/* - * 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.Diagnostics; - -namespace Tizen.Multimedia -{ - /// - /// Represents data for a video frame captured. - /// - public class CapturedFrame - { - internal CapturedFrame(byte[] imageBuffer, int width, int height) - { - Debug.Assert(imageBuffer != null, "imageBuffer is null!"); - Debug.Assert(width > 0, $"Width is invalid : {width}!"); - Debug.Assert(height > 0, $"height is invalid : {height}!"); - - Buffer = imageBuffer; - Size = new Size(width, height); - Log.Debug(PlayerLog.Tag, "width : " + width + ", height : " + height); - } - - /// - /// Gets the raw buffer of the captured image. - /// - /// The color space format is RGB888. - public byte[] Buffer { get; } - - /// - /// Gets the size. - /// - public Size Size { get; } - } -} diff --git a/src/Tizen.Multimedia.MediaPlayer/Player/DownloadProgress.cs b/src/Tizen.Multimedia.MediaPlayer/Player/DownloadProgress.cs deleted file mode 100644 index bb5b7a9fd..000000000 --- a/src/Tizen.Multimedia.MediaPlayer/Player/DownloadProgress.cs +++ /dev/null @@ -1,66 +0,0 @@ -/* - * 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. - */ - -namespace Tizen.Multimedia -{ - - /// - /// Represents data for a downloading status. - /// - public struct DownloadProgress - { - /// - /// Initializes a new instance of the DownloadProgress struct. - /// - /// The position that downloading started in percentage. - /// The position indicating the current downloading progress in percentage. - public DownloadProgress(int start, int current) - { - Start = start; - Current = current; - Log.Debug(PlayerLog.Tag, "start : " + start + ", current : " + current); - } - - /// - /// Gets or sets the start position. - /// - /// The position that downloading started in percentage. - public int Start - { - get; - set; - } - - /// - /// Gets or sets the current position. - /// - /// The position indicating the current downloading progress in percentage. - public int Current - { - get; - set; - } - - /// - /// Returns a string that represents the current object. - /// - /// A string that represents the current object. - public override string ToString() - { - return $"Start={ Start.ToString() }, Current={ Current.ToString() }"; - } - } -} diff --git a/src/Tizen.Multimedia.MediaPlayer/Player/EqualizerBand.cs b/src/Tizen.Multimedia.MediaPlayer/Player/EqualizerBand.cs deleted file mode 100644 index 199fbd1ea..000000000 --- a/src/Tizen.Multimedia.MediaPlayer/Player/EqualizerBand.cs +++ /dev/null @@ -1,102 +0,0 @@ -/* - * 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.Diagnostics; -using Native = Interop.AudioEffect; - -namespace Tizen.Multimedia -{ - - /// - /// Represents an equalizer band of . - /// - public class EqualizerBand - { - private readonly AudioEffect _owner; - private readonly int _index; - - internal EqualizerBand(AudioEffect owner, int index) - { - Debug.Assert(owner != null); - - _owner = owner; - _index = index; - - int frequency = 0; - int range = 0; - - Native.GetEqualizerBandFrequency(_owner.Player.Handle, _index, out frequency). - ThrowIfFailed("Failed to initialize equalizer band"); - - Native.GetEqualizerBandFrequencyRange(_owner.Player.Handle, _index, out range). - ThrowIfFailed("Failed to initialize equalizer band"); - - Frequency = frequency; - FrequencyRange = range; - Log.Debug(PlayerLog.Tag, "frequency : " + frequency + ", range : " + range); - } - - /// - /// Sets or gets the gain for the equalizer band. - /// - /// The value indicating new gain in decibel(dB). - /// The player that this EqualizerBand belongs to has already been disposed of. - /// - /// is not inside of . - /// - public int Level - { - get - { - _owner.Player.ValidateNotDisposed(); - - int value = 0; - Native.GetEqualizerBandLevel(_owner.Player.Handle, _index, out value). - ThrowIfFailed("Failed to get the level of the equalizer band"); - Log.Info(PlayerLog.Tag, "get level : " + value); - return value; - } - set - { - _owner.Player.ValidateNotDisposed(); - - if (value < _owner.BandLevelRange.Min || _owner.BandLevelRange.Max < value) - { - Log.Error(PlayerLog.Tag, "invalid level : " + value); - throw new ArgumentOutOfRangeException(nameof(value), value, - $"valid value range is { nameof(AudioEffect.BandLevelRange) }." + - $"but got {value}."); - } - - Native.SetEqualizerBandLevel(_owner.Player.Handle, _index, value). - ThrowIfFailed("Failed to set the level of the equalizer band"); - } - } - - - /// - /// Gets the frequency in the dB. - /// - public int Frequency { get; } - - /// - /// Gets the frequency range in the dB. - /// - public int FrequencyRange { get; } - - } -} diff --git a/src/Tizen.Multimedia.MediaPlayer/Player/MediaBufferSource.cs b/src/Tizen.Multimedia.MediaPlayer/Player/MediaBufferSource.cs deleted file mode 100644 index 2785aefc9..000000000 --- a/src/Tizen.Multimedia.MediaPlayer/Player/MediaBufferSource.cs +++ /dev/null @@ -1,141 +0,0 @@ -/* - * 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 static Interop; - -namespace Tizen.Multimedia -{ - /// - /// Represents a media source using memory. - /// - /// - /// The buffer has to be filled with appropriate data which means it must be well-formatted. - /// If you provide invalid data, you won't receive an error until is called. - /// - /// - public sealed class MediaBufferSource : MediaSource - { - private byte[] _buffer; - - /// - /// Initializes a new instance of the MediaBufferSource class with an allocated buffer. - /// - /// The value indicating the size of the buffer. - /// - /// is zero.\n - /// -or-\n - /// is less than zero. - /// - public MediaBufferSource(int length) - { - if (length <= 0) - { - Log.Error(PlayerLog.Tag, "invalid length : " + length); - throw new ArgumentOutOfRangeException(nameof(length), length, - "length can't be equal to or less than zero."); - } - _buffer = new byte[length]; - } - - /// - /// Initializes a new instance of the MediaBufferSource class from the buffer. - /// - /// The source array to be copied into the buffer. - /// is null. - public MediaBufferSource(byte[] buffer) : this(buffer, buffer == null ? 0 : buffer.Length) - { - } - - //TODO remove default parameter. - /// - /// Initializes a new instance of the MediaBufferSource class from the buffer - /// with the specified length and the specified offset. - /// - /// The source array to be copied into the buffer. - /// The value indicating the number of bytes to copy from the buffer. - /// The value indicating the offset in the buffer of the first byte to copy. - /// is null. - /// - /// is less than zero.\n - /// -or-\n - /// is equal to or less than zero.\n - /// -or-\n - /// + is greater than buffer.Length. - /// - public MediaBufferSource(byte[] buffer, int length, int offset = 0) - { - if (buffer == null) - { - Log.Error(PlayerLog.Tag, "invalid buffer"); - throw new ArgumentNullException(nameof(buffer)); - } - if (offset < 0) - { - Log.Error(PlayerLog.Tag, "invalid offset : " + offset); - throw new ArgumentOutOfRangeException(nameof(offset), offset, "offset can't be less than zero."); - } - if (length <= 0) - { - Log.Error(PlayerLog.Tag, "invalid length : " + length); - throw new ArgumentOutOfRangeException(nameof(length), length, "length can't be equal to or less than zero."); - } - if (length + offset > buffer.Length) - { - Log.Error(PlayerLog.Tag, "invalid total length : " + (int)(length + offset)); - throw new ArgumentOutOfRangeException($"length + offset can't be greater than the length of the { nameof(buffer) }."); - } - - _buffer = new byte[length]; - - Array.Copy(buffer, offset, _buffer, 0, length); - } - - private MediaBufferSource() - { - } - - /// - /// Creates a MediaBufferSource that wraps a byte array. - /// - /// The array to be wrapped. - /// A MediaBufferSource wrapping the byte array. - public static MediaBufferSource Wrap(byte[] buffer) - { - if (buffer == null) - { - Log.Error(PlayerLog.Tag, "invalid buffer"); - throw new ArgumentNullException(nameof(buffer)); - } - - MediaBufferSource source = new MediaBufferSource(); - source._buffer = buffer; - return source; - } - - /// - /// Gets the byte array of this buffer. - /// - public byte[] Buffer => _buffer; - - internal override void OnAttached(Player player) - { - NativePlayer.SetMemoryBuffer(player.Handle, _buffer, _buffer.Length). - ThrowIfFailed("Failed to set the memory buffer"); - } - } -} - diff --git a/src/Tizen.Multimedia.MediaPlayer/Player/MediaSource.cs b/src/Tizen.Multimedia.MediaPlayer/Player/MediaSource.cs deleted file mode 100644 index 8d980ce97..000000000 --- a/src/Tizen.Multimedia.MediaPlayer/Player/MediaSource.cs +++ /dev/null @@ -1,45 +0,0 @@ -/* - * 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. - */ - -namespace Tizen.Multimedia -{ - /// - /// MediaSource is a base class for sources. - /// - public abstract class MediaSource - { - internal MediaSource() - { - } - - internal void AttachTo(Player player) - { - OnAttached(player); - } - - internal void DetachFrom(Player player) - { - OnDetached(player); - } - - internal abstract void OnAttached(Player player); - - internal virtual void OnDetached(Player player) - { - } - } -} - diff --git a/src/Tizen.Multimedia.MediaPlayer/Player/MediaStreamBufferStatusChangedEventArgs.cs b/src/Tizen.Multimedia.MediaPlayer/Player/MediaStreamBufferStatusChangedEventArgs.cs deleted file mode 100644 index be0441144..000000000 --- a/src/Tizen.Multimedia.MediaPlayer/Player/MediaStreamBufferStatusChangedEventArgs.cs +++ /dev/null @@ -1,50 +0,0 @@ -/* - * 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.Multimedia -{ - - /// - /// Provides data for the event. - /// - public class MediaStreamBufferStatusChangedEventArgs : EventArgs - { - /// - /// Initializes a new instance of the MediaStreamBufferStatusChangedEventArgs class. - /// - /// The value indicating the status of the stream. - public MediaStreamBufferStatusChangedEventArgs(MediaStreamBufferStatus status) - { - Status = status; - } - - /// - /// Gets the status. - /// - public MediaStreamBufferStatus Status { get; } - - /// - /// Returns a string that represents the current object. - /// - /// A string that represents the current object. - public override string ToString() - { - return $"Status : { Status.ToString() }"; - } - } -} diff --git a/src/Tizen.Multimedia.MediaPlayer/Player/MediaStreamConfiguration.cs b/src/Tizen.Multimedia.MediaPlayer/Player/MediaStreamConfiguration.cs deleted file mode 100644 index c0a6319d3..000000000 --- a/src/Tizen.Multimedia.MediaPlayer/Player/MediaStreamConfiguration.cs +++ /dev/null @@ -1,173 +0,0 @@ -/* - * 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.Diagnostics; -using static Interop; - -namespace Tizen.Multimedia -{ - /// - /// Provides a means to configure properties and handle events for . - /// - /// - public class MediaStreamConfiguration - { - private const ulong DefaultBufferMaxSize = 200000; - private const uint DefaultBufferMinThreshold = 0; - - private readonly MediaStreamSource _owner; - private readonly StreamType _streamType; - - private ulong _bufferMaxSize = DefaultBufferMaxSize; - private uint _threshold = DefaultBufferMinThreshold; - - internal MediaStreamConfiguration(MediaStreamSource owner, StreamType streamType) - { - _owner = owner; - _streamType = streamType; - } - - /// - /// Occurs when the buffer underruns or overflows. - /// - /// The event handler will be executed on an internal thread. - /// - /// - public event EventHandler BufferStatusChanged; - - /// - /// Occurs when the seeking is requested. - /// - /// The event handler will be executed on an internal thread. - public event EventHandler SeekingOccurred; - - /// - /// Gets the max size of the buffer. - /// - /// The max size of the buffer. The default is 200000. - /// If the buffer level overflows the max size, will be raised with . - /// The is not assigned to a player. - /// is zero. - /// - public ulong BufferMaxSize - { - get - { - return _bufferMaxSize; - } - set - { - if (_owner.Player == null) - { - throw new InvalidOperationException("The source is not assigned to a player yet."); - } - - Debug.Assert(_owner.Player.IsDisposed == false); - - if (value == 0UL) - { - throw new ArgumentOutOfRangeException(nameof(value), value, "the buffer max size can't be zero."); - } - - NativePlayer.SetMediaStreamBufferMaxSize(_owner.Player.Handle, _streamType, value). - ThrowIfFailed("Failed to set the buffer max size"); - - _bufferMaxSize = value; - } - } - - /// - /// Gets the minimum threshold of the buffer, or zero if the is not assigned to a player. - /// - /// The minimum threshold of the buffer in percentage. The default is zero. - /// If the buffer level drops below the threshold value, will be raised with . - /// The is not assigned to a player. - /// is greater than 100. - /// - public uint BufferMinThreshold - { - get - { - return _threshold; - } - set - { - if (_owner.Player == null) - { - throw new InvalidOperationException("The source is not assigned to a player yet."); - } - - Debug.Assert(_owner.Player.IsDisposed == false); - - if (100 < value) - { - throw new ArgumentOutOfRangeException(nameof(value), value, - $"The threshold can't be greater than 100, but got { value }."); - } - - NativePlayer.SetMediaStreamBufferMinThreshold(_owner.Player.Handle, _streamType, value). - ThrowIfFailed("Failed to set the buffer minimum threshold"); - - _threshold = value; - } - } - - internal void OnPlayerSet(Player player) - { - if (_streamType == StreamType.Audio) - { - player.MediaStreamAudioSeekingOccurred += MediaStreamSeekingOccurred; - player.MediaStreamAudioBufferStatusChanged += MediaStreamBufferStatusChanged; - } - else - { - player.MediaStreamVideoSeekingOccurred += MediaStreamSeekingOccurred; - player.MediaStreamVideoBufferStatusChanged += MediaStreamBufferStatusChanged; - } - - NativePlayer.SetMediaStreamBufferMaxSize(player.Handle, _streamType, _bufferMaxSize). - ThrowIfFailed("Failed to initialize the media stream configuration"); - - NativePlayer.SetMediaStreamBufferMinThreshold(player.Handle, _streamType, _threshold). - ThrowIfFailed("Failed to initialize the media stream configuration"); - } - - internal void OnPlayerUnset(Player player) - { - if (_streamType == StreamType.Audio) - { - player.MediaStreamAudioSeekingOccurred -= MediaStreamSeekingOccurred; - player.MediaStreamAudioBufferStatusChanged -= MediaStreamBufferStatusChanged; - } - else - { - player.MediaStreamVideoSeekingOccurred -= MediaStreamSeekingOccurred; - player.MediaStreamVideoBufferStatusChanged -= MediaStreamBufferStatusChanged; - } - } - - private void MediaStreamBufferStatusChanged(object sender, MediaStreamBufferStatusChangedEventArgs e) - { - BufferStatusChanged?.Invoke(this, e); - } - - private void MediaStreamSeekingOccurred(object sender, MediaStreamSeekingOccurredEventArgs e) - { - SeekingOccurred?.Invoke(this, e); - } - } -} diff --git a/src/Tizen.Multimedia.MediaPlayer/Player/MediaStreamSeekingOccurredEventArgs.cs b/src/Tizen.Multimedia.MediaPlayer/Player/MediaStreamSeekingOccurredEventArgs.cs deleted file mode 100644 index f3aa87457..000000000 --- a/src/Tizen.Multimedia.MediaPlayer/Player/MediaStreamSeekingOccurredEventArgs.cs +++ /dev/null @@ -1,46 +0,0 @@ -/* - * 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.Multimedia -{ - /// - /// Provides data for the event. - /// - public class MediaStreamSeekingOccurredEventArgs : EventArgs - { - /// - /// Initializes a new instance of the MediaStreamSeekingOccurredEventArgs class. - /// - /// The value indicating the new position to seek. - public MediaStreamSeekingOccurredEventArgs(ulong offset) - { - Offset = offset; - } - - /// - /// Gets the offset. - /// - public ulong Offset { get; } - - /// - /// Returns a string that represents the current object. - /// - /// A string that represents the current object. - public override string ToString() => $"Offset : { Offset.ToString() }"; - } -} diff --git a/src/Tizen.Multimedia.MediaPlayer/Player/MediaStreamSource.cs b/src/Tizen.Multimedia.MediaPlayer/Player/MediaStreamSource.cs deleted file mode 100644 index 2cb962456..000000000 --- a/src/Tizen.Multimedia.MediaPlayer/Player/MediaStreamSource.cs +++ /dev/null @@ -1,298 +0,0 @@ -/* - * 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.Collections.Generic; -using System.Diagnostics; -using System.Linq; -using static Interop; - -namespace Tizen.Multimedia -{ - - /// - /// Provides the ability to push packets as the source of . - /// - /// The source must be set as a source to a player before pushing. - /// - public sealed class MediaStreamSource : MediaSource - { - private readonly MediaFormat _audioMediaFormat; - private readonly MediaFormat _videoMediaFormat; - - /// - /// Gets all supported audio types. - /// - public static IEnumerable SupportedAudioTypes - { - get - { - yield return MediaFormatAudioMimeType.Aac; - } - } - - /// - /// Gets all supported video types. - /// - public static IEnumerable SupportedVideoTypes - { - get - { - yield return MediaFormatVideoMimeType.H264SP; - } - } - - private Player _player; - - private MediaStreamConfiguration CreateAudioConfiguration(AudioMediaFormat format) - { - if (format == null) - { - return null; - } - - if (!SupportedAudioTypes.Contains(format.MimeType)) - { - Log.Error(PlayerLog.Tag, "The audio format is not supported : " + format.MimeType); - throw new ArgumentException($"The audio format is not supported, Type : {format.MimeType}."); - } - - return new MediaStreamConfiguration(this, StreamType.Audio); - } - - private MediaStreamConfiguration CreateVideoConfiguration(VideoMediaFormat format) - { - if (format == null) - { - return null; - } - - if (!SupportedVideoTypes.Contains(format.MimeType)) - { - Log.Error(PlayerLog.Tag, "The video format is not supported : " + format.MimeType); - throw new ArgumentException($"The video format is not supported, Type : {format.MimeType}."); - } - - return new MediaStreamConfiguration(this, StreamType.Video); - } - - - /// - /// Initializes a new instance of the MediaStreamSource class - /// with the specified and . - /// - /// The for this source. - /// The for this source. - /// AAC and H.264 are supported. - /// Both and are null. - /// - /// is not supported.\n - /// -or-\n - /// is not supported.\n - /// - /// - /// - public MediaStreamSource(AudioMediaFormat audioMediaFormat, VideoMediaFormat videoMediaFormat) - { - if (audioMediaFormat == null && videoMediaFormat == null) - { - throw new ArgumentNullException(nameof(audioMediaFormat) + " and " + nameof(videoMediaFormat)); - } - - _audioMediaFormat = audioMediaFormat; - _videoMediaFormat = videoMediaFormat; - - AudioConfiguration = CreateAudioConfiguration(audioMediaFormat); - VideoConfiguration = CreateVideoConfiguration(videoMediaFormat); - } - - /// - /// Initializes a new instance of the MediaStreamSource class with the specified . - /// - /// The for this source. - /// AAC is supported. - /// is null. - /// is not supported. - /// - public MediaStreamSource(AudioMediaFormat audioMediaFormat) - { - if (audioMediaFormat == null) - { - throw new ArgumentNullException(nameof(audioMediaFormat)); - } - - _audioMediaFormat = audioMediaFormat; - - AudioConfiguration = CreateAudioConfiguration(audioMediaFormat); - } - /// - /// Initializes a new instance of the MediaStreamSource class with the specified . - /// - /// H.264 is supported. - /// The for this source. - /// is null. - /// is not supported. - /// - public MediaStreamSource(VideoMediaFormat videoMediaFormat) - { - if (videoMediaFormat == null) - { - throw new ArgumentNullException(nameof(videoMediaFormat)); - } - - _videoMediaFormat = videoMediaFormat; - - VideoConfiguration = CreateVideoConfiguration(videoMediaFormat); - } - - /// - /// Gets the audio configuration, or null if no AudioMediaFormat is specified in the constructor. - /// - public MediaStreamConfiguration AudioConfiguration { get; } - - /// - /// Gets the video configuration, or null if no VideoMediaFormat is specified in the constructor. - /// - public MediaStreamConfiguration VideoConfiguration { get; } - - /// - /// Pushes elementary stream to decode audio or video. - /// - /// This source must be set as a source to a player and the player must be in the , - /// , or state. - /// The to decode. - /// - /// This source is not set as a source to a player.\n - /// -or-\n - /// The player is not in the valid state. - /// - /// is null. - /// has been disposed of. - /// - /// is neither video nor audio type.\n - /// -or-\n - /// The format of packet is not matched with the specified format in the constructor. - /// - /// The internal buffer has reached its limits. - /// - /// - /// - public void Push(MediaPacket packet) - { - if (_player == null) - { - Log.Error(PlayerLog.Tag, "The source is not set as a source to a player yet."); - throw new InvalidOperationException("The source is not set as a source to a player yet."); - } - if (packet == null) - { - Log.Error(PlayerLog.Tag, "packet is null"); - throw new ArgumentNullException(nameof(packet)); - } - if (packet.IsDisposed) - { - Log.Error(PlayerLog.Tag, "packet is disposed"); - throw new ObjectDisposedException(nameof(packet)); - } - - if (packet.Format.Type == MediaFormatType.Text || packet.Format.Type == MediaFormatType.Container) - { - Log.Error(PlayerLog.Tag, "The format of the packet is invalid : " + packet.Format.Type); - throw new ArgumentException($"The format of the packet is invalid : { packet.Format.Type }."); - } - - if (!packet.Format.Equals(_audioMediaFormat) && !packet.Format.Equals(_videoMediaFormat)) - { - Log.Error(PlayerLog.Tag, "The format of the packet is invalid : Unmatched format."); - throw new ArgumentException($"The format of the packet is invalid : Unmatched format."); - } - - if (packet.Format.Type == MediaFormatType.Video && _videoMediaFormat == null) - { - Log.Error(PlayerLog.Tag, "Video is not configured with the current source."); - throw new ArgumentException("Video is not configured with the current source."); - } - if (packet.Format.Type == MediaFormatType.Audio && _audioMediaFormat == null) - { - Log.Error(PlayerLog.Tag, "Audio is not configured with the current source."); - throw new ArgumentException("Audio is not configured with the current source."); - } - - _player.ValidatePlayerState(PlayerState.Paused, PlayerState.Playing, PlayerState.Ready); - - NativePlayer.PushMediaStream(_player.Handle, packet.GetHandle()). - ThrowIfFailed("Failed to push the packet to the player"); - } - - private void SetMediaStreamInfo(StreamType streamType, MediaFormat mediaFormat) - { - if (mediaFormat == null) - { - Log.Error(PlayerLog.Tag, "invalid media format"); - return; - } - - IntPtr ptr = IntPtr.Zero; - - try - { - ptr = mediaFormat.AsNativeHandle(); - NativePlayer.SetMediaStreamInfo(_player.Handle, (int)streamType, ptr). - ThrowIfFailed("Failed to set the media stream info"); - } - finally - { - MediaFormat.ReleaseNativeHandle(ptr); - } - } - - internal override void OnAttached(Player player) - { - Debug.Assert(player != null); - - if (_player != null) - { - Log.Error(PlayerLog.Tag, "The source is has already been assigned to another player."); - throw new InvalidOperationException("The source is has already been assigned to another player."); - } - - AudioConfiguration?.OnPlayerSet(player); - VideoConfiguration?.OnPlayerSet(player); - - _player = player; - - SetMediaStreamInfo(StreamType.Audio, _audioMediaFormat); - SetMediaStreamInfo(StreamType.Video, _videoMediaFormat); - } - - internal override void OnDetached(Player player) - { - base.OnDetached(player); - - AudioConfiguration?.OnPlayerUnset(player); - VideoConfiguration?.OnPlayerUnset(player); - - _player = null; - } - - /// - /// Gets the that this source is assigned to as a source, or null if this source is not assigned. - /// - /// - public Player Player => _player; - - } -} diff --git a/src/Tizen.Multimedia.MediaPlayer/Player/MediaUriSource.cs b/src/Tizen.Multimedia.MediaPlayer/Player/MediaUriSource.cs deleted file mode 100644 index 40f66d454..000000000 --- a/src/Tizen.Multimedia.MediaPlayer/Player/MediaUriSource.cs +++ /dev/null @@ -1,56 +0,0 @@ -/* - * 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 static Interop; - -namespace Tizen.Multimedia -{ - /// - /// Represents a media source with a uri. - /// - /// - /// The internet privilege(http://tizen.org/privilege/internet) must be added if any URLs are used to play from a network. - /// The mediastorage privilege(http://tizen.org/privilege/mediastorage) must be added if any video/audio files are used to play located in the internal storage. - /// The externalstorage privilege(http://tizen.org/privilege/externalstorage) must be added if any video/audio files are used to play located in the external storage. - /// - /// - public sealed class MediaUriSource : MediaSource - { - // TODO consider using Uri class. - /// - /// Initializes a new instance of the MediaUriSource class with the specified uri. - /// The uri string. - /// For HTTP or RSTP, uri should start with "http://" or "rtsp://". - /// The default protocol is "file://". - /// If you provide an invalid uri, you won't receive an error until is called. - public MediaUriSource(string uri) - { - Uri = uri ?? throw new ArgumentNullException(nameof(uri)); - } - - /// - /// Gets the uri. - /// - public string Uri { get; } - - internal override void OnAttached(Player player) - { - NativePlayer.SetUri(player.Handle, Uri).ThrowIfFailed("Failed to set the source with specified uri"); - } - } -} - diff --git a/src/Tizen.Multimedia.MediaPlayer/Player/PlaybackInterruptedEventArgs.cs b/src/Tizen.Multimedia.MediaPlayer/Player/PlaybackInterruptedEventArgs.cs deleted file mode 100644 index 08294664b..000000000 --- a/src/Tizen.Multimedia.MediaPlayer/Player/PlaybackInterruptedEventArgs.cs +++ /dev/null @@ -1,49 +0,0 @@ -/* - * 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.Multimedia -{ - /// - /// Provides data for the event. - /// - public class PlaybackInterruptedEventArgs : EventArgs - { - /// - /// Initializes a new instance of the PlaybackInterruptedEventArgs class. - /// - /// The enum value indicating the reason. - public PlaybackInterruptedEventArgs(PlaybackInterruptionReason reason) - { - Reason = reason; - } - - /// - /// Gets the reason. - /// - public PlaybackInterruptionReason Reason { get; } - - /// - /// Returns a string that represents the current object. - /// - /// A string that represents the current object. - public override string ToString() - { - return $"Reason : { Reason.ToString() }"; - } - } -} diff --git a/src/Tizen.Multimedia.MediaPlayer/Player/Player.Events.cs b/src/Tizen.Multimedia.MediaPlayer/Player/Player.Events.cs deleted file mode 100644 index 11fee2d12..000000000 --- a/src/Tizen.Multimedia.MediaPlayer/Player/Player.Events.cs +++ /dev/null @@ -1,290 +0,0 @@ -/* - * 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.Threading.Tasks; -using System.Runtime.InteropServices; -using System.Diagnostics; -using System.IO; -using System.Threading; -using static Interop; - -namespace Tizen.Multimedia -{ - public partial class Player - { - /// - /// Occurs when the playback of a media is finished. - /// - public event EventHandler PlaybackCompleted; - private NativePlayer.PlaybackCompletedCallback _playbackCompletedCallback; - - /// - /// Occurs when the playback of a media is interrupted. - /// - public event EventHandler PlaybackInterrupted; - private NativePlayer.PlaybackInterruptedCallback _playbackInterruptedCallback; - - /// - /// Occurs when any error occurs. - /// - /// The event handler will be executed on an internal thread. - public event EventHandler ErrorOccurred; - private NativePlayer.PlaybackErrorCallback _playbackErrorCallback; - - /// - /// Occurs when the video stream is changed. - /// - /// The event handler will be executed on an internal thread. - public event EventHandler VideoStreamChanged; - private NativePlayer.VideoStreamChangedCallback _videoStreamChangedCallback; - - /// - /// Occurs when the subtitle is updated. - /// - /// The event handler will be executed on an internal thread. - public event EventHandler SubtitleUpdated; - private NativePlayer.SubtitleUpdatedCallback _subtitleUpdatedCallback; - - /// - /// Occurs when there is a change in the buffering status of streaming. - /// - public event EventHandler BufferingProgressChanged; - private NativePlayer.BufferingProgressCallback _bufferingProgressCallback; - - internal event EventHandler MediaStreamAudioBufferStatusChanged; - private NativePlayer.MediaStreamBufferStatusCallback _mediaStreamAudioBufferStatusChangedCallback; - - internal event EventHandler MediaStreamVideoBufferStatusChanged; - private NativePlayer.MediaStreamBufferStatusCallback _mediaStreamVideoBufferStatusChangedCallback; - - internal event EventHandler MediaStreamAudioSeekingOccurred; - private NativePlayer.MediaStreamSeekCallback _mediaStreamAudioSeekCallback; - - internal event EventHandler MediaStreamVideoSeekingOccurred; - private NativePlayer.MediaStreamSeekCallback _mediaStreamVideoSeekCallback; - - private bool _callbackRegistered; - - private void RegisterEvents() - { - if (_callbackRegistered) - { - return; - } - RegisterSubtitleUpdatedCallback(); - RegisterErrorOccurredCallback(); - RegisterPlaybackInterruptedCallback(); - RegisterVideoStreamChangedCallback(); - RegisterBufferingCallback(); - RegisterMediaStreamBufferStatusCallback(); - RegisterMediaStreamSeekCallback(); - RegisterPlaybackCompletedCallback(); - - _callbackRegistered = true; - } - - private void RegisterSubtitleUpdatedCallback() - { - _subtitleUpdatedCallback = (duration, text, _) => - { - Log.Debug(PlayerLog.Tag, "duration : " + duration + ", text : " + text); - SubtitleUpdated?.Invoke(this, new SubtitleUpdatedEventArgs(duration, text)); - }; - - NativePlayer.SetSubtitleUpdatedCb(Handle, _subtitleUpdatedCallback). - ThrowIfFailed("Failed to initialize the player"); - } - - private void RegisterPlaybackCompletedCallback() - { - _playbackCompletedCallback = _ => - { - Log.Debug(PlayerLog.Tag, "completed callback"); - PlaybackCompleted?.Invoke(this, EventArgs.Empty); - }; - NativePlayer.SetCompletedCb(Handle, _playbackCompletedCallback). - ThrowIfFailed("Failed to set PlaybackCompleted"); - } - - private void RegisterPlaybackInterruptedCallback() - { - _playbackInterruptedCallback = (code, _) => - { - if (!Enum.IsDefined(typeof(PlaybackInterruptionReason), code)) - { - return; - } - - if (code == PlaybackInterruptionReason.ResourceConflict) - { - OnUnprepared(); - } - - Log.Warn(PlayerLog.Tag, "interrupted reason : " + code); - PlaybackInterrupted?.Invoke(this, new PlaybackInterruptedEventArgs(code)); - }; - - NativePlayer.SetInterruptedCb(Handle, _playbackInterruptedCallback). - ThrowIfFailed("Failed to set PlaybackInterrupted"); - } - - private void RegisterErrorOccurredCallback() - { - _playbackErrorCallback = (code, _) => - { - //TODO handle service disconnected error. - Log.Warn(PlayerLog.Tag, "error code : " + code); - ErrorOccurred?.Invoke(this, new PlayerErrorOccurredEventArgs((PlayerError)code)); - }; - - NativePlayer.SetErrorCb(Handle, _playbackErrorCallback). - ThrowIfFailed("Failed to set PlaybackError"); - } - - #region VideoFrameDecoded event - - private EventHandler _videoFrameDecoded; - - private NativePlayer.VideoFrameDecodedCallback _videoFrameDecodedCallback; - - /// - /// Occurs when a video frame is decoded. - /// - /// - /// The event handler will be executed on an internal thread. - /// The in event args should be disposed after use. - /// - /// http://tizen.org/feature/multimedia.raw_video - /// The required feature is not supported. - /// - public event EventHandler VideoFrameDecoded - { - add - { - ValidationUtil.ValidateFeatureSupported(Features.RawVideo); - - _videoFrameDecoded += value; - } - remove - { - ValidationUtil.ValidateFeatureSupported(Features.RawVideo); - - _videoFrameDecoded -= value; - } - } - - private void RegisterVideoFrameDecodedCallback() - { - _videoFrameDecodedCallback = (packetHandle, _) => - { - var handler = _videoFrameDecoded; - if (handler != null) - { - Log.Debug(PlayerLog.Tag, "packet : " + packetHandle); - handler.Invoke(this, - new VideoFrameDecodedEventArgs(MediaPacket.From(packetHandle))); - } - else - { - MediaPacket.From(packetHandle).Dispose(); - } - }; - - NativePlayer.SetVideoFrameDecodedCb(Handle, _videoFrameDecodedCallback). - ThrowIfFailed("Failed to register the VideoFrameDecoded"); - } - #endregion - - private void RegisterVideoStreamChangedCallback() - { - ValidatePlayerState(PlayerState.Idle); - - _videoStreamChangedCallback = (width, height, fps, bitrate, _) => - { - Log.Debug(PlayerLog.Tag, "height : " + height + ", width : " + width - + ", fps : " + fps + ", bitrate : " + bitrate); - - VideoStreamChanged?.Invoke(this, new VideoStreamChangedEventArgs(height, width, fps, bitrate)); - }; - - NativePlayer.SetVideoStreamChangedCb(Handle, _videoStreamChangedCallback). - ThrowIfFailed("Failed to set the video stream changed callback"); - } - - private void RegisterBufferingCallback() - { - _bufferingProgressCallback = (percent, _) => - { - Log.Debug(PlayerLog.Tag, $"Buffering callback with percent { percent }"); - BufferingProgressChanged?.Invoke(this, new BufferingProgressChangedEventArgs(percent)); - }; - - NativePlayer.SetBufferingCb(Handle, _bufferingProgressCallback). - ThrowIfFailed("Failed to set BufferingProgress"); - } - - private void RegisterMediaStreamBufferStatusCallback() - { - _mediaStreamAudioBufferStatusChangedCallback = (status, _) => - { - Debug.Assert(Enum.IsDefined(typeof(MediaStreamBufferStatus), status)); - Log.Debug(PlayerLog.Tag, "audio buffer status : " + status); - MediaStreamAudioBufferStatusChanged?.Invoke(this, - new MediaStreamBufferStatusChangedEventArgs(status)); - }; - _mediaStreamVideoBufferStatusChangedCallback = (status, _) => - { - Debug.Assert(Enum.IsDefined(typeof(MediaStreamBufferStatus), status)); - Log.Debug(PlayerLog.Tag, "video buffer status : " + status); - MediaStreamVideoBufferStatusChanged?.Invoke(this, - new MediaStreamBufferStatusChangedEventArgs(status)); - }; - - RegisterMediaStreamBufferStatusCallback(StreamType.Audio, _mediaStreamAudioBufferStatusChangedCallback); - RegisterMediaStreamBufferStatusCallback(StreamType.Video, _mediaStreamVideoBufferStatusChangedCallback); - } - - private void RegisterMediaStreamBufferStatusCallback(StreamType streamType, - NativePlayer.MediaStreamBufferStatusCallback cb) - { - NativePlayer.SetMediaStreamBufferStatusCb(Handle, streamType, cb). - ThrowIfFailed("Failed to SetMediaStreamBufferStatus"); - } - - private void RegisterMediaStreamSeekCallback() - { - _mediaStreamAudioSeekCallback = (offset, _) => - { - Log.Debug(PlayerLog.Tag, "audio seeking offset : " + offset); - MediaStreamAudioSeekingOccurred?.Invoke(this, new MediaStreamSeekingOccurredEventArgs(offset)); - }; - _mediaStreamVideoSeekCallback = (offset, _) => - { - Log.Debug(PlayerLog.Tag, "video seeking offset : " + offset); - MediaStreamVideoSeekingOccurred?.Invoke(this, new MediaStreamSeekingOccurredEventArgs(offset)); - }; - - RegisterMediaStreamSeekCallback(StreamType.Audio, _mediaStreamAudioSeekCallback); - RegisterMediaStreamSeekCallback(StreamType.Video, _mediaStreamVideoSeekCallback); - } - - private void RegisterMediaStreamSeekCallback(StreamType streamType, NativePlayer.MediaStreamSeekCallback cb) - { - NativePlayer.SetMediaStreamSeekCb(Handle, streamType, cb). - ThrowIfFailed("Failed to SetMediaStreamSeek"); - } - } -} diff --git a/src/Tizen.Multimedia.MediaPlayer/Player/Player.Properties.cs b/src/Tizen.Multimedia.MediaPlayer/Player/Player.Properties.cs deleted file mode 100644 index e8219d6ce..000000000 --- a/src/Tizen.Multimedia.MediaPlayer/Player/Player.Properties.cs +++ /dev/null @@ -1,412 +0,0 @@ -/* - * 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.Threading.Tasks; -using System.Runtime.InteropServices; -using System.Diagnostics; -using System.IO; -using System.Threading; -using NativeDisplay = Interop.Display; -using static Interop; - -namespace Tizen.Multimedia -{ - public partial class Player - { - private void RetrieveProperties() - { - NativePlayer.GetAudioLatencyMode(Handle, out _audioLatencyMode). - ThrowIfFailed("Failed to initialize the player"); - - NativePlayer.IsLooping(Handle, out _isLooping).ThrowIfFailed("Failed to initialize the player"); - } - - /// - /// Gets the native handle of the player. - /// - /// An IntPtr that contains the native handle of the player. - /// The player has already been disposed of. - public IntPtr Handle - { - get - { - ValidateNotDisposed(); - return _handle.DangerousGetHandle(); - } - } - - #region Network configuration - private string _cookie = ""; - private string _userAgent = ""; - - /// - /// Gets or sets the cookie for streaming playback. - /// - /// To set, the player must be in the state. - /// The player is not in the valid state. - /// The player has already been disposed of. - /// The value to set is null. - public string Cookie - { - get - { - Log.Info(PlayerLog.Tag, "get cookie : " + _cookie); - return _cookie; - } - set - { - ValidatePlayerState(PlayerState.Idle); - - if (value == null) - { - throw new ArgumentNullException(nameof(value), "Cookie can't be null."); - } - - NativePlayer.SetStreamingCookie(Handle, value, value.Length). - ThrowIfFailed("Failed to set the cookie to the player"); - - _cookie = value; - } - } - - /// - /// Gets or sets the user agent for streaming playback. - /// - /// To set, the player must be in the state. - /// The player is not in the valid state. - /// The player has already been disposed of. - /// The value to set is null. - public string UserAgent - { - get - { - Log.Info(PlayerLog.Tag, "get useragent : " + _userAgent); - return _userAgent; - } - set - { - ValidatePlayerState(PlayerState.Idle); - - if (value == null) - { - throw new ArgumentNullException(nameof(value), "UserAgent can't be null."); - } - - NativePlayer.SetStreamingUserAgent(Handle, value, value.Length). - ThrowIfFailed("Failed to set the user agent to the player"); - - _userAgent = value; - } - } - #endregion - - /// - /// Gets the state of the player. - /// - /// The current state of the player. - /// The player has already been disposed of. - public PlayerState State - { - get - { - ValidateNotDisposed(); - - if (IsPreparing()) - { - return PlayerState.Preparing; - } - - NativePlayer.GetState(Handle, out var state).ThrowIfFailed("Failed to retrieve the state of the player"); - - Debug.Assert(Enum.IsDefined(typeof(PlayerState), state)); - - return (PlayerState)state; - } - } - - private AudioLatencyMode _audioLatencyMode; - - /// - /// Gets or sets the audio latency mode. - /// - /// A that specifies the mode. The default is . - /// - /// If the mode is , - /// audio output interval can be increased, so it can keep more audio data to play. - /// But, state transition like pause or resume can be more slower than default(). - /// - /// The player has already been disposed of. - /// The value is not valid. - public AudioLatencyMode AudioLatencyMode - { - get - { - Log.Info(PlayerLog.Tag, "get audio latency mode : " + _audioLatencyMode); - return _audioLatencyMode; - } - set - { - ValidateNotDisposed(); - - if (_audioLatencyMode == value) - { - return; - } - ValidationUtil.ValidateEnum(typeof(AudioLatencyMode), value); - - NativePlayer.SetAudioLatencyMode(Handle, value). - ThrowIfFailed("Failed to set the audio latency mode of the player"); - - _audioLatencyMode = value; - } - } - - private bool _isLooping; - - /// - /// Gets or sets the looping state. - /// - /// true if the playback is looping; otherwise, false. The default value is false. - /// The player has already been disposed of. - public bool IsLooping - { - get - { - Log.Info(PlayerLog.Tag, "get looping : " + _isLooping); - return _isLooping; - } - set - { - ValidateNotDisposed(); - - if (_isLooping == value) - { - return; - } - - NativePlayer.SetLooping(Handle, value).ThrowIfFailed("Failed to set the looping state of the player"); - - _isLooping = value; - } - } - - #region Display methods - /// - /// Gets the display settings. - /// - /// A that specifies the display settings. - public PlayerDisplaySettings DisplaySettings { get; } - - private Display _display; - - private PlayerErrorCode SetDisplay(Display display) - { - if (display == null) - { - return NativeDisplay.SetDisplay(Handle, PlayerDisplayType.None, IntPtr.Zero); - } - - return display.ApplyTo(this); - } - - private void ReplaceDisplay(Display newDisplay) - { - _display?.SetOwner(null); - _display = newDisplay; - _display?.SetOwner(this); - } - - /// - /// Gets or sets the display. - /// - /// A that specifies the display. - /// The player must be in the state. - /// The player has already been disposed of. - /// The value has already been assigned to another player. - /// The player is not in the valid state. - public Display Display - { - get - { - return _display; - } - set - { - ValidatePlayerState(PlayerState.Idle); - - if (value?.Owner != null) - { - if (ReferenceEquals(this, value.Owner)) - { - return; - } - - throw new ArgumentException("The display has already been assigned to another."); - } - SetDisplay(value).ThrowIfFailed("Failed to set the display to the player"); - - ReplaceDisplay(value); - } - } - - PlayerErrorCode IDisplayable.ApplyEvasDisplay(DisplayType type, ElmSharp.EvasObject evasObject) - { - Debug.Assert(IsDisposed == false); - - Debug.Assert(Enum.IsDefined(typeof(DisplayType), type)); - Debug.Assert(type != DisplayType.None); - - return NativeDisplay.SetDisplay(Handle, - type == DisplayType.Overlay ? PlayerDisplayType.Overlay : PlayerDisplayType.Evas, evasObject); - } - - PlayerErrorCode IDisplayable.ApplyEcoreWindow(IntPtr windowHandle) - { - Debug.Assert(IsDisposed == false); - - return NativeDisplay.SetEcoreDisplay(Handle, PlayerDisplayType.Overlay, windowHandle); - } - #endregion - - private PlayerTrackInfo _audioTrack; - - /// - /// Gets the track info for the audio. - /// - /// A for audio. - public PlayerTrackInfo AudioTrackInfo - { - get - { - if (_audioTrack == null) - { - _audioTrack = new PlayerTrackInfo(this, StreamType.Audio); - } - return _audioTrack; - } - } - - private PlayerTrackInfo _subtitleTrackInfo; - - /// - /// Gets the track info for the subtitle. - /// - /// A for the subtitle. - public PlayerTrackInfo SubtitleTrackInfo - { - get - { - if (_subtitleTrackInfo == null) - { - _subtitleTrackInfo = new PlayerTrackInfo(this, StreamType.Text); - } - return _subtitleTrackInfo; - } - } - - private StreamInfo _streamInfo; - - /// - /// Gets the stream information. - /// - /// A for this player. - public StreamInfo StreamInfo - { - get - { - if (_streamInfo == null) - { - _streamInfo = new StreamInfo(this); - } - return _streamInfo; - } - } - - private readonly AudioEffect _audioEffect; - - /// - /// Gets the audio effect. - /// - /// http://tizen.org/feature/multimedia.custom_audio_effect - /// The required feature is not supported. - public AudioEffect AudioEffect - { - get - { - if (_audioEffect == null) - { - throw new NotSupportedException($"The feature({Features.AudioEffect}) is not supported."); - } - - return _audioEffect; - } - } - - /// - /// Gets or sets the mute state. - /// - /// true if the player is muted; otherwise, false. - /// The player has already been disposed of. - public bool Muted - { - get - { - bool value = false; - NativePlayer.IsMuted(Handle, out value).ThrowIfFailed("Failed to get the mute state of the player"); - - Log.Info(PlayerLog.Tag, "get mute : " + value); - - return value; - } - set - { - NativePlayer.SetMute(Handle, value).ThrowIfFailed("Failed to set the mute state of the player"); - } - } - - /// - /// Gets or sets the current volume. - /// - /// Valid volume range is from 0 to 1.0, inclusive. - /// The player has already been disposed of. - /// - /// is less than zero.\n - /// -or-\n - /// is greater than 1.0. - /// - public float Volume - { - get - { - float value = 0.0F; - NativePlayer.GetVolume(Handle, out value, out value). - ThrowIfFailed("Failed to get the volume of the player"); - return value; - } - set - { - if (value < 0F || 1.0F < value) - { - throw new ArgumentOutOfRangeException(nameof(value), value, - $"Valid volume range is 0 <= value <= 1.0, but got { value }."); - } - - NativePlayer.SetVolume(Handle, value, value). - ThrowIfFailed("Failed to set the volume of the player"); - } - } - } -} diff --git a/src/Tizen.Multimedia.MediaPlayer/Player/Player.cs b/src/Tizen.Multimedia.MediaPlayer/Player/Player.cs deleted file mode 100644 index 7dd403568..000000000 --- a/src/Tizen.Multimedia.MediaPlayer/Player/Player.cs +++ /dev/null @@ -1,643 +0,0 @@ -/* - * 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.Threading.Tasks; -using System.Runtime.InteropServices; -using System.Diagnostics; -using System.IO; -using System.Threading; -using static Interop; - -namespace Tizen.Multimedia -{ - internal static class PlayerLog - { - internal const string Tag = "Tizen.Multimedia.Player"; - } - - /// - /// Provides the ability to control media playback. - /// - /// - /// The player provides functions to play a media content. - /// It also provides functions to adjust the configurations of the player such as playback rate, volume, looping etc. - /// Note that only one video player can be played at one time. - /// - public partial class Player : IDisposable, IDisplayable - { - private PlayerHandle _handle; - - /// - /// Initializes a new instance of the class. - /// - public Player() - { - NativePlayer.Create(out _handle).ThrowIfFailed("Failed to create player"); - - Debug.Assert(_handle != null); - - RetrieveProperties(); - - if (Features.IsSupported(Features.AudioEffect)) - { - _audioEffect = new AudioEffect(this); - } - - if (Features.IsSupported(Features.RawVideo)) - { - RegisterVideoFrameDecodedCallback(); - } - - DisplaySettings = PlayerDisplaySettings.Create(this); - } - - internal void ValidatePlayerState(params PlayerState[] desiredStates) - { - Debug.Assert(desiredStates.Length > 0); - - ValidateNotDisposed(); - - var curState = State; - if (curState.IsAnyOf(desiredStates)) - { - return; - } - - throw new InvalidOperationException($"The player is not in a valid state. " + - $"Current State : { curState }, Valid State : { string.Join(", ", desiredStates) }."); - } - - #region Dispose support - private bool _disposed; - - /// - /// Releases all resources used by the current instance. - /// - public void Dispose() - { - Dispose(true); - } - - private void Dispose(bool disposing) - { - if (!_disposed) - { - ReplaceDisplay(null); - - if (_source != null) - { - try - { - _source.DetachFrom(this); - } - catch (Exception e) - { - Log.Error(PlayerLog.Tag, e.ToString()); - } - } - _source = null; - - if (_handle != null) - { - _handle.Dispose(); - } - _disposed = true; - } - } - - internal void ValidateNotDisposed() - { - if (_disposed) - { - Log.Warn(PlayerLog.Tag, "player was disposed"); - throw new ObjectDisposedException(nameof(Player)); - } - } - - internal bool IsDisposed => _disposed; - #endregion - - #region Methods - - /// - /// Gets the streaming download progress. - /// - /// The containing current download progress. - /// The player must be in the or state. - /// - /// The player is not streaming.\n - /// -or-\n - /// The player is not in the valid state. - /// - /// The player has already been disposed of. - public DownloadProgress GetDownloadProgress() - { - ValidatePlayerState(PlayerState.Playing, PlayerState.Paused); - - int start = 0; - int current = 0; - NativePlayer.GetStreamingDownloadProgress(Handle, out start, out current). - ThrowIfFailed("Failed to get download progress"); - - Log.Info(PlayerLog.Tag, "get download progress : " + start + ", " + current); - - return new DownloadProgress(start, current); - } - - /// - /// Sets the subtitle path for playback. - /// - /// Only MicroDVD/SubViewer(*.sub), SAMI(*.smi), and SubRip(*.srt) subtitle formats are supported. - /// The mediastorage privilege(http://tizen.org/privilege/mediastorage) must be added if any files are used to play located in the internal storage. - /// The externalstorage privilege(http://tizen.org/privilege/externalstorage) must be added if any files are used to play located in the external storage. - /// - /// The player has already been disposed of. - /// is an empty string. - /// The specified path does not exist. - /// The path is null. - public void SetSubtitle(string path) - { - ValidateNotDisposed(); - - if (path == null) - { - throw new ArgumentNullException(nameof(path)); - } - - if (path.Length == 0) - { - throw new ArgumentException("The path is empty.", nameof(path)); - } - - if (!File.Exists(path)) - { - throw new FileNotFoundException($"The specified file does not exist.", path); - } - - NativePlayer.SetSubtitlePath(Handle, path). - ThrowIfFailed("Failed to set the subtitle path to the player"); - } - - /// - /// Removes the subtitle path. - /// - /// The player must be in the state. - /// The player has already been disposed of. - /// The player is not in the valid state. - public void ClearSubtitle() - { - ValidatePlayerState(PlayerState.Idle); - - NativePlayer.SetSubtitlePath(Handle, null). - ThrowIfFailed("Failed to clear the subtitle of the player"); - } - - /// - /// Sets the offset for the subtitle. - /// - /// The value indicating a desired offset in milliseconds. - /// The player must be in the or state. - /// The player has already been disposed of. - /// - /// The player is not in the valid state.\n - /// -or-\n - /// No subtitle is set. - /// - /// - public void SetSubtitleOffset(int offset) - { - ValidatePlayerState(PlayerState.Playing, PlayerState.Paused); - - var err = NativePlayer.SetSubtitlePositionOffset(Handle, offset); - - if (err == PlayerErrorCode.FeatureNotSupported) - { - throw new InvalidOperationException("No subtitle set"); - } - - err.ThrowIfFailed("Failed to the subtitle offset of the player"); - } - - private void Prepare() - { - NativePlayer.Prepare(Handle).ThrowIfFailed("Failed to prepare the player"); - } - - /// - /// Called when the is invoked. - /// - protected virtual void OnPreparing() - { - RegisterEvents(); - } - - /// - /// Prepares the media player for playback, asynchronously. - /// - /// A task that represents the asynchronous prepare operation. - /// To prepare the player, the player must be in the state, - /// and a source must be set. - /// No source is set. - /// The player has already been disposed of. - /// The player is not in the valid state. - public virtual Task PrepareAsync() - { - if (_source == null) - { - throw new InvalidOperationException("No source is set."); - } - - ValidatePlayerState(PlayerState.Idle); - - OnPreparing(); - - var completionSource = new TaskCompletionSource(); - - SetPreparing(); - - Task.Run(() => - { - try - { - Prepare(); - ClearPreparing(); - completionSource.SetResult(true); - } - catch (Exception e) - { - ClearPreparing(); - completionSource.TrySetException(e); - } - }); - - return completionSource.Task; - } - - /// - /// Unprepares the player. - /// - /// - /// The most recently used source is reset and is no longer associated with the player. Playback is no longer possible. - /// If you want to use the player again, you have to set a source and call again. - /// - /// The player must be in the , , or state. - /// It has no effect if the player is already in the state. - /// - /// - /// The player has already been disposed of. - /// The player is not in the valid state. - public virtual void Unprepare() - { - if (State == PlayerState.Idle) - { - Log.Warn(PlayerLog.Tag, "idle state already"); - return; - } - ValidatePlayerState(PlayerState.Ready, PlayerState.Paused, PlayerState.Playing); - - NativePlayer.Unprepare(Handle).ThrowIfFailed("Failed to unprepare the player"); - - OnUnprepared(); - } - - /// - /// Called after the is unprepared. - /// - /// - protected virtual void OnUnprepared() - { - _source?.DetachFrom(this); - _source = null; - } - - /// - /// Starts or resumes playback. - /// - /// - /// The player must be in the or state. - /// It has no effect if the player is already in the state.\n - /// \n - /// Sound can be mixed with other sounds if you don't control the stream focus using . - /// - /// The player has already been disposed of. - /// The player is not in the valid state. - /// - /// - /// - /// - /// - public virtual void Start() - { - if (State == PlayerState.Playing) - { - Log.Warn(PlayerLog.Tag, "playing state already"); - return; - } - ValidatePlayerState(PlayerState.Ready, PlayerState.Paused); - - NativePlayer.Start(Handle).ThrowIfFailed("Failed to start the player"); - } - - /// - /// Stops playing the media content. - /// - /// - /// The player must be in the or state. - /// It has no effect if the player is already in the state. - /// - /// The player has already been disposed of. - /// The player is not in the valid state. - /// - /// - public virtual void Stop() - { - if (State == PlayerState.Ready) - { - Log.Warn(PlayerLog.Tag, "ready state already"); - return; - } - ValidatePlayerState(PlayerState.Paused, PlayerState.Playing); - - NativePlayer.Stop(Handle).ThrowIfFailed("Failed to stop the player"); - } - - /// - /// Pauses the player. - /// - /// - /// The player must be in the state. - /// It has no effect if the player is already in the state. - /// - /// The player has already been disposed of. - /// The player is not in the valid state. - /// - public virtual void Pause() - { - if (State == PlayerState.Paused) - { - Log.Warn(PlayerLog.Tag, "pause state already"); - return; - } - - ValidatePlayerState(PlayerState.Playing); - - NativePlayer.Pause(Handle).ThrowIfFailed("Failed to pause the player"); - } - - private MediaSource _source; - - /// - /// Sets a media source for the player. - /// - /// A that specifies the source for playback. - /// The player must be in the state. - /// The player has already been disposed of. - /// - /// The player is not in the valid state.\n - /// -or-\n - /// It is not able to assign the source to the player. - /// - /// - public void SetSource(MediaSource source) - { - ValidatePlayerState(PlayerState.Idle); - - if (source != null) - { - source.AttachTo(this); - } - - if (_source != null) - { - _source.DetachFrom(this); - } - - _source = source; - } - - /// - /// Captures a video frame, asynchronously. - /// - /// A task that represents the asynchronous capture operation. - /// http://tizen.org/feature/multimedia.raw_video - /// The player must be in the or state. - /// The player has already been disposed of. - /// The player is not in the valid state. - /// The required feature is not supported. - public async Task CaptureVideoAsync() - { - ValidationUtil.ValidateFeatureSupported(Features.RawVideo); - - ValidatePlayerState(PlayerState.Playing, PlayerState.Paused); - - TaskCompletionSource t = new TaskCompletionSource(); - - NativePlayer.VideoCaptureCallback cb = (data, width, height, size, _) => - { - Debug.Assert(size <= int.MaxValue); - - byte[] buf = new byte[size]; - Marshal.Copy(data, buf, 0, (int)size); - - t.TrySetResult(new CapturedFrame(buf, width, height)); - }; - - using (var cbKeeper = ObjectKeeper.Get(cb)) - { - NativePlayer.CaptureVideo(Handle, cb) - .ThrowIfFailed("Failed to capture the video"); - - return await t.Task; - } - } - - /// - /// Gets the play position in milliseconds. - /// - /// The player must be in the , , - /// or state. - /// The player has already been disposed of. - /// The player is not in the valid state. - /// - public int GetPlayPosition() - { - ValidatePlayerState(PlayerState.Ready, PlayerState.Paused, PlayerState.Playing); - - int playPosition = 0; - - NativePlayer.GetPlayPosition(Handle, out playPosition). - ThrowIfFailed("Failed to get the play position of the player"); - - Log.Info(PlayerLog.Tag, "get play position : " + playPosition); - - return playPosition; - } - - private void SetPlayPosition(int milliseconds, bool accurate, - NativePlayer.SeekCompletedCallback cb) - { - var ret = NativePlayer.SetPlayPosition(Handle, milliseconds, accurate, cb, IntPtr.Zero); - - //Note that we assume invalid param error is returned only when the position value is invalid. - if (ret == PlayerErrorCode.InvalidArgument) - { - throw new ArgumentOutOfRangeException(nameof(milliseconds), milliseconds, - "The position is not valid."); - } - if (ret != PlayerErrorCode.None) - { - Log.Error(PlayerLog.Tag, "Failed to set play position, " + (PlayerError)ret); - } - ret.ThrowIfFailed("Failed to set play position"); - } - - /// - /// Sets the seek position for playback, asynchronously. - /// - /// The value indicating a desired position in milliseconds. - /// The value indicating whether the operation performs with accuracy. - /// - /// The player must be in the , , - /// or state. - /// If the is true, the play position will be adjusted as the specified value, - /// but this might be considerably slow. If false, the play position will be a nearest keyframe position. - /// - /// The player has already been disposed of. - /// The player is not in the valid state. - /// The specified position is not valid. - /// - public async Task SetPlayPositionAsync(int position, bool accurate) - { - ValidatePlayerState(PlayerState.Ready, PlayerState.Playing, PlayerState.Paused); - - var taskCompletionSource = new TaskCompletionSource(); - - bool immediateResult = _source is MediaStreamSource; - - NativePlayer.SeekCompletedCallback cb = _ => taskCompletionSource.TrySetResult(true); - - using (var cbKeeper = ObjectKeeper.Get(cb)) - { - SetPlayPosition(position, accurate, cb); - if (immediateResult) - { - taskCompletionSource.TrySetResult(true); - } - - await taskCompletionSource.Task; - } - } - - /// - /// Sets the playback rate. - /// - /// The value for the playback rate. Valid range is -5.0 to 5.0, inclusive. - /// - /// The player must be in the , , - /// or state. - /// The sound will be muted, when the playback rate is under 0.0 or over 2.0. - /// - /// The player has already been disposed of. - /// - /// The player is not in the valid state.\n - /// -or-\n - /// Streaming playback. - /// - /// - /// is less than 5.0.\n - /// -or-\n - /// is greater than 5.0.\n - /// -or-\n - /// is zero. - /// - public void SetPlaybackRate(float rate) - { - if (rate < -5.0F || 5.0F < rate || rate == 0.0F) - { - throw new ArgumentOutOfRangeException(nameof(rate), rate, "Valid range is -5.0 to 5.0 (except 0.0)"); - } - - ValidatePlayerState(PlayerState.Ready, PlayerState.Playing, PlayerState.Paused); - - NativePlayer.SetPlaybackRate(Handle, rate).ThrowIfFailed("Failed to set the playback rate."); - } - - /// - /// Applies the audio stream policy. - /// - /// The to apply. - /// - /// The player must be in the state.\n - /// \n - /// does not support all .\n - /// Supported types are , , - /// , , - /// , , - /// and . - /// - /// - /// The player has already been disposed of.\n - /// -or-\n - /// has already been disposed of. - /// - /// The player is not in the valid state. - /// is null. - /// - /// of is not supported by . - /// - /// - public void ApplyAudioStreamPolicy(AudioStreamPolicy policy) - { - if (policy == null) - { - throw new ArgumentNullException(nameof(policy)); - } - - ValidatePlayerState(PlayerState.Idle); - - NativePlayer.SetAudioPolicyInfo(Handle, policy.Handle). - ThrowIfFailed("Failed to set the audio stream policy to the player"); - } - #endregion - - #region Preparing state - - private int _isPreparing; - - private bool IsPreparing() - { - return Interlocked.CompareExchange(ref _isPreparing, 1, 1) == 1; - } - - private void SetPreparing() - { - Interlocked.Exchange(ref _isPreparing, 1); - } - - private void ClearPreparing() - { - Interlocked.Exchange(ref _isPreparing, 0); - } - - #endregion - - /// - /// This method supports the product infrastructure and is not intended to be used directly from application code. - /// - protected static Exception GetException(int errorCode, string message) => - ((PlayerErrorCode)errorCode).GetException(message); - } -} diff --git a/src/Tizen.Multimedia.MediaPlayer/Player/PlayerDisplaySettings.cs b/src/Tizen.Multimedia.MediaPlayer/Player/PlayerDisplaySettings.cs deleted file mode 100644 index 12f2acb03..000000000 --- a/src/Tizen.Multimedia.MediaPlayer/Player/PlayerDisplaySettings.cs +++ /dev/null @@ -1,162 +0,0 @@ -/* - * 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.Diagnostics; -using Native = Interop.Display; - -namespace Tizen.Multimedia -{ - /// - /// Provides a means to configure display settings for video . - /// - public class PlayerDisplaySettings - { - /// - /// This constructor supports the product infrastructure and is not intended to be used directly from application code. - /// - protected PlayerDisplaySettings(Player player) - { - if (player == null) - { - throw new ArgumentNullException(nameof(player)); - } - - Player = player; - } - - internal static PlayerDisplaySettings Create(Player player) => new PlayerDisplaySettings(player); - - /// - /// Gets the player of this instance. - /// - /// The of this instance. - protected Player Player { get; } - - /// - /// Gets or sets the . - /// - /// - /// Operation failed; internal error. - /// - /// The player has already been disposed of. - /// The specified value to set is invalid. - public PlayerDisplayMode Mode - { - get - { - Native.GetMode(Player.Handle, out var value). - ThrowIfFailed("Failed to get display mode"); - - return value; - } - set - { - ValidationUtil.ValidateEnum(typeof(PlayerDisplayMode), value); - - Native.SetMode(Player.Handle, value). - ThrowIfFailed("Failed to set display mode"); - } - } - - /// - /// Gets or sets the value indicating whether the display is visible. - /// - /// true if the display is visible; otherwise false. - /// - /// Operation failed; internal error. - /// - /// The player has already been disposed of. - public bool IsVisible - { - get - { - Native.IsVisible(Player.Handle, out var value). - ThrowIfFailed("Failed to get the visible state of the display"); - - return value; - } - set - { - Native.SetVisible(Player.Handle, value).ThrowIfFailed("Failed to set the visible state of the display"); - } - } - - /// - /// Gets or sets the rotation of the display. - /// - /// , , , - /// - /// - /// Operation failed; internal error. - /// - /// The player has already been disposed of. - /// The specified value to set is invalid. - public Rotation Rotation - { - get - { - Native.GetRotation(Player.Handle, out var value). - ThrowIfFailed("Failed to get the rotation state of the display"); - - return value; - } - set - { - ValidationUtil.ValidateEnum(typeof(Rotation), value); - - Native.SetRotation(Player.Handle, value). - ThrowIfFailed("Failed to set the rotation state of the display"); - } - } - - /// - /// Sets the roi(region of interest). - /// - /// The region. - /// - /// To set roi, must be set to first. - /// - /// - /// Operation failed; internal error.\n - /// -or-\n - /// is not set to . - /// - /// The player has already been disposed of. - /// The width or the height is less than or equal to zero. - public void SetRoi(Rectangle roi) - { - if (roi.Width <= 0) - { - throw new ArgumentOutOfRangeException(nameof(roi), roi.Width, - $"The width of the roi can't be less than or equal to zero."); - } - if (roi.Height <= 0) - { - throw new ArgumentOutOfRangeException(nameof(roi), roi.Height, - $"The height of the roi can't be less than or equal to zero."); - } - - if (Mode != PlayerDisplayMode.Roi) - { - throw new InvalidOperationException("Mode is not set to Roi"); - } - - Native.SetRoi(Player.Handle, roi.X, roi.Y, roi.Width, roi.Height). - ThrowIfFailed("Failed to set the roi"); - } - } -} diff --git a/src/Tizen.Multimedia.MediaPlayer/Player/PlayerDisplayType.cs b/src/Tizen.Multimedia.MediaPlayer/Player/PlayerDisplayType.cs deleted file mode 100644 index bcd2e0cf3..000000000 --- a/src/Tizen.Multimedia.MediaPlayer/Player/PlayerDisplayType.cs +++ /dev/null @@ -1,25 +0,0 @@ -/* - * 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. - */ - -namespace Tizen.Multimedia -{ - internal enum PlayerDisplayType - { - Overlay, - Evas = 3, - None = 4, - } -} \ No newline at end of file diff --git a/src/Tizen.Multimedia.MediaPlayer/Player/PlayerEnums.cs b/src/Tizen.Multimedia.MediaPlayer/Player/PlayerEnums.cs deleted file mode 100644 index cfc5c38b4..000000000 --- a/src/Tizen.Multimedia.MediaPlayer/Player/PlayerEnums.cs +++ /dev/null @@ -1,288 +0,0 @@ -/* - * 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.Multimedia -{ - /// - /// Specifies errors. - /// - /// - /// - public enum PlayerError - { - /// - /// File does not exists. - /// - NoSuchFile = ErrorCode.NoSuchFile, - - /// - /// Internal error. - /// - InternalError = ErrorCode.InvalidOperation, - - /// - /// No space. - /// - NoSpaceOnDevice = PlayerErrorCode.NoSpaceOnDevice, - - /// - /// Not enough buffer. - /// - BufferSpace = ErrorCode.BufferSpace, - - /// - /// failed. - /// - SeekFailed = PlayerErrorCode.SeekFailed, - - /// - /// Invalid state. - /// - InvalidState = PlayerErrorCode.InvalidState, - - /// - /// Not supported file. - /// - NotSupportedFile = PlayerErrorCode.NotSupportedFile, - - /// - /// Invalid uri. - /// - InvalidUri = PlayerErrorCode.InvalidUri, - - /// - /// Connection to service failed. - /// - ConnectionFailed = PlayerErrorCode.ConnectionFailed, - - /// - /// Not permitted DRM. - /// - DrmNotPermitted = PlayerErrorCode.DrmNotPermitted, - - /// - /// Service disconnected. - /// - ServiceDisconnected = PlayerErrorCode.ServiceDisconnected, - - /// - /// Not supported audio codec. - /// - AudioCodecNotSupported = PlayerErrorCode.NotSupportedAudioCodec, - - /// - /// Not supported video codec. - /// - VideoCodecNotSupported = PlayerErrorCode.NotSupportedVideoCodec, - - /// - /// Not supported subtitle file. - /// - SubtitleNotSupported = PlayerErrorCode.NotSupportedSubtitle, - } - - /// - /// Specifies states that a can have. - /// - public enum PlayerState - { - /// - /// Initial state, unprepared. - /// - /// - Idle = 1, - - /// - /// Prepared. - /// - /// - Ready, - - /// - /// Playing. - /// - /// - Playing, - - /// - /// Paused while playing media. - /// - /// - Paused, - - /// - /// Preparation in progress. - /// - /// /> - Preparing, - } - - internal static class PlayerStateExtensions - { - internal static bool IsAnyOf(this PlayerState thisState, params PlayerState[] states) - { - return Array.IndexOf(states, thisState) != -1; - } - } - - /// - /// Specifies audio latency modes for . - /// - /// - public enum AudioLatencyMode - { - /// - /// Low audio latency mode. - /// - Low, - - /// - /// Middle audio latency mode. - /// - Mid, - - /// - /// High audio latency mode. - /// - High, - } - - /// - /// Specifies display modes for . - /// - /// - public enum PlayerDisplayMode - { - /// - /// Letter box. - /// - LetterBox, - - /// - /// Original size. - /// - OriginalSize, - - /// - /// Full-screen. - /// - FullScreen, - - /// - /// Cropped full-screen. - /// - CroppedFull, - - /// - /// Original size (if surface size is larger than video size(width/height)) or - /// letter box (if video size(width/height) is larger than surface size). - /// - OriginalOrFull, - - /// - /// Region of interest. - /// - /// - Roi - } - - internal enum StreamType - { - /// - /// Audio element stream type. - /// - Audio = 1, - - /// - /// Video element stream type. - /// - Video, - - /// - /// Text type. - /// - Text - } - - /// - /// Specifies the streaming buffer status. - /// - /// - /// - public enum MediaStreamBufferStatus - { - /// - /// Underrun. - /// - Underrun, - - /// - /// Completed. - /// - Overflow, - } - - /// - /// Specifies the reason for the playback interruption. - /// - /// - public enum PlaybackInterruptionReason - { - /// - /// Interrupted by a resource conflict and the will be unprepared automatically. - /// - ResourceConflict = 4 - } - - /// - /// Specifies keys for the metadata. - /// - /// - public enum StreamMetadataKey - { - /// - /// Album. - /// - Album, - - /// - /// Artists. - /// - Artist, - - /// - /// Author. - /// - Author, - - /// - /// Genre. - /// - Genre, - - /// - /// Title. - /// - Title, - - /// - /// Year. - /// - Year - } -} diff --git a/src/Tizen.Multimedia.MediaPlayer/Player/PlayerError.cs b/src/Tizen.Multimedia.MediaPlayer/Player/PlayerError.cs deleted file mode 100644 index a25bb4e1f..000000000 --- a/src/Tizen.Multimedia.MediaPlayer/Player/PlayerError.cs +++ /dev/null @@ -1,156 +0,0 @@ -/* - * 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.IO; -using Tizen.Internals.Errors; - -namespace Tizen.Multimedia -{ - internal enum PlayerErrorCode - { - None = ErrorCode.None, - InvalidArgument = ErrorCode.InvalidParameter, - OutOfMemory = ErrorCode.OutOfMemory, - NoSuchFile = ErrorCode.NoSuchFile, - InvalidOperation = ErrorCode.InvalidOperation, - NoSpaceOnDevice = ErrorCode.FileNoSpaceOnDevice, - FeatureNotSupported = ErrorCode.NotSupported, - PermissionDenied = ErrorCode.PermissionDenied, - NoBufferSpace = ErrorCode.BufferSpace, - TizenPlayerError = -0x01940000, - PlayerErrorClass = TizenPlayerError | 0x20, - SeekFailed = PlayerErrorClass | 0x01, - InvalidState = PlayerErrorClass | 0x02, - NotSupportedFile = PlayerErrorClass | 0x03, - InvalidUri = PlayerErrorClass | 0x04, - SoundPolicyError = PlayerErrorClass | 0x05, - ConnectionFailed = PlayerErrorClass | 0x06, - VideoCaptureFailed = PlayerErrorClass | 0x07, - DrmExpired = PlayerErrorClass | 0x08, - DrmNoLicense = PlayerErrorClass | 0x09, - DrmFutureUse = PlayerErrorClass | 0x0a, - DrmNotPermitted = PlayerErrorClass | 0x0b, - ResourceLimit = PlayerErrorClass | 0x0c, - ServiceDisconnected = PlayerErrorClass | 0x0d, - NotSupportedAudioCodec = PlayerErrorClass | 0x0e, - NotSupportedVideoCodec = PlayerErrorClass | 0x0f, - NotSupportedSubtitle = PlayerErrorClass | 0x10 - } - - internal static class PlayerErrorCodeExtensions - { - internal static void ThrowIfFailed(this PlayerErrorCode err, string message) - { - if (err == PlayerErrorCode.None) - { - return; - } - - throw err.GetException(message); - } - - internal static Exception GetException(this PlayerErrorCode err, string message) - { - if (err == PlayerErrorCode.None) - { - return null; - } - - string msg = $"{ (message ?? "Operation failed") } : { err.ToString() }."; - - switch (err) - { - case PlayerErrorCode.InvalidArgument: - case PlayerErrorCode.InvalidUri: - throw new ArgumentException(msg); - - case PlayerErrorCode.NoSuchFile: - throw new FileNotFoundException(msg); - - case PlayerErrorCode.OutOfMemory: - throw new OutOfMemoryException(msg); - - case PlayerErrorCode.NoSpaceOnDevice: - throw new IOException(msg); - - case PlayerErrorCode.PermissionDenied: - throw new UnauthorizedAccessException(msg); - - case PlayerErrorCode.NotSupportedFile: - throw new FileFormatException(msg); - - case PlayerErrorCode.FeatureNotSupported: - throw new NotSupportedException(msg); - - case PlayerErrorCode.DrmExpired: - case PlayerErrorCode.DrmNoLicense: - case PlayerErrorCode.DrmFutureUse: - case PlayerErrorCode.DrmNotPermitted: - // TODO consider another exception. - case PlayerErrorCode.InvalidOperation: - case PlayerErrorCode.InvalidState: - case PlayerErrorCode.SeekFailed: - case PlayerErrorCode.ConnectionFailed: - case PlayerErrorCode.VideoCaptureFailed: - throw new InvalidOperationException(msg); - - case PlayerErrorCode.NoBufferSpace: - throw new NoBufferSpaceException(msg); - - case PlayerErrorCode.ResourceLimit: - throw new ResourceLimitException(msg); - - case PlayerErrorCode.NotSupportedAudioCodec: - throw new CodecNotSupportedException(CodecKind.Audio); - - case PlayerErrorCode.NotSupportedVideoCodec: - throw new CodecNotSupportedException(CodecKind.Video); - - } - - throw new InvalidOperationException(msg); - } - } - - /// - /// The exception that is thrown when there is no available space in a buffer. - /// - public class NoBufferSpaceException : InvalidOperationException - { - /// - /// Initializes a new instance of the NoBufferSpaceException class with a specified error message. - /// - /// Error description. - public NoBufferSpaceException(string message) : base(message) - { - } - } - - /// - /// The exception that is thrown when there is no available resource for internal use. - /// - public class ResourceLimitException : InvalidOperationException - { - /// - /// Initializes a new instance of the ResourceLimitException class with a specified error message. - /// - /// Error description. - public ResourceLimitException(string message) : base(message) - { - } - } -} - diff --git a/src/Tizen.Multimedia.MediaPlayer/Player/PlayerErrorOccurredEventArgs.cs b/src/Tizen.Multimedia.MediaPlayer/Player/PlayerErrorOccurredEventArgs.cs deleted file mode 100644 index 7971ed42f..000000000 --- a/src/Tizen.Multimedia.MediaPlayer/Player/PlayerErrorOccurredEventArgs.cs +++ /dev/null @@ -1,48 +0,0 @@ -/* - * 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.Multimedia -{ - /// - /// Provides data for the event. - /// - public class PlayerErrorOccurredEventArgs : EventArgs - { - /// - /// Initializes a new instance of the PlayerErrorOccurredEventArgs class. - /// - /// The value indicating the kind of error occurred. - public PlayerErrorOccurredEventArgs(PlayerError error) - { - Error = error; - } - - /// - /// Gets the error. - /// - public PlayerError Error { get; } - - /// - /// Returns a string that represents the current object. - /// - /// A string that represents the current object. - public override string ToString() - { - return $"Error={ Error.ToString() }"; - } - } -} diff --git a/src/Tizen.Multimedia.MediaPlayer/Player/PlayerTrackInfo.cs b/src/Tizen.Multimedia.MediaPlayer/Player/PlayerTrackInfo.cs deleted file mode 100644 index d771fae88..000000000 --- a/src/Tizen.Multimedia.MediaPlayer/Player/PlayerTrackInfo.cs +++ /dev/null @@ -1,157 +0,0 @@ -/* - * 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.Diagnostics; -using System.Runtime.InteropServices; -using static Interop; - -namespace Tizen.Multimedia -{ - /// - /// Provides a means to retrieve the track information. - /// - /// - /// - public class PlayerTrackInfo - { - private readonly int _streamType; - private readonly Player _owner; - - internal PlayerTrackInfo(Player player, StreamType streamType) - { - Debug.Assert(player != null); - - Log.Debug(PlayerLog.Tag, "streamType : " + streamType); - _streamType = (int)streamType; - _owner = player; - } - - /// - /// Gets the number of tracks. - /// - /// The number of tracks. - /// - /// The that owns this instance must be in the , - /// , or state. - /// - /// The that this instance belongs to has been disposed of. - /// The that this instance belongs to is not in the valid state. - public int GetCount() - { - _owner.ValidatePlayerState(PlayerState.Ready, PlayerState.Playing, PlayerState.Paused); - - int count = 0; - NativePlayer.GetTrackCount(_owner.Handle, _streamType, out count). - ThrowIfFailed("Failed to get count of the track"); - Log.Info(PlayerLog.Tag, "get count : " + count); - return count; - } - - /// - /// Gets the language code for the specified index, or null if the language is undefined. - /// - /// The number of tracks. - /// - /// The that owns this instance must be in the , - /// , or state. - /// The language codes are defined in ISO 639-1. - /// - /// The that this instance belongs to has been disposed of. - /// The that this instance belongs to is not in the valid state. - /// - /// is less than zero.\n - /// -or-\n - /// is equal to or greater than - /// - public string GetLanguageCode(int index) - { - _owner.ValidatePlayerState(PlayerState.Ready, PlayerState.Playing, PlayerState.Paused); - - if (index < 0 || GetCount() <= index) - { - Log.Error(PlayerLog.Tag, "invalid index"); - throw new ArgumentOutOfRangeException(nameof(index), index, - $"valid index range is 0 <= x < {nameof(GetCount)}(), but got { index }."); - } - - IntPtr code = IntPtr.Zero; - - try - { - NativePlayer.GetTrackLanguageCode(_owner.Handle, _streamType, index, out code). - ThrowIfFailed("Failed to get the selected language of the player"); - - string result = Marshal.PtrToStringAnsi(code); - - if (result == "und") - { - Log.Error(PlayerLog.Tag, "not defined code"); - return null; - } - Log.Info(PlayerLog.Tag, "get language code : " + result); - return result; - } - finally - { - LibcSupport.Free(code); - } - } - - /// - /// Gets or sets the selected track index. - /// - /// The currently selected track index. - /// - /// The that owns this instance must be in the , - /// , or state. - /// - /// The that this instance belongs to has been disposed of. - /// The that this instance belongs to is not in the valid state. - /// - /// is less than zero.\n - /// -or-\n - /// is equal to or greater than - /// - public int Selected - { - get - { - _owner.ValidatePlayerState(PlayerState.Ready, PlayerState.Playing, PlayerState.Paused); - - int value = 0; - - NativePlayer.GetCurrentTrack(_owner.Handle, _streamType, out value). - ThrowIfFailed("Failed to get the selected index of the player"); - Log.Debug(PlayerLog.Tag, "get selected index : " + value); - return value; - } - set - { - if (value < 0 || GetCount() <= value) - { - Log.Error(PlayerLog.Tag, "invalid index"); - throw new ArgumentOutOfRangeException(nameof(value), value, - $"valid index range is 0 <= x < {nameof(GetCount)}(), but got { value }."); - } - - _owner.ValidatePlayerState(PlayerState.Ready, PlayerState.Playing, PlayerState.Paused); - - NativePlayer.SelectTrack(_owner.Handle, _streamType, value). - ThrowIfFailed("Failed to set the selected index of the player"); - } - } - } -} diff --git a/src/Tizen.Multimedia.MediaPlayer/Player/StreamInfo.cs b/src/Tizen.Multimedia.MediaPlayer/Player/StreamInfo.cs deleted file mode 100644 index b82ba0ced..000000000 --- a/src/Tizen.Multimedia.MediaPlayer/Player/StreamInfo.cs +++ /dev/null @@ -1,372 +0,0 @@ -/* - * 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; -using static Interop; - -namespace Tizen.Multimedia -{ - /// - /// Represents properties for the audio stream. - /// - public struct AudioStreamProperties - { - /// - /// Initializes a new instance of the AudioStreamProperties struct with the specified sample rate, channels, and bit rate. - /// - /// The sample rate of the stream. - /// The number of channels of the stream. - /// The bit rate of the stream. - public AudioStreamProperties(int sampleRate, int channels, int bitRate) - { - SampleRate = sampleRate; - Channels = channels; - BitRate = bitRate; - Log.Debug(PlayerLog.Tag, "sampleRate : " + sampleRate + ", channels : " + channels + ", bitRate : " + bitRate); - } - - /// - /// Gets or sets the sample rate. - /// - /// The audio sample rate(Hz). - public int SampleRate - { - get; - set; - } - - /// - /// Gets or sets the channels. - /// - public int Channels - { - get; - set; - } - - /// - /// Gets or sets the bit rate. - /// - /// The audio bit rate(Hz). - public int BitRate - { - get; - set; - } - - /// - /// Returns a string that represents the current object. - /// - /// A string that represents the current object. - public override string ToString() => - $"SampleRate={ SampleRate.ToString() }, Channels={ Channels.ToString() }, BitRate={ BitRate.ToString() }"; - } - - /// - /// Represents properties for the video stream. - /// - public struct VideoStreamProperties - { - /// - /// Initializes a new instance of the VideoStreamProperties struct with the specified fps, bit rate, and size. - /// - /// The fps of the stream. - /// The bit rate of the stream. - /// The size of the stream. - public VideoStreamProperties(int fps, int bitRate, Size size) - { - Fps = fps; - BitRate = bitRate; - Size = size; - Log.Debug(PlayerLog.Tag, "fps : " + fps + ", bitrate : " + bitRate + - ", width : " + size.Width + ", height : " + size.Height); - } - /// - /// Initializes a new instance of the VideoStreamProperties struct with the specified fps, bit rate, width, and height. - /// - /// The fps of the stream. - /// The bit rate of the stream. - /// The width of the stream. - /// The height of the stream. - public VideoStreamProperties(int fps, int bitRate, int width, int height) - { - Fps = fps; - BitRate = bitRate; - Size = new Size(width, height); - Log.Debug(PlayerLog.Tag, "fps : " + fps + ", bitrate : " + bitRate + - ", width : " + width + ", height : " + height); - } - - /// - /// Gets or sets the fps. - /// - public int Fps - { - get; - set; - } - /// - /// Gets or sets the bit rate. - /// - public int BitRate - { - get; - set; - } - - /// - /// Gets or sets the size. - /// - public Size Size - { - get; - set; - } - - /// - /// Returns a string that represents the current object. - /// - /// A string that represents the current object. - public override string ToString() - { - return $"Fps={ Fps.ToString() }, BitRate={ BitRate.ToString() }, Size=[{ Size.ToString() }]"; - } - } - - /// - /// Provides a means to retrieve stream information. - /// - public class StreamInfo - { - internal StreamInfo(Player owner) - { - Player = owner; - } - - /// - /// Retrieves the album art of the stream, or null if there is no album art data. - /// - /// Raw byte array if album art exists; otherwise null. - /// - /// The that owns this instance must be in the , - /// , or state. - /// - /// - /// The that this instance belongs to has been disposed of. - /// - /// - /// The that this instance belongs to is not in the valid state. - /// - public byte[] GetAlbumArt() - { - Player.ValidatePlayerState(PlayerState.Ready, PlayerState.Playing, PlayerState.Paused); - - NativePlayer.GetAlbumArt(Player.Handle, out var art, out var size). - ThrowIfFailed("Failed to get the album art"); - - if (art == IntPtr.Zero || size == 0) - { - Log.Error(PlayerLog.Tag, "art is null or size is 0 : " + size); - return null; - } - - byte[] albumArt = new byte[size]; - Marshal.Copy(art, albumArt, 0, size); - return albumArt; - } - - private string GetCodecInfo(bool audioInfo) - { - Player.ValidatePlayerState(PlayerState.Ready, PlayerState.Playing, PlayerState.Paused); - - IntPtr audioPtr = IntPtr.Zero; - IntPtr videoPtr = IntPtr.Zero; - try - { - NativePlayer.GetCodecInfo(Player.Handle, out audioPtr, out videoPtr). - ThrowIfFailed("Failed to get codec info"); - - if (audioInfo) - { - Log.Debug(PlayerLog.Tag, "it is audio case"); - return Marshal.PtrToStringAnsi(audioPtr); - } - else - { - Log.Debug(PlayerLog.Tag, "it is video case"); - return Marshal.PtrToStringAnsi(videoPtr); - } - } - finally - { - LibcSupport.Free(audioPtr); - LibcSupport.Free(videoPtr); - } - } - - /// - /// Retrieves the codec name of the audio or null if there is no audio. - /// - /// A string that represents the codec name. - public string GetAudioCodec() - { - return GetCodecInfo(true); - } - - /// - /// Retrieves the codec name of the video or null if there is no video. - /// - /// A string that represents the codec name. - public string GetVideoCodec() - { - return GetCodecInfo(false); - } - - /// - /// Gets the duration. - /// - /// The duration of the stream. - /// - /// The that owns this instance must be in the , - /// , or state. - /// - /// - /// The that this instance belongs to has been disposed of. - /// - /// - /// The that this instance belongs to is not in the valid state. - /// - public int GetDuration() - { - Player.ValidatePlayerState(PlayerState.Ready, PlayerState.Playing, PlayerState.Paused); - - int duration = 0; - NativePlayer.GetDuration(Player.Handle, out duration). - ThrowIfFailed("Failed to get the duration"); - - Log.Info(PlayerLog.Tag, "get duration : " + duration); - return duration; - } - - /// - /// Gets the properties of the audio. - /// - /// A that contains the audio stream information. - /// - /// The that owns this instance must be in the , - /// , or state. - /// - /// - /// The that this instance belongs to has been disposed of. - /// - /// - /// The that this instance belongs to is not in the valid state. - /// - public AudioStreamProperties GetAudioProperties() - { - Player.ValidatePlayerState(PlayerState.Ready, PlayerState.Playing, PlayerState.Paused); - - int sampleRate = 0; - int channels = 0; - int bitRate = 0; - - NativePlayer.GetAudioStreamInfo(Player.Handle, out sampleRate, out channels, out bitRate). - ThrowIfFailed("Failed to get audio stream info"); - - return new AudioStreamProperties(sampleRate, channels, bitRate); - } - - /// - /// Gets the properties of the video. - /// - /// A that contains the video stream information. - /// - /// The that owns this instance must be in the , - /// , or state. - /// - /// - /// The that this instance belongs to has been disposed of. - /// - /// - /// The that this instance belongs to is not in the valid state. - /// - public VideoStreamProperties GetVideoProperties() - { - Player.ValidatePlayerState(PlayerState.Ready, PlayerState.Playing, PlayerState.Paused); - - int fps = 0; - int bitRate = 0; - - NativePlayer.GetVideoStreamInfo(Player.Handle, out fps, out bitRate). - ThrowIfFailed("Failed to get the video stream info"); - - return new VideoStreamProperties(fps, bitRate, GetVideoSize()); - } - - private Size GetVideoSize() - { - Player.ValidatePlayerState(PlayerState.Ready, PlayerState.Playing, PlayerState.Paused); - - int height = 0; - int width = 0; - - NativePlayer.GetVideoSize(Player.Handle, out width, out height). - ThrowIfFailed("Failed to get the video size"); - - return new Size(width, height); - } - - /// - /// Gets the metadata with the specified key. - /// - /// A string that represents the value of the specified key. - /// The key to query. - /// - /// The that owns this instance must be in the , - /// , or state. - /// - /// The that this instance belongs to has been disposed of. - /// - /// - /// The that this instance belongs to is not in the valid state. - /// - public string GetMetadata(StreamMetadataKey key) - { - Player.ValidatePlayerState(PlayerState.Ready, PlayerState.Playing, PlayerState.Paused); - - ValidationUtil.ValidateEnum(typeof(StreamMetadataKey), key); - - IntPtr ptr = IntPtr.Zero; - - try - { - NativePlayer.GetContentInfo(Player.Handle, key, out ptr). - ThrowIfFailed($"Failed to get the meta data with the key '{ key }'"); - - return Marshal.PtrToStringAnsi(ptr); - } - finally - { - LibcSupport.Free(ptr); - } - } - - /// - /// Gets the that owns this instance. - /// - public Player Player { get; } - } -} diff --git a/src/Tizen.Multimedia.MediaPlayer/Player/SubtitleUpdatedEventArgs.cs b/src/Tizen.Multimedia.MediaPlayer/Player/SubtitleUpdatedEventArgs.cs deleted file mode 100644 index 0aad4525e..000000000 --- a/src/Tizen.Multimedia.MediaPlayer/Player/SubtitleUpdatedEventArgs.cs +++ /dev/null @@ -1,50 +0,0 @@ -/* - * 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.Multimedia -{ - /// - /// Provides data for the event. - /// - public class SubtitleUpdatedEventArgs : EventArgs - { - internal SubtitleUpdatedEventArgs(uint duration, string text) - { - Duration = duration; - Text = text; - } - - /// - /// Gets the duration of the updated subtitle. - /// - public uint Duration { get; } - - /// - /// Gets the text of the updated subtitle. - /// - public string Text { get; } - - /// - /// Returns a string that represents the current object. - /// - /// A string that represents the current object. - public override string ToString() - { - return $"Duration={ Duration.ToString() }, Text={ Text }"; - } - } -} diff --git a/src/Tizen.Multimedia.MediaPlayer/Player/VideoFrameDecodedEventArgs.cs b/src/Tizen.Multimedia.MediaPlayer/Player/VideoFrameDecodedEventArgs.cs deleted file mode 100644 index daa545dfc..000000000 --- a/src/Tizen.Multimedia.MediaPlayer/Player/VideoFrameDecodedEventArgs.cs +++ /dev/null @@ -1,39 +0,0 @@ -/* - * 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.Multimedia -{ - /// - /// Provides data for the event. - /// - public class VideoFrameDecodedEventArgs : EventArgs - { - /// - /// Initializes a new instance of the VideoFrameDecodedEventArgs class. - /// - internal VideoFrameDecodedEventArgs(MediaPacket packet) - { - Packet = packet; - } - - /// - /// Gets the packet containing the decoded frame. - /// - public MediaPacket Packet { get; } - - } -} diff --git a/src/Tizen.Multimedia.MediaPlayer/Player/VideoStreamChangedEventArgs.cs b/src/Tizen.Multimedia.MediaPlayer/Player/VideoStreamChangedEventArgs.cs deleted file mode 100644 index 40ca485d0..000000000 --- a/src/Tizen.Multimedia.MediaPlayer/Player/VideoStreamChangedEventArgs.cs +++ /dev/null @@ -1,59 +0,0 @@ -/* - * 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.Multimedia -{ - /// - /// Provides data for the event. - /// - public class VideoStreamChangedEventArgs : EventArgs - { - /// - /// Initializes a new instance of the VideoStreamChangedEventArgs class. - /// - internal VideoStreamChangedEventArgs(int height, int width, int fps, int bitRate) - { - Size = new Size(width, height); - Fps = fps; - BitRate = bitRate; - } - - /// - /// Gets the of the new video. - /// - public Size Size { get; } - - /// - /// Gets the fps of the new video - /// - public int Fps { get; } - - /// - /// Gets the bit rate of the new video. - /// - public int BitRate { get; } - - /// - /// Returns a string that represents the current object. - /// - /// A string that represents the current object. - public override string ToString() - { - return $"Size=({ Size.ToString() }), Fps={ Fps.ToString() }, BitRate={ BitRate.ToString() }"; - } - } -} diff --git a/src/Tizen.Multimedia.MediaPlayer/Tizen.Multimedia.MediaPlayer.csproj b/src/Tizen.Multimedia.MediaPlayer/Tizen.Multimedia.MediaPlayer.csproj deleted file mode 100644 index ec9bff774..000000000 --- a/src/Tizen.Multimedia.MediaPlayer/Tizen.Multimedia.MediaPlayer.csproj +++ /dev/null @@ -1,11 +0,0 @@ - - - - netstandard2.0 - - - - - - - \ No newline at end of file diff --git a/src/Tizen.Multimedia.MediaPlayer/Tizen.Multimedia.MediaPlayer.sln b/src/Tizen.Multimedia.MediaPlayer/Tizen.Multimedia.MediaPlayer.sln deleted file mode 100755 index 243eb41b8..000000000 --- a/src/Tizen.Multimedia.MediaPlayer/Tizen.Multimedia.MediaPlayer.sln +++ /dev/null @@ -1,72 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26730.12 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Multimedia.MediaPlayer", "Tizen.Multimedia.MediaPlayer.csproj", "{BB1AF9FB-C940-4623-B218-ECD1943169F8}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Multimedia", "..\Tizen.Multimedia\Tizen.Multimedia.csproj", "{A5AF369B-6E56-4B34-A3CF-0ED0A353B57F}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ElmSharp", "..\ElmSharp\ElmSharp.csproj", "{59D17ABA-9010-47B1-9147-195BCB8CC124}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.System.Information", "..\Tizen.System.Information\Tizen.System.Information.csproj", "{361E8A4D-5640-49E8-8524-4EB5409646DD}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen", "..\Tizen\Tizen.csproj", "{2B17A608-FCBB-49DB-B977-94E8FF160E1A}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Log", "..\Tizen.Log\Tizen.Log.csproj", "{61A19070-B8F4-4672-A77F-3A77762AD6DF}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.NUI", "..\Tizen.NUI\Tizen.NUI.csproj", "{4F3E9EBF-5B4E-4113-9394-EBBDA9F5951B}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.System.SystemSettings", "..\Tizen.System.SystemSettings\Tizen.System.SystemSettings.csproj", "{0B90CFD7-0154-4FA1-9253-7317B9469852}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Applications.Common", "..\Tizen.Applications.Common\Tizen.Applications.Common.csproj", "{88CA5588-ED50-40E9-80DC-F1DD34F4E52A}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {BB1AF9FB-C940-4623-B218-ECD1943169F8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {BB1AF9FB-C940-4623-B218-ECD1943169F8}.Debug|Any CPU.Build.0 = Debug|Any CPU - {BB1AF9FB-C940-4623-B218-ECD1943169F8}.Release|Any CPU.ActiveCfg = Release|Any CPU - {BB1AF9FB-C940-4623-B218-ECD1943169F8}.Release|Any CPU.Build.0 = Release|Any CPU - {A5AF369B-6E56-4B34-A3CF-0ED0A353B57F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A5AF369B-6E56-4B34-A3CF-0ED0A353B57F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A5AF369B-6E56-4B34-A3CF-0ED0A353B57F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A5AF369B-6E56-4B34-A3CF-0ED0A353B57F}.Release|Any CPU.Build.0 = Release|Any CPU - {59D17ABA-9010-47B1-9147-195BCB8CC124}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {59D17ABA-9010-47B1-9147-195BCB8CC124}.Debug|Any CPU.Build.0 = Debug|Any CPU - {59D17ABA-9010-47B1-9147-195BCB8CC124}.Release|Any CPU.ActiveCfg = Release|Any CPU - {59D17ABA-9010-47B1-9147-195BCB8CC124}.Release|Any CPU.Build.0 = Release|Any CPU - {361E8A4D-5640-49E8-8524-4EB5409646DD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {361E8A4D-5640-49E8-8524-4EB5409646DD}.Debug|Any CPU.Build.0 = Debug|Any CPU - {361E8A4D-5640-49E8-8524-4EB5409646DD}.Release|Any CPU.ActiveCfg = Release|Any CPU - {361E8A4D-5640-49E8-8524-4EB5409646DD}.Release|Any CPU.Build.0 = Release|Any CPU - {2B17A608-FCBB-49DB-B977-94E8FF160E1A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {2B17A608-FCBB-49DB-B977-94E8FF160E1A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {2B17A608-FCBB-49DB-B977-94E8FF160E1A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {2B17A608-FCBB-49DB-B977-94E8FF160E1A}.Release|Any CPU.Build.0 = Release|Any CPU - {61A19070-B8F4-4672-A77F-3A77762AD6DF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {61A19070-B8F4-4672-A77F-3A77762AD6DF}.Debug|Any CPU.Build.0 = Debug|Any CPU - {61A19070-B8F4-4672-A77F-3A77762AD6DF}.Release|Any CPU.ActiveCfg = Release|Any CPU - {61A19070-B8F4-4672-A77F-3A77762AD6DF}.Release|Any CPU.Build.0 = Release|Any CPU - {4F3E9EBF-5B4E-4113-9394-EBBDA9F5951B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {4F3E9EBF-5B4E-4113-9394-EBBDA9F5951B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {4F3E9EBF-5B4E-4113-9394-EBBDA9F5951B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {4F3E9EBF-5B4E-4113-9394-EBBDA9F5951B}.Release|Any CPU.Build.0 = Release|Any CPU - {0B90CFD7-0154-4FA1-9253-7317B9469852}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {0B90CFD7-0154-4FA1-9253-7317B9469852}.Debug|Any CPU.Build.0 = Debug|Any CPU - {0B90CFD7-0154-4FA1-9253-7317B9469852}.Release|Any CPU.ActiveCfg = Release|Any CPU - {0B90CFD7-0154-4FA1-9253-7317B9469852}.Release|Any CPU.Build.0 = Release|Any CPU - {88CA5588-ED50-40E9-80DC-F1DD34F4E52A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {88CA5588-ED50-40E9-80DC-F1DD34F4E52A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {88CA5588-ED50-40E9-80DC-F1DD34F4E52A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {88CA5588-ED50-40E9-80DC-F1DD34F4E52A}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {239AD666-133D-4D72-83C2-FD05704C52F7} - EndGlobalSection -EndGlobal diff --git a/src/Tizen.Multimedia.Metadata/Interop/Interop.Libc.cs b/src/Tizen.Multimedia.Metadata/Interop/Interop.Libc.cs deleted file mode 100644 index 8e0fa301f..000000000 --- a/src/Tizen.Multimedia.Metadata/Interop/Interop.Libc.cs +++ /dev/null @@ -1,27 +0,0 @@ -/* - * 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 Libc - { - [DllImport(Libraries.Libc, EntryPoint = "free")] - public static extern void Free(IntPtr userData); - } -} diff --git a/src/Tizen.Multimedia.Metadata/Interop/Interop.Libraries.cs b/src/Tizen.Multimedia.Metadata/Interop/Interop.Libraries.cs deleted file mode 100644 index df5d15592..000000000 --- a/src/Tizen.Multimedia.Metadata/Interop/Interop.Libraries.cs +++ /dev/null @@ -1,25 +0,0 @@ -/* - * 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 MetadataEditor = "libcapi-media-metadata-editor.so"; - public const string MetadataExtractor = "libcapi-media-metadata-extractor.so"; - public const string Libc = "libc.so.6"; - } -} diff --git a/src/Tizen.Multimedia.Metadata/Interop/Interop.MetadataEditor.cs b/src/Tizen.Multimedia.Metadata/Interop/Interop.MetadataEditor.cs deleted file mode 100644 index 6d5477930..000000000 --- a/src/Tizen.Multimedia.Metadata/Interop/Interop.MetadataEditor.cs +++ /dev/null @@ -1,52 +0,0 @@ -/* - * 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; -using Tizen.Multimedia; - -internal static partial class Interop -{ - internal static partial class MetadataEditor - { - [DllImport(Libraries.MetadataEditor, EntryPoint = "metadata_editor_create")] - internal static extern MetadataEditorError Create(out IntPtr handle); - - [DllImport(Libraries.MetadataEditor, EntryPoint = "metadata_editor_set_path")] - internal static extern MetadataEditorError SetPath(IntPtr handle, string path); - - [DllImport(Libraries.MetadataEditor, EntryPoint = "metadata_editor_destroy")] - internal static extern MetadataEditorError Destroy(IntPtr handle); - - [DllImport(Libraries.MetadataEditor, EntryPoint = "metadata_editor_get_metadata")] - internal static extern MetadataEditorError GetMetadata(IntPtr handle, MetadataEditorAttr attribute, out IntPtr value); - - [DllImport(Libraries.MetadataEditor, EntryPoint = "metadata_editor_set_metadata")] - internal static extern MetadataEditorError SetMetadata(IntPtr handle, MetadataEditorAttr attribute, string value); - - [DllImport(Libraries.MetadataEditor, EntryPoint = "metadata_editor_update_metadata")] - internal static extern MetadataEditorError UpdateMetadata(IntPtr handle); - - [DllImport(Libraries.MetadataEditor, EntryPoint = "metadata_editor_get_picture")] - internal static extern MetadataEditorError GetPicture(IntPtr handle, int index, out IntPtr picture, out int size, out IntPtr mimeType); - - [DllImport(Libraries.MetadataEditor, EntryPoint = "metadata_editor_append_picture")] - internal static extern MetadataEditorError AddPicture(IntPtr handle, string path); - - [DllImport(Libraries.MetadataEditor, EntryPoint = "metadata_editor_remove_picture")] - internal static extern MetadataEditorError RemovePicture(IntPtr handle, int index); - } -} diff --git a/src/Tizen.Multimedia.Metadata/Interop/Interop.MetadataExtractor.cs b/src/Tizen.Multimedia.Metadata/Interop/Interop.MetadataExtractor.cs deleted file mode 100644 index d79e0dde2..000000000 --- a/src/Tizen.Multimedia.Metadata/Interop/Interop.MetadataExtractor.cs +++ /dev/null @@ -1,71 +0,0 @@ -/* - * 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; -using Tizen.Multimedia; - -internal static partial class Interop -{ - internal static partial class MetadataExtractor - { - [DllImport(Libraries.MetadataExtractor, EntryPoint = "metadata_extractor_create")] - internal static extern MetadataExtractorError Create(out IntPtr handle); - - [DllImport(Libraries.MetadataExtractor, EntryPoint = "metadata_extractor_set_path")] - internal static extern MetadataExtractorError SetPath(IntPtr handle, string path); - - [DllImport(Libraries.MetadataExtractor, EntryPoint = "metadata_extractor_set_buffer")] - internal static extern MetadataExtractorError SetBuffer(IntPtr handle, IntPtr buffer, int size); - - [DllImport(Libraries.MetadataExtractor, EntryPoint = "metadata_extractor_destroy")] - internal static extern MetadataExtractorError Destroy(IntPtr handle); - - [DllImport(Libraries.MetadataExtractor, EntryPoint = "metadata_extractor_get_metadata")] - private static extern MetadataExtractorError GetMetadata(IntPtr handle, MetadataExtractorAttr attribute, out IntPtr value); - - internal static string GetMetadata(IntPtr handle, MetadataExtractorAttr attr) - { - IntPtr valuePtr = IntPtr.Zero; - - try - { - var ret = GetMetadata(handle, attr, out valuePtr); - MetadataExtractorRetValidator.ThrowIfError(ret, "Failed to get value for " + attr); - return Marshal.PtrToStringAnsi(valuePtr); - } - finally - { - Libc.Free(valuePtr); - } - } - - [DllImport(Libraries.MetadataExtractor, EntryPoint = "metadata_extractor_get_artwork")] - internal static extern MetadataExtractorError GetArtwork(IntPtr handle, out IntPtr artwork, - out int size, out IntPtr mimeType); - - [DllImport(Libraries.MetadataExtractor, EntryPoint = "metadata_extractor_get_frame")] - internal static extern MetadataExtractorError GetFrame(IntPtr handle, out IntPtr frame, out int size); - - [DllImport(Libraries.MetadataExtractor, EntryPoint = "metadata_extractor_get_synclyrics")] - internal static extern MetadataExtractorError GetSynclyrics(IntPtr handle, int index, - out uint timeStamp, out IntPtr lyrics); - - [DllImport(Libraries.MetadataExtractor, EntryPoint = "metadata_extractor_get_frame_at_time")] - internal static extern MetadataExtractorError GetFrameAtTime(IntPtr handle, uint timeStamp, - bool isAccurate, out IntPtr frame, out int size); - } -} diff --git a/src/Tizen.Multimedia.Metadata/MetadataEditor/MetadataEditor.cs b/src/Tizen.Multimedia.Metadata/MetadataEditor/MetadataEditor.cs deleted file mode 100755 index 9510cb3f2..000000000 --- a/src/Tizen.Multimedia.Metadata/MetadataEditor/MetadataEditor.cs +++ /dev/null @@ -1,536 +0,0 @@ -/* - * 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.IO; -using System.Runtime.InteropServices; - -namespace Tizen.Multimedia -{ - /// - /// Provides a means to edit the metadata of the media file. - /// - /// - /// If you want to access only an internal storage, - /// you should add privilege http://tizen.org/privilege/mediastorage. \n - /// Or if you want to access only an external storage, - /// you should add privilege http://tizen.org/privilege/externalstorage. \n - /// - public class MetadataEditor : IDisposable - { - private bool _disposed = false; - private IntPtr _handle = IntPtr.Zero; - private bool _isFileReadOnly; - - private IntPtr Handle - { - get - { - if (_handle == IntPtr.Zero) - { - throw new ObjectDisposedException(nameof(MetadataEditor)); - } - - return _handle; - } - } - - /// - /// Initializes a new instance of the class with the specified path. - /// - /// 3 - /// The path of the media file to edit the metadata. - /// is null. - /// is a zero-length string, contains only white space. - /// The file is not supported. - /// The file does not exist. - /// The caller does not have required privilege to access the file. - public MetadataEditor(string path) - { - if (path == null) - { - throw new ArgumentNullException(nameof(path)); - } - - if (string.IsNullOrWhiteSpace(path)) - { - throw new ArgumentException($"{nameof(path)} is a zero-length string.", nameof(path)); - } - - Interop.MetadataEditor.Create(out _handle).ThrowIfError("Failed to create metadata"); - - try - { - Interop.MetadataEditor.SetPath(Handle, path).ThrowIfError("Failed to set path"); - - _isFileReadOnly = File.GetAttributes(path).HasFlag(FileAttributes.ReadOnly); - } - catch (Exception) - { - Interop.MetadataEditor.Destroy(_handle); - throw; - } - } - - private string GetParam(MetadataEditorAttr attr) - { - IntPtr val = IntPtr.Zero; - - try - { - Interop.MetadataEditor.GetMetadata(Handle, attr, out val) - .ThrowIfError("Failed to get metadata"); - - return Marshal.PtrToStringAnsi(val); - } - finally - { - Interop.Libc.Free(val); - } - } - - private void SetParam(MetadataEditorAttr attr, string value) - { - if (_isFileReadOnly) - { - throw new InvalidOperationException("The media file is read-only."); - } - - Interop.MetadataEditor.SetMetadata(Handle, attr, value).ThrowIfError("Failed to set value"); - } - - /// - /// Gets or sets the artist of media. - /// - /// 3 - /// The file is read-only. - /// The has already been disposed of. - public string Artist - { - get - { - return GetParam(MetadataEditorAttr.Artist); - } - - set - { - SetParam(MetadataEditorAttr.Artist, value); - } - } - - /// - /// Gets or sets the title of media. - /// - /// 3 - /// The file is read-only. - /// The has already been disposed of. - public string Title - { - get - { - return GetParam(MetadataEditorAttr.Title); - } - - set - { - SetParam(MetadataEditorAttr.Title, value); - } - } - - /// - /// Gets or sets the album name of media. - /// - /// 3 - /// The file is read-only. - /// The has already been disposed of. - public string Album - { - get - { - return GetParam(MetadataEditorAttr.Album); - } - - set - { - SetParam(MetadataEditorAttr.Album, value); - } - } - - /// - /// Gets or sets the genre of media. - /// - /// 3 - /// The file is read-only. - /// The has already been disposed of. - public string Genre - { - get - { - return GetParam(MetadataEditorAttr.Genre); - } - - set - { - SetParam(MetadataEditorAttr.Genre, value); - } - } - - /// - /// Gets or sets the author of media. - /// - /// 3 - /// The file is read-only. - /// The has already been disposed of. - public string Author - { - get - { - return GetParam(MetadataEditorAttr.Author); - } - - set - { - SetParam(MetadataEditorAttr.Author, value); - } - } - - /// - /// Gets or sets the copyright of media. - /// - /// 3 - /// The file is read-only. - /// The has already been disposed of. - public string Copyright - { - get - { - return GetParam(MetadataEditorAttr.Copyright); - } - - set - { - SetParam(MetadataEditorAttr.Copyright, value); - } - } - - /// - /// Gets or sets the date of media. - /// - /// 3 - /// - /// If the media contains the ID3 tag, this refers to the recorded date. - /// If the media is a mp4 format, this refers to the year, and the value to set will be converted into integer. - /// - /// The file is read-only. - /// The has already been disposed of. - public string Date - { - get - { - return GetParam(MetadataEditorAttr.Date); - } - - set - { - SetParam(MetadataEditorAttr.Date, value); - } - } - - /// - /// Gets or sets the description of media. - /// - /// 3 - /// The file is read-only. - /// The has already been disposed of. - public string Description - { - get - { - return GetParam(MetadataEditorAttr.Description); - } - - set - { - SetParam(MetadataEditorAttr.Description, value); - } - } - - /// - /// Gets or sets the comment of media. - /// - /// 3 - /// The file is read-only. - /// The has already been disposed of. - public string Comment - { - get - { - return GetParam(MetadataEditorAttr.Comment); - } - - set - { - SetParam(MetadataEditorAttr.Comment, value); - } - } - - /// - /// Gets or sets the track number of media. - /// - /// 3 - /// The file is read-only. - /// The has already been disposed of. - public string TrackNumber - { - get - { - return GetParam(MetadataEditorAttr.TrackNumber); - } - - set - { - SetParam(MetadataEditorAttr.TrackNumber, value); - } - } - - /// - /// Gets the count of album arts of media. - /// - /// 3 - /// The has already been disposed of. - public int PictureCount - { - get => int.TryParse(GetParam(MetadataEditorAttr.PictureCount), out var value) ? value : 0; - } - - /// - /// Gets or sets the conductor of media. - /// - /// 3 - /// The file is read-only. - /// The has already been disposed of. - public string Conductor - { - get - { - return GetParam(MetadataEditorAttr.Conductor); - } - - set - { - SetParam(MetadataEditorAttr.Conductor, value); - } - } - - /// - /// Gets or sets the unsynchronized lyrics of media. - /// - /// 3 - /// The file is read-only. - /// The has already been disposed of. - public string UnsyncLyrics - { - get - { - return GetParam(MetadataEditorAttr.UnsyncLyrics); - } - - set - { - SetParam(MetadataEditorAttr.UnsyncLyrics, value); - } - } - - /// - /// Writes the modified metadata to the media file. - /// - /// - /// An internal error occurs.\n - /// -or-\n - /// The file is read-only. - /// - /// The has already been disposed of. - public void Commit() - { - if (_isFileReadOnly) - { - throw new InvalidOperationException("The media file is read-only."); - } - - Interop.MetadataEditor.UpdateMetadata(Handle).ThrowIfError("Failed to update file"); - } - - /// - /// Gets the artwork image in the media file. - /// - /// 3 - /// The index of the picture to import. - /// The artwork included in the media file. - /// An internal error occurs. - /// - /// is less than zero.\n - /// -or-\n - /// is greater than or equal to .\n - /// - /// The has already been disposed of. - public Artwork GetPicture(int index) - { - if (index < 0) - { - throw new ArgumentOutOfRangeException(nameof(index), index, - "Index should not be less than zero."); - } - - if (index >= PictureCount) - { - throw new ArgumentOutOfRangeException(nameof(index), index, - "Index should not be greater thor or equal to PictureCount."); - } - - IntPtr data = IntPtr.Zero; - IntPtr mimeType = IntPtr.Zero; - - try - { - Interop.MetadataEditor.GetPicture(Handle, index, out data, out var size, out mimeType). - ThrowIfError("Failed to get the value"); - - if (size > 0) - { - byte[] tmpBuf = new byte[size]; - Marshal.Copy(data, tmpBuf, 0, size); - - return new Artwork(tmpBuf, Marshal.PtrToStringAnsi(mimeType)); - } - - return null; - } - finally - { - if (data != IntPtr.Zero) - { - Interop.Libc.Free(data); - } - - if (mimeType != IntPtr.Zero) - { - Interop.Libc.Free(mimeType); - } - } - } - - /// - /// Appends the picture to the media file. - /// - /// 3 - /// The path of the picture for adding to the metadata. - /// - /// An internal error occurs.\n - /// -or-\n - /// The media file is read-only. - /// - /// is null - /// The file does not exist. - /// The caller does not have required privilege to access the file. - /// The has already been disposed of. - /// The specified file is not supported. - public void AddPicture(string path) - { - if (path == null) - { - throw new ArgumentNullException(nameof(path)); - } - - if (File.Exists(path) == false) - { - throw new FileNotFoundException("File does not exist.", path); - } - - if (_isFileReadOnly) - { - throw new InvalidOperationException("The media file is read-only."); - } - - Interop.MetadataEditor.AddPicture(Handle, path). - ThrowIfError("Failed to append picture"); - } - - /// - /// Removes the picture from the media file. - /// - /// 3 - /// The index of the picture to remove. - /// - /// An internal error occurs.\n - /// -or-\n - /// The media file is read-only. - /// - /// - /// is less than zero.\n - /// -or-\n - /// is greater than or equal to .\n - /// - /// The has already been disposed of. - public void RemovePicture(int index) - { - if (index < 0) - { - throw new ArgumentOutOfRangeException("Index should be larger than 0 [" + index + "]"); - } - - if (index >= PictureCount) - { - throw new ArgumentOutOfRangeException(nameof(index), index, - "Index should not be greater thor or equal to PictureCount."); - } - - if (_isFileReadOnly) - { - throw new InvalidOperationException("The media file is read-only."); - } - - Interop.MetadataEditor.RemovePicture(Handle, index).ThrowIfError("Failed to remove picture"); - } - - ~MetadataEditor() - { - Dispose(false); - } - - protected virtual void Dispose(bool disposing) - { - if (!_disposed) - { - if (_handle != IntPtr.Zero) - { - Interop.MetadataEditor.Destroy(_handle); - _handle = IntPtr.Zero; - } - - _disposed = true; - } - } - - /// - /// Releases all resources used by the object. - /// - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - } -} diff --git a/src/Tizen.Multimedia.Metadata/MetadataEditor/MetadataEditorAttr.cs b/src/Tizen.Multimedia.Metadata/MetadataEditor/MetadataEditorAttr.cs deleted file mode 100644 index 2c9a01895..000000000 --- a/src/Tizen.Multimedia.Metadata/MetadataEditor/MetadataEditorAttr.cs +++ /dev/null @@ -1,35 +0,0 @@ -/* - * 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. - */ - -namespace Tizen.Multimedia -{ - internal enum MetadataEditorAttr - { - Artist, - Title, - Album, - Genre, - Author, - Copyright, - Date, - Description, - Comment, - TrackNumber, - PictureCount, - Conductor, - UnsyncLyrics, - } -} \ No newline at end of file diff --git a/src/Tizen.Multimedia.Metadata/MetadataEditor/MetadataEditorError.cs b/src/Tizen.Multimedia.Metadata/MetadataEditor/MetadataEditorError.cs deleted file mode 100644 index 7ae16805e..000000000 --- a/src/Tizen.Multimedia.Metadata/MetadataEditor/MetadataEditorError.cs +++ /dev/null @@ -1,70 +0,0 @@ -/* - * 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.IO; -using Tizen.Internals.Errors; - -namespace Tizen.Multimedia -{ - /// - /// Enumeration for the metadata extractor's error codes. - /// - internal enum MetadataEditorError - { - None = ErrorCode.None, - InvalidParameter = ErrorCode.InvalidParameter, - OutOfMemory = ErrorCode.OutOfMemory, - FileNotExists = ErrorCode.FileExists, - PermissionDenied = ErrorCode.PermissionDenied, - NotSupported = ErrorCode.NotSupported, - TizenMetadataEditorError = -0x019C0000, - OperationFailed = TizenMetadataEditorError | 0x01 - } - - internal static class MetadataEditorErrorExtensions - { - internal static void ThrowIfError(this MetadataEditorError errorCode, string errorMessage) - { - if (errorCode == MetadataEditorError.None) - { - return; - } - - switch (errorCode) - { - case MetadataEditorError.InvalidParameter: - throw new ArgumentException(errorMessage); - - case MetadataEditorError.OutOfMemory: - throw new OutOfMemoryException(errorMessage); - - case MetadataEditorError.FileNotExists: - throw new FileNotFoundException(errorMessage); - - case MetadataEditorError.PermissionDenied: - throw new UnauthorizedAccessException(errorMessage); - - case MetadataEditorError.NotSupported: - throw new FileFormatException(errorMessage); - - case MetadataEditorError.OperationFailed: - throw new InvalidOperationException(errorMessage); - } - } - } -} - diff --git a/src/Tizen.Multimedia.Metadata/MetadataExtractor/Artwork.cs b/src/Tizen.Multimedia.Metadata/MetadataExtractor/Artwork.cs deleted file mode 100755 index 38afe72a9..000000000 --- a/src/Tizen.Multimedia.Metadata/MetadataExtractor/Artwork.cs +++ /dev/null @@ -1,48 +0,0 @@ -/* - * 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. - */ - -namespace Tizen.Multimedia -{ - /// - /// Represents the artwork information of the media. - /// - public class Artwork - { - /// - /// Initializes a new instance of the Artwork class with the specified data and the mime type. - /// - /// 3 - /// The data of the artwork to set the metadata. - /// The mime type of the data of the artwork. - public Artwork(byte[] data, string mimeType) - { - Data = data; - MimeType = mimeType; - } - - /// - /// Gets the encoded artwork image. - /// - /// 3 - public byte[] Data { get; } - - /// - /// Gets the mime type of the artwork. - /// - /// 3 - public string MimeType { get; } - } -} diff --git a/src/Tizen.Multimedia.Metadata/MetadataExtractor/Metadata.cs b/src/Tizen.Multimedia.Metadata/MetadataExtractor/Metadata.cs deleted file mode 100755 index 11b33af29..000000000 --- a/src/Tizen.Multimedia.Metadata/MetadataExtractor/Metadata.cs +++ /dev/null @@ -1,398 +0,0 @@ -/* - * 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.Diagnostics; -using static Interop.MetadataExtractor; - -namespace Tizen.Multimedia -{ - /// - /// Represents the video metadata information. - /// - public class VideoMetadata - { - private VideoMetadata(int streamCount, IntPtr handle) - { - Debug.Assert(streamCount > 0); - Debug.Assert(handle != IntPtr.Zero); - - StreamCount = streamCount; - BitRate = ValueConverter.ToNullableInt(GetMetadata(handle, MetadataExtractorAttr.VideoBitrate)); - Fps = ValueConverter.ToNullableInt(GetMetadata(handle, MetadataExtractorAttr.VideoFps)); - Width = ValueConverter.ToNullableInt(GetMetadata(handle, MetadataExtractorAttr.VideoWidth)); - Height = ValueConverter.ToNullableInt(GetMetadata(handle, MetadataExtractorAttr.VideoHeight)); - Codec = GetMetadata(handle, MetadataExtractorAttr.VideoCodec); - - _description = new Lazy(() => ObjectDescriptionBuilder.BuildWithProperties(this)); - } - - internal static VideoMetadata From(IntPtr handle) - { - var streamCount = ValueConverter.ToInt(GetMetadata(handle, MetadataExtractorAttr.VideoStreamCount)); - - return streamCount > 0 ? new VideoMetadata(streamCount, handle) : null; - } - - /// - /// Gets the bitrate. - /// - /// 3 - /// The bitrate value, or null if the information does not exist. - public int? BitRate { get; } - - /// - /// Gets the video fps. - /// - /// 3 - /// The fps value, or null if the information does not exist. - public int? Fps { get; } - - /// - /// Gets the width of the video. - /// - /// 3 - /// The width value, or null if the information does not exist. - public int? Width { get; } - - /// - /// Gets the height of the video. - /// - /// 3 - /// The height value, or null if the information does not exist. - public int? Height { get; } - - /// - /// Gets the codec type of the video. - /// - /// 3 - /// A string representing the codec type, or null if the information does not exist. - public string Codec { get; } - - /// - /// Gets the video stream count. - /// - /// 3 - /// The number of video streams. - public int StreamCount { get; } - - private Lazy _description; - - public override string ToString() - { - return _description.Value; - } - - } - - /// - /// Represents the audio metadata information. - /// - public class AudioMetadata - { - private AudioMetadata(int streamCount, IntPtr handle) - { - Debug.Assert(streamCount > 0); - Debug.Assert(handle != IntPtr.Zero); - - StreamCount = streamCount; - BitRate = ValueConverter.ToNullableInt(GetMetadata(handle, MetadataExtractorAttr.AudioBitrate)); - Channels = ValueConverter.ToNullableInt(GetMetadata(handle, MetadataExtractorAttr.AudioChannels)); - SampleRate = ValueConverter.ToNullableInt(GetMetadata(handle, MetadataExtractorAttr.AudioSamplerate)); - BitPerSample = ValueConverter.ToNullableInt(GetMetadata(handle, MetadataExtractorAttr.AudioBitPerSample)); - Codec = GetMetadata(handle, MetadataExtractorAttr.AudioCodec); - - _description = new Lazy(() => ObjectDescriptionBuilder.BuildWithProperties(this)); - } - - internal static AudioMetadata From(IntPtr handle) - { - var streamCount = ValueConverter.ToInt(GetMetadata(handle, MetadataExtractorAttr.AudioStreamCount)); - - return streamCount > 0 ? new AudioMetadata(streamCount, handle) : null; - } - - /// - /// Gets the audio bitrate. - /// - /// 3 - /// The bit rate value, or null if the information does not exist. - public int? BitRate { get; } - - /// - /// Gets the audio channels. - /// - /// 3 - /// The number of the audio channels, or null if the information does not exist. - public int? Channels { get; } - - /// - /// Gets the audio sample rate. - /// - /// 3 - /// The sample rate, or null if the information does not exist. - public int? SampleRate { get; } - - /// - /// Gets the bit per sample of the audio. - /// - /// 3 - /// The bit per sample, or null if the information does not exist. - public int? BitPerSample { get; } - - /// - /// Gets the audio stream count. - /// - /// 3 - /// The number of audio streams. - public int StreamCount { get; } - - /// - /// Gets the audio codec type. - /// - /// 3 - public string Codec { get; } - - private Lazy _description; - - public override string ToString() - { - return _description.Value; - } - } - - /// - /// Represents the metadata information of a media. - /// - public class Metadata - { - internal Metadata(IntPtr handle) - { - Debug.Assert(handle != IntPtr.Zero); - - Video = VideoMetadata.From(handle); - Audio = AudioMetadata.From(handle); - - Duration = ValueConverter.ToNullableInt(GetMetadata(handle, MetadataExtractorAttr.Duration)); - Artist = GetMetadata(handle, MetadataExtractorAttr.Artist); - Title = GetMetadata(handle, MetadataExtractorAttr.Title); - Album = GetMetadata(handle, MetadataExtractorAttr.Album); - AlbumArtist = GetMetadata(handle, MetadataExtractorAttr.AlbumArtist); - Genre = GetMetadata(handle, MetadataExtractorAttr.Genre); - Author = GetMetadata(handle, MetadataExtractorAttr.Author); - Copyright = GetMetadata(handle, MetadataExtractorAttr.Copyright); - DateReleased = GetMetadata(handle, MetadataExtractorAttr.ReleaseDate); - Description = GetMetadata(handle, MetadataExtractorAttr.Description); - Comment = GetMetadata(handle, MetadataExtractorAttr.Comment); - TrackNumber = GetMetadata(handle, MetadataExtractorAttr.TrackNum); - Classification = GetMetadata(handle, MetadataExtractorAttr.Classification); - Rating = GetMetadata(handle, MetadataExtractorAttr.Rating); - Longitude = ValueConverter.ToNullableDouble(GetMetadata(handle, MetadataExtractorAttr.Longitude)); - Latitude = ValueConverter.ToNullableDouble(GetMetadata(handle, MetadataExtractorAttr.Latitude)); - Altitude = ValueConverter.ToNullableDouble(GetMetadata(handle, MetadataExtractorAttr.Altitude)); - Conductor = GetMetadata(handle, MetadataExtractorAttr.Conductor); - UnsyncLyrics = GetMetadata(handle, MetadataExtractorAttr.UnSyncLyrics); - SyncLyricsCount = ValueConverter.ToInt(GetMetadata(handle, MetadataExtractorAttr.SyncLyricsNum)); - DateRecorded = GetMetadata(handle, MetadataExtractorAttr.RecordingDate); - Rotation = GetMetadata(handle, MetadataExtractorAttr.Rotate); - Content360 = GetMetadata(handle, MetadataExtractorAttr.ContentFor360); - - _description = new Lazy(() => ObjectDescriptionBuilder.BuildWithProperties(this)); - } - - /// - /// Gets the duration of the media. - /// - /// 3 - /// The duration value, or null if the information does not exist. - public int? Duration { get; } - - /// - /// Gets the video metadata. - /// - /// 3 - /// The video metadata, or null if the information does not exist. - public VideoMetadata Video { get; } - - /// - /// Gets the audio metadata. - /// - /// 3 - /// The audio metadata, or null if the information does not exist. - public AudioMetadata Audio { get; } - - /// - /// Gets the artist of the media. - /// - /// 3 - /// A string representing the artist, or null if the information does not exist. - public string Artist { get; } - - /// - /// Gets the title of the media. - /// - /// 3 - /// A string representing the title, or null if the information does not exist. - public string Title { get; } - - /// - /// Gets the album name of the media. - /// - /// 3 - /// A string representing the album name, or null if the information does not exist. - public string Album { get; } - - /// - /// Gets the album artist of the media. - /// - /// 3 - /// A string representing the album artist, or null if the information does not exist. - public string AlbumArtist { get; } - - /// - /// Gets the genre of the media. - /// - /// 3 - /// A string representing the genre, or null if the information does not exist. - public string Genre { get; } - - /// - /// Gets the author of the media. - /// - /// 3 - /// A string representing the author, or null if the information does not exist. - public string Author { get; } - - /// - /// Gets the copyright of the media. - /// - /// 3 - /// A string representing the copyright, or null if the information does not exist. - public string Copyright { get; } - - /// - /// Gets the release date of the media. - /// - /// 3 - /// A string representing the release date, or null if the information does not exist. - public string DateReleased { get; } - - /// - /// Gets the description of the media. - /// - /// 3 - /// A string representing the description, or null if the information does not exist. - public string Description { get; } - - /// - /// Gets the comment of the media. - /// - /// 3 - /// A string representing the comment, or null if the information does not exist. - public string Comment { get; } - - /// - /// Gets the track number of the media. - /// - /// 3 - /// A string representing the track number, or null if the information does not exist. - public string TrackNumber { get; } - - /// - /// Gets the classification of the media. - /// - /// 3 - /// A string representing the classification, or null if the information does not exist. - public string Classification { get; } - - /// - /// Gets the rating of the media. - /// - /// 3 - /// A string representing the rating, or null if the information does not exist. - public string Rating { get; } - - /// - /// Gets the longitude of the media. - /// - /// 3 - /// The longitude value, or null if the information does not exist. - public double? Longitude { get; } - - /// - /// Gets the latitude of the media. - /// - /// 3 - /// The latitude value, or null if the information does not exist. - public double? Latitude { get; } - - /// - /// Gets the altitude of the media. - /// - /// 3 - /// The altitude value, or null if the information does not exist. - public double? Altitude { get; } - - /// - /// Gets the conductor of the media. - /// - /// 3 - /// A string representing the conductor, or null if the information does not exist. - public string Conductor { get; } - - /// - /// Gets the unsynchronized lyrics of the media. - /// - /// 3 - /// A string representing the unsynchronized lyrics, or null if the information does not exist. - public string UnsyncLyrics { get; } - - /// - /// Gets the number of synchronized lyrics of the media. - /// - /// 3 - /// The number of the synchronized lyrics. - public int SyncLyricsCount { get; } - - /// - /// Gets the recording date of the media. - /// - /// 3 - /// A string representing the recording date, or null if the information does not exist. - public string DateRecorded { get; } - - /// - /// Gets the rotate(orientation) information of the media. - /// - /// 3 - /// A string representing the rotation information, or null if the information does not exist. - public string Rotation { get; } - - /// - /// Gets the information for 360 content of the media. - /// - /// 3 - /// A string representing the information for 360 content, or null if the information does not exist. - public string Content360 { get; } - - private Lazy _description; - - public override string ToString() - { - return _description.Value; - } - } -} diff --git a/src/Tizen.Multimedia.Metadata/MetadataExtractor/MetadataExtractor.cs b/src/Tizen.Multimedia.Metadata/MetadataExtractor/MetadataExtractor.cs deleted file mode 100755 index 3086a9b43..000000000 --- a/src/Tizen.Multimedia.Metadata/MetadataExtractor/MetadataExtractor.cs +++ /dev/null @@ -1,315 +0,0 @@ -/* - * 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.IO; -using System.Runtime.InteropServices; - -namespace Tizen.Multimedia -{ - static internal class MetadataExtractorLog - { - internal const string Tag = "Tizen.Multimedia.MetadataExtractor"; - } - - /// - /// Provides a means to get the metadata from a media file. - /// - public class MetadataExtractor : IDisposable - { - private bool _disposed = false; - private IntPtr _handle = IntPtr.Zero; - private IntPtr _buffer = IntPtr.Zero; - - private void Create(Func initFunc) - { - MetadataExtractorRetValidator.ThrowIfError( - Interop.MetadataExtractor.Create(out _handle), "Failed to create metadata"); - - try - { - MetadataExtractorRetValidator.ThrowIfError(initFunc(), "Failed to init"); - - _metadata = new Lazy(() => new Metadata(Handle)); - } - catch - { - Release(); - throw; - } - } - - /// - /// Initializes a new instance of the MetadataExtractor class with the specified path. - /// - /// 3 - /// The path for the file to extract the metadata. - /// is null. - /// does not exist. - public MetadataExtractor(string path) - { - if (path == null) - { - throw new ArgumentNullException(nameof(path)); - } - - Create(() => Interop.MetadataExtractor.SetPath(_handle, path)); - } - - /// - /// Initializes a new instance of the MetadataExtractor class with the specified buffer. - /// - /// 3 - /// The buffer to extract the metadata. - /// is null. - /// The length of is zero. - public MetadataExtractor(byte[] buffer) - { - if (buffer == null) - { - throw new ArgumentNullException(nameof(buffer)); - } - - if (buffer.Length == 0) - { - throw new ArgumentException("buffer length is zero.", nameof(buffer)); - } - - _buffer = Marshal.AllocHGlobal(buffer.Length); - Marshal.Copy(buffer, 0, _buffer, buffer.Length); - - try - { - Create(() => Interop.MetadataExtractor.SetBuffer(_handle, _buffer, buffer.Length)); - } - catch (Exception) - { - Marshal.FreeHGlobal(_buffer); - throw; - } - } - - private IntPtr Handle - { - get - { - if (_disposed) - { - throw new ObjectDisposedException(nameof(MetadataExtractor)); - } - - return _handle; - } - } - - private Lazy _metadata; - - /// - /// Retrieves the . - /// - /// 3 - /// The for the given source. - /// An internal process error occurs. - /// The has been already disposed of. - public Metadata GetMetadata() - { - if (_disposed) - { - throw new ObjectDisposedException(nameof(MetadataExtractor)); - } - - return _metadata.Value; - } - - /// - /// Gets the artwork image in the source. - /// - /// 3 - /// The if it exists, otherwise null. - /// An internal process error occurs. - /// The has been already disposed of. - public Artwork GetArtwork() - { - IntPtr data = IntPtr.Zero; - IntPtr mimeType = IntPtr.Zero; - - try - { - int size = 0; - - var ret = Interop.MetadataExtractor.GetArtwork(Handle, out data, out size, out mimeType); - MetadataExtractorRetValidator.ThrowIfError(ret, "Failed to get value"); - - if (size > 0) - { - var buf = new byte[size]; - Marshal.Copy(data, buf, 0, size); - - return new Artwork(buf, Marshal.PtrToStringAnsi(mimeType)); - } - - return null; - } - finally - { - Interop.Libc.Free(data); - Interop.Libc.Free(mimeType); - } - } - - /// - /// Gets the sync lyrics of the source. - /// - /// 3 - /// The index of lyrics to retrieve. - /// The object if is valid, otherwise null. - /// An internal process error occurs. - /// The has been already disposed of. - public SyncLyrics GetSyncLyrics(int index) - { - IntPtr lyrics = IntPtr.Zero; - - try - { - uint timestamp = 0; - - var ret = Interop.MetadataExtractor.GetSynclyrics(Handle, index, out timestamp, out lyrics); - MetadataExtractorRetValidator.ThrowIfError(ret, "Failed to get sync lyrics"); - - if (lyrics == IntPtr.Zero) - { - return null; - } - - return new SyncLyrics(Marshal.PtrToStringAnsi(lyrics), timestamp); - } - finally - { - Interop.Libc.Free(lyrics); - } - } - - /// - /// Gets the frame of a video media. - /// - /// 3 - /// The raw thumbnail data in RGB888 if it exists, otherwise null. - /// An internal process error occurs. - /// The has been already disposed of. - public byte[] GetVideoThumbnail() - { - IntPtr data = IntPtr.Zero; - - try - { - int size = 0; - - var ret = Interop.MetadataExtractor.GetFrame(Handle, out data, out size); - MetadataExtractorRetValidator.ThrowIfError(ret, "Failed to get value"); - - if (size == 0) - { - return null; - } - - var buf = new byte[size]; - Marshal.Copy(data, buf, 0, size); - - return buf; - } - finally - { - Interop.Libc.Free(data); - } - } - - /// - /// Gets the frame of a video media. - /// - /// 3 - /// The timestamp in milliseconds. - /// true to get an accurate frame for the given timestamp, - /// otherwise false to get the nearest i-frame of the video rapidly. - /// The raw frame data in RGB888 if a frame at specified time exists, otherwise null. - /// An internal error occurs. - /// The has been already disposed of. - public byte[] GetFrameAt(uint timeStamp, bool accurate) - { - IntPtr data = IntPtr.Zero; - - try - { - int size = 0; - - var ret = Interop.MetadataExtractor.GetFrameAtTime(Handle, timeStamp, accurate, out data, out size); - MetadataExtractorRetValidator.ThrowIfError(ret, "Failed to get value"); - - if (size == 0) - { - return null; - } - - var buf = new byte[size]; - Marshal.Copy(data, buf, 0, size); - - return buf; - } - finally - { - Interop.Libc.Free(data); - } - } - - ~MetadataExtractor() - { - Dispose(false); - } - - protected virtual void Dispose(bool disposing) - { - if (!_disposed) - { - Release(); - _disposed = true; - } - } - - private void Release() - { - if (_buffer != IntPtr.Zero) - { - Marshal.FreeHGlobal(_buffer); - } - - if (_handle != IntPtr.Zero) - { - var ret = Interop.MetadataExtractor.Destroy(_handle); - Log.Error(MetadataExtractorLog.Tag, $"DestroyHandle failed : {ret}."); - - _handle = IntPtr.Zero; - } - } - - /// - /// Releases all resources used by the object. - /// - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - } -} diff --git a/src/Tizen.Multimedia.Metadata/MetadataExtractor/MetadataExtractorAttr.cs b/src/Tizen.Multimedia.Metadata/MetadataExtractor/MetadataExtractorAttr.cs deleted file mode 100644 index 574e7a4df..000000000 --- a/src/Tizen.Multimedia.Metadata/MetadataExtractor/MetadataExtractorAttr.cs +++ /dev/null @@ -1,57 +0,0 @@ -/* - * 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. - */ - -namespace Tizen.Multimedia -{ - internal enum MetadataExtractorAttr - { - Duration, - VideoBitrate, - VideoFps, - VideoWidth, - VideoHeight, - VideoStreamCount, - AudioBitrate, - AudioChannels, - AudioSamplerate, - AudioBitPerSample, - AudioStreamCount, - Artist, - Title, - Album, - AlbumArtist, - Genre, - Author, - Copyright, - ReleaseDate, - Description, - Comment, - TrackNum, - Classification, - Rating, - Longitude, - Latitude, - Altitude, - Conductor, - UnSyncLyrics, - SyncLyricsNum, - RecordingDate, - Rotate, - VideoCodec, - AudioCodec, - ContentFor360, - } -} diff --git a/src/Tizen.Multimedia.Metadata/MetadataExtractor/MetadataExtractorError.cs b/src/Tizen.Multimedia.Metadata/MetadataExtractor/MetadataExtractorError.cs deleted file mode 100644 index 71c8bca0b..000000000 --- a/src/Tizen.Multimedia.Metadata/MetadataExtractor/MetadataExtractorError.cs +++ /dev/null @@ -1,61 +0,0 @@ -/* - * 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.IO; -using Tizen.Internals.Errors; - -namespace Tizen.Multimedia -{ - /// - /// Enumeration for the metadata extractor's error codes. - /// - internal enum MetadataExtractorError - { - None = ErrorCode.None, - InvalidParameter = ErrorCode.InvalidParameter, - OutOfMemory = ErrorCode.OutOfMemory, - FileExists = ErrorCode.FileExists, - PermissionDenied = ErrorCode.PermissionDenied, - TizenMetadataExtractorError = -0x01930000, - OperationFailed = TizenMetadataExtractorError | 0x01 // Invalid operation - }; - - internal static class MetadataExtractorRetValidator - { - internal static void ThrowIfError(MetadataExtractorError error, string errorMessage) - { - switch (error) - { - case MetadataExtractorError.InvalidParameter: - throw new ArgumentException(errorMessage); - - case MetadataExtractorError.FileExists: - throw new FileNotFoundException(errorMessage); - - case MetadataExtractorError.PermissionDenied: - throw new UnauthorizedAccessException(errorMessage); - - case MetadataExtractorError.OutOfMemory: - throw new OutOfMemoryException(); - - case MetadataExtractorError.OperationFailed: - throw new InvalidOperationException(errorMessage); - } - } - } -} - diff --git a/src/Tizen.Multimedia.Metadata/MetadataExtractor/SyncLyrics.cs b/src/Tizen.Multimedia.Metadata/MetadataExtractor/SyncLyrics.cs deleted file mode 100755 index 77f1bdfba..000000000 --- a/src/Tizen.Multimedia.Metadata/MetadataExtractor/SyncLyrics.cs +++ /dev/null @@ -1,48 +0,0 @@ -/* - * 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. - */ - -namespace Tizen.Multimedia -{ - /// - /// Represents the synchronized lyrics information of the media. - /// - public class SyncLyrics - { - /// - /// Initializes a new instance of the MetadataExtractor class with the specified lyrics and the timestamp. - /// - /// 3 - /// The text of synchronized lyrics. - /// The timestamp of synchronized lyrics. - public SyncLyrics(string lyrics, uint timestamp) - { - Lyrics = lyrics; - Timestamp = timestamp; - } - - /// - /// Gets the text representation of the lyrics. - /// - /// 3 - public string Lyrics { get; } - - /// - /// Gets the time information of the lyrics. - /// - /// 3 - public uint Timestamp { get; } - } -} diff --git a/src/Tizen.Multimedia.Metadata/MetadataExtractor/ValueConverter.cs b/src/Tizen.Multimedia.Metadata/MetadataExtractor/ValueConverter.cs deleted file mode 100644 index aa6571eda..000000000 --- a/src/Tizen.Multimedia.Metadata/MetadataExtractor/ValueConverter.cs +++ /dev/null @@ -1,48 +0,0 @@ -/* - * 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.Diagnostics; -using static Interop.MetadataExtractor; - -namespace Tizen.Multimedia -{ - internal static class ValueConverter - { - internal static int? ToNullableInt(string str) - { - if (int.TryParse(str, out var value)) - { - return value; - } - return null; - } - - internal static int ToInt(string str) - { - return int.TryParse(str, out var value) ? value : 0; - } - - internal static double? ToNullableDouble(string str) - { - if (double.TryParse(str, out var value)) - { - return value; - } - return null; - } - } -} \ No newline at end of file diff --git a/src/Tizen.Multimedia.Metadata/ObjectDescriptionBuilder.cs b/src/Tizen.Multimedia.Metadata/ObjectDescriptionBuilder.cs deleted file mode 100644 index 96f1f6820..000000000 --- a/src/Tizen.Multimedia.Metadata/ObjectDescriptionBuilder.cs +++ /dev/null @@ -1,59 +0,0 @@ -/* - * 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.Reflection; -using System.Text; - -namespace Tizen.Multimedia -{ - /// - /// Represents a point in 2D space. - /// - internal static class ObjectDescriptionBuilder - { - internal static string BuildWithProperties(object obj) - { - StringBuilder sb = new StringBuilder(); - - foreach (var property in obj.GetType().GetRuntimeProperties()) - { - object value = property.GetValue(obj); - - sb.Append(property.Name).Append("="); - - bool isObjectType = Convert.GetTypeCode(value) == TypeCode.Object; - - if (isObjectType) - { - sb.Append("[").Append(value).Append("]"); - } - else - { - sb.Append(value); - } - - sb.Append(", "); - } - if (sb.Length >= 2) - { - sb.Remove(sb.Length - 1, 2); - } - - return sb.ToString(); - } - } -} diff --git a/src/Tizen.Multimedia.Metadata/Tizen.Multimedia.Metadata.csproj b/src/Tizen.Multimedia.Metadata/Tizen.Multimedia.Metadata.csproj deleted file mode 100644 index ec9bff774..000000000 --- a/src/Tizen.Multimedia.Metadata/Tizen.Multimedia.Metadata.csproj +++ /dev/null @@ -1,11 +0,0 @@ - - - - netstandard2.0 - - - - - - - \ No newline at end of file diff --git a/src/Tizen.Multimedia.Metadata/Tizen.Multimedia.Metadata.sln b/src/Tizen.Multimedia.Metadata/Tizen.Multimedia.Metadata.sln deleted file mode 100755 index ab4c2671e..000000000 --- a/src/Tizen.Multimedia.Metadata/Tizen.Multimedia.Metadata.sln +++ /dev/null @@ -1,72 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26730.12 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Multimedia.Metadata", "Tizen.Multimedia.Metadata.csproj", "{72F6EF8A-4D43-47E9-909D-B2317F83E636}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ElmSharp", "..\ElmSharp\ElmSharp.csproj", "{41D45A2A-3EC3-4032-9CA5-B8320C1387EB}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen", "..\Tizen\Tizen.csproj", "{6B32A210-8A28-4DF9-8C9C-01B836F5C2C9}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Log", "..\Tizen.Log\Tizen.Log.csproj", "{C409F1B4-D26C-43C7-AFB2-683D446F48F8}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Multimedia", "..\Tizen.Multimedia\Tizen.Multimedia.csproj", "{832B5F91-A2AB-4D34-AAFD-1F25FBF44422}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Applications.Common", "..\Tizen.Applications.Common\Tizen.Applications.Common.csproj", "{9774C131-7D48-4FE3-8A0C-B58336DC2419}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.NUI", "..\Tizen.NUI\Tizen.NUI.csproj", "{B5B29221-56C0-47C0-A04D-61C809EA07BD}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.System.SystemSettings", "..\Tizen.System.SystemSettings\Tizen.System.SystemSettings.csproj", "{F6DFE370-F2C3-4BF0-80F0-859BF0B937E8}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.System.Information", "..\Tizen.System.Information\Tizen.System.Information.csproj", "{485F0B7B-D7C1-4195-8F2D-9BEC2A85BAA1}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {72F6EF8A-4D43-47E9-909D-B2317F83E636}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {72F6EF8A-4D43-47E9-909D-B2317F83E636}.Debug|Any CPU.Build.0 = Debug|Any CPU - {72F6EF8A-4D43-47E9-909D-B2317F83E636}.Release|Any CPU.ActiveCfg = Release|Any CPU - {72F6EF8A-4D43-47E9-909D-B2317F83E636}.Release|Any CPU.Build.0 = Release|Any CPU - {41D45A2A-3EC3-4032-9CA5-B8320C1387EB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {41D45A2A-3EC3-4032-9CA5-B8320C1387EB}.Debug|Any CPU.Build.0 = Debug|Any CPU - {41D45A2A-3EC3-4032-9CA5-B8320C1387EB}.Release|Any CPU.ActiveCfg = Release|Any CPU - {41D45A2A-3EC3-4032-9CA5-B8320C1387EB}.Release|Any CPU.Build.0 = Release|Any CPU - {6B32A210-8A28-4DF9-8C9C-01B836F5C2C9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6B32A210-8A28-4DF9-8C9C-01B836F5C2C9}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6B32A210-8A28-4DF9-8C9C-01B836F5C2C9}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6B32A210-8A28-4DF9-8C9C-01B836F5C2C9}.Release|Any CPU.Build.0 = Release|Any CPU - {C409F1B4-D26C-43C7-AFB2-683D446F48F8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C409F1B4-D26C-43C7-AFB2-683D446F48F8}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C409F1B4-D26C-43C7-AFB2-683D446F48F8}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C409F1B4-D26C-43C7-AFB2-683D446F48F8}.Release|Any CPU.Build.0 = Release|Any CPU - {832B5F91-A2AB-4D34-AAFD-1F25FBF44422}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {832B5F91-A2AB-4D34-AAFD-1F25FBF44422}.Debug|Any CPU.Build.0 = Debug|Any CPU - {832B5F91-A2AB-4D34-AAFD-1F25FBF44422}.Release|Any CPU.ActiveCfg = Release|Any CPU - {832B5F91-A2AB-4D34-AAFD-1F25FBF44422}.Release|Any CPU.Build.0 = Release|Any CPU - {9774C131-7D48-4FE3-8A0C-B58336DC2419}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {9774C131-7D48-4FE3-8A0C-B58336DC2419}.Debug|Any CPU.Build.0 = Debug|Any CPU - {9774C131-7D48-4FE3-8A0C-B58336DC2419}.Release|Any CPU.ActiveCfg = Release|Any CPU - {9774C131-7D48-4FE3-8A0C-B58336DC2419}.Release|Any CPU.Build.0 = Release|Any CPU - {B5B29221-56C0-47C0-A04D-61C809EA07BD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B5B29221-56C0-47C0-A04D-61C809EA07BD}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B5B29221-56C0-47C0-A04D-61C809EA07BD}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B5B29221-56C0-47C0-A04D-61C809EA07BD}.Release|Any CPU.Build.0 = Release|Any CPU - {F6DFE370-F2C3-4BF0-80F0-859BF0B937E8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F6DFE370-F2C3-4BF0-80F0-859BF0B937E8}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F6DFE370-F2C3-4BF0-80F0-859BF0B937E8}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F6DFE370-F2C3-4BF0-80F0-859BF0B937E8}.Release|Any CPU.Build.0 = Release|Any CPU - {485F0B7B-D7C1-4195-8F2D-9BEC2A85BAA1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {485F0B7B-D7C1-4195-8F2D-9BEC2A85BAA1}.Debug|Any CPU.Build.0 = Debug|Any CPU - {485F0B7B-D7C1-4195-8F2D-9BEC2A85BAA1}.Release|Any CPU.ActiveCfg = Release|Any CPU - {485F0B7B-D7C1-4195-8F2D-9BEC2A85BAA1}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {E2A6AA3C-816F-42EA-AD90-619FA89A8D49} - EndGlobalSection -EndGlobal diff --git a/src/Tizen.Multimedia.Radio/Interop/Interop.Libraries.cs b/src/Tizen.Multimedia.Radio/Interop/Interop.Libraries.cs deleted file mode 100644 index f237099ed..000000000 --- a/src/Tizen.Multimedia.Radio/Interop/Interop.Libraries.cs +++ /dev/null @@ -1,26 +0,0 @@ -/* - * 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. - */ - -namespace Tizen.Multimedia -{ - internal static partial class Interop - { - internal static partial class Libraries - { - public const string Radio = "libcapi-media-radio.so.0"; - } - } -} diff --git a/src/Tizen.Multimedia.Radio/Interop/Interop.Radio.cs b/src/Tizen.Multimedia.Radio/Interop/Interop.Radio.cs deleted file mode 100644 index 929324ba1..000000000 --- a/src/Tizen.Multimedia.Radio/Interop/Interop.Radio.cs +++ /dev/null @@ -1,136 +0,0 @@ -/* - * 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; - -namespace Tizen.Multimedia -{ - internal static partial class Interop - { - internal static class Radio - { - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void SeekCompletedCallback(int frequency, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void ScanUpdatedCallback(int frequency, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void ScanStoppedCallback(IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void ScanCompletedCallback(IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void InterruptedCallback(RadioInterruptedReason reason, IntPtr userData); - - - [DllImport(Libraries.Radio, EntryPoint = "radio_create")] - internal static extern RadioError Create(out RadioHandle radio); - - [DllImport(Libraries.Radio, EntryPoint = "radio_destroy")] - internal static extern RadioError Destroy(IntPtr radio); - - [DllImport(Libraries.Radio, EntryPoint = "radio_get_state")] - internal static extern RadioError GetState(RadioHandle radio, out RadioState state); - - [DllImport(Libraries.Radio, EntryPoint = "radio_start")] - internal static extern RadioError Start(RadioHandle radio); - - [DllImport(Libraries.Radio, EntryPoint = "radio_stop")] - internal static extern RadioError Stop(RadioHandle radio); - - [DllImport(Libraries.Radio, EntryPoint = "radio_seek_up")] - internal static extern RadioError SeekUp(RadioHandle radio, SeekCompletedCallback callback, - IntPtr userData = default(IntPtr)); - - [DllImport(Libraries.Radio, EntryPoint = "radio_seek_down")] - internal static extern RadioError SeekDown(RadioHandle radio, SeekCompletedCallback callback, - IntPtr userData = default(IntPtr)); - - [DllImport(Libraries.Radio, EntryPoint = "radio_set_frequency")] - internal static extern RadioError SetFrequency(RadioHandle radio, int frequency); - - [DllImport(Libraries.Radio, EntryPoint = "radio_get_frequency")] - internal static extern RadioError GetFrequency(RadioHandle radio, out int frequency); - - [DllImport(Libraries.Radio, EntryPoint = "radio_get_signal_strength")] - internal static extern RadioError GetSignalStrength(RadioHandle radio, out int strength); - - [DllImport(Libraries.Radio, EntryPoint = "radio_scan_start")] - internal static extern RadioError ScanStart(RadioHandle radio, ScanUpdatedCallback callback, - IntPtr userData = default(IntPtr)); - - [DllImport(Libraries.Radio, EntryPoint = "radio_scan_stop")] - internal static extern RadioError ScanStop(RadioHandle radio, ScanStoppedCallback callback, - IntPtr userData = default(IntPtr)); - - [DllImport(Libraries.Radio, EntryPoint = "radio_set_mute")] - internal static extern RadioError SetMute(RadioHandle radio, bool muted); - - [DllImport(Libraries.Radio, EntryPoint = "radio_is_muted")] - internal static extern RadioError GetMuted(RadioHandle radio, out bool muted); - - [DllImport(Libraries.Radio, EntryPoint = "radio_set_scan_completed_cb")] - internal static extern RadioError SetScanCompletedCb(RadioHandle radio, - ScanCompletedCallback callback, IntPtr userData = default(IntPtr)); - - [DllImport(Libraries.Radio, EntryPoint = "radio_unset_scan_completed_cb")] - internal static extern RadioError UnsetScanCompletedCb(RadioHandle radio); - - [DllImport(Libraries.Radio, EntryPoint = "radio_set_interrupted_cb")] - internal static extern RadioError SetInterruptedCb(RadioHandle radio, - InterruptedCallback callback, IntPtr userData = default(IntPtr)); - - [DllImport(Libraries.Radio, EntryPoint = "radio_unset_interrupted_cb")] - internal static extern RadioError UnsetInterruptedCb(RadioHandle radio); - - [DllImport(Libraries.Radio, EntryPoint = "radio_get_frequency_range")] - internal static extern RadioError GetFrequencyRange(RadioHandle radio, out int minFreq, out int maxFreq); - - [DllImport(Libraries.Radio, EntryPoint = "radio_get_channel_spacing")] - internal static extern RadioError GetChannelSpacing(RadioHandle radio, out int channelSpacing); - - [DllImport(Libraries.Radio, EntryPoint = "radio_set_volume")] - internal static extern RadioError SetVolume(RadioHandle radio, float volume); - - [DllImport(Libraries.Radio, EntryPoint = "radio_get_volume")] - internal static extern RadioError GetVolume(RadioHandle radio, out float volume); - } - - internal class RadioHandle : SafeHandle - { - protected RadioHandle() : base(IntPtr.Zero, true) - { - } - - public override bool IsInvalid => handle == IntPtr.Zero; - - protected override bool ReleaseHandle() - { - var ret = Radio.Destroy(handle); - if (ret != RadioError.None) - { - Log.Debug(GetType().FullName, $"Failed to release native handle."); - return false; - } - - return true; - } - } - } -} diff --git a/src/Tizen.Multimedia.Radio/Radio/Radio.cs b/src/Tizen.Multimedia.Radio/Radio/Radio.cs deleted file mode 100755 index 20d70fd8a..000000000 --- a/src/Tizen.Multimedia.Radio/Radio/Radio.cs +++ /dev/null @@ -1,391 +0,0 @@ -/* - * 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.Linq; -using System.Threading.Tasks; -using Tizen.System; -using static Tizen.Multimedia.Interop.Radio; - -namespace Tizen.Multimedia -{ - /// - /// Provides a means for using the radio feature. - /// - public class Radio : IDisposable - { - private Interop.RadioHandle _handle; - - private const string FeatureFmRadio = "http://tizen.org/feature/fmradio"; - - /// - /// Initializes a new instance of the Radio class. - /// - /// The radio feature is not supported. - public Radio() - { - ValidateFeatureSupported(FeatureFmRadio); - - Create(out _handle); - - try - { - SetScanCompletedCb(_handle, ScanCompleteCallback).ThrowIfFailed("Failed to initialize radio"); - SetInterruptedCb(_handle, InterruptedCallback).ThrowIfFailed("Failed to initialize radio"); - } - catch (Exception) - { - _handle.Dispose(); - throw; - } - } - - private Interop.RadioHandle Handle - { - get - { - if (_disposed) - { - throw new ObjectDisposedException(GetType().Name); - } - return _handle; - } - } - - /// - /// Occurs when the radio scanning information is updated. - /// - public event EventHandler ScanUpdated; - - /// - /// Occurs when the radio scanning stops. - /// - public event EventHandler ScanStopped; - - /// - /// Occurs when the radio scanning is completed. - /// - public event EventHandler ScanCompleted; - - /// - /// Occurs when the radio is interrupted. - /// - public event EventHandler Interrupted; - - /// - /// Gets the current state of the radio. - /// - public RadioState State - { - get - { - RadioState state; - GetState(Handle, out state); - return state; - } - } - - /// - /// Gets or sets the radio frequency in the range of 87500 ~ 108000 kHz. - /// - /// - /// is less than of .\n - /// - or - \n - /// is greater than of .\n - /// - public int Frequency - { - get - { - int value = 0; - GetFrequency(Handle, out value).ThrowIfFailed("Failed to get frequency"); - return value; - } - set - { - if (value < FrequencyRange.Min || value > FrequencyRange.Max) - { - throw new ArgumentOutOfRangeException(nameof(Frequency), value, "Frequency must be within FrequencyRange."); - } - - SetFrequency(Handle, value).ThrowIfFailed("Failed to set frequency"); - } - } - - /// - /// Gets the current signal strength in the range of -128 ~ 128 dBm. - /// - public int SignalStrength - { - get - { - int value = 0; - GetSignalStrength(Handle, out value).ThrowIfFailed("Failed to get signal strength"); - return value; - } - } - - /// - /// Gets the value indicating if the radio is muted. - /// - /// - /// true if the radio is muted; otherwise, false. - /// The default is false. - /// - public bool IsMuted - { - get - { - bool value; - GetMuted(Handle, out value).ThrowIfFailed("Failed to get the mute state"); - return value; - } - set - { - SetMute(Handle, value).ThrowIfFailed("Failed to set the mute state"); - } - } - - /// - /// Gets the channel spacing for the current region. - /// - public int ChannelSpacing - { - get - { - int value; - GetChannelSpacing(Handle, out value).ThrowIfFailed("Failed to get channel spacing"); - return value; - } - } - - /// - /// Gets or sets the radio volume level. - /// - /// Valid volume range is from 0 to 1.0(100%), inclusive. - /// The default is 1.0. - /// - /// is less than zero.\n - /// - or -\n - /// is greater than 1.0. - /// - public float Volume - { - get - { - float value; - GetVolume(Handle, out value).ThrowIfFailed("Failed to get volume level."); - return value; - } - set - { - if (value < 0F || 1.0F < value) - { - throw new ArgumentOutOfRangeException(nameof(value), value, - $"Valid volume range is 0 <= value <= 1.0, but got { value }."); - } - - SetVolume(Handle, value).ThrowIfFailed("Failed to set volume level"); - } - } - - /// - /// Gets the frequency for the region in the range of 87500 ~ 108000 kHz. - /// - public Range FrequencyRange - { - get - { - int min, max; - - GetFrequencyRange(Handle, out min, out max).ThrowIfFailed("Failed to get frequency range"); - - return new Range(min, max); - } - } - - /// - /// Starts the radio. - /// - /// The radio must be in the state. - /// The radio is not in the valid state. - public void Start() - { - ValidateRadioState(RadioState.Ready); - - Interop.Radio.Start(Handle).ThrowIfFailed("Failed to start radio"); - } - - /// - /// Stops the radio. - /// - /// The radio must be in the state. - /// The radio is not in the valid state. - public void Stop() - { - ValidateRadioState(RadioState.Playing); - - Interop.Radio.Stop(Handle).ThrowIfFailed("Failed to stop radio"); - } - - /// - /// Starts the radio scanning and triggers the ScanInformationUpdated event when the scan information is updated. - /// - /// The radio must be in the or state. - /// The radio is not in the valid state. - /// - /// - public void StartScan() - { - ValidateRadioState(RadioState.Ready, RadioState.Playing); - - ScanStart(Handle, ScanUpdatedCallback); - } - - /// - /// Stops the radio scanning. - /// - /// The radio must be in the state. - /// The radio is not in the valid state. - /// - public void StopScan() - { - ValidateRadioState(RadioState.Scanning); - - ScanStop(Handle, ScanStoppedCallback); - } - - /// - /// Seeks up the effective frequency of the radio. - /// - /// - /// A task that represents the asynchronous seeking operation. - /// The result value is the current frequency in the range of 87500 ~ 108000 kHz. - /// It can be -1 if the seeking operation has failed. - /// - /// The radio must be in the state. - /// The radio is not in the valid state. - public async Task SeekUpAsync() - { - ValidateRadioState(RadioState.Playing); - - TaskCompletionSource tcs = new TaskCompletionSource(); - SeekCompletedCallback callback = (currentFrequency, _) => - { - tcs.TrySetResult(currentFrequency); - }; - - SeekUp(Handle, callback); - return await tcs.Task; - } - - /// - /// Seeks down the effective frequency of the radio. - /// - /// - /// A task that represents the asynchronous seeking operation. - /// The result value is the current frequency in the range of 87500 ~ 108000 kHz. - /// It can be -1 if the seeking operation has failed. - /// - /// The radio must be in the state. - /// The radio is not in the valid state. - public async Task SeekDownAsync() - { - ValidateRadioState(RadioState.Playing); - - TaskCompletionSource tcs = new TaskCompletionSource(); - SeekCompletedCallback callback = (currentFrequency, _) => - { - tcs.TrySetResult(currentFrequency); - }; - - SeekDown(Handle, callback); - return await tcs.Task; - } - - private void ValidateFeatureSupported(string featurePath) - { - bool supported = false; - Information.TryGetValue(featurePath, out supported); - - if (supported == false) - { - throw new NotSupportedException($"The feature({featurePath}) is not supported."); - } - - } - - private void ScanUpdatedCallback(int frequency, IntPtr data) - { - ScanUpdated?.Invoke(this, new ScanUpdatedEventArgs(frequency)); - } - - private void ScanStoppedCallback(IntPtr data) - { - ScanStopped?.Invoke(this, EventArgs.Empty); - } - - private void ScanCompleteCallback(IntPtr data) - { - ScanCompleted?.Invoke(this, EventArgs.Empty); - } - - private void InterruptedCallback(RadioInterruptedReason reason, IntPtr data) - { - Interrupted?.Invoke(this, new RadioInterruptedEventArgs(reason)); - } - - private void ValidateRadioState(params RadioState[] required) - { - RadioState curState = State; - - if (required.Contains(curState) == false) - { - throw new InvalidOperationException($"{curState} is not valid state."); - } - } - - #region IDisposable Support - private bool _disposed = false; - - /// - /// Releases the resources used by the Radio. - /// - /// - /// true to release both managed and unmanaged resources; false to release only unmanaged resources. - /// - protected virtual void Dispose(bool disposing) - { - if (!_disposed) - { - if (_handle != null) - { - _handle.Dispose(); - } - _disposed = true; - } - } - - /// - /// Releases all resources used by the object. - /// - public void Dispose() - { - Dispose(true); - } - #endregion - } -} diff --git a/src/Tizen.Multimedia.Radio/Radio/RadioError.cs b/src/Tizen.Multimedia.Radio/Radio/RadioError.cs deleted file mode 100644 index 631d9c7f9..000000000 --- a/src/Tizen.Multimedia.Radio/Radio/RadioError.cs +++ /dev/null @@ -1,69 +0,0 @@ -/* - * 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.Multimedia -{ - - internal enum RadioError - { - None = ErrorCode.None, - OutOfMemory = ErrorCode.OutOfMemory, - InvalidParameter = ErrorCode.InvalidParameter, - InvalidOperation = ErrorCode.InvalidOperation, - PermissionDenied = ErrorCode.PermissionDenied, - NotSupported = ErrorCode.NotSupported, - - InvalidState = -0x019A0000 | 0x01, - SoundPolicy = -0x019A0000 | 0x02, - NoAntenna = -0x019A0000 | 0x03, - } - - internal static class RadioErrorExtensions - { - internal static void ThrowIfFailed(this RadioError err, string message) - { - if (err == RadioError.None) - { - return; - } - - string errMessage = $"{message}; {err}."; - switch (err) - { - case RadioError.PermissionDenied: - throw new UnauthorizedAccessException(errMessage); - - case RadioError.InvalidParameter: - throw new ArgumentException(errMessage); - - case RadioError.OutOfMemory: - throw new OutOfMemoryException(errMessage); - - case RadioError.NotSupported: - case RadioError.NoAntenna: - throw new NotSupportedException(errMessage); - - default: - throw new InvalidOperationException(errMessage); - } - } - - } - -} diff --git a/src/Tizen.Multimedia.Radio/Radio/RadioInterruptedEventArgs.cs b/src/Tizen.Multimedia.Radio/Radio/RadioInterruptedEventArgs.cs deleted file mode 100644 index 84e434024..000000000 --- a/src/Tizen.Multimedia.Radio/Radio/RadioInterruptedEventArgs.cs +++ /dev/null @@ -1,43 +0,0 @@ -/* - * 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.Multimedia -{ - /// - /// Provides data for the event. - /// - public class RadioInterruptedEventArgs : EventArgs - { - internal RadioInterruptedEventArgs(RadioInterruptedReason reason) - { - Reason = reason; - } - - /// - /// Gets the reason. - /// - /// The reason for interruption. - public RadioInterruptedReason Reason { get; } - - /// - /// Returns a string that represents the current object. - /// - /// A string that represents the current object. - public override string ToString() => $"Reason={ Reason.ToString() }"; - } -} diff --git a/src/Tizen.Multimedia.Radio/Radio/RadioInterruptedReason.cs b/src/Tizen.Multimedia.Radio/Radio/RadioInterruptedReason.cs deleted file mode 100644 index d6cb24c60..000000000 --- a/src/Tizen.Multimedia.Radio/Radio/RadioInterruptedReason.cs +++ /dev/null @@ -1,29 +0,0 @@ -/* - * 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. - */ - -namespace Tizen.Multimedia -{ - /// - /// Specifies interrupted reasons. - /// - public enum RadioInterruptedReason - { - /// - /// By a resource conflict. - /// - ResourceConflict = 4, - } -} diff --git a/src/Tizen.Multimedia.Radio/Radio/RadioState.cs b/src/Tizen.Multimedia.Radio/Radio/RadioState.cs deleted file mode 100644 index 38db7f092..000000000 --- a/src/Tizen.Multimedia.Radio/Radio/RadioState.cs +++ /dev/null @@ -1,37 +0,0 @@ -/* - * 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. - */ - -namespace Tizen.Multimedia -{ - /// - /// Specifies states of the . - /// - public enum RadioState - { - /// - /// Ready to play or scan. - /// - Ready, - /// - /// Playing audio from the tuner. - /// - Playing, - /// - /// Scanning; searching for the next station for signal. - /// - Scanning, - } -} diff --git a/src/Tizen.Multimedia.Radio/Radio/ScanUpdatedEventArgs.cs b/src/Tizen.Multimedia.Radio/Radio/ScanUpdatedEventArgs.cs deleted file mode 100644 index 174f67028..000000000 --- a/src/Tizen.Multimedia.Radio/Radio/ScanUpdatedEventArgs.cs +++ /dev/null @@ -1,45 +0,0 @@ -/* - * 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.Multimedia -{ - /// - /// Provides data for the event. - /// - public class ScanUpdatedEventArgs : EventArgs - { - internal ScanUpdatedEventArgs(int tunedFrequency) - { - Frequency = tunedFrequency; - } - - /// - /// Gets the tuned radio frequency that is scanned, in range [87500 ~ 108000] (kHz). - /// - public int Frequency { get; } - - /// - /// Returns a string that represents the current object. - /// - /// A string that represents the current object. - public override string ToString() - { - return $"Frequency={ Frequency.ToString() }"; - } - } -} diff --git a/src/Tizen.Multimedia.Radio/Tizen.Multimedia.Radio.csproj b/src/Tizen.Multimedia.Radio/Tizen.Multimedia.Radio.csproj deleted file mode 100644 index 8d4fb3159..000000000 --- a/src/Tizen.Multimedia.Radio/Tizen.Multimedia.Radio.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - netstandard2.0 - - - - - - - - \ No newline at end of file diff --git a/src/Tizen.Multimedia.Radio/Tizen.Multimedia.Radio.sln b/src/Tizen.Multimedia.Radio/Tizen.Multimedia.Radio.sln deleted file mode 100755 index 918534ac7..000000000 --- a/src/Tizen.Multimedia.Radio/Tizen.Multimedia.Radio.sln +++ /dev/null @@ -1,72 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26730.12 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Multimedia.Radio", "Tizen.Multimedia.Radio.csproj", "{2F4014F0-B4F3-405F-A270-CB9ED958A109}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ElmSharp", "..\ElmSharp\ElmSharp.csproj", "{901E1981-A92B-4993-8FA3-CDA2023E0851}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen", "..\Tizen\Tizen.csproj", "{F1FEC17C-EB01-46D1-B3E8-D01941552256}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Log", "..\Tizen.Log\Tizen.Log.csproj", "{D2D974E3-AB9F-41C2-AE79-EF83338CA753}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Multimedia", "..\Tizen.Multimedia\Tizen.Multimedia.csproj", "{E7063DA3-0D13-430E-B401-FE56AB126B3E}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.System.Information", "..\Tizen.System.Information\Tizen.System.Information.csproj", "{75DA9762-1230-4492-A171-698FE2654767}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.NUI", "..\Tizen.NUI\Tizen.NUI.csproj", "{C34CF704-4FA7-437F-BDA1-1CFB5C10B3E9}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.System.SystemSettings", "..\Tizen.System.SystemSettings\Tizen.System.SystemSettings.csproj", "{808F2480-137A-4125-A630-F7DC74ECE7F8}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Applications.Common", "..\Tizen.Applications.Common\Tizen.Applications.Common.csproj", "{54E87680-3639-4235-9A1E-A3AEDBDE02B7}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {2F4014F0-B4F3-405F-A270-CB9ED958A109}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {2F4014F0-B4F3-405F-A270-CB9ED958A109}.Debug|Any CPU.Build.0 = Debug|Any CPU - {2F4014F0-B4F3-405F-A270-CB9ED958A109}.Release|Any CPU.ActiveCfg = Release|Any CPU - {2F4014F0-B4F3-405F-A270-CB9ED958A109}.Release|Any CPU.Build.0 = Release|Any CPU - {901E1981-A92B-4993-8FA3-CDA2023E0851}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {901E1981-A92B-4993-8FA3-CDA2023E0851}.Debug|Any CPU.Build.0 = Debug|Any CPU - {901E1981-A92B-4993-8FA3-CDA2023E0851}.Release|Any CPU.ActiveCfg = Release|Any CPU - {901E1981-A92B-4993-8FA3-CDA2023E0851}.Release|Any CPU.Build.0 = Release|Any CPU - {F1FEC17C-EB01-46D1-B3E8-D01941552256}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F1FEC17C-EB01-46D1-B3E8-D01941552256}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F1FEC17C-EB01-46D1-B3E8-D01941552256}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F1FEC17C-EB01-46D1-B3E8-D01941552256}.Release|Any CPU.Build.0 = Release|Any CPU - {D2D974E3-AB9F-41C2-AE79-EF83338CA753}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D2D974E3-AB9F-41C2-AE79-EF83338CA753}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D2D974E3-AB9F-41C2-AE79-EF83338CA753}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D2D974E3-AB9F-41C2-AE79-EF83338CA753}.Release|Any CPU.Build.0 = Release|Any CPU - {E7063DA3-0D13-430E-B401-FE56AB126B3E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E7063DA3-0D13-430E-B401-FE56AB126B3E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E7063DA3-0D13-430E-B401-FE56AB126B3E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E7063DA3-0D13-430E-B401-FE56AB126B3E}.Release|Any CPU.Build.0 = Release|Any CPU - {75DA9762-1230-4492-A171-698FE2654767}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {75DA9762-1230-4492-A171-698FE2654767}.Debug|Any CPU.Build.0 = Debug|Any CPU - {75DA9762-1230-4492-A171-698FE2654767}.Release|Any CPU.ActiveCfg = Release|Any CPU - {75DA9762-1230-4492-A171-698FE2654767}.Release|Any CPU.Build.0 = Release|Any CPU - {C34CF704-4FA7-437F-BDA1-1CFB5C10B3E9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C34CF704-4FA7-437F-BDA1-1CFB5C10B3E9}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C34CF704-4FA7-437F-BDA1-1CFB5C10B3E9}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C34CF704-4FA7-437F-BDA1-1CFB5C10B3E9}.Release|Any CPU.Build.0 = Release|Any CPU - {808F2480-137A-4125-A630-F7DC74ECE7F8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {808F2480-137A-4125-A630-F7DC74ECE7F8}.Debug|Any CPU.Build.0 = Debug|Any CPU - {808F2480-137A-4125-A630-F7DC74ECE7F8}.Release|Any CPU.ActiveCfg = Release|Any CPU - {808F2480-137A-4125-A630-F7DC74ECE7F8}.Release|Any CPU.Build.0 = Release|Any CPU - {54E87680-3639-4235-9A1E-A3AEDBDE02B7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {54E87680-3639-4235-9A1E-A3AEDBDE02B7}.Debug|Any CPU.Build.0 = Debug|Any CPU - {54E87680-3639-4235-9A1E-A3AEDBDE02B7}.Release|Any CPU.ActiveCfg = Release|Any CPU - {54E87680-3639-4235-9A1E-A3AEDBDE02B7}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {8DC2DD7C-1392-42E8-B093-A601AFD78D58} - EndGlobalSection -EndGlobal diff --git a/src/Tizen.Multimedia.Recorder/Interop/Interop.Libraries.cs b/src/Tizen.Multimedia.Recorder/Interop/Interop.Libraries.cs deleted file mode 100644 index 02fd9dfe4..000000000 --- a/src/Tizen.Multimedia.Recorder/Interop/Interop.Libraries.cs +++ /dev/null @@ -1,23 +0,0 @@ -/* - * 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 Recorder = "libcapi-media-recorder.so.0"; - } -} diff --git a/src/Tizen.Multimedia.Recorder/Interop/Interop.Recorder.Capabilities.cs b/src/Tizen.Multimedia.Recorder/Interop/Interop.Recorder.Capabilities.cs deleted file mode 100644 index e25772868..000000000 --- a/src/Tizen.Multimedia.Recorder/Interop/Interop.Recorder.Capabilities.cs +++ /dev/null @@ -1,53 +0,0 @@ -/* - * 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; -using Tizen.Multimedia; - -internal static partial class Interop -{ - internal static partial class Recorder - { - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool VideoResolutionCallback(int width, int height, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool VideoEncoderCallback(RecorderVideoCodec value, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool AudioEncoderCallback(RecorderAudioCodec value, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool FileFormatCallback(RecorderFileFormat value, IntPtr userData); - - [DllImport(Libraries.Recorder, EntryPoint = "recorder_foreach_supported_file_format")] - internal static extern RecorderErrorCode GetFileFormats(RecorderHandle handle, - FileFormatCallback callback, IntPtr userData = default(IntPtr)); - - [DllImport(Libraries.Recorder, EntryPoint = "recorder_foreach_supported_audio_encoder")] - internal static extern RecorderErrorCode GetAudioEncoders(RecorderHandle handle, - AudioEncoderCallback callback, IntPtr userData = default(IntPtr)); - - [DllImport(Libraries.Recorder, EntryPoint = "recorder_foreach_supported_video_encoder")] - internal static extern RecorderErrorCode GetVideoEncoders(RecorderHandle handle, - VideoEncoderCallback callback, IntPtr userData = default(IntPtr)); - - [DllImport(Libraries.Recorder, EntryPoint = "recorder_foreach_supported_video_resolution")] - public static extern RecorderErrorCode GetVideoResolutions(RecorderHandle handle, - VideoResolutionCallback callback, IntPtr userData = default(IntPtr)); - } -} diff --git a/src/Tizen.Multimedia.Recorder/Interop/Interop.Recorder.Events.cs b/src/Tizen.Multimedia.Recorder/Interop/Interop.Recorder.Events.cs deleted file mode 100644 index c525aa3ca..000000000 --- a/src/Tizen.Multimedia.Recorder/Interop/Interop.Recorder.Events.cs +++ /dev/null @@ -1,126 +0,0 @@ -/* - * 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; -using Tizen.Multimedia; - -internal static partial class Interop -{ - - internal static partial class Recorder - { - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void RecorderErrorCallback(RecorderError error, RecorderState current, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void RecordingLimitReachedCallback(RecordingLimitType type, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void RecordingProgressCallback(ulong elapsedTime, ulong fileSize, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void AudioStreamCallback(IntPtr stream, int size, AudioSampleType type, int channel, - uint timeStamp, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void StatechangedCallback(RecorderState previous, RecorderState current, bool byPolicy, IntPtr userData); - - [DllImport(Libraries.Recorder, EntryPoint = "recorder_set_error_cb")] - internal static extern RecorderErrorCode SetErrorCallback(RecorderHandle handle, RecorderErrorCallback callback, - IntPtr userData); - - [DllImport(Libraries.Recorder, EntryPoint = "recorder_unset_error_cb")] - internal static extern RecorderErrorCode UnsetErrorCallback(RecorderHandle handle); - - [DllImport(Libraries.Recorder, EntryPoint = "recorder_set_state_changed_cb")] - internal static extern RecorderErrorCode SetStateChangedCallback(RecorderHandle handle, - StatechangedCallback callback, IntPtr userData); - - [DllImport(Libraries.Recorder, EntryPoint = "recorder_unset_state_changed_cb")] - internal static extern RecorderErrorCode UnsetStateChangedCallback(RecorderHandle handle); - - [DllImport(Libraries.Recorder, EntryPoint = "recorder_set_recording_status_cb")] - internal static extern RecorderErrorCode SetRecordingProgressCallback(RecorderHandle handle, - RecordingProgressCallback callback, IntPtr userData); - - [DllImport(Libraries.Recorder, EntryPoint = "recorder_unset_recording_status_cb")] - internal static extern RecorderErrorCode UnsetRecordingProgressCallback(RecorderHandle handle); - - [DllImport(Libraries.Recorder, EntryPoint = "recorder_set_audio_stream_cb")] - internal static extern RecorderErrorCode SetAudioStreamCallback(RecorderHandle handle, - AudioStreamCallback callback, IntPtr userData); - - [DllImport(Libraries.Recorder, EntryPoint = "recorder_unset_audio_stream_cb")] - internal static extern RecorderErrorCode UnsetAudioStreamCallback(RecorderHandle handle); - - [DllImport(Libraries.Recorder, EntryPoint = "recorder_set_recording_limit_reached_cb")] - internal static extern RecorderErrorCode SetLimitReachedCallback(RecorderHandle handle, - RecordingLimitReachedCallback callback, IntPtr userData); - - [DllImport(Libraries.Recorder, EntryPoint = "recorder_unset_recording_limit_reached_cb")] - internal static extern RecorderErrorCode UnsetLimitReachedCallback(RecorderHandle handle); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void MuxedStreamCallback(IntPtr stream, int size, ulong offset, IntPtr userData); - - [DllImport(Libraries.Recorder, EntryPoint = "recorder_set_muxed_stream_cb")] - internal static extern RecorderErrorCode SetMuxedStreamCallback(RecorderHandle handle, - MuxedStreamCallback callback, IntPtr userData); - - [DllImport(Libraries.Recorder, EntryPoint = "recorder_unset_muxed_stream_cb")] - internal static extern RecorderErrorCode UnsetMuxedStreamCallback(RecorderHandle handle); - - - #region InterruptCallback - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void InterruptedCallback(RecorderPolicy policy, RecorderState previous, - RecorderState current, IntPtr userData); - - [DllImport(Libraries.Recorder, EntryPoint = "recorder_set_interrupted_cb")] - internal static extern RecorderErrorCode SetInterruptedCallback(RecorderHandle handle, - InterruptedCallback callback, IntPtr userData); - - [DllImport(Libraries.Recorder, EntryPoint = "recorder_unset_interrupted_cb")] - internal static extern RecorderErrorCode UnsetInterruptedCallback(RecorderHandle handle); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void InterruptStartedCallback(RecorderPolicy policy, RecorderState state, - IntPtr userData); - - [DllImport(Libraries.Recorder, EntryPoint = "recorder_set_interrupt_started_cb")] - internal static extern RecorderErrorCode SetInterruptStartedCallback(RecorderHandle handle, - InterruptStartedCallback callback, IntPtr userData = default(IntPtr)); - - [DllImport(Libraries.Recorder, EntryPoint = "recorder_unset_interrupt_started_cb")] - internal static extern RecorderErrorCode UnsetInterruptStartedCallback(RecorderHandle handle); - - #endregion - - - #region DeviceStateChangedCallback - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void DeviceStateChangedCallback(RecorderType type, RecorderDeviceState state, IntPtr userData); - - [DllImport(Libraries.Recorder, EntryPoint = "recorder_add_device_state_changed_cb")] - internal static extern RecorderErrorCode AddDeviceStateChangedCallback(DeviceStateChangedCallback callback, - IntPtr userData, out int id); - - [DllImport(Libraries.Recorder, EntryPoint = "recorder_remove_device_state_changed_cb")] - internal static extern RecorderErrorCode RemoveDeviceStateChangedCallback(int id); - #endregion - } -} \ No newline at end of file diff --git a/src/Tizen.Multimedia.Recorder/Interop/Interop.Recorder.Settings.cs b/src/Tizen.Multimedia.Recorder/Interop/Interop.Recorder.Settings.cs deleted file mode 100644 index 0fbfdb279..000000000 --- a/src/Tizen.Multimedia.Recorder/Interop/Interop.Recorder.Settings.cs +++ /dev/null @@ -1,119 +0,0 @@ -/* - * 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; -using Tizen.Multimedia; - -internal static partial class Interop -{ - internal static partial class Recorder - { - [DllImport(Libraries.Recorder, EntryPoint = "recorder_attr_get_audio_channel")] - internal static extern RecorderErrorCode GetAudioChannel(RecorderHandle handle, out int channelCount); - - [DllImport(Libraries.Recorder, EntryPoint = "recorder_attr_set_audio_channel")] - internal static extern RecorderErrorCode SetAudioChannel(RecorderHandle handle, int channelCount); - - [DllImport(Libraries.Recorder, EntryPoint = "recorder_attr_get_audio_device")] - internal static extern RecorderErrorCode GetAudioDevice(RecorderHandle handle, out RecorderAudioDevice device); - - [DllImport(Libraries.Recorder, EntryPoint = "recorder_attr_set_audio_device")] - internal static extern RecorderErrorCode SetAudioDevice(RecorderHandle handle, RecorderAudioDevice device); - - [DllImport(Libraries.Recorder, EntryPoint = "recorder_get_audio_level")] - internal static extern RecorderErrorCode GetAudioLevel(RecorderHandle handle, out double dB); - - [DllImport(Libraries.Recorder, EntryPoint = "recorder_attr_get_audio_samplerate")] - internal static extern RecorderErrorCode GetAudioSampleRate(RecorderHandle handle, out int sampleRate); - - [DllImport(Libraries.Recorder, EntryPoint = "recorder_attr_set_audio_samplerate")] - internal static extern RecorderErrorCode SetAudioSampleRate(RecorderHandle handle, int sampleRate); - - [DllImport(Libraries.Recorder, EntryPoint = "recorder_attr_get_audio_encoder_bitrate")] - internal static extern RecorderErrorCode GetAudioEncoderBitrate(RecorderHandle handle, out int bitRate); - - [DllImport(Libraries.Recorder, EntryPoint = "recorder_attr_set_audio_encoder_bitrate")] - internal static extern RecorderErrorCode SetAudioEncoderBitrate(RecorderHandle handle, int bitRate); - - [DllImport(Libraries.Recorder, EntryPoint = "recorder_attr_get_video_encoder_bitrate")] - internal static extern RecorderErrorCode GetVideoEncoderBitrate(RecorderHandle handle, out int bitRate); - - [DllImport(Libraries.Recorder, EntryPoint = "recorder_attr_set_video_encoder_bitrate")] - internal static extern RecorderErrorCode SetVideoEncoderBitrate(RecorderHandle handle, int bitRate); - - [DllImport(Libraries.Recorder, EntryPoint = "recorder_get_audio_encoder")] - internal static extern RecorderErrorCode GetAudioEncoder(RecorderHandle handle, out RecorderAudioCodec codec); - - [DllImport(Libraries.Recorder, EntryPoint = "recorder_set_audio_encoder")] - internal static extern RecorderErrorCode SetAudioEncoder(RecorderHandle handle, RecorderAudioCodec codec); - - [DllImport(Libraries.Recorder, EntryPoint = "recorder_get_video_encoder")] - internal static extern RecorderErrorCode GetVideoEncoder(RecorderHandle handle, out RecorderVideoCodec codec); - - [DllImport(Libraries.Recorder, EntryPoint = "recorder_set_video_encoder")] - internal static extern RecorderErrorCode SetVideoEncoder(RecorderHandle handle, RecorderVideoCodec codec); - - [DllImport(Libraries.Recorder, EntryPoint = "recorder_get_file_format")] - internal static extern RecorderErrorCode GetFileFormat(RecorderHandle handle, out RecorderFileFormat format); - - [DllImport(Libraries.Recorder, EntryPoint = "recorder_set_file_format")] - internal static extern RecorderErrorCode SetFileFormat(RecorderHandle handle, RecorderFileFormat format); - - [DllImport(Libraries.Recorder, EntryPoint = "recorder_get_filename")] - internal static extern RecorderErrorCode GetFileName(RecorderHandle handle, out IntPtr path); - - [DllImport(Libraries.Recorder, EntryPoint = "recorder_set_filename")] - internal static extern RecorderErrorCode SetFileName(RecorderHandle handle, string path); - - [DllImport(Libraries.Recorder, EntryPoint = "recorder_attr_get_size_limit")] - internal static extern RecorderErrorCode GetSizeLimit(RecorderHandle handle, out int kbyte); - - [DllImport(Libraries.Recorder, EntryPoint = "recorder_attr_set_size_limit")] - internal static extern RecorderErrorCode SetSizeLimit(RecorderHandle handle, int kbyte); - - [DllImport(Libraries.Recorder, EntryPoint = "recorder_attr_get_time_limit")] - internal static extern RecorderErrorCode GetTimeLimit(RecorderHandle handle, out int second); - - [DllImport(Libraries.Recorder, EntryPoint = "recorder_attr_set_time_limit")] - internal static extern RecorderErrorCode SetTimeLimit(RecorderHandle handle, int second); - - [DllImport(Libraries.Recorder, EntryPoint = "recorder_attr_is_muted")] - [return: MarshalAs(UnmanagedType.I1)] - internal static extern bool GetMute(RecorderHandle handle); - - [DllImport(Libraries.Recorder, EntryPoint = "recorder_attr_set_mute")] - internal static extern RecorderErrorCode SetMute(RecorderHandle handle, bool enable); - - [DllImport(Libraries.Recorder, EntryPoint = "recorder_attr_get_recording_motion_rate")] - internal static extern RecorderErrorCode GetMotionRate(RecorderHandle handle, out double motionRate); - - [DllImport(Libraries.Recorder, EntryPoint = "recorder_attr_set_recording_motion_rate")] - internal static extern RecorderErrorCode SetMotionRate(RecorderHandle handle, double motionRate); - - [DllImport(Libraries.Recorder, EntryPoint = "recorder_attr_get_orientation_tag")] - internal static extern RecorderErrorCode GetOrientationTag(RecorderHandle handle, out Rotation orientation); - - [DllImport(Libraries.Recorder, EntryPoint = "recorder_attr_set_orientation_tag")] - internal static extern RecorderErrorCode SetOrientationTag(RecorderHandle handle, Rotation orientation); - - [DllImport(Libraries.Recorder, EntryPoint = "recorder_get_video_resolution")] - internal static extern RecorderErrorCode GetVideoResolution(RecorderHandle handle, out int width, out int height); - - [DllImport(Libraries.Recorder, EntryPoint = "recorder_set_video_resolution")] - internal static extern RecorderErrorCode SetVideoResolution(RecorderHandle handle, int width, int height); - } -} diff --git a/src/Tizen.Multimedia.Recorder/Interop/Interop.Recorder.cs b/src/Tizen.Multimedia.Recorder/Interop/Interop.Recorder.cs deleted file mode 100644 index 5fa70fba8..000000000 --- a/src/Tizen.Multimedia.Recorder/Interop/Interop.Recorder.cs +++ /dev/null @@ -1,92 +0,0 @@ -/* - * 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; -using Tizen.Multimedia; - -internal static partial class Interop -{ - - internal static partial class Recorder - { - [DllImport(Libraries.Recorder, EntryPoint = "recorder_create_audiorecorder")] - internal static extern RecorderErrorCode Create(out RecorderHandle handle); - - [DllImport(Libraries.Recorder, EntryPoint = "recorder_create_videorecorder")] - internal static extern RecorderErrorCode CreateVideo(IntPtr cameraHandle, out RecorderHandle handle); - - [DllImport(Libraries.Recorder, EntryPoint = "recorder_prepare")] - internal static extern RecorderErrorCode Prepare(RecorderHandle handle); - - [DllImport(Libraries.Recorder, EntryPoint = "recorder_unprepare")] - internal static extern RecorderErrorCode Unprepare(RecorderHandle handle); - - [DllImport(Libraries.Recorder, EntryPoint = "recorder_start")] - internal static extern RecorderErrorCode Start(RecorderHandle handle); - - [DllImport(Libraries.Recorder, EntryPoint = "recorder_pause")] - internal static extern RecorderErrorCode Pause(RecorderHandle handle); - - [DllImport(Libraries.Recorder, EntryPoint = "recorder_commit")] - internal static extern RecorderErrorCode Commit(RecorderHandle handle); - - [DllImport(Libraries.Recorder, EntryPoint = "recorder_cancel")] - internal static extern RecorderErrorCode Cancel(RecorderHandle handle); - - [DllImport(Libraries.Recorder, EntryPoint = "recorder_get_state")] - internal static extern RecorderErrorCode GetState(RecorderHandle handle, out RecorderState state); - - [DllImport(Libraries.Recorder, EntryPoint = "recorder_set_sound_stream_info")] - internal static extern RecorderErrorCode SetAudioStreamPolicy(RecorderHandle handle, AudioStreamPolicyHandle streamInfoHandle); - - [DllImport(Libraries.Recorder, EntryPoint = "recorder_get_device_state")] - internal static extern RecorderErrorCode GetDeviceState(RecorderType type, out RecorderDeviceState state); - } - - internal class RecorderHandle : SafeHandle - { - [DllImport(Libraries.Recorder, EntryPoint = "recorder_destroy")] - private static extern RecorderErrorCode Destroy(IntPtr handle); - - [DllImport(Libraries.Recorder, EntryPoint = "recorder_cancel")] - private static extern RecorderErrorCode Cancel(IntPtr handle); - - [DllImport(Libraries.Recorder, EntryPoint = "recorder_unprepare")] - private static extern RecorderErrorCode Unprepare(IntPtr handle); - - protected RecorderHandle() : base(IntPtr.Zero, true) - { - } - - public override bool IsInvalid => handle == IntPtr.Zero; - - protected override bool ReleaseHandle() - { - Cancel(handle).Ignore(RecorderErrorCode.InvalidState).ThrowIfError("Failed to cancel"); - Unprepare(handle).Ignore(RecorderErrorCode.InvalidState).ThrowIfError("Failed to unprepare"); - - var ret = Destroy(handle); - if (ret != RecorderErrorCode.None) - { - Tizen.Log.Debug(GetType().FullName, $"Failed to release native RecorderHandle."); - - return false; - } - return true; - } - } -} \ No newline at end of file diff --git a/src/Tizen.Multimedia.Recorder/Recorder/AudioRecorder.cs b/src/Tizen.Multimedia.Recorder/Recorder/AudioRecorder.cs deleted file mode 100644 index 42b415d74..000000000 --- a/src/Tizen.Multimedia.Recorder/Recorder/AudioRecorder.cs +++ /dev/null @@ -1,107 +0,0 @@ -/* - * 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 Native = Interop.Recorder; -using NativeHandle = Interop.RecorderHandle; - -namespace Tizen.Multimedia -{ - /// - /// Provides the ability to control audio recording. - /// - public class AudioRecorder : Recorder - { - private static NativeHandle CreateHandle() - { - Native.Create(out var handle).ThrowIfError("Failed to create Audio recorder"); - - return handle; - } - - private static void ThrowIfCodecAndFormatNotValid(RecorderAudioCodec audioCodec, RecorderFileFormat fileFormat) - { - if (audioCodec == RecorderAudioCodec.None) - { - throw new ArgumentOutOfRangeException(nameof(audioCodec), - "RecorderAudioCodec.None is only available with VideoRecorder."); - } - - audioCodec.ThrowIfFormatNotSupported(fileFormat); - } - - /// - /// Initializes a new instance of the class with the specified audio codec and file format. - /// - /// The codec for audio encoding. - /// The format of result file. - /// http://tizen.org/feature/microphone - /// An internal error occurred. - /// - /// A required feature is not supported.\n - /// -or-\n - /// is not supported.\n - /// -or-\n - /// is not supported with the specified audio codec. - /// - /// - /// is not valid.\n - /// -or-\n - /// is not valid. - /// - /// - /// is - /// - /// - /// - /// - /// - public AudioRecorder(RecorderAudioCodec audioCodec, RecorderFileFormat fileFormat) : base(CreateHandle()) - { - SetFormatAndCodec(audioCodec, fileFormat); - } - - /// - /// Sets the audio codec and the file format for recording. - /// - /// The codec for audio encoding. - /// The format of result file. - /// - /// is not supported.\n - /// -or-\n - /// is not supported with the specified audio codec. - /// - /// - /// is not valid.\n - /// -or-\n - /// is not valid. - /// - /// - /// is - /// - /// - /// - /// - /// - public void SetFormatAndCodec(RecorderAudioCodec audioCodec, RecorderFileFormat fileFormat) - { - ThrowIfCodecAndFormatNotValid(audioCodec, fileFormat); - - AudioCodec = audioCodec; - FileFormat = fileFormat; - } - } -} \ No newline at end of file diff --git a/src/Tizen.Multimedia.Recorder/Recorder/AudioStreamStoringEventArgs.cs b/src/Tizen.Multimedia.Recorder/Recorder/AudioStreamStoringEventArgs.cs deleted file mode 100644 index f06d80a0e..000000000 --- a/src/Tizen.Multimedia.Recorder/Recorder/AudioStreamStoringEventArgs.cs +++ /dev/null @@ -1,61 +0,0 @@ -/* - * 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.Multimedia -{ - /// - /// Provides data for the event. - /// - public class AudioStreamStoringEventArgs : EventArgs - { - internal AudioStreamStoringEventArgs(IMediaBuffer stream, AudioSampleType type, int channel, - uint recordingTime) - { - Stream = stream; - Type = type; - Channels = channel; - Timestamp = recordingTime; - } - - /// - /// Gets the audio stream buffer. - /// - /// - /// If the stream is modified in the event handler, the modified data will be stored. - /// \n - /// The buffer is only valid in the event.\n - /// Any attempt to access to this buffer after the event ends will throw an exception. - /// - public IMediaBuffer Stream { get; } - - /// - /// Gets the audio format type. - /// - public AudioSampleType Type { get; } - - /// - /// Gets the number of channels. - /// - public int Channels { get; } - - /// - /// Gets the timestamp(PTS) of stream buffer in milliseconds. - /// - public long Timestamp { get; } - } -} diff --git a/src/Tizen.Multimedia.Recorder/Recorder/MuxedStreamDeliveredEventArgs.cs b/src/Tizen.Multimedia.Recorder/Recorder/MuxedStreamDeliveredEventArgs.cs deleted file mode 100644 index b038bd63b..000000000 --- a/src/Tizen.Multimedia.Recorder/Recorder/MuxedStreamDeliveredEventArgs.cs +++ /dev/null @@ -1,46 +0,0 @@ -/* - * 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.Multimedia -{ - /// - /// Provides data for the event. - /// - public class MuxedStreamDeliveredEventArgs : EventArgs - { - internal MuxedStreamDeliveredEventArgs(IMediaBuffer stream, ulong offset) - { - Stream = stream; - Offset = (long)offset; - } - - /// - /// Gets the stream buffer that will be recordered. - /// - /// - /// This buffer is read-only and only valid in the event.\n - /// Any attempt to access to this buffer after the event ends will throw an exception. - /// - public IMediaBuffer Stream { get; } - - /// - /// The file offset where the buffer will be written. - /// - public long Offset { get; } - } -} diff --git a/src/Tizen.Multimedia.Recorder/Recorder/Recorder.Capabilities.cs b/src/Tizen.Multimedia.Recorder/Recorder/Recorder.Capabilities.cs deleted file mode 100644 index 7bb79f744..000000000 --- a/src/Tizen.Multimedia.Recorder/Recorder/Recorder.Capabilities.cs +++ /dev/null @@ -1,104 +0,0 @@ -/* - * 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.Collections.Generic; -using System.Linq; -using Native = Interop.Recorder; -using NativeHandle = Interop.RecorderHandle; - -namespace Tizen.Multimedia -{ - internal class Capabilities - { - public IEnumerable SupportedFileFormats { get; } - public IEnumerable SupportedAudioCodecs { get; } - public IEnumerable SupportedVideoCodecs { get; } - - private RecorderErrorCode GetAudioEncoders(NativeHandle handle, List result) => - Native.GetAudioEncoders(handle, (codec, _) => { result.Add(codec); return true; }); - - private RecorderErrorCode GetFileFormats(NativeHandle handle, List result) => - Native.GetFileFormats(handle, (format, _) => { result.Add(format); return true; }); - - private RecorderErrorCode GetVideoEncoders(NativeHandle handle, List result) => - Native.GetVideoEncoders(handle, (codec, _) => { result.Add(codec); return true; }); - - private static IEnumerable Load(NativeHandle handle, Func, RecorderErrorCode> loadFunc) - { - var result = new List(); - - var ret = loadFunc(handle, result); - - if (ret == RecorderErrorCode.NotSupported) - { - return null; - } - - ret.ThrowIfError("Failed to load the capabilities"); - - return result.AsReadOnly(); - } - - internal Capabilities(NativeHandle handle) - { - SupportedVideoCodecs = Load(handle, GetVideoEncoders); - - SupportedAudioCodecs = Load(handle, GetAudioEncoders); - SupportedFileFormats = Load(handle, GetFileFormats); - } - } - - public partial class Recorder - { - internal static Lazy Capabilities { get; } = new Lazy(LoadCapabilities); - - private static Capabilities LoadCapabilities() - { - Native.Create(out var handle).ThrowIfError("Failed to load the capabilities"); ; - using (handle) - { - return new Capabilities(handle); - } - } - - /// - /// Gets the file formats that the current device supports. - /// - public static IEnumerable GetSupportedFileFormats() => Capabilities.Value.SupportedFileFormats; - - /// - /// Gets the audio encoders that the current device supports. - /// - public static IEnumerable GetSupportedAudioCodecs() => Capabilities.Value.SupportedAudioCodecs; - - internal static void ValidateFileFormat(RecorderFileFormat format) - { - if (GetSupportedFileFormats().Contains(format) == false) - { - throw new NotSupportedException($"{format.ToString()} is not supported."); - } - } - - internal static void ValidateAudioCodec(RecorderAudioCodec codec) - { - if (GetSupportedAudioCodecs().Contains(codec) == false) - { - throw new NotSupportedException($"{codec.ToString()} is not supported."); - } - } - } -} \ No newline at end of file diff --git a/src/Tizen.Multimedia.Recorder/Recorder/Recorder.Events.cs b/src/Tizen.Multimedia.Recorder/Recorder/Recorder.Events.cs deleted file mode 100755 index 31d644740..000000000 --- a/src/Tizen.Multimedia.Recorder/Recorder/Recorder.Events.cs +++ /dev/null @@ -1,261 +0,0 @@ -/* - * 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.Linq; -using Native = Interop.Recorder; - -namespace Tizen.Multimedia -{ - public partial class Recorder - { - /// - /// Occurs when an error occurs during the recorder operation. - /// - public event EventHandler ErrorOccurred; - private Native.RecorderErrorCallback _errorOccurredCallback; - - /// - /// Occurs after interrupt handling is completed. - /// - public event EventHandler Interrupted; - private Native.InterruptedCallback _interruptedCallback; - - /// - /// This event occurs when the recorder state is changed. - /// - public event EventHandler StateChanged; - private Native.StatechangedCallback _stateChangedCallback; - - /// - /// Occurs when the recording information changes. - /// - public event EventHandler RecordingStatusChanged; - private Native.RecordingProgressCallback _recordingProgressCallback; - - //TODO need to test dispose while event handler is running. - /// - /// Occurs when the audio stream data is being delivered. - /// - /// - /// Do not call and in this event. - /// - public event EventHandler AudioStreamStoring; - private Native.AudioStreamCallback _audioStreamCallback; - - /// - /// Occurs when recording limit is reached. - /// - /// - /// After this event is raised, the recording data is discarded and not written in the recording file. - /// - public event EventHandler RecordingLimitReached; - private Native.RecordingLimitReachedCallback _recordingLimitReachedCallback; - - /// - /// Occurs when the muxed stream data is being delivered. - /// - public event EventHandler MuxedStreamDelivered; - private Native.MuxedStreamCallback _muxedStreamCallback; - - private void RegisterEvents() - { - RegisterErrorCallback(); - RegisterInterruptedEvent(); - RegisterStateChangedEvent(); - RegisterRecordingProgressEvent(); - RegisterAudioStreamDeliveredEvent(); - RegisterRecordingLimitReachedEvent(); - RegisterMuxedStreamEvent(); - RegisterInterruptingEvent(); - } - - private void RegisterErrorCallback() - { - _errorOccurredCallback = (error, state, _) => - { - ErrorOccurred?.Invoke(this, new RecordingErrorOccurredEventArgs(error, state)); - }; - - Native.SetErrorCallback(_handle, _errorOccurredCallback, IntPtr.Zero). - ThrowIfError("Failed to initialize ErrorOccurred event"); - } - - private void RegisterInterruptedEvent() - { - _interruptedCallback = (policy, previousState, currentState, _) => - { - Interrupted?.Invoke(this, new RecorderInterruptedEventArgs(policy, previousState, currentState)); - }; - Native.SetInterruptedCallback(_handle, _interruptedCallback, IntPtr.Zero). - ThrowIfError("Failed to initialize Interrupted event"); - } - - private void RegisterStateChangedEvent() - { - _stateChangedCallback = (RecorderState previous, RecorderState current, bool byPolicy, IntPtr userData) => - { - SetState(current); - StateChanged?.Invoke(this, new RecorderStateChangedEventArgs(previous, current, byPolicy)); - }; - - Native.SetStateChangedCallback(_handle, _stateChangedCallback, IntPtr.Zero). - ThrowIfError("Failed to initialize StateChanged event"); - } - - private void RegisterRecordingProgressEvent() - { - _recordingProgressCallback = (ulong elapsedTime, ulong fileSize, IntPtr userData) => - { - RecordingStatusChanged?.Invoke(this, new RecordingStatusChangedEventArgs((long)elapsedTime, (long)fileSize)); - }; - - Native.SetRecordingProgressCallback(_handle, _recordingProgressCallback, IntPtr.Zero). - ThrowIfError("Failed to initialize RecordingStatusChanged event"); - } - - private void RegisterAudioStreamDeliveredEvent() - { - _audioStreamCallback = (stream, streamSize, type, channel, recordingTime, _) => - { - var handler = AudioStreamStoring; - if (handler != null) - { - _isInAudioStreamStoring.Value = true; - - using (var buffer = new ScopedMediaBuffer(stream, streamSize)) - { - handler.Invoke(this, - new AudioStreamStoringEventArgs(buffer, type, channel, recordingTime)); - } - } - }; - - Native.SetAudioStreamCallback(_handle, _audioStreamCallback, IntPtr.Zero). - ThrowIfError("Failed to initialize AudioStreamStoring event"); - } - - private void RegisterRecordingLimitReachedEvent() - { - _recordingLimitReachedCallback = (RecordingLimitType type, IntPtr userData) => - { - RecordingLimitReached?.Invoke(this, new RecordingLimitReachedEventArgs(type)); - }; - - Native.SetLimitReachedCallback(_handle, _recordingLimitReachedCallback, IntPtr.Zero). - ThrowIfError("Failed to initialize RecordingLimitReached event"); - } - - private void RegisterMuxedStreamEvent() - { - _muxedStreamCallback = (IntPtr stream, int streamSize, ulong offset, IntPtr userData) => - { - using (var buffer = new ScopedMediaBuffer(stream, streamSize, true)) - { - MuxedStreamDelivered?.Invoke(this, new MuxedStreamDeliveredEventArgs(buffer, offset)); - } - }; - - Native.SetMuxedStreamCallback(_handle, _muxedStreamCallback, IntPtr.Zero). - ThrowIfError("Failed to initialize MuxedStreamDelivered event"); - } - - /// - /// Occurs before interrupt handling is started. - /// - public event EventHandler Interrupting; - private Native.InterruptStartedCallback _interruptingCallback; - - private void RegisterInterruptingEvent() - { - _interruptingCallback = (policy, state, _) => - { - Interrupting?.Invoke(this, new RecorderInterruptingEventArgs(policy, state)); - }; - - Native.SetInterruptStartedCallback(_handle, _interruptingCallback). - ThrowIfError("Failed to initialize Interrupting event"); - } - - #region DeviceStateChanged - - private static object _deviceStateChangedLock = new object(); - private static EventHandler _deviceStateChanged; - private static Native.DeviceStateChangedCallback _deviceStateChangedCallback; - private static int _deviceStateChangedId; - - /// - /// Occurs when a recorder device state changes. - /// - public static event EventHandler DeviceStateChanged - { - add - { - if (value == null) - { - return; - } - - lock (_deviceStateChangedLock) - { - if (_deviceStateChanged == null) - { - RegisterDeviceStateChangedEvent(); - } - - _deviceStateChanged += value; - } - } - remove - { - if (value == null) - { - return; - } - - lock (_deviceStateChangedLock) - { - if (_deviceStateChanged == value) - { - UnregisterDeviceStateChangedEvent(); - } - - _deviceStateChanged -= value; - } - } - } - - private static void RegisterDeviceStateChangedEvent() - { - _deviceStateChangedCallback = (type, state, _) => - { - _deviceStateChanged?.Invoke(null, new RecorderDeviceStateChangedEventArgs(type, state)); - }; - - Native.AddDeviceStateChangedCallback(_deviceStateChangedCallback, IntPtr.Zero, out _deviceStateChangedId). - ThrowIfError("Failed to add the event handler."); - } - - private static void UnregisterDeviceStateChangedEvent() - { - Native.RemoveDeviceStateChangedCallback(_deviceStateChangedId). - ThrowIfError("Failed to remove the event handler."); - - _deviceStateChangedCallback = null; - } - #endregion - } -} diff --git a/src/Tizen.Multimedia.Recorder/Recorder/Recorder.Settings.cs b/src/Tizen.Multimedia.Recorder/Recorder/Recorder.Settings.cs deleted file mode 100755 index 59ba378e3..000000000 --- a/src/Tizen.Multimedia.Recorder/Recorder/Recorder.Settings.cs +++ /dev/null @@ -1,293 +0,0 @@ -/* - * 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.Diagnostics; -using Native = Interop.Recorder; - -namespace Tizen.Multimedia -{ - public partial class Recorder - { - private RecorderAudioCodec _audioCodec; - - /// - /// Gets the audio codec for encoding an audio stream. - /// - /// - public RecorderAudioCodec AudioCodec - { - get => _audioCodec; - internal set - { - Debug.Assert(Enum.IsDefined(typeof(RecorderAudioCodec), value)); - - if (this is AudioRecorder || value != RecorderAudioCodec.None) - { - ValidateAudioCodec(value); - } - - Native.SetAudioEncoder(Handle, value).ThrowIfError("Failed to set audio encoder."); - - _audioCodec = value; - } - } - - private RecorderFileFormat _fileFormat; - - /// - /// Gets the file format of the recording result. - /// - /// - public RecorderFileFormat FileFormat - { - get => _fileFormat; - internal set - { - Debug.Assert(Enum.IsDefined(typeof(RecorderFileFormat), value)); - - ValidateFileFormat(value); - - Native.SetFileFormat(Handle, value).ThrowIfError("Failed to set file format."); - - _fileFormat = value; - } - } - - /// - /// Gets or sets the number of the audio channel. - /// - /// - /// To set, the recorder must be in the or the state. - /// - /// - /// For mono recording, set the channel to 1. - /// For stereo recording, set the channel to 2. - /// - /// is less than or equal to zero. - /// The recorder is not in the valid state. - /// The recorder already has been disposed of. - public int AudioChannels - { - get - { - Native.GetAudioChannel(Handle, out var val).ThrowIfError("Failed to get audio channel."); - - return val; - } - - set - { - ValidateState(RecorderState.Idle, RecorderState.Ready); - - if (value <= 0) - { - throw new ArgumentOutOfRangeException(nameof(value), value, - "Audio channels can't be less than or equal to zero."); - } - - Native.SetAudioChannel(Handle, value).ThrowIfError("Failed to set audio channel"); - } - } - - /// - /// Gets or sets the audio device for recording. - /// - /// - /// To set, the recorder must be in the or the state. - /// - /// A that specifies the type of the audio device. - /// is not valid. - /// The recorder is not in the valid state. - /// The recorder already has been disposed of. - public RecorderAudioDevice AudioDevice - { - get - { - Native.GetAudioDevice(Handle, out var val).ThrowIfError("Failed to get the audio device."); - - return val; - } - - set - { - ValidateState(RecorderState.Idle, RecorderState.Ready); - - ValidationUtil.ValidateEnum(typeof(RecorderAudioDevice), value, nameof(value)); - - Native.SetAudioDevice(Handle, value).ThrowIfError("Failed to set the audio device."); - } - } - - /// - /// Gets or sets the sampling rate of an audio stream in hertz. - /// - /// - /// To set, the recorder must be in the or the state. - /// - /// is less than or equal to zero. - /// The recorder is not in the valid state. - /// The recorder already has been disposed of. - public int AudioSampleRate - { - get - { - Native.GetAudioSampleRate(Handle, out var val). - ThrowIfError("Failed to get audio sample rate."); - - return val; - } - - set - { - ValidateState(RecorderState.Idle, RecorderState.Ready); - - if (value <= 0) - { - throw new ArgumentOutOfRangeException(nameof(value), value, - "Sample rate can't be less than or equal to zero."); - } - - Native.SetAudioSampleRate(Handle, value). - ThrowIfError("Failed to set audio sample rate."); - } - } - - /// - /// Gets or sets the bitrate of an audio encoder in bits per second. - /// - /// - /// To set, the recorder must be in the or the state. - /// - /// is less than or equal to zero. - /// The recorder is not in the valid state. - /// The recorder already has been disposed of. - public int AudioBitRate - { - get - { - Native.GetAudioEncoderBitrate(Handle, out var val).ThrowIfError("Failed to get audio bitrate."); - - return val; - } - - set - { - ValidateState(RecorderState.Idle, RecorderState.Ready); - - if (value <= 0) - { - throw new ArgumentOutOfRangeException(nameof(value), value, - "Bit rate can't be less than or equal to zero."); - } - - Native.SetAudioEncoderBitrate(Handle, value). - ThrowIfError("Failed to set audio bitrate"); - } - } - - /// - /// Gets or sets the maximum size of a recording file. - /// - /// - /// The maximum size of a recording file in kilobytes, or 0 for unlimited size. - /// - /// - /// After reaching the limitation, the data which is being recorded will - /// be discarded and will not be written to the file.\n - /// \n - /// To set, the recorder must be in the or the state. - /// - /// is less than zero. - /// The recorder is not in the valid state. - /// The recorder already has been disposed of. - public int SizeLimit - { - get - { - int val = 0; - - Native.GetSizeLimit(Handle, out val). - ThrowIfError("Failed to get size limit."); - - return val; - } - - set - { - ValidateState(RecorderState.Idle, RecorderState.Ready); - - if (value < 0) - { - throw new ArgumentOutOfRangeException(nameof(value), value, - "Size limit can't be less than zero."); - } - - Native.SetSizeLimit(Handle, value).ThrowIfError("Failed to set size limit"); - } - } - - /// - /// Gets or sets the time limit of recording. - /// - /// - /// The time of recording in seconds, or 0 for unlimited time. - /// - /// - /// After reaching the limitation, the data which is being recorded will - /// be discarded and will not be written to the file.\n - /// \n - /// To set, the recorder must be in the or the state. - /// - /// is less than zero. - /// The recorder is not in the valid state. - /// The recorder already has been disposed of. - public int TimeLimit - { - get - { - Native.GetTimeLimit(Handle, out var val). - ThrowIfError("Failed to get time limit."); - - return val; - } - - set - { - ValidateState(RecorderState.Idle, RecorderState.Ready); - - if (value < 0) - { - throw new ArgumentOutOfRangeException(nameof(value), value, - "Time limit can't be less than zero."); - } - - Native.SetTimeLimit(Handle, value).ThrowIfError("Failed to set time limit."); - } - } - - /// - /// Gets or sets the mute state of a recorder. - /// - /// The recorder already has been disposed of. - public bool Muted - { - get => Native.GetMute(Handle); - - set => Native.SetMute(Handle, value).ThrowIfError("Failed to set mute"); - } - } -} \ No newline at end of file diff --git a/src/Tizen.Multimedia.Recorder/Recorder/Recorder.cs b/src/Tizen.Multimedia.Recorder/Recorder/Recorder.cs deleted file mode 100755 index 24807ce71..000000000 --- a/src/Tizen.Multimedia.Recorder/Recorder/Recorder.cs +++ /dev/null @@ -1,426 +0,0 @@ -/* - * 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.Diagnostics; -using System.Linq; -using System.Threading; -using Native = Interop.Recorder; -using NativeHandle = Interop.RecorderHandle; - -namespace Tizen.Multimedia -{ - /// - /// Recorder is a base class for audio and video recorders that - /// provides the ability to control the recording of a multimedia content.\n - /// \n - /// Simple audio and audio/video are supported. - /// - public abstract partial class Recorder : IDisposable - { - private readonly NativeHandle _handle; - private RecorderState _state; - private ThreadLocal _isInAudioStreamStoring = new ThreadLocal(); - - internal Recorder(NativeHandle handle) - { - _handle = handle; - - try - { - RegisterEvents(); - - SetState(State); - } - catch (Exception) - { - _handle.Dispose(); - throw; - } - } - - internal NativeHandle Handle - { - get - { - if (_disposed) - { - throw new ObjectDisposedException(nameof(Recorder)); - } - - return _handle; - } - } - - #region Dispose support - private bool _disposed; - - /// - /// Releases the unmanaged resources used by the Recorder. - /// - public void Dispose() - { - Dispose(true); - } - - /// - /// Releases the resources used by the Recorder. - /// - /// - /// true to release both managed and unmanaged resources; false to release only unmanaged resources. - /// - protected virtual void Dispose(bool disposing) - { - if (!_disposed) - { - if (_handle != null) - { - _handle.Dispose(); - } - - _disposed = true; - } - } - #endregion Dispose support - - #region State validation - internal void ValidateState(params RecorderState[] required) - { - Debug.Assert(required.Length > 0); - - var curState = _state; - if (!required.Contains(curState)) - { - throw new InvalidOperationException("The recorder is not in a valid state. " + - $"Current State : { curState }, Valid State : { string.Join(", ", required) }."); - } - } - - private void SetState(RecorderState state) - { - _state = state; - } - #endregion - - #region Properties - - /// - /// Gets the current state of the recorder. - /// - /// A that specifies the state of the recorder. - /// The recorder already has been disposed of. - public RecorderState State - { - get - { - Native.GetState(Handle, out var val).ThrowIfError("Failed to get recorder state."); - - return val; - } - } - #endregion Properties - - #region Methods - /// - /// Prepares the media recorder for recording. - /// - /// - /// The recorder should be in the state.\n - /// The state of the recorder will be the after this.\n - /// It has no effect if the current state is the . - /// - /// - /// The recorder is not in the valid state.\n - /// -or-\n - /// An internal error occurred. - /// - /// The recorder already has been disposed of. - public void Prepare() - { - if (_state == RecorderState.Ready) - { - return; - } - - ValidateState(RecorderState.Idle); - - Native.Prepare(Handle).ThrowIfError("Failed to prepare media recorder"); - - SetState(RecorderState.Ready); - } - - private void ThrowIfAccessedInAudioStreamStoring() - { - if (_isInAudioStreamStoring.Value) - { - throw new InvalidOperationException("The method can't be called in the AudioStreamStoring event"); - } - } - - /// - /// Resets the media recorder. - /// - /// - /// The recorder should be in the state. - /// The state of recorder will be the after this. - /// It has no effect if the current state is the . - /// - /// - /// The recorder is not in the valid state.\n - /// -or-\n - /// An internal error occurred. - /// - /// The recorder already has been disposed of. - public void Unprepare() - { - ThrowIfAccessedInAudioStreamStoring(); - - if (_state == RecorderState.Idle) - { - return; - } - - ValidateState(RecorderState.Ready); - - Native.Unprepare(Handle).ThrowIfError("Failed to reset the media recorder"); - - SetState(RecorderState.Idle); - } - - /// - /// Starts the recording. - /// - /// - /// The recorder must be in the state. - /// The state of the recorder will be the after this. \n - /// \n - /// If the specified path exists, the file is removed automatically and updated by new one.\n - /// The mediastorage privilege(http://tizen.org/privilege/mediastorage) is required if the path is relevant to media storage.\n - /// The externalstorage privilege(http://tizen.org/privilege/externalstorage) is required if the path is relevant to external storage.\n - /// \n - /// In the video recorder, some preview format does not support record mode. - /// You should use the default preview format or the in the record mode. - /// - /// The file path for recording result. - /// http://tizen.org/privilege/recorder - /// - /// The recorder is not in the valid state.\n - /// -or-\n - /// The preview format of the camera is not supported. - /// -or-\n - /// An internal error occurred. - /// - /// The recorder already has been disposed of. - /// is null. - /// is a zero-length string, contains only white space. - /// Caller does not have required privilege. - /// - /// - public void Start(string savePath) - { - ValidateState(RecorderState.Ready); - - if (savePath == null) - { - throw new ArgumentNullException(nameof(savePath)); - } - - if (string.IsNullOrWhiteSpace(savePath)) - { - throw new ArgumentException($"{nameof(savePath)} is an empty string.", nameof(savePath)); - } - - Native.SetFileName(Handle, savePath).ThrowIfError("Failed to set save path."); - - Native.Start(Handle).ThrowIfError("Failed to start the media recorder"); - - SetState(RecorderState.Recording); - } - - /// - /// Resumes the recording. - /// - /// - /// The recorder should be in the state. - /// The state of recorder will be the after this. - /// It has no effect if the current state is the . - /// - /// - /// The recorder is not in the valid state.\n - /// -or-\n - /// An internal error occurred. - /// - /// The recorder already has been disposed of. - public void Resume() - { - if (_state == RecorderState.Recording) - { - return; - } - - ValidateState(RecorderState.Paused); - - Native.Start(Handle).ThrowIfError("Failed to resume the media recorder"); - - SetState(RecorderState.Recording); - } - - /// - /// Pauses the recording. - /// - /// - /// The recorder should be in the state. - /// The state of the recorder will be the after this. - /// It has no effect if the current state is the . - /// - /// - /// The recorder is not in the valid state.\n - /// -or-\n - /// An internal error occurred. - /// - /// The recorder already has been disposed of. - public void Pause() - { - if (_state == RecorderState.Paused) - { - return; - } - - ValidateState(RecorderState.Recording); - - Native.Pause(Handle).ThrowIfError("Failed to pause the media recorder"); - - SetState(RecorderState.Paused); - } - - /// - /// Stops recording and saves the result. - /// - /// - /// The recorder must be in the or the state. - /// The state of the recorder will be the after the operation. - /// - /// - /// The recorder is not in the valid state.\n - /// -or-\n - /// The method is called in event. - /// -or-\n - /// An internal error occurred. - /// - /// The recorder already has been disposed of. - public void Commit() - { - ThrowIfAccessedInAudioStreamStoring(); - - ValidateState(RecorderState.Recording, RecorderState.Paused); - - Native.Commit(Handle).ThrowIfError("Failed to save the recorded content"); - - SetState(RecorderState.Ready); - } - - /// - /// Cancels the recording.\n - /// The recording data is discarded and not written in the recording file. - /// - /// - /// The recorder must be in the or the state. - /// The state of the recorder will be the after the operation. - /// - /// - /// The recorder is not in the valid state.\n - /// -or-\n - /// The method is called in event. - /// -or-\n - /// An internal error occurred. - /// - /// The recorder already has been disposed of. - public void Cancel() - { - ThrowIfAccessedInAudioStreamStoring(); - - ValidateState(RecorderState.Recording, RecorderState.Paused); - - Native.Cancel(Handle).ThrowIfError("Failed to cancel the recording"); - - SetState(RecorderState.Ready); - } - - /// - /// Apply the audio stream policy. - /// - /// - /// The recorder must be in the or the state. - /// - /// The policy to apply. - /// is null. - /// - /// The recorder is not in the valid state.\n - /// -or-\n - /// is not supported for the recorder. - /// -or-\n - /// An internal error occurred. - /// - /// - /// The recorder already has been disposed of.\n - /// -or-\n - /// already has been disposed of. - /// - public void ApplyAudioStreamPolicy(AudioStreamPolicy policy) - { - if (policy == null) - { - throw new ArgumentNullException(nameof(policy)); - } - - ValidateState(RecorderState.Idle, RecorderState.Ready); - - Native.SetAudioStreamPolicy(Handle, policy.Handle).ThrowIfError("Failed to apply the audio stream policy."); - } - - /// - /// Returns the peak audio input level in dB since the last call to this method. - /// - /// - /// 0dB indicates the maximum input level, -300dB indicates the minimum input level.\n - /// \n - /// The recorder must be in the or the state. - /// - /// The recorder already has been disposed of. - public double GetPeakAudioLevel() - { - ValidateState(RecorderState.Recording, RecorderState.Paused); - - Native.GetAudioLevel(Handle, out var level).ThrowIfError("Failed to get audio level."); - - return level; - } - - /// - /// Returns the state of recorder device. - /// - /// is invalid. - public static RecorderDeviceState GetDeviceState(RecorderType type) - { - ValidationUtil.ValidateEnum(typeof(RecorderType), type, nameof(type)); - - Native.GetDeviceState(type, out var state).ThrowIfError("Failed to get device state"); - - return state; - } - #endregion - } -} diff --git a/src/Tizen.Multimedia.Recorder/Recorder/RecorderDeviceException.cs b/src/Tizen.Multimedia.Recorder/Recorder/RecorderDeviceException.cs deleted file mode 100644 index 1267870eb..000000000 --- a/src/Tizen.Multimedia.Recorder/Recorder/RecorderDeviceException.cs +++ /dev/null @@ -1,48 +0,0 @@ -/* - * 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.Multimedia -{ - /// - /// The exception that is thrown when a recorder device-related error occurs. - /// - public class RecorderDeviceException : Exception - { - /// - /// Initializes a new instance of the class. - /// - public RecorderDeviceException() : base() - { - } - - /// - /// Initializes a new instance of the class with a specified error message. - /// - public RecorderDeviceException(string message) : base(message) - { - } - - /// - /// Initializes a new instance of the class with - /// a specified error message and inner exception. - /// - public RecorderDeviceException(string message, Exception innerException) : base(message, innerException) - { - } - } -} \ No newline at end of file diff --git a/src/Tizen.Multimedia.Recorder/Recorder/RecorderDeviceStateChangedEventArgs.cs b/src/Tizen.Multimedia.Recorder/Recorder/RecorderDeviceStateChangedEventArgs.cs deleted file mode 100644 index 1b52f517b..000000000 --- a/src/Tizen.Multimedia.Recorder/Recorder/RecorderDeviceStateChangedEventArgs.cs +++ /dev/null @@ -1,42 +0,0 @@ -/* - * 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.Multimedia -{ - /// - /// Provides data for the event. - /// - public class RecorderDeviceStateChangedEventArgs : EventArgs - { - internal RecorderDeviceStateChangedEventArgs(RecorderType type, RecorderDeviceState state) - { - Type = type; - DeviceState = state; - } - - /// - /// Gets the recorder type. - /// - public RecorderType Type { get; } - - /// - /// Gets the device state. - /// - public RecorderDeviceState DeviceState { get; } - } -} diff --git a/src/Tizen.Multimedia.Recorder/Recorder/RecorderEnums.cs b/src/Tizen.Multimedia.Recorder/Recorder/RecorderEnums.cs deleted file mode 100755 index 8d93891aa..000000000 --- a/src/Tizen.Multimedia.Recorder/Recorder/RecorderEnums.cs +++ /dev/null @@ -1,258 +0,0 @@ -/* - * 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. - */ - -namespace Tizen.Multimedia -{ - /// - /// Specifies audio codecs for . - /// - /// - public enum RecorderAudioCodec - { - /// - /// Disabled. - /// - None = -1, - /// - /// AMR codec. - /// - Amr, - /// - /// AAC codec. - /// - Aac, - /// - /// Vorbis codec. - /// - Vorbis, - /// - /// PCM codec. - /// - Pcm, - /// - /// The mp3 codec. - /// - Mp3 - } - - /// - /// Specifies audio capture devices for . - /// - public enum RecorderAudioDevice - { - /// - /// Capture audio from the Mic device. - /// - Mic, - /// - /// Capture audio from the modem. - /// - Modem - } - - /// - /// Specifies container formats for . - /// - /// - public enum RecorderFileFormat - { - /// - /// 3GP file format. - /// - ThreeGp, - /// - /// MP4 file format. - /// - Mp4, - /// - /// AMR file format. - /// - Amr, - /// - /// ADTS file format. - /// - Adts, - /// - /// WAV file format. - /// - Wav, - /// - /// OGG file format. - /// - Ogg, - /// - /// M2TS file format. - /// - M2ts - } - - /// - /// Specifies recorder policies. - /// - /// - /// - /// - public enum RecorderPolicy - { - /// - /// Security policy. - /// - Security = 4, - /// - /// Resource conflict policy. - /// - ResourceConflict - } - - /// - /// Specifies types of the recording limit for . - /// - /// - /// - /// - public enum RecordingLimitType - { - /// - /// Time limit in seconds of the recording file - /// - Time, - /// - /// Size limit in KB(KiloBytes) of the recording file. - /// - Size, - /// - /// No free space in the storage. - /// - Space - } - - /// - /// Specifies states for . - /// - public enum RecorderState - { - /// - /// Recorder is created, but not prepared. - /// - Idle = 1, - /// - /// Recorder is ready to record. In case of a video recorder, - /// preview display will be shown. - /// - Ready, - /// - /// Recorder is recording the media. - /// - Recording, - /// - /// Recorder is paused while recording the media. - /// - Paused - } - - /// - /// Specifies video codecs for . - /// - /// - public enum RecorderVideoCodec - { - /// - /// H263 codec. - /// - H263, - /// - /// H264 codec. - /// - H264, - /// - /// MPEG4 codec. - /// - Mpeg4, - /// - /// Theora codec. - /// - Theora - } - - /// - /// Specifies errors for . - /// - /// - public enum RecorderError - { - /// - /// ESD situation. - /// - Esd = RecorderErrorCode.Esd, - - /// - /// Device Error. - /// - DeviceError = RecorderErrorCode.DeviceError, - - /// - /// Internal error. - /// - InternalError = RecorderErrorCode.InvalidOperation, - - /// - /// Out of memory. - /// - OutOfMemory = RecorderErrorCode.OutOfMemory, - - /// - /// Out of storage or the storage has been removed while recording. - /// - OutOfStorage = RecorderErrorCode.OutOfStorage - } - - /// - /// Specifies recorder types for . - /// - public enum RecorderType - { - /// - /// Audio recorder. - /// - Audio, - - /// - /// Video recorder. - /// - Video - } - - /// - /// Specifies recorder device states for . - /// - public enum RecorderDeviceState - { - /// - /// No recording in progress. - /// - Idle, - - /// - /// Recording in progress. - /// - Recording, - - /// - /// All recordings are paused. - /// - Paused - } -} \ No newline at end of file diff --git a/src/Tizen.Multimedia.Recorder/Recorder/RecorderError.cs b/src/Tizen.Multimedia.Recorder/Recorder/RecorderError.cs deleted file mode 100644 index f189686bb..000000000 --- a/src/Tizen.Multimedia.Recorder/Recorder/RecorderError.cs +++ /dev/null @@ -1,91 +0,0 @@ -/* - * 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.IO; -using Tizen.Internals.Errors; - -namespace Tizen.Multimedia -{ - internal enum RecorderErrorCode - { - TizenErrorRecorder = -0x01950000, - RecorderErrorClass = TizenErrorRecorder | 0x10, - None = ErrorCode.None, - InvalidParameter = ErrorCode.InvalidParameter, - InvalidState = RecorderErrorClass | 0x02, - OutOfMemory = ErrorCode.OutOfMemory, - DeviceError = RecorderErrorClass | 0x04, - InvalidOperation = ErrorCode.InvalidOperation, - SecurityRestricted = RecorderErrorClass | 0x07, - Esd = RecorderErrorClass | 0x0a, - OutOfStorage = RecorderErrorClass | 0x0b, - PermissionDenied = ErrorCode.PermissionDenied, - NotSupported = ErrorCode.NotSupported, - ResourceConflict = RecorderErrorClass | 0x0c, - ServiceDisconnected = RecorderErrorClass | 0x0d - } - - internal static class RecorderErrorCodeExtensions - { - internal static RecorderErrorCode Ignore(this RecorderErrorCode errorCode, RecorderErrorCode ignore) - { - return (ignore == errorCode) ? RecorderErrorCode.None : errorCode; - } - - internal static void ThrowIfError(this RecorderErrorCode errorCode, string errorMessage) - { - if (errorCode == RecorderErrorCode.None) - { - return; - } - - switch (errorCode) - { - case RecorderErrorCode.InvalidParameter: - throw new ArgumentException(errorMessage); - - case RecorderErrorCode.OutOfMemory: - throw new OutOfMemoryException($"{errorMessage}."); - - case RecorderErrorCode.DeviceError: - case RecorderErrorCode.Esd: - throw new RecorderDeviceException($"{errorMessage}; {errorCode.ToString()}."); - - case RecorderErrorCode.SecurityRestricted: - throw new UnauthorizedAccessException($"The feature is currently disabled by the device policy; {errorCode.ToString()}."); - - case RecorderErrorCode.PermissionDenied: - throw new UnauthorizedAccessException($"{errorMessage}; {errorCode.ToString()}."); - - case RecorderErrorCode.NotSupported: - throw new NotSupportedException($"{errorMessage}."); - - case RecorderErrorCode.InvalidState: - case RecorderErrorCode.InvalidOperation: - case RecorderErrorCode.ResourceConflict: - case RecorderErrorCode.ServiceDisconnected: - throw new InvalidOperationException($"{errorMessage}; {errorCode.ToString()}."); - - case RecorderErrorCode.OutOfStorage: - throw new IOException($"{errorMessage}; Not enough disk space or specified path is not available to ."); - - default: - throw new Exception($"Unknown error : {errorCode.ToString()}."); - } - } - } -} diff --git a/src/Tizen.Multimedia.Recorder/Recorder/RecorderExtensions.cs b/src/Tizen.Multimedia.Recorder/Recorder/RecorderExtensions.cs deleted file mode 100644 index 918208986..000000000 --- a/src/Tizen.Multimedia.Recorder/Recorder/RecorderExtensions.cs +++ /dev/null @@ -1,116 +0,0 @@ -/* - * 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.Collections.Generic; -using System.Linq; - -namespace Tizen.Multimedia -{ - /// - /// Provides extension methods for . - /// - public static class RecorderExtensions - { - /// - /// Returns supported file formats for a . - /// - /// An IEnumerable of representing the supported file formats. - /// The . - /// is invalid. - public static IEnumerable GetSupportedFileFormats(this RecorderVideoCodec videoCodec) - { - ValidationUtil.ValidateEnum(typeof(RecorderVideoCodec), videoCodec, nameof(videoCodec)); - - switch (videoCodec) - { - case RecorderVideoCodec.H263: - yield return RecorderFileFormat.ThreeGp; - break; - - case RecorderVideoCodec.H264: - case RecorderVideoCodec.Mpeg4: - yield return RecorderFileFormat.ThreeGp; - yield return RecorderFileFormat.Mp4; - yield return RecorderFileFormat.M2ts; - break; - - case RecorderVideoCodec.Theora: - yield return RecorderFileFormat.Ogg; - break; - } - } - - /// - /// Returns supported file formats for a . - /// - /// An IEnumerable of representing the supported file formats. - /// The . - /// is invalid. - public static IEnumerable GetSupportedFileFormats(this RecorderAudioCodec audioCodec) - { - ValidationUtil.ValidateEnum(typeof(RecorderAudioCodec), audioCodec, nameof(audioCodec)); - - switch (audioCodec) - { - case RecorderAudioCodec.Amr: - yield return RecorderFileFormat.ThreeGp; - yield return RecorderFileFormat.Amr; - break; - - case RecorderAudioCodec.Mp3: - yield return RecorderFileFormat.Mp4; - yield return RecorderFileFormat.M2ts; - break; - - case RecorderAudioCodec.Aac: - yield return RecorderFileFormat.ThreeGp; - yield return RecorderFileFormat.Mp4; - yield return RecorderFileFormat.M2ts; - yield return RecorderFileFormat.Adts; - break; - - case RecorderAudioCodec.Vorbis: - yield return RecorderFileFormat.Ogg; - break; - - case RecorderAudioCodec.Pcm: - yield return RecorderFileFormat.Wav; - break; - } - } - - internal static void ThrowIfFormatNotSupported(this RecorderAudioCodec audioCodec, RecorderFileFormat fileFormat) - { - ValidationUtil.ValidateEnum(typeof(RecorderFileFormat), fileFormat, nameof(fileFormat)); - - if (audioCodec.GetSupportedFileFormats().Contains(fileFormat) == false) - { - throw new NotSupportedException($"{audioCodec} does not support {fileFormat}."); - } - } - - internal static void ThrowIfFormatNotSupported(this RecorderVideoCodec videoCodec, RecorderFileFormat fileFormat) - { - ValidationUtil.ValidateEnum(typeof(RecorderFileFormat), fileFormat, nameof(fileFormat)); - - if (videoCodec.GetSupportedFileFormats().Contains(fileFormat) == false) - { - throw new NotSupportedException($"{videoCodec} does not support {fileFormat}."); - } - } - } -} \ No newline at end of file diff --git a/src/Tizen.Multimedia.Recorder/Recorder/RecorderInterruptedEventArgs.cs b/src/Tizen.Multimedia.Recorder/Recorder/RecorderInterruptedEventArgs.cs deleted file mode 100755 index cae132986..000000000 --- a/src/Tizen.Multimedia.Recorder/Recorder/RecorderInterruptedEventArgs.cs +++ /dev/null @@ -1,48 +0,0 @@ -/* - * 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.Multimedia -{ - /// - /// Provides data for the event. - /// - public class RecorderInterruptedEventArgs : EventArgs - { - internal RecorderInterruptedEventArgs(RecorderPolicy policy, RecorderState previous, RecorderState current) - { - Reason = policy; - Previous = previous; - Current = current; - } - - /// - /// Gets the reason that interrupted the recorder. - /// - public RecorderPolicy Reason { get; } - - /// - /// Gets the previous state of the recorder. - /// - public RecorderState Previous { get; } - - /// - /// Gets the current state of the recorder. - /// - public RecorderState Current { get; } - } -} diff --git a/src/Tizen.Multimedia.Recorder/Recorder/RecorderInterruptingEventArgs.cs b/src/Tizen.Multimedia.Recorder/Recorder/RecorderInterruptingEventArgs.cs deleted file mode 100644 index 4e90317d3..000000000 --- a/src/Tizen.Multimedia.Recorder/Recorder/RecorderInterruptingEventArgs.cs +++ /dev/null @@ -1,42 +0,0 @@ -/* - * 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.Multimedia -{ - /// - /// Provides data for the event. - /// - public class RecorderInterruptingEventArgs : EventArgs - { - internal RecorderInterruptingEventArgs(RecorderPolicy policy, RecorderState state) - { - Reason = policy; - State = state; - } - - /// - /// Gets the reason of the interrupt. - /// - public RecorderPolicy Reason { get; } - - /// - /// Gets the previous state of the recorder. - /// - public RecorderState State { get; } - } -} diff --git a/src/Tizen.Multimedia.Recorder/Recorder/RecorderStateChangedEventArgs.cs b/src/Tizen.Multimedia.Recorder/Recorder/RecorderStateChangedEventArgs.cs deleted file mode 100755 index 34b85229f..000000000 --- a/src/Tizen.Multimedia.Recorder/Recorder/RecorderStateChangedEventArgs.cs +++ /dev/null @@ -1,49 +0,0 @@ -/* - * 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.Multimedia -{ - /// - /// Provides data for the event. - /// - public class RecorderStateChangedEventArgs : EventArgs - { - internal RecorderStateChangedEventArgs(RecorderState previous, RecorderState current, bool byPolicy) - { - PreviousState = previous; - CurrentState = current; - IsStateChangedByPolicy = byPolicy; - } - - /// - /// Gets the previous state of the recorder. - /// - public RecorderState PreviousState { get; } - - /// - /// Gets the current state of the recorder. - /// - public RecorderState CurrentState { get; } - - /// - /// Gets the value indicating whether the state is changed by policy. - /// - /// true if the state changed by policy such as resource conflict or security, otherwise false. - public bool IsStateChangedByPolicy { get; } - } -} diff --git a/src/Tizen.Multimedia.Recorder/Recorder/RecordingErrorOccurredEventArgs.cs b/src/Tizen.Multimedia.Recorder/Recorder/RecordingErrorOccurredEventArgs.cs deleted file mode 100755 index 059ae9f14..000000000 --- a/src/Tizen.Multimedia.Recorder/Recorder/RecordingErrorOccurredEventArgs.cs +++ /dev/null @@ -1,36 +0,0 @@ -/* - * 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.Multimedia -{ - /// - /// Provides data for the event. - /// - public class RecordingErrorOccurredEventArgs : EventArgs - { - internal RecordingErrorOccurredEventArgs(RecorderError error, RecorderState state) - { - Error = error; - } - - /// - /// Gets the error. - /// - public RecorderError Error { get; } - } -} diff --git a/src/Tizen.Multimedia.Recorder/Recorder/RecordingLimitReachedEventArgs.cs b/src/Tizen.Multimedia.Recorder/Recorder/RecordingLimitReachedEventArgs.cs deleted file mode 100755 index 7fbcd4e95..000000000 --- a/src/Tizen.Multimedia.Recorder/Recorder/RecordingLimitReachedEventArgs.cs +++ /dev/null @@ -1,41 +0,0 @@ -/* - * 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.Multimedia -{ - /// - /// Provides data for the event. - /// - public class RecordingLimitReachedEventArgs : EventArgs - { - /// - /// Initializes a new instance of the class - /// with the specified type. - /// - /// The type of the limit. - public RecordingLimitReachedEventArgs(RecordingLimitType type) - { - Type = type; - } - - /// - /// Gets the type of the limit. - /// - public RecordingLimitType Type { get; } - } -} diff --git a/src/Tizen.Multimedia.Recorder/Recorder/RecordingStatusChangedEventArgs.cs b/src/Tizen.Multimedia.Recorder/Recorder/RecordingStatusChangedEventArgs.cs deleted file mode 100644 index 5c5726b8a..000000000 --- a/src/Tizen.Multimedia.Recorder/Recorder/RecordingStatusChangedEventArgs.cs +++ /dev/null @@ -1,48 +0,0 @@ -/* - * 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.Multimedia -{ - /// - /// Provides data for the event. - /// - public class RecordingStatusChangedEventArgs : EventArgs - { - /// - /// Initializes a new instance of the class - /// with the specified elapsed time and file size. - /// - /// The time of the recording in milliseconds. - /// The size of the recording in kilobytes. - public RecordingStatusChangedEventArgs(long elapsedTime, long fileSize) - { - ElapsedTime = elapsedTime; - FileSize = fileSize; - } - - /// - /// Gets the time of the recording in milliseconds. - /// - public long ElapsedTime { get; } - - /// - /// Gets the size of the recording file in kilobytes. - /// - public long FileSize { get; } - } -} diff --git a/src/Tizen.Multimedia.Recorder/Recorder/VideoRecorder.Capabilities.cs b/src/Tizen.Multimedia.Recorder/Recorder/VideoRecorder.Capabilities.cs deleted file mode 100644 index 7e50b68ce..000000000 --- a/src/Tizen.Multimedia.Recorder/Recorder/VideoRecorder.Capabilities.cs +++ /dev/null @@ -1,102 +0,0 @@ -/* - * 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.Collections.Generic; -using System.Diagnostics; -using System.Linq; -using Native = Interop.Recorder; -using NativeHandle = Interop.RecorderHandle; - -namespace Tizen.Multimedia -{ - public partial class VideoRecorder - { - private static IEnumerable _frontResolutions; - private static IEnumerable _rearResolutions; - - private static IEnumerable GetVideoResolutions(NativeHandle handle) - { - var result = new List(); - - var ret = Native.GetVideoResolutions(handle, (w, h, _) => { result.Add(new Size(w, h)); return true; }); - - if (ret == RecorderErrorCode.NotSupported) - { - throw new NotSupportedException("Video recording is not supported."); - } - - ret.ThrowIfError("Failed to load the resolutions"); - - return result.AsReadOnly(); - } - - private static IEnumerable LoadVideoResolutions(CameraDevice device) - { - using (var camera = new Camera(device)) - { - Native.CreateVideo(camera.Handle, out var handle).ThrowIfError("Failed to get the resolutions"); - - using (handle) - { - return GetVideoResolutions(handle); - } - } - } - - /// - /// Gets the video resolutions that the current device supports. - /// - /// http://tizen.org/feature/camera - /// The camera device to retrieve the supported resolutions - /// A required feature is not supported. - /// is invalid. - public static IEnumerable GetSupportedVideoResolutions(CameraDevice device) - { - ValidationUtil.ValidateEnum(typeof(CameraDevice), device, nameof(device)); - - if (device == CameraDevice.Front) - { - return _frontResolutions ?? (_frontResolutions = LoadVideoResolutions(CameraDevice.Front)); - } - - if (device == CameraDevice.Front) - { - return _rearResolutions ?? (_rearResolutions = LoadVideoResolutions(CameraDevice.Rear)); - } - - Debug.Fail($"No cache for {device}."); - - return LoadVideoResolutions(device); - } - - /// - /// Gets the video encoders that the current device supports. - /// - /// http://tizen.org/feature/camera - /// A required feature is not supported. - public static IEnumerable GetSupportedVideoCodecs() - => Capabilities.Value.SupportedVideoCodecs ?? throw new NotSupportedException("Video recording is not supported."); - - internal static void ValidateVideoCodec(RecorderVideoCodec codec) - { - if (GetSupportedVideoCodecs().Contains(codec) == false) - { - throw new NotSupportedException($"{codec.ToString()} is not supported."); - } - } - } -} \ No newline at end of file diff --git a/src/Tizen.Multimedia.Recorder/Recorder/VideoRecorder.cs b/src/Tizen.Multimedia.Recorder/Recorder/VideoRecorder.cs deleted file mode 100755 index fa8821a2e..000000000 --- a/src/Tizen.Multimedia.Recorder/Recorder/VideoRecorder.cs +++ /dev/null @@ -1,365 +0,0 @@ -/* - * 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.Diagnostics; -using Native = Interop.Recorder; -using NativeHandle = Interop.RecorderHandle; - -namespace Tizen.Multimedia -{ - /// - /// Provides the ability to control video recording. - /// - public partial class VideoRecorder : Recorder - { - private static NativeHandle CreateHandle(Camera camera) - { - if (camera == null) - { - throw new ArgumentNullException(nameof(camera)); - } - - Native.CreateVideo(camera.Handle, out var handle). - ThrowIfError("Failed to create video recorder."); - - return handle; - } - - private static void ThrowIfCodecAndFormatNotValid(RecorderVideoCodec videoCodec, - RecorderAudioCodec audioCodec, RecorderFileFormat fileFormat) - { - videoCodec.ThrowIfFormatNotSupported(fileFormat); - - if (audioCodec != RecorderAudioCodec.None) - { - audioCodec.ThrowIfFormatNotSupported(fileFormat); - } - } - - /// - /// Initializes a new instance of the class with the specified camera, video codec and file format. - /// - /// - /// If the state of is , - /// the will be changed to the recommended format for recording.\n - /// \n - /// The initial state of the Recorder will be - /// if the state of is or . - /// - /// The camera object. - /// The codec for video encoding. - /// The format of result file. - /// http://tizen.org/feature/camera - /// An internal error occurred. - /// - /// A required feature is not supported.\n - /// -or-\n - /// is not supported.\n - /// -or-\n - /// is not supported with the specified video codec. - /// - /// - /// is not valid.\n - /// -or-\n - /// is not valid. - /// - /// has been disposed of. - /// is null. - /// - /// - /// - /// - /// - public VideoRecorder(Camera camera, RecorderVideoCodec videoCodec, RecorderFileFormat fileFormat) : - this(camera, videoCodec, RecorderAudioCodec.None, fileFormat) - { - } - - /// - /// Initializes a new instance of the class with the specified camera, video codec, - /// audio codec and file format. - /// - /// - /// If the state of is , - /// the will be changed to the recommended format for recording.\n - /// \n - /// The initial state of the Recorder will be - /// if the state of is or . - /// - /// The camera object. - /// The codec for video encoding. - /// The codec for audio encoding. - /// The format of result file. - /// http://tizen.org/feature/camera - /// An internal error occurred. - /// - /// A required feature is not supported.\n - /// -or-\n - /// is not supported.\n - /// -or-\n - /// is not supported.\n - /// -or-\n - /// is not supported with the specified video codec. - /// -or-\n - /// is not supported with the specified audio codec. - /// - /// - /// is not valid.\n - /// -or-\n - /// is not valid.\n - /// -or-\n - /// is not valid. - /// - /// has been disposed of. - /// is null. - /// - /// - /// - /// - /// - /// - /// - public VideoRecorder(Camera camera, RecorderVideoCodec videoCodec, - RecorderAudioCodec audioCodec, RecorderFileFormat fileFormat) : base(CreateHandle(camera)) - { - SetFormatAndCodec(videoCodec, RecorderAudioCodec.None, fileFormat); - } - - /// - /// Sets the video codec and the file format for recording. Audio will not recorded. - /// - /// The codec for video encoding. - /// The format of result file. - /// - /// is not supported.\n - /// -or-\n - /// is not supported with the specified video codec. - /// - /// - /// is not valid.\n - /// -or-\n - /// is not valid. - /// - /// - /// - /// - /// - /// - public void SetFormatAndCodec(RecorderVideoCodec videoCodec, RecorderFileFormat fileFormat) - { - SetFormatAndCodec(videoCodec, RecorderAudioCodec.None, fileFormat); - } - - /// - /// Sets the video codec, audio codec and the file format for recording. - /// - /// The codec for video encoding. - /// The codec for audio encoding. - /// The format of result file. - /// - /// is not supported.\n - /// -or-\n - /// is not supported.\n - /// -or-\n - /// is not supported with the specified video codec. - /// -or-\n - /// is not supported with the specified audio codec. - /// - /// - /// is not valid.\n - /// -or-\n - /// is not valid.\n - /// -or-\n - /// is not valid. - /// - /// - /// - /// - /// - /// - /// - /// - public void SetFormatAndCodec(RecorderVideoCodec videoCodec, RecorderAudioCodec audioCodec, RecorderFileFormat fileFormat) - { - ThrowIfCodecAndFormatNotValid(videoCodec, audioCodec, fileFormat); - - VideoCodec = videoCodec; - AudioCodec = audioCodec; - FileFormat = fileFormat; - } - - #region Properties - - private RecorderVideoCodec _videoCodec; - - /// - /// Gets the audio codec for encoding an audio stream. - /// - public RecorderVideoCodec VideoCodec - { - get => _videoCodec; - internal set - { - Debug.Assert(Enum.IsDefined(typeof(RecorderVideoCodec), value)); - - ValidateVideoCodec(value); - - Native.SetVideoEncoder(Handle, value).ThrowIfError("Failed to set video codec."); - - _videoCodec = value; - } - } - - /// - /// Gets or sets the video recording motion rate. - /// - /// - /// The attribute is valid only in a video recorder.\n - /// If the rate is in range of 0-1, the video is recorded in a slow motion mode.\n - /// If the rate is bigger than 1, the video is recorded in a fast motion mode.\n - /// \n - /// To set, the recorder must be in the or the state. - /// - /// The is less than or equal to 0. - /// The recorder is not in the valid state. - /// The recorder already has been disposed of. - public double VideoMotionRate - { - get - { - Native.GetMotionRate(Handle, out var val).ThrowIfError("Failed to get video motion rate."); - - return val; - } - - set - { - ValidateState(RecorderState.Idle, RecorderState.Ready); - - if (value <= 0) - { - throw new ArgumentOutOfRangeException(nameof(value), value, - "Video Motion rate can't be less than zero."); - } - - Native.SetMotionRate(Handle, value). - ThrowIfError("Failed to set video motion rate"); - } - } - - /// - /// Gets or sets the orientation in the video metadata tag. - /// - /// A that specifies the type of orientation. - /// is not valid. - /// The recorder already has been disposed of. - public Rotation VideoOrientationTag - { - get - { - Native.GetOrientationTag(Handle, out var val).ThrowIfError("Failed to get recorder orientation."); - - return val; - } - - set - { - ValidationUtil.ValidateEnum(typeof(Rotation), value, nameof(value)); - - Native.SetOrientationTag(Handle, value). - ThrowIfError("Failed to set recorder orientation"); - } - } - - /// - /// Gets or sets the resolution of the video recording. - /// - /// - /// To set, the recorder must be in the or the state. - /// - /// Width or height of is less than or equal to zero. - /// is not supported. - /// The recorder is not in the valid state. - /// The recorder already has been disposed of. - /// - public Size VideoResolution - { - get - { - Native.GetVideoResolution(Handle, out var width, out var height). - ThrowIfError("Failed to get camera video resolution"); - - return new Size(width, height); - } - - set - { - ValidateState(RecorderState.Idle, RecorderState.Ready); - - if (value.Width <= 0 || value.Height <= 0) - { - throw new ArgumentOutOfRangeException(nameof(value), value, - "Resolution can't be less than or equal to zero."); - } - - var ret = Native.SetVideoResolution(Handle, value.Width, value.Height); - - if (ret == RecorderErrorCode.InvalidParameter) - { - throw new NotSupportedException($"Resolution({value.ToString()}) is not supported."); - } - - ret.ThrowIfError("Failed to set video resolution."); - } - } - - /// - /// Gets or sets the bitrate of the video encoder in bits per second. - /// - /// - /// To set, the recorder must be in the or state. - /// - /// is less than or equal to zero. - /// The recorder is not in the valid state. - /// The recorder already has been disposed of. - public int VideoBitRate - { - get - { - Native.GetVideoEncoderBitrate(Handle, out var val).ThrowIfError("Failed to get video bitrate."); - - return val; - } - - set - { - ValidateState(RecorderState.Idle, RecorderState.Ready); - - if (value <= 0) - { - throw new ArgumentOutOfRangeException(nameof(value), value, - "Bit rate can't be less than or equal to zero."); - } - - Native.SetVideoEncoderBitrate(Handle, value). - ThrowIfError("Failed to set video bitrate"); - } - } - - #endregion - } -} \ No newline at end of file diff --git a/src/Tizen.Multimedia.Recorder/Tizen.Multimedia.Recorder.csproj b/src/Tizen.Multimedia.Recorder/Tizen.Multimedia.Recorder.csproj deleted file mode 100644 index bd01a3b36..000000000 --- a/src/Tizen.Multimedia.Recorder/Tizen.Multimedia.Recorder.csproj +++ /dev/null @@ -1,13 +0,0 @@ - - - - netstandard2.0 - - - - - - - - - \ No newline at end of file diff --git a/src/Tizen.Multimedia.Recorder/Tizen.Multimedia.Recorder.sln b/src/Tizen.Multimedia.Recorder/Tizen.Multimedia.Recorder.sln deleted file mode 100755 index 9ba43eefa..000000000 --- a/src/Tizen.Multimedia.Recorder/Tizen.Multimedia.Recorder.sln +++ /dev/null @@ -1,84 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26730.12 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Multimedia.Recorder", "Tizen.Multimedia.Recorder.csproj", "{78B69A8B-FCDA-40BF-B9F8-7EF17ECEEB63}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Multimedia", "..\Tizen.Multimedia\Tizen.Multimedia.csproj", "{84F6700F-1795-4F1A-A18A-7BC64A9B103D}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ElmSharp", "..\ElmSharp\ElmSharp.csproj", "{94920190-FD55-408C-9F71-EF55173586D5}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen", "..\Tizen\Tizen.csproj", "{1D297A7B-8190-4B39-B8D9-60310118B412}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Log", "..\Tizen.Log\Tizen.Log.csproj", "{20523C8C-62D4-487E-BD17-6C6847B3F3C0}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.System.Information", "..\Tizen.System.Information\Tizen.System.Information.csproj", "{C62E34CA-BF10-4B7A-87A4-3AC67C488EF0}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Multimedia.AudioIO", "..\Tizen.Multimedia.AudioIO\Tizen.Multimedia.AudioIO.csproj", "{6FCEB61E-089D-4959-A7E0-28AC512AF6BE}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Multimedia.Camera", "..\Tizen.Multimedia.Camera\Tizen.Multimedia.Camera.csproj", "{511D947C-5A2C-4E29-B958-7C28065F94C3}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Applications.Common", "..\Tizen.Applications.Common\Tizen.Applications.Common.csproj", "{4B348E66-5FE7-46C9-AE4D-BDEAD667CC80}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.NUI", "..\Tizen.NUI\Tizen.NUI.csproj", "{C8A06A7A-73C2-435E-9D9B-E54B8DACC95C}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.System.SystemSettings", "..\Tizen.System.SystemSettings\Tizen.System.SystemSettings.csproj", "{B4A0715B-D4C6-4309-9470-5C12A109FAFE}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {78B69A8B-FCDA-40BF-B9F8-7EF17ECEEB63}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {78B69A8B-FCDA-40BF-B9F8-7EF17ECEEB63}.Debug|Any CPU.Build.0 = Debug|Any CPU - {78B69A8B-FCDA-40BF-B9F8-7EF17ECEEB63}.Release|Any CPU.ActiveCfg = Release|Any CPU - {78B69A8B-FCDA-40BF-B9F8-7EF17ECEEB63}.Release|Any CPU.Build.0 = Release|Any CPU - {84F6700F-1795-4F1A-A18A-7BC64A9B103D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {84F6700F-1795-4F1A-A18A-7BC64A9B103D}.Debug|Any CPU.Build.0 = Debug|Any CPU - {84F6700F-1795-4F1A-A18A-7BC64A9B103D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {84F6700F-1795-4F1A-A18A-7BC64A9B103D}.Release|Any CPU.Build.0 = Release|Any CPU - {94920190-FD55-408C-9F71-EF55173586D5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {94920190-FD55-408C-9F71-EF55173586D5}.Debug|Any CPU.Build.0 = Debug|Any CPU - {94920190-FD55-408C-9F71-EF55173586D5}.Release|Any CPU.ActiveCfg = Release|Any CPU - {94920190-FD55-408C-9F71-EF55173586D5}.Release|Any CPU.Build.0 = Release|Any CPU - {1D297A7B-8190-4B39-B8D9-60310118B412}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1D297A7B-8190-4B39-B8D9-60310118B412}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1D297A7B-8190-4B39-B8D9-60310118B412}.Release|Any CPU.ActiveCfg = Release|Any CPU - {1D297A7B-8190-4B39-B8D9-60310118B412}.Release|Any CPU.Build.0 = Release|Any CPU - {20523C8C-62D4-487E-BD17-6C6847B3F3C0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {20523C8C-62D4-487E-BD17-6C6847B3F3C0}.Debug|Any CPU.Build.0 = Debug|Any CPU - {20523C8C-62D4-487E-BD17-6C6847B3F3C0}.Release|Any CPU.ActiveCfg = Release|Any CPU - {20523C8C-62D4-487E-BD17-6C6847B3F3C0}.Release|Any CPU.Build.0 = Release|Any CPU - {C62E34CA-BF10-4B7A-87A4-3AC67C488EF0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C62E34CA-BF10-4B7A-87A4-3AC67C488EF0}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C62E34CA-BF10-4B7A-87A4-3AC67C488EF0}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C62E34CA-BF10-4B7A-87A4-3AC67C488EF0}.Release|Any CPU.Build.0 = Release|Any CPU - {6FCEB61E-089D-4959-A7E0-28AC512AF6BE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6FCEB61E-089D-4959-A7E0-28AC512AF6BE}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6FCEB61E-089D-4959-A7E0-28AC512AF6BE}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6FCEB61E-089D-4959-A7E0-28AC512AF6BE}.Release|Any CPU.Build.0 = Release|Any CPU - {511D947C-5A2C-4E29-B958-7C28065F94C3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {511D947C-5A2C-4E29-B958-7C28065F94C3}.Debug|Any CPU.Build.0 = Debug|Any CPU - {511D947C-5A2C-4E29-B958-7C28065F94C3}.Release|Any CPU.ActiveCfg = Release|Any CPU - {511D947C-5A2C-4E29-B958-7C28065F94C3}.Release|Any CPU.Build.0 = Release|Any CPU - {4B348E66-5FE7-46C9-AE4D-BDEAD667CC80}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {4B348E66-5FE7-46C9-AE4D-BDEAD667CC80}.Debug|Any CPU.Build.0 = Debug|Any CPU - {4B348E66-5FE7-46C9-AE4D-BDEAD667CC80}.Release|Any CPU.ActiveCfg = Release|Any CPU - {4B348E66-5FE7-46C9-AE4D-BDEAD667CC80}.Release|Any CPU.Build.0 = Release|Any CPU - {C8A06A7A-73C2-435E-9D9B-E54B8DACC95C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C8A06A7A-73C2-435E-9D9B-E54B8DACC95C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C8A06A7A-73C2-435E-9D9B-E54B8DACC95C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C8A06A7A-73C2-435E-9D9B-E54B8DACC95C}.Release|Any CPU.Build.0 = Release|Any CPU - {B4A0715B-D4C6-4309-9470-5C12A109FAFE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B4A0715B-D4C6-4309-9470-5C12A109FAFE}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B4A0715B-D4C6-4309-9470-5C12A109FAFE}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B4A0715B-D4C6-4309-9470-5C12A109FAFE}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {4B1CEF84-6D38-4D95-BFD6-51087A178A29} - EndGlobalSection -EndGlobal diff --git a/src/Tizen.Multimedia.Remoting/Interop/Interop.Libraries.cs b/src/Tizen.Multimedia.Remoting/Interop/Interop.Libraries.cs deleted file mode 100644 index d479daac2..000000000 --- a/src/Tizen.Multimedia.Remoting/Interop/Interop.Libraries.cs +++ /dev/null @@ -1,25 +0,0 @@ -/* - * 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 ScreenMirroring = "libcapi-media-screen-mirroring.so.0"; - public const string MediaController = "libcapi-media-controller.so.0"; - } -} - diff --git a/src/Tizen.Multimedia.Remoting/Interop/Interop.MediaControllerClient.cs b/src/Tizen.Multimedia.Remoting/Interop/Interop.MediaControllerClient.cs deleted file mode 100644 index 202956483..000000000 --- a/src/Tizen.Multimedia.Remoting/Interop/Interop.MediaControllerClient.cs +++ /dev/null @@ -1,166 +0,0 @@ -/* - * 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; -using Tizen.Multimedia.Remoting; - -internal static partial class Interop -{ - internal static partial class MediaControllerClient - { - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void ServerUpdatedCallback(string serverName, MediaControllerServerState serverState, - IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void PlaybackUpdatedCallback(string serverName, IntPtr playback, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void MetadataUpdatedCallback(string serverName, IntPtr metadata, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void ShuffleModeUpdatedCallback(string serverName, MediaControllerShuffleMode shuffleMode, - IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void RepeatModeUpdatedCallback(string serverName, NativeRepeatMode repeatMode, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool ActivatedServerCallback(string serverName, IntPtr userData); - - [DllImport(Libraries.MediaController, EntryPoint = "mc_client_create")] - internal static extern MediaControllerError Create(out MediaControllerClientHandle handle); - - [DllImport(Libraries.MediaController, EntryPoint = "mc_client_destroy")] - internal static extern MediaControllerError Destroy(IntPtr handle); - - [DllImport(Libraries.MediaController, EntryPoint = "mc_client_set_server_update_cb")] - internal static extern MediaControllerError SetServerUpdatedCb(MediaControllerClientHandle handle, - ServerUpdatedCallback callback, IntPtr userData = default(IntPtr)); - - [DllImport(Libraries.MediaController, EntryPoint = "mc_client_unset_server_update_cb")] - internal static extern MediaControllerError UnsetServerUpdatedCb(MediaControllerClientHandle handle); - - [DllImport(Libraries.MediaController, EntryPoint = "mc_client_set_playback_update_cb")] - internal static extern MediaControllerError SetPlaybackUpdatedCb(MediaControllerClientHandle handle, - PlaybackUpdatedCallback callback, IntPtr userData = default(IntPtr)); - - [DllImport(Libraries.MediaController, EntryPoint = "mc_client_unset_playback_update_cb")] - internal static extern MediaControllerError UnsetPlaybackUpdatedCb(MediaControllerClientHandle handle); - - [DllImport(Libraries.MediaController, EntryPoint = "mc_client_set_metadata_update_cb")] - internal static extern MediaControllerError SetMetadataUpdatedCb(MediaControllerClientHandle handle, - MetadataUpdatedCallback callback, IntPtr userData = default(IntPtr)); - - [DllImport(Libraries.MediaController, EntryPoint = "mc_client_unset_metadata_update_cb")] - internal static extern MediaControllerError UnsetMetadataUpdatedCb(MediaControllerClientHandle handle); - - [DllImport(Libraries.MediaController, EntryPoint = "mc_client_set_shuffle_mode_update_cb")] - internal static extern MediaControllerError SetShuffleModeUpdatedCb(MediaControllerClientHandle handle, - ShuffleModeUpdatedCallback callback, IntPtr userData = default(IntPtr)); - - [DllImport(Libraries.MediaController, EntryPoint = "mc_client_unset_shuffle_mode_update_cb")] - internal static extern MediaControllerError UnsetShuffleModeUpdatedCb(MediaControllerClientHandle handle); - - [DllImport(Libraries.MediaController, EntryPoint = "mc_client_set_repeat_mode_update_cb")] - internal static extern MediaControllerError SetRepeatModeUpdatedCb(MediaControllerClientHandle handle, - RepeatModeUpdatedCallback callback, IntPtr userData = default(IntPtr)); - - [DllImport(Libraries.MediaController, EntryPoint = "mc_client_unset_repeat_mode_update_cb")] - internal static extern MediaControllerError UnsetRepeatModeUpdatedCb(MediaControllerClientHandle handle); - - [DllImport(Libraries.MediaController, EntryPoint = "mc_client_get_playback_state")] - internal static extern MediaControllerError GetPlaybackState(IntPtr playback, out MediaControllerPlaybackCode state); - - [DllImport(Libraries.MediaController, EntryPoint = "mc_client_get_playback_position")] - internal static extern MediaControllerError GetPlaybackPosition(IntPtr playback, out ulong position); - - [DllImport(Libraries.MediaController, EntryPoint = "mc_client_destroy_playback")] - internal static extern MediaControllerError DestroyPlayback(IntPtr playback); - - [DllImport(Libraries.MediaController, EntryPoint = "mc_client_get_metadata")] - private static extern MediaControllerError GetMetadata(IntPtr metadata, MediaControllerAttribute attribute, - out IntPtr value); - - internal static string GetMetadata(IntPtr handle, MediaControllerAttribute attr) - { - IntPtr valuePtr = IntPtr.Zero; - - try - { - GetMetadata(handle, attr, out valuePtr).ThrowIfError($"Failed to get value for {attr}."); - return Marshal.PtrToStringAnsi(valuePtr); - } - finally - { - Tizen.Multimedia.LibcSupport.Free(valuePtr); - } - } - - [DllImport(Libraries.MediaController, EntryPoint = "mc_client_destroy_metadata")] - internal static extern MediaControllerError DestroyMetadata(IntPtr metadata); - - [DllImport(Libraries.MediaController, EntryPoint = "mc_client_get_latest_server_info")] - internal static extern MediaControllerError GetLatestServer(MediaControllerClientHandle handle, - out IntPtr serverName, out MediaControllerServerState serverState); - - [DllImport(Libraries.MediaController, EntryPoint = "mc_client_get_server_playback_info")] - internal static extern MediaControllerError GetServerPlayback(MediaControllerClientHandle handle, - string serverName, out IntPtr playback); - - [DllImport(Libraries.MediaController, EntryPoint = "mc_client_get_server_metadata")] - internal static extern MediaControllerError GetServerMetadata(MediaControllerClientHandle handle, - string serverName, out IntPtr metadata); - - [DllImport(Libraries.MediaController, EntryPoint = "mc_client_get_server_shuffle_mode")] - internal static extern MediaControllerError GetServerShuffleMode(MediaControllerClientHandle handle, - string serverName, out MediaControllerShuffleMode mode); - - [DllImport(Libraries.MediaController, EntryPoint = "mc_client_get_server_repeat_mode")] - internal static extern MediaControllerError GetServerRepeatMode(MediaControllerClientHandle handle, - string serverName, out NativeRepeatMode mode); - - [DllImport(Libraries.MediaController, EntryPoint = "mc_client_send_playback_state_command")] - internal static extern MediaControllerError SendPlaybackStateCommand(MediaControllerClientHandle handle, - string serverName, MediaControllerPlaybackCode command); - - [DllImport(Libraries.MediaController, EntryPoint = "mc_client_foreach_server")] - internal static extern MediaControllerError ForeachActivatedServer(MediaControllerClientHandle handle, - ActivatedServerCallback callback, IntPtr userData); - } - - internal class MediaControllerClientHandle : SafeHandle - { - protected MediaControllerClientHandle() : base(IntPtr.Zero, true) - { - } - - public override bool IsInvalid => handle == IntPtr.Zero; - - protected override bool ReleaseHandle() - { - var ret = MediaControllerClient.Destroy(handle); - if (ret != MediaControllerError.None) - { - Tizen.Log.Debug(GetType().FullName, $"Failed to release native {GetType().Name}"); - return false; - } - - return true; - } - } -} diff --git a/src/Tizen.Multimedia.Remoting/Interop/Interop.MediaControllerServer.cs b/src/Tizen.Multimedia.Remoting/Interop/Interop.MediaControllerServer.cs deleted file mode 100644 index abd6e5844..000000000 --- a/src/Tizen.Multimedia.Remoting/Interop/Interop.MediaControllerServer.cs +++ /dev/null @@ -1,75 +0,0 @@ -/* - * 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; -using Tizen.Multimedia.Remoting; - -internal static partial class Interop -{ - internal static partial class MediaControllerServer - { - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void PlaybackStateCommandReceivedCallback(string clientName, - MediaControllerPlaybackCode state, IntPtr userData); - - [DllImport(Libraries.MediaController, EntryPoint = "mc_server_create")] - internal static extern MediaControllerError Create(out IntPtr handle); - - [DllImport(Libraries.MediaController, EntryPoint = "mc_server_destroy")] - internal static extern MediaControllerError Destroy(IntPtr handle); - - [DllImport(Libraries.MediaController, EntryPoint = "mc_server_set_playback_state")] - internal static extern MediaControllerError SetPlaybackState(IntPtr handle, - MediaControllerPlaybackCode state); - - [DllImport(Libraries.MediaController, EntryPoint = "mc_server_set_playback_position")] - internal static extern MediaControllerError SetPlaybackPosition(IntPtr handle, ulong position); - - [DllImport(Libraries.MediaController, EntryPoint = "mc_server_update_playback_info")] - internal static extern MediaControllerError UpdatePlayback(IntPtr handle); - - [DllImport(Libraries.MediaController, EntryPoint = "mc_server_set_metadata")] - internal static extern MediaControllerError SetMetadata(IntPtr handle, - MediaControllerAttribute attribute, string value); - - [DllImport(Libraries.MediaController, EntryPoint = "mc_server_update_metadata")] - internal static extern MediaControllerError UpdateMetadata(IntPtr handle); - - [DllImport(Libraries.MediaController, EntryPoint = "mc_server_update_shuffle_mode")] - internal static extern MediaControllerError UpdateShuffleMode(IntPtr handle, - MediaControllerShuffleMode mode); - - [DllImport(Libraries.MediaController, EntryPoint = "mc_server_update_repeat_mode")] - internal static extern MediaControllerError UpdateRepeatMode(IntPtr handle, NativeRepeatMode mode); - - [DllImport(Libraries.MediaController, EntryPoint = "mc_server_set_playback_state_command_received_cb")] - internal static extern MediaControllerError SetPlaybackStateCmdRecvCb(IntPtr handle, - PlaybackStateCommandReceivedCallback callback, IntPtr userData = default(IntPtr)); - - [DllImport(Libraries.MediaController, EntryPoint = "mc_server_unset_playback_state_command_received_cb")] - internal static extern MediaControllerError UnsetPlaybackStateCmdRecvCb(IntPtr handle); - - [DllImport(Libraries.MediaController, EntryPoint = "mc_db_connect")] - internal static extern MediaControllerError ConnectDb(out IntPtr dbHandle); - - [DllImport(Libraries.MediaController, EntryPoint = "mc_db_disconnect")] - internal static extern MediaControllerError DisconnectDb(IntPtr dbHandle); - - [DllImport(Libraries.MediaController, EntryPoint = "mc_db_check_server_table_exist")] - internal static extern MediaControllerError CheckServerExist(IntPtr dbHandle, string appId, out bool value); - } -} diff --git a/src/Tizen.Multimedia.Remoting/Interop/Interop.ScreenMirroring.cs b/src/Tizen.Multimedia.Remoting/Interop/Interop.ScreenMirroring.cs deleted file mode 100644 index 92d2cc88b..000000000 --- a/src/Tizen.Multimedia.Remoting/Interop/Interop.ScreenMirroring.cs +++ /dev/null @@ -1,100 +0,0 @@ -/* - * 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; -using Tizen.Multimedia.Remoting; - -internal static partial class Interop -{ - internal static partial class ScreenMirroring - { - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void StateChangedCallback(IntPtr userData, - ScreenMirroringState state, ScreenMirroringErrorCode error); - - [DllImport(Libraries.ScreenMirroring, EntryPoint = "scmirroring_sink_create")] - internal static extern ScreenMirroringErrorCode Create(out IntPtr handle); - - [DllImport(Libraries.ScreenMirroring, EntryPoint = "scmirroring_sink_set_state_changed_cb")] - internal static extern ScreenMirroringErrorCode SetStateChangedCb(IntPtr handle, - StateChangedCallback cb, IntPtr userData = default(IntPtr)); - - [DllImport(Libraries.ScreenMirroring, EntryPoint = "scmirroring_sink_set_ip_and_port")] - internal static extern ScreenMirroringErrorCode SetIpAndPort(IntPtr handle, string ip, string port); - - [DllImport(Libraries.ScreenMirroring, EntryPoint = "scmirroring_sink_set_display")] - internal static extern ScreenMirroringErrorCode SetDisplay(IntPtr handle, int type, IntPtr display); - - [DllImport(Libraries.ScreenMirroring, EntryPoint = "scmirroring_sink_set_resolution")] - internal static extern ScreenMirroringErrorCode SetResolution(IntPtr handle, ScreenMirroringResolutions resolution); - - [DllImport(Libraries.ScreenMirroring, EntryPoint = "scmirroring_sink_prepare")] - internal static extern ScreenMirroringErrorCode Prepare(IntPtr handle); - - [DllImport(Libraries.ScreenMirroring, EntryPoint = "scmirroring_sink_connect")] - internal static extern ScreenMirroringErrorCode Connect(IntPtr handle); - - [DllImport(Libraries.ScreenMirroring, EntryPoint = "scmirroring_sink_start")] - internal static extern ScreenMirroringErrorCode StartAsync(IntPtr handle); - - [DllImport(Libraries.ScreenMirroring, EntryPoint = "scmirroring_sink_pause")] - internal static extern ScreenMirroringErrorCode PauseAsync(IntPtr handle); - - [DllImport(Libraries.ScreenMirroring, EntryPoint = "scmirroring_sink_resume")] - internal static extern ScreenMirroringErrorCode ResumeAsync(IntPtr handle); - - [DllImport(Libraries.ScreenMirroring, EntryPoint = "scmirroring_sink_disconnect")] - internal static extern ScreenMirroringErrorCode Disconnect(IntPtr handle); - - [DllImport(Libraries.ScreenMirroring, EntryPoint = "scmirroring_sink_unprepare")] - internal static extern ScreenMirroringErrorCode Unprepare(IntPtr handle); - - [DllImport(Libraries.ScreenMirroring, EntryPoint = "scmirroring_sink_unset_state_changed_cb")] - internal static extern int UnsetStateChangedCb(IntPtr handle); - - [DllImport(Libraries.ScreenMirroring, EntryPoint = "scmirroring_sink_destroy")] - internal static extern int Destroy(IntPtr handle); - - [DllImport(Libraries.ScreenMirroring, EntryPoint = "scmirroring_sink_get_negotiated_video_codec")] - internal static extern ScreenMirroringErrorCode GetNegotiatedVideoCodec(ref IntPtr handle, - out ScreenMirroringVideoCodec codec); - - [DllImport(Libraries.ScreenMirroring, EntryPoint = "scmirroring_sink_get_negotiated_video_resolution")] - internal static extern ScreenMirroringErrorCode GetNegotiatedVideoResolution(ref IntPtr handle, - out int width, out int height); - - [DllImport(Libraries.ScreenMirroring, EntryPoint = "scmirroring_sink_get_negotiated_video_frame_rate")] - internal static extern ScreenMirroringErrorCode GetNegotiatedVideoFrameRate(ref IntPtr handle, - out int frameRate); - - [DllImport(Libraries.ScreenMirroring, EntryPoint = "scmirroring_sink_get_negotiated_audio_codec")] - internal static extern ScreenMirroringErrorCode GetNegotiatedAudioCodec(ref IntPtr handle, - out ScreenMirroringAudioCodec codec); - - [DllImport(Libraries.ScreenMirroring, EntryPoint = "scmirroring_sink_get_negotiated_audio_channel")] - internal static extern ScreenMirroringErrorCode GetNegotiatedAudioChannel(ref IntPtr handle, - out int channel); - - [DllImport(Libraries.ScreenMirroring, EntryPoint = "scmirroring_sink_get_negotiated_audio_sample_rate")] - internal static extern ScreenMirroringErrorCode GetNegotiatedAudioSampleRate(ref IntPtr handle, - out int sampleRate); - - [DllImport(Libraries.ScreenMirroring, EntryPoint = "scmirroring_sink_get_negotiated_audio_bitwidth")] - internal static extern ScreenMirroringErrorCode GetNegotiatedAudioBitwidth(ref IntPtr handle, - out int bitwidth); - } -} diff --git a/src/Tizen.Multimedia.Remoting/MediaController/EnumExtensions.cs b/src/Tizen.Multimedia.Remoting/MediaController/EnumExtensions.cs deleted file mode 100644 index d49135e90..000000000 --- a/src/Tizen.Multimedia.Remoting/MediaController/EnumExtensions.cs +++ /dev/null @@ -1,99 +0,0 @@ -/* - * 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.Diagnostics; - -namespace Tizen.Multimedia.Remoting -{ - internal static class EnumExtensions - { - internal static MediaControlPlaybackState ToState(this MediaControllerPlaybackCode code) - { - switch (code) - { - case MediaControllerPlaybackCode.None: return MediaControlPlaybackState.None; - case MediaControllerPlaybackCode.Play: return MediaControlPlaybackState.Playing; - case MediaControllerPlaybackCode.Pause: return MediaControlPlaybackState.Paused; - case MediaControllerPlaybackCode.Stop: return MediaControlPlaybackState.Stopped; - case MediaControllerPlaybackCode.FastForward: return MediaControlPlaybackState.FastForwarding; - case MediaControllerPlaybackCode.Rewind: return MediaControlPlaybackState.Rewinding; - } - - Debug.Fail($"Not supported code for playback state{code}."); - return MediaControlPlaybackState.None; - } - - internal static MediaControllerPlaybackCode ToCode(this MediaControlPlaybackState state) - { - switch (state) - { - case MediaControlPlaybackState.Playing: return MediaControllerPlaybackCode.Play; - case MediaControlPlaybackState.Paused: return MediaControllerPlaybackCode.Pause; - case MediaControlPlaybackState.Stopped: return MediaControllerPlaybackCode.Stop; - case MediaControlPlaybackState.FastForwarding: return MediaControllerPlaybackCode.FastForward; - case MediaControlPlaybackState.Rewinding: return MediaControllerPlaybackCode.Rewind; - } - return MediaControllerPlaybackCode.None; - } - - internal static MediaControlPlaybackCommand ToCommand(this MediaControllerPlaybackCode code) - { - switch (code) - { - case MediaControllerPlaybackCode.Play: return MediaControlPlaybackCommand.Play; - case MediaControllerPlaybackCode.Pause: return MediaControlPlaybackCommand.Pause; - case MediaControllerPlaybackCode.Stop: return MediaControlPlaybackCommand.Stop; - case MediaControllerPlaybackCode.Next: return MediaControlPlaybackCommand.Next; - case MediaControllerPlaybackCode.Prev: return MediaControlPlaybackCommand.Previous; - case MediaControllerPlaybackCode.FastForward: return MediaControlPlaybackCommand.FastForward; - case MediaControllerPlaybackCode.Rewind: return MediaControlPlaybackCommand.Rewind; - } - - Debug.Fail($"Not supported code for playback command{code}."); - return MediaControlPlaybackCommand.Play; - } - - internal static MediaControllerPlaybackCode ToCode(this MediaControlPlaybackCommand command) - { - switch (command) - { - case MediaControlPlaybackCommand.Play: return MediaControllerPlaybackCode.Play; - case MediaControlPlaybackCommand.Pause: return MediaControllerPlaybackCode.Pause; - case MediaControlPlaybackCommand.Stop: return MediaControllerPlaybackCode.Stop; - case MediaControlPlaybackCommand.Next: return MediaControllerPlaybackCode.Next; - case MediaControlPlaybackCommand.Previous: return MediaControllerPlaybackCode.Prev; - case MediaControlPlaybackCommand.FastForward: return MediaControllerPlaybackCode.FastForward; - case MediaControlPlaybackCommand.Rewind: return MediaControllerPlaybackCode.Rewind; - } - return MediaControllerPlaybackCode.Play; - } - - internal static NativeRepeatMode ToNative(this MediaControlRepeatMode mode) - { - Debug.Assert(Enum.IsDefined(typeof(MediaControlRepeatMode), mode)); - - return mode == MediaControlRepeatMode.Off ? NativeRepeatMode.On : NativeRepeatMode.Off; - } - - internal static MediaControlRepeatMode ToPublic(this NativeRepeatMode mode) - { - Debug.Assert(Enum.IsDefined(typeof(NativeRepeatMode), mode)); - - return mode == NativeRepeatMode.Off ? MediaControlRepeatMode.On : MediaControlRepeatMode.Off; - } - } -} \ No newline at end of file diff --git a/src/Tizen.Multimedia.Remoting/MediaController/InternalEnums.cs b/src/Tizen.Multimedia.Remoting/MediaController/InternalEnums.cs deleted file mode 100644 index b25c43be3..000000000 --- a/src/Tizen.Multimedia.Remoting/MediaController/InternalEnums.cs +++ /dev/null @@ -1,66 +0,0 @@ -/* - * 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.Diagnostics; - -namespace Tizen.Multimedia.Remoting -{ - internal enum MediaControllerPlaybackCode - { - None, - Play, - Pause, - Stop, - Next, - Prev, - FastForward, - Rewind, - } - - internal enum MediaControllerServerState - { - None, - Activated, - Deactivated, - } - - internal enum MediaControllerShuffleMode - { - On, - Off, - } - - internal enum NativeRepeatMode - { - On, - Off, - } - - internal enum MediaControllerAttribute - { - Title, - Artist, - Album, - Author, - Genre, - Duration, - Date, - Copyright, - Description, - TrackNumber, - Picture, - } -} \ No newline at end of file diff --git a/src/Tizen.Multimedia.Remoting/MediaController/MediaControlMetadata.cs b/src/Tizen.Multimedia.Remoting/MediaController/MediaControlMetadata.cs deleted file mode 100644 index 8ec676dfc..000000000 --- a/src/Tizen.Multimedia.Remoting/MediaController/MediaControlMetadata.cs +++ /dev/null @@ -1,107 +0,0 @@ -/* - * 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.Diagnostics; -using Native = Interop.MediaControllerClient; - -namespace Tizen.Multimedia.Remoting -{ - /// - /// Represents metadata for media control. - /// - public class MediaControlMetadata - { - /// - /// Initializes a new instance of the class. - /// - public MediaControlMetadata() - { - } - - internal MediaControlMetadata(IntPtr handle) - { - Debug.Assert(handle != IntPtr.Zero); - - Title = Native.GetMetadata(handle, MediaControllerAttribute.Title); - Artist = Native.GetMetadata(handle, MediaControllerAttribute.Artist); - Album = Native.GetMetadata(handle, MediaControllerAttribute.Album); - Author = Native.GetMetadata(handle, MediaControllerAttribute.Author); - Genre = Native.GetMetadata(handle, MediaControllerAttribute.Genre); - Duration = Native.GetMetadata(handle, MediaControllerAttribute.Duration); - Date = Native.GetMetadata(handle, MediaControllerAttribute.Date); - Copyright = Native.GetMetadata(handle, MediaControllerAttribute.Copyright); - Description = Native.GetMetadata(handle, MediaControllerAttribute.Description); - TrackNumber = Native.GetMetadata(handle, MediaControllerAttribute.TrackNumber); - AlbumArtPath = Native.GetMetadata(handle, MediaControllerAttribute.Picture); - } - - /// - /// Gets or sets the title. - /// - public string Title { get; set; } - - /// - /// Gets or sets the artist. - /// - public string Artist { get; set; } - - /// - /// Gets or sets the album. - /// - public string Album { get; set; } - - /// - /// Gets or sets the author. - /// - public string Author { get; set; } - - /// - /// Gets or sets the genre. - /// - public string Genre { get; set; } - - /// - /// Gets or sets the duration. - /// - public string Duration { get; set; } - - /// - /// Gets or sets the date. - /// - public string Date { get; set; } - - /// - /// Gets or sets the copyright. - /// - public string Copyright { get; set; } - - /// - /// Gets or sets the description. - /// - public string Description { get; set; } - - /// - /// Gets or sets the track number. - /// - public string TrackNumber { get; set; } - - /// - /// Gets or sets the path of the album art. - /// - public string AlbumArtPath { get; set; } - } -} \ No newline at end of file diff --git a/src/Tizen.Multimedia.Remoting/MediaController/MediaControlPlaybackCommand.cs b/src/Tizen.Multimedia.Remoting/MediaController/MediaControlPlaybackCommand.cs deleted file mode 100644 index 664eb190b..000000000 --- a/src/Tizen.Multimedia.Remoting/MediaController/MediaControlPlaybackCommand.cs +++ /dev/null @@ -1,59 +0,0 @@ -/* - * 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. - */ - -namespace Tizen.Multimedia.Remoting -{ - /// - /// Specifies playback commands. - /// - public enum MediaControlPlaybackCommand - { - /// - /// Play. - /// - Play, - - /// - /// Pause. - /// - Pause, - - /// - /// Stop. - /// - Stop, - - /// - /// Skip to next. - /// - Next, - - /// - /// Skip to previous. - /// - Previous, - - /// - /// Fast forward. - /// - FastForward, - - /// - /// Rewind. - /// - Rewind, - } -} \ No newline at end of file diff --git a/src/Tizen.Multimedia.Remoting/MediaController/MediaControlPlaybackState.cs b/src/Tizen.Multimedia.Remoting/MediaController/MediaControlPlaybackState.cs deleted file mode 100644 index e1f3fc1fc..000000000 --- a/src/Tizen.Multimedia.Remoting/MediaController/MediaControlPlaybackState.cs +++ /dev/null @@ -1,54 +0,0 @@ -/* - * 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. - */ - -namespace Tizen.Multimedia.Remoting -{ - /// - /// Specifies playback states. - /// - public enum MediaControlPlaybackState - { - /// - /// Unknown; no state is set. - /// - None, - - /// - /// Playing. - /// - Playing, - - /// - /// Paused. - /// - Paused, - - /// - /// Stopped. - /// - Stopped, - - /// - /// Fast forwarding. - /// - FastForwarding, - - /// - /// Rewinding. - /// - Rewinding, - } -} \ No newline at end of file diff --git a/src/Tizen.Multimedia.Remoting/MediaController/MediaControlServer.cs b/src/Tizen.Multimedia.Remoting/MediaController/MediaControlServer.cs deleted file mode 100644 index c4909bbe4..000000000 --- a/src/Tizen.Multimedia.Remoting/MediaController/MediaControlServer.cs +++ /dev/null @@ -1,266 +0,0 @@ -/* - * 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 Native = Interop.MediaControllerServer; - -namespace Tizen.Multimedia.Remoting -{ - /// - /// Provides a means to set playback information and metadata and receive commands from clients. - /// - /// - /// - public static class MediaControlServer - { - private static IntPtr _handle = IntPtr.Zero; - private static bool? _isRunning; - - /// - /// Gets a value indicating whether the server is running. - /// - /// true if the server has started; otherwise, false. - /// - /// - public static bool IsRunning - { - get - { - if (_isRunning.HasValue == false) - { - _isRunning = GetRunningState(); - } - - return _isRunning.Value; - } - } - - private static bool GetRunningState() - { - IntPtr handle = IntPtr.Zero; - try - { - Native.ConnectDb(out handle).ThrowIfError("Failed to retrieve the running state."); - - Native.CheckServerExist(handle, Applications.Application.Current.ApplicationInfo.ApplicationId, - out var value).ThrowIfError("Failed to retrieve the running state."); - - return value; - } - finally - { - if (handle != IntPtr.Zero) - { - Native.DisconnectDb(handle); - } - } - } - - private static void EnsureInitializedIfRunning() - { - if (_handle != IntPtr.Zero) - { - return; - } - - if (IsRunning == false) - { - throw new InvalidOperationException("The server is not running."); - } - - Initialize(); - } - - private static IntPtr Handle - { - get - { - EnsureInitializedIfRunning(); - - return _handle; - } - } - - private static void Initialize() - { - Native.Create(out _handle).ThrowIfError("Failed to create media controller server."); - - try - { - RegisterPlaybackCommandReceivedEvent(); - _isRunning = true; - } - catch - { - Native.Destroy(_handle); - _playbackCommandCallback = null; - _handle = IntPtr.Zero; - throw; - } - } - - /// - /// Starts the media control server. - /// - /// - /// When the server starts, will be raised. - /// - /// http://tizen.org/privilege/mediacontroller.server - /// An internal error occurs. - /// Caller does not have required privilege. - /// - public static void Start() - { - Initialize(); - } - - /// - /// Stops the media control server. - /// - /// - /// When the server stops, will be raised. - /// - /// - /// The server is not running .\n - /// -or-\n - /// An internal error occurs. - /// - /// - public static void Stop() - { - EnsureInitializedIfRunning(); - - Native.Destroy(_handle).ThrowIfError("Failed to stop the server."); - - _handle = IntPtr.Zero; - _playbackCommandCallback = null; - _isRunning = false; - } - - /// - /// Updates playback state and playback position. - /// The playback state. - /// The playback position in milliseconds. - /// is not valid. - /// is less than zero. - /// - /// The server is not running .\n - /// -or-\n - /// An internal error occurs. - /// - public static void SetPlaybackState(MediaControlPlaybackState state, long position) - { - ValidationUtil.ValidateEnum(typeof(MediaControlPlaybackState), state, nameof(state)); - - if (position < 0) - { - throw new ArgumentOutOfRangeException(nameof(position), position, "position can't be less than zero."); - } - - Native.SetPlaybackState(Handle, state.ToCode()).ThrowIfError("Failed to set playback state."); - - Native.SetPlaybackPosition(Handle, (ulong)position).ThrowIfError("Failed to set playback position."); - - Native.UpdatePlayback(Handle).ThrowIfError("Failed to set playback."); - } - - private static void SetMetadata(MediaControllerAttribute attribute, string value) - { - Native.SetMetadata(Handle, attribute, value).ThrowIfError($"Failed to set metadata({attribute})."); - } - - /// - /// Updates metadata information. - /// - /// The metadata to update. - /// is null. - /// - /// The server is not running .\n - /// -or-\n - /// An internal error occurs. - /// - public static void SetMetadata(MediaControlMetadata metadata) - { - if (metadata == null) - { - throw new ArgumentNullException(nameof(metadata)); - } - - SetMetadata(MediaControllerAttribute.Title, metadata.Title); - SetMetadata(MediaControllerAttribute.Artist, metadata.Artist); - SetMetadata(MediaControllerAttribute.Album, metadata.Album); - SetMetadata(MediaControllerAttribute.Author, metadata.Author); - SetMetadata(MediaControllerAttribute.Genre, metadata.Genre); - SetMetadata(MediaControllerAttribute.Duration, metadata.Duration); - SetMetadata(MediaControllerAttribute.Date, metadata.Date); - SetMetadata(MediaControllerAttribute.Copyright, metadata.Copyright); - SetMetadata(MediaControllerAttribute.Description, metadata.Description); - SetMetadata(MediaControllerAttribute.TrackNumber, metadata.TrackNumber); - SetMetadata(MediaControllerAttribute.Picture, metadata.AlbumArtPath); - - Native.UpdateMetadata(Handle).ThrowIfError("Failed to set metadata."); - } - - /// - /// Updates the shuffle mode. - /// - /// A value indicating whether the shuffle mode is enabled. - /// - /// The server is not running .\n - /// -or-\n - /// An internal error occurs. - /// - public static void SetShuffleModeEnabled(bool enabled) - { - Native.UpdateShuffleMode(Handle, enabled ? MediaControllerShuffleMode.On : MediaControllerShuffleMode.Off). - ThrowIfError("Failed to set shuffle mode."); - } - - /// - /// Updates the repeat mode. - /// - /// A value indicating the repeat mode. - /// - /// The server is not running .\n - /// -or-\n - /// An internal error occurs. - /// - /// is invalid. - public static void SetRepeatMode(MediaControlRepeatMode mode) - { - ValidationUtil.ValidateEnum(typeof(MediaControlRepeatMode), mode, nameof(mode)); - - Native.UpdateRepeatMode(Handle, mode.ToNative()).ThrowIfError("Failed to set repeat mode."); - } - - /// - /// Occurs when a client sends playback command. - /// - public static event EventHandler PlaybackCommandReceived; - - private static Native.PlaybackStateCommandReceivedCallback _playbackCommandCallback; - - private static void RegisterPlaybackCommandReceivedEvent() - { - _playbackCommandCallback = (clientName, playbackCode, _) => - { - PlaybackCommandReceived?.Invoke(null, new PlaybackCommandReceivedEventArgs(clientName, playbackCode.ToCommand())); - }; - Native.SetPlaybackStateCmdRecvCb(Handle, _playbackCommandCallback). - ThrowIfError("Failed to init PlaybackStateCommandReceived event."); ; - } - } -} \ No newline at end of file diff --git a/src/Tizen.Multimedia.Remoting/MediaController/MediaControlServerStartedEventArgs.cs b/src/Tizen.Multimedia.Remoting/MediaController/MediaControlServerStartedEventArgs.cs deleted file mode 100644 index 5749d5105..000000000 --- a/src/Tizen.Multimedia.Remoting/MediaController/MediaControlServerStartedEventArgs.cs +++ /dev/null @@ -1,47 +0,0 @@ -/* - * 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.Multimedia.Remoting -{ - /// - /// Provides data for the event. - /// - public class MediaControlServerStartedEventArgs : EventArgs - { - /// - /// Initializes a new instance of the class. - /// - /// A of the server. - /// is null. - public MediaControlServerStartedEventArgs(MediaController mediaController) - { - if (mediaController == null) - { - throw new ArgumentNullException(nameof(mediaController)); - } - - Controller = mediaController; - } - - /// - /// Gets the controller of the server added. - /// - /// A . - public MediaController Controller { get; } - } -} \ No newline at end of file diff --git a/src/Tizen.Multimedia.Remoting/MediaController/MediaControlServerStoppedEventArgs.cs b/src/Tizen.Multimedia.Remoting/MediaController/MediaControlServerStoppedEventArgs.cs deleted file mode 100644 index bb0636dd0..000000000 --- a/src/Tizen.Multimedia.Remoting/MediaController/MediaControlServerStoppedEventArgs.cs +++ /dev/null @@ -1,47 +0,0 @@ -/* - * 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.Multimedia.Remoting -{ - /// - /// Provides data for the event. - /// - public class MediaControlServerStoppedEventArgs : EventArgs - { - /// - /// Initializes a new instance of the class. - /// - /// The application id of the server stopped. - /// is null. - public MediaControlServerStoppedEventArgs(string serverAppId) - { - if (serverAppId == null) - { - throw new ArgumentNullException(nameof(serverAppId)); - } - - ServerAppId = serverAppId; - } - - /// - /// Gets the application id of the server. - /// - /// A string represents the application id. - public string ServerAppId { get; } - } -} \ No newline at end of file diff --git a/src/Tizen.Multimedia.Remoting/MediaController/MediaController.cs b/src/Tizen.Multimedia.Remoting/MediaController/MediaController.cs deleted file mode 100644 index fd35a5790..000000000 --- a/src/Tizen.Multimedia.Remoting/MediaController/MediaController.cs +++ /dev/null @@ -1,332 +0,0 @@ -/* - * 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.Diagnostics; -using Native = Interop.MediaControllerClient; - -namespace Tizen.Multimedia.Remoting -{ - /// - /// Provides a means to to send commands to and handle events from media control server. - /// - public class MediaController - { - internal MediaController(MediaControllerManager manager, string serverAppId) - { - Debug.Assert(manager != null); - Debug.Assert(serverAppId != null); - - Manager = manager; - ServerAppId = serverAppId; - } - - private MediaControllerManager Manager { get; } - - /// - /// Gets the application id of the server. - /// - /// The server application id. - public string ServerAppId { get; } - - /// - /// Gets a value indicating whether the sever has been stopped. - /// - /// true if the server has been stopped; otherwise, false. - public bool IsStopped - { - get; - private set; - } - - private void ThrowIfStopped() - { - if (IsStopped) - { - throw new InvalidOperationException("The server has already been stopped."); - } - } - - /// - /// Occurs when the server is stopped. - /// - public event EventHandler ServerStopped; - - internal void RaiseStoppedEvent() - { - IsStopped = true; - ServerStopped?.Invoke(this, EventArgs.Empty); - } - - /// - /// Occurs when the playback state is updated. - /// - public event EventHandler PlaybackStateUpdated; - - private PlaybackStateUpdatedEventArgs CreatePlaybackUpdatedEventArgs(IntPtr playbackHandle) - { - try - { - Native.GetPlaybackState(playbackHandle, out var playbackCode).ThrowIfError("Failed to get state."); - - Native.GetPlaybackPosition(playbackHandle, out var position).ThrowIfError("Failed to get position."); - - return new PlaybackStateUpdatedEventArgs(playbackCode.ToState(), (long)position); - } - catch (Exception e) - { - Log.Error(GetType().FullName, e.ToString()); - } - return null; - } - - internal void RaisePlaybackUpdatedEvent(IntPtr playbackHandle) - { - var eventHandler = PlaybackStateUpdated; - - if (eventHandler == null) - { - return; - } - - var args = CreatePlaybackUpdatedEventArgs(playbackHandle); - - if (args != null) - { - eventHandler.Invoke(this, args); - } - } - - /// - /// Occurs when the metadata is updated. - /// - public event EventHandler MetadataUpdated; - - private MetadataUpdatedEventArgs CreateMetadataUpdatedEventArgs(IntPtr metadataHandle) - { - try - { - return new MetadataUpdatedEventArgs(new MediaControlMetadata(metadataHandle)); - } - catch (Exception e) - { - Log.Error(GetType().FullName, e.ToString()); - } - return null; - } - - internal void RaiseMetadataUpdatedEvent(IntPtr metadataHandle) - { - var eventHandler = MetadataUpdated; - - if (eventHandler == null) - { - return; - } - - var args = CreateMetadataUpdatedEventArgs(metadataHandle); - - if (args != null) - { - eventHandler.Invoke(this, args); - } - } - - /// - /// Occurs when the shuffle mode is updated. - /// - public event EventHandler ShuffleModeUpdated; - - internal void RaiseShuffleModeUpdatedEvent(MediaControllerShuffleMode mode) - { - ShuffleModeUpdated?.Invoke(this, new ShuffleModeUpdatedEventArgs(mode == MediaControllerShuffleMode.On)); - } - - /// - /// Occurs when the repeat mode is updated. - /// - public event EventHandler RepeatModeUpdated; - - internal void RaiseRepeatModeUpdatedEvent(MediaControlRepeatMode mode) - { - RepeatModeUpdated?.Invoke(this, new RepeatModeUpdatedEventArgs(mode)); - } - - /// - /// Returns the playback state set by the server. - /// - /// The playback state. - /// - /// The server has already been stopped. - /// -or-\n - /// An internal error occurs. - /// - /// The has already been disposed of. - /// - public MediaControlPlaybackState GetPlaybackState() - { - ThrowIfStopped(); - - IntPtr playbackHandle = IntPtr.Zero; - - try - { - Native.GetServerPlayback(Manager.Handle, ServerAppId, out playbackHandle).ThrowIfError("Failed to get playback."); - - Native.GetPlaybackState(playbackHandle, out var playbackCode).ThrowIfError("Failed to get state."); - - return playbackCode.ToState(); - } - finally - { - if (playbackHandle != IntPtr.Zero) - { - Native.DestroyPlayback(playbackHandle); - } - } - } - - /// - /// Returns the playback position set by the server. - /// - /// The playback position in milliseconds. - /// - /// The server has already been stopped. - /// -or-\n - /// An internal error occurs. - /// - /// The has already been disposed of. - /// - public long GetPlaybackPosition() - { - ThrowIfStopped(); - - IntPtr playbackHandle = IntPtr.Zero; - - try - { - Native.GetServerPlayback(Manager.Handle, ServerAppId, out playbackHandle).ThrowIfError("Failed to get playback."); - - Native.GetPlaybackPosition(playbackHandle, out var position).ThrowIfError("Failed to get position."); - - return (long)position; - } - finally - { - if (playbackHandle != IntPtr.Zero) - { - Native.DestroyPlayback(playbackHandle); - } - } - } - - /// - /// Returns the metadata set by the server. - /// - /// The metadata. - /// - /// The server has already been stopped. - /// -or-\n - /// An internal error occurs. - /// - /// The has already been disposed of. - /// - public MediaControlMetadata GetMetadata() - { - ThrowIfStopped(); - - IntPtr metadataHandle = IntPtr.Zero; - - try - { - Native.GetServerMetadata(Manager.Handle, ServerAppId, out metadataHandle). - ThrowIfError("Failed to get metadata."); - - return new MediaControlMetadata(metadataHandle); - } - finally - { - if (metadataHandle != IntPtr.Zero) - { - Native.DestroyMetadata(metadataHandle); - } - } - } - - /// - /// Returns whether the shuffle mode is enabled. - /// - /// A value indicating whether the shuffle mode is enabled. - /// - /// The server has already been stopped. - /// -or-\n - /// An internal error occurs. - /// - /// The has already been disposed of. - /// - public bool IsShuffleModeEnabled() - { - ThrowIfStopped(); - - Native.GetServerShuffleMode(Manager.Handle, ServerAppId, out var shuffleMode). - ThrowIfError("Failed to get shuffle mode state."); - - return shuffleMode == MediaControllerShuffleMode.On; - } - - /// - /// Returns the repeat mode. - /// - /// A set by the server. - /// - /// The server has already been stopped. - /// -or-\n - /// An internal error occurs. - /// - /// The has already been disposed of. - /// - public MediaControlRepeatMode GetRepeatMode() - { - ThrowIfStopped(); - - Native.GetServerRepeatMode(Manager.Handle, ServerAppId, out var repeatMode). - ThrowIfError("Failed to get repeat mode state."); - - return repeatMode.ToPublic(); - } - - /// - /// Sends playback command to the server. - /// A playback command. - /// - /// The server has already been stopped. - /// -or-\n - /// An internal error occurs. - /// - /// is not valid. - /// The has already been disposed of. - /// - public void SendPlaybackCommand(MediaControlPlaybackCommand command) - { - ThrowIfStopped(); - - ValidationUtil.ValidateEnum(typeof(MediaControlPlaybackCommand), command, nameof(command)); - - Native.SendPlaybackStateCommand(Manager.Handle, ServerAppId, command.ToCode()). - ThrowIfError("Failed to send command."); - } - } -} \ No newline at end of file diff --git a/src/Tizen.Multimedia.Remoting/MediaController/MediaControllerError.cs b/src/Tizen.Multimedia.Remoting/MediaController/MediaControllerError.cs deleted file mode 100644 index 7a492a8bd..000000000 --- a/src/Tizen.Multimedia.Remoting/MediaController/MediaControllerError.cs +++ /dev/null @@ -1,63 +0,0 @@ -/* - * 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.IO; -using Tizen.Internals.Errors; - -namespace Tizen.Multimedia.Remoting -{ - internal enum MediaControllerError - { - None = ErrorCode.None, - InvalidParameter = ErrorCode.InvalidParameter, - OutOfMemory = ErrorCode.OutOfMemory, - InvalidOperation = ErrorCode.InvalidOperation, - NoSpaceOnDevice = ErrorCode.FileNoSpaceOnDevice, - PermissionDenied = ErrorCode.PermissionDenied, - } - - internal static class MediaControllerErrorExtensions - { - internal static void ThrowIfError(this MediaControllerError error, string errorMessage) - { - if (error == MediaControllerError.None) - { - return; - } - - switch (error) - { - case MediaControllerError.InvalidParameter: - throw new ArgumentException(errorMessage); - - case MediaControllerError.OutOfMemory: - throw new OutOfMemoryException(errorMessage); - - case MediaControllerError.InvalidOperation: - throw new InvalidOperationException(errorMessage); - - case MediaControllerError.NoSpaceOnDevice: - throw new IOException($"Not enough storage : {errorMessage}"); - - case MediaControllerError.PermissionDenied: - throw new UnauthorizedAccessException(errorMessage); - } - - throw new InvalidOperationException($"Unknown error({error}) : {errorMessage}"); - } - } -} \ No newline at end of file diff --git a/src/Tizen.Multimedia.Remoting/MediaController/MediaControllerManager.Events.cs b/src/Tizen.Multimedia.Remoting/MediaController/MediaControllerManager.Events.cs deleted file mode 100644 index 4cdd504fa..000000000 --- a/src/Tizen.Multimedia.Remoting/MediaController/MediaControllerManager.Events.cs +++ /dev/null @@ -1,120 +0,0 @@ -/* - * 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 Native = Interop.MediaControllerClient; - -namespace Tizen.Multimedia.Remoting -{ - public partial class MediaControllerManager - { - private Native.ServerUpdatedCallback _serverUpdatedCallback; - private Native.PlaybackUpdatedCallback _playbackUpdatedCallback; - private Native.MetadataUpdatedCallback _metadataUpdatedCallback; - private Native.ShuffleModeUpdatedCallback _shufflemodeUpdatedCallback; - private Native.RepeatModeUpdatedCallback _repeatmodeUpdatedCallback; - - /// - /// Occurs when a server is started. - /// - public event EventHandler ServerStarted; - - /// - /// Occurs when a server is stopped. - /// - public event EventHandler ServerStopped; - - private void InitializeEvents() - { - RegisterPlaybackUpdatedEvent(); - RegisterServerUpdatedEvent(); - RegisterMetadataUpdatedEvent(); - RegisterShuffleModeUpdatedEvent(); - RegisterRepeatModeUpdatedEvent(); - } - - private void RaiseServerChangedEvent(MediaControllerServerState state, MediaController controller) - { - if (controller == null) - { - return; - } - - if (state == MediaControllerServerState.Activated) - { - ServerStarted?.Invoke(this, new MediaControlServerStartedEventArgs(controller)); - } - else - { - controller.RaiseStoppedEvent(); - ServerStopped?.Invoke(this, new MediaControlServerStoppedEventArgs(controller.ServerAppId)); - } - } - - private void RegisterServerUpdatedEvent() - { - _serverUpdatedCallback = (serverName, state, _) => - { - RaiseServerChangedEvent(state, HandleServerUpdated(serverName, state)); - }; - - Native.SetServerUpdatedCb(Handle, _serverUpdatedCallback).ThrowIfError("Failed to init server changed event."); - } - - private void RegisterPlaybackUpdatedEvent() - { - _playbackUpdatedCallback = (serverName, playback, _) => - { - GetController(serverName)?.RaisePlaybackUpdatedEvent(playback); - }; - - Native.SetPlaybackUpdatedCb(Handle, _playbackUpdatedCallback).ThrowIfError("Failed to init PlaybackUpdated event."); - } - - - private void RegisterMetadataUpdatedEvent() - { - _metadataUpdatedCallback = (serverName, metadata, _) => - { - GetController(serverName)?.RaiseMetadataUpdatedEvent(metadata); - }; - - Native.SetMetadataUpdatedCb(Handle, _metadataUpdatedCallback).ThrowIfError("Failed to init MetadataUpdated event."); - } - - private void RegisterShuffleModeUpdatedEvent() - { - _shufflemodeUpdatedCallback = (serverName, shuffleMode, _) => - { - GetController(serverName)?.RaiseShuffleModeUpdatedEvent(shuffleMode); - }; - - Native.SetShuffleModeUpdatedCb(Handle, _shufflemodeUpdatedCallback). - ThrowIfError("Failed to init ShuffleModeUpdated event."); - } - - private void RegisterRepeatModeUpdatedEvent() - { - _repeatmodeUpdatedCallback = (serverName, repeatMode, _) => - { - GetController(serverName)?.RaiseRepeatModeUpdatedEvent(repeatMode.ToPublic()); - }; - - Native.SetRepeatModeUpdatedCb(Handle, _repeatmodeUpdatedCallback). - ThrowIfError("Failed to init RepeatModeUpdated event."); - } - } -} \ No newline at end of file diff --git a/src/Tizen.Multimedia.Remoting/MediaController/MediaControllerManager.cs b/src/Tizen.Multimedia.Remoting/MediaController/MediaControllerManager.cs deleted file mode 100644 index 78a0e060d..000000000 --- a/src/Tizen.Multimedia.Remoting/MediaController/MediaControllerManager.cs +++ /dev/null @@ -1,204 +0,0 @@ -/* - * 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.Collections.Generic; -using System.Linq; -using System.Threading; -using Native = Interop.MediaControllerClient; -using NativeHandle = Interop.MediaControllerClientHandle; - -namespace Tizen.Multimedia.Remoting -{ - /// - /// Provides a means to retrieve active controllers and observe controllers added and removed. - /// - public partial class MediaControllerManager : IDisposable - { - private NativeHandle _handle; - - private Dictionary _activated = new Dictionary(); - - private ReaderWriterLockSlim _lock = new ReaderWriterLockSlim(); - - internal NativeHandle Handle - { - get - { - if (_disposed) - { - throw new ObjectDisposedException(nameof(MediaControllerManager)); - } - - return _handle; - } - } - - /// - /// Initializes a new instance of the class. - /// - /// http://tizen.org/privilege/mediacontroller.client - /// An internal error occurs. - /// The caller does not have required privilege. - public MediaControllerManager() - { - Native.Create(out _handle).ThrowIfError("Failed to create media controller client."); - - InitializeEvents(); - - LoadActivatedServers(); - } - - private bool _disposed; - - /// - /// Releases all resources used by the . - /// - public void Dispose() - { - Dispose(true); - } - - /// - /// Releases the unmanaged resources used by the . - /// - /// true to release both managed and unmanaged resources; false to release only unmanaged resources. - protected virtual void Dispose(bool disposing) - { - if (!_disposed) - { - if (disposing) - { - // To be used if there are any other disposable objects - } - _handle.Dispose(); - - _disposed = true; - } - } - - /// - /// Gets the active controllers. - /// - /// An array of . - public MediaController[] GetActiveControllers() - { - if (_disposed) - { - return new MediaController[0]; - } - - try - { - _lock.EnterReadLock(); - return _activated.Values.ToArray(); - } - finally - { - _lock.ExitReadLock(); - } - } - - #region Controllers-related operations - - #region Unlocking operations - - private MediaController HandleActivation(string serverName) - { - if (_activated.ContainsKey(serverName)) - { - return null; - } - - var controller = new MediaController(this, serverName); - _activated.Add(serverName, controller); - - return controller; - } - - private MediaController HandleDeactivation(string serverName) - { - if (_activated.TryGetValue(serverName, out var controller)) - { - _activated.Remove(serverName); - } - - return controller; - } - #endregion - - #region Locking operations - - private MediaController HandleServerUpdated(string serverName, MediaControllerServerState state) - { - try - { - _lock.EnterWriteLock(); - - if (state == MediaControllerServerState.Activated) - { - return HandleActivation(serverName); - } - - return HandleDeactivation(serverName); - } - finally - { - _lock.ExitWriteLock(); - } - } - - private MediaController GetController(string serverName) - { - try - { - _lock.EnterReadLock(); - - _activated.TryGetValue(serverName, out var value); - return value; - } - finally - { - _lock.ExitReadLock(); - } - } - - private void LoadActivatedServers() - { - try - { - _lock.EnterWriteLock(); - - Native.ActivatedServerCallback serverCallback = (serverName, _) => - { - _activated.Add(serverName, new MediaController(this, serverName)); - return true; - }; - - Native.ForeachActivatedServer(Handle, serverCallback, IntPtr.Zero). - ThrowIfError("Failed to get activated servers."); - } - finally - { - _lock.ExitWriteLock(); - } - } - - #endregion - - #endregion - } -} \ No newline at end of file diff --git a/src/Tizen.Multimedia.Remoting/MediaController/MediaControllerRepeatMode.cs b/src/Tizen.Multimedia.Remoting/MediaController/MediaControllerRepeatMode.cs deleted file mode 100644 index 1ac0dc881..000000000 --- a/src/Tizen.Multimedia.Remoting/MediaController/MediaControllerRepeatMode.cs +++ /dev/null @@ -1,34 +0,0 @@ -/* - * 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. - */ - -namespace Tizen.Multimedia.Remoting -{ - /// - /// Specifies the repeat mode. - /// - public enum MediaControlRepeatMode - { - /// - /// Off. - /// - Off, - - /// - /// On. - /// - On, - } -} \ No newline at end of file diff --git a/src/Tizen.Multimedia.Remoting/MediaController/MetadataUpdatedEventArgs.cs b/src/Tizen.Multimedia.Remoting/MediaController/MetadataUpdatedEventArgs.cs deleted file mode 100755 index 98cbfed16..000000000 --- a/src/Tizen.Multimedia.Remoting/MediaController/MetadataUpdatedEventArgs.cs +++ /dev/null @@ -1,41 +0,0 @@ -/* - * 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.Multimedia.Remoting -{ - /// - /// Provides data for the event. - /// - public class MetadataUpdatedEventArgs : EventArgs - { - /// - /// Initializes a new instance of the class. - /// - /// The updated . - public MetadataUpdatedEventArgs(MediaControlMetadata metadata) - { - Metadata = metadata; - } - - /// - /// Gets the metadata. - /// - /// The updated . - public MediaControlMetadata Metadata { get; } - } -} \ No newline at end of file diff --git a/src/Tizen.Multimedia.Remoting/MediaController/PlaybackCommandReceivedEventArgs.cs b/src/Tizen.Multimedia.Remoting/MediaController/PlaybackCommandReceivedEventArgs.cs deleted file mode 100644 index 7d7c3e194..000000000 --- a/src/Tizen.Multimedia.Remoting/MediaController/PlaybackCommandReceivedEventArgs.cs +++ /dev/null @@ -1,58 +0,0 @@ -/* - * 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.Multimedia.Remoting -{ - /// - /// Provides data for the event. - /// - public class PlaybackCommandReceivedEventArgs : EventArgs - { - /// - /// Initializes a new instance of the class. - /// - /// The client application id. - /// The playback command. - /// is null. - /// is invalid. - public PlaybackCommandReceivedEventArgs(string clientAppId, MediaControlPlaybackCommand command) - { - if (clientAppId == null) - { - throw new ArgumentNullException(nameof(clientAppId)); - } - - ValidationUtil.ValidateEnum(typeof(MediaControlPlaybackCommand), command, nameof(command)); - - ClientAppId = clientAppId; - Command = command; - } - - /// - /// Gets the application id of the client that sent command. - /// - /// The client application id. - public string ClientAppId { get; } - - /// - /// Gets the command. - /// - /// The . - public MediaControlPlaybackCommand Command { get; } - } -} \ No newline at end of file diff --git a/src/Tizen.Multimedia.Remoting/MediaController/PlaybackStateUpdatedEventArgs.cs b/src/Tizen.Multimedia.Remoting/MediaController/PlaybackStateUpdatedEventArgs.cs deleted file mode 100644 index d4ad6620d..000000000 --- a/src/Tizen.Multimedia.Remoting/MediaController/PlaybackStateUpdatedEventArgs.cs +++ /dev/null @@ -1,58 +0,0 @@ -/* - * 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.Diagnostics; -using Native = Interop.MediaControllerClient; - -namespace Tizen.Multimedia.Remoting -{ - /// - /// Provides data for the event. - /// - public class PlaybackStateUpdatedEventArgs : EventArgs - { - /// - /// Initializes a new instance of the class. - /// - /// The playback state. - /// The playback position in milliseconds. - /// is invalid. - /// is less than zero. - public PlaybackStateUpdatedEventArgs(MediaControlPlaybackState state, long position) - { - ValidationUtil.ValidateEnum(typeof(MediaControlPlaybackState), state, nameof(state)); - - if (position < 0) - { - throw new ArgumentOutOfRangeException(nameof(position), position, "position can't be less than zero."); - } - - State = state; - Position = position; - } - - /// - /// Gets the playback state. - /// - public MediaControlPlaybackState State { get; } - - /// - /// Gets the playback position in milliseconds. - /// - public long Position { get; } - } -} \ No newline at end of file diff --git a/src/Tizen.Multimedia.Remoting/MediaController/RepeatModeUpdatedEventArgs.cs b/src/Tizen.Multimedia.Remoting/MediaController/RepeatModeUpdatedEventArgs.cs deleted file mode 100755 index f0fecf315..000000000 --- a/src/Tizen.Multimedia.Remoting/MediaController/RepeatModeUpdatedEventArgs.cs +++ /dev/null @@ -1,44 +0,0 @@ -/* - * 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.Multimedia.Remoting -{ - /// - /// Provides data for the event. - /// - public class RepeatModeUpdatedEventArgs : EventArgs - { - /// - /// Initializes a new instance of the class. - /// - /// A value indicating the updated repeat mode. - /// is invalid. - public RepeatModeUpdatedEventArgs(MediaControlRepeatMode mode) - { - ValidationUtil.ValidateEnum(typeof(MediaControlRepeatMode), mode, nameof(mode)); - - RepeatMode = mode; - } - - /// - /// Gets the updated repeat mode. - /// - /// The . - public MediaControlRepeatMode RepeatMode { get; } - } -} \ No newline at end of file diff --git a/src/Tizen.Multimedia.Remoting/MediaController/ShuffleModeUpdatedEventArgs.cs b/src/Tizen.Multimedia.Remoting/MediaController/ShuffleModeUpdatedEventArgs.cs deleted file mode 100755 index 7905803f5..000000000 --- a/src/Tizen.Multimedia.Remoting/MediaController/ShuffleModeUpdatedEventArgs.cs +++ /dev/null @@ -1,41 +0,0 @@ -/* - * 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.Multimedia.Remoting -{ - /// - /// Provides data for the event. - /// - public class ShuffleModeUpdatedEventArgs : EventArgs - { - /// - /// Initializes a new instance of the class. - /// - /// A value indicating whether the shuffle mode is enabled. - public ShuffleModeUpdatedEventArgs(bool enabled) - { - Enabled = enabled; - } - - /// - /// Gets a value indicating whether the shuffle mode is enabled. - /// - /// true if the shuffle mode is enabled; otherwise, false. - public bool Enabled { get; } - } -} \ No newline at end of file diff --git a/src/Tizen.Multimedia.Remoting/NamespaceDoc.cs b/src/Tizen.Multimedia.Remoting/NamespaceDoc.cs deleted file mode 100644 index c5931e536..000000000 --- a/src/Tizen.Multimedia.Remoting/NamespaceDoc.cs +++ /dev/null @@ -1,22 +0,0 @@ -/* - * 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. - */ - -/// -/// The System.Runtime.Remoting namespace provides classes and interfaces that work with remote process or device. -/// -namespace Tizen.Multimedia.Remoting -{ -} \ No newline at end of file diff --git a/src/Tizen.Multimedia.Remoting/ScreenMirroring/EventArgs.cs b/src/Tizen.Multimedia.Remoting/ScreenMirroring/EventArgs.cs deleted file mode 100644 index e1d8bf3ae..000000000 --- a/src/Tizen.Multimedia.Remoting/ScreenMirroring/EventArgs.cs +++ /dev/null @@ -1,52 +0,0 @@ -/* - * 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.Multimedia.Remoting -{ - /// - /// Provides data for the event. - /// - public class ScreenMirroringStateChangedEventArgs : EventArgs - { - internal ScreenMirroringStateChangedEventArgs(ScreenMirroringState state) - { - State = state; - } - - /// - /// Gets the current state of the screen mirroring. - /// - public ScreenMirroringState State { get; } - } - - /// - /// Provides data for the event. - /// - public class ScreenMirroringErrorOccurredEventArgs : EventArgs - { - internal ScreenMirroringErrorOccurredEventArgs(ScreenMirroringError error) - { - Error = error; - } - - /// - /// Gets the error that occurred. - /// - public ScreenMirroringError Error { get; } - } -} \ No newline at end of file diff --git a/src/Tizen.Multimedia.Remoting/ScreenMirroring/InteropHelper.cs b/src/Tizen.Multimedia.Remoting/ScreenMirroring/InteropHelper.cs deleted file mode 100644 index 625854dc6..000000000 --- a/src/Tizen.Multimedia.Remoting/ScreenMirroring/InteropHelper.cs +++ /dev/null @@ -1,30 +0,0 @@ -/* - * 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.Multimedia.Remoting -{ - internal static class InteropHelper - { - internal delegate ScreenMirroringErrorCode GetFunc(ref IntPtr handle, out T value); - - internal static ScreenMirroringErrorCode GetValue(GetFunc func, IntPtr handle, out T value) - { - return func(ref handle, out value); - } - } -} diff --git a/src/Tizen.Multimedia.Remoting/ScreenMirroring/ScreenMirroring.cs b/src/Tizen.Multimedia.Remoting/ScreenMirroring/ScreenMirroring.cs deleted file mode 100644 index 2d02dc80b..000000000 --- a/src/Tizen.Multimedia.Remoting/ScreenMirroring/ScreenMirroring.cs +++ /dev/null @@ -1,523 +0,0 @@ -/* - * 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.Diagnostics; -using System.Linq; -using System.Threading; -using System.Threading.Tasks; -using Native = Interop.ScreenMirroring; - -namespace Tizen.Multimedia.Remoting -{ - /// - /// Provides the ability to connect to and disconnect from a screen mirroring source, - /// start, pause, and resume the screen mirroring as a sink. - /// - public class ScreenMirroring : IDisposable, IDisplayable - { - private const int Port = 2022; - - private IntPtr _handle; - - private AtomicState _state; - - private bool _disposed = false; - - internal IntPtr Handle - { - get - { - ThrowIfDisposed(); - - return _handle; - } - } - - /// - /// Initializes a new instance of the ScreenMirroring class. - /// - /// http://tizen.org/feature/network.wifi.direct.display - /// The feature is not supported. - public ScreenMirroring() - { - Native.Create(out _handle).ThrowIfError("Failed to create ScreenMirroring."); - - _state = new AtomicState(); - - AudioInfo = new ScreenMirroringAudioInfo(this); - VideoInfo = new ScreenMirroringVideoInfo(this); - - RegisterStateChangedEvent(); - } - - ~ScreenMirroring() - { - Dispose(false); - } - - /// - /// Occurs when the state is changed. - /// - public event EventHandler StateChanged; - - /// - /// Occurs when an error occurs. - /// - public event EventHandler ErrorOccurred; - - #region Display support - - private Display _display; - - private void DetachDisplay() - { - if (_display != null) - { - _display.SetOwner(null); - _display = null; - } - } - - private void SetDisplay(Display display) - { - if (display == null) - { - throw new ArgumentNullException(nameof(Display)); - } - - display.SetOwner(this); - display.ApplyTo(this).ThrowIfError("Failed to set display."); - - _display = display; - } - - ScreenMirroringErrorCode IDisplayable.ApplyEvasDisplay(DisplayType type, - ElmSharp.EvasObject evasObject) - { - Debug.Assert(Enum.IsDefined(typeof(DisplayType), type)); - - return Native.SetDisplay(Handle, (int)type, evasObject); - } - - ScreenMirroringErrorCode IDisplayable.ApplyEcoreWindow(IntPtr windowHandle) - { - throw new NotSupportedException("ScreenMirroring does not support NUI.Window display."); - } - #endregion - - /// - /// Gets the negotiated audio info. - /// - public ScreenMirroringAudioInfo AudioInfo { get; } - - /// - /// Gets the negotiated video info. - /// - public ScreenMirroringVideoInfo VideoInfo { get; } - - private bool IsConnected - { - get - { - return _state.IsOneOf(ScreenMirroringState.Connected, ScreenMirroringState.Playing, - ScreenMirroringState.Paused); - } - } - - internal void ThrowIfNotConnected() - { - ThrowIfDisposed(); - - if (IsConnected == false) - { - throw new InvalidOperationException("ScreenMirroring is not connected."); - } - } - - /// - /// Prepares the screen mirroring with the specified display. - /// - /// - /// The state must be .\n - /// \n - /// All supported resolutions will be candidates. - /// - /// The display where the mirroring will be played on. - /// - /// has already been assigned to another. - /// - /// is null. - /// - /// The current state is not in the valid.\n - /// -or-\n - /// An internal error occurs. - /// - /// The has already been disposed. - public void Prepare(Display display) - { - PrepareCore(display, (ScreenMirroringResolutions)0); - } - - /// - /// Prepares the screen mirroring with the specified display and resolutions. - /// - /// - /// The state must be . - /// - /// The display where the mirroring will be played on. - /// The desired resolutions. - /// - /// contain invalid flags.\n - /// -or-\n - /// has already been assigned to another. - /// - /// is null. - /// - /// The current state is not in the valid.\n - /// -or-\n - /// An internal error occurs. - /// - /// The has already been disposed. - public void Prepare(Display display, ScreenMirroringResolutions resolutions) - { - ValidationUtil.ValidateFlagsEnum(resolutions, (ScreenMirroringResolutions)((1 << 7) - 1), nameof(resolutions)); - - PrepareCore(display, resolutions); - } - - private void PrepareCore(Display display, ScreenMirroringResolutions resolutions) - { - ValidateState(ScreenMirroringState.Idle); - - Native.SetResolution(Handle, resolutions).ThrowIfError("Failed to set resolutions."); - - try - { - SetDisplay(display); - - Native.Prepare(Handle).ThrowIfError("Failed to prepare."); - } - catch - { - DetachDisplay(); - throw; - } - } - - /// - /// Creates the connection and ready for receiving data from a mirroring source. - /// - /// The source ip address to connect. - /// - /// The state must be state by - /// . - /// - /// A task that represents the asynchronous operation. - /// http://tizen.org/privilege/internet - /// is null. - /// - /// The current state is not in the valid.\n - /// -or-\n - /// An internal error occurs. - /// - /// is a zero-length string, contains only white space. - /// The has already been disposed. - /// Caller does not have required permission. - public Task ConnectAsync(string sourceIp) - { - if (sourceIp == null) - { - throw new ArgumentNullException(nameof(sourceIp)); - } - - if (string.IsNullOrWhiteSpace(sourceIp)) - { - throw new ArgumentException($"{nameof(sourceIp)} is a zero-length string.", nameof(sourceIp)); - } - - ValidateState(ScreenMirroringState.Prepared); - - Native.SetIpAndPort(Handle, sourceIp, Port.ToString()).ThrowIfError("Failed to set ip."); - - var tcs = new TaskCompletionSource(); - - Task.Factory.StartNew(() => - { - Native.Connect(Handle).ThrowIfError("Failed to connect"); - tcs.SetResult(true); - }); - - return tcs.Task; - } - - /// - /// Starts mirroring from the source. - /// - /// - /// The state must be state by - /// . - /// - /// A task that represents the asynchronous operation. - /// http://tizen.org/privilege/internet - /// - /// The current state is not in the valid.\n - /// -or-\n - /// An internal error occurs. - /// - /// The has already been disposed. - /// Caller does not have required permission. - public Task StartAsync() - { - ValidateState(ScreenMirroringState.Connected); - - var tcs = new TaskCompletionSource(); - - Task.Factory.StartNew(() => - { - Native.StartAsync(Handle).ThrowIfError("Failed to start."); - tcs.TrySetResult(true); - }); - - return tcs.Task; - } - - /// - /// Pauses mirroring from the source. - /// - /// - /// The state must be state by - /// . - /// - /// A task that represents the asynchronous operation. - /// http://tizen.org/privilege/internet - /// - /// The current state is not in the valid.\n - /// -or-\n - /// An internal error occurs. - /// - /// The has already been disposed. - /// Caller does not have required permission. - public Task PauseAsync() - { - ValidateState(ScreenMirroringState.Playing); - - var tcs = new TaskCompletionSource(); - - Task.Factory.StartNew(() => - { - Native.PauseAsync(Handle).ThrowIfError("Failed to prepare."); - tcs.TrySetResult(true); - }); - - return tcs.Task; - } - - /// - /// Resumes mirroring from the source. - /// - /// - /// The state must be state by - /// . - /// - /// A task that represents the asynchronous operation. - /// http://tizen.org/privilege/internet - /// - /// The current state is not in the valid.\n - /// -or-\n - /// An internal error occurs. - /// - /// The has already been disposed. - /// Caller does not have required permission. - public Task ResumeAsync() - { - ValidateState(ScreenMirroringState.Paused); - - var tcs = new TaskCompletionSource(); - - Task.Factory.StartNew(() => - { - Native.ResumeAsync(Handle).ThrowIfError("Failed to resume."); - tcs.TrySetResult(true); - }); - - return tcs.Task; - } - - /// - /// Disconnects from the source. - /// - /// - /// The state must be , - /// or . - /// - /// http://tizen.org/privilege/internet - /// - /// The current state is not in the valid.\n - /// -or-\n - /// An internal error occurs. - /// - /// The has already been disposed. - /// Caller does not have required permission. - public void Disconnect() - { - ValidateState(ScreenMirroringState.Connected, ScreenMirroringState.Playing, - ScreenMirroringState.Paused); - - Native.Disconnect(Handle).ThrowIfError("Failed to disconnect."); - } - - /// - /// Unprepares the screen mirroring. - /// - /// - /// The state must be , - /// or . - /// - /// - /// The current state is not in the valid.\n - /// -or-\n - /// An internal error occurs. - /// - /// The has already been disposed. - public void Unprepare() - { - ValidateState(ScreenMirroringState.Prepared, ScreenMirroringState.Disconnected); - - Native.Unprepare(Handle).ThrowIfError("Failed to reset."); - - DetachDisplay(); - } - - private void ThrowIfDisposed() - { - if (_disposed) - { - throw new ObjectDisposedException(nameof(ScreenMirroring)); - } - } - - /// - /// Releases all resource used by the object. - /// - /// - /// Call when you are finished using the . - /// The method leaves the in an unusable - /// state. After calling , you must release all references to the - /// so the garbage collector can reclaim the memory that the - /// was occupying. - /// - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - - /// - /// Releases the resources used by the ScreenMirroring. - /// - /// - /// true to release both managed and unmanaged resources; false to release only unmanaged resources. - /// - protected virtual void Dispose(bool disposing) - { - if (!_disposed) - { - DetachDisplay(); - - if (_handle != IntPtr.Zero) - { - Native.Destroy(_handle); - _handle = IntPtr.Zero; - } - - _disposed = true; - } - } - - private Native.StateChangedCallback _stateChangedCallback; - - private void RegisterStateChangedEvent() - { - _stateChangedCallback = (_, state, error) => - { - var prevState = _state.Value; - - _state.Value = state; - - if (prevState != state) - { - StateChanged?.Invoke(this, new ScreenMirroringStateChangedEventArgs(state)); - - } - - if (error != ScreenMirroringErrorCode.None) - { - ErrorOccurred?.Invoke(this, new ScreenMirroringErrorOccurredEventArgs( - ScreenMirroringError.InvalidOperation)); - } - }; - - Native.SetStateChangedCb(Handle, _stateChangedCallback). - ThrowIfError("Failed to initialize StateChanged event."); - } - - private void ValidateState(params ScreenMirroringState[] required) - { - Debug.Assert(required.Length > 0); - - if (_disposed) - { - throw new ObjectDisposedException(nameof(ScreenMirroring)); - } - - var curState = _state.Value; - if (!required.Contains(curState)) - { - throw new InvalidOperationException($"The screen mirroring is not in a valid state. " + - $"Current State : { curState }, Valid State : { string.Join(", ", required) }."); - } - } - - } - - internal class AtomicState - { - private int _value; - - public AtomicState() - { - _value = (int)ScreenMirroringState.Idle; - } - - public ScreenMirroringState Value - { - get - { - return (ScreenMirroringState)Interlocked.CompareExchange(ref _value, 0, 0); - } - set - { - Interlocked.Exchange(ref _value, (int)value); - } - } - - public bool IsOneOf(params ScreenMirroringState[] states) - { - return states.Contains(Value); - } - } -} diff --git a/src/Tizen.Multimedia.Remoting/ScreenMirroring/ScreenMirroringAudioInfo.cs b/src/Tizen.Multimedia.Remoting/ScreenMirroring/ScreenMirroringAudioInfo.cs deleted file mode 100644 index 59bd64880..000000000 --- a/src/Tizen.Multimedia.Remoting/ScreenMirroring/ScreenMirroringAudioInfo.cs +++ /dev/null @@ -1,124 +0,0 @@ -/* - * 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 static Tizen.Multimedia.Remoting.InteropHelper; -using Native = Interop.ScreenMirroring; - -namespace Tizen.Multimedia.Remoting -{ - /// - /// Provides a means to retrieve the audio information which is negotiated with the source device. - /// - /// - public class ScreenMirroringAudioInfo - { - private readonly ScreenMirroring _owner; - - internal ScreenMirroringAudioInfo(ScreenMirroring owner) - { - _owner = owner; - } - - /// - /// Gets the negotiated audio codec. - /// - /// - /// Not connected to a source.\n - /// \n - /// An internal error occurs. - /// - /// The has already been disposed. - public ScreenMirroringAudioCodec Codec - { - get - { - _owner.ThrowIfNotConnected(); - - GetValue(Native.GetNegotiatedAudioCodec, _owner.Handle, out ScreenMirroringAudioCodec value). - ThrowIfError("Failed to get audio codec."); - - return value; - } - } - - /// - /// Gets the negotiated audio channels. - /// - /// - /// Not connected to a source.\n - /// \n - /// An internal error occurs. - /// - /// The has already been disposed. - public int Channels - { - get - { - _owner.ThrowIfNotConnected(); - - GetValue(Native.GetNegotiatedAudioChannel, _owner.Handle, out int value). - ThrowIfError("Failed to get audio channels."); - - return value; - } - } - - /// - /// Gets the negotiated audio sample rate. - /// - /// - /// Not connected to a source.\n - /// \n - /// An internal error occurs. - /// - /// The has already been disposed. - public int SampleRate - { - get - { - _owner.ThrowIfNotConnected(); - - GetValue(Native.GetNegotiatedAudioSampleRate, _owner.Handle, out int value). - ThrowIfError("Failed to get audio sample rate."); - - return value; - } - } - - /// - /// Gets the negotiated audio bit width. - /// - /// - /// Not connected to a source.\n - /// \n - /// An internal error occurs. - /// - /// The has already been disposed. - public int BitWidth - { - get - { - _owner.ThrowIfNotConnected(); - - GetValue(Native.GetNegotiatedAudioBitwidth, _owner.Handle, out int value). - ThrowIfError("Failed to get audio bit width."); - - return value; - } - } - } -} diff --git a/src/Tizen.Multimedia.Remoting/ScreenMirroring/ScreenMirroringEnums.cs b/src/Tizen.Multimedia.Remoting/ScreenMirroring/ScreenMirroringEnums.cs deleted file mode 100644 index 0bed78d0b..000000000 --- a/src/Tizen.Multimedia.Remoting/ScreenMirroring/ScreenMirroringEnums.cs +++ /dev/null @@ -1,148 +0,0 @@ -/* - * 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.Multimedia.Remoting -{ - /// - /// Specifies the audio codecs for . - /// - /// - public enum ScreenMirroringAudioCodec - { - /// - /// The screen mirroring is not negotiated yet. - /// - None, - /// - /// AAC codec. - /// - Aac, - /// - /// AC3 codec. - /// - Ac3, - /// - /// LPCM codec. - /// - Lpcm - } - - /// - /// Specifies the video codecs for . - /// - /// - public enum ScreenMirroringVideoCodec - { - /// - /// The screen mirroring is not negotiated yet. - /// - None, - /// - /// H.264 codec. - /// - H264 - } - - /// - /// Specifies the available combinations of resolutions and fps for . - /// - [Flags] - public enum ScreenMirroringResolutions - { - /// - /// W-1920, H-1080, 30 fps. - /// - R1920x1080P30 = (1 << 0), - /// - /// W-1280, H-720, 30 fps. - /// - R1280x720P30 = (1 << 1), - /// - /// W-960, H-540, 30 fps. - /// - R960x540P30 = (1 << 2), - /// - /// W-864, H-480, 30 fps. - /// - R864x480P30 = (1 << 3), - /// - /// W-720, H-480, 60 fps. - /// - R720x480P60 = (1 << 4), - /// - /// W-640, H-480, 60 fps. - /// - R640x480P60 = (1 << 5), - /// - /// W-640, H-360, 30 fps. - /// - R640x360P30 = (1 << 6) - } - - /// - /// Specifies the states of . - /// - public enum ScreenMirroringState - { - /// - /// Idle. - /// - Idle = 1, - - /// - /// Prepared. - /// - /// - Prepared, - - /// - /// Connected to a source. - /// - /// - Connected, - - /// - /// Playing. - /// - /// - Playing, - - /// - /// Paused while playing media. - /// - /// - Paused, - - /// - /// Disconnected from source. - /// - /// - Disconnected - } - - /// - /// Specifies the errors for . - /// - public enum ScreenMirroringError - { - /// - /// Invalid operation. - /// - InvalidOperation = ScreenMirroringErrorCode.InvalidOperation - } -} diff --git a/src/Tizen.Multimedia.Remoting/ScreenMirroring/ScreenMirroringError.cs b/src/Tizen.Multimedia.Remoting/ScreenMirroring/ScreenMirroringError.cs deleted file mode 100644 index 7c76fd4f3..000000000 --- a/src/Tizen.Multimedia.Remoting/ScreenMirroring/ScreenMirroringError.cs +++ /dev/null @@ -1,69 +0,0 @@ -/* - * 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.Multimedia.Remoting -{ - internal enum ScreenMirroringErrorCode - { - None = ErrorCode.None, - InvalidParameter = ErrorCode.InvalidParameter, - OutOfMemory = ErrorCode.OutOfMemory, - InvalidOperation = ErrorCode.InvalidOperation, - ConnectionTimeOut = ErrorCode.ConnectionTimeout, - PermissionDenied = ErrorCode.PermissionDenied, - NotSupported = ErrorCode.NotSupported, - Unknown = ErrorCode.Unknown - } - - internal static class ScreenMirroringErrorExtensions - { - internal static void ThrowIfError(this ScreenMirroringErrorCode err, string message) - { - if (err == ScreenMirroringErrorCode.None) - { - return; - } - - switch (err) - { - case ScreenMirroringErrorCode.InvalidParameter: - throw new ArgumentException(message); - - case ScreenMirroringErrorCode.OutOfMemory: - throw new OutOfMemoryException(message); - - case ScreenMirroringErrorCode.PermissionDenied: - throw new UnauthorizedAccessException(message); - - case ScreenMirroringErrorCode.NotSupported: - throw new NotSupportedException(message); - - case ScreenMirroringErrorCode.InvalidOperation: - throw new InvalidOperationException(message); - - case ScreenMirroringErrorCode.ConnectionTimeOut: - throw new TimeoutException(message); - - default: - throw new InvalidOperationException($"Unknown error : {err.ToString()}."); - } - } - } -} - diff --git a/src/Tizen.Multimedia.Remoting/ScreenMirroring/ScreenMirroringVideoInfo.cs b/src/Tizen.Multimedia.Remoting/ScreenMirroring/ScreenMirroringVideoInfo.cs deleted file mode 100644 index 0716436b8..000000000 --- a/src/Tizen.Multimedia.Remoting/ScreenMirroring/ScreenMirroringVideoInfo.cs +++ /dev/null @@ -1,102 +0,0 @@ -/* - * 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 static Tizen.Multimedia.Remoting.InteropHelper; -using Native = Interop.ScreenMirroring; - -namespace Tizen.Multimedia.Remoting -{ - /// - /// Provides a means to retrieve the video information which is negotiated with the source device. - /// - public class ScreenMirroringVideoInfo - { - private readonly ScreenMirroring _owner; - - internal ScreenMirroringVideoInfo(ScreenMirroring owner) - { - _owner = owner; - } - - /// - /// Gets the negotiated video codec. - /// - /// - /// Not connected to a source.\n - /// \n - /// An internal error occurs. - /// - /// The has already been disposed. - public ScreenMirroringVideoCodec Codec - { - get - { - _owner.ThrowIfNotConnected(); - - GetValue(Native.GetNegotiatedVideoCodec, _owner.Handle, out ScreenMirroringVideoCodec value). - ThrowIfError("Failed to get video codec."); - - return value; - } - } - - /// - /// Gets the negotiated video resolution. - /// - /// - /// Not connected to a source.\n - /// \n - /// An internal error occurs. - /// - /// The has already been disposed. - public Size Resolution - { - get - { - _owner.ThrowIfNotConnected(); - - var handle = _owner.Handle; - Native.GetNegotiatedVideoResolution(ref handle, out var width, out var height). - ThrowIfError("Failed to get resolution."); - - return new Size(width, height); - } - } - - /// - /// Gets the negotiated video frame rate. - /// - /// - /// Not connected to a source.\n - /// \n - /// An internal error occurs. - /// - /// The has already been disposed. - public int FrameRate - { - get - { - _owner.ThrowIfNotConnected(); - - GetValue(Native.GetNegotiatedVideoFrameRate, _owner.Handle, out int value). - ThrowIfError("Failed to get video frame rate."); - - return value; - } - } - } -} diff --git a/src/Tizen.Multimedia.Remoting/Tizen.Multimedia.Remoting.csproj b/src/Tizen.Multimedia.Remoting/Tizen.Multimedia.Remoting.csproj deleted file mode 100644 index ec9bff774..000000000 --- a/src/Tizen.Multimedia.Remoting/Tizen.Multimedia.Remoting.csproj +++ /dev/null @@ -1,11 +0,0 @@ - - - - netstandard2.0 - - - - - - - \ No newline at end of file diff --git a/src/Tizen.Multimedia.Remoting/Tizen.Multimedia.Remoting.sln b/src/Tizen.Multimedia.Remoting/Tizen.Multimedia.Remoting.sln deleted file mode 100755 index 95b070792..000000000 --- a/src/Tizen.Multimedia.Remoting/Tizen.Multimedia.Remoting.sln +++ /dev/null @@ -1,72 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26730.12 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Multimedia.Remoting", "Tizen.Multimedia.Remoting.csproj", "{916CC498-AC26-4D6E-8880-39D06512E584}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ElmSharp", "..\ElmSharp\ElmSharp.csproj", "{CF568069-BFAA-492C-A523-CB213FEB2A77}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen", "..\Tizen\Tizen.csproj", "{85727CA5-D42F-472A-8F25-4B26590C5E1F}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Log", "..\Tizen.Log\Tizen.Log.csproj", "{BEB18EFD-181F-47BD-87F7-920B69C97E38}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Multimedia", "..\Tizen.Multimedia\Tizen.Multimedia.csproj", "{48FB3B03-212C-4206-A30A-C3CD82D31792}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.System.Information", "..\Tizen.System.Information\Tizen.System.Information.csproj", "{624D0C3F-9015-4CF7-8F92-E7FBE753C039}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Applications.Common", "..\Tizen.Applications.Common\Tizen.Applications.Common.csproj", "{15F2B584-D50C-4DF6-AD62-28F6B1DAF3C0}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.NUI", "..\Tizen.NUI\Tizen.NUI.csproj", "{F215E1FB-22FD-4EB5-8A56-094CE095B94B}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.System.SystemSettings", "..\Tizen.System.SystemSettings\Tizen.System.SystemSettings.csproj", "{8D796213-C2BF-4938-AAEF-D53EF0468A85}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {916CC498-AC26-4D6E-8880-39D06512E584}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {916CC498-AC26-4D6E-8880-39D06512E584}.Debug|Any CPU.Build.0 = Debug|Any CPU - {916CC498-AC26-4D6E-8880-39D06512E584}.Release|Any CPU.ActiveCfg = Release|Any CPU - {916CC498-AC26-4D6E-8880-39D06512E584}.Release|Any CPU.Build.0 = Release|Any CPU - {CF568069-BFAA-492C-A523-CB213FEB2A77}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {CF568069-BFAA-492C-A523-CB213FEB2A77}.Debug|Any CPU.Build.0 = Debug|Any CPU - {CF568069-BFAA-492C-A523-CB213FEB2A77}.Release|Any CPU.ActiveCfg = Release|Any CPU - {CF568069-BFAA-492C-A523-CB213FEB2A77}.Release|Any CPU.Build.0 = Release|Any CPU - {85727CA5-D42F-472A-8F25-4B26590C5E1F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {85727CA5-D42F-472A-8F25-4B26590C5E1F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {85727CA5-D42F-472A-8F25-4B26590C5E1F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {85727CA5-D42F-472A-8F25-4B26590C5E1F}.Release|Any CPU.Build.0 = Release|Any CPU - {BEB18EFD-181F-47BD-87F7-920B69C97E38}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {BEB18EFD-181F-47BD-87F7-920B69C97E38}.Debug|Any CPU.Build.0 = Debug|Any CPU - {BEB18EFD-181F-47BD-87F7-920B69C97E38}.Release|Any CPU.ActiveCfg = Release|Any CPU - {BEB18EFD-181F-47BD-87F7-920B69C97E38}.Release|Any CPU.Build.0 = Release|Any CPU - {48FB3B03-212C-4206-A30A-C3CD82D31792}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {48FB3B03-212C-4206-A30A-C3CD82D31792}.Debug|Any CPU.Build.0 = Debug|Any CPU - {48FB3B03-212C-4206-A30A-C3CD82D31792}.Release|Any CPU.ActiveCfg = Release|Any CPU - {48FB3B03-212C-4206-A30A-C3CD82D31792}.Release|Any CPU.Build.0 = Release|Any CPU - {624D0C3F-9015-4CF7-8F92-E7FBE753C039}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {624D0C3F-9015-4CF7-8F92-E7FBE753C039}.Debug|Any CPU.Build.0 = Debug|Any CPU - {624D0C3F-9015-4CF7-8F92-E7FBE753C039}.Release|Any CPU.ActiveCfg = Release|Any CPU - {624D0C3F-9015-4CF7-8F92-E7FBE753C039}.Release|Any CPU.Build.0 = Release|Any CPU - {15F2B584-D50C-4DF6-AD62-28F6B1DAF3C0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {15F2B584-D50C-4DF6-AD62-28F6B1DAF3C0}.Debug|Any CPU.Build.0 = Debug|Any CPU - {15F2B584-D50C-4DF6-AD62-28F6B1DAF3C0}.Release|Any CPU.ActiveCfg = Release|Any CPU - {15F2B584-D50C-4DF6-AD62-28F6B1DAF3C0}.Release|Any CPU.Build.0 = Release|Any CPU - {F215E1FB-22FD-4EB5-8A56-094CE095B94B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F215E1FB-22FD-4EB5-8A56-094CE095B94B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F215E1FB-22FD-4EB5-8A56-094CE095B94B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F215E1FB-22FD-4EB5-8A56-094CE095B94B}.Release|Any CPU.Build.0 = Release|Any CPU - {8D796213-C2BF-4938-AAEF-D53EF0468A85}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {8D796213-C2BF-4938-AAEF-D53EF0468A85}.Debug|Any CPU.Build.0 = Debug|Any CPU - {8D796213-C2BF-4938-AAEF-D53EF0468A85}.Release|Any CPU.ActiveCfg = Release|Any CPU - {8D796213-C2BF-4938-AAEF-D53EF0468A85}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {5976EB53-B44D-4454-B11C-C807DB62A7A0} - EndGlobalSection -EndGlobal diff --git a/src/Tizen.Multimedia.StreamRecorder/Interop/Interop.Libraries.cs b/src/Tizen.Multimedia.StreamRecorder/Interop/Interop.Libraries.cs deleted file mode 100644 index 43f15f269..000000000 --- a/src/Tizen.Multimedia.StreamRecorder/Interop/Interop.Libraries.cs +++ /dev/null @@ -1,23 +0,0 @@ -/* - * 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 StreamRecorder = "libcapi-media-streamrecorder.so.0"; - } -} diff --git a/src/Tizen.Multimedia.StreamRecorder/Interop/Interop.StreamRecorder.Capabilities.cs b/src/Tizen.Multimedia.StreamRecorder/Interop/Interop.StreamRecorder.Capabilities.cs deleted file mode 100644 index 133674e58..000000000 --- a/src/Tizen.Multimedia.StreamRecorder/Interop/Interop.StreamRecorder.Capabilities.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System; -using System.Runtime.InteropServices; -using Tizen.Multimedia; - -internal static partial class Interop -{ - internal static partial class StreamRecorder - { - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool VideoResolutionCallback(int width, int height, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool FileFormatCallback(StreamRecorderFileFormat format, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool AudioEncoderCallback(StreamRecorderAudioCodec codec, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool VideoEncoderCallback(StreamRecorderVideoCodec codec, IntPtr userData); - - [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_foreach_supported_file_format")] - internal static extern StreamRecorderErrorCode FileFormats(StreamRecorderHandle handle, - FileFormatCallback callback, IntPtr userData = default(IntPtr)); - - [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_foreach_supported_audio_encoder")] - internal static extern StreamRecorderErrorCode AudioEncoders(StreamRecorderHandle handle, - AudioEncoderCallback callback, IntPtr userData = default(IntPtr)); - - [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_foreach_supported_video_encoder")] - internal static extern StreamRecorderErrorCode VideoEncoders(StreamRecorderHandle handle, - VideoEncoderCallback callback, IntPtr userData = default(IntPtr)); - - [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_foreach_supported_video_resolution")] - internal static extern StreamRecorderErrorCode VideoResolution(StreamRecorderHandle handle, - VideoResolutionCallback callback, IntPtr userData = default(IntPtr)); - } -} diff --git a/src/Tizen.Multimedia.StreamRecorder/Interop/Interop.StreamRecorder.Events.cs b/src/Tizen.Multimedia.StreamRecorder/Interop/Interop.StreamRecorder.Events.cs deleted file mode 100644 index e7febae51..000000000 --- a/src/Tizen.Multimedia.StreamRecorder/Interop/Interop.StreamRecorder.Events.cs +++ /dev/null @@ -1,61 +0,0 @@ -using System; -using System.Runtime.InteropServices; -using Tizen.Multimedia; - -internal static partial class Interop -{ - internal static partial class StreamRecorder - { - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void RecordingLimitReachedCallback(RecordingLimitType type, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void RecordingStatusCallback(ulong elapsedTime, ulong fileSize, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void NotifiedCallback(int previous, int current, - StreamRecorderNotify notify, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void RecorderErrorCallback(StreamRecorderErrorCode error, - RecorderState current, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void BufferConsumedCallback(IntPtr buffer, IntPtr userData); - - [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_set_notify_cb")] - internal static extern StreamRecorderErrorCode SetNotifiedCallback(StreamRecorderHandle handle, - NotifiedCallback callback, IntPtr userData = default(IntPtr)); - - [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_unset_notify_cb")] - internal static extern int UnsetNotifiedCallback(StreamRecorderHandle handle); - - [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_set_recording_status_cb")] - internal static extern StreamRecorderErrorCode SetStatusChangedCallback(StreamRecorderHandle handle, - RecordingStatusCallback callback, IntPtr userData = default(IntPtr)); - - [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_unset_recording_status_cb")] - internal static extern int UnsetStatusChangedCallback(StreamRecorderHandle handle); - - [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_set_recording_limit_reached_cb")] - internal static extern StreamRecorderErrorCode SetLimitReachedCallback(StreamRecorderHandle handle, - RecordingLimitReachedCallback callback, IntPtr userData = default(IntPtr)); - - [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_unset_recording_limit_reached_cb")] - internal static extern int UnsetLimitReachedCallback(StreamRecorderHandle handle); - - [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_set_error_cb")] - internal static extern StreamRecorderErrorCode SetErrorCallback(StreamRecorderHandle handle, - RecorderErrorCallback callback, IntPtr userData = default(IntPtr)); - - [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_unset_error_cb")] - internal static extern int UnsetErrorCallback(StreamRecorderHandle handle); - - [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_set_buffer_consume_completed_cb")] - internal static extern StreamRecorderErrorCode SetBufferConsumedCallback(StreamRecorderHandle handle, - BufferConsumedCallback callback, IntPtr userData = default(IntPtr)); - - [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_unset_buffer_consume_completed_cb")] - internal static extern int UnsetBufferConsumedCallback(StreamRecorderHandle handle); - } -} diff --git a/src/Tizen.Multimedia.StreamRecorder/Interop/Interop.StreamRecorder.Settings.cs b/src/Tizen.Multimedia.StreamRecorder/Interop/Interop.StreamRecorder.Settings.cs deleted file mode 100644 index a8fabbb41..000000000 --- a/src/Tizen.Multimedia.StreamRecorder/Interop/Interop.StreamRecorder.Settings.cs +++ /dev/null @@ -1,88 +0,0 @@ -using System; -using System.Runtime.InteropServices; -using Tizen.Multimedia; - -internal static partial class Interop -{ - internal static partial class StreamRecorder - { - [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_set_filename")] - internal static extern StreamRecorderErrorCode SetFileName(StreamRecorderHandle handle, string path); - - [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_get_filename")] - internal static extern int GetFileName(StreamRecorderHandle handle, out IntPtr path); - - [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_set_file_format")] - internal static extern StreamRecorderErrorCode SetFileFormat(StreamRecorderHandle handle, - StreamRecorderFileFormat format); - - [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_get_file_format")] - internal static extern int GetFileFormat(StreamRecorderHandle handle, out int format); - - [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_set_audio_encoder")] - internal static extern StreamRecorderErrorCode SetAudioEncoder(StreamRecorderHandle handle, - StreamRecorderAudioCodec codec); - - [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_get_audio_encoder")] - internal static extern int GetAudioEncoder(StreamRecorderHandle handle, out int codec); - - [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_set_video_encoder")] - internal static extern StreamRecorderErrorCode SetVideoEncoder(StreamRecorderHandle handle, - StreamRecorderVideoCodec codec); - - [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_get_video_encoder")] - internal static extern int GetVideoEncoder(StreamRecorderHandle handle, out int codec); - - [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_set_video_resolution")] - internal static extern StreamRecorderErrorCode SetVideoResolution(StreamRecorderHandle handle, - int width, int height); - - [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_get_video_resolution")] - internal static extern StreamRecorderErrorCode GetVideoResolution(StreamRecorderHandle handle, - out int width, out int height); - - [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_set_video_framerate")] - internal static extern StreamRecorderErrorCode SetVideoFrameRate(StreamRecorderHandle handle, int framerate); - - [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_get_video_framerate")] - internal static extern int GetVideoFramerate(StreamRecorderHandle handle, out int framerate); - - [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_set_video_source_format")] - internal static extern StreamRecorderErrorCode SetVideoSourceFormat(StreamRecorderHandle handle, - StreamRecorderVideoFormat format); - - [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_get_video_source_format")] - internal static extern int GetVideoSourceFormat(StreamRecorderHandle handle, out int format); - - [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_set_recording_limit")] - internal static extern StreamRecorderErrorCode SetRecordingLimit(StreamRecorderHandle handle, - RecordingLimitType type, int limit); - - [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_get_recording_limit")] - internal static extern int GetRecordingLimit(StreamRecorderHandle handle, int type, out int format); - - [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_set_audio_samplerate")] - internal static extern StreamRecorderErrorCode SetAudioSampleRate(StreamRecorderHandle handle, int samplerate); - - [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_get_audio_samplerate")] - internal static extern int GetAudioSampleRate(StreamRecorderHandle handle, out int samplerate); - - [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_set_audio_encoder_bitrate")] - internal static extern StreamRecorderErrorCode SetAudioEncoderBitrate(StreamRecorderHandle handle, int bitrate); - - [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_get_audio_encoder_bitrate")] - internal static extern int GetAudioEncoderBitrate(StreamRecorderHandle handle, out int bitrate); - - [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_set_video_encoder_bitrate")] - internal static extern StreamRecorderErrorCode SetVideoEncoderBitRate(StreamRecorderHandle handle, int bitrate); - - [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_get_video_encoder_bitrate")] - internal static extern int GetVideoEncoderBitrate(StreamRecorderHandle handle, out int bitrate); - - [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_set_audio_channel")] - internal static extern StreamRecorderErrorCode SetAudioChannel(StreamRecorderHandle handle, int channel); - - [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_get_audio_channel")] - internal static extern int GetAudioChannel(StreamRecorderHandle handle, out int channel); - } -} diff --git a/src/Tizen.Multimedia.StreamRecorder/Interop/Interop.StreamRecorder.cs b/src/Tizen.Multimedia.StreamRecorder/Interop/Interop.StreamRecorder.cs deleted file mode 100644 index e7f061b0e..000000000 --- a/src/Tizen.Multimedia.StreamRecorder/Interop/Interop.StreamRecorder.cs +++ /dev/null @@ -1,77 +0,0 @@ -using System; -using System.Runtime.InteropServices; -using Tizen.Multimedia; - -internal static partial class Interop -{ - internal static partial class StreamRecorder - { - [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_create")] - internal static extern StreamRecorderErrorCode Create(out StreamRecorderHandle handle); - - [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_prepare")] - internal static extern StreamRecorderErrorCode Prepare(StreamRecorderHandle handle); - - [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_unprepare")] - internal static extern StreamRecorderErrorCode Unprepare(StreamRecorderHandle handle); - - [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_start")] - internal static extern StreamRecorderErrorCode Start(StreamRecorderHandle handle); - - [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_pause")] - internal static extern StreamRecorderErrorCode Pause(StreamRecorderHandle handle); - - [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_commit")] - internal static extern StreamRecorderErrorCode Commit(StreamRecorderHandle handle); - - [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_cancel")] - internal static extern StreamRecorderErrorCode Cancel(StreamRecorderHandle handle); - - [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_push_stream_buffer")] - internal static extern StreamRecorderErrorCode PushStreamBuffer(StreamRecorderHandle handle, - IntPtr mediaPacketHandle); - - [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_enable_source_buffer")] - internal static extern StreamRecorderErrorCode EnableSourceBuffer(StreamRecorderHandle handle, - StreamRecorderSourceType type); - - [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_get_state")] - internal static extern StreamRecorderErrorCode GetState(StreamRecorderHandle handle, out RecorderState state); - } - - internal class StreamRecorderHandle : SafeHandle - { - [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_destroy")] - private static extern StreamRecorderErrorCode Destroy(IntPtr handle); - - [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_cancel")] - private static extern StreamRecorderErrorCode Cancel(IntPtr handle); - - [DllImport(Libraries.StreamRecorder, EntryPoint = "streamrecorder_unprepare")] - private static extern StreamRecorderErrorCode Unprepare(IntPtr handle); - - protected StreamRecorderHandle() : base(IntPtr.Zero, true) - { - } - - public override bool IsInvalid => handle == IntPtr.Zero; - - protected override bool ReleaseHandle() - { - try - { - Cancel(handle).Ignore(StreamRecorderErrorCode.InvalidState).ThrowIfError("Failed to cancel."); - Unprepare(handle).Ignore(StreamRecorderErrorCode.InvalidState).ThrowIfError("Failed to unprepare."); - Destroy(handle).ThrowIfError("Failed to destory."); - - return true; - } - catch (Exception e) - { - Tizen.Log.Debug(GetType().FullName, $"Failed to release native RecorderHandle; {e.Message}"); - - return false; - } - } - } -} diff --git a/src/Tizen.Multimedia.StreamRecorder/StreamRecorder/StreamRecorder.Capabilities.cs b/src/Tizen.Multimedia.StreamRecorder/StreamRecorder/StreamRecorder.Capabilities.cs deleted file mode 100644 index 4ba213796..000000000 --- a/src/Tizen.Multimedia.StreamRecorder/StreamRecorder/StreamRecorder.Capabilities.cs +++ /dev/null @@ -1,154 +0,0 @@ -/* - * 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.Collections.Generic; -using System.Linq; -using Native = Interop.StreamRecorder; - -namespace Tizen.Multimedia -{ - public partial class StreamRecorder - { - internal void LoadCapabilities() - { - _videoCodecs = LoadVideoCodecs(this); - _audioCodecs = LoadAudioCodecs(this); - _fileFormats = LoadFileFormats(this); - _videoResolutions = LoadResolutions(this); - } - - private static IEnumerable LoadVideoCodecs(StreamRecorder recorder) - { - var result = new List(); - Native.VideoEncoderCallback callback = (codec, _) => - { - result.Add(codec.ToRecorderEnum()); - return true; - }; - - Native.VideoEncoders(recorder.Handle, callback).ThrowIfError("Failed to get the supported video codecs."); - - return result.AsReadOnly(); - } - - private static IEnumerable LoadAudioCodecs(StreamRecorder recorder) - { - var result = new List(); - - Native.AudioEncoders(recorder.Handle, (codec, _) => - { - result.Add(codec.ToRecorderEnum()); - return true; - }).ThrowIfError("Failed to get the supported audio codecs."); - - return result.AsReadOnly(); - } - - private static IEnumerable LoadFileFormats(StreamRecorder recorder) - { - var result = new List(); - - Native.FileFormats(recorder.Handle, (fileFormat, _) => - { - result.Add(fileFormat.ToRecorderEnum()); - return true; - }).ThrowIfError("Failed to get the supported file formats."); - - return result.AsReadOnly(); - } - - private static IEnumerable LoadResolutions(StreamRecorder recorder) - { - List result = new List(); - - Native.VideoResolutionCallback callback = (width, height, _) => - { - result.Add(new Size(width, height)); - return true; - }; - - Native.VideoResolution(recorder.Handle, callback). - ThrowIfError("Failed to get the supported video resolutions."); - - return result.AsReadOnly(); - } - - private IEnumerable _fileFormats; - - /// - /// Gets the file formats that the current device supports. - /// - /// An IEnumerable of representing the supported file formats. - public IEnumerable GetSupportedFileFormats() => _fileFormats; - - private IEnumerable _audioCodecs; - - /// - /// Gets the audio codecs that the current device supports. - /// - /// An IEnumerable of representing the supported audio codecs. - public IEnumerable GetSupportedAudioCodecs() => _audioCodecs; - - private IEnumerable _videoCodecs; - - /// - /// Gets the video codecs that the current device supports. - /// - /// An IEnumerable of representing the supported video codecs. - public IEnumerable GetSupportedVideoCodecs() => _videoCodecs; - - private IEnumerable _videoResolutions; - - /// - /// Gets the video resolutions that the current device supports. - /// - /// An IEnumerable of representing the supported resolutions. - public IEnumerable GetSupportedVideoResolutions() => _videoResolutions; - - internal void ValidateFileFormat(RecorderFileFormat format) - { - if (_fileFormats.Contains(format) == false) - { - throw new NotSupportedException($"{format.ToString()} is not supported."); - } - } - - internal void ValidateAudioCodec(RecorderAudioCodec codec) - { - if (_audioCodecs.Contains(codec) == false) - { - throw new NotSupportedException($"{codec.ToString()} is not supported."); - } - } - - internal void ValidateVideoCodec(RecorderVideoCodec codec) - { - if (_videoCodecs.Contains(codec) == false) - { - throw new NotSupportedException($"{codec.ToString()} is not supported."); - } - } - - internal void ValidateVideoResolution(Size resolution) - { - if (_videoResolutions.Contains(resolution) == false) - { - throw new NotSupportedException($"Resolution({resolution.ToString()}) is not supported."); - } - } - } -} \ No newline at end of file diff --git a/src/Tizen.Multimedia.StreamRecorder/StreamRecorder/StreamRecorder.Events.cs b/src/Tizen.Multimedia.StreamRecorder/StreamRecorder/StreamRecorder.Events.cs deleted file mode 100644 index 647e3abd4..000000000 --- a/src/Tizen.Multimedia.StreamRecorder/StreamRecorder/StreamRecorder.Events.cs +++ /dev/null @@ -1,129 +0,0 @@ -/* - * 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.Diagnostics; -using Native = Interop.StreamRecorder; - -namespace Tizen.Multimedia -{ - public partial class StreamRecorder - { - /// - /// Occurs when state is changed. - /// - public event EventHandler StateChanged; - - - /// - /// Occurs when a buffer had consumed completely. - /// - public event EventHandler BufferConsumed; - - /// - /// Occurs when recording status is changed. - /// - public event EventHandler RecordingStatusChanged; - - /// - /// Occurs when recording limit is reached. - /// - public event EventHandler RecordingLimitReached; - - /// - /// Occurs when an error occurred during a recorder operation. - /// - public event EventHandler ErrorOccurred; - - private Native.RecordingLimitReachedCallback _recordingLimitReachedCallback; - private Native.RecorderErrorCallback _recorderErrorCallback; - private Native.RecordingStatusCallback _recordingStatusCallback; - private Native.BufferConsumedCallback _bufferConsumedCallback; - private Native.NotifiedCallback _notifiedCallback; - - private void RegisterStreamRecorderNotifiedEvent() - { - _notifiedCallback = (previous, current, notify, _) => - { - if (previous == 0) - { - return; - } - - StateChanged?.Invoke(this, new StreamRecorderStateChangedEventArgs( - (RecorderState)previous, (RecorderState)current)); - }; - - Native.SetNotifiedCallback(_handle, _notifiedCallback). - ThrowIfError("Failed to initialize state changed event."); - } - - private void RegisterBufferConsumedEvent() - { - _bufferConsumedCallback = (lockedPacketHandle, _) => - { - MediaPacket packet = null; - - // Lock must be disposed here, note that the packet won't be disposed. - using (MediaPacket.Lock packetLock = - MediaPacket.Lock.FromHandle(lockedPacketHandle)) - { - Debug.Assert(packetLock != null); - - packet = packetLock.MediaPacket; - } - - BufferConsumed?.Invoke(this, new StreamRecorderBufferConsumedEventArgs(packet)); - }; - - Native.SetBufferConsumedCallback(_handle, _bufferConsumedCallback). - ThrowIfError("Failed to initialize buffer consumed event."); - } - - private void RegisterRecordingStatusChangedEvent() - { - _recordingStatusCallback = (elapsedTime, fileSize, _) => - { - RecordingStatusChanged?.Invoke(this, new RecordingStatusChangedEventArgs((long)elapsedTime, (long)fileSize)); - }; - Native.SetStatusChangedCallback(_handle, _recordingStatusCallback). - ThrowIfError("Failed to initialize status changed event."); - } - - private void RegisterRecordingLimitReachedEvent() - { - _recordingLimitReachedCallback = (type, _) => - { - RecordingLimitReached?.Invoke(this, new RecordingLimitReachedEventArgs(type)); - }; - - Native.SetLimitReachedCallback(_handle, _recordingLimitReachedCallback). - ThrowIfError("Failed to initialize limit reached event."); - } - - private void RegisterRecordingErrorOccurredEvent() - { - _recorderErrorCallback = (error, currentState, _) => - { - ErrorOccurred?.Invoke(this, new StreamRecorderErrorOccurredEventArgs( - error == StreamRecorderErrorCode.OutOfStorage ? - StreamRecorderError.OutOfStorage : StreamRecorderError.InternalError, currentState)); - }; - Native.SetErrorCallback(_handle, _recorderErrorCallback). - ThrowIfError("Failed to set error callback"); - } - } -} diff --git a/src/Tizen.Multimedia.StreamRecorder/StreamRecorder/StreamRecorder.cs b/src/Tizen.Multimedia.StreamRecorder/StreamRecorder/StreamRecorder.cs deleted file mode 100644 index 99fd6d881..000000000 --- a/src/Tizen.Multimedia.StreamRecorder/StreamRecorder/StreamRecorder.cs +++ /dev/null @@ -1,363 +0,0 @@ -/* - * 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.Diagnostics; -using System.Linq; -using NativeHandle = Interop.StreamRecorderHandle; -using Native = Interop.StreamRecorder; - -namespace Tizen.Multimedia -{ - /// - /// Provides the ability to record user buffer from application. - /// - /// - public partial class StreamRecorder : IDisposable - { - private NativeHandle _handle; - private bool _disposed = false; - - private bool _audioEnabled; - private bool _videoEnabled; - private StreamRecorderVideoFormat _sourceFormat; - - /// - /// Initialize a new instance of the class. - /// - /// The feature is not supported. - public StreamRecorder() - { - try - { - Native.Create(out _handle).ThrowIfError("Failed to create stream recorder."); - } - catch (TypeLoadException) - { - throw new NotSupportedException("StreamRecorder is not supported."); - } - - LoadCapabilities(); - - RegisterStreamRecorderNotifiedEvent(); - RegisterBufferConsumedEvent(); - RegisterRecordingStatusChangedEvent(); - RegisterRecordingErrorOccurredEvent(); - RegisterRecordingLimitReachedEvent(); - } - - internal NativeHandle Handle - { - get - { - if (_disposed) - { - throw new ObjectDisposedException(nameof(StreamRecorder)); - } - - return _handle; - } - } - - /// - /// Gets the current state of the stream recorder. - /// - /// The has already been disposed. - public RecorderState State - { - get - { - Native.GetState(Handle, out var val).ThrowIfError("Failed to get the stream recorder state."); - - return val; - } - } - - private void ValidateState(params RecorderState[] required) - { - Debug.Assert(required.Length > 0); - - var curState = State; - if (!required.Contains(curState)) - { - throw new InvalidOperationException($"The stream recorder is not in a valid state. " + - $"Current State : { curState }, Valid State : { string.Join(", ", required) }."); - } - } - - #region Operation methods - /// - /// Prepares the stream recorder with the specified options. - /// - /// The recorder must be . - /// The options for recording. - /// The recorder is not in the valid state. - /// Both and - /// are null. - /// - /// contains a value which is not supported. - /// The has already been disposed. - /// - /// - /// - /// - /// - public void Prepare(StreamRecorderOptions options) - { - if (options == null) - { - throw new ArgumentNullException(nameof(options)); - } - - ValidateState(RecorderState.Idle); - - options.Apply(this); - - Native.Prepare(Handle).ThrowIfError("Failed to prepare stream recorder."); - - _audioEnabled = options.Audio != null; - _videoEnabled = options.Video != null; - - if (options.Video != null) - { - _sourceFormat = options.Video.SourceFormat; - } - } - - /// - /// Unprepares the stream recorder. - /// - /// - /// The recorder state must be state by - /// , and .\n - /// The recorder state will be .\n - /// \n - /// It has no effect if the recorder is already in the state. - /// - /// The recorder is not in the valid state. - /// The has already been disposed. - /// - public void Unprepare() - { - if (State == RecorderState.Idle) - { - return; - } - - ValidateState(RecorderState.Ready); - - Native.Unprepare(Handle).ThrowIfError("Failed to reset the stream recorder."); - } - - /// - /// Starts recording. - /// - /// - /// The recorder state must be state by - /// or - /// state by .\n - /// \n - /// It has no effect if the recorder is already in the state. - /// - /// The recorder is not in the valid state. - /// The access of the resources can not be granted. - /// The has already been disposed. - /// - /// - /// - public void Start() - { - if (State == RecorderState.Recording) - { - return; - } - - ValidateState(RecorderState.Ready, RecorderState.Paused); - - Native.Start(Handle).ThrowIfError("Failed to start the stream recorder."); - } - - /// - /// Pauses recording. - /// - /// - /// Recording can be resumed with .\n - /// \n - /// The recorder state must be state by \n - /// \n - /// It has no effect if the recorder is already in the state. - /// - /// The recorder is not in the valid state. - /// The has already been disposed. - /// - /// - /// - public void Pause() - { - if (State == RecorderState.Paused) - { - return; - } - - ValidateState(RecorderState.Recording); - - Native.Pause(Handle).ThrowIfError("Failed to pause the stream recorder."); - } - - /// - /// Stops recording and saves the result. - /// - /// - /// The recorder state must be state by or - /// state by .\n - /// \n - /// The recorder state will be after commit.\n - /// - /// http://tizen.org/privilege/mediastorage is needed if the save path are relevant to media storage. - /// http://tizen.org/privilege/externalstorage is needed if the save path are relevant to external storage. - /// - /// - /// http://tizen.org/privilege/mediastorage - /// http://tizen.org/privilege/externalstorage - /// The recorder is not in the valid state. - /// The access to the resources can not be granted. - /// The has already been disposed. - /// - /// - public void Commit() - { - ValidateState(RecorderState.Paused, RecorderState.Recording); - - Native.Commit(Handle).ThrowIfError("Failed to commit."); - } - - /// - /// Cancels recording. - /// The recording data is discarded and not written. - /// - /// - /// The recorder state must be state by or - /// state by . - /// - /// The recorder is not in the valid state. - /// The has already been disposed. - /// - /// - public void Cancel() - { - ValidateState(RecorderState.Paused, RecorderState.Recording); - - Native.Cancel(Handle).ThrowIfError("Failed to cancel recording."); - } - - private static bool AreVideoTypesMatched(StreamRecorderVideoFormat videoFormat, MediaFormatVideoMimeType mimeType) - { - return (videoFormat == StreamRecorderVideoFormat.Nv12 && mimeType == MediaFormatVideoMimeType.NV12) || - (videoFormat == StreamRecorderVideoFormat.Nv21 && mimeType == MediaFormatVideoMimeType.NV21) || - (videoFormat == StreamRecorderVideoFormat.I420 && mimeType == MediaFormatVideoMimeType.I420); - } - - /// - /// Pushes a packet as recording raw data. - /// - /// An audio or video packet to record. - /// - /// The recorder state must be state by . - /// - /// - /// The recorder is not in the valid state.\n - /// -or-\n - /// is an audio packet but audio recording is not enabled(See ).\n - /// -or-\n - /// is a video packet but video recording is not enabled(See ).\n - /// -or-\n - /// is a video packet but the does not match the video source format.\n - /// -or-\n - /// An internal error occurs. - /// - /// The has already been disposed. - /// - /// - /// - /// - public void PushBuffer(MediaPacket packet) - { - if (packet == null) - { - throw new ArgumentNullException(nameof(packet)); - } - - ValidateState(RecorderState.Recording); - - switch (packet.Format.Type) - { - case MediaFormatType.Audio: - if (_audioEnabled == false) - { - throw new InvalidOperationException("Audio option is not set."); - } - break; - - case MediaFormatType.Video: - if (_videoEnabled == false) - { - throw new InvalidOperationException("Video option is not set."); - } - - if (AreVideoTypesMatched(_sourceFormat, (packet.Format as VideoMediaFormat).MimeType) == false) - { - throw new InvalidOperationException("Video format does not match."); - } - - break; - - default: - throw new ArgumentException("Packet is not valid."); - } - - Native.PushStreamBuffer(Handle, MediaPacket.Lock.Get(packet).GetHandle()) - .ThrowIfError("Failed to push buffer."); - } - - #endregion - - #region Dispose support - /// - /// Release any unmanaged resources used by this object. - /// - public void Dispose() - { - Dispose(true); - } - - /// - /// Releases the resources used by the StreamRecorder. - /// - /// - /// true to release both managed and unmanaged resources; false to release only unmanaged resources. - /// - protected virtual void Dispose(bool disposing) - { - if (!_disposed) - { - _handle?.Dispose(); - - _disposed = true; - } - } - #endregion - } -} diff --git a/src/Tizen.Multimedia.StreamRecorder/StreamRecorder/StreamRecorderAudioOptions.cs b/src/Tizen.Multimedia.StreamRecorder/StreamRecorder/StreamRecorderAudioOptions.cs deleted file mode 100644 index 911cf3452..000000000 --- a/src/Tizen.Multimedia.StreamRecorder/StreamRecorder/StreamRecorderAudioOptions.cs +++ /dev/null @@ -1,175 +0,0 @@ -/* - * 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 Native = Interop.StreamRecorder; - -namespace Tizen.Multimedia -{ - /// - /// Specifies the options associated with audio recording. - /// - /// - /// - /// - public class StreamRecorderAudioOptions - { - private const int DefaultSampleRate = 0; - private const int DefaultBitRate = 128000; - private const int DefaultChannels = 2; - - /// - /// Initialize a new instance of the class with the specified codec. - /// - /// The for encoding audio stream. - /// - /// , and will be set as default. - /// - /// is not valid. - public StreamRecorderAudioOptions(RecorderAudioCodec codec) : - this(codec, DefaultSampleRate, DefaultBitRate, DefaultChannels) - { - } - - /// - /// Initialize a new instance of the class with the specified - /// codec, sample rate, bit rate and channel value. - /// - /// The for encoding audio stream. - /// The sample rate for encoding audio stream. - /// The bit rate for encoding audio stream. - /// The number of channels for encoding audio stream. - /// is not valid. - /// - /// is less than zero.\n - /// -or-\n - /// is less than or equal to zero.\n - /// -or-\n - /// is less than or equal to zero. - /// - public StreamRecorderAudioOptions(RecorderAudioCodec codec, int sampleRate, int bitRate, int channels) - { - Codec = codec; - SampleRate = sampleRate; - BitRate = bitRate; - Channels = channels; - } - - private RecorderAudioCodec _codec; - - /// - /// Gets or sets the audio codec for encoding an audio stream. - /// - /// The codec for audio stream recording. - /// is not valid. - /// - public RecorderAudioCodec Codec - { - get => _codec; - set - { - ValidationUtil.ValidateEnum(typeof(RecorderAudioCodec), value, nameof(value)); - - _codec = value; - } - } - - private int _sampleRate; - - /// - /// Gets or sets the sampling rate of the audio stream in hertz. - /// - /// If the value is zero, the sample rate will be decided based on input buffers. - /// The sample rate value for stream recorder. The default is zero. - /// is less than zero. - public int SampleRate - { - get => _sampleRate; - set - { - if (value < 0) - { - throw new ArgumentOutOfRangeException(nameof(value), value, - "Sample rate can't be less than or equal to zero."); - } - - _sampleRate = value; - } - } - - private int _bitRate; - - /// - /// Gets or sets the bit rate of the audio encoder in bits per second. - /// - /// The bit rate value for audio stream recording. The default is 128000. - /// is less than or equal to zero. - public int BitRate - { - get => _bitRate; - set - { - if (value <= 0) - { - throw new ArgumentOutOfRangeException(nameof(value), value, - "Bit rate can't be less than or equal to zero."); - } - - _bitRate = value; - } - } - - private int _channels; - - /// - /// Gets or sets the number of audio channels. - /// - /// The number of audio channels for audio stream recording. The default is 2. - /// is less than or equal to zero. - public int Channels - { - get => _channels; - set - { - if (value <= 0) - { - throw new ArgumentOutOfRangeException(nameof(value), value, - "Channels can't be less than or equal to zero."); - } - - _channels = value; - } - } - - internal void Apply(StreamRecorder recorder) - { - recorder.ValidateAudioCodec(Codec); - - Native.SetAudioEncoder(recorder.Handle, Codec.ToStreamRecorderEnum()). - ThrowIfError("Failed to set audio codec."); - - Native.SetAudioSampleRate(recorder.Handle, SampleRate). - ThrowIfError("Failed to set audio sample rate."); - - Native.SetAudioEncoderBitrate(recorder.Handle, BitRate). - ThrowIfError("Failed to set audio bit rate."); - - Native.SetAudioChannel(recorder.Handle, Channels). - ThrowIfError("Failed to set audio channels."); - } - } - -} diff --git a/src/Tizen.Multimedia.StreamRecorder/StreamRecorder/StreamRecorderBufferConsumedEventArgs.cs b/src/Tizen.Multimedia.StreamRecorder/StreamRecorder/StreamRecorderBufferConsumedEventArgs.cs deleted file mode 100644 index f11c51c6c..000000000 --- a/src/Tizen.Multimedia.StreamRecorder/StreamRecorder/StreamRecorderBufferConsumedEventArgs.cs +++ /dev/null @@ -1,37 +0,0 @@ -/* - * 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.Multimedia -{ - - /// - /// Provides data for the event. - /// - public class StreamRecorderBufferConsumedEventArgs : EventArgs - { - internal StreamRecorderBufferConsumedEventArgs(MediaPacket packet) - { - Packet = packet; - } - - /// - /// Gets the packet that has consumed. - /// - public MediaPacket Packet { get; } - } -} diff --git a/src/Tizen.Multimedia.StreamRecorder/StreamRecorder/StreamRecorderEnums.cs b/src/Tizen.Multimedia.StreamRecorder/StreamRecorder/StreamRecorderEnums.cs deleted file mode 100644 index 041d0f01e..000000000 --- a/src/Tizen.Multimedia.StreamRecorder/StreamRecorder/StreamRecorderEnums.cs +++ /dev/null @@ -1,272 +0,0 @@ -/* - * 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.Diagnostics; - -namespace Tizen.Multimedia -{ - - /// - /// Specifies errors for / - /// - public enum StreamRecorderError - { - /// - /// Internal error. - /// - InternalError = StreamRecorderErrorCode.InvalidOperation, - /// - /// Out of storage. - /// - OutOfStorage = StreamRecorderErrorCode.OutOfStorage - } - - /// - /// Specifies the video source formats for . - /// - public enum StreamRecorderVideoFormat - { - /// - /// Nv12 format. - /// - Nv12, - /// - /// Nv21 format. - /// - Nv21, - /// - /// I420 format. - /// - I420 - } - - #region Internal enums - - /// - /// Enumeration for Audio Codec. - /// - internal enum StreamRecorderAudioCodec - { - /// - /// AMR codec. - /// - Amr = 0, - /// - /// AAC codec. - /// - Aac, - /// - /// PCM codec. - /// - Pcm - } - - /// - /// Enumeration for the file container format. - /// - internal enum StreamRecorderFileFormat - { - /// - /// 3GP file format. - /// - ThreeGp, - /// - /// MP4 file format. - /// - Mp4, - /// - /// AMR file format. - /// - Amr, - /// - /// ADTS file format. - /// - Adts, - /// - /// WAV file format. - /// - Wav - } - - /// - /// Enumeration for the recorder notify type. - /// - internal enum StreamRecorderNotify - { - /// - /// None. - /// - None = 0, - /// - /// State changed. - /// - StateChanged - } - - /// - /// Enumeration for video codec. - /// - internal enum StreamRecorderVideoCodec - { - /// - /// H263 codec. - /// - H263, - /// - /// MPEG4 codec. - /// - Mpeg4 - } - - /// - /// Enumeration for source type. - /// - internal enum StreamRecorderSourceType - { - /// - /// Video source - /// - Video, - /// - /// Audio source - /// - Audio, - /// - /// Audio/Video both - /// - VideoAudio - } - - internal static class StreamRecorderEnumExtensions - { - internal static RecorderVideoCodec ToRecorderEnum(this StreamRecorderVideoCodec value) - { - switch (value) - { - case StreamRecorderVideoCodec.H263: - return RecorderVideoCodec.H263; - - case StreamRecorderVideoCodec.Mpeg4: - return RecorderVideoCodec.Mpeg4; - } - - Debug.Fail("Unknown video codec value."); - return 0; - } - - internal static StreamRecorderVideoCodec ToStreamRecorderEnum(this RecorderVideoCodec value) - { - switch (value) - { - case RecorderVideoCodec.H263: - return StreamRecorderVideoCodec.H263; - - case RecorderVideoCodec.Mpeg4: - return StreamRecorderVideoCodec.Mpeg4; - } - - throw new NotSupportedException($"{value.ToString()} is not supported."); - } - - - internal static RecorderAudioCodec ToRecorderEnum(this StreamRecorderAudioCodec value) - { - switch (value) - { - case StreamRecorderAudioCodec.Aac: - return RecorderAudioCodec.Aac; - - case StreamRecorderAudioCodec.Amr: - return RecorderAudioCodec.Amr; - - case StreamRecorderAudioCodec.Pcm: - return RecorderAudioCodec.Pcm; - } - - Debug.Fail("Unknown audio codec value."); - return 0; - } - - - internal static StreamRecorderAudioCodec ToStreamRecorderEnum(this RecorderAudioCodec value) - { - switch (value) - { - case RecorderAudioCodec.Aac: - return StreamRecorderAudioCodec.Aac; - - case RecorderAudioCodec.Amr: - return StreamRecorderAudioCodec.Amr; - - case RecorderAudioCodec.Pcm: - return StreamRecorderAudioCodec.Pcm; - } - - throw new NotSupportedException($"{value.ToString()} is not supported."); - } - - - internal static RecorderFileFormat ToRecorderEnum(this StreamRecorderFileFormat value) - { - switch (value) - { - case StreamRecorderFileFormat.ThreeGp: - return RecorderFileFormat.ThreeGp; - - case StreamRecorderFileFormat.Mp4: - return RecorderFileFormat.Mp4; - - case StreamRecorderFileFormat.Amr: - return RecorderFileFormat.Amr; - - case StreamRecorderFileFormat.Adts: - return RecorderFileFormat.Adts; - - case StreamRecorderFileFormat.Wav: - return RecorderFileFormat.Wav; - } - - Debug.Fail("Unknown file format value."); - return 0; - } - - - internal static StreamRecorderFileFormat ToStreamRecorderEnum(this RecorderFileFormat value) - { - switch (value) - { - case RecorderFileFormat.ThreeGp: - return StreamRecorderFileFormat.ThreeGp; - - case RecorderFileFormat.Mp4: - return StreamRecorderFileFormat.Mp4; - - case RecorderFileFormat.Amr: - return StreamRecorderFileFormat.Amr; - - case RecorderFileFormat.Adts: - return StreamRecorderFileFormat.Adts; - - case RecorderFileFormat.Wav: - return StreamRecorderFileFormat.Wav; - } - - throw new NotSupportedException($"{value.ToString()} is not supported."); - } - } - #endregion -} diff --git a/src/Tizen.Multimedia.StreamRecorder/StreamRecorder/StreamRecorderError.cs b/src/Tizen.Multimedia.StreamRecorder/StreamRecorder/StreamRecorderError.cs deleted file mode 100644 index 3c971de9f..000000000 --- a/src/Tizen.Multimedia.StreamRecorder/StreamRecorder/StreamRecorderError.cs +++ /dev/null @@ -1,74 +0,0 @@ -/* - * 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.IO; -using Tizen.Internals.Errors; - -namespace Tizen.Multimedia -{ - internal enum StreamRecorderErrorCode - { - None = ErrorCode.None, - InvalidParameter = ErrorCode.InvalidParameter, - TizenErrorStreamRecorder = -0x01A10000, - InvalidState = TizenErrorStreamRecorder | 0x01, - OutOfMemory = ErrorCode.OutOfMemory, - InvalidOperation = ErrorCode.InvalidOperation, - OutOfStorage = TizenErrorStreamRecorder | 0x02, - PermissionDenied = ErrorCode.PermissionDenied, - NotSupported = ErrorCode.NotSupported, - } - - internal static class StreamRecorderErrorExtensions - { - internal static StreamRecorderErrorCode Ignore(this StreamRecorderErrorCode errorCode, StreamRecorderErrorCode ignore) - { - return (ignore == errorCode) ? StreamRecorderErrorCode.None : errorCode; - } - - internal static void ThrowIfError(this StreamRecorderErrorCode err, string errorMessage) - { - if (err == StreamRecorderErrorCode.None) - { - return; - } - - switch (err) - { - case StreamRecorderErrorCode.InvalidParameter: - throw new ArgumentException(errorMessage); - - case StreamRecorderErrorCode.OutOfMemory: - throw new OutOfMemoryException(errorMessage); - - case StreamRecorderErrorCode.PermissionDenied: - throw new UnauthorizedAccessException(errorMessage); - - case StreamRecorderErrorCode.NotSupported: - throw new NotSupportedException(errorMessage); - - case StreamRecorderErrorCode.InvalidState: - case StreamRecorderErrorCode.InvalidOperation: - throw new InvalidOperationException(errorMessage); - - case StreamRecorderErrorCode.OutOfStorage: - throw new IOException(errorMessage); - } - } - } -} - diff --git a/src/Tizen.Multimedia.StreamRecorder/StreamRecorder/StreamRecorderErrorOccurredEventArgs.cs b/src/Tizen.Multimedia.StreamRecorder/StreamRecorder/StreamRecorderErrorOccurredEventArgs.cs deleted file mode 100644 index 228dda703..000000000 --- a/src/Tizen.Multimedia.StreamRecorder/StreamRecorder/StreamRecorderErrorOccurredEventArgs.cs +++ /dev/null @@ -1,43 +0,0 @@ -/* - * 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.Multimedia -{ - /// - /// Provides data for the event. - /// - public class StreamRecorderErrorOccurredEventArgs : EventArgs - { - internal StreamRecorderErrorOccurredEventArgs(StreamRecorderError error, RecorderState state) - { - Error = error; - State = state; - } - - /// - /// Gets the error code. - /// - public StreamRecorderError Error { get; } - - /// - /// Gets the state of the recorder. - /// - public RecorderState State { get; } - - } -} diff --git a/src/Tizen.Multimedia.StreamRecorder/StreamRecorder/StreamRecorderOptions.cs b/src/Tizen.Multimedia.StreamRecorder/StreamRecorder/StreamRecorderOptions.cs deleted file mode 100644 index 49d90989b..000000000 --- a/src/Tizen.Multimedia.StreamRecorder/StreamRecorder/StreamRecorderOptions.cs +++ /dev/null @@ -1,214 +0,0 @@ -/* - * 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.Diagnostics; -using Native = Interop.StreamRecorder; - -namespace Tizen.Multimedia -{ - /// - /// Specifies the options associated with . - /// - /// - /// - /// - /// - public class StreamRecorderOptions - { - /// - /// Initialize a new instance of the class with the specified - /// save path and file format. - /// - /// The path that the recording result is saved. - /// The file format of output file. - /// is null. - /// - /// is an empty string.\n - /// -or-\n - /// is not valid. - /// - public StreamRecorderOptions(string savePath, RecorderFileFormat fileFormat) - { - SavePath = savePath; - FileFormat = fileFormat; - } - - private string _savePath; - - /// - /// Gets or sets the file path to record. - /// - /// - /// If the same file already exists in the file system, then old file will be overwritten. - /// - /// is null. - /// is an empty string. - public string SavePath - { - get => _savePath; - set - { - if (value == null) - { - throw new ArgumentNullException(nameof(value)); - } - - if (string.IsNullOrWhiteSpace(value)) - { - throw new ArgumentException("Path can't be an empty string.", nameof(value)); - } - - _savePath = value; - } - } - - private RecorderFileFormat _fileFormat; - - /// - /// Gets or sets the file format for recording media stream. - /// - /// is not valid. - /// - public RecorderFileFormat FileFormat - { - get => _fileFormat; - set - { - ValidationUtil.ValidateEnum(typeof(RecorderFileFormat), value, nameof(value)); - - _fileFormat = value; - } - } - - private int _timeLimit; - - /// - /// Gets or sets the time limit of recording. - /// - /// - /// The maximum time of recording in seconds, or 0 for unlimited time. - /// - /// - /// After reaching the limitation, the data which is being recorded will - /// be discarded and not written to the file. - /// The recorder state must be state. - /// - /// is less than zero. - /// - /// - public int TimeLimit - { - get => _timeLimit; - set - { - if (value < 0) - { - throw new ArgumentOutOfRangeException(nameof(value), value, - "Time limit can't be less than zero."); - } - - _timeLimit = value; - } - } - - private int _sizeLimit; - - /// - /// Gets or sets the maximum size of a recording file. - /// - /// - /// The maximum size of a recording file in kilobytes, or 0 for unlimited size. - /// - /// - /// After reaching the limitation, the data which is being recorded will - /// be discarded and not written to the file. - /// - /// is less than zero. - /// - /// - public int SizeLimit - { - get => _sizeLimit; - set - { - if (value < 0) - { - throw new ArgumentOutOfRangeException(nameof(value), value, - "Size limit can't be less than zero."); - } - - _sizeLimit = value; - } - } - - /// - /// Gets or sets the options for audio recording. - /// - /// - /// or must be set for recording. - /// - /// - public StreamRecorderAudioOptions Audio { get; set; } - - /// - /// Gets or sets the options for video recording. - /// - /// - /// or must be set for recording. - /// - /// - public StreamRecorderVideoOptions Video { get; set; } - - private StreamRecorderSourceType GetSourceType() - { - Debug.Assert(Audio != null || Video != null); - - if (Audio != null && Video != null) - { - return StreamRecorderSourceType.VideoAudio; - } - - return Audio != null ? StreamRecorderSourceType.Audio : StreamRecorderSourceType.Video; - } - - internal void Apply(StreamRecorder recorder) - { - if (Audio == null && Video == null) - { - throw new ArgumentException("Both Audio and Video are not set."); - } - - Native.EnableSourceBuffer(recorder.Handle, GetSourceType()).ThrowIfError("Failed to apply options."); - - Native.SetFileName(recorder.Handle, SavePath).ThrowIfError("Failed to set save path."); - - recorder.ValidateFileFormat(FileFormat); - Native.SetFileFormat(recorder.Handle, FileFormat.ToStreamRecorderEnum()) - .ThrowIfError("Failed to set file format."); - - Native.SetRecordingLimit(recorder.Handle, RecordingLimitType.Size, SizeLimit). - ThrowIfError("Failed to set size limit."); - - Native.SetRecordingLimit(recorder.Handle, RecordingLimitType.Time, TimeLimit). - ThrowIfError("Failed to set time limit."); - - Audio?.Apply(recorder); - - Video?.Apply(recorder); - } - } -} diff --git a/src/Tizen.Multimedia.StreamRecorder/StreamRecorder/StreamRecorderStateChangedEventArgs.cs b/src/Tizen.Multimedia.StreamRecorder/StreamRecorder/StreamRecorderStateChangedEventArgs.cs deleted file mode 100644 index 2a91d1a0b..000000000 --- a/src/Tizen.Multimedia.StreamRecorder/StreamRecorder/StreamRecorderStateChangedEventArgs.cs +++ /dev/null @@ -1,42 +0,0 @@ -/* - * 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.Multimedia -{ - /// - /// Provides data for the event. - /// - public class StreamRecorderStateChangedEventArgs : EventArgs - { - internal StreamRecorderStateChangedEventArgs(RecorderState previous, RecorderState current) - { - Previous = previous; - Current = current; - } - - /// - /// Gets the previous state of the stream recorder. - /// - public RecorderState Previous { get; } - - /// - /// Gets the current state of the stream recorder. - /// - public RecorderState Current { get; } - } -} diff --git a/src/Tizen.Multimedia.StreamRecorder/StreamRecorder/StreamRecorderVideoOptions.cs b/src/Tizen.Multimedia.StreamRecorder/StreamRecorder/StreamRecorderVideoOptions.cs deleted file mode 100644 index 346053217..000000000 --- a/src/Tizen.Multimedia.StreamRecorder/StreamRecorder/StreamRecorderVideoOptions.cs +++ /dev/null @@ -1,217 +0,0 @@ -/* - * 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 Native = Interop.StreamRecorder; - -namespace Tizen.Multimedia -{ - /// - /// Specifies the options associated with video recording. - /// - /// - /// - /// - public class StreamRecorderVideoOptions - { - private const int DefaultBitRate = 0; - - /// - /// Initialize a new instance of the class with the specified - /// codec, resolution, source format and frame rate. - /// - /// The for encoding video stream. - /// The resolution of video recording. - /// The format of source stream. - /// The frame rate for encoding video stream. - /// - /// will be set as default. - /// - /// - /// is not valid.\n - /// -or-\n - /// is not valid.\n - /// - /// - /// Width or height of is less than or equal to zero.\n - /// -or-\n - /// is less than or equal to zero.\n - /// - public StreamRecorderVideoOptions(RecorderVideoCodec codec, Size resolution, - StreamRecorderVideoFormat sourceFormat, int frameRate) : - this(codec, resolution, sourceFormat, frameRate, DefaultBitRate) - { - } - - /// - /// Initialize a new instance of the class with the specified - /// codec, resolution, source format, frame rate and bit rate. - /// - /// The for encoding video stream. - /// The resolution of video recording. - /// The format of source stream. - /// The frame rate for encoding video stream. - /// The bit rate for encoding video stream. - /// - /// is not valid.\n - /// -or-\n - /// is not valid.\n - /// - /// - /// Width or height of is less than or equal to zero.\n - /// -or-\n - /// is less than or equal to zero.\n - /// -or-\n - /// is less than zero. - /// - public StreamRecorderVideoOptions(RecorderVideoCodec codec, Size resolution, - StreamRecorderVideoFormat sourceFormat, int frameRate, int bitRate) - { - Codec = codec; - Resolution = resolution; - SourceFormat = sourceFormat; - FrameRate = frameRate; - BitRate = bitRate; - } - - private RecorderVideoCodec _codec; - - /// - /// Gets or sets the video codec for encoding video stream. - /// - /// The codec for video stream recording. - /// is not valid. - /// - public RecorderVideoCodec Codec - { - get => _codec; - set - { - ValidationUtil.ValidateEnum(typeof(RecorderVideoCodec), value, nameof(value)); - - _codec = value; - } - } - - private Size _resolution; - - /// - /// Gets or sets the resolution of the video recording. - /// - /// The output resolution for video stream recording. - /// - /// Width or height of is less than or equal to zero. - /// - /// - public Size Resolution - { - get => _resolution; - set - { - if (value.Width <= 0 || value.Height <= 0) - { - throw new ArgumentOutOfRangeException(nameof(value), value, - "Resolution can't be less than or equal to zero."); - } - - _resolution = value; - } - } - - private int _frameRate; - - /// - /// Gets or sets the frame rate for recording media stream. - /// - /// The frame rate value for video stream recording. - /// is less than or equal to zero. - public int FrameRate - { - get => _frameRate; - set - { - if (value <= 0) - { - throw new ArgumentOutOfRangeException(nameof(value), value, - "Frame rate can't be less than or equal to zero."); - } - _frameRate = value; - } - } - - private StreamRecorderVideoFormat _sourceFormat; - - /// - /// Gets or sets the video source format for recording media stream. - /// - /// The source format of buffers for video stream recording. - /// is not valid. - public StreamRecorderVideoFormat SourceFormat - { - get => _sourceFormat; - set - { - ValidationUtil.ValidateEnum(typeof(StreamRecorderVideoFormat), value, nameof(value)); - - _sourceFormat = value; - } - } - - private int _bitRate; - - /// - /// The bit rate of the video encoder in bits per second. - /// - /// The bit rate value for video stream recording. The default is 0. - /// is less than zero. - public int BitRate - { - get => _bitRate; - set - { - if (value < 0) - { - throw new ArgumentOutOfRangeException(nameof(value), value, - "Bit rate can't be less than or equal to zero."); - } - _bitRate = value; - } - } - - internal void Apply(StreamRecorder recorder) - { - recorder.ValidateVideoCodec(Codec); - - Native.SetVideoEncoder(recorder.Handle, Codec.ToStreamRecorderEnum()). - ThrowIfError("Failed to set video codec."); - - recorder.ValidateVideoResolution(Resolution); - - Native.SetVideoResolution(recorder.Handle, Resolution.Width, Resolution.Height). - ThrowIfError("Failed to set video resolution."); - - Native.SetVideoFrameRate(recorder.Handle, FrameRate). - ThrowIfError("Failed to set video frame rate."); - - Native.SetVideoEncoderBitRate(recorder.Handle, BitRate). - ThrowIfError("Failed to set video bit rate."); - - Native.SetVideoSourceFormat(recorder.Handle, SourceFormat). - ThrowIfError("Failed to set video source format."); - } - } - -} diff --git a/src/Tizen.Multimedia.StreamRecorder/Tizen.Multimedia.StreamRecorder.csproj b/src/Tizen.Multimedia.StreamRecorder/Tizen.Multimedia.StreamRecorder.csproj deleted file mode 100644 index 9b8e9e682..000000000 --- a/src/Tizen.Multimedia.StreamRecorder/Tizen.Multimedia.StreamRecorder.csproj +++ /dev/null @@ -1,11 +0,0 @@ - - - - netstandard2.0 - - - - - - - \ No newline at end of file diff --git a/src/Tizen.Multimedia.StreamRecorder/Tizen.Multimedia.StreamRecorder.sln b/src/Tizen.Multimedia.StreamRecorder/Tizen.Multimedia.StreamRecorder.sln deleted file mode 100755 index 830c4c19c..000000000 --- a/src/Tizen.Multimedia.StreamRecorder/Tizen.Multimedia.StreamRecorder.sln +++ /dev/null @@ -1,90 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26730.12 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Multimedia.StreamRecorder", "Tizen.Multimedia.StreamRecorder.csproj", "{E637475F-BFC1-40F3-A903-D548C240F677}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Multimedia.Recorder", "..\Tizen.Multimedia.Recorder\Tizen.Multimedia.Recorder.csproj", "{FF4886B5-3225-40C5-9314-1193E0ECAEDF}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen", "..\Tizen\Tizen.csproj", "{C983A5CA-797B-4C30-B9E0-A7A4B1275D88}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Log", "..\Tizen.Log\Tizen.Log.csproj", "{AF762B89-151B-413B-B289-9909ABA04371}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ElmSharp", "..\ElmSharp\ElmSharp.csproj", "{1413EA41-9936-41A5-9BCF-9E1DA243DB7B}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Applications.Common", "..\Tizen.Applications.Common\Tizen.Applications.Common.csproj", "{BC2D0788-EF91-4E36-BFC6-B91E48A223E2}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.NUI", "..\Tizen.NUI\Tizen.NUI.csproj", "{F605BC25-8B3A-4C51-AF63-C49AABFB6793}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.System.SystemSettings", "..\Tizen.System.SystemSettings\Tizen.System.SystemSettings.csproj", "{3E60C6E2-D0C3-4471-9E2F-ADD1E3A8A3C7}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Multimedia", "..\Tizen.Multimedia\Tizen.Multimedia.csproj", "{36328359-B4AB-4AFD-A06E-4C0355B9472F}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.System.Information", "..\Tizen.System.Information\Tizen.System.Information.csproj", "{958093FF-C0C1-4CAA-9B89-EFFF00790535}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Multimedia.AudioIO", "..\Tizen.Multimedia.AudioIO\Tizen.Multimedia.AudioIO.csproj", "{80C1392F-E71C-4539-A970-BDE3FF04B951}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Multimedia.Camera", "..\Tizen.Multimedia.Camera\Tizen.Multimedia.Camera.csproj", "{EEA12578-E0D6-4852-90B8-020D238E29C4}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {E637475F-BFC1-40F3-A903-D548C240F677}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E637475F-BFC1-40F3-A903-D548C240F677}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E637475F-BFC1-40F3-A903-D548C240F677}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E637475F-BFC1-40F3-A903-D548C240F677}.Release|Any CPU.Build.0 = Release|Any CPU - {FF4886B5-3225-40C5-9314-1193E0ECAEDF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {FF4886B5-3225-40C5-9314-1193E0ECAEDF}.Debug|Any CPU.Build.0 = Debug|Any CPU - {FF4886B5-3225-40C5-9314-1193E0ECAEDF}.Release|Any CPU.ActiveCfg = Release|Any CPU - {FF4886B5-3225-40C5-9314-1193E0ECAEDF}.Release|Any CPU.Build.0 = Release|Any CPU - {C983A5CA-797B-4C30-B9E0-A7A4B1275D88}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C983A5CA-797B-4C30-B9E0-A7A4B1275D88}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C983A5CA-797B-4C30-B9E0-A7A4B1275D88}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C983A5CA-797B-4C30-B9E0-A7A4B1275D88}.Release|Any CPU.Build.0 = Release|Any CPU - {AF762B89-151B-413B-B289-9909ABA04371}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {AF762B89-151B-413B-B289-9909ABA04371}.Debug|Any CPU.Build.0 = Debug|Any CPU - {AF762B89-151B-413B-B289-9909ABA04371}.Release|Any CPU.ActiveCfg = Release|Any CPU - {AF762B89-151B-413B-B289-9909ABA04371}.Release|Any CPU.Build.0 = Release|Any CPU - {1413EA41-9936-41A5-9BCF-9E1DA243DB7B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1413EA41-9936-41A5-9BCF-9E1DA243DB7B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1413EA41-9936-41A5-9BCF-9E1DA243DB7B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {1413EA41-9936-41A5-9BCF-9E1DA243DB7B}.Release|Any CPU.Build.0 = Release|Any CPU - {BC2D0788-EF91-4E36-BFC6-B91E48A223E2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {BC2D0788-EF91-4E36-BFC6-B91E48A223E2}.Debug|Any CPU.Build.0 = Debug|Any CPU - {BC2D0788-EF91-4E36-BFC6-B91E48A223E2}.Release|Any CPU.ActiveCfg = Release|Any CPU - {BC2D0788-EF91-4E36-BFC6-B91E48A223E2}.Release|Any CPU.Build.0 = Release|Any CPU - {F605BC25-8B3A-4C51-AF63-C49AABFB6793}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F605BC25-8B3A-4C51-AF63-C49AABFB6793}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F605BC25-8B3A-4C51-AF63-C49AABFB6793}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F605BC25-8B3A-4C51-AF63-C49AABFB6793}.Release|Any CPU.Build.0 = Release|Any CPU - {3E60C6E2-D0C3-4471-9E2F-ADD1E3A8A3C7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {3E60C6E2-D0C3-4471-9E2F-ADD1E3A8A3C7}.Debug|Any CPU.Build.0 = Debug|Any CPU - {3E60C6E2-D0C3-4471-9E2F-ADD1E3A8A3C7}.Release|Any CPU.ActiveCfg = Release|Any CPU - {3E60C6E2-D0C3-4471-9E2F-ADD1E3A8A3C7}.Release|Any CPU.Build.0 = Release|Any CPU - {36328359-B4AB-4AFD-A06E-4C0355B9472F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {36328359-B4AB-4AFD-A06E-4C0355B9472F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {36328359-B4AB-4AFD-A06E-4C0355B9472F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {36328359-B4AB-4AFD-A06E-4C0355B9472F}.Release|Any CPU.Build.0 = Release|Any CPU - {958093FF-C0C1-4CAA-9B89-EFFF00790535}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {958093FF-C0C1-4CAA-9B89-EFFF00790535}.Debug|Any CPU.Build.0 = Debug|Any CPU - {958093FF-C0C1-4CAA-9B89-EFFF00790535}.Release|Any CPU.ActiveCfg = Release|Any CPU - {958093FF-C0C1-4CAA-9B89-EFFF00790535}.Release|Any CPU.Build.0 = Release|Any CPU - {80C1392F-E71C-4539-A970-BDE3FF04B951}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {80C1392F-E71C-4539-A970-BDE3FF04B951}.Debug|Any CPU.Build.0 = Debug|Any CPU - {80C1392F-E71C-4539-A970-BDE3FF04B951}.Release|Any CPU.ActiveCfg = Release|Any CPU - {80C1392F-E71C-4539-A970-BDE3FF04B951}.Release|Any CPU.Build.0 = Release|Any CPU - {EEA12578-E0D6-4852-90B8-020D238E29C4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {EEA12578-E0D6-4852-90B8-020D238E29C4}.Debug|Any CPU.Build.0 = Debug|Any CPU - {EEA12578-E0D6-4852-90B8-020D238E29C4}.Release|Any CPU.ActiveCfg = Release|Any CPU - {EEA12578-E0D6-4852-90B8-020D238E29C4}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {DD113101-5A21-474D-9B56-22610C624BDF} - EndGlobalSection -EndGlobal diff --git a/src/Tizen.Multimedia.Util/ImageUtil/BitmapFrame.cs b/src/Tizen.Multimedia.Util/ImageUtil/BitmapFrame.cs deleted file mode 100644 index 0a485983c..000000000 --- a/src/Tizen.Multimedia.Util/ImageUtil/BitmapFrame.cs +++ /dev/null @@ -1,50 +0,0 @@ -/* - * 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.Diagnostics; -using System.Runtime.InteropServices; - -namespace Tizen.Multimedia.Util -{ - /// - /// Represents the image data returned by a decoder class. - /// - public class BitmapFrame - { - internal BitmapFrame(IntPtr nativeBuffer, int width, int height, int size) - { - Debug.Assert(nativeBuffer != IntPtr.Zero); - - byte[] buf = new byte[size]; - Marshal.Copy(nativeBuffer, buf, 0, size); - - Buffer = buf; - - Size = new Size(width, height); - } - - /// - /// Gets the raw image data. - /// - public byte[] Buffer { get; } - - /// - /// Gets the size of the image. - /// - public Size Size { get; } - } -} diff --git a/src/Tizen.Multimedia.Util/ImageUtil/GifFrame.cs b/src/Tizen.Multimedia.Util/ImageUtil/GifFrame.cs deleted file mode 100644 index 6649e29f0..000000000 --- a/src/Tizen.Multimedia.Util/ImageUtil/GifFrame.cs +++ /dev/null @@ -1,61 +0,0 @@ -/* - * 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.Multimedia.Util -{ - /// - /// Represents the gif image data used to encode a gif image with . - /// - public class GifFrame - { - - /// - /// 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. - /// is null. - /// The length of is zero. - public GifFrame(byte[] buffer, uint delay) - { - if (buffer == null) - { - throw new ArgumentNullException(nameof(buffer)); - } - - if (buffer.Length == 0) - { - throw new ArgumentException("buffer has no element.", nameof(buffer)); - } - - Buffer = buffer; - Delay = delay; - } - - /// - /// Gets the raw image data. - /// - public byte[] Buffer { get; } - - /// - /// Gets or sets the delay for this image. - /// - /// Time delay in 0.001 sec units. - public uint Delay { get; set; } - } -} diff --git a/src/Tizen.Multimedia.Util/ImageUtil/ImageColorSpace.cs b/src/Tizen.Multimedia.Util/ImageUtil/ImageColorSpace.cs deleted file mode 100644 index 8c3fd1b54..000000000 --- a/src/Tizen.Multimedia.Util/ImageUtil/ImageColorSpace.cs +++ /dev/null @@ -1,172 +0,0 @@ -/* - * 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.Diagnostics; - -namespace Tizen.Multimedia.Util -{ - internal enum ImageColorSpace - { - /// - /// YV12 - YCrCb planar format. - /// - YV12, - /// - /// YUV422 - planar. - /// - Yuv422, - /// - /// YUV420 - planar. - /// - I420, - /// - /// NV12- planar. - /// - NV12, - /// - /// UYVY - packed. - /// - Uyvy, - /// - /// YUYV - packed. - /// - Yuyv, - /// - /// RGB565, high-byte is blue. - /// - Rgb565, - /// - /// RGB888, high-byte is blue. - /// - Rgb888, - /// - /// ARGB8888, high-byte is blue. - /// - Argb8888, - /// - /// BGRA8888, high-byte is alpha. - /// - Bgra8888, - /// - /// RGBA8888, high-byte is alpha. - /// - Rgba8888, - /// - /// BGRX8888, high-byte is X. - /// - Bgrx8888, - /// - /// NV21- planar. - /// - NV21, - /// - /// NV16- planar. - /// - NV16, - /// - /// NV61- planar. - /// - NV61, - } - - internal static class ImageColorSpaceExtensions - { - internal static ColorSpace ToCommonColorSpace(this ImageColorSpace value) - { - Debug.Assert(Enum.IsDefined(typeof(ImageColorSpace), value)); - - switch (value) - { - case ImageColorSpace.YV12: return ColorSpace.YV12; - - case ImageColorSpace.Uyvy: return ColorSpace.Uyvy; - - case ImageColorSpace.Yuyv: return ColorSpace.Yuyv; - - case ImageColorSpace.Yuv422: return ColorSpace.Yuv422; - - case ImageColorSpace.I420: return ColorSpace.I420; - - case ImageColorSpace.Rgb565: return ColorSpace.Rgb565; - - case ImageColorSpace.Rgb888: return ColorSpace.Rgb888; - - case ImageColorSpace.Argb8888: return ColorSpace.Argb8888; - - case ImageColorSpace.Bgra8888: return ColorSpace.Bgra8888; - - case ImageColorSpace.Rgba8888: return ColorSpace.Rgba8888; - - case ImageColorSpace.Bgrx8888: return ColorSpace.Bgrx8888; - - case ImageColorSpace.NV12: return ColorSpace.NV12; - - case ImageColorSpace.NV16: return ColorSpace.NV16; - - case ImageColorSpace.NV21: return ColorSpace.NV21; - - case ImageColorSpace.NV61: return ColorSpace.NV61; - } - - Debug.Fail($"Not supported color space : {value.ToString()}!"); - throw new NotSupportedException("Implementation does not support the specified value."); - } - } - - internal static class ImageColorSpaceSupport - { - internal static ImageColorSpace ToImageColorSpace(this ColorSpace colorSpace) - { - ValidationUtil.ValidateEnum(typeof(ColorSpace), colorSpace, nameof(colorSpace)); - - switch (colorSpace) - { - case ColorSpace.YV12: return ImageColorSpace.YV12; - - case ColorSpace.Uyvy: return ImageColorSpace.Uyvy; - - case ColorSpace.Yuyv: return ImageColorSpace.Yuyv; - - case ColorSpace.Yuv422: return ImageColorSpace.Yuv422; - - case ColorSpace.I420: return ImageColorSpace.I420; - - case ColorSpace.Rgb565: return ImageColorSpace.Rgb565; - - case ColorSpace.Rgb888: return ImageColorSpace.Rgb888; - - case ColorSpace.Argb8888: return ImageColorSpace.Argb8888; - - case ColorSpace.Bgra8888: return ImageColorSpace.Bgra8888; - - case ColorSpace.Rgba8888: return ImageColorSpace.Rgba8888; - - case ColorSpace.Bgrx8888: return ImageColorSpace.Bgrx8888; - - case ColorSpace.NV12: return ImageColorSpace.NV12; - - case ColorSpace.NV16: return ImageColorSpace.NV16; - - case ColorSpace.NV21: return ImageColorSpace.NV21; - - case ColorSpace.NV61: return ImageColorSpace.NV61; - } - - throw new NotSupportedException($"The ColorSpace.{colorSpace.ToString()} is not supported."); - } - } -} diff --git a/src/Tizen.Multimedia.Util/ImageUtil/ImageDecoder.cs b/src/Tizen.Multimedia.Util/ImageUtil/ImageDecoder.cs deleted file mode 100644 index fcf1cab34..000000000 --- a/src/Tizen.Multimedia.Util/ImageUtil/ImageDecoder.cs +++ /dev/null @@ -1,382 +0,0 @@ -/* - * 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.Collections.Generic; -using System.Diagnostics; -using System.IO; -using System.Linq; -using System.Runtime.InteropServices; -using System.Threading.Tasks; -using static Interop; -using static Interop.Decode; - -namespace Tizen.Multimedia.Util -{ - /// - /// This is a base class for image decoders. - /// - public abstract class ImageDecoder : IDisposable - { - private ImageDecoderHandle _handle; - - private ColorSpace? _colorSpace; - - internal ImageDecoder(ImageFormat format) - { - Create(out _handle).ThrowIfFailed("Failed to create ImageDecoder"); - - Debug.Assert(_handle != null); - - InputFormat = format; - } - - /// - /// Gets the image format of this decoder. - /// - public ImageFormat InputFormat { get; } - - private ImageDecoderHandle Handle - { - get - { - if (_handle.IsInvalid) - { - throw new ObjectDisposedException(nameof(ImageDecoder)); - } - return _handle; - } - } - - /// - /// Sets the color-space to decode into. The default is . - /// - /// The value indicating color-space to decode into. - /// is invalid. - /// is not supported by the decoder. - /// - public void SetColorSpace(ColorSpace colorSpace) - { - ValidationUtil.ValidateEnum(typeof(ColorSpace), colorSpace, nameof(ColorSpace)); - - if (ImageUtil.GetSupportedColorSpaces(InputFormat).Contains(colorSpace) == false) - { - throw new NotSupportedException($"{colorSpace.ToString()} is not supported for {InputFormat}."); - } - - _colorSpace = colorSpace; - } - - /// - /// Decodes an image from the specified file. - /// - /// The input file path from which to decode. - /// A task that represents the asynchronous decoding operation. - /// - /// Only Graphics Interchange Format(GIF) codec returns more than one frame.\n - /// \n - /// http://tizen.org/privilege/mediastorage is needed if is relevant to the media storage.\n - /// http://tizen.org/privilege/externalstorage is needed if is relevant to the external storage. - /// - /// is null. - /// - /// is an empty string.\n - /// - or -\n - /// is not a image file.\n - /// - or -\n - /// The format of is not . - /// - /// does not exists. - /// The caller does not have required permission to access the path. - /// The format of is not . - /// The has already been disposed of. - public async Task> DecodeAsync(string inputFilePath) - { - if (inputFilePath == null) - { - throw new ArgumentNullException(nameof(inputFilePath)); - } - - if (inputFilePath.Length == 0) - { - throw new ArgumentException("path is empty.", nameof(inputFilePath)); - } - - if (CheckHeader(inputFilePath) == false) - { - throw new FileFormatException("The file has an invalid header."); - } - - var pathPtr = Marshal.StringToHGlobalAnsi(inputFilePath); - try - { - - SetInputPath(Handle, pathPtr).ThrowIfFailed("Failed to set input file path for decoding"); - return await DecodeAsync(); - } - finally - { - Marshal.FreeHGlobal(pathPtr); - } - } - - /// - /// Decodes an image from the buffer. - /// - /// The image buffer from which to decode. - /// A task that represents the asynchronous decoding operation. - /// - /// Only Graphics Interchange Format(GIF) codec returns more than one frame.\n - /// - /// is null. - /// - /// is an empty array.\n - /// - or -\n - /// The format of is not . - /// - /// The format of is not . - /// The has already been disposed of. - public Task> DecodeAsync(byte[] inputBuffer) - { - if (inputBuffer == null) - { - throw new ArgumentNullException(nameof(inputBuffer)); - } - - if (inputBuffer.Length == 0) - { - throw new ArgumentException("buffer is empty.", nameof(inputBuffer)); - } - - if (CheckHeader(inputBuffer) == false) - { - throw new FileFormatException("buffer has an invalid header."); - } - - SetInputBuffer(Handle, inputBuffer, (ulong)inputBuffer.Length). - ThrowIfFailed("Failed to set input buffer for decoding"); - - return DecodeAsync(); - } - - private bool CheckHeader(byte[] input) - { - if (input.Length < Header.Length) - { - return false; - } - - for (int i = 0; i < Header.Length; ++i) - { - if (input[i] != Header[i]) - { - return false; - } - } - - return true; - } - - private bool CheckHeader(string inputFile) - { - using (var fs = File.OpenRead(inputFile)) - { - byte[] fileHeader = new byte[Header.Length]; - - if (fs.Read(fileHeader, 0, fileHeader.Length) < Header.Length) - { - return false; - } - return CheckHeader(fileHeader); - } - } - - internal Task> DecodeAsync() - { - Initialize(Handle); - - IntPtr outBuffer = IntPtr.Zero; - SetOutputBuffer(Handle, out outBuffer).ThrowIfFailed("Failed to decode given image"); - - var tcs = new TaskCompletionSource>(); - - Task.Run(() => - { - try - { - int width, height; - ulong size; - - DecodeRun(Handle, out width, out height, out size).ThrowIfFailed("Failed to decode"); - - tcs.SetResult(new[] { new BitmapFrame(outBuffer, width, height, (int)size) }); - } - catch (Exception e) - { - tcs.TrySetException(e); - } - finally - { - LibcSupport.Free(outBuffer); - } - }); - - return tcs.Task; - } - - internal virtual void Initialize(ImageDecoderHandle handle) - { - if (_colorSpace.HasValue) - { - SetColorspace(Handle, _colorSpace.Value.ToImageColorSpace()).ThrowIfFailed("Failed to set color space"); - } - } - - internal abstract byte[] Header { get; } - - #region IDisposable Support - private bool _disposed = false; - - /// - /// Releases the unmanaged resources used by the ImageDecoder. - /// - /// true to release both managed and unmanaged resources; false to release only unmanaged resources. - protected virtual void Dispose(bool disposing) - { - if (!_disposed) - { - if (_handle != null) - { - _handle.Dispose(); - } - _disposed = true; - } - } - - /// - /// Releases all resources used by the ImageDecoder. - /// - public void Dispose() - { - Dispose(true); - } - #endregion - } - - /// - /// Provides the ability to decode Bitmap (BMP) encoded images. - /// - public class BmpDecoder : ImageDecoder - { - private static readonly byte[] _header = { (byte)'B', (byte)'M' }; - - /// - /// Initializes a new instance of the class. - /// - /// will be the . - public BmpDecoder() : base(ImageFormat.Bmp) - { - } - - internal override byte[] Header => _header; - } - - /// - /// Provides the ability to decode the Portable Network Graphics (PNG) encoded images. - /// - public class PngDecoder : ImageDecoder - { - private static readonly byte[] _header = { 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a }; - - /// - /// Initializes a new instance of the class. - /// - /// will be the . - public PngDecoder() : base(ImageFormat.Png) - { - } - - internal override byte[] Header => _header; - } - - /// - /// Provides the ability to decode the Joint Photographic Experts Group (JPEG) encoded images. - /// - public class JpegDecoder : ImageDecoder - { - private static readonly byte[] _header = { 0xFF, 0xD8 }; - - /// - /// A read-only field that represents the default value of . - /// - public static readonly JpegDownscale DefaultJpegDownscale = JpegDownscale.None; - - private JpegDownscale _jpegDownscale = DefaultJpegDownscale; - - /// - /// Initializes a new instance of the class. - /// - /// will be the . - public JpegDecoder() : base(ImageFormat.Jpeg) - { - } - - /// - /// Gets or sets the downscale at which the jpeg image should be decoded. - /// - /// is invalid. - public JpegDownscale Downscale - { - get - { - return _jpegDownscale; - } - set - { - ValidationUtil.ValidateEnum(typeof(JpegDownscale), value, nameof(Downscale)); - - _jpegDownscale = value; - } - } - - internal override void Initialize(ImageDecoderHandle handle) - { - base.Initialize(handle); - - SetJpegDownscale(handle, Downscale).ThrowIfFailed("Failed to set downscale for decoding"); - } - - internal override byte[] Header => _header; - } - - /// - /// Provides the ability to decode the Graphics Interchange Format (GIF) encoded images. - /// - public class GifDecoder : ImageDecoder - { - private static readonly byte[] _header = { (byte)'G', (byte)'I', (byte)'F' }; - - /// - /// Initializes a new instance of the class. - /// - /// will be the . - public GifDecoder() : base(ImageFormat.Gif) - { - } - - internal override byte[] Header => _header; - } -} diff --git a/src/Tizen.Multimedia.Util/ImageUtil/ImageEncoder.cs b/src/Tizen.Multimedia.Util/ImageUtil/ImageEncoder.cs deleted file mode 100644 index 23863a131..000000000 --- a/src/Tizen.Multimedia.Util/ImageUtil/ImageEncoder.cs +++ /dev/null @@ -1,462 +0,0 @@ -/* - * 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.Collections.Generic; -using System.Diagnostics; -using System.IO; -using System.Linq; -using System.Runtime.InteropServices; -using System.Threading.Tasks; -using static Interop.ImageUtil; -using Unmanaged = Interop.ImageUtil.Encode; - -namespace Tizen.Multimedia.Util -{ - /// - /// This is a base class for image encoders. - /// - public abstract class ImageEncoder : IDisposable - { - private ImageEncoderHandle _handle; - - private bool _hasResolution; - - internal ImageEncoder(ImageFormat format) - { - Unmanaged.Create(format, out _handle).ThrowIfFailed("Failed to create ImageEncoder"); - - Debug.Assert(_handle != null); - - OutputFormat = format; - } - - private ImageEncoderHandle Handle - { - get - { - if (_disposed) - { - throw new ObjectDisposedException(GetType().Name); - } - - return _handle; - } - } - - /// - /// Gets the image format of this encoder. - /// - public ImageFormat OutputFormat { get; } - - /// - /// Sets the resolution of the output image. - /// - /// The target resolution. - /// - /// The width of is less than or equal to zero.\n - /// - or -\n - /// The height of is less than or equal to zero. - /// - public void SetResolution(Size resolution) - { - if (resolution.Width <= 0) - { - throw new ArgumentOutOfRangeException(nameof(resolution), resolution.Width, - "The width of resolution can't be less than or equal to zero."); - } - if (resolution.Height <= 0) - { - throw new ArgumentOutOfRangeException(nameof(resolution), resolution.Height, - "The height of resolution can't be less than or equal to zero."); - } - - Unmanaged.SetResolution(Handle, (uint)resolution.Width, (uint)resolution.Height). - ThrowIfFailed("Failed to set the resolution"); - - _hasResolution = true; - } - - /// - /// Sets the color-space of the output image. - /// - /// The target color-space. - /// is invalid. - /// is not supported by the encoder. - /// - public void SetColorSpace(ColorSpace colorSpace) - { - ValidationUtil.ValidateEnum(typeof(ColorSpace), colorSpace, nameof(colorSpace)); - - if (ImageUtil.GetSupportedColorSpaces(OutputFormat).Contains(colorSpace) == false) - { - throw new NotSupportedException($"{colorSpace.ToString()} is not supported for {OutputFormat}."); - } - - Unmanaged.SetColorspace(Handle, colorSpace.ToImageColorSpace()). - ThrowIfFailed("Failed to set the color space"); - } - - private Task Run(Stream outStream) - { - var tcs = new TaskCompletionSource(); - - IntPtr outBuffer = IntPtr.Zero; - Unmanaged.SetOutputBuffer(Handle, out outBuffer).ThrowIfFailed("Failed to initialize encoder"); - - Task.Run(() => - { - try - { - ulong size = 0; - Unmanaged.Run(Handle, out size).ThrowIfFailed("Failed to encode given image"); - - byte[] buf = new byte[size]; - Marshal.Copy(outBuffer, buf, 0, (int)size); - outStream.Write(buf, 0, (int)size); - - tcs.TrySetResult(true); - } - catch (Exception e) - { - tcs.TrySetException(e); - } - finally - { - Interop.Libc.Free(outBuffer); - } - }); - - return tcs.Task; - } - - internal Task EncodeAsync(Action settingInputAction, Stream outStream) - { - Debug.Assert(settingInputAction != null); - - if (outStream == null) - { - throw new ArgumentNullException(nameof(outStream)); - } - - if (outStream.CanWrite == false) - { - throw new ArgumentException("The stream is not writable.", nameof(outStream)); - } - - Initialize(); - - settingInputAction(Handle); - - return Run(outStream); - } - - /// - /// Encodes an image from a raw image buffer to a specified . - /// - /// The image buffer to encode. - /// The stream that the image is encoded to. - /// A task that represents the asynchronous encoding operation. - /// - /// is null.\n - /// - or -\n - /// is null. - /// - /// - /// is an empty array.\n - /// - or -\n - /// is not writable.\n - /// - /// The resolution is not set. - /// The has already been disposed of. - /// - public Task EncodeAsync(byte[] inputBuffer, Stream outStream) - { - if (inputBuffer == null) - { - throw new ArgumentNullException(nameof(inputBuffer)); - } - - if (inputBuffer.Length == 0) - { - throw new ArgumentException("buffer is empty.", nameof(inputBuffer)); - } - - return EncodeAsync(handle => - { - Unmanaged.SetInputBuffer(handle, inputBuffer). - ThrowIfFailed("Failed to configure encoder; InputBuffer"); - }, outStream); - } - - internal void Initialize() - { - Configure(Handle); - - if (_hasResolution == false) - { - throw new InvalidOperationException("Resolution is not set."); - } - } - - internal abstract void Configure(ImageEncoderHandle handle); - - #region IDisposable Support - private bool _disposed = false; - - /// - /// Releases the unmanaged resources used by the ImageEncoder. - /// - /// true to release both managed and unmanaged resources; false to release only unmanaged resources. - protected virtual void Dispose(bool disposing) - { - if (!_disposed) - { - if (_handle != null) - { - _handle.Dispose(); - } - _disposed = true; - } - } - - /// - /// Releases all resources used by the ImageEncoder. - /// - public void Dispose() - { - Dispose(true); - } - #endregion - } - - /// - /// Provides the ability to encode the Bitmap (BMP) format images. - /// - public class BmpEncoder : ImageEncoder - { - /// - /// Initializes a new instance of the class. - /// - /// will be the . - public BmpEncoder() : base(ImageFormat.Bmp) - { - } - - internal override void Configure(ImageEncoderHandle handle) - { - } - } - - /// - /// Provides the ability to encode the Portable Network Graphics (PNG) format images. - /// - public class PngEncoder : ImageEncoder - { - /// - /// A read-only field that represents the default value of . - /// - public static readonly PngCompression DefaultCompression = PngCompression.Level6; - - private PngCompression? _compression; - - /// - /// Initializes a new instance of the class. - /// - /// will be the . - public PngEncoder() : - base(ImageFormat.Png) - { - } - - /// - /// Initializes a new instance of the class with . - /// - /// will be the . - /// The compression level of the encoder. - /// is invalid. - public PngEncoder(PngCompression compression) : - base(ImageFormat.Png) - { - Compression = compression; - } - - /// - /// Gets or sets the compression level of the png image. - /// - /// The compression level. The default is . - /// is invalid. - public PngCompression Compression - { - get { return _compression ?? DefaultCompression; } - set - { - ValidationUtil.ValidateEnum(typeof(PngCompression), value, nameof(Compression)); - - _compression = value; - } - } - - internal override void Configure(ImageEncoderHandle handle) - { - if (_compression.HasValue) - { - Unmanaged.SetPngCompression(handle, _compression.Value). - ThrowIfFailed("Failed to configure encoder; PngCompression"); - } - } - } - - /// - /// Provides the ability to encode the Joint Photographic Experts Group (JPEG) format images. - /// - public class JpegEncoder : ImageEncoder - { - /// - /// A read-only field that represents the default value of . - /// - public static readonly int DefaultQuality = 75; - - private int? _quality; - - /// - /// Initializes a new instance of the class. - /// - /// will be the . - public JpegEncoder() : base(ImageFormat.Jpeg) - { - } - - - /// - /// Initializes a new instance of the class with initial quality value. - /// - /// The quality for JPEG image encoding; from 1(lowest quality) to 100(highest quality). - /// will be the . - /// - /// is less than or equal to 0.\n - /// - or -\n - /// is greater than 100. - /// - public JpegEncoder(int quality) : - base(ImageFormat.Jpeg) - { - Quality = quality; - } - - /// - /// Gets or sets the quality of the encoded image. - /// - /// - /// The quality of the output image. The default is 75.\n - /// Valid value is from 1(lowest quality) to 100(highest quality). - /// - /// - /// is less than or equal to 0.\n - /// - or -\n - /// is greater than 100. - /// - public int Quality - { - get { return _quality ?? DefaultQuality; } - set - { - if (value <= 0 || value > 100) - { - throw new ArgumentOutOfRangeException(nameof(Quality), value, - "Valid range is from 1 to 100, inclusive."); - } - _quality = value; - } - } - - internal override void Configure(ImageEncoderHandle handle) - { - if (_quality.HasValue) - { - Unmanaged.SetQuality(handle, _quality.Value). - ThrowIfFailed("Failed to configure encoder; Quality"); - } - } - } - - /// - /// Provides the ability to encode the Graphics Interchange Format (GIF) format images. - /// - public class GifEncoder : ImageEncoder - { - /// - /// Initializes a new instance of the class. - /// - /// will be the . - public GifEncoder() : base(ImageFormat.Gif) - { - } - - internal override void Configure(ImageEncoderHandle handle) - { - } - - /// - /// Encodes a Graphics Interchange Format (GIF) image from multiple raw image buffers to a specified . - /// - /// The image frames to encode. - /// The stream that the image is encoded to. - /// A task that represents the asynchronous encoding operation. - /// - /// is null.\n - /// - or -\n - /// is null. - /// - /// - /// has no element(empty).\n - /// - or -\n - /// is not writable.\n - /// - /// The resolution is not set. - /// The has already been disposed of. - /// - public Task EncodeAsync(IEnumerable frames, Stream outStream) - { - if (frames == null) - { - throw new ArgumentNullException(nameof(frames)); - } - - if (frames.Count() == 0) - { - throw new ArgumentException("frames is a empty collection", nameof(frames)); - } - - return EncodeAsync(handle => - { - foreach (GifFrame frame in frames) - { - if (frame == null) - { - throw new ArgumentNullException(nameof(frames)); - } - Unmanaged.SetInputBuffer(handle, frame.Buffer). - ThrowIfFailed("Failed to configure encoder; Buffer"); - - Unmanaged.SetGifFrameDelayTime(handle, (ulong)frame.Delay). - ThrowIfFailed("Failed to configure encoder; Delay"); - } - }, outStream); - } - } - -} diff --git a/src/Tizen.Multimedia.Util/ImageUtil/ImageFormat.cs b/src/Tizen.Multimedia.Util/ImageUtil/ImageFormat.cs deleted file mode 100644 index b600b8295..000000000 --- a/src/Tizen.Multimedia.Util/ImageUtil/ImageFormat.cs +++ /dev/null @@ -1,41 +0,0 @@ -/* - * 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. - */ - -namespace Tizen.Multimedia.Util -{ - /// - /// Specifies image formats for , and . - /// - public enum ImageFormat - { - /// - /// The Joint Photographic Experts Group format. - /// - Jpeg, - /// - /// The Portable Network Graphics format. - /// - Png, - /// - /// The Graphics Interchange Format. - /// - Gif, - /// - /// The Bitmap format. - /// - Bmp, - } -} diff --git a/src/Tizen.Multimedia.Util/ImageUtil/ImageRotation.cs b/src/Tizen.Multimedia.Util/ImageUtil/ImageRotation.cs deleted file mode 100644 index 7750c88a5..000000000 --- a/src/Tizen.Multimedia.Util/ImageUtil/ImageRotation.cs +++ /dev/null @@ -1,50 +0,0 @@ -/* - * 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. - */ - -namespace Tizen.Multimedia.Util -{ - /// - /// Specifies how an image is rotated or flipped. - /// - /// - internal enum ImageRotation - { - /// - /// No rotation. - /// - Rotate0, - /// - /// Rotate 90 degree clockwise. - /// - Rotate90, - /// - /// Rotate 180 degree clockwise. - /// - Rotate180, - /// - /// Rotate 270 degree clockwise. - /// - Rotate270, - /// - /// Flip horizontally. - /// - FlipHorizontal, - /// - /// Flip vertically. - /// - FlipVertical, - } -} diff --git a/src/Tizen.Multimedia.Util/ImageUtil/ImageTransform.cs b/src/Tizen.Multimedia.Util/ImageUtil/ImageTransform.cs deleted file mode 100644 index e3d8d14d8..000000000 --- a/src/Tizen.Multimedia.Util/ImageUtil/ImageTransform.cs +++ /dev/null @@ -1,596 +0,0 @@ -/* - * 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.Collections; -using System.Collections.Generic; -using System.Diagnostics; -using System.Runtime.InteropServices; -using System.Threading.Tasks; -using static Interop.ImageUtil; -using static Interop.ImageUtil.Transform; - -namespace Tizen.Multimedia.Util -{ - /// - /// A base class for image transformations. - /// - public abstract class ImageTransform - { - internal ImageTransform() - { - } - - internal async Task RunAsync(TransformHandle handle, MediaPacket source) - { - var tcs = new TaskCompletionSource(); - - TransformCompletedCallback cb = (nativehandle, errorCode, _) => - { - if (errorCode == ImageUtilError.None) - { - try - { - tcs.TrySetResult(MediaPacket.From(Marshal.PtrToStructure(nativehandle))); - } - catch (Exception e) - { - tcs.TrySetException(e); - } - } - else - { - tcs.TrySetException(errorCode.ToException("Image transformation failed")); - } - }; - - using (var cbKeeper = ObjectKeeper.Get(cb)) - { - Run(handle, source.GetHandle(), cb).ThrowIfFailed("Failed to transform given packet with " + GetType()); - - return await tcs.Task; - } - } - - internal static TransformHandle CreateHandle() - { - Create(out var handle).ThrowIfFailed("Failed to run ImageTransformer"); - Debug.Assert(handle != null); - return handle; - } - - internal abstract void Configure(TransformHandle handle); - - internal virtual Task ApplyAsync(MediaPacket source) - { - using (TransformHandle handle = CreateHandle()) - { - Configure(handle); - - return RunAsync(handle, source); - } - } - } - - /// - /// Represents a collection of objects that can be individually accessed by index. - /// - public class ImageTransformCollection : IEnumerable, IList - { - private List _list = new List(); - - /// - /// Initializes a new instance of the ImageTransformCollection class. - /// - public ImageTransformCollection() - { - } - - /// - /// Gets or sets the at the specified index. - /// - /// The zero-based index of the to get or set. - /// The at the specified index. - /// - /// index is less than 0.\n - /// - or -\n - /// index is equal to or greater than Count. - /// - public ImageTransform this[int index] - { - get { return _list[index]; } - set { _list[index] = value; } - } - - /// - /// Gets the number of items contained in the TransformCollection. - /// - public int Count => _list.Count; - - bool ICollection.IsReadOnly => false; - - /// - /// Adds a to the end of the collection. - /// - /// The to add. - /// - /// accepts null as a valid value for reference types and allows duplicate elements. - /// - public void Add(ImageTransform item) - { - if (item == null) - { - throw new ArgumentNullException(nameof(item)); - } - _list.Add(item); - } - - /// - /// Removes all items. - /// - public void Clear() => _list.Clear(); - - /// - /// Determines whether the contains the specified item. - /// - /// The to locate in the collection. - /// true if the is found in the collection; otherwise, false. - public bool Contains(ImageTransform item) => _list.Contains(item); - - /// - /// Copies the items of the collection to an array, starting at the specified array index. - /// - /// The one-dimensional array that is the destination of the items copied from the collection. - /// The zero-based index in array at which copying begins. - /// is null. - /// is less than 0. - /// - /// The number of elements in the source collection is greater than the available space from arrayIndex to the end of the destination array. - /// - public void CopyTo(ImageTransform[] array, int arrayIndex) => _list.CopyTo(array, arrayIndex); - - /// - /// Determines the index of the specified item in the collection. - /// - /// The to locate in the collection. - /// The index of value if found in the ; otherwise, -1. - public int IndexOf(ImageTransform item) => _list.IndexOf(item); - - /// - /// Inserts a into the collection at the specified index. - /// - /// The zero-based index at which should be inserted. - /// The to insert into the collection. - /// is null. - /// - /// index is less than 0.\n - /// -or-\n - /// index is greater than . - /// - public void Insert(int index, ImageTransform item) - { - if (item == null) - { - throw new ArgumentNullException(nameof(item)); - } - _list.Insert(index, item); - } - - /// - /// Removes the first occurrence of the specified from the collection. - /// - /// The to remove. - /// true if was removed from the collection; otherwise, false. - public bool Remove(ImageTransform item) => _list.Remove(item); - - /// - /// Removes the at the specified index. - /// - /// The zero-based index to remove. - /// - /// index is less than 0.\n - /// - or -\n - /// index is equal to or greater than . - /// - public void RemoveAt(int index) => _list.RemoveAt(index); - - /// - /// Returns an enumerator that can iterate through the collection. - /// - /// An enumerator that can be used to iterate through the collection. - public IEnumerator GetEnumerator() => _list.GetEnumerator(); - - IEnumerator IEnumerable.GetEnumerator() => _list.GetEnumerator(); - } - - // TODO need to improve performance - /// - /// Represents a that is a composite of the transforms. - /// - public class ImageTransformGroup : ImageTransform - { - /// - /// Gets or sets the . - /// - public ImageTransformCollection Children { get; set; } - - /// - /// Initializes a new instance of the ImageTransformGroup class. - /// - public ImageTransformGroup() - { - Children = new ImageTransformCollection(); - } - - internal override void Configure(TransformHandle handle) - { - // intended blank - } - - internal override async Task ApplyAsync(MediaPacket source) - { - if (Children.Count == 0) - { - return source; - } - - var items = Children; - - MediaPacket curPacket = await items[0].ApplyAsync(source); - - for (int i = 1; i < items.Count; ++i) - { - var oldPacket = curPacket; - try - { - curPacket = await items[i].ApplyAsync(curPacket); - } - finally - { - oldPacket.Dispose(); - } - } - - return curPacket; - } - } - - /// - /// Rotates an image. - /// - /// - public class RotateTransform : ImageTransform - { - private Rotation _rotation; - - /// - /// Initializes a new instance of the class. - /// - /// The value how to rotate an image. - /// is invalid. - /// is . - public RotateTransform(Rotation rotation) - { - Rotation = rotation; - - } - - /// - /// Gets or sets the value how to rotate an image. - /// - /// is invalid. - /// is . - public Rotation Rotation - { - get { return _rotation; } - set - { - ValidationUtil.ValidateEnum(typeof(Rotation), value, nameof(Rotation)); - - if (value == Rotation.Rotate0) - { - throw new ArgumentOutOfRangeException(nameof(value), "Rotation can't be Rotate0."); - } - - _rotation = value; - } - } - - internal override void Configure(TransformHandle handle) - { - SetRotation(handle, GetImageRotation()); - } - - private ImageRotation GetImageRotation() - { - switch (Rotation) - { - case Rotation.Rotate90: return ImageRotation.Rotate90; - case Rotation.Rotate180: return ImageRotation.Rotate180; - case Rotation.Rotate270: return ImageRotation.Rotate270; - } - - Debug.Fail("Rotation is invalid value!"); - return ImageRotation.Rotate0; - } - } - - - /// - /// Flips an image. - /// - /// - public class FlipTransform : ImageTransform - { - private Flips _flip; - - /// - /// Initializes a new instance of the class. - /// - /// The value how to flip an image. - /// is invalid. - /// is . - public FlipTransform(Flips flip) - { - Flip = flip; - } - - /// - /// Gets or sets the value how to rotate an image. - /// - /// is invalid. - /// is . - public Flips Flip - { - get { return _flip; } - set - { - ValidationUtil.ValidateFlagsEnum(value, Flips.Horizontal | Flips.Vertical, nameof(Flips)); - - if (value == Flips.None) - { - throw new ArgumentOutOfRangeException(nameof(value), "Flip can't be None."); - } - - _flip = value; - } - } - - internal override void Configure(TransformHandle handle) - { - // intended blank - } - - private async Task ApplyAsync(TransformHandle handle, MediaPacket source, - ImageRotation rotation) - { - SetRotation(handle, rotation); - return await RunAsync(handle, source); - } - - internal override async Task ApplyAsync(MediaPacket source) - { - using (TransformHandle handle = CreateHandle()) - { - if (Flip.HasFlag(Flips.Vertical | Flips.Horizontal)) - { - var flipped = await ApplyAsync(handle, source, ImageRotation.FlipHorizontal); - try - { - return await ApplyAsync(handle, flipped, ImageRotation.FlipVertical); - } - finally - { - flipped.Dispose(); - } - } - - return await ApplyAsync(handle, source, Flip.HasFlag(Flips.Horizontal) ? - ImageRotation.FlipHorizontal : ImageRotation.FlipVertical); - } - } - } - - /// - /// Changes the colorspace of an image. - /// - /// - public class ColorSpaceTransform : ImageTransform - { - private ImageColorSpace _imageColorSpace; - - /// - /// Initializes a new instance of the class. - /// - /// The colorspace of output image. - /// is invalid. - /// is not supported. - /// - public ColorSpaceTransform(ColorSpace colorSpace) - { - ColorSpace = colorSpace; - } - - /// - /// Gets or sets the colorspace of the result image. - /// - /// is invalid. - /// is not supported. - /// - public ColorSpace ColorSpace - { - get { return _imageColorSpace.ToCommonColorSpace(); } - set - { - ValidationUtil.ValidateEnum(typeof(ColorSpace), value, nameof(ColorSpace)); - - _imageColorSpace = value.ToImageColorSpace(); - } - } - - internal override void Configure(TransformHandle handle) - { - SetColorspace(handle, _imageColorSpace); - } - - /// - /// Gets the supported colorspaces for . - /// - public static IEnumerable SupportedColorSpaces - { - get - { - foreach (ImageColorSpace value in Enum.GetValues(typeof(ImageColorSpace))) - { - yield return value.ToCommonColorSpace(); - } - } - } - } - - /// - /// Crops an image. - /// - public class CropTransform : ImageTransform - { - private Rectangle _region; - - /// - /// Initializes a new instance of the class. - /// - /// The crop region. - /// - /// The X-position of is less than zero.\n - /// - or -\n - /// The Y-position of is less than zero.\n - /// - or -\n - /// The width of is less than or equal to zero.\n - /// - or -\n - /// The height of is less than or equal to zero. - /// - public CropTransform(Rectangle region) - { - Region = region; - } - - /// - /// Gets or sets the crop region. - /// - /// - /// The X-position of is less than zero.\n - /// - or -\n - /// The Y-position of is less than zero.\n - /// - or -\n - /// The width of is less than or equal to zero.\n - /// - or -\n - /// The height of is less than or equal to zero. - /// - public Rectangle Region - { - get { return _region; } - set - { - - if (value.X < 0) - { - throw new ArgumentOutOfRangeException(nameof(Region), value, - "X position of the region can't be less than zero."); - } - - if (value.Y < 0) - { - throw new ArgumentOutOfRangeException(nameof(Region), value, - "Y position of the region can't be less than zero."); - } - - if (value.Width <= 0) - { - throw new ArgumentOutOfRangeException(nameof(Region), value, - "Width of the region can't be less than or equal zero."); - } - - if (value.Height < 0) - { - throw new ArgumentOutOfRangeException(nameof(Region), value, - "Height of the region can't be less than or equal to zero."); - } - - _region = value; - } - } - - internal override void Configure(TransformHandle handle) - { - SetCropArea(handle, Region.Left, Region.Top, Region.Right, Region.Bottom); - } - } - - /// - /// Resizes an image. - /// - public class ResizeTransform : ImageTransform - { - private Size _size; - - /// - /// Initializes a new instance of the class. - /// - /// The size that an image is resized to. - /// - /// The width of is less than or equal to zero.\n - /// - or -\n - /// The height of is less than or equal to zero. - /// - public ResizeTransform(Size size) - { - Size = size; - } - - /// - /// Gets or sets the size that an image is resized to. - /// - /// - /// The width of is less than or equal to zero.\n - /// - or -\n - /// The height of is less than or equal to zero. - /// - public Size Size - { - get { return _size; } - set - { - if (value.Width <= 0) - { - throw new ArgumentOutOfRangeException(nameof(Size), value, - "Width of the size can't be less than or equal to zero."); - } - - if (value.Height <= 0) - { - throw new ArgumentOutOfRangeException(nameof(Size), value, - "Height of the size can't be less than or equal to zero."); - } - - _size = value; - } - } - - internal override void Configure(TransformHandle handle) - { - SetResolution(handle, (uint)Size.Width, (uint)Size.Height); - } - } -} diff --git a/src/Tizen.Multimedia.Util/ImageUtil/ImageTransformer.cs b/src/Tizen.Multimedia.Util/ImageUtil/ImageTransformer.cs deleted file mode 100644 index 53bfd3829..000000000 --- a/src/Tizen.Multimedia.Util/ImageUtil/ImageTransformer.cs +++ /dev/null @@ -1,91 +0,0 @@ -/* - * 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.Threading.Tasks; - -namespace Tizen.Multimedia.Util -{ - /// - /// Provides the ability to transform an image. - /// - public class ImageTransformer : IDisposable - { - /// - /// Initializes a new instance of the class. - /// - public ImageTransformer() - { - } - - /// - /// Transforms an image with . - /// - /// to transform. The of this must be . - /// to apply. - /// A task that represents the asynchronous transforming operation. - /// - /// is null.\n - /// - or -\n - /// is null. - /// - /// The has already been disposed of. - /// Failed to apply . - public Task TransformAsync(MediaPacket source, ImageTransform item) - { - if (_disposed) - { - throw new ObjectDisposedException(nameof(ImageTransformer)); - } - - if (source == null) - { - throw new ArgumentNullException(nameof(source)); - } - - if (item == null) - { - throw new ArgumentNullException(nameof(item)); - } - - return item.ApplyAsync(source); - } - - #region IDisposable Support - private bool _disposed = false; - - /// - /// Releases the unmanaged resources used by the ImageTransformer. - /// - /// true to release both managed and unmanaged resources; false to release only unmanaged resources. - protected virtual void Dispose(bool disposing) - { - if (!_disposed) - { - _disposed = true; - } - } - - /// - /// Releases all resources used by the ImageTransformer. - /// - public void Dispose() - { - Dispose(true); - } - #endregion - } -} diff --git a/src/Tizen.Multimedia.Util/ImageUtil/ImageUtil.cs b/src/Tizen.Multimedia.Util/ImageUtil/ImageUtil.cs deleted file mode 100644 index 215f53f3e..000000000 --- a/src/Tizen.Multimedia.Util/ImageUtil/ImageUtil.cs +++ /dev/null @@ -1,129 +0,0 @@ -/* - * 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.Collections.Generic; -using Tizen.Common; -using static Interop.ImageUtil; - -namespace Tizen.Multimedia.Util -{ - /// - /// Provides utilities for images. - /// - public static class ImageUtil - { - /// - /// Retrieves supported colorspaces for a that represents formats for and . - /// - /// An IEnumerable of representing the supported color-spaces. - /// The . - /// is invalid. - public static IEnumerable GetSupportedColorSpaces(ImageFormat format) - { - ValidationUtil.ValidateEnum(typeof(ImageFormat), format, nameof(format)); - - var colorspaces = new List(); - - ForeachSupportedColorspace(format, - (colorspace, _) => { colorspaces.Add(colorspace.ToCommonColorSpace()); return true; }). - ThrowIfFailed("Failed to get supported color-space list from native handle"); - - return colorspaces; - } - - /// - /// Calculates the size of the image buffer for the specified resolution and color-space. - /// - /// The resolution of the image. - /// of the image. - /// The buffer size. - /// - /// width of is less than or equal to zero.\n - /// - or -\n - /// height of is less than or equal to zero. - /// - /// is invalid. - public static int CalculateBufferSize(Size resolution, ColorSpace colorSpace) - { - if (resolution.Width <= 0) - { - throw new ArgumentOutOfRangeException(nameof(resolution), resolution.Width, - "width can't be less than or equal to zero."); - } - if (resolution.Height <= 0) - { - throw new ArgumentOutOfRangeException(nameof(resolution), resolution.Height, - "height can't be less than or equal to zero."); - } - - ValidationUtil.ValidateEnum(typeof(ColorSpace), colorSpace, nameof(colorSpace)); - - uint bufferSize; - global::Interop.ImageUtil.CalculateBufferSize(resolution.Width, resolution.Height, - colorSpace.ToImageColorSpace(), out bufferSize) - .ThrowIfFailed("Failed to calculate buffer size for given parameter"); - - return (int)bufferSize; - } - - /// - /// Extracts representative color from an image buffer. - /// - /// Raw image buffer. - /// Resolution of the image. - /// The image should be . - /// The representative color of the image. - /// - /// is null. - /// is empty. - /// - /// width of is less than or equal to zero.\n - /// - or -\n - /// height of is less than or equal to zero. - /// - public static Color GetColor(byte[] buffer, Size size) - { - if (buffer == null) - { - throw new ArgumentNullException(nameof(buffer)); - } - - if (buffer.Length == 0) - { - throw new ArgumentException("buffer is empty.", nameof(buffer)); - } - - if (size.Width <= 0) - { - throw new ArgumentOutOfRangeException(nameof(size), size.Width, - "width can't be less than or equal to zero."); - } - if (size.Height <= 0) - { - throw new ArgumentOutOfRangeException(nameof(size), size.Height, - "height can't be less than or equal to zero."); - } - - - byte r, g, b; - ExtractColorFromMemory(buffer, size.Width, size.Height, out r, out g, out b) - .ThrowIfFailed("Failed to extract color from buffer"); - - return Color.FromRgb(r, g, b); - } - } -} diff --git a/src/Tizen.Multimedia.Util/ImageUtil/ImageUtilError.cs b/src/Tizen.Multimedia.Util/ImageUtil/ImageUtilError.cs deleted file mode 100644 index efeec4b69..000000000 --- a/src/Tizen.Multimedia.Util/ImageUtil/ImageUtilError.cs +++ /dev/null @@ -1,81 +0,0 @@ -/* - * 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.Diagnostics; -using System.IO; -using Tizen.Internals.Errors; - -namespace Tizen.Multimedia.Util -{ - - internal enum ImageUtilError - { - None = ErrorCode.None, - OutOfMemory = ErrorCode.OutOfMemory, - InvalidParameter = ErrorCode.InvalidParameter, - InvalidOperation = ErrorCode.InvalidOperation, - PermissionDenied = ErrorCode.PermissionDenied, - NotSupported = ErrorCode.NotSupported, - NoSuchFile = ErrorCode.NoSuchFile, - NotSupportedFormat = -0x01920000 | 0x01, - } - - internal static class ImageUtilErrorExtensions - { - internal static void ThrowIfFailed(this ImageUtilError err, string message) - { - if (err == ImageUtilError.None) - { - return; - } - - throw err.ToException(message); - } - - internal static Exception ToException(this ImageUtilError err, string message) - { - Debug.Assert(err != ImageUtilError.None); - - string errMessage = $"{message}; {err}."; - switch (err) - { - case ImageUtilError.PermissionDenied: - return new UnauthorizedAccessException(errMessage); - - case ImageUtilError.InvalidParameter: - return new ArgumentException(errMessage); - - case ImageUtilError.NoSuchFile: - return new FileNotFoundException(errMessage); - - case ImageUtilError.OutOfMemory: - return new OutOfMemoryException(errMessage); - - case ImageUtilError.NotSupported: - return new NotSupportedException(errMessage); - - case ImageUtilError.NotSupportedFormat: - return new FileFormatException(errMessage); - - case ImageUtilError.InvalidOperation: - default: - return new InvalidOperationException(errMessage); - } - } - } - -} diff --git a/src/Tizen.Multimedia.Util/ImageUtil/JpegDownscale.cs b/src/Tizen.Multimedia.Util/ImageUtil/JpegDownscale.cs deleted file mode 100644 index de4a94abf..000000000 --- a/src/Tizen.Multimedia.Util/ImageUtil/JpegDownscale.cs +++ /dev/null @@ -1,41 +0,0 @@ -/* - * 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. - */ - -namespace Tizen.Multimedia.Util -{ - /// - /// Specifies the JPEG Downscale options for decoding. - /// - public enum JpegDownscale - { - /// - /// No downscale. - /// - None, - /// - /// 1/2 downscale. - /// - OneHalf, - /// - /// 1/4 downscale. - /// - OneFourth, - /// - /// 1/8 downscale. - /// - OneEighth, - } -} diff --git a/src/Tizen.Multimedia.Util/ImageUtil/PngCompression.cs b/src/Tizen.Multimedia.Util/ImageUtil/PngCompression.cs deleted file mode 100644 index 8398cfa8e..000000000 --- a/src/Tizen.Multimedia.Util/ImageUtil/PngCompression.cs +++ /dev/null @@ -1,65 +0,0 @@ -/* - * 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. - */ - -namespace Tizen.Multimedia.Util -{ - /// - /// Specifies the PNG compression levels. - /// - public enum PngCompression - { - /// - /// No Compression. - /// - None, - /// - /// Compression Level 1. Best speed. - /// - Level1, - /// - /// Compression Level 2. - /// - Level2, - /// - /// Compression Level 3. - /// - Level3, - /// - /// Compression Level 4. - /// - Level4, - /// - /// Compression Level 5. - /// - Level5, - /// - /// Compression Level 6. - /// - Level6, - /// - /// Compression Level 7. - /// - Level7, - /// - /// Compression Level 8. - /// - Level8, - /// - /// Compression Level 9. - /// - Level9, - } -} diff --git a/src/Tizen.Multimedia.Util/Interop/Interop.ImageUtil.Decode.cs b/src/Tizen.Multimedia.Util/Interop/Interop.ImageUtil.Decode.cs deleted file mode 100644 index f7636c679..000000000 --- a/src/Tizen.Multimedia.Util/Interop/Interop.ImageUtil.Decode.cs +++ /dev/null @@ -1,80 +0,0 @@ -/* - * 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; -using Tizen; -using Tizen.Multimedia.Util; - -internal static partial class Interop -{ - internal static class Decode - { - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void DecodeCompletedCallback(ImageUtilError error, IntPtr userData, int width, int height, ulong size); - - [DllImport(Libraries.ImageUtil, EntryPoint = "image_util_decode_create")] - public static extern ImageUtilError Create(out ImageDecoderHandle handle); - - [DllImport(Libraries.ImageUtil, EntryPoint = "image_util_decode_destroy")] - internal static extern ImageUtilError Destroy(IntPtr handle); - - [DllImport(Libraries.ImageUtil, EntryPoint = "image_util_decode_set_input_path")] - internal static extern ImageUtilError SetInputPath(ImageDecoderHandle handle, IntPtr path); - - [DllImport(Libraries.ImageUtil, EntryPoint = "image_util_decode_set_input_buffer")] - internal static extern ImageUtilError SetInputBuffer(ImageDecoderHandle handle, byte[] srcBuffer, ulong srcSize); - - [DllImport(Libraries.ImageUtil, EntryPoint = "image_util_decode_set_output_buffer")] - internal static extern ImageUtilError SetOutputBuffer(ImageDecoderHandle handle, out IntPtr dstBuffer); - - [DllImport(Libraries.ImageUtil, EntryPoint = "image_util_decode_set_colorspace")] - internal static extern ImageUtilError SetColorspace(ImageDecoderHandle handle, ImageColorSpace colorspace); - - [DllImport(Libraries.ImageUtil, EntryPoint = "image_util_decode_set_jpeg_downscale")] - internal static extern ImageUtilError SetJpegDownscale(ImageDecoderHandle handle, JpegDownscale downscale); - - [DllImport(Libraries.ImageUtil, EntryPoint = "image_util_decode_run_async")] - internal static extern ImageUtilError DecodeRunAsync(ImageDecoderHandle handle, DecodeCompletedCallback callback, - IntPtr userData = default(IntPtr)); - - [DllImport(Libraries.ImageUtil, EntryPoint = "image_util_decode_run")] - internal static extern ImageUtilError DecodeRun(ImageDecoderHandle handle, out int width, - out int height, out ulong size); - } - - internal class ImageDecoderHandle : SafeHandle - { - protected ImageDecoderHandle() : base(IntPtr.Zero, true) - { - } - - public override bool IsInvalid => handle == IntPtr.Zero; - - protected override bool ReleaseHandle() - { - var ret = Decode.Destroy(handle); - if (ret != ImageUtilError.None) - { - Log.Debug(GetType().FullName, $"Failed to release native {GetType()}"); - return false; - } - - return true; - } - - } -} diff --git a/src/Tizen.Multimedia.Util/Interop/Interop.ImageUtil.Encode.cs b/src/Tizen.Multimedia.Util/Interop/Interop.ImageUtil.Encode.cs deleted file mode 100644 index ada1c392e..000000000 --- a/src/Tizen.Multimedia.Util/Interop/Interop.ImageUtil.Encode.cs +++ /dev/null @@ -1,91 +0,0 @@ -/* - * 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; -using Tizen; -using Tizen.Multimedia.Util; - -internal static partial class Interop -{ - internal static partial class ImageUtil - { - internal static class Encode - { - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void EncodeCompletedCallback(ImageUtilError ImageUtilError, IntPtr userData, ulong size); - - [DllImport(Libraries.ImageUtil, EntryPoint = "image_util_encode_run_async")] - internal static extern ImageUtilError EncodeRunAsync(ImageEncoderHandle handle, - EncodeCompletedCallback callback, IntPtr userData = default(IntPtr)); - - [DllImport(Libraries.ImageUtil, EntryPoint = "image_util_encode_create")] - internal static extern ImageUtilError Create(ImageFormat type, out ImageEncoderHandle handle); - - [DllImport(Libraries.ImageUtil, EntryPoint = "image_util_encode_destroy")] - internal static extern ImageUtilError Destroy(IntPtr handle); - - [DllImport(Libraries.ImageUtil, EntryPoint = "image_util_encode_set_resolution")] - internal static extern ImageUtilError SetResolution(ImageEncoderHandle handle, uint width, uint height); - - [DllImport(Libraries.ImageUtil, EntryPoint = "image_util_encode_set_colorspace")] - internal static extern ImageUtilError SetColorspace(ImageEncoderHandle handle, ImageColorSpace colorspace); - - [DllImport(Libraries.ImageUtil, EntryPoint = "image_util_encode_set_quality")] - internal static extern ImageUtilError SetQuality(ImageEncoderHandle handle, int quality); - - [DllImport(Libraries.ImageUtil, EntryPoint = "image_util_encode_set_png_compression")] - internal static extern ImageUtilError SetPngCompression(ImageEncoderHandle handle, PngCompression compression); - - [DllImport(Libraries.ImageUtil, EntryPoint = "image_util_encode_set_gif_frame_delay_time")] - internal static extern ImageUtilError SetGifFrameDelayTime(ImageEncoderHandle handle, ulong delayTime); - - [DllImport(Libraries.ImageUtil, EntryPoint = "image_util_encode_set_output_path")] - internal static extern ImageUtilError SetOutputPath(ImageEncoderHandle handle, string path); - - [DllImport(Libraries.ImageUtil, EntryPoint = "image_util_encode_set_input_buffer")] - internal static extern ImageUtilError SetInputBuffer(ImageEncoderHandle handle, byte[] srcBuffer); - - [DllImport(Libraries.ImageUtil, EntryPoint = "image_util_encode_set_output_buffer")] - internal static extern ImageUtilError SetOutputBuffer(ImageEncoderHandle handle, out IntPtr dstBuffer); - - [DllImport(Libraries.ImageUtil, EntryPoint = "image_util_encode_run")] - internal static extern ImageUtilError Run(ImageEncoderHandle handle, out ulong size); - } - - internal class ImageEncoderHandle : SafeHandle - { - protected ImageEncoderHandle() : base(IntPtr.Zero, true) - { - } - - public override bool IsInvalid => handle == IntPtr.Zero; - - - protected override bool ReleaseHandle() - { - var ret = Encode.Destroy(handle); - if (ret != ImageUtilError.None) - { - Log.Debug(GetType().FullName, $"Failed to release native {GetType().Name}"); - return false; - } - - return true; - } - } - } -} diff --git a/src/Tizen.Multimedia.Util/Interop/Interop.ImageUtil.Transform.cs b/src/Tizen.Multimedia.Util/Interop/Interop.ImageUtil.Transform.cs deleted file mode 100644 index 056266d0f..000000000 --- a/src/Tizen.Multimedia.Util/Interop/Interop.ImageUtil.Transform.cs +++ /dev/null @@ -1,89 +0,0 @@ -/* - * 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; -using Tizen; -using Tizen.Multimedia.Util; - -internal static partial class Interop -{ - internal static partial class ImageUtil - { - internal static class Transform - { - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void TransformCompletedCallback(IntPtr resultPacket, ImageUtilError errorCode, - IntPtr userData = default(IntPtr)); - - [DllImport(Libraries.ImageUtil, EntryPoint = "image_util_transform_run")] - internal static extern ImageUtilError Run(TransformHandle handle, IntPtr srcPacket, - TransformCompletedCallback callback, IntPtr userData = default(IntPtr)); - - [DllImport(Libraries.ImageUtil, EntryPoint = "image_util_transform_create")] - internal static extern ImageUtilError Create(out TransformHandle handle); - - [DllImport(Libraries.ImageUtil, EntryPoint = "image_util_transform_destroy")] - internal static extern ImageUtilError Destroy(IntPtr handle); - - [DllImport(Libraries.ImageUtil, EntryPoint = "image_util_transform_get_colorspace")] - internal static extern ImageUtilError GetColorspace(TransformHandle handle, out ImageColorSpace colorspace); - - [DllImport(Libraries.ImageUtil, EntryPoint = "image_util_transform_set_colorspace")] - internal static extern ImageUtilError SetColorspace(TransformHandle handle, ImageColorSpace colorspace); - - [DllImport(Libraries.ImageUtil, EntryPoint = "image_util_transform_set_hardware_acceleration")] - internal static extern ImageUtilError SetHardwareAcceleration(TransformHandle handle, bool mode); - - [DllImport(Libraries.ImageUtil, EntryPoint = "image_util_transform_set_rotation")] - internal static extern ImageUtilError SetRotation(TransformHandle handle, ImageRotation rotation); - - [DllImport(Libraries.ImageUtil, EntryPoint = "image_util_transform_get_crop_area")] - internal static extern ImageUtilError GetCropArea(TransformHandle handle, out uint startX, out uint startY, out uint endX, out uint endY); - - [DllImport(Libraries.ImageUtil, EntryPoint = "image_util_transform_set_crop_area")] - internal static extern ImageUtilError SetCropArea(TransformHandle handle, int startX, int startY, int endX, int endY); - - [DllImport(Libraries.ImageUtil, EntryPoint = "image_util_transform_get_resolution")] - internal static extern ImageUtilError GetResolution(TransformHandle handle, out uint width, out uint height); - - [DllImport(Libraries.ImageUtil, EntryPoint = "image_util_transform_set_resolution")] - internal static extern ImageUtilError SetResolution(TransformHandle handle, uint width, uint height); - } - - internal class TransformHandle : SafeHandle - { - protected TransformHandle() : base(IntPtr.Zero, true) - { - } - - public override bool IsInvalid => handle == IntPtr.Zero; - - protected override bool ReleaseHandle() - { - var ret = Transform.Destroy(handle); - if (ret != ImageUtilError.None) - { - Log.Debug(GetType().FullName, $"Failed to release native {GetType().Name}"); - return false; - } - - return true; - } - } - } - -} diff --git a/src/Tizen.Multimedia.Util/Interop/Interop.ImageUtil.cs b/src/Tizen.Multimedia.Util/Interop/Interop.ImageUtil.cs deleted file mode 100644 index 728f4c0f9..000000000 --- a/src/Tizen.Multimedia.Util/Interop/Interop.ImageUtil.cs +++ /dev/null @@ -1,38 +0,0 @@ -/* - * 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; -using Tizen.Multimedia.Util; - -internal static partial class Interop -{ - internal static partial class ImageUtil - { - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool SupportedColorspaceCallback(ImageColorSpace colorspace, IntPtr userData); - - [DllImport(Libraries.ImageUtil, EntryPoint = "image_util_foreach_supported_colorspace")] - internal static extern ImageUtilError ForeachSupportedColorspace(ImageFormat type, SupportedColorspaceCallback callback, - IntPtr userData = default(IntPtr)); - - [DllImport(Libraries.ImageUtil, EntryPoint = "image_util_calculate_buffer_size")] - internal static extern ImageUtilError CalculateBufferSize(int width, int height, ImageColorSpace colorspace, out uint size); - - [DllImport(Libraries.ImageUtil, EntryPoint = "image_util_extract_color_from_memory")] - internal static extern ImageUtilError ExtractColorFromMemory(byte[] buffer, int width, int height, out byte rgbR, out byte rgbG, out byte rgbB); - } -} diff --git a/src/Tizen.Multimedia.Util/Interop/Interop.Libraries.cs b/src/Tizen.Multimedia.Util/Interop/Interop.Libraries.cs deleted file mode 100644 index 3b5ae55c3..000000000 --- a/src/Tizen.Multimedia.Util/Interop/Interop.Libraries.cs +++ /dev/null @@ -1,24 +0,0 @@ -/* - * 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 ImageUtil = "libcapi-media-image-util.so.0"; - public const string ThumbnailExtractor = "libcapi-media-thumbnail-util.so"; - } -} diff --git a/src/Tizen.Multimedia.Util/Interop/Interop.ThumbnailExtractor.cs b/src/Tizen.Multimedia.Util/Interop/Interop.ThumbnailExtractor.cs deleted file mode 100644 index c1a02de2c..000000000 --- a/src/Tizen.Multimedia.Util/Interop/Interop.ThumbnailExtractor.cs +++ /dev/null @@ -1,72 +0,0 @@ -/* - * 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; -using Tizen; -using Tizen.Multimedia.Util; - -internal static partial class Interop -{ - internal static class ThumbnailExtractor - { - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - public delegate void ThumbnailExtractCallback(ThumbnailExtractorError error, string requestId, - int thumbWidth, int thumbHeight, IntPtr thumbData, int thumbSize, IntPtr userData); - - [DllImport(Libraries.ThumbnailExtractor, EntryPoint = "thumbnail_util_create")] - internal static extern ThumbnailExtractorError Create(out ThumbnailExtractorHandle handle); - - [DllImport(Libraries.ThumbnailExtractor, EntryPoint = "thumbnail_util_extract")] - internal static extern ThumbnailExtractorError Extract(ThumbnailExtractorHandle handle, - ThumbnailExtractCallback callback, IntPtr userData, out IntPtr requestId); - - [DllImport(Libraries.ThumbnailExtractor, EntryPoint = "thumbnail_util_set_path")] - internal static extern ThumbnailExtractorError SetPath(ThumbnailExtractorHandle handle, string path); - - [DllImport(Libraries.ThumbnailExtractor, EntryPoint = "thumbnail_util_set_size")] - internal static extern ThumbnailExtractorError SetSize(ThumbnailExtractorHandle handle, int width, int height); - - - [DllImport(Libraries.ThumbnailExtractor, EntryPoint = "thumbnail_util_cancel")] - internal static extern ThumbnailExtractorError Cancel(ThumbnailExtractorHandle handle, string requestId); - - [DllImport(Libraries.ThumbnailExtractor, EntryPoint = "thumbnail_util_destroy")] - internal static extern ThumbnailExtractorError Destroy(IntPtr handle); - } - - internal class ThumbnailExtractorHandle : CriticalHandle - { - protected ThumbnailExtractorHandle() : base(IntPtr.Zero) - { - } - - public override bool IsInvalid => handle == IntPtr.Zero; - - protected override bool ReleaseHandle() - { - var result = ThumbnailExtractor.Destroy(handle); - - if (result == ThumbnailExtractorError.None) - { - return true; - } - - Log.Error(GetType().Name, $"Failed to destroy handle : {result}"); - return false; - } - } -} diff --git a/src/Tizen.Multimedia.Util/ThumbnailExtractor/ThumbnailExtractionResult.cs b/src/Tizen.Multimedia.Util/ThumbnailExtractor/ThumbnailExtractionResult.cs deleted file mode 100755 index de0a1c4de..000000000 --- a/src/Tizen.Multimedia.Util/ThumbnailExtractor/ThumbnailExtractionResult.cs +++ /dev/null @@ -1,42 +0,0 @@ -/* - * 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. - */ - -namespace Tizen.Multimedia.Util -{ - /// - /// Represents the result of the thumbnail extraction. - /// - public class ThumbnailExtractionResult - { - internal ThumbnailExtractionResult(byte[] thumbnailData, int width, int height) - { - RawData = thumbnailData; - Size = new Size(width, height); - } - - /// - /// The thumbnail data. - /// - /// 3 - public byte[] RawData { get; } - - /// - /// The size of the thumbnail. - /// - /// 3 - public Size Size { get; } - } -} diff --git a/src/Tizen.Multimedia.Util/ThumbnailExtractor/ThumbnailExtractor.cs b/src/Tizen.Multimedia.Util/ThumbnailExtractor/ThumbnailExtractor.cs deleted file mode 100755 index c9ff0187b..000000000 --- a/src/Tizen.Multimedia.Util/ThumbnailExtractor/ThumbnailExtractor.cs +++ /dev/null @@ -1,240 +0,0 @@ -/* - * 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.IO; -using System.Runtime.InteropServices; -using System.Threading; -using System.Threading.Tasks; -using Handle = Interop.ThumbnailExtractorHandle; -using Native = Interop.ThumbnailExtractor; - -namespace Tizen.Multimedia.Util -{ - /// - /// Provides the ability to extract the thumbnail from media files. - /// - public static class ThumbnailExtractor - { - private static Handle CreateHandle() - { - Native.Create(out var handle).ThrowIfError("Failed to extract."); - - return handle; - } - - /// - /// Extracts the thumbnail for the given media with the specified path. - /// - /// 3 - /// A task that represents the asynchronous extracting operation. - /// The size of the thumbnail will be the default size (320x240). - /// The path of the media file to extract the thumbnail. - /// is null. - /// does not exist. - /// An internal error occurs. - /// The caller does not have required privilege for accessing the . - /// The specified file is not supported. - public static Task ExtractAsync(string path) - { - return RunExtractAsync(path, null, CancellationToken.None); - } - - /// - /// Extracts the thumbnail for the given media with the specified path. - /// - /// A task that represents the asynchronous extracting operation. - /// The size of the thumbnail will be the default size(320x240).\n - /// The path of the media file to extract the thumbnail. - /// The token to stop the operation. - /// is null. - /// does not exist. - /// An internal error occurs. - /// The caller does not have required privilege for accessing the . - /// The specified file is not supported. - public static Task ExtractAsync(string path, CancellationToken cancellationToken) - { - return RunExtractAsync(path, null, cancellationToken); - } - - /// - /// Extracts the thumbnail for the given media with the specified path and size. - /// - /// 3 - /// A task that represents the asynchronous extracting operation. - /// - /// If the width is not a multiple of 8, it can be changed by the inner process.\n - /// The width will be a multiple of 8 greater than the set value. - /// - /// The path of the media file to extract the thumbnail. - /// The size of the thumbnail. - /// is null. - /// does not exist. - /// An internal error occurs. - /// The caller does not have required privilege for accessing the . - /// - /// The width or the height of is less than or equal to zero. - /// - /// The specified file is not supported. - public static Task ExtractAsync(string path, Size size) - { - return RunExtractAsync(path, size, CancellationToken.None); - } - - /// - /// Extracts the thumbnail for the given media with the specified path and size. - /// - /// 3 - /// A task that represents the asynchronous extracting operation. - /// - /// If the width is not a multiple of 8, it can be changed by the inner process.\n - /// The width will be a multiple of 8 greater than the set value. - /// - /// The path of the media file to extract the thumbnail. - /// The size of the thumbnail. - /// The token to stop the operation. - /// is null. - /// does not exist. - /// An internal error occurs. - /// The caller does not have required privilege for accessing the . - /// - /// The width or the height of is less than or equal to zero. - /// - /// The specified file is not supported. - public static Task ExtractAsync(string path, Size size, - CancellationToken cancellationToken) - { - return RunExtractAsync(path, size, cancellationToken); - } - - private static Task RunExtractAsync(string path, Size? size, - CancellationToken cancellationToken) - { - if (path == null) - { - throw new ArgumentNullException(nameof(path)); - } - - if (File.Exists(path) == false) - { - throw new FileNotFoundException("File does not exists.", path); - } - - if (size.HasValue) - { - if (size.Value.Width <= 0) - { - throw new ArgumentOutOfRangeException(nameof(size), size.Value.Width, - "The width must be greater than zero."); - } - - if (size.Value.Height <= 0) - { - throw new ArgumentOutOfRangeException(nameof(size), size.Value.Height, - "The height must be greater than zero."); - } - } - - return cancellationToken.IsCancellationRequested ? - Task.FromCanceled(cancellationToken) : - ExtractAsyncCore(path, size, cancellationToken); - } - - - private static async Task ExtractAsyncCore(string path, Size? size, - CancellationToken cancellationToken) - { - using (var handle = CreateHandle()) - { - Native.SetPath(handle, path).ThrowIfError("Failed to extract; failed to set the path."); - - if (size.HasValue) - { - Native.SetSize(handle, size.Value.Width, size.Value.Height). - ThrowIfError("Failed to extract; failed to set the size"); - } - - var tcs = new TaskCompletionSource(); - - IntPtr id = IntPtr.Zero; - - try - { - Native.Extract(handle, GetCallback(tcs), IntPtr.Zero, out id) - .ThrowIfError("Failed to extract."); - - using (RegisterCancellationToken(tcs, cancellationToken, handle, Marshal.PtrToStringAnsi(id))) - { - return await tcs.Task; - } - } - finally - { - LibcSupport.Free(id); - } - } - } - - private static Native.ThumbnailExtractCallback GetCallback(TaskCompletionSource tcs) - { - return (error, requestId, thumbWidth, thumbHeight, thumbData, dataSize, _) => - { - if (error == ThumbnailExtractorError.None) - { - try - { - byte[] tmpBuf = new byte[dataSize]; - Marshal.Copy(thumbData, tmpBuf, 0, dataSize); - - tcs.SetResult(new ThumbnailExtractionResult(tmpBuf, thumbWidth, thumbHeight)); - } - catch (Exception e) - { - tcs.SetException(new InvalidOperationException("[" + error + "] Failed to copy data.", e)); - } - finally - { - LibcSupport.Free(thumbData); - } - } - else - { - tcs.SetException(error.ToException("Failed to extract.")); - } - }; - } - - private static IDisposable RegisterCancellationToken(TaskCompletionSource tcs, - CancellationToken cancellationToken, Handle handle, string id) - { - if (cancellationToken.CanBeCanceled == false) - { - return null; - } - - return cancellationToken.Register(() => - { - if (tcs.Task.IsCompleted) - { - return; - } - - Native.Cancel(handle, id).ThrowIfError("Failed to cancel."); - tcs.TrySetCanceled(); - }); - } - } -} diff --git a/src/Tizen.Multimedia.Util/ThumbnailExtractor/ThumbnailExtractorError.cs b/src/Tizen.Multimedia.Util/ThumbnailExtractor/ThumbnailExtractorError.cs deleted file mode 100644 index 588d9582d..000000000 --- a/src/Tizen.Multimedia.Util/ThumbnailExtractor/ThumbnailExtractorError.cs +++ /dev/null @@ -1,74 +0,0 @@ -/* - * 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.IO; -using Tizen.Internals.Errors; - -namespace Tizen.Multimedia.Util -{ - internal enum ThumbnailExtractorError - { - None = ErrorCode.None, - InvalidParameter = ErrorCode.InvalidParameter, - OutOfMemory = ErrorCode.OutOfMemory, - InvalidOperation = ErrorCode.InvalidOperation, - FileNoSpaceOnDevice = ErrorCode.FileNoSpaceOnDevice, - PermissionDenied = ErrorCode.PermissionDenied, - TizenThumbnailUtilError = -0x02F90000, - UnsupportedContent = TizenThumbnailUtilError | 0x01, - }; - - internal static class ThumbnailExtractorErrorExtensions - { - internal static void ThrowIfError(this ThumbnailExtractorError errorCode, string errorMessage) - { - if (errorCode == ThumbnailExtractorError.None) - { - return; - } - - throw errorCode.ToException(errorMessage); - } - - internal static Exception ToException(this ThumbnailExtractorError errorCode, string errorMessage) - { - switch (errorCode) - { - case ThumbnailExtractorError.InvalidParameter: - return new ArgumentException(errorMessage); - - case ThumbnailExtractorError.OutOfMemory: - return new OutOfMemoryException(errorMessage); - - case ThumbnailExtractorError.InvalidOperation: - return new InvalidOperationException(errorMessage); - - case ThumbnailExtractorError.FileNoSpaceOnDevice: - return new IOException("No space to write on the device."); - - case ThumbnailExtractorError.PermissionDenied: - return new UnauthorizedAccessException("[" + errorCode.ToString() + "]" + errorMessage); - - case ThumbnailExtractorError.UnsupportedContent: - return new FileFormatException(errorMessage); - } - - return new InvalidOperationException("[" + errorCode.ToString() + "]" + errorMessage); - } - } -} - diff --git a/src/Tizen.Multimedia.Util/Tizen.Multimedia.Util.csproj b/src/Tizen.Multimedia.Util/Tizen.Multimedia.Util.csproj deleted file mode 100644 index ec9bff774..000000000 --- a/src/Tizen.Multimedia.Util/Tizen.Multimedia.Util.csproj +++ /dev/null @@ -1,11 +0,0 @@ - - - - netstandard2.0 - - - - - - - \ No newline at end of file diff --git a/src/Tizen.Multimedia.Util/Tizen.Multimedia.Util.sln b/src/Tizen.Multimedia.Util/Tizen.Multimedia.Util.sln deleted file mode 100755 index 19efbc7be..000000000 --- a/src/Tizen.Multimedia.Util/Tizen.Multimedia.Util.sln +++ /dev/null @@ -1,72 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26730.12 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Multimedia.Util", "Tizen.Multimedia.Util.csproj", "{7B123B52-9A9F-4785-960E-C8AA5A9D2AF8}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Multimedia", "..\Tizen.Multimedia\Tizen.Multimedia.csproj", "{A35FBE9E-543B-4D4C-AA97-E88A13D3C34F}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ElmSharp", "..\ElmSharp\ElmSharp.csproj", "{A4960572-B5DF-4CEA-9ECB-EC91ED527997}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen", "..\Tizen\Tizen.csproj", "{975A2DDA-1842-438F-9A40-AD34FCDE50B0}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Log", "..\Tizen.Log\Tizen.Log.csproj", "{65032A36-D61E-420E-AB34-CF3313895F0D}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Applications.Common", "..\Tizen.Applications.Common\Tizen.Applications.Common.csproj", "{58122F37-7A06-48B2-815A-BF355D284F63}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.NUI", "..\Tizen.NUI\Tizen.NUI.csproj", "{34C6C601-4FF0-440D-ADF6-5AA3A3DF5F58}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.System.SystemSettings", "..\Tizen.System.SystemSettings\Tizen.System.SystemSettings.csproj", "{CD96F19F-3BEA-43C7-AAC0-951EC6AADDC7}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.System.Information", "..\Tizen.System.Information\Tizen.System.Information.csproj", "{0284DB45-7FA4-4414-956A-8115BC508A8E}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {7B123B52-9A9F-4785-960E-C8AA5A9D2AF8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7B123B52-9A9F-4785-960E-C8AA5A9D2AF8}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7B123B52-9A9F-4785-960E-C8AA5A9D2AF8}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7B123B52-9A9F-4785-960E-C8AA5A9D2AF8}.Release|Any CPU.Build.0 = Release|Any CPU - {A35FBE9E-543B-4D4C-AA97-E88A13D3C34F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A35FBE9E-543B-4D4C-AA97-E88A13D3C34F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A35FBE9E-543B-4D4C-AA97-E88A13D3C34F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A35FBE9E-543B-4D4C-AA97-E88A13D3C34F}.Release|Any CPU.Build.0 = Release|Any CPU - {A4960572-B5DF-4CEA-9ECB-EC91ED527997}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A4960572-B5DF-4CEA-9ECB-EC91ED527997}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A4960572-B5DF-4CEA-9ECB-EC91ED527997}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A4960572-B5DF-4CEA-9ECB-EC91ED527997}.Release|Any CPU.Build.0 = Release|Any CPU - {975A2DDA-1842-438F-9A40-AD34FCDE50B0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {975A2DDA-1842-438F-9A40-AD34FCDE50B0}.Debug|Any CPU.Build.0 = Debug|Any CPU - {975A2DDA-1842-438F-9A40-AD34FCDE50B0}.Release|Any CPU.ActiveCfg = Release|Any CPU - {975A2DDA-1842-438F-9A40-AD34FCDE50B0}.Release|Any CPU.Build.0 = Release|Any CPU - {65032A36-D61E-420E-AB34-CF3313895F0D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {65032A36-D61E-420E-AB34-CF3313895F0D}.Debug|Any CPU.Build.0 = Debug|Any CPU - {65032A36-D61E-420E-AB34-CF3313895F0D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {65032A36-D61E-420E-AB34-CF3313895F0D}.Release|Any CPU.Build.0 = Release|Any CPU - {58122F37-7A06-48B2-815A-BF355D284F63}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {58122F37-7A06-48B2-815A-BF355D284F63}.Debug|Any CPU.Build.0 = Debug|Any CPU - {58122F37-7A06-48B2-815A-BF355D284F63}.Release|Any CPU.ActiveCfg = Release|Any CPU - {58122F37-7A06-48B2-815A-BF355D284F63}.Release|Any CPU.Build.0 = Release|Any CPU - {34C6C601-4FF0-440D-ADF6-5AA3A3DF5F58}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {34C6C601-4FF0-440D-ADF6-5AA3A3DF5F58}.Debug|Any CPU.Build.0 = Debug|Any CPU - {34C6C601-4FF0-440D-ADF6-5AA3A3DF5F58}.Release|Any CPU.ActiveCfg = Release|Any CPU - {34C6C601-4FF0-440D-ADF6-5AA3A3DF5F58}.Release|Any CPU.Build.0 = Release|Any CPU - {CD96F19F-3BEA-43C7-AAC0-951EC6AADDC7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {CD96F19F-3BEA-43C7-AAC0-951EC6AADDC7}.Debug|Any CPU.Build.0 = Debug|Any CPU - {CD96F19F-3BEA-43C7-AAC0-951EC6AADDC7}.Release|Any CPU.ActiveCfg = Release|Any CPU - {CD96F19F-3BEA-43C7-AAC0-951EC6AADDC7}.Release|Any CPU.Build.0 = Release|Any CPU - {0284DB45-7FA4-4414-956A-8115BC508A8E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {0284DB45-7FA4-4414-956A-8115BC508A8E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {0284DB45-7FA4-4414-956A-8115BC508A8E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {0284DB45-7FA4-4414-956A-8115BC508A8E}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {1BA22031-74BE-402A-A5A5-387466ECA499} - EndGlobalSection -EndGlobal diff --git a/src/Tizen.Multimedia.Vision/Interop/Interop.Libraries.cs b/src/Tizen.Multimedia.Vision/Interop/Interop.Libraries.cs deleted file mode 100644 index c48de1cd6..000000000 --- a/src/Tizen.Multimedia.Vision/Interop/Interop.Libraries.cs +++ /dev/null @@ -1,23 +0,0 @@ -/* - * 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 MediaVision = "libcapi-media-vision.so.0"; - } -} diff --git a/src/Tizen.Multimedia.Vision/Interop/Interop.MediaVision.BarCode.cs b/src/Tizen.Multimedia.Vision/Interop/Interop.MediaVision.BarCode.cs deleted file mode 100644 index 0d7d134b4..000000000 --- a/src/Tizen.Multimedia.Vision/Interop/Interop.MediaVision.BarCode.cs +++ /dev/null @@ -1,68 +0,0 @@ -/* - * 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; -using Tizen.Multimedia.Vision; - -/// -/// Interop APIs. -/// -internal static partial class Interop -{ - /// - /// Interop for Media Vision APIs. - /// - internal static partial class MediaVision - { - /// - /// Interop for Barcode Detector APIs. - /// - internal static partial class BarcodeDetector - { - [DllImport(Libraries.MediaVision, EntryPoint = "mv_barcode_detect")] - internal static extern MediaVisionError Detect(IntPtr source, IntPtr engineCfg, Rectangle roi, - DetectedCallback detectCb, IntPtr userData = default(IntPtr)); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void DetectedCallback( - IntPtr source, - IntPtr engineCfg, - [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 5)] - Quadrangle[] locations, - [MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.LPStr, SizeParamIndex = 5)] - string[] messages, - BarcodeType[] types, - int numberOfBarcodes, - IntPtr userData); - } - - /// - /// Interop for Barcode Generator APIs. - /// - internal static partial class BarcodeGenerator - { - [DllImport(Libraries.MediaVision, EntryPoint = "mv_barcode_generate_source")] - internal static extern MediaVisionError GenerateSource(IntPtr engineCfg, string message, - BarcodeType type, int qrEncMode, int qrEcc, int qrVersion, IntPtr source); - - [DllImport(Libraries.MediaVision, EntryPoint = "mv_barcode_generate_image")] - internal static extern MediaVisionError GenerateImage(IntPtr engineCfg, - string message, int imageWidth, int imageHeight, BarcodeType type, - int qrEncMode, int qrEcc, int qrVersion, string imagePath, BarcodeImageFormat imageFormat); - } - } -} diff --git a/src/Tizen.Multimedia.Vision/Interop/Interop.MediaVision.Common.cs b/src/Tizen.Multimedia.Vision/Interop/Interop.MediaVision.Common.cs deleted file mode 100755 index 37623220f..000000000 --- a/src/Tizen.Multimedia.Vision/Interop/Interop.MediaVision.Common.cs +++ /dev/null @@ -1,192 +0,0 @@ -/* - * 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; -using Tizen.Multimedia.Vision; - -/// -/// Interop APIs. -/// -internal static partial class Interop -{ - internal static Tizen.Multimedia.Point ToApiStruct(this MediaVision.Point pt) - { - return new Tizen.Multimedia.Point(pt.x, pt.y); - } - - internal static MediaVision.Point ToMarshalable(this Tizen.Multimedia.Point pt) - { - return new MediaVision.Point() { x = pt.X, y = pt.Y }; - } - - internal static MediaVision.Point[] ToMarshalable(Tizen.Multimedia.Point[] pts) - { - var result = new MediaVision.Point[pts.Length]; - for (int i = 0; i < pts.Length; ++i) - { - result[i] = pts[i].ToMarshalable(); - } - return result; - } - - - internal static Quadrangle ToApiStruct(this MediaVision.Quadrangle quadrangle) - { - Tizen.Multimedia.Point[] points = new Tizen.Multimedia.Point[4]; - for (int i = 0; i < 4; ++i) - { - points[i] = quadrangle.points[i].ToApiStruct(); - } - return new Quadrangle(points); - } - - internal static MediaVision.Quadrangle ToMarshalable(this Quadrangle quadrangle) - { - MediaVision.Point[] points = new MediaVision.Point[4]; - for (int i = 0; i < 4; ++i) - { - points[i] = quadrangle.Points[i].ToMarshalable(); - } - return new MediaVision.Quadrangle() { points = points }; - } - - internal static Tizen.Multimedia.Rectangle ToApiStruct(this MediaVision.Rectangle rectangle) - { - return new Tizen.Multimedia.Rectangle(rectangle.x, rectangle.y, rectangle.width, rectangle.height); - } - - internal static MediaVision.Rectangle ToMarshalable(this Tizen.Multimedia.Rectangle rectangle) - { - return new MediaVision.Rectangle() - { - x = rectangle.X, - y = rectangle.Y, - width = rectangle.Width, - height = rectangle.Height - }; - } - - internal static Tizen.Multimedia.Rectangle[] ToApiStruct(MediaVision.Rectangle[] rects) - { - var result = new Tizen.Multimedia.Rectangle[rects.Length]; - - for (int i = 0; i < rects.Length; i++) - { - result[i] = rects[i].ToApiStruct(); - } - return result; - } - - /// - /// Interop for Media Vision APIs. - /// - internal static partial class MediaVision - { - [StructLayout(LayoutKind.Sequential)] - internal struct Point - { - internal int x; - internal int y; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct Rectangle - { - internal int x; - internal int y; - internal int width; - internal int height; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct Quadrangle - { - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)] - internal Point[] points; - } - - /// - /// Interop for Media Vision Source APIs. - /// - internal static partial class MediaSource - { - [DllImport(Libraries.MediaVision, EntryPoint = "mv_create_source")] - internal static extern MediaVisionError Create(out IntPtr source); - - [DllImport(Libraries.MediaVision, EntryPoint = "mv_destroy_source")] - internal static extern int Destroy(IntPtr /* mv_source_h */ source); - - [DllImport(Libraries.MediaVision, EntryPoint = "mv_source_fill_by_media_packet")] - internal static extern MediaVisionError FillMediaPacket(IntPtr source, IntPtr mediaPacket); - - [DllImport(Libraries.MediaVision, EntryPoint = "mv_source_fill_by_buffer")] - internal static extern MediaVisionError FillBuffer(IntPtr source, byte[] buffer, - int bufferSize, uint imageWidth, uint imageHeight, VisionColorSpace colorspace); - - [DllImport(Libraries.MediaVision, EntryPoint = "mv_source_clear")] - internal static extern int Clear(IntPtr /* mv_source_h */ source); - - [DllImport(Libraries.MediaVision, EntryPoint = "mv_source_get_buffer")] - internal static extern MediaVisionError GetBuffer(IntPtr source, out IntPtr buffer, out int bufferSize); - - [DllImport(Libraries.MediaVision, EntryPoint = "mv_source_get_height")] - internal static extern int GetHeight(IntPtr source, out uint imageHeight); - - [DllImport(Libraries.MediaVision, EntryPoint = "mv_source_get_width")] - internal static extern int GetWidth(IntPtr source, out uint imageWidth); - - [DllImport(Libraries.MediaVision, EntryPoint = "mv_source_get_colorspace")] - internal static extern int GetColorspace(IntPtr /* mv_source_h */ source, out VisionColorSpace colorspace); - } - - /// - /// Interop for Engine Configuration APIs. - /// - internal static partial class EngineConfig - { - [DllImport(Libraries.MediaVision, EntryPoint = "mv_create_engine_config")] - internal static extern MediaVisionError Create(out IntPtr handle); - - [DllImport(Libraries.MediaVision, EntryPoint = "mv_destroy_engine_config")] - internal static extern int Destroy(IntPtr handle); - - [DllImport(Libraries.MediaVision, EntryPoint = "mv_engine_config_set_double_attribute")] - internal static extern MediaVisionError SetDouble(IntPtr handle, string name, double value); - - [DllImport(Libraries.MediaVision, EntryPoint = "mv_engine_config_set_int_attribute")] - internal static extern MediaVisionError SetInt(IntPtr handle, string name, int value); - - [DllImport(Libraries.MediaVision, EntryPoint = "mv_engine_config_set_bool_attribute")] - internal static extern MediaVisionError SetBool(IntPtr handle, string name, bool value); - - [DllImport(Libraries.MediaVision, EntryPoint = "mv_engine_config_set_string_attribute")] - internal static extern MediaVisionError SetString(IntPtr handle, string name, string value); - - [DllImport(Libraries.MediaVision, EntryPoint = "mv_engine_config_get_double_attribute")] - internal static extern MediaVisionError GetDouble(IntPtr handle, string name, out double value); - - [DllImport(Libraries.MediaVision, EntryPoint = "mv_engine_config_get_int_attribute")] - internal static extern MediaVisionError GetInt(IntPtr handle, string name, out int value); - - [DllImport(Libraries.MediaVision, EntryPoint = "mv_engine_config_get_bool_attribute")] - internal static extern MediaVisionError GetBool(IntPtr handle, string name, out bool value); - - [DllImport(Libraries.MediaVision, EntryPoint = "mv_engine_config_get_string_attribute")] - internal static extern MediaVisionError GetString(IntPtr handle, string name, out IntPtr value); - } - } -} diff --git a/src/Tizen.Multimedia.Vision/Interop/Interop.MediaVision.Face.cs b/src/Tizen.Multimedia.Vision/Interop/Interop.MediaVision.Face.cs deleted file mode 100755 index 8ce61f838..000000000 --- a/src/Tizen.Multimedia.Vision/Interop/Interop.MediaVision.Face.cs +++ /dev/null @@ -1,153 +0,0 @@ -/* - * 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; -using Tizen.Multimedia.Vision; - -/// -/// Interop APIs. -/// -internal static partial class Interop -{ - /// - /// Interop for Media Vision APIs. - /// - internal static partial class MediaVision - { - /// - /// Interop for Face APIs. - /// - internal static partial class Face - { - [DllImport(Libraries.MediaVision, EntryPoint = "mv_face_detect")] - internal static extern MediaVisionError Detect(IntPtr source, IntPtr engineCfg, - DetectedCallback detectedCb, IntPtr userData = default(IntPtr)); - - [DllImport(Libraries.MediaVision, EntryPoint = "mv_face_recognize")] - internal static extern MediaVisionError Recognize(IntPtr source, IntPtr recognitionModel, IntPtr engineCfg, - IntPtr faceLocation, RecognizedCallback recognizedCb, IntPtr userData = default(IntPtr)); - - [DllImport(Libraries.MediaVision, EntryPoint = "mv_face_recognize")] - internal static extern MediaVisionError Recognize(IntPtr source, IntPtr recognitionModel, IntPtr engineCfg, - ref Rectangle faceLocation, RecognizedCallback recognizedCb, IntPtr userData = default(IntPtr)); - - [DllImport(Libraries.MediaVision, EntryPoint = "mv_face_track")] - internal static extern MediaVisionError Track(IntPtr source, IntPtr trackingModel, IntPtr engineCfg, - TrackedCallback trackedCb, bool doLearn, IntPtr userData = default(IntPtr)); - - [DllImport(Libraries.MediaVision, EntryPoint = "mv_face_eye_condition_recognize")] - internal static extern MediaVisionError RecognizeEyeCondition(IntPtr source, IntPtr engineCfg, - Rectangle faceLocation, EyeConditionRecognizedCallback eyeConditionRecognizedCb, IntPtr userData = default(IntPtr)); - - [DllImport(Libraries.MediaVision, EntryPoint = "mv_face_facial_expression_recognize")] - internal static extern MediaVisionError RecognizeFacialExpression(IntPtr source, IntPtr engineCfg, - Rectangle faceLocation, MvFaceFacialExpressionRecognizedCallback expressionRecognizedCb, - IntPtr userData = default(IntPtr)); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void DetectedCallback(IntPtr source, IntPtr engineCfg, - [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 3)] Rectangle[] facesLocations, - int numberOfFaces, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void RecognizedCallback(IntPtr source, IntPtr recognitionModel, - IntPtr engineCfg, IntPtr faceLocation, IntPtr faceLabel, double confidence, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void TrackedCallback(IntPtr source, IntPtr trackingModel, IntPtr engineCfg, - IntPtr location, double confidence, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void EyeConditionRecognizedCallback(IntPtr source, IntPtr engineCfg, - Rectangle faceLocation, EyeCondition eyeCondition, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void MvFaceFacialExpressionRecognizedCallback(IntPtr source, - IntPtr engineCfg, Rectangle faceLocation, FacialExpression facialExpression, IntPtr userData); - } - - /// - /// Interop for FaceRecognitionModel APIs. - /// - internal static partial class FaceRecognitionModel - { - [DllImport(Libraries.MediaVision, EntryPoint = "mv_face_recognition_model_create")] - internal static extern MediaVisionError Create(out IntPtr handle); - - [DllImport(Libraries.MediaVision, EntryPoint = "mv_face_recognition_model_destroy")] - internal static extern int Destroy(IntPtr handle); - - [DllImport(Libraries.MediaVision, EntryPoint = "mv_face_recognition_model_clone")] - internal static extern int Clone(IntPtr src, out IntPtr dst); - - [DllImport(Libraries.MediaVision, EntryPoint = "mv_face_recognition_model_save")] - internal static extern MediaVisionError Save(string fileName, IntPtr handle); - - [DllImport(Libraries.MediaVision, EntryPoint = "mv_face_recognition_model_load")] - internal static extern MediaVisionError Load(string fileName, out IntPtr handle); - - [DllImport(Libraries.MediaVision, EntryPoint = "mv_face_recognition_model_add")] - internal static extern MediaVisionError Add(IntPtr source, IntPtr recognitionModel, - ref Rectangle exampleLocation, int faceLabel); - - [DllImport(Libraries.MediaVision, EntryPoint = "mv_face_recognition_model_add")] - internal static extern MediaVisionError Add(IntPtr source, IntPtr recognitionModel, - IntPtr exampleLocation, int faceLabel); - - [DllImport(Libraries.MediaVision, EntryPoint = "mv_face_recognition_model_reset")] - internal static extern MediaVisionError Reset(IntPtr recognitionModel, IntPtr faceLabel = default(IntPtr)); - - [DllImport(Libraries.MediaVision, EntryPoint = "mv_face_recognition_model_reset")] - internal static extern MediaVisionError Remove(IntPtr recognitionModel, ref int faceLabel); - - [DllImport(Libraries.MediaVision, EntryPoint = "mv_face_recognition_model_learn")] - internal static extern MediaVisionError Learn(IntPtr engineCfg, IntPtr handle); - - [DllImport(Libraries.MediaVision, EntryPoint = "mv_face_recognition_model_query_labels")] - internal static extern MediaVisionError QueryLabels(IntPtr handle, out IntPtr labels, out uint numberOfLabels); - } - - /// - /// Interop for FaceTrackingModel APIs. - /// - internal static partial class FaceTrackingModel - { - [DllImport(Libraries.MediaVision, EntryPoint = "mv_face_tracking_model_create")] - internal static extern MediaVisionError Create(out IntPtr handle); - - [DllImport(Libraries.MediaVision, EntryPoint = "mv_face_tracking_model_destroy")] - internal static extern int Destroy(IntPtr handle); - - [DllImport(Libraries.MediaVision, EntryPoint = "mv_face_tracking_model_prepare")] - internal static extern MediaVisionError Prepare(IntPtr trackingModel, IntPtr engineCfg, - IntPtr source, ref Quadrangle location); - - [DllImport(Libraries.MediaVision, EntryPoint = "mv_face_tracking_model_prepare")] - internal static extern MediaVisionError Prepare(IntPtr trackingModel, IntPtr engineCfg, - IntPtr source, IntPtr location); - - [DllImport(Libraries.MediaVision, EntryPoint = "mv_face_tracking_model_clone")] - internal static extern int Clone(IntPtr src, out IntPtr dst); - - [DllImport(Libraries.MediaVision, EntryPoint = "mv_face_tracking_model_save")] - internal static extern MediaVisionError Save(string fileName, IntPtr handle); - - [DllImport(Libraries.MediaVision, EntryPoint = "mv_face_tracking_model_load")] - internal static extern MediaVisionError Load(string fileName, out IntPtr handle); - } - } -} diff --git a/src/Tizen.Multimedia.Vision/Interop/Interop.MediaVision.Image.cs b/src/Tizen.Multimedia.Vision/Interop/Interop.MediaVision.Image.cs deleted file mode 100755 index ebf59edbb..000000000 --- a/src/Tizen.Multimedia.Vision/Interop/Interop.MediaVision.Image.cs +++ /dev/null @@ -1,111 +0,0 @@ -/* - * 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; -using Tizen.Multimedia.Vision; - -/// -/// Interop APIs. -/// -internal static partial class Interop -{ - /// - /// Interop for Media Vision APIs. - /// - internal static partial class MediaVision - { - /// - /// Interop for Image APIs. - /// - internal static partial class Image - { - [DllImport(Libraries.MediaVision, EntryPoint = "mv_image_recognize")] - internal static extern MediaVisionError Recognize(IntPtr source, IntPtr[] imageObjects, - int numberOfObjects, IntPtr engineCfg, RecognizedCallback recognizedCb, IntPtr userData = default(IntPtr)); - - [DllImport(Libraries.MediaVision, EntryPoint = "mv_image_track")] - internal static extern MediaVisionError Track(IntPtr source, IntPtr imageTrackingModel, - IntPtr engineCfg, TrackedCallback trackedCb, IntPtr userData = default(IntPtr)); - - [DllImport(Libraries.MediaVision, EntryPoint = "mv_image_object_create")] - internal static extern MediaVisionError Create(out IntPtr handle); - - [DllImport(Libraries.MediaVision, EntryPoint = "mv_image_object_destroy")] - internal static extern int Destroy(IntPtr handle); - - [DllImport(Libraries.MediaVision, EntryPoint = "mv_image_object_fill")] - internal static extern MediaVisionError Fill(IntPtr handle, IntPtr engineCfg, IntPtr source, ref Rectangle location); - - [DllImport(Libraries.MediaVision, EntryPoint = "mv_image_object_fill")] - internal static extern MediaVisionError Fill(IntPtr handle, IntPtr engineCfg, IntPtr source, IntPtr location); - - [DllImport(Libraries.MediaVision, EntryPoint = "mv_image_object_get_recognition_rate")] - internal static extern MediaVisionError GetRecognitionRate(IntPtr handle, out double recognitionRate); - - [DllImport(Libraries.MediaVision, EntryPoint = "mv_image_object_set_label")] - internal static extern MediaVisionError SetLabel(IntPtr handle, int label); - - [DllImport(Libraries.MediaVision, EntryPoint = "mv_image_object_get_label")] - internal static extern MediaVisionError GetLabel(IntPtr handle, out int label); - - [DllImport(Libraries.MediaVision, EntryPoint = "mv_image_object_clone")] - internal static extern int Clone(IntPtr src, out IntPtr dst); - - [DllImport(Libraries.MediaVision, EntryPoint = "mv_image_object_save")] - internal static extern MediaVisionError Save(string fileName, IntPtr handle); - - [DllImport(Libraries.MediaVision, EntryPoint = "mv_image_object_load")] - internal static extern MediaVisionError Load(string fileName, out IntPtr handle); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void RecognizedCallback(IntPtr source, IntPtr engineCfg, IntPtr imageObjects, - [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 4)] - IntPtr[] locations, uint numberOfObjects, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void TrackedCallback(IntPtr source, IntPtr imageTrackingModel, - IntPtr engineCfg, IntPtr location, IntPtr userData); - } - - /// - /// Interop for ImageTrackingModel APIs. - /// - internal static partial class ImageTrackingModel - { - [DllImport(Libraries.MediaVision, EntryPoint = "mv_image_tracking_model_create")] - internal static extern MediaVisionError Create(out IntPtr imageTrackingModel); - - [DllImport(Libraries.MediaVision, EntryPoint = "mv_image_tracking_model_set_target")] - internal static extern MediaVisionError SetTarget(IntPtr handle, IntPtr imageTrackingModel); - - [DllImport(Libraries.MediaVision, EntryPoint = "mv_image_tracking_model_destroy")] - internal static extern int Destroy(IntPtr imageTrackingModel); - - [DllImport(Libraries.MediaVision, EntryPoint = "mv_image_tracking_model_refresh")] - internal static extern MediaVisionError Refresh(IntPtr imageTrackingModel, IntPtr engineCfg); - - [DllImport(Libraries.MediaVision, EntryPoint = "mv_image_tracking_model_clone")] - internal static extern int Clone(IntPtr src, out IntPtr dest); - - [DllImport(Libraries.MediaVision, EntryPoint = "mv_image_tracking_model_save")] - internal static extern MediaVisionError Save(string fileName, IntPtr imageTrackingModel); - - [DllImport(Libraries.MediaVision, EntryPoint = "mv_image_tracking_model_load")] - internal static extern MediaVisionError Load(string fileName, out IntPtr imageTrackingModel); - } - } -} diff --git a/src/Tizen.Multimedia.Vision/Interop/Interop.MediaVision.Surveillance.cs b/src/Tizen.Multimedia.Vision/Interop/Interop.MediaVision.Surveillance.cs deleted file mode 100755 index d63c6a0c6..000000000 --- a/src/Tizen.Multimedia.Vision/Interop/Interop.MediaVision.Surveillance.cs +++ /dev/null @@ -1,91 +0,0 @@ -/* - * 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; -using Tizen.Multimedia.Vision; - -/// -/// Interop APIs. -/// -internal static partial class Interop -{ - /// - /// Interop for Media Vision APIs. - /// - internal static partial class MediaVision - { - /// - /// Interop for Surveillance APIs. - /// - internal static partial class Surveillance - { - [DllImport(Libraries.MediaVision, EntryPoint = "mv_surveillance_event_trigger_create")] - internal static extern MediaVisionError EventTriggerCreate(string eventType, out IntPtr trigger); - - [DllImport(Libraries.MediaVision, EntryPoint = "mv_surveillance_event_trigger_destroy")] - internal static extern int EventTriggerDestroy(IntPtr trigger); - - [DllImport(Libraries.MediaVision, EntryPoint = "mv_surveillance_get_event_trigger_type")] - internal static extern int GetEventTriggerType(IntPtr trigger, out string eventType); - - [DllImport(Libraries.MediaVision, EntryPoint = "mv_surveillance_set_event_trigger_roi")] - internal static extern MediaVisionError SetEventTriggerRoi(IntPtr trigger, int numberOfPoints, Point[] roi); - - [DllImport(Libraries.MediaVision, EntryPoint = "mv_surveillance_get_event_trigger_roi")] - internal static extern MediaVisionError GetEventTriggerRoi(IntPtr trigger, out int numberOfPoints, out IntPtr roi); - - [DllImport(Libraries.MediaVision, EntryPoint = "mv_surveillance_subscribe_event_trigger")] - internal static extern MediaVisionError SubscribeEventTrigger(IntPtr trigger, int videoStreamId, - IntPtr engineCfg, EventOccurredCallback callback, IntPtr userData = default(IntPtr)); - - [DllImport(Libraries.MediaVision, EntryPoint = "mv_surveillance_unsubscribe_event_trigger")] - internal static extern MediaVisionError UnsubscribeEventTrigger(IntPtr trigger, int videoStreamId); - - [DllImport(Libraries.MediaVision, EntryPoint = "mv_surveillance_push_source")] - internal static extern MediaVisionError PushSource(IntPtr source, int videoStreamId); - - [DllImport(Libraries.MediaVision, EntryPoint = "mv_surveillance_foreach_supported_event_type")] - internal static extern int ForeachSupportedEventType(EventTypeCallback callback, IntPtr userData); - - [DllImport(Libraries.MediaVision, EntryPoint = "mv_surveillance_foreach_event_result_name")] - internal static extern int ForeachEventResultName(string eventType, EventResultNameCallback callback, - IntPtr userData); - - [DllImport(Libraries.MediaVision, EntryPoint = "mv_surveillance_get_result_value")] - internal static extern MediaVisionError GetResultValue(IntPtr result, string name, out int value); - - [DllImport(Libraries.MediaVision, EntryPoint = "mv_surveillance_get_result_value")] - internal static extern MediaVisionError GetResultValue(IntPtr result, string name, [Out] int[] value); - - [DllImport(Libraries.MediaVision, EntryPoint = "mv_surveillance_get_result_value")] - internal static extern MediaVisionError GetResultValue(IntPtr result, string name, [Out] double[] value); - - [DllImport(Libraries.MediaVision, EntryPoint = "mv_surveillance_get_result_value")] - internal static extern MediaVisionError GetResultValue(IntPtr result, string name, [Out] Rectangle[] value); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void EventOccurredCallback(IntPtr trigger, IntPtr source, - int videoStreamId, IntPtr eventResult, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool EventTypeCallback(string eventType, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool EventResultNameCallback(string name, IntPtr userData); - } - } -} diff --git a/src/Tizen.Multimedia.Vision/MediaVision/Barcode.cs b/src/Tizen.Multimedia.Vision/MediaVision/Barcode.cs deleted file mode 100755 index a8d9ce8b0..000000000 --- a/src/Tizen.Multimedia.Vision/MediaVision/Barcode.cs +++ /dev/null @@ -1,61 +0,0 @@ -/* - * 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. - */ - -namespace Tizen.Multimedia.Vision -{ - /// - /// Represents a detected barcode. - /// - /// 3 - public class Barcode - { - /// - /// Initializes a new instance of the class. - /// - /// 3 - public Barcode(Quadrangle region, string message, BarcodeType type) - { - Region = region; - Message = message; - Type = type; - } - - /// - /// The quadrangle location of the detected barcode. - /// - /// 3 - public Quadrangle Region { get; } - - /// - /// The decoded message of the barcode. - /// - /// 3 - public string Message { get; } - - /// - /// The type of the detected barcode. - /// - /// 3 - public BarcodeType Type { get; } - - /// - /// Returns a string that represents the current object. - /// - /// A string that represents the current object. - public override string ToString() => - $"Region={Region}, Message={Message}, Type={Type.ToString()}"; - } -} diff --git a/src/Tizen.Multimedia.Vision/MediaVision/BarcodeDetectionConfiguration.cs b/src/Tizen.Multimedia.Vision/MediaVision/BarcodeDetectionConfiguration.cs deleted file mode 100755 index 633c983c3..000000000 --- a/src/Tizen.Multimedia.Vision/MediaVision/BarcodeDetectionConfiguration.cs +++ /dev/null @@ -1,58 +0,0 @@ -/* - * 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.Multimedia.Vision -{ - /// - /// Represents a configuration of . - /// - /// - /// 3 - public class BarcodeDetectionConfiguration : EngineConfiguration - { - private const string KeyAttrTarget = "MV_BARCODE_DETECT_ATTR_TARGET"; - - /// - /// Initializes a new instance of the class. - /// - /// The feature is not supported. - /// 3 - public BarcodeDetectionConfiguration() : base("barcode_detection") - { - } - - /// - /// Gets or sets the target of the barcode detection. - /// - /// is not valid. - /// The already has been disposed of. - /// 3 - public BarcodeDetectionTarget Target - { - get - { - return (BarcodeDetectionTarget)GetInt(KeyAttrTarget); - } - set - { - ValidationUtil.ValidateEnum(typeof(BarcodeDetectionTarget), value); - Set(KeyAttrTarget, (int)value); - } - } - } -} diff --git a/src/Tizen.Multimedia.Vision/MediaVision/BarcodeDetectionTarget.cs b/src/Tizen.Multimedia.Vision/MediaVision/BarcodeDetectionTarget.cs deleted file mode 100755 index 0da739624..000000000 --- a/src/Tizen.Multimedia.Vision/MediaVision/BarcodeDetectionTarget.cs +++ /dev/null @@ -1,43 +0,0 @@ -/* - * 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. - */ - -namespace Tizen.Multimedia.Vision -{ - /// - /// Specifies the target of . - /// - /// 3 - public enum BarcodeDetectionTarget - { - /// - /// 1D and 2D. - /// - /// 3 - All, - - /// - /// 1D barcode only. - /// - /// 3 - Barcode1D, - - /// - /// 2D barcode only. - /// - /// 3 - Barcode2D, - } -} diff --git a/src/Tizen.Multimedia.Vision/MediaVision/BarcodeDetector.cs b/src/Tizen.Multimedia.Vision/MediaVision/BarcodeDetector.cs deleted file mode 100755 index 176db34bd..000000000 --- a/src/Tizen.Multimedia.Vision/MediaVision/BarcodeDetector.cs +++ /dev/null @@ -1,119 +0,0 @@ -/* - * 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.Collections.Generic; -using System.Threading.Tasks; -using InteropBarcode = Interop.MediaVision.BarcodeDetector; -using Unmanaged = Interop.MediaVision; - -namespace Tizen.Multimedia.Vision -{ - /// - /// Provides the ability to detect barcodes on image sources. - /// - /// 3 - public static class BarcodeDetector - { - /// - /// Detects barcodes on the source and reads the message from it. - /// - /// The instance. - /// Region of interest - rectangular area on the source which will be used for - /// barcode detection. Note that roi should be inside area on the source. - /// is null. - /// The feature is not supported. - /// already has been disposed of. - /// A task that represents the asynchronous detect operation. - /// - /// 3 - public static async Task> DetectAsync(MediaVisionSource source, - Rectangle roi) - { - return await DetectAsync(source, roi, null); - } - - /// - /// Detects barcodes on the source and reads the message from it with . - /// - /// The instance. - /// Region of interest - rectangular area on the source which will be used for - /// barcode detection. Note that roi should be inside area on the source. - /// The configuration of the barcode detector. This value can be null. - /// A task that represents the asynchronous detect operation. - /// is null. - /// The feature is not supported. - /// - /// already has been disposed of.\n - /// -or-\n - /// already has been disposed of. - /// - /// - /// 3 - public static async Task> DetectAsync(MediaVisionSource source, - Rectangle roi, BarcodeDetectionConfiguration config) - { - if (source == null) - { - throw new ArgumentNullException(nameof(source)); - } - - var tcs = new TaskCompletionSource>(); - - using (var cb = ObjectKeeper.Get(GetCallback(tcs))) - { - InteropBarcode.Detect(source.Handle, EngineConfiguration.GetHandle(config), - roi.ToMarshalable(), cb.Target).Validate("Failed to detect barcode."); - - return await tcs.Task; - } - } - - private static Barcode[] CreateBarcodes(Unmanaged.Quadrangle[] locations, string[] messages, - BarcodeType[] types, int numberOfBarcodes) - { - Barcode[] barcodes = new Barcode[numberOfBarcodes]; - - for (int i = 0; i < numberOfBarcodes; i++) - { - barcodes[i] = new Barcode(locations[i].ToApiStruct(), messages[i], types[i]); - - Log.Info(MediaVisionLog.Tag, barcodes[i].ToString()); - } - - return barcodes; - } - - private static InteropBarcode.DetectedCallback GetCallback(TaskCompletionSource> tcs) - { - return (IntPtr mvSource, IntPtr engineCfg, Unmanaged.Quadrangle[] locations, string[] messages, - BarcodeType[] types, int numberOfBarcodes, IntPtr userData) => - { - Log.Info(MediaVisionLog.Tag, $"Barcodes detected, count : {numberOfBarcodes}"); - - try - { - tcs.TrySetResult(CreateBarcodes(locations, messages, types, numberOfBarcodes)); - } - catch (Exception e) - { - MultimediaLog.Error(MediaVisionLog.Tag, "Failed to handle barcode detection callback", e); - tcs.TrySetException(e); - } - }; - } - } -} diff --git a/src/Tizen.Multimedia.Vision/MediaVision/BarcodeGenerationConfiguration.cs b/src/Tizen.Multimedia.Vision/MediaVision/BarcodeGenerationConfiguration.cs deleted file mode 100755 index edfbc5071..000000000 --- a/src/Tizen.Multimedia.Vision/MediaVision/BarcodeGenerationConfiguration.cs +++ /dev/null @@ -1,107 +0,0 @@ -/* - * 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.Common; - -namespace Tizen.Multimedia.Vision -{ - /// - /// Represents a configuration of instances. - /// - /// - /// 3 - public class BarcodeGenerationConfiguration : EngineConfiguration - { - private const string KeyTextAttr = "MV_BARCODE_GENERATE_ATTR_TEXT"; - private const string KeyForegroundColorAttr = "MV_BARCODE_GENERATE_ATTR_COLOR_FRONT"; - private const string KeyBackgroundColorAttr = "MV_BARCODE_GENERATE_ATTR_COLOR_BACK"; - - /// - /// Initializes a new instance of the class. - /// - /// The feature is not supported. - /// 3 - public BarcodeGenerationConfiguration() : base("barcode_generation") - { - } - - /// - /// Gets or sets the text visibility of the barcode to be generated. - /// - /// is not valid. - /// The already has been disposed of. - /// 3 - public Visibility TextVisibility - { - get - { - return (Visibility)GetInt(KeyTextAttr); - } - set - { - ValidationUtil.ValidateEnum(typeof(Visibility), value); - Set(KeyTextAttr, (int)value); - } - } - - private Color _foregroundColor = Color.Black; - - /// - /// Gets or sets the foreground color of the barcode to be generated. - /// - /// - /// The alpha value of the color will be ignored. - /// - /// The already has been disposed of. - /// 3 - public Color ForegroundColor - { - get - { - return _foregroundColor; - } - set - { - Set(KeyForegroundColorAttr, string.Format("{0:x2}{1:x2}{2:x2}", value.R, value.G, value.B)); - _foregroundColor = value; - } - } - - private Color _backgroundColor = Color.White; - - /// - /// Gets or sets the background color of the barcode to be generated. - /// - /// - /// The alpha value of the color will be ignored. - /// - /// The already has been disposed of. - /// 3 - public Color BackgroundColor - { - get - { - return _backgroundColor; - } - set - { - Set(KeyBackgroundColorAttr, string.Format("{0:x2}{1:x2}{2:x2}", value.R, value.G, value.B)); - _backgroundColor = value; - } - } - } -} diff --git a/src/Tizen.Multimedia.Vision/MediaVision/BarcodeGenerator.cs b/src/Tizen.Multimedia.Vision/MediaVision/BarcodeGenerator.cs deleted file mode 100755 index 402a109bf..000000000 --- a/src/Tizen.Multimedia.Vision/MediaVision/BarcodeGenerator.cs +++ /dev/null @@ -1,357 +0,0 @@ -/* - * 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 InteropBarcode = Interop.MediaVision.BarcodeGenerator; - -namespace Tizen.Multimedia.Vision -{ - /// - /// Provides the ability to generate barcodes and QR codes. - /// Different encoding types , error correction codes , - /// and code versions are supported for QRCodes. - /// - /// - /// 3 - public static class BarcodeGenerator - { - private const int NoneErrorCorrection = (int)ErrorCorrectionLevel.High + 1; - private const int NoneQrMode = (int)QrMode.Utf8 + 1; - - private static MediaVisionSource GenerateSource(BarcodeGenerationConfiguration config, - string message, BarcodeType type, int qrMode, int qrEcc, int qrVersion) - { - if (message == null) - { - throw new ArgumentNullException(nameof(message)); - } - - ValidationUtil.ValidateEnum(typeof(BarcodeType), type); - - MediaVisionSource source = new MediaVisionSource(); - try - { - InteropBarcode.GenerateSource(EngineConfiguration.GetHandle(config), - message, type, qrMode, qrEcc, qrVersion, source.Handle). - Validate("Failed to generate source"); - } - catch (Exception) - { - source.Dispose(); - throw; - } - return source; - } - - /// - /// Generates a QR image with the specified message. - /// - /// The message to be encoded in the barcode. - /// The instance. - /// containing the generated QR image. - /// - /// is null.\n - /// -or-\n - /// is null. - /// - /// - /// is too long.\n - /// -or-\n - /// contains characters which are illegal by the . - /// - /// The feature is not supported. - /// - /// 3 - public static MediaVisionSource GenerateSource(string message, QrConfiguration qrConfig) - { - return GenerateSource(message, qrConfig, null); - } - - /// - /// Generates a QR image with the specified message with . - /// - /// The message to be encoded in the barcode. - /// The instance. - /// The configuration of the barcode generator. This value can be null. - /// containing the generated QR image. - /// - /// must be , - /// because the text visibility is not supported in the QR code. - /// - /// - /// is null.\n - /// -or-\n - /// is null. - /// - /// - /// is too long.\n - /// -or-\n - /// contains characters which are illegal by the . - /// - /// - /// The feature is not supported.\n - /// -or-\n - /// is the . - /// - /// already has been disposed of. - /// - /// 3 - public static MediaVisionSource GenerateSource(string message, QrConfiguration qrConfig, - BarcodeGenerationConfiguration config) - { - if (qrConfig == null) - { - throw new ArgumentNullException(nameof(qrConfig)); - } - - if (config != null) - { - if (config.TextVisibility == Visibility.Visible) - { - throw new NotSupportedException("Text can't be visible in QR."); - } - } - - return GenerateSource(config, message, BarcodeType.QR, (int)qrConfig.Mode, - (int)qrConfig.ErrorCorrectionLevel, qrConfig.Version); - } - - /// - /// Generates a barcode image with the specified message. - /// - /// The message to be encoded in the barcode. - /// Type of the barcode to be generated. - /// containing the generated barcode image. - /// is null. - /// - /// is too long.\n - /// -or-\n - /// is .\n - /// -or-\n - /// is invalid. - /// -or-\n - /// contains illegal characters. - /// - /// The feature is not supported. - /// 3 - public static MediaVisionSource GenerateSource(string message, BarcodeType type) - { - return GenerateSource(message, type, null); - } - - /// - /// Generates a barcode image with the specified message and . - /// - /// The message to be encoded in the barcode. - /// Type of the barcode to be generated. - /// The configuration of the barcode generator. This value can be null. - /// containing the generated barcode image. - /// is null. - /// - /// is too long.\n - /// -or-\n - /// is . - /// -or-\n - /// is invalid. - /// -or-\n - /// contains illegal characters. - /// - /// The feature is not supported. - /// already has been disposed of. - /// 3 - public static MediaVisionSource GenerateSource(string message, BarcodeType type, - BarcodeGenerationConfiguration config) - { - if (type == BarcodeType.QR) - { - throw new ArgumentException($"Invalid barcode type : {type}."); - } - - return GenerateSource(config, message, type, NoneQrMode, NoneErrorCorrection, 0); - } - - private static void GenerateImage(BarcodeGenerationConfiguration config, - string message, BarcodeType type, BarcodeImageConfiguration imageConfig, - int qrMode, int qrEcc, int qrVersion) - { - if (message == null) - { - throw new ArgumentNullException(nameof(message)); - } - - if (imageConfig == null) - { - throw new ArgumentNullException(nameof(imageConfig)); - } - - ValidationUtil.ValidateEnum(typeof(BarcodeType), type); - - InteropBarcode.GenerateImage(EngineConfiguration.GetHandle(config), message, - imageConfig.Width, imageConfig.Height, type, qrMode, qrEcc, qrVersion, - imageConfig.Path, imageConfig.Format). - Validate("Failed to generate image"); - } - - /// - /// Generates a QR image file with the specified message. - /// - /// - /// must be , - /// because the text visibility is not supported in the QR code. - /// - /// The message to be encoded in the barcode. - /// The instance. - /// The that contains information about the file to be generated. - /// - /// is null.\n - /// -or-\n - /// is null.\n - /// -or-\n - /// is null. - /// - /// - /// is too long.\n - /// -or-\n - /// contains characters which are illegal by the . - /// - /// No permission to write a file. - /// The feature is not supported. - /// - /// 3 - public static void GenerateImage(string message, QrConfiguration qrConfig, - BarcodeImageConfiguration imageConfig) - { - GenerateImage(message, qrConfig, imageConfig, null); - } - - /// - /// Generates a QR image file with the specified message and . - /// - /// - /// must be , - /// because the text visibility is not supported in the QR code. - /// - /// The message to be encoded in the barcode. - /// The instance. - /// The that contains - /// information about the file to be generated. - /// The configuration of the barcode generator. This value can be null. - /// - /// is null.\n - /// -or-\n - /// is null.\n - /// -or-\n - /// is null. - /// - /// - /// is too long.\n - /// -or-\n - /// contains characters which are illegal by the . - /// - /// No permission to write a file. - /// - /// The feature is not supported.\n - /// -or-\n - /// is the . - /// - /// already has been disposed of. - /// 3 - public static void GenerateImage(string message, QrConfiguration qrConfig, - BarcodeImageConfiguration imageConfig, BarcodeGenerationConfiguration config) - { - if (qrConfig == null) - { - throw new ArgumentNullException(nameof(qrConfig)); - } - - if (config != null) - { - if (config.TextVisibility == Visibility.Visible) - { - throw new NotSupportedException("Text can't be visible in QR."); - } - } - - GenerateImage(config, message, BarcodeType.QR, imageConfig, (int)qrConfig.Mode, - (int)qrConfig.ErrorCorrectionLevel, qrConfig.Version); - } - - /// - /// Generates a barcode image file with the specified message. - /// - /// The message to be encoded in the barcode. - /// Type of the barcode to be generated. - /// The that contains - /// information about the file to be generated. - /// - /// is null.\n - /// -or-\n - /// is null. - /// - /// - /// is too long.\n - /// -or-\n - /// is . - /// -or-\n - /// is invalid. - /// -or-\n - /// contains illegal characters. - /// - /// No permission to write a file. - /// The feature is not supported. - /// 3 - public static void GenerateImage(string message, BarcodeType type, BarcodeImageConfiguration imageConfig) - { - GenerateImage(message, type, imageConfig, null); - } - - /// - /// Generates a barcode image file with the specified message and . - /// - /// The message to be encoded in the barcode. - /// Type of the barcode to be generated. - /// The that contains - /// information about the file to be generated. - /// The configuration of the barcode generator. This value can be null. - /// - /// is null.\n - /// -or-\n - /// is null. - /// - /// - /// is too long.\n - /// -or-\n - /// is . - /// -or-\n - /// is invalid. - /// -or-\n - /// contains illegal characters. - /// - /// No permission to write a file. - /// The feature is not supported. - /// already has been disposed of. - /// 3 - public static void GenerateImage(string message, - BarcodeType type, BarcodeImageConfiguration imageConfig, BarcodeGenerationConfiguration config) - { - if (type == BarcodeType.QR) - { - throw new ArgumentException($"Invalid barcode type : {type}."); - } - GenerateImage(config, message, type, imageConfig, NoneQrMode, NoneErrorCorrection, 0); - } - } -} diff --git a/src/Tizen.Multimedia.Vision/MediaVision/BarcodeImageConfiguration.cs b/src/Tizen.Multimedia.Vision/MediaVision/BarcodeImageConfiguration.cs deleted file mode 100755 index bf14e4430..000000000 --- a/src/Tizen.Multimedia.Vision/MediaVision/BarcodeImageConfiguration.cs +++ /dev/null @@ -1,135 +0,0 @@ -/* - * 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.Multimedia.Vision -{ - /// - /// Represents a configuration for the image to be generated by . - /// - /// 3 - public class BarcodeImageConfiguration - { - /// - /// Initializes a new instance of the class. - /// - /// - /// The mediastorage privilege (http://tizen.org/privilege/mediastorage) is needed if the image path is relevant to media storage.\n - /// The externalstorage privilege (http://tizen.org/privilege/externalstorage) is needed if the image path is relevant to external storage. - /// - /// The of the generated image. - /// The path to the file to be generated. - /// The format of the output image. - /// - /// The width of is less than or equal to zero.\n - /// -or-\n - /// The height of is less than or equal to zero. - /// - /// is null. - /// is invalid. - /// - /// BarcodeImageConfiguration imageConfig = new BarcodeImageConfiguration(new Size(500, 400), "/opt/usr/test-barcode-generate-new", BarcodeImageFormat.JPG); - /// - /// 3 - public BarcodeImageConfiguration(Size size, string path, BarcodeImageFormat imageFormat) - { - if (size.Width <= 0) - { - throw new ArgumentOutOfRangeException(nameof(Size.Width), size.Width, - "width can't be less than or equal to zero."); - } - - if (size.Height <= 0) - { - throw new ArgumentOutOfRangeException(nameof(Size.Height), size.Height, - "height can't be less than or equal to zero."); - } - - if (path == null) - { - throw new ArgumentNullException(nameof(path)); - } - - ValidationUtil.ValidateEnum(typeof(BarcodeImageFormat), imageFormat); - - Size = size; - Path = path; - Format = imageFormat; - } - - /// - /// Initializes a new instance of the class. - /// - /// - /// The mediastorage privilege (http://tizen.org/privilege/mediastorage) is needed if the image path is relevant to media storage.\n - /// The externalstorage privilege (http://tizen.org/privilege/externalstorage) is needed if the image path is relevant to external storage. - /// - /// The width of the image to be generated. - /// The height of the image to be generated. - /// The path to the file to be generated. - /// The format of the output image. - /// - /// is less than or equal to zero.\n - /// -or-\n - /// is less than or equal to zero. - /// - /// is null. - /// is invalid. - /// - /// BarcodeImageConfiguration 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) - { - } - - /// - /// Gets the size of the image. - /// - /// 3 - public Size Size { get; } - - /// - /// Gets the width of the image. - /// - /// 3 - public int Width => Size.Width; - - /// - /// Gets the height of the image. - /// - /// 3 - public int Height => Size.Height; - - /// - /// Gets the path to the file that has to be generated. - /// - /// - /// The mediastorage privilege (http://tizen.org/privilege/mediastorage) is needed if the image path is relevant to media storage.\n - /// The externalstorage privilege (http://tizen.org/privilege/externalstorage) is needed if the image path is relevant to external storage. - /// - /// 3 - public string Path { get; } - - /// - /// Gets the format of the output image. - /// - /// 3 - public BarcodeImageFormat Format { get; } - } -} diff --git a/src/Tizen.Multimedia.Vision/MediaVision/BarcodeImageFormat.cs b/src/Tizen.Multimedia.Vision/MediaVision/BarcodeImageFormat.cs deleted file mode 100755 index de3ff8b2c..000000000 --- a/src/Tizen.Multimedia.Vision/MediaVision/BarcodeImageFormat.cs +++ /dev/null @@ -1,42 +0,0 @@ -/* - * 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. - */ - -namespace Tizen.Multimedia.Vision -{ - /// - /// Specifies the supported image formats for - /// - /// - /// 3 - public enum BarcodeImageFormat - { - /// - /// BMP image format. - /// - /// 3 - Bmp, - /// - /// JPEG image format. - /// - /// 3 - Jpeg, - /// - /// PNG image format. - /// - /// 3 - Png - } -} diff --git a/src/Tizen.Multimedia.Vision/MediaVision/BarcodeType.cs b/src/Tizen.Multimedia.Vision/MediaVision/BarcodeType.cs deleted file mode 100755 index bcf39308f..000000000 --- a/src/Tizen.Multimedia.Vision/MediaVision/BarcodeType.cs +++ /dev/null @@ -1,71 +0,0 @@ -/* - * 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. - */ - -namespace Tizen.Multimedia.Vision -{ - /// - /// Specifies the supported barcode types. - /// - /// - /// QR codes (versions 1 to 40) and set of 1D barcodes are supported. - /// - /// - /// - /// 3 - public enum BarcodeType - { - /// - /// 2D barcode - Quick Response code. - /// - /// 3 - QR, - /// - /// 1D barcode - Universal Product Code with 12-digit. - /// - /// 3 - UpcA, - /// - /// 1D barcode - Universal Product Code with 6-digit. - /// - /// 3 - UpcE, - /// - /// 1D barcode - International Article Number with 8-digit. - /// - /// 3 - Ean8, - /// - /// 1D barcode - International Article Number with 13-digit. - /// - /// 3 - Ean13, - /// - /// 1D barcode - Code 128. - /// - /// 3 - Code128, - /// - /// 1D barcode - Code 39. - /// - /// 3 - Code39, - /// - /// 1D barcode - Interleaved Two of Five. - /// - /// 3 - I25 - } -} diff --git a/src/Tizen.Multimedia.Vision/MediaVision/EngineConfiguration.cs b/src/Tizen.Multimedia.Vision/MediaVision/EngineConfiguration.cs deleted file mode 100755 index aa20741ba..000000000 --- a/src/Tizen.Multimedia.Vision/MediaVision/EngineConfiguration.cs +++ /dev/null @@ -1,187 +0,0 @@ -/* - * 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.System; -using System.Runtime.InteropServices; -using static Interop.MediaVision; - -namespace Tizen.Multimedia.Vision -{ - /// - /// A base class for configuration classes. - /// - /// 3 - public abstract class EngineConfiguration : IDisposable - { - private IntPtr _handle = IntPtr.Zero; - private bool _disposed = false; - - private const string _featurePath = "http://tizen.org/feature/vision."; - - private bool IsSupportedEngineType(string type) - { - bool isSupported = false; - - string featureType = _featurePath + type; - - bool ret = Information.TryGetValue(featureType, out isSupported); - - return (isSupported && ret) ? true : false; - } - - private bool IsSupportedEngineType(string type1, string type2) - { - return (IsSupportedEngineType(type1) && IsSupportedEngineType(type2)) ? true : false; - } - - internal EngineConfiguration(string engineType) - { - if (IsSupportedEngineType(engineType) == false) - { - throw new NotSupportedException($"{engineType} : Not Supported"); - } - - EngineConfig.Create(out _handle).Validate("Failed to create media vision engine."); - } - - internal EngineConfiguration(string engineType1, string engineType2) - { - - if (IsSupportedEngineType(engineType1, engineType2) == false) - { - throw new NotSupportedException($"{engineType1} or {engineType2} : Not Supported"); - } - - EngineConfig.Create(out _handle).Validate("Failed to create media vision engine."); - } - - ~EngineConfiguration() - { - Dispose(false); - } - - internal static IntPtr GetHandle(EngineConfiguration config) - { - if (config == null) - { - return IntPtr.Zero; - } - - if (config._disposed) - { - throw new ObjectDisposedException(config.GetType().Name); - } - - return config._handle; - } - - internal void Set(string key, double value) - { - EngineConfig.SetDouble(Handle, key, value).Validate("Failed to set attribute"); - } - - internal void Set(string key, int value) - { - 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"); - } - - internal void Set(string key, string value) - { - EngineConfig.SetString(Handle, key, value).Validate("Failed to set attribute"); - } - - internal int GetInt(string key) - { - int value = 0; - EngineConfig.GetInt(Handle, key, out value).Validate("Failed to get the value"); - return value; - } - - internal double GetDouble(string key) - { - double value = 0; - EngineConfig.GetDouble(Handle, key, out value).Validate("Failed to get the value"); - return value; - } - - internal bool GetBool(string key) - { - bool value = false; - EngineConfig.GetBool(Handle, key, out value).Validate("Failed to get the value"); - return value; - } - - internal string GetString(string key) - { - IntPtr ptr = IntPtr.Zero; - - try - { - EngineConfig.GetString(Handle, key, out ptr).Validate("Failed to get the value"); - return Marshal.PtrToStringAnsi(ptr); - } - finally - { - LibcSupport.Free(ptr); - } - } - - /// - /// Releases all resources used by the object. - /// - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - - /// - /// Releases the resources used by the object. - /// - /// - /// true to release both managed and unmanaged resources, otherwise false to release only unmanaged resources. - /// - protected virtual void Dispose(bool disposing) - { - if (_disposed) - { - return; - } - - EngineConfig.Destroy(_handle); - _disposed = true; - } - - internal IntPtr Handle - { - get - { - if (_disposed) - { - throw new ObjectDisposedException(nameof(EngineConfiguration)); - } - return _handle; - } - } - } -} diff --git a/src/Tizen.Multimedia.Vision/MediaVision/ErrorCorrectionLevel.cs b/src/Tizen.Multimedia.Vision/MediaVision/ErrorCorrectionLevel.cs deleted file mode 100755 index 5c285bedd..000000000 --- a/src/Tizen.Multimedia.Vision/MediaVision/ErrorCorrectionLevel.cs +++ /dev/null @@ -1,46 +0,0 @@ -/* - * 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. - */ - -namespace Tizen.Multimedia.Vision -{ - /// - /// Specifies the supported QR code error correction levels. - /// - /// 3 - public enum ErrorCorrectionLevel - { - /// - /// Recovery up to 7% losses. - /// - /// 3 - Low, - /// - /// Recovery up to 15% losses. - /// - /// 3 - Medium, - /// - /// Recovery up to 25% losses. - /// - /// 3 - Quartile, - /// - /// Recovery up to 30% losses. - /// - /// 3 - High - } -} diff --git a/src/Tizen.Multimedia.Vision/MediaVision/EyeCondition.cs b/src/Tizen.Multimedia.Vision/MediaVision/EyeCondition.cs deleted file mode 100755 index 03b7d3b9c..000000000 --- a/src/Tizen.Multimedia.Vision/MediaVision/EyeCondition.cs +++ /dev/null @@ -1,43 +0,0 @@ -/* - * 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. - */ - -namespace Tizen.Multimedia.Vision -{ - /// - /// Specifies the eyes state types. - /// - /// 3 - public enum EyeCondition - { - /// - /// Eyes are open. - /// - /// 3 - Open, - - /// - /// Eyes are closed. - /// - /// 3 - Closed, - - /// - /// The eyes condition wasn't determined. - /// - /// 3 - NotFound - } -} diff --git a/src/Tizen.Multimedia.Vision/MediaVision/FaceDetectionConfiguration.cs b/src/Tizen.Multimedia.Vision/MediaVision/FaceDetectionConfiguration.cs deleted file mode 100755 index b53b785b5..000000000 --- a/src/Tizen.Multimedia.Vision/MediaVision/FaceDetectionConfiguration.cs +++ /dev/null @@ -1,196 +0,0 @@ -/* - * 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.Multimedia.Vision -{ - /// - /// Represents a configuration of instances. - /// - /// 3 - public class FaceDetectionConfiguration : EngineConfiguration - { - private const string KeyModelFilePath = "MV_FACE_DETECTION_MODEL_FILE_PATH"; - private const string KeyRoiX = "MV_FACE_DETECTION_ROI_X"; - private const string KeyRoiY = "MV_FACE_DETECTION_ROI_Y"; - private const string KeyRoiWidth = "MV_FACE_DETECTION_ROI_WIDTH"; - private const string KeyRoiHeight = "MV_FACE_DETECTION_ROI_HEIGHT"; - private const string KeyMinWidth = "MV_FACE_DETECTION_MIN_SIZE_WIDTH"; - private const string KeyMinHeight = "MV_FACE_DETECTION_MIN_SIZE_HEIGHT"; - - /// - /// Initializes a new instance of the class. - /// - /// The feature is not supported. - /// 3 - public FaceDetectionConfiguration() : base("face_recognition") - { - } - - /// - /// Gets or sets the face detection haarcascade xml file for face detection. - /// - /// is null. - /// 3 - public string ModelFilePath - { - get - { - return GetString(KeyModelFilePath); - } - set - { - if (value == null) - { - throw new ArgumentNullException(nameof(ModelFilePath), "ModeFilePath can't be null."); - } - Set(KeyModelFilePath, value); - } - } - - - /// - /// Gets or sets the minimum height of a face which will be detected. - /// - /// - /// Default value is null (all detected faces will be applied), which can be changed to specify the minimum face height. - /// - /// is less than zero. - /// 3 - public int? MinHeight - { - get - { - int value = GetInt(KeyMinHeight); - if (value == -1) return null; - return value; - } - set - { - if (value.HasValue && value < 0) - { - throw new ArgumentOutOfRangeException(nameof(MinHeight), value, - $"{nameof(MinHeight)} can't be less than zero."); - } - - Set(KeyMinHeight, value ?? -1); - } - } - - /// - /// Gets or sets the minimum width of a face which will be detected. - /// - /// - /// Default value is null (all detected faces will be applied), which can be changed to specify the minimum face width. - /// - /// is less than zero. - /// 3 - public int? MinWidth - { - get - { - int value = GetInt(KeyMinWidth); - if (value == -1) return null; - return value; - } - set - { - if (value.HasValue && value < 0) - { - throw new ArgumentOutOfRangeException(nameof(MinWidth), value, - $"{nameof(MinWidth)} can't be less than zero."); - } - - Set(KeyMinWidth, value ?? -1); - } - } - - private static readonly Rectangle DefaultRoi = new Rectangle(-1, -1, -1, -1); - - private Rectangle? _roi; - - /// - /// Gets or sets the roi of the face detection. - /// - /// - /// Default value is null (the roi will be a full image), which can be changed to specify the roi for face detection. - /// - /// - /// The width of is less than or equal to zero.\n - /// -or-\n - /// The height of is less than or equal to zero.\n - /// -or-\n - /// The x position of is less than zero.\n - /// -or-\n - /// The y position of is less than zero.\n - /// - /// 3 - public Rectangle? Roi - { - get - { - return _roi; - } - set - { - if (value != null) - { - ValidateRoi(value.Value); - } - - SetRoi(value ?? DefaultRoi); - - _roi = value; - } - } - - private static void ValidateRoi(Rectangle roi) - { - if (roi.Width <= 0) - { - throw new ArgumentOutOfRangeException("Roi.Width", roi.Width, - "The width of roi can't be less than or equal to zero."); - } - - if (roi.Height <= 0) - { - throw new ArgumentOutOfRangeException("Roi.Height", roi.Height, - "The height of roi can't be less than or equal to zero."); - } - - if (roi.X < 0) - { - throw new ArgumentOutOfRangeException("Roi.X", roi.X, - "The x position of roi can't be less than zero."); - } - - if (roi.Y < 0) - { - throw new ArgumentOutOfRangeException("Roi.Y", roi.Y, - "The y position of roi can't be less than zero."); - } - } - - private void SetRoi(Rectangle roi) - { - Set(KeyRoiX, roi.X); - Set(KeyRoiY, roi.Y); - Set(KeyRoiWidth, roi.Width); - Set(KeyRoiHeight, roi.Height); - } - } -} diff --git a/src/Tizen.Multimedia.Vision/MediaVision/FaceDetector.cs b/src/Tizen.Multimedia.Vision/MediaVision/FaceDetector.cs deleted file mode 100755 index 592a48cf4..000000000 --- a/src/Tizen.Multimedia.Vision/MediaVision/FaceDetector.cs +++ /dev/null @@ -1,105 +0,0 @@ -/* - * 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.Threading.Tasks; -using InteropFace = Interop.MediaVision.Face; - -namespace Tizen.Multimedia.Vision -{ - /// - /// Provides the ability to detect faces on image sources. - /// - /// 3 - public static class FaceDetector - { - - /// - /// Detects faces on the source.\n - /// Each time when DetectAsync is called, a set of the detected faces at the media source are received asynchronously. - /// - /// The source of the media where faces will be detected. - /// A task that represents the asynchronous detect operation. - /// is null. - /// - /// The feature is not supported.\n - /// -or-\n - /// The format of is not supported. - /// - /// 3 - public static async Task DetectAsync(MediaVisionSource source) - { - return await DetectAsync(source, null); - } - - /// - /// Detects faces on the source.\n - /// Each time when DetectAsync is called, a set of the detected faces at the media source are received asynchronously. - /// - /// The source of the media where faces will be detected. - /// The configuration of engine will be used for detecting. This value can be null. - /// A task that represents the asynchronous detect operation. - /// is null. - /// The feature is not supported. - /// 3 - public static async Task DetectAsync(MediaVisionSource source, - FaceDetectionConfiguration config) - { - if (source == null) - { - throw new ArgumentNullException(nameof(source)); - } - - TaskCompletionSource tcs = new TaskCompletionSource(); - - using (var cb = ObjectKeeper.Get(GetCallback(tcs))) - { - InteropFace.Detect(source.Handle, EngineConfiguration.GetHandle(config), cb.Target). - Validate("Failed to perform face detection"); - - return await tcs.Task; - } - } - - private static InteropFace.DetectedCallback GetCallback(TaskCompletionSource tcs) - { - return (IntPtr sourceHandle, IntPtr engineConfig, global::Interop.MediaVision.Rectangle[] facesLocations, - int numberOfFaces, IntPtr _) => - { - try - { - Log.Info(MediaVisionLog.Tag, $"Faces detected, count : {numberOfFaces}."); - Rectangle[] locations = new Rectangle[numberOfFaces]; - for (int i = 0; i < numberOfFaces; i++) - { - locations[i] = facesLocations[i].ToApiStruct(); - Log.Info(MediaVisionLog.Tag, $"Face {0} detected : {locations}."); - } - - if (!tcs.TrySetResult(locations)) - { - Log.Error(MediaVisionLog.Tag, "Failed to set face detection result."); - } - } - catch (Exception e) - { - MultimediaLog.Info(MediaVisionLog.Tag, "Failed to handle face detection.", e); - tcs.TrySetException(e); - } - }; - } - } -} diff --git a/src/Tizen.Multimedia.Vision/MediaVision/FaceRecognitionConfiguration.cs b/src/Tizen.Multimedia.Vision/MediaVision/FaceRecognitionConfiguration.cs deleted file mode 100755 index 87c2618ee..000000000 --- a/src/Tizen.Multimedia.Vision/MediaVision/FaceRecognitionConfiguration.cs +++ /dev/null @@ -1,58 +0,0 @@ -/* - * 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.Multimedia.Vision -{ - /// - /// Represents a configuration of instances. - /// - /// 3 - public class FaceRecognitionConfiguration : EngineConfiguration - { - private const string KeyModelType = "MV_FACE_RECOGNITION_MODEL_TYPE"; - - /// - /// Initializes a new instance of the class. - /// - /// The feature is not supported. - /// 3 - public FaceRecognitionConfiguration() : base("face_recognition") - { - } - - /// - /// Gets or sets the method used for face recognition model learning. - /// Default value is . - /// - /// is not valid. - /// 3 - public FaceRecognitionModelType ModelType - { - get - { - return (FaceRecognitionModelType)GetInt(KeyModelType); - } - set - { - ValidationUtil.ValidateEnum(typeof(FaceRecognitionModelType), value); - Set(KeyModelType, (int)value); - } - } - - } -} diff --git a/src/Tizen.Multimedia.Vision/MediaVision/FaceRecognitionModel.cs b/src/Tizen.Multimedia.Vision/MediaVision/FaceRecognitionModel.cs deleted file mode 100755 index 20b727bff..000000000 --- a/src/Tizen.Multimedia.Vision/MediaVision/FaceRecognitionModel.cs +++ /dev/null @@ -1,310 +0,0 @@ -/* - * 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.IO; -using System.Runtime.InteropServices; -using InteropModel = Interop.MediaVision.FaceRecognitionModel; - -namespace Tizen.Multimedia.Vision -{ - /// - /// Represents the face recognition model interface. - /// - /// 3 - public class FaceRecognitionModel : IDisposable - { - private IntPtr _handle = IntPtr.Zero; - private bool _disposed = false; - - /// - /// Initializes a new instance of the class. - /// - /// The feature is not supported. - /// 3 - public FaceRecognitionModel() - { - InteropModel.Create(out _handle).Validate("Failed to create FaceRecognitionModel"); - } - - /// - /// Initializes a new instance of the class with the specified path. - /// - /// - /// Models saved by can be loaded. - /// - /// Path to the model to load. - /// is null. - /// is invalid. - /// - /// The feature is not supported.\n - /// -or-\n - /// is not supported format. - /// - /// No permission to access the specified file. - /// - /// 3 - public FaceRecognitionModel(string modelPath) - { - if (modelPath == null) - { - throw new ArgumentNullException(nameof(modelPath)); - } - - InteropModel.Load(modelPath, out _handle). - Validate("Failed to load FaceRecognitionModel from file"); - } - - ~FaceRecognitionModel() - { - Dispose(false); - } - - /// - /// Gets labels that had been learned by the model. - /// - /// 3 - public int[] Labels - { - get - { - IntPtr unmangedArray = IntPtr.Zero; - try - { - uint numOfLabels = 0; - - InteropModel.QueryLabels(Handle, out unmangedArray, out numOfLabels). - Validate("Failed to retrieve face labels."); - - int[] labels = new int[numOfLabels]; - Marshal.Copy(unmangedArray, labels, 0, (int)numOfLabels); - - return labels; - } - finally - { - if (unmangedArray != IntPtr.Zero) - { - LibcSupport.Free(unmangedArray); - } - } - } - } - - /// - /// Saves the recognition model to the file. - /// - /// 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 directory for does not exist. - /// 3 - public void Save(string path) - { - if (path == null) - { - throw new ArgumentNullException(nameof(path)); - } - - var ret = InteropModel.Save(path, Handle); - - if (ret == MediaVisionError.InvalidPath) - { - throw new DirectoryNotFoundException($"The directory for the path({path}) does not exist."); - } - - ret.Validate("Failed to save recognition model to file"); - } - - private MediaVisionError InvokeAdd(MediaVisionSource source, int label, Rectangle? area) - { - if (area != null) - { - var rect = area.Value.ToMarshalable(); - return InteropModel.Add(source.Handle, Handle, ref rect, label); - } - - return InteropModel.Add(source.Handle, Handle, IntPtr.Zero, label); - } - - /// - /// Adds the face image example to be used for face recognition model learning. - /// - /// The that contains face image. - /// The label that identifies face for which example is adding. - /// Specify the same labels for the face images of a single person when calling this method. - /// Has to be unique for each face. - /// is null. - /// - /// The has already been disposed of.\n - /// -or-\n - /// has already been dispose of. - /// - /// - /// 3 - public void Add(MediaVisionSource source, int label) - { - if (source == null) - { - throw new ArgumentNullException(nameof(source)); - } - - InvokeAdd(source, label, null).Validate("Failed to add face example image"); - } - - /// - /// Adds the face image example to be used for face recognition model learning. - /// - /// The that contains face image. - /// The label that identifies face for which example is adding. - /// Specify the same labels for the face images of a single person when calling this method. - /// Has to be unique for each face. - /// The rectangular region of the face image at the source image. - /// is null. - /// - /// The has already been disposed of.\n - /// -or-\n - /// has already been dispose of. - /// - /// - /// 3 - public void Add(MediaVisionSource source, int label, Rectangle area) - { - if (source == null) - { - throw new ArgumentNullException(nameof(source)); - } - - InvokeAdd(source, label, area).Validate("Failed to add face example image"); - } - - /// - /// Removes all face examples added with the specified label. - /// - /// The label that identifies face for which examples will be removed. - /// The has already been disposed of. - /// true if the examples are successfully removed; otherwise, false if there is no example labeled with the specified label. - /// - /// - /// 3 - public bool Remove(int label) - { - var ret = InteropModel.Remove(Handle, ref label); - - if (ret == MediaVisionError.KeyNotAvailable) - { - return false; - } - - ret.Validate("Failed to remove image example"); - return true; - } - - /// - /// Removes all face examples. - /// - /// The has already been disposed of. - /// 3 - public void Reset() - { - InteropModel.Reset(Handle).Validate("Failed to reset image example"); - } - - - /// - /// Learns the face recognition model. - /// - /// - /// Before you start the learning process, face recognition models have to be filled with the training data - face image examples. - /// These examples have to be provided by or . - /// Recognition accuracy is usually increased when the different examples of the identical faces are added more and more. - /// But it depends on the used learning algorithm. - /// - /// The has already been disposed of. - /// No examples added. - /// - /// - /// 3 - public void Learn() - { - Learn(null); - } - - /// - /// Learns the face recognition model with . - /// - /// - /// Before you start the learning process, face recognition models have to be filled with the training data - face image examples. - /// These examples have to be provided by or . - /// Recognition accuracy is usually increased when the different examples of the identical faces are added more and more. - /// But it depends on the used learning algorithm. - /// - /// The configuration used for learning of the recognition models. This value can be null. - /// - /// The has already been disposed of.\n - /// -or-\n - /// has already been disposed of. - /// - /// No examples added. - /// - /// - /// 3 - public void Learn(FaceRecognitionConfiguration config) - { - InteropModel.Learn(EngineConfiguration.GetHandle(config), Handle). - Validate("Failed to learn"); - } - - /// - /// Releases all the resources used by the object. - /// - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - - /// - /// Releases the resources used by the object. - /// - /// - /// true to release both managed and unmanaged resources; otherwise false to release only unmanaged resources. - /// - protected virtual void Dispose(bool disposing) - { - if (_disposed) - { - return; - } - - InteropModel.Destroy(_handle); - _disposed = true; - } - - internal IntPtr Handle - { - get - { - if (_disposed) - { - throw new ObjectDisposedException(nameof(FaceRecognitionModel)); - } - return _handle; - } - } - } -} diff --git a/src/Tizen.Multimedia.Vision/MediaVision/FaceRecognitionModelType.cs b/src/Tizen.Multimedia.Vision/MediaVision/FaceRecognitionModelType.cs deleted file mode 100755 index 2416b5d01..000000000 --- a/src/Tizen.Multimedia.Vision/MediaVision/FaceRecognitionModelType.cs +++ /dev/null @@ -1,43 +0,0 @@ -/* - * 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. - */ - -namespace Tizen.Multimedia.Vision -{ - /// - /// Specifies the face recognition model learning algorithms. - /// - /// 3 - public enum FaceRecognitionModelType - { - /// - /// Eigenfaces. - /// - /// 3 - EigenFaces = 1, - - /// - /// Fisherfaces. - /// - /// 3 - FisherFaces, - - /// - /// Local Binary Patterns Histograms (LBPH); The default type. - /// - /// 3 - Lbph - } -} diff --git a/src/Tizen.Multimedia.Vision/MediaVision/FaceRecognitionResult.cs b/src/Tizen.Multimedia.Vision/MediaVision/FaceRecognitionResult.cs deleted file mode 100755 index ef960c1f5..000000000 --- a/src/Tizen.Multimedia.Vision/MediaVision/FaceRecognitionResult.cs +++ /dev/null @@ -1,60 +0,0 @@ -/* - * 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. - */ - -namespace Tizen.Multimedia.Vision -{ - /// - /// Represents the result of operations. - /// - /// 3 - public class FaceRecognitionResult - { - internal FaceRecognitionResult(bool recognized, double confidence, int label, Rectangle? area) - { - Success = recognized; - Label = label; - Area = area; - Confidence = confidence; - } - - /// - /// Gets the value indicating the recognition is successful. - /// - /// 3 - public bool Success { get; } - - /// - /// Gets the label of the recognized face. - /// - /// 3 - public int Label { get; } - - /// - /// Gets the location of the recognized face. - /// - /// 3 - public Rectangle? Area { get; } - - /// - /// The confidence of the recognition model that face has been recognized correctly (value from 0.0 to 1.0). - /// No faces were recognized if confidence was 0.0. When model has been learned on large amount of examples, - /// threshold for this value can be high (0.85-0.95). If model was learned for small amount of examples, - /// then threshold can be reduced (0.5-0.85). - /// - /// 3 - public double Confidence { get; } - } -} diff --git a/src/Tizen.Multimedia.Vision/MediaVision/FaceRecognizer.cs b/src/Tizen.Multimedia.Vision/MediaVision/FaceRecognizer.cs deleted file mode 100755 index 034a846de..000000000 --- a/src/Tizen.Multimedia.Vision/MediaVision/FaceRecognizer.cs +++ /dev/null @@ -1,327 +0,0 @@ -/* - * 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; -using System.Threading.Tasks; -using InteropFace = Interop.MediaVision.Face; - -namespace Tizen.Multimedia.Vision -{ - /// - /// Provides the ability to recognize faces, face expressions, and eye condition on image sources. - /// - /// 3 - public static class FaceRecognizer - { - - /// - /// Performs face recognition on the source with . - /// - /// The of the media to recognize faces for. - /// The to be used for recognition. - /// A task that represents the asynchronous recognition operation. - /// - /// is null.\n - /// -or-\n - /// is null. - /// - /// The feature is not supported. - /// has already been disposed of. - /// is untrained model. - /// 3 - public static async Task RecognizeAsync(MediaVisionSource source, - FaceRecognitionModel recognitionModel) - { - return await InvokeRecognizeAsync(source, recognitionModel, null, null); - } - - /// - /// Performs face recognition on the source with and a bounding box. - /// - /// The of the media to recognize faces for. - /// The to be used for recognition. - /// Rectangular box bounding face image on the source. - /// A task that represents the asynchronous recognition operation. - /// - /// is null.\n - /// -or-\n - /// is null. - /// - /// The feature is not supported. - /// has already been disposed of. - /// is untrained model. - /// 3 - public static async Task RecognizeAsync(MediaVisionSource source, - FaceRecognitionModel recognitionModel, Rectangle bound) - { - return await InvokeRecognizeAsync(source, recognitionModel, bound, null); - } - - /// - /// Performs face recognition on the source with and . - /// - /// The of the media to recognize faces for. - /// The to be used for recognition. - /// The configuration used for recognition. This value can be null. - /// A task that represents the asynchronous recognition operation. - /// - /// is null.\n - /// -or-\n - /// is null. - /// - /// The feature is not supported. - /// - /// has already been disposed of.\n - /// -or-\n - /// has already been disposed of. - /// - /// is untrained model. - /// 3 - public static async Task RecognizeAsync(MediaVisionSource source, - FaceRecognitionModel recognitionModel, FaceRecognitionConfiguration config) - { - return await InvokeRecognizeAsync(source, recognitionModel, null, config); - } - - - /// - /// Performs face recognition on the source with , - /// and a bounding box. - /// - /// The of the media to recognize faces for. - /// The to be used for recognition. - /// Rectangular box bounding face image on the source. - /// The used for recognition. This value can be null. - /// A task that represents the asynchronous recognition operation. - /// - /// is null.\n - /// -or-\n - /// is null. - /// - /// The feature is not supported. - /// - /// has already been disposed of.\n - /// -or-\n - /// has already been disposed of. - /// - /// is untrained model. - /// 3 - public static async Task RecognizeAsync(MediaVisionSource source, - FaceRecognitionModel recognitionModel, Rectangle bound, FaceRecognitionConfiguration config) - { - return await InvokeRecognizeAsync(source, recognitionModel, bound, config); - } - - private static MediaVisionError InvokeRecognize(IntPtr sourceHandle, IntPtr modelHandle, - IntPtr configHandle, InteropFace.RecognizedCallback cb, Rectangle? area) - { - if (area == null) - { - return InteropFace.Recognize(sourceHandle, modelHandle, configHandle, IntPtr.Zero, cb); - } - - var rect = area.Value.ToMarshalable(); - return InteropFace.Recognize(sourceHandle, modelHandle, configHandle, ref rect, cb); - } - - private static async Task InvokeRecognizeAsync(MediaVisionSource source, - FaceRecognitionModel recognitionModel, Rectangle? area, - FaceRecognitionConfiguration config) - { - if (source == null) - { - throw new ArgumentNullException(nameof(source)); - } - if (recognitionModel == null) - { - throw new ArgumentNullException(nameof(recognitionModel)); - } - - TaskCompletionSource tcs = new TaskCompletionSource(); - - using (var cb = ObjectKeeper.Get(GetRecognizedCallback(tcs))) - { - InvokeRecognize(source.Handle, recognitionModel.Handle, EngineConfiguration.GetHandle(config), - cb.Target, area).Validate("Failed to perform face recognition."); - - return await tcs.Task; - } - } - - private static FaceRecognitionResult CreateRecognitionResult( - IntPtr faceLocationPtr, IntPtr faceLabelPtr, double confidence) - { - int faceLabel = 0; - if (faceLabelPtr != IntPtr.Zero) - { - faceLabel = Marshal.ReadInt32(faceLabelPtr); - } - - Rectangle? faceLocation = null; - if (faceLocationPtr != IntPtr.Zero) - { - var area = Marshal.PtrToStructure(faceLocationPtr); - faceLocation = area.ToApiStruct(); - } - - return new FaceRecognitionResult(faceLabelPtr != IntPtr.Zero, confidence, faceLabel, faceLocation); - } - - private static InteropFace.RecognizedCallback GetRecognizedCallback( - TaskCompletionSource tcs) - { - return (IntPtr sourceHandle, IntPtr recognitionModelHandle, - IntPtr engineCfgHandle, IntPtr faceLocationPtr, IntPtr faceLabelPtr, double confidence, IntPtr _) => - { - try - { - if (!tcs.TrySetResult(CreateRecognitionResult(faceLocationPtr, faceLabelPtr, confidence))) - { - Log.Error(MediaVisionLog.Tag, "Failed to set result"); - } - } - catch (Exception e) - { - MultimediaLog.Error(MediaVisionLog.Tag, "Setting recognition result failed.", e); - tcs.TrySetException(e); - } - }; - } - - /// - /// Determines eye-blink condition on media source. - /// - /// The source of the media to recognize eye-blink condition for. - /// The bounding the face at the source. - /// A task that represents the asynchronous recognition operation. - /// is null. - /// has already been disposed of. - /// The feature is not supported. - /// 3 - public static async Task RecognizeEyeConditionAsync(MediaVisionSource source, - Rectangle bound) - { - return await RecognizeEyeConditionAsync(source, bound, null); - } - - /// - /// Determines eye-blink condition on the media source. - /// - /// The source of the media to recognize eye-blink condition for. - /// The bounding the face at the source. - /// The configuration used for eye-blink condition recognition. This value can be null. - /// A task that represents the asynchronous recognition operation. - /// is null. - /// - /// has already been disposed of.\n - /// -or-\n - /// has already been disposed of. - /// - /// The feature is not supported. - /// 3 - public static async Task RecognizeEyeConditionAsync(MediaVisionSource source, - Rectangle bound, FaceRecognitionConfiguration config) - { - if (source == null) - { - throw new ArgumentNullException(nameof(source)); - } - - TaskCompletionSource tcs = new TaskCompletionSource(); - - InteropFace.EyeConditionRecognizedCallback cb = (IntPtr sourceHandle, IntPtr engineCfgHandle, - global::Interop.MediaVision.Rectangle faceLocation, EyeCondition eyeCondition, IntPtr _) => - { - Log.Info(MediaVisionLog.Tag, $"Eye condition recognized, eye condition : {eyeCondition}"); - if (!tcs.TrySetResult(eyeCondition)) - { - Log.Error(MediaVisionLog.Tag, "Failed to set eye condition result"); - } - }; - - using (var cbKeeper = ObjectKeeper.Get(cb)) - { - InteropFace.RecognizeEyeCondition(source.Handle, EngineConfiguration.GetHandle(config), - bound.ToMarshalable(), cb).Validate("Failed to perform eye condition recognition."); - - return await tcs.Task; - } - } - - /// - /// Determines facial expression on media source. - /// - /// The source of the media to recognize facial expression for. - /// The location bounding the face at the source. - /// A task that represents the asynchronous recognition operation. - /// is null. - /// has already been disposed of. - /// The feature is not supported. - /// 3 - public static async Task RecognizeFacialExpressionAsync(MediaVisionSource source, - Rectangle bound) - { - return await RecognizeFacialExpressionAsync(source, bound, null); - } - - /// - /// Determines facial expression on media source. - /// - /// The source of the media to recognize facial expression for. - /// The location bounding the face at the source. - /// The configuration used for expression recognition. This value can be null. - /// A task that represents the asynchronous recognition operation. - /// is null. - /// - /// has already been disposed of.\n - /// -or-\n - /// has already been disposed of. - /// - /// The feature is not supported. - /// 3 - public static async Task RecognizeFacialExpressionAsync(MediaVisionSource source, - Rectangle bound, FaceRecognitionConfiguration config) - { - if (source == null) - { - throw new ArgumentNullException(nameof(source)); - } - - TaskCompletionSource tcsResult = new TaskCompletionSource(); - - InteropFace.MvFaceFacialExpressionRecognizedCallback cb = (IntPtr sourceHandle, IntPtr engineCfgHandle, - global::Interop.MediaVision.Rectangle faceLocation, FacialExpression facialExpression, IntPtr _) => - { - Log.Info(MediaVisionLog.Tag, $"Facial expression recognized, expression : {facialExpression}"); - if (!tcsResult.TrySetResult(facialExpression)) - { - Log.Error(MediaVisionLog.Tag, "Failed to set facial result"); - } - }; - - using (var cbKeeper = ObjectKeeper.Get(cb)) - { - InteropFace.RecognizeFacialExpression(source.Handle, EngineConfiguration.GetHandle(config), - bound.ToMarshalable(), cb). - Validate("Failed to perform facial expression recognition."); - - return await tcsResult.Task; - } - } - } -} - diff --git a/src/Tizen.Multimedia.Vision/MediaVision/FaceTracker.cs b/src/Tizen.Multimedia.Vision/MediaVision/FaceTracker.cs deleted file mode 100755 index 33c7cfc54..000000000 --- a/src/Tizen.Multimedia.Vision/MediaVision/FaceTracker.cs +++ /dev/null @@ -1,104 +0,0 @@ -/* - * 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; -using System.Threading.Tasks; -using InteropFace = Interop.MediaVision.Face; - -namespace Tizen.Multimedia.Vision -{ - /// - /// Provides the ability to track faces on image sources. - /// - /// 3 - public static class FaceTracker - { - - /// - /// Performs face tracking on the source with the trackingModel. - /// - /// The source of the media to recognize face for. - /// The model will be used for tracking. - /// The value indicating whether model learning while tracking. If it is true, then the model will try to learn - /// (if it supports learning feature), otherwise the model will be not learned during the invoking tracking iteration. - /// Learning process improves tracking correctness, but can decrease tracking performance. - /// A task that represents the asynchronous tracking operation. - /// - /// is null.\n - /// -or-\n - /// is null. - /// - /// - /// has already been disposed of.\n - /// -or-\n - /// has already been disposed of. - /// - /// The feature is not supported. - /// is not prepared. - /// 3 - public static async Task TrackAsync(MediaVisionSource source, - FaceTrackingModel trackingModel, bool doLearn) - { - if (source == null) - { - throw new ArgumentNullException(nameof(source)); - } - if (trackingModel == null) - { - throw new ArgumentNullException(nameof(trackingModel)); - } - - TaskCompletionSource tcs = new TaskCompletionSource(); - - using (var cb = ObjectKeeper.Get(GetTrackCallback(tcs))) - { - InteropFace.Track(source.Handle, trackingModel.Handle, IntPtr.Zero, - cb.Target, doLearn).Validate("Failed to perform face tracking."); - - return await tcs.Task; - } - } - - private static InteropFace.TrackedCallback GetTrackCallback(TaskCompletionSource tcs) - { - return (IntPtr sourceHandle, IntPtr trackingModelHandle, IntPtr engineCfgHandle, - IntPtr locationPtr, double confidence, IntPtr _) => - { - try - { - Quadrangle area = null; - if (locationPtr != IntPtr.Zero) - { - area = Marshal.PtrToStructure(locationPtr).ToApiStruct(); - } - - Log.Info(MediaVisionLog.Tag, $"Tracked area : {area}, confidence : {confidence}"); - - if (!tcs.TrySetResult(new FaceTrackingResult(locationPtr != IntPtr.Zero, confidence, area))) - { - Log.Error(MediaVisionLog.Tag, "Failed to set tracking result"); - } - } - catch (Exception e) - { - MultimediaLog.Error(MediaVisionLog.Tag, "Setting tracking result failed.", e); - tcs.TrySetException(e); - } - }; - } - } -} diff --git a/src/Tizen.Multimedia.Vision/MediaVision/FaceTrackingModel.cs b/src/Tizen.Multimedia.Vision/MediaVision/FaceTrackingModel.cs deleted file mode 100755 index 66539217b..000000000 --- a/src/Tizen.Multimedia.Vision/MediaVision/FaceTrackingModel.cs +++ /dev/null @@ -1,182 +0,0 @@ -/* - * 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.IO; -using InteropModel = Interop.MediaVision.FaceTrackingModel; - -namespace Tizen.Multimedia.Vision -{ - /// - /// Represents the face tracking model. - /// - /// 3 - public class FaceTrackingModel : IDisposable - { - private IntPtr _handle = IntPtr.Zero; - private bool _disposed = false; - - /// - /// Initializes a new instance of the class. - /// - /// The feature is not supported. - /// 3 - public FaceTrackingModel() - { - InteropModel.Create(out _handle).Validate("Failed to create FaceTrackingModel."); - } - - /// - /// Initializes a new instance of the class with the specified path. - /// - /// - /// Models saved by can be loaded. - /// - /// Path to the model to load. - /// is null. - /// is invalid. - /// - /// The feature is not supported.\n - /// -or-\n - /// is not supported format. - /// - /// No permission to access the specified file. - /// - /// 3 - public FaceTrackingModel(string modelPath) - { - if (modelPath == null) - { - throw new ArgumentNullException(nameof(modelPath)); - } - InteropModel.Load(modelPath, out _handle).Validate("Failed to load FaceTrackingModel from file."); - } - - ~FaceTrackingModel() - { - Dispose(false); - } - - private MediaVisionError InvokePrepare(MediaVisionSource source, Quadrangle region) - { - if (region != null) - { - var quad = region.ToMarshalable(); - return InteropModel.Prepare(Handle, IntPtr.Zero, source.Handle, ref quad); - } - - return InteropModel.Prepare(Handle, IntPtr.Zero, source.Handle, IntPtr.Zero); - } - - /// - /// Initializes the tracking model by the location of the face to be tracked. - /// - /// It is usually called once after the tracking model is created, and each time before tracking - /// is started for the new sequence of sources, which is not the direct continuation of - /// the sequence for which tracking has been performed before. But, it is allowed to call it - /// between tracking sessions to allow Media Vision start to track more accurately. - /// - /// - /// needs to be the position of the face to be tracked when called first time for the tracking model. - /// is fitted to the valid region of if has invalid points. - /// - /// The source where face location is specified. - /// Usually it is the first frame of the video or the first image in the continuous - /// image sequence planned to be used for tracking. - /// The region determining position of the face to be tracked on the source. - /// If null, then tracking model will try to find previously tracked face by itself. - /// is null. - /// - /// The has already been disposed of.\n - /// -or-\n - /// has already bean disposed of. - /// - /// 3 - public void Prepare(MediaVisionSource source, Quadrangle region) - { - if (source == null) - { - throw new ArgumentNullException(nameof(source)); - } - - InvokePrepare(source, region).Validate("Failed to prepare tracking model."); - } - - /// - /// Saves the tracking model to the file. - /// - /// 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 directory for does not exist. - /// 3 - public void Save(string path) - { - if (path == null) - { - throw new ArgumentNullException(nameof(path)); - } - - var ret = InteropModel.Save(path, Handle); - - if (ret == MediaVisionError.InvalidPath) - { - throw new DirectoryNotFoundException($"The directory for the path({path}) does not exist."); - } - - ret.Validate("Failed to save tracking model to file"); - } - - /// - /// Releases all the resources used by the object. - /// - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - - /// - /// Releases the resources used by the object. - /// - /// - /// true to release both managed and unmanaged resources; otherwise false to release only unmanaged resources. - /// - protected virtual void Dispose(bool disposing) - { - if (_disposed) - { - return; - } - - InteropModel.Destroy(_handle); - _disposed = true; - } - - internal IntPtr Handle - { - get - { - if (_disposed) - { - throw new ObjectDisposedException(nameof(FaceTrackingModel)); - } - return _handle; - } - } - } -} diff --git a/src/Tizen.Multimedia.Vision/MediaVision/FaceTrackingResult.cs b/src/Tizen.Multimedia.Vision/MediaVision/FaceTrackingResult.cs deleted file mode 100755 index 9c86e947f..000000000 --- a/src/Tizen.Multimedia.Vision/MediaVision/FaceTrackingResult.cs +++ /dev/null @@ -1,51 +0,0 @@ -/* - * 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. - */ - -namespace Tizen.Multimedia.Vision -{ - /// - /// Represents the result of face tracking operation. - /// - /// 3 - public class FaceTrackingResult - { - internal FaceTrackingResult(bool success, double confidence, Quadrangle region) - { - Success = success; - Confidence = confidence; - Region = region; - } - - /// - /// Gets the value indicating the recognition is successful. - /// - /// 3 - public bool Success { get; } - - /// - /// Gets the region which determines the new position of the tracked face on the source. - /// - /// 3 - public Quadrangle Region { get; } - - /// - /// The confidence of the tracking model that a new location of the face was determined correctly - /// (value from 0.0 to 1.0). If no location was determined during the last track iteration, then the value is 0.0. - /// - /// 3 - public double Confidence { get; } - } -} diff --git a/src/Tizen.Multimedia.Vision/MediaVision/FacialExpression.cs b/src/Tizen.Multimedia.Vision/MediaVision/FacialExpression.cs deleted file mode 100755 index 81dc2729c..000000000 --- a/src/Tizen.Multimedia.Vision/MediaVision/FacialExpression.cs +++ /dev/null @@ -1,73 +0,0 @@ -/* - * 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. - */ - -namespace Tizen.Multimedia.Vision -{ - /// - /// Specifies the expression types for faces. - /// - /// 3 - public enum FacialExpression - { - /// - /// Unknown face expression. - /// - /// 3 - Unknown, - - /// - /// Face expression is neutral. - /// - /// 3 - Neutral, - - /// - /// Face expression is smiling. - /// - /// 3 - Smile, - - /// - /// Face expression is sadness. - /// - /// 3 - Sadness, - - /// - /// Face expression is surprise. - /// - /// 3 - Surprise, - - /// - /// Face expression is anger. - /// - /// 3 - Anger, - - /// - /// Face expression is fear. - /// - /// 3 - Fear, - - /// - /// Face expression is disgust. - /// - /// 3 - Disgust - } -} diff --git a/src/Tizen.Multimedia.Vision/MediaVision/ImageFillConfiguration.cs b/src/Tizen.Multimedia.Vision/MediaVision/ImageFillConfiguration.cs deleted file mode 100755 index 2eabbb5cc..000000000 --- a/src/Tizen.Multimedia.Vision/MediaVision/ImageFillConfiguration.cs +++ /dev/null @@ -1,90 +0,0 @@ -/* - * 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.Multimedia.Vision -{ - /// - /// Represents a configuration of fill operations of instances. - /// - /// 3 - public class ImageFillConfiguration : EngineConfiguration - { - private const string KeyScaleFactor = "MV_IMAGE_RECOGNITION_OBJECT_SCALE_FACTOR"; - private const string KeyMaxKeypoints = "MV_IMAGE_RECOGNITION_OBJECT_MAX_KEYPOINTS_NUM"; - - /// - /// A read-only field that represents the default value of . - /// - /// 3 - public static readonly double DefaultScaleFactor = 1.2; - - /// - /// A read-only field that represents the default value of . - /// - /// 3 - public static readonly int DefaultMaxKeypoints = 1000; - - /// - /// Initializes a new instance of the class. - /// - /// The feature is not supported. - /// 3 - public ImageFillConfiguration() : base("image_recognition") - { - } - - /// - /// Gets or sets the scale factor the image to be recognized.\n - /// The value of the factor will be used for resizing of the images (objects) for recognition. - /// The default value is 1.2. - /// - /// The already has been disposed of. - /// 3 - public double ObjectScaleFactor - { - get - { - return GetDouble(KeyScaleFactor); - } - set - { - Set(KeyScaleFactor, value); - } - } - - /// - /// Gets or sets the maximum key points should be detected on the image.\n - /// The maximal number of key points can be selected on the image object to calculate descriptors. - /// This key points will be used for image (object) recognition and has to be specified as integer number. - /// The default value is 1000. - /// - /// The already has been disposed of. - /// 3 - public int ObjectMaxKeyPoints - { - get - { - return GetInt(KeyMaxKeypoints); - } - set - { - Set(KeyMaxKeypoints, value); - } - } - } -} diff --git a/src/Tizen.Multimedia.Vision/MediaVision/ImageObject.cs b/src/Tizen.Multimedia.Vision/MediaVision/ImageObject.cs deleted file mode 100755 index ab0b6d9b3..000000000 --- a/src/Tizen.Multimedia.Vision/MediaVision/ImageObject.cs +++ /dev/null @@ -1,300 +0,0 @@ -/* - * 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.IO; -using InteropImage = Interop.MediaVision.Image; - -namespace Tizen.Multimedia.Vision -{ - /// - /// Represents an image object. - /// - /// 3 - public class ImageObject : IDisposable - { - private IntPtr _handle = IntPtr.Zero; - private bool _disposed = false; - - /// - /// Initializes a new instance of the class. - /// - /// The feature is not supported. - /// 3 - public ImageObject() - { - InteropImage.Create(out _handle).Validate("Failed to create image object"); - } - - /// - /// Initializes a new instance of the class from the specified file. - /// - /// - /// ImageObject has been saved by can be loaded. - /// - /// Path to the image object to load. - /// is null. - /// is invalid. - /// - /// The feature is not supported.\n - /// -or-\n - /// is not supported file. - /// - /// No permission to access the specified file. - /// - /// 3 - public ImageObject(string path) - { - if (path == null) - { - throw new ArgumentNullException(nameof(path)); - } - InteropImage.Load(path, out _handle).Validate("Failed to load image object from file"); - } - - ~ImageObject() - { - Dispose(false); - } - - /// - /// Gets a value that determines how well an image object can be recognized. - /// - /// - /// If recognition rate is too low, try to use another image or change some configuration parameters - /// and fill the image object again. - /// - /// - /// Recognition rate determines how well an image object can be recognized. This value can be from 0 to 1. - /// If the recognition rate is 0 object can not be recognized and the bigger it is the more likely to recognize the object. - /// - /// The has already been disposed of. - /// - /// - /// - /// - /// - /// 3 - public double RecognitionRate - { - get - { - InteropImage.GetRecognitionRate(Handle, out var rate).Validate("Failed to get recognition rate"); - return rate; - } - } - - #region Methods - /// - /// Gets the label for the image object. - /// - /// - /// The label value if the has label, otherwise null. - /// - /// The has already been disposed of. - /// - /// 3 - public int? GetLabel() - { - var ret = InteropImage.GetLabel(Handle, out var label); - - if (ret == MediaVisionError.NoData) - { - return null; - } - - ret.Validate("Failed to get label"); - return label; - } - - /// - /// Sets the label for the . - /// - /// - /// 3 - public void SetLabel(int label) - { - InteropImage.SetLabel(Handle, label).Validate("Failed to set label"); - } - - /// - /// Fills the image object.\n - /// Extracts data from @a source image which will be needed for recognition of depicted object in @a location. - /// - /// The source image where image object is depicted. - /// is null. - /// - /// The has already been disposed of.\n - /// -or-\n - /// has already been disposed of. - /// - /// 3 - public void Fill(MediaVisionSource source) - { - InvokeFill(source, null, null); - } - - /// - /// Fills the image object.\n - /// Extracts data from @a source image which will be needed for recognition of depicted object in @a location. - /// - /// The source image where image object is depicted. - /// The configuration used for extract recognition data from source. This value can be null. - /// is null. - /// - /// The has already been disposed of.\n - /// -or-\n - /// has already been disposed of.\n - /// -or-\n - /// has already been disposed of. - /// - /// 3 - public void Fill(MediaVisionSource source, ImageFillConfiguration config) - { - InvokeFill(source, config, null); - } - - /// - /// Fills the image object.\n - /// Extracts data from @a source image which will be needed for recognition of depicted object in @a location. - /// - /// The source image where image object is depicted. - /// Rectangular bound of the image object on the source image. - /// is null. - /// - /// The has already been disposed of.\n - /// -or-\n - /// has already been disposed of.\n - /// - /// 3 - public void Fill(MediaVisionSource source, Rectangle rect) - { - InvokeFill(source, null, rect); - } - - /// - /// Fills the image object.\n - /// Extracts data from @a source image which will be needed for recognition of depicted object in @a location. - /// - /// The source image where image object is depicted. - /// The configuration used for extract recognition data from source. This value can be null. - /// Rectangular bound of the image object on the source image. - /// is null. - /// - /// The has already been disposed of.\n - /// -or-\n - /// has already been disposed of.\n - /// -or-\n - /// has already been disposed of. - /// - /// 3 - public void Fill(MediaVisionSource source, ImageFillConfiguration config, Rectangle rect) - { - InvokeFill(source, config, rect); - } - - private MediaVisionError InvokeFill(IntPtr source, IntPtr config, Rectangle? area) - { - if (area == null) - { - return InteropImage.Fill(Handle, config, source, IntPtr.Zero); - } - - var rect = area.Value.ToMarshalable(); - - return InteropImage.Fill(Handle, config, source, ref rect); - } - - private void InvokeFill(MediaVisionSource source, ImageFillConfiguration config, Rectangle? area) - { - if (source == null) - { - throw new ArgumentNullException(nameof(source)); - } - - InvokeFill(source.Handle, EngineConfiguration.GetHandle(config), area). - Validate("Failed to fill the image object"); - } - - /// - /// Saves the image object. - /// - /// 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 directory for does not exist. - /// 3 - public void Save(string path) - { - if (path == null) - { - throw new ArgumentNullException(nameof(path)); - } - - var ret = InteropImage.Save(path, Handle); - - if (ret == MediaVisionError.InvalidPath) - { - throw new DirectoryNotFoundException($"The directory for the path({path}) does not exist."); - } - - ret.Validate("Failed to save the image object"); - } - #endregion - - #region IDisposable-support - - /// - /// Releases all the resources used by the object. - /// - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - - /// - /// Releases the resources used by the object. - /// - /// - /// true to release both managed and unmanaged resources; otherwise false to release only unmanaged resources. - /// - protected virtual void Dispose(bool disposing) - { - if (_disposed) - { - return; - } - - InteropImage.Destroy(_handle); - _disposed = true; - } - - internal IntPtr Handle - { - get - { - if (_disposed) - { - throw new ObjectDisposedException(nameof(ImageObject)); - } - return _handle; - } - } - #endregion - } -} diff --git a/src/Tizen.Multimedia.Vision/MediaVision/ImageRecognitionConfiguration.cs b/src/Tizen.Multimedia.Vision/MediaVision/ImageRecognitionConfiguration.cs deleted file mode 100755 index f8647e5df..000000000 --- a/src/Tizen.Multimedia.Vision/MediaVision/ImageRecognitionConfiguration.cs +++ /dev/null @@ -1,214 +0,0 @@ -/* - * 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.Multimedia.Vision -{ - /// - /// Represents a configuration of . - /// - /// 3 - public class ImageRecognitionConfiguration : EngineConfiguration - { - private const string KeySceneScaleFactor = "MV_IMAGE_RECOGNITION_SCENE_SCALE_FACTOR"; - private const string KeySceneMaxKeypoints = "MV_IMAGE_RECOGNITION_SCENE_MAX_KEYPOINTS_NUM"; - - private const string KeyMinKeypointsMatch = "MV_IMAGE_RECOGNITION_MIN_MATCH_NUM"; - private const string KeyReqMatchPartKey = "MV_IMAGE_RECOGNITION_REQ_MATCH_PART"; - private const string KeyTolerantPartMatchingError = "MV_IMAGE_RECOGNITION_TOLERANT_MATCH_PART_ERR"; - - /// - /// A read-only field that represents the default value of . - /// - /// 3 - public static readonly double DefaultSceneScaleFactor = 1.2; - - /// - /// A read-only field that represents the default value of . - /// - /// 3 - public static readonly int DefaultSceneMaxKeypoints = 5000; - - /// - /// A read-only field that represents the default value of . - /// - /// 3 - public static readonly int DefaultMinKeyPointMatches = 30; - - /// - /// A read-only field that represents the default value of . - /// - /// 3 - public static readonly double DefaultRequiredMatchPart = 0.05; - - /// - /// A read-only field that represents the default value of . - /// - /// 3 - public static readonly double DefaultTolerantPartMatchError = 0.1; - - /// - /// Initializes a new instance of the class. - /// - /// The feature is not supported. - /// 3 - public ImageRecognitionConfiguration() : base("image_recognition") - { - } - - /// - /// Gets or sets the scene scale factor. - /// - /// - /// The value indicating the factor will be used for resizing of the scene including the images (objects) for recognition. - /// The default is 1.2. - /// - /// The already has been disposed of. - /// 3 - public double SceneScaleFactor - { - get - { - return GetDouble(KeySceneScaleFactor); - } - set - { - Set(KeySceneScaleFactor, value); - } - } - - /// - /// Gets or sets the maximum key points that should be detected on the scene. - /// The maximal number of key points can be selected on the scene including the images (objects) to calculate descriptors. - /// - /// - /// The maximal key points for image recognition. - /// The default is 5000. - /// - /// The already has been disposed of. - /// is less than zero. - /// 3 - public int SceneMaxKeyPoints - { - get - { - return GetInt(KeySceneMaxKeypoints); - } - set - { - if (value < 0) - { - throw new ArgumentOutOfRangeException(nameof(SceneMaxKeyPoints), value, - $"{nameof(SceneMaxKeyPoints)} can't be less than zero."); - } - Set(KeySceneMaxKeypoints, value); - } - } - - /// - /// Gets or sets the minimum number of key points matches required for recognition. - /// - /// - /// The minimal number of key points should be matched between an image and a scene for image objects recognition. - /// The default is 30. - /// - /// The already has been disposed of. - /// is less than zero. - /// 3 - public int MinKeyPointMatches - { - get - { - return GetInt(KeyMinKeypointsMatch); - } - set - { - if (value < 0) - { - throw new ArgumentOutOfRangeException(nameof(MinKeyPointMatches), value, - $"{nameof(MinKeyPointMatches)} can't be less than zero."); - } - Set(KeyMinKeypointsMatch, value); - } - } - - /// - /// Gets or sets the required matching part for the image recognition. - /// To recognize occluded or hidden an image by other images, required relative part of the matches in respect to the total - /// amount of matching keypoints required for image recognition. Too low value will result in unsustainable behavior, - /// but the effect of object overlapping will be reduced. - /// - /// - /// The value indicating required relative part of the matches; can be from 0 to 1, inclusive. - /// The default is 0.05. - /// - /// The already has been disposed of. - /// - /// is less than zero.\n - /// -or-\n - /// is greater than one. - /// - /// 3 - public double RequiredMatchingPart - { - get - { - return GetDouble(KeyReqMatchPartKey); - } - set - { - if (value < 0 || value > 1) - { - throw new ArgumentOutOfRangeException(nameof(value), value, "Valid range is 0 to 1 inclusive,"); - } - Set(KeyReqMatchPartKey, value); - } - } - - /// - /// Gets or sets the part matching error for the image recognition.\n - /// Allowable error of matches number. - /// - /// - /// The value indicating allowable error of matches; can be from 0 to 1, inclusive. - /// The default is 0.1. - /// - /// The already has been disposed of. - /// - /// is less than zero.\n - /// -or-\n - /// is greater than one. - /// - /// 3 - public double TolerantPartMatchError - { - get - { - return GetDouble(KeyTolerantPartMatchingError); - } - set - { - if (value < 0 || value > 1) - { - throw new ArgumentOutOfRangeException(nameof(value), value, "Valid range is 0 to 1 inclusive."); - } - - Set(KeyTolerantPartMatchingError, value); - } - } - } -} diff --git a/src/Tizen.Multimedia.Vision/MediaVision/ImageRecognitionResult.cs b/src/Tizen.Multimedia.Vision/MediaVision/ImageRecognitionResult.cs deleted file mode 100755 index 5e13c4634..000000000 --- a/src/Tizen.Multimedia.Vision/MediaVision/ImageRecognitionResult.cs +++ /dev/null @@ -1,44 +0,0 @@ -/* - * 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. - */ - -namespace Tizen.Multimedia.Vision -{ - /// - /// Represents a result of RecognizeAsync operations of . - /// - /// 3 - public class ImageRecognitionResult - { - - internal ImageRecognitionResult(bool success, Quadrangle region) - { - Success = success; - Region = region; - } - - /// - /// The region of recognized image object on the source image. - /// - /// 3 - public Quadrangle Region { get; } - - /// - /// Gets the value indicating the recognition is successful. - /// - /// 3 - public bool Success { get; } - } -} diff --git a/src/Tizen.Multimedia.Vision/MediaVision/ImageRecognizer.cs b/src/Tizen.Multimedia.Vision/MediaVision/ImageRecognizer.cs deleted file mode 100755 index b96228572..000000000 --- a/src/Tizen.Multimedia.Vision/MediaVision/ImageRecognizer.cs +++ /dev/null @@ -1,156 +0,0 @@ -/* - * 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.Collections.Generic; -using System.Runtime.InteropServices; -using System.Threading.Tasks; -using InteropImage = Interop.MediaVision.Image; - -namespace Tizen.Multimedia.Vision -{ - /// - /// Provides the ability to recognize images on image sources. - /// - /// 3 - public static class ImageRecognizer - { - /// - /// Recognizes the given image objects on the source image.\n - /// - /// The source image on which image objects will be recognized. - /// The array of image objects which will be processed as targets of recognition. - /// A task that represents the asynchronous recognition operation. - /// - /// is null.\n - /// -or-\n - /// is null.\n - /// -or-\n - /// contains null reference. - /// - /// has no elements.(The length is zero.) - /// The feature is not supported. - /// has already been disposed of. - /// 3 - public static async Task> RecognizeAsync( - MediaVisionSource source, ImageObject[] imageObjects) - { - return await RecognizeAsync(source, imageObjects, null); - } - - /// - /// Recognizes the given image objects on the source image.\n - /// - /// The source image on which image objects will be recognized. - /// The array of image objects which will be processed as targets of recognition. - /// The configuration used for recognition. This value can be null. - /// A task that represents the asynchronous recognition operation. - /// - /// is null.\n - /// -or-\n - /// is null.\n - /// -or-\n - /// contains null elements. - /// - /// has no elements.(The length is zero.) - /// The feature is not supported. - /// - /// has already been disposed of.\n - /// -or-\n - /// has already been disposed of. - /// - /// 3 - public static async Task> RecognizeAsync(MediaVisionSource source, - ImageObject[] imageObjects, ImageRecognitionConfiguration config) - { - if (source == null) - { - throw new ArgumentNullException(nameof(source)); - } - if (imageObjects == null) - { - throw new ArgumentNullException(nameof(imageObjects)); - } - if (imageObjects.Length == 0) - { - throw new ArgumentException("No image object to recognize.", nameof(imageObjects)); - } - - var tcs = new TaskCompletionSource>(); - - using (var cb = ObjectKeeper.Get(GetCallback(tcs))) - using (var imageHandles = ObjectKeeper.Get(GetHandles(imageObjects))) - { - InteropImage.Recognize(source.Handle, imageHandles.Target, imageHandles.Target.Length, - EngineConfiguration.GetHandle(config), cb.Target). - Validate("Failed to perform image recognition."); - - return await tcs.Task; - } - } - - private static ImageRecognitionResult[] CreateResults(IntPtr[] locations, uint numOfObjects) - { - ImageRecognitionResult[] results = new ImageRecognitionResult[numOfObjects]; - - for (int i = 0; i < numOfObjects; i++) - { - Quadrangle quadrangle = locations[i] != IntPtr.Zero ? - Marshal.PtrToStructure(locations[i]).ToApiStruct() : null; - - results[i] = new ImageRecognitionResult(locations[i] != IntPtr.Zero, quadrangle); - } - - return results; - } - - private static InteropImage.RecognizedCallback GetCallback( - TaskCompletionSource> tcs) - { - return (IntPtr source, IntPtr engineConfig, IntPtr imageObjectHandles, - IntPtr[] locations, uint numOfObjects, IntPtr _) => - { - try - { - if (!tcs.TrySetResult(CreateResults(locations, numOfObjects))) - { - Log.Info(MediaVisionLog.Tag, "Failed to set recognition result"); - } - } - catch (Exception e) - { - MultimediaLog.Error(MediaVisionLog.Tag, "Failed to handle recognition result", e); - tcs.TrySetException(e); - } - }; - } - - private static IntPtr[] GetHandles(ImageObject[] imageObjects) - { - IntPtr[] imageHandles = new IntPtr[imageObjects.Length]; - for (int i = 0; i < imageObjects.Length; i++) - { - if (imageObjects[i] == null) - { - throw new ArgumentNullException($"{nameof(imageObjects)}[{i}]"); - } - - imageHandles[i] = imageObjects[i].Handle; - } - - return imageHandles; - } - } -} diff --git a/src/Tizen.Multimedia.Vision/MediaVision/ImageTracker.cs b/src/Tizen.Multimedia.Vision/MediaVision/ImageTracker.cs deleted file mode 100755 index 4d95f4da6..000000000 --- a/src/Tizen.Multimedia.Vision/MediaVision/ImageTracker.cs +++ /dev/null @@ -1,130 +0,0 @@ -/* - * 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; -using System.Threading.Tasks; -using InteropImage = Interop.MediaVision.Image; - -namespace Tizen.Multimedia.Vision -{ - /// - /// Provides the ability to track images on image sources. - /// - /// 3 - public static class ImageTracker - { - /// - /// Tracks the given image tracking model on the current frame. - /// - /// The current image of sequence where the image tracking model will be tracked. - /// The image tracking model which processed as target of tracking. - /// A task that represents the asynchronous tracking operation. - /// - /// is null.\n - /// -or-\n - /// is null. - /// - /// The feature is not supported. - /// - /// has already been disposed of.\n - /// -or-\n - /// has already been disposed of. - /// - /// has no target. - /// - /// 3 - public static async Task TrackAsync(MediaVisionSource source, - ImageTrackingModel trackingModel) - { - return await TrackAsync(source, trackingModel, null); - } - - /// - /// Tracks the given image tracking model on the current frame and . - /// - /// The current image of sequence where the image tracking model will be tracked. - /// The image tracking model which processed as target of tracking. - /// The configuration used for tracking. This value can be null. - /// A task that represents the asynchronous tracking operation. - /// - /// is null.\n - /// -or-\n - /// is null. - /// - /// The feature is not supported. - /// - /// has already been disposed of.\n - /// -or-\n - /// has already been disposed of.\n - /// -or-\n - /// has already been disposed of. - /// - /// has no target. - /// - /// 3 - public static async Task TrackAsync(MediaVisionSource source, - ImageTrackingModel trackingModel, ImageTrackingConfiguration config) - { - if (source == null) - { - throw new ArgumentNullException(nameof(source)); - } - if (trackingModel == null) - { - throw new ArgumentNullException(nameof(trackingModel)); - } - - TaskCompletionSource tcs = new TaskCompletionSource(); - - using (var cb = ObjectKeeper.Get(GetCallback(tcs))) - { - InteropImage.Track(source.Handle, trackingModel.Handle, EngineConfiguration.GetHandle(config), - cb.Target).Validate("Failed to perform image tracking."); - - return await tcs.Task; - } - } - - private static InteropImage.TrackedCallback GetCallback(TaskCompletionSource tcs) - { - return (IntPtr sourceHandle, IntPtr imageTrackingModelHandle, IntPtr engineCfgHandle, IntPtr locationPtr, IntPtr _) => - { - try - { - Quadrangle region = null; - if (locationPtr != IntPtr.Zero) - { - region = Marshal.PtrToStructure(locationPtr).ToApiStruct(); - } - - Log.Info(MediaVisionLog.Tag, $"Image tracked, region : {region}"); - - if (!tcs.TrySetResult(region)) - { - Log.Info(MediaVisionLog.Tag, "Failed to set track result"); - } - } - catch (Exception e) - { - MultimediaLog.Error(MediaVisionLog.Tag, "Failed to handle track result", e); - tcs.TrySetException(e); - } - }; - - } - } -} diff --git a/src/Tizen.Multimedia.Vision/MediaVision/ImageTrackingConfiguration.cs b/src/Tizen.Multimedia.Vision/MediaVision/ImageTrackingConfiguration.cs deleted file mode 100755 index 71d3b23bb..000000000 --- a/src/Tizen.Multimedia.Vision/MediaVision/ImageTrackingConfiguration.cs +++ /dev/null @@ -1,226 +0,0 @@ -/* - * 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.Multimedia.Vision -{ - /// - /// Represents a configuration of . - /// - /// 3 - public class ImageTrackingConfiguration : ImageRecognitionConfiguration - { - private const string KeyHistoryAmount = "MV_IMAGE_TRACKING_HISTORY_AMOUNT"; - private const string KeyExpectedOffset = "MV_IMAGE_TRACKING_EXPECTED_OFFSET"; - private const string KeyUseStabilization = "MV_IMAGE_TRACKING_USE_STABLIZATION"; - private const string KeyStabilizationTolerantShift = "MV_IMAGE_TRACKING_STABLIZATION_TOLERANT_SHIFT"; - private const string KeyStabilizationSpeed = "MV_IMAGE_TRACKING_STABLIZATION_SPEED"; - private const string KeyStabilizationAcceleration = "MV_IMAGE_TRACKING_STABLIZATION_ACCELERATION"; - - /// - /// A read-only field that represents the default value of . - /// - /// 3 - public static readonly int DefaultHistoryAmount = 3; - - /// - /// A read-only field that represents the default value of . - /// - /// 3 - public static readonly double DefaultExpectedOffset = 0; - - /// - /// A read-only field that represents the default value of . - /// - /// 3 - public static readonly bool DefaultStabilizationEnabled = true; - - /// - /// A read-only field that represents the default value of . - /// - /// 3 - public static readonly double DefaultStabilizationTolerantShift = 0.00006; - - /// - /// A read-only field that represents the default value of . - /// - /// 3 - public static readonly double DefaultStabilizationSpeed = 0.3; - - /// - /// A read-only field that represents the default value of . - /// - /// 3 - public static readonly double DefaultStabilizationAcceleration = 0.1; - - /// - /// Initializes a new instance of the class. - /// - /// The feature is not supported. - /// 3 - public ImageTrackingConfiguration() - { - } - - /// - /// Gets or sets the number of recognition results in the tracking history. - /// - /// - /// The number of previous recognition results, which will influence the stabilization.\n - /// The default is 3. - /// - /// The already has been disposed of. - /// is less than zero. - /// 3 - public int HistoryAmount - { - get - { - return GetInt(KeyHistoryAmount); - } - set - { - if (value < 0) - { - throw new ArgumentOutOfRangeException(nameof(HistoryAmount), value, - $"{nameof(HistoryAmount)} can't be less than zero."); - } - Set(KeyHistoryAmount, value); - } - } - - /// - /// Gets or sets the expected tracking offset. - /// - /// - /// Relative offset value for which the object offset is expected (relative to the object size in the current frame).\n - /// The default is 0. - /// - /// The already has been disposed of. - /// 3 - public double ExpectedOffset - { - get - { - return GetDouble(KeyExpectedOffset); - } - set - { - Set(KeyExpectedOffset, value); - } - } - - /// - /// Gets or sets the acceleration of the tracking stabilization. - /// - /// - /// Acceleration will be used for image stabilization (relative to the distance from current location to stabilized location); - /// from 0 to 1, inclusive.\n - /// The default is 0.1. - /// - /// The already has been disposed of. - /// - /// is less than zero.\n - /// -or-\n - /// is greater than one. - /// - /// 3 - public double StabilizationAcceleration - { - get - { - return GetDouble(KeyStabilizationAcceleration); - } - set - { - if (value < 0 || value > 1) - { - throw new ArgumentOutOfRangeException(nameof(value), value, "Valid range is 0 to 1 inclusive."); - } - - Set(KeyStabilizationAcceleration, value); - } - } - - /// - /// Gets or sets the speed of the tracking stabilization. - /// - /// - /// The start speed value used for image stabilization.\n - /// The default is 0.3. - /// - /// The already has been disposed of. - /// 3 - public double StabilizationSpeed - { - get - { - return GetDouble(KeyStabilizationSpeed); - } - set - { - Set(KeyStabilizationSpeed, value); - } - } - - /// - /// Gets or sets the relative tolerant shift for the tracking stabilization. - /// - /// - /// It is component of tolerant shift which will be ignored by stabilization process. - /// (this value is relative to the object size in the current frame). - /// Tolerant shift will be computed like R * S + C, where R is the value set to , - /// S is the area of object location on frame, C is a constant value 1.3.\n - /// \n - /// The default is 0.00006. - /// - /// The already has been disposed of. - /// 3 - public double StabilizationTolerantShift - { - get - { - return GetDouble(KeyStabilizationTolerantShift); - } - set - { - Set(KeyStabilizationTolerantShift, value); - } - } - - /// - /// Gets or sets the state of the contour stabilization during tracking process. - /// - /// - /// true if the contour stabilization is enabled; otherwise false.\n - /// The default is true. - /// - /// The already has been disposed of. - /// 3 - public bool IsStabilizationEnabled - { - get - { - return GetBool(KeyUseStabilization); - } - set - { - Set(KeyUseStabilization, value); - } - } - } -} diff --git a/src/Tizen.Multimedia.Vision/MediaVision/ImageTrackingModel.cs b/src/Tizen.Multimedia.Vision/MediaVision/ImageTrackingModel.cs deleted file mode 100755 index a3b9bec2c..000000000 --- a/src/Tizen.Multimedia.Vision/MediaVision/ImageTrackingModel.cs +++ /dev/null @@ -1,173 +0,0 @@ -/* - * 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.IO; -using InteropModel = Interop.MediaVision.ImageTrackingModel; - -namespace Tizen.Multimedia.Vision -{ - /// - /// Represents the image tracking model interface. - /// - /// 3 - public class ImageTrackingModel : IDisposable - { - private IntPtr _handle = IntPtr.Zero; - private bool _disposed = false; - - /// - /// Initializes a new instance of the class. - /// - /// The feature is not supported. - /// 3 - public ImageTrackingModel() - { - InteropModel.Create(out _handle).Validate("Failed to create FaceTrackingModel"); - } - - /// - /// Initializes a new instance of the class with the specified path. - /// - /// - /// Model saved by can be loaded. - /// - /// Path to the model to load. - /// is null. - /// is invalid. - /// - /// The feature is not supported.\n - /// -or-\n - /// is not supported format. - /// - /// No permission to access the specified file. - /// - /// 3 - public ImageTrackingModel(string modelPath) - { - if (modelPath == null) - { - throw new ArgumentNullException(nameof(modelPath)); - } - InteropModel.Load(modelPath, out _handle).Validate("Failed to load ImageTrackingModel from file"); - } - - ~ImageTrackingModel() - { - Dispose(false); - } - - /// - /// Sets the target of the image tracking model.\n - /// Sets the image object which will be tracked by using tracking functionality with this tracking model. - /// - /// Image object which will be set as the target for tracking. - /// is null. - /// - /// The has already been disposed of.\n - /// -or-\n - /// has already been disposed of. - /// - /// 3 - public void SetTarget(ImageObject imageObject) - { - if (imageObject == null) - { - throw new ArgumentNullException(nameof(imageObject)); - } - - InteropModel.SetTarget(imageObject.Handle, Handle). - Validate("Failed to set target of image tracking model"); - } - - /// - /// Refreshes the state of image tracking model.\n - /// Clears the moving history and change state to undetected. It is usually called each time before tracking is started - /// for the new sequence of sources, which is not the direct continuation of the sequence for which tracking has been performed before. - /// Tracking algorithm will try to find image by itself. - /// - /// The has already been disposed of. - /// 3 - public void Refresh() - { - InteropModel.Refresh(Handle, IntPtr.Zero).Validate("Failed to refresh state"); - } - - /// - /// Saves the tracking model to the file. - /// - /// 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 directory for does not exist. - /// 3 - public void Save(string path) - { - if (path == null) - { - throw new ArgumentNullException(path); - } - - var ret = InteropModel.Save(path, Handle); - - if (ret == MediaVisionError.InvalidPath) - { - throw new DirectoryNotFoundException($"The directory for the path({path}) does not exist."); - } - - ret.Validate("Failed to save tracking model to file"); - } - - /// - /// Releases all resources used by the object. - /// - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - - /// - /// Releases the resources used by the object. - /// - /// - /// true to release both managed and unmanaged resources; otherwise false to release only unmanaged resources. - /// - protected virtual void Dispose(bool disposing) - { - if (_disposed) - { - return; - } - - InteropModel.Destroy(_handle); - _disposed = true; - } - - internal IntPtr Handle - { - get - { - if (_disposed) - { - throw new ObjectDisposedException(nameof(ImageTrackingModel)); - } - return _handle; - } - } - } -} diff --git a/src/Tizen.Multimedia.Vision/MediaVision/MediaVisionError.cs b/src/Tizen.Multimedia.Vision/MediaVision/MediaVisionError.cs deleted file mode 100755 index ef43a2468..000000000 --- a/src/Tizen.Multimedia.Vision/MediaVision/MediaVisionError.cs +++ /dev/null @@ -1,128 +0,0 @@ -/* - * 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.IO; -using Tizen.Internals.Errors; - -namespace Tizen.Multimedia.Vision -{ - internal static class MediaVisionLog - { - internal const string Tag = "Tizen.Multimedia.MediaVision"; - } - - /// - /// Enumeration for media vision's error codes. - /// - internal enum MediaVisionError - { - MediaVisionErrorCode = -0x019D0000, - /// - /// Successful. - /// - None = ErrorCode.None, - /// - /// Not supported. - /// - NotSupported = ErrorCode.NotSupported, - /// - /// Message too long. - /// - MsgTooLong = ErrorCode.MsgTooLong, - /// - /// No data. - /// - NoData = ErrorCode.NoData, - /// - /// Key not available. - /// - KeyNotAvailable = ErrorCode.KeyNotAvailable, - /// - /// Out of memory. - /// - OutOfMemory = ErrorCode.OutOfMemory, - /// - /// Invalid parameter. - /// - InvalidParameter = ErrorCode.InvalidParameter, - /// - /// Invalid operation. - /// - InvalidOperation = ErrorCode.InvalidOperation, - /// - /// Permission denied. - /// - PermissionDenied = ErrorCode.NotPermitted, - /// - /// Not supported format. - /// - NotSupportedFormat = MediaVisionErrorCode | 0x01, - /// - /// Internal error - /// - Internal = MediaVisionErrorCode | 0x02, - /// - /// Invalid data. - /// - InvalidData = MediaVisionErrorCode | 0x03, - /// - /// Invalid path (Since 3.0). - /// - InvalidPath = MediaVisionErrorCode | 0x04 - } - - internal static class MediaVisionErrorExtensions - { - public static void Validate(this MediaVisionError error, string msg) - { - if (error == MediaVisionError.None) - { - return; - } - - switch (error) - { - case MediaVisionError.NotSupported: - throw new NotSupportedException(msg); - case MediaVisionError.MsgTooLong: - throw new ArgumentException($"{msg} : Message too long."); - case MediaVisionError.NoData: - throw new InvalidOperationException($"{msg} : No Data."); - case MediaVisionError.KeyNotAvailable: - throw new ArgumentException($"{msg} : Key Not Available."); - case MediaVisionError.OutOfMemory: - throw new OutOfMemoryException($"{msg} : Out of Memory."); - case MediaVisionError.InvalidParameter: - throw new ArgumentException($"{msg} : Invalid argument."); - case MediaVisionError.InvalidOperation: - throw new InvalidOperationException($"{msg} : Invalid Operation."); - case MediaVisionError.PermissionDenied: - throw new UnauthorizedAccessException($"{msg} : Permission Denied."); - case MediaVisionError.NotSupportedFormat: - throw new NotSupportedException($"{msg} : Not Supported Format."); - case MediaVisionError.Internal: - throw new InvalidOperationException($"{msg} : Internal Error."); - case MediaVisionError.InvalidData: - throw new ArgumentException($"{msg} : Invalid Data."); - case MediaVisionError.InvalidPath: - throw new FileNotFoundException($"{msg} : Invalid Path."); - default: - throw new InvalidOperationException($"{msg} : Unknown Error."); - } - } - } -} diff --git a/src/Tizen.Multimedia.Vision/MediaVision/MediaVisionSource.cs b/src/Tizen.Multimedia.Vision/MediaVision/MediaVisionSource.cs deleted file mode 100755 index 25a66d67e..000000000 --- a/src/Tizen.Multimedia.Vision/MediaVision/MediaVisionSource.cs +++ /dev/null @@ -1,270 +0,0 @@ -/* - * 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.Diagnostics; -using System.Linq; -using System.Collections.Generic; -using InteropSource = Interop.MediaVision.MediaSource; - -namespace Tizen.Multimedia.Vision -{ - /// - /// Represents the media vision source to keep information on the image or video frame data as raw buffer. - /// - /// 3 - public class MediaVisionSource : IBufferOwner, IDisposable - { - private IntPtr _handle = IntPtr.Zero; - private bool _disposed = false; - - internal MediaVisionSource() - { - InteropSource.Create(out _handle).Validate("Failed to create media vision source"); - } - - private MediaVisionSource(Action fillAction) - : this() - { - try - { - fillAction(_handle); - } - catch (Exception) - { - InteropSource.Destroy(_handle); - _disposed = true; - throw; - } - } - - private static void FillMediaPacket(IntPtr handle, MediaPacket mediaPacket) - { - Debug.Assert(handle != IntPtr.Zero); - - if (mediaPacket == null) - { - throw new ArgumentNullException(nameof(mediaPacket)); - } - - InteropSource.FillMediaPacket(handle, mediaPacket.GetHandle()). - Validate("Failed to fill media packet"); - } - - /// - /// Initializes a new instance of the class based on the . - /// - /// The from which the source will be filled. - /// The feature is not supported. - /// is null. - /// has already been disposed of. - /// 3 - public MediaVisionSource(MediaPacket mediaPacket) - : this(handle => FillMediaPacket(handle, mediaPacket)) - { - } - - private static void FillBuffer(IntPtr handle, byte[] buffer, uint width, uint height, ColorSpace colorSpace) - { - Debug.Assert(handle != IntPtr.Zero); - - if (buffer == null) - { - throw new ArgumentNullException(nameof(buffer)); - } - - if (buffer.Length == 0) - { - throw new ArgumentException("Buffer.Length is zero.", nameof(buffer)); - } - - ValidationUtil.ValidateEnum(typeof(ColorSpace), colorSpace, nameof(colorSpace)); - - InteropSource.FillBuffer(handle, buffer, buffer.Length, width, height, colorSpace.ToVisionColorSpace()). - Validate("Failed to fill buffer"); - } - - /// - /// Initializes a new instance of the class based on the buffer and . - /// - /// The buffer of image data. - /// The width of image. - /// The height of image. - /// The image . - /// - /// The feature is not supported.\n - /// -or-\n - /// is not supported. - /// - /// is null. - /// - /// has no element.(The length is zero.)\n - /// -or-\n - /// is invalid. - /// - /// 3 - public MediaVisionSource(byte[] buffer, uint width, uint height, ColorSpace colorSpace) - : this(handle => FillBuffer(handle, buffer, width, height, colorSpace)) - { - } - - ~MediaVisionSource() - { - Dispose(false); - } - - private IMediaBuffer _buffer; - - /// - /// Gets the buffer of the media source. - /// - /// The has already been disposed of. - /// 3 - public IMediaBuffer Buffer - { - get - { - if (_buffer == null) - { - IntPtr bufferHandle = IntPtr.Zero; - int bufferSize = 0; - - InteropSource.GetBuffer(Handle, out bufferHandle, out bufferSize). - Validate("Failed to get buffer"); - - _buffer = new DependentMediaBuffer(this, bufferHandle, bufferSize); - } - return _buffer; - } - } - - /// - /// Gets MediaVision's supported ColorSpace state. - /// true if supported, otherwise false. - /// - public static bool IsSupportedColorSpace(ColorSpace colorSpace) - { - return SupportedColorSpaces.Contains(colorSpace); - } - - /// - /// Gets the height of the media source. - /// - /// The has already been disposed of. - /// 3 - public uint Height - { - get - { - uint height = 0; - var ret = InteropSource.GetHeight(Handle, out height); - MultimediaDebug.AssertNoError(ret); - return height; - } - } - - /// - /// Gets the width of the media source. - /// - /// The has already been disposed of. - /// 3 - public uint Width - { - get - { - uint width = 0; - var ret = InteropSource.GetWidth(Handle, out width); - MultimediaDebug.AssertNoError(ret); - return width; - } - } - - /// - /// Gets of the media source. - /// - /// The has already been disposed of. - /// 3 - public ColorSpace Colorspace - { - get - { - VisionColorSpace visionColorSpace; - - var ret = InteropSource.GetColorspace(Handle, out visionColorSpace); - MultimediaDebug.AssertNoError(ret); - return visionColorSpace.ToCommonColorSpace(); - } - } - - /// - /// Gets the supported colorspaces for . - /// - public static IEnumerable SupportedColorSpaces - { - get - { - foreach (VisionColorSpace value in Enum.GetValues(typeof(VisionColorSpace))) - { - yield return value.ToCommonColorSpace(); - } - } - } - - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - - /// - /// Releases the resources used by the object. - /// - /// - /// true to release both managed and unmanaged resources; otherwise false to release only unmanaged resources. - /// - protected virtual void Dispose(bool disposing) - { - if (_disposed) - { - return; - } - InteropSource.Destroy(_handle); - _disposed = true; - } - - internal IntPtr Handle - { - get - { - if (_disposed) - { - throw new ObjectDisposedException(nameof(MediaVisionSource)); - } - return _handle; - } - } - - bool IBufferOwner.IsBufferAccessible(object buffer, MediaBufferAccessMode accessMode) - { - return true; - } - - bool IBufferOwner.IsDisposed - { - get { return _disposed; } - } - } -} diff --git a/src/Tizen.Multimedia.Vision/MediaVision/MovementDetectedEventArgs.cs b/src/Tizen.Multimedia.Vision/MediaVision/MovementDetectedEventArgs.cs deleted file mode 100755 index a5dba43be..000000000 --- a/src/Tizen.Multimedia.Vision/MediaVision/MovementDetectedEventArgs.cs +++ /dev/null @@ -1,43 +0,0 @@ -/* - * 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.Collections.Generic; - -namespace Tizen.Multimedia.Vision -{ - /// - /// Provides data for the event. - /// - /// 3 - public class MovementDetectedEventArgs : EventArgs - { - /// - /// Initializes a new instance of the class. - /// - /// 3 - public MovementDetectedEventArgs(IEnumerable areas) - { - Areas = areas; - } - - /// - /// Gets a set of rectangular regions where movement was detected. - /// - /// 3 - public IEnumerable Areas { get; } - } -} diff --git a/src/Tizen.Multimedia.Vision/MediaVision/MovementDetectionConfiguration.cs b/src/Tizen.Multimedia.Vision/MediaVision/MovementDetectionConfiguration.cs deleted file mode 100755 index 17e691feb..000000000 --- a/src/Tizen.Multimedia.Vision/MediaVision/MovementDetectionConfiguration.cs +++ /dev/null @@ -1,81 +0,0 @@ -/* - * 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.Multimedia.Vision -{ - /// - /// Represents a configuration of . - /// - /// 3 - public class MovementDetectionConfiguration : SurveillanceEngineConfiguration - { - private const string KeyThreshold = "MV_SURVEILLANCE_MOVEMENT_DETECTION_THRESHOLD"; - - /// - /// A read-only field that represents the default value of . - /// - /// 3 - public static readonly int DefaultThreshold = 10; - - - /// - /// Initializes a new instance of the class. - /// - /// The feature is not supported. - /// 3 - public MovementDetectionConfiguration() - { - } - - /// - /// Gets or sets movement detection threshold.\n - /// This value might be set before subscription on event - /// to specify the sensitivity of the movement detector. - /// - /// - /// The value indicating the sensitivity of from 0 to 255 inclusive, - /// where 255 means that no movements will be detected and 0 means that all frame changes - /// will be interpreted as movements.\n - /// The default is 10. - /// - /// The already has been disposed of. - /// - /// is less than zero.\n - /// -or-\n - /// is greater than 255. - /// - /// 3 - public int Threshold - { - get - { - return GetInt(KeyThreshold); - } - set - { - if (value < 0 || value > 255) - { - throw new ArgumentOutOfRangeException(nameof(Threshold), value, - $"Valid {nameof(Threshold)} range is 0 to 255 inclusive"); - } - - Set(KeyThreshold, value); - } - } - } -} diff --git a/src/Tizen.Multimedia.Vision/MediaVision/MovementDetector.cs b/src/Tizen.Multimedia.Vision/MediaVision/MovementDetector.cs deleted file mode 100755 index 3d1b6e515..000000000 --- a/src/Tizen.Multimedia.Vision/MediaVision/MovementDetector.cs +++ /dev/null @@ -1,118 +0,0 @@ -/* - * 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 static Interop.MediaVision.Surveillance; - -namespace Tizen.Multimedia.Vision -{ - /// - /// Provides the ability to detect movement on image sources. - /// - /// - /// 3 - public class MovementDetector : SurveillanceEngine - { - private const string KeyNumberOfRegions = "NUMBER_OF_MOVEMENT_REGIONS"; - private const string KeyRegions = "MOVEMENT_REGIONS"; - - private const string MovementDetectedEventType = "MV_SURVEILLANCE_EVENT_MOVEMENT_DETECTED"; - - /// - /// Initializes a new instance of the class. - /// - /// The feature is not supported. - /// 3 - public MovementDetector() : base(MovementDetectedEventType) - { - } - - /// - /// Occurs when the movement detected. - /// - /// The event handler will be executed on an internal thread. - /// 3 - public event EventHandler Detected; - - internal override void OnEventDetected(IntPtr trigger, IntPtr source, int streamId, - IntPtr result, IntPtr _) - { - try - { - Detected?.Invoke(this, CreateMovementDetectedEventArgs(result)); - } - catch (Exception e) - { - MultimediaLog.Error(MediaVisionLog.Tag, "Failed to invoke Recognized event.", e); - } - } - - private static Rectangle[] RetrieveAreas(IntPtr result) - { - int count = 0; - GetResultValue(result, KeyNumberOfRegions, out count).Validate("Failed to get result count"); - - if (count == 0) - { - return new Rectangle[0]; - } - - var rects = new global::Interop.MediaVision.Rectangle[count]; - - GetResultValue(result, KeyRegions, rects).Validate("Failed to get regions"); - - return global::Interop.ToApiStruct(rects); - } - - private static MovementDetectedEventArgs CreateMovementDetectedEventArgs(IntPtr result) - { - return new MovementDetectedEventArgs(RetrieveAreas(result)); - } - - - /// - /// Adds . - /// - /// The source used for recognition. - /// is null. - /// The has already been disposed of. - /// - /// 3 - public void AddSource(SurveillanceSource source) - { - AddSource(source, null); - } - - /// - /// Adds with the provided . - /// - /// The source used for recognition. - /// The config for the . This value can be null. - /// is null. - /// - /// The has already been disposed of.\n - /// -or-\n - /// has already been disposed of. - /// - /// - /// 3 - public void AddSource(SurveillanceSource source, MovementDetectionConfiguration config) - { - InvokeAddSource(source, config); - } - - } -} diff --git a/src/Tizen.Multimedia.Vision/MediaVision/PersonAppearanceDetectedEventArgs.cs b/src/Tizen.Multimedia.Vision/MediaVision/PersonAppearanceDetectedEventArgs.cs deleted file mode 100755 index 3e0f94d23..000000000 --- a/src/Tizen.Multimedia.Vision/MediaVision/PersonAppearanceDetectedEventArgs.cs +++ /dev/null @@ -1,58 +0,0 @@ -/* - * 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.Collections.Generic; - -namespace Tizen.Multimedia.Vision -{ - /// - /// Provides data for the event. - /// - /// 3 - public class PersonAppearanceDetectedEventArgs : EventArgs - { - /// - /// Initializes a new instance of the class. - /// - /// 3 - public PersonAppearanceDetectedEventArgs(IEnumerable appeared, - IEnumerable disappeared, IEnumerable tracked) - { - AppearanceAreas = appeared; - DisappearanceAreas = disappeared; - TrackedAreas = tracked; - } - - /// - /// Gets a set of rectangular regions where appearances of the persons were detected. - /// - /// 3 - public IEnumerable AppearanceAreas { get; } - - /// - /// Gets a set of rectangular regions where disappearances of the persons were detected. - /// - /// 3 - public IEnumerable DisappearanceAreas { get; } - - /// - /// Gets a set of rectangular regions where persons were tracked. - /// - /// 3 - public IEnumerable TrackedAreas { get; } - } -} diff --git a/src/Tizen.Multimedia.Vision/MediaVision/PersonAppearanceDetectionConfiguration.cs b/src/Tizen.Multimedia.Vision/MediaVision/PersonAppearanceDetectionConfiguration.cs deleted file mode 100755 index ae503f1e2..000000000 --- a/src/Tizen.Multimedia.Vision/MediaVision/PersonAppearanceDetectionConfiguration.cs +++ /dev/null @@ -1,75 +0,0 @@ -/* - * 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.Multimedia.Vision -{ - /// - /// Represents a configuration of instances. - /// - /// 3 - public class PersonAppearanceDetectionConfiguration : SurveillanceEngineConfiguration - { - private const string KeySkipFramesCount = "MV_SURVEILLANCE_SKIP_FRAMES_COUNT"; - - /// - /// A read-only field that represents the default value of . - /// - /// 3 - public static readonly int DefaultSkipFramesCount = 0; - - /// - /// Initializes a new instance of the class. - /// - /// The feature is not supported. - /// 3 - public PersonAppearanceDetectionConfiguration() - { - } - - /// - /// Gets or sets how many frames will be skipped during push source.\n - /// - /// - /// The value to specify the number of calls will be ignored by subscription - /// of the event trigger.\n - /// - /// The default is 0. It means that no frames will be skipped and all will - /// be processed. - /// - /// The already has been disposed of. - /// is less than zero. - /// - /// 3 - public int SkipFramesCount - { - get - { - return GetInt(KeySkipFramesCount); - } - set - { - if (value < 0) - { - throw new ArgumentOutOfRangeException(nameof(SkipFramesCount), value, - $"{nameof(SkipFramesCount)} can't be less than zero."); - } - Set(KeySkipFramesCount, value); - } - } - } -} diff --git a/src/Tizen.Multimedia.Vision/MediaVision/PersonAppearanceDetector.cs b/src/Tizen.Multimedia.Vision/MediaVision/PersonAppearanceDetector.cs deleted file mode 100755 index 35af496de..000000000 --- a/src/Tizen.Multimedia.Vision/MediaVision/PersonAppearanceDetector.cs +++ /dev/null @@ -1,122 +0,0 @@ -/* - * 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 static Interop.MediaVision.Surveillance; - -namespace Tizen.Multimedia.Vision -{ - /// - /// Provides the ability to detect person appearance changes on image sources. - /// - /// - /// 3 - public class PersonAppearanceDetector : SurveillanceEngine - { - private const string KeyAppearedNumber = "NUMBER_OF_APPEARED_PERSONS"; - private const string KeyDisappearedNumber = "NUMBER_OF_DISAPPEARED_PERSONS"; - private const string KeyTrackedNumber = "NUMBER_OF_TRACKED_PERSONS"; - private const string KeyAppearedLocations = "APPEARED_PERSONS_LOCATIONS"; - private const string KeyDisappearedLocations = "DISAPPEARED_PERSONS_LOCATIONS"; - private const string KeyTrackedLocations = "TRACKED_PERSONS_LOCATIONS"; - - private const string PersonAppearanceEventType = "MV_SURVEILLANCE_EVENT_PERSON_APPEARED_DISAPEARED"; - - /// - /// Initializes a new instance of the class. - /// - /// The feature is not supported. - /// 3 - public PersonAppearanceDetector() : base(PersonAppearanceEventType) - { - } - - /// - /// Occurs when the any appearance changes detected. - /// - /// The event handler will be executed on an internal thread. - /// 3 - public event EventHandler Detected; - - internal override void OnEventDetected(IntPtr trigger, IntPtr source, int streamId, - IntPtr result, IntPtr _) - { - try - { - Detected?.Invoke(this, CreatePersonAppearanceChangedEventArgs(result)); - } - catch (Exception e) - { - MultimediaLog.Error(MediaVisionLog.Tag, "Failed to invoke Recognized event.", e); - } - } - - - private PersonAppearanceDetectedEventArgs CreatePersonAppearanceChangedEventArgs(IntPtr result) - { - return new PersonAppearanceDetectedEventArgs( - GetResultAreas(result, KeyAppearedNumber, KeyAppearedLocations), - GetResultAreas(result, KeyDisappearedNumber, KeyDisappearedLocations), - GetResultAreas(result, KeyTrackedNumber, KeyTrackedLocations) - ); - } - - private static Rectangle[] GetResultAreas(IntPtr result, string countKey, string regionsKey) - { - int count = 0; - GetResultValue(result, countKey, out count).Validate("Failed to get result"); - - var rects = new global::Interop.MediaVision.Rectangle[count]; - if (count > 0) - { - GetResultValue(result, regionsKey, rects).Validate("Failed to get result"); - } - - return global::Interop.ToApiStruct(rects); - } - - /// - /// Adds . - /// - /// The source used for recognition. - /// is null. - /// The has already been disposed of. - /// - /// 3 - public void AddSource(SurveillanceSource source) - { - AddSource(source, null); - } - - /// - /// Adds with the provided . - /// - /// The source used for recognition. - /// The config for the . This value can be null. - /// is null. - /// - /// The has already been disposed of.\n - /// -or-\n - /// has already been disposed of. - /// - /// - /// 3 - public void AddSource(SurveillanceSource source, PersonAppearanceDetectionConfiguration config) - { - InvokeAddSource(source, config); - } - } -} diff --git a/src/Tizen.Multimedia.Vision/MediaVision/PersonRecognitionConfiguration.cs b/src/Tizen.Multimedia.Vision/MediaVision/PersonRecognitionConfiguration.cs deleted file mode 100755 index d8173241a..000000000 --- a/src/Tizen.Multimedia.Vision/MediaVision/PersonRecognitionConfiguration.cs +++ /dev/null @@ -1,63 +0,0 @@ -/* - * 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.Multimedia.Vision -{ - /// - /// Represents a configuration of instances. - /// - /// 3 - public class PersonRecognitionConfiguration : SurveillanceEngineConfiguration - { - private const string KeyFaceRecognitionModelFilePath = "MV_SURVEILLANCE_FACE_RECOGNITION_MODEL_FILE_PATH"; - - /// - /// Initializes a new instance of the class. - /// - /// Path to the face recognition model. - /// is null. - /// The feature is not supported. - /// 3 - public PersonRecognitionConfiguration(string modelPath) - { - FaceRecognitionModelPath = modelPath; - } - - /// - /// Gets or sets face recognition model file path. - /// - /// is null. - /// The already has been disposed of. - /// 3 - public string FaceRecognitionModelPath - { - get - { - return GetString(KeyFaceRecognitionModelFilePath); - } - set - { - if (value == null) - { - throw new ArgumentNullException(nameof(FaceRecognitionModelPath)); - } - Set(KeyFaceRecognitionModelFilePath, value); - } - } - } -} diff --git a/src/Tizen.Multimedia.Vision/MediaVision/PersonRecognitionInfo.cs b/src/Tizen.Multimedia.Vision/MediaVision/PersonRecognitionInfo.cs deleted file mode 100755 index 116253243..000000000 --- a/src/Tizen.Multimedia.Vision/MediaVision/PersonRecognitionInfo.cs +++ /dev/null @@ -1,54 +0,0 @@ -/* - * 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. - */ - -namespace Tizen.Multimedia.Vision -{ - /// - /// Represents a result of instances. - /// - /// 3 - public class PersonRecognitionInfo - { - /// - /// Initializes a new instance of the class. - /// - /// 3 - public PersonRecognitionInfo(Rectangle area, int label, double confidence) - { - Area = area; - Label = label; - Confidence = confidence; - } - - /// - /// Gets the rectangular location where person face was recognized. - /// - /// 3 - public Rectangle Area { get; } - - /// - /// Gets the label that correspond to the recognized person. - /// - /// 3 - public int Label { get; } - - /// - /// Gets the confidence value that correspond to the recognized person. - /// - /// 3 - public double Confidence { get; } - } -} diff --git a/src/Tizen.Multimedia.Vision/MediaVision/PersonRecognizedEventArgs.cs b/src/Tizen.Multimedia.Vision/MediaVision/PersonRecognizedEventArgs.cs deleted file mode 100755 index 4b8b7b8b8..000000000 --- a/src/Tizen.Multimedia.Vision/MediaVision/PersonRecognizedEventArgs.cs +++ /dev/null @@ -1,43 +0,0 @@ -/* - * 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.Collections.Generic; - -namespace Tizen.Multimedia.Vision -{ - /// - /// Provides data for the event. - /// - /// 3 - public class PersonRecognizedEventArgs : EventArgs - { - /// - /// Initializes a new instance of the class. - /// - /// 3 - public PersonRecognizedEventArgs(IEnumerable recognitionInfo) - { - Recognitions = recognitionInfo; - } - - /// - /// Gets a set of information that correspond to the recognized persons. - /// - /// 3 - public IEnumerable Recognitions { get; } - } -} diff --git a/src/Tizen.Multimedia.Vision/MediaVision/PersonRecognizer.cs b/src/Tizen.Multimedia.Vision/MediaVision/PersonRecognizer.cs deleted file mode 100755 index 8bdf8348d..000000000 --- a/src/Tizen.Multimedia.Vision/MediaVision/PersonRecognizer.cs +++ /dev/null @@ -1,128 +0,0 @@ -/* - * 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 static Interop.MediaVision.Surveillance; - -namespace Tizen.Multimedia.Vision -{ - /// - /// Provides the ability to recognize person on image sources. - /// - /// - /// 3 - public class PersonRecognizer : SurveillanceEngine - { - private const string KeyCount = "NUMBER_OF_PERSONS"; - private const string KeyLocations = "PERSONS_LOCATIONS"; - private const string KeyLabels = "PERSONS_LABELS"; - private const string KeyConfidences = "PERSONS_CONFIDENCES"; - - private const string PersonRecognizedEventType = "MV_SURVEILLANCE_EVENT_PERSON_RECOGNIZED"; - - /// - /// Initializes a new instance of the class. - /// - /// The feature is not supported. - /// 3 - public PersonRecognizer() : base(PersonRecognizedEventType) - { - } - - /// - /// Occurs when a person recognized. - /// - /// The event handler will be executed on an internal thread. - /// - /// 3 - public event EventHandler Recognized; - - internal override void OnEventDetected(IntPtr trigger, IntPtr source, int streamId, - IntPtr result, IntPtr _) - { - try - { - Recognized?.Invoke(this, CreatePersonRecognizedEventArgs(result)); - } - catch (Exception e) - { - MultimediaLog.Error(MediaVisionLog.Tag, "Failed to invoke Recognized event.", e); - } - } - - private PersonRecognizedEventArgs CreatePersonRecognizedEventArgs(IntPtr result) - { - int count; - - GetResultValue(result, KeyCount, out count).Validate("Failed to get result count"); - - var recognitionInfo = new PersonRecognitionInfo[count]; - - if (count > 0) - { - var rects = new global::Interop.MediaVision.Rectangle[count]; - GetResultValue(result, KeyLocations, rects).Validate("Failed to get location"); - - var labels = new int[count]; - GetResultValue(result, KeyLabels, labels).Validate("Failed to get label"); - - var confidences = new double[count]; - GetResultValue(result, KeyConfidences, confidences).Validate("Failed to get confidence"); - - for (int i = 0; i < count; i++) - { - recognitionInfo[i] = new PersonRecognitionInfo(rects[i].ToApiStruct(), - labels[i], confidences[i]); - } - } - - return new PersonRecognizedEventArgs(recognitionInfo); - } - - /// - /// Adds with the provided . - /// - /// The source used for recognition. - /// The config for the . - /// - /// is null.\n - /// -or-\n - /// is null. - /// - /// - /// The has already been disposed of.\n - /// -or-\n - /// has already been disposed of. - /// - /// - /// of does not exists. - /// - /// - /// No permission to access to the . - /// - /// The model file is not supported format or file. - /// - /// 3 - public void AddSource(SurveillanceSource source, PersonRecognitionConfiguration config) - { - if (config == null) - { - throw new ArgumentNullException(nameof(config)); - } - InvokeAddSource(source, config); - } - } -} diff --git a/src/Tizen.Multimedia.Vision/MediaVision/QrConfiguration.cs b/src/Tizen.Multimedia.Vision/MediaVision/QrConfiguration.cs deleted file mode 100755 index e6d8a97a7..000000000 --- a/src/Tizen.Multimedia.Vision/MediaVision/QrConfiguration.cs +++ /dev/null @@ -1,80 +0,0 @@ -/* - * 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.Multimedia.Vision -{ - /// - /// Represents a QR configuration of . - /// - /// 3 - public class QrConfiguration - { - /// - /// Initializes a new instance of the class. - /// - /// 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.\n - /// -or-\n - /// is greater than 40. - /// - /// - /// is invalid.\n - /// -or- - /// is invalid. - /// - /// 3 - public QrConfiguration(QrMode qrMode, ErrorCorrectionLevel ecc, int version) - { - if (version < 1 || version > 40) - { - throw new ArgumentOutOfRangeException(nameof(version), version, - "Valid version range is 1 to 40 inclusive."); - } - ValidationUtil.ValidateEnum(typeof(QrMode), qrMode, nameof(qrMode)); - ValidationUtil.ValidateEnum(typeof(ErrorCorrectionLevel), ecc, nameof(ecc)); - - Mode = qrMode; - ErrorCorrectionLevel = ecc; - Version = version; - } - - /// - /// Gets the encoding mode for the message. - /// - /// 3 - public QrMode Mode { get; } - - /// - /// Gets the error correction level. - /// - /// 3 - public ErrorCorrectionLevel ErrorCorrectionLevel { get; } - - /// - /// Gets the QR code version. - /// - /// 3 - public int Version { get; } - } -} diff --git a/src/Tizen.Multimedia.Vision/MediaVision/QrMode.cs b/src/Tizen.Multimedia.Vision/MediaVision/QrMode.cs deleted file mode 100755 index 14f547774..000000000 --- a/src/Tizen.Multimedia.Vision/MediaVision/QrMode.cs +++ /dev/null @@ -1,46 +0,0 @@ -/* - * 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. - */ - -namespace Tizen.Multimedia.Vision -{ - /// - /// Specifies the supported QR code encoding modes. - /// - /// 3 - public enum QrMode - { - /// - /// Numeric digits. - /// - /// 3 - Numeric, - /// - /// Alphanumeric characters, '$', '%', '*', '+', '-', '.', '/' and ':'. - /// - /// 3 - AlphaNumeric, - /// - /// Raw 8-bit bytes. - /// - /// 3 - Byte, - /// - /// UTF-8 character encoding. - /// - /// 3 - Utf8 - } -} diff --git a/src/Tizen.Multimedia.Vision/MediaVision/Quadrangle.cs b/src/Tizen.Multimedia.Vision/MediaVision/Quadrangle.cs deleted file mode 100755 index 708621cfd..000000000 --- a/src/Tizen.Multimedia.Vision/MediaVision/Quadrangle.cs +++ /dev/null @@ -1,58 +0,0 @@ -/* - * 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.Multimedia.Vision -{ - /// - /// Represents a region with 4 s. - /// - /// 3 - public class Quadrangle - { - - /// - /// Initializes a new instance of the class with an array of . - /// - /// must have 4 elements. - /// Four points that define the object bounding quadrangle. - /// The length of is not 4. - /// 3 - public Quadrangle(Point[] points) - { - if (points.Length != 4) - { - throw new ArgumentException($"{points} must have 4 elements."); - } - - Points = points; - } - - /// - /// Gets four points that define the object bounding quadrangle. - /// - /// 3 - public Point[] Points { get; } - - /// - /// Returns a string that represents the current object. - /// - /// A string that represents the current object. - public override string ToString() => - $"[{{{Points[0].ToString()}}}, {{{Points[1].ToString()}}}, {{{Points[2].ToString()}}}, {{{Points[3].ToString()}}}]"; - } -} diff --git a/src/Tizen.Multimedia.Vision/MediaVision/SurveillanceConfiguration.cs b/src/Tizen.Multimedia.Vision/MediaVision/SurveillanceConfiguration.cs deleted file mode 100755 index 27583146b..000000000 --- a/src/Tizen.Multimedia.Vision/MediaVision/SurveillanceConfiguration.cs +++ /dev/null @@ -1,29 +0,0 @@ -/* - * 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. - */ - -namespace Tizen.Multimedia.Vision -{ - /// - /// SurveillanceEngineConfiguration is a base class for surveillance configurations. - /// - /// 3 - public class SurveillanceEngineConfiguration : EngineConfiguration - { - internal SurveillanceEngineConfiguration() : base("face_recognition", "image_recognition") - { - } - } -} diff --git a/src/Tizen.Multimedia.Vision/MediaVision/SurveillanceEngine.cs b/src/Tizen.Multimedia.Vision/MediaVision/SurveillanceEngine.cs deleted file mode 100755 index b3921a419..000000000 --- a/src/Tizen.Multimedia.Vision/MediaVision/SurveillanceEngine.cs +++ /dev/null @@ -1,159 +0,0 @@ -/* - * 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; -using static Interop.MediaVision.Surveillance; - -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. - /// - /// - /// - /// - /// 3 - public abstract class SurveillanceEngine : IDisposable - { - private IntPtr _handle = IntPtr.Zero; - private bool _disposed = false; - - /// - /// Initializes a new instance of the class. - /// - /// The type of the event trigger. - internal SurveillanceEngine(string eventType) - { - EventTriggerCreate(eventType, out _handle).Validate("Failed to create surveillance event trigger."); - } - - ~SurveillanceEngine() - { - Dispose(false); - } - - internal IntPtr Handle - { - get - { - if (_disposed) - { - throw new ObjectDisposedException(GetType().Name); - } - return _handle; - } - } - - /// - /// Sets and gets the ROI (Region Of Interest). - /// - /// The has already been disposed of. - /// 3 - public Point[] Roi - { - get - { - IntPtr roiPtr = IntPtr.Zero; - try - { - int count = 0; - GetEventTriggerRoi(Handle, out count, out roiPtr).Validate("Failed to get roi"); - - Point[] points = new Point[count]; - IntPtr iterPtr = roiPtr; - - for (int i = 0; i < count; i++) - { - points[i] = Marshal.PtrToStructure(iterPtr).ToApiStruct(); - iterPtr = IntPtr.Add(iterPtr, Marshal.SizeOf()); - } - - return points; - } - finally - { - LibcSupport.Free(roiPtr); - } - } - set - { - int length = value == null ? 0 : value.Length; - - var points = value == null ? null : global::Interop.ToMarshalable(value); - - SetEventTriggerRoi(Handle, length, points).Validate("Failed to set roi"); - } - } - - internal abstract void OnEventDetected(IntPtr trigger, IntPtr source, - int streamId, IntPtr eventResult, IntPtr userData); - - internal void InvokeAddSource(SurveillanceSource source, SurveillanceEngineConfiguration config) - { - if (source == null) - { - throw new ArgumentNullException(nameof(source)); - } - SubscribeEventTrigger(Handle, source.StreamId, EngineConfiguration.GetHandle(config), - OnEventDetected).Validate("Failed to subscribe trigger"); - } - - /// - /// Removes the source from . - /// - /// is null. - /// The has already been disposed of. - /// has not been added. - /// 3 - public void RemoveSource(SurveillanceSource source) - { - if (source == null) - { - throw new ArgumentNullException(nameof(source)); - } - UnsubscribeEventTrigger(Handle, source.StreamId).Validate("Failed to unsubscribe event trigger"); - } - - - /// - /// Releases all the resources used by the object. - /// - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - - /// - /// Releases the resources used by the object. - /// - /// - /// true to release both managed and unmanaged resources; otherwise false to release only unmanaged resources. - /// - protected virtual void Dispose(bool disposing) - { - if (_disposed) - { - return; - } - - EventTriggerDestroy(_handle); - _disposed = true; - } - } -} diff --git a/src/Tizen.Multimedia.Vision/MediaVision/SurveillanceSource.cs b/src/Tizen.Multimedia.Vision/MediaVision/SurveillanceSource.cs deleted file mode 100755 index 6f5d6a1db..000000000 --- a/src/Tizen.Multimedia.Vision/MediaVision/SurveillanceSource.cs +++ /dev/null @@ -1,76 +0,0 @@ -/* - * 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 static Interop.MediaVision.Surveillance; - -namespace Tizen.Multimedia.Vision -{ - /// - /// Provides the ability to push the source to surveillance engines. - /// - /// - /// - /// - /// 3 - public class SurveillanceSource - { - private static int _nextStreamId = int.MinValue; - - private static int GetNextStreamId() - { - if (_nextStreamId == int.MaxValue) - { - return _nextStreamId = int.MinValue; - } - return _nextStreamId++; - } - - /// - /// Initializes a new instance of the class. - /// - /// 3 - public SurveillanceSource() - { - StreamId = GetNextStreamId(); - } - - /// - /// Pushes the source to the surveillance system to detect events. - /// - /// The media source used for surveillance. - /// is null. - /// has already been disposed of. - /// This has not been added yet. - /// - /// - /// - /// - /// - /// 3 - public void Push(MediaVisionSource source) - { - if (source == null) - { - throw new ArgumentNullException(nameof(source)); - } - - PushSource(source.Handle, StreamId).Validate("Failed to push source"); - } - - internal int StreamId { get; } - } -} diff --git a/src/Tizen.Multimedia.Vision/MediaVision/VisionColorSpace.cs b/src/Tizen.Multimedia.Vision/MediaVision/VisionColorSpace.cs deleted file mode 100755 index 71454287b..000000000 --- a/src/Tizen.Multimedia.Vision/MediaVision/VisionColorSpace.cs +++ /dev/null @@ -1,142 +0,0 @@ -/* - * 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.Diagnostics; - -namespace Tizen.Multimedia.Vision -{ - /// - /// Specifies colorspaces for MediaVision. - /// - internal enum VisionColorSpace - { - /// - /// The colorspace type is Y800. - /// - Y800 = 1, - /// - /// The colorspace type is I420. - /// - I420, - /// - /// The colorspace type is NV12. - /// - NV12, - /// - /// The colorspace type is YV12. - /// - YV12, - /// - /// The colorspace type is NV21. - /// - NV21, - /// - /// The colorspace type is YUYV. - /// - Yuyv, - /// - /// The colorspace type is UYVY. - /// - Uyvy, - /// - /// The colorspace type is 422P. - /// - Yuv422P, - /// - /// The colorspace type is RGB565. - /// - Rgb565, - /// - /// The colorspace type is RGB888. - /// - Rgb888, - /// - /// The colorspace type is RGBA. - /// - Rgba - } - - internal static class VisionColorSpaceExtensions - { - internal static ColorSpace ToCommonColorSpace(this VisionColorSpace value) - { - Debug.Assert(Enum.IsDefined(typeof(VisionColorSpace), value)); - - switch (value) - { - case VisionColorSpace.Y800: return ColorSpace.Y800; - - case VisionColorSpace.I420: return ColorSpace.I420; - - case VisionColorSpace.NV12: return ColorSpace.NV12; - - case VisionColorSpace.YV12: return ColorSpace.YV12; - - case VisionColorSpace.NV21: return ColorSpace.NV21; - - case VisionColorSpace.Yuyv: return ColorSpace.Yuyv; - - case VisionColorSpace.Uyvy: return ColorSpace.Uyvy; - - case VisionColorSpace.Yuv422P: return ColorSpace.Yuv422P; - - case VisionColorSpace.Rgb565: return ColorSpace.Rgb565; - - case VisionColorSpace.Rgb888: return ColorSpace.Rgb888; - - case VisionColorSpace.Rgba: return ColorSpace.Rgba8888; - } - - throw new NotSupportedException("Implementation does not support the specified value." + value.ToString()); - } - } - - internal static class VisionColorSpaceSupport - { - internal static VisionColorSpace ToVisionColorSpace(this ColorSpace colorSpace) - { - ValidationUtil.ValidateEnum(typeof(ColorSpace), colorSpace, nameof(colorSpace)); - - switch (colorSpace) - { - case ColorSpace.Y800: return VisionColorSpace.Y800; - - case ColorSpace.I420: return VisionColorSpace.I420; - - case ColorSpace.NV12: return VisionColorSpace.NV12; - - case ColorSpace.YV12: return VisionColorSpace.YV12; - - case ColorSpace.NV21: return VisionColorSpace.NV21; - - case ColorSpace.Yuyv: return VisionColorSpace.Yuyv; - - case ColorSpace.Uyvy: return VisionColorSpace.Uyvy; - - case ColorSpace.Yuv422P: return VisionColorSpace.Yuv422P; - - case ColorSpace.Rgb565: return VisionColorSpace.Rgb565; - - case ColorSpace.Rgb888: return VisionColorSpace.Rgb888; - - case ColorSpace.Rgba8888: return VisionColorSpace.Rgba; - } - - throw new NotSupportedException("Implementation does not support the specified value." + colorSpace.ToString()); - } - } -} diff --git a/src/Tizen.Multimedia.Vision/NamespaceDoc.cs b/src/Tizen.Multimedia.Vision/NamespaceDoc.cs deleted file mode 100644 index e66f4531e..000000000 --- a/src/Tizen.Multimedia.Vision/NamespaceDoc.cs +++ /dev/null @@ -1,25 +0,0 @@ -/* - * 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. - */ - -/// -/// The Tizen.Multimedia.Vision namespace contains classes and interfaces that support vision processing including -/// face detection, face recognition, face tracking, barcode detection, barcode generation, flat image detection, -/// flat image recognition, flat image tracking, flat image features extraction, movement detection, -/// person appearance/disappearance detection and person recognition. -/// -namespace Tizen.Multimedia.Vision -{ -} diff --git a/src/Tizen.Multimedia.Vision/Tizen.Multimedia.Vision.csproj b/src/Tizen.Multimedia.Vision/Tizen.Multimedia.Vision.csproj deleted file mode 100644 index ec9bff774..000000000 --- a/src/Tizen.Multimedia.Vision/Tizen.Multimedia.Vision.csproj +++ /dev/null @@ -1,11 +0,0 @@ - - - - netstandard2.0 - - - - - - - \ No newline at end of file diff --git a/src/Tizen.Multimedia.Vision/Tizen.Multimedia.Vision.sln b/src/Tizen.Multimedia.Vision/Tizen.Multimedia.Vision.sln deleted file mode 100755 index f0a5351b9..000000000 --- a/src/Tizen.Multimedia.Vision/Tizen.Multimedia.Vision.sln +++ /dev/null @@ -1,72 +0,0 @@ -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26730.12 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Multimedia.Vision", "Tizen.Multimedia.Vision.csproj", "{2BF51BFD-D43A-45D8-BAD6-E41B12B775A5}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Multimedia", "..\Tizen.Multimedia\Tizen.Multimedia.csproj", "{AA876642-6C17-43C9-B7DA-A8B68EDB7AC9}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ElmSharp", "..\ElmSharp\ElmSharp.csproj", "{E48B2C17-F195-4513-83BC-AC8FEED2A18B}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Applications.Common", "..\Tizen.Applications.Common\Tizen.Applications.Common.csproj", "{64939D2A-1985-44CF-A86C-1F0C6182855F}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.NUI", "..\Tizen.NUI\Tizen.NUI.csproj", "{E8F9F8C4-F64B-4BEC-8276-3D3889941206}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.System.SystemSettings", "..\Tizen.System.SystemSettings\Tizen.System.SystemSettings.csproj", "{82CFA43E-C1DD-4CA3-A590-6BF6B5161B36}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen", "..\Tizen\Tizen.csproj", "{74F57E7F-650D-4677-AA7C-B2A898C91517}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Log", "..\Tizen.Log\Tizen.Log.csproj", "{43582AEF-2F1E-40FF-8B48-9051A98043A9}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.System.Information", "..\Tizen.System.Information\Tizen.System.Information.csproj", "{5F4C6E94-6FC5-4267-B4D6-5565E5979B78}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {2BF51BFD-D43A-45D8-BAD6-E41B12B775A5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {2BF51BFD-D43A-45D8-BAD6-E41B12B775A5}.Debug|Any CPU.Build.0 = Debug|Any CPU - {2BF51BFD-D43A-45D8-BAD6-E41B12B775A5}.Release|Any CPU.ActiveCfg = Release|Any CPU - {2BF51BFD-D43A-45D8-BAD6-E41B12B775A5}.Release|Any CPU.Build.0 = Release|Any CPU - {AA876642-6C17-43C9-B7DA-A8B68EDB7AC9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {AA876642-6C17-43C9-B7DA-A8B68EDB7AC9}.Debug|Any CPU.Build.0 = Debug|Any CPU - {AA876642-6C17-43C9-B7DA-A8B68EDB7AC9}.Release|Any CPU.ActiveCfg = Release|Any CPU - {AA876642-6C17-43C9-B7DA-A8B68EDB7AC9}.Release|Any CPU.Build.0 = Release|Any CPU - {E48B2C17-F195-4513-83BC-AC8FEED2A18B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E48B2C17-F195-4513-83BC-AC8FEED2A18B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E48B2C17-F195-4513-83BC-AC8FEED2A18B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E48B2C17-F195-4513-83BC-AC8FEED2A18B}.Release|Any CPU.Build.0 = Release|Any CPU - {64939D2A-1985-44CF-A86C-1F0C6182855F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {64939D2A-1985-44CF-A86C-1F0C6182855F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {64939D2A-1985-44CF-A86C-1F0C6182855F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {64939D2A-1985-44CF-A86C-1F0C6182855F}.Release|Any CPU.Build.0 = Release|Any CPU - {E8F9F8C4-F64B-4BEC-8276-3D3889941206}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E8F9F8C4-F64B-4BEC-8276-3D3889941206}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E8F9F8C4-F64B-4BEC-8276-3D3889941206}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E8F9F8C4-F64B-4BEC-8276-3D3889941206}.Release|Any CPU.Build.0 = Release|Any CPU - {82CFA43E-C1DD-4CA3-A590-6BF6B5161B36}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {82CFA43E-C1DD-4CA3-A590-6BF6B5161B36}.Debug|Any CPU.Build.0 = Debug|Any CPU - {82CFA43E-C1DD-4CA3-A590-6BF6B5161B36}.Release|Any CPU.ActiveCfg = Release|Any CPU - {82CFA43E-C1DD-4CA3-A590-6BF6B5161B36}.Release|Any CPU.Build.0 = Release|Any CPU - {74F57E7F-650D-4677-AA7C-B2A898C91517}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {74F57E7F-650D-4677-AA7C-B2A898C91517}.Debug|Any CPU.Build.0 = Debug|Any CPU - {74F57E7F-650D-4677-AA7C-B2A898C91517}.Release|Any CPU.ActiveCfg = Release|Any CPU - {74F57E7F-650D-4677-AA7C-B2A898C91517}.Release|Any CPU.Build.0 = Release|Any CPU - {43582AEF-2F1E-40FF-8B48-9051A98043A9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {43582AEF-2F1E-40FF-8B48-9051A98043A9}.Debug|Any CPU.Build.0 = Debug|Any CPU - {43582AEF-2F1E-40FF-8B48-9051A98043A9}.Release|Any CPU.ActiveCfg = Release|Any CPU - {43582AEF-2F1E-40FF-8B48-9051A98043A9}.Release|Any CPU.Build.0 = Release|Any CPU - {5F4C6E94-6FC5-4267-B4D6-5565E5979B78}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {5F4C6E94-6FC5-4267-B4D6-5565E5979B78}.Debug|Any CPU.Build.0 = Debug|Any CPU - {5F4C6E94-6FC5-4267-B4D6-5565E5979B78}.Release|Any CPU.ActiveCfg = Release|Any CPU - {5F4C6E94-6FC5-4267-B4D6-5565E5979B78}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {D658DC62-9F57-4437-86B8-954FF2E26DB4} - EndGlobalSection -EndGlobal diff --git a/src/Tizen.Multimedia/AssemblyAttrs.cs b/src/Tizen.Multimedia/AssemblyAttrs.cs deleted file mode 100644 index 50e0b434b..000000000 --- a/src/Tizen.Multimedia/AssemblyAttrs.cs +++ /dev/null @@ -1,74 +0,0 @@ -/* - * 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. - */ - -// This file specifies any assembly attributes. -// Note that InternalsVisibleToAttribute can be removed or added and needs to be Multimedia packages only. - -using System.Runtime.CompilerServices; - -[assembly: InternalsVisibleTo("Tizen.Multimedia.AudioIO, " + - "PublicKey=0024000004800000940000000602000000240000525341310004000001000100d115b100424841" + - "6b12d21b626cfb17149c9303fe394693fd3b32d7872e89559a4fa96c98110c2e62eea48aca693b" + - "ddbe17094ca8ea2e2cd79970ca590fb672b9b371b5d7002076817321f62d6483ea50c56dbd1f37" + - "b185a4c24c47718876e6ae6d266508c551170d4cbdda3f82edaff9405ee3d7857282d8269e8e518d2f0fb2")] - -[assembly: InternalsVisibleTo("Tizen.Multimedia.Camera, " + - "PublicKey=0024000004800000940000000602000000240000525341310004000001000100d115b100424841" + - "6b12d21b626cfb17149c9303fe394693fd3b32d7872e89559a4fa96c98110c2e62eea48aca693b" + - "ddbe17094ca8ea2e2cd79970ca590fb672b9b371b5d7002076817321f62d6483ea50c56dbd1f37" + - "b185a4c24c47718876e6ae6d266508c551170d4cbdda3f82edaff9405ee3d7857282d8269e8e518d2f0fb2")] - -[assembly: InternalsVisibleTo("Tizen.Multimedia.MediaCodec, " + - "PublicKey=0024000004800000940000000602000000240000525341310004000001000100d115b100424841" + - "6b12d21b626cfb17149c9303fe394693fd3b32d7872e89559a4fa96c98110c2e62eea48aca693b" + - "ddbe17094ca8ea2e2cd79970ca590fb672b9b371b5d7002076817321f62d6483ea50c56dbd1f37" + - "b185a4c24c47718876e6ae6d266508c551170d4cbdda3f82edaff9405ee3d7857282d8269e8e518d2f0fb2")] - -[assembly: InternalsVisibleTo("Tizen.Multimedia.MediaPlayer, " + - "PublicKey=0024000004800000940000000602000000240000525341310004000001000100d115b100424841" + - "6b12d21b626cfb17149c9303fe394693fd3b32d7872e89559a4fa96c98110c2e62eea48aca693b" + - "ddbe17094ca8ea2e2cd79970ca590fb672b9b371b5d7002076817321f62d6483ea50c56dbd1f37" + - "b185a4c24c47718876e6ae6d266508c551170d4cbdda3f82edaff9405ee3d7857282d8269e8e518d2f0fb2")] - -[assembly: InternalsVisibleTo("Tizen.Multimedia.Recorder, " + - "PublicKey=0024000004800000940000000602000000240000525341310004000001000100d115b100424841" + - "6b12d21b626cfb17149c9303fe394693fd3b32d7872e89559a4fa96c98110c2e62eea48aca693b" + - "ddbe17094ca8ea2e2cd79970ca590fb672b9b371b5d7002076817321f62d6483ea50c56dbd1f37" + - "b185a4c24c47718876e6ae6d266508c551170d4cbdda3f82edaff9405ee3d7857282d8269e8e518d2f0fb2")] - -[assembly: InternalsVisibleTo("Tizen.Multimedia.StreamRecorder, " + - "PublicKey=0024000004800000940000000602000000240000525341310004000001000100d115b100424841" + - "6b12d21b626cfb17149c9303fe394693fd3b32d7872e89559a4fa96c98110c2e62eea48aca693b" + - "ddbe17094ca8ea2e2cd79970ca590fb672b9b371b5d7002076817321f62d6483ea50c56dbd1f37" + - "b185a4c24c47718876e6ae6d266508c551170d4cbdda3f82edaff9405ee3d7857282d8269e8e518d2f0fb2")] - -[assembly: InternalsVisibleTo("Tizen.Multimedia.Remoting, " + - "PublicKey=0024000004800000940000000602000000240000525341310004000001000100d115b100424841" + - "6b12d21b626cfb17149c9303fe394693fd3b32d7872e89559a4fa96c98110c2e62eea48aca693b" + - "ddbe17094ca8ea2e2cd79970ca590fb672b9b371b5d7002076817321f62d6483ea50c56dbd1f37" + - "b185a4c24c47718876e6ae6d266508c551170d4cbdda3f82edaff9405ee3d7857282d8269e8e518d2f0fb2")] - -[assembly: InternalsVisibleTo("Tizen.Multimedia.Util, " + - "PublicKey=0024000004800000940000000602000000240000525341310004000001000100d115b100424841" + - "6b12d21b626cfb17149c9303fe394693fd3b32d7872e89559a4fa96c98110c2e62eea48aca693b" + - "ddbe17094ca8ea2e2cd79970ca590fb672b9b371b5d7002076817321f62d6483ea50c56dbd1f37" + - "b185a4c24c47718876e6ae6d266508c551170d4cbdda3f82edaff9405ee3d7857282d8269e8e518d2f0fb2")] - -[assembly: InternalsVisibleTo("Tizen.Multimedia.Vision, " + - "PublicKey=0024000004800000940000000602000000240000525341310004000001000100d115b100424841" + - "6b12d21b626cfb17149c9303fe394693fd3b32d7872e89559a4fa96c98110c2e62eea48aca693b" + - "ddbe17094ca8ea2e2cd79970ca590fb672b9b371b5d7002076817321f62d6483ea50c56dbd1f37" + - "b185a4c24c47718876e6ae6d266508c551170d4cbdda3f82edaff9405ee3d7857282d8269e8e518d2f0fb2")] \ No newline at end of file diff --git a/src/Tizen.Multimedia/AudioManager/AudioDevice.cs b/src/Tizen.Multimedia/AudioManager/AudioDevice.cs deleted file mode 100755 index c5fa445a2..000000000 --- a/src/Tizen.Multimedia/AudioManager/AudioDevice.cs +++ /dev/null @@ -1,120 +0,0 @@ -/* - * 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; - -namespace Tizen.Multimedia -{ - /// - /// Provides the ability to query the information of sound devices. - /// - public class AudioDevice - { - private readonly int _id; - private readonly AudioDeviceType _type; - private readonly AudioDeviceIoDirection _ioDirection; - - internal AudioDevice(IntPtr deviceHandle) - { - int ret = Interop.AudioDevice.GetDeviceId(deviceHandle, out _id); - MultimediaDebug.AssertNoError(ret); - - ret = Interop.AudioDevice.GetDeviceName(deviceHandle, out var name); - MultimediaDebug.AssertNoError(ret); - - Name = Marshal.PtrToStringAnsi(name); - - ret = Interop.AudioDevice.GetDeviceType(deviceHandle, out _type); - MultimediaDebug.AssertNoError(ret); - - ret = (int)Interop.AudioDevice.GetDeviceIoDirection(deviceHandle, out _ioDirection); - MultimediaDebug.AssertNoError(ret); - } - - /// - /// Gets the ID of the device. - /// - /// The id of the device. - public int Id => _id; - - /// - /// Gets the name of the device. - /// - /// The name of the device. - public string Name { get; } - - /// - /// Gets the type of the device. - /// - /// The of the device. - public AudioDeviceType Type => _type; - - /// - /// Gets the IO direction of the device. - /// - /// The IO direction of the device. - public AudioDeviceIoDirection IoDirection => _ioDirection; - - /// - /// Gets the state of the device. - /// - /// The of the device. - public AudioDeviceState State - { - get - { - Interop.AudioDevice.GetDeviceState(Id, out var state). - Validate("Failed to get the state of the device"); - - return state; - } - } - - /// - /// Returns a string that represents the current object. - /// - /// A string that represents the current object. - public override string ToString() => - $"Id={Id}, Name={Name}, Type={Type}, IoDirection={IoDirection}, State={State}"; - - /// - /// Compares an object to an instance of for equality. - /// - /// A to compare. - /// true if the two devices are equal; otherwise, false. - public override bool Equals(object obj) - { - var rhs = obj as AudioDevice; - if (rhs == null) - { - return false; - } - - return Id == rhs.Id; - } - - - /// - /// Gets the hash code for this instance of . - /// - /// The hash code for this instance of . - public override int GetHashCode() - { - return Id.GetHashCode(); - } - } -} diff --git a/src/Tizen.Multimedia/AudioManager/AudioDeviceConnectionChangedEventArgs.cs b/src/Tizen.Multimedia/AudioManager/AudioDeviceConnectionChangedEventArgs.cs deleted file mode 100644 index d23266c9b..000000000 --- a/src/Tizen.Multimedia/AudioManager/AudioDeviceConnectionChangedEventArgs.cs +++ /dev/null @@ -1,44 +0,0 @@ -/* - * 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.Multimedia -{ - /// - /// Provides data for the event. - /// - public class AudioDeviceConnectionChangedEventArgs : EventArgs - { - internal AudioDeviceConnectionChangedEventArgs(AudioDevice device, bool isConnected) - { - Device = device; - IsConnected = isConnected; - } - - /// - /// Gets the device. - /// - /// The . - public AudioDevice Device { get; } - - /// - /// Gets the connection state of the device. - /// - /// true if the device is connected; otherwise, false. - public bool IsConnected { get; } - } -} diff --git a/src/Tizen.Multimedia/AudioManager/AudioDeviceStateChangedEventArgs.cs b/src/Tizen.Multimedia/AudioManager/AudioDeviceStateChangedEventArgs.cs deleted file mode 100644 index ba9e33a3c..000000000 --- a/src/Tizen.Multimedia/AudioManager/AudioDeviceStateChangedEventArgs.cs +++ /dev/null @@ -1,44 +0,0 @@ -/* - * 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.Multimedia -{ - /// - /// Provides data for the event. - /// - public class AudioDeviceStateChangedEventArgs : EventArgs - { - internal AudioDeviceStateChangedEventArgs(AudioDevice device, AudioDeviceState changedState) - { - Device = device; - State = changedState; - } - - /// - /// Gets the device. - /// - /// The . - public AudioDevice Device { get; } - - /// - /// Gets the state of the device. - /// - /// The of the device. - public AudioDeviceState State { get; } - } -} diff --git a/src/Tizen.Multimedia/AudioManager/AudioManager.cs b/src/Tizen.Multimedia/AudioManager/AudioManager.cs deleted file mode 100755 index b6be3d5ff..000000000 --- a/src/Tizen.Multimedia/AudioManager/AudioManager.cs +++ /dev/null @@ -1,202 +0,0 @@ -/* - * 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.Collections.Generic; - -namespace Tizen.Multimedia -{ - /// - /// Provides the ability to control volume levels and monitor audio devices. - /// - public static class AudioManager - { - static AudioManager() - { - VolumeController = new AudioVolume(); - } - - /// - /// Gets the volume controller. - /// - /// The . - public static AudioVolume VolumeController { get; } - - /// - /// Gets the all devices currently connected. - /// - /// An IEnumerable<AudioDevice> that contains connected devices. - public static IEnumerable GetConnectedDevices() - { - IntPtr deviceListHandle = IntPtr.Zero; - - try - { - var ret = Interop.AudioDevice.GetDeviceList(AudioDeviceOptions.All, out deviceListHandle); - - List result = new List(); - - if (ret == AudioManagerError.NoData) - { - return result; - } - - ret.Validate("Failed to get connected devices"); - - while (ret == AudioManagerError.None) - { - ret = Interop.AudioDevice.GetNextDevice(deviceListHandle, out var deviceHandle); - - if (ret == AudioManagerError.NoData) - { - break; - } - - ret.Validate("Failed to get connected devices"); - - result.Add(new AudioDevice(deviceHandle)); - } - return result; - } - finally - { - Interop.AudioDevice.FreeDeviceList(deviceListHandle); - } - } - - #region DeviceConnectionChanged event - private static int _deviceConnectionChangedCallbackId = -1; - - private static Interop.AudioDevice.ConnectionChangedCallback _audioDeviceConnectionChangedCallback; - private static EventHandler _audioDeviceConnectionChanged; - private static object _audioDeviceConnectionLock = new object(); - - /// - /// Occurs when the state of a connection of an audio device changes. - /// - public static event EventHandler DeviceConnectionChanged - { - add - { - lock (_audioDeviceConnectionLock) - { - if (_audioDeviceConnectionChanged == null) - { - RegisterAudioDeviceEvent(); - } - _audioDeviceConnectionChanged += value; - } - } - remove - { - if (value == null) - { - return; - } - - lock (_audioDeviceConnectionLock) - { - if (_audioDeviceConnectionChanged == value) - { - UnregisterDeviceConnectionChangedEvent(); - } - _audioDeviceConnectionChanged -= value; - } - } - } - - private static void RegisterAudioDeviceEvent() - { - _audioDeviceConnectionChangedCallback = (IntPtr device, bool isConnected, IntPtr userData) => - { - _audioDeviceConnectionChanged?.Invoke(null, - new AudioDeviceConnectionChangedEventArgs(new AudioDevice(device), isConnected)); - }; - - Interop.AudioDevice.AddDeviceConnectionChangedCallback(AudioDeviceOptions.All, - _audioDeviceConnectionChangedCallback, IntPtr.Zero, out _deviceConnectionChangedCallbackId). - Validate("Unable to add device connection changed callback"); - } - - private static void UnregisterDeviceConnectionChangedEvent() - { - Interop.AudioDevice.RemoveDeviceConnectionChangedCallback(_deviceConnectionChangedCallbackId). - Validate("Unable to remove device connection changed callback"); - } - #endregion - - #region DeviceStateChanged event - private static int _deviceStateChangedCallbackId = -1; - - private static Interop.AudioDevice.StateChangedCallback _audioDeviceStateChangedCallback; - private static EventHandler _audioDeviceStateChanged; - private static object _audioDeviceStateLock = new object(); - - /// - /// Occurs when the state of an audio device changes. - /// - public static event EventHandler DeviceStateChanged - { - add - { - lock (_audioDeviceStateLock) - { - if (_audioDeviceStateChanged == null) - { - RegisterDeviceStateChangedEvent(); - } - _audioDeviceStateChanged += value; - } - } - remove - { - if (value == null) - { - return; - } - - lock (_audioDeviceStateLock) - { - if (_audioDeviceStateChanged == value) - { - UnregisterDeviceStateChangedEvent(); - } - _audioDeviceStateChanged -= value; - } - } - } - - private static void RegisterDeviceStateChangedEvent() - { - _audioDeviceStateChangedCallback = (IntPtr device, AudioDeviceState changedState, IntPtr userData) => - { - _audioDeviceStateChanged?.Invoke(null, - new AudioDeviceStateChangedEventArgs(new AudioDevice(device), changedState)); - }; - - Interop.AudioDevice.AddDeviceStateChangedCallback(AudioDeviceOptions.All, - _audioDeviceStateChangedCallback, IntPtr.Zero, out _deviceStateChangedCallbackId). - Validate("Failed to add device state changed event"); - } - - private static void UnregisterDeviceStateChangedEvent() - { - Interop.AudioDevice.RemoveDeviceStateChangedCallback(_deviceStateChangedCallbackId). - Validate("Failed to remove device state changed event"); - } - #endregion - } -} diff --git a/src/Tizen.Multimedia/AudioManager/AudioManagerEnums.cs b/src/Tizen.Multimedia/AudioManager/AudioManagerEnums.cs deleted file mode 100644 index 74d90b1ac..000000000 --- a/src/Tizen.Multimedia/AudioManager/AudioManagerEnums.cs +++ /dev/null @@ -1,355 +0,0 @@ -/* - * 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.Multimedia -{ - /// - /// Specifies the flags for the audio device options. - /// - /// This enumeration has a attribute that allows a bitwise combination of its member values. - /// - /// - [Flags] - internal enum AudioDeviceOptions - { - /// - /// Input devices. - /// - Input = 0x0001, - /// - /// Output devices. - /// - Output = 0x0002, - /// - /// Input and output devices (both directions are available). - /// - InputAndOutput = 0x0004, - /// - /// Built-in devices. - /// - Internal = 0x00010, - /// - /// External devices. - /// - External = 0x0020, - /// - /// Deactivated devices. - /// - Deactivated = 0x1000, - /// - /// Activated devices. - /// - Activated = 0x2000, - - /// - /// All devices. - /// - All = 0xFFFF - } - - /// - /// Specifies the audio device types. - /// - public enum AudioDeviceType - { - /// - /// Built-in speaker. - /// - BuiltinSpeaker, - /// - /// Built-in receiver. - /// - BuiltinReceiver, - /// - /// Built-in microphone. - /// - BuiltinMic, - /// - /// Audio jack that can be connected to wired accessories such as headphones and headsets. - /// - AudioJack, - /// - /// Bluetooth media (A2DP). - /// - BluetoothMedia, - /// - /// HDMI. - /// - Hdmi, - /// - /// Device for forwarding. - /// - Forwarding, - /// - /// USB audio. - /// - UsbAudio, - /// - /// Bluetooth voice (SCO). - /// - BluetoothVoice - } - - /// - /// Specifies the audio device directions. - /// - public enum AudioDeviceIoDirection - { - /// - /// Input device. - /// - Input, - /// - /// Output device. - /// - Output, - /// - /// Input/output device (both directions are available). - /// - InputAndOutput - } - - /// - /// Specifies the audio device states. - /// - public enum AudioDeviceState - { - /// - /// Deactivated state. - /// - Deactivated, - /// - /// Activated state. - /// - Activated - } - - /// - /// Specifies the audio volume types. - /// - public enum AudioVolumeType - { - /// - /// System. - /// - System, - /// - /// Notification. - /// - Notification, - /// - /// Alarm. - /// - Alarm, - /// - /// Ringtone. - /// - Ringtone, - /// - /// Media. - /// - Media, - /// - /// Call. - /// - Call, - /// - /// VoIP. - /// - Voip, - /// - /// Voice. - /// - Voice, - /// - /// No volume exists. - /// - /// - None - } - - /// - /// Specifies the audio stream types. - /// - public enum AudioStreamType - { - /// - /// Media. - /// - Media, - /// - /// System. - /// - System, - /// - /// Alarm. - /// - Alarm, - /// - /// Notification. - /// - Notification, - /// - /// Emergency. - /// - Emergency, - /// - /// Voice information. - /// - VoiceInformation, - /// - /// Voice recognition. - /// - VoiceRecognition, - /// - /// Ringtone for VoIP. - /// - RingtoneVoip, - /// - /// VoIP. - /// - Voip, - /// - /// Media only for external devices. - /// - MediaExternalOnly - } - - /// - /// Specifies the change reasons of the audio stream focus state. - /// - public enum AudioStreamFocusChangedReason - { - /// - /// Media. - /// - Media, - /// - /// System. - /// - System, - /// - /// Alarm. - /// - Alarm, - /// - /// Notification. - /// - Notification, - /// - /// Emergency. - /// - Emergency, - /// - /// Voice information. - /// - VoiceInformation, - /// - /// Voice recognition. - /// - VoiceRecognition, - /// - /// Ringtone. - /// - RingtoneVoip, - /// - /// VoIP. - /// - Voip, - /// - /// Voice-call or video-call. - /// - Call, - /// - /// Media only for external devices. - /// - MediaExternalOnly - } - - /// - /// Specifies the flags for the audio stream focus options. - /// - /// This enumeration has a attribute that allows a bitwise combination of its member values. - /// - /// - [Flags] - public enum AudioStreamFocusOptions - { - /// - /// Playback focus. - /// - Playback = 0x0001, - /// - /// Recording focus. - /// - Recording = 0x0002 - } - - /// - /// Specifies the audio stream focus states. - /// - public enum AudioStreamFocusState - { - /// - /// Focus state for release. - /// - Released, - /// - /// Focus state for acquisition. - /// - Acquired - } - - /// - /// Specifies the flags for the audio stream behaviors. - /// - /// This enumeration has a attribute that allows a bitwise combination of its member values. - /// - /// - [Flags] - public enum AudioStreamBehaviors - { - /// - /// No Resume. - /// - NoResume = 0x0001, - /// - /// Fading. - /// - Fading = 0x0002 - } - - - internal static class AudioManagerEnumExtensions - { - internal static bool IsValid(this AudioStreamFocusOptions value) - { - int mask = (int)(AudioStreamFocusOptions.Playback | AudioStreamFocusOptions.Recording); - - return (mask & (int)value) != 0; - } - - internal static bool IsValid(this AudioStreamBehaviors value) - { - int mask = (int)(AudioStreamBehaviors.NoResume | AudioStreamBehaviors.Fading); - - return ((~mask) & (int)value) == 0; - } - } - -} diff --git a/src/Tizen.Multimedia/AudioManager/AudioManagerError.cs b/src/Tizen.Multimedia/AudioManager/AudioManagerError.cs deleted file mode 100644 index f9902482a..000000000 --- a/src/Tizen.Multimedia/AudioManager/AudioManagerError.cs +++ /dev/null @@ -1,115 +0,0 @@ -/* - * 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.Multimedia -{ - internal enum AudioManagerError - { - SoundManagerError = -0x01960000, - /// - /// Successful - /// - None = ErrorCode.None, - /// - /// Out of memory - /// - OutOfMemory = ErrorCode.OutOfMemory, - /// - /// Invalid parameter - /// - InvalidParameter = ErrorCode.InvalidParameter, - /// - /// Invalid operation - /// - InvalidOperation = ErrorCode.InvalidOperation, - /// - /// Permission denied - /// - PermissionDenied = ErrorCode.PermissionDenied, - /// - /// Not supported - /// - NotSupported = ErrorCode.NotSupported, - /// - /// No data - /// - NoData = ErrorCode.NoData, - /// - /// Internal error inside the sound system - /// - Internal = SoundManagerError | 01, - /// - /// Noncompliance with the sound system policy - /// - Policy = SoundManagerError | 02, - /// - /// No playing sound - /// - NoPlayingSound = SoundManagerError | 03, - /// - /// Invalid state (Since 3.0) - /// - InvalidState = SoundManagerError | 04 - } - - internal static class AudioManagerErrorExtensions - { - internal static void Validate(this AudioManagerError err, string msg) - { - if (err == AudioManagerError.None) - { - return; - } - - msg = msg ?? ""; - msg += $" : {err}."; - - switch (err) - { - case AudioManagerError.OutOfMemory: - throw new OutOfMemoryException(msg); - - case AudioManagerError.InvalidParameter: - throw new ArgumentException(msg); - - case AudioManagerError.PermissionDenied: - throw new UnauthorizedAccessException(msg); - - case AudioManagerError.NotSupported: - throw new NotSupportedException(msg); - - case AudioManagerError.Policy: - throw new AudioPolicyException(msg); - - case AudioManagerError.NoData: - // TODO check when it is thrown - throw new InvalidOperationException(msg); - - case AudioManagerError.Internal: - case AudioManagerError.InvalidOperation: - case AudioManagerError.NoPlayingSound: - case AudioManagerError.InvalidState: - throw new InvalidOperationException(msg); - - default: - throw new InvalidOperationException("Unknown Error : " + msg); - } - } - } -} diff --git a/src/Tizen.Multimedia/AudioManager/AudioPolicyException.cs b/src/Tizen.Multimedia/AudioManager/AudioPolicyException.cs deleted file mode 100644 index b0d48903e..000000000 --- a/src/Tizen.Multimedia/AudioManager/AudioPolicyException.cs +++ /dev/null @@ -1,50 +0,0 @@ -/* - * 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.Multimedia -{ - /// - /// The exception that is thrown when noncompliance with the sound system policy happens. - /// - public class AudioPolicyException : InvalidOperationException - { - /// - /// Initializes a new instance of the class. - /// - public AudioPolicyException() - { - } - - /// - /// Initializes a new instance of the class with a specified error message. - /// - /// The error message that explains the reason for the exception. - public AudioPolicyException(string message) : base(message) - { - } - - /// - /// Initializes a new instance of the class with a specified error message and inner exception. - /// - /// The error message that explains the reason for the exception. - /// The exception that is the cause of the current exception.. - public AudioPolicyException(string message, Exception innerException) : base(message, innerException) - { - } - } -} diff --git a/src/Tizen.Multimedia/AudioManager/AudioStreamPolicy.cs b/src/Tizen.Multimedia/AudioManager/AudioStreamPolicy.cs deleted file mode 100755 index 2429e3964..000000000 --- a/src/Tizen.Multimedia/AudioManager/AudioStreamPolicy.cs +++ /dev/null @@ -1,368 +0,0 @@ -/* - * 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.Diagnostics; - -namespace Tizen.Multimedia -{ - /// - /// Provides the ability to control the sound stream. - /// - public class AudioStreamPolicy : IDisposable - { - private AudioStreamPolicyHandle _handle; - private bool _disposed = false; - private Interop.AudioStreamPolicy.FocusStateChangedCallback _focusStateChangedCallback; - - /// - /// Initializes a new instance of the class with - /// - /// - /// To apply the stream policy according to this stream information, the AudioStreamPolicy should - /// be passed to other APIs related to playback or recording. (For example., , , etc.) - /// - /// The type of the sound stream for which the policy needs to be created. - /// is invalid. - public AudioStreamPolicy(AudioStreamType streamType) - { - ValidationUtil.ValidateEnum(typeof(AudioStreamType), streamType, nameof(streamType)); - - _focusStateChangedCallback = (IntPtr streamInfo, AudioStreamFocusOptions focusMask, - AudioStreamFocusState state, AudioStreamFocusChangedReason reason, AudioStreamBehaviors behaviors, - string extraInfo, IntPtr userData) => - { - FocusStateChanged?.Invoke(this, - new AudioStreamPolicyFocusStateChangedEventArgs(focusMask, state, reason, behaviors, extraInfo)); - }; - - Interop.AudioStreamPolicy.Create(streamType, _focusStateChangedCallback, - IntPtr.Zero, out _handle).Validate("Unable to create stream information"); - - Debug.Assert(_handle != null); - } - - /// - /// Occurs when the state of focus that belongs to the current AudioStreamPolicy is changed. - /// - /// - /// The event is raised in the internal thread. - /// - public event EventHandler FocusStateChanged; - - /// - /// Gets the . - /// - /// - /// If the of the current AudioStreamPolicy is , - /// it returns . - /// - /// The of the policy instance. - /// The has already been disposed of. - public AudioVolumeType VolumeType - { - get - { - AudioVolumeType type; - var ret = Interop.AudioStreamPolicy.GetSoundType(Handle, out type); - if (ret == AudioManagerError.NoData) - { - return AudioVolumeType.None; - } - - ret.Validate("Failed to get volume type"); - - return type; - } - } - - private AudioStreamFocusState GetFocusState(bool playback) - { - int ret = Interop.AudioStreamPolicy.GetFocusState(Handle, out var stateForPlayback, out var stateForRecording); - MultimediaDebug.AssertNoError(ret); - - return playback ? stateForPlayback : stateForRecording; - } - - /// - /// Gets the state of focus for the playback. - /// - /// The state of focus for playback. - /// The has already been disposed of. - public AudioStreamFocusState PlaybackFocusState => GetFocusState(true); - - /// - /// Gets the state of focus for the recording. - /// - /// The state of focus for recording. - /// The has already been disposed of. - public AudioStreamFocusState RecordingFocusState => GetFocusState(false); - - /// - /// Gets or sets the auto focus reacquisition. - /// - /// - /// true if the auto focus reacquisition is enabled; otherwise, false.\n - /// The default is true. - /// - /// - /// If you don't want to reacquire the focus you've lost automatically, - /// disable the focus reacquisition. - /// - /// The has already been disposed of. - public bool FocusReacquisitionEnabled - { - get - { - Interop.AudioStreamPolicy.GetFocusReacquisition(Handle, out var enabled). - Validate("Failed to get focus reacquisition state"); - - return enabled; - } - set - { - Interop.AudioStreamPolicy.SetFocusReacquisition(Handle, value). - Validate("Failed to set focus reacquisition"); - } - } - - internal AudioStreamPolicyHandle Handle - { - get - { - if (_disposed) - { - throw new ObjectDisposedException(nameof(AudioStreamPolicy)); - } - return _handle; - } - } - - /// - /// Acquires the stream focus. - /// - /// The focuses that you want to acquire. - /// The requesting behaviors. - /// The extra information for this request. This value can be null. - /// is zero. - /// - /// contain a invalid bit.\n - /// -or-\n - /// contain a invalid bit.\n - /// - /// The focus has already been acquired. - /// Called in raised by releasing focus. - /// The has already been disposed of. - public void AcquireFocus(AudioStreamFocusOptions options, AudioStreamBehaviors behaviors, string extraInfo) - { - if (options == 0) - { - throw new ArgumentException("options can't be zero.", nameof(options)); - } - - if (options.IsValid() == false) - { - throw new ArgumentOutOfRangeException(nameof(options), options, "options contains a invalid bit."); - } - - if (behaviors.IsValid() == false) - { - throw new ArgumentOutOfRangeException(nameof(behaviors), behaviors, "behaviors contains a invalid bit."); - } - - Interop.AudioStreamPolicy.AcquireFocus(Handle, options, behaviors, extraInfo). - Validate("Failed to acquire focus"); - } - - /// - /// Releases the acquired focus. - /// - /// The focus mask that you want to release. - /// The requesting behaviors. - /// The extra information for this request. This value can be null. - /// is zero. - /// - /// contain a invalid bit.\n - /// -or-\n - /// contain a invalid bit.\n - /// - /// The focus has not been acquired. - /// The has already been disposed of. - public void ReleaseFocus(AudioStreamFocusOptions options, AudioStreamBehaviors behaviors, string extraInfo) - { - if (options == 0) - { - throw new ArgumentException("options can't be zero.", nameof(options)); - } - - if (options.IsValid() == false) - { - throw new ArgumentOutOfRangeException(nameof(options), options, "options contains a invalid bit."); - } - - if (behaviors.IsValid() == false) - { - throw new ArgumentOutOfRangeException(nameof(behaviors), behaviors, "behaviors contains a invalid bit."); - } - - Interop.AudioStreamPolicy.ReleaseFocus(Handle, options, behaviors, extraInfo). - Validate("Failed to release focus"); - } - - /// - /// Applies the stream routing. - /// - /// - /// If the stream has not been made yet, this will be applied when the stream starts to play. - /// - /// - /// - /// The has already been disposed of. - public void ApplyStreamRouting() - { - Interop.AudioStreamPolicy.ApplyStreamRouting(Handle).Validate("Failed to apply stream routing"); - } - - /// - /// Adds a device for the stream routing. - /// - /// The device to add. - /// - /// The available is and . - /// - /// - /// The device is not connected.\n - /// -or-\n - /// An internal error occurs. - /// - /// is null. - /// of is unavailable for this. - /// The has already been disposed of. - /// - /// - public void AddDeviceForStreamRouting(AudioDevice device) - { - if (device == null) - { - throw new ArgumentNullException(nameof(device)); - } - - var ret = Interop.AudioStreamPolicy.AddDeviceForStreamRouting(Handle, device.Id); - - if (ret == AudioManagerError.NoData) - { - throw new InvalidOperationException("The device seems not connected."); - } - - ret.Validate("Failed to add device for stream routing"); - } - - /// - /// Removes the device for the stream routing. - /// - /// The device to remove. - /// - /// The available is and . - /// - /// An internal error occurs. - /// is null. - /// The has already been disposed of. - /// - public void RemoveDeviceForStreamRouting(AudioDevice device) - { - if (device == null) - { - throw new ArgumentNullException(nameof(device)); - } - - Interop.AudioStreamPolicy.RemoveDeviceForStreamRouting(Handle, device.Id). - Validate("Failed to remove device for stream routing"); - } - - /// - /// Releases all resources used by the . - /// - public void Dispose() - { - Dispose(true); - } - - /// - /// Releases the unmanaged resources used by the . - /// - /// true to release both managed and unmanaged resources; false to release only unmanaged resources. - protected virtual void Dispose(bool disposing) - { - if (!_disposed) - { - if (_handle != null) - { - _handle.Dispose(); - } - _disposed = true; - } - } - - #region Static events - - private static bool _isWatchCallbackRegistered; - private static EventHandler _streamFocusStateChanged; - private static Interop.AudioStreamPolicy.FocusStateWatchCallback _focusStateWatchCallback; - private static object _streamFocusEventLock = new object(); - - /// - /// Occurs when the focus state for stream types is changed regardless of the process. - /// - public static event EventHandler StreamFocusStateChanged - { - add - { - lock (_streamFocusEventLock) - { - if (_isWatchCallbackRegistered == false) - { - RegisterFocusStateWatch(); - _isWatchCallbackRegistered = true; - } - _streamFocusStateChanged += value; - } - } - remove - { - lock (_streamFocusEventLock) - { - _streamFocusStateChanged -= value; - } - } - } - - private static void RegisterFocusStateWatch() - { - _focusStateWatchCallback = (int id, AudioStreamFocusOptions options, AudioStreamFocusState focusState, - AudioStreamFocusChangedReason reason, string extraInfo, IntPtr userData) => - { - _streamFocusStateChanged?.Invoke(null, - new StreamFocusStateChangedEventArgs(options, focusState, reason, extraInfo)); - }; - - Interop.AudioStreamPolicy.AddFocusStateWatchCallback( - AudioStreamFocusOptions.Playback | AudioStreamFocusOptions.Recording, - _focusStateWatchCallback, IntPtr.Zero, out var cbId). - Validate("Failed to initialize focus state event"); - } - #endregion - } -} diff --git a/src/Tizen.Multimedia/AudioManager/AudioStreamPolicyFocusStateChangedEventArgs.cs b/src/Tizen.Multimedia/AudioManager/AudioStreamPolicyFocusStateChangedEventArgs.cs deleted file mode 100644 index c8b3e7062..000000000 --- a/src/Tizen.Multimedia/AudioManager/AudioStreamPolicyFocusStateChangedEventArgs.cs +++ /dev/null @@ -1,72 +0,0 @@ -/* - * 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.Multimedia -{ - /// - /// Provides data for the event. - /// - public class AudioStreamPolicyFocusStateChangedEventArgs : EventArgs - { - internal AudioStreamPolicyFocusStateChangedEventArgs(AudioStreamFocusOptions options, - AudioStreamFocusState state, AudioStreamFocusChangedReason reason, - AudioStreamBehaviors behaviors, string extraInfo) - { - FocusOptions = options; - FocusState = state; - Reason = reason; - Behaviors = behaviors; - ExtraInfo = extraInfo; - } - - /// - /// Gets the focus options. - /// - /// The focus options. - public AudioStreamFocusOptions FocusOptions { get; } - - /// - /// Gets the focus state. - /// - /// The focus state. - public AudioStreamFocusState FocusState { get; } - - /// - /// Gets the reason for state change of the focus. - /// - /// The reason for state change of the focus. - public AudioStreamFocusChangedReason Reason { get; } - - /// - /// Gets the requested behaviors that should be followed - /// - /// The requested behaviors that should be followed. - public AudioStreamBehaviors Behaviors { get; } - - /// - /// Gets the extra information. - /// - /// - /// The extra information specified in or - /// . - /// - /// - /// - public string ExtraInfo { get; } - } -} diff --git a/src/Tizen.Multimedia/AudioManager/AudioVolume.cs b/src/Tizen.Multimedia/AudioManager/AudioVolume.cs deleted file mode 100755 index d50df6623..000000000 --- a/src/Tizen.Multimedia/AudioManager/AudioVolume.cs +++ /dev/null @@ -1,125 +0,0 @@ -/* - * 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.Multimedia -{ - /// - /// Provides the ability to control the volume levels. - /// - /// - public class AudioVolume - { - private const string Tag = "Tizen.Multimedia.AudioVolume"; - - private int _volumeChangedCallbackId = -1; - private EventHandler _volumeChanged; - private Interop.AudioVolume.VolumeChangedCallback _volumeChangedCallback; - - private object _eventLock = new object(); - - internal AudioVolume() - { - Level = new VolumeLevel(); - MaxLevel = new MaxVolumeLevel(); - } - - /// - /// Occurs when the volume level is changed. - /// - public event EventHandler Changed - { - add - { - lock (_eventLock) - { - if (_volumeChanged == null) - { - RegisterVolumeChangedEvent(); - } - _volumeChanged += value; - } - } - remove - { - if (value == null) - { - return; - } - - lock (_eventLock) - { - if (_volumeChanged == value) - { - UnregisterVolumeChangedEvent(); - } - _volumeChanged -= value; - } - } - } - - /// - /// Gets the volume type of the sound being currently played. - /// - /// The volume type of the sound being currently played. - public AudioVolumeType CurrentPlaybackType - { - get - { - var ret = Interop.AudioVolume.GetCurrentSoundType(out var currentType); - if (ret == AudioManagerError.NoPlayingSound) - { - return AudioVolumeType.None; - } - ret.Validate("Failed to get current volume type"); - - return currentType; - } - } - - /// - /// Gets the . - /// - /// The . - public VolumeLevel Level { get; } - - /// - /// Gets the . - /// - /// The . - public MaxVolumeLevel MaxLevel { get; } - - private void RegisterVolumeChangedEvent() - { - _volumeChangedCallback = (AudioVolumeType type, uint volume, IntPtr userData) => - { - _volumeChanged?.Invoke(this, new VolumeChangedEventArgs(type, volume)); - }; - var error = Interop.AudioVolume.AddVolumeChangedCallback(_volumeChangedCallback, IntPtr.Zero, - out _volumeChangedCallbackId); - Log.Info(Tag, $"VolumeController callback id:{_volumeChangedCallbackId}"); - - error.Validate("Failed to add volume changed event"); - } - - private void UnregisterVolumeChangedEvent() - { - Interop.AudioVolume.RemoveVolumeChangedCallback(_volumeChangedCallbackId). - Validate("Failed to remove volume changed event"); - } - } -} diff --git a/src/Tizen.Multimedia/AudioManager/MaxVolumeLevel.cs b/src/Tizen.Multimedia/AudioManager/MaxVolumeLevel.cs deleted file mode 100644 index 931d9c155..000000000 --- a/src/Tizen.Multimedia/AudioManager/MaxVolumeLevel.cs +++ /dev/null @@ -1,56 +0,0 @@ -/* - * 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.Multimedia -{ - /// - /// Provides a means to get max volume levels. - /// - public class MaxVolumeLevel - { - internal MaxVolumeLevel() - { - } - - /// - /// Gets the max volume level of the specified - /// - /// The to query. - /// The maximum volume level. - /// is invalid. - /// is . - public int this[AudioVolumeType type] - { - get - { - ValidationUtil.ValidateEnum(typeof(AudioVolumeType), type, nameof(type)); - - if (type == AudioVolumeType.None) - { - throw new ArgumentOutOfRangeException(nameof(type), - "Cannot get max volume level for AudioVolumeType.None"); - } - - Interop.AudioVolume.GetMaxVolume(type, out var maxVolume). - Validate("Failed to get the max volume level"); - - return maxVolume; - } - } - } -} diff --git a/src/Tizen.Multimedia/AudioManager/StreamFocusStateChangedEventArgs.cs b/src/Tizen.Multimedia/AudioManager/StreamFocusStateChangedEventArgs.cs deleted file mode 100755 index fc00e9210..000000000 --- a/src/Tizen.Multimedia/AudioManager/StreamFocusStateChangedEventArgs.cs +++ /dev/null @@ -1,64 +0,0 @@ -/* - * 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.Multimedia -{ - /// - /// Provides data for the event. - /// - public class StreamFocusStateChangedEventArgs : EventArgs - { - internal StreamFocusStateChangedEventArgs(AudioStreamFocusOptions options, - AudioStreamFocusState focusState, AudioStreamFocusChangedReason reason, string extraInfo) - { - FocusOptions = options; - FocusState = focusState; - Reason = reason; - ExtraInfo = extraInfo; - } - - /// - /// Gets the focus options. - /// - /// The focus options. - public AudioStreamFocusOptions FocusOptions { get; } - - /// - /// Gets the changed focus state. - /// - /// The focus state. - public AudioStreamFocusState FocusState { get; } - - /// - /// Gets the reason for state change of the focus. - /// - /// The reason for state change of the focus. - public AudioStreamFocusChangedReason Reason { get; } - - /// - /// Gets the extra information. - /// - /// - /// The extra information specified in or - /// . - /// - /// - /// - public string ExtraInfo { get; } - } -} diff --git a/src/Tizen.Multimedia/AudioManager/VolumeChangedEventArgs.cs b/src/Tizen.Multimedia/AudioManager/VolumeChangedEventArgs.cs deleted file mode 100755 index aa4b901af..000000000 --- a/src/Tizen.Multimedia/AudioManager/VolumeChangedEventArgs.cs +++ /dev/null @@ -1,44 +0,0 @@ -/* - * 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.Multimedia -{ - /// - /// Provides data for the event. - /// - public class VolumeChangedEventArgs : EventArgs - { - internal VolumeChangedEventArgs(AudioVolumeType type, uint level) - { - Type = type; - Level = (int)level; - } - - /// - /// Gets the sound type that volume is changed. - /// - /// The sound type that volume is changed. - public AudioVolumeType Type { get; } - - /// - /// Gets the new volume level. - /// - /// The new volume level. - public int Level { get; } - } -} diff --git a/src/Tizen.Multimedia/AudioManager/VolumeLevel.cs b/src/Tizen.Multimedia/AudioManager/VolumeLevel.cs deleted file mode 100644 index cdfcbf023..000000000 --- a/src/Tizen.Multimedia/AudioManager/VolumeLevel.cs +++ /dev/null @@ -1,84 +0,0 @@ -/* - * 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.Multimedia -{ - /// - /// Provides a means to control volume levels. - /// - public class VolumeLevel - { - internal VolumeLevel() - { - } - - /// - /// Gets or sets the volume level of the specified - /// - /// The to control. - /// The current volume level. - /// To set volumes, the specified privilege is required. - /// http://tizen.org/privilege/volume.set - /// is invalid. - /// - /// is . - /// -or- - /// is less than zero. - /// -or- - /// is greater than . - /// - /// The caller does not have required privilege to set volume. - public int this[AudioVolumeType type] - { - get - { - ValidationUtil.ValidateEnum(typeof(AudioVolumeType), type, nameof(type)); - - if (type == AudioVolumeType.None) - { - throw new ArgumentOutOfRangeException(nameof(type), - "Cannot get volume level for AudioVolumeType.None"); - } - - Interop.AudioVolume.GetVolume(type, out var volume).Validate("Failed to get the volume level"); - - return volume; - } - set - { - ValidationUtil.ValidateEnum(typeof(AudioVolumeType), type, nameof(value)); - - if (type == AudioVolumeType.None) - { - throw new ArgumentOutOfRangeException(nameof(type), - "Cannot set volume level for AudioVolumeType.None"); - } - - var ret = Interop.AudioVolume.SetVolume(type, value); - - if (ret == AudioManagerError.InvalidParameter) - { - throw new ArgumentOutOfRangeException(nameof(value), value, - $"valid volume level range is 0 <= x <= {nameof(MaxVolumeLevel)}[{nameof(AudioVolumeType)}]"); - } - - ret.Validate("Failed to set the volume level"); - } - } - } -} diff --git a/src/Tizen.Multimedia/Common.Internal/DependentMediaBuffer.cs b/src/Tizen.Multimedia/Common.Internal/DependentMediaBuffer.cs deleted file mode 100644 index 855c83d35..000000000 --- a/src/Tizen.Multimedia/Common.Internal/DependentMediaBuffer.cs +++ /dev/null @@ -1,49 +0,0 @@ -/* - * 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.Diagnostics; - -namespace Tizen.Multimedia -{ - /// - /// Represents a buffer that is dependent on the owner object. - /// - internal class DependentMediaBuffer : MediaBufferBase - { - private readonly IBufferOwner _owner; - - internal DependentMediaBuffer(IBufferOwner owner, IntPtr dataHandle, int size) - : base(dataHandle, size) - { - Debug.Assert(owner != null, "Owner is null!"); - Debug.Assert(!owner.IsDisposed, "Owner has been already disposed!"); - - _owner = owner; - } - - - internal override void ValidateBufferReadable() - { - _owner.ValidateBufferReadable(this); - } - - internal override void ValidateBufferWritable() - { - _owner.ValidateBufferWritable(this); - } - } -} diff --git a/src/Tizen.Multimedia/Common.Internal/Features.cs b/src/Tizen.Multimedia/Common.Internal/Features.cs deleted file mode 100755 index 58b1ec6ea..000000000 --- a/src/Tizen.Multimedia/Common.Internal/Features.cs +++ /dev/null @@ -1,34 +0,0 @@ -/* - * 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 Tizen.System; - -namespace Tizen.Multimedia -{ - internal static class Features - { - internal const string AudioEffect = "http://tizen.org/feature/multimedia.custom_audio_effect"; - internal const string RawVideo = "http://tizen.org/feature/multimedia.raw_video"; - - internal static bool IsSupported(string featureKey) - { - bool supported = false; - Information.TryGetValue(featureKey, out supported); - return supported; - } - - } -} diff --git a/src/Tizen.Multimedia/Common.Internal/FileUtil.cs b/src/Tizen.Multimedia/Common.Internal/FileUtil.cs deleted file mode 100644 index 2b3e6f5ac..000000000 --- a/src/Tizen.Multimedia/Common.Internal/FileUtil.cs +++ /dev/null @@ -1,44 +0,0 @@ -/* - * 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.IO; - -namespace Tizen.Multimedia -{ - internal static class FileUtil - { - public static bool HasReadPermission(string path) - { - return Access(path, Interop.Libc.AccessMode.R_OK); - } - - public static bool HasWritePermission(string path) - { - - return Access(Path.GetDirectoryName(path), Interop.Libc.AccessMode.W_OK); - } - - private static bool Access(string path, int mode) - { - if (path == null) - { - throw new ArgumentNullException(nameof(path)); - } - return Interop.Libc.Access(path, mode) == 0; - } - } -} diff --git a/src/Tizen.Multimedia/Common.Internal/IBufferOwner.cs b/src/Tizen.Multimedia/Common.Internal/IBufferOwner.cs deleted file mode 100644 index 16acf08ff..000000000 --- a/src/Tizen.Multimedia/Common.Internal/IBufferOwner.cs +++ /dev/null @@ -1,64 +0,0 @@ -/* - * 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.Multimedia -{ - internal enum MediaBufferAccessMode - { - Read, - Write - } - - internal interface IBufferOwner - { - bool IsBufferAccessible(object buffer, MediaBufferAccessMode accessMode); - - bool IsDisposed { get; } - } - - - internal static class BufferOwnerExtensions - { - internal static void ValidateBufferReadable(this IBufferOwner bufferOwner, IMediaBuffer buffer) - { - if (bufferOwner.IsDisposed) - { - throw new ObjectDisposedException(bufferOwner.GetType().Name); - } - - if (!bufferOwner.IsBufferAccessible(buffer, MediaBufferAccessMode.Read)) - { - throw new InvalidOperationException("The buffer is not in the readable state."); - } - } - - internal static void ValidateBufferWritable(this IBufferOwner bufferOwner, IMediaBuffer buffer) - { - if (bufferOwner.IsDisposed) - { - throw new ObjectDisposedException(bufferOwner.GetType().Name); - } - - if (!bufferOwner.IsBufferAccessible(buffer, MediaBufferAccessMode.Write)) - { - throw new InvalidOperationException("The buffer is not in the writable state."); - } - } - } - -} diff --git a/src/Tizen.Multimedia/Common.Internal/LibcSupport.cs b/src/Tizen.Multimedia/Common.Internal/LibcSupport.cs deleted file mode 100644 index c888cd760..000000000 --- a/src/Tizen.Multimedia/Common.Internal/LibcSupport.cs +++ /dev/null @@ -1,28 +0,0 @@ -/* - * 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.Multimedia -{ - internal static class LibcSupport - { - internal static void Free(IntPtr ptr) - { - Interop.Libc.Free(ptr); - } - } -} diff --git a/src/Tizen.Multimedia/Common.Internal/MediaBufferBase.cs b/src/Tizen.Multimedia/Common.Internal/MediaBufferBase.cs deleted file mode 100644 index 553a0dc7f..000000000 --- a/src/Tizen.Multimedia/Common.Internal/MediaBufferBase.cs +++ /dev/null @@ -1,168 +0,0 @@ -/* - * 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.Diagnostics; -using System.Runtime.InteropServices; - -namespace Tizen.Multimedia -{ - internal abstract class MediaBufferBase : IMediaBuffer - { - private readonly IntPtr _dataHandle; - - public int Length { get; } - - internal MediaBufferBase(IntPtr dataHandle, int size, bool isReadOnly) - { - Debug.Assert(dataHandle != IntPtr.Zero, "dataHandle is null!"); - Debug.Assert(size >= 0, "size must not be negative!"); - - _dataHandle = dataHandle; - Length = size; - IsReadOnly = false; - } - - internal MediaBufferBase(IntPtr dataHandle, int size) : - this(dataHandle, size, false) - { - } - - internal IntPtr DataHandle => _dataHandle; - - public bool IsReadOnly { get; } - - /// - /// Validates the range. - /// - /// - /// - /// - /// The offset + length is greater than . - /// -or- - /// The offset or length is less than zero. - /// - private void ValidateRange(int offset, int length) - { - if (offset + length > Length) - { - throw new ArgumentOutOfRangeException($"{nameof(offset)}, {nameof(length)}", - "offset + length can't be greater than length of the buffer."); - } - if (length < 0) - { - throw new ArgumentOutOfRangeException(nameof(length), length, - $"Length can't be less than zero."); - } - if (offset < 0) - { - throw new ArgumentOutOfRangeException(nameof(offset), offset, - $"Offset can't be less than zero."); - } - } - - public byte this[int index] - { - get - { - ThrowIfBufferIsNotReadable(); - - if (index < 0 || index >= Length) - { - throw new ArgumentOutOfRangeException(nameof(index), index, - $"Valid index range is [0, { nameof(Length) })."); - } - - return Marshal.ReadByte(DataHandle, index); - } - set - { - ThrowIfBufferIsNotWritable(); - - Marshal.WriteByte(DataHandle, index, value); - } - } - - private void ThrowIfBufferIsNotReadable() - { - ValidateBufferReadable(); - } - - private void ThrowIfBufferIsNotWritable() - { - if (IsReadOnly) - { - throw new NotSupportedException("The buffer is read-only."); - } - - ValidateBufferWritable(); - } - - internal abstract void ValidateBufferReadable(); - - internal abstract void ValidateBufferWritable(); - - public void CopyFrom(byte[] source, int startIndex, int length, int offset) - { - ThrowIfBufferIsNotReadable(); - - if (startIndex < 0) - { - throw new ArgumentOutOfRangeException(nameof(startIndex), startIndex, - "startIndex can't be less than zero."); - } - if (startIndex + length > source.Length) - { - throw new ArgumentOutOfRangeException($"{nameof(startIndex)}, {nameof(length)}", - "startIndex + length can't be greater than source.Length."); - } - - ValidateRange(offset, length); - - Marshal.Copy(source, startIndex, IntPtr.Add(_dataHandle, offset), length); - } - - public void CopyFrom(byte[] source, int startIndex, int length) - { - CopyFrom(source, startIndex, length, 0); - } - - public void CopyTo(byte[] dest, int startIndex, int length, int offset) - { - ThrowIfBufferIsNotWritable(); - - if (startIndex < 0) - { - throw new ArgumentOutOfRangeException(nameof(startIndex), startIndex, - "startIndex can't be less than zero."); - } - if (startIndex + length > dest.Length) - { - throw new ArgumentOutOfRangeException($"{nameof(startIndex)}, {nameof(length)}", - "startIndex + length can't be greater than source.Length."); - } - - ValidateRange(offset, length); - - Marshal.Copy(IntPtr.Add(_dataHandle, offset), dest, startIndex, length); - } - - public void CopyTo(byte[] dest, int startIndex, int length) - { - CopyTo(dest, startIndex, length, 0); - } - } -} diff --git a/src/Tizen.Multimedia/Common.Internal/MultimediaDebug.cs b/src/Tizen.Multimedia/Common.Internal/MultimediaDebug.cs deleted file mode 100644 index 3e00569dd..000000000 --- a/src/Tizen.Multimedia/Common.Internal/MultimediaDebug.cs +++ /dev/null @@ -1,31 +0,0 @@ -/* - * 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.Diagnostics; - -namespace Tizen.Multimedia -{ - internal class MultimediaDebug - { - [Conditional("DEBUG")] - internal static void AssertNoError(int errorCode) - { - Debug.Assert(errorCode == (int)Internals.Errors.ErrorCode.None, - $"The API is supposed not to return an error! But it returns error({ errorCode }).", - "Implementation of core may have been changed, modify the call to throw if the return code is not ok."); - } - } -} diff --git a/src/Tizen.Multimedia/Common.Internal/MultimediaLog.cs b/src/Tizen.Multimedia/Common.Internal/MultimediaLog.cs deleted file mode 100644 index e844bdd42..000000000 --- a/src/Tizen.Multimedia/Common.Internal/MultimediaLog.cs +++ /dev/null @@ -1,76 +0,0 @@ -/* - * 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.Diagnostics; -using System.Runtime.CompilerServices; -using System.Text; - -namespace Tizen.Multimedia -{ - internal static class MultimediaLog - { - [Conditional("DEBUG")] - public static void Debug(string tag, string message, Exception e = null, [CallerFilePath] string file = "", [CallerMemberName] string func = "", [CallerLineNumber] int line = 0) - { - Log.Debug(tag, BuildMessage(message, e), file, func, line); - } - - public static void Error(string tag, string message, Exception e = null, [CallerFilePath] string file = "", [CallerMemberName] string func = "", [CallerLineNumber] int line = 0) - { - Log.Error(tag, BuildMessage(message, e), file, func, line); - } - - public static void Fatal(string tag, string message, Exception e = null, [CallerFilePath] string file = "", [CallerMemberName] string func = "", [CallerLineNumber] int line = 0) - { - Log.Fatal(tag, BuildMessage(message, e), file, func, line); - } - - public static void Info(string tag, string message, Exception e = null, [CallerFilePath] string file = "", [CallerMemberName] string func = "", [CallerLineNumber] int line = 0) - { - Log.Info(tag, BuildMessage(message, e), file, func, line); - } - - public static void Verbose(string tag, string message, Exception e = null, [CallerFilePath] string file = "", [CallerMemberName] string func = "", [CallerLineNumber] int line = 0) - { - Log.Verbose(tag, BuildMessage(message, e), file, func, line); - } - - public static void Warn(string tag, string message, Exception e = null, [CallerFilePath] string file = "", [CallerMemberName] string func = "", [CallerLineNumber] int line = 0) - { - Log.Warn(tag, BuildMessage(message, e), file, func, line); - } - - private static string BuildMessage(string message, Exception exception) - { - if (exception == null) - { - return message; - } - - StringBuilder sb = new StringBuilder(); - - Exception e = exception; - while (e != null) - { - message += e.Message + Environment.NewLine + e.StackTrace; - e = e.InnerException; - } - - return sb.ToString(); - } - } -} diff --git a/src/Tizen.Multimedia/Common.Internal/ObjectKeeper.cs b/src/Tizen.Multimedia/Common.Internal/ObjectKeeper.cs deleted file mode 100644 index 6f4de804d..000000000 --- a/src/Tizen.Multimedia/Common.Internal/ObjectKeeper.cs +++ /dev/null @@ -1,77 +0,0 @@ -/* - * 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; - -namespace Tizen.Multimedia -{ - internal abstract class ObjectKeeper : IDisposable - { - private ObjectKeeper() - { - } - - public abstract void Dispose(); - - public static ObjectKeeperImpl Get(T target) - { - return new ObjectKeeperImpl(target); - } - - internal class ObjectKeeperImpl : ObjectKeeper - { - private readonly GCHandle _handle; - - internal ObjectKeeperImpl(T obj) - { - Target = obj; - _handle = GCHandle.Alloc(obj); - } - - ~ObjectKeeperImpl() - { - Dispose(false); - } - - private bool disposedValue = false; - - protected virtual void Dispose(bool disposing) - { - if (!disposedValue) - { - if (disposing) - { - _handle.Free(); - } - - disposedValue = true; - } - } - - public override void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - - public T Target - { - get; - } - } - } -} diff --git a/src/Tizen.Multimedia/Common.Internal/ScopedMediaBuffer.cs b/src/Tizen.Multimedia/Common.Internal/ScopedMediaBuffer.cs deleted file mode 100644 index 88d9dde1f..000000000 --- a/src/Tizen.Multimedia/Common.Internal/ScopedMediaBuffer.cs +++ /dev/null @@ -1,63 +0,0 @@ -/* - * 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.Multimedia -{ - /// - /// Represents a scoped buffer which lives shortly such as a callback. - /// - internal class ScopedMediaBuffer : MediaBufferBase, IDisposable - { - internal ScopedMediaBuffer(IntPtr dataHandle, int size, bool isReadOnly) - : base(dataHandle, size, isReadOnly) - { - } - - internal ScopedMediaBuffer(IntPtr dataHandle, int size) - : this(dataHandle, size, false) - { - } - - internal override void ValidateBufferReadable() - { - if (_disposed) - { - throw new InvalidOperationException("The buffer has already been invalidated."); - } - } - - internal override void ValidateBufferWritable() => ValidateBufferReadable(); - - #region IDisposable Support - private bool _disposed = false; - - protected virtual void Dispose(bool disposing) - { - if (_disposed == false) - { - _disposed = true; - } - } - - public void Dispose() - { - Dispose(true); - } - #endregion - } -} diff --git a/src/Tizen.Multimedia/Common.Internal/ValdiationUtil.cs b/src/Tizen.Multimedia/Common.Internal/ValdiationUtil.cs deleted file mode 100644 index b2b7bf66d..000000000 --- a/src/Tizen.Multimedia/Common.Internal/ValdiationUtil.cs +++ /dev/null @@ -1,56 +0,0 @@ -/* - * 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.Globalization; - -namespace Tizen.Multimedia -{ - internal static class ValidationUtil - { - internal static void ValidateEnum(Type enumType, object value) - { - if (!Enum.IsDefined(enumType, value)) - { - throw new ArgumentException($"Invalid { enumType.Name } value : { value }"); - } - } - - internal static void ValidateEnum(Type enumType, object value, string paramName) - { - if (!Enum.IsDefined(enumType, value)) - { - throw new ArgumentException($"Invalid { enumType.Name } value : { value }", paramName); - } - } - - internal static void ValidateFlagsEnum(T value, T allMasks, string paramName) where T : IConvertible - { - if (((~allMasks.ToInt32(CultureInfo.InvariantCulture)) & value.ToInt32(CultureInfo.InvariantCulture)) != 0) - { - throw new ArgumentException($"Invalid { typeof(T).Name } value : { value }", paramName); - } - } - - internal static void ValidateFeatureSupported(string featureKey) - { - if (Features.IsSupported(featureKey) == false) - { - throw new NotSupportedException($"The feature({featureKey}) is not supported."); - } - } - } -} diff --git a/src/Tizen.Multimedia/Common/CodecNotSupportedException.cs b/src/Tizen.Multimedia/Common/CodecNotSupportedException.cs deleted file mode 100644 index f5757fd88..000000000 --- a/src/Tizen.Multimedia/Common/CodecNotSupportedException.cs +++ /dev/null @@ -1,66 +0,0 @@ -/* - * 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.Multimedia -{ - /// - /// Specifies whether a codec is an audio codec or a video codec. - /// - public enum CodecKind - { - /// - /// Audio codec. - /// - Audio, - - /// - /// Video codec. - /// - Video - } - - /// - /// The exception that is thrown when the codec for an input file or a data stream is not supported - /// or the input is malformed. - /// - public class CodecNotSupportedException : InvalidOperationException - { - /// - /// Initializes a new instance of the class - /// with indicating which codec is not supported. - /// - public CodecNotSupportedException(CodecKind kind) - { - CodecKind = kind; - } - - /// - /// Initializes a new instance of the class with - /// indicating which codec is not supported and a specified error message. - /// - public CodecNotSupportedException(CodecKind kind, string message) : base(message) - { - CodecKind = kind; - } - - /// - /// Gets the of the exception. - /// - public CodecKind CodecKind { get; } - } -} diff --git a/src/Tizen.Multimedia/Common/ColorSpace.cs b/src/Tizen.Multimedia/Common/ColorSpace.cs deleted file mode 100644 index 1d0f598c8..000000000 --- a/src/Tizen.Multimedia/Common/ColorSpace.cs +++ /dev/null @@ -1,112 +0,0 @@ -/* - * 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. - */ - -namespace Tizen.Multimedia -{ - /// - /// Specifies color spaces for Tizen.Multimedia. - /// - public enum ColorSpace - { - /// - /// Y800. - /// - Y800, - - /// - /// I420. - /// - I420, - - /// - /// NV12. - /// - NV12, - - /// - /// NV16. - /// - NV16, - - /// - /// NV21. - /// - NV21, - - /// - /// NV61. - /// - NV61, - - /// - /// YV12. - /// - /// - YV12, - - /// - /// YUYV. - /// - Yuyv, - - /// - /// YUV422. - /// - Yuv422, - - /// - /// UYVY. - /// - Uyvy, - - /// - /// YUV422P. - /// - /// - Yuv422P, - - /// - /// RGB565. - /// - Rgb565, - - /// - /// RGB888. - /// - Rgb888, - - /// - /// RGBA8888. - /// - Rgba8888, - - /// - /// ARGB8888. - /// - Argb8888, - - /// - /// BGRA8888. - /// - Bgra8888, - - /// - /// BGRX8888. - /// - Bgrx8888 - - } -} diff --git a/src/Tizen.Multimedia/Common/Display.cs b/src/Tizen.Multimedia/Common/Display.cs deleted file mode 100644 index ba104096f..000000000 --- a/src/Tizen.Multimedia/Common/Display.cs +++ /dev/null @@ -1,170 +0,0 @@ -/* - * 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 ElmSharp; - -namespace Tizen.Multimedia -{ - internal enum DisplayType - { - /// - /// Overlay surface display. - /// - Overlay, - - /// - /// Evas image object surface display. - /// - Surface, - - /// - /// This disposes off buffers. - /// - None, - } - - internal interface IDisplayable - { - TError ApplyEvasDisplay(DisplayType type, EvasObject evasObject); - TError ApplyEcoreWindow(IntPtr windowHandle); - } - - internal interface IDisplaySetter - { - TError SetDisplay(IDisplayable target); - } - - internal class EvasDisplaySetter : IDisplaySetter - { - private readonly DisplayType _type; - private readonly EvasObject _target; - - internal EvasDisplaySetter(DisplayType type, EvasObject target) - { - if (target == IntPtr.Zero) - { - throw new ArgumentException("The evas object is not realized."); - } - - _type = type; - _target = target; - } - - public TError SetDisplay(IDisplayable target) - { - return target.ApplyEvasDisplay(_type, _target); - } - } - - internal class EcoreDisplaySetter : IDisplaySetter - { - private readonly IntPtr _windowHandle; - - internal EcoreDisplaySetter(IntPtr windowHandle) - { - _windowHandle = windowHandle; - } - - public TError SetDisplay(IDisplayable target) - { - return target.ApplyEcoreWindow(_windowHandle); - } - } - - /// - /// Provides a means to wrap various display types. - /// - /// - /// - /// - public class Display - { - private readonly IDisplaySetter _setter; - - /// - /// Initializes a new instance of the class with a class. - /// - /// A to display. - /// http://tizen.org/feature/multimedia.raw_video - /// The required feature is not supported. - public Display(MediaView mediaView) - { - ValidationUtil.ValidateFeatureSupported(Features.RawVideo); - - if (mediaView == null) - { - throw new ArgumentNullException(nameof(mediaView)); - } - - _setter = new EvasDisplaySetter(DisplayType.Surface, mediaView); - } - - /// - /// Initializes a new instance of the class with a class. - /// - /// A to display. - public Display(Window window) - { - if (window == null) - { - throw new ArgumentNullException(nameof(window)); - } - - _setter = new EvasDisplaySetter(DisplayType.Overlay, window); - } - - /// - /// Initializes a new instance of the class with a class. - /// - /// A to display. - /// - /// The must be - /// for the to be rendered correctly. - /// - public Display(NUI.Window window) - { - if (window == null) - { - throw new ArgumentNullException(nameof(window)); - } - - _setter = new EcoreDisplaySetter(window.GetNativeWindowHandler()); - } - - private EvasObject EvasObject { get; } - - private DisplayType Type { get; } - - private object _owner; - - internal object Owner => _owner; - - internal void SetOwner(object newOwner) - { - if (_owner != null && newOwner != null) - { - throw new ArgumentException("The display has already been assigned to another."); - } - - _owner = newOwner; - } - - internal TError ApplyTo(IDisplayable target) - { - return _setter.SetDisplay(target); - } - } -} diff --git a/src/Tizen.Multimedia/Common/FileFormatException.cs b/src/Tizen.Multimedia/Common/FileFormatException.cs deleted file mode 100644 index 94e9b166e..000000000 --- a/src/Tizen.Multimedia/Common/FileFormatException.cs +++ /dev/null @@ -1,41 +0,0 @@ -/* - * 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.Multimedia -{ - /// - /// The exception that is thrown when an input file or a data stream that is supposed to conform - /// to a certain file format specification, is malformed. - /// - public class FileFormatException : FormatException - { - /// - /// Initializes a new instance of the class. - /// - public FileFormatException() - { - } - - /// - /// Initializes a new instance of the class with a specified error message. - /// - public FileFormatException(string message) : base(message) - { - } - } -} diff --git a/src/Tizen.Multimedia/Common/Flips.cs b/src/Tizen.Multimedia/Common/Flips.cs deleted file mode 100644 index 977be45fe..000000000 --- a/src/Tizen.Multimedia/Common/Flips.cs +++ /dev/null @@ -1,42 +0,0 @@ -/* - * 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.Multimedia -{ - /// - /// Specifies the flip operation. - /// - [Flags] - public enum Flips - { - /// - /// No flip operation. - /// - None = 0, - - /// - /// Flip horizontally. - /// - Horizontal = 1, - - /// - /// Flip vertically. - /// - Vertical = 2, - } -} diff --git a/src/Tizen.Multimedia/Common/IMediaBuffer.cs b/src/Tizen.Multimedia/Common/IMediaBuffer.cs deleted file mode 100644 index dfa427504..000000000 --- a/src/Tizen.Multimedia/Common/IMediaBuffer.cs +++ /dev/null @@ -1,104 +0,0 @@ -/* - * 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.Multimedia -{ - /// - /// Provides functionality to read and write the media buffer. - /// - public interface IMediaBuffer - { - /// - /// Gets or sets a value at the specified index. - /// - /// The index of the value to get or set. - /// - /// is less than zero.\n - /// -or-\n - /// is equal to or greater than . - /// - /// The object that owns the current buffer has already been disposed of. - /// The buffer is not available, i.e. not writable state. - byte this[int index] - { - get; - set; - } - - /// - /// Gets the size of the buffer, in bytes. - /// - int Length { get; } - - /// - /// Gets the value indicating whether the is read-only. - /// - /// true if the is read-only; otherwise, false. - bool IsReadOnly { get; } - - /// - /// Copies data from a byte array to the buffer. - /// - /// The array to copy to. - /// The zero-based index in the source array where copying should start. - /// The number of array elements to copy. - /// is null. - /// or is not valid. - /// The object that owns the current buffer has already been disposed of. - void CopyTo(byte[] dest, int startIndex, int length); - - /// - /// Copies data from a byte array to the buffer. - /// - /// The array to copy to. - /// The zero-based index in the source array where copying should start. - /// The number of array elements to copy. - /// The zero-based index in the buffer where copying should start. - /// is null. - /// , , - /// or is not valid. - /// The object that owns the current buffer has already been disposed of. - void CopyTo(byte[] dest, int startIndex, int length, int offset); - - /// - /// Copies data from the buffer to a byte array. - /// - /// The array to copy from. - /// The zero-based index in the destination array where copying should start. - /// The number of elements to copy. - /// is null. - /// or is not valid. - /// The object that owns the current buffer has already been disposed of. - /// The buffer is not available. i.e. not writable state. - void CopyFrom(byte[] source, int startIndex, int length); - - /// - /// Copies data from the buffer to a byte array. - /// - /// The array to copy from. - /// The zero-based index in the destination array where copying should start. - /// The number of elements to copy. - /// The zero-based index in the buffer where copying should start. - /// is null. - /// , , - /// or is not valid. - /// The object that owns the current buffer has already been disposed of. - /// The buffer is not available. i.e. not writable state. - void CopyFrom(byte[] source, int startIndex, int length, int offset); - } -} diff --git a/src/Tizen.Multimedia/Common/Point.cs b/src/Tizen.Multimedia/Common/Point.cs deleted file mode 100644 index 4cca3608e..000000000 --- a/src/Tizen.Multimedia/Common/Point.cs +++ /dev/null @@ -1,103 +0,0 @@ -/* - * 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.Multimedia -{ - /// - /// Represents a point in the 2D space. - /// - public struct Point - { - - /// - /// Initializes a new instance of the Point with the specified coordinates. - /// - /// X-axis coordinate of the point in the 2D space. - /// Y-axis coordinate of the point in the 2D space. - public Point(int x, int y) - { - X = x; - Y = y; - } - - /// - /// Gets or sets the X-axis coordinate of the point in the 2D space. - /// - public int X - { - get; - set; - } - - /// - /// Gets or sets the Y-axis coordinate of the point in the 2D space. - /// - public int Y - { - get; - set; - } - - /// - /// Returns a string that represents the current object. - /// - /// A string that represents the current object. - public override string ToString() => $"X={X.ToString()}, Y={Y.ToString()}"; - - /// - /// Gets the hash code for this instance of . - /// - /// The hash code for this instance of . - public override int GetHashCode() - { - return new { X, Y }.GetHashCode(); - } - - /// - /// Compares an object to an instance of for equality. - /// - /// A to compare. - /// true if the points are equal; otherwise, false. - public override bool Equals(object obj) - { - return obj is Point && this == (Point)obj; - } - - /// - /// Compares two instances of for equality. - /// - /// A to compare. - /// A to compare. - /// true if the two instances of are equal; otherwise false. - public static bool operator ==(Point point1, Point point2) - { - return point1.X == point2.X && point1.Y == point2.Y; - } - - /// - /// Compares two instances of for inequality. - /// - /// A to compare. - /// A to compare. - /// true if the two instances of are not equal; otherwise false. - public static bool operator !=(Point point1, Point point2) - { - return !(point1 == point2); - } - } -} diff --git a/src/Tizen.Multimedia/Common/Range.cs b/src/Tizen.Multimedia/Common/Range.cs deleted file mode 100644 index bcfc720f3..000000000 --- a/src/Tizen.Multimedia/Common/Range.cs +++ /dev/null @@ -1,123 +0,0 @@ -/* - * 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.Multimedia -{ - /// - /// Represents a range(min, max) value. - /// - public struct Range - { - /// - /// Initializes a new instance of the range with the specified values. - /// - /// Minimum value of the range. - /// Maximum value of the range. - /// is less than . - public Range(int min, int max) - { - if (min > max) - { - throw new ArgumentException($"min can't be greater than max."); - } - Min = min; - Max = max; - } - - /// - /// Gets or sets the minimum value of the range. - /// - public int Min - { - get; - set; - } - - /// - /// Gets or sets the maximum value of the range. - /// - public int Max - { - get; - set; - } - - /// - /// Gets the length of the range. - /// - public int Length => Max - Min; - - /// - /// Determines if the specified value is within the range. - /// - /// The value to check. - /// true if the value is within the range; otherwise false. - public bool IsInside(int value) - { - return Min <= value && value <= Max; - } - - /// - /// Returns a string that represents the current object. - /// - /// A string that represents the current object. - public override string ToString() => $"Min={Min.ToString()}, Max={Max.ToString()}"; - - /// - /// Gets the hash code for this instance of . - /// - /// The hash code for this instance of . - public override int GetHashCode() - { - return new { Min, Max }.GetHashCode(); - } - - /// - /// Compares an object to an instance of for equality. - /// - /// A to compare. - /// true if the two ranges are equal; otherwise, false. - public override bool Equals(object obj) - { - return obj is Range && this == (Range)obj; - } - - /// - /// Compares two instances of for equality. - /// - /// A to compare. - /// A to compare. - /// true if the two instances of are equal; otherwise false. - public static bool operator ==(Range range1, Range range2) - { - return range1.Min == range2.Min && range1.Max == range2.Max; - } - - /// - /// Compares two instances of for inequality. - /// - /// A to compare. - /// A to compare. - /// true if the two instances of are not equal; otherwise false. - public static bool operator !=(Range range1, Range range2) - { - return !(range1 == range2); - } - } -} - diff --git a/src/Tizen.Multimedia/Common/Rectangle.cs b/src/Tizen.Multimedia/Common/Rectangle.cs deleted file mode 100644 index d7f537dd0..000000000 --- a/src/Tizen.Multimedia/Common/Rectangle.cs +++ /dev/null @@ -1,174 +0,0 @@ -/* - * 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.Multimedia -{ - /// - /// Represents the location of the object bounded by a rectangle defined by - /// coordinates of top left corner, width and height. - /// - public struct Rectangle - { - private Point _location; - private Size _size; - - /// - /// Initializes a new instance of the with the specified values. - /// - /// The x-coordinate of the upper-left corner of the rectangle. - /// The y-coordinate of the upper-left corner of the rectangle. - /// The Width of the rectangle. - /// The Height of the rectangle. - public Rectangle(int x, int y, int width, int height) : this(new Point(x, y), - new Size(width, height)) - { - } - - /// - /// Initializes a new instance of the with the specified values. - /// - /// A that represents the upper-left corner of the rectangular region. - /// A that represents the width and height of the rectangular region. - public Rectangle(Point location, Size size) - { - _location = location; - _size = size; - } - - /// - /// Gets or sets the coordinates of the upper-left corner of the rectangle. - /// - public Point Location - { - get { return _location; } - set { _location = value; } - } - - /// - /// Gets or sets the x-coordinate of the upper-left corner of the rectangle. - /// - public int X - { - get { return _location.X; } - set { _location.X = value; } - } - - /// - /// Gets or sets the y-coordinate of the upper-left corner of the rectangle. - /// - public int Y - { - get { return _location.Y; } - set { _location.Y = value; } - } - - /// - /// Gets or sets the width of the rectangle. - /// - public int Width - { - get { return _size.Width; } - set { _size.Width = value; } - } - - /// - /// Gets or sets the height of the rectangle. - /// - public int Height - { - get { return _size.Height; } - set { _size.Height = value; } - } - - /// - /// Gets the x-coordinate of the left edge of the rectangle. - /// - public int Left => X; - - /// - /// Gets the y-coordinate of the top edge of the rectangle. - /// - public int Top => Y; - - /// - /// Gets the x-coordinate of the right edge of the rectangle. - /// - public int Right => X + Width; - - /// - /// Gets the y-coordinate of the bottom edge of the rectangle. - /// - public int Bottom => Y + Height; - - /// - /// Gets or sets the size of the rectangle. - /// - public Size Size - { - get { return _size; } - set { _size = value; } - } - - /// - /// Returns a string that represents the current object. - /// - /// A string that represents the current object. - public override string ToString() => $"{_location.ToString()}, {_size.ToString()}"; - - /// - /// Gets the hash code for this instance of . - /// - /// The hash code for this instance of . - public override int GetHashCode() - { - return new { Location, Size }.GetHashCode(); - } - - /// - /// Compares an object to an instance of for equality. - /// - /// A to compare. - /// true if the rectangles are equal; otherwise, false. - public override bool Equals(object obj) - { - return obj is Rectangle && this == (Rectangle)obj; - } - - /// - /// Compares two instances of for equality. - /// - /// A to compare. - /// A to compare. - /// true if the two instances of are equal; otherwise false. - public static bool operator ==(Rectangle rect1, Rectangle rect2) - { - return rect1.Location == rect2.Location && rect1.Size == rect2.Size; - } - - /// - /// Compares two instances of for inequality. - /// - /// A to compare. - /// A to compare. - /// true if the two instances of are not equal; otherwise false. - public static bool operator !=(Rectangle rect1, Rectangle rect2) - { - return !(rect1 == rect2); - } - } -} diff --git a/src/Tizen.Multimedia/Common/Rotation.cs b/src/Tizen.Multimedia/Common/Rotation.cs deleted file mode 100644 index 78241b3dc..000000000 --- a/src/Tizen.Multimedia/Common/Rotation.cs +++ /dev/null @@ -1,44 +0,0 @@ -/* - * 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. - */ - -namespace Tizen.Multimedia -{ - /// - /// Specifies the directions of rotation. - /// - public enum Rotation - { - /// - /// No rotation. - /// - Rotate0, - - /// - /// Rotate clockwise by 90 degrees. - /// - Rotate90, - - /// - /// Rotate clockwise by 180 degrees. - /// - Rotate180, - - /// - /// Rotate clockwise by 270 degrees. - /// - Rotate270 - } -} diff --git a/src/Tizen.Multimedia/Common/Size.cs b/src/Tizen.Multimedia/Common/Size.cs deleted file mode 100644 index 6545bc252..000000000 --- a/src/Tizen.Multimedia/Common/Size.cs +++ /dev/null @@ -1,102 +0,0 @@ -/* - * 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.Multimedia -{ - /// - /// Represents a size in 2D space. - /// - public struct Size - { - /// - /// Initializes a new instance of the with the specified values. - /// - /// Width of the size. - /// Height of the size. - public Size(int width, int height) - { - Width = width; - Height = height; - } - - /// - /// Gets or sets the width. - /// - public int Width - { - get; - set; - } - - /// - /// Gets or sets the height. - /// - public int Height - { - get; - set; - } - - /// - /// Returns a string that represents the current object. - /// - /// A string that represents the current object. - public override string ToString() => $"Width={ Width.ToString() }, Height={ Height.ToString() }"; - - /// - /// Gets the hash code for this instance of . - /// - /// The hash code for this instance of . - public override int GetHashCode() - { - return new { Width, Height }.GetHashCode(); - } - - /// - /// Compares an object to an instance of for equality. - /// - /// A to compare. - /// true if the two sizes are equal; otherwise, false. - public override bool Equals(object obj) - { - return obj is Size && this == (Size)obj; - } - - /// - /// Compares two instances of for equality. - /// - /// A to compare. - /// A to compare. - /// true if the two instances of are equal; otherwise false. - public static bool operator ==(Size size1, Size size2) - { - return size1.Width == size2.Width && size1.Height == size2.Height; - } - - /// - /// Compares two instances of for inequality. - /// - /// A to compare. - /// A to compare. - /// true if the two instances of are not equal; otherwise false. - public static bool operator !=(Size size1, Size size2) - { - return !(size1 == size2); - } - } -} diff --git a/src/Tizen.Multimedia/Common/Visibility.cs b/src/Tizen.Multimedia/Common/Visibility.cs deleted file mode 100644 index 97e6d078c..000000000 --- a/src/Tizen.Multimedia/Common/Visibility.cs +++ /dev/null @@ -1,33 +0,0 @@ -/* - * 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. - */ - -namespace Tizen.Multimedia -{ - /// - /// Specifies visibilities. - /// - public enum Visibility - { - /// - /// Invisible. - /// - Invisible, - /// - /// Visible. - /// - Visible - } -} diff --git a/src/Tizen.Multimedia/Interop/AudioStreamPolicyHandle.cs b/src/Tizen.Multimedia/Interop/AudioStreamPolicyHandle.cs deleted file mode 100644 index fbb67648e..000000000 --- a/src/Tizen.Multimedia/Interop/AudioStreamPolicyHandle.cs +++ /dev/null @@ -1,42 +0,0 @@ -/* - * 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; - -namespace Tizen.Multimedia -{ - internal class AudioStreamPolicyHandle : SafeHandle - { - protected AudioStreamPolicyHandle() : base(IntPtr.Zero, true) - { - } - - public override bool IsInvalid => handle == IntPtr.Zero; - - protected override bool ReleaseHandle() - { - var ret = Interop.AudioStreamPolicy.Destroy(handle); - if (ret != AudioManagerError.None) - { - Log.Debug(GetType().FullName, $"Failed to release native {GetType()}"); - return false; - } - - return true; - } - } -} diff --git a/src/Tizen.Multimedia/Interop/Interop.Device.cs b/src/Tizen.Multimedia/Interop/Interop.Device.cs deleted file mode 100644 index 0cc2ecb87..000000000 --- a/src/Tizen.Multimedia/Interop/Interop.Device.cs +++ /dev/null @@ -1,71 +0,0 @@ -/* - * 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; - -namespace Tizen.Multimedia -{ - internal static partial class Interop - { - internal static partial class AudioDevice - { - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void ConnectionChangedCallback(IntPtr device, bool isConnected, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void StateChangedCallback(IntPtr device, AudioDeviceState changedState, IntPtr userData); - - [DllImport(Libraries.SoundManager, EntryPoint = "sound_manager_get_device_list")] - internal static extern AudioManagerError GetDeviceList(AudioDeviceOptions deviceMask, out IntPtr deviceList); - - [DllImport(Libraries.SoundManager, EntryPoint = "sound_manager_free_device_list")] - internal static extern AudioManagerError FreeDeviceList(IntPtr deviceList); - - [DllImport(Libraries.SoundManager, EntryPoint = "sound_manager_get_next_device")] - internal static extern AudioManagerError GetNextDevice(IntPtr deviceList, out IntPtr device); - - [DllImport(Libraries.SoundManager, EntryPoint = "sound_manager_get_device_type")] - internal static extern int GetDeviceType(IntPtr device, out AudioDeviceType type); - - [DllImport(Libraries.SoundManager, EntryPoint = "sound_manager_get_device_io_direction")] - internal static extern AudioManagerError GetDeviceIoDirection(IntPtr device, out AudioDeviceIoDirection ioDirection); - - [DllImport(Libraries.SoundManager, EntryPoint = "sound_manager_get_device_id")] - internal static extern int GetDeviceId(IntPtr device, out int id); - - [DllImport(Libraries.SoundManager, EntryPoint = "sound_manager_get_device_name")] - internal static extern int GetDeviceName(IntPtr device, out IntPtr name); - - [DllImport(Libraries.SoundManager, EntryPoint = "sound_manager_get_device_state_by_id")] - internal static extern AudioManagerError GetDeviceState(int deviceId, out AudioDeviceState state); - - [DllImport(Libraries.SoundManager, EntryPoint = "sound_manager_add_device_connection_changed_cb")] - internal static extern AudioManagerError AddDeviceConnectionChangedCallback( - AudioDeviceOptions deviceMask, ConnectionChangedCallback callback, IntPtr userData, out int id); - - [DllImport(Libraries.SoundManager, EntryPoint = "sound_manager_remove_device_connection_changed_cb")] - internal static extern AudioManagerError RemoveDeviceConnectionChangedCallback(int id); - - [DllImport(Libraries.SoundManager, EntryPoint = "sound_manager_add_device_state_changed_cb")] - internal static extern AudioManagerError AddDeviceStateChangedCallback(AudioDeviceOptions deviceMask, - StateChangedCallback callback, IntPtr userData, out int id); - - [DllImport(Libraries.SoundManager, EntryPoint = "sound_manager_remove_device_state_changed_cb")] - internal static extern AudioManagerError RemoveDeviceStateChangedCallback(int id); - } - } -} \ No newline at end of file diff --git a/src/Tizen.Multimedia/Interop/Interop.EvasObject.cs b/src/Tizen.Multimedia/Interop/Interop.EvasObject.cs deleted file mode 100644 index 69ae936f2..000000000 --- a/src/Tizen.Multimedia/Interop/Interop.EvasObject.cs +++ /dev/null @@ -1,34 +0,0 @@ -/* - * 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; - -namespace Tizen.Multimedia -{ - internal static partial class Interop - { - internal static partial class EvasObject - { - [DllImport("libevas.so.1")] - internal static extern IntPtr evas_object_image_add(IntPtr parent); - [DllImport("libevas.so.1")] - internal static extern IntPtr evas_object_evas_get(IntPtr obj); - [DllImport("libevas.so.1")] - internal static extern void evas_object_show(IntPtr obj); - } - } -} \ No newline at end of file diff --git a/src/Tizen.Multimedia/Interop/Interop.Libc.cs b/src/Tizen.Multimedia/Interop/Interop.Libc.cs deleted file mode 100644 index 5c25fda61..000000000 --- a/src/Tizen.Multimedia/Interop/Interop.Libc.cs +++ /dev/null @@ -1,41 +0,0 @@ -/* - * 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; - -namespace Tizen.Multimedia -{ - internal static partial class Interop - { - internal static partial class Libc - { - internal static class AccessMode - { - internal const int W_OK = 0x02; - internal const int R_OK = 0x04; - } - - [DllImport(Libraries.Libc, EntryPoint = "free")] - public static extern void Free(IntPtr ptr); - - - - [DllImport(Libraries.Libc, EntryPoint = "access")] - public static extern int Access(string path, int mode); - } - } -} \ No newline at end of file diff --git a/src/Tizen.Multimedia/Interop/Interop.Libraries.cs b/src/Tizen.Multimedia/Interop/Interop.Libraries.cs deleted file mode 100644 index f0ce7919d..000000000 --- a/src/Tizen.Multimedia/Interop/Interop.Libraries.cs +++ /dev/null @@ -1,28 +0,0 @@ -/* - * 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. - */ - -namespace Tizen.Multimedia -{ - internal static partial class Interop - { - internal static partial class Libraries - { - public const string SoundManager = "libcapi-media-sound-manager.so.0"; - public const string MediaTool = "libcapi-media-tool.so.0"; - public const string Libc = "libc.so.6"; - } - } -} diff --git a/src/Tizen.Multimedia/Interop/Interop.MediaTool.cs b/src/Tizen.Multimedia/Interop/Interop.MediaTool.cs deleted file mode 100644 index e7992f330..000000000 --- a/src/Tizen.Multimedia/Interop/Interop.MediaTool.cs +++ /dev/null @@ -1,172 +0,0 @@ -/* - * 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; - -namespace Tizen.Multimedia -{ - internal static partial class Interop - { - internal static class MediaPacket - { - [DllImport(Libraries.MediaTool, EntryPoint = "media_packet_create")] - internal static extern int Create(IntPtr format, IntPtr finalizeCb, IntPtr cbData, out IntPtr handle); - - [DllImport(Libraries.MediaTool, EntryPoint = "media_packet_alloc")] - internal static extern int Alloc(IntPtr handle); - - [DllImport(Libraries.MediaTool, EntryPoint = "media_packet_destroy")] - internal static extern int Destroy(IntPtr handle); - - [DllImport(Libraries.MediaTool, EntryPoint = "media_packet_get_format")] - internal static extern int GetFormat(IntPtr handle, out IntPtr format); - - [DllImport(Libraries.MediaTool, EntryPoint = "media_packet_get_buffer_data_ptr")] - internal static extern int GetBufferData(IntPtr handle, out IntPtr dataHandle); - - [DllImport(Libraries.MediaTool, EntryPoint = "media_packet_get_buffer_size")] - internal static extern int GetBufferSize(IntPtr handle, out ulong size); - - [DllImport(Libraries.MediaTool, EntryPoint = "media_packet_set_buffer_size")] - internal static extern int SetBufferSize(IntPtr handle, ulong size); - - [DllImport(Libraries.MediaTool, EntryPoint = "media_packet_get_allocated_buffer_size")] - internal static extern int GetAllocatedBufferSize(IntPtr handle, out int size); - - [DllImport(Libraries.MediaTool, EntryPoint = "media_packet_get_number_of_video_planes")] - internal static extern int GetNumberOfVideoPlanes(IntPtr handle, out uint num); - - [DllImport(Libraries.MediaTool, EntryPoint = "media_packet_get_video_stride_width")] - internal static extern int GetVideoStrideWidth(IntPtr handle, int planeIndex, out int value); - - [DllImport(Libraries.MediaTool, EntryPoint = "media_packet_get_video_stride_height")] - internal static extern int GetVideoStrideHeight(IntPtr handle, int planeIndex, out int value); - - [DllImport(Libraries.MediaTool, EntryPoint = "media_packet_get_video_plane_data_ptr")] - internal static extern int GetVideoPlaneData(IntPtr handle, int planeIndex, out IntPtr dataHandle); - - [DllImport(Libraries.MediaTool, EntryPoint = "media_packet_is_encoded")] - internal static extern int IsEncoded(IntPtr handle, out bool value); - - [DllImport(Libraries.MediaTool, EntryPoint = "media_packet_get_flags")] - internal static extern int GetBufferFlags(IntPtr handle, out int value); - - [DllImport(Libraries.MediaTool, EntryPoint = "media_packet_set_flags")] - internal static extern int SetBufferFlags(IntPtr handle, int value); - - [DllImport(Libraries.MediaTool, EntryPoint = "media_packet_reset_flags")] - internal static extern int ResetBufferFlags(IntPtr handle); - - [DllImport(Libraries.MediaTool, EntryPoint = "media_packet_get_pts")] - internal static extern int GetPts(IntPtr handle, out ulong value); - - [DllImport(Libraries.MediaTool, EntryPoint = "media_packet_get_dts")] - internal static extern int GetDts(IntPtr handle, out ulong value); - - [DllImport(Libraries.MediaTool, EntryPoint = "media_packet_set_pts")] - internal static extern int SetPts(IntPtr handle, ulong value); - - [DllImport(Libraries.MediaTool, EntryPoint = "media_packet_set_dts")] - internal static extern int SetDts(IntPtr handle, ulong value); - - - [DllImport(Libraries.MediaTool, EntryPoint = "media_packet_set_extra")] - internal static extern int SetExtra(IntPtr handle, IntPtr value); - - [DllImport(Libraries.MediaTool, EntryPoint = "media_packet_get_extra")] - internal static extern int GetExtra(IntPtr handle, out IntPtr value); - } - - internal static class MediaFormat - { - [DllImport(Libraries.MediaTool, EntryPoint = "media_format_create")] - internal static extern int Create(out IntPtr handle); - - [DllImport(Libraries.MediaTool, EntryPoint = "media_format_unref")] - internal static extern int Unref(IntPtr handle); - - [DllImport(Libraries.MediaTool, EntryPoint = "media_format_get_type")] - internal static extern int GetType(IntPtr handle, out int type); - - [DllImport(Libraries.MediaTool, EntryPoint = "media_format_get_container_mime")] - internal static extern int GetContainerMimeType(IntPtr handle, out int mimeType); - - [DllImport(Libraries.MediaTool, EntryPoint = "media_format_set_container_mime")] - internal static extern int SetContainerMimeType(IntPtr handle, int mimeType); - - #region Video apis - [DllImport(Libraries.MediaTool, EntryPoint = "media_format_get_video_info")] - internal static extern int GetVideoInfo(IntPtr handle, out int mimeType, - out int width, out int height, out int averageBps, out int maxBps); - - [DllImport(Libraries.MediaTool, EntryPoint = "media_format_get_video_frame_rate")] - internal static extern int GetVideoFrameRate(IntPtr handle, out int frameRate); - - [DllImport(Libraries.MediaTool, EntryPoint = "media_format_set_video_mime")] - internal static extern int SetVideoMimeType(IntPtr handle, int value); - - [DllImport(Libraries.MediaTool, EntryPoint = "media_format_set_video_width")] - internal static extern int SetVideoWidth(IntPtr handle, int value); - - [DllImport(Libraries.MediaTool, EntryPoint = "media_format_set_video_height")] - internal static extern int SetVideoHeight(IntPtr handle, int value); - - [DllImport(Libraries.MediaTool, EntryPoint = "media_format_set_video_avg_bps")] - internal static extern int SetVideoAverageBps(IntPtr handle, int value); - - [DllImport(Libraries.MediaTool, EntryPoint = "media_format_set_video_frame_rate")] - internal static extern int SetVideoFrameRate(IntPtr handle, int value); - #endregion - - #region Audio apis - [DllImport(Libraries.MediaTool, EntryPoint = "media_format_get_audio_info")] - internal static extern int GetAudioInfo(IntPtr handle, out int mimeType, - out int channel, out int sampleRate, out int bit, out int averageBps); - - [DllImport(Libraries.MediaTool, EntryPoint = "media_format_get_audio_aac_header_type")] - internal static extern int GetAudioAacType(IntPtr handle, out int aacType); - - [DllImport(Libraries.MediaTool, EntryPoint = "media_format_set_audio_mime")] - internal static extern int SetAudioMimeType(IntPtr handle, int value); - - [DllImport(Libraries.MediaTool, EntryPoint = "media_format_set_audio_channel")] - internal static extern int SetAudioChannel(IntPtr handle, int value); - - [DllImport(Libraries.MediaTool, EntryPoint = "media_format_set_audio_samplerate")] - internal static extern int SetAudioSampleRate(IntPtr handle, int value); - - [DllImport(Libraries.MediaTool, EntryPoint = "media_format_set_audio_bit")] - internal static extern int SetAudioBit(IntPtr handle, int value); - - [DllImport(Libraries.MediaTool, EntryPoint = "media_format_set_audio_avg_bps")] - internal static extern int SetAudioAverageBps(IntPtr handle, int value); - - [DllImport(Libraries.MediaTool, EntryPoint = "media_format_set_audio_aac_header_type")] - internal static extern int SetAudioAacType(IntPtr handle, int value); - #endregion - - [DllImport(Libraries.MediaTool, EntryPoint = "media_format_get_text_info")] - internal static extern int GetTextInfo(IntPtr handle, out int mimeType, out int textType); - - [DllImport(Libraries.MediaTool, EntryPoint = "media_format_set_text_mime")] - internal static extern int SetTextMimeType(IntPtr handle, int value); - - [DllImport(Libraries.MediaTool, EntryPoint = "media_format_set_text_type")] - internal static extern int SetTextType(IntPtr handle, int value); - } - } -} \ No newline at end of file diff --git a/src/Tizen.Multimedia/Interop/Interop.StreamPolicy.cs b/src/Tizen.Multimedia/Interop/Interop.StreamPolicy.cs deleted file mode 100644 index 0ab53a212..000000000 --- a/src/Tizen.Multimedia/Interop/Interop.StreamPolicy.cs +++ /dev/null @@ -1,86 +0,0 @@ -/* - * 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; - -namespace Tizen.Multimedia -{ - internal static partial class Interop - { - internal static partial class AudioStreamPolicy - { - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void FocusStateChangedCallback(IntPtr streamInfo, AudioStreamFocusOptions focusMask, - AudioStreamFocusState focusState, AudioStreamFocusChangedReason reason, - AudioStreamBehaviors audioStreamBehavior, string extraInfo, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void FocusStateWatchCallback(int id, AudioStreamFocusOptions focusMask, - AudioStreamFocusState focusState, AudioStreamFocusChangedReason reason, string extraInfo, - IntPtr userData); - - [DllImport(Libraries.SoundManager, EntryPoint = "sound_manager_create_stream_information")] - internal static extern AudioManagerError Create(AudioStreamType streamType, - FocusStateChangedCallback callback, IntPtr userData, out AudioStreamPolicyHandle streamInfo); - - [DllImport(Libraries.SoundManager, EntryPoint = "sound_manager_destroy_stream_information")] - internal static extern AudioManagerError Destroy(IntPtr streamInfo); - - [DllImport(Libraries.SoundManager, EntryPoint = "sound_manager_add_device_id_for_stream_routing")] - internal static extern AudioManagerError AddDeviceForStreamRouting( - AudioStreamPolicyHandle streamInfo, int deviceId); - - [DllImport(Libraries.SoundManager, EntryPoint = "sound_manager_remove_device_id_for_stream_routing")] - internal static extern AudioManagerError RemoveDeviceForStreamRouting( - AudioStreamPolicyHandle streamInfo, int device); - - [DllImport(Libraries.SoundManager, EntryPoint = "sound_manager_apply_stream_routing")] - internal static extern AudioManagerError ApplyStreamRouting(AudioStreamPolicyHandle streamInfo); - - [DllImport(Libraries.SoundManager, EntryPoint = "sound_manager_acquire_focus")] - internal static extern AudioManagerError AcquireFocus(AudioStreamPolicyHandle streamInfo, - AudioStreamFocusOptions focusMask, AudioStreamBehaviors audioStreamBehavior, string extraInfo); - - [DllImport(Libraries.SoundManager, EntryPoint = "sound_manager_release_focus")] - internal static extern AudioManagerError ReleaseFocus(AudioStreamPolicyHandle streamInfo, - AudioStreamFocusOptions focusMask, AudioStreamBehaviors audioStreamBehavior, string extraInfo); - - [DllImport(Libraries.SoundManager, EntryPoint = "sound_manager_get_focus_state")] - internal static extern int GetFocusState(AudioStreamPolicyHandle streamInfo, - out AudioStreamFocusState stateForPlayback, out AudioStreamFocusState stateForRecording); - - [DllImport(Libraries.SoundManager, EntryPoint = "sound_manager_set_focus_reacquisition")] - internal static extern AudioManagerError SetFocusReacquisition(AudioStreamPolicyHandle streamInfo, - bool enable); - - [DllImport(Libraries.SoundManager, EntryPoint = "sound_manager_get_focus_reacquisition")] - internal static extern AudioManagerError GetFocusReacquisition(AudioStreamPolicyHandle streamInfo, - out bool enabled); - - [DllImport(Libraries.SoundManager, EntryPoint = "sound_manager_get_sound_type")] - internal static extern AudioManagerError GetSoundType(AudioStreamPolicyHandle streamInfo, - out AudioVolumeType soundType); - - [DllImport(Libraries.SoundManager, EntryPoint = "sound_manager_add_focus_state_watch_cb")] - internal static extern AudioManagerError AddFocusStateWatchCallback(AudioStreamFocusOptions focusMask, - FocusStateWatchCallback callback, IntPtr userData, out int id); - - [DllImport(Libraries.SoundManager, EntryPoint = "sound_manager_remove_focus_state_watch_cb")] - internal static extern int RemoveFocusStateWatchCallback(int id); - } - } -} \ No newline at end of file diff --git a/src/Tizen.Multimedia/Interop/Interop.Volume.cs b/src/Tizen.Multimedia/Interop/Interop.Volume.cs deleted file mode 100644 index cae490e7f..000000000 --- a/src/Tizen.Multimedia/Interop/Interop.Volume.cs +++ /dev/null @@ -1,49 +0,0 @@ -/* - * 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; - -namespace Tizen.Multimedia -{ - internal static partial class Interop - { - internal static partial class AudioVolume - { - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void VolumeChangedCallback(AudioVolumeType type, uint volume, IntPtr userData); - - [DllImport(Libraries.SoundManager, EntryPoint = "sound_manager_get_max_volume")] - internal static extern AudioManagerError GetMaxVolume(AudioVolumeType type, out int max); - - [DllImport(Libraries.SoundManager, EntryPoint = "sound_manager_set_volume")] - internal static extern AudioManagerError SetVolume(AudioVolumeType type, int volume); - - [DllImport(Libraries.SoundManager, EntryPoint = "sound_manager_get_volume")] - internal static extern AudioManagerError GetVolume(AudioVolumeType type, out int volume); - - [DllImport(Libraries.SoundManager, EntryPoint = "sound_manager_get_current_sound_type")] - internal static extern AudioManagerError GetCurrentSoundType(out AudioVolumeType type); - - [DllImport(Libraries.SoundManager, EntryPoint = "sound_manager_add_volume_changed_cb")] - internal static extern AudioManagerError AddVolumeChangedCallback(VolumeChangedCallback callback, - IntPtr userData, out int id); - - [DllImport(Libraries.SoundManager, EntryPoint = "sound_manager_remove_volume_changed_cb")] - internal static extern AudioManagerError RemoveVolumeChangedCallback(int id); - } - } -} \ No newline at end of file diff --git a/src/Tizen.Multimedia/MediaTool/AudioMediaFormat.cs b/src/Tizen.Multimedia/MediaTool/AudioMediaFormat.cs deleted file mode 100644 index b70894efb..000000000 --- a/src/Tizen.Multimedia/MediaTool/AudioMediaFormat.cs +++ /dev/null @@ -1,274 +0,0 @@ -/* - * 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.Diagnostics; -using Tizen.Internals.Errors; - -namespace Tizen.Multimedia -{ - /// - /// Represents an audio media format. This class cannot be inherited. - /// - public sealed class AudioMediaFormat : MediaFormat - { - - /// - /// Initializes a new instance of the AudioMediaFormat class with the specified mime type, - /// channel, sample rate, bit, and bit rate. - /// - /// The mime type of the format. - /// The channel value of the format. - /// The sample rate value of the format. - /// The bit value of the format. - /// The bit rate value of the format. - /// is invalid(i.e. undefined value). - /// - /// , , , or is less than zero. - /// - public AudioMediaFormat(MediaFormatAudioMimeType mimeType, - int channel, int sampleRate, int bit, int bitRate) - : this(mimeType, channel, sampleRate, bit, bitRate, MediaFormatAacType.None) - { - } - - /// - /// Initializes a new instance of the AudioMediaFormat class with the specified mime type, - /// channel, sample rate, bit, bit rate, and AAC type. - /// - /// The mime type of the format. - /// The channel value of the format. - /// The sample rate value of the format. - /// The bit value of the format. - /// The bit rate value of the format. - /// The AAC bitstream format(ADIF or ADTS). - /// - /// or is invalid (i.e. undefined value).\n - /// -or-\n - /// is not , but is one of the AAC types. - /// - /// - /// , , , or is less than zero. - /// - public AudioMediaFormat(MediaFormatAudioMimeType mimeType, - int channel, int sampleRate, int bit, int bitRate, MediaFormatAacType aacType) - : base(MediaFormatType.Audio) - { - if (!Enum.IsDefined(typeof(MediaFormatAudioMimeType), mimeType)) - { - throw new ArgumentException($"Invalid mime type value : { (int)mimeType }"); - } - if (channel < 0) - { - throw new ArgumentOutOfRangeException("Channel value can't be negative."); - } - if (sampleRate < 0) - { - throw new ArgumentOutOfRangeException("Sample rate value can't be negative."); - } - if (bit < 0) - { - throw new ArgumentOutOfRangeException("Bit value can't be negative."); - } - if (bitRate < 0) - { - throw new ArgumentOutOfRangeException("Bit rate value can't be negative."); - } - if (!Enum.IsDefined(typeof(MediaFormatAacType), aacType)) - { - throw new ArgumentException($"Invalid aac type value : { (int)aacType }"); - } - if (!IsAacSupportedMimeType(mimeType) && aacType != MediaFormatAacType.None) - { - throw new ArgumentException("Aac is supported only with aac mime types."); - } - - MimeType = mimeType; - Channel = channel; - SampleRate = sampleRate; - Bit = bit; - BitRate = bitRate; - AacType = aacType; - } - - /// - /// Initializes a new instance of the AudioMediaFormat class from a native handle. - /// - /// A native handle. - internal AudioMediaFormat(IntPtr handle) - : base(MediaFormatType.Audio) - { - Debug.Assert(handle != IntPtr.Zero, "The handle is invalid!"); - - MediaFormatAudioMimeType mimeType; - int channel = 0; - int sampleRate = 0; - int bit = 0; - int bitRate = 0; - MediaFormatAacType aacType; - GetInfo(handle, out mimeType, out channel, out sampleRate, out bit, out bitRate); - - if (IsAacSupportedMimeType(mimeType)) - { - GetAacType(handle, out aacType); - } - else - { - aacType = MediaFormatAacType.None; - } - - MimeType = mimeType; - Channel = channel; - SampleRate = sampleRate; - Bit = bit; - BitRate = bitRate; - AacType = aacType; - } - - /// - /// Returns an indication whether a specified mime type is an AAC type. - /// - /// A mime type. - private static bool IsAacSupportedMimeType(MediaFormatAudioMimeType mimeType) - { - return mimeType == MediaFormatAudioMimeType.AacLC || - mimeType == MediaFormatAudioMimeType.AacHE || - mimeType == MediaFormatAudioMimeType.AacHEPS; - } - - /// - /// Retrieves audio properties of the media format from a native handle. - /// - /// A native handle that the properties are retrieved from. - /// An out parameter for the mime type. - /// An out parameter for the channel. - /// An out parameter for the sample rate. - /// An out parameter for the bit. - /// An out parameter for the bit rate. - private static void GetInfo(IntPtr handle, out MediaFormatAudioMimeType mimeType, - out int channel, out int sampleRate, out int bit, out int bitRate) - { - Debug.Assert(handle != IntPtr.Zero, "The handle is invalid!"); - - int mimeTypeValue = 0; - - int ret = Interop.MediaFormat.GetAudioInfo(handle, - out mimeTypeValue, out channel, out sampleRate, out bit, out bitRate); - - mimeType = (MediaFormatAudioMimeType)mimeTypeValue; - - MultimediaDebug.AssertNoError(ret); - - Debug.Assert(Enum.IsDefined(typeof(MediaFormatAudioMimeType), mimeType), - "Invalid audio mime type!"); - } - - /// - /// Retrieves the AAC type value from a native handle. - /// - /// A native handle that the properties are retrieved from. - /// An out parameter for tha AAC type. - private static void GetAacType(IntPtr handle, out MediaFormatAacType aacType) - { - Debug.Assert(handle != IntPtr.Zero, "The handle is invalid!"); - - int aacTypeValue = 0; - - int ret = Interop.MediaFormat.GetAudioAacType(handle, out aacTypeValue); - - MultimediaDebug.AssertNoError(ret); - - aacType = (MediaFormatAacType)aacTypeValue; - - Debug.Assert(Enum.IsDefined(typeof(MediaFormatAacType), aacType), "Invalid aac type!"); - } - - internal override void AsNativeHandle(IntPtr handle) - { - Debug.Assert(Type == MediaFormatType.Audio); - - int ret = Interop.MediaFormat.SetAudioMimeType(handle, (int)MimeType); - MultimediaDebug.AssertNoError(ret); - - ret = Interop.MediaFormat.SetAudioChannel(handle, Channel); - MultimediaDebug.AssertNoError(ret); - - ret = Interop.MediaFormat.SetAudioSampleRate(handle, SampleRate); - MultimediaDebug.AssertNoError(ret); - - ret = Interop.MediaFormat.SetAudioBit(handle, Bit); - MultimediaDebug.AssertNoError(ret); - - ret = Interop.MediaFormat.SetAudioAverageBps(handle, BitRate); - MultimediaDebug.AssertNoError(ret); - - ret = Interop.MediaFormat.SetAudioAacType(handle, (int)AacType); - MultimediaDebug.AssertNoError(ret); - } - - /// - /// Gets the mime type of the current format. - /// - public MediaFormatAudioMimeType MimeType { get; } - - /// - /// Gets the channel value of the current format. - /// - public int Channel { get; } - - /// - /// Gets the sample rate value of the current format. - /// - public int SampleRate { get; } - - /// - /// Gets the bit value of the current format. - /// - public int Bit { get; } - - /// - /// Gets the bit rate value of the current format. - /// - public int BitRate { get; } - - /// - /// Gets the AAC type of the current format. - /// - public MediaFormatAacType AacType { get; } - - public override string ToString() - { - return $@"MimeTyp={ MimeType.ToString() }, Channel={ Channel.ToString() }, SampleRate= - { SampleRate }, Bit={ Bit.ToString() }, BitRate={ BitRate.ToString() }, AacType={ AacType.ToString() }"; - } - - public override bool Equals(object obj) - { - var rhs = obj as AudioMediaFormat; - if (rhs == null) - { - return false; - } - - return MimeType == rhs.MimeType && Channel == rhs.Channel && SampleRate == rhs.SampleRate && - Bit == rhs.Bit && BitRate == rhs.BitRate; - } - - public override int GetHashCode() - { - return new { MimeType, Channel, SampleRate, Bit, BitRate }.GetHashCode(); - } - } -} diff --git a/src/Tizen.Multimedia/MediaTool/ContainerMediaFormat.cs b/src/Tizen.Multimedia/MediaTool/ContainerMediaFormat.cs deleted file mode 100644 index 8efa929b8..000000000 --- a/src/Tizen.Multimedia/MediaTool/ContainerMediaFormat.cs +++ /dev/null @@ -1,101 +0,0 @@ -/* - * 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.Diagnostics; -using Tizen.Internals.Errors; - -namespace Tizen.Multimedia -{ - /// - /// Represents a container media format. This class cannot be inherited. - /// - public sealed class ContainerMediaFormat : MediaFormat - { - /// - /// Initializes a new instance of the ContainerMediaFormat class. - /// - /// The mime type of the container format. - /// is invalid (i.e. undefined value). - public ContainerMediaFormat(MediaFormatContainerMimeType mimeType) - : base(MediaFormatType.Container) - { - if (!Enum.IsDefined(typeof(MediaFormatContainerMimeType), mimeType)) - { - throw new ArgumentException($"Invalid mime type value : { (int)mimeType }"); - } - MimeType = mimeType; - } - - /// - /// Initializes a new instance of the ContainerMediaFormat class from a native handle. - /// - /// A native media format handle. - internal ContainerMediaFormat(IntPtr handle) - : base(MediaFormatType.Container) - { - Debug.Assert(handle != IntPtr.Zero, "The handle is invalid!"); - - int mimeType = 0; - - int ret = Interop.MediaFormat.GetContainerMimeType(handle, out mimeType); - - MultimediaDebug.AssertNoError(ret); - - Debug.Assert(Enum.IsDefined(typeof(MediaFormatContainerMimeType), mimeType), - "Invalid container mime type!"); - - MimeType = (MediaFormatContainerMimeType)mimeType; - } - - /// - /// Gets the mime type of the current format. - /// - public MediaFormatContainerMimeType MimeType - { - get; - } - - internal override void AsNativeHandle(IntPtr handle) - { - Debug.Assert(Type == MediaFormatType.Container); - - int ret = Interop.MediaFormat.SetContainerMimeType(handle, (int)MimeType); - - MultimediaDebug.AssertNoError(ret); - } - - public override string ToString() - { - return $"MimeType={ MimeType.ToString() }"; - } - - public override bool Equals(object obj) - { - var rhs = obj as ContainerMediaFormat; - if (rhs == null) - { - return false; - } - - return MimeType == rhs.MimeType; - } - - public override int GetHashCode() - { - return (int)MimeType; - } - } -} diff --git a/src/Tizen.Multimedia/MediaTool/MediaFormat.cs b/src/Tizen.Multimedia/MediaTool/MediaFormat.cs deleted file mode 100755 index d6c51e2a3..000000000 --- a/src/Tizen.Multimedia/MediaTool/MediaFormat.cs +++ /dev/null @@ -1,111 +0,0 @@ -/* - * 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.Diagnostics; -using Tizen.Internals.Errors; - -namespace Tizen.Multimedia -{ - /// - /// MediaFormat is a base class for media formats. - /// - public abstract class MediaFormat - { - /// - /// Initializes a new instance of the ContainerMediaFormat class with a type. - /// - /// A type for the format. - internal MediaFormat(MediaFormatType type) - { - Type = type; - } - - /// - /// Gets the type of the current format. - /// - public MediaFormatType Type - { - get; - } - - /// - /// Creates a media format from a native handle. - /// - /// A native handle. - /// An object of one of the subclasses of . - internal static MediaFormat FromHandle(IntPtr handle) - { - if (handle == IntPtr.Zero) - { - throw new ArgumentException("The handle value is invalid."); - } - - int type = 0; - int ret = Interop.MediaFormat.GetType(handle, out type); - - if (ret != (int)ErrorCode.InvalidOperation) - { - MultimediaDebug.AssertNoError(ret); - - switch ((MediaFormatType)type) - { - case MediaFormatType.Container: - return new ContainerMediaFormat(handle); - - case MediaFormatType.Video: - return new VideoMediaFormat(handle); - - case MediaFormatType.Audio: - return new AudioMediaFormat(handle); - - case MediaFormatType.Text: - return new TextMediaFormat(handle); - } - } - - throw new ArgumentException("looks like handle is corrupted."); - } - - /// - /// Creates a native media format from this object. - /// - /// A converted native handle. - /// The returned handle must be destroyed using . - internal IntPtr AsNativeHandle() - { - IntPtr handle; - int ret = Interop.MediaFormat.Create(out handle); - - MultimediaDebug.AssertNoError(ret); - - AsNativeHandle(handle); - - return handle; - } - - internal static void ReleaseNativeHandle(IntPtr handle) - { - Interop.MediaFormat.Unref(handle); - } - - /// - /// Fills out properties of a native media format with the current media format object. - /// - /// A native handle to be written. - internal abstract void AsNativeHandle(IntPtr handle); - } -} diff --git a/src/Tizen.Multimedia/MediaTool/MediaFormatAacType.cs b/src/Tizen.Multimedia/MediaTool/MediaFormatAacType.cs deleted file mode 100644 index 03ed36954..000000000 --- a/src/Tizen.Multimedia/MediaTool/MediaFormatAacType.cs +++ /dev/null @@ -1,37 +0,0 @@ -/* - * 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. - */ - -namespace Tizen.Multimedia -{ - /// - /// Specifies the AAC types for . - /// - public enum MediaFormatAacType - { - /// - /// Raw, no header. - /// - None, - /// - /// ADTS header. - /// - Adts, - /// - /// ADIF header. - /// - Adif - } -} diff --git a/src/Tizen.Multimedia/MediaTool/MediaFormatMimeType.cs b/src/Tizen.Multimedia/MediaTool/MediaFormatMimeType.cs deleted file mode 100755 index 3fbeebff8..000000000 --- a/src/Tizen.Multimedia/MediaTool/MediaFormatMimeType.cs +++ /dev/null @@ -1,363 +0,0 @@ -/* - * 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. - */ - -namespace Tizen.Multimedia -{ - /// - /// Specifies the media format types. - /// - /// - public enum MediaFormatType - { - /// - /// Audio media format. - /// - Audio = 0x01000000, - - /// - /// Video media format. - /// - Video = 0x02000000, - - /// - /// Container media format. - /// - Container = 0x04000000, - - /// - /// Text media format. - /// - Text = 0x03000000, - } - - /// - /// Specifies the media format data types. - /// - internal enum MediaFormatDataType - { - /// - /// Encoded type. - /// - Encoded = 0x10000000, - - /// - /// Raw type. - /// - Raw = 0x20000000, - } - - /// - /// Specifies the mime types for audio media formats. - /// - public enum MediaFormatAudioMimeType - { - /// - /// AMR, alias for . - /// - Amr = (MediaFormatType.Audio | MediaFormatDataType.Encoded | 0x1040), - - /// - /// AMR-NB. - /// - AmrNB = (MediaFormatType.Audio | MediaFormatDataType.Encoded | 0x1040), - - /// - /// AMR-WB. - /// - AmrWB = (MediaFormatType.Audio | MediaFormatDataType.Encoded | 0x1041), - - /// - /// AAC, alias for . - /// - Aac = (MediaFormatType.Audio | MediaFormatDataType.Encoded | 0x1060), - - /// - /// AAC-LC (Advanced Audio Coding Low-Complexity profile). - /// - AacLC = (MediaFormatType.Audio | MediaFormatDataType.Encoded | 0x1060), - - /// - /// HE-AAC (High-Efficiency Advanced Audio Coding). - /// - AacHE = (MediaFormatType.Audio | MediaFormatDataType.Encoded | 0x1061), - - /// - /// HE-AAC-PS (High-Efficiency Advanced Audio Coding with Parametric Stereo). - /// - AacHEPS = (MediaFormatType.Audio | MediaFormatDataType.Encoded | 0x1062), - - /// - /// MP3. - /// - MP3 = (MediaFormatType.Audio | MediaFormatDataType.Encoded | 0x1070), - - /// - /// VORBIS. - /// - Vorbis = (MediaFormatType.Audio | MediaFormatDataType.Encoded | 0x1080), - - /// - /// FLAC. - /// - Flac = (MediaFormatType.Audio | MediaFormatDataType.Encoded | 0x1090), - - /// - /// Windows Media Audio 1. - /// - Wma1 = (MediaFormatType.Audio | MediaFormatDataType.Encoded | 0x10A0), - - /// - /// Windows Media Audio 2. - /// - Wma2 = (MediaFormatType.Audio | MediaFormatDataType.Encoded | 0x10A1), - - /// - /// Windows Media Audio Professional. - /// - WmaPro = (MediaFormatType.Audio | MediaFormatDataType.Encoded | 0x10A2), - - /// - /// Windows Media Audio Lossless. - /// - WmaLossless = (MediaFormatType.Audio | MediaFormatDataType.Encoded | 0x10A3), - - /// - /// PCM. - /// - Pcm = (MediaFormatType.Audio | MediaFormatDataType.Raw | 0x1510), - } - - /// - /// Specifies the mime types for video media formats. - /// - public enum MediaFormatVideoMimeType - { - /// - /// H261. - /// - H261 = (MediaFormatType.Video | MediaFormatDataType.Encoded | 0x2010), - - /// - /// H263. - /// - H263 = (MediaFormatType.Video | MediaFormatDataType.Encoded | 0x2020), - - /// - /// H263P. - /// - H263P = (MediaFormatType.Video | MediaFormatDataType.Encoded | 0x2021), - - /// - /// H264_SP. - /// - H264SP = (MediaFormatType.Video | MediaFormatDataType.Encoded | 0x2030), - - /// - /// H264_MP. - /// - H264MP = (MediaFormatType.Video | MediaFormatDataType.Encoded | 0x2031), - - /// - /// H264_HP. - /// - H264HP = (MediaFormatType.Video | MediaFormatDataType.Encoded | 0x2032), - - /// - /// MJPEG - /// - MJpeg = (MediaFormatType.Video | MediaFormatDataType.Encoded | 0x2040), - - /// - /// MPEG1. - /// - Mpeg1 = (MediaFormatType.Video | MediaFormatDataType.Encoded | 0x2050), - - /// - /// MPEG2_SP. - /// - Mpeg2SP = (MediaFormatType.Video | MediaFormatDataType.Encoded | 0x2060), - - /// - /// MPEG2_MP. - /// - Mpeg2MP = (MediaFormatType.Video | MediaFormatDataType.Encoded | 0x2061), - - /// - /// MPEG2_HP. - /// - Mpeg2HP = (MediaFormatType.Video | MediaFormatDataType.Encoded | 0x2062), - - /// - /// MPEG4_SP. - /// - Mpeg4SP = (MediaFormatType.Video | MediaFormatDataType.Encoded | 0x2070), - - /// - /// MPEG4_ASP. - /// - Mpeg4Asp = (MediaFormatType.Video | MediaFormatDataType.Encoded | 0x2071), - - /// - /// I420. - /// - I420 = (MediaFormatType.Video | MediaFormatDataType.Raw | 0x2510), - - /// - /// NV12. - /// - NV12 = (MediaFormatType.Video | MediaFormatDataType.Raw | 0x2520), - - /// - /// NV12T. - /// - NV12T = (MediaFormatType.Video | MediaFormatDataType.Raw | 0x2530), - - /// - /// YV12. - /// - YV12 = (MediaFormatType.Video | MediaFormatDataType.Raw | 0x2540), - - /// - /// NV21. - /// - NV21 = (MediaFormatType.Video | MediaFormatDataType.Raw | 0x2550), - - /// - /// NV16. - /// - NV16 = (MediaFormatType.Video | MediaFormatDataType.Raw | 0x2560), - - /// - /// YUYV. - /// - Yuyv = (MediaFormatType.Video | MediaFormatDataType.Raw | 0x2570), - - /// - /// UYVY. - /// - Uyvy = (MediaFormatType.Video | MediaFormatDataType.Raw | 0x2580), - - /// - /// 422P. - /// - Yuv422P = (MediaFormatType.Video | MediaFormatDataType.Raw | 0x2590), - - /// - /// RGB565. - /// - Rgb565 = (MediaFormatType.Video | MediaFormatDataType.Raw | 0x25a0), - - /// - /// RGB888. - /// - Rgb888 = (MediaFormatType.Video | MediaFormatDataType.Raw | 0x25b0), - - /// - /// RGBA. - /// - Rgba = (MediaFormatType.Video | MediaFormatDataType.Raw | 0x25c0), - - /// - /// ARGB. - /// - Argb = (MediaFormatType.Video | MediaFormatDataType.Raw | 0x25d0), - - /// - /// BGRA. - /// - Bgra = (MediaFormatType.Video | MediaFormatDataType.Raw | 0x25e0), - - } - - /// - /// Specifies the mime types for container media formats. - /// - public enum MediaFormatContainerMimeType - { - /// - /// MP4 container, video. - /// - MP4 = (MediaFormatType.Container | 0x3010), - - /// - /// AVI container, video. - /// - Avi = (MediaFormatType.Container | 0x3020), - - /// - /// MPEG2TS container, video. - /// - Mpeg2TS = (MediaFormatType.Container | 0x3030), - - /// - /// MPEG2PS container, video. - /// - Mpeg2PS = (MediaFormatType.Container | 0x3040), - - /// - /// MATROSKA container, video. - /// - Matroska = (MediaFormatType.Container | 0x3050), - - /// - /// WEBM container, video. - /// - Webm = (MediaFormatType.Container | 0x3060), - - /// - /// 3GP container, video. - /// - ThreeGP = (MediaFormatType.Container | 0x3070), - - /// - /// WAV container, audio. - /// - Wav = (MediaFormatType.Container | 0x4010), - - /// - /// OGG container, audio - /// - Ogg = (MediaFormatType.Container | 0x4020), - - /// - /// AAC_ADTS container, audio - /// - AacAdts = (MediaFormatType.Container | 0x4030), - - /// - /// AAC_ADIF container, audio. - /// - AacAdif = (MediaFormatType.Container | 0x4031), - } - - /// - /// Specifies the text mime types. - /// - public enum MediaFormatTextMimeType - { - /// - /// MP4. - /// - MP4 = (MediaFormatType.Text | MediaFormatDataType.Encoded | 0x8010), - - /// - /// 3GP. - /// - ThreeGP = (MediaFormatType.Text | MediaFormatDataType.Encoded | 0x8020), - } - -} - diff --git a/src/Tizen.Multimedia/MediaTool/MediaFormatTextType.cs b/src/Tizen.Multimedia/MediaTool/MediaFormatTextType.cs deleted file mode 100755 index a9673fc50..000000000 --- a/src/Tizen.Multimedia/MediaTool/MediaFormatTextType.cs +++ /dev/null @@ -1,39 +0,0 @@ -/* - * 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. - */ - -namespace Tizen.Multimedia -{ - /// - /// Specifies the text types. - /// - public enum MediaFormatTextType - { - /// - /// This indicates no type specified. - /// - None, - - /// - /// MP4. - /// - MP4, - - /// - /// 3GPP. - /// - ThreeGpp - } -} diff --git a/src/Tizen.Multimedia/MediaTool/MediaPacket.Lock.cs b/src/Tizen.Multimedia/MediaTool/MediaPacket.Lock.cs deleted file mode 100644 index e08eb8f54..000000000 --- a/src/Tizen.Multimedia/MediaTool/MediaPacket.Lock.cs +++ /dev/null @@ -1,207 +0,0 @@ -/* - * 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.Diagnostics; -using System.Runtime.InteropServices; -using System.Threading; -using Tizen.Internals.Errors; - -namespace Tizen.Multimedia -{ - /// - /// Represents a packet for multimedia. - /// - public abstract partial class MediaPacket : IDisposable - { - private readonly LockState _lock = new LockState(); - - /// - /// Validates the current object is not locked. - /// - /// The MediaPacket has already been disposed of. - /// The MediaPacket is in use by another module. - private void ValidateNotLocked() - { - ValidateNotDisposed(); - - if (_lock.IsLocked) - { - throw new InvalidOperationException("Can't perform any writing operation." + - "The packet is in use, internally."); - } - } - - /// - /// Provides a thread-safe lock state controller. - /// - private sealed class LockState - { - const int LOCKED = 1; - const int UNLOCKED = 0; - - private int _locked = UNLOCKED; - - internal void SetLock() - { - if (Interlocked.CompareExchange(ref _locked, LOCKED, UNLOCKED) == LOCKED) - { - throw new InvalidOperationException("The packet is already locked."); - } - } - - internal void SetUnlock() - { - if (Interlocked.CompareExchange(ref _locked, UNLOCKED, LOCKED) == UNLOCKED) - { - Debug.Fail("The packet to unlock is not locked. " + - "There must be an error somewhere that a lock isn't disposed correctly."); - } - } - - internal bool IsLocked - { - get - { - return Interlocked.CompareExchange(ref _locked, 0, 0) == LOCKED; - } - } - } - - /// - /// Provides a thread-safe lock controller. - /// - /// - /// using (var lock = BaseMediaPacket.Lock(mediaPacket)) - /// { - /// .... - /// } - /// - internal sealed class Lock : IDisposable - { - private readonly MediaPacket _packet; - private readonly GCHandle _gcHandle; - private int _lockCount; - - internal static Lock Get(MediaPacket packet) - { - Debug.Assert(packet != null); - - lock (packet) - { - Lock lck = FromHandle(packet._handle); - - if (lck == null) - { - lck = new Lock(packet); - } - - lck._lockCount++; - - return lck; - } - } - - private Lock(MediaPacket packet) - { - Debug.Assert(packet != null, "The packet is null!"); - - packet.ValidateNotDisposed(); - - _packet = packet; - - _packet._lock.SetLock(); - - _gcHandle = GCHandle.Alloc(this); - - SetExtra(GCHandle.ToIntPtr(_gcHandle)); - } - - internal static Lock FromHandle(IntPtr handle) - { - Debug.Assert(handle != IntPtr.Zero); - - IntPtr extra = GetExtra(handle); - - if (extra == IntPtr.Zero) - { - return null; - } - - return (Lock)GCHandle.FromIntPtr(extra).Target; - } - - private void SetExtra(IntPtr ptr) - { - int ret = Interop.MediaPacket.SetExtra(_packet._handle, ptr); - - MultimediaDebug.AssertNoError(ret); - } - - private static IntPtr GetExtra(IntPtr handle) - { - IntPtr value; - - int ret = Interop.MediaPacket.GetExtra(handle, out value); - - MultimediaDebug.AssertNoError(ret); - - return value; - } - - internal IntPtr GetHandle() - { - return _packet.GetHandle(); - } - - internal MediaPacket MediaPacket - { - get - { - return _packet; - } - } - - private bool _isDisposed = false; - - public void Dispose() - { - if (!_isDisposed) - { - lock (_packet) - { - _lockCount--; - - if (_lockCount == 0) - { - SetExtra(IntPtr.Zero); - - if (_gcHandle.IsAllocated) - { - _gcHandle.Free(); - } - - //We can assure that at this point '_packet' is always locked by this lock. - _packet._lock.SetUnlock(); - } - } - - _isDisposed = true; - } - } - } - } -} diff --git a/src/Tizen.Multimedia/MediaTool/MediaPacket.cs b/src/Tizen.Multimedia/MediaTool/MediaPacket.cs deleted file mode 100644 index a72b05cab..000000000 --- a/src/Tizen.Multimedia/MediaTool/MediaPacket.cs +++ /dev/null @@ -1,575 +0,0 @@ -/* - * 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.Diagnostics; -using System.Runtime.InteropServices; -using System.Threading; -using Tizen.Internals.Errors; - -namespace Tizen.Multimedia -{ - /// - /// Represents a packet for multimedia. - /// - public abstract partial class MediaPacket : IDisposable - { - private IntPtr _handle = IntPtr.Zero; - - /// - /// Initializes a new instance of the MediaPacket class with the specified media format. - /// - /// The media format containing properties for the packet. - /// is null. - /// - /// The of the specified format is . - /// - /// Operation failed. - internal MediaPacket(MediaFormat format) - { - if (format == null) - { - throw new ArgumentNullException(nameof(format)); - } - - if (format.Type == MediaFormatType.Container) - { - throw new ArgumentException("Container format can't be used to create a new packet."); - } - - Initialize(format); - _format = format; - } - - /// - /// Initializes a new instance of the MediaPacket class from a native handle. - /// - /// The native handle to be used. - internal MediaPacket(IntPtr handle) - { - _handle = handle; - - IntPtr formatHandle; - int ret = Interop.MediaPacket.GetFormat(handle, out formatHandle); - - MultimediaDebug.AssertNoError(ret); - - try - { - if (formatHandle != IntPtr.Zero) - { - _format = MediaFormat.FromHandle(formatHandle); - } - } - finally - { - Interop.MediaFormat.Unref(formatHandle); - } - } - - ~MediaPacket() - { - Dispose(false); - } - - /// - /// Creates and initializes a native handle for the current object. - /// - /// The format to be set to the media format. - /// Operation failed. - private void Initialize(MediaFormat format) - { - if (format.Type == MediaFormatType.Container) - { - throw new ArgumentException("Creating a packet for container is not supported."); - } - - IntPtr formatHandle = IntPtr.Zero; - - try - { - formatHandle = format.AsNativeHandle(); - - int ret = Interop.MediaPacket.Create(formatHandle, IntPtr.Zero, IntPtr.Zero, out _handle); - MultimediaDebug.AssertNoError(ret); - - Debug.Assert(_handle != IntPtr.Zero, "Created handle must not be null"); - - Alloc(); - } - catch (Exception) - { - if (_handle != IntPtr.Zero) - { - Interop.MediaPacket.Destroy(_handle); - _handle = IntPtr.Zero; - } - - throw; - } - finally - { - if (formatHandle != IntPtr.Zero) - { - Interop.MediaFormat.Unref(formatHandle); - } - } - } - - /// - /// Allocates internal buffer. - /// - /// Operation failed. - private void Alloc() - { - ErrorCode ret = (ErrorCode)Interop.MediaPacket.Alloc(_handle); - if (ret == ErrorCode.None) - { - return; - } - - switch (ret) - { - case ErrorCode.OutOfMemory: - throw new OutOfMemoryException("Failed to allocate buffer for the packet."); - - default: - throw new InvalidOperationException("Failed to create a packet."); - } - - } - - private readonly MediaFormat _format; - - /// - /// Gets the media format of the current packet. - /// - public MediaFormat Format - { - get - { - ValidateNotDisposed(); - return _format; - } - } - - /// - /// Gets or sets the PTS(Presentation Time Stamp) value of the current packet. - /// - /// The MediaPacket has already been disposed of. - /// - /// The MediaPacket is not in the writable state, which means it is being used by another module. - /// - public ulong Pts - { - get - { - ValidateNotDisposed(); - - ulong value = 0; - int ret = Interop.MediaPacket.GetPts(_handle, out value); - - MultimediaDebug.AssertNoError(ret); - - return value; - } - set - { - ValidateNotDisposed(); - ValidateNotLocked(); - - int ret = Interop.MediaPacket.SetPts(_handle, value); - - MultimediaDebug.AssertNoError(ret); - } - } - - /// - /// Gets or sets the DTS(Decoding Time Stamp) value of the current packet. - /// - /// The MediaPacket has already been disposed of. - /// - /// The MediaPacket is not in the writable state, which means it is being used by another module. - /// - public ulong Dts - { - get - { - ValidateNotDisposed(); - - ulong value = 0; - int ret = Interop.MediaPacket.GetDts(_handle, out value); - - MultimediaDebug.AssertNoError(ret); - - return value; - } - set - { - ValidateNotDisposed(); - ValidateNotLocked(); - - int ret = Interop.MediaPacket.SetDts(_handle, value); - - MultimediaDebug.AssertNoError(ret); - } - } - - /// - /// Gets a value indicating whether the packet is the encoded type. - /// - /// true if the packet is the encoded type; otherwise, false. - /// The MediaPacket has already been disposed of. - public bool IsEncoded - { - get - { - ValidateNotDisposed(); - - bool value = false; - int ret = Interop.MediaPacket.IsEncoded(_handle, out value); - - MultimediaDebug.AssertNoError(ret); - - return value; - } - } - - private MediaPacketBuffer _buffer; - - /// - /// Gets the buffer of the packet. - /// - /// The allocated to the packet. - /// This property will return null if the packet is in the raw video format. - /// The MediaPacket has already been disposed of. - /// - /// - public MediaPacketBuffer Buffer - { - get - { - ValidateNotDisposed(); - - if (IsVideoPlaneSupported) - { - return null; - } - - if (_buffer == null) - { - _buffer = GetBuffer(); - } - - return _buffer; - } - } - - /// - /// Gets or sets a length of data written in the . - /// - /// The MediaPacket has already been disposed of. - /// - /// The value specified for this property is less than zero or greater than . - /// - /// The MediaPacket has instead of .\n - /// -or-\n - /// The MediaPacket is not in the writable state, which means it is being used by another module. - /// - public int BufferWrittenLength - { - get - { - ValidateNotDisposed(); - - ulong value = 0; - int ret = Interop.MediaPacket.GetBufferSize(_handle, out value); - MultimediaDebug.AssertNoError(ret); - - Debug.Assert(value < int.MaxValue); - - return (int)value; - } - set - { - ValidateNotDisposed(); - ValidateNotLocked(); - - if (IsVideoPlaneSupported) - { - throw new InvalidOperationException( - "This packet uses VideoPlanes instead of Buffer."); - } - - Debug.Assert(Buffer != null); - - if (value < 0 || value >= Buffer.Length) - { - throw new ArgumentOutOfRangeException("value must be less than Buffer.Size."); - } - - int ret = Interop.MediaPacket.SetBufferSize(_handle, (ulong)value); - MultimediaDebug.AssertNoError(ret); - } - } - - private MediaPacketVideoPlane[] _videoPlanes; - - /// - /// Gets the video planes of the packet. - /// - /// The s allocated to the packet. - /// This property will return null if the packet is not in the raw video format. - /// The MediaPacket has already been disposed of. - /// - /// - public MediaPacketVideoPlane[] VideoPlanes - { - get - { - ValidateNotDisposed(); - - if (!IsVideoPlaneSupported) - { - return null; - } - - if (_videoPlanes == null) - { - _videoPlanes = GetVideoPlanes(); - } - - return _videoPlanes; - } - } - - /// - /// Gets or sets the buffer flags of the packet. - /// - /// The MediaPacket has already been disposed of. - /// - /// The MediaPacket is not in the writable state, which means it is being used by another module. - /// - public MediaPacketBufferFlags BufferFlags - { - get - { - ValidateNotDisposed(); - - int value = 0; - - int ret = Interop.MediaPacket.GetBufferFlags(_handle, out value); - - MultimediaDebug.AssertNoError(ret); - - return (MediaPacketBufferFlags)value; - } - - set - { - ValidateNotDisposed(); - ValidateNotLocked(); - - int ret = Interop.MediaPacket.ResetBufferFlags(_handle); - - MultimediaDebug.AssertNoError(ret); - - ret = Interop.MediaPacket.SetBufferFlags(_handle, (int)value); - - MultimediaDebug.AssertNoError(ret); - } - } - - /// - /// Gets a value indicating whether the packet has been disposed of. - /// - /// true if the packet has been disposed of; otherwise, false. - public bool IsDisposed - { - get - { - return _isDisposed; - } - } - - private bool _isDisposed = false; - - - /// - /// Releases all resources used by the object. - /// - /// - /// The MediaPacket can not be disposed, which means it is being used by another module. - /// - public void Dispose() - { - if (_isDisposed) - { - return; - } - ValidateNotLocked(); - - Dispose(true); - GC.SuppressFinalize(this); - } - - /// - /// Releases the resources used by the object. - /// - /// - /// true to release both managed and unmanaged resources; false to release only unmanaged resources. - /// - protected virtual void Dispose(bool disposing) - { - if (_isDisposed) - { - return; - } - - if (_handle != IntPtr.Zero) - { - Interop.MediaPacket.Destroy(_handle); - _handle = IntPtr.Zero; - } - - _isDisposed = true; - } - - internal IntPtr GetHandle() - { - ValidateNotDisposed(); - - Debug.Assert(_handle != IntPtr.Zero, "The handle is invalid!"); - - return _handle; - } - - /// - /// Validates the current object has not been disposed of. - /// - /// The MediaPacket has already been disposed of. - private void ValidateNotDisposed() - { - if (_isDisposed) - { - throw new ObjectDisposedException("This packet has already been disposed of."); - } - } - - /// - /// Ensures whether the packet is writable. - /// - /// The MediaPacket has already been disposed of. - /// The MediaPacket is being used by another module. - internal void EnsureWritableState() - { - ValidateNotDisposed(); - ValidateNotLocked(); - } - - /// - /// Ensures whether the packet is readable. - /// - /// The MediaPacket has already been disposed of. - internal void EnsureReadableState() - { - ValidateNotDisposed(); - } - - /// - /// Gets a value indicating whether the packet is in the raw video format. - /// - /// true if the packet is in the raw video format; otherwise, false. - private bool IsVideoPlaneSupported - { - get - { - return !IsEncoded && Format.Type == MediaFormatType.Video; - } - } - - /// - /// Retrieves video planes of the current packet. - /// - /// The s allocated to the current MediaPacket. - private MediaPacketVideoPlane[] GetVideoPlanes() - { - Debug.Assert(_handle != IntPtr.Zero, "The handle is invalid!"); - - uint numberOfPlanes = 0; - int ret = Interop.MediaPacket.GetNumberOfVideoPlanes(_handle, out numberOfPlanes); - - MultimediaDebug.AssertNoError(ret); - - MediaPacketVideoPlane[] planes = new MediaPacketVideoPlane[numberOfPlanes]; - - for (int i = 0; i < numberOfPlanes; ++i) - { - planes[i] = new MediaPacketVideoPlane(this, i); - } - - return planes; - } - - /// - /// Retrieves the buffer of the current packet. - /// - /// The allocated to the current MediaPacket. - private MediaPacketBuffer GetBuffer() - { - Debug.Assert(_handle != IntPtr.Zero, "The handle is invalid!"); - - IntPtr dataHandle; - - int ret = Interop.MediaPacket.GetBufferData(_handle, out dataHandle); - MultimediaDebug.AssertNoError(ret); - - Debug.Assert(dataHandle != IntPtr.Zero, "Data handle is invalid!"); - - int size = 0; - ret = Interop.MediaPacket.GetAllocatedBufferSize(_handle, out size); - MultimediaDebug.AssertNoError(ret); - - return new MediaPacketBuffer(this, dataHandle, size); - } - - /// - /// Creates an object of the MediaPacket with the specified . - /// - /// The media format for the new packet. - /// A new MediaPacket object. - public static MediaPacket Create(MediaFormat format) - { - return new SimpleMediaPacket(format); - } - - internal static MediaPacket From(IntPtr handle) - { - return new SimpleMediaPacket(handle); - } - } - - internal class SimpleMediaPacket : MediaPacket - { - internal SimpleMediaPacket(MediaFormat format) : base(format) - { - } - - internal SimpleMediaPacket(IntPtr handle) : base(handle) - { - } - } -} diff --git a/src/Tizen.Multimedia/MediaTool/MediaPacketBuffer.cs b/src/Tizen.Multimedia/MediaTool/MediaPacketBuffer.cs deleted file mode 100644 index 2aecc07b5..000000000 --- a/src/Tizen.Multimedia/MediaTool/MediaPacketBuffer.cs +++ /dev/null @@ -1,176 +0,0 @@ -/* - * 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.Diagnostics; -using System.Runtime.InteropServices; - -namespace Tizen.Multimedia -{ - /// - /// Represents a buffer for a . - /// - public class MediaPacketBuffer - { - private readonly MediaPacket _packet; - private readonly IntPtr _dataHandle; - - internal MediaPacketBuffer(MediaPacket packet, IntPtr dataHandle, int size) - { - Debug.Assert(packet != null, "Packet is null!"); - Debug.Assert(!packet.IsDisposed, "Packet is already disposed!"); - Debug.Assert(dataHandle != IntPtr.Zero, "dataHandle is null!"); - Debug.Assert(size >= 0, "size must not be negative!"); - - _packet = packet; - _dataHandle = dataHandle; - _length = size; - } - - /// - /// Gets or sets a value at the specified index. - /// - /// The index of the value to get or set. - /// - /// is less than zero.\n - /// -or-\n - /// is equal to or greater than . - /// - /// The MediaPacket that owns the current buffer has already been disposed of. - /// The MediaPacket that owns the current buffer is being used by another module. - public byte this[int index] - { - get - { - _packet.EnsureReadableState(); - - if (index < 0 || index >= Length) - { - throw new ArgumentOutOfRangeException($"Valid index range is [0, { nameof(Length) })."); - } - - return Marshal.ReadByte(_dataHandle, index); - } - set - { - _packet.EnsureWritableState(); - - Marshal.WriteByte(_dataHandle, index, value); - } - } - - /// - /// Validates the range. - /// - /// - /// - /// - /// + is greater than .\n - /// -or-\n - /// or is less than zero. - /// - private void ValidateRange(int offset, int length) - { - if (offset + length > _length) - { - throw new ArgumentOutOfRangeException("offset + length can't be greater than length of the buffer."); - } - if (length < 0) - { - throw new ArgumentOutOfRangeException($"Length can't be less than zero : { length }."); - } - if (offset < 0) - { - throw new ArgumentOutOfRangeException($"Offset can't be less than zero : { offset }."); - } - } - - /// - /// Copies the data from a byte array to the buffer. - /// - /// The array to copy from. - /// The zero-based index in the source array where copying should start. - /// The number of array elements to copy. - /// The zero-based index in the buffer where copying should start. - /// - /// , , or is not valid. - /// - /// The MediaPacket that owns the current buffer has already been disposed of. - public void CopyFrom(byte[] source, int startIndex, int length, int offset = 0) - { - _packet.EnsureReadableState(); - - if (startIndex < 0) - { - throw new ArgumentOutOfRangeException("startIndex can't be less than zero."); - } - if (startIndex + length > source.Length) - { - throw new ArgumentOutOfRangeException("startIndex + length can't be greater than source.Length."); - } - - ValidateRange(offset, length); - - Marshal.Copy(source, startIndex, IntPtr.Add(_dataHandle, offset), length); - } - - /// - /// Copies the data from the buffer to a byte array. - /// - /// The array to copy to. - /// The zero-based index in the destination array where copying should start. - /// The number of elements to copy. - /// The zero-based index in the buffer where copying should start. - /// - /// , , , or is not valid. - /// - /// The MediaPacket that owns the current buffer has already been disposed of. - /// The MediaPacket that owns the current buffer is being used by another module. - public void CopyTo(byte[] dest, int startIndex, int length, int offset = 0) - { - _packet.EnsureWritableState(); - - if (startIndex < 0) - { - throw new ArgumentOutOfRangeException("Start index can't be less than zero."); - } - if (startIndex + length > dest.Length) - { - throw new ArgumentOutOfRangeException("startIndex + length can't be greater than dest.Length."); - } - - ValidateRange(offset, length); - - Marshal.Copy(IntPtr.Add(_dataHandle, offset), dest, startIndex, length); - } - - private readonly int _length; - - /// - /// Gets the size of the buffer, in bytes. - /// - /// The MediaPacket that owns the current buffer has already been disposed of. - public int Length - { - get - { - _packet.EnsureReadableState(); - - return _length; - } - } - } -} diff --git a/src/Tizen.Multimedia/MediaTool/MediaPacketBufferFlags.cs b/src/Tizen.Multimedia/MediaTool/MediaPacketBufferFlags.cs deleted file mode 100644 index 897d4b3c2..000000000 --- a/src/Tizen.Multimedia/MediaTool/MediaPacketBufferFlags.cs +++ /dev/null @@ -1,45 +0,0 @@ -/* - * 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.Multimedia -{ - /// - /// Specifies the flag for a buffer. - /// - /// This enumeration has a attribute that allows a bitwise combination of its member values. - /// - /// - [Flags] - public enum MediaPacketBufferFlags - { - /// - /// The buffer contains the codec initialization or the codec specific data instead of the media data. - /// - CodecConfig = 0x1, - - /// - /// The buffer indicates the end of the stream. - /// - EndOfStream = 0x2, - - /// - /// The buffer contains a sync frame. - /// - SyncFrame = 0x4, - } -} diff --git a/src/Tizen.Multimedia/MediaTool/MediaPacketVideoPlane.cs b/src/Tizen.Multimedia/MediaTool/MediaPacketVideoPlane.cs deleted file mode 100644 index aaabb3903..000000000 --- a/src/Tizen.Multimedia/MediaTool/MediaPacketVideoPlane.cs +++ /dev/null @@ -1,93 +0,0 @@ -/* - * 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.Diagnostics; - -namespace Tizen.Multimedia -{ - /// - /// Represents a video plane for the . - /// This class is used if and only if the format of the packet is the raw video. - /// - public class MediaPacketVideoPlane - { - private readonly MediaPacket _packet; - private readonly int _strideWidth; - private readonly int _strideHeight; - private readonly MediaPacketBuffer _buffer; - - internal MediaPacketVideoPlane(MediaPacket packet, int index) - { - Debug.Assert(packet != null, "The packet is null!"); - Debug.Assert(!packet.IsDisposed, "Packet is already disposed!"); - Debug.Assert(index >= 0, "Video plane index must not be negative!"); - - _packet = packet; - - int ret = Interop.MediaPacket.GetVideoStrideWidth(packet.GetHandle(), index, out _strideWidth); - MultimediaDebug.AssertNoError(ret); - - ret = Interop.MediaPacket.GetVideoStrideWidth(packet.GetHandle(), index, out _strideHeight); - MultimediaDebug.AssertNoError(ret); - - IntPtr dataHandle; - ret = Interop.MediaPacket.GetVideoPlaneData(packet.GetHandle(), index, out dataHandle); - MultimediaDebug.AssertNoError(ret); - - _buffer = new MediaPacketBuffer(packet, dataHandle, _strideWidth * _strideHeight); - } - - /// - /// Gets the buffer of the current video plane. - /// - /// The MediaPacket that owns the current buffer has already been disposed of. - public MediaPacketBuffer Buffer - { - get - { - _packet.EnsureReadableState(); - return _buffer; - } - } - - /// - /// Gets the stride width of the current video plane. - /// - /// The MediaPacket that owns the current buffer has already been disposed of. - public int StrideWidth - { - get - { - _packet.EnsureReadableState(); - return _strideWidth; - } - } - - /// - /// Gets the stride height of the current video plane. - /// - /// The MediaPacket that owns the current buffer has already been disposed of. - public int StrideHeight - { - get - { - _packet.EnsureReadableState(); - return _strideHeight; - } - } - } -} diff --git a/src/Tizen.Multimedia/MediaTool/TextMediaFormat.cs b/src/Tizen.Multimedia/MediaTool/TextMediaFormat.cs deleted file mode 100644 index 1c5ef6bc7..000000000 --- a/src/Tizen.Multimedia/MediaTool/TextMediaFormat.cs +++ /dev/null @@ -1,136 +0,0 @@ -/* - * 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.Diagnostics; -using Tizen.Internals.Errors; - -namespace Tizen.Multimedia -{ - /// - /// Represents a text media format. This class cannot be inherited. - /// - public sealed class TextMediaFormat : MediaFormat - { - /// - /// Initializes a new instance of the TextMediaFormat class with the specified mime type - /// and text type. - /// - /// The mime type of the format. - /// The text type of the format. - /// - /// or is invalid (i.e. undefined value). - /// - public TextMediaFormat(MediaFormatTextMimeType mimeType, MediaFormatTextType textType) - : base(MediaFormatType.Text) - { - if (!Enum.IsDefined(typeof(MediaFormatTextMimeType), mimeType)) - { - throw new ArgumentException($"Invalid mime type value : { (int)mimeType }"); - } - if (!Enum.IsDefined(typeof(MediaFormatTextType), textType)) - { - throw new ArgumentException($"Invalid text type value : { (int)textType }"); - } - MimeType = mimeType; - TextType = textType; - } - - /// - /// Initializes a new instance of the TextMediaFormat class from a native handle. - /// - /// A native handle. - internal TextMediaFormat(IntPtr handle) - : base(MediaFormatType.Text) - { - Debug.Assert(handle != IntPtr.Zero, "The handle is invalid!"); - - MediaFormatTextMimeType mimeType; - MediaFormatTextType textType; - - GetInfo(handle, out mimeType, out textType); - - MimeType = mimeType; - TextType = textType; - } - - /// - /// Retrieves text properties of the media format from a native handle. - /// - /// A native handle that the properties are retrieved from. - /// An out parameter for the mime type. - /// An out parameter for the text type. - private static void GetInfo(IntPtr handle, out MediaFormatTextMimeType mimeType, - out MediaFormatTextType textType) - { - int mimeTypeValue = 0; - int textTypeValue = 0; - - int ret = Interop.MediaFormat.GetTextInfo(handle, out mimeTypeValue, out textTypeValue); - - MultimediaDebug.AssertNoError(ret); - - mimeType = (MediaFormatTextMimeType)mimeTypeValue; - textType = (MediaFormatTextType)textTypeValue; - - Debug.Assert(Enum.IsDefined(typeof(MediaFormatTextMimeType), mimeType), - "Invalid text mime type!"); - Debug.Assert(Enum.IsDefined(typeof(MediaFormatTextType), textType), - "Invalid text type!"); - } - - internal override void AsNativeHandle(IntPtr handle) - { - Debug.Assert(Type == MediaFormatType.Text); - - int ret = Interop.MediaFormat.SetTextMimeType(handle, (int)MimeType); - MultimediaDebug.AssertNoError(ret); - - ret = Interop.MediaFormat.SetTextType(handle, (int)TextType); - MultimediaDebug.AssertNoError(ret); - } - - /// - /// Gets the mime type of the current format. - /// - public MediaFormatTextMimeType MimeType { get; } - - /// - /// Gets the text type of the current format. - /// - public MediaFormatTextType TextType { get; } - - public override string ToString() - { - return $"MimeType={ MimeType.ToString() }, TextType={ TextType.ToString() }"; - } - - public override bool Equals(object obj) - { - var rhs = obj as TextMediaFormat; - if (rhs == null) - { - return false; - } - - return MimeType == rhs.MimeType && TextType == rhs.TextType; - } - - public override int GetHashCode() - { - return new { MimeType, TextType }.GetHashCode(); - } - } -} diff --git a/src/Tizen.Multimedia/MediaTool/VideoMediaFormat.cs b/src/Tizen.Multimedia/MediaTool/VideoMediaFormat.cs deleted file mode 100644 index ca74d1816..000000000 --- a/src/Tizen.Multimedia/MediaTool/VideoMediaFormat.cs +++ /dev/null @@ -1,285 +0,0 @@ -/* - * 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.Diagnostics; -using Tizen.Internals.Errors; - -namespace Tizen.Multimedia -{ - /// - /// Represents a video media format. This class cannot be inherited. - /// - public sealed class VideoMediaFormat : MediaFormat - { - private const int DefaultFrameRate = 0; - private const int DefaultBitRate = 0; - - /// - /// Initializes a new instance of the VideoMediaFormat class with the specified mime type, width, and height. - /// - /// The mime type of the format. - /// The width value of the format. - /// The height value of the format - /// is invalid (i.e. undefined value). - /// or is less than zero. - public VideoMediaFormat(MediaFormatVideoMimeType mimeType, int width, int height) - : this(mimeType, width, height, DefaultFrameRate) - { - } - - /// - /// Initializes a new instance of the VideoMediaFormat class with the specified mime type and size. - /// - /// The mime type of the format. - /// The size of the format. - /// is invalid (i.e. undefined value). - /// The width or the height of is less than zero. - public VideoMediaFormat(MediaFormatVideoMimeType mimeType, Size size) - : this(mimeType, size, DefaultFrameRate) - { - } - - /// - /// Initializes a new instance of the VideoMediaFormat class with the specified mime type, - /// width, height, and frame rate. - /// - /// The mime type of the format. - /// The width value of the format. - /// The height value of the format - /// The frame rate of the format. - /// is invalid (i.e. undefined value). - /// - /// , , or is less than zero. - /// - public VideoMediaFormat(MediaFormatVideoMimeType mimeType, int width, int height, int frameRate) - : this(mimeType, width, height, frameRate, DefaultBitRate) - { - } - - /// - /// Initializes a new instance of the VideoMediaFormat class with the specified mime type, - /// width, height, and frame rate. - /// - /// The mime type of the format. - /// The video size of the format. - /// The frame rate of the format. - /// is invalid (i.e. undefined value). - /// - /// The width or the height of is less than zero.\n - /// -or-\n - /// is less than zero. - /// - public VideoMediaFormat(MediaFormatVideoMimeType mimeType, Size size, - int frameRate) - : this(mimeType, size, frameRate, DefaultBitRate) - { - } - - /// - /// Initializes a new instance of the VideoMediaFormat class with the specified mime type, - /// width, height, frame rate, and bit rate. - /// - /// The mime type of the format. - /// The width value of the format. - /// The height value of the format - /// The frame rate of the format. - /// The bit rate of the format. - /// is invalid (i.e. undefined value). - /// - /// , , , or is less than zero. - /// - public VideoMediaFormat(MediaFormatVideoMimeType mimeType, int width, int height, - int frameRate, int bitRate) - : this(mimeType, new Size(width, height), frameRate, bitRate) - { - } - - /// - /// Initializes a new instance of the VideoMediaFormat class with the specified mime type, - /// size, frame rate, and bit rate. - /// - /// The mime type of the format. - /// The size of the format. - /// The frame rate of the format. - /// The bit rate of the format. - /// is invalid (i.e. undefined value). - /// - /// The width or the height of is less than zero.\n - /// -or-\n - /// is less than zero.\n - /// -or-\n - /// is less than zero. - /// - public VideoMediaFormat(MediaFormatVideoMimeType mimeType, Size size, - int frameRate, int bitRate) - : base(MediaFormatType.Video) - { - if (!Enum.IsDefined(typeof(MediaFormatVideoMimeType), mimeType)) - { - throw new ArgumentException($"Invalid mime type value : { (int)mimeType }"); - } - if (size.Width < 0) - { - throw new ArgumentOutOfRangeException(nameof(size), size.Width, "Size.Width value can't be less than zero."); - } - if (size.Height < 0) - { - throw new ArgumentOutOfRangeException(nameof(size), size.Height, "Size.Height value can't be less than zero."); - } - if (frameRate < 0) - { - throw new ArgumentOutOfRangeException(nameof(frameRate), frameRate, "Frame rate can't be less than zero."); - } - if (bitRate < 0) - { - throw new ArgumentOutOfRangeException(nameof(bitRate), bitRate, "Bit rate value can't be less than zero."); - } - - MimeType = mimeType; - Size = size; - FrameRate = frameRate; - BitRate = bitRate; - } - - /// - /// Initializes a new instance of the VideoMediaForma class from a native handle. - /// - /// A native handle. - internal VideoMediaFormat(IntPtr handle) - : base(MediaFormatType.Video) - { - Debug.Assert(handle != IntPtr.Zero, "The handle is invalid!"); - - int width = 0; - int height = 0; - int bitRate = 0; - int frameRate = 0; - MediaFormatVideoMimeType mimeType; - GetInfo(handle, out width, out height, out bitRate, out mimeType); - - GetFrameRate(handle, out frameRate); - - MimeType = mimeType; - Size = new Size(width, height); - FrameRate = frameRate; - BitRate = bitRate; - } - - /// - /// Retrieves video properties of the media format from a native handle. - /// - /// A native handle that the properties are retrieved from. - /// An out parameter for the width. - /// An out parameter for the height. - /// An out parameter for the bit rate. - /// An out parameter for the mime type. - private static void GetInfo(IntPtr handle, out int width, out int height, out int bitRate, - out MediaFormatVideoMimeType mimeType) - { - Debug.Assert(handle != IntPtr.Zero, "The handle is invalid!"); - - int mimeTypeValue = 0; - int maxBps = 0; - - int ret = Interop.MediaFormat.GetVideoInfo(handle, - out mimeTypeValue, out width, out height, out bitRate, out maxBps); - - MultimediaDebug.AssertNoError(ret); - - mimeType = (MediaFormatVideoMimeType)mimeTypeValue; - - Debug.Assert(Enum.IsDefined(typeof(MediaFormatVideoMimeType), mimeType), - "Invalid video mime type!"); - } - - /// - /// Retrieves frame rate from a native handle. - /// - /// A native handle that the properties are retrieved from. - /// An out parameter for the frame rate. - private static void GetFrameRate(IntPtr handle, out int frameRate) - { - Debug.Assert(handle != IntPtr.Zero, "The handle is invalid!"); - - int ret = Interop.MediaFormat.GetVideoFrameRate(handle, out frameRate); - - MultimediaDebug.AssertNoError(ret); - } - - internal override void AsNativeHandle(IntPtr handle) - { - Debug.Assert(Type == MediaFormatType.Video); - - int ret = Interop.MediaFormat.SetVideoMimeType(handle, (int)MimeType); - MultimediaDebug.AssertNoError(ret); - - ret = Interop.MediaFormat.SetVideoWidth(handle, Size.Width); - MultimediaDebug.AssertNoError(ret); - - ret = Interop.MediaFormat.SetVideoHeight(handle, Size.Height); - MultimediaDebug.AssertNoError(ret); - - ret = Interop.MediaFormat.SetVideoAverageBps(handle, BitRate); - MultimediaDebug.AssertNoError(ret); - - ret = Interop.MediaFormat.SetVideoFrameRate(handle, FrameRate); - MultimediaDebug.AssertNoError(ret); - } - - /// - /// Gets the mime type of the current format. - /// - public MediaFormatVideoMimeType MimeType { get; } - - /// - /// Gets the size of the current format. - /// - public Size Size { get; } - - /// - /// Gets the frame rate value of the current format. - /// - public int FrameRate { get; } - - /// - /// Gets the bit rate value of the current format. - /// - public int BitRate { get; } - - public override string ToString() - { - return $@"MimeType={ MimeType.ToString() }, Size=({ Size.ToString() }), FrameRate= - { FrameRate.ToString() }, BitRate={ BitRate.ToString() }"; - } - - public override bool Equals(object obj) - { - var rhs = obj as VideoMediaFormat; - if (rhs == null) - { - return false; - } - - return MimeType == rhs.MimeType && Size == rhs.Size && - FrameRate == rhs.FrameRate && BitRate == rhs.BitRate; - } - - public override int GetHashCode() - { - return new { MimeType, Size, FrameRate, BitRate }.GetHashCode(); - } - } -} diff --git a/src/Tizen.Multimedia/MediaView/MediaView.cs b/src/Tizen.Multimedia/MediaView/MediaView.cs deleted file mode 100755 index f064a7279..000000000 --- a/src/Tizen.Multimedia/MediaView/MediaView.cs +++ /dev/null @@ -1,52 +0,0 @@ -/* - * 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 ElmSharp; - -namespace Tizen.Multimedia -{ - /// - /// The MediaView class allows application developers to display the video output on the screen. - /// - /// - /// This view should not be instantiated directly.\n - /// Use to create the view. - /// - /// - /// - /// Tizen.Xamarin.Forms.Extension.MediaView mediaView = ... - /// ... - /// var display = new Display((Tizen.Multimedia.MediaView)MediaView.NativeView); - /// - /// - public class MediaView : EvasObject - { - /// - /// This constructor is used by the infrastructure and is not intended to be used directly from application code. - /// - public MediaView(EvasObject parent) : base(parent) - { - } - - protected override IntPtr CreateHandle(EvasObject parent) - { - IntPtr evas = Interop.EvasObject.evas_object_evas_get(parent); - return Interop.EvasObject.evas_object_image_add(evas); - } - } -} - diff --git a/src/Tizen.Multimedia/Tizen.Multimedia.csproj b/src/Tizen.Multimedia/Tizen.Multimedia.csproj deleted file mode 100644 index 3b5598e70..000000000 --- a/src/Tizen.Multimedia/Tizen.Multimedia.csproj +++ /dev/null @@ -1,14 +0,0 @@ - - - - netstandard2.0 - - - - - - - - - - \ No newline at end of file diff --git a/src/Tizen.Multimedia/Tizen.Multimedia.sln b/src/Tizen.Multimedia/Tizen.Multimedia.sln deleted file mode 100755 index af31cfe4d..000000000 --- a/src/Tizen.Multimedia/Tizen.Multimedia.sln +++ /dev/null @@ -1,64 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26430.12 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Multimedia", "Tizen.Multimedia.csproj", "{CE0306EA-C972-4D11-916B-3A453FA18616}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ElmSharp", "..\ElmSharp\ElmSharp.csproj", "{11BB8B68-9E10-49F4-B9AB-9AD64703C81B}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen", "..\Tizen\Tizen.csproj", "{8C5FA5D9-925E-434C-B2E2-023AE99439D7}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Log", "..\Tizen.Log\Tizen.Log.csproj", "{A93E036B-A06F-4A3F-A724-73DCD57B8AEB}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Applications.Common", "..\Tizen.Applications.Common\Tizen.Applications.Common.csproj", "{C85B022F-7CB1-4420-8231-412EDC25BCBC}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.System.Information", "..\Tizen.System.Information\Tizen.System.Information.csproj", "{14A1C9D0-F301-4A1D-BAE0-A39B85E840CA}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.NUI", "..\Tizen.NUI\Tizen.NUI.csproj", "{9440B262-BA9A-4490-8E5A-7ABFA21E7CB7}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.System.SystemSettings", "..\Tizen.System.SystemSettings\Tizen.System.SystemSettings.csproj", "{852634E0-31DD-4469-B538-30C63F993433}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {CE0306EA-C972-4D11-916B-3A453FA18616}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {CE0306EA-C972-4D11-916B-3A453FA18616}.Debug|Any CPU.Build.0 = Debug|Any CPU - {CE0306EA-C972-4D11-916B-3A453FA18616}.Release|Any CPU.ActiveCfg = Release|Any CPU - {CE0306EA-C972-4D11-916B-3A453FA18616}.Release|Any CPU.Build.0 = Release|Any CPU - {11BB8B68-9E10-49F4-B9AB-9AD64703C81B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {11BB8B68-9E10-49F4-B9AB-9AD64703C81B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {11BB8B68-9E10-49F4-B9AB-9AD64703C81B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {11BB8B68-9E10-49F4-B9AB-9AD64703C81B}.Release|Any CPU.Build.0 = Release|Any CPU - {8C5FA5D9-925E-434C-B2E2-023AE99439D7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {8C5FA5D9-925E-434C-B2E2-023AE99439D7}.Debug|Any CPU.Build.0 = Debug|Any CPU - {8C5FA5D9-925E-434C-B2E2-023AE99439D7}.Release|Any CPU.ActiveCfg = Release|Any CPU - {8C5FA5D9-925E-434C-B2E2-023AE99439D7}.Release|Any CPU.Build.0 = Release|Any CPU - {A93E036B-A06F-4A3F-A724-73DCD57B8AEB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A93E036B-A06F-4A3F-A724-73DCD57B8AEB}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A93E036B-A06F-4A3F-A724-73DCD57B8AEB}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A93E036B-A06F-4A3F-A724-73DCD57B8AEB}.Release|Any CPU.Build.0 = Release|Any CPU - {C85B022F-7CB1-4420-8231-412EDC25BCBC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C85B022F-7CB1-4420-8231-412EDC25BCBC}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C85B022F-7CB1-4420-8231-412EDC25BCBC}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C85B022F-7CB1-4420-8231-412EDC25BCBC}.Release|Any CPU.Build.0 = Release|Any CPU - {14A1C9D0-F301-4A1D-BAE0-A39B85E840CA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {14A1C9D0-F301-4A1D-BAE0-A39B85E840CA}.Debug|Any CPU.Build.0 = Debug|Any CPU - {14A1C9D0-F301-4A1D-BAE0-A39B85E840CA}.Release|Any CPU.ActiveCfg = Release|Any CPU - {14A1C9D0-F301-4A1D-BAE0-A39B85E840CA}.Release|Any CPU.Build.0 = Release|Any CPU - {9440B262-BA9A-4490-8E5A-7ABFA21E7CB7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {9440B262-BA9A-4490-8E5A-7ABFA21E7CB7}.Debug|Any CPU.Build.0 = Debug|Any CPU - {9440B262-BA9A-4490-8E5A-7ABFA21E7CB7}.Release|Any CPU.ActiveCfg = Release|Any CPU - {9440B262-BA9A-4490-8E5A-7ABFA21E7CB7}.Release|Any CPU.Build.0 = Release|Any CPU - {852634E0-31DD-4469-B538-30C63F993433}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {852634E0-31DD-4469-B538-30C63F993433}.Debug|Any CPU.Build.0 = Debug|Any CPU - {852634E0-31DD-4469-B538-30C63F993433}.Release|Any CPU.ActiveCfg = Release|Any CPU - {852634E0-31DD-4469-B538-30C63F993433}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/src/Tizen.NUI/Tizen.NUI.csproj b/src/Tizen.NUI/Tizen.NUI.csproj deleted file mode 100755 index 22cb37840..000000000 --- a/src/Tizen.NUI/Tizen.NUI.csproj +++ /dev/null @@ -1,21 +0,0 @@ - - - - netstandard2.0 - $(DefineConstants);DEBUG_ON - - - - - - - - - - - TizenSystemSettings - - - - - \ No newline at end of file diff --git a/src/Tizen.NUI/Tizen.NUI.sln b/src/Tizen.NUI/Tizen.NUI.sln deleted file mode 100755 index b08673377..000000000 --- a/src/Tizen.NUI/Tizen.NUI.sln +++ /dev/null @@ -1,46 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26430.12 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.NUI", "Tizen.NUI.csproj", "{473C3BEC-2F67-4285-85FC-BF4E96BFFF1C}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.System.SystemSettings", "..\Tizen.System.SystemSettings\Tizen.System.SystemSettings.csproj", "{8D71B1B6-9901-436F-8914-9F812E1B10A7}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen", "..\Tizen\Tizen.csproj", "{33B7EFD5-0050-416D-A2D1-8F18F26F106D}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Log", "..\Tizen.Log\Tizen.Log.csproj", "{1C550C1F-9370-42FF-86FA-EDCD6262B258}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Applications.Common", "..\Tizen.Applications.Common\Tizen.Applications.Common.csproj", "{2AEDCAA7-543F-48A1-BEA3-CF3E14F6EDC2}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {473C3BEC-2F67-4285-85FC-BF4E96BFFF1C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {473C3BEC-2F67-4285-85FC-BF4E96BFFF1C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {473C3BEC-2F67-4285-85FC-BF4E96BFFF1C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {473C3BEC-2F67-4285-85FC-BF4E96BFFF1C}.Release|Any CPU.Build.0 = Release|Any CPU - {8D71B1B6-9901-436F-8914-9F812E1B10A7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {8D71B1B6-9901-436F-8914-9F812E1B10A7}.Debug|Any CPU.Build.0 = Debug|Any CPU - {8D71B1B6-9901-436F-8914-9F812E1B10A7}.Release|Any CPU.ActiveCfg = Release|Any CPU - {8D71B1B6-9901-436F-8914-9F812E1B10A7}.Release|Any CPU.Build.0 = Release|Any CPU - {33B7EFD5-0050-416D-A2D1-8F18F26F106D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {33B7EFD5-0050-416D-A2D1-8F18F26F106D}.Debug|Any CPU.Build.0 = Debug|Any CPU - {33B7EFD5-0050-416D-A2D1-8F18F26F106D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {33B7EFD5-0050-416D-A2D1-8F18F26F106D}.Release|Any CPU.Build.0 = Release|Any CPU - {1C550C1F-9370-42FF-86FA-EDCD6262B258}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {1C550C1F-9370-42FF-86FA-EDCD6262B258}.Debug|Any CPU.Build.0 = Debug|Any CPU - {1C550C1F-9370-42FF-86FA-EDCD6262B258}.Release|Any CPU.ActiveCfg = Release|Any CPU - {1C550C1F-9370-42FF-86FA-EDCD6262B258}.Release|Any CPU.Build.0 = Release|Any CPU - {2AEDCAA7-543F-48A1-BEA3-CF3E14F6EDC2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {2AEDCAA7-543F-48A1-BEA3-CF3E14F6EDC2}.Debug|Any CPU.Build.0 = Debug|Any CPU - {2AEDCAA7-543F-48A1-BEA3-CF3E14F6EDC2}.Release|Any CPU.ActiveCfg = Release|Any CPU - {2AEDCAA7-543F-48A1-BEA3-CF3E14F6EDC2}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/src/Tizen.NUI/src/internal/AccessibilityActionSignal.cs b/src/Tizen.NUI/src/internal/AccessibilityActionSignal.cs index ca92f015e..6e97809be 100755 --- a/src/Tizen.NUI/src/internal/AccessibilityActionSignal.cs +++ b/src/Tizen.NUI/src/internal/AccessibilityActionSignal.cs @@ -115,7 +115,7 @@ namespace Tizen.NUI public void Connect(System.Delegate func) { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); { NDalicPINVOKE.AccessibilityActionSignal_Connect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -124,7 +124,7 @@ namespace Tizen.NUI public void Disconnect(System.Delegate func) { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); { NDalicPINVOKE.AccessibilityActionSignal_Disconnect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); diff --git a/src/Tizen.NUI/src/internal/AccessibilityFocusOvershotSignal.cs b/src/Tizen.NUI/src/internal/AccessibilityFocusOvershotSignal.cs index 34af47c16..01d4f98f3 100755 --- a/src/Tizen.NUI/src/internal/AccessibilityFocusOvershotSignal.cs +++ b/src/Tizen.NUI/src/internal/AccessibilityFocusOvershotSignal.cs @@ -114,7 +114,7 @@ namespace Tizen.NUI public void Connect(System.Delegate func) { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); { NDalicPINVOKE.AccessibilityFocusOvershotSignal_Connect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -123,7 +123,7 @@ namespace Tizen.NUI public void Disconnect(System.Delegate func) { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); { NDalicPINVOKE.AccessibilityFocusOvershotSignal_Disconnect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); diff --git a/src/Tizen.NUI/src/internal/ActivatedSignalType.cs b/src/Tizen.NUI/src/internal/ActivatedSignalType.cs index 2ae0e6cc7..4e1c714d1 100755 --- a/src/Tizen.NUI/src/internal/ActivatedSignalType.cs +++ b/src/Tizen.NUI/src/internal/ActivatedSignalType.cs @@ -13,13 +13,11 @@ * limitations under the License. * */ -using System; -using System.Runtime.InteropServices; namespace Tizen.NUI { - [Obsolete("Please do not use! this will be deprecated")] - public class ActivatedSignalType : global::System.IDisposable + + internal class ActivatedSignalType : global::System.IDisposable { private global::System.Runtime.InteropServices.HandleRef swigCPtr; protected bool swigCMemOwn; @@ -116,7 +114,7 @@ namespace Tizen.NUI public void Connect(System.Delegate func) { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); { NDalicManualPINVOKE.ActivatedSignalType_Connect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -125,7 +123,7 @@ namespace Tizen.NUI public void Disconnect(System.Delegate func) { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); { NDalicManualPINVOKE.ActivatedSignalType_Disconnect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); diff --git a/src/Tizen.NUI/src/internal/AdaptorSignalType.cs b/src/Tizen.NUI/src/internal/AdaptorSignalType.cs deleted file mode 100755 index e9fa64403..000000000 --- a/src/Tizen.NUI/src/internal/AdaptorSignalType.cs +++ /dev/null @@ -1,103 +0,0 @@ -/** Copyright (c) 2017 Samsung Electronics Co., Ltd. -* -* 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. -* -*/ - -namespace Tizen.NUI -{ - - public class AdaptorSignalType : global::System.IDisposable - { - private global::System.Runtime.InteropServices.HandleRef swigCPtr; - protected bool swigCMemOwn; - - internal AdaptorSignalType(global::System.IntPtr cPtr, bool cMemoryOwn) - { - swigCMemOwn = cMemoryOwn; - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - } - - internal static global::System.Runtime.InteropServices.HandleRef getCPtr(AdaptorSignalType obj) - { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; - } - - ~AdaptorSignalType() - { - Dispose(); - } - - public virtual void Dispose() - { - lock (this) - { - if (swigCPtr.Handle != global::System.IntPtr.Zero) - { - if (swigCMemOwn) - { - swigCMemOwn = false; - NDalicManualPINVOKE.delete_AdaptorSignalType(swigCPtr); - } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - } - global::System.GC.SuppressFinalize(this); - } - } - - public bool Empty() - { - bool ret = NDalicManualPINVOKE.AdaptorSignalType_Empty(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - public uint GetConnectionCount() - { - uint ret = NDalicManualPINVOKE.AdaptorSignalType_GetConnectionCount(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - public void Connect(System.Delegate func) - { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); - { - NDalicManualPINVOKE.AdaptorSignalType_Connect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - } - - public void Disconnect(System.Delegate func) - { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); - { - NDalicManualPINVOKE.AdaptorSignalType_Disconnect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - } - - public void Emit(Adaptor arg) - { - NDalicManualPINVOKE.AdaptorSignalType_Emit(swigCPtr, Adaptor.getCPtr(arg)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - public AdaptorSignalType() : this(NDalicManualPINVOKE.new_AdaptorSignalType(), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - } - -} diff --git a/src/Tizen.NUI/src/internal/Alignment.cs b/src/Tizen.NUI/src/internal/Alignment.cs index 7108b1af1..c49d4f7cf 100755 --- a/src/Tizen.NUI/src/internal/Alignment.cs +++ b/src/Tizen.NUI/src/internal/Alignment.cs @@ -67,7 +67,7 @@ namespace Tizen.NUI - public new class Padding : global::System.IDisposable + public class Padding : global::System.IDisposable { private global::System.Runtime.InteropServices.HandleRef swigCPtr; protected bool swigCMemOwn; diff --git a/src/Tizen.NUI/src/internal/AnimationSignal.cs b/src/Tizen.NUI/src/internal/AnimationSignal.cs index 6855938d0..85d624dd5 100755 --- a/src/Tizen.NUI/src/internal/AnimationSignal.cs +++ b/src/Tizen.NUI/src/internal/AnimationSignal.cs @@ -115,7 +115,7 @@ namespace Tizen.NUI public void Connect(System.Delegate func) { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); { NDalicPINVOKE.AnimationSignal_Connect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -124,7 +124,7 @@ namespace Tizen.NUI public void Disconnect(System.Delegate func) { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); { NDalicPINVOKE.AnimationSignal_Disconnect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); diff --git a/src/Tizen.NUI/src/internal/Any.cs b/src/Tizen.NUI/src/internal/Any.cs index 8b6e5a521..0bc189d73 100755 --- a/src/Tizen.NUI/src/internal/Any.cs +++ b/src/Tizen.NUI/src/internal/Any.cs @@ -122,7 +122,7 @@ namespace Tizen.NUI return ret; } - public new SWIGTYPE_p_std__type_info GetType() + public SWIGTYPE_p_std__type_info GetType() { SWIGTYPE_p_std__type_info ret = new SWIGTYPE_p_std__type_info(NDalicPINVOKE.Any_GetType(swigCPtr), false); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -222,7 +222,7 @@ namespace Tizen.NUI if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - public new SWIGTYPE_p_std__type_info GetType() + public SWIGTYPE_p_std__type_info GetType() { SWIGTYPE_p_std__type_info ret = new SWIGTYPE_p_std__type_info(NDalicPINVOKE.Any_AnyContainerBase_GetType(swigCPtr), false); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); diff --git a/src/Tizen.NUI/src/internal/AppSignalType.cs b/src/Tizen.NUI/src/internal/AppSignalType.cs deleted file mode 100755 index 2ff2a0a80..000000000 --- a/src/Tizen.NUI/src/internal/AppSignalType.cs +++ /dev/null @@ -1,141 +0,0 @@ -/** Copyright (c) 2017 Samsung Electronics Co., Ltd. -* -* 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. -* -*/ - -namespace Tizen.NUI -{ - - internal class AppSignalType : global::System.IDisposable - { - private global::System.Runtime.InteropServices.HandleRef swigCPtr; - protected bool swigCMemOwn; - - internal AppSignalType(global::System.IntPtr cPtr, bool cMemoryOwn) - { - swigCMemOwn = cMemoryOwn; - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - } - - internal static global::System.Runtime.InteropServices.HandleRef getCPtr(AppSignalType obj) - { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; - } - - //A Flag to check who called Dispose(). (By User or DisposeQueue) - private bool isDisposeQueued = false; - //A Flat to check if it is already disposed. - protected bool disposed = false; - - ~AppSignalType() - { - if (!isDisposeQueued) - { - isDisposeQueued = true; - DisposeQueue.Instance.Add(this); - } - } - - public void Dispose() - { - //Throw excpetion if Dispose() is called in separate thread. - if (!Window.IsInstalled()) - { - throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread."); - } - - if (isDisposeQueued) - { - Dispose(DisposeTypes.Implicit); - } - else - { - Dispose(DisposeTypes.Explicit); - System.GC.SuppressFinalize(this); - } - } - - protected virtual void Dispose(DisposeTypes type) - { - if (disposed) - { - return; - } - - if (type == DisposeTypes.Explicit) - { - //Called by User - //Release your own managed resources here. - //You should release all of your own disposable objects here. - - } - - //Release your own unmanaged resources here. - //You should not access any managed member here except static instance. - //because the execution order of Finalizes is non-deterministic. - - if (swigCPtr.Handle != global::System.IntPtr.Zero) - { - swigCMemOwn = false; - NDalicManualPINVOKE.delete_AppSignalType(swigCPtr); - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - } - - disposed = true; - } - - public bool Empty() - { - bool ret = NDalicManualPINVOKE.AppSignalType_Empty(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - public uint GetConnectionCount() - { - uint ret = NDalicManualPINVOKE.AppSignalType_GetConnectionCount(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - public void Connect(System.Delegate func) - { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); - { - NDalicManualPINVOKE.AppSignalType_Connect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - } - - public void Disconnect(System.Delegate func) - { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); - { - NDalicManualPINVOKE.AppSignalType_Disconnect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - } - - public void Emit(WidgetApplication arg) - { - NDalicManualPINVOKE.AppSignalType_Emit(swigCPtr, WidgetApplication.getCPtr(arg)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - public AppSignalType() : this(NDalicManualPINVOKE.new_AppSignalType(), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - } -} diff --git a/src/Tizen.NUI/src/internal/Application.cs b/src/Tizen.NUI/src/internal/Application.cs index b7167d85c..07f73ba1c 100755 --- a/src/Tizen.NUI/src/internal/Application.cs +++ b/src/Tizen.NUI/src/internal/Application.cs @@ -20,6 +20,18 @@ namespace Tizen.NUI using System; using System.Runtime.InteropServices; + //This version should be updated and synced for every Dali native release + internal static class Version + { + public const int ver1 = 1; + public const int ver2 = 2; + public const int ver3 = 39; + public const int nuiVer1 = 0; + public const int nuiVer2 = 2; + public const int nuiVer3 = 39; + public const string nuiRelease = ""; + } + /** * @brief Event arguments that passed via NUIApplicationInit signal * @@ -671,7 +683,7 @@ namespace Tizen.NUI * (in the type of NUIApplicationResetEventHandler-DaliEventHandler) * provided by the user. Reset signal is emitted when application is reset */ - public new event DaliEventHandler Reset + public event DaliEventHandler Reset { add { @@ -1026,6 +1038,61 @@ namespace Tizen.NUI private static Application _instance; // singleton + public delegate void InitDelegate(); + + public delegate void TerminateDelegate(); + + public delegate void PauseDelegate(); + + public delegate void ResumeDelegate(); + + public delegate void ResizeDelegate(); + + public delegate void AppControlDelegate(); + + public delegate void LanguageChangedDelegate(); + + public delegate void RegionChangedDelegate(); + + public delegate void BatteryLowDelegate(); + + public delegate void MemoryLowDelegate(); + + [System.Runtime.InteropServices.UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.StdCall)] + internal delegate void InitDelegateInternal(); + + [System.Runtime.InteropServices.UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.StdCall)] + internal delegate void TerminateDelegateInternal(); + + [System.Runtime.InteropServices.UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.StdCall)] + internal delegate void PauseDelegateInternal(); + + [System.Runtime.InteropServices.UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.StdCall)] + internal delegate void ResumeDelegateInternal(); + + [System.Runtime.InteropServices.UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.StdCall)] + internal delegate void ResizeDelegateInternal(); + + [System.Runtime.InteropServices.UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.StdCall)] + internal delegate void AppControlDelegateInternal(); + + [System.Runtime.InteropServices.UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.StdCall)] + internal delegate void LanguageChangedDelegateInternal(); + + [System.Runtime.InteropServices.UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.StdCall)] + internal delegate void RegionChangedDelegateInternal(); + + [System.Runtime.InteropServices.UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.StdCall)] + internal delegate void BatteryLowDelegateInternal(); + + [System.Runtime.InteropServices.UnmanagedFunctionPointer(System.Runtime.InteropServices.CallingConvention.StdCall)] + internal delegate void MemoryLowDelegateInternal(); + + static void Initialization() + { + // instance.InitDelegate(); + } + public static Application Instance { get @@ -1041,57 +1108,88 @@ namespace Tizen.NUI return ret; } + internal void SetupDelegates() + { + InitDelegateInternal initializeCallback = new InitDelegateInternal(Initialization); + + NUILog.Debug("InitSignal connection count"); + + this.InitSignal().Connect(initializeCallback); + + NUILog.Debug("InitSignal connection count = " + InitSignal().GetConnectionCount()); + } + public static Application NewApplication() { - return NewApplication("", Application.WindowMode.Opaque); + _instance = NewApplication("", Application.WindowMode.Opaque); + return _instance; } public static Application NewApplication(string stylesheet) { - return NewApplication(stylesheet, Application.WindowMode.Opaque); + _instance = NewApplication(stylesheet, Application.WindowMode.Opaque); + return _instance; } public static Application NewApplication(string stylesheet, Application.WindowMode windowMode) { + { + int ver1 = -1; + int ver2 = -1; + int ver3 = -1; + + try + { + if (NDalicManualPINVOKE.NativeVersionCheck(ref ver1, ref ver2, ref ver3)) + { + if (ver1 != Version.ver1 || ver2 != Version.ver2 || ver3 != Version.ver3) + { + //throw new System.InvalidOperationException("Dali native version mismatch error! nui=" + Version.ver1 + "." + Version.ver2 + "." + Version.ver3 + " but dali=" + ver1 + "." + ver2 + "." + ver3); + NUILog.Error("Dali native version mismatch error! nui=" + Version.nuiVer1 + "." + Version.nuiVer2 + "." + Version.nuiVer3 + Version.nuiRelease + " but native dali=" + ver1 + "." + ver2 + "." + ver3); + } + } + else + { + //throw new System.InvalidOperationException("Dali native version mismatch error! nui=" + Version.ver1 + "." + Version.ver2 + "." + Version.ver3 + " but dali=" + ver1 + "." + ver2 + "." + ver3); + NUILog.Error("Dali native version mismatch error! nui=" + Version.nuiVer1 + "." + Version.nuiVer2 + "." + Version.nuiVer3 + Version.nuiRelease + " but native dali=" + ver1 + "." + ver2 + "." + ver3); + } + } + catch (Exception exc) + { + //throw new System.InvalidOperationException("Dali native version is very old! nui=" + Version.ver1 + "." + Version.ver2 + "." + Version.ver3); + NUILog.Error("Dali native version is very old! nui=" + Version.nuiVer1 + "." + Version.nuiVer2 + "." + Version.nuiVer3 + Version.nuiRelease); + NUILog.Error("exception occured! =" + exc.Message); + } + NUILog.Debug(" Dali native version=" + ver1 + "." + ver2 + "." + ver3 + " NUI version=" + Version.nuiVer1 + "." + Version.nuiVer2 + "." + Version.nuiVer3 + Version.nuiRelease); + } + NUILog.Debug(" NewApplication(string stylesheet, Application.WindowMode windowMode) is called! "); + // register all Views with the type registry, so that can be created / styled via JSON //ViewRegistryHelper.Initialize(); //moved to Application side. Application ret = New(1, stylesheet, windowMode); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + // we've got an application now connect the signals + ret.SetupDelegates(); // set the singleton _instance = ret; return ret; } - - public static Application NewApplication(string[] args, string stylesheet, Application.WindowMode windowMode) - { - NUILog.Debug(" NewApplication(string[] args, string stylesheet, Application.WindowMode windowMode) is called! "); - - Application ret = New(args, stylesheet, (Application.WindowMode)windowMode); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - - // set the singleton - _instance = ret; - return _instance; - } - - /// - /// Ensures that the function passed in is called from the main loop when it is idle. - /// - /// The function to call - /// true if added successfully, false otherwise - public bool AddIdle(System.Delegate func) + //Removed from v0.2.33 + /*public bool AddIdle(System.Delegate func) { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); System.IntPtr ip2 = NDalicManualPINVOKE.MakeCallback(new System.Runtime.InteropServices.HandleRef(this, ip)); bool ret = NDalicPINVOKE.Application_AddIdle(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip2)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; - } + }*/ + + /** * Outer::outer_method(int) @@ -1132,17 +1230,6 @@ namespace Tizen.NUI return ret; } - public static Application New(string[] args, string stylesheet, Application.WindowMode windowMode) - { - NUILog.Debug("New(string[] args) is called!"); - int argc = args.Length; - string argvStr = string.Join(" ", args); - - Application ret = new Application(NDalicPINVOKE.Application_New__MANUAL_4(argc, argvStr, stylesheet, (int)windowMode), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - public static Application New(int argc, string stylesheet, Application.WindowMode windowMode, Rectangle positionSize) { Application ret = new Application(NDalicPINVOKE.Application_New__SWIG_4(argc, stylesheet, (int)windowMode, Rectangle.getCPtr(positionSize)), true); diff --git a/src/Tizen.NUI/src/internal/ApplicationControlSignal.cs b/src/Tizen.NUI/src/internal/ApplicationControlSignal.cs index 3933f19d6..fba3f8139 100755 --- a/src/Tizen.NUI/src/internal/ApplicationControlSignal.cs +++ b/src/Tizen.NUI/src/internal/ApplicationControlSignal.cs @@ -116,7 +116,7 @@ namespace Tizen.NUI public void Connect(System.Delegate func) { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); { NDalicPINVOKE.ApplicationControlSignal_Connect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -125,7 +125,7 @@ namespace Tizen.NUI public void Disconnect(System.Delegate func) { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); { NDalicPINVOKE.ApplicationControlSignal_Disconnect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); diff --git a/src/Tizen.NUI/src/internal/ApplicationSignal.cs b/src/Tizen.NUI/src/internal/ApplicationSignal.cs index 25a738fb9..6c97b0f53 100755 --- a/src/Tizen.NUI/src/internal/ApplicationSignal.cs +++ b/src/Tizen.NUI/src/internal/ApplicationSignal.cs @@ -116,7 +116,7 @@ namespace Tizen.NUI public void Connect(System.Delegate func) { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); { NDalicPINVOKE.ApplicationSignal_Connect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -125,7 +125,7 @@ namespace Tizen.NUI public void Disconnect(System.Delegate func) { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); { NDalicPINVOKE.ApplicationSignal_Disconnect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); diff --git a/src/Tizen.NUI/src/internal/Builder.cs b/src/Tizen.NUI/src/internal/Builder.cs index 76e6e86cf..aaa87be8b 100755 --- a/src/Tizen.NUI/src/internal/Builder.cs +++ b/src/Tizen.NUI/src/internal/Builder.cs @@ -141,7 +141,6 @@ namespace Tizen.NUI } catch (System.Exception e) { - NUILog.Error(e.Message); throw new global::System.InvalidOperationException("Failed to parse " + fileName); } } diff --git a/src/Tizen.NUI/src/internal/ButtonSignal.cs b/src/Tizen.NUI/src/internal/ButtonSignal.cs index 40a71a3f8..a6fc806fd 100755 --- a/src/Tizen.NUI/src/internal/ButtonSignal.cs +++ b/src/Tizen.NUI/src/internal/ButtonSignal.cs @@ -115,7 +115,7 @@ namespace Tizen.NUI public void Connect(System.Delegate func) { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); { NDalicPINVOKE.ButtonSignal_Connect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -124,7 +124,7 @@ namespace Tizen.NUI public void Disconnect(System.Delegate func) { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); { NDalicPINVOKE.ButtonSignal_Disconnect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); diff --git a/src/Tizen.NUI/src/internal/Camera.cs b/src/Tizen.NUI/src/internal/Camera.cs index 7cfe07068..f43ba7f41 100755 --- a/src/Tizen.NUI/src/internal/Camera.cs +++ b/src/Tizen.NUI/src/internal/Camera.cs @@ -179,7 +179,7 @@ namespace Tizen.NUI if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - public static Camera DownCast(BaseHandle handle) + public new static Camera DownCast(BaseHandle handle) { Camera ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as Camera; if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -204,7 +204,7 @@ namespace Tizen.NUI if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - public new CameraType GetType() + public CameraType GetType() { CameraType ret = (CameraType)NDalicPINVOKE.CameraActor_GetType(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); diff --git a/src/Tizen.NUI/src/internal/ConnectionTracker.cs b/src/Tizen.NUI/src/internal/ConnectionTracker.cs index 21bab1970..165375fe6 100755 --- a/src/Tizen.NUI/src/internal/ConnectionTracker.cs +++ b/src/Tizen.NUI/src/internal/ConnectionTracker.cs @@ -75,7 +75,7 @@ namespace Tizen.NUI if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - public new virtual void SignalDisconnected(SlotObserver slotObserver, SWIGTYPE_p_Dali__CallbackBase callback) + public virtual void SignalDisconnected(SlotObserver slotObserver, SWIGTYPE_p_Dali__CallbackBase callback) { NDalicPINVOKE.ConnectionTracker_SignalDisconnected(swigCPtr, SlotObserver.getCPtr(slotObserver), SWIGTYPE_p_Dali__CallbackBase.getCPtr(callback)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); diff --git a/src/Tizen.NUI/src/internal/ConnectionTrackerInterface.cs b/src/Tizen.NUI/src/internal/ConnectionTrackerInterface.cs index 3505e46d8..35feff799 100755 --- a/src/Tizen.NUI/src/internal/ConnectionTrackerInterface.cs +++ b/src/Tizen.NUI/src/internal/ConnectionTrackerInterface.cs @@ -13,13 +13,11 @@ * limitations under the License. * */ -using System; -using System.Runtime.InteropServices; namespace Tizen.NUI { - [Obsolete("Please do not use! this will be internal")] - public class ConnectionTrackerInterface : SignalObserver + + internal class ConnectionTrackerInterface : SignalObserver { private global::System.Runtime.InteropServices.HandleRef swigCPtr; diff --git a/src/Tizen.NUI/src/internal/ControlKeySignal.cs b/src/Tizen.NUI/src/internal/ControlKeySignal.cs index 2152600ad..10ffc5418 100755 --- a/src/Tizen.NUI/src/internal/ControlKeySignal.cs +++ b/src/Tizen.NUI/src/internal/ControlKeySignal.cs @@ -118,7 +118,7 @@ namespace Tizen.NUI public void Connect(System.Delegate func) { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); { NDalicPINVOKE.ControlKeySignal_Connect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -127,7 +127,7 @@ namespace Tizen.NUI public void Disconnect(System.Delegate func) { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); { NDalicPINVOKE.ControlKeySignal_Disconnect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); diff --git a/src/Tizen.NUI/src/internal/CustomActor.cs b/src/Tizen.NUI/src/internal/CustomActor.cs index 15752d22e..6f7bf4dc7 100755 --- a/src/Tizen.NUI/src/internal/CustomActor.cs +++ b/src/Tizen.NUI/src/internal/CustomActor.cs @@ -68,7 +68,7 @@ namespace Tizen.NUI if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - public static CustomActor DownCast(BaseHandle handle) + public new static CustomActor DownCast(BaseHandle handle) { CustomActor ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as CustomActor; if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); diff --git a/src/Tizen.NUI/src/internal/DaliEnumConstants.cs b/src/Tizen.NUI/src/internal/DaliEnumConstants.cs index a709af05f..58320babe 100755 --- a/src/Tizen.NUI/src/internal/DaliEnumConstants.cs +++ b/src/Tizen.NUI/src/internal/DaliEnumConstants.cs @@ -94,7 +94,7 @@ internal class NUILog [CallerFilePath] string file = null ) { - Tizen.Log.Fatal("NUI", $"{msg} (at {DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fffffff")} line {lineNum} of {caller} in {file})" ); + Tizen.Log.Debug("NUI", $"{msg} (at {DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fffffff")} line {lineNum} of {caller} in {file})" ); } public static void Error(string msg, @@ -103,7 +103,7 @@ internal class NUILog [CallerFilePath] string file = null ) { - Tizen.Log.Fatal("NUI", $"[ERROR] {msg} (at {DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fffffff")} line {lineNum} of {caller} in {file})" ); + Tizen.Log.Debug("NUI", $"[ERROR] {msg} (at {DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fffffff")} line {lineNum} of {caller} in {file})" ); } } diff --git a/src/Tizen.NUI/src/internal/FloatSignal.cs b/src/Tizen.NUI/src/internal/FloatSignal.cs index 7980330fa..0af06f177 100755 --- a/src/Tizen.NUI/src/internal/FloatSignal.cs +++ b/src/Tizen.NUI/src/internal/FloatSignal.cs @@ -116,7 +116,7 @@ namespace Tizen.NUI public void Connect(System.Delegate func) { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); { NDalicPINVOKE.FloatSignal_Connect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -125,7 +125,7 @@ namespace Tizen.NUI public void Disconnect(System.Delegate func) { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); { NDalicPINVOKE.FloatSignal_Disconnect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); diff --git a/src/Tizen.NUI/src/internal/FocusChangedSignal.cs b/src/Tizen.NUI/src/internal/FocusChangedSignal.cs index e15a88091..4b00d4a3d 100755 --- a/src/Tizen.NUI/src/internal/FocusChangedSignal.cs +++ b/src/Tizen.NUI/src/internal/FocusChangedSignal.cs @@ -116,7 +116,7 @@ namespace Tizen.NUI public void Connect(System.Delegate func) { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); { NDalicPINVOKE.FocusChangedSignal_Connect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -125,7 +125,7 @@ namespace Tizen.NUI public void Disconnect(System.Delegate func) { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); { NDalicPINVOKE.FocusChangedSignal_Disconnect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); diff --git a/src/Tizen.NUI/src/internal/FocusGroupChangedSignal.cs b/src/Tizen.NUI/src/internal/FocusGroupChangedSignal.cs index ee8668479..439ebb815 100755 --- a/src/Tizen.NUI/src/internal/FocusGroupChangedSignal.cs +++ b/src/Tizen.NUI/src/internal/FocusGroupChangedSignal.cs @@ -115,7 +115,7 @@ namespace Tizen.NUI public void Connect(System.Delegate func) { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); { NDalicPINVOKE.FocusGroupChangedSignal_Connect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -124,7 +124,7 @@ namespace Tizen.NUI public void Disconnect(System.Delegate func) { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); { NDalicPINVOKE.FocusGroupChangedSignal_Disconnect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); diff --git a/src/Tizen.NUI/src/internal/FriendAssembly.cs b/src/Tizen.NUI/src/internal/FriendAssembly.cs index ca831bc7b..6ba2744e9 100755 --- a/src/Tizen.NUI/src/internal/FriendAssembly.cs +++ b/src/Tizen.NUI/src/internal/FriendAssembly.cs @@ -20,8 +20,8 @@ // compile with: /target:Tizen.NUI.ExtTEST /keyfile:FriendAssemblies.snk using System.Runtime.CompilerServices; -[assembly: InternalsVisibleTo("NUIsamples, PublicKey=0024000004800000940000000602000000240000525341310004000001000100ed445c2a988d35b99e5766f42eef33d89d1f67225db051f011abcfce47a4788875c39750a2e5695f1ec117f41d96610419811762669f98131db30a6e64c6bb8fde3731f373f6cda4c0087d121f5108559f216dc015807dc46ec5a4d1b63f5deff64c01754a0db0dc849bc300672572cbd2697432ab6c193ebf9fade6bf0f2aad")] -[assembly: InternalsVisibleTo("Tizen.Multimedia, PublicKey=0024000004800000940000000602000000240000525341310004000001000100d115b1004248416b12d21b626cfb17149c9303fe394693fd3b32d7872e89559a4fa96c98110c2e62eea48aca693bddbe17094ca8ea2e2cd79970ca590fb672b9b371b5d7002076817321f62d6483ea50c56dbd1f37b185a4c24c47718876e6ae6d266508c551170d4cbdda3f82edaff9405ee3d7857282d8269e8e518d2f0fb2")] +[assembly: InternalsVisibleTo("Tizen.NUI.Extension.Test, PublicKey=00240000048000009400000006020000002400005253413100040000010001004d7c7c03a196ecb8e7cc5056750e1f40ee2bbe99f0e53a07f2538f2b0f450bd731b9dca3706503a0378baca74a09cf3af6261b330c031f44817ab6ed64189460765a402279d3e0c1fa7295ae1dccb2e3ff329705fd85b58d66ae7cb7e95ba06e0d847c3e3ba918798f579e5caeb1c6149955e6baf24236eec46227a623e494b1")] +[assembly: InternalsVisibleTo("Tizen.Multimedia, PublicKey=0024000004800000940000000602000000240000525341310004000001000100bd36a93b6d224759632d08a501b9dcb99a533e8ff0c3a1fc7044f5b05e176c005e5a7fc4d1dfa54da4d4cad4868c4518aa1f661380fb90685dc699d5e48dcc697b33c1e38b70845f405612d6827e7337c191ddd0a0aa35fdad654efe4c54881fdaa82ce35dce18ea918953e448c7aa284a47ed6fe3aa9404930b2b973a28cddf")] [assembly: InternalsVisibleTo("Tizen.TV.NUI, PublicKey=0024000004800000940000000602000000240000525341310004000001000100ed445c2a988d35b99e5766f42eef33d89d1f67225db051f011abcfce47a4788875c39750a2e5695f1ec117f41d96610419811762669f98131db30a6e64c6bb8fde3731f373f6cda4c0087d121f5108559f216dc015807dc46ec5a4d1b63f5deff64c01754a0db0dc849bc300672572cbd2697432ab6c193ebf9fade6bf0f2aad")] namespace Tizen.NUI diff --git a/src/Tizen.NUI/src/internal/GaussianBlurViewSignal.cs b/src/Tizen.NUI/src/internal/GaussianBlurViewSignal.cs index f04eb2379..4eaed53b6 100755 --- a/src/Tizen.NUI/src/internal/GaussianBlurViewSignal.cs +++ b/src/Tizen.NUI/src/internal/GaussianBlurViewSignal.cs @@ -116,7 +116,7 @@ namespace Tizen.NUI public void Connect(System.Delegate func) { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); { NDalicPINVOKE.GaussianBlurViewSignal_Connect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -125,7 +125,7 @@ namespace Tizen.NUI public void Disconnect(System.Delegate func) { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); { NDalicPINVOKE.GaussianBlurViewSignal_Disconnect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); diff --git a/src/Tizen.NUI/src/internal/GestureDetector.cs b/src/Tizen.NUI/src/internal/GestureDetector.cs index cd60b5843..a9e821732 100755 --- a/src/Tizen.NUI/src/internal/GestureDetector.cs +++ b/src/Tizen.NUI/src/internal/GestureDetector.cs @@ -68,7 +68,7 @@ namespace Tizen.NUI if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - public static GestureDetector DownCast(BaseHandle handle) + public new static GestureDetector DownCast(BaseHandle handle) { GestureDetector ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as GestureDetector; if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); diff --git a/src/Tizen.NUI/src/internal/HoverSignal.cs b/src/Tizen.NUI/src/internal/HoverSignal.cs index 39dc7335e..aaf415e47 100755 --- a/src/Tizen.NUI/src/internal/HoverSignal.cs +++ b/src/Tizen.NUI/src/internal/HoverSignal.cs @@ -117,7 +117,7 @@ namespace Tizen.NUI public void Connect(System.Delegate func) { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); { NDalicPINVOKE.ActorHoverSignal_Connect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -126,7 +126,7 @@ namespace Tizen.NUI public void Disconnect(System.Delegate func) { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); { NDalicPINVOKE.ActorHoverSignal_Disconnect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); diff --git a/src/Tizen.NUI/src/internal/ImageSignal.cs b/src/Tizen.NUI/src/internal/ImageSignal.cs index 7362ba01f..3ccc0aebf 100755 --- a/src/Tizen.NUI/src/internal/ImageSignal.cs +++ b/src/Tizen.NUI/src/internal/ImageSignal.cs @@ -116,7 +116,7 @@ namespace Tizen.NUI public void Connect(System.Delegate func) { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); { NDalicPINVOKE.ImageSignal_Connect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -125,7 +125,7 @@ namespace Tizen.NUI public void Disconnect(System.Delegate func) { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); { NDalicPINVOKE.ImageSignal_Disconnect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); diff --git a/src/Tizen.NUI/src/internal/ImfEventSignalType.cs b/src/Tizen.NUI/src/internal/ImfEventSignalType.cs index 722e7a3b6..1ccbdc81e 100755 --- a/src/Tizen.NUI/src/internal/ImfEventSignalType.cs +++ b/src/Tizen.NUI/src/internal/ImfEventSignalType.cs @@ -13,13 +13,11 @@ * limitations under the License. * */ -using System; -using System.Runtime.InteropServices; namespace Tizen.NUI { - [Obsolete("Please do not use! this will be deprecated")] - public class ImfEventSignalType : global::System.IDisposable + + internal class ImfEventSignalType : global::System.IDisposable { private global::System.Runtime.InteropServices.HandleRef swigCPtr; protected bool swigCMemOwn; @@ -116,7 +114,7 @@ namespace Tizen.NUI public void Connect(System.Delegate func) { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); { NDalicManualPINVOKE.ImfEventSignalType_Connect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -125,7 +123,7 @@ namespace Tizen.NUI public void Disconnect(System.Delegate func) { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); { NDalicManualPINVOKE.ImfEventSignalType_Disconnect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); diff --git a/src/Tizen.NUI/src/internal/ImfVoidSignalType.cs b/src/Tizen.NUI/src/internal/ImfVoidSignalType.cs index ca6851c24..549be57a8 100755 --- a/src/Tizen.NUI/src/internal/ImfVoidSignalType.cs +++ b/src/Tizen.NUI/src/internal/ImfVoidSignalType.cs @@ -13,13 +13,11 @@ * limitations under the License. * */ -using System; -using System.Runtime.InteropServices; namespace Tizen.NUI { - [Obsolete("Please do not use! this will be internal")] - public class ImfVoidSignalType : global::System.IDisposable + + internal class ImfVoidSignalType : global::System.IDisposable { private global::System.Runtime.InteropServices.HandleRef swigCPtr; protected bool swigCMemOwn; @@ -121,7 +119,7 @@ namespace Tizen.NUI public void Connect(System.Delegate func) { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); { NDalicManualPINVOKE.ImfVoidSignalType_Connect__SWIG_0(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -130,7 +128,7 @@ namespace Tizen.NUI public void Disconnect(System.Delegate func) { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); { NDalicManualPINVOKE.ImfVoidSignalType_Disconnect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); diff --git a/src/Tizen.NUI/src/internal/ItemContainer.cs b/src/Tizen.NUI/src/internal/ItemContainer.cs index 189a85017..774012674 100755 --- a/src/Tizen.NUI/src/internal/ItemContainer.cs +++ b/src/Tizen.NUI/src/internal/ItemContainer.cs @@ -211,10 +211,10 @@ namespace Tizen.NUI return new ItemContainerEnumerator(this); } - // The type-safe enumerator. + // Type-safe enumerator /// Note that the IEnumerator documentation requires an InvalidOperationException to be thrown /// whenever the collection is modified. This has been done for changes in the size of the - /// collection, but not when one of the elements of the collection is modified as it is a bit + /// collection but not when one of the elements of the collection is modified as it is a bit /// tricky to detect unmanaged code that modifies the collection under our feet. public sealed class ItemContainerEnumerator : global::System.Collections.IEnumerator , global::System.Collections.Generic.IEnumerator diff --git a/src/Tizen.NUI/src/internal/ItemIdContainer.cs b/src/Tizen.NUI/src/internal/ItemIdContainer.cs index 994783f2c..79ab437d9 100755 --- a/src/Tizen.NUI/src/internal/ItemIdContainer.cs +++ b/src/Tizen.NUI/src/internal/ItemIdContainer.cs @@ -211,10 +211,10 @@ namespace Tizen.NUI return new ItemIdContainerEnumerator(this); } - // The type-safe enumerator. + // Type-safe enumerator /// Note that the IEnumerator documentation requires an InvalidOperationException to be thrown /// whenever the collection is modified. This has been done for changes in the size of the - /// collection, but not when one of the elements of the collection is modified as it is a bit + /// collection but not when one of the elements of the collection is modified as it is a bit /// tricky to detect unmanaged code that modifies the collection under our feet. public sealed class ItemIdContainerEnumerator : global::System.Collections.IEnumerator , global::System.Collections.Generic.IEnumerator diff --git a/src/Tizen.NUI/src/internal/ItemView.cs b/src/Tizen.NUI/src/internal/ItemView.cs index 5a2c37596..ad354db0a 100755 --- a/src/Tizen.NUI/src/internal/ItemView.cs +++ b/src/Tizen.NUI/src/internal/ItemView.cs @@ -83,7 +83,7 @@ namespace Tizen.NUI } } - public new class Property + public class Property { public static readonly int LAYOUT = NDalicManualPINVOKE.ItemView_Property_LAYOUT_get(); public static readonly int MINIMUM_SWIPE_SPEED = NDalicPINVOKE.ItemView_Property_MINIMUM_SWIPE_SPEED_get(); diff --git a/src/Tizen.NUI/src/internal/KeyEventSignal.cs b/src/Tizen.NUI/src/internal/KeyEventSignal.cs index d36097a13..f3334d44c 100755 --- a/src/Tizen.NUI/src/internal/KeyEventSignal.cs +++ b/src/Tizen.NUI/src/internal/KeyEventSignal.cs @@ -115,7 +115,7 @@ namespace Tizen.NUI public void Connect(System.Delegate func) { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); { NDalicPINVOKE.KeyEventSignal_Connect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -124,7 +124,7 @@ namespace Tizen.NUI public void Disconnect(System.Delegate func) { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); { NDalicPINVOKE.KeyEventSignal_Disconnect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); diff --git a/src/Tizen.NUI/src/internal/KeyInputFocusSignal.cs b/src/Tizen.NUI/src/internal/KeyInputFocusSignal.cs index 6204afcb9..146220ced 100755 --- a/src/Tizen.NUI/src/internal/KeyInputFocusSignal.cs +++ b/src/Tizen.NUI/src/internal/KeyInputFocusSignal.cs @@ -117,7 +117,7 @@ namespace Tizen.NUI public void Connect(System.Delegate func) { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); { NDalicPINVOKE.KeyInputFocusSignal_Connect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -126,7 +126,7 @@ namespace Tizen.NUI public void Disconnect(System.Delegate func) { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); { NDalicPINVOKE.KeyInputFocusSignal_Disconnect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); diff --git a/src/Tizen.NUI/src/internal/KeyboardTypeSignalType.cs b/src/Tizen.NUI/src/internal/KeyboardTypeSignalType.cs index 9e785f0df..6d8670dc0 100755 --- a/src/Tizen.NUI/src/internal/KeyboardTypeSignalType.cs +++ b/src/Tizen.NUI/src/internal/KeyboardTypeSignalType.cs @@ -114,7 +114,7 @@ namespace Tizen.NUI public void Connect(System.Delegate func) { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); { NDalicManualPINVOKE.KeyboardTypeSignalType_Connect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -123,7 +123,7 @@ namespace Tizen.NUI public void Disconnect(System.Delegate func) { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); { NDalicManualPINVOKE.KeyboardTypeSignalType_Disconnect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); diff --git a/src/Tizen.NUI/src/internal/LinearConstrainer.cs b/src/Tizen.NUI/src/internal/LinearConstrainer.cs index 0ffad0854..5a21f4cf5 100755 --- a/src/Tizen.NUI/src/internal/LinearConstrainer.cs +++ b/src/Tizen.NUI/src/internal/LinearConstrainer.cs @@ -160,7 +160,7 @@ namespace Tizen.NUI if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - internal static LinearConstrainer DownCast(BaseHandle handle) + internal new static LinearConstrainer DownCast(BaseHandle handle) { LinearConstrainer ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as LinearConstrainer; if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); diff --git a/src/Tizen.NUI/src/internal/LongPressGestureDetectedSignal.cs b/src/Tizen.NUI/src/internal/LongPressGestureDetectedSignal.cs index c46d0e25f..1ba97fc6f 100755 --- a/src/Tizen.NUI/src/internal/LongPressGestureDetectedSignal.cs +++ b/src/Tizen.NUI/src/internal/LongPressGestureDetectedSignal.cs @@ -117,7 +117,7 @@ namespace Tizen.NUI public void Connect(System.Delegate func) { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); { NDalicPINVOKE.LongPressGestureDetectedSignal_Connect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -126,7 +126,7 @@ namespace Tizen.NUI public void Disconnect(System.Delegate func) { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); { NDalicPINVOKE.LongPressGestureDetectedSignal_Disconnect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); diff --git a/src/Tizen.NUI/src/internal/ManualPINVOKE.cs b/src/Tizen.NUI/src/internal/ManualPINVOKE.cs index 18432e387..890050201 100755 --- a/src/Tizen.NUI/src/internal/ManualPINVOKE.cs +++ b/src/Tizen.NUI/src/internal/ManualPINVOKE.cs @@ -181,6 +181,9 @@ namespace Tizen.NUI [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_ViewWrapperImpl_CreateTransition")] public static extern global::System.IntPtr ViewWrapperImpl_CreateTransition(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_View_GetVisualResourceStatus")] + public static extern int View_GetVisualResourceStatus(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2); + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_View_CreateTransition")] public static extern global::System.IntPtr View_CreateTransition(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); @@ -671,8 +674,9 @@ namespace Tizen.NUI [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint = "CSharp_HIDDENINPUT_PROPERTY_SUBSTITUTE_COUNT_get")] public static extern int HIDDENINPUT_PROPERTY_SUBSTITUTE_COUNT_get(); - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint = "CSharp_HIDDENINPUT_PROPERTY_SHOW_DURATION_get")] - public static extern int HIDDENINPUT_PROPERTY_SHOW_DURATION_get(); + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint = "CSharp_HIDDENINPUT_PROPERTY_SHOW_LAST_CHARACTER_DURATION_get")] + public static extern int HIDDENINPUT_PROPERTY_SHOW_LAST_CHARACTER_DURATION_get(); + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_TtsPlayer_SWIGUpcast")] public static extern global::System.IntPtr TtsPlayer_SWIGUpcast(global::System.IntPtr jarg1); @@ -798,536 +802,126 @@ namespace Tizen.NUI [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_Adaptor_FeedKeyEvent")] public static extern void Window_FeedKeyEvent(global::System.Runtime.InteropServices.HandleRef jarg1); - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint = "CSharp_Dali_MakeCallback")] - public static extern global::System.IntPtr MakeCallback(global::System.Runtime.InteropServices.HandleRef jarg1); - - //for widget view - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WidgetView_Property_WIDGET_ID_get")] - public static extern int WidgetView_Property_WIDGET_ID_get(); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WidgetView_Property_INSTANCE_ID_get")] - public static extern int WidgetView_Property_INSTANCE_ID_get(); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WidgetView_Property_CONTENT_INFO_get")] - public static extern int WidgetView_Property_CONTENT_INFO_get(); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WidgetView_Property_TITLE_get")] - public static extern int WidgetView_Property_TITLE_get(); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WidgetView_Property_UPDATE_PERIOD_get")] - public static extern int WidgetView_Property_UPDATE_PERIOD_get(); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WidgetView_Property_PREVIEW_get")] - public static extern int WidgetView_Property_PREVIEW_get(); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WidgetView_Property_LOADING_TEXT_get")] - public static extern int WidgetView_Property_LOADING_TEXT_get(); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WidgetView_Property_WIDGET_STATE_FAULTED_get")] - public static extern int WidgetView_Property_WIDGET_STATE_FAULTED_get(); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WidgetView_Property_PERMANENT_DELETE_get")] - public static extern int WidgetView_Property_PERMANENT_DELETE_get(); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_new_WidgetView_Property")] - public static extern global::System.IntPtr new_WidgetView_Property(); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_delete_WidgetView_Property")] - public static extern void delete_WidgetView_Property(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WidgetView_New")] - public static extern global::System.IntPtr WidgetView_New(string jarg1, string jarg2, int jarg3, int jarg4, float jarg5); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WidgetView_DownCast")] - public static extern global::System.IntPtr WidgetView_DownCast(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_new_WidgetView__SWIG_0")] - public static extern global::System.IntPtr new_WidgetView__SWIG_0(); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_new_WidgetView__SWIG_1")] - public static extern global::System.IntPtr new_WidgetView__SWIG_1(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WidgetView_Assign")] - public static extern global::System.IntPtr WidgetView_Assign(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_delete_WidgetView")] - public static extern void delete_WidgetView(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WidgetView_PauseWidget")] - public static extern bool WidgetView_PauseWidget(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WidgetView_ResumeWidget")] - public static extern bool WidgetView_ResumeWidget(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WidgetView_CancelTouchEvent")] - public static extern bool WidgetView_CancelTouchEvent(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WidgetView_ActivateFaultedWidget")] - public static extern void WidgetView_ActivateFaultedWidget(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WidgetView_WidgetAddedSignal")] - public static extern global::System.IntPtr WidgetView_WidgetAddedSignal(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WidgetView_WidgetDeletedSignal")] - public static extern global::System.IntPtr WidgetView_WidgetDeletedSignal(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WidgetView_WidgetCreationAbortedSignal")] - public static extern global::System.IntPtr WidgetView_WidgetCreationAbortedSignal(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WidgetView_WidgetContentUpdatedSignal")] - public static extern global::System.IntPtr WidgetView_WidgetContentUpdatedSignal(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WidgetView_WidgetUpdatePeriodChangedSignal")] - public static extern global::System.IntPtr WidgetView_WidgetUpdatePeriodChangedSignal(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WidgetView_WidgetFaultedSignal")] - public static extern global::System.IntPtr WidgetView_WidgetFaultedSignal(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WidgetViewSignal_Empty")] - public static extern bool WidgetViewSignal_Empty(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WidgetViewSignal_GetConnectionCount")] - public static extern uint WidgetViewSignal_GetConnectionCount(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WidgetViewSignal_Connect")] - public static extern void WidgetViewSignal_Connect(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WidgetViewSignal_Disconnect")] - public static extern void WidgetViewSignal_Disconnect(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WidgetViewSignal_Emit")] - public static extern void WidgetViewSignal_Emit(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_new_WidgetViewSignal")] - public static extern global::System.IntPtr new_WidgetViewSignal(); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_delete_WidgetViewSignal")] - public static extern void delete_WidgetViewSignal(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WidgetView_SWIGUpcast")] - public static extern global::System.IntPtr WidgetView_SWIGUpcast(global::System.IntPtr jarg1); - - // For widget view manager - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WidgetViewManager_New")] - public static extern global::System.IntPtr WidgetViewManager_New(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WidgetViewManager_DownCast")] - public static extern global::System.IntPtr WidgetViewManager_DownCast(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_new_WidgetViewManager__SWIG_0")] - public static extern global::System.IntPtr new_WidgetViewManager__SWIG_0(); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_new_WidgetViewManager__SWIG_1")] - public static extern global::System.IntPtr new_WidgetViewManager__SWIG_1(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WidgetViewManager_Assign")] - public static extern global::System.IntPtr WidgetViewManager_Assign(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_delete_WidgetViewManager")] - public static extern void delete_WidgetViewManager(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WidgetViewManager_AddWidget")] - public static extern global::System.IntPtr WidgetViewManager_AddWidget(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2, string jarg3, int jarg4, int jarg5, float jarg6); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WidgetViewManager_SWIGUpcast")] - public static extern global::System.IntPtr WidgetViewManager_SWIGUpcast(global::System.IntPtr jarg1); - - - //For Adaptor - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_Adaptor_New__SWIG_0")] - public static extern global::System.IntPtr Adaptor_New__SWIG_0(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_Adaptor_New__SWIG_1")] - public static extern global::System.IntPtr Adaptor_New__SWIG_1(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_Adaptor_New__SWIG_2")] - public static extern global::System.IntPtr Adaptor_New__SWIG_2(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_Adaptor_New__SWIG_3")] - public static extern global::System.IntPtr Adaptor_New__SWIG_3(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2, global::System.Runtime.InteropServices.HandleRef jarg3); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_delete_Adaptor")] - public static extern void delete_Adaptor(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_Adaptor_Start")] - public static extern void Adaptor_Start(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_Adaptor_Pause")] - public static extern void Adaptor_Pause(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_Adaptor_Resume")] - public static extern void Adaptor_Resume(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_Adaptor_Stop")] - public static extern void Adaptor_Stop(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_Adaptor_AddIdle")] - public static extern bool Adaptor_AddIdle(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_Adaptor_RemoveIdle")] - public static extern void Adaptor_RemoveIdle(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_Adaptor_ReplaceSurface")] - public static extern void Adaptor_ReplaceSurface(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2, global::System.Runtime.InteropServices.HandleRef jarg3); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_Adaptor_GetSurface")] - public static extern global::System.IntPtr Adaptor_GetSurface(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_Adaptor_GetNativeWindowHandle")] - public static extern global::System.IntPtr Adaptor_GetNativeWindowHandle(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_Adaptor_ReleaseSurfaceLock")] - public static extern void Adaptor_ReleaseSurfaceLock(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_Adaptor_SetRenderRefreshRate")] - public static extern void Adaptor_SetRenderRefreshRate(global::System.Runtime.InteropServices.HandleRef jarg1, uint jarg2); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_Adaptor_SetUseHardwareVSync")] - public static extern void Adaptor_SetUseHardwareVSync(global::System.Runtime.InteropServices.HandleRef jarg1, bool jarg2); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_Adaptor_Get")] - public static extern global::System.IntPtr Adaptor_Get(); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_Adaptor_IsAvailable")] - public static extern bool Adaptor_IsAvailable(); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_Adaptor_NotifySceneCreated")] - public static extern void Adaptor_NotifySceneCreated(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_Adaptor_NotifyLanguageChanged")] - public static extern void Adaptor_NotifyLanguageChanged(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_Adaptor_SetMinimumPinchDistance")] - public static extern void Adaptor_SetMinimumPinchDistance(global::System.Runtime.InteropServices.HandleRef jarg1, float jarg2); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_Adaptor_FeedTouchPoint")] - public static extern void Adaptor_FeedTouchPoint(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2, int jarg3); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_Adaptor_FeedWheelEvent")] - public static extern void Adaptor_FeedWheelEvent(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_Adaptor_FeedKeyEvent")] - public static extern void Adaptor_FeedKeyEvent(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_Adaptor_SceneCreated")] - public static extern void Adaptor_SceneCreated(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_Adaptor_SetViewMode")] - public static extern void Adaptor_SetViewMode(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_Adaptor_SetStereoBase")] - public static extern void Adaptor_SetStereoBase(global::System.Runtime.InteropServices.HandleRef jarg1, float jarg2); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_Adaptor_ResizedSignal")] - public static extern global::System.IntPtr Adaptor_ResizedSignal(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_Adaptor_LanguageChangedSignal")] - public static extern global::System.IntPtr Adaptor_LanguageChangedSignal(global::System.Runtime.InteropServices.HandleRef jarg1); - - //Adaptor Signal Type - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_AdaptorSignalType_Empty")] - public static extern bool AdaptorSignalType_Empty(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_AdaptorSignalType_GetConnectionCount")] - public static extern uint AdaptorSignalType_GetConnectionCount(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_AdaptorSignalType_Connect")] - public static extern void AdaptorSignalType_Connect(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_AdaptorSignalType_Disconnect")] - public static extern void AdaptorSignalType_Disconnect(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_AdaptorSignalType_Emit")] - public static extern void AdaptorSignalType_Emit(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_new_AdaptorSignalType")] - public static extern global::System.IntPtr new_AdaptorSignalType(); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_delete_AdaptorSignalType")] - public static extern void delete_AdaptorSignalType(global::System.Runtime.InteropServices.HandleRef jarg1); - - //For widget - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_Widget_New")] - public static extern global::System.IntPtr Widget_New(string jarg1); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_new_Widget__SWIG_0")] - public static extern global::System.IntPtr new_Widget__SWIG_0(); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_new_Widget__SWIG_1")] - public static extern global::System.IntPtr new_Widget__SWIG_1(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_Widget_Assign")] - public static extern global::System.IntPtr Widget_Assign(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_delete_Widget")] - public static extern void delete_Widget(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_Widget_CreateSignal")] - public static extern global::System.IntPtr Widget_CreateSignal(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_Widget_TerminateSignal")] - public static extern global::System.IntPtr Widget_TerminateSignal(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_Widget_PauseSignal")] - public static extern global::System.IntPtr Widget_PauseSignal(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_Widget_ResumeSignal")] - public static extern global::System.IntPtr Widget_ResumeSignal(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_Widget_ResizeSignal")] - public static extern global::System.IntPtr Widget_ResizeSignal(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_Widget_UpdateSignal")] - public static extern global::System.IntPtr Widget_UpdateSignal(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WidgetApplication_New")] - public static extern global::System.IntPtr WidgetApplication_New(int jarg1, string jarg2, string jarg3); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_new_WidgetApplication__SWIG_0")] - public static extern global::System.IntPtr new_WidgetApplication__SWIG_0(); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_new_WidgetApplication__SWIG_1")] - public static extern global::System.IntPtr new_WidgetApplication__SWIG_1(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WidgetApplication_Assign")] - public static extern global::System.IntPtr WidgetApplication_Assign(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_delete_WidgetApplication")] - public static extern void delete_WidgetApplication(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WidgetApplication_MainLoop")] - public static extern void WidgetApplication_MainLoop(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WidgetApplication_Quit")] - public static extern void WidgetApplication_Quit(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WidgetApplication_GetWindow")] - public static extern global::System.IntPtr WidgetApplication_GetWindow(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WidgetApplication_GetResourcePath")] - public static extern string WidgetApplication_GetResourcePath(); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WidgetApplication_InitSignal")] - public static extern global::System.IntPtr WidgetApplication_InitSignal(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WidgetApplication_TerminateSignal")] - public static extern global::System.IntPtr WidgetApplication_TerminateSignal(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WidgetApplication_LanguageChangedSignal")] - public static extern global::System.IntPtr WidgetApplication_LanguageChangedSignal(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WidgetApplication_RegionChangedSignal")] - public static extern global::System.IntPtr WidgetApplication_RegionChangedSignal(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WidgetApplication_BatteryLowSignal")] - public static extern global::System.IntPtr WidgetApplication_BatteryLowSignal(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WidgetApplication_MemoryLowSignal")] - public static extern global::System.IntPtr WidgetApplication_MemoryLowSignal(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WidgetData_New")] - public static extern global::System.IntPtr WidgetData_New(string jarg1, global::System.Runtime.InteropServices.HandleRef jarg2, string jarg3); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_new_WidgetData__SWIG_0")] - public static extern global::System.IntPtr new_WidgetData__SWIG_0(); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_new_WidgetData__SWIG_1")] - public static extern global::System.IntPtr new_WidgetData__SWIG_1(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WidgetData_Assign")] - public static extern global::System.IntPtr WidgetData_Assign(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_delete_WidgetData")] - public static extern void delete_WidgetData(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WidgetData_GetInstanceId")] - public static extern string WidgetData_GetInstanceId(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WidgetData_GetArgs")] - public static extern global::System.IntPtr WidgetData_GetArgs(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WidgetData_GetContent")] - public static extern string WidgetData_GetContent(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WidgetData_GetWindow")] - public static extern global::System.IntPtr WidgetData_GetWindow(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WidgetData_SetArgs")] - public static extern void WidgetData_SetArgs(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WidgetData_SetContent")] - public static extern void WidgetData_SetContent(global::System.Runtime.InteropServices.HandleRef jarg1, string jarg2); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WidgetData_SetWindow")] - public static extern void WidgetData_SetWindow(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WidgetInstanceCreateSignalType_Empty")] - public static extern bool WidgetInstanceCreateSignalType_Empty(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WidgetInstanceCreateSignalType_GetConnectionCount")] - public static extern uint WidgetInstanceCreateSignalType_GetConnectionCount(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WidgetInstanceCreateSignalType_Connect")] - public static extern void WidgetInstanceCreateSignalType_Connect(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WidgetInstanceCreateSignalType_Disconnect")] - public static extern void WidgetInstanceCreateSignalType_Disconnect(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WidgetInstanceCreateSignalType_Emit")] - public static extern void WidgetInstanceCreateSignalType_Emit(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2, global::System.Runtime.InteropServices.HandleRef jarg3, global::System.Runtime.InteropServices.HandleRef jarg4); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_new_WidgetInstanceCreateSignalType")] - public static extern global::System.IntPtr new_WidgetInstanceCreateSignalType(); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_delete_WidgetInstanceCreateSignalType")] - public static extern void delete_WidgetInstanceCreateSignalType(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WidgetInstanceTerminateSignalType_Empty")] - public static extern bool WidgetInstanceTerminateSignalType_Empty(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WidgetInstanceTerminateSignalType_GetConnectionCount")] - public static extern uint WidgetInstanceTerminateSignalType_GetConnectionCount(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WidgetInstanceTerminateSignalType_Connect")] - public static extern void WidgetInstanceTerminateSignalType_Connect(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WidgetInstanceTerminateSignalType_Disconnect")] - public static extern void WidgetInstanceTerminateSignalType_Disconnect(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WidgetInstanceTerminateSignalType_Emit")] - public static extern void WidgetInstanceTerminateSignalType_Emit(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2, global::System.Runtime.InteropServices.HandleRef jarg3, int jarg4); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_new_WidgetInstanceTerminateSignalType")] - public static extern global::System.IntPtr new_WidgetInstanceTerminateSignalType(); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_delete_WidgetInstanceTerminateSignalType")] - public static extern void delete_WidgetInstanceTerminateSignalType(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WidgetInstancePauseOrResumeSignalType_Empty")] - public static extern bool WidgetInstancePauseOrResumeSignalType_Empty(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WidgetInstancePauseOrResumeSignalType_GetConnectionCount")] - public static extern uint WidgetInstancePauseOrResumeSignalType_GetConnectionCount(global::System.Runtime.InteropServices.HandleRef jarg1); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WidgetInstancePauseOrResumeSignalType_Connect")] - public static extern void WidgetInstancePauseOrResumeSignalType_Connect(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WidgetInstancePauseOrResumeSignalType_Disconnect")] - public static extern void WidgetInstancePauseOrResumeSignalType_Disconnect(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_Adaptor_RenderOnce")] + public static extern void Window_RenderOnce(global::System.Runtime.InteropServices.HandleRef jarg1); - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WidgetInstancePauseOrResumeSignalType_Emit")] - public static extern void WidgetInstancePauseOrResumeSignalType_Emit(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); + //for watch + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_new_WatchTime")] + public static extern global::System.IntPtr new_WatchTime(); - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_new_WidgetInstancePauseOrResumeSignalType")] - public static extern global::System.IntPtr new_WidgetInstancePauseOrResumeSignalType(); + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_delete_WatchTime")] + public static extern void delete_WatchTime(global::System.Runtime.InteropServices.HandleRef jarg1); - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_delete_WidgetInstancePauseOrResumeSignalType")] - public static extern void delete_WidgetInstancePauseOrResumeSignalType(global::System.Runtime.InteropServices.HandleRef jarg1); + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WatchTime_GetHour")] + public static extern int WatchTime_GetHour(global::System.Runtime.InteropServices.HandleRef jarg1); - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WidgetInstanceResizeSignalType_Empty")] - public static extern bool WidgetInstanceResizeSignalType_Empty(global::System.Runtime.InteropServices.HandleRef jarg1); + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WatchTime_GetHour24")] + public static extern int WatchTime_GetHour24(global::System.Runtime.InteropServices.HandleRef jarg1); - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WidgetInstanceResizeSignalType_GetConnectionCount")] - public static extern uint WidgetInstanceResizeSignalType_GetConnectionCount(global::System.Runtime.InteropServices.HandleRef jarg1); + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WatchTime_GetMinute")] + public static extern int WatchTime_GetMinute(global::System.Runtime.InteropServices.HandleRef jarg1); - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WidgetInstanceResizeSignalType_Connect")] - public static extern void WidgetInstanceResizeSignalType_Connect(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WatchTime_GetSecond")] + public static extern int WatchTime_GetSecond(global::System.Runtime.InteropServices.HandleRef jarg1); - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WidgetInstanceResizeSignalType_Disconnect")] - public static extern void WidgetInstanceResizeSignalType_Disconnect(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WatchTime_GetMillisecond")] + public static extern int WatchTime_GetMillisecond(global::System.Runtime.InteropServices.HandleRef jarg1); - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WidgetInstanceResizeSignalType_Emit")] - public static extern void WidgetInstanceResizeSignalType_Emit(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2, global::System.Runtime.InteropServices.HandleRef jarg3); + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WatchTime_GetYear")] + public static extern int WatchTime_GetYear(global::System.Runtime.InteropServices.HandleRef jarg1); - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_new_WidgetInstanceResizeSignalType")] - public static extern global::System.IntPtr new_WidgetInstanceResizeSignalType(); + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WatchTime_GetMonth")] + public static extern int WatchTime_GetMonth(global::System.Runtime.InteropServices.HandleRef jarg1); - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_delete_WidgetInstanceResizeSignalType")] - public static extern void delete_WidgetInstanceResizeSignalType(global::System.Runtime.InteropServices.HandleRef jarg1); + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WatchTime_GetDay")] + public static extern int WatchTime_GetDay(global::System.Runtime.InteropServices.HandleRef jarg1); - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WidgetInstanceUpdateSignalType_Empty")] - public static extern bool WidgetInstanceUpdateSignalType_Empty(global::System.Runtime.InteropServices.HandleRef jarg1); + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WatchTime_GetDayOfWeek")] + public static extern int WatchTime_GetDayOfWeek(global::System.Runtime.InteropServices.HandleRef jarg1); - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WidgetInstanceUpdateSignalType_GetConnectionCount")] - public static extern uint WidgetInstanceUpdateSignalType_GetConnectionCount(global::System.Runtime.InteropServices.HandleRef jarg1); + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WatchTime_GetUtcTime")] + public static extern global::System.IntPtr WatchTime_GetUtcTime(global::System.Runtime.InteropServices.HandleRef jarg1); - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WidgetInstanceUpdateSignalType_Connect")] - public static extern void WidgetInstanceUpdateSignalType_Connect(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WatchTime_GetUtcTimeStamp")] + public static extern global::System.IntPtr WatchTime_GetUtcTimeStamp(global::System.Runtime.InteropServices.HandleRef jarg1); - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WidgetInstanceUpdateSignalType_Disconnect")] - public static extern void WidgetInstanceUpdateSignalType_Disconnect(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WatchTime_GetTimeZone")] + public static extern string WatchTime_GetTimeZone(global::System.Runtime.InteropServices.HandleRef jarg1); - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WidgetInstanceUpdateSignalType_Emit")] - public static extern void WidgetInstanceUpdateSignalType_Emit(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2, global::System.Runtime.InteropServices.HandleRef jarg3, int jarg4); + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WatchTime_GetDaylightSavingTimeStatus")] + public static extern bool WatchTime_GetDaylightSavingTimeStatus(global::System.Runtime.InteropServices.HandleRef jarg1); - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_new_WidgetInstanceUpdateSignalType")] - public static extern global::System.IntPtr new_WidgetInstanceUpdateSignalType(); + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WatchApplication_New__SWIG_0")] + public static extern global::System.IntPtr WatchApplication_New__SWIG_0(); - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_delete_WidgetInstanceUpdateSignalType")] - public static extern void delete_WidgetInstanceUpdateSignalType(global::System.Runtime.InteropServices.HandleRef jarg1); + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WatchApplication_New__SWIG_1")] + public static extern global::System.IntPtr WatchApplication_New__SWIG_1(int jarg1, string jarg2); - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_AppSignalType_Empty")] - public static extern bool AppSignalType_Empty(global::System.Runtime.InteropServices.HandleRef jarg1); + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WatchApplication_New__SWIG_2")] + public static extern global::System.IntPtr WatchApplication_New__SWIG_2(int jarg1, string jarg2, string jarg3); - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_AppSignalType_GetConnectionCount")] - public static extern uint AppSignalType_GetConnectionCount(global::System.Runtime.InteropServices.HandleRef jarg1); + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_new_WatchApplication__SWIG_0")] + public static extern global::System.IntPtr new_WatchApplication__SWIG_0(); - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_AppSignalType_Connect")] - public static extern void AppSignalType_Connect(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_new_WatchApplication__SWIG_1")] + public static extern global::System.IntPtr new_WatchApplication__SWIG_1(global::System.Runtime.InteropServices.HandleRef jarg1); - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_AppSignalType_Disconnect")] - public static extern void AppSignalType_Disconnect(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WatchApplication_Assign")] + public static extern global::System.IntPtr WatchApplication_Assign(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_AppSignalType_Emit")] - public static extern void AppSignalType_Emit(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_delete_WatchApplication")] + public static extern void delete_WatchApplication(global::System.Runtime.InteropServices.HandleRef jarg1); - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_new_AppSignalType")] - public static extern global::System.IntPtr new_AppSignalType(); + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WatchApplication_TimeTickSignal")] + public static extern global::System.IntPtr WatchApplication_TimeTickSignal(global::System.Runtime.InteropServices.HandleRef jarg1); - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_delete_AppSignalType")] - public static extern void delete_AppSignalType(global::System.Runtime.InteropServices.HandleRef jarg1); + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WatchApplication_AmbientTickSignal")] + public static extern global::System.IntPtr WatchApplication_AmbientTickSignal(global::System.Runtime.InteropServices.HandleRef jarg1); - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_Widget_SWIGUpcast")] - public static extern global::System.IntPtr Widget_SWIGUpcast(global::System.IntPtr jarg1); + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WatchApplication_AmbientChangedSignal")] + public static extern global::System.IntPtr WatchApplication_AmbientChangedSignal(global::System.Runtime.InteropServices.HandleRef jarg1); - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WidgetApplication_SWIGUpcast")] - public static extern global::System.IntPtr WidgetApplication_SWIGUpcast(global::System.IntPtr jarg1); + //for watch signal + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WatchTimeSignal_Empty")] + public static extern bool WatchTimeSignal_Empty(global::System.Runtime.InteropServices.HandleRef jarg1); - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WidgetData_SWIGUpcast")] - public static extern global::System.IntPtr WidgetData_SWIGUpcast(global::System.IntPtr jarg1); + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WatchTimeSignal_GetConnectionCount")] + public static extern uint WatchTimeSignal_GetConnectionCount(global::System.Runtime.InteropServices.HandleRef jarg1); - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Actor_Property_INHERIT_LAYOUT_DIRECTION_get")] - public static extern int Actor_Property_INHERIT_LAYOUT_DIRECTION_get(); + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WatchTimeSignal_Connect")] + public static extern void WatchTimeSignal_Connect(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Actor_Property_LAYOUT_DIRECTION_get")] - public static extern int Actor_Property_LAYOUT_DIRECTION_get(); + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WatchTimeSignal_Disconnect")] + public static extern void WatchTimeSignal_Disconnect(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_LayoutDirectionChangedSignal")] - public static extern global::System.IntPtr LayoutDirectionChangedSignal(global::System.Runtime.InteropServices.HandleRef jarg1); + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WatchTimeSignal_Emit")] + public static extern void WatchTimeSignal_Emit(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2, global::System.Runtime.InteropServices.HandleRef jarg3); - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_ViewLayoutDirectionChangedSignal_Empty")] - public static extern bool ViewLayoutDirectionChangedSignal_Empty(global::System.Runtime.InteropServices.HandleRef jarg1); + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_new_WatchTimeSignal")] + public static extern global::System.IntPtr new_WatchTimeSignal(); - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_ViewLayoutDirectionSignal_GetConnectionCount")] - public static extern uint ViewLayoutDirectionChangedSignal_GetConnectionCount(global::System.Runtime.InteropServices.HandleRef jarg1); + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_delete_WatchTimeSignal")] + public static extern void delete_WatchTimeSignal(global::System.Runtime.InteropServices.HandleRef jarg1); - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_ViewLayoutDirectionSignal_Connect")] - public static extern void ViewLayoutDirectionChangedSignal_Connect(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WatchBoolSignal_Empty")] + public static extern bool WatchBoolSignal_Empty(global::System.Runtime.InteropServices.HandleRef jarg1); - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_ViewLayoutDirectionSignal_Disconnect")] - public static extern void ViewLayoutDirectionChangedSignal_Disconnect(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WatchBoolSignal_GetConnectionCount")] + public static extern uint WatchBoolSignal_GetConnectionCount(global::System.Runtime.InteropServices.HandleRef jarg1); - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_ViewLayoutDirectionSignal_Emit")] - public static extern void ViewLayoutDirectionChangedSignal_Emit(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WatchBoolSignal_Connect")] + public static extern void WatchBoolSignal_Connect(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_new_ViewLayoutDirectionSignal")] - public static extern global::System.IntPtr new_ViewLayoutDirectionChangedSignal(); + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WatchBoolSignal_Disconnect")] + public static extern void WatchBoolSignal_Disconnect(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2); - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_delete_ViewLayoutDirectionSignal")] - public static extern void delete_ViewLayoutDirectionChangedSignal(global::System.Runtime.InteropServices.HandleRef jarg1); + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_WatchBoolSignal_Emit")] + public static extern void WatchBoolSignal_Emit(global::System.Runtime.InteropServices.HandleRef jarg1, global::System.Runtime.InteropServices.HandleRef jarg2, bool jarg3); - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_Adaptor_RenderOnce")] - public static extern void Window_RenderOnce(global::System.Runtime.InteropServices.HandleRef jarg1); + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_new_WatchBoolSignal")] + public static extern global::System.IntPtr new_WatchBoolSignal(); + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_delete_WatchBoolSignal")] + public static extern void delete_WatchBoolSignal(global::System.Runtime.InteropServices.HandleRef jarg1); } } diff --git a/src/Tizen.NUI/src/internal/Model3dView.cs b/src/Tizen.NUI/src/internal/Model3dView.cs index 1732b09b2..cb053aaa7 100755 --- a/src/Tizen.NUI/src/internal/Model3dView.cs +++ b/src/Tizen.NUI/src/internal/Model3dView.cs @@ -65,7 +65,7 @@ namespace Tizen.NUI base.Dispose(type); } - public new class Property : global::System.IDisposable + public class Property : global::System.IDisposable { private global::System.Runtime.InteropServices.HandleRef swigCPtr; protected bool swigCMemOwn; diff --git a/src/Tizen.NUI/src/internal/NDalic.cs b/src/Tizen.NUI/src/internal/NDalic.cs index de0bbc565..d793ffd27 100755 --- a/src/Tizen.NUI/src/internal/NDalic.cs +++ b/src/Tizen.NUI/src/internal/NDalic.cs @@ -199,7 +199,7 @@ namespace Tizen.NUI public static bool RegisterType(string name, SWIGTYPE_p_std__type_info baseType, System.Delegate f) { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(f); + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(f); { bool ret = NDalicPINVOKE.RegisterType(name, SWIGTYPE_p_std__type_info.getCPtr(baseType), new System.Runtime.InteropServices.HandleRef(null, ip)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -209,8 +209,8 @@ namespace Tizen.NUI public static bool RegisterProperty(string objectName, string name, int index, PropertyType type, System.Delegate setFunc, System.Delegate getFunc) { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(setFunc); - System.IntPtr ip2 = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(getFunc); + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(setFunc); + System.IntPtr ip2 = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(getFunc); { bool ret = NDalicPINVOKE.RegisterProperty(objectName, name, index, (int)type, new System.Runtime.InteropServices.HandleRef(null, ip), new System.Runtime.InteropServices.HandleRef(null, ip2)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -885,7 +885,9 @@ namespace Tizen.NUI internal static readonly int IMAGE_VISUAL_FRAME_DELAY = NDalicPINVOKE.IMAGE_VISUAL_FRAME_DELAY_get(); internal static readonly int IMAGE_VISUAL_MASK_CONTENT_SCALE = NDalicPINVOKE.IMAGE_VISUAL_MASK_CONTENT_SCALE_get(); internal static readonly int IMAGE_VISUAL_CROP_TO_MASK = NDalicPINVOKE.IMAGE_VISUAL_CROP_TO_MASK_get(); - + internal static readonly int IMAGE_VISUAL_RELEASE_POLICY = NDalicPINVOKE.IMAGE_VISUAL_RELEASE_POLICY_get(); + internal static readonly int IMAGE_VISUAL_LOAD_POLICY = NDalicPINVOKE.IMAGE_VISUAL_LOAD_POLICY_get(); + internal static readonly int IMAGE_VISUAL_ORIENTATION_CORRECTION = NDalicPINVOKE.IMAGE_VISUAL_ORIENTATION_CORRECTION_get(); internal static readonly int MESH_VISUAL_OBJECT_URL = NDalicPINVOKE.MESH_VISUAL_OBJECT_URL_get(); internal static readonly int MESH_VISUAL_MATERIAL_URL = NDalicPINVOKE.MESH_VISUAL_MATERIAL_URL_get(); internal static readonly int MESH_VISUAL_TEXTURES_PATH = NDalicPINVOKE.MESH_VISUAL_TEXTURES_PATH_get(); diff --git a/src/Tizen.NUI/src/internal/NDalicPINVOKE.cs b/src/Tizen.NUI/src/internal/NDalicPINVOKE.cs index e6c72b638..59b03092e 100755 --- a/src/Tizen.NUI/src/internal/NDalicPINVOKE.cs +++ b/src/Tizen.NUI/src/internal/NDalicPINVOKE.cs @@ -5319,23 +5319,17 @@ class NDalicPINVOKE { [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_PaddingType_Set")] public static extern void PaddingType_Set(global::System.Runtime.InteropServices.HandleRef jarg1, float jarg2, float jarg3, float jarg4, float jarg5); - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_PaddingType_x_set")] - public static extern void PaddingType_x_set(global::System.Runtime.InteropServices.HandleRef jarg1, float jarg2); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_PaddingType_x_get")] - public static extern float PaddingType_x_get(global::System.Runtime.InteropServices.HandleRef jarg1); - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_PaddingType_left_set")] public static extern void PaddingType_left_set(global::System.Runtime.InteropServices.HandleRef jarg1, float jarg2); [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_PaddingType_left_get")] public static extern float PaddingType_left_get(global::System.Runtime.InteropServices.HandleRef jarg1); - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_PaddingType_y_set")] - public static extern void PaddingType_y_set(global::System.Runtime.InteropServices.HandleRef jarg1, float jarg2); + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_PaddingType_start_set")] + public static extern void PaddingType_start_set(global::System.Runtime.InteropServices.HandleRef jarg1, float jarg2); - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_PaddingType_y_get")] - public static extern float PaddingType_y_get(global::System.Runtime.InteropServices.HandleRef jarg1); + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_PaddingType_start_get")] + public static extern float PaddingType_start_get(global::System.Runtime.InteropServices.HandleRef jarg1); [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_PaddingType_right_set")] public static extern void PaddingType_right_set(global::System.Runtime.InteropServices.HandleRef jarg1, float jarg2); @@ -5343,11 +5337,11 @@ class NDalicPINVOKE { [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_PaddingType_right_get")] public static extern float PaddingType_right_get(global::System.Runtime.InteropServices.HandleRef jarg1); - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_PaddingType_width_set")] - public static extern void PaddingType_width_set(global::System.Runtime.InteropServices.HandleRef jarg1, float jarg2); + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_PaddingType_end_set")] + public static extern void PaddingType_end_set(global::System.Runtime.InteropServices.HandleRef jarg1, float jarg2); - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_PaddingType_width_get")] - public static extern float PaddingType_width_get(global::System.Runtime.InteropServices.HandleRef jarg1); + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_PaddingType_end_get")] + public static extern float PaddingType_end_get(global::System.Runtime.InteropServices.HandleRef jarg1); [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_PaddingType_bottom_set")] public static extern void PaddingType_bottom_set(global::System.Runtime.InteropServices.HandleRef jarg1, float jarg2); @@ -5355,12 +5349,6 @@ class NDalicPINVOKE { [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_PaddingType_bottom_get")] public static extern float PaddingType_bottom_get(global::System.Runtime.InteropServices.HandleRef jarg1); - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_PaddingType_height_set")] - public static extern void PaddingType_height_set(global::System.Runtime.InteropServices.HandleRef jarg1, float jarg2); - - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_PaddingType_height_get")] - public static extern float PaddingType_height_get(global::System.Runtime.InteropServices.HandleRef jarg1); - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_PaddingType_top_set")] public static extern void PaddingType_top_set(global::System.Runtime.InteropServices.HandleRef jarg1, float jarg2); @@ -6272,11 +6260,11 @@ class NDalicPINVOKE { [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_IsOpaqueState")] public static extern bool IsOpaqueState(global::System.Runtime.InteropServices.HandleRef jarg1); - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_SetScreenMode")] - public static extern bool SetScreenMode(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2); + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_SetScreenOffMode")] + public static extern bool SetScreenOffMode(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2); - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_GetScreenMode")] - public static extern int GetScreenMode(global::System.Runtime.InteropServices.HandleRef jarg1); + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_GetScreenOffMode")] + public static extern int GetScreenOffMode(global::System.Runtime.InteropServices.HandleRef jarg1); [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_SetBrightness")] public static extern bool SetBrightness(global::System.Runtime.InteropServices.HandleRef jarg1, int jarg2); @@ -6296,9 +6284,6 @@ class NDalicPINVOKE { [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_Application_New__SWIG_3")] public static extern global::System.IntPtr Application_New__SWIG_3(int jarg1, string jarg3, int jarg4); - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_Application_New__MANUAL_4")] - public static extern global::System.IntPtr Application_New__MANUAL_4(int jarg1, string jarg2, string jarg3, int jarg4); - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_new_Application__SWIG_0")] public static extern global::System.IntPtr new_Application__SWIG_0(); @@ -6431,6 +6416,7 @@ class NDalicPINVOKE { [global::System.Runtime.InteropServices.DllImport("NDalic", EntryPoint="CSharp_Dali_Application_New__SWIG_4")] public static extern global::System.IntPtr Application_New__SWIG_4(int jarg1, string jarg3, int jarg4, global::System.Runtime.InteropServices.HandleRef jarg5); + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_TimerSignalType_Empty")] public static extern bool TimerSignalType_Empty(global::System.Runtime.InteropServices.HandleRef jarg1); @@ -6578,6 +6564,15 @@ class NDalicPINVOKE { [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_IMAGE_VISUAL_CROP_TO_MASK_get")] public static extern int IMAGE_VISUAL_CROP_TO_MASK_get(); + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_IMAGE_VISUAL_RELEASE_POLICY_get")] + public static extern int IMAGE_VISUAL_RELEASE_POLICY_get(); + + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_IMAGE_VISUAL_LOAD_POLICY_get")] + public static extern int IMAGE_VISUAL_LOAD_POLICY_get(); + + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint ="CSharp_Dali_IMAGE_VISUAL_ORIENTATION_CORRECTION_get")] + public static extern int IMAGE_VISUAL_ORIENTATION_CORRECTION_get(); + [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_MESH_VISUAL_OBJECT_URL_get")] public static extern int MESH_VISUAL_OBJECT_URL_get(); @@ -9283,9 +9278,6 @@ class NDalicPINVOKE { [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_TextLabel_Property_TEXT_COLOR_get")] public static extern int TextLabel_Property_TEXT_COLOR_get(); - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_TextLabel_Property_TEXT_COLOR_ANIMATABLE_get")] - public static extern int TextLabel_Property_TEXT_COLOR_ANIMATABLE_get(); - [global::System.Runtime.InteropServices.DllImport("libdali-csharp-binder.so", EntryPoint="CSharp_Dali_TextLabel_Property_SHADOW_OFFSET_get")] public static extern int TextLabel_Property_SHADOW_OFFSET_get(); diff --git a/src/Tizen.NUI/src/internal/NUICoreBackend.cs b/src/Tizen.NUI/src/internal/NUICoreBackend.cs index ef771dc2f..35a855d60 100755 --- a/src/Tizen.NUI/src/internal/NUICoreBackend.cs +++ b/src/Tizen.NUI/src/internal/NUICoreBackend.cs @@ -27,14 +27,12 @@ namespace Tizen.NUI class NUICoreBackend : ICoreBackend { /// - /// The Application instance to connect event. + /// Application instance to connect event. /// protected Application _application; - private string _stylesheet = ""; - private NUIApplication.WindowMode _windowMode = NUIApplication.WindowMode.Opaque; /// - /// The Dictionary to contain each type of event callback. + /// Dictionary to contain each type of event callback. /// protected IDictionary Handlers = new Dictionary(); @@ -43,6 +41,7 @@ namespace Tizen.NUI /// public NUICoreBackend() { + _application = Application.NewApplication(); } /// @@ -50,7 +49,7 @@ namespace Tizen.NUI /// public NUICoreBackend(string stylesheet) { - _stylesheet = stylesheet; + _application = Application.NewApplication(stylesheet); } /// @@ -58,28 +57,27 @@ namespace Tizen.NUI /// public NUICoreBackend(string stylesheet, NUIApplication.WindowMode windowMode) { - _stylesheet = stylesheet; - _windowMode = windowMode; + _application = Application.NewApplication(stylesheet, (Application.WindowMode)windowMode ); } /// - /// Adds NUIApplication event to Application. - /// Puts each type of event callback in Dictionary. + /// Add NUIApplication event to Application. + /// Put each type of event callback in Dictionary. /// - /// The type of event. - /// The event callback. + /// Type of event + /// Event callback public void AddEventHandler(EventType evType, Action handler) { Handlers.Add(evType, handler); } /// - /// Adds NUIApplication event to Application. - /// Puts each type of event callback in Dictionary. + /// Add NUIApplication event to Application. + /// Put each type of event callback in Dictionary. /// - /// The argument type for the event. - /// The type of event. - /// The event callback. + /// Argument type for the event + /// Type of event + /// Event callback public void AddEventHandler(EventType evType, Action handler) where TEventArgs : EventArgs { Handlers.Add(evType, handler); @@ -87,55 +85,27 @@ namespace Tizen.NUI /// - /// The Dispose function. + /// Dispose function. /// public void Dispose() { - if(_application != null) - { - _application.Dispose(); - } + _application.Dispose(); } /// - /// The Exit application. + /// Exit Application. /// public void Exit() { - if(_application != null) - { - _application.Quit(); - } + _application.Quit(); } /// - /// Ensures that the function passed in is called from the main loop when it is idle. + /// Run Application. /// - /// The function to call - /// true if added successfully, false otherwise - public bool AddIdle(System.Delegate func) - { - return _application.AddIdle(func); - } - - /// - /// The Run application. - /// - /// The arguments from commandline. + /// Arguments from commandline. public void Run(string[] args) { - TizenSynchronizationContext.Initialize(); - - args[0] = Tizen.Applications.Application.Current.ApplicationInfo.ExecutablePath; - if (args.Length == 1) - { - _application = Application.NewApplication(); - } - else if (args.Length > 1) - { - _application = Application.NewApplication(args, _stylesheet, (Application.WindowMode)_windowMode); - } - _application.BatteryLow += OnBatteryLow; _application.LanguageChanged += OnLanguageChanged; _application.MemoryLow += OnMemoryLow; @@ -151,10 +121,10 @@ namespace Tizen.NUI } /// - /// The Region changed event callback function. + /// Region changed event callback function. /// - /// The application instance. - /// The event argument for RegionChanged. + /// Application instance + /// Event argument for RegionChanged private void OnRegionChanged(object source, NUIApplicationRegionChangedEventArgs e) { Log.Debug("NUI", "NUICorebackend OnRegionChanged Called"); @@ -164,10 +134,10 @@ namespace Tizen.NUI } /// - /// The Memory Low event callback function. + /// Memory Low event callback function. /// - /// The application instance. - /// The event argument for MemoryLow. + /// Application instance + /// Event argument for MemoryLow private void OnMemoryLow(object source, NUIApplicationMemoryLowEventArgs e) { Log.Debug("NUI", "NUICorebackend OnMemoryLow Called"); @@ -177,10 +147,10 @@ namespace Tizen.NUI } /// - /// The Language changed event callback function. + /// Language changed event callback function. /// - /// The application instance. - /// The event argument for LanguageChanged. + /// Application instance + /// Event argument for LanguageChanged private void OnLanguageChanged(object source, NUIApplicationLanguageChangedEventArgs e) { Log.Debug("NUI", "NUICorebackend OnLanguageChanged Called"); @@ -190,10 +160,10 @@ namespace Tizen.NUI } /// - /// The Battery Low event callback function. + /// Battery low event callback function. /// - /// The application instance. - /// The event argument for BatteryLow. + /// Application instance + /// Event argument for BatteryLow private void OnBatteryLow(object source, NUIApplicationBatteryLowEventArgs e) { Log.Debug("NUI", "NUICorebackend OnBatteryLow Called"); @@ -203,26 +173,22 @@ namespace Tizen.NUI } /// - /// The Initialized event callback function. + /// Initialized event callback function. /// - /// The application instance. - /// The event argument for Initialized. + /// Application instance + /// Event argument for Initialized private void OnInitialized(object source, NUIApplicationInitEventArgs e) { - Log.Debug("NUI", "NUICorebackend OnPreCreated Called"); - var preCreateHandler = Handlers[EventType.PreCreated] as Action; - preCreateHandler?.Invoke(); - - Log.Debug("NUI", "NUICorebackend OnCreate Called"); - var createHandler = Handlers[EventType.Created] as Action; - createHandler?.Invoke(); + Log.Debug("NUI", "NUICorebackend OnInitialized Called"); + var handler = Handlers[EventType.Created] as Action; + handler?.Invoke(); } /// - /// The Terminated event callback function. + /// Terminated event callback function. /// - /// The application instance. - /// The event argument for Terminated. + /// Application instance + /// Event argument for Terminated private void OnTerminated(object source, NUIApplicationTerminatingEventArgs e) { Log.Debug("NUI", "NUICorebackend OnTerminated Called"); @@ -231,10 +197,10 @@ namespace Tizen.NUI } /// - /// The Resumed event callback function. + /// Resumed event callback function. /// - /// The application instance. - /// The event argument for Resumed. + /// Application instance + /// Event argument for Resumed private void OnResumed(object source, NUIApplicationResumedEventArgs e) { Log.Debug("NUI", "NUICorebackend OnResumed Called"); @@ -243,23 +209,24 @@ namespace Tizen.NUI } /// - /// The App control event callback function. + /// App control event callback function. /// - /// The application instance. - /// The event argument for AppControl. + /// Application instance + /// Event argument for AppControl private void OnAppControl(object source, NUIApplicationAppControlEventArgs e) { Log.Debug("NUI", "NUICorebackend OnAppControl Called"); + /* can invoke after making new api which getting control handle at application. var handler = Handlers[EventType.AppControlReceived] as Action; - SafeAppControlHandle handle = new SafeAppControlHandle(e.VoidP,false); - handler?.Invoke( new AppControlReceivedEventArgs(new ReceivedAppControl(handle)) ); + handler?.Invoke(); + */ } /// - /// The Paused event callback function. + /// Paused event callback function. /// - /// The application instance. - /// The event argument for Paused. + /// Application instance + /// Event argument for Paused private void OnPaused(object source, NUIApplicationPausedEventArgs e) { Log.Debug("NUI", "NUICorebackend OnPaused Called"); @@ -267,14 +234,5 @@ namespace Tizen.NUI handler?.Invoke(); } - - internal Application ApplicationHandle - { - get - { - return _application; - } - } - } } diff --git a/src/Tizen.NUI/src/internal/NUIEventType.cs b/src/Tizen.NUI/src/internal/NUIEventType.cs index fc3d40c2c..66a40f7c6 100755 --- a/src/Tizen.NUI/src/internal/NUIEventType.cs +++ b/src/Tizen.NUI/src/internal/NUIEventType.cs @@ -19,22 +19,32 @@ using Tizen.Applications.CoreBackend; namespace Tizen.NUI { /// - /// This class represents the type of NUI event for backends. This class can be converted from string type. + /// Class that represents the type of NUI event for backends. This class can be converted from string type. /// public class NUIEventType : EventType { /// /// Initializes the EventType class. /// - /// The name of the event type. + /// The name of event type. public NUIEventType(string name) : base(name) { } /// - /// Pre-defined event type "Reset". + /// Pre-defined event type. "TimeTick" /// - public static readonly NUIEventType Reset = "Reset"; + public static readonly NUIEventType TimeTick = "TimeTick"; + + /// + /// Pre-defined event type. "AmbientTick" + /// + public static readonly NUIEventType AmbientTick = "AmbientTick"; + + /// + /// Pre-defined event type. "AmbientChanged" + /// + public static readonly NUIEventType AmbientChanged = "AmbientChanged"; /// /// Converts a string to NUIEventType instance. diff --git a/src/Tizen.NUI/src/internal/NUIWatchCoreBackend.cs b/src/Tizen.NUI/src/internal/NUIWatchCoreBackend.cs new file mode 100755 index 000000000..1a5c259c1 --- /dev/null +++ b/src/Tizen.NUI/src/internal/NUIWatchCoreBackend.cs @@ -0,0 +1,270 @@ +/* + * Copyright (c) 2017 Samsung Electronics Co., Ltd. + * + * 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.Collections.Generic; +using Tizen.Applications.CoreBackend; +using Tizen.Applications; + +namespace Tizen.NUI +{ + class NUIWatchCoreBackend : ICoreBackend + { + /// + /// Application instance to connect event. + /// + protected WatchApplication _application; + private string _stylesheet = ""; + + /// + /// Dictionary to contain each type of event callback. + /// + protected IDictionary Handlers = new Dictionary(); + + /// + /// The default Constructor. + /// + public NUIWatchCoreBackend() + { + } + + /// + /// The constructor with stylesheet. + /// + public NUIWatchCoreBackend(string stylesheet) + { + _stylesheet = stylesheet; + } + + /// + /// Add NUIApplication event to Application. + /// Put each type of event callback in Dictionary. + /// + /// Type of event + /// Event callback + public void AddEventHandler(EventType evType, Action handler) + { + Handlers.Add(evType, handler); + } + + /// + /// Add NUIApplication event to Application. + /// Put each type of event callback in Dictionary. + /// + /// Argument type for the event + /// Type of event + /// Event callback + public void AddEventHandler(EventType evType, Action handler) where TEventArgs : EventArgs + { + Handlers.Add(evType, handler); + } + + + /// + /// Dispose function. + /// + public void Dispose() + { + _application.Dispose(); + } + + /// + /// Exit Application. + /// + public void Exit() + { + _application.Quit(); + } + + /// + /// Run Application. + /// + /// Arguments from commandline. + public void Run(string[] args) + { + args[0] = Tizen.Applications.Application.Current.ApplicationInfo.ExecutablePath; + if (args.Length == 1) + { + _application = WatchApplication.NewWatchApplication(); + } + else if (args.Length > 1) + { + _application = WatchApplication.NewWatchApplication(args, _stylesheet); + } + + _application.BatteryLow += OnBatteryLow; + _application.LanguageChanged += OnLanguageChanged; + _application.MemoryLow += OnMemoryLow; + _application.RegionChanged += OnRegionChanged; + + _application.Initialized += OnInitialized; + _application.Resumed += OnResumed; + _application.Terminating += OnTerminated; + _application.Paused += OnPaused; + _application.AppControl += OnAppControl; + + _application.AmbientChanged += OnAmbientChanged; + _application.AmbientTick += OnAmbientTick; + _application.TimeTick += OnTimeTick; + + _application.MainLoop(); + } + + private void OnTimeTick(object source, WatchApplication.TimeTickEventArgs e) + { + Log.Debug("NUI", "NUIWatchCorebackend OnTimeTick Called"); + var handler = Handlers[NUIEventType.TimeTick] as Action; + handler?.Invoke(new NUIWatchApplication.TimeTickEventArgs(e.WatchTime)); + } + + private void OnAmbientTick(object source, WatchApplication.AmbientTickEventArgs e) + { + Log.Debug("NUI", "NUIWatchCorebackend OnAmbientTick Called"); + var handler = Handlers[NUIEventType.AmbientTick] as Action; + handler?.Invoke(new NUIWatchApplication.AmbientTickEventArgs(e.WatchTime)); + } + + private void OnAmbientChanged(object source, WatchApplication.AmbientChangedEventArgs e) + { + Log.Debug("NUI", "NUIWatchCorebackend OnAmbientChanged Called"); + var handler = Handlers[NUIEventType.AmbientChanged] as Action; + handler?.Invoke(new NUIWatchApplication.AmbientChangedEventArgs(e.Changed)); + } + + /// + /// Region changed event callback function. + /// + /// Application instance + /// Event argument for RegionChanged + private void OnRegionChanged(object source, NUIApplicationRegionChangedEventArgs e) + { + Log.Debug("NUI", "NUIWatchCorebackend OnRegionChanged Called"); + var handler = Handlers[EventType.RegionFormatChanged] as Action; + // Need to make new signal return in native to return right value. + handler?.Invoke( new RegionFormatChangedEventArgs("")); + } + + /// + /// Memory Low event callback function. + /// + /// Application instance + /// Event argument for MemoryLow + private void OnMemoryLow(object source, NUIApplicationMemoryLowEventArgs e) + { + Log.Debug("NUI", "NUIWatchCorebackend OnMemoryLow Called"); + var handler = Handlers[EventType.LowMemory] as Action; + // Need to make new signal return in native to return right value. + handler?.Invoke( new LowMemoryEventArgs(LowMemoryStatus.None)); + } + + /// + /// Language changed event callback function. + /// + /// Application instance + /// Event argument for LanguageChanged + private void OnLanguageChanged(object source, NUIApplicationLanguageChangedEventArgs e) + { + Log.Debug("NUI", "NUIWatchCorebackend OnLanguageChanged Called"); + var handler = Handlers[EventType.LocaleChanged] as Action; + // Need to make new signal return in native to return right value. + handler?.Invoke( new LocaleChangedEventArgs("")); + } + + /// + /// Battery low event callback function. + /// + /// Application instance + /// Event argument for BatteryLow + private void OnBatteryLow(object source, NUIApplicationBatteryLowEventArgs e) + { + Log.Debug("NUI", "NUIWatchCorebackend OnBatteryLow Called"); + var handler = Handlers[EventType.LowBattery] as Action; + // Need to make new signal return in native to return right value. + handler?.Invoke(new LowBatteryEventArgs(LowBatteryStatus.None)); + } + + /// + /// Initialized event callback function. + /// + /// Application instance + /// Event argument for Initialized + private void OnInitialized(object source, NUIApplicationInitEventArgs e) + { + Log.Debug("NUI", "NUIWatchCorebackend OnInitialized Called"); + var handler = Handlers[EventType.Created] as Action; + handler?.Invoke(); + } + + /// + /// Terminated event callback function. + /// + /// Application instance + /// Event argument for Terminated + private void OnTerminated(object source, NUIApplicationTerminatingEventArgs e) + { + Log.Debug("NUI", "NUIWatchCorebackend OnTerminated Called"); + var handler = Handlers[EventType.Terminated] as Action; + handler?.Invoke(); + } + + /// + /// Resumed event callback function. + /// + /// Application instance + /// Event argument for Resumed + private void OnResumed(object source, NUIApplicationResumedEventArgs e) + { + Log.Debug("NUI", "NUIWatchCorebackend OnResumed Called"); + var handler = Handlers[EventType.Resumed] as Action; + handler?.Invoke(); + } + + /// + /// App control event callback function. + /// + /// Application instance + /// Event argument for AppControl + private void OnAppControl(object source, NUIApplicationAppControlEventArgs e) + { + Log.Debug("NUI", "NUIWatchCorebackend OnAppControl Called"); + var handler = Handlers[EventType.AppControlReceived] as Action; + SafeAppControlHandle handle = new SafeAppControlHandle(e.VoidP, false); + handler?.Invoke(new AppControlReceivedEventArgs(new ReceivedAppControl(handle))); + } + + /// + /// Paused event callback function. + /// + /// Application instance + /// Event argument for Paused + private void OnPaused(object source, NUIApplicationPausedEventArgs e) + { + Log.Debug("NUI", "NUIWatchCorebackend OnPaused Called"); + var handler = Handlers[EventType.Paused] as Action; + handler?.Invoke(); + } + + internal WatchApplication WatchApplicationHandle + { + get + { + return _application; + } + } + + } +} diff --git a/src/Tizen.NUI/src/internal/NUIWidgetCoreBackend.cs b/src/Tizen.NUI/src/internal/NUIWidgetCoreBackend.cs deleted file mode 100755 index ec05e4319..000000000 --- a/src/Tizen.NUI/src/internal/NUIWidgetCoreBackend.cs +++ /dev/null @@ -1,208 +0,0 @@ -/* - * Copyright (c) 2017 Samsung Electronics Co., Ltd. - * - * 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.Collections.Generic; - -using Tizen.Applications.CoreBackend; -using Tizen.Applications; - -namespace Tizen.NUI -{ - class NUIWidgetCoreBackend : ICoreBackend - { - /// - /// Application instance to connect event. - /// - protected WidgetApplication _application; - private string _stylesheet = ""; - - /// - /// Dictionary to contain each type of event callback. - /// - protected IDictionary Handlers = new Dictionary(); - - /// - /// The default Constructor. - /// - public NUIWidgetCoreBackend() - { - //Tizen.Log.Fatal("NUI", "### NUIWidgetCoreBackend called"); - //_application = WidgetApplication.NewWidgetApplication(); - } - - /// - /// The constructor with stylesheet. - /// - public NUIWidgetCoreBackend(string stylesheet) - { - _stylesheet = stylesheet; - //_application = WidgetApplication.NewWidgetApplication(stylesheet); - } - - /// - /// Add NUIWidgetApplication event to Application. - /// Put each type of event callback in Dictionary. - /// - /// Type of event - /// Event callback - public void AddEventHandler(EventType evType, Action handler) - { - Handlers.Add(evType, handler); - } - - /// - /// Add NUIWidgetApplication event to Application. - /// Put each type of event callback in Dictionary. - /// - /// Argument type for the event - /// Type of event - /// Event callback - public void AddEventHandler(EventType evType, Action handler) where TEventArgs : EventArgs - { - Handlers.Add(evType, handler); - } - - - /// - /// Dispose function. - /// - public void Dispose() - { - Tizen.Log.Fatal("NUI", "### NUIWidgetCoreBackend Dispose called"); - if (_application != null) - { - _application.Dispose(); - } - } - - /// - /// Exit Application. - /// - public void Exit() - { - Tizen.Log.Fatal("NUI", "### NUIWidgetCoreBackend Exit called"); - if (_application != null) - { - _application.Quit(); - } - } - - /// - /// Run Application. - /// - /// Arguments from commandline. - public void Run(string[] args) - { - args[0] = Tizen.Applications.Application.Current.ApplicationInfo.ExecutablePath; - _application = WidgetApplication.NewWidgetApplication(args, _stylesheet); - - TizenSynchronizationContext.Initialize(); - _application.BatteryLow += OnBatteryLow; - _application.LanguageChanged += OnLanguageChanged; - _application.MemoryLow += OnMemoryLow; - _application.RegionChanged += OnRegionChanged; ; - - _application.Init += OnInit; - _application.Terminate += OnTerminate; - - _application.MainLoop(); - } - - private void OnInit(object sender, WidgetApplication.WidgetApplicationEventArgs e) - { - Log.Fatal("NUI", "NUIWidgetApplication OnPreCreated Called"); - var preCreateHandler = Handlers[EventType.PreCreated] as Action; - preCreateHandler?.Invoke(); - - Log.Fatal("NUI", "NUIWidgetApplication OnCreate Called"); - var createHandler = Handlers[EventType.Created] as Action; - createHandler?.Invoke(); - - } - - private void OnTerminate(object sender, WidgetApplication.WidgetApplicationEventArgs e) - { - Log.Fatal("NUI", "NUIWidgetApplication OnTerminated Called"); - var handler = Handlers[EventType.Terminated] as Action; - handler?.Invoke(); - } - - /// - /// Region changed event callback function. - /// - /// Application instance - /// Event argument for RegionChanged - private void OnRegionChanged(object sender, WidgetApplication.WidgetApplicationEventArgs e) - { - Log.Fatal("NUI", "NUIWidgetApplication OnRegionChanged Called"); - var handler = Handlers[EventType.RegionFormatChanged] as Action; - // Need to make new signal return in native to return right value. - handler?.Invoke(new RegionFormatChangedEventArgs("")); - } - - /// - /// Memory Low event callback function. - /// - /// Application instance - /// Event argument for MemoryLow - private void OnMemoryLow(object sender, WidgetApplication.WidgetApplicationEventArgs e) - { - Log.Fatal("NUI", "NUIWidgetApplication OnMemoryLow Called"); - var handler = Handlers[EventType.LowMemory] as Action; - // Need to make new signal return in native to return right value. - handler?.Invoke(new LowMemoryEventArgs(LowMemoryStatus.None)); - } - - /// - /// Language changed event callback function. - /// - /// Application instance - /// Event argument for LanguageChanged - private void OnLanguageChanged(object sender, WidgetApplication.WidgetApplicationEventArgs e) - { - - Log.Fatal("NUI", "NUIWidgetApplication OnLanguageChanged Called"); - var handler = Handlers[EventType.LocaleChanged] as Action; - // Need to make new signal return in native to return right value. - handler?.Invoke(new LocaleChangedEventArgs("")); - - } - - /// - /// Battery low event callback function. - /// - /// Application instance - /// Event argument for BatteryLow - private void OnBatteryLow(object sender, WidgetApplication.WidgetApplicationEventArgs e) - { - Log.Fatal("NUI", "NUIWidgetApplication OnBatteryLow Called"); - var handler = Handlers[EventType.LowBattery] as Action; - // Need to make new signal return in native to return right value. - handler?.Invoke(new LowBatteryEventArgs(LowBatteryStatus.None)); - - } - - internal WidgetApplication WidgetApplicationHandle - { - get - { - return _application; - } - } - } -} diff --git a/src/Tizen.NUI/src/internal/ObjectCreatedSignal.cs b/src/Tizen.NUI/src/internal/ObjectCreatedSignal.cs index f44303e20..0c0a18b9b 100755 --- a/src/Tizen.NUI/src/internal/ObjectCreatedSignal.cs +++ b/src/Tizen.NUI/src/internal/ObjectCreatedSignal.cs @@ -116,7 +116,7 @@ namespace Tizen.NUI public void Connect(System.Delegate func) { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); { NDalicPINVOKE.ObjectCreatedSignal_Connect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -125,7 +125,7 @@ namespace Tizen.NUI public void Disconnect(System.Delegate func) { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); { NDalicPINVOKE.ObjectCreatedSignal_Disconnect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); diff --git a/src/Tizen.NUI/src/internal/ObjectDestroyedSignal.cs b/src/Tizen.NUI/src/internal/ObjectDestroyedSignal.cs index 8bd462c63..de482c7d6 100755 --- a/src/Tizen.NUI/src/internal/ObjectDestroyedSignal.cs +++ b/src/Tizen.NUI/src/internal/ObjectDestroyedSignal.cs @@ -116,7 +116,7 @@ namespace Tizen.NUI public void Connect(System.Delegate func) { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); { NDalicPINVOKE.ObjectDestroyedSignal_Connect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -125,7 +125,7 @@ namespace Tizen.NUI public void Disconnect(System.Delegate func) { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); { NDalicPINVOKE.ObjectDestroyedSignal_Disconnect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); diff --git a/src/Tizen.NUI/src/internal/PagePanSignal.cs b/src/Tizen.NUI/src/internal/PagePanSignal.cs index a2b33842b..67de63198 100755 --- a/src/Tizen.NUI/src/internal/PagePanSignal.cs +++ b/src/Tizen.NUI/src/internal/PagePanSignal.cs @@ -115,7 +115,7 @@ namespace Tizen.NUI public void Connect(System.Delegate func) { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); { NDalicPINVOKE.PagePanSignal_Connect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -124,7 +124,7 @@ namespace Tizen.NUI public void Disconnect(System.Delegate func) { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); { NDalicPINVOKE.PagePanSignal_Disconnect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); diff --git a/src/Tizen.NUI/src/internal/PageTurnSignal.cs b/src/Tizen.NUI/src/internal/PageTurnSignal.cs index f172fcf4c..0ba7fbef3 100755 --- a/src/Tizen.NUI/src/internal/PageTurnSignal.cs +++ b/src/Tizen.NUI/src/internal/PageTurnSignal.cs @@ -115,7 +115,7 @@ namespace Tizen.NUI public void Connect(System.Delegate func) { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); { NDalicPINVOKE.PageTurnSignal_Connect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -124,7 +124,7 @@ namespace Tizen.NUI public void Disconnect(System.Delegate func) { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); { NDalicPINVOKE.PageTurnSignal_Disconnect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); diff --git a/src/Tizen.NUI/src/internal/PageTurnView.cs b/src/Tizen.NUI/src/internal/PageTurnView.cs index e9008f55d..9a2ebbe41 100755 --- a/src/Tizen.NUI/src/internal/PageTurnView.cs +++ b/src/Tizen.NUI/src/internal/PageTurnView.cs @@ -412,7 +412,7 @@ namespace Tizen.NUI } - public new class Property : global::System.IDisposable + public class Property : global::System.IDisposable { private global::System.Runtime.InteropServices.HandleRef swigCPtr; protected bool swigCMemOwn; diff --git a/src/Tizen.NUI/src/internal/PanGestureDetectedSignal.cs b/src/Tizen.NUI/src/internal/PanGestureDetectedSignal.cs index 224dbb77c..3f97cec62 100755 --- a/src/Tizen.NUI/src/internal/PanGestureDetectedSignal.cs +++ b/src/Tizen.NUI/src/internal/PanGestureDetectedSignal.cs @@ -116,7 +116,7 @@ namespace Tizen.NUI public void Connect(System.Delegate func) { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); { NDalicPINVOKE.PanGestureDetectedSignal_Connect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -125,7 +125,7 @@ namespace Tizen.NUI public void Disconnect(System.Delegate func) { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); { NDalicPINVOKE.PanGestureDetectedSignal_Disconnect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); diff --git a/src/Tizen.NUI/src/internal/PathConstrainer.cs b/src/Tizen.NUI/src/internal/PathConstrainer.cs index 077720ea4..98e2d9e05 100755 --- a/src/Tizen.NUI/src/internal/PathConstrainer.cs +++ b/src/Tizen.NUI/src/internal/PathConstrainer.cs @@ -164,7 +164,7 @@ namespace Tizen.NUI if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - public static PathConstrainer DownCast(BaseHandle handle) + public new static PathConstrainer DownCast(BaseHandle handle) { PathConstrainer ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as PathConstrainer; if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); diff --git a/src/Tizen.NUI/src/internal/PinchGestureDetectedSignal.cs b/src/Tizen.NUI/src/internal/PinchGestureDetectedSignal.cs index e8d7b3919..1d88dbf2d 100755 --- a/src/Tizen.NUI/src/internal/PinchGestureDetectedSignal.cs +++ b/src/Tizen.NUI/src/internal/PinchGestureDetectedSignal.cs @@ -115,7 +115,7 @@ namespace Tizen.NUI public void Connect(System.Delegate func) { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); { NDalicPINVOKE.PinchGestureDetectedSignal_Connect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -124,7 +124,7 @@ namespace Tizen.NUI public void Disconnect(System.Delegate func) { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); { NDalicPINVOKE.PinchGestureDetectedSignal_Disconnect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); diff --git a/src/Tizen.NUI/src/internal/PreFocusChangeSignal.cs b/src/Tizen.NUI/src/internal/PreFocusChangeSignal.cs index 0de7eafd9..78799a731 100755 --- a/src/Tizen.NUI/src/internal/PreFocusChangeSignal.cs +++ b/src/Tizen.NUI/src/internal/PreFocusChangeSignal.cs @@ -128,7 +128,7 @@ namespace Tizen.NUI public void Disconnect(System.Delegate func) { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); { NDalicManualPINVOKE.PreFocusChangeSignal_Disconnect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); diff --git a/src/Tizen.NUI/src/internal/ProgressBarValueChangedSignal.cs b/src/Tizen.NUI/src/internal/ProgressBarValueChangedSignal.cs index 1acb5441f..b1f5b6bea 100755 --- a/src/Tizen.NUI/src/internal/ProgressBarValueChangedSignal.cs +++ b/src/Tizen.NUI/src/internal/ProgressBarValueChangedSignal.cs @@ -116,7 +116,7 @@ namespace Tizen.NUI public void Connect(System.Delegate func) { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); { NDalicPINVOKE.ProgressBarValueChangedSignal_Connect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -125,7 +125,7 @@ namespace Tizen.NUI public void Disconnect(System.Delegate func) { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); { NDalicPINVOKE.ProgressBarValueChangedSignal_Disconnect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); diff --git a/src/Tizen.NUI/src/internal/PropertyHelper.cs b/src/Tizen.NUI/src/internal/PropertyHelper.cs index 61fc04ca1..e2b631127 100755 --- a/src/Tizen.NUI/src/internal/PropertyHelper.cs +++ b/src/Tizen.NUI/src/internal/PropertyHelper.cs @@ -16,8 +16,6 @@ namespace Tizen.NUI { - using System.Text; - internal static class PropertyHelper { /// @@ -26,9 +24,9 @@ namespace Tizen.NUI internal static Property GetPropertyFromString(Animatable handle, string stringProperty) { /// Convert property string to be lowercase - StringBuilder sb = new StringBuilder(stringProperty); - sb[0] = (char)(sb[0] | 0x20); - string str = sb.ToString(); + string str1 = stringProperty.Substring(0, 1); + string str2 = stringProperty.Substring(1); + string str = str1.ToLower() + str2; Property property = new Property(handle, str); if (property.propertyIndex == Property.INVALID_INDEX) diff --git a/src/Tizen.NUI/src/internal/PropertyRangeManager.cs b/src/Tizen.NUI/src/internal/PropertyRangeManager.cs index 7216b8efc..c875ef94a 100755 --- a/src/Tizen.NUI/src/internal/PropertyRangeManager.cs +++ b/src/Tizen.NUI/src/internal/PropertyRangeManager.cs @@ -9,7 +9,7 @@ using Tizen.NUI.BaseComponents; namespace Tizen.NUI { /// - /// The helper class for calculating what property indexes should be assigned to the C# View (view) classes. + /// Helper class for calculating what property indexes should be assigned to C# View (view) classes. /// internal class PropertyRangeManager { @@ -24,7 +24,7 @@ namespace Tizen.NUI } /// - /// Only called if a view has scriptable properties. + /// Only called if a View has scriptable properties /// private PropertyRange RegisterView(string viewName, System.Type viewType) { @@ -50,11 +50,11 @@ namespace Tizen.NUI /// /// Gets the index of the property. - /// Each property has to have unique index for this view type. + /// Each property has to have unique index for this view type /// /// The property index. - /// The view name. - /// The view type. + /// View name + /// View type /// Type. public int GetPropertyIndex(string viewName, System.Type viewType, ScriptableProperty.ScriptableType type) { @@ -77,7 +77,7 @@ namespace Tizen.NUI } /// - /// We calculate the start property indices, based on the type and it's class hierarchy, for example, DateView (70,000)- > Spin (60,000) -> View (50,000). + /// We calculate the start property indices, based on the type and it's class heirachy, e.g. DateView (70,000)- > Spin (60,000) -> View (50,000) /// private void GetPropertyStartRange(System.Type viewType, ref PropertyRange range) { diff --git a/src/Tizen.NUI/src/internal/Registry.cs b/src/Tizen.NUI/src/internal/Registry.cs index d9e0ee041..cf91e4e38 100755 --- a/src/Tizen.NUI/src/internal/Registry.cs +++ b/src/Tizen.NUI/src/internal/Registry.cs @@ -14,12 +14,12 @@ namespace Tizen.NUI internal sealed class Registry { /// - /// The registry is a singleton. + /// Registry is a singleton /// private static Registry instance = null; /// - /// Given a C++ object, the dictionary allows us to find which C# object it belongs to. + /// Given a C++ object the dictionary allows us to find which C# object it belongs to. /// By keeping the weak reference only, it will allow the object to be garbage collected. /// private Dictionary _controlMap; @@ -31,9 +31,9 @@ namespace Tizen.NUI /// - /// Stores the mapping between this instance of BaseHandle (C# base class) and native part. + /// Store the mapping between this instance of BaseHandle (C# base class) and native part. /// - /// The instance of BaseHandle (C# base class). + /// The instance of BaseHandle (C# base class) internal static void Register(BaseHandle baseHandle) { // We store a pointer to the RefObject for the control @@ -51,9 +51,9 @@ namespace Tizen.NUI } /// - /// Removes this instance of BaseHandle (C# base class) and native part from the mapping table. + /// Remove the this instance of BaseHandle (C# base class) and native part from the mapping table. /// - /// The instance of BaseHandle (C# base class) + /// The instance of BaseHandle (C# base class) internal static void Unregister(BaseHandle baseHandle) { RefObject refObj = baseHandle.GetObjectPtr(); diff --git a/src/Tizen.NUI/src/internal/RenderTask.cs b/src/Tizen.NUI/src/internal/RenderTask.cs index f7e3e83e6..babb0ed96 100755 --- a/src/Tizen.NUI/src/internal/RenderTask.cs +++ b/src/Tizen.NUI/src/internal/RenderTask.cs @@ -254,7 +254,7 @@ namespace Tizen.NUI if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - public static RenderTask DownCast(BaseHandle handle) + public new static RenderTask DownCast(BaseHandle handle) { RenderTask ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as RenderTask; if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); diff --git a/src/Tizen.NUI/src/internal/ResizedSignal.cs b/src/Tizen.NUI/src/internal/ResizedSignal.cs index c6e48c22d..cc69abf38 100755 --- a/src/Tizen.NUI/src/internal/ResizedSignal.cs +++ b/src/Tizen.NUI/src/internal/ResizedSignal.cs @@ -114,7 +114,7 @@ namespace Tizen.NUI public void Connect(System.Delegate func) { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); { NDalicManualPINVOKE.ResizedSignal_Connect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -123,7 +123,7 @@ namespace Tizen.NUI public void Disconnect(System.Delegate func) { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); { NDalicManualPINVOKE.ResizedSignal_Disconnect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); diff --git a/src/Tizen.NUI/src/internal/Ruler.cs b/src/Tizen.NUI/src/internal/Ruler.cs index 61080fe3c..ce8e8e750 100755 --- a/src/Tizen.NUI/src/internal/Ruler.cs +++ b/src/Tizen.NUI/src/internal/Ruler.cs @@ -98,7 +98,7 @@ namespace Tizen.NUI return ret; } - public new Ruler.RulerType GetType() + public Ruler.RulerType GetType() { Ruler.RulerType ret = (Ruler.RulerType)NDalicPINVOKE.Ruler_GetType(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); diff --git a/src/Tizen.NUI/src/internal/RulerPtr.cs b/src/Tizen.NUI/src/internal/RulerPtr.cs index cd2de6a0b..548642e8b 100755 --- a/src/Tizen.NUI/src/internal/RulerPtr.cs +++ b/src/Tizen.NUI/src/internal/RulerPtr.cs @@ -207,7 +207,7 @@ namespace Tizen.NUI return ret; } - public new Ruler.RulerType GetType() + public Ruler.RulerType GetType() { Ruler.RulerType ret = (Ruler.RulerType)NDalicPINVOKE.RulerPtr_GetType(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); diff --git a/src/Tizen.NUI/src/internal/SWIGTYPE_p_CallbackBase.cs b/src/Tizen.NUI/src/internal/SWIGTYPE_p_CallbackBase.cs index 94137391c..0191095a3 100755 --- a/src/Tizen.NUI/src/internal/SWIGTYPE_p_CallbackBase.cs +++ b/src/Tizen.NUI/src/internal/SWIGTYPE_p_CallbackBase.cs @@ -7,13 +7,11 @@ // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. //------------------------------------------------------------------------------ -using System; -using System.Runtime.InteropServices; namespace Tizen.NUI { - [Obsolete("Please do not use! this will be internal")] - public class SWIGTYPE_p_CallbackBase + + internal class SWIGTYPE_p_CallbackBase { private global::System.Runtime.InteropServices.HandleRef swigCPtr; diff --git a/src/Tizen.NUI/src/internal/SWIGTYPE_p_Dali__CallbackBase.cs b/src/Tizen.NUI/src/internal/SWIGTYPE_p_Dali__CallbackBase.cs index 003069725..22ff2b978 100755 --- a/src/Tizen.NUI/src/internal/SWIGTYPE_p_Dali__CallbackBase.cs +++ b/src/Tizen.NUI/src/internal/SWIGTYPE_p_Dali__CallbackBase.cs @@ -7,13 +7,11 @@ // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. //------------------------------------------------------------------------------ -using System; -using System.Runtime.InteropServices; namespace Tizen.NUI { - [Obsolete("Please do not use! this will be internal")] - public class SWIGTYPE_p_Dali__CallbackBase + + internal class SWIGTYPE_p_Dali__CallbackBase { private global::System.Runtime.InteropServices.HandleRef swigCPtr; diff --git a/src/Tizen.NUI/src/internal/SWIGTYPE_p_Dali__FunctorDelegate.cs b/src/Tizen.NUI/src/internal/SWIGTYPE_p_Dali__FunctorDelegate.cs index 33d505aa3..1e123d8db 100755 --- a/src/Tizen.NUI/src/internal/SWIGTYPE_p_Dali__FunctorDelegate.cs +++ b/src/Tizen.NUI/src/internal/SWIGTYPE_p_Dali__FunctorDelegate.cs @@ -7,13 +7,11 @@ // Do not make changes to this file unless you know what you are doing--modify // the SWIG interface file instead. //------------------------------------------------------------------------------ -using System; -using System.Runtime.InteropServices; namespace Tizen.NUI { - [Obsolete("Please do not use! this will be internal")] - public class SWIGTYPE_p_Dali__FunctorDelegate + + internal class SWIGTYPE_p_Dali__FunctorDelegate { private global::System.Runtime.InteropServices.HandleRef swigCPtr; diff --git a/src/Tizen.NUI/src/internal/SWIGTYPE_p_Dali__RenderSurface.cs b/src/Tizen.NUI/src/internal/SWIGTYPE_p_Dali__RenderSurface.cs deleted file mode 100755 index 869309830..000000000 --- a/src/Tizen.NUI/src/internal/SWIGTYPE_p_Dali__RenderSurface.cs +++ /dev/null @@ -1,40 +0,0 @@ -/** Copyright (c) 2017 Samsung Electronics Co., Ltd. -* -* 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. -* -*/ - -namespace Tizen.NUI -{ - - internal class SWIGTYPE_p_Dali__RenderSurface - { - private global::System.Runtime.InteropServices.HandleRef swigCPtr; - - internal SWIGTYPE_p_Dali__RenderSurface(global::System.IntPtr cPtr, bool futureUse) - { - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - } - - protected SWIGTYPE_p_Dali__RenderSurface() - { - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - } - - internal static global::System.Runtime.InteropServices.HandleRef getCPtr(SWIGTYPE_p_Dali__RenderSurface obj) - { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; - } - } - -} diff --git a/src/Tizen.NUI/src/internal/SWIGTYPE_p_bundle.cs b/src/Tizen.NUI/src/internal/SWIGTYPE_p_bundle.cs deleted file mode 100755 index 2c1c4d0f2..000000000 --- a/src/Tizen.NUI/src/internal/SWIGTYPE_p_bundle.cs +++ /dev/null @@ -1,40 +0,0 @@ -/** Copyright (c) 2017 Samsung Electronics Co., Ltd. -* -* 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. -* -*/ - -namespace Tizen.NUI -{ - - public class SWIGTYPE_p_bundle - { - private global::System.Runtime.InteropServices.HandleRef swigCPtr; - - internal SWIGTYPE_p_bundle(global::System.IntPtr cPtr, bool futureUse) - { - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - } - - protected SWIGTYPE_p_bundle() - { - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - } - - internal static global::System.Runtime.InteropServices.HandleRef getCPtr(SWIGTYPE_p_bundle obj) - { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; - } - } - -} diff --git a/src/Tizen.NUI/src/internal/SWIGTYPE_p_f_p_Dali__BaseObject_p_Dali__ConnectionTrackerInterface.cs b/src/Tizen.NUI/src/internal/SWIGTYPE_p_f_p_Dali__BaseObject_p_Dali__ConnectionTrackerInterface.cs deleted file mode 100755 index cce5fc9bb..000000000 --- a/src/Tizen.NUI/src/internal/SWIGTYPE_p_f_p_Dali__BaseObject_p_Dali__ConnectionTrackerInterface.cs +++ /dev/null @@ -1,34 +0,0 @@ -//------------------------------------------------------------------------------ -// -// -// This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.9 -// -// Do not make changes to this file unless you know what you are doing--modify -// the SWIG interface file instead. -//------------------------------------------------------------------------------ - -namespace Tizen.NUI -{ - - internal class SWIGTYPE_p_f_p_Dali__BaseObject_p_Dali__ConnectionTrackerInterface_r_q_const__std__string_p_Dali__FunctorDelegate__bool - { - private global::System.Runtime.InteropServices.HandleRef swigCPtr; - - internal SWIGTYPE_p_f_p_Dali__BaseObject_p_Dali__ConnectionTrackerInterface_r_q_const__std__string_p_Dali__FunctorDelegate__bool(global::System.IntPtr cPtr, bool futureUse) - { - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - } - - protected SWIGTYPE_p_f_p_Dali__BaseObject_p_Dali__ConnectionTrackerInterface_r_q_const__std__string_p_Dali__FunctorDelegate__bool() - { - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - } - - internal static global::System.Runtime.InteropServices.HandleRef getCPtr(SWIGTYPE_p_f_p_Dali__BaseObject_p_Dali__ConnectionTrackerInterface_r_q_const__std__string_p_Dali__FunctorDelegate__bool obj) - { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; - } - } - -} diff --git a/src/Tizen.NUI/src/internal/SWIGTYPE_p_f_p_Dali__BaseObject_p_Dali__ConnectionTrackerInterface_r_q_const__std__string_p_Dali__FunctorDelegate__bool.cs b/src/Tizen.NUI/src/internal/SWIGTYPE_p_f_p_Dali__BaseObject_p_Dali__ConnectionTrackerInterface_r_q_const__std__string_p_Dali__FunctorDelegate__bool.cs new file mode 100755 index 000000000..cce5fc9bb --- /dev/null +++ b/src/Tizen.NUI/src/internal/SWIGTYPE_p_f_p_Dali__BaseObject_p_Dali__ConnectionTrackerInterface_r_q_const__std__string_p_Dali__FunctorDelegate__bool.cs @@ -0,0 +1,34 @@ +//------------------------------------------------------------------------------ +// +// +// This file was automatically generated by SWIG (http://www.swig.org). +// Version 3.0.9 +// +// Do not make changes to this file unless you know what you are doing--modify +// the SWIG interface file instead. +//------------------------------------------------------------------------------ + +namespace Tizen.NUI +{ + + internal class SWIGTYPE_p_f_p_Dali__BaseObject_p_Dali__ConnectionTrackerInterface_r_q_const__std__string_p_Dali__FunctorDelegate__bool + { + private global::System.Runtime.InteropServices.HandleRef swigCPtr; + + internal SWIGTYPE_p_f_p_Dali__BaseObject_p_Dali__ConnectionTrackerInterface_r_q_const__std__string_p_Dali__FunctorDelegate__bool(global::System.IntPtr cPtr, bool futureUse) + { + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); + } + + protected SWIGTYPE_p_f_p_Dali__BaseObject_p_Dali__ConnectionTrackerInterface_r_q_const__std__string_p_Dali__FunctorDelegate__bool() + { + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + } + + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(SWIGTYPE_p_f_p_Dali__BaseObject_p_Dali__ConnectionTrackerInterface_r_q_const__std__string_p_Dali__FunctorDelegate__bool obj) + { + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; + } + } + +} diff --git a/src/Tizen.NUI/src/internal/SWIGTYPE_p_time_t.cs b/src/Tizen.NUI/src/internal/SWIGTYPE_p_time_t.cs new file mode 100755 index 000000000..e97c48d00 --- /dev/null +++ b/src/Tizen.NUI/src/internal/SWIGTYPE_p_time_t.cs @@ -0,0 +1,39 @@ +/** Copyright (c) 2017 Samsung Electronics Co., Ltd. +* +* 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. +* +*/ +namespace Tizen.NUI +{ + + public class SWIGTYPE_p_time_t + { + private global::System.Runtime.InteropServices.HandleRef swigCPtr; + + internal SWIGTYPE_p_time_t(global::System.IntPtr cPtr, bool futureUse) + { + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); + } + + protected SWIGTYPE_p_time_t() + { + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + } + + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(SWIGTYPE_p_time_t obj) + { + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; + } + } + +} diff --git a/src/Tizen.NUI/src/internal/SWIGTYPE_p_tm.cs b/src/Tizen.NUI/src/internal/SWIGTYPE_p_tm.cs new file mode 100755 index 000000000..b36f4a99e --- /dev/null +++ b/src/Tizen.NUI/src/internal/SWIGTYPE_p_tm.cs @@ -0,0 +1,39 @@ +/** Copyright (c) 2017 Samsung Electronics Co., Ltd. +* +* 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. +* +*/ +namespace Tizen.NUI +{ + + public class SWIGTYPE_p_tm + { + private global::System.Runtime.InteropServices.HandleRef swigCPtr; + + internal SWIGTYPE_p_tm(global::System.IntPtr cPtr, bool futureUse) + { + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); + } + + protected SWIGTYPE_p_tm() + { + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + } + + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(SWIGTYPE_p_tm obj) + { + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; + } + } + +} diff --git a/src/Tizen.NUI/src/internal/ScrollStateChangedSignal.cs b/src/Tizen.NUI/src/internal/ScrollStateChangedSignal.cs index acb32c979..d24bc8504 100755 --- a/src/Tizen.NUI/src/internal/ScrollStateChangedSignal.cs +++ b/src/Tizen.NUI/src/internal/ScrollStateChangedSignal.cs @@ -117,7 +117,7 @@ namespace Tizen.NUI public void Connect(System.Delegate func) { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); { NDalicManualPINVOKE.ScrollStateChangedSignal_Connect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -126,7 +126,7 @@ namespace Tizen.NUI public void Disconnect(System.Delegate func) { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); { NDalicManualPINVOKE.ScrollStateChangedSignal_Disconnect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); diff --git a/src/Tizen.NUI/src/internal/ScrollViewSnapStartedSignal.cs b/src/Tizen.NUI/src/internal/ScrollViewSnapStartedSignal.cs index c0351ad8f..26b4f0ae7 100755 --- a/src/Tizen.NUI/src/internal/ScrollViewSnapStartedSignal.cs +++ b/src/Tizen.NUI/src/internal/ScrollViewSnapStartedSignal.cs @@ -115,7 +115,7 @@ namespace Tizen.NUI public void Connect(System.Delegate func) { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); { NDalicPINVOKE.ScrollViewSnapStartedSignal_Connect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -124,7 +124,7 @@ namespace Tizen.NUI public void Disconnect(System.Delegate func) { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); { NDalicPINVOKE.ScrollViewSnapStartedSignal_Disconnect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); diff --git a/src/Tizen.NUI/src/internal/ScrollableSignal.cs b/src/Tizen.NUI/src/internal/ScrollableSignal.cs index c745236b4..06b3bbcb0 100755 --- a/src/Tizen.NUI/src/internal/ScrollableSignal.cs +++ b/src/Tizen.NUI/src/internal/ScrollableSignal.cs @@ -115,7 +115,7 @@ namespace Tizen.NUI public void Connect(System.Delegate func) { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); { NDalicPINVOKE.ScrollableSignal_Connect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -124,7 +124,7 @@ namespace Tizen.NUI public void Disconnect(System.Delegate func) { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); { NDalicPINVOKE.ScrollableSignal_Disconnect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); diff --git a/src/Tizen.NUI/src/internal/SignalObserver.cs b/src/Tizen.NUI/src/internal/SignalObserver.cs index 2e98240ff..d1916fdde 100755 --- a/src/Tizen.NUI/src/internal/SignalObserver.cs +++ b/src/Tizen.NUI/src/internal/SignalObserver.cs @@ -13,13 +13,11 @@ * limitations under the License. * */ -using System; -using System.Runtime.InteropServices; namespace Tizen.NUI { - [Obsolete("Please do not use! this will be internal")] - public class SignalObserver : global::System.IDisposable + + internal class SignalObserver : global::System.IDisposable { private global::System.Runtime.InteropServices.HandleRef swigCPtr; protected bool swigCMemOwn; diff --git a/src/Tizen.NUI/src/internal/Size.cs b/src/Tizen.NUI/src/internal/Size.cs index 9b66384bf..4cb6c0e09 100755 --- a/src/Tizen.NUI/src/internal/Size.cs +++ b/src/Tizen.NUI/src/internal/Size.cs @@ -43,7 +43,7 @@ namespace Tizen.NUI protected bool disposed = false; /// - /// Dispose. + /// Dispose /// ~Size() { @@ -106,86 +106,86 @@ namespace Tizen.NUI } /// - /// The addition operator for A+B. + /// Addition operator for A+B /// - /// Size to assign A. - /// Size to assign B. - /// A size containing the result of the addition. + /// Size, A + /// Size to assign, B + /// A Size containing the result of the addition public static Size operator +(Size arg1, Size arg2) { return arg1.Add(arg2); } /// - /// The subtraction operator for A-B. + /// Subtraction operator for A-B /// - /// Size to subtract A. - /// Size to subtract B. - /// The size containing the result of the subtraction. + /// Size, A + /// Size to subtract, B + /// A Size containing the result of the subtraction public static Size operator -(Size arg1, Size arg2) { return arg1.Subtract(arg2); } /// - /// The unary negation operator. + /// Unary negation operator. /// - /// Size for unary negation. - /// A size containing the negation. + /// Size for unary negation + /// A Size containg the negation public static Size operator -(Size arg1) { return arg1.Subtract(); } /// - /// The multiplication operator. + /// Multiplication operator. /// - /// Size for multiplication. - /// The size to multiply. - /// A size containing the result of the multiplication. + /// Size for multiplication + /// The Size to multipl + /// A Size containing the result of the multiplication public static Size operator *(Size arg1, Size arg2) { return arg1.Multiply(arg2); } /// - /// The multiplication operator. + /// Multiplication operator. /// - /// Size for multiplication. - /// The float value to scale the size. - /// A size containing the result of the scaling. + /// Size for multiplication + /// The float value to scale the Size + /// A Size containing the result of the scaling public static Size operator *(Size arg1, float arg2) { return arg1.Multiply(arg2); } /// - /// The division operator. + /// Division operator. /// - /// Size for division. - /// The size to divide. - /// A size containing the result of the division. + /// Size for division + /// The Size to divide + /// A Size containing the result of the division> public static Size operator /(Size arg1, Size arg2) { return arg1.Divide(arg2); } /// - /// The division operator. + /// Division operator. /// - /// Size for division. - /// The float value to scale the size by. - /// A Size containing the result of the scaling. + /// Size for division + /// The float value to scale the Size by + /// A Size containing the result of the scaling public static Size operator /(Size arg1, float arg2) { return arg1.Divide(arg2); } /// - /// The array subscript operator. + /// Array subscript operator. /// - /// Subscript index. - /// The float at the given index. + /// Subscript index + /// The float at the given index public float this[uint index] { get @@ -202,7 +202,7 @@ namespace Tizen.NUI } /// - /// The constructor. + /// Constructor. /// public Size() : this(NDalicPINVOKE.new_Vector3__SWIG_0(), true) { @@ -210,27 +210,27 @@ namespace Tizen.NUI } /// - /// The constructor. + /// Constructor. /// - /// The x (or width) component. - /// The y (or height) component. - /// The z (or depth) component. + /// x (or width) component + /// y (or height) component + /// z (or depth) component public Size(float x, float y, float z) : this(NDalicPINVOKE.new_Vector3__SWIG_1(x, y, z), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } /// - /// The constructor. + /// Constructor. /// - /// Size2D with x (width) and y (height). + /// Size2D with x (width) and y (height) public Size(Size2D size2d) : this(NDalicPINVOKE.new_Vector3__SWIG_3(Size2D.getCPtr(size2d)), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } /// - /// The Zero constant, (0.0f, 0.0f, 0.0f). + /// Zero constant, (0.0f, 0.0f, 0.0f). /// public static Size Zero { @@ -300,11 +300,11 @@ namespace Tizen.NUI } /// - /// Checks equality.
+ /// Check equality.
/// Utilizes appropriate machine epsilon values.
///
- /// The size to test against. - /// True if the sizes are equal. + /// The Size to test against + /// True if the Sizes are equal public bool EqualTo(Size rhs) { bool ret = NDalicPINVOKE.Vector3_EqualTo(swigCPtr, Size.getCPtr(rhs)); @@ -313,11 +313,11 @@ namespace Tizen.NUI } /// - /// Checks inequality.
+ /// Check inequality.
/// Utilizes appropriate machine epsilon values.
///
- /// The size to test against. - /// True if the sizes are not equal. + /// The Size to test against + /// True if the Sizes are not equal public bool NotEqualTo(Size rhs) { bool ret = NDalicPINVOKE.Vector3_NotEqualTo(swigCPtr, Size.getCPtr(rhs)); @@ -326,7 +326,7 @@ namespace Tizen.NUI } /// - /// The Width property for the width component of size + /// Width property for width component of Siz /// public float Width { @@ -344,7 +344,7 @@ namespace Tizen.NUI } /// - /// The Height property for the height component of size. + /// Height property for height component of Size /// public float Height { @@ -362,7 +362,7 @@ namespace Tizen.NUI } /// - /// The Depth property for the depth component of size. + /// Depth property for depth component of Size /// public float Depth { @@ -380,18 +380,18 @@ namespace Tizen.NUI } /// - /// The type cast operator, Size to Vector3. + /// Type cast operator, Size to Vector3. /// - /// The object of size type. + /// Object of Size type public static implicit operator Vector3(Size size) { return new Vector3(size.Width, size.Height, size.Depth); } /// - /// The type cast operator, Vector3 to Size type. + /// Type cast operator, Vector3 to Size type. /// - /// The object of Vector3 type. + /// Object of Vector3 type public static implicit operator Size(Vector3 vec) { return new Size(vec.Width, vec.Height, vec.Depth); diff --git a/src/Tizen.NUI/src/internal/SliderMarkReachedSignal.cs b/src/Tizen.NUI/src/internal/SliderMarkReachedSignal.cs index af5a122d5..117194677 100755 --- a/src/Tizen.NUI/src/internal/SliderMarkReachedSignal.cs +++ b/src/Tizen.NUI/src/internal/SliderMarkReachedSignal.cs @@ -116,7 +116,7 @@ namespace Tizen.NUI public void Connect(System.Delegate func) { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); { NDalicPINVOKE.SliderMarkReachedSignal_Connect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -125,7 +125,7 @@ namespace Tizen.NUI public void Disconnect(System.Delegate func) { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); { NDalicPINVOKE.SliderMarkReachedSignal_Disconnect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); diff --git a/src/Tizen.NUI/src/internal/SliderValueChangedSignal.cs b/src/Tizen.NUI/src/internal/SliderValueChangedSignal.cs index b286019b2..3678c78ba 100755 --- a/src/Tizen.NUI/src/internal/SliderValueChangedSignal.cs +++ b/src/Tizen.NUI/src/internal/SliderValueChangedSignal.cs @@ -115,7 +115,7 @@ namespace Tizen.NUI public void Connect(System.Delegate func) { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); { NDalicPINVOKE.SliderValueChangedSignal_Connect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -124,7 +124,7 @@ namespace Tizen.NUI public void Disconnect(System.Delegate func) { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); { NDalicPINVOKE.SliderValueChangedSignal_Disconnect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); diff --git a/src/Tizen.NUI/src/internal/SlotObserver.cs b/src/Tizen.NUI/src/internal/SlotObserver.cs index 9b034fec9..2c55bff03 100755 --- a/src/Tizen.NUI/src/internal/SlotObserver.cs +++ b/src/Tizen.NUI/src/internal/SlotObserver.cs @@ -13,13 +13,11 @@ * limitations under the License. * */ -using System; -using System.Runtime.InteropServices; namespace Tizen.NUI { - [Obsolete("Please do not use! this will be internal")] - public class SlotObserver : global::System.IDisposable + + internal class SlotObserver : global::System.IDisposable { private global::System.Runtime.InteropServices.HandleRef swigCPtr; protected bool swigCMemOwn; diff --git a/src/Tizen.NUI/src/internal/StageWheelSignal.cs b/src/Tizen.NUI/src/internal/StageWheelSignal.cs index 62dec7319..2ac99519b 100755 --- a/src/Tizen.NUI/src/internal/StageWheelSignal.cs +++ b/src/Tizen.NUI/src/internal/StageWheelSignal.cs @@ -116,7 +116,7 @@ namespace Tizen.NUI public void Connect(System.Delegate func) { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); { NDalicPINVOKE.StageWheelSignal_Connect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -125,7 +125,7 @@ namespace Tizen.NUI public void Disconnect(System.Delegate func) { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); { NDalicPINVOKE.StageWheelSignal_Disconnect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); diff --git a/src/Tizen.NUI/src/internal/StateChangedSignalType.cs b/src/Tizen.NUI/src/internal/StateChangedSignalType.cs index 55263f52c..7f0555ecb 100755 --- a/src/Tizen.NUI/src/internal/StateChangedSignalType.cs +++ b/src/Tizen.NUI/src/internal/StateChangedSignalType.cs @@ -112,7 +112,7 @@ namespace Tizen.NUI public void Connect(System.Delegate func) { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); { NDalicManualPINVOKE.StateChangedSignalType_Connect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -121,7 +121,7 @@ namespace Tizen.NUI public void Disconnect(System.Delegate func) { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); { NDalicManualPINVOKE.StateChangedSignalType_Disconnect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); diff --git a/src/Tizen.NUI/src/internal/StatusSignalType.cs b/src/Tizen.NUI/src/internal/StatusSignalType.cs index 6e2dd515b..4c9de843c 100755 --- a/src/Tizen.NUI/src/internal/StatusSignalType.cs +++ b/src/Tizen.NUI/src/internal/StatusSignalType.cs @@ -13,13 +13,11 @@ * limitations under the License. * */ -using System; -using System.Runtime.InteropServices; namespace Tizen.NUI { - [Obsolete("Please do not use! this will be deprecated")] - public class StatusSignalType : global::System.IDisposable + + internal class StatusSignalType : global::System.IDisposable { private global::System.Runtime.InteropServices.HandleRef swigCPtr; protected bool swigCMemOwn; @@ -116,7 +114,7 @@ namespace Tizen.NUI public void Connect(System.Delegate func) { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); { NDalicManualPINVOKE.StatusSignalType_Connect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -125,7 +123,7 @@ namespace Tizen.NUI public void Disconnect(System.Delegate func) { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); { NDalicManualPINVOKE.StatusSignalType_Disconnect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); diff --git a/src/Tizen.NUI/src/internal/StyleChangedSignal.cs b/src/Tizen.NUI/src/internal/StyleChangedSignal.cs index a8d893965..93b4b80a1 100755 --- a/src/Tizen.NUI/src/internal/StyleChangedSignal.cs +++ b/src/Tizen.NUI/src/internal/StyleChangedSignal.cs @@ -115,7 +115,7 @@ namespace Tizen.NUI public void Connect(System.Delegate func) { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); { NDalicPINVOKE.StyleChangedSignal_Connect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -124,7 +124,7 @@ namespace Tizen.NUI public void Disconnect(System.Delegate func) { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); { NDalicPINVOKE.StyleChangedSignal_Disconnect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); diff --git a/src/Tizen.NUI/src/internal/TapGestureDetectedSignal.cs b/src/Tizen.NUI/src/internal/TapGestureDetectedSignal.cs index 672be8fc9..6c5f8ca0d 100755 --- a/src/Tizen.NUI/src/internal/TapGestureDetectedSignal.cs +++ b/src/Tizen.NUI/src/internal/TapGestureDetectedSignal.cs @@ -115,7 +115,7 @@ namespace Tizen.NUI public void Connect(System.Delegate func) { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); { NDalicPINVOKE.TapGestureDetectedSignal_Connect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -124,7 +124,7 @@ namespace Tizen.NUI public void Disconnect(System.Delegate func) { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); { NDalicPINVOKE.TapGestureDetectedSignal_Disconnect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); diff --git a/src/Tizen.NUI/src/internal/TextEditorSignal.cs b/src/Tizen.NUI/src/internal/TextEditorSignal.cs index 62554f671..f2e9c0dfd 100755 --- a/src/Tizen.NUI/src/internal/TextEditorSignal.cs +++ b/src/Tizen.NUI/src/internal/TextEditorSignal.cs @@ -118,7 +118,7 @@ namespace Tizen.NUI public void Connect(System.Delegate func) { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); { NDalicPINVOKE.TextEditorSignal_Connect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -127,7 +127,7 @@ namespace Tizen.NUI public void Disconnect(System.Delegate func) { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); { NDalicPINVOKE.TextEditorSignal_Disconnect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); diff --git a/src/Tizen.NUI/src/internal/TextFieldSignal.cs b/src/Tizen.NUI/src/internal/TextFieldSignal.cs index 3afb059ca..51eae91cf 100755 --- a/src/Tizen.NUI/src/internal/TextFieldSignal.cs +++ b/src/Tizen.NUI/src/internal/TextFieldSignal.cs @@ -118,7 +118,7 @@ namespace Tizen.NUI public void Connect(System.Delegate func) { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); { NDalicPINVOKE.TextFieldSignal_Connect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -127,7 +127,7 @@ namespace Tizen.NUI public void Disconnect(System.Delegate func) { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); { NDalicPINVOKE.TextFieldSignal_Disconnect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); diff --git a/src/Tizen.NUI/src/internal/TimerSignalType.cs b/src/Tizen.NUI/src/internal/TimerSignalType.cs index 4b6876f60..f893c8644 100755 --- a/src/Tizen.NUI/src/internal/TimerSignalType.cs +++ b/src/Tizen.NUI/src/internal/TimerSignalType.cs @@ -116,7 +116,7 @@ namespace Tizen.NUI public void Connect(System.Delegate func) { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); { NDalicPINVOKE.TimerSignalType_Connect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -125,7 +125,7 @@ namespace Tizen.NUI public void Disconnect(System.Delegate func) { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); { NDalicPINVOKE.TimerSignalType_Disconnect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); diff --git a/src/Tizen.NUI/src/internal/TouchDataSignal.cs b/src/Tizen.NUI/src/internal/TouchDataSignal.cs index 256acfa04..0f0825214 100755 --- a/src/Tizen.NUI/src/internal/TouchDataSignal.cs +++ b/src/Tizen.NUI/src/internal/TouchDataSignal.cs @@ -116,7 +116,7 @@ namespace Tizen.NUI public void Connect(System.Delegate func) { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); { NDalicPINVOKE.ActorTouchDataSignal_Connect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -125,7 +125,7 @@ namespace Tizen.NUI public void Disconnect(System.Delegate func) { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); { NDalicPINVOKE.ActorTouchDataSignal_Disconnect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); diff --git a/src/Tizen.NUI/src/internal/TouchPointContainer.cs b/src/Tizen.NUI/src/internal/TouchPointContainer.cs index ab013b770..4f4e18b36 100755 --- a/src/Tizen.NUI/src/internal/TouchPointContainer.cs +++ b/src/Tizen.NUI/src/internal/TouchPointContainer.cs @@ -211,10 +211,10 @@ namespace Tizen.NUI return new TouchPointContainerEnumerator(this); } - // The type-safe enumerator. + // Type-safe enumerator /// Note that the IEnumerator documentation requires an InvalidOperationException to be thrown /// whenever the collection is modified. This has been done for changes in the size of the - /// collection, but not when one of the elements of the collection is modified as it is a bit + /// collection but not when one of the elements of the collection is modified as it is a bit /// tricky to detect unmanaged code that modifies the collection under our feet. public sealed class TouchPointContainerEnumerator : global::System.Collections.IEnumerator , global::System.Collections.Generic.IEnumerator diff --git a/src/Tizen.NUI/src/internal/TouchSignal.cs b/src/Tizen.NUI/src/internal/TouchSignal.cs index fdcc11d7d..420b58e9f 100755 --- a/src/Tizen.NUI/src/internal/TouchSignal.cs +++ b/src/Tizen.NUI/src/internal/TouchSignal.cs @@ -116,7 +116,7 @@ namespace Tizen.NUI public void Connect(System.Delegate func) { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); { NDalicPINVOKE.TouchSignal_Connect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -125,7 +125,7 @@ namespace Tizen.NUI public void Disconnect(System.Delegate func) { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); { NDalicPINVOKE.TouchSignal_Disconnect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); diff --git a/src/Tizen.NUI/src/internal/TypeRegistration.cs b/src/Tizen.NUI/src/internal/TypeRegistration.cs index f08459a68..64f2e7ec9 100755 --- a/src/Tizen.NUI/src/internal/TypeRegistration.cs +++ b/src/Tizen.NUI/src/internal/TypeRegistration.cs @@ -100,7 +100,7 @@ namespace Tizen.NUI static private global::System.IntPtr SwigConstructTypeRegistration(SWIGTYPE_p_std__type_info registerType, SWIGTYPE_p_std__type_info baseType, System.Delegate f) { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(f); + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(f); return NDalicPINVOKE.new_TypeRegistration__SWIG_0(SWIGTYPE_p_std__type_info.getCPtr(registerType), SWIGTYPE_p_std__type_info.getCPtr(baseType), new System.Runtime.InteropServices.HandleRef(null, ip)); } @@ -111,7 +111,7 @@ namespace Tizen.NUI static private global::System.IntPtr SwigConstructTypeRegistration(SWIGTYPE_p_std__type_info registerType, SWIGTYPE_p_std__type_info baseType, System.Delegate f, bool callCreateOnInit) { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(f); + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(f); return NDalicPINVOKE.new_TypeRegistration__SWIG_1(SWIGTYPE_p_std__type_info.getCPtr(registerType), SWIGTYPE_p_std__type_info.getCPtr(baseType), new System.Runtime.InteropServices.HandleRef(null, ip), callCreateOnInit); } @@ -122,7 +122,7 @@ namespace Tizen.NUI static private global::System.IntPtr SwigConstructTypeRegistration(string name, SWIGTYPE_p_std__type_info baseType, System.Delegate f) { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(f); + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(f); return NDalicPINVOKE.new_TypeRegistration__SWIG_2(name, SWIGTYPE_p_std__type_info.getCPtr(baseType), new System.Runtime.InteropServices.HandleRef(null, ip)); } @@ -140,7 +140,7 @@ namespace Tizen.NUI public static void RegisterControl(string controlName, System.Delegate createFunc) { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(createFunc); + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(createFunc); { NDalicPINVOKE.TypeRegistration_RegisterControl(controlName, new System.Runtime.InteropServices.HandleRef(null, ip)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -149,8 +149,8 @@ namespace Tizen.NUI public static void RegisterProperty(string controlName, string propertyName, int index, PropertyType type, System.Delegate setFunc, System.Delegate getFunc) { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(setFunc); - System.IntPtr ip2 = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(getFunc); + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(setFunc); + System.IntPtr ip2 = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(getFunc); { NDalicPINVOKE.TypeRegistration_RegisterProperty(controlName, propertyName, index, (int)type, new System.Runtime.InteropServices.HandleRef(null, ip), new System.Runtime.InteropServices.HandleRef(null, ip2)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); diff --git a/src/Tizen.NUI/src/internal/Uint16Pair.cs b/src/Tizen.NUI/src/internal/Uint16Pair.cs index c2d201f13..bd5c27338 100755 --- a/src/Tizen.NUI/src/internal/Uint16Pair.cs +++ b/src/Tizen.NUI/src/internal/Uint16Pair.cs @@ -14,13 +14,10 @@ * */ -using System; - namespace Tizen.NUI { - [Obsolete("Please do not use! this will be deprecated")] - public class Uint16Pair : global::System.IDisposable + internal class Uint16Pair : global::System.IDisposable { private global::System.Runtime.InteropServices.HandleRef swigCPtr; protected bool swigCMemOwn; diff --git a/src/Tizen.NUI/src/internal/VideoViewSignal.cs b/src/Tizen.NUI/src/internal/VideoViewSignal.cs index f950e95f6..e234ffafb 100755 --- a/src/Tizen.NUI/src/internal/VideoViewSignal.cs +++ b/src/Tizen.NUI/src/internal/VideoViewSignal.cs @@ -111,7 +111,7 @@ namespace Tizen.NUI { } public void Connect(System.Delegate func) { -System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); +System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); { NDalicPINVOKE.VideoViewSignal_Connect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -119,7 +119,7 @@ System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForD } public void Disconnect(System.Delegate func) { -System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); +System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); { NDalicPINVOKE.VideoViewSignal_Disconnect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); diff --git a/src/Tizen.NUI/src/internal/ViewLayoutDirectionChangedSignal.cs b/src/Tizen.NUI/src/internal/ViewLayoutDirectionChangedSignal.cs deleted file mode 100755 index d376113e2..000000000 --- a/src/Tizen.NUI/src/internal/ViewLayoutDirectionChangedSignal.cs +++ /dev/null @@ -1,146 +0,0 @@ -/** Copyright (c) 2017 Samsung Electronics Co., Ltd. -* -* 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 Tizen.NUI.BaseComponents; - -namespace Tizen.NUI -{ - - internal class ViewLayoutDirectionChangedSignal : global::System.IDisposable - { - private global::System.Runtime.InteropServices.HandleRef swigCPtr; - protected bool swigCMemOwn; - - internal ViewLayoutDirectionChangedSignal(global::System.IntPtr cPtr, bool cMemoryOwn) - { - swigCMemOwn = cMemoryOwn; - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - } - - internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ViewLayoutDirectionChangedSignal obj) - { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; - } - - //A Flag to check who called Dispose(). (By User or DisposeQueue) - private bool isDisposeQueued = false; - //A Flat to check if it is already disposed. - protected bool disposed = false; - - ~ViewLayoutDirectionChangedSignal() - { - if (!isDisposeQueued) - { - isDisposeQueued = true; - DisposeQueue.Instance.Add(this); - } - } - - public void Dispose() - { - //Throw excpetion if Dispose() is called in separate thread. - if (!Window.IsInstalled()) - { - throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread."); - } - - if (isDisposeQueued) - { - Dispose(DisposeTypes.Implicit); - } - else - { - Dispose(DisposeTypes.Explicit); - System.GC.SuppressFinalize(this); - } - } - - protected virtual void Dispose(DisposeTypes type) - { - if (disposed) - { - return; - } - - if (type == DisposeTypes.Explicit) - { - //Called by User - //Release your own managed resources here. - //You should release all of your own disposable objects here. - } - - //Release your own unmanaged resources here. - //You should not access any managed member here except static instance. - //because the execution order of Finalizes is non-deterministic. - - if (swigCPtr.Handle != global::System.IntPtr.Zero) - { - if (swigCMemOwn) - { - swigCMemOwn = false; - NDalicManualPINVOKE.delete_ViewLayoutDirectionChangedSignal(swigCPtr); - } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - } - - disposed = true; - } - - public bool Empty() - { - bool ret = NDalicManualPINVOKE.ViewLayoutDirectionChangedSignal_Empty(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - public uint GetConnectionCount() - { - uint ret = NDalicManualPINVOKE.ViewLayoutDirectionChangedSignal_GetConnectionCount(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - public void Connect(System.Delegate func) - { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); - { - NDalicManualPINVOKE.ViewLayoutDirectionChangedSignal_Connect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - } - - public void Disconnect(System.Delegate func) - { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); - { - NDalicManualPINVOKE.ViewLayoutDirectionChangedSignal_Disconnect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - } - - public void Emit(View arg) - { - NDalicManualPINVOKE.ViewLayoutDirectionChangedSignal_Emit(swigCPtr, View.getCPtr(arg)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - public ViewLayoutDirectionChangedSignal() : this(NDalicManualPINVOKE.new_ViewLayoutDirectionChangedSignal(), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - } -} \ No newline at end of file diff --git a/src/Tizen.NUI/src/internal/ViewResourceReadySignal.cs b/src/Tizen.NUI/src/internal/ViewResourceReadySignal.cs index 8ba486215..599c10629 100755 --- a/src/Tizen.NUI/src/internal/ViewResourceReadySignal.cs +++ b/src/Tizen.NUI/src/internal/ViewResourceReadySignal.cs @@ -117,7 +117,7 @@ namespace Tizen.NUI public void Connect(System.Delegate func) { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); { NDalicPINVOKE.ViewResourceReadySignal_Connect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -126,7 +126,7 @@ namespace Tizen.NUI public void Disconnect(System.Delegate func) { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); { NDalicPINVOKE.ViewResourceReadySignal_Disconnect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); diff --git a/src/Tizen.NUI/src/internal/ViewSignal.cs b/src/Tizen.NUI/src/internal/ViewSignal.cs index dff1c7d3f..122679408 100755 --- a/src/Tizen.NUI/src/internal/ViewSignal.cs +++ b/src/Tizen.NUI/src/internal/ViewSignal.cs @@ -116,7 +116,7 @@ namespace Tizen.NUI public void Connect(System.Delegate func) { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); { NDalicPINVOKE.ActorSignal_Connect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -125,7 +125,7 @@ namespace Tizen.NUI public void Disconnect(System.Delegate func) { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); { NDalicPINVOKE.ActorSignal_Disconnect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); diff --git a/src/Tizen.NUI/src/internal/ViewVisibilityChangedSignal.cs b/src/Tizen.NUI/src/internal/ViewVisibilityChangedSignal.cs index d8029f580..5881954d0 100755 --- a/src/Tizen.NUI/src/internal/ViewVisibilityChangedSignal.cs +++ b/src/Tizen.NUI/src/internal/ViewVisibilityChangedSignal.cs @@ -117,7 +117,7 @@ namespace Tizen.NUI public void Connect(System.Delegate func) { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); { NDalicPINVOKE.ViewVisibilityChangedSignal_Connect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -126,7 +126,7 @@ namespace Tizen.NUI public void Disconnect(System.Delegate func) { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); { NDalicPINVOKE.ViewVisibilityChangedSignal_Disconnect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); diff --git a/src/Tizen.NUI/src/internal/ViewWrapperImpl.cs b/src/Tizen.NUI/src/internal/ViewWrapperImpl.cs index db0728afa..f598ca3fb 100755 --- a/src/Tizen.NUI/src/internal/ViewWrapperImpl.cs +++ b/src/Tizen.NUI/src/internal/ViewWrapperImpl.cs @@ -59,44 +59,44 @@ namespace Tizen.NUI public delegate void OnTapDelegate(TapGesture tap); public delegate void OnLongPressDelegate(LongPressGesture longPress); - public new OnStageConnectionDelegate OnStageConnection; - public new OnStageDisconnectionDelegate OnStageDisconnection; - public new OnChildAddDelegate OnChildAdd; - public new OnChildRemoveDelegate OnChildRemove; - public new OnPropertySetDelegate OnPropertySet; - public new OnSizeSetDelegate OnSizeSet; - public new OnSizeAnimationDelegate OnSizeAnimation; + public OnStageConnectionDelegate OnStageConnection; + public OnStageDisconnectionDelegate OnStageDisconnection; + public OnChildAddDelegate OnChildAdd; + public OnChildRemoveDelegate OnChildRemove; + public OnPropertySetDelegate OnPropertySet; + public OnSizeSetDelegate OnSizeSet; + public OnSizeAnimationDelegate OnSizeAnimation; public OnTouchDelegate OnTouch; public OnHoverDelegate OnHover; public OnKeyDelegate OnKey; public OnWheelDelegate OnWheel; - public new OnRelayoutDelegate OnRelayout; - public new OnSetResizePolicyDelegate OnSetResizePolicy; - public new GetNaturalSizeDelegate GetNaturalSize; - public new CalculateChildSizeDelegate CalculateChildSize; - public new GetHeightForWidthDelegate GetHeightForWidth; - public new GetWidthForHeightDelegate GetWidthForHeight; + public OnRelayoutDelegate OnRelayout; + public OnSetResizePolicyDelegate OnSetResizePolicy; + public GetNaturalSizeDelegate GetNaturalSize; + public CalculateChildSizeDelegate CalculateChildSize; + public GetHeightForWidthDelegate GetHeightForWidth; + public GetWidthForHeightDelegate GetWidthForHeight; public RelayoutDependentOnChildrenDimensionDelegate RelayoutDependentOnChildrenDimension; - public new RelayoutDependentOnChildrenDelegate RelayoutDependentOnChildren; - public new OnCalculateRelayoutSizeDelegate OnCalculateRelayoutSize; - public new OnLayoutNegotiatedDelegate OnLayoutNegotiated; - public new OnControlChildAddDelegate OnControlChildAdd; - public new OnControlChildRemoveDelegate OnControlChildRemove; - public new OnStyleChangeDelegate OnStyleChange; - public new OnAccessibilityActivatedDelegate OnAccessibilityActivated; - public new OnAccessibilityPanDelegate OnAccessibilityPan; - public new OnAccessibilityTouchDelegate OnAccessibilityTouch; - public new OnAccessibilityValueChangeDelegate OnAccessibilityValueChange; - public new OnAccessibilityZoomDelegate OnAccessibilityZoom; + public RelayoutDependentOnChildrenDelegate RelayoutDependentOnChildren; + public OnCalculateRelayoutSizeDelegate OnCalculateRelayoutSize; + public OnLayoutNegotiatedDelegate OnLayoutNegotiated; + public OnControlChildAddDelegate OnControlChildAdd; + public OnControlChildRemoveDelegate OnControlChildRemove; + public OnStyleChangeDelegate OnStyleChange; + public OnAccessibilityActivatedDelegate OnAccessibilityActivated; + public OnAccessibilityPanDelegate OnAccessibilityPan; + public OnAccessibilityTouchDelegate OnAccessibilityTouch; + public OnAccessibilityValueChangeDelegate OnAccessibilityValueChange; + public OnAccessibilityZoomDelegate OnAccessibilityZoom; public OnFocusGainedDelegate OnFocusGained; public OnFocusLostDelegate OnFocusLost; - public new GetNextFocusableViewDelegate GetNextFocusableView; - public new OnFocusChangeCommittedDelegate OnFocusChangeCommitted; - public new OnKeyboardEnterDelegate OnKeyboardEnter; - public new OnPinchDelegate OnPinch; - public new OnPanDelegate OnPan; - public new OnTapDelegate OnTap; - public new OnLongPressDelegate OnLongPress; + public GetNextFocusableViewDelegate GetNextFocusableView; + public OnFocusChangeCommittedDelegate OnFocusChangeCommitted; + public OnKeyboardEnterDelegate OnKeyboardEnter; + public OnPinchDelegate OnPinch; + public OnPanDelegate OnPan; + public OnTapDelegate OnTap; + public OnLongPressDelegate OnLongPress; internal ViewWrapperImpl(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicManualPINVOKE.ViewWrapperImpl_SWIGUpcast(cPtr), cMemoryOwn) { @@ -132,7 +132,6 @@ namespace Tizen.NUI if (swigCMemOwn) { swigCMemOwn = false; - NDalicManualPINVOKE.delete_ViewWrapperImpl(swigCPtr); } swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); } diff --git a/src/Tizen.NUI/src/internal/VoidSignal.cs b/src/Tizen.NUI/src/internal/VoidSignal.cs index dba71150d..bf6251a6d 100755 --- a/src/Tizen.NUI/src/internal/VoidSignal.cs +++ b/src/Tizen.NUI/src/internal/VoidSignal.cs @@ -121,7 +121,7 @@ namespace Tizen.NUI public void Connect(System.Delegate func) { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); { NDalicPINVOKE.VoidSignal_Connect__SWIG_0(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -130,7 +130,7 @@ namespace Tizen.NUI public void Disconnect(System.Delegate func) { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); { NDalicPINVOKE.VoidSignal_Disconnect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); diff --git a/src/Tizen.NUI/src/internal/WatchApplication.cs b/src/Tizen.NUI/src/internal/WatchApplication.cs new file mode 100755 index 000000000..f44a5d243 --- /dev/null +++ b/src/Tizen.NUI/src/internal/WatchApplication.cs @@ -0,0 +1,383 @@ +/** Copyright (c) 2017 Samsung Electronics Co., Ltd. +* +* 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; +namespace Tizen.NUI +{ + internal class WatchApplication : Application + { + private global::System.Runtime.InteropServices.HandleRef swigCPtr; + + internal WatchApplication(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn) + { + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); + } + + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(WatchApplication obj) + { + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; + } + + protected virtual void Dispose(DisposeTypes type) + { + if (disposed) + { + return; + } + + if (type == DisposeTypes.Explicit) + { + //Called by User + //Release your own managed resources here. + //You should release all of your own disposable objects here. + + } + + //Release your own unmanaged resources here. + //You should not access any managed member here except static instance. + //because the execution order of Finalizes is non-deterministic. + DisConnectFromSignals(); + + if (swigCPtr.Handle != global::System.IntPtr.Zero) + { + if (swigCMemOwn) + { + swigCMemOwn = false; + NDalicManualPINVOKE.delete_WatchApplication(swigCPtr); + } + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + } + + base.Dispose(type); + } + + private void DisConnectFromSignals() + { + if (_timeTickCallback != null) + { + this.TimeTickSignal().Disconnect(_timeTickCallback); + } + if (_ambientTickCallback != null) + { + this.AmbientTickSignal().Disconnect(_ambientTickCallback); + } + if (_ambientChangedCallback != null) + { + this.AmbientChangedSignal().Disconnect(_ambientChangedCallback); + } + } + + public static WatchApplication Instance + { + get + { + return _instance; + } + } + + public static WatchApplication NewWatchApplication() + { + WatchApplication ret = New(); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + // we've got an application now connect the signals + _instance = ret; + return ret; + } + + public static WatchApplication NewWatchApplication(string[] args) + { + WatchApplication ret = New(args); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + _instance = ret; + return ret; + } + + public static WatchApplication NewWatchApplication(string[] args, string stylesheet) + { + WatchApplication ret = New(args, stylesheet); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + _instance = ret; + return ret; + } + + public new static WatchApplication New() + { + WatchApplication ret = new WatchApplication(NDalicManualPINVOKE.WatchApplication_New__SWIG_0(), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + public static WatchApplication New(string[] args) + { + int argc = args.Length; + string argvStr = string.Join(" ", args); + + WatchApplication ret = new WatchApplication(NDalicManualPINVOKE.WatchApplication_New__SWIG_1(argc, argvStr), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + public static WatchApplication New(string[] args, string stylesheet) + { + int argc = args.Length; + string argvStr = string.Join(" ", args); + + WatchApplication ret = new WatchApplication(NDalicManualPINVOKE.WatchApplication_New__SWIG_2(argc, argvStr, stylesheet), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal WatchApplication(WatchApplication implementation) : this(NDalicManualPINVOKE.new_WatchApplication__SWIG_1(WatchApplication.getCPtr(implementation)), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Event arguments that passed via time tick event signal. + /// + public class TimeTickEventArgs : EventArgs + { + /// + /// Application. + /// + public Application Application + { + get; + set; + } + + /// + /// WatchTime. + /// + public WatchTime WatchTime + { + get; + set; + } + } + + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + private delegate void TimeTickCallbackType(IntPtr application, IntPtr watchTime); + private TimeTickCallbackType _timeTickCallback; + private DaliEventHandler _timeTickEventHandler; + + /// + /// TimeTick event. + /// + public event DaliEventHandler TimeTick + { + add + { + if (_timeTickEventHandler == null) + { + _timeTickCallback = new TimeTickCallbackType( OnTimeTick); + TimeTickSignal().Connect(_timeTickCallback); + } + + _timeTickEventHandler += value; + } + + remove + { + _timeTickEventHandler -= value; + + if (_timeTickEventHandler == null && TimeTickSignal().Empty() == false) + { + TimeTickSignal().Disconnect(_timeTickCallback); + } + } + } + + private void OnTimeTick(IntPtr application, IntPtr watchTime) + { + TimeTickEventArgs e = new TimeTickEventArgs(); + if (application != null) + { + e.Application = Application.GetApplicationFromPtr(application); + } + if(watchTime != null) + { + e.WatchTime = WatchTime.GetWatchTimeFromPtr(watchTime); + } + + _timeTickEventHandler?.Invoke(this, e); + } + + internal WatchTimeSignal TimeTickSignal() + { + WatchTimeSignal ret = new WatchTimeSignal(NDalicManualPINVOKE.WatchApplication_TimeTickSignal(swigCPtr), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Event arguments that passed via ambient tick event signal. + /// + public class AmbientTickEventArgs : EventArgs + { + /// + /// Application. + /// + public Application Application + { + get; + set; + } + + /// + /// WatchTime. + /// + public WatchTime WatchTime + { + get; + set; + } + } + + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + private delegate void AmbientTickCallbackType(IntPtr application, IntPtr watchTime); + private AmbientTickCallbackType _ambientTickCallback; + private DaliEventHandler _ambientTickEventHandler; + + /// + /// AmbientTick event. + /// + public event DaliEventHandler AmbientTick + { + add + { + if (_ambientTickEventHandler == null) + { + _ambientTickCallback = new AmbientTickCallbackType( OnAmbientTick); + AmbientTickSignal().Connect(_ambientTickCallback); + } + + _ambientTickEventHandler += value; + } + + remove + { + _ambientTickEventHandler -= value; + + if (_ambientTickEventHandler == null && AmbientTickSignal().Empty() == false) + { + AmbientTickSignal().Disconnect(_ambientTickCallback); + } + } + } + + private void OnAmbientTick(IntPtr application, IntPtr watchTime) + { + AmbientTickEventArgs e = new AmbientTickEventArgs(); + if (application != null) + { + e.Application = Application.GetApplicationFromPtr(application); + } + if (watchTime != null) + { + e.WatchTime = WatchTime.GetWatchTimeFromPtr(watchTime); + } + + _ambientTickEventHandler?.Invoke(this, e); + } + + internal WatchTimeSignal AmbientTickSignal() + { + WatchTimeSignal ret = new WatchTimeSignal(NDalicManualPINVOKE.WatchApplication_AmbientTickSignal(swigCPtr), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Event arguments that passed via ambient tick event signal. + /// + public class AmbientChangedEventArgs : EventArgs + { + /// + /// Application. + /// + public Application Application + { + get; + set; + } + + /// + /// Changed. + /// + public bool Changed + { + get; + set; + } + } + + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + private delegate void AmbientChangedCallbackType(IntPtr application, bool changed); + private AmbientChangedCallbackType _ambientChangedCallback; + private DaliEventHandler _ambientChangedEventHandler; + + /// + /// AmbientChanged event. + /// + public event DaliEventHandler AmbientChanged + { + add + { + if (_ambientChangedEventHandler == null) + { + _ambientChangedCallback = new AmbientChangedCallbackType( OnAmbientChanged); + AmbientChangedSignal().Connect(_ambientChangedCallback); + } + + _ambientChangedEventHandler += value; + } + + remove + { + _ambientChangedEventHandler -= value; + + if (_ambientChangedEventHandler == null && AmbientChangedSignal().Empty() == false) + { + AmbientChangedSignal().Disconnect(_ambientChangedCallback); + } + } + } + + private void OnAmbientChanged(IntPtr application, bool changed) + { + AmbientChangedEventArgs e = new AmbientChangedEventArgs(); + if (application != null) + { + e.Application = Application.GetApplicationFromPtr(application); + } + e.Changed = changed; + + _ambientChangedEventHandler?.Invoke(this, e); + } + + internal WatchBoolSignal AmbientChangedSignal() + { + WatchBoolSignal ret = new WatchBoolSignal(NDalicManualPINVOKE.WatchApplication_AmbientChangedSignal(swigCPtr), false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + private static WatchApplication _instance; //singleton + + } + +} diff --git a/src/Tizen.NUI/src/internal/WatchBoolSignal.cs b/src/Tizen.NUI/src/internal/WatchBoolSignal.cs new file mode 100755 index 000000000..c85921d3d --- /dev/null +++ b/src/Tizen.NUI/src/internal/WatchBoolSignal.cs @@ -0,0 +1,145 @@ +/** Copyright (c) 2017 Samsung Electronics Co., Ltd. +* +* 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. +* +*/ +namespace Tizen.NUI +{ + + internal class WatchBoolSignal : global::System.IDisposable + { + private global::System.Runtime.InteropServices.HandleRef swigCPtr; + protected bool swigCMemOwn; + + internal WatchBoolSignal(global::System.IntPtr cPtr, bool cMemoryOwn) + { + swigCMemOwn = cMemoryOwn; + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); + } + + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(WatchBoolSignal obj) + { + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; + } + + //A Flag to check who called Dispose(). (By User or DisposeQueue) + private bool isDisposeQueued = false; + //A Flat to check if it is already disposed. + protected bool disposed = false; + + ~WatchBoolSignal() + { + if (!isDisposeQueued) + { + isDisposeQueued = true; + DisposeQueue.Instance.Add(this); + } + } + + public void Dispose() + { + //Throw excpetion if Dispose() is called in separate thread. + if (!Window.IsInstalled()) + { + throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread."); + } + + if (isDisposeQueued) + { + Dispose(DisposeTypes.Implicit); + } + else + { + Dispose(DisposeTypes.Explicit); + System.GC.SuppressFinalize(this); + } + } + + protected virtual void Dispose(DisposeTypes type) + { + if (disposed) + { + return; + } + + if (type == DisposeTypes.Explicit) + { + //Called by User + //Release your own managed resources here. + //You should release all of your own disposable objects here. + + } + + //Release your own unmanaged resources here. + //You should not access any managed member here except static instance. + //because the execution order of Finalizes is non-deterministic. + + if (swigCPtr.Handle != global::System.IntPtr.Zero) + { + if (swigCMemOwn) + { + swigCMemOwn = false; + NDalicManualPINVOKE.delete_WatchBoolSignal(swigCPtr); + } + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + } + + disposed = true; + } + + public bool Empty() + { + bool ret = NDalicManualPINVOKE.WatchBoolSignal_Empty(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + public uint GetConnectionCount() + { + uint ret = NDalicManualPINVOKE.WatchBoolSignal_GetConnectionCount(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + public void Connect(System.Delegate func) + { + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + { + NDalicManualPINVOKE.WatchBoolSignal_Connect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + } + + public void Disconnect(System.Delegate func) + { + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + { + NDalicManualPINVOKE.WatchBoolSignal_Disconnect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + } + + public void Emit(Application arg1, bool arg2) + { + NDalicManualPINVOKE.WatchBoolSignal_Emit(swigCPtr, Application.getCPtr(arg1), arg2); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + public WatchBoolSignal() : this(NDalicManualPINVOKE.new_WatchBoolSignal(), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + } + +} diff --git a/src/Tizen.NUI/src/internal/WatchTimeSignal.cs b/src/Tizen.NUI/src/internal/WatchTimeSignal.cs new file mode 100755 index 000000000..dd9db6439 --- /dev/null +++ b/src/Tizen.NUI/src/internal/WatchTimeSignal.cs @@ -0,0 +1,145 @@ +/** Copyright (c) 2017 Samsung Electronics Co., Ltd. +* +* 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. +* +*/ +namespace Tizen.NUI +{ + + internal class WatchTimeSignal : global::System.IDisposable + { + private global::System.Runtime.InteropServices.HandleRef swigCPtr; + protected bool swigCMemOwn; + + internal WatchTimeSignal(global::System.IntPtr cPtr, bool cMemoryOwn) + { + swigCMemOwn = cMemoryOwn; + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); + } + + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(WatchTimeSignal obj) + { + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; + } + + //A Flag to check who called Dispose(). (By User or DisposeQueue) + private bool isDisposeQueued = false; + //A Flat to check if it is already disposed. + protected bool disposed = false; + + ~WatchTimeSignal() + { + if (!isDisposeQueued) + { + isDisposeQueued = true; + DisposeQueue.Instance.Add(this); + } + } + + public void Dispose() + { + //Throw excpetion if Dispose() is called in separate thread. + if (!Window.IsInstalled()) + { + throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread."); + } + + if (isDisposeQueued) + { + Dispose(DisposeTypes.Implicit); + } + else + { + Dispose(DisposeTypes.Explicit); + System.GC.SuppressFinalize(this); + } + } + + protected virtual void Dispose(DisposeTypes type) + { + if (disposed) + { + return; + } + + if (type == DisposeTypes.Explicit) + { + //Called by User + //Release your own managed resources here. + //You should release all of your own disposable objects here. + + } + + //Release your own unmanaged resources here. + //You should not access any managed member here except static instance. + //because the execution order of Finalizes is non-deterministic. + + if (swigCPtr.Handle != global::System.IntPtr.Zero) + { + if (swigCMemOwn) + { + swigCMemOwn = false; + NDalicManualPINVOKE.delete_WatchTimeSignal(swigCPtr); + } + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + } + + disposed = true; + } + + public bool Empty() + { + bool ret = NDalicManualPINVOKE.WatchTimeSignal_Empty(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + public uint GetConnectionCount() + { + uint ret = NDalicManualPINVOKE.WatchTimeSignal_GetConnectionCount(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + public void Connect(System.Delegate func) + { + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + { + NDalicManualPINVOKE.WatchTimeSignal_Connect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + } + + public void Disconnect(System.Delegate func) + { + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + { + NDalicManualPINVOKE.WatchTimeSignal_Disconnect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + } + + public void Emit(Application arg1, WatchTime arg2) + { + NDalicManualPINVOKE.WatchTimeSignal_Emit(swigCPtr, Application.getCPtr(arg1), WatchTime.getCPtr(arg2)); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + public WatchTimeSignal() : this(NDalicManualPINVOKE.new_WatchTimeSignal(), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + } + +} diff --git a/src/Tizen.NUI/src/internal/WeakEventHandler.cs b/src/Tizen.NUI/src/internal/WeakEventHandler.cs deleted file mode 100755 index b273b600c..000000000 --- a/src/Tizen.NUI/src/internal/WeakEventHandler.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System; -using System.Reflection; - -namespace Tizen.NUI -{ - internal sealed class WeakEventHandler where TEventArgs : EventArgs - { - private readonly WeakReference _targetReference; - private readonly MethodInfo _method; - - public WeakEventHandler(EventHandler callback) - { - _method = callback.GetMethodInfo(); - _targetReference = new WeakReference(callback.Target, true); - } - - public void Handler(object sender, TEventArgs e) - { - var target = _targetReference.Target; - if (target != null) - { - var callback = (Action)_method.CreateDelegate(typeof(Action), target); - if (callback != null) - { - callback(sender, e); - } - } - } -} - -} - diff --git a/src/Tizen.NUI/src/internal/WheelSignal.cs b/src/Tizen.NUI/src/internal/WheelSignal.cs index f17a3fbf4..51bd0d136 100755 --- a/src/Tizen.NUI/src/internal/WheelSignal.cs +++ b/src/Tizen.NUI/src/internal/WheelSignal.cs @@ -116,7 +116,7 @@ namespace Tizen.NUI public void Connect(System.Delegate func) { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); { NDalicPINVOKE.ActorWheelSignal_Connect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -125,7 +125,7 @@ namespace Tizen.NUI public void Disconnect(System.Delegate func) { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); { NDalicPINVOKE.ActorWheelSignal_Disconnect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); diff --git a/src/Tizen.NUI/src/internal/WidgetApplication.cs b/src/Tizen.NUI/src/internal/WidgetApplication.cs deleted file mode 100755 index a4ac01465..000000000 --- a/src/Tizen.NUI/src/internal/WidgetApplication.cs +++ /dev/null @@ -1,529 +0,0 @@ -/** Copyright (c) 2017 Samsung Electronics Co., Ltd. -* -* 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; - -namespace Tizen.NUI -{ - /// - /// Widget application - /// - internal class WidgetApplication : BaseHandle - { - private global::System.Runtime.InteropServices.HandleRef swigCPtr; - - internal WidgetApplication(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicManualPINVOKE.WidgetApplication_SWIGUpcast(cPtr), cMemoryOwn) - { - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - } - - internal static global::System.Runtime.InteropServices.HandleRef getCPtr(WidgetApplication obj) - { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; - } - - /// - /// To make Window instance be disposed. - /// - protected override void Dispose(DisposeTypes type) - { - if(disposed) - { - return; - } - - if(type == DisposeTypes.Explicit) - { - //Called by User - //Release your own managed resources here. - //You should release all of your own disposable objects here. - } - - //Release your own unmanaged resources here. - //You should not access any managed member here except static instance. - //because the execution order of Finalizes is non-deterministic. - - if (_initCallback != null) - { - this.InitSignal().Disconnect(_initCallback); - } - if (_terminateCallback != null) - { - this.TerminateSignal().Disconnect(_terminateCallback); - } - if (_languageChangedCallback != null) - { - this.LanguageChangedSignal().Disconnect(_languageChangedCallback);; - } - if (_regionChangedCallback != null) - { - this.RegionChangedSignal().Disconnect(_regionChangedCallback); - } - if (_batteryLowCallback != null) - { - this.BatteryLowSignal().Disconnect(_batteryLowCallback); - } - if (_memoryLowCallback != null) - { - this.MemoryLowSignal().Disconnect(_memoryLowCallback); - } - - if (swigCPtr.Handle != global::System.IntPtr.Zero) - { - if (swigCMemOwn) - { - swigCMemOwn = false; - NDalicManualPINVOKE.delete_WidgetApplication(swigCPtr); - } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - } - - base.Dispose(type); - } - - internal static WidgetApplication GetWidgetApplicationFromPtr(global::System.IntPtr cPtr) - { - WidgetApplication ret = new WidgetApplication(cPtr, false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - public static WidgetApplication Instance - { - get - { - return _instance; - } - } - - public static WidgetApplication NewWidgetApplication(string[] args, string stylesheet) - { - WidgetApplication ret = New(args, stylesheet); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - - _instance = ret; - return ret; - } - - public static WidgetApplication New(string[] args, string stylesheet) - { - int argc = args.Length; - string argvStr = string.Join(" ", args); - - WidgetApplication ret = new WidgetApplication(NDalicManualPINVOKE.WidgetApplication_New(argc, argvStr, stylesheet), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal WidgetApplication(WidgetApplication widgetApplication) : this(NDalicManualPINVOKE.new_WidgetApplication__SWIG_1(WidgetApplication.getCPtr(widgetApplication)), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - internal WidgetApplication Assign(WidgetApplication widgetApplication) - { - WidgetApplication ret = new WidgetApplication(NDalicManualPINVOKE.WidgetApplication_Assign(swigCPtr, WidgetApplication.getCPtr(widgetApplication)), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// This starts the application. - /// - public void MainLoop() - { - NDalicManualPINVOKE.WidgetApplication_MainLoop(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) - { - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - } - - /// - /// This quits the application. - /// Tizen applications should use Lower to improve re-start performance unless they need to Quit completely. - /// - public void Quit() - { - NDalicManualPINVOKE.WidgetApplication_Quit(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - /// - /// Get window. - /// - /// The window for widget instance. - public Window GetWindow() - { - Window ret = new Window(NDalicManualPINVOKE.WidgetApplication_GetWindow(swigCPtr), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// Get path application resources are stored at. - /// - /// The full path of the resources - public static string GetResourcePath() - { - string ret = NDalicManualPINVOKE.WidgetApplication_GetResourcePath(); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// Event arguments that passed via widget app event signal. - /// - public class WidgetApplicationEventArgs : EventArgs - { - /// - /// Widget application. - /// - public WidgetApplication WidgetApplication - { - get; - set; - } - } - - [UnmanagedFunctionPointer(CallingConvention.StdCall)] - private delegate void InitCallbackType(IntPtr widgetApplication); - private InitCallbackType _initCallback; - private DaliEventHandler _initEventHandler; - - /// - /// Init event. - /// - public event DaliEventHandler Init - { - add - { - if (_initEventHandler == null) - { - _initCallback = new InitCallbackType( OnInit); - InitSignal().Connect(_initCallback); - } - - _initEventHandler += value; - } - - remove - { - _initEventHandler -= value; - - if (_initEventHandler == null && InitSignal().Empty() == false) - { - InitSignal().Disconnect(_initCallback); - } - } - } - - private void OnInit(IntPtr widgetApplication) - { - WidgetApplicationEventArgs e = new WidgetApplicationEventArgs(); - if (widgetApplication != null) - { - e.WidgetApplication = WidgetApplication.GetWidgetApplicationFromPtr(widgetApplication); - } - - if (_initEventHandler != null) - { - _initEventHandler(this, e); - } - } - - internal AppSignalType InitSignal() - { - AppSignalType ret = new AppSignalType(NDalicManualPINVOKE.WidgetApplication_InitSignal(swigCPtr), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - [UnmanagedFunctionPointer(CallingConvention.StdCall)] - private delegate void TerminateCallbackType(IntPtr widgetApplication); - private TerminateCallbackType _terminateCallback; - private DaliEventHandler _terminateEventHandler; - - /// - /// Terminate event. - /// - public event DaliEventHandler Terminate - { - add - { - if (_terminateEventHandler == null) - { - _terminateCallback = new TerminateCallbackType( OnTerminate); - TerminateSignal().Connect(_terminateCallback); - } - - _terminateEventHandler += value; - } - - remove - { - _terminateEventHandler -= value; - - if (_terminateEventHandler == null && TerminateSignal().Empty() == false) - { - TerminateSignal().Disconnect(_terminateCallback); - } - } - } - - private void OnTerminate(IntPtr widgetApplication) - { - WidgetApplicationEventArgs e = new WidgetApplicationEventArgs(); - - if (widgetApplication != null) - { - e.WidgetApplication = WidgetApplication.GetWidgetApplicationFromPtr(widgetApplication); - } - - if (_terminateEventHandler != null) - { - _terminateEventHandler(this, e); - } - } - - internal AppSignalType TerminateSignal() - { - AppSignalType ret = new AppSignalType(NDalicManualPINVOKE.WidgetApplication_TerminateSignal(swigCPtr), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - [UnmanagedFunctionPointer(CallingConvention.StdCall)] - private delegate void LanguageChangedCallbackType(IntPtr widgetApplication); - private LanguageChangedCallbackType _languageChangedCallback; - private DaliEventHandler _languageChangedEventHandler; - - /// - /// LanguageChanged event. - /// - public event DaliEventHandler LanguageChanged - { - add - { - if (_languageChangedEventHandler == null) - { - _languageChangedCallback = new LanguageChangedCallbackType( OnLanguageChanged); - LanguageChangedSignal().Connect(_languageChangedCallback); - } - - _languageChangedEventHandler += value; - } - - remove - { - _languageChangedEventHandler -= value; - - if (_languageChangedEventHandler == null && LanguageChangedSignal().Empty() == false) - { - LanguageChangedSignal().Disconnect(_languageChangedCallback); - } - } - } - - private void OnLanguageChanged(IntPtr widgetApplication) - { - WidgetApplicationEventArgs e = new WidgetApplicationEventArgs(); - - if (widgetApplication != null) - { - e.WidgetApplication = WidgetApplication.GetWidgetApplicationFromPtr(widgetApplication); - } - - if (_languageChangedEventHandler != null) - { - _languageChangedEventHandler(this, e); - } - } - - internal AppSignalType LanguageChangedSignal() - { - AppSignalType ret = new AppSignalType(NDalicManualPINVOKE.WidgetApplication_LanguageChangedSignal(swigCPtr), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - [UnmanagedFunctionPointer(CallingConvention.StdCall)] - private delegate void RegionChangedCallbackType(IntPtr widgetApplication); - private RegionChangedCallbackType _regionChangedCallback; - private DaliEventHandler _regionChangedEventHandler; - - /// - /// RegionChanged event. - /// - public event DaliEventHandler RegionChanged - { - add - { - if (_regionChangedEventHandler == null) - { - _regionChangedCallback = new RegionChangedCallbackType( OnRegionChanged ); - RegionChangedSignal().Connect(_regionChangedCallback); - } - - _regionChangedEventHandler += value; - } - - remove - { - _regionChangedEventHandler -= value; - - if (_regionChangedEventHandler == null && RegionChangedSignal().Empty() == false) - { - RegionChangedSignal().Disconnect(_regionChangedCallback); - } - } - } - - private void OnRegionChanged(IntPtr widgetApplication) - { - WidgetApplicationEventArgs e = new WidgetApplicationEventArgs(); - - if (widgetApplication != null) - { - e.WidgetApplication = WidgetApplication.GetWidgetApplicationFromPtr(widgetApplication); - } - - if (_regionChangedEventHandler != null) - { - _regionChangedEventHandler(this, e); - } - } - - internal AppSignalType RegionChangedSignal() - { - AppSignalType ret = new AppSignalType(NDalicManualPINVOKE.WidgetApplication_RegionChangedSignal(swigCPtr), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - [UnmanagedFunctionPointer(CallingConvention.StdCall)] - private delegate void BatteryLowCallbackType(IntPtr widgetApplication); - private BatteryLowCallbackType _batteryLowCallback; - private DaliEventHandler _batteryLowEventHandler; - - /// - /// BatteryLow event. - /// - public event DaliEventHandler BatteryLow - { - add - { - if (_batteryLowEventHandler == null) - { - _batteryLowCallback = new BatteryLowCallbackType( OnBatteryLow ); - BatteryLowSignal().Connect(_batteryLowCallback); - } - - _batteryLowEventHandler += value; - } - - remove - { - _batteryLowEventHandler -= value; - - if (_batteryLowEventHandler == null && BatteryLowSignal().Empty() == false) - { - BatteryLowSignal().Disconnect(_batteryLowCallback); - } - } - } - - private void OnBatteryLow(IntPtr widgetApplication) - { - WidgetApplicationEventArgs e = new WidgetApplicationEventArgs(); - - if (widgetApplication != null) - { - e.WidgetApplication = WidgetApplication.GetWidgetApplicationFromPtr(widgetApplication); - } - - if (_batteryLowEventHandler != null) - { - _batteryLowEventHandler(this, e); - } - } - - internal AppSignalType BatteryLowSignal() - { - AppSignalType ret = new AppSignalType(NDalicManualPINVOKE.WidgetApplication_BatteryLowSignal(swigCPtr), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - [UnmanagedFunctionPointer(CallingConvention.StdCall)] - private delegate void MemoryLowCallbackType(IntPtr widgetApplication); - private MemoryLowCallbackType _memoryLowCallback; - private DaliEventHandler _memoryLowEventHandler; - - /// - /// MemoryLow event. - /// - public event DaliEventHandler MemoryLow - { - add - { - if (_memoryLowEventHandler == null) - { - _memoryLowCallback = new MemoryLowCallbackType (OnMemoryLow); - MemoryLowSignal().Connect(_memoryLowCallback); - } - - _memoryLowEventHandler += value; - } - - remove - { - _memoryLowEventHandler -= value; - - if (_memoryLowEventHandler == null && MemoryLowSignal().Empty() == false) - { - MemoryLowSignal().Disconnect(_memoryLowCallback); - } - } - } - - private void OnMemoryLow(IntPtr widgetApplication) - { - WidgetApplicationEventArgs e = new WidgetApplicationEventArgs(); - - if (widgetApplication != null) - { - e.WidgetApplication = WidgetApplication.GetWidgetApplicationFromPtr(widgetApplication); - } - - if (_memoryLowEventHandler != null) - { - _memoryLowEventHandler(this, e); - } - } - - internal AppSignalType MemoryLowSignal() - { - AppSignalType ret = new AppSignalType(NDalicManualPINVOKE.WidgetApplication_MemoryLowSignal(swigCPtr), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - private static WidgetApplication _instance; //singleton - - } - -} diff --git a/src/Tizen.NUI/src/internal/WidgetInstanceCreateSignalType.cs b/src/Tizen.NUI/src/internal/WidgetInstanceCreateSignalType.cs deleted file mode 100755 index 16543ddfc..000000000 --- a/src/Tizen.NUI/src/internal/WidgetInstanceCreateSignalType.cs +++ /dev/null @@ -1,143 +0,0 @@ -/** Copyright (c) 2017 Samsung Electronics Co., Ltd. -* -* 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. -* -*/ - -namespace Tizen.NUI -{ - - internal class WidgetInstanceCreateSignalType : global::System.IDisposable - { - private global::System.Runtime.InteropServices.HandleRef swigCPtr; - protected bool swigCMemOwn; - - internal WidgetInstanceCreateSignalType(global::System.IntPtr cPtr, bool cMemoryOwn) - { - swigCMemOwn = cMemoryOwn; - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - } - - internal static global::System.Runtime.InteropServices.HandleRef getCPtr(WidgetInstanceCreateSignalType obj) - { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; - } - - //A Flag to check who called Dispose(). (By User or DisposeQueue) - private bool isDisposeQueued = false; - //A Flat to check if it is already disposed. - protected bool disposed = false; - - ~WidgetInstanceCreateSignalType() - { - if (!isDisposeQueued) - { - isDisposeQueued = true; - DisposeQueue.Instance.Add(this); - } - } - - public void Dispose() - { - //Throw excpetion if Dispose() is called in separate thread. - if (!Window.IsInstalled()) - { - throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread."); - } - - if (isDisposeQueued) - { - Dispose(DisposeTypes.Implicit); - } - else - { - Dispose(DisposeTypes.Explicit); - System.GC.SuppressFinalize(this); - } - } - - protected virtual void Dispose(DisposeTypes type) - { - if (disposed) - { - return; - } - - if (type == DisposeTypes.Explicit) - { - //Called by User - //Release your own managed resources here. - //You should release all of your own disposable objects here. - - } - - //Release your own unmanaged resources here. - //You should not access any managed member here except static instance. - //because the execution order of Finalizes is non-deterministic. - - if (swigCPtr.Handle != global::System.IntPtr.Zero) - { - swigCMemOwn = false; - NDalicManualPINVOKE.delete_WidgetInstanceCreateSignalType(swigCPtr); - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - } - - disposed = true; - } - - public bool Empty() - { - bool ret = NDalicManualPINVOKE.WidgetInstanceCreateSignalType_Empty(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - public uint GetConnectionCount() - { - uint ret = NDalicManualPINVOKE.WidgetInstanceCreateSignalType_GetConnectionCount(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - public void Connect(System.Delegate func) - { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); - { - NDalicManualPINVOKE.WidgetInstanceCreateSignalType_Connect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - } - - public void Disconnect(System.Delegate func) - { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); - { - NDalicManualPINVOKE.WidgetInstanceCreateSignalType_Disconnect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - } - - public void Emit(WidgetData arg1, SWIGTYPE_p_bundle arg2, Uint16Pair arg3) - { - NDalicManualPINVOKE.WidgetInstanceCreateSignalType_Emit(swigCPtr, WidgetData.getCPtr(arg1), SWIGTYPE_p_bundle.getCPtr(arg2), Uint16Pair.getCPtr(arg3)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - public WidgetInstanceCreateSignalType() : this(NDalicManualPINVOKE.new_WidgetInstanceCreateSignalType(), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - } - -} diff --git a/src/Tizen.NUI/src/internal/WidgetInstancePauseOrResumeSignalType.cs b/src/Tizen.NUI/src/internal/WidgetInstancePauseOrResumeSignalType.cs deleted file mode 100755 index 49a170b41..000000000 --- a/src/Tizen.NUI/src/internal/WidgetInstancePauseOrResumeSignalType.cs +++ /dev/null @@ -1,143 +0,0 @@ -/** Copyright (c) 2017 Samsung Electronics Co., Ltd. -* -* 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. -* -*/ - -namespace Tizen.NUI -{ - - internal class WidgetInstancePauseOrResumeSignalType : global::System.IDisposable - { - private global::System.Runtime.InteropServices.HandleRef swigCPtr; - protected bool swigCMemOwn; - - internal WidgetInstancePauseOrResumeSignalType(global::System.IntPtr cPtr, bool cMemoryOwn) - { - swigCMemOwn = cMemoryOwn; - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - } - - internal static global::System.Runtime.InteropServices.HandleRef getCPtr(WidgetInstancePauseOrResumeSignalType obj) - { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; - } - - //A Flag to check who called Dispose(). (By User or DisposeQueue) - private bool isDisposeQueued = false; - //A Flat to check if it is already disposed. - protected bool disposed = false; - - ~WidgetInstancePauseOrResumeSignalType() - { - if (!isDisposeQueued) - { - isDisposeQueued = true; - DisposeQueue.Instance.Add(this); - } - } - - public void Dispose() - { - //Throw excpetion if Dispose() is called in separate thread. - if (!Window.IsInstalled()) - { - throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread."); - } - - if (isDisposeQueued) - { - Dispose(DisposeTypes.Implicit); - } - else - { - Dispose(DisposeTypes.Explicit); - System.GC.SuppressFinalize(this); - } - } - - protected virtual void Dispose(DisposeTypes type) - { - if (disposed) - { - return; - } - - if (type == DisposeTypes.Explicit) - { - //Called by User - //Release your own managed resources here. - //You should release all of your own disposable objects here. - - } - - //Release your own unmanaged resources here. - //You should not access any managed member here except static instance. - //because the execution order of Finalizes is non-deterministic. - - if (swigCPtr.Handle != global::System.IntPtr.Zero) - { - swigCMemOwn = false; - NDalicManualPINVOKE.delete_WidgetInstancePauseOrResumeSignalType(swigCPtr); - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - } - - disposed = true; - } - - public bool Empty() - { - bool ret = NDalicManualPINVOKE.WidgetInstancePauseOrResumeSignalType_Empty(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - public uint GetConnectionCount() - { - uint ret = NDalicManualPINVOKE.WidgetInstancePauseOrResumeSignalType_GetConnectionCount(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - public void Connect(System.Delegate func) - { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); - { - NDalicManualPINVOKE.WidgetInstancePauseOrResumeSignalType_Connect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - } - - public void Disconnect(System.Delegate func) - { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); - { - NDalicManualPINVOKE.WidgetInstancePauseOrResumeSignalType_Disconnect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - } - - public void Emit(WidgetData arg) - { - NDalicManualPINVOKE.WidgetInstancePauseOrResumeSignalType_Emit(swigCPtr, WidgetData.getCPtr(arg)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - public WidgetInstancePauseOrResumeSignalType() : this(NDalicManualPINVOKE.new_WidgetInstancePauseOrResumeSignalType(), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - } - -} diff --git a/src/Tizen.NUI/src/internal/WidgetInstanceResizeSignalType.cs b/src/Tizen.NUI/src/internal/WidgetInstanceResizeSignalType.cs deleted file mode 100755 index 0685f8003..000000000 --- a/src/Tizen.NUI/src/internal/WidgetInstanceResizeSignalType.cs +++ /dev/null @@ -1,142 +0,0 @@ -/** Copyright (c) 2017 Samsung Electronics Co., Ltd. -* -* 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. -* -*/ - -namespace Tizen.NUI -{ - - internal class WidgetInstanceResizeSignalType : global::System.IDisposable - { - private global::System.Runtime.InteropServices.HandleRef swigCPtr; - protected bool swigCMemOwn; - - internal WidgetInstanceResizeSignalType(global::System.IntPtr cPtr, bool cMemoryOwn) - { - swigCMemOwn = cMemoryOwn; - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - } - - internal static global::System.Runtime.InteropServices.HandleRef getCPtr(WidgetInstanceResizeSignalType obj) - { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; - } - - //A Flag to check who called Dispose(). (By User or DisposeQueue) - private bool isDisposeQueued = false; - //A Flat to check if it is already disposed. - protected bool disposed = false; - - ~WidgetInstanceResizeSignalType() - { - if (!isDisposeQueued) - { - isDisposeQueued = true; - DisposeQueue.Instance.Add(this); - } - } - public void Dispose() - { - //Throw excpetion if Dispose() is called in separate thread. - if (!Window.IsInstalled()) - { - throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread."); - } - - if (isDisposeQueued) - { - Dispose(DisposeTypes.Implicit); - } - else - { - Dispose(DisposeTypes.Explicit); - System.GC.SuppressFinalize(this); - } - } - - protected virtual void Dispose(DisposeTypes type) - { - if (disposed) - { - return; - } - - if (type == DisposeTypes.Explicit) - { - //Called by User - //Release your own managed resources here. - //You should release all of your own disposable objects here. - - } - - //Release your own unmanaged resources here. - //You should not access any managed member here except static instance. - //because the execution order of Finalizes is non-deterministic. - - if (swigCPtr.Handle != global::System.IntPtr.Zero) - { - swigCMemOwn = false; - NDalicManualPINVOKE.delete_WidgetInstanceResizeSignalType(swigCPtr); - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - } - - disposed = true; - } - - public bool Empty() - { - bool ret = NDalicManualPINVOKE.WidgetInstanceResizeSignalType_Empty(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - public uint GetConnectionCount() - { - uint ret = NDalicManualPINVOKE.WidgetInstanceResizeSignalType_GetConnectionCount(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - public void Connect(System.Delegate func) - { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); - { - NDalicManualPINVOKE.WidgetInstanceResizeSignalType_Connect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - } - - public void Disconnect(System.Delegate func) - { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); - { - NDalicManualPINVOKE.WidgetInstanceResizeSignalType_Disconnect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - } - - public void Emit(WidgetData arg1, Uint16Pair arg2) - { - NDalicManualPINVOKE.WidgetInstanceResizeSignalType_Emit(swigCPtr, WidgetData.getCPtr(arg1), Uint16Pair.getCPtr(arg2)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - public WidgetInstanceResizeSignalType() : this(NDalicManualPINVOKE.new_WidgetInstanceResizeSignalType(), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - } - -} diff --git a/src/Tizen.NUI/src/internal/WidgetInstanceTerminateSignalType.cs b/src/Tizen.NUI/src/internal/WidgetInstanceTerminateSignalType.cs deleted file mode 100755 index 1e4327f09..000000000 --- a/src/Tizen.NUI/src/internal/WidgetInstanceTerminateSignalType.cs +++ /dev/null @@ -1,142 +0,0 @@ -/** Copyright (c) 2017 Samsung Electronics Co., Ltd. -* -* 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. -* -*/ -namespace Tizen.NUI -{ - - internal class WidgetInstanceTerminateSignalType : global::System.IDisposable - { - private global::System.Runtime.InteropServices.HandleRef swigCPtr; - protected bool swigCMemOwn; - - internal WidgetInstanceTerminateSignalType(global::System.IntPtr cPtr, bool cMemoryOwn) - { - swigCMemOwn = cMemoryOwn; - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - } - - internal static global::System.Runtime.InteropServices.HandleRef getCPtr(WidgetInstanceTerminateSignalType obj) - { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; - } - - //A Flag to check who called Dispose(). (By User or DisposeQueue) - private bool isDisposeQueued = false; - //A Flat to check if it is already disposed. - protected bool disposed = false; - - ~WidgetInstanceTerminateSignalType() - { - if (!isDisposeQueued) - { - isDisposeQueued = true; - DisposeQueue.Instance.Add(this); - } - } - - public void Dispose() - { - //Throw excpetion if Dispose() is called in separate thread. - if (!Window.IsInstalled()) - { - throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread."); - } - - if (isDisposeQueued) - { - Dispose(DisposeTypes.Implicit); - } - else - { - Dispose(DisposeTypes.Explicit); - System.GC.SuppressFinalize(this); - } - } - - protected virtual void Dispose(DisposeTypes type) - { - if (disposed) - { - return; - } - - if (type == DisposeTypes.Explicit) - { - //Called by User - //Release your own managed resources here. - //You should release all of your own disposable objects here. - - } - - //Release your own unmanaged resources here. - //You should not access any managed member here except static instance. - //because the execution order of Finalizes is non-deterministic. - - if (swigCPtr.Handle != global::System.IntPtr.Zero) - { - swigCMemOwn = false; - NDalicManualPINVOKE.delete_WidgetInstanceTerminateSignalType(swigCPtr); - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - } - - disposed = true; - } - - public bool Empty() - { - bool ret = NDalicManualPINVOKE.WidgetInstanceTerminateSignalType_Empty(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - public uint GetConnectionCount() - { - uint ret = NDalicManualPINVOKE.WidgetInstanceTerminateSignalType_GetConnectionCount(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - public void Connect(System.Delegate func) - { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); - { - NDalicManualPINVOKE.WidgetInstanceTerminateSignalType_Connect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - } - - public void Disconnect(System.Delegate func) - { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); - { - NDalicManualPINVOKE.WidgetInstanceTerminateSignalType_Disconnect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - } - - public void Emit(WidgetData arg1, SWIGTYPE_p_bundle arg2, Widget.WidgetTerminateType arg3) - { - NDalicManualPINVOKE.WidgetInstanceTerminateSignalType_Emit(swigCPtr, WidgetData.getCPtr(arg1), SWIGTYPE_p_bundle.getCPtr(arg2), (int)arg3); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - public WidgetInstanceTerminateSignalType() : this(NDalicManualPINVOKE.new_WidgetInstanceTerminateSignalType(), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - } - -} diff --git a/src/Tizen.NUI/src/internal/WidgetInstanceUpdateSignalType.cs b/src/Tizen.NUI/src/internal/WidgetInstanceUpdateSignalType.cs deleted file mode 100755 index 26480b520..000000000 --- a/src/Tizen.NUI/src/internal/WidgetInstanceUpdateSignalType.cs +++ /dev/null @@ -1,143 +0,0 @@ -/** Copyright (c) 2017 Samsung Electronics Co., Ltd. -* -* 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. -* -*/ - -namespace Tizen.NUI -{ - - internal class WidgetInstanceUpdateSignalType : global::System.IDisposable - { - private global::System.Runtime.InteropServices.HandleRef swigCPtr; - protected bool swigCMemOwn; - - internal WidgetInstanceUpdateSignalType(global::System.IntPtr cPtr, bool cMemoryOwn) - { - swigCMemOwn = cMemoryOwn; - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - } - - internal static global::System.Runtime.InteropServices.HandleRef getCPtr(WidgetInstanceUpdateSignalType obj) - { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; - } - - //A Flag to check who called Dispose(). (By User or DisposeQueue) - private bool isDisposeQueued = false; - //A Flat to check if it is already disposed. - protected bool disposed = false; - - ~WidgetInstanceUpdateSignalType() - { - if (!isDisposeQueued) - { - isDisposeQueued = true; - DisposeQueue.Instance.Add(this); - } - } - - public void Dispose() - { - //Throw excpetion if Dispose() is called in separate thread. - if (!Window.IsInstalled()) - { - throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread."); - } - - if (isDisposeQueued) - { - Dispose(DisposeTypes.Implicit); - } - else - { - Dispose(DisposeTypes.Explicit); - System.GC.SuppressFinalize(this); - } - } - - protected virtual void Dispose(DisposeTypes type) - { - if (disposed) - { - return; - } - - if (type == DisposeTypes.Explicit) - { - //Called by User - //Release your own managed resources here. - //You should release all of your own disposable objects here. - - } - - //Release your own unmanaged resources here. - //You should not access any managed member here except static instance. - //because the execution order of Finalizes is non-deterministic. - - if (swigCPtr.Handle != global::System.IntPtr.Zero) - { - swigCMemOwn = false; - NDalicManualPINVOKE.delete_WidgetInstanceUpdateSignalType(swigCPtr); - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - } - - disposed = true; - } - - public bool Empty() - { - bool ret = NDalicManualPINVOKE.WidgetInstanceUpdateSignalType_Empty(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - public uint GetConnectionCount() - { - uint ret = NDalicManualPINVOKE.WidgetInstanceUpdateSignalType_GetConnectionCount(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - public void Connect(System.Delegate func) - { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); - { - NDalicManualPINVOKE.WidgetInstanceUpdateSignalType_Connect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - } - - public void Disconnect(System.Delegate func) - { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); - { - NDalicManualPINVOKE.WidgetInstanceUpdateSignalType_Disconnect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - } - - public void Emit(WidgetData arg1, SWIGTYPE_p_bundle arg2, int arg3) - { - NDalicManualPINVOKE.WidgetInstanceUpdateSignalType_Emit(swigCPtr, WidgetData.getCPtr(arg1), SWIGTYPE_p_bundle.getCPtr(arg2), arg3); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - public WidgetInstanceUpdateSignalType() : this(NDalicManualPINVOKE.new_WidgetInstanceUpdateSignalType(), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - } - -} diff --git a/src/Tizen.NUI/src/internal/WidgetViewSignal.cs b/src/Tizen.NUI/src/internal/WidgetViewSignal.cs deleted file mode 100755 index 4dca3b625..000000000 --- a/src/Tizen.NUI/src/internal/WidgetViewSignal.cs +++ /dev/null @@ -1,97 +0,0 @@ -//------------------------------------------------------------------------------ -// -// -// This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.12 -// -// Do not make changes to this file unless you know what you are doing--modify -// the SWIG interface file instead. -//------------------------------------------------------------------------------ - -namespace Tizen.NUI -{ - - public class WidgetViewSignal : global::System.IDisposable - { - private global::System.Runtime.InteropServices.HandleRef swigCPtr; - protected bool swigCMemOwn; - - internal WidgetViewSignal(global::System.IntPtr cPtr, bool cMemoryOwn) - { - swigCMemOwn = cMemoryOwn; - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - } - - internal static global::System.Runtime.InteropServices.HandleRef getCPtr(WidgetViewSignal obj) - { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; - } - - ~WidgetViewSignal() - { - Dispose(); - } - - public virtual void Dispose() - { - lock (this) - { - if (swigCPtr.Handle != global::System.IntPtr.Zero) - { - if (swigCMemOwn) - { - swigCMemOwn = false; - NDalicManualPINVOKE.delete_WidgetViewSignal(swigCPtr); - } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - } - global::System.GC.SuppressFinalize(this); - } - } - - public bool Empty() - { - bool ret = NDalicManualPINVOKE.WidgetViewSignal_Empty(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - public uint GetConnectionCount() - { - uint ret = NDalicManualPINVOKE.WidgetViewSignal_GetConnectionCount(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - public void Connect(System.Delegate func) - { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); - { - NDalicManualPINVOKE.WidgetViewSignal_Connect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - } - - public void Disconnect(System.Delegate func) - { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); - { - NDalicManualPINVOKE.WidgetViewSignal_Disconnect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - } - - public void Emit(WidgetView arg) - { - NDalicManualPINVOKE.WidgetViewSignal_Emit(swigCPtr, WidgetView.getCPtr(arg)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - public WidgetViewSignal() : this(NDalicManualPINVOKE.new_WidgetViewSignal(), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - } - -} diff --git a/src/Tizen.NUI/src/internal/WindowFocusSignalType.cs b/src/Tizen.NUI/src/internal/WindowFocusSignalType.cs index 25e5a5beb..9ac3a1354 100755 --- a/src/Tizen.NUI/src/internal/WindowFocusSignalType.cs +++ b/src/Tizen.NUI/src/internal/WindowFocusSignalType.cs @@ -116,7 +116,7 @@ namespace Tizen.NUI public void Connect(System.Delegate func) { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); { NDalicPINVOKE.WindowFocusSignalType_Connect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -125,7 +125,7 @@ namespace Tizen.NUI public void Disconnect(System.Delegate func) { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); { NDalicPINVOKE.WindowFocusSignalType_Disconnect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); diff --git a/src/Tizen.NUI/src/internal/dotnetcore/AddedException.cs b/src/Tizen.NUI/src/internal/dotnetcore/AddedException.cs new file mode 100755 index 000000000..be7d0ddda --- /dev/null +++ b/src/Tizen.NUI/src/internal/dotnetcore/AddedException.cs @@ -0,0 +1,54 @@ +/** Copyright (c) 2017 Samsung Electronics Co., Ltd. +* +* 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. +* +*/ + +namespace System +{ + public class ApplicationException : Exception + { + public ApplicationException() + { + new global::System.ApplicationException(); + } + + public ApplicationException(string message) + { + new global::System.ApplicationException(message); + } + + public ApplicationException(string message, Exception innerException) + { + new global::System.ApplicationException(message, innerException); + } + } + + public class SystemException : Exception + { + public SystemException() + { + new global::System.SystemException(); + } + + public SystemException(string message) + { + new global::System.SystemException(message); + } + + public SystemException(string message, Exception innerException) + { + new global::System.SystemException(message, innerException); + } + } +} diff --git a/src/Tizen.NUI/src/internal/dotnetcore/HandleRef.cs b/src/Tizen.NUI/src/internal/dotnetcore/HandleRef.cs new file mode 100755 index 000000000..db34d4ad9 --- /dev/null +++ b/src/Tizen.NUI/src/internal/dotnetcore/HandleRef.cs @@ -0,0 +1,55 @@ +// ==++== +// +// Copyright (c) Microsoft Corporation. All rights reserved. +// +// ==--== +namespace System.Runtime.InteropServices +{ + + using System; + + [System.Runtime.InteropServices.ComVisible(true)] + public struct HandleRef + { + + // ! Do not add or rearrange fields as the EE depends on this layout. + //------------------------------------------------------------------ + internal Object m_wrapper; + internal IntPtr m_handle; + //------------------------------------------------------------------ + + + public HandleRef(Object wrapper, IntPtr handle) + { + m_wrapper = wrapper; + m_handle = handle; + } + + public Object Wrapper + { + get + { + return m_wrapper; + } + } + + public IntPtr Handle + { + get + { + return m_handle; + } + } + + + public static explicit operator IntPtr(HandleRef value) + { + return value.m_handle; + } + + public static IntPtr ToIntPtr(HandleRef value) + { + return value.m_handle; + } + } +} diff --git a/src/Tizen.NUI/src/public/Adaptor.cs b/src/Tizen.NUI/src/public/Adaptor.cs deleted file mode 100755 index b8431748a..000000000 --- a/src/Tizen.NUI/src/public/Adaptor.cs +++ /dev/null @@ -1,518 +0,0 @@ -/** Copyright (c) 2017 Samsung Electronics Co., Ltd. -* -* 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; - -namespace Tizen.NUI -{ - /// - /// An Adaptor object is used to initialize and control how Dali runs. - /// - /// It provides the lifecycle interface that allows the application - /// writer to provide their own main loop and other platform related - /// features. - /// - /// The Adaptor class provides a means for initialising the resources required by the Dali::Core. - /// - /// When dealing with platform events, the application writer must ensure that DALi is called in a - /// thread-safe manner. - /// - /// As soon as the Adaptor class is created and started, the application writer can initialise their - /// view objects straight away or as required by the main loop they intend to use (there is no - /// need to wait for an initialize signal as per the Tizen.NUI.Application class). - /// - /// - public class Adaptor : global::System.IDisposable - { - private global::System.Runtime.InteropServices.HandleRef swigCPtr; - protected bool swigCMemOwn; - - internal Adaptor(global::System.IntPtr cPtr, bool cMemoryOwn) - { - swigCMemOwn = cMemoryOwn; - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - } - - internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Adaptor obj) - { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; - } - - //A Flag to check who called Dispose(). (By User or DisposeQueue) - private bool isDisposeQueued = false; - //A Flat to check if it is already disposed. - protected bool disposed = false; - - ~Adaptor() - { - if (!isDisposeQueued) - { - isDisposeQueued = true; - DisposeQueue.Instance.Add(this); - } - } - - public void Dispose() - { - //Throw excpetion if Dispose() is called in separate thread. - if (!Window.IsInstalled()) - { - throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread."); - } - - if (isDisposeQueued) - { - Dispose(DisposeTypes.Implicit); - } - else - { - Dispose(DisposeTypes.Explicit); - System.GC.SuppressFinalize(this); - } - } - - protected virtual void Dispose(DisposeTypes type) - { - if (disposed) - { - return; - } - - if (type == DisposeTypes.Explicit) - { - //Called by User - //Release your own managed resources here. - //You should release all of your own disposable objects here. - - } - - //Release your own unmanaged resources here. - //You should not access any managed member here except static instance. - //because the execution order of Finalizes is non-deterministic. - - if (swigCPtr.Handle != global::System.IntPtr.Zero) - { - swigCMemOwn = false; - NDalicManualPINVOKE.delete_Adaptor(swigCPtr); - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - } - - disposed = true; - } - - internal static Adaptor GetAdaptorFromPtr(global::System.IntPtr cPtr) - { - Adaptor ret = new Adaptor(cPtr, false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal static Adaptor New(Window window) - { - Adaptor ret = new Adaptor(NDalicManualPINVOKE.Adaptor_New__SWIG_0(Window.getCPtr(window)), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal static Adaptor New(Window window, SWIGTYPE_p_Configuration__ContextLoss configuration) - { - Adaptor ret = new Adaptor(NDalicManualPINVOKE.Adaptor_New__SWIG_1(Window.getCPtr(window), SWIGTYPE_p_Configuration__ContextLoss.getCPtr(configuration)), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal static Adaptor New(Any nativeWindow, SWIGTYPE_p_Dali__RenderSurface surface) - { - Adaptor ret = new Adaptor(NDalicManualPINVOKE.Adaptor_New__SWIG_2(Any.getCPtr(nativeWindow), SWIGTYPE_p_Dali__RenderSurface.getCPtr(surface)), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal static Adaptor New(Any nativeWindow, SWIGTYPE_p_Dali__RenderSurface surface, SWIGTYPE_p_Configuration__ContextLoss configuration) - { - Adaptor ret = new Adaptor(NDalicManualPINVOKE.Adaptor_New__SWIG_3(Any.getCPtr(nativeWindow), SWIGTYPE_p_Dali__RenderSurface.getCPtr(surface), SWIGTYPE_p_Configuration__ContextLoss.getCPtr(configuration)), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// Starts the adaptor. - /// - internal void Start() - { - NDalicManualPINVOKE.Adaptor_Start(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - /// - /// Pauses the adaptor. - /// - internal void Pause() - { - NDalicManualPINVOKE.Adaptor_Pause(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - /// - /// Resumes the adaptor, if previously paused. - /// - /// If the adaptor is not paused, this does not do anything. - internal void Resume() - { - NDalicManualPINVOKE.Adaptor_Resume(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - /// - /// Stops the adaptor. - /// - internal void Stop() - { - NDalicManualPINVOKE.Adaptor_Stop(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - internal bool AddIdle(SWIGTYPE_p_Dali__CallbackBase callback) - { - bool ret = NDalicManualPINVOKE.Adaptor_AddIdle(swigCPtr, SWIGTYPE_p_Dali__CallbackBase.getCPtr(callback)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal void RemoveIdle(SWIGTYPE_p_Dali__CallbackBase callback) - { - NDalicManualPINVOKE.Adaptor_RemoveIdle(swigCPtr, SWIGTYPE_p_Dali__CallbackBase.getCPtr(callback)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - internal void ReplaceSurface(Any nativeWindow, SWIGTYPE_p_Dali__RenderSurface surface) - { - NDalicManualPINVOKE.Adaptor_ReplaceSurface(swigCPtr, Any.getCPtr(nativeWindow), SWIGTYPE_p_Dali__RenderSurface.getCPtr(surface)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - internal SWIGTYPE_p_Dali__RenderSurface GetSurface() - { - SWIGTYPE_p_Dali__RenderSurface ret = new SWIGTYPE_p_Dali__RenderSurface(NDalicManualPINVOKE.Adaptor_GetSurface(swigCPtr), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal Any GetNativeWindowHandle() - { - Any ret = new Any(NDalicManualPINVOKE.Adaptor_GetNativeWindowHandle(swigCPtr), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// Releases any locks the surface may hold. - /// - /// - /// For example, after compositing an offscreen surface, use this method to allow rendering to continue. - /// - internal void ReleaseSurfaceLock() - { - NDalicManualPINVOKE.Adaptor_ReleaseSurfaceLock(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - /// - /// Sets the number of frames per render. - /// - /// The number of vsyncs between successive renders. - /// - /// Suggest this is a power of two: - /// 1 - render each vsync frame. - /// 2 - render every other vsync frame. - /// 4 - render every fourth vsync frame. - /// 8 - render every eighth vsync frame. - /// - internal void SetRenderRefreshRate(uint numberOfVSyncsPerRender) - { - NDalicManualPINVOKE.Adaptor_SetRenderRefreshRate(swigCPtr, numberOfVSyncsPerRender); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - /// - /// Sets whether the frame count per render is managed using the hardware vsync or manually timed. - /// - /// True if the hardware vsync should be used. - internal void SetUseHardwareVSync(bool useHardware) - { - NDalicManualPINVOKE.Adaptor_SetUseHardwareVSync(swigCPtr, useHardware); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - private static readonly Adaptor instance = Adaptor.Get(); - - internal static Adaptor Get() - { - Adaptor ret = new Adaptor(NDalicManualPINVOKE.Adaptor_Get(), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// Returns a reference to the instance of the adaptor used by the current thread. - /// - /// The adaptor has been initialized. This is only valid in the main thread. - public static Adaptor Instance - { - get - { - return instance; - } - } - - /// - /// Checks whether the adaptor is available. - /// - /// True if it is available, false otherwise. - internal static bool IsAvailable() - { - bool ret = NDalicManualPINVOKE.Adaptor_IsAvailable(); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// Calls this method to notify DALi when a scene is created and initialized. - /// Notify the adaptor that the scene has been created. - /// - internal void NotifySceneCreated() - { - NDalicManualPINVOKE.Adaptor_NotifySceneCreated(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - /// - /// Calls this method to notify DALi when the system language changes. - /// - /// Use this only when not using Dali::Application. As the application is created, using the - /// application will automatically receive notification of the language change. - /// When Dali::Application is not used, the application developer should - /// use app-core to receive the language change notifications and should update DALi - /// by calling this method. - /// - internal void NotifyLanguageChanged() - { - NDalicManualPINVOKE.Adaptor_NotifyLanguageChanged(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - /// - /// Sets the minimum distance in pixels that the fingers must move towards or away from each other in order to trigger a pinch gesture. - /// - /// The minimum pinch distance in pixels. - internal void SetMinimumPinchDistance(float distance) - { - NDalicManualPINVOKE.Adaptor_SetMinimumPinchDistance(swigCPtr, distance); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - internal void FeedTouchPoint(TouchPoint point, int timeStamp) - { - NDalicManualPINVOKE.Adaptor_FeedTouchPoint(swigCPtr, TouchPoint.getCPtr(point), timeStamp); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - /// - /// Feeds a wheel event to the adaptor. - /// - /// The wheel event. - public void FeedWheelEvent(Wheel wheelEvent) - { - NDalicManualPINVOKE.Adaptor_FeedWheelEvent(swigCPtr, Wheel.getCPtr(wheelEvent)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - /// - /// Feeds a key event to the adaptor. - /// - /// The key event holding the key information. - public void FeedKeyEvent(Key keyEvent) - { - NDalicManualPINVOKE.Adaptor_FeedKeyEvent(swigCPtr, Key.getCPtr(keyEvent)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - /// - /// Notifies core that the scene has been created. - /// - internal void SceneCreated() - { - NDalicManualPINVOKE.Adaptor_SceneCreated(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - internal void SetViewMode(ViewMode viewMode) - { - NDalicManualPINVOKE.Adaptor_SetViewMode(swigCPtr, (int)viewMode); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - /// - /// Sets the stereo base (eye separation) for stereoscopic 3D. - /// The stereo base is the distance in millimetres between the eyes. Typical values are - /// between 50mm and 70mm. The default value is 65mm. - /// - /// The stereo base (eye separation) for stereoscopic 3D. - internal void SetStereoBase(float stereoBase) - { - NDalicManualPINVOKE.Adaptor_SetStereoBase(swigCPtr, stereoBase); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - /// - /// Event arguments that passed via the Resized signal. - /// - internal class ResizedEventArgs : EventArgs - { - - /// - /// Adaptor - is the adaptor which has size changed. - /// - public Adaptor Adaptor - { - get; - set; - } - } - - [UnmanagedFunctionPointer(CallingConvention.StdCall)] - private delegate void ResizedCallbackDelegate(IntPtr adaptor); - private EventHandler _resizedEventHandler; - private ResizedCallbackDelegate _resizedCallbackDelegate; - - /// - /// An event for the Resized signal which can be used to subscribe or unsubscribe the event handler - /// provided by the user. The Resized signal is emitted when the size changes.
- ///
- internal event EventHandler Resized - { - add - { - if (_resizedEventHandler == null) - { - _resizedCallbackDelegate = (OnResized); - ResizedSignal().Connect(_resizedCallbackDelegate); - } - _resizedEventHandler += value; - } - remove - { - _resizedEventHandler -= value; - if (_resizedEventHandler == null && ResizedSignal().Empty() == false) - { - ResizedSignal().Disconnect(_resizedCallbackDelegate); - } - } - } - - private void OnResized(IntPtr adaptor) - { - ResizedEventArgs e = new ResizedEventArgs(); - if (adaptor != null) - { - e.Adaptor = Adaptor.GetAdaptorFromPtr(adaptor); - } - - if (_resizedEventHandler != null) - { - //here we send all data to user event handlers - _resizedEventHandler(this, e); - } - } - - internal AdaptorSignalType ResizedSignal() - { - AdaptorSignalType ret = new AdaptorSignalType(NDalicManualPINVOKE.Adaptor_ResizedSignal(swigCPtr), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// Event arguments that passed via the LanguageChanged signal. - /// - internal class LanguageChangedEventArgs : EventArgs - { - - /// - /// Adaptor - is the adaptor which has language changed. - /// - public Adaptor Adaptor - { - get; - set; - } - } - - [UnmanagedFunctionPointer(CallingConvention.StdCall)] - private delegate void LanguageChangedCallbackDelegate(IntPtr adaptor); - private EventHandler _languageChangedEventHandler; - private LanguageChangedCallbackDelegate _languageChangedCallbackDelegate; - - /// - /// An event for LanguageChanged signal which can be used to subscribe or unsubscribe the event handler - /// provided by the user. The LanguageChanged signal is emitted when the language changes.
- ///
- internal event EventHandler LanguageChanged - { - add - { - if (_languageChangedEventHandler == null) - { - _languageChangedCallbackDelegate = (OnLanguageChanged); - LanguageChangedSignal().Connect(_languageChangedCallbackDelegate); - } - _languageChangedEventHandler += value; - } - remove - { - _languageChangedEventHandler -= value; - if (_languageChangedEventHandler == null && LanguageChangedSignal().Empty() == false) - { - LanguageChangedSignal().Disconnect(_languageChangedCallbackDelegate); - } - } - } - - private void OnLanguageChanged(IntPtr adaptor) - { - LanguageChangedEventArgs e = new LanguageChangedEventArgs(); - if (adaptor != null) - { - e.Adaptor = Adaptor.GetAdaptorFromPtr(adaptor); - } - - if (_languageChangedEventHandler != null) - { - //here we send all data to user event handlers - _languageChangedEventHandler(this, e); - } - } - - internal AdaptorSignalType LanguageChangedSignal() - { - AdaptorSignalType ret = new AdaptorSignalType(NDalicManualPINVOKE.Adaptor_LanguageChangedSignal(swigCPtr), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - } - -} diff --git a/src/Tizen.NUI/src/public/AlphaFunction.cs b/src/Tizen.NUI/src/public/AlphaFunction.cs index 41c608894..ed3563306 100755 --- a/src/Tizen.NUI/src/public/AlphaFunction.cs +++ b/src/Tizen.NUI/src/public/AlphaFunction.cs @@ -54,7 +54,7 @@ namespace Tizen.NUI } } /// - /// To make the AlphaFunction instance be disposed. + /// To make AlphaFunction instance be disposed. /// public void Dispose() { @@ -106,17 +106,17 @@ namespace Tizen.NUI } /// - /// The constructor.
- /// Creates an alpha function object with the user-defined alpha function.
+ /// Constructor.
+ /// Creates an alpha function object with user defined alpha function.
///
/// User defined fuction. It must be a method formatted as float alphafunction(float progress) - public AlphaFunction(System.Delegate func) : this(NDalicPINVOKE.new_AlphaFunction__SWIG_2(SWIGTYPE_p_f_float__float.getCPtr(new SWIGTYPE_p_f_float__float(System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func), true))), true) + public AlphaFunction(System.Delegate func) : this(NDalicPINVOKE.new_AlphaFunction__SWIG_2(SWIGTYPE_p_f_float__float.getCPtr(new SWIGTYPE_p_f_float__float(System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func), true))), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } /// - /// The default constructor.
+ /// Default constructor.
/// Creates an alpha function object with the default built-in alpha function.
///
public AlphaFunction() : this(NDalicPINVOKE.new_AlphaFunction__SWIG_0(), true) @@ -125,10 +125,10 @@ namespace Tizen.NUI } /// - /// The constructor.
+ /// Constructor.
/// Creates an alpha function object with the built-in alpha function passed as a parameter to the constructor.
///
- /// One of the built-in alpha functions. + /// One of the built-in alpha functions public AlphaFunction(AlphaFunction.BuiltinFunctions function) : this(NDalicPINVOKE.new_AlphaFunction__SWIG_1((int)function), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -140,12 +140,12 @@ namespace Tizen.NUI } /// - /// The constructor.
- /// Creates a bezier alpha function. The bezier will have the first point at (0,0) and the end point at (1,1).
+ /// Constructor.
+ /// Creates a bezier alpha function.The bezier will have the first point at(0,0) and the end point at(1,1).
///
- /// The x components of the control points will be clamped to the range [0, 1] to prevent non-monotonic curves. - /// A Vector2 which will be used as the first control point of the curve. - /// A Vector2 which will be used as the second control point of the curve. + /// The x components of the control points will be clamped to the range[0, 1] to prevent non monotonic curves. + /// A Vector2 which will be used as the first control point of the curve + /// A Vector2 which will be used as the second control point of the curve public AlphaFunction(Vector2 controlPoint0, Vector2 controlPoint1) : this(NDalicPINVOKE.new_AlphaFunction__SWIG_3(Vector2.getCPtr(controlPoint0), Vector2.getCPtr(controlPoint1)), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -154,8 +154,8 @@ namespace Tizen.NUI /// /// Retrives the control points of the alpha function.
///
- /// A Vector2 which will be used as the first control point of the curve. - /// A Vector2 which will be used as the second control point of the curve. + /// A Vector2 which is used as the first control point of the curve + /// A Vector2 which is used as the second control point of the curve public void GetBezierControlPoints(out Vector2 controlPoint0, out Vector2 controlPoint1) { Vector4 ret = new Vector4(NDalicPINVOKE.AlphaFunction_GetBezierControlPoints(swigCPtr), true); @@ -186,9 +186,9 @@ namespace Tizen.NUI } /// - /// Returns the functioning mode of the alpha function. + /// Returns the functioning mode of the alpha function /// - /// The functioning mode of the alpha function. + /// The functioning mode of the alpha function public AlphaFunction.Modes GetMode() { AlphaFunction.Modes ret = (AlphaFunction.Modes)NDalicPINVOKE.AlphaFunction_GetMode(swigCPtr); @@ -197,71 +197,71 @@ namespace Tizen.NUI } /// - /// This specifies the various types of BuiltinFunctions. + /// This specifies the various types of BuiltinFunctions /// public enum BuiltinFunctions { /// - /// Linear. + /// Linear /// Default, /// - /// No transformation. + /// No transformation /// Linear, /// - /// Reverse linear. + /// Reverse linear /// Reverse, /// - /// Speeds up and comes to a sudden stop (square). + /// Speeds up and comes to a sudden stop (Square) /// EaseInSquare, /// - /// Sudden start and slows to a gradual stop (square). + /// Sudden start and slows to a gradual stop (Square) /// EaseOutSquare, /// - /// Speeds up and comes to a sudden stop (cubic). + /// Speeds up and comes to a sudden stop (Cubic) /// EaseIn, /// - /// Sudden start and slows to a gradual stop (cubic). + /// Sudden start and slows to a gradual stop (Cubic) /// EaseOut, /// - /// Speeds up and slows to a gradual stop (cubic). + /// Speeds up and slows to a gradual stop (Cubic) /// EaseInOut, /// - /// Speeds up and comes to a sudden stop (sinusoidal). + /// Speeds up and comes to a sudden stop (sinusoidal) /// EaseInSine, /// - /// Sudden start and slows to a gradual stop (sinusoidal). + /// Sudden start and slows to a gradual stop (sinusoidal) /// EaseOutSine, /// - /// Speeds up and slows to a gradual stop (sinusoidal). + /// Speeds up and slows to a gradual stop (sinusoidal) /// EaseInOutSine, /// - /// Sudden start, loses momentum and returns to start position. + /// Sudden start, loses momentum and returns to start position /// Bounce, /// - /// Single revolution. + /// Single revolution /// Sin, /// - /// Sudden start, exceed end position and return to a gradual stop. + /// Sudden start, exceed end position and return to a gradual stop /// EaseOutBack, Count } /// - /// This specifies which mode is set for AlphaFunction. + /// This specifies which mode is set for AlphaFuction /// public enum Modes { @@ -271,11 +271,11 @@ namespace Tizen.NUI BuiltinFunction, /// - /// The user has provided a custom function. + /// The user has provided a custom function /// CustomFunction, /// - /// The user has provided the control points of a bezier curve. + /// The user has provided the control points of a bezier curve /// Bezier } diff --git a/src/Tizen.NUI/src/public/Animatable.cs b/src/Tizen.NUI/src/public/Animatable.cs index b5c056e8e..5859e850e 100755 --- a/src/Tizen.NUI/src/public/Animatable.cs +++ b/src/Tizen.NUI/src/public/Animatable.cs @@ -86,7 +86,9 @@ namespace Tizen.NUI public int GetPropertyIndex(string name) { - int ret = NDalicPINVOKE.Handle_GetPropertyIndex(swigCPtr, name); + string daliPropertyName = name.Substring(0, 1).ToLower() + name.Substring(1); + + int ret = NDalicPINVOKE.Handle_GetPropertyIndex(swigCPtr, daliPropertyName); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } diff --git a/src/Tizen.NUI/src/public/Animation.cs b/src/Tizen.NUI/src/public/Animation.cs index 5c2b2575e..312ad0812 100755 --- a/src/Tizen.NUI/src/public/Animation.cs +++ b/src/Tizen.NUI/src/public/Animation.cs @@ -24,11 +24,11 @@ namespace Tizen.NUI using Tizen.NUI.BaseComponents; /// - /// Animation can be used to animate the properties of any number of objects, typically view.
+ /// Animation can be used to animate the properties of any number of objects, typically View.
/// If the "Finished" event is connected to a member function of an object, it must be disconnected before the object is destroyed.
- /// This is typically done in the object destructor, and requires either the animation handle to be stored.
+ /// This is typically done in the object destructor, and requires either the Animation handle to be stored.
/// The overall animation time is superseded by the values given in the animation time used when calling the AnimateTo(), AnimateBy(), AnimateBetween() and AnimatePath() methods.
- /// If any of the individual calls to those functions exceeds the overall animation time (Duration), then the overall animation time is automatically extended.
+ /// If any of the individual calls to those functions exceeds the overall animation time(Duration), then the overall animation time is automatically extended.
///
public class Animation : BaseHandle { @@ -45,7 +45,7 @@ namespace Tizen.NUI } /// - /// To make animation instance be disposed. + /// To make Animation instance be disposed. /// protected override void Dispose(DisposeTypes type) { @@ -53,16 +53,12 @@ namespace Tizen.NUI { return; } + if(type == DisposeTypes.Explicit) { //Called by User //Release your own managed resources here. //You should release all of your own disposable objects here. - - } - else if(type == DisposeTypes.Implicit) - { - } if (_animationFinishedEventCallback != null) @@ -76,14 +72,6 @@ namespace Tizen.NUI ProgressReachedSignal().Disconnect(_animationProgressReachedEventCallback); } - if(this) - { - this.Clear(); - this.Reset(); - NUILog.Error("Now Animation is playing! Clear and Reset here!"); - //throw new System.InvalidOperationException("Animation Instance should not be disposed until getting Finished event. Should be a global variable"); - } - //Release your own unmanaged resources here. //You should not access any managed member here except static instance. //because the execution order of Finalizes is non-deterministic. @@ -102,13 +90,13 @@ namespace Tizen.NUI } /// - /// Creates an initialized animation.
+ /// Create an initialized Animation.
/// The animation will not loop.
/// The default end action is "Cancel".
- /// The default alpha function is linear.
+ /// The default Alpha function is linear.
///
/// DurationmSeconds must be greater than zero. - /// The duration in milliseconds. + /// The duration in milli seconds. public Animation(int durationMilliSeconds) : this(NDalicPINVOKE.Animation_New((float)durationMilliSeconds / 1000.0f), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -119,8 +107,8 @@ namespace Tizen.NUI private delegate void AnimationFinishedEventCallbackType(IntPtr data); private event EventHandler _animationFinishedEventHandler; /** - * @brief Event for the finished signal which can be used to subscribe or unsubscribe the event handler. - * The finished signal is emitted when an animation's animations have finished. + * @brief Event for Finished signal which can be used to subscribe/unsubscribe the event handler. + * Finished signal is emitted when an Animation's animations have finished. */ public event EventHandler Finished { @@ -128,11 +116,18 @@ namespace Tizen.NUI { if (_animationFinishedEventHandler == null) { - NUILog.Debug("[add before]FinishedSignal().Empty=" + FinishedSignal().Empty() + " GetConnectionCount=" + FinishedSignal().GetConnectionCount()); +#if DEBUG_ON + Tizen.Log.Debug("NUI", "con1) FinishedSignal().Empty = " + FinishedSignal().Empty()); + Tizen.Log.Debug("NUI", "con2) FinishedSignal().GetConnectionCount = " + FinishedSignal().GetConnectionCount()); +#endif _animationFinishedEventCallback = OnFinished; FinishedSignal().Connect(_animationFinishedEventCallback); - NUILog.Debug("[add after]FinishedSignal().Empty=" + FinishedSignal().Empty() + " GetConnectionCount=" + FinishedSignal().GetConnectionCount()); +#if DEBUG_ON + Tizen.Log.Debug("NUI", "con3) FinishedSignal().Empty = " + FinishedSignal().Empty()); + Tizen.Log.Debug("NUI", "con4) FinishedSignal().GetConnectionCount = " + FinishedSignal().GetConnectionCount()); +#endif } + _animationFinishedEventHandler += value; } remove @@ -141,9 +136,15 @@ namespace Tizen.NUI if (_animationFinishedEventHandler == null && FinishedSignal().Empty() == false) { - NUILog.Debug("[remove before]FinishedSignal().Empty=" + FinishedSignal().Empty() + " GetConnectionCount=" + FinishedSignal().GetConnectionCount()); +#if DEBUG_ON + Tizen.Log.Debug("NUI", "discon1) FinishedSignal().Empty = " + FinishedSignal().Empty()); + Tizen.Log.Debug("NUI", "discon2) FinishedSignal().GetConnectionCount = " + FinishedSignal().GetConnectionCount()); +#endif FinishedSignal().Disconnect(_animationFinishedEventCallback); - NUILog.Debug("[remove after]FinishedSignal().Empty=" + FinishedSignal().Empty() + " GetConnectionCount=" + FinishedSignal().GetConnectionCount()); +#if DEBUG_ON + Tizen.Log.Debug("NUI", "discon3) FinishedSignal().Empty = " + FinishedSignal().Empty()); + Tizen.Log.Debug("NUI", "discon4) FinishedSignal().GetConnectionCount = " + FinishedSignal().GetConnectionCount()); +#endif } } } @@ -161,8 +162,8 @@ namespace Tizen.NUI private AnimationProgressReachedEventCallbackType _animationProgressReachedEventCallback; private event EventHandler _animationProgressReachedEventHandler; /** - * @brief Event for the ProgressReached signal, which can be used to subscribe or unsubscribe the event handler. - * The ProgressReached signal is emitted when the animation has reached a given progress percentage, this is set in the api SetProgressNotification. + * @brief Event for ProgressReached signal which can be used to subscribe/unsubscribe the event handler. + * ProgressReached signal is emitted when the Animation has reached a given progress percentage, this is set in the api SetProgressNotification. */ public event EventHandler ProgressReached { @@ -170,10 +171,16 @@ namespace Tizen.NUI { if (_animationProgressReachedEventHandler == null) { - NUILog.Debug("[add before]ProgressReachedSignal().Empty=" + FinishedSignal().Empty() + " GetConnectionCount=" + FinishedSignal().GetConnectionCount()); +#if DEBUG_ON + Tizen.Log.Debug("NUI", "con1) ProgressReachedSignal().Empty = " + ProgressReachedSignal().Empty()); + Tizen.Log.Debug("NUI", "con2) ProgressReachedSignal().GetConnectionCount = " + ProgressReachedSignal().GetConnectionCount()); +#endif _animationProgressReachedEventCallback = OnProgressReached; ProgressReachedSignal().Connect(_animationProgressReachedEventCallback); - NUILog.Debug("[add after]ProgressReachedSignal().Empty=" + FinishedSignal().Empty() + " GetConnectionCount=" + FinishedSignal().GetConnectionCount()); +#if DEBUG_ON + Tizen.Log.Debug("NUI", "con3) ProgressReachedSignal().Empty = " + ProgressReachedSignal().Empty()); + Tizen.Log.Debug("NUI", "con4) ProgressReachedSignal().GetConnectionCount = " + ProgressReachedSignal().GetConnectionCount()); +#endif } _animationProgressReachedEventHandler += value; @@ -184,9 +191,15 @@ namespace Tizen.NUI if (_animationProgressReachedEventHandler == null && ProgressReachedSignal().Empty() == false) { - NUILog.Debug("[remove before]ProgressReachedSignal().Empty=" + FinishedSignal().Empty() + " GetConnectionCount=" + FinishedSignal().GetConnectionCount()); +#if DEBUG_ON + Tizen.Log.Debug("NUI", "discon1) ProgressReachedSignal().Empty = " + ProgressReachedSignal().Empty()); + Tizen.Log.Debug("NUI", "discon2) ProgressReachedSignal().GetConnectionCount = " + ProgressReachedSignal().GetConnectionCount()); +#endif ProgressReachedSignal().Disconnect(_animationProgressReachedEventCallback); - NUILog.Debug("[remove after]ProgressReachedSignal().Empty=" + FinishedSignal().Empty() + " GetConnectionCount=" + FinishedSignal().GetConnectionCount()); +#if DEBUG_ON + Tizen.Log.Debug("NUI", "discon3) ProgressReachedSignal().Empty = " + ProgressReachedSignal().Empty()); + Tizen.Log.Debug("NUI", "discon4) ProgressReachedSignal().GetConnectionCount = " + ProgressReachedSignal().GetConnectionCount()); +#endif } } } @@ -211,7 +224,7 @@ namespace Tizen.NUI /// - /// Gets or sets the duration in milliseconds of the animation. + /// Gets/Sets the duration in milli seconds of the animation. /// public int Duration { @@ -226,7 +239,7 @@ namespace Tizen.NUI } /// - /// Gets or sets the default alpha function for the animation. + /// Gets/Sets the default alpha function for the animation. /// public AlphaFunction DefaultAlphaFunction { @@ -253,10 +266,10 @@ namespace Tizen.NUI } /// - /// Set: Enables looping for 'count' repeats. A zero is the same as Looping = true; i.e., repeat forever.
+ /// Set : Enables looping for 'count' repeats. A zero is the same as Looping = true; i.e.repeat forever.
/// If Play() Stop() or 'count' loops is reached, the loop counter will reset.
/// Setting this parameter does not cause the animation to Play().
- /// Get: Gets the loop count. A zero is the same as Looping = true; i.e., repeat forever.
+ /// Get : Gets the loop count. A zero is the same as Looping = true; ie repeat forever.
/// The loop count is initially 1 for play once.
///
public int LoopCount @@ -273,8 +286,8 @@ namespace Tizen.NUI } /// - /// Gets or sets the status of whether the animation will loop.
- /// This property resets the loop count and should not be used with the LoopCount property.
+ /// Gets/Sets the status of whether the animation will loop.
+ /// This property resets the loop count and should not be used with LoopCount property.
/// Setting this parameter does not cause the animation to Play().
///
public bool Looping @@ -292,9 +305,9 @@ namespace Tizen.NUI /// - /// Gets or sets the end action of the animation.
+ /// Gets/Sets the end action of the animation.
/// This action is performed when the animation ends or if it is stopped.
- /// The default end action is cancel.
+ /// Default end action is Cancel.
///
public EndActions EndAction { @@ -312,7 +325,7 @@ namespace Tizen.NUI /// /// Stops the animation. /// - /// The end action can be set. + /// end action can be set public void Stop(EndActions action = EndActions.Cancel) { SetEndAction(action); @@ -333,9 +346,9 @@ namespace Tizen.NUI } /// - /// Gets or sets the disconnect action.
+ /// Gets/Sets the disconnect action.
/// If any of the animated property owners are disconnected from the stage while the animation is being played, then this action is performed.
- /// The default action is cancel.
+ /// Default action is to Cancel.
///
public EndActions DisconnectAction { @@ -354,9 +367,9 @@ namespace Tizen.NUI /// - /// Gets or sets the progress of the animation.
- /// The animation will play (or continue playing) from this point.
- /// The progress must be in the 0-1 interval or in the play range interval if defined
+ /// Gets/Sets the progress of the animation.
+ /// The animation will play(or continue playing) from this point.
+ /// The progress must be in the 0-1 interval or in the play range interval if defined.
/// otherwise, it will be ignored.
///
public float CurrentProgress @@ -375,9 +388,9 @@ namespace Tizen.NUI } /// - /// Gets or sets specificifications of a speed factor for the animation.
+ /// Gets/Sets Specifies a speed factor for the animation.
/// The speed factor is a multiplier of the normal velocity of the animation.
- /// Values between [0, 1] will slow down the animation and values above one will speed up the animation.
+ /// Values between[0, 1] will slow down the animation and values above one will speed up the animation.
/// It is also possible to specify a negative multiplier to play the animation in reverse.
///
public float SpeedFactor @@ -396,9 +409,9 @@ namespace Tizen.NUI } /// - /// Gets or sets the playing range.
- /// Animation will play between the values specified. Both values (range.x and range.y ) should be between 0-1, - /// otherwise they will be ignored. If the range provided is not in proper order (minimum, maximum ), it will be reordered.
+ /// Gets/Sets the playing range.
+ /// Animation will play between the values specified. Both values(range.x and range.y ) should be between 0-1, + /// otherwise they will be ignored.If the range provided is not in proper order(minimum, maximum ), it will be reordered.
///
public RelativeVector2 PlayRange { @@ -417,9 +430,9 @@ namespace Tizen.NUI /// - /// Gets or sets the progress notification marker which triggers the ProgressReachedSignal.
- /// Percentage of animation progress should be greater than 0 and less than 1, for example, 0.3 for 30%
- /// One notification can be set on each animation. + /// Gets/Sets the Progress notification marker which triggers the ProgressReachedSignal.
+ /// percentage of animation progress should be greater than 0 and less than 1, e.g 0.3 for 30%
+ /// One notification can be set on each animation ///
public float ProgressNotification { @@ -439,10 +452,10 @@ namespace Tizen.NUI /// /// Animates a property value by a relative amount.
///
- /// The target object to animate. - /// The target property to animate. - /// The property value will change by this amount. - /// The alpha function to apply. + /// The target object to animate + /// The target property to animate + /// The property value will change by this amount + /// The alpha function to apply public void AnimateBy(View target, string property, object relativeValue, AlphaFunction alphaFunction = null) { Property _prop = PropertyHelper.GetPropertyFromString(target, property); @@ -473,12 +486,12 @@ namespace Tizen.NUI /// /// Animates a property value by a relative amount.
///
- /// The target object to animate. - /// The target property to animate. - /// The property value will change by this amount. - /// The start time of the animation. - /// The end time of the animation. - /// The alpha function to apply. + /// The target object to animate + /// The target property to animate + /// The property value will change by this amount + /// Start time of animation + /// End time of animation + /// The alpha function to apply public void AnimateBy(View target, string property, object relativeValue, int startTime, int endTime, AlphaFunction alphaFunction = null) { Property _prop = PropertyHelper.GetPropertyFromString(target, property); @@ -511,10 +524,10 @@ namespace Tizen.NUI /// /// Animates a property to a destination value.
///
- /// The target object to animate. - /// The target property to animate. - /// The destination value. - /// The alpha function to apply. + /// The target object to animate + /// The target property to animate + /// The destination value + /// The alpha function to apply public void AnimateTo(View target, string property, object destinationValue, AlphaFunction alphaFunction = null) { Property _prop = PropertyHelper.GetPropertyFromString(target, property); @@ -545,13 +558,13 @@ namespace Tizen.NUI /// /// Animates a property to a destination value.
///
- /// The target object to animate. - /// The target property to animate. - /// The destination value. - /// The alpha function to apply. - /// The start time of the animation. - /// The end time of the animation. - /// The alpha function to apply. + /// The target object to animate + /// The target property to animate + /// The destination value + /// The alpha function to apply + /// Start time of animation + /// End time of animation + /// The alpha function to apply public void AnimateTo(View target, string property, object destinationValue, int startTime, int endTime, AlphaFunction alphaFunction = null) { Property _prop = PropertyHelper.GetPropertyFromString(target, property); @@ -584,11 +597,11 @@ namespace Tizen.NUI /// /// Animates a property between keyframes. /// - /// The target object to animate. - /// The target property to animate. - /// The set of time or value pairs between which to animate. - /// The method used to interpolate between values. - /// The alpha function to apply. + /// The target object to animate + /// The target property to animate + /// The set of time/value pairs between which to animate + /// The method used to interpolate between values + /// The alpha function to apply public void AnimateBetween(View target, string property, KeyFrames keyFrames, Interpolation interpolation = Interpolation.Linear, AlphaFunction alphaFunction = null) { Property _prop = PropertyHelper.GetPropertyFromString(target, property); @@ -615,10 +628,10 @@ namespace Tizen.NUI /// The target object to animate /// The target property to animate /// The set of time/value pairs between which to animate - /// The start time of animation in milliseconds. - /// The end time of animation in milliseconds. - /// The method used to interpolate between values. - /// The alpha function to apply. + /// Start time of animation in milli seconds + /// End time of animation in milli seconds + /// The method used to interpolate between values + /// The alpha function to apply public void AnimateBetween(View target, string property, KeyFrames keyFrames, int startTime, int endTime, Interpolation interpolation = Interpolation.Linear, AlphaFunction alphaFunction = null) { Property _prop = PropertyHelper.GetPropertyFromString(target, property); @@ -635,14 +648,14 @@ namespace Tizen.NUI } /// - /// Animates the view's position and orientation through a predefined path.
+ /// Animates an view's position and orientation through a predefined path.
/// The view will rotate to orient the supplied forward vector with the path's tangent.
/// If forward is the zero vector then no rotation will happen.
///
- /// The view to animate. - /// It defines position and orientation. - /// The vector (in local space coordinate system) will be oriented with the path's tangent direction. - /// The alpha function to apply. + /// The view to animate + /// It defines position and orientation + /// The vector (in local space coordinate system) that will be oriented with the path's tangent direction + /// The alpha function to apply public void AnimatePath(View view, Path path, Vector3 forward, AlphaFunction alphaFunction = null) { if (alphaFunction == null) @@ -656,16 +669,16 @@ namespace Tizen.NUI } /// - /// Animates the view's position and orientation through a predefined path.
+ /// Animates an view's position and orientation through a predefined path.
/// The view will rotate to orient the supplied forward vector with the path's tangent.
/// If forward is the zero vector then no rotation will happen.
///
- /// The view to animate. - /// It defines position and orientation. - /// The vector (in local space coordinate system) will be oriented with the path's tangent direction. - /// The start time of the animation. - /// The end time of the animation. - /// The alpha function to apply. + /// The view to animate + /// It defines position and orientation + /// The vector (in local space coordinate system) that will be oriented with the path's tangent direction + /// Start time of animation + /// End time of animation + /// The alpha function to apply public void AnimatePath(View view, Path path, Vector3 forward, int startTime, int endTime, AlphaFunction alphaFunction = null) { TimePeriod time = new TimePeriod(MilliSecondsToSeconds(startTime), MilliSecondsToSeconds(endTime - startTime)); @@ -680,7 +693,7 @@ namespace Tizen.NUI } /// - /// Creates an initialized animation.
+ /// Creates an initialized Animation.
/// The animation will not loop.
/// The default end action is "Cancel".
/// The default alpha function is linear.
@@ -697,12 +710,12 @@ namespace Tizen.NUI } /// - /// Downcasts a handle to animation handle.
- /// If handle points to an animation object, the downcast produces a valid handle.
+ /// Downcasts a handle to Animation handle.
+ /// If handle points to an Animation object, the downcast produces valid handle.
/// If not, the returned handle is left uninitialized.
///
- /// Handle to an object. - /// Handle to an animation object or an uninitialized handle. + /// Handle to an object + /// Handle to an Animation object or an uninitialized handle public static Animation DownCast(BaseHandle handle) { Animation ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as Animation; @@ -846,23 +859,6 @@ namespace Tizen.NUI return ret; } - private static bool? disableAnimation = null; - private bool DisableAnimation - { - get - { - if (disableAnimation.HasValue == false) - { - string type = Environment.GetEnvironmentVariable("PlatformSmartType"); - if (type == "Entry") - disableAnimation = true; - else - disableAnimation = false; - } - return disableAnimation.Value; - } - } - /// /// Plays the animation. /// @@ -870,9 +866,9 @@ namespace Tizen.NUI { NDalicPINVOKE.Animation_Play(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - - if (DisableAnimation == true) - Stop(EndActions.StopFinal); +#if DISABLE_ANIMATION + Stop(EndActions.StopFinal); +#endif } /// @@ -880,7 +876,7 @@ namespace Tizen.NUI /// The progress must be in the 0-1 interval or in the play range interval if defined, /// otherwise, it will be ignored.
///
- /// A value between [0,1], or between the play range if specified, from where the animation should start playing. + /// A value between [0,1], or between the play range if specified, from where the animation should start playing public void PlayFrom(float progress) { NDalicPINVOKE.Animation_PlayFrom(swigCPtr, progress); @@ -888,11 +884,11 @@ namespace Tizen.NUI } /// - /// Plays the animation after a given delay time.
+ /// Play the animation after a given delay time.
/// The delay time is not included in the looping time.
- /// When the delay time is a negative value, it would treat as play immediately.
+ /// When the delay time is negative value, it would treat as play immediately.
///
- /// The delay time. + /// The delay time public void PlayAfter(int delayMilliseconds) { NDalicPINVOKE.Animation_PlayAfter(swigCPtr, MilliSecondsToSeconds(delayMilliseconds)); @@ -1081,7 +1077,7 @@ namespace Tizen.NUI } /// - /// Enumeration for what to do when the animation ends, stopped, or destroyed. + /// Enumeration for what to do when the animation ends, is stopped, or is destroyed. /// public enum EndActions { @@ -1094,7 +1090,7 @@ namespace Tizen.NUI ///
Discard, /// - /// If the animation is stopped, the animated property values are saved as if the animation had run to completion, otherwise behaves like cancel. + /// If the animation is stopped, the animated property values are saved as if the animation had run to completion, otherwise behaves like Cancel. /// StopFinal } @@ -1117,19 +1113,19 @@ namespace Tizen.NUI /// /// Enumeration for what state the animation is in. /// - /// Calling Reset() on this class will not reset the animation. It will call the BaseHandle.Reset() which drops the object handle. + /// Calling Reset() on this class will NOT reset the animation. It will call BaseHandle.Reset() which drops the object handle. public enum States { /// - /// The animation has stopped. + /// Animation has stopped /// Stopped, /// - /// The animation is playing. + /// The animation is playing /// Playing, /// - /// The animation is paused. + /// The animation is paused /// Paused } diff --git a/src/Tizen.NUI/src/public/BaseComponents/CustomView.cs b/src/Tizen.NUI/src/public/BaseComponents/CustomView.cs index cc5b0a825..3f2d16575 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/CustomView.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/CustomView.cs @@ -74,9 +74,9 @@ namespace Tizen.NUI.BaseComponents } /// - /// Sets the background with a property map. + /// Set the background with a property map. /// - /// The background property map. + /// The background property map public void SetBackground(Tizen.NUI.PropertyMap map) { viewWrapperImpl.SetBackground(map); @@ -84,9 +84,9 @@ namespace Tizen.NUI.BaseComponents /// /// Allows deriving classes to enable any of the gesture detectors that are available.
- /// Gesture detection can be enabled one at a time or in a bitwise format.
+ /// Gesture detection can be enabled one at a time or in bitwise format.
///
- /// The gesture type(s) to enable. + /// The gesture type(s) to enable public void EnableGestureDetection(Gesture.GestureType type) { viewWrapperImpl.EnableGestureDetection(type); @@ -96,7 +96,7 @@ namespace Tizen.NUI.BaseComponents /// Allows deriving classes to disable any of the gesture detectors.
/// Like EnableGestureDetection, this can also be called using bitwise or one at a time.
///
- /// The gesture type(s) to disable. + /// The gesture type(s) to disable internal void DisableGestureDetection(Gesture.GestureType type) { viewWrapperImpl.DisableGestureDetection(type); @@ -104,7 +104,7 @@ namespace Tizen.NUI.BaseComponents /// /// Sets whether this control supports two dimensional keyboard navigation - /// (i.e., whether it knows how to handle the keyboard focus movement between its child views).
+ /// (i.e. whether it knows how to handle the keyboard focus movement between its child views).
/// The control doesn't support it by default.
///
/// Whether this control supports two dimensional keyboard navigation. @@ -126,9 +126,9 @@ namespace Tizen.NUI.BaseComponents } /// - /// Gets whether this control supports two-dimensional keyboard navigation. + /// Gets whether this control supports two dimensional keyboard navigation. /// - /// True if this control supports two-dimensional keyboard navigation. + /// true if this control supports two dimensional keyboard navigation internal bool IsKeyboardNavigationSupported() { return viewWrapperImpl.IsKeyboardNavigationSupported(); @@ -136,9 +136,9 @@ namespace Tizen.NUI.BaseComponents /// - /// Sets or gets whether this control is a focus group for keyboard navigation. + /// Sets or Gets whether this control is a focus group for keyboard navigation. /// - /// True if this control is set as a focus group for keyboard navigation. + /// true if this control is set as a focus group for keyboard navigation public bool FocusGroup { get @@ -153,9 +153,9 @@ namespace Tizen.NUI.BaseComponents /// /// Sets whether this control is a focus group for keyboard navigation. - /// (i.e., the scope of keyboard focus movement can be limitied to its child views). The control is not a focus group by default. + /// (i.e. the scope of keyboard focus movement can be limitied to its child views). The control is not a focus group by default. /// - /// Whether this control is set as a focus group for keyboard navigation. + /// Whether this control is set as a focus group for keyboard navigation internal void SetAsKeyboardFocusGroup(bool isFocusGroup) { viewWrapperImpl.SetAsFocusGroup(isFocusGroup); @@ -170,7 +170,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// Called by the AccessibilityManager to activate the control. + /// Called by the AccessibilityManager to activate the Control. /// internal void AccessibilityActivate() { @@ -188,18 +188,18 @@ namespace Tizen.NUI.BaseComponents /// /// Called by the KeyInputFocusManager to emit key event signals. /// - /// The key event. - /// True if the event was consumed. + /// The key event + /// True if the event was consumed internal bool EmitKeyEventSignal(Key key) { return viewWrapperImpl.EmitKeyEventSignal(key); } /// - /// Requests a relayout, which means performing a size negotiation on this view, its parent, and children (and potentially whole scene).
+ /// Request a relayout, which means performing a size negotiation on this view, its parent and children (and potentially whole scene).
/// This method can also be called from a derived class every time it needs a different size.
- /// At the end of event processing, the relayout process starts and all controls which requested relayout will have their sizes (re)negotiated.
- /// It can be called multiple times; the size negotiation is still only performed once, i.e., there is no need to keep track of this in the calling side.
+ /// At the end of event processing, the relayout process starts and all controls which requested Relayout will have their sizes (re)negotiated.
+ /// It can be called multiple times; the size negotiation is still only performed once, i.e. there is no need to keep track of this in the calling side.
/// protected void RelayoutRequest() { @@ -207,95 +207,95 @@ namespace Tizen.NUI.BaseComponents } /// - /// Provides the view implementation of GetHeightForWidth. + /// Provides the View implementation of GetHeightForWidth. /// - /// The width to use. - /// The height based on the width. + /// Width to use + /// The height based on the width protected float GetHeightForWidthBase(float width) { return viewWrapperImpl.GetHeightForWidthBase(width); } /// - /// Provides the view implementation of GetWidthForHeight. + /// Provides the View implementation of GetWidthForHeight. /// - /// The height to use. - /// The width based on the height. + /// Height to use + /// The width based on the height protected float GetWidthForHeightBase(float height) { return viewWrapperImpl.GetWidthForHeightBase(height); } /// - /// Calculates the size for a child using the base view object. + /// Calculate the size for a child using the base view object. /// - /// The child view to calculate the size for. - /// The dimension to calculate the size, for example, the width or the height. - /// Return the calculated size for the given dimension. If more than one dimension is requested, just return the first one found. + /// The child view to calculate the size for + /// The dimension to calculate the size for. E.g. width or height + /// Return the calculated size for the given dimension. If more than one dimension is requested, just return the first one found protected float CalculateChildSizeBase(View child, DimensionType dimension) { return viewWrapperImpl.CalculateChildSizeBase(child, dimension); } /// - /// Determines if this view is dependent on it's children for relayout from the base class. + /// Determine if this view is dependent on it's children for relayout from the base class. /// - /// The dimension(s) to check for. - /// Return if the view is dependent on it's children. + /// The dimension(s) to check for + /// Return if the view is dependent on it's children protected bool RelayoutDependentOnChildrenBase(DimensionType dimension) { return viewWrapperImpl.RelayoutDependentOnChildrenBase(dimension); } /// - /// Determines if this view is dependent on it's children for relayout from the base class. + /// Determine if this view is dependent on it's children for relayout from the base class. /// - /// Return if the view is dependent on it's children. + /// Return if the view is dependent on it's children protected bool RelayoutDependentOnChildrenBase() { return viewWrapperImpl.RelayoutDependentOnChildrenBase(); } /// - /// Registers a visual by property index, linking a view to visual when required.
- /// In the case of the visual being a view or control deeming visual not required, then the visual should be an empty handle.
- /// No parenting is done during registration, this should be done by a derived class.
+ /// Register a visual by Property Index, linking an View to visual when required.
+ /// In the case of the visual being an view or control deeming visual not required then visual should be an empty handle.
+ /// No parenting is done during registration, this should be done by derived class.
///
- /// The property index of the visual used to reference visual. - /// The visual to register. + /// The Property index of the visual, used to reference visual + /// The visual to register protected void RegisterVisual(int index, VisualBase visual) { viewWrapperImpl.RegisterVisual(index, visual); } /// - /// Registers a visual by the property index, linking a view to visual when required.
- /// In the case of the visual being a view or control deeming visual not required, then the visual should be an empty handle.
- /// If enabled is false, then the visual is not set on the stage until enabled by the derived class.
+ /// Register a visual by Property Index, linking an View to visual when required.
+ /// In the case of the visual being an view or control deeming visual not required then visual should be an empty handle.
+ /// If enabled is false then the visual is not set on stage until enabled by the derived class.
///
- /// The property index of the visual used to reference visual. - /// The visual to register. - /// False if derived class wants to control when the visual is set on the stage. + /// The Property index of the visual, used to reference visual + /// The visual to register + /// false if derived class wants to control when visual is set on stage protected void RegisterVisual(int index, VisualBase visual, bool enabled) { viewWrapperImpl.RegisterVisual(index, visual, enabled); } /// - /// Erases the entry matching the given index from the list of registered visuals. + /// Erase the entry matching the given index from the list of registered visuals. /// - /// The property index of the visual used to reference visual. + /// The Property index of the visual, used to reference visual protected void UnregisterVisual(int index) { viewWrapperImpl.UnregisterVisual(index); } /// - /// Retrieves the visual associated with the given property index.
- /// For managing the object lifecycle, do not store the returned visual as a member which increments its reference count.
+ /// Retrieve the visual associated with the given property index.
+ /// For managing object life-cycle, do not store the returned visual as a member which increments its reference count.
///
- /// The property index of the visual used to reference visual. - /// The registered visual if exists, otherwise an empty handle. + /// The Property index of the visual, used to reference visual + /// The registered visual if exist, otherwise empty handle protected VisualBase GetVisual(int index) { return viewWrapperImpl.GetVisual(index); @@ -303,10 +303,10 @@ namespace Tizen.NUI.BaseComponents /// /// Sets the given visual to be displayed or not when parent staged.
- /// For managing the object lifecycle, do not store the returned visual as a member which increments its reference count.
+ /// For managing object life-cycle, do not store the returned visual as a member which increments its reference count.
///
- /// The property index of the visual, used to reference visual. - /// Flag set to enabled or disabled. + /// The Property index of the visual, used to reference visual + /// flag to set enabled or disabled protected void EnableVisual(int index, bool enable) { viewWrapperImpl.EnableVisual(index, enable); @@ -314,37 +314,37 @@ namespace Tizen.NUI.BaseComponents /// /// Queries if the given visual is to be displayed when parent staged.
- /// For managing the object lifecycle, do not store the returned visual as a member which increments its reference count.
+ /// For managing object life-cycle, do not store the returned visual as a member which increments its reference count.
///
- /// The property index of the visual. - /// Whether visual is enabled or not. + /// The Property index of the visual + /// Whether visual is enabled or not protected bool IsVisualEnabled(int index) { return viewWrapperImpl.IsVisualEnabled(index); } /// - /// Creates a transition effect on the control. + /// Create a transition effect on the control. /// - /// The transition data describing the effect to create. - /// A handle to an animation defined with the given effect, or an empty handle if no properties match. + /// transitionData The transition data describing the effect to create + /// A handle to an animation defined with the given effect, or an empty handle if no properties match protected Animation CreateTransition(TransitionData transitionData) { return viewWrapperImpl.CreateTransition(transitionData); } /// - /// Emits the KeyInputFocusGained signal if true, else, emits the KeyInputFocusLost signal.
- /// Should be called last by the control after it acts on the input focus change.
+ /// Emits KeyInputFocusGained signal if true else emits KeyInputFocusLost signal.
+ /// Should be called last by the control after it acts on the Input Focus change.
///
- /// True if gained, false if lost. + /// focusGained True if gained, False if lost protected void EmitFocusSignal(bool focusGained) { viewWrapperImpl.EmitFocusSignal(focusGained); } /// - /// This method is called after the control has been initialized.
+ /// This method is called after the Control has been initialized.
/// Derived classes should do any second phase initialization by overriding this method.
///
public virtual void OnInitialize() @@ -353,19 +353,19 @@ namespace Tizen.NUI.BaseComponents /// /// Called after the view has been connected to the stage.
- /// When a view is connected, it will be directly or indirectly parented to the root view.
- /// The root view is provided automatically by Tizen.NUI.Stage, and is always considered to be connected.
- /// When the parent of a set of views is connected to the stage, then all of the children will receive this callback.
+ /// When an view is connected, it will be directly or indirectly parented to the root View.
+ /// The root View is provided automatically by Tizen.NUI.Stage, and is always considered to be connected.
+ /// When the parent of a set of views is connected to the stage, then all of the children will received this callback.
///
- /// The depth in the hierarchy for the view. + /// The depth in the hierarchy for the view public virtual void OnStageConnection(int depth) { } /// - /// Called after the view has been disconnected from the stage.
- /// If a view is disconnected, it either has no parent, or is parented to a disconnected view.
- /// When the parent of a set of views is disconnected to the stage, then all of the children will receive this callback, starting with the leaf views.
+ /// Called after the view has been disconnected from Stage.
+ /// If an view is disconnected it either has no parent, or is parented to a disconnected view.
+ /// When the parent of a set of views is disconnected to the stage, then all of the children will received this callback, starting with the leaf views.
///
public virtual void OnStageDisconnection() { @@ -374,7 +374,7 @@ namespace Tizen.NUI.BaseComponents /// /// Called after a child has been added to the owning view. /// - /// The child which has been added. + /// The child which has been added public virtual void OnChildAdd(View view) { } @@ -382,7 +382,7 @@ namespace Tizen.NUI.BaseComponents /// /// Called after the owning view has attempted to remove a child( regardless of whether it succeeded or not ). /// - /// The child being removed. + /// The child being removed public virtual void OnChildRemove(View view) { } @@ -390,67 +390,67 @@ namespace Tizen.NUI.BaseComponents /// /// Called when the owning view property is set. /// - /// The property index that was set. - /// The value to set. + /// The Property index that was set + /// The value to set public virtual void OnPropertySet(int index, Tizen.NUI.PropertyValue propertyValue) { } /// - /// Called when the owning view's size is set, for example, using View.SetSize(). + /// Called when the owning view's size is set e.g. using View.SetSize(). /// - /// The target size. + /// The target size public virtual void OnSizeSet(Vector3 targetSize) { } /// - /// Called when the owning view's size is animated, for example, using Animation::AnimateTo( Property ( view, View::Property::SIZE ), ... ). + /// Called when the owning view's size is animated e.g. using Animation::AnimateTo( Property( view, View::Property::SIZE ), ... ). /// - /// The object which is animating the owning view. - /// The target size. + /// The object which is animating the owning view + /// The target size public virtual void OnSizeAnimation(Animation animation, Vector3 targetSize) { } /// - /// Called after a touch event is received by the owning view.
+ /// Called after a touch-event is received by the owning view.
/// CustomViewBehaviour.REQUIRES_TOUCH_EVENTS must be enabled during construction. See CustomView(ViewWrapperImpl.CustomViewBehaviour behaviour).
///
- /// The touch event. - /// True if the event should be consumed. + /// The touch event + /// True if the event should be consumed public virtual bool OnTouch(Touch touch) { return false; // Do not consume } /// - /// Called after a hover event is received by the owning view.
+ /// Called after a hover-event is received by the owning view.
/// CustomViewBehaviour.REQUIRES_HOVER_EVENTS must be enabled during construction. See CustomView(ViewWrapperImpl.CustomViewBehaviour behaviour).
///
- /// The hover event. - /// True if the hover event should be consumed. + /// The hover event + /// True if the hover event should be consumed public virtual bool OnHover(Hover hover) { return false; // Do not consume } /// - /// Called after a key event is received by the view that has had its focus set. + /// Called after a key-event is received by the view that has had its focus set. /// - /// The key event. - /// True if the key event should be consumed. + /// The key event + /// True if the key event should be consumed public virtual bool OnKey(Key key) { return false; // Do not consume } /// - /// Called after a wheel event is received by the owning view.
+ /// Called after a wheel-event is received by the owning view.
/// CustomViewBehaviour.REQUIRES_WHEEL_EVENTS must be enabled during construction. See CustomView(ViewWrapperImpl.CustomViewBehaviour behaviour).
///
- /// The wheel event. - /// True if the wheel event should be consumed. + /// The wheel event + /// True if the wheel event should be consumed public virtual bool OnWheel(Wheel wheel) { return false; // Do not consume @@ -458,12 +458,12 @@ namespace Tizen.NUI.BaseComponents /// /// Called after the size negotiation has been finished for this control.
- /// The control is expected to assign this given size to itself or its children.
- /// Should be overridden by derived classes if they need to layout views differently after certain operations like add or remove views, resize, or after changing specific properties.
+ /// The control is expected to assign this given size to itself/its children.
+ /// Should be overridden by derived classes if they need to layout views differently after certain operations like add or remove views, resize or after changing specific properties.
/// As this function is called from inside the size negotiation algorithm, you cannot call RequestRelayout (the call would just be ignored).
///
- /// The allocated size. - /// The control should add views to this container that it is not able to allocate a size for. + /// The allocated size + /// The control should add views to this container that it is not able to allocate a size for public virtual void OnRelayout(Vector2 size, RelayoutContainer container) { } @@ -471,26 +471,26 @@ namespace Tizen.NUI.BaseComponents /// /// Notification for deriving classes. /// - /// The policy being set. - /// The policy is being set for. + /// policy The policy being set + /// dimension The dimension the policy is being set for public virtual void OnSetResizePolicy(ResizePolicyType policy, DimensionType dimension) { } /// - /// Returns the natural size of the view. + /// Return the natural size of the view. /// /// The view's natural size - public new virtual Size2D GetNaturalSize() + public virtual Size2D GetNaturalSize() { return new Size2D(0, 0); } /// - /// Calculates the size for a child. + /// Calculate the size for a child. /// - /// The child view to calculate the size for. - /// The dimension to calculate the size, for example, the width or the height. + /// The child view to calculate the size for + /// The dimension to calculate the size for. E.g. width or height /// Return the calculated size for the given dimension. If more than one dimension is requested, just return the first one found. public virtual float CalculateChildSize(View child, DimensionType dimension) { @@ -503,7 +503,7 @@ namespace Tizen.NUI.BaseComponents ///
/// Width to use /// The height based on the width - public new virtual float GetHeightForWidth(float width) + public virtual float GetHeightForWidth(float width) { return viewWrapperImpl.GetHeightForWidthBase(width); } @@ -514,44 +514,44 @@ namespace Tizen.NUI.BaseComponents ///
/// Height to use /// The width based on the width - public new virtual float GetWidthForHeight(float height) + public virtual float GetWidthForHeight(float height) { return viewWrapperImpl.GetWidthForHeightBase(height); } /// - /// Determines if this view is dependent on it's children for relayout. + /// Determine if this view is dependent on it's children for relayout. /// - /// The dimension(s) to check for. - /// Return if the view is dependent on it's children. + /// The dimension(s) to check for + /// Return if the view is dependent on it's children public virtual bool RelayoutDependentOnChildren(DimensionType dimension) { return viewWrapperImpl.RelayoutDependentOnChildrenBase(dimension); } /// - /// Determines if this view is dependent on it's children for relayout from the base class. + /// Determine if this view is dependent on it's children for relayout from the base class. /// - /// Return true if the view is dependent on it's children. + /// Return true if the view is dependent on it's children public virtual bool RelayoutDependentOnChildren() { return viewWrapperImpl.RelayoutDependentOnChildrenBase(); } /// - /// The virtual method to notify deriving classes that relayout dependencies have been + /// Virtual method to notify deriving classes that relayout dependencies have been /// met and the size for this object is about to be calculated for the given dimension. /// - /// The dimension that is about to be calculated. + /// The dimension that is about to be calculated public virtual void OnCalculateRelayoutSize(DimensionType dimension) { } /// - /// The virtual method to notify deriving classes that the size for a dimension has just been negotiated. + /// Virtual method to notify deriving classes that the size for a dimension has just been negotiated. /// - /// The new size for the given dimension. - /// The dimension that was just negotiated. + /// The new size for the given dimension + /// The dimension that was just negotiated public virtual void OnLayoutNegotiated(float size, DimensionType dimension) { } @@ -559,17 +559,17 @@ namespace Tizen.NUI.BaseComponents /// /// This method should be overridden by deriving classes requiring notifications when the style changes. /// - /// The StyleManager object. - /// Information denoting what has changed. + /// The StyleManager object + /// Information denoting what has changed public virtual void OnStyleChange(StyleManager styleManager, StyleChangeType change) { } /// - /// This method is called when the control accessibility is activated.
+ /// This method is called when the control is accessibility activated.
/// Derived classes should override this to perform custom accessibility activation.
///
- /// True if this control can perform accessibility activation. + /// true if this control can perform accessibility activation internal virtual bool OnAccessibilityActivated() { return false; @@ -578,28 +578,28 @@ namespace Tizen.NUI.BaseComponents /// /// This method should be overridden by deriving classes when they wish to respond the accessibility. /// - /// The pan gesture. - /// True if the pan gesture has been consumed by this control. + /// The pan gesture + /// true if the pan gesture has been consumed by this control internal virtual bool OnAccessibilityPan(PanGesture gestures) { return false; } /// - /// This method should be overridden by deriving classes when they wish to respond the accessibility. + /// This method should be overridden by deriving classes when they wish to respond the accessibility /// - /// The touch gesture. - /// True if the touch event has been consumed by this control. + /// The touch gesture + /// true if the touch event has been consumed by this control internal virtual bool OnAccessibilityTouch(Touch touch) { return false; } /// - /// This method should be overridden by deriving classes when they wish to respond the accessibility up and down action (i.e., value change of slider control). + /// This method should be overridden by deriving classes when they wish to respond the accessibility up and down action (i.e. value change of slider control). /// - /// Whether the value should be increased or decreased. - /// True if the value changed action has been consumed by this control. + /// isIncrease Whether the value should be increased or decreased + /// true if the value changed action has been consumed by this control internal virtual bool OnAccessibilityValueChange(bool isIncrease) { return false; @@ -608,21 +608,21 @@ namespace Tizen.NUI.BaseComponents /// /// This method should be overridden by deriving classes when they wish to respond the accessibility zoom action. /// - /// True if the zoom action has been consumed by this control. + /// true if the zoom action has been consumed by this control internal virtual bool OnAccessibilityZoom() { return false; } /// - /// Called when the control gain key input focus. Should be overridden by derived classes if they need to customize what happens when the focus is gained. + /// Called when the control gain key input focus. Should be overridden by derived classes if they need to customize what happens when focus is gained. /// public virtual void OnFocusGained() { } /// - /// Called when the control loses key input focus. Should be overridden by derived classes if they need to customize what happens when the focus is lost. + /// Called when the control loses key input focus. Should be overridden by derived classes if they need to customize what happens when focus is lost. /// public virtual void OnFocusLost() { @@ -632,10 +632,10 @@ namespace Tizen.NUI.BaseComponents /// Gets the next keyboard focusable view in this control towards the given direction.
/// A control needs to override this function in order to support two dimensional keyboard navigation.
///
- /// The current focused view. - /// The direction to move the focus towards. - /// Whether the focus movement should be looped within the control. - /// The next keyboard focusable view in this control or an empty handle if no view can be focused. + /// The current focused view + /// The direction to move the focus towards + /// Whether the focus movement should be looped within the control + /// the next keyboard focusable view in this control or an empty handle if no view can be focused public virtual View GetNextFocusableView(View currentFocusedView, View.FocusDirection direction, bool loopEnabled) { return new View(); @@ -643,9 +643,9 @@ namespace Tizen.NUI.BaseComponents /// /// Informs this control that its chosen focusable view will be focused.
- /// This allows the application to preform any actions it wishes before the focus is actually moved to the chosen view.
+ /// This allows the application to preform any actions if wishes before the focus is actually moved to the chosen view.
///
- /// The commited focused view. + /// The commited focused view public virtual void OnFocusChangeCommitted(View commitedFocusableView) { } @@ -654,7 +654,7 @@ namespace Tizen.NUI.BaseComponents /// This method is called when the control has enter pressed on it.
/// Derived classes should override this to perform custom actions.
///
- /// True if this control supported this action. + /// true if this control supported this action public virtual bool OnKeyboardEnter() { return false; @@ -662,11 +662,11 @@ namespace Tizen.NUI.BaseComponents /// /// Called whenever a pinch gesture is detected on this control.
- /// This can be overridden by deriving classes when pinch detection is enabled. The default behavior is to scale the control by the pinch scale.
- /// If overridden, then the default behavior will not occur.
+ /// This can be overridden by deriving classes when pinch detection is enabled. The default behaviour is to scale the control by the pinch scale.
+ /// If overridden, then the default behaviour will not occur.
/// Pinch detection should be enabled via EnableGestureDetection().
///
- /// The pinch tap gesture. + /// pinch tap gesture internal virtual void OnPinch(PinchGesture pinch) { } @@ -674,10 +674,10 @@ namespace Tizen.NUI.BaseComponents /// /// Called whenever a pan gesture is detected on this control.
/// This should be overridden by deriving classes when pan detection is enabled.
- /// There is no default behavior with panning.
+ /// There is no default behaviour with panning.
/// Pan detection should be enabled via EnableGestureDetection().
///
- /// The pan gesture. + /// The pan gesture public virtual void OnPan(PanGesture pan) { } @@ -685,10 +685,10 @@ namespace Tizen.NUI.BaseComponents /// /// Called whenever a tap gesture is detected on this control.
/// This should be overridden by deriving classes when tap detection is enabled.
- /// There is no default behavior with a tap.
+ /// There is no default behaviour with a tap.
/// Tap detection should be enabled via EnableGestureDetection().
///
- /// The tap gesture. + /// The tap gesture public virtual void OnTap(TapGesture tap) { } @@ -696,10 +696,10 @@ namespace Tizen.NUI.BaseComponents /// /// Called whenever a long press gesture is detected on this control.
/// This should be overridden by deriving classes when long press detection is enabled.
- /// There is no default behavior associated with a long press.
+ /// There is no default behaviour associated with a long press.
/// Long press detection should be enabled via EnableGestureDetection().
///
- /// The long press gesture. + /// The long press gesture internal virtual void OnLongPress(LongPressGesture longPress) { } diff --git a/src/Tizen.NUI/src/public/BaseComponents/FlexContainer.cs b/src/Tizen.NUI/src/public/BaseComponents/FlexContainer.cs index 41a3eda40..05c42a7e3 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/FlexContainer.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/FlexContainer.cs @@ -18,8 +18,8 @@ namespace Tizen.NUI.BaseComponents { /// /// FlexContainer implements a subset of the flexbox spec (defined by W3C):https://www.w3.org/TR/css3-flexbox/
- /// It aims at providing a more efficient way to layout, align, and distribute space among items in the container, even when their size is unknown or dynamic.
- /// FlexContainer has the ability to alter the width and the height of its children (i.e., flex items) to fill the available space in the best possible way on different screen sizes.
+ /// It aims at providing a more efficient way to lay out, align and distribute space among items in the container, even when their size is unknown or dynamic.
+ /// FlexContainer has the ability to alter the width and height of its children (i.e. flex items) to fill the available space in the best possible way on different screen sizes.
/// FlexContainer can expand items to fill available free space, or shrink them to prevent overflow.
///
public class FlexContainer : View @@ -68,7 +68,7 @@ namespace Tizen.NUI.BaseComponents } - internal new class Property + internal class Property { internal static readonly int CONTENT_DIRECTION = NDalicPINVOKE.FlexContainer_Property_CONTENT_DIRECTION_get(); internal static readonly int FLEX_DIRECTION = NDalicPINVOKE.FlexContainer_Property_FLEX_DIRECTION_get(); @@ -124,7 +124,7 @@ namespace Tizen.NUI.BaseComponents /// /// Enumeration for the alignment of the flex items when the items do not use all available - /// space on the main axis. + /// space on the main-axis. /// public enum Justification { @@ -137,7 +137,7 @@ namespace Tizen.NUI.BaseComponents /// /// Enumeration for the alignment of the flex items or lines when the items or lines do not - /// use all the available space on the cross axis. + /// use all the available space on the cross-axis. /// public enum Alignment { @@ -159,7 +159,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The primary direction in which content is ordered. + /// The primary direction in which content is ordered /// public ContentDirectionType ContentDirection { @@ -176,7 +176,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The direction of the main axis which determines the direction that flex items are laid out. + /// The direction of the main-axis which determines the direction that flex items are laid out /// public FlexDirectionType FlexDirection { @@ -193,7 +193,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// Whether the flex items should wrap or not if there is no enough room for them on one flex line. + /// Whether the flex items should wrap or not if there is no enough room for them on one flex line /// public WrapType FlexWrap { @@ -210,7 +210,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The alignment of flex items when the items do not use all available space on the main axis. + /// The alignment of flex items when the items do not use all available space on the main-axis /// public Justification JustifyContent { @@ -227,7 +227,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The alignment of flex items when the items do not use all available space on the cross axis. + /// The alignment of flex items when the items do not use all available space on the cross-axis /// public Alignment AlignItems { @@ -244,7 +244,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// Similar to "alignItems", but it aligns flex lines; so only works when there are multiple lines. + /// Similar to "alignItems", but it aligns flex lines, so only works when there are multiple lines /// public Alignment AlignContent { diff --git a/src/Tizen.NUI/src/public/BaseComponents/ImageView.cs b/src/Tizen.NUI/src/public/BaseComponents/ImageView.cs index a5c620214..a804d1154 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/ImageView.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/ImageView.cs @@ -21,7 +21,7 @@ namespace Tizen.NUI.BaseComponents /// /// ImageView is a class for displaying an image resource.
- /// An instance of ImageView can be created using a URL or an image instance.
+ /// An instance of ImageView can be created using a URL or an Image instance.
///
public class ImageView : View { @@ -67,9 +67,9 @@ namespace Tizen.NUI.BaseComponents private ResourceReadyEventCallbackType _resourceReadyEventCallback; /// - /// An event for ResourceReady signal which can be used to subscribe or unsubscribe the event handler.
+ /// Event for ResourceReady signal which can be used to subscribe/unsubscribe the event handler.
/// This signal is emitted after all resources required by a control are loaded and ready.
- /// Most resources are only loaded when the control is placed on the stage.
+ /// Most resources are only loaded when the control is placed on stage.
///
public event EventHandler ResourceReady { @@ -146,7 +146,7 @@ namespace Tizen.NUI.BaseComponents base.Dispose(type); } - internal new class Property + internal class Property { internal static readonly int RESOURCE_URL = NDalicPINVOKE.ImageView_Property_RESOURCE_URL_get(); internal static readonly int IMAGE = NDalicPINVOKE.ImageView_Property_IMAGE_get(); @@ -163,10 +163,10 @@ namespace Tizen.NUI.BaseComponents } /// - /// Creates an initialized ImageView from a URL to an image resource.
+ /// Creates an initialized ImageView from an URL to an image resource.
/// If the string is empty, ImageView will not display anything.
///
- /// The URL of the image resource to display. + /// The url of the image resource to display public ImageView(string url) : this(NDalicPINVOKE.ImageView_New__SWIG_2(url), true) { _url = url; @@ -191,7 +191,7 @@ namespace Tizen.NUI.BaseComponents /// Sets this ImageView from the given URL.
/// If the URL is empty, ImageView will not display anything.
///
- /// The URL to the image resource to display. + /// The URL to the image resource to display public void SetImage(string url) { _url = url; @@ -212,11 +212,11 @@ namespace Tizen.NUI.BaseComponents } /// - /// Queries if all resources required by a control are loaded and ready.
- /// Most resources are only loaded when the control is placed on the stage.
- /// True if the resources are loaded and ready, false otherwise.
+ /// Query if all resources required by a control are loaded and ready.
+ /// Most resources are only loaded when the control is placed on stage.
+ /// true if the resources are loaded and ready, false otherwise.
///
- public new bool IsResourceReady() + public bool IsResourceReady() { bool ret = NDalicPINVOKE.IsResourceReady(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) @@ -225,7 +225,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// ImageView ResourceUrl, type string. + /// ImageView ResourceUrl, type string /// public string ResourceUrl { @@ -242,7 +242,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// ImageView ImageMap, type PropertyMap: string if it is a URL, map otherwise + /// ImageView ImageMap, type PropertyMap : string if it is a url, map otherwise /// public PropertyMap ImageMap { @@ -324,7 +324,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// Gets or sets whether to draw the borders only (if true).
+ /// Get or set whether to draws the borders only(If true).
/// If not specified, the default is false.
/// For N-Patch images only.
/// Optional. @@ -355,6 +355,21 @@ namespace Tizen.NUI.BaseComponents } } + public ImageView.LoadingStatusType LoadingStatus + { + get + { + return (ImageView.LoadingStatusType)NDalicManualPINVOKE.View_GetVisualResourceStatus(swigCPtr, (int)Property.IMAGE); + } + } + + public enum LoadingStatusType + { + Preparing, + Ready, + Failed + } + private void UpdateImage() { if (_url != null) diff --git a/src/Tizen.NUI/src/public/BaseComponents/Scrollable.cs b/src/Tizen.NUI/src/public/BaseComponents/Scrollable.cs index 0499a70d3..3803986a6 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/Scrollable.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/Scrollable.cs @@ -301,7 +301,7 @@ namespace Tizen.NUI.BaseComponents } - public new class Property + public class Property { public static readonly int OVERSHOOT_EFFECT_COLOR = NDalicPINVOKE.Scrollable_Property_OVERSHOOT_EFFECT_COLOR_get(); public static readonly int OVERSHOOT_ANIMATION_SPEED = NDalicPINVOKE.Scrollable_Property_OVERSHOOT_ANIMATION_SPEED_get(); diff --git a/src/Tizen.NUI/src/public/BaseComponents/TableView.cs b/src/Tizen.NUI/src/public/BaseComponents/TableView.cs index 0766f75d2..48b57d32c 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/TableView.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/TableView.cs @@ -21,8 +21,8 @@ namespace Tizen.NUI.BaseComponents /// /// TableView is a layout container for aligning child actors in a grid like layout.
- /// TableView constraints the X and the Y position and the width and the height of the child actors.
- /// The Z position and depth are left intact so that the 3D model actors can also be laid out + /// TableView constrains the x and y position and width and height of the child actors.
+ /// z position and depth are left intact so that 3D model actors can also be laid out /// in a grid without loosing their depth scaling.
///
public class TableView : View @@ -71,7 +71,7 @@ namespace Tizen.NUI.BaseComponents } - internal new class Property + internal class Property { internal static readonly int ROWS = NDalicPINVOKE.TableView_Property_ROWS_get(); internal static readonly int COLUMNS = NDalicPINVOKE.TableView_Property_COLUMNS_get(); @@ -90,7 +90,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// Class to specify the layout position for the child view. + /// Class to specify layout position for child view. /// public class CellPosition : global::System.IDisposable { @@ -172,49 +172,49 @@ namespace Tizen.NUI.BaseComponents } /// - /// The constructor. + /// Constructor. /// - /// The row index initialized. - /// The column index initialized. - /// The row span initialized. - /// The column span initialized. + /// The row index initialized + /// The column index initialized + /// The row span initialized + /// The column span initialized public CellPosition(uint rowIndex, uint columnIndex, uint rowSpan, uint columnSpan) : this(NDalicPINVOKE.new_TableView_CellPosition__SWIG_0(rowIndex, columnIndex, rowSpan, columnSpan), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } /// - /// The constructor to initialize values to defaults for convenience. + /// Constructor to initialise values to defaults for convenience. /// - /// The row index initialized. - /// The column index initialized. - /// The row span initialized. + /// The row index initialized + /// The column index initialized + /// The row span initialized public CellPosition(uint rowIndex, uint columnIndex, uint rowSpan) : this(NDalicPINVOKE.new_TableView_CellPosition__SWIG_1(rowIndex, columnIndex, rowSpan), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } /// - /// The constructor to initialize values to defaults for convenience. + /// Constructor to initialise values to defaults for convenience. /// - /// The row index initialized. - /// The column index initialized. + /// The row index initialized + /// The column index initialized public CellPosition(uint rowIndex, uint columnIndex) : this(NDalicPINVOKE.new_TableView_CellPosition__SWIG_2(rowIndex, columnIndex), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } /// - /// The constructor to initialize values to default for convenience. + /// Constructor to initialise values to defaults for convenience. /// - /// The row index initialized. + /// The row index initialized public CellPosition(uint rowIndex) : this(NDalicPINVOKE.new_TableView_CellPosition__SWIG_3(rowIndex), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } /// - /// The default constructor. + /// Default constructor /// public CellPosition() : this(NDalicPINVOKE.new_TableView_CellPosition__SWIG_4(), true) { @@ -222,7 +222,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The index of a row. + /// Index of row /// public uint rowIndex { @@ -240,7 +240,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The index of a column. + /// Index of column /// public uint columnIndex { @@ -258,7 +258,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The span of a row. + /// Span of row /// public uint rowSpan { @@ -276,7 +276,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The span of a column. + /// Span of column /// public uint columnSpan { @@ -298,8 +298,8 @@ namespace Tizen.NUI.BaseComponents /// /// Creates the TableView view. /// - /// Initial rows for the table. - /// Initial columns for the table. + /// initialRows for the table + /// initialColumns for the table public TableView(uint initialRows, uint initialColumns) : this(NDalicPINVOKE.TableView_New(initialRows, initialColumns), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -307,9 +307,9 @@ namespace Tizen.NUI.BaseComponents } /// - /// The Copy constructor. Creates another handle that points to the same real object. + /// Copy constructor. Creates another handle that points to the same real object. /// - /// Handle to copy from. + /// Handle to copy from public TableView(TableView handle) : this(NDalicPINVOKE.new_TableView__SWIG_1(TableView.getCPtr(handle)), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -327,9 +327,9 @@ namespace Tizen.NUI.BaseComponents /// Adds a child to the table.
/// If the row or column index is outside the table, the table gets resized bigger.
///
- /// The child to add. - /// The position for the child. - /// True if the addition succeeded, and false if the cell is already occupied. + /// The child to add + /// The position for the child + /// Tue if the addition succeeded and false if the cell is already occupied public bool AddChild(View child, TableView.CellPosition position) { bool ret = NDalicPINVOKE.TableView_AddChild(swigCPtr, View.getCPtr(child), TableView.CellPosition.getCPtr(position)); @@ -340,8 +340,8 @@ namespace Tizen.NUI.BaseComponents /// /// Returns a child from the given layout position. /// - /// The position in the table. - /// Child that was in the cell or an uninitialized handle. + /// The position in the table + /// Child that was in the cell or an uninitialized handle public View GetChildAt(TableView.CellPosition position) { IntPtr cPtr = NDalicPINVOKE.TableView_GetChildAt(swigCPtr, TableView.CellPosition.getCPtr(position)); @@ -354,8 +354,8 @@ namespace Tizen.NUI.BaseComponents /// /// Removes a child from the given layout position. /// - /// The position for the child to remove. - /// Child that was removed or an uninitialized handle. + /// The position for the child to remove + /// Child that was removed or an uninitialized handle public View RemoveChildAt(TableView.CellPosition position) { IntPtr cPtr = NDalicPINVOKE.TableView_RemoveChildAt(swigCPtr, TableView.CellPosition.getCPtr(position)); @@ -368,9 +368,9 @@ namespace Tizen.NUI.BaseComponents /// /// Finds the child's layout position. /// - /// The child to search for. - /// The position for the child. - /// True if the child was included in this TableView. + /// The child to search for + /// The position for the child + /// true if the child was included in this TableView public bool FindChildPosition(View child, TableView.CellPosition position) { bool ret = NDalicPINVOKE.TableView_FindChildPosition(swigCPtr, View.getCPtr(child), TableView.CellPosition.getCPtr(position)); @@ -379,9 +379,9 @@ namespace Tizen.NUI.BaseComponents } /// - /// Inserts a new row to the given index. + /// Inserts a new row to given index. /// - /// The rowIndex of the new row. + /// The rowIndex of the new row public void InsertRow(uint rowIndex) { NDalicPINVOKE.TableView_InsertRow(swigCPtr, rowIndex); @@ -392,7 +392,7 @@ namespace Tizen.NUI.BaseComponents /// Deletes a row from the given index.
/// Removed elements are deleted.
/// - /// The rowIndex of the row to delete. + /// The rowIndex of the row to delete public void DeleteRow(uint rowIndex) { NDalicPINVOKE.TableView_DeleteRow__SWIG_0(swigCPtr, rowIndex); @@ -402,7 +402,7 @@ namespace Tizen.NUI.BaseComponents /// /// Inserts a new column to the given index. /// - /// The columnIndex of the new column. + /// The columnIndex of the new column public void InsertColumn(uint columnIndex) { NDalicPINVOKE.TableView_InsertColumn(swigCPtr, columnIndex); @@ -413,7 +413,7 @@ namespace Tizen.NUI.BaseComponents /// Deletes a column from the given index.
/// Removed elements are deleted.
/// - /// The columnIndex of the column to delete. + /// The columnIndex of the column to delete public void DeleteColumn(uint columnIndex) { NDalicPINVOKE.TableView_DeleteColumn__SWIG_0(swigCPtr, columnIndex); @@ -423,8 +423,8 @@ namespace Tizen.NUI.BaseComponents /// /// Resizes the TableView. /// - /// The rows for the table. - /// The columns for the table. + /// The rows for the table + /// The columns for the table public void Resize(uint rows, uint columns) { NDalicPINVOKE.TableView_Resize__SWIG_0(swigCPtr, rows, columns); @@ -432,9 +432,9 @@ namespace Tizen.NUI.BaseComponents } /// - /// Sets the horizontal and the vertical padding between cells. + /// Sets horizontal and vertical padding between cells. /// - /// Width and height. + /// Width and height public void SetCellPadding(Size2D padding) { NDalicPINVOKE.TableView_SetCellPadding(swigCPtr, Size2D.getCPtr(padding)); @@ -444,7 +444,7 @@ namespace Tizen.NUI.BaseComponents /// /// Gets the current padding as width and height. /// - /// The current padding as width and height. + /// The current padding as width and height public Vector2 GetCellPadding() { Vector2 ret = new Vector2(NDalicPINVOKE.TableView_GetCellPadding(swigCPtr), true); @@ -455,7 +455,7 @@ namespace Tizen.NUI.BaseComponents /// /// Specifies this row as fitting its height to its children. /// - /// The row to set. + /// The row to set public void SetFitHeight(uint rowIndex) { NDalicPINVOKE.TableView_SetFitHeight(swigCPtr, rowIndex); @@ -465,8 +465,8 @@ namespace Tizen.NUI.BaseComponents /// /// Checks if the row is a fit row. /// - /// The row to check. - /// True if the row is fit. + /// The row to check + /// true if the row is fit public bool IsFitHeight(uint rowIndex) { bool ret = NDalicPINVOKE.TableView_IsFitHeight(swigCPtr, rowIndex); @@ -477,7 +477,7 @@ namespace Tizen.NUI.BaseComponents /// /// Specifies this column as fitting its width to its children. /// - /// The column to set. + /// The column to set public void SetFitWidth(uint columnIndex) { NDalicPINVOKE.TableView_SetFitWidth(swigCPtr, columnIndex); @@ -487,8 +487,8 @@ namespace Tizen.NUI.BaseComponents /// /// Checks if the column is a fit column. /// - /// The column to check. - /// True if the column is fit. + /// The column to check + /// true if the column is fit public bool IsFitWidth(uint columnIndex) { bool ret = NDalicPINVOKE.TableView_IsFitWidth(swigCPtr, columnIndex); @@ -497,11 +497,11 @@ namespace Tizen.NUI.BaseComponents } /// - /// Sets a row to have a fixed height.
+ /// Sets a row to have fixed height.
/// Setting a fixed height of 0 has no effect.
///
- /// The rowIndex for row with a fixed height. - /// The height in world coordinate units. + /// The rowIndex for row with fixed height + /// The height in world coordinate units public void SetFixedHeight(uint rowIndex, float height) { NDalicPINVOKE.TableView_SetFixedHeight(swigCPtr, rowIndex, height); @@ -511,8 +511,8 @@ namespace Tizen.NUI.BaseComponents /// /// Gets a row's fixed height. /// - /// The row index with a fixed height. - /// height The height in world coordinate units. + /// The row index with fixed height + /// height The height in world coordinate units public float GetFixedHeight(uint rowIndex) { float ret = NDalicPINVOKE.TableView_GetFixedHeight(swigCPtr, rowIndex); @@ -521,12 +521,12 @@ namespace Tizen.NUI.BaseComponents } /// - /// Sets a row to have a relative height. Relative height means percentage of - /// the remainder of the table height after subtracting padding and fixed height rows.
+ /// Sets a row to have relative height. Relative height means percentage of + /// the remainder of the table height after subtracting Padding and Fixed height rows.
/// Setting a relative height of 0 has no effect.
///
- /// The rowIndex for row with a relative height. - /// The height percentage between 0.0f and 1.0f. + /// The rowIndex for row with relative height + /// The height percentage between 0.0f and 1.0f public void SetRelativeHeight(uint rowIndex, float heightPercentage) { NDalicPINVOKE.TableView_SetRelativeHeight(swigCPtr, rowIndex, heightPercentage); @@ -536,8 +536,8 @@ namespace Tizen.NUI.BaseComponents /// /// Gets a row's relative height. /// - /// The row index with a relative height. - /// Height in percentage units, between 0.0f and 1.0f. + /// The row index with relative height + /// Height in percentage units, between 0.0f and 1.0f public float GetRelativeHeight(uint rowIndex) { float ret = NDalicPINVOKE.TableView_GetRelativeHeight(swigCPtr, rowIndex); @@ -546,11 +546,11 @@ namespace Tizen.NUI.BaseComponents } /// - /// Sets a column to have a fixed width.
+ /// Sets a column to have fixed width.
/// Setting a fixed width of 0 has no effect.
///
- /// The columnIndex for column with a fixed width. - /// The width in world coordinate units. + /// The columnIndex for column with fixed width + /// The width in world coordinate units public void SetFixedWidth(uint columnIndex, float width) { NDalicPINVOKE.TableView_SetFixedWidth(swigCPtr, columnIndex, width); @@ -560,8 +560,8 @@ namespace Tizen.NUI.BaseComponents /// /// Gets a column's fixed width. /// - /// The column index with a fixed width. - /// Width in world coordinate units. + /// The column index with fixed width + /// Width in world coordinate units public float GetFixedWidth(uint columnIndex) { float ret = NDalicPINVOKE.TableView_GetFixedWidth(swigCPtr, columnIndex); @@ -570,12 +570,12 @@ namespace Tizen.NUI.BaseComponents } /// - /// Sets a column to have a relative width. Relative width means percentage of - /// the remainder of the table width after subtracting padding and fixed width columns.
+ /// Sets a column to have relative width. Relative width means percentage of + /// the remainder of table width after subtracting Padding and Fixed width columns.
/// Setting a relative width of 0 has no effect.
///
- /// The columnIndex for column with a fixed width. - /// The widthPercentage between 0.0f and 1.0f. + /// The columnIndex for column with fixed width + /// The widthPercentage between 0.0f and 1.0f public void SetRelativeWidth(uint columnIndex, float widthPercentage) { NDalicPINVOKE.TableView_SetRelativeWidth(swigCPtr, columnIndex, widthPercentage); @@ -585,8 +585,8 @@ namespace Tizen.NUI.BaseComponents /// /// Gets a column's relative width. /// - /// The column index with a relative width. - /// Width in percentage units, between 0.0f and 1.0f. + /// The column index with relative width + /// Width in percentage units, between 0.0f and 1.0f public float GetRelativeWidth(uint columnIndex) { float ret = NDalicPINVOKE.TableView_GetRelativeWidth(swigCPtr, columnIndex); @@ -596,11 +596,11 @@ namespace Tizen.NUI.BaseComponents /// /// Sets the alignment on a cell.
- /// Cells without calling this function have the default values of left and top respectively.
+ /// Cells without calling this function have the default values of LEFT and TOP respectively.
///
- /// The cell to set alignment on. - /// The horizontal alignment. - /// The vertical alignment. + /// The cell to set alignment on + /// The horizontal alignment + /// The vertical alignment public void SetCellAlignment(TableView.CellPosition position, HorizontalAlignmentType horizontal, VerticalAlignmentType vertical) { NDalicPINVOKE.TableView_SetCellAlignment(swigCPtr, TableView.CellPosition.getCPtr(position), (int)horizontal, (int)vertical); @@ -608,7 +608,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// Enumeration for describing how the size of a row or column has been set. + /// Enumeration for describing how the size of a row / column has been set. /// public enum LayoutPolicy { @@ -619,7 +619,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The amount of rows in the table. + /// the amount of rows in the table. /// public int Rows { @@ -635,7 +635,7 @@ namespace Tizen.NUI.BaseComponents } } /// - /// The amount of columns in the table. + /// the amount of columns in the table. /// public int Columns { @@ -651,7 +651,7 @@ namespace Tizen.NUI.BaseComponents } } /// - /// Padding between cells. + /// padding between cells. /// public Vector2 CellPadding { @@ -668,7 +668,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The number of layout rows. + /// The number of layout rows /// public PropertyMap LayoutRows { @@ -685,7 +685,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The number of layout columns. + /// The number of layout columns /// public PropertyMap LayoutColumns { diff --git a/src/Tizen.NUI/src/public/BaseComponents/TextEditor.cs b/src/Tizen.NUI/src/public/BaseComponents/TextEditor.cs index 17185e7ad..b0d3dab04 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/TextEditor.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/TextEditor.cs @@ -14,14 +14,11 @@ * */ -extern alias TizenSystemSettings; -using TizenSystemSettings.Tizen.System; namespace Tizen.NUI.BaseComponents { using System; using System.Runtime.InteropServices; - using System.Globalization; /// /// A control which provides a multi-line editable text editor. @@ -29,9 +26,6 @@ namespace Tizen.NUI.BaseComponents public class TextEditor : View { private global::System.Runtime.InteropServices.HandleRef swigCPtr; - private string textEditorTextSid = null; - private string textEditorPlaceHolderTextSid = null; - private bool systemlangTextFlag = false; internal TextEditor(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.TextEditor_SWIGUpcast(cPtr), cMemoryOwn) { @@ -83,7 +77,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// Event arguments that passed via the TextChanged signal. + /// Event arguments that passed via TextChanged signal. /// public class TextChangedEventArgs : EventArgs { @@ -111,8 +105,8 @@ namespace Tizen.NUI.BaseComponents private TextChangedCallbackDelegate _textEditorTextChangedCallbackDelegate; /// - /// An event for the TextChanged signal which can be used to subscribe or unsubscribe the event handler - /// provided by the user. The TextChanged signal is emitted when the text changes.
+ /// Event for TextChanged signal which can be used to subscribe/unsubscribe the event handler + /// provided by the user. TextChanged signal is emitted when the text changes.
///
public event EventHandler TextChanged { @@ -151,7 +145,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// Event arguments that passed via the ScrollStateChanged signal. + /// Event arguments that passed via ScrollStateChanged signal. /// public class ScrollStateChangedEventArgs : EventArgs { @@ -195,8 +189,8 @@ namespace Tizen.NUI.BaseComponents private ScrollStateChangedCallbackDelegate _textEditorScrollStateChangedCallbackDelegate; /// - /// Event for the ScrollStateChanged signal which can be used to subscribe or unsubscribe the event handler - /// provided by the user. The ScrollStateChanged signal is emitted when the scroll state changes.
+ /// Event for ScrollStateChanged signal which can be used to subscribe/unsubscribe the event handler + /// provided by the user. ScrollStateChanged signal is emitted when the scroll state changes.
///
public event EventHandler ScrollStateChanged { @@ -237,7 +231,7 @@ namespace Tizen.NUI.BaseComponents } } - internal new class Property + internal class Property { internal static readonly int RENDERING_BACKEND = NDalicPINVOKE.TextEditor_Property_RENDERING_BACKEND_get(); internal static readonly int TEXT = NDalicPINVOKE.TextEditor_Property_TEXT_get(); @@ -353,82 +347,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The TranslatableText property.
- /// The text can set the SID value.
- ///
- /// - /// ResourceManager about multilingual is null. - /// - public string TranslatableText - { - get - { - return textEditorTextSid; - } - set - { - if (NUIApplication.MultilingualResourceManager == null) - { - throw new ArgumentNullException("ResourceManager about multilingual is null"); - } - textEditorTextSid = value; - Text = SetTranslatable(textEditorTextSid); - } - } - /// - /// The TranslatablePlaceholderText property.
- /// The text can set the SID value.
- ///
- /// - /// ResourceManager about multilingual is null. - /// - public string TranslatablePlaceholderText - { - get - { - return textEditorPlaceHolderTextSid; - } - set - { - if (NUIApplication.MultilingualResourceManager == null) - { - throw new ArgumentNullException("ResourceManager about multilingual is null"); - } - textEditorPlaceHolderTextSid = value; - PlaceholderText = SetTranslatable(textEditorPlaceHolderTextSid); - } - } - private string SetTranslatable(string textEditorSid) - { - string translatableText = null; - translatableText = NUIApplication.MultilingualResourceManager?.GetString(textEditorSid, new CultureInfo(SystemSettings.LocaleLanguage.Replace("_", "-"))); - if (translatableText != null) - { - if (systemlangTextFlag == false) - { - SystemSettings.LocaleLanguageChanged += new WeakEventHandler(SystemSettings_LocaleLanguageChanged).Handler; - systemlangTextFlag = true; - } - return translatableText; - } - else - { - translatableText = ""; - return translatableText; - } - } - private void SystemSettings_LocaleLanguageChanged(object sender, LocaleLanguageChangedEventArgs e) - { - if (textEditorTextSid != null) - { - Text = NUIApplication.MultilingualResourceManager?.GetString(textEditorTextSid, new CultureInfo(e.Value.Replace("_", "-"))); - } - if (textEditorPlaceHolderTextSid != null) - { - PlaceholderText = NUIApplication.MultilingualResourceManager?.GetString(textEditorPlaceHolderTextSid, new CultureInfo(e.Value.Replace("_", "-"))); - } - } - /// The Text property. + /// Text property. ///
public string Text { @@ -445,7 +364,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The TextColor property. + /// Text color property. /// public Vector4 TextColor { @@ -462,7 +381,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The FontFamily property. + /// Font family property. /// public string FontFamily { @@ -479,7 +398,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The FontStyle property. + /// Font style property. /// public PropertyMap FontStyle { @@ -496,7 +415,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The PointSize property. + /// Point size property. /// public float PointSize { @@ -513,7 +432,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The HorizontalAlignment property. + /// Horizontal alignment property. /// public HorizontalAlignment HorizontalAlignment { @@ -568,7 +487,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The ScrollThreshold property. + /// Scroll threshold property. /// public float ScrollThreshold { @@ -585,7 +504,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The ScrollSpeed property. + /// Scroll speed property. /// public float ScrollSpeed { @@ -602,7 +521,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The PrimaryCursorColor property. + /// Primary cursor color property. /// public Vector4 PrimaryCursorColor { @@ -619,7 +538,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The SecondaryCursorColor property. + /// SecondaryCursorColor property. /// public Vector4 SecondaryCursorColor { @@ -636,7 +555,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The EnableCursorBlink property. + /// EnableCursorBlink property. /// public bool EnableCursorBlink { @@ -653,7 +572,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The CursorBlinkInterval property. + /// CursorBlinkInterval property. /// public float CursorBlinkInterval { @@ -670,7 +589,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The CursorBlinkDuration property. + /// CursorBlinkDuration property. /// public float CursorBlinkDuration { @@ -687,7 +606,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The CursorWidth property. + /// CursorWidth property. /// public int CursorWidth { @@ -704,7 +623,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The GrabHandleImage property. + /// GrabHandleImage property. /// public string GrabHandleImage { @@ -721,7 +640,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The GrabHandlePressedImage property. + /// GrabHandlePressedImage property. /// public string GrabHandlePressedImage { @@ -738,7 +657,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The SelectionHandleImageLeft property. + /// SelectionHandleImageLeft property. /// public PropertyMap SelectionHandleImageLeft { @@ -755,7 +674,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The SelectionHandleImageRight property. + /// SelectionHandleImageRight property. /// public PropertyMap SelectionHandleImageRight { @@ -772,7 +691,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The SelectionHandlePressedImageLeft property. + /// SelectionHandlePressedImageLeft property. /// public PropertyMap SelectionHandlePressedImageLeft { @@ -789,7 +708,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The SelectionHandlePressedImageRight property. + /// SelectionHandlePressedImageRight property. /// public PropertyMap SelectionHandlePressedImageRight { @@ -806,7 +725,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The SelectionHandleMarkerImageLeft property. + /// SelectionHandleMarkerImageLeft property. /// public PropertyMap SelectionHandleMarkerImageLeft { @@ -823,7 +742,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The SelectionHandleMarkerImageRight property. + /// SelectionHandleMarkerImageRight property. /// public PropertyMap SelectionHandleMarkerImageRight { @@ -840,7 +759,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The SelectionHighlightColor property. + /// SelectionHighlightColor property. /// public Vector4 SelectionHighlightColor { @@ -857,7 +776,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The DecorationBoundingBox property. + /// DecorationBoundingBox property. /// public Rectangle DecorationBoundingBox { @@ -874,7 +793,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The EnableMarkup property. + /// EnableMarkup property. /// public bool EnableMarkup { @@ -891,7 +810,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The InputColor property. + /// InputColor property. /// public Vector4 InputColor { @@ -908,7 +827,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The InputFontFamily property. + /// InputFontFamily property. /// public string InputFontFamily { @@ -925,7 +844,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The InputFontStyle property. + /// InputFontStyle property. /// public PropertyMap InputFontStyle { @@ -942,7 +861,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The InputPointSize property. + /// InputPointSize property. /// public float InputPointSize { @@ -959,7 +878,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The LineSpacing property. + /// LineSpacing property. /// public float LineSpacing { @@ -976,7 +895,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The InputLineSpacing property. + /// InputLineSpacing property. /// public float InputLineSpacing { @@ -993,7 +912,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The Underline property. + /// Underline property. /// public PropertyMap Underline { @@ -1010,7 +929,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The InputUnderline property. + /// InputUnderline property. /// public string InputUnderline { @@ -1027,7 +946,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The Shadow property. + /// Shadow property. /// public PropertyMap Shadow { @@ -1044,7 +963,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The InputShadow property. + /// InputShadow property. /// public string InputShadow { @@ -1061,7 +980,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The Emboss property. + /// Emboss property. /// public string Emboss { @@ -1078,7 +997,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The InputEmboss property. + /// InputEmboss property. /// public string InputEmboss { @@ -1095,7 +1014,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The Outline property. + /// Outline property. /// public string Outline { @@ -1112,7 +1031,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The InputOutline property. + /// InputOutline property. /// public string InputOutline { @@ -1129,7 +1048,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The SmoothScroll property. + /// SmoothScroll property. /// public bool SmoothScroll { @@ -1146,7 +1065,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The SmoothScrollDuration property. + /// SmoothScrollDuration property. /// public float SmoothScrollDuration { @@ -1163,7 +1082,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The EnableScrollBar property. + /// EnableScrollBar property. /// public bool EnableScrollBar { @@ -1180,7 +1099,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The ScrollBarShowDuration property. + /// ScrollBarShowDuration property. /// public float ScrollBarShowDuration { @@ -1197,7 +1116,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The ScrollBarFadeDuration property. + /// ScrollBarFadeDuration property. /// public float ScrollBarFadeDuration { @@ -1214,7 +1133,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The PixelSize property. + /// PixelSize property. /// public float PixelSize { @@ -1231,7 +1150,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The line count of the text. + /// The line count of text. /// public int LineCount { @@ -1261,7 +1180,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The Placeholder text color. + /// The placeholder-text color. /// public Color PlaceholderTextColor { @@ -1278,7 +1197,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The EnableSelection property. + /// Enable selection property. /// public bool EnableSelection { @@ -1295,24 +1214,24 @@ namespace Tizen.NUI.BaseComponents } /// - /// The Placeholder property. - /// Gets or sets the placeholder: text, color, font family, font style, point size, and pixel size. + /// Placeholder property. + /// Gets/Sets the placeholder : text, color, font family, font style, point size, and pixel size. /// /// /// The following example demonstrates how to set the placeholder property. /// /// PropertyMap propertyMap = new PropertyMap(); - /// propertyMap.Add("placeholderText", new PropertyValue("Setting Placeholder Text")); - /// propertyMap.Add("placeholderTextFocused", new PropertyValue("Setting Placeholder Text Focused")); - /// propertyMap.Add("placeholderColor", new PropertyValue(Color.Red)); - /// propertyMap.Add("placeholderFontFamily", new PropertyValue("Arial")); - /// propertyMap.Add("placeholderPointSize", new PropertyValue(12.0f)); + /// propertyMap.Add("text", new PropertyValue("Setting Placeholder Text")); + /// propertyMap.Add("textFocused", new PropertyValue("Setting Placeholder Text Focused")); + /// propertyMap.Add("color", new PropertyValue(Color.Red)); + /// propertyMap.Add("fontFamily", new PropertyValue("Arial")); + /// propertyMap.Add("pointSize", new PropertyValue(12.0f)); /// /// PropertyMap fontStyleMap = new PropertyMap(); /// fontStyleMap.Add("weight", new PropertyValue("bold")); /// fontStyleMap.Add("width", new PropertyValue("condensed")); /// fontStyleMap.Add("slant", new PropertyValue("italic")); - /// propertyMap.Add("placeholderFontStyle", new PropertyValue(fontStyleMap)); + /// propertyMap.Add("fontStyle", new PropertyValue(fontStyleMap)); /// /// TextEditor editor = new TextEditor(); /// editor.Placeholder = propertyMap; @@ -1333,27 +1252,34 @@ namespace Tizen.NUI.BaseComponents } /// - /// The LineWrapMode property.
- /// The line wrap mode when the text lines over the layout width.
+ /// LineWrapMode property.
+ /// line wrap mode when the text lines over layout width.
///
public LineWrapMode LineWrapMode { get { string temp; - if(GetProperty(TextEditor.Property.LINE_WRAP_MODE).Get(out temp) == false) + if(GetProperty(TextLabel.Property.LINE_WRAP_MODE).Get(out temp) == false) { NUILog.Error("LineWrapMode get error!"); } + LineWrapMode lineWrapMode; switch (temp) { - case "WRAP_MODE_WORD": - return LineWrapMode.Word; - case "WRAP_MODE_CHARACTER": - return LineWrapMode.Character; + case "CHARACTER": + { + lineWrapMode = LineWrapMode.Character; + break; + } + case "WORD": default: - return LineWrapMode.Word; + { + lineWrapMode = LineWrapMode.Word; + break; + } } + return lineWrapMode; } set { @@ -1362,16 +1288,16 @@ namespace Tizen.NUI.BaseComponents { case LineWrapMode.Word: { - temp = "WRAP_MODE_WORD"; + temp = "WORD"; break; } case LineWrapMode.Character: { - temp = "WRAP_MODE_CHARACTER"; + temp = "CHARACTER"; break; } } - SetProperty(TextEditor.Property.LINE_WRAP_MODE, new Tizen.NUI.PropertyValue(temp)); + SetProperty(TextLabel.Property.LINE_WRAP_MODE, new Tizen.NUI.PropertyValue(temp)); } } diff --git a/src/Tizen.NUI/src/public/BaseComponents/TextField.cs b/src/Tizen.NUI/src/public/BaseComponents/TextField.cs index 898ea8d3c..f4de3c67c 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/TextField.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/TextField.cs @@ -13,23 +13,19 @@ * limitations under the License. * */ -extern alias TizenSystemSettings; -using TizenSystemSettings.Tizen.System; + namespace Tizen.NUI.BaseComponents { using System; using System.Runtime.InteropServices; - using System.Globalization; + /// - /// A control which provides a single line editable text field. + /// A control which provides a single-line editable text field. /// public class TextField : View { private global::System.Runtime.InteropServices.HandleRef swigCPtr; - private string textFieldTextSid = null; - private string textFieldPlaceHolderTextSid = null; - private bool systemlangTextFlag = false; internal TextField(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.TextField_SWIGUpcast(cPtr), cMemoryOwn) { @@ -42,7 +38,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// Dispose. + /// Dispose /// protected override void Dispose(DisposeTypes type) { @@ -87,7 +83,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The TextChanged event arguments. + /// Text changed event arguments. /// public class TextChangedEventArgs : EventArgs { @@ -110,7 +106,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The MaxLengthReached event arguments. + /// MaxLengthReached event arguments. /// public class MaxLengthReachedEventArgs : EventArgs { @@ -144,7 +140,7 @@ namespace Tizen.NUI.BaseComponents private MaxLengthReachedCallbackDelegate _textFieldMaxLengthReachedCallbackDelegate; /// - /// The TextChanged event. + /// TextChanged event. /// public event EventHandler TextChanged { @@ -183,7 +179,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The MaxLengthReached event. + /// MaxLengthReached event. /// public event EventHandler MaxLengthReached { @@ -221,7 +217,7 @@ namespace Tizen.NUI.BaseComponents } - internal new class Property + internal class Property { internal static readonly int RENDERING_BACKEND = NDalicPINVOKE.TextField_Property_RENDERING_BACKEND_get(); internal static readonly int TEXT = NDalicPINVOKE.TextField_Property_TEXT_get(); @@ -343,82 +339,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The TranslatableText property.
- /// The text can set the SID value.
- ///
- /// - /// ResourceManager about multilingual is null. - /// - public string TranslatableText - { - get - { - return textFieldTextSid; - } - set - { - if (NUIApplication.MultilingualResourceManager == null) - { - throw new ArgumentNullException("ResourceManager about multilingual is null"); - } - textFieldTextSid = value; - Text = SetTranslatable(textFieldTextSid); - } - } - /// - /// The TranslatablePlaceholderText property.
- /// The text can set the SID value.
- ///
- /// - /// ResourceManager about multilingual is null. - /// - public string TranslatablePlaceholderText - { - get - { - return textFieldPlaceHolderTextSid; - } - set - { - if (NUIApplication.MultilingualResourceManager == null) - { - throw new ArgumentNullException("ResourceManager about multilingual is null"); - } - textFieldPlaceHolderTextSid = value; - PlaceholderText = SetTranslatable(textFieldPlaceHolderTextSid); - } - } - private string SetTranslatable(string textFieldSid) - { - string translatableText = null; - translatableText = NUIApplication.MultilingualResourceManager?.GetString(textFieldSid, new CultureInfo(SystemSettings.LocaleLanguage.Replace("_", "-"))); - if (translatableText != null) - { - if (systemlangTextFlag == false) - { - SystemSettings.LocaleLanguageChanged += new WeakEventHandler(SystemSettings_LocaleLanguageChanged).Handler; - systemlangTextFlag = true; - } - return translatableText; - } - else - { - translatableText = ""; - return translatableText; - } - } - private void SystemSettings_LocaleLanguageChanged(object sender, LocaleLanguageChangedEventArgs e) - { - if (textFieldTextSid != null) - { - Text = NUIApplication.MultilingualResourceManager?.GetString(textFieldTextSid, new CultureInfo(e.Value.Replace("_", "-"))); - } - if (textFieldPlaceHolderTextSid != null) - { - PlaceholderText = NUIApplication.MultilingualResourceManager?.GetString(textFieldPlaceHolderTextSid, new CultureInfo(e.Value.Replace("_", "-"))); - } - } - /// The Text property. + /// Text property. /// public string Text { @@ -435,7 +356,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The PlaceholderText property. + /// PlaceholderText property. /// public string PlaceholderText { @@ -452,7 +373,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The PlaceholderTextFocused property. + /// PlaceholderTextFocused property. /// public string PlaceholderTextFocused { @@ -469,7 +390,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The FontFamily property. + /// FontFamily property. /// public string FontFamily { @@ -486,7 +407,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The FontStyle property. + /// FontStyle property. /// public PropertyMap FontStyle { @@ -503,7 +424,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The PointSize property. + /// PointSize property. /// public float PointSize { @@ -520,7 +441,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The MaxLength property. + /// MaxLength property. /// public int MaxLength { @@ -537,7 +458,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The ExceedPolicy property. + /// ExceedPolicy property. /// public int ExceedPolicy { @@ -554,7 +475,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The HorizontalAlignment property. + /// HorizontalAlignment property. /// public HorizontalAlignment HorizontalAlignment { @@ -609,7 +530,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The VerticalAlignment property. + /// VerticalAlignment property. /// public VerticalAlignment VerticalAlignment { @@ -664,7 +585,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The TextColor property. + /// TextColor property. /// public Color TextColor { @@ -681,7 +602,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The PlaceholderTextColor property. + /// PlaceholderTextColor property. /// public Vector4 PlaceholderTextColor { @@ -698,7 +619,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The ShadowOffset property. + /// ShadowOffset property. /// public Vector2 ShadowOffset { @@ -715,7 +636,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The ShadowColor property. + /// ShadowColor property. /// public Vector4 ShadowColor { @@ -732,7 +653,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The PrimaryCursorColor property. + /// PrimaryCursorColor property. /// public Vector4 PrimaryCursorColor { @@ -749,7 +670,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The SecondaryCursorColor property. + /// SecondaryCursorColor property. /// public Vector4 SecondaryCursorColor { @@ -766,7 +687,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The EnableCursorBlink property. + /// EnableCursorBlink property. /// public bool EnableCursorBlink { @@ -783,7 +704,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The CursorBlinkInterval property. + /// CursorBlinkInterval property. /// public float CursorBlinkInterval { @@ -800,7 +721,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The CursorBlinkDuration property. + /// CursorBlinkDuration property. /// public float CursorBlinkDuration { @@ -817,7 +738,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The CursorWidth property. + /// CursorWidth property. /// public int CursorWidth { @@ -834,7 +755,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The GrabHandleImage property. + /// GrabHandleImage property. /// public string GrabHandleImage { @@ -851,7 +772,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The GrabHandlePressedImage property. + /// GrabHandlePressedImage property. /// public string GrabHandlePressedImage { @@ -868,7 +789,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The ScrollThreshold property. + /// ScrollThreshold property. /// public float ScrollThreshold { @@ -885,7 +806,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The ScrollSpeed property. + /// ScrollSpeed property. /// public float ScrollSpeed { @@ -902,7 +823,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The SelectionHandleImageLeft property. + /// SelectionHandleImageLeft property. /// public PropertyMap SelectionHandleImageLeft { @@ -919,7 +840,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The SelectionHandleImageRight property. + /// SelectionHandleImageRight property. /// public PropertyMap SelectionHandleImageRight { @@ -936,7 +857,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The SelectionHandlePressedImageLeft property. + /// SelectionHandlePressedImageLeft property. /// public PropertyMap SelectionHandlePressedImageLeft { @@ -953,7 +874,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The SelectionHandlePressedImageRight property. + /// SelectionHandlePressedImageRight property. /// public PropertyMap SelectionHandlePressedImageRight { @@ -970,7 +891,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The SelectionHandleMarkerImageLeft property. + /// SelectionHandleMarkerImageLeft property. /// public PropertyMap SelectionHandleMarkerImageLeft { @@ -987,7 +908,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The SelectionHandleMarkerImageRight property. + /// SelectionHandleMarkerImageRight property. /// public PropertyMap SelectionHandleMarkerImageRight { @@ -1004,7 +925,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The SelectionHighlightColor property. + /// SelectionHighlightColor property. /// public Vector4 SelectionHighlightColor { @@ -1021,7 +942,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The DecorationBoundingBox property. + /// DecorationBoundingBox property. /// public Rectangle DecorationBoundingBox { @@ -1038,7 +959,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The InputMethodSettings property. + /// InputMethodSettings property. /// public PropertyMap InputMethodSettings { @@ -1055,7 +976,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The InputColor property. + /// InputColor property. /// public Vector4 InputColor { @@ -1072,7 +993,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The EnableMarkup property. + /// EnableMarkup property. /// public bool EnableMarkup { @@ -1089,7 +1010,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The InputFontFamily property. + /// InputFontFamily property. /// public string InputFontFamily { @@ -1106,7 +1027,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The InputFontStyle property. + /// InputFontStyle property. /// public PropertyMap InputFontStyle { @@ -1123,7 +1044,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The InputPointSize property. + /// InputPointSize property. /// public float InputPointSize { @@ -1140,7 +1061,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The Underline property. + /// Underline property. /// public PropertyMap Underline { @@ -1157,7 +1078,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The InputUnderline property. + /// InputUnderline property. /// public string InputUnderline { @@ -1174,7 +1095,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The Shadow property. + /// Shadow property. /// public PropertyMap Shadow { @@ -1191,7 +1112,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The InputShadow property. + /// InputShadow property. /// public string InputShadow { @@ -1208,7 +1129,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The Emboss property. + /// Emboss property. /// public string Emboss { @@ -1225,7 +1146,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The InputEmboss property. + /// InputEmboss property. /// public string InputEmboss { @@ -1242,7 +1163,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The Outline property. + /// Outline property. /// public string Outline { @@ -1259,7 +1180,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The InputOutline property. + /// InputOutline property. /// public string InputOutline { @@ -1276,7 +1197,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The HiddenInputSettings property. + /// HiddenInputSettings property. /// public Tizen.NUI.PropertyMap HiddenInputSettings { @@ -1293,7 +1214,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The PixelSize property. + /// PixelSize property. /// public float PixelSize { @@ -1310,7 +1231,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The Enable selection property. + /// Enable selection property. /// public bool EnableSelection { @@ -1327,24 +1248,24 @@ namespace Tizen.NUI.BaseComponents } /// - /// The Placeholder property. - /// Gets or sets the placeholder: text, color, font family, font style, point size, and pixel size. + /// Placeholder property. + /// Gets/Sets the placeholder : text, color, font family, font style, point size, and pixel size. /// /// - /// The following example demonstrates how to set the Placeholder property. + /// The following example demonstrates how to set the placeholder property. /// /// PropertyMap propertyMap = new PropertyMap(); - /// propertyMap.Add("placeholderText", new PropertyValue("Setting Placeholder Text")); - /// propertyMap.Add("placeholderTextFocused", new PropertyValue("Setting Placeholder Text Focused")); - /// propertyMap.Add("placeholderColor", new PropertyValue(Color.Red)); - /// propertyMap.Add("placeholderFontFamily", new PropertyValue("Arial")); - /// propertyMap.Add("placeholderPointSize", new PropertyValue(12.0f)); + /// propertyMap.Add("text", new PropertyValue("Setting Placeholder Text")); + /// propertyMap.Add("textFocused", new PropertyValue("Setting Placeholder Text Focused")); + /// propertyMap.Add("color", new PropertyValue(Color.Red)); + /// propertyMap.Add("fontFamily", new PropertyValue("Arial")); + /// propertyMap.Add("pointSize", new PropertyValue(12.0f)); /// /// PropertyMap fontStyleMap = new PropertyMap(); /// fontStyleMap.Add("weight", new PropertyValue("bold")); /// fontStyleMap.Add("width", new PropertyValue("condensed")); /// fontStyleMap.Add("slant", new PropertyValue("italic")); - /// propertyMap.Add("placeholderFontStyle", new PropertyValue(fontStyleMap)); + /// propertyMap.Add("fontStyle", new PropertyValue(fontStyleMap)); /// /// TextField field = new TextField(); /// field.Placeholder = propertyMap; diff --git a/src/Tizen.NUI/src/public/BaseComponents/TextLabel.cs b/src/Tizen.NUI/src/public/BaseComponents/TextLabel.cs index 32ca8f36b..01a61fe34 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/TextLabel.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/TextLabel.cs @@ -14,22 +14,19 @@ * */ -extern alias TizenSystemSettings; -using TizenSystemSettings.Tizen.System; using System; -using System.Globalization; + namespace Tizen.NUI.BaseComponents { /// /// A control which renders a short text string.
- /// Text labels are lightweight, non-editable, and do not respond to the user input.
+ /// Text labels are lightweight, non-editable and do not respond to user input.
///
public class TextLabel : View { private global::System.Runtime.InteropServices.HandleRef swigCPtr; - private string textLabelSid = null; - private bool systemlangTextFlag = false; + internal TextLabel(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.TextLabel_SWIGUpcast(cPtr), cMemoryOwn) { swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); @@ -41,7 +38,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// Dispose. + /// Dispose /// protected override void Dispose(DisposeTypes type) { @@ -74,7 +71,7 @@ namespace Tizen.NUI.BaseComponents base.Dispose(type); } - internal new class Property + internal class Property { internal static readonly int RENDERING_BACKEND = NDalicPINVOKE.TextLabel_Property_RENDERING_BACKEND_get(); internal static readonly int TEXT = NDalicPINVOKE.TextLabel_Property_TEXT_get(); @@ -106,8 +103,6 @@ namespace Tizen.NUI.BaseComponents internal static readonly int AUTO_SCROLL_LOOP_DELAY = NDalicManualPINVOKE.TextLabel_Property_AUTO_SCROLL_LOOP_DELAY_get(); internal static readonly int LINE_COUNT = NDalicManualPINVOKE.TextLabel_Property_LINE_COUNT_get(); internal static readonly int LINE_WRAP_MODE = NDalicManualPINVOKE.TextLabel_Property_LINE_WRAP_MODE_get(); - internal static readonly int TEXT_COLOR_ANIMATABLE = NDalicPINVOKE.TextLabel_Property_TEXT_COLOR_ANIMATABLE_get(); - } /// @@ -138,55 +133,13 @@ namespace Tizen.NUI.BaseComponents public new static TextLabel DownCast(BaseHandle handle) { TextLabel ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as TextLabel; - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } - /// - /// The TranslatableText property.
- /// The text can set the SID value.
- ///
- /// - /// ResourceManager about multilingual is null. - /// - public string TranslatableText - { - get - { - return textLabelSid; - } - set - { - if (NUIApplication.MultilingualResourceManager == null) - { - throw new ArgumentNullException("ResourceManager about multilingual is null"); - } - string translatableText = null; - textLabelSid = value; - translatableText = NUIApplication.MultilingualResourceManager?.GetString(textLabelSid, new CultureInfo(SystemSettings.LocaleLanguage.Replace("_", "-"))); - if (translatableText != null) - { - Text = translatableText; - if (systemlangTextFlag == false) - { - SystemSettings.LocaleLanguageChanged += new WeakEventHandler(SystemSettings_LocaleLanguageChanged).Handler; - systemlangTextFlag = true; - } - } - else - { - Text = ""; - } - } - } - private void SystemSettings_LocaleLanguageChanged(object sender, LocaleLanguageChangedEventArgs e) - { - Text = NUIApplication.MultilingualResourceManager?.GetString(textLabelSid, new CultureInfo(e.Value.Replace("_", "-"))); - } /// - /// The Text property.
- /// The text to display in the UTF-8 format.
+ /// Text property.
+ /// The text to display in UTF-8 format.
///
public string Text { @@ -203,7 +156,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The FontFamily property.
+ /// FontFamily property.
/// The requested font family to use.
///
public string FontFamily @@ -221,7 +174,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The FontStyle property.
+ /// FontStyle property.
/// The requested font style to use.
///
public PropertyMap FontStyle @@ -239,7 +192,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The PointSize property.
+ /// PointSize property.
/// The size of font in points.
///
public float PointSize @@ -257,7 +210,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The MultiLine property.
+ /// MultiLine property.
/// The single-line or multi-line layout option.
///
public bool MultiLine @@ -275,7 +228,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The HorizontalAlignment property.
+ /// HorizontalAlignment property.
/// The line horizontal alignment.
///
public HorizontalAlignment HorizontalAlignment @@ -330,7 +283,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The VerticalAlignment property.
+ /// VerticalAlignment property.
/// The line vertical alignment.
///
public VerticalAlignment VerticalAlignment @@ -386,8 +339,10 @@ namespace Tizen.NUI.BaseComponents } /// - /// The TextColor property.
+ /// TextColor property.
/// The color of the text.
+ /// Animation framework can be used to change the color of the text when not using mark up.
+ /// Cannot animate the color when text is auto scrolling.
///
public Color TextColor { @@ -404,7 +359,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The ShadowOffset property.
+ /// ShadowOffset property.
/// The drop shadow offset 0 indicates no shadow.
///
public Vector2 ShadowOffset @@ -422,7 +377,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The ShadowColor property.
+ /// ShadowColor property.
/// The color of a drop shadow.
///
public Vector4 ShadowColor @@ -440,7 +395,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The UnderlineEnabled property.
+ /// UnderlineEnabled property.
/// The underline enabled flag.
///
public bool UnderlineEnabled @@ -458,7 +413,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The UnderlineColor property.
+ /// UnderlineColor property.
/// Overrides the underline height from font metrics.
///
public Vector4 UnderlineColor @@ -476,7 +431,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The UnderlineHeight property.
+ /// UnderlineHeight property.
/// Overrides the underline height from font metrics.
///
public float UnderlineHeight @@ -494,7 +449,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The EnableMarkup property.
+ /// EnableMarkup property.
/// Whether the mark-up processing is enabled.
///
public bool EnableMarkup @@ -512,7 +467,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The EnableAutoScroll property.
+ /// EnableAutoScroll property.
/// Starts or stops auto scrolling.
///
public bool EnableAutoScroll @@ -530,7 +485,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The AutoScrollSpeed property.
+ /// AutoScrollSpeed property.
/// Sets the speed of scrolling in pixels per second.
///
public int AutoScrollSpeed @@ -548,7 +503,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The AutoScrollLoopCount property.
+ /// AutoScrollLoopCount property.
/// Number of complete loops when scrolling enabled.
///
public int AutoScrollLoopCount @@ -566,7 +521,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The AutoScrollGap property.
+ /// AutoScrollGap property.
/// Gap before scrolling wraps.
///
public float AutoScrollGap @@ -584,7 +539,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The LineSpacing property.
+ /// LineSpacing property.
/// The default extra space between lines in points.
///
public float LineSpacing @@ -602,7 +557,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The Underline property.
+ /// Underline property.
/// The default underline parameters.
///
public PropertyMap Underline @@ -620,7 +575,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The Shadow property.
+ /// Shadow property.
/// The default shadow parameters.
///
public PropertyMap Shadow @@ -638,7 +593,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The Emboss property.
+ /// Emboss property.
/// The default emboss parameters.
///
public string Emboss @@ -656,7 +611,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The Outline property.
+ /// Outline property.
/// The default outline parameters.
///
public string Outline @@ -674,7 +629,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The PixelSize property.
+ /// PixelSize property.
/// The size of font in pixels.
///
public float PixelSize @@ -692,7 +647,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The Ellipsis property.
+ /// Ellipsis property.
/// Enable or disable the ellipsis.
///
public bool Ellipsis @@ -710,8 +665,8 @@ namespace Tizen.NUI.BaseComponents } /// - /// The AutoScrollLoopDelay property.
- /// Do something.
+ /// AutoScrollLoopDelay property.
+ /// do something.
///
public float AutoScrollLoopDelay { @@ -728,8 +683,8 @@ namespace Tizen.NUI.BaseComponents } /// - /// The AutoScrollStopMode property.
- /// Do something.
+ /// AutoScrollStopMode property.
+ /// do something.
///
public AutoScrollStopMode AutoScrollStopMode { @@ -740,15 +695,23 @@ namespace Tizen.NUI.BaseComponents { NUILog.Error("AutoScrollStopMode get error!"); } + AutoScrollStopMode autoScrollStopMode; switch (temp) { - case "FINISH_LOOP": - return AutoScrollStopMode.FinishLoop; + case "IMMEDIATE": - return AutoScrollStopMode.Immediate; + { + autoScrollStopMode = AutoScrollStopMode.Immediate; + break; + } + case "FINISH_LOOP": default: - return AutoScrollStopMode.FinishLoop; + { + autoScrollStopMode = AutoScrollStopMode.FinishLoop; + break; + } } + return autoScrollStopMode; } set { @@ -757,26 +720,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The TextColorAnimatable property.
- /// The color of the text that can be animatated.
- /// Animation framework can be used to change the color of the text when not using mark up.
- /// Not possible when text is auto scrolling.
- ///
- public Color TextColorAnimatable - { - get - { - Color animatableColor = new Color(0.0f, 0.0f, 0.0f, 0.0f); - GetProperty(TextLabel.Property.TEXT_COLOR_ANIMATABLE).Get(animatableColor); - return animatableColor; - } - set - { - SetProperty(TextLabel.Property.TEXT_COLOR_ANIMATABLE, new Tizen.NUI.PropertyValue(value)); - } - } - - /// The line count of the text. + /// The line count of text. ///
public int LineCount { @@ -789,7 +733,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The LineWrapMode property.
+ /// LineWrapMode property.
/// line wrap mode when the text lines over layout width.
///
public LineWrapMode LineWrapMode @@ -801,15 +745,22 @@ namespace Tizen.NUI.BaseComponents { NUILog.Error("LineWrapMode get error!"); } + LineWrapMode lineWrapMode; switch (temp) { - case "WRAP_MODE_WORD": - return LineWrapMode.Word; - case "WRAP_MODE_CHARACTER": - return LineWrapMode.Character; + case "CHARACTER": + { + lineWrapMode = LineWrapMode.Character; + break; + } default: - return LineWrapMode.Word; + case "WORD": + { + lineWrapMode = LineWrapMode.Word; + break; + } } + return lineWrapMode; } set { @@ -818,17 +769,18 @@ namespace Tizen.NUI.BaseComponents { case LineWrapMode.Word: { - temp = "WRAP_MODE_WORD"; + temp = "WORD"; break; } case LineWrapMode.Character: { - temp = "WRAP_MODE_CHARACTER"; + temp = "CHARACTER"; break; } } SetProperty(TextLabel.Property.LINE_WRAP_MODE, new Tizen.NUI.PropertyValue(temp)); } } + } } diff --git a/src/Tizen.NUI/src/public/BaseComponents/VideoView.cs b/src/Tizen.NUI/src/public/BaseComponents/VideoView.cs index a70d5cb11..ae73ef1ba 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/VideoView.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/VideoView.cs @@ -74,7 +74,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// Event arguments that passed via the finished signal. + /// Event arguments that passed via Finished signal /// public class FinishedEventArgs : EventArgs { @@ -104,9 +104,9 @@ namespace Tizen.NUI.BaseComponents /// - /// Event for the finished signal which can be used to subscribe or unsubscribe the event handler + /// Event for Finished signal which can be used to subscribe/unsubscribe the event handler /// (in the type of FinishedEventHandler-DaliEventHandler) provided by the user.
- /// The finished signal is emitted when a video playback has finished.
+ /// Finished signal is emitted when a video playback have finished.
///
public event EventHandler Finished { @@ -144,7 +144,7 @@ namespace Tizen.NUI.BaseComponents } } - internal new class Property + internal class Property { internal static readonly int VIDEO = NDalicPINVOKE.VideoView_Property_VIDEO_get(); internal static readonly int LOOPING = NDalicPINVOKE.VideoView_Property_LOOPING_get(); @@ -165,7 +165,7 @@ namespace Tizen.NUI.BaseComponents /// Creates an initialized VideoView.
/// If the string is empty, VideoView will not display anything.
/// - /// The URL of the video resource to display. + /// The url of the video resource to display public VideoView(string url) : this(NDalicPINVOKE.VideoView_New__SWIG_1(url), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -214,7 +214,7 @@ namespace Tizen.NUI.BaseComponents /// /// Seeks forward by the specified number of milliseconds. /// - /// The position for forward playback. + /// The position for forward playback public void Forward(int millisecond) { NDalicPINVOKE.VideoView_Forward(swigCPtr, millisecond); @@ -224,7 +224,7 @@ namespace Tizen.NUI.BaseComponents /// /// Seeks backward by the specified number of milliseconds. /// - /// The position for backward playback. + /// The position for backward playback public void Backward(int millisecond) { NDalicPINVOKE.VideoView_Backward(swigCPtr, millisecond); @@ -239,7 +239,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// Video file URL as string type or PropertyMap. + /// video file url as string type or PropertyMap. /// public PropertyMap Video { @@ -256,7 +256,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The looping status, true or false. + /// looping status, true or false. /// public bool Looping { @@ -273,7 +273,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The mute status, true or false. + /// mute status, true or false. /// public bool Muted { @@ -290,7 +290,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The left and the right volume scalar as float type, PropertyMap with two values ( "left" and "right" ). + /// left and right volume scalar as float type, PropertyMap with two values ( "left" and "right" ). /// public PropertyMap Volume { diff --git a/src/Tizen.NUI/src/public/BaseComponents/View.cs b/src/Tizen.NUI/src/public/BaseComponents/View.cs index 1002e876c..1f9940e42 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/View.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/View.cs @@ -27,6 +27,7 @@ namespace Tizen.NUI.BaseComponents { private global::System.Runtime.InteropServices.HandleRef swigCPtr; + internal View(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicPINVOKE.View_SWIGUpcast(cPtr), cMemoryOwn) { swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); @@ -41,7 +42,7 @@ namespace Tizen.NUI.BaseComponents // From Container Base class /// - /// Adds a child view to this view. + /// Adds a child view to this View. /// /// /// @@ -50,10 +51,12 @@ namespace Tizen.NUI.BaseComponents NDalicPINVOKE.Actor_Add(swigCPtr, View.getCPtr(child)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + + Children.Add(child); } /// - /// Removes a child view from this View. If the view was not a child of this view, this is a no-op. + /// Removes a child View from this View. If the view was not a child of this view, this is a no-op. /// /// /// @@ -62,22 +65,25 @@ namespace Tizen.NUI.BaseComponents NDalicPINVOKE.Actor_Remove(swigCPtr, View.getCPtr(child)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + + Children.Remove(child); } /// - /// Retrieves a child view by index. + /// Retrieves child view by index. /// /// /// public override View GetChildAt(uint index) { - IntPtr cPtr = NDalicPINVOKE.Actor_GetChildAt(swigCPtr, index); - - View ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as View; - - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret ?? null; + if (index < Children.Count) + { + return Children[Convert.ToInt32(index)]; + } + else + { + return null; + } } /// @@ -87,51 +93,27 @@ namespace Tizen.NUI.BaseComponents /// protected override uint GetChildCount() { - uint ret = NDalicPINVOKE.Actor_GetChildCount(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + return Convert.ToUInt32(Children.Count); } /// - /// Gets the views parent. + /// Get the Views parent /// /// + protected override Container GetParent() { - Container ret; IntPtr cPtr = NDalicPINVOKE.Actor_GetParent(swigCPtr); BaseHandle basehandle = Registry.GetManagedBaseHandleFromNativePtr(cPtr); - if(basehandle is Layer) - { - ret = basehandle as Layer; - } - else - { - ret = basehandle as View; - } - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - [Obsolete("This is temporal API. Currently Parent returns View but Container class has been introduced so 'View Parent' will be changed 'Container Parent' later soon, then this will be removed")] - public Container GetContainerParent() - { - return this.GetParent(); + return basehandle as Container; } - internal bool IsTopLevelView() - { - if(GetContainerParent() is Layer) - { - return true; - } - return false; - } + /// // you can override it to clean-up your own resources. protected override void Dispose(DisposeTypes type) @@ -165,6 +147,13 @@ namespace Tizen.NUI.BaseComponents } base.Dispose(type); + + // Dispose all Children of this View. + foreach (View childView in Children) + { + childView?.Dispose(); + } + Children.Clear(); } private void DisConnectFromSignals() @@ -266,8 +255,8 @@ namespace Tizen.NUI.BaseComponents private KeyInputFocusGainedCallbackType _keyInputFocusGainedCallback; /// - /// An event for the KeyInputFocusGained signal which can be used to subscribe or unsubscribe the event handler provided by the user.
- /// The KeyInputFocusGained signal is emitted when the control gets the key input focus.
+ /// Event for KeyInputFocusGained signal which can be used to subscribe/unsubscribe the event handler provided by the user.
+ /// KeyInputFocusGained signal is emitted when the control gets Key Input Focus.
///
public event EventHandler FocusGained { @@ -308,8 +297,8 @@ namespace Tizen.NUI.BaseComponents private KeyInputFocusLostCallbackType _keyInputFocusLostCallback; /// - /// An event for the KeyInputFocusLost signal which can be used to subscribe or unsubscribe the event handler provided by the user.
- /// The KeyInputFocusLost signal is emitted when the control loses the key input focus.
+ /// Event for KeyInputFocusLost signal which can be used to subscribe/unsubscribe the event handler provided by the user.
+ /// KeyInputFocusLost signal is emitted when the control loses Key Input Focus.
///
public event EventHandler FocusLost { @@ -344,14 +333,14 @@ namespace Tizen.NUI.BaseComponents } /// - /// Event arguments that passed via the KeyEvent signal. + /// Event arguments that passed via KeyEvent signal. /// public class KeyEventArgs : EventArgs { private Key _key; /// - /// Key - is the key sent to the view. + /// Key - is the key sent to the View. /// public Key Key { @@ -372,8 +361,8 @@ namespace Tizen.NUI.BaseComponents private KeyCallbackType _keyCallback; /// - /// An event for the KeyPressed signal which can be used to subscribe or unsubscribe the event handler provided by the user.
- /// The KeyPressed signal is emitted when the key event is received.
+ /// Event for KeyPressed signal which can be used to subscribe/unsubscribe the event handler provided by the user.
+ /// KeyPressed signal is emitted when key event is received.
///
public event EventHandlerWithReturnType KeyEvent { @@ -427,8 +416,8 @@ namespace Tizen.NUI.BaseComponents private OnRelayoutEventCallbackType _onRelayoutEventCallback; /// - /// An event for the OnRelayout signal which can be used to subscribe or unsubscribe the event handler.
- /// The OnRelayout signal is emitted after the size has been set on the view during relayout.
+ /// Event for OnRelayout signal which can be used to subscribe/unsubscribe the event handler.
+ /// OnRelayout signal is emitted after the size has been set on the view during relayout.
///
public event EventHandler Relayout { @@ -465,14 +454,14 @@ namespace Tizen.NUI.BaseComponents } /// - /// Event arguments that passed via the touch signal. + /// Event arguments that passed via Touch signal. /// public class TouchEventArgs : EventArgs { private Touch _touch; /// - /// Touch - contains the information of touch points. + /// Touch - contains the information of touch points /// public Touch Touch { @@ -493,8 +482,8 @@ namespace Tizen.NUI.BaseComponents private TouchDataCallbackType _touchDataCallback; /// - /// An event for the touched signal which can be used to subscribe or unsubscribe the event handler provided by the user.
- /// The touched signal is emitted when the touch input is received.
+ /// Event for Touched signal which can be used to subscribe/unsubscribe the event handler provided by the user.
+ /// Touched signal is emitted when touch input is received.
///
public event EventHandlerWithReturnType TouchEvent { @@ -537,7 +526,7 @@ namespace Tizen.NUI.BaseComponents /// - /// Event arguments that passed via the hover signal. + /// Event arguments that passed via Hover signal. /// public class HoverEventArgs : EventArgs { @@ -565,8 +554,8 @@ namespace Tizen.NUI.BaseComponents private HoverEventCallbackType _hoverEventCallback; /// - /// An event for the hovered signal which can be used to subscribe or unsubscribe the event handler provided by the user.
- /// The hovered signal is emitted when the hover input is received.
+ /// Event for Hovered signal which can be used to subscribe/unsubscribe the event handler provided by the user.
+ /// Hovered signal is emitted when hover input is received.
///
public event EventHandlerWithReturnType HoverEvent { @@ -609,14 +598,14 @@ namespace Tizen.NUI.BaseComponents /// - /// Event arguments that passed via the wheel signal. + /// Event arguments that passed via Wheel signal. /// public class WheelEventArgs : EventArgs { private Wheel _wheel; /// - /// WheelEvent - store a wheel rolling type: MOUSE_WHEEL or CUSTOM_WHEEL. + /// WheelEvent - store a wheel rolling type : MOUSE_WHEEL or CUSTOM_WHEEL /// public Wheel Wheel { @@ -637,8 +626,8 @@ namespace Tizen.NUI.BaseComponents private WheelEventCallbackType _wheelEventCallback; /// - /// An event for the WheelMoved signal which can be used to subscribe or unsubscribe the event handler provided by the user.
- /// The WheelMoved signal is emitted when the wheel event is received.
+ /// Event for WheelMoved signal which can be used to subscribe/unsubscribe the event handler provided by the user.
+ /// WheelMoved signal is emitted when wheel event is received.
///
public event EventHandlerWithReturnType WheelEvent { @@ -686,8 +675,8 @@ namespace Tizen.NUI.BaseComponents private OnWindowEventCallbackType _onWindowEventCallback; /// - /// An event for the OnWindow signal which can be used to subscribe or unsubscribe the event handler.
- /// The OnWindow signal is emitted after the view has been connected to the window.
+ /// Event for OnWindow signal which can be used to subscribe/unsubscribe the event handler.
+ /// OnWindow signal is emitted after the view has been connected to the Window.
///
public event EventHandler AddedToWindow { @@ -729,8 +718,8 @@ namespace Tizen.NUI.BaseComponents private OffWindowEventCallbackType _offWindowEventCallback; /// - /// An event for the OffWindow signal, which can be used to subscribe or unsubscribe the event handler.
- /// OffWindow signal is emitted after the view has been disconnected from the window.
+ /// Event for OffWindow signal which can be used to subscribe/unsubscribe the event handler.
+ /// OffWindow signal is emitted after the view has been disconnected from the Window.
///
public event EventHandler RemovedFromWindow { @@ -826,7 +815,7 @@ namespace Tizen.NUI.BaseComponents private VisibilityChangedEventCallbackType _visibilityChangedEventCallback; /// - /// An event for visibility change which can be used to subscribe or unsubscribe the event handler.
+ /// Event for visibility change which can be used to subscribe/unsubscribe the event handler.
/// This signal is emitted when the visible property of this or a parent view is changed.
///
public event EventHandler VisibilityChanged @@ -870,101 +859,6 @@ namespace Tizen.NUI.BaseComponents } } - - /// - /// Event arguments of layout direction changed. - /// - public class LayoutDirectionChangedEventArgs : EventArgs - { - private View _view; - private ViewLayoutDirectionType _type; - - /// - /// The view, or child of view, whose layout direction has changed. - /// - public View View - { - get - { - return _view; - } - set - { - _view = value; - } - } - - /// - /// Whether the view's layout direction property has changed or a parent's. - /// - public ViewLayoutDirectionType Type - { - get - { - return _type; - } - set - { - _type = value; - } - } - } - - private EventHandler _layoutDirectionChangedEventHandler; - [UnmanagedFunctionPointer(CallingConvention.StdCall)] - private delegate void LayoutDirectionChangedEventCallbackType(IntPtr data, ViewLayoutDirectionType type); - private LayoutDirectionChangedEventCallbackType _layoutDirectionChangedEventCallback; - - /// - /// Event for layout direction change which can be used to subscribe/unsubscribe the event handler.
- /// This signal is emitted when the layout direction property of this or a parent view is changed.
- ///
- public event EventHandler LayoutDirectionChanged - { - add - { - if (_layoutDirectionChangedEventHandler == null) - { - _layoutDirectionChangedEventCallback = OnLayoutDirectionChanged; - LayoutDirectionChangedSignal(this).Connect(_layoutDirectionChangedEventCallback); - } - - _layoutDirectionChangedEventHandler += value; - } - - remove - { - _layoutDirectionChangedEventHandler -= value; - - if (_layoutDirectionChangedEventHandler == null && LayoutDirectionChangedSignal(this).Empty() == false) - { - LayoutDirectionChangedSignal(this).Disconnect(_layoutDirectionChangedEventCallback); - } - } - } - - // Callback for View layout direction change signal - private void OnLayoutDirectionChanged(IntPtr data, ViewLayoutDirectionType type) - { - LayoutDirectionChangedEventArgs e = new LayoutDirectionChangedEventArgs(); - if (data != null) - { - e.View = Registry.GetManagedBaseHandleFromNativePtr(data) as View; - } - e.Type = type; - - if (_layoutDirectionChangedEventHandler != null) - { - _layoutDirectionChangedEventHandler(this, e); - } - } - - - - - - - // Resource Ready Signal private EventHandler _resourcesLoadedEventHandler; @@ -973,8 +867,8 @@ namespace Tizen.NUI.BaseComponents private ResourcesLoadedCallbackType _ResourcesLoadedCallback; /// - /// An event for the ResourcesLoadedSignal signal which can be used to subscribe or unsubscribe the event handler provided by the user.
- /// This signal is emitted after all resources required by a view are loaded and ready.
+ /// Event for ResourcesLoadedSignal signal which can be used to subscribe/unsubscribe the event handler provided by the user.
+ /// This signal is emitted after all resources required by a View are loaded and ready.
///
public event EventHandler ResourcesLoaded { @@ -1075,8 +969,6 @@ namespace Tizen.NUI.BaseComponents internal static readonly int MAXIMUM_SIZE = NDalicPINVOKE.Actor_Property_MAXIMUM_SIZE_get(); internal static readonly int INHERIT_POSITION = NDalicPINVOKE.Actor_Property_INHERIT_POSITION_get(); internal static readonly int CLIPPING_MODE = NDalicPINVOKE.Actor_Property_CLIPPING_MODE_get(); - internal static readonly int INHERIT_LAYOUT_DIRECTION = NDalicManualPINVOKE.Actor_Property_INHERIT_LAYOUT_DIRECTION_get(); - internal static readonly int LAYOUT_DIRECTION = NDalicManualPINVOKE.Actor_Property_LAYOUT_DIRECTION_get(); } /// @@ -1093,7 +985,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// Creates a new instance of a view. + /// Creates a new instance of a View. /// public View() : this(NDalicPINVOKE.View_New(), true) { @@ -1106,21 +998,21 @@ namespace Tizen.NUI.BaseComponents } /// - /// Downcasts a handle to view handle.
- /// If handle points to a view, the downcast produces a valid handle.
+ /// Downcasts a handle to View handle.
+ /// If handle points to a View, the downcast produces valid handle.
/// If not, the returned handle is left uninitialized.
///
- /// A handle to an object. - /// A handle to a view or an uninitialized handle. - [Obsolete("Please do not use! this will be deprecated, instead please use as keyword.")] - public static View DownCast(BaseHandle handle) + /// Handle to an object + /// A handle to a View or an uninitialized handle + [Obsolete("Please do not use! this will be deprecated, instead please us as keyword.")] + public new static View DownCast(BaseHandle handle) { View ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as View; if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } - [Obsolete("Please do not use! this will be deprecated, instead please use as keyword.")] + [Obsolete("Please do not use! this will be deprecated, instead please us as keyword.")] public static T DownCast(View view) where T : View { T ret = Registry.GetManagedBaseHandleFromNativePtr(view) as T; @@ -1156,9 +1048,9 @@ namespace Tizen.NUI.BaseComponents } /// - /// Queries whether the view has a focus. + /// Quries whether the view has focus. /// - /// True if this view has a focus. + /// true if this view has focus public bool HasFocus() { bool ret = NDalicPINVOKE.View_HasKeyInputFocus(swigCPtr); @@ -1203,7 +1095,7 @@ namespace Tizen.NUI.BaseComponents /// /// Sets the name of the style to be applied to the view. /// - /// A string matching a style described in a stylesheet. + /// A string matching a style described in a stylesheet public void SetStyleName(string styleName) { NDalicPINVOKE.View_SetStyleName(swigCPtr, styleName); @@ -1213,7 +1105,7 @@ namespace Tizen.NUI.BaseComponents /// /// Retrieves the name of the style to be applied to the view (if any). /// - /// A string matching a style, or an empty string. + /// A string matching a style, or an empty string public string GetStyleName() { string ret = NDalicPINVOKE.View_GetStyleName(swigCPtr); @@ -1283,7 +1175,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The StyleName, type string. + /// styleName, type string. /// public string StyleName { @@ -1300,7 +1192,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The mutually exclusive with BACKGROUND_IMAGE & BACKGROUND type Vector4. + /// mutually exclusive with BACKGROUND_IMAGE & BACKGROUND, type Vector4. /// public Color BackgroundColor { @@ -1325,7 +1217,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// Creates an animation to animate the background color visual. If there is no + /// Create an Animation to animate the background color visual. If there is no /// background visual, creates one with transparent black as it's mixColor. /// public Animation AnimateBackgroundColor( object destinationValue, @@ -1347,7 +1239,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// Creates an animation to animate the mixColor of the named visual. + /// Create an Animation to animate the mixColor of the named visual. /// public Animation AnimateColor( string targetVisual, object destinationColor, int startTime, int endTime, AlphaFunction.BuiltinFunctions? alphaFunction = null, object initialColor = null ) { @@ -1387,7 +1279,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The mutually exclusive with BACKGROUND_COLOR & BACKGROUND type Map. + /// mutually exclusive with BACKGROUND_COLOR & BACKGROUND, type Map. /// public string BackgroundImage { @@ -1536,7 +1428,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// Displays a tooltip as a text. + /// Displays a tooltip as Text /// public string TooltipText { @@ -1603,8 +1495,8 @@ namespace Tizen.NUI.BaseComponents } /// - /// The Child property of FlexContainer.
- /// The proportion of the free space in the container, the flex item will receive.
+ /// Child Property of FlexContainer.
+ /// The proportion of the free space in the container the flex item will receive.
/// If all items in the container set this property, their sizes will be proportional to the specified flex factor.
///
public float Flex @@ -1622,7 +1514,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The Child property of FlexContainer.
+ /// Child Property of FlexContainer.
/// The alignment of the flex item along the cross axis, which, if set, overides the default alignment for all items in the container.
///
public int AlignSelf @@ -1640,7 +1532,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The Child property of FlexContainer.
+ /// Child Property of FlexContainer.
/// The space around the flex item.
///
public Vector4 FlexMargin @@ -1658,7 +1550,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The top-left cell this child occupies, if not set, the first available cell is used. + /// The top-left cell this child occupies, if not set, the first available cell is used /// public Vector2 CellIndex { @@ -1675,7 +1567,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The number of rows this child occupies, if not set, the default value is 1. + /// The number of rows this child occupies, if not set, default value is 1 /// public float RowSpan { @@ -1692,7 +1584,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The number of columns this child occupies, if not set, the default value is 1. + /// The number of columns this child occupies, if not set, default value is 1 /// public float ColumnSpan { @@ -1709,7 +1601,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The horizontal alignment of this child inside the cells, if not set, the default value is 'left'. + /// The horizontal alignment of this child inside the cells, if not set, default value is 'left' /// public Tizen.NUI.HorizontalAlignmentType CellHorizontalAlignment { @@ -1764,7 +1656,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// The vertical alignment of this child inside the cells, if not set, the default value is 'top'. + /// The vertical alignment of this child inside the cells, if not set, default value is 'top' /// public Tizen.NUI.VerticalAlignmentType CellVerticalAlignment { @@ -1820,8 +1712,8 @@ namespace Tizen.NUI.BaseComponents /// /// The left focusable view.
- /// This will return null if not set.
- /// This will also return null if the specified left focusable view is not on a window.
+ /// This will return NULL if not set.
+ /// This will also return NULL if the specified left focusable view is not on Window.
///
public View LeftFocusableView { @@ -1842,8 +1734,8 @@ namespace Tizen.NUI.BaseComponents /// /// The right focusable view.
- /// This will return null if not set.
- /// This will also return null if the specified right focusable view is not on a window.
+ /// This will return NULL if not set.
+ /// This will also return NULL if the specified right focusable view is not on Window.
///
public View RightFocusableView { @@ -1864,8 +1756,8 @@ namespace Tizen.NUI.BaseComponents /// /// The up focusable view.
- /// This will return null if not set.
- /// This will also return null if the specified up focusable view is not on a window.
+ /// This will return NULL if not set.
+ /// This will also return NULL if the specified up focusable view is not on Window.
///
public View UpFocusableView { @@ -1886,8 +1778,8 @@ namespace Tizen.NUI.BaseComponents /// /// The down focusable view.
- /// This will return null if not set.
- /// This will also return null if the specified down focusable view is not on a window.
+ /// This will return NULL if not set.
+ /// This will also return NULL if the specified down focusable view is not on Window.
///
public View DownFocusableView { @@ -1907,7 +1799,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// Whether the view should be focusable by keyboard navigation. + /// whether the view should be focusable by keyboard navigation. /// public bool Focusable { @@ -1922,27 +1814,27 @@ namespace Tizen.NUI.BaseComponents } /// - /// Enumeration for describing the states of the view. + /// Enumeration for describing the states of view. /// public enum States { /// - /// The normal state. + /// Normal state /// Normal, /// - /// The focused state. + /// Focused state /// Focused, /// - /// The disabled state. + /// Disabled state /// Disabled } /// - /// Retrieves the position of the view.
- /// The coordinates are relative to the view's parent.
+ /// Retrieves the position of the View.
+ /// The coordinates are relative to the View's parent.
///
public Position CurrentPosition { @@ -1953,10 +1845,10 @@ namespace Tizen.NUI.BaseComponents } /// - /// Sets the size of a view for the width and the height.
+ /// Sets the size of an view for width and height.
/// Geometry can be scaled to fit within this area.
- /// This does not interfere with the view's scale factor.
- /// The views default depth is the minimum of width and height.
+ /// This does not interfere with the views scale factor.
+ /// The views default depth is the minimum of width & height.
///
public Size2D Size2D { @@ -1974,8 +1866,8 @@ namespace Tizen.NUI.BaseComponents } /// - /// Retrieves the size of the view.
- /// The coordinates are relative to the view's parent.
+ /// Retrieves the size of the View.
+ /// The coordinates are relative to the View's parent.
///
public Size2D CurrentSize { @@ -2012,9 +1904,9 @@ namespace Tizen.NUI.BaseComponents } /// - /// Sets the position of the view for X and Y.
- /// By default, sets the position vector between the parent origin and the pivot point (default).
- /// If the position inheritance is disabled, sets the world position.
+ /// Sets the position of the View for X and Y.
+ /// By default, sets the position vector between the parent origin and pivot point(default).
+ /// If Position inheritance if disabled, sets the world position.
///
public Position2D Position2D { @@ -2031,7 +1923,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// Retrieves the screen postion of the view.
+ /// Retrieves screen postion of view's.
///
public Vector2 ScreenPosition { @@ -2092,8 +1984,8 @@ namespace Tizen.NUI.BaseComponents } /// - /// Queries whether the view is connected to the stage.
- /// When a view is connected, it will be directly or indirectly parented to the root view.
+ /// Queries whether the view is connected to the Stage.
+ /// When an view is connected, it will be directly or indirectly parented to the root View.
///
public bool IsOnWindow { @@ -2104,7 +1996,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// Gets the depth in the hierarchy for the view. + /// Gets depth in the hierarchy for the view. /// public int HierarchyDepth { @@ -2115,12 +2007,12 @@ namespace Tizen.NUI.BaseComponents } /// - /// Sets the sibling order of the view so the depth position can be defined within the same parent. + /// Sets the sibling order of the view so depth position can be defined within the same parent. /// /// - /// Note the initial value is 0. - /// Raise, Lower, RaiseToTop, LowerToBottom, RaiseAbove, and LowerBelow will override the sibling order. - /// The values set by this property will likely change. + /// Note The initial value is 0. + /// Raise, Lower, RaiseToTop, LowerToBottom, RaiseAbove and LowerBelow will override the sibling order. + /// The values set by this Property will likely change. /// public int SiblingOrder { @@ -2136,13 +2028,7 @@ namespace Tizen.NUI.BaseComponents } } - /// - /// Returns the natural size of the view. - /// - /// - /// Deriving classes stipulate the natural size and by default a view has a zero natural size. - /// - [Obsolete("Please do not use! this will be deprecated, please use NaturalSize2D instead")] + [Obsolete("Please do not use! this will be internal property")] public Vector3 NaturalSize { get @@ -2155,25 +2041,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// Returns the natural size (Size2D) of the view. - /// - /// - /// Deriving classes stipulate the natural size and by default a view has a zero natural size. - /// - public Size2D NaturalSize2D - { - get - { - Vector3 temp = new Vector3(NDalicPINVOKE.Actor_GetNaturalSize(swigCPtr), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - - return new Size2D((int)temp.Width, (int)temp.Height); - } - } - - /// - /// Shows the view. + /// Shows the View. /// /// /// This is an asynchronous method. @@ -2184,12 +2052,12 @@ namespace Tizen.NUI.BaseComponents } /// - /// Hides the view. + /// Hides the View. /// /// /// This is an asynchronous method. - /// If the view is hidden, then the view and its children will not be rendered. - /// This is regardless of the individual visibility of the children, i.e., the view will only be rendered if all of its parents are shown. + /// If an view is hidden, then the view and its children will not be rendered. + /// This is regardless of the individual visibility of the children i.e.an view will only be rendered if all of its parents are shown. /// public void Hide() { @@ -2198,6 +2066,21 @@ namespace Tizen.NUI.BaseComponents internal void Raise() { + var parentChildren = Parent?.Children; + + if (parentChildren != null) + { + int currentIndex = parentChildren.IndexOf(this); + + // If the view is not already the last item in the list. + if (currentIndex != parentChildren.Count -1) + { + View temp = parentChildren[currentIndex + 1]; + parentChildren[currentIndex + 1] = this; + parentChildren[currentIndex] = temp; + } + } + NDalicPINVOKE.Raise(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -2205,43 +2088,74 @@ namespace Tizen.NUI.BaseComponents internal void Lower() { + var parentChildren = Parent?.Children; + + if (parentChildren != null) + { + int currentIndex = parentChildren.IndexOf(this); + + // If the view is not already the first item in the list. + if (currentIndex > 0) + { + View temp = parentChildren[currentIndex - 1]; + parentChildren[currentIndex - 1] = this; + parentChildren[currentIndex] = temp; + } + } + NDalicPINVOKE.Lower(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } /// - /// Raises the view above all other views. + /// Raise view above all other views. /// /// /// Sibling order of views within the parent will be updated automatically. - /// Once a raise or lower API is used, that view will then have an exclusive sibling order independent of insertion. + /// Once a raise or lower API is used that view will then have an exclusive sibling order independent of insertion. /// public void RaiseToTop() { + var parentChildren = Parent?.Children; + + if (parentChildren != null) + { + parentChildren.Remove(this); + parentChildren.Add(this); + } + NDalicPINVOKE.RaiseToTop(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } /// - /// Lowers the view to the bottom of all views. + /// Lower view to the bottom of all views. /// /// - /// The sibling order of views within the parent will be updated automatically. + /// Sibling order of views within the parent will be updated automatically. /// Once a raise or lower API is used that view will then have an exclusive sibling order independent of insertion. /// public void LowerToBottom() { + var parentChildren = Parent?.Children; + + if (parentChildren != null) + { + parentChildren.Remove(this); + parentChildren.Insert(0, this); + } + NDalicPINVOKE.LowerToBottom(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } /// - /// Queries if all resources required by a view are loaded and ready. + /// Query if all resources required by a View are loaded and ready. /// - /// Most resources are only loaded when the control is placed on the stage. + /// Most resources are only loaded when the control is placed on stage /// public bool IsResourceReady() { @@ -2251,32 +2165,63 @@ namespace Tizen.NUI.BaseComponents } /// - /// Raises the view to above the target view. + /// Raise the view to above the target view. /// - /// The sibling order of views within the parent will be updated automatically. + /// Sibling order of views within the parent will be updated automatically. /// Views on the level above the target view will still be shown above this view. /// Raising this view above views with the same sibling order as each other will raise this view above them. /// Once a raise or lower API is used that view will then have an exclusive sibling order independent of insertion. /// - /// Will be raised above this view. + /// Will be raised above this view internal void RaiseAbove(View target) { + var parentChildren = Parent?.Children; + + if (parentChildren != null) + { + int currentIndex = parentChildren.IndexOf(this); + int targetIndex = parentChildren.IndexOf(target); + + // If the currentIndex is less than the target index and the target has the same parent. + if (currentIndex < targetIndex) + { + parentChildren.Remove(this); + parentChildren.Insert(targetIndex, this); + } + } + NDalicPINVOKE.RaiseAbove(swigCPtr, View.getCPtr(target)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } /// - /// Lowers the view to below the target view. + /// Lower the view to below the target view. /// - /// The sibling order of views within the parent will be updated automatically. + /// Sibling order of views within the parent will be updated automatically. /// Lowering this view below views with the same sibling order as each other will lower this view above them. /// Once a raise or lower API is used that view will then have an exclusive sibling order independent of insertion. /// - /// Will be lowered below this view. + /// Will be lowered below this view internal void LowerBelow(View target) { - NDalicPINVOKE.RaiseAbove(swigCPtr, View.getCPtr(target)); + var parentChildren = Parent?.Children; + + if (parentChildren != null) + { + int currentIndex = parentChildren.IndexOf(this); + int targetIndex = parentChildren.IndexOf(target); + + // If the currentIndex is not already the 0th index and the target has the same parent. + if ((currentIndex != 0) && (targetIndex != -1) && + (currentIndex > targetIndex)) + { + parentChildren.Remove(this); + parentChildren.Insert(targetIndex, this); + } + } + + NDalicPINVOKE.LowerBelow(swigCPtr, View.getCPtr(target)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } @@ -2330,23 +2275,21 @@ namespace Tizen.NUI.BaseComponents } /// - /// Removes a view from its parent view or layer. If a view has no parent, this method does nothing. + /// Removes a View from its Parent View / Layer. If the View has no parent, this method does nothing. /// - ///
The (child) view has been initialized. 
+ ///
The (child) View has been initialized. 
public void Unparent() { - NDalicPINVOKE.Actor_Unparent(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + GetParent()?.Remove(this); } /// - /// Search through this view's hierarchy for a view with the given name. + /// Search through this view's hierarchy for an view with the given name. /// The view itself is also considered in the search. /// - ///
The view has been initialized.
- /// The name of the view to find. - /// A handle to the view if found, or an empty handle if not. + ///
The View has been initialized.
+ /// The name of the view to find + /// A handle to the view if found, or an empty handle if not public View FindChildByName(string viewName) { IntPtr cPtr = NDalicPINVOKE.Actor_FindChildByName(swigCPtr, viewName); @@ -2758,13 +2701,13 @@ namespace Tizen.NUI.BaseComponents /// /// Converts screen coordinates into the view's coordinate system using the default camera. /// - ///
The view has been initialized.
- /// The view coordinates are relative to the top-left(0.0, 0.0, 0.5). - /// On return, the X-coordinate relative to the view. - /// On return, the Y-coordinate relative to the view. - /// The screen X-coordinate. - /// The screen Y-coordinate. - /// True if the conversion succeeded. + ///
The View has been initialized.
+ /// The view coordinates are relative to the top-left(0.0, 0.0, 0.5) + /// On return, the X-coordinate relative to the view + /// On return, the Y-coordinate relative to the view + /// The screen X-coordinate + /// The screen Y-coordinate + /// True if the conversion succeeded public bool ScreenToLocal(out float localX, out float localY, float screenX, float screenY) { bool ret = NDalicPINVOKE.Actor_ScreenToLocal(swigCPtr, out localX, out localY, screenX, screenY); @@ -2809,8 +2752,8 @@ namespace Tizen.NUI.BaseComponents /// ResizePolicy::SIZE_RELATIVE_TO_PARENT or ResizePolicy::SIZE_FIXED_OFFSET_FROM_PARENT.
/// This view's size is set to the view's size multiplied by or added to this factor, depending on ResizePolicy.
///
- ///
The view has been initialized.
- /// A Vector3 representing the relative factor to be applied to each axis. + ///
The View has been initialized.
+ /// A Vector3 representing the relative factor to be applied to each axis public void SetSizeModeFactor(Vector3 factor) { NDalicPINVOKE.Actor_SetSizeModeFactor(swigCPtr, Vector3.getCPtr(factor)); @@ -2828,11 +2771,11 @@ namespace Tizen.NUI.BaseComponents /// /// Calculates the height of the view given a width.
- /// The natural size is used for default calculation.
- /// Size 0 is treated as aspect ratio 1:1.
+ /// The natural size is used for default calculation.
+ /// size 0 is treated as aspect ratio 1:1.
///
- /// The width to use. - /// The height based on the width. + /// Width to use + /// The height based on the width public float GetHeightForWidth(float width) { float ret = NDalicPINVOKE.Actor_GetHeightForWidth(swigCPtr, width); @@ -2844,10 +2787,10 @@ namespace Tizen.NUI.BaseComponents /// /// Calculates the width of the view given a height.
/// The natural size is used for default calculation.
- /// Size 0 is treated as aspect ratio 1:1.
+ /// size 0 is treated as aspect ratio 1:1.
///
- /// The height to use. - /// The width based on the height. + /// Height to use + /// The width based on the height public float GetWidthForHeight(float height) { float ret = NDalicPINVOKE.Actor_GetWidthForHeight(swigCPtr, height); @@ -3010,14 +2953,6 @@ namespace Tizen.NUI.BaseComponents return ret; } - - internal ViewLayoutDirectionChangedSignal LayoutDirectionChangedSignal(View view) { - ViewLayoutDirectionChangedSignal ret = new ViewLayoutDirectionChangedSignal(NDalicManualPINVOKE.LayoutDirectionChangedSignal(View.getCPtr(view)), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal ViewSignal ResourcesLoadedSignal() { ViewSignal ret = new ViewSignal(NDalicPINVOKE.ResourceReadySignal(swigCPtr), false); @@ -3026,12 +2961,12 @@ namespace Tizen.NUI.BaseComponents } /// - /// Gets or sets the origin of a view within its parent's area.
- /// This is expressed in unit coordinates, such that (0.0, 0.0, 0.5) is the top-left corner of the parent, and (1.0, 1.0, 0.5) is the bottom-right corner.
+ /// Gets/Sets the origin of an view, within its parent's area.
+ /// This is expressed in unit coordinates, such that (0.0, 0.0, 0.5) is the top-left corner of the parent, and(1.0, 1.0, 0.5) is the bottom-right corner.
/// The default parent-origin is ParentOrigin.TopLeft (0.0, 0.0, 0.5).
- /// A view's position is the distance between this origin and the view's anchor-point.
+ /// An view's position is the distance between this origin, and the view's anchor-point.
///
- ///
The view has been initialized.
+ ///
The View has been initialized.
public Position ParentOrigin { get @@ -3089,12 +3024,12 @@ namespace Tizen.NUI.BaseComponents } /// - /// Gets or sets the anchor-point of a view.
+ /// Gets/Sets the anchor-point of an view.
/// This is expressed in unit coordinates, such that (0.0, 0.0, 0.5) is the top-left corner of the view, and (1.0, 1.0, 0.5) is the bottom-right corner.
/// The default pivot point is PivotPoint.Center (0.5, 0.5, 0.5).
- /// A view position is the distance between its parent-origin and this anchor-point.
- /// A view's orientation is the rotation from its default orientation, the rotation is centered around its anchor-point.
- ///
The view has been initialized.
+ /// An view position is the distance between its parent-origin and this anchor-point.
+ /// An view's orientation is the rotation from its default orientation, the rotation is centered around its anchor-point.
+ ///
The View has been initialized.
///
public Position PivotPoint { @@ -3153,7 +3088,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// Gets or sets the size width of the view. + /// Gets/Sets the size width of an view. /// public float SizeWidth { @@ -3170,7 +3105,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// Gets or sets the size height of the view. + /// Gets/Sets the size height of an view. /// public float SizeHeight { @@ -3187,9 +3122,9 @@ namespace Tizen.NUI.BaseComponents } /// - /// Gets or sets the position of the view.
- /// By default, sets the position vector between the parent origin and pivot point (default).
- /// If the position inheritance is disabled, sets the world position.
+ /// Gets/Sets the position of the View.
+ /// By default, sets the position vector between the parent origin and pivot point(default).
+ /// If Position inheritance if disabled, sets the world position.
///
public Position Position { @@ -3206,7 +3141,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// Gets or sets the position X of the view. + /// Gets/Sets the position x of the View. /// public float PositionX { @@ -3223,7 +3158,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// Gets or sets the position Y of the view. + /// Gets/Sets the position y of the View. /// public float PositionY { @@ -3240,7 +3175,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// Gets or sets the position Z of the view. + /// Gets/Sets the position z of the View. /// public float PositionZ { @@ -3257,7 +3192,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// Gets or sets the world position of the view. + /// Gets/Sets the world position of the View. /// public Vector3 WorldPosition { @@ -3300,8 +3235,8 @@ namespace Tizen.NUI.BaseComponents } /// - /// Gets or sets the orientation of the view.
- /// The view's orientation is the rotation from its default orientation, and the rotation is centered around its anchor-point.
+ /// Gets/Sets the orientation of the View.
+ /// An view's orientation is the rotation from its default orientation, and the rotation is centered around its anchor-point.
///
/// This is an asynchronous method. public Rotation Orientation @@ -3319,7 +3254,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// Gets or sets the world orientation of the view.
+ /// Gets/Sets the world orientation of the View.
///
public Rotation WorldOrientation { @@ -3332,7 +3267,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// Gets or sets the scale factor applied to the view.
+ /// Gets/Sets the scale factor applied to an view.
///
public Vector3 Scale { @@ -3349,7 +3284,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// Gets or sets the scale X factor applied to the view. + /// Gets/Sets the scale x factor applied to an view. /// public float ScaleX { @@ -3366,7 +3301,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// Gets or sets the scale Y factor applied to the view. + /// Gets/Sets the scale y factor applied to an view. /// public float ScaleY { @@ -3383,7 +3318,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// Gets or sets the scale Z factor applied to the view. + /// Gets/Sets the scale z factor applied to an view. /// public float ScaleZ { @@ -3400,7 +3335,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// Gets the world scale of the view. + /// Gets the world scale of View. /// public Vector3 WorldScale { @@ -3413,11 +3348,11 @@ namespace Tizen.NUI.BaseComponents } /// - /// Retrieves the visibility flag of the view. + /// Retrieves the visibility flag of an view. /// /// - /// If the view is not visible, then the view and its children will not be rendered. - /// This is regardless of the individual visibility values of the children, i.e., the view will only be rendered if all of its parents have visibility set to true. + /// If an view is not visible, then the view and its children will not be rendered. + /// This is regardless of the individual visibility values of the children i.e.an view will only be rendered if all of its parents have visibility set to true. /// public bool Visibility { @@ -3453,7 +3388,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// Gets or sets the view's name. + /// Gets/Sets the View's name. /// public string Name { @@ -3470,18 +3405,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// Get the number of children held by the view. - /// - public uint ChildCount - { - get - { - return GetChildCount(); - } - } - - /// - /// Gets the view's ID. + /// Gets the View's ID. /// Readonly /// public uint ID @@ -3493,7 +3417,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// Gets or sets the status of whether the view should emit touch or hover signals. + /// Gets/Sets the status of whether an view should emit touch or hover signals. /// public bool Sensitive { @@ -3510,7 +3434,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// Gets or sets the status of whether the view should receive a notification when touch or hover motion events leave the boundary of the view. + /// Gets/Sets the status of whether the view should receive a notification when touch or hover motion events leave the boundary of the view. /// public bool LeaveRequired { @@ -3527,7 +3451,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// Gets or sets the status of whether a child view inherits it's parent's orientation. + /// Gets/Sets the status of whether a child view inherits it's parent's orientation. /// public bool InheritOrientation { @@ -3544,7 +3468,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// Gets or sets the status of whether a child view inherits it's parent's scale. + /// Gets/Sets the status of whether a child view inherits it's parent's scale. /// public bool InheritScale { @@ -3561,12 +3485,28 @@ namespace Tizen.NUI.BaseComponents } /// - /// Gets or sets the status of how the view and its children should be drawn.
+ /// Gets/Sets the Opacity inheritance state. If true (default) This view will blend its opacity with the parents. + /// If false, this view will use its own opacity value directly. + ///
+ public bool InheritOpacity + { + get + { + return GetColorMode() != ColorMode.UseOwnColor; + } + set + { + SetColorMode(value ? ColorMode.UseOwnMultiplyParentAlpha : ColorMode.UseOwnColor); + } + } + + /// + /// Gets/Sets the status of how the view and its children should be drawn.
/// Not all views are renderable, but DrawMode can be inherited from any view.
- /// If an object is in a 3D layer, it will be depth-tested against other objects in the world, i.e., it may be obscured if other objects are in front.
+ /// If an object is in a 3D layer, it will be depth-tested against other objects in the world i.e. it may be obscured if other objects are in front.
/// If DrawMode.Overlay2D is used, the view and its children will be drawn as a 2D overlay.
- /// Overlay views are drawn in a separate pass, after all non-overlay views within the layer.
- /// For overlay views, the drawing order is with respect to tree levels of views, and depth-testing will not be used.
+ /// Overlay views are drawn in a separate pass, after all non-overlay views within the Layer.
+ /// For overlay views, the drawing order is with respect to tree levels of Views, and depth-testing will not be used.
///
public DrawModeType DrawMode { @@ -3596,7 +3536,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// Gets or sets the relative to parent size factor of the view.
+ /// Gets/Sets the relative to parent size factor of the view.
/// This factor is only used when ResizePolicyType is set to either: ResizePolicyType.SizeRelativeToParent or ResizePolicyType.SizeFixedOffsetFromParent.
/// This view's size is set to the view's size multiplied by or added to this factor, depending on ResizePolicyType.
///
@@ -3615,7 +3555,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// Gets or sets the width resize policy to be used. + /// Gets/Sets the width resize policy to be used. /// public ResizePolicyType WidthResizePolicy { @@ -3655,7 +3595,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// Gets or sets the height resize policy to be used. + /// Gets/Sets the height resize policy to be used. /// public ResizePolicyType HeightResizePolicy { @@ -3695,8 +3635,8 @@ namespace Tizen.NUI.BaseComponents } /// - /// Gets or sets the policy to use when setting size with size negotiation.
- /// Defaults to SizeScalePolicyType.UseSizeSet.
+ /// Gets/Sets the policy to use when setting size with size negotiation.
+ /// Defaults to SizeScalePolicyType.UseSizeSet.
///
public SizeScalePolicyType SizeScalePolicy { @@ -3750,7 +3690,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// Gets or sets the status of whether the width size is dependent on the height size. + /// Gets/Sets the status of whether the width size is dependent on height size. /// public bool WidthForHeight { @@ -3767,7 +3707,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// Gets or sets the status of whether the height size is dependent on the width size. + /// Gets/Sets the status of whether the height size is dependent on width size. /// public bool HeightForWidth { @@ -3784,7 +3724,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// Gets or sets the padding for use in layout. + /// Gets/Sets the padding for use in layout. /// public Vector4 Padding { @@ -3801,7 +3741,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// Gets or sets the minimum size the view can be assigned in size negotiation. + /// Gets/Sets the minimum size an view can be assigned in size negotiation. /// public Size2D MinimumSize { @@ -3818,7 +3758,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// Gets or sets the maximum size the view can be assigned in size negotiation. + /// Gets/Sets the maximum size an view can be assigned in size negotiation. /// public Size2D MaximumSize { @@ -3835,9 +3775,9 @@ namespace Tizen.NUI.BaseComponents } /// - /// Gets or sets whether a child view inherits it's parent's position.
+ /// Gets/Sets whether a child view inherits it's parent's position.
/// Default is to inherit.
- /// Switching this off means that using position sets the view's world position, i.e., translates from the world origin (0,0,0) to the pivot point of the view.
+ /// Switching this off means that using Position sets the view's world position, i.e. translates from the world origin(0,0,0) to the pivot point of the view.
///
public bool InheritPosition { @@ -3854,7 +3794,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// Gets or sets the clipping behavior (mode) of it's children. + /// Gets/Sets clipping behavior(mode) of it's children. /// public ClippingModeType ClippingMode { @@ -3871,6 +3811,8 @@ namespace Tizen.NUI.BaseComponents return ClippingModeType.Disabled; case "CLIP_CHILDREN": return ClippingModeType.ClipChildren; + case "CLIP_TO_BOUNDING_BOX": + return ClippingModeType.ClipToBoundingBox; default: return ClippingModeType.Disabled; } @@ -3882,7 +3824,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// Gets the number of renderers held by the view. + /// Get the number of renderers held by the view. /// public uint RendererCount { @@ -3988,7 +3930,7 @@ namespace Tizen.NUI.BaseComponents } } - [Obsolete("Please do not use! this will be deprecated, please use Size2D instead")] + [Obsolete("Please do not use! this will be deprecated")] public Size Size { get @@ -4079,66 +4021,8 @@ namespace Tizen.NUI.BaseComponents } } - [Obsolete("Please DO NOT use! This will be deprecated! Please use 'Container GetParent() for derived class' instead!")] - public View Parent - { - get - { - View ret; - IntPtr cPtr = NDalicPINVOKE.Actor_GetParent(swigCPtr); - BaseHandle basehandle = Registry.GetManagedBaseHandleFromNativePtr(cPtr); - if (basehandle is Layer) - { - ret = new View(cPtr, false); - } - else - { - ret = basehandle as View; - } - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - } - - public bool InheritLayoutDirection - { - get - { - bool temp = false; - GetProperty(View.Property.INHERIT_LAYOUT_DIRECTION).Get(out temp); - return temp; - } - set - { - SetProperty(View.Property.INHERIT_LAYOUT_DIRECTION, new Tizen.NUI.PropertyValue(value)); - } - } - - public ViewLayoutDirectionType LayoutDirection - { - get - { - int temp; - if (GetProperty(View.Property.LAYOUT_DIRECTION).Get(out temp) == false) - { - NUILog.Error("LAYOUT_DIRECTION get error!"); - } - return (ViewLayoutDirectionType)temp; - } - set - { - SetProperty(View.Property.LAYOUT_DIRECTION, new Tizen.NUI.PropertyValue((int)value)); - } - } - } - - public enum ViewLayoutDirectionType - { - LTR, - RTL } } diff --git a/src/Tizen.NUI/src/public/BaseComponents/VisualView.cs b/src/Tizen.NUI/src/public/BaseComponents/VisualView.cs index b67bab96f..d33ce5dd1 100755 --- a/src/Tizen.NUI/src/public/BaseComponents/VisualView.cs +++ b/src/Tizen.NUI/src/public/BaseComponents/VisualView.cs @@ -16,13 +16,12 @@ namespace Tizen.NUI.BaseComponents { using System; - using System.Text; using System.Runtime.InteropServices; using System.Collections.Generic; using System.Linq; /// - /// A visual view control if a user adds any visual to it. + /// A visual view control for user add any visual to it. /// /// /// Example: @@ -63,7 +62,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// Overrides the parent method. + /// Override the parent method. /// public override void OnInitialize() { @@ -74,10 +73,10 @@ namespace Tizen.NUI.BaseComponents } /// - /// Adds or updates a visual to visual view. + /// Add or update a visual to visual view. /// - /// The name of a visual to add. If a name is added to an existing visual name, the visual will be replaced. - /// The property map of a visual to create. + /// The name of visual to add. If add a existed visual name, the visual will be replaced. + /// The property map of visual to create. public void AddVisual(string visualName, VisualMap visualMap) { VisualBase visual = null; @@ -123,9 +122,9 @@ namespace Tizen.NUI.BaseComponents } /// - /// Removes a visual by name. + /// Remove a visual by name. /// - /// The name of a visual to remove. + /// The name of visual to remove. public void RemoveVisual(string visualName) { foreach (var item in _visualDictionary) @@ -144,7 +143,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// Gets the total number of visuals which are added by users. + /// Get the total number of Visuals which are added by users /// public int NumberOfVisuals { @@ -155,7 +154,7 @@ namespace Tizen.NUI.BaseComponents } /// - /// Removes all visuals of the visual view. + /// Remove all visuals of visual view. /// public void RemoveAll() { @@ -170,13 +169,13 @@ namespace Tizen.NUI.BaseComponents } /// - /// Overrides the method of OnRelayout() for CustomView class.
+ /// Override method of OnRelayout() for CustomView class.
/// Called after the size negotiation has been finished for this control.
- /// The control is expected to assign this given size to itself or its children.
- /// Should be overridden by derived classes if they need to layout actors differently after certain operations like add or remove actors, resize, or after changing specific properties.
+ /// The control is expected to assign this given size to itself/its children.
+ /// Should be overridden by derived classes if they need to layout actors differently after certain operations like add or remove actors, resize or after changing specific properties.
///
- /// As this function is called from inside the size negotiation algorithm, you cannot call RequestRelayout (the call would just be ignored). - /// The allocated size. + /// As this function is called from inside the size negotiation algorithm, you cannot call RequestRelayout (the call would just be ignored) + /// The allocated size /// The control should add actors to this container that it is not able to allocate a size for. public override void OnRelayout(Vector2 size, RelayoutContainer container) { @@ -205,15 +204,15 @@ namespace Tizen.NUI.BaseComponents } /// - /// Creates a visual animation (transition) with the input parameters. + /// Create visual animation (transition) with the input parameters. /// - /// The visual map to animation. - /// The property of visual to animation. - /// The destination value of property after animation. - /// The start time of visual animation. - /// The end time of visual animation. - /// The alpha function of visual animation. - /// The initial property value of visual animation. + /// The visual map to animation. + /// The property of visual to animation. + /// The destination value of property after animation. + /// The start time of visual animation. + /// The end time of visual animation. + /// The alpha function of visual animation + /// The initial property value of visual animation /// Animation instance public Animation AnimateVisual(VisualMap target, string property, object destinationValue, int startTime, int endTime, AlphaFunction.BuiltinFunctions? alphaFunction = null, object initialValue = null) { @@ -307,9 +306,9 @@ namespace Tizen.NUI.BaseComponents _timePeriod.Add("delay", new PropertyValue(startTime / 1000.0f)); _animator.Add("timePeriod", new PropertyValue(_timePeriod)); - StringBuilder sb = new StringBuilder(property); - sb[0] = (char)(sb[0] | 0x20); - string _str = sb.ToString(); + string _str1 = property.Substring(0, 1); + string _str2 = property.Substring(1); + string _str = _str1.ToLower() + _str2; if (_str == "position") {_str = "offset";} PropertyValue destVal = PropertyValue.CreateFromObject(destinationValue); @@ -333,15 +332,15 @@ namespace Tizen.NUI.BaseComponents } /// - /// Adds a group visual animation (transition) map with the input parameters. + /// Add group visual animation (transition) map with the input parameters. /// - /// The visual map to animation. - /// The property of visual to animation. - /// The destination value of property after animation. - /// The start time of visual animation. - /// The end time of visual animation. - /// The alpha function of visual animation. - /// The initial property value of visual animation. + /// The visual map to animation. + /// The property of visual to animation. + /// The destination value of property after animation. + /// The start time of visual animation. + /// The end time of visual animation. + /// The alpha function of visual animation + /// The initial property value of visual animation public void AnimateVisualAdd(VisualMap target, string property, object destinationValue, int startTime, int endTime, AlphaFunction.BuiltinFunctions? alphaFunction = null, object initialValue = null) { string _alphaFunction = null; @@ -434,9 +433,9 @@ namespace Tizen.NUI.BaseComponents _timePeriod.Add("delay", new PropertyValue(startTime / 1000.0f)); _animator.Add("timePeriod", new PropertyValue(_timePeriod)); - StringBuilder sb = new StringBuilder(property); - sb[0] = (char)(sb[0] | 0x20); - string _str = sb.ToString(); + string _str1 = property.Substring(0, 1); + string _str2 = property.Substring(1); + string _str = _str1.ToLower() + _str2; if (_str == "position") {_str = "offset";} PropertyValue destVal = PropertyValue.CreateFromObject(destinationValue); @@ -458,9 +457,9 @@ namespace Tizen.NUI.BaseComponents } /// - /// Finishes to add a visual animation (transition) map and creates a transition animation. + /// Finish to add Visual animation (transition) map and create transition animation. /// - /// Animation instance. + /// Animation instance public Animation AnimateVisualAddFinish() { if ( _animateArray == null || _animateArray.Empty()) diff --git a/src/Tizen.NUI/src/public/BaseHandle.cs b/src/Tizen.NUI/src/public/BaseHandle.cs index 40ed2a173..6ff87e9c2 100755 --- a/src/Tizen.NUI/src/public/BaseHandle.cs +++ b/src/Tizen.NUI/src/public/BaseHandle.cs @@ -25,16 +25,11 @@ namespace Tizen.NUI internal BaseHandle(global::System.IntPtr cPtr, bool cMemoryOwn) { - //to catch derived classes dali native exceptions - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - _registerMe = swigCMemOwn = cMemoryOwn; - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); // using copy constructor to create another native handle so Registry.Unregister works fine. swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, NDalicPINVOKE.new_BaseHandle__SWIG_2(swigCPtr)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); if (_registerMe) { @@ -46,18 +41,10 @@ namespace Tizen.NUI internal BaseHandle(global::System.IntPtr cPtr) { _registerMe = swigCMemOwn = true; - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - // using copy constructor to create another native handle so Registry.Unregister works fine. - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, NDalicPINVOKE.new_BaseHandle__SWIG_2(swigCPtr)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - - if (_registerMe) - { - // Register this instance of BaseHandle in the registry. - Registry.Register(this); - } + // Register this instance of BaseHandle in the registry. + Registry.Register(this); } internal static global::System.Runtime.InteropServices.HandleRef getCPtr(BaseHandle obj) diff --git a/src/Tizen.NUI/src/public/Color.cs b/src/Tizen.NUI/src/public/Color.cs index c579fa78e..1d3d55c8a 100755 --- a/src/Tizen.NUI/src/public/Color.cs +++ b/src/Tizen.NUI/src/public/Color.cs @@ -22,7 +22,7 @@ namespace Tizen.NUI using System; /// - /// The Color class. + /// Color class. /// public class Color : global::System.IDisposable { @@ -55,7 +55,7 @@ namespace Tizen.NUI } /// - /// To make a color instance be disposed. + /// To make Color instance be disposed. /// public void Dispose() { @@ -107,11 +107,11 @@ namespace Tizen.NUI } /// - /// The addition operator. + /// Addition operator. /// - /// The first value. - /// The second value. - /// The color containing the result of the addition. + /// First value + /// Second value + /// A Color containing the result of the addition public static Color operator +(Color arg1, Color arg2) { Color result = arg1.Add(arg2); @@ -120,11 +120,11 @@ namespace Tizen.NUI } /// - /// The subtraction operator. + /// Subtraction operator. /// - /// The first value. - /// The second value. - /// The color containing the result of the subtraction. + /// First value + /// Second value + /// A Color containing the result of the subtraction public static Color operator -(Color arg1, Color arg2) { Color result = arg1.Subtract(arg2); @@ -133,10 +133,10 @@ namespace Tizen.NUI } /// - /// The unary negation operator. + /// Unary negation operator. /// - /// The target value. - /// The color containg the negation. + /// Target Value + /// A Color containg the negation public static Color operator -(Color arg1) { Color result = arg1.Subtract(); @@ -145,11 +145,11 @@ namespace Tizen.NUI } /// - /// The multiplication operator. + /// Multiplication operator. /// - /// The first value. - /// The second value. - /// The color containing the result of the multiplication. + /// First Value + /// Second Value + /// A Color containing the result of the multiplication public static Color operator *(Color arg1, Color arg2) { Color result = arg1.Multiply(arg2); @@ -165,11 +165,11 @@ namespace Tizen.NUI } /// - /// The division operator. + /// Division operator. /// - /// The first value. - /// The second value. - /// The color containing the result of the division. + /// First Value + /// Second Value + /// A Color containing the result of the division public static Color operator /(Color arg1, Color arg2) { Color result = arg1.Divide(arg2); @@ -185,10 +185,10 @@ namespace Tizen.NUI } /// - /// The array subscript operator overload. + /// Array subscript operator overload. /// - /// The subscript index. - /// The float at the given index. + /// Subscript index + /// The float at the given index public float this[uint index] { get @@ -214,12 +214,12 @@ namespace Tizen.NUI /// - /// The constructor. + /// Constructor. /// - /// The red component. - /// The green component. - /// The blue component. - /// The alpha component. + /// red component + /// green component + /// blue component + /// alpha component public Color(float r, float g, float b, float a) : this(NDalicPINVOKE.new_Vector4__SWIG_1(r, g, b, a), true) { ValueCheck(ref r); @@ -230,9 +230,9 @@ namespace Tizen.NUI } /// - /// The conversion constructor from an array of four floats. + /// Conversion constructor from an array of four floats. /// - /// array Array of R,G,B,A. + /// array Array of R,G,B,A public Color(float[] array) : this(NDalicPINVOKE.new_Vector4__SWIG_2(array), true) { ValueCheck(ref array[0]); @@ -334,10 +334,10 @@ namespace Tizen.NUI } /// - /// Checks if two color classes are same. + /// Check if two Color classes are same. /// - /// A color to be compared. - /// If two colors are are same, then true. + /// A Color to be compared + /// If two Colors are are same, then true. public bool EqualTo(Color rhs) { bool ret = NDalicPINVOKE.Vector4_EqualTo(swigCPtr, Color.getCPtr(rhs)); @@ -349,10 +349,10 @@ namespace Tizen.NUI } /// - /// Checks if two color classes are different. + /// Check if two Color classes are different. /// - /// A color to be compared. - /// If two colors are are different, then true. + /// A Color to be compared + /// If two Colors are are different, then true. public bool NotEqualTo(Color rhs) { bool ret = NDalicPINVOKE.Vector4_NotEqualTo(swigCPtr, Color.getCPtr(rhs)); @@ -369,7 +369,7 @@ namespace Tizen.NUI } /// - /// The red component. + /// red component. /// public float R { @@ -388,7 +388,7 @@ namespace Tizen.NUI } /// - /// The green component. + /// green component. /// public float G { @@ -407,7 +407,7 @@ namespace Tizen.NUI } /// - /// The blue component. + /// blue component. /// public float B { @@ -426,7 +426,7 @@ namespace Tizen.NUI } /// - /// The alpha component. + /// alpha component. /// public float A { @@ -445,63 +445,63 @@ namespace Tizen.NUI } /// - /// Gets the black colored Color class. + /// Get black colored Color class. /// public static readonly Color Black = new Color(0.0f, 0.0f, 0.0f, 1.0f); /// - /// Gets the white colored Color class. + /// Get white colored Color class. /// public static readonly Color White = new Color(1.0f, 1.0f, 1.0f, 1.0f); /// - /// Gets the red colored Color class. + /// Get red colored Color class. /// public static readonly Color Red = new Color(1.0f, 0.0f, 0.0f, 1.0f); /// - /// Gets the green colored Color class. + /// Get green colored Color class. /// public static readonly Color Green = new Color(0.0f, 1.0f, 0.0f, 1.0f); /// - /// Gets the blue colored Color class. + /// Get blue colored Color class. /// public static readonly Color Blue = new Color(0.0f, 0.0f, 1.0f, 1.0f); /// - /// Gets the yellow colored Color class. + /// Get yellow colored Color class. /// public static readonly Color Yellow = new Color(1.0f, 1.0f, 0.0f, 1.0f); /// - /// Gets the magenta colored Color class. + /// Get magenta colored Color class. /// public static readonly Color Magenta = new Color(1.0f, 0.0f, 1.0f, 1.0f); /// - /// Gets the cyan colored Color class. + /// Get cyan colored Color class. /// public static readonly Color Cyan = new Color(0.0f, 1.0f, 1.0f, 1.0f); /// - /// Gets the transparent colored Color class. + /// Get transparent colored Color class. /// public static readonly Color Transparent = new Color(0.0f, 0.0f, 0.0f, 0.0f); /// - /// Converts the Color class to Vector4 class implicitly. + /// convert Color class to Vector4 class implicitly. /// - /// A color to be converted to Vector4 + /// A Color to be converted to Vector4 public static implicit operator Vector4(Color color) { return new Vector4(color.R, color.G, color.B, color.A); } /// - /// Converts Vector4 class to Color class implicitly. + /// convert Vector4 class to Color class implicitly. /// - /// A Vector4 to be converted to color. + /// A Vector4 to be converted to Color public static implicit operator Color(Vector4 vec) { return new Color(vec.R, vec.G, vec.B, vec.A); diff --git a/src/Tizen.NUI/src/public/Container.cs b/src/Tizen.NUI/src/public/Container.cs index 1078d6a4e..b9038462e 100755 --- a/src/Tizen.NUI/src/public/Container.cs +++ b/src/Tizen.NUI/src/public/Container.cs @@ -15,13 +15,14 @@ */ using System; +using System.Collections.Generic; using Tizen.NUI.BaseComponents; namespace Tizen.NUI { /// /// - /// The Container is an abstract class to be inherited from by classes that desire to have views + /// Container is an abstract class to be inherited from by classes that desire to have Views /// added to them. /// /// @@ -29,6 +30,16 @@ namespace Tizen.NUI public abstract class Container : Animatable { + private List _childViews = new List(); + + public List Children + { + get + { + return _childViews; + } + } + internal Container(global::System.IntPtr cPtr, bool cMemoryOwn) : base(cPtr, cMemoryOwn) { // No un-managed data hence no need to store a native ptr @@ -48,47 +59,47 @@ namespace Tizen.NUI /// /// Adds a child view to this Container. /// - ///
This Container (the parent) has been initialized. The child view has been initialized. The child view is not the same as the parent view.
+ ///
This Container(the parent) has been initialized. The child view has been initialized. The child view is not the same as the parent view.
/// The child will be referenced by its parent. This means that the child will be kept alive, even if the handle passed into this method is reset or destroyed. - /// If the child already has a parent, it will be removed from the old parent and reparented to this view. This may change child's position, color, scale, etc. as it now inherits them from this view. - /// The child view to add. + /// If the child already has a parent, it will be removed from old parent and reparented to this view. This may change child's position, color, scale etc as it now inherits them from this view. + /// The child view to add public abstract void Add( View view ); /// - /// Removes a child view from this view. If the view was not a child of this view, this is a no-op. + /// Removes a child View from this View. If the view was not a child of this view, this is a no-op. /// - ///
This view (the parent) has been initialized. The child view is not the same as the parent view.
- /// The child. + ///
This View(the parent) has been initialized. The child view is not the same as the parent view.
+ /// The child public abstract void Remove( View view ); /// - /// Retrieves the child view by the index. + /// Retrieves child view by index. /// - ///
The view has been initialized.
- /// The index of the child to retrieve. - /// The view for the given index or empty handle if children are not initialized. + ///
The View has been initialized.
+ /// The index of the child to retrieve + /// The view for the given index or empty handle if children not initialized public abstract View GetChildAt( uint index ); /// - /// Gets the parent of this container. + /// Get the parent of this container /// ///
The child container has been initialized.
- /// The parent container. + /// The parent container protected abstract Container GetParent(); /// - /// Gets the number of children for this container. + /// Get the number of children for this container /// ///
The container has been initialized.
- /// The number of children. + /// number of children protected abstract UInt32 GetChildCount(); /// - /// Gets the parent container. + /// Get the parent Container /// Read only /// ///
The child container has been initialized.
- /// The parent container. + /// The parent container public Container Parent { get @@ -98,11 +109,11 @@ namespace Tizen.NUI } /// - /// Gets the number of children for this container. + /// Get the number of children for this container /// Read only /// ///
The container has been initialized.
- /// The number of children. + /// number of children public uint ChildCount { get diff --git a/src/Tizen.NUI/src/public/CustomView/Spin.cs b/src/Tizen.NUI/src/public/CustomView/Spin.cs index ad1157bb7..e3e9f2c1b 100755 --- a/src/Tizen.NUI/src/public/CustomView/Spin.cs +++ b/src/Tizen.NUI/src/public/CustomView/Spin.cs @@ -27,7 +27,7 @@ using Tizen.NUI.BaseComponents; namespace Tizen.NUI { /// - ///Spins the CustomView class. + ///Spin CustomView class /// public class Spin : CustomView { @@ -62,22 +62,21 @@ namespace Tizen.NUI } /// - /// Creates an initialized spin. + /// Creates an initialized Spin. /// public Spin() : base(typeof(Spin).FullName, CustomViewBehaviour.RequiresKeyboardNavigationSupport) { } /// - /// Overrides the method of OnInitialize() for the CustomView class.
- /// This method is called after the control has been initialized.
+ /// Override method of OnInitialize() for CustomView class.
+ /// This method is called after the Control has been initialized.
/// Derived classes should do any second phase initialization by overriding this method.
///
public override void OnInitialize() { // Initialize the propertiesControl - //_arrowImage = "/home/tengxb/Workspace/nui-debug/examples/res/images/arrow.png"; - _arrowImage = Tizen.Applications.Application.Current.DirectoryInfo.Resource + "picture.png"; + _arrowImage = "/home/tengxb/Workspace/nui-debug/examples/res/images/arrow.png"; _textBackgroundColor = new Color(0.6f, 0.6f, 0.6f, 1.0f); _currentValue = 0; _minValue = 0; @@ -115,29 +114,29 @@ namespace Tizen.NUI } /// - /// Overrides the method of GetNaturalSize() for the CustomView class.
- /// Returns the natural size of the actor.
+ /// Override method of GetNaturalSize() for CustomView class.
+ /// Return the natural size of the actor.
///
- /// Natural size of this spin itself. + /// Natural size of this Spin itself public override Size2D GetNaturalSize() { return new Size2D(150, 150); } /// - /// An event handler is used when the TextField in the spin gets the key focus.
- /// Make sure when the current spin that takes input focus, also takes the keyboard focus.
+ /// Event handler when the TextField in Spin gets the Key focus.
+ /// Make sure when the current spin that takes input focus also takes the keyboard focus.
/// For example, when you tap the spin directly.
///
- /// Sender of this event. - /// Event arguments. + /// Sender of this event + /// Event arguments public void TextFieldKeyInputFocusGained(object source, EventArgs e) { FocusManager.Instance.SetCurrentFocusView(_textField); } /// - /// An event handler when the TextField in the spin looses it's key focus. + /// Event handler when the TextField in Spin looses it's Key focus /// /// /// @@ -163,14 +162,14 @@ namespace Tizen.NUI } /// - /// Overrides the method of GetNextKeyboardFocusableView() for the CustomView class.
- /// Gets the next key focusable view in this view towards the given direction.
- /// A view needs to override this function in order to support two-dimensional key navigation.
+ /// Override method of GetNextKeyboardFocusableView() for CustomView class.
+ /// Gets the next key focusable view in this View towards the given direction.
+ /// A View needs to override this function in order to support two dimensional key navigation.
///
- /// The current focused view. - /// The direction to move the focus towards. - /// Whether the focus movement should be looped within the control. - /// The next keyboard focusable view in this control or an empty handle if no view can be focused. + /// The current focused view + /// The direction to move the focus towards + /// Whether the focus movement should be looped within the control + /// The next keyboard focusable view in this control or an empty handle if no view can be focused public override View GetNextFocusableView(View currentFocusedView, View.FocusDirection direction, bool loopEnabled) { // Respond to Up/Down keys to change the value while keeping the current spin focused @@ -195,7 +194,7 @@ namespace Tizen.NUI } /// - /// Value to be set in the spin. + /// Value to be set in Spin. /// [ScriptableProperty()] public int Value @@ -226,7 +225,7 @@ namespace Tizen.NUI } /// - /// Minimum value of the spin value. + /// Minimum Value of Spin Value. /// // MinValue property of type int: [ScriptableProperty()] @@ -243,7 +242,7 @@ namespace Tizen.NUI } /// - /// Maximum value of the spin value. + /// Maximum Value of Spin Value. /// // MaxValue property of type int: [ScriptableProperty()] @@ -260,7 +259,7 @@ namespace Tizen.NUI } /// - /// Increasing, decreasing step of the spin value when up or down keys are pressed. + /// Increasing, decresing step of Spin Value when Up or Down key is pressed. /// // Step property of type int: [ScriptableProperty()] @@ -294,7 +293,7 @@ namespace Tizen.NUI } /// - /// Text point size of the spin value. + /// Text point size of Spin Value. /// // TextPointSize property of type int: [ScriptableProperty()] @@ -312,7 +311,7 @@ namespace Tizen.NUI } /// - /// The color of the spin value. + /// The color of Spin Value. /// // TextColor property of type Color: [ScriptableProperty()] @@ -332,7 +331,7 @@ namespace Tizen.NUI } /// - /// Maximum text lengh of the spin value. + /// Maximum text lengh of Spin Value. /// // MaxTextLength property of type int: [ScriptableProperty()] @@ -350,7 +349,7 @@ namespace Tizen.NUI } /// - /// Reference of TextField of the spin. + /// Reference of TextField of Spin. /// public TextField SpinText { @@ -365,7 +364,7 @@ namespace Tizen.NUI } /// - /// Show indicator image, for example, up or down arrow image. + /// Show indicator image, for example Up/Down Arrow image. /// // Indicator property of type string: public string IndicatorImage diff --git a/src/Tizen.NUI/src/public/CustomViewRegistry.cs b/src/Tizen.NUI/src/public/CustomViewRegistry.cs index 46a3c933d..0b5cc2140 100755 --- a/src/Tizen.NUI/src/public/CustomViewRegistry.cs +++ b/src/Tizen.NUI/src/public/CustomViewRegistry.cs @@ -8,7 +8,7 @@ using Tizen.NUI.BaseComponents; namespace Tizen.NUI { /// - /// Adds this attribute to any property belonging to a view (control) you want to be scriptable from JSON. + /// Add this attribute to any property belonging to a View (control) you want to be scriptable from JSON /// /// /// Example: @@ -31,13 +31,13 @@ namespace Tizen.NUI /// /// Internally the following occurs for property registration ( this only occurs once per Type, not per Instance): /// - /// - The controls static constructor should call ViewRegistry.Register() (only called once for the lifecycle of the app). - /// - Within Register() the code will introspect the Controls properties, looking for the ScriptableProperty() attribute. + /// - The controls static constructor should call ViewRegistry.Register() (only called once for the lifecycle of the app) + /// - Within Register() the code will introspect the Controls properties, looking for the ScriptableProperty() attribute /// - For every property with the ScriptableProperty() attribute, TypeRegistration.RegisterProperty is called. - /// - TypeRegistration.RegisterProperty calls in to DALi C++ Code Dali::CSharpTypeRegistry::RegisterProperty(). + /// - TypeRegistration.RegisterProperty calls in to DALi C++ Code Dali::CSharpTypeRegistry::RegisterProperty() /// - DALi C++ now knows the existance of the property and will try calling SetProperty, if it finds the property in a JSON file (loaded using builder). /// - /// The DALi C# example: + /// The DALi C# example /// /// class MyView : public CustomView /// { @@ -87,8 +87,8 @@ namespace Tizen.NUI } /// - /// View the Registry singleton. - /// Used for registering controls and any scriptable properties they have (see ScriptableProperty). + /// View Registry singleton. + /// Used for registering controls and any scriptable properties they have ( see ScriptableProperty ) /// /// Internal Design from C# to C++ /// @@ -97,15 +97,15 @@ namespace Tizen.NUI /// Example of running a static constructor: /// System.Runtime.CompilerServices.RuntimeHelpers.RunClassConstructor (typeof(Spin).TypeHandle); /// Inside the static constructor the control should register it's type with the ViewRegistry - /// For example: + /// e.g. /// /// static Spin() /// { /// ViewRegistry.Instance.Register(CreateInstance, typeof(Spin) ); /// } /// - /// The control should also provide a CreateInstance function, which gets passed to the ViewRegistry. - /// // Eventually it will be called if DALi Builderfinds a Spin control in a JSON file. + /// The control should also provide a CreateInstance function, which gets passed to the ViewRegistry + /// // Eventually it will be called if DALi Builderfinds a Spin control in a JSON file /// static CustomView CreateInstance() /// { /// return new Spin(); @@ -123,7 +123,7 @@ namespace Tizen.NUI public sealed class CustomViewRegistry { /// - /// ViewRegistry is a singleton. + /// ViewRegistry is a singleton /// private static CustomViewRegistry instance = null; @@ -143,12 +143,12 @@ namespace Tizen.NUI /// // Maps the name of a custom view to a create instance function - /// For example, given a string "Spin", we can get a function used to create the Spin View. + /// E.g. given a string "Spin", we can get a function used to create the Spin View. /// private Dictionary> _constructorMap; /// - /// Lookup table to match C# types to DALi types, used for the automatic property registration. + /// Lookup table to match C# types to DALi types, used for the automatic property registration /// private static readonly Dictionary _daliPropertyTypeLookup = new Dictionary @@ -201,10 +201,10 @@ namespace Tizen.NUI } /// - /// Called directly from DALi C++ type registry to create a control (view) using no marshalling. + /// Called directly from DALi C++ type registry to create a control (View) using no marshalling. /// - /// Pointer to the control (views) handle. - /// C pointer to the control (view) name. + /// Pointer to the Control (Views) handle + /// C pointer to the Control (View) name private static IntPtr CreateControl(IntPtr cPtrControlName) { string controlName = System.Runtime.InteropServices.Marshal.PtrToStringAnsi(cPtrControlName); @@ -223,6 +223,7 @@ namespace Tizen.NUI else { throw new global::System.InvalidOperationException("C# View not registererd with ViewRegistry" + controlName); + return IntPtr.Zero; } } @@ -255,12 +256,12 @@ namespace Tizen.NUI } /// - /// The function which registers a view and all it's scriptable properties with DALi's type registry. - /// Means the view can be created or configured from a JSON script. + /// Function which registers a view and all it's scriptable properties with DALi's type registry. + /// Means the View can be created / configured from a JSON script. /// - /// The function uses introspection to scan a views C# properties, then selects the ones with + /// The function uses introspection to scan a Views C# properties, then selects the ones with ///[ScriptableProperty] attribute to be registered. - /// Example of a Spin view registering itself: + /// Example of a Spin view registering itself /// static Spin() /// { /// ViewRegistry registers control type with DALi type registery @@ -316,7 +317,7 @@ namespace Tizen.NUI } /// - /// Gets a property value from a view. + /// Get a property value from a View /// /// private IntPtr GetPropertyValue(IntPtr refObjectPtr, string propertyName) @@ -339,7 +340,7 @@ namespace Tizen.NUI } /// - /// Sets a property value on a view. + /// Set a property value on a View /// /// private void SetPropertyValue(IntPtr refObjectPtr, string propertyName, IntPtr propertyValuePtr) diff --git a/src/Tizen.NUI/src/public/Degree.cs b/src/Tizen.NUI/src/public/Degree.cs index 11785b7f2..4524fef5b 100755 --- a/src/Tizen.NUI/src/public/Degree.cs +++ b/src/Tizen.NUI/src/public/Degree.cs @@ -100,7 +100,7 @@ namespace Tizen.NUI } /// - /// The constructor. + /// Constructor. /// public Degree() : this(NDalicPINVOKE.new_Degree__SWIG_0(), true) { @@ -110,16 +110,16 @@ namespace Tizen.NUI /// /// Creates an angle in degrees. /// - /// The initial value in degrees. + /// The initial value in degrees public Degree(float value) : this(NDalicPINVOKE.new_Degree__SWIG_1(value), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } /// - /// Creates an angle in degrees from a radian. + /// Creates an angle in degrees from a Radian. /// - /// The initial value in radians. + /// The initial value in Radians public Degree(Radian value) : this(NDalicPINVOKE.new_Degree__SWIG_2(Radian.getCPtr(value)), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); diff --git a/src/Tizen.NUI/src/public/FocusManager.cs b/src/Tizen.NUI/src/public/FocusManager.cs index 1147ad47a..f86c19262 100755 --- a/src/Tizen.NUI/src/public/FocusManager.cs +++ b/src/Tizen.NUI/src/public/FocusManager.cs @@ -25,9 +25,9 @@ namespace Tizen.NUI using Tizen.NUI.BaseComponents; /// - /// Provides the functionality of handling keyboard navigation and maintaining the two-dimensional keyboard focus chain.
- /// It provides functionality of setting the focus and moving the focus in four directions( i.e., left, right, up, and down).
- /// It also draws a highlight for the focused view and sends an event when the focus is changed.
+ /// Provides the functionality of handling keyboard navigation and maintaining the two dimensional keyboard focus chain.
+ /// It provides functionality of setting the focus and moving the focus in four directions(i.e.Left, Right, Up and Down).
+ /// It also draws a highlight for the focused View and sends a event when the focus is changed.
///
public class FocusManager : BaseHandle { @@ -45,7 +45,7 @@ namespace Tizen.NUI } /// - /// To make the FocusManager instance be disposed. + /// To make FocusManager instance be disposed. /// protected override void Dispose(DisposeTypes type) { @@ -105,7 +105,7 @@ namespace Tizen.NUI /// - /// Event arguments that passed via the PreFocusChange signal. + ///Event arguments that passed via PreFocusChange signal /// public class PreFocusChangeEventArgs : EventArgs { @@ -157,10 +157,10 @@ namespace Tizen.NUI /// /// PreFocusChange will be triggered before the focus is going to be changed.
- /// The FocusManager makes the best guess for which view to focus towards the given direction, but applications might want to change that.
+ /// FocusManager makes the best guess for which view to focus towards the given direction, but applications might want to change that.
/// By connecting with this event, they can check the proposed view to focus and return a different view if they wish.
/// This event is only triggered when the navigation key is pressed and KeyboardFocusManager tries to move the focus automatically.
- /// It won't be emitted for focus movement by calling the SetCurrentFocusView directly.
+ /// It won't be emitted for focus movement by calling SetCurrentFocusView directly.
///
public event EventHandlerWithReturnType PreFocusChange { @@ -232,7 +232,7 @@ namespace Tizen.NUI } /// - /// Event arguments that passed via the FocusChanged signal. + ///Event arguments that passed via FocusChanged signal. /// public class FocusChangedEventArgs : EventArgs { @@ -270,7 +270,7 @@ namespace Tizen.NUI private FocusChangedEventCallback _focusChangedEventCallback; /// - /// The FocusGroupChanged will be triggered after the current focused view has been changed. + /// FocusGroupChanged will be triggered after the current focused view has been changed. /// public event EventHandler FocusChanged { @@ -308,7 +308,7 @@ namespace Tizen.NUI } /// - /// Event arguments that passed via the FocusGroupChanged signal. + ///Event arguments that passed via FocusGroupChanged signal. /// public class FocusGroupChangedEventArgs : EventArgs { @@ -346,8 +346,8 @@ namespace Tizen.NUI private FocusGroupChangedEventCallback _focusGroupChangedEventCallback; /// - /// The FocusGroupChanged will be triggered when the focus group has been changed.
- /// If the current focus group has a parent layout control, the FocusManager will make the best guess for the next focus group to move the focus to in the given direction (forward or backward).
+ /// FocusGroupChanged will be triggered when the focus group has been changed.
+ /// If the current focus group has a parent layout control, FocusManager will make the best guess for the next focus group to move the focus to in the given direction (forward or backward).
/// If not, the application has to set the new focus.
///
public event EventHandler FocusGroupChanged @@ -386,7 +386,7 @@ namespace Tizen.NUI } /// - /// Event arguments that passed via the FocusedViewEnterKey signal. + ///Event arguments that passed via FocusedViewEnterKey signal /// public class FocusedViewActivatedEventArgs : EventArgs { @@ -411,7 +411,7 @@ namespace Tizen.NUI private FocusedViewEnterKeyEventCallback _focusedViewEnterKeyEventCallback; /// - /// The FocusedViewActivated will be triggered when the current focused view has the enter key pressed on it. + /// FocusedViewActivated will be triggered when the current focused view has the enter key pressed on it. /// public event EventHandler FocusedViewActivated { @@ -461,19 +461,14 @@ namespace Tizen.NUI } /// - /// Moves the keyboard focus to the given view.
- /// Only one view can be focused at the same time.
- /// The view must be in the stage already and keyboard focusable.
+ /// Moves the keyboard focus to the given View.
+ /// Only one View can be focused at the same time.
+ /// The View must be in the stage already and keyboard focusable.
///
- /// The view to be focused. - /// Whether the focus is successful or not. + /// The View to be focused + /// Whether the focus is successful or not public bool SetCurrentFocusView(View view) { - if(view == null) - { - throw new ArgumentNullException("the target view should not be null"); - } - bool ret = NDalicManualPINVOKE.FocusManager_SetCurrentFocusActor(swigCPtr, View.getCPtr(view)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; @@ -482,7 +477,7 @@ namespace Tizen.NUI /// /// Gets the current focused view. /// - /// A handle to the current focused view or an empty handle if no view is focused. + /// A handle to the current focused View or an empty handle if no View is focused public View GetCurrentFocusView() { IntPtr cPtr = NDalicManualPINVOKE.FocusManager_GetCurrentFocusActor(swigCPtr); @@ -492,10 +487,10 @@ namespace Tizen.NUI } /// - /// Moves the focus to the next focusable view in the focus chain in the given direction (according to the focus traversal order). + /// Moves the focus to the next focusable View in the focus chain in the given direction(according to the focus traversal order). /// - /// The direction of the focus movement. - /// True if the movement was successful. + /// The direction of focus movement + /// true if the movement was successful public bool MoveFocus(View.FocusDirection direction) { bool ret = NDalicManualPINVOKE.FocusManager_MoveFocus(swigCPtr, (int)direction); @@ -505,7 +500,7 @@ namespace Tizen.NUI /// /// Clears the focus from the current focused view if any, so that no view is focused in the focus chain.
- /// It will emit the FocusChanged event without the current focused view.
+ /// It will emit FocusChanged event without current focused View.
///
public void ClearFocus() { @@ -514,7 +509,7 @@ namespace Tizen.NUI } /// - /// Move the focus to previous focused view. + /// Move the focus to prev focused view. /// public void MoveFocusBackward() { @@ -523,7 +518,7 @@ namespace Tizen.NUI } /// - /// Gets or sets the status of whether the focus movement should be looped within the same focus group.
+ /// Sets/Gets the status of whether the focus movement should be looped within the same focus group.
/// The focus movement is not looped by default.
///
public bool FocusGroupLoop @@ -552,11 +547,11 @@ namespace Tizen.NUI } /// - /// Sets whether the view is a focus group that can limit the scope of the focus movement to its child views in the focus chain.
+ /// Sets whether an View is a focus group that can limit the scope of focus movement to its child views in the focus chain.
/// Layout controls set themselves as focus groups by default.
///
- /// The view to be set as a focus group. - /// Whether to set the view as a focus group or not. + /// The View to be set as a focus group + /// Whether to set the View as a focus group or not public void SetAsFocusGroup(View view, bool isFocusGroup) { NDalicManualPINVOKE.FocusManager_SetAsFocusGroup(swigCPtr, View.getCPtr(view), isFocusGroup); @@ -566,8 +561,8 @@ namespace Tizen.NUI /// /// Checks whether the view is set as a focus group or not. /// - /// The view to be checked. - /// Whether the view is set as a focus group. + /// The View to be checked + /// Whether the View is set as a focus group public bool IsFocusGroup(View view) { bool ret = NDalicManualPINVOKE.FocusManager_IsFocusGroup(swigCPtr, View.getCPtr(view)); @@ -578,8 +573,8 @@ namespace Tizen.NUI /// /// Returns the closest ancestor of the given view that is a focus group. /// - /// The view to be checked for its focus group. - /// The focus group the given view belongs to or an empty handle if the given view. + /// The View to be checked for its focus group + /// The focus group the given view belongs to or an empty handle if the given view public View GetFocusGroup(View view) { IntPtr cPtr = NDalicManualPINVOKE.FocusManager_GetFocusGroup(swigCPtr, View.getCPtr(view)); @@ -598,8 +593,8 @@ namespace Tizen.NUI } /// - /// Gets or sets the focus indicator view.
- /// This will replace the default focus indicator view in the FocusManager and will be added to the focused view as a highlight.
+ /// Sets/Gets the focus indicator View.
+ /// This will replace the default focus indicator view in FocusManager and will be added to the focused view as a highlight.
///
public View FocusIndicator { @@ -629,9 +624,9 @@ namespace Tizen.NUI } /// - /// Provides the implementation of a custom focus algorithm interface to allow the application to define the focus logic.
+ /// Provide the implementation of custom Focus algorithm interface to allow the app define the focus logic.
///
- /// The user's implementation of ICustomFocusAlgorithm. + /// The user's implementation of ICustomFocusAlgorithm public void SetCustomAlgorithm(ICustomFocusAlgorithm arg0) { _customAlgorithmInterfaceWrapper = new CustomAlgorithmInterfaceWrapper(); @@ -672,7 +667,7 @@ namespace Tizen.NUI private static readonly FocusManager instance = FocusManager.Get(); /// - /// Gets the singleton of the FocusManager object. + /// Gets the singleton of FocusManager object. /// public static FocusManager Instance { @@ -683,11 +678,11 @@ namespace Tizen.NUI } /// - /// ICustomFocusAlgorithm is used to provide the custom keyboard focus algorithm for retrieving the next focusable view.
- /// The application can implement the interface and override the keyboard focus behavior.
- /// If the focus is changing within a layout container, then the layout container is queried first to provide the next focusable view.
- /// If this does not provide a valid view, then the Keyboard FocusManager will check focusable properties to determine the next focusable actor.
- /// If focusable properties are not set, then the keyboard FocusManager calls the GetNextFocusableView() method of this interface.
+ /// ICustomFocusAlgorithm is used to provide custom keyboard focus algorithm for retrieving the next focusable view.
+ /// The application can implement the interface and override the keyboard focus behaviour.
+ /// If focus is changing within a layout container, then the layout container is queried first to provide the next focusable view.
+ /// If this does not provide a valid view, then the Keyboard FocusManager will check focusable properties to determine next focusable actor.
+ /// If focusable properties are not set, then the Keyboard FocusManager calls the GetNextFocusableView() method of this interface.
///
public interface ICustomFocusAlgorithm { diff --git a/src/Tizen.NUI/src/public/Geometry.cs b/src/Tizen.NUI/src/public/Geometry.cs index b65ad88c6..4752be25f 100755 --- a/src/Tizen.NUI/src/public/Geometry.cs +++ b/src/Tizen.NUI/src/public/Geometry.cs @@ -101,7 +101,7 @@ namespace Tizen.NUI if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - public new Geometry.Type GetType() + public Geometry.Type GetType() { Geometry.Type ret = (Geometry.Type)NDalicPINVOKE.Geometry_GetType(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); diff --git a/src/Tizen.NUI/src/public/Gesture.cs b/src/Tizen.NUI/src/public/Gesture.cs index e2e4628f9..8e8d9576a 100755 --- a/src/Tizen.NUI/src/public/Gesture.cs +++ b/src/Tizen.NUI/src/public/Gesture.cs @@ -19,8 +19,8 @@ namespace Tizen.NUI /// /// Base structure for different gestures that an application can receive.
- /// A Gesture is an event that is produced from a combination of several touch events - /// in a particular order or within a certain time frame (for example, pinch).
+ /// A gesture is an event that is produced from a combination of several touch events + /// in a particular order or within a certain time frame (e.g pinch).
///
public class Gesture : global::System.IDisposable { @@ -136,7 +136,7 @@ namespace Tizen.NUI } /// - /// The Copy constructor. + /// Copy constructor. /// /// A reference to the copied handle public Gesture(Gesture rhs) : this(NDalicPINVOKE.new_Gesture(Gesture.getCPtr(rhs)), true) @@ -190,7 +190,7 @@ namespace Tizen.NUI } /// - /// Enumeration for type of gesture. + /// Enumeration for type of gesture /// public enum GestureType { diff --git a/src/Tizen.NUI/src/public/Hover.cs b/src/Tizen.NUI/src/public/Hover.cs index 9f194e2da..4da86f6ca 100755 --- a/src/Tizen.NUI/src/public/Hover.cs +++ b/src/Tizen.NUI/src/public/Hover.cs @@ -19,7 +19,7 @@ namespace Tizen.NUI using Tizen.NUI.BaseComponents; /// /// Hover events are a collection of points at a specific moment in time.
- /// When a multi-event occurs, each point represents the points that are currently being + /// When a multi event occurs, each point represents the points that are currently being /// hovered or the points where a hover has stopped.
///
public class Hover : global::System.IDisposable @@ -121,12 +121,12 @@ namespace Tizen.NUI } /// - /// Returns the ID of the device used for the point specified.
+ /// Returns the ID of the device used for the Point specified.
/// Each point has a unique device ID which specifies the device used for that /// point. This is returned by this method.
///
- /// The point required. - /// The device ID of this point. + /// The point required + /// The Device ID of this poin public int GetDeviceId(uint point) { if (point < points.Count) @@ -137,10 +137,10 @@ namespace Tizen.NUI } /// - /// Retrieves the state of the point specified. + /// Retrieves the State of the point specified. /// - /// The point required. - /// The state of the point specified. + /// The point required + /// The state of the point specified public PointStateType GetState(uint point) { if (point < points.Count) @@ -153,8 +153,8 @@ namespace Tizen.NUI /// /// Retrieves the view that was underneath the point specified. /// - /// The point required. - /// The view that was underneath the point specified. + /// The point required + /// The view that was underneath the point specified public View GetHitView(uint point) { if (point < points.Count) @@ -171,10 +171,10 @@ namespace Tizen.NUI } /// - /// Retrieves the coordinates relative to the top-left of the hit-view at the point specified. + /// Retrieves the co-ordinates relative to the top-left of the hit-view at the point specified. /// - /// The point required. - /// The coordinates relative to the top-left of the hit-view of the point specified. + /// The point required + /// The co-ordinates relative to the top-left of the hit-view of the point specified public Vector2 GetLocalPosition(uint point) { if (point < points.Count) @@ -185,10 +185,10 @@ namespace Tizen.NUI } /// - /// Retrieves the coordinates relative to the top-left of the screen of the point specified. + /// Retrieves the co-ordinates relative to the top-left of the screen of the point specified. /// - /// The point required. - /// The coordinates relative to the top-left of the screen of the point specified. + /// The point required + /// The co-ordinates relative to the top-left of the screen of the point specified public Vector2 GetScreenPosition(uint point) { if (point < points.Count) @@ -199,7 +199,7 @@ namespace Tizen.NUI } /// - /// The default constructor. + /// Default constructor. /// public Hover() : this(NDalicPINVOKE.new_Hover__SWIG_0(), true) { @@ -207,9 +207,9 @@ namespace Tizen.NUI } /// - /// The constructor. + /// Constructor. /// - /// The time the event occurred. + /// The time the event occurred internal Hover(uint time) : this(NDalicPINVOKE.new_Hover__SWIG_1(time), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -249,7 +249,7 @@ namespace Tizen.NUI /// /// Returns the total number of points. /// - /// Total number of points. + /// Total number of Points public uint GetPointCount() { uint ret = NDalicPINVOKE.Hover_GetPointCount(swigCPtr); diff --git a/src/Tizen.NUI/src/public/ImfManager.cs b/src/Tizen.NUI/src/public/ImfManager.cs index 790b45e72..38d8db12f 100755 --- a/src/Tizen.NUI/src/public/ImfManager.cs +++ b/src/Tizen.NUI/src/public/ImfManager.cs @@ -25,14 +25,14 @@ namespace Tizen.NUI { private global::System.Runtime.InteropServices.HandleRef swigCPtr; - internal ImfManager(IntPtr cPtr, bool cMemoryOwn) : base(NDalicManualPINVOKE.ImfManager_SWIGUpcast(cPtr), cMemoryOwn) + internal ImfManager(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicManualPINVOKE.ImfManager_SWIGUpcast(cPtr), cMemoryOwn) { swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); } internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ImfManager obj) { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, IntPtr.Zero) : obj.swigCPtr; + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; } protected override void Dispose(DisposeTypes type) @@ -54,9 +54,9 @@ namespace Tizen.NUI //You should not access any managed member here except static instance. //because the execution order of Finalizes is non-deterministic. - if (_keyboardTypeChangedEventCallback != null) + if (_imfKeyboardTypeChangedEventCallback != null) { - KeyboardTypeChangedSignal().Disconnect(_keyboardTypeChangedEventCallback); + KeyboardTypeChangedSignal().Disconnect(_imfKeyboardTypeChangedEventCallback); } if (_imfManagerLanguageChangedEventCallback != null) @@ -91,7 +91,7 @@ namespace Tizen.NUI swigCMemOwn = false; NDalicManualPINVOKE.delete_ImfManager(swigCPtr); } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, IntPtr.Zero); + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); } base.Dispose(type); @@ -105,7 +105,7 @@ namespace Tizen.NUI private global::System.Runtime.InteropServices.HandleRef swigCPtr; protected bool swigCMemOwn; - internal ImfEventData(IntPtr cPtr, bool cMemoryOwn) + internal ImfEventData(global::System.IntPtr cPtr, bool cMemoryOwn) { swigCMemOwn = cMemoryOwn; swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); @@ -113,7 +113,7 @@ namespace Tizen.NUI internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ImfEventData obj) { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, IntPtr.Zero) : obj.swigCPtr; + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; } //A Flag to check who called Dispose(). (By User or DisposeQueue) @@ -132,7 +132,7 @@ namespace Tizen.NUI } /// - /// The dispose pattern. + /// Dispose pattern /// public void Dispose() { @@ -172,20 +172,20 @@ namespace Tizen.NUI //You should not access any managed member here except static instance. //because the execution order of Finalizes is non-deterministic. - if (swigCPtr.Handle != IntPtr.Zero) + if (swigCPtr.Handle != global::System.IntPtr.Zero) { if (swigCMemOwn) { swigCMemOwn = false; NDalicManualPINVOKE.delete_ImfManager_ImfEventData(swigCPtr); } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, IntPtr.Zero); + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); } disposed = true; } - internal static ImfEventData GetImfEventDataFromPtr(IntPtr cPtr) + internal static ImfEventData GetImfEventDataFromPtr(global::System.IntPtr cPtr) { ImfEventData ret = new ImfEventData(cPtr, false); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -193,7 +193,7 @@ namespace Tizen.NUI } /// - /// The default constructor. + /// Default Constructor /// public ImfEventData() : this(NDalicManualPINVOKE.new_ImfManager_ImfEventData__SWIG_0(), true) { @@ -201,11 +201,11 @@ namespace Tizen.NUI } /// - /// The constructor. + /// Constructor /// /// The name of the event from the IMF. - /// The pre-edit or the commit string. - /// Start the position from the current cursor position to start deleting characters. + /// The pre-edit or commit string. + /// Start position from the current cursor position to start deleting characters. /// The number of characters to delete from the cursorOffset. public ImfEventData(ImfManager.ImfEvent aEventName, string aPredictiveString, int aCursorOffset, int aNumberOfChars) : this(NDalicManualPINVOKE.new_ImfManager_ImfEventData__SWIG_1((int)aEventName, aPredictiveString, aCursorOffset, aNumberOfChars), true) { @@ -213,26 +213,7 @@ namespace Tizen.NUI } /// - /// The pre-edit or the commit string. - /// - [Obsolete("Please do not use! this will be deprecated")] - public string predictiveString - { - set - { - NDalicManualPINVOKE.ImfManager_ImfEventData_predictiveString_set(swigCPtr, value); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - get - { - string ret = NDalicManualPINVOKE.ImfManager_ImfEventData_predictiveString_get(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - } - - /// - /// The pre-edit or the commit string. + /// The pre-edit or commit string. /// public string PredictiveString { @@ -249,25 +230,6 @@ namespace Tizen.NUI } } - /// - /// The name of the event from the IMF. - /// - [Obsolete("Please do not use! this will be deprecated")] - public ImfManager.ImfEvent eventName - { - set - { - NDalicManualPINVOKE.ImfManager_ImfEventData_eventName_set(swigCPtr, (int)value); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - get - { - ImfManager.ImfEvent ret = (ImfManager.ImfEvent)NDalicManualPINVOKE.ImfManager_ImfEventData_eventName_get(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - } - /// /// The name of the event from the IMF. /// @@ -287,26 +249,7 @@ namespace Tizen.NUI } /// - /// The start position from the current cursor position to start deleting characters. - /// - [Obsolete("Please do not use! this will be deprecated")] - public int cursorOffset - { - set - { - NDalicManualPINVOKE.ImfManager_ImfEventData_cursorOffset_set(swigCPtr, value); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - get - { - int ret = NDalicManualPINVOKE.ImfManager_ImfEventData_cursorOffset_get(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - } - - /// - /// The start position from the current cursor position to start deleting characters. + /// Start position from the current cursor position to start deleting characters. /// public int CursorOffset { @@ -324,26 +267,7 @@ namespace Tizen.NUI } /// - /// The number of characters to delete from the cursorOffset. - /// - [Obsolete("Please do not use! this will be deprecated")] - public int numberOfChars - { - set - { - NDalicManualPINVOKE.ImfManager_ImfEventData_numberOfChars_set(swigCPtr, value); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - get - { - int ret = NDalicManualPINVOKE.ImfManager_ImfEventData_numberOfChars_get(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - } - - /// - /// The number of characters to delete from the cursorOffset. + /// Number of characters to delete from the cursorOffset. /// public int NumberOfChars { @@ -363,19 +287,14 @@ namespace Tizen.NUI } /// - /// Data required by the IMF from the callback. + /// Data required by IMF from the callback. /// public class ImfCallbackData : global::System.IDisposable { private global::System.Runtime.InteropServices.HandleRef swigCPtr; protected bool swigCMemOwn; - internal IntPtr GetImfCallbackDataPtr() - { - return (IntPtr)swigCPtr; - } - - internal ImfCallbackData(IntPtr cPtr, bool cMemoryOwn) + internal ImfCallbackData(global::System.IntPtr cPtr, bool cMemoryOwn) { swigCMemOwn = cMemoryOwn; swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); @@ -383,7 +302,7 @@ namespace Tizen.NUI internal static global::System.Runtime.InteropServices.HandleRef getCPtr(ImfCallbackData obj) { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, IntPtr.Zero) : obj.swigCPtr; + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; } //A Flag to check who called Dispose(). (By User or DisposeQueue) @@ -402,7 +321,7 @@ namespace Tizen.NUI } /// - /// The dispose pattern. + /// Dispose pattern /// public void Dispose() { @@ -442,20 +361,20 @@ namespace Tizen.NUI //You should not access any managed member here except static instance. //because the execution order of Finalizes is non-deterministic. - if (swigCPtr.Handle != IntPtr.Zero) + if (swigCPtr.Handle != global::System.IntPtr.Zero) { if (swigCMemOwn) { swigCMemOwn = false; NDalicManualPINVOKE.delete_ImfManager_ImfCallbackData(swigCPtr); } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, IntPtr.Zero); + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); } disposed = true; } - internal static ImfCallbackData GetImfCallbackDataFromPtr(IntPtr cPtr) + internal static ImfCallbackData GetImfCallbackDataFromPtr(global::System.IntPtr cPtr) { ImfCallbackData ret = new ImfCallbackData(cPtr, false); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -463,7 +382,7 @@ namespace Tizen.NUI } /// - /// The default constructor. + /// Default Constructor /// public ImfCallbackData() : this(NDalicManualPINVOKE.new_ImfManager_ImfCallbackData__SWIG_0(), true) { @@ -471,11 +390,11 @@ namespace Tizen.NUI } /// - /// The constructor. + /// Constructor /// - /// True if the cursor position needs to be updated. - /// The new position of the cursor. - /// The current text string. + /// True if cursor position needs to be updated. + /// New position of cursor. + /// Current text string. /// Flag if preedit reset is required. public ImfCallbackData(bool aUpdate, int aCursorPosition, string aCurrentText, bool aPreeditResetRequired) : this(NDalicManualPINVOKE.new_ImfManager_ImfCallbackData__SWIG_1(aUpdate, aCursorPosition, aCurrentText, aPreeditResetRequired), true) { @@ -483,26 +402,7 @@ namespace Tizen.NUI } /// - /// The current text string. - /// - [Obsolete("Please do not use! this will be deprecated")] - public string currentText - { - set - { - NDalicManualPINVOKE.ImfManager_ImfCallbackData_currentText_set(swigCPtr, value); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - get - { - string ret = NDalicManualPINVOKE.ImfManager_ImfCallbackData_currentText_get(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - } - - /// - /// The current text string. + /// Current text string. /// public string CurrentText { @@ -520,26 +420,7 @@ namespace Tizen.NUI } /// - /// The current text string. - /// - [Obsolete("Please do not use! this will be deprecated")] - public int cursorPosition - { - set - { - NDalicManualPINVOKE.ImfManager_ImfCallbackData_cursorPosition_set(swigCPtr, value); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - get - { - int ret = NDalicManualPINVOKE.ImfManager_ImfCallbackData_cursorPosition_get(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - } - - /// - /// The current text string. + /// Current text string. /// public int CursorPosition { @@ -557,26 +438,7 @@ namespace Tizen.NUI } /// - /// If the cursor position needs to be updated. - /// - [Obsolete("Please do not use! this will be deprecated")] - public bool update - { - set - { - NDalicManualPINVOKE.ImfManager_ImfCallbackData_update_set(swigCPtr, value); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - get - { - bool ret = NDalicManualPINVOKE.ImfManager_ImfCallbackData_update_get(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - } - - /// - /// If the cursor position needs to be updated. + /// If cursor position needs to be updated. /// public bool Update { @@ -594,26 +456,7 @@ namespace Tizen.NUI } /// - /// Flags if preedit reset is required. - /// - [Obsolete("Please do not use! this will be deprecated")] - public bool preeditResetRequired - { - set - { - NDalicManualPINVOKE.ImfManager_ImfCallbackData_preeditResetRequired_set(swigCPtr, value); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - get - { - bool ret = NDalicManualPINVOKE.ImfManager_ImfCallbackData_preeditResetRequired_get(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - } - - /// - /// Flags if preedit reset is required. + /// Flag if preedit reset is required. /// public bool PreeditResetRequired { @@ -633,7 +476,7 @@ namespace Tizen.NUI } /// - /// Retrieves a handle to the instance of the ImfManager. + /// Retrieve a handle to the instance of ImfManager. /// /// A handle to the ImfManager. public static ImfManager Get() @@ -644,9 +487,9 @@ namespace Tizen.NUI } /// - /// Activates the IMF.
- /// It means that the text editing is started somewhere.
- /// If the hardware keyboard isn't connected, then it will show the virtual keyboard. + /// Activate the IMF.
+ /// It means that the text editing is started at somewhere.
+ /// If the H/W keyboard isn't connected then it will show the virtual keyboard. ///
public void Activate() { @@ -655,8 +498,8 @@ namespace Tizen.NUI } /// - /// Deactivates the IMF.
- /// It means that the text editing is finished somewhere. + /// Deactivate the IMF.
+ /// It means that the text editing is finished at somewhere. ///
public void Deactivate() { @@ -665,10 +508,10 @@ namespace Tizen.NUI } /// - /// Gets the restoration status which controls if the keyboard is restored after the focus is lost and then regained.
- /// If true, then the keyboard will be restored (activated) after focus is regained. + /// Get the restoration status, which controls if the keyboard is restored after the focus lost then regained.
+ /// If true then keyboard will be restored (activated) after focus is regained. ///
- /// The restoration status. + /// Restoration status. public bool RestoreAfterFocusLost() { bool ret = NDalicManualPINVOKE.ImfManager_RestoreAfterFocusLost(swigCPtr); @@ -677,9 +520,9 @@ namespace Tizen.NUI } /// - /// Sets the status whether the IMF has to restore the keyboard after losing focus. + /// Set status whether the IMF has to restore the keyboard after losing focus. /// - /// True means that keyboard should be restored after the focus is lost and regained. + /// True means that keyboard should be restored after focus lost and regained. public void SetRestoreAfterFocusLost(bool toggle) { NDalicManualPINVOKE.ImfManager_SetRestoreAfterFocusLost(swigCPtr, toggle); @@ -687,7 +530,7 @@ namespace Tizen.NUI } /// - /// Sends a message reset to the preedit state or the IMF module. + /// Send message reset the pred-edit state / imf module. /// public new void Reset() { @@ -696,7 +539,7 @@ namespace Tizen.NUI } /// - /// Notifies the IMF context that the cursor position has changed, required for features like auto-capitalization. + /// Notifies IMF context that the cursor position has changed, required for features like auto-capitalisation. /// public void NotifyCursorPosition() { @@ -705,9 +548,9 @@ namespace Tizen.NUI } /// - /// Sets the cursor position stored in VirtualKeyboard, this is required by the IMF context. + /// Sets cursor position stored in VirtualKeyboard, this is required by the IMF context. /// - /// The position of the cursor. + /// Position of cursor. public void SetCursorPosition(uint cursorPosition) { NDalicManualPINVOKE.ImfManager_SetCursorPosition(swigCPtr, cursorPosition); @@ -715,9 +558,9 @@ namespace Tizen.NUI } /// - /// Gets the cursor position stored in VirtualKeyboard, this is required by the IMF context. + /// Gets cursor position stored in VirtualKeyboard, this is required by the IMF context. /// - /// The current position of the cursor. + /// Current position of cursor public uint GetCursorPosition() { uint ret = NDalicManualPINVOKE.ImfManager_GetCursorPosition(swigCPtr); @@ -726,7 +569,7 @@ namespace Tizen.NUI } /// - /// A method to store the string required by the IMF, this is used to provide predictive word suggestions. + /// Method to store the string required by the IMF, this is used to provide predictive word suggestions. /// /// The text string surrounding the current cursor point. public void SetSurroundingText(string text) @@ -736,9 +579,9 @@ namespace Tizen.NUI } /// - /// Gets the current text string set within the IMF manager, this is used to offer predictive suggestions. + /// Gets current text string set within the IMF manager, this is used to offer predictive suggestions. /// - /// The surrounding text. + /// Surrounding text. public string GetSurroundingText() { string ret = NDalicManualPINVOKE.ImfManager_GetSurroundingText(swigCPtr); @@ -747,7 +590,7 @@ namespace Tizen.NUI } /// - /// Notifies the IMF context that text input is set to multiline or not. + /// Notifies IMF context that text input is set to multi line or not. /// /// True if multiline text input is used. public void NotifyTextInputMultiLine(bool multiLine) @@ -757,7 +600,7 @@ namespace Tizen.NUI } /// - /// Returns the text direction of the keyboard's current input language. + /// Returns text direction of the keyboard's current input language. /// /// The direction of the text. public ImfManager.TextDirection GetTextDirection() @@ -768,13 +611,13 @@ namespace Tizen.NUI } /// - /// Provides the size and the position of the keyboard.
- /// The position is relative to whether the keyboard is visible or not.
- /// If the keyboard is not visible, then the position will be off the screen.
- /// If the keyboard is not being shown when this method is called, the keyboard is partially setup (IMFContext) to get/> - /// the values then taken down. So ideally, GetInputMethodArea() should be called after Show(). + /// Provides size and position of keyboard.
+ /// Position is relative to whether keyboard is visible or not.
+ /// If keyboard is not visible then position will be off the screen.
+ /// If keyboard is not being shown when this method is called the keyboard is partially setup (IMFContext) to get
+ /// the values then taken down. So ideally GetInputMethodArea() should be called after Show(). ///
- /// Rectangle which is keyboard panel x, y, width, height. + /// Rectangle which is keyboard panel x, y, width, height public Rectangle GetInputMethodArea() { Rectangle ret = new Rectangle(NDalicManualPINVOKE.ImfManager_GetInputMethodArea(swigCPtr), true); @@ -801,7 +644,7 @@ namespace Tizen.NUI /// /// Gets the specific data of the current active input panel. /// - /// The specific data to be received from the input panel. + /// The specific data to be got from the input panel. public void GetInputPanelUserData(out string text) { NDalicManualPINVOKE.ImfManager_GetInputPanelUserData(swigCPtr, out text); @@ -823,7 +666,7 @@ namespace Tizen.NUI /// Sets the return key on the input panel to be visible or invisible.
/// The default is true. ///
- /// True if the return key is visible (enabled), false otherwise. + /// True if the return key is visible(enabled), false otherwise. public void SetReturnKeyState(bool visible) { NDalicManualPINVOKE.ImfManager_SetReturnKeyState(swigCPtr, visible); @@ -831,7 +674,7 @@ namespace Tizen.NUI } /// - /// Enables to show the input panel automatically when focused. + /// Enable to show the input panel automatically when focused. /// /// If true, the input panel will be shown when focused. public void AutoEnableInputPanel(bool enabled) @@ -862,7 +705,7 @@ namespace Tizen.NUI /// Gets the keyboard type.
/// The default keyboard type is SoftwareKeyboard. ///
- /// The keyboard type. + /// The keyboard type public ImfManager.KeyboardType GetKeyboardType() { ImfManager.KeyboardType ret = (ImfManager.KeyboardType)NDalicManualPINVOKE.ImfManager_GetKeyboardType(swigCPtr); @@ -872,7 +715,7 @@ namespace Tizen.NUI /// /// Gets the current language locale of the input panel.
- /// For example, en_US, en_GB, en_PH, fr_FR, ... + /// Ex) en_US, en_GB, en_PH, fr_FR, ... ///
/// The current language locale of the input panel. public string GetInputPanelLocale() @@ -883,17 +726,23 @@ namespace Tizen.NUI } /// - /// The constructor. + /// Constructor /// public ImfManager() : this(NDalicManualPINVOKE.new_ImfManager(), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } + internal static ImfManager GetImfManagerFromPtr(global::System.IntPtr cPtr) + { + ImfManager ret = new ImfManager(cPtr, false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + /// /// ImfManager activated event arguments. /// - [Obsolete("Please do not use! this will be deprecated")] public class ImfManagerActivatedEventArgs : EventArgs { public ImfManager ImfManager @@ -906,12 +755,12 @@ namespace Tizen.NUI [UnmanagedFunctionPointer(CallingConvention.StdCall)] private delegate void ImfManagerActivatedEventCallbackType(global::System.IntPtr data); private ImfManagerActivatedEventCallbackType _imfManagerActivatedEventCallback; + private event EventHandler _imfManagerActivatedEventHandler; /// - /// ImfManager activated event. + /// ImfManager activated. /// - [Obsolete("Please do not use! this will be deprecated")] public event EventHandler ImfManagerActivated { add @@ -939,10 +788,7 @@ namespace Tizen.NUI { ImfManagerActivatedEventArgs e = new ImfManagerActivatedEventArgs(); - if (data != null) - { - e.ImfManager = Registry.GetManagedBaseHandleFromNativePtr(data) as ImfManager; - } + e.ImfManager = ImfManager.GetImfManagerFromPtr(data); if (_imfManagerActivatedEventHandler != null) { @@ -950,69 +796,7 @@ namespace Tizen.NUI } } - /// - /// ImfManager activated event arguments. - /// - public class ActivatedEventArgs : EventArgs - { - public ImfManager ImfManager - { - get; - set; - } - } - - [UnmanagedFunctionPointer(CallingConvention.StdCall)] - private delegate void ActivatedEventCallbackType(IntPtr data); - private ActivatedEventCallbackType _activatedEventCallback; - private event EventHandler _activatedEventHandler; - - /// - /// ImfManager activated. - /// - public event EventHandler Activated - { - add - { - if (_activatedEventHandler == null) - { - _activatedEventCallback = OnActivated; - ActivatedSignal().Connect(_activatedEventCallback); - } - - _activatedEventHandler += value; - } - remove - { - _activatedEventHandler -= value; - - if (_activatedEventHandler == null && _activatedEventCallback != null) - { - ActivatedSignal().Disconnect(_activatedEventCallback); - } - } - } - - private void OnActivated(IntPtr data) - { - ActivatedEventArgs e = new ActivatedEventArgs(); - - if (data != null) - { - e.ImfManager = Registry.GetManagedBaseHandleFromNativePtr(data) as ImfManager; - } - - if (_activatedEventHandler != null) - { - _activatedEventHandler(this, e); - } - } - - /// - /// ImfManager activated signal. - /// - [Obsolete("Please do not use! this will be internal")] - public ActivatedSignalType ActivatedSignal() + internal ActivatedSignalType ActivatedSignal() { ActivatedSignalType ret = new ActivatedSignalType(NDalicManualPINVOKE.ImfManager_ActivatedSignal(swigCPtr), false); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -1022,7 +806,6 @@ namespace Tizen.NUI /// /// ImfManager event received event arguments. /// - [Obsolete("Please do not use! this will be deprecated")] public class ImfManagerEventReceivedEventArgs : EventArgs { public ImfManager ImfManager @@ -1030,17 +813,22 @@ namespace Tizen.NUI get; set; } + + public ImfEventData ImfEventData + { + get; + set; + } } - private delegate void ImfManagerEventReceivedEventCallbackType(global::System.IntPtr data); + private delegate ImfCallbackData ImfManagerEventReceivedEventCallbackType(global::System.IntPtr imfManager, global::System.IntPtr imfEventData); private ImfManagerEventReceivedEventCallbackType _imfManagerEventReceivedEventCallback; - private event EventHandler _imfManagerEventReceivedEventHandler; + private event EventHandlerWithReturnType _imfManagerEventReceivedEventHandler; /// /// ImfManager event received. /// - [Obsolete("Please do not use! this will be deprecated")] - public event EventHandler ImfManagerEventReceived + public event EventHandlerWithReturnType ImfManagerEventReceived { add { @@ -1063,103 +851,21 @@ namespace Tizen.NUI } } - private void OnImfManagerEventReceived(global::System.IntPtr data) + private ImfCallbackData OnImfManagerEventReceived(global::System.IntPtr imfManager, global::System.IntPtr imfEventData) { ImfManagerEventReceivedEventArgs e = new ImfManagerEventReceivedEventArgs(); - if (data != null) - { - e.ImfManager = Registry.GetManagedBaseHandleFromNativePtr(data) as ImfManager; - } + e.ImfManager = ImfManager.GetImfManagerFromPtr(imfManager); + e.ImfEventData = ImfEventData.GetImfEventDataFromPtr(imfEventData); if (_imfManagerEventReceivedEventHandler != null) { - _imfManagerEventReceivedEventHandler(this, e); - } - } - - /// - /// ImfManager event received event arguments. - /// - public class EventReceivedEventArgs : EventArgs - { - public ImfManager ImfManager - { - get; - set; - } - - public ImfEventData ImfEventData - { - get; - set; - } - } - - private delegate IntPtr EventReceivedEventCallbackType(IntPtr imfManager, IntPtr imfEventData); - private EventReceivedEventCallbackType _eventReceivedEventCallback; - private event EventHandlerWithReturnType _eventReceivedEventHandler; - - /// - /// ImfManager event received. - /// - public event EventHandlerWithReturnType EventReceived - { - add - { - if (_eventReceivedEventHandler == null) - { - _eventReceivedEventCallback = OnEventReceived; - EventReceivedSignal().Connect(_eventReceivedEventCallback); - } - - _eventReceivedEventHandler += value; - } - remove - { - _eventReceivedEventHandler -= value; - - if (_eventReceivedEventHandler == null && _eventReceivedEventCallback != null) - { - EventReceivedSignal().Disconnect(_eventReceivedEventCallback); - } - } - } - - private IntPtr OnEventReceived(IntPtr imfManager, IntPtr imfEventData) - { - ImfCallbackData imfCallbackData = null; - - EventReceivedEventArgs e = new EventReceivedEventArgs(); - - if (imfManager != null) - { - e.ImfManager = Registry.GetManagedBaseHandleFromNativePtr(imfManager) as ImfManager; - } - if (imfEventData != null) - { - e.ImfEventData = ImfEventData.GetImfEventDataFromPtr(imfEventData); - } - - if (_eventReceivedEventHandler != null) - { - imfCallbackData = _eventReceivedEventHandler(this, e); - } - if (imfCallbackData != null) - { - return imfCallbackData.GetImfCallbackDataPtr(); - } - else - { - return new ImfCallbackData().GetImfCallbackDataPtr(); + return _imfManagerEventReceivedEventHandler(this, e); } + return null; } - /// - /// ImfManager event received signal. - /// - [Obsolete("Please do not use! this will be internal")] - public ImfEventSignalType EventReceivedSignal() + internal ImfEventSignalType EventReceivedSignal() { ImfEventSignalType ret = new ImfEventSignalType(NDalicManualPINVOKE.ImfManager_EventReceivedSignal(swigCPtr), false); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -1169,24 +875,22 @@ namespace Tizen.NUI /// /// ImfManager status changed event arguments. /// - [Obsolete("Please do not use! this will be deprecated")] public class ImfManagerStatusChangedEventArgs : EventArgs { - public ImfManager ImfManager + public bool StatusChanged { get; set; } } - private delegate void ImfManagerStatusChangedEventCallbackType(global::System.IntPtr data); + private delegate void ImfManagerStatusChangedEventCallbackType(bool statusChanged); private ImfManagerStatusChangedEventCallbackType _imfManagerStatusChangedEventCallback; - private event EventHandler _imfManagerStatusChangedEventHandler; + private event EventHandler _imfManagerStatusChangedEventHandler; /// /// ImfManager status changed. /// - [Obsolete("Please do not use! this will be deprecated")] public event EventHandler ImfManagerStatusChanged { add @@ -1210,14 +914,11 @@ namespace Tizen.NUI } } - private void OnImfManagerStatusChanged(global::System.IntPtr data) + private void OnImfManagerStatusChanged(bool statusChanged) { ImfManagerStatusChangedEventArgs e = new ImfManagerStatusChangedEventArgs(); - if (data != null) - { - e.ImfManager = Registry.GetManagedBaseHandleFromNativePtr(data) as ImfManager; - } + e.StatusChanged = statusChanged; if (_imfManagerStatusChangedEventHandler != null) { @@ -1225,93 +926,21 @@ namespace Tizen.NUI } } - /// - /// ImfManager status changed event arguments. - /// - public class StatusChangedEventArgs : EventArgs - { - public bool StatusChanged - { - get; - set; - } - } - - private delegate void StatusChangedEventCallbackType(bool statusChanged); - private StatusChangedEventCallbackType _statusChangedEventCallback; - private event EventHandler _statusChangedEventHandler; - - /// - /// ImfManager status changed. - /// - public event EventHandler StatusChanged - { - add - { - if (_statusChangedEventHandler == null) - { - _statusChangedEventCallback = OnStatusChanged; - StatusChangedSignal().Connect(_statusChangedEventCallback); - } - - _statusChangedEventHandler += value; - } - remove - { - _statusChangedEventHandler -= value; - - if (_statusChangedEventHandler == null && _statusChangedEventCallback != null) - { - StatusChangedSignal().Disconnect(_statusChangedEventCallback); - } - } - } - - private void OnStatusChanged(bool statusChanged) - { - StatusChangedEventArgs e = new StatusChangedEventArgs(); - - e.StatusChanged = statusChanged; - - if (_statusChangedEventHandler != null) - { - _statusChangedEventHandler(this, e); - } - } - - /// - /// ImfManager status changed signal. - /// - [Obsolete("Please do not use! this will be internal")] - public StatusSignalType StatusChangedSignal() + internal StatusSignalType StatusChangedSignal() { StatusSignalType ret = new StatusSignalType(NDalicManualPINVOKE.ImfManager_StatusChangedSignal(swigCPtr), false); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } - /// - /// ImfManager resized event arguments. - /// - [Obsolete("Please do not use! this will be deprecated")] - public class ImfManagerResizedEventArgs : EventArgs - { - public ImfManager ImfManager - { - get; - set; - } - } - - private delegate void ImfManagerResizedEventCallbackType(IntPtr data); + private delegate void ImfManagerResizedEventCallbackType(); private ImfManagerResizedEventCallbackType _imfManagerResizedEventCallback; - private event EventHandler _imfManagerResizedEventHandler; + private event EventHandler _imfManagerResizedEventHandler; /// - /// ImfManager resized event. + /// ImfManager resized. /// - [Obsolete("Please do not use! this will be deprecated")] - public event EventHandler ImfManagerResized + public event EventHandler ImfManagerResized { add { @@ -1334,92 +963,29 @@ namespace Tizen.NUI } } - private void OnImfManagerResized(IntPtr data) + private void OnImfManagerResized() { - ImfManagerResizedEventArgs e = new ImfManagerResizedEventArgs(); - - if (data != null) - { - e.ImfManager = Registry.GetManagedBaseHandleFromNativePtr(data) as ImfManager; - } - if (_imfManagerResizedEventHandler != null) { - _imfManagerResizedEventHandler(this, e); + _imfManagerResizedEventHandler(this, null); } } - private delegate void ResizedEventCallbackType(); - private ResizedEventCallbackType _resizedEventCallback; - private event EventHandler _resizedEventHandler; - - /// - /// ImfManager resized. - /// - public event EventHandler Resized + internal ImfVoidSignalType ResizedSignal() { - add - { - if (_resizedEventHandler == null) - { - _resizedEventCallback = OnResized; - ResizedSignal().Connect(_resizedEventCallback); - } - - _resizedEventHandler += value; - } - remove - { - _resizedEventHandler -= value; - - if (_resizedEventHandler == null && _resizedEventCallback != null) - { - ResizedSignal().Disconnect(_resizedEventCallback); - } - } - } - - private void OnResized() - { - if (_resizedEventHandler != null) - { - _resizedEventHandler(this, null); - } - } - - /// - /// ImfManager resized signal. - /// - [Obsolete("Please do not use! this will be internal")] - public ImfVoidSignalType ResizedSignal() - { - ImfVoidSignalType ret = new ImfVoidSignalType(NDalicManualPINVOKE.ImfManager_ResizedSignal(swigCPtr), false); + ImfVoidSignalType ret = new ImfVoidSignalType(NDalicManualPINVOKE.ImfManager_ResizedSignal(swigCPtr), true); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } - /// - /// ImfManager language changed event arguments. - /// - [Obsolete("Please do not use! this will be deprecated")] - public class ImfManagerLanguageChangedEventArgs : EventArgs - { - public ImfManager ImfManager - { - get; - set; - } - } - - private delegate void ImfManagerLanguageChangedEventCallbackType(IntPtr data); + private delegate void ImfManagerLanguageChangedEventCallbackType(); private ImfManagerLanguageChangedEventCallbackType _imfManagerLanguageChangedEventCallback; - private event EventHandler _imfManagerLanguageChangedEventHandler; + private event EventHandler _imfManagerLanguageChangedEventHandler; /// - /// ImfManager language changed event. + /// ImfManager language changed. /// - [Obsolete("Please do not use! this will be deprecated")] - public event EventHandler ImfManagerLanguageChanged + public event EventHandler ImfManagerLanguageChanged { add { @@ -1442,66 +1008,17 @@ namespace Tizen.NUI } } - private void OnImfManagerLanguageChanged(IntPtr data) + private void OnImfManagerLanguageChanged() { - ImfManagerLanguageChangedEventArgs e = new ImfManagerLanguageChangedEventArgs(); - - if (data != null) - { - e.ImfManager = Registry.GetManagedBaseHandleFromNativePtr(data) as ImfManager; - } - if (_imfManagerLanguageChangedEventHandler != null) { - _imfManagerLanguageChangedEventHandler(this, e); - } - } - - private delegate void LanguageChangedEventCallbackType(); - private LanguageChangedEventCallbackType _languageChangedEventCallback; - private event EventHandler _languageChangedEventHandler; - - /// - /// ImfManager language changed. - /// - public event EventHandler LanguageChanged - { - add - { - if (_languageChangedEventHandler == null) - { - _languageChangedEventCallback = OnLanguageChanged; - LanguageChangedSignal().Connect(_languageChangedEventCallback); - } - - _languageChangedEventHandler += value; - } - remove - { - _languageChangedEventHandler -= value; - - if (_languageChangedEventHandler == null && _languageChangedEventCallback != null) - { - LanguageChangedSignal().Disconnect(_languageChangedEventCallback); - } + _imfManagerLanguageChangedEventHandler(this, null); } } - private void OnLanguageChanged() - { - if (_languageChangedEventHandler != null) - { - _languageChangedEventHandler(this, null); - } - } - - /// - /// ImfManager language changed signal. - /// - [Obsolete("Please do not use! this will be internal")] - public ImfVoidSignalType LanguageChangedSignal() + internal ImfVoidSignalType LanguageChangedSignal() { - ImfVoidSignalType ret = new ImfVoidSignalType(NDalicManualPINVOKE.ImfManager_LanguageChangedSignal(swigCPtr), false); + ImfVoidSignalType ret = new ImfVoidSignalType(NDalicManualPINVOKE.ImfManager_LanguageChangedSignal(swigCPtr), true); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } @@ -1509,7 +1026,7 @@ namespace Tizen.NUI /// /// ImfManager keyboard type changed event arguments. /// - public class KeyboardTypeChangedEventArgs : EventArgs + public class ImfKeyboardTypeChangedEventArgs : EventArgs { public KeyboardType KeyboardType { @@ -1518,45 +1035,45 @@ namespace Tizen.NUI } } - private delegate void KeyboardTypeChangedEventCallbackType(KeyboardType type); - private KeyboardTypeChangedEventCallbackType _keyboardTypeChangedEventCallback; - private event EventHandler _keyboardTypeChangedEventHandler; + private delegate void ImfKeyboardTypeChangedEventCallbackType(KeyboardType type); + private ImfKeyboardTypeChangedEventCallbackType _imfKeyboardTypeChangedEventCallback; + private event EventHandler _imfKeyboardTypeChangedEventHandler; /// /// ImfManager keyboard type changed. /// - public event EventHandler KeyboardTypeChanged + public event EventHandler ImfKeyboardTypeChanged { add { - if (_keyboardTypeChangedEventHandler == null) + if (_imfKeyboardTypeChangedEventHandler == null) { - _keyboardTypeChangedEventCallback = OnKeyboardTypeChanged; - KeyboardTypeChangedSignal().Connect(_keyboardTypeChangedEventCallback); + _imfKeyboardTypeChangedEventCallback = OnImfKeyboardTypeChanged; + KeyboardTypeChangedSignal().Connect(_imfKeyboardTypeChangedEventCallback); } - _keyboardTypeChangedEventHandler += value; + _imfKeyboardTypeChangedEventHandler += value; } remove { - _keyboardTypeChangedEventHandler -= value; + _imfKeyboardTypeChangedEventHandler -= value; - if (_keyboardTypeChangedEventHandler == null && _keyboardTypeChangedEventCallback != null) + if (_imfKeyboardTypeChangedEventHandler == null && _imfKeyboardTypeChangedEventCallback != null) { - KeyboardTypeChangedSignal().Disconnect(_keyboardTypeChangedEventCallback); + KeyboardTypeChangedSignal().Disconnect(_imfKeyboardTypeChangedEventCallback); } } } - private void OnKeyboardTypeChanged(KeyboardType type) + private void OnImfKeyboardTypeChanged(KeyboardType type) { - KeyboardTypeChangedEventArgs e = new KeyboardTypeChangedEventArgs(); + ImfKeyboardTypeChangedEventArgs e = new ImfKeyboardTypeChangedEventArgs(); e.KeyboardType = type; - if (_keyboardTypeChangedEventHandler != null) + if (_imfKeyboardTypeChangedEventHandler != null) { - _keyboardTypeChangedEventHandler(this, e); + _imfKeyboardTypeChangedEventHandler(this, e); } } @@ -1568,7 +1085,7 @@ namespace Tizen.NUI } /// - /// The direction of the text. + /// The direction of text. /// public enum TextDirection { @@ -1600,11 +1117,11 @@ namespace Tizen.NUI ///
Commit, /// - /// An event to delete a range of characters from the string. + /// Event to delete a range of characters from the string. /// DeleteSurrounding, /// - /// An event to query string and the cursor position. + /// Event to query string and cursor position. /// GetSurrounding, /// @@ -1614,7 +1131,7 @@ namespace Tizen.NUI } /// - /// Enumeration for the state of the input panel. + /// Enumeration for state of the input panel. /// public enum State { @@ -1637,12 +1154,12 @@ namespace Tizen.NUI } /// - /// Enumeration for the types of keyboard. + /// Enumeration for the type of Keyboard. /// public enum KeyboardType { /// - /// Software keyboard (virtual keyboard) is default. + /// Software keyboard (Virtual keyboard) is default. /// SoftwareKeyboard, /// diff --git a/src/Tizen.NUI/src/public/InputMethod.cs b/src/Tizen.NUI/src/public/InputMethod.cs index ee7fe8622..c8aa42c52 100755 --- a/src/Tizen.NUI/src/public/InputMethod.cs +++ b/src/Tizen.NUI/src/public/InputMethod.cs @@ -27,14 +27,14 @@ namespace Tizen.NUI private int? _variation = null; /// - /// The default constructor. + /// Default constructor. /// public InputMethod() { } /// - /// Gets or sets the panel layout. + /// Get or set panel layout. /// public PanelLayoutType PanelLayout { @@ -49,7 +49,7 @@ namespace Tizen.NUI } /// - /// Gets or sets the action button. + /// Get or set action button. /// public ActionButtonTitleType ActionButton { @@ -64,7 +64,7 @@ namespace Tizen.NUI } /// - /// Gets or sets the auto capital. + /// Get or set auto capital. /// public AutoCapitalType AutoCapital { @@ -79,7 +79,7 @@ namespace Tizen.NUI } /// - /// Gets or sets the variation. + /// Get or set variation. /// public int Variation { @@ -94,7 +94,7 @@ namespace Tizen.NUI } /// - /// Gets or sets the variation for normal layout. + /// Get or set variation for normal layout. /// public NormalLayoutType NormalVariation { @@ -109,7 +109,7 @@ namespace Tizen.NUI } /// - /// Gets or sets the variation for the number only layout. + /// Get or set variation for number only layout. /// public NumberOnlyLayoutType NumberOnlyVariation { @@ -124,7 +124,7 @@ namespace Tizen.NUI } /// - /// Gets or sets the variation for the password layout. + /// Get or set variation for password layout. /// public PasswordLayoutType PasswordVariation { @@ -149,7 +149,7 @@ namespace Tizen.NUI } /// - /// Gets the input method map. + /// Get the input method map. /// public PropertyMap OutputMap { @@ -160,24 +160,24 @@ namespace Tizen.NUI } /// - /// SetType that can be changed in the system input method. + /// SetType that can be changed in the system Input Method. /// public enum CategoryType { /// - /// Set the keyboard layout. + /// Set Keyboard layout. /// PanelLayout, /// - /// Set the action button title. + /// Set Action button title. /// ActionButtonTitle, /// - /// Set the auto capitalise of input. + /// Set Auto capitalise of input. /// AutoCapitalise, /// - /// Set the variation. + /// Set variation. /// Variation } @@ -247,7 +247,7 @@ namespace Tizen.NUI /// HEX, /// - /// Command-line terminal layout including Esc, Alt, Ctrl key, and so on (no auto-correct, no auto-capitalization). + /// Command-line terminal layout including ESC, Alt, Ctrl key, so on (no auto-correct, no auto-capitalization). /// Terminal, /// @@ -320,7 +320,7 @@ namespace Tizen.NUI } /// - /// Available variation for the normal layout. + /// Available variation for Normal layout. /// public enum NormalLayoutType { @@ -339,7 +339,7 @@ namespace Tizen.NUI } /// - /// Available variation for the number only layout. + /// Available variation for Number only layout. /// public enum NumberOnlyLayoutType { @@ -362,7 +362,7 @@ namespace Tizen.NUI } /// - /// Available variation for the password layout. + /// Available variation for Password layout. /// public enum PasswordLayoutType { diff --git a/src/Tizen.NUI/src/public/Key.cs b/src/Tizen.NUI/src/public/Key.cs index b3e212cfb..650a77646 100755 --- a/src/Tizen.NUI/src/public/Key.cs +++ b/src/Tizen.NUI/src/public/Key.cs @@ -118,7 +118,7 @@ namespace Tizen.NUI } /// - /// Name given to the key pressed. + /// Name given to the key pressed /// public string KeyPressedName { @@ -126,10 +126,6 @@ namespace Tizen.NUI { return keyPressedName; } - set - { - keyPressedName = value; - } } /* duplicated with KeyPressedName : removed @@ -151,14 +147,10 @@ namespace Tizen.NUI { return keyCode; } - set - { - keyCode = value; - } } /// - /// Special keys like Shift, Alt, and Ctrl which modify the next key pressed. + /// Special keys like shift, alt and control which modify the next key pressed. /// public int KeyModifier { @@ -166,10 +158,6 @@ namespace Tizen.NUI { return keyModifier; } - set - { - keyModifier = value; - } } /// @@ -181,10 +169,6 @@ namespace Tizen.NUI { return time; } - set - { - time = value; - } } /// @@ -196,10 +180,6 @@ namespace Tizen.NUI { return state; } - set - { - state = value; - } } public DeviceClassType DeviceClass @@ -214,7 +194,7 @@ namespace Tizen.NUI /// - /// The default constructor. + /// Default Constructor. /// public Key() : this(NDalicPINVOKE.new_Key__SWIG_0(), true) { @@ -222,23 +202,23 @@ namespace Tizen.NUI } /// - /// The constructor. + /// Constructor. /// - /// The name of the key pressed or command from the IMF, if later, then the following parameters will be needed. - /// A string of input characters or key pressed. - /// The unique key code for the key pressed. - /// The key modifier for special keys like Shift and Alt. - /// The time (in ms) that the key event occurred. - /// The state of the key event. + /// The name of the key pressed or command from the IMF, if later then the some following parameters will be needed + /// A string of input characters or key pressed + /// The unique key code for the key pressed + /// The key modifier for special keys like shift and alt + /// The time (in ms) that the key event occurred + /// The state of the key event internal Key(string keyName, string keyString, int keyCode, int keyModifier, uint timeStamp, Key.StateType keyState) : this(NDalicPINVOKE.new_Key__SWIG_1(keyName, keyString, keyCode, keyModifier, timeStamp, (int)keyState), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } /// - /// Checks to see if the Shift key modifier has been supplied. + /// Checks to see if Shift key modifier has been supplied. /// - /// True if Shift modifier. + /// True if shift modifier public bool IsShiftModifier() { bool ret = NDalicPINVOKE.Key_IsShiftModifier(swigCPtr); @@ -249,7 +229,7 @@ namespace Tizen.NUI /// /// Checks to see if Ctrl (control) key modifier has been supplied. /// - /// True if Ctrl modifier. + /// True if ctrl modifier public bool IsCtrlModifier() { bool ret = NDalicPINVOKE.Key_IsCtrlModifier(swigCPtr); @@ -260,7 +240,7 @@ namespace Tizen.NUI /// /// Checks to see if Alt key modifier has been supplied. /// - /// True if Alt modifier. + /// True if alt modifier public bool IsAltModifier() { bool ret = NDalicPINVOKE.Key_IsAltModifier(swigCPtr); diff --git a/src/Tizen.NUI/src/public/KeyFrames.cs b/src/Tizen.NUI/src/public/KeyFrames.cs index 39d86ef71..92abafbe7 100755 --- a/src/Tizen.NUI/src/public/KeyFrames.cs +++ b/src/Tizen.NUI/src/public/KeyFrames.cs @@ -20,7 +20,7 @@ namespace Tizen.NUI { /// - /// A set of key frames for a property that can be animated using DALi animation.
+ /// A set of key frames for a property that can be animated using Dali Animation.
/// This allows the generation of key frame objects from individual Property::Values.
///
public class KeyFrames : BaseHandle @@ -73,8 +73,8 @@ namespace Tizen.NUI /// /// Adds a key frame. /// - /// A progress value between 0.0 and 1.0. - /// A value. + /// A progress value between 0.0 and 1.0 + /// A value public void Add(float progress, object value) { PropertyValue val = PropertyValue.CreateFromObject(value); @@ -84,9 +84,9 @@ namespace Tizen.NUI /// /// Adds a key frame. /// - /// A progress value between 0.0 and 1.0. + /// A progress value between 0.0 and 1.0 /// A value - /// The alpha function used to blend to the next keyframe. + /// The alpha function used to blend to the next keyframe public void Add(float progress, object value, AlphaFunction alpha) { PropertyValue val = PropertyValue.CreateFromObject(value); @@ -114,7 +114,7 @@ namespace Tizen.NUI /// Gets the type of the key frame. ///
/// The key frame property type - public new PropertyType GetType() + public PropertyType GetType() { PropertyType ret = (PropertyType)NDalicPINVOKE.KeyFrames_GetType(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -124,8 +124,8 @@ namespace Tizen.NUI /// /// Adds a key frame. /// - /// A progress value between 0.0 and 1.0. - /// A value. + /// A progress value between 0.0 and 1.0 + /// A value public void Add(float progress, PropertyValue value) { NDalicPINVOKE.KeyFrames_Add__SWIG_0(swigCPtr, progress, PropertyValue.getCPtr(value)); @@ -135,9 +135,9 @@ namespace Tizen.NUI /// /// Adds a key frame. /// - /// A progress value between 0.0 and 1.0. - /// A value. - /// The alpha function used to blend to the next keyframe. + /// A progress value between 0.0 and 1.0 + /// A value + /// The alpha function used to blend to the next keyframe public void Add(float progress, PropertyValue value, AlphaFunction alpha) { NDalicPINVOKE.KeyFrames_Add__SWIG_1(swigCPtr, progress, PropertyValue.getCPtr(value), AlphaFunction.getCPtr(alpha)); diff --git a/src/Tizen.NUI/src/public/Layer.cs b/src/Tizen.NUI/src/public/Layer.cs index cc9dd2548..33583252d 100755 --- a/src/Tizen.NUI/src/public/Layer.cs +++ b/src/Tizen.NUI/src/public/Layer.cs @@ -36,7 +36,7 @@ namespace Tizen.NUI return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; } - /// From the Container base class. + /// from Container base class /// /// Adds a child view to this layer. @@ -48,10 +48,12 @@ namespace Tizen.NUI NDalicPINVOKE.Actor_Add(swigCPtr, View.getCPtr(child)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + + Children.Add(child); } /// - /// Removes a child view from this layer. If the view was not a child of this layer, this is a no-op. + /// Removes a child View from this layer. If the view was not a child of this layer, this is a no-op. /// /// /// @@ -60,24 +62,26 @@ namespace Tizen.NUI NDalicPINVOKE.Actor_Remove(swigCPtr, View.getCPtr(child)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + + Children.Remove(child); } /// - /// Retrieves a child view by the index. + /// Retrieves child view by index. /// - ///
The view has been initialized.
- /// The index of the child to retrieve. - /// The view for the given index or empty handle if children not initialized. + ///
The View has been initialized.
+ /// The index of the child to retrieve + /// The view for the given index or empty handle if children not initialized public override View GetChildAt(uint index) { - System.IntPtr cPtr = NDalicPINVOKE.Actor_GetChildAt(swigCPtr, index); - - View ret = Registry.GetManagedBaseHandleFromNativePtr(cPtr) as View; - - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - - return ret ?? null; + if (index < Children.Count) + { + return Children[Convert.ToInt32(index)]; + } + else + { + return null; + } } @@ -88,12 +92,11 @@ namespace Tizen.NUI protected override uint GetChildCount() { - uint ret = NDalicPINVOKE.Actor_GetChildCount(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; + return Convert.ToUInt32(Children.Count); } + /// + protected override void Dispose(DisposeTypes type) { if(disposed) @@ -123,6 +126,13 @@ namespace Tizen.NUI } base.Dispose(type); + + // Dispose all Children of this Layer. + foreach (View childView in Children) + { + childView?.Dispose(); + } + Children.Clear(); } @@ -159,7 +169,7 @@ namespace Tizen.NUI [Obsolete("Please do not use! this will be deprecated")] - public static Layer DownCast(BaseHandle handle) + public new static Layer DownCast(BaseHandle handle) { Layer ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as Layer; if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -167,11 +177,11 @@ namespace Tizen.NUI } /// - /// Search through this layer's hierarchy for a view with the given unique ID. + /// Search through this layer's hierarchy for an view with the given unique ID. /// - ///
This layer (the parent) has been initialized.
+ ///
This layer(the parent) has been initialized.
/// The actor itself is also considered in the search. - /// The id of the child to find + /// The id of the child to find /// A handle to the view if found, or an empty handle if not. public View FindChildById(uint id) { @@ -185,7 +195,7 @@ namespace Tizen.NUI /// /// Queries the depth of the layer.
- /// 0 is the bottommost layer, higher number is on the top.
+ /// 0 is the bottom most layer, higher number is on top.
///
public uint Depth { @@ -252,9 +262,9 @@ namespace Tizen.NUI /// /// Moves the layer directly above the given layer.
- /// After the call, this layer's depth will be immediately above target.
+ /// After the call, this layers depth will be immediately above target.
///
- /// The layer to get on top of. + /// Layer to get on top of public void MoveAbove(Layer target) { NDalicPINVOKE.Layer_MoveAbove(swigCPtr, Layer.getCPtr(target)); @@ -263,9 +273,9 @@ namespace Tizen.NUI /// /// Moves the layer directly below the given layer.
- /// After the call, this layer's depth will be immediately below target.
+ /// After the call, this layers depth will be immediately below target.
///
- /// The layer to get below of. + /// Layer to get below of public void MoveBelow(Layer target) { NDalicPINVOKE.Layer_MoveBelow(swigCPtr, Layer.getCPtr(target)); @@ -333,7 +343,7 @@ namespace Tizen.NUI } /// - /// Layer behavior, type String (Layer.LayerBehavior). + /// Layer Behavior, type String(Layer.LayerBehavior) /// public Layer.LayerBehavior Behavior { @@ -348,8 +358,8 @@ namespace Tizen.NUI } /// - /// Internal only property to enable or disable clipping, type boolean. - /// By default, this is false, i.e., the viewport of the layer is the entire window. + /// Internal only property to Enable/Disable Clipping, type Boolean. + /// By default this is false, i.e. the viewport of the Layer is the entire window. /// internal bool ClippingEnabled { @@ -367,7 +377,7 @@ namespace Tizen.NUI } /// - /// Sets the viewport (in window coordinates), type rectangle. + /// Sets the Viewport (in window coordinates), type Rectangle. /// The contents of the layer will not be visible outside this box, when ViewportEnabled is true. /// public Rectangle Viewport @@ -397,7 +407,7 @@ namespace Tizen.NUI } /// - /// Retrieves and sets the layer's opacity.
+ /// Retrieves and sets the Layer's opacity.
///
public float Opacity { @@ -414,7 +424,7 @@ namespace Tizen.NUI } /// - /// Retrieves and sets the layer's visibility. + /// Retrieves and sets the Layer's visibility. /// public bool Visibility { @@ -429,50 +439,5 @@ namespace Tizen.NUI SetProperty(View.Property.VISIBLE, new Tizen.NUI.PropertyValue(value)); } } - - /// - /// Get the number of children held by the layer. - /// - public uint ChildCount - { - get - { - uint ret = NDalicPINVOKE.Actor_GetChildCount(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - } - - /// - /// Gets or sets the layer's name. - /// - public string Name - { - get - { - return GetName(); - } - set - { - SetName(value); - } - } - - internal string GetName() - { - string ret = NDalicPINVOKE.Actor_GetName(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal void SetName(string name) - { - NDalicPINVOKE.Actor_SetName(swigCPtr, name); - if (NDalicPINVOKE.SWIGPendingException.Pending) - throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - } } diff --git a/src/Tizen.NUI/src/public/LongPressGesture.cs b/src/Tizen.NUI/src/public/LongPressGesture.cs index 5db76f65d..4eecc9227 100755 --- a/src/Tizen.NUI/src/public/LongPressGesture.cs +++ b/src/Tizen.NUI/src/public/LongPressGesture.cs @@ -18,8 +18,8 @@ namespace Tizen.NUI { /// - /// A long press gesture is emitted when the user holds the screen with the stated number of fingers.
- /// A long press gesture finishes when all touches have been released.
+ /// A LongPressGesture is emitted when the user holds the screen with the stated number of fingers.
+ /// Long press gesture finishes when all touches have been released.
///
public class LongPressGesture : Gesture { @@ -75,7 +75,7 @@ namespace Tizen.NUI } /// - /// The number of touch points in this long press gesture, i.e., the number of fingers the user had + /// The number of touch points in this long press gesture, i.e. the number of fingers the user had /// on the screen to generate the long press gesture.
///
public uint NumberOfTouches @@ -111,7 +111,7 @@ namespace Tizen.NUI } /// - /// The constructor. + /// Constructor. /// /// The state of the gesture public LongPressGesture(Gesture.StateType state) : this(NDalicPINVOKE.new_LongPressGesture__SWIG_0((int)state), true) diff --git a/src/Tizen.NUI/src/public/NUIApplication.cs b/src/Tizen.NUI/src/public/NUIApplication.cs index 6a4f19d13..a36fe87f5 100755 --- a/src/Tizen.NUI/src/public/NUIApplication.cs +++ b/src/Tizen.NUI/src/public/NUIApplication.cs @@ -24,7 +24,7 @@ namespace Tizen.NUI { /// - /// Represents an application that have a UI screen. The NUIApplication class has a default stage. + /// Represents an application that have UI screen. The NUIApplication class has a default stage. /// public class NUIApplication : CoreApplication { @@ -51,21 +51,21 @@ namespace Tizen.NUI } /// - /// The constructor with a stylesheet. + /// The constructor with stylesheet. /// public NUIApplication(string stylesheet) : base(new NUICoreBackend(stylesheet)) { } /// - /// The constructor with a stylesheet and window mode. + /// The constructor with stylesheet and window mode. /// public NUIApplication(string stylesheet, WindowMode windowMode) : base(new NUICoreBackend(stylesheet,windowMode)) { } /// - /// Overrides this method if you want to handle behavior. + /// Overrides this method if want to handle behavior. /// protected override void OnLocaleChanged(LocaleChangedEventArgs e) { @@ -74,7 +74,7 @@ namespace Tizen.NUI } /// - /// Overrides this method if you want to handle behavior. + /// Overrides this method if want to handle behavior. /// protected override void OnLowBattery(LowBatteryEventArgs e) { @@ -83,7 +83,7 @@ namespace Tizen.NUI } /// - /// Overrides this method if you want to handle behavior. + /// Overrides this method if want to handle behavior. /// protected override void OnLowMemory(LowMemoryEventArgs e) { @@ -92,7 +92,7 @@ namespace Tizen.NUI } /// - /// Overrides this method if you want to handle behavior. + /// Overrides this method if want to handle behavior. /// protected override void OnRegionFormatChanged(RegionFormatChangedEventArgs e) { @@ -101,7 +101,7 @@ namespace Tizen.NUI } /// - /// Overrides this method if you want to handle behavior. + /// Overrides this method if want to handle behavior. /// protected override void OnTerminate() { @@ -110,16 +110,16 @@ namespace Tizen.NUI } /// - /// Overrides this method if you want to handle behavior. + /// Overrides this method if want to handle behavior. /// - protected virtual void OnPause() + protected void OnPause() { Log.Debug("NUI", "OnPause() is called!"); Paused?.Invoke(this, EventArgs.Empty); } /// - /// Overrides this method if you want to handle behavior. + /// Overrides this method if want to handle behavior. /// protected virtual void OnResume() { @@ -128,7 +128,7 @@ namespace Tizen.NUI } /// - /// Overrides this method if you want to handle behavior. + /// Overrides this method if want to handle behavior. /// protected virtual void OnPreCreate() { @@ -136,7 +136,7 @@ namespace Tizen.NUI } /// - /// Overrides this method if you want to handle behavior. + /// Overrides this method if want to handle behavior. /// protected override void OnAppControlReceived(AppControlReceivedEventArgs e) { @@ -150,7 +150,7 @@ namespace Tizen.NUI } /// - /// Overrides this method if you want to handle behavior. + /// Overrides this method if want to handle behavior. /// protected override void OnCreate() { @@ -162,33 +162,43 @@ namespace Tizen.NUI } /// - /// Runs the NUIApplication. + /// Run NUIApplication. /// /// Arguments from commandline. public override void Run(string[] args) { - Backend.AddEventHandler(EventType.PreCreated, OnPreCreate); + string[] argsClone = null; + + if (args == null) + { + argsClone = new string[1]; + } + else + { + argsClone = new string[args.Length + 1]; + args.CopyTo(argsClone, 1); + } + argsClone[0] = string.Empty; + Backend.AddEventHandler(EventType.Resumed, OnResume); + Backend.AddEventHandler(EventType.AppControlReceived, OnAppControlReceived); Backend.AddEventHandler(EventType.Paused, OnPause); - base.Run(args); - } + Backend.AddEventHandler(EventType.Terminated, OnTerminate); + Backend.AddEventHandler(EventType.RegionFormatChanged, OnRegionFormatChanged); + Backend.AddEventHandler(EventType.LowMemory, OnLowMemory); + Backend.AddEventHandler(EventType.LowBattery, OnLowBattery); + Backend.AddEventHandler(EventType.LocaleChanged, OnLocaleChanged); + Backend.AddEventHandler(EventType.Created, OnCreate); - /// - /// Exits the NUIApplication. - /// - public override void Exit() - { - base.Exit(); + Backend.Run(argsClone); } /// - /// Ensures that the function passed in is called from the main loop when it is idle. + /// Exit NUIApplication. /// - /// The function to call - /// true if added successfully, false otherwise - public bool AddIdle(System.Delegate func) + public override void Exit() { - return ((NUICoreBackend)this.Backend).AddIdle(func); + Backend.Exit(); } /// @@ -199,41 +209,5 @@ namespace Tizen.NUI Opaque = 0, Transparent = 1 } - - - internal Application ApplicationHandle - { - get - { - return ((NUICoreBackend)this.Backend).ApplicationHandle; - } - } - - /// - /// ResourceManager to handle multilingual. - /// - public static System.Resources.ResourceManager MultilingualResourceManager - { - get - { - return resourceManager; - } - set - { - resourceManager = value; - } - } - - /// - /// Gets the window instance. - /// - [Obsolete("Please do not use! this will be deprecated")] - public Window Window - { - get - { - return Window.Instance; - } - } } } diff --git a/src/Tizen.NUI/src/public/NUIConstants.cs b/src/Tizen.NUI/src/public/NUIConstants.cs index 2d1c05a21..8a99cb306 100755 --- a/src/Tizen.NUI/src/public/NUIConstants.cs +++ b/src/Tizen.NUI/src/public/NUIConstants.cs @@ -28,7 +28,7 @@ namespace Tizen.NUI } /// - /// This specifies whether the actor uses its own color or inherits. + /// This specifies whether the Actor uses its own color, or inherits. /// public enum ColorMode { @@ -45,26 +45,26 @@ namespace Tizen.NUI /// UseOwnMultiplyParentColor, /// - /// Actor will blend its alpha with its parents alpha. This means when the parent fades in or out, the child does as well. This is the default. + /// Actor will blend its alpha with its parents alpha. This means when parent fades in or out child does as well. This is the default. /// UseOwnMultiplyParentAlpha } /// - /// This specifies the dimension of the width or the height for size negotiation. + /// This specifies the dimesion of width or heigh for size negotiation. /// public enum DimensionType { /// - /// Width dimension. + /// Width dimension /// Width = 0x1, /// - /// Height dimension. + /// Height dimension /// Height = 0x2, /// - /// Mask to cover all flags. + /// Mask to cover all flags /// AllDimensions = 0x3 } @@ -75,15 +75,15 @@ namespace Tizen.NUI public enum DrawModeType { /// - /// The default draw-mode. + /// The default draw-mode /// Normal = 0, /// - /// Draw the actor and its children as an overlay. + /// Draw the actor and its children as an overlay /// Overlay2D = 1, /// - /// Will be replaced by separate ClippingMode enum. Draw the actor and its children into the stencil buffer. + /// Will be replaced by separate ClippingMode enum. Draw the actor and its children into the stencil buffer /// Stencil = 3 } @@ -94,13 +94,13 @@ namespace Tizen.NUI public enum ResizePolicyType { /// - /// Size is fixed as set by SetSize. + /// Size is fixed as set by SetSize /// Fixed, /// - /// Size is to use the actor's natural size. + /// Size is to use the actor's natural size /// - /// + /// UseNaturalSize, /// /// Size is to fill up to the actor's parent's bounds. Aspect ratio is not maintained. @@ -115,15 +115,15 @@ namespace Tizen.NUI /// SizeFixedOffsetFromParent, /// - /// The size will adjust to wrap around all children. + /// Size will adjust to wrap around all children /// FitToChildren, /// - /// One dimension is dependent on the other. + /// One dimension is dependent on the other /// DimensionDependency, /// - /// The size will be assigned to the actor. + /// The size will be assigned to the actor /// UseAssignedSize } @@ -134,41 +134,45 @@ namespace Tizen.NUI public enum SizeScalePolicyType { /// - /// Use the size that was set. + /// Use the size that was set /// UseSizeSet, /// - /// Fit within the size set maintaining natural size aspect ratio. + /// Fit within the size set maintaining natural size aspect ratio /// FitWithAspectRatio, /// - /// Fit within the size set maintaining natural size aspect ratio. + /// Fit within the size set maintaining natural size aspect ratio /// FillWithAspectRatio } /// - /// Enumeration for the ClippingMode describing how this actor's children will be clipped against it. + /// Enumeration for ClippingMode describing how this Actor's children will be clipped against it. /// public enum ClippingModeType { /// - /// This actor will not clip its children. + /// This Actor will not clip its children. /// Disabled, /// - /// This actor will clip all children to within its boundaries (the actor will also be visible itself). + /// This Actor will clip all children to within its boundaries (the actor will also be visible itself). /// - ClipChildren + ClipChildren, + /// + /// This Actor will clip all children within a screen-aligned rectangle encompassing its boundaries (the actor will also be visible itself). + /// + ClipToBoundingBox } /// - /// Enumeration for type determination of how the camera operates. + /// Enumeration for type determination of how camera operates. /// public enum CameraType { /// - /// Camera orientation is taken from the CameraActor. + /// Camera orientation is taken from CameraActor. /// FreeLook, /// @@ -178,7 +182,7 @@ namespace Tizen.NUI } /// - /// Enumeration for the projection modes. + /// Enumeration for projection modes. /// public enum ProjectionMode { @@ -193,16 +197,16 @@ namespace Tizen.NUI } /// - /// This specifies customView behavior types. + /// This specifies ccustomView behaviour types. /// public enum CustomViewBehaviour { /// - /// Use to provide default behavior (size negotiation is on, event callbacks are not called). + /// Use to provide default behaviour (size negotiation is on, event callbacks are not called) /// ViewBehaviourDefault = 0, /// - /// True if the control does not need size negotiation, i.e., it can be skipped in the algorithm. + /// True if control does not need size negotiation, i.e. it can be skipped in the algorithm /// DisableSizeNegotiation = 1 << 0, /// @@ -230,95 +234,95 @@ namespace Tizen.NUI } /// - /// This specifies all the property types.
+ /// This specifies all the property types.
/// Enumeration for the property types supported. ///
public enum PropertyType { /// - /// No type. + /// No type /// None, /// - /// A boolean type. + /// A boolean type /// Boolean, /// - /// A float type. + /// A float type /// Float, /// - /// An integer type. + /// An integer type /// Integer, /// - /// A vector array of size=2 with float precision. + /// a vector array of size=2 with float precision /// Vector2, /// - /// A vector array of size=3 with float precision. + /// a vector array of size=3 with float precision /// Vector3, /// - /// A vector array of size=4 with float precision. + /// a vector array of size=4 with float precision /// Vector4, /// - /// A 3x3 matrix. + /// a 3x3 matrix /// Matrix3, /// - /// A 4x4 matrix. + /// a 4x4 matrix /// Matrix, /// - /// An integer array of size=4. + /// an integer array of size=4 /// Rectangle, /// - /// Either a quaternion or an axis angle rotation. + /// either a quaternion or an axis angle rotation /// Rotation, /// - /// A string type. + /// A string type /// String, /// - /// An array of PropertyValue. + /// an array of PropertyValue /// Array, /// - /// A string key to PropertyValue mapping. + /// a string key to PropertyValue mapping /// Map } /// - /// This specifies the property access mode types.
+ /// This specifies the property access mode types.
/// Enumeration for the access mode for custom properties. ///
public enum PropertyAccessMode { /// - /// If the property is read-only. + /// if the property is read-only /// ReadOnly, /// - /// If the property is read or writeable. + /// If the property is read/writeable /// ReadWrite, /// - /// If the property can be animated or constrained. + /// If the property can be animated or constrained /// Animatable, /// - /// The number of access modes. + /// The number of access modes /// AccessModeCount } /// - /// Types of style change. Enumeration for the StyleChange type. + /// Types of style change. Enumeration for StyleChange type. /// public enum StyleChangeType { @@ -342,15 +346,15 @@ namespace Tizen.NUI public enum HorizontalAlignmentType { /// - /// Align horizontally left. + /// Align horizontally left /// Left, /// - /// Align horizontally center. + /// Align horizontally center /// Center, /// - /// Align horizontally right. + /// Align horizontally right /// Right } @@ -361,15 +365,15 @@ namespace Tizen.NUI public enum VerticalAlignmentType { /// - /// Align vertically top. + /// Align vertically top /// Top, /// - /// Align vertically center. + /// Align vertically center /// Center, /// - /// Align vertically bottom. + /// Align vertically bottom /// Bottom } @@ -380,32 +384,32 @@ namespace Tizen.NUI public enum PointStateType { /// - /// Touch or hover started. + /// Touch or hover started /// Started, /// - /// Touch or hover finished. + /// Touch or hover finished /// Finished, /// - /// Screen touched. + /// Screen touched /// Down = Started, /// - /// Touch stopped. + /// Touch stopped /// Up = Finished, /// - /// Finger dragged or hovered. + /// Finger dragged or hovered /// Motion, /// - /// Leave the boundary of an actor. + /// Leave the boundary of an actor /// Leave, /// /// No change from last event.
- /// Useful when a multi-point event occurs where all points are sent, but indicates that this particular point has not changed since the last time. + /// Useful when a multi-point event occurs where all points are sent but indicates that this particular point has not changed since the last time. ///
Stationary, /// @@ -453,40 +457,76 @@ namespace Tizen.NUI } /// - /// This specifies wrap mode types.
+ /// This specifies wrap mode types
/// WrapModeU and WrapModeV separately decide how the texture should be sampled when the u and v coordinate exceeds the range of 0.0 to 1.0. ///
public enum WrapModeType { /// - /// The default value. + /// Defualt value /// Default = 0, /// - /// Clamp to edge. + /// Clamp to edge /// ClampToEdge, /// - /// Repeat. + /// Repeat /// Repeat, /// - /// Mirrored repeat. + /// Mirrored repeat /// MirroredRepeat } + /// + /// Specifies the Release Policy types
+ /// Decides if the image should be cached in different conditions + ///
+ public enum ReleasePolicyType + { + /// + /// Image is released when visual detached from scene + /// + Detached = 0, + /// + /// Image is only released when visual is destroyed + /// + Destroyed, + /// + /// Image is not released. + /// + Never + } + + /// + /// Specifies the Load Policy types
+ /// Decides when the image texture should be loaded + ///
+ public enum LoadPolicyType + { + /// + /// Load texture once the image source has been provided. Even if not being used yet. + /// + Immediate = 0, + /// + /// Only load texture once the visual is attached, when the image needs to be shown. + /// + Attached + } + /// /// The type of coordinate system for certain attributes of the points in a gradient. /// public enum GradientVisualUnitsType { /// - /// Uses the normals for the start, end, and center points, i.e., top-left is (-0.5, -0.5) and bottom-right is (0.5, 0.5). + /// Uses the normals for the start, end & center points, i.e. top-left is (-0.5, -0.5) and bottom-right is (0.5, 0.5). /// ObjectBoundingBox, /// - /// Uses the user coordinates for the start, end, and center points, i.e., in a 200 by 200 control, top-left is (0, 0) and bottom-right is (200, 200). + /// Uses the user coordinates for the start, end & center points, i.e. in a 200 by 200 control, top-left is (0, 0) and bottom-right is (200, 200). /// UserSpace } @@ -502,17 +542,17 @@ namespace Tizen.NUI ///
Pad, /// - /// Reflects the gradient pattern start-to-end, end-to-start, start-to-end, etc. until the quad is filled. + /// Reflect the gradient pattern start-to-end, end-to-start, start-to-end etc. until the quad is filled. /// Reflect, /// - /// Repeats the gradient pattern start-to-end, start-to-end, start-to-end, etc. until the quad is filled. + /// Repeat the gradient pattern start-to-end, start-to-end, start-to-end etc. until the quad is filled. /// Repeat } /// - /// The shading mode used by the mesh visual. + /// The shading mode used by MeshVisual. /// public enum MeshVisualShadingModeValue { @@ -525,30 +565,30 @@ namespace Tizen.NUI ///
TexturedWithSpecularLighting, /// - /// Uses all textures provided including gloss, normal, and texture map along with specular, ambient, and diffuse lighting. + /// Uses all textures provided including a gloss, normal and texture map along with specular, ambient and diffuse lighting. /// TexturedWithDetailedSpecularLighting } /// - /// The primitive shape to render as a primitive visual. + /// The primitive shape to render as a PrimitiveVisual. /// public enum PrimitiveVisualShapeType { /// - /// A perfectly round geometrical object in the three-dimensional space. + /// A perfectly round geometrical object in three-dimensional space. /// Sphere, /// - /// The area bound between two circles, i.e., a cone with the tip removed. + /// The area bound between two circles, i.e. a cone with the tip removed. /// ConicalFrustrum, /// - /// Equivalent to a conical frustrum with the top radius of zero. - /// Equivalent to a conical frustrum with the top radius of zero. + /// Equivalent to a conical frustrum with top radius of zero. + ///
Equivalent to a conical frustrum with top radius of zero. Cone, /// - /// Equivalent to a conical frustrum with the top radius of zero. + /// Equivalent to a conical frustrum with top radius of zero. /// Cylinder, /// @@ -573,33 +613,33 @@ namespace Tizen.NUI public enum FittingModeType { /// - /// Full-screen image display: Limit loaded image resolution to device resolution using the ShrinkToFit mode. + /// Full-screen image display: Limit loaded image resolution to device resolution using ShrinkToFit mode. /// ShrinkToFit, /// - /// Thumbnail gallery grid: Limit loaded image resolution to screen tile using the ScaleToFill mode. + /// Thumbnail gallery grid: Limit loaded image resolution to screen tile using ScaleToFill mode. /// ScaleToFill, /// - /// Image columns: Limit loaded image resolution to column width using the FitWidth mode. + /// Image columns: Limit loaded image resolution to column width using FitWidth mode. /// FitWidth, /// - /// Image rows: Limit loaded image resolution to row height using the FitHeight mode. + /// Image rows: Limit loaded image resolution to row height using FitHeight mode. /// FitHeight } /// - /// This specifies sampling mode types. Filtering options are used when resizing images to sample original pixels.
- /// A SamplingMode controls how pixels in an input image are sampled and combined to generate each pixel of a destination image during scaling.
- /// NoFilter and Box modes do not guarantee that the output pixel array exactly matches the rectangle specified by the desired dimensions and the FittingMode,
+ /// This specifies sampling mode types. Filtering options, used when resizing images to sample original pixels.
+ /// A SamplingMode controls how pixels in an input image are sampled and combined to generate each pixel of a destination image during a scaling.
+ /// NoFilter and Box modes do not guarantee that the output pixel array exactly matches the rectangle specified by the desired dimensions and FittingMode,
/// but all other filter modes do if the desired dimensions are `<=` the raw dimensions of the input image file.
///
public enum SamplingModeType { /// - /// Iteratively box filter to generate an image of 1/2, 1/4, 1/8, etc. width and height and approximately the desired size.
+ /// Iteratively box filter to generate an image of 1/2, 1/4, 1/8, etc width and height and approximately the desired size.
/// This is the default. ///
Box, @@ -612,7 +652,7 @@ namespace Tizen.NUI ///
Linear, /// - /// Iteratively box filter to generate an image of 1/2, 1/4, 1/8, etc. width and height and approximately the desired size,
+ /// Iteratively box filter to generate an image of 1/2, 1/4, 1/8 etc width and height and approximately the desired size,
/// then for each output pixel, read one pixel from the last level of box filtering.
///
BoxThenNearest, @@ -663,15 +703,15 @@ namespace Tizen.NUI ///
Origin, /// - /// The anchor-point of the visual. + /// The anchor-point of the visual /// AnchorPoint, /// - /// Whether the x or y offset values are relative (percentage [0.0f to 1.0f] of the control) or absolute (in world units). + /// Whether the x or y OFFSET values are relative (percentage [0.0f to 1.0f] of the control) or absolute (in world units). /// OffsetPolicy, /// - /// Whether the width or the height size values are relative (percentage [0.0f to 1.0f] of the control) or absolute (in world units). + /// Whether the width or height SIZE values are relative (percentage [0.0f to 1.0f] of the control) or absolute (in world units). /// SizePolicy } @@ -707,7 +747,7 @@ namespace Tizen.NUI ///
Mesh, /// - /// Renders a simple 3D shape, such as a cube or a sphere. + /// Renders a simple 3D shape, such as a cube or sphere. /// Primitive, /// @@ -727,7 +767,7 @@ namespace Tizen.NUI /// SVG, /// - /// Renders a animated image (animated GIF). + /// Renders a animated image. (Animated GIF) /// AnimatedImage } @@ -758,7 +798,7 @@ namespace Tizen.NUI } /// - /// This specifies visaul align types. + /// This specifies Visaul align types. /// public enum AlignType { @@ -775,7 +815,7 @@ namespace Tizen.NUI } /// - /// This specifies properties of the BorderVisual. + /// This specifies properties of BorderVisual. /// public struct BorderVisualProperty { @@ -785,7 +825,7 @@ namespace Tizen.NUI } /// - /// This specifies properties of the ColorVisual. + /// This specifies properties of ColorVisual. /// public struct ColorVisualProperty { @@ -793,7 +833,7 @@ namespace Tizen.NUI } /// - /// This specifies properties of the GradientVisual. + /// This specifies properties of GradientVisual. /// public struct GradientVisualProperty { @@ -808,7 +848,7 @@ namespace Tizen.NUI } /// - /// This specifies properties of the ImageVisual. + /// This specifies properties of ImageVisual. /// public struct ImageVisualProperty { @@ -829,11 +869,13 @@ namespace Tizen.NUI public static readonly int BatchSize = NDalic.IMAGE_VISUAL_BATCH_SIZE; public static readonly int CacheSize = NDalic.IMAGE_VISUAL_CACHE_SIZE; public static readonly int FrameDelay = NDalic.IMAGE_VISUAL_FRAME_DELAY; - + public static readonly int ReleasePolicy = NDalic.IMAGE_VISUAL_RELEASE_POLICY; + public static readonly int LoadPolicy = NDalic.IMAGE_VISUAL_LOAD_POLICY; + public static readonly int OrientationCorrection = NDalic.IMAGE_VISUAL_ORIENTATION_CORRECTION; } /// - /// This specifies properties of the MeshVisual. + /// This specifies properties of MeshVisual. /// public struct MeshVisualProperty { @@ -847,7 +889,7 @@ namespace Tizen.NUI } /// - /// This specifies properties of the PrimitiveVisual. + /// This specifies properties of PrimitiveVisual. /// public struct PrimitiveVisualProperty { @@ -866,7 +908,7 @@ namespace Tizen.NUI } /// - /// This specifies properties of the TextVisual. + /// This specifies properties of TextVisual. /// public struct TextVisualProperty { @@ -882,7 +924,7 @@ namespace Tizen.NUI } /// - /// This specifies properties of the NpatchImageVisual. + /// This specifies properties of NpatchImageVisual. /// public struct NpatchImageVisualProperty { @@ -900,14 +942,14 @@ namespace Tizen.NUI } /// - /// The HiddenInput property. + /// HiddenInput Property. /// public struct HiddenInputProperty { public static readonly int Mode = NDalicManualPINVOKE.HIDDENINPUT_PROPERTY_MODE_get(); public static readonly int SubstituteCharacter = NDalicManualPINVOKE.HIDDENINPUT_PROPERTY_SUBSTITUTE_CHARACTER_get(); public static readonly int SubstituteCount = NDalicManualPINVOKE.HIDDENINPUT_PROPERTY_SUBSTITUTE_COUNT_get(); - public static readonly int ShowDuration = NDalicManualPINVOKE.HIDDENINPUT_PROPERTY_SHOW_DURATION_get(); + public static readonly int ShowLastCharacterDuration = NDalicManualPINVOKE.HIDDENINPUT_PROPERTY_SHOW_LAST_CHARACTER_DURATION_get(); } /// @@ -932,7 +974,7 @@ namespace Tizen.NUI /// ShowCount, /// - /// Show last character for the duration (use ShowDuration property to modify duration). + /// Show last character for the duration(use ShowLastCharacterDuration property to modify duration). /// ShowLastCharacter } @@ -1288,7 +1330,7 @@ namespace Tizen.NUI } /// - /// Auto scrolling stop behavior. + /// Auto scrolling stop behaviour. /// public enum AutoScrollStopMode { @@ -1297,7 +1339,7 @@ namespace Tizen.NUI ///
FinishLoop, /// - /// Stop animation immediately and reset position. + /// Stop animation immediatly and reset position. /// Immediate } @@ -1305,15 +1347,15 @@ namespace Tizen.NUI /// /// An enum of screen mode. /// - public enum ScreenMode { + public enum ScreenOffMode { /// /// The mode which turns the screen off after a timeout. /// - Default, + Timout, /// /// The mode which keeps the screen turned on. /// - AlwaysOn + Never } /// @@ -1327,15 +1369,15 @@ namespace Tizen.NUI /// None = -1, /// - /// The base nofitication level. + /// Base nofitication level. /// Base = 10, /// - /// The medium notification level than base. + /// Medium notification level than base. /// Medium = 20, /// - /// The higher notification level than medium. + /// Higher notification level than medium. /// High = 30, /// @@ -1345,21 +1387,21 @@ namespace Tizen.NUI } /// - /// An enum of window types. + /// An enum of Window types. /// public enum WindowType { /// /// A default window type.
- /// Indicates a normal or top-level window. + /// Indicates a normal, top-level window. /// Almost every window will be created with this type. ///
Normal, /// - /// A notification window, like a warning about battery life or a new email received. + /// A notification window, like a warning about battery life or a new E-Mail received. /// Notification, /// - /// A persistent utility window, like a toolbox or a palette. + /// A persistent utility window, like a toolbox or palette. /// Utility, /// @@ -1518,7 +1560,7 @@ namespace Tizen.NUI } /// - /// An enum of the scroll state of the text eidtor. + /// An enum of scroll state of text eidtor. /// public enum ScrollState { @@ -1534,17 +1576,17 @@ namespace Tizen.NUI } /// - /// An enum of the line wrap mode of text controls. + /// An enum of line wrap mode of text controls. /// public enum LineWrapMode { /// - /// The word mode will move a word to the next line. + /// Word mode will move word to next line /// Word, /// - /// character will move character by character to the next line. + /// character will move character by character to next line /// Character } diff --git a/src/Tizen.NUI/src/public/NUIWatchApplication.cs b/src/Tizen.NUI/src/public/NUIWatchApplication.cs new file mode 100755 index 000000000..7ec0967e9 --- /dev/null +++ b/src/Tizen.NUI/src/public/NUIWatchApplication.cs @@ -0,0 +1,319 @@ +/* + * Copyright (c) 2016 Samsung Electronics Co., Ltd. + * + * 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.Applications; +using Tizen.Applications.CoreBackend; + +namespace Tizen.NUI +{ + + /// + /// Represents an application that can make watch-face. + /// + public class NUIWatchApplication : CoreApplication + { + /// + /// Occurs whenever the application is resumed. + /// + public event EventHandler Resumed; + + /// + /// Occurs whenever the application is paused. + /// + public event EventHandler Paused; + + /// + /// Occurs at every second. + /// + public event EventHandler TimeTick; + + /// + /// Event arguments that passed via time tick event signal. + /// + public class TimeTickEventArgs : EventArgs + { + private WatchTime _watchTime; + /// + /// Default Constructor. + /// + public TimeTickEventArgs( WatchTime watchTime ) + { + _watchTime = watchTime; + } + + /// + /// WatchTime. + /// + public WatchTime WatchTime + { + get + { + return _watchTime; + } + } + } + + /// + /// Occurs at each minute in ambient mode. + /// http://tizen.org/privilege/alarm.set privilege is needed to receive ambient ticks at each minute. + /// + public event EventHandler AmbientTick; + + /// + /// Event arguments that passed via ambient tick event signal. + /// + public class AmbientTickEventArgs : EventArgs + { + private WatchTime _watchTime; + /// + /// Default Constructor. + /// + public AmbientTickEventArgs(WatchTime watchTime) + { + _watchTime = watchTime; + } + + /// + /// WatchTime. + /// + public WatchTime WatchTime + { + get + { + return _watchTime; + } + } + } + + /// + /// Occurs when the device enters or exits ambient mode + /// + public event EventHandler AmbientChanged; + + /// + /// Event arguments that passed via ambient tick event signal. + /// + public class AmbientChangedEventArgs : EventArgs + { + private bool _changed; + /// + /// Default Constructor. + /// + public AmbientChangedEventArgs(bool changed) + { + _changed = changed; + } + + /// + /// Changed. + /// + public bool Changed + { + get + { + return _changed; + } + } + } + + /// + /// The default constructor. + /// + public NUIWatchApplication() : base(new NUIWatchCoreBackend()) + { + } + + /// + /// The constructor with stylesheet. + /// + public NUIWatchApplication(string stylesheet) : base(new NUIWatchCoreBackend(stylesheet)) + { + } + + /// + /// Overrides this method if want to handle behavior. + /// + protected override void OnLocaleChanged(LocaleChangedEventArgs e) + { + Log.Debug("NUI", "OnLocaleChanged() is called!"); + base.OnLocaleChanged(e); + } + + /// + /// Overrides this method if want to handle behavior. + /// + protected override void OnLowBattery(LowBatteryEventArgs e) + { + Log.Debug("NUI", "OnLowBattery() is called!"); + base.OnLowBattery(e); + } + + /// + /// Overrides this method if want to handle behavior. + /// + protected override void OnLowMemory(LowMemoryEventArgs e) + { + Log.Debug("NUI", "OnLowMemory() is called!"); + base.OnLowMemory(e); + } + + /// + /// Overrides this method if want to handle behavior. + /// + protected override void OnRegionFormatChanged(RegionFormatChangedEventArgs e) + { + Log.Debug("NUI", "OnRegionFormatChanged() is called!"); + base.OnRegionFormatChanged(e); + } + + /// + /// Overrides this method if want to handle behavior. + /// + protected override void OnCreate() + { + // This is also required to create DisposeQueue on main thread. + DisposeQueue disposeQ = DisposeQueue.Instance; + disposeQ.Initialize(); + Log.Debug("NUI","OnCreate() is called!"); + base.OnCreate(); + } + + /// + /// Overrides this method if want to handle behavior. + /// + protected virtual void OnPreCreate() + { + Log.Debug("NUI", "OnPreCreate() is called!"); + } + + /// + /// Overrides this method if want to handle behavior. + /// + protected override void OnTerminate() + { + Log.Debug("NUI", "OnTerminate() is called!"); + base.OnTerminate(); + } + + /// + /// Overrides this method if want to handle behavior. + /// + protected override void OnAppControlReceived(AppControlReceivedEventArgs e) + { + Log.Debug("NUI", "OnAppControlReceived() is called!"); + if (e != null) + { + Log.Debug("NUI", "OnAppControlReceived() is called! ApplicationId=" + e.ReceivedAppControl.ApplicationId); + Log.Debug("NUI", "CallerApplicationId=" + e.ReceivedAppControl.CallerApplicationId + " IsReplyRequest=" + e.ReceivedAppControl.IsReplyRequest); + } + base.OnAppControlReceived(e); + } + + /// + /// Overrides this method if want to handle behavior. + /// + protected void OnPause() + { + Log.Debug("NUI", "OnPause() is called!"); + Paused?.Invoke(this, EventArgs.Empty); + } + + /// + /// Overrides this method if want to handle behavior. + /// + protected virtual void OnResume() + { + Log.Debug("NUI", "OnResume() is called!"); + Resumed?.Invoke(this, EventArgs.Empty); + } + + /// + /// Overrides this method if want to handle behavior. + /// + protected virtual void OnTimeTick(TimeTickEventArgs e) + { + Log.Debug("NUI", "OnTimeTick() is called!"); + TimeTick?.Invoke(this, e); + } + + /// + /// Overrides this method if want to handle behavior. + /// + /// http://tizen.org/privilege/alarm.set + protected virtual void OnAmbientTick(AmbientTickEventArgs e) + { + Log.Debug("NUI", "OnAmbientTick() is called!"); + AmbientTick?.Invoke(this, e); + } + + /// + /// Overrides this method if want to handle behavior. + /// + protected virtual void OnAmbientChanged(AmbientChangedEventArgs e) + { + Log.Debug("NUI", "OnAmbientChanged() is called!"); + AmbientChanged?.Invoke(this, e); + } + + /// + /// Run NUIWidgetApplication. + /// + /// Arguments from commandline. + public override void Run(string[] args) + { + Backend.AddEventHandler(EventType.PreCreated, OnPreCreate); + Backend.AddEventHandler(EventType.Resumed, OnResume); + Backend.AddEventHandler(EventType.Paused, OnPause); + + Backend.AddEventHandler(NUIEventType.TimeTick, OnTimeTick); + Backend.AddEventHandler(NUIEventType.AmbientTick, OnAmbientTick); + Backend.AddEventHandler(NUIEventType.AmbientChanged, OnAmbientChanged); + + base.Run(args); + } + + /// + /// Exit NUIWidgetApplication. + /// + public override void Exit() + { + Backend.Exit(); + } + + internal WatchApplication ApplicationHandle + { + get + { + return ((NUIWatchCoreBackend)this.Backend).WatchApplicationHandle; + } + } + + /// + /// Get the window instance. + /// + public Window Window + { + get + { + //return Window.Instance; + return ApplicationHandle.GetWindow(); + } + } + + } +} diff --git a/src/Tizen.NUI/src/public/NUIWidgetApplication.cs b/src/Tizen.NUI/src/public/NUIWidgetApplication.cs deleted file mode 100755 index c0de24c0b..000000000 --- a/src/Tizen.NUI/src/public/NUIWidgetApplication.cs +++ /dev/null @@ -1,152 +0,0 @@ -/* - * Copyright (c) 2016 Samsung Electronics Co., Ltd. - * - * 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.Applications; -using Tizen.Applications.CoreBackend; -using Tizen.NUI; - -namespace Tizen.NUI -{ - - /// - /// Represents an application that have UI screen. The NUIWidgetApplication class has a default stage. - /// - public class NUIWidgetApplication : CoreApplication - { - - /// - /// The default constructor. - /// - public NUIWidgetApplication() : base(new NUIWidgetCoreBackend()) - { - Tizen.Log.Fatal("NUI", "### NUIWidgetApplication called"); - } - - /// - /// The constructor with stylesheet. - /// - public NUIWidgetApplication(string stylesheet) : base(new NUIWidgetCoreBackend(stylesheet)) - { - Tizen.Log.Fatal("NUI", "### NUIWidgetApplication(string) called"); - } - - /// - /// Overrides this method if want to handle behavior. - /// - protected override void OnLocaleChanged(LocaleChangedEventArgs e) - { - Log.Fatal("NUI", "OnLocaleChanged() is called!"); - base.OnLocaleChanged(e); - } - - /// - /// Overrides this method if want to handle behavior. - /// - protected override void OnLowBattery(LowBatteryEventArgs e) - { - Log.Fatal("NUI", "OnLowBattery() is called!"); - base.OnLowBattery(e); - } - - /// - /// Overrides this method if want to handle behavior. - /// - protected override void OnLowMemory(LowMemoryEventArgs e) - { - Log.Fatal("NUI", "OnLowMemory() is called!"); - base.OnLowMemory(e); - } - - /// - /// Overrides this method if want to handle behavior. - /// - protected override void OnRegionFormatChanged(RegionFormatChangedEventArgs e) - { - Log.Fatal("NUI", "OnRegionFormatChanged() is called!"); - base.OnRegionFormatChanged(e); - } - - /// - /// Overrides this method if want to handle behavior. - /// - protected override void OnTerminate() - { - Log.Fatal("NUI", "OnTerminate() is called!"); - base.OnTerminate(); - } - - /// - /// Overrides this method if want to handle behavior. - /// - protected virtual void OnPreCreate() - { - Log.Fatal("NUI", "OnPreCreate() is called!"); - } - - /// - /// Overrides this method if want to handle behavior. - /// - protected override void OnCreate() - { - // This is also required to create DisposeQueue on main thread. - DisposeQueue disposeQ = DisposeQueue.Instance; - disposeQ.Initialize(); - Log.Fatal("NUI","OnCreate() is called!"); - base.OnCreate(); - } - - /// - /// Run NUIWidgetApplication. - /// - /// Arguments from commandline. - public override void Run(string[] args) - { - Backend.AddEventHandler(EventType.PreCreated, OnPreCreate); - base.Run(args); - } - - /// - /// Exit NUIWidgetApplication. - /// - public override void Exit() - { - Tizen.Log.Fatal("NUI", "### NUIWidgetApplication Exit called"); - base.Exit(); - } - - internal WidgetApplication ApplicationHandle - { - get - { - return ((NUIWidgetCoreBackend)this.Backend).WidgetApplicationHandle; - } - } - - /// - /// Get the window instance. - /// - public Window Window - { - get - { - //return Window.Instance; - return ApplicationHandle.GetWindow(); - } - } - } -} diff --git a/src/Tizen.NUI/src/public/PaddingType.cs b/src/Tizen.NUI/src/public/PaddingType.cs index b0e301999..f0148596b 100755 --- a/src/Tizen.NUI/src/public/PaddingType.cs +++ b/src/Tizen.NUI/src/public/PaddingType.cs @@ -17,6 +17,8 @@ namespace Tizen.NUI { + using System; + public class PaddingType : global::System.IDisposable { private global::System.Runtime.InteropServices.HandleRef swigCPtr; @@ -48,6 +50,9 @@ namespace Tizen.NUI } } + /// + /// Dispose. + /// public void Dispose() { //Throw excpetion if Dispose() is called in separate thread. @@ -99,6 +104,12 @@ namespace Tizen.NUI disposed = true; } + /// + /// Equality operator. + /// + /// First operand + /// Second operand + /// True if the values are identical public static bool operator ==(PaddingType a, PaddingType b) { // If both are null, or both are same instance, return true. @@ -120,12 +131,19 @@ namespace Tizen.NUI (System.Math.Abs(a.Top - b.Top) < NDalic.GetRangedEpsilon(a.Top, b.Top)); } + /// + /// Inequality operator. + /// + /// First operand + /// Second operand + /// True if the values are not identical public static bool operator !=(PaddingType a, PaddingType b) { return !(a == b); } ///< The Left value + [Obsolete("Please do not use! this will be removed. please use Start instead")] public float Left { set @@ -138,7 +156,21 @@ namespace Tizen.NUI } } + ///< The Start value + public float Start + { + set + { + start = value; + } + get + { + return start; + } + } + ///< The Right value + [Obsolete("Please do not use! this will be removed. please use End instead")] public float Right { set @@ -151,16 +183,16 @@ namespace Tizen.NUI } } - ///< The Bottom value - public float Bottom + ///< The end value + public float End { set { - bottom = value; + end = value; } get { - return bottom; + return end; } } @@ -177,36 +209,50 @@ namespace Tizen.NUI } } - - public PaddingType() : this(NDalicPINVOKE.new_PaddingType__SWIG_0(), true) + ///< The Bottom value + public float Bottom { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + set + { + bottom = value; + } + get + { + return bottom; + } } - public PaddingType(float x, float y, float width, float height) : this(NDalicPINVOKE.new_PaddingType__SWIG_1(x, y, width, height), true) + /// + /// Creates an uninitialized PaddingType. + /// + public PaddingType() : this(NDalicPINVOKE.new_PaddingType__SWIG_0(), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - public void Set(float newX, float newY, float newWidth, float newHeight) + /// + /// PaddingType Constructor. + /// + /// Start padding or X coordinate + /// End padding or Y coordinate + /// Top padding or Height + /// Bottom padding or Width + public PaddingType(float start, float end, float top, float bottom) : this(NDalicPINVOKE.new_PaddingType__SWIG_1(start, end, bottom, top), true) { - NDalicPINVOKE.PaddingType_Set(swigCPtr, newX, newY, newWidth, newHeight); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - private float x + /// + /// Assignment from individual values. + /// + /// Start padding or X coordinate + /// End padding or Y coordinate + /// Top padding or Height + /// Bottom padding or Width + public void Set(float newStart, float newEnd, float newTop, float newBottom) { - set - { - NDalicPINVOKE.PaddingType_x_set(swigCPtr, value); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - get - { - float ret = NDalicPINVOKE.PaddingType_x_get(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } + NDalicPINVOKE.PaddingType_Set(swigCPtr, newStart, newEnd, newBottom, newTop); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } private float left @@ -224,16 +270,16 @@ namespace Tizen.NUI } } - private float y + private float start { set { - NDalicPINVOKE.PaddingType_y_set(swigCPtr, value); + NDalicPINVOKE.PaddingType_start_set(swigCPtr, value); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } get { - float ret = NDalicPINVOKE.PaddingType_y_get(swigCPtr); + float ret = NDalicPINVOKE.PaddingType_start_get(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } @@ -254,66 +300,50 @@ namespace Tizen.NUI } } - private float width + private float end { set { - NDalicPINVOKE.PaddingType_width_set(swigCPtr, value); + NDalicPINVOKE.PaddingType_end_set(swigCPtr, value); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } get { - float ret = NDalicPINVOKE.PaddingType_width_get(swigCPtr); + float ret = NDalicPINVOKE.PaddingType_end_get(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } } - private float bottom - { - set - { - NDalicPINVOKE.PaddingType_bottom_set(swigCPtr, value); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - get - { - float ret = NDalicPINVOKE.PaddingType_bottom_get(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - } - - private float height + private float top { set { - NDalicPINVOKE.PaddingType_height_set(swigCPtr, value); + NDalicPINVOKE.PaddingType_top_set(swigCPtr, value); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } get { - float ret = NDalicPINVOKE.PaddingType_height_get(swigCPtr); + float ret = NDalicPINVOKE.PaddingType_top_get(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } } - private float top + private float bottom { set { - NDalicPINVOKE.PaddingType_top_set(swigCPtr, value); + NDalicPINVOKE.PaddingType_bottom_set(swigCPtr, value); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } get { - float ret = NDalicPINVOKE.PaddingType_top_get(swigCPtr); + float ret = NDalicPINVOKE.PaddingType_bottom_get(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } } - } } diff --git a/src/Tizen.NUI/src/public/PanGesture.cs b/src/Tizen.NUI/src/public/PanGesture.cs index 2c930fce3..a70f3a666 100755 --- a/src/Tizen.NUI/src/public/PanGesture.cs +++ b/src/Tizen.NUI/src/public/PanGesture.cs @@ -108,7 +108,7 @@ namespace Tizen.NUI } /// - /// The current touch position of the primary touch point in local actor coordinates. + /// This current touch position of the primary touch point in local actor coordinates. /// public Vector2 Position { @@ -149,7 +149,7 @@ namespace Tizen.NUI } /// - /// The current touch position of the primary touch point in screen coordinates. + /// This current touch position of the primary touch point in screen coordinates. /// public Vector2 ScreenPosition { @@ -171,7 +171,7 @@ namespace Tizen.NUI } /// - /// The default constructor. + /// Default Constructor. /// public PanGesture() : this(NDalicPINVOKE.new_PanGesture__SWIG_0(), true) { @@ -179,7 +179,7 @@ namespace Tizen.NUI } /// - /// The constructor. + /// Constructor. /// /// The state of the gesture internal PanGesture(Gesture.StateType state) : this(NDalicPINVOKE.new_PanGesture__SWIG_1((int)state), true) @@ -303,7 +303,7 @@ namespace Tizen.NUI /// Returns the speed at which the user is moving their fingers.
/// This is the pixel movement per millisecond.
///
- /// The speed of the pan (in pixels per millisecond). + /// The speed of the pan (in pixels per millisecond) public float GetSpeed() { float ret = NDalicPINVOKE.PanGesture_GetSpeed(swigCPtr); @@ -312,11 +312,11 @@ namespace Tizen.NUI } /// - /// Returns the distance the user has panned (dragged) since the last pan gesture or, + /// This returns the distance the user has panned (dragged) since the last pan gesture or, /// if the gesture has just started, then the distance moved since the user touched the screen.
/// This is always a positive value.
///
- /// The distance, as a float, a user's finger has panned. + /// The distance, as a float, a user's finger has panned public float GetDistance() { float ret = NDalicPINVOKE.PanGesture_GetDistance(swigCPtr); @@ -328,7 +328,7 @@ namespace Tizen.NUI /// Returns the speed at which the user is moving their fingers relative to screen coordinates.
/// This is the pixel movement per millisecond.
///
- /// The speed of the pan (in pixels per millisecond). + /// The speed of the pan (in pixels per millisecond) public float GetScreenSpeed() { float ret = NDalicPINVOKE.PanGesture_GetScreenSpeed(swigCPtr); @@ -337,12 +337,12 @@ namespace Tizen.NUI } /// - /// Returns the distance the user has panned (dragged) since the last pan gesture in screen + /// This returns the distance the user has panned (dragged) since the last pan gesture in screen /// coordinates or, if the gesture has just started, then the distance in screen coordinates moved /// since the user touched the screen.
/// This is always a positive value.
///
- /// The distance, as a float, a user's finger has panned. + /// The distance, as a float, a user's finger has panned public float GetScreenDistance() { float ret = NDalicPINVOKE.PanGesture_GetScreenDistance(swigCPtr); diff --git a/src/Tizen.NUI/src/public/Path.cs b/src/Tizen.NUI/src/public/Path.cs index 495851be4..a13eb6ab2 100755 --- a/src/Tizen.NUI/src/public/Path.cs +++ b/src/Tizen.NUI/src/public/Path.cs @@ -21,7 +21,7 @@ namespace Tizen.NUI /// /// A 3D parametric curve.
- /// Paths can be used to animate the position and orientation of actors.
+ /// Paths can be used to animate position and orientation of actors.
///
public class Path : BaseHandle { @@ -76,7 +76,7 @@ namespace Tizen.NUI } /// - /// Creates an initialized path handle. + /// Creates an initialized Path handle. /// public Path() : this(NDalicPINVOKE.Path_New(), true) { @@ -86,7 +86,7 @@ namespace Tizen.NUI [Obsolete("Please do not use! this will be deprecated")] - public static Path DownCast(BaseHandle handle) + public new static Path DownCast(BaseHandle handle) { Path ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as Path; if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -96,7 +96,7 @@ namespace Tizen.NUI /// /// Adds an interpolation point. /// - /// The new interpolation point to be added. + /// The new interpolation point to be added public void AddPoint(Position point) { NDalicPINVOKE.Path_AddPoint(swigCPtr, Position.getCPtr(point)); @@ -106,7 +106,7 @@ namespace Tizen.NUI /// /// Adds a control point. /// - /// The new control point to be added. + /// The new control point to be added public void AddControlPoint(Vector3 point) { NDalicPINVOKE.Path_AddControlPoint(swigCPtr, Vector3.getCPtr(point)); @@ -121,7 +121,7 @@ namespace Tizen.NUI /// The in control point is the length of the preceding segment back along this bisector multiplied by the curvature.
/// The out control point is the length of the succeeding segment forward along this bisector multiplied by the curvature.
///
- /// The curvature of the spline. 0 gives straight lines between the knots, negative values means the spline contains loops, positive values up to 0.5 result in a smooth curve, positive values between 0.5 and 1 result in looped curves where the loops are not distinct (i.e., the curve appears to be non-continuous), positive values higher than 1 result in looped curves. + /// The curvature of the spline. 0 gives straight lines between the knots, negative values means the spline contains loops, positive values up to 0.5 result in a smooth curve, positive values between 0.5 and 1 result in looped curves where the loops are not distinct (i.e. the curve appears to be non-continuous), positive values higher than 1 result in looped curves public void GenerateControlPoints(float curvature) { NDalicPINVOKE.Path_GenerateControlPoints(swigCPtr, curvature); @@ -129,11 +129,11 @@ namespace Tizen.NUI } /// - /// Sample path at a given progress. Calculates the position and tangent at that point of the curve. + /// Sample path at a given progress. Calculates position and tangent at that point of the curve. /// - /// A floating point value between 0.0 and 1.0. - /// The interpolated position at that progress. - /// The interpolated tangent at that progress. + /// A floating point value between 0.0 and 1.0 + /// The interpolated position at that progress + /// The interpolated tangent at that progress public void Sample(float progress, Vector3 position, Vector3 tangent) { NDalicPINVOKE.Path_Sample(swigCPtr, progress, Vector3.getCPtr(position), Vector3.getCPtr(tangent)); @@ -141,9 +141,9 @@ namespace Tizen.NUI } /// - /// An accessor for the interpolation points. + /// Accessor for the interpolation points. /// - /// The index of the interpolation point. + /// The index of the interpolation point public Vector3 GetPoint(uint index) { Vector3 ret = new Vector3(NDalicPINVOKE.Path_GetPoint(swigCPtr, index), false); @@ -152,9 +152,9 @@ namespace Tizen.NUI } /// - /// An accessor for the control points. + /// Accessor for the control points. /// - /// The index of the control point. + /// The index of the control point public Vector3 GetControlPoint(uint index) { Vector3 ret = new Vector3(NDalicPINVOKE.Path_GetControlPoint(swigCPtr, index), false); @@ -165,7 +165,7 @@ namespace Tizen.NUI /// /// Gets the number of interpolation points in the path. /// - /// The number of interpolation points in the path. + /// The number of interpolation points in the path public uint GetPointCount() { uint ret = NDalicPINVOKE.Path_GetPointCount(swigCPtr); @@ -174,7 +174,7 @@ namespace Tizen.NUI } /// - /// Enumeration for the Points. + /// Enumeration for Points /// public PropertyArray Points { @@ -191,7 +191,7 @@ namespace Tizen.NUI } /// - /// Enumeration for the ControlPoints. + /// Enumeration for ControlPoints /// public PropertyArray ControlPoints { diff --git a/src/Tizen.NUI/src/public/PinchGesture.cs b/src/Tizen.NUI/src/public/PinchGesture.cs index ec97af920..daf41731f 100755 --- a/src/Tizen.NUI/src/public/PinchGesture.cs +++ b/src/Tizen.NUI/src/public/PinchGesture.cs @@ -77,7 +77,7 @@ namespace Tizen.NUI /// /// The scale factor from the start of the pinch gesture till the latest pinch gesture.
/// If the user is moving their fingers away from each other, then - /// this value increases. Conversely, if the user is moving their + /// this value increases. Conversely, if the user is moving their /// fingers towards each other, this value will decrease.
///
public float Scale @@ -123,9 +123,9 @@ namespace Tizen.NUI } /// - /// The default constructor. + /// Default Constructor. /// - /// The state of the gesture. + /// The state of the gesture internal PinchGesture(Gesture.StateType state) : this(NDalicPINVOKE.new_PinchGesture__SWIG_0((int)state), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); diff --git a/src/Tizen.NUI/src/public/Position.cs b/src/Tizen.NUI/src/public/Position.cs index 728cf7e86..9a9ae5276 100755 --- a/src/Tizen.NUI/src/public/Position.cs +++ b/src/Tizen.NUI/src/public/Position.cs @@ -21,7 +21,7 @@ namespace Tizen.NUI { /// - /// Position is a three-dimensional vector. + /// Position is a three dimensional vector. /// public class Position : global::System.IDisposable { @@ -104,76 +104,76 @@ namespace Tizen.NUI /// - /// An addition operator. + /// Addition operator. /// - /// The vector to add. - /// The vector to add. - /// The vector containing the result of the addition. + /// Vector to add + /// Vector to add + /// A vector containing the result of the addition public static Position operator +(Position arg1, Position arg2) { return arg1.Add(arg2); } /// - /// The subtraction operator. + /// Subtraction operator. /// - /// The vector to subtract. - /// The vector to subtract. - /// The vector containing the result of the subtraction. + /// Vector to subtract + /// Vector to subtract + /// A vector containing the result of the subtraction public static Position operator -(Position arg1, Position arg2) { return arg1.Subtract(arg2); } /// - /// The unary negation operator. + /// Unary negation operator. /// - /// The vector to negate. - /// The vector containg the negation. + /// Vector to netate + /// A vector containg the negation public static Position operator -(Position arg1) { return arg1.Subtract(); } /// - /// The multiplication operator. + /// Multiplication operator. /// - /// The vector to multiply. - /// The vector to multiply. - /// The vector containing the result of the multiplication. + /// The vector to multiply + /// The vector to multiply + /// A vector containing the result of the multiplication public static Position operator *(Position arg1, Position arg2) { return arg1.Multiply(arg2); } /// - /// The multiplication operator. + /// Multiplication operator. /// /// The vector to multiply - /// The float value to scale the vector. - /// The vector containing the result of scaling. + /// The float value to scale the vector + /// A vector containing the result of the scaling public static Position operator *(Position arg1, float arg2) { return arg1.Multiply(arg2); } /// - /// The division operator. + /// Division operator. /// - /// The vector to divide. - /// The vector to divide. - /// The vector containing the result of the division. + /// The vector to divide + /// The vector to divide + /// A vector containing the result of the division public static Position operator /(Position arg1, Position arg2) { return arg1.Divide(arg2); } /// - /// The division operator. + /// Division operator. /// - /// The vector to divide. - /// The float value to scale the vector by. - /// The vector containing the result of scaling. + /// The vector to divide + /// The float value to scale the vector by + /// A vector containing the result of the scaling public static Position operator /(Position arg1, float arg2) { return arg1.Divide(arg2); @@ -181,10 +181,10 @@ namespace Tizen.NUI /// - /// The const array subscript operator overload. Should be 0, 1, or 2. + /// Const array subscript operator overload. Should be 0, 1 or 2. /// - /// The subscript index. - /// The float at the given index. + /// Subscript index + /// The float at the given index public float this[uint index] { get @@ -193,6 +193,8 @@ namespace Tizen.NUI } } + /// + /// internal static Position GetPositionFromPtr(global::System.IntPtr cPtr) { Position ret = new Position(cPtr, false); @@ -202,7 +204,7 @@ namespace Tizen.NUI /// - /// The constructor. + /// Constructor /// public Position() : this(NDalicPINVOKE.new_Vector3__SWIG_0(), true) { @@ -210,20 +212,20 @@ namespace Tizen.NUI } /// - /// The constructor. + /// Constructor /// - /// The x component. - /// The y component. - /// The z component. + /// x component + /// y component + /// z component public Position(float x, float y, float z) : this(NDalicPINVOKE.new_Vector3__SWIG_1(x, y, z), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } /// - /// The constructor. + /// Constructor /// - /// Position2D to create this vector from. + /// Position2D to create this vector from public Position(Position2D position2d) : this(NDalicPINVOKE.new_Vector3__SWIG_3(Position2D.getCPtr(position2d)), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -288,10 +290,10 @@ namespace Tizen.NUI } /// - /// Compares if rhs is equal to. + /// Compare if rhs is equal to /// - /// The vector to compare. - /// Returns true if the two vectors are equal, otherwise false. + /// The vector to compare + /// Returns true if the two vectors are equal, otherwise false public bool EqualTo(Position rhs) { bool ret = NDalicPINVOKE.Vector3_EqualTo(swigCPtr, Position.getCPtr(rhs)); @@ -300,10 +302,10 @@ namespace Tizen.NUI } /// - /// Compares if rhs is not equal to. + /// Compare if rhs is not equal to /// - /// The vector to compare. - /// Returns true if the two vectors are not equal, otherwise false. + /// The vector to compare + /// Returns true if the two vectors are not equal, otherwise false public bool NotEqualTo(Position rhs) { bool ret = NDalicPINVOKE.Vector3_NotEqualTo(swigCPtr, Position.getCPtr(rhs)); @@ -313,7 +315,7 @@ namespace Tizen.NUI /// - /// The x component. + /// x component /// public float X { @@ -331,7 +333,7 @@ namespace Tizen.NUI } /// - /// The y component. + /// y component /// public float Y { @@ -349,7 +351,7 @@ namespace Tizen.NUI } /// - /// The z component. + /// z component /// public float Z { @@ -432,7 +434,7 @@ namespace Tizen.NUI } /// - /// ParentOrigin constants: 0.0, 0.0, 0.5. + /// ParentOrigin constants: 0.0, 0.0, 0.5 /// public static Position ParentOriginTopLeft { @@ -446,7 +448,7 @@ namespace Tizen.NUI } /// - /// ParentOrigin constants: 0.5, 0.0, 0.5. + /// ParentOrigin constants: 0.5, 0.0, 0.5 /// public static Position ParentOriginTopCenter { @@ -460,7 +462,7 @@ namespace Tizen.NUI } /// - /// ParentOrigin constants: 1.0, 0.0, 0.5. + /// ParentOrigin constants: 1.0, 0.0, 0.5 /// public static Position ParentOriginTopRight { @@ -474,7 +476,7 @@ namespace Tizen.NUI } /// - /// ParentOrigin constants: 0.0, 0.5, 0.5. + /// ParentOrigin constants: 0.0, 0.5, 0.5 /// public static Position ParentOriginCenterLeft { @@ -502,7 +504,7 @@ namespace Tizen.NUI } /// - /// ParentOrigin constants: 1.0, 0.5, 0.5. + /// ParentOrigin constants: 1.0, 0.5, 0.5 /// public static Position ParentOriginCenterRight { @@ -516,7 +518,7 @@ namespace Tizen.NUI } /// - /// ParentOrigin constants: 0.0f, 1.0f, 0.5f. + /// ParentOrigin constants: 0.0f, 1.0f, 0.5f /// public static Position ParentOriginBottomLeft { @@ -530,7 +532,7 @@ namespace Tizen.NUI } /// - /// ParentOrigin constants: 0.5, 1.0, 0.5. + /// ParentOrigin constants: 0.5, 1.0, 0.5 /// public static Position ParentOriginBottomCenter { @@ -544,7 +546,7 @@ namespace Tizen.NUI } /// - /// ParentOrigin constants: 1.0, 1.0, 0.5. + /// ParentOrigin constants: 1.0, 1.0, 0.5 /// public static Position ParentOriginBottomRight { @@ -558,7 +560,7 @@ namespace Tizen.NUI } /// - /// PivotPoint constants: 0.0. + /// PivotPoint constants: 0.0 /// public static float PivotPointTop { @@ -571,7 +573,7 @@ namespace Tizen.NUI } /// - /// PivotPoint constants: 1.0. + /// PivotPoint constants: 1.0 /// public static float PivotPointBottom { @@ -584,7 +586,7 @@ namespace Tizen.NUI } /// - /// PivotPoint constants: 0.0. + /// PivotPoint constants: 0.0 /// public static float PivotPointLeft { @@ -597,7 +599,7 @@ namespace Tizen.NUI } /// - /// PivotPoint constants: 1.0. + /// PivotPoint constants: 1.0 /// public static float PivotPointRight { @@ -610,7 +612,7 @@ namespace Tizen.NUI } /// - /// PivotPoint constants: 0.0. + /// PivotPoint constants: 0.0 /// public static float PivotPointMiddle { @@ -623,7 +625,7 @@ namespace Tizen.NUI } /// - /// PivotPoint constants: 0.0, 0.0, 0.5. + /// PivotPoint constants: 0.0, 0.0, 0.5 /// public static Position PivotPointTopLeft { @@ -637,7 +639,7 @@ namespace Tizen.NUI } /// - /// PivotPoint constants: 0.5, 0.0, 0.5. + /// PivotPoint constants: 0.5, 0.0, 0.5 /// public static Position PivotPointTopCenter { @@ -651,7 +653,7 @@ namespace Tizen.NUI } /// - /// PivotPoint constants: 1.0, 0.0, 0.5. + /// PivotPoint constants: 1.0, 0.0, 0.5 /// public static Position PivotPointTopRight { @@ -665,7 +667,7 @@ namespace Tizen.NUI } /// - /// PivotPoint constants: 0.0, 0.5, 0.5. + /// PivotPoint constants: 0.0, 0.5, 0.5 /// public static Position PivotPointCenterLeft { @@ -679,7 +681,7 @@ namespace Tizen.NUI } /// - /// PivotPoint constants: 0.5, 0.5, 0.5. + /// PivotPoint constants: 0.5, 0.5, 0.5 /// public static Position PivotPointCenter { @@ -693,7 +695,7 @@ namespace Tizen.NUI } /// - /// PivotPoint constants: 1.0, 0.5, 0.5. + /// PivotPoint constants: 1.0, 0.5, 0.5 /// public static Position PivotPointCenterRight { @@ -707,7 +709,7 @@ namespace Tizen.NUI } /// - /// PivotPoint constants: 0.0, 1.0, 0.5. + /// PivotPoint constants: 0.0, 1.0, 0.5 /// public static Position PivotPointBottomLeft { @@ -735,7 +737,7 @@ namespace Tizen.NUI } /// - /// PivotPoint constants: 1.0, 1.0, 0.5. + /// PivotPoint constants: 1.0, 1.0, 0.5 /// public static Position PivotPointBottomRight { @@ -749,7 +751,7 @@ namespace Tizen.NUI } /// - /// Constant ( 1.0f, 1.0f, 1.0f ). + /// Constant ( 1.0f, 1.0f, 1.0f ) /// public static Position One { @@ -829,7 +831,7 @@ namespace Tizen.NUI } /// - /// Constant ( 0.0f, 0.0f, 0.0f ). + /// Constant ( 0.0f, 0.0f, 0.0f ) /// public static Position Zero { @@ -843,7 +845,7 @@ namespace Tizen.NUI } /// - /// Converts a position instance to a Vector3 instance. + /// Convert a position instance to a vector3 instance. /// public static implicit operator Vector3(Position Position) { @@ -851,7 +853,7 @@ namespace Tizen.NUI } /// - /// Converts a Vector3 instance to a position instance. + /// Convert a vector3 instance to a position instance. /// public static implicit operator Position(Vector3 vec) { diff --git a/src/Tizen.NUI/src/public/Position2D.cs b/src/Tizen.NUI/src/public/Position2D.cs index f12ece408..b840d8c50 100755 --- a/src/Tizen.NUI/src/public/Position2D.cs +++ b/src/Tizen.NUI/src/public/Position2D.cs @@ -19,7 +19,7 @@ namespace Tizen.NUI { /// - /// Position2D is a two-dimensional vector. + /// Position2D is a two dimensional vector. /// public class Position2D : global::System.IDisposable { @@ -101,86 +101,86 @@ namespace Tizen.NUI } /// - /// The addition operator. + /// Addition operator. /// - /// The vector to add. - /// The vector to add. - /// The vector containing the result of the addition. + /// Vector to add + /// Vector to add + /// A vector containing the result of the addition public static Position2D operator +(Position2D arg1, Position2D arg2) { return arg1.Add(arg2); } /// - /// The subtraction operator. + /// Subtraction operator. /// - /// The vector to subtract. - /// The vector to subtract. - /// The vector containing the result of the subtraction. + /// Vector to subtract + /// Vector to subtract + /// A vector containing the result of the subtraction public static Position2D operator -(Position2D arg1, Position2D arg2) { return arg1.Subtract(arg2); } /// - /// The unary negation operator. + /// Unary negation operator. /// - /// The vector to negate. - /// The vector containing the negation. + /// Vector to netate + /// A vector containing the negation public static Position2D operator -(Position2D arg1) { return arg1.Subtract(); } /// - /// The multiplication operator. + /// Multiplication operator. /// - /// The vector to multiply. - /// The vector to multiply. - /// The vector containing the result of the multiplication. + /// Vector to multiply + /// Vector to multiply + /// A vector containing the result of the multiplication public static Position2D operator *(Position2D arg1, Position2D arg2) { return arg1.Multiply(arg2); } /// - /// The multiplication operator. + /// Multiplication operator. /// - /// The vector to multiply. - /// The integer value to scale the vector. - /// The vector containing the result of the multiplication. + /// Vector to multiply + /// The int value to scale the vector + /// A vector containing the result of the multiplication public static Position2D operator *(Position2D arg1, int arg2) { return arg1.Multiply(arg2); } /// - /// The division operator. + /// Division operator. /// - /// The vector to divide. - /// The vector to divide. - /// The vector containing the result of the division. + /// Vector to divide + /// Vector to divide + /// A vector containing the result of the division public static Position2D operator /(Position2D arg1, Position2D arg2) { return arg1.Divide(arg2); } /// - /// The division operator. + /// Division operator. /// - /// The vector to divide. - /// The integer value to scale the vector by. - /// The vector containing the result of the division. + /// Vector to divide + /// The int value to scale the vector by + /// A vector containing the result of the division public static Position2D operator /(Position2D arg1, int arg2) { return arg1.Divide(arg2); } /// - /// The const array subscript operator overload. Should be 0, or 1. + /// Const array subscript operator overload. Should be 0, or 1. /// - /// The subscript index. - /// The float at the given index. + /// Subscript index + /// The float at the given index public float this[uint index] { get @@ -197,7 +197,7 @@ namespace Tizen.NUI } /// - /// The constructor. + /// Constructor /// public Position2D() : this(NDalicPINVOKE.new_Vector2__SWIG_0(), true) { @@ -205,7 +205,7 @@ namespace Tizen.NUI } /// - /// The constructor. + /// Constructor /// /// x component /// y component @@ -215,7 +215,7 @@ namespace Tizen.NUI } /// - /// The constructor. + /// Constructor /// /// Position to create this vector from public Position2D(Position position) : this(NDalicPINVOKE.new_Vector2__SWIG_3(Position.getCPtr(position)), true) @@ -275,7 +275,7 @@ namespace Tizen.NUI } /// - /// Compares if the rhs is equal to. + /// Compare if rhs is equal to. /// /// The vector to compare /// Returns true if the two vectors are equal, otherwise false @@ -287,10 +287,10 @@ namespace Tizen.NUI } /// - /// Compares if the rhs is not equal to. + /// Compare if rhs is not equal to. /// - /// The vector to compare. - /// Returns true if the two vectors are not equal, otherwise false. + /// The vector to compare + /// Returns true if the two vectors are not equal, otherwise false public bool NotEqualTo(Position2D rhs) { bool ret = NDalicPINVOKE.Vector2_NotEqualTo(swigCPtr, Position2D.getCPtr(rhs)); @@ -306,7 +306,7 @@ namespace Tizen.NUI } /// - /// The x component. + /// x component. /// public int X { @@ -324,7 +324,7 @@ namespace Tizen.NUI } /// - /// The y component. + /// y component. /// public int Y { @@ -342,7 +342,7 @@ namespace Tizen.NUI } /// - /// Converts a Position2D instance to a Vector2 instance. + /// Convert a position2D instance to a vector2 instance. /// public static implicit operator Vector2(Position2D position2d) { @@ -350,29 +350,13 @@ namespace Tizen.NUI } /// - /// Converts a Vector2 instance to a Position2D instance. + /// Convert a vector2 instance to a position2D instance. /// public static implicit operator Position2D(Vector2 vec) { return new Position2D((int)vec.X, (int)vec.Y); } - /// - /// Converts a Position2D instance to a Uint16Pair instance. - /// - public static implicit operator Uint16Pair(Position2D position2d) - { - return new Uint16Pair((uint)position2d.X, (uint)position2d.Y); - } - - /// - /// Converts a Uint16Pair instance to a Position2D instance. - /// - public static implicit operator Position2D(Uint16Pair pair) - { - return new Position2D((int)pair.GetX(), (int)pair.GetY()); - } - } } diff --git a/src/Tizen.NUI/src/public/Property.cs b/src/Tizen.NUI/src/public/Property.cs index 702c8bc3e..d5852e27e 100755 --- a/src/Tizen.NUI/src/public/Property.cs +++ b/src/Tizen.NUI/src/public/Property.cs @@ -130,44 +130,44 @@ namespace Tizen.NUI } /// - /// This constructor creates a property instance. + /// Constructor. Create a Property instance. /// - /// A valid handle to the target object. - /// The index of a property. + /// A valid handle to the target object + /// The index of a property public Property(Animatable arg0, int propertyIndex) : this(NDalicPINVOKE.new_Property__SWIG_0(Animatable.getCPtr(arg0), propertyIndex), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } /// - /// This constructor creates a property instance. + /// Constructor. Create a Property instance. /// - /// A valid handle to the target object. - /// The index of a property. - /// Index to a sub component of a property, for use with Vector2, Vector3 and Vector4. -1 for the main property (default is -1). + /// A valid handle to the target object + /// The index of a property + /// Index to a sub component of a property, for use with Vector2, Vector3 and Vector4. -1 for main property (default is -1) public Property(Animatable arg0, int propertyIndex, int componentIndex) : this(NDalicPINVOKE.new_Property__SWIG_1(Animatable.getCPtr(arg0), propertyIndex, componentIndex), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } /// - /// This constructor creates a property instance.
- /// This performs a property index query and is therefore slower than constructing a property directly with the index.
+ /// Constructor. Create a Property instance.
+ /// This performs a property index query and is therefore slower than constructing a Property directly with the index.
///
- /// A valid handle to the target object. - /// The property name. + /// A valid handle to the target object + /// The property name public Property(Animatable arg0, string propertyName) : this(NDalicPINVOKE.new_Property__SWIG_2(Animatable.getCPtr(arg0), propertyName), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } /// - /// This constructor creates a property instance.
- /// This performs a property index query and is therefore slower than constructing a property directly with the index.
+ /// Constructor. Create a Property instance.
+ /// This performs a property index query and is therefore slower than constructing a Property directly with the index.
///
- /// A valid handle to the target object. - /// The property name. - /// Index to a sub component of a property, for use with Vector2, Vector3 and Vector4. -1 for main property (default is -1). + /// A valid handle to the target object + /// The property name + /// Index to a sub component of a property, for use with Vector2, Vector3 and Vector4. -1 for main property (default is -1) public Property(Animatable arg0, string propertyName, int componentIndex) : this(NDalicPINVOKE.new_Property__SWIG_3(Animatable.getCPtr(arg0), propertyName, componentIndex), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -189,7 +189,7 @@ namespace Tizen.NUI } /// - /// Gets or sets the index of the property. + /// Gets/Sets the index of the property. /// public int propertyIndex { @@ -207,7 +207,7 @@ namespace Tizen.NUI } /// - /// Gets or sets the component index of the property. + /// Gets/Sets the componentIndex of the property. /// public int componentIndex { @@ -227,7 +227,7 @@ namespace Tizen.NUI } /// - /// An array of property values. + /// A Array of property values. /// public class PropertyArray : global::System.IDisposable { @@ -309,10 +309,10 @@ namespace Tizen.NUI } /// - /// The operator to access an element. + /// Operator to access an element. /// - /// The element index to access. No bounds checking is performed. - /// The reference to the element. + /// The element index to access. No bounds checking is performed + /// The a reference to the element public PropertyValue this[uint index] { get @@ -322,7 +322,7 @@ namespace Tizen.NUI } /// - /// The constructor. + /// Constructor /// public PropertyArray() : this(NDalicPINVOKE.new_Property_Array__SWIG_0(), true) { @@ -337,7 +337,7 @@ namespace Tizen.NUI /// /// Retrieves the number of elements in the array. /// - /// The number of elements in the array. + /// The number of elements in the array public uint Size() { uint ret = NDalicPINVOKE.Property_Array_Size(swigCPtr); @@ -348,7 +348,7 @@ namespace Tizen.NUI /// /// Retrieves the number of elements in the array. /// - /// The number of elements in the array. + /// The number of elements in the array public uint Count() { uint ret = NDalicPINVOKE.Property_Array_Count(swigCPtr); @@ -359,7 +359,7 @@ namespace Tizen.NUI /// /// Returns whether the array is empty. /// - /// Returns true if empty, false otherwise. + /// Return true if empty, false otherwise public bool Empty() { bool ret = NDalicPINVOKE.Property_Array_Empty(swigCPtr); @@ -379,7 +379,7 @@ namespace Tizen.NUI /// /// Increases the capacity of the array. /// - /// The size to reserve. + /// The size to reserve public void Reserve(uint size) { NDalicPINVOKE.Property_Array_Reserve(swigCPtr, size); @@ -399,7 +399,7 @@ namespace Tizen.NUI /// /// Retrieves the capacity of the array. /// - /// The allocated capacity of the array. + /// The allocated capacity of the array public uint Capacity() { uint ret = NDalicPINVOKE.Property_Array_Capacity(swigCPtr); @@ -410,7 +410,7 @@ namespace Tizen.NUI /// /// Adds an element to the array. /// - /// The value to add at the end of the array. + /// The value to add to the end of the array public void PushBack(PropertyValue value) { NDalicPINVOKE.Property_Array_PushBack(swigCPtr, PropertyValue.getCPtr(value)); @@ -418,9 +418,9 @@ namespace Tizen.NUI } /// - /// Adds an element to the array. + /// Add an element to the array. /// - /// The value to add at the end of the array. + /// The value to add to the end of the array public PropertyArray Add(PropertyValue value) { PropertyArray ret = new PropertyArray(NDalicPINVOKE.Property_Array_Add(swigCPtr, PropertyValue.getCPtr(value)), false); @@ -429,10 +429,10 @@ namespace Tizen.NUI } /// - /// Accesses an element. + /// Access an element. /// - /// The element index to access. No bounds checking is performed. - /// The reference to the element. + /// The element index to access. No bounds checking is performed + /// The a reference to the element public PropertyValue GetElementAt(uint index) { PropertyValue ret = new PropertyValue(NDalicPINVOKE.Property_Array_GetElementAt__SWIG_0(swigCPtr, index), false); @@ -444,7 +444,7 @@ namespace Tizen.NUI /// Retrieves the value of elements in the array. /// /// The element index to retrieve. - /// The reference to the element. + /// The a reference to the element private PropertyValue ValueOfIndex(uint index) { PropertyValue ret = new PropertyValue(NDalicPINVOKE.Property_Array_ValueOfIndex__SWIG_0(swigCPtr, index), false); @@ -454,7 +454,7 @@ namespace Tizen.NUI } /// - /// A key type which can be either a std::string or a Property::Index. + /// A key type which can be either a std::string or a Property::Index /// public class PropertyKey : global::System.IDisposable { @@ -536,7 +536,7 @@ namespace Tizen.NUI } /// - /// The type of the key. + /// The type of the key /// public PropertyKey.KeyType Type { @@ -590,28 +590,28 @@ namespace Tizen.NUI } /// - /// The constructor. + /// Constructor /// - /// The string key. + /// The string key public PropertyKey(string key) : this(NDalicPINVOKE.new_Property_Key__SWIG_0(key), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } /// - /// The constructor. + /// Constructor /// - /// The index key. + /// The index key public PropertyKey(int key) : this(NDalicPINVOKE.new_Property_Key__SWIG_1(key), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } /// - /// Compares if rhs is equal to. + /// Compare if rhs is equal to /// - /// A string key to compare against. - /// Returns true if the key compares, or false if it isn't equal or of the wrong type. + /// A string key to compare against + /// Returns true if the key compares, or false if it isn't equal or of the wrong type public bool EqualTo(string rhs) { bool ret = NDalicPINVOKE.Property_Key_EqualTo__SWIG_0(swigCPtr, rhs); @@ -620,10 +620,10 @@ namespace Tizen.NUI } /// - /// Compares if rhs is equal to. + /// Compare if rhs is equal to /// - /// The index key to compare against. - /// Returns true if the key compares, or false if it isn't equal or of the wrong type. + /// A index key to compare against + /// Returns true if the key compares, or false if it isn't equal or of the wrong type public bool EqualTo(int rhs) { bool ret = NDalicPINVOKE.Property_Key_EqualTo__SWIG_1(swigCPtr, rhs); @@ -632,10 +632,10 @@ namespace Tizen.NUI } /// - /// Compares if rhs is equal to + /// Compare if rhs is equal to /// /// A key to compare against - /// Returns true if the keys are of the same type and have the same value. + /// Returns true if the keys are of the same type and have the same value public bool EqualTo(PropertyKey rhs) { bool ret = NDalicPINVOKE.Property_Key_EqualTo__SWIG_2(swigCPtr, PropertyKey.getCPtr(rhs)); @@ -644,10 +644,10 @@ namespace Tizen.NUI } /// - /// Compares if rhs is not equal to. + /// Compare if rhs is not equal to /// - /// The index key to compare against. - /// Returns true if the key is not equal or not a string key. + /// An index key to compare against. + /// Returns true if the key is not equal or not a string key public bool NotEqualTo(string rhs) { bool ret = NDalicPINVOKE.Property_Key_NotEqualTo__SWIG_0(swigCPtr, rhs); @@ -656,10 +656,10 @@ namespace Tizen.NUI } /// - /// Compares if rhs is not equal to. + /// Compare if rhs is not equal to /// - /// The index key to compare against. - /// Returns true if the key is not equal, or not the index key. + /// An index key to compare against. + /// Returns true if the key is not equal, or not an index key public bool NotEqualTo(int rhs) { bool ret = NDalicPINVOKE.Property_Key_NotEqualTo__SWIG_1(swigCPtr, rhs); @@ -668,10 +668,10 @@ namespace Tizen.NUI } /// - /// Compares if rhs is not equal to. + /// Compare if rhs is not equal to /// /// A key to compare against. - /// Returns true if the keys are not of the same type or are not equal. + /// Returns true if the keys are not of the same type or are not equal public bool NotEqualTo(PropertyKey rhs) { bool ret = NDalicPINVOKE.Property_Key_NotEqualTo__SWIG_2(swigCPtr, PropertyKey.getCPtr(rhs)); @@ -680,7 +680,7 @@ namespace Tizen.NUI } /// - /// The type of key. + /// The type of key /// public enum KeyType { @@ -691,7 +691,7 @@ namespace Tizen.NUI } /// - /// A map of property values, the key type could be string or Property::Index. + /// A Map of property values, the key type could be String or Property::Index. /// public class PropertyMap : global::System.IDisposable { @@ -773,11 +773,11 @@ namespace Tizen.NUI } /// - /// The operator to access the element with the specified string key.
+ /// Operator to access the element with the specified string key.
/// If an element with the key does not exist, then it is created.
///
- /// The key whose value to access. - /// A value for the element with the specified key. + /// The key whose value to access + /// A value for the element with the specified key public PropertyValue this[string key] { get @@ -787,11 +787,11 @@ namespace Tizen.NUI } /// - /// The operator to access the element with the specified index key.
+ /// Operator to access the element with the specified index key.
/// If an element with the key does not exist, then it is created.
///
- /// The key whose value to access. - /// A value for the element with the specified key. + /// The key whose value to access + /// A value for the element with the specified key public PropertyValue this[int key] { get @@ -801,7 +801,7 @@ namespace Tizen.NUI } /// - /// The constructor. + /// Constructor /// public PropertyMap() : this(NDalicPINVOKE.new_Property_Map__SWIG_0(), true) { @@ -809,9 +809,9 @@ namespace Tizen.NUI } /// - /// The copy constructor. + /// Copy Constructor /// - /// The map to copy from. + /// The Map to copy from public PropertyMap(PropertyMap other) : this(NDalicPINVOKE.new_Property_Map__SWIG_1(PropertyMap.getCPtr(other)), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -820,7 +820,7 @@ namespace Tizen.NUI /// /// Retrieves the number of elements in the map. /// - /// The number of elements in the map. + /// The number of elements in the map public uint Count() { uint ret = NDalicPINVOKE.Property_Map_Count(swigCPtr); @@ -831,7 +831,7 @@ namespace Tizen.NUI /// /// Returns whether the map is empty. /// - /// Returns true if empty, false otherwise. + /// Returns true if empty, false otherwise public bool Empty() { bool ret = NDalicPINVOKE.Property_Map_Empty(swigCPtr); @@ -840,11 +840,11 @@ namespace Tizen.NUI } /// - /// Inserts the key-value pair in the map, with the key type as string.
+ /// Inserts the key-value pair in the Map, with the key type as string.
/// Does not check for duplicates.
///
- /// The key to insert. - /// The value to insert. + /// The key to insert + /// The value to insert public void Insert(string key, PropertyValue value) { NDalicPINVOKE.Property_Map_Insert__SWIG_0(swigCPtr, key, PropertyValue.getCPtr(value)); @@ -852,11 +852,11 @@ namespace Tizen.NUI } /// - /// Inserts the key-value pair in the map, with the key type as index.
+ /// Inserts the key-value pair in the Map, with the key type as index.
/// Does not check for duplicates.
///
- /// The key to insert. - /// The value to insert. + /// The key to insert + /// The value to insert public void Insert(int key, PropertyValue value) { NDalicPINVOKE.Property_Map_Insert__SWIG_2(swigCPtr, key, PropertyValue.getCPtr(value)); @@ -864,12 +864,12 @@ namespace Tizen.NUI } /// - /// Inserts the key-value pair in the map, with the key type as string.
+ /// Inserts the key-value pair in the Map, with the key type as string.
/// Does not check for duplicates.
///
- /// The key to insert. - /// The value to insert. - /// Returns a reference to this object. + /// The key to insert + /// The value to insert + /// Returns a reference to this object public PropertyMap Add(string key, PropertyValue value) { PropertyMap ret = new PropertyMap(NDalicPINVOKE.Property_Map_Add__SWIG_0(swigCPtr, key, PropertyValue.getCPtr(value)), false); @@ -878,12 +878,12 @@ namespace Tizen.NUI } /// - /// Inserts the key-value pair in the map, with the key type as string.
+ /// Inserts the key-value pair in the Map, with the key type as string.
/// Does not check for duplicates.
///
- /// The key to insert. - /// The value to insert. - /// Returns a reference to this object. + /// The key to insert + /// The value to insert + /// Returns a reference to this object public PropertyMap Add(int key, PropertyValue value) { PropertyMap ret = new PropertyMap(NDalicPINVOKE.Property_Map_Add__SWIG_2(swigCPtr, key, PropertyValue.getCPtr(value)), false); @@ -894,8 +894,8 @@ namespace Tizen.NUI /// /// Retrieves the value at the specified position. /// - /// The specified position. - /// A reference to the value at the specified position. + /// The specified position + /// A reference to the value at the specified position public PropertyValue GetValue(uint position) { PropertyValue ret = new PropertyValue(NDalicPINVOKE.Property_Map_GetValue(swigCPtr, position), false); @@ -912,10 +912,10 @@ namespace Tizen.NUI } /// - /// Retrieves the key at the specified position. + /// Retrieve the key at the specified position. /// - /// The specified position. - /// A copy of the key at the specified position. + /// The specified position + /// A copy of the key at the specified position public PropertyKey GetKeyAt(uint position) { PropertyKey ret = new PropertyKey(NDalicPINVOKE.Property_Map_GetKeyAt(swigCPtr, position), true); @@ -935,8 +935,8 @@ namespace Tizen.NUI /// /// Finds the value for the specified key if it exists. /// - /// The key to find. - /// The value if it exists, an empty object otherwise. + /// The key to find + /// The value if it exists, an empty object otherwise public PropertyValue Find(int key) { global::System.IntPtr cPtr = NDalicPINVOKE.Property_Map_Find__SWIG_2(swigCPtr, key); @@ -948,9 +948,9 @@ namespace Tizen.NUI /// /// Finds the value for the specified keys if either exist. /// - /// The index key to find. - /// The string key to find. - /// The value if it exists, an empty object otherwise. + /// The index key to find + /// The string key to find + /// The value if it exists, an empty object otherwise public PropertyValue Find(int indexKey, string stringKey) { global::System.IntPtr cPtr = NDalicPINVOKE.Property_Map_Find__SWIG_3(swigCPtr, indexKey, stringKey); @@ -990,7 +990,7 @@ namespace Tizen.NUI /// Merges values from the map 'from' to the current.
/// Any values in 'from' will overwrite the values in the current map.
/// - /// The map to merge from. + /// The map to merge from public void Merge(PropertyMap from) { NDalicPINVOKE.Property_Map_Merge(swigCPtr, PropertyMap.getCPtr(from)); @@ -1000,8 +1000,8 @@ namespace Tizen.NUI /// /// Retrieves the element with the specified string key. /// - /// The key whose value to retrieve. - /// The value for the element with the specified key. + /// The key whose value to retrieve + /// The value for the element with the specified key internal PropertyValue ValueOfIndex(string key) { PropertyValue ret = new PropertyValue(NDalicPINVOKE.Property_Map_ValueOfIndex__SWIG_0(swigCPtr, key), false); @@ -1012,8 +1012,8 @@ namespace Tizen.NUI /// /// Retrieves the element with the specified index key. /// - /// The key whose value to retrieve. - /// The value for the element with the specified key. + /// The key whose value to retrieve + /// The value for the element with the specified key internal PropertyValue ValueOfIndex(int key) { PropertyValue ret = new PropertyValue(NDalicPINVOKE.Property_Map_ValueOfIndex__SWIG_2(swigCPtr, key), false); @@ -1106,11 +1106,11 @@ namespace Tizen.NUI /// - /// An extension to the property value class that allows us to create a - /// Property value from a C# object, for example, integer, float, or string.
+ /// Extension to property value class that allows us to create a + /// PropertyValue from a C# object, e.g. int, float, string.
///
- /// An object to create. - /// The created value. + /// An object to create + /// The created value static public PropertyValue CreateFromObject(System.Object obj) { System.Type type = obj.GetType(); @@ -1196,7 +1196,7 @@ namespace Tizen.NUI /// /// Creates a Size2D property value. /// - /// Size2D values. + /// A Size2D values public PropertyValue(Size2D vectorValue) : this(NDalicPINVOKE.new_Property_Value__SWIG_4(Size2D.getCPtr(vectorValue)), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -1205,7 +1205,7 @@ namespace Tizen.NUI /// /// Creates a Position2D property value. /// - /// Position2D values. + /// A Position2D values public PropertyValue(Position2D vectorValue) : this(NDalicPINVOKE.new_Property_Value__SWIG_4(Position2D.getCPtr(vectorValue)), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -1214,7 +1214,7 @@ namespace Tizen.NUI /// /// Creates a Size property value. /// - /// Size values. + /// A Size values internal PropertyValue(Size vectorValue) : this(NDalicPINVOKE.new_Property_Value__SWIG_5(Size.getCPtr(vectorValue)), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -1223,7 +1223,7 @@ namespace Tizen.NUI /// /// Creates a Position property value. /// - /// Position values. + /// A Position values public PropertyValue(Position vectorValue) : this(NDalicPINVOKE.new_Property_Value__SWIG_5(Position.getCPtr(vectorValue)), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -1232,7 +1232,7 @@ namespace Tizen.NUI /// /// Creates a Color property value. /// - /// Color values. + /// A Color values public PropertyValue(Color vectorValue) : this(NDalicPINVOKE.new_Property_Value__SWIG_6(Color.getCPtr(vectorValue)), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -1242,7 +1242,7 @@ namespace Tizen.NUI /// /// Retrieves a Size2D value. /// - /// On return, a Size2D value. + /// On return, a Size2D value public bool Get(Size2D vectorValue) { bool ret = NDalicPINVOKE.Property_Value_Get__SWIG_5(swigCPtr, Size2D.getCPtr(vectorValue)); @@ -1253,7 +1253,7 @@ namespace Tizen.NUI /// /// Retrieves a Position2D value. /// - /// On return, a Position2D value. + /// On return, a Position2D value public bool Get(Position2D vectorValue) { bool ret = NDalicPINVOKE.Property_Value_Get__SWIG_5(swigCPtr, Position2D.getCPtr(vectorValue)); @@ -1264,7 +1264,7 @@ namespace Tizen.NUI /// /// Retrieves a Size value. /// - /// On return, a size value. + /// On return, a Size value internal bool Get(Size vectorValue) { bool ret = NDalicPINVOKE.Property_Value_Get__SWIG_6(swigCPtr, Size.getCPtr(vectorValue)); @@ -1275,7 +1275,7 @@ namespace Tizen.NUI /// /// Retrieves a Position value. /// - /// On return, a position value. + /// On return, a Position value public bool Get(Position vectorValue) { bool ret = NDalicPINVOKE.Property_Value_Get__SWIG_6(swigCPtr, Position.getCPtr(vectorValue)); @@ -1286,7 +1286,7 @@ namespace Tizen.NUI /// /// Retrieves a Color value. /// - /// On return, a color value. + /// On return, a Color value public bool Get(Color vectorValue) { bool ret = NDalicPINVOKE.Property_Value_Get__SWIG_7(swigCPtr, Color.getCPtr(vectorValue)); @@ -1297,7 +1297,7 @@ namespace Tizen.NUI /// - /// The default constructor. + /// Default constructor. /// public PropertyValue() : this(NDalicPINVOKE.new_Property_Value__SWIG_0(), true) { @@ -1307,7 +1307,7 @@ namespace Tizen.NUI /// /// Creates a boolean property value. /// - /// A boolean value. + /// A boolean value public PropertyValue(bool boolValue) : this(NDalicPINVOKE.new_Property_Value__SWIG_1(boolValue), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -1316,7 +1316,7 @@ namespace Tizen.NUI /// /// Creates an integer property value. /// - /// An integer value. + /// An integer value public PropertyValue(int integerValue) : this(NDalicPINVOKE.new_Property_Value__SWIG_2(integerValue), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -1325,7 +1325,7 @@ namespace Tizen.NUI /// /// Creates a float property value. /// - /// A floating-point value. + /// A floating-point value public PropertyValue(float floatValue) : this(NDalicPINVOKE.new_Property_Value__SWIG_3(floatValue), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -1334,7 +1334,7 @@ namespace Tizen.NUI /// /// Creates a Vector2 property value. /// - /// A vector of 2 floating-point values. + /// A vector of 2 floating-point values public PropertyValue(Vector2 vectorValue) : this(NDalicPINVOKE.new_Property_Value__SWIG_4(Vector2.getCPtr(vectorValue)), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -1343,7 +1343,7 @@ namespace Tizen.NUI /// /// Creates a Vector3 property value. /// - /// A vector of 3 floating-point values. + /// A vector of 3 floating-point values public PropertyValue(Vector3 vectorValue) : this(NDalicPINVOKE.new_Property_Value__SWIG_5(Vector3.getCPtr(vectorValue)), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -1352,7 +1352,7 @@ namespace Tizen.NUI /// /// Creates a Vector4 property value. /// - /// A vector of 4 floating-point values. + /// A vector of 4 floating-point values public PropertyValue(Vector4 vectorValue) : this(NDalicPINVOKE.new_Property_Value__SWIG_6(Vector4.getCPtr(vectorValue)), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -1371,7 +1371,7 @@ namespace Tizen.NUI /// /// Creates a Rectangle property value. /// - /// Rectangle values. + /// A Rectangle values public PropertyValue(Rectangle vectorValue) : this(NDalicPINVOKE.new_Property_Value__SWIG_9(Rectangle.getCPtr(vectorValue)), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -1385,7 +1385,7 @@ namespace Tizen.NUI /// /// Creates a Rotation property value. /// - /// Rotation values. + /// A Rotation values public PropertyValue(Rotation quaternion) : this(NDalicPINVOKE.new_Property_Value__SWIG_11(Rotation.getCPtr(quaternion)), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -1394,7 +1394,7 @@ namespace Tizen.NUI /// /// Creates a string property value. /// - /// A string. + /// A string public PropertyValue(string stringValue) : this(NDalicPINVOKE.new_Property_Value__SWIG_12(stringValue), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -1403,7 +1403,7 @@ namespace Tizen.NUI /// /// Creates an array property value. /// - /// An array. + /// An array public PropertyValue(PropertyArray arrayValue) : this(NDalicPINVOKE.new_Property_Value__SWIG_14(PropertyArray.getCPtr(arrayValue)), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -1412,7 +1412,7 @@ namespace Tizen.NUI /// /// Creates a map property value. /// - /// An array. + /// An array public PropertyValue(PropertyMap mapValue) : this(NDalicPINVOKE.new_Property_Value__SWIG_15(PropertyMap.getCPtr(mapValue)), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -1421,7 +1421,7 @@ namespace Tizen.NUI /// /// Creates a PropertyType value. /// - /// A PropertyType value. + /// A PropertyType values public PropertyValue(PropertyType type) : this(NDalicPINVOKE.new_Property_Value__SWIG_16((int)type), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -1430,7 +1430,7 @@ namespace Tizen.NUI /// /// Creates a PropertyValue value. /// - /// A PropertyValue value. + /// A PropertyValue values public PropertyValue(PropertyValue value) : this(NDalicPINVOKE.new_Property_Value__SWIG_17(PropertyValue.getCPtr(value)), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -1440,7 +1440,7 @@ namespace Tizen.NUI /// Queries the type of this property value. /// /// The type ID - public new PropertyType GetType() + public PropertyType GetType() { PropertyType ret = (PropertyType)NDalicPINVOKE.Property_Value_GetType(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -1450,8 +1450,8 @@ namespace Tizen.NUI /// /// Retrieves a boolean value. /// - /// On return, a boolean value. - /// Returns true if the value is successfully retrieved, false if the type is not convertible. + /// On return, a boolean value + /// Returns true if the value is successfully retrieved, false if the type is not convertible public bool Get(out bool boolValue) { bool ret = NDalicPINVOKE.Property_Value_Get__SWIG_1(swigCPtr, out boolValue); @@ -1462,8 +1462,8 @@ namespace Tizen.NUI /// /// Retrieves a floating-point value. /// - /// On return, a floating-point value. - /// Returns true if the value is successfully retrieved, false if the type is not convertible. + /// On return, a floating-point value + /// Returns true if the value is successfully retrieved, false if the type is not convertible public bool Get(out float floatValue) { bool ret = NDalicPINVOKE.Property_Value_Get__SWIG_2(swigCPtr, out floatValue); @@ -1472,10 +1472,10 @@ namespace Tizen.NUI } /// - /// Retrieves an integer value. + /// Retrieves a integer value. /// - /// On return, an integer value. - /// Returns true if the value is successfully retrieved, false if the type is not convertible. + /// On return, a integer value + /// Returns true if the value is successfully retrieved, false if the type is not convertible public bool Get(out int integerValue) { bool ret = NDalicPINVOKE.Property_Value_Get__SWIG_3(swigCPtr, out integerValue); @@ -1486,8 +1486,8 @@ namespace Tizen.NUI /// /// Retrieves an integer rectangle. /// - /// On return, an integer rectangle. - /// Returns true if the value is successfully retrieved, false if the type is not convertible. + /// On return, an integer rectangle + /// Returns true if the value is successfully retrieved, false if the type is not convertible public bool Get(Rectangle rect) { bool ret = NDalicPINVOKE.Property_Value_Get__SWIG_4(swigCPtr, Rectangle.getCPtr(rect)); @@ -1498,8 +1498,8 @@ namespace Tizen.NUI /// /// Retrieves a vector value. /// - /// On return, a vector value. - /// Returns true if the value is successfully retrieved, false if the type is not convertible. + /// On return, a vector value + /// Returns true if the value is successfully retrieved, false if the type is not convertible public bool Get(Vector2 vectorValue) { bool ret = NDalicPINVOKE.Property_Value_Get__SWIG_5(swigCPtr, Vector2.getCPtr(vectorValue)); @@ -1510,8 +1510,8 @@ namespace Tizen.NUI /// /// Retrieves a vector value. /// - /// On return, a vector value. - /// Returns true if the value is successfully retrieved, false if the type is not convertible. + /// On return, a vector value + /// Returns true if the value is successfully retrieved, false if the type is not convertible public bool Get(Vector3 vectorValue) { bool ret = NDalicPINVOKE.Property_Value_Get__SWIG_6(swigCPtr, Vector3.getCPtr(vectorValue)); @@ -1522,8 +1522,8 @@ namespace Tizen.NUI /// /// Retrieves a vector value. /// - /// On return, a vector value. - /// Returns true if the value is successfully retrieved, false if the type is not convertible. + /// On return, a vector value + /// Returns true if the value is successfully retrieved, false if the type is not convertible public bool Get(Vector4 vectorValue) { bool ret = NDalicPINVOKE.Property_Value_Get__SWIG_7(swigCPtr, Vector4.getCPtr(vectorValue)); @@ -1555,8 +1555,8 @@ namespace Tizen.NUI /// /// Retrieves a Rotation value. /// - /// On return, a rotation value. - /// Returns true if the value is successfully retrieved, false if the type is not convertible. + /// On return, a Rotation value + /// Returns true if the value is successfully retrieved, false if the type is not convertible public bool Get(Rotation quaternionValue) { bool ret = NDalicPINVOKE.Property_Value_Get__SWIG_11(swigCPtr, Rotation.getCPtr(quaternionValue)); @@ -1567,8 +1567,8 @@ namespace Tizen.NUI /// /// Retrieves a string property value. /// - /// On return, a string. - /// Returns true if the value is successfully retrieved, false if the type is not convertible. + /// On return, a string + /// Returns true if the value is successfully retrieved, false if the type is not convertible public bool Get(out string stringValue) { bool ret = NDalicPINVOKE.Property_Value_Get__SWIG_12(swigCPtr, out stringValue); @@ -1579,8 +1579,8 @@ namespace Tizen.NUI /// /// Retrieves an array property value. /// - /// On return, the array as a vector property values. - /// Returns true if the value is successfully retrieved, false if the type is not convertible. + /// On return, the array as a vector Property Values + /// Returns true if the value is successfully retrieved, false if the type is not convertible public bool Get(PropertyArray arrayValue) { bool ret = NDalicPINVOKE.Property_Value_Get__SWIG_13(swigCPtr, PropertyArray.getCPtr(arrayValue)); @@ -1589,10 +1589,10 @@ namespace Tizen.NUI } /// - /// Retrieves a map property value. + /// Retrieves an map property value. /// - /// On return, the map as vector of string and property value pairs. - /// Returns true if the value is successfully retrieved, false if the type is not convertible. + /// On return, the map as vector of string and Property Value pairs + /// Returns true if the value is successfully retrieved, false if the type is not convertible public bool Get(PropertyMap mapValue) { bool ret = NDalicPINVOKE.Property_Value_Get__SWIG_14(swigCPtr, PropertyMap.getCPtr(mapValue)); diff --git a/src/Tizen.NUI/src/public/PropertyNotifySignal.cs b/src/Tizen.NUI/src/public/PropertyNotifySignal.cs index cfef507fd..491900735 100755 --- a/src/Tizen.NUI/src/public/PropertyNotifySignal.cs +++ b/src/Tizen.NUI/src/public/PropertyNotifySignal.cs @@ -119,7 +119,7 @@ namespace Tizen.NUI public void Connect(System.Delegate func) { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); { NDalicPINVOKE.PropertyNotifySignal_Connect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -128,7 +128,7 @@ namespace Tizen.NUI public void Disconnect(System.Delegate func) { - System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); + System.IntPtr ip = System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(func); { NDalicPINVOKE.PropertyNotifySignal_Disconnect(swigCPtr, new System.Runtime.InteropServices.HandleRef(this, ip)); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); diff --git a/src/Tizen.NUI/src/public/Radian.cs b/src/Tizen.NUI/src/public/Radian.cs index 439a5e92e..16bb8970e 100755 --- a/src/Tizen.NUI/src/public/Radian.cs +++ b/src/Tizen.NUI/src/public/Radian.cs @@ -101,7 +101,7 @@ namespace Tizen.NUI /// - /// The default constructor, initializes to 0. + /// Default constructor, initializes to 0. /// public Radian() : this(NDalicPINVOKE.new_Radian__SWIG_0(), true) { @@ -111,7 +111,7 @@ namespace Tizen.NUI /// /// Creates an angle in radians. /// - /// The initial value in radians. + /// The initial value in radians public Radian(float value) : this(NDalicPINVOKE.new_Radian__SWIG_1(value), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -120,7 +120,7 @@ namespace Tizen.NUI /// /// Creates an angle in radians from an angle in degrees. /// - /// The initial value in degrees. + /// The initial value in degrees public Radian(Degree degree) : this(NDalicPINVOKE.new_Radian__SWIG_2(Degree.getCPtr(degree)), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -129,7 +129,7 @@ namespace Tizen.NUI /// /// Conversion to float. /// - /// The float value of this radian. + /// The float value of this Radian public float ConvertToFloat() { float ret = NDalicPINVOKE.Radian_ConvertToFloat(swigCPtr); @@ -138,7 +138,7 @@ namespace Tizen.NUI } /// - /// The value in radians. + /// The value in radians /// public float Value { diff --git a/src/Tizen.NUI/src/public/Rectangle.cs b/src/Tizen.NUI/src/public/Rectangle.cs index 04528475f..c601cbbd7 100755 --- a/src/Tizen.NUI/src/public/Rectangle.cs +++ b/src/Tizen.NUI/src/public/Rectangle.cs @@ -18,7 +18,7 @@ namespace Tizen.NUI { /// - /// The Rectangle class. + /// Rectangle class /// public class Rectangle : global::System.IDisposable { @@ -100,11 +100,11 @@ namespace Tizen.NUI } /// - /// THe Equality operator. + /// Equality operator. /// - /// The first operand. - /// The second operand. - /// True if the boxes are exactly the same. + /// First operand + /// Second operand + /// True if boxes are exactly same public static bool operator ==(Rectangle a, Rectangle b) { // If both are null, or both are same instance, return true. @@ -124,18 +124,18 @@ namespace Tizen.NUI } /// - /// The Inequality operator. + /// Inequality operator. /// - /// The first rectangle. - /// The second rectangle. - /// True if the rectangles are not identical. + /// The first rectangle + /// The second rectangle + /// True if rectangles are not identical public static bool operator !=(Rectangle a, Rectangle b) { return !(a == b); } /// - /// The x position of the rectangle. + /// X position of the rectangle /// public int X { @@ -150,7 +150,7 @@ namespace Tizen.NUI } /// - /// The Y position of the rectangle. + /// Y position of the rectangle /// public int Y { @@ -165,7 +165,7 @@ namespace Tizen.NUI } /// - /// The width of the rectangle. + /// Width of the rectangle /// public int Width { @@ -180,7 +180,7 @@ namespace Tizen.NUI } /// - /// The height of the rectangle. + /// Height of the rectangle /// public int Height { @@ -195,7 +195,7 @@ namespace Tizen.NUI } /// - /// The constructor. + /// Constructor. /// public Rectangle() : this(NDalicPINVOKE.new_Rectangle__SWIG_0(), true) { @@ -203,12 +203,12 @@ namespace Tizen.NUI } /// - /// The constructor. + /// Constructor. /// - /// The x coordinate (or left). - /// The y coordinate (or right). - /// The width (or bottom). - /// The height (or top). + /// X coordinate (or left) + /// Y coordinate (or right) + /// Width (or bottom) + /// Height (or top) public Rectangle(int x, int y, int width, int height) : this(NDalicPINVOKE.new_Rectangle__SWIG_1(x, y, width, height), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -217,10 +217,10 @@ namespace Tizen.NUI /// /// Assignment from individual values. /// - /// The x coordinate. - /// The y coordinate. - /// The width. - /// The height./param> + /// X coordinate + /// Y coordinate + /// Width + /// Height public void Set(int newX, int newY, int newWidth, int newHeight) { NDalicPINVOKE.Rectangle_Set(swigCPtr, newX, newY, newWidth, newHeight); @@ -228,9 +228,9 @@ namespace Tizen.NUI } /// - /// Determines whether or not this rectangle is empty. + /// Determines whether or not this Rectangle is empty. /// - /// True if width or height are zero. + /// True if width or height are zero public bool IsEmpty() { bool ret = NDalicPINVOKE.Rectangle_IsEmpty(swigCPtr); @@ -241,7 +241,7 @@ namespace Tizen.NUI /// /// Gets the left of the rectangle. /// - /// The left edge of the rectangle. + /// The left edge of the rectangle public int Left() { int ret = NDalicPINVOKE.Rectangle_Left(swigCPtr); @@ -252,7 +252,7 @@ namespace Tizen.NUI /// /// Gets the right of the rectangle. /// - /// The right edge of the rectangle. + /// The right edge of the rectangle public int Right() { int ret = NDalicPINVOKE.Rectangle_Right(swigCPtr); @@ -263,7 +263,7 @@ namespace Tizen.NUI /// /// Gets the top of the rectangle. /// - /// The top of the rectangle. + /// The top of the rectangle public int Top() { int ret = NDalicPINVOKE.Rectangle_Top(swigCPtr); @@ -274,7 +274,7 @@ namespace Tizen.NUI /// /// Gets the bottom of the rectangle. /// - /// The bottom of the rectangle. + /// The bottom of the rectangle public int Bottom() { int ret = NDalicPINVOKE.Rectangle_Bottom(swigCPtr); @@ -285,7 +285,7 @@ namespace Tizen.NUI /// /// Gets the area of the rectangle. /// - /// The area of the rectangle. + /// The area of the rectangle public int Area() { int ret = NDalicPINVOKE.Rectangle_Area(swigCPtr); @@ -296,8 +296,8 @@ namespace Tizen.NUI /// /// Determines whether or not this rectangle and the specified rectangle intersect. /// - /// The other rectangle to test against this rectangle. - /// True if the rectangles intersect. + /// The other rectangle to test against this rectangle + /// True if the rectangles intersect public bool Intersects(Rectangle other) { bool ret = NDalicPINVOKE.Rectangle_Intersects(swigCPtr, Rectangle.getCPtr(other)); @@ -306,10 +306,10 @@ namespace Tizen.NUI } /// - /// Determines whether or not this rectangle contains the specified rectangle. + /// Determines whether or not this Rectangle contains the specified rectangle. /// - /// The other rectangle to test against this rectangle. - /// True if the specified rectangle is contained. + /// The other rectangle to test against this rectangle + /// True if the specified rectangle is contained public bool Contains(Rectangle other) { bool ret = NDalicPINVOKE.Rectangle_Contains(swigCPtr, Rectangle.getCPtr(other)); diff --git a/src/Tizen.NUI/src/public/RelativeVector2.cs b/src/Tizen.NUI/src/public/RelativeVector2.cs index 77194037a..de4f503ff 100755 --- a/src/Tizen.NUI/src/public/RelativeVector2.cs +++ b/src/Tizen.NUI/src/public/RelativeVector2.cs @@ -20,8 +20,8 @@ namespace Tizen.NUI { /// - /// RelativeVector2 is a two-dimensional vector. - /// Both values (x and y) should be between [0, 1]. + /// RelativeVector2 is a two dimensional vector. + /// Both values(x and y) should be between [0, 1]. /// public class RelativeVector2 : global::System.IDisposable { @@ -104,11 +104,11 @@ namespace Tizen.NUI /// - /// The addition operator. + /// Addition operator. /// - /// The vector to add. - /// The vector to add. - /// The vector containing the result of the addition. + /// Vector to add + /// Vector to add + /// A vector containing the result of the addition public static RelativeVector2 operator +(RelativeVector2 arg1, RelativeVector2 arg2) { RelativeVector2 result = arg1.Add(arg2); @@ -117,11 +117,11 @@ namespace Tizen.NUI } /// - /// The subtraction operator. + /// Subtraction operator. /// - /// The vector to subtract. - /// The vector to subtract. - /// The vector containing the result of the subtraction. + /// Vector to subtract + /// Vector to subtract + /// A vector containing the result of the subtraction public static RelativeVector2 operator -(RelativeVector2 arg1, RelativeVector2 arg2) { RelativeVector2 result = arg1.Subtract(arg2); @@ -130,11 +130,11 @@ namespace Tizen.NUI } /// - /// The multiplication operator. + /// Multiplication operator. /// - /// The vector to multiply. - /// The vector to multiply. - /// The vector containing the result of the multiplication. + /// The vector to multiply + /// The vector to multiply + /// A vector containing the result of the multiplication public static RelativeVector2 operator *(RelativeVector2 arg1, RelativeVector2 arg2) { RelativeVector2 result = arg1.Multiply(arg2); @@ -143,11 +143,11 @@ namespace Tizen.NUI } /// - /// The multiplication operator. + /// Multiplication operator. /// - /// The vector to multiply. - /// The float value to scale the vector. - /// The vector containing the result of the scaling. + /// The vector to multiply + /// The float value to scale the vector + /// A vector containing the result of the scaling public static RelativeVector2 operator *(RelativeVector2 arg1, float arg2) { RelativeVector2 result = arg1.Multiply(arg2); @@ -156,11 +156,11 @@ namespace Tizen.NUI } /// - /// The division operator. + /// Division operator. /// - /// The vector to divide. - /// The vector to divide. - /// The vector containing the result of the division. + /// The vector to divide + /// The vector to divide + /// A vector containing the result of the division public static RelativeVector2 operator /(RelativeVector2 arg1, RelativeVector2 arg2) { RelativeVector2 result = arg1.Divide(arg2); @@ -169,11 +169,11 @@ namespace Tizen.NUI } /// - /// The division operator. + /// Division operator. /// - /// The vector to divide. - /// The float value to scale the vector by. - /// The vector containing the result of the scaling. + /// The vector to divide + /// The float value to scale the vector by + /// A vector containing the result of the scaling public static RelativeVector2 operator /(RelativeVector2 arg1, float arg2) { RelativeVector2 result = arg1.Divide(arg2); @@ -183,10 +183,10 @@ namespace Tizen.NUI /// - /// The const array subscript operator overload. Should be 0, 1. + /// Const array subscript operator overload. Should be 0, 1. /// - /// The subscript index. - /// The float at the given index. + /// Subscript index + /// The float at the given index public float this[uint index] { get @@ -206,7 +206,7 @@ namespace Tizen.NUI /// - /// The constructor. + /// Constructor /// public RelativeVector2() : this(NDalicPINVOKE.new_Vector2__SWIG_0(), true) { @@ -214,10 +214,10 @@ namespace Tizen.NUI } /// - /// The constructor. + /// Constructor /// - /// The x component. - /// The y component. + /// x component + /// y component public RelativeVector2(float x, float y) : this(NDalicPINVOKE.new_Vector2__SWIG_1(x, y), true) { ValueCheck(x); @@ -226,18 +226,18 @@ namespace Tizen.NUI } /// - /// The constructor. + /// Constructor /// - /// The RelativeVector3 to create this vector from. + /// RelativeVector3 to create this vector from public RelativeVector2(RelativeVector3 relativeVector3) : this(NDalicPINVOKE.new_Vector2__SWIG_3(RelativeVector3.getCPtr(relativeVector3)), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } /// - /// The constructor. + /// Constructor /// - /// The RelativeVector4 to create this vector from. + /// RelativeVector4 to create this vector from public RelativeVector2(RelativeVector4 relativeVector4) : this(NDalicPINVOKE.new_Vector2__SWIG_4(RelativeVector4.getCPtr(relativeVector4)), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -294,10 +294,10 @@ namespace Tizen.NUI } /// - /// Compares if the rhs is equal to. + /// Compare if rhs is equal to /// - /// The vector to compare. - /// Returns true if the two vectors are equal, otherwise false. + /// The vector to compare + /// Returns true if the two vectors are equal, otherwise false public bool EqualTo(RelativeVector2 rhs) { bool ret = NDalicPINVOKE.Vector2_EqualTo(swigCPtr, RelativeVector2.getCPtr(rhs)); @@ -306,10 +306,10 @@ namespace Tizen.NUI } /// - /// Compares if the rhs is not equal to. + /// Compare if rhs is not equal to /// - /// The vector to compare. - /// Returns true if the two vectors are not equal, otherwise false. + /// The vector to compare + /// Returns true if the two vectors are not equal, otherwise false public bool NotEqualTo(RelativeVector2 rhs) { bool ret = NDalicPINVOKE.Vector2_NotEqualTo(swigCPtr, RelativeVector2.getCPtr(rhs)); @@ -319,7 +319,7 @@ namespace Tizen.NUI /// - /// The x component. + /// x component /// public float X { @@ -338,7 +338,7 @@ namespace Tizen.NUI } /// - /// The y component. + /// y component /// public float Y { diff --git a/src/Tizen.NUI/src/public/RelativeVector3.cs b/src/Tizen.NUI/src/public/RelativeVector3.cs index 46d7e8f7c..d83d7b0c6 100755 --- a/src/Tizen.NUI/src/public/RelativeVector3.cs +++ b/src/Tizen.NUI/src/public/RelativeVector3.cs @@ -20,8 +20,8 @@ namespace Tizen.NUI { /// - /// RelativeVector3 is a three-dimensional vector. - /// All values (x, y, z and w) should be between [0, 1]. + /// RelativeVector3 is a three dimensional vector. + /// All values(x, y, z and w) should be between [0, 1]. /// public class RelativeVector3 : global::System.IDisposable { @@ -104,11 +104,11 @@ namespace Tizen.NUI /// - /// The addition operator. + /// Addition operator. /// - /// The vector to add. - /// Th vector to add. - /// The vector containing the result of the addition. + /// Vector to add + /// Vector to add + /// A vector containing the result of the addition public static RelativeVector3 operator +(RelativeVector3 arg1, RelativeVector3 arg2) { RelativeVector3 result = arg1.Add(arg2); @@ -117,11 +117,11 @@ namespace Tizen.NUI } /// - /// The subtraction operator. + /// Subtraction operator. /// - /// The vector to subtract. - /// The vector to subtract. - /// The vector containing the result of the subtraction. + /// Vector to subtract + /// Vector to subtract + /// A vector containing the result of the subtraction public static RelativeVector3 operator -(RelativeVector3 arg1, RelativeVector3 arg2) { RelativeVector3 result = arg1.Subtract(arg2); @@ -130,11 +130,11 @@ namespace Tizen.NUI } /// - /// The multiplication operator. + /// Multiplication operator. /// - /// The vector to multiply. - /// The vector to multiply. - /// The vector containing the result of the multiplication. + /// The vector to multiply + /// The vector to multiply + /// A vector containing the result of the multiplication public static RelativeVector3 operator *(RelativeVector3 arg1, RelativeVector3 arg2) { RelativeVector3 result = arg1.Multiply(arg2); @@ -143,11 +143,11 @@ namespace Tizen.NUI } /// - /// The multiplication operator. + /// Multiplication operator. /// - /// The vector to multiply. - /// The float value to scale the vector. - /// The vector containing the result of the scaling. + /// The vector to multiply + /// The float value to scale the vector + /// A vector containing the result of the scaling public static RelativeVector3 operator *(RelativeVector3 arg1, float arg2) { RelativeVector3 result = arg1.Multiply(arg2); @@ -156,11 +156,11 @@ namespace Tizen.NUI } /// - /// The division operator. + /// Division operator. /// - /// The vector to divide. - /// The vector to divide. - /// The vector containing the result of the division. + /// The vector to divide + /// The vector to divide + /// A vector containing the result of the division public static RelativeVector3 operator /(RelativeVector3 arg1, RelativeVector3 arg2) { RelativeVector3 result = arg1.Divide(arg2); @@ -169,11 +169,11 @@ namespace Tizen.NUI } /// - /// The division operator. + /// Division operator. /// - /// The vector to divide. - /// The float value to scale the vector by. - /// The vector containing the result of the scaling. + /// The vector to divide + /// The float value to scale the vector by + /// A vector containing the result of the scaling public static RelativeVector3 operator /(RelativeVector3 arg1, float arg2) { RelativeVector3 result = arg1.Divide(arg2); @@ -183,10 +183,10 @@ namespace Tizen.NUI /// - /// The const array subscript operator overload. Should be 0, 1 or 2. + /// Const array subscript operator overload. Should be 0, 1 or 2. /// - /// The subscript index. - /// The float at the given index. + /// Subscript index + /// The float at the given index public float this[uint index] { get @@ -206,7 +206,7 @@ namespace Tizen.NUI /// - /// The constructor. + /// Constructor /// public RelativeVector3() : this(NDalicPINVOKE.new_Vector3__SWIG_0(), true) { @@ -214,11 +214,11 @@ namespace Tizen.NUI } /// - /// The constructor. + /// Constructor /// - /// The x component. - /// The y component. - /// The z component. + /// x component + /// y component + /// z component public RelativeVector3(float x, float y, float z) : this(NDalicPINVOKE.new_Vector3__SWIG_1(x, y, z), true) { ValueCheck(x); @@ -228,18 +228,18 @@ namespace Tizen.NUI } /// - /// The constructor. + /// Constructor /// - /// The RelativeVector2 to create this vector from. + /// RelativeVector2 to create this vector from public RelativeVector3(RelativeVector2 relativeVector2) : this(NDalicPINVOKE.new_Vector3__SWIG_3(RelativeVector2.getCPtr(relativeVector2)), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } /// - /// The constructor. + /// Constructor /// - /// The RelativeVector4 to create this vector from. + /// RelativeVector4 to create this vector from public RelativeVector3(RelativeVector4 relativeVector4) : this(NDalicPINVOKE.new_Vector3__SWIG_4(RelativeVector4.getCPtr(relativeVector4)), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -296,10 +296,10 @@ namespace Tizen.NUI } /// - /// Compares if the rhs is equal to. + /// Compare if rhs is equal to /// - /// The vector to compare. - /// Returns true if the two vectors are equal, otherwise false. + /// The vector to compare + /// Returns true if the two vectors are equal, otherwise false public bool EqualTo(RelativeVector3 rhs) { bool ret = NDalicPINVOKE.Vector3_EqualTo(swigCPtr, RelativeVector3.getCPtr(rhs)); @@ -308,10 +308,10 @@ namespace Tizen.NUI } /// - /// Compares if the rhs is not equal to. + /// Compare if rhs is not equal to /// - /// The vector to compare. - /// Returns true if the two vectors are not equal, otherwise false. + /// The vector to compare + /// Returns true if the two vectors are not equal, otherwise false public bool NotEqualTo(RelativeVector3 rhs) { bool ret = NDalicPINVOKE.Vector3_NotEqualTo(swigCPtr, RelativeVector3.getCPtr(rhs)); @@ -321,7 +321,7 @@ namespace Tizen.NUI /// - /// The x component. + /// x component /// public float X { @@ -340,7 +340,7 @@ namespace Tizen.NUI } /// - /// The y component. + /// y component /// public float Y { @@ -359,7 +359,7 @@ namespace Tizen.NUI } /// - /// The z component. + /// z component /// public float Z { diff --git a/src/Tizen.NUI/src/public/RelativeVector4.cs b/src/Tizen.NUI/src/public/RelativeVector4.cs index ee226cb49..4ab36717a 100755 --- a/src/Tizen.NUI/src/public/RelativeVector4.cs +++ b/src/Tizen.NUI/src/public/RelativeVector4.cs @@ -20,8 +20,8 @@ namespace Tizen.NUI { /// - /// RelativeVector4 is a four-dimensional vector. - /// All values (x, y, and z) should be between [0, 1]. + /// RelativeVector4 is a four dimensional vector. + /// All values(x, y, and z) should be between [0, 1]. /// public class RelativeVector4 : global::System.IDisposable { @@ -104,11 +104,11 @@ namespace Tizen.NUI /// - /// The addition operator. + /// Addition operator. /// - /// The vector to add. - /// The vector to add. - /// The vector containing the result of the addition. + /// Vector to add + /// Vector to add + /// A vector containing the result of the addition public static RelativeVector4 operator +(RelativeVector4 arg1, RelativeVector4 arg2) { RelativeVector4 result = arg1.Add(arg2); @@ -117,11 +117,11 @@ namespace Tizen.NUI } /// - /// The subtraction operator. + /// Subtraction operator. /// - /// The vector to subtract. - /// The vector to subtract. - /// The vector containing the result of the subtraction. + /// Vector to subtract + /// Vector to subtract + /// A vector containing the result of the subtraction public static RelativeVector4 operator -(RelativeVector4 arg1, RelativeVector4 arg2) { RelativeVector4 result = arg1.Subtract(arg2); @@ -130,11 +130,11 @@ namespace Tizen.NUI } /// - /// The multiplication operator. + /// Multiplication operator. /// - /// The vector to multiply. - /// The vector to multiply. - /// The vector containing the result of the multiplication. + /// The vector to multiply + /// The vector to multiply + /// A vector containing the result of the multiplication public static RelativeVector4 operator *(RelativeVector4 arg1, RelativeVector4 arg2) { RelativeVector4 result = arg1.Multiply(arg2); @@ -143,11 +143,11 @@ namespace Tizen.NUI } /// - /// The multiplication operator. + /// Multiplication operator. /// - /// The vector to multiply. - /// The float value to scale the vector. - /// The vector containing the result of the scaling. + /// The vector to multiply + /// The float value to scale the vector + /// A vector containing the result of the scaling public static RelativeVector4 operator *(RelativeVector4 arg1, float arg2) { RelativeVector4 result = arg1.Multiply(arg2); @@ -156,11 +156,11 @@ namespace Tizen.NUI } /// - /// The division operator. + /// Division operator. /// - /// The vector to divide. - /// The vector to divide. - /// The vector containing the result of the division. + /// The vector to divide + /// The vector to divide + /// A vector containing the result of the division public static RelativeVector4 operator /(RelativeVector4 arg1, RelativeVector4 arg2) { RelativeVector4 result = arg1.Divide(arg2); @@ -169,11 +169,11 @@ namespace Tizen.NUI } /// - /// The division operator. + /// Division operator. /// - /// The vector to divide. - /// The float value to scale the vector by. - /// The vector containing the result of the scaling. + /// The vector to divide + /// The float value to scale the vector by + /// A vector containing the result of the scaling public static RelativeVector4 operator /(RelativeVector4 arg1, float arg2) { RelativeVector4 result = arg1.Divide(arg2); @@ -183,10 +183,10 @@ namespace Tizen.NUI /// - /// The const array subscript operator overload. Should be 0, 1 3 or 3. + /// Const array subscript operator overload. Should be 0, 1 3 or 3. /// - /// The subscript index. - /// The float at the given index. + /// Subscript index + /// The float at the given index public float this[uint index] { get @@ -206,7 +206,7 @@ namespace Tizen.NUI /// - /// The constructor. + /// Constructor /// public RelativeVector4() : this(NDalicPINVOKE.new_Vector4__SWIG_0(), true) { @@ -214,12 +214,12 @@ namespace Tizen.NUI } /// - /// The constructor. + /// Constructor /// - /// The x component. - /// The y component. - /// The z component. - /// The w component. + /// x component + /// y component + /// z component + /// w component public RelativeVector4(float x, float y, float z, float w) : this(NDalicPINVOKE.new_Vector4__SWIG_1(x, y, z, w), true) { ValueCheck(x); @@ -230,18 +230,18 @@ namespace Tizen.NUI } /// - /// The constructor. + /// Constructor /// - /// The RelativeVector2 to create this vector from. + /// RelativeVector2 to create this vector from public RelativeVector4(RelativeVector2 relativeVector2) : this(NDalicPINVOKE.new_Vector4__SWIG_3(RelativeVector2.getCPtr(relativeVector2)), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } /// - /// The constructor. + /// Constructor /// - /// The RelativeVector3 to create this vector from. + /// RelativeVector3 to create this vector from public RelativeVector4(RelativeVector3 relativeVector3) : this(NDalicPINVOKE.new_Vector4__SWIG_4(RelativeVector3.getCPtr(relativeVector3)), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -297,10 +297,10 @@ namespace Tizen.NUI } /// - /// Compares if the rhs is equal to. + /// Compare if rhs is equal to /// - /// The vector to compare. - /// Returns true if the two vectors are equal, otherwise false. + /// The vector to compare + /// Returns true if the two vectors are equal, otherwise false public bool EqualTo(RelativeVector4 rhs) { bool ret = NDalicPINVOKE.Vector4_EqualTo(swigCPtr, RelativeVector4.getCPtr(rhs)); @@ -309,10 +309,10 @@ namespace Tizen.NUI } /// - /// Compares if the rhs is not equal to. + /// Compare if rhs is not equal to /// - /// The vector to compare. - /// Returns true if the two vectors are not equal, otherwise false. + /// The vector to compare + /// Returns true if the two vectors are not equal, otherwise false public bool NotEqualTo(RelativeVector4 rhs) { bool ret = NDalicPINVOKE.Vector4_NotEqualTo(swigCPtr, RelativeVector4.getCPtr(rhs)); @@ -322,7 +322,7 @@ namespace Tizen.NUI /// - /// The x component. + /// x component /// public float X { @@ -341,7 +341,7 @@ namespace Tizen.NUI } /// - /// The y component. + /// y component /// public float Y { @@ -360,7 +360,7 @@ namespace Tizen.NUI } /// - /// The z component. + /// z component /// public float Z { @@ -379,7 +379,7 @@ namespace Tizen.NUI } /// - /// The w component. + /// w component /// public float W { diff --git a/src/Tizen.NUI/src/public/RelayoutContainer.cs b/src/Tizen.NUI/src/public/RelayoutContainer.cs index 73bc081f3..dae6cc8a7 100755 --- a/src/Tizen.NUI/src/public/RelayoutContainer.cs +++ b/src/Tizen.NUI/src/public/RelayoutContainer.cs @@ -21,7 +21,7 @@ namespace Tizen.NUI { using Tizen.NUI.BaseComponents; /// - /// An interface to encapsulate the information required for relayout. + /// Interface to encapsulate information required for relayout. /// public class RelayoutContainer : global::System.IDisposable { @@ -54,7 +54,7 @@ namespace Tizen.NUI } /// - /// To make the RelayoutContainer instance be disposed. + /// To make RelayoutContainer instance be disposed. /// public void Dispose() { @@ -108,8 +108,8 @@ namespace Tizen.NUI /// /// Adds relayout information to the container if it doesn't already exist. /// - /// The view to relayout. - /// The size to relayout. + /// The view to relayout + /// The size to relayout public virtual void Add(View view, Size2D size) { NDalicPINVOKE.RelayoutContainer_Add(swigCPtr, View.getCPtr(view), Size2D.getCPtr(size)); diff --git a/src/Tizen.NUI/src/public/Rotation.cs b/src/Tizen.NUI/src/public/Rotation.cs index 0de9829ab..ff9cf98e5 100755 --- a/src/Tizen.NUI/src/public/Rotation.cs +++ b/src/Tizen.NUI/src/public/Rotation.cs @@ -18,7 +18,7 @@ namespace Tizen.NUI { /// - /// The Rotation class. + /// Rotation Class /// public class Rotation : global::System.IDisposable { @@ -51,7 +51,7 @@ namespace Tizen.NUI } /// - /// To make the Rotation instance be disposed. + /// To make Rotation instance be disposed. /// public void Dispose() { @@ -103,94 +103,94 @@ namespace Tizen.NUI } /// - /// The addition operator. + /// Addition operator. /// - /// The first rotation. - /// The second rotation. - /// The rotation containing the result of the addition. + /// First Rotation + /// Second Rotation + /// A Rotation containing the result of the Addition public static Rotation operator +(Rotation arg1, Rotation arg2) { return arg1.Add(arg2); } /// - /// The subtraction operator. + /// Subtraction operator. /// - /// The first rotation. - /// The second rotation. - /// The rotation containing the result of the subtraction. + /// First Rotation + /// Second Rotation + /// A Rotation containing the result of the subtract public static Rotation operator -(Rotation arg1, Rotation arg2) { return arg1.Subtract(arg2); } /// - /// The unary negation operator. + /// Unary Negation operator. /// - /// The first rotation. - /// The rotation containing the negated result. + /// First Rotation + /// A Rotation containing the negated result public static Rotation operator -(Rotation arg1) { return arg1.Subtract(); } /// - /// The multiplication operator. + /// Multiplication operator. /// - /// The first rotation. - /// The second rotation. - /// The rotation containing the result of the multiplication. + /// First Rotation + /// Second Rotation + /// A Rotation containing the result of the Multiplication public static Rotation operator *(Rotation arg1, Rotation arg2) { return arg1.Multiply(arg2); } /// - /// The multiplication operator. + /// Multiplication operator. /// - /// Rotation. - /// The vector to multiply. - /// The rotation containing the result of the multiplication. + /// Rotation + /// The vector to multiply + /// A Rotation containing the result of the multiplication public static Vector3 operator *(Rotation arg1, Vector3 arg2) { return arg1.Multiply(arg2); } /// - /// The scale operator. + /// Scale operator. /// - /// Rotation. - /// A value to scale by. - /// The rotation containing the result of scaling. + /// Rotation + /// A value to scale by + /// A Rotation containing the result of the scaling public static Rotation operator *(Rotation arg1, float arg2) { return arg1.Multiply(arg2); } /// - /// The division operator. + /// Division operator. /// - /// The first rotation. - /// The second rotation. - /// The rotation containing the result of scaling. + /// First Rotation + /// Second Rotation + /// A Rotation containing the result of the scaling public static Rotation operator /(Rotation arg1, Rotation arg2) { return arg1.Divide(arg2); } /// - /// The scale operator. + /// Scale operator. /// - /// Rotation. - /// A value to scale by. - /// The rotation containing the result of scaling. + /// Rotation + /// A value to scale by + /// A Rotation containing the result of the scaling public static Rotation operator /(Rotation arg1, float arg2) { return arg1.Divide(arg2); } /// - /// The default constructor. + /// Default Constructor. /// public Rotation() : this(NDalicPINVOKE.new_Rotation__SWIG_0(), true) { @@ -198,17 +198,17 @@ namespace Tizen.NUI } /// - /// The constructor from an axis and angle. + /// Constructor from an axis and angle. /// - /// The angle around the axis. - /// The vector of the axis. + /// The angle around the axis + /// The vector of the axis public Rotation(Radian angle, Vector3 axis) : this(NDalicPINVOKE.new_Rotation__SWIG_1(Radian.getCPtr(angle), Vector3.getCPtr(axis)), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } /// - /// (0.0f,0.0f,0.0f,1.0f). + /// (0.0f,0.0f,0.0f,1.0f) /// public static Rotation IDENTITY { @@ -224,7 +224,7 @@ namespace Tizen.NUI /// /// Helper to check if this is an identity quaternion. /// - /// True if this is identity quaternion. + /// True if this is identity quaternion public bool IsIdentity() { bool ret = NDalicPINVOKE.Rotation_IsIdentity(swigCPtr); @@ -233,11 +233,11 @@ namespace Tizen.NUI } /// - /// Converts the quaternion to an axis or angle pair. + /// Converts the quaternion to an axis/angle pair. /// - /// The result of an an axis. - /// The result of angle in radians. - /// True if converted correctly. + /// the result of axis + /// the result of angle Angle in radians + /// True if converted correctly public bool GetAxisAngle(Vector3 axis, Radian angle) { bool ret = NDalicPINVOKE.Rotation_GetAxisAngle(swigCPtr, Vector3.getCPtr(axis), Radian.getCPtr(angle)); @@ -351,9 +351,9 @@ namespace Tizen.NUI } /// - /// Returns the length of the rotation. + /// Returns the length of the rotation /// - /// The length of the rotation. + /// The length of the rotation public float Length() { float ret = NDalicPINVOKE.Rotation_Length(swigCPtr); @@ -362,9 +362,9 @@ namespace Tizen.NUI } /// - /// Returns the squared length of the rotation. + /// Returns the squared length of the rotation /// - /// The squared length of the rotation. + /// The squared length of the rotation public float LengthSquared() { float ret = NDalicPINVOKE.Rotation_LengthSquared(swigCPtr); @@ -384,7 +384,7 @@ namespace Tizen.NUI /// /// Normalized. /// - /// A normalized version of this rotation. + /// A normalized version of this rotation public Rotation Normalized() { Rotation ret = new Rotation(NDalicPINVOKE.Rotation_Normalized(swigCPtr), true); @@ -411,9 +411,9 @@ namespace Tizen.NUI } /// - /// Performs the logarithm of a rotation. + /// Performs the logarithm of a rotation /// - /// The rotation representing the logarithm. + /// A rotation representing the logarithm public Rotation Log() { Rotation ret = new Rotation(NDalicPINVOKE.Rotation_Log(swigCPtr), true); @@ -422,9 +422,9 @@ namespace Tizen.NUI } /// - /// Performs an exponent. + /// Performs an exponent /// - /// The rotation representing the exponent. + /// A rotation representing the exponent public Rotation Exp() { Rotation ret = new Rotation(NDalicPINVOKE.Rotation_Exp(swigCPtr), true); @@ -435,9 +435,9 @@ namespace Tizen.NUI /// /// Returns the dot product of two rotations. /// - /// The first rotation. - /// The second rotation. - /// The dot product of the two rotations. + /// The first rotation + /// The second rotation + /// The dot product of the two rotations public static float Dot(Rotation q1, Rotation q2) { float ret = NDalicPINVOKE.Rotation_Dot(Rotation.getCPtr(q1), Rotation.getCPtr(q2)); @@ -446,12 +446,12 @@ namespace Tizen.NUI } /// - /// The linear iterpolation (using a straight line between the two rotations). + /// Linear Interpolation (using a straight line between the two rotations). /// - /// The start rotation. - /// The end rotation. - /// A progress value between 0 and 1. - /// The interpolated rotation. + /// The start rotation + /// The end rotation + /// A progress value between 0 and 1 + /// The interpolated rotation public static Rotation Lerp(Rotation q1, Rotation q2, float t) { Rotation ret = new Rotation(NDalicPINVOKE.Rotation_Lerp(Rotation.getCPtr(q1), Rotation.getCPtr(q2), t), true); @@ -460,12 +460,12 @@ namespace Tizen.NUI } /// - /// The spherical linear interpolation (using the shortest arc of a great circle between the two rotations). + /// Spherical Linear Interpolation (using the shortest arc of a great circle between the two rotations). /// - /// The start rotation. - /// The end rotation. - /// A progress value between 0 and 1. - /// The interpolated rotation. + /// The start rotation + /// The end rotation + /// A progress value between 0 and 1 + /// The interpolated rotation public static Rotation Slerp(Rotation q1, Rotation q2, float progress) { Rotation ret = new Rotation(NDalicPINVOKE.Rotation_Slerp(Rotation.getCPtr(q1), Rotation.getCPtr(q2), progress), true); @@ -474,12 +474,12 @@ namespace Tizen.NUI } /// - /// This version of slerp, used by squad, does not check for theta > 90. + /// This version of Slerp, used by Squad, does not check for theta > 90. /// - /// The start rotation. - /// The end rotation. - /// A progress value between 0 and 1. - /// The interpolated rotation. + /// The start rotation + /// The end rotation + /// A progress value between 0 and 1 + /// The interpolated rotation public static Rotation SlerpNoInvert(Rotation q1, Rotation q2, float t) { Rotation ret = new Rotation(NDalicPINVOKE.Rotation_SlerpNoInvert(Rotation.getCPtr(q1), Rotation.getCPtr(q2), t), true); @@ -488,14 +488,14 @@ namespace Tizen.NUI } /// - /// The spherical cubic interpolation. + /// Spherical Cubic Interpolation. /// - /// The start rotation. - /// The end rotation. - /// The control rotation for q1. - /// The control rotation for q2. - /// A progress value between 0 and 1. - /// The interpolated rotation. + /// The start rotation + /// The end rotation + /// The control rotation for q1 + /// The control rotation for q2 + /// A progress value between 0 and 1 + /// The interpolated rotation public static Rotation Squad(Rotation start, Rotation end, Rotation ctrl1, Rotation ctrl2, float t) { Rotation ret = new Rotation(NDalicPINVOKE.Rotation_Squad(Rotation.getCPtr(start), Rotation.getCPtr(end), Rotation.getCPtr(ctrl1), Rotation.getCPtr(ctrl2), t), true); @@ -504,11 +504,11 @@ namespace Tizen.NUI } /// - /// Returns the shortest angle between two rotations in radians. + /// Returns the shortest angle between two rotations in Radians. /// - /// The first rotation. - /// The second rotation. - /// The angle between the two rotation. + /// The first rotation + /// The second rotation + /// The angle between the two rotation public static float AngleBetween(Rotation q1, Rotation q2) { float ret = NDalicPINVOKE.Rotation_AngleBetween(Rotation.getCPtr(q1), Rotation.getCPtr(q2)); diff --git a/src/Tizen.NUI/src/public/Size2D.cs b/src/Tizen.NUI/src/public/Size2D.cs index 9f30751ed..9e3b50c1e 100755 --- a/src/Tizen.NUI/src/public/Size2D.cs +++ b/src/Tizen.NUI/src/public/Size2D.cs @@ -19,7 +19,7 @@ namespace Tizen.NUI { /// - /// A two-dimensional size. + /// A two dimensional size /// public class Size2D : global::System.IDisposable { @@ -52,7 +52,7 @@ namespace Tizen.NUI } /// - /// Dispose. + /// Dispose /// public void Dispose() { @@ -104,54 +104,54 @@ namespace Tizen.NUI } /// - /// The addition operator for A+B. + /// Addition operator for A+B /// - /// Size A. - /// Size to assign B. - /// A size containing the result of the addition. + /// Size, A + /// Size to assign, B + /// A Size containing the result of the addition public static Size2D operator +(Size2D arg1, Size2D arg2) { return arg1.Add(arg2); } /// - /// The subtraction operator for A-B. + /// Subtraction operator for A-B /// - /// Size A. - /// Size to subtract B. - /// A size containing the result of the subtraction. + /// Size, A + /// Size to subtract, B + /// A Size containing the result of the subtraction public static Size2D operator -(Size2D arg1, Size2D arg2) { return arg1.Subtract(arg2); } /// - /// The unary negation operator. + /// Unary negation operator. /// - /// Size for unary negation. - /// A size containing the negation. + /// Size for unary negation + /// A Size containg the negation public static Size2D operator -(Size2D arg1) { return arg1.Subtract(); } /// - /// The multiplication operator. + /// Multiplication operator. /// - /// Size for multiplication. - /// Size to multiply. - /// A size containing the result of the multiplication. + /// Size for multiplication + /// The Size to multipl + /// A Size containing the result of the multiplication public static Size2D operator *(Size2D arg1, Size2D arg2) { return arg1.Multiply(arg2); } /// - /// The multiplication operator. + /// Multiplication operator. /// /// Size for multiplication - /// The integer value to scale the size. - /// A size containing the result of the scaling. + /// The int value to scale the Size + /// A Size containing the result of the scaling public static Size2D operator *(Size2D arg1, int arg2) { @@ -159,32 +159,32 @@ namespace Tizen.NUI } /// - /// The division operator. + /// Division operator. /// - /// Size for division. - /// Size to divide. - /// A size containing the result of the division. + /// Size for division + /// The Size to divide + /// A Size containing the result of the division> public static Size2D operator /(Size2D arg1, Size2D arg2) { return arg1.Divide(arg2); } /// - /// The division operator. + /// Division operator. /// - /// Size for division. - /// The integer value to scale the size by. - /// A size containing the result of the scaling. + /// Size for division + /// The int value to scale the Size by + /// A Size containing the result of the scaling public static Size2D operator /(Size2D arg1, int arg2) { return arg1.Divide(arg2); } /// - /// The array subscript operator. + /// Array subscript operator. /// - /// The subscript index. - /// The float at the given index. + /// Subscript index + /// The float at the given index public float this[uint index] { get @@ -194,9 +194,9 @@ namespace Tizen.NUI } /// - /// Gets the size from the pointer. + /// Get Size from pointer. /// - /// The pointer of the size. + /// Pointer of the Size /// Size internal static Size2D GetSize2DFromPtr(global::System.IntPtr cPtr) { @@ -206,7 +206,7 @@ namespace Tizen.NUI } /// - /// The constructor. + /// Constructor. /// public Size2D() : this(NDalicPINVOKE.new_Vector2__SWIG_0(), true) { @@ -214,10 +214,10 @@ namespace Tizen.NUI } /// - /// The constructor. + /// Constructor. /// - /// The x (or width) component. - /// The y (or height) component. + /// x (or width) component + /// y (or height) component public Size2D(int x, int y) : this(NDalicPINVOKE.new_Vector2__SWIG_1((float)x, (float)y), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -275,11 +275,11 @@ namespace Tizen.NUI } /// - /// Checks equality.
+ /// Check equality.
/// Utilizes appropriate machine epsilon values.
///
- /// The size to test against. - /// True if the sizes are equal. + /// The Size to test against + /// True if the Sizes are equal public bool EqualTo(Size2D rhs) { bool ret = NDalicPINVOKE.Vector2_EqualTo(swigCPtr, Size2D.getCPtr(rhs)); @@ -288,11 +288,11 @@ namespace Tizen.NUI } /// - /// Checks inequality.
+ /// Check inequality.
/// Utilizes appropriate machine epsilon values.
///
- /// The size to test against. - /// True if the sizes are not equal. + /// The Size to test against + /// True if the Sizes are not equal public bool NotEqualTo(Size2D rhs) { bool ret = NDalicPINVOKE.Vector2_NotEqualTo(swigCPtr, Size2D.getCPtr(rhs)); @@ -308,7 +308,7 @@ namespace Tizen.NUI } /// - /// The property for the width component of a size. + /// Property for width component of Size /// public int Width { @@ -326,7 +326,7 @@ namespace Tizen.NUI } /// - /// The property for the height component of a size. + /// Property for height component of Size /// public int Height { @@ -344,42 +344,23 @@ namespace Tizen.NUI } /// - /// The type cast operator, Size2D to Vector2. + /// Type cast operator, Size2D to Vector2. /// - /// An object of the Size2D type. + /// Object of Size2D type public static implicit operator Vector2(Size2D size) { return new Vector2((float)size.Width, (float)size.Height); } /// - /// The type cast operator, Vector2 to Size2D type. + /// Type cast operator, Vector2 to Size2D type. /// - /// An object of the Vector2 type. + /// Object of Vector2 type public static implicit operator Size2D(Vector2 vec) { return new Size2D((int)vec.X, (int)vec.Y); } - /// - /// The type cast operator, Size2D to Uint16Pair. - /// - /// An object of the Size2D type. - public static implicit operator Uint16Pair(Size2D size2d) - { - return new Uint16Pair((uint)size2d.Width, (uint)size2d.Height); - } - - /// - /// The type cast operator, Uint16Pair to Size2D type. - /// - /// An object of the Vector2 type. - public static implicit operator Size2D(Uint16Pair pair) - { - return new Size2D((int)pair.GetWidth(), (int)pair.GetWidth()); - } - - } } diff --git a/src/Tizen.NUI/src/public/StyleManager.cs b/src/Tizen.NUI/src/public/StyleManager.cs index 0bc93ea86..d5790344d 100755 --- a/src/Tizen.NUI/src/public/StyleManager.cs +++ b/src/Tizen.NUI/src/public/StyleManager.cs @@ -22,11 +22,11 @@ namespace Tizen.NUI using Tizen.NUI.BaseComponents; /// - /// The StyleManager informs applications of the system theme change, and supports application theme change at runtime.
- /// Applies various styles to controls using the properties system.
+ /// StyleManager informs applications of system theme change, and supports application theme change at runtime.
+ /// Applies various styles to Controls using the properties system.
/// On theme change, it automatically updates all controls, then raises a event to inform the application.
/// If the application wants to customize the theme, RequestThemeChange needs to be called.
- /// It provides the path to the application resource root folder, from there the filename can be specified along with any subfolders, for example, Images, Models, etc.
+ /// It provides the path to the application resource root folder, from there the filename can an be specified along with any sub folders, e.g Images, Models etc.
///
public class StyleManager : BaseHandle { @@ -43,7 +43,7 @@ namespace Tizen.NUI } /// - /// Dispose. + /// Dispose /// protected override void Dispose(DisposeTypes type) { @@ -82,7 +82,7 @@ namespace Tizen.NUI } /// - /// Style changed event arguments. + /// Style changed event arguments /// public class StyleChangedEventArgs : EventArgs { @@ -105,7 +105,7 @@ namespace Tizen.NUI } /// - /// StyleChange - contains the style change information (default font changed or + /// StyleChange - contains Style change information (default font changed or /// default font size changed or theme has changed).
///
public StyleChangeType StyleChange @@ -128,9 +128,9 @@ namespace Tizen.NUI private StyleChangedCallbackDelegate _styleManagerStyleChangedCallbackDelegate; /// - /// An event for the StyleChanged signal which can be used to subscribe or unsubscribe the + /// Event for StyleChanged signal which can be used to subscribe/unsubscribe the /// event handler provided by the user.
- /// The StyleChanged signal is emitted after the style (for example, theme or font change) has changed + /// StyleChanged signal is is emitted after the style (e.g. theme/font change) has changed /// and the controls have been informed.
///
public event EventHandler StyleChanged @@ -172,7 +172,7 @@ namespace Tizen.NUI /// /// Creates a StyleManager handle.
- /// This can be initialized with StyleManager::Get().
+ /// this can be initialized with StyleManager::Get().
///
public StyleManager() : this(NDalicPINVOKE.new_StyleManager(), true) { @@ -182,7 +182,7 @@ namespace Tizen.NUI /// /// Gets the singleton of StyleManager object. /// - /// A handle to the StyleManager control. + /// A handle to the StyleManager control public static StyleManager Get() { StyleManager ret = new StyleManager(NDalicPINVOKE.StyleManager_Get(), true); @@ -191,13 +191,13 @@ namespace Tizen.NUI } /// - /// Applies a new theme to the application.
- /// This will be merged on the top of the default Toolkit theme.
+ /// Applies a new theme to the application.
+ /// This will be merged on top of the default Toolkit theme.
/// If the application theme file doesn't style all controls that the /// application uses, then the default Toolkit theme will be used /// instead for those controls.
///
- /// A relative path is specified for style theme. + /// A relative path is specified for style theme public void ApplyTheme(string themeFile) { NDalicPINVOKE.StyleManager_ApplyTheme(swigCPtr, themeFile); @@ -216,8 +216,8 @@ namespace Tizen.NUI /// /// Sets a constant for use when building styles. /// - /// The key of the constant. - /// The value of the constant. + /// The key of the constant + /// The value of the constant public void AddConstant(string key, PropertyValue value) { NDalicPINVOKE.StyleManager_SetStyleConstant(swigCPtr, key, PropertyValue.getCPtr(value)); @@ -227,8 +227,8 @@ namespace Tizen.NUI /// /// Returns the style constant set for a specific key. /// - /// The key of the constant. - /// The value of the constant if it exists. + /// The key of the constant + /// The value of the constant if it exists /// public bool GetConstant(string key, PropertyValue valueOut) { @@ -240,9 +240,9 @@ namespace Tizen.NUI /// /// Applies the specified style to the control. /// - /// The control to which to apply the style. - /// The name of the JSON style file to apply. - /// The name of the style within the JSON file to apply. + /// The control to which to apply the style + /// The name of the JSON style file to apply + /// The name of the style within the JSON file to apply public void ApplyStyle(View control, string jsonFileName, string styleName) { NDalicPINVOKE.StyleManager_ApplyStyle(swigCPtr, View.getCPtr(control), jsonFileName, styleName); diff --git a/src/Tizen.NUI/src/public/TTSPlayer.cs b/src/Tizen.NUI/src/public/TTSPlayer.cs index 70ce712cc..415606b7c 100755 --- a/src/Tizen.NUI/src/public/TTSPlayer.cs +++ b/src/Tizen.NUI/src/public/TTSPlayer.cs @@ -20,7 +20,7 @@ namespace Tizen.NUI using System.Runtime.InteropServices; /// - /// The Text-to-speech (TTS) player. + /// The Text-to-speech (TTS) Player. /// public class TTSPlayer : BaseHandle { @@ -78,10 +78,10 @@ namespace Tizen.NUI } /// - /// Gets the singleton of the TTS player for the given mode. + /// Gets the singleton of the TtsPlayer for the given mode. /// - /// The mode of TTS player. - /// A handle of the TTS player for the given mode. + /// The mode of tts-player. + /// A handle of the Ttsplayer for the given mode. public static TTSPlayer Get(TTSMode mode) { TTSPlayer ret = new TTSPlayer(NDalicManualPINVOKE.TtsPlayer_Get__SWIG_0((int)mode), true); @@ -90,9 +90,9 @@ namespace Tizen.NUI } /// - /// Gets the singleton of the TTS player for the default mode. + /// Gets the singleton of the TtsPlayer for the default mode.. /// - /// A handle of the TTS player for the default mode. + /// A handle of the Ttsplayer for the default mode. public static TTSPlayer Get() { TTSPlayer ret = new TTSPlayer(NDalicManualPINVOKE.TtsPlayer_Get__SWIG_1(), true); @@ -115,8 +115,8 @@ namespace Tizen.NUI /// /// Starts playing the audio data synthesized from the specified text. /// - /// The text to play. - /// The TTS player needs to be initialized. + /// The text to play. + /// The TtsPlayer needs to be initialized. public void Play(string text) { NDalicManualPINVOKE.TtsPlayer_Play(swigCPtr, text); @@ -126,7 +126,7 @@ namespace Tizen.NUI /// /// Stops playing the utterance. /// - /// The TTS player needs to be initialized. + /// The TtsPlayer needs to be initialized. public void Stop() { NDalicManualPINVOKE.TtsPlayer_Stop(swigCPtr); @@ -136,7 +136,7 @@ namespace Tizen.NUI /// /// Pauses the currently playing utterance. /// - /// The TTS player needs to be initialized. + /// The TtsPlayer needs to be initialized. public void Pause() { NDalicManualPINVOKE.TtsPlayer_Pause(swigCPtr); @@ -146,7 +146,7 @@ namespace Tizen.NUI /// /// Resumes the previously paused utterance. /// - /// The TTS player needs to be initialized. + /// The TtsPlayer needs to be initialized. public void Resume() { NDalicManualPINVOKE.TtsPlayer_Resume(swigCPtr); @@ -157,7 +157,7 @@ namespace Tizen.NUI /// Gets the current state of the player. /// /// The current TTS state. - /// The TTS player needs to be initialized. + /// The TtsPlayer needs to be initialized. public TTSState GetState() { TTSState ret = (TTSState)NDalicManualPINVOKE.TtsPlayer_GetState(swigCPtr); @@ -249,12 +249,12 @@ namespace Tizen.NUI Notification, /// /// Screen reader mode.
- /// To help visually impaired users interact with their devices,
+ /// To help visually impaired users interact with their devices,
/// screen reader reads text or graphic elements on the screen using the TTS engine. ///
ScreenReader, /// - /// Number of mode. + /// Number of Mode. /// ModeNum } diff --git a/src/Tizen.NUI/src/public/TapGesture.cs b/src/Tizen.NUI/src/public/TapGesture.cs index fd2883459..3bcbcb8c3 100755 --- a/src/Tizen.NUI/src/public/TapGesture.cs +++ b/src/Tizen.NUI/src/public/TapGesture.cs @@ -35,7 +35,7 @@ namespace Tizen.NUI } /// - /// Dispose. + /// Dispose /// protected override void Dispose(DisposeTypes type) { @@ -70,10 +70,10 @@ namespace Tizen.NUI /// - /// Gets the TapGesture from the pointer. + /// Get TapGesture from the pointer. /// - /// The pointer to cast. - /// The TapGesture object. + /// The pointer to cast + /// TapGesture object internal static TapGesture GetTapGestureFromPtr(global::System.IntPtr cPtr) { TapGesture ret = new TapGesture(cPtr, false); @@ -82,7 +82,7 @@ namespace Tizen.NUI } /// - /// The number of taps property (read-only). + /// Number of taps property (read-only). /// public uint NumberOfTaps { @@ -93,7 +93,7 @@ namespace Tizen.NUI } /// - /// The number of touches property (read-only). + /// Number of touches property (read-only). /// public uint NumberOfTouches { @@ -104,7 +104,7 @@ namespace Tizen.NUI } /// - /// The screen point property (read-only). + /// Screen point property (read-only). /// public Vector2 ScreenPoint { @@ -115,7 +115,7 @@ namespace Tizen.NUI } /// - /// The local point property (read-only). + /// Local point property (read-only). /// public Vector2 LocalPoint { diff --git a/src/Tizen.NUI/src/public/Timer.cs b/src/Tizen.NUI/src/public/Timer.cs index cbb7dd609..1f4863a9f 100755 --- a/src/Tizen.NUI/src/public/Timer.cs +++ b/src/Tizen.NUI/src/public/Timer.cs @@ -23,10 +23,10 @@ namespace Tizen.NUI /// /// Mechanism to issue simple periodic or one-shot events.
/// Timer is provided for application developers to be able to issue - /// simple periodic or one-shot events. Please note that the timer - /// callback functions should return as soon as possible because they - /// block the next SignalTick. Please note that timer signals are not - /// in sync with DALi's render timer.
+ /// simple periodic or one-shot events. Please note that timer + /// callback functions should return as soon as possible, because they + /// block the next SignalTick. Please note that timer signals are not + /// in sync with Dali's render timer.
/// This class is a handle class so it can be stack allocated and used /// as a member.
///
@@ -82,7 +82,7 @@ namespace Tizen.NUI /// - /// Event arguments that passed via the tick event. + /// Event arguments that passed via Tick event. /// public class TickEventArgs : EventArgs { @@ -94,9 +94,9 @@ namespace Tizen.NUI private TickCallbackDelegate _timerTickCallbackDelegate; /// - /// @brief Event for the ticked signal, which can be used to subscribe or unsubscribe the event handler - /// (in the type of TickEventHandler-DaliEventHandlerWithReturnType)
- /// provided by the user. The ticked signal is emitted after specified time interval.
+ /// brief Event for Ticked signal which can be used to subscribe/unsubscribe the event handler + /// (in the type of TickEventHandler-DaliEventHandlerWithReturnType).
+ /// provided by the user. Ticked signal is emitted after specified time interval.
///
public event EventHandlerWithReturnType Tick { @@ -132,10 +132,10 @@ namespace Tizen.NUI } /// - /// Creates a tick timer that emits periodic signal. + /// Creates a tick Timer that emits periodic signal. /// - /// Interval in milliseconds. - /// A new timer. + /// Interval in milliseconds + /// A new timer public Timer(uint milliSec) : this(NDalicPINVOKE.Timer_New(milliSec), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -156,8 +156,8 @@ namespace Tizen.NUI } /// - /// Starts the timer.
- /// In case a timer is already running, its time is reset and the timer is restarted.
+ /// Starts timer.
+ /// In case a Timer is already running, its time is reset and timer is restarted.
///
public void Start() { @@ -166,7 +166,7 @@ namespace Tizen.NUI } /// - /// Stops the timer. + /// Stops timer. /// public void Stop() { @@ -193,7 +193,7 @@ namespace Tizen.NUI /// Sets a new interval on the timer and starts the timer.
/// Cancels the previous timer.
/// - /// MilliSec interval in milliseconds. + /// milliSec Interval in milliseconds internal void SetInterval(uint milliSec) { NDalicPINVOKE.Timer_SetInterval(swigCPtr, milliSec); @@ -208,9 +208,9 @@ namespace Tizen.NUI } /// - /// Tells whether the timer is running. + /// Tells whether timer is running. /// - /// Whether the timer is started or not. + /// Whether Timer is started or not public bool IsRunning() { bool ret = NDalicPINVOKE.Timer_IsRunning(swigCPtr); diff --git a/src/Tizen.NUI/src/public/Touch.cs b/src/Tizen.NUI/src/public/Touch.cs index ea650964f..a181fb5c9 100755 --- a/src/Tizen.NUI/src/public/Touch.cs +++ b/src/Tizen.NUI/src/public/Touch.cs @@ -81,8 +81,8 @@ namespace Tizen.NUI } /// - /// An uninitialized touch instance.
- /// Calling member functions with an uninitialized touch handle is not allowed.
+ /// An uninitialized Touch instance.
+ /// Calling member functions with an uninitialized Touch handle is not allowed.
///
public Touch() : this(NDalicPINVOKE.new_Touch__SWIG_0(), true) { @@ -97,7 +97,7 @@ namespace Tizen.NUI /// /// Returns the time (in ms) that the touch event occurred. /// - /// The time (in ms) that the touch event occurred. + /// The time (in ms) that the touch event occurred public uint GetTime() { uint ret = NDalicPINVOKE.Touch_GetTime(swigCPtr); @@ -108,7 +108,7 @@ namespace Tizen.NUI /// /// Returns the total number of points in this TouchData. /// - /// The total number of points. + /// Total number of Points public uint GetPointCount() { uint ret = NDalicPINVOKE.Touch_GetPointCount(swigCPtr); @@ -117,13 +117,13 @@ namespace Tizen.NUI } /// - /// Returns the ID of the device used for the point specified.
- /// Each point has a unique device ID, which specifies the device used for that + /// Returns the ID of the device used for the Point specified.
+ /// Each point has a unique device ID which specifies the device used for that /// point. This is returned by this method.
- /// If a point is greater than GetPointCount(), then this method will return -1.
+ /// If point is greater than GetPointCount() then this method will return -1.
///
- /// The point required. - /// The device ID of this point. + /// The point required + /// The Device ID of this point public int GetDeviceId(uint point) { int ret = NDalicPINVOKE.Touch_GetDeviceId(swigCPtr, point); @@ -132,11 +132,11 @@ namespace Tizen.NUI } /// - /// Retrieves the state of the point specified.
- /// If a point is greater than GetPointCount(), then this method will return PointState.Finished.
+ /// Retrieves the State of the point specified.
+ /// If point is greater than GetPointCount() then this method will return PointState.Finished.
///
- /// The point required. - /// The state of the point specified. + /// The point required + /// The state of the point specified public PointStateType GetState(uint point) { PointStateType ret = (PointStateType)NDalicPINVOKE.Touch_GetState(swigCPtr, point); @@ -146,10 +146,10 @@ namespace Tizen.NUI /// /// Retrieves the actor that was underneath the point specified.
- /// If a point is greater than GetPointCount(), then this method will return an empty handle.
+ /// If point is greater than GetPointCount() then this method will return an empty handle.
///
- /// The point required. - /// The actor that was underneath the point specified. + /// The point required + /// The actor that was underneath the point specified public View GetHitView(uint point) { global::System.IntPtr cPtr = NDalicPINVOKE.Touch_GetHitActor(swigCPtr, point); @@ -160,14 +160,14 @@ namespace Tizen.NUI } /// - /// Retrieves the coordinates relative to the top-left of the hit actor at the point specified.
+ /// Retrieves the co-ordinates relative to the top-left of the hit-actor at the point specified.
/// The top-left of an actor is (0.0, 0.0, 0.5).
- /// If you require the local coordinates of another actor (for example, the parent of the hit actor), + /// If you require the local coordinates of another actor (e.g the parent of the hit actor), /// then you should use Actor::ScreenToLocal().
- /// If a point is greater than GetPointCount(), then this method will return Vector2.Zero.
+ /// If point is greater than GetPointCount() then this method will return Vector2.Zero.
///
- /// The point required. - /// The coordinates relative to the top-left of the hit actor of the point specified. + /// The point required + /// The co-ordinates relative to the top-left of the hit-actor of the point specified public Vector2 GetLocalPosition(uint point) { Vector2 ret = new Vector2(NDalicPINVOKE.Touch_GetLocalPosition(swigCPtr, point), false); @@ -176,11 +176,11 @@ namespace Tizen.NUI } /// - /// Retrieves the coordinates relative to the top-left of the screen of the point specified.
- /// If a point is greater than GetPointCount(), then this method will return Vector2.Zero.
+ /// Retrieves the co-ordinates relative to the top-left of the screen of the point specified.
+ /// If point is greater than GetPointCount() then this method will return Vector2.Zero.
///
- /// The point required. - /// The coordinates relative to the top-left of the screen of the point specified. + /// The point required + /// The co-ordinates relative to the top-left of the screen of the point specified public Vector2 GetScreenPosition(uint point) { Vector2 ret = new Vector2(NDalicPINVOKE.Touch_GetScreenPosition(swigCPtr, point), false); @@ -191,10 +191,10 @@ namespace Tizen.NUI /// /// Retrieves the radius of the press point.
/// This is the average of both the horizontal and vertical radii of the press point.
- /// If point is greater than GetPointCount(), then this method will return 0.0f.
+ /// If point is greater than GetPointCount() then this method will return 0.0f.
///
- /// The point required. - /// The radius of the press point. + /// The point required + /// The radius of the press point public float GetRadius(uint point) { float ret = NDalicPINVOKE.Touch_GetRadius(swigCPtr, point); @@ -203,11 +203,11 @@ namespace Tizen.NUI } /// - /// Retrieves both the horizontal and the vertical radii of the press point.
- /// If a point is greater than GetPointCount(), then this method will return Vector2.Zero.
+ /// Retrieves BOTH the horizontal and the vertical radii of the press point.
+ /// If point is greater than GetPointCount() then this method will return Vector2.Zero.
///
- /// The point required. - /// The horizontal and vertical radii of the press point. + /// The point required + /// The horizontal and vertical radii of the press point public Vector2 GetEllipseRadius(uint point) { Vector2 ret = new Vector2(NDalicPINVOKE.Touch_GetEllipseRadius(swigCPtr, point), false); @@ -221,10 +221,10 @@ namespace Tizen.NUI /// Normal pressure is defined as 1.0f.
/// A value between 0.0f and 1.0f means light pressure has been applied.
/// A value greater than 1.0f means more pressure than normal has been applied.
- /// If point is greater than GetPointCount(), then this method will return 1.0f.
+ /// If point is greater than GetPointCount() then this method will return 1.0f.
/// - /// The point required. - /// The touch pressure. + /// point The point required + /// The touch pressure public float GetPressure(uint point) { float ret = NDalicPINVOKE.Touch_GetPressure(swigCPtr, point); diff --git a/src/Tizen.NUI/src/public/UIComponents/Button.cs b/src/Tizen.NUI/src/public/UIComponents/Button.cs index 1cffbcc3e..43eb91a8d 100755 --- a/src/Tizen.NUI/src/public/UIComponents/Button.cs +++ b/src/Tizen.NUI/src/public/UIComponents/Button.cs @@ -24,17 +24,17 @@ namespace Tizen.NUI.UIComponents using Tizen.NUI.BaseComponents; /// - /// The Button class is a base class for different kinds of buttons.
+ /// Button is a base class for different kinds of buttons.
/// This class provides the disabled property and the clicked signal.
- /// The clicked event handler is emitted when the button is touched, and the touch point doesn't leave the boundary of the button.
+ /// A Clicked event handler is emitted when the button is touched and the touch point doesn't leave the boundary of the button.
/// When the disabled property is set to true, no signal is emitted.
- /// The 'Visual' describes not just traditional images like PNG and BMP, but also refers to whatever is used to show the button. It could be a color, gradient, or some other kind of renderer.
- /// The button's appearance can be modified by setting properties for the various visuals or images.
- /// It is not mandatory to set all the visuals. A button could be defined only by setting its background visual, or by setting its background and selected visuals.
+ /// 'Visual' describes not just traditional images like png, bmp but refers to whatever is used to show the button, it could be a color, gradient or some other kind of renderer.
+ /// The button's appearance can be modified by setting properties for the various visuals/images.
+ /// It is not mandatory to set all visuals. A button could be defined only by setting its background visual or by setting its background and selected visuals.
/// The button visual is shown over the background visual.
- /// When pressed, the unselected visuals are replaced by the selected visuals.
+ /// When pressed the unselected visuals are replaced by the selected visual.
/// The text label is always placed on the top of all images.
- /// When the button is disabled, the background button and the selected visuals are replaced by their disabled visuals.
+ /// When the button is disabled, background, button and selected visuals are replaced by their disabled visuals.
///
public class Button : View { @@ -51,7 +51,7 @@ namespace Tizen.NUI.UIComponents } /// - /// To dispose the button instance. + /// To make Button instance be disposed. /// protected override void Dispose(DisposeTypes type) { @@ -127,7 +127,7 @@ namespace Tizen.NUI.UIComponents private ClickedCallbackType _clickedCallback; /// - /// The Clicked event will be triggered when the button is touched and the touch point doesn't leave the boundary of the button. + /// Clicked will be triggered when the button is touched and the touch point doesn't leave the boundary of the button. /// public event EventHandlerWithReturnType Clicked { @@ -171,7 +171,7 @@ namespace Tizen.NUI.UIComponents private PressedCallbackType _pressedCallback; /// - /// The Pressed event will be triggered when the button is touched. + /// Pressed will be triggered when the button is touched. /// public event EventHandlerWithReturnType Pressed { @@ -214,7 +214,7 @@ namespace Tizen.NUI.UIComponents private ReleasedCallbackType _releasedCallback; /// - /// The Released event will be triggered when the button is touched and the touch point leaves the boundary of the button. + /// Released will be triggered when the button is touched and the touch point leaves the boundary of the button. /// public event EventHandlerWithReturnType Released { @@ -256,7 +256,7 @@ namespace Tizen.NUI.UIComponents private StateChangedCallback _stateChangedCallback; /// - /// The StateChanged event will be triggered when the button's state is changed. + /// StateChanged will be triggered when the button's state is changed. /// public event EventHandlerWithReturnType StateChanged { @@ -293,7 +293,7 @@ namespace Tizen.NUI.UIComponents /// - /// Gets or sets the unselected button foreground or icon visual. + /// Gets/Sets the unselected button foreground/icon visual /// public Tizen.NUI.PropertyMap UnselectedVisual { @@ -310,7 +310,7 @@ namespace Tizen.NUI.UIComponents } /// - /// Gets or sets the selected button foreground or icon visual. + /// Gets/Sets the selected button foreground/icon visual /// public Tizen.NUI.PropertyMap SelectedVisual { @@ -327,7 +327,7 @@ namespace Tizen.NUI.UIComponents } /// - /// Gets or sets the disabled selected state foreground or icon button visual. + /// Gets/Sets the disabled selected state foreground/icon button visual /// public Tizen.NUI.PropertyMap DisabledSelectedVisual { @@ -344,7 +344,7 @@ namespace Tizen.NUI.UIComponents } /// - /// Gets or sets the disabled unselected state foreground or icon visual. + /// Gets/Sets the disabled unselected state foreground/icon visual /// public Tizen.NUI.PropertyMap DisabledUnselectedVisual { @@ -361,7 +361,7 @@ namespace Tizen.NUI.UIComponents } /// - /// Gets or sets the disabled unselected state background button visual. + /// Gets/Sets the disabled in the unselected state background, button visual /// public Tizen.NUI.PropertyMap UnselectedBackgroundVisual { @@ -378,7 +378,7 @@ namespace Tizen.NUI.UIComponents } /// - /// Gets or sets the selected background button visual. + /// Gets/Sets the selected background button visual /// public Tizen.NUI.PropertyMap SelectedBackgroundVisual { @@ -395,7 +395,7 @@ namespace Tizen.NUI.UIComponents } /// - /// Gets or sets the disabled while unselected background button visual. + /// Gets/Sets the disabled while unselected background button visual /// public Tizen.NUI.PropertyMap DisabledUnselectedBackgroundVisual { @@ -412,7 +412,7 @@ namespace Tizen.NUI.UIComponents } /// - /// Gets or sets the disabled while selected background button visual. + /// Gets/Sets the disabled while selected background button visual /// public Tizen.NUI.PropertyMap DisabledSelectedBackgroundVisual { @@ -429,7 +429,7 @@ namespace Tizen.NUI.UIComponents } /// - /// Gets or sets the position of the the label in relation to the foreground or icon, if both present. + /// Gets/Sets the position of the the label in relation to the foreground/icon if both present /// public Align LabelRelativeAlignment { @@ -490,7 +490,7 @@ namespace Tizen.NUI.UIComponents } /// - /// Gets or sets the padding around the text. + /// Gets/Sets the padding around the text /// public Vector4 LabelPadding { @@ -507,7 +507,7 @@ namespace Tizen.NUI.UIComponents } /// - /// Gets or sets the padding around the foreground visual. + /// Gets/Sets the padding around the foreground visual /// public Vector4 ForegroundVisualPadding { @@ -523,7 +523,7 @@ namespace Tizen.NUI.UIComponents } } - internal new class Property + internal class Property { internal static readonly int UNSELECTED_VISUAL = NDalicManualPINVOKE.Button_Property_UNSELECTED_VISUAL_get(); internal static readonly int SELECTED_VISUAL = NDalicManualPINVOKE.Button_Property_SELECTED_VISUAL_get(); @@ -547,8 +547,8 @@ namespace Tizen.NUI.UIComponents } /// - /// Creates an uninitialized button.
- /// Only the derived versions can be instantiated.
+ /// Creates an uninitialized Button.
+ /// Only derived versions can be instantiated.
///
public Button() : this(NDalicPINVOKE.new_Button__SWIG_0(), true) { @@ -584,7 +584,7 @@ namespace Tizen.NUI.UIComponents } /// - /// If the autorepeating property is set to true, then the togglable property is set to false. + /// If the autorepeating property is set to true then the togglable property is set to false. /// public bool AutoRepeating { @@ -601,7 +601,7 @@ namespace Tizen.NUI.UIComponents } /// - /// By default, this value is set to 0.15 seconds. + /// By default this value is set to 0.15 seconds. /// public float InitialAutoRepeatingDelay { @@ -618,7 +618,7 @@ namespace Tizen.NUI.UIComponents } /// - /// By default, this value is set to 0.05 seconds. + /// default this value is set to 0.05 seconds. /// public float NextAutoRepeatingDelay { @@ -652,7 +652,7 @@ namespace Tizen.NUI.UIComponents } /// - /// Gets or sets the togglable button as either selected or unselected, togglable property must be set to true. + /// /Gets/Sets the togglable button as either selected or unselected, togglable property must be set to true. /// public bool Selected { @@ -669,7 +669,7 @@ namespace Tizen.NUI.UIComponents } /// - /// Gets or sets the unselected color. + /// Gets/Sets unselected color. /// public Color UnselectedColor { @@ -686,7 +686,7 @@ namespace Tizen.NUI.UIComponents } /// - /// Gets or sets the selected color. + /// Gets/Sets selected color. /// public Color SelectedColor { @@ -703,7 +703,7 @@ namespace Tizen.NUI.UIComponents } /// - /// Gets or sets the label. + /// Gets/Sets label. /// public Tizen.NUI.PropertyMap Label { @@ -720,7 +720,7 @@ namespace Tizen.NUI.UIComponents } /// - /// Gets or sets the text of the label. + /// Gets/Sets text of label. /// public string LabelText { @@ -740,24 +740,24 @@ namespace Tizen.NUI.UIComponents } /// - /// Enumeration for describing the position, the text label can be, in relation to the control (and foreground/icon). + /// Enumeration for describing the position the text label can be in relation to the control(and foreground/icon). /// public enum Align { /// - /// At the start of the control before the foreground or icon. + /// At the start of the control before the foreground/icon /// Begin, /// - /// At the end of the control after the foreground or icon. + /// At the end of the control after the foreground/icon /// End, /// - /// At the top of the control above the foreground or icon. + /// At the top of the control above the foreground/icon /// Top, /// - /// At the bottom of the control below the foreground or icon. + /// At the bottom of the control below the foreground/icon /// Bottom } diff --git a/src/Tizen.NUI/src/public/UIComponents/CheckBoxButton.cs b/src/Tizen.NUI/src/public/UIComponents/CheckBoxButton.cs index 3d4f1d16a..e2ef38a19 100755 --- a/src/Tizen.NUI/src/public/UIComponents/CheckBoxButton.cs +++ b/src/Tizen.NUI/src/public/UIComponents/CheckBoxButton.cs @@ -20,12 +20,12 @@ namespace Tizen.NUI.UIComponents { /// - /// The CheckBoxButton provides a checkbox button which the user can check or uncheck.
- /// By default, the CheckBoxButton emits a Button.Clicked event when the button changes its state to selected or unselected.
+ /// CheckBoxButton provides a check box button which user can check or uncheck.
+ /// By default, a CheckBoxButton emits a Button.Clicked event when the button changes its state to selected or unselected.
/// The button's appearance could be modified by Button.UnselectedImage, Button.BackgroundImage, Button.SelectedImage, Button.SelectedBackgroundImage, Button.DisabledBackgroundImage, Button.DisabledImage, and Button.DisabledSelectedImage.
- /// When the button is not disabled, if it's not selected, it only shows the background image.
+ /// When the button is not disabled, if it's not selected it only shows the background image.
/// The selected image is shown over the background image when the box is selected (background image is not replaced by \e selected image).
- /// When the button is disabled, the background image and the selected image are replaced by disabled images.
+ /// When the button is disabled, background image and selected image are replaced by disabled images.
/// ///
public class CheckBoxButton : Button { @@ -43,7 +43,7 @@ namespace Tizen.NUI.UIComponents /// - /// To dispose the CheckBoxButton instance. + /// To make CheckBoxButton instance be disposed. /// protected override void Dispose(DisposeTypes type) { @@ -77,7 +77,7 @@ namespace Tizen.NUI.UIComponents } /// - /// Creates an initialized CheckBoxButton. + /// Creates an initialized CheckBoxButton /// public CheckBoxButton() : this(NDalicPINVOKE.CheckBoxButton_New(), true) { diff --git a/src/Tizen.NUI/src/public/UIComponents/Popup.cs b/src/Tizen.NUI/src/public/UIComponents/Popup.cs index 55e5b709f..a39f01200 100755 --- a/src/Tizen.NUI/src/public/UIComponents/Popup.cs +++ b/src/Tizen.NUI/src/public/UIComponents/Popup.cs @@ -22,7 +22,7 @@ namespace Tizen.NUI.UIComponents using Tizen.NUI.BaseComponents; /// - /// The Popup widget provides a configurable popup dialog with a built-in layout of three main fields. + /// The Popup widget provides a configurable pop-up dialog with built-in layout of three main fields. /// public class Popup : View { @@ -100,35 +100,35 @@ namespace Tizen.NUI.UIComponents /// - /// Event arguments that passed via the OutsideTouchedEvent. + /// Event arguments that passed via OutsideTouchedEvent /// public class TouchedOutsideEventArgs : EventArgs { } /// - /// Event arguments that passed via the ShowingEventArgs. + /// Event arguments that passed via ShowingEventArgs /// public class ShowingEventArgs : EventArgs { } /// - /// Event arguments that passed via the ShownEventArgs. + /// Event arguments that passed via ShownEventArgs /// public class ShownEventArgs : EventArgs { } /// - /// Event arguments that passed via the HidingEventArgs. + /// Event arguments that passed via HidingEventArgs /// public class HidingEventArgs : EventArgs { } /// - /// Event arguments that passed via the HiddenEventArgs. + /// Event arguments that passed via HiddenEventArgs /// public class HiddenEventArgs : EventArgs { @@ -160,7 +160,7 @@ namespace Tizen.NUI.UIComponents private HiddenEventCallbackDelegate _popUpHiddenEventCallbackDelegate; /// - /// An event is sent when the user has touched outside the dialog. + /// Event is sent when user has touched outside of the Dialog. /// public event EventHandler TouchedOutside { @@ -196,7 +196,7 @@ namespace Tizen.NUI.UIComponents } /// - /// An event is sent when the popup starts showing. + /// Event is sent when the Popup is starting to be shown. /// public event EventHandler Showing { @@ -233,7 +233,7 @@ namespace Tizen.NUI.UIComponents /// - /// An event is sent when the popup has been fully displayed. + /// Event is sent when the Popup has been fully displayed. /// public event EventHandler Shown { @@ -269,7 +269,7 @@ namespace Tizen.NUI.UIComponents } /// - /// An event is sent when the popup starts to hide. + /// Event is sent when the Popup is starting to be hidden. /// public event EventHandler Hiding { @@ -305,7 +305,7 @@ namespace Tizen.NUI.UIComponents } /// - /// An event is sent when the popup has been completely hidden. + /// Event is sent when the Popup has been completely hidden. /// public event EventHandler Hidden { @@ -340,7 +340,7 @@ namespace Tizen.NUI.UIComponents } } - internal new class Property + internal class Property { internal static readonly int TITLE = NDalicPINVOKE.Popup_Property_TITLE_get(); internal static readonly int CONTENT = NDalicPINVOKE.Popup_Property_CONTENT_get(); @@ -366,7 +366,7 @@ namespace Tizen.NUI.UIComponents } /// - /// Creates the popup. + /// Create the Popup. /// public Popup() : this(NDalicPINVOKE.Popup_New(), true) { @@ -383,9 +383,9 @@ namespace Tizen.NUI.UIComponents } /// - /// Sets the title for this popup. + /// Sets a title for this Popup. /// - /// The actor to set the title. + /// The actor to set a title public void SetTitle(View titleView) { NDalicPINVOKE.Popup_SetTitle(swigCPtr, View.getCPtr(titleView)); @@ -404,7 +404,7 @@ namespace Tizen.NUI.UIComponents /// /// Sets the content actor. /// - /// The actor to use. + /// The actor to use public void SetContent(View content) { NDalicPINVOKE.Popup_SetContent(swigCPtr, View.getCPtr(content)); @@ -421,9 +421,9 @@ namespace Tizen.NUI.UIComponents } /// - /// Sets the actor to use for the footer in this popup. + /// Sets the actor to use for a footer in this Popup. /// - /// The footer actor to be added to this popup. + /// The footer actor to be added to this Popup public void SetFooter(View footer) { NDalicPINVOKE.Popup_SetFooter(swigCPtr, View.getCPtr(footer)); @@ -440,11 +440,11 @@ namespace Tizen.NUI.UIComponents } /// - /// Sets the display state of popup.
+ /// Sets the display state of Popup.
/// There are 4 total display states.
/// Only 2 can be set, but all four can be read for better inspection of the current popup state.
///
- /// The other two states are getable, but not setable, and are there for consistency.
+ /// The other two states are getable, but not setable and are there for consistency.
///
/// | Value | Setting the state | Getting the state |
/// |----------|--------------------------------|--------------------------------|
@@ -453,9 +453,9 @@ namespace Tizen.NUI.UIComponents /// | SHOWING | | The popup is transitioning in |
/// | HIDING | | The popup is transitioning out |
///
- /// All 4 states changes cause notifications via 4 respective signals that can be connected to.
+ /// All 4 state changes cause notifications via 4 respective signals that can be connected to.
///
- /// The desired display state to change to. + /// The desired display state to change to public void SetDisplayState(Popup.DisplayStateType displayState) { NDalicPINVOKE.Popup_SetDisplayState(swigCPtr, (int)displayState); @@ -505,7 +505,7 @@ namespace Tizen.NUI.UIComponents } /// - /// The display states of the popup. + /// The display states of the Popup. /// public enum DisplayStateType { @@ -516,7 +516,7 @@ namespace Tizen.NUI.UIComponents } /// - /// The animation modes within the popup.
+ /// The animation mode within popup.
/// Choose from a predefined mode or "CUSTOM" to use the ANIMATION_IN and ANIMATION_OUT properties.
///
public enum AnimationModeType @@ -528,8 +528,8 @@ namespace Tizen.NUI.UIComponents } /// - /// The types of the contextual layout.
- /// The popup is positioned adjacent to it's parent in the direction specified by this mode.
+ /// Types of contextual layout.
+ /// The Popup is positioned adjacent to it's parent in the direction specified by this mode.
/// NON_CONTEXTUAL disables any contextual positioning.
///
public enum ContextualModeType @@ -542,7 +542,7 @@ namespace Tizen.NUI.UIComponents } /// - /// The popup title. + /// Popup title. /// public PropertyMap Title { @@ -558,7 +558,7 @@ namespace Tizen.NUI.UIComponents } } /// - /// The popup content. + /// Popup content. /// public PropertyMap Content { @@ -574,7 +574,7 @@ namespace Tizen.NUI.UIComponents } } /// - /// The popup footer. + /// Popup footer. /// public PropertyMap Footer { @@ -590,7 +590,7 @@ namespace Tizen.NUI.UIComponents } } /// - /// The popup display state. + /// Popup display state. /// public DisplayStateType DisplayState { @@ -650,7 +650,7 @@ namespace Tizen.NUI.UIComponents } } /// - /// The touch transparent. + /// Touch transparent. /// public bool TouchTransparent { @@ -666,7 +666,7 @@ namespace Tizen.NUI.UIComponents } } /// - /// The popup tail visibility. + /// Popup tail visibility. /// public bool TailVisibility { @@ -682,7 +682,7 @@ namespace Tizen.NUI.UIComponents } } /// - /// The popup tail position. + /// Popup tail position. /// public Vector3 TailPosition { @@ -698,7 +698,7 @@ namespace Tizen.NUI.UIComponents } } /// - /// The contextual mode. + /// Contextual mode. /// public ContextualModeType ContextualMode { @@ -765,7 +765,7 @@ namespace Tizen.NUI.UIComponents } } /// - /// The animation duration. + /// Animation duration. /// public float AnimationDuration { @@ -781,7 +781,7 @@ namespace Tizen.NUI.UIComponents } } /// - /// The animation mode. + /// Animation mode. /// public AnimationModeType AnimationMode { @@ -841,7 +841,7 @@ namespace Tizen.NUI.UIComponents } } /// - /// The entry animation. + /// Entry animation. /// public PropertyMap EntryAnimation { @@ -857,7 +857,7 @@ namespace Tizen.NUI.UIComponents } } /// - /// The exit animation. + /// Exit animation. /// public PropertyMap ExitAnimation { @@ -873,7 +873,7 @@ namespace Tizen.NUI.UIComponents } } /// - /// The auto hide delay. + /// Auto hide delay. /// public int AutoHideDelay { @@ -889,7 +889,7 @@ namespace Tizen.NUI.UIComponents } } /// - /// The backing enabled. + /// Backing enabled. /// public bool BackingEnabled { @@ -905,7 +905,7 @@ namespace Tizen.NUI.UIComponents } } /// - /// The backing color. + /// Backing color. /// public Vector4 BackingColor { @@ -921,7 +921,7 @@ namespace Tizen.NUI.UIComponents } } /// - /// The background image. + /// Background image. /// public string PopupBackgroundImage { @@ -937,7 +937,7 @@ namespace Tizen.NUI.UIComponents } } /// - /// The background border. + /// Background border. /// public Rectangle PopupBackgroundBorder { @@ -953,7 +953,7 @@ namespace Tizen.NUI.UIComponents } } /// - /// The tail up image. + /// Tail up image. /// public string TailUpImage { @@ -969,7 +969,7 @@ namespace Tizen.NUI.UIComponents } } /// - /// The tail down image. + /// Tail down image. /// public string TailDownImage { @@ -985,7 +985,7 @@ namespace Tizen.NUI.UIComponents } } /// - /// The tail left image. + /// Tail left image. /// public string TailLeftImage { @@ -1001,7 +1001,7 @@ namespace Tizen.NUI.UIComponents } } /// - /// The tail right image. + /// Tail right image. /// public string TailRightImage { diff --git a/src/Tizen.NUI/src/public/UIComponents/ProgressBar.cs b/src/Tizen.NUI/src/public/UIComponents/ProgressBar.cs index 43191d55c..a6bde4723 100755 --- a/src/Tizen.NUI/src/public/UIComponents/ProgressBar.cs +++ b/src/Tizen.NUI/src/public/UIComponents/ProgressBar.cs @@ -22,7 +22,7 @@ namespace Tizen.NUI.UIComponents using Tizen.NUI.BaseComponents; /// - /// The ProgressBar is a control to give the user an indication of the progress of an operation. + /// ProgressBar is a control to give the user an indication of the progress of an operation. /// public class ProgressBar : View { @@ -39,7 +39,7 @@ namespace Tizen.NUI.UIComponents } /// - /// To dispose the ProgressBar instance. + /// To make ProgressBar instance be disposed. /// protected override void Dispose(DisposeTypes type) { @@ -80,7 +80,7 @@ namespace Tizen.NUI.UIComponents /// - /// Event arguments that passed via the ValueChangedEventArgs. + /// Event arguments that passed via ValueChangedEventArgs /// public class ValueChangedEventArgs : EventArgs { @@ -132,7 +132,7 @@ namespace Tizen.NUI.UIComponents private ValueChangedCallbackDelegate _progressBarValueChangedCallbackDelegate; /// - /// The event is sent when the ProgressBar value changes. + /// Event is sent when the ProgressBar value changes. /// public event EventHandler ValueChanged { @@ -171,7 +171,7 @@ namespace Tizen.NUI.UIComponents } } - internal new class Property + internal class Property { internal static readonly int PROGRESS_VALUE = NDalicPINVOKE.ProgressBar_Property_PROGRESS_VALUE_get(); internal static readonly int SECONDARY_PROGRESS_VALUE = NDalicPINVOKE.ProgressBar_Property_SECONDARY_PROGRESS_VALUE_get(); @@ -201,10 +201,10 @@ namespace Tizen.NUI.UIComponents } /// - /// The progress value of the progress bar, the progress runs from 0 to 1.
- /// If the value is set to 0, then the progress bar will be set to beginning.
- /// If the value is set to 1, then the progress bar will be set to end.
- /// Any value outside the range is ignored.
+ /// The progress value of progress bar, progress runs form 0 to 1.
+ /// If Value is set to 0, progress bar will be set to beginning.
+ /// If Value is set to 1, progress bar will be set to end.
+ /// Any Value outside of the range is ignored.
///
public float ProgressValue { @@ -220,11 +220,11 @@ namespace Tizen.NUI.UIComponents } } /// - /// The secondary progress value of the progress bar, the secondary progress runs from 0 to 1.
+ /// The secondary progress value of progress bar, secondary progress runs form 0 to 1.
/// Optional. If not supplied, the default is 0.
- /// If the value is set to 0, then the progress bar will be set secondary progress to beginning.
- /// If the value is set to 1, then the progress bar will be set secondary progress to end.
- /// Any value outside of the range is ignored.
+ /// If Value is set to 0, progress bar will be set secondary progress to beginning.
+ /// If Value is set to 1, progress bar will be set secondary progress to end.
+ /// Any Value outside of the range is ignored.
///
public float SecondaryProgressValue { @@ -240,7 +240,7 @@ namespace Tizen.NUI.UIComponents } } /// - /// Sets the progress bar as \e indeterminate state. + /// Sets the progress-bar as \e indeterminate state. /// public bool Indeterminate { @@ -256,7 +256,7 @@ namespace Tizen.NUI.UIComponents } } /// - /// The track visual value of progress bar, it's full progress area, and it's shown behind the PROGRESS_VISUAL.
+ /// The track Visual value of progress bar, it's a full progress area and it's shown behind PROGRESS_VISUAL.
/// Optional. If not supplied, the default track visual will be shown.
///
public Tizen.NUI.PropertyMap TrackVisual @@ -273,8 +273,8 @@ namespace Tizen.NUI.UIComponents } } /// - /// The progress visual value of the progress bar, the size of the progress visual is changed based on the PROGRESS_VALUE.
- /// Optional. If not supplied, then the default progress visual will be shown.
+ /// The progress Visual value of progress bar, size of the progress visual is changed based on PROGRESS_VALUE.
+ /// Optional. If not supplied, the default progress visual will be shown.
///
public Tizen.NUI.PropertyMap ProgressVisual { @@ -290,8 +290,8 @@ namespace Tizen.NUI.UIComponents } } /// - /// The secondary progress visual of the progress bar, the size of the secondary progress visual is changed based on the SECONDARY_PROGRESS_VALUE.
- /// Optional. If not supplied, then the secondary progress visual will not be shown.
+ /// The secondary progress visual of progress bar, size of the secondary progress visual is changed based on SECONDARY_PROGRESS_VALUE.
+ /// Optional. If not supplied, the secondary progress visual will not be shown.
///
public Tizen.NUI.PropertyMap SecondaryProgressVisual { @@ -307,8 +307,8 @@ namespace Tizen.NUI.UIComponents } } /// - /// The indeterminate visual of the progress bar.
- /// Optional. If not supplied, then the default indeterminate visual will be shown.
+ /// The indeterminate visual of progress bar.
+ /// Optional. If not supplied, the default inditerminate visual will be shown.
///
public Tizen.NUI.PropertyMap IndeterminateVisual { @@ -324,8 +324,8 @@ namespace Tizen.NUI.UIComponents } } /// - /// The transition data for the indeterminate visual animation.
- /// Optional. If not supplied, then the default animation will be played.
+ /// The transition data for indeterminate visual animation.
+ /// Optional. If not supplied, default animation will be played.
///
public Tizen.NUI.PropertyArray IndeterminateVisualAnimation { @@ -341,7 +341,7 @@ namespace Tizen.NUI.UIComponents } } /// - /// The label visual of the progress bar. + /// The Label visual of progress bar. /// public Tizen.NUI.PropertyMap LabelVisual { diff --git a/src/Tizen.NUI/src/public/UIComponents/PushButton.cs b/src/Tizen.NUI/src/public/UIComponents/PushButton.cs index d587b6763..4c8ee8edc 100755 --- a/src/Tizen.NUI/src/public/UIComponents/PushButton.cs +++ b/src/Tizen.NUI/src/public/UIComponents/PushButton.cs @@ -21,7 +21,7 @@ namespace Tizen.NUI.UIComponents { /// - /// The PushButton changes its appearance when it is pressed, and returns to its original when it is released. + /// A PushButton changes its appearance when is pressed and returns to its original when is released. /// public class PushButton : Button { @@ -38,7 +38,7 @@ namespace Tizen.NUI.UIComponents } /// - /// To dispose the PushButton instance. + /// To make PushButton instance be disposed. /// protected override void Dispose(DisposeTypes type) { @@ -72,7 +72,7 @@ namespace Tizen.NUI.UIComponents } - internal new class Property + internal class Property { internal static readonly int UNSELECTED_ICON = NDalicPINVOKE.PushButton_Property_UNSELECTED_ICON_get(); internal static readonly int SELECTED_ICON = NDalicPINVOKE.PushButton_Property_SELECTED_ICON_get(); @@ -173,7 +173,7 @@ namespace Tizen.NUI.UIComponents } } [Obsolete("Please do not use! this will be deprecated")] - public new Vector4 LabelPadding + public Vector4 LabelPadding { get { @@ -206,23 +206,23 @@ namespace Tizen.NUI.UIComponents public enum IconAlignmentType { /// - /// The icon located to the left of text. + /// Icon located to the left of text. /// Left, /// - /// The icon located to the right of text. + /// Icon located to the right of text. /// Right, /// - /// The icon located to the top of text. + /// Icon located to the top of text. /// Top, /// - /// The icon located to the bottom of text. + /// Icon located to the bottom of text. /// Bottom, /// - /// The icon located to the right of text by default. + /// Icon located to the right of text by default. /// Default = Right } diff --git a/src/Tizen.NUI/src/public/UIComponents/RadioButton.cs b/src/Tizen.NUI/src/public/UIComponents/RadioButton.cs index 8785870f3..d082422d8 100755 --- a/src/Tizen.NUI/src/public/UIComponents/RadioButton.cs +++ b/src/Tizen.NUI/src/public/UIComponents/RadioButton.cs @@ -18,17 +18,17 @@ namespace Tizen.NUI.UIComponents { /// - /// A RadioButton provides a radio button with two states, \e selected or \e unselected.
- /// Radio buttons are designed to select one of the many options at the same time.
- /// A RadioButton can change its current state using the selected.
+ /// A RadioButton provides a radio button which two states \e selected or \e unselected.
+ /// Radio buttons are designed to select one of many option at the same time.
+ /// RadioButton can change its current state using Selected.
///
/// RadioButtons can be grouped.
/// Two or more RadioButtons are in one group when they have this same parent.
/// In each groups only one RadioButton can be \e selected at a given time.
- /// So when a RadioButton is set to \e selected, other RadioButtons in its group are set to \e unselected.
- /// When \e selected RadioButton is set to \e unselected, no other RadioButtons in this group are set to \e selected.
+ /// So when RadioButton is set to \e selected, other RadioButtons in its group are set to \e unselected.
+ /// When \e selected RadioButton is set to \e unselected no other RadioButtons in his group is set to \e selected.
///
- /// The StateChanged event is emitted when the RadioButton change its state to \e selected or \e unselected.
+ /// A StateChanged Event is emitted when the RadioButton change its state to \e selected or \e unselected.
///
public class RadioButton : Button { @@ -45,7 +45,7 @@ namespace Tizen.NUI.UIComponents } /// - /// To dispose the RadioButton instance. + /// To make RadioButton instance be disposed. /// protected override void Dispose(DisposeTypes type) { @@ -79,7 +79,7 @@ namespace Tizen.NUI.UIComponents base.Dispose(type); } /// - /// Creates an uninitialized RadioButton. + /// Creates an uninitialized RadioButton /// public RadioButton() : this(NDalicPINVOKE.RadioButton_New__SWIG_0(), true) { @@ -88,9 +88,9 @@ namespace Tizen.NUI.UIComponents } /// - /// Creates an uninitialized RadioButton with the label. + /// Creates an uninitialized RadioButton with Label /// - /// The label text. + /// Label text public RadioButton(string label) : this(NDalicPINVOKE.RadioButton_New__SWIG_1(label), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); diff --git a/src/Tizen.NUI/src/public/UIComponents/ScrollBar.cs b/src/Tizen.NUI/src/public/UIComponents/ScrollBar.cs index 32844d9ba..9a9a5ad61 100755 --- a/src/Tizen.NUI/src/public/UIComponents/ScrollBar.cs +++ b/src/Tizen.NUI/src/public/UIComponents/ScrollBar.cs @@ -22,7 +22,7 @@ namespace Tizen.NUI.UIComponents using Tizen.NUI.BaseComponents; /// - /// The ScrollBar is a UI component that can be linked to the scrollable objects + /// ScrollBar is a UI component that can be linked to the scrollable objects /// indicating the current scroll position of the scrollable object.
///
public class ScrollBar : View @@ -40,7 +40,7 @@ namespace Tizen.NUI.UIComponents } /// - /// To dispose the ScrollBar instance. + /// To make ScrollBar instance be disposed. /// protected override void Dispose(DisposeTypes type) { @@ -84,21 +84,21 @@ namespace Tizen.NUI.UIComponents } /// - /// Event arguments that passed via the PanFinished event. + /// Event arguments that passed via PanFinished event /// public class PanFinishedEventArgs : EventArgs { } /// - /// Event arguments that passed via the ScrollPositionIntervalReached event. + /// Event arguments that passed via ScrollPositionIntervalReached event /// public class ScrollIntervalEventArgs : EventArgs { private float _currentScrollPosition; /// - /// The current scroll position of the scrollable content. + /// current scroll position of the scrollable content /// public float CurrentScrollPosition { @@ -124,7 +124,7 @@ namespace Tizen.NUI.UIComponents private ScrollPositionIntervalReachedEventCallbackDelegate _scrollBarScrollPositionIntervalReachedEventCallbackDelegate; /// - /// The event emitted when panning is finished on the scroll indicator. + /// Event emitted when panning is finished on the scroll indicator. /// public event EventHandler PanFinished { @@ -161,7 +161,7 @@ namespace Tizen.NUI.UIComponents /// - /// This is the event emitted when the current scroll position of the scrollable content. + /// Event emitted when the current scroll position of the scrollable content /// public event EventHandler ScrollInterval { @@ -197,7 +197,7 @@ namespace Tizen.NUI.UIComponents } - internal new class Property + internal class Property { internal static readonly int SCROLL_DIRECTION = NDalicPINVOKE.ScrollBar_Property_SCROLL_DIRECTION_get(); internal static readonly int INDICATOR_HEIGHT_POLICY = NDalicPINVOKE.ScrollBar_Property_INDICATOR_HEIGHT_POLICY_get(); @@ -211,16 +211,16 @@ namespace Tizen.NUI.UIComponents } /// - /// Creates an initialized scrollbar. + /// Creates an initialized ScrollBar. /// - /// The direction of the scrollbar (either vertically or horizontally). + /// The direction of scroll bar (either vertically or horizontally) public ScrollBar(ScrollBar.Direction direction) : this(NDalicPINVOKE.ScrollBar_New__SWIG_0((int)direction), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } /// - /// Creates an uninitialized scrollbar. + /// Creates an uninitialized ScrollBar /// public ScrollBar() : this(NDalicPINVOKE.ScrollBar_New__SWIG_1(), true) { @@ -351,7 +351,7 @@ namespace Tizen.NUI.UIComponents } /// - /// The direction of the scrollbar. + /// Direction of scroll bar /// public enum Direction { @@ -360,7 +360,7 @@ namespace Tizen.NUI.UIComponents } /// - /// The indicator height policy. + /// Indicator height policy. /// public enum IndicatorHeightPolicyType { @@ -369,7 +369,7 @@ namespace Tizen.NUI.UIComponents } /// - /// The direction of the scrollbar. + /// Direction of scroll bar /// public Direction ScrollDirection { @@ -417,7 +417,7 @@ namespace Tizen.NUI.UIComponents } /// - /// The indicator height policy. + /// Indicator height policy. /// public IndicatorHeightPolicyType IndicatorHeightPolicy { @@ -465,7 +465,7 @@ namespace Tizen.NUI.UIComponents } /// - /// The fixed height of the scroll indicator. + /// the fixed height of scroll indicator. /// public float IndicatorFixedHeight { @@ -482,7 +482,7 @@ namespace Tizen.NUI.UIComponents } /// - /// The duration in seconds for the scroll indicator to become fully visible. + /// the duration in seconds for the scroll indicator to become fully visible. /// public float IndicatorShowDuration { @@ -499,7 +499,7 @@ namespace Tizen.NUI.UIComponents } /// - /// The duration in seconds for the scroll indicator to become fully invisible. + /// the duration in seconds for the scroll indicator to become fully invisible. /// public float IndicatorHideDuration { @@ -516,7 +516,7 @@ namespace Tizen.NUI.UIComponents } /// - /// The list of values to get the notification when the current scroll position of the scrollable object goes above or below any of these values. + /// the list of values to get notification when the current scroll position of the scrollable object goes above or below any of these values. /// public Tizen.NUI.PropertyArray ScrollPositionIntervals { @@ -550,7 +550,7 @@ namespace Tizen.NUI.UIComponents } /// - /// The padding at the start of the indicator. For example, the top if the scrollDirection is vertical. + /// The padding at the start of the indicator. For example, the top if scrollDirection is Vertical. /// public float IndicatorStartPadding { @@ -567,7 +567,7 @@ namespace Tizen.NUI.UIComponents } /// - /// The padding at the end of the indicator. For example, the bottom if the scrollDirection is vertical. + /// The padding at the end of the indicator. For example, the bottom if scrollDirection is Vertical. /// public float IndicatorEndPadding { diff --git a/src/Tizen.NUI/src/public/UIComponents/ScrollView.cs b/src/Tizen.NUI/src/public/UIComponents/ScrollView.cs index ea6acdcd9..67f307fdc 100755 --- a/src/Tizen.NUI/src/public/UIComponents/ScrollView.cs +++ b/src/Tizen.NUI/src/public/UIComponents/ScrollView.cs @@ -73,7 +73,7 @@ namespace Tizen.NUI } /** - * @brief Event arguments that passed via the SnapStarted signal + * @brief Event arguments that passed via SnapStarted signal * */ public class SnapStartedEventArgs : EventArgs @@ -103,9 +103,9 @@ namespace Tizen.NUI private SnapStartedCallbackDelegate _scrollViewSnapStartedCallbackDelegate; /** - * @brief Event for the SnapStarted signal which can be used to subscribe or unsubscribe the event handler + * @brief Event for SnapStarted signal which can be used to subscribe/unsubscribe the event handler * (in the type of SnapStartedEventHandler-DaliEventHandler) provided by the user. - * The SnapStarted signal is emitted when the ScrollView has started to snap or flick (it tells the target + * SnapStarted signal is emitted hen the ScrollView has started to snap or flick (it tells the target * position, scale, rotation for the snap or flick). * */ @@ -297,7 +297,7 @@ namespace Tizen.NUI } - public new class Property + public class Property { public static readonly int WRAP_ENABLED = NDalicPINVOKE.ScrollView_Property_WRAP_ENABLED_get(); public static readonly int PANNING_ENABLED = NDalicPINVOKE.ScrollView_Property_PANNING_ENABLED_get(); diff --git a/src/Tizen.NUI/src/public/UIComponents/Slider.cs b/src/Tizen.NUI/src/public/UIComponents/Slider.cs index 928646d08..3bb0e1267 100755 --- a/src/Tizen.NUI/src/public/UIComponents/Slider.cs +++ b/src/Tizen.NUI/src/public/UIComponents/Slider.cs @@ -22,7 +22,7 @@ namespace Tizen.NUI.UIComponents using Tizen.NUI.BaseComponents; /// - /// The slider is a control to enable sliding an indicator between two values. + /// Slider is a control to enable sliding an indicator between two values. /// public class Slider : View { @@ -39,7 +39,7 @@ namespace Tizen.NUI.UIComponents } /// - /// Dispose. + /// Dispose /// protected override void Dispose(DisposeTypes type) { @@ -89,7 +89,7 @@ namespace Tizen.NUI.UIComponents } /// - /// The ValueChanged event arguments. + /// Value changed event arguments. /// public class ValueChangedEventArgs : EventArgs { @@ -97,7 +97,7 @@ namespace Tizen.NUI.UIComponents private float _slideValue; /// - /// The slider. + /// Slider. /// public Slider Slider { @@ -112,7 +112,7 @@ namespace Tizen.NUI.UIComponents } /// - /// The slider value. + /// Slider value. /// public float SlideValue { @@ -128,7 +128,7 @@ namespace Tizen.NUI.UIComponents } /// - /// The SlidingFinished event arguments. + /// Sliding finished event arguments. /// public class SlidingFinishedEventArgs : EventArgs { @@ -136,7 +136,7 @@ namespace Tizen.NUI.UIComponents private float _slideValue; /// - /// The slider. + /// Slider. /// public Slider Slider { @@ -151,7 +151,7 @@ namespace Tizen.NUI.UIComponents } /// - /// The slider value. + /// Slider value. /// public float SlideValue { @@ -167,7 +167,7 @@ namespace Tizen.NUI.UIComponents } /// - /// The MarkReached event arguments. + /// Mark reached event arguments. /// public class MarkReachedEventArgs : EventArgs { @@ -175,7 +175,7 @@ namespace Tizen.NUI.UIComponents private int _slideValue; /// - /// The slider. + /// Slider. /// public Slider Slider { @@ -190,7 +190,7 @@ namespace Tizen.NUI.UIComponents } /// - /// The slider value. + /// Slider value. /// public int SlideValue { @@ -222,7 +222,7 @@ namespace Tizen.NUI.UIComponents private MarkReachedCallbackDelegate _sliderMarkReachedCallbackDelegate; /// - /// An event emitted when the slider value changes. + /// Event emitted when the slider value changes. /// public event EventHandlerWithReturnType ValueChanged { @@ -263,7 +263,7 @@ namespace Tizen.NUI.UIComponents } /// - /// An event emitted when the sliding is finished. + /// Event emitted when the sliding is finished. /// public event EventHandlerWithReturnType SlidingFinished { @@ -304,7 +304,7 @@ namespace Tizen.NUI.UIComponents } /// - /// An event emitted when the slider handle reaches a mark. + /// Event emitted when the slider handle reaches a mark. /// public event EventHandlerWithReturnType MarkReached { @@ -345,10 +345,10 @@ namespace Tizen.NUI.UIComponents } /// - /// Gets the slider from the pointer. + /// Get Slider from the pointer. /// - /// The pointer of the slider. - /// The object of the slider type. + /// The pointer of Slider + /// Object of Slider type internal static Slider GetSliderFromPtr(global::System.IntPtr cPtr) { Slider ret = new Slider(cPtr, false); @@ -356,7 +356,7 @@ namespace Tizen.NUI.UIComponents return ret; } - internal new class Property : global::System.IDisposable + internal class Property : global::System.IDisposable { private global::System.Runtime.InteropServices.HandleRef swigCPtr; protected bool swigCMemOwn; @@ -461,7 +461,7 @@ namespace Tizen.NUI.UIComponents } /// - /// Creates the slider control. + /// Creates the Slider control. /// public Slider() : this(NDalicPINVOKE.Slider_New(), true) { @@ -481,12 +481,12 @@ namespace Tizen.NUI.UIComponents } /// - /// Downcasts an object handle to the slider.
- /// If the handle points to a slider, then the downcast produces a valid handle.
- /// If not, then the returned handle is left uninitialized.
+ /// Downcasts an Object handle to Slider.
+ /// If handle points to a Slider, the downcast produces valid handle.
+ /// If not, the returned handle is left uninitialized.
///
- /// The handle to an object. - /// The handle to a slider or an uninitialized handle. + /// Handle to an object + /// Handle to a Slider or an uninitialized handle public new static Slider DownCast(BaseHandle handle) { Slider ret = Registry.GetManagedBaseHandleFromNativePtr(handle) as Slider; @@ -516,7 +516,7 @@ namespace Tizen.NUI.UIComponents } /// - /// The lower bound property. + /// Lower bound property /// public float LowerBound { @@ -533,7 +533,7 @@ namespace Tizen.NUI.UIComponents } /// - /// The upper bound property. + /// Upper bound property /// public float UpperBound { @@ -550,7 +550,7 @@ namespace Tizen.NUI.UIComponents } /// - /// The value property. + /// Value property /// public float Value { @@ -567,7 +567,7 @@ namespace Tizen.NUI.UIComponents } /// - /// The track visual property. + /// Track visual property /// public PropertyMap TrackVisual { @@ -584,7 +584,7 @@ namespace Tizen.NUI.UIComponents } /// - /// The handle visual property. + /// Handle visual property /// public PropertyMap HandleVisual { @@ -601,7 +601,7 @@ namespace Tizen.NUI.UIComponents } /// - /// The progress visual property. + /// Progress visual property /// public PropertyMap ProgressVisual { @@ -618,7 +618,7 @@ namespace Tizen.NUI.UIComponents } /// - /// The popup visual property. + /// Popup visual property /// public PropertyMap PopupVisual { @@ -635,7 +635,7 @@ namespace Tizen.NUI.UIComponents } /// - /// The popup arrow visual property. + /// Popup arrow visual property /// public PropertyMap PopupArrowVisual { @@ -652,7 +652,7 @@ namespace Tizen.NUI.UIComponents } /// - /// The disable color property. + /// Disable color property /// public Vector4 DisabledColor { @@ -669,7 +669,7 @@ namespace Tizen.NUI.UIComponents } /// - /// The value precision property. + /// Value presicion property /// public int ValuePrecision { @@ -686,7 +686,7 @@ namespace Tizen.NUI.UIComponents } /// - /// The show popup property. + /// Show popup property /// public bool ShowPopup { @@ -703,7 +703,7 @@ namespace Tizen.NUI.UIComponents } /// - /// The show value property. + /// Show value property /// public bool ShowValue { @@ -720,7 +720,7 @@ namespace Tizen.NUI.UIComponents } /// - /// The marks property. + /// Marks property /// public Tizen.NUI.PropertyArray Marks { @@ -737,7 +737,7 @@ namespace Tizen.NUI.UIComponents } /// - /// The snap to marks property. + /// Snap to marks property /// public bool SnapToMarks { @@ -754,7 +754,7 @@ namespace Tizen.NUI.UIComponents } /// - /// The mark tolerance property. + /// Mark tolerance property /// public float MarkTolerance { diff --git a/src/Tizen.NUI/src/public/UIComponents/ToggleButton.cs b/src/Tizen.NUI/src/public/UIComponents/ToggleButton.cs index a861e9555..fe3eef4e2 100755 --- a/src/Tizen.NUI/src/public/UIComponents/ToggleButton.cs +++ b/src/Tizen.NUI/src/public/UIComponents/ToggleButton.cs @@ -65,7 +65,7 @@ namespace Tizen.NUI base.Dispose(type); } - public new class Property + public class Property { public static readonly int STATE_VISUALS = NDalicPINVOKE.ToggleButton_Property_STATE_VISUALS_get(); public static readonly int TOOLTIPS = NDalicPINVOKE.ToggleButton_Property_TOOLTIPS_get(); diff --git a/src/Tizen.NUI/src/public/Vector2.cs b/src/Tizen.NUI/src/public/Vector2.cs index 1687a9889..b8e05da1a 100755 --- a/src/Tizen.NUI/src/public/Vector2.cs +++ b/src/Tizen.NUI/src/public/Vector2.cs @@ -18,7 +18,7 @@ namespace Tizen.NUI { /// - /// A two-dimensional vector. + /// A two dimensional vector. /// public class Vector2 : global::System.IDisposable { @@ -100,86 +100,86 @@ namespace Tizen.NUI } /// - /// The addition operator. + /// Addition operator. /// - /// The first value. - /// The second value. - /// The vector containing the result of the addition. + /// First value + /// Second value + /// A vector containing the result of the addition public static Vector2 operator +(Vector2 arg1, Vector2 arg2) { return arg1.Add(arg2); } /// - /// The subtraction operator. + /// Subtraction operator. /// - /// The first value. - /// The second value. - /// The vector containing the result of the subtraction. + /// First value + /// Second value + /// A vector containing the result of the subtraction public static Vector2 operator -(Vector2 arg1, Vector2 arg2) { return arg1.Subtract(arg2); } /// - /// The unary negation operator. + /// Unary negation operator. /// - /// The target value. - /// The vector containing the negation. + /// Target Value + /// A vector containg the negation public static Vector2 operator -(Vector2 arg1) { return arg1.Subtract(); } /// - /// The multiplication operator. + /// Multiplication operator. /// - /// The first value. - /// The second value. - /// The vector containing the result of the multiplication. + /// First Value + /// Second Value + /// A vector containing the result of the multiplication public static Vector2 operator *(Vector2 arg1, Vector2 arg2) { return arg1.Multiply(arg2); } /// - /// Th multiplication operator. + /// Multiplication operator. /// - /// The first value. - /// The float value to scale the vector. - /// The vector containing the result of the scaling. + /// First Value + /// The float value to scale the vector + /// A vector containing the result of the scaling public static Vector2 operator *(Vector2 arg1, float arg2) { return arg1.Multiply(arg2); } /// - /// The division operator. + /// Division operator. /// - /// The first value. - /// The second value. - /// The vector containing the result of the division. + /// First Value + /// Second Value + /// A vector containing the result of the division public static Vector2 operator /(Vector2 arg1, Vector2 arg2) { return arg1.Divide(arg2); } /// - /// Th division operator. + /// Division operator. /// - /// The first value. - /// The float value to scale the vector by. - /// The vector containing the result of the scaling. + /// First Value + /// The float value to scale the vector by + /// A vector containing the result of the scaling public static Vector2 operator /(Vector2 arg1, float arg2) { return arg1.Divide(arg2); } /// - /// The array subscript operator overload. + /// Array subscript operator overload. /// - /// The subscript index. - /// The float at the given index. + /// Subscript index + /// The float at the given index public float this[uint index] { get @@ -196,7 +196,7 @@ namespace Tizen.NUI } /// - /// The default constructor initializes the vector to 0. + /// Default constructor, initializes the vector to 0. /// public Vector2() : this(NDalicPINVOKE.new_Vector2__SWIG_0(), true) { @@ -204,44 +204,44 @@ namespace Tizen.NUI } /// - /// The constructor. + /// Constructor. /// - /// The x or width component. - /// The y or height component. + /// x or width component + /// y or height component public Vector2(float x, float y) : this(NDalicPINVOKE.new_Vector2__SWIG_1(x, y), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } /// - /// The conversion constructor from an array of two floats. + /// Conversion constructor from an array of two floats. /// - /// The array of xy. + /// Array of xy public Vector2(float[] array) : this(NDalicPINVOKE.new_Vector2__SWIG_2(array), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } /// - /// The constructor. + /// Constructor. /// - /// Vector3 to create this vector from. + /// Vector3 to create this vector from public Vector2(Vector3 vec3) : this(NDalicPINVOKE.new_Vector2__SWIG_3(Vector3.getCPtr(vec3)), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } /// - /// The constructor. + /// Constructor. /// - /// Vector4 to create this vector from. + /// Vector4 to create this vector from public Vector2(Vector4 vec4) : this(NDalicPINVOKE.new_Vector2__SWIG_4(Vector4.getCPtr(vec4)), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } /// - /// (1.0f,1.0f). + /// (1.0f,1.0f) /// public static Vector2 One { @@ -255,7 +255,7 @@ namespace Tizen.NUI } /// - /// The vector representing the x-axis. + /// Vector representing the X axis /// public static Vector2 XAxis { @@ -269,7 +269,7 @@ namespace Tizen.NUI } /// - /// The vector representing the y-axis. + /// Vector representing the Y axis /// public static Vector2 YAxis { @@ -283,7 +283,7 @@ namespace Tizen.NUI } /// - /// The vector representing the negative x-axis. + /// Vector representing the negative X axis /// public static Vector2 NegativeXAxis { @@ -297,7 +297,7 @@ namespace Tizen.NUI } /// - /// The vector representing the negative y-axis. + /// Vector representing the negative Y axis /// public static Vector2 NegativeYAxis { @@ -311,7 +311,7 @@ namespace Tizen.NUI } /// - /// (0.0f, 0.0f). + /// (0.0f, 0.0f) /// public static Vector2 Zero { @@ -439,7 +439,7 @@ namespace Tizen.NUI /// /// Returns the length of the vector. /// - /// The length of the vector. + /// The length of the vector public float Length() { float ret = NDalicPINVOKE.Vector2_Length(swigCPtr); @@ -461,7 +461,7 @@ namespace Tizen.NUI } /// - /// Sets the vector to be the unit length, whilst maintaining its direction. + /// Sets the vector to be unit length, whilst maintaining its direction. /// public void Normalize() { @@ -472,8 +472,8 @@ namespace Tizen.NUI /// /// Clamps the vector between minimum and maximum vectors. /// - /// The minimum vector. - /// The maximum vector. + /// The minimum vector + /// The maximum vector public void Clamp(Vector2 min, Vector2 max) { NDalicPINVOKE.Vector2_Clamp(swigCPtr, Vector2.getCPtr(min), Vector2.getCPtr(max)); @@ -489,7 +489,7 @@ namespace Tizen.NUI } /// - /// The x component. + /// x component /// public float X { @@ -507,7 +507,7 @@ namespace Tizen.NUI } /// - /// The width. + /// width /// public float Width { @@ -525,7 +525,7 @@ namespace Tizen.NUI } /// - /// The y component. + /// y component /// public float Y { @@ -543,7 +543,7 @@ namespace Tizen.NUI } /// - /// The height. + /// height /// public float Height { diff --git a/src/Tizen.NUI/src/public/Vector3.cs b/src/Tizen.NUI/src/public/Vector3.cs index 2c8fb248f..dcd16e67f 100755 --- a/src/Tizen.NUI/src/public/Vector3.cs +++ b/src/Tizen.NUI/src/public/Vector3.cs @@ -18,7 +18,7 @@ namespace Tizen.NUI { /// - /// A three-dimensional vector. + /// A three dimensional vector. /// public class Vector3 : global::System.IDisposable { @@ -100,86 +100,86 @@ namespace Tizen.NUI } /// - /// The addition operator. + /// Addition operator. /// - /// The first value. - /// The second value. - /// The vector containing the result of the addition. + /// First Value + /// Second Value + /// A vector containing the result of the addition public static Vector3 operator +(Vector3 arg1, Vector3 arg2) { return arg1.Add(arg2); } /// - /// The subtraction operator. + /// Subtraction operator. /// - /// The first value. - /// The second value. - /// The vector containing the result of the subtraction. + /// First Value + /// Second Value + /// A vector containing the result of the subtraction public static Vector3 operator -(Vector3 arg1, Vector3 arg2) { return arg1.Subtract(arg2); } /// - /// The unary negation operator. + /// Unary negation operator. /// - /// The target value. - /// The vector containg the negation. + /// Target Value + /// A vector containg the negation public static Vector3 operator -(Vector3 arg1) { return arg1.Subtract(); } /// - /// The multiplication operator. + /// Multiplication operator. /// - /// The first value. - /// The second value. - /// The vector containing the result of the multiplication. + /// First Value + /// Second Value + /// A vector containing the result of the multiplication public static Vector3 operator *(Vector3 arg1, Vector3 arg2) { return arg1.Multiply(arg2); } /// - /// The multiplication operator. + /// Multiplication operator. /// - /// The first value. - /// The float value to scale the vector. - /// The vector containing the result of the scaling. + /// First Value + /// The float value to scale the vector + /// A vector containing the result of the scaling public static Vector3 operator *(Vector3 arg1, float arg2) { return arg1.Multiply(arg2); } /// - /// The division operator. + /// Division operator. /// - /// The first value. - /// The second value. - /// The vector containing the result of the division. + /// First Value + /// Second Value + /// A vector containing the result of the division public static Vector3 operator /(Vector3 arg1, Vector3 arg2) { return arg1.Divide(arg2); } /// - /// The division operator. + /// Division operator. /// - /// The first value. - /// The float value to scale the vector by. - /// The vector containing the result of the scaling. + /// First Value + /// The float value to scale the vector by + /// A vector containing the result of the scaling public static Vector3 operator /(Vector3 arg1, float arg2) { return arg1.Divide(arg2); } /// - /// An array subscript operator overload. + /// Array subscript operator overload. /// - /// The subscript index. - /// The float at the given index. + /// Subscript index + /// The float at the given index public float this[uint index] { get @@ -196,7 +196,7 @@ namespace Tizen.NUI } /// - /// The constructor. + /// Constructor. /// public Vector3() : this(NDalicPINVOKE.new_Vector3__SWIG_0(), true) { @@ -204,11 +204,11 @@ namespace Tizen.NUI } /// - /// The default constructor initializes the vector to 0. + /// Default constructor, initializes the vector to 0. /// - /// The x (or width) component. - /// The y (or height) component. - /// The z (or depth) component. + /// x (or width) component + /// y (or height) component + /// z (or depth) component public Vector3(float x, float y, float z) : this(NDalicPINVOKE.new_Vector3__SWIG_1(x, y, z), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -217,32 +217,32 @@ namespace Tizen.NUI /// /// Conversion constructor from an array of three floats. /// - /// An array of xyz. + /// Array of xyz public Vector3(float[] array) : this(NDalicPINVOKE.new_Vector3__SWIG_2(array), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } /// - /// The constructor. + /// Constructor. /// - /// Vector2 to create this vector from. + /// Vector2 to create this vector from public Vector3(Vector2 vec2) : this(NDalicPINVOKE.new_Vector3__SWIG_3(Vector2.getCPtr(vec2)), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } /// - /// The constructor. + /// Constructor /// - /// Vector4 to create this vector from. + /// Vector4 to create this vector from public Vector3(Vector4 vec4) : this(NDalicPINVOKE.new_Vector3__SWIG_4(Vector4.getCPtr(vec4)), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } /// - /// (1.0f,1.0f,1.0f). + /// (1.0f,1.0f,1.0f) /// public static Vector3 One { @@ -256,7 +256,7 @@ namespace Tizen.NUI } /// - /// The vector representing the x-axis. + /// Vector representing the X axis /// public static Vector3 XAxis { @@ -270,7 +270,7 @@ namespace Tizen.NUI } /// - /// The vector representing the y-axis. + /// Vector representing the Y axis /// public static Vector3 YAxis { @@ -284,7 +284,7 @@ namespace Tizen.NUI } /// - /// The vector representing the z-axis. + /// Vector representing the Z axis /// public static Vector3 ZAxis { @@ -298,7 +298,7 @@ namespace Tizen.NUI } /// - /// The vector representing the negative x-axis. + /// Vector representing the negative X axis /// public static Vector3 NegativeXAxis { @@ -312,7 +312,7 @@ namespace Tizen.NUI } /// - /// Th vector representing the negative y-axis. + /// Vector representing the negative Y axis /// public static Vector3 NegativeYAxis { @@ -326,7 +326,7 @@ namespace Tizen.NUI } /// - /// The vector representing the negative z-axis. + /// Vector representing the negative Z axis /// public static Vector3 NegativeZAxis { @@ -340,7 +340,7 @@ namespace Tizen.NUI } /// - /// (0.0f, 0.0f, 0.0f). + /// (0.0f, 0.0f, 0.0f) /// public static Vector3 Zero { @@ -489,7 +489,7 @@ namespace Tizen.NUI /// /// Returns the length of the vector. /// - /// The length of the vector. + /// The length of the vector public float Length() { float ret = NDalicPINVOKE.Vector3_Length(swigCPtr); @@ -502,7 +502,7 @@ namespace Tizen.NUI /// This is more efficient than Length() for threshold /// testing as it avoids the use of a square root.
/// - /// The length of the vector squared. + /// The length of the vector squared public float LengthSquared() { float ret = NDalicPINVOKE.Vector3_LengthSquared(swigCPtr); @@ -522,8 +522,8 @@ namespace Tizen.NUI /// /// Clamps the vector between minimum and maximum vectors. /// - /// The minimum vector. - /// The maximum vector. + /// The minimum vector + /// The maximum vector public void Clamp(Vector3 min, Vector3 max) { NDalicPINVOKE.Vector3_Clamp(swigCPtr, Vector3.getCPtr(min), Vector3.getCPtr(max)); @@ -539,9 +539,9 @@ namespace Tizen.NUI } /// - /// Returns the x and y components (or width and height, or r and g) as a Vector2. + /// Returns the x & y components (or width & height, or r & g) as a Vector2. /// - /// The partial vector contents as Vector2 (x,y). + /// The partial vector contents as Vector2 (x,y) public Vector2 GetVectorXY() { Vector2 ret = new Vector2(NDalicPINVOKE.Vector3_GetVectorXY__SWIG_0(swigCPtr), false); @@ -550,9 +550,9 @@ namespace Tizen.NUI } /// - /// Returns the y and z components (or height and depth, or g and b) as a Vector2. + /// Returns the y & z components (or height & depth, or g & b) as a Vector2. /// - /// The partial vector contents as Vector2 (y,z). + /// The partial vector contents as Vector2 (y,z) public Vector2 GetVectorYZ() { Vector2 ret = new Vector2(NDalicPINVOKE.Vector3_GetVectorYZ__SWIG_0(swigCPtr), false); @@ -561,7 +561,7 @@ namespace Tizen.NUI } /// - /// The x component. + /// x component /// public float X { @@ -579,7 +579,7 @@ namespace Tizen.NUI } /// - /// The width component. + /// width component /// public float Width { @@ -597,7 +597,7 @@ namespace Tizen.NUI } /// - /// The red component. + /// red component /// public float R { @@ -615,7 +615,7 @@ namespace Tizen.NUI } /// - /// The y component. + /// y component /// public float Y { @@ -633,7 +633,7 @@ namespace Tizen.NUI } /// - /// The height component. + /// height component /// public float Height { @@ -651,7 +651,7 @@ namespace Tizen.NUI } /// - /// The green component. + /// green component /// public float G { @@ -669,7 +669,7 @@ namespace Tizen.NUI } /// - /// The z component. + /// z component /// public float Z { @@ -687,7 +687,7 @@ namespace Tizen.NUI } /// - /// The depth component. + /// depth component /// public float Depth { @@ -705,7 +705,7 @@ namespace Tizen.NUI } /// - /// The blue component. + /// blue component /// public float B { diff --git a/src/Tizen.NUI/src/public/Vector4.cs b/src/Tizen.NUI/src/public/Vector4.cs index 6e0ed18cb..3fefc5b88 100755 --- a/src/Tizen.NUI/src/public/Vector4.cs +++ b/src/Tizen.NUI/src/public/Vector4.cs @@ -18,7 +18,7 @@ namespace Tizen.NUI { /// - /// A four-dimensional vector. + /// A four dimensional vector. /// public class Vector4 : global::System.IDisposable { @@ -100,86 +100,86 @@ namespace Tizen.NUI } /// - /// The addition operator. + /// Addition operator. /// - /// The first value. - /// The second value. - /// The vector containing the result of the addition. + /// First value + /// Second value + /// A vector containing the result of the addition public static Vector4 operator +(Vector4 arg1, Vector4 arg2) { return arg1.Add(arg2); } /// - /// The subtraction operator. + /// Subtraction operator. /// - /// The first value. - /// The second value. - /// The vector containing the result of the subtraction. + /// First value + /// Second value + /// A vector containing the result of the subtraction public static Vector4 operator -(Vector4 arg1, Vector4 arg2) { return arg1.Subtract(arg2); } /// - /// The unary negation operator. + /// Unary negation operator. /// - /// The target value. - /// The vector containing the negation. + /// Target Value + /// A vector containg the negation public static Vector4 operator -(Vector4 arg1) { return arg1.Subtract(); } /// - /// The multiplication operator. + /// Multiplication operator. /// - /// The first value. - /// The second value. - /// The vector containing the result of the multiplication. + /// First Value + /// Second Value + /// A vector containing the result of the multiplication public static Vector4 operator *(Vector4 arg1, Vector4 arg2) { return arg1.Multiply(arg2); } /// - /// The multiplication operator. + /// Multiplication operator. /// - /// The first value. - /// The float value to scale the vector. - /// The vector containing the result of scaling. + /// First Value + /// The float value to scale the vector + /// A vector containing the result of the scaling public static Vector4 operator *(Vector4 arg1, float arg2) { return arg1.Multiply(arg2); } /// - /// The division operator. + /// Division operator. /// - /// The first value. - /// The second value. - /// The vector containing the result of the division. + /// First Value + /// Second Value + /// A vector containing the result of the division public static Vector4 operator /(Vector4 arg1, Vector4 arg2) { return arg1.Divide(arg2); } /// - /// The division operator. + /// Division operator. /// - /// The first value. - /// The float value to scale the vector by. - /// The vector containing the result of scaling. + /// First Value + /// The float value to scale the vector by + /// A vector containing the result of the scaling public static Vector4 operator /(Vector4 arg1, float arg2) { return arg1.Divide(arg2); } /// - /// The array subscript operator overload. + /// Array subscript operator overload. /// - /// The subscript index. - /// The float at the given index. + /// Subscript index + /// The float at the given index public float this[uint index] { get @@ -196,7 +196,7 @@ namespace Tizen.NUI } /// - /// The default constructor initializes the vector to 0. + /// Default constructor, initializes the vector to 0. /// public Vector4() : this(NDalicPINVOKE.new_Vector4__SWIG_0(), true) { @@ -204,46 +204,46 @@ namespace Tizen.NUI } /// - /// The conversion constructor from four floats. + /// Conversion constructor from four floats. /// - /// The x (or r/s) component. - /// The y (or g/t) component. - /// The z (or b/p) component. - /// The w (or a/q) component. + /// x (or r/s) component + /// y (or g/t) component + /// z (or b/p) component + /// w (or a/q) component public Vector4(float x, float y, float z, float w) : this(NDalicPINVOKE.new_Vector4__SWIG_1(x, y, z, w), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } /// - /// The conversion constructor from an array of four floats. + /// Conversion constructor from an array of four floats. /// - /// The array of either xyzw/rgba/stpq. + /// array Array of either xyzw/rgba/stpq public Vector4(float[] array) : this(NDalicPINVOKE.new_Vector4__SWIG_2(array), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } /// - /// The conversion constructor from Vector2. + /// Conversion constructor from Vector2. /// - /// Vector2 to copy from, z and w are initialized to 0. + /// Vector2 to copy from, z and w are initialized to 0 public Vector4(Vector2 vec2) : this(NDalicPINVOKE.new_Vector4__SWIG_3(Vector2.getCPtr(vec2)), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } /// - /// The conversion constructor from Vector3. + /// Conversion constructor from Vector3. /// - /// Vector3 to copy from, w is initialized to 0. + /// Vector3 to copy from, w is initialized to 0 public Vector4(Vector3 vec3) : this(NDalicPINVOKE.new_Vector4__SWIG_4(Vector3.getCPtr(vec3)), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } /// - /// (1.0f,1.0f,1.0f,1.0f). + /// (1.0f,1.0f,1.0f,1.0f) /// public static Vector4 One { @@ -257,7 +257,7 @@ namespace Tizen.NUI } /// - /// (1.0f,0.0f,0.0f,0.0f). + /// (1.0f,0.0f,0.0f,0.0f) /// public static Vector4 XAxis { @@ -271,7 +271,7 @@ namespace Tizen.NUI } /// - /// (0.0f,1.0f,0.0f,0.0f). + /// (0.0f,1.0f,0.0f,0.0f) /// public static Vector4 YAxis { @@ -285,7 +285,7 @@ namespace Tizen.NUI } /// - /// (0.0f,0.0f,1.0f,0.0f). + /// (0.0f,0.0f,1.0f,0.0f) /// public static Vector4 ZAxis { @@ -299,7 +299,7 @@ namespace Tizen.NUI } /// - /// (0.0f, 0.0f, 0.0f, 0.0f). + /// (0.0f, 0.0f, 0.0f, 0.0f) /// public static Vector4 Zero { @@ -455,7 +455,7 @@ namespace Tizen.NUI /// /// Returns the length of the vector. /// - /// The length. + /// The length public float Length() { float ret = NDalicPINVOKE.Vector4_Length(swigCPtr); @@ -468,7 +468,7 @@ namespace Tizen.NUI /// This is faster than using Length() when performing /// threshold checks as it avoids use of the square root.
/// - /// The length of the vector squared. + /// The length of the vector squared public float LengthSquared() { float ret = NDalicPINVOKE.Vector4_LengthSquared(swigCPtr); @@ -489,8 +489,8 @@ namespace Tizen.NUI /// /// Clamps the vector between minimum and maximum vectors. /// - /// The minimum vector. - /// The maximum vector. + /// The minimum vector + /// The maximum vector public void Clamp(Vector4 min, Vector4 max) { NDalicPINVOKE.Vector4_Clamp(swigCPtr, Vector4.getCPtr(min), Vector4.getCPtr(max)); @@ -506,7 +506,7 @@ namespace Tizen.NUI } /// - /// The x component. + /// x component /// public float X { @@ -524,7 +524,7 @@ namespace Tizen.NUI } /// - /// The red component. + /// red component /// public float R { @@ -542,7 +542,7 @@ namespace Tizen.NUI } /// - /// The s component. + /// s component /// public float S { @@ -560,7 +560,7 @@ namespace Tizen.NUI } /// - /// The y component. + /// y component /// public float Y { @@ -578,7 +578,7 @@ namespace Tizen.NUI } /// - /// The green component. + /// green component /// public float G { @@ -596,7 +596,7 @@ namespace Tizen.NUI } /// - /// The t component. + /// t component /// public float T { @@ -614,7 +614,7 @@ namespace Tizen.NUI } /// - /// The z component. + /// z component /// public float Z { @@ -632,7 +632,7 @@ namespace Tizen.NUI } /// - /// The blue component. + /// blue component /// public float B { @@ -650,7 +650,7 @@ namespace Tizen.NUI } /// - /// The p component. + /// p component /// public float P { @@ -668,7 +668,7 @@ namespace Tizen.NUI } /// - /// The w component. + /// w component /// public float W { @@ -686,7 +686,7 @@ namespace Tizen.NUI } /// - /// The alpha component. + /// alpha component /// public float A { @@ -704,7 +704,7 @@ namespace Tizen.NUI } /// - /// The q component. + /// q component /// public float Q { diff --git a/src/Tizen.NUI/src/public/VisualBase.cs b/src/Tizen.NUI/src/public/VisualBase.cs index c745c5148..c36046215 100755 --- a/src/Tizen.NUI/src/public/VisualBase.cs +++ b/src/Tizen.NUI/src/public/VisualBase.cs @@ -14,15 +14,12 @@ * */ -using System; -using System.Runtime.InteropServices; - namespace Tizen.NUI { /// /// Sets whether the actor should be focusable by keyboard navigation.
- /// Visuals reuse geometry, shader etc. across controls. They ensure that the renderer and texture sets exist only when control is on window.
+ /// Visuals reuse geometry, shader etc. across controls. They ensure that the renderer and texture sets exist only when control is on-window.
/// Each visual also responds to actor size and color change, and provides clipping at the renderer level.
///
public class VisualBase : BaseHandle @@ -71,7 +68,7 @@ namespace Tizen.NUI } /// - /// Creates an empty visual handle. + /// Create an empty Visual Handle /// public VisualBase() : this(NDalicPINVOKE.new_VisualBase__SWIG_0(), true) { @@ -84,7 +81,7 @@ namespace Tizen.NUI } /// - /// The name of the visual. + /// name of the visual /// public string Name { @@ -112,9 +109,9 @@ namespace Tizen.NUI } /// - /// Sets the transform and the control size. + /// Sets the transform and the control size /// - /// A property map describing the transform. + /// A property map describing the transform /// The size of the parent control for visuals that need to scale internally. public void SetTransformAndSize(PropertyMap transform, Vector2 controlSize) { @@ -125,7 +122,7 @@ namespace Tizen.NUI /// /// Returns the height for a given width. /// - /// The width to use. + /// Width to use. /// The height based on the width. public float GetHeightForWidth(float width) { @@ -137,7 +134,7 @@ namespace Tizen.NUI /// /// Returns the width for a given height. /// - /// The height to use. + /// Height to use. /// The width based on the height. public float GetWidthForHeight(float height) { @@ -147,11 +144,11 @@ namespace Tizen.NUI } /// - /// Returns the natural size of the visual.
- /// Deriving classes stipulate the natural size and by default a visual has a zero natural size.
+ /// Return the natural size of the visual.
+ /// Deriving classes stipulate the natural size and by default a visual has a ZERO natural size.
/// A visual may not actually have a natural size until it has been placed on window and acquired all it's resources.
///
- /// The visual's natural size. + /// The visual's natural size public void GetNaturalSize(Size2D naturalSize) { NDalicPINVOKE.VisualBase_GetNaturalSize(swigCPtr, Size2D.getCPtr(naturalSize)); @@ -159,7 +156,7 @@ namespace Tizen.NUI } /// - /// The depth index of this visual. + /// the depth index of this visual. /// public int DepthIndex { @@ -186,15 +183,10 @@ namespace Tizen.NUI } /// - /// Creates the property map representing this visual. + /// Create the property map representing this visual. /// - [Obsolete("Please be caution! this will be readonly.")] public PropertyMap Creation { - set - { - CreatePropertyMap(value); - } get { PropertyMap map = new PropertyMap(); @@ -202,7 +194,6 @@ namespace Tizen.NUI return map; } } - internal void CreatePropertyMap(PropertyMap map) { NDalicPINVOKE.VisualBase_CreatePropertyMap(swigCPtr, PropertyMap.getCPtr(map)); diff --git a/src/Tizen.NUI/src/public/VisualFactory.cs b/src/Tizen.NUI/src/public/VisualFactory.cs index 4462e7166..b1e1d7336 100755 --- a/src/Tizen.NUI/src/public/VisualFactory.cs +++ b/src/Tizen.NUI/src/public/VisualFactory.cs @@ -19,7 +19,7 @@ namespace Tizen.NUI { /// - /// The VisualFactory is a singleton object that provides and shares visuals between views. + /// VisualFactory is a singleton object that provides and shares visuals between views /// public class VisualFactory : BaseHandle { @@ -82,10 +82,10 @@ namespace Tizen.NUI /// - /// Request the visual. + /// Request the visual /// /// The map contains the properties required by the visual. The content of the map determines the type of visual that will be returned. - /// The handle to the created visual. + /// The handle to the created visual public VisualBase CreateVisual(PropertyMap propertyMap) { VisualBase ret = new VisualBase(NDalicPINVOKE.VisualFactory_CreateVisual__SWIG_0(swigCPtr, PropertyMap.getCPtr(propertyMap)), true); @@ -103,7 +103,7 @@ namespace Tizen.NUI private static readonly VisualFactory instance = VisualFactory.Get(); /// - /// Retrieves the VisualFactory singleton. + /// retrieve VisualFactory singleton. /// public static VisualFactory Instance { diff --git a/src/Tizen.NUI/src/public/VisualMaps.cs b/src/Tizen.NUI/src/public/VisualMaps.cs index a6f99f0b5..90d1e3721 100755 --- a/src/Tizen.NUI/src/public/VisualMaps.cs +++ b/src/Tizen.NUI/src/public/VisualMaps.cs @@ -15,12 +15,11 @@ namespace Tizen.NUI { - using System.Text; using System.Collections.Generic; using Tizen.NUI.BaseComponents; /// - /// A class encapsulating the transform map of the visual. + /// A class encapsulating the transform map of visual. /// public class VisualMap { @@ -59,7 +58,7 @@ namespace Tizen.NUI } /// - /// Gets or sets the size of the visual.
+ /// Get or set size of the visual.
/// It can be either relative (percentage of the parent) /// or absolute (in world units).
/// Optional. @@ -82,7 +81,7 @@ namespace Tizen.NUI } /// - /// Gets or sets the offset of the visual.
+ /// Get or set offset of the visual.
/// It can be either relative (percentage of the parent) /// or absolute (in world units).
/// Optional. @@ -105,7 +104,7 @@ namespace Tizen.NUI } /// - /// Gets or sets the relative size of the visual
+ /// Get or set relative size of the visual
/// (percentage [0.0f to 1.0f] of the control).
/// Optional. ///
@@ -124,7 +123,7 @@ namespace Tizen.NUI } /// - /// Gets or sets the relative offset of the visual
+ /// Get or set relative offset of the visual
/// (percentage [0.0f to 1.0f] of the control).
/// Optional. ///
@@ -143,9 +142,9 @@ namespace Tizen.NUI } /// - /// Gets or sets whether the x and y offset values are relative
+ /// Get or set whether the x and y offset values are relative
/// (percentage [0.0f to 1.0f] of the control) or absolute (in world units).
- /// By default, both the x and the y offset are relative.
+ /// Be default, both the x and the y offset is relative.
/// Optional. ///
public VisualTransformPolicyType PositionPolicy @@ -178,9 +177,9 @@ namespace Tizen.NUI } /// - /// Gets or sets whether the x offset values are relative
+ /// Get or set whether the x offset values are relative
/// (percentage [0.0f to 1.0f] of the control) or absolute (in world units).
- /// By default, the x offset is relative.
+ /// Be default, the x offset is relative.
/// Optional. ///
public VisualTransformPolicyType PositionPolicyX @@ -218,9 +217,9 @@ namespace Tizen.NUI } /// - /// Gets or sets whether the y offset values are relative
+ /// Get or set whether the y offset values are relative
/// (percentage [0.0f to 1.0f] of the control) or absolute (in world units).
- /// By default, the y offset is relative.
+ /// Be default, the y offset is relative.
/// Optional. ///
public VisualTransformPolicyType PositionPolicyY @@ -257,9 +256,9 @@ namespace Tizen.NUI } /// - /// Gets or sets whether the size values of the width or the height are relative
+ /// Get or set whether the width or height size values are relative
/// (percentage [0.0f to 1.0f] of the control) or absolute (in world units).
- /// By default, offsets of both the width and the height are relative to the control's size.
+ /// Be default, both the width and the height offset is relative to the control's size.
/// Optional. ///
public VisualTransformPolicyType SizePolicy @@ -292,9 +291,9 @@ namespace Tizen.NUI } /// - /// Gets or sets whether size values of the width are relative.
+ /// Get or set whether the width size values are relative
/// (percentage [0.0f to 1.0f] of the control) or absolute (in world units).
- /// By default, the value of the width is relative to the control's width.
+ /// Be default, the width value is relative to the control's width.
/// Optional. ///
public VisualTransformPolicyType SizePolicyWidth @@ -331,9 +330,9 @@ namespace Tizen.NUI } /// - /// Gets or sets whether size values of the height are relative
+ /// Get or set whether the height size values are relative
/// (percentage [0.0f to 1.0f] of the control) or absolute (in world units).
- /// By default, the height value is relative to the control's height.
+ /// Be default, both the height value is relative to the control's height.
/// Optional. ///
public VisualTransformPolicyType SizePolicyHeight @@ -370,8 +369,8 @@ namespace Tizen.NUI } /// - /// Gets or sets the origin of the visual within its control area.
- /// By default, the origin is center.
+ /// Get or set the origin of the visual within its control area.
+ /// By default, the origin is Center.
/// Optional. ///
public Visual.AlignType Origin @@ -388,8 +387,8 @@ namespace Tizen.NUI } /// - /// Gets or sets the anchor point of the visual.
- /// By default, the anchor point is center.
+ /// Get or set the anchor-point of the visual.
+ /// By default, the anchor point is Center.
/// Optional. ///
public Visual.AlignType AnchorPoint @@ -406,7 +405,7 @@ namespace Tizen.NUI } /// - /// Gets or sets the depth index of the visual.
+ /// Get or set the depth index of the visual.
/// By default, the depth index is 0.
/// Optional. ///
@@ -434,7 +433,7 @@ namespace Tizen.NUI } /// - /// Gets the transform map used by the visual. + /// Get the transform map used by the visual. /// public PropertyMap OutputTransformMap { @@ -451,7 +450,7 @@ namespace Tizen.NUI } /// - /// Gets the property map to create the visual. + /// Get the property map to create the visual. /// public PropertyMap OutputVisualMap { @@ -499,8 +498,8 @@ namespace Tizen.NUI } /// - /// Enables or disables the premultiplied alpha.
- /// The premultiplied alpha is false by default unless this behavior is modified by the derived visual type. + /// Enables/disables premultiplied alpha.
+ /// The premultiplied alpha is false by default unless this behaviour is modified by the derived Visual type. ///
public bool PremultipliedAlpha { @@ -532,7 +531,7 @@ namespace Tizen.NUI } /// - /// Opacity is the alpha component of the mix color discussed above. + /// Opacity is the alpha component of the mixColor, above. /// public float Opacity { @@ -550,7 +549,7 @@ namespace Tizen.NUI } /// - /// A class encapsulating the property map of the image visual. + /// A class encapsulating the property map of a image visual. /// public class ImageVisual : VisualMap { @@ -571,9 +570,12 @@ namespace Tizen.NUI private WrapModeType? _wrapModeV = null; private float? _maskContentScale = null; private bool? _cropToMask = null; + private ReleasePolicyType? _releasePolicy = null; + private LoadPolicyType? _loadPolicy = null; + private bool? _orientationCorrection = true; /// - /// Gets or sets the URL of the image.
+ /// Get or set the URL of the image.
/// Mandatory. ///
@@ -592,7 +594,7 @@ namespace Tizen.NUI /// - /// Gets or sets the URL of the alpha mask.
+ /// Get or set the URL of the alpha mask.
/// Optional. ///
public string AlphaMaskURL @@ -609,9 +611,9 @@ namespace Tizen.NUI } /// - /// Gets or sets fitting options used when resizing images to fit the desired dimensions.
- /// If not supplied, the default is FittingModeType.ShrinkToFit.
- /// For normal quad images only.
+ /// Get or set fitting options, used when resizing images to fit desired dimensions.
+ /// If not supplied, default is FittingModeType.ShrinkToFit.
+ /// For Normal Quad images only.
/// Optional. ///
public FittingModeType FittingMode @@ -628,9 +630,9 @@ namespace Tizen.NUI } /// - /// Gets or sets filtering options used when resizing images to the sample original pixels.
- /// If not supplied, the default is SamplingModeType.Box.
- /// For normal quad images only.
+ /// Get or set filtering options, used when resizing images to sample original pixels.
+ /// If not supplied, default is SamplingModeType.Box.
+ /// For Normal Quad images only.
/// Optional. ///
public SamplingModeType SamplingMode @@ -647,9 +649,9 @@ namespace Tizen.NUI } /// - /// Gets or sets the desired image width.
+ /// Get or set the desired image width.
/// If not specified, the actual image width is used.
- /// For normal quad images only.
+ /// For Normal Quad images only.
/// Optional. ///
public int DesiredWidth @@ -666,9 +668,9 @@ namespace Tizen.NUI } /// - /// Gets or sets the desired image height.
+ /// Get or set the desired image height.
/// If not specified, the actual image height is used.
- /// For normal quad images only.
+ /// For Normal Quad images only.
/// Optional. ///
public int DesiredHeight @@ -685,9 +687,9 @@ namespace Tizen.NUI } /// - /// Gets or sets whether to load the image synchronously.
- /// If not specified, the default is false, i.e., the image is loaded asynchronously.
- /// For normal quad images only.
+ /// Get or set whether to load the image synchronously.
+ /// If not specified, the default is false, i.e. the image is loaded asynchronously.
+ /// For Normal Quad images only.
/// Optional. ///
public bool SynchronousLoading @@ -704,9 +706,9 @@ namespace Tizen.NUI } /// - /// Gets or sets whether to draw the borders only (If true).
+ /// Get or set whether to draws the borders only(If true).
/// If not specified, the default is false.
- /// For n-patch images only.
+ /// For N-Patch images only.
/// Optional. ///
public bool BorderOnly @@ -723,11 +725,11 @@ namespace Tizen.NUI } /// - /// Gets or sets the image area to be displayed.
+ /// Get or set the image area to be displayed.
/// It is a rectangular area.
- /// The first two elements indicate the top-left position of the area, and the last two elements are the areas of the width and the height respectively.
- /// If not specified, the default value is Vector4 (0.0, 0.0, 1.0, 1.0), i.e., the entire area of the image.
- /// For normal quad images only.
+ /// The first two elements indicate the top-left position of the area, and the last two elements are the area width and height respectively.
+ /// If not specified, the default value is Vector4(0.0, 0.0, 1.0, 1.0), i.e. the entire area of the image.
+ /// For For Normal QUAD image only.
/// Optional. ///
public Vector4 PixelArea @@ -744,10 +746,10 @@ namespace Tizen.NUI } /// - /// Gets or sets the wrap mode for the u coordinate.
+ /// Get or set the wrap mode for u coordinate.
/// It decides how the texture should be sampled when the u coordinate exceeds the range of 0.0 to 1.0.
/// If not specified, the default is WrapModeType.Default(CLAMP).
- /// For normal quad images only.
+ /// For Normal QUAD image only.
/// Optional. ///
public WrapModeType WrapModeU @@ -764,11 +766,11 @@ namespace Tizen.NUI } /// - /// Gets or sets the wrap mode for the v coordinate.
+ /// Get or set the wrap mode for v coordinate.
/// It decides how the texture should be sampled when the v coordinate exceeds the range of 0.0 to 1.0.
- /// The first two elements indicate the top-left position of the area, and the last two elements are the areas of the width and the height respectively.
+ /// The first two elements indicate the top-left position of the area, and the last two elements are the area width and height respectively.
/// If not specified, the default is WrapModeType.Default(CLAMP).
- /// For normal quad images only. + /// For Normal QUAD image only. /// Optional. ///
public WrapModeType WrapModeV @@ -810,6 +812,60 @@ namespace Tizen.NUI } } + /// + /// Get or set the Image Visual release policy
+ /// It decides if a texture should be released from the cache or kept to reduce loading time
+ ///
+ public ReleasePolicyType ReleasePolicy + { + get + { + return _releasePolicy ?? (ReleasePolicyType.Destroyed ); + } + set + { + _releasePolicy = value; + UpdateVisual(); + } + } + + + /// + /// Get or set the Image Visual image loading policy
+ /// It decides if a texture should be loaded immediately after source set or only after visual is added to window
+ ///
+ public LoadPolicyType LoadPolicy + { + get + { + return _loadPolicy ?? (LoadPolicyType.Attached); + } + set + { + _loadPolicy = value; + UpdateVisual(); + } + } + + /// + /// Get or set whether to automatically correct the orientation based on exif data.
+ /// If not specified, the default is true.
+ /// For JPEG images only.
+ /// Optional. + ///
+ public bool OrientationCorrection + { + get + { + return _orientationCorrection ?? (true); + } + set + { + _orientationCorrection = value; + UpdateVisual(); + } + } + protected override void ComposingPropertyMap() { if (_url != null) @@ -833,12 +889,15 @@ namespace Tizen.NUI if (_opacity != null) { _outputVisualMap.Add((int)Visual.Property.Opacity, new PropertyValue((float)_opacity)); } if (_maskContentScale != null) { _outputVisualMap.Add((int)ImageVisualProperty.MaskContentScale, new PropertyValue((float)_maskContentScale)); } if (_cropToMask != null) { _outputVisualMap.Add((int)ImageVisualProperty.CropToMask, new PropertyValue((bool)_cropToMask)); } + if (_releasePolicy != null) { _outputVisualMap.Add( ImageVisualProperty.ReleasePolicy , new PropertyValue((int)_releasePolicy)); } + if (_loadPolicy != null) { _outputVisualMap.Add( ImageVisualProperty.LoadPolicy, new PropertyValue((int)_loadPolicy)); } + if (_orientationCorrection != null) { _outputVisualMap.Add( ImageVisualProperty.OrientationCorrection, new PropertyValue((bool)_orientationCorrection)); } } } } /// - /// A class encapsulating the property map of the text visual. + /// A class encapsulating the property map of a text visual. /// public class TextVisual : VisualMap { @@ -857,7 +916,7 @@ namespace Tizen.NUI private bool? _enableMarkup = null; /// - /// Gets or sets the text to display in the UTF-8 format.
+ /// Get or set the text to display in UTF-8 format.
/// Mandatory. ///
public string Text @@ -874,7 +933,7 @@ namespace Tizen.NUI } /// - /// Gets or sets the requested font family to use.
+ /// Get or set the requested font family to use.
/// Optional. ///
public string FontFamily @@ -891,7 +950,7 @@ namespace Tizen.NUI } /// - /// Gets or sets the requested font style to use.
+ /// Get or set the requested font style to use.
/// Optional. ///
public PropertyMap FontStyle @@ -908,7 +967,7 @@ namespace Tizen.NUI } /// - /// Gets or sets the size of font in points.
+ /// Get or set the size of font in points.
/// Mandatory. ///
public float PointSize @@ -925,7 +984,7 @@ namespace Tizen.NUI } /// - /// Gets or sets the single-line or multi-line layout option.
+ /// Get or set the single-line or multi-line layout option.
/// If not specified, the default is false.
/// Optional. ///
@@ -943,8 +1002,8 @@ namespace Tizen.NUI } /// - /// Gets or sets the line horizontal alignment.
- /// If not specified, the default is begin.
+ /// Get or set the line horizontal alignment.
+ /// If not specified, the default is Begin.
/// Optional. ///
public HorizontalAlignment HorizontalAlignment @@ -993,8 +1052,8 @@ namespace Tizen.NUI } /// - /// Gets or sets the line vertical alignment.
- /// If not specified, the default is top.
+ /// Get or set the line vertical alignment.
+ /// If not specified, the default is Top.
/// Optional. ///
public VerticalAlignment VerticalAlignment @@ -1043,7 +1102,7 @@ namespace Tizen.NUI } /// - /// Gets or sets the color of the text.
+ /// Get or set the color of the text.
/// Optional. ///
public Color TextColor @@ -1060,7 +1119,7 @@ namespace Tizen.NUI } /// - /// Gets or sets whether the mark-up processing is enabled.
+ /// Get or set whether the mark-up processing is enabled.
/// Optional. ///
public bool EnableMarkup @@ -1100,7 +1159,7 @@ namespace Tizen.NUI } /// - /// A class encapsulating the property map of the border visual. + /// A class encapsulating the property map of a border visual. /// public class BorderVisual : VisualMap { @@ -1113,7 +1172,7 @@ namespace Tizen.NUI private bool? _antiAliasing = null; /// - /// Gets or sets the color of the border.
+ /// Get or set the color of the border.
/// Mandatory. ///
public Color Color @@ -1130,7 +1189,7 @@ namespace Tizen.NUI } /// - /// Gets or sets the width of the border (in pixels).
+ /// Get or set the width of the border (in pixels).
/// Mandatory. ///
public float BorderSize @@ -1147,8 +1206,8 @@ namespace Tizen.NUI } /// - /// Gets or sets whether the anti-aliasing of the border is required.
- /// If not supplied, the default is false.
+ /// Get or set whether anti-aliasing of the border is required.
+ /// If not supplied, default is false.
/// Optional. ///
public bool AntiAliasing @@ -1182,7 +1241,7 @@ namespace Tizen.NUI } /// - /// A class encapsulating the property map of the color visual. + /// A class encapsulating the property map of a color visual. /// public class ColorVisual : VisualMap { @@ -1193,7 +1252,7 @@ namespace Tizen.NUI private Color _mixColorForColorVisual = null; /// - /// Gets or sets the solid color required.
+ /// Get or set the solid color required.
/// Mandatory. ///
public Color Color @@ -1224,7 +1283,7 @@ namespace Tizen.NUI } /// - /// A class encapsulating the property map of the gradient visual. + /// A class encapsulating the property map of a gradient visual. /// public class GradientVisual : VisualMap { @@ -1242,8 +1301,8 @@ namespace Tizen.NUI private GradientVisualSpreadMethodType? _spreadMethod = null; /// - /// Gets or sets the start position of a linear gradient.
- /// Mandatory for linear.
+ /// Get or set the start position of a linear gradient.
+ /// Mandatory for Linear.
///
public Vector2 StartPosition { @@ -1259,8 +1318,8 @@ namespace Tizen.NUI } /// - /// Gets or sets the end position of a linear gradient.
- /// Mandatory for linear.
+ /// Get or set the end position of a linear gradient.
+ /// Mandatory for Linear.
///
public Vector2 EndPosition { @@ -1276,8 +1335,8 @@ namespace Tizen.NUI } /// - /// Gets or sets the center point of a radial gradient.
- /// Mandatory for radial.
+ /// Get or set the center point of a radial gradient.
+ /// Mandatory for Radial.
///
public Vector2 Center { @@ -1293,8 +1352,8 @@ namespace Tizen.NUI } /// - /// Gets or sets the size of the radius of a radial gradient.
- /// Mandatory for radial.
+ /// Get or set the size of the radius of a radial gradient.
+ /// Mandatory for Radial.
///
public float Radius { @@ -1310,9 +1369,9 @@ namespace Tizen.NUI } /// - /// Gets or sets all the stop offsets.
+ /// Get or set all the stop offsets.
/// A PropertyArray of float.
- /// If not supplied, the default is 0.0f and 1.0f.
+ /// If not supplied, default is 0.0f and 1.0f.
/// Optional. ///
public PropertyArray StopOffset @@ -1329,9 +1388,9 @@ namespace Tizen.NUI } /// - /// Gets or sets the color at the stop offsets.
- /// A PropertyArray of color.
- /// At least 2 values are required to show a gradient.
+ /// Get or set the color at the stop offsets.
+ /// A PropertyArray of Color.
+ /// At least 2 values required to show a gradient.
/// Mandatory. ///
public PropertyArray StopColor @@ -1348,8 +1407,8 @@ namespace Tizen.NUI } /// - /// Gets or sets descriptions of the coordinate system for certain attributes of the points in a gradient.
- /// If not supplied, the default is GradientVisualUnitsType.ObjectBoundingBox.
+ /// Get or set defines the coordinate system for certain attributes of the points in a gradient.
+ /// If not supplied, default is GradientVisualUnitsType.ObjectBoundingBox.
/// Optional. ///
public GradientVisualUnitsType Units @@ -1366,8 +1425,8 @@ namespace Tizen.NUI } /// - /// Gets or sets indications of what happens if the gradient starts or ends inside the bounds of the target rectangle.
- /// If not supplied, the default is GradientVisualSpreadMethodType.Pad.
+ /// Get or set indicates what happens if the gradient starts or ends inside the bounds of the target rectangle.
+ /// If not supplied, default is GradientVisualSpreadMethodType.Pad.
/// Optional. ///
public GradientVisualSpreadMethodType SpreadMethod @@ -1406,7 +1465,7 @@ namespace Tizen.NUI } /// - /// A class encapsulating the property map of the mesh visual. + /// A class encapsulating the property map of a mesh visual. /// public class MeshVisual : VisualMap { @@ -1423,7 +1482,7 @@ namespace Tizen.NUI private Vector3 _lightPosition = null; /// - /// Gets or sets the location of the ".obj" file.
+ /// Get or set the location of the ".obj" file.
/// Mandatory. ///
public string ObjectURL @@ -1440,7 +1499,7 @@ namespace Tizen.NUI } /// - /// Gets or sets the location of the ".mtl" file.
+ /// Get or set the location of the ".mtl" file.
/// If not specified, then a textureless object is assumed.
/// Optional. ///
@@ -1458,7 +1517,7 @@ namespace Tizen.NUI } /// - /// Gets or sets the path to the directory the textures (including gloss and normal) are stored in.
+ /// Get or set path to the directory the textures (including gloss and normal) are stored in.
/// Mandatory if using material.
///
public string TexturesPath @@ -1475,7 +1534,7 @@ namespace Tizen.NUI } /// - /// Gets or sets the type of shading mode that the mesh will use.
+ /// Get or set the type of shading mode that the mesh will use.
/// If anything the specified shading mode requires is missing, a simpler mode that can be handled with what has been supplied will be used instead.
/// If not specified, it will use the best it can support (will try MeshVisualShadingModeValue.TexturedWithDetailedSpecularLighting first).
/// Optional. @@ -1494,7 +1553,7 @@ namespace Tizen.NUI } /// - /// Gets or sets whether to use mipmaps for textures or not.
+ /// Get or set whether to use mipmaps for textures or not.
/// If not specified, the default is true.
/// Optional. ///
@@ -1512,7 +1571,7 @@ namespace Tizen.NUI } /// - /// Gets or sets whether to average normals at each point to smooth textures or not.
+ /// Get or set whether to average normals at each point to smooth textures or not.
/// If not specified, the default is true.
/// Optional. ///
@@ -1530,9 +1589,9 @@ namespace Tizen.NUI } /// - /// Gets or sets the position, in the stage space, of the point light that applies lighting to the model.
- /// This is based off the stage's dimensions, so using the width and the height of the stage halved will correspond to the center, - /// and using all zeroes will place the light at the top-left corner.
+ /// Get or set the position, in stage space, of the point light that applies lighting to the model.
+ /// This is based off the stage's dimensions, so using the width and height of the stage halved will correspond to the center, + /// and using all zeroes will place the light at the top left corner.
/// If not specified, the default is an offset outwards from the center of the screen.
/// Optional. ///
@@ -1570,7 +1629,7 @@ namespace Tizen.NUI } /// - /// A class encapsulating the property map of the primetive visual. + /// A class encapsulating the property map of a primetive visual. /// public class PrimitiveVisual : VisualMap { @@ -1592,7 +1651,7 @@ namespace Tizen.NUI private Vector3 _lightPosition = null; /// - /// Gets or sets the specific shape to render.
+ /// Get or set the specific shape to render.
/// If not specified, the default is PrimitiveVisualShapeType.Sphere.
/// Optional. ///
@@ -1610,12 +1669,12 @@ namespace Tizen.NUI } /// - /// Gets or sets the color of the shape.
- /// If not specified, the default is Color (0.5, 0.5, 0.5, 1.0).
- /// Applies to all shapes.
+ /// Get or set the color of the shape.
+ /// If not specified, the default is Color(0.5, 0.5, 0.5, 1.0).
+ /// Applies to ALL shapes.
/// Optional. ///
- public new Color MixColor + public Color MixColor { get { @@ -1629,7 +1688,7 @@ namespace Tizen.NUI } /// - /// Gets or sets the number of slices as you go around the shape.
+ /// Get or set the number of slices as you go around the shape.
/// For spheres and conical frustrums, this determines how many divisions there are as you go around the object.
/// If not specified, the default is 128.
/// The range is from 1 to 255.
@@ -1649,7 +1708,7 @@ namespace Tizen.NUI } /// - /// Gets or sets the number of stacks as you go down the shape.
+ /// Get or set the number of stacks as you go down the shape.
/// For spheres, 'stacks' determines how many layers there are as you go down the object.
/// If not specified, the default is 128.
/// The range is from 1 to 255.
@@ -1669,7 +1728,7 @@ namespace Tizen.NUI } /// - /// Gets or sets the scale of the radius of the top circle of a conical frustrum.
+ /// Get or set the scale of the radius of the top circle of a conical frustrum.
/// If not specified, the default is 1.0f.
/// Applies to: - PrimitiveVisualShapeType.ConicalFrustrum
/// Only values greater than or equal to 0.0f are accepted.
@@ -1689,7 +1748,7 @@ namespace Tizen.NUI } /// - /// Gets or sets the scale of the radius of the bottom circle of a conical frustrum.
+ /// Get or set the scale of the radius of the bottom circle of a conical frustrum.
/// If not specified, the default is 1.5f.
/// Applies to: - PrimitiveVisualShapeType.ConicalFrustrum
/// - PrimitiveVisualShapeType.Cone
@@ -1710,7 +1769,7 @@ namespace Tizen.NUI } /// - /// Gets or sets the scale of the height of a conic.
+ /// Get or set the scale of the height of a conic.
/// If not specified, the default is 3.0f.
/// Applies to:
/// - PrimitiveVisualShapeType.ConicalFrustrum
@@ -1733,7 +1792,7 @@ namespace Tizen.NUI } /// - /// Gets or sets the scale of the radius of a cylinder.
+ /// Get or set the scale of the radius of a cylinder.
/// If not specified, the default is 1.0f.
/// Applies to:
/// - PrimitiveVisualShapeType.Cylinder
@@ -1754,13 +1813,13 @@ namespace Tizen.NUI } /// - /// Gets or sets the dimensions of a cuboid. Scales in the same fashion as a 9-patch image.
+ /// Get or set the dimensions of a cuboid. Scales in the same fashion as a 9-patch image.
/// If not specified, the default is Vector3.One.
/// Applies to:
/// - PrimitiveVisualShapeType.Cube
/// - PrimitiveVisualShapeType.Octahedron
/// - PrimitiveVisualShapeType.BevelledCube
- /// Each Vector3 parameter should be greater than or equal to 0.0f.
+ /// Each vector3 parameter should be greater than or equal to 0.0f.
/// Optional. ///
public Vector3 ScaleDimensions @@ -1777,7 +1836,7 @@ namespace Tizen.NUI } /// - /// Gets or sets determines how bevelled the cuboid should be, based off the smallest dimension.
+ /// Get or set determines how bevelled the cuboid should be, based off the smallest dimension.
/// Bevel percentage ranges from 0.0 to 1.0. It affects the ratio of the outer face widths to the width of the overall cube.
/// If not specified, the default is 0.0f (no bevel).
/// Applies to:
@@ -1799,7 +1858,7 @@ namespace Tizen.NUI } /// - /// Gets or sets descriptions of how smooth the bevelled edges should be.
+ /// Get or set defines how smooth the bevelled edges should be.
/// If not specified, the default is 0.0f (sharp edges).
/// Applies to:
/// - PrimitiveVisualShapeType.BevelledCube
@@ -1820,11 +1879,11 @@ namespace Tizen.NUI } /// - /// Gets or sets the position, in the stage space, of the point light that applies lighting to the model.
- /// This is based off the stage's dimensions, so using the width and the height of the stage halved will correspond to the center, - /// and using all zeroes will place the light at the top-left corner.
+ /// Get or set the position, in stage space, of the point light that applies lighting to the model.
+ /// This is based off the stage's dimensions, so using the width and height of the stage halved will correspond to the center, + /// and using all zeroes will place the light at the top left corner.
/// If not specified, the default is an offset outwards from the center of the screen.
- /// Applies to all shapes.
+ /// Applies to ALL shapes.
/// Optional. ///
public Vector3 LightPosition @@ -1863,7 +1922,7 @@ namespace Tizen.NUI } /// - /// A class encapsulating the property map of the n-patch image visual. + /// A class encapsulating the property map of a n-patch image visual. /// public class NPatchVisual : VisualMap { @@ -1876,7 +1935,7 @@ namespace Tizen.NUI private Rectangle _border = null; /// - /// Gets or sets the URL of the image.
+ /// Get or set the URL of the image.
/// Mandatory. ///
public string URL @@ -1893,9 +1952,9 @@ namespace Tizen.NUI } /// - /// Gets or sets whether to draw the borders only (If true).
+ /// Get or set whether to draws the borders only(If true).
/// If not specified, the default is false.
- /// For n-patch images only.
+ /// For N-Patch images only.
/// Optional. ///
public bool BorderOnly @@ -1912,8 +1971,8 @@ namespace Tizen.NUI } /// - /// The border of the image is in the order: left, right, bottom, top.
- /// For n-patch images only.
+ /// The border of the image in the order: left, right, bottom, top.
+ /// For N-Patch images only.
/// Optional. ///
public Rectangle Border @@ -1947,7 +2006,7 @@ namespace Tizen.NUI } /// - /// A class encapsulating the property map of the SVG visual. + /// A class encapsulating the property map of a SVG visual. /// public class SVGVisual : VisualMap { @@ -1986,7 +2045,7 @@ namespace Tizen.NUI } /// - /// A class encapsulating the property map of the animated image (AGIF) visual. + /// A class encapsulating the property map of a Animated Image(AGIF) visual. /// public class AnimatedImageVisual : VisualMap { @@ -2003,7 +2062,7 @@ namespace Tizen.NUI { get { - if( _urls != null ) + if( _urls == null ) { return _urls[0]; } @@ -2308,9 +2367,9 @@ namespace Tizen.NUI _timePeriod.Add("delay", new PropertyValue(_startTime / 1000.0f)); _animator.Add("timePeriod", new PropertyValue(_timePeriod)); - StringBuilder sb = new StringBuilder(_propertyIndex); - sb[0] = (char)(sb[0] | 0x20); - string _str = sb.ToString(); + string _str1 = _propertyIndex.Substring(0, 1); + string _str2 = _propertyIndex.Substring(1); + string _str = _str1.ToLower() + _str2; PropertyValue val = PropertyValue.CreateFromObject(_destinationValue); diff --git a/src/Tizen.NUI/src/public/WatchTime.cs b/src/Tizen.NUI/src/public/WatchTime.cs new file mode 100755 index 000000000..3392a6cba --- /dev/null +++ b/src/Tizen.NUI/src/public/WatchTime.cs @@ -0,0 +1,353 @@ +/** Copyright (c) 2017 Samsung Electronics Co., Ltd. +* +* 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. +* +*/ +namespace Tizen.NUI +{ + /// + /// The WatchTime class is used to get time for the WatchApplication.
+ /// A WatchTime has a time handle from watch application framework.
+ /// You can get time(hour, minute, second, millisecond) and date(year, month, day)
+ /// on receiving timeTick signal. + ///
+ public class WatchTime : global::System.IDisposable + { + private global::System.Runtime.InteropServices.HandleRef swigCPtr; + protected bool swigCMemOwn; + + internal WatchTime(global::System.IntPtr cPtr, bool cMemoryOwn) + { + swigCMemOwn = cMemoryOwn; + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); + } + + internal static global::System.Runtime.InteropServices.HandleRef getCPtr(WatchTime obj) + { + return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; + } + + //A Flag to check who called Dispose(). (By User or DisposeQueue) + private bool isDisposeQueued = false; + //A Flat to check if it is already disposed. + protected bool disposed = false; + + ~WatchTime() + { + if (!isDisposeQueued) + { + isDisposeQueued = true; + DisposeQueue.Instance.Add(this); + } + } + + /// + /// To make watch time instance be disposed. + /// + public void Dispose() + { + //Throw excpetion if Dispose() is called in separate thread. + if (!Window.IsInstalled()) + { + throw new System.InvalidOperationException("This API called from separate thread. This API must be called from MainThread."); + } + + if (isDisposeQueued) + { + Dispose(DisposeTypes.Implicit); + } + else + { + Dispose(DisposeTypes.Explicit); + System.GC.SuppressFinalize(this); + } + } + + protected virtual void Dispose(DisposeTypes type) + { + if (disposed) + { + return; + } + + if (type == DisposeTypes.Explicit) + { + //Called by User + //Release your own managed resources here. + //You should release all of your own disposable objects here. + + } + + //Release your own unmanaged resources here. + //You should not access any managed member here except static instance. + //because the execution order of Finalizes is non-deterministic. + + if (swigCPtr.Handle != global::System.IntPtr.Zero) + { + if (swigCMemOwn) + { + swigCMemOwn = false; + NDalicManualPINVOKE.delete_WatchTime(swigCPtr); + } + swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); + } + + disposed = true; + } + + internal static WatchTime GetWatchTimeFromPtr(global::System.IntPtr cPtr) + { + WatchTime ret = new WatchTime(cPtr, false); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Constructor. + /// + public WatchTime() : this(NDalicManualPINVOKE.new_WatchTime(), true) + { + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } + + /// + /// Get the current hour. + /// + /// The return value is always positive.The WatchTime needs to be initialized. + public int Hour + { + get + { + return GetHour(); + } + } + + internal int GetHour() + { + int ret = NDalicManualPINVOKE.WatchTime_GetHour(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Get the current hour24. + /// + /// The return value is always positive.The WatchTime needs to be initialized. + public int Hour24 + { + get + { + return GetHour24(); + } + } + + internal int GetHour24() + { + int ret = NDalicManualPINVOKE.WatchTime_GetHour24(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Get the current minute. + /// + /// The return value is always positive.The WatchTime needs to be initialized. + public int Minute + { + get + { + return GetMinute(); + } + } + + internal int GetMinute() + { + int ret = NDalicManualPINVOKE.WatchTime_GetMinute(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Get the current second. + /// + /// The return value is always positive.The WatchTime needs to be initialized. + public int Second + { + get + { + return GetSecond(); + } + } + + internal int GetSecond() + { + int ret = NDalicManualPINVOKE.WatchTime_GetSecond(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Get the current millisecond. + /// + /// The return value is always positive.The WatchTime needs to be initialized. + public int Millisecond + { + get + { + return GetMillisecond(); + } + } + + internal int GetMillisecond() + { + int ret = NDalicManualPINVOKE.WatchTime_GetMillisecond(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Get the current year. + /// + /// The return value is always positive.The WatchTime needs to be initialized. + public int Year + { + get + { + return GetYear(); + } + } + + internal int GetYear() + { + int ret = NDalicManualPINVOKE.WatchTime_GetYear(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Get the current month. + /// + /// The return value is always positive.The WatchTime needs to be initialized. + public int Month + { + get + { + return GetMonth(); + } + } + + internal int GetMonth() + { + int ret = NDalicManualPINVOKE.WatchTime_GetMonth(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Get the current day. + /// + /// The return value is always positive.The WatchTime needs to be initialized. + public int Day + { + get + { + return GetDay(); + } + } + + internal int GetDay() + { + int ret = NDalicManualPINVOKE.WatchTime_GetDay(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Get the current week. + /// + /// The return value is always positive.The WatchTime needs to be initialized. + public int DayOfWeek + { + get + { + return GetDayOfWeek(); + } + } + + internal int GetDayOfWeek() + { + int ret = NDalicManualPINVOKE.WatchTime_GetDayOfWeek(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal SWIGTYPE_p_tm GetUtcTime() + { + SWIGTYPE_p_tm ret = new SWIGTYPE_p_tm(NDalicManualPINVOKE.WatchTime_GetUtcTime(swigCPtr), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + internal SWIGTYPE_p_time_t GetUtcTimeStamp() + { + SWIGTYPE_p_time_t ret = new SWIGTYPE_p_time_t(NDalicManualPINVOKE.WatchTime_GetUtcTimeStamp(swigCPtr), true); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Get the ID of timezone. + /// + /// + /// The WatchTime needs to be initialized.
+ /// The timezone ID, according to the IANA(Internet Assigned Numbers Authority)
+ /// If you want to see more information, please refer to the site :
+ /// https://en.wikipedia.org/wiki/List_of_tz_database_time_zones/ + ///
+ public string TimeZone + { + get + { + return GetTimeZone(); + } + } + + internal string GetTimeZone() + { + string ret = NDalicManualPINVOKE.WatchTime_GetTimeZone(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + /// + /// Get the daylight saving time status. + /// + /// The WatchTime needs to be initialized. + public bool DaylightSavingTimeStatus + { + get + { + return GetDaylightSavingTimeStatus(); + } + } + + internal bool GetDaylightSavingTimeStatus() + { + bool ret = NDalicManualPINVOKE.WatchTime_GetDaylightSavingTimeStatus(swigCPtr); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + return ret; + } + + } + +} diff --git a/src/Tizen.NUI/src/public/Wheel.cs b/src/Tizen.NUI/src/public/Wheel.cs index 286580a9a..23c8a65c9 100755 --- a/src/Tizen.NUI/src/public/Wheel.cs +++ b/src/Tizen.NUI/src/public/Wheel.cs @@ -19,7 +19,7 @@ namespace Tizen.NUI /// /// The wheel event structure is used to store a wheel rolling, it facilitates processing of the wheel rolling and passing to other libraries like Toolkit.
- /// There is a key modifier which relates to keys like Alt, Shift, and Ctrl functions are supplied to check if they have been pressed when the wheel is being rolled.
+ /// There is a key modifier which relates to keys like alt, shift and control functions are supplied to check if they have been pressed when the wheel is being rolled.
/// We support a mouse device and there may be another custom device that support the wheel event. The device type is specified as \e type.
/// The mouse wheel event can be sent to the specific actor but the custom wheel event will be sent to the window.
///
@@ -111,7 +111,7 @@ namespace Tizen.NUI } /// - /// The type of the wheel event. + /// The type of the wheel event /// public Wheel.WheelType Type { @@ -122,7 +122,7 @@ namespace Tizen.NUI } /// - /// The direction of wheel rolling (0 = default vertical wheel, 1 = horizontal wheel). + /// he direction of wheel rolling (0 = default vertical wheel, 1 = horizontal wheel) /// public int Direction { @@ -133,7 +133,7 @@ namespace Tizen.NUI } /// - /// Modifier keys pressed during the event (such as Shift, Alt, and Ctrl). + /// Modifier keys pressed during the event (such as shift, alt and control) /// public uint Modifiers { @@ -144,7 +144,7 @@ namespace Tizen.NUI } /// - /// The coordinates of the cursor relative to the top-left of the screen. + /// The co-ordinates of the cursor relative to the top-left of the screen /// public Vector2 Point { @@ -155,7 +155,7 @@ namespace Tizen.NUI } /// - /// The offset of rolling (positive value means roll down or clockwise, and negative value means roll up or counter-clockwise). + /// The offset of rolling (positive value means roll down or clockwise, and negative value means roll up or counter-clockwise) /// public int Z { @@ -166,7 +166,7 @@ namespace Tizen.NUI } /// - /// The time the wheel is being rolled. + /// The time the wheel is being rolled /// public uint TimeStamp { @@ -177,7 +177,7 @@ namespace Tizen.NUI } /// - /// The default constructor. + /// Default constructor. /// public Wheel() : this(NDalicPINVOKE.new_Wheel__SWIG_0(), true) { @@ -185,23 +185,23 @@ namespace Tizen.NUI } /// - /// The constructor. + /// Constructor. /// - /// The type of the wheel event. - /// The direction of wheel rolling (0 = default vertical wheel, 1 = horizontal wheel). - /// Modifier keys pressed during the event (such as Shift, Alt, and Ctrl). - /// The coordinates of the cursor relative to the top-left of the screen. - /// The offset of rolling (positive value means roll down or clockwise, and negative value means roll up or counter-clockwise). - /// The time the wheel is being rolled. + /// The type of the wheel event + /// The direction of wheel rolling (0 = default vertical wheel, 1 = horizontal wheel) + /// Modifier keys pressed during the event (such as shift, alt and control) + /// The co-ordinates of the cursor relative to the top-left of the screen + /// The offset of rolling (positive value means roll down or clockwise, and negative value means roll up or counter-clockwise) + /// The time the wheel is being rolled public Wheel(Wheel.WheelType type, int direction, uint modifiers, Vector2 point, int z, uint timeStamp) : this(NDalicPINVOKE.new_Wheel__SWIG_1((int)type, direction, modifiers, Vector2.getCPtr(point), z, timeStamp), true) { if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } /// - /// Checks to see if the Shift key modifier has been supplied. + /// Checks to see if Shift key modifier has been supplied. /// - /// True if Shift modifier. + /// True if shift modifier public bool IsShiftModifier() { bool ret = NDalicPINVOKE.Wheel_IsShiftModifier(swigCPtr); @@ -212,7 +212,7 @@ namespace Tizen.NUI /// /// Checks to see if Ctrl (control) key modifier has been supplied. /// - /// True if Ctrl modifier. + /// True if ctrl modifier public bool IsCtrlModifier() { bool ret = NDalicPINVOKE.Wheel_IsCtrlModifier(swigCPtr); @@ -223,7 +223,7 @@ namespace Tizen.NUI /// /// Checks to see if Alt key modifier has been supplied. /// - /// True if Alt modifier. + /// True if alt modifier public bool IsAltModifier() { bool ret = NDalicPINVOKE.Wheel_IsAltModifier(swigCPtr); @@ -323,7 +323,7 @@ namespace Tizen.NUI } /// - /// The type of the wheel event. + /// The type of the wheel event /// public enum WheelType { diff --git a/src/Tizen.NUI/src/public/Widget.cs b/src/Tizen.NUI/src/public/Widget.cs deleted file mode 100755 index 098e5abb3..000000000 --- a/src/Tizen.NUI/src/public/Widget.cs +++ /dev/null @@ -1,620 +0,0 @@ -/** Copyright (c) 2017 Samsung Electronics Co., Ltd. -* -* 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; -using Tizen.Applications; - -namespace Tizen.NUI -{ - /// - /// Widget object should be created by WidgetApplication. - /// - public class Widget : BaseHandle - { - private global::System.Runtime.InteropServices.HandleRef swigCPtr; - - internal Widget(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicManualPINVOKE.Widget_SWIGUpcast(cPtr), cMemoryOwn) - { - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - } - - internal static global::System.Runtime.InteropServices.HandleRef getCPtr(Widget obj) - { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; - } - - /// - /// To make Widget instance be disposed. - /// - protected override void Dispose(DisposeTypes type) - { - if(disposed) - { - return; - } - - if(type == DisposeTypes.Explicit) - { - //Called by User - //Release your own managed resources here. - //You should release all of your own disposable objects here. - } - - //Release your own unmanaged resources here. - //You should not access any managed member here except static instance. - //because the execution order of Finalizes is non-deterministic. - - if (swigCPtr.Handle != global::System.IntPtr.Zero) - { - if (swigCMemOwn) - { - swigCMemOwn = false; - NDalicManualPINVOKE.delete_Widget(swigCPtr); - } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - } - - base.Dispose(type); - } - - /// - /// This is the constructor for Widget. - /// - /// for widget instance - public Widget(string id) : this(NDalicManualPINVOKE.Widget_New(id), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - internal Widget(Widget widget) : this(NDalicManualPINVOKE.new_Widget__SWIG_1(Widget.getCPtr(widget)), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - internal Widget Assign(Widget widget) - { - Widget ret = new Widget(NDalicManualPINVOKE.Widget_Assign(swigCPtr, Widget.getCPtr(widget)), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// Event arguments that passed via KeyEvent signal. - /// - public class CreateEventArgs : EventArgs - { - /// - /// widget data. - /// - public WidgetData WidgetData - { - get; - set; - } - - /// - /// a bundle. - /// - public SWIGTYPE_p_bundle Bundle - { - get; - set; - } - - /// - /// window size. - /// - public Size2D WindowSize - { - get; - set; - } - } - - [UnmanagedFunctionPointer(CallingConvention.StdCall)] - private delegate void CreateCallbackType(IntPtr widgetData, IntPtr bundle, IntPtr windowSize); - private CreateCallbackType _createCallback; - private EventHandler _createEventHandler; - - /// - /// Create event. - /// - public event EventHandler Create - { - add - { - if (_createEventHandler == null) - { - _createCallback = OnCreate; - CreateSignal().Connect(_createCallback); - } - - _createEventHandler += value; - } - - remove - { - _createEventHandler -= value; - - if (_createEventHandler == null && CreateSignal().Empty() == false) - { - CreateSignal().Disconnect(_createCallback); - } - } - } - - private void OnCreate(IntPtr widgetData, IntPtr bundle, IntPtr windowSize) - { - CreateEventArgs e = new CreateEventArgs(); - if (widgetData != null) - { - e.WidgetData = WidgetData.GetWidgetDataFromPtr(widgetData); - } - if (bundle != null) - { - e.Bundle = new SWIGTYPE_p_bundle(bundle, false); - } - if (windowSize != null) - { - var val = new Uint16Pair(windowSize, false); - e.WindowSize = val; - val.Dispose(); - } - - _createEventHandler?.Invoke(this, e); - } - - internal WidgetInstanceCreateSignalType CreateSignal() - { - WidgetInstanceCreateSignalType ret = new WidgetInstanceCreateSignalType(NDalicManualPINVOKE.Widget_CreateSignal(swigCPtr), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// Event arguments that passed via terminate event signal. - /// - public class TerminateEventArgs : EventArgs - { - /// - /// widget data. - /// - public WidgetData WidgetData - { - get; - set; - } - - /// - /// a bundle. - /// - public SWIGTYPE_p_bundle Bundle - { - get; - set; - } - - /// - /// widget terminate type. - /// - public WidgetTerminateType WidgetTerminateType - { - get; - set; - } - } - - [UnmanagedFunctionPointer(CallingConvention.StdCall)] - private delegate void TerminateCallbackType(IntPtr widgetData, IntPtr bundle, WidgetTerminateType widgetTerminateType); - private TerminateCallbackType _terminateCallback; - private EventHandler _terminateEventHandler; - - /// - /// Terminate event. - /// - public event EventHandler Terminate - { - add - { - if (_terminateEventHandler == null) - { - _terminateCallback = OnTerminate; - TerminateSignal().Connect(_terminateCallback); - } - - _terminateEventHandler += value; - } - - remove - { - _terminateEventHandler -= value; - - if (_terminateEventHandler == null && TerminateSignal().Empty() == false) - { - TerminateSignal().Disconnect(_terminateCallback); - } - } - } - - private void OnTerminate(IntPtr widgetData, IntPtr bundle, WidgetTerminateType widgetTerminateType) - { - TerminateEventArgs e = new TerminateEventArgs(); - if (widgetData != null) - { - e.WidgetData = WidgetData.GetWidgetDataFromPtr(widgetData); - } - if (bundle != null) - { - e.Bundle = new SWIGTYPE_p_bundle(bundle, false); - } - - e.WidgetTerminateType = widgetTerminateType; - _terminateEventHandler?.Invoke(this, e); - } - - internal WidgetInstanceTerminateSignalType TerminateSignal() - { - WidgetInstanceTerminateSignalType ret = new WidgetInstanceTerminateSignalType(NDalicManualPINVOKE.Widget_TerminateSignal(swigCPtr), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// Event arguments that passed via pause event signal. - /// - public class PauseEventArgs : EventArgs - { - /// - /// widget data. - /// - public WidgetData WidgetData - { - get; - set; - } - } - - [UnmanagedFunctionPointer(CallingConvention.StdCall)] - private delegate void PauseCallbackType(IntPtr widgetData); - private PauseCallbackType _pauseCallback; - private EventHandler _pauseEventHandler; - - /// - /// Pause event. - /// - public event EventHandler Pause - { - add - { - if (_pauseEventHandler == null) - { - _pauseCallback = OnPause; - PauseSignal().Connect(_pauseCallback); - } - - _pauseEventHandler += value; - } - - remove - { - _pauseEventHandler -= value; - - if (_pauseEventHandler == null && PauseSignal().Empty() == false) - { - PauseSignal().Disconnect(_pauseCallback); - } - } - } - - private void OnPause(IntPtr widgetData) - { - PauseEventArgs e = new PauseEventArgs(); - if (widgetData != null) - { - e.WidgetData = WidgetData.GetWidgetDataFromPtr(widgetData); - } - - _pauseEventHandler?.Invoke(this, e); - } - - internal WidgetInstancePauseOrResumeSignalType PauseSignal() - { - WidgetInstancePauseOrResumeSignalType ret = new WidgetInstancePauseOrResumeSignalType(NDalicManualPINVOKE.Widget_PauseSignal(swigCPtr), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// Event arguments that passed via pause event signal. - /// - public class ResumeEventArgs : EventArgs - { - /// - /// widget data. - /// - public WidgetData WidgetData - { - get; - set; - } - } - - [UnmanagedFunctionPointer(CallingConvention.StdCall)] - private delegate void ResumeCallbackType(IntPtr widgetData); - private ResumeCallbackType _resumeCallback; - private EventHandler _resumeEventHandler; - - /// - /// Resume event. - /// - public event EventHandler Resume - { - add - { - if (_resumeEventHandler == null) - { - _resumeCallback = OnResume; - ResumeSignal().Connect(_resumeCallback); - } - - _resumeEventHandler += value; - } - - remove - { - _resumeEventHandler -= value; - - if (_resumeEventHandler == null && ResumeSignal().Empty() == false) - { - ResumeSignal().Disconnect(_resumeCallback); - } - } - } - - private void OnResume(IntPtr widgetData) - { - ResumeEventArgs e = new ResumeEventArgs(); - if (widgetData != null) - { - e.WidgetData = WidgetData.GetWidgetDataFromPtr(widgetData); - } - - _resumeEventHandler?.Invoke(this, e); - } - - internal WidgetInstancePauseOrResumeSignalType ResumeSignal() - { - WidgetInstancePauseOrResumeSignalType ret = new WidgetInstancePauseOrResumeSignalType(NDalicManualPINVOKE.Widget_ResumeSignal(swigCPtr), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// Event arguments that passed via resize signal. - /// - public class ResizeEventArgs : EventArgs - { - /// - /// widget data. - /// - public WidgetData WidgetData - { - get; - set; - } - - /// - /// window size. - /// - public Size2D WindowSize - { - get; - set; - } - } - - [UnmanagedFunctionPointer(CallingConvention.StdCall)] - private delegate void ResizeCallbackType(IntPtr widgetData, IntPtr windowSize); - private ResizeCallbackType _resizeCallback; - private EventHandler _resizeEventHandler; - - /// - /// Resize event. - /// - public event EventHandler Resize - { - add - { - if (_resizeEventHandler == null) - { - _resizeCallback = OnResize; - ResizeSignal().Connect(_resizeCallback); - } - - _resizeEventHandler += value; - } - - remove - { - _resizeEventHandler -= value; - - if (_resizeEventHandler == null && ResizeSignal().Empty() == false) - { - ResizeSignal().Disconnect(_resizeCallback); - } - } - } - - private void OnResize(IntPtr widgetData, IntPtr windowSize) - { - ResizeEventArgs e = new ResizeEventArgs(); - if (widgetData != null) - { - e.WidgetData = WidgetData.GetWidgetDataFromPtr(widgetData); - } - if (windowSize != null) - { - var val = new Uint16Pair(windowSize, false); - e.WindowSize = val; - val.Dispose(); - } - - _resizeEventHandler?.Invoke(this, e); - } - - internal WidgetInstanceResizeSignalType ResizeSignal() - { - WidgetInstanceResizeSignalType ret = new WidgetInstanceResizeSignalType(NDalicManualPINVOKE.Widget_ResizeSignal(swigCPtr), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// Event arguments that passed via update event signal. - /// - public class UpdateEventArgs : EventArgs - { - /// - /// widget data. - /// - public WidgetData WidgetData - { - get; - set; - } - - /// - /// A bundle. - /// - public SWIGTYPE_p_bundle Bundle - { - get; - set; - } - - /// - /// It means several steps. - /// - /// - /// 0 -> no force - /// 1 -> force but do someting - /// 2 -> force - /// - public int Force - { - get; - set; - } - } - - [UnmanagedFunctionPointer(CallingConvention.StdCall)] - private delegate void UpdateCallbackType(IntPtr widgetData, IntPtr bundle, int force); - private UpdateCallbackType _updateCallback; - private EventHandler _updateEventHandler; - - /// - /// Update event. - /// - public event EventHandler Update - { - add - { - if (_updateEventHandler == null) - { - _updateCallback = OnUpdate; - UpdateSignal().Connect(_updateCallback); - } - - _updateEventHandler += value; - } - - remove - { - _updateEventHandler -= value; - - if (_updateEventHandler == null && UpdateSignal().Empty() == false) - { - UpdateSignal().Disconnect(_updateCallback); - } - } - } - - private void OnUpdate(IntPtr widgetData, IntPtr bundle, int force) - { - UpdateEventArgs e = new UpdateEventArgs(); - if (widgetData != null) - { - e.WidgetData = WidgetData.GetWidgetDataFromPtr(widgetData); - } - if (bundle != null) - { - e.Bundle = new SWIGTYPE_p_bundle(bundle, false); - } - e.Force = force; - - _updateEventHandler?.Invoke(this, e); - } - - internal WidgetInstanceUpdateSignalType UpdateSignal() - { - WidgetInstanceUpdateSignalType ret = new WidgetInstanceUpdateSignalType(NDalicManualPINVOKE.Widget_UpdateSignal(swigCPtr), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// Enumeration for terminate type of widget instance. - /// - public enum WidgetTerminateType - { - /// - /// User deleted this widget from the viewer - /// - Permanent, - /// - /// Widget is deleted because of other reasons (e.g. widget process is terminated temporarily by the system) - /// - Temporary - } - - /// - /// Enumeration for lifecycle event type of widget instance. - /// - public enum WidgetLifecycleEventType - { - /// - /// The widget is dead. - /// - AppDead = 0, - /// - /// The widget is dead. - /// - Create = 1, - /// - /// The widget is destroyed. - /// - Destroy = 2, - /// - /// The widget is paused. - /// - Pause = 3, - /// - /// The widget is resumed. - /// - Resume = 4 - } - } -} diff --git a/src/Tizen.NUI/src/public/WidgetData.cs b/src/Tizen.NUI/src/public/WidgetData.cs deleted file mode 100755 index 70538467f..000000000 --- a/src/Tizen.NUI/src/public/WidgetData.cs +++ /dev/null @@ -1,161 +0,0 @@ -/** Copyright (c) 2017 Samsung Electronics Co., Ltd. -* -* 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. -* -*/ - -namespace Tizen.NUI -{ - /// - /// Widget data. - /// - public class WidgetData : BaseHandle - { - private global::System.Runtime.InteropServices.HandleRef swigCPtr; - - internal WidgetData(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicManualPINVOKE.WidgetData_SWIGUpcast(cPtr), cMemoryOwn) - { - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - } - - internal static global::System.Runtime.InteropServices.HandleRef getCPtr(WidgetData obj) - { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; - } - - /// - /// To make Window instance be disposed. - /// - protected override void Dispose(DisposeTypes type) - { - if(disposed) - { - return; - } - - if(type == DisposeTypes.Explicit) - { - //Called by User - //Release your own managed resources here. - //You should release all of your own disposable objects here. - } - - //Release your own unmanaged resources here. - //You should not access any managed member here except static instance. - //because the execution order of Finalizes is non-deterministic. - - if (swigCPtr.Handle != global::System.IntPtr.Zero) - { - if (swigCMemOwn) - { - swigCMemOwn = false; - NDalicManualPINVOKE.delete_WidgetData(swigCPtr); - } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - } - - base.Dispose(type); - } - - internal static WidgetData GetWidgetDataFromPtr(global::System.IntPtr cPtr) - { - WidgetData ret = new WidgetData(cPtr, false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal WidgetData(string instanceId, SWIGTYPE_p_bundle args, string content) : this(NDalicManualPINVOKE.WidgetData_New(instanceId, SWIGTYPE_p_bundle.getCPtr(args), content), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - internal WidgetData(WidgetData widgetData) : this(NDalicManualPINVOKE.new_WidgetData__SWIG_1(WidgetData.getCPtr(widgetData)), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - internal WidgetData Assign(WidgetData widgetData) - { - WidgetData ret = new WidgetData(NDalicManualPINVOKE.WidgetData_Assign(swigCPtr, WidgetData.getCPtr(widgetData)), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// Get widget instance id. - /// - /// Id of widget instance. - public string GetInstanceId() - { - string ret = NDalicManualPINVOKE.WidgetData_GetInstanceId(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal SWIGTYPE_p_bundle GetArgs() - { - global::System.IntPtr cPtr = NDalicManualPINVOKE.WidgetData_GetArgs(swigCPtr); - SWIGTYPE_p_bundle ret = (cPtr == global::System.IntPtr.Zero) ? null : new SWIGTYPE_p_bundle(cPtr, false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// Get widget instance content. - /// - /// Content of widget instance. - public string GetContent() - { - string ret = NDalicManualPINVOKE.WidgetData_GetContent(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// Get widget instance Window. - /// - /// Window of widget instance - public Window GetWindow() - { - Window ret = new Window(NDalicManualPINVOKE.WidgetData_GetWindow(swigCPtr), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal void SetArgs(SWIGTYPE_p_bundle args) - { - NDalicManualPINVOKE.WidgetData_SetArgs(swigCPtr, SWIGTYPE_p_bundle.getCPtr(args)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - /// - /// Set widget instance arguments. - /// - /// Content of widget instance - public void SetContent(string content) - { - NDalicManualPINVOKE.WidgetData_SetContent(swigCPtr, content); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - /// - /// Set widget instance arguments. - /// - /// Window of widget instance. - public void SetWindow(Window window) - { - NDalicManualPINVOKE.WidgetData_SetWindow(swigCPtr, Window.getCPtr(window)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - } -} diff --git a/src/Tizen.NUI/src/public/WidgetView.cs b/src/Tizen.NUI/src/public/WidgetView.cs deleted file mode 100755 index 26c716fd2..000000000 --- a/src/Tizen.NUI/src/public/WidgetView.cs +++ /dev/null @@ -1,671 +0,0 @@ -/** Copyright (c) 2017 Samsung Electronics Co., Ltd. -* -* 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. -* -*/ -// This File has been auto-generated by SWIG and then modified using DALi Ruby Scripts -//------------------------------------------------------------------------------ -// -// -// This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.12 -// -// Do not make changes to this file unless you know what you are doing--modify -// the SWIG interface file instead. -//------------------------------------------------------------------------------ - -namespace Tizen.NUI -{ - using System; - using System.Runtime.InteropServices; - using Tizen.NUI.BaseComponents; - - /// - /// The WidgetView is a class for displaying the widget image and controlling the widget.
- /// Input events that the WidgetView gets are delivered to the widget. - ///
- public class WidgetView : View - { - private global::System.Runtime.InteropServices.HandleRef swigCPtr; - - internal WidgetView(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicManualPINVOKE.WidgetView_SWIGUpcast(cPtr), cMemoryOwn) - { - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - } - - internal static global::System.Runtime.InteropServices.HandleRef getCPtr(WidgetView obj) - { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; - } - - /// - /// To make the Button instance be disposed. - /// - protected override void Dispose(DisposeTypes type) - { - if (disposed) - { - return; - } - - if (type == DisposeTypes.Explicit) - { - //Called by User - //Release your own managed resources here. - //You should release all of your own disposable objects here. - - } - - //Release your own unmanaged resources here. - //You should not access any managed member here except static instance. - //because the execution order of Finalizes is non-deterministic. - if (swigCPtr.Handle != global::System.IntPtr.Zero) - { - if (swigCMemOwn) - { - swigCMemOwn = false; - NDalicManualPINVOKE.delete_WidgetView(swigCPtr); - } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - } - base.Dispose(); - } - - internal new class Property - { - internal static readonly int WIDGET_ID = NDalicManualPINVOKE.WidgetView_Property_WIDGET_ID_get(); - internal static readonly int INSTANCE_ID = NDalicManualPINVOKE.WidgetView_Property_INSTANCE_ID_get(); - internal static readonly int CONTENT_INFO = NDalicManualPINVOKE.WidgetView_Property_CONTENT_INFO_get(); - internal static readonly int TITLE = NDalicManualPINVOKE.WidgetView_Property_TITLE_get(); - internal static readonly int UPDATE_PERIOD = NDalicManualPINVOKE.WidgetView_Property_UPDATE_PERIOD_get(); - internal static readonly int PREVIEW = NDalicManualPINVOKE.WidgetView_Property_PREVIEW_get(); - internal static readonly int LOADING_TEXT = NDalicManualPINVOKE.WidgetView_Property_LOADING_TEXT_get(); - internal static readonly int WIDGET_STATE_FAULTED = NDalicManualPINVOKE.WidgetView_Property_WIDGET_STATE_FAULTED_get(); - internal static readonly int PERMANENT_DELETE = NDalicManualPINVOKE.WidgetView_Property_PERMANENT_DELETE_get(); - } - - /// - /// Creates a new WidgetView. - /// - public WidgetView(string widgetId, string contentInfo, int width, int height, float updatePeriod) : this(NDalicManualPINVOKE.WidgetView_New(widgetId, contentInfo, width, height, updatePeriod), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - - } - - internal new static WidgetView DownCast(BaseHandle handle) - { - WidgetView ret = new WidgetView(NDalicManualPINVOKE.WidgetView_DownCast(BaseHandle.getCPtr(handle)), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal WidgetView(WidgetView handle) : this(NDalicManualPINVOKE.new_WidgetView__SWIG_1(WidgetView.getCPtr(handle)), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - internal WidgetView Assign(WidgetView handle) - { - WidgetView ret = new WidgetView(NDalicManualPINVOKE.WidgetView_Assign(swigCPtr, WidgetView.getCPtr(handle)), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal static WidgetView GetWidgetViewFromPtr(global::System.IntPtr cPtr) - { - WidgetView ret = new WidgetView(cPtr, false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// Event arguments of the widget view. - /// - public class WidgetViewEventArgs : EventArgs - { - private WidgetView _widgetView; - - /// - /// The widet view. - /// - public WidgetView WidgetView - { - get - { - return _widgetView; - } - set - { - _widgetView = value; - } - } - } - - private EventHandler _widgetAddedEventHandler; - [UnmanagedFunctionPointer(CallingConvention.StdCall)] - private delegate void WidgetAddedEventCallbackType(IntPtr data); - private WidgetAddedEventCallbackType _widgetAddedEventCallback; - - /// - /// An event for the ResourceReady signal which can be used to subscribe or unsubscribe the event handler.
- /// This signal is emitted after all resources required by a control are loaded and ready.
- /// Most resources are only loaded when the control is placed on the stage.
- ///
- public event EventHandler WidgetAdded - { - add - { - if (_widgetAddedEventHandler == null) - { - _widgetAddedEventCallback = OnWidgetAdded; - WidgetAddedSignal().Connect(_widgetAddedEventCallback); - } - - _widgetAddedEventHandler += value; - } - - remove - { - _widgetAddedEventHandler -= value; - - if (_widgetAddedEventHandler == null && WidgetAddedSignal().Empty() == false) - { - WidgetAddedSignal().Disconnect(_widgetAddedEventCallback); - } - } - } - - // Callback for WidgetView WidgetAdded signal - private void OnWidgetAdded(IntPtr data) - { - WidgetViewEventArgs e = new WidgetViewEventArgs(); - if(data != null) - { - e.WidgetView = WidgetView.GetWidgetViewFromPtr(data); - } - - if (_widgetAddedEventHandler != null) - { - _widgetAddedEventHandler(this, e); - } - } - - private EventHandler _widgetDeletedEventHandler; - [UnmanagedFunctionPointer(CallingConvention.StdCall)] - private delegate void WidgetDeletedEventCallbackType(IntPtr data); - private WidgetDeletedEventCallbackType _widgetDeletedEventCallback; - - /// - /// An event for the ResourceReady signal which can be used to subscribe or unsubscribe the event handler.
- /// This signal is emitted after all resources required by a control are loaded and ready.
- /// Most resources are only loaded when the control is placed on the stage.
- ///
- public event EventHandler WidgetDeleted - { - add - { - if (_widgetDeletedEventHandler == null) - { - _widgetDeletedEventCallback = OnWidgetDeleted; - WidgetDeletedSignal().Connect(_widgetDeletedEventCallback); - } - - _widgetDeletedEventHandler += value; - } - - remove - { - _widgetDeletedEventHandler -= value; - - if (_widgetDeletedEventHandler == null && WidgetDeletedSignal().Empty() == false) - { - WidgetDeletedSignal().Disconnect(_widgetDeletedEventCallback); - } - } - } - - // Callback for WidgetView WidgetDeleted signal - private void OnWidgetDeleted(IntPtr data) - { - WidgetViewEventArgs e = new WidgetViewEventArgs(); - if(data != null) - { - e.WidgetView = WidgetView.GetWidgetViewFromPtr(data); - } - - if (_widgetDeletedEventHandler != null) - { - _widgetDeletedEventHandler(this, e); - } - } - - private EventHandler _widgetCreationAbortedEventHandler; - [UnmanagedFunctionPointer(CallingConvention.StdCall)] - private delegate void WidgetCreationAbortedEventCallbackType(IntPtr data); - private WidgetCreationAbortedEventCallbackType _widgetCreationAbortedEventCallback; - - /// - /// An event for the ResourceReady signal which can be used to subscribe or unsubscribe the event handler.
- /// This signal is emitted after all resources required by a control are loaded and ready.
- /// Most resources are only loaded when the control is placed on the stage.
- ///
- public event EventHandler WidgetCreationAborted - { - add - { - if (_widgetCreationAbortedEventHandler == null) - { - _widgetCreationAbortedEventCallback = OnWidgetCreationAborted; - WidgetCreationAbortedSignal().Connect(_widgetCreationAbortedEventCallback); - } - - _widgetCreationAbortedEventHandler += value; - } - - remove - { - _widgetCreationAbortedEventHandler -= value; - - if (_widgetCreationAbortedEventHandler == null && WidgetCreationAbortedSignal().Empty() == false) - { - WidgetCreationAbortedSignal().Disconnect(_widgetCreationAbortedEventCallback); - } - } - } - - // Callback for WidgetView WidgetCreationAborted signal - private void OnWidgetCreationAborted(IntPtr data) - { - WidgetViewEventArgs e = new WidgetViewEventArgs(); - if(data != null) - { - e.WidgetView = WidgetView.GetWidgetViewFromPtr(data); - } - - if (_widgetCreationAbortedEventHandler != null) - { - _widgetCreationAbortedEventHandler(this, e); - } - } - - private EventHandler _widgetContentUpdatedEventHandler; - [UnmanagedFunctionPointer(CallingConvention.StdCall)] - private delegate void WidgetContentUpdatedEventCallbackType(IntPtr data); - private WidgetContentUpdatedEventCallbackType _widgetContentUpdatedEventCallback; - - /// - /// An event for the ResourceReady signal which can be used to subscribe or unsubscribe the event handler.
- /// This signal is emitted after all resources required by a control are loaded and ready.
- /// Most resources are only loaded when the control is placed on the stage.
- ///
- public event EventHandler WidgetContentUpdated - { - add - { - if (_widgetContentUpdatedEventHandler == null) - { - _widgetContentUpdatedEventCallback = OnWidgetContentUpdated; - WidgetContentUpdatedSignal().Connect(_widgetContentUpdatedEventCallback); - } - - _widgetContentUpdatedEventHandler += value; - } - - remove - { - _widgetContentUpdatedEventHandler -= value; - - if (_widgetContentUpdatedEventHandler == null && WidgetContentUpdatedSignal().Empty() == false) - { - WidgetContentUpdatedSignal().Disconnect(_widgetContentUpdatedEventCallback); - } - } - } - - // Callback for WidgetView WidgetContentUpdated signal - private void OnWidgetContentUpdated(IntPtr data) - { - WidgetViewEventArgs e = new WidgetViewEventArgs(); - if(data != null) - { - e.WidgetView = WidgetView.GetWidgetViewFromPtr(data); - } - - if (_widgetContentUpdatedEventHandler != null) - { - _widgetContentUpdatedEventHandler(this, e); - } - } - - private EventHandler _widgetUpdatePeriodChangedEventHandler; - [UnmanagedFunctionPointer(CallingConvention.StdCall)] - private delegate void WidgetUpdatePeriodChangedEventCallbackType(IntPtr data); - private WidgetUpdatePeriodChangedEventCallbackType _widgetUpdatePeriodChangedEventCallback; - - /// - /// An event for the ResourceReady signal which can be used to subscribe or unsubscribe the event handler.
- /// This signal is emitted after all resources required by a control are loaded and ready.
- /// Most resources are only loaded when the control is placed on the stage.
- ///
- public event EventHandler WidgetUpdatePeriodChanged - { - add - { - if (_widgetUpdatePeriodChangedEventHandler == null) - { - _widgetUpdatePeriodChangedEventCallback = OnWidgetUpdatePeriodChanged; - WidgetUpdatePeriodChangedSignal().Connect(_widgetUpdatePeriodChangedEventCallback); - } - - _widgetUpdatePeriodChangedEventHandler += value; - } - - remove - { - _widgetUpdatePeriodChangedEventHandler -= value; - - if (_widgetUpdatePeriodChangedEventHandler == null && WidgetUpdatePeriodChangedSignal().Empty() == false) - { - WidgetUpdatePeriodChangedSignal().Disconnect(_widgetUpdatePeriodChangedEventCallback); - } - } - } - - // Callback for WidgetView WidgetUpdatePeriodChanged signal - private void OnWidgetUpdatePeriodChanged(IntPtr data) - { - WidgetViewEventArgs e = new WidgetViewEventArgs(); - if(data != null) - { - e.WidgetView = WidgetView.GetWidgetViewFromPtr(data); - } - - if (_widgetUpdatePeriodChangedEventHandler != null) - { - _widgetUpdatePeriodChangedEventHandler(this, e); - } - } - - private EventHandler _widgetFaultedEventHandler; - [UnmanagedFunctionPointer(CallingConvention.StdCall)] - private delegate void WidgetFaultedEventCallbackType(IntPtr data); - private WidgetFaultedEventCallbackType _widgetFaultedEventCallback; - - /// - /// An event for the ResourceReady signal which can be used to subscribe or unsubscribe the event handler.
- /// This signal is emitted after all resources required by a control are loaded and ready.
- /// Most resources are only loaded when the control is placed on the stage.
- ///
- public event EventHandler WidgetFaulted - { - add - { - if (_widgetFaultedEventHandler == null) - { - _widgetFaultedEventCallback = OnWidgetFaulted; - WidgetFaultedSignal().Connect(_widgetFaultedEventCallback); - } - - _widgetFaultedEventHandler += value; - } - - remove - { - _widgetFaultedEventHandler -= value; - - if (_widgetFaultedEventHandler == null && WidgetFaultedSignal().Empty() == false) - { - WidgetFaultedSignal().Disconnect(_widgetFaultedEventCallback); - } - } - } - - // Callback for WidgetView WidgetFaulted signal - private void OnWidgetFaulted(IntPtr data) - { - WidgetViewEventArgs e = new WidgetViewEventArgs(); - if(data != null) - { - e.WidgetView = WidgetView.GetWidgetViewFromPtr(data); - } - - if (_widgetFaultedEventHandler != null) - { - _widgetFaultedEventHandler(this, e); - } - } - - /// - /// Pauses a given widget. - /// - /// True on success, false otherwise. - public bool PauseWidget() - { - bool ret = NDalicManualPINVOKE.WidgetView_PauseWidget(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// Resumes a given widget. - /// - /// True on success, false otherwise. - public bool ResumeWidget() - { - bool ret = NDalicManualPINVOKE.WidgetView_ResumeWidget(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// Cancels the touch event procedure. - /// If you call this function after feed the touch down event, the widget will get ON_HOLD events. - /// If a widget gets ON_HOLD event, it will not do anything even if you feed touch up event. - /// - /// True on success, false otherwise. - public bool CancelTouchEvent() - { - bool ret = NDalicManualPINVOKE.WidgetView_CancelTouchEvent(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// Activates a widget in the faulted state. - /// A widget in faulted state must be activated before adding the widget. - /// - public void ActivateFaultedWidget() - { - NDalicManualPINVOKE.WidgetView_ActivateFaultedWidget(swigCPtr); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - internal WidgetViewSignal WidgetAddedSignal() - { - WidgetViewSignal ret = new WidgetViewSignal(NDalicManualPINVOKE.WidgetView_WidgetAddedSignal(swigCPtr), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal WidgetViewSignal WidgetDeletedSignal() - { - WidgetViewSignal ret = new WidgetViewSignal(NDalicManualPINVOKE.WidgetView_WidgetDeletedSignal(swigCPtr), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal WidgetViewSignal WidgetCreationAbortedSignal() - { - WidgetViewSignal ret = new WidgetViewSignal(NDalicManualPINVOKE.WidgetView_WidgetCreationAbortedSignal(swigCPtr), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal WidgetViewSignal WidgetContentUpdatedSignal() - { - WidgetViewSignal ret = new WidgetViewSignal(NDalicManualPINVOKE.WidgetView_WidgetContentUpdatedSignal(swigCPtr), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal WidgetViewSignal WidgetUpdatePeriodChangedSignal() - { - WidgetViewSignal ret = new WidgetViewSignal(NDalicManualPINVOKE.WidgetView_WidgetUpdatePeriodChangedSignal(swigCPtr), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal WidgetViewSignal WidgetFaultedSignal() - { - WidgetViewSignal ret = new WidgetViewSignal(NDalicManualPINVOKE.WidgetView_WidgetFaultedSignal(swigCPtr), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// Gets the ID of the widget. - /// - public string WidgetID - { - get - { - string temp; - GetProperty(WidgetView.Property.WIDGET_ID).Get(out temp); - return temp; - } - } - - /// - /// Gets the ID of the instance. - /// - public string InstanceID - { - get - { - string temp; - GetProperty(WidgetView.Property.INSTANCE_ID).Get(out temp); - return temp; - } - } - - /// - /// Gets the content info. - /// - public string ContentInfo - { - get - { - string temp; - GetProperty(WidgetView.Property.CONTENT_INFO).Get(out temp); - return temp; - } - } - - /// - /// Gets the title. - /// - public string Title - { - get - { - string temp; - GetProperty(WidgetView.Property.TITLE).Get(out temp); - return temp; - } - } - - /// - /// Gets the update peroid. - /// - public float UpdatePeriod - { - get - { - float temp; - GetProperty(WidgetView.Property.UPDATE_PERIOD).Get(out temp); - return temp; - } - } - - /// - /// Gets or sets the preview. - /// - public bool Preview - { - get - { - bool temp; - GetProperty(WidgetView.Property.PREVIEW).Get(out temp); - return temp; - } - set - { - SetProperty(WidgetView.Property.PREVIEW, new Tizen.NUI.PropertyValue(value)); - } - } - - /// - /// Gets or sets the loading text. - /// - public bool LoadingText - { - get - { - bool temp; - GetProperty(WidgetView.Property.LOADING_TEXT).Get(out temp); - return temp; - } - set - { - SetProperty(WidgetView.Property.LOADING_TEXT, new Tizen.NUI.PropertyValue(value)); - } - } - - /// - /// Gets or sets whether the widget state is faulted or not. - /// - public bool WidgetStateFaulted - { - get - { - bool temp; - GetProperty(WidgetView.Property.WIDGET_STATE_FAULTED).Get(out temp); - return temp; - } - set - { - SetProperty(WidgetView.Property.WIDGET_STATE_FAULTED, new Tizen.NUI.PropertyValue(value)); - } - } - - /// - /// Gets or sets whether the widget is to delete permanently or not. - /// - public bool PermanentDelete - { - get - { - bool temp; - GetProperty(WidgetView.Property.PERMANENT_DELETE).Get(out temp); - return temp; - } - set - { - SetProperty(WidgetView.Property.PERMANENT_DELETE, new Tizen.NUI.PropertyValue(value)); - } - } - - } - -} diff --git a/src/Tizen.NUI/src/public/WidgetViewManager.cs b/src/Tizen.NUI/src/public/WidgetViewManager.cs deleted file mode 100755 index 5391a78e3..000000000 --- a/src/Tizen.NUI/src/public/WidgetViewManager.cs +++ /dev/null @@ -1,122 +0,0 @@ -/** Copyright (c) 2017 Samsung Electronics Co., Ltd. -* -* 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. -* -*/ -// This File has been auto-generated by SWIG and then modified using DALi Ruby Scripts -//------------------------------------------------------------------------------ -// -// -// This file was automatically generated by SWIG (http://www.swig.org). -// Version 3.0.12 -// -// Do not make changes to this file unless you know what you are doing--modify -// the SWIG interface file instead. -//------------------------------------------------------------------------------ - -namespace Tizen.NUI -{ - - /// - /// WidgetViewManager manages addition of WidgetView controls. - /// This class provides the functionality of adding the widget views and controlling the widgets. - /// - public class WidgetViewManager : BaseHandle - { - private global::System.Runtime.InteropServices.HandleRef swigCPtr; - - internal WidgetViewManager(global::System.IntPtr cPtr, bool cMemoryOwn) : base(NDalicManualPINVOKE.WidgetViewManager_SWIGUpcast(cPtr), cMemoryOwn) - { - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(this, cPtr); - } - - internal static global::System.Runtime.InteropServices.HandleRef getCPtr(WidgetViewManager obj) - { - return (obj == null) ? new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero) : obj.swigCPtr; - } - - /// - /// To make WidgetViewManager instance be disposed. - /// - protected override void Dispose(DisposeTypes type) - { - if(disposed) - { - return; - } - - if(type == DisposeTypes.Explicit) - { - //Called by User - //Release your own managed resources here. - //You should release all of your own disposable objects here. - } - - //Release your own unmanaged resources here. - //You should not access any managed member here except static instance. - //because the execution order of Finalizes is non-deterministic. - if (swigCPtr.Handle != global::System.IntPtr.Zero) - { - if (swigCMemOwn) - { - swigCMemOwn = false; - NDalicManualPINVOKE.delete_WidgetViewManager(swigCPtr); - } - swigCPtr = new global::System.Runtime.InteropServices.HandleRef(null, global::System.IntPtr.Zero); - } - base.Dispose(type); - } - - public WidgetViewManager(NUIApplication nuiApplication, string appId) : this(NDalicManualPINVOKE.WidgetViewManager_New(Application.getCPtr(nuiApplication.ApplicationHandle), appId), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - internal static WidgetViewManager DownCast(BaseHandle handle) - { - WidgetViewManager ret = new WidgetViewManager(NDalicManualPINVOKE.WidgetViewManager_DownCast(BaseHandle.getCPtr(handle)), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - internal WidgetViewManager(WidgetViewManager handle) : this(NDalicManualPINVOKE.new_WidgetViewManager__SWIG_1(WidgetViewManager.getCPtr(handle)), true) - { - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - } - - internal WidgetViewManager Assign(WidgetViewManager handle) - { - WidgetViewManager ret = new WidgetViewManager(NDalicManualPINVOKE.WidgetViewManager_Assign(swigCPtr, WidgetViewManager.getCPtr(handle)), false); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - /// - /// Creates a new widget view object. - /// - /// The widget ID. - /// Contents that will be given to the widget instance. - /// The widget width. - /// The widget height. - /// The period of updating contents of the widget. - /// A handle to WidgetView. - public WidgetView AddWidget(string widgetId, string contentInfo, int width, int height, float updatePeriod) - { - WidgetView ret = new WidgetView(NDalicManualPINVOKE.WidgetViewManager_AddWidget(swigCPtr, widgetId, contentInfo, width, height, updatePeriod), true); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - return ret; - } - - } - -} diff --git a/src/Tizen.NUI/src/public/Window.cs b/src/Tizen.NUI/src/public/Window.cs index 220424eb9..2633b4b33 100755 --- a/src/Tizen.NUI/src/public/Window.cs +++ b/src/Tizen.NUI/src/public/Window.cs @@ -23,7 +23,7 @@ namespace Tizen.NUI /// /// The window class is used internally for drawing.
- /// The window has an orientation and indicator properties.
+ /// A Window has an orientation and indicator properties.
///
public class Window : BaseHandle { @@ -47,7 +47,7 @@ namespace Tizen.NUI } /// - /// To make the window instance be disposed. + /// To make Window instance be disposed. /// protected override void Dispose(DisposeTypes type) { @@ -145,26 +145,18 @@ namespace Tizen.NUI return ret; } - /// - /// Sets whether the window accepts a focus or not. - /// - /// If a focus is accepted or not. The default is true. + [Obsolete("Please do not use! this will be internal method")] public void SetAcceptFocus(bool accept) { NDalicPINVOKE.SetAcceptFocus(swigCPtr, accept); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - /// - /// Returns whether the window accepts a focus or not. - /// - /// True if the window accepts a focus, false otherwise. + [Obsolete("Please do not use! this will be internal method")] public bool IsFocusAcceptable() { - bool ret = NDalicPINVOKE.IsFocusAcceptable(swigCPtr); + return NDalicPINVOKE.IsFocusAcceptable(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); - - return ret; } /// @@ -188,7 +180,7 @@ namespace Tizen.NUI /// /// Retrieves whether the window is visible or not. /// - /// True if the window is visible. + /// true, if the windoe is visible public bool IsVisible() { bool temp = NDalicPINVOKE.IsVisible(swigCPtr); @@ -284,7 +276,7 @@ namespace Tizen.NUI } /// - /// Gets or sets a window type. + /// Gets/Sets a window type. /// public WindowType Type { @@ -342,22 +334,22 @@ namespace Tizen.NUI } /// - /// Sets a window's screen mode. + /// Sets a window's screen off mode. /// - /// The screen mode. + /// The screen mode. /// True if no error occurred, false otherwise. - public bool SetScreenMode(ScreenMode screenMode) { - bool ret = NDalicPINVOKE.SetScreenMode(swigCPtr, (int)screenMode); + public bool SetScreenOffMode(ScreenOffMode screenOffMode) { + bool ret = NDalicPINVOKE.SetScreenOffMode(swigCPtr, (int)screenOffMode); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } /// - /// Gets the screen mode of the window. + /// Gets a screen off mode of the window. /// - /// The screen mode. - public ScreenMode GetScreenMode() { - ScreenMode ret = (ScreenMode)NDalicPINVOKE.GetScreenMode(swigCPtr); + /// The screen off mode. + public ScreenOffMode GetScreenOffMode() { + ScreenOffMode ret = (ScreenOffMode)NDalicPINVOKE.GetScreenOffMode(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); return ret; } @@ -374,9 +366,9 @@ namespace Tizen.NUI } /// - /// Gets the preferred brightness of the window. + /// Gets preffered brightness of the window. /// - /// The preferred brightness. + /// The preffered brightness. public int GetBrightness() { int ret = NDalicPINVOKE.GetBrightness(swigCPtr); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); @@ -493,19 +485,14 @@ namespace Tizen.NUI if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } - /// - /// Sets the window name and the class string. - /// - /// The name of the window. - /// The class of the window. - public void SetClass(string name, string klass) + internal void SetClass(string name, string klass) { NDalicPINVOKE.Window_SetClass(swigCPtr, name, klass); if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); } /// - /// Raises the window to the top of the window stack. + /// Raises window to the top of Window stack. /// public void Raise() { @@ -514,7 +501,7 @@ namespace Tizen.NUI } /// - /// Lowers the window to the bottom of the window stack. + /// Lowers window to the bottom of Window stack. /// public void Lower() { @@ -523,7 +510,7 @@ namespace Tizen.NUI } /// - /// Activates the window to the top of the window stack even it is iconified. + /// Activates window to the top of Window stack even it is iconified. /// public void Activate() { @@ -578,9 +565,9 @@ namespace Tizen.NUI } /// - /// Gets the default ( root ) layer. + /// Get default ( root ) layer. /// - /// The root layer. + /// The root layer public Layer GetDefaultLayer() { return this.GetRootLayer(); @@ -600,14 +587,12 @@ namespace Tizen.NUI public void Add(View view) { - NDalicPINVOKE.Stage_Add(stageCPtr, View.getCPtr(view)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + GetRootLayer()?.Add(view); } public void Remove(View view) { - NDalicPINVOKE.Stage_Remove(stageCPtr, View.getCPtr(view)); - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + GetRootLayer()?.Remove(view); } internal Vector2 GetSize() @@ -647,11 +632,13 @@ namespace Tizen.NUI internal Layer GetRootLayer() { - if (_rootLayer == null) + // Window.IsInstalled() is actually true only when called from event thread and + // Core has been initialized, not when Stage is ready. + if (_rootLayer == null && Window.IsInstalled()) + { _rootLayer = new Layer(NDalicPINVOKE.Stage_GetRootLayer(stageCPtr), true); - - - if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + if (NDalicPINVOKE.SWIGPendingException.Pending) throw NDalicPINVOKE.SWIGPendingException.Retrieve(); + } return _rootLayer; } @@ -685,7 +672,7 @@ namespace Tizen.NUI /// /// Keep rendering for at least the given amount of time. /// - /// Time to keep rendering, 0 means render at least one more frame. + /// Time to keep rendering, 0 means render at least one more frame public void KeepRendering(float durationSeconds) { NDalicPINVOKE.Stage_KeepRendering(stageCPtr, durationSeconds); @@ -773,8 +760,8 @@ namespace Tizen.NUI private static readonly Window instance = Application.Instance.GetWindow(); /// - /// The stage instance property (read-only).
- /// Gets the current window.
+ /// Stage instance property (read-only).
+ /// Gets the current Window.
///
public static Window Instance { @@ -785,12 +772,12 @@ namespace Tizen.NUI } /// - /// Grabs the key specified by a key for a window only when a window is the topmost window.
+ /// Grabs the key specified by a key for a window only when a window is the topmost window.
/// This function can be used for following example scenarios:
- /// - Mobile - Using volume up or down as zoom up or down in camera apps.
+ /// - Mobile - Using volume up/down as zoom up/down in camera apps.
///
- /// The key code to grab. - /// True if the grab succeeds. + /// The key code to grab + /// true if the grab succeeds public bool GrabKeyTopmost(int DaliKey) { bool ret = NDalicManualPINVOKE.GrabKeyTopmost(HandleRef.ToIntPtr(this.swigCPtr), DaliKey); @@ -799,11 +786,11 @@ namespace Tizen.NUI } /// - /// Ungrabs the key specified by a key for the window.
+ /// Ungrabs the key specified by a key for a window.
/// Note: If this function is called between key down and up events of a grabbed key, an application doesn't receive the key up event.
///
- /// The key code to ungrab. - /// True if the ungrab succeeds. + /// The key code to ungrab + /// true if the ungrab succeeds public bool UngrabKeyTopmost(int DaliKey) { bool ret = NDalicManualPINVOKE.UngrabKeyTopmost(HandleRef.ToIntPtr(this.swigCPtr), DaliKey); @@ -815,12 +802,12 @@ namespace Tizen.NUI /// Grabs the key specified by a key for a window in a GrabMode.
/// Details: This function can be used for following example scenarios:
/// - TV - A user might want to change the volume or channel of the background TV contents while focusing on the foregrund app.
- /// - Mobile - When a user presses the Home key, the homescreen appears regardless of the current foreground app.
- /// - Mobile - Using the volume up or down as zoom up or down in camera apps.
+ /// - Mobile - When a user presses Home key, the homescreen appears regardless of current foreground app.
+ /// - Mobile - Using volume up/down as zoom up/down in camera apps.
///
- /// The key code to grab. - /// The grab mode for the key. - /// True if the grab succeeds. + /// The key code to grab + /// The grab mode for the key + /// true if the grab succeeds public bool GrabKey(int DaliKey, KeyGrabMode GrabMode) { bool ret = NDalicManualPINVOKE.GrabKey(HandleRef.ToIntPtr(this.swigCPtr), DaliKey, (int)GrabMode); @@ -829,11 +816,11 @@ namespace Tizen.NUI } /// - /// Ungrabs the key specified by a key for a window.
+ /// Ungrabs the key specified by a key for a window.
/// Note: If this function is called between key down and up events of a grabbed key, an application doesn't receive the key up event.
///
- /// The key code to ungrab. - /// True if the ungrab succeeds. + /// The key code to ungrab + /// true if the ungrab succeeds public bool UngrabKey(int DaliKey) { bool ret = NDalicManualPINVOKE.UngrabKey(HandleRef.ToIntPtr(this.swigCPtr), DaliKey); @@ -860,24 +847,24 @@ namespace Tizen.NUI } /// - /// Enumeration for the key grab mode for platform-level APIs. + /// Enumeration for key grab mode for platform-level APIs. /// public enum KeyGrabMode { /// - /// Grabs a key only when on the top of the grabbing-window stack mode. + /// Grab a key only when on the top of the grabbing-window stack mode. /// Topmost = 0, /// - /// Grabs a key together with the other client window(s) mode. + /// Grab a key together with the other client window(s) mode. /// Shared, /// - /// Grabs a key exclusively regardless of the grabbing-window's position on the window stack with the possibility of overriding the grab by the other client window mode. + /// Grab a key exclusively regardless of the grabbing-window's position on the window stack with the possibility of overriding the grab by the other client window mode. /// OverrideExclusive, /// - /// Grabs a key exclusively regardless of the grabbing-window's position on the window stack mode. + /// Grab a key exclusively regardless of the grabbing-window's position on the window stack mode. /// Exclusive }; @@ -903,7 +890,7 @@ namespace Tizen.NUI } /// - /// The touch event argument. + /// Touch event argument. /// public class TouchEventArgs : EventArgs { @@ -929,7 +916,7 @@ namespace Tizen.NUI private EventCallbackDelegateType1 _stageTouchCallbackDelegate; /// - /// This event is emitted when the screen is touched and when the touch ends.
+ /// This is emitted when the screen is touched and when the touch ends.
/// If there are multiple touch points, then this will be emitted when the first touch occurs and /// then when the last finger is lifted.
/// An interrupted event will also be emitted (if it occurs).
@@ -1000,7 +987,7 @@ namespace Tizen.NUI private EventCallbackDelegateType1 _stageWheelCallbackDelegate; /// - /// This event is emitted when the wheel event is received. + /// Event emitted when wheel event is received. /// public event EventHandler WheelEvent { @@ -1046,7 +1033,7 @@ namespace Tizen.NUI private Key _key; /// - /// Key. + /// Key /// public Key Key { @@ -1065,7 +1052,7 @@ namespace Tizen.NUI private EventCallbackDelegateType1 _stageKeyCallbackDelegate; /// - /// This event is emitted when the key event is received. + /// Event emitted when key event is received. /// public event EventHandler KeyEvent { @@ -1335,7 +1322,7 @@ namespace Tizen.NUI } /// - /// The window size property (read-only). + /// Window size property (read-only). /// public Size2D Size { @@ -1347,7 +1334,7 @@ namespace Tizen.NUI } /// - /// The background color property. + /// Background color property. /// public Color BackgroundColor { @@ -1363,7 +1350,7 @@ namespace Tizen.NUI } /// - /// The DPI property (read-only).
+ /// Dpi property (read-only).
/// Retrieves the DPI of the display device to which the Window is connected.
///
public Vector2 Dpi @@ -1375,7 +1362,7 @@ namespace Tizen.NUI } /// - /// The layer count property (read-only).
+ /// Layer count property (read-only).
/// Queries the number of on-Window layers.
///
public uint LayerCount @@ -1388,9 +1375,9 @@ namespace Tizen.NUI /// - /// Adds a layer to the stage. + /// Add layer to the Stage. /// - /// Layer to add. + /// Layer to add public void AddLayer(Layer layer) { NDalicPINVOKE.Stage_Add(stageCPtr, Layer.getCPtr(layer)); @@ -1398,9 +1385,9 @@ namespace Tizen.NUI } /// - /// Removes a layer from the stage. + /// Remove layer from the Stage. /// - /// Layer to remove. + /// Layer to remove public void RemoveLayer(Layer layer) { NDalicPINVOKE.Stage_Remove(stageCPtr, Layer.getCPtr(layer)); @@ -1422,7 +1409,7 @@ namespace Tizen.NUI private delegate void WindowFocusChangedEventCallbackType2(bool focusGained); private event EventHandler _windowFocusChangedEventHandler2; - [Obsolete("Please do not use! this will be deprecated. Please use 'FocusChanged' event instead")] + [Obsolete("Please do not use! this will be deprecated")] public event EventHandler WindowFocusChanged { add @@ -1459,7 +1446,7 @@ namespace Tizen.NUI } /// - /// Gets or sets a size of the window. + /// Gets/Sets a size of the window. /// public Size2D WindowSize { @@ -1474,7 +1461,7 @@ namespace Tizen.NUI } /// - /// Gets or sets a position of the window. + /// Gets/Sets a position of the window. /// public Position2D WindowPosition { diff --git a/src/Tizen.Network.Bluetooth/Interop/Interop.Bluetooth.cs b/src/Tizen.Network.Bluetooth/Interop/Interop.Bluetooth.cs deleted file mode 100755 index faf204012..000000000 --- a/src/Tizen.Network.Bluetooth/Interop/Interop.Bluetooth.cs +++ /dev/null @@ -1,656 +0,0 @@ -/* - * 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.Network.Bluetooth; -using System.Runtime.InteropServices; - -internal static partial class Interop -{ - internal static partial class Bluetooth - { - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void StateChangedCallback(int result, int state, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void NameChangedCallback(string deviceName, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void VisibilityModeChangedCallback(int result, int visibility, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void VisibilityDurationChangedCallback(int duration, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void DiscoveryStateChangedCallback(int result, BluetoothDeviceDiscoveryState state, IntPtr deviceInfo, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool BondedDeviceCallback([MarshalAs(UnmanagedType.Struct)]ref BluetoothDeviceStruct device, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void BondCreatedCallback(int result, [MarshalAs(UnmanagedType.Struct)]ref BluetoothDeviceStruct device, IntPtr userData); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void BondDestroyedCallback(int result, string deviceAddress, IntPtr userData); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void AuthorizationChangedCallback(int authorization, string deviceAddress, IntPtr userData); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void ServiceSearchedCallback(int result, [MarshalAs(UnmanagedType.Struct)]ref BluetoothDeviceSdpStruct sdp, IntPtr userData); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void DeviceConnectionStateChangedCallback(bool connected, [MarshalAs(UnmanagedType.Struct)]ref BluetoothDeviceConnectionStruct device, IntPtr userData); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool ConnectedProfileCallback(int profile, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void DataReceivedCallback([MarshalAs(UnmanagedType.Struct)]ref SocketDataStruct socketData, IntPtr userData); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void SocketConnectionStateChangedCallback(int result, BluetoothSocketState connectionState, [MarshalAs(UnmanagedType.Struct)]ref SocketConnectionStruct socketConnection, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void AudioConnectionStateChangedCallback(int result, bool connected, string deviceAddress, int profileType, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void HidConnectionStateChangedCallback(int result, bool connected, string deviceAddress, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void ConnectionRequestedCallback(string deviceAddress, IntPtr userData); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void PushRequestedCallback(string file, long size, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void TransferProgressCallback(string file, long size, int percent, IntPtr userData); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void TransferFinishedCallback(int result, string file, long size, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void PushRespondedCallback(int result, string deviceAddress, IntPtr userData); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void PushProgressCallback(string file, long size, int percent, IntPtr userData); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void PushFinishedCallback(int result, string deviceAddress, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void TargetConnectionStateChangedCallback(bool connected, string deviceAddress, IntPtr userData); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void EqualizerStateChangedCallback(int equalizer, IntPtr userData); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void RepeatModeChangedCallback(int repeat, IntPtr userData); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void ShuffleModeChangedCallback(int shuffle, IntPtr userData); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void ScanModeChangedCallback(int scan, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void ConnectionChangedCallback(int result, bool connected, string deviceAddress, IntPtr userData); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void ClientCharacteristicValueChangedCallback(IntPtr characteristicHandle, string value, int len, IntPtr userData); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void GattClientRequestedCallback(int result, IntPtr handle, IntPtr userData); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool GattForEachCallback(int total, int index, IntPtr handle, IntPtr userData); - - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_initialize")] - internal static extern int Initialize(); - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_deinitialize")] - internal static extern int Deinitialize(); - - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_adapter_get_name")] - internal static extern int GetName(out string name); - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_adapter_set_name")] - internal static extern int SetName(string name); - - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_adapter_get_state")] - internal static extern int GetState(out BluetoothState isActivated); - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_adapter_get_address")] - internal static extern int GetAddress(out string address); - - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_adapter_get_visibility")] - internal static extern int GetVisibility(out int visibility, out int duration); - - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_adapter_is_discovering")] - internal static extern int IsDiscovering(out bool isDiscovering); - - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_adapter_start_device_discovery")] - internal static extern int StartDiscovery(); - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_adapter_stop_device_discovery")] - internal static extern int StopDiscovery(); - - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_adapter_foreach_bonded_device")] - internal static extern int GetBondedDevices(BondedDeviceCallback bondedDeviceCb, IntPtr userData); - - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_adapter_get_bonded_device_info")] - internal static extern int GetBondedDeviceByAddress(string deviceAddress, out IntPtr deviceInfo); - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_adapter_free_device_info")] - internal static extern int FreeDeviceInfo(BluetoothDeviceStruct deviceInfo); - - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_adapter_is_service_used")] - internal static extern int IsServiceUsed(string serviceUuid, out bool used); - - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_adapter_get_local_oob_data")] - internal static extern int GetOobData(out IntPtr hash, out IntPtr randomizer, out int hashLen, out int randomizerLen); - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_adapter_set_remote_oob_data")] - internal static extern int SetOobData(string deviceAddress, IntPtr hash, IntPtr randomizer, int hashLen, int randomizerLen); - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_adapter_remove_remote_oob_data")] - internal static extern int RemoveOobData(string deviceAddress); - - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_adapter_set_state_changed_cb")] - internal static extern int SetStateChangedCallback(StateChangedCallback stateChangedCb, IntPtr userData); - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_adapter_unset_state_changed_cb")] - internal static extern int UnsetStateChangedCallback(); - - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_adapter_set_name_changed_cb")] - internal static extern int SetNameChangedCallback(NameChangedCallback nameChangedCb, IntPtr userData); - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_adapter_unset_name_changed_cb")] - internal static extern int UnsetNameChangedCallback(); - - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_adapter_set_visibility_mode_changed_cb")] - internal static extern int SetVisibilityModeChangedCallback(VisibilityModeChangedCallback visibilityChangedCb, IntPtr userData); - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_adapter_unset_visibility_mode_changed_cb")] - internal static extern int UnsetVisibilityModeChangedCallback(); - - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_adapter_set_visibility_duration_changed_cb")] - internal static extern int SetVisibilityDurationChangedCallback(VisibilityDurationChangedCallback durationChangedCb, IntPtr userData); - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_adapter_unset_visibility_duration_changed_cb")] - internal static extern int UnsetVisibilityDurationChangedCallback(); - - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_adapter_set_device_discovery_state_changed_cb")] - internal static extern int SetDiscoveryStateChangedCallback(DiscoveryStateChangedCallback discoveryChangedCb, IntPtr userData); - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_adapter_unset_device_discovery_state_changed_cb")] - internal static extern int UnsetDiscoveryStateChangedCallback(); - - //Bluetooth Device - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_device_create_bond")] - internal static extern int CreateBond(string deviceAddress); - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_device_destroy_bond")] - internal static extern int DestroyBond(string deviceAddress); - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_device_cancel_bonding")] - internal static extern int CancelBonding(); - - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_device_set_alias")] - internal static extern int SetAlias(string deviceAddress, string alias); - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_device_set_authorization")] - internal static extern int SetAuthorization(string deviceAddress, int state); - - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_device_get_service_mask_from_uuid_list")] - internal static extern int GetMaskFromUuid([MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.LPStr, SizeParamIndex = 1)] string[] uuids, int count, out BluetoothServiceClassType serviceMask); - - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_device_start_service_search")] - internal static extern int StartServiceSearch(string deviceAddress); - - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_device_foreach_connected_profiles")] - internal static extern int GetConnectedProfiles(string deviceAddress, ConnectedProfileCallback connectedProfileCb, IntPtr userData); - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_device_is_profile_connected")] - internal static extern int IsProfileConnected(string deviceAddress, int profile, out bool connectionStatus); - - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_device_set_bond_created_cb")] - internal static extern int SetBondCreatedCallback(BondCreatedCallback bondCreatedCb, IntPtr userData); - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_device_unset_bond_created_cb")] - internal static extern int UnsetBondCreatedCallback(); - - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_device_set_bond_destroyed_cb")] - internal static extern int SetBondDestroyedCallback(BondDestroyedCallback bondDestroyedCb, IntPtr userData); - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_device_unset_bond_destroyed_cb")] - internal static extern int UnsetBondDestroyedCallback(); - - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_device_set_authorization_changed_cb")] - internal static extern int SetAuthorizationChangedCallback(AuthorizationChangedCallback authorizationChangedCb, IntPtr userData); - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_device_unset_authorization_changed_cb")] - internal static extern int UnsetAuthorizationChangedCallback(); - - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_device_set_service_searched_cb")] - internal static extern int SetServiceSearchedCallback(ServiceSearchedCallback serviceSearchedCb, IntPtr userData); - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_device_unset_service_searched_cb")] - internal static extern int UnsetServiceSearchedCallback(); - - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_device_set_connection_state_changed_cb")] - internal static extern int SetConnectionStateChangedCallback(DeviceConnectionStateChangedCallback connectionChangedCb, IntPtr userData); - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_device_unset_connection_state_changed_cb")] - internal static extern int UnsetConnectionStateChangedCallback(); - - // Bluetooth LE Adapter - - //Callback for event - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void AdapterLeScanResultChangedCallBack(int result, - [MarshalAs(UnmanagedType.Struct)]ref BluetoothLeScanDataStruct scanData, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - public delegate void AdvertisingStateChangedCallBack(int result, IntPtr advertiserHandle, - BluetoothLeAdvertisingState advertisingState, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - public delegate void GattConnectionStateChangedCallBack(int result, bool connected, - string remoteAddress, IntPtr userData); - - //Bluetooth Le Adapter Apis - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_adapter_le_start_scan")] - public static extern int StartScan(AdapterLeScanResultChangedCallBack callback, IntPtr userData); - - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_adapter_le_stop_scan")] - public static extern int StopScan(); - - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_adapter_le_get_scan_result_service_uuids")] - public static extern int GetScanResultServiceUuid(ref BluetoothLeScanDataStruct scanData, - BluetoothLePacketType packetType, ref IntPtr uuids, ref int count); - - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_adapter_le_get_scan_result_device_name")] - public static extern int GetLeScanResultDeviceName(ref BluetoothLeScanDataStruct scanData, - BluetoothLePacketType packetType, out string deviceName); - - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_adapter_le_get_scan_result_tx_power_level")] - public static extern int GetScanResultTxPowerLevel(ref BluetoothLeScanDataStruct scanData, - BluetoothLePacketType packetType, out int txPowerLevel); - - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_adapter_le_get_scan_result_service_solicitation_uuids")] - public static extern int GetScaResultSvcSolicitationUuids(ref BluetoothLeScanDataStruct scanData, - BluetoothLePacketType packetType, out IntPtr uuids, out int count); - - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_adapter_le_get_scan_result_service_data_list")] - public static extern int GetScanResultServiceDataList(ref BluetoothLeScanDataStruct scanData, - BluetoothLePacketType PacketType, out IntPtr serviceDataArray, out int count); - - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_adapter_le_free_service_data_list")] - public static extern int FreeServiceDataList(IntPtr serviceData, int count); - - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_adapter_le_get_scan_result_appearance")] - public static extern int GetScanResultAppearance(ref BluetoothLeScanDataStruct scanData, - BluetoothLePacketType packetType, out int appearance); - - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_adapter_le_get_scan_result_manufacturer_data")] - public static extern int GetScanResultManufacturerData(ref BluetoothLeScanDataStruct scanData, - BluetoothLePacketType packetType, out int manufId, out IntPtr manufData, - out int manufDataLength); - - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_gatt_connect")] - internal static extern int GattConnect(string deviceAddress, bool autoConnect); - - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_gatt_disconnect")] - internal static extern int GattDisconnect(string deviceAddress); - - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_gatt_set_connection_state_changed_cb")] - internal static extern int SetGattConnectionStateChangedCallback( - GattConnectionStateChangedCallBack gattConnectionChangedCb, IntPtr userData); - - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_gatt_unset_connection_state_changed_cb")] - internal static extern int UnsetGattConnectionStateChangedCallback(); - - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_adapter_le_create_advertiser")] - public static extern int CreateAdvertiser(out IntPtr advertiserHandle); - - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_adapter_le_destroy_advertiser")] - public static extern int DestroyAdvertiser(IntPtr advertiserHandle); - - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_adapter_le_add_advertising_service_uuid")] - public static extern int AddAdvertisingServiceUuid(IntPtr advertiserHandle, - BluetoothLePacketType PacketType, string uuid); - - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_adapter_le_add_advertising_service_solicitation_uuid")] - public static extern int AddAdvertisingServiceSolicitationUuid(IntPtr advertiserHandle, - BluetoothLePacketType PacketType, string uuid); - - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_adapter_le_add_advertising_service_data")] - public static extern int AddAdvertisingServiceData(IntPtr advertiserHandle, - BluetoothLePacketType PacketType, string uuid, IntPtr serviceData, int serviceDatalength); - - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_adapter_le_set_advertising_appearance")] - public static extern int SetAdvertisingAppearance(IntPtr advertiserHandle, - BluetoothLePacketType packetType, int appearance); - - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_adapter_le_add_advertising_manufacturer_data")] - public static extern int AddAdvertisingManufData(IntPtr advertiserHandle, BluetoothLePacketType packetType, - int manufId, IntPtr manufData, int manufacturerDataLength); - - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_adapter_le_set_advertising_device_name")] - public static extern int SetAdvertisingDeviceName(IntPtr advertiserHandle, BluetoothLePacketType packetType, - bool includeName); - - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_adapter_le_set_advertising_tx_power_level")] - public static extern int SetAdvertisingTxPowerLevel(IntPtr advertiserHandle, BluetoothLePacketType packetType, - bool includePowerLevel); - - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_adapter_le_clear_advertising_data")] - public static extern int ClearAdvertisingData(IntPtr advertiserHandle, BluetoothLePacketType packetType); - - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_adapter_le_start_advertising_new")] - public static extern int BluetoothLeStartAdvertising(IntPtr advertiserHandle, - AdvertisingStateChangedCallBack callback, IntPtr userData); - - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_adapter_le_stop_advertising")] - public static extern int BluetoothLeStopAdvertising(IntPtr advertiserHandle); - - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_adapter_le_set_advertising_mode")] - public static extern int SetAdvertisingMode(IntPtr advertiserHandle, - BluetoothLeAdvertisingMode advertisingMode); - - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_adapter_le_set_advertising_connectable")] - public static extern int SetAdvertisingConnectable(IntPtr advertiserHandle, - bool connectable); - - //Bluetooth Socket - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_socket_create_rfcomm")] - internal static extern int CreateServerSocket(string serviceUuid, out int socketFd); - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_socket_destroy_rfcomm")] - internal static extern int DestroyServerSocket(int socketFd); - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_socket_listen_and_accept_rfcomm")] - internal static extern int Listen(int socketFd, int pendingConnections); - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_socket_connect_rfcomm")] - internal static extern int ConnectSocket(string address, string serviceUuid); - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_socket_disconnect_rfcomm")] - internal static extern int DisconnectSocket(int socketFd); - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_socket_send_data")] - internal static extern int SendData(int socketFd, string data, int dataLength); - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_socket_set_data_received_cb")] - internal static extern int SetDataReceivedCallback(DataReceivedCallback callback, IntPtr userData); - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_socket_unset_data_received_cb")] - internal static extern int UnsetDataReceivedCallback(); - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_socket_set_connection_state_changed_cb")] - internal static extern int SetConnectionStateChangedCallback(SocketConnectionStateChangedCallback callback, IntPtr userData); - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_socket_unset_connection_state_changed_cb")] - internal static extern int UnsetSocketConnectionStateChangedCallback(); - - // Bluetooth Audio - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_audio_initialize")] - internal static extern int InitializeAudio(); - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_audio_deinitialize")] - internal static extern int DeinitializeAudio(); - - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_audio_connect")] - internal static extern int Connect(string deviceAddress, int profileType); - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_audio_disconnect")] - internal static extern int Disconnect(string deviceAddress, int profileType); - - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_audio_set_connection_state_changed_cb")] - internal static extern int SetAudioConnectionStateChangedCallback(AudioConnectionStateChangedCallback audioStateChangedCb, IntPtr userData); - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_audio_unset_connection_state_changed_cb")] - internal static extern int UnsetAudioConnectionStateChangedCallback(); - - //Bluetooth Hid - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_hid_host_initialize")] - internal static extern int InitializeHid(HidConnectionStateChangedCallback hidConnectionChangedCb, IntPtr userData); - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_hid_host_deinitialize")] - internal static extern int DeinitializeHid(); - - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_hid_host_connect")] - internal static extern int Connect(string deviceAddress); - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_hid_host_disconnect")] - internal static extern int Disconnect(string deviceAddress); - - // Bluetooth OPP - // Opp Server - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_opp_server_initialize")] - internal static extern int InitializeOppServer(string deviceAddress, PushRequestedCallback pushRequestedCb, IntPtr userData); - - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_opp_server_deinitialize")] - internal static extern int DinitializeOppServer(); - - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_opp_server_initialize_by_connection_request")] - internal static extern int InitializeOppServerCustom(string deviceAddress, ConnectionRequestedCallback connectionRequestedCb, IntPtr userData); - - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_opp_server_accept")] - internal static extern int OppServerAcceptPush(TransferProgressCallback transferProgressCb, TransferFinishedCallback transferFinishedCb, string name, IntPtr userData, out int transferId); - - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_opp_server_reject")] - internal static extern int OppServerRejectPush(); - - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_opp_server_cancel_transfer")] - internal static extern int OppServerCancelTransfer(int transferId); - - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_opp_server_set_destination")] - internal static extern int OppServerSetDestinationPath(string path); - - // Opp Client - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_opp_client_initialize")] - internal static extern int InitializeOppClient(); - - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_opp_client_dinitialize")] - internal static extern int DeinitializeOppClient(); - - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_opp_client_add_file")] - internal static extern int OppClientAddFile(string filePath); - - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_opp_client_clear_files")] - internal static extern int OppClientClearFiles(); - - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_opp_client_cancel_push")] - internal static extern int OppClientCancelPush(); - - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_opp_client_push_files")] - internal static extern int OppClientPushFile(string filePath, PushRespondedCallback pushRespondedCb, PushProgressCallback pushProgressCb, PushFinishedCallback pushFinishedCb, IntPtr userData); - - //Bluetooth Avrcp - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_avrcp_target_initialize")] - internal static extern int InitializeAvrcp(TargetConnectionStateChangedCallback targetStateChangedCb, IntPtr userData); - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_avrcp_target_deinitialize")] - internal static extern int DeinitializeAvrcp(); - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_avrcp_target_notify_equalizer_state")] - internal static extern int NotifyEqualizerState(int state); - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_avrcp_target_notify_repeat_mode")] - internal static extern int NotifyRepeatMode(int repeat); - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_avrcp_target_notify_shuffle_mode")] - internal static extern int NotifyShuffleMode(int shuffle); - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_avrcp_target_notify_scan_mode")] - internal static extern int NotifyScanMode(int scan); - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_avrcp_target_notify_player_state")] - internal static extern int NotifyPlayerState(int state); - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_avrcp_target_notify_position")] - internal static extern int NotifyCurrentPosition(uint position); - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_avrcp_target_notify_track")] - internal static extern int NotifyTrack(string title, string artist, string album, string genre, uint trackNum, uint totaltracks, uint duration); - - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_avrcp_set_equalizer_state_changed_cb")] - internal static extern int SetEqualizerStateChangedCallback(EqualizerStateChangedCallback equalizerStateChangedCb, IntPtr userData); - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_avrcp_unset_equalizer_state_changed_cb")] - internal static extern int UnsetEqualizerStateChangedCallback(); - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_avrcp_set_repeat_mode_changed_cb")] - internal static extern int SetRepeatModeChangedCallback(RepeatModeChangedCallback repeatModeChangedCb, IntPtr userData); - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_avrcp_unset_repeat_mode_changed_cb")] - internal static extern int UnsetRepeatModeChangedCallback(); - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_avrcp_set_shuffle_mode_changed_cb")] - internal static extern int SetShuffleModeChangedCallback(ShuffleModeChangedCallback shuffleModeChangedCb, IntPtr userData); - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_avrcp_unset_shuffle_mode_changed_cb")] - internal static extern int UnsetShuffleModeChangedCallback(); - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_avrcp_set_scan_mode_changed_cb")] - internal static extern int SetScanModeChangedCallback(ScanModeChangedCallback scanModeChangedCb, IntPtr userData); - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_avrcp_unset_scan_mode_changed_cb")] - internal static extern int UnsetScanModeChangedCallback(); - - // Bluetooth GATT - - [UnmanagedFunctionPointerAttribute(CallingConvention.Cdecl)] - internal delegate bool BtGattForeachCallback(int total, int index, IntPtr gattHandle, IntPtr userData); - - [UnmanagedFunctionPointerAttribute(CallingConvention.Cdecl)] - internal delegate void BtGattServerReadValueRequestedCallback(string clientAddress, int requestId, IntPtr serverHandle, IntPtr gattHandle, int offset, IntPtr userData); - - [UnmanagedFunctionPointerAttribute(CallingConvention.Cdecl)] - internal delegate void BtGattServerWriteValueRequestedCallback(string clientAddress, int requestId, IntPtr serverHandle, IntPtr gattHandle, int offset, bool response_needed, byte[] value, int len, IntPtr userData); - - [UnmanagedFunctionPointerAttribute(CallingConvention.Cdecl)] - internal delegate void BtClientCharacteristicValueChangedCallback(IntPtr characteristicHandle, byte[] value, int len, IntPtr userData); - - [UnmanagedFunctionPointerAttribute(CallingConvention.Cdecl)] - internal delegate void BtGattServerNotificationStateChangeCallback(bool notify, IntPtr serverHandle, IntPtr characteristicHandle, IntPtr userData); - - [UnmanagedFunctionPointerAttribute(CallingConvention.Cdecl)] - internal delegate void BtGattServerNotificationSentCallback(int result, string clientAddress, IntPtr serverHandle, IntPtr characteristicHandle, bool completed, IntPtr userData); - - [UnmanagedFunctionPointerAttribute(CallingConvention.Cdecl)] - internal delegate void BtGattClientRequestCompletedCallback(int result, IntPtr requestHandle, IntPtr userData); - - // Gatt Attribute - - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_gatt_destroy")] - internal static extern int BtGattDestroy(IntPtr gattHandle); - - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_gatt_get_uuid")] - internal static extern int BtGattGetUuid(BluetoothGattAttributeHandle gattHandle, out string uuid); - - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_gatt_get_value")] - internal static extern int BtGattGetValue(BluetoothGattAttributeHandle gattHandle, out IntPtr nativeValue, out int valueLength); - - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_gatt_set_value")] - internal static extern int BtGattSetValue(BluetoothGattAttributeHandle gattHandle, byte[] value, int valueLength); - - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_gatt_get_int_value")] - internal static extern int BtGattGetIntValue(BluetoothGattAttributeHandle gattHandle, int type, int offset, out int value); - - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_gatt_set_int_value")] - internal static extern int BtGattSetIntValue(BluetoothGattAttributeHandle gattHandle, int type, int value, int offset); - - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_gatt_get_float_value")] - internal static extern int BtGattGetFloatValue(BluetoothGattAttributeHandle gattHandle, int type, int offset, out float value); - - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_gatt_set_float_value")] - internal static extern int BtGattSetFloatValue(BluetoothGattAttributeHandle gattHandle, int type, int mantissa, int exponent, int offset); - - // GATT Descriptor - - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_gatt_descriptor_create")] - internal static extern int BtGattDescriptorCreate(string uuid, int permissions, byte[] value, int valueLength, out BluetoothGattAttributeHandle descriptorHandle); - - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_gatt_descriptor_get_permissions")] - internal static extern int BtGattDescriptorGetPermissions(BluetoothGattAttributeHandle descriptorHandle, out int permissions); - - // GATT Characteristic - - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_gatt_characteristic_create")] - internal static extern int BtGattCharacteristicCreate(string uuid, int permissions, int properties, byte[] value, int valueLength, out BluetoothGattAttributeHandle characteristicHandle); - - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_gatt_characteristic_get_permissions")] - internal static extern int BtGattCharacteristicGetPermissions(BluetoothGattAttributeHandle characteristicHandle, out int permissions); - - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_gatt_characteristic_get_properties")] - internal static extern int BtGattCharacteristicGetProperties(BluetoothGattAttributeHandle characteristicHandle, out int properties); - - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_gatt_characteristic_set_properties")] - internal static extern int BtGattCharacteristicSetProperties(BluetoothGattAttributeHandle characteristicHandle, int properties); - - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_gatt_characteristic_get_write_type")] - internal static extern int BtGattCharacteristicGetWriteType(BluetoothGattAttributeHandle characteristicHandle, out int writeType); - - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_gatt_characteristic_set_write_type")] - internal static extern int BtGattCharacteristicSetWriteType(BluetoothGattAttributeHandle characteristicHandle, int writeType); - - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_gatt_characteristic_add_descriptor")] - internal static extern int BtGattCharacteristicAddDescriptor(BluetoothGattAttributeHandle characteristicHandle, BluetoothGattAttributeHandle descriptorHandle); - - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_gatt_characteristic_get_descriptor")] - internal static extern int BtGattCharacteristicGetDescriptor(BluetoothGattAttributeHandle characteristicHandle, string uuid, out BluetoothGattAttributeHandle descriptorHandle); - - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_gatt_characteristic_foreach_descriptors")] - internal static extern int BtGattCharacteristicForeachDescriptors(BluetoothGattAttributeHandle characteristicHandle, BtGattForeachCallback callback, IntPtr userData); - - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_gatt_client_set_characteristic_value_changed_cb")] - internal static extern int BtGattClientSetCharacteristicValueChangedCallback(BluetoothGattAttributeHandle characteristicHandle, BtClientCharacteristicValueChangedCallback cb, IntPtr userData); - - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_gatt_client_unset_characteristic_value_changed_cb")] - internal static extern int BtGattClientUnsetCharacteristicValueChangedCallback(BluetoothGattAttributeHandle characteristicHandle); - - // GATT Service - - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_gatt_service_create")] - internal static extern int BtGattServiceCreate(string uuid, int type, out BluetoothGattAttributeHandle serviceHandle); - - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_gatt_service_add_characteristic")] - internal static extern int BtGattServiceAddCharacteristic(BluetoothGattAttributeHandle serviceHandle, BluetoothGattAttributeHandle characteristicHandle); - - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_gatt_service_get_characteristic")] - internal static extern int BtGattServiceGetCharacteristic(BluetoothGattAttributeHandle serviceHandle, string uuid, out BluetoothGattAttributeHandle characteristicHandle); - - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_gatt_service_foreach_characteristics")] - internal static extern int BtGattServiceForeachCharacteristics(BluetoothGattAttributeHandle serviceHandle, BtGattForeachCallback callback, IntPtr userData); - - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_gatt_service_add_included_service")] - internal static extern int BtGattServiceAddIncludedService(BluetoothGattAttributeHandle serviceHandle, BluetoothGattAttributeHandle includedServiceHandle); - - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_gatt_service_get_included_service")] - internal static extern int BtGattServiceGetIncludedService(BluetoothGattAttributeHandle serviceHandle, string uuid, out BluetoothGattAttributeHandle includedServiceHandle); - - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_gatt_service_foreach_included_services")] - internal static extern int BtGattServiceForeachIncludedServices(BluetoothGattAttributeHandle serviceHandle, BtGattForeachCallback callback, IntPtr userData); - - // GATT Client - - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_gatt_client_destroy")] - internal static extern int BtGattClientDestroy(IntPtr clientHandle); - - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_gatt_client_create")] - internal static extern int BtGattClientCreate(string remoteAddress, out BluetoothGattClientHandle clientHandle); - - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_gatt_client_get_remote_address")] - internal static extern int BtGattClientGetRemoteAddress(BluetoothGattClientHandle clientHandle, out string remoteAddress); - - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_gatt_client_get_service")] - internal static extern int BtGattClientGetService(BluetoothGattClientHandle clientHandle, string uuid, out BluetoothGattAttributeHandle serviceHandle); - - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_gatt_client_foreach_services")] - internal static extern int BtGattClientForeachServices(BluetoothGattClientHandle clientHandle, BtGattForeachCallback callback, IntPtr userData); - - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_gatt_client_read_value")] - internal static extern int BtGattClientReadValue(BluetoothGattAttributeHandle gattHandle, BtGattClientRequestCompletedCallback callback, IntPtr userData); - - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_gatt_client_write_value")] - internal static extern int BtGattClientWriteValue(BluetoothGattAttributeHandle gattHandle, BtGattClientRequestCompletedCallback callback, IntPtr userData); - - // GATT Server - - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_gatt_server_destroy")] - internal static extern int BtGattServerDestroy(IntPtr serverHandle); - - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_gatt_server_create")] - internal static extern int BtGattServerCreate(out BluetoothGattServerHandle serverHandle); - - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_gatt_server_initialize")] - internal static extern int BtGattServerInitialize(); - - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_gatt_server_deinitialize")] - internal static extern int BtGattServerDeinitialize(); - - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_gatt_server_set_read_value_requested_cb")] - internal static extern int BtGattServerSetReadValueRequestedCallback(BluetoothGattAttributeHandle gattHandle, BtGattServerReadValueRequestedCallback callback, IntPtr userData); - - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_gatt_server_set_write_value_requested_cb")] - internal static extern int BtGattServerSetWriteValueRequestedCallback(BluetoothGattAttributeHandle gattHandle, BtGattServerWriteValueRequestedCallback callback, IntPtr userData); - - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_gatt_server_set_characteristic_notification_state_change_cb")] - internal static extern int BtGattServeSetNotificationStateChangeCallback(BluetoothGattAttributeHandle characteristicHandle, BtGattServerNotificationStateChangeCallback callback, IntPtr userData); - - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_gatt_server_start")] - internal static extern int BtGattServerStart(); - - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_gatt_server_register_service")] - internal static extern int BtGattServerRegisterService(BluetoothGattServerHandle serverHandle, BluetoothGattAttributeHandle serviceHandle); - - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_gatt_server_unregister_service")] - internal static extern int BtGattServerUnregisterService(BluetoothGattServerHandle serverHandle, BluetoothGattAttributeHandle serviceHandle); - - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_gatt_server_unregister_all_services")] - internal static extern int BtGattServerUnregisterAllServices(BluetoothGattServerHandle serverHandle); - - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_gatt_server_get_service")] - internal static extern int BtGattServerGetService(BluetoothGattServerHandle serverHandle, string uuid, out BluetoothGattAttributeHandle serviceHandle); - - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_gatt_server_foreach_services")] - internal static extern int BtGattServerForeachServices(BluetoothGattServerHandle serverHandle, BtGattForeachCallback callback, IntPtr userData); - - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_gatt_server_send_response")] - internal static extern int BtGattServerSendResponse(int requestId, int requestType, int offset, int status, byte[] value, int valueLen); - - [DllImport(Libraries.Bluetooth, EntryPoint = "bt_gatt_server_notify_characteristic_changed_value")] - internal static extern int BtGattServerNotify(BluetoothGattAttributeHandle characteristicHandle, BtGattServerNotificationSentCallback callback, string clientAddress, IntPtr userData); - } -} - - diff --git a/src/Tizen.Network.Bluetooth/Interop/Interop.Glib.cs b/src/Tizen.Network.Bluetooth/Interop/Interop.Glib.cs deleted file mode 100644 index 576a6e287..000000000 --- a/src/Tizen.Network.Bluetooth/Interop/Interop.Glib.cs +++ /dev/null @@ -1,30 +0,0 @@ -/* - * 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 Glib - { - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool GSourceFunc(IntPtr userData); - - [DllImport(Libraries.Glib, EntryPoint = "g_idle_add", CallingConvention = CallingConvention.Cdecl)] - internal static extern uint IdleAdd(GSourceFunc d, IntPtr data); - } -} diff --git a/src/Tizen.Network.Bluetooth/Interop/Interop.Libc.cs b/src/Tizen.Network.Bluetooth/Interop/Interop.Libc.cs deleted file mode 100644 index 825599e27..000000000 --- a/src/Tizen.Network.Bluetooth/Interop/Interop.Libc.cs +++ /dev/null @@ -1,27 +0,0 @@ -/* - * 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 Libc - { - [DllImport(Libraries.Libc, EntryPoint = "free", CallingConvention = CallingConvention.Cdecl)] - internal static extern int Free(IntPtr ptr); - } -} diff --git a/src/Tizen.Network.Bluetooth/Interop/Interop.Libraries.cs b/src/Tizen.Network.Bluetooth/Interop/Interop.Libraries.cs deleted file mode 100644 index 4aa83d40c..000000000 --- a/src/Tizen.Network.Bluetooth/Interop/Interop.Libraries.cs +++ /dev/null @@ -1,25 +0,0 @@ -/* - * 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 Bluetooth = "libcapi-network-bluetooth.so.0"; - public const string Glib = "libglib-2.0.so.0"; - public const string Libc = "libc.so.6"; - } -} diff --git a/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth.csproj b/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth.csproj deleted file mode 100644 index 348907fb1..000000000 --- a/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth.csproj +++ /dev/null @@ -1,11 +0,0 @@ - - - - netstandard2.0 - - - - - - - \ No newline at end of file diff --git a/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth.sln b/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth.sln deleted file mode 100755 index e422b9d0d..000000000 --- a/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth.sln +++ /dev/null @@ -1,40 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26430.12 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Network.Bluetooth", "Tizen.Network.Bluetooth.csproj", "{5EBC5F29-475A-48FA-982C-7E194CC37AAC}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.System.Information", "..\Tizen.System.Information\Tizen.System.Information.csproj", "{452444AA-6282-4A0C-AFF9-39BECC6BE8FC}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen", "..\Tizen\Tizen.csproj", "{039EED1A-2447-4720-8D4D-173902D41935}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Log", "..\Tizen.Log\Tizen.Log.csproj", "{5896952E-7033-446F-8350-1FBCE1676715}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {5EBC5F29-475A-48FA-982C-7E194CC37AAC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {5EBC5F29-475A-48FA-982C-7E194CC37AAC}.Debug|Any CPU.Build.0 = Debug|Any CPU - {5EBC5F29-475A-48FA-982C-7E194CC37AAC}.Release|Any CPU.ActiveCfg = Release|Any CPU - {5EBC5F29-475A-48FA-982C-7E194CC37AAC}.Release|Any CPU.Build.0 = Release|Any CPU - {452444AA-6282-4A0C-AFF9-39BECC6BE8FC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {452444AA-6282-4A0C-AFF9-39BECC6BE8FC}.Debug|Any CPU.Build.0 = Debug|Any CPU - {452444AA-6282-4A0C-AFF9-39BECC6BE8FC}.Release|Any CPU.ActiveCfg = Release|Any CPU - {452444AA-6282-4A0C-AFF9-39BECC6BE8FC}.Release|Any CPU.Build.0 = Release|Any CPU - {039EED1A-2447-4720-8D4D-173902D41935}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {039EED1A-2447-4720-8D4D-173902D41935}.Debug|Any CPU.Build.0 = Debug|Any CPU - {039EED1A-2447-4720-8D4D-173902D41935}.Release|Any CPU.ActiveCfg = Release|Any CPU - {039EED1A-2447-4720-8D4D-173902D41935}.Release|Any CPU.Build.0 = Release|Any CPU - {5896952E-7033-446F-8350-1FBCE1676715}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {5896952E-7033-446F-8350-1FBCE1676715}.Debug|Any CPU.Build.0 = Debug|Any CPU - {5896952E-7033-446F-8350-1FBCE1676715}.Release|Any CPU.ActiveCfg = Release|Any CPU - {5896952E-7033-446F-8350-1FBCE1676715}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothAdapter.cs b/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothAdapter.cs deleted file mode 100644 index 756944a20..000000000 --- a/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothAdapter.cs +++ /dev/null @@ -1,624 +0,0 @@ -/* - * 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.Collections.Generic; - -namespace Tizen.Network.Bluetooth -{ - /// - /// This class is used to control the Bluetooth adapter and get the list of bonded devices.
- /// The BluetoothAdapter class is used to discover neighbouring bluetooth devices. - ///
- /// http://tizen.org/privilege/bluetooth - static public class BluetoothAdapter - { - /// - /// A property to check whether the Bluetooth is enabled. - /// - /// Thrown when the Bluetooth is not supported. - /// Thrown when the Bluetooth is not enabled. - static public bool IsBluetoothEnabled - { - get - { - try - { - return BluetoothAdapterImpl.Instance.IsBluetoothEnabled; - } - catch (TypeInitializationException e) - { - throw e.InnerException; - } - } - } - - /// - /// The local adapter address. - /// - /// - /// The Bluetooth must be enabled. - /// - /// Thrown when the Bluetooth is not supported. - /// Thrown when the Bluetooth is not enabled. - static public string Address - { - get - { - if (IsBluetoothEnabled) - { - return BluetoothAdapterImpl.Instance.Address; - } - else - { - return null; - } - } - } - - /// - /// The name of the local adapter. - /// - /// - /// The Bluetooth must be enabled. - /// - /// Thrown when the Bluetooth is not supported. - /// Thrown when the Bluetooth is not enabled. - static public string Name - { - get - { - if (IsBluetoothEnabled) - { - return BluetoothAdapterImpl.Instance.Name; - } - else - { - return null; - } - } - set - { - try - { - BluetoothAdapterImpl.Instance.Name = value; - } - catch (TypeInitializationException e) - { - throw e.InnerException; - } - } - } - - /// - /// The visibility mode of the Bluetooth adapter. - /// - /// - /// The Bluetooth must be enabled. - /// - /// Thrown when the Bluetooth is not supported. - /// Thrown when the Bluetooth is not enabled. - static public VisibilityMode Visibility - { - get - { - if (IsBluetoothEnabled) - { - return BluetoothAdapterImpl.Instance.Visibility; - } - else - { - return VisibilityMode.NonDiscoverable; - } - } - } - - /// - /// A property to check whether the device discovery process is in progress. - /// - /// - /// The Bluetooth must be enabled. - /// - /// Thrown when the Bluetooth is not supported. - /// Thrown when the Bluetooth is not enabled. - static public bool IsDiscoveryInProgress - { - get - { - if (IsBluetoothEnabled) - { - return BluetoothAdapterImpl.Instance.IsDiscoveryInProgress; - } - else - { - return false; - } - } - } - - /// - /// The remaining time, in seconds, until the visibility mode is changed from TimeLimitedDiscoverable to NonDiscoverable. - /// - /// - /// The Bluetooth must be enabled. - /// - /// Thrown when the Bluetooth is not supported. - /// Thrown when the Bluetooth is not enabled. - static public int RemainingTimeAsVisible - { - get - { - if (IsBluetoothEnabled) - { - return BluetoothAdapterImpl.Instance.RemainingTimeAsVisible; - } - else - { - return 0; - } - } - } - - /// - /// The StateChanged event is raised when the Bluetooth adapter state is changed. - /// - /// Thrown when the Bluetooth is not supported. - /// Thrown when the Bluetooth is not enabled. - static public event EventHandler StateChanged - { - add - { - try - { - BluetoothAdapterImpl.Instance.StateChanged += value; - } - catch (TypeInitializationException e) - { - throw e.InnerException; - } - } - remove - { - try - { - BluetoothAdapterImpl.Instance.StateChanged -= value; - } - catch (TypeInitializationException e) - { - throw e.InnerException; - } - } - } - - /// - /// The NameChanged event is raised when the Bluetooth adapter name is changed. - /// - /// Thrown when the Bluetooth is not supported. - /// Thrown when the Bluetooth is not enabled. - static public event EventHandler NameChanged - { - add - { - try - { - BluetoothAdapterImpl.Instance.NameChanged += value; - } - catch (TypeInitializationException e) - { - throw e.InnerException; - } - } - remove - { - try - { - BluetoothAdapterImpl.Instance.NameChanged -= value; - } - catch (TypeInitializationException e) - { - throw e.InnerException; - } - } - } - - /// - /// The VisibilityModeChanged event is raised when the Bluetooth adapter visibility mode is changed. - /// - /// Thrown when the Bluetooth is not supported. - /// Thrown when the Bluetooth is not enabled. - static public event EventHandler VisibilityModeChanged - { - add - { - try - { - BluetoothAdapterImpl.Instance.VisibilityModeChanged += value; - } - catch (TypeInitializationException e) - { - throw e.InnerException; - } - } - remove - { - try - { - BluetoothAdapterImpl.Instance.VisibilityModeChanged -= value; - } - catch (TypeInitializationException e) - { - throw e.InnerException; - } - } - } - - /// - /// The VisibilityDurationChanged event is raised very second until the visibility mode is changed to NonDiscoverable. - /// - /// Thrown when the Bluetooth is not supported. - /// Thrown when the Bluetooth is not enabled. - static public event EventHandler VisibilityDurationChanged - { - add - { - try - { - BluetoothAdapterImpl.Instance.VisibilityDurationChanged += value; - } - catch (TypeInitializationException e) - { - throw e.InnerException; - } - } - remove - { - try - { - BluetoothAdapterImpl.Instance.VisibilityDurationChanged -= value; - } - catch (TypeInitializationException e) - { - throw e.InnerException; - } - } - } - - /// - /// The DiscoveryStateChanged event is raised when the device discovery state is changed. - /// - /// Thrown when the Bluetooth is not supported. - /// Thrown when the Bluetooth is not enabled. - static public event EventHandler DiscoveryStateChanged - { - add - { - try - { - BluetoothAdapterImpl.Instance.DiscoveryStateChanged += value; - } - catch (TypeInitializationException e) - { - throw e.InnerException; - } - } - remove - { - try - { - BluetoothAdapterImpl.Instance.DiscoveryStateChanged -= value; - } - catch (TypeInitializationException e) - { - throw e.InnerException; - } - } - } - - /// - /// This event is called when the LE scan result is obtained. - /// - /// Thrown when the Bluetooth is not supported. - /// Thrown when the Bluetooth is not enabled. - static public event EventHandler ScanResultChanged - { - add - { - try - { - BluetoothLeImplAdapter.Instance.AdapterLeScanResultChanged += value; - } - catch (TypeInitializationException e) - { - throw e.InnerException; - } - } - remove - { - try - { - BluetoothLeImplAdapter.Instance.AdapterLeScanResultChanged -= value; - } - catch (TypeInitializationException e) - { - throw e.InnerException; - } - } - } - - /// - /// Starts the device discovery process. - /// - /// - /// The Bluetooth must be enabled and the device discovery process can be stopped by StopDiscovery(). - /// If this succeeds, the DiscoveryStateChanged event will be invoked. - /// - /// Thrown when the Bluetooth is not supported. - /// Thrown when the Bluetooth is not enabled - /// or the start discovery fails. - static public void StartDiscovery() - { - if (IsBluetoothEnabled) - { - BluetoothAdapterImpl.Instance.StartDiscovery(); - } - } - - /// - /// Stops the device discovery process. - /// - /// - /// The device discovery process must be in progress with StartDiscovery(). - /// If this succeeds, the DiscoveryStateChanged event will be invoked. - /// - /// Thrown when the Bluetooth is not supported. - /// Thrown when the Bluetooth is not enabled or - /// the discovery process is not is progress. - static public void StopDiscovery() - { - if (IsDiscoveryInProgress) - { - BluetoothAdapterImpl.Instance.StopDiscovery(); - } - } - - /// - /// Retrieves the device information of all bonded devices. - /// - /// - /// The Bluetooth must be enabled. - /// - /// The list of the bonded BluetoothDeviceInfo objects. - /// Thrown when the Bluetooth is not supported. - /// Thrown when the Bluetooth is not enabled - /// or reading the Bonded devices list is failed. - static public IEnumerable GetBondedDevices() - { - if (IsBluetoothEnabled) - { - return BluetoothAdapterImpl.Instance.GetBondedDevices(); - } - else - { - return null; - } - } - - /// - /// Gets the device information of a bonded device. - /// - /// - /// The Bluetooth must be enabled. - /// - /// Information of the bonded BluetoothDeviceInfo object. - /// Thrown when the Bluetooth is not supported. - /// Thrown when the Bluetooth is not enabled - /// or reading the bonded device information fails. - static public BluetoothDevice GetBondedDevice(string address) - { - if (IsBluetoothEnabled) - { - return BluetoothAdapterImpl.Instance.GetBondedDevice(address); - } - else - { - return null; - } - } - - /// - /// Checks whether the UUID of service is used or not. - /// - /// true if the specified serviceUuid is used, otherwise false. - /// The UUID of Service. - /// Thrown when the Bluetooth is not supported. - /// Thrown when the Bluetooth is not enabled. - static public bool IsServiceUsed(string serviceUuid) - { - try - { - return BluetoothAdapterImpl.Instance.IsServiceUsed(serviceUuid); - } - catch (TypeInitializationException e) - { - throw e.InnerException; - } - } - - /// - /// Gets the hash and the randomizer value of the local OOB data object. - /// - /// - /// The Bluetooth must be enabled. - /// - /// The BluetoothOobData object. - /// Thrown when the Bluetooth is not supported. - /// Thrown when the Bluetooth is not enabled - /// or the read OObData procedure is failed. - static public BluetoothOobData GetLocalOobData() - { - if (IsBluetoothEnabled && Globals.IsInitialize) - { - return BluetoothAdapterImpl.Instance.GetLocalOobData(); - } - else - { - return null; - } - } - - /// - /// Sets the hash and the randmoizer value of the OOB data into the remote device. - /// - /// - /// The Bluetooth must be enabled. - /// - /// The remote device address. - /// The BluetoothOobData object. - /// Thrown when the Bluetooth is not supported. - /// Thrown when the Bluetooth is not enabled - /// or the set OobData procedure is failed. - static public void SetRemoteOobData(string address, BluetoothOobData oobData) - { - if (IsBluetoothEnabled && Globals.IsInitialize) - { - BluetoothAdapterImpl.Instance.SetRemoteOobData(address, oobData); - } - } - - /// - /// Removes the hash and the randomizer value of the OOB data from the remote device. - /// - /// - /// The Bluetooth must be enabled. - /// - /// The remote device address. - /// Thrown when the Bluetooth is not supported. - /// Thrown when the Bluetooth is not enabled. - /// or if the Remove Oobdata procedure is failed. - static public void RemoveRemoteOobData(string address) - { - if (IsBluetoothEnabled && Globals.IsInitialize) - { - BluetoothAdapterImpl.Instance.RemoveRemoteOobData(address); - } - } - - /// - /// Starts the Bluetooth LE scan operation to discover BLE devices - /// - /// - /// The Bluetooth must be enabled. - /// The result of the operation StartLeScan. - /// Thrown when the Bluetooth LE is not supported. - /// Thrown when the Bluetooth LE is not enabled - /// or the Start LE scan is failed. - static public void StartLeScan() - { - if (BluetoothAdapter.IsBluetoothEnabled && Globals.IsInitialize) - { - int ret = BluetoothLeImplAdapter.Instance.StartScan (); - if (ret != (int)BluetoothError.None) - { - Log.Error(Globals.LogTag, "Failed to in start the le scan operation, Error - " + (BluetoothError)ret); - BluetoothErrorFactory.ThrowBluetoothException(ret); - } - } - else - { - BluetoothErrorFactory.ThrowBluetoothException((int)BluetoothError.NotEnabled); - } - } - - /// - /// Stops the Bluetooth LE scan operation. - /// - /// - /// The Bluetooth must be enabled. - /// The result of the operation stopLescan. - /// Thrown when the Bluetooth LE is not supported. - /// Thrown when the Bluetooth LE is not enabled - /// or the Stop LE scan is failed. - static public void StopLeScan() - { - if (BluetoothAdapter.IsBluetoothEnabled && Globals.IsInitialize) - { - int ret = BluetoothLeImplAdapter.Instance.StopScan (); - if (ret != (int)BluetoothError.None) - { - Log.Error(Globals.LogTag, "Failed to stop the le scan operation, Error - " + (BluetoothError)ret); - BluetoothErrorFactory.ThrowBluetoothException(ret); - } - } - else - { - BluetoothErrorFactory.ThrowBluetoothException((int)BluetoothError.NotEnabled); - } - } - - /// - /// Returns the BluetoothLeAdvertiser instance. - /// - /// - /// The Bluetooth must be enabled before calling this API. - /// - /// The BluetoothLeAdvertiser instance. - static public BluetoothLeAdvertiser GetBluetoothLeAdvertiser() - { - return BluetoothLeAdvertiser.Instance; - } - - /// - /// Registers a rfcomm server socket with a specific UUID. - /// - /// - /// The Bluetooth must be enabled before calling this API. - /// - /// The BluetoothServerSocket instance. - /// The UUID of service to provide. - /// Thrown when the Bluetooth is not supported. - /// Thrown when the Bluetooth is not enabled - /// or the socket create error occurs. - static public BluetoothServerSocket CreateServerSocket(string serviceUuid) - { - if (IsBluetoothEnabled && Globals.IsInitialize) - { - return BluetoothAdapterImpl.Instance.CreateServerSocket (serviceUuid); - } - else - { - return null; - } - } - - /// - /// Removes the rfcomm server socket which was created using CreateServerSocket(). - /// - /// - /// The socket must be created with CreateServerSocket(). The ConnectionStateChanged event is raised after this API is called. - /// - /// The server socket instance is created using CreateServerSocket(). - /// Thrown when the Bluetooth is not supported. - /// Thrown when the Bluetooth is not enabled - /// or the socket destroy error occurs. - static public void DestroyServerSocket(BluetoothServerSocket socket) - { - if (IsBluetoothEnabled && Globals.IsInitialize) - { - BluetoothAdapterImpl.Instance.DestroyServerSocket(socket); - } - } - } -} diff --git a/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothAdapterImpl.cs b/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothAdapterImpl.cs deleted file mode 100644 index 14e298178..000000000 --- a/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothAdapterImpl.cs +++ /dev/null @@ -1,637 +0,0 @@ -/* - * 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.Collections.Generic; -using System.Runtime.InteropServices; - -namespace Tizen.Network.Bluetooth -{ - static internal class Globals - { - internal const string LogTag = "Tizen.Network.Bluetooth"; - internal static bool IsInitialize = false; - internal static bool IsAudioInitialize = false; - internal static bool IsHidInitialize = false; - internal static bool IsOppServerInitialized = false; - internal static bool IsOppClientInitialized = false; - } - - internal partial class BluetoothAdapterImpl : IDisposable - { - private event EventHandler _stateChanged; - private event EventHandler _nameChanged; - private event EventHandler _visibilityModeChanged; - private event EventHandler _visibilityDurationChanged; - private event EventHandler _discoveryStateChanged; - - private Interop.Bluetooth.StateChangedCallback _stateChangedCallback; - private Interop.Bluetooth.NameChangedCallback _nameChangedCallback; - private Interop.Bluetooth.VisibilityModeChangedCallback _visibilityChangedCallback; - private Interop.Bluetooth.VisibilityDurationChangedCallback _visibilitydurationChangedCallback; - private Interop.Bluetooth.DiscoveryStateChangedCallback _discoveryStateChangedCallback; - - private static readonly BluetoothAdapterImpl _instance = new BluetoothAdapterImpl(); - private bool disposed = false; - - internal event EventHandler StateChanged - { - add - { - if (_stateChanged == null) - { - RegisterStateChangedEvent(); - } - _stateChanged += value; - } - remove - { - _stateChanged -= value; - if (_stateChanged == null) - { - UnregisterStateChangedEvent(); - } - } - } - - internal event EventHandler NameChanged - { - add - { - if (_nameChanged == null) - { - RegisterNameChangedEvent(); - } - _nameChanged += value; - } - remove - { - _nameChanged -= value; - if (_nameChanged == null) - { - UnregisterNameChangedEvent(); - } - } - } - - internal event EventHandler VisibilityModeChanged - { - add - { - if (_visibilityModeChanged == null) - { - RegisterVisibilityChangedEvent(); - } - _visibilityModeChanged += value; - } - remove - { - _visibilityModeChanged -= value; - if (_visibilityModeChanged == null) - { - UnregisterVisibilityChangedEvent(); - } - } - } - - internal event EventHandler VisibilityDurationChanged - { - add - { - if (_visibilityDurationChanged == null) - { - RegisterVisibilityDurationChangedEvent(); - } - _visibilityDurationChanged += value; - } - remove - { - _visibilityDurationChanged -= value; - if (_visibilityDurationChanged == null) - { - UnregisterVisibilityDurationChangedEvent(); - } - } - } - - internal event EventHandler DiscoveryStateChanged - { - add - { - if (_discoveryStateChanged == null) - { - RegisterDiscoveryStateChangedEvent(); - } - _discoveryStateChanged+= value; - } - remove - { - _discoveryStateChanged -= value; - if (_discoveryStateChanged == null) - { - UnregisterDiscoveryStateChangedEvent(); - } - } - } - - private void RegisterStateChangedEvent() - { - _stateChangedCallback = (int result, int state, IntPtr userData) => - { - if (_stateChanged != null) - { - BluetoothState st = (BluetoothState)state; - BluetoothError res = (BluetoothError)result; - _stateChanged(null, new StateChangedEventArgs(res,st)); - } - }; - int ret = Interop.Bluetooth.SetStateChangedCallback(_stateChangedCallback, IntPtr.Zero); - if (ret != (int)BluetoothError.None) - { - Log.Error(Globals.LogTag, "Failed to set state changed callback, Error - " + (BluetoothError)ret); - } - } - - private void UnregisterStateChangedEvent() - { - int ret = Interop.Bluetooth.UnsetStateChangedCallback(); - if (ret != (int)BluetoothError.None) - { - Log.Error(Globals.LogTag, "Failed to unset state changed callback, Error - " + (BluetoothError)ret); - } - } - - private void RegisterNameChangedEvent() - { - _nameChangedCallback = (string deviceName, IntPtr userData) => - { - if (_nameChanged != null) - { - _nameChanged(null, new NameChangedEventArgs(deviceName)); - } - }; - int ret = Interop.Bluetooth.SetNameChangedCallback(_nameChangedCallback, IntPtr.Zero); - if (ret != (int)BluetoothError.None) - { - Log.Error(Globals.LogTag, "Failed to set name changed callback, Error - " + (BluetoothError)ret); - } - } - - private void UnregisterNameChangedEvent() - { - int ret = Interop.Bluetooth.UnsetNameChangedCallback(); - if (ret != (int)BluetoothError.None) - { - Log.Error(Globals.LogTag, "Failed to unset name changed callback, Error - " + (BluetoothError)ret); - } - } - - private void RegisterVisibilityChangedEvent() - { - _visibilityChangedCallback = (int result, int mode, IntPtr userData) => - { - if (_visibilityModeChanged != null) - { - VisibilityMode visibility = (VisibilityMode)mode; - BluetoothError res = (BluetoothError)result; - _visibilityModeChanged(null, new VisibilityModeChangedEventArgs(res,visibility)); - } - }; - int ret = Interop.Bluetooth.SetVisibilityModeChangedCallback(_visibilityChangedCallback, IntPtr.Zero); - if (ret != (int)BluetoothError.None) - { - Log.Error(Globals.LogTag, "Failed to set visibility mode changed callback, Error - " + (BluetoothError)ret); - } - } - - private void UnregisterVisibilityChangedEvent() - { - int ret = Interop.Bluetooth.UnsetVisibilityModeChangedCallback(); - if (ret != (int)BluetoothError.None) - { - Log.Error(Globals.LogTag, "Failed to unset visibility mode changed callback, Error - " + (BluetoothError)ret); - } - } - - private void RegisterVisibilityDurationChangedEvent() - { - _visibilitydurationChangedCallback = (int duration, IntPtr userData) => - { - if (_visibilityDurationChanged != null) - { - _visibilityDurationChanged(null, new VisibilityDurationChangedEventArgs(duration)); - } - }; - int ret = Interop.Bluetooth.SetVisibilityDurationChangedCallback(_visibilitydurationChangedCallback, IntPtr.Zero); - if (ret != (int)BluetoothError.None) - { - Log.Error(Globals.LogTag, "Failed to set visibility duration changed callback, Error - " + (BluetoothError)ret); - } - } - - private void UnregisterVisibilityDurationChangedEvent() - { - int ret = Interop.Bluetooth.UnsetVisibilityDurationChangedCallback(); - if (ret != (int)BluetoothError.None) - { - Log.Error(Globals.LogTag, "Failed to unset visiiblity duration changed callback, Error - " + (BluetoothError)ret); - } - } - - private void RegisterDiscoveryStateChangedEvent() - { - _discoveryStateChangedCallback = (int result, BluetoothDeviceDiscoveryState state, IntPtr deviceInfo, IntPtr userData) => - { - Log.Info(Globals.LogTag, "Discovery state changed callback is called"); - if (_discoveryStateChanged != null) - { - BluetoothError res = (BluetoothError)result; - switch(state) - { - case BluetoothDeviceDiscoveryState.Started: - _discoveryStateChanged(null, new DiscoveryStateChangedEventArgs(res,state)); - break; - case BluetoothDeviceDiscoveryState.Finished: - { - _discoveryStateChanged(null, new DiscoveryStateChangedEventArgs(res,state)); - break; - } - case BluetoothDeviceDiscoveryState.Found: - { - BluetoothDiscoveredDeviceStruct info = (BluetoothDiscoveredDeviceStruct)Marshal.PtrToStructure(deviceInfo, typeof(BluetoothDiscoveredDeviceStruct)); - _discoveryStateChanged(null, new DiscoveryStateChangedEventArgs(res,state,BluetoothUtils.ConvertStructToDiscoveredDevice(info))); - break; - } - default: - break; - } - } - }; - int ret = Interop.Bluetooth.SetDiscoveryStateChangedCallback(_discoveryStateChangedCallback, IntPtr.Zero); - if (ret != (int)BluetoothError.None) - { - Log.Error(Globals.LogTag, "Failed to set discovery state changed callback, Error - " + (BluetoothError)ret); - } - } - - private void UnregisterDiscoveryStateChangedEvent() - { - int ret = Interop.Bluetooth.UnsetDiscoveryStateChangedCallback(); - if (ret != (int)BluetoothError.None) - { - Log.Error(Globals.LogTag, "Failed to unset discovery state changed callback, Error - " + (BluetoothError)ret); - } - } - - internal bool IsBluetoothEnabled - { - get - { - BluetoothState active; - int ret = Interop.Bluetooth.GetState(out active); - if (ret != (int)BluetoothError.None) - { - Log.Error(Globals.LogTag, "Failed to get state, Error - " + (BluetoothError)ret); - } - if (active == BluetoothState.Enabled) - return true; - else - return false; - } - } - internal string Address - { - get - { - string address; - int ret = Interop.Bluetooth.GetAddress(out address); - if (ret != (int)BluetoothError.None) - { - Log.Error(Globals.LogTag, "Failed to get address, Error - " + (BluetoothError)ret); - return ""; - } - return address; - } - } - - internal VisibilityMode Visibility - { - get - { - int visibilityMode; - int time; - int ret = Interop.Bluetooth.GetVisibility(out visibilityMode, out time); - if(ret != (int)BluetoothError.None) - { - Log.Error(Globals.LogTag, "Failed to get visibility mode, Error - " + (BluetoothError)ret); - return VisibilityMode.NonDiscoverable; - } - return (VisibilityMode)visibilityMode; - } - } - - internal bool IsDiscoveryInProgress - { - get - { - bool isDiscovering; - int ret = Interop.Bluetooth.IsDiscovering(out isDiscovering); - if(ret != (int)BluetoothError.None) - { - Log.Error(Globals.LogTag, "Failed to get discovery progress state, Error - " + (BluetoothError)ret); - } - return isDiscovering; - } - } - - internal int RemainingTimeAsVisible - { - get - { - int duration = 0; - int visibilityMode; - int ret = Interop.Bluetooth.GetVisibility(out visibilityMode, out duration); - if ((ret != (int)BluetoothError.None) || ((VisibilityMode)visibilityMode != VisibilityMode.TimeLimitedDiscoverable)) - { - Log.Error(Globals.LogTag, "Failed to get remaining visible time, Error - " + (BluetoothError)ret); - } - return duration; - } - } - - internal string Name - { - get - { - string name; - int ret = Interop.Bluetooth.GetName(out name); - if (ret != (int)BluetoothError.None) - { - Log.Error(Globals.LogTag, "Failed to get adapter name, Error - " + (BluetoothError)ret); - return ""; - } - return name; - } - set - { - int ret = Interop.Bluetooth.SetName(value.ToString()); - if (ret != (int)BluetoothError.None) - { - Log.Error(Globals.LogTag, "Failed to set adapter name, Error - " + (BluetoothError)ret); - BluetoothErrorFactory.ThrowBluetoothException(ret); - } - } - } - - internal void StartDiscovery() - { - int ret = Interop.Bluetooth.StartDiscovery(); - if (ret != (int)BluetoothError.None) - { - Log.Error(Globals.LogTag, "Failed to start discovery, Error - " + (BluetoothError)ret); - BluetoothErrorFactory.ThrowBluetoothException(ret); - } - } - - internal void StopDiscovery() - { - int ret = Interop.Bluetooth.StopDiscovery(); - if(ret != (int)BluetoothError.None) - { - Log.Error(Globals.LogTag, "Failed to stop discovery, Error - " + (BluetoothError)ret); - BluetoothErrorFactory.ThrowBluetoothException(ret); - } - } - - internal IEnumerable GetBondedDevices() - { - List deviceList = new List(); - Interop.Bluetooth.BondedDeviceCallback callback = (ref BluetoothDeviceStruct deviceInfo, IntPtr userData) => - { - Log.Info(Globals.LogTag, "Bonded devices cb is called"); - if(!deviceInfo.Equals(null)) - { - deviceList.Add(BluetoothUtils.ConvertStructToDeviceClass(deviceInfo)); - } - return true; - }; - int ret = Interop.Bluetooth.GetBondedDevices(callback, IntPtr.Zero); - if(ret != (int)BluetoothError.None) - { - Log.Error(Globals.LogTag, "Failed to get bonded devices, Error - " + (BluetoothError)ret); - BluetoothErrorFactory.ThrowBluetoothException(ret); - } - return deviceList; - } - - internal BluetoothDevice GetBondedDevice(string address) - { - IntPtr deviceInfo; - int ret = Interop.Bluetooth.GetBondedDeviceByAddress(address, out deviceInfo); - if(ret != (int)BluetoothError.None) - { - Log.Error(Globals.LogTag, "Failed to get bonded device by address, Error - " + (BluetoothError)ret); - BluetoothErrorFactory.ThrowBluetoothException(ret); - } - BluetoothDeviceStruct device = (BluetoothDeviceStruct)Marshal.PtrToStructure(deviceInfo, typeof(BluetoothDeviceStruct)); - - return BluetoothUtils.ConvertStructToDeviceClass(device); - } - - internal bool IsServiceUsed(string serviceUuid) - { - bool isUsed; - int ret = Interop.Bluetooth.IsServiceUsed(serviceUuid, out isUsed); - if(ret != (int)BluetoothError.None) - { - Log.Error(Globals.LogTag, "Failed to check the usage of service, Error - " + (BluetoothError)ret); - } - return isUsed; - } - - internal BluetoothOobData GetLocalOobData() - { - BluetoothOobData oobData = new BluetoothOobData(); - IntPtr hash; - IntPtr randomizer; - int hashLength; - int randomizerLength; - int ret = Interop.Bluetooth.GetOobData(out hash, out randomizer, out hashLength, out randomizerLength); - if(ret != (int)BluetoothError.None) - { - Log.Error(Globals.LogTag, "Failed to get the local oob data, Error - " + (BluetoothError)ret); - BluetoothErrorFactory.ThrowBluetoothException(ret); - } - - byte[] hashArr = new byte[hashLength]; - Marshal.Copy(hash, hashArr, 0, hashLength); - byte[] randomizerArr = new byte[randomizerLength]; - Marshal.Copy(randomizer, randomizerArr, 0, randomizerLength); - - oobData.HashValue = hashArr; - oobData.RandomizerValue = randomizerArr; - return oobData; - } - - internal void SetRemoteOobData(string deviceAddress, BluetoothOobData oobData) - { - byte[] hash = oobData.HashValue; - byte[] randomizer = oobData.RandomizerValue; - int hashLength = hash.Length; - int randomizerLength = randomizer.Length; - - IntPtr hashPtr = Marshal.AllocHGlobal(hashLength); - Marshal.Copy(hash, 0, hashPtr, hashLength); - IntPtr randomizerPtr = Marshal.AllocHGlobal(randomizerLength); - Marshal.Copy(randomizer, 0, randomizerPtr, randomizerLength); - - int ret = Interop.Bluetooth.SetOobData(deviceAddress, hashPtr, randomizerPtr, hashLength, randomizerLength); - if(ret != (int)BluetoothError.None) - { - Log.Error(Globals.LogTag, "Failed to set the remote oob data, Error - " + (BluetoothError)ret); - BluetoothErrorFactory.ThrowBluetoothException(ret); - } - } - - internal void RemoveRemoteOobData(string deviceAddress) - { - int ret = Interop.Bluetooth.RemoveOobData(deviceAddress); - if(ret != (int)BluetoothError.None) - { - Log.Error(Globals.LogTag, "Failed to remove the remote oob data, Error - " + (BluetoothError)ret); - BluetoothErrorFactory.ThrowBluetoothException(ret); - } - } - - internal BluetoothServerSocket CreateServerSocket(string serviceUuid) - { - int socketFd; - int ret = Interop.Bluetooth.CreateServerSocket(serviceUuid, out socketFd); - if(ret != (int)BluetoothError.None) - { - Log.Error(Globals.LogTag, "Failed to create server socket, Error - " + (BluetoothError)ret); - BluetoothErrorFactory.ThrowBluetoothException(ret); - } - Log.Info (Globals.LogTag, "Created socketfd: "+ socketFd); - return new BluetoothServerSocket(socketFd); - } - - internal void DestroyServerSocket(BluetoothServerSocket socket) - { - int ret = Interop.Bluetooth.DestroyServerSocket(socket.socketFd); - if (ret != (int)BluetoothError.None) - { - Log.Error(Globals.LogTag, "Failed to destroy socket, Error - " + (BluetoothError)ret); - BluetoothErrorFactory.ThrowBluetoothException(ret); - } - } - - internal static BluetoothAdapterImpl Instance - { - get - { - return _instance; - } - } - - private BluetoothAdapterImpl() - { - initialize(); - } - - ~BluetoothAdapterImpl() - { - Dispose(false); - } - - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - - private void Dispose(bool disposing) - { - if (disposed) - return; - - if (disposing) - { - // Free managed objects. - } - //Free unmanaged objects - RemoveAllRegisteredEvent(); - deinitialize(); - disposed = true; - } - - private void initialize() - { - int ret = Interop.Bluetooth.Initialize(); - if (ret != (int)BluetoothError.None) - { - Log.Error (Globals.LogTag, "Failed to initialize bluetooth, Error - " + (BluetoothError)ret); - BluetoothErrorFactory.ThrowBluetoothException (ret); - } - else - { - Globals.IsInitialize = true; - } - } - - private void deinitialize() - { - int ret = Interop.Bluetooth.Deinitialize(); - if (ret != (int)BluetoothError.None) - { - Log.Error (Globals.LogTag, "Failed to deinitialize bluetooth, Error - " + (BluetoothError)ret); - } - else - { - Globals.IsInitialize = false; - } - } - - private void RemoveAllRegisteredEvent() - { - //unregister all remaining events when this object is released. - if (_stateChanged != null) - { - UnregisterStateChangedEvent(); - } - - if (_nameChanged != null) - { - UnregisterNameChangedEvent(); - } - - if (_visibilityDurationChanged != null) - { - UnregisterVisibilityDurationChangedEvent(); - } - - if (_visibilityModeChanged != null) - { - UnregisterVisibilityChangedEvent(); - } - - if (_discoveryStateChanged != null) - { - UnregisterDiscoveryStateChangedEvent(); - } - } - } -} diff --git a/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothAudio.cs b/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothAudio.cs deleted file mode 100644 index 614607ffe..000000000 --- a/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothAudio.cs +++ /dev/null @@ -1,105 +0,0 @@ -/* - * 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.Network.Bluetooth -{ - /// - /// This class is used to handle the connection with other Bluetooth audio devices - /// like headset, hands-free, and headphone. - /// - /// http://tizen.org/privilege/bluetooth - public class BluetoothAudio : BluetoothProfile - { - internal BluetoothAudio() - { - } - - /// - /// The AudioConnectionStateChanged event is called when the audio connection state is changed. - /// - public event EventHandler AudioConnectionStateChanged - { - add - { - BluetoothAudioImpl.Instance.AudioConnectionStateChanged += value; - } - remove - { - BluetoothAudioImpl.Instance.AudioConnectionStateChanged -= value; - } - } - - /// - /// Connects the remote device with the given audio profile. - /// - /// - /// The device must be bonded with the remote device by CreateBond(). If connection request succeeds, the AudioConnectionStateChanged event will be invoked. - /// If audio profile type is All and this request succeeds, then the AudioConnectionStateChanged event will be called twice when HspHfp
- /// and AdvancedAudioDistribution is connected. - ///
- /// The type of the audio profile. - /// Thrown when the Bluetooth is not supported. - /// Thrown when the Bluetooth is not enabled - /// or when the connection attempt fails. - public void Connect(BluetoothAudioProfileType profileType) - { - if (BluetoothAdapter.IsBluetoothEnabled && Globals.IsInitialize) - { - int ret = BluetoothAudioImpl.Instance.Connect(RemoteAddress, profileType); - if (ret != (int)BluetoothError.None) - { - Log.Error(Globals.LogTag, "Failed to Connect - " + (BluetoothError)ret); - BluetoothErrorFactory.ThrowBluetoothException(ret); - } - } - else - { - BluetoothErrorFactory.ThrowBluetoothException((int)BluetoothError.NotEnabled); - } - } - - /// - /// Disconnects the remote device with the given audio profile. - /// - /// - /// The device must be connected by Connect(). If the disconnection request succeeds, the AudioConnectionStateChanged event will be invoked. - /// If audio profile type is All and this request succeeds, then the AudioConnectionStateChanged event will be called twice when HspHfp
- /// and AdvancedAudioDistribution is disconnected. - ///
- /// The type of the audio profile. - /// Thrown when the Bluetooth is not supported. - /// Thrown when the Bluetooth is not enabled - /// or when Disconnection attempt fails. - public void Disconnect(BluetoothAudioProfileType type) - { - if (BluetoothAdapter.IsBluetoothEnabled && Globals.IsInitialize) - { - int ret = BluetoothAudioImpl.Instance.Disconnect(RemoteAddress, type); - if (ret != (int)BluetoothError.None) - { - Log.Error(Globals.LogTag, "Failed to Disconnect - " + (BluetoothError)ret); - BluetoothErrorFactory.ThrowBluetoothException(ret); - } - } - else - { - BluetoothErrorFactory.ThrowBluetoothException((int)BluetoothError.NotEnabled); - } - } - } -} diff --git a/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothAudioImpl.cs b/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothAudioImpl.cs deleted file mode 100644 index 6570dc9ea..000000000 --- a/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothAudioImpl.cs +++ /dev/null @@ -1,174 +0,0 @@ -/* - * 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.Network.Bluetooth -{ - internal class BluetoothAudioImpl : IDisposable - { - private event EventHandler _audioConnectionChanged; - private Interop.Bluetooth.AudioConnectionStateChangedCallback _audioConnectionChangedCallback; - - private static readonly BluetoothAudioImpl _instance = new BluetoothAudioImpl(); - private bool disposed = false; - - internal event EventHandler AudioConnectionStateChanged - { - add - { - if (_audioConnectionChanged == null) - { - RegisterAudioConnectionChangedEvent(); - } - _audioConnectionChanged += value; - } - remove - { - _audioConnectionChanged -= value; - if (_audioConnectionChanged == null) - { - UnregisterAudioConnectionChangedEvent(); - } - } - } - - private void RegisterAudioConnectionChangedEvent() - { - _audioConnectionChangedCallback = (int result, bool connected, string deviceAddress, int profileType, IntPtr userData) => - { - if (_audioConnectionChanged != null) - { - _audioConnectionChanged(null, new AudioConnectionStateChangedEventArgs(result, connected, deviceAddress, (BluetoothAudioProfileType)profileType)); - } - }; - int ret = Interop.Bluetooth.SetAudioConnectionStateChangedCallback(_audioConnectionChangedCallback, IntPtr.Zero); - if (ret != (int)BluetoothError.None) - { - Log.Error(Globals.LogTag, "Failed to set audio connection changed callback, Error - " + (BluetoothError)ret); - } - } - - private void UnregisterAudioConnectionChangedEvent() - { - int ret = Interop.Bluetooth.UnsetAudioConnectionStateChangedCallback(); - if (ret != (int)BluetoothError.None) - { - Log.Error(Globals.LogTag, "Failed to unset audio connection changed callback, Error - " + (BluetoothError)ret); - } - } - - internal int Connect(string deviceAddress, BluetoothAudioProfileType type) - { - int ret = Interop.Bluetooth.Connect(deviceAddress, (int)type); - if (ret != (int)BluetoothError.None) - { - Log.Error(Globals.LogTag, "Failed to connect device with the given profile type, Error - " + (BluetoothError)ret); - } - return ret; - } - - internal int Disconnect(string deviceAddress, BluetoothAudioProfileType type) - { - int ret = Interop.Bluetooth.Disconnect(deviceAddress, (int)type); - if (ret != (int)BluetoothError.None) - { - Log.Error(Globals.LogTag, "Failed to disconnect device with the given profile type, Error - " + (BluetoothError)ret); - } - return ret; - } - - internal static BluetoothAudioImpl Instance - { - get - { - return _instance; - } - } - - private BluetoothAudioImpl () - { - Log.Info(Globals.LogTag, "Initializing audio"); - initialize(); - } - - ~BluetoothAudioImpl() - { - Dispose(false); - } - - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - - private void Dispose(bool disposing) - { - if (disposed) - return; - - if (disposing) - { - // Free managed objects. - } - //Free unmanaged objects - deinitialize(); - RemoveAllRegisteredEvent(); - disposed = true; - } - - private void initialize() - { - if (Globals.IsInitialize) - { - int ret = Interop.Bluetooth.InitializeAudio (); - if (ret != (int)BluetoothError.None) - { - Log.Error(Globals.LogTag, "Failed to initialize bluetoothaudio, Error - " + (BluetoothError)ret); - Globals.IsAudioInitialize = false; - BluetoothErrorFactory.ThrowBluetoothException (ret); - } - else - { - Globals.IsAudioInitialize = true; - } - } - else - { - BluetoothErrorFactory.ThrowBluetoothException((int)BluetoothError.NotInitialized); - } - } - - private void deinitialize() - { - if (Globals.IsAudioInitialize) { - int ret = Interop.Bluetooth.DeinitializeAudio (); - if (ret != (int)BluetoothError.None) { - Log.Error (Globals.LogTag, "Failed to deinitialize bluetoothaudio, Error - " + (BluetoothError)ret); - } - } - } - - private void RemoveAllRegisteredEvent() - { - if (_audioConnectionChanged != null) - { - UnregisterAudioConnectionChangedEvent(); - } - } - } -} diff --git a/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothAvrcp.cs b/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothAvrcp.cs deleted file mode 100644 index ac814ee9d..000000000 --- a/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothAvrcp.cs +++ /dev/null @@ -1,262 +0,0 @@ -/* - * 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.Network.Bluetooth -{ - /// - /// This class is used to notify changes of the target device (For example, media player) to the control device (For example, headset). - /// - /// http://tizen.org/privilege/bluetooth - public class BluetoothAvrcp : BluetoothProfile - { - internal BluetoothAvrcp() - { - } - - /// - /// The TargetConnectionStateChanged event is invoked when the connection state is changed. - /// - public event EventHandler TargetConnectionStateChanged - { - add - { - BluetoothAvrcpImpl.Instance.TargetConnectionStateChanged += value; - } - remove - { - BluetoothAvrcpImpl.Instance.TargetConnectionStateChanged -= value; - } - } - - /// - /// The EqualizerStateChanged event is invoked when the equalizer state is changed by the remote control device. - /// - public event EventHandler EqualizerStateChanged - { - add - { - BluetoothAvrcpImpl.Instance.EqualizerStateChanged += value; - } - remove - { - BluetoothAvrcpImpl.Instance.EqualizerStateChanged -= value; - } - } - - /// - /// The RepeatModeChanged event is invoked when the repeat mode is changed by the remote control device. - /// - public event EventHandler RepeatModeChanged - { - add - { - BluetoothAvrcpImpl.Instance.RepeatModeChanged += value; - } - remove - { - BluetoothAvrcpImpl.Instance.RepeatModeChanged -= value; - } - } - - /// - /// The ShuffleModeChanged event is invoked when the shuffle mode is changed by the remote control device. - /// - public event EventHandler ShuffleModeChanged - { - add - { - BluetoothAvrcpImpl.Instance.ShuffleModeChanged += value; - } - remove - { - BluetoothAvrcpImpl.Instance.ShuffleModeChanged -= value; - } - } - - /// - /// The ScanModeChanged event is invoked when the scan mode is changed by the remote control device. - /// - public event EventHandler ScanModeChanged - { - add - { - BluetoothAvrcpImpl.Instance.ScanModeChanged += value; - } - remove - { - BluetoothAvrcpImpl.Instance.ScanModeChanged -= value; - } - } - - /// - /// Notifies the equalize state to the remote device. - /// - /// - /// The remote device must be connected. - /// - /// The equalizer state. - /// Thrown when the Bluetooth is not supported. - /// Thrown when the Bluetooth is not enabled - /// or when notifying the equalizer state to the remote device fails. - public void NotifyEqualizerState(EqualizerState state) - { - if (BluetoothAdapter.IsBluetoothEnabled && Globals.IsInitialize) - { - BluetoothAvrcpImpl.Instance.NotifyEqualizeState(state); - } - else - { - BluetoothErrorFactory.ThrowBluetoothException((int)BluetoothError.NotEnabled); - } - } - - /// - /// Notifies the repeat mode to the remote device. - /// - /// - /// The remote device must be connected. - /// - /// The repeat mode. - /// Thrown when the Bluetooth is not supported. - /// Thrown when the Bluetooth is not enabled - /// or when notifying the repeat mode state to the remote device fails. - /// - public void NotifyRepeatMode(RepeatMode mode) - { - if (BluetoothAdapter.IsBluetoothEnabled && Globals.IsInitialize) - { - BluetoothAvrcpImpl.Instance.NotifyRepeatMode(mode); - } - else - { - BluetoothErrorFactory.ThrowBluetoothException((int)BluetoothError.NotEnabled); - } - } - - /// - /// Notifies the shuffle mode to the remote device. - /// - /// - /// The remote device must be connected. - /// - /// The shuffle mode. - /// Thrown when the Bluetooth is not supported. - /// Thrown when the Bluetooth is not enabled - /// or when notifying the shuffle mode state to the remote device fails. - public void NotifyShuffleMode(ShuffleMode mode) - { - if (BluetoothAdapter.IsBluetoothEnabled && Globals.IsInitialize) - { - BluetoothAvrcpImpl.Instance.NotifyShuffleMode(mode); - } - else - { - BluetoothErrorFactory.ThrowBluetoothException((int)BluetoothError.NotEnabled); - } - } - - /// - /// Notifies the scan mode to the remote device. - /// - /// - /// The remote device must be connected. - /// - /// The scan mode. - /// Thrown when the Bluetooth is not supported. - /// Thrown when the Bluetooth is not enabled - /// or when notifying the scan mode state to the remote device fails. - public void NotifyScanMode(ScanMode mode) - { - if (BluetoothAdapter.IsBluetoothEnabled && Globals.IsInitialize) - { - BluetoothAvrcpImpl.Instance.NotifyScanMode(mode); - } - else - { - BluetoothErrorFactory.ThrowBluetoothException((int)BluetoothError.NotEnabled); - } - } - - /// - /// Notifies the player state to the remote device. - /// - /// - /// The remote device must be connected. - /// - /// The player state. - /// Thrown when the Bluetooth is not supported. - /// Thrown when the Bluetooth is not enabled - /// or when notifying the player state to the remote device fails. - public void NotifyPlayerState(PlayerState state) - { - if (BluetoothAdapter.IsBluetoothEnabled && Globals.IsInitialize) - { - BluetoothAvrcpImpl.Instance.NotifyPlayerState(state); - } - else - { - BluetoothErrorFactory.ThrowBluetoothException((int)BluetoothError.NotEnabled); - } - } - - /// - /// Notifies the current position of the song to the remote device. - /// - /// - /// The remote device must be connected. - /// - /// The current position in milliseconds. - /// Thrown when the Bluetooth is not supported. - /// Thrown when the Bluetooth is not enabled - /// or when notifying the current position state to the remote device fails. - public void NotifyCurrentPosition(uint position) - { - if (BluetoothAdapter.IsBluetoothEnabled && Globals.IsInitialize) - { - BluetoothAvrcpImpl.Instance.NotifyCurrentPosition(position); - } - else - { - BluetoothErrorFactory.ThrowBluetoothException((int)BluetoothError.NotEnabled); - } - } - - /// - /// Notifies the track to the remote device. - /// - /// - /// The remote device must be connected. - /// - /// The data of the track. - /// Thrown when the Bluetooth is not supported. - /// Thrown when the Bluetooth is not enabled - /// or when notifying the shuffle track state to the remote device fails. - public void NotifyTrack(Track trackData) - { - if (BluetoothAdapter.IsBluetoothEnabled && Globals.IsInitialize) - { - BluetoothAvrcpImpl.Instance.NotifyTrack(trackData); - } - else - { - BluetoothErrorFactory.ThrowBluetoothException((int)BluetoothError.NotEnabled); - } - } - } -} - diff --git a/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothAvrcpImpl.cs b/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothAvrcpImpl.cs deleted file mode 100644 index 28abda86e..000000000 --- a/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothAvrcpImpl.cs +++ /dev/null @@ -1,419 +0,0 @@ -/* - * 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.Network.Bluetooth -{ - internal class BluetoothAvrcpImpl : IDisposable - { - private event EventHandler _targetConnectionChanged; - private event EventHandler _equalizerStateChanged; - private event EventHandler _repeatModeChanged; - private event EventHandler _scanModeChanged; - private event EventHandler _shuffleModeChanged; - - private Interop.Bluetooth.TargetConnectionStateChangedCallback _targetConnectionChangedCallback; - private Interop.Bluetooth.EqualizerStateChangedCallback _equalizerStateChangedCallback; - private Interop.Bluetooth.RepeatModeChangedCallback _repeatModeChangedCallback; - private Interop.Bluetooth.ShuffleModeChangedCallback _shuffleModeChangedCallback; - private Interop.Bluetooth.ScanModeChangedCallback _scanModeChangedCallback; - - private static BluetoothAvrcpImpl _instance = new BluetoothAvrcpImpl(); - private bool disposed = false; - - internal event EventHandler TargetConnectionStateChanged - { - add - { - _targetConnectionChanged += value; - } - remove - { - _targetConnectionChanged -= value; - } - } - - internal event EventHandler EqualizerStateChanged - { - add - { - if (_equalizerStateChanged == null) - { - RegisterEqualizerStateChangedEvent(); - } - _equalizerStateChanged += value; - } - remove - { - _equalizerStateChanged -= value; - if (_equalizerStateChanged == null) - { - UnregisterEqualizerStateChangedEvent(); - } - } - } - - internal event EventHandler RepeatModeChanged - { - add - { - if (_repeatModeChanged == null) - { - RegisterRepeatModeChangedEvent(); - } - _repeatModeChanged += value; - } - remove - { - _repeatModeChanged -= value; - if (_repeatModeChanged == null) - { - UnregisterRepeatModeChangedEvent(); - } - } - } - - internal event EventHandler ShuffleModeChanged - { - add - { - if (_shuffleModeChanged == null) - { - RegisterShuffleModeChangedEvent(); - } - _shuffleModeChanged += value; - } - remove - { - _shuffleModeChanged -= value; - if (_shuffleModeChanged == null) - { - UnregisterShuffleModeChangedEvent(); - } - } - } - - internal event EventHandler ScanModeChanged - { - add - { - if (_scanModeChanged == null) - { - RegisterScanModeChangedEvent(); - } - _scanModeChanged += value; - } - remove - { - _scanModeChanged -= value; - if (_scanModeChanged == null) - { - UnregisterScanModeChangedEvent(); - } - } - } - - private void RegisterEqualizerStateChangedEvent() - { - _equalizerStateChangedCallback = (int equalizer, IntPtr userData) => - { - if (_equalizerStateChanged != null) - { - EqualizerState state = (EqualizerState) equalizer; - _equalizerStateChanged(null, new EqualizerStateChangedEventArgs(state)); - } - }; - int ret = Interop.Bluetooth.SetEqualizerStateChangedCallback(_equalizerStateChangedCallback, IntPtr.Zero); - if (ret != (int)BluetoothError.None) - { - Log.Error(Globals.LogTag, "Failed to set equalizer state changed callback, Error - " + (BluetoothError)ret); - } - } - private void UnregisterEqualizerStateChangedEvent() - { - int ret = Interop.Bluetooth.UnsetEqualizerStateChangedCallback(); - if (ret != (int)BluetoothError.None) - { - Log.Error(Globals.LogTag, "Failed to unset equalizer state changed callback, Error - " + (BluetoothError)ret); - } - } - - private void RegisterRepeatModeChangedEvent() - { - _repeatModeChangedCallback = (int repeat, IntPtr userData) => - { - if (_repeatModeChanged != null) - { - RepeatMode mode = (RepeatMode)repeat; - _repeatModeChanged(null, new RepeatModeChangedEventArgs(mode)); - } - }; - int ret = Interop.Bluetooth.SetRepeatModeChangedCallback(_repeatModeChangedCallback, IntPtr.Zero); - if (ret != (int)BluetoothError.None) - { - Log.Error(Globals.LogTag, "Failed to set repeat mode changed callback, Error - " + (BluetoothError)ret); - } - } - private void UnregisterRepeatModeChangedEvent() - { - int ret = Interop.Bluetooth.UnsetRepeatModeChangedCallback(); - if (ret != (int)BluetoothError.None) - { - Log.Error(Globals.LogTag, "Failed to unset repeat mode changed callback, Error - " + (BluetoothError)ret); - } - } - - private void RegisterShuffleModeChangedEvent() - { - Log.Debug (Globals.LogTag, "inside RegisterShuffleModeChangedEvent"); - _shuffleModeChangedCallback = (int shuffle, IntPtr userData) => - { - Log.Debug (Globals.LogTag, "inside RegisterShuffleModeChangedEvent callback"); - if (_shuffleModeChanged != null) - { - ShuffleMode mode = (ShuffleMode) shuffle; - _shuffleModeChanged(null, new ShuffleModeChangedeventArgs(mode)); - } - }; - int ret = Interop.Bluetooth.SetShuffleModeChangedCallback(_shuffleModeChangedCallback, IntPtr.Zero); - if (ret != (int)BluetoothError.None) - { - Log.Debug (Globals.LogTag, "failed inside RegisterShuffleModeChangedEvent"); - Log.Error(Globals.LogTag, "Failed to set shuffle mode changed callback, Error - " + (BluetoothError)ret); - } - } - private void UnregisterShuffleModeChangedEvent() - { - int ret = Interop.Bluetooth.UnsetShuffleModeChangedCallback(); - if (ret != (int)BluetoothError.None) - { - Log.Error(Globals.LogTag, "Failed to unset shuffle mode changed callback, Error - " + (BluetoothError)ret); - } - } - - private void RegisterScanModeChangedEvent() - { - _scanModeChangedCallback = (int scan, IntPtr userData) => - { - if (_scanModeChanged != null) - { - ScanMode mode = (ScanMode) scan; - _scanModeChanged(null, new ScanModeChangedEventArgs(mode)); - } - }; - int ret = Interop.Bluetooth.SetScanModeChangedCallback(_scanModeChangedCallback, IntPtr.Zero); - if (ret != (int)BluetoothError.None) - { - Log.Error(Globals.LogTag, "Failed to set scan mode changed callback, Error - " + (BluetoothError)ret); - } - } - private void UnregisterScanModeChangedEvent() - { - int ret = Interop.Bluetooth.UnsetScanModeChangedCallback(); - if (ret != (int)BluetoothError.None) - { - Log.Error(Globals.LogTag, "Failed to unset scan mode changed callback, Error - " + (BluetoothError)ret); - } - } - - private void targetInitialize() - { - if (Globals.IsInitialize) - { - _targetConnectionChangedCallback = (bool connected, string deviceAddress, IntPtr userData) => - { - if (_targetConnectionChanged != null) - { - _targetConnectionChanged(null, new TargetConnectionStateChangedEventArgs(connected, deviceAddress)); - } - }; - - int ret = Interop.Bluetooth.InitializeAvrcp(_targetConnectionChangedCallback, IntPtr.Zero); - if (ret != (int)BluetoothError.None) - { - Log.Error (Globals.LogTag, "Failed to initialize bluetooth avrcp, Error - " + (BluetoothError)ret); - BluetoothErrorFactory.ThrowBluetoothException(ret); - } - else - { - Globals.IsAudioInitialize = true; - } - } - else - { - Log.Error(Globals.LogTag, "Failed to initialize Avrcp, BT not initialized"); - BluetoothErrorFactory.ThrowBluetoothException((int)BluetoothError.NotInitialized); - } - } - - private void targetDeinitialize() - { - if (Globals.IsAudioInitialize) - { - int ret = Interop.Bluetooth.DeinitializeAvrcp(); - if (ret != (int)BluetoothError.None) - { - Log.Error (Globals.LogTag, "Failed to deinitialize bluetooth avrcp, Error - " + (BluetoothError)ret); - BluetoothErrorFactory.ThrowBluetoothException(ret); - } - else - { - Globals.IsAudioInitialize = false; - } - } - } - - internal void NotifyEqualizeState(EqualizerState state) - { - int ret = Interop.Bluetooth.NotifyEqualizerState((int)state); - if (ret != (int)BluetoothError.None) - { - Log.Error(Globals.LogTag, "Failed to notify equalizer state to remote device, Error - " + (BluetoothError)ret); - BluetoothErrorFactory.ThrowBluetoothException(ret); - } - } - - internal void NotifyRepeatMode(RepeatMode repeat) - { - int ret = Interop.Bluetooth.NotifyRepeatMode((int)repeat); - if (ret != (int)BluetoothError.None) - { - Log.Error(Globals.LogTag, "Failed to notify repeat mode to remote device, Error - " + (BluetoothError)ret); - BluetoothErrorFactory.ThrowBluetoothException(ret); - } - } - - internal void NotifyShuffleMode(ShuffleMode shuffle) - { - int ret = Interop.Bluetooth.NotifyShuffleMode((int)shuffle); - if (ret != (int)BluetoothError.None) - { - Log.Error(Globals.LogTag, "Failed to notify shuffle mode to remote device, Error - " + (BluetoothError)ret); - BluetoothErrorFactory.ThrowBluetoothException(ret); - } - } - - internal void NotifyScanMode(ScanMode scan) - { - int ret = Interop.Bluetooth.NotifyScanMode((int)scan); - if (ret != (int)BluetoothError.None) - { - Log.Error(Globals.LogTag, "Failed to notify scan mode to remote device, Error - " + (BluetoothError)ret); - BluetoothErrorFactory.ThrowBluetoothException(ret); - } - } - - internal void NotifyPlayerState(PlayerState state) - { - int ret = Interop.Bluetooth.NotifyPlayerState((int)state); - if (ret != (int)BluetoothError.None) - { - Log.Error(Globals.LogTag, "Failed to notify player state to remote device, Error - " + (BluetoothError)ret); - BluetoothErrorFactory.ThrowBluetoothException(ret); - } - } - - internal void NotifyCurrentPosition(uint position) - { - int ret = Interop.Bluetooth.NotifyCurrentPosition(position); - if (ret != (int)BluetoothError.None) - { - Log.Error(Globals.LogTag, "Failed to notify position to remote device, Error - " + (BluetoothError)ret); - BluetoothErrorFactory.ThrowBluetoothException(ret); - } - } - - internal void NotifyTrack(Track trackData) - { - string title = trackData.Title; - string artist = trackData.Artist; - string album = trackData.Album; - string genre = trackData.Genre; - uint trackNum = trackData.TrackNum; - uint totalTracks = trackData.TotalTracks; - uint duration = trackData.Duration; - - int ret = Interop.Bluetooth.NotifyTrack(title, artist, album, genre, trackNum, totalTracks, duration); - if (ret != (int)BluetoothError.None) - { - Log.Error(Globals.LogTag, "Failed to notify track data to the remote device, Error - " + (BluetoothError)ret); - BluetoothErrorFactory.ThrowBluetoothException(ret); - } - } - - internal static BluetoothAvrcpImpl Instance - { - get - { - return _instance; - } - } - - private BluetoothAvrcpImpl() - { - targetInitialize(); - } - - ~BluetoothAvrcpImpl() - { - Dispose(false); - } - - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - - private void Dispose(bool disposing) - { - if (disposed) - return; - - if (disposing) - { - // Free managed objects. - } - //Free unmanaged objects - targetDeinitialize(); - RemoveAllRegisteredEvent(); - disposed = true; - } - - private void RemoveAllRegisteredEvent() - { - //unregister all remaining events when this object is released. - if (_equalizerStateChanged != null) - { - UnregisterEqualizerStateChangedEvent(); - } - if (_repeatModeChanged != null) - { - UnregisterRepeatModeChangedEvent(); - } - if (_scanModeChanged != null) - { - UnregisterScanModeChangedEvent(); - } - if (_shuffleModeChanged != null) - { - UnregisterShuffleModeChangedEvent(); - } - } - } -} - diff --git a/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothData.cs b/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothData.cs deleted file mode 100644 index cf386c548..000000000 --- a/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothData.cs +++ /dev/null @@ -1,499 +0,0 @@ -/* - * 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; -using System.Collections.Generic; -using System.Collections.Concurrent; -using System.Collections.ObjectModel; -using System.Collections.Specialized; - -namespace Tizen.Network.Bluetooth -{ - /// - /// This class is used to handle the device class types and the service. - /// - public class BluetoothClass - { - internal BluetoothMajorDeviceClassType MajorType; - internal BluetoothMinorDeviceClassType MinorType; - internal int Mask; - - internal BluetoothClass() - { - } - - /// - /// The type of the major device class. - /// - public BluetoothMajorDeviceClassType MajorDeviceClassType - { - get - { - return MajorType; - } - } - /// - /// The type of the minor device class. - /// - public BluetoothMinorDeviceClassType MinorDeviceClassType - { - get - { - return MinorType; - } - } - /// - /// The major service class mask. - /// - public int MajorServiceClassMask - { - get - { - return Mask; - } - } - } - - /// - /// This class contains the information of the Bluetooth OOB data. - /// - public class BluetoothOobData - { - /// - /// The default constructor. Initializes an object of the BluetoothOobData. - /// - public BluetoothOobData() - { - } - - /// - /// The hash value. - /// - public byte[] HashValue - { - get; - set; - } - /// - /// The randomizer value. - /// - public byte[] RandomizerValue - { - get; - set; - } - } - - /// - /// This class contains the information of the Bluetooth device SDP data. - /// - public class BluetoothDeviceSdpData - { - internal string Address; - internal Collection Uuid; - - internal BluetoothDeviceSdpData() - { - } - - /// - /// The device address. - /// - public string DeviceAddress - { - get - { - return Address; - } - } - /// - /// The service UUID. - /// - public IEnumerable ServiceUuid - { - get - { - return Uuid; - } - } - } - - /// - /// This class contains the information of the Bluetooth device connection data. - /// - public class BluetoothDeviceConnectionData - { - internal string RemoteAddress; - internal BluetoothConnectionLinkType Link; - internal BluetoothDisconnectReason Reason; - - internal BluetoothDeviceConnectionData() - { - } - - /// - /// The device address. - /// - public string Address - { - get - { - return RemoteAddress; - } - } - /// - /// The type of the connection link. - /// - public BluetoothConnectionLinkType LinkType - { - get - { - return Link; - } - } - /// - /// The disconnect reason. - /// - public BluetoothDisconnectReason DisconnectReason - { - get - { - return Reason; - } - } - } - - /// - /// This class contains the information of the track data. - /// - public class Track - { - /// - /// The default constructor. Initializes an object of the track. - /// - public Track() - { - } - - /// - /// The title of the track. - /// - public string Title - { - get; - set; - } - /// - /// The artist of the track. - /// - public string Artist - { - get; - set; - } - /// - /// The album of the track. - /// - public string Album - { - get; - set; - } - /// - /// The genre of the track. - /// - public string Genre - { - get; - set; - } - /// - /// The track number. - /// - public uint TrackNum - { - get; - set; - } - /// - /// The number of all tracks. - /// - public uint TotalTracks - { - get; - set; - } - /// - /// The duration of the track in milliseconds. - /// - public uint Duration - { - get; - set; - } - } - - /// - /// This class contains the information of the manufacturer data. - /// - public class ManufacturerData - { - /// - /// The default Constructor. Initializes an object of the ManufacturerData. - /// - public ManufacturerData() - { - } - - /// - /// The manufacturer ID. - /// - public int Id - { - get; - set; - } - /// - /// The length of the manufacturer data. - /// - public int DataLength - { - get; - set; - } - /// - /// The manufacturer data. - /// - public byte[] Data - { - get; - set; - } - } - - internal class BluetoothLeScanData - { - internal string RemoteAddress - { - get; - set; - } - internal BluetoothLeDeviceAddressType AddressType - { - get; - set; - } - internal int Rssi - { - get; - set; - } - internal int AdvDataLength - { - get; - set; - } - internal byte[] AdvData - { - get; - set; - } - internal int ScanDataLength - { - get; - set; - } - internal byte[] ScanData - { - get; - set; - } - } - - /// - /// This class contains the information of the Bluetooth service data. - /// - public class BluetoothServiceData - { - /// - /// The default constructor. Initializes an object of the BluetoothServiceData. - /// - public BluetoothServiceData() - { - } - - /// - /// The UUID of the service. - /// - public string Uuid - { - get; - set; - } - /// - /// The data length of the service data. - /// - public int DataLength - { - get; - set; - } - /// - /// The service data. - /// - public byte[] Data - { - get; - set; - } - } - - /// - /// This class contains the service data information. - /// - public class BluetoothLeServiceData - { - internal string Uuid; - internal byte[] Data; - internal int Length; - - internal BluetoothLeServiceData() - { - } - - /// - /// The Bluetooth LE service UUID. - /// - public string ServiceUuid - { - get - { - return Uuid; - } - } - /// - /// The Bluetooth LE service data. - /// - public byte[] ServiceData - { - get - { - return Data; - } - } - /// - /// The length of the service data. - /// - public int ServiceDataLength - { - get - { - return Length; - } - } - } - - /// - /// This class contains the information of the socket data. - /// - public class SocketData - { - internal string RecvData; - internal int Size; - internal int Fd; - - internal SocketData() - { - } - - /// - /// The socket FD. - /// - public int SocketFd - { - get - { - return Fd; - } - } - /// - /// The length of the received data. - /// - public int DataSize - { - get - { - return Size; - } - } - /// - /// The received data. - /// - public string Data - { - get - { - return RecvData; - } - } - } - - /// - /// This class contains the information of the socket connection. - /// - public class SocketConnection - { - internal string Uuid; - internal string RemoteAddress; - internal int Fd; - - internal SocketConnection() - { - } - - /// - /// The connected socket FD. - /// - public int SocketFd - { - get - { - return Fd; - } - } - /// - /// The remote device address. - /// - public string Address - { - get - { - return RemoteAddress; - } - } - /// - /// The service UUID. - /// - public string ServiceUuid - { - get - { - return Uuid; - } - } - } -} diff --git a/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothDevice.cs b/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothDevice.cs deleted file mode 100644 index 24f159348..000000000 --- a/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothDevice.cs +++ /dev/null @@ -1,701 +0,0 @@ -/* - * 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.Collections.Generic; -using System.Runtime.InteropServices; -using System.Collections.Concurrent; -using System.Collections.ObjectModel; -using System.Collections.Specialized; - -namespace Tizen.Network.Bluetooth -{ - /// - /// This class is used to handle the connection with other devices and set authorization of other devices.
- /// The BluetoothDevice class is used to search for services available on remote devices. - ///
- /// http://tizen.org/privilege/bluetooth - public class BluetoothDevice - { - private event EventHandler _bondCreated; - private event EventHandler _bondDestroyed; - private event EventHandler _authorizationChanged; - private event EventHandler _serviceSearched; - private event EventHandler _connectionChanged; - - private Interop.Bluetooth.BondCreatedCallback _bondCreatedCallback; - private Interop.Bluetooth.BondDestroyedCallback _bondDestroyedCallback; - private Interop.Bluetooth.AuthorizationChangedCallback _authorizationChangedCallback; - private Interop.Bluetooth.ServiceSearchedCallback _serviceSearchedCallback; - private Interop.Bluetooth.DeviceConnectionStateChangedCallback _connectionChangedCallback; - - internal string RemoteDeviceAddress; - internal string RemoteDeviceName; - internal int RemoteDeviceRssi; - internal BluetoothClass RemoteDeviceClass; - internal Collection RemoteDeviceService; - internal int RemoteDeviceCount; - internal bool RemotePaired; - internal bool RemoteAuthorized; - internal bool RemoteConnected; - internal BluetoothAppearanceType RemoteAppearance; - internal int RemoteManufLength; - internal string RemoteManufData; - - internal BluetoothDevice() - { - } - - /// - /// The address of the device. - /// - public string Address - { - get - { - return RemoteDeviceAddress; - } - } - /// - /// The name of the device. - /// - public string Name - { - get - { - return RemoteDeviceName; - } - } - /// - /// The strength indicator of received signal of the device. - /// - public int Rssi - { - get - { - return RemoteDeviceRssi; - } - } - /// - /// The class of the device. - /// - public BluetoothClass Class - { - get - { - return RemoteDeviceClass; - } - } - /// - /// The service UUID list of the device. - /// - public IEnumerable ServiceUuidList - { - get - { - return RemoteDeviceService; - } - } - /// - /// The number of services. - /// - public int ServiceCount - { - get - { - return RemoteDeviceCount; - } - } - /// - /// The paired state of the device. - /// - public bool IsPaired - { - get - { - return RemotePaired; - } - } - /// - /// The connection state of the device. - /// - public bool IsConnected - { - get - { - return RemoteConnected; - } - } - /// - /// The authorization state of the device. - /// - public bool IsAuthorized - { - get - { - return RemoteAuthorized; - } - } - /// - /// The Bluetooth appearance. - /// - public BluetoothAppearanceType AppearanceType - { - get - { - return RemoteAppearance; - } - } - - /// - /// The length of the manufacturer data. - /// - public int ManufacturerDataLength - { - get - { - return RemoteManufLength; - } - } - /// - /// The manufacturer data. - /// - public string ManufacturerData - { - get - { - return RemoteManufData; - } - } - - /// - /// The BondCreated event is raised when the process of creating the bond is finished. - /// - public event EventHandler BondCreated - { - add - { - if (_bondCreated == null) - { - RegisterBondCreatedEvent(); - } - _bondCreated += value; - } - remove - { - _bondCreated -= value; - if (_bondCreated == null) - { - UnregisterBondCreatedEvent(); - } - } - } - - /// - /// The BondDestroyed event is raised when the bond is destroyed. - /// - public event EventHandler BondDestroyed - { - add - { - if (_bondDestroyed == null) - { - RegisterBondDestroyedEvent(); - } - _bondDestroyed += value; - } - remove - { - _bondDestroyed -= value; - if (_bondDestroyed == null) - { - UnregisterBondDestroyedEvent(); - } - } - } - - /// - /// The AuthorizationChanged event is raised when the authorization of the device is changed. - /// - public event EventHandler AuthorizationChanged - { - add - { - if (_authorizationChanged == null) - { - RegisterAuthorizationChangedEvent(); - } - _authorizationChanged += value; - } - remove - { - _authorizationChanged -= value; - if (_authorizationChanged == null) - { - UnregisterAuthorizationChangedEvent(); - } - } - } - - /// - /// The ServiceSearched event is raised when the process of service searched is finished. - /// - public event EventHandler ServiceSearched - { - add - { - if (_serviceSearched == null) - { - RegisterServiceSearchedEvent(); - } - _serviceSearched += value; - } - remove - { - _serviceSearched -= value; - if (_serviceSearched == null) - { - UnregisterServiceSearchedEvent(); - } - } - } - - /// - /// The ConnectionStateChanged event is raised when the connection state is changed. - /// - public event EventHandler ConnectionStateChanged - { - add - { - if (_connectionChanged == null) - { - RegisterConnectionChangedEvent(); - } - _connectionChanged += value; - } - remove - { - _connectionChanged -= value; - if (_connectionChanged == null) - { - UnregisterConnectionChangedEvent(); - } - } - } - - private void RegisterBondCreatedEvent() - { - _bondCreatedCallback = (int result, ref BluetoothDeviceStruct device, IntPtr userData) => - { - if (_bondCreated != null) - { - BluetoothError res = (BluetoothError)result; - _bondCreated(null, new BondCreatedEventArgs(res, BluetoothUtils.ConvertStructToDeviceClass(device))); - } - }; - int ret = Interop.Bluetooth.SetBondCreatedCallback(_bondCreatedCallback, IntPtr.Zero); - if (ret != (int)BluetoothError.None) - { - Log.Error(Globals.LogTag, "Failed to set bond created callback, Error - " + (BluetoothError)ret); - } - } - - private void UnregisterBondCreatedEvent() - { - int ret = Interop.Bluetooth.UnsetBondCreatedCallback(); - if (ret != (int)BluetoothError.None) - { - Log.Error(Globals.LogTag, "Failed to unset bond created callback, Error - " + (BluetoothError)ret); - } - } - - private void RegisterBondDestroyedEvent() - { - _bondDestroyedCallback = (int result, string deviceAddress, IntPtr userData) => - { - if (_bondDestroyed != null) - { - BluetoothError res = (BluetoothError)result; - _bondDestroyed(null, new BondDestroyedEventArgs(res, deviceAddress)); - } - }; - int ret = Interop.Bluetooth.SetBondDestroyedCallback(_bondDestroyedCallback, IntPtr.Zero); - if (ret != (int)BluetoothError.None) - { - Log.Error(Globals.LogTag, "Failed to set bond destroyed callback, Error - " + (BluetoothError)ret); - } - } - - private void UnregisterBondDestroyedEvent() - { - int ret = Interop.Bluetooth.UnsetBondDestroyedCallback(); - if (ret != (int)BluetoothError.None) - { - Log.Error(Globals.LogTag, "Failed to unset bond destroyed callback, Error - " + (BluetoothError)ret); - } - } - - private void RegisterServiceSearchedEvent() - { - _serviceSearchedCallback = (int result, ref BluetoothDeviceSdpStruct sdp, IntPtr userData) => - { - Log.Info(Globals.LogTag, "Servicesearched cb is called"); - if (_serviceSearched != null) - { - BluetoothError res = (BluetoothError)result; - _serviceSearched(null, new ServiceSearchedEventArgs(res, BluetoothUtils.ConvertStructToSdpData(sdp))); - } - }; - int ret = Interop.Bluetooth.SetServiceSearchedCallback(_serviceSearchedCallback, IntPtr.Zero); - if (ret != (int)BluetoothError.None) - { - Log.Error(Globals.LogTag, "Failed to set service searched callback, Error - " + (BluetoothError)ret); - } - } - - private void UnregisterServiceSearchedEvent() - { - int ret = Interop.Bluetooth.UnsetServiceSearchedCallback(); - if (ret != (int)BluetoothError.None) - { - Log.Error(Globals.LogTag, "Failed to unset service searched callback, Error - " + (BluetoothError)ret); - } - } - - private void RegisterAuthorizationChangedEvent() - { - _authorizationChangedCallback = (int authorization, string deviceAddress, IntPtr userData) => - { - Log.Info(Globals.LogTag, "Authorization changed cb is called"); - if (_authorizationChanged != null) - { - BluetoothAuthorizationType auth = (BluetoothAuthorizationType)authorization; - _authorizationChanged(null, new AuthorizationChangedEventArgs(auth, deviceAddress)); - } - }; - int ret = Interop.Bluetooth.SetAuthorizationChangedCallback(_authorizationChangedCallback, IntPtr.Zero); - if (ret != (int)BluetoothError.None) - { - Log.Error(Globals.LogTag, "Failed to set authroization changed callback, Error - " + (BluetoothError)ret); - } - } - - private void UnregisterAuthorizationChangedEvent() - { - int ret = Interop.Bluetooth.UnsetAuthorizationChangedCallback(); - if (ret != (int)BluetoothError.None) - { - Log.Error(Globals.LogTag, "Failed to unset authroization changed callback, Error - " + (BluetoothError)ret); - } - } - - private void RegisterConnectionChangedEvent() - { - _connectionChangedCallback = (bool connected, ref BluetoothDeviceConnectionStruct device, IntPtr userData) => - { - Log.Info(Globals.LogTag, "Connection state changed cb is called"); - if (_connectionChanged != null) - { - _connectionChanged(null, new DeviceConnectionStateChangedEventArgs(connected, BluetoothUtils.ConvertStructToConnectionData(device))); - } - }; - - int ret = Interop.Bluetooth.SetConnectionStateChangedCallback(_connectionChangedCallback, IntPtr.Zero); - if (ret != (int)BluetoothError.None) - { - Log.Error(Globals.LogTag, "Failed to set connection state changed callback, Error - " + (BluetoothError)ret); - } - } - - private void UnregisterConnectionChangedEvent() - { - int ret = Interop.Bluetooth.UnsetConnectionStateChangedCallback(); - if (ret != (int)BluetoothError.None) - { - Log.Error(Globals.LogTag, "Failed to unset connection state changed callback, Error - " + (BluetoothError)ret); - } - } - - /// - /// Creates a bond with the remote Bluetooth device. - /// - /// - /// The Bluetooth must be enabled and the remote device must be discoverable by StartDiscovery(). The bond can be destroyed by DestroyBond(). - /// The bonding request can be cancelled by CancelBonding(). If this succeeds, the BondCreated event will be invoked. - /// - /// Thrown when the BT/BTLE is not enabled - /// or when the create bonding process to the remote device fails. - public void CreateBond() - { - if (BluetoothAdapter.IsBluetoothEnabled) - { - int ret = Interop.Bluetooth.CreateBond(RemoteDeviceAddress); - if (ret != (int)BluetoothError.None) - { - Log.Error(Globals.LogTag, "Failed to create bond, Error - " + (BluetoothError)ret); - BluetoothErrorFactory.ThrowBluetoothException(ret); - } - } - } - - /// - /// Cancels the bonding process. - /// - /// - /// Bonding must be in progress by CreateBond(). - /// - /// Thrown when the BT/BTLE is not enabled - /// or when the cancel bonding procedure to remote device fails. - public void CancelBonding() - { - int ret = Interop.Bluetooth.CancelBonding(); - if (ret != (int)BluetoothError.None) - { - Log.Error(Globals.LogTag, "Failed to cancel bonding process, Error - " + (BluetoothError)ret); - BluetoothErrorFactory.ThrowBluetoothException(ret); - } - } - - /// - /// Destroys the bond. - /// - /// - /// The Bluetooth must be enabled and the bond must be created by CreateBond(). - /// If this succeeds, the BondDestroyed event will be invoked. - /// - /// Thrown when the BT/BTLE is not enabled - /// or when the destroy bonding procedure fails. - public void DestroyBond() - { - if (BluetoothAdapter.IsBluetoothEnabled) - { - int ret = Interop.Bluetooth.DestroyBond(RemoteDeviceAddress); - if (ret != (int)BluetoothError.None) - { - Log.Error(Globals.LogTag, "Failed to destroy bond, Error - " + (BluetoothError)ret); - BluetoothErrorFactory.ThrowBluetoothException(ret); - } - } - } - - /// - /// Sets an alias for the bonded device. - /// - /// - /// The Bluetooth must be enabled and the bond must be created by CreateBond(). - /// - /// The alias name of the remote device. - /// Thrown when the BT/BTLE is not enabled - /// or when the set alias name to remote device fails. - public void SetAlias(string aliasName) - { - if (BluetoothAdapter.IsBluetoothEnabled) - { - int ret = Interop.Bluetooth.SetAlias(RemoteDeviceAddress, aliasName); - if (ret != (int)BluetoothError.None) - { - Log.Error(Globals.LogTag, "Failed to set alias name, Error - " + (BluetoothError)ret); - BluetoothErrorFactory.ThrowBluetoothException(ret); - } - } - } - - /// - /// Sets the authorization of a bonded device. - /// - /// - /// The Bluetooth must be enabled and the bond must be created by CreateBond(). - /// If this succeeds, the AuthorizationChanged event will be invoked. - /// - /// The authorization state. - /// Thrown when the BT/BTLE is not enabled - /// or when the set authorization to remote device fails. - public void SetAuthorization(BluetoothAuthorizationType authorizationState) - { - if (BluetoothAdapter.IsBluetoothEnabled) - { - int ret = Interop.Bluetooth.SetAuthorization(RemoteDeviceAddress, (int)authorizationState); - if (ret != (int)BluetoothError.None) - { - Log.Error(Globals.LogTag, "Failed to set authroization state, Error - " + (BluetoothError)ret); - BluetoothErrorFactory.ThrowBluetoothException(ret); - } - } - } - - /// - /// Gets the mask from the UUID. - /// - /// The service mask list converted from the given UUID list. - /// The UUID list of the device. - /// Thrown when the BT/BTLE is not enabled - /// or when the get Mask from UUID fails. - public BluetoothServiceClassType GetMaskFromUuid(string[] uuids) - { - BluetoothServiceClassType serviceMask; - - int ret = Interop.Bluetooth.GetMaskFromUuid(uuids, uuids.Length, out serviceMask); - if (ret != (int)BluetoothError.None) - { - Log.Error(Globals.LogTag, "Failed to get service mask, Error - " + (BluetoothError)ret); - BluetoothErrorFactory.ThrowBluetoothException(ret); - } - return serviceMask; - } - - /// - /// Starts the search for services supported by the specified device. - /// - /// - /// The Bluetooth must be enabled and remote device must be discoverable by StartDiscovery(). The bond must be created by CreateBond(). - /// If this succeeds, the ServiceSearched event will be invoked. - /// - /// Thrown when the BT/BTLE is not enabled - /// or when the remote device service search fails. - public void StartServiceSearch() - { - Log.Info(Globals.LogTag, "startservicesearch entry"); - if (BluetoothAdapter.IsBluetoothEnabled) - { - int ret = Interop.Bluetooth.StartServiceSearch(RemoteDeviceAddress); - if (ret != (int)BluetoothError.None) - { - Log.Error(Globals.LogTag, "Failed to start service search, Error - " + (BluetoothError)ret); - BluetoothErrorFactory.ThrowBluetoothException(ret); - } - } - } - - /// - /// Gets the connected profiles. - /// - /// - /// The Bluetooth must be enabled. - /// - /// The connected Bluetooth profiles. - /// Thrown when the BT/BTLE is not enabled - /// or when there is no BT connection. - public IEnumerable GetConnectedProfiles() - { - if (BluetoothAdapter.IsBluetoothEnabled) - { - List profileList = new List(); - Interop.Bluetooth.ConnectedProfileCallback callback = (int profile, IntPtr userData) => - { - if (!profile.Equals(null)) - { - profileList.Add((BluetoothProfileType)profile); - } - return true; - }; - int ret = Interop.Bluetooth.GetConnectedProfiles(RemoteDeviceAddress, callback, IntPtr.Zero); - if (ret != (int)BluetoothError.None) - { - Log.Error(Globals.LogTag, "Failed to get connected profiles, Error - " + (BluetoothError)ret); - BluetoothErrorFactory.ThrowBluetoothException(ret); - } - return profileList; - } - else - { - return null; - } - } - - /// - /// Determines if profile is connected to the specified remote device. - /// - /// - /// The Bluetooth must be enabled. - /// - /// true if profile is connected, otherwise false. - /// The Bluetooth profile type. - /// Thrown when the BT/BTLE is not enabled - /// or when there is no BT connection. - public bool IsProfileConnected(BluetoothProfileType profileType) - { - if (BluetoothAdapter.IsBluetoothEnabled) - { - bool isConnected; - int ret = Interop.Bluetooth.IsProfileConnected(RemoteDeviceAddress, (int)profileType, out isConnected); - if (ret != (int)BluetoothError.None) - { - Log.Error(Globals.LogTag, "Failed to get profile connected state, Error - " + (BluetoothError)ret); - } - return isConnected; - } - else - { - return false; - } - } - - /// - /// Returns the instance of the Bluetooth profile type. - /// - /// - /// The Bluetooth must be enabled. - /// - public T GetProfile() where T : BluetoothProfile - { - /* - * FIXME: Find a proper way for dynamic allocation. - */ - T profile = null; - String type = typeof(T).ToString(); - if (type.Equals("Tizen.Network.Bluetooth.BluetoothAudio")) - { - BluetoothAudio audio = new BluetoothAudio(); - profile = (audio as T); - } - else if (type.Equals("Tizen.Network.Bluetooth.BluetoothAvrcp")) - { - BluetoothAvrcp avrcp = new BluetoothAvrcp(); - profile = (avrcp as T); - } - else if (type.Equals("Tizen.Network.Bluetooth.BluetoothHid")) - { - BluetoothHid hid = new BluetoothHid(); - profile = (hid as T); - } - - else if (type.Equals("Tizen.Network.Bluetooth.BluetoothOppClient")) - { - BluetoothOppClient oppClient = new BluetoothOppClient(); - profile = (oppClient as T); - } - - if (profile != null) - { - profile.RemoteAddress = RemoteDeviceAddress; - } - return profile; - } - - /// - /// Creates the client socket. - /// - /// The IBluetoothClientSocket instance. - /// The UUID of the service. - public IBluetoothClientSocket CreateSocket(string serviceUuid) - { - BluetoothSocket clientSocket = new BluetoothSocket(); - clientSocket.remoteAddress = this.Address; - clientSocket.serviceUuid = serviceUuid; - return (IBluetoothClientSocket)clientSocket; - } - } -} diff --git a/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothEnumerations.cs b/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothEnumerations.cs deleted file mode 100644 index 1842de931..000000000 --- a/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothEnumerations.cs +++ /dev/null @@ -1,1202 +0,0 @@ -/* - * 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.Network.Bluetooth -{ - /// - /// Enumeration for the Bluetooth states. - /// - public enum BluetoothState - { - /// - /// The disabled state. - /// - Disabled = 0, - /// - /// The enabled state. - /// - Enabled - } - - /// - /// Enumeration for the Bluetooth errors. - /// - public enum BluetoothError - { - /// - /// Successful. - /// - None = ErrorCode.None, - /// - /// Operation canceled. - /// - Cancelled = ErrorCode.Canceled, - /// - /// Invalid parameter. - /// - InvalidParameter = ErrorCode.InvalidParameter, - /// - /// Out of memory. - /// - OutOfMemory = ErrorCode.OutOfMemory, - /// - /// Device or resource busy. - /// - ResourceBusy = ErrorCode.ResourceBusy, - /// - /// Timeout error. - /// - TimedOut = ErrorCode.TimedOut, - /// - /// Operation now in progress. - /// - NowInProgress = ErrorCode.NowInProgress, - /// - /// Bluetooth is not supported. - /// - NotSupported = ErrorCode.NotSupported, - /// - /// Permission denied. - /// - PermissionDenied = ErrorCode.PermissionDenied, - /// - /// Quota exceeded. - /// - QuotaExceeded = ErrorCode.QuotaExceeded, - /// - /// No data available. - /// - NoData = ErrorCode.NoData, - /// - /// Local adapter not initialized. - /// - NotInitialized = -0x01C00000 | 0x0101, - /// - /// Local adapter not enabled. - /// - NotEnabled = -0x01C00000 | 0x0102, - /// - /// Operation already done. - /// - AlreadyDone = -0x01C00000 | 0x0103, - /// - /// Operation failed. - /// - OperationFailed = -0x01C00000 | 0x0104, - /// - /// Operation not in progress. - /// - NotInProgress = -0x01C00000 | 0x0105, - /// - /// Remote device not bonded. - /// - RemoteDeviceNotBonded = -0x01C00000 | 0x0106, - /// - /// Authentication rejected. - /// - AuthRejected = -0x01C00000 | 0x0107, - /// - /// Authentication failed. - /// - AuthFailed = -0x01C00000 | 0x0108, - /// - /// Remote device not found. - /// - RemoteDeviceNotFound = -0x01C00000 | 0x0109, - /// - /// Service search failed. - /// - ServiceSearchFailed = -0x01C00000 | 0x010A, - /// - /// Remote device is not connected. - /// - RemoteDeviceNotConnected = -0x01C00000 | 0x010B, - /// - /// Resource temporarily unavailable. - /// - ResourceUnavailable = -0x01C00000 | 0x010C, - /// - /// Service Not Found. - /// - ServiceNotFound = -0x01C00000 | 0x010D - } - - /// - /// Enumeration for the Bluetooth visibility modes. - /// - public enum VisibilityMode - { - /// - /// The non-discoverable mode. - /// - NonDiscoverable = 0, - /// - /// The discoverable mode. - /// - Discoverable = 1, - /// - /// The discoverable mode with limited time. - /// - TimeLimitedDiscoverable = 2 - } - - /// - /// Enumeration for the Bluetooth major device class types. - /// - public enum BluetoothMajorDeviceClassType - { - /// - /// The miscellaneous major class type. - /// - Misc = 0x00, - /// - /// The computer major class type. - /// - Computer = 0x01, - /// - /// The phone major class type. - /// - Phone = 0x02, - /// - /// The LAN/Network access point major class type. - /// - LanNetworkAccessPoint = 0x03, - /// - /// The audio/video major class type. - /// - AudioVideo = 0x04, - /// - /// The peripheral major class type. - /// - Peripheral = 0x05, - /// - /// The imaging major class type. - /// - Imaging = 0x06, - /// - /// The wearable major class type. - /// - Wearable = 0x07, - /// - /// The toy major class type. - /// - Toy = 0x08, - /// - /// The health major class type. - /// - Health = 0x09, - /// - /// The uncategorized major class type. - /// - Uncategorized = 0x1F - } - - /// - /// Enumeration for the Bluetooth minor device class types. - /// - public enum BluetoothMinorDeviceClassType - { - /// - /// The uncategorized computer minor class type. - /// - ComputerUncategorized = 0x00, - /// - /// The desktop workstation computer minor class type. - /// - ComputerDesktopWorkstation = 0x04, - /// - /// The server computer minor class type. - /// - ComputerServer = 0x08, - /// - /// The laptop computer minor class type. - /// - ComputerLaptop = 0x0C, - /// - /// The handheld PC/PDA computer minor class type. - /// - ComputerHandheldPcOrPda = 0x10, - /// - /// The palm sized PC/PDA computer minor class type. - /// - ComputerPalmSizedPcOrPda = 0x14, - /// - /// The wearable computer minor class type. - /// - ComputerWearableComputer = 0x18, - - /// - /// The unclassified phone minor class type. - /// - PhoneUncategorized = 0x00, - /// - /// The cellular phone minor class type. - /// - PhoneCellular = 0x04, - /// - /// The cordless phone minor class type. - /// - PhoneCordless = 0x08, - /// - /// The smartphone phone minor class type. - /// - PhoneSmartPhone = 0x0C, - /// - /// The wired modem or voice gateway phone minor class type. - /// - PhoneWiredModemOrVoiceGateway = 0x10, - /// - /// The ISDN phone minor class type. - /// - PhoneCommonIsdnAccess = 0x14, - - /// - /// Fully available LAN/Network access point minor class type. - /// - LanNetworkAccessPointFullyAvailable = 0x04, - /// - /// 1-17% utilized LAN/Network access point minor class type. - /// - LanNetworkAccessPoint1To17PercentUtilized = 0x20, - /// - /// 17-33% utilized LAN/Network access point minor class type. - /// - LanNetworkAccessPoint17To33PercentUtilized = 0x40, - /// - /// 33-50% utilized LAN/Network access point minor class type. - /// - LanNetworkAccessPoint33To50PercentUtilized = 0x60, - /// - /// 50-67% utilized LAN/Network access point minor class type. - /// - LanNetworkAccessPoint50To67PercentUtilized = 0x80, - /// - /// 67-83% utilized LAN/Network access point minor class type. - /// - LanNetworkAccessPoint67To83PercentUtilized = 0xA0, - /// - /// 83-99% utilized LAN/Network access point minor class type. - /// - LanNetworkAccessPoint83To99PercentUtilized = 0xC0, - /// - /// No service available LAN/Network access point minor class type. - /// - LanNetworkAccessPointNoServiceAvailable = 0xE0, - - /// - /// The uncategorized audio/video minor class type. - /// - AudioVideoUncategorized = 0x00, - /// - /// The wearable headset audio/video minor class type. - /// - AudioVideoWearableHeadset = 0x04, - /// - /// The hands free audio/video minor class type. - /// - AudioVideoHandsFree = 0x08, - /// - /// The microphone audio/video minor class type. - /// - AudioVideoMicrophone = 0x10, - /// - /// The loudspeaker audio/video minor class type. - /// - AudioVideoLoudspeaker = 0x14, - /// - /// The headphones audio/video minor class type. - /// - AudioVideoHeadphones = 0x18, - /// - /// The portable audio audio/video minor class type. - /// - AudioVideoPortableAudio = 0x1C, - /// - /// The car audio audio/video minor class type. - /// - AudioVideoCarAudio = 0x20, - /// - /// The SetTopbox audio/video minor class type. - /// - AudioVideoSetTopBox = 0x24, - /// - /// The Hi-Fi audio/video minor class type. - /// - AudioVideoHifiAudioDevice = 0x28, - /// - /// The VCR audio/video minor class type. - /// - AudioVideoVcr = 0x2C, - /// - /// The video camera audio/video minor class type. - /// - AudioVideoVideoCamera = 0x30, - /// - /// Camcorder audio/video minor class type. - /// - AudioVideoCamcorder = 0x34, - /// - /// The video monitor audio/video minor class type. - /// - AudioVideoVideoMonitor = 0x38, - /// - /// The video display and loudspeaker audio/video minor class type. - /// - AudioVideoVideoDisplayLoudspeaker = 0x3C, - /// - /// The video conferencing audio/video minor class type. - /// - AudioVideoVideoConferencing = 0x40, - /// - /// The gaming/toy audio/video minor class type. - /// - AudioVideoGamingToy = 0x48, - - /// - /// The uncategorized peripheral minor class type. - /// - PeripheralUncategorized = 0x00, - /// - /// The keyboard peripheral minor class type. - /// - PeripheralKeyBoard = 0x40, - /// - /// The pointing device peripheral minor class type. - /// - PeripheralPointingDevice = 0x80, - /// - /// The combo keyboard peripheral minor class type. - /// - PeripheralComboKeyboardPointingDevice = 0xC0, - /// - /// The joystick peripheral minor class type. - /// - PeripheralJoystick = 0x04, - /// - /// The game pad peripheral minor class type. - /// - PeripheralGamePad = 0x08, - /// - /// The remote control peripheral minor class type. - /// - PeripheralRemoteControl = 0x0C, - /// - /// The sensing device peripheral minor class type. - /// - PeripheralSensingDevice = 0x10, - /// - /// The digitizer peripheral minor class type. - /// - PeripheralDigitizerTablet = 0x14, - /// - /// The card reader peripheral minor class type. - /// - PeripheralCardReader = 0x18, - /// - /// The digital pen peripheral minor class type. - /// - PeripheralDigitalPen = 0x1C, - /// - /// The handheld scanner peripheral minor class type. - /// - PeripheralHandheldScanner = 0x20, - /// - /// The handheld gestural input computer minor class type. - /// - PeripheralHandheldGesturalInputDevice = 0x24, - - /// - /// The display imaging minor class type. - /// - ImagingDisplay = 0x10, - /// - /// The camera imaging minor class type. - /// - ImagingCamera = 0x20, - /// - /// The scanner imaging minor class type. - /// - ImagingScanner = 0x40, - /// - /// The printer imaging minor class type. - /// - ImagingPrinter = 0x80, - - /// - /// The wrist watch wearable minor class type. - /// - WearableWristWatch = 0x04, - /// - /// The pager wearable minor class type. - /// - WearablePager = 0x08, - /// - /// The jacket wearable minor class type. - /// - WearableJacket = 0x0C, - /// - /// The helmet wearable minor class type. - /// - WearableHelmet = 0x10, - /// - /// The glasses wearable minor class type. - /// - WearableGlasses = 0x14, - - /// - /// The robot toy minor class type. - /// - ToyRobot = 0x04, - /// - /// The vehicle toy minor class type. - /// - ToyVehicle = 0x08, - /// - /// The doll toy minor class type. - /// - ToyDollAction = 0x0C, - /// - /// The controller toy minor class type. - /// - ToyController = 0x10, - /// - /// The game toy minor class type. - /// - ToyGame = 0x14, - - /// - /// The uncategorized health minor class type. - /// - HealthUncategorized = 0x00, - /// - /// The BP monitor health minor class type. - /// - HealthBloodPressureMonitor = 0x04, - /// - /// The thermometer health minor class type. - /// - HealthThermometer = 0x08, - /// - /// The scale health minor class type. - /// - HealthWeighingScale = 0x0C, - /// - /// The glucose meter health minor class type. - /// - HealthGlucoseMeter= 0x10, - /// - /// The pulse oximeter health minor class type. - /// - HealthPulseOximeter = 0x14, - /// - /// The heart/pulse rate monitor health minor class type. - /// - HealthHeartPulseRateMonitor = 0x18, - /// - /// The display health minor class type. - /// - HealthDataDisplay = 0x1C, - /// - /// The step counter health minor class type. - /// - HealthStepCounter = 0x20, - /// - /// The body composition analyzer health minor class type. - /// - HealthBodyCompositionAnalyzer = 0x24, - /// - /// The peak flow monitor health minor class type. - /// - HealthPeakFlowMonitor = 0x28, - /// - /// The medication monitor health minor class type. - /// - HealthMedicationMonitor = 0x2C, - /// - /// The knee prosthesis health minor class type. - /// - HealthKneeProsthesis = 0x30, - /// - /// The ankle prosthesis health minor class type. - /// - HealthAnkleProsthesis = 0x34 - } - - /// - /// Enumeration for the Bluetooth device discovery states. - /// - public enum BluetoothDeviceDiscoveryState - { - /// - /// The device discovery is started. - /// - Started = 0, - /// - /// The device discovery is finished. - /// - Finished, - /// - /// The remote device is found. - /// - Found - } - - /// - /// Enumeration for the Bluetooth appearance types. - /// - public enum BluetoothAppearanceType - { - /// - /// Unknown. - /// - Unknown = 0, - /// - /// Generic phone. - /// - GenericPhone = 1, - /// - /// Generic computer. - /// - GenericComputer = 2, - /// - /// Generic watch. - /// - GenericWatch = 3 - } - - /// - /// Enumeration for the Bluetooth audio profile types. - /// - public enum BluetoothAudioProfileType - { - /// - /// All supported profiles of audio. - /// - All = 0, - /// - /// The Headset and Hands-Free profile. - /// - HspHfp, - /// - /// The Advanced Audio Distribution profile. - /// - AdvancedAudioDistribution, - /// - /// The Audio Gateway profile. - /// - AudioGateway, - /// - /// The Advanced Audio Distribution profile sink role. - /// - AdvancedAudioDistributionSink - } - - /// - /// Enumeration for the Bluetooth service class types. - /// - public enum BluetoothServiceClassType - { - /// - /// No service class. - /// - None = 0, - /// - /// The RES service class. - /// - Res = 0x00000001, - /// - /// The SPP service class. - /// - Spp = 0x00000002, - /// - /// The DUN service class. - /// - Dun = 0x00000004, - /// - /// The FAX service class. - /// - Fax = 0x00000008, - /// - /// The LAP service class. - /// - Lap = 0x00000010, - /// - /// The HSP service class. - /// - Hsp = 0x00000020, - /// - /// The HFPservice class. - /// - Hfp = 0x00000040, - /// - /// The OPP service class. - /// - Opp = 0x00000080, - /// - /// The FTP service class. - /// - Ftp = 0x00000100, - /// - /// The CTP service class. - /// - Ctp = 0x00000200, - /// - /// The ICP service class. - /// - Icp = 0x00000400, - /// - /// The Sync service class. - /// - Sync = 0x00000800, - /// - /// The BPP service class. - /// - Bpp = 0x00001000, - /// - /// The BIP service class. - /// - Bip = 0x00002000, - /// - /// The PANU service class. - /// - Panu = 0x00004000, - /// - /// The NAP service class. - /// - Nap = 0x00008000, - /// - /// The GN service class. - /// - Gn = 0x00010000, - /// - /// The SAP service class. - /// - Sap = 0x00020000, - /// - /// The A2DP service class. - /// - A2dp = 0x00040000, - /// - /// The AVRCP service class. - /// - Avrcp = 0x00080000, - /// - /// The PBAP service class. - /// - Pbap = 0x00100000, - /// - /// The HID service class. - /// - Hid = 0x00200000, - /// - /// The A2DP Source service class. - /// - A2dpSource = 0x00400000, - /// - /// All service class. - /// - All = 0x00FFFFFF, - /// - /// The Max service class. - /// - Max - } - - /// - /// Enumeration for the Bluetooth profile types. - /// - public enum BluetoothProfileType - { - /// - /// The RFCOMM profile. - /// - Rfcomm = 0, - /// - /// The Advanced Audio Distribution Profile Source role. - /// - AdvancedAudioDistribution, - /// - /// The Headset profile. - /// - Headset, - /// - /// The Human Interface Device profile. - /// - HumanInterfaceDevice, - /// - /// The Network Access Point profile. - /// - NetworkAccessPoint, - /// - /// The Audio Gateway profile. - /// - AudioGateway, - /// - /// The Generic Attribute profile. - /// - GenericAttribute, - /// - /// The NAP Server profile. - /// - NapServer, - /// - /// The advanced Audio Distribution profile sink role. - /// - AdvancedAudioDistributionSink - } - - /// - /// Enumeration for the Bluetooth authorization types. - /// - public enum BluetoothAuthorizationType - { - /// - /// The authorized type. - /// - Authorized = 0, - /// - /// The unauthorized type. - /// - Unauthorized - } - - /// - /// Enumeration for the Bluetooth connection link types. - /// - public enum BluetoothConnectionLinkType - { - /// - /// The BR/EDR link. - /// - BrEdr = 0, - /// - /// The LE link. - /// - Le, - /// - /// The default connection type. - /// - Default - } - - /// - /// Enumeration for the Bluetooth disconnect reason. - /// - public enum BluetoothDisconnectReason - { - /// - /// The disconnected by unknown reason. - /// - Unknown = 0, - /// - /// The disconnected by timeout. - /// - Timeout, - /// - /// The disconnected by local host. - /// - LocalHost, - /// - /// The disconnected by remote. - /// - Remote - } - - /// - /// Enumeration for the connected Bluetooth device event roles. - /// - public enum BluetoothSocketRole - { - /// - /// Unknown role. - /// - Unknown, - /// - /// The server role. - /// - Server, - /// - /// The client role. - /// - Client - } - - /// - /// Enumeration for the Bluetooth socket connection states. - /// - public enum BluetoothSocketState - { - /// - /// The RFCOMM is connected. - /// - Connected, - /// - /// The RFCOMM is disconnected. - /// - Disconnected - } - - /// - /// Enumeration for the equalizer states. - /// - public enum EqualizerState - { - /// - /// Equalizer Off. - /// - Off = 0, - /// - /// Equalizer On. - /// - On - } - - /// - /// Enumeration for the repeat modes. - /// - public enum RepeatMode - { - /// - /// Repeat off. - /// - Off = 0, - /// - /// Single track repeat. - /// - SingleTrack, - /// - /// All track repeat. - /// - AllTrack, - /// - /// Group repeat. - /// - Group - } - - /// - /// Enumeration for the shuffle modes. - /// - public enum ShuffleMode - { - /// - /// Shuffle off. - /// - Off = 0, - /// - /// All tracks shuffle. - /// - AllTrack, - /// - /// Group shuffle. - /// - Group - } - - /// - /// Enumeration for the scan modes. - /// - public enum ScanMode - { - /// - /// Scan off. - /// - Off = 0, - /// - /// All tracks scan. - /// - AllTrack, - /// - /// Group scan. - /// - Group - } - - /// - /// Enumeration for the player states. - /// - public enum PlayerState - { - /// - /// The stopped state. - /// - Stopped = 0, - /// - /// The playing state. - /// - Playing, - /// - /// The paused state. - /// - Paused, - /// - /// The seek forward state. - /// - SeekForward, - /// - /// The seek rewind state. - /// - SeekRewind - } - - /// - /// Enumeration for the Bluetooth LE device address types. - /// - public enum BluetoothLeDeviceAddressType - { - /// - /// The Buetooth LE public address. - /// - BluetoothLePublicAddress, - /// - /// The Bluetooth LE private address. - /// - BluetoothLePrivateAddress - } - - /// - /// Enumeration for the Bluetooth LePacket types. - /// - public enum BluetoothLePacketType - { - /// - /// The Bluetooth LE advertising packet. - /// - BluetoothLeAdvertisingPacket, - /// - /// The Bluetooth LE scan response packet. - /// - BluetoothLeScanResponsePacket - } - - /// - /// Enumeration for the Bluetooth LE data types. - /// - public enum BluetoothLeDataType - { - /// - /// The Bluetooth LE packet data list 16 bit service uuid. - /// - BluetoothLePacketDataList16BitServiceUuid, - /// - /// The Bluetooth LE packet manufacturer data. - /// - BluetoothLePacketManufacturerData - } - - /// - /// Enumeration for the Bluetooth LE advertising mode types. - /// - public enum BluetoothLeAdvertisingMode - { - /// - /// The Bluetooth LE advertising balanced mode. - /// - BluetoothLeAdvertisingBalancedMode, - /// - /// The Bluetooth LE advertising low latency mode. - /// - BluetoothLeAdvertisingLowLatencyMode, - /// - /// The Bluetooth LE advertising low energy mode. - /// - BluetoothLeAdvertisingLowEnergyMode - } - - /// - /// Enumeration for the Bluetooth LE advertising mode type. - /// - public enum BluetoothLeAdvertisingState - { - /// - /// The Bluetooth LE advertising stopped. - /// - BluetoothLeAdvertisingStopped, - /// - /// The Bluetooth LE advertising started. - /// - BluetoothLeAdvertisingStarted - } - - /// - /// Enumeration for the integer type for GATT handle's values. - /// - public enum IntDataType - { - /// - /// The 8-bit signed integer type. - /// - SignedInt8, - /// - /// The 16-bit signed integer type. - /// - SignedInt16, - /// - /// The 32-bit signed integer type. - /// - SignedInt32, - /// - /// The 8-bit unsigned integer type. - /// - UnsignedInt8, - /// - /// The 16-bit unsigned integer type. - /// - UnsignedInt16, - /// - /// The 32-bit unsigned integer type. - /// - UnsignedInt32 - } - - /// - /// Enumerations of the float type for GATT handle's values. - /// - public enum FloatDataType - { - /// - /// The 32-bit float type. - /// - Float, - /// - /// The 16-bit float type. - /// - SFloat, - } - - /// - /// Enumeration for the GATT handle's types. - /// - public enum GattHandleType - { - /// - /// The GATT service type. - /// - Service, - /// - /// The GATT characteristic type. - /// - Characteristic, - /// - /// The GATT descriptor type. - /// - Descriptor - } - - /// - /// Enumeration for the service types. - /// - public enum BluetoothGattServiceType - { - /// - /// The GATT primary service type. - /// - Primary, - /// - /// The GATT secondary service type. - /// - Secondary - } - - /// - /// Enumeration for the characteristic's property. - /// - [Flags] - public enum BluetoothGattProperty - { - /// - /// The broadcast property. - /// - Broadcast = 1, - /// - /// The read property. - /// - Read = 2, - /// - /// The write without response property. - /// - WriteWithoutResponse = 4, - /// - /// The write property. - /// - Write = 8, - /// - /// The notify property. - /// - Notify = 16, - /// - /// The indicate property. - /// - Indicate = 32, - /// - /// The authenticated signed writes property. - /// - AuthenticatedSignedWrites = 64, - /// - /// The extended properties. - /// - ExtendedProperties = 128, - } - - /// - /// Enumeration for the Bluetooth GATT permission types. - /// - [Flags] - public enum BluetoothGattPermission - { - /// - /// Read permission. - /// - Read = 1, - /// - /// Write permission. - /// - Write = 2, - } - - /// - /// Enumeration for the write types. - /// - public enum BluetoothGattWriteType - { - /// - /// The write without response. - /// - NoResponse, - /// - /// The write with response. - /// - WriteWithResponse - } - - /// - /// Enumeration for the remote device request types for attributes. - /// - public enum BluetoothGattRequestType - { - /// - /// Read requested. - /// - Read = 0, - /// - /// Write requested. - /// - Write = 1, - } -} diff --git a/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothError.cs b/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothError.cs deleted file mode 100644 index 253d50b14..000000000 --- a/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothError.cs +++ /dev/null @@ -1,110 +0,0 @@ -/* - * 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.Network.Bluetooth -{ - /// - /// A class which is used to Throw the Bluetooth Error exceptions. - /// - static internal class BluetoothErrorFactory - { - /// - /// Exceptions for Bluetooth Errors. - /// - /// Thrown when the Bluetooth Error happens. - static internal void ThrowBluetoothException(int exception) - { - BluetoothError error = (BluetoothError)exception; - switch (error) - { - case BluetoothError.InvalidParameter: - throw new InvalidOperationException("Invalid parameter"); - - case BluetoothError.Cancelled: - throw new InvalidOperationException("Operation cancelled"); - - case BluetoothError.AlreadyDone: - throw new InvalidOperationException("Operation already done"); - - case BluetoothError.TimedOut: - throw new InvalidOperationException("Timeout error"); - - case BluetoothError.AuthFailed: - throw new InvalidOperationException("Authentication failed"); - - case BluetoothError.AuthRejected: - throw new InvalidOperationException("Authentication rejected"); - - case BluetoothError.NoData: - throw new InvalidOperationException("No data available"); - - case BluetoothError.NotEnabled: - throw new InvalidOperationException("Local adapter not enabled"); - - case BluetoothError.NotInitialized: - throw new InvalidOperationException("Local adapter not initialized"); - - case BluetoothError.NowInProgress: - throw new InvalidOperationException("Operation now in progress"); - - case BluetoothError.NotInProgress: - throw new InvalidOperationException("Operation not in progress"); - - case BluetoothError.NotSupported: - throw new NotSupportedException("Bluetooth is not supported"); - - case BluetoothError.OperationFailed: - throw new InvalidOperationException("Operation failed"); - - case BluetoothError.OutOfMemory: - throw new InvalidOperationException("Out of memory"); - - case BluetoothError.PermissionDenied: - throw new InvalidOperationException("Permission denied"); - - case BluetoothError.QuotaExceeded: - throw new InvalidOperationException("Quota exceeded"); - - case BluetoothError.RemoteDeviceNotBonded: - throw new InvalidOperationException("Remote device not bonded"); - - case BluetoothError.RemoteDeviceNotConnected: - throw new InvalidOperationException("Remote device not connected"); - - case BluetoothError.RemoteDeviceNotFound: - throw new InvalidOperationException("Remote device not found"); - - case BluetoothError.ResourceBusy: - throw new InvalidOperationException("Device or resource busy"); - - case BluetoothError.ResourceUnavailable: - throw new InvalidOperationException("Resource temporarily unavailable"); - - case BluetoothError.ServiceNotFound: - throw new InvalidOperationException("Service Not Found"); - - case BluetoothError.ServiceSearchFailed: - throw new InvalidOperationException("Service search failed"); - - default: - throw new InvalidOperationException("Unknown exception"); - } - } - } -} - diff --git a/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothEventArgs.cs b/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothEventArgs.cs deleted file mode 100644 index c1a979ba5..000000000 --- a/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothEventArgs.cs +++ /dev/null @@ -1,1294 +0,0 @@ -/* - * 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.Collections.Generic; - -namespace Tizen.Network.Bluetooth -{ - /// - /// An extended EventArgs class contains the changed Bluetooth state. - /// - public class StateChangedEventArgs : EventArgs - { - private BluetoothState _type; - private BluetoothError _result; - - internal StateChangedEventArgs(BluetoothError result, BluetoothState type) - { - _type = type; - _result = result; - } - - /// - /// The state of Bluetooth. - /// - public BluetoothState BTState - { - get - { - return _type; - } - } - - /// - /// The BluetoothError result. - /// - public BluetoothError Result - { - get - { - return _result; - } - } - } - - /// - /// An extended EventArgs class contains the changed Bluetooth name. - /// - public class NameChangedEventArgs : EventArgs - { - private string _name; - - internal NameChangedEventArgs(string name) - { - _name = name; - } - - /// - /// The name of the device. - /// - public string DeviceName - { - get - { - return _name; - } - } - } - - /// - /// An extended EventArgs class contains the changed Bluetooth visibility mode. - /// - public class VisibilityModeChangedEventArgs : EventArgs - { - private VisibilityMode _mode; - private BluetoothError _result; - - internal VisibilityModeChangedEventArgs(BluetoothError result, VisibilityMode mode) - { - _result = result; - _mode = mode; - } - - /// - /// The visibility mode. - /// - public VisibilityMode Visibility - { - get - { - return _mode; - } - } - - /// - /// The BluetoothError result. - /// - public BluetoothError Result - { - get - { - return _result; - } - } - } - - /// - /// An extended EventArgs class contains the duration until the visibility mode is changed from TimeLimitedDiscoverable to NonDiscoverable. - /// - public class VisibilityDurationChangedEventArgs : EventArgs - { - private int _duration; - - internal VisibilityDurationChangedEventArgs(int duration) - { - _duration = duration; - } - - /// - /// The duration. - /// - public int Duration - { - get - { - return _duration; - } - } - } - - /// - /// An extended EventArgs class contains the changed Bluetooth device discovery state and the discovered device information. - /// - public class DiscoveryStateChangedEventArgs : EventArgs - { - private BluetoothError _result; - private BluetoothDeviceDiscoveryState _state; - private BluetoothDevice _device; - - internal DiscoveryStateChangedEventArgs(BluetoothError result, BluetoothDeviceDiscoveryState state) - { - _result = result; - _state = state; - } - - internal DiscoveryStateChangedEventArgs(BluetoothError result, BluetoothDeviceDiscoveryState state, BluetoothDevice device) - { - _result = result; - _state = state; - _device = device; - } - - /// - /// The BluetoothError result. - /// - public BluetoothError Result - { - get - { - return _result; - } - } - - /// - /// The state of the discovery. - /// - public BluetoothDeviceDiscoveryState DiscoveryState - { - get - { - return _state; - } - } - - /// - /// The remote device found. - /// - public BluetoothDevice DeviceFound - { - get - { - return _device; - } - } - } - - /// - /// An extended EventArgs class contains the bonded device information. - /// - public class BondCreatedEventArgs : EventArgs - { - private BluetoothError _result; - private BluetoothDevice _device; - - internal BondCreatedEventArgs(BluetoothError result, BluetoothDevice device) - { - _result = result; - _device = device; - } - - /// - /// The BluetoothError result. - /// - public BluetoothError Result - { - get - { - return _result; - } - } - - /// - /// The remote device. - /// - public BluetoothDevice Device - { - get - { - return _device; - } - } - } - - /// - /// An extended EventArgs class contains the address of the remote Bluetooth device to destroy bond with. - /// - public class BondDestroyedEventArgs : EventArgs - { - private BluetoothError _result; - private string _address; - - internal BondDestroyedEventArgs(BluetoothError result, string address) - { - _result = result; - _address = address; - } - - /// - /// The BluetoothError result. - /// - public BluetoothError Result - { - get - { - return _result; - } - } - - /// - /// The remote device address. - /// - /// The device address. - public string DeviceAddress - { - get - { - return _address; - } - } - } - - /// - /// An extended EventArgs class contains the authorization state and the address of the remote Bluetooth device. - /// - public class AuthorizationChangedEventArgs : EventArgs - { - private BluetoothAuthorizationType _authType; - private string _address; - - internal AuthorizationChangedEventArgs(BluetoothAuthorizationType authType, string address) - { - _authType = authType; - _address = address; - } - - /// - /// The authorization. - /// - public BluetoothAuthorizationType Authorization - { - get - { - return _authType; - } - } - - /// - /// The device address. - /// - public string DeviceAddress - { - get - { - return _address; - } - } - - } - - /// - /// An extended EventArgs class contains the service lists found on the remote Bluetooth device. - /// - public class ServiceSearchedEventArgs : EventArgs - { - private BluetoothDeviceSdpData _sdpData; - private BluetoothError _result; - - internal ServiceSearchedEventArgs(BluetoothError result, BluetoothDeviceSdpData sdpData) - { - _result = result; - _sdpData = sdpData; - } - - /// - /// The BluetoothError result. - /// - public BluetoothError Result - { - get - { - return _result; - } - } - /// - /// The sdp data. - /// - public BluetoothDeviceSdpData SdpData - { - get - { - return _sdpData; - } - } - } - - /// - /// An extended EventArgs class contains the connection state and the connection information of the remote device. - /// - public class DeviceConnectionStateChangedEventArgs : EventArgs - { - private bool _isConnected; - private BluetoothDeviceConnectionData _connectionData; - - internal DeviceConnectionStateChangedEventArgs(bool isConnected, BluetoothDeviceConnectionData connectionData) - { - _isConnected = isConnected; - _connectionData = connectionData; - } - - /// - /// A value indicating whether the device is connected. - /// - public bool IsConnected - { - get - { - return _isConnected; - } - } - - /// - /// The device connection data. - /// - public BluetoothDeviceConnectionData ConnectionData - { - get - { - return _connectionData; - } - } - } - - /// - /// An extended EventArgs class contains the data received information. - /// - public class SocketDataReceivedEventArgs : EventArgs - { - private SocketData _data; - - internal SocketDataReceivedEventArgs(SocketData data) - { - _data = data; - } - - /// - /// The socket data. - /// - public SocketData Data - { - get - { - return _data; - } - } - } - - /// - /// An extended EventArgs class contains the changed connection state. - /// - public class SocketConnectionStateChangedEventArgs : EventArgs - { - private BluetoothError _result; - private BluetoothSocketState _state; - private SocketConnection _connection; - - internal SocketConnectionStateChangedEventArgs(BluetoothError result, BluetoothSocketState state, SocketConnection connection) - { - _result = result; - _state = state; - _connection = connection; - } - - /// - /// The BluetoothError result. - /// - public BluetoothError Result - { - get - { - return _result; - } - } - - /// - /// The socket state. - /// - public BluetoothSocketState State - { - get - { - return _state; - } - } - - /// - /// The socket connection. - /// - public SocketConnection Connection - { - get - { - return _connection; - } - } - } - - public class AcceptStateChangedEventArgs : EventArgs - { - private BluetoothError _result; - private BluetoothSocketState _state; - private SocketConnection _connection; - private IBluetoothServerSocket _server; - - internal AcceptStateChangedEventArgs(BluetoothError result, BluetoothSocketState state, SocketConnection connection, BluetoothSocket server) - { - _result = result; - _state = state; - _connection = connection; - _server = (IBluetoothServerSocket)server; - } - - /// - /// The BluetoothError result. - /// - public BluetoothError Result - { - get - { - return _result; - } - } - - /// - /// The socket state. - /// - public BluetoothSocketState State - { - get - { - return _state; - } - } - - /// - /// The socket connection. - /// - public SocketConnection Connection - { - get - { - return _connection; - } - } - - /// - /// The server socket instance. - /// - public IBluetoothServerSocket Server - { - get - { - return _server; - } - } - } - - /// - /// An extended EventArgs class contains the connection state, remote address, and the type of audio profile. - /// - public class AudioConnectionStateChangedEventArgs : EventArgs - { - private int _result; - private bool _isConnected; - private string _address; - private BluetoothAudioProfileType _type; - - internal AudioConnectionStateChangedEventArgs(int result, bool isConnected, string address, BluetoothAudioProfileType type) - { - _result = result; - _type = type; - _isConnected = isConnected; - _address = address; - } - - /// - /// The result. - /// - public int Result - { - get - { - return _result; - } - } - - /// - /// A value indicating whether this instance is connected. - /// - public bool IsConnected - { - get - { - return _isConnected; - } - } - - /// - /// The address. - /// - public string Address - { - get - { - return _address; - } - } - - /// - /// The type of the audio profile. - /// - public BluetoothAudioProfileType ProfileType - { - get - { - return _type; - } - } - } - - /// - /// An extended EventArgs class contains the connection state and the address of the remote Bluetooth device. - /// - public class HidConnectionStateChangedEventArgs : EventArgs - { - private int _result; - private bool _isConnected; - private string _address; - - internal HidConnectionStateChangedEventArgs(int result, bool isConnected, string address) - { - _result = result; - _isConnected = isConnected; - _address = address; - } - - /// - /// The result. - /// - public int Result - { - get - { - return _result; - } - } - - /// - /// A value indicating whether this instance is connected. - /// - public bool IsConnected - { - get - { - return _isConnected; - } - } - - /// - /// The address. - /// - public string Address - { - get - { - return _address; - } - } - } - - /// - /// An extended EventArgs class contains the changed equalizer state. - /// - public class EqualizerStateChangedEventArgs : EventArgs - { - private EqualizerState _state; - - internal EqualizerStateChangedEventArgs(EqualizerState state) - { - _state = state; - } - - /// - /// The state of the equalizer. - /// - public EqualizerState State - { - get - { - return _state; - } - } - } - - /// - /// An extended EventArgs class contains the changed repeat mode. - /// - public class RepeatModeChangedEventArgs : EventArgs - { - private RepeatMode _mode; - - internal RepeatModeChangedEventArgs(RepeatMode mode) - { - _mode = mode; - } - - /// - /// The repeat mode. - /// - public RepeatMode Mode - { - get - { - return _mode; - } - } - } - - /// - /// An extended EventArgs class contains the changed shuffle mode. - /// - public class ShuffleModeChangedeventArgs : EventArgs - { - private ShuffleMode _mode; - - internal ShuffleModeChangedeventArgs(ShuffleMode mode) - { - _mode = mode; - } - - /// - /// The shuffle mode. - /// - public ShuffleMode Mode - { - get - { - return _mode; - } - } - } - - /// - /// An extended EventArgs class contains the changed scan mode. - /// - public class ScanModeChangedEventArgs : EventArgs - { - private ScanMode _mode; - - internal ScanModeChangedEventArgs(ScanMode mode) - { - _mode = mode; - } - - /// - /// The scan mode. - /// - public ScanMode Mode - { - get - { - return _mode; - } - } - } - - /// - /// An extended EventArgs class contains the connection state and the remote device address. - /// - public class TargetConnectionStateChangedEventArgs : EventArgs - { - private bool _isConnected; - private string _address; - - internal TargetConnectionStateChangedEventArgs(bool isConnected, string address) - { - _isConnected = isConnected; - _address = address; - } - - /// - /// A value indicating whether this instance is connected. - /// - public bool IsConnected - { - get - { - return _isConnected; - } - } - - /// - /// The address. - /// - public string Address - { - get - { - return _address; - } - } - } - - /// - /// An extended EventArgs class contains the changed Bluetooth LE advertising state changed information. - /// - public class AdvertisingStateChangedEventArgs : EventArgs - { - private BluetoothLeAdvertisingState _state; - private int _result; - private IntPtr _advertiserHandle; - - //TODO : Add conversion code from IntPtr to BluetoothLeAdvertiser class later - internal AdvertisingStateChangedEventArgs(int result, IntPtr advertiserHandle, - BluetoothLeAdvertisingState state) - { - _result = result; - _advertiserHandle = advertiserHandle; - _state = state; - } - - /// - /// The result. - /// - public int Result - { - get - { - return _result; - } - } - - /// - /// The advertiser handle. - /// - public IntPtr AdvertiserHandle - { - get - { - return _advertiserHandle; - } - } - - /// - /// The LE advertising state. - /// - public BluetoothLeAdvertisingState State - { - get - { - return _state; - } - } - } - - /// - /// An extended EventArgs class contains the changed Bluetooth LE scan result information. - /// - public class AdapterLeScanResultChangedEventArgs : EventArgs - { - private BluetoothLeDevice _deviceData; - private BluetoothError _result; - - internal AdapterLeScanResultChangedEventArgs(BluetoothError result, BluetoothLeDevice deviceData) - { - _deviceData = deviceData; - _result = result; - } - - /// - /// The result. - /// - public BluetoothError Result - { - get - { - return _result; - } - } - - /// - /// The LE device data. - /// - public BluetoothLeDevice DeviceData - { - get - { - return _deviceData; - } - } - } - - /// - /// An extended EventArgs class contains the changed Bluetooth LE GATT connection state. - /// - public class GattConnectionStateChangedEventArgs : EventArgs - { - private bool _isConnected; - private int _result; - private string _remoteAddress; - - internal GattConnectionStateChangedEventArgs(int result, bool connected, string remoteAddress) - { - _isConnected = connected; - _result = result; - _remoteAddress = remoteAddress; - } - - /// - /// The result. - /// - public int Result - { - get - { - return _result; - } - } - - /// - /// A value indicating whether this instance is connected. - /// - public bool IsConnected - { - get - { - return _isConnected; - } - } - - /// - /// The remote address. - /// - public string RemoteAddress - { - get - { - return _remoteAddress; - } - } - } - - /// - /// An extended EventArgs class contains the changed attribute value. - /// - public class ValueChangedEventArgs : EventArgs - { - internal ValueChangedEventArgs(byte[] value) - { - Value = value; - } - - /// - /// The attribute value. - /// - public byte[] Value { get; } - } - - /// - /// An extended EventArgs class contains the read value request data. - /// - public class ReadRequestedEventArgs : EventArgs - { - internal ReadRequestedEventArgs(BluetoothGattServer server, string clientAddress, int requestId, int offset) - { - Server = server; - ClientAddress = clientAddress; - RequestId = requestId; - Offset = offset; - } - - /// - /// The GATT server instance. - /// - public BluetoothGattServer Server { get; } - /// - /// The client address. - /// - public string ClientAddress { get; } - /// - /// The request identifier. - /// - public int RequestId { get; } - /// - /// The offset. - /// - public int Offset { get; } - } - - /// - /// An extended EventArgs class contains the read value request data. - /// - public class WriteRequestedEventArgs : EventArgs - { - internal WriteRequestedEventArgs(BluetoothGattServer server, string clientAddress, int requestId, byte[] value, int offset, bool response_needed) - { - Server = server; - ClientAddress = clientAddress; - RequestId = requestId; - Value = value; - Offset = offset; - Response_needed = response_needed; - } - - /// - /// The GATT server instance. - /// - public BluetoothGattServer Server { get; } - /// - /// The client address. - /// - public string ClientAddress { get; } - /// - /// The request identifier. - /// - public int RequestId { get; } - /// - /// The read value. - /// - public byte[] Value { get; } - /// - /// The offset. - /// - public int Offset { get; } - /// - /// Indicates whether a response is required by the remote device. - /// - public bool Response_needed { get; } - } - - /// - /// An extended EventArgs class contains the client preference to enable or disable the Notification/Indication. - /// - public class NotificationStateChangedEventArg : EventArgs - { - internal NotificationStateChangedEventArg(BluetoothGattServer server, bool value) - { - Server = server; - Value = value; - } - - /// - /// The GATT server instance. - /// - public BluetoothGattServer Server { get; } - /// - /// A value indicating whether the notification is enabled. - /// - public bool Value { get; } - } - - /// - /// An extended EventArgs class contains the read value request data. - /// - public class NotificationSentEventArg : EventArgs - { - internal NotificationSentEventArg(BluetoothGattServer server, string clientAddress, int result, bool completed) - { - Result = result; - ClientAddress = clientAddress; - Server = server; - Completed = completed; - } - - /// - /// The GATT server instance. - /// - public BluetoothGattServer Server { get; } - /// - /// The client address. - /// - public string ClientAddress { get; } - /// - /// The result. - /// - public int Result { get; } - /// - /// Gets a value indicating whether the notification sent is completed. - /// - public bool Completed { get; } - } - - /// - /// An extended EventArgs class which contains the connection state and address of the remote Bluetooth device. - /// - public class ConnectionRequestedEventArgs : EventArgs - { - private string _address; - - internal ConnectionRequestedEventArgs(string address) - { - _address = address; - } - - /// - /// The address. - /// - public string Address - { - get - { - return _address; - } - } - } - - /// - /// An extended EventArgs class which contains the file transfer progress state, file transfer progress by percent. - /// - public class TransferProgressEventArgs : EventArgs - { - private string _file; - private long _size; - private int _percent; - - internal TransferProgressEventArgs(string file, long size, int percent) - { - _file = file; - _size = size; - _percent = percent; - } - - /// - /// The File name. - /// - public string File - { - get - { - return _file; - } - } - - /// - /// The File size. - /// - public long Size - { - get - { - return _size; - } - } - - /// - /// The File transfer percent. - /// - public int Percent - { - get - { - return _percent; - } - } - } - - /// - /// An extended EventArgs class which contains the file transfer finished state and file state. - /// - public class TransferFinishedEventArgs : EventArgs - { - private string _file; - private long _size; - private int _result; - - internal TransferFinishedEventArgs(int result, string file, long size) - { - _file = file; - _size = size; - _result = result; - } - - /// - /// The File name. - /// - public string File - { - get - { - return _file; - } - } - - /// - /// The File size. - /// - public long Size - { - get - { - return _size; - } - } - - /// - /// The return value. - /// - public int Result - { - get - { - return _result; - } - } - } - - /// - /// An extended EventArgs class which contains the Push Request respond state - /// - - public class PushRespondedEventArgs : EventArgs - { - int _result; - string _address; - - internal PushRespondedEventArgs(int result, string address) - { - _address = address; - _result = result; - } - - /// - /// The return value. - /// - public int Result - { - get - { - return _result; - } - } - - /// - /// The address. - /// - public string Address - { - get - { - return _address; - } - } - } - - /// - /// An extended EventArgs class which contains the file push progress state, push progress by percent. - /// - public class PushProgressEventArgs : EventArgs - { - private string _file; - private long _size; - private int _percent; - - internal PushProgressEventArgs(string file, long size, int percent) - { - _file = file; - _size = size; - _percent = percent; - } - - /// - /// The File name. - /// - public string File - { - get - { - return _file; - } - } - - /// - /// The File size. - /// - public long Size - { - get - { - return _size; - } - } - - /// - /// The File transfer percent. - /// - public int Percent - { - get - { - return _percent; - } - } - } - - /// - /// An extended EventArgs class which contains the Push Request respond state - /// - - public class PushFinishedEventArgs : EventArgs - { - int _result; - string _address; - - internal PushFinishedEventArgs(int result, string address) - { - _address = address; - _result = result; - } - - /// - /// The return value. - /// - public int Result - { - get - { - return _result; - } - } - - /// - /// The address. - /// - public string Address - { - get - { - return _address; - } - } - } -} diff --git a/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothGatt.cs b/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothGatt.cs deleted file mode 100644 index 923f99c2f..000000000 --- a/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothGatt.cs +++ /dev/null @@ -1,966 +0,0 @@ -/* - * 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.Collections.Generic; -using System.Runtime.InteropServices; -using System.Text; -using System.Threading.Tasks; - -namespace Tizen.Network.Bluetooth -{ - /// - /// The Bluetooth GATT server. - /// - public class BluetoothGattServer - { - private static BluetoothGattServer _instance; - private BluetoothGattServerImpl _impl; - private BluetoothGattServer() - { - _impl = new BluetoothGattServerImpl(); - } - - /// - /// (event) This event is called when the indication acknowledgement is received for each notified client. - /// - public event EventHandler NotificationSent - { - add - { - _impl._notificationSent += value; - } - remove - { - _impl._notificationSent -= value; - } - } - - /// - /// Creates the Bluetooth GATT server. - /// - /// - /// Thrown when the BT/BTLE is not supported. - /// Thrown when the create GATT server fails. - public static BluetoothGattServer CreateServer() - { - if (_instance == null) - { - BluetoothGattServer server = new BluetoothGattServer(); - if (server.IsValid()) - { - _instance = server; - } - } - return _instance; - } - - /// - /// Registers the server along with the GATT services of the application it is hosting. - /// - /// Thrown when the BT/BTLE is not supported. - /// Thrown when the register server application fails. - public void Start() - { - _impl.Start(); - } - - /// - /// Registers a specified service to this server. - /// - /// The service, which needs to be registered with this server. - /// Thrown when the BT/BTLE is not supported. - /// Thrown when the register service fails. - public void RegisterGattService(BluetoothGattService service) - { - if (service.IsRegistered()) - { - BluetoothErrorFactory.ThrowBluetoothException((int)BluetoothError.InvalidParameter); - } - _impl.RegisterGattService(this, service); - } - - /// - /// Unregisters a specified service from this server. - /// - /// The service, which needs to be unregistered from this server. - /// - /// Once unregistered, the service object will become invalid and should not be used to access sevices or any children attribute's methods/members. - /// - /// Thrown when the BT/BTLE is not supported. - /// Thrown when the unregister service fails. - public void UnregisterGattService(BluetoothGattService service) - { - if (service.GetGattServer() != this) - { - BluetoothErrorFactory.ThrowBluetoothException((int)BluetoothError.InvalidParameter); - } - - _impl.UnregisterGattService(service); - } - - /// - /// Unregisters all services from this server. - /// - /// - /// Once unregistered, servicees will become invalid and should not be used to access sevices or any children attribute's methods/members. - /// - /// Thrown when the BT/BTLE is not supported. - /// Thrown when the unregister all services fail. - public void UnregisterGattServices() - { - _impl.UnregisterAllGattServices(this); - } - - /// - /// Gets service with given UUID that belongs to this server. - /// - /// The UUID for the service to get. - /// The Service with the given UUID if it exists, null otherwise. - public BluetoothGattService GetService(string uuid) - { - return _impl.GetService(this, uuid); - } - - /// - /// Gets the list of services that belongs to this server. - /// - /// The list of services that belongs to this server. - public IEnumerable GetServices() - { - return _impl.GetServices(this); - } - - /// - /// Sends indication for the value change of the characteristic to the remote devices. - /// - /// The characteristic whose the value is changed. - /// The remote device address to send, notify, or indicate and if set to NULL, then notify/indicate all is enabled. - /// Thrown when the BT/BTLE is not enabled - /// or when the remote device is disconnected, or when service is not registered, or when the CCCD is not enabled. - public async Task SendIndicationAsync(BluetoothGattCharacteristic characteristic, string clientAddress) - { - return await _impl.SendIndicationAsync(this, characteristic, clientAddress); - } - - /// - /// Sends the notification for the value change of the characteristic to the remote devices. - /// - /// The characteristic, which has a changed value. - /// The remote device address to send, notify, or indicate and if set to NULL, then notify/indicate all is enabled. - /// Thrown when the BT/BTLE is not enabled - /// or when the remote device is disconnected, or when service is not registered, or when the CCCD is not enabled. - public void SendNotification(BluetoothGattCharacteristic characteristic, string clientAddress) - { - _impl.SendNotification(characteristic, clientAddress); - } - - /// - /// Sends a response to the remote device as a result of a read/write request. - /// - /// The identification of a read/write request. - /// The request type for read/write. - /// The error value in case of failure, 0 for success. - /// The value to be sent. - /// The offset from where the value is read. - /// Thrown when the BT/BTLE is not enabled - /// or when the remote device is disconnected, or the send response procedure fails. - public void SendResponse(int requestId, BluetoothGattRequestType type, int status, byte[] value, int offset) - { - _impl.SendResponse(requestId, (int)type, status, value, offset); - } - - internal bool IsValid() - { - return _impl.GetHandle().IsInvalid == false; - } - } - - /// - /// The Bluetooth GATT client. - /// - public class BluetoothGattClient - { - private BluetoothGattClientImpl _impl; - private string _remoteAddress = string.Empty; - - internal BluetoothGattClient(string remoteAddress) - { - _impl = new BluetoothGattClientImpl(remoteAddress); - _remoteAddress = remoteAddress; - } - - internal static BluetoothGattClient CreateClient(string remoteAddress) - { - BluetoothGattClient client = new BluetoothGattClient(remoteAddress); - return client.Isvalid() ? client : null; - } - - public void DestroyClient() - { - _impl.GetHandle().Dispose(); - } - - /// - /// The address of the remote device. - /// - /// Thrown when the BT/BTLE is not enabled - /// or when the remote device is disconnected. - public string RemoteAddress - { - get - { - if (string.IsNullOrEmpty(_remoteAddress)) - { - _remoteAddress = _impl.GetRemoteAddress(); - } - return _remoteAddress; - } - } - - /// - /// Gets the service with the given UUID that belongs to the remote device. - /// - /// The UUID for the service to get. - /// The service with the given UUID if it exists, null otherwise. - /// Thrown when the BT/BTLE is not enabled - /// or when the remote device is disconnected, or when the get service fails. - public BluetoothGattService GetService(string uuid) - { - return _impl.GetService(this, uuid); - } - - /// - /// Gets list of services that belongs to the remote device. - /// - /// The list of services that belongs to the remote device. - /// Thrown when the BT/BTLE is not enabled - /// or when the remote device is disconnected, or when the get service fails. - public IEnumerable GetServices() - { - return _impl.GetServices(this); - } - - /// - /// Reads the value of a given characteristic from the remote device asynchronously. - /// - /// The characteristic to be read. - /// true on success, false otherwise. - /// Thrown when the BT/BTLE is not enabled - /// or when the remote device is disconnected, or when the read attribute value fails. - public async Task ReadValueAsync(BluetoothGattCharacteristic characteristic) - { - return await _impl.ReadValueAsyncTask(characteristic.GetHandle()); - } - - /// - /// Reads the value of the given descriptor from the remote device asynchronously. - /// - /// The descriptor to be read. - /// true on success, false otherwise. - /// Thrown when the BT/BTLE is not enabled - /// or when the remote device is disconnected, or when the read attribute value fails. - public async Task ReadValueAsync(BluetoothGattDescriptor descriptor) - { - return await _impl.ReadValueAsyncTask(descriptor.GetHandle()); - } - - /// - /// Writes the value of a given characteristic to the remote device asynchronously. - /// - /// The characteristic to be written. - /// true on success, false otherwise. - /// Thrown when the BT/BTLE is not enabled - /// or when the remote device is disconnected or when the write attribute value fails. - public async Task WriteValueAsync(BluetoothGattCharacteristic characteristic) - { - return await _impl.WriteValueAsyncTask(characteristic.GetHandle()); - } - - /// - /// Writes the value of the given descriptor to the remote device asynchronously. - /// - /// The descriptor to be written. - /// true on success, false otherwise. - /// Thrown when the BT/BTLE is not enabled - /// or when the remote device is disconnected, or when the write attribute value fails. - public async Task WriteValueAsync(BluetoothGattDescriptor descriptor) - { - return await _impl.WriteValueAsyncTask(descriptor.GetHandle()); - } - - internal bool Isvalid() - { - return _impl.GetHandle().IsInvalid == false; - } - } - - /// - /// The Bluetooth GATT service. - /// - public class BluetoothGattService - { - private BluetoothGattServiceImpl _impl; - private BluetoothGattClient _parentClient = null; - private BluetoothGattServer _parentServer = null; - private BluetoothGattService _parentService = null; - - /// - /// The constructor. - /// - /// The UUID of the service. - /// The type of service. - /// Thrown when the create GATT service procedure fails. - public BluetoothGattService(string uuid, BluetoothGattServiceType type) - { - Uuid = uuid; - _impl = new BluetoothGattServiceImpl(uuid, type); - } - - internal BluetoothGattService(BluetoothGattServiceImpl impl, string uuid) - { - Uuid = uuid; - _impl = impl; - } - - /// - /// Specification name from the UUID. - /// - public string Uuid { get; } - - /// - /// Adds a characteristic to this service. - /// - /// The characteristic to be added. - /// true on success, false otherwise. - /// Thrown when the add GATT characteristic procedure fails. - public void AddCharacteristic(BluetoothGattCharacteristic characteristic) - { - if (GetGattClient() != null) - { - BluetoothErrorFactory.ThrowBluetoothException((int)BluetoothError.NotSupported); - } - - if (characteristic.GetService() != null) - { - BluetoothErrorFactory.ThrowBluetoothException((int)BluetoothError.InvalidParameter); - } - - _impl.AddCharacteristic(characteristic); - characteristic.SetParent(this); - } - - /// - /// Gets the characteristic with the given UUID that belongs to this service. - /// - /// The UUID for the characteristic to get. - /// The characteristic with a given UUID if it exists, null otherwise. - public BluetoothGattCharacteristic GetCharacteristic(string uuid) - { - return _impl.GetCharacteristic(this, uuid); - } - - /// - /// Gets list of the characteristic that belongs to this service. - /// - /// The list of the characteristic that belongs to this service. - public IEnumerable GetCharacteristics() - { - return _impl.GetCharacteristics(this); - } - - /// - /// Includes a service to this service. - /// - /// The service to be included. - /// true on success, false otherwise - /// Thrown when the add GATT service procedure fails./// - public void AddService(BluetoothGattService service) - { - if (GetGattClient() != null) - { - BluetoothErrorFactory.ThrowBluetoothException((int)BluetoothError.NotSupported); - } - - if (service.IsRegistered()) - { - BluetoothErrorFactory.ThrowBluetoothException((int)BluetoothError.InvalidParameter); - } - - _impl.AddIncludeService(service); - service.SetParent(this); - } - - /// - /// Gets the included service. - /// - /// The UUID for the service to get. - /// The service with a given UUID if it exists, null otherwise. - public BluetoothGattService GetIncludeService(string uuid) - { - return _impl.GetIncludeService(this, uuid); - } - - /// - /// Gets the included service list of this service. - /// - /// The included service list of this service. - public IEnumerable GetIncludeServices() - { - return _impl.GetIncludeServices(this); - } - - /// - /// Gets the server instance which the specified service belongs to. - /// - /// The server instance which the specified service belongs to. - public BluetoothGattServer GetGattServer() - { - return _parentServer; - } - - /// - /// Gets the client instance which the specified service belongs to. - /// - /// The client instance which the specified service belongs to. - public BluetoothGattClient GetGattClient() - { - return _parentClient; - } - - internal BluetoothGattAttributeHandle GetHandle() - { - return _impl.GetHandle(); - } - - internal void SetParent(BluetoothGattService parent) - { - if (!IsRegistered()) - { - _parentService = parent; - _impl.ReleaseHandleOwnership(); - } - } - - internal void SetParent(BluetoothGattClient parent) - { - if (!IsRegistered()) - { - _parentClient = parent; - _impl.ReleaseHandleOwnership(); - } - } - - internal void SetParent(BluetoothGattServer parent) - { - if (!IsRegistered()) - { - _parentServer = parent; - _impl.ReleaseHandleOwnership(); - } - } - - internal void UnregisterService() - { - _parentServer = null; - _parentClient = null; - _parentService = null; - } - - internal bool IsRegistered() - { - return _parentClient != null || _parentServer != null || _parentService != null; - } - } - - /// - /// The Bluetooth GATT characteristic. - /// - public class BluetoothGattCharacteristic : BluetoothGattAttribute - { - private BluetoothGattCharacteristicImpl _impl; - private BluetoothGattService _parent = null; - - private Interop.Bluetooth.BtClientCharacteristicValueChangedCallback _characteristicValueChangedCallback; - private Interop.Bluetooth.BtGattServerNotificationStateChangeCallback _notificationStateChangedCallback; - - private EventHandler _characteristicValueChanged; - internal EventHandler _notificationStateChanged; - - /// - /// The constructor. - /// - /// The UUID of the characterstic.param> - /// Permissions for the characterstic. - /// Properties set for the characterstic. - /// The value associated with the characterstic. - /// throws in case of internal error. - /// Thrown when the create GATT characteristics procedure fails. - public BluetoothGattCharacteristic(string uuid, BluetoothGattPermission permissions, BluetoothGattProperty properties, byte[] value) : base(uuid, permissions) - { - _impl = new BluetoothGattCharacteristicImpl(uuid, permissions, properties, value); - } - - internal BluetoothGattCharacteristic(BluetoothGattCharacteristicImpl impl, string uuid, BluetoothGattPermission permission) : base(uuid, permission) - { - _impl = impl; - } - - /// - /// The CharacteristicValueChanged event is raised when the server notifies for change in this characteristic value. - /// - /// - /// Adding the event handle on characteristic on the server side will not have any effect. - /// - public event EventHandler ValueChanged - { - add - { - if (Client != null) - { - if (_characteristicValueChanged == null) - { - _characteristicValueChangedCallback = (gattHandle, characteristicValue, len, userData) => - { - _characteristicValueChanged?.Invoke(this, new ValueChangedEventArgs(characteristicValue)); - }; - - _impl.SetCharacteristicValueChangedEvent(_characteristicValueChangedCallback); - } - _characteristicValueChanged = value; - } - } - remove - { - if (Client != null) - { - _characteristicValueChanged = null; - if (_characteristicValueChanged == null) - { - _impl.UnsetCharacteristicValueChangedEvent(); - } - - } - } - } - - /// - /// The NotificationStateChanged event is called when the client enables or disables the Notification/Indication for particular characteristics. - /// - /// - /// Adding event handle on the characteristic on the client side will not have any effect. - /// - public event EventHandler NotificationStateChanged - { - add - { - if (Server != null) - { - if (_notificationStateChangedCallback == null) - { - _notificationStateChangedCallback = (notify, serverHandle, characteristicHandle, userData) => - { - _notificationStateChanged?.Invoke(this, new NotificationStateChangedEventArg(Server, notify)); - }; - - _impl.SetNotificationStateChangedEvent(_notificationStateChangedCallback); - } - - _notificationStateChanged = value; - } - } - remove - { - if (Server != null) - { - _notificationStateChanged = null; - // CAPI does not allow unsetting ReadValueRequestedEventCallback. - } - } - } - - /// - /// The property for this characteristic. - /// - public BluetoothGattProperty Properties - { - get - { - return _impl.GetProperties(); - } - set - { - if (Server != null) - { - _impl.SetProperties(value); - } - } - } - - /// - /// The write type to be used for write operations. - /// - public BluetoothGattWriteType WriteType - { - get - { - return _impl.GetWriteType(); - } - set - { - _impl.SetWriteType(value); - } - } - - internal override BluetoothGattClient Client - { - get - { - return _parent?.GetGattClient(); - } - } - - internal override BluetoothGattServer Server - { - get - { - return _parent?.GetGattServer(); - } - } - - internal override BluetoothGattAttributeImpl Impl - { - get - { - return _impl; - } - } - - /// - /// Adds a descriptor to this characteristic. - /// - /// The descriptor to be added. - /// true on success, false otherwise. - /// Thrown when the add GATT descriptor procedure fails. - public void AddDescriptor(BluetoothGattDescriptor descriptor) - { - if (Client != null) - { - BluetoothErrorFactory.ThrowBluetoothException((int)BluetoothError.NotSupported); - } - - if (descriptor.GetCharacteristic() != null) - { - BluetoothErrorFactory.ThrowBluetoothException((int)BluetoothError.InvalidParameter); - } - - _impl.AddDescriptor(descriptor); - descriptor.SetParent(this); - } - - /// - /// Gets the descriptor with the given UUID that belongs to this characteristic. - /// - /// The UUID for the descriptor to get. - /// The descriptor with a given UUID if it exists, null otherwise. - public BluetoothGattDescriptor GetDescriptor(string uuid) - { - return _impl.GetDescriptor(this, uuid); - } - - /// - /// Gets the list of descriptors that belongs to this characteristic. - /// - /// The list of descriptors that belongs to this characteristic. - public IEnumerable GetDescriptors() - { - return _impl.GetDescriptors(this); - } - - /// - /// Gets the service instance, which the specified characterstic belongs to. - /// - /// The characteristic instance, the specified characterstic belongs to. - public BluetoothGattService GetService() - { - return _parent; - } - - internal void SetParent(BluetoothGattService parent) - { - if (_parent == null) - { - _parent = parent; - ReleaseHandleOwnership(); - } - } - } - - /// - /// The Bluetooth GATT descriptor. - /// - public class BluetoothGattDescriptor : BluetoothGattAttribute - { - private BluetoothGattCharacteristic _parent = null; - private BluetoothGattDescriptorImpl _impl; - - /// - /// The constructor. - /// - /// The UUID of the descriptor. - /// Permissions for the descriptor. - /// The value associated with the descriptor. - /// throws in case of internal error. - /// Thrown when the create GATT descriptor procedure fails. - public BluetoothGattDescriptor(string uuid, BluetoothGattPermission permisions, byte[] value) : base (uuid, permisions) - { - _impl = new BluetoothGattDescriptorImpl(uuid, permisions, value); - } - - internal BluetoothGattDescriptor(BluetoothGattDescriptorImpl impl, string uuid, BluetoothGattPermission permission) : base(uuid, permission) - { - _impl = impl; - } - - internal override BluetoothGattClient Client - { - get - { - return _parent?.Client; - } - } - - internal override BluetoothGattServer Server - { - get - { - return _parent?.Server; - } - } - - internal override BluetoothGattAttributeImpl Impl - { - get - { - return _impl; - } - } - - /// - /// Gets the characteristic instance, which the specified descriptor belongs to. - /// - /// The characteristic instance, the specified descriptor belongs to. - public BluetoothGattCharacteristic GetCharacteristic() - { - return _parent; - } - - internal void SetParent(BluetoothGattCharacteristic parent) - { - if (_parent == null) - { - _parent = parent; - ReleaseHandleOwnership(); - } - } - } - - /// - /// The Bluetooth GATT attribute. - /// - public abstract class BluetoothGattAttribute - { - private Interop.Bluetooth.BtGattServerReadValueRequestedCallback _readValueRequestedCallback; - private Interop.Bluetooth.BtGattServerWriteValueRequestedCallback _writeValueRequestedCallback; - - private EventHandler _readValueRequested; - private EventHandler _writeValueRequested; - - public BluetoothGattAttribute(string uuid, BluetoothGattPermission permission) - { - Uuid = uuid; - Permissions = permission; - } - - // Events - - /// - /// This event is called when the client request to read the value of a characteristic or a descriptor. - /// - /// Thrown when the set read value requested callback procedure fails. - public event EventHandler ReadRequested - { - add - { - if (Server == null) return; - if (_readValueRequestedCallback == null) - { - _readValueRequestedCallback = (clientAddress, requestId, serverHandle, gattHandle, offset, userData) => - { - _readValueRequested?.Invoke(this, new ReadRequestedEventArgs(Server, clientAddress, requestId, offset)); - }; - Impl.SetReadValueRequestedEventCallback(_readValueRequestedCallback); - } - _readValueRequested = value; - } - remove - { - if (Server == null) return; - _readValueRequested = null; - // CAPI does not allow unsetting ReadValueRequestedEventCallback. - } - } - - /// - /// This event is called when a value of a characteristic or a descriptor has been changed by a client. - /// - /// Thrown when the set write value requested callback procedure fails. - public event EventHandler WriteRequested - { - add - { - if (Server == null) return; - if (_writeValueRequested == null) - { - _writeValueRequestedCallback = (clientAddress, requestId, serverHandle, gattHandle, offset, response_needed, valueToWrite, len, userData) => - { - _writeValueRequested?.Invoke(this, new WriteRequestedEventArgs(Server, clientAddress, requestId, valueToWrite, offset, response_needed)); - }; - Impl.SetWriteValueRequestedEventCallback(_writeValueRequestedCallback); - } - _writeValueRequested = value; - } - remove - { - if (Server == null) return; - _writeValueRequested = null; - // CAPI does not allow unsetting ReadValueRequestedEventCallback. - } - } - - /// - /// The attribute's UUID. - /// - public string Uuid { get; } - - /// - /// Permissions for this attribute. - /// - public BluetoothGattPermission Permissions { get; } - - /// - /// The value of this descriptor. - /// - public byte[] Value - { - get - { - return Impl.GetValue(); - } - set - { - Impl.SetValue(value); - } - } - - internal abstract BluetoothGattClient Client { get; } - internal abstract BluetoothGattServer Server { get; } - internal abstract BluetoothGattAttributeImpl Impl { get; } - - /// - /// Returns a string value at the specified offset. - /// - /// - /// The string value at specified offset. - public string GetValue(int offset) - { - return Impl.GetValue(offset); - } - - /// - /// Sets the string value as a specified offset. - /// - /// value to set - /// Throws exception if the value is null. - public void SetValue(string value) - { - if (string.IsNullOrEmpty(value)) - GattUtil.ThrowForError((int)BluetoothError.InvalidParameter, "value should not be null"); - - byte[] val = Encoding.UTF8.GetBytes(value); - Impl.SetValue(val); - } - - /// - /// Returns a value at specified offset as the int value of the specified type. - /// - /// The type of the int value. - /// An offset in the attribute value buffer. - /// The int value at given offset. - /// Throws exception if (offset + size of int value) is greater than the length of the value buffer. - public int GetValue(IntDataType type, int offset) - { - return Impl.GetValue(type, offset); - } - - /// - /// Updates a value at the specified offset by the int value of the specified type. - /// - /// The type of the int value. - /// The value to set. - /// An offset in the attribute value buffer. - /// Throws exception if (offset + size of int value) is greater than the length of the value buffer. - public void SetValue(IntDataType type, int value, int offset) - { - Impl.SetValue(type, value, offset); - } - - /// - /// Returns a value at the specified offset as the float value of the specified type. - /// - /// The type of the float value. - /// An offset in the attribute value buffer. - /// The float value at given offset. - /// Throws exception if (offset + size of float value) is greater than the length of the value buffer. - public float GetValue(FloatDataType type, int offset) - { - return Impl.GetValue(type, offset); - } - - /// - /// Updates the value at the specified offset by the float value of the specified type. - /// - /// The type of the float value. - /// The mantissa of the float value. - /// An exponent of the float value. - /// An offset in the attribute value buffer. - /// Throws exception if (offset + size of float value) is greater than the length of the value buffer. - public void SetValue(FloatDataType type, int mantissa, int exponent, int offset) - { - Impl.SetValue(type, mantissa, exponent, offset); - } - - internal void ReleaseHandleOwnership() - { - Impl.ReleaseHandleOwnership(); - } - - internal BluetoothGattAttributeHandle GetHandle() - { - return Impl.GetHandle(); - } - } -} diff --git a/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothGattImpl.cs b/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothGattImpl.cs deleted file mode 100644 index 39530db16..000000000 --- a/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothGattImpl.cs +++ /dev/null @@ -1,707 +0,0 @@ -/* - * 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.Collections.Generic; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; -using System.Text; -using System.Threading.Tasks; - -namespace Tizen.Network.Bluetooth -{ - internal class BluetoothGattServerImpl - { - private BluetoothGattServerHandle _handle; - internal event EventHandler _notificationSent; - - internal BluetoothGattServerImpl() - { - int err = Interop.Bluetooth.BtGattServerInitialize(); - GattUtil.ThrowForError(err, "Failed to initialize server"); - - err = Interop.Bluetooth.BtGattServerCreate(out _handle); - GattUtil.ThrowForError(err, "Failed to create server"); - } - - internal void Start() - { - int err = Interop.Bluetooth.BtGattServerStart(); - GattUtil.ThrowForError(err, "Failed to start server"); - } - - internal void RegisterGattService(BluetoothGattServer server, BluetoothGattService service) - { - int err = Interop.Bluetooth.BtGattServerRegisterService(_handle, service.GetHandle()); - GattUtil.ThrowForError(err, "Failed to Register service"); - - service.SetParent(server); - } - - internal void UnregisterGattService(BluetoothGattService service) - { - int err = Interop.Bluetooth.BtGattServerUnregisterService(_handle, service.GetHandle()); - GattUtil.ThrowForError(err, "Failed to Unregister service"); - - service.UnregisterService(); - } - - internal void UnregisterAllGattServices(BluetoothGattServer server) - { - int err = Interop.Bluetooth.BtGattServerUnregisterAllServices(_handle); - GattUtil.ThrowForError(err, "Failed to Unregister all services"); - } - - internal BluetoothGattService GetService(BluetoothGattServer server, string uuid) - { - BluetoothGattAttributeHandle serviceHandle; - int err = Interop.Bluetooth.BtGattServerGetService(_handle, uuid, out serviceHandle); - if (err.IsFailed()) - { - GattUtil.Error(err, string.Format("Failed to get service with UUID ({0})", uuid)); - return null; - } - - BluetoothGattService service = new BluetoothGattService(new BluetoothGattServiceImpl(serviceHandle), uuid); ; - service.SetParent(server); - return service; - } - - internal IEnumerable GetServices(BluetoothGattServer server) - { - List attribututeList = new List(); - Interop.Bluetooth.BtGattForeachCallback cb = (total, index, attributeHandle, userData) => - { - BluetoothGattAttributeHandle handle = new BluetoothGattAttributeHandle(attributeHandle, false); - BluetoothGattService service = BluetoothGattServiceImpl.CreateBluetoothGattService(handle, ""); ; - if (service != null) - { - service.SetParent(server); - attribututeList.Add(service); - } - return true; - }; - - int err = Interop.Bluetooth.BtGattServerForeachServices(_handle, cb, IntPtr.Zero); - GattUtil.Error(err, "Failed to get all services"); - - return attribututeList; - } - - internal void SendResponse(int requestId, int request_type, int status, byte[] value, int offset) - { - int err = Interop.Bluetooth.BtGattServerSendResponse(requestId, request_type, offset, status, value, value.Length); - GattUtil.ThrowForError(err, string.Format("Failed to send response for request Id {0}", requestId)); - } - - internal void SendNotification(BluetoothGattCharacteristic characteristic, string clientAddress) - { - int err = Interop.Bluetooth.BtGattServerNotify(characteristic.GetHandle(), null, clientAddress, IntPtr.Zero); - GattUtil.ThrowForError(err, string.Format("Failed to send value changed notification for characteristic uuid {0}", characteristic.Uuid)); - } - - internal Task SendIndicationAsync(BluetoothGattServer server, BluetoothGattCharacteristic characteristic, string clientAddress) - { - TaskCompletionSource tcs = new TaskCompletionSource(); - Interop.Bluetooth.BtGattServerNotificationSentCallback cb = (result, address, serverHandle, characteristicHandle, completed, userData) => - { - _notificationSent?.Invoke(characteristic, new NotificationSentEventArg(server, address, result, completed)); - if (completed) - { - tcs.SetResult(true); - } - }; - - int err = Interop.Bluetooth.BtGattServerNotify(characteristic.GetHandle(), cb, clientAddress, IntPtr.Zero); - GattUtil.ThrowForError(err, string.Format("Failed to send value changed indication for characteristic uuid {0}", characteristic.Uuid)); - - return tcs.Task; - } - - internal BluetoothGattServerHandle GetHandle() - { - return _handle; - } - } - - internal class BluetoothGattClientImpl - { - private BluetoothGattClientHandle _handle; - - internal BluetoothGattClientImpl(string remoteAddress) - { - int err = Interop.Bluetooth.BtGattClientCreate(remoteAddress, out _handle); - GattUtil.ThrowForError(err, "Failed to get native client handle"); - } - - internal string GetRemoteAddress() - { - string remoteAddress; - int err = Interop.Bluetooth.BtGattClientGetRemoteAddress(_handle, out remoteAddress); - GattUtil.ThrowForError(err, "Failed to get remote address for this client"); - - return remoteAddress; - } - - internal BluetoothGattService GetService(BluetoothGattClient client, string uuid) - { - BluetoothGattAttributeHandle serviceHandle; - int err = Interop.Bluetooth.BtGattClientGetService(_handle, uuid, out serviceHandle); - if (err.IsFailed()) - { - GattUtil.Error(err, string.Format("Failed to get service with UUID ({0})", uuid)); - return null; - } - - BluetoothGattService service = new BluetoothGattService(new BluetoothGattServiceImpl(serviceHandle), uuid); ; - service.SetParent(client); - return service; - } - - internal IEnumerable GetServices(BluetoothGattClient client) - { - List attribututeList = new List(); - Interop.Bluetooth.BtGattForeachCallback cb = (total, index, attributeHandle, userData) => - { - BluetoothGattAttributeHandle handle = new BluetoothGattAttributeHandle(attributeHandle, false); - BluetoothGattService service = BluetoothGattServiceImpl.CreateBluetoothGattService(handle, ""); - if (service != null) - { - service.SetParent(client); - attribututeList.Add(service); - } - return true; - }; - - int err = Interop.Bluetooth.BtGattClientForeachServices(_handle, cb, IntPtr.Zero); - GattUtil.Error(err, "Failed to get all services"); - - return attribututeList; - } - - internal Task ReadValueAsyncTask(BluetoothGattAttributeHandle handle) - { - TaskCompletionSource tcs = new TaskCompletionSource(); - Interop.Bluetooth.BtGattClientRequestCompletedCallback cb = (result, requestHandle, userData) => - { - if (result == (int)BluetoothError.None) - tcs.SetResult(true); - else - tcs.SetResult(false); - }; - - int err = Interop.Bluetooth.BtGattClientReadValue(handle, cb, IntPtr.Zero); - if (err.IsFailed()) - { - GattUtil.Error(err, "Failed to read value from remote device"); - tcs.SetResult(false); - BluetoothErrorFactory.ThrowBluetoothException(err); - } - return tcs.Task; - } - - internal Task WriteValueAsyncTask(BluetoothGattAttributeHandle handle) - { - TaskCompletionSource tcs = new TaskCompletionSource(); - Interop.Bluetooth.BtGattClientRequestCompletedCallback cb = (result, requestHandle, userData) => - { - if (result == (int)BluetoothError.None) - tcs.SetResult(true); - else - tcs.SetResult(false); - }; - - int err = Interop.Bluetooth.BtGattClientWriteValue(handle, cb, IntPtr.Zero); - if (err.IsFailed()) - { - GattUtil.Error(err, "Failed to write value to remote device"); - tcs.SetResult(false); - BluetoothErrorFactory.ThrowBluetoothException(err); - } - return tcs.Task; - } - - internal BluetoothGattClientHandle GetHandle() - { - return _handle; - } - } - - internal class BluetoothGattServiceImpl : BluetoothGattAttributeImpl - { - internal BluetoothGattServiceImpl(string uuid, BluetoothGattServiceType type) - { - int err = Interop.Bluetooth.BtGattServiceCreate(uuid, (int)type, out _handle); - GattUtil.ThrowForError(err, "Failed to get native service handle"); - } - - internal BluetoothGattServiceImpl(BluetoothGattAttributeHandle handle) - { - _handle = handle; - } - - internal static BluetoothGattService CreateBluetoothGattService(BluetoothGattAttributeHandle handle, string uuid) - { - if (uuid == "") - { - int err = Interop.Bluetooth.BtGattGetUuid(handle, out uuid); - GattUtil.ThrowForError(err, "Failed to get UUID"); - } - - BluetoothGattServiceImpl impl = new BluetoothGattServiceImpl(handle); - return new BluetoothGattService(impl, uuid); - } - - internal void AddCharacteristic(BluetoothGattCharacteristic characteristic) - { - int err = Interop.Bluetooth.BtGattServiceAddCharacteristic(_handle, characteristic.GetHandle()); - GattUtil.ThrowForError(err, string.Format("Failed to add characteristic with UUID ({0})", characteristic.Uuid)); - } - - internal BluetoothGattCharacteristic GetCharacteristic(BluetoothGattService service, string uuid) - { - BluetoothGattAttributeHandle attributeHandle; - int err = Interop.Bluetooth.BtGattServiceGetCharacteristic(_handle, uuid, out attributeHandle); - if (err.IsFailed()) - { - GattUtil.Error(err, string.Format("Failed to get Characteristic with UUID ({0})", uuid)); - return null; - } - - BluetoothGattCharacteristic Characteristic = BluetoothGattCharacteristicImpl.CreateBluetoothGattGattCharacteristic(attributeHandle, uuid); - Characteristic.SetParent(service); - return Characteristic; - } - - internal IEnumerable GetCharacteristics(BluetoothGattService service) - { - List attribututeList = new List(); - Interop.Bluetooth.BtGattForeachCallback cb = (total, index, attributeHandle, userData) => - { - BluetoothGattAttributeHandle handle = new BluetoothGattAttributeHandle(attributeHandle, false); - BluetoothGattCharacteristic Characteristic = BluetoothGattCharacteristicImpl.CreateBluetoothGattGattCharacteristic(handle, ""); - if (Characteristic != null) - { - Characteristic.SetParent(service); - attribututeList.Add(Characteristic); - } - return true; - }; - - int err = Interop.Bluetooth.BtGattServiceForeachCharacteristics(service.GetHandle(), cb, IntPtr.Zero); - GattUtil.Error(err, "Failed to get all Characteristic"); - - return attribututeList; - } - - internal void AddIncludeService(BluetoothGattService includedService) - { - int err = Interop.Bluetooth.BtGattServiceAddIncludedService(_handle, includedService.GetHandle()); - GattUtil.ThrowForError(err, string.Format("Failed to add service with UUID ({0})", includedService.Uuid)); - } - - internal BluetoothGattService GetIncludeService(BluetoothGattService parentService, string uuid) - { - BluetoothGattAttributeHandle attributeHandle; - int err = Interop.Bluetooth.BtGattServiceGetIncludedService(_handle, uuid, out attributeHandle); - if (err.IsFailed()) - { - GattUtil.Error(err, string.Format("Failed to get included service with UUID ({0})", uuid)); - return null; - } - - BluetoothGattService service = new BluetoothGattService(new BluetoothGattServiceImpl(attributeHandle), uuid); - service.SetParent(parentService); - return service; - } - - internal IEnumerable GetIncludeServices(BluetoothGattService parentService) - { - List attribututeList = new List(); - Interop.Bluetooth.BtGattForeachCallback cb = (total, index, attributeHandle, userData) => - { - BluetoothGattAttributeHandle handle = new BluetoothGattAttributeHandle(attributeHandle, false); - BluetoothGattService service = BluetoothGattServiceImpl.CreateBluetoothGattService(handle, ""); - if (service != null) - { - service.SetParent(parentService); - attribututeList.Add(service); - } - return true; - }; - - int err = Interop.Bluetooth.BtGattServiceForeachIncludedServices(parentService.GetHandle(), cb, IntPtr.Zero); - GattUtil.Error(err, "Failed to get all services"); - - return attribututeList; - } - } - - internal class BluetoothGattCharacteristicImpl : BluetoothGattAttributeImpl - { - internal BluetoothGattCharacteristicImpl(string uuid, BluetoothGattPermission permission, BluetoothGattProperty property, byte[] value) - { - int err = Interop.Bluetooth.BtGattCharacteristicCreate(uuid, (int)permission, (int)property, value, value.Length, out _handle); - GattUtil.ThrowForError(err, "Failed to get native characteristic handle"); - } - - internal BluetoothGattCharacteristicImpl(BluetoothGattAttributeHandle handle) - { - _handle = handle; - } - - internal static BluetoothGattCharacteristic CreateBluetoothGattGattCharacteristic(BluetoothGattAttributeHandle handle, string uuid) - { - int permission; - int err = Interop.Bluetooth.BtGattCharacteristicGetPermissions(handle, out permission); - GattUtil.ThrowForError(err, "Failed to get permissions"); - - if (uuid == "") - { - err = Interop.Bluetooth.BtGattGetUuid(handle, out uuid); - GattUtil.ThrowForError(err, "Failed to get UUID"); - } - - BluetoothGattCharacteristicImpl impl = new BluetoothGattCharacteristicImpl(handle); - return new BluetoothGattCharacteristic(impl, uuid, (BluetoothGattPermission)permission); - } - - internal void SetCharacteristicValueChangedEvent(Interop.Bluetooth.BtClientCharacteristicValueChangedCallback callback) - { - int err = Interop.Bluetooth.BtGattClientSetCharacteristicValueChangedCallback(_handle, callback, IntPtr.Zero); - GattUtil.Error(err, "Failed to set client characteristic value changed callback"); - } - - internal void UnsetCharacteristicValueChangedEvent() - { - int err = Interop.Bluetooth.BtGattClientUnsetCharacteristicValueChangedCallback(_handle); - GattUtil.Error(err, "Failed to unset client characteristic value changed callback"); - } - - internal void SetNotificationStateChangedEvent(Interop.Bluetooth.BtGattServerNotificationStateChangeCallback callback) - { - int err = Interop.Bluetooth.BtGattServeSetNotificationStateChangeCallback(_handle, callback, IntPtr.Zero); - GattUtil.Error(err, "Failed to set characteristic notification state changed callback"); - } - - internal BluetoothGattProperty GetProperties() - { - int properties = 0 ; - int err = Interop.Bluetooth.BtGattCharacteristicGetProperties(_handle, out properties); - GattUtil.Error(err, "Failed to get characteristic properties"); - return (BluetoothGattProperty)properties; - } - - internal void SetProperties(BluetoothGattProperty perperties) - { - int err = Interop.Bluetooth.BtGattCharacteristicSetProperties(_handle, (int)perperties); - GattUtil.Error(err, "Failed to set characteristic properties"); - } - - internal BluetoothGattWriteType GetWriteType() - { - int writeType; - int err = Interop.Bluetooth.BtGattCharacteristicGetWriteType(_handle, out writeType); - GattUtil.Error(err, "Failed to get characteristic writetype"); - return (BluetoothGattWriteType) writeType; - } - - internal void SetWriteType(BluetoothGattWriteType writeType) - { - int err = Interop.Bluetooth.BtGattCharacteristicSetWriteType(_handle, (int)writeType); - GattUtil.Error(err, "Failed to get characteristic writetype"); - } - - internal void AddDescriptor(BluetoothGattDescriptor descriptor) - { - int err = Interop.Bluetooth.BtGattCharacteristicAddDescriptor(_handle, descriptor.GetHandle()); - GattUtil.ThrowForError(err, string.Format("Failed to add descriptor with UUID ({0})", descriptor.Uuid)); - } - - internal BluetoothGattDescriptor GetDescriptor(BluetoothGattCharacteristic characteristic, string uuid) - { - BluetoothGattAttributeHandle handle; - int err = Interop.Bluetooth.BtGattCharacteristicGetDescriptor(_handle, uuid, out handle); - if (err.IsFailed()) - { - GattUtil.Error(err, string.Format("Failed to get descriptor with UUID ({0})", uuid)); - return null; - } - BluetoothGattDescriptor descriptor = BluetoothGattDescriptorImpl.CreateBluetoothGattDescriptor(handle, uuid); - descriptor.SetParent(characteristic); - return descriptor; - } - - internal IEnumerable GetDescriptors(BluetoothGattCharacteristic characteristic) - { - List attribututeList = new List(); - Interop.Bluetooth.BtGattForeachCallback cb = (total, index, attributeHandle, userData) => - { - BluetoothGattAttributeHandle handle = new BluetoothGattAttributeHandle(attributeHandle, false); - BluetoothGattDescriptor descriptor = BluetoothGattDescriptorImpl.CreateBluetoothGattDescriptor(handle, ""); - if (descriptor != null) - { - descriptor.SetParent(characteristic); - attribututeList.Add(descriptor); - } - return true; - }; - - int err = Interop.Bluetooth.BtGattCharacteristicForeachDescriptors(characteristic.GetHandle(), cb, IntPtr.Zero); - GattUtil.Error(err, "Failed to get all descriptor"); - - return attribututeList; - } - } - - internal class BluetoothGattDescriptorImpl : BluetoothGattAttributeImpl - { - internal BluetoothGattDescriptorImpl(string uuid, BluetoothGattPermission permission, byte[] value) - { - int err = Interop.Bluetooth.BtGattDescriptorCreate(uuid, (int)permission, value, value.Length, out _handle); - GattUtil.ThrowForError(err, "Failed to get native descriptor handle"); - } - - internal BluetoothGattDescriptorImpl(BluetoothGattAttributeHandle handle) - { - _handle = handle; - } - - internal static BluetoothGattDescriptor CreateBluetoothGattDescriptor(BluetoothGattAttributeHandle handle, string uuid) - { - int permission; - int err = Interop.Bluetooth.BtGattDescriptorGetPermissions(handle, out permission); - GattUtil.ThrowForError(err, string.Format("Failed to get permissions with UUID ({0})", uuid)); - - if (uuid == "") - { - int ret = Interop.Bluetooth.BtGattGetUuid(handle, out uuid); - GattUtil.ThrowForError(ret, "Failed to get UUID"); - } - - BluetoothGattDescriptorImpl impl = new BluetoothGattDescriptorImpl(handle); - return new BluetoothGattDescriptor(impl, uuid, (BluetoothGattPermission)permission); - } - } - - internal abstract class BluetoothGattAttributeImpl - { - protected BluetoothGattAttributeHandle _handle; - - internal string GetUuid() - { - string uuid; - int err = Interop.Bluetooth.BtGattGetUuid(_handle, out uuid); - GattUtil.Error(err, "Failed to get attribute uuid"); - - return uuid; - } - - internal byte[] GetValue() - { - IntPtr nativeValue; - int nativeValueLength; - int err = Interop.Bluetooth.BtGattGetValue(_handle, out nativeValue, out nativeValueLength); - GattUtil.Error(err, "Failed to get attribute value"); - - return GattUtil.IntPtrToByteArray(nativeValue, nativeValueLength); - } - - internal void SetValue(byte[] value) - { - int err = Interop.Bluetooth.BtGattSetValue(_handle, value, value.Length); - GattUtil.ThrowForError(err, "Failed to set attribute value"); - } - - internal string GetValue(int offset) - { - byte[] value = GetValue(); - - int nullPos = value.Length - offset; - for (int i = offset; i < value.Length; ++i) - { - if (value[i] == '\0') - { - nullPos = i; - break; - } - } - - string strValue = ""; - strValue = Encoding.UTF8.GetString(value, offset, nullPos - offset); - return strValue; - } - - internal int GetValue(IntDataType type, int offset) - { - int value; - int err = Interop.Bluetooth.BtGattGetIntValue(_handle, (int)type, offset, out value); - GattUtil.Error(err, "Failed to get attribute int value at offset"); - return value; - } - - internal void SetValue(IntDataType type, int value, int offset) - { - int err = Interop.Bluetooth.BtGattSetIntValue(_handle, (int)type, value, offset); - GattUtil.ThrowForError(err, "Failed to set attribute int value at offset"); - } - - internal float GetValue(FloatDataType type, int offset) - { - float value; - int err = Interop.Bluetooth.BtGattGetFloatValue(_handle, (int)type, offset, out value); - GattUtil.Error(err, "Failed to get attribute float value at offset"); - return value; - } - - internal void SetValue(FloatDataType type, int mantissa, int exponent, int offset) - { - int err = Interop.Bluetooth.BtGattSetFloatValue(_handle, (int)type, mantissa, exponent, offset); - GattUtil.ThrowForError(err, "Failed to set attribute float value at offset"); - } - - internal void SetReadValueRequestedEventCallback(Interop.Bluetooth.BtGattServerReadValueRequestedCallback callback) - { - int err = Interop.Bluetooth.BtGattServerSetReadValueRequestedCallback(_handle, callback, IntPtr.Zero); - GattUtil.ThrowForError(err, "Failed to set attribute read value requested callback"); - } - - internal void SetWriteValueRequestedEventCallback(Interop.Bluetooth.BtGattServerWriteValueRequestedCallback callback) - { - int err = Interop.Bluetooth.BtGattServerSetWriteValueRequestedCallback(_handle, callback, IntPtr.Zero); - GattUtil.ThrowForError(err, "Failed to set attribute write value requested callback"); - } - - internal BluetoothGattAttributeHandle GetHandle() - { - return _handle; - } - - internal void ReleaseHandleOwnership() - { - _handle.ReleaseOwnership(); - } - } - - - internal class BluetoothGattAttributeHandle : BluetoothGattHandle - { - public BluetoothGattAttributeHandle(IntPtr nativeHandle, bool hasOwnership) : base(nativeHandle, hasOwnership) - { - } - - public BluetoothGattAttributeHandle() - { - } - - protected override bool ReleaseHandle() - { - if (_hasOwnership == true) - { - Interop.Bluetooth.BtGattDestroy(handle); - } - SetHandle(IntPtr.Zero); - return true; - } - } - - internal class BluetoothGattClientHandle : BluetoothGattHandle - { - protected override bool ReleaseHandle() - { - if (_hasOwnership == true) - { - Interop.Bluetooth.BtGattClientDestroy(handle); - } - SetHandle(IntPtr.Zero); - return true; - } - } - - internal class BluetoothGattServerHandle : BluetoothGattHandle - { - protected override bool ReleaseHandle() - { - if (_hasOwnership == true) - { - Interop.Bluetooth.BtGattServerDeinitialize(); - Interop.Bluetooth.BtGattServerDestroy(handle); - } - SetHandle(IntPtr.Zero); - return true; - } - } - - internal abstract class BluetoothGattHandle : SafeHandle - { - protected bool _hasOwnership; - - public BluetoothGattHandle() : base(IntPtr.Zero, true) - { - _hasOwnership = true; - } - - public BluetoothGattHandle(IntPtr nativeHandle, bool hasOwnership) : base(nativeHandle, true) - { - _hasOwnership = hasOwnership; - } - - public override bool IsInvalid - { - get { return handle == IntPtr.Zero; } - } - - public void ReleaseOwnership() - { - _hasOwnership = false; - } - } - - internal static class GattUtil - { - internal static byte[] IntPtrToByteArray(IntPtr nativeValue, int lenght) - { - byte[] value = new byte[lenght]; - if (nativeValue != IntPtr.Zero) - { - Marshal.Copy(nativeValue, value, 0, lenght); - } - return value; - } - - internal static void Error(int err, string message, [CallerFilePath] string file = "", [CallerMemberName] string func = "", [CallerLineNumber] int line = 0) - { - if (err.IsFailed()) - { - Log.Error(Globals.LogTag, string.Format("{0}, err: {1}", message, (BluetoothError)err), file, func, line); - } - } - - internal static void ThrowForError(int err, string message, [CallerFilePath] string file = "", [CallerMemberName] string func = "", [CallerLineNumber] int line = 0) - { - if (err.IsFailed()) - { - Log.Error(Globals.LogTag, string.Format("{0}, err: {1}", message, (BluetoothError)err), file, func, line); - BluetoothErrorFactory.ThrowBluetoothException(err); - } - } - - internal static bool IsFailed(this int err) - { - return err != (int)BluetoothError.None; - } - } -} diff --git a/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothHid.cs b/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothHid.cs deleted file mode 100644 index c35a963c8..000000000 --- a/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothHid.cs +++ /dev/null @@ -1,79 +0,0 @@ -using System; - -namespace Tizen.Network.Bluetooth -{ - /// - /// A class which is used to handle the connection to Bluetooth HID like keyboards and mouse. - /// - /// http://tizen.org/privilege/bluetooth - public class BluetoothHid : BluetoothProfile - { - internal BluetoothHid() - { - } - - /// - /// The HidConnectionStateChanged event is called when the HID host connection state is changed. - /// - public event EventHandler HidConnectionStateChanged - { - add - { - BluetoothHidImpl.Instance.HidConnectionStateChanged += value; - } - remove - { - BluetoothHidImpl.Instance.HidConnectionStateChanged -= value; - } - } - - /// - /// Connects the remote device with the HID service. - /// - /// - /// The device must be bonded with the remote device by CreateBond(). - /// If connection request succeeds, the HidConnectionStateChanged event will be invoked. - /// - /// Thrown when the Bluetooth is not enabled - /// or when the connection attempt to the remote device fails. - public void Connect() - { - if (BluetoothAdapter.IsBluetoothEnabled && Globals.IsInitialize) - { - int ret = BluetoothHidImpl.Instance.Connect(RemoteAddress); - if (ret != (int)BluetoothError.None) - { - Log.Error(Globals.LogTag, "Failed to Connect - " + (BluetoothError)ret); - BluetoothErrorFactory.ThrowBluetoothException(ret); - } - } - else - { - BluetoothErrorFactory.ThrowBluetoothException((int)BluetoothError.NotEnabled); - } - } - - /// - /// Disconnects the remote device with the HID service. - /// - /// Thrown when the Bluetooth is not enabled - /// or when the disconnection attempt to the remote device fails. - public void Disconnect() - { - if (BluetoothAdapter.IsBluetoothEnabled && Globals.IsInitialize) - { - int ret = BluetoothHidImpl.Instance.Disconnect(RemoteAddress); - if (ret != (int)BluetoothError.None) - { - Log.Error(Globals.LogTag, "Failed to Disconnect - " + (BluetoothError)ret); - BluetoothErrorFactory.ThrowBluetoothException(ret); - } - } - else - { - BluetoothErrorFactory.ThrowBluetoothException((int)BluetoothError.NotEnabled); - } - } - } -} - diff --git a/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothHidImpl.cs b/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothHidImpl.cs deleted file mode 100644 index 6a1401e33..000000000 --- a/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothHidImpl.cs +++ /dev/null @@ -1,148 +0,0 @@ -/* - * 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.Network.Bluetooth -{ - internal class BluetoothHidImpl : IDisposable - { - private event EventHandler _hidConnectionChanged; - private Interop.Bluetooth.HidConnectionStateChangedCallback _hidConnectionChangedCallback; - - private static readonly BluetoothHidImpl _instance = new BluetoothHidImpl(); - private bool disposed = false; - - internal event EventHandler HidConnectionStateChanged - { - add - { - _hidConnectionChanged += value; - } - remove - { - //nothing to be done - } - } - - internal int Connect(string deviceAddress) - { - if (Globals.IsHidInitialize) - { - int ret = Interop.Bluetooth.Connect (deviceAddress); - if (ret != (int)BluetoothError.None) { - Log.Error (Globals.LogTag, "Failed to connect device with the hid service, Error - " + (BluetoothError)ret); - } - return ret; - } - return (int)BluetoothError.NotInitialized; - } - - internal int Disconnect(string deviceAddress) - { - if (Globals.IsHidInitialize) - { - int ret = Interop.Bluetooth.Disconnect (deviceAddress); - if (ret != (int)BluetoothError.None) { - Log.Error (Globals.LogTag, "Failed to disconnect device with the hid service, Error - " + (BluetoothError)ret); - } - return ret; - } - return (int)BluetoothError.NotInitialized; - } - - internal static BluetoothHidImpl Instance - { - get - { - return _instance; - } - } - private BluetoothHidImpl () - { - initialize(); - } - ~BluetoothHidImpl() - { - Dispose(false); - } - - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - - private void Dispose(bool disposing) - { - if (disposed) - return; - - if (disposing) - { - // Free managed objects. - } - //Free unmanaged objects - deinitialize(); - disposed = true; - } - - private void initialize() - { - if (Globals.IsInitialize) - { - _hidConnectionChangedCallback = (int result, bool connected, string deviceAddress, IntPtr userData) => - { - if (_hidConnectionChanged != null) - { - _hidConnectionChanged(null, new HidConnectionStateChangedEventArgs(result, connected, deviceAddress)); - } - }; - - int ret = Interop.Bluetooth.InitializeHid (_hidConnectionChangedCallback, IntPtr.Zero); - if (ret != (int)BluetoothError.None) - { - Log.Error(Globals.LogTag, "Failed to initialize bluetooth hid, Error - " + (BluetoothError)ret); - BluetoothErrorFactory.ThrowBluetoothException (ret); - } - else - { - Globals.IsHidInitialize = true; - } - } - else - { - Log.Error(Globals.LogTag, "Failed to initialize HID, BT not initialized"); - BluetoothErrorFactory.ThrowBluetoothException((int)BluetoothError.NotInitialized); - } - } - - private void deinitialize() - { - if (Globals.IsHidInitialize) - { - int ret = Interop.Bluetooth.DeinitializeHid (); - if (ret != (int)BluetoothError.None) { - Log.Error (Globals.LogTag, "Failed to deinitialize bluetooth hid, Error - " + (BluetoothError)ret); - BluetoothErrorFactory.ThrowBluetoothException (ret); - } else { - Globals.IsHidInitialize = false; - } - } - } - } -} - diff --git a/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothLeAdapter.cs b/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothLeAdapter.cs deleted file mode 100644 index a700c4400..000000000 --- a/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothLeAdapter.cs +++ /dev/null @@ -1,831 +0,0 @@ -/* - * 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.Threading.Tasks; -using System.Collections.Generic; -using System.Collections.Specialized; -using System.Runtime.InteropServices; - -namespace Tizen.Network.Bluetooth { - - /// - /// This is the BluetoothLeAdvertiser class. It handles the LE advertising operation amd callback. - /// - public class BluetoothLeAdvertiser - { - private static readonly BluetoothLeAdvertiser _instance = new BluetoothLeAdvertiser(); - - internal static BluetoothLeAdvertiser Instance - { - get - { - return _instance; - } - } - - private BluetoothLeAdvertiser() - { - } - - /// - /// This event is called when the LE advertising state changes. - /// - public event EventHandler AdvertisingStateChanged - { - add - { - BluetoothLeImplAdapter.Instance.AdapterLeAdvertisingStateChanged += value; - } - remove - { - BluetoothLeImplAdapter.Instance.AdapterLeAdvertisingStateChanged -= value; - } - } - /// - /// Starts advertising using the advertise data object. - /// - /// - /// The Bluetooth must be enabled. - /// - /// The advertiser object carrying information of the advertising. - /// Thrown when the Bluetooth LE is not supported. - /// Thrown when the Bluetooth LE is not enabled. - public void StartAdvertising(BluetoothLeAdvertiseData advertiseData) - { - if (BluetoothAdapter.IsBluetoothEnabled && Globals.IsInitialize) - { - int ret = BluetoothLeImplAdapter.Instance.StartAdvertising (advertiseData.GetHandle ()); - if (ret != (int)BluetoothError.None) { - Log.Error (Globals.LogTag, "Failed to start advertising- " + (BluetoothError)ret); - BluetoothErrorFactory.ThrowBluetoothException(ret); - } - } - else - { - BluetoothErrorFactory.ThrowBluetoothException((int)BluetoothError.NotEnabled); - } - } - - /// - /// Stops the advertising. - /// - /// - /// The Bluetooth must be enabled. - /// - /// The advertiser object carrying information of the advertising. - /// Thrown when the Bluetooth LE is not supported. - /// Thrown when the Bluetooth LE is not enabled. - public void StopAdvertising(BluetoothLeAdvertiseData advertiseData) - { - if (BluetoothAdapter.IsBluetoothEnabled && Globals.IsInitialize) - { - int ret = BluetoothLeImplAdapter.Instance.StopAdvertising (advertiseData.GetHandle ()); - if (ret != (int)BluetoothError.None) { - Log.Error (Globals.LogTag, "Failed to stop advertising operation- " + (BluetoothError)ret); - BluetoothErrorFactory.ThrowBluetoothException(ret); - } - } - else - { - BluetoothErrorFactory.ThrowBluetoothException((int)BluetoothError.NotEnabled); - } - } - } - - /// - /// This is the BluetoothLeDevice class. - /// It handles the LE device operations like getting data from the scan result information. - /// - public class BluetoothLeDevice - { - //properties of Bluetoothlesacandata - private string _remoteAddress; - private BluetoothLeDeviceAddressType _addressType; - private int _rssi; - private byte[] _advDataValue; - private byte[] _scanDataValue; - private BluetoothLePacketType _packetType; - private BluetoothLeScanData _scanData; - - /// - /// This event is called when the GATT client connects/disconnects with the server. - /// - public event EventHandler GattConnectionStateChanged - { - add - { - BluetoothLeImplAdapter.Instance.LeGattConnectionStateChanged += value; - } - remove - { - BluetoothLeImplAdapter.Instance.LeGattConnectionStateChanged -= value; - } - } - - internal BluetoothLeDevice(BluetoothLeScanData scanData) - { - _scanData = new BluetoothLeScanData (); - _scanData = scanData; - - Log.Info (Globals.LogTag, "Rssi" + _scanData.Rssi); - _rssi = scanData.Rssi; - Log.Info (Globals.LogTag, "RemoteAddress" + _scanData.RemoteAddress); - if (scanData.RemoteAddress != null) - _remoteAddress = scanData.RemoteAddress; - Log.Info (Globals.LogTag, "AddressType" + _scanData.AddressType); - _addressType = scanData.AddressType; - - Log.Info (Globals.LogTag, "AdvDataLength" + _scanData.AdvDataLength); - if (_scanData.AdvDataLength > 0) - { - _advDataValue = new byte[_scanData.AdvDataLength]; - scanData.AdvData.CopyTo(_advDataValue, 0); - } - - Log.Info(Globals.LogTag, "ScanDataLength" + _scanData.ScanDataLength); - // Check length before copying - if (_scanData.ScanDataLength > 0) - { - _scanDataValue = new byte[_scanData.ScanDataLength]; - scanData.ScanData.CopyTo(_scanDataValue, 0); - } - } - - ~BluetoothLeDevice() - { - if (BluetoothAdapter.IsBluetoothEnabled && Globals.IsInitialize) - { - BluetoothLeImplAdapter.Instance.FreeServiceDataList(); - } - } - - /// - /// The remote address. - /// - public string RemoteAddress - { - get - { - return _remoteAddress; - } - } - - /// - /// The type of the address. - /// - public BluetoothLeDeviceAddressType AddressType - { - get - { - return _addressType; - } - } - - /// - /// The rssi value. - /// - public int Rssi - { - get - { - return _rssi; - } - } - - /// - /// The advertsing data information. - /// - public byte[] AdvertsingDataInformation - { - get - { - return _advDataValue; - } - } - - /// - /// The scan data information. - /// - public byte[] ScanDataInformation - { - get - { - return _scanDataValue; - } - } - - /// - /// The type of the packet. - /// - public BluetoothLePacketType PacketType - { - get - { - return _packetType; - } - set - { - _packetType = value; - } - } - - /// - /// Gets the service UUIDs list from the LE scan result information. - /// - /// Gets the list of the string service UUIDs. - /// - /// The Bluetooth must be enabled. - /// - /// Thrown when the Bluetooth LE is not supported. - /// Thrown when the Bluetooth LE is not enabled. - public IEnumerable ServiceUuid - { - get - { - if (BluetoothAdapter.IsBluetoothEnabled && Globals.IsInitialize) - { - Log.Info(Globals.LogTag, "Retrieving Service uuid- "); - return BluetoothLeImplAdapter.Instance.GetLeScanResultServiceUuids(_scanData, _packetType); - } - return null; - } - } - - /// - /// Gets the device name from the LE scan result information. - /// - /// Gets the device name. - /// - /// The Bluetooth must be enabled. - /// - /// Thrown when the Bluetooth LE is not supported. - /// Thrown when the Bluetooth LE is not enabled. - public string DeviceName - { - get - { - Log.Info(Globals.LogTag, "Retrieving device name- "); - if (BluetoothAdapter.IsBluetoothEnabled && Globals.IsInitialize) - { - return BluetoothLeImplAdapter.Instance.GetLeScanResultDeviceName(_scanData, _packetType); - } - return null; - } - } - /// - /// Gets the transmission power level from the LE scan result information. - /// - /// Gets the transmission power level in dB. - /// - /// The Bluetooth must be enabled. - /// - /// Thrown when the Bluetooth LE is not supported. - /// Thrown when the Bluetooth LE is not enabled. - public int TxPowerLevel - { - get - { - if (BluetoothAdapter.IsBluetoothEnabled && Globals.IsInitialize) - { - return BluetoothLeImplAdapter.Instance.GetScanResultTxPowerLevel(_scanData, _packetType); - } - return -1; - } - } - - /// - /// Gets the service solicitation UUID list from the scan result information. - /// - /// Gets the list of the service solicitation UUIDs. - /// - /// The Bluetooth must be enabled. - /// - /// Thrown when the Bluetooth LE is not supported. - /// Thrown when the Bluetooth LE is not enabled. - public IEnumerable ServiceSolictationUuid - { - get - { - if (BluetoothAdapter.IsBluetoothEnabled && Globals.IsInitialize) - { - return BluetoothLeImplAdapter.Instance.GetScanResultSvcSolicitationUuids(_scanData, _packetType); - } - return null; - } - } - /// - /// Gets the manufacturer data from the scan result information. - /// - /// Gets the appearance value. - /// - /// The Bluetooth must be enabled. - /// - /// Thrown when the Bluetooth LE is not supported. - /// Thrown when the Bluetooth LE is not enabled. - public int Appearance - { - get - { - if (BluetoothAdapter.IsBluetoothEnabled && Globals.IsInitialize) - { - return BluetoothLeImplAdapter.Instance.GetScanResultAppearance(_scanData, _packetType); - } - return -1; - } - } - /// - /// Gets the manufacturer data from the scan result information. - /// - /// Gets the manufacturer data containing the manucturer data and ID information. - /// - /// The Bluetooth must be enabled. - /// - /// Thrown when the Bluetooth LE is not supported. - /// Thrown when the Bluetooth LE is not enabled./// - public ManufacturerData ManufacturerData - { - get - { - if (BluetoothAdapter.IsBluetoothEnabled && Globals.IsInitialize) - { - return BluetoothLeImplAdapter.Instance.GetScanResultManufacturerData(_scanData, _packetType); - } - return null; - } - } - - /// - /// Gets the service data list from the scan result information. - /// - /// - /// The Bluetooth must be enabled. - /// - /// Returns the service data list. - /// Thrown when the Bluetooth LE is not supported. - /// Thrown when the Bluetooth LE is not enabled. - public IEnumerable GetServiceDataList() - { - int serviceCount = 0; - if (BluetoothAdapter.IsBluetoothEnabled && Globals.IsInitialize) - { - return BluetoothLeImplAdapter.Instance.GetScanResultServiceDataList(_scanData, - _packetType, out serviceCount); - } - return null; - } - - - /// - /// Creates a GATT connection with the remote device. - /// - /// - /// The Bluetooth must be enabled. - /// - /// The auto connect flag. - /// client instance - /// Thrown when the Bluetooth LE is not supported. - /// Thrown when the Bluetooth LE is not enabled - /// or when the gatt connection attempt to remote device fails. - public BluetoothGattClient GattConnect(bool autoConnect) - { - BluetoothGattClient client = null; - if (BluetoothAdapter.IsBluetoothEnabled && Globals.IsInitialize) - { - int ret = BluetoothLeImplAdapter.Instance.GattConnect (_remoteAddress, autoConnect); - if (ret != (int)BluetoothError.None) { - Log.Error (Globals.LogTag, "Failed to create GATT Connection with remote device- " + (BluetoothError)ret); - } - else - { - client = BluetoothGattClient.CreateClient(_remoteAddress); - } - } - else - { - BluetoothErrorFactory.ThrowBluetoothException((int)BluetoothError.NotEnabled); - } - return client; - } - - /// - /// Disconnects a GATT connection with the remote device. - /// - /// - /// The Bluetooth must be enabled. - /// - /// Thrown when the Bluetooth LE is not supported. - /// Thrown when the Bluetooth LE is not enabled - /// or when the GATT disconnection attempt to remote device fails. - public void GattDisconnect() - { - if (BluetoothAdapter.IsBluetoothEnabled && Globals.IsInitialize) - { - int ret = BluetoothLeImplAdapter.Instance.GattDisconnect (_remoteAddress); - if (ret != (int)BluetoothError.None) { - Log.Error (Globals.LogTag, "Failed to disconnect GATT connection with remote device- " + (BluetoothError)ret); - } - } - else - { - BluetoothErrorFactory.ThrowBluetoothException((int)BluetoothError.NotEnabled); - } - } - } - - /// - /// Bluetooth LE advertise data. Handles the data advertising. - /// - public class BluetoothLeAdvertiseData:IDisposable - { - private IntPtr _handle = IntPtr.Zero; - private BluetoothLeAdvertisingMode _mode; - private bool _advertisingConnectable; - private BluetoothLePacketType _packetType; - private int _appearance; - private bool _includePowerLevel; - private bool _includeDeviceName; - - /// - /// The default constructor initializes an object of the BluetoothLeAdvertiseData. - /// - /// Thrown when the Bluetooth LE is not supported. - /// Thrown when the Bluetooth LE is not enabled - /// or when create advertiser fails. - public BluetoothLeAdvertiseData() - { - if (BluetoothAdapter.IsBluetoothEnabled && Globals.IsInitialize) - { - Log.Debug(Globals.LogTag, " Creating LeAdvertiser()"); - int ret = Interop.Bluetooth.CreateAdvertiser(out _handle); - if (ret != (int)BluetoothError.None) - { - Log.Error(Globals.LogTag, "Failed to create advertiser object- " + (BluetoothError)ret); - BluetoothErrorFactory.ThrowBluetoothException(ret); - } - } - else - { - BluetoothErrorFactory.ThrowBluetoothException((int)BluetoothError.NotEnabled); - } - } - - ~BluetoothLeAdvertiseData() - { - if (BluetoothAdapter.IsBluetoothEnabled && Globals.IsInitialize) - { - //clean-up - ClearAdvertisingData (BluetoothLePacketType.BluetoothLeAdvertisingPacket); - ClearAdvertisingData (BluetoothLePacketType.BluetoothLeScanResponsePacket); - BluetoothLeImplAdapter.Instance.DestroyAdvertiser (_handle); - } - Dispose(false); - } - - internal IntPtr GetHandle() - { - return _handle; - } - - /// - /// The advertising mode to control the advertising power and latency. - /// - /// - /// The Bluetooth must be enabled. - /// - /// Thrown when the Bluetooth LE is not supported. - /// Thrown when the Bluetooth LE is not enabled - /// or when the set advertising mode fails. - public BluetoothLeAdvertisingMode AdvertisingMode - { - get - { - return _mode; - } - set - { - if (BluetoothAdapter.IsBluetoothEnabled && Globals.IsInitialize) - { - _mode = value; - int ret = Interop.Bluetooth.SetAdvertisingMode (GetHandle (), _mode); - if (ret != (int)BluetoothError.None) { - Log.Error (Globals.LogTag, "Failed to set advertising mode- " + (BluetoothError)ret); - BluetoothErrorFactory.ThrowBluetoothException (ret); - } - } - } - } - - /// - /// The advertising connectable type. - /// - /// - /// The Bluetooth must be enabled. - /// - /// Thrown when the Bluetooth LE is not supported. - /// Thrown when the Bluetooth LE is not enabled - /// or when the set advertising connectable mode fails. - public bool AdvertisingConnectable - { - get - { - return _advertisingConnectable; - } - set - { - if (BluetoothAdapter.IsBluetoothEnabled && Globals.IsInitialize) - { - _advertisingConnectable = value; - int ret = Interop.Bluetooth.SetAdvertisingConnectable (GetHandle (), _advertisingConnectable); - if (ret != (int)BluetoothError.None) { - Log.Error (Globals.LogTag, "Failed to set advertising connectable value- " + (BluetoothError)ret); - BluetoothErrorFactory.ThrowBluetoothException (ret); - } - } - } - } - - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - - private void Dispose(bool disposing) - { - //todo... - } - - /// - /// The type of the packet. - /// - public BluetoothLePacketType PacketType - { - get - { - return _packetType; - } - set - { - _packetType = value; - } - } - /// - /// Sets the external appearance of this device to the advertise or the scan response data. - /// Please refer to the adopted Bluetooth specification for the appearance. - /// - /// - /// The Bluetooth must be enabled. - /// - /// Thrown when the Bluetooth LE is not supported. - /// Thrown when the Bluetooth LE is not enabled - /// or when the set appearance fails. - public int Appearance - { - get - { - return _appearance; - } - set - { - _appearance = value; - if (BluetoothAdapter.IsBluetoothEnabled && Globals.IsInitialize) { - int ret = Interop.Bluetooth.SetAdvertisingAppearance (GetHandle (), _packetType, _appearance); - if (ret != (int)BluetoothError.None) { - Log.Error (Globals.LogTag, "Failed to add appearance value to advertising data- " + (BluetoothError)ret); - BluetoothErrorFactory.ThrowBluetoothException(ret); - } - } - } - } - /// - /// Sets whether the device name has to be included in the advertise or the scan response data. - /// The maximum advertised or responded data size is 31 bytes including the data type and the system wide data. - /// - /// - /// The Bluetooth must be enabled. - /// - /// Thrown when the Bluetooth LE is not supported. - /// Thrown when the Bluetooth LE is not enabled - /// or when the set advertising device name fails. - public bool IncludeDeviceName - { - get - { - return _includeDeviceName; - } - set - { - _includeDeviceName = value; - if (BluetoothAdapter.IsBluetoothEnabled && Globals.IsInitialize) - { - int ret = Interop.Bluetooth.SetAdvertisingDeviceName(GetHandle(), _packetType, _includeDeviceName); - if (ret != (int)BluetoothError.None) { - Log.Error (Globals.LogTag, "Failed to add device name to advertising data- " + (BluetoothError)ret); - BluetoothErrorFactory.ThrowBluetoothException(ret); - } - } - } - } - - - /// - /// Sets whether the transmission power level should be included in the advertise or the scan response data. - /// The maximum advertised or responded data size is 31 bytes including the data type and the system wide data. - /// - /// - /// The Bluetooth must be enabled. - /// - /// Thrown when the Bluetooth LE is not supported. - /// Thrown when the Bluetooth LE is not enabled - /// or when the set advertising TC power level fails. - public bool IncludeTxPowerLevel - { - get - { - return _includePowerLevel; - } - set - { - _includePowerLevel = value; - if (BluetoothAdapter.IsBluetoothEnabled && Globals.IsInitialize) - { - int ret = Interop.Bluetooth.SetAdvertisingTxPowerLevel(GetHandle(), _packetType, _includePowerLevel); - if (ret != (int)BluetoothError.None) - { - Log.Error(Globals.LogTag, "Failed to add advertising service solicitation uuid- " + (BluetoothError)ret); - } - } - } - } - /// - /// Adds a service UUID to the advertise or the scan response data. - /// The maximum advertised or responded data size is 31 bytes - /// including the data type and the system wide data. - /// - /// - /// The Bluetooth must be enabled. - /// - /// The packet type. - /// The service UUID to add to advertise data. - /// Thrown when the Bluetooth LE is not supported. - /// Thrown when the Bluetooth LE is not enabled - /// or when the add advertising service UUID procedure fails. - public void AddAdvertisingServiceUuid(BluetoothLePacketType packetType, string serviceUuid) - { - if (BluetoothAdapter.IsBluetoothEnabled && Globals.IsInitialize) - { - int ret = Interop.Bluetooth.AddAdvertisingServiceUuid (GetHandle (), packetType, serviceUuid); - if (ret != (int)BluetoothError.None) { - Log.Error (Globals.LogTag, "Failed to add service uuid to advertising data- " + (BluetoothError)ret); - BluetoothErrorFactory.ThrowBluetoothException (ret); - } - } - else - { - BluetoothErrorFactory.ThrowBluetoothException((int)BluetoothError.NotEnabled); - } - } - - /// - /// Adds a service solicitation UUID to advertise or scan the response data. - /// The maximum advertised or responded data size is 31 bytes - /// including the data type and the system wide data. - /// - /// - /// The Bluetooth must be enabled. - /// - /// The packet type. - /// The service solicitation UUID to add to advertise data. - /// Thrown when the Bluetooth LE is not supported. - /// Thrown when the Bluetooth LE is not enabled - /// or when the add advertising service solicitation UUID procedure fails. - public void AddAdvertisingServiceSolicitationUuid(BluetoothLePacketType packetType, - string serviceSolicitationUuid) - { - if (BluetoothAdapter.IsBluetoothEnabled && Globals.IsInitialize) - { - int ret = Interop.Bluetooth.AddAdvertisingServiceSolicitationUuid(GetHandle(), packetType, - serviceSolicitationUuid); - if (ret != (int)BluetoothError.None) { - Log.Error (Globals.LogTag, "Failed to add service solicitation uuid to advertising data- " + (BluetoothError)ret); - BluetoothErrorFactory.ThrowBluetoothException(ret); - } - } - else - { - BluetoothErrorFactory.ThrowBluetoothException((int)BluetoothError.NotEnabled); - } - } - - /// - /// Adds a service data to the advertise or the scan response data. - /// The maximum advertised or responded data size is 31 bytes - /// including data type and system wide data. - /// - /// - /// The Bluetooth must be enabled. - /// - /// The packet type. - /// The service data to be added to advertising. - /// Thrown when the Bluetooth LE is not supported. - /// Thrown when the Bluetooth LE is not enabled - /// or when the add advertising data procedure fails. - public void AddAdvertisingServiceData(BluetoothLePacketType packetType, BluetoothServiceData data) - { - if (BluetoothAdapter.IsBluetoothEnabled && Globals.IsInitialize) - { - IntPtr serviceDataPtr; - serviceDataPtr = Marshal.AllocHGlobal(data.DataLength); - Marshal.Copy(data.Data, 0, serviceDataPtr, data.DataLength); - - for (int i = 0; i < 3; i++) - Log.Error (Globals.LogTag, " service data is " + data.Data [i]); - int ret = Interop.Bluetooth.AddAdvertisingServiceData(GetHandle(), packetType, - data.Uuid, serviceDataPtr, data.DataLength); - if (ret != (int)BluetoothError.None) - { - Log.Error(Globals.LogTag, "Failed to add service data to advertising data- " + (BluetoothError)ret); - BluetoothErrorFactory.ThrowBluetoothException(ret); - } - } - else - { - BluetoothErrorFactory.ThrowBluetoothException((int)BluetoothError.NotEnabled); - } - } - - /// - /// Adds the manufacturer specific data to the advertise or the scan response data. - /// Please refer to the adopted Bluetooth specification for the the appearance. - /// - /// - /// The Bluetooth must be enabled. - /// - /// The packet type. - /// The manufacturer specific data. - /// Thrown when the Bluetooth LE is not supported. - /// Thrown when the Bluetooth LE is not enabled - /// or when the add advertising manufacturer data procedure fails. - public void AddAdvertisingManufacturerData(BluetoothLePacketType packetType, - ManufacturerData manufacturerData) - { - if (BluetoothAdapter.IsBluetoothEnabled && Globals.IsInitialize) - { - IntPtr manufDataPtr; - manufDataPtr = Marshal.AllocHGlobal(manufacturerData.DataLength); - Marshal.Copy(manufacturerData.Data, 0, manufDataPtr, manufacturerData.DataLength); - - int ret = Interop.Bluetooth.AddAdvertisingManufData(GetHandle(), packetType, - manufacturerData.Id, manufDataPtr, manufacturerData.DataLength); - if (ret != (int)BluetoothError.None) - { - Log.Error(Globals.LogTag, "Failed to add service solicitation uuid to advertising data- " + (BluetoothError)ret); - BluetoothErrorFactory.ThrowBluetoothException(ret); - } - } - else - { - BluetoothErrorFactory.ThrowBluetoothException((int)BluetoothError.NotEnabled); - } - } - - /// - /// Clears all data to be advertised or responded to the scan request from the LE scanning device. - /// - /// - /// The Bluetooth must be enabled. - /// - /// The packet type to be cleared. - /// Thrown when the Bluetooth LE is not supported. - /// Thrown when the Bluetooth LE is not enabled - /// or when the clear advertising data procedure fails. - internal void ClearAdvertisingData(BluetoothLePacketType packetType) - { - if (BluetoothAdapter.IsBluetoothEnabled && Globals.IsInitialize) - { - int ret = Interop.Bluetooth.ClearAdvertisingData (GetHandle (), packetType); - if (ret != (int)BluetoothError.None) { - Log.Error (Globals.LogTag, "Failed to Clear Advertising Data- " + (BluetoothError)ret); - } - } - else - { - BluetoothErrorFactory.ThrowBluetoothException((int)BluetoothError.NotEnabled); - } - } - } -} diff --git a/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothLeAdapterImpl.cs b/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothLeAdapterImpl.cs deleted file mode 100644 index 1fb02de8d..000000000 --- a/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothLeAdapterImpl.cs +++ /dev/null @@ -1,452 +0,0 @@ -/* - * 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.Collections.Generic; -using System.Collections.Specialized; -using System.Threading.Tasks; -using System.Runtime.InteropServices; - -namespace Tizen.Network.Bluetooth -{ - internal class BluetoothLeImplAdapter : IDisposable - { - private static readonly BluetoothLeImplAdapter _instance = new BluetoothLeImplAdapter(); - - private bool disposed = false; - - private event EventHandler _adapterLeScanResultChanged = null; - private Interop.Bluetooth.AdapterLeScanResultChangedCallBack _adapterLeScanResultChangedCallback; - - private event EventHandler _advertisingStateChanged = null; - private Interop.Bluetooth.AdvertisingStateChangedCallBack _advertisingStateChangedCallback; - - private event EventHandler _gattConnectionStateChanged = null; - private Interop.Bluetooth.GattConnectionStateChangedCallBack _gattConnectionStateChangedCallback; - - private int _serviceListCount = 0; - private IList _list = new List(); - private bool _scanStarted; - - internal static BluetoothLeImplAdapter Instance - { - get - { - return _instance; - } - } - - private BluetoothLeImplAdapter() - { - } - - ~BluetoothLeImplAdapter() - { - Dispose(false); - } - - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - - private void Dispose(bool disposing) - { - if (disposed) - return; - - if (disposing) - { - // Free managed objects. - } - //Free unmanaged objects - if (_gattConnectionStateChanged != null) - { - UnRegisterGattConnectionStateChangedEvent(); - } - - //stop scan operation in progress - StopScan (); - - disposed = true; - } - - internal event EventHandler AdapterLeScanResultChanged - { - add - { - _adapterLeScanResultChanged += value; - } - remove { - _adapterLeScanResultChanged -= value; - } - } - - internal event EventHandler AdapterLeAdvertisingStateChanged - { - add - { - _advertisingStateChanged += value; - } - remove - { - _advertisingStateChanged -= value; - } - } - - internal event EventHandler LeGattConnectionStateChanged - { - add - { - if (_gattConnectionStateChanged == null) - { - RegisterGattConnectionStateChangedEvent(); - } - _gattConnectionStateChanged += value; - } - remove - { - _gattConnectionStateChanged -= value; - if (_gattConnectionStateChanged == null) - { - UnRegisterGattConnectionStateChangedEvent(); - } - } - } - - internal void RegisterGattConnectionStateChangedEvent() - { - _gattConnectionStateChangedCallback = (int result, bool connected, - string remoteDeviceAddress, IntPtr userData) => - { - if (_gattConnectionStateChanged != null) - { - Log.Info(Globals.LogTag, "Setting gatt connection state changed callback" ); - GattConnectionStateChangedEventArgs e = new GattConnectionStateChangedEventArgs (result, - connected, remoteDeviceAddress); - - _gattConnectionStateChanged(null, e); - } - }; - - int ret = Interop.Bluetooth.SetGattConnectionStateChangedCallback( - _gattConnectionStateChangedCallback, IntPtr.Zero); - if (ret != (int)BluetoothError.None) - { - Log.Error(Globals.LogTag, "Failed to set gatt connection state changed callback, Error - " + (BluetoothError)ret); - } - } - - internal void UnRegisterGattConnectionStateChangedEvent() - { - int ret = Interop.Bluetooth.UnsetGattConnectionStateChangedCallback(); - if (ret != (int)BluetoothError.None) - { - Log.Error(Globals.LogTag, "Failed to unset gatt connection state changed callback, Error - " + (BluetoothError)ret); - } - } - - internal int StartScan() - { - _adapterLeScanResultChangedCallback = (int result, ref BluetoothLeScanDataStruct scanData, IntPtr userData) => - { - Log.Info(Globals.LogTag, "Inside Le scan callback " ); - BluetoothLeScanData scanDataInfo = BluetoothUtils.ConvertStructToLeScanData(scanData); - - BluetoothLeDevice device = new BluetoothLeDevice(scanDataInfo); - BluetoothError res = (BluetoothError)result; - - AdapterLeScanResultChangedEventArgs e = new AdapterLeScanResultChangedEventArgs (res, - device); - _adapterLeScanResultChanged (null, e); - }; - - IntPtr data = IntPtr.Zero; - int ret = Interop.Bluetooth.StartScan(_adapterLeScanResultChangedCallback, data); - if (ret != (int)BluetoothError.None) - { - Log.Error(Globals.LogTag, "Failed to start BLE scan - " + (BluetoothError)ret); - BluetoothErrorFactory.ThrowBluetoothException(ret); - } - _scanStarted = true; - return ret; - } - - internal int StopScan() - { - int ret = (int)BluetoothError.None; - - if (_scanStarted) - { - ret = Interop.Bluetooth.StopScan (); - if (ret != (int)BluetoothError.None) { - Log.Error (Globals.LogTag, "Failed to stop BLE scan - " + (BluetoothError)ret); - BluetoothErrorFactory.ThrowBluetoothException (ret); - } - } - return ret; - } - - internal IList GetLeScanResultServiceUuids(BluetoothLeScanData scanData, BluetoothLePacketType packetType) - { - IntPtr uuidListArray = IntPtr.Zero; - int count = -1; - - BluetoothLeScanDataStruct scanDataStruct = BluetoothUtils.ConvertLeScanDataToStruct(scanData); - - int ret = Interop.Bluetooth.GetScanResultServiceUuid(ref scanDataStruct, packetType, - ref uuidListArray, ref count); - if (ret != (int)BluetoothError.None) - { - Log.Info(Globals.LogTag, "Failed to service uuids list- " + (BluetoothError)ret); - return null; - } - - Log.Info(Globals.LogTag, "count of uuids : " + count); - - IntPtr[] uuidList = new IntPtr[count]; - Marshal.Copy(uuidListArray, uuidList, 0, count); - IList list = new List(); - foreach(IntPtr uuids in uuidList) - { - list.Add(Marshal.PtrToStringAnsi(uuids)); - Interop.Libc.Free(uuids); - } - - Interop.Libc.Free(uuidListArray); - return list; - } - - internal string GetLeScanResultDeviceName(BluetoothLeScanData scanData, BluetoothLePacketType packetType) - { - string deviceName; - - BluetoothLeScanDataStruct scanDataStruct = BluetoothUtils.ConvertLeScanDataToStruct (scanData); - - int ret = Interop.Bluetooth.GetLeScanResultDeviceName(ref scanDataStruct, packetType, out deviceName); - if (ret != (int)BluetoothError.None) { - Log.Error(Globals.LogTag, "Failed to get Device name- " + (BluetoothError)ret); - return null; - } - Log.Info (Globals.LogTag, "Device name " + deviceName); - return deviceName; - } - - internal int GetScanResultTxPowerLevel(BluetoothLeScanData scanData, BluetoothLePacketType packetType) - { - int powerLevel = -1; - BluetoothLeScanDataStruct scanDataStruct = BluetoothUtils.ConvertLeScanDataToStruct (scanData); - - int ret = Interop.Bluetooth.GetScanResultTxPowerLevel(ref scanDataStruct, packetType, out powerLevel); - if (ret != (int)BluetoothError.None) { - Log.Error(Globals.LogTag, "Failed to get tx power level- " + (BluetoothError)ret); - } - Log.Info (Globals.LogTag, "TxPowerLevel is --- " + powerLevel); - return powerLevel; - } - - internal IList GetScanResultSvcSolicitationUuids(BluetoothLeScanData scanData, BluetoothLePacketType packetType) - { - IntPtr uuidListArray; - int count; - - BluetoothLeScanDataStruct scanDataStruct = BluetoothUtils.ConvertLeScanDataToStruct(scanData); - - int ret = Interop.Bluetooth.GetScaResultSvcSolicitationUuids(ref scanDataStruct, packetType, out uuidListArray, out count); - if (ret != (int)BluetoothError.None) { - Log.Error(Globals.LogTag, "Failed to get service solicitation uuids " + (BluetoothError)ret); - return null; - } - - IntPtr[] uuidList = new IntPtr[count]; - Marshal.Copy(uuidListArray, uuidList, 0, count); - IList list = new List(); - foreach(IntPtr uuids in uuidList) - { - list.Add(Marshal.PtrToStringAnsi(uuids)); - Interop.Libc.Free(uuids); - } - - Interop.Libc.Free(uuidListArray); - return list; - } - - internal IList GetScanResultServiceDataList(BluetoothLeScanData scanData, - BluetoothLePacketType packetType, out int serviceCount) - { - int ret = 0; - IntPtr serviceListArray; - _serviceListCount = 0; - - BluetoothLeScanDataStruct scanDataStruct = BluetoothUtils.ConvertLeScanDataToStruct (scanData); - - ret = Interop.Bluetooth.GetScanResultServiceDataList(ref scanDataStruct, packetType, out serviceListArray, out _serviceListCount); - Log.Info(Globals.LogTag, "ServiceListCount : " + _serviceListCount + " PacketType : " + packetType + " Error: " + (BluetoothError)ret); - if (ret != (int)BluetoothError.None) - { - Log.Info(Globals.LogTag, "Failed to get Service Data List, Error - " + (BluetoothError)ret); - serviceCount = 0; - Marshal.FreeHGlobal(serviceListArray); - Marshal.FreeHGlobal(scanDataStruct.AdvData); - Marshal.FreeHGlobal(scanDataStruct.ScanData); - return null; - } - - BluetoothLeServiceDataStruct[] svcList = new BluetoothLeServiceDataStruct[_serviceListCount]; - int sizePointerToABC = Marshal.SizeOf(new BluetoothLeServiceDataStruct()); - for (int i = 0; i < _serviceListCount; i++) - { - svcList[i] = (BluetoothLeServiceDataStruct)Marshal.PtrToStructure(new IntPtr(serviceListArray.ToInt32() + (i * sizePointerToABC)), typeof(BluetoothLeServiceDataStruct)); - Log.Info(Globals.LogTag, " Uuid : " + svcList[i].ServiceUuid + "length : " + svcList[i].ServiceDataLength); - - _list.Add(BluetoothUtils.ConvertStructToLeServiceData(svcList[i])); - } - - serviceCount = _serviceListCount; - - Interop.Libc.Free(serviceListArray); - Marshal.FreeHGlobal(scanDataStruct.AdvData); - Marshal.FreeHGlobal(scanDataStruct.ScanData); - return _list; - } - - internal int FreeServiceDataList() - { - if (_list.Count > 0) - { - int iServiceDataSize = Marshal.SizeOf(typeof(BluetoothLeServiceData)); - IntPtr structServiceData = Marshal.AllocHGlobal(iServiceDataSize); - Marshal.StructureToPtr(_list, structServiceData, false); - - int ret = Interop.Bluetooth.FreeServiceDataList(structServiceData, _serviceListCount); - if (ret != (int)BluetoothError.None) - { - Log.Error(Globals.LogTag, "Failed to free Service Data List, Error - " + (BluetoothError)ret); - BluetoothErrorFactory.ThrowBluetoothException(ret); - } - - Marshal.FreeHGlobal(structServiceData); - } - return 0; - } - - internal int GetScanResultAppearance(BluetoothLeScanData scanData, BluetoothLePacketType packetType) - { - int appearance; - - BluetoothLeScanDataStruct scanDataStruct = BluetoothUtils.ConvertLeScanDataToStruct (scanData); - - int ret = Interop.Bluetooth.GetScanResultAppearance(ref scanDataStruct, packetType, out appearance); - if (ret != (int)BluetoothError.None) { - Log.Error(Globals.LogTag, "Failed to get Appearance value- " + (BluetoothError)ret); - } - return appearance; - } - - internal ManufacturerData GetScanResultManufacturerData(BluetoothLeScanData scanData, BluetoothLePacketType packetType) - { - int dataId = 0; - int dataLength = 0; - IntPtr manufData; - - BluetoothLeScanDataStruct scanDataStruct = BluetoothUtils.ConvertLeScanDataToStruct (scanData); - ManufacturerData data = new ManufacturerData(); - - int ret = Interop.Bluetooth.GetScanResultManufacturerData(ref scanDataStruct, packetType, out dataId, - out manufData, out dataLength); - if (ret != (int)BluetoothError.None) - { - Log.Error(Globals.LogTag, "Failed to get Manufacturer data - " + (BluetoothError)ret); - return null; - } - - data.Id = dataId; - data.DataLength = dataLength; - if (data.DataLength > 0) - { - data.Data = new byte[data.DataLength]; - Marshal.Copy(manufData, data.Data, 0, data.DataLength); - } - - return data; - } - - internal int GattConnect(string remoteAddress, bool autoConnect) - { - int ret = Interop.Bluetooth.GattConnect (remoteAddress, autoConnect); - if (ret != (int)BluetoothError.None) - { - Log.Error(Globals.LogTag, "Failed to establish GATT connection - " + (BluetoothError)ret); - BluetoothErrorFactory.ThrowBluetoothException(ret); - } - return ret; - } - - internal int GattDisconnect(string remoteAddress) - { - int ret = Interop.Bluetooth.GattDisconnect (remoteAddress); - if (ret != (int)BluetoothError.None) - { - Log.Error(Globals.LogTag, "Failed to disconnect GATT connection - " + (BluetoothError)ret); - BluetoothErrorFactory.ThrowBluetoothException(ret); - } - return ret; - } - - internal int CreateAdvertiser(out IntPtr advertiserHandle) - { - return Interop.Bluetooth.CreateAdvertiser (out advertiserHandle); - } - - internal int DestroyAdvertiser(IntPtr advertiserHandle) - { - int ret = Interop.Bluetooth.DestroyAdvertiser (advertiserHandle); - if (ret != (int)BluetoothError.None) { - Log.Error(Globals.LogTag, "Failed to destroy the Advertiser- " + (BluetoothError)ret); - BluetoothErrorFactory.ThrowBluetoothException(ret); - } - return ret; - } - - internal int StartAdvertising(IntPtr advertisingHandle) - { - _advertisingStateChangedCallback = (int result, IntPtr advertiserHandle, - BluetoothLeAdvertisingState state, IntPtr userData) => - { - Log.Info(Globals.LogTag, "Setting advertising state changed callback !! " ); - AdvertisingStateChangedEventArgs e = new AdvertisingStateChangedEventArgs(result, advertiserHandle, state); - _advertisingStateChanged(null, e); - }; - - IntPtr uData = IntPtr.Zero; - int ret = Interop.Bluetooth.BluetoothLeStartAdvertising (advertisingHandle, - _advertisingStateChangedCallback, uData ); - if (ret != (int)BluetoothError.None) - { - Log.Error(Globals.LogTag, "Failed to start BLE advertising - " + (BluetoothError)ret); - BluetoothErrorFactory.ThrowBluetoothException(ret); - } - return ret; - } - - - internal int StopAdvertising(IntPtr advertisingHandle) - { - return Interop.Bluetooth.BluetoothLeStopAdvertising (advertisingHandle); - } - } -} diff --git a/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothOpp.cs b/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothOpp.cs deleted file mode 100644 index 196351043..000000000 --- a/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothOpp.cs +++ /dev/null @@ -1,402 +0,0 @@ -/* - * 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.Network.Bluetooth -{ - /// - /// A class which is used to handle the connection and send and receive the object over Opp profile. - /// - /// http://tizen.org/privilege/bluetooth - public class BluetoothOppServer - { - private static BluetoothOppServerImpl _impl; - private static BluetoothOppServer _instance; - - public BluetoothOppServer() - { - _impl = BluetoothOppServerImpl.Instance; - } - - /// - /// (event) ConnectionRequested is called when OPP client requests for connection. - /// - public event EventHandler ConnectionRequested - { - add - { - _impl.ConnectionRequested += value; - } - remove - { - _impl.ConnectionRequested -= value; - } - } - - /// - /// (event) TransferProgress is called when the file transfer state is changed. - /// - public event EventHandler TransferProgress - { - add - { - _impl.TransferProgress += value; - } - remove - { - _impl.TransferProgress -= value; - } - } - - /// - /// (event) TransferFinished is called when the file tranfser is completed. - /// - public event EventHandler TransferFinished - { - add - { - _impl.TransferFinished += value; - } - remove - { - _impl.TransferFinished -= value; - } - } - /// - /// Register the Opp Server with the Opp service. - /// - /// - /// The device must be bonded with remote device by CreateBond(). - /// If connection request is received from OPP Client, ConnectionRequested event will be invoked. - /// - /// Path to store the files. - /// http://tizen.org/feature/network.bluetooth.opp - /// Thrown when the required feature is not Supported. - /// Thrown when the BT/BTLE is not Supported. - /// Thrown when the BT/BTLE is not Enabled or Other Bluetooth Errors. - public static BluetoothOppServer StartServer(string FilePath) - { - if (BluetoothAdapter.IsBluetoothEnabled && Globals.IsInitialize) - { - if (_instance == null) - { - BluetoothOppServer server = new BluetoothOppServer(); - if (server != null) - _instance = server; - } - int ret = _impl.StartServer(FilePath); - if (ret != (int)BluetoothError.None) - { - Log.Error(Globals.LogTag, "Failed to Opp Start Server - " + (BluetoothError)ret); - BluetoothErrorFactory.ThrowBluetoothException(ret); - } - return _instance; - } - else - { - BluetoothErrorFactory.ThrowBluetoothException((int)BluetoothError.NotEnabled); - } - return null; - } - - /// - /// Stops the Opp Server. - /// - /// http://tizen.org/feature/network.bluetooth.opp - /// Thrown when the required feature is not Supported. - /// Thrown when the BT/BTLE is not Supported. - /// Thrown when the BT/BTLE is not Enabled or Other Bluetooth Errors. - public void StopServer() - { - if (BluetoothAdapter.IsBluetoothEnabled && Globals.IsInitialize) - { - int ret = _impl.StopServer(); - if (ret != (int)BluetoothError.None) - { - Log.Error(Globals.LogTag, "Failed to Stop the Opp Server - " + (BluetoothError)ret); - BluetoothErrorFactory.ThrowBluetoothException(ret); - } - else - { - if (_instance != null) - _instance = null; - } - } - else - { - BluetoothErrorFactory.ThrowBluetoothException((int)BluetoothError.NotEnabled); - } - } - - /// - /// Accept File Push request. - /// - /// File name to accept. - /// http://tizen.org/feature/network.bluetooth.opp - /// Thrown when the required feature is not Supported. - /// Thrown when the BT/BTLE is not Supported. - /// Thrown when the BT/BTLE is not Enabled or Other Bluetooth Errors. - public int AcceptPush(string FileName) - { - int _transitionId = -1; - if (BluetoothAdapter.IsBluetoothEnabled && Globals.IsInitialize) - { - int ret = _impl.AcceptPush(FileName, out _transitionId); - if (ret != (int)BluetoothError.None) - { - Log.Error(Globals.LogTag, "Failed to Accept Push - " + (BluetoothError)ret); - BluetoothErrorFactory.ThrowBluetoothException(ret); - } - } - else - { - BluetoothErrorFactory.ThrowBluetoothException((int)BluetoothError.NotEnabled); - } - return _transitionId; - } - - /// - /// Reject File Push request. - /// - /// http://tizen.org/feature/network.bluetooth.opp - /// Thrown when the required feature is not Supported. - /// Thrown when the BT/BTLE is not Supported. - /// Thrown when the BT/BTLE is not Enabled or Other Bluetooth Errors. - public void RejectPush() - { - if (BluetoothAdapter.IsBluetoothEnabled && Globals.IsInitialize) - { - int ret = _impl.RejectPush(); - if (ret != (int)BluetoothError.None) - { - Log.Error(Globals.LogTag, "Failed to Reject Push - " + (BluetoothError)ret); - BluetoothErrorFactory.ThrowBluetoothException(ret); - } - } - else - { - BluetoothErrorFactory.ThrowBluetoothException((int)BluetoothError.NotEnabled); - } - } - - /// - /// Cancel the ongoing transfer session. - /// - /// tranfer ID. - /// http://tizen.org/feature/network.bluetooth.opp - /// Thrown when the required feature is not Supported. - /// Thrown when the BT/BTLE is not Supported. - /// Thrown when the BT/BTLE is not Enabled or Other Bluetooth Errors. - public void CancelTransfer(int TransferId) - { - if (BluetoothAdapter.IsBluetoothEnabled && Globals.IsInitialize) - { - int ret = _impl.CancelTransferId(TransferId); - if (ret != (int)BluetoothError.None) - { - Log.Error(Globals.LogTag, "Failed to Cancel Transfer - " + (BluetoothError)ret); - BluetoothErrorFactory.ThrowBluetoothException(ret); - } - } - else - { - BluetoothErrorFactory.ThrowBluetoothException((int)BluetoothError.NotEnabled); - } - } - - /// - /// Cancel the ongoing transfer session. - /// - /// Path to store the files. - /// http://tizen.org/feature/network.bluetooth.opp - /// Thrown when the required feature is not Supported. - /// Thrown when the BT/BTLE is not Supported. - /// Thrown when the BT/BTLE is not Enabled or Other Bluetooth Errors. - public void SetDestinationPath(string FilePath) - { - if (BluetoothAdapter.IsBluetoothEnabled && Globals.IsInitialize) - { - int ret = _impl.SetDestinationPath(FilePath); - if (ret != (int)BluetoothError.None) - { - Log.Error(Globals.LogTag, "Failed to Set Destination Path - " + (BluetoothError)ret); - BluetoothErrorFactory.ThrowBluetoothException(ret); - } - } - else - { - BluetoothErrorFactory.ThrowBluetoothException((int)BluetoothError.NotEnabled); - } - } - } - - /// - /// A class which is used to handle the connection and send and receive the object over Opp profile. - /// - /// http://tizen.org/privilege/bluetooth - public class BluetoothOppClient : BluetoothProfile - { - internal BluetoothOppClient() - { - } - - /// - /// (event) PushResponded is called when remote OPP Server responds to a File push request. - /// - public event EventHandler PushResponded - { - add - { - BluetoothOppClientImpl.Instance.PushResponded += value; - } - remove - { - BluetoothOppClientImpl.Instance.PushResponded -= value; - } - } - - /// - /// (event) PushProgress is called when the file transfer state is changed. - /// - public event EventHandler PushProgress - { - add - { - BluetoothOppClientImpl.Instance.PushProgress += value; - } - remove - { - BluetoothOppClientImpl.Instance.PushProgress -= value; - } - } - - /// - /// (event) PushFinished is called when the file tranfser is completed. - /// - public event EventHandler PushFinished - { - add - { - BluetoothOppClientImpl.Instance.PushFinished += value; - } - remove - { - BluetoothOppClientImpl.Instance.PushFinished -= value; - } - } - - /// - /// Add File path to be pushed. - /// - /// file for sending. - /// http://tizen.org/feature/network.bluetooth.opp - /// Thrown when the required feature is not Supported. - /// Thrown when the BT/BTLE is not Supported. - /// Thrown when the BT/BTLE is not Enabled or Other Bluetooth Errors. - public void AddFile(string FilePath) - { - if (BluetoothAdapter.IsBluetoothEnabled && Globals.IsInitialize) - { - int ret = BluetoothOppClientImpl.Instance.AddFile(FilePath); - if (ret != (int)BluetoothError.None) - { - Log.Error(Globals.LogTag, "Failed to Set File Path - " + (BluetoothError)ret); - BluetoothErrorFactory.ThrowBluetoothException(ret); - } - } - else - { - BluetoothErrorFactory.ThrowBluetoothException((int)BluetoothError.NotEnabled); - } - } - - /// - /// Clears all the File paths. - /// - /// http://tizen.org/feature/network.bluetooth.opp - /// Thrown when the required feature is not Supported. - /// Thrown when the BT/BTLE is not Supported. - /// Thrown when the BT/BTLE is not Enabled or Other Bluetooth Errors. - public void ClearFiles() - { - if (BluetoothAdapter.IsBluetoothEnabled && Globals.IsInitialize) - { - int ret = BluetoothOppClientImpl.Instance.ClearFile(); - if (ret != (int)BluetoothError.None) - { - Log.Error(Globals.LogTag, "Failed to Clear the Files - " + (BluetoothError)ret); - BluetoothErrorFactory.ThrowBluetoothException(ret); - } - } - else - { - BluetoothErrorFactory.ThrowBluetoothException((int)BluetoothError.NotEnabled); - } - } - - /// - /// Cancels the ongoing push session. - /// - /// http://tizen.org/feature/network.bluetooth.opp - /// Thrown when the required feature is not Supported. - /// Thrown when the BT/BTLE is not Supported. - /// Thrown when the BT/BTLE is not Enabled or Other Bluetooth Errors. - public void CancelPush() - { - if (BluetoothAdapter.IsBluetoothEnabled && Globals.IsInitialize) - { - int ret = BluetoothOppClientImpl.Instance.CancelPush(); - if (ret != (int)BluetoothError.None) - { - Log.Error(Globals.LogTag, "Failed to Cancel Push Operation - " + (BluetoothError)ret); - BluetoothErrorFactory.ThrowBluetoothException(ret); - } - } - else - { - BluetoothErrorFactory.ThrowBluetoothException((int)BluetoothError.NotEnabled); - } - } - - /// - /// Pushes the file set through AddFile. - /// - /// destination device address. - /// http://tizen.org/feature/network.bluetooth.opp - /// Thrown when the required feature is not Supported. - /// Thrown when the BT/BTLE is not Supported. - /// Thrown when the BT/BTLE is not Enabled or Other Bluetooth Errors. - public void PushFile(string Destination) - { - if (BluetoothAdapter.IsBluetoothEnabled && Globals.IsInitialize) - { - int ret = BluetoothOppClientImpl.Instance.PushFile(Destination); - if (ret != (int)BluetoothError.None) - { - Log.Error(Globals.LogTag, "Failed to Cancel Push Operation - " + (BluetoothError)ret); - BluetoothErrorFactory.ThrowBluetoothException(ret); - } - } - else - { - BluetoothErrorFactory.ThrowBluetoothException((int)BluetoothError.NotEnabled); - } - } - } -} - diff --git a/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothOppImpl.cs b/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothOppImpl.cs deleted file mode 100644 index a2fefad6c..000000000 --- a/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothOppImpl.cs +++ /dev/null @@ -1,363 +0,0 @@ -/* - * 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.Network.Bluetooth -{ - internal class BluetoothOppServerImpl - { - private event EventHandler _ConnectionRequested; - private Interop.Bluetooth.ConnectionRequestedCallback _ConnectionRequestedCallback; - - private event EventHandler _TransferProgress; - private Interop.Bluetooth.TransferProgressCallback _TransferProgressCallback; - - private event EventHandler _TransferFinished; - private Interop.Bluetooth.TransferFinishedCallback _TransferFinishedCallback; - - private static readonly BluetoothOppServerImpl _instance = new BluetoothOppServerImpl(); - - internal event EventHandler ConnectionRequested - { - add - { - _ConnectionRequested += value; - } - remove - { - //nothing to be done - } - } - - internal event EventHandler TransferProgress - { - add - { - _TransferProgress += value; - } - remove - { - //nothing to be done - } - } - - internal event EventHandler TransferFinished - { - add - { - _TransferFinished += value; - } - remove - { - //nothing to be done - } - } - - internal int StartServer(string filePath) - { - _ConnectionRequestedCallback = (string devAddress, IntPtr userData) => - { - _ConnectionRequested?.Invoke(null, new ConnectionRequestedEventArgs(devAddress)); - }; - - int ret = Interop.Bluetooth.InitializeOppServerCustom(filePath, _ConnectionRequestedCallback, IntPtr.Zero); - if (ret != (int)BluetoothError.None) - { - Log.Error(Globals.LogTag, "Failed to start bluetooth opp server, Error - " + (BluetoothError)ret); - BluetoothErrorFactory.ThrowBluetoothException(ret); - } - else - { - Globals.IsOppServerInitialized = true; - } - return ret; - } - - internal int StopServer() - { - if (Globals.IsOppServerInitialized) - { - int ret = Interop.Bluetooth.DinitializeOppServer(); - if (ret != (int)BluetoothError.None) { - Log.Error (Globals.LogTag, "Failed to stop bluetooth opp server, Error - " + (BluetoothError)ret); - } - return ret; - } - return (int)BluetoothError.NotInitialized; - } - - internal int AcceptPush(string name, out int _transferId) - { - _transferId = -1; - if (Globals.IsOppServerInitialized) - { - _TransferProgressCallback = (string file, long size, int percent, IntPtr userData) => - { - _TransferProgress?.Invoke(null, new TransferProgressEventArgs(file, size, percent)); - }; - - _TransferFinishedCallback = (int result, string file, long size, IntPtr userData) => - { - _TransferFinished?.Invoke(null, new TransferFinishedEventArgs(result, file, size)); - }; - - int ret = Interop.Bluetooth.OppServerAcceptPush(_TransferProgressCallback, _TransferFinishedCallback, name, IntPtr.Zero, out _transferId); - if (ret != (int)BluetoothError.None) - { - Log.Error(Globals.LogTag, "Failed to accept the push request, Error - " + (BluetoothError)ret); - } - return ret; - } - return (int)BluetoothError.NotInitialized; - } - - internal int RejectPush() - { - if (Globals.IsOppServerInitialized) - { - int ret = Interop.Bluetooth.OppServerRejectPush(); - if (ret != (int)BluetoothError.None) - { - Log.Error(Globals.LogTag, "Failed to reject the push request, Error - " + (BluetoothError)ret); - } - return ret; - } - return (int)BluetoothError.NotInitialized; - } - - internal int CancelTransferId(int TransferId) - { - if (Globals.IsOppServerInitialized) - { - int ret = Interop.Bluetooth.OppServerCancelTransfer(TransferId); - if (ret != (int)BluetoothError.None) - { - Log.Error(Globals.LogTag, "Failed to cancel the transferid " + TransferId + " Error - " + (BluetoothError)ret); - } - return ret; - } - return (int)BluetoothError.NotInitialized; - } - - internal int SetDestinationPath(string path) - { - if (Globals.IsOppServerInitialized) - { - int ret = Interop.Bluetooth.OppServerSetDestinationPath(path); - if (ret != (int)BluetoothError.None) - { - Log.Error(Globals.LogTag, "Failed to Set the desitination path " + path + " Error - " + (BluetoothError)ret); - } - return ret; - } - return (int)BluetoothError.NotInitialized; - } - - internal static BluetoothOppServerImpl Instance - { - get - { - return _instance; - } - } - } - - internal class BluetoothOppClientImpl - { - private event EventHandler _PushResponded; - private Interop.Bluetooth.PushRespondedCallback _PushRespondedCallback; - - private event EventHandler _PushProgress; - private Interop.Bluetooth.PushProgressCallback _PushProgressCallback; - - private event EventHandler _PushFinished; - private Interop.Bluetooth.PushFinishedCallback _PushFinishedCallback; - - private static readonly BluetoothOppClientImpl _instance = new BluetoothOppClientImpl(); - - internal event EventHandler PushResponded - { - add - { - _PushResponded += value; - } - remove - { - //nothing to be done - } - } - - internal event EventHandler PushProgress - { - add - { - _PushProgress += value; - } - remove - { - //nothing to be done - } - } - - internal event EventHandler PushFinished - { - add - { - _PushFinished += value; - } - remove - { - //nothing to be done - } - } - - private BluetoothOppClientImpl() - { - Log.Info(Globals.LogTag, "Initializing OppClient"); - initialize(); - } - - ~BluetoothOppClientImpl() - { - deinitialize(); - } - - internal int AddFile(string filePath) - { - - if (Globals.IsOppClientInitialized) - { - int ret = Interop.Bluetooth.OppClientAddFile(filePath); - if (ret != (int)BluetoothError.None) - { - Log.Error(Globals.LogTag, "Failed to Add File, Error - " + (BluetoothError)ret); - } - return ret; - } - return (int)BluetoothError.NotInitialized; - } - - internal int ClearFile() - { - - if (Globals.IsOppClientInitialized) - { - int ret = Interop.Bluetooth.OppClientClearFiles(); - if (ret != (int)BluetoothError.None) - { - Log.Error(Globals.LogTag, "Failed to Clear Files, Error - " + (BluetoothError)ret); - } - return ret; - } - return (int)BluetoothError.NotInitialized; - } - - internal int CancelPush() - { - - if (Globals.IsOppClientInitialized) - { - int ret = Interop.Bluetooth.OppClientCancelPush(); - if (ret != (int)BluetoothError.None) - { - Log.Error(Globals.LogTag, "Failed to Clear Files, Error - " + (BluetoothError)ret); - } - return ret; - } - return (int)BluetoothError.NotInitialized; - } - - internal int PushFile(string Destination) - { - - if (Globals.IsOppClientInitialized) - { - _PushRespondedCallback = (int result, string address, IntPtr userData) => - { - _PushResponded?.Invoke(null, new PushRespondedEventArgs(result, address)); - }; - - _PushProgressCallback = (string file, long size, int percent, IntPtr userData) => - { - _PushProgress?.Invoke(null, new PushProgressEventArgs(file, size, percent)); - }; - - _PushFinishedCallback = (int result, string address, IntPtr userData) => - { - _PushFinished?.Invoke(null, new PushFinishedEventArgs(result, address)); - }; - - int ret = Interop.Bluetooth.OppClientPushFile(Destination, _PushRespondedCallback, _PushProgressCallback, _PushFinishedCallback, IntPtr.Zero); - if (ret != (int)BluetoothError.None) - { - Log.Error(Globals.LogTag, "Failed to push File, Error - " + (BluetoothError)ret); - } - return ret; - } - return (int)BluetoothError.NotInitialized; - } - - private void initialize() - { - if (Globals.IsInitialize) - { - - int ret = Interop.Bluetooth.InitializeOppClient(); - if (ret != (int)BluetoothError.None) - { - Log.Error(Globals.LogTag, "Failed to initialize bluetooth Opp Client, Error - " + (BluetoothError)ret); - BluetoothErrorFactory.ThrowBluetoothException(ret); - } - else - { - Globals.IsOppClientInitialized = true; - } - } - else - { - Log.Error(Globals.LogTag, "Failed to initialize Opp Client, BT not initialized"); - BluetoothErrorFactory.ThrowBluetoothException((int)BluetoothError.NotInitialized); - } - } - - private void deinitialize() - { - if (Globals.IsOppClientInitialized) - { - int ret = Interop.Bluetooth.DeinitializeOppClient(); - if (ret != (int)BluetoothError.None) - { - Log.Error(Globals.LogTag, "Failed to deinitialize Opp Client, Error - " + (BluetoothError)ret); - BluetoothErrorFactory.ThrowBluetoothException(ret); - } - else - { - Globals.IsOppClientInitialized = false; - } - } - } - - internal static BluetoothOppClientImpl Instance - { - get - { - return _instance; - } - } - } -} - diff --git a/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothProfile.cs b/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothProfile.cs deleted file mode 100644 index 6be950a8f..000000000 --- a/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothProfile.cs +++ /dev/null @@ -1,28 +0,0 @@ -/* - * 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. - */ - -namespace Tizen.Network.Bluetooth -{ - /// - /// This generic class represents all Bluetooth profiles.
- /// Any common properties/functions can be added in this class in future. - ///
- /// http://tizen.org/privilege/bluetooth - public abstract class BluetoothProfile - { - internal string RemoteAddress { get; set; } - } -} diff --git a/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothServerSocket.cs b/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothServerSocket.cs deleted file mode 100644 index 3d4509b88..000000000 --- a/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothServerSocket.cs +++ /dev/null @@ -1,149 +0,0 @@ -/* - * 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.Collections.Generic; -using System.Runtime.InteropServices; - -namespace Tizen.Network.Bluetooth -{ - /// - /// The BluetoothSocket provides functions for managing connections to other devices and exchanging data. - /// - public class BluetoothServerSocket : IDisposable - { - private event EventHandler _acceptStateChanged; - private Interop.Bluetooth.SocketConnectionStateChangedCallback _connectionStateChangedCallback; - internal int socketFd; - private bool disposed = false; - - /// - /// The AcceptStateChanged event is raised when the socket connection state is changed. - /// - /// Thrown when the Bluetooth is not enabled - /// or when the register accpet state changed callback fails. - public event EventHandler AcceptStateChanged - { - add - { - if (_acceptStateChanged == null) - { - RegisterAcceptStateChangedEvent(); - } - _acceptStateChanged += value; - } - remove - { - _acceptStateChanged -= value; - if (_acceptStateChanged == null) - { - UnregisterAcceptStateChangedEvent(); - } - } - } - - private void RegisterAcceptStateChangedEvent() - { - _connectionStateChangedCallback = (int result, BluetoothSocketState connectionState, ref SocketConnectionStruct socketConnection, IntPtr userData) => - { - Log.Info(Globals.LogTag, "AcceptStateChanged cb is called"); - if (_acceptStateChanged != null) - { - BluetoothSocket socket = new BluetoothSocket(); - socket.connectedSocket = socketConnection.SocketFd; - GCHandle handle2 = (GCHandle) userData; - _acceptStateChanged(handle2.Target as BluetoothServerSocket, new AcceptStateChangedEventArgs((BluetoothError)result, connectionState, BluetoothUtils.ConvertStructToSocketConnection(socketConnection), socket)); - } - }; - GCHandle handle1 = GCHandle.Alloc(this); - IntPtr data = (IntPtr) handle1; - int ret = Interop.Bluetooth.SetConnectionStateChangedCallback(_connectionStateChangedCallback, data); - if (ret != (int)BluetoothError.None) - { - Log.Error(Globals.LogTag, "Failed to set accept state changed callback, Error - " + (BluetoothError)ret); - BluetoothErrorFactory.ThrowBluetoothException(ret); - } - } - - private void UnregisterAcceptStateChangedEvent() - { - int ret = Interop.Bluetooth.UnsetSocketConnectionStateChangedCallback(); - if (ret != (int)BluetoothError.None) - { - Log.Error(Globals.LogTag, "Failed to unset accept state changed callback, Error - " + (BluetoothError)ret); - BluetoothErrorFactory.ThrowBluetoothException(ret); - } - } - - internal BluetoothServerSocket(int socketFd) - { - Log.Info (Globals.LogTag, "Constructing server socket"); - this.socketFd = socketFd; - } - - /// - /// Starts listening on the passed RFCOMM socket and accepts connection requests. - /// - /// - /// The socket must be created with CreateServerSocket(). This API invokes the ConnectionStateChanged event. - /// - /// Thrown when the Bluetooth is not enabled - /// or when the listen on socket procedure fails. - public void Listen() - { - int ret = Interop.Bluetooth.Listen(socketFd, 1); - if (ret != (int)BluetoothError.None) - { - Log.Error(Globals.LogTag, "Failed to accept connection, Error - " + (BluetoothError)ret); - BluetoothErrorFactory.ThrowBluetoothException(ret); - } - } - - ~BluetoothServerSocket() - { - Dispose(false); - } - - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - - private void Dispose(bool disposing) - { - if (disposed) - return; - - if (disposing) - { - // Free managed objects. - } - //Free unmanaged objects - RemoveRegisteredEvents(); - disposed = true; - } - - private void RemoveRegisteredEvents() - { - //unregister all remaining events when this object is released. - if (_acceptStateChanged != null) - { - UnregisterAcceptStateChangedEvent(); - } - } - } -} diff --git a/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothSocket.cs b/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothSocket.cs deleted file mode 100644 index 5639cc2a3..000000000 --- a/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothSocket.cs +++ /dev/null @@ -1,265 +0,0 @@ -/* - * 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.Collections.Generic; -using System.Runtime.InteropServices; - -namespace Tizen.Network.Bluetooth -{ - /// - /// The IBluetoothServerSocket interface handles the server socket operations. - /// - public interface IBluetoothServerSocket - { - event EventHandler DataReceived; - event EventHandler ConnectionStateChanged; - int SendData(string data); - } - - /// - /// The IBluetoothClientSocket interface handles the client socket operations. - /// - public interface IBluetoothClientSocket : IBluetoothServerSocket - { - void Connect(); - void Disconnect(); - } - - internal class BluetoothSocket : IBluetoothClientSocket, IDisposable - { - private event EventHandler _dataReceived; - private event EventHandler _connectionStateChanged; - private Interop.Bluetooth.DataReceivedCallback _dataReceivedCallback; - private Interop.Bluetooth.SocketConnectionStateChangedCallback _connectionStateChangedCallback; - private bool disposed = false; - internal int connectedSocket; - internal string remoteAddress; - internal string serviceUuid; - - /// - /// This event occurs when the socket server receives data from the client. - /// - /// Thrown when the Bluetooth is not enabled - /// or when the register data received callback fails. - public event EventHandler DataReceived - { - add - { - if (_dataReceived == null) - { - RegisterDataReceivedEvent(); - } - _dataReceived += value; - } - remove - { - _dataReceived -= value; - if (_dataReceived == null) - { - UnregisterDataReceivedEvent(); - } - } - } - - /// - /// This event occurs when the connection state between two devices is changed. - /// - /// Thrown when the Bluetooth is not enabled - /// or when the register connection changed callback fails. - public event EventHandler ConnectionStateChanged - { - add - { - if (_connectionStateChanged == null) - { - RegisterConnectionStateChangedEvent(); - } - _connectionStateChanged += value; - } - remove - { - _connectionStateChanged -= value; - if (_connectionStateChanged == null) - { - UnregisterConnectionStateChangedEvent(); - } - } - } - - private void RegisterDataReceivedEvent() - { - _dataReceivedCallback = (ref SocketDataStruct socketData, IntPtr userData) => - { - Log.Info(Globals.LogTag, "DataReceivedCallback is called"); - if (_dataReceived != null) - { - GCHandle handle2 = (GCHandle) userData; - _dataReceived(handle2.Target as IBluetoothServerSocket, new SocketDataReceivedEventArgs(BluetoothUtils.ConvertStructToSocketData(socketData))); - } - }; - GCHandle handle1 = GCHandle.Alloc (this); - IntPtr uData = (IntPtr) handle1; - int ret = Interop.Bluetooth.SetDataReceivedCallback(_dataReceivedCallback, uData); - if (ret != (int)BluetoothError.None) - { - Log.Error(Globals.LogTag, "Failed to set data received callback, Error - " + (BluetoothError)ret); - BluetoothErrorFactory.ThrowBluetoothException(ret); - } - } - - private void UnregisterDataReceivedEvent() - { - int ret = Interop.Bluetooth.UnsetDataReceivedCallback(); - if (ret != (int)BluetoothError.None) - { - Log.Error(Globals.LogTag, "Failed to unset data received callback, Error - " + (BluetoothError)ret); - BluetoothErrorFactory.ThrowBluetoothException(ret); - } - } - - private void RegisterConnectionStateChangedEvent() - { - _connectionStateChangedCallback = (int result, BluetoothSocketState connectionState, ref SocketConnectionStruct socketConnection, IntPtr userData) => - { - Log.Info(Globals.LogTag, "ConnectionStateChangedCallback is called"); - if (_connectionStateChanged != null) - { - connectedSocket = socketConnection.SocketFd; - GCHandle handle2 = (GCHandle) userData; - _connectionStateChanged(handle2.Target as IBluetoothServerSocket, new SocketConnectionStateChangedEventArgs((BluetoothError)result, connectionState, BluetoothUtils.ConvertStructToSocketConnection(socketConnection))); - } - }; - GCHandle handle1 = GCHandle.Alloc(this); - IntPtr data = (IntPtr) handle1; - int ret = Interop.Bluetooth.SetConnectionStateChangedCallback(_connectionStateChangedCallback, data); - if (ret != (int)BluetoothError.None) - { - Log.Error(Globals.LogTag, "Failed to set connection state changed callback, Error - " + (BluetoothError)ret); - BluetoothErrorFactory.ThrowBluetoothException(ret); - } - } - - private void UnregisterConnectionStateChangedEvent() - { - int ret = Interop.Bluetooth.UnsetSocketConnectionStateChangedCallback(); - if (ret != (int)BluetoothError.None) - { - Log.Error(Globals.LogTag, "Failed to unset connection state changed callback, Error - " + (BluetoothError)ret); - BluetoothErrorFactory.ThrowBluetoothException(ret); - } - } - - /// - /// Connects to a specific RFCOMM based service on a remote Bluetooth device UUID. - /// - /// - /// The bluetooth must be enabled, discoverable with StartDiscovery(), and bonded with the remote device using CreateBond(). The ConnectionStateChanged event is raised once this API is called. - /// - /// The address of the remote Bluetooth device. - /// The UUID of the service provided by the remote Bluetooth device. - /// Thrown when the Bluetooth is not enabled - /// or when the connect socket attempt to remote device fails, or when the service UUID is not supported by the remote device. - void IBluetoothClientSocket.Connect() - { - int ret = Interop.Bluetooth.ConnectSocket(remoteAddress, serviceUuid); - if (ret != (int)BluetoothError.None) - { - Log.Error(Globals.LogTag, "Failed to connect to socket, Error - " + (BluetoothError)ret); - BluetoothErrorFactory.ThrowBluetoothException(ret); - } - } - - /// - /// Disconnects the RFCOMM connection with the given file descriptor of the conneted socket. - /// - /// - /// The connection must be established. - /// - /// The file descriptor of the socket to close. - /// Thrown when the Bluetooth is not enabled - /// or when the socket disconnect to remote device fails. - void IBluetoothClientSocket.Disconnect() - { - int ret = Interop.Bluetooth.DisconnectSocket(connectedSocket); - if (ret != (int)BluetoothError.None) - { - Log.Error(Globals.LogTag, "Failed to disconnect socket, Error - " + (BluetoothError)ret); - BluetoothErrorFactory.ThrowBluetoothException(ret); - } - } - - /// - /// Sends data to the connected device. - /// - /// The number of bytes written (zero indicates nothing was written). - /// - /// The connection must be established. - /// - /// The file descriptor of the connected socket. - /// The data to be sent. - /// Thrown when the Bluetooth is not enabled - /// or when the remote device is not connected, or the send data procedure fails. - public int SendData(string data) - { - int ret = Interop.Bluetooth.SendData(connectedSocket, data, data.Length); - if (ret < 0) - { - Log.Error(Globals.LogTag, "Failed to send data, Error - " + (BluetoothError)ret); - BluetoothErrorFactory.ThrowBluetoothException(ret); - } - return ret; - } - - ~BluetoothSocket() - { - Dispose(false); - } - - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - - private void Dispose(bool disposing) - { - if (disposed) - return; - - if (disposing) - { - // Free managed objects. - } - //Free unmanaged objects - RemoveRegisteredEvents(); - disposed = true; - } - - private void RemoveRegisteredEvents() - { - //unregister all remaining events when this object is released. - if (_dataReceived != null) - { - UnregisterDataReceivedEvent(); - } - if (_connectionStateChanged != null) - { - UnregisterConnectionStateChangedEvent(); - } - } - } -} diff --git a/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothStructs.cs b/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothStructs.cs deleted file mode 100644 index dcd53a265..000000000 --- a/src/Tizen.Network.Bluetooth/Tizen.Network.Bluetooth/BluetoothStructs.cs +++ /dev/null @@ -1,390 +0,0 @@ -/* - * 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.Reflection; -using System.Linq; -using System.Collections.Generic; -using System.Collections.ObjectModel; -using System.Collections.Specialized; -using System.Runtime.InteropServices; - -namespace Tizen.Network.Bluetooth -{ - /// - /// The structure of the device class type and service. - /// - [StructLayout(LayoutKind.Sequential)] - internal struct BluetoothClassStruct - { - /// - /// The type of the major device class. - /// - internal BluetoothMajorDeviceClassType MajorDeviceClassType; - /// - /// The type of the minor device class. - /// - internal BluetoothMinorDeviceClassType MinorDeviceClassType; - /// - /// The major service class mask. - /// - internal int MajorServiceClassMask; - } - - /// - /// This structure contains the information of the Bluetooth device. - /// - [StructLayout(LayoutKind.Sequential)] - internal struct BluetoothDeviceStruct - { - /// - /// The address of the device. - /// - [MarshalAsAttribute(UnmanagedType.LPStr)] - internal string Address; - - /// - /// The name of the device. - /// - [MarshalAsAttribute(UnmanagedType.LPStr)] - internal string Name; - - /// - /// The class of the device. - /// - internal BluetoothClassStruct Class; - - /// - /// The service UUID list of the device. - /// - internal IntPtr ServiceUuidList; - - /// - /// The service count of the device. - /// - internal int ServiceCount; - - /// - /// The paired state of the device. - /// - [MarshalAsAttribute(UnmanagedType.I1)] - internal bool IsPaired; - - /// - /// The connection state of the device. - /// - [MarshalAsAttribute(UnmanagedType.I1)] - internal bool IsConnected; - - /// - /// The authorization state of the device. - /// - [MarshalAsAttribute(UnmanagedType.I1)] - internal bool IsAuthorized; - - /// - /// The length of the manufacturer the data. - /// - internal int ManufacturerDataLength; - - /// - /// The manufacturer data. - /// - [MarshalAsAttribute(UnmanagedType.LPStr)] - internal string ManufacturerData; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct BluetoothDiscoveredDeviceStruct - { - [MarshalAsAttribute(UnmanagedType.LPStr)] - internal string Address; - - [MarshalAsAttribute(UnmanagedType.LPStr)] - internal string Name; - - internal BluetoothClassStruct Class; - - internal int Rssi; - - [MarshalAsAttribute(UnmanagedType.I1)] - internal bool IsPaired; - - internal IntPtr ServiceUuidList; - - internal int ServiceCount; - - internal BluetoothAppearanceType AppearanceType; - - internal int ManufacturerDataLength; - - [MarshalAsAttribute(UnmanagedType.LPStr)] - internal string ManufacturerData; - } - - internal struct BluetoothDeviceSdpStruct - { - [MarshalAsAttribute(UnmanagedType.LPStr)] - internal string DeviceAddress; - internal IntPtr ServiceUuid; - internal int ServiceCount; - } - - internal struct BluetoothDeviceConnectionStruct - { - internal string Address; - internal BluetoothConnectionLinkType LinkType; - internal BluetoothDisconnectReason DisconnectReason; - } - - internal struct SocketDataStruct - { - internal int SocketFd; - internal int DataSize; - internal IntPtr Data; - } - - internal struct SocketConnectionStruct - { - internal int SocketFd; - internal int ServerFd; - internal BluetoothSocketRole LocalRole; - internal string Address; - internal string ServiceUuid; - } - - ///
- [StructLayout(LayoutKind.Sequential)] - internal struct BluetoothLeScanDataStruct - { - [MarshalAsAttribute(UnmanagedType.LPStr)] - internal string RemoteAddress; - - internal BluetoothLeDeviceAddressType AddressType; - - internal int Rssi; - - internal int AdvDataLength; - - internal IntPtr AdvData; - - internal int ScanDataLength; - - internal IntPtr ScanData; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct BluetoothLeServiceDataStruct - { - /// - /// The Bluetooth LE service UUID. - /// - [MarshalAs(UnmanagedType.LPStr)] - internal string ServiceUuid; - /// - /// The Bluetooth LE service data. - /// - internal IntPtr ServiceData; - - internal int ServiceDataLength; - } - - internal static class BluetoothUtils - { - internal static BluetoothDevice ConvertStructToDeviceClass(BluetoothDeviceStruct device) - { - BluetoothDevice resultDevice = new BluetoothDevice(); - Collection uuidList = null; - - if (device.ServiceCount > 0) - { - IntPtr[] extensionList = new IntPtr[device.ServiceCount]; - Marshal.Copy (device.ServiceUuidList, extensionList, 0, device.ServiceCount); - uuidList = new Collection (); - foreach (IntPtr extension in extensionList) { - string uuid = Marshal.PtrToStringAnsi (extension); - uuidList.Add (uuid); - } - } - - resultDevice.RemoteDeviceAddress = device.Address; - resultDevice.RemoteDeviceName = device.Name; - resultDevice.RemoteDeviceClass = new BluetoothClass(); - resultDevice.Class.MajorType = device.Class.MajorDeviceClassType; - resultDevice.Class.MinorType = device.Class.MinorDeviceClassType; - resultDevice.Class.Mask = device.Class.MajorServiceClassMask; - resultDevice.RemotePaired = device.IsPaired; - resultDevice.RemoteConnected = device.IsConnected; - resultDevice.RemoteAuthorized = device.IsAuthorized; - resultDevice.RemoteDeviceService = uuidList; - resultDevice.RemoteDeviceCount = device.ServiceCount; - resultDevice.RemoteManufLength = device.ManufacturerDataLength; - resultDevice.RemoteManufData = device.ManufacturerData; - - return resultDevice; - } - - internal static BluetoothDevice ConvertStructToDiscoveredDevice(BluetoothDiscoveredDeviceStruct structDevice) - { - BluetoothDevice resultDevice = new BluetoothDevice(); - Collection uuidList = null; - - if (structDevice.ServiceCount > 0) { - IntPtr[] extensionList = new IntPtr[structDevice.ServiceCount]; - Marshal.Copy (structDevice.ServiceUuidList, extensionList, 0, structDevice.ServiceCount); - uuidList = new Collection (); - foreach (IntPtr extension in extensionList) { - string uuid = Marshal.PtrToStringAnsi (extension); - uuidList.Add (uuid); - } - } - - resultDevice.RemoteDeviceAddress = structDevice.Address; - resultDevice.RemoteDeviceName = structDevice.Name; - - resultDevice.RemoteDeviceClass = new BluetoothClass(); - resultDevice.Class.MajorType = structDevice.Class.MajorDeviceClassType; - resultDevice.Class.MinorType = structDevice.Class.MinorDeviceClassType; - resultDevice.Class.Mask = structDevice.Class.MajorServiceClassMask; - - resultDevice.RemoteDeviceRssi = structDevice.Rssi; - resultDevice.RemoteAppearance = structDevice.AppearanceType; - - if (structDevice.ServiceCount > 0) { - resultDevice.RemoteDeviceService = uuidList; - resultDevice.RemoteDeviceCount = structDevice.ServiceCount; - } - - resultDevice.RemotePaired = structDevice.IsPaired; - resultDevice.RemoteManufData = structDevice.ManufacturerData; - resultDevice.RemoteManufLength = structDevice.ManufacturerDataLength; - return resultDevice; - } - - internal static BluetoothDeviceSdpData ConvertStructToSdpData(BluetoothDeviceSdpStruct structData) - { - BluetoothDeviceSdpData resultData = new BluetoothDeviceSdpData(); - Collection uuidList = null; - - if (structData.ServiceCount > 0) { - IntPtr[] extensionList = new IntPtr[structData.ServiceCount]; - Marshal.Copy (structData.ServiceUuid, extensionList, 0, structData.ServiceCount); - uuidList = new Collection (); - foreach (IntPtr extension in extensionList) { - string uuid = Marshal.PtrToStringAnsi (extension); - uuidList.Add (uuid); - } - } - - resultData.Uuid = uuidList; - resultData.Address = structData.DeviceAddress; - - return resultData; - } - - internal static BluetoothDeviceConnectionData ConvertStructToConnectionData(BluetoothDeviceConnectionStruct structInfo) - { - BluetoothDeviceConnectionData resultData = new BluetoothDeviceConnectionData(); - resultData.RemoteAddress = structInfo.Address; - resultData.Link = structInfo.LinkType; - resultData.Reason = structInfo.DisconnectReason; - return resultData; - } - - internal static BluetoothLeScanData ConvertStructToLeScanData(BluetoothLeScanDataStruct structScanData) - { - BluetoothLeScanData scanData = new BluetoothLeScanData(); - - scanData.RemoteAddress = structScanData.RemoteAddress; - scanData.AddressType = structScanData.AddressType; - scanData.Rssi = structScanData.Rssi; - - if (structScanData.AdvDataLength > 0) - { - scanData.AdvDataLength = structScanData.AdvDataLength; - scanData.AdvData = new byte[scanData.AdvDataLength]; - Marshal.Copy (structScanData.AdvData, scanData.AdvData, 0, scanData.AdvDataLength); - } - - if (structScanData.ScanDataLength > 0) - { - scanData.ScanDataLength = structScanData.ScanDataLength; - scanData.ScanData = new byte[scanData.ScanDataLength]; - Marshal.Copy (structScanData.ScanData, scanData.ScanData, 0, scanData.ScanDataLength); - } - return scanData; - } - - internal static BluetoothLeScanDataStruct ConvertLeScanDataToStruct(BluetoothLeScanData scanData) - { - BluetoothLeScanDataStruct scanDataStruct = new BluetoothLeScanDataStruct(); - - scanDataStruct.RemoteAddress = scanData.RemoteAddress; - scanDataStruct.AddressType = scanData.AddressType; - scanDataStruct.Rssi = scanData.Rssi; - - if (scanData.AdvDataLength > 0) - { - scanDataStruct.AdvDataLength = scanData.AdvDataLength; - scanDataStruct.AdvData = Marshal.AllocHGlobal(scanData.AdvDataLength); - Marshal.Copy (scanData.AdvData, 0, scanDataStruct.AdvData, scanData.AdvDataLength); - } - - if (scanData.ScanDataLength > 0) - { - scanDataStruct.ScanDataLength = scanData.ScanDataLength; - scanDataStruct.ScanData = Marshal.AllocHGlobal(scanData.ScanDataLength); - Marshal.Copy (scanData.ScanData, 0, scanDataStruct.ScanData, scanData.ScanDataLength); - } - - return scanDataStruct; - } - - internal static BluetoothLeServiceData ConvertStructToLeServiceData(BluetoothLeServiceDataStruct structServiceData) - { - BluetoothLeServiceData serviceData = new BluetoothLeServiceData(); - Log.Info(Globals.LogTag, "ServiceDataLength" + structServiceData.ServiceDataLength); - - if (structServiceData.ServiceDataLength > 0) - { - serviceData.Uuid = structServiceData.ServiceUuid; - serviceData.Length = structServiceData.ServiceDataLength; - serviceData.Data = new byte[serviceData.Length]; - Marshal.Copy(structServiceData.ServiceData, serviceData.Data, 0, serviceData.Length); - } - return serviceData; - } - - internal static SocketData ConvertStructToSocketData(SocketDataStruct structInfo) - { - SocketData data = new SocketData(); - data.Fd = structInfo.SocketFd; - data.Size = structInfo.DataSize; - data.RecvData = Marshal.PtrToStringAnsi(structInfo.Data); - return data; - } - - internal static SocketConnection ConvertStructToSocketConnection(SocketConnectionStruct structInfo) - { - SocketConnection connectionInfo = new SocketConnection(); - connectionInfo.Fd = structInfo.SocketFd; - connectionInfo.RemoteAddress = structInfo.Address; - connectionInfo.Uuid = structInfo.ServiceUuid; - return connectionInfo; - } - } -} - diff --git a/src/Tizen.Network.Connection/Interop/Interop.Connection.cs b/src/Tizen.Network.Connection/Interop/Interop.Connection.cs deleted file mode 100755 index 89011c8f4..000000000 --- a/src/Tizen.Network.Connection/Interop/Interop.Connection.cs +++ /dev/null @@ -1,337 +0,0 @@ -/* - * 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; -using Tizen.Network.Connection; - -internal static partial class Interop -{ - internal static partial class Connection - { - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - public delegate void ConnectionTypeChangedCallback(ConnectionType type, IntPtr userData); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - public delegate void EthernetCableStateChangedCallback(EthernetCableState state, IntPtr userData); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - public delegate void ConnectionAddressChangedCallback(IntPtr ipv4, IntPtr ipv6, IntPtr userData); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - public delegate void ConnectionCallback(ConnectionError result, IntPtr userData); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - public delegate bool IPv6AddressCallback(IntPtr ipv6, IntPtr userData); - - [DllImport(Libraries.Connection, EntryPoint = "connection_create")] - public static extern int Create(out IntPtr handle); - - [DllImport(Libraries.Connection, EntryPoint = "connection_destroy")] - public static extern int Destroy(IntPtr handle); - - [DllImport(Libraries.Connection, EntryPoint = "connection_get_type")] - public static extern int GetType(IntPtr handle, out int type); - - [DllImport(Libraries.Connection, EntryPoint = "connection_get_ip_address")] - public static extern int GetIPAddress(IntPtr handle, int family, out IntPtr address); - - [DllImport(Libraries.Connection, EntryPoint = "connection_foreach_ipv6_address")] - public static extern int GetAllIPv6Addresses(IntPtr handle, int type, IPv6AddressCallback callback, IntPtr userData); - - [DllImport(Libraries.Connection, EntryPoint = "connection_get_proxy")] - public static extern int GetProxy(IntPtr handle, int family, out IntPtr address); - - [DllImport(Libraries.Connection, EntryPoint = "connection_get_mac_address")] - public static extern int GetMacAddress(IntPtr handle, int family, out IntPtr address); - - [DllImport(Libraries.Connection, EntryPoint = "connection_get_wifi_state")] - public static extern int GetWiFiState(IntPtr handle, out int state); - - [DllImport(Libraries.Connection, EntryPoint = "connection_get_cellular_state")] - public static extern int GetCellularState(IntPtr handle, out int state); - - [DllImport(Libraries.Connection, EntryPoint = "connection_get_ethernet_state")] - public static extern int GetEthernetState(IntPtr handle, out int state); - - [DllImport(Libraries.Connection, EntryPoint = "connection_get_ethernet_cable_state")] - public static extern int GetEthernetCableState(IntPtr handle, out int state); - - [DllImport(Libraries.Connection, EntryPoint = "connection_get_bt_state")] - public static extern int GetBtState(IntPtr handle, out int state); - - [DllImport(Libraries.Connection, EntryPoint = "connection_get_statistics")] - public static extern int GetStatistics(IntPtr handle, int connectionType, int statisticsType, out long size); - - [DllImport(Libraries.Connection, EntryPoint = "connection_reset_statistics")] - public static extern int ResetStatistics(IntPtr handle, int connectionType, int statisticsType); - - [DllImport(Libraries.Connection, EntryPoint = "connection_add_route_entry")] - public static extern int AddRoute(IntPtr handle, AddressFamily family, string interfaceName, string address, string gateway); - - [DllImport(Libraries.Connection, EntryPoint = "connection_remove_route_entry")] - public static extern int RemoveRoute(IntPtr handle, AddressFamily family, string interfaceName, string address, string gateway); - - [DllImport(Libraries.Connection, EntryPoint = "connection_set_type_changed_cb")] - public static extern int SetTypeChangedCallback(IntPtr handle, ConnectionTypeChangedCallback callback, IntPtr userData); - - [DllImport(Libraries.Connection, EntryPoint = "connection_set_ip_address_changed_cb")] - public static extern int SetIPAddressChangedCallback(IntPtr handle, ConnectionAddressChangedCallback callback, IntPtr userData); - - [DllImport(Libraries.Connection, EntryPoint = "connection_set_ethernet_cable_state_chaged_cb")] - public static extern int SetEthernetCableStateChagedCallback(IntPtr handle, EthernetCableStateChangedCallback callback, IntPtr userData); - - [DllImport(Libraries.Connection, EntryPoint = "connection_set_proxy_address_changed_cb")] - public static extern int SetProxyAddressChangedCallback(IntPtr handle, ConnectionAddressChangedCallback callback, IntPtr userData); - - [DllImport(Libraries.Connection, EntryPoint = "connection_unset_type_changed_cb")] - public static extern int UnsetTypeChangedCallback(IntPtr handle); - - [DllImport(Libraries.Connection, EntryPoint = "connection_unset_ip_address_changed_cb")] - public static extern int UnsetIPAddressChangedCallback(IntPtr handle); - - [DllImport(Libraries.Connection, EntryPoint = "connection_unset_ethernet_cable_state_chaged_cb")] - public static extern int UnsetEthernetCableStateChagedCallback(IntPtr handle); - - [DllImport(Libraries.Connection, EntryPoint = "connection_unset_proxy_address_changed_cb")] - public static extern int UnsetProxyAddressChangedCallback(IntPtr handle); - - [DllImport(Libraries.Connection, EntryPoint = "connection_add_profile")] - public static extern int AddProfile(IntPtr handle, IntPtr profileHandle); - - [DllImport(Libraries.Connection, EntryPoint = "connection_remove_profile")] - public static extern int RemoveProfile(IntPtr handle, IntPtr profileHandle); - - [DllImport(Libraries.Connection, EntryPoint = "connection_update_profile")] - public static extern int UpdateProfile(IntPtr handle, IntPtr profileHandle); - - [DllImport(Libraries.Connection, EntryPoint = "connection_get_default_cellular_service_profile")] - public static extern int GetDefaultCellularServiceProfile(IntPtr handle, int type, out IntPtr profileHandle); - - [DllImport(Libraries.Connection, EntryPoint = "connection_get_current_profile")] - public static extern int GetCurrentProfile(IntPtr handle, out IntPtr profileHandle); - - [DllImport(Libraries.Connection, EntryPoint = "connection_open_profile")] - public static extern int OpenProfile(IntPtr handle, IntPtr profileHandle, ConnectionCallback callback, IntPtr userData); - - [DllImport(Libraries.Connection, EntryPoint = "connection_close_profile")] - public static extern int CloseProfile(IntPtr handle, IntPtr profileHandle, ConnectionCallback callback, IntPtr userData); - - [DllImport(Libraries.Connection, EntryPoint = "connection_reset_profile")] - public static extern int ResetProfile(IntPtr handle, int Option, int Id, ConnectionCallback callback, IntPtr userData); - - [DllImport(Libraries.Connection, EntryPoint = "connection_set_default_cellular_service_profile_async")] - public static extern int SetDefaultCellularServiceProfileAsync(IntPtr handle, int Type, IntPtr profileHandle, ConnectionCallback callback, IntPtr userData); - - [DllImport(Libraries.Connection, EntryPoint = "connection_get_profile_iterator")] - public static extern int GetProfileIterator(IntPtr handle, int type, out IntPtr iterHandle); - - [DllImport(Libraries.Connection, EntryPoint = "connection_profile_iterator_next")] - public static extern int GetNextProfileIterator(IntPtr iterHandle, out IntPtr profileHandle); - - [DllImport(Libraries.Connection, EntryPoint = "connection_profile_iterator_has_next")] - public static extern bool HasNextProfileIterator(IntPtr iterHandle); - - [DllImport(Libraries.Connection, EntryPoint = "connection_destroy_profile_iterator")] - public static extern int DestroyProfileIterator(IntPtr iterHandle); - } - - internal static partial class ConnectionProfile - { - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - public delegate void ProfileStateChangedCallback(ProfileState type, IntPtr userData); - - [DllImport(Libraries.Connection, EntryPoint = "connection_profile_create")] - public static extern int Create(int ProfileType, string Keyword, out IntPtr profileHandle); - - [DllImport(Libraries.Connection, EntryPoint = "connection_profile_clone")] - public static extern int Clone(out IntPtr cloneHandle, IntPtr profileHandle); - - [DllImport(Libraries.Connection, EntryPoint = "connection_profile_destroy")] - public static extern int Destroy(IntPtr profileHandle); - - [DllImport(Libraries.Connection, EntryPoint = "connection_profile_get_id")] - public static extern int GetId(IntPtr profileHandle, out IntPtr profileId); - - [DllImport(Libraries.Connection, EntryPoint = "connection_profile_get_name")] - public static extern int GetName(IntPtr profileHandle, out IntPtr name); - - [DllImport(Libraries.Connection, EntryPoint = "connection_profile_get_type")] - public static extern int GetType(IntPtr profileHandle, out int type); - - [DllImport(Libraries.Connection, EntryPoint = "connection_profile_get_network_interface_name")] - public static extern int GetNetworkInterfaceName(IntPtr profileHandle, out IntPtr interfaceName); - - [DllImport(Libraries.Connection, EntryPoint = "connection_profile_get_state")] - public static extern int GetState(IntPtr profileHandle, out int type); - - [DllImport(Libraries.Connection, EntryPoint = "connection_profile_get_ipv6_state")] - public static extern int GetIPv6State(IntPtr profileHandle, out int type); - - [DllImport(Libraries.Connection, EntryPoint = "connection_profile_get_ip_config_type")] - public static extern int GetIPConfigType(IntPtr profileHandle, int family, out int type); - - [DllImport(Libraries.Connection, EntryPoint = "connection_profile_get_proxy_type")] - public static extern int GetProxyType(IntPtr profileHandle, out int type); - - [DllImport(Libraries.Connection, EntryPoint = "connection_profile_get_ip_address")] - public static extern int GetIPAddress(IntPtr profileHandle, int family, out IntPtr address); - - [DllImport(Libraries.Connection, EntryPoint = "connection_profile_get_subnet_mask")] - public static extern int GetSubnetMask(IntPtr profileHandle, int family, out IntPtr address); - - [DllImport(Libraries.Connection, EntryPoint = "connection_profile_get_gateway_address")] - public static extern int GetGatewayAddress(IntPtr profileHandle, int family, out IntPtr address); - - [DllImport(Libraries.Connection, EntryPoint = "connection_profile_get_dns_address")] - public static extern int GetDnsAddress(IntPtr profileHandle, int order, int Family, out IntPtr address); - - [DllImport(Libraries.Connection, EntryPoint = "connection_profile_get_proxy_address")] - public static extern int GetProxyAddress(IntPtr profileHandle, int family, out IntPtr address); - - [DllImport(Libraries.Connection, EntryPoint = "connection_profile_get_prefix_length")] - public static extern int GetPrefixLength(IntPtr profileHandle, int family, out int length); - - [DllImport(Libraries.Connection, EntryPoint = "connection_profile_get_dns_config_type")] - public static extern int GetDnsConfigType(IntPtr profileHandle, int family, out int type); - - [DllImport(Libraries.Connection, EntryPoint = "connection_profile_get_dhcp_server_address")] - public static extern int GetDhcpServerAddress(IntPtr profileHandle, AddressFamily family, out string dhcpServerAddress); - - [DllImport(Libraries.Connection, EntryPoint = "connection_profile_refresh")] - public static extern int Refresh(IntPtr profileHandle); - - [DllImport(Libraries.Connection, EntryPoint = "connection_profile_set_ip_config_type")] - public static extern int SetIPConfigType(IntPtr profileHandle, int family, int type); - - [DllImport(Libraries.Connection, EntryPoint = "connection_profile_set_proxy_type")] - public static extern int SetProxyType(IntPtr profileHandle, int type); - - [DllImport(Libraries.Connection, EntryPoint = "connection_profile_set_ip_address")] - public static extern int SetIPAddress(IntPtr profileHandle, int family, string address); - - [DllImport(Libraries.Connection, EntryPoint = "connection_profile_set_subnet_mask")] - public static extern int SetSubnetMask(IntPtr profileHandle, int family, string address); - - [DllImport(Libraries.Connection, EntryPoint = "connection_profile_set_gateway_address")] - public static extern int SetGatewayAddress(IntPtr profileHandle, int family, string address); - - [DllImport(Libraries.Connection, EntryPoint = "connection_profile_set_dns_address")] - public static extern int SetDnsAddress(IntPtr profileHandle, int order, int family, string address); - - [DllImport(Libraries.Connection, EntryPoint = "connection_profile_set_proxy_address")] - public static extern int SetProxyAddress(IntPtr profileHandle, int family, string address); - - [DllImport(Libraries.Connection, EntryPoint = "connection_profile_set_prefix_length")] - public static extern int SetPrefixLength(IntPtr profileHandle, int family, int length); - - [DllImport(Libraries.Connection, EntryPoint = "connection_profile_set_dns_config_type")] - public static extern int SetDnsConfigType(IntPtr profileHandle, int family, int type); - - [DllImport(Libraries.Connection, EntryPoint = "connection_profile_set_state_changed_cb")] - public static extern int SetStateChangeCallback(IntPtr profileHandle, ProfileStateChangedCallback callback, IntPtr userData); - - [DllImport(Libraries.Connection, EntryPoint = "connection_profile_unset_state_changed_cb")] - public static extern int UnsetStateChangeCallback(IntPtr profileHandle); - } - - internal static partial class ConnectionCellularProfile - { - [DllImport(Libraries.Connection, EntryPoint = "connection_profile_get_cellular_service_type")] - public static extern int GetServiceType(IntPtr profileHandle, out int type); - - [DllImport(Libraries.Connection, EntryPoint = "connection_profile_get_cellular_apn")] - public static extern int GetApn(IntPtr profileHandle, out IntPtr apn); - - [DllImport(Libraries.Connection, EntryPoint = "connection_profile_get_cellular_auth_info")] - public static extern int GetAuthInfo(IntPtr profileHandle, out int authType, out string name, out string password); - - [DllImport(Libraries.Connection, EntryPoint = "connection_profile_get_cellular_home_url")] - public static extern int GetHomeUrl(IntPtr profileHandle, out IntPtr homeUrl); - - [DllImport(Libraries.Connection, EntryPoint = "connection_profile_get_cellular_pdn_type")] - public static extern int GetPdnType(IntPtr profileHandle, out int pdnType); - - [DllImport(Libraries.Connection, EntryPoint = "connection_profile_get_cellular_roam_pdn_type")] - public static extern int GetRoamingPdnType(IntPtr profileHandle, out int roamPdnType); - - [DllImport(Libraries.Connection, EntryPoint = "connection_profile_is_cellular_roaming")] - public static extern int IsRoaming(IntPtr profileHandle, out bool roaming); - - [DllImport(Libraries.Connection, EntryPoint = "connection_profile_is_cellular_hidden")] - public static extern int IsHidden(IntPtr profileHandle, out bool hidden); - - [DllImport(Libraries.Connection, EntryPoint = "connection_profile_is_cellular_editable")] - public static extern int IsEditable(IntPtr profileHandle, out bool editable); - - [DllImport(Libraries.Connection, EntryPoint = "connection_profile_is_cellular_default")] - public static extern int IsDefault(IntPtr profileHandle, out bool isDefault); - - [DllImport(Libraries.Connection, EntryPoint = "connection_profile_set_cellular_service_type")] - public static extern int SetServiceType(IntPtr profileHandle, int type); - - [DllImport(Libraries.Connection, EntryPoint = "connection_profile_set_cellular_apn")] - public static extern int SetApn(IntPtr profileHandle, string apn); - - [DllImport(Libraries.Connection, EntryPoint = "connection_profile_set_cellular_auth_info")] - public static extern int SetAuthInfo(IntPtr profileHandle, int authType, string name, string password); - - [DllImport(Libraries.Connection, EntryPoint = "connection_profile_set_cellular_home_url")] - public static extern int SetHomeUrl(IntPtr profileHandle, string homeUrl); - - [DllImport(Libraries.Connection, EntryPoint = "connection_profile_set_cellular_pdn_type")] - public static extern int SetPdnType(IntPtr profileHandle, int pdnType); - - [DllImport(Libraries.Connection, EntryPoint = "connection_profile_set_cellular_roam_pdn_type")] - public static extern int SetRoamingPdnType(IntPtr profileHandle, int roamPdnType); - } - - internal static partial class ConnectionWiFiProfile - { - [DllImport(Libraries.Connection, EntryPoint = "connection_profile_get_wifi_essid")] - public static extern int GetEssid(IntPtr profileHandle, out IntPtr essid); - - [DllImport(Libraries.Connection, EntryPoint = "connection_profile_get_wifi_bssid")] - public static extern int GetBssid(IntPtr profileHandle, out IntPtr bssid); - - [DllImport(Libraries.Connection, EntryPoint = "connection_profile_get_wifi_rssi")] - public static extern int GetRssi(IntPtr profileHandle, out int rssi); - - [DllImport(Libraries.Connection, EntryPoint = "connection_profile_get_wifi_frequency")] - public static extern int GetFrequency(IntPtr profileHandle, out int frequency); - - [DllImport(Libraries.Connection, EntryPoint = "connection_profile_get_wifi_max_speed")] - public static extern int GetMaxSpeed(IntPtr profileHandle, out int maxSpeed); - - [DllImport(Libraries.Connection, EntryPoint = "connection_profile_get_wifi_security_type")] - public static extern int GetSecurityType(IntPtr profileHandle, out int type); - - [DllImport(Libraries.Connection, EntryPoint = "connection_profile_get_wifi_encryption_type")] - public static extern int GetEncryptionType(IntPtr profileHandle, out int type); - - [DllImport(Libraries.Connection, EntryPoint = "connection_profile_is_wifi_passphrase_required")] - public static extern int IsRequiredPassphrase(IntPtr profileHandle, out bool required); - - [DllImport(Libraries.Connection, EntryPoint = "connection_profile_set_wifi_passphrase")] - public static extern int SetPassphrase(IntPtr profileHandle, string passphrase); - - [DllImport(Libraries.Connection, EntryPoint = "connection_profile_is_wifi_wps_supported")] - public static extern int IsSupportedWps(IntPtr profileHandle, out bool supported); - } - - internal static partial class Libc - { - [DllImport(Libraries.Libc, EntryPoint = "free")] - public static extern void Free(IntPtr userData); - - } -} diff --git a/src/Tizen.Network.Connection/Interop/Interop.Libraries.cs b/src/Tizen.Network.Connection/Interop/Interop.Libraries.cs deleted file mode 100644 index 03ee0cd92..000000000 --- a/src/Tizen.Network.Connection/Interop/Interop.Libraries.cs +++ /dev/null @@ -1,30 +0,0 @@ -/* - * 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 Connection = "libcapi-network-connection.so.1"; - public const string WiFi = "libcapi-network-wifi.so.1"; - public const string Bluetooth = "libcapi-network-bluetooth.so.0"; - public const string Smartcard = "libcapi-network-smartcard.so.0"; - public const string Nfc = "libcapi-network-nfc.so.0"; - public const string WiFiDirect = "libwifi-direct.so.1"; - public const string Glib = "libglib-2.0.so.0"; - public const string Libc = "libc.so.6"; - } -} diff --git a/src/Tizen.Network.Connection/Tizen.Network.Connection.csproj b/src/Tizen.Network.Connection/Tizen.Network.Connection.csproj deleted file mode 100644 index 7f4584ffe..000000000 --- a/src/Tizen.Network.Connection/Tizen.Network.Connection.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - netstandard2.0 - - - - - - - - diff --git a/src/Tizen.Network.Connection/Tizen.Network.Connection.sln b/src/Tizen.Network.Connection/Tizen.Network.Connection.sln deleted file mode 100755 index 4a0a69e84..000000000 --- a/src/Tizen.Network.Connection/Tizen.Network.Connection.sln +++ /dev/null @@ -1,34 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26430.12 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Network.Connection", "Tizen.Network.Connection.csproj", "{95B09375-DBE2-48E2-8E23-F7EAAB2F8FE7}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen", "..\Tizen\Tizen.csproj", "{D8E4C8E2-9D12-4E1E-934B-11865FED39AF}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Log", "..\Tizen.Log\Tizen.Log.csproj", "{F850EB87-EF9C-445B-B1F1-3945DF82842E}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {95B09375-DBE2-48E2-8E23-F7EAAB2F8FE7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {95B09375-DBE2-48E2-8E23-F7EAAB2F8FE7}.Debug|Any CPU.Build.0 = Debug|Any CPU - {95B09375-DBE2-48E2-8E23-F7EAAB2F8FE7}.Release|Any CPU.ActiveCfg = Release|Any CPU - {95B09375-DBE2-48E2-8E23-F7EAAB2F8FE7}.Release|Any CPU.Build.0 = Release|Any CPU - {D8E4C8E2-9D12-4E1E-934B-11865FED39AF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D8E4C8E2-9D12-4E1E-934B-11865FED39AF}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D8E4C8E2-9D12-4E1E-934B-11865FED39AF}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D8E4C8E2-9D12-4E1E-934B-11865FED39AF}.Release|Any CPU.Build.0 = Release|Any CPU - {F850EB87-EF9C-445B-B1F1-3945DF82842E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F850EB87-EF9C-445B-B1F1-3945DF82842E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F850EB87-EF9C-445B-B1F1-3945DF82842E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F850EB87-EF9C-445B-B1F1-3945DF82842E}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/src/Tizen.Network.Connection/Tizen.Network.Connection/CellularProfile.cs b/src/Tizen.Network.Connection/Tizen.Network.Connection/CellularProfile.cs deleted file mode 100755 index ebb3f81d6..000000000 --- a/src/Tizen.Network.Connection/Tizen.Network.Connection/CellularProfile.cs +++ /dev/null @@ -1,403 +0,0 @@ -/* - * 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.Collections.Generic; -using System.Linq; -using System.Text; -using System.Runtime.InteropServices; - -namespace Tizen.Network.Connection -{ - /// - /// This is the CellularProfile class. It provides functions to manage the cellular profile. - /// - /// 3 - public class CellularProfile : ConnectionProfile - { - internal CellularProfile(IntPtr handle): base(handle) - { - } - - private CellularAuthInformation _cellularAuthInfo = null; - - ~CellularProfile() - { - } - - /// - /// The APN (access point name). - /// - /// 3 - /// Cellular access point name. - /// Thrown during set when a feature is not supported. - /// Thrown during set when a value is an invalid parameter. - /// Thrown during set when a value is null. - /// Thrown during set when a profile instance is invalid or when a method fails due to an invalid operation. - /// Thrown when an operation is performed on a disposed object. - public string Apn - { - get - { - Log.Debug(Globals.LogTag, "Get Apn"); - IntPtr Value; - int ret = Interop.ConnectionCellularProfile.GetApn(ProfileHandle, out Value); - if ((ConnectionError)ret != ConnectionError.None) - { - Log.Error(Globals.LogTag, "It failed to get apn, " + (ConnectionError)ret); - } - string result = Marshal.PtrToStringAnsi(Value); - Interop.Libc.Free(Value); - return result; - } - - set - { - Log.Debug(Globals.LogTag, "Set Apn"); - CheckDisposed(); - if (value != null) - { - int ret = Interop.ConnectionCellularProfile.SetApn(ProfileHandle, value); - if ((ConnectionError)ret != ConnectionError.None) - { - Log.Error(Globals.LogTag, "It failed to set apn, " + (ConnectionError)ret); - ConnectionErrorFactory.CheckFeatureUnsupportedException(ret, "http://tizen.org/feature/network.telephony"); - ConnectionErrorFactory.CheckHandleNullException(ret, (ProfileHandle == IntPtr.Zero), "ProfileHandle may have been disposed or released"); - ConnectionErrorFactory.ThrowConnectionException(ret); - } - } - - else - { - throw new ArgumentNullException("Value of Apn is null"); - } - } - } - - /// - /// The home URL. - /// - /// 3 - /// Cellular home URL. - /// Thrown during set when a feature is not supported. - /// Thrown during set when a value is an invalid parameter. - /// Thrown during set when a value is null. - /// Thrown during set when a profile instance is invalid or when a method fails due to an invalid operation. - /// Thrown when an operation is performed on a disposed object. - public string HomeUri - { - get - { - Log.Debug(Globals.LogTag, "Get HomeUri"); - IntPtr Value; - int ret = Interop.ConnectionCellularProfile.GetHomeUrl(ProfileHandle, out Value); - if ((ConnectionError)ret != ConnectionError.None) - { - Log.Error(Globals.LogTag, "It failed to get home url, " + (ConnectionError)ret); - } - string result = Marshal.PtrToStringAnsi(Value); - Interop.Libc.Free(Value); - return result; - } - - set - { - Log.Debug(Globals.LogTag, "Set HomeUri"); - CheckDisposed(); - if (value != null) - { - int ret = Interop.ConnectionCellularProfile.SetHomeUrl(ProfileHandle, value); - if ((ConnectionError)ret != ConnectionError.None) - { - Log.Error(Globals.LogTag, "It failed to set home url, " + (ConnectionError)ret); - ConnectionErrorFactory.CheckFeatureUnsupportedException(ret, "http://tizen.org/feature/network.telephony"); - ConnectionErrorFactory.CheckHandleNullException(ret, (ProfileHandle == IntPtr.Zero), "ProfileHandle may have been disposed or released"); - ConnectionErrorFactory.ThrowConnectionException(ret); - } - } - - else - { - throw new ArgumentNullException("Value of HomeUri is null"); - } - } - } - - /// - /// The service type. - /// - /// 3 - /// Cellular service type. - /// Thrown during set when a feature is not supported. - /// Thrown during set when a value is an invalid parameter. - /// Thrown during set when a profile instance is invalid or when a method fails due to an invalid operation. - /// Thrown when an operation is performed on a disposed object. - public CellularServiceType ServiceType - { - get - { - Log.Debug(Globals.LogTag, "Get ServiceType"); - int value; - int ret = Interop.ConnectionCellularProfile.GetServiceType(ProfileHandle, out value); - if ((ConnectionError)ret != ConnectionError.None) - { - Log.Error(Globals.LogTag, "It failed to get service type, " + (ConnectionError)ret); - } - return (CellularServiceType)value; - } - - set - { - Log.Debug(Globals.LogTag, "Set ServiceType"); - CheckDisposed(); - int ret = Interop.ConnectionCellularProfile.SetServiceType(ProfileHandle, (int)value); - if ((ConnectionError)ret != ConnectionError.None) - { - Log.Error(Globals.LogTag, "It failed to set service type, " + (ConnectionError)ret); - ConnectionErrorFactory.CheckFeatureUnsupportedException(ret, "http://tizen.org/feature/network.telephony"); - ConnectionErrorFactory.CheckHandleNullException(ret, (ProfileHandle == IntPtr.Zero), "ProfileHandle may have been disposed or released"); - ConnectionErrorFactory.ThrowConnectionException(ret); - } - } - } - - /// - /// The cellular pdn type. - /// - /// 3 - /// Cellular pdn type. - /// Thrown during set when a feature is not supported. - /// Thrown during set when a value is an invalid parameter. - /// Thrown during set when a profile instance is invalid or when a method fails due to an invalid operation. - /// Thrown when an operation is performed on a disposed object. - public CellularPdnType PdnType - { - get - { - Log.Debug(Globals.LogTag, "Get PdnType"); - int value; - int ret = Interop.ConnectionCellularProfile.GetPdnType(ProfileHandle, out value); - if ((ConnectionError)ret != ConnectionError.None) - { - Log.Error(Globals.LogTag, "It failed to get pdn type, " + (ConnectionError)ret); - } - return (CellularPdnType)value; - } - - set - { - Log.Debug(Globals.LogTag, "Set PdnType"); - CheckDisposed(); - int ret = Interop.ConnectionCellularProfile.SetPdnType(ProfileHandle, (int)value); - if ((ConnectionError)ret != ConnectionError.None) - { - Log.Error(Globals.LogTag, "It failed to set pdn type, " + (ConnectionError)ret); - ConnectionErrorFactory.CheckFeatureUnsupportedException(ret, "http://tizen.org/feature/network.telephony"); - ConnectionErrorFactory.CheckHandleNullException(ret, (ProfileHandle == IntPtr.Zero), "ProfileHandle may have been disposed or released"); - ConnectionErrorFactory.ThrowConnectionException(ret); - } - } - } - - /// - /// The cellular roaming pdn type. - /// - /// 3 - /// Cellular roaming pdn type. - /// Thrown during set when a feature is not supported. - /// Thrown during set when a value is an invalid parameter. - /// Thrown during set when a profile instance is invalid or when a method fails due to an invalid operation. - /// Thrown when a operation is performed on a disposed object. - public CellularPdnType RoamingPdnType - { - get - { - Log.Debug(Globals.LogTag, "Get RoamingPdnType"); - int value; - int ret = Interop.ConnectionCellularProfile.GetRoamingPdnType(ProfileHandle, out value); - if ((ConnectionError)ret != ConnectionError.None) - { - Log.Error(Globals.LogTag, "It failed to get roam pdn type, " + (ConnectionError)ret); - } - return (CellularPdnType)value; - } - - set - { - Log.Debug(Globals.LogTag, "Set RoamingPdnType"); - CheckDisposed(); - int ret = Interop.ConnectionCellularProfile.SetRoamingPdnType(ProfileHandle, (int)value); - if ((ConnectionError)ret != ConnectionError.None) - { - Log.Error(Globals.LogTag, "It failed to set roam pdn type, " + (ConnectionError)ret); - ConnectionErrorFactory.CheckFeatureUnsupportedException(ret, "http://tizen.org/feature/network.telephony"); - ConnectionErrorFactory.CheckHandleNullException(ret, (ProfileHandle == IntPtr.Zero), "ProfileHandle may have been disposed or released"); - ConnectionErrorFactory.ThrowConnectionException(ret); - } - } - } - - /// - /// The cellular authentication information. - /// - /// 3 - /// Instance of CellularAuthInformation. - /// Thrown during set when a feature is not supported. - /// Thrown during set when a value is an invalid parameter. - /// Thrown during set when a value is null. - /// Thrown during set when a profile instance is invalid or when a method fails due to an invalid operation. - /// Thrown when an operation is performed on a disposed object. - public CellularAuthInformation CellularAuthInfo - { - get - { - int type; - string name; - string password; - int ret = Interop.ConnectionCellularProfile.GetAuthInfo(ProfileHandle, out type, out name, out password); - if ((ConnectionError)ret != ConnectionError.None) - { - Log.Error(Globals.LogTag, "It failed to get cellular authentication information, " + (ConnectionError)ret); - return null; - } - - if (_cellularAuthInfo == null) - _cellularAuthInfo = new CellularAuthInformation(); - _cellularAuthInfo.AuthType = (CellularAuthType)type; - _cellularAuthInfo.UserName = name; - _cellularAuthInfo.Password = password; - return _cellularAuthInfo; - } - - set - { - CheckDisposed(); - if (value != null) - { - _cellularAuthInfo = value; - int type = (int)_cellularAuthInfo.AuthType; - string name = _cellularAuthInfo.UserName; - string password = _cellularAuthInfo.Password; - int ret = Interop.ConnectionCellularProfile.SetAuthInfo(ProfileHandle, type, name, password); - if ((ConnectionError)ret != ConnectionError.None) - { - Log.Error(Globals.LogTag, "It failed to set auth information, " + (ConnectionError)ret); - ConnectionErrorFactory.CheckFeatureUnsupportedException(ret, "http://tizen.org/feature/network.telephony"); - ConnectionErrorFactory.CheckHandleNullException(ret, (ProfileHandle == IntPtr.Zero), "ProfileHandle may have been disposed or released"); - ConnectionErrorFactory.ThrowConnectionException(ret); - } - } - - else - { - throw new ArgumentNullException("CellularAuthInformation value is null"); - } - } - } - - /// - /// Checks whether the profile is hidden. - /// - /// 3 - /// True if the cellular profile is hidden, otherwise false. - public bool Hidden - { - get - { - bool value; - int ret = Interop.ConnectionCellularProfile.IsHidden(ProfileHandle, out value); - if ((ConnectionError)ret != ConnectionError.None) - { - Log.Error(Globals.LogTag, "It failed to get hidden value, " + (ConnectionError)ret); - } - return value; - } - } - - /// - /// Checks whether the profile is editable. - /// - /// 3 - /// True if the cellular profile is editable, otherwise false. - public bool Editable - { - get - { - bool value; - int ret = Interop.ConnectionCellularProfile.IsEditable(ProfileHandle, out value); - if ((ConnectionError)ret != ConnectionError.None) - { - Log.Error(Globals.LogTag, "It failed to get editable value, " + (ConnectionError)ret); - } - return value; - } - } - - /// - /// Checks whether the profile is default. - /// - /// 3 - /// True if the cellular profile is default, otherwise false. - public bool IsDefault - { - get - { - bool value; - int ret = Interop.ConnectionCellularProfile.IsDefault(ProfileHandle, out value); - if ((ConnectionError)ret != ConnectionError.None) - { - Log.Error(Globals.LogTag, "It failed to get IsDefault value, " + (ConnectionError)ret); - } - return value; - } - } - } - - /// - /// This is the CellularAuthInformation class. It provides the properties to get and set the cellular authentication information. - /// - /// 3 - public class CellularAuthInformation - { - /// - /// Default constructor. Initializes an object of the CellularAuthInformation. - /// - /// 3 - public CellularAuthInformation() - { - } - - /// - /// The user name. - /// - /// 3 - /// Cellular user name. - public string UserName { get; set;} - /// - /// The password. - /// - /// 3 - /// Cellular password. - public string Password { get; set; } - - /// - /// The authentication type. - /// - /// 3 - /// Cellular authentication type. - public CellularAuthType AuthType { get; set; } - } -} diff --git a/src/Tizen.Network.Connection/Tizen.Network.Connection/ConnectionError.cs b/src/Tizen.Network.Connection/Tizen.Network.Connection/ConnectionError.cs deleted file mode 100755 index 9e8d58798..000000000 --- a/src/Tizen.Network.Connection/Tizen.Network.Connection/ConnectionError.cs +++ /dev/null @@ -1,93 +0,0 @@ -/* - * 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.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tizen.Network.Connection -{ - internal static class ConnectionErrorFactory - { - internal static void CheckFeatureUnsupportedException(int err, string message) - { - if ((ConnectionError)err == ConnectionError.NotSupported) - { - ThrowConnectionException(err, message); - } - } - - internal static void CheckPermissionDeniedException(int err, string message) - { - if ((ConnectionError)err == ConnectionError.PermissionDenied) - { - ThrowConnectionException(err, message); - } - } - - internal static void CheckHandleNullException(int err, bool isHandleInvalid, string message) - { - if ((ConnectionError)err == ConnectionError.InvalidParameter) - { - if (isHandleInvalid) - { - ThrowConnectionException((int)ConnectionError.InvalidOperation, message); - } - } - } - - internal static void ThrowConnectionException(int errno , string message = "") - { - ConnectionError _error = (ConnectionError)errno; - Log.Debug(Globals.LogTag, "ThrowConnectionException " + _error); - switch (_error) - { - case ConnectionError.AddressFamilyNotSupported: - throw new InvalidOperationException("Address Family Not Supported"); - case ConnectionError.AlreadyExists: - throw new InvalidOperationException("Already Exists"); - case ConnectionError.DhcpFailed: - throw new InvalidOperationException("DHCP Failed"); - case ConnectionError.EndOfIteration: - throw new InvalidOperationException("End Of Iteration"); - case ConnectionError.InvalidKey: - throw new InvalidOperationException("Invalid Key"); - case ConnectionError.InvalidOperation: - throw new InvalidOperationException("Invalid Operation " + message); - case ConnectionError.InvalidParameter: - throw new ArgumentException("Invalid Parameter"); - case ConnectionError.NoConnection: - throw new InvalidOperationException("No Connection"); - case ConnectionError.NoReply: - throw new InvalidOperationException("No Reply"); - case ConnectionError.NotSupported: - throw new NotSupportedException("Unsupported feature " + message); - case ConnectionError.NowInProgress: - throw new InvalidOperationException("Now In Progress"); - case ConnectionError.OperationAborted: - throw new InvalidOperationException("Operation Aborted"); - case ConnectionError.OperationFailed: - throw new InvalidOperationException("Operation Failed"); - case ConnectionError.OutOfMemoryError: - throw new OutOfMemoryException("Out Of Memory Error"); - case ConnectionError.PermissionDenied: - throw new UnauthorizedAccessException("Permission Denied " + message); - } - } - } -} \ No newline at end of file diff --git a/src/Tizen.Network.Connection/Tizen.Network.Connection/ConnectionInternalManager.cs b/src/Tizen.Network.Connection/Tizen.Network.Connection/ConnectionInternalManager.cs deleted file mode 100755 index f9aa0be92..000000000 --- a/src/Tizen.Network.Connection/Tizen.Network.Connection/ConnectionInternalManager.cs +++ /dev/null @@ -1,956 +0,0 @@ -/* - * 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.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Runtime.InteropServices; -using System.Collections; -using System.Threading; - -namespace Tizen.Network.Connection -{ - class HandleHolder : IDisposable - { - private IntPtr Handle; - private bool disposed = false; - - public HandleHolder() - { - Log.Debug(Globals.LogTag, "Handle: " + Handle); - int ret = Interop.Connection.Create(out Handle); - if(ret != (int)ConnectionError.None) - { - ConnectionErrorFactory.CheckFeatureUnsupportedException(ret, "http://tizen.org/feature/network.telephony " + "http://tizen.org/feature/network.wifi " + "http://tizen.org/feature/network.tethering.bluetooth " + "http://tizen.org/feature/network.ethernet"); - ConnectionErrorFactory.CheckPermissionDeniedException(ret, "(http://tizen.org/privilege/network.get)"); - ConnectionErrorFactory.ThrowConnectionException(ret); - } - } - - ~HandleHolder() - { - Dispose(false); - } - - internal IntPtr GetHandle() - { - Log.Debug(Globals.LogTag, "handleholder handle = " + Handle); - return Handle; - } - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - - private void Dispose(bool disposing) - { - Log.Debug(Globals.LogTag, ">>> HandleHolder Dispose with " + disposing); - Log.Debug(Globals.LogTag, ">>> Handle: " + Handle); - if (disposed) - return; - - if (disposing) - { - // Free managed objects. - Destroy(); - } - disposed = true; - } - - private void Destroy() - { - Interop.Connection.Destroy(Handle); - if (Handle != IntPtr.Zero) - { - Handle = IntPtr.Zero; - } - } - } - - internal class ConnectionInternalManager - { - private bool disposed = false; - private static ConnectionInternalManager s_instance = null; - - private EventHandler _ConnectionTypeChanged = null; - private EventHandler _IPAddressChanged = null; - private EventHandler _EthernetCableStateChanged = null; - private EventHandler _ProxyAddressChanged = null; - - private Interop.Connection.ConnectionAddressChangedCallback _connectionAddressChangedCallback; - private Interop.Connection.ConnectionTypeChangedCallback _connectionTypeChangedCallback; - private Interop.Connection.ConnectionAddressChangedCallback _proxyAddressChangedCallback; - - internal static ConnectionInternalManager Instance - { - get - { - if (s_instance == null) - { - s_instance = new ConnectionInternalManager(); - } - - return s_instance; - } - } - - private static ThreadLocal s_threadName = new ThreadLocal(() => - { - Log.Info(Globals.LogTag, "In threadlocal delegate"); - return new HandleHolder(); - }); - - private ConnectionInternalManager() - { - - } - - ~ConnectionInternalManager() - { - Dispose(false); - } - - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - - private void Dispose(bool disposing) - { - Log.Debug(Globals.LogTag, ">>> ConnectionInternalManager Dispose with disposing " + disposing + ", disposed " + disposed); - Log.Debug(Globals.LogTag, ">>> Handle: " + GetHandle()); - if (disposed) - return; - - if (disposing) - { - // Free managed objects. - } - - UnregisterEvents(); - disposed = true; - } - - internal IntPtr GetHandle() - { - return s_threadName.Value.GetHandle(); - } - - internal event EventHandler ConnectionTypeChanged - { - add - { - if (_ConnectionTypeChanged == null) - { - ConnectionTypeChangedStart(); - } - - _ConnectionTypeChanged += value; - } - remove - { - _ConnectionTypeChanged -= value; - if (_ConnectionTypeChanged == null) - { - ConnectionTypeChangedStop(); - } - } - } - - private void ConnectionTypeChangedStart() - { - _connectionTypeChangedCallback = (ConnectionType type, IntPtr user_data) => - { - if (_ConnectionTypeChanged != null) - { - _ConnectionTypeChanged(null, new ConnectionTypeEventArgs(type)); - } - }; - - int ret = Interop.Connection.SetTypeChangedCallback(GetHandle(), _connectionTypeChangedCallback, IntPtr.Zero); - if ((ConnectionError)ret != ConnectionError.None) - { - Log.Error(Globals.LogTag, "It failed to register connection type changed callback, " + (ConnectionError)ret); - ConnectionErrorFactory.ThrowConnectionException(ret); - } - } - - private void ConnectionTypeChangedStop() - { - int ret = Interop.Connection.UnsetTypeChangedCallback(GetHandle()); - if ((ConnectionError)ret != ConnectionError.None) - { - Log.Error(Globals.LogTag, "It failed to unregister connection type changed callback, " + (ConnectionError)ret); - ConnectionErrorFactory.ThrowConnectionException(ret); - } - } - - internal event EventHandler EthernetCableStateChanged - { - add - { - if (_EthernetCableStateChanged == null) - { - EthernetCableStateChangedStart(); - } - _EthernetCableStateChanged += value; - } - remove - { - _EthernetCableStateChanged -= value; - if (_EthernetCableStateChanged == null) - { - EthernetCableStateChangedStop(); - } - } - } - - private void EthernetCableStateChangedStart() - { - int ret = Interop.Connection.SetEthernetCableStateChagedCallback(GetHandle(), EthernetCableStateChangedCallback, IntPtr.Zero); - if ((ConnectionError)ret != ConnectionError.None) - { - Log.Error(Globals.LogTag, "It failed to register ethernet cable state changed callback, " + (ConnectionError)ret); - ConnectionErrorFactory.ThrowConnectionException(ret); - } - } - - private void EthernetCableStateChangedStop() - { - int ret = Interop.Connection.UnsetEthernetCableStateChagedCallback(GetHandle()); - if ((ConnectionError)ret != ConnectionError.None) - { - Log.Error(Globals.LogTag, "It failed to unregister ethernet cable state changed callback, " + (ConnectionError)ret); - ConnectionErrorFactory.ThrowConnectionException(ret); - } - } - - private void EthernetCableStateChangedCallback(EthernetCableState state, IntPtr user_data) - { - if (_EthernetCableStateChanged != null) - { - _EthernetCableStateChanged(null, new EthernetCableStateEventArgs(state)); - } - } - - internal event EventHandler IPAddressChanged - { - add - { - if (_IPAddressChanged == null) - { - IPAddressChangedStart(); - } - _IPAddressChanged += value; - } - - remove - { - _IPAddressChanged -= value; - if (_IPAddressChanged == null) - { - IPAddressChangedStop(); - } - } - } - - private void IPAddressChangedStart() - { - _connectionAddressChangedCallback = (IntPtr IPv4, IntPtr IPv6, IntPtr UserData) => - { - if (_IPAddressChanged != null) - { - string ipv4 = Marshal.PtrToStringAnsi(IPv4); - string ipv6 = Marshal.PtrToStringAnsi(IPv6); - - if ((string.IsNullOrEmpty(ipv4) == false) || (string.IsNullOrEmpty(ipv6) == false)) - { - _IPAddressChanged(null, new AddressEventArgs(ipv4, ipv6)); - } - } - }; - - int ret = Interop.Connection.SetIPAddressChangedCallback(GetHandle(), _connectionAddressChangedCallback, IntPtr.Zero); - if ((ConnectionError)ret != ConnectionError.None) - { - Log.Error(Globals.LogTag, "It failed to register callback for changing IP address, " + (ConnectionError)ret); - } - } - - private void IPAddressChangedStop() - { - int ret = Interop.Connection.UnsetIPAddressChangedCallback(GetHandle()); - if ((ConnectionError)ret != ConnectionError.None) - { - Log.Error(Globals.LogTag, "It failed to unregister callback for changing IP address, " + (ConnectionError)ret); - } - } - - internal event EventHandler ProxyAddressChanged - { - add - { - //Console.WriteLine("ProxyAddressChanged Add **"); - if (_ProxyAddressChanged == null) - { - ProxyAddressChangedStart(); - } - - _ProxyAddressChanged += value; - } - remove - { - //Console.WriteLine("ProxyAddressChanged Remove"); - _ProxyAddressChanged -= value; - if (_ProxyAddressChanged == null) - { - ProxyAddressChangedStop(); - } - } - } - - private void ProxyAddressChangedStart() - { - _proxyAddressChangedCallback = (IntPtr IPv4, IntPtr IPv6, IntPtr UserData) => - { - if (_ProxyAddressChanged != null) - { - string ipv4 = Marshal.PtrToStringAnsi(IPv4); - string ipv6 = Marshal.PtrToStringAnsi(IPv6); - - if ((string.IsNullOrEmpty(ipv4) == false) || (string.IsNullOrEmpty(ipv6) == false)) - { - _ProxyAddressChanged(null, new AddressEventArgs(ipv4, ipv6)); - } - } - }; - - int ret = Interop.Connection.SetProxyAddressChangedCallback(GetHandle(), _proxyAddressChangedCallback, IntPtr.Zero); - if ((ConnectionError)ret != ConnectionError.None) - { - Log.Error(Globals.LogTag, "It failed to register callback for changing proxy address, " + (ConnectionError)ret); - } - } - - private void ProxyAddressChangedStop() - { - int ret = Interop.Connection.UnsetProxyAddressChangedCallback(GetHandle()); - if ((ConnectionError)ret != ConnectionError.None) - { - Log.Error(Globals.LogTag, "It failed to unregister callback for changing proxy address, " + (ConnectionError)ret); - } - } - - private void UnregisterEvents() - { - if (_ConnectionTypeChanged != null) - { - ConnectionTypeChangedStop(); - } - if (_IPAddressChanged != null) - { - IPAddressChangedStop(); - } - if (_EthernetCableStateChanged != null) - { - EthernetCableStateChangedStop(); - } - if (_ProxyAddressChanged != null) - { - ProxyAddressChangedStop(); - } - } - - internal int GetProfileIterator(ProfileListType type, out IntPtr iterator) - { - return Interop.Connection.GetProfileIterator(GetHandle(), (int)type, out iterator); - } - - internal bool HasNext(IntPtr iterator) - { - return Interop.Connection.HasNextProfileIterator(iterator); - } - - internal int NextProfileIterator(IntPtr iterator, out IntPtr profileHandle) - { - return Interop.Connection.GetNextProfileIterator(iterator, out profileHandle); - } - - internal int DestoryProfileIterator(IntPtr iterator) - { - return Interop.Connection.DestroyProfileIterator(iterator); - } - - internal System.Net.IPAddress GetIPAddress(AddressFamily family) - { - Log.Debug(Globals.LogTag, "GetIPAddress " + family); - IntPtr ip; - int ret = Interop.Connection.GetIPAddress(GetHandle(), (int)family, out ip); - if ((ConnectionError)ret != ConnectionError.None) - { - Log.Error(Globals.LogTag, "It failed to get IP address, " + (ConnectionError)ret); - ConnectionErrorFactory.CheckFeatureUnsupportedException(ret, "http://tizen.org/feature/network.telephony " + "http://tizen.org/feature/network.wifi " + "http://tizen.org/feature/network.tethering.bluetooth " + "http://tizen.org/feature/network.ethernet"); - ConnectionErrorFactory.CheckHandleNullException(ret, (GetHandle() == IntPtr.Zero), "Connection Handle may have been disposed or released"); - ConnectionErrorFactory.ThrowConnectionException(ret); - } - - string result = Marshal.PtrToStringAnsi(ip); - Interop.Libc.Free(ip); - Log.Debug(Globals.LogTag, "IPAddress " + result + " (" + result.Length + ")"); - if (result.Length == 0) - { - if (family == AddressFamily.IPv4) - return System.Net.IPAddress.Parse("0.0.0.0"); - else - return System.Net.IPAddress.Parse("::"); - } - return System.Net.IPAddress.Parse(result); - } - - internal IEnumerable GetAllIPv6Addresses(ConnectionType type) - { - Log.Debug(Globals.LogTag, "GetAllIPv6Addresses"); - List ipList = new List(); - Interop.Connection.IPv6AddressCallback callback = (IntPtr ipv6Address, IntPtr userData) => - { - if (ipv6Address != IntPtr.Zero) - { - string ipv6 = Marshal.PtrToStringAnsi(ipv6Address); - if (ipv6.Length == 0) - ipList.Add(System.Net.IPAddress.Parse("::")); - else - ipList.Add(System.Net.IPAddress.Parse(ipv6)); - return true; - } - return false; - }; - - int ret = Interop.Connection.GetAllIPv6Addresses(GetHandle(), (int)type, callback, IntPtr.Zero); - if (ret != (int)ConnectionError.None) - { - Log.Error(Globals.LogTag, "Failed to get all IPv6 addresses, Error - " + (ConnectionError)ret); - ConnectionErrorFactory.CheckFeatureUnsupportedException(ret, "http://tizen.org/feature/network.telephony " + "http://tizen.org/feature/network.wifi " + "http://tizen.org/feature/network.tethering.bluetooth " + "http://tizen.org/feature/network.ethernet"); - ConnectionErrorFactory.CheckHandleNullException(ret, (GetHandle() == IntPtr.Zero), "Connection Handle may have been disposed or released"); - ConnectionErrorFactory.ThrowConnectionException(ret); - } - - return ipList; - } - - internal string GetProxy(AddressFamily family) - { - Log.Debug(Globals.LogTag, "GetProxy " + family); - IntPtr ip; - int ret = Interop.Connection.GetProxy(GetHandle(), (int)family, out ip); - if ((ConnectionError)ret != ConnectionError.None) - { - Log.Error(Globals.LogTag, "It failed to get proxy, " + (ConnectionError)ret); - ConnectionErrorFactory.CheckFeatureUnsupportedException(ret, "http://tizen.org/feature/network.telephony " + "http://tizen.org/feature/network.wifi " + "http://tizen.org/feature/network.tethering.bluetooth " + "http://tizen.org/feature/network.ethernet"); - ConnectionErrorFactory.CheckHandleNullException(ret, (GetHandle() == IntPtr.Zero), "Connection Handle may have been disposed or released"); - ConnectionErrorFactory.ThrowConnectionException(ret); - } - - string result = Marshal.PtrToStringAnsi(ip); - Interop.Libc.Free(ip); - return result; - } - - internal string GetMacAddress(ConnectionType type) - { - Log.Debug(Globals.LogTag, "GetMacAddress " + type); - IntPtr mac; - int ret = Interop.Connection.GetMacAddress(GetHandle(), (int)type, out mac); - if ((ConnectionError)ret != ConnectionError.None) - { - Log.Error(Globals.LogTag, "It failed to get mac address, " + (ConnectionError)ret); - ConnectionErrorFactory.CheckFeatureUnsupportedException(ret, "http://tizen.org/feature/network.wifi " + "http://tizen.org/feature/network.ethernet"); - ConnectionErrorFactory.CheckHandleNullException(ret, (GetHandle() == IntPtr.Zero), "Connection Handle may have been disposed or released"); - ConnectionErrorFactory.ThrowConnectionException(ret); - } - - string result = Marshal.PtrToStringAnsi(mac); - Interop.Libc.Free(mac); - return result; - } - - internal long GetStatistics(ConnectionType connectionType, StatisticsType statisticsType) - { - Log.Debug(Globals.LogTag, "GetStatistics " + connectionType + ", " + statisticsType); - long size; - int ret = Interop.Connection.GetStatistics(GetHandle(), (int)connectionType, - (int)statisticsType, out size); - if ((ConnectionError)ret != ConnectionError.None) - { - Log.Error(Globals.LogTag, "It failed to get statistics, " + (ConnectionError)ret); - ConnectionErrorFactory.CheckFeatureUnsupportedException(ret, "http://tizen.org/feature/network.wifi " + "http://tizen.org/feature/network.telephony"); - ConnectionErrorFactory.CheckPermissionDeniedException(ret, "(http://tizen.org/privilege/network.get)"); - ConnectionErrorFactory.CheckHandleNullException(ret, (GetHandle() == IntPtr.Zero), "Connection Handle may have been disposed or released"); - ConnectionErrorFactory.ThrowConnectionException(ret); - } - return size; - } - - internal void ResetStatistics(ConnectionType connectionType, StatisticsType statisticsType) - { - Log.Debug(Globals.LogTag, "ResetStatistics " + connectionType + ", " + statisticsType); - int ret = Interop.Connection.ResetStatistics(GetHandle(), (int)connectionType, - (int)statisticsType); - if ((ConnectionError)ret != ConnectionError.None) - { - Log.Error(Globals.LogTag, "It failed to reset statistics, " + (ConnectionError)ret); - ConnectionErrorFactory.CheckFeatureUnsupportedException(ret, "http://tizen.org/feature/network.wifi " + "http://tizen.org/feature/network.telephony"); - ConnectionErrorFactory.CheckPermissionDeniedException(ret, "(http://tizen.org/privilege/network.set)"); - ConnectionErrorFactory.CheckHandleNullException(ret, (GetHandle() == IntPtr.Zero), "Connection Handle may have been disposed or released"); - ConnectionErrorFactory.ThrowConnectionException(ret); - } - } - - internal void AddRoute(AddressFamily family, string interfaceName, System.Net.IPAddress address, System.Net.IPAddress gateway) - { - if (interfaceName != null && address != null && gateway != null) - { - Log.Debug(Globals.LogTag, "AddRoute " + family + ", " + interfaceName + ", " + address + ", " + gateway); - int ret = Interop.Connection.AddRoute(GetHandle(), family, interfaceName, address.ToString(), gateway.ToString()); - if ((ConnectionError)ret != ConnectionError.None) - { - Log.Error(Globals.LogTag, "It failed to add route to the routing table, " + (ConnectionError)ret); - ConnectionErrorFactory.CheckFeatureUnsupportedException(ret, "http://tizen.org/feature/network.telephony " + "http://tizen.org/feature/network.wifi " + "http://tizen.org/feature/network.tethering.bluetooth " + "http://tizen.org/feature/network.ethernet"); - ConnectionErrorFactory.CheckPermissionDeniedException(ret, "(http://tizen.org/privilege/network.set)"); - ConnectionErrorFactory.CheckHandleNullException(ret, (GetHandle() == IntPtr.Zero), "Connection Handle may have been disposed or released"); - ConnectionErrorFactory.ThrowConnectionException(ret); - } - } - - else - { - throw new ArgumentNullException("Arguments are null"); - } - } - - internal void RemoveRoute(AddressFamily family, string interfaceName, System.Net.IPAddress address, System.Net.IPAddress gateway) - { - if (interfaceName != null && address != null && gateway != null) - { - Log.Debug(Globals.LogTag, "RemoveRoute " + family + ", " + interfaceName + ", " + address + ", " + gateway); - int ret = Interop.Connection.RemoveRoute(GetHandle(), family, interfaceName, address.ToString(), gateway.ToString()); - if ((ConnectionError)ret != ConnectionError.None) - { - Log.Error(Globals.LogTag, "It failed to remove route from the routing table, " + (ConnectionError)ret); - ConnectionErrorFactory.CheckFeatureUnsupportedException(ret, "http://tizen.org/feature/network.telephony " + "http://tizen.org/feature/network.wifi " + "http://tizen.org/feature/network.tethering.bluetooth " + "http://tizen.org/feature/network.ethernet"); - ConnectionErrorFactory.CheckPermissionDeniedException(ret, "(http://tizen.org/privilege/network.set)"); - ConnectionErrorFactory.CheckHandleNullException(ret, (GetHandle() == IntPtr.Zero), "Connection Handle may have been disposed or released"); - ConnectionErrorFactory.ThrowConnectionException(ret); - } - } - - else - { - throw new ArgumentNullException("Arguments are null"); - } - } - - internal ConnectionType ConnectionType - { - get - { - Log.Debug(Globals.LogTag, "get ConnectionType"); - int type = 0; - int ret = Interop.Connection.GetType(GetHandle(), out type); - if ((ConnectionError)ret != ConnectionError.None) - { - Log.Error(Globals.LogTag, "It failed to get connection type, " + (ConnectionError)ret); - ConnectionErrorFactory.ThrowConnectionException(ret); - } - return (ConnectionType)type; - } - } - - internal CellularState CellularState - { - get - { - Log.Debug(Globals.LogTag, "get CellularState"); - int type = 0; - int ret = Interop.Connection.GetCellularState(GetHandle(), out type); - if ((ConnectionError)ret != ConnectionError.None) - { - Log.Error(Globals.LogTag, "It failed to get cellular state, " + (ConnectionError)ret); - ConnectionErrorFactory.ThrowConnectionException(ret); - } - return (CellularState)type; - } - } - - internal ConnectionState WiFiState - { - get - { - Log.Debug(Globals.LogTag, "get WiFiState"); - int type = 0; - int ret = Interop.Connection.GetWiFiState(GetHandle(), out type); - if ((ConnectionError)ret != ConnectionError.None) - { - Log.Error(Globals.LogTag, "It failed to get wifi state, " + (ConnectionError)ret); - ConnectionErrorFactory.ThrowConnectionException(ret); - } - return (ConnectionState)type; - } - } - - internal ConnectionState BluetoothState - { - get - { - Log.Debug(Globals.LogTag, "get BluetoothState"); - int type = 0; - int ret = Interop.Connection.GetBtState(GetHandle(), out type); - if ((ConnectionError)ret != ConnectionError.None) - { - Log.Error(Globals.LogTag, "It failed to get bluetooth state, " + (ConnectionError)ret); - ConnectionErrorFactory.ThrowConnectionException(ret); - } - return (ConnectionState)type; - } - } - - internal ConnectionState EthernetState - { - get - { - Log.Debug(Globals.LogTag, "get ConnectionType"); - int type = 0; - int ret = Interop.Connection.GetEthernetState(GetHandle(), out type); - if ((ConnectionError)ret != ConnectionError.None) - { - Log.Error(Globals.LogTag, "It failed to get ethernet state, " + (ConnectionError)ret); - ConnectionErrorFactory.ThrowConnectionException(ret); - } - return (ConnectionState)type; - } - } - - internal EthernetCableState EthernetCableState - { - get - { - Log.Debug(Globals.LogTag, "get EthernetCableState"); - int type = 0; - int ret = Interop.Connection.GetEthernetCableState(GetHandle(), out type); - if ((ConnectionError)ret != ConnectionError.None) - { - Log.Error(Globals.LogTag, "It failed to get ethernet cable state, " + (ConnectionError)ret); - ConnectionErrorFactory.ThrowConnectionException(ret); - } - return (EthernetCableState)type; - } - } - - internal IntPtr CreateCellularProfile(ConnectionProfileType type, string keyword) - { - Log.Debug(Globals.LogTag, "CreateCellularProfile, " + type + ", " + keyword); - if (keyword != null) - { - IntPtr handle = IntPtr.Zero; - int ret = Interop.ConnectionProfile.Create((int)type, keyword, out handle); - if ((ConnectionError)ret != ConnectionError.None) - { - Log.Error(Globals.LogTag, "It failed to Create profile, " + (ConnectionError)ret); - ConnectionErrorFactory.CheckFeatureUnsupportedException(ret, "http://tizen.org/feature/network.wifi " + "http://tizen.org/feature/network.telephony"); - ConnectionErrorFactory.CheckPermissionDeniedException(ret, "(http://tizen.org/privilege/network.get)"); - ConnectionErrorFactory.ThrowConnectionException(ret); - } - - return handle; - } - - else - { - throw new ArgumentNullException("Keyword is null"); - } - } - - internal void AddCellularProfile(CellularProfile profile) - { - - Log.Debug(Globals.LogTag, "AddCellularProfile"); - if (profile != null) - { - if (profile.Type == ConnectionProfileType.Cellular) - { - int ret = Interop.Connection.AddProfile(GetHandle(), profile.ProfileHandle); - if ((ConnectionError)ret != ConnectionError.None) - { - Log.Error(Globals.LogTag, "Failed to add cellular profile, " + (ConnectionError)ret); - ConnectionErrorFactory.CheckFeatureUnsupportedException(ret, "http://tizen.org/feature/network.telephony"); - ConnectionErrorFactory.CheckPermissionDeniedException(ret, "(http://tizen.org/privilege/network.profile)"); - ConnectionErrorFactory.CheckHandleNullException(ret, (GetHandle() == IntPtr.Zero || profile.ProfileHandle == IntPtr.Zero), "Connection or Profile Handle may have been disposed or released"); - ConnectionErrorFactory.ThrowConnectionException(ret); - } - } - - else - { - throw new ArgumentException("Profile type is not cellular"); - } - } - - else - { - throw new ArgumentNullException("Profile is null"); - } - } - - internal void RemoveProfile(ConnectionProfile profile) - { - Log.Debug(Globals.LogTag, "RemoveProfile"); - if (profile != null) - { - int ret = Interop.Connection.RemoveProfile(GetHandle(), profile.ProfileHandle); - if ((ConnectionError)ret != ConnectionError.None) - { - Log.Error(Globals.LogTag, "It failed to remove profile, " + (ConnectionError)ret); - ConnectionErrorFactory.CheckFeatureUnsupportedException(ret, "http://tizen.org/feature/network.wifi " + "http://tizen.org/feature/network.telephony"); - ConnectionErrorFactory.CheckHandleNullException(ret, (GetHandle() == IntPtr.Zero || profile.ProfileHandle == IntPtr.Zero), "Connection or Profile Handle may have been disposed or released"); - ConnectionErrorFactory.ThrowConnectionException(ret); - } - } - - else - { - throw new ArgumentNullException("Profile is null"); - } - } - - internal void UpdateProfile(ConnectionProfile profile) - { - Log.Debug(Globals.LogTag, "UpdateProfile"); - if (profile != null) - { - int ret = Interop.Connection.UpdateProfile(GetHandle(), profile.ProfileHandle); - if ((ConnectionError)ret != ConnectionError.None) - { - Log.Error(Globals.LogTag, "It failed to update profile, " + (ConnectionError)ret); - ConnectionErrorFactory.CheckFeatureUnsupportedException(ret, "http://tizen.org/feature/network.telephony " + "http://tizen.org/feature/network.wifi " + "http://tizen.org/feature/network.ethernet"); - ConnectionErrorFactory.CheckHandleNullException(ret, (GetHandle() == IntPtr.Zero || profile.ProfileHandle == IntPtr.Zero), "Connection or Profile Handle may have been disposed or released"); - ConnectionErrorFactory.ThrowConnectionException(ret); - } - } - - else - { - throw new ArgumentNullException("Profile is null"); - } - } - - internal ConnectionProfile GetCurrentProfile() - { - Log.Debug(Globals.LogTag, "GetCurrentProfile"); - IntPtr ProfileHandle; - int ret = Interop.Connection.GetCurrentProfile(GetHandle(), out ProfileHandle); - if ((ConnectionError)ret != ConnectionError.None) - { - Log.Error(Globals.LogTag, "It failed to get current profile, " + (ConnectionError)ret); - ConnectionErrorFactory.CheckFeatureUnsupportedException(ret, "http://tizen.org/feature/network.telephony " + "http://tizen.org/feature/network.wifi " + "http://tizen.org/feature/network.tethering.bluetooth " + "http://tizen.org/feature/network.ethernet"); - ConnectionErrorFactory.CheckPermissionDeniedException(ret, "(http://tizen.org/privilege/network.get)"); - ConnectionErrorFactory.CheckHandleNullException(ret, (GetHandle() == IntPtr.Zero), "Connection Handle may have been disposed or released"); - ConnectionErrorFactory.ThrowConnectionException(ret); - } - - ConnectionProfile Profile = new ConnectionProfile(ProfileHandle); - return Profile; - } - - internal ConnectionProfile GetDefaultCellularProfile(CellularServiceType type) - { - Log.Debug(Globals.LogTag, "GetDefaultCellularProfile"); - IntPtr ProfileHandle; - int ret = Interop.Connection.GetDefaultCellularServiceProfile(GetHandle(), (int)type, out ProfileHandle); - if ((ConnectionError)ret != ConnectionError.None) - { - Log.Error(Globals.LogTag, "Error: " + ret); - Log.Error(Globals.LogTag, "It failed to get default cellular profile, " + (ConnectionError)ret); - ConnectionErrorFactory.CheckFeatureUnsupportedException(ret, "http://tizen.org/feature/network.telephony"); - ConnectionErrorFactory.CheckPermissionDeniedException(ret, "(http://tizen.org/privilege/network.get)"); - ConnectionErrorFactory.CheckHandleNullException(ret, (GetHandle() == IntPtr.Zero), "Connection Handle may have been disposed or released"); - ConnectionErrorFactory.ThrowConnectionException(ret); - } - - CellularProfile Profile = new CellularProfile(ProfileHandle); - return Profile; - } - - internal Task SetDefaultCellularProfile(CellularServiceType type, ConnectionProfile profile) - { - Log.Debug(Globals.LogTag, "SetDefaultCellularProfile"); - if (profile != null) - { - TaskCompletionSource task = new TaskCompletionSource(); - Interop.Connection.ConnectionCallback Callback = (ConnectionError Result, IntPtr Data) => - { - if (Result != ConnectionError.None) - { - Log.Error(Globals.LogTag, "Error occurs during set default cellular profile, " + Result); - task.SetException(new InvalidOperationException("Error occurs during set default cellular profile, " + Result)); - } - - task.SetResult(true); - }; - - int ret = Interop.Connection.SetDefaultCellularServiceProfileAsync(GetHandle(), (int)type, profile.ProfileHandle, Callback, (IntPtr)0); - if ((ConnectionError)ret != ConnectionError.None) - { - Log.Error(Globals.LogTag, "It failed to set default cellular profile, " + (ConnectionError)ret); - ConnectionErrorFactory.CheckFeatureUnsupportedException(ret, "http://tizen.org/feature/network.telephony"); - ConnectionErrorFactory.CheckHandleNullException(ret, (GetHandle() == IntPtr.Zero || profile.ProfileHandle == IntPtr.Zero), "Connection or Profile Handle may have been disposed or released"); - ConnectionErrorFactory.ThrowConnectionException(ret); - } - - return task.Task; - } - - else - { - throw new ArgumentNullException("Profile is null"); - } - } - - - internal Task> GetProfileListAsync(ProfileListType type) - { - Log.Debug(Globals.LogTag, "GetProfileListAsync"); - var task = new TaskCompletionSource>(); - - List Result = new List(); - IntPtr iterator; - int ret = Interop.Connection.GetProfileIterator(GetHandle(), (int)type, out iterator); - if ((ConnectionError)ret != ConnectionError.None) - { - Log.Error(Globals.LogTag, "It failed to get profile iterator, " + (ConnectionError)ret); - ConnectionErrorFactory.CheckFeatureUnsupportedException(ret, "http://tizen.org/feature/network.telephony " + "http://tizen.org/feature/network.wifi " + "http://tizen.org/feature/network.tethering.bluetooth " + "http://tizen.org/feature/network.ethernet"); - ConnectionErrorFactory.CheckPermissionDeniedException(ret, "(http://tizen.org/privilege/network.get)"); - ConnectionErrorFactory.CheckHandleNullException(ret, (GetHandle() == IntPtr.Zero), "Connection Handle may have been disposed or released"); - ConnectionErrorFactory.ThrowConnectionException(ret); - } - - while (Interop.Connection.HasNextProfileIterator(iterator)) - { - IntPtr nextH; - IntPtr profileH; - Interop.Connection.GetNextProfileIterator(iterator, out nextH); - Interop.ConnectionProfile.Clone(out profileH, nextH); - - int profileType; - Interop.ConnectionProfile.GetType(profileH, out profileType); - - if ((ConnectionProfileType)profileType == ConnectionProfileType.WiFi) - { - WiFiProfile cur = new WiFiProfile(profileH); - Result.Add(cur); - } - else if ((ConnectionProfileType)profileType == ConnectionProfileType.Cellular) - { - CellularProfile cur = new CellularProfile(profileH); - Result.Add(cur); - } - else { - ConnectionProfile cur = new ConnectionProfile(profileH); - Result.Add(cur); - } - } - Interop.Connection.DestroyProfileIterator(iterator); - task.SetResult(Result); - return task.Task; - } - - internal Task OpenProfileAsync(ConnectionProfile profile) - { - Log.Debug(Globals.LogTag, "OpenProfileAsync"); - if (profile != null) - { - Log.Debug(Globals.LogTag, "OpenProfileAsync " + profile.Name); - TaskCompletionSource task = new TaskCompletionSource(); - Interop.Connection.ConnectionCallback Callback = (ConnectionError Result, IntPtr Data) => - { - Log.Debug(Globals.LogTag, "Connected " + profile.Name); - if (Result != ConnectionError.None) - { - Log.Error(Globals.LogTag, "Error occurs during connecting profile, " + Result); - task.SetException(new InvalidOperationException("Error occurs during connecting profile, " + Result)); - } - - task.SetResult(true); - }; - - int ret = Interop.Connection.OpenProfile(GetHandle(), profile.ProfileHandle, Callback, IntPtr.Zero); - if ((ConnectionError)ret != ConnectionError.None) - { - Log.Error(Globals.LogTag, "It failed to connect profile, " + (ConnectionError)ret); - ConnectionErrorFactory.CheckFeatureUnsupportedException(ret, "http://tizen.org/feature/network.telephony " + "http://tizen.org/feature/network.wifi " + "http://tizen.org/feature/network.tethering.bluetooth"); - ConnectionErrorFactory.CheckHandleNullException(ret, (GetHandle() == IntPtr.Zero || profile.ProfileHandle == IntPtr.Zero), "Connection or Profile Handle may have been disposed or released"); - ConnectionErrorFactory.ThrowConnectionException(ret); - } - - return task.Task; - } - - else - { - throw new ArgumentNullException("Profile is null"); - } - } - - internal Task CloseProfileAsync(ConnectionProfile profile) - { - Log.Debug(Globals.LogTag, "CloseProfileAsync"); - if (profile != null) - { - Log.Debug(Globals.LogTag, "CloseProfileAsync " + profile.Name); - TaskCompletionSource task = new TaskCompletionSource(); - Interop.Connection.ConnectionCallback Callback = (ConnectionError Result, IntPtr Data) => - { - if (Result != ConnectionError.None) - { - Log.Error(Globals.LogTag, "Error occurs during disconnecting profile, " + Result); - task.SetException(new InvalidOperationException("Error occurs during disconnecting profile, " + Result)); - } - - task.SetResult(true); - }; - - int ret = Interop.Connection.CloseProfile(GetHandle(), profile.ProfileHandle, Callback, IntPtr.Zero); - if ((ConnectionError)ret != ConnectionError.None) - { - Log.Error(Globals.LogTag, "It failed to disconnect profile, " + (ConnectionError)ret); - ConnectionErrorFactory.CheckFeatureUnsupportedException(ret, "http://tizen.org/feature/network.telephony " + "http://tizen.org/feature/network.wifi " + "http://tizen.org/feature/network.tethering.bluetooth"); - ConnectionErrorFactory.CheckPermissionDeniedException(ret, "(http://tizen.org/privilege/network.set)"); - ConnectionErrorFactory.CheckHandleNullException(ret, (GetHandle() == IntPtr.Zero || profile.ProfileHandle == IntPtr.Zero), "Connection or Profile Handle may have been disposed or released"); - ConnectionErrorFactory.ThrowConnectionException(ret); - } - - return task.Task; - } - - else - { - throw new ArgumentNullException("Profile is null"); - } - } - } -} diff --git a/src/Tizen.Network.Connection/Tizen.Network.Connection/ConnectionManager.cs b/src/Tizen.Network.Connection/Tizen.Network.Connection/ConnectionManager.cs deleted file mode 100755 index 3636f1d11..000000000 --- a/src/Tizen.Network.Connection/Tizen.Network.Connection/ConnectionManager.cs +++ /dev/null @@ -1,638 +0,0 @@ -/* - * 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.Collections.Generic; -using System.ComponentModel; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Runtime.InteropServices; - -/// -/// The Connection API provides functions and enumerations to get the status of network and current profile and manages profiles. -/// -namespace Tizen.Network.Connection -{ - /// - /// This class manages the connection handle resources. - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public sealed class SafeConnectionHandle : SafeHandle - { - internal SafeConnectionHandle(IntPtr handle) : base(handle, true) - { - } - - /// - /// Checks whether the handle value is valid or not. - /// - /// True if the handle is invalid, otherwise false. - public override bool IsInvalid - { - get - { - return this.handle == IntPtr.Zero; - } - } - - /// - /// Frees the handle. - /// - /// True if the handle is released successfully, otherwise false. - protected override bool ReleaseHandle() - { - this.SetHandle(IntPtr.Zero); - return true; - } - } - - /// - /// This is the ConnectionManager class. It provides functions to manage data connections. - /// - /// 3 - public static class ConnectionManager - { - private static ConnectionItem _currentConnection = null; - - /// - /// An event is called when the type of the current connection is changed. - /// - /// 3 - /// http://tizen.org/privilege/network.get - /// http://tizen.org/feature/network.ethernet - /// http://tizen.org/feature/network.telephony - /// http://tizen.org/feature/network.tethering.bluetooth - /// http://tizen.org/feature/network.wifi - /// Thrown when a feature is not supported. - /// Thrown when a permission is denied. - public static event EventHandler ConnectionTypeChanged - { - add - { - ConnectionInternalManager.Instance.ConnectionTypeChanged += value; - } - - remove - { - ConnectionInternalManager.Instance.ConnectionTypeChanged -= value; - } - } - - /// - /// An event for the ethernet cable is plugged [in/out] event. - /// - /// 3 - /// http://tizen.org/privilege/network.get - /// http://tizen.org/feature/network.ethernet - /// Thrown when a feature is not supported. - /// Thrown when a permission is denied. - public static event EventHandler EthernetCableStateChanged - { - add - { - ConnectionInternalManager.Instance.EthernetCableStateChanged += value; - } - - remove - { - ConnectionInternalManager.Instance.EthernetCableStateChanged -= value; - } - } - - /// - /// An event is called when the IP address is changed. - /// - /// 3 - /// http://tizen.org/privilege/network.get - /// http://tizen.org/feature/network.ethernet - /// http://tizen.org/feature/network.telephony - /// http://tizen.org/feature/network.tethering.bluetooth - /// http://tizen.org/feature/network.wifi - /// Thrown when a feature is not supported. - /// Thrown when a permission is denied. - public static event EventHandler IPAddressChanged - { - add - { - ConnectionInternalManager.Instance.IPAddressChanged += value; - } - - remove - { - ConnectionInternalManager.Instance.IPAddressChanged -= value; - } - } - - /// - /// An event is called when the proxy address is changed. - /// - /// 3 - /// http://tizen.org/privilege/network.get - /// http://tizen.org/feature/network.ethernet - /// http://tizen.org/feature/network.telephony - /// http://tizen.org/feature/network.tethering.bluetooth - /// http://tizen.org/feature/network.wifi - /// Thrown when a feature is not supported. - /// Thrown when a permission is denied. - public static event EventHandler ProxyAddressChanged - { - add - { - ConnectionInternalManager.Instance.ProxyAddressChanged += value; - } - - remove - { - ConnectionInternalManager.Instance.ProxyAddressChanged -= value; - } - } - - /// - /// Gets the connection handle. - /// - /// 3 - /// Instance of SafeConnectionHandle. - [EditorBrowsable(EditorBrowsableState.Never)] - public static SafeConnectionHandle GetConnectionHandle() - { - IntPtr handle = ConnectionInternalManager.Instance.GetHandle(); - return new SafeConnectionHandle(handle); - } - - /// - /// Gets the IP address of the current connection. - /// - /// 3 - /// The address family. - /// IP address of the connection (global address in case of IPv6). - /// http://tizen.org/privilege/network.get - /// http://tizen.org/feature/network.ethernet - /// http://tizen.org/feature/network.telephony - /// http://tizen.org/feature/network.tethering.bluetooth - /// http://tizen.org/feature/network.wifi - /// Thrown when a feature is not supported. - /// Thrown when a permission is denied. - /// Thrown when a value is an invalid parameter. - /// Thrown when memory is not enough to continue execution. - /// Thrown when a connection instance is invalid or when a method fails due to an invalid operation. - public static System.Net.IPAddress GetIPAddress(AddressFamily family) - { - return ConnectionInternalManager.Instance.GetIPAddress(family); - } - - /// - /// Gets all the IPv6 addresses of the current connection. - /// - /// 3 - /// The type of current network connection. - /// A list of IPv6 addresses of the connection. - /// http://tizen.org/privilege/network.get - /// http://tizen.org/feature/network.ethernet - /// http://tizen.org/feature/network.telephony - /// http://tizen.org/feature/network.tethering.bluetooth - /// http://tizen.org/feature/network.wifi - /// Thrown when a feature is not supported. - /// Thrown when a permission is denied. - /// Thrown when a value is an invalid parameter. - /// Thrown when memory is not enough to continue execution. - /// Thrown when a connection instance is invalid or when a method fails due to an invalid operation. - public static IEnumerable GetAllIPv6Addresses(ConnectionType type) - { - return ConnectionInternalManager.Instance.GetAllIPv6Addresses(type); - } - - /// - /// Gets the proxy address of the current connection. - /// - /// 3 - /// The address family. - /// Proxy address of the connection. - /// http://tizen.org/privilege/network.get - /// http://tizen.org/feature/network.ethernet - /// http://tizen.org/feature/network.telephony - /// http://tizen.org/feature/network.tethering.bluetooth - /// http://tizen.org/feature/network.wifi - /// Thrown when a feature is not supported. - /// Thrown when a permission is denied. - /// Thrown when a value is an invalid parameter. - /// Thrown when memory is not enough to continue execution. - /// Thrown when a connection instance is invalid or when a method fails due to an invalid operation. - public static string GetProxy(AddressFamily family) - { - return ConnectionInternalManager.Instance.GetProxy(family); - } - - /// - /// Gets the MAC address of the Wi-Fi or ethernet. - /// - /// 3 - /// The type of current network connection. - /// MAC address of the Wi-Fi or ethernet. - /// http://tizen.org/privilege/network.get - /// http://tizen.org/feature/network.ethernet - /// http://tizen.org/feature/network.telephony - /// http://tizen.org/feature/network.tethering.bluetooth - /// http://tizen.org/feature/network.wifi - /// Thrown when a feature is not supported. - /// Thrown when a permission is denied. - /// Thrown when value is an invalid parameter. - /// Thrown when memory is not enough to continue execution. - /// Thrown when a connection instance is invalid or when a method fails due to an invalid operation. - public static string GetMacAddress(ConnectionType type) - { - return ConnectionInternalManager.Instance.GetMacAddress(type); - } - - /// - /// Gets the statistics information. - /// - /// 3 - /// The type of connection (only WiFi and Cellular are supported). - /// The type of statistics. - /// The statistics information associated with statisticsType. - /// http://tizen.org/privilege/network.get - /// http://tizen.org/feature/network.ethernet - /// http://tizen.org/feature/network.telephony - /// http://tizen.org/feature/network.tethering.bluetooth - /// http://tizen.org/feature/network.wifi - /// Thrown when a feature is not supported. - /// Thrown when a permission is denied. - /// Thrown when value is an invalid parameter. - /// Thrown when memory is not enough to continue execution. - /// Thrown when a connection instance is invalid or when a method fails due to invalid operation. - public static long GetStatistics(ConnectionType connectionType, StatisticsType statisticsType) - { - return ConnectionInternalManager.Instance.GetStatistics(connectionType, statisticsType); - } - - /// - /// Resets the statistics information. - /// - /// 3 - /// The type of connection (only WiFi and Cellular are supported). - /// The type of statistics. - /// http://tizen.org/privilege/network.get - /// http://tizen.org/privilege/network.set - /// http://tizen.org/feature/network.ethernet - /// http://tizen.org/feature/network.telephony - /// http://tizen.org/feature/network.tethering.bluetooth - /// http://tizen.org/feature/network.wifi - /// Thrown when a feature is not supported. - /// Thrown when a permission is denied. - /// Thrown when a value is an invalid parameter. - /// Thrown when memory is not enough to continue execution. - /// Thrown when a connection instance is invalid or when a method fails due to an invalid operation. - public static void ResetStatistics(ConnectionType connectionType, StatisticsType statisticsType) - { - ConnectionInternalManager.Instance.ResetStatistics(connectionType, statisticsType); - } - - /// - /// Adds a route to the routing table. - /// - /// 4 - /// The address family. - /// The name of the network interface. - /// The IP address of the host. - /// The gateway address. - /// http://tizen.org/privilege/network.get - /// http://tizen.org/privilege/network.set - /// http://tizen.org/feature/network.telephony - /// http://tizen.org/feature/network.wifi - /// http://tizen.org/feature/network.tethering.bluetooth - /// http://tizen.org/feature/network.ethernet - /// Thrown when a feature is not supported. - /// Thrown when a permission is denied. - /// Thrown when a value is an invalid parameter. - /// Thrown when an interfaceName or a hostAddress or a gateway is null. - /// Thrown when memory is not enough to continue execution. - /// Thrown when a connection instance is invalid or when a method fails due to an invalid operation. - public static void AddRoute(AddressFamily family, string interfaceName, System.Net.IPAddress hostAddress, System.Net.IPAddress gateway) - { - ConnectionInternalManager.Instance.AddRoute(family, interfaceName, hostAddress, gateway); - } - - /// - /// Removes a route from the routing table. - /// - /// 4 - /// The address family. - /// The name of network interface. - /// The IP address of the host. - /// The gateway address. - /// http://tizen.org/privilege/network.get - /// http://tizen.org/privilege/network.set - /// http://tizen.org/feature/network.telephony - /// http://tizen.org/feature/network.wifi - /// http://tizen.org/feature/network.tethering.bluetooth - /// http://tizen.org/feature/network.ethernet - /// Thrown when a feature is not supported. - /// Thrown when a permission is denied. - /// Thrown when a value is an invalid parameter. - /// Thrown when an interfaceName or a hostAddress or a gateway is null. - /// Thrown when memory is not enough to continue execution. - /// Thrown when a connection instance is invalid or when a method fails due to an invalid operation. - public static void RemoveRoute(AddressFamily family, string interfaceName, System.Net.IPAddress hostAddress, System.Net.IPAddress gateway) - { - ConnectionInternalManager.Instance.RemoveRoute(family, interfaceName, hostAddress, gateway); - } - - /// - /// The type and state of the current profile for data connection. - /// - /// 3 - /// Instance of ConnectionItem. - public static ConnectionItem CurrentConnection - { - get - { - if (_currentConnection == null) - { - _currentConnection = new ConnectionItem(); - } - - return _currentConnection; - } - } - - /// - /// Creates a cellular profile handle. - /// - /// 3 - /// The type of profile. Cellular profile type is supported. - /// The keyword included in profile name. - /// CellularProfile object. - /// http://tizen.org/privilege/network.get - /// http://tizen.org/feature/network.telephony - /// http://tizen.org/feature/network.wifi - /// Thrown when a feature is not supported. - /// Thrown when a permission is denied. - /// Thrown when a value is an invalid parameter. - /// Thrown when a keyword value is null. - /// Thrown when a method fails due to invalid operation. - public static CellularProfile CreateCellularProfile(ConnectionProfileType type, string keyword) - { - IntPtr profileHandle = IntPtr.Zero; - if (type == ConnectionProfileType.Cellular) - { - profileHandle = ConnectionInternalManager.Instance.CreateCellularProfile(type, keyword); - } - - else - { - Log.Error(Globals.LogTag, "ConnectionProfile Type is not supported"); - ConnectionErrorFactory.ThrowConnectionException((int)ConnectionError.InvalidParameter); - } - - return new CellularProfile(profileHandle); - } - - /// - /// The state of the cellular connection. - /// - /// 3 - /// Cellular network state. - /// http://tizen.org/privilege/network.get - public static CellularState CellularState - { - get - { - return ConnectionInternalManager.Instance.CellularState; - } - } - - /// - /// The state of the Wi-Fi connection. - /// - /// 3 - /// WiFi connection state. - /// http://tizen.org/privilege/network.get - public static ConnectionState WiFiState - { - get - { - return ConnectionInternalManager.Instance.WiFiState; - } - } - - /// - /// The state of the Bluetooth connection. - /// - /// 3 - /// Bluetooth connection state. - /// http://tizen.org/privilege/network.get - public static ConnectionState BluetoothState - { - get - { - return ConnectionInternalManager.Instance.BluetoothState; - } - } - - /// - /// The Ethernet connection state. - /// - /// 3 - /// Ethernet connection state. - /// http://tizen.org/privilege/network.get - public static ConnectionState EthernetState - { - get - { - return ConnectionInternalManager.Instance.EthernetState; - } - } - - /// - /// Checks if the ethernet cable is attached or not. - /// - /// 3 - /// Ethernet cable state. - /// http://tizen.org/privilege/network.get - public static EthernetCableState EthernetCableState - { - get - { - return ConnectionInternalManager.Instance.EthernetCableState; - } - } - - } // class ConnectionManager - - /// - /// This class contains connection information, such as connection type and state. - /// - /// 3 - public class ConnectionItem - { - internal ConnectionItem() - { - } - - /// - /// The type of the current profile for data connection. - /// - /// 3 - /// Data connection current profile. - /// http://tizen.org/privilege/network.get - public ConnectionType Type - { - get - { - return ConnectionInternalManager.Instance.ConnectionType; - } - } - - /// - /// The state of the current profile for data connection. - /// - /// 3 - /// Connection state of the current connection type. - /// http://tizen.org/privilege/network.get - public ConnectionState State - { - get - { - if (ConnectionInternalManager.Instance.ConnectionType == ConnectionType.Cellular) - { - if (ConnectionInternalManager.Instance.CellularState == CellularState.Connected) - { - return ConnectionState.Connected; - } - else if (ConnectionInternalManager.Instance.CellularState == CellularState.Available) - { - return ConnectionState.Disconnected; - } - else { - return ConnectionState.Deactivated; - } - } - else if (ConnectionInternalManager.Instance.ConnectionType == ConnectionType.Bluetooth) - { - return ConnectionInternalManager.Instance.BluetoothState; - } - else if (ConnectionInternalManager.Instance.ConnectionType == ConnectionType.WiFi) - { - return ConnectionInternalManager.Instance.WiFiState; - } - else if (ConnectionInternalManager.Instance.ConnectionType == ConnectionType.Ethernet) - { - return ConnectionInternalManager.Instance.EthernetState; - } - else { // TO DO : Add Net Proxy - return ConnectionState.Disconnected; - } - } - } - } // class ConnectionItem - - /// - /// An extended EventArgs class, which contains changed connection type. - /// - /// 3 - public class ConnectionTypeEventArgs : EventArgs - { - private ConnectionType Type = ConnectionType.Disconnected; - - internal ConnectionTypeEventArgs(ConnectionType type) - { - Type = type; - } - - /// - /// The connection type. - /// - /// 3 - /// Type of the connection. - public ConnectionType ConnectionType - { - get - { - return Type; - } - } - } - - /// - /// An extended EventArgs class, which contains changed ethernet cable state. - /// - /// 3 - public class EthernetCableStateEventArgs : EventArgs - { - private EthernetCableState State; - - internal EthernetCableStateEventArgs(EthernetCableState state) - { - State = state; - } - - /// - /// The ethernet cable state. - /// - /// 3 - /// Attached or detached state of the ethernet cable. - public EthernetCableState EthernetCableState - { - get - { - return State; - } - } - } - - /// - /// An extended EventArgs class, which contains changed address. - /// - /// 3 - public class AddressEventArgs : EventArgs - { - private string IPv4 = ""; - private string IPv6 = ""; - - internal AddressEventArgs(string ipv4, string ipv6) - { - IPv4 = ipv4; - IPv6 = ipv6; - } - - /// - /// The IPV4 address. - /// - /// 3 - /// IP address in the format of the IPV4 syntax. - public string IPv4Address - { - get - { - return IPv4; - } - } - - /// - /// The IPV6 address. - /// - /// 3 - /// IP address in the format of the IPV6 syntax. - public string IPv6Address - { - get - { - return IPv6; - } - } - } -} diff --git a/src/Tizen.Network.Connection/Tizen.Network.Connection/ConnectionProfile.cs b/src/Tizen.Network.Connection/Tizen.Network.Connection/ConnectionProfile.cs deleted file mode 100755 index e234476ad..000000000 --- a/src/Tizen.Network.Connection/Tizen.Network.Connection/ConnectionProfile.cs +++ /dev/null @@ -1,451 +0,0 @@ -/* - * 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.Collections.Generic; -using System.Linq; -using System.Text; -using System.Runtime.InteropServices; - -namespace Tizen.Network.Connection -{ - /// - /// This is the ConnectionProfile class. It provides event and properties of the connection profile. - /// - /// 3 - public class ConnectionProfile : IDisposable - { - internal IntPtr ProfileHandle = IntPtr.Zero; - private IAddressInformation IPv4; - private IAddressInformation IPv6; - private bool disposed = false; - private EventHandler _ProfileStateChanged = null; - - private Interop.ConnectionProfile.ProfileStateChangedCallback _profileChangedCallback; - - internal IntPtr GetHandle() - { - return ProfileHandle; - } - - /// - /// The event is called when the state of profile is changed. - /// - /// 3 - /// http://tizen.org/feature/network.ethernet - /// http://tizen.org/feature/network.telephony - /// http://tizen.org/feature/network.tethering.bluetooth - /// http://tizen.org/feature/network.wifi - /// Thrown when a feature is not supported. - public event EventHandler ProfileStateChanged - { - add - { - Log.Debug(Globals.LogTag, "ProfileStateChanged add"); - if (_ProfileStateChanged == null) - { - ProfileStateChangedStart(); - } - _ProfileStateChanged += value; - } - remove - { - Log.Debug(Globals.LogTag, "ProfileStateChanged remove"); - _ProfileStateChanged -= value; - if (_ProfileStateChanged == null) - { - ProfileStateChangedStop(); - } - } - } - - private void ProfileStateChangedStart() - { - _profileChangedCallback = (ProfileState state, IntPtr userData) => - { - if (_ProfileStateChanged != null) - { - _ProfileStateChanged(null, new ProfileStateEventArgs(state)); - } - }; - - Log.Debug(Globals.LogTag, "ProfileStateChangedStart"); - int ret = Interop.ConnectionProfile.SetStateChangeCallback(ProfileHandle, _profileChangedCallback, IntPtr.Zero); - if ((ConnectionError)ret != ConnectionError.None) - { - Log.Error(Globals.LogTag, "It failed to register callback for changing profile state, " + (ConnectionError)ret); - } - } - - private void ProfileStateChangedStop() - { - Log.Debug(Globals.LogTag, "ProfileStateChangedStop"); - int ret = Interop.ConnectionProfile.UnsetStateChangeCallback(ProfileHandle); - if ((ConnectionError)ret != ConnectionError.None) - { - Log.Error(Globals.LogTag, "It failed to unregister callback for changing profile state, " + (ConnectionError)ret); - } - } - - internal ConnectionProfile(IntPtr handle) - { - ProfileHandle = handle; - IPv4 = new ConnectionAddressInformation(ProfileHandle, AddressFamily.IPv4); - IPv6 = new ConnectionAddressInformation(ProfileHandle, AddressFamily.IPv6); - } - - ~ConnectionProfile() - { - Dispose(false); - } - - /// - /// Disposes the memory allocated to unmanaged resources. - /// - /// 3 - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - - private void Dispose(bool disposing) - { - Log.Debug(Globals.LogTag, ">>> ConnectionProfile Dispose with " + disposing); - if (disposed) - return; - - if (disposing) - { - // Free managed objects. - UnregisterEvents(); - Destroy(); - } - disposed = true; - } - - private void UnregisterEvents() - { - if (_ProfileStateChanged != null) - { - ProfileStateChangedStop(); - } - } - - private void Destroy() - { - Interop.ConnectionProfile.Destroy(ProfileHandle); - ProfileHandle = IntPtr.Zero; - } - - internal void CheckDisposed() - { - if (disposed) - { - throw new ObjectDisposedException(GetType().FullName); - } - } - - /// - /// The profile ID. - /// - /// 3 - /// Unique ID of the profile. - public string Id - { - get - { - IntPtr Value; - int ret = Interop.ConnectionProfile.GetId(ProfileHandle, out Value); - if ((ConnectionError)ret != ConnectionError.None) - { - Log.Error(Globals.LogTag, "It failed to get id of connection profile, " + (ConnectionError)ret); - } - string result = Marshal.PtrToStringAnsi(Value); - Interop.Libc.Free(Value); - return result; - } - } - - /// - /// The profile name. - /// - /// 3 - /// User friendly name of the profile. - public string Name - { - get - { - IntPtr Value; - int ret = Interop.ConnectionProfile.GetName(ProfileHandle, out Value); - if ((ConnectionError)ret != ConnectionError.None) - { - Log.Error(Globals.LogTag, "It failed to get name of connection profile, " + (ConnectionError)ret); - } - string result = Marshal.PtrToStringAnsi(Value); - Interop.Libc.Free(Value); - return result; - } - } - - /// - /// The network type. - /// - /// 3 - /// Profile type of the network connection. - public ConnectionProfileType Type - { - get - { - int Value; - int ret = Interop.ConnectionProfile.GetType(ProfileHandle, out Value); - if ((ConnectionError)ret != ConnectionError.None) - { - Log.Error(Globals.LogTag, "It failed to get type of connection profile, " + (ConnectionError)ret); - } - return (ConnectionProfileType)Value; - } - } - - /// - /// The name of the network interface. - /// - /// 3 - /// Network interface name, for example, eth0 and pdp0. - public string InterfaceName - { - get - { - IntPtr Value; - int ret = Interop.ConnectionProfile.GetNetworkInterfaceName(ProfileHandle, out Value); - if ((ConnectionError)ret != ConnectionError.None) - { - Log.Error(Globals.LogTag, "It failed to get network interface name, " + (ConnectionError)ret); - } - string result = Marshal.PtrToStringAnsi(Value); - Interop.Libc.Free(Value); - return result; - } - } - - /// - /// Refreshes the profile information. - /// - /// 3 - /// http://tizen.org/privilege/network.get - /// http://tizen.org/feature/network.ethernet - /// http://tizen.org/feature/network.telephony - /// http://tizen.org/feature/network.tethering.bluetooth - /// http://tizen.org/feature/network.wifi - /// Thrown when a feature is not supported. - /// Thrown when a permission is denied. - /// Thrown when a value is an invalid parameter. - /// Thrown when a profile instance is invalid or when a method fails due to an invalid operation. - /// Thrown when an operation is performed on a disposed object. - public void Refresh() - { - CheckDisposed(); - int ret = Interop.ConnectionProfile.Refresh(ProfileHandle); - if ((ConnectionError)ret != ConnectionError.None) - { - Log.Error(Globals.LogTag, "It failed to get network interface name, " + (ConnectionError)ret); - ConnectionErrorFactory.CheckFeatureUnsupportedException(ret, "http://tizen.org/feature/network.telephony " + "http://tizen.org/feature/network.wifi " + "http://tizen.org/feature/network.tethering.bluetooth " + "http://tizen.org/feature/network.ethernet"); - ConnectionErrorFactory.CheckPermissionDeniedException(ret, "(http://tizen.org/privilege/network.get)"); - ConnectionErrorFactory.CheckHandleNullException(ret, (ProfileHandle == IntPtr.Zero), "ProfileHandle may have been disposed or released"); - ConnectionErrorFactory.ThrowConnectionException(ret); - } - } - - /// - /// Gets the network state. - /// - /// 3 - /// The address family. - /// The network state. - /// http://tizen.org/feature/network.ethernet - /// http://tizen.org/feature/network.telephony - /// http://tizen.org/feature/network.tethering.bluetooth - /// http://tizen.org/feature/network.wifi - /// Thrown when a feature is not supported. - /// Thrown when a value is an invalid parameter. - /// Thrown when a profile instance is invalid or when a method fails due to an invalid operation. - /// Thrown when an operation is performed on a disposed object. - public ProfileState GetState(AddressFamily family) - { - CheckDisposed(); - int Value; - int ret = (int)ConnectionError.None; - if (family == AddressFamily.IPv4) - { - ret = Interop.ConnectionProfile.GetState(ProfileHandle, out Value); - } - - else - { - ret = Interop.ConnectionProfile.GetIPv6State(ProfileHandle, out Value); - } - - if ((ConnectionError)ret != ConnectionError.None) - { - Log.Error(Globals.LogTag, "It failed to get profile state, " + (ConnectionError)ret); - ConnectionErrorFactory.CheckFeatureUnsupportedException(ret, "http://tizen.org/feature/network.telephony " + "http://tizen.org/feature/network.wifi " + "http://tizen.org/feature/network.tethering.bluetooth " + "http://tizen.org/feature/network.ethernet"); - ConnectionErrorFactory.CheckHandleNullException(ret, (ProfileHandle == IntPtr.Zero), "ProfileHandle may have been disposed or released"); - ConnectionErrorFactory.ThrowConnectionException(ret); - } - - return (ProfileState)Value; - } - - /// - /// The Proxy type. - /// - /// 3 - /// Proxy type of the connection. - /// Thrown during set when a feature is not supported. - /// Thrown during set when a value is an invalid parameter. - /// Thrown during set when a profile instance is invalid or when a method fails due to an invalid operation. - /// Thrown during set when a operation is performed on a disposed object. - public ProxyType ProxyType - { - get - { - int Value; - int ret = Interop.ConnectionProfile.GetProxyType(ProfileHandle, out Value); - if ((ConnectionError)ret != ConnectionError.None) - { - Log.Error(Globals.LogTag, "It failed to get proxy type, " + (ConnectionError)ret); - } - return (ProxyType)Value; - - } - - set - { - CheckDisposed(); - int ret = Interop.ConnectionProfile.SetProxyType(ProfileHandle, (int)value); - if ((ConnectionError)ret != ConnectionError.None) - { - Log.Error(Globals.LogTag, "It failed to set proxy type, " + (ConnectionError)ret); - ConnectionErrorFactory.CheckFeatureUnsupportedException(ret, "http://tizen.org/feature/network.telephony " + "http://tizen.org/feature/network.wifi " + "http://tizen.org/feature/network.tethering.bluetooth " + "http://tizen.org/feature/network.ethernet"); - ConnectionErrorFactory.CheckHandleNullException(ret, (ProfileHandle == IntPtr.Zero), "ProfileHandle may have been disposed or released"); - ConnectionErrorFactory.ThrowConnectionException(ret); - } - } - } - - /// - /// The proxy address. - /// - /// 3 - /// Proxy address of the connection. - /// Thrown during set when a feature is not supported. - /// Thrown during set when a value is an invalid parameter. - /// Thrown during set when a value is null. - /// Thrown during set when a profile instance is invalid or when a method fails due to an invalid operation. - /// Thrown when an operation is performed on a disposed object. - public string ProxyAddress - { - get - { - IntPtr Value; - int ret = Interop.ConnectionProfile.GetProxyAddress(ProfileHandle, (int)AddressFamily.IPv4, out Value); - if ((ConnectionError)ret != ConnectionError.None) - { - Log.Error(Globals.LogTag, "It failed to get proxy address, " + (ConnectionError)ret); - } - string result = Marshal.PtrToStringAnsi(Value); - Interop.Libc.Free(Value); - return result; - - } - - set - { - CheckDisposed(); - if (value != null) - { - int ret = Interop.ConnectionProfile.SetProxyAddress(ProfileHandle, (int)AddressFamily.IPv4, value); - if ((ConnectionError)ret != ConnectionError.None) - { - Log.Error(Globals.LogTag, "It failed to set proxy address, " + (ConnectionError)ret); - ConnectionErrorFactory.CheckFeatureUnsupportedException(ret, "http://tizen.org/feature/network.telephony " + "http://tizen.org/feature/network.wifi " + "http://tizen.org/feature/network.tethering.bluetooth " + "http://tizen.org/feature/network.ethernet"); - ConnectionErrorFactory.CheckHandleNullException(ret, (ProfileHandle == IntPtr.Zero), "ProfileHandle may have been disposed or released"); - ConnectionErrorFactory.ThrowConnectionException(ret); - } - } - - else - { - throw new ArgumentNullException("ProxyAddress is null"); - } - } - } - - /// - /// The address information (IPv4). - /// - /// 3 - /// Instance of IAddressInformation with IPV4 address. - public IAddressInformation IPv4Settings - { - get - { - return IPv4; - - } - } - - /// - /// The address information (IPv6). - /// - /// 3 - /// Instance of IAddressInformation with IPV6 address. - public IAddressInformation IPv6Settings - { - get - { - return IPv6; - } - } - } - - /// - /// An extended EventArgs class, which contains changed profile state. - /// - /// 3 - public class ProfileStateEventArgs : EventArgs - { - private ProfileState _State = ProfileState.Disconnected; - - internal ProfileStateEventArgs(ProfileState state) - { - _State = state; - } - - /// - /// The profile state. - /// - /// 3 - /// State type of the connection profile. - public ProfileState State - { - get - { - return _State; - } - } - } -} diff --git a/src/Tizen.Network.Connection/Tizen.Network.Connection/ConnectionProfileManager.cs b/src/Tizen.Network.Connection/Tizen.Network.Connection/ConnectionProfileManager.cs deleted file mode 100755 index e205c4875..000000000 --- a/src/Tizen.Network.Connection/Tizen.Network.Connection/ConnectionProfileManager.cs +++ /dev/null @@ -1,268 +0,0 @@ -/* - * 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.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Collections; - -namespace Tizen.Network.Connection -{ - /// - /// This is the ConnectionProfileManager class. It provides functions to add, get, connect, or modify the connection profile. - /// - /// 3 - public static class ConnectionProfileManager - { - /// - /// Adds a new profile. - /// - /// 3 - /// The cellular profile object. - /// http://tizen.org/privilege/network.profile - /// http://tizen.org/privilege/network.get - /// http://tizen.org/feature/network.telephony - /// http://tizen.org/feature/network.wifi - /// http://tizen.org/feature/network.tethering.bluetooth - /// http://tizen.org/feature/network.ethernet - /// Thrown when a feature is not supported. - /// Thrown when a permission is denied. - /// Thrown when a value is an invalid parameter. - /// Thrown when a value is null. - /// Thrown when memory is not enough to continue execution. - /// Thrown when connection or profile instance is invalid or when a method fails due to an invalid operation. - public static void AddCellularProfile(CellularProfile profile) - { - Log.Debug(Globals.LogTag, "AddCellularProfile"); - ConnectionInternalManager.Instance.AddCellularProfile(profile); - } - - /// - /// Gets the list of the profile with the profile list type. - /// - /// 3 - /// The type of profile. - /// List of connection profile objects. - /// http://tizen.org/privilege/network.get - /// http://tizen.org/feature/network.telephony - /// http://tizen.org/feature/network.wifi - /// http://tizen.org/feature/network.tethering.bluetooth - /// http://tizen.org/feature/network.ethernet - /// Thrown when a feature is not supported. - /// Thrown when a permission is denied. - /// Thrown when value is an invalid parameter. - /// Thrown when memory is not enough to continue execution. - /// Thrown when a connection instance has been disposed. - public static Task> GetProfileListAsync(ProfileListType type) - { - Log.Debug(Globals.LogTag, "GetProfileListAsync"); - return ConnectionInternalManager.Instance.GetProfileListAsync(type); - } - - /// - /// Opens a connection of profile asynchronously. - /// - /// 3 - /// The connection profile object. - /// A task indicates whether the ConnectProfileAsync method is done successfully or not. - /// http://tizen.org/privilege/network.get - /// http://tizen.org/privilege/network.set - /// http://tizen.org/feature/network.telephony - /// http://tizen.org/feature/network.wifi - /// http://tizen.org/feature/network.tethering.bluetooth - /// http://tizen.org/feature/network.ethernet - /// Thrown when a feature is not supported. - /// Thrown when a permission is denied. - /// Thrown when value is an invalid parameter. - /// Thrown when a value is null. - /// Thrown when memory is not enough to continue execution. - /// Thrown when a connection or a profile instance is invalid or when a method fails due to an invalid operation. - public static Task ConnectProfileAsync(ConnectionProfile profile) - { - Log.Debug(Globals.LogTag, "ConnectProfile"); - return ConnectionInternalManager.Instance.OpenProfileAsync(profile); - } - - /// - /// Closes a connection of profile. - /// - /// 3 - /// The connection profile object. - /// A task indicates whether the DisconnectProfileAsync method is done successfully or not. - /// http://tizen.org/privilege/network.get - /// http://tizen.org/privilege/network.set - /// http://tizen.org/feature/network.telephony - /// http://tizen.org/feature/network.wifi - /// http://tizen.org/feature/network.tethering.bluetooth - /// http://tizen.org/feature/network.ethernet - /// Thrown when a feature is not supported. - /// Thrown when a permission is denied. - /// Thrown when a value is an invalid parameter. - /// Thrown when a value is null. - /// Thrown when memory is not enough to continue execution. - /// Thrown when a connection or a profile instance is invalid or when a method fails due to invalid operation. - public static Task DisconnectProfileAsync(ConnectionProfile profile) - { - Log.Debug(Globals.LogTag, "DisconnectProfileAsync"); - return ConnectionInternalManager.Instance.CloseProfileAsync(profile); - } - - /// - /// Removes an existing profile. - /// - /// 3 - /// The connection profile object. - /// http://tizen.org/privilege/network.get - /// http://tizen.org/privilege/network.profile - /// http://tizen.org/feature/network.telephony - /// http://tizen.org/feature/network.wifi - /// http://tizen.org/feature/network.tethering.bluetooth - /// http://tizen.org/feature/network.ethernet - /// Thrown when a feature is not supported. - /// Thrown when a permission is denied. - /// Thrown when value is an invalid parameter. - /// Thrown when a value is null. - /// Thrown when memory is not enough to continue execution. - /// Thrown when a connection or a profile instance is invalid or when a method fails due to invalid operation. - public static void RemoveProfile(ConnectionProfile profile) - { - Log.Debug(Globals.LogTag, "RemoveProfile. Id: " + profile.Id + ", Name: " + profile.Name + ", Type: " + profile.Type); - ConnectionInternalManager.Instance.RemoveProfile(profile); - } - - /// - /// Updates an existing profile. - /// When a profile is changed, these changes will be not applied to the ConnectionProfileManager immediately. - /// When you call this function, your changes affect the ConnectionProfileManager and the existing profile is updated. - /// - /// 3 - /// The connection profile object. - /// http://tizen.org/privilege/network.get - /// http://tizen.org/privilege/network.profile - /// http://tizen.org/feature/network.telephony - /// http://tizen.org/feature/network.wifi - /// http://tizen.org/feature/network.tethering.bluetooth - /// http://tizen.org/feature/network.ethernet - /// Thrown when a feature is not supported. - /// Thrown when a permission is denied. - /// Thrown when a value is an invalid parameter. - /// Thrown when a value is null. - /// Thrown when memory is not enough to continue execution. - /// Thrown when a connection or a profile instance is invalid or when a method fails due to an invalid operation. - public static void UpdateProfile(ConnectionProfile profile) - { - Log.Debug(Globals.LogTag, "UpdateProfile"); - ConnectionInternalManager.Instance.UpdateProfile(profile); - } - - /// - /// Gets the name of the default profile. - /// - /// 3 - /// Connection profile object. - /// http://tizen.org/privilege/network.get - /// http://tizen.org/feature/network.telephony - /// http://tizen.org/feature/network.wifi - /// http://tizen.org/feature/network.tethering.bluetooth - /// http://tizen.org/feature/network.ethernet - /// Thrown when a feature is not supported. - /// Thrown when a permission is denied. - /// Thrown when a value is an invalid parameter. - /// Thrown when memory is not enough to continue execution. - /// Thrown when a connection instance is invalid or when a method fails due to an invalid operation. - public static ConnectionProfile GetCurrentProfile() - { - Log.Debug(Globals.LogTag, "GetCurrentProfile"); - return ConnectionInternalManager.Instance.GetCurrentProfile(); - } - - /// - /// Gets the default profile, which provides the given cellular service. - /// - /// 3 - /// The cellular service type. - /// Connection profile object. - /// http://tizen.org/privilege/network.get - /// http://tizen.org/feature/network.telephony - /// http://tizen.org/feature/network.wifi - /// http://tizen.org/feature/network.tethering.bluetooth - /// http://tizen.org/feature/network.ethernet - /// Thrown when a feature is not supported. - /// Thrown when a permission is denied. - /// Thrown when a value is an invalid parameter. - /// Thrown when memory is not enough to continue execution. - /// Thrown when a connection instance is invalid or when a method fails due to an invalid operation. - public static ConnectionProfile GetDefaultCellularProfile(CellularServiceType type) - { - Log.Debug(Globals.LogTag, "GetDefaultCurrentProfile"); - return ConnectionInternalManager.Instance.GetDefaultCellularProfile(type); - } - - /// - /// Sets the default profile, which provides the given cellular service. - /// - /// 3 - /// The cellular service type. - /// The connection profile object. - /// A task indicates whether the SetDefaultCellularProfile method is done successfully or not. - /// http://tizen.org/privilege/network.get - /// http://tizen.org/privilege/network.profile - /// http://tizen.org/feature/network.telephony - /// http://tizen.org/feature/network.wifi - /// http://tizen.org/feature/network.tethering.bluetooth - /// http://tizen.org/feature/network.ethernet - /// Thrown when a feature is not supported. - /// Thrown when a permission is denied. - /// Thrown when a value is an invalid parameter. - /// Thrown when a value is null. - /// Thrown when memory is not enough to continue execution. - /// Thrown when a connection or a profile instance is invalid or when a method fails due to invalid operation. - public static Task SetDefaultCellularProfile(CellularServiceType type, ConnectionProfile profile) - { - Log.Debug(Globals.LogTag, "SetDefaultCellularProfile"); - return ConnectionInternalManager.Instance.SetDefaultCellularProfile(type, profile); - } - } - - /// - /// An extended EventArgs class, which contains the state of changed connection profile. - /// - /// 3 - public class ConnectionProfileStateEventArgs : EventArgs - { - private ConnectionProfileState State; - - internal ConnectionProfileStateEventArgs(ConnectionProfileState state) - { - State = state; - } - - /// - /// The connection profile state. - /// - /// 3 - /// State of the connection profile. - public ConnectionProfileState ConnectionProfileState - { - get - { - return State; - } - } - } -} diff --git a/src/Tizen.Network.Connection/Tizen.Network.Connection/ConnectionTypes.cs b/src/Tizen.Network.Connection/Tizen.Network.Connection/ConnectionTypes.cs deleted file mode 100755 index 51c613ee7..000000000 --- a/src/Tizen.Network.Connection/Tizen.Network.Connection/ConnectionTypes.cs +++ /dev/null @@ -1,284 +0,0 @@ -/* - * 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.Collections.Generic; -using System.Linq; -using System.Text; -using Tizen.Internals.Errors; - - -namespace Tizen.Network.Connection -{ - /// - /// Enumeration for the connection type. - /// - /// 3 - public enum ConnectionType - { - Disconnected = 0, /**< Disconnected */ - WiFi = 1, /**< Wi-Fi type */ - Cellular = 2, /**< Cellular type */ - Ethernet = 3, /**< Ethernet type */ - Bluetooth = 4, /**< Bluetooth type */ - NetProxy = 5 /**< Proxy type for internet connection */ - } - - /// - /// Enumeration for the address family. - /// - /// 3 - public enum AddressFamily - { - IPv4 = 0, /**< IPv4 Address */ - IPv6 = 1 /**< IPv6 Address */ - } - - /// - /// Enumeration for the cellular network state. - /// - /// 3 - public enum CellularState - { - OutOfService = 0, /**< Out of service */ - FlightMode = 1, /**< Flight mode */ - RoamingOff = 2, /**< Roaming is turned off */ - CallOnlyAvailable = 3, /**< Call is only available */ - Available = 4, /**< Available but not connected yet */ - Connected = 5, /**< Connected */ - } - - /// - /// Enumeration for the connection state. - /// - /// 3 - public enum ConnectionState - { - Deactivated = 0, /**< Deactivated */ - Disconnected = 1, /**< Disconnected */ - Connected = 2, /**< Connected */ - } - - /// - /// Enumeration for the attached or detached state of the ethernet cable. - /// - /// 3 - public enum EthernetCableState - { - Detached = 0, /**< Ethernet cable is detached */ - Attached = 1, /**< Ethernet cable is attached */ - } - - /// - /// Enumeration for the statistics type. - /// - /// 3 - public enum StatisticsType - { - LastReceivedData = 0, /**< Last received data */ - LastSentData = 1, /**< Last sent data */ - TotalReceivedData = 2, /**< Total received data */ - TotalSentData = 3, /**< Total sent data */ - } - - /// - /// Enumeration for the network connection type. - /// - /// 3 - public enum ConnectionProfileType - { - Cellular = 0, /**< Cellular type */ - WiFi = 1, /**< Wi-Fi type */ - Ethernet = 2, /**< Ethernet type */ - Bt = 3, /**< Bluetooth type */ - } - - /// - /// Enumeration for the profile state type. - /// - /// 3 - public enum ProfileState - { - Disconnected = 0, /**< Disconnected state */ - Association = 1, /**< Association state */ - Configuration = 2, /**< Configuration state */ - Connected = 3, /**< Connected state */ - } - - /// - /// Enumeration for the proxy method type. - /// - /// 3 - public enum ProxyType - { - Direct = 0, /**< Direct connection */ - Auto = 1, /**< Auto configuration(Use PAC file). If URL property is not set, DHCP/WPAD auto-discover will be tried */ - Manual = 2, /**< Manual configuration */ - } - - /// - /// Enumeration for the IP configuration type. - /// - /// 3 - public enum IPConfigType - { - None = 0, /**< Not defined */ - Static = 1, /**< Manual IP configuration */ - Dynamic = 2, /**< Config IP using DHCP client*/ - Auto = 3, /**< Config IP from Auto IP pool (169.254/16). Later with DHCP client, if available */ - Fixed = 4, /**< Indicates an IP address that can not be modified */ - } - - /// - /// Enumeration for the cellular service type. - /// - /// 3 - public enum CellularServiceType - { - Unknown = 0, /**< Unknown */ - Internet = 1, /**< Internet */ - MMS = 2, /**< MMS */ - PrepaidInternet = 3, /**< Prepaid internet */ - PrepaidMMS = 4, /**< Prepaid MMS */ - Tethering = 5, /**< Tethering */ - Application = 6, /**< Specific application */ - } - - /// - /// Enumeration for the cellular pdn type. - /// - /// 3 - public enum CellularPdnType - { - Unknown = 0, /**< Unknown */ - IPv4 = 1, /**< IPv4 */ - IPv6 = 2, /**< IPv6 */ - IPv4_IPv6 = 3, /**< Both IPv4 and IPv6 */ - } - - /// - /// Enumeration for the DNS configuration type. - /// - /// 3 - public enum DnsConfigType - { - None = 0, /**< Not defined */ - Static = 1, /**< Manual DNS configuration */ - Dynamic = 2, /**< Config DNS using DHCP client */ - } - - static internal class ConnectionErrorValue - { - internal const int Base = -0x01C10000; - } - - - /// - /// Enumeration for the connection errors. - /// - /// 3 - // To do : have to assign valid error code - public enum ConnectionError - { - None = ErrorCode.None, /**< Successful */ - InvalidParameter = ErrorCode.InvalidParameter, /**< Invalid parameter */ - OutOfMemoryError = ErrorCode.OutOfMemory, /**< Out of memory error */ - InvalidOperation = ErrorCode.InvalidOperation, /**< Invalid Operation */ - AddressFamilyNotSupported = ErrorCode.AddressFamilyNotSupported, /**< Address family not supported */ - OperationFailed = ConnectionErrorValue.Base | 0x0401, /**< Operation failed */ - EndOfIteration = ConnectionErrorValue.Base | 0x0402, /**< End of iteration */ - NoConnection = ConnectionErrorValue.Base | 0x0403, /**< There is no connection */ - NowInProgress = ErrorCode.NowInProgress, /** Now in progress */ - AlreadyExists = ConnectionErrorValue.Base | 0x0404, /**< Already exists */ - OperationAborted = ConnectionErrorValue.Base | 0x0405, /**< Operation is aborted */ - DhcpFailed = ConnectionErrorValue.Base | 0x0406, /**< DHCP failed */ - InvalidKey = ConnectionErrorValue.Base | 0x0407, /**< Invalid key */ - NoReply = ConnectionErrorValue.Base | 0x0408, /**< No reply */ - PermissionDenied = ErrorCode.PermissionDenied, /**< Permission denied */ - NotSupported = ErrorCode.NotSupported /**< Not Supported */ - } - - /// - /// Enumeration for the profile list type. - /// - /// 3 - public enum ProfileListType - { - Registered = 0, /**< The iterator of the registered profile */ - Connected = 1, /**< The iterator of the connected profile */ - Default = 2, /**< The iterator of the default profile */ - } - - /// - /// Enumeration for the security type of Wi-Fi. - /// - /// 3 - public enum WiFiSecurityType - { - None = 0, /**< Security disabled */ - Wep = 1, /**< WEP */ - WpaPsk = 2, /**< WPA-PSK */ - Wpa2Psk = 3, /**< WPA2-PSK */ - Eap = 4, /**< EAP */ - } - - /// - /// Enumeration for the encryption modes. - /// - /// 3 - public enum WiFiEncryptionType - { - None = 0, /**< Encryption disabled */ - Wep = 1, /**< WEP */ - Tkip = 2, /**< TKIP */ - Aes = 3, /**< AES */ - TkipAesMixed = 4, /**< TKIP and AES are both supported */ - } - - /// - /// Enumeration for the connection profile state. - /// - /// 3 - public enum ConnectionProfileState - { - Disconnected = 0, /**< Disconnected state */ - Association = 1, /**< Association state */ - Configuration = 2, /**< Configuration state */ - Connected = 3, /**< Connected state */ - } - - /// - /// Enumeration for the cellular authentication type. - /// - /// 3 - public enum CellularAuthType - { - None = 0, /**< No authentication */ - Pap = 1, /**< PAP authentication */ - Chap = 2, /**< CHAP authentication */ - } - - public enum AddressInformationType - { - Connection = 0, - WiFi = 1 - } - - static internal class Globals - { - internal const string LogTag = "Tizen.Network.Connection"; - } -} diff --git a/src/Tizen.Network.Connection/Tizen.Network.Connection/IAddressInformation.cs b/src/Tizen.Network.Connection/Tizen.Network.Connection/IAddressInformation.cs deleted file mode 100755 index 4a2a4754a..000000000 --- a/src/Tizen.Network.Connection/Tizen.Network.Connection/IAddressInformation.cs +++ /dev/null @@ -1,384 +0,0 @@ -/* - * 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.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Collections; -using System.Runtime.InteropServices; - -namespace Tizen.Network.Connection -{ - /// - /// This interface provides properties to manage address information of the connection. - /// - /// 3 - public interface IAddressInformation - { - /// - /// The DNS address. - /// - /// 3 - /// First DNS address of the connection. - /// Thrown during set when a feature is not supported. - /// Thrown during set when a value is an invalid parameter. - /// Thrown during set when a profile instance is invalid or when a method fails due to an invalid operation. - System.Net.IPAddress Dns1 { get; set; } - - /// - /// The DNS address. - /// - /// 3 - /// Second DNS address of the connection. - /// Thrown during set when a feature is not supported. - /// Thrown during set when a value is an invalid parameter. - /// Thrown during set when a profile instance is invalid or when a method fails due to an invalid operation. - System.Net.IPAddress Dns2 { get; set; } - - /// - /// The gateway address. - /// - /// 3 - /// Gateway address of the connection. - /// Thrown during set when a feature is not supported. - /// Thrown during set when a value is an invalid parameter. - /// Thrown during set when a profile instance is invalid or when a method fails due to an invalid operation. - System.Net.IPAddress Gateway { get; set; } - - /// - /// The subnet mask address. - /// - /// 3 - /// Subnet mask of the connection. - /// Thrown during set when a feature is not supported. - /// Thrown during set when a value is an invalid parameter. - /// Thrown during set when a profile instance is invalid or when a method fails due to an invalid operation. - System.Net.IPAddress SubnetMask { get; set; } - - /// - /// The IP address. - /// - /// 3 - /// IP address of the connection. - /// Thrown during set when a feature is not supported. - /// Thrown during set when a value is an invalid parameter. - /// Thrown during set when a profile instance is invalid or when a method fails due to an invalid operation. - System.Net.IPAddress IP { get; set; } - - /// - /// The type of IP config. - /// - /// 3 - /// IP config type of the connection. - /// Thrown during set when a feature is not supported. - /// Thrown during set when a value is an invalid parameter. - /// Thrown during set when a profile instance is invalid or when a method fails due to an invalid operation. - IPConfigType IPConfigType { get; set; } - - /// - /// The prefix length. - /// - /// 3 - /// Prefix length of the connection. - /// Thrown during set when a feature is not supported. - /// Thrown during set when a value is an invalid parameter. - /// Thrown during set when a profile instance is invalid or when a method fails due to an invalid operation. - int PrefixLength { get; set; } - - /// - /// The DNS config type. - /// - /// 3 - /// Config type of the DNS. - /// Thrown during set when a feature is not supported. - /// Thrown during set when a value is an invalid parameter. - /// Thrown during set when a profile instance is invalid or when a method fails due to an invalid operation. - DnsConfigType DnsConfigType { get; set; } - - /// - /// The DHCP server address. It is only supported for the IPV4 address family. - /// - /// 4 - /// Server address of the DHCP. - System.Net.IPAddress DhcpServerAddress { get; } - } - - internal class ConnectionAddressInformation : IAddressInformation - { - private IntPtr _profileHandle; - private AddressFamily _family; - - internal ConnectionAddressInformation(IntPtr handle, AddressFamily family) - { - _profileHandle = handle; - _family = family; - } - - public System.Net.IPAddress Dns1 - { - get - { - IntPtr Value; - int ret = Interop.ConnectionProfile.GetDnsAddress(_profileHandle, 1, (int)_family, out Value); - if ((ConnectionError)ret != ConnectionError.None) - { - Log.Error(Globals.LogTag, "It failed to get dns1 address, " + (ConnectionError)ret); - } - string result = Marshal.PtrToStringAnsi(Value); - Interop.Libc.Free(Value); - if (result == null || result.Length == 0) - return System.Net.IPAddress.Parse("0.0.0.0"); - return System.Net.IPAddress.Parse(result); - } - - set - { - int ret = Interop.ConnectionProfile.SetDnsAddress(_profileHandle, 1, (int)_family, value.ToString()); - if ((ConnectionError)ret != ConnectionError.None) - { - Log.Error(Globals.LogTag, "It failed to set dns1 address, " + (ConnectionError)ret); - ConnectionErrorFactory.CheckFeatureUnsupportedException(ret, "http://tizen.org/feature/network.telephony " + "http://tizen.org/feature/network.wifi " + "http://tizen.org/feature/network.tethering.bluetooth " + "http://tizen.org/feature/network.ethernet"); - ConnectionErrorFactory.CheckHandleNullException(ret, (_profileHandle == IntPtr.Zero), "ProfileHandle may have been disposed or released"); - ConnectionErrorFactory.ThrowConnectionException(ret); - } - } - } - public System.Net.IPAddress Dns2 - { - get - { - IntPtr Value; - int ret = Interop.ConnectionProfile.GetDnsAddress(_profileHandle, 2, (int)_family, out Value); - if ((ConnectionError)ret != ConnectionError.None) - { - Log.Error(Globals.LogTag, "It failed to get dns2 address, " + (ConnectionError)ret); - } - string result = Marshal.PtrToStringAnsi(Value); - Interop.Libc.Free(Value); - if (result == null || result.Length == 0) - return System.Net.IPAddress.Parse("0.0.0.0"); - return System.Net.IPAddress.Parse(result); - } - - set - { - int ret = Interop.ConnectionProfile.SetDnsAddress(_profileHandle, 2, (int)_family, value.ToString()); - if ((ConnectionError)ret != ConnectionError.None) - { - Log.Error(Globals.LogTag, "It failed to set dns2 address, " + (ConnectionError)ret); - ConnectionErrorFactory.CheckFeatureUnsupportedException(ret, "http://tizen.org/feature/network.telephony " + "http://tizen.org/feature/network.wifi " + "http://tizen.org/feature/network.tethering.bluetooth " + "http://tizen.org/feature/network.ethernet"); - ConnectionErrorFactory.CheckHandleNullException(ret, (_profileHandle == IntPtr.Zero), "ProfileHandle may have been disposed or released"); - ConnectionErrorFactory.ThrowConnectionException(ret); - } - } - } - - public System.Net.IPAddress Gateway - { - get - { - IntPtr Value; - int ret = Interop.ConnectionProfile.GetGatewayAddress(_profileHandle, (int)_family, out Value); - if ((ConnectionError)ret != ConnectionError.None) - { - Log.Error(Globals.LogTag, "It failed to get gateway, " + (ConnectionError)ret); - } - string result = Marshal.PtrToStringAnsi(Value); - Interop.Libc.Free(Value); - if (result == null || result.Length == 0) - return System.Net.IPAddress.Parse("0.0.0.0"); - return System.Net.IPAddress.Parse(result); - } - - set - { - int ret = Interop.ConnectionProfile.SetGatewayAddress(_profileHandle, (int)_family, value.ToString()); - if ((ConnectionError)ret != ConnectionError.None) - { - Log.Error(Globals.LogTag, "It failed to set gateway, " + (ConnectionError)ret); - ConnectionErrorFactory.CheckFeatureUnsupportedException(ret, "http://tizen.org/feature/network.telephony " + "http://tizen.org/feature/network.wifi " + "http://tizen.org/feature/network.tethering.bluetooth " + "http://tizen.org/feature/network.ethernet"); - ConnectionErrorFactory.CheckHandleNullException(ret, (_profileHandle == IntPtr.Zero), "ProfileHandle may have been disposed or released"); - ConnectionErrorFactory.ThrowConnectionException(ret); - } - } - } - - - public System.Net.IPAddress SubnetMask - { - get - { - IntPtr Value; - int ret = Interop.ConnectionProfile.GetSubnetMask(_profileHandle, (int)_family, out Value); - if ((ConnectionError)ret != ConnectionError.None) - { - Log.Error(Globals.LogTag, "It failed to get subnet mask, " + (ConnectionError)ret); - } - string result = Marshal.PtrToStringAnsi(Value); - Interop.Libc.Free(Value); - if (result == null || result.Length == 0) - return System.Net.IPAddress.Parse("0.0.0.0"); - return System.Net.IPAddress.Parse(result); - } - - set - { - int ret = Interop.ConnectionProfile.SetSubnetMask(_profileHandle, (int)_family, value.ToString()); - if ((ConnectionError)ret != ConnectionError.None) - { - Log.Error(Globals.LogTag, "It failed to set subnet mask, " + (ConnectionError)ret); - ConnectionErrorFactory.CheckFeatureUnsupportedException(ret, "http://tizen.org/feature/network.telephony " + "http://tizen.org/feature/network.wifi " + "http://tizen.org/feature/network.tethering.bluetooth " + "http://tizen.org/feature/network.ethernet"); - ConnectionErrorFactory.CheckHandleNullException(ret, (_profileHandle == IntPtr.Zero), "ProfileHandle may have been disposed or released"); - ConnectionErrorFactory.ThrowConnectionException(ret); - } - } - } - - - public System.Net.IPAddress IP - { - get - { - IntPtr Value; - int ret = Interop.ConnectionProfile.GetIPAddress(_profileHandle, (int)_family, out Value); - if ((ConnectionError)ret != ConnectionError.None) - { - Log.Error(Globals.LogTag, "It failed to get ip, " + (ConnectionError)ret); - } - string result = Marshal.PtrToStringAnsi(Value); - Interop.Libc.Free(Value); - if (result == null || result.Length == 0) - return System.Net.IPAddress.Parse("0.0.0.0"); - return System.Net.IPAddress.Parse(result); - } - - set - { - int ret = Interop.ConnectionProfile.SetIPAddress(_profileHandle, (int)_family, value.ToString()); - if ((ConnectionError)ret != ConnectionError.None) - { - Log.Error(Globals.LogTag, "It failed to set ip, " + (ConnectionError)ret); - ConnectionErrorFactory.CheckFeatureUnsupportedException(ret, "http://tizen.org/feature/network.telephony " + "http://tizen.org/feature/network.wifi " + "http://tizen.org/feature/network.tethering.bluetooth " + "http://tizen.org/feature/network.ethernet"); - ConnectionErrorFactory.CheckHandleNullException(ret, (_profileHandle == IntPtr.Zero), "ProfileHandle may have been disposed or released"); - ConnectionErrorFactory.ThrowConnectionException(ret); - } - } - } - - public IPConfigType IPConfigType - { - get - { - int Value; - int ret = Interop.ConnectionProfile.GetIPConfigType(_profileHandle, (int)_family, out Value); - if ((ConnectionError)ret != ConnectionError.None) - { - Log.Error(Globals.LogTag, "It failed to get ip config type, " + (ConnectionError)ret); - } - return (IPConfigType)Value; - } - - set - { - int ret = Interop.ConnectionProfile.SetIPConfigType(_profileHandle, (int)_family, (int)value); - if ((ConnectionError)ret != ConnectionError.None) - { - Log.Error(Globals.LogTag, "It failed to set ip config type, " + (ConnectionError)ret); - ConnectionErrorFactory.CheckFeatureUnsupportedException(ret, "http://tizen.org/feature/network.telephony " + "http://tizen.org/feature/network.wifi " + "http://tizen.org/feature/network.tethering.bluetooth " + "http://tizen.org/feature/network.ethernet"); - ConnectionErrorFactory.CheckHandleNullException(ret, (_profileHandle == IntPtr.Zero), "ProfileHandle may have been disposed or released"); - ConnectionErrorFactory.ThrowConnectionException(ret); - } - } - } - - public int PrefixLength - { - get - { - int Value; - int ret = Interop.ConnectionProfile.GetPrefixLength(_profileHandle, (int)_family, out Value); - if ((ConnectionError)ret != ConnectionError.None) - { - Log.Error(Globals.LogTag, "It failed to get prefix length, " + (ConnectionError)ret); - } - return Value; - } - - set - { - int ret = Interop.ConnectionProfile.SetPrefixLength(_profileHandle, (int)_family, value); - if ((ConnectionError)ret != ConnectionError.None) - { - Log.Error(Globals.LogTag, "It failed to set prefix length, " + (ConnectionError)ret); - ConnectionErrorFactory.CheckFeatureUnsupportedException(ret, "http://tizen.org/feature/network.telephony " + "http://tizen.org/feature/network.wifi " + "http://tizen.org/feature/network.tethering.bluetooth " + "http://tizen.org/feature/network.ethernet"); - ConnectionErrorFactory.CheckHandleNullException(ret, (_profileHandle == IntPtr.Zero), "ProfileHandle may have been disposed or released"); - ConnectionErrorFactory.ThrowConnectionException(ret); - } - } - } - - public DnsConfigType DnsConfigType - { - get - { - int Value; - int ret = Interop.ConnectionProfile.GetDnsConfigType(_profileHandle, (int)_family, out Value); - if ((ConnectionError)ret != ConnectionError.None) - { - Log.Error(Globals.LogTag, "It failed to get DNS config type, " + (ConnectionError)ret); - } - return (DnsConfigType)Value; - } - - set - { - int ret = Interop.ConnectionProfile.SetDnsConfigType(_profileHandle, (int)_family, (int)value); - if ((ConnectionError)ret != ConnectionError.None) - { - Log.Error(Globals.LogTag, "It failed to set DNS config type, " + (ConnectionError)ret); - ConnectionErrorFactory.CheckFeatureUnsupportedException(ret, "http://tizen.org/feature/network.telephony " + "http://tizen.org/feature/network.wifi " + "http://tizen.org/feature/network.tethering.bluetooth " + "http://tizen.org/feature/network.ethernet"); - ConnectionErrorFactory.CheckHandleNullException(ret, (_profileHandle == IntPtr.Zero), "ProfileHandle may have been disposed or released"); - ConnectionErrorFactory.ThrowConnectionException(ret); - } - } - } - - public System.Net.IPAddress DhcpServerAddress - { - get - { - string dhcpServer; - int ret = Interop.ConnectionProfile.GetDhcpServerAddress(_profileHandle, _family, out dhcpServer); - if ((ConnectionError)ret != ConnectionError.None) - { - Log.Error(Globals.LogTag, "It failed to get the DHCP server address, " + (ConnectionError)ret); - } - - if (dhcpServer == null || dhcpServer.Length == 0) - { - return System.Net.IPAddress.Parse("0.0.0.0"); - } - - else - { - return System.Net.IPAddress.Parse(dhcpServer); - } - } - } - } -} diff --git a/src/Tizen.Network.Connection/Tizen.Network.Connection/WiFiProfile.cs b/src/Tizen.Network.Connection/Tizen.Network.Connection/WiFiProfile.cs deleted file mode 100755 index 21f925809..000000000 --- a/src/Tizen.Network.Connection/Tizen.Network.Connection/WiFiProfile.cs +++ /dev/null @@ -1,247 +0,0 @@ -/* - * 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.Collections.Generic; -using System.Linq; -using System.Text; -using System.Runtime.InteropServices; - -namespace Tizen.Network.Connection -{ - /// - /// This is the WiFiProfile class. It provides functions to manage the WiFi profile. - /// - /// 3 - public class WiFiProfile : ConnectionProfile - { - internal WiFiProfile(IntPtr Handle) : base(Handle) - { - } - - ~WiFiProfile() - { - } - - /// - /// The ESSID (Extended Service Set Identifier). - /// - /// 3 - /// ESSID of the WiFi. - public string Essid - { - get - { - IntPtr value; - int ret = Interop.ConnectionWiFiProfile.GetEssid(ProfileHandle, out value); - if ((ConnectionError)ret != ConnectionError.None) - { - Log.Error(Globals.LogTag, "It failed to create profile handle, " + (ConnectionError)ret); - } - string result = Marshal.PtrToStringAnsi(value); - Interop.Libc.Free(value); - return result; - } - } - - /// - /// The BSSID (Basic Service Set Identifier). - /// - /// 3 - /// BSSID of the WiFi. - public string Bssid - { - get - { - IntPtr value; - int ret = Interop.ConnectionWiFiProfile.GetBssid(ProfileHandle, out value); - if ((ConnectionError)ret != ConnectionError.None) - { - Log.Error(Globals.LogTag, "It failed to get bssid, " + (ConnectionError)ret); - } - string result = Marshal.PtrToStringAnsi(value); - Interop.Libc.Free(value); - return result; - } - } - - /// - /// The RSSI. - /// - /// 3 - /// RSSI of the WiFi. - public int Rssi - { - get - { - int value; - int ret = Interop.ConnectionWiFiProfile.GetRssi(ProfileHandle, out value); - if ((ConnectionError)ret != ConnectionError.None) - { - Log.Error(Globals.LogTag, "It failed to get rssi, " + (ConnectionError)ret); - } - return value; - } - } - - /// - /// The frequency (MHz). - /// - /// 3 - /// Frequency of the WiFi. - public int Frequency - { - get - { - int value; - int ret = Interop.ConnectionWiFiProfile.GetFrequency(ProfileHandle, out value); - if ((ConnectionError)ret != ConnectionError.None) - { - Log.Error(Globals.LogTag, "It failed to get frequency, " + (ConnectionError)ret); - } - return value; - } - } - - /// - /// The max speed (Mbps). - /// - /// 3 - /// Maximum speed of the WiFi. - public int MaxSpeed - { - get - { - int value; - int ret = Interop.ConnectionWiFiProfile.GetMaxSpeed(ProfileHandle, out value); - if ((ConnectionError)ret != ConnectionError.None) - { - Log.Error(Globals.LogTag, "It failed to get max speed, " + (ConnectionError)ret); - } - return value; - } - } - - /// - /// The security type of WiFi. - /// - /// 3 - /// Security type of the WiFi. - public WiFiSecurityType SecurityType - { - get - { - int value; - int ret = Interop.ConnectionWiFiProfile.GetSecurityType(ProfileHandle, out value); - if ((ConnectionError)ret != ConnectionError.None) - { - Log.Error(Globals.LogTag, "It failed to get security type, " + (ConnectionError)ret); - } - return (WiFiSecurityType)value; - } - } - - /// - /// The encryption type of WiFi. - /// - /// 3 - /// Encryption mode of the WiFi. - public WiFiEncryptionType EncryptionType - { - get - { - int value; - int ret = Interop.ConnectionWiFiProfile.GetEncryptionType(ProfileHandle, out value); - if ((ConnectionError)ret != ConnectionError.None) - { - Log.Error(Globals.LogTag, "It failed to get encryption type, " + (ConnectionError)ret); - } - return (WiFiEncryptionType)value; - } - } - - /// - /// Checks whether passphrase is required. - /// - /// 3 - /// True if a passphrase is required, otherwise false. - /// This property is not valid if WiFiSecurityType is Eap. - public bool PassphraseRequired - { - get - { - bool value; - int ret = Interop.ConnectionWiFiProfile.IsRequiredPassphrase(ProfileHandle, out value); - if ((ConnectionError)ret != ConnectionError.None) - { - Log.Error(Globals.LogTag, "It failed to get PassphraseRequired, " + (ConnectionError)ret); - } - return value; - } - } - - /// - /// Checks whether the WPS (Wi-Fi Protected Setup) is supported. - /// - /// 3 - /// True if WPS is supported, otherwise false. - public bool WpsSupported - { - get - { - bool value; - int ret = Interop.ConnectionWiFiProfile.IsSupportedWps(ProfileHandle, out value); - if ((ConnectionError)ret != ConnectionError.None) - { - Log.Error(Globals.LogTag, "It failed to get IsSupportedWps, " + (ConnectionError)ret); - } - return value; - } - } - - /// - /// Sets the passphrase of the Wi-Fi WPA. - /// - /// 3 - /// The passphrase of Wi-Fi security. - /// http://tizen.org/feature/network.wifi - /// Thrown when a feature is not supported. - /// Thrown when a value is an invalid parameter. - /// Thrown when a passphrase is null. - /// Thrown when a profile instance is invalid or when a method fails due to an invalid operation. - /// Thrown when an operation is performed on a disposed object. - public void SetPassphrase(string passphrase) - { - CheckDisposed(); - if (passphrase != null) - { - int ret = Interop.ConnectionWiFiProfile.SetPassphrase(ProfileHandle, passphrase); - if ((ConnectionError)ret != ConnectionError.None) - { - Log.Error(Globals.LogTag, "It failed to set passphrase, " + (ConnectionError)ret); - ConnectionErrorFactory.CheckFeatureUnsupportedException(ret, "http://tizen.org/feature/network.wifi"); - ConnectionErrorFactory.CheckHandleNullException(ret, (ProfileHandle == IntPtr.Zero), "ProfileHandle may have been disposed or released"); - ConnectionErrorFactory.ThrowConnectionException(ret); - } - } - - else - { - throw new ArgumentNullException("Value of passphrase is null"); - } - } - } -} diff --git a/src/Tizen.Network.IoTConnectivity/Interop/Interop.IoTConnectivity.Client.cs b/src/Tizen.Network.IoTConnectivity/Interop/Interop.IoTConnectivity.Client.cs deleted file mode 100755 index f1d4ace95..000000000 --- a/src/Tizen.Network.IoTConnectivity/Interop/Interop.IoTConnectivity.Client.cs +++ /dev/null @@ -1,244 +0,0 @@ - /* - * 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 IoTConnectivity - { - internal static partial class Client - { - internal static partial class DeviceInformation - { - internal delegate bool DeviceInformationCallback(IntPtr deviceInfoHandle, int result, IntPtr userData); - - internal enum Property - { - Name = 0, - SpecVersion, - Id, - DataModelVersion, - } - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_find_device_info")] - internal static extern int Find(string hostAddress, int connectivityType, IntPtr query, DeviceInformationCallback cb, IntPtr userData); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_device_info_get_property")] - internal static extern int GetProperty(IntPtr deviceInfoHandle, int property, out IntPtr value); - } - - internal static partial class PlatformInformation - { - internal delegate bool PlatformInformationCallback(IntPtr platformInfoHandle, int result, IntPtr userData); - - internal enum Propery - { - Id = 0, - MfgName, - MfgUrl, - ModelNumber, - DateOfMfg, - PlatformVer, - OsVer, - HardwareVer, - FirmwareVer, - SupportUrl, - SystemTime - } - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_find_platform_info")] - internal static extern int Find(string hostAddress, int connectivityType, IntPtr query, PlatformInformationCallback cb, IntPtr userData); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_platform_info_get_property")] - internal static extern int GetProperty(IntPtr platformInfoHandle, int property, out IntPtr value); - } - - internal static partial class RemoteResource - { - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void ResponseCallback(IntPtr resource, int err, int requestType, IntPtr response, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void ObserveCallback(IntPtr resource, int err, int sequenceNumber, IntPtr response, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void CachedRepresentationChangedCallback(IntPtr resource, IntPtr representation, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void StateChangedCallback(IntPtr resource, int state, IntPtr userData); - - internal enum ConnectivityType - { - None = -1, - All, - Ip, - Ipv4, - Ipv6 - } - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_remote_resource_create")] - internal static extern int Create(string hostAddress, int connectivityType, string uriPath, int properties, IntPtr resourceTypes, IntPtr resourceInterfaces, out IntPtr remoteResource); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_remote_resource_destroy")] - internal static extern void Destroy(IntPtr resource); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_remote_resource_clone")] - internal static extern int Clone(IntPtr src, out IntPtr dest); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_remote_resource_observe_register")] - internal static extern int RegisterObserve(IntPtr resource, int observePolicy, IntPtr query, ObserveCallback cb, IntPtr userData); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_remote_resource_observe_deregister")] - internal static extern int DeregisterObserve(IntPtr resource); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_remote_resource_get")] - internal static extern int Get(IntPtr resource, IntPtr query, ResponseCallback cb, IntPtr userData); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_remote_resource_put")] - internal static extern int Put(IntPtr resource, IntPtr repr, IntPtr query, ResponseCallback cb, IntPtr userData); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_remote_resource_post")] - internal static extern int Post(IntPtr resource, IntPtr repr, IntPtr query, ResponseCallback cb, IntPtr userData); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_remote_resource_delete")] - internal static extern int Delete(IntPtr resource, ResponseCallback cb, IntPtr userData); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_remote_resource_start_caching")] - internal static extern int StartCaching(IntPtr resource, CachedRepresentationChangedCallback cb, IntPtr userData); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_remote_resource_stop_caching")] - internal static extern int StopCaching(IntPtr resource); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_remote_resource_start_monitoring")] - internal static extern int StartMonitoring(IntPtr resource, StateChangedCallback cb, IntPtr userData); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_remote_resource_stop_monitoring")] - internal static extern int StopMonitoring(IntPtr resource); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_remote_resource_get_uri_path")] - internal static extern int GetUriPath(IntPtr resource, out IntPtr uriPath); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_remote_resource_get_connectivity_type")] - internal static extern int GetConnectivityType(IntPtr resource, out int connectivityType); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_remote_resource_get_host_address")] - internal static extern int GetHostAddress(IntPtr resource, out IntPtr hostAddress); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_remote_resource_get_device_id")] - internal static extern int GetDeviceId(IntPtr resource, out IntPtr deviceId); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_remote_resource_get_types")] - internal static extern int GetTypes(IntPtr resource, out IntPtr types); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_remote_resource_get_interfaces")] - internal static extern int GetInterfaces(IntPtr resource, out IntPtr ifaces); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_remote_resource_get_policies")] - internal static extern int GetPolicies(IntPtr resource, out int properties); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_remote_resource_get_options")] - internal static extern int GetOptions(IntPtr resource, out IntPtr options); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_remote_resource_set_options")] - internal static extern int SetOptions(IntPtr resource, IntPtr options); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_remote_resource_get_cached_representation")] - internal static extern int GetCachedRepresentation(IntPtr resource, out IntPtr representation); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_remote_resource_get_checking_interval")] - internal static extern int GetTimeInterval(IntPtr resource, out int timeInterval); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_remote_resource_set_checking_interval")] - internal static extern int SetTimeInterval(IntPtr resource, int timeInterval); - } - - internal static partial class IoTCon - { - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_initialize")] - internal static extern int Initialize(string filePath); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_deinitialize")] - internal static extern void Deinitialize(); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_get_timeout")] - internal static extern int GetTimeout(out int timeoutSeconds); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_set_timeout")] - internal static extern int SetTimeout(int timeoutSeconds); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_polling_get_interval")] - internal static extern int GetPollingInterval(out int interval); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_polling_set_interval")] - internal static extern int SetPollingInterval(int interval); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_polling_invoke")] - internal static extern int InvokePolling(); - } - - internal static partial class ResourceFinder - { - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool FoundResourceCallback(IntPtr remoteResourceHandle, int result, IntPtr userData); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_find_resource")] - internal static extern int AddResourceFoundCb(string hostAddress, int connectivityType, IntPtr query, FoundResourceCallback cb, IntPtr userData); - } - - internal static partial class Presence - { - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void PresenceCallback(IntPtr presenceResponseHandle, int err, IntPtr response, IntPtr userData); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_add_presence_cb")] - internal static extern int AddPresenceCb(string hostAddress, int connectivityType, string resourceType, PresenceCallback cb, IntPtr userData, out IntPtr presenceHandle); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_remove_presence_cb")] - internal static extern int RemovePresenceCb(IntPtr presenceHandle); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_presence_get_host_address")] - internal static extern int GetHostAddress(IntPtr presence, out IntPtr hostAddress); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_presence_get_connectivity_type")] - internal static extern int GetConnectivityType(IntPtr presence, out int connectivityType); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_presence_get_resource_type")] - internal static extern int GetResourceType(IntPtr presence, out IntPtr resourceType); - } - - internal static partial class PresenceResponse - { - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_presence_response_get_result")] - internal static extern int GetResult(IntPtr response, out int result); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_presence_response_get_trigger")] - internal static extern int GetTrigger(IntPtr response, out int trigger); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_presence_response_get_host_address")] - internal static extern int GetHostAddress(IntPtr response, out IntPtr hostAddress); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_presence_response_get_connectivity_type")] - internal static extern int GetConnectivityType(IntPtr response, out int connectivityType); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_presence_response_get_resource_type")] - internal static extern int GetResourceType(IntPtr response, out IntPtr resourceType); - } - } - } -} diff --git a/src/Tizen.Network.IoTConnectivity/Interop/Interop.IoTConnectivity.Common.cs b/src/Tizen.Network.IoTConnectivity/Interop/Interop.IoTConnectivity.Common.cs deleted file mode 100755 index 9b4fa4801..000000000 --- a/src/Tizen.Network.IoTConnectivity/Interop/Interop.IoTConnectivity.Common.cs +++ /dev/null @@ -1,368 +0,0 @@ - /* - * 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 IoTConnectivity - { - internal static partial class Common - { - internal enum DataType - { - None = 0, - Int, - Bool, - Double, - String, - ByteStr, - Null, - List, - Attributes - } - - internal static partial class ResourceTypes - { - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool ForeachCallback(string type, IntPtr userData); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_resource_types_create")] - internal static extern int Create(out IntPtr types); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_resource_types_destroy")] - internal static extern void Destroy(IntPtr types); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_resource_types_add")] - internal static extern int Add(IntPtr types, string type); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_resource_types_remove")] - internal static extern int Remove(IntPtr types, string type); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_resource_types_foreach")] - internal static extern int Foreach(IntPtr types, ForeachCallback cb, IntPtr userData); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_resource_types_clone")] - internal static extern int Clone(IntPtr src, out IntPtr dest); - } - - internal static partial class ResourceInterfaces - { - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool ForeachCallback(string iface, IntPtr userData); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_resource_interfaces_create")] - internal static extern int Create(out IntPtr ifaces); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_resource_interfaces_destroy")] - internal static extern void Destroy(IntPtr ifaces); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_resource_interfaces_add")] - internal static extern int Add(IntPtr ifaces, string iface); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_resource_interfaces_remove")] - internal static extern int Remove(IntPtr ifaces, string iface); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_resource_interfaces_foreach")] - internal static extern int Foreach(IntPtr ifaces, ForeachCallback cb, IntPtr userData); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_resource_interfaces_clone")] - internal static extern int Clone(IntPtr src, out IntPtr dest); - } - - internal static partial class Attributes - { - internal delegate bool AttributesCallback(IntPtr attributes, string key, IntPtr userData); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_attributes_create")] - internal static extern int Create(out IntPtr attributes); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_attributes_destroy")] - internal static extern void Destroy(IntPtr attributes); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_attributes_clone")] - internal static extern int Clone(IntPtr attributes, out IntPtr attributes_clone); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_attributes_add_int")] - internal static extern int AddInt(IntPtr attributes, string key, int val); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_attributes_add_bool")] - internal static extern int AddBool(IntPtr attributes, string key, bool val); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_attributes_add_double")] - internal static extern int AddDouble(IntPtr attributes, string key, double val); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_attributes_add_str")] - internal static extern int AddStr(IntPtr attributes, string key, string val); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_attributes_add_byte_str")] - internal static extern int AddByteStr(IntPtr attributes, string key, byte[] val, int len); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_attributes_add_list")] - internal static extern int AddList(IntPtr attributes, string key, IntPtr list); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_attributes_add_attributes")] - internal static extern int AddAttributes(IntPtr dest, string key, IntPtr src); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_attributes_add_null")] - internal static extern int AddNull(IntPtr attributes, string key); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_attributes_get_int")] - internal static extern int GetInt(IntPtr attributes, string key, out int val); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_attributes_get_bool")] - internal static extern int GetBool(IntPtr attributes, string key, out bool val); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_attributes_get_double")] - internal static extern int GetDouble(IntPtr attributes, string key, out double val); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_attributes_get_str")] - internal static extern int GetStr(IntPtr attributes, string key, out IntPtr val); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_attributes_get_byte_str")] - internal static extern int GetByteStr(IntPtr attributes, string key, out IntPtr value, out int size); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_attributes_get_list")] - internal static extern int GetList(IntPtr attributes, string key, out IntPtr list); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_attributes_get_attributes")] - internal static extern int GetAttributes(IntPtr src, string key, out IntPtr dest); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_attributes_is_null")] - internal static extern int IsNull(IntPtr attributes, string key, out bool isNull); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_attributes_remove")] - internal static extern int Remove(IntPtr attributes, string key); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_attributes_get_type")] - internal static extern int GetType(IntPtr attributes, string key, out DataType type); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_attributes_foreach")] - internal static extern int Foreach(IntPtr attributes, AttributesCallback cb, IntPtr userData); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_attributes_get_keys_count")] - internal static extern int GetKeysCount(IntPtr attributes, out int count); - } - - internal static partial class Query - { - internal delegate bool QueryCallback(string key, string value, IntPtr userData); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_query_create")] - internal static extern int Create(out IntPtr query); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_query_destroy")] - internal static extern void Destroy(IntPtr query); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_query_get_resource_type")] - internal static extern int GetResourceType(IntPtr query, out IntPtr resourceType); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_query_get_interface")] - internal static extern int GetInterface(IntPtr query, out IntPtr resourceInterface); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_query_set_resource_type")] - internal static extern int SetResourceType(IntPtr query, string resourceType); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_query_set_interface")] - internal static extern int SetInterface(IntPtr query, string resourceInterface); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_query_add")] - internal static extern int Add(IntPtr query, string key, string value); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_query_remove")] - internal static extern int Remove(IntPtr query, string key); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_query_lookup")] - internal static extern int Lookup(IntPtr query, string key, out IntPtr data); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_query_foreach")] - internal static extern int Foreach(IntPtr query, QueryCallback cb, IntPtr userData); - } - - internal static partial class Representation - { - internal delegate bool RepresentationChildrenCallback(IntPtr child, IntPtr userData); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_representation_create")] - internal static extern int Create(out IntPtr repr); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_representation_destroy")] - internal static extern void Destroy(IntPtr repr); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_representation_clone")] - internal static extern int Clone(IntPtr src, out IntPtr dest); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_representation_set_uri_path")] - internal static extern int SetUriPath(IntPtr repr, string uriPath); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_representation_get_uri_path")] - internal static extern int GetUriPath(IntPtr repr, out IntPtr uriPath); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_representation_set_resource_types")] - internal static extern int SetResourceTypes(IntPtr repr, IntPtr types); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_representation_get_resource_types")] - internal static extern int GetResourceTypes(IntPtr repr, out IntPtr types); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_representation_set_resource_interfaces")] - internal static extern int SetResourceInterfaces(IntPtr repr, IntPtr ifaces); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_representation_get_resource_interfaces")] - internal static extern int GetResourceInterfaces(IntPtr repr, out IntPtr ifaces); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_representation_set_attributes")] - internal static extern int SetAttributes(IntPtr repr, IntPtr attribs); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_representation_get_attributes")] - internal static extern int GetAttributes(IntPtr repr, out IntPtr attribs); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_representation_add_child")] - internal static extern int AddChild(IntPtr parent, IntPtr child); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_representation_remove_child")] - internal static extern int RemoveChild(IntPtr parent, IntPtr child); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_representation_foreach_children")] - internal static extern int ForeachChildren(IntPtr parent, RepresentationChildrenCallback cb, IntPtr userData); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_representation_get_children_count")] - internal static extern int GetChildrenCount(IntPtr parent, out int count); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_representation_get_nth_child")] - internal static extern int GetNthChild(IntPtr parent, int pos, out IntPtr child); - } - - internal static partial class Options - { - internal delegate bool OptionsCallback(ushort id, string data, IntPtr userData); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_options_create")] - internal static extern int Create(out IntPtr options); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_options_destroy")] - internal static extern void Destroy(IntPtr options); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_options_add")] - internal static extern int Add(IntPtr options, ushort id, string data); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_options_remove")] - internal static extern int Remove(IntPtr options, ushort id); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_options_lookup")] - internal static extern int Lookup(IntPtr options, ushort id, out IntPtr data); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_options_foreach")] - internal static extern int ForEach(IntPtr options, OptionsCallback cb, IntPtr userData); - } - - internal static partial class List - { - internal delegate bool IntCallback(int pos, int value, IntPtr userData); - - internal delegate bool BoolCallback(int pos, bool value, IntPtr userData); - - internal delegate bool DoubleCallback(int pos, double value, IntPtr userData); - - internal delegate bool ByteStrCallback(int pos, byte[] value, int len, IntPtr userData); - - internal delegate bool StrCallback(int pos, string value, IntPtr userData); - - internal delegate bool ListCallback(int pos, IntPtr value, IntPtr userData); - - internal delegate bool AttribsCallback(int pos, IntPtr value, IntPtr userData); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_list_create")] - internal static extern int Create(DataType type, out IntPtr list); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_list_destroy")] - internal static extern void Destroy(IntPtr list); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_list_add_int")] - internal static extern int AddInt(IntPtr list, int val, int pos); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_list_add_bool")] - internal static extern int AddBool(IntPtr list, bool val, int pos); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_list_add_double")] - internal static extern int AddDouble(IntPtr list, double val, int pos); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_list_add_str")] - internal static extern int AddStr(IntPtr list, string val, int pos); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_list_add_byte_str")] - internal static extern int AddByteStr(IntPtr list, byte[] val, int len, int pos); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_list_add_list")] - internal static extern int AddList(IntPtr list, IntPtr val, int pos); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_list_add_attributes")] - internal static extern int AddAttributes(IntPtr list, IntPtr val, int pos); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_list_get_nth_int")] - internal static extern int GetNthInt(IntPtr list, int pos, out int val); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_list_get_nth_bool")] - internal static extern int GetNthBool(IntPtr list, int pos, out bool val); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_list_get_nth_double")] - internal static extern int GetNthDouble(IntPtr list, int pos, out double val); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_list_get_nth_str")] - internal static extern int GetNthStr(IntPtr list, int pos, out IntPtr val); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_list_get_nth_byte_str")] - internal static extern int GetNthByteStr(IntPtr list, int pos, out IntPtr val, out int len); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_list_get_nth_list")] - internal static extern int GetNthList(IntPtr src, int pos, out IntPtr dest); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_list_get_nth_attributes")] - internal static extern int GetNthAttributes(IntPtr list, int pos, out IntPtr attribs); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_list_remove_nth")] - internal static extern int RemoveNth(IntPtr list, int pos); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_list_get_type")] - internal static extern int GetType(IntPtr list, out int type); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_list_get_length")] - internal static extern int GetLength(IntPtr list, out int length); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_list_foreach_int")] - internal static extern int ForeachInt(IntPtr list, IntCallback cb, IntPtr userData); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_list_foreach_bool")] - internal static extern int ForeachBool(IntPtr list, BoolCallback cb, IntPtr userData); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_list_foreach_double")] - internal static extern int ForeachDouble(IntPtr list, DoubleCallback cb, IntPtr userData); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_list_foreach_byte_str")] - internal static extern int ForeachByteStr(IntPtr list, ByteStrCallback cb, IntPtr userData); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_list_foreach_str")] - internal static extern int ForeachStr(IntPtr list, StrCallback cb, IntPtr userData); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_list_foreach_list")] - internal static extern int ForeachList(IntPtr list, ListCallback cb, IntPtr userData); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_list_foreach_attributes")] - internal static extern int ForeachAttributes(IntPtr list, AttribsCallback cb, IntPtr userData); - } - } - } -} diff --git a/src/Tizen.Network.IoTConnectivity/Interop/Interop.IoTConnectivity.Server.cs b/src/Tizen.Network.IoTConnectivity/Interop/Interop.IoTConnectivity.Server.cs deleted file mode 100755 index 59b935556..000000000 --- a/src/Tizen.Network.IoTConnectivity/Interop/Interop.IoTConnectivity.Server.cs +++ /dev/null @@ -1,169 +0,0 @@ - /* - * 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 IoTConnectivity - { - internal static partial class Server - { - internal enum RequestType - { - Unknown = 0, - Get = 1, - Put = 2, - Post = 3, - Delete = 4, - } - - internal static partial class IoTCon - { - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_start_presence")] - internal static extern int StartPresence(uint time); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_stop_presence")] - internal static extern int StopPresence(); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_set_device_name")] - internal static extern int SetDeviceName(string deviceName); - } - - internal static partial class Resource - { - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void RequestHandlerCallback(IntPtr resource, IntPtr request, IntPtr userData); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_resource_create")] - internal static extern int Create(string uriPath, IntPtr resTypes, IntPtr ifaces, int properties, RequestHandlerCallback cb, IntPtr userData, out IntPtr resourceHandle); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_resource_destroy")] - internal static extern int Destroy(IntPtr resourceHandle); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_resource_bind_interface")] - internal static extern int BindInterface(IntPtr resource, string iface); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_resource_bind_type")] - internal static extern int BindType(IntPtr resourceHandle, string resourceType); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_resource_set_request_handler")] - internal static extern int SetRequestHandler(IntPtr resource, RequestHandlerCallback cb, IntPtr userData); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_resource_bind_child_resource")] - internal static extern int BindChildResource(IntPtr parent, IntPtr child); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_resource_unbind_child_resource")] - internal static extern int UnbindChildResource(IntPtr parent, IntPtr child); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_resource_notify")] - internal static extern int Notify(IntPtr resource, IntPtr repr, IntPtr observers, int qos); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_resource_get_number_of_children")] - internal static extern int GetNumberOfChildren(IntPtr resource, out int number); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_resource_get_nth_child")] - internal static extern int GetNthChild(IntPtr parent, int index, out IntPtr child); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_resource_get_uri_path")] - internal static extern int GetUriPath(IntPtr resource, out IntPtr uriPath); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_resource_get_types")] - internal static extern int GetTypes(IntPtr resource, out IntPtr types); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_resource_get_interfaces")] - internal static extern int GetInterfaces(IntPtr resource, out IntPtr ifaces); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_resource_get_properties")] - internal static extern int GetProperties(IntPtr resource, out int properties); - } - - internal static partial class Request - { - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_request_get_host_address")] - internal static extern int GetHostAddress(IntPtr request, out IntPtr hostAddress); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_request_get_connectivity_type")] - internal static extern int GetConnectivityType(IntPtr request, out int connectivityType); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_request_get_representation")] - internal static extern int GetRepresentation(IntPtr request, out IntPtr repr); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_request_get_request_type")] - internal static extern int GetRequestType(IntPtr request, out int type); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_request_get_options")] - internal static extern int GetOptions(IntPtr request, out IntPtr options); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_request_get_query")] - internal static extern int GetQuery(IntPtr request, out IntPtr query); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_request_get_observe_type")] - internal static extern int GetObserveType(IntPtr request, out int observeType); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_request_get_observe_id")] - internal static extern int GetObserveId(IntPtr request, out int observeId); - } - - internal static partial class Response - { - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_response_create")] - internal static extern int Create(IntPtr request, out IntPtr response); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_response_destroy")] - internal static extern void Destroy(IntPtr resp); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_response_get_options")] - internal static extern int GetOptions(IntPtr resp, out IntPtr options); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_response_get_representation")] - internal static extern int GetRepresentation(IntPtr resp, out IntPtr repr); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_response_get_result")] - internal static extern int GetResult(IntPtr resp, out int result); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_response_set_result")] - internal static extern int SetResult(IntPtr resp, int result); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_response_set_representation")] - internal static extern int SetRepresentation(IntPtr resp, IntPtr repr); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_response_set_options")] - internal static extern int SetOptions(IntPtr resp, IntPtr options); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_response_send")] - internal static extern int Send(IntPtr resp); - } - - internal static partial class Observers - { - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_observers_create")] - internal static extern int Create(out IntPtr observers); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_observers_destroy")] - internal static extern void Destroy(IntPtr observers); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_observers_add")] - internal static extern int Add(IntPtr observers, int observeId); - - [DllImport(Libraries.IoTCon, EntryPoint = "iotcon_observers_remove")] - internal static extern int Remove(IntPtr observers, int observeId); - } - } - } -} diff --git a/src/Tizen.Network.IoTConnectivity/Interop/Interop.Libraries.cs b/src/Tizen.Network.IoTConnectivity/Interop/Interop.Libraries.cs deleted file mode 100755 index b91861804..000000000 --- a/src/Tizen.Network.IoTConnectivity/Interop/Interop.Libraries.cs +++ /dev/null @@ -1,25 +0,0 @@ - /* - * 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 IoTCon = "libiotcon.so.0"; - public const string Glib = "libglib-2.0.so.0"; - public const string Libc = "libc.so.6"; - } -} diff --git a/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity.csproj b/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity.csproj deleted file mode 100644 index 7f4584ffe..000000000 --- a/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - netstandard2.0 - - - - - - - - diff --git a/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity.sln b/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity.sln deleted file mode 100755 index e6bd49fe6..000000000 --- a/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity.sln +++ /dev/null @@ -1,34 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26430.12 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Network.IoTConnectivity", "Tizen.Network.IoTConnectivity.csproj", "{3582989E-9C6D-4E1B-9C5A-F985F9B6F346}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen", "..\Tizen\Tizen.csproj", "{49F93528-1A8C-45E5-A9DF-0D6E90C950AE}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Log", "..\Tizen.Log\Tizen.Log.csproj", "{D3E401EB-8E0C-43C9-98B9-D29B8D4A92E2}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {3582989E-9C6D-4E1B-9C5A-F985F9B6F346}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {3582989E-9C6D-4E1B-9C5A-F985F9B6F346}.Debug|Any CPU.Build.0 = Debug|Any CPU - {3582989E-9C6D-4E1B-9C5A-F985F9B6F346}.Release|Any CPU.ActiveCfg = Release|Any CPU - {3582989E-9C6D-4E1B-9C5A-F985F9B6F346}.Release|Any CPU.Build.0 = Release|Any CPU - {49F93528-1A8C-45E5-A9DF-0D6E90C950AE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {49F93528-1A8C-45E5-A9DF-0D6E90C950AE}.Debug|Any CPU.Build.0 = Debug|Any CPU - {49F93528-1A8C-45E5-A9DF-0D6E90C950AE}.Release|Any CPU.ActiveCfg = Release|Any CPU - {49F93528-1A8C-45E5-A9DF-0D6E90C950AE}.Release|Any CPU.Build.0 = Release|Any CPU - {D3E401EB-8E0C-43C9-98B9-D29B8D4A92E2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D3E401EB-8E0C-43C9-98B9-D29B8D4A92E2}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D3E401EB-8E0C-43C9-98B9-D29B8D4A92E2}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D3E401EB-8E0C-43C9-98B9-D29B8D4A92E2}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/Attributes.cs b/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/Attributes.cs deleted file mode 100755 index 6dd18a82e..000000000 --- a/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/Attributes.cs +++ /dev/null @@ -1,860 +0,0 @@ -/// Copyright 2016 by Samsung Electronics, Inc., -/// - /* - * 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.Collections; -using System.Collections.Generic; -using System.Runtime.InteropServices; - -namespace Tizen.Network.IoTConnectivity -{ - /// - /// This class represents current attributes of a resource. - /// It provides API to manage attributes. - /// This class is accessed by using a constructor to create a new instance of this object. - /// - /// 3 - public class Attributes : IDictionary, IDisposable - { - internal IntPtr _resourceAttributesHandle = IntPtr.Zero; - private readonly IDictionary _attributes = new Dictionary(); - private bool _disposed = false; - - /// - /// The Attributes constructor. - /// - /// 3 - /// 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); - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to create attributes handle"); - throw IoTConnectivityErrorFactory.GetException(ret); - } - } - - internal Attributes(IntPtr attributesHandleToClone) - { - int ret = Interop.IoTConnectivity.Common.Attributes.Clone(attributesHandleToClone, out _resourceAttributesHandle); - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to create attributes handle"); - throw IoTConnectivityErrorFactory.GetException(ret); - } - - SetAttributes(_resourceAttributesHandle); - } - - /// - /// Destructor of the Attributes class. - /// - ~Attributes() - { - Dispose(false); - } - - /// - /// Gets the number of keys. - /// - /// 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 - { - return _attributes.Count; - } - } - - /// - /// Represents whether an attribute is readonly. - /// - /// 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 - { - return _attributes.IsReadOnly; - } - } - - /// - /// Contains all the attribute keys. - /// - /// 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 - { - return _attributes.Keys; - } - } - - /// - /// Contains all the attribute values. - /// - /// 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 - { - return _attributes.Values; - } - } - - /// - /// Gets or sets the attribute with the specified key. - /// - /// 3 - /// 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 - { - if (_attributes.ContainsKey(key)) - return _attributes[key]; - else - return null; - } - - set - { - Add(key, value); - } - } - - /// - /// Adds the attribute key and a value as a key value pair. - /// - /// 3 - /// The key value pair to add. - /// http://tizen.org/feature/iot.ocf - /// - /// Tizen.Network.IoTConnectivity.Attributes attributes = new Tizen.Network.IoTConnectivity.Attributes(); - /// attributes.Add(new KeyValuePair ("state", "ON")); - /// - public void Add(KeyValuePair item) - { - Add(item.Key, item.Value); - } - - /// - /// Adds an attribute. - /// - /// 3 - /// 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; - if (value is int) - { - ret = Interop.IoTConnectivity.Common.Attributes.AddInt(_resourceAttributesHandle, key, (int)value); - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to add int"); - throw IoTConnectivityErrorFactory.GetException(ret); - } - } - else if (value is Attributes) - { - Attributes attribs = (Attributes)value; - ret = Interop.IoTConnectivity.Common.Attributes.AddAttributes(_resourceAttributesHandle, key, attribs._resourceAttributesHandle); - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to add attributes"); - throw IoTConnectivityErrorFactory.GetException(ret); - } - } - else if (value is string) - { - ret = Interop.IoTConnectivity.Common.Attributes.AddStr(_resourceAttributesHandle, key, (string)value); - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to add string"); - throw IoTConnectivityErrorFactory.GetException(ret); - } - } - else if (value is double) - { - ret = Interop.IoTConnectivity.Common.Attributes.AddDouble(_resourceAttributesHandle, key, (double)value); - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to add double"); - throw IoTConnectivityErrorFactory.GetException(ret); - } - } - else if (value is bool) - { - ret = Interop.IoTConnectivity.Common.Attributes.AddBool(_resourceAttributesHandle, key, (bool)value); - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to add bool"); - throw IoTConnectivityErrorFactory.GetException(ret); - } - } - else if (value is byte[]) - { - byte[] val = value as byte[]; - if (val == null) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to get byte[] val"); - throw new ArgumentException("Invalid Parameter"); - } - ret = Interop.IoTConnectivity.Common.Attributes.AddByteStr(_resourceAttributesHandle, key, val, val.Length); - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to add bool"); - throw IoTConnectivityErrorFactory.GetException(ret); - } - } - else if (value is IEnumerable) - { - IntPtr listHandle = List.GetListHandle(value); - ret = Interop.IoTConnectivity.Common.Attributes.AddList(_resourceAttributesHandle, key, listHandle); - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to add list"); - throw IoTConnectivityErrorFactory.GetException(ret); - } - } - else - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to Add"); - throw IoTConnectivityErrorFactory.GetException((int)IoTConnectivityError.InvalidParameter); - } - _attributes.Add(key, value); - } - - /// - /// Clears attributes collection. - /// - /// 3 - /// 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) - { - int ret = Interop.IoTConnectivity.Common.Attributes.Remove(_resourceAttributesHandle, key); - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to clear attributes"); - throw IoTConnectivityErrorFactory.GetException(ret); - } - } - _attributes.Clear(); - } - - /// - /// Checks whether the given key value pair exists in attributes collection. - /// - /// 3 - /// The status key value pair. - /// true if exists. Otherwise, false. - /// - /// Tizen.Network.IoTConnectivity.Attributes attributes = new Tizen.Network.IoTConnectivity.Attributes() { - /// { "state", "ON" }, - /// { "dim", 10 } - /// }; - /// if (attributes.Contains(new KeyValuePair ("dim", 10)) - /// Console.WriteLine("Attribute conatins pair ('dim', 10)"); - /// - public bool Contains(KeyValuePair item) - { - return _attributes.Contains(item); - } - - /// - /// Checks whether the given key exists in attributes collection. - /// - /// 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); - } - - /// - /// Copies the elements of the attributes to an array, starting at a particular index. - /// - /// 3 - /// The destination array. - /// The zero-based index in an array at which copying begins. - /// - /// Tizen.Network.IoTConnectivity.Attributes attributes = new Tizen.Network.IoTConnectivity.Attributes() { - /// { "state", "ON" }, - /// { "dim", 10 } - /// }; - /// KeyValuePair[] dest = new KeyValuePair[attributes.Count]; - /// int index = 0; - /// attributes.CopyTo(dest, index); - /// Console.WriteLine("Dest conatins ({0}, {1})", dest[0].Key, dest[0].Value); - /// - public void CopyTo(KeyValuePair[] array, int arrayIndex) - { - _attributes.CopyTo(array, arrayIndex); - } - - /// - /// Returns an enumerator that iterates through the collection. - /// - /// 3 - /// An enumerator that can be used to iterate through the collection. - /// - /// Tizen.Network.IoTConnectivity.Attributes attributes = new Tizen.Network.IoTConnectivity.Attributes() { - /// { "state", "ON" }, - /// { "dim", 10 } - /// }; - /// foreach (KeyValuePair pair in attributes) - /// { - /// Console.WriteLine("key : {0}, value : {1}", pair.Key, pair.Value); - /// } - /// - public IEnumerator> GetEnumerator() - { - return _attributes.GetEnumerator(); - } - - /// - /// Removes an attribute from collection. - /// - /// 3 - /// The attributes element to remove. - /// true if operation is successful, otherwise, false. - /// http://tizen.org/feature/iot.ocf - /// 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(new KeyValuePair("dim", 10))) - /// Console.WriteLine("Remove was successful"); - /// - public bool Remove(KeyValuePair item) - { - return Remove(item.Key); - } - - /// - /// Removes an attribute from collection using a key. - /// - /// 3 - /// The attributes element to remove. - /// true if operation is successful, otherwise, false. - /// http://tizen.org/feature/iot.ocf - /// 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); - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to remove attributes"); - throw IoTConnectivityErrorFactory.GetException(ret); - } - - bool isRemoved = _attributes.Remove(key); - - return isRemoved; - } - - /// - /// Gets the value associated with the specified key. - /// - /// 3 - /// 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" } - /// }; - /// object value; - /// 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); - } - - /// - /// Returns an enumerator that iterates through the collection. - /// - /// 3 - IEnumerator IEnumerable.GetEnumerator() - { - return _attributes.GetEnumerator(); - } - - /// - /// Releases any unmanaged resources used by this object. - /// - /// 3 - /// http://tizen.org/feature/iot.ocf - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - - /// - /// Releases any unmanaged resources used by this object. Can also dispose any other disposable objects. - /// - /// 3 - /// If true, disposes any disposable objects. If false, does not dispose disposable objects. - /// http://tizen.org/feature/iot.ocf - protected virtual void Dispose(bool disposing) - { - if (_disposed) - return; - - if (disposing) - { - // Free managed objects - } - - Interop.IoTConnectivity.Common.Attributes.Destroy(_resourceAttributesHandle); - _disposed = true; - } - - private void SetAttributes(IntPtr attributesHandle) - { - Interop.IoTConnectivity.Common.Attributes.AttributesCallback cb = (IntPtr attributes, string key, IntPtr userData) => - { - Interop.IoTConnectivity.Common.DataType dataType; - int ret = Interop.IoTConnectivity.Common.Attributes.GetType(attributes, key, out dataType); - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to get type"); - throw IoTConnectivityErrorFactory.GetException(ret); - } - - switch ((Interop.IoTConnectivity.Common.DataType)dataType) - { - case Interop.IoTConnectivity.Common.DataType.Int: - { - int value; - ret = Interop.IoTConnectivity.Common.Attributes.GetInt(attributes, key, out value); - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to get attributes"); - throw IoTConnectivityErrorFactory.GetException(ret); - } - _attributes.Add(key, value); - break; - } - case Interop.IoTConnectivity.Common.DataType.Bool: - { - bool value; - ret = Interop.IoTConnectivity.Common.Attributes.GetBool(attributes, key, out value); - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to get attributes"); - throw IoTConnectivityErrorFactory.GetException(ret); - } - _attributes.Add(key, value); - break; - } - case Interop.IoTConnectivity.Common.DataType.Double: - { - double value; - ret = Interop.IoTConnectivity.Common.Attributes.GetDouble(attributes, key, out value); - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to get attributes"); - throw IoTConnectivityErrorFactory.GetException(ret); - } - _attributes.Add(key, value); - break; - } - case Interop.IoTConnectivity.Common.DataType.String: - { - IntPtr value; - string Str; - ret = Interop.IoTConnectivity.Common.Attributes.GetStr(attributes, key, out value); - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to get attributes"); - throw IoTConnectivityErrorFactory.GetException(ret); - } - Str = (value != IntPtr.Zero) ? Marshal.PtrToStringAnsi(value) : string.Empty; - _attributes.Add(key, Str); - break; - } - case Interop.IoTConnectivity.Common.DataType.ByteStr: - { - IntPtr byteStrPtr; - int byteStrSize; - ret = Interop.IoTConnectivity.Common.Attributes.GetByteStr(attributes, key, out byteStrPtr, out byteStrSize); - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to get attributes"); - throw IoTConnectivityErrorFactory.GetException(ret); - } - byte[] byteStr = new byte[byteStrSize]; - Marshal.Copy(byteStrPtr, byteStr, 0, byteStrSize); - _attributes.Add(key, byteStr); - break; - } - case Interop.IoTConnectivity.Common.DataType.Null: - { - _attributes.Add(key, null); - break; - } - case Interop.IoTConnectivity.Common.DataType.List: - { - IntPtr listHandle; - ret = Interop.IoTConnectivity.Common.Attributes.GetList(attributes, key, out listHandle); - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to get attributes"); - throw IoTConnectivityErrorFactory.GetException(ret); - } - _attributes.Add(key, List.GetList(listHandle)); - break; - } - case Interop.IoTConnectivity.Common.DataType.Attributes: - { - IntPtr attribsHandle; - ret = Interop.IoTConnectivity.Common.Attributes.GetAttributes(attributes, key, out attribsHandle); - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to get attributes"); - throw IoTConnectivityErrorFactory.GetException(ret); - } - _attributes.Add(key, new Attributes(attribsHandle)); - break; - } - default: - break; - } - - return true; - }; - - int res = Interop.IoTConnectivity.Common.Attributes.Foreach(attributesHandle, cb, IntPtr.Zero); - if (res != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to remove attributes"); - throw IoTConnectivityErrorFactory.GetException(res); - } - } - } - - internal static class List - { - internal static IntPtr GetListHandle(object list) - { - IntPtr listHandle = IntPtr.Zero; - int ret; - int pos = 0; - - if (list is IEnumerable) - { - ret = Interop.IoTConnectivity.Common.List.Create(Interop.IoTConnectivity.Common.DataType.List, out listHandle); - pos = 0; - foreach (IEnumerable val in (IEnumerable)list) - { - IntPtr childList = GetListHandle(val); - ret = Interop.IoTConnectivity.Common.List.AddList(listHandle, childList, pos++); - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to add attributes"); - Interop.IoTConnectivity.Common.List.Destroy(childList); - throw IoTConnectivityErrorFactory.GetException(ret); - } - } - } - else if (list is IEnumerable) - { - ret = Interop.IoTConnectivity.Common.List.Create(Interop.IoTConnectivity.Common.DataType.Int, out listHandle); - pos = 0; - foreach (int val in (IEnumerable)list) - { - ret = Interop.IoTConnectivity.Common.List.AddInt(listHandle, val, pos++); - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to add attributes"); - throw IoTConnectivityErrorFactory.GetException(ret); - } - } - } - else if (list is IEnumerable) - { - ret = Interop.IoTConnectivity.Common.List.Create(Interop.IoTConnectivity.Common.DataType.String, out listHandle); - pos = 0; - foreach (string val in (IEnumerable)list) - { - ret = Interop.IoTConnectivity.Common.List.AddStr(listHandle, val, pos++); - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to add str"); - throw IoTConnectivityErrorFactory.GetException(ret); - } - } - } - else if (list is IEnumerable) - { - ret = Interop.IoTConnectivity.Common.List.Create(Interop.IoTConnectivity.Common.DataType.Double, out listHandle); - pos = 0; - foreach (double val in (IEnumerable)list) - { - ret = Interop.IoTConnectivity.Common.List.AddDouble(listHandle, val, pos++); - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to add double"); - throw IoTConnectivityErrorFactory.GetException(ret); - } - } - } - else if (list is IEnumerable) - { - ret = Interop.IoTConnectivity.Common.List.Create(Interop.IoTConnectivity.Common.DataType.Bool, out listHandle); - pos = 0; - foreach (bool val in (IEnumerable)list) - { - ret = Interop.IoTConnectivity.Common.List.AddBool(listHandle, val, pos++); - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to add bool"); - throw IoTConnectivityErrorFactory.GetException(ret); - } - } - } - else if (list is IEnumerable) - { - ret = Interop.IoTConnectivity.Common.List.Create(Interop.IoTConnectivity.Common.DataType.Attributes, out listHandle); - pos = 0; - foreach (Attributes val in (IEnumerable)list) - { - ret = Interop.IoTConnectivity.Common.List.AddAttributes(listHandle, val._resourceAttributesHandle, pos++); - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to add attributes"); - throw IoTConnectivityErrorFactory.GetException(ret); - } - } - } - else if (list is IEnumerable) - { - ret = Interop.IoTConnectivity.Common.List.Create(Interop.IoTConnectivity.Common.DataType.ByteStr, out listHandle); - pos = 0; - foreach (byte[] val in (IEnumerable)list) - { - ret = Interop.IoTConnectivity.Common.List.AddByteStr(listHandle, val, val.Length, pos++); - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to add byte[]"); - throw IoTConnectivityErrorFactory.GetException(ret); - } - } - } - else - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to GetListHandle"); - throw IoTConnectivityErrorFactory.GetException((int)IoTConnectivityError.InvalidParameter); - } - return listHandle; - } - - internal static object GetList(IntPtr listHandle) - { - IList list = null; - int type; - int ret = Interop.IoTConnectivity.Common.List.GetType(listHandle, out type); - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to get type"); - throw IoTConnectivityErrorFactory.GetException(ret); - } - switch ((Interop.IoTConnectivity.Common.DataType)type) - { - case Interop.IoTConnectivity.Common.DataType.Int: - { - list = new List(); - Interop.IoTConnectivity.Common.List.IntCallback cb = (int pos, int value, IntPtr userData) => - { - list.Add(value); - return true; - }; - ret = Interop.IoTConnectivity.Common.List.ForeachInt(listHandle, cb, IntPtr.Zero); - break; - } - case Interop.IoTConnectivity.Common.DataType.Bool: - { - list = new List(); - Interop.IoTConnectivity.Common.List.BoolCallback cb = (int pos, bool value, IntPtr userData) => - { - list.Add(value); - return true; - }; - ret = Interop.IoTConnectivity.Common.List.ForeachBool(listHandle, cb, IntPtr.Zero); - break; - } - case Interop.IoTConnectivity.Common.DataType.Double: - { - list = new List(); - Interop.IoTConnectivity.Common.List.DoubleCallback cb = (int pos, double value, IntPtr userData) => - { - list.Add(value); - return true; - }; - ret = Interop.IoTConnectivity.Common.List.ForeachDouble(listHandle, cb, IntPtr.Zero); - break; - } - case Interop.IoTConnectivity.Common.DataType.String: - { - list = new List(); - Interop.IoTConnectivity.Common.List.StrCallback cb = (int pos, string value, IntPtr userData) => - { - list.Add(value); - return true; - }; - ret = Interop.IoTConnectivity.Common.List.ForeachStr(listHandle, cb, IntPtr.Zero); - break; - } - case Interop.IoTConnectivity.Common.DataType.Attributes: - { - list = new List(); - Interop.IoTConnectivity.Common.List.AttribsCallback cb = (int pos, IntPtr value, IntPtr userData) => - { - list.Add(new Attributes(value)); - return true; - }; - ret = Interop.IoTConnectivity.Common.List.ForeachAttributes(listHandle, cb, IntPtr.Zero); - break; - } - case Interop.IoTConnectivity.Common.DataType.ByteStr: - { - list = new List(); - Interop.IoTConnectivity.Common.List.ByteStrCallback cb = (int pos, byte[] value, int len, IntPtr userData) => - { - list.Add(value); - return true; - }; - ret = Interop.IoTConnectivity.Common.List.ForeachByteStr(listHandle, cb, IntPtr.Zero); - break; - } - case Interop.IoTConnectivity.Common.DataType.List: - { - list = new List>(); - Interop.IoTConnectivity.Common.List.ListCallback cb = (int pos, IntPtr value, IntPtr userData) => - { - object childList = GetList(value); - if (childList != null) - list.Add(childList); - return true; - }; - ret = Interop.IoTConnectivity.Common.List.ForeachList(listHandle, cb, IntPtr.Zero); - break; - } - default: - break; - } - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to get attributes"); - throw IoTConnectivityErrorFactory.GetException(ret); - } - return list; - } - } -} diff --git a/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/CacheUpdatedEventArgs.cs b/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/CacheUpdatedEventArgs.cs deleted file mode 100755 index 7ca278e35..000000000 --- a/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/CacheUpdatedEventArgs.cs +++ /dev/null @@ -1,37 +0,0 @@ - /* - * 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.Network.IoTConnectivity -{ - /// - /// This class represents event arguments of the CacheUpdated event. - /// - /// 3 - public class CacheUpdatedEventArgs : EventArgs - { - internal CacheUpdatedEventArgs() { } - - /// - /// Indicates the updated representation of the resource. - /// - /// 3 - /// The updated representation of the resource. - public Representation Representation { get; internal set; } - } -} diff --git a/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/DeviceInformationFoundEventArgs.cs b/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/DeviceInformationFoundEventArgs.cs deleted file mode 100755 index 605fc0359..000000000 --- a/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/DeviceInformationFoundEventArgs.cs +++ /dev/null @@ -1,70 +0,0 @@ - /* - * 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. - */ - - -namespace Tizen.Network.IoTConnectivity -{ - /// - /// This class represents event arguments of the DeviceInformationFound event. - /// - /// 3 - public class DeviceInformationFoundEventArgs - { - internal DeviceInformationFoundEventArgs() { } - - /// - /// The request ID. - /// - /// 3 - /// The request ID. - public int RequestId { get; internal set; } - - /// - /// Indicates to continuously receive the event for finding device information. - /// - /// 3 - /// Continuously receive the event for finding device information. - public bool EventContinue { get; set; } - - /// - /// Indicates the human friendly name for device. - /// - /// 3 - /// Human friendly name for device. - public string Name { get; internal set; } - - /// - /// Indicates the spec version of the core specification. - /// - /// 3 - /// Spec version of the core specification. - public string SpecVersion { get; internal set; } - - /// - /// Indicates an unique identifier for the OIC device. - /// - /// 3 - /// Unique identifier for OIC device. - public string DeviceId { get; internal set; } - - /// - /// Indicates version of the specs this device data model is implemented to. - /// - /// 3 - /// Version of the specs this device data model is implemented to. - public string DataModelVersion { get; internal set; } - } -} diff --git a/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/FindingError.cs b/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/FindingError.cs deleted file mode 100755 index eec4fbe91..000000000 --- a/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/FindingError.cs +++ /dev/null @@ -1,74 +0,0 @@ - /* - * 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. - */ - - -namespace Tizen.Network.IoTConnectivity -{ - /// - /// Enumeration for resource found errors. - /// - internal enum FindingError - { - /// - /// I/O error. - /// - Io = 1, - /// - /// Out of memory. - /// - OutOfMemory, - /// - /// Permission denied. - /// - PermissionDenied, - /// - /// Not supported. - /// - NotSupported, - /// - /// Invalid parameter. - /// - InvalidParameter, - /// - /// No data available. - /// - NoData, - /// - /// Time out. - /// - TimeOut, - /// - /// IoTivity errors. - /// - Iotivity, - /// - /// Representation errors. - /// - Representation, - /// - /// Invalid type. - /// - InvalidType, - /// - /// Already. - /// - Already, - /// - /// System errors. - /// - System - } -} diff --git a/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/FindingErrorOccurredEventArgs.cs b/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/FindingErrorOccurredEventArgs.cs deleted file mode 100755 index bc28027c5..000000000 --- a/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/FindingErrorOccurredEventArgs.cs +++ /dev/null @@ -1,44 +0,0 @@ - /* - * 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.Network.IoTConnectivity -{ - /// - /// This class represents event arguments of the FindingErrorOccurred event. - /// - /// 3 - public class FindingErrorOccurredEventArgs : EventArgs - { - internal FindingErrorOccurredEventArgs() { } - - /// - /// The request ID of the operation, which caused this error. - /// - /// 3 - /// The request ID of the operation, which caused this error. - public int RequestId { get; internal set; } - - /// - /// Contains error details. - /// - /// 3 - /// Error details. - public Exception Error { get; internal set; } - } -} diff --git a/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/IoTConnectivityClientManager.cs b/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/IoTConnectivityClientManager.cs deleted file mode 100755 index 7a8e7ed32..000000000 --- a/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/IoTConnectivityClientManager.cs +++ /dev/null @@ -1,967 +0,0 @@ - /* - * 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.Collections.Generic; -using System.Runtime.InteropServices; - -namespace Tizen.Network.IoTConnectivity -{ - /// - /// IoT connectivity client manager consists of client side APIs. - /// - /// 3 - public static class IoTConnectivityClientManager - { - /// - /// The IP Address for multicast. - /// - /// 3 - public const string MulticastAddress = null; - - private static int s_presenceListenerId = 1; - private static Dictionary s_presenceCallbacksMap = new Dictionary(); - private static Dictionary s_presenceHandlesMap = new Dictionary(); - - private static int s_requestId = 1; - private static Dictionary s_resourceFoundCallbacksMap = new Dictionary(); - private static Dictionary s_deviceInformationCallbacksMap = new Dictionary(); - private static Dictionary s_platformInformationCallbacksMap = new Dictionary(); - - /// - /// PresenceReceived event. This event occurs when server starts sending presence of a resource. - /// - /// 3 - public static event EventHandler PresenceReceived; - - /// - /// ResourceFound event. This event occurs when a resource is found from the remote server - /// after sending request using API StartFindingResource(). - /// - /// 3 - public static event EventHandler ResourceFound; - - /// - /// PlatformInformationFound event. This event occurs when platform information is found - /// after sending request using API StartFindingPlatformInformation(). - /// - /// 3 - public static event EventHandler PlatformInformationFound; - - /// - /// DeviceInformationFound event. This event occurs when device information is found - /// after sending request using API StartFindingDeviceInformation(). - /// - /// 3 - public static event EventHandler DeviceInformationFound; - - /// - /// FindingError event. This event occurs when an error is found. - /// - /// 3 - public static event EventHandler FindingErrorOccurred; - - /// - /// Timeout in seconds. - /// - /// 3 - /// - /// Value to be set must be in range from 1 to 3600. Default timeout interval value is 30.\n - /// Sets/gets the timeout of StartFindingResource(), StartFindingDeviceInformation(), StartFindingPlatformInformation(), - /// RemoteResource.GetAsync(), RemoteResource.PutAsync(), RemoteResource.PostAsync() and RemoteResource.DeleteAsync() APIs.\n - /// Setter can throw exception. - /// - ///
-        /// Initialize() should be called to initialize.
-        /// 
- /// - /// IoTConnectivityClientManager.Initialize(); - /// IoTConnectivityClientManager.TimeOut = 120; - /// - public static int TimeOut - { - get - { - int timeout; - int ret = Interop.IoTConnectivity.Client.IoTCon.GetTimeout(out timeout); - if (ret != (int)IoTConnectivityError.None) - { - Log.Warn(IoTConnectivityErrorFactory.LogTag, "Failed to get timeout"); - return 0; - } - return timeout; - } - set - { - int ret = Interop.IoTConnectivity.Client.IoTCon.SetTimeout(value); - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to set timeout"); - throw IoTConnectivityErrorFactory.GetException(ret); - } - } - } - - /// - /// Polling interval of IoTConnectivity. - /// - /// 3 - /// - /// Sets/Gets the polling inerval(milliseconds) of IoTCon. Default value is 100 milliseconds. - /// Value to be set must be in range from 1 to 999. The closer to 0, the faster it operates. - /// Setter is invoked immediately for changing the interval. - /// If you want the faster operation, we recommend you set 10 milliseconds for polling interval. - /// Setter can throw exception. - /// - ///
-        /// Initialize() should be called to initialize.
-        /// 
- /// - /// IoTConnectivityClientManager.Initialize(); - /// IoTConnectivityClientManager.PollingInterval = 100; - /// - public static int PollingInterval - { - get - { - int interval; - int ret = Interop.IoTConnectivity.Client.IoTCon.GetPollingInterval(out interval); - if (ret != (int)IoTConnectivityError.None) - { - Log.Warn(IoTConnectivityErrorFactory.LogTag, "Failed to get polling interval"); - return 0; - } - return interval; - } - set - { - int ret = Interop.IoTConnectivity.Client.IoTCon.SetPollingInterval(value); - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to set polling interval"); - throw IoTConnectivityErrorFactory.GetException(ret); - } - } - } - - /// - /// Initializes IoTCon. - /// Call this function to start IoTCon. - /// - /// 3 - /// - /// @a filePath point to a file for handling secure virtual resources. - /// The file that is CBOR(Concise Binary Object Representation)-format must already exist - /// in @a filePath. We recommend to use application-local file for @a filePath. - /// - /// - /// http://tizen.org/privilege/network.get \n - /// http://tizen.org/privilege/internet - /// - /// public - /// The file path to point to storage for handling secure virtual resources. - /// http://tizen.org/feature/iot.ocf - /// - /// You must call Deinitialize() if IoTCon API is no longer needed. - /// - /// - /// 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); - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to initialize"); - throw IoTConnectivityErrorFactory.GetException(ret); - } - } - - /// - /// Deinitializes IoTCon. - /// - /// 3 - /// - /// This API must be called if IoTCon API is no longer needed. - /// - /// http://tizen.org/feature/iot.ocf - ///
-        /// Initialize() should be called to initialize.
-        /// 
- /// - /// - /// IoTConnectivityClientManager.Deinitialize(); - /// - public static void Deinitialize() - { - s_presenceListenerId = 1; - s_presenceCallbacksMap.Clear(); - s_presenceHandlesMap.Clear(); - - s_requestId = 1; - s_resourceFoundCallbacksMap.Clear(); - s_deviceInformationCallbacksMap.Clear(); - s_platformInformationCallbacksMap.Clear(); - - PresenceReceived = delegate{}; - ResourceFound = delegate{}; - PlatformInformationFound = delegate{}; - DeviceInformationFound = delegate{}; - FindingErrorOccurred = delegate{}; - - Interop.IoTConnectivity.Client.IoTCon.Deinitialize(); - } - - /// - /// Invokes a next message from a queue for receiving messages from others, immediately. - /// - /// 3 - /// - /// This API invokes a next message from a queue for receiving messages from others, immediately. - /// After calling the API, it continues the polling with existing interval. - /// - /// http://tizen.org/feature/iot.ocf - ///
-        /// 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(); - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to invoke polling"); - throw IoTConnectivityErrorFactory.GetException(ret); - } - } - - /// - /// Starts receiving presence events. - /// - /// 3 - /// - /// Sends request to receive presence to an interested server's resource with resourceType. - /// If succeeded, event handler will be triggered when the server sends presence. - /// A server sends presence events when adds / removes / alters a resource or start / stop presence.\n - /// @a hostAddress could be for IPv4 multicast. - /// The length of @ resourceType should be less than or equal to 61. The @ resourceType must start with a lowercase alphabetic character, followed by a sequence - /// of lowercase alphabetic, numeric, ".", or "-" characters, and contains no white space. - /// - /// - /// http://tizen.org/privilege/internet - /// - /// public - /// The address or addressable name of the server. - /// A resource type that a client is interested in. - /// PresenceId - An identifier for this request. - /// http://tizen.org/feature/iot.ocf - ///
Initialize() should be called to initialize.
- /// - /// When the resource receive presence, event handler will be invoked.\n - /// You must destroy presence by calling StopReceivingPresence() if presence event is no longer needed. - /// - /// - /// - /// - /// - /// Thrown when the iotcon is not supported. - /// Thrown when there is an invalid parameter. - /// Thrown when the operation is invalid. - /// Thrown when an application does not have privilege to access. - /// Thrown when there is not enough memory. - /// - /// EventHandler handler = (sender, e) => { - /// Console.Log("PresenceReceived, presence id :" + e.PresenceId); - /// } - /// EventHandler errorHandler = (sender, e) => { - /// Console.Log("Found error :" + e.Error.Message); - /// } - /// IoTConnectivityClientManager.PresenceReceived += handler; - /// 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; - - if (resourceType != null && !ResourceTypes.IsValid(resourceType)) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Invalid type"); - throw new ArgumentException("Invalid type"); - } - - IntPtr id = IntPtr.Zero; - lock (s_presenceCallbacksMap) - { - id = (IntPtr)s_presenceListenerId++; - } - s_presenceCallbacksMap[id] = (IntPtr presence, int result, IntPtr presenceResponseHandle, IntPtr userData) => - { - int presenceId = (int)userData; - if (result == (int)IoTConnectivityError.None) - { - if (presenceResponseHandle != IntPtr.Zero) - { - PresenceReceivedEventArgs e = GetPresenceReceivedEventArgs(presenceId, presenceResponseHandle); - if (e == null) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Can't get PresenceReceivedEventArgs"); - return; - } - PresenceReceived?.Invoke(null, e); - } - else - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Handle is null"); - return; - } - } - else - { - FindingErrorOccurredEventArgs e = GetFindingErrorOccurredEventArgs(presenceId, result); - FindingErrorOccurred?.Invoke(null, e); - } - }; - - IntPtr presenceHandle; - int errorCode = Interop.IoTConnectivity.Client.Presence.AddPresenceCb(hostAddress, (int)connectivityType, resourceType, s_presenceCallbacksMap[id], id, out presenceHandle); - if (errorCode != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to register presence event handler"); - lock (s_presenceCallbacksMap) - { - s_presenceCallbacksMap.Remove(id); - } - throw IoTConnectivityErrorFactory.GetException(errorCode); - } - - lock (s_presenceHandlesMap) - { - s_presenceHandlesMap[id] = presenceHandle; - } - return (int)id; - } - - /// - /// Stops receiving presence events. - /// - /// 3 - /// - /// Sends request to not to receive server's presence any more. - /// - /// - /// http://tizen.org/privilege/internet - /// - /// public - /// The start presence request identifier. - /// http://tizen.org/feature/iot.ocf - ///
-        /// Initialize() should be called to initialize.
-        /// 
- /// - /// - /// - /// - /// Thrown when the iotcon is not supported. - /// Thrown when there is an invalid parameter. - /// Thrown when the operation is invalid. - /// Thrown when an application does not have privilege to access. - /// Thrown when there is not enough memory. - /// - /// EventHandler handler = (sender, e) => { - /// Console.Log("PresenceReceived, presence id :" + e.PresenceId); - /// } - /// EventHandler errorHandler = (sender, e) => { - /// Console.Log("Found error :" + e.Error.Message); - /// } - /// IoTConnectivityClientManager.PresenceReceived += handler; - /// IoTConnectivityClientManager.FindingErrorOccurred += errorHandler; - /// int id = IoTConnectivityClientManager.StartReceivingPresence(IoTConnectivityClientManager.MulticastAddress, "oic.iot.door"); - /// await Task.Delay(5000); // Do other things here - /// // Call StopReceivingPresence() when receiving presence is not required any more - /// IoTConnectivityClientManager.PresenceReceived -= handler; - /// IoTConnectivityClientManager.FindingErrorOccurred -= errorHandler; - /// IoTConnectivityClientManager.StopReceivingPresence(id); - /// - public static void StopReceivingPresence(int presenceId) - { - if (!s_presenceHandlesMap.ContainsKey((IntPtr)presenceId)) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "this presenceId does not exist"); - throw new ArgumentException("this presenceId does not exist"); - } - - if (s_presenceHandlesMap.ContainsKey((IntPtr)presenceId)) - { - IntPtr presenceHandle = s_presenceHandlesMap[(IntPtr)presenceId]; - int ret = Interop.IoTConnectivity.Client.Presence.RemovePresenceCb(presenceHandle); - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to deregister presence event handler"); - throw IoTConnectivityErrorFactory.GetException(ret); - } - - lock (s_presenceHandlesMap) - { - s_presenceHandlesMap.Remove((IntPtr)presenceId); - } - } - - if (s_presenceCallbacksMap.ContainsKey((IntPtr)presenceId)) - { - lock (s_presenceCallbacksMap) - { - s_presenceCallbacksMap.Remove((IntPtr)presenceId); - } - } - } - - /// - /// Starts finding resources. - /// - /// 3 - /// - /// Sends request to find a resource of @a hostAddress server with @a resourceType. - /// If succeeded, event handler will be triggered with information of the resource.\n - /// @a hostAddress could be for the IPv4 multicast. - /// The length of @a resourceType should be less than or equal to 61. The @ resourceType must start with a lowercase alphabetic character, followed by a sequence - /// of lowercase alphabetic, numeric, ".", or "-" characters, and contains no white space. - /// - /// - /// http://tizen.org/privilege/internet - /// - /// public - /// The address or addressable name of the server. The address includes a protocol like coaps://. - /// The query specified as a filter for founding resources. - /// RequestId - An identifier for this request. - /// http://tizen.org/feature/iot.ocf - ///
Initialize() should be called to initialize.
- /// - /// When the resource is found, event handler will be invoked. - /// - /// - /// - /// - /// Thrown when the iotcon is not supported. - /// Thrown when the operation is invalid. - /// Thrown when an application does not have privilege to access. - /// Thrown when there is not enough memory. - /// - /// EventHandler handler = (sender, e) => { - /// Console.Log("Found resource at host address :" + e.Resource.HostAddress + ", uri :" + e.Resource.UriPath); - /// } - /// EventHandler errorHandler = (sender, e) => { - /// Console.Log("Found error :" + e.Error.Message); - /// } - /// IoTConnectivityClientManager.ResourceFound += handler; - /// IoTConnectivityClientManager.FindingErrorOccurred += errorHandler; - /// ResourceQuery query = new ResourceQuery(); - /// 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; - - IntPtr id = IntPtr.Zero; - lock (s_resourceFoundCallbacksMap) - { - id = (IntPtr)s_requestId++; - } - s_resourceFoundCallbacksMap[id] = (IntPtr remoteResourceHandle, int result, IntPtr userData) => - { - if (ResourceFound == null) - return false; - - int requestId = (int)userData; - if (result == (int)IoTConnectivityError.None) - { - if (remoteResourceHandle != IntPtr.Zero) - { - RemoteResource resource = null; - try - { - resource = new RemoteResource(remoteResourceHandle); - } - catch (Exception exp) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Can't clone RemoteResource's handle: " + exp.Message); - return true; - } - ResourceFoundEventArgs e = new ResourceFoundEventArgs() - { - RequestId = requestId, - EventContinue = true, - Resource = resource - }; - ResourceFound?.Invoke(null, e); - Log.Info(IoTConnectivityErrorFactory.LogTag, "e.EventContinue : " + e.EventContinue); - return e.EventContinue; - } - else - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Handle is null"); - } - } - else - { - FindingErrorOccurredEventArgs e = GetFindingErrorOccurredEventArgs(requestId, result); - FindingErrorOccurred?.Invoke(null, e); - - lock (s_resourceFoundCallbacksMap) - { - s_resourceFoundCallbacksMap.Remove(id); - } - } - return true; - }; - IntPtr queryHandle = (query == null) ? IntPtr.Zero : query._resourceQueryHandle; - int errorCode = Interop.IoTConnectivity.Client.ResourceFinder.AddResourceFoundCb(hostAddress, (int)connectivityType, queryHandle, s_resourceFoundCallbacksMap[id], id); - if (errorCode != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to register resource found event handler"); - lock (s_resourceFoundCallbacksMap) - { - s_resourceFoundCallbacksMap.Remove(id); - } - throw IoTConnectivityErrorFactory.GetException(errorCode); - } - return (int)id; - } - - /// - /// Starts finding the device information of remote server. - /// - /// 3 - /// - /// Requests server for device information. - /// If succeeded, event handler will be triggered with information of the device.\n - /// @a hostAddress could be for the IPv4 multicast. - /// - /// - /// http://tizen.org/privilege/internet - /// - /// public - /// The host address of the remote server. - /// The query specified as a filter for founding resources. - /// RequestId - An identifier for this request. - /// http://tizen.org/feature/iot.ocf - ///
Initialize() should be called to initialize.
- /// - /// event handler will be invoked. - /// - /// - /// - /// - /// - /// Thrown when the iotcon is not supported. - /// Thrown when the operation is invalid. - /// Thrown when an application does not have privilege to access. - /// Thrown when there is not enough memory. - /// - /// EventHandler handler = (sender, e) => { - /// Console.Log("Device information found, id : " + e.RequestId + ", name : " + e.Name); - /// } - /// EventHandler errorHandler = (sender, e) => { - /// Console.Log("Found error :" + e.Error.Message); - /// } - /// IoTConnectivityClientManager.DeviceInformationFound += handler; - /// 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; - - IntPtr id = IntPtr.Zero; - lock (s_deviceInformationCallbacksMap) - { - id = (IntPtr)s_requestId++; - } - s_deviceInformationCallbacksMap[id] = (IntPtr deviceInfoHandle, int result, IntPtr userData) => - { - if (DeviceInformationFound == null) - return false; - - int requestId = (int)userData; - if (result == (int)IoTConnectivityError.None) - { - if (deviceInfoHandle != IntPtr.Zero) - { - DeviceInformationFoundEventArgs e = GetDeviceInformationFoundEventArgs(requestId, deviceInfoHandle); - if (e == null) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Can't get DeviceInformationFoundEventArgs"); - return true; - } - DeviceInformationFound?.Invoke(null, e); - Log.Info(IoTConnectivityErrorFactory.LogTag, "e.EventContinue : " + e.EventContinue); - return e.EventContinue; - } - else - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Handle is null"); - } - } - else - { - FindingErrorOccurredEventArgs e = GetFindingErrorOccurredEventArgs(requestId, result); - FindingErrorOccurred?.Invoke(null, e); - - lock (s_deviceInformationCallbacksMap) - { - s_deviceInformationCallbacksMap.Remove(id); - } - } - return true; - }; - - IntPtr queryHandle = (query == null) ? IntPtr.Zero : query._resourceQueryHandle; - int errorCode = Interop.IoTConnectivity.Client.DeviceInformation.Find(hostAddress, (int)connectivityType, queryHandle, s_deviceInformationCallbacksMap[id], id); - if (errorCode != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to get device information"); - lock (s_deviceInformationCallbacksMap) - { - s_deviceInformationCallbacksMap.Remove(id); - } - throw IoTConnectivityErrorFactory.GetException(errorCode); - } - - return (int)id; - } - - /// - /// Starts finding the platform information of remote server. - /// - /// 3 - /// - /// Requests server for platform information. - /// If succeeded, event handler will be triggered with information of the platform.\n - /// @a hostAddress could be for IPv4 multicast. - /// - /// - /// http://tizen.org/privilege/internet - /// - /// public - /// The host address of remote server. - /// The query specified as a filter for founding resources. - /// RequestId - An identifier for this request. - /// http://tizen.org/feature/iot.ocf - ///
Initialize() should be called to initialize.
- /// - /// event handler will be invoked. - /// - /// - /// - /// - /// Thrown when the iotcon is not supported. - /// Thrown when the operation is invalid. - /// Thrown when an application does not have privilege to access. - /// Thrown when there is not enough memory. - /// - /// EventHandler handler = (sender, e) => { - /// Console.Log("PlatformInformationFound :" + e.RequestId); - /// } - /// EventHandler errorHandler = (sender, e) => { - /// Console.Log("Found error :" + e.Error.Message); - /// } - /// IoTConnectivityClientManager.PlatformInformationFound += handler; - /// 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; - - IntPtr id = IntPtr.Zero; - lock (s_platformInformationCallbacksMap) - { - id = (IntPtr)s_requestId++; - } - s_platformInformationCallbacksMap[id] = (IntPtr platformInfoHandle, int result, IntPtr userData) => - { - if (PlatformInformationFound == null) - return false; - - int requestId = (int)userData; - if (result == (int)IoTConnectivityError.None) - { - if (platformInfoHandle != IntPtr.Zero) - { - PlatformInformationFoundEventArgs e = GetPlatformInformationFoundEventArgs(requestId, platformInfoHandle); - if (e == null) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Can't get PlatformInformationFoundEventArgs"); - return true; - } - PlatformInformationFound?.Invoke(null, e); - Log.Info(IoTConnectivityErrorFactory.LogTag, "e.EventContinue : " + e.EventContinue); - return e.EventContinue; - } - else - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Handle is null"); - } - } - else - { - FindingErrorOccurredEventArgs e = GetFindingErrorOccurredEventArgs(requestId, result); - FindingErrorOccurred?.Invoke(null, e); - - lock (s_platformInformationCallbacksMap) - { - s_platformInformationCallbacksMap.Remove(id); - } - } - return true; - }; - - IntPtr queryHandle = (query == null) ? IntPtr.Zero : query._resourceQueryHandle; - int errorCode = Interop.IoTConnectivity.Client.PlatformInformation.Find(hostAddress, (int)connectivityType, queryHandle, s_platformInformationCallbacksMap[id], id); - if (errorCode != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to get platform information"); - lock (s_platformInformationCallbacksMap) - { - s_platformInformationCallbacksMap.Remove(id); - } - throw IoTConnectivityErrorFactory.GetException(errorCode); - } - - return (int)id; - } - - // Private methods - private static PresenceReceivedEventArgs GetPresenceReceivedEventArgs(int presenceId, IntPtr presenceResponseHandle) - { - int trigger; - IntPtr host, type; - - int ret = Interop.IoTConnectivity.Client.PresenceResponse.GetHostAddress(presenceResponseHandle, out host); - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to get host address"); - return null; - } - - ret = Interop.IoTConnectivity.Client.PresenceResponse.GetResourceType(presenceResponseHandle, out type); - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to get resource type"); - return null; - } - - ret = Interop.IoTConnectivity.Client.PresenceResponse.GetTrigger(presenceResponseHandle, out trigger); - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to get event type"); - return null; - } - - PresenceReceivedEventArgs e = new PresenceReceivedEventArgs() - { - PresenceId = presenceId, - HostAddress = (host != IntPtr.Zero) ? Marshal.PtrToStringAnsi(host) : string.Empty, - Type = (type != IntPtr.Zero) ? Marshal.PtrToStringAnsi(type) : string.Empty, - EventType = (PresenceEventType)trigger - }; - - return e; - } - - private static DeviceInformationFoundEventArgs GetDeviceInformationFoundEventArgs(int requestId, IntPtr deviceInfoHandle) - { - IntPtr name, specVersion, deviceId, dataModelVersion; - - int ret = Interop.IoTConnectivity.Client.DeviceInformation.GetProperty(deviceInfoHandle, (int)Interop.IoTConnectivity.Client.DeviceInformation.Property.Name, out name); - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to get name"); - return null; - } - - ret = Interop.IoTConnectivity.Client.DeviceInformation.GetProperty(deviceInfoHandle, (int)Interop.IoTConnectivity.Client.DeviceInformation.Property.SpecVersion, out specVersion); - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to get spec version"); - return null; - } - - ret = Interop.IoTConnectivity.Client.DeviceInformation.GetProperty(deviceInfoHandle, (int)Interop.IoTConnectivity.Client.DeviceInformation.Property.Id, out deviceId); - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to get device id"); - return null; - } - - ret = Interop.IoTConnectivity.Client.DeviceInformation.GetProperty(deviceInfoHandle, (int)Interop.IoTConnectivity.Client.DeviceInformation.Property.DataModelVersion, out dataModelVersion); - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to get data model version"); - return null; - } - - DeviceInformationFoundEventArgs e = new DeviceInformationFoundEventArgs() - { - RequestId = requestId, - EventContinue = true, - Name = (name != IntPtr.Zero) ? Marshal.PtrToStringAnsi(name) : string.Empty, - SpecVersion = (specVersion != IntPtr.Zero) ? Marshal.PtrToStringAnsi(specVersion) : string.Empty, - DeviceId = (deviceId != IntPtr.Zero) ? Marshal.PtrToStringAnsi(deviceId) : string.Empty, - DataModelVersion = (dataModelVersion != IntPtr.Zero) ? Marshal.PtrToStringAnsi(dataModelVersion) : string.Empty - }; - - return e; - } - - private static PlatformInformationFoundEventArgs GetPlatformInformationFoundEventArgs(int requestId, IntPtr platformInfoHandle) - { - IntPtr platformId, manufacturerName, manufacturerUrl, modelNumber, dateOfManufacture, platformVersion, osVersion, hardwareVersion, firmwareVersion, supportUrl, systemTime; - - int ret = Interop.IoTConnectivity.Client.PlatformInformation.GetProperty(platformInfoHandle, (int)Interop.IoTConnectivity.Client.PlatformInformation.Propery.Id, out platformId); - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to get platform id"); - return null; - } - - ret = Interop.IoTConnectivity.Client.PlatformInformation.GetProperty(platformInfoHandle, (int)Interop.IoTConnectivity.Client.PlatformInformation.Propery.MfgName, out manufacturerName); - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to get manufacturer name"); - return null; - } - - ret = Interop.IoTConnectivity.Client.PlatformInformation.GetProperty(platformInfoHandle, (int)Interop.IoTConnectivity.Client.PlatformInformation.Propery.MfgUrl, out manufacturerUrl); - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to get manufacturer url"); - return null; - } - - ret = Interop.IoTConnectivity.Client.PlatformInformation.GetProperty(platformInfoHandle, (int)Interop.IoTConnectivity.Client.PlatformInformation.Propery.ModelNumber, out modelNumber); - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to get model number"); - return null; - } - - ret = Interop.IoTConnectivity.Client.PlatformInformation.GetProperty(platformInfoHandle, (int)Interop.IoTConnectivity.Client.PlatformInformation.Propery.DateOfMfg, out dateOfManufacture); - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to get date of manufacture"); - return null; - } - - ret = Interop.IoTConnectivity.Client.PlatformInformation.GetProperty(platformInfoHandle, (int)Interop.IoTConnectivity.Client.PlatformInformation.Propery.PlatformVer, out platformVersion); - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to get platform version"); - return null; - } - - ret = Interop.IoTConnectivity.Client.PlatformInformation.GetProperty(platformInfoHandle, (int)Interop.IoTConnectivity.Client.PlatformInformation.Propery.OsVer, out osVersion); - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to os version"); - return null; - } - - ret = Interop.IoTConnectivity.Client.PlatformInformation.GetProperty(platformInfoHandle, (int)Interop.IoTConnectivity.Client.PlatformInformation.Propery.HardwareVer, out hardwareVersion); - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to hardware version"); - return null; - } - - ret = Interop.IoTConnectivity.Client.PlatformInformation.GetProperty(platformInfoHandle, (int)Interop.IoTConnectivity.Client.PlatformInformation.Propery.FirmwareVer, out firmwareVersion); - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to get firmware version"); - return null; - } - - ret = Interop.IoTConnectivity.Client.PlatformInformation.GetProperty(platformInfoHandle, (int)Interop.IoTConnectivity.Client.PlatformInformation.Propery.SupportUrl, out supportUrl); - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to get support url"); - return null; - } - - ret = Interop.IoTConnectivity.Client.PlatformInformation.GetProperty(platformInfoHandle, (int)Interop.IoTConnectivity.Client.PlatformInformation.Propery.SystemTime, out systemTime); - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to get system time"); - return null; - } - - PlatformInformationFoundEventArgs e = new PlatformInformationFoundEventArgs() - { - RequestId = requestId, - EventContinue = true, - PlatformId = (platformId != IntPtr.Zero) ? Marshal.PtrToStringAnsi(platformId) : string.Empty, - ManufacturerName = (manufacturerName != IntPtr.Zero) ? Marshal.PtrToStringAnsi(manufacturerName) : string.Empty, - ManufacturerURL = (manufacturerUrl != IntPtr.Zero) ? Marshal.PtrToStringAnsi(manufacturerUrl) : string.Empty, - DateOfManufacture = (dateOfManufacture != IntPtr.Zero) ? Marshal.PtrToStringAnsi(dateOfManufacture) : string.Empty, - ModelNumber = (modelNumber != IntPtr.Zero) ? Marshal.PtrToStringAnsi(modelNumber) : string.Empty, - PlatformVersion = (platformVersion != IntPtr.Zero) ? Marshal.PtrToStringAnsi(platformVersion) : string.Empty, - OsVersion = (osVersion != IntPtr.Zero) ? Marshal.PtrToStringAnsi(osVersion) : string.Empty, - HardwareVersion = (hardwareVersion != IntPtr.Zero) ? Marshal.PtrToStringAnsi(hardwareVersion) : string.Empty, - FirmwareVersion = (firmwareVersion != IntPtr.Zero) ? Marshal.PtrToStringAnsi(firmwareVersion) : string.Empty, - SupportUrl = (supportUrl != IntPtr.Zero) ? Marshal.PtrToStringAnsi(supportUrl) : string.Empty, - SystemTime = (systemTime != IntPtr.Zero) ? Marshal.PtrToStringAnsi(systemTime) : string.Empty - }; - - Log.Info(IoTConnectivityErrorFactory.LogTag, "e.RequestId is " + e.RequestId); - Log.Info(IoTConnectivityErrorFactory.LogTag, "e.PlatformId is " + e.PlatformId); - Log.Info(IoTConnectivityErrorFactory.LogTag, "e.ManufacturerName is " + e.ManufacturerName); - Log.Info(IoTConnectivityErrorFactory.LogTag, "e.ManufacturerURL is " + e.ManufacturerURL); - Log.Info(IoTConnectivityErrorFactory.LogTag, "e.DateOfManufacture is " + e.DateOfManufacture); - Log.Info(IoTConnectivityErrorFactory.LogTag, "e.ModelNumber is " + e.ModelNumber); - Log.Info(IoTConnectivityErrorFactory.LogTag, "e.PlatformVersion is " + e.PlatformVersion); - Log.Info(IoTConnectivityErrorFactory.LogTag, "e.OsVersion is " + e.OsVersion); - Log.Info(IoTConnectivityErrorFactory.LogTag, "e.HardwareVersion is " + e.HardwareVersion); - Log.Info(IoTConnectivityErrorFactory.LogTag, "e.FirmwareVersion is " + e.FirmwareVersion); - Log.Info(IoTConnectivityErrorFactory.LogTag, "e.SupportUrl is " + e.SupportUrl); - Log.Info(IoTConnectivityErrorFactory.LogTag, "e.SystemTime is " + e.SystemTime); - - return e; - } - - private static FindingErrorOccurredEventArgs GetFindingErrorOccurredEventArgs(int requestId, int err) - { - FindingErrorOccurredEventArgs e = new FindingErrorOccurredEventArgs() - { - RequestId = requestId, - Error = IoTConnectivityErrorFactory.GetException(err) - }; - return e; - } - } -} diff --git a/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/IoTConnectivityErrorFactory.cs b/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/IoTConnectivityErrorFactory.cs deleted file mode 100755 index 338a0936a..000000000 --- a/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/IoTConnectivityErrorFactory.cs +++ /dev/null @@ -1,103 +0,0 @@ - /* - * 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.IO; -using Tizen.Internals.Errors; - -namespace Tizen.Network.IoTConnectivity -{ - internal enum IoTConnectivityError - { - None = ErrorCode.None, - InvalidParameter = ErrorCode.InvalidParameter, - OutOfMemory = ErrorCode.OutOfMemory, - Io = ErrorCode.IoError, - PermissionDenied = ErrorCode.PermissionDenied, - NotSupported = ErrorCode.NotSupported, - NoData = ErrorCode.NoData, - TimedOut = ErrorCode.TimedOut, - Iotivity = -0x01C80000 | 0x01, - Representation = -0x01C80000 | 0x02, - InvalidType = -0x01C80000 | 0x03, - Already = -0x01C80000 | 0x04, - System = -0x01C80000 | 0x06, - } - - internal static class IoTConnectivityErrorFactory - { - internal const string LogTag = "Tizen.Network.IoTConnectivity"; - - internal static void ThrowException(int err) - { - throw GetException(err); - } - - internal static Exception GetException(int err) - { - IoTConnectivityError error = (IoTConnectivityError)err; - if (error == IoTConnectivityError.OutOfMemory) - { - return new OutOfMemoryException("Out of memory"); - } - else if (error == IoTConnectivityError.InvalidParameter) - { - return new ArgumentException("Invalid parameter"); - } - else if (error == IoTConnectivityError.Io) - { - return new IOException("I/O Error"); - } - else if (error == IoTConnectivityError.NoData) - { - return new InvalidOperationException("No data found"); - } - else if (error == IoTConnectivityError.TimedOut) - { - return new TimeoutException("timed out"); - } - else if (error == IoTConnectivityError.PermissionDenied) - { - return new UnauthorizedAccessException("Permission denied"); - } - else if (error == IoTConnectivityError.NotSupported) - { - return new NotSupportedException("Not supported"); - } - else if (error == IoTConnectivityError.Representation) - { - return new InvalidOperationException("Representation error"); - } - else if (error == IoTConnectivityError.InvalidType) - { - return new ArgumentException("Invalid type"); - } - else if (error == IoTConnectivityError.Already) - { - return new InvalidOperationException("Duplicate"); - } - else if (error == IoTConnectivityError.System) - { - return new InvalidOperationException("System error"); - } - else - { - return new InvalidOperationException("Invalid operation"); - } - } - } -} diff --git a/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/IoTConnectivityServerManager.cs b/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/IoTConnectivityServerManager.cs deleted file mode 100755 index 34946c904..000000000 --- a/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/IoTConnectivityServerManager.cs +++ /dev/null @@ -1,315 +0,0 @@ - /* - * 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.Collections.Generic; - -namespace Tizen.Network.IoTConnectivity -{ - /// - /// IoT connectivity server manager consists of server side APIs. - /// - /// 3 - public static class IoTConnectivityServerManager - { - private static int s_requestId = 1; - private static Dictionary s_RequestHandlerCallbackMap = new Dictionary(); - - /// - /// Initializes IoTCon. Calls this API to start IoTCon. - /// - /// 3 - /// - /// @a filePath point to a file for handling secure virtual resources. - /// The file that is CBOR(Concise Binary Object Representation)-format must already exist - /// in @a filePath. We recommend to use application-local file for @a filePath. - /// - /// - /// http://tizen.org/privilege/network.get \n - /// http://tizen.org/privilege/internet - /// - /// public - /// The file path to point to storage for handling secure virtual resources. - /// http://tizen.org/feature/iot.ocf - /// - /// You must call Deinitialize() if IoTCon API is no longer needed. - /// - /// - /// 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); - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to initialize"); - throw IoTConnectivityErrorFactory.GetException(ret); - } - } - - /// - /// Deinitializes IoTCon. - /// - /// 3 - /// - /// This API must be called if IoTCon API is no longer needed. - /// - /// http://tizen.org/feature/iot.ocf - ///
-        /// Initialize() should be called to initialize.
-        /// 
- /// - /// - /// IoTConnectivityServerManager.Deinitialize(); - /// - public static void Deinitialize() - { - _resources.Clear(); - s_requestId = 1; - s_RequestHandlerCallbackMap.Clear(); - - Interop.IoTConnectivity.Client.IoTCon.Deinitialize(); - } - - /// - /// Registers a resource in IoTCon server. - /// - /// 3 - /// - /// http://tizen.org/privilege/internet - /// - /// public - /// The resource to register. - /// http://tizen.org/feature/iot.ocf - ///
-        /// Initialize() should be called to initialize.
-        /// 
- /// - /// - /// Thrown when the iotcon is not supported. - /// Thrown when there is an invalid parameter. - /// Thrown when the operation is invalid. - /// Thrown when there is not enough memory. - /// Thrown when an application does not have privilege to access. - /// - /// ResourceTypes types = new ResourceTypes(new List(){ "org.tizen.light" }); - /// Attributes attributes = new Attributes { { "state", "ON" }}; - /// Resource res = new LiteResource("/room/1", types, ResourcePolicy.Discoverable, attributes); - /// try { - /// IoTConnectivityServerManager.RegisterResource(res); - /// } catch(Exception ex) { - /// Console.Log("Exception caught : " + ex.Message); - /// } - /// - public static void RegisterResource(Resource resource) - { - Log.Info(IoTConnectivityErrorFactory.LogTag, "..."); - - IntPtr id = IntPtr.Zero; - lock (s_RequestHandlerCallbackMap) - { - id = (IntPtr)s_requestId++; - } - - s_RequestHandlerCallbackMap[id] = (IntPtr r_resource, IntPtr request, IntPtr userData) => - { - int requestId = (int)userData; - - Log.Info(IoTConnectivityErrorFactory.LogTag, "Received s_RequestHandlerCallbackMap : " + requestId); - - if (request == IntPtr.Zero) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "request is IntPtr.Zero"); - return; - } - resource.OnRequest(r_resource, request, userData); - }; - - IntPtr handle = IntPtr.Zero; - int errorCode = Interop.IoTConnectivity.Server.Resource.Create(resource.UriPath, resource.Types._resourceTypeHandle, resource.Interfaces.ResourceInterfacesHandle, (int)resource.Policy, s_RequestHandlerCallbackMap[id], id, out handle); - if (errorCode != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed create resource"); - lock (s_RequestHandlerCallbackMap) - { - s_RequestHandlerCallbackMap.Remove(id); - } - throw IoTConnectivityErrorFactory.GetException(errorCode); - } - else - { - resource.ResourceHandle = handle; - } - _resources.Add(resource); - } - - /// - /// Unregisters a resource in IoTCon server. - /// - /// 3 - /// - /// http://tizen.org/privilege/internet - /// - /// public - /// The resource to unregister. - /// http://tizen.org/feature/iot.ocf - ///
-        /// Initialize() should be called to initialize.
-        /// 
- /// - /// - /// Thrown when the iotcon is not supported. - /// Thrown when an application does not have privilege to access. - /// - /// ResourceTypes types = new ResourceTypes(new List(){ "org.tizen.light" }); - /// Attributes attributes = new Attributes { { "state", "ON" }}; - /// Resource res = new LiteResource("/room/1", types, ResourcePolicy.Discoverable, attributes); - /// IoTConnectivityServerManager.RegisterResource(res); - /// try { - /// IoTConnectivityServerManager.UnregisterResource(res); - /// } catch(Exception ex) { - /// Console.Log("Exception caught : " + ex.Message); - /// } - /// - public static void UnregisterResource(Resource resource) - { - if (resource != null) - { - if (resource.ResourceHandle != IntPtr.Zero) - { - Interop.IoTConnectivity.Server.Resource.Destroy(resource.ResourceHandle); - resource.ResourceHandle = IntPtr.Zero; - } - - _resources.Remove(resource); - } - } - - /// - /// Starts presence of a server. - /// - /// 3 - /// - /// Use this API to send server's announcements to clients. - /// Server can call this API when online for the first time or come back from offline to online.\n - /// If @a time is 0, server will set default value as 60 seconds.\n - /// If @a time is very big, server will set maximum value as (60 * 60 * 24) seconds, (24 hours). - /// - /// - /// http://tizen.org/privilege/internet - /// - /// public - /// The interval of announcing presence in seconds. - /// http://tizen.org/feature/iot.ocf - ///
-        /// Initialize() should be called to initialize.
-        /// 
- /// - /// - /// - /// - /// 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); - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to start presence"); - throw IoTConnectivityErrorFactory.GetException(ret); - } - } - - /// - /// Stops presence of a server. - /// - /// 3 - /// - /// Use this API to stop sending server's announcements to clients. - /// Server can call this API when terminating, entering to offline or out of network. - /// - /// - /// http://tizen.org/privilege/internet - /// - /// public - /// http://tizen.org/feature/iot.ocf - ///
-        /// Initialize() should be called to initialize.
-        /// 
- /// - /// - /// - /// - /// 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(); - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed cancel presence"); - throw IoTConnectivityErrorFactory.GetException(ret); - } - } - - /// - /// Sets the device name. - /// - /// 3 - /// - /// This API sets the name of the local device (the device calling the API).\n - /// If the device name is set, clients can get the name using . - /// - /// The device name. - /// http://tizen.org/feature/iot.ocf - /// - /// - /// - /// 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); - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed set device name"); - throw IoTConnectivityErrorFactory.GetException(ret); - } - } - private static List _resources = new List(); - } -} diff --git a/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/LiteResource.cs b/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/LiteResource.cs deleted file mode 100755 index b7b480121..000000000 --- a/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/LiteResource.cs +++ /dev/null @@ -1,179 +0,0 @@ - /* - * 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. - */ - - -namespace Tizen.Network.IoTConnectivity -{ - /// - /// This class represents a lite resource. - /// It provides APIs to encapsulate resources. - /// This class is accessed by using a constructor to create a new instance of this object. - /// - /// 3 - public class LiteResource : Resource - { - /// - /// The LiteResource constructor. - /// - /// 3 - /// - /// Creates a lite resource, which can then be registered in server using .\n - /// When client requests some operations, it sends a response to client automatically.\n - /// @a uri length must be less than 128. - /// - /// - /// http://tizen.org/privilege/internet - /// - /// public - /// The uri path of the lite resource. - /// The type of the resource. - /// Policy of the resource. - /// Optional attributes of the resource. - /// http://tizen.org/feature/iot.ocf - ///
-        /// IoTConnectivityServerManager.Initialize() should be called to initialize.
-        /// 
- /// - /// - /// - /// - /// List 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) - { - Attributes = attribs; - } - - /// - /// Gets or sets the attributes of the lite resource. - /// - /// 3 - /// The attributes of the lite resource. - /// - /// List list = new List() { "org.tizen.light" }; - /// LiteResource res = new LiteResource("/light/1", new ResourceTypes(list), ResourcePolicy.Discoverable); - /// Attributes attributes = new Attributes() { - /// { "state", "ON" } - /// }; - /// res.Attributes = newAttributes; - /// foreach (KeyValuePair pair in res.Attributes) - /// { - /// Console.WriteLine("key : {0}, value : {1}", pair.Key, pair.Value); - /// } - /// - public Attributes Attributes { get; set; } - - /// - /// Decides whether to accept or reject a post request. - /// - /// 3 - /// - /// Child classes of this class can override this method to accept or reject post request. - /// - /// 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) - /// { - /// object newAttributes; - /// attributes.TryGetValue("LIGHT_ATTRIBUTE", out newAttributes); - /// if((int)newAttributes == 1) - /// return true; - /// return false; - /// } - /// } - /// - protected virtual bool OnPost(Attributes attribs) - { - return true; - } - - // The code block untill @endcond should not appear in doxygen spec. - /// @cond - protected sealed override Response OnGet(Request request) - { - Representation representation = new Representation() - { - UriPath = UriPath, - Interface = Interfaces, - Type = Types, - Attributes = Attributes - }; - - Response response = new Response() - { - Representation = representation, - Result = ResponseCode.Ok - }; - - return response; - } - - protected sealed override Response OnPut(Request request) - { - Response response = new Response(); - response.Result = ResponseCode.Forbidden; - return response; - } - - protected sealed override Response OnPost(Request request) - { - if (OnPost(request.Representation.Attributes)) - { - Attributes = request.Representation.Attributes; - Representation representation = new Representation() { - UriPath = UriPath, - Interface = Interfaces, - Type = Types, - Attributes = Attributes - }; - - Response response = new Response() { - Representation = representation, - Result = ResponseCode.Ok - }; - - Notify(representation, QualityOfService.High); - return response; - } - - return new Response() - { - Result = ResponseCode.Error - }; - } - - protected sealed override Response OnDelete(Request request) - { - Response response = new Response(); - response.Result = ResponseCode.Forbidden; - return response; - } - - protected sealed override bool OnObserving(Request request, ObserveType observeType, int observeId) - { - return true; - } - /// @endcond - } -} diff --git a/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/NamespaceDoc.cs b/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/NamespaceDoc.cs deleted file mode 100755 index 6c4b38f2d..000000000 --- a/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/NamespaceDoc.cs +++ /dev/null @@ -1,12 +0,0 @@ -/** - -The Tizen.Network.IoTConnectivity namespace provides classes to manage -Resource, RemoteResource, Request, Response and so on which are based on IoTivity project. - - -The Tizen.Network.IoTConnectivity namespace provides classes to manage -Resource, RemoteResource, Request, Response and so on which are based on IoTivity project. - -*/ -namespace Tizen.Network.IoTConnectivity {} - diff --git a/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/ObservePolicy.cs b/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/ObservePolicy.cs deleted file mode 100755 index b70b84152..000000000 --- a/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/ObservePolicy.cs +++ /dev/null @@ -1,37 +0,0 @@ - /* - * 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. - */ - - -namespace Tizen.Network.IoTConnectivity -{ - /// - /// Enumeration for the policy of observation. - /// - /// 3 - public enum ObservePolicy - { - /// - /// Indicates the observation request for the most up-to-date notifications only. - /// - /// 3 - IgnoreOutOfOrder = 0, - /// - /// Indicates the observation request for all notifications including state notifications. - /// - /// 3 - AcceptOutOfOrder - } -} diff --git a/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/ObserveType.cs b/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/ObserveType.cs deleted file mode 100755 index 6329befe7..000000000 --- a/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/ObserveType.cs +++ /dev/null @@ -1,45 +0,0 @@ - /* - * 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. - */ - - -namespace Tizen.Network.IoTConnectivity -{ - /// - /// Enumeration for the type of observation. - /// - /// 3 - public enum ObserveType - { - /// - /// No observe action. - /// - /// 3 - NoType = 0, - - /// - /// Indicates an action of the registering observation. - /// - /// 3 - Register = 1, - - /// - /// Indicates an action of unregistering observation. - /// - /// 3 - Deregister = 2, - } -} - diff --git a/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/ObserverNotifiedEventArgs.cs b/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/ObserverNotifiedEventArgs.cs deleted file mode 100755 index 1e7c6abd1..000000000 --- a/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/ObserverNotifiedEventArgs.cs +++ /dev/null @@ -1,44 +0,0 @@ - /* - * 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.Network.IoTConnectivity -{ - /// - /// This class represents event arguments of the ObserverNotified event. - /// - /// 3 - public class ObserverNotifiedEventArgs : EventArgs - { - internal ObserverNotifiedEventArgs() { } - - /// - /// Result of the observe response. - /// - /// 3 - /// Result of the observe response. - public ResponseCode Result { get; internal set; } - - /// - /// Representation of the resource being observed. - /// - /// 3 - /// Representation of the resource being observed. - public Representation Representation { get; internal set; } - } -} diff --git a/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/PlatformInformationFoundEventArgs.cs b/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/PlatformInformationFoundEventArgs.cs deleted file mode 100755 index d7279e9b7..000000000 --- a/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/PlatformInformationFoundEventArgs.cs +++ /dev/null @@ -1,119 +0,0 @@ - /* - * 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. - */ - - -namespace Tizen.Network.IoTConnectivity -{ - /// - /// This class represents event arguments of the PlatformInformationFound event. - /// - /// 3 - public class PlatformInformationFoundEventArgs - { - internal PlatformInformationFoundEventArgs() { } - - /// - /// Indicates the request ID. - /// - /// 3 - /// The request ID. - public int RequestId { get; internal set; } - - /// - /// Indicates to continuously receive the event for finding the platform information. - /// - /// 3 - /// Continuously receive the event for finding the platform information. - public bool EventContinue { get; set; } - - /// - /// Indicates the platform identifier. - /// - /// 3 - /// The platform identifier. - public string PlatformId { get; internal set; } - - /// - /// Indicates the name of the manufacturer. - /// - /// 3 - /// The name of the manufacturer. - public string ManufacturerName { get; internal set; } - - /// - /// Indicates the URL of the manufacturer. - /// - /// 3 - /// The URL of the manufacturer. - public string ManufacturerURL { get; internal set; } - - /// - /// Indicates the model number as designated by the manufacturer. - /// - /// 3 - /// The model number as designated by the manufacturer. - public string ModelNumber { get; internal set; } - - /// - /// Indicates the manufacturing date of the device. - /// - /// 3 - /// The manufacturing date of the device. - public string DateOfManufacture { get; internal set; } - - /// - /// Indicates the version of the platfrom defined by the manufacturer. - /// - /// 3 - /// The version of platfrom defined by manufacturer. - public string PlatformVersion { get; internal set; } - - /// - /// Indicates the version of the platfrom resident OS. - /// - /// 3 - /// The version of the platfrom resident OS. - public string OsVersion { get; internal set; } - - /// - /// Indicates the version of the platform Hardware. - /// - /// 3 - /// The version of the platform Hardware. - public string HardwareVersion { get; internal set; } - - /// - /// Indicates the version of the device firmware. - /// - /// 3 - /// The version of the device firmware. - public string FirmwareVersion { get; internal set; } - - /// - /// Indicates the URL that points to support information from the manufacturer. - /// - /// 3 - /// The URL that points to support information from the manufacturer. - public string SupportUrl { get; internal set; } - - /// - /// Indicates the reference time of the device. - /// - /// 3 - /// The reference time of the device. - public string SystemTime { get; internal set; } - } -} diff --git a/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/PresenceEventType.cs b/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/PresenceEventType.cs deleted file mode 100755 index 5c7b58fbd..000000000 --- a/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/PresenceEventType.cs +++ /dev/null @@ -1,42 +0,0 @@ - /* - * 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. - */ - - -namespace Tizen.Network.IoTConnectivity -{ - /// - /// Enumeration for operation of presence response. - /// - /// 3 - public enum PresenceEventType - { - /// - /// Indicates the resource creation operation of the server. - /// - /// 3 - ResourceCreated = 0, - /// - /// Indicates the resource updation operation of the server. - /// - /// 3 - ResourceUpdated, - /// - /// Indicates the resource destruction operation of the server. - /// - /// 3 - ResourceDestroyed - } -} diff --git a/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/PresenceReceivedEventArgs.cs b/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/PresenceReceivedEventArgs.cs deleted file mode 100755 index 4fc0238be..000000000 --- a/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/PresenceReceivedEventArgs.cs +++ /dev/null @@ -1,58 +0,0 @@ - /* - * 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.Network.IoTConnectivity -{ - /// - /// This class represents event arguments of the PresenceReceived event. - /// - /// 3 - public class PresenceReceivedEventArgs : EventArgs - { - internal PresenceReceivedEventArgs() { } - - /// - /// Indicates the request ID of the presence event. - /// - /// 3 - /// The request ID of the presence event. - public int PresenceId { get; internal set; } - - /// - /// Indicates the event type. - /// - /// 3 - /// The event type. - public PresenceEventType EventType { get; internal set; } - - /// - /// Indicates the host address of resource. - /// - /// 3 - /// The host address of resource. - public string HostAddress { get; internal set; } - - /// - /// Indicates the type of the resource. - /// - /// 3 - /// The type of the resource. - public string Type { get; internal set; } - } -} diff --git a/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/QualityOfService.cs b/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/QualityOfService.cs deleted file mode 100755 index 54eed0828..000000000 --- a/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/QualityOfService.cs +++ /dev/null @@ -1,37 +0,0 @@ - /* - * 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. - */ - - -namespace Tizen.Network.IoTConnectivity -{ - /// - /// Enumeration for states of remote resource. - /// - /// 3 - public enum QualityOfService - { - /// - /// Indicates the low quality of service. - /// - /// 3 - Low = 0, - /// - /// Indicates the high quality of service. - /// - /// 3 - High - } -} diff --git a/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/RemoteResource.cs b/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/RemoteResource.cs deleted file mode 100755 index af9059681..000000000 --- a/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/RemoteResource.cs +++ /dev/null @@ -1,893 +0,0 @@ - /* - * 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.Collections.Generic; -using System.Net; -using System.Runtime.InteropServices; -using System.Threading.Tasks; - -namespace Tizen.Network.IoTConnectivity -{ - /// - /// This class represents a remote resource. - /// It provides APIs to manage remote resource. - /// - /// 3 - public class RemoteResource : IDisposable - { - internal const int TimeOutMax = 3600; - internal IntPtr _remoteResourceHandle = IntPtr.Zero; - - private bool _disposed = false; - private bool _cacheEnabled = false; - private ResourceOptions _options; - - private int _responseCallbackId = 1; - private static Dictionary _responseCallbacksMap = new Dictionary(); - - private Interop.IoTConnectivity.Client.RemoteResource.CachedRepresentationChangedCallback _cacheUpdatedCallback; - private Interop.IoTConnectivity.Client.RemoteResource.StateChangedCallback _stateChangedCallback; - private Interop.IoTConnectivity.Client.RemoteResource.ObserveCallback _observeCallback; - - private EventHandler _stateChangedEventHandler; - - /// - /// Creates a remote resource instance. - /// - /// 3 - /// - /// To use this API, you should provide all the details required to correctly contact and - /// observe the object.\n - /// If not, you should discover the resource object manually.\n - /// The @a policy can contain multiple policies like ResourcePolicy.Discoverable | ResourcePolicy.Observable. - /// - /// The host address of the resource. - /// The URI path of the resource. - /// The policies of the resource. - /// The resource types of the resource. - /// The resource interfaces of the resource. - /// http://tizen.org/feature/iot.ocf - /// Thrown when the iotcon is not supported. - /// Thrown when there is not enough memory. - /// Thrown when there is an invalid parameter. - public RemoteResource(string hostAddress, string uriPath, ResourcePolicy policy, ResourceTypes resourceTypes, ResourceInterfaces resourceInterfaces) - { - if (hostAddress == null || uriPath == null || resourceTypes == null || resourceInterfaces == null) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Invalid parameters"); - throw new ArgumentException("Invalid parameter"); - } - - HostAddress = hostAddress; - UriPath = uriPath; - Policy = policy; - Types = new List(resourceTypes); - Interfaces = new List(resourceInterfaces); - DeviceId = null; - - CreateRemoteResource(resourceTypes._resourceTypeHandle, resourceInterfaces.ResourceInterfacesHandle); - } - - internal RemoteResource(IntPtr handleToClone) - { - int ret = Interop.IoTConnectivity.Client.RemoteResource.Clone(handleToClone, out _remoteResourceHandle); - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Faled to clone"); - throw IoTConnectivityErrorFactory.GetException(ret); - } - SetRemoteResource(); - } - - /// - /// Destructor of the RemoteResource class. - /// - ~RemoteResource() - { - Dispose(false); - } - - /// - /// The event is invoked with cached resource attributes. - /// - /// 3 - public event EventHandler CacheUpdated; - - /// - /// Observe an event on the resource sent by the server. - /// - /// 3 - public event EventHandler ObserverNotified; - - /// - /// The event is called when remote resource's state are changed. - /// - /// 3 - public event EventHandler StateChanged - { - add - { - if (_stateChangedEventHandler == null) - { - RegisterStateChangedEvent(); - } - _stateChangedEventHandler += value; - } - remove - { - _stateChangedEventHandler -= value; - if (_stateChangedEventHandler == null) - { - UnregisterStateChangedEvent(); - } - } - } - - /// - /// The host address of the resource. - /// - /// 3 - /// The host address of the resource. - public string HostAddress { get; private set; } - - /// - /// The URI path of the resource. - /// - /// 3 - /// The URI path of the resource. - public string UriPath { get; private set; } - - /// - /// The resource types of the remote resource. - /// - /// 3 - /// The resource types of the remote resource. - public IEnumerable Types { get; private set; } - - /// - /// The interfaces of the resource. - /// - /// 3 - /// The interfaces of the resource. - public IEnumerable Interfaces { get; private set; } - - /// - /// The policy of the resource. - /// - /// 3 - /// The policy of the resource. - public ResourcePolicy Policy { get; private set; } - - /// - /// The header options of the resource. - /// - /// 3 - /// The header options of the resource. - /// Thrown when the iotcon is not supported. - /// Thrown when there is an invalid parameter. - public ResourceOptions Options - { - get - { - return _options; - } - set - { - _options = value; - if (value != null) - { - int ret = Interop.IoTConnectivity.Client.RemoteResource.SetOptions(_remoteResourceHandle, value._resourceOptionsHandle); - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to set options"); - throw IoTConnectivityErrorFactory.GetException(ret); - } - } - } - } - - /// - /// Indicates the CacheEnabled status of the remote resource. - /// - /// 3 - /// - /// Client can start caching only when this is set true. Set it to false to stop caching the resource attributes. - /// - /// Thrown when the iotcon is not supported. - /// Thrown when there is an invalid parameter. - /// Thrown when the operation is invalid. - /// Thrown when an application does not have privilege to access. - /// Thrown when there is not enough memory. - public bool CacheEnabled - { - get - { - return _cacheEnabled; - } - set - { - if (_cacheEnabled != value) - { - _cacheEnabled = value; - HandleCachePolicyChanged(); - } - } - } - - /// - /// Time interval of monitoring and caching API. - /// - /// 3 - /// - /// Default time interval is 10 seconds. - /// Seconds for time interval (must be in range from 1 to 3600). - /// - /// Thrown when the iotcon is not supported. - /// Thrown when there is an invalid parameter. - public int TimeInterval - { - get - { - int interval; - int ret = Interop.IoTConnectivity.Client.RemoteResource.GetTimeInterval(_remoteResourceHandle, out interval); - if (ret != (int)IoTConnectivityError.None) - { - Log.Warn(IoTConnectivityErrorFactory.LogTag, "Failed to get time interval"); - return 0; - } - return interval; - } - set - { - int ret = (int)IoTConnectivityError.InvalidParameter; - if (value <= TimeOutMax && value > 0) - { - ret = Interop.IoTConnectivity.Client.RemoteResource.SetTimeInterval(_remoteResourceHandle, value); - } - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to set time interval"); - throw IoTConnectivityErrorFactory.GetException(ret); - } - } - } - - /// - /// The device ID of the resource. - /// - /// 3 - /// The device ID of the resource. - public string DeviceId { get; private set; } - - /// - /// Gets cached representation from the remote resource. - /// - /// 3 - /// cached representation from the remote resource. - /// http://tizen.org/feature/iot.ocf - public Representation CachedRepresentation() - { - IntPtr handle; - int ret = Interop.IoTConnectivity.Client.RemoteResource.GetCachedRepresentation(_remoteResourceHandle, out handle); - if (ret != (int)IoTConnectivityError.None) - { - Log.Warn(IoTConnectivityErrorFactory.LogTag, "Failed to get CachedRepresentation"); - return null; - } - - Representation representation = new Representation(handle); - return representation; - } - - /// - /// Starts observing on the resource. - /// - /// 3 - /// - /// When server sends notification message, will be called. - /// - /// - /// http://tizen.org/privilege/internet - /// - /// public - /// The type to specify how client wants to observe. - /// The query to send to server. - /// http://tizen.org/feature/iot.ocf - /// Thrown when the iotcon is not supported. - /// Thrown when the operation is invalid. - /// Thrown when an application does not have privilege to access. - /// Thrown when there is not enough memory. - public void StartObserving(ObservePolicy policy, ResourceQuery query = null) - { - _observeCallback = (IntPtr resource, int err, int sequenceNumber, IntPtr response, IntPtr userData) => - { - int result; - IntPtr representationHandle; - int ret = Interop.IoTConnectivity.Server.Response.GetResult(response, out result); - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to get result"); - return; - } - - ret = Interop.IoTConnectivity.Server.Response.GetRepresentation(response, out representationHandle); - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to get representation"); - return; - } - - Representation repr = null; - try - { - repr = new Representation(representationHandle); - } - catch (Exception exp) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to new representation: " + exp.Message); - return; - } - - ObserverNotifiedEventArgs e = new ObserverNotifiedEventArgs() - { - Representation = repr, - Result = (ResponseCode)result - }; - ObserverNotified?.Invoke(this, e); - }; - - IntPtr queryHandle = IntPtr.Zero; - if (query != null) - { - queryHandle = query._resourceQueryHandle; - } - - int errCode = Interop.IoTConnectivity.Client.RemoteResource.RegisterObserve(_remoteResourceHandle, (int)policy, queryHandle, _observeCallback, IntPtr.Zero); - if (errCode != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to register observe callbacks"); - throw IoTConnectivityErrorFactory.GetException(errCode); - } - } - - /// - /// Stops observing on the resource. - /// - /// 3 - /// - /// http://tizen.org/privilege/internet - /// - /// public - /// http://tizen.org/feature/iot.ocf - /// Thrown when the iotcon is not supported. - /// Thrown when the operation is invalid. - /// Thrown when an application does not have privilege to access. - public void StopObserving() - { - int ret = Interop.IoTConnectivity.Client.RemoteResource.DeregisterObserve(_remoteResourceHandle); - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to deregister observe callbacks"); - throw IoTConnectivityErrorFactory.GetException(ret); - } - } - - /// - /// Gets the attributes of a resource asynchronously. - /// - /// 3 - /// - /// http://tizen.org/privilege/internet - /// - /// public - /// The ResourceQuery to send to server. - /// Remote response with result and representation. - /// http://tizen.org/feature/iot.ocf - public async Task GetAsync(ResourceQuery query = null) - { - TaskCompletionSource tcsRemoteResponse = new TaskCompletionSource(); - - IntPtr id = IntPtr.Zero; - lock (_responseCallbacksMap) - { - id = (IntPtr)_responseCallbackId++; - } - _responseCallbacksMap[id] = (IntPtr resource, int err, int requestType, IntPtr responseHandle, IntPtr userData) => - { - IntPtr responseCallbackId = userData; - lock(_responseCallbacksMap) - { - _responseCallbacksMap.Remove(responseCallbackId); - } - - if (responseHandle != IntPtr.Zero) - { - try - { - tcsRemoteResponse.TrySetResult(GetRemoteResponse(responseHandle)); - } - catch(Exception exp) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to get RemoteResponse: ", exp.Message); - tcsRemoteResponse.TrySetException(exp); - } - } - else - { - tcsRemoteResponse.TrySetException(IoTConnectivityErrorFactory.GetException((int)IoTConnectivityError.System)); - } - }; - - IntPtr queryHandle = (query == null) ? IntPtr.Zero : query._resourceQueryHandle; - int errCode = Interop.IoTConnectivity.Client.RemoteResource.Get(_remoteResourceHandle, queryHandle, _responseCallbacksMap[id], id); - if (errCode != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to get resource attributes"); - tcsRemoteResponse.TrySetException(IoTConnectivityErrorFactory.GetException(errCode)); - } - return await tcsRemoteResponse.Task; - } - - /// - /// Puts the representation of a resource asynchronously. - /// - /// 3 - /// - /// http://tizen.org/privilege/internet - /// - /// public - /// Resource representation to put. - /// The ResourceQuery to send to server. - /// Remote response with result and representation. - /// http://tizen.org/feature/iot.ocf - public async Task PutAsync(Representation representation, ResourceQuery query = null) - { - TaskCompletionSource tcsRemoteResponse = new TaskCompletionSource(); - - IntPtr id = IntPtr.Zero; - lock (_responseCallbacksMap) - { - id = (IntPtr)_responseCallbackId++; - } - _responseCallbacksMap[id] = (IntPtr resource, int err, int requestType, IntPtr responseHandle, IntPtr userData) => - { - IntPtr responseCallbackId = userData; - lock (_responseCallbacksMap) - { - _responseCallbacksMap.Remove(responseCallbackId); - } - if (err == (int)(IoTConnectivityError.Iotivity)) - { - RemoteResponse response = new RemoteResponse(); - response.Result = ResponseCode.Forbidden; - response.Representation = null; - tcsRemoteResponse.TrySetResult(response); - } - else if (responseHandle != IntPtr.Zero) - { - try - { - tcsRemoteResponse.TrySetResult(GetRemoteResponse(responseHandle)); - } - catch (Exception exp) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to get RemoteResponse: ", exp.Message); - tcsRemoteResponse.TrySetException(exp); - } - } - else - { - tcsRemoteResponse.TrySetException(IoTConnectivityErrorFactory.GetException((int)IoTConnectivityError.System)); - } - }; - IntPtr queryHandle = (query == null) ? IntPtr.Zero : query._resourceQueryHandle; - int errCode = Interop.IoTConnectivity.Client.RemoteResource.Put(_remoteResourceHandle, representation._representationHandle, queryHandle, _responseCallbacksMap[id], id); - if (errCode != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to put resource representation"); - tcsRemoteResponse.TrySetException(IoTConnectivityErrorFactory.GetException(errCode)); - } - return await tcsRemoteResponse.Task; - } - - /// - /// Posts request on a resource asynchronously. - /// - /// 3 - /// - /// http://tizen.org/privilege/internet - /// - /// public - /// Resource representation of request. - /// The ResourceQuery to send to server. - /// Remote response with result and representation. - /// http://tizen.org/feature/iot.ocf - public async Task PostAsync(Representation representation, ResourceQuery query = null) - { - TaskCompletionSource tcsRemoteResponse = new TaskCompletionSource(); - - IntPtr id = IntPtr.Zero; - lock (_responseCallbacksMap) - { - id = (IntPtr)_responseCallbackId++; - } - _responseCallbacksMap[id] = (IntPtr resource, int err, int requestType, IntPtr responseHandle, IntPtr userData) => - { - IntPtr responseCallbackId = userData; - lock (_responseCallbacksMap) - { - _responseCallbacksMap.Remove(responseCallbackId); - } - if (responseHandle != IntPtr.Zero) - { - try - { - tcsRemoteResponse.TrySetResult(GetRemoteResponse(responseHandle)); - } - catch (Exception exp) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to get RemoteResponse: ", exp.Message); - tcsRemoteResponse.TrySetException(exp); - } - } - else - { - tcsRemoteResponse.TrySetException(IoTConnectivityErrorFactory.GetException((int)IoTConnectivityError.System)); - } - }; - IntPtr queryHandle = (query == null) ? IntPtr.Zero : query._resourceQueryHandle; - int errCode = Interop.IoTConnectivity.Client.RemoteResource.Post(_remoteResourceHandle, representation._representationHandle, queryHandle, _responseCallbacksMap[id], id); - if (errCode != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to post request"); - tcsRemoteResponse.TrySetException(IoTConnectivityErrorFactory.GetException(errCode)); - } - return await tcsRemoteResponse.Task; - } - - /// - /// Deletes the resource asynchronously. - /// - /// 3 - /// - /// http://tizen.org/privilege/internet - /// - /// public - /// Remote response with result and representation. - /// http://tizen.org/feature/iot.ocf - public async Task DeleteAsync() - { - TaskCompletionSource tcsRemoteResponse = new TaskCompletionSource(); - - IntPtr id = IntPtr.Zero; - lock (_responseCallbacksMap) - { - id = (IntPtr)_responseCallbackId++; - } - _responseCallbacksMap[id] = (IntPtr resource, int err, int requestType, IntPtr responseHandle, IntPtr userData) => - { - IntPtr responseCallbackId = userData; - lock (_responseCallbacksMap) - { - _responseCallbacksMap.Remove(responseCallbackId); - } - if (err == (int)(IoTConnectivityError.Iotivity)) - { - RemoteResponse response = new RemoteResponse(); - response.Result = ResponseCode.Forbidden; - response.Representation = null; - tcsRemoteResponse.TrySetResult(response); - } - else if (responseHandle != IntPtr.Zero) - { - try - { - tcsRemoteResponse.TrySetResult(GetRemoteResponse(responseHandle)); - } - catch (Exception exp) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to get RemoteResponse: ", exp.Message); - tcsRemoteResponse.TrySetException(exp); - } - } - else - { - tcsRemoteResponse.TrySetException(IoTConnectivityErrorFactory.GetException((int)IoTConnectivityError.System)); - } - }; - - int errCode = Interop.IoTConnectivity.Client.RemoteResource.Delete(_remoteResourceHandle, _responseCallbacksMap[id], id); - if (errCode != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to delete"); - tcsRemoteResponse.TrySetException(IoTConnectivityErrorFactory.GetException(errCode)); - } - return await tcsRemoteResponse.Task; - } - - /// - /// Releases any unmanaged resources used by this object. - /// - /// 3 - /// http://tizen.org/feature/iot.ocf - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - - internal static Interop.IoTConnectivity.Client.RemoteResource.ConnectivityType GetConnectivityType(string hostAddress) - { - Interop.IoTConnectivity.Client.RemoteResource.ConnectivityType type = Interop.IoTConnectivity.Client.RemoteResource.ConnectivityType.None; - - Log.Info(IoTConnectivityErrorFactory.LogTag, hostAddress); - - if (hostAddress == IoTConnectivityClientManager.MulticastAddress) - { - type = Interop.IoTConnectivity.Client.RemoteResource.ConnectivityType.Ipv4; - } - else - { - IPAddress address; - string hostName = hostAddress; - if (hostAddress.Contains(":")) - { - string[] hostParts = hostAddress.Split(':'); - if (hostParts.Length == 2) - { - hostName = hostParts[0]; - } - } - if (hostAddress.Contains("%")) - { - string[] hostParts = hostAddress.Split('%'); - if (hostParts.Length == 2) - { - hostName = hostParts[0]; - } - } - if (hostName.Contains("[")) - { - string[] hostParts = hostName.Split('['); - if (hostParts.Length == 2) - { - hostName = hostParts[1]; - } - } - Log.Info(IoTConnectivityErrorFactory.LogTag, hostName); - if (IPAddress.TryParse(hostName, out address)) - { - switch (address.AddressFamily) - { - case System.Net.Sockets.AddressFamily.InterNetwork: - type = Interop.IoTConnectivity.Client.RemoteResource.ConnectivityType.Ipv4; - break; - case System.Net.Sockets.AddressFamily.InterNetworkV6: - type = Interop.IoTConnectivity.Client.RemoteResource.ConnectivityType.Ipv6; - break; - default: - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to parse for Ipv4 or Ipv6"); - break; - } - } - else - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to parse hostname " + hostName); - } - } - return type; - } - - /// - /// Releases any unmanaged resources used by this object. Can also dispose any other disposable objects. - /// - /// 3 - /// If true, disposes any disposable objects. If false, does not dispose disposable objects. - /// http://tizen.org/feature/iot.ocf - protected virtual void Dispose(bool disposing) - { - if (_disposed) - return; - - if (disposing) - { - // Free managed objects - } - - Interop.IoTConnectivity.Client.RemoteResource.Destroy(_remoteResourceHandle); - _disposed = true; - } - - private void HandleCachePolicyChanged() - { - if (_cacheEnabled) - { - _cacheUpdatedCallback = (IntPtr resource, IntPtr representation, IntPtr userData) => - { - if (CacheEnabled) - { - Representation repr = null; - try - { - repr = new Representation(representation); - } - catch (Exception exp) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to new Representation: " + exp.Message); - return; - } - - CacheUpdatedEventArgs e = new CacheUpdatedEventArgs() - { - Representation = repr - }; - CacheUpdated?.Invoke(this, e); - } - }; - - int ret = Interop.IoTConnectivity.Client.RemoteResource.StartCaching(_remoteResourceHandle, _cacheUpdatedCallback, IntPtr.Zero); - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to add cache updated event handler"); - throw IoTConnectivityErrorFactory.GetException(ret); - } - } - else - { - int ret = Interop.IoTConnectivity.Client.RemoteResource.StopCaching(_remoteResourceHandle); - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to remove cache updated event handler"); - throw IoTConnectivityErrorFactory.GetException(ret); - } - } - } - - private void RegisterStateChangedEvent() - { - _stateChangedCallback = (IntPtr resource, int state, IntPtr userData) => - { - StateChangedEventArgs e = new StateChangedEventArgs() - { - State = (ResourceState)state - }; - _stateChangedEventHandler?.Invoke(null, e); - }; - - int ret = Interop.IoTConnectivity.Client.RemoteResource.StartMonitoring(_remoteResourceHandle, _stateChangedCallback, IntPtr.Zero); - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to add state changed event handler"); - throw IoTConnectivityErrorFactory.GetException(ret); - } - } - - private void UnregisterStateChangedEvent() - { - int ret = Interop.IoTConnectivity.Client.RemoteResource.StopMonitoring(_remoteResourceHandle); - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to remove state changed event handler"); - throw IoTConnectivityErrorFactory.GetException(ret); - } - } - - private void CreateRemoteResource(IntPtr resourceTypeHandle, IntPtr resourceInterfaceHandle) - { - Interop.IoTConnectivity.Client.RemoteResource.ConnectivityType connectivityType = GetConnectivityType(HostAddress); - if (connectivityType == Interop.IoTConnectivity.Client.RemoteResource.ConnectivityType.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Unable to parse host address"); - throw new ArgumentException("Unable to parse host address"); - } - int ret = Interop.IoTConnectivity.Client.RemoteResource.Create(HostAddress, (int)connectivityType, UriPath, (int)Policy, resourceTypeHandle, resourceInterfaceHandle, out _remoteResourceHandle); - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to get remote resource"); - throw IoTConnectivityErrorFactory.GetException(ret); - } - } - - private void SetRemoteResource() - { - IntPtr hostAddressPtr, uriPathPtr; - int ret = Interop.IoTConnectivity.Client.RemoteResource.GetHostAddress(_remoteResourceHandle, out hostAddressPtr); - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Faled to get host address"); - throw IoTConnectivityErrorFactory.GetException(ret); - } - - ret = Interop.IoTConnectivity.Client.RemoteResource.GetUriPath(_remoteResourceHandle, out uriPathPtr); - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Faled to get uri path"); - throw IoTConnectivityErrorFactory.GetException(ret); - } - - int policy = (int)ResourcePolicy.NoProperty; - ret = Interop.IoTConnectivity.Client.RemoteResource.GetPolicies(_remoteResourceHandle, out policy); - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Faled to get uri path"); - throw IoTConnectivityErrorFactory.GetException(ret); - } - - IntPtr typesHandle, interfacesHandle; - ret = Interop.IoTConnectivity.Client.RemoteResource.GetTypes(_remoteResourceHandle, out typesHandle); - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to get resource types"); - throw IoTConnectivityErrorFactory.GetException(ret); - } - - ret = Interop.IoTConnectivity.Client.RemoteResource.GetInterfaces(_remoteResourceHandle, out interfacesHandle); - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to get resource interfaces"); - throw IoTConnectivityErrorFactory.GetException(ret); - } - - IntPtr deviceIdPtr; - ret = Interop.IoTConnectivity.Client.RemoteResource.GetDeviceId(_remoteResourceHandle, out deviceIdPtr); - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to get device id"); - throw IoTConnectivityErrorFactory.GetException(ret); - } - DeviceId = (deviceIdPtr != IntPtr.Zero) ? Marshal.PtrToStringAnsi(deviceIdPtr) : string.Empty; - HostAddress = (hostAddressPtr != IntPtr.Zero) ? Marshal.PtrToStringAnsi(hostAddressPtr) : string.Empty; - UriPath = (uriPathPtr != IntPtr.Zero) ? Marshal.PtrToStringAnsi(uriPathPtr) : string.Empty; - Types = new ResourceTypes(typesHandle); - Interfaces = new ResourceInterfaces(interfacesHandle); - Policy = (ResourcePolicy)policy; - } - - private RemoteResponse GetRemoteResponse(IntPtr response) - { - int result; - IntPtr representationHandle, optionsHandle; - int ret = Interop.IoTConnectivity.Server.Response.GetResult(response, out result); - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to get result"); - throw IoTConnectivityErrorFactory.GetException(ret); - } - - ret = Interop.IoTConnectivity.Server.Response.GetRepresentation(response, out representationHandle); - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to get representation"); - throw IoTConnectivityErrorFactory.GetException(ret); - } - - ret = Interop.IoTConnectivity.Server.Response.GetOptions(response, out optionsHandle); - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to get options"); - throw IoTConnectivityErrorFactory.GetException(ret); - } - return new RemoteResponse() - { - Result = (ResponseCode)result, - Representation = new Representation(representationHandle), - Options = (optionsHandle == IntPtr.Zero)? null : new ResourceOptions(optionsHandle) - }; - } - } -} diff --git a/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/RemoteResponse.cs b/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/RemoteResponse.cs deleted file mode 100755 index cff7d4493..000000000 --- a/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/RemoteResponse.cs +++ /dev/null @@ -1,50 +0,0 @@ - /* - * 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. - */ - - -namespace Tizen.Network.IoTConnectivity -{ - /// - /// This class represents a remote response. - /// It represents the response of all CRUD operations. - /// - /// 3 - public class RemoteResponse - { - internal RemoteResponse() { } - - /// - /// Indicates the result of the response. - /// - /// 3 - /// The result of the response. - public ResponseCode Result { get; internal set; } - - /// - /// Indicates representation of the response. - /// - /// 3 - /// Representation of the response. - public Representation Representation { get; internal set; } - - /// - /// Indicates header options of the response. - /// - /// 3 - /// Header options of the response. - public ResourceOptions Options { get; internal set; } - } -} diff --git a/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/Representation.cs b/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/Representation.cs deleted file mode 100755 index 8281a5515..000000000 --- a/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/Representation.cs +++ /dev/null @@ -1,362 +0,0 @@ - /* - * 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.Collections.Generic; -using System.Collections.ObjectModel; -using System.Runtime.InteropServices; - -namespace Tizen.Network.IoTConnectivity -{ - /// - /// This class provides APIs to manage representation. - /// A representation is a payload of a request or a response. - /// - /// 3 - public class Representation : IDisposable - { - internal IntPtr _representationHandle = IntPtr.Zero; - - private bool _disposed = false; - private ObservableCollection _children = new ObservableCollection(); - - /// - /// The Representation constructor. - /// - /// 3 - /// http://tizen.org/feature/iot.ocf - /// 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); - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to create representation"); - throw IoTConnectivityErrorFactory.GetException(ret); - } - - _children.CollectionChanged += ChildrenCollectionChanged; - } - - // Constructor for cloning native representation object - internal Representation(IntPtr handleToClone) - { - int ret = (int)IoTConnectivityError.InvalidParameter; - if (handleToClone != IntPtr.Zero) - { - ret = Interop.IoTConnectivity.Common.Representation.Clone(handleToClone, out _representationHandle); - } - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to create representation"); - throw IoTConnectivityErrorFactory.GetException(ret); - } - - _children.CollectionChanged += ChildrenCollectionChanged; - } - - /// - /// Destructor of the Representation class. - /// - ~Representation() - { - Dispose(false); - } - - /// - /// The URI path of resource. - /// - /// 3 - /// - /// The URI path of resource. - /// Setter can throw exceptions. - /// - /// 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 - { - IntPtr path; - int ret = Interop.IoTConnectivity.Common.Representation.GetUriPath(_representationHandle, out path); - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to Get uri"); - throw IoTConnectivityErrorFactory.GetException(ret); - } - return (path != IntPtr.Zero) ? Marshal.PtrToStringAnsi(path) : string.Empty; - } - set - { - int ret = (int)IoTConnectivityError.InvalidParameter; - if (value != null) - ret = Interop.IoTConnectivity.Common.Representation.SetUriPath(_representationHandle, value); - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to set uri"); - throw IoTConnectivityErrorFactory.GetException(ret); - } - } - } - - /// - /// The type of resource. - /// - /// 3 - /// The type of resource. - /// - /// Thrown when the iotcon is not supported. - /// Thrown when there is an invalid parameter. - /// Thrown when the operation is invalid. - /// - /// Representation repr = new Representation(); - /// ResourceTypes types = new ResourceTypes (new List(){ "org.tizen.light" }); - /// repr.Type = types; - /// var type = repr.Type; // Getter - /// foreach (string item in type) - /// { - /// Console.WriteLine("Type is {0}", item); - /// } - /// - public ResourceTypes Type - { - get - { - IntPtr typeHandle; - int ret = Interop.IoTConnectivity.Common.Representation.GetResourceTypes(_representationHandle, out typeHandle); - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to get type"); - return null; - } - return (typeHandle == IntPtr.Zero) ? null : new ResourceTypes(typeHandle); - } - set - { - int ret = (int)IoTConnectivityError.InvalidParameter; - if (value != null) - ret = Interop.IoTConnectivity.Common.Representation.SetResourceTypes(_representationHandle, value._resourceTypeHandle); - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to set type"); - throw IoTConnectivityErrorFactory.GetException(ret); - } - } - } - - /// - /// The interface of the resource. - /// - /// 3 - /// The interface of the resource. - /// - /// Thrown when the iotcon is not supported. - /// Thrown when there is an invalid parameter. - /// Thrown when the operation is invalid. - /// - /// Representation repr = new Representation(); - /// ResourceInterfaces ifaces = new ResourceInterfaces (new List(){ ResourceInterfaces.DefaultInterface }); - /// repr.Interface = ifaces; - /// var iface = repr.Interface; // Getter - /// foreach (string item in iface) - /// { - /// Console.WriteLine("Interface is {0}", iface); - /// } - /// - public ResourceInterfaces Interface - { - get - { - IntPtr interfaceHandle; - int ret = Interop.IoTConnectivity.Common.Representation.GetResourceInterfaces(_representationHandle, out interfaceHandle); - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to get interface"); - return null; - } - return (interfaceHandle == IntPtr.Zero) ? null : new ResourceInterfaces(interfaceHandle); - } - set - { - int ret = (int)IoTConnectivityError.InvalidParameter; - if (value != null) - ret = Interop.IoTConnectivity.Common.Representation.SetResourceInterfaces(_representationHandle, value.ResourceInterfacesHandle); - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to set interface"); - throw IoTConnectivityErrorFactory.GetException(ret); - } - } - } - - /// - /// Current attributes of the resource. - /// - /// 3 - /// Current attributes of the resource. - /// - /// 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" }, - /// { "dim", 10 } - /// }; - /// repr.Attributes = attributes; - /// var newAttributes = repr.Attributes; // Getter - /// string strval = newAttributes["state"] as string; - /// int intval = (int)newAttributes["dim"]; - /// Console.WriteLine("attributes are {0} and {1}", strval, intval); - /// - public Attributes Attributes - { - get - { - IntPtr attributeHandle; - int ret = Interop.IoTConnectivity.Common.Representation.GetAttributes(_representationHandle, out attributeHandle); - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to get attributes"); - throw IoTConnectivityErrorFactory.GetException(ret); - } - return (attributeHandle == IntPtr.Zero) ? null : new Attributes(attributeHandle); - } - set - { - int ret = (int)IoTConnectivityError.InvalidParameter; - if (value != null) - { - ret = Interop.IoTConnectivity.Common.Representation.SetAttributes(_representationHandle, value._resourceAttributesHandle); - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to set attributes"); - throw IoTConnectivityErrorFactory.GetException(ret); - } - } - } - } - - /// - /// List of Child resource representation. - /// - /// 3 - /// List of Child resource representation. - /// - /// Representation repr = new Representation(); - /// Representation child1 = new Representation(); - /// ResourceTypes types1 = new ResourceTypes(new List() { "org.tizen.light" }); - /// child1.Type = types1; - /// ResourceInterfaces ifaces1 = new ResourceInterfaces(new List() { ResourceInterfaces.DefaultInterface }); - /// child1.Interface = ifaces1; - /// try - /// { - /// repr.Children.Add(child1); - /// Console.WriteLine("Number of children : {0}", repr.Children.Count); - /// Representation firstChild = repr.Children.ElementAt(0); - /// } catch(Exception ex) - /// { - /// Console.WriteLine("Exception caught : " + ex.Message); - /// } - /// - public ICollection Children - { - get - { - return _children; - } - } - - /// - /// Releases any unmanaged resources used by this object. - /// - /// 3 - /// http://tizen.org/feature/iot.ocf - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - - /// - /// Releases any unmanaged resources used by this object. Can also dispose any other disposable objects. - /// - /// 3 - /// If true, disposes any disposable objects. If false, does not dispose disposable objects. - /// http://tizen.org/feature/iot.ocf - protected virtual void Dispose(bool disposing) - { - if (_disposed) - return; - - if (disposing) - { - // Free managed objects - Type?.Dispose(); - Interface?.Dispose(); - Attributes?.Dispose(); - foreach(var child in Children) - { - child.Dispose(); - } - } - - Interop.IoTConnectivity.Common.Representation.Destroy(_representationHandle); - _disposed = true; - } - - private void ChildrenCollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e) - { - if (e.Action == System.Collections.Specialized.NotifyCollectionChangedAction.Add) - { - foreach (Representation r in e.NewItems) - { - int ret = Interop.IoTConnectivity.Common.Representation.AddChild(_representationHandle, r._representationHandle); - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to add child"); - throw IoTConnectivityErrorFactory.GetException(ret); - } - } - } - else if (e.Action == System.Collections.Specialized.NotifyCollectionChangedAction.Remove) - { - foreach (Representation r in e.NewItems) - { - int ret = Interop.IoTConnectivity.Common.Representation.RemoveChild(_representationHandle, r._representationHandle); - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to remove child"); - throw IoTConnectivityErrorFactory.GetException(ret); - } - } - } - } - } -} diff --git a/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/Request.cs b/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/Request.cs deleted file mode 100755 index bbaeae5ed..000000000 --- a/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/Request.cs +++ /dev/null @@ -1,103 +0,0 @@ - /* - * 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.Network.IoTConnectivity -{ - /// - /// Class respresenting request to a resource. - /// It provides APIs to manage client's request. - /// - /// 3 - public class Request : IDisposable - { - private bool _disposed = false; - - internal Request() - { - } - - /// - /// Destructor of the Request class. - /// - ~Request() - { - Dispose(false); - } - - /// - /// The host address of the request. - /// - /// 3 - /// The host address of the request. - public string HostAddress { get; internal set; } - - /// - /// The representation of the request. - /// - /// 3 - /// The representation of the request. - public Representation Representation { get; internal set; } - - /// - /// The query of the request. - /// - /// 3 - /// The query of the request. - public ResourceQuery Query { get; internal set; } - - /// - /// The options related to the request. - /// - /// 3 - /// The options related to the request. - public ResourceOptions Options { get; internal set; } - - /// - /// Releases any unmanaged resources used by this object. - /// - /// 3 - /// http://tizen.org/feature/iot.ocf - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - - /// - /// Releases any unmanaged resources used by this object. Can also dispose any other disposable objects. - /// - /// 3 - /// If true, disposes any disposable objects. If false, does not dispose disposable objects. - /// http://tizen.org/feature/iot.ocf - protected virtual void Dispose(bool disposing) - { - if (_disposed) - return; - - if (disposing) - { - Representation?.Dispose(); - Query?.Dispose(); - Options?.Dispose(); - } - - _disposed = true; - } - } -} diff --git a/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/Resource.cs b/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/Resource.cs deleted file mode 100755 index deb277cb2..000000000 --- a/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/Resource.cs +++ /dev/null @@ -1,510 +0,0 @@ - /* - * 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.Collections.Generic; -using System.Collections.ObjectModel; -using System.Runtime.InteropServices; - -namespace Tizen.Network.IoTConnectivity -{ - /// - /// Abstract class respresenting a resource. - /// All resources need to inherit from this class. - /// - /// 3 - public abstract class Resource : IDisposable - { - private IntPtr _resourceHandle = IntPtr.Zero; - private bool _disposed = false; - private ObservableCollection _children = new ObservableCollection(); - private IntPtr _observerHandle = IntPtr.Zero; - - /// - /// The constructor. - /// - /// 3 - /// - /// @a uri format would be relative URI path like '/a/light' - /// and its length must be less than 128. - /// - /// - /// http://tizen.org/privilege/internet - /// - /// public - /// The URI path of the resource. - /// Resource types. - /// Resource interfaces. - /// The policies of the resoruce. - /// http://tizen.org/feature/iot.ocf - ///
-        /// IoTConnectivityServerManager.Initialize() should be called to initialize.
-        /// 
- /// - /// - /// - /// Thrown when the iotcon is not supported. - /// Thrown when there is not enough memory. - /// - /// // Create a class which inherits from Resource - /// public class DoorResource : Resource - /// { - /// public DoorResource(string uri, ResourceTypes types, ResourceInterfaces interfaces, ResourcePolicy policy) - /// : base(uri, types, interfaces, policy) { - /// } - /// protected override Response OnDelete(Request request) { - /// // Do something - /// } - /// protected override Response OnGet(Request request) { - /// // Do something - /// } - /// // Override other abstract methods of Resource class - /// } - /// - /// // Use it like below - /// ResourceInterfaces ifaces = new ResourceInterfaces(new List(){ 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; - Types = types; - Interfaces = interfaces; - Policy = policy; - - _children.CollectionChanged += ChildrenCollectionChanged; - - int ret = Interop.IoTConnectivity.Server.Observers.Create(out _observerHandle); - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to create obsever handle"); - throw IoTConnectivityErrorFactory.GetException(ret); - } - } - - /// - /// Destructor of the Resource class. - /// - ~Resource() - { - Dispose(false); - } - - /// - /// Type details of the resource. - /// - /// 3 - /// Type details of the resource. - public ResourceTypes Types { get; internal set; } - - /// - /// Interface details of the resource. - /// - /// 3 - /// Interface details of the resource. - public ResourceInterfaces Interfaces { get; internal set; } - - /// - /// The policies of the resource. - /// - /// 3 - /// The policies of the resource. - public ResourcePolicy Policy { get; internal set; } - - /// - /// URI path of the resource. - /// - /// 3 - /// URI path of the resource. - public string UriPath { get; internal set; } - - /// - /// List of Child resources. - /// - /// 3 - /// List of Child resources. - public ICollection Children - { - get - { - return _children; - } - } - - internal IntPtr ResourceHandle - { - get - { - return _resourceHandle; - } - set - { - _resourceHandle = value; - } - } - - /// - /// Notify the specified representation and qos. - /// - /// 3 - /// - /// http://tizen.org/privilege/internet - /// - /// public - /// Representation. - /// The quality of service for message transfer. - /// http://tizen.org/feature/iot.ocf - ///
-        /// IoTConnectivityServerManager.Initialize() should be called to initialize.
-        /// 
- /// - /// - /// Thrown when the iotcon is not supported. - /// Thrown when an application does not have privilege to access. - /// Thrown when the operation is invalid. - /// - /// ResourceInterfaces ifaces = new ResourceInterfaces(new List(){ 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); - /// IoTConnectivityServerManager.RegisterResource(resource); - /// - /// Representation repr = new Representation(); - /// repr.UriPath = "/door/uri/new/notify"; - /// repr.Type = new ResourceTypes(new List(){ "oic.iot.door.new.notify" }); - /// repr.Attributes = new Attributes() { - /// _attribute, 1 } - /// }; - /// resource.Notify(repr, QualityOfService.High); - /// - public void Notify(Representation representation, QualityOfService qos) - { - int ret = (int)IoTConnectivityError.None; - ret = Interop.IoTConnectivity.Server.Resource.Notify(_resourceHandle, representation._representationHandle, _observerHandle, (int)qos); - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to send notification"); - throw IoTConnectivityErrorFactory.GetException(ret); - } - } - - /// - /// This is called when the client performs get operation on this resource. - /// - /// 3 - /// A request from client. - /// A response having the representation and the result. - protected abstract Response OnGet(Request request); - - /// - /// This is called when the client performs put operation on this resource. - /// - /// 3 - /// A request from client. - /// A response. - protected abstract Response OnPut(Request request); - - /// - /// This is called when the client performs post operation on this resource. - /// - /// 3 - /// A request from client. - /// A response having the representation and the result. - protected abstract Response OnPost(Request request); - - /// - /// This is called when the client performs delete operation on this resource. - /// - /// 3 - /// A request from client. - /// A response. - protected abstract Response OnDelete(Request request); - - /// - /// Called on the observing event. - /// - /// 3 - /// A request from client. - /// Observer type. - /// Observe identifier. - /// Returns true if it wants to be observed, else false. - protected abstract bool OnObserving(Request request, ObserveType type, int observeId); - - /// - /// Releases any unmanaged resources used by this object. - /// - /// 3 - /// http://tizen.org/feature/iot.ocf - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - - /// - /// Releases any unmanaged resources used by this object. Can also dispose any other disposable objects. - /// - /// 3 - /// If true, disposes any disposable objects. If false, does not dispose disposable objects. - /// http://tizen.org/feature/iot.ocf - protected virtual void Dispose(bool disposing) - { - if (_disposed) - return; - - if (disposing) - { - Types?.Dispose(); - Interfaces?.Dispose(); - } - - if (_resourceHandle != IntPtr.Zero) - Interop.IoTConnectivity.Server.Resource.Destroy(_resourceHandle); - if (_observerHandle != IntPtr.Zero) - Interop.IoTConnectivity.Server.Observers.Destroy(_observerHandle); - _disposed = true; - } - - // This method is used as callback for Resource - internal void OnRequest(IntPtr resourceHandle, IntPtr requestHandle, IntPtr userData) - { - Request request = GetRequest(requestHandle); - Response response = null; - - if (request == null) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to get Request"); - return; - } - - try - { - int observeType; - int ret = Interop.IoTConnectivity.Server.Request.GetObserveType(requestHandle, out observeType); - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to Get observe type"); - return; - } - if ((ObserveType)observeType != ObserveType.NoType) - { - int observeId; - ret = Interop.IoTConnectivity.Server.Request.GetObserveId(requestHandle, out observeId); - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to Get observe id"); - return; - } - switch ((ObserveType)observeType) - { - case ObserveType.Register: - { - if (OnObserving(request, ObserveType.Register, observeId)) - { - ret = Interop.IoTConnectivity.Server.Observers.Add(_observerHandle, observeId); - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to add observer id"); - return; - } - break; - } - else - { - // If OnObserving for ObserveType.Register returns false, do not operate for Get operation after Observe operation. - return; - } - } - case ObserveType.Deregister: - { - if (OnObserving(request, ObserveType.Deregister, observeId)) - { - ret = Interop.IoTConnectivity.Server.Observers.Remove(_observerHandle, observeId); - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to remove observer id"); - return; - } - break; - } - else - { - // If OnObserving for ObserveType.Deregister returns false, do not operate for Get operation after Observe operation. - return; - } - } - } - } - int requestType; - ret = Interop.IoTConnectivity.Server.Request.GetRequestType(requestHandle, out requestType); - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to Get request type"); - return; - } - switch ((Interop.IoTConnectivity.Server.RequestType)requestType) - { - case Interop.IoTConnectivity.Server.RequestType.Put: - { - response = OnPut(request); - break; - } - case Interop.IoTConnectivity.Server.RequestType.Get: - { - response = OnGet(request); - break; - } - case Interop.IoTConnectivity.Server.RequestType.Post: - { - response = OnPost(request); - break; - } - case Interop.IoTConnectivity.Server.RequestType.Delete: - { - response = OnDelete(request); - break; - } - default: - break; - } - if (response == null) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to send Response"); - return; - } - - if (!response.Send(requestHandle)) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to send Response"); - return; - } - } - finally - { - request?.Dispose(); - response?.Dispose(); - } - } - - private Request GetRequest(IntPtr requestHandle) - { - IntPtr hostAddressPtr; - int ret = Interop.IoTConnectivity.Server.Request.GetHostAddress(requestHandle, out hostAddressPtr); - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to Get host address"); - return null; - } - - IntPtr optionsHandle = IntPtr.Zero; - ret = Interop.IoTConnectivity.Server.Request.GetOptions(requestHandle, out optionsHandle); - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to Get options"); - return null; - } - - IntPtr queryHandle = IntPtr.Zero; - ret = Interop.IoTConnectivity.Server.Request.GetQuery(requestHandle, out queryHandle); - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to Get Query"); - return null; - } - - IntPtr representationHandle = IntPtr.Zero; - ret = Interop.IoTConnectivity.Server.Request.GetRepresentation(requestHandle, out representationHandle); - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to Get representation"); - return null; - } - - ResourceOptions opts = null; - ResourceQuery query = null; - Representation representation = null; - try - { - opts = (optionsHandle == IntPtr.Zero) ? null : new ResourceOptions(optionsHandle); - } - catch (Exception exp) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to new ResourceOptions: " + exp.Message); - return null; - } - - try - { - query = (queryHandle == IntPtr.Zero) ? null : new ResourceQuery(queryHandle); - } - catch (Exception exp) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to new ResourceQuery: " + exp.Message); - opts?.Dispose(); - return null; - } - - try - { - representation = (representationHandle == IntPtr.Zero) ? null : new Representation(representationHandle); - } - catch (Exception exp) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to new Representation: " + exp.Message); - opts?.Dispose(); - query?.Dispose(); - return null; - } - - return new Request() - { - HostAddress = (hostAddressPtr != IntPtr.Zero) ? Marshal.PtrToStringAnsi(hostAddressPtr) : string.Empty, - Options = opts, - Query = query, - Representation = representation - }; - } - - private void ChildrenCollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs eventArgs) - { - if (eventArgs.Action == System.Collections.Specialized.NotifyCollectionChangedAction.Add) - { - foreach (Resource r in eventArgs.NewItems) - { - int ret = Interop.IoTConnectivity.Server.Resource.BindChildResource(_resourceHandle, r._resourceHandle); - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to bind resource "); - throw IoTConnectivityErrorFactory.GetException(ret); - } - } - } - else if (eventArgs.Action == System.Collections.Specialized.NotifyCollectionChangedAction.Remove) - { - foreach (Resource r in eventArgs.NewItems) - { - int ret = Interop.IoTConnectivity.Server.Resource.UnbindChildResource(_resourceHandle, r._resourceHandle); - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to unbind resource"); - throw IoTConnectivityErrorFactory.GetException(ret); - } - } - } - } - } -} diff --git a/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/ResourceFoundEventArgs.cs b/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/ResourceFoundEventArgs.cs deleted file mode 100755 index 5ed0fb09d..000000000 --- a/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/ResourceFoundEventArgs.cs +++ /dev/null @@ -1,54 +0,0 @@ - /* - * 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.Network.IoTConnectivity -{ - /// - /// This class represents event arguments of the ResourceFound event. - /// - /// 3 - public class ResourceFoundEventArgs : EventArgs - { - internal ResourceFoundEventArgs() { } - - /// - /// Indicates the request ID. - /// This is the same request ID returned by the API. - /// - /// 3 - /// The request ID. - public int RequestId { get; internal set; } - - /// - /// Indicates to continuously receive the event for finding resource. - /// - /// 3 - /// Continuously receive the event for finding resource. - public bool EventContinue { get; set; } - - /// - /// Remote resource, which is found after . - /// - /// 3 - /// Remote resource which is found after . - /// - /// - public RemoteResource Resource { get; internal set; } - } -} diff --git a/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/ResourceInterfaces.cs b/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/ResourceInterfaces.cs deleted file mode 100755 index 49a928bba..000000000 --- a/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/ResourceInterfaces.cs +++ /dev/null @@ -1,312 +0,0 @@ - /* - * 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.Collections; -using System.Collections.Generic; -using System.Text.RegularExpressions; - -namespace Tizen.Network.IoTConnectivity -{ - /// - /// This class contains resource interfaces and provides APIs to manage, add, or remove those interfaces. - /// A resource interface indicates a class or category of resources. - /// - /// 3 - public class ResourceInterfaces : IEnumerable, IDisposable - { - /// - /// Default Interface. - /// - /// 3 - public const string DefaultInterface = "oic.if.baseline"; - - /// - /// List Links Interface, which is used to list the references to other resources contained in a resource. - /// - /// 3 - public const string LinkInterface = "oic.if.ll"; - - /// - /// Batch Interface, which is used to manipulate (GET, PUT, POST, DELETE) on other resource contained in a resource. - /// - /// 3 - public const string BatchInterface = "oic.if.b"; - - /// - /// Group Interface, which is used to manipulate (GET, PUT, POST) a group of remote resources. - /// - /// 3 - public const string GroupInterface = "oic.mi.grp"; - - /// - /// Read-Only Interface, which is used to limit the methods that can be applied to a resource to GET only. - /// - /// 3 - public const string ReadonlyInterface = "oic.if.r"; - - private readonly IntPtr _resourceInterfacesHandle = IntPtr.Zero; - private const int MaxLength = 61; - private readonly HashSet _resourceInterfaces = new HashSet(); - private bool _disposed = false; - - /// - /// Constructor of ResourceInterfaces. - /// - /// 3 - /// http://tizen.org/feature/iot.ocf - /// - /// - /// 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); - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to create interface"); - throw IoTConnectivityErrorFactory.GetException(ret); - } - } - - /// - /// Constructor of ResourceInterfaces using list of interfaces. - /// - /// 3 - /// List of resource interfaces. - /// http://tizen.org/feature/iot.ocf - /// Thrown when the iotcon is not supported. - /// Thrown when there is not enough memory. - /// Thrown when there is an invalid parameter. - /// - /// ResourceInterfaces resourceInterfaces = new ResourceInterfaces(new List() - /// { ResourceInterfaces.LinkInterface, ResourceInterfaces.ReadonlyInterface }); - /// - public ResourceInterfaces(IEnumerable ifaces) - { - int ret = Interop.IoTConnectivity.Common.ResourceInterfaces.Create(out _resourceInterfacesHandle); - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to create interface"); - throw IoTConnectivityErrorFactory.GetException(ret); - } - foreach (string iface in ifaces) - { - Add(iface); - } - } - - internal ResourceInterfaces(IntPtr ifacesHandleToClone) - { - int ret = Interop.IoTConnectivity.Common.ResourceInterfaces.Clone(ifacesHandleToClone, out _resourceInterfacesHandle); - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to create interface"); - throw IoTConnectivityErrorFactory.GetException(ret); - } - - Interop.IoTConnectivity.Common.ResourceInterfaces.ForeachCallback cb = (string iface, IntPtr data) => - { - _resourceInterfaces.Add(iface); - return true; - }; - - ret = Interop.IoTConnectivity.Common.ResourceInterfaces.Foreach(ifacesHandleToClone, cb, IntPtr.Zero); - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to create type"); - throw IoTConnectivityErrorFactory.GetException(ret); - } - } - - /// - /// Destructor of the ResourceInterfaces class. - /// - ~ResourceInterfaces() - { - Dispose(false); - } - - internal IntPtr ResourceInterfacesHandle - { - get - { - return _resourceInterfacesHandle; - } - } - - /// - /// Indicates count of interfaces in the list - /// - /// 3 - /// Count of interfaces in the list. - /// - /// ResourceInterfaces resourceInterfaces = new ResourceInterfaces(new List() - /// { ResourceInterfaces.LinkInterface, ResourceInterfaces.ReadonlyInterface }); - /// Console.WriteLine("There are {0} interfaces", resourceInterfaces.Count); - /// - public int Count - { - get - { - return _resourceInterfaces.Count; - } - } - - /// - /// Adds a resource interface into the list. - /// - /// 3 - /// - /// @a item could be a value, such as . - /// - /// The string data to insert into the resource interfaces. - /// http://tizen.org/feature/iot.ocf - /// - /// 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)) - { - int ret = Interop.IoTConnectivity.Common.ResourceInterfaces.Add(_resourceInterfacesHandle, item); - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to add interface"); - throw IoTConnectivityErrorFactory.GetException(ret); - } - _resourceInterfaces.Add(item); - } - else - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Invalid interface"); - throw IoTConnectivityErrorFactory.GetException((int)IoTConnectivityError.InvalidParameter); - } - } - - /// - /// Removes a resource interface from the list. - /// - /// 3 - /// The string data to delete from the resource ifaces. - /// http://tizen.org/feature/iot.ocf - /// - /// Thrown when the iotcon is not supported. - /// Thrown when there is an invalid parameter. - /// Thrown when the operation is invalid. - /// - /// ResourceInterfaces resourceInterfaces = new ResourceInterfaces(new List(){ ResourceInterfaces.BatchInterface }); - /// resourceInterfaces.Add(ResourceInterfaces.BatchInterface); - /// - public void Remove(string item) - { - bool isRemoved = _resourceInterfaces.Remove(item); - if (isRemoved) - { - int ret = Interop.IoTConnectivity.Common.ResourceInterfaces.Remove(_resourceInterfacesHandle, item); - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to remove interface"); - throw IoTConnectivityErrorFactory.GetException(ret); - } - } - else - throw IoTConnectivityErrorFactory.GetException((int)IoTConnectivityError.InvalidParameter); - } - - /// - /// Returns enumerator for the list of interfaces. - /// - /// 3 - /// The enumerator. - /// - /// ResourceInterfaces resourceInterfaces = new ResourceInterfaces(new List() - /// { ResourceInterfaces.LinkInterface, ResourceInterfaces.ReadonlyInterface }); - /// foreach(string item in resourceInterfaces) - /// { - /// Console.WriteLine("Interface : {0}", item); - /// } - /// - public IEnumerator GetEnumerator() - { - return _resourceInterfaces.GetEnumerator(); - } - - /// - /// Returns enumerator for the list of interfaces. - /// - /// 3 - /// The enumerator. - /// - /// ResourceInterfaces resourceInterfaces = new ResourceInterfaces(new List() - /// { ResourceInterfaces.LinkInterface, ResourceInterfaces.ReadonlyInterface }); - /// foreach(string item in resourceInterfaces) - /// { - /// Console.WriteLine("Interface : {0}", item); - /// } - /// - IEnumerator IEnumerable.GetEnumerator() - { - return _resourceInterfaces.GetEnumerator(); - } - - /// - /// Releases any unmanaged resources used by this object. - /// - /// 3 - /// http://tizen.org/feature/iot.ocf - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - - internal static bool IsValid(string type) - { - Regex r = new Regex("^[a-zA-Z0-9.-]+$"); - return (type.Length <= MaxLength && type.Length > 0 && char.IsLower(type[0]) && r.IsMatch(type)); - } - - /// - /// Releases any unmanaged resources used by this object. Can also dispose any other disposable objects. - /// - /// 3 - /// If true, disposes any disposable objects. If false, does not dispose disposable objects. - /// http://tizen.org/feature/iot.ocf - protected virtual void Dispose(bool disposing) - { - if (_disposed) - return; - - if (disposing) - { - // Free managed objects - } - - Interop.IoTConnectivity.Common.ResourceInterfaces.Destroy(_resourceInterfacesHandle); - _disposed = true; - } - } -} diff --git a/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/ResourceOptions.cs b/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/ResourceOptions.cs deleted file mode 100755 index 736291e30..000000000 --- a/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/ResourceOptions.cs +++ /dev/null @@ -1,474 +0,0 @@ - /* - * 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.Collections; -using System.Collections.Generic; -using System.Linq; - -namespace Tizen.Network.IoTConnectivity -{ - /// - /// This class represents resource options. It provides APIs to manage them.\n - /// The iotcon options API provides methods for managing vendor specific options of coap packet.\n - /// See more about coap packet in http://tools.ietf.org/html/rfc7252. - /// - /// 3 - public class ResourceOptions : IDictionary, IDisposable - { - internal const int MaxSize = 2; - internal const int IdMin = 2048; - internal const int IdMax = 3000; - internal const int DataMax = 15; - - internal IntPtr _resourceOptionsHandle = IntPtr.Zero; - private readonly IDictionary _options = new Dictionary(); - private bool _disposed = false; - - /// - /// The resource options constructor. - /// - /// 3 - /// http://tizen.org/feature/iot.ocf - /// - /// - /// 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); - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to create options"); - throw IoTConnectivityErrorFactory.GetException(ret); - } - } - - // internal constructor - internal ResourceOptions(IntPtr handleToClone) - { - int ret = Interop.IoTConnectivity.Common.Options.Create(out _resourceOptionsHandle); - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to create options"); - throw IoTConnectivityErrorFactory.GetException(ret); - } - - Interop.IoTConnectivity.Common.Options.OptionsCallback forEachCallback = (ushort id, string value, IntPtr userData) => - { - Add(id, value); - return true; - }; - - ret = Interop.IoTConnectivity.Common.Options.ForEach(handleToClone, forEachCallback, IntPtr.Zero); - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to iterate options"); - throw IoTConnectivityErrorFactory.GetException(ret); - } - } - - /// - /// Destructor of the ResourceOptions class. - /// - ~ResourceOptions() - { - Dispose(false); - } - - /// - /// Contains all the Option keys. - /// - /// 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 - { - return _options.Keys; - } - } - - /// - /// Contains all the Option values. - /// - /// 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 - { - return _options.Values; - } - } - - /// - /// Gets the number of options. - /// - /// 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 - { - return _options.Count; - } - } - - /// - /// Represents whether the collection is readonly. - /// - /// 3 - /// Whether the collection is readonly. - /// - /// ResourceOptions options = new ResourceOptions(); - /// if (options.IsReadOnly) - /// Console.WriteLine("Read only options"); - /// - public bool IsReadOnly - { - get - { - return _options.IsReadOnly; - } - } - - /// - /// Gets or sets the option data. - /// - /// 3 - /// 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 - { - return _options[key]; - } - set - { - Add(key, value); - } - } - - /// - /// Checks whether the given key exists in Options collection. - /// - /// 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); - } - - /// - /// Adds a new ID and a correspoding data into the options. - /// - /// 3 - /// - /// ResourceOptions can have up to 2 options. \n - /// key is always situated between 2048 and 3000. \n - /// Length of option data is less than or equal to 15. - /// - /// The ID of the option to insert. - /// The string data to insert into the options. - /// http://tizen.org/feature/iot.ocf - /// - /// 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; - if (IsValid(key, value)) - { - ret = Interop.IoTConnectivity.Common.Options.Add(_resourceOptionsHandle, key, value); - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to add option"); - throw IoTConnectivityErrorFactory.GetException(ret); - } - _options.Add(key, value); - } - else - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Invalid options"); - throw IoTConnectivityErrorFactory.GetException((int)IoTConnectivityError.InvalidParameter); - } - } - - /// - /// Removes the ID and its associated data from the options. - /// - /// 3 - /// The ID of the option to delete. - /// True if operation is successful. Otherwise, false. - /// http://tizen.org/feature/iot.ocf - /// - /// 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); - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to remove option"); - throw IoTConnectivityErrorFactory.GetException(ret); - } - - bool isRemoved = _options.Remove(key); - - return isRemoved; - } - - /// - /// Gets the value associated with the specified key. - /// - /// 3 - /// 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); - } - - /// - /// Adds options key and value as a key value pair. - /// - /// 3 - /// The key value pair. - /// http://tizen.org/feature/iot.ocf - /// - /// - /// ResourceOptions options = new ResourceOptions(); - /// options.Add(new KeyValuePair(2050, "12345")); - /// - public void Add(KeyValuePair item) - { - Add(item.Key, item.Value); - } - - /// - /// Clears the Options collection. - /// - /// 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) - { - int ret = Interop.IoTConnectivity.Common.Options.Remove(_resourceOptionsHandle, key); - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to remove option"); - throw IoTConnectivityErrorFactory.GetException(ret); - }; - } - _options.Clear(); - } - - /// - /// Checks if the given option pair exists. - /// - /// 3 - /// The key value pair. - /// True if exists. Otherwise, false. - /// - /// ResourceOptions options = new ResourceOptions(); - /// options.Add(new KeyValuePair(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); - } - - /// - /// Copies the elements of the options collection to an array, starting at a particular index. - /// - /// 3 - /// The destination array. - /// Index parameter. - /// - /// ResourceOptions options = new ResourceOptions(); - /// options.Add(new KeyValuePair(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); - } - - /// - /// Removes the given key value pair from the options. - /// - /// 3 - /// The key value pair to remove - /// True if operation is successful. Otherwise, false - /// http://tizen.org/feature/iot.ocf - /// - /// Thrown when there is an invalid parameter - /// - /// ResourceOptions options = new ResourceOptions(); - /// options.Add(new KeyValuePair(2050, "12345")); - /// var result = options.Remove(new KeyValuePair(2050, "12345")); - /// - public bool Remove(KeyValuePair item) - { - return Remove(item.Key); - } - - /// - /// Get the enumerator to options collection. - /// - /// 3 - /// Enumerator to option pairs. - /// - /// ResourceOptions options = new ResourceOptions(); - /// options.Add(new KeyValuePair(2050, "sample1")); - /// options.Add(new KeyValuePair(2055, "sample2")); - /// foreach (KeyValuePair pair in options) - /// { - /// Console.WriteLine("key : {0}, value : {1}", pair.Key, pair.Value); - /// } - /// - public IEnumerator> GetEnumerator() - { - return _options.GetEnumerator(); - } - - /// - /// Releases any unmanaged resources used by this object. - /// - /// 3 - /// http://tizen.org/feature/iot.ocf - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - - /// - /// Gets the enumerator to options collection. - /// - /// 3 - /// Enumerator to option pairs. - /// - /// ResourceOptions options = new ResourceOptions(); - /// options.Add(new KeyValuePair(2050, "sample1")); - /// options.Add(new KeyValuePair(2055, "sample2")); - /// foreach (KeyValuePair pair in options) - /// { - /// Console.WriteLine("key : {0}, value : {1}", pair.Key, pair.Value); - /// } - /// - IEnumerator IEnumerable.GetEnumerator() - { - return _options.GetEnumerator(); - } - - /// - /// Releases any unmanaged resources used by this object. Can also dispose any other disposable objects. - /// - /// 3 - /// If true, disposes any disposable objects. If false, does not dispose disposable objects. - /// http://tizen.org/feature/iot.ocf - protected virtual void Dispose(bool disposing) - { - if (_disposed) - return; - - if (disposing) - { - // Free managed objects - } - - Interop.IoTConnectivity.Common.Options.Destroy(_resourceOptionsHandle); - _disposed = true; - } - - private bool IsValid(ushort key, string value) - { - return (key > IdMin && key < IdMax && value.Length <= DataMax && _options.Count() < MaxSize); - } - } -} diff --git a/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/ResourcePolicy.cs b/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/ResourcePolicy.cs deleted file mode 100755 index 0edfb3b0d..000000000 --- a/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/ResourcePolicy.cs +++ /dev/null @@ -1,64 +0,0 @@ - /* - * 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.Network.IoTConnectivity -{ - /// - /// Enumeration for the policy, which can be held in a resource. - /// - /// 3 - public enum ResourcePolicy - { - /// - /// Indicates resource uninitialized. - /// - /// 3 - NoProperty = 0, - /// - /// Indicates resource that is allowed to be discovered. - /// - /// 3 - Discoverable = (1 << 0), - /// - /// Indicates resource that is allowed to be observed. - /// - /// 3 - Observable = (1 << 1), - /// - /// Indicates resource initialized and activated. - /// - /// 3 - Active = (1 << 2), - /// - /// Indicates resource, which takes some delay to respond. - /// - /// 3 - Slow = (1 << 3), - /// - /// Indicates secure resource. - /// - /// 3 - Secure = (1 << 4), - /// - /// When this bit is set, the resource is allowed to be discovered only if discovery request contains an explicit querystring. - /// - /// 3 - ExplicitDiscoverable = (1 << 5), - } -} diff --git a/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/ResourceQuery.cs b/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/ResourceQuery.cs deleted file mode 100755 index 7622ee030..000000000 --- a/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/ResourceQuery.cs +++ /dev/null @@ -1,563 +0,0 @@ - /* - * 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.Collections; -using System.Collections.Generic; -using System.Runtime.InteropServices; - -namespace Tizen.Network.IoTConnectivity -{ - /// - /// This class provides APIs to manage the query of request. - /// - /// 3 - public class ResourceQuery : IDictionary, IDisposable - { - internal const int QueryMaxLenth = 64; - internal IntPtr _resourceQueryHandle = IntPtr.Zero; - private readonly IDictionary _query = new Dictionary(); - private bool _disposed = false; - - /// - /// The resource query constructor. - /// - /// 3 - /// http://tizen.org/feature/iot.ocf - /// - /// - /// 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); - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to create query"); - throw IoTConnectivityErrorFactory.GetException(ret); - } - } - - internal ResourceQuery(IntPtr resourceQueryHandleToClone) - { - int ret = Interop.IoTConnectivity.Common.Query.Create(out _resourceQueryHandle); - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to create query"); - throw IoTConnectivityErrorFactory.GetException(ret); - } - - Interop.IoTConnectivity.Common.Query.QueryCallback forEachCallback = (string key, string value, IntPtr userData) => - { - Add(key, value); - return true; - }; - - ret = Interop.IoTConnectivity.Common.Query.Foreach(resourceQueryHandleToClone, forEachCallback, IntPtr.Zero); - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to iterate query"); - throw IoTConnectivityErrorFactory.GetException(ret); - } - } - - /// - /// Destructor of the ResourceQuery class. - /// - ~ResourceQuery() - { - Dispose(false); - } - - /// - /// Gets and sets the resource type of the query. - /// - /// 3 - /// The resource type of the query. - /// 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 - { - IntPtr type; - int ret = Interop.IoTConnectivity.Common.Query.GetResourceType(_resourceQueryHandle, out type); - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to get type"); - return ""; - } - return (type != IntPtr.Zero) ? Marshal.PtrToStringAnsi(type) : string.Empty; - } - set - { - int ret = (int)IoTConnectivityError.InvalidParameter; - if (ResourceTypes.IsValid(value)) - ret = Interop.IoTConnectivity.Common.Query.SetResourceType(_resourceQueryHandle, value); - - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to set type"); - throw IoTConnectivityErrorFactory.GetException(ret); - } - } - } - - /// - /// Gets and sets the resource interface of the query. - /// - /// 3 - /// - /// The resource interface of the query. - /// Setter value could be a value, such as . - /// - /// 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 - { - IntPtr iface; - int ret = Interop.IoTConnectivity.Common.Query.GetInterface(_resourceQueryHandle, out iface); - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to get interface"); - return ""; - } - return (iface != IntPtr.Zero) ? Marshal.PtrToStringAnsi(iface) : string.Empty; - } - set - { - int ret = (int)IoTConnectivityError.InvalidParameter; - if (ResourceInterfaces.IsValid(value)) - ret = Interop.IoTConnectivity.Common.Query.SetInterface(_resourceQueryHandle, value); - - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to set interface"); - throw IoTConnectivityErrorFactory.GetException(ret); - } - } - } - - /// - /// Contains all the query keys. - /// - /// 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 - { - return _query.Keys; - } - } - - /// - /// Contains all the query values. - /// - /// 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 - { - return _query.Values; - } - } - - /// - /// Gets the number of query elements. - /// - /// 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 - { - return _query.Count; - } - } - - /// - /// Represents whether the collection is readonly. - /// - /// 3 - /// Whether the collection is readonly. - /// - /// ResourceQuery query = new ResourceQuery(); - /// if (query.IsReadOnly) - /// Console.WriteLine("Read only query"); - /// - public bool IsReadOnly - { - get - { - return _query.IsReadOnly; - } - } - - /// - /// Gets or sets the query data. - /// - /// 3 - /// 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 - { - return _query[key]; - } - - set - { - Add(key, value); - } - } - - /// - /// Checks whether the given key exists in the query collection. - /// - /// 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); - } - - /// - /// Adds a new key and correspoding value into the query. - /// - /// 3 - /// - /// The full length of query should be less than or equal to 64. - /// - /// The key of the query to insert. - /// The string data to insert into the query. - /// http://tizen.org/feature/iot.ocf - /// - /// 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)) - { - int ret = Interop.IoTConnectivity.Common.Query.Add(_resourceQueryHandle, key, value); - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to add query"); - throw IoTConnectivityErrorFactory.GetException(ret); - } - _query.Add(key, value); - } - else - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Query cannot be added"); - throw IoTConnectivityErrorFactory.GetException((int)IoTConnectivityError.InvalidParameter); - } - } - - /// - /// Removes the key and its associated value from the query. - /// - /// 3 - /// The ID of the query to delete. - /// True if operation is successful. Otherwise, false. - /// http://tizen.org/feature/iot.ocf - /// - /// 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); - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to remove query"); - throw IoTConnectivityErrorFactory.GetException(ret); - } - - bool isRemoved = _query.Remove(key); - - return isRemoved; - } - - /// - /// Gets the value associated with the specified key. - /// - /// 3 - /// 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); - } - - /// - /// Adds a query key and a value as a key value pair. - /// - /// 3 - /// The key value pair. - /// http://tizen.org/feature/iot.ocf - /// - /// - /// ResourceQuery query = new ResourceQuery(); - /// query.Add(new KeyValuePair("key1", "value1")); - /// - public void Add(KeyValuePair item) - { - Add(item.Key, item.Value); - } - - /// - /// Clears the query collection. - /// - /// 3 - /// 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) - { - int ret = Interop.IoTConnectivity.Common.Query.Remove(_resourceQueryHandle, key); - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to clear query"); - throw IoTConnectivityErrorFactory.GetException(ret); - } - } - _query.Clear(); - } - - /// - /// Checks if the given query pair exists. - /// - /// 3 - /// The key value pair. - /// True if exists. Otherwise, false. - /// - /// ResourceQuery query = new ResourceQuery(); - /// query.Add(new KeyValuePair("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); - } - - /// - /// Copies the elements of the query collection to an array, starting at a particular index. - /// - /// 3 - /// The destination array. - /// Index parameter. - /// - /// ResourceQuery query = new ResourceQuery(); - /// query.Add(new KeyValuePair("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); - } - - /// - /// Removes the given key value pair from the query. - /// - /// 3 - /// The key value pair to remove. - /// True if operation is successful. Otherwise, false. - /// http://tizen.org/feature/iot.ocf - /// - /// Thrown when there is an invalid parameter. - /// - /// ResourceQuery query = new ResourceQuery(); - /// query.Add(new KeyValuePair("key1", "value1")); - /// var result = query.Remove(new KeyValuePair("key1", "value1")); - /// - public bool Remove(KeyValuePair item) - { - return Remove(item.Key); - } - - /// - /// Gets the enumerator to the query collection. - /// - /// 3 - /// Enumerator to query pairs. - /// - /// ResourceQuery query = new ResourceQuery(); - /// query.Add(new KeyValuePair("key1", "value1")); - /// query.Add(new KeyValuePair("key2", "value2")); - /// foreach (KeyValuePair pair in query) - /// { - /// Console.WriteLine("key : {0}, value : {1}", pair.Key, pair.Value); - /// } - /// - public IEnumerator> GetEnumerator() - { - return _query.GetEnumerator(); - } - - /// - /// Gets the enumerator to the query collection. - /// - /// 3 - /// The enumerator to the query pairs. - /// - /// ResourceQuery query = new ResourceQuery(); - /// query.Add(new KeyValuePair("key1", "value1")); - /// query.Add(new KeyValuePair("key2", "value2")); - /// foreach (KeyValuePair pair in query) - /// { - /// Console.WriteLine("key : {0}, value : {1}", pair.Key, pair.Value); - /// } - /// - IEnumerator IEnumerable.GetEnumerator() - { - return _query.GetEnumerator(); - } - - /// - /// Releases any unmanaged resources used by this object. - /// - /// 3 - /// http://tizen.org/feature/iot.ocf - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - - /// - /// Releases any unmanaged resources used by this object. Can also dispose any other disposable objects. - /// - /// 3 - /// If true, disposes any disposable objects. If false, does not dispose disposable objects. - /// http://tizen.org/feature/iot.ocf - protected virtual void Dispose(bool disposing) - { - if (_disposed) - return; - - if (disposing) - { - // Free managed objects - } - - Interop.IoTConnectivity.Common.Query.Destroy(_resourceQueryHandle); - _disposed = true; - } - - private bool CanAddQuery(string newKey, string newValue) - { - int queryLenth = 0; - foreach (string key in Keys) - { - queryLenth += key.Length + 2; - } - foreach (string value in Values) - { - queryLenth += value.Length; - } - - if ((newKey.Length + newValue.Length + queryLenth + 2) < QueryMaxLenth) - return true; - - return false; - } - } -} diff --git a/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/ResourceState.cs b/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/ResourceState.cs deleted file mode 100755 index e093b0a1b..000000000 --- a/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/ResourceState.cs +++ /dev/null @@ -1,37 +0,0 @@ - /* - * 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. - */ - - -namespace Tizen.Network.IoTConnectivity -{ - /// - /// Enumeration for states of the remote resource. - /// - /// 3 - public enum ResourceState - { - /// - /// Indicates remote resource is alive. - /// - /// 3 - Alive = 0, - /// - /// Indicates remote resource is lost. - /// - /// 3 - LostSignal - } -} diff --git a/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/ResourceTypes.cs b/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/ResourceTypes.cs deleted file mode 100755 index 8f91afb61..000000000 --- a/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/ResourceTypes.cs +++ /dev/null @@ -1,268 +0,0 @@ - /* - * 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.Collections; -using System.Collections.Generic; -using System.Text.RegularExpressions; - -namespace Tizen.Network.IoTConnectivity -{ - /// - /// This class contains resource types and provides APIs to manage, add, or remove those types. - /// A resource type indicates a class or a category of resources. - /// - /// 3 - public class ResourceTypes : IEnumerable, IDisposable - { - internal const int MaxLength = 61; - internal IntPtr _resourceTypeHandle = IntPtr.Zero; - private readonly HashSet _resourceTypes = new HashSet(); - private bool _disposed = false; - - /// - /// Constructor of ResourceTypes. - /// - /// 3 - /// http://tizen.org/feature/iot.ocf - /// - /// - /// 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); - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to create type"); - throw IoTConnectivityErrorFactory.GetException(ret); - } - } - - /// - /// Constructor of ResourceTypes using list of types. - /// - /// 3 - /// List of resource types. - /// http://tizen.org/feature/iot.ocf - /// Thrown when there is an invalid parameter. - /// - /// ResourceTypes types = new ResourceTypes(new List() { "org.tizen.light", "oic.if.room" }); - /// - public ResourceTypes(IEnumerable types) - { - int ret = Interop.IoTConnectivity.Common.ResourceTypes.Create(out _resourceTypeHandle); - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to create type"); - throw IoTConnectivityErrorFactory.GetException(ret); - } - - foreach (string type in types) - { - Add(type); - } - } - - internal ResourceTypes(IntPtr typesHandleToClone) - { - int ret = Interop.IoTConnectivity.Common.ResourceTypes.Clone(typesHandleToClone, out _resourceTypeHandle); - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to create type"); - throw IoTConnectivityErrorFactory.GetException(ret); - } - - Interop.IoTConnectivity.Common.ResourceTypes.ForeachCallback cb = (string type, IntPtr data) => - { - _resourceTypes.Add(type); - return true; - }; - - ret = Interop.IoTConnectivity.Common.ResourceTypes.Foreach(typesHandleToClone, cb, IntPtr.Zero); - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to create type"); - throw IoTConnectivityErrorFactory.GetException(ret); - } - } - - /// - /// Destructor of the ResourceTypes class. - /// - ~ResourceTypes() - { - Dispose(false); - } - - /// - /// Indicates count of types in the list. - /// - /// 3 - /// Count of types in the list. - /// - /// ResourceTypes types = new ResourceTypes(new List() { "org.tizen.light", "oic.if.room" }); - /// Console.WriteLine("There are {0} items", types.Count); - /// - public int Count - { - get - { - return _resourceTypes.Count; - } - } - - /// - /// Adds a resource type into the list. - /// - /// 3 - /// - /// The length of @a item should be less than or equal to 61.\n - /// The @a item must start with a lowercase alphabetic character, followed by a sequence - /// of lowercase alphabetic, numeric, ".", or "-" characters, and contains no white space.\n - /// Duplicate strings are not allowed. - /// - /// The string data to insert into the resource types. - /// http://tizen.org/feature/iot.ocf - /// - /// 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)) - { - int ret = Interop.IoTConnectivity.Common.ResourceTypes.Add(_resourceTypeHandle, item); - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to add type"); - throw IoTConnectivityErrorFactory.GetException(ret); - } - _resourceTypes.Add(item); - } - else - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Invalid type"); - throw IoTConnectivityErrorFactory.GetException((int)IoTConnectivityError.InvalidParameter); - } - } - - /// - /// Removes a resource type from the list. - /// - /// 3 - /// The string data to delete from the resource types. - /// http://tizen.org/feature/iot.ocf - /// - /// Thrown when the iotcon is not supported. - /// Thrown when there is an invalid parameter. - /// Thrown when the operation is invalid. - /// - /// ResourceTypes resourceTypes = new ResourceTypes(new List() { "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); - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to remove type"); - throw IoTConnectivityErrorFactory.GetException(ret); - } - - _resourceTypes.Remove(item); - } - - /// - /// Returns an enumerator for the list of types. - /// - /// 3 - /// The enumerator. - /// - /// ResourceTypes resourceTypes = new ResourceTypes(new List() { "org.tizen.light", "oic.if.room" }); - /// foreach(string item in resourceTypes) - /// { - /// Console.WriteLine("Type : {0}", item); - /// } - /// - public IEnumerator GetEnumerator() - { - return _resourceTypes.GetEnumerator(); - } - - /// - /// Returns an enumerator for the list of types. - /// - /// 3 - /// The enumerator. - /// - /// ResourceTypes resourceTypes = new ResourceTypes(new List() { "org.tizen.light", "oic.if.room" }); - /// foreach(string item in resourceTypes) - /// { - /// Console.WriteLine("Type : {0}", item); - /// } - /// - IEnumerator IEnumerable.GetEnumerator() - { - return _resourceTypes.GetEnumerator(); - } - - /// - /// Releases any unmanaged resources used by this object. - /// - /// 3 - /// http://tizen.org/feature/iot.ocf - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - - internal static bool IsValid(string type) - { - Regex r = new Regex("^[a-zA-Z0-9.-]+$"); - return (type.Length <= MaxLength && type.Length > 0 && char.IsLower(type[0]) && r.IsMatch(type)); - } - - /// - /// Releases any unmanaged resources used by this object. Can also dispose any other disposable objects. - /// - /// 3 - /// If true, disposes any disposable objects. If false, does not dispose disposable objects. - /// http://tizen.org/feature/iot.ocf - protected virtual void Dispose(bool disposing) - { - if (_disposed) - return; - - if (disposing) - { - // Free managed objects - } - - Interop.IoTConnectivity.Common.ResourceTypes.Destroy(_resourceTypeHandle); - _disposed = true; - } - } -} diff --git a/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/Response.cs b/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/Response.cs deleted file mode 100755 index ce8306e4e..000000000 --- a/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/Response.cs +++ /dev/null @@ -1,148 +0,0 @@ - /* - * 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.Network.IoTConnectivity -{ - /// - /// This class represents response from a resource. - /// It provides APIs to manage response. - /// - /// 3 - public class Response : IDisposable - { - private bool _disposed = false; - - /// - /// Constructor of Response. - /// - /// 3 - /// - /// Response response = new Response(); - /// - public Response() { } - - /// - /// Destructor of the Response class. - /// - ~Response() - { - Dispose(false); - } - - /// - /// Gets or sets the result from/into the response. - /// - /// 3 - /// The result from/into the response. - public ResponseCode Result { get; set; } - - /// - /// Gets or sets the representation from/into the response. - /// - /// 3 - /// The representation from/into the response. - public Representation Representation { get; set; } - - /// - /// Gets or sets the options from/into the response. - /// - /// 3 - /// The options from/into the response. - public ResourceOptions Options { get; set; } - - /// - /// Releases any unmanaged resources used by this object. - /// - /// 3 - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - - internal bool Send(IntPtr requestHandle) - { - IntPtr responseHandle = IntPtr.Zero; - int ret = Interop.IoTConnectivity.Server.Response.Create(requestHandle, out responseHandle); - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to send response"); - return false; - } - - ret = Interop.IoTConnectivity.Server.Response.SetResult(responseHandle, (int)Result); - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to send response"); - Interop.IoTConnectivity.Server.Response.Destroy(responseHandle); - return false; - } - - if (Representation != null) - { - ret = Interop.IoTConnectivity.Server.Response.SetRepresentation(responseHandle, Representation._representationHandle); - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to send response"); - Interop.IoTConnectivity.Server.Response.Destroy(responseHandle); - return false; - } - } - - if (Options != null) - { - ret = Interop.IoTConnectivity.Server.Response.SetOptions(responseHandle, Options._resourceOptionsHandle); - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to send response"); - Interop.IoTConnectivity.Server.Response.Destroy(responseHandle); - return false; - } - } - - ret = Interop.IoTConnectivity.Server.Response.Send(responseHandle); - if (ret != (int)IoTConnectivityError.None) - { - Log.Error(IoTConnectivityErrorFactory.LogTag, "Failed to send response"); - Interop.IoTConnectivity.Server.Response.Destroy(responseHandle); - return false; - } - - Interop.IoTConnectivity.Server.Response.Destroy(responseHandle); - return true; - } - - /// - /// Releases any unmanaged resources used by this object. Can also dispose any other disposable objects. - /// - /// 3 - /// If true, disposes any disposable objects. If false, does not dispose disposable objects. - protected virtual void Dispose(bool disposing) - { - if (_disposed) - return; - - if (disposing) - { - } - - _disposed = true; - } - } -} diff --git a/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/ResponseCode.cs b/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/ResponseCode.cs deleted file mode 100755 index 0792b00ba..000000000 --- a/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/ResponseCode.cs +++ /dev/null @@ -1,62 +0,0 @@ - /* - * 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. - */ - - -namespace Tizen.Network.IoTConnectivity -{ - /// - /// Enumeration for the result of response. - /// - /// 3 - public enum ResponseCode - { - /// - /// Indicates the result of response for success. - /// - /// 3 - Ok = 0, - /// - /// Indicates the result of response for some error. - /// - /// 3 - Error, - /// - /// Indicates the result of response for created resource. - /// - /// 3 - Created, - /// - /// Indicates the result of response for deleted resource. - /// - /// 3 - Deleted, - /// - /// Indicates the result of response for changed resource. - /// - /// 3 - Changed, - /// - /// Indicates the result of response for slow resource. - /// - /// 3 - Slow, - /// - /// Indicates the result of response for accessing unauthorized resource. - /// - /// 3 - Forbidden - } -} diff --git a/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/StateChangedEventArgs.cs b/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/StateChangedEventArgs.cs deleted file mode 100755 index 0078a9340..000000000 --- a/src/Tizen.Network.IoTConnectivity/Tizen.Network.IoTConnectivity/StateChangedEventArgs.cs +++ /dev/null @@ -1,37 +0,0 @@ - /* - * 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.Network.IoTConnectivity -{ - /// - /// This class represents event arguments of the StateChanged event. - /// - /// 3 - public class StateChangedEventArgs : EventArgs - { - internal StateChangedEventArgs() { } - - /// - /// Indicates the new state of the resource. - /// - /// 3 - /// The new state of the resource. - public ResourceState State { get; internal set; } - } -} diff --git a/src/Tizen.Network.Mtp/Interop/Interop.Glib.cs b/src/Tizen.Network.Mtp/Interop/Interop.Glib.cs deleted file mode 100644 index 576a6e287..000000000 --- a/src/Tizen.Network.Mtp/Interop/Interop.Glib.cs +++ /dev/null @@ -1,30 +0,0 @@ -/* - * 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 Glib - { - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool GSourceFunc(IntPtr userData); - - [DllImport(Libraries.Glib, EntryPoint = "g_idle_add", CallingConvention = CallingConvention.Cdecl)] - internal static extern uint IdleAdd(GSourceFunc d, IntPtr data); - } -} diff --git a/src/Tizen.Network.Mtp/Interop/Interop.Libc.cs b/src/Tizen.Network.Mtp/Interop/Interop.Libc.cs deleted file mode 100644 index 825599e27..000000000 --- a/src/Tizen.Network.Mtp/Interop/Interop.Libc.cs +++ /dev/null @@ -1,27 +0,0 @@ -/* - * 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 Libc - { - [DllImport(Libraries.Libc, EntryPoint = "free", CallingConvention = CallingConvention.Cdecl)] - internal static extern int Free(IntPtr ptr); - } -} diff --git a/src/Tizen.Network.Mtp/Interop/Interop.Libraries.cs b/src/Tizen.Network.Mtp/Interop/Interop.Libraries.cs deleted file mode 100644 index ae75b1aa7..000000000 --- a/src/Tizen.Network.Mtp/Interop/Interop.Libraries.cs +++ /dev/null @@ -1,25 +0,0 @@ -/* - * 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 Mtp = "libcapi-network-mtp.so.0"; - public const string Glib = "libglib-2.0.so.0"; - public const string Libc = "libc.so.6"; - } -} diff --git a/src/Tizen.Network.Mtp/Interop/Interop.Mtp.cs b/src/Tizen.Network.Mtp/Interop/Interop.Mtp.cs deleted file mode 100644 index bd5025314..000000000 --- a/src/Tizen.Network.Mtp/Interop/Interop.Mtp.cs +++ /dev/null @@ -1,116 +0,0 @@ -/* - * 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 Mtp - { - //Callback for event - //mtp_event_cb - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void MptStateChangedCallback(int eventType, int eventParameter, IntPtr userData); - - //capi-network-mtp-1.3.16-2.3.armv7l.rpm - ////Mtp Manager - [DllImport(Libraries.Mtp, EntryPoint = "mtp_initialize")] - internal static extern int Initialize(); - [DllImport(Libraries.Mtp, EntryPoint = "mtp_deinitialize")] - internal static extern int Deinitialize(); - [DllImport(Libraries.Mtp, EntryPoint = "mtp_get_devices")] - internal static extern int GetDevices(out IntPtr devices, out int count); - [DllImport(Libraries.Mtp, EntryPoint = "mtp_get_storages")] - internal static extern int GetStorages(int device, out IntPtr storages, out int count); - [DllImport(Libraries.Mtp, EntryPoint = "mtp_get_object_handles")] - internal static extern int GetObjectHandles(int device, int storage, int fileType, int parentHandle, out IntPtr objectHandle, out int count); - [DllImport(Libraries.Mtp, EntryPoint = "mtp_get_object")] - internal static extern bool GetObject(int device, int objectHandle, string fileDestinationPath); - [DllImport(Libraries.Mtp, EntryPoint = "mtp_get_thumbnail")] - internal static extern int getThumbnail(int device, int objectHandle, string fileDestinationPath); - - [DllImport(Libraries.Mtp, EntryPoint = "mtp_add_mtp_event_cb")] - internal static extern int AddMtpStateChangedCallback(MptStateChangedCallback callback, IntPtr userData); - [DllImport(Libraries.Mtp, EntryPoint = "mtp_remove_mtp_event_cb")] - internal static extern int RemoveMtpStateChangedCallback(MptStateChangedCallback callback); - - internal static class DeviceInfomation - { - [DllImport(Libraries.Mtp, EntryPoint = "mtp_deviceinfo_get_manufacturer_name")] - internal static extern int GetManufacturerName(int device, out IntPtr manufacturerName); - [DllImport(Libraries.Mtp, EntryPoint = "mtp_deviceinfo_get_model_name")] - internal static extern int GetModelName(int device, out IntPtr modelName); - [DllImport(Libraries.Mtp, EntryPoint = "mtp_deviceinfo_get_serial_number")] - internal static extern int GetSerialNumber(int device, out IntPtr serialNumber); - [DllImport(Libraries.Mtp, EntryPoint = "mtp_deviceinfo_get_device_version")] - internal static extern int GetDeviceVersion(int device, out IntPtr deviceVersion); - } - - internal static class StorageInformation - { - [DllImport(Libraries.Mtp, EntryPoint = "mtp_storageinfo_get_description")] - internal static extern int GetDescription(int device, int storage, out IntPtr description); - [DllImport(Libraries.Mtp, EntryPoint = "mtp_storageinfo_get_free_space")] - internal static extern int GetFreeSpace(int device, int storage, out UInt64 freeSpace); - [DllImport(Libraries.Mtp, EntryPoint = "mtp_storageinfo_get_max_capacity")] - internal static extern int GetMaxCapacity(int device, int storage, out UInt64 maxCapacity); - [DllImport(Libraries.Mtp, EntryPoint = "mtp_storageinfo_get_storage_type")] - internal static extern int GetStorageType(int device, int storage, out int storageType); - [DllImport(Libraries.Mtp, EntryPoint = "mtp_storageinfo_get_volume_identifier")] - internal static extern int GetVolumeIdentifier(int device, int storage, out IntPtr volumeIdentifier); - } - - internal static class ObjectInformation - { - [DllImport(Libraries.Mtp, EntryPoint = "mtp_objectinfo_get_file_name")] - internal static extern int GetFileName(int device, int objectHandle, out IntPtr fileName); - [DllImport(Libraries.Mtp, EntryPoint = "mtp_objectinfo_get_keywords")] - internal static extern int GetKeywords(int device, int objectHandle, out IntPtr keyWords); - [DllImport(Libraries.Mtp, EntryPoint = "mtp_objectinfo_get_association_desc")] - internal static extern int GetAssociationDescription(int device, int objectHandle, out int associationDescription); - [DllImport(Libraries.Mtp, EntryPoint = "mtp_objectinfo_get_association_type")] - internal static extern int GetAssociationType(int device, int objectHandle, out int associationType); - [DllImport(Libraries.Mtp, EntryPoint = "mtp_objectinfo_get_size")] - internal static extern int GetSize(int device, int objectHandle, out int size); - [DllImport(Libraries.Mtp, EntryPoint = "mtp_objectinfo_get_parent_object_handle")] - internal static extern int GetParentObjectHandle(int device, int objectHandle, out int parentObjectHandle); - [DllImport(Libraries.Mtp, EntryPoint = "mtp_objectinfo_get_storage")] - internal static extern int GetStorage(int device, int objectHandle, out int stroage); - [DllImport(Libraries.Mtp, EntryPoint = "mtp_objectinfo_get_date_created")] - internal static extern int GetDateCreated(int device, int objectHandle, out int dateCreated); - [DllImport(Libraries.Mtp, EntryPoint = "mtp_objectinfo_get_date_modified")] - internal static extern int GetDateModified(int device, int objectHandle, out int dateModified); - [DllImport(Libraries.Mtp, EntryPoint = "mtp_objectinfo_get_file_type")] - internal static extern int GetFileType(int device, int objectHandle, out int fileType); - [DllImport(Libraries.Mtp, EntryPoint = "mtp_objectinfo_get_image_bit_depth")] - internal static extern int GetImageBitDepth(int device, int objectHandle, out int depth); - [DllImport(Libraries.Mtp, EntryPoint = "mtp_objectinfo_get_image_pix_width")] - internal static extern int GetImagePixWidth(int device, int objectHandle, out int width); - [DllImport(Libraries.Mtp, EntryPoint = "mtp_objectinfo_get_image_pix_height")] - internal static extern int GetImagePixHeight(int device, int objectHandle, out int height); - [DllImport(Libraries.Mtp, EntryPoint = "mtp_objectinfo_get_thumbnail_size")] - internal static extern int GetThumbnailSize(int device, int objectHandle, out int size); - [DllImport(Libraries.Mtp, EntryPoint = "mtp_objectinfo_get_thumbnail_file_type")] - internal static extern int GetThumbnailFileType(int device, int objectHandle, out int fileType); - [DllImport(Libraries.Mtp, EntryPoint = "mtp_objectinfo_get_thumbnail_pix_height")] - internal static extern int GetThumbnailPixHeight(int device, int objectHandle, out int height); - [DllImport(Libraries.Mtp, EntryPoint = "mtp_objectinfo_get_thumbnail_pix_width")] - internal static extern int GetThumbnailPixWidth(int device, int objectHandle, out int width); - } - - } -} diff --git a/src/Tizen.Network.Mtp/Tizen.Network.Mtp.csproj b/src/Tizen.Network.Mtp/Tizen.Network.Mtp.csproj deleted file mode 100644 index 7f4584ffe..000000000 --- a/src/Tizen.Network.Mtp/Tizen.Network.Mtp.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - netstandard2.0 - - - - - - - - diff --git a/src/Tizen.Network.Mtp/Tizen.Network.Mtp.sln b/src/Tizen.Network.Mtp/Tizen.Network.Mtp.sln deleted file mode 100755 index a010f4646..000000000 --- a/src/Tizen.Network.Mtp/Tizen.Network.Mtp.sln +++ /dev/null @@ -1,34 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26430.12 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Network.Mtp", "Tizen.Network.Mtp.csproj", "{66896B73-D51B-4E1D-9A7A-B5D66FDE6E97}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen", "..\Tizen\Tizen.csproj", "{82B9BB77-6809-4DA0-9BCE-DAC24C7A7669}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Log", "..\Tizen.Log\Tizen.Log.csproj", "{AD803503-C70D-4CE7-A1F1-9DF0B890A42F}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {66896B73-D51B-4E1D-9A7A-B5D66FDE6E97}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {66896B73-D51B-4E1D-9A7A-B5D66FDE6E97}.Debug|Any CPU.Build.0 = Debug|Any CPU - {66896B73-D51B-4E1D-9A7A-B5D66FDE6E97}.Release|Any CPU.ActiveCfg = Release|Any CPU - {66896B73-D51B-4E1D-9A7A-B5D66FDE6E97}.Release|Any CPU.Build.0 = Release|Any CPU - {82B9BB77-6809-4DA0-9BCE-DAC24C7A7669}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {82B9BB77-6809-4DA0-9BCE-DAC24C7A7669}.Debug|Any CPU.Build.0 = Debug|Any CPU - {82B9BB77-6809-4DA0-9BCE-DAC24C7A7669}.Release|Any CPU.ActiveCfg = Release|Any CPU - {82B9BB77-6809-4DA0-9BCE-DAC24C7A7669}.Release|Any CPU.Build.0 = Release|Any CPU - {AD803503-C70D-4CE7-A1F1-9DF0B890A42F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {AD803503-C70D-4CE7-A1F1-9DF0B890A42F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {AD803503-C70D-4CE7-A1F1-9DF0B890A42F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {AD803503-C70D-4CE7-A1F1-9DF0B890A42F}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/src/Tizen.Network.Mtp/Tizen.Network.Mtp/MtpDevice.cs b/src/Tizen.Network.Mtp/Tizen.Network.Mtp/MtpDevice.cs deleted file mode 100644 index 778069449..000000000 --- a/src/Tizen.Network.Mtp/Tizen.Network.Mtp/MtpDevice.cs +++ /dev/null @@ -1,184 +0,0 @@ -/* - * 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; -using System.Collections.Generic; - -namespace Tizen.Network.Mtp -{ - /// - /// A class for Mtp Device information. It allows applications to handle device information. - /// - /// 5 - public class MtpDevice : IDisposable - { - private int _deviceHandle = -1; - private bool disposed = false; - private List _storageList = new List(); - - /// - /// Gets the manufacturer name of the device information. - /// - /// Manufacture name of device. - /// 5 - public string ManufacturerName - { - get - { - IntPtr strPtr; - int ret = Interop.Mtp.DeviceInfomation.GetManufacturerName(_deviceHandle, out strPtr); - if (ret != (int)MtpError.None) - { - Log.Error(Globals.LogTag, "Failed to get manufacturer name, Error - " + (MtpError)ret); - return ""; - } - return Marshal.PtrToStringAnsi(strPtr); - } - } - - /// - /// Gets the model name of the device information. - /// - /// Model name of device. - /// 5 - public string ModelName - { - get - { - IntPtr strPtr; - int ret = Interop.Mtp.DeviceInfomation.GetModelName(_deviceHandle, out strPtr); - if (ret != (int)MtpError.None) - { - Log.Error(Globals.LogTag, "Failed to get model name, Error - " + (MtpError)ret); - return ""; - } - return Marshal.PtrToStringAnsi(strPtr); - } - } - - /// - /// Gets the serial number of the device information. - /// - /// Serial number of device. - /// 5 - public string SerialNumber - { - get - { - IntPtr strPtr; - int ret = Interop.Mtp.DeviceInfomation.GetSerialNumber(_deviceHandle, out strPtr); - if (ret != (int)MtpError.None) - { - Log.Error(Globals.LogTag, "Failed to get serial number, Error - " + (MtpError)ret); - return ""; - } - return Marshal.PtrToStringAnsi(strPtr); - } - } - - /// - /// Gets the device version of the device information. - /// - /// Version number of device. - /// 5 - public string DeviceVersion - { - get - { - IntPtr strPtr; - int ret = Interop.Mtp.DeviceInfomation.GetDeviceVersion(_deviceHandle, out strPtr); - if (ret != (int)MtpError.None) - { - Log.Error(Globals.LogTag, "Failed to get device version, Error - " + (MtpError)ret); - return ""; - } - return Marshal.PtrToStringAnsi(strPtr); - } - } - - internal MtpDevice(int handle) - { - _deviceHandle = handle; - } - - ~MtpDevice() - { - Dispose(false); - } - - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - - private void Dispose(bool disposing) - { - if (disposed) - return; - - if (disposing) - { - // Free managed objects. - foreach (MtpStorage storage in _storageList) - { - storage.Dispose(); - _storageList.Remove(storage); - } - } - //Free unmanaged objects - disposed = true; - } - - internal int GetHandle() - { - return _deviceHandle; - } - - /// - /// Gets the list of storages. - /// - /// List of storage objects. - /// http://tizen.org/feature/network.mtp - /// Thrown when Mtp is not supported. - /// Thrown when the method failed due to invalid operation. - /// 5 - public IEnumerable GetStorages() - { - IntPtr storagePtr; - int count = 0; - - int ret = Interop.Mtp.GetStorages(_deviceHandle, out storagePtr, out count); - if (ret != (int)MtpError.None) - { - Log.Error(Globals.LogTag, "Failed to get storage list, Error - " + (MtpError)ret); - MtpErrorFactory.ThrowMtpException(ret); - } - - for (int i = 0; i < count; i++) - { - int storageID = Marshal.ReadInt32(storagePtr); - - MtpStorage storageItem = new MtpStorage(_deviceHandle, storageID); - _storageList.Add(storageItem); - storagePtr += sizeof(int); - } - - return _storageList; - } - } -} diff --git a/src/Tizen.Network.Mtp/Tizen.Network.Mtp/MtpEnumerations.cs b/src/Tizen.Network.Mtp/Tizen.Network.Mtp/MtpEnumerations.cs deleted file mode 100644 index 17e0ae0dd..000000000 --- a/src/Tizen.Network.Mtp/Tizen.Network.Mtp/MtpEnumerations.cs +++ /dev/null @@ -1,284 +0,0 @@ -/* - * 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.Network.Mtp -{ - /// - /// Enumeration for Mtp storage type. - /// - /// 5 - public enum MtpStorageType - { - /// - /// Undefined - /// - Undefined = 0, - /// - /// fixed ROM - /// - FixedRom = 1, - /// - /// removable ROM - /// - RemovableRom = 2, - /// - /// fixed RAM - /// - FixedRam = 3, - /// - /// removable RAM - /// - RemovableRam = 4 - } - - /// - /// Enumeration for Mtp file type. - /// - /// 5 - public enum MtpFileType - { - /// - /// Folder - /// - Folder = 0, - /// - /// Wav - /// - Wav = 1, - /// - /// Mp3 - /// - Mp3 = 2, - /// - /// Wma - /// - Wma = 3, - /// - /// Ogg - /// - Ogg = 4, - /// - /// Audible - /// - Audible = 5, - /// - /// Mp4 - /// - Mp4 = 6, - /// - /// UndefAudio - /// - UndefAudio = 7, - /// - /// Wmv - /// - Wmv = 8, - /// - /// Avi - /// - Avi = 9, - /// - /// Mpeg - /// - Mpeg = 10, - /// - /// Asf - /// - Asf = 11, - /// - /// Qt - /// - Qt = 12, - /// - /// UndefVideo - /// - UndefVideo = 13, - /// - /// Jpeg - /// - Jpeg = 14, - /// - /// Jfif - /// - Jfif = 15, - /// - /// Tiff - /// - Tiff = 16, - /// - /// Bmp - /// - Bmp = 17, - /// - /// Gif - /// - Gif = 18, - /// - /// Pict - /// - Pict = 19, - /// - /// Png - /// - Png = 20, - /// - /// Vcalendar1 - /// - Vcalendar1 = 21, - /// - /// Vcalendar2 - /// - Vcalendar2 = 22, - /// - /// Vcard2 - /// - Vcard2 = 23, - /// - /// Vcard3 - /// - Vcard3 = 24, - /// - /// WindowsImageFormat - /// - WindowsImageFormat = 25, - /// - /// WinExec - /// - WinExec = 26, - /// - /// Text - /// - Text = 27, - /// - /// Html - /// - Html = 28, - /// - /// Firmware - /// - Firmware = 29, - /// - /// Aac - /// - Aac = 30, - /// - /// Mediacard - /// - Mediacard = 31, - /// - /// Flac - /// - Flac = 32, - /// - /// Mp2 - /// - Mp2 = 33, - /// - /// M4a - /// - M4a = 34, - /// - /// Doc - /// - Doc = 35, - /// - /// Xml - /// - Xml = 36, - /// - /// Xls - /// - Xls = 37, - /// - /// Ppt - /// - Ppt = 38, - /// - /// Mht - /// - Mht = 39, - /// - /// Jp2 - /// - Jp2 = 40, - /// - /// Jpx - /// - Jpx = 41, - /// - /// Album - /// - Album = 42, - /// - /// Playlist - /// - Playlist = 43, - /// - /// Unknown - /// - Unknown = 44, - /// - /// All (Helper type) - /// - All = 45, - /// - /// All Image (Helper type) - /// - AllImage = 46 - } - - /// - /// Enumeration for Mtp Event type. - /// - /// 5 - public enum MtpEventType - { - /// - /// Unknown - /// - Unknown, - /// - /// Storage Added - /// - StorageAdded, - /// - /// Storage Removed - /// - StorageRemoved, - /// - /// Object Added - /// - ObjectAdded, - /// - /// Object Removed - /// - ObjectRemoved, - /// - /// Device Added - /// - DeviceAdded, - /// - /// Device Removed - /// - DeviceRemoved, - /// - /// Turned Off - /// - TurnedOff - } -} diff --git a/src/Tizen.Network.Mtp/Tizen.Network.Mtp/MtpErrorFactory.cs b/src/Tizen.Network.Mtp/Tizen.Network.Mtp/MtpErrorFactory.cs deleted file mode 100644 index 5362b1eeb..000000000 --- a/src/Tizen.Network.Mtp/Tizen.Network.Mtp/MtpErrorFactory.cs +++ /dev/null @@ -1,85 +0,0 @@ -/* - * 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.Network.Mtp -{ - static internal class MtpErrorValue - { - internal const int Base = -0x01CC0000; - } - - /// - /// Enumeration for Mtp Error. - /// - /// 5 - public enum MtpError - { - None = ErrorCode.None, - IoError = ErrorCode.IoError, - InvalidParameterError = ErrorCode.InvalidParameter, - OutOfMemoryError = ErrorCode.OutOfMemory, - PermissionDeniedError = ErrorCode.PermissionDenied, - NotSupportedError = ErrorCode.NotSupported, - - CommunicationError = MtpErrorValue.Base | 0x01, - ControllerError = MtpErrorValue.Base | 0x02, - NoDeviceError = MtpErrorValue.Base | 0x03, - NotInitializedError = MtpErrorValue.Base | 0x04, - NotActivatedError = MtpErrorValue.Base | 0x05, - NotActivatedCommunicationError = MtpErrorValue.Base | 0x06, - PluginFailError = MtpErrorValue.Base | 0x07 - } - - internal static class MtpErrorFactory - { - static internal void ThrowMtpException(int e) - { - ThrowException(e, false); - } - - static internal void ThrowMtpException(int e, int handle) - { - ThrowException(e, (handle < 0)); - } - - static private void ThrowException(int e, bool isHandleNull) - { - MtpError err = (MtpError)e; - - if (isHandleNull) - { - throw new InvalidOperationException("Invalid instance (object may have been disposed or released)"); - } - - if (err == MtpError.InvalidParameterError) - { - throw new ArgumentException(err.ToString()); - } - else if (err == MtpError.NotSupportedError) - { - throw new NotSupportedException(); - } - else - { - throw new InvalidOperationException(err.ToString()); - } - } - - } -} diff --git a/src/Tizen.Network.Mtp/Tizen.Network.Mtp/MtpEventArgs.cs b/src/Tizen.Network.Mtp/Tizen.Network.Mtp/MtpEventArgs.cs deleted file mode 100644 index e6e7245ca..000000000 --- a/src/Tizen.Network.Mtp/Tizen.Network.Mtp/MtpEventArgs.cs +++ /dev/null @@ -1,62 +0,0 @@ -/* - * 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.Collections.Generic; - -namespace Tizen.Network.Mtp -{ - /// - /// An extended EventArgs class which contains Mtp event. - /// - /// 5 - public class MtpStateChangedEventArgs : EventArgs - { - private MtpEventType _type = MtpEventType.Unknown; - private int _eventParameter; - - internal MtpStateChangedEventArgs(MtpEventType type, int eventParameter) - { - _type = type; - _eventParameter = eventParameter; - } - - /// - /// The Mtp event type. - /// - /// 5 - public MtpEventType Type - { - get - { - return _type; - } - } - - /// - /// The event parameter. - /// - /// 5 - public int EventParameter - { - get - { - return _eventParameter; - } - } - } - -} diff --git a/src/Tizen.Network.Mtp/Tizen.Network.Mtp/MtpManager.cs b/src/Tizen.Network.Mtp/Tizen.Network.Mtp/MtpManager.cs deleted file mode 100644 index f202f4bfd..000000000 --- a/src/Tizen.Network.Mtp/Tizen.Network.Mtp/MtpManager.cs +++ /dev/null @@ -1,83 +0,0 @@ -/* - * 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.Collections.Generic; -using System.Threading.Tasks; - -namespace Tizen.Network.Mtp -{ - /// - /// A class for MTP management. It allows applications to use MTP service. - /// - /// - /// http://tizen.org/privilege/mediastorage is needed if input or output path are relevant to media storage. - /// http://tizen.org/privilege/externalstorage is needed if input or output path are relevant to external storage. - /// - /// 5 - static public class MtpManager - { - /// - /// Gets the list of MTP devices. - /// - /// List of MtpDevice objects. - /// http://tizen.org/feature/network.mtp - /// Thrown when Mtp is not supported. - /// Thrown when the method failed due to invalid operation. - /// 5 - static public IEnumerable GetDevices() - { - try - { - return MtpManagerImpl.Instance.GetDevices(); - } - catch (TypeInitializationException e) - { - throw e.InnerException; - } - } - - /// - /// MtpStateChanged is raised when the Mtp device state is changed. - /// - /// 5 - static public event EventHandler MtpStateChanged - { - add - { - try - { - MtpManagerImpl.Instance.MtpStateChanged += value; - } - catch (TypeInitializationException e) - { - throw e.InnerException; - } - } - remove - { - try - { - MtpManagerImpl.Instance.MtpStateChanged -= value; - } - catch (TypeInitializationException e) - { - throw e.InnerException; - } - } - } - } -} diff --git a/src/Tizen.Network.Mtp/Tizen.Network.Mtp/MtpManagerEvent.cs b/src/Tizen.Network.Mtp/Tizen.Network.Mtp/MtpManagerEvent.cs deleted file mode 100644 index 7b233116c..000000000 --- a/src/Tizen.Network.Mtp/Tizen.Network.Mtp/MtpManagerEvent.cs +++ /dev/null @@ -1,95 +0,0 @@ -/* - * 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.Threading.Tasks; - -namespace Tizen.Network.Mtp -{ - internal static class EventHandlerExtension - { - internal static void SafeInvoke(this EventHandler evt, object sender, EventArgs e) - { - var handler = evt; - if (handler != null) - { - handler(sender, e); - } - } - internal static void SafeInvoke(this EventHandler evt, object sender, T e) where T : EventArgs - { - var handler = evt; - if (handler != null) - { - handler(sender, e); - } - } - } - - internal partial class MtpManagerImpl - { - private event EventHandler _mtpStateChanged; - - private Interop.Mtp.MptStateChangedCallback _mtpStateChangedCallback; - - internal event EventHandler MtpStateChanged - { - add - { - if (_mtpStateChanged == null) - { - RegisterMtpStateChangedEvent(); - } - _mtpStateChanged += value; - } - remove - { - _mtpStateChanged -= value; - if (_mtpStateChanged == null) - { - UnregisterMtpStateChangedEvent(); - } - } - } - - private void RegisterMtpStateChangedEvent() - { - _mtpStateChangedCallback = (int eventType, int eventParameter, IntPtr userData) => - { - MtpEventType _eventType = (MtpEventType)eventType; - int _eventParameter = eventParameter; - MtpStateChangedEventArgs e = new MtpStateChangedEventArgs(_eventType, _eventParameter); - _mtpStateChanged.SafeInvoke(null, e); - }; - - int ret = Interop.Mtp.AddMtpStateChangedCallback(_mtpStateChangedCallback, IntPtr.Zero); - if (ret != (int)MtpError.None) - { - Log.Error(Globals.LogTag, "Failed to add mtp state changed callback, Error - " + (MtpError)ret); - } - } - - private void UnregisterMtpStateChangedEvent() - { - int ret = Interop.Mtp.RemoveMtpStateChangedCallback(_mtpStateChangedCallback); - - if (ret != (int)MtpError.None) - { - Log.Error(Globals.LogTag, "Failed to remove mtp state changed callback, Error - " + (MtpError)ret); - } - } - } -} diff --git a/src/Tizen.Network.Mtp/Tizen.Network.Mtp/MtpManagerImpl.cs b/src/Tizen.Network.Mtp/Tizen.Network.Mtp/MtpManagerImpl.cs deleted file mode 100644 index 111bdb01a..000000000 --- a/src/Tizen.Network.Mtp/Tizen.Network.Mtp/MtpManagerImpl.cs +++ /dev/null @@ -1,116 +0,0 @@ -/* - * 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.Collections.Generic; -using System.Runtime.InteropServices; -using System.Threading.Tasks; - -namespace Tizen.Network.Mtp -{ - static internal class Globals - { - internal const string LogTag = "Tizen.Network.Mtp"; - } - - internal partial class MtpManagerImpl : IDisposable - { - private static readonly MtpManagerImpl _instance = new MtpManagerImpl(); - private List _deviceList = new List(); - private bool disposed = false; - - internal static MtpManagerImpl Instance - { - get - { - return _instance; - } - } - - private MtpManagerImpl() - { - Initialize(); - } - - ~MtpManagerImpl() - { - Dispose(false); - } - - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - - private void Dispose(bool disposing) - { - if (disposed) - return; - - if (disposing) - { - // Free managed objects. - } - //Free unmanaged objects - Deinitialize(); - disposed = true; - } - - private void Initialize() - { - int ret = Interop.Mtp.Initialize(); - if (ret != (int)MtpError.None) - { - Log.Error(Globals.LogTag, "Failed to Initialize Mtp, Error - " + (MtpError)ret); - MtpErrorFactory.ThrowMtpException(ret); - } - } - - private void Deinitialize() - { - int ret = Interop.Mtp.Deinitialize(); - if (ret != (int)MtpError.None) - { - Log.Error(Globals.LogTag, "Failed to Deinitialize Mtp, Error - " + (MtpError)ret); - } - } - - internal IEnumerable GetDevices() - { - IntPtr devicePtr; - int count = 0; - - int ret = Interop.Mtp.GetDevices(out devicePtr, out count); - if (ret != (int)MtpError.None) - { - Log.Error(Globals.LogTag, "Failed to get device list, Error - " + (MtpError)ret); - MtpErrorFactory.ThrowMtpException(ret); - } - - for (int i = 0; i < count; i++) - { - int deviceID = Marshal.ReadInt32(devicePtr); - - MtpDevice deviceItem = new MtpDevice(deviceID); - _deviceList.Add(deviceItem); - devicePtr += sizeof(int); - } - - return _deviceList; - } - } -} diff --git a/src/Tizen.Network.Mtp/Tizen.Network.Mtp/MtpObject.cs b/src/Tizen.Network.Mtp/Tizen.Network.Mtp/MtpObject.cs deleted file mode 100644 index 6607e13ef..000000000 --- a/src/Tizen.Network.Mtp/Tizen.Network.Mtp/MtpObject.cs +++ /dev/null @@ -1,393 +0,0 @@ -/* - * 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; -using System.Collections.Generic; - -namespace Tizen.Network.Mtp -{ - /// - /// A class for Mtp Object information. It allows applications to handle object information. - /// - /// 5 - public class MtpObject : IDisposable - { - private int _deviceHandle = -1; - private int _objectHandle = -1; - private bool disposed = false; - - /// - /// Gets the filename of the object information. - /// - /// File name of object. - /// 5 - public string FileName - { - get - { - IntPtr strPtr; - int ret = Interop.Mtp.ObjectInformation.GetFileName(_deviceHandle, _objectHandle, out strPtr); - if (ret != (int)MtpError.None) - { - Log.Error(Globals.LogTag, "Failed to get file name, Error - " + (MtpError)ret); - return ""; - } - return Marshal.PtrToStringAnsi(strPtr); - } - } - - /// - /// Gets the keywords of the object information. - /// - /// Keywords of object. - /// 5 - public string Keywords - { - get - { - IntPtr strPtr; - int ret = Interop.Mtp.ObjectInformation.GetKeywords(_deviceHandle, _objectHandle, out strPtr); - if (ret != (int)MtpError.None) - { - Log.Error(Globals.LogTag, "Failed to get keywords, Error - " + (MtpError)ret); - return ""; - } - return Marshal.PtrToStringAnsi(strPtr); - } - } - - /// - /// Gets the association description of the object information. - /// - /// Association description of object. - /// 5 - public int AssociationDescription - { - get - { - int value; - int ret = Interop.Mtp.ObjectInformation.GetAssociationDescription(_deviceHandle, _objectHandle, out value); - if (ret != (int)MtpError.None) - { - Log.Error(Globals.LogTag, "Failed to get association decription, Error - " + (MtpError)ret); - } - return value; - } - } - - /// - /// Gets the association type of the object information. - /// - /// Association type of object. - /// 5 - public int AssociationType - { - get - { - int value; - int ret = Interop.Mtp.ObjectInformation.GetAssociationType(_deviceHandle, _objectHandle, out value); - if (ret != (int)MtpError.None) - { - Log.Error(Globals.LogTag, "Failed to get association type, Error - " + (MtpError)ret); - } - return value; - } - } - - /// - /// Gets the size of the object information. - /// - /// Size of object. - /// 5 - public int Size - { - get - { - int value; - int ret = Interop.Mtp.ObjectInformation.GetSize(_deviceHandle, _objectHandle, out value); - if (ret != (int)MtpError.None) - { - Log.Error(Globals.LogTag, "Failed to get size, Error - " + (MtpError)ret); - } - return value; - } - } - - /// - /// Gets the parent object handle of the object information. - /// - /// Handle of Parent object. - /// 5 - public int ParentObjectHandle - { - get - { - int value; - int ret = Interop.Mtp.ObjectInformation.GetParentObjectHandle(_deviceHandle, _objectHandle, out value); - if (ret != (int)MtpError.None) - { - Log.Error(Globals.LogTag, "Failed to get parent object handle, Error - " + (MtpError)ret); - } - return value; - } - } - - /// - /// Gets the mtp storage of the object information. - /// - /// Storage of object. - /// 5 - public int Storage - { - get - { - int value; - int ret = Interop.Mtp.ObjectInformation.GetStorage(_deviceHandle, _objectHandle, out value); - if (ret != (int)MtpError.None) - { - Log.Error(Globals.LogTag, "Failed to get storage, Error - " + (MtpError)ret); - } - return value; - } - } - - /// - /// Gets the object created time of the object information. - /// - /// Date created of object. - /// 5 - public int DateCreated - { - get - { - int value; - int ret = Interop.Mtp.ObjectInformation.GetDateCreated(_deviceHandle, _objectHandle, out value); - if (ret != (int)MtpError.None) - { - Log.Error(Globals.LogTag, "Failed to get date created, Error - " + (MtpError)ret); - } - return value; - } - } - - /// - /// Gets the object modified time of the object information. - /// - /// Date modified of object. - /// 5 - public int DateModified - { - get - { - int value; - int ret = Interop.Mtp.ObjectInformation.GetDateModified(_deviceHandle, _objectHandle, out value); - if (ret != (int)MtpError.None) - { - Log.Error(Globals.LogTag, "Failed to get date modified, Error - " + (MtpError)ret); - } - return value; - } - } - - /// - /// Gets the file type of the object information. - /// - /// File type of object. - /// 5 - public MtpFileType FileType - { - get - { - int value; - int ret = Interop.Mtp.ObjectInformation.GetStorage(_deviceHandle, _objectHandle, out value); - if (ret != (int)MtpError.None) - { - Log.Error(Globals.LogTag, "Failed to get file type, Error - " + (MtpError)ret); - } - return (MtpFileType)value; - } - } - - /// - /// Gets the image bit depth of the object information. - /// - /// Bit depth of image. - /// 5 - public int ImageBitDepth - { - get - { - int value; - int ret = Interop.Mtp.ObjectInformation.GetImageBitDepth(_deviceHandle, _objectHandle, out value); - if (ret != (int)MtpError.None) - { - Log.Error(Globals.LogTag, "Failed to get image bit depth, Error - " + (MtpError)ret); - } - return value; - } - } - - /// - /// Gets the image pixel width of the object information. - /// - /// Pixel width of image. - /// 5 - public int ImagePixelWidth - { - get - { - int value; - int ret = Interop.Mtp.ObjectInformation.GetImagePixWidth(_deviceHandle, _objectHandle, out value); - if (ret != (int)MtpError.None) - { - Log.Error(Globals.LogTag, "Failed to get image pixel width, Error - " + (MtpError)ret); - } - return value; - } - } - - /// - /// Gets the image pixel height of the object information. - /// - /// Pixel height of image. - /// 5 - public int ImagePixelHeight - { - get - { - int value; - int ret = Interop.Mtp.ObjectInformation.GetImagePixHeight(_deviceHandle, _objectHandle, out value); - if (ret != (int)MtpError.None) - { - Log.Error(Globals.LogTag, "Failed to get image pixel height, Error - " + (MtpError)ret); - } - return value; - } - } - - /// - /// Gets the thumbnail size of the object information. - /// - /// Size of thumbnail. - /// 5 - public int ThumbnailSize - { - get - { - int value; - int ret = Interop.Mtp.ObjectInformation.GetThumbnailSize(_deviceHandle, _objectHandle, out value); - if (ret != (int)MtpError.None) - { - Log.Error(Globals.LogTag, "Failed to get thumbnail size, Error - " + (MtpError)ret); - } - return value; - } - } - - /// - /// Gets the thumbnail file type of the object information. - /// - /// File type of thumbnail. - /// 5 - public int ThumbnailFileType - { - get - { - int value; - int ret = Interop.Mtp.ObjectInformation.GetThumbnailFileType(_deviceHandle, _objectHandle, out value); - if (ret != (int)MtpError.None) - { - Log.Error(Globals.LogTag, "Failed to get thumbnail file type, Error - " + (MtpError)ret); - } - return value; - } - } - - /// - /// Gets the thumbnail pixel width of the object information. - /// - /// Pixel width of thumbnail. - /// 5 - public int ThumbnailPixelWidth - { - get - { - int value; - int ret = Interop.Mtp.ObjectInformation.GetThumbnailPixWidth(_deviceHandle, _objectHandle, out value); - if (ret != (int)MtpError.None) - { - Log.Error(Globals.LogTag, "Failed to get thumbnail pixel width, Error - " + (MtpError)ret); - } - return value; - } - } - - /// - /// Gets the thumbnail pixel height of the object information. - /// - /// Pixel height of thumbnail. - /// 5 - public int ThumbnailPixelHeight - { - get - { - int value; - int ret = Interop.Mtp.ObjectInformation.GetThumbnailPixHeight(_deviceHandle, _objectHandle, out value); - if (ret != (int)MtpError.None) - { - Log.Error(Globals.LogTag, "Failed to get thumbnail pixel height, Error - " + (MtpError)ret); - } - return value; - } - } - - internal MtpObject(int deviceHandle, int objectHandle) - { - _deviceHandle = deviceHandle; - _objectHandle = objectHandle; - } - - ~MtpObject() - { - Dispose(false); - } - - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - - private void Dispose(bool disposing) - { - if (disposed) - return; - - if (disposing) - { - // Free managed objects. - } - //Free unmanaged objects - disposed = true; - } - - internal int GetHandle() - { - return _objectHandle; - } - } -} diff --git a/src/Tizen.Network.Mtp/Tizen.Network.Mtp/MtpStorage.cs b/src/Tizen.Network.Mtp/Tizen.Network.Mtp/MtpStorage.cs deleted file mode 100644 index 1e44f1f5a..000000000 --- a/src/Tizen.Network.Mtp/Tizen.Network.Mtp/MtpStorage.cs +++ /dev/null @@ -1,230 +0,0 @@ -/* - * 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; -using System.Collections.Generic; - -namespace Tizen.Network.Mtp -{ - /// - /// A class for Mtp Storage information. It allows applications to handle storage information. - /// - /// 5 - public class MtpStorage : IDisposable - { - private int _deviceHandle = -1; - private int _storageHandle = -1; - private bool disposed = false; - private List _objectHandleList = new List(); - private List _objectList = new List(); - private MtpObject _rootObject; - - /// - /// Gets the description of the storage information. - /// - /// Description of storage. - /// 5 - public string Description - { - get - { - IntPtr strPtr; - int ret = Interop.Mtp.StorageInformation.GetDescription(_deviceHandle, _storageHandle, out strPtr); - if (ret != (int)MtpError.None) - { - Log.Error(Globals.LogTag, "Failed to get description, Error - " + (MtpError)ret); - return ""; - } - return Marshal.PtrToStringAnsi(strPtr); - } - } - - /// - /// Gets the free space of the storage information in bytes. - /// - /// Free space of storage(bytes). - /// 5 - public UInt64 FreeSpace - { - get - { - UInt64 freeSpace; - int ret = Interop.Mtp.StorageInformation.GetFreeSpace(_deviceHandle, _storageHandle, out freeSpace); - if (ret != (int)MtpError.None) - { - Log.Error(Globals.LogTag, "Failed to get free space, Error - " + (MtpError)ret); - } - return freeSpace; - } - } - - /// - /// Gets the max capacity of the storage information in bytes. - /// - /// Max capacity of storage(bytes). - /// 5 - public UInt64 MaxCapacity - { - get - { - UInt64 maxCapacity; - int ret = Interop.Mtp.StorageInformation.GetMaxCapacity(_deviceHandle, _storageHandle, out maxCapacity); - if (ret != (int)MtpError.None) - { - Log.Error(Globals.LogTag, "Failed to get free space, Error - " + (MtpError)ret); - } - return maxCapacity; - } - } - - /// - /// Gets the storage type of the storage information. - /// - /// Type of storage. - /// 5 - public MtpStorageType StorageType - { - get - { - int storageType; - int ret = Interop.Mtp.StorageInformation.GetStorageType(_deviceHandle, _storageHandle, out storageType); - if (ret != (int)MtpError.None) - { - Log.Error(Globals.LogTag, "Failed to get free space, Error - " + (MtpError)ret); - } - return (MtpStorageType)storageType; - } - } - - /// - /// Gets the volume identifier of the storage information. - /// - /// Volume identifier of stroage. - /// 5 - public string VolumeIdentifier - { - get - { - IntPtr strPtr; - int ret = Interop.Mtp.StorageInformation.GetVolumeIdentifier(_deviceHandle, _storageHandle, out strPtr); - if (ret != (int)MtpError.None) - { - Log.Error(Globals.LogTag, "Failed to get volume identifier, Error - " + (MtpError)ret); - return ""; - } - return Marshal.PtrToStringAnsi(strPtr); - } - } - - internal MtpStorage(int deviceHandle, int storageHandle) - { - _deviceHandle = deviceHandle; - _storageHandle = storageHandle; - } - - ~MtpStorage() - { - Dispose(false); - } - - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - - private void Dispose(bool disposing) - { - if (disposed) - return; - - if (disposing) - { - // Free managed objects. - foreach (MtpObject mtpObject in _objectList) - { - mtpObject.Dispose(); - _objectList.Remove(mtpObject); - } - - //Free unmanaged objects - disposed = true; - } - } - - internal int GetHandle() - { - return _storageHandle; - } - - /// - /// Gets the root folder object. - /// - /// List of storage objects. - /// http://tizen.org/feature/network.mtp - /// - /// http://tizen.org/privilege/mediastorage is needed if input or output path are relevant to media storage. - /// http://tizen.org/privilege/externalstorage is needed if input or output path are relevant to external storage. - /// - /// 5 - public MtpObject GetRootObject() - { - _rootObject = new MtpObject(_deviceHandle, 0); - - return _rootObject; - } - - /// - /// Gets the list of objects. - /// - /// The parent object handle. If parentHandle is 0, it means "root folder" of mtp storage. - /// The file type what you want. - /// List of objects. - /// http://tizen.org/feature/network.mtp - /// - /// http://tizen.org/privilege/mediastorage is needed if input or output path are relevant to media storage. - /// http://tizen.org/privilege/externalstorage is needed if input or output path are relevant to external storage. - /// - /// Thrown when Mtp is not supported. - /// Thrown when method is failed due to an invalid parameter. - /// Thrown when the method failed due to invalid operation. - /// 5 - public IEnumerable GetObjectList(MtpObject parentObject, MtpFileType fileType) - { - IntPtr objectPtr; - int count = 0; - - int ret = Interop.Mtp.GetObjectHandles(_deviceHandle, _storageHandle, parentObject.GetHandle(), (int)fileType, out objectPtr, out count); - if (ret != (int)MtpError.None) - { - Log.Error(Globals.LogTag, "Failed to get object handle lists, Error - " + (MtpError)ret); - MtpErrorFactory.ThrowMtpException(ret); - } - - for (int i = 0; i < count; i++) - { - int objectID = Marshal.ReadInt32(objectPtr); - - MtpObject objectItem = new MtpObject(_deviceHandle, objectID); - _objectList.Add(objectItem); - objectPtr += sizeof(int); - } - - return _objectList; - } - } -} diff --git a/src/Tizen.Network.Mtp/Tizen.Network.Mtp/NamespaceDoc.cs b/src/Tizen.Network.Mtp/Tizen.Network.Mtp/NamespaceDoc.cs deleted file mode 100644 index c8c3c3aec..000000000 --- a/src/Tizen.Network.Mtp/Tizen.Network.Mtp/NamespaceDoc.cs +++ /dev/null @@ -1,44 +0,0 @@ -/** - -The Tizen.Network.Mtp namespace provides classes to manage the MTP(Media Transfer Protocol) initiator. - - - - -

Overview

- -MTP API provides functions for support PTP(Picture Transfer Protocol) subset of MTP(Media Transfer Protocol). - - - -

Manager

-Provide functions to establish connection to access MTP responder device, and to Get/Delete files. -
- - -

Device

-Provide functions to gets the device information of MTP responder device. -
- - -

Storage

-Provide functions to gets the storage information of MTP responder storage. -
- - -

Object

-Provide functions to gets the object information of certain file in MTP responder. -
- -

Related Features

- -To guarantee that if input or output path are relevant to internal and external storage, -declare the following feature requirements in the config file:
-http://tizen.org/privilege/mediastorage -http://tizen.org/privilege/externalstorage -
- -
-*/ - -namespace Tizen.Network.Mtp { } \ No newline at end of file diff --git a/src/Tizen.Network.Nfc/Interop/Interop.Glib.cs b/src/Tizen.Network.Nfc/Interop/Interop.Glib.cs deleted file mode 100644 index 576a6e287..000000000 --- a/src/Tizen.Network.Nfc/Interop/Interop.Glib.cs +++ /dev/null @@ -1,30 +0,0 @@ -/* - * 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 Glib - { - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool GSourceFunc(IntPtr userData); - - [DllImport(Libraries.Glib, EntryPoint = "g_idle_add", CallingConvention = CallingConvention.Cdecl)] - internal static extern uint IdleAdd(GSourceFunc d, IntPtr data); - } -} diff --git a/src/Tizen.Network.Nfc/Interop/Interop.Libc.cs b/src/Tizen.Network.Nfc/Interop/Interop.Libc.cs deleted file mode 100644 index 825599e27..000000000 --- a/src/Tizen.Network.Nfc/Interop/Interop.Libc.cs +++ /dev/null @@ -1,27 +0,0 @@ -/* - * 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 Libc - { - [DllImport(Libraries.Libc, EntryPoint = "free", CallingConvention = CallingConvention.Cdecl)] - internal static extern int Free(IntPtr ptr); - } -} diff --git a/src/Tizen.Network.Nfc/Interop/Interop.Libraries.cs b/src/Tizen.Network.Nfc/Interop/Interop.Libraries.cs deleted file mode 100644 index 8984d7124..000000000 --- a/src/Tizen.Network.Nfc/Interop/Interop.Libraries.cs +++ /dev/null @@ -1,25 +0,0 @@ -/* - * 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 Nfc = "libcapi-network-nfc.so.0"; - public const string Glib = "libglib-2.0.so.0"; - public const string Libc = "libc.so.6"; - } -} diff --git a/src/Tizen.Network.Nfc/Interop/Interop.Nfc.cs b/src/Tizen.Network.Nfc/Interop/Interop.Nfc.cs deleted file mode 100644 index d6ad84a6e..000000000 --- a/src/Tizen.Network.Nfc/Interop/Interop.Nfc.cs +++ /dev/null @@ -1,281 +0,0 @@ -/* - * 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 Nfc - { - //Callback for async method - //nfc_activation_completed_cb - //nfc_tag_write_completed_cb - //nfc_tag_format_completed_cb - //nfc_mifare_authenticate_with_keyA_completed_cb - //nfc_mifare_authenticate_with_keyB_completed_cb - //nfc_mifare_write_block_completed_cb - //nfc_mifare_write_page_completed_cb - //nfc_mifare_increment_completed_cb - //nfc_mifare_decrement_completed_cb - //nfc_mifare_transfer_completed_cb - //nfc_mifare_restore_completed_cb - //nfc_p2p_send_completed_cb - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void VoidCallback(int result, IntPtr userData); - //nfc_tag_information_cb - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool TagInformationCallback(IntPtr key, IntPtr value, int valueSize, IntPtr userData); - //nfc_tag_transceive_completed_cb - //nfc_mifare_read_block_completed_cb - //nfc_mifare_read_page_completed_cb - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void TagTransceiveCompletedCallback(int result, IntPtr value, int bufferSize, IntPtr userData); - //nfc_tag_read_completed_cb - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool TagReadCompletedCallback(int result, IntPtr message, IntPtr userData); - //nfc_snep_event_cb - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void SnepEventCallback(IntPtr handle, int snepEvent, int result, IntPtr message, IntPtr userData); - //nfc_se_registered_aid_cb - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void SecureElementRegisteredAidCallback(int seType, IntPtr aid, bool readOnly, IntPtr userData); - - - //Callback for event - //nfc_activation_changed_cb - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void ActivationChangedCallback(bool activated, IntPtr userData); - //nfc_tag_discovered_cb - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void TagDiscoveredCallback(int type, IntPtr tag, IntPtr userData); - //nfc_p2p_target_discovered_cb - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void P2pTargetDiscoveredCallback(int type, IntPtr p2pTaget, IntPtr userData); - //nfc_ndef_discovered_cb - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void NdefMessageDiscoveredCallback(IntPtr message, IntPtr userData); - //nfc_se_event_cb - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void SecureElementEventCallback(int eventType, IntPtr userData); - //nfc_se_transaction_event_cb - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void SecureElementTransactionEventCallback(int type, IntPtr aid, int aidSize, IntPtr param, int paramSize, IntPtr userData); - //nfc_p2p_data_received_cb - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void P2pDataReceivedCallback(IntPtr target, IntPtr message, IntPtr userData); - //nfc_hce_event_cb - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void HostCardEmulationEventCallback(IntPtr handle, int eventType, IntPtr apdu, uint apduLen, IntPtr userData); - - //capi-network-nfc-0.2.5-6.1.armv7l - [DllImport(Libraries.Nfc, EntryPoint = "nfc_manager_initialize")] - internal static extern int Initialize(); - [DllImport(Libraries.Nfc, EntryPoint = "nfc_manager_deinitialize")] - internal static extern int Deinitialize(); - - ////Nfc Manager - [DllImport(Libraries.Nfc, EntryPoint = "nfc_manager_is_supported")] - internal static extern bool IsSupported(); - [DllImport(Libraries.Nfc, EntryPoint = "nfc_manager_set_activation")] - internal static extern int SetActivation(bool activation, VoidCallback callback, IntPtr userData); - [DllImport(Libraries.Nfc, EntryPoint = "nfc_manager_is_activated")] - internal static extern bool IsActivated(); - [DllImport(Libraries.Nfc, EntryPoint = "nfc_manager_set_activation_changed_cb")] - internal static extern int SetActivationChangedCallback(ActivationChangedCallback callback, IntPtr userData); - [DllImport(Libraries.Nfc, EntryPoint = "nfc_manager_unset_activation_changed_cb")] - internal static extern void UnsetActivationChangedCallback(); - [DllImport(Libraries.Nfc, EntryPoint = "nfc_manager_set_tag_discovered_cb")] - internal static extern int SetTagDiscoveredCallback(TagDiscoveredCallback callback, IntPtr userData); - [DllImport(Libraries.Nfc, EntryPoint = "nfc_manager_unset_tag_discovered_cb")] - internal static extern void UnsetTagDiscoveredCallback(); - [DllImport(Libraries.Nfc, EntryPoint = "nfc_manager_set_ndef_discovered_cb")] - internal static extern int SetNdefDiscoveredCallback(NdefMessageDiscoveredCallback callback, IntPtr userData); - [DllImport(Libraries.Nfc, EntryPoint = "nfc_manager_unset_ndef_discovered_cb")] - internal static extern void UnsetNdefDiscoveredCallback(); - [DllImport(Libraries.Nfc, EntryPoint = "nfc_manager_set_p2p_target_discovered_cb")] - internal static extern int SetP2pTargetDiscoveredCallback(P2pTargetDiscoveredCallback callback, IntPtr userData); - [DllImport(Libraries.Nfc, EntryPoint = "nfc_manager_unset_p2p_target_discovered_cb")] - internal static extern void UnsetP2pTargetDiscoveredCallback(); - [DllImport(Libraries.Nfc, EntryPoint = "nfc_manager_set_se_event_cb")] - internal static extern int SetSecureElementEventCallback(SecureElementEventCallback callback, IntPtr userData); - [DllImport(Libraries.Nfc, EntryPoint = "nfc_manager_unset_se_event_cb")] - internal static extern void UnsetSecureElementEventCallback(); - [DllImport(Libraries.Nfc, EntryPoint = "nfc_manager_set_se_transaction_event_cb")] - internal static extern int SetSecureElementTransactionEventCallback(int setype, SecureElementTransactionEventCallback callback, IntPtr userData); - [DllImport(Libraries.Nfc, EntryPoint = "nfc_manager_unset_se_transaction_event_cb")] - internal static extern int UnsetSecureElementTransactionEventCallback(int setype); - [DllImport(Libraries.Nfc, EntryPoint = "nfc_manager_set_hce_event_cb")] - internal static extern int SetHostCardEmulationEventCallback(HostCardEmulationEventCallback callback, IntPtr userData); - [DllImport(Libraries.Nfc, EntryPoint = "nfc_manager_unset_hce_event_cb")] - internal static extern void UnsetHostCardEmulationEventCallback(); - [DllImport(Libraries.Nfc, EntryPoint = "nfc_manager_enable_transaction_fg_dispatch")] - internal static extern int EnableTransactionForegroundDispatch(); - [DllImport(Libraries.Nfc, EntryPoint = "nfc_manager_disable_transaction_fg_dispatch")] - internal static extern int DisableTransactionForegroundDispatch(); - [DllImport(Libraries.Nfc, EntryPoint = "nfc_manager_get_cached_message")] - internal static extern int GetCachedMessage(out IntPtr ndefMessage); - [DllImport(Libraries.Nfc, EntryPoint = "nfc_manager_set_tag_filter")] - internal static extern void SetTagFilter(int filter); - [DllImport(Libraries.Nfc, EntryPoint = "nfc_manager_get_tag_filter")] - internal static extern int GetTagFilter(); - [DllImport(Libraries.Nfc, EntryPoint = "nfc_manager_get_connected_tag")] - internal static extern int GetConnectedTag(out IntPtr tag); - [DllImport(Libraries.Nfc, EntryPoint = "nfc_manager_get_connected_target")] - internal static extern int GetConnectedTarget(out IntPtr target); - [DllImport(Libraries.Nfc, EntryPoint = "nfc_manager_set_system_handler_enable")] - internal static extern int SetSystemHandlerEnable(bool enable); - [DllImport(Libraries.Nfc, EntryPoint = "nfc_manager_is_system_handler_enabled")] - internal static extern bool IsSystemHandlerEnabled(); - [DllImport(Libraries.Nfc, EntryPoint = "nfc_manager_set_se_type")] - internal static extern int SetSecureElementType(int type); - [DllImport(Libraries.Nfc, EntryPoint = "nfc_manager_get_se_type")] - internal static extern int GetSecureElementType(out int type); - - ////NDEF - NFC Data Exchange Format, TNF - Type Name Format - internal static class NdefRecord - { - [DllImport(Libraries.Nfc, EntryPoint = "nfc_ndef_record_create")] - internal static extern int Create(out IntPtr record, int tnf, byte[] type, int typeSize, byte[] id, int idSize, byte[] payload, uint payloadSize); - [DllImport(Libraries.Nfc, EntryPoint = "nfc_ndef_record_create_text")] - internal static extern int CreateText(out IntPtr record, string text, string languageCode, int encode); - [DllImport(Libraries.Nfc, EntryPoint = "nfc_ndef_record_create_uri")] - internal static extern int CreateUri(out IntPtr record, string uri); - [DllImport(Libraries.Nfc, EntryPoint = "nfc_ndef_record_create_mime")] - internal static extern int CreateMime(out IntPtr record, string mimeType, byte[] data, uint dataSize); - [DllImport(Libraries.Nfc, EntryPoint = "nfc_ndef_record_destroy")] - internal static extern int Destroy(IntPtr record); - [DllImport(Libraries.Nfc, EntryPoint = "nfc_ndef_record_set_id")] - internal static extern int SetId(IntPtr record, byte[] id, int idSize); - [DllImport(Libraries.Nfc, EntryPoint = "nfc_ndef_record_get_id")] - internal static extern int GetId(IntPtr record, out IntPtr id, out int size); - [DllImport(Libraries.Nfc, EntryPoint = "nfc_ndef_record_get_payload")] - internal static extern int GetPayload(IntPtr record, out IntPtr payload, out uint size); - [DllImport(Libraries.Nfc, EntryPoint = "nfc_ndef_record_get_type")] - internal static extern int GetType(IntPtr record, out IntPtr type, out int size); - [DllImport(Libraries.Nfc, EntryPoint = "nfc_ndef_record_get_tnf")] - internal static extern int GetTnf(IntPtr record, out int tnf); - [DllImport(Libraries.Nfc, EntryPoint = "nfc_ndef_record_get_text")] - internal static extern int GetText(IntPtr record, out string text); - [DllImport(Libraries.Nfc, EntryPoint = "nfc_ndef_record_get_langcode")] - internal static extern int GetLanguageCode(IntPtr record, out string languageCode); - [DllImport(Libraries.Nfc, EntryPoint = "nfc_ndef_record_get_encode_type")] - internal static extern int GetEncodeType(IntPtr record, out int encode); - [DllImport(Libraries.Nfc, EntryPoint = "nfc_ndef_record_get_uri")] - internal static extern int GetUri(IntPtr record, out string uri); - [DllImport(Libraries.Nfc, EntryPoint = "nfc_ndef_record_get_mime_type")] - internal static extern int GetMimeType(IntPtr record, out string mimeType); - } - - internal static class NdefMessage - { - [DllImport(Libraries.Nfc, EntryPoint = "nfc_ndef_message_create")] - internal static extern int Create(out IntPtr ndefMessage); - [DllImport(Libraries.Nfc, EntryPoint = "nfc_ndef_message_create_from_rawdata")] - internal static extern int CreateRawData(out IntPtr ndefMessage, byte[] rawData, uint rawDataSize); - [DllImport(Libraries.Nfc, EntryPoint = "nfc_ndef_message_destroy")] - internal static extern int Destroy(IntPtr ndefMessage); - [DllImport(Libraries.Nfc, EntryPoint = "nfc_ndef_message_get_record_count")] - internal static extern int GetRecordCount(IntPtr ndefMessage, out int count); - [DllImport(Libraries.Nfc, EntryPoint = "nfc_ndef_message_get_rawdata")] - internal static extern int GetRawData(IntPtr ndefMessage, out IntPtr rawData, out uint rawDataSize); - [DllImport(Libraries.Nfc, EntryPoint = "nfc_ndef_message_append_record")] - internal static extern int AppendRecord(IntPtr ndefMessage, IntPtr record); - [DllImport(Libraries.Nfc, EntryPoint = "nfc_ndef_message_insert_record")] - internal static extern int InsertRecord(IntPtr ndefMessage, int index, IntPtr record); - [DllImport(Libraries.Nfc, EntryPoint = "nfc_ndef_message_remove_record")] - internal static extern int RemoveRecord(IntPtr ndefMessage, int index); - [DllImport(Libraries.Nfc, EntryPoint = "nfc_ndef_message_get_record")] - internal static extern int GetRecord(IntPtr ndefMessage, int index, out IntPtr record); - } - - internal static class Tag - { - [DllImport(Libraries.Nfc, EntryPoint = "nfc_tag_get_type")] - internal static extern int GetType(IntPtr tag, out int type); - [DllImport(Libraries.Nfc, EntryPoint = "nfc_tag_is_support_ndef")] - internal static extern int IsSupportNdef(IntPtr tag, out bool isSupported); - [DllImport(Libraries.Nfc, EntryPoint = "nfc_tag_get_maximum_ndef_size")] - internal static extern int GetMaximumNdefSize(IntPtr tag, out uint maximunNdefBytesSize); - [DllImport(Libraries.Nfc, EntryPoint = "nfc_tag_get_ndef_size")] - internal static extern int GetNdefSize(IntPtr tag, out uint ndefBytesSize); - [DllImport(Libraries.Nfc, EntryPoint = "nfc_tag_foreach_information")] - internal static extern int ForeachInformation(IntPtr tag, TagInformationCallback callback, IntPtr userData); - [DllImport(Libraries.Nfc, EntryPoint = "nfc_tag_transceive")] - internal static extern int Transceive(IntPtr tag, byte[] buffer, int bufferSize, TagTransceiveCompletedCallback callback, IntPtr userData); - [DllImport(Libraries.Nfc, EntryPoint = "nfc_tag_read_ndef")] - internal static extern int ReadNdef(IntPtr tag, TagReadCompletedCallback callback, IntPtr userData); - [DllImport(Libraries.Nfc, EntryPoint = "nfc_tag_write_ndef")] - internal static extern int WriteNdef(IntPtr tag, IntPtr ndefMessage, VoidCallback callback, IntPtr userData); - [DllImport(Libraries.Nfc, EntryPoint = "nfc_tag_format_ndef")] - internal static extern int FormatNdef(IntPtr tag, byte[] key, int kyeSize, VoidCallback callback, IntPtr userData); - - ////Mifare - } - - ////SNEP - Simple NDEF Exchange Protocol - internal static class P2p - { - [DllImport(Libraries.Nfc, EntryPoint = "nfc_p2p_set_data_received_cb")] - internal static extern int SetDataReceivedCallback(IntPtr target, P2pDataReceivedCallback callback, IntPtr userData); - [DllImport(Libraries.Nfc, EntryPoint = "nfc_p2p_unset_data_received_cb")] - internal static extern int UnsetDataReceivedCallback(IntPtr target); - [DllImport(Libraries.Nfc, EntryPoint = "nfc_p2p_send")] - internal static extern int Send(IntPtr target, IntPtr ndefMessage, VoidCallback callback, IntPtr userData); - [DllImport(Libraries.Nfc, EntryPoint = "nfc_snep_start_server")] - internal static extern int SnepStartServer(IntPtr target, string san, int sap, SnepEventCallback callback, IntPtr userData); - [DllImport(Libraries.Nfc, EntryPoint = "nfc_snep_start_client")] - internal static extern int SnepStartClient(IntPtr target, string san, int sap, SnepEventCallback callback, IntPtr userData); - [DllImport(Libraries.Nfc, EntryPoint = "nfc_snep_send_client_request")] - internal static extern int SnepSendClientRequest(IntPtr snepHandle, int type, IntPtr ndefMessage, SnepEventCallback callback, IntPtr userData); - [DllImport(Libraries.Nfc, EntryPoint = "nfc_snep_stop_service")] - internal static extern int SnepStopService(IntPtr target, IntPtr snepHandle); - [DllImport(Libraries.Nfc, EntryPoint = "nfc_snep_register_server")] - internal static extern int SnepRegisterServer(string san, int sap, SnepEventCallback callback, IntPtr userData); - [DllImport(Libraries.Nfc, EntryPoint = "nfc_snep_unregister_server")] - internal static extern int SnepUnregisterServer(string sam, int sap); - } - - ////SE - Secure Element, HCE - Host Card Emulation, APDU - Application Protocol Data Unit, AID - Application Identifier - internal static class CardEmulation - { - [DllImport(Libraries.Nfc, EntryPoint = "nfc_se_enable_card_emulation")] - internal static extern int EnableCardEmulation(); - [DllImport(Libraries.Nfc, EntryPoint = "nfc_se_disable_card_emulation")] - internal static extern int DisableCardEmulatiion(); - [DllImport(Libraries.Nfc, EntryPoint = "nfc_se_get_card_emulation_mode")] - internal static extern int GetCardEmulationMode(out int type); - [DllImport(Libraries.Nfc, EntryPoint = "nfc_hce_send_apdu_response")] - internal static extern int HceSendApduRespondse(IntPtr seHandle, byte[] response, uint responseLength); - [DllImport(Libraries.Nfc, EntryPoint = "nfc_se_set_default_route")] - internal static extern int SetDefaultRoute(int poweredOnStatus, int poweredOffStatus, int lowBatteryStatus); - [DllImport(Libraries.Nfc, EntryPoint = "nfc_se_is_activated_handler_for_aid")] - internal static extern int IsActivatedHandlerForAid(int seType, string aid, out bool isActivatedHandler); - [DllImport(Libraries.Nfc, EntryPoint = "nfc_se_is_activated_handler_for_category")] - internal static extern int IsActivatedHandlerForCategory(int seType, int category, out bool isActivatedHandler); - [DllImport(Libraries.Nfc, EntryPoint = "nfc_se_register_aid")] - internal static extern int RegisterAid(int seType, int category, string aid); - [DllImport(Libraries.Nfc, EntryPoint = "nfc_se_unregister_aid")] - internal static extern int UnregisterAid(int seType, int category, string aid); - [DllImport(Libraries.Nfc, EntryPoint = "nfc_se_foreach_registered_aids")] - internal static extern int ForeachRegisterdAids(int seType, int category, SecureElementRegisteredAidCallback callback, IntPtr userData); - [DllImport(Libraries.Nfc, EntryPoint = "nfc_se_set_preferred_handler")] - internal static extern int SetPreferredHandler(); - [DllImport(Libraries.Nfc, EntryPoint = "nfc_se_unset_preferred_handler")] - internal static extern int UnsetPreferredHandler(); - } - } -} diff --git a/src/Tizen.Network.Nfc/Tizen.Network.Nfc.csproj b/src/Tizen.Network.Nfc/Tizen.Network.Nfc.csproj deleted file mode 100644 index aeeef3ffc..000000000 --- a/src/Tizen.Network.Nfc/Tizen.Network.Nfc.csproj +++ /dev/null @@ -1,11 +0,0 @@ - - - - netstandard2.0 - - - - - - - diff --git a/src/Tizen.Network.Nfc/Tizen.Network.Nfc.sln b/src/Tizen.Network.Nfc/Tizen.Network.Nfc.sln deleted file mode 100755 index b63abbb95..000000000 --- a/src/Tizen.Network.Nfc/Tizen.Network.Nfc.sln +++ /dev/null @@ -1,40 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26430.12 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Network.Nfc", "Tizen.Network.Nfc.csproj", "{4B797D35-8204-4A77-89B8-3E483487F7A6}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.System.Information", "..\Tizen.System.Information\Tizen.System.Information.csproj", "{DD28E89E-A7AF-41F3-A43A-3694EC14D806}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen", "..\Tizen\Tizen.csproj", "{26B43A98-DA33-447B-861C-B74A1004A092}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Log", "..\Tizen.Log\Tizen.Log.csproj", "{399874C4-6B32-41B6-B05C-835BEA98024C}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {4B797D35-8204-4A77-89B8-3E483487F7A6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {4B797D35-8204-4A77-89B8-3E483487F7A6}.Debug|Any CPU.Build.0 = Debug|Any CPU - {4B797D35-8204-4A77-89B8-3E483487F7A6}.Release|Any CPU.ActiveCfg = Release|Any CPU - {4B797D35-8204-4A77-89B8-3E483487F7A6}.Release|Any CPU.Build.0 = Release|Any CPU - {DD28E89E-A7AF-41F3-A43A-3694EC14D806}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {DD28E89E-A7AF-41F3-A43A-3694EC14D806}.Debug|Any CPU.Build.0 = Debug|Any CPU - {DD28E89E-A7AF-41F3-A43A-3694EC14D806}.Release|Any CPU.ActiveCfg = Release|Any CPU - {DD28E89E-A7AF-41F3-A43A-3694EC14D806}.Release|Any CPU.Build.0 = Release|Any CPU - {26B43A98-DA33-447B-861C-B74A1004A092}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {26B43A98-DA33-447B-861C-B74A1004A092}.Debug|Any CPU.Build.0 = Debug|Any CPU - {26B43A98-DA33-447B-861C-B74A1004A092}.Release|Any CPU.ActiveCfg = Release|Any CPU - {26B43A98-DA33-447B-861C-B74A1004A092}.Release|Any CPU.Build.0 = Release|Any CPU - {399874C4-6B32-41B6-B05C-835BEA98024C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {399874C4-6B32-41B6-B05C-835BEA98024C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {399874C4-6B32-41B6-B05C-835BEA98024C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {399874C4-6B32-41B6-B05C-835BEA98024C}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/src/Tizen.Network.Nfc/Tizen.Network.Nfc/NfcCallbackData.cs b/src/Tizen.Network.Nfc/Tizen.Network.Nfc/NfcCallbackData.cs deleted file mode 100755 index 7c37c14b2..000000000 --- a/src/Tizen.Network.Nfc/Tizen.Network.Nfc/NfcCallbackData.cs +++ /dev/null @@ -1,114 +0,0 @@ -/* - * 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.Collections.Generic; - -namespace Tizen.Network.Nfc -{ - /// - /// This structure contains the information of the Tag data. - /// - /// 3 - public class NfcTagInformation - { - private string _key; - private byte[] _informationValue; - - internal NfcTagInformation(string key, byte[] informationValue) - { - _key = key; - _informationValue = informationValue; - } - - /// - /// Key value. - /// - /// 3 - public string Key - { - get - { - return _key; - } - } - /// - /// Information value. - /// - /// 3 - public byte[] InformationValue - { - get - { - return _informationValue; - } - } - } - - /// - /// This structure contains the information of the secure element AID (Application Identifier). - /// - /// 3 - public class NfcRegisteredAidInformation - { - private NfcSecureElementType _seType; - private string _aid; - private bool _readOnly; - - internal NfcRegisteredAidInformation(NfcSecureElementType seType, string aid, bool readOnly) - { - _seType = seType; - _aid = aid; - _readOnly = readOnly; - } - - /// - /// The Secure Element Type value. - /// - /// 3 - public NfcSecureElementType SeType - { - get - { - return _seType; - } - } - - /// - /// The targeted AID (Application Identifier) value. - /// - /// 3 - public string Aid - { - get - { - return _aid; - } - } - - /// - /// Read-only value. If this value is false, there are restrictions to the operation on this AID. - /// - /// 3 - public bool ReadOnly - { - get - { - return _readOnly; - } - } - } -} diff --git a/src/Tizen.Network.Nfc/Tizen.Network.Nfc/NfcCardEmulationAdapter.cs b/src/Tizen.Network.Nfc/Tizen.Network.Nfc/NfcCardEmulationAdapter.cs deleted file mode 100755 index 1fadabb2d..000000000 --- a/src/Tizen.Network.Nfc/Tizen.Network.Nfc/NfcCardEmulationAdapter.cs +++ /dev/null @@ -1,480 +0,0 @@ -/* - * 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; -using System.Collections.Generic; - -namespace Tizen.Network.Nfc -{ - /// - /// A class for the NFC CardEmulation mode. It allows applications to handle Card Emulation informations. - /// - /// 3 - /// http://tizen.org/privilege/nfc.cardemulation - public class NfcCardEmulationAdapter : IDisposable - { - private bool disposed = false; - - private event EventHandler _secureElementEvent; - private event EventHandler _secureElementTransactionEvent; - private event EventHandler _hostCardEmulationEvent; - - private Interop.Nfc.SecureElementEventCallback _secureElementEventCallback; - private Interop.Nfc.SecureElementTransactionEventCallback _secureElementTransactionEventCallback; - private Interop.Nfc.HostCardEmulationEventCallback _hostCardEmulationEventCallback; - - /// - /// An event that is called when receiving the Secure Element (SIM/UICC(Universal Integrated Circuit Card)) event. - /// - /// 3 - /// http://tizen.org/privilege/nfc.cardemulation - public event EventHandler SecureElementEvent - { - add - { - if (_secureElementEvent == null) - { - RegisterSecureElementEvent(); - } - _secureElementEvent += value; - } - remove - { - _secureElementEvent -= value; - if (_secureElementEvent == null) - { - UnregisterSecureElementEvent(); - } - } - } - - /// - /// An event that is called when receiving the Secure Element (SIM/UICC (Universal Integrated Circuit Card)) transaction event for the 'ESE(SmartMX)' type. - /// - /// 3 - /// http://tizen.org/privilege/nfc.cardemulation - public event EventHandler EseSecureElementTransactionEvent - { - add - { - if (_secureElementTransactionEvent == null) - { - RegisterSecureElementTransactionEvent(NfcSecureElementType.EmbeddedSE); - } - _secureElementTransactionEvent += value; - } - remove - { - _secureElementTransactionEvent -= value; - if (_secureElementTransactionEvent == null) - { - UnregisterSecureElementTransactionEvent(NfcSecureElementType.EmbeddedSE); - } - } - } - - /// - /// An event that is called when receiving the Secure Element (SIM/UICC (Universal Integrated Circuit Card)) transaction event for the 'UICC' type. - /// - /// 3 - /// http://tizen.org/privilege/nfc.cardemulation - public event EventHandler UiccSecureElementTransactionEvent - { - add - { - if (_secureElementTransactionEvent == null) - { - RegisterSecureElementTransactionEvent(NfcSecureElementType.Uicc); - } - _secureElementTransactionEvent += value; - } - remove - { - _secureElementTransactionEvent -= value; - if (_secureElementTransactionEvent == null) - { - UnregisterSecureElementTransactionEvent(NfcSecureElementType.Uicc); - } - } - } - - /// - /// An event that is called when receiving the HCE (Host Card Emulation) event. - /// - /// 3 - /// http://tizen.org/privilege/nfc.cardemulation - public event EventHandler HostCardEmulationEvent - { - add - { - if (_hostCardEmulationEvent == null) - { - RegisterHostCardEmulationEvent(); - } - _hostCardEmulationEvent += value; - } - remove - { - _hostCardEmulationEvent -= value; - if (_hostCardEmulationEvent == null) - { - UnregisterHostCardEmulationEvent(); - } - } - } - - internal NfcCardEmulationAdapter() - { - } - - ~NfcCardEmulationAdapter() - { - Dispose(false); - } - - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - - private void Dispose(bool disposing) - { - if (disposed) - return; - - if (disposing) - { - // Free managed objects. - } - //Free unmanaged objects - disposed = true; - } - - /// - /// Enables the card emulation mode. - /// - /// 3 - /// http://tizen.org/privilege/nfc.cardemulation - /// Thrown when the NFC is not supported. - /// Thrown when the method fails due to an invalid operation. - public void EnableCardEmulation() - { - int ret = Interop.Nfc.CardEmulation.EnableCardEmulation(); - if (ret != (int)NfcError.None) - { - Log.Error(Globals.LogTag, "Failed to enable card emulation mode, Error - " + (NfcError)ret); - NfcErrorFactory.ThrowNfcException(ret); - } - } - - /// - /// Disables the card emulation mode. - /// - /// 3 - /// http://tizen.org/privilege/nfc.cardemulation - /// Thrown when the NFC is not supported. - /// Thrown when the method fails due to an invalid operation. - public void DisableCardEmulation() - { - int ret = Interop.Nfc.CardEmulation.DisableCardEmulatiion(); - if (ret != (int)NfcError.None) - { - Log.Error(Globals.LogTag, "Failed to disable card emulation mode, Error - " + (NfcError)ret); - NfcErrorFactory.ThrowNfcException(ret); - } - } - - /// - /// Gets the current card emulation mode. - /// - /// 3 - /// Enumeration value for the NfcSecureElementCardEmulationMode. - /// http://tizen.org/privilege/nfc.cardemulation - public NfcSecureElementCardEmulationMode GetCardEmulationMode() - { - int mode = 0; - int ret = Interop.Nfc.CardEmulation.GetCardEmulationMode(out mode); - if (ret != (int)NfcError.None) - { - Log.Error(Globals.LogTag, "Failed to get card emulation mode, Error - " + (NfcError)ret); - } - - return (NfcSecureElementCardEmulationMode)mode; - } - - /// - /// Gives the priority to the foreground application when dispatching the transaction event. - /// - /// 3 - /// http://tizen.org/privilege/nfc.cardemulation - /// Thrown when the NFC is not supported. - /// Thrown when the method fails due to an invalid operation. - public void EnableTransactionForegroundDispatch() - { - int ret = Interop.Nfc.EnableTransactionForegroundDispatch(); - if (ret != (int)NfcError.None) - { - Log.Error(Globals.LogTag, "Failed to enable foreground dispatch, Error - " + (NfcError)ret); - NfcErrorFactory.ThrowNfcException(ret); - } - } - - /// - /// Disables the foreground dispatch for the "EVT_TRANSACTION" to the given application. - /// - /// 3 - /// http://tizen.org/privilege/nfc.cardemulation - /// Thrown when the NFC is not supported. - /// Thrown when the method fails due to an invalid operation. - public void DisableTransactionForegroundDispatch() - { - int ret = Interop.Nfc.DisableTransactionForegroundDispatch(); - if (ret != (int)NfcError.None) - { - Log.Error(Globals.LogTag, "Failed to disable foreground dispatch, Error - " + (NfcError)ret); - NfcErrorFactory.ThrowNfcException(ret); - } - } - - /// - /// Gets the state, whether an application to call this API is currently the activated handler for the specific AID. - /// - /// 3 - /// 'True' when application is currently the activated handler, otherwise 'False'. - /// The type of the Secure Element. - /// The application ID specified in the ISO/IEC 7816-4. - /// http://tizen.org/privilege/nfc.cardemulation - /// Thrown when the NFC is not supported. - /// Thrown when the method fails due to an invalid parameter. - /// Thrown when the method fails due to an invalid operation. - public bool IsActivatedHandlerForAid(NfcSecureElementType seType, string aid) - { - bool isActivatedHandle = false; - int ret = Interop.Nfc.CardEmulation.IsActivatedHandlerForAid((int)seType, aid, out isActivatedHandle); - if (ret != (int)NfcError.None) - { - Log.Error(Globals.LogTag, "Failed to check activated handle for aid, Error - " + (NfcError)ret); - NfcErrorFactory.ThrowNfcException(ret); - } - - return isActivatedHandle; - } - - /// - /// Gets the state, whether an application to call this API is currently the activated handler for the category. - /// - /// 3 - /// 'True' when application is currently the activated handler, otherwise 'False'. - /// The type of the secure element. - /// Enumeration value of the category. - /// http://tizen.org/privilege/nfc.cardemulation - /// Thrown when the NFC is not supported. - /// Thrown when the method fails due to an invalid parameter. - /// Thrown when the method fails due to an invalid operation. - public bool IsActivatedHandlerForCategory(NfcSecureElementType seType, NfcCardEmulationCategoryType category) - { - bool isActivatedHandle = false; - int ret = Interop.Nfc.CardEmulation.IsActivatedHandlerForCategory((int)seType, (int)category, out isActivatedHandle); - if (ret != (int)NfcError.None) - { - Log.Error(Globals.LogTag, "Failed to check activated handle for category, Error - " + (NfcError)ret); - NfcErrorFactory.ThrowNfcException(ret); - } - - return isActivatedHandle; - } - - /// - /// Registers the AID for a specific category. - /// - /// 3 - /// The type of the secure element. - /// Enumeration value of the category. - /// The application ID specified in the ISO/IEC 7816-4. - /// http://tizen.org/privilege/nfc.cardemulation - /// Thrown when the NFC is not supported. - /// Thrown when the method fails due to an invalid parameter. - /// Thrown when the method fails due to an invalid operation. - public void RegisterAid(NfcSecureElementType seType, NfcCardEmulationCategoryType category, string aid) - { - int ret = Interop.Nfc.CardEmulation.RegisterAid((int)seType, (int)category, aid); - if (ret != (int)NfcError.None) - { - Log.Error(Globals.LogTag, "Failed to register aid, Error - " + (NfcError)ret); - NfcErrorFactory.ThrowNfcException(ret); - } - } - - /// - /// Unregisters a previously registered AID for the specified category. - /// - /// 3 - /// The type of the secure element. - /// Enumeration value of the category. - /// The application ID specified in the ISO/IEC 7816-4. - /// http://tizen.org/privilege/nfc.cardemulation - /// Thrown when the NFC is not supported. - /// Thrown when the method fails due to an invalid parameter. - /// Thrown when the method fails due to an invalid operation. - public void UnregisterAid(NfcSecureElementType seType, NfcCardEmulationCategoryType category, string aid) - { - int ret = Interop.Nfc.CardEmulation.UnregisterAid((int)seType, (int)category, aid); - if (ret != (int)NfcError.None) - { - Log.Error(Globals.LogTag, "Failed to unregister aid, Error - " + (NfcError)ret); - NfcErrorFactory.ThrowNfcException(ret); - } - } - - /// - /// Sets the application as a preferred handler. - /// - /// 3 - /// http://tizen.org/privilege/nfc.cardemulation - /// Thrown when the NFC is not supported. - /// Thrown when the method fails due to an invalid operation. - public void SetPreferredApplication() - { - int ret = Interop.Nfc.CardEmulation.SetPreferredHandler(); - if (ret != (int)NfcError.None) - { - Log.Error(Globals.LogTag, "Failed to set preferred handler, Error - " + (NfcError)ret); - NfcErrorFactory.ThrowNfcException(ret); - } - } - - /// - /// Unsets the application as a preferred handler. - /// - /// 3 - /// http://tizen.org/privilege/nfc.cardemulation - /// Thrown when the NFC is not supported. - /// Thrown when the method fails due to an invalid operation. - public void UnsetPreferredApplication() - { - int ret = Interop.Nfc.CardEmulation.UnsetPreferredHandler(); - if (ret != (int)NfcError.None) - { - Log.Error(Globals.LogTag, "Failed to unset preferred handler, Error - " + (NfcError)ret); - NfcErrorFactory.ThrowNfcException(ret); - } - } - - /// - /// Retrieves all registered AIDs. - /// - /// 3 - /// The list of NfcRegisteredAidInformation objects. - /// The type of the secure element. - /// Enumeration value of the category. - /// http://tizen.org/privilege/nfc.cardemulation - /// Thrown when the NFC is not supported. - /// Thrown when the method fails due to an invalid parameter. - /// Thrown when the method fails due to an invalid operation. - public IEnumerable GetRegisteredAidInformation(NfcSecureElementType seType, NfcCardEmulationCategoryType category) - { - List infoList = new List(); - Interop.Nfc.SecureElementRegisteredAidCallback callback = (int type, IntPtr aid, bool readOnly, IntPtr userData) => - { - if (aid != IntPtr.Zero) - { - NfcRegisteredAidInformation aidInfo = new NfcRegisteredAidInformation((NfcSecureElementType)type, Marshal.PtrToStringAnsi(aid), readOnly); - - infoList.Add(aidInfo); - } - }; - - int ret = Interop.Nfc.CardEmulation.ForeachRegisterdAids((int)seType, (int)category, callback, IntPtr.Zero); - if (ret != (int)NfcError.None) - { - Log.Error(Globals.LogTag, "Failed to get all registerd aid informations, Error - " + (NfcError)ret); - NfcErrorFactory.ThrowNfcException(ret); - } - - return infoList; - } - - private void RegisterSecureElementEvent() - { - _secureElementEventCallback = (int eventType, IntPtr userData) => - { - NfcSecureElementEvent _eventType = (NfcSecureElementEvent)eventType; - SecureElementEventArgs e = new SecureElementEventArgs(_eventType); - _secureElementEvent.SafeInvoke(null, e); - }; - - int ret = Interop.Nfc.SetSecureElementEventCallback(_secureElementEventCallback, IntPtr.Zero); - if (ret != (int)NfcError.None) - { - Log.Error(Globals.LogTag, "Failed to set secure element event callback, Error - " + (NfcError)ret); - } - } - - private void UnregisterSecureElementEvent() - { - Interop.Nfc.UnsetSecureElementEventCallback(); - } - - private void RegisterSecureElementTransactionEvent(NfcSecureElementType seType) - { - _secureElementTransactionEventCallback = (int type, IntPtr aid, int aidSize, IntPtr param, int paramSize, IntPtr userData) => - { - NfcSecureElementType _secureElementType = (NfcSecureElementType)type; - byte[] _aid = NfcConvertUtil.IntLengthIntPtrToByteArray(aid, aidSize); - byte[] _param = NfcConvertUtil.IntLengthIntPtrToByteArray(param, paramSize); - SecureElementTranscationEventArgs e = new SecureElementTranscationEventArgs(_secureElementType, _aid, _param); - _secureElementTransactionEvent.SafeInvoke(null, e); - }; - - int ret = Interop.Nfc.SetSecureElementTransactionEventCallback((int)seType, _secureElementTransactionEventCallback, IntPtr.Zero); - if (ret != (int)NfcError.None) - { - Log.Error(Globals.LogTag, "Failed to set secure element transaction event callback, Error - " + (NfcError)ret); - } - } - - private void UnregisterSecureElementTransactionEvent(NfcSecureElementType seType) - { - Interop.Nfc.UnsetSecureElementTransactionEventCallback((int)seType); - } - - private void RegisterHostCardEmulationEvent() - { - _hostCardEmulationEventCallback = (IntPtr handle, int eventType, IntPtr apdu, uint apduLen, IntPtr userData) => - { - IntPtr _seHandle = handle; - NfcHceEvent _hcdEventType = (NfcHceEvent)eventType; - byte[] _apdu = NfcConvertUtil.UintLengthIntPtrToByteArray(apdu, apduLen); - HostCardEmulationEventArgs e = new HostCardEmulationEventArgs(_seHandle, _hcdEventType, _apdu); - _hostCardEmulationEvent.SafeInvoke(null, e); - }; - - int ret = Interop.Nfc.SetHostCardEmulationEventCallback(_hostCardEmulationEventCallback, IntPtr.Zero); - if (ret != (int)NfcError.None) - { - Log.Error(Globals.LogTag, "Failed to set host card emulation event callback, Error - " + (NfcError)ret); - NfcErrorFactory.ThrowNfcException(ret); - } - } - - private void UnregisterHostCardEmulationEvent() - { - Interop.Nfc.UnsetHostCardEmulationEventCallback(); - } - } -} diff --git a/src/Tizen.Network.Nfc/Tizen.Network.Nfc/NfcEnumerations.cs b/src/Tizen.Network.Nfc/Tizen.Network.Nfc/NfcEnumerations.cs deleted file mode 100644 index 135a72f64..000000000 --- a/src/Tizen.Network.Nfc/Tizen.Network.Nfc/NfcEnumerations.cs +++ /dev/null @@ -1,440 +0,0 @@ -/* - * 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.Network.Nfc -{ - /// - /// Enumeration for the NFC record TNF (Type Name Format). - /// - /// 3 - public enum NfcRecordTypeNameFormat - { - /// - /// Empty. - /// - /// 3 - Empty = 0, - /// - /// The RTD (Record Type Definition) type format [NFC RTD]. - /// - /// 3 - WellKnown = 1, - /// - /// MIME media types in the RFC 2046 [RFC 2046]. - /// - /// 3 - MimeMedia = 2, - /// - /// The absolute URI as defined in the RFC 3986 [RFC 3986]. - /// - /// 3 - Uri = 3, - /// - /// The NFC forum external type [NFC RTD]. - /// - /// 3 - ExternalRtd = 4, - /// - /// The payload type is unknown. - /// - /// 3 - Unknown = 5, - /// - /// The final chunk of a chunked NDEF record. - /// - /// 3 - UnChanged = 6 - } - - /// - /// Enumeration for the NFC encode type. - /// - /// 3 - public enum NfcEncodeType - { - /// - /// UTF-8. - /// - /// 3 - Utf8 = 0, - /// - /// UTF-16. - /// - /// 3 - Utf16 = 1 - } - /// - /// Enumeration for the NFC tag type. - /// - /// 3 - public enum NfcTagType - { - /// - /// An unknown target. - /// - /// 3 - UnknownTarget = 0x00, - /// - /// The generic PICC. - /// - /// 3 - GenericPicc, - /// - /// The ISO14443 A PICC. - /// - /// 3 - Iso14443APicc, - /// - /// The ISO14443 4A PICC. - /// - /// 3 - Iso144434APicc, - /// - /// The ISO14443 4A PICC. - /// - /// 3 - Iso144433APicc, - /// - /// The Mifare Mini PICC. - /// - /// 3 - MifareMiniPicc, - /// - /// Mifare 1k PICC. - /// - /// 3 - Mifare1kPicc, - /// - /// Mifare 4k PICC. - /// - /// 3 - Mifare4kPicc, - /// - /// The Mifare Ultra PICC. - /// - /// 3 - MifareUltraPicc, - /// - /// The Mifare Desfire PICC. - /// - /// 3 - MifareDesfirePicc, - /// - /// The Iso14443 B PICC. - /// - /// 3 - Iso14443BPicc, - /// - /// Iso14443 4B PICC. - /// - /// 3 - Iso144434BPicc, - /// - /// The ISO14443 B Prime PICC. - /// - /// 3 - Iso14443BPrimePicc, - /// - /// The Felica PICC. - /// - /// 3 - FelicaPicc, - /// - /// The Jewel PICC. - /// - /// 3 - JewelPicc, - /// . - /// - /// 3 - Iso15693Picc, - /// - /// The Barcode 128 PICC. - /// - /// 3 - Barcode128Picc, - /// - /// The Barcode 256 PICC. - /// - /// 3 - Barcode256Picc, - /// - /// The NFCIP1 Target. - /// - /// 3 - NfcIp1Target, - /// - /// The NFCIP1 Initiator. - /// - /// 3 - NfcIp1Initiator - } - /// - /// Enumeration for the NFC tag filter type. - /// - /// 3 - public enum NfcTagFilterType - { - /// - /// All disable. - /// - /// 3 - AllDisable = 0x0000, - /// - /// ISO14443A enable. - /// - /// 3 - Iso14443AEnable = 0x0001, - /// - /// ISO14443B enable. - /// - /// 3 - Iso14443BEnable = 0x0002, - /// - /// ISO15693 enable. - /// - /// 3 - Iso15693Enable = 0x0004, - /// - /// FELICA enable. - /// - /// 3 - FelicaEnable = 0x0008, - /// - /// JEWEL enable. - /// - /// 3 - JewelEnable = 0x0010, - /// - /// IP enable. - /// - /// 3 - IpEnable = 0x0020, - /// - /// All enable. - /// - /// 3 - AllEnable = ~0 - } - /// - /// Enumeration for the NFC discovered type. - /// - /// 3 - public enum NfcDiscoveredType - { - /// - /// Attached, discovered, and activated event. - /// - /// 3 - Attached, - /// - /// Detached, disappeared, and deactivated event. - /// - /// 3 - Detached - } - /// - /// Enumeration for the NFC secure element event. - /// - /// 3 - public enum NfcSecureElementEvent - { - /// - /// Start transaction. - /// - /// 3 - StartTransaction, - /// - /// End transaction. - /// - /// 3 - EndTransaction, - /// - /// Ready signal. - /// - /// 3 - Connectivity, - /// - /// The CLF (Contactless Front-end) detects a RF field. - /// - /// 3 - FieldOn, - /// - /// The CLF (Contactless Front-end) detects that the RF field is off. - /// - /// 3 - FieldOff, - /// - /// An external reader tries to access the secure element. - /// - /// 3 - Transaction, - /// - /// Changing the emulated secure element type. - /// - /// 3 - TypeChanged, - /// - /// Changing the card emulation mode. - /// - /// 3 - CardEmulationChanged - } - /// - /// Enumeration for the NFC filter type. - /// - /// 3 - public enum NfcSecureElementType - { - /// - /// Disable card emulation. - /// - /// 3 - Disable = 0x00, - /// - /// The SmartMX type card emulation (Embedded Secure Element). - /// - /// 3 - EmbeddedSE = 0x01, - /// - /// The UICC type card emulation (Universal IC Card). - /// - /// 3 - Uicc = 0x02, - /// - /// The SDCARD card emulation. - /// - /// 3 - Sdcard = 0x03, - /// - /// The Host based card emulation. - /// - /// 3 - Hce = 0x04 - } - /// - /// Enumeration for the NFC discovered type. - /// - /// 3 - public enum NfcSecureElementCardEmulationMode - { - /// - /// The card emulation mode is OFF. - /// - /// 3 - Off = 0x00, - /// - /// The card emulation mode is ON. - /// - /// 3 - On = 0x01 - } - /// - /// Enumeration for the SNEP (Simple NDEF Exchange Protocol) event. - /// - /// 3 - public enum NfcSnepEvent - { - /// - /// Server or client stopped. - /// - /// 3 - Stop = 0x00, - /// - /// Server started or client connected. - /// - /// 3 - Start = 0x01, - /// - /// Server received get request. - /// - /// 3 - Get = 0x02, - /// - /// Server received put request. - /// - /// 3 - Put = 0x03, - /// - /// Service registered. - /// - /// 3 - Register = 0x04, - /// - /// Service unregistered. - /// - /// 3 - Unregister = 0x05 - } - /// - /// Enumeration for the SNEP request type. - /// - /// 3 - public enum NfcSnepRequestType - { - /// - /// The get request. - /// - /// 3 - Get = 0x01, - /// - /// The put request. - /// - /// 3 - Put = 0x02 - } - /// - /// Enumeration for the NFC card emulation category type. - /// - /// 3 - public enum NfcCardEmulationCategoryType - { - /// - /// NFC payment services. - /// - /// 3 - Payment = 0x01, - /// - /// All other card emulation services. - /// - /// 3 - Other = 0x02 - } - /// - /// Enumeration for the NFC card emulation HCE (Host Card Emulation) event type. - /// - /// 3 - public enum NfcHceEvent - { - /// - /// HCE deactivated. - /// - /// 3 - Deactivated = 0x00, - /// - /// HCE activated. - /// - /// 3 - Activated = 0x01, - /// - /// HCE APDU (Application Protocol Data Unit) received. - /// - /// 3 - ApduReceived = 0x02 - } -} diff --git a/src/Tizen.Network.Nfc/Tizen.Network.Nfc/NfcErrorFactory.cs b/src/Tizen.Network.Nfc/Tizen.Network.Nfc/NfcErrorFactory.cs deleted file mode 100644 index fd6849e31..000000000 --- a/src/Tizen.Network.Nfc/Tizen.Network.Nfc/NfcErrorFactory.cs +++ /dev/null @@ -1,90 +0,0 @@ -/* - * 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.Network.Nfc -{ - /// - /// Enumeration for the NFC Error. - /// - /// 3 - public enum NfcError - { - None = ErrorCode.None, - IoError = ErrorCode.IoError, - InvalidParameterError = ErrorCode.InvalidParameter, - OutOfMemoryError = ErrorCode.OutOfMemory, - TimedOutError = ErrorCode.TimedOut, - DeviceBusyError = ErrorCode.ResourceBusy, - NotSupportedError = ErrorCode.NotSupported, - PermissionDeniedError = ErrorCode.PermissionDenied, - OperationFailedError = -0x01C20000 | 0x01, - InvalidNdefMessageError = -0x01C20000 | 0x02, - InvalidRecordTypeError = -0x01C20000 | 0x03, - NoDeviceError = -0x01C20000 | 0x04, - NotActivatedError = -0x01C20000 | 0x05, - AlreadyActivatedError = -0x01C20000 | 0x06, - AlreadyDeactivatedError = -0x01C20000 | 0x07, - ReadOnlyNdefError = -0x01C20000 | 0x08, - NoSpaceOnNdefError = -0x01C20000 | 0x09, - NoNdefMessageError = -0x01C20000 | 0x0a, - NotNdefFormatError = -0x01C20000 | 0x0b, - SecurityRestrictedError = -0x01C20000 | 0x0c, - IllegalStateError = -0x01C20000 | 0x0d, - NotInitializedError = -0x01C20000 | 0x0e, - TagNotSupportedError = -0x01C20000 | 0x0f, - AidAlreadyRegisteredError = -0x01C20000 | 0x10 - } - - internal static class NfcErrorFactory - { - static internal void ThrowNfcException(int e) - { - ThrowException(e, false); - } - - static internal void ThrowNfcException(int e, int handle) - { - ThrowException(e, (handle < 0)); - } - - static private void ThrowException(int e, bool isHandleNull) - { - NfcError err = (NfcError)e; - - if (isHandleNull) - { - throw new InvalidOperationException("Invalid instance (object may have been disposed or released)"); - } - - if (err == NfcError.InvalidParameterError) - { - throw new ArgumentException(err.ToString()); - } - else if (err == NfcError.NotSupportedError) - { - throw new NotSupportedException(); - } - else - { - throw new InvalidOperationException(err.ToString()); - } - } - - } -} diff --git a/src/Tizen.Network.Nfc/Tizen.Network.Nfc/NfcEventArgs.cs b/src/Tizen.Network.Nfc/Tizen.Network.Nfc/NfcEventArgs.cs deleted file mode 100644 index 48d82ab57..000000000 --- a/src/Tizen.Network.Nfc/Tizen.Network.Nfc/NfcEventArgs.cs +++ /dev/null @@ -1,320 +0,0 @@ -/* - * 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.Collections.Generic; - -namespace Tizen.Network.Nfc -{ - /// - /// An extended EventArgs class which contains the changed NFC activation state. - /// - /// 3 - public class ActivationChangedEventArgs : EventArgs - { - private bool _activated = false; - - internal ActivationChangedEventArgs(bool activated) - { - _activated = activated; - } - - /// - /// The NFC activation state. - /// - /// 3 - public bool Activated - { - get - { - return _activated; - } - } - } - - /// - /// An extended EventArgs class which contains the changed NFC tag discovered. - /// - /// 3 - public class TagDiscoveredEventArgs : EventArgs - { - private NfcDiscoveredType _type = NfcDiscoveredType.Detached; - private NfcTag _tag; - - internal TagDiscoveredEventArgs(NfcDiscoveredType _type, IntPtr tagHandle) - { - _tag = new NfcTag(tagHandle); - } - - /// - /// The tag type. - /// - /// 3 - public NfcDiscoveredType Type - { - get - { - return _type; - } - } - - /// - /// The tag object. - /// - /// 3 - public NfcTag Tag - { - get - { - return _tag; - } - } - } - - /// - /// An extended EventArgs class which contains the changed NFC P2P target discovered. - /// - /// 3 - public class P2pTargetDiscoveredEventArgs : EventArgs - { - private NfcDiscoveredType _type = NfcDiscoveredType.Detached; - private NfcP2p _p2pTarget; - - internal P2pTargetDiscoveredEventArgs(NfcDiscoveredType _type, IntPtr p2pTargetHandle) - { - _p2pTarget = new NfcP2p(p2pTargetHandle); - } - - /// - /// The P2P target type. - /// - /// 3 - public NfcDiscoveredType Type - { - get - { - return _type; - } - } - - /// - /// The P2P object. - /// - /// 3 - public NfcP2p P2pTarget - { - get - { - return _p2pTarget; - } - } - } - - /// - /// An extended EventArgs class which contains the changed NFC NDEF discovered. - /// - /// 3 - public class NdefMessageDiscoveredEventArgs : EventArgs - { - private NfcNdefMessage _ndef; - - internal NdefMessageDiscoveredEventArgs(IntPtr messageHandle) - { - _ndef = new NfcNdefMessage(messageHandle); - } - - /// - /// The NdefMessage object that is most recently received via the NFC P2P mode or the tag mode. - /// - /// 3 - public NfcNdefMessage NdefMessage - { - get - { - return _ndef; - } - } - } - - /// - /// An extended EventArgs class which contains the changed secure element event. - /// - /// 3 - public class SecureElementEventArgs : EventArgs - { - private NfcSecureElementEvent _eventType = NfcSecureElementEvent.StartTransaction; - - internal SecureElementEventArgs(NfcSecureElementEvent eventType) - { - _eventType = eventType; - } - - /// - /// The NFC secure element event. - /// - /// 3 - public NfcSecureElementEvent EventType - { - get - { - return _eventType; - } - } - } - - /// - /// An extended EventArgs class which contains the changed secure element trasaction event. - /// - /// 3 - public class SecureElementTranscationEventArgs : EventArgs - { - private NfcSecureElementType _secureElementType = NfcSecureElementType.Disable; - byte[] _aid; - byte[] _param; - - internal SecureElementTranscationEventArgs(NfcSecureElementType secureElementType, byte[] aid, byte[] param) - { - _secureElementType = secureElementType; - _aid = aid; - _param = param; - } - - /// - /// The NFC secure element type. - /// - /// 3 - public NfcSecureElementType SecureElementType - { - get - { - return _secureElementType; - } - } - /// - /// The NFC secure element AID. - /// - /// 3 - public byte[] ApplicationID - { - get - { - return _aid; - } - } - /// - /// The NFC secure element param. - /// - /// 3 - public byte[] Param - { - get - { - return _param; - } - } - } - - /// - /// An extended EventArgs class which contains the changed HCE (Host Card Emulation) event. - /// - /// 3 - public class HostCardEmulationEventArgs : EventArgs - { - private NfcSecureElement _se; - private NfcHceEvent _hceEvent = NfcHceEvent.Deactivated; - private byte[] _apdu; - - internal HostCardEmulationEventArgs(IntPtr seHandle, NfcHceEvent hcdEvent, byte[] apdu) - { - _se = new NfcSecureElement(seHandle); - _hceEvent = hcdEvent; - _apdu = apdu; - } - - /// - /// The NFC secure element. - /// - /// 3 - public NfcSecureElement SecureElement - { - get - { - return _se; - } - } - /// - /// The NFC HCE event. - /// - /// 3 - public NfcHceEvent HceEvent - { - get - { - return _hceEvent; - } - } - /// - /// The NFC APDU (Application Protocol Data Unit). - /// - /// 3 - public byte[] Apdu - { - get - { - return _apdu; - } - } - } - - /// - /// An extended EventArgs class which contains the changed HCE (Host Card Emulation) event. - /// - /// 3 - public class P2pDataReceivedEventArgs : EventArgs - { - private NfcP2p _p2pTarget; - private NfcNdefMessage _ndefMessage; - - internal P2pDataReceivedEventArgs(IntPtr p2pHandle, IntPtr ndefHandle) - { - _p2pTarget = new NfcP2p(p2pHandle); - _ndefMessage = new NfcNdefMessage(ndefHandle); - } - - /// - /// The NFC P2P target. - /// - /// 3 - public NfcP2p P2pTarget - { - get - { - return _p2pTarget; - } - } - /// - /// The NFC NDEF message. - /// - /// 3 - public NfcNdefMessage NdefMessage - { - get - { - return _ndefMessage; - } - } - } -} diff --git a/src/Tizen.Network.Nfc/Tizen.Network.Nfc/NfcManager.cs b/src/Tizen.Network.Nfc/Tizen.Network.Nfc/NfcManager.cs deleted file mode 100755 index 41fe3cf8e..000000000 --- a/src/Tizen.Network.Nfc/Tizen.Network.Nfc/NfcManager.cs +++ /dev/null @@ -1,473 +0,0 @@ -/* - * 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.Collections.Generic; -using System.Threading.Tasks; -using Tizen.System; - -namespace Tizen.Network.Nfc -{ - /// - /// A class for the NFC management. It allows applications to use the NFC service. - /// - /// 3 - /// http://tizen.org/privilege/nfc - static public class NfcManager - { - /// - /// Checks whether the NFC is supported. - /// - /// 3 - static public bool IsSupported - { - get - { - bool isNfcSupported = false; - - Information.TryGetValue("http://tizen.org/feature/network.nfc", out isNfcSupported); - - if (!isNfcSupported) - { - throw new NotSupportedException(); - } - - try - { - return NfcManagerImpl.Instance.IsSupported; - } - catch (TypeInitializationException e) - { - throw e.InnerException; - } - } - } - - /// - /// The NFC Activation state. - /// - /// 3 - static public bool IsActivated - { - get - { - bool isNfcSupported = false; - - Information.TryGetValue("http://tizen.org/feature/network.nfc", out isNfcSupported); - - if (!isNfcSupported) - { - throw new NotSupportedException(); - } - - try - { - return NfcManagerImpl.Instance.IsActivated; - } - catch (TypeInitializationException e) - { - throw e.InnerException; - } - } - } - - /// - /// The Tag Filter type. - /// - /// 3 - static public NfcTagFilterType TagFilterType - { - get - { - bool isNfcSupported = false; - bool isTagSupported = false; - - Information.TryGetValue("http://tizen.org/feature/network.nfc", out isNfcSupported); - Information.TryGetValue("http://tizen.org/feature/network.nfc.tag", out isTagSupported); - - if (!isNfcSupported || !isTagSupported) - { - throw new NotSupportedException(); - } - - try - { - return NfcManagerImpl.Instance.TagFilterType; - } - catch (TypeInitializationException e) - { - throw e.InnerException; - } - } - set - { - bool isNfcSupported = false; - bool isTagSupported = false; - - Information.TryGetValue("http://tizen.org/feature/network.nfc", out isNfcSupported); - Information.TryGetValue("http://tizen.org/feature/network.nfc.tag", out isTagSupported); - - if (!isNfcSupported || !isTagSupported) - { - throw new NotSupportedException(); - } - - try - { - NfcManagerImpl.Instance.TagFilterType = value; - } - catch (TypeInitializationException e) - { - throw e.InnerException; - } - } - } - - /// - /// The Secure Element type. - /// - /// 3 - /// http://tizen.org/privilege/nfc.cardemulation - static public NfcSecureElementType SecureElementType - { - get - { - bool isNfcSupported = false; - bool isCeSupported = false; - - Information.TryGetValue("http://tizen.org/feature/network.nfc", out isNfcSupported); - Information.TryGetValue("http://tizen.org/feature/network.nfc.cardemulation", out isCeSupported); - - if (!isNfcSupported || !isCeSupported) - { - throw new NotSupportedException(); - } - - try - { - return NfcManagerImpl.Instance.SecureElementType; - } - catch (TypeInitializationException e) - { - throw e.InnerException; - } - } - set - { - bool isNfcSupported = false; - bool isCeSupported = false; - - Information.TryGetValue("http://tizen.org/feature/network.nfc", out isNfcSupported); - Information.TryGetValue("http://tizen.org/feature/network.nfc.cardemulation", out isCeSupported); - - if (!isNfcSupported || !isCeSupported) - { - throw new NotSupportedException(); - } - - try - { - NfcManagerImpl.Instance.SecureElementType = value; - } - catch (TypeInitializationException e) - { - throw e.InnerException; - } - } - } - - /// - /// Enables or disables the system handling for the tag and target discovered event. - /// - /// 3 - /// http://tizen.org/privilege/nfc - static public bool SystemHandlerEnabled - { - get - { - bool isNfcSupported = false; - - Information.TryGetValue("http://tizen.org/feature/network.nfc", out isNfcSupported); - - if (!isNfcSupported) - { - throw new NotSupportedException(); - } - - try - { - return NfcManagerImpl.Instance.SystemHandlerEnabled; - } - catch (TypeInitializationException e) - { - throw e.InnerException; - } - } - set - { - bool isNfcSupported = false; - - Information.TryGetValue("http://tizen.org/feature/network.nfc", out isNfcSupported); - - if (!isNfcSupported) - { - throw new NotSupportedException(); - } - - try - { - NfcManagerImpl.Instance.SystemHandlerEnabled = value; - } - catch (TypeInitializationException e) - { - throw e.InnerException; - } - } - } - - /// - /// The cached NDEF message. - /// - /// 3 - static public NfcNdefMessage CachedNdefMessage - { - get - { - bool isNfcSupported = false; - - Information.TryGetValue("http://tizen.org/feature/network.nfc", out isNfcSupported); - - if (!isNfcSupported) - { - throw new NotSupportedException(); - } - - try - { - return NfcManagerImpl.Instance.CachedNdefMessage; - } - catch (TypeInitializationException e) - { - throw e.InnerException; - } - } - } - - /// - /// Gets the Tag adapter object. - /// - /// 3 - static public NfcTagAdapter GetTagAdapter() - { - bool isNfcSupported = false; - bool isTagSupported = false; - - Information.TryGetValue("http://tizen.org/feature/network.nfc", out isNfcSupported); - Information.TryGetValue("http://tizen.org/feature/network.nfc.tag", out isTagSupported); - - if (!isNfcSupported || !isTagSupported) - { - throw new NotSupportedException(); - } - - try - { - return NfcManagerImpl.Instance.TagAdapter; - } - catch (TypeInitializationException e) - { - throw e.InnerException; - } - } - - /// - /// Gets the P2P adapter object. - /// - /// 3 - static public NfcP2pAdapter GetP2pAdapter() - { - bool isNfcSupported = false; - bool isP2pSupported = false; - - Information.TryGetValue("http://tizen.org/feature/network.nfc", out isNfcSupported); - Information.TryGetValue("http://tizen.org/feature/network.nfc.p2p", out isP2pSupported); - - if (!isNfcSupported || !isP2pSupported) - { - throw new NotSupportedException(); - } - - try - { - return NfcManagerImpl.Instance.P2pAdapter; - } - catch (TypeInitializationException e) - { - throw e.InnerException; - } - } - - /// - /// Gets the Card Emulation adapter object. - /// - /// 3 - static public NfcCardEmulationAdapter GetCardEmulationAdapter() - { - bool isNfcSupported = false; - bool isCeSupported = false; - - Information.TryGetValue("http://tizen.org/feature/network.nfc", out isNfcSupported); - Information.TryGetValue("http://tizen.org/feature/network.nfc.cardemulation", out isCeSupported); - - if (!isNfcSupported || !isCeSupported) - { - throw new NotSupportedException(); - } - - try - { - return NfcManagerImpl.Instance.CardEmulationAdapter; - } - catch (TypeInitializationException e) - { - throw e.InnerException; - } - } - - /// - /// Activates the NFC asynchronously. - /// - /// 3 - /// A task indicates whether the Activate method is done or not. - /// http://tizen.org/privilege/nfc.admin - static public Task SetActivationAsync(bool activation) - { - bool isNfcSupported = false; - - Information.TryGetValue("http://tizen.org/feature/network.nfc", out isNfcSupported); - - if (!isNfcSupported) - { - throw new NotSupportedException(); - } - - try - { - return NfcManagerImpl.Instance.SetActivationAsync(activation); - } - catch (TypeInitializationException e) - { - throw e.InnerException; - } - } - - /// - /// The Activation changed event. - /// - /// 3 - static public event EventHandler ActivationChanged - { - add - { - bool isNfcSupported = false; - - Information.TryGetValue("http://tizen.org/feature/network.nfc", out isNfcSupported); - - if (!isNfcSupported) - { - throw new NotSupportedException(); - } - - try - { - NfcManagerImpl.Instance.ActivationChanged += value; - } - catch (TypeInitializationException e) - { - throw e.InnerException; - } - } - remove - { - bool isNfcSupported = false; - - Information.TryGetValue("http://tizen.org/feature/network.nfc", out isNfcSupported); - - if (!isNfcSupported) - { - throw new NotSupportedException(); - } - - try - { - NfcManagerImpl.Instance.ActivationChanged -= value; - } - catch (TypeInitializationException e) - { - throw e.InnerException; - } - } - } - - /// - /// The NDEF discovered event. - /// - /// 3 - static public event EventHandler NdefMessageDiscovered - { - add - { - bool isNfcSupported = false; - - Information.TryGetValue("http://tizen.org/feature/network.nfc", out isNfcSupported); - - if (!isNfcSupported) - { - throw new NotSupportedException(); - } - - try - { - NfcManagerImpl.Instance.NdefMessageDiscovered += value; - } - catch (TypeInitializationException e) - { - throw e.InnerException; - } - } - remove - { - bool isNfcSupported = false; - - Information.TryGetValue("http://tizen.org/feature/network.nfc", out isNfcSupported); - - if (!isNfcSupported) - { - throw new NotSupportedException(); - } - - try - { - NfcManagerImpl.Instance.NdefMessageDiscovered -= value; - } - catch (TypeInitializationException e) - { - throw e.InnerException; - } - } - } - } -} diff --git a/src/Tizen.Network.Nfc/Tizen.Network.Nfc/NfcManagerEvent.cs b/src/Tizen.Network.Nfc/Tizen.Network.Nfc/NfcManagerEvent.cs deleted file mode 100644 index 7150daa58..000000000 --- a/src/Tizen.Network.Nfc/Tizen.Network.Nfc/NfcManagerEvent.cs +++ /dev/null @@ -1,139 +0,0 @@ -/* - * 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.Threading.Tasks; - -namespace Tizen.Network.Nfc -{ - internal static class EventHandlerExtension - { - internal static void SafeInvoke(this EventHandler evt, object sender, EventArgs e) - { - var handler = evt; - if (handler != null) - { - handler(sender, e); - } - } - internal static void SafeInvoke(this EventHandler evt, object sender, T e) where T : EventArgs - { - var handler = evt; - if (handler != null) - { - handler(sender, e); - } - } - } - - internal partial class NfcManagerImpl - { - private event EventHandler _activationChanged; - private event EventHandler _ndefMessageDiscovered; - - private Interop.Nfc.ActivationChangedCallback _activationChangedCallback; - private Interop.Nfc.NdefMessageDiscoveredCallback _ndefMessageDiscoveredCallback; - - internal event EventHandler ActivationChanged - { - add - { - if (_activationChanged == null) - { - RegisterActivationChangedEvent(); - } - _activationChanged += value; - } - remove - { - _activationChanged -= value; - if (_activationChanged == null) - { - UnregisterActivationChangedEvent(); - } - } - } - - internal event EventHandler NdefMessageDiscovered - { - add - { - if (_ndefMessageDiscovered == null) - { - RegisterNdefMessageDiscoveredEvent(); - } - _ndefMessageDiscovered += value; - } - remove - { - _ndefMessageDiscovered -= value; - if (_ndefMessageDiscovered == null) - { - UnregisterNdefMessageDiscoveredEvent(); - } - } - } - - internal void RemoveAllRegisteredEvent() - { - //unregister all remaining events when this object is released. - if (_activationChanged != null) - { - UnregisterActivationChangedEvent(); - } - } - - private void RegisterActivationChangedEvent() - { - _activationChangedCallback = (bool activated, IntPtr userData) => - { - bool isActivated = activated; - ActivationChangedEventArgs e = new ActivationChangedEventArgs(isActivated); - _activationChanged.SafeInvoke(null, e); - }; - int ret = Interop.Nfc.SetActivationChangedCallback(_activationChangedCallback, IntPtr.Zero); - if (ret != (int)NfcError.None) - { - Log.Error(Globals.LogTag, "Failed to set activation changed callback, Error - " + (NfcError)ret); - } - } - - private void UnregisterActivationChangedEvent() - { - Interop.Nfc.UnsetActivationChangedCallback(); - } - - private void RegisterNdefMessageDiscoveredEvent() - { - _ndefMessageDiscoveredCallback = (IntPtr ndefMessageHandle, IntPtr userData) => - { - NdefMessageDiscoveredEventArgs e = new NdefMessageDiscoveredEventArgs(ndefMessageHandle); - _ndefMessageDiscovered.SafeInvoke(null, e); - }; - - int ret = Interop.Nfc.SetNdefDiscoveredCallback(_ndefMessageDiscoveredCallback, IntPtr.Zero); - if (ret != (int)NfcError.None) - { - Log.Error(Globals.LogTag, "Failed to set ndef message discovered callback, Error - " + (NfcError)ret); - } - } - - private void UnregisterNdefMessageDiscoveredEvent() - { - Interop.Nfc.UnsetNdefDiscoveredCallback(); - } - } -} diff --git a/src/Tizen.Network.Nfc/Tizen.Network.Nfc/NfcManagerImpl.cs b/src/Tizen.Network.Nfc/Tizen.Network.Nfc/NfcManagerImpl.cs deleted file mode 100755 index 702f1b2d3..000000000 --- a/src/Tizen.Network.Nfc/Tizen.Network.Nfc/NfcManagerImpl.cs +++ /dev/null @@ -1,271 +0,0 @@ -/* - * 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.Collections.Generic; -using System.Runtime.InteropServices; -using System.Threading.Tasks; - -namespace Tizen.Network.Nfc -{ - static internal class Globals - { - internal const string LogTag = "Tizen.Network.Nfc"; - } - - internal static class NfcConvertUtil - { - internal static byte[] IntLengthIntPtrToByteArray(IntPtr nativeValue, int length) - { - byte[] value = new byte[length]; - if (nativeValue != IntPtr.Zero) - { - Marshal.Copy(nativeValue, value, 0, length); - } - return value; - } - - internal static byte[] UintLengthIntPtrToByteArray(IntPtr nativeValue, uint length) - { - byte[] value = new byte[length]; - - if (nativeValue != IntPtr.Zero) - { - for (int i = 0; i < length; i++) - { - value[i] = Marshal.ReadByte(nativeValue); - nativeValue += sizeof(byte); - } - } - return value; - } - } - - internal partial class NfcManagerImpl : IDisposable - { - private static readonly NfcManagerImpl _instance = new NfcManagerImpl(); - private static readonly NfcTagAdapter _instanceTagAdapter = new NfcTagAdapter(); - private static readonly NfcP2pAdapter _instanceP2pAdapter = new NfcP2pAdapter(); - private static readonly NfcCardEmulationAdapter _instanceCardEmulationAdapter = new NfcCardEmulationAdapter(); - - private Dictionary _callback_map = new Dictionary(); - private int _requestId = 0; - private bool disposed = false; - - internal static NfcManagerImpl Instance - { - get - { - return _instance; - } - } - - internal NfcTagAdapter TagAdapter - { - get - { - return _instanceTagAdapter; - } - } - - internal NfcP2pAdapter P2pAdapter - { - get - { - return _instanceP2pAdapter; - } - } - - internal NfcCardEmulationAdapter CardEmulationAdapter - { - get - { - return _instanceCardEmulationAdapter; - } - } - - internal bool IsSupported - { - get - { - bool support = Interop.Nfc.IsSupported(); - - return support; - } - } - - internal bool IsActivated - { - get - { - bool active = Interop.Nfc.IsActivated(); - - return active; - } - } - - internal NfcNdefMessage CachedNdefMessage - { - get - { - IntPtr ndef = IntPtr.Zero; ; - int ret = Interop.Nfc.GetCachedMessage(out ndef); - if (ret != (int)NfcError.None) - { - Log.Error(Globals.LogTag, "Failed to get cached ndef message, Error - " + (NfcError)ret); - } - - NfcNdefMessage ndefMessage = new NfcNdefMessage(ndef); - return ndefMessage; - } - } - - internal NfcTagFilterType TagFilterType - { - get - { - int type = Interop.Nfc.GetTagFilter(); - - return (NfcTagFilterType)type; - } - set - { - Interop.Nfc.SetTagFilter((int)value); - } - } - - internal NfcSecureElementType SecureElementType - { - get - { - int type; - int ret = Interop.Nfc.GetSecureElementType(out type); - if (ret != (int)NfcError.None) - { - Log.Error(Globals.LogTag, "Failed to get secure element type, Error - " + (NfcError)ret); - } - return (NfcSecureElementType)type; - } - set - { - int ret = Interop.Nfc.SetSecureElementType((int)value); - if (ret != (int)NfcError.None) - { - Log.Error(Globals.LogTag, "Failed to set secure element type, Error - " + (NfcError)ret); - } - } - } - - internal bool SystemHandlerEnabled - { - get - { - bool systemhandler = Interop.Nfc.IsSystemHandlerEnabled(); - - return systemhandler; - } - set - { - int ret = Interop.Nfc.SetSystemHandlerEnable(value); - if (ret != (int)NfcError.None) - { - Log.Error(Globals.LogTag, "Failed to enable system handler, Error - " + (NfcError)ret); - } - } - } - - private NfcManagerImpl() - { - Initialize(); - } - - ~NfcManagerImpl() - { - Dispose(false); - } - - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - - private void Dispose(bool disposing) - { - if (disposed) - return; - - if (disposing) - { - // Free managed objects. - } - //Free unmanaged objects - Deinitialize(); - disposed = true; - } - - private void Initialize() - { - int ret = Interop.Nfc.Initialize(); - if (ret != (int)NfcError.None) - { - Log.Error(Globals.LogTag, "Failed to Initialize Nfc, Error - " + (NfcError)ret); - NfcErrorFactory.ThrowNfcException(ret); - } - } - - private void Deinitialize() - { - int ret = Interop.Nfc.Deinitialize(); - if (ret != (int)NfcError.None) - { - Log.Error(Globals.LogTag, "Failed to Deinitialize Nfc, Error - " + (NfcError)ret); - } - } - - internal Task SetActivationAsync(bool activation) - { - TaskCompletionSource task = new TaskCompletionSource(); - IntPtr id = IntPtr.Zero; - lock (_callback_map) - { - id = (IntPtr)_requestId++; - _callback_map[id] = (error, key) => - { - Log.Debug(Globals.LogTag, "nfc activated"); - if (error != (int)NfcError.None) - { - Log.Error(Globals.LogTag, "Error occurs during Nfc activating, " + (NfcError)error); - task.SetException(new InvalidOperationException("Error occurs during Nfc activating, " + (NfcError)error)); - } - task.SetResult(true); - lock (_callback_map) - { - _callback_map.Remove(key); - } - }; - - int ret = Interop.Nfc.SetActivation(activation, _callback_map[id], id); - if (ret != (int)NfcError.None) - { - Log.Error(Globals.LogTag, "Failed to activate nfc, Error - " + (NfcError)ret); - NfcErrorFactory.ThrowNfcException(ret); - } - } - return task.Task; - } - } -} diff --git a/src/Tizen.Network.Nfc/Tizen.Network.Nfc/NfcNdefMessage.cs b/src/Tizen.Network.Nfc/Tizen.Network.Nfc/NfcNdefMessage.cs deleted file mode 100755 index 1f74fcc46..000000000 --- a/src/Tizen.Network.Nfc/Tizen.Network.Nfc/NfcNdefMessage.cs +++ /dev/null @@ -1,207 +0,0 @@ -/* - * 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; -using System.Collections.Generic; - -namespace Tizen.Network.Nfc -{ - /// - /// A class for the NDEF Message information. It allows applications to use the NDEF Message information. - /// - /// 3 - public class NfcNdefMessage : IDisposable - { - private bool disposed = false; - private IntPtr _messageHandle = IntPtr.Zero; - private List _recordList = new List(); - - /// - /// The number of records in the NDEF message. - /// - /// 3 - public int RecordCount - { - get - { - int recordCount; - int ret = Interop.Nfc.NdefMessage.GetRecordCount(_messageHandle, out recordCount); - if (ret != (int)NfcError.None) - { - Log.Error(Globals.LogTag, "Failed to get record count, Error - " + (NfcError)ret); - } - return recordCount; - } - } - - /// - /// Creates an object for the access point. - /// - /// 3 - /// Thrown when the NFC is not supported. - /// Thrown when the method fails due to an invalid operation. - public NfcNdefMessage() - { - int ret = Interop.Nfc.NdefMessage.Create(out _messageHandle); - - if (ret != (int)NfcError.None) - { - Log.Error(Globals.LogTag, "Failed to create Ndef message, Error - " + (NfcError)ret); - NfcErrorFactory.ThrowNfcException(ret); - } - } - - internal NfcNdefMessage(IntPtr messageHandle) - { - _messageHandle = messageHandle; - } - - ~NfcNdefMessage() - { - Dispose(false); - } - - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - - private void Dispose(bool disposing) - { - if (disposed) - return; - - if (disposing) - { - // Free managed objects. - int ret = Interop.Nfc.NdefMessage.Destroy(_messageHandle); - - if (ret != (int)NfcError.None) - { - Log.Error(Globals.LogTag, "Failed to destroy ndef message, Error - " + (NfcError)ret); - } - } - //Free unmanaged objects - disposed = true; - } - - /// - /// Appends a record into the NDEF message. - /// - /// 3 - /// Whether the record is appended successfully. - /// The NfcNdefRecord object that will be appended into the NDEF message. - public bool AppendRecord(NfcNdefRecord record) - { - bool isSuccess = true; - - int ret = Interop.Nfc.NdefMessage.AppendRecord(_messageHandle, record.GetHandle()); - if (ret != (int)NfcError.None) - { - Log.Error(Globals.LogTag, "Failed to append record, Error - " + (NfcError)ret); - isSuccess = false; - } - else - { - _recordList.Add(record); - } - - return isSuccess; - } - - /// - /// Inserts a record at the index into the NDEF message. - /// - /// 3 - /// Whether inserting the record succeeded. - /// The index of a record ( starts from 0 ). - /// The NfcNdefRecord object that will be appended into the NDEF message. - public bool InsertRecord(int index, NfcNdefRecord record) - { - bool isSuccess = true; - - int ret = Interop.Nfc.NdefMessage.InsertRecord(_messageHandle, index, record.GetHandle()); - if (ret != (int)NfcError.None) - { - Log.Error(Globals.LogTag, "Failed to insert record, Error - " + (NfcError)ret); - isSuccess = false; - } - else - { - _recordList.Add(record); - } - - return isSuccess; - } - - /// - /// Removes a record at the index into the NDEF message. - /// - /// 3 - /// Whether removing the record succeeded. - /// The index of a record ( starts from 0 ). - public bool RemoveRecord(int index) - { - bool isSuccess = true; - - int ret = Interop.Nfc.NdefMessage.RemoveRecord(_messageHandle, index); - if (ret != (int)NfcError.None) - { - Log.Error(Globals.LogTag, "Failed to remove record, Error - " + (NfcError)ret); - isSuccess = false; - } - - return isSuccess; - } - - /// - /// Gets a record by the index. - /// - /// 3 - /// The NfcNdefRecord object. - /// The index of a record ( starts from 0 ). - public NfcNdefRecord GetRecord(int index) - { - IntPtr recordHandle; - NfcNdefRecord recordObject = null; - - int ret = Interop.Nfc.NdefMessage.GetRecord(_messageHandle, index, out recordHandle); - if (ret != (int)NfcError.None) - { - Log.Error(Globals.LogTag, "Failed to remove record, Error - " + (NfcError)ret); - } - - foreach (NfcNdefRecord recordElement in _recordList) - { - if(recordElement.GetHandle() == recordHandle) - { - Log.Debug(Globals.LogTag, "Find record handle"); - recordObject = recordElement; - break; - } - } - - return recordObject; - } - - internal IntPtr GetHandle() - { - return _messageHandle; - } - } -} diff --git a/src/Tizen.Network.Nfc/Tizen.Network.Nfc/NfcNdefRecord.cs b/src/Tizen.Network.Nfc/Tizen.Network.Nfc/NfcNdefRecord.cs deleted file mode 100755 index 25d330d07..000000000 --- a/src/Tizen.Network.Nfc/Tizen.Network.Nfc/NfcNdefRecord.cs +++ /dev/null @@ -1,322 +0,0 @@ -/* - * 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; -using System.Collections.Generic; - -namespace Tizen.Network.Nfc -{ - /// - /// A class for the NDEF Record information. It allows applications to use the NDEF Record information. - /// - /// 3 - public class NfcNdefRecord : IDisposable - { - private bool disposed = false; - private IntPtr _recordHandle = IntPtr.Zero; - - /// - /// The record ID. - /// - /// 3 - public byte[] Id - { - get - { - IntPtr id; - int idLength; - int ret = Interop.Nfc.NdefRecord.GetId(_recordHandle, out id, out idLength); - if (ret != (int)NfcError.None) - { - Log.Error(Globals.LogTag, "Failed to get id, Error - " + (NfcError)ret); - return null; - } - - return NfcConvertUtil.IntLengthIntPtrToByteArray(id, idLength); - } - } - - /// - /// The record payload. - /// - /// 3 - public byte[] Payload - { - get - { - IntPtr payload; - uint payloadLength; - int ret = Interop.Nfc.NdefRecord.GetPayload(_recordHandle, out payload, out payloadLength); - if (ret != (int)NfcError.None) - { - Log.Error(Globals.LogTag, "Failed to get payload, Error - " + (NfcError)ret); - return null; - } - - return NfcConvertUtil.UintLengthIntPtrToByteArray(payload, payloadLength); - } - } - - /// - /// The record type. - /// - /// 3 - public byte[] Type - { - get - { - IntPtr type; - int typeSize; - int ret = Interop.Nfc.NdefRecord.GetType(_recordHandle, out type, out typeSize); - if (ret != (int)NfcError.None) - { - Log.Error(Globals.LogTag, "Failed to get payload, Error - " + (NfcError)ret); - return null; - } - - return NfcConvertUtil.IntLengthIntPtrToByteArray(type, typeSize); - } - } - - /// - /// The record TNF (Type Name Format) value. - /// - /// 3 - public NfcRecordTypeNameFormat Tnf - { - get - { - int tnf; - int ret = Interop.Nfc.NdefRecord.GetTnf(_recordHandle, out tnf); - if (ret != (int)NfcError.None) - { - Log.Error(Globals.LogTag, "Failed to get tnf, Error - " + (NfcError)ret); - } - return (NfcRecordTypeNameFormat)tnf; - } - } - - /// - /// The text of the text type NDEF record. - /// - /// 3 - public string Text - { - get - { - string text; - int ret = Interop.Nfc.NdefRecord.GetText(_recordHandle, out text); - if (ret != (int)NfcError.None) - { - Log.Error(Globals.LogTag, "Failed to get text, Error - " + (NfcError)ret); - } - return text; - } - } - - /// - /// The language code of the text type NDEF record. - /// - /// 3 - public string LanguageCode - { - get - { - string languageCode; - int ret = Interop.Nfc.NdefRecord.GetLanguageCode(_recordHandle, out languageCode); - if (ret != (int)NfcError.None) - { - Log.Error(Globals.LogTag, "Failed to get language code, Error - " + (NfcError)ret); - } - return languageCode; - } - } - - /// - /// The encoding type of the text type NDEF record. - /// - /// 3 - public NfcEncodeType EncodeType - { - get - { - int encodeType; - int ret = Interop.Nfc.NdefRecord.GetEncodeType(_recordHandle, out encodeType); - if (ret != (int)NfcError.None) - { - Log.Error(Globals.LogTag, "Failed to get encode type, Error - " + (NfcError)ret); - } - return (NfcEncodeType)encodeType; - } - } - - /// - /// The URI of the URI type NDEF record. - /// - /// 3 - public string Uri - { - get - { - string uri; - int ret = Interop.Nfc.NdefRecord.GetUri(_recordHandle, out uri); - if (ret != (int)NfcError.None) - { - Log.Error(Globals.LogTag, "Failed to get uri, Error - " + (NfcError)ret); - } - return uri; - } - } - - /// - /// The mime type of the mime type NDEF record. - /// - /// 3 - public string MimeType - { - get - { - string mimeType; - int ret = Interop.Nfc.NdefRecord.GetMimeType(_recordHandle, out mimeType); - if (ret != (int)NfcError.None) - { - Log.Error(Globals.LogTag, "Failed to get mime type, Error - " + (NfcError)ret); - } - return mimeType; - } - } - - /// - /// Creates a record with a given parameter value. - /// - /// 3 - /// The type name format. - /// The specified type name. - /// The record ID. - /// The payload of this record. - /// The byte size of the payload. - /// Thrown when the NFC is not supported. - /// Thrown when the method fails due to an invalid parameter. - /// Thrown when the method fails due to an invalid operation. - public NfcNdefRecord(NfcRecordTypeNameFormat format, byte[] type, byte[] id, byte[] payload, uint paloadLength) - { - int ret = Interop.Nfc.NdefRecord.Create(out _recordHandle, (int)format, type, type.Length, id, id.Length, payload, paloadLength); - - if (ret != (int)NfcError.None) - { - Log.Error(Globals.LogTag, "Failed to create Ndef record, Error - " + (NfcError)ret); - NfcErrorFactory.ThrowNfcException(ret); - } - } - - /// - /// Creates a record with the text type payload. - /// - /// 3 - /// The encoded text. - /// The language code string value followed by the IANA [RFC 3066] (ex: en-US, ko-KR). - /// The encoding type. - /// Thrown when the NFC is not supported. - /// Thrown when the method fails due to an invalid parameter. - /// Thrown when the method fails due to an invalid operation. - public NfcNdefRecord(string text, string languageCode, NfcEncodeType encode) - { - int ret = Interop.Nfc.NdefRecord.CreateText(out _recordHandle, text, languageCode, (int)encode); - - if (ret != (int)NfcError.None) - { - Log.Error(Globals.LogTag, "Failed to create ndef Text record, Error - " + (NfcError)ret); - NfcErrorFactory.ThrowNfcException(ret); - } - } - - /// - /// Creates a record with the URI type payload. - /// - /// 3 - /// The URI string that will be stored in the payload. - /// Thrown when the NFC is not supported. - /// Thrown when the method fails due to an invalid parameter. - /// Thrown when the method fails due to an invalid operation. - public NfcNdefRecord(string uri) - { - int ret = Interop.Nfc.NdefRecord.CreateUri(out _recordHandle, uri); - - if (ret != (int)NfcError.None) - { - Log.Error(Globals.LogTag, "Failed to create ndef Uri record, Error - " + (NfcError)ret); - NfcErrorFactory.ThrowNfcException(ret); - } - } - - /// - /// Creates a record with the mime type payload. - /// - /// 3 - /// The mime type [RFC 2046] (ex. text/plain, image/jpeg ). This value is stored in the type field. - /// The data in the form of the bytes array. - /// The size of the data. - /// Thrown when the NFC is not supported. - /// Thrown when the method fails due to an invalid parameter. - /// Thrown when the method fails due to an invalid operation. - public NfcNdefRecord(string mimeType, byte[] data, uint dataSize) - { - int ret = Interop.Nfc.NdefRecord.CreateMime(out _recordHandle, mimeType, data, dataSize); - - if (ret != (int)NfcError.None) - { - Log.Error(Globals.LogTag, "Failed to create ndef Mime record, Error - " + (NfcError)ret); - NfcErrorFactory.ThrowNfcException(ret); - } - } - - ~NfcNdefRecord() - { - Dispose(false); - } - - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - - private void Dispose(bool disposing) - { - if (disposed) - return; - - if (disposing) - { - // Free managed objects. - int ret = Interop.Nfc.NdefRecord.Destroy(_recordHandle); - - if (ret != (int)NfcError.None) - { - Log.Error(Globals.LogTag, "Failed to destroy ndef record, Error - " + (NfcError)ret); - } - } - //Free unmanaged objects - disposed = true; - } - - internal IntPtr GetHandle() - { - return _recordHandle; - } - } -} diff --git a/src/Tizen.Network.Nfc/Tizen.Network.Nfc/NfcP2p.cs b/src/Tizen.Network.Nfc/Tizen.Network.Nfc/NfcP2p.cs deleted file mode 100755 index 441bb089a..000000000 --- a/src/Tizen.Network.Nfc/Tizen.Network.Nfc/NfcP2p.cs +++ /dev/null @@ -1,182 +0,0 @@ -/* - * 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; -using System.Collections.Generic; -using System.Threading.Tasks; - -namespace Tizen.Network.Nfc -{ - /// - /// The class for managing the P2P target information. - /// - /// 3 - public class NfcP2p : IDisposable - { - private IntPtr _p2pTargetHandle = IntPtr.Zero; - private bool disposed = false; - - private event EventHandler _p2pDataReceived; - - private Interop.Nfc.P2pDataReceivedCallback _p2pDataReceivedCallback; - - /// - /// The event for receiving data from the NFC peer-to-peer target. - /// - /// 3 - public event EventHandler P2pDataReceived - { - add - { - _p2pDataReceived += value; - } - remove - { - _p2pDataReceived -= value; - } - } - - internal NfcP2p(IntPtr handle) - { - _p2pTargetHandle = handle; - RegisterP2pDataReceivedEvent(); - } - - ~NfcP2p() - { - Dispose(false); - } - - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - - private void Dispose(bool disposing) - { - if (disposed) - return; - - if (disposing) - { - // Free managed objects. - UnregisterP2pDataReceivedEvent(); - } - //Free unmanaged objects - disposed = true; - } - - internal IntPtr GetHandle() - { - return _p2pTargetHandle; - } - - /// - /// Sends data to the NFC peer-to-peer target. - /// - /// 3 - /// The NfcNdefMessage object. - /// http://tizen.org/privilege/nfc - /// Thrown when the NFC is not supported. - /// Thrown when the method fails due to an invalid parameter. - /// Thrown when the method fails due to an invalid operation. - public Task SendNdefMessageAsync(NfcNdefMessage ndefMessage) - { - var task = new TaskCompletionSource(); - - Interop.Nfc.VoidCallback callback = (int result, IntPtr userData) => - { - task.SetResult((NfcError)result); - return; - }; - - int ret = Interop.Nfc.P2p.Send(_p2pTargetHandle, ndefMessage.GetHandle(), callback, IntPtr.Zero); - if (ret != (int)NfcError.None) - { - Log.Error(Globals.LogTag, "Failed to write ndef message, Error - " + (NfcError)ret); - NfcErrorFactory.ThrowNfcException(ret); - } - - return task.Task; - } - - private void RegisterP2pDataReceivedEvent() - { - _p2pDataReceivedCallback = (IntPtr p2pTargetHandle, IntPtr ndefMessageHandle, IntPtr userData) => - { - P2pDataReceivedEventArgs e = new P2pDataReceivedEventArgs(p2pTargetHandle, ndefMessageHandle); - _p2pDataReceived.SafeInvoke(null, e); - }; - - int ret = Interop.Nfc.P2p.SetDataReceivedCallback(_p2pTargetHandle, _p2pDataReceivedCallback, IntPtr.Zero); - if (ret != (int)NfcError.None) - { - Log.Error(Globals.LogTag, "Failed to set p2p target discovered callback, Error - " + (NfcError)ret); - } - } - - private void UnregisterP2pDataReceivedEvent() - { - Interop.Nfc.P2p.UnsetDataReceivedCallback(_p2pTargetHandle); - } - } - - /// - /// The class for managing the SNEP (Simple NDEF Exchange Protocol) information. - /// - /// 3 - public class NfcSnep : IDisposable - { - private IntPtr _snepHandle = IntPtr.Zero; - private bool disposed = false; - - internal NfcSnep(IntPtr handle) - { - _snepHandle = handle; - } - - ~NfcSnep() - { - Dispose(false); - } - - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - - private void Dispose(bool disposing) - { - if (disposed) - return; - - if (disposing) - { - // Free managed objects. - } - //Free unmanaged objects - disposed = true; - } - - internal IntPtr GetHandle() - { - return _snepHandle; - } - } -} diff --git a/src/Tizen.Network.Nfc/Tizen.Network.Nfc/NfcP2pAdapter.cs b/src/Tizen.Network.Nfc/Tizen.Network.Nfc/NfcP2pAdapter.cs deleted file mode 100755 index 6ee377b6f..000000000 --- a/src/Tizen.Network.Nfc/Tizen.Network.Nfc/NfcP2pAdapter.cs +++ /dev/null @@ -1,127 +0,0 @@ -/* - * 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; -using System.Collections.Generic; - -namespace Tizen.Network.Nfc -{ - /// - /// The class for the NFC P2P (Peer-to-Peer) mode. It allows applications to handle P2P informations. - /// - /// 3 - /// http://tizen.org/privilege/nfc - public class NfcP2pAdapter : IDisposable - { - private NfcP2p _p2pTarget; - private bool disposed = false; - - private event EventHandler _p2pTargetDiscovered; - - private Interop.Nfc.P2pTargetDiscoveredCallback _p2pTargetDiscoveredCallback; - - /// - /// The event for receiving the NFC peer-to-peer target discovered notification. - /// - /// 3 - public event EventHandler P2pTargetDiscovered - { - add - { - _p2pTargetDiscovered += value; - } - remove - { - _p2pTargetDiscovered -= value; - } - } - - internal NfcP2pAdapter() - { - RegisterP2pTargetDiscoveredEvent(); - } - - ~NfcP2pAdapter() - { - Dispose(false); - } - - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - - private void Dispose(bool disposing) - { - if (disposed) - return; - - if (disposing) - { - // Free managed objects. - UnregisterP2pTargetDiscoveredEvent(); - } - //Free unmanaged objects - disposed = true; - } - - /// - /// Gets the current connected P2P target. - /// - /// 3 - /// The NfcP2p object. - /// http://tizen.org/privilege/nfc - /// Thrown when the NFC is not supported. - /// Thrown when the method fails due to an invalid operation. - public NfcP2p GetConnectedTarget() - { - IntPtr targetHandle = IntPtr.Zero; - int ret = Interop.Nfc.GetConnectedTarget(out targetHandle); - - if (ret != (int)NfcError.None) - { - Log.Error(Globals.LogTag, "Failed to get connected p2p target, Error - " + (NfcError)ret); - NfcErrorFactory.ThrowNfcException(ret); - } - _p2pTarget = new NfcP2p(targetHandle); - - return _p2pTarget; - } - - private void RegisterP2pTargetDiscoveredEvent() - { - _p2pTargetDiscoveredCallback = (int type, IntPtr p2pTargetHandle, IntPtr userData) => - { - NfcDiscoveredType tagType = (NfcDiscoveredType)type; - P2pTargetDiscoveredEventArgs e = new P2pTargetDiscoveredEventArgs(tagType, p2pTargetHandle); - _p2pTargetDiscovered.SafeInvoke(null, e); - }; - - int ret = Interop.Nfc.SetP2pTargetDiscoveredCallback(_p2pTargetDiscoveredCallback, IntPtr.Zero); - if (ret != (int)NfcError.None) - { - Log.Error(Globals.LogTag, "Failed to set p2p target discovered callback, Error - " + (NfcError)ret); - } - } - - private void UnregisterP2pTargetDiscoveredEvent() - { - Interop.Nfc.UnsetP2pTargetDiscoveredCallback(); - } - } -} diff --git a/src/Tizen.Network.Nfc/Tizen.Network.Nfc/NfcSecureElement.cs b/src/Tizen.Network.Nfc/Tizen.Network.Nfc/NfcSecureElement.cs deleted file mode 100755 index 228890d7e..000000000 --- a/src/Tizen.Network.Nfc/Tizen.Network.Nfc/NfcSecureElement.cs +++ /dev/null @@ -1,86 +0,0 @@ -/* - * 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; -using System.Collections.Generic; - -namespace Tizen.Network.Nfc -{ - /// - /// The class for managing the Secure Element information. - /// - /// 3 - public class NfcSecureElement : IDisposable - { - private IntPtr _secureElementHandle = IntPtr.Zero; - private bool disposed = false; - - internal NfcSecureElement(IntPtr handle) - { - _secureElementHandle = handle; - } - - ~NfcSecureElement() - { - Dispose(false); - } - - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - - private void Dispose(bool disposing) - { - if (disposed) - return; - - if (disposing) - { - // Free managed objects. - } - //Free unmanaged objects - disposed = true; - } - - /// - /// Sends the APDU (Application Protocol Data Unit) response to the CLF (Contactless Front-end). - /// - /// 3 - /// The bytes array of the response data. - /// The size of the response bytes array. - /// http://tizen.org/privilege/nfc.cardemulation - /// Thrown when the NFC is not supported. - /// Thrown when the method fails due to an invalid parameter. - /// Thrown when the method fails due to an invalid operation. - public void HceSendApduResponse(byte[] response, uint responseLength) - { - int ret = Interop.Nfc.CardEmulation.HceSendApduRespondse(_secureElementHandle, response, responseLength); - if (ret != (int)NfcError.None) - { - Log.Error(Globals.LogTag, "Failed to hcd send apdu response, Error - " + (NfcError)ret); - NfcErrorFactory.ThrowNfcException(ret); - } - } - - internal IntPtr GetHandle() - { - return _secureElementHandle; - } - } -} diff --git a/src/Tizen.Network.Nfc/Tizen.Network.Nfc/NfcTag.cs b/src/Tizen.Network.Nfc/Tizen.Network.Nfc/NfcTag.cs deleted file mode 100755 index 883a0d3b2..000000000 --- a/src/Tizen.Network.Nfc/Tizen.Network.Nfc/NfcTag.cs +++ /dev/null @@ -1,298 +0,0 @@ -/* - * 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; -using System.Collections.Generic; -using System.Threading.Tasks; - -namespace Tizen.Network.Nfc -{ - /// - /// The class for managing the Tag information. - /// - /// 3 - public class NfcTag : IDisposable - { - private bool disposed = false; - private IntPtr _tagHandle = IntPtr.Zero; - - /// - /// The type of the NFC tag. - /// - /// 3 - public NfcTagType Type - { - get - { - int type; - int ret = Interop.Nfc.Tag.GetType(_tagHandle, out type); - if (ret != (int)NfcError.None) - { - Log.Error(Globals.LogTag, "Failed to get tag type, Error - " + (NfcError)ret); - } - return (NfcTagType)type; - } - } - - /// - /// Whether the given NFC tag supports the NDEF messages. - /// - /// 3 - public bool IsSupportNdef - { - get - { - bool isSupport; - int ret = Interop.Nfc.Tag.IsSupportNdef(_tagHandle, out isSupport); - if (ret != (int)NfcError.None) - { - Log.Error(Globals.LogTag, "Failed to get support state, Error - " + (NfcError)ret); - } - return isSupport; - - } - } - - /// - /// The maximum NDEF message size that can be stored in the NFC tag. - /// - /// 3 - public uint MaximumNdefSize - { - get - { - uint maxSize; - int ret = Interop.Nfc.Tag.GetMaximumNdefSize(_tagHandle, out maxSize); - if (ret != (int)NfcError.None) - { - Log.Error(Globals.LogTag, "Failed to get max ndef size, Error - " + (NfcError)ret); - } - return maxSize; - } - } - - /// - /// The size of the NDEF message stored in the tag. - /// - /// 3 - public uint NdefSize - { - get - { - uint ndefSize; - int ret = Interop.Nfc.Tag.GetNdefSize(_tagHandle, out ndefSize); - if (ret != (int)NfcError.None) - { - Log.Error(Globals.LogTag, "Failed to get ndef size, Error - " + (NfcError)ret); - } - return ndefSize; - } - } - - internal NfcTag(IntPtr handle) - { - _tagHandle = handle; - } - - ~NfcTag() - { - Dispose(false); - } - - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - - private void Dispose(bool disposing) - { - if (disposed) - return; - - if (disposing) - { - // Free managed objects. - } - //Free unmanaged objects - disposed = true; - } - - /// - /// Retrieves all the tag information. - /// - /// 3 - /// The list of the NfcTagInformation objects. - /// http://tizen.org/privilege/nfc - /// Thrown when the NFC is not supported. - /// Thrown when the method fails due to an invalid operation. - public IEnumerable ForeachInformation() - { - List infoList = new List(); - Interop.Nfc.TagInformationCallback callback = (IntPtr key, IntPtr infoValue, int valueSize, IntPtr userData) => - { - if (key != IntPtr.Zero && infoValue != IntPtr.Zero) - { - NfcTagInformation tagInfo = new NfcTagInformation(Marshal.PtrToStringAnsi(key), new byte[valueSize]); - - Marshal.Copy(infoValue, tagInfo.InformationValue, 0, valueSize); - - infoList.Add(tagInfo); - - return true; - } - return false; - }; - - int ret = Interop.Nfc.Tag.ForeachInformation(_tagHandle, callback, IntPtr.Zero); - if (ret != (int)NfcError.None) - { - Log.Error(Globals.LogTag, "Failed to get all Tag information, Error - " + (NfcError)ret); - NfcErrorFactory.ThrowNfcException(ret); - } - - return infoList; - } - - /// - /// Transceives the data of the raw format card. - /// - /// 3 - /// The binary data for a parameter or additional commands. - /// http://tizen.org/privilege/nfc - /// Thrown when the NFC is not supported. - /// Thrown when the method fails due to an invalid parameter. - /// Thrown when the the method fails due to an invalid operation. - public Task TransceiveAsync(byte[] buffer) - { - var task = new TaskCompletionSource(); - - byte[] resultBuffer = null; - Interop.Nfc.TagTransceiveCompletedCallback callback = (int result, IntPtr resultData, int dataSize, IntPtr userData) => - { - if (result == (int)NfcError.None) - { - resultBuffer = new byte[dataSize]; - Marshal.Copy(resultData, resultBuffer, 0, dataSize); - task.SetResult(resultBuffer); - } - return; - }; - - int ret = Interop.Nfc.Tag.Transceive(_tagHandle, buffer, buffer.Length, callback, IntPtr.Zero); - if (ret != (int)NfcError.None) - { - Log.Error(Globals.LogTag, "Failed to transceive data, Error - " + (NfcError)ret); - NfcErrorFactory.ThrowNfcException(ret); - } - - return task.Task; - } - - /// - /// Reads the NDEF formatted data from the NFC tag. - /// - /// 3 - /// http://tizen.org/privilege/nfc - /// Thrown when the NFC is not supported. - /// Thrown when the method fails due to an invalid operation. - public Task ReadNdefMessageAsync() - { - var task = new TaskCompletionSource(); - - NfcNdefMessage ndefMsg = null; - Interop.Nfc.TagReadCompletedCallback callback = (int result, IntPtr ndefMessage, IntPtr userData) => - { - if (result == (int)NfcError.None) - { - ndefMsg = new NfcNdefMessage(ndefMessage); - task.SetResult(ndefMsg); - - return true; - } - return false; - }; - - int ret = Interop.Nfc.Tag.ReadNdef(_tagHandle, callback, IntPtr.Zero); - if (ret != (int)NfcError.None) - { - Log.Error(Globals.LogTag, "Failed to read ndef message, Error - " + (NfcError)ret); - NfcErrorFactory.ThrowNfcException(ret); - } - - return task.Task; - } - - /// - /// Writes the NDEF formatted data. - /// - /// 3 - /// The NfcNdefMessage object. - /// http://tizen.org/privilege/nfc - /// Thrown when the NFC is not supported. - /// Thrown when the method fails due to an invalid parameter. - /// Thrown when the method fails due to an invalid operation. - public Task WriteNdefMessageAsync(NfcNdefMessage ndefMessage) - { - var task = new TaskCompletionSource(); - - Interop.Nfc.VoidCallback callback = (int result, IntPtr userData) => - { - task.SetResult((NfcError)result); - return; - }; - - int ret = Interop.Nfc.Tag.WriteNdef(_tagHandle, ndefMessage.GetHandle(), callback, IntPtr.Zero); - if (ret != (int)NfcError.None) - { - Log.Error(Globals.LogTag, "Failed to write ndef message, Error - " + (NfcError)ret); - NfcErrorFactory.ThrowNfcException(ret); - } - - return task.Task; - } - - /// - /// Formats the detected tag that can store the NDEF message. - /// - /// 3 - /// The key value that may need to format the tag. - /// http://tizen.org/privilege/nfc - /// Thrown when the NFC is not supported. - /// Thrown when method fails due to an invalid parameter. - /// Thrown when the method fails due to an invalid operation. - public Task FormatNdefMessageAsync(byte[] keyValue) - { - var task = new TaskCompletionSource(); - - Interop.Nfc.VoidCallback callback = (int result, IntPtr userData) => - { - task.SetResult((NfcError)result); - return; - }; - - int ret = Interop.Nfc.Tag.FormatNdef(_tagHandle, keyValue, keyValue.Length, callback, IntPtr.Zero); - if (ret != (int)NfcError.None) - { - Log.Error(Globals.LogTag, "Failed to format ndef message, Error - " + (NfcError)ret); - NfcErrorFactory.ThrowNfcException(ret); - } - - return task.Task; - } - } -} diff --git a/src/Tizen.Network.Nfc/Tizen.Network.Nfc/NfcTagAdapter.cs b/src/Tizen.Network.Nfc/Tizen.Network.Nfc/NfcTagAdapter.cs deleted file mode 100755 index 0f0dbc2c0..000000000 --- a/src/Tizen.Network.Nfc/Tizen.Network.Nfc/NfcTagAdapter.cs +++ /dev/null @@ -1,127 +0,0 @@ -/* - * 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; -using System.Collections.Generic; - -namespace Tizen.Network.Nfc -{ - /// - /// The class for the NFC tag mode. It allows applications to handle the Tag informations. - /// - /// 3 - /// http://tizen.org/privilege/nfc - public class NfcTagAdapter : IDisposable - { - private NfcTag _tag; - private bool disposed = false; - - private event EventHandler _tagDiscovered; - - private Interop.Nfc.TagDiscoveredCallback _tagDiscoveredCallback; - - /// - /// The event for receiving the tag discovered notification. - /// - /// 3 - public event EventHandler TagDiscovered - { - add - { - _tagDiscovered += value; - } - remove - { - _tagDiscovered -= value; - } - } - - internal NfcTagAdapter() - { - RegisterTagDiscoveredEvent(); - } - - ~NfcTagAdapter() - { - Dispose(false); - } - - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - - private void Dispose(bool disposing) - { - if (disposed) - return; - - if (disposing) - { - // Free managed objects. - UnregisterTagDiscoveredEvent(); - } - //Free unmanaged objects - disposed = true; - } - - /// - /// Gets the current connected tag. - /// - /// 3 - /// The NfcTag object. - /// http://tizen.org/privilege/nfc - /// Thrown when the NFC is not supported. - /// Thrown when the method fails due to an invalid operation. - public NfcTag GetConnectedTag() - { - IntPtr tagHandle = IntPtr.Zero; - int ret = Interop.Nfc.GetConnectedTag(out tagHandle); - - if (ret != (int)NfcError.None) - { - Log.Error(Globals.LogTag, "Failed to get connected tag, Error - " + (NfcError)ret); - NfcErrorFactory.ThrowNfcException(ret); - } - _tag = new NfcTag(tagHandle); - - return _tag; - } - - private void RegisterTagDiscoveredEvent() - { - _tagDiscoveredCallback = (int type, IntPtr tagHandle, IntPtr userData) => - { - NfcDiscoveredType tagType = (NfcDiscoveredType)type; - TagDiscoveredEventArgs e = new TagDiscoveredEventArgs(tagType, tagHandle); - _tagDiscovered.SafeInvoke(null, e); - }; - - int ret = Interop.Nfc.SetTagDiscoveredCallback(_tagDiscoveredCallback, IntPtr.Zero); - if (ret != (int)NfcError.None) - { - Log.Error(Globals.LogTag, "Failed to set tag discovered callback, Error - " + (NfcError)ret); - } - } - - private void UnregisterTagDiscoveredEvent() - { - Interop.Nfc.UnsetTagDiscoveredCallback(); - } - } -} diff --git a/src/Tizen.Network.Nsd/Interop/Interop.Libraries.cs b/src/Tizen.Network.Nsd/Interop/Interop.Libraries.cs deleted file mode 100755 index dd080415b..000000000 --- a/src/Tizen.Network.Nsd/Interop/Interop.Libraries.cs +++ /dev/null @@ -1,26 +0,0 @@ -/* - * 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 Dnssd = "libnsd-dns-sd.so.0"; - public const string Ssdp = "libnsd-ssdp.so.0"; - public const string Glib = "libglib-2.0.so.0"; - public const string Libc = "libc.so.6"; - } -} diff --git a/src/Tizen.Network.Nsd/Interop/Interop.Nsd.cs b/src/Tizen.Network.Nsd/Interop/Interop.Nsd.cs deleted file mode 100755 index 5979c1da5..000000000 --- a/src/Tizen.Network.Nsd/Interop/Interop.Nsd.cs +++ /dev/null @@ -1,117 +0,0 @@ -/* - * 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; -using Tizen.Network.Nsd; - -/// -/// Interop class for Nsd -/// -internal static partial class Interop -{ - /// - /// Nsd Native Apis - /// - internal static partial class Nsd - { - internal static class Dnssd - { - //Callback for event - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void ServiceRegisteredCallback(DnssdError result, uint service, IntPtr userData); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void ServiceFoundCallback(DnssdServiceState state, uint service, IntPtr userData); - - //Dns-sd - [DllImport(Libraries.Dnssd, EntryPoint = "dnssd_initialize")] - internal static extern int Initialize(); - [DllImport(Libraries.Dnssd, EntryPoint = "dnssd_deinitialize")] - internal static extern int Deinitialize(); - [DllImport(Libraries.Dnssd, EntryPoint = "dnssd_create_local_service")] - internal static extern int CreateService(string type, out uint service); - [DllImport(Libraries.Dnssd, EntryPoint = "dnssd_destroy_local_service")] - internal static extern int DestroyService(uint service); - [DllImport(Libraries.Dnssd, EntryPoint = "dnssd_service_set_name")] - internal static extern int SetName(uint service, string name); - [DllImport(Libraries.Dnssd, EntryPoint = "dnssd_service_set_port")] - internal static extern int SetPort(uint service, int port); - [DllImport(Libraries.Dnssd, EntryPoint = "dnssd_service_add_txt_record")] - internal static extern int AddTxtRecord(uint service, string key, ushort length, byte[] value); - [DllImport(Libraries.Dnssd, EntryPoint = "dnssd_service_remove_txt_record")] - internal static extern int RemoveTxtRecord(uint service, string key); - [DllImport(Libraries.Dnssd, EntryPoint = "dnssd_service_set_record")] - internal static extern int SetRecord(uint service, ushort type, ushort length, byte[] data); - [DllImport(Libraries.Dnssd, EntryPoint = "dnssd_service_unset_record")] - internal static extern int UnsetRecord(uint service, ushort type); - [DllImport(Libraries.Dnssd, EntryPoint = "dnssd_register_local_service")] - internal static extern int RegisterService(uint service, ServiceRegisteredCallback callback, IntPtr userData); - [DllImport(Libraries.Dnssd, EntryPoint = "dnssd_deregister_local_service")] - internal static extern int DeregisterService(uint service); - [DllImport(Libraries.Dnssd, EntryPoint = "dnssd_start_browsing_service")] - internal static extern int StartBrowsing(string type, out uint browser, ServiceFoundCallback callback, IntPtr userData); - [DllImport(Libraries.Dnssd, EntryPoint = "dnssd_stop_browsing_service")] - internal static extern int StopBrowsing(uint browser); - [DllImport(Libraries.Dnssd, EntryPoint = "dnssd_service_get_type")] - internal static extern int GetType(uint service, out string type); - [DllImport(Libraries.Dnssd, EntryPoint = "dnssd_service_get_name")] - internal static extern int GetName(uint service, out string name); - [DllImport(Libraries.Dnssd, EntryPoint = "dnssd_service_get_ip")] - internal static extern int GetIP(uint service, out string ipV4, out string ipV6); - [DllImport(Libraries.Dnssd, EntryPoint = "dnssd_service_get_port")] - internal static extern int GetPort(uint service, out int port); - [DllImport(Libraries.Dnssd, EntryPoint = "dnssd_service_get_all_txt_record")] - internal static extern int GetAllTxtRecord(uint service, out ushort length, out byte[] value); - } - - internal static class Ssdp - { - //Callback for event - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void ServiceRegisteredCallback(SsdpError result, uint service, IntPtr userData); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void ServiceFoundCallback(SsdpServiceState state, uint service, IntPtr userData); - - //Ssdp - [DllImport(Libraries.Ssdp, EntryPoint = "ssdp_initialize")] - internal static extern int Initialize(); - [DllImport(Libraries.Ssdp, EntryPoint = "ssdp_deinitialize")] - internal static extern int Deinitialize(); - [DllImport(Libraries.Ssdp, EntryPoint = "ssdp_create_local_service")] - internal static extern int CreateService(string target, out uint service); - [DllImport(Libraries.Ssdp, EntryPoint = "ssdp_destroy_local_service")] - internal static extern int DestroyService(uint service); - [DllImport(Libraries.Ssdp, EntryPoint = "ssdp_service_set_usn")] - internal static extern int SetUsn(uint service, string usn); - [DllImport(Libraries.Ssdp, EntryPoint = "ssdp_service_set_url")] - internal static extern int SetUrl(uint service, string url); - [DllImport(Libraries.Ssdp, EntryPoint = "ssdp_service_get_target")] - internal static extern int GetTarget(uint service, out string target); - [DllImport(Libraries.Ssdp, EntryPoint = "ssdp_service_get_usn")] - internal static extern int GetUsn(uint service, out string usn); - [DllImport(Libraries.Ssdp, EntryPoint = "ssdp_service_get_url")] - internal static extern int GetUrl(uint service, out string url); - [DllImport(Libraries.Ssdp, EntryPoint = "ssdp_register_local_service")] - internal static extern int RegisterService(uint service, ServiceRegisteredCallback callback, IntPtr userData); - [DllImport(Libraries.Ssdp, EntryPoint = "ssdp_deregister_local_service")] - internal static extern int DeregisterService(uint service); - [DllImport(Libraries.Ssdp, EntryPoint = "ssdp_start_browsing_service")] - internal static extern int StartBrowsing(string target, out uint browser, ServiceFoundCallback callback, IntPtr userData); - [DllImport(Libraries.Ssdp, EntryPoint = "ssdp_stop_browsing_service")] - internal static extern int StopBrowsing(uint browser); - } - } -} diff --git a/src/Tizen.Network.Nsd/Tizen.Network.Nsd.csproj b/src/Tizen.Network.Nsd/Tizen.Network.Nsd.csproj deleted file mode 100644 index 7f4584ffe..000000000 --- a/src/Tizen.Network.Nsd/Tizen.Network.Nsd.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - netstandard2.0 - - - - - - - - diff --git a/src/Tizen.Network.Nsd/Tizen.Network.Nsd.sln b/src/Tizen.Network.Nsd/Tizen.Network.Nsd.sln deleted file mode 100755 index 931427df6..000000000 --- a/src/Tizen.Network.Nsd/Tizen.Network.Nsd.sln +++ /dev/null @@ -1,34 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26430.12 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Network.Nsd", "Tizen.Network.Nsd.csproj", "{7AA86C38-3C2A-4701-91CF-4B298D0235A3}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen", "..\Tizen\Tizen.csproj", "{41BF88B5-6B3D-4DCA-887D-4EAEF94B4CE1}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Log", "..\Tizen.Log\Tizen.Log.csproj", "{C216D010-4253-42FC-8630-28E0A612BCD6}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {7AA86C38-3C2A-4701-91CF-4B298D0235A3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7AA86C38-3C2A-4701-91CF-4B298D0235A3}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7AA86C38-3C2A-4701-91CF-4B298D0235A3}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7AA86C38-3C2A-4701-91CF-4B298D0235A3}.Release|Any CPU.Build.0 = Release|Any CPU - {41BF88B5-6B3D-4DCA-887D-4EAEF94B4CE1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {41BF88B5-6B3D-4DCA-887D-4EAEF94B4CE1}.Debug|Any CPU.Build.0 = Debug|Any CPU - {41BF88B5-6B3D-4DCA-887D-4EAEF94B4CE1}.Release|Any CPU.ActiveCfg = Release|Any CPU - {41BF88B5-6B3D-4DCA-887D-4EAEF94B4CE1}.Release|Any CPU.Build.0 = Release|Any CPU - {C216D010-4253-42FC-8630-28E0A612BCD6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C216D010-4253-42FC-8630-28E0A612BCD6}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C216D010-4253-42FC-8630-28E0A612BCD6}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C216D010-4253-42FC-8630-28E0A612BCD6}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/src/Tizen.Network.Nsd/Tizen.Network.Nsd/DnssdBrowser.cs b/src/Tizen.Network.Nsd/Tizen.Network.Nsd/DnssdBrowser.cs deleted file mode 100755 index f4e6b1a55..000000000 --- a/src/Tizen.Network.Nsd/Tizen.Network.Nsd/DnssdBrowser.cs +++ /dev/null @@ -1,123 +0,0 @@ -/* - * 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.Network.Nsd -{ - /// - /// This class is used for managing network service discovery using DNSSD. - /// - /// 4 - public class DnssdBrowser : INsdBrowser - { - private string _serviceType; - private uint _browserHandle; - private event EventHandler _serviceFound; - private Interop.Nsd.Dnssd.ServiceFoundCallback _serviceFoundCallback; - - /// - /// This event is raised when a DNSSD service is found during service discovery. - /// - /// 4 - public event EventHandler ServiceFound - { - add - { - _serviceFound += value; - } - - remove - { - _serviceFound -= value; - } - } - - /// - /// A public constructor for DnssdBrowser class to create a DnssdBrowser instance for the given service type. - /// - /// The DNSSD service type - /// 4 - /// http://tizen.org/feature/network.service_discovery.dnssd - /// Thrown when serviceType is null. - /// Thrown when DNSSD is not supported. - public DnssdBrowser(string serviceType) - { - DnssdInitializer dnssdInit = Globals.s_threadDns.Value; - Log.Info(Globals.LogTag, "Initialize ThreadLocal instance = " + dnssdInit); - if(serviceType == null) - { - Log.Debug(Globals.LogTag, "serviceType is null"); - NsdErrorFactory.ThrowDnssdException((int)DnssdError.InvalidParameter); - } - - _serviceType = serviceType; - } - - /// - /// Starts browsing the DNSSD remote service. - /// - /// - /// If there are any services available, ServiceFound event will be invoked. - /// Application will keep browsing for available/unavailable services until it calls StopDiscovery(). - /// - /// 4 - /// http://tizen.org/privilege/internet - /// http://tizen.org/feature/network.service_discovery.dnssd - /// Thrown when any other error occurred. - /// Thrown when DNSSD is not supported. - /// Thrown when permission is denied. - public void StartDiscovery() - { - DnssdInitializer dnssdInit = Globals.s_threadDns.Value; - Log.Info(Globals.LogTag, "Initialize ThreadLocal instance = " + dnssdInit); - - _serviceFoundCallback = (DnssdServiceState state, uint service, IntPtr userData) => - { - if (_serviceFound != null) - { - Log.Info(Globals.LogTag, "Inside Service found callback"); - DnssdService dnsService = new DnssdService(service); - _serviceFound(null, new DnssdServiceFoundEventArgs(state, dnsService)); - } - }; - - int ret = Interop.Nsd.Dnssd.StartBrowsing(_serviceType, out _browserHandle, _serviceFoundCallback, IntPtr.Zero); - if (ret != (int)DnssdError.None) - { - Log.Error(Globals.LogTag, "Failed to discover Dnssd remote service, Error - " + (DnssdError)ret); - NsdErrorFactory.ThrowDnssdException(ret); - } - } - - /// - /// Stops browsing the DNSSD remote service. - /// - /// 4 - /// http://tizen.org/feature/network.service_discovery.dnssd - /// Thrown when any other error occurred. - /// Thrown when DNSSD is not supported. - public void StopDiscovery() - { - int ret = Interop.Nsd.Dnssd.StopBrowsing(_browserHandle); - if (ret != (int)DnssdError.None) - { - Log.Error(Globals.LogTag, "Failed to stop discovery of Dnssd remote service, Error - " + (DnssdError)ret); - NsdErrorFactory.ThrowDnssdException(ret); - } - } - } -} diff --git a/src/Tizen.Network.Nsd/Tizen.Network.Nsd/DnssdService.cs b/src/Tizen.Network.Nsd/Tizen.Network.Nsd/DnssdService.cs deleted file mode 100755 index fdf58805a..000000000 --- a/src/Tizen.Network.Nsd/Tizen.Network.Nsd/DnssdService.cs +++ /dev/null @@ -1,438 +0,0 @@ -/* - * 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.Text; -using System.Threading; -using System.Net; - -namespace Tizen.Network.Nsd -{ - internal class DnssdInitializer - { - internal DnssdInitializer() - { - Globals.DnssdInitialize(); - } - - ~DnssdInitializer() - { - int ret = Interop.Nsd.Dnssd.Deinitialize(); - if (ret != (int)DnssdError.None) - { - Log.Error(Globals.LogTag, "Failed to deinitialize Dnssd, Error - " + (DnssdError)ret); - } - } - } - /// - /// This class is used for managing local service registration and its properties using DNSSD. - /// - /// 4 - public class DnssdService : INsdService - { - private uint _serviceHandle; - private string _serviceType; - private ushort _dnsRecordtype = 16; - private Interop.Nsd.Dnssd.ServiceRegisteredCallback _serviceRegisteredCallback; - - /// - /// Constructor to create DnssdService instance that sets the serviceType to a given value. - /// - /// 4 - /// The DNSSD service type. It is expressed as type followed by protocol, separated by a dot(e.g. "_ftp._tcp"). - /// It must begin with an underscore, followed by 1-15 characters which may be letters, digits or hyphens. - /// - /// http://tizen.org/feature/network.service_discovery.dnssd - /// Thrown while setting this property when DNSSD is not supported. - /// Thrown when serviceType is set to null. - public DnssdService(string serviceType) - { - _serviceType = serviceType; - DnssdInitializeCreateService(); - } - - internal DnssdService(uint service) - { - _serviceHandle = service; - } - - internal void DnssdInitializeCreateService() - { - DnssdInitializer dnssdInit = Globals.s_threadDns.Value; - Log.Info(Globals.LogTag, "Initialize ThreadLocal instance = " + dnssdInit); - int ret = Interop.Nsd.Dnssd.CreateService(_serviceType, out _serviceHandle); - if (ret != (int)DnssdError.None) - { - Log.Error(Globals.LogTag, "Failed to create a local Dnssd service handle, Error - " + (DnssdError)ret); - NsdErrorFactory.ThrowDnssdException(ret); - } - } - - /// - /// Name of DNSSD service. - /// - /// - /// Set Name for only unregistered service created locally. - /// It may be up to 63 bytes. - /// In case of error, null will be returned during get and exception will be thrown during set. - /// - /// 4 - /// http://tizen.org/feature/network.service_discovery.dnssd - /// Thrown while setting this property when DNSSD is not supported. - /// Thrown when Name value is set to null. - /// Thrown while setting this property when any other error occurred. - public string Name - { - get - { - string name; - int ret = Interop.Nsd.Dnssd.GetName(_serviceHandle, out name); - if (ret != (int)DnssdError.None) - { - Log.Error(Globals.LogTag, "Failed to get name of service, Error: " + (DnssdError)ret); - return null; - } - - return name; - } - - set - { - if (!Globals.s_threadDns.IsValueCreated) - { - DnssdInitializeCreateService(); - } - - int ret = Interop.Nsd.Dnssd.SetName(_serviceHandle, value); - if (ret != (int)DnssdError.None) - { - Log.Error(Globals.LogTag, "Failed to set name of service, Error: " + (DnssdError)ret); - NsdErrorFactory.ThrowDnssdException(ret); - } - } - } - - /// - /// Type of DNSSD local/remote service. - /// - /// - /// It is expressed as type followed by protocol, separated by a dot(e.g. "_ftp._tcp"). - /// It must begin with an underscore, followed by 1-15 characters which may be letters, digits or hyphens. - /// In case of error, null will be returned. - /// - /// 4 - public string Type - { - get - { - string type; - int ret = Interop.Nsd.Dnssd.GetType(_serviceHandle, out type); - if (ret != (int)DnssdError.None) - { - Log.Error(Globals.LogTag, "Failed to get type of service, Error: " + (DnssdError)ret); - return null; - } - - return type; - } - } - - /// - /// Port number of DNSSD local/remote service. - /// - /// - /// Set Port for only unregistered service created locally. The default value of Port is 0. - /// In case of error, -1 will be returned during get and exception will be thrown during set. - /// - /// 4 - /// http://tizen.org/feature/network.service_discovery.dnssd - /// Thrown while setting this property when DNSSD is not supported. - /// Thrown if value of Port is set to less than 0 or more than 65535. - /// Thrown while setting this property when any other error occurred. - public int Port - { - get - { - int port; - int ret = Interop.Nsd.Dnssd.GetPort(_serviceHandle, out port); - if (ret != (int)DnssdError.None) - { - Log.Error(Globals.LogTag, "Failed to get port number of Dnssd service, Error: " + (DnssdError)ret); - return -1; - } - - return port; - } - - set - { - if (!Globals.s_threadDns.IsValueCreated) - { - DnssdInitializeCreateService(); - } - - int ret = Interop.Nsd.Dnssd.SetPort(_serviceHandle, value); - if (ret != (int)DnssdError.None) - { - Log.Error(Globals.LogTag, "Failed to set port number of Dnssd service, Error: " + (DnssdError)ret); - NsdErrorFactory.ThrowDnssdException(ret); - } - } - } - - /// - /// IP address of DNSSD remote service. - /// - /// - /// If the remote service has no IPv4 Address, then IPv4Address would contain null and if it has no IPv6 Address, then IPv6Address would contain null. - /// In case of error, null object will be returned. - /// - /// 4 - public IPAddressInformation IP - { - get - { - string IPv4, IPv6; - int ret = Interop.Nsd.Dnssd.GetIP(_serviceHandle, out IPv4, out IPv6); - if (ret != (int)DnssdError.None) - { - Log.Error(Globals.LogTag, "Failed to get the IP of Dnssd remote service, Error: " + (DnssdError)ret); - return null; - } - - IPAddressInformation IPAddressInstance = new IPAddressInformation(IPv4, IPv6); - return IPAddressInstance; - } - } - - private void GetTxtRecord(out ushort length, out byte[] value) - { - int ret = Interop.Nsd.Dnssd.GetAllTxtRecord(_serviceHandle, out length, out value); - if (ret != (int)DnssdError.None) - { - Log.Error(Globals.LogTag, "Failed to get the TXT record, Error: " + (DnssdError)ret); - NsdErrorFactory.ThrowDnssdException(ret); - } - } - - /// - /// Adds the TXT record. - /// - /// - /// TXT record should be added after registering local service using RegisterService(). - /// - /// 4 - /// The key of the TXT record. It must be a null-terminated string with 9 characters or fewer excluding null. It is case insensitive. - /// The value of the TXT record.If null, then "key" will be added with no value. If non-null but value_length is zero, then "key=" will be added with empty value. - /// http://tizen.org/feature/network.service_discovery.dnssd - /// Thrown when DNSSD is not supported. - /// Thrown when value of key is null. - /// Thrown when any other error occurred. - public void AddTXTRecord(string key, string value) - { - byte[] byteValue = Encoding.UTF8.GetBytes(value); - ushort length = Convert.ToUInt16(byteValue.Length); - int ret = Interop.Nsd.Dnssd.AddTxtRecord(_serviceHandle, key, length, byteValue); - if (ret != (int)DnssdError.None) - { - Log.Error(Globals.LogTag, "Failed to add the TXT record, Error: " + (DnssdError)ret); - NsdErrorFactory.ThrowDnssdException(ret); - } - - byte[] txtValue; - ushort txtLength; - GetTxtRecord(out txtLength, out txtValue); - - ret = Interop.Nsd.Dnssd.SetRecord(_serviceHandle, _dnsRecordtype, txtLength, txtValue); - if (ret != (int)DnssdError.None) - { - Log.Error(Globals.LogTag, "Failed to set the DNS resource record, Error: " + (DnssdError)ret); - NsdErrorFactory.ThrowDnssdException(ret); - } - } - - /// - /// Removes the TXT record. - /// - /// 4 - /// The key of the TXT record to be removed. - /// http://tizen.org/feature/network.service_discovery.dnssd - /// Thrown when DNSSD is not supported. - /// Thrown when value of key is null. - /// Thrown when any other error occurred. - public void RemoveTXTRecord(string key) - { - int ret = Interop.Nsd.Dnssd.RemoveTxtRecord(_serviceHandle, key); - if (ret != (int)DnssdError.None) - { - Log.Error(Globals.LogTag, "Failed to remove the TXT record, Error: " + (DnssdError)ret); - NsdErrorFactory.ThrowDnssdException(ret); - } - - byte[] txtValue; - ushort txtLength; - GetTxtRecord(out txtLength, out txtValue); - if (txtLength == 0) - { - ret = Interop.Nsd.Dnssd.UnsetRecord(_serviceHandle, _dnsRecordtype); - if (ret != (int)DnssdError.None) - { - Log.Error(Globals.LogTag, "Failed to unset the DNS resource record, Error: " + (DnssdError)ret); - NsdErrorFactory.ThrowDnssdException(ret); - } - } - } - - /// - /// Registers the DNSSD local service for publishing. - /// - /// Name of the service must be set. - /// 4 - /// http://tizen.org/privilege/internet - /// http://tizen.org/feature/network.service_discovery.dnssd - /// Thrown when any other error occurred. - /// Thrown when DNSSD is not supported. - /// Thrown when permission is denied. - public void RegisterService() - { - if (!Globals.s_threadDns.IsValueCreated) - { - DnssdInitializeCreateService(); - } - - _serviceRegisteredCallback = (DnssdError result, uint service, IntPtr userData) => - { - if (result != DnssdError.None) - { - Log.Error(Globals.LogTag, "Failed to finish the registration of Dnssd local service, Error: " + result); - NsdErrorFactory.ThrowDnssdException((int)result); - } - }; - - int ret = Interop.Nsd.Dnssd.RegisterService(_serviceHandle, _serviceRegisteredCallback, IntPtr.Zero); - if (ret != (int)DnssdError.None) - { - Log.Error(Globals.LogTag, "Failed to register the Dnssd local service, Error: " + (DnssdError)ret); - NsdErrorFactory.ThrowDnssdException(ret); - } - } - - /// - /// Deregisters the DNSSD local service. - /// - /// - /// A local service registered using RegisterService() must be passed. - /// - /// 4 - /// http://tizen.org/feature/network.service_discovery.dnssd - /// Thrown when any other error occurred. - /// Thrown when DNSSD is not supported. - public void DeregisterService() - { - int ret = Interop.Nsd.Dnssd.DeregisterService(_serviceHandle); - if (ret != (int)DnssdError.None) - { - Log.Error(Globals.LogTag, "Failed to deregister the Dnssd local service, Error: " + (DnssdError)ret); - NsdErrorFactory.ThrowDnssdException(ret); - } - } - - #region IDisposable Support - private bool _disposedValue = false; // To detect redundant calls - - private void Dispose(bool disposing) - { - if (!_disposedValue) - { - if (disposing) - { - if (_serviceHandle != 0) - { - int ret = Interop.Nsd.Dnssd.DestroyService(_serviceHandle); - if (ret != (int)DnssdError.None) - { - Log.Error(Globals.LogTag, "Failed to destroy the local Dnssd service handle, Error - " + (DnssdError)ret); - } - } - } - - _disposedValue = true; - } - } - - ~DnssdService() - { - Dispose(false); - } - - /// - /// Disposes the memory allocated to unmanaged resources. - /// - /// 4 - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - #endregion - } - - /// - /// This class manages the IP address properties of DNSSD service. - /// - /// 4 - public class IPAddressInformation - { - private string _ipv4, _ipv6; - internal IPAddressInformation() - { - } - - internal IPAddressInformation(string ipv4, string ipv6) - { - _ipv4 = ipv4; - _ipv6 = ipv6; - } - - /// - /// The IP version 4 address of DNSSD service. - /// - /// 4 - public IPAddress IPv4Address - { - get - { - if (_ipv4 == null) - return IPAddress.Parse("0.0.0.0"); - return IPAddress.Parse(_ipv4); - } - } - - /// - /// The IP version 6 address of DNSSD service. - /// - /// 4 - public IPAddress IPv6Address - { - get - { - if (_ipv6 == null) - return IPAddress.Parse("0:0:0:0:0:0:0:0"); - return IPAddress.Parse(_ipv6); - } - } - } -} diff --git a/src/Tizen.Network.Nsd/Tizen.Network.Nsd/Globals.cs b/src/Tizen.Network.Nsd/Tizen.Network.Nsd/Globals.cs deleted file mode 100755 index d1abff4eb..000000000 --- a/src/Tizen.Network.Nsd/Tizen.Network.Nsd/Globals.cs +++ /dev/null @@ -1,58 +0,0 @@ -/* - * 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.Threading; - -namespace Tizen.Network.Nsd -{ - internal static class Globals - { - internal const string LogTag = "Tizen.Network.Nsd"; - - internal static void DnssdInitialize() - { - int ret = Interop.Nsd.Dnssd.Initialize(); - if(ret!=(int)DnssdError.None) - { - Log.Error(LogTag, "Failed to initialize Dnssd, Error - "+ (DnssdError)ret); - NsdErrorFactory.ThrowDnssdException(ret); - } - } - - internal static void SsdpInitialize() - { - int ret = Interop.Nsd.Ssdp.Initialize(); - if (ret != (int)SsdpError.None) - { - Log.Error(LogTag, "Failed to initialize Ssdp, Error - " + (SsdpError)ret); - NsdErrorFactory.ThrowSsdpException(ret); - } - } - - internal static ThreadLocal s_threadDns = new ThreadLocal(() => - { - Log.Info(LogTag, "Inside Dnssd ThreadLocal delegate"); - return new DnssdInitializer(); - }); - - internal static ThreadLocal s_threadSsd = new ThreadLocal(() => - { - Log.Info(LogTag, "Inside Ssdp ThreadLocal delegate"); - return new SsdpInitializer(); - }); - } -} diff --git a/src/Tizen.Network.Nsd/Tizen.Network.Nsd/INsdBrowser.cs b/src/Tizen.Network.Nsd/Tizen.Network.Nsd/INsdBrowser.cs deleted file mode 100755 index 7fa490abb..000000000 --- a/src/Tizen.Network.Nsd/Tizen.Network.Nsd/INsdBrowser.cs +++ /dev/null @@ -1,52 +0,0 @@ -/* - * 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.Network.Nsd -{ - /// - /// This interface is used for managing network service discovery using DNSSD/SSDP. - /// - public interface INsdBrowser - { - /// - /// Starts browsing the DNSSD/SSDP remote service. - /// - /// - /// If there are any services available, ServiceFound event will be invoked. - /// Application will keep browsing for available/unavailable services until it calls StopDiscovery(). - /// - /// 4 - /// http://tizen.org/privilege/internet - /// http://tizen.org/feature/network.service_discovery.dnssd - /// http://tizen.org/feature/network.service_discovery.ssdp - /// Thrown when any other error occured. - /// Thrown when DNSSD/SSDP is not supported. - /// Thrown when permission is denied. - void StartDiscovery(); - - /// - /// Stops browsing the DNSSD/SSDP remote service. - /// - /// 4 - /// http://tizen.org/feature/network.service_discovery.dnssd - /// http://tizen.org/feature/network.service_discovery.ssdp - /// Thrown when any other error occured. - /// Thrown when DNSSD/SSDP is not supported. - void StopDiscovery(); - } -} diff --git a/src/Tizen.Network.Nsd/Tizen.Network.Nsd/INsdService.cs b/src/Tizen.Network.Nsd/Tizen.Network.Nsd/INsdService.cs deleted file mode 100755 index 7b0c6e350..000000000 --- a/src/Tizen.Network.Nsd/Tizen.Network.Nsd/INsdService.cs +++ /dev/null @@ -1,54 +0,0 @@ -/* - * 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.Network.Nsd -{ - /// - /// This interface is used for managing local service registration using DNSSD/SSDP. - /// - public interface INsdService : IDisposable - { - /// - /// Registers the DNSSD/SSDP local service for publishing. - /// - /// - /// A service created locally must be passed. - /// - /// 4 - /// http://tizen.org/privilege/internet - /// http://tizen.org/feature/network.service_discovery.dnssd - /// http://tizen.org/feature/network.service_discovery.ssdp - /// Thrown when any other error occurred. - /// Thrown when DNSSD/SSDP is not supported. - /// Thrown when permission is denied. - void RegisterService(); - - /// - /// Deregisters the DNSSD/SSDP local service. - /// - /// - /// A local service registered using RegisterService() must be passed. - /// - /// 4 - /// http://tizen.org/feature/network.service_discovery.dnssd - /// http://tizen.org/feature/network.service_discovery.ssdp - /// Thrown when any other error occurred. - /// Thrown when DNSSD/SSDP is not supported. - void DeregisterService(); - } -} diff --git a/src/Tizen.Network.Nsd/Tizen.Network.Nsd/NamespaceDoc.cs b/src/Tizen.Network.Nsd/Tizen.Network.Nsd/NamespaceDoc.cs deleted file mode 100644 index e1e4b6137..000000000 --- a/src/Tizen.Network.Nsd/Tizen.Network.Nsd/NamespaceDoc.cs +++ /dev/null @@ -1,30 +0,0 @@ -/** - -The Tizen.Network.Nsd namespace provides classes to manage the network service discovery protocols. - - -

Overview

-The Nsd API handles two network service discovery protocols: DNS-SD (DNS Service Discovery) and SSDP (Simple Service Discovery Protocol). They allows application to announce local services and search for remote services on a network. - -

Related Features

-To use DNS-SD, declare the following feature requirements in the config file:
-http://tizen.org/feature/network.service_discovery.dnssd -
-To use SSDP, declare the following feature requirements in the config file:
-http://tizen.org/feature/network.service_discovery.ssdp -
- -
- - -The following example demonstrates how to register a DNS-SD local service. - -DnssdService service = new DnssdService("_http._tcp"); -service.Name = "TestService"; -service.Port = "1234"; -service.RegisterService(); - - - -*/ -namespace Tizen.Network.Nsd {} diff --git a/src/Tizen.Network.Nsd/Tizen.Network.Nsd/NsdEnumerations.cs b/src/Tizen.Network.Nsd/Tizen.Network.Nsd/NsdEnumerations.cs deleted file mode 100755 index ce98b1e3b..000000000 --- a/src/Tizen.Network.Nsd/Tizen.Network.Nsd/NsdEnumerations.cs +++ /dev/null @@ -1,93 +0,0 @@ -/* - * 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 Tizen.Internals.Errors; - -namespace Tizen.Network.Nsd -{ - /// - /// Enumeration for DNS-SD service state. - /// - /// 4 - public enum DnssdServiceState - { - /// - /// Available DNS-SD service found. - /// - Available, - /// - /// DNS-SD service not available. - /// - Unavailable, - /// - /// Lookup failure for service name. - /// - ServiceNameLookupFailed, - /// - /// Lookup failure for host name and port number. - /// - HostNameLookupFailed, - /// - /// Lookup failure for IP address. - /// - AddressLookupFailed - } - - /// - /// Enumeration for SSDP service state. - /// - /// 4 - public enum SsdpServiceState - { - /// - /// Available SSDP service found. - /// - Available, - /// - /// SSDP service not available. - /// - Unavailable - } - - internal enum DnssdError - { - None = ErrorCode.None, - OutOfMemory = ErrorCode.OutOfMemory, - PermissionDenied = ErrorCode.PermissionDenied, - InvalidOperation = ErrorCode.InvalidOperation, - InvalidParameter = ErrorCode.InvalidParameter, - NotSupported = ErrorCode.NotSupported, - NotInitialized = -0x01CA0000 | 0x01, - AlreadyRegistered = -0x01CA0000 | 0x02, - NameConflict = -0x01CA0000 | 0x03, - ServiceNotRunning = -0x01CA0000 | 0x04, - ServiceNotFound = -0x01CA0000 | 0x05, - OperationFailed = -0x01CA0000 | 0x06 - } - - internal enum SsdpError - { - None = ErrorCode.None, - OutOfMemory = ErrorCode.OutOfMemory, - PermissionDenied = ErrorCode.PermissionDenied, - InvalidParameter = ErrorCode.InvalidParameter, - NotSupported = ErrorCode.NotSupported, - NotInitialized = -0x01C90000 | 0x01, - OperationFailed = -0x01C90000 | 0x04, - ServiceNotFound = -0x01C90000 | 0x05, - ServiceAlreadyRegistered = -0x01C90000 | 0x06 - } -} diff --git a/src/Tizen.Network.Nsd/Tizen.Network.Nsd/NsdError.cs b/src/Tizen.Network.Nsd/Tizen.Network.Nsd/NsdError.cs deleted file mode 100755 index 3eda75780..000000000 --- a/src/Tizen.Network.Nsd/Tizen.Network.Nsd/NsdError.cs +++ /dev/null @@ -1,77 +0,0 @@ -/* - * 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.Network.Nsd -{ - internal static class NsdErrorFactory - { - internal static void ThrowDnssdException(int exception) - { - DnssdError _error = (DnssdError)exception; - switch (_error) - { - case DnssdError.OutOfMemory: - throw new InvalidOperationException("Out of memory"); - case DnssdError.PermissionDenied: - throw new UnauthorizedAccessException("Permission Denied"); - case DnssdError.InvalidOperation: - throw new InvalidOperationException("Invalid operation"); - case DnssdError.InvalidParameter: - throw new ArgumentException("Invalid parameter"); - case DnssdError.NotSupported: - throw new NotSupportedException("Not supported"); - case DnssdError.NotInitialized: - throw new InvalidOperationException("Not initialized"); - case DnssdError.AlreadyRegistered: - throw new InvalidOperationException("Already registered"); - case DnssdError.NameConflict: - throw new InvalidOperationException("Name conflict"); - case DnssdError.ServiceNotRunning: - throw new InvalidOperationException("Service not running"); - case DnssdError.ServiceNotFound: - throw new InvalidOperationException("Service not found"); - case DnssdError.OperationFailed: - throw new InvalidOperationException("Operation failed"); - } - } - - internal static void ThrowSsdpException(int exception) - { - SsdpError _error = (SsdpError)exception; - switch (_error) - { - case SsdpError.OutOfMemory: - throw new InvalidOperationException("Out of memory"); - case SsdpError.PermissionDenied: - throw new UnauthorizedAccessException("Permission Denied"); - case SsdpError.InvalidParameter: - throw new ArgumentException("Invalid parameter"); - case SsdpError.NotSupported: - throw new NotSupportedException("Not supported"); - case SsdpError.NotInitialized: - throw new InvalidOperationException("Not initialized"); - case SsdpError.OperationFailed: - throw new InvalidOperationException("Operation failed"); - case SsdpError.ServiceNotFound: - throw new InvalidOperationException("Service not found"); - case SsdpError.ServiceAlreadyRegistered: - throw new InvalidOperationException("Service already registered"); - } - } - } -} diff --git a/src/Tizen.Network.Nsd/Tizen.Network.Nsd/NsdEventArgs.cs b/src/Tizen.Network.Nsd/Tizen.Network.Nsd/NsdEventArgs.cs deleted file mode 100755 index b68edc5aa..000000000 --- a/src/Tizen.Network.Nsd/Tizen.Network.Nsd/NsdEventArgs.cs +++ /dev/null @@ -1,100 +0,0 @@ -/* - * 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.Network.Nsd -{ - /// - /// An extended EventArgs class which contains changed service state during service discovery using DNSSD. - /// - /// 4 - public class DnssdServiceFoundEventArgs : EventArgs - { - private DnssdServiceState _state; - private DnssdService _service; - - internal DnssdServiceFoundEventArgs(DnssdServiceState state, DnssdService service) - { - _state = state; - _service = service; - } - - /// - /// DNSSD service state. - /// - /// 4 - public DnssdServiceState State - { - get - { - return _state; - } - } - - /// - /// DNSSD service instance. - /// - /// 4 - public DnssdService Service - { - get - { - return _service; - } - } - } - - /// - /// An extended EventArgs class which contains changed service state during service discovery using SSDP. - /// - /// 4 - public class SsdpServiceFoundEventArgs : EventArgs - { - private SsdpServiceState _state; - private SsdpService _service; - - internal SsdpServiceFoundEventArgs(SsdpServiceState state, SsdpService service) - { - _state = state; - _service = service; - } - - /// - /// SSDP service state. - /// - /// 4 - public SsdpServiceState State - { - get - { - return _state; - } - } - - /// - /// SSDP service instance. - /// - /// 4 - public SsdpService Service - { - get - { - return _service; - } - } - } -} diff --git a/src/Tizen.Network.Nsd/Tizen.Network.Nsd/SsdpBrowser.cs b/src/Tizen.Network.Nsd/Tizen.Network.Nsd/SsdpBrowser.cs deleted file mode 100755 index 69bfd78c0..000000000 --- a/src/Tizen.Network.Nsd/Tizen.Network.Nsd/SsdpBrowser.cs +++ /dev/null @@ -1,123 +0,0 @@ -/* - * 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.Network.Nsd -{ - /// - /// This class is used for managing network service discovery using SSDP. - /// - /// 4 - public class SsdpBrowser : INsdBrowser - { - private string _target; - private uint _browserHandle; - private event EventHandler _serviceFound; - private Interop.Nsd.Ssdp.ServiceFoundCallback _serviceFoundCallback; - - /// - /// This event is raised when service has become available or unavailable during service discovery using SSDP. - /// - /// 4 - public event EventHandler ServiceFound - { - add - { - _serviceFound += value; - } - - remove - { - _serviceFound -= value; - } - } - - /// - /// A public constructor for SsdpBrowser class to create a SsdpBrowser instance for the given target. - /// - /// 4 - /// The target to browse for the service. - /// http://tizen.org/feature/network.service_discovery.ssdp - /// Thrown when target is null. - /// Thrown when SSDP is not supported. - public SsdpBrowser(string target) - { - SsdpInitializer ssdpInit = Globals.s_threadSsd.Value; - Log.Info(Globals.LogTag, "Initialize ThreadLocal instance = " + ssdpInit); - if (target == null) - { - Log.Debug(Globals.LogTag, "target is null"); - NsdErrorFactory.ThrowSsdpException((int)SsdpError.InvalidParameter); - } - - _target = target; - } - - /// - /// Starts browsing the SSDP remote service. - /// - /// - /// If there are any services available, ServiceFound event will be invoked. - /// Application will keep browsing for available/unavailable services until it calls StopDiscovery(). - /// - /// 4 - /// http://tizen.org/feature/network.service_discovery.ssdp - /// Thrown when any other error occured. - /// Thrown when SSDP is not supported. - public void StartDiscovery() - { - SsdpInitializer ssdpInit = Globals.s_threadSsd.Value; - Log.Info(Globals.LogTag, "Initialize ThreadLocal instance = " + ssdpInit); - - _serviceFoundCallback = (SsdpServiceState state, uint service, IntPtr userData) => - { - if (_serviceFound != null) - { - Log.Info(Globals.LogTag, "Inside Service found callback"); - SsdpService ssdpService = new SsdpService(service); - _serviceFound(null, new SsdpServiceFoundEventArgs(state, ssdpService)); - } - }; - - int ret = Interop.Nsd.Ssdp.StartBrowsing(_target, out _browserHandle, _serviceFoundCallback, IntPtr.Zero); - if (ret != (int)SsdpError.None) - { - Log.Error(Globals.LogTag, "Failed to discover Ssdp remote service, Error - " + (SsdpError)ret); - NsdErrorFactory.ThrowSsdpException(ret); - } - } - - /// - /// Stops browsing the SSDP remote service. - /// - /// 4 - /// http://tizen.org/privilege/internet - /// http://tizen.org/feature/network.service_discovery.ssdp - /// Thrown when any other error occured. - /// Thrown when SSDP is not supported. - /// Thrown when permission is denied. - public void StopDiscovery() - { - int ret = Interop.Nsd.Ssdp.StopBrowsing(_browserHandle); - if (ret != (int)SsdpError.None) - { - Log.Error(Globals.LogTag, "Failed to stop discovery of Ssdp remote service, Error - " + (SsdpError)ret); - NsdErrorFactory.ThrowSsdpException(ret); - } - } - } -} diff --git a/src/Tizen.Network.Nsd/Tizen.Network.Nsd/SsdpService.cs b/src/Tizen.Network.Nsd/Tizen.Network.Nsd/SsdpService.cs deleted file mode 100755 index 06cc83d9b..000000000 --- a/src/Tizen.Network.Nsd/Tizen.Network.Nsd/SsdpService.cs +++ /dev/null @@ -1,281 +0,0 @@ -/* - * 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.Threading; - -namespace Tizen.Network.Nsd -{ - internal class SsdpInitializer - { - internal SsdpInitializer() - { - Globals.SsdpInitialize(); - } - - ~SsdpInitializer() - { - int ret = Interop.Nsd.Ssdp.Deinitialize(); - if (ret != (int)SsdpError.None) - { - Log.Error(Globals.LogTag, "Failed to deinitialize Ssdp, Error - " + (SsdpError)ret); - } - } - } - - /// - /// This class is used for managing local service registration and its properties using SSDP. - /// - /// 4 - public class SsdpService : INsdService - { - private uint _serviceHandle; - private string _target; - private Interop.Nsd.Ssdp.ServiceRegisteredCallback _serviceRegisteredCallback; - - /// - /// Constructor to create SsdpService instance that sets the target to a given value. - /// - /// 4 - /// The SSDP local service's target. It may be a device type or a service type. - /// http://tizen.org/feature/network.service_discovery.ssdp - /// Thrown while setting this property when SSDP is not supported. - /// Thrown when target is set to null. - public SsdpService(string target) - { - _target = target; - SsdpInitializeCreateService(); - } - - internal SsdpService(uint service) - { - _serviceHandle = service; - } - - internal void SsdpInitializeCreateService() - { - SsdpInitializer ssdpInit = Globals.s_threadSsd.Value; - Log.Info(Globals.LogTag, "Initialize ThreadLocal instance = " + ssdpInit); - int ret = Interop.Nsd.Ssdp.CreateService(_target, out _serviceHandle); - if (ret != (int)SsdpError.None) - { - Log.Error(Globals.LogTag, "Failed to create a local Ssdp service handle, Error - " + (SsdpError)ret); - NsdErrorFactory.ThrowSsdpException(ret); - } - } - - /// - /// Unique Service Name of SSDP service. - /// - /// - /// Set Usn for only unregistered service created locally. If service is already registered, Usn will not be set. - /// In case of error, null will be returned during get and exception will be thrown during set. - /// - /// 4 - /// http://tizen.org/feature/network.service_discovery.ssdp - /// Thrown while setting this property when SSDP is not supported. - /// Thrown when Usn value is set to null. - /// Thrown while setting this property when any other error occurred. - public string Usn - { - get - { - string usn; - int ret = Interop.Nsd.Ssdp.GetUsn(_serviceHandle, out usn); - if (ret != (int)SsdpError.None) - { - Log.Error(Globals.LogTag, "Failed to get usn of service, Error: " + (SsdpError)ret); - return null; - } - - return usn; - } - - set - { - if (!Globals.s_threadSsd.IsValueCreated) - { - SsdpInitializeCreateService(); - } - - int ret = Interop.Nsd.Ssdp.SetUsn(_serviceHandle, value); - if (ret != (int)SsdpError.None) - { - Log.Error(Globals.LogTag, "Failed to set usn of service, Error: " + (SsdpError)ret); - NsdErrorFactory.ThrowSsdpException(ret); - } - } - } - - /// - /// Target of SSDP service. - /// - /// - /// It may be a device type or a service type specified in UPnP forum (http://upnp.org). - /// In case of error, null will be returned. - /// - /// 4 - public string Target - { - get - { - string target; - int ret = Interop.Nsd.Ssdp.GetTarget(_serviceHandle, out target); - if (ret != (int)SsdpError.None) - { - Log.Error(Globals.LogTag, "Failed to get target of service, Error: " + (SsdpError)ret); - return null; - } - - return target; - } - } - - /// - /// URL of SSDP service. - /// - /// - /// Set Url for only unregistered service created locally. If service is already registered, Url will not be set. - /// In case of error, null will be returned during get and exception will be thrown during set. - /// - /// 4 - /// http://tizen.org/feature/network.service_discovery.ssdp - /// Thrown while setting this property when SSDP is not supported. - /// Thrown when Url value is set to null. - /// Thrown while setting this property when any other error occurred. - public string Url - { - get - { - string url; - int ret = Interop.Nsd.Ssdp.GetUrl(_serviceHandle, out url); - if (ret != (int)SsdpError.None) - { - Log.Error(Globals.LogTag, "Failed to get url of Ssdp service, Error: " + (SsdpError)ret); - return null; - } - - return url; - } - - set - { - if (!Globals.s_threadSsd.IsValueCreated) - { - SsdpInitializeCreateService(); - } - - int ret = Interop.Nsd.Ssdp.SetUrl(_serviceHandle, value); - if (ret != (int)SsdpError.None) - { - Log.Error(Globals.LogTag, "Failed to set url of Ssdp service, Error: " + (SsdpError)ret); - NsdErrorFactory.ThrowSsdpException(ret); - } - } - } - - /// - /// Registers the SSDP local service for publishing. - /// - /// - /// A service created locally must be passed. - /// Url and Usn of the service must be set before RegisterService is called. - /// - /// 4 - /// http://tizen.org/privilege/internet - /// http://tizen.org/feature/network.service_discovery.ssdp - /// Thrown when any other error occurred. - /// Thrown when SSDP is not supported. - /// Thrown when permission is denied. - public void RegisterService() - { - if (!Globals.s_threadSsd.IsValueCreated) - { - SsdpInitializeCreateService(); - } - - _serviceRegisteredCallback = (SsdpError result, uint service, IntPtr userData) => - { - }; - - int ret = Interop.Nsd.Ssdp.RegisterService(_serviceHandle, _serviceRegisteredCallback, IntPtr.Zero); - if (ret != (int)SsdpError.None) - { - Log.Error(Globals.LogTag, "Failed to register the Ssdp local service, Error: " + (SsdpError)ret); - NsdErrorFactory.ThrowSsdpException(ret); - } - } - - /// - /// Deregisters the SSDP local service. - /// - /// - /// A local service registered using RegisterService() must be passed. - /// - /// 4 - /// http://tizen.org/feature/network.service_discovery.ssdp - /// Thrown when any other error occurred. - /// Thrown when SSDP is not supported. - public void DeregisterService() - { - int ret = Interop.Nsd.Ssdp.DeregisterService(_serviceHandle); - if (ret != (int)SsdpError.None) - { - Log.Error(Globals.LogTag, "Failed to deregister the Ssdp local service, Error: " + (SsdpError)ret); - NsdErrorFactory.ThrowSsdpException(ret); - } - } - - #region IDisposable Support - private bool _disposedValue = false; // To detect redundant calls - - private void Dispose(bool disposing) - { - if (!_disposedValue) - { - if (disposing) - { - if (_serviceHandle != 0) - { - int ret = Interop.Nsd.Ssdp.DestroyService(_serviceHandle); - if (ret != (int)SsdpError.None) - { - Log.Error(Globals.LogTag, "Failed to destroy the local Ssdp service handle, Error - " + (SsdpError)ret); - } - } - } - - _disposedValue = true; - } - } - - ~SsdpService() - { - Dispose(false); - } - - /// - /// Disposes the memory allocated to unmanaged resources. - /// - /// 4 - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - #endregion - } -} diff --git a/src/Tizen.Network.Smartcard/Interop/Interop.Glib.cs b/src/Tizen.Network.Smartcard/Interop/Interop.Glib.cs deleted file mode 100644 index 576a6e287..000000000 --- a/src/Tizen.Network.Smartcard/Interop/Interop.Glib.cs +++ /dev/null @@ -1,30 +0,0 @@ -/* - * 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 Glib - { - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool GSourceFunc(IntPtr userData); - - [DllImport(Libraries.Glib, EntryPoint = "g_idle_add", CallingConvention = CallingConvention.Cdecl)] - internal static extern uint IdleAdd(GSourceFunc d, IntPtr data); - } -} diff --git a/src/Tizen.Network.Smartcard/Interop/Interop.Libc.cs b/src/Tizen.Network.Smartcard/Interop/Interop.Libc.cs deleted file mode 100644 index 825599e27..000000000 --- a/src/Tizen.Network.Smartcard/Interop/Interop.Libc.cs +++ /dev/null @@ -1,27 +0,0 @@ -/* - * 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 Libc - { - [DllImport(Libraries.Libc, EntryPoint = "free", CallingConvention = CallingConvention.Cdecl)] - internal static extern int Free(IntPtr ptr); - } -} diff --git a/src/Tizen.Network.Smartcard/Interop/Interop.Libraries.cs b/src/Tizen.Network.Smartcard/Interop/Interop.Libraries.cs deleted file mode 100644 index f231ed144..000000000 --- a/src/Tizen.Network.Smartcard/Interop/Interop.Libraries.cs +++ /dev/null @@ -1,25 +0,0 @@ -/* - * 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 Smartcard = "libcapi-network-smartcard.so.0"; - public const string Glib = "libglib-2.0.so.0"; - public const string Libc = "libc.so.6"; - } -} diff --git a/src/Tizen.Network.Smartcard/Interop/Interop.Smartcard.cs b/src/Tizen.Network.Smartcard/Interop/Interop.Smartcard.cs deleted file mode 100644 index 234de80a7..000000000 --- a/src/Tizen.Network.Smartcard/Interop/Interop.Smartcard.cs +++ /dev/null @@ -1,83 +0,0 @@ -/* - * 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 Smartcard - { - //capi-network-smartcard-0.0.6-2.1.armv7l.rpm - //Smartcard Manager - [DllImport(Libraries.Smartcard, EntryPoint = "smartcard_initialize")] - internal static extern int Initialize(); - [DllImport(Libraries.Smartcard, EntryPoint = "smartcard_deinitialize")] - internal static extern int Deinitialize(); - [DllImport(Libraries.Smartcard, EntryPoint = "smartcard_get_readers")] - internal static extern int GetReaders(out IntPtr readers, out int len); - - internal static class Reader - { - [DllImport(Libraries.Smartcard, EntryPoint = "smartcard_reader_get_name")] - internal static extern int ReaderGetName(int reader, out IntPtr readerName); - [DllImport(Libraries.Smartcard, EntryPoint = "smartcard_reader_is_secure_element_present")] - internal static extern int ReaderIsSecureElementPresent(int reader, out bool present); - [DllImport(Libraries.Smartcard, EntryPoint = "smartcard_reader_open_session")] - internal static extern int ReaderOpenSession(int reader, out int session); - [DllImport(Libraries.Smartcard, EntryPoint = "smartcard_reader_close_sessions")] - internal static extern int ReaderCloseSessions(int reader); - } - - internal static class Session - { - [DllImport(Libraries.Smartcard, EntryPoint = "smartcard_session_get_reader")] - internal static extern int SessionGetReader(int session, out int reader); - [DllImport(Libraries.Smartcard, EntryPoint = "smartcard_session_get_atr")] - internal static extern int SessionGetAtr(int session, out IntPtr atr, out int len); - [DllImport(Libraries.Smartcard, EntryPoint = "smartcard_session_close")] - internal static extern int SessionClose(int session); - [DllImport(Libraries.Smartcard, EntryPoint = "smartcard_session_is_closed")] - internal static extern int SessionIsClosed(int session, out bool closed); - [DllImport(Libraries.Smartcard, EntryPoint = "smartcard_session_close_channels")] - internal static extern int SessionCloseChannels(int session); - [DllImport(Libraries.Smartcard, EntryPoint = "smartcard_session_open_basic_channel")] - internal static extern int SessionOpenBasicChannel(int session, byte[] aid, int aidLen, byte p2, out int channel); - [DllImport(Libraries.Smartcard, EntryPoint = "smartcard_session_open_logical_channel")] - internal static extern int SessionOpenLogicalChannel(int session, byte[] aid, int aidLen, byte p2, out int channel); - } - - internal static class Channel - { - [DllImport(Libraries.Smartcard, EntryPoint = "smartcard_channel_close")] - internal static extern int ChannelClose(int channel); - [DllImport(Libraries.Smartcard, EntryPoint = "smartcard_channel_is_basic_channel")] - internal static extern int ChannelIsBasicChannel(int channel, out bool basicChannel); - [DllImport(Libraries.Smartcard, EntryPoint = "smartcard_channel_is_closed")] - internal static extern int ChannelIsClosed(int channel, out bool closed); - [DllImport(Libraries.Smartcard, EntryPoint = "smartcard_channel_get_select_response")] - internal static extern int ChannelGetSelectResponse(int channel, out IntPtr selectResp, out int len); - [DllImport(Libraries.Smartcard, EntryPoint = "smartcard_channel_get_session")] - internal static extern int ChannelGetSession(int channel, out int session); - [DllImport(Libraries.Smartcard, EntryPoint = "smartcard_channel_transmit")] - internal static extern int ChannelTransmit(int channel, byte[] cmd, int cmdLen, out IntPtr resp, out int len); - [DllImport(Libraries.Smartcard, EntryPoint = "smartcard_channel_transmit_retrieve_response")] - internal static extern int ChannelTransmitRetrieveResponse(int channel, out IntPtr name, out int len); - [DllImport(Libraries.Smartcard, EntryPoint = "smartcard_channel_select_next")] - internal static extern int ChannelSelectNext(int channel, out bool success); - } - } -} diff --git a/src/Tizen.Network.Smartcard/Tizen.Network.Smartcard.csproj b/src/Tizen.Network.Smartcard/Tizen.Network.Smartcard.csproj deleted file mode 100644 index 7f4584ffe..000000000 --- a/src/Tizen.Network.Smartcard/Tizen.Network.Smartcard.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - netstandard2.0 - - - - - - - - diff --git a/src/Tizen.Network.Smartcard/Tizen.Network.Smartcard.sln b/src/Tizen.Network.Smartcard/Tizen.Network.Smartcard.sln deleted file mode 100755 index 1b4824d35..000000000 --- a/src/Tizen.Network.Smartcard/Tizen.Network.Smartcard.sln +++ /dev/null @@ -1,34 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26430.12 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Network.Smartcard", "Tizen.Network.Smartcard.csproj", "{BBA19170-876D-46F6-81BA-F3EDA3B4D816}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen", "..\Tizen\Tizen.csproj", "{D454EADE-814E-46A3-820B-8634CBB81131}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Log", "..\Tizen.Log\Tizen.Log.csproj", "{B4EDF5AD-A918-46C4-BF29-DFC41495AB67}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {BBA19170-876D-46F6-81BA-F3EDA3B4D816}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {BBA19170-876D-46F6-81BA-F3EDA3B4D816}.Debug|Any CPU.Build.0 = Debug|Any CPU - {BBA19170-876D-46F6-81BA-F3EDA3B4D816}.Release|Any CPU.ActiveCfg = Release|Any CPU - {BBA19170-876D-46F6-81BA-F3EDA3B4D816}.Release|Any CPU.Build.0 = Release|Any CPU - {D454EADE-814E-46A3-820B-8634CBB81131}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D454EADE-814E-46A3-820B-8634CBB81131}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D454EADE-814E-46A3-820B-8634CBB81131}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D454EADE-814E-46A3-820B-8634CBB81131}.Release|Any CPU.Build.0 = Release|Any CPU - {B4EDF5AD-A918-46C4-BF29-DFC41495AB67}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B4EDF5AD-A918-46C4-BF29-DFC41495AB67}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B4EDF5AD-A918-46C4-BF29-DFC41495AB67}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B4EDF5AD-A918-46C4-BF29-DFC41495AB67}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/src/Tizen.Network.Smartcard/Tizen.Network.Smartcard/SmartcardChannel.cs b/src/Tizen.Network.Smartcard/Tizen.Network.Smartcard/SmartcardChannel.cs deleted file mode 100644 index e6a5255c0..000000000 --- a/src/Tizen.Network.Smartcard/Tizen.Network.Smartcard/SmartcardChannel.cs +++ /dev/null @@ -1,252 +0,0 @@ -/* - * 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; -using System.Collections.Generic; - -namespace Tizen.Network.Smartcard -{ - /// - /// The class for Smartcard channel information. It allows applications to handle the channel information. - /// - /// 3 - /// http://tizen.org/privilege/secureelement - public class SmartcardChannel : IDisposable - { - private int _channelHandle = -1; - private bool disposed = false; - private SmartcardSession _sessionObject; - - /// - /// Whether the kind of channel is basic. - /// - /// 3 - public bool IsBasicChannel - { - get - { - bool isBasicChannel; - int ret = Interop.Smartcard.Channel.ChannelIsBasicChannel(_channelHandle, out isBasicChannel); - if (ret != (int)SmartcardError.None) - { - Log.Error(Globals.LogTag, "Failed to get basic channel, Error - " + (SmartcardError)ret); - } - return isBasicChannel; - } - } - - /// - /// Whether the kind of channel is logical. - /// - /// 3 - public bool IsLogicalChannel - { - get - { - bool isBasicChannel; - int ret = Interop.Smartcard.Channel.ChannelIsBasicChannel(_channelHandle, out isBasicChannel); - if (ret != (int)SmartcardError.None) - { - Log.Error(Globals.LogTag, "Failed to get logical channel, Error - " + (SmartcardError)ret); - } - return !isBasicChannel; - } - } - - /// - /// Whether the channel is closed. - /// - /// 3 - public bool IsClosed - { - get - { - bool isClosed; - int ret = Interop.Smartcard.Channel.ChannelIsClosed(_channelHandle, out isClosed); - if (ret != (int)SmartcardError.None) - { - Log.Error(Globals.LogTag, "Failed to get closed, Error - " + (SmartcardError)ret); - } - return isClosed; - } - } - - /// - /// The session that has opened the given channel. - /// - /// 3 - public SmartcardSession Session - { - get - { - int session; - int ret = Interop.Smartcard.Channel.ChannelGetSession(_channelHandle, out session); - if (ret != (int)SmartcardError.None) - { - Log.Error(Globals.LogTag, "Failed to get session, Error - " + (SmartcardError)ret); - } - - if (_sessionObject.GetHandle() != session) - { - Log.Error(Globals.LogTag, "Does not correspond with session, Error - " + _sessionObject.GetHandle() + " " + session); - } - - return _sessionObject; - } - } - - internal SmartcardChannel(SmartcardSession sessionHandle, int channelHandle) - { - _sessionObject = sessionHandle; - _channelHandle = channelHandle; - } - - ~SmartcardChannel() - { - Dispose(false); - } - - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - - private void Dispose(bool disposing) - { - if (disposed) - return; - - if (disposing) - { - // Free managed objects. - } - //Free unmanaged objects - disposed = true; - } - - /// - /// Closes the given channel to the Secure Element. - /// - /// 3 - /// Thrown when the Smartcard is not supported. - /// Thrown when the method failed due to an invalid operation. - public void Close() - { - int ret = Interop.Smartcard.Channel.ChannelClose(_channelHandle); - if (ret != (int)SmartcardError.None) - { - Log.Error(Globals.LogTag, "Failed to channel close, Error - " + (SmartcardError)ret); - SmartcardErrorFactory.ThrowSmartcardException(ret); - } - Dispose(true); - } - - /// - /// Gets the response to the select command. - /// - /// 3 - /// Byte array to retrieve the select response. - public byte[] GetSelectedResponse() - { - byte[] respList; - IntPtr strAtr; - int len; - int ret = Interop.Smartcard.Channel.ChannelGetSelectResponse(_channelHandle, out strAtr, out len); - if (ret != (int)SmartcardError.None) - { - Log.Error(Globals.LogTag, "Failed to get select response, Error - " + (SmartcardError)ret); - } - - respList = new byte[len]; - for (int i = 0; i < len; i++) - { - respList[i] = Marshal.ReadByte(strAtr); - strAtr += sizeof(byte); - } - return respList; - } - - /// - /// Transmits the APDU command (as per ISO/IEC 7816-4) to the secure element. - /// - /// 3 - /// Byte array for the response APDU plus status words. - /// Command APDU to be sent to the secure element. - public byte[] Transmit(byte[] cmd) - { - byte[] atrList; - IntPtr strAtr; - int len; - int ret = Interop.Smartcard.Channel.ChannelTransmit(_channelHandle, cmd, cmd.Length, out strAtr, out len); - if (ret != (int)SmartcardError.None) - { - Log.Error(Globals.LogTag, "Failed to transmit, Error - " + (SmartcardError)ret); - } - - atrList = new byte[len]; - for (int i = 0; i < len; i++) - { - atrList[i] = Marshal.ReadByte(strAtr); - strAtr += sizeof(byte); - } - - return atrList; - } - - /// - /// Helper function to retrieve the response APDU of the previous transmit() call. - /// - /// 3 - /// Byte array for the response APDU plus status words. - public byte[] GetTransmittedResponse() - { - byte[] respList; - IntPtr strAtr; - int len; - int ret = Interop.Smartcard.Channel.ChannelTransmitRetrieveResponse(_channelHandle, out strAtr, out len); - if (ret != (int)SmartcardError.None) - { - Log.Error(Globals.LogTag, "Failed to get trasmit retrieve response, Error - " + (SmartcardError)ret); - } - - respList = new byte[len]; - for (int i = 0; i < len; i++) - { - respList[i] = Marshal.ReadByte(strAtr); - strAtr += sizeof(byte); - } - return respList; - } - - /// - /// Performs a selection of the next applet on the given channel that matches to the partial application ID (AID). - /// - /// 3 - /// True or false depending whether another applet with the partial application ID (AID). - public bool SelectNext() - { - bool selectNext; - int ret = Interop.Smartcard.Channel.ChannelSelectNext(_channelHandle, out selectNext); - if (ret != (int)SmartcardError.None) - { - Log.Error(Globals.LogTag, "Failed to select next, Error - " + (SmartcardError)ret); - } - return selectNext; - } - } -} diff --git a/src/Tizen.Network.Smartcard/Tizen.Network.Smartcard/SmartcardErrorFactory.cs b/src/Tizen.Network.Smartcard/Tizen.Network.Smartcard/SmartcardErrorFactory.cs deleted file mode 100644 index a562a2f95..000000000 --- a/src/Tizen.Network.Smartcard/Tizen.Network.Smartcard/SmartcardErrorFactory.cs +++ /dev/null @@ -1,74 +0,0 @@ -/* - * 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.Network.Smartcard -{ - internal enum SmartcardError - { - None = ErrorCode.None, - IoError = ErrorCode.IoError, - InvalidParameterError = ErrorCode.InvalidParameter, - PermissionDeniedError = ErrorCode.PermissionDenied, - NotSupportedError = ErrorCode.NotSupported, - GeneralError = -0x01C70000 | 0x01, - NoSuchElementError = -0x01C70000 | 0x02, - IllegalStateError = -0x01C70000 | 0x03, - IllegalReferenceError = -0x01C70000 | 0x04, - OperationNotSupportError = -0x01C70000 | 0x05, - ChannelNotAvailableError = -0x01C70000 | 0x06, - NotInitializedError = -0x01C70000 | 0x07 - } - - internal static class SmartcardErrorFactory - { - static internal void ThrowSmartcardException(int e) - { - ThrowException(e, false); - } - - static internal void ThrowSmartcardException(int e, int handle) - { - ThrowException(e, (handle < 0)); - } - - static private void ThrowException(int e, bool isHandleNull) - { - SmartcardError err = (SmartcardError)e; - - if (isHandleNull) - { - throw new InvalidOperationException("Invalid instance (object may have been disposed or released)"); - } - - if (err == SmartcardError.InvalidParameterError) - { - throw new ArgumentException(err.ToString()); - } - else if (err == SmartcardError.NotSupportedError) - { - throw new NotSupportedException(err.ToString()); - } - else - { - throw new InvalidOperationException(err.ToString()); - } - } - - } -} diff --git a/src/Tizen.Network.Smartcard/Tizen.Network.Smartcard/SmartcardManager.cs b/src/Tizen.Network.Smartcard/Tizen.Network.Smartcard/SmartcardManager.cs deleted file mode 100755 index f08ced3f1..000000000 --- a/src/Tizen.Network.Smartcard/Tizen.Network.Smartcard/SmartcardManager.cs +++ /dev/null @@ -1,47 +0,0 @@ -/* - * 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.Collections.Generic; -using System.Threading.Tasks; - -namespace Tizen.Network.Smartcard -{ - /// - /// The class for Smartcard management. It allows applications to use the Smartcard service. - /// - /// 3 - /// http://tizen.org/privilege/secureelement - static public class SmartcardManager - { - /// - /// Gets the list of available secure element readers. - /// - /// 3 - /// List of SmartcardReader objects. - static public IEnumerable GetReaders() - { - try - { - return SmartcardManagerImpl.Instance.GetReaders(); - } - catch (TypeInitializationException e) - { - throw e.InnerException; - } - } - } -} diff --git a/src/Tizen.Network.Smartcard/Tizen.Network.Smartcard/SmartcardManagerImpl.cs b/src/Tizen.Network.Smartcard/Tizen.Network.Smartcard/SmartcardManagerImpl.cs deleted file mode 100755 index 5e4db7fbe..000000000 --- a/src/Tizen.Network.Smartcard/Tizen.Network.Smartcard/SmartcardManagerImpl.cs +++ /dev/null @@ -1,121 +0,0 @@ -/* - * 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.Collections.Generic; -using System.Runtime.InteropServices; -using System.Threading.Tasks; - -namespace Tizen.Network.Smartcard -{ - static internal class Globals - { - internal const string LogTag = "Tizen.Network.Smartcard"; - } - - internal class SmartcardManagerImpl : IDisposable - { - private static readonly SmartcardManagerImpl _instance = new SmartcardManagerImpl(); - private List _readerList = new List(); - private bool disposed = false; - - internal static SmartcardManagerImpl Instance - { - get - { - return _instance; - } - } - - private SmartcardManagerImpl() - { - initialize(); - } - - ~SmartcardManagerImpl() - { - Dispose(false); - } - - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - - private void Dispose(bool disposing) - { - if (disposed) - return; - - if (disposing) - { - // Free managed objects. - foreach (SmartcardReader reader in _readerList) - { - reader.Dispose(); - _readerList.Remove(reader); - } - } - //Free unmanaged objects - deinitialize(); - disposed = true; - } - - private void initialize() - { - int ret = Interop.Smartcard.Initialize(); - if (ret != (int)SmartcardError.None) - { - Log.Error(Globals.LogTag, "Failed to initialize smartcard, Error - " + (SmartcardError)ret); - SmartcardErrorFactory.ThrowSmartcardException(ret); - } - } - - private void deinitialize() - { - int ret = Interop.Smartcard.Deinitialize(); - if (ret != (int)SmartcardError.None) - { - Log.Error(Globals.LogTag, "Failed to deinitialize smartcard, Error - " + (SmartcardError)ret); - } - } - - internal IEnumerable GetReaders() - { - IntPtr readerPtr; - int len = 0; - - int ret = Interop.Smartcard.GetReaders(out readerPtr, out len); - if (ret != (int)SmartcardError.None) - { - Log.Error(Globals.LogTag, "Failed to remove with AP, Error - " + (SmartcardError)ret); - SmartcardErrorFactory.ThrowSmartcardException(ret); - } - - for (int i = 0; i < len; i++) - { - int readerID = Marshal.ReadInt32(readerPtr); - - SmartcardReader readerItem = new SmartcardReader(readerID); - _readerList.Add(readerItem); - readerPtr += sizeof(int); - } - - return _readerList; - } - } -} diff --git a/src/Tizen.Network.Smartcard/Tizen.Network.Smartcard/SmartcardReader.cs b/src/Tizen.Network.Smartcard/Tizen.Network.Smartcard/SmartcardReader.cs deleted file mode 100644 index 13e7c997e..000000000 --- a/src/Tizen.Network.Smartcard/Tizen.Network.Smartcard/SmartcardReader.cs +++ /dev/null @@ -1,155 +0,0 @@ -/* - * 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; -using System.Collections.Generic; - -namespace Tizen.Network.Smartcard -{ - /// - /// The class for Smartcard reader information. It allows applications to handle the reader information. - /// - /// 3 - /// http://tizen.org/privilege/secureelement - public class SmartcardReader : IDisposable - { - private int _readerHandle = -1; - private int _session; - private bool disposed = false; - private List _sessionList = new List(); - - /// - /// The name of the reader. - /// - /// 3 - public string Name - { - get - { - IntPtr strPtr; - int ret = Interop.Smartcard.Reader.ReaderGetName(_readerHandle, out strPtr); - if (ret != (int)SmartcardError.None) - { - Log.Error(Globals.LogTag, "Failed to get reader name, Error - " + (SmartcardError)ret); - return ""; - } - return Marshal.PtrToStringAnsi(strPtr); - } - } - - /// - /// The existence of a secure element. - /// - /// 3 - public bool IsSecureElementPresent - { - get - { - bool isPresent; - int ret = Interop.Smartcard.Reader.ReaderIsSecureElementPresent(_readerHandle, out isPresent); - if (ret != (int)SmartcardError.None) - { - Log.Error(Globals.LogTag, "Failed to get present, Error - " + (SmartcardError)ret); - } - return isPresent; - } - } - - internal SmartcardReader(int handle) - { - _readerHandle = handle; - } - - ~SmartcardReader() - { - Dispose(false); - } - - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - - private void Dispose(bool disposing) - { - if (disposed) - return; - - if (disposing) - { - // Free managed objects. - foreach (SmartcardSession session in _sessionList) - { - session.Dispose(); - _sessionList.Remove(session); - } - } - //Free unmanaged objects - disposed = true; - } - - internal int GetHandle() - { - return _readerHandle; - } - - internal int GetSession() - { - return _session; - } - - /// - /// Connects to a secure element in the given reader. - /// - /// 3 - /// The SmartcardSession object. - public SmartcardSession OpenSession() - { - int ret = Interop.Smartcard.Reader.ReaderOpenSession(_readerHandle, out _session); - if (ret != (int)SmartcardError.None) - { - Log.Error(Globals.LogTag, "Failed to get session handle, Error - " + (SmartcardError)ret); - } - - SmartcardSession session = new SmartcardSession(this, _session); - _sessionList.Add(session); - return session; - } - - /// - /// Closes all the sessions opened on the given reader. - /// - /// 3 - /// Thrown when the Smartcard is not supported. - /// Thrown when the method failed due to an invalid operation. - public void CloseSessions() - { - int ret = Interop.Smartcard.Reader.ReaderCloseSessions(_readerHandle); - if (ret != (int)SmartcardError.None) - { - Log.Error(Globals.LogTag, "Failed to close sessions, Error - " + (SmartcardError)ret); - SmartcardErrorFactory.ThrowSmartcardException(ret); - } - - foreach (SmartcardSession session in _sessionList) - { - session.Close(); - } - } - } -} diff --git a/src/Tizen.Network.Smartcard/Tizen.Network.Smartcard/SmartcardSession.cs b/src/Tizen.Network.Smartcard/Tizen.Network.Smartcard/SmartcardSession.cs deleted file mode 100644 index 8ecc7aaed..000000000 --- a/src/Tizen.Network.Smartcard/Tizen.Network.Smartcard/SmartcardSession.cs +++ /dev/null @@ -1,242 +0,0 @@ -/* - * 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; -using System.Collections.Generic; - -namespace Tizen.Network.Smartcard -{ - /// - /// The class for the Smartcard session information. It allows applications to handle the session information. - /// - /// 3 - /// http://tizen.org/privilege/secureelement - public class SmartcardSession : IDisposable - { - private int _sessionHandle = -1; - private bool disposed = false; - private List _basicChannelList = new List(); - private List _logicalChannelList = new List(); - private SmartcardReader _readerObject; - private int _basicChannel = 0; - private int _logicalChannel = 0; - - /// - /// The reader object that provides the given session. - /// - /// 3 - public SmartcardReader Reader - { - get - { - int reader; - int ret = Interop.Smartcard.Session.SessionGetReader(_sessionHandle, out reader); - if (ret != (int)SmartcardError.None) - { - Log.Error(Globals.LogTag, "Failed to get reader, Error - " + (SmartcardError)ret); - } - - if (_readerObject.GetHandle() != reader) - { - Log.Error(Globals.LogTag, "Does not correspond with reader, Error - " + _readerObject.GetHandle() + " " + reader); - } - - return _readerObject; - } - } - - /// - /// The Answer to Reset (ATR) of this secure element. - /// - /// 3 - public byte[] Atr - { - get - { - byte[] atrList; - IntPtr strAtr; - int len; - int ret = Interop.Smartcard.Session.SessionGetAtr(_sessionHandle, out strAtr, out len); - if (ret != (int)SmartcardError.None) - { - Log.Error(Globals.LogTag, "Failed to get atr, Error - " + (SmartcardError)ret); - } - - atrList = new byte[len]; - for (int i = 0; i < len; i++) - { - atrList[i] = Marshal.ReadByte(strAtr); - strAtr += sizeof(byte); - } - return atrList; - } - } - - /// - /// Whether the session is closed. - /// - /// 3 - public bool IsClosed - { - get - { - bool isClosed; - int ret = Interop.Smartcard.Session.SessionIsClosed(_sessionHandle, out isClosed); - if (ret != (int)SmartcardError.None) - { - Log.Error(Globals.LogTag, "Failed to get present, Error - " + (SmartcardError)ret); - } - return isClosed; - } - } - - internal SmartcardSession(SmartcardReader readerHandle, int sessionHandle) - { - _readerObject = readerHandle; - _sessionHandle = sessionHandle; - } - - ~SmartcardSession() - { - Dispose(false); - } - - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - - private void Dispose(bool disposing) - { - if (disposed) - return; - - if (disposing) - { - // Free managed objects. - foreach (SmartcardChannel channel in _basicChannelList) - { - channel.Dispose(); - _basicChannelList.Remove(channel); - } - - foreach (SmartcardChannel channel in _logicalChannelList) - { - channel.Dispose(); - _logicalChannelList.Remove(channel); - } - } - //Free unmanaged objects - disposed = true; - } - - internal int GetHandle() - { - return _sessionHandle; - } - - /// - /// Closes the connection with the secure element. - /// - /// 3 - /// Thrown when the Smartcard is not supported. - /// Thrown when the method failed due to invalid operation. - public void Close() - { - int ret = Interop.Smartcard.Session.SessionClose(_sessionHandle); - if (ret != (int)SmartcardError.None) - { - Log.Error(Globals.LogTag, "Failed to close, Error - " + (SmartcardError)ret); - SmartcardErrorFactory.ThrowSmartcardException(ret); - } - Dispose(true); - } - - /// - /// Closes any channel opened on the given session. - /// - /// 3 - /// Thrown when the Smartcard is not supported. - /// Thrown when the method failed due to an invalid operation. - public void CloseChannels() - { - int ret = Interop.Smartcard.Session.SessionCloseChannels(_sessionHandle); - if (ret != (int)SmartcardError.None) - { - Log.Error(Globals.LogTag, "Failed to close, Error - " + (SmartcardError)ret); - SmartcardErrorFactory.ThrowSmartcardException(ret); - } - - foreach (SmartcardChannel channel in _basicChannelList) - { - channel.Close(); - } - - foreach (SmartcardChannel channel in _logicalChannelList) - { - channel.Close(); - } - } - - /// - /// Gets an access to the basic channel, as defined in the ISO/IEC 7816-4 specification (the one that has number 0). - /// - /// 3 - /// The SmartcardChannel object for the basic channel. - /// The byte array containing the Application ID(AID) to be selected on the given channel. - /// P2 byte of the SELECT command if executed. - /// Thrown when the Smartcard is not supported. - /// Thrown when the method failed due to invalid operation. - public SmartcardChannel OpenBasicChannel(byte[] aid, byte p2) - { - int ret = Interop.Smartcard.Session.SessionOpenBasicChannel(_sessionHandle, aid, aid.Length, p2, out _basicChannel); - if (ret != (int)SmartcardError.None) - { - Log.Error(Globals.LogTag, "Failed to open basic channel, Error - " + (SmartcardError)ret); - SmartcardErrorFactory.ThrowSmartcardException(ret); - } - SmartcardChannel basicChannel = new SmartcardChannel(this, _basicChannel); - _basicChannelList.Add(basicChannel); - - return basicChannel; - } - - /// - /// Open a logical channel with the secure element, selecting the Applet represented by the given application ID (AID). - /// - /// 3 - /// The SmartcardChannel object for the logical channel. - /// The byte array containing the Application ID(AID) to be selected on the given channel. - /// P2 byte of the SELECT command if executed. - /// Thrown when the Smartcard is not supported. - /// Thrown when the method failed due to an invalid operation. - public SmartcardChannel OpenLogicalChannel(byte[] aid, byte p2) - { - int ret = Interop.Smartcard.Session.SessionOpenLogicalChannel(_sessionHandle, aid, aid.Length, p2, out _logicalChannel); - if (ret != (int)SmartcardError.None) - { - Log.Error(Globals.LogTag, "Failed to open logical channel, Error - " + (SmartcardError)ret); - SmartcardErrorFactory.ThrowSmartcardException(ret); - } - SmartcardChannel logicalChannel = new SmartcardChannel(this, _logicalChannel); - _logicalChannelList.Add(logicalChannel); - - return logicalChannel; - } - } -} diff --git a/src/Tizen.Network.WiFi/Interop/Interop.Libraries.cs b/src/Tizen.Network.WiFi/Interop/Interop.Libraries.cs deleted file mode 100755 index d966df68f..000000000 --- a/src/Tizen.Network.WiFi/Interop/Interop.Libraries.cs +++ /dev/null @@ -1,25 +0,0 @@ -/* - * 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 WiFi = "libcapi-network-wifi-manager.so.1"; - public const string Glib = "libglib-2.0.so.0"; - public const string Libc = "libc.so.6"; - } -} diff --git a/src/Tizen.Network.WiFi/Interop/Interop.WiFi.cs b/src/Tizen.Network.WiFi/Interop/Interop.WiFi.cs deleted file mode 100755 index 96f75fe3a..000000000 --- a/src/Tizen.Network.WiFi/Interop/Interop.WiFi.cs +++ /dev/null @@ -1,332 +0,0 @@ -/* - * 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; -using Tizen.Network.WiFi; -using Tizen.Network.Connection; - -internal static partial class Interop -{ - internal static partial class WiFi - { - //Callback for async method - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void VoidCallback(int result, IntPtr userData); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool HandleCallback(IntPtr handle, IntPtr userData); - - //Callback for event - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void DeviceStateChangedCallback(int deviceState, IntPtr userData); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void ConnectionStateChangedCallback(int connectionState, IntPtr ap, IntPtr userData); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void RssiLevelChangedCallback(int level, IntPtr userData); - - //capi-network-wifi-1.0.65-19.23.armv7l - [DllImport(Libraries.WiFi, EntryPoint = "wifi_manager_initialize")] - internal static extern int Initialize(out SafeWiFiManagerHandle wifi); - [DllImport(Libraries.WiFi, EntryPoint = "wifi_manager_deinitialize")] - internal static extern int Deinitialize(IntPtr wifi); - - ////Wi-Fi Manager - [DllImport(Libraries.WiFi, EntryPoint = "wifi_manager_activate")] - internal static extern int Activate(SafeWiFiManagerHandle wifi, VoidCallback callback, IntPtr userData); - [DllImport(Libraries.WiFi, EntryPoint = "wifi_manager_activate_with_wifi_picker_tested")] - internal static extern int ActivateWithWiFiPickerTested(SafeWiFiManagerHandle wifi, VoidCallback callback, IntPtr userData); - [DllImport(Libraries.WiFi, EntryPoint = "wifi_manager_deactivate")] - internal static extern int Deactivate(SafeWiFiManagerHandle wifi, VoidCallback callback, IntPtr userData); - [DllImport(Libraries.WiFi, EntryPoint = "wifi_manager_is_activated")] - internal static extern int IsActive(SafeWiFiManagerHandle wifi, out bool activated); - [DllImport(Libraries.WiFi, EntryPoint = "wifi_manager_get_mac_address")] - internal static extern int GetMacAddress(SafeWiFiManagerHandle wifi, out string macAddress); - [DllImport(Libraries.WiFi, EntryPoint = "wifi_manager_get_network_interface_name")] - internal static extern int GetNetworkInterfaceName(SafeWiFiManagerHandle wifi, out string interfaceName); - [DllImport(Libraries.WiFi, EntryPoint = "wifi_manager_scan")] - internal static extern int Scan(SafeWiFiManagerHandle wifi, VoidCallback callback, IntPtr userData); - [DllImport(Libraries.WiFi, EntryPoint = "wifi_manager_scan_specific_ap")] - internal static extern int ScanSpecificAP(SafeWiFiManagerHandle wifi, string essid, VoidCallback callback, IntPtr userData); - [DllImport(Libraries.WiFi, EntryPoint = "wifi_manager_get_connected_ap")] - internal static extern int GetConnectedAP(SafeWiFiManagerHandle wifi, out IntPtr ap); - [DllImport(Libraries.WiFi, EntryPoint = "wifi_manager_foreach_found_ap")] - internal static extern int GetForeachFoundAPs(SafeWiFiManagerHandle wifi, HandleCallback callback, IntPtr userData); - [DllImport(Libraries.WiFi, EntryPoint = "wifi_manager_foreach_found_specific_ap")] - internal static extern int GetForeachFoundSpecificAPs(SafeWiFiManagerHandle wifi, HandleCallback callback, IntPtr userData); - [DllImport(Libraries.WiFi, EntryPoint = "wifi_manager_connect")] - internal static extern int Connect(SafeWiFiManagerHandle wifi, IntPtr ap, VoidCallback callback, IntPtr userData); - [DllImport(Libraries.WiFi, EntryPoint = "wifi_manager_disconnect")] - internal static extern int Disconnect(SafeWiFiManagerHandle wifi, IntPtr ap, VoidCallback callback, IntPtr userData); - [DllImport(Libraries.WiFi, EntryPoint = "wifi_manager_connect_by_wps_pbc")] - internal static extern int ConnectByWpsPbc(SafeWiFiManagerHandle wifi, IntPtr ap, VoidCallback callback, IntPtr userData); - [DllImport(Libraries.WiFi, EntryPoint = "wifi_manager_connect_by_wps_pin")] - internal static extern int ConnectByWpsPin(SafeWiFiManagerHandle wifi, IntPtr ap, string pin, VoidCallback callback, IntPtr userData); - [DllImport(Libraries.WiFi, EntryPoint = "wifi_manager_connect_by_wps_pbc_without_ssid")] - internal static extern int ConnectByWpsPbcWithoutSsid(SafeWiFiManagerHandle wifi, VoidCallback callback, IntPtr userData); - [DllImport(Libraries.WiFi, EntryPoint = "wifi_manager_connect_by_wps_pin_without_ssid")] - internal static extern int ConnectByWpsPinWithoutSsid(SafeWiFiManagerHandle wifi, string pin, VoidCallback callback, IntPtr userData); - [DllImport(Libraries.WiFi, EntryPoint = "wifi_manager_forget_ap")] - internal static extern int RemoveAP(SafeWiFiManagerHandle wifi, IntPtr ap); - - //Wi-Fi Monitor - [DllImport(Libraries.WiFi, EntryPoint = "wifi_manager_get_connection_state")] - internal static extern int GetConnectionState(SafeWiFiManagerHandle wifi, out int connectionState); - [DllImport(Libraries.WiFi, EntryPoint = "wifi_manager_set_device_state_changed_cb")] - internal static extern int SetDeviceStateChangedCallback(SafeWiFiManagerHandle wifi, DeviceStateChangedCallback callback, IntPtr userData); - [DllImport(Libraries.WiFi, EntryPoint = "wifi_manager_unset_device_state_changed_cb")] - internal static extern int UnsetDeviceStateChangedCallback(SafeWiFiManagerHandle wifi); - [DllImport(Libraries.WiFi, EntryPoint = "wifi_manager_set_background_scan_cb")] - internal static extern int SetBackgroundScanCallback(SafeWiFiManagerHandle wifi, VoidCallback callback, IntPtr userData); - [DllImport(Libraries.WiFi, EntryPoint = "wifi_manager_unset_background_scan_cb")] - internal static extern int UnsetBackgroundScanCallback(SafeWiFiManagerHandle wifi); - [DllImport(Libraries.WiFi, EntryPoint = "wifi_manager_set_connection_state_changed_cb")] - internal static extern int SetConnectionStateChangedCallback(SafeWiFiManagerHandle wifi, ConnectionStateChangedCallback callback, IntPtr userData); - [DllImport(Libraries.WiFi, EntryPoint = "wifi_manager_unset_connection_state_changed_cb")] - internal static extern int UnsetConnectionStateChangedCallback(SafeWiFiManagerHandle wifi); - [DllImport(Libraries.WiFi, EntryPoint = "wifi_manager_set_rssi_level_changed_cb")] - internal static extern int SetRssiLevelchangedCallback(SafeWiFiManagerHandle wifi, RssiLevelChangedCallback callback, IntPtr userData); - [DllImport(Libraries.WiFi, EntryPoint = "wifi_manager_unset_rssi_level_changed_cb")] - internal static extern int UnsetRssiLevelchangedCallback(SafeWiFiManagerHandle wifi); - - internal static class AP - { - [DllImport(Libraries.WiFi, EntryPoint = "wifi_manager_ap_create")] - internal static extern int Create(SafeWiFiManagerHandle wifi, string essid, out IntPtr ap); - [DllImport(Libraries.WiFi, EntryPoint = "wifi_manager_ap_hidden_create")] - internal static extern int CreateHiddenAP(SafeWiFiManagerHandle wifi, string essid, out IntPtr ap); - [DllImport(Libraries.WiFi, EntryPoint = "wifi_manager_ap_destroy")] - internal static extern int Destroy(IntPtr ap); - [DllImport(Libraries.WiFi, EntryPoint = "wifi_manager_ap_clone")] - internal static extern int Clone(out IntPtr cloned, IntPtr original); - [DllImport(Libraries.WiFi, EntryPoint = "wifi_manager_ap_refresh")] - internal static extern int Refresh(IntPtr ap); - - ////Network Information - [DllImport(Libraries.WiFi, EntryPoint = "wifi_manager_ap_get_essid")] - internal static extern int GetEssid(SafeWiFiAPHandle ap, out IntPtr essid); - [DllImport(Libraries.WiFi, EntryPoint = "wifi_manager_ap_get_bssid")] - internal static extern int GetBssid(SafeWiFiAPHandle ap, out IntPtr bssid); - [DllImport(Libraries.WiFi, EntryPoint = "wifi_manager_ap_get_rssi")] - internal static extern int GetRssi(SafeWiFiAPHandle ap, out int rssi); - [DllImport(Libraries.WiFi, EntryPoint = "wifi_manager_ap_get_rssi_level")] - internal static extern int GetRssiLevel(SafeWiFiAPHandle ap, out int rssi_level); - [DllImport(Libraries.WiFi, EntryPoint = "wifi_manager_ap_get_frequency")] - internal static extern int GetFrequency(SafeWiFiAPHandle ap, out int frequency); - [DllImport(Libraries.WiFi, EntryPoint = "wifi_manager_ap_get_max_speed")] - internal static extern int GetMaxSpeed(SafeWiFiAPHandle ap, out int maxSpeed); - [DllImport(Libraries.WiFi, EntryPoint = "wifi_manager_ap_is_favorite")] - internal static extern int IsFavorite(SafeWiFiAPHandle ap, out bool isFavorite); - [DllImport(Libraries.WiFi, EntryPoint = "wifi_manager_ap_is_passpoint")] - internal static extern int IsPasspoint(SafeWiFiAPHandle ap, out bool isPasspoint); - [DllImport(Libraries.WiFi, EntryPoint = "wifi_manager_ap_get_connection_state")] - internal static extern int GetConnectionState(SafeWiFiAPHandle ap, out int connectionState); - [DllImport(Libraries.WiFi, EntryPoint = "wifi_manager_ap_get_ip_config_type")] - internal static extern int GetIPConfigType(SafeWiFiAPHandle ap, int addressFamily, out int ipConfigType); - [DllImport(Libraries.WiFi, EntryPoint = "wifi_manager_ap_set_ip_config_type")] - internal static extern int SetIPConfigType(SafeWiFiAPHandle ap, int addressFamily, int ipConfigType); - [DllImport(Libraries.WiFi, EntryPoint = "wifi_manager_ap_get_ip_address")] - internal static extern int GetIPAddress(SafeWiFiAPHandle ap, int addressFamily, out IntPtr ipAddress); - [DllImport(Libraries.WiFi, EntryPoint = "wifi_manager_ap_foreach_ipv6_address")] - internal static extern int GetAllIPv6Addresses(SafeWiFiAPHandle ap, HandleCallback callback, IntPtr userData); - [DllImport(Libraries.WiFi, EntryPoint = "wifi_manager_ap_set_ip_address")] - internal static extern int SetIPAddress(SafeWiFiAPHandle ap, int addressFamily, string ipAddress); - [DllImport(Libraries.WiFi, EntryPoint = "wifi_manager_ap_get_subnet_mask")] - internal static extern int GetSubnetMask(SafeWiFiAPHandle ap, int addressFamily, out IntPtr subnetMask); - [DllImport(Libraries.WiFi, EntryPoint = "wifi_manager_ap_set_subnet_mask")] - internal static extern int SetSubnetMask(SafeWiFiAPHandle ap, int addressFamily, string subnetMask); - [DllImport(Libraries.WiFi, EntryPoint = "wifi_manager_ap_get_gateway_address")] - internal static extern int GetGatewayAddress(SafeWiFiAPHandle ap, int addressFamily, out IntPtr gatewayAddress); - [DllImport(Libraries.WiFi, EntryPoint = "wifi_manager_ap_set_gateway_address")] - internal static extern int SetGatewayAddress(SafeWiFiAPHandle ap, int addressFamily, string gatewayAddress); - [DllImport(Libraries.WiFi, EntryPoint = "wifi_manager_ap_get_dhcp_server_address")] - internal static extern int GetDhcpServerAddress(SafeWiFiAPHandle ap, AddressFamily addressFamily, out string dhcpServer); - [DllImport(Libraries.WiFi, EntryPoint = "wifi_manager_ap_get_proxy_address")] - internal static extern int GetProxyAddress(SafeWiFiAPHandle ap, int addressFamily, out IntPtr proxyAddress); - [DllImport(Libraries.WiFi, EntryPoint = "wifi_manager_ap_set_proxy_address")] - internal static extern int SetProxyAddress(SafeWiFiAPHandle ap, int addressFamily, string proxyAddress); - [DllImport(Libraries.WiFi, EntryPoint = "wifi_manager_ap_get_proxy_type")] - internal static extern int GetProxyType(SafeWiFiAPHandle ap, out int proxyType); - [DllImport(Libraries.WiFi, EntryPoint = "wifi_manager_ap_set_proxy_type")] - internal static extern int SetProxyType(SafeWiFiAPHandle ap, int proxyType); - [DllImport(Libraries.WiFi, EntryPoint = "wifi_manager_ap_get_dns_address")] - internal static extern int GetDnsAddress(SafeWiFiAPHandle ap, int order, int addressFamily, out IntPtr dnsAddress); - [DllImport(Libraries.WiFi, EntryPoint = "wifi_manager_ap_set_dns_address")] - internal static extern int SetDnsAddress(SafeWiFiAPHandle ap, int order, int addressFamily, string dnsAddress); - [DllImport(Libraries.WiFi, EntryPoint = "wifi_manager_ap_get_prefix_length")] - internal static extern int GetPrefixLength(SafeWiFiAPHandle ap, int addressFamily, out int length); - [DllImport(Libraries.WiFi, EntryPoint = "wifi_manager_ap_set_prefix_length")] - internal static extern int SetPrefixLength(SafeWiFiAPHandle ap, int addressFamily, int length); - [DllImport(Libraries.WiFi, EntryPoint = "wifi_manager_ap_get_dns_config_type")] - internal static extern int GetDnsConfigType(SafeWiFiAPHandle ap, int addressFamily, out int type); - [DllImport(Libraries.WiFi, EntryPoint = "wifi_manager_ap_set_dns_config_type")] - internal static extern int SetDnsConfigType(SafeWiFiAPHandle ap, int addressFamily, int type); - - ////Security Information - [DllImport(Libraries.WiFi, EntryPoint = "wifi_manager_ap_get_security_type")] - internal static extern int GetSecurityType(SafeWiFiAPHandle ap, out int securityType); - [DllImport(Libraries.WiFi, EntryPoint = "wifi_manager_ap_set_security_type")] - internal static extern int SetSecurityType(SafeWiFiAPHandle ap, int securityType); - [DllImport(Libraries.WiFi, EntryPoint = "wifi_manager_ap_get_encryption_type")] - internal static extern int GetEncryptionType(SafeWiFiAPHandle ap, out int encryptionType); - [DllImport(Libraries.WiFi, EntryPoint = "wifi_manager_ap_set_encryption_type")] - internal static extern int SetEncryptionType(SafeWiFiAPHandle ap, int encryptionType); - [DllImport(Libraries.WiFi, EntryPoint = "wifi_manager_ap_is_passphrase_required")] - internal static extern int IsPassphraseRequired(SafeWiFiAPHandle ap, out bool required); - [DllImport(Libraries.WiFi, EntryPoint = "wifi_manager_ap_set_passphrase")] - internal static extern int SetPassphrase(SafeWiFiAPHandle ap, string passphrase); - [DllImport(Libraries.WiFi, EntryPoint = "wifi_manager_ap_is_wps_supported")] - internal static extern int IsWpsSupported(SafeWiFiAPHandle ap, out bool supported); - - ////EAP - [DllImport(Libraries.WiFi, EntryPoint = "wifi_manager_ap_set_eap_passphrase")] - internal static extern int SetEapPassphrase(SafeWiFiAPHandle ap, string userName, string password); - [DllImport(Libraries.WiFi, EntryPoint = "wifi_manager_ap_get_eap_passphrase")] - internal static extern int GetEapPassphrase(SafeWiFiAPHandle ap, out IntPtr userName, out bool isPasswordSet); - [DllImport(Libraries.WiFi, EntryPoint = "wifi_manager_ap_get_eap_ca_cert_file")] - internal static extern int GetEapCaCertFile(SafeWiFiAPHandle ap, out IntPtr file); - [DllImport(Libraries.WiFi, EntryPoint = "wifi_manager_ap_set_eap_ca_cert_file")] - internal static extern int SetEapCaCertFile(SafeWiFiAPHandle ap, string file); - [DllImport(Libraries.WiFi, EntryPoint = "wifi_manager_ap_get_eap_client_cert_file")] - internal static extern int GetEapClientCertFile(SafeWiFiAPHandle ap, out IntPtr file); - [DllImport(Libraries.WiFi, EntryPoint = "wifi_manager_ap_set_eap_client_cert_file")] - internal static extern int SetEapClientCertFile(SafeWiFiAPHandle ap, string file); - [DllImport(Libraries.WiFi, EntryPoint = "wifi_manager_ap_get_eap_private_key_file")] - internal static extern int GetEapPrivateKeyFile(SafeWiFiAPHandle ap, out IntPtr file); - [DllImport(Libraries.WiFi, EntryPoint = "wifi_manager_ap_set_eap_private_key_info")] - internal static extern int SetEapPrivateKeyFile(SafeWiFiAPHandle ap, string file, string password); - [DllImport(Libraries.WiFi, EntryPoint = "wifi_manager_ap_get_eap_type")] - internal static extern int GetEapType(SafeWiFiAPHandle ap, out int eapType); - [DllImport(Libraries.WiFi, EntryPoint = "wifi_manager_ap_set_eap_type")] - internal static extern int SetEapType(SafeWiFiAPHandle ap, int eapType); - [DllImport(Libraries.WiFi, EntryPoint = "wifi_manager_ap_get_eap_auth_type")] - internal static extern int GetEapAuthType(SafeWiFiAPHandle ap, out int file); - [DllImport(Libraries.WiFi, EntryPoint = "wifi_manager_ap_set_eap_auth_type")] - internal static extern int SetEapAuthType(SafeWiFiAPHandle ap, int file); - } - - internal static class Config - { - [DllImport(Libraries.WiFi, EntryPoint = "wifi_manager_config_create")] - internal static extern int Create(SafeWiFiManagerHandle wifi, string name, string passPhrase, int securityType, out IntPtr config); - [DllImport(Libraries.WiFi, EntryPoint = "wifi_manager_config_clone")] - internal static extern int Clone(IntPtr origin, out IntPtr cloned); - [DllImport(Libraries.WiFi, EntryPoint = "wifi_manager_config_destroy")] - internal static extern int Destroy(IntPtr config); - [DllImport(Libraries.WiFi, EntryPoint = "wifi_manager_config_save")] - internal static extern int SaveConfiguration(SafeWiFiManagerHandle wifi, IntPtr config); - [DllImport(Libraries.WiFi, EntryPoint = "wifi_manager_config_foreach_configuration")] - internal static extern int GetForeachConfiguration(SafeWiFiManagerHandle wifi, HandleCallback callback, IntPtr userData); - [DllImport(Libraries.WiFi, EntryPoint = "wifi_manager_config_get_name")] - internal static extern int GetName(IntPtr config, out IntPtr name); - [DllImport(Libraries.WiFi, EntryPoint = "wifi_manager_config_get_security_type")] - internal static extern int GetSecurityType(IntPtr config, out int securityType); - [DllImport(Libraries.WiFi, EntryPoint = "wifi_manager_config_set_proxy_address")] - internal static extern int SetProxyAddress(IntPtr config, int addressFamily, string proxyAddress); - [DllImport(Libraries.WiFi, EntryPoint = "wifi_manager_config_get_proxy_address")] - internal static extern int GetProxyAddress(IntPtr config, out int addressFamily, out IntPtr proxyAddress); - [DllImport(Libraries.WiFi, EntryPoint = "wifi_manager_config_set_hidden_ap_property")] - internal static extern int SetHiddenAPProperty(IntPtr config, bool isHidden); - [DllImport(Libraries.WiFi, EntryPoint = "wifi_manager_config_get_hidden_ap_property")] - internal static extern int GetHiddenAPProperty(IntPtr config, out bool isHidden); - [DllImport(Libraries.WiFi, EntryPoint = "wifi_manager_config_get_eap_anonymous_identity")] - internal static extern int GetEapAnonymousIdentity(SafeWiFiConfigHandle config, out IntPtr anonymousIdentify); - [DllImport(Libraries.WiFi, EntryPoint = "wifi_manager_config_set_eap_anonymous_identity")] - internal static extern int SetEapAnonymousIdentity(SafeWiFiConfigHandle config, string anonymousIdentify); - [DllImport(Libraries.WiFi, EntryPoint = "wifi_manager_config_get_eap_ca_cert_file")] - internal static extern int GetEapCaCertFile(SafeWiFiConfigHandle config, out IntPtr caCert); - [DllImport(Libraries.WiFi, EntryPoint = "wifi_manager_config_set_eap_ca_cert_file")] - internal static extern int SetEapCaCertFile(SafeWiFiConfigHandle config, string caCert); - [DllImport(Libraries.WiFi, EntryPoint = "wifi_manager_config_get_eap_client_cert_file")] - internal static extern int GetEapClientCertFile(SafeWiFiConfigHandle config, out IntPtr clientCert); - [DllImport(Libraries.WiFi, EntryPoint = "wifi_manager_config_set_eap_client_cert_file")] - internal static extern int SetEapClientCertFile(SafeWiFiConfigHandle config, string privateKey, string clientCert); - [DllImport(Libraries.WiFi, EntryPoint = "wifi_manager_config_get_eap_identity")] - internal static extern int GetEapIdentity(SafeWiFiConfigHandle config, out IntPtr identify); - [DllImport(Libraries.WiFi, EntryPoint = "wifi_manager_config_set_eap_identity")] - internal static extern int SetEapIdentity(SafeWiFiConfigHandle config, string identify); - [DllImport(Libraries.WiFi, EntryPoint = "wifi_manager_config_get_eap_type")] - internal static extern int GetEapType(SafeWiFiConfigHandle config, out int eapType); - [DllImport(Libraries.WiFi, EntryPoint = "wifi_manager_config_set_eap_type")] - internal static extern int SetEapType(SafeWiFiConfigHandle config, int eapType); - [DllImport(Libraries.WiFi, EntryPoint = "wifi_manager_config_get_eap_auth_type")] - internal static extern int GetEapAuthType(SafeWiFiConfigHandle config, out int eapAuthType); - [DllImport(Libraries.WiFi, EntryPoint = "wifi_manager_config_set_eap_auth_type")] - internal static extern int SetEapAuthType(SafeWiFiConfigHandle config, int eapAuthType); - [DllImport(Libraries.WiFi, EntryPoint = "wifi_manager_config_get_eap_subject_match")] - internal static extern int GetEapSubjectMatch(SafeWiFiConfigHandle config, out IntPtr subjectMatch); - [DllImport(Libraries.WiFi, EntryPoint = "wifi_manager_config_set_eap_subject_match")] - internal static extern int SetEapSubjectMatch(SafeWiFiConfigHandle config, string subjectMatch); - } - - internal sealed class SafeWiFiAPHandle : SafeHandle - { - public SafeWiFiAPHandle() : base(IntPtr.Zero, true) - { - } - - public SafeWiFiAPHandle(IntPtr handle) : base(handle, true) - { - } - - public override bool IsInvalid - { - get - { - return this.handle == IntPtr.Zero; - } - } - - protected override bool ReleaseHandle() - { - this.SetHandle(IntPtr.Zero); - return true; - } - } - - internal sealed class SafeWiFiConfigHandle : SafeHandle - { - public SafeWiFiConfigHandle() : base(IntPtr.Zero, true) - { - } - - public SafeWiFiConfigHandle(IntPtr handle) : base(handle, true) - { - } - - public override bool IsInvalid - { - get - { - return this.handle == IntPtr.Zero; - } - } - - protected override bool ReleaseHandle() - { - WiFi.Config.Destroy(this.handle); - this.SetHandle(IntPtr.Zero); - return true; - } - } - - } - - internal static partial class Libc - { - [DllImport(Libraries.Libc, EntryPoint = "free")] - public static extern void Free(IntPtr userData); - } -} diff --git a/src/Tizen.Network.WiFi/Tizen.Network.WiFi.csproj b/src/Tizen.Network.WiFi/Tizen.Network.WiFi.csproj deleted file mode 100644 index b3b1ca16e..000000000 --- a/src/Tizen.Network.WiFi/Tizen.Network.WiFi.csproj +++ /dev/null @@ -1,11 +0,0 @@ - - - - netstandard2.0 - - - - - - - diff --git a/src/Tizen.Network.WiFi/Tizen.Network.WiFi.sln b/src/Tizen.Network.WiFi/Tizen.Network.WiFi.sln deleted file mode 100755 index c0c5959b5..000000000 --- a/src/Tizen.Network.WiFi/Tizen.Network.WiFi.sln +++ /dev/null @@ -1,40 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26430.12 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Network.WiFi", "Tizen.Network.WiFi.csproj", "{41E3B96D-1767-45B6-9F44-6CB228962E45}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Network.Connection", "..\Tizen.Network.Connection\Tizen.Network.Connection.csproj", "{F0F314F7-D441-4A46-BEBF-B82BC6041C73}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen", "..\Tizen\Tizen.csproj", "{6B1572A2-8970-45DF-82E4-34F20AF01A73}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Log", "..\Tizen.Log\Tizen.Log.csproj", "{CABE3AEF-18CD-47D9-9B6F-5EA7950C6A69}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {41E3B96D-1767-45B6-9F44-6CB228962E45}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {41E3B96D-1767-45B6-9F44-6CB228962E45}.Debug|Any CPU.Build.0 = Debug|Any CPU - {41E3B96D-1767-45B6-9F44-6CB228962E45}.Release|Any CPU.ActiveCfg = Release|Any CPU - {41E3B96D-1767-45B6-9F44-6CB228962E45}.Release|Any CPU.Build.0 = Release|Any CPU - {F0F314F7-D441-4A46-BEBF-B82BC6041C73}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F0F314F7-D441-4A46-BEBF-B82BC6041C73}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F0F314F7-D441-4A46-BEBF-B82BC6041C73}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F0F314F7-D441-4A46-BEBF-B82BC6041C73}.Release|Any CPU.Build.0 = Release|Any CPU - {6B1572A2-8970-45DF-82E4-34F20AF01A73}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6B1572A2-8970-45DF-82E4-34F20AF01A73}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6B1572A2-8970-45DF-82E4-34F20AF01A73}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6B1572A2-8970-45DF-82E4-34F20AF01A73}.Release|Any CPU.Build.0 = Release|Any CPU - {CABE3AEF-18CD-47D9-9B6F-5EA7950C6A69}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {CABE3AEF-18CD-47D9-9B6F-5EA7950C6A69}.Debug|Any CPU.Build.0 = Debug|Any CPU - {CABE3AEF-18CD-47D9-9B6F-5EA7950C6A69}.Release|Any CPU.ActiveCfg = Release|Any CPU - {CABE3AEF-18CD-47D9-9B6F-5EA7950C6A69}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/src/Tizen.Network.WiFi/Tizen.Network.WiFi/ConnectionStateChangedEventArgs.cs b/src/Tizen.Network.WiFi/Tizen.Network.WiFi/ConnectionStateChangedEventArgs.cs deleted file mode 100755 index 869a0ea9d..000000000 --- a/src/Tizen.Network.WiFi/Tizen.Network.WiFi/ConnectionStateChangedEventArgs.cs +++ /dev/null @@ -1,60 +0,0 @@ -/* - * 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.Network.WiFi -{ - /// - /// An extended EventArgs class which contains the changed connection state. - /// - /// 3 - public class ConnectionStateChangedEventArgs : EventArgs - { - private WiFiConnectionState _state = WiFiConnectionState.Disconnected; - private WiFiAP _ap; - - internal ConnectionStateChangedEventArgs(WiFiConnectionState s, IntPtr apHandle) - { - _state = s; - _ap = new WiFiAP(apHandle); - } - - /// - /// The Wi-Fi connection state. - /// - /// 3 - public WiFiConnectionState State - { - get - { - return _state; - } - } - - /// - /// The access point. - /// - /// 3 - public WiFiAP AP - { - get - { - return _ap; - } - } - } -} diff --git a/src/Tizen.Network.WiFi/Tizen.Network.WiFi/DeviceStateChangedEventArgs.cs b/src/Tizen.Network.WiFi/Tizen.Network.WiFi/DeviceStateChangedEventArgs.cs deleted file mode 100644 index b53bb325c..000000000 --- a/src/Tizen.Network.WiFi/Tizen.Network.WiFi/DeviceStateChangedEventArgs.cs +++ /dev/null @@ -1,46 +0,0 @@ -/* - * 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.Network.WiFi -{ - /// - /// An extended EventArgs class which contains the changed device state. - /// - /// 3 - public class DeviceStateChangedEventArgs : EventArgs - { - private WiFiDeviceState _state = WiFiDeviceState.Deactivated; - - internal DeviceStateChangedEventArgs(WiFiDeviceState s) - { - _state = s; - } - - /// - /// The Wi-Fi device state. - /// - /// 3 - public WiFiDeviceState State - { - get - { - return _state; - } - } - } -} diff --git a/src/Tizen.Network.WiFi/Tizen.Network.WiFi/IWiFiEap.cs b/src/Tizen.Network.WiFi/Tizen.Network.WiFi/IWiFiEap.cs deleted file mode 100755 index b16c5e365..000000000 --- a/src/Tizen.Network.WiFi/Tizen.Network.WiFi/IWiFiEap.cs +++ /dev/null @@ -1,45 +0,0 @@ -/* - * 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.Network.WiFi -{ - /// - /// An abstract class for the Wi-Fi EAP information. - /// - /// 3 - internal interface IWiFiEap - { - /// - /// The file path of CA Certificate of EAP. - /// - /// 3 - string CaCertificationFile { get; set; } - - /// - /// The EAP type of the Wi-Fi. - /// - /// 3 - WiFiEapType EapType { get; set; } - - /// - /// The type of EAP phase2 authentication of the Wi-Fi. - /// - /// 3 - WiFiAuthenticationType AuthenticationType { get; set; } - } //WiFiEap -} diff --git a/src/Tizen.Network.WiFi/Tizen.Network.WiFi/RssiLevelChangedEventArgs.cs b/src/Tizen.Network.WiFi/Tizen.Network.WiFi/RssiLevelChangedEventArgs.cs deleted file mode 100755 index fbf25091d..000000000 --- a/src/Tizen.Network.WiFi/Tizen.Network.WiFi/RssiLevelChangedEventArgs.cs +++ /dev/null @@ -1,46 +0,0 @@ -/* - * 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.Network.WiFi -{ - /// - /// An extended EventArgs class which contains the changed RSSI level. - /// - /// 3 - public class RssiLevelChangedEventArgs : EventArgs - { - private WiFiRssiLevel _level = WiFiRssiLevel.Level0; - - internal RssiLevelChangedEventArgs(WiFiRssiLevel l) - { - _level = l; - } - - /// - /// The Wi-Fi RSSI level. - /// - /// 3 - public WiFiRssiLevel Level - { - get - { - return _level; - } - } - } -} diff --git a/src/Tizen.Network.WiFi/Tizen.Network.WiFi/WiFiAP.cs b/src/Tizen.Network.WiFi/Tizen.Network.WiFi/WiFiAP.cs deleted file mode 100755 index 350b27543..000000000 --- a/src/Tizen.Network.WiFi/Tizen.Network.WiFi/WiFiAP.cs +++ /dev/null @@ -1,524 +0,0 @@ -/* - * 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.Threading.Tasks; -using System.Collections.Generic; - -namespace Tizen.Network.WiFi -{ - /// - /// A class for managing the network information of the access point (AP). - /// - /// 3 - public class WiFiAP : IDisposable - { - private IntPtr _apHandle = IntPtr.Zero; - private Dictionary _callback_map = new Dictionary(); - private static Dictionary s_callbackMap = new Dictionary(); - private int _requestId = 0; - private static int s_requestId = 0; - private WiFiNetwork _network; - private WiFiSecurity _security; - private bool _disposed = false; - - /// - /// The network information of the access point (AP). - /// - /// 3 - /// The WiFiNetwork instance containing the network information of the AP. - public WiFiNetwork NetworkInformation - { - get - { - return _network; - } - } - - /// - /// The security information of the access point (AP). - /// - /// 3 - /// The WiFiSecurity instance containing security information of the AP. - public WiFiSecurity SecurityInformation - { - get - { - return _security; - } - } - - internal WiFiAP(IntPtr handle) - { - Log.Debug(Globals.LogTag, "New WiFiAP. Handle: " + handle); - _apHandle = handle; - Initialize(); - } - - /// - /// Creates an object for the access point. - /// - /// 3 - /// The Extended Service Set Identifier of the access point. - /// http://tizen.org/feature/network.wifi - /// http://tizen.org/privilege/network.get - /// Thrown when the Wi-Fi is not supported. - /// Thrown when permission is denied. - /// Thrown when the ESSID is passed as null. - /// Thrown when the method failed due to an invalid parameter. - /// Thrown when the system is out of memory. - /// Thrown when the method failed due to an invalid operation. - public WiFiAP(string essid) - { - Log.Debug(Globals.LogTag, "New WiFiAP. Essid: " + essid); - createHandle(essid, true); - Initialize(); - } - - /// - /// Creates an object for the hidden access point. - /// - /// 3 - /// The Extended Service Set Identifier of the access point. - /// The value to set a hidden AP. - /// http://tizen.org/feature/network.wifi - /// http://tizen.org/privilege/network.get - /// Thrown when the Wi-Fi is not supported. - /// Thrown when permission is denied. - /// Thrown when the ESSID is passed as null. - /// Thrown when the method failed due to an invalid parameter. - /// Thrown when the system is out of memory. - /// Thrown when the method failed due to an invalid operation. - public WiFiAP(string essid, bool hidden) - { - createHandle(essid, hidden); - Initialize(); - } - - ~WiFiAP() - { - Dispose(false); - } - - /// - /// A method to destroy the managed WiFiAP objects. - /// - /// 3 - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - - private void Dispose(bool disposing) - { - if (_disposed) - return; - - if (disposing) - { - Interop.WiFi.AP.Destroy(_apHandle); - _apHandle = IntPtr.Zero; - } - _disposed = true; - } - - private void createHandle(string id, bool hidden) - { - int ret = -1; - if (id == null) - { - throw new ArgumentNullException("Essid is null"); - } - - if (hidden) - { - ret = Interop.WiFi.AP.CreateHiddenAP(WiFiManagerImpl.Instance.GetSafeHandle(), id, out _apHandle); - } - - else - { - ret = Interop.WiFi.AP.Create(WiFiManagerImpl.Instance.GetSafeHandle(), id, out _apHandle); - } - - if (ret != (int)WiFiError.None) - { - Log.Error(Globals.LogTag, "Failed to create handle, Error - " + (WiFiError)ret); - WiFiErrorFactory.ThrowWiFiException(ret, WiFiManagerImpl.Instance.GetSafeHandle().DangerousGetHandle()); - } - } - - private void Initialize() - { - Interop.WiFi.SafeWiFiAPHandle apHandle = new Interop.WiFi.SafeWiFiAPHandle(_apHandle); - _network = new WiFiNetwork(apHandle); - _security = new WiFiSecurity(apHandle); - } - - /// - /// Refreshes the access point information. - /// - /// 3 - /// http://tizen.org/feature/network.wifi - /// http://tizen.org/privilege/network.get - /// Thrown when the Wi-Fi is not supported. - /// Thrown when permission is denied. - /// Thrown when the object instance is disposed or released. - /// Thrown when the method failed due to an invalid parameter. - /// Thrown when the method failed due to an invalid operation. - public void Refresh() - { - Log.Debug(Globals.LogTag, "Refresh"); - if (_disposed) - { - throw new ObjectDisposedException("Invalid AP instance (Object may have been disposed or released)"); - } - int ret = Interop.WiFi.AP.Refresh(_apHandle); - if (ret != (int)WiFiError.None) - { - Log.Error(Globals.LogTag, "Failed to refresh ap handle, Error - " + (WiFiError)ret); - WiFiErrorFactory.ThrowWiFiException(ret, _apHandle, "http://tizen.org/privilege/network.get"); - } - } - - /// - /// Connects the access point asynchronously. - /// - /// 3 - /// A task indicating whether the connect method is done or not. - /// http://tizen.org/feature/network.wifi - /// http://tizen.org/privilege/network.set - /// http://tizen.org/privilege/network.get - /// Thrown when the Wi-Fi is not supported. - /// Thrown when permission is denied. - /// Thrown when the object instance is disposed or released. - /// Thrown when the system is out of memory. - /// Thrown when the method failed due to an invalid parameter. - /// Thrown when the method failed due to an invalid operation. - public Task ConnectAsync() - { - Log.Debug(Globals.LogTag, "ConnectAsync"); - if (_disposed) - { - throw new ObjectDisposedException("Invalid AP instance (Object may have been disposed or released)"); - } - TaskCompletionSource task = new TaskCompletionSource(); - IntPtr id; - lock (_callback_map) - { - id = (IntPtr)_requestId++; - _callback_map[id] = (error, key) => - { - Log.Debug(Globals.LogTag, "Connecting finished : " + (WiFiError)error); - if (error != (int)WiFiError.None) - { - Log.Error(Globals.LogTag, "Error occurs during WiFi connecting, " + (WiFiError)error); - task.SetException(new InvalidOperationException("Error occurs during WiFi connecting, " + (WiFiError)error)); - } - task.SetResult(true); - lock (_callback_map) - { - _callback_map.Remove(key); - } - }; - } - - int ret = Interop.WiFi.Connect(WiFiManagerImpl.Instance.GetSafeHandle(), _apHandle, _callback_map[id], id); - if (ret != (int)WiFiError.None) - { - Log.Error(Globals.LogTag, "Failed to connect wifi, Error - " + (WiFiError)ret); - WiFiErrorFactory.ThrowWiFiException(ret, WiFiManagerImpl.Instance.GetSafeHandle().DangerousGetHandle(), _apHandle); - } - - return task.Task; - } - - /// - /// Connects the access point with the WPS asynchronously. - /// - /// 3 - /// A WpsInfo instance which is type of WpsPbcInfo or WpsPinInfo. - /// A task indicating whether the ConnectWps method is done or not. - /// http://tizen.org/feature/network.wifi - /// http://tizen.org/privilege/network.profile - /// http://tizen.org/privilege/network.get - /// Thrown when the Wi-Fi is not supported. - /// Thrown when permission is denied. - /// Thrown when the object instance is disposed or released. - /// Thrown when the WpsPinInfo object is constructed with a null pin. - /// Thrown when the WpsPinInfo object is constructed with a pin which is an empty string or more than 7 characters. - /// Thrown when the system is out of memory. - /// Thrown when the method failed due to an invalid parameter. - /// Thrown when the method failed due to an invalid operation. - public Task ConnectWpsAsync(WpsInfo info) - { - Log.Debug(Globals.LogTag, "ConnectWpsAsync"); - if (_disposed) - { - throw new ObjectDisposedException("Invalid AP instance (Object may have been disposed or released)"); - } - TaskCompletionSource task = new TaskCompletionSource(); - IntPtr id; - lock (_callback_map) - { - id = (IntPtr)_requestId++; - _callback_map[id] = (error, key) => - { - Log.Debug(Globals.LogTag, "Connecting by WPS finished"); - if (error != (int)WiFiError.None) - { - Log.Error(Globals.LogTag, "Error occurs during WiFi connecting, " + (WiFiError)error); - task.SetException(new InvalidOperationException("Error occurs during WiFi connecting, " + (WiFiError)error)); - } - task.SetResult(true); - lock (_callback_map) - { - _callback_map.Remove(key); - } - }; - } - - int ret = -1; - if (info.GetType() == typeof(WpsPbcInfo)) - { - ret = Interop.WiFi.ConnectByWpsPbc(WiFiManagerImpl.Instance.GetSafeHandle(), _apHandle, _callback_map[id], id); - } - - else if (info.GetType() == typeof(WpsPinInfo)) - { - WpsPinInfo pinInfo = (WpsPinInfo)info; - if (pinInfo.GetWpsPin() == null) - { - throw new ArgumentNullException("Wps pin should not be null"); - } - - if (pinInfo.GetWpsPin().Length == 0 || pinInfo.GetWpsPin().Length > 8) - { - throw new ArgumentOutOfRangeException("Wps pin should not be empty or more than 7 characters"); - } - - ret = Interop.WiFi.ConnectByWpsPin(WiFiManagerImpl.Instance.GetSafeHandle(), _apHandle, pinInfo.GetWpsPin(), _callback_map[id], id); - } - - if (ret != (int)WiFiError.None) - { - Log.Error(Globals.LogTag, "Failed to connect wifi, Error - " + (WiFiError)ret); - WiFiErrorFactory.ThrowWiFiException(ret, WiFiManagerImpl.Instance.GetSafeHandle().DangerousGetHandle(), _apHandle); - } - - return task.Task; - } - - /// - /// Connects the access point with WPS without SSID asynchronously. - /// - /// 3 - /// A WpsInfo instance which is of type WpsPbcInfo or WpsPinInfo. - /// A task which contains Connected access point information. - /// - /// If WpsPinInfo is used, its object has to be constructed with a pin which must be 4 or 8 characters long. - /// - /// http://tizen.org/feature/network.wifi - /// http://tizen.org/privilege/network.set - /// http://tizen.org/privilege/network.get - /// http://tizen.org/privilege/network.profile - /// Thrown when the Wi-Fi is not supported. - /// Thrown when permission is denied. - /// Thrown when the WpsPinInfo object is constructed with a null pin. - /// Thrown when the WpsPinInfo object is constructed with a pin which is not of 4 or 8 characters long. - /// Thrown when the system is out of memory. - /// Thrown when the method failed due to an invalid parameter. - /// Thrown when the method failed due to an invalid operation. - public static Task ConnectWpsWithoutSsidAsync(WpsInfo info) - { - TaskCompletionSource task = new TaskCompletionSource(); - IntPtr id; - lock (s_callbackMap) - { - id = (IntPtr)s_requestId++; - s_callbackMap[id] = (error, key) => - { - Log.Debug(Globals.LogTag, "Connecting by WPS finished"); - if (error != (int)WiFiError.None) - { - Log.Error(Globals.LogTag, "Error occurs during WiFi connecting, " + (WiFiError)error); - task.SetException(new InvalidOperationException("Error occurs during WiFi connecting, " + (WiFiError)error)); - } - WiFiAP ap = WiFiManagerImpl.Instance.GetConnectedAP(); - task.SetResult(ap); - lock (s_callbackMap) - { - s_callbackMap.Remove(key); - } - }; - } - - int ret = -1; - if (info.GetType() == typeof(WpsPbcInfo)) - { - ret = Interop.WiFi.ConnectByWpsPbcWithoutSsid(WiFiManagerImpl.Instance.GetSafeHandle(), s_callbackMap[id], id); - } - - else if (info.GetType() == typeof(WpsPinInfo)) - { - WpsPinInfo pinInfo = (WpsPinInfo)info; - if (pinInfo.GetWpsPin() == null) - { - throw new ArgumentNullException("Wps pin should not be null"); - } - - if (pinInfo.GetWpsPin().Length != 4 && pinInfo.GetWpsPin().Length != 8) - { - throw new ArgumentOutOfRangeException("Wps pin should be of 4 or 8 characters long"); - } - - ret = Interop.WiFi.ConnectByWpsPinWithoutSsid(WiFiManagerImpl.Instance.GetSafeHandle(), pinInfo.GetWpsPin(), s_callbackMap[id], id); - } - - if (ret != (int)WiFiError.None) - { - Log.Error(Globals.LogTag, "Failed to connect wifi, Error - " + (WiFiError)ret); - WiFiErrorFactory.ThrowWiFiException(ret, WiFiManagerImpl.Instance.GetSafeHandle().DangerousGetHandle()); - } - - return task.Task; - } - - /// - /// Disconnects the access point asynchronously. - /// - /// 3 - /// A task indicating whether the disconnect method is done or not. - /// http://tizen.org/feature/network.wifi - /// http://tizen.org/privilege/network.set - /// http://tizen.org/privilege/network.get - /// Thrown when the Wi-Fi is not supported. - /// Thrown when permission is denied. - /// Thrown when the object instance is disposed or released. - /// Thrown when the system is out of memory. - /// Thrown when the method failed due to an invalid parameter. - /// Thrown when the method failed due to an invalid operation. - public Task DisconnectAsync() - { - Log.Debug(Globals.LogTag, "DisconnectAsync"); - if (_disposed) - { - throw new ObjectDisposedException("Invalid AP instance (Object may have been disposed or released)"); - } - TaskCompletionSource task = new TaskCompletionSource(); - IntPtr id; - lock (_callback_map) - { - id = (IntPtr)_requestId++; - _callback_map[id] = (error, key) => - { - Log.Debug(Globals.LogTag, "Disconnecting finished"); - if (error != (int)WiFiError.None) - { - Log.Error(Globals.LogTag, "Error occurs during WiFi disconnecting, " + (WiFiError)error); - task.SetException(new InvalidOperationException("Error occurs during WiFi disconnecting, " + (WiFiError)error)); - } - task.SetResult(true); - lock (_callback_map) - { - _callback_map.Remove(key); - } - }; - } - int ret = Interop.WiFi.Disconnect(WiFiManagerImpl.Instance.GetSafeHandle(), _apHandle, _callback_map[id], id); - if (ret != (int)WiFiError.None) - { - Log.Error(Globals.LogTag, "Failed to disconnect wifi, Error - " + (WiFiError)ret); - WiFiErrorFactory.ThrowWiFiException(ret, WiFiManagerImpl.Instance.GetSafeHandle().DangerousGetHandle(), _apHandle); - } - return task.Task; - } - - /// - /// Deletes the information of a stored access point and disconnects it when the AP is connected.
- /// If an AP is connected, then the connection information will be stored. This information is used when a connection to that AP is established automatically. - ///
- /// 3 - /// http://tizen.org/feature/network.wifi - /// http://tizen.org/privilege/network.profile - /// http://tizen.org/privilege/network.get - /// Thrown when the Wi-Fi is not supported. - /// Thrown when permission is denied. - /// Thrown when the object instance is disposed or released. - /// Thrown when the system is out of memory. - /// Thrown when the method failed due to an invalid parameter. - /// Thrown when the method failed due to an invalid operation. - public void ForgetAP() - { - Log.Debug(Globals.LogTag, "ForgetAP"); - if (_disposed) - { - throw new ObjectDisposedException("Invalid AP instance (Object may have been disposed or released)"); - } - int ret = Interop.WiFi.RemoveAP(WiFiManagerImpl.Instance.GetSafeHandle(), _apHandle); - if (ret != (int)WiFiError.None) - { - Log.Error(Globals.LogTag, "Failed to forget AP, Error - " + (WiFiError)ret); - WiFiErrorFactory.ThrowWiFiException(ret, WiFiManagerImpl.Instance.GetSafeHandle().DangerousGetHandle(), _apHandle); - } - } - } - - /// - /// An abstract class which is used to represent the WPS information of the access point. - /// - /// 3 - public abstract class WpsInfo - { - } - - /// - /// A class which is used to represent WPS PBC information of the access point. - /// - public class WpsPbcInfo : WpsInfo - { - } - - /// - /// A class which is used to represent WPS PIN information of the access point. - /// - public class WpsPinInfo : WpsInfo - { - private string _pin; - - private WpsPinInfo() - { - } - - /// - /// A public constructor which instantiates WpsPinInfo class with the given pin. - /// - /// 3 - /// WPS Pin of the access point. - /// - /// Pin should not be null or empty. It should be of less than 8 characters. - /// - public WpsPinInfo(string pin) - { - _pin = pin; - } - - internal string GetWpsPin() - { - return _pin; - } - } -} diff --git a/src/Tizen.Network.WiFi/Tizen.Network.WiFi/WiFiAddressInformation.cs b/src/Tizen.Network.WiFi/Tizen.Network.WiFi/WiFiAddressInformation.cs deleted file mode 100755 index 07506f0dc..000000000 --- a/src/Tizen.Network.WiFi/Tizen.Network.WiFi/WiFiAddressInformation.cs +++ /dev/null @@ -1,271 +0,0 @@ -/* - * 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; -using System.Net; -using Tizen.Network.Connection; - -namespace Tizen.Network.WiFi -{ - internal class WiFiAddressInformation : IAddressInformation - { - private Interop.WiFi.SafeWiFiAPHandle _handle; - private AddressFamily _family; - - internal WiFiAddressInformation(Interop.WiFi.SafeWiFiAPHandle handle, AddressFamily family) - { - _handle = handle; - _family = family; - } - - public System.Net.IPAddress Dns1 - { - get - { - IntPtr addrPtr; - int ret = Interop.WiFi.AP.GetDnsAddress(_handle, 1, (int)_family, out addrPtr); - if (ret != (int)WiFiError.None) - { - Log.Error(Globals.LogTag, "Failed to get first dns address, Error - " + (WiFiError)ret); - return System.Net.IPAddress.Parse("0.0.0.0"); - } - string addrStr = Marshal.PtrToStringAnsi(addrPtr); - Interop.Libc.Free(addrPtr); - if (addrStr == null || addrStr.Length == 0) - return System.Net.IPAddress.Parse("0.0.0.0"); - return System.Net.IPAddress.Parse(addrStr); - } - set - { - int ret = Interop.WiFi.AP.SetDnsAddress(_handle, 1, (int)_family, value.ToString()); - if (ret != (int)WiFiError.None) - { - Log.Error(Globals.LogTag, "Failed to set first dns address, Error - " + (WiFiError)ret); - WiFiErrorFactory.ThrowWiFiException(ret, _handle.DangerousGetHandle()); - } - } - } - - public System.Net.IPAddress Dns2 - { - get - { - IntPtr addrPtr; - int ret = Interop.WiFi.AP.GetDnsAddress(_handle, 2, (int)_family, out addrPtr); - if (ret != (int)WiFiError.None) - { - Log.Error(Globals.LogTag, "Failed to get second dns address, Error - " + (WiFiError)ret); - return System.Net.IPAddress.Parse("0.0.0.0"); - } - string addrStr = Marshal.PtrToStringAnsi(addrPtr); - Interop.Libc.Free(addrPtr); - if (addrStr == null || addrStr.Length == 0) - return System.Net.IPAddress.Parse("0.0.0.0"); - return System.Net.IPAddress.Parse(addrStr); - } - set - { - int ret = Interop.WiFi.AP.SetDnsAddress(_handle, 2, (int)_family, value.ToString()); - if (ret != (int)WiFiError.None) - { - Log.Error(Globals.LogTag, "Failed to set second dns address, Error - " + (WiFiError)ret); - WiFiErrorFactory.ThrowWiFiException(ret, _handle.DangerousGetHandle()); - } - } - } - - public System.Net.IPAddress Gateway - { - get - { - IntPtr addrPtr; - int ret = Interop.WiFi.AP.GetGatewayAddress(_handle, (int)_family, out addrPtr); - if (ret != (int)WiFiError.None) - { - Log.Error(Globals.LogTag, "Failed to get gateway address, Error - " + (WiFiError)ret); - return System.Net.IPAddress.Parse("0.0.0.0"); - } - string addrStr = Marshal.PtrToStringAnsi(addrPtr); - Interop.Libc.Free(addrPtr); - if (addrStr == null || addrStr.Length == 0) - return System.Net.IPAddress.Parse("0.0.0.0"); - return System.Net.IPAddress.Parse(addrStr); - } - set - { - int ret = Interop.WiFi.AP.SetGatewayAddress(_handle, (int)_family, value.ToString()); - if (ret != (int)WiFiError.None) - { - Log.Error(Globals.LogTag, "Failed to set gateway address, Error - " + (WiFiError)ret); - WiFiErrorFactory.ThrowWiFiException(ret, _handle.DangerousGetHandle()); - } - } - } - - public System.Net.IPAddress SubnetMask - { - get - { - IntPtr addrPtr; - int ret = Interop.WiFi.AP.GetSubnetMask(_handle, (int)_family, out addrPtr); - if (ret != (int)WiFiError.None) - { - Log.Error(Globals.LogTag, "Failed to get subnet mask, Error - " + (WiFiError)ret); - return System.Net.IPAddress.Parse("0.0.0.0"); - } - string addrStr = Marshal.PtrToStringAnsi(addrPtr); - Interop.Libc.Free(addrPtr); - if (addrStr == null || addrStr.Length == 0) - return System.Net.IPAddress.Parse("0.0.0.0"); - return System.Net.IPAddress.Parse(addrStr); - } - set - { - int ret = Interop.WiFi.AP.SetSubnetMask(_handle, (int)_family, value.ToString()); - if (ret != (int)WiFiError.None) - { - Log.Error(Globals.LogTag, "Failed to set subnet mask, Error - " + (WiFiError)ret); - WiFiErrorFactory.ThrowWiFiException(ret, _handle.DangerousGetHandle()); - } - } - } - - public System.Net.IPAddress IP - { - get - { - IntPtr addrPtr; - int ret = Interop.WiFi.AP.GetIPAddress(_handle, (int)_family, out addrPtr); - if (ret != (int)WiFiError.None) - { - Log.Error(Globals.LogTag, "Failed to get ip address, Error - " + (WiFiError)ret); - return System.Net.IPAddress.Parse("0.0.0.0"); - } - string addrStr = Marshal.PtrToStringAnsi(addrPtr); - Interop.Libc.Free(addrPtr); - if (addrStr == null || addrStr.Length == 0) - return System.Net.IPAddress.Parse("0.0.0.0"); - return System.Net.IPAddress.Parse(addrStr); - } - set - { - int ret = Interop.WiFi.AP.SetIPAddress(_handle, (int)_family, value.ToString()); - if (ret != (int)WiFiError.None) - { - Log.Error(Globals.LogTag, "Failed to set ip address, Error - " + (WiFiError)ret); - WiFiErrorFactory.ThrowWiFiException(ret, _handle.DangerousGetHandle()); - } - } - } - - public IPConfigType IPConfigType - { - get - { - int type; - int ret = Interop.WiFi.AP.GetIPConfigType(_handle, (int)_family, out type); - if (ret != (int)WiFiError.None) - { - Log.Error(Globals.LogTag, "Failed to get ip config type, Error - " + (WiFiError)ret); - } - return (IPConfigType)type; - } - set - { - int ret = Interop.WiFi.AP.SetIPConfigType(_handle, (int)_family, (int)value); - if (ret != (int)WiFiError.None) - { - Log.Error(Globals.LogTag, "Failed to set ip config type, Error - " + (WiFiError)ret); - WiFiErrorFactory.ThrowWiFiException(ret, _handle.DangerousGetHandle()); - } - } - } - - public int PrefixLength - { - get - { - int Value; - int ret = Interop.WiFi.AP.GetPrefixLength(_handle, (int)_family, out Value); - if (ret != (int)WiFiError.None) - { - Log.Error(Globals.LogTag, "It failed to get prefix length, " + (WiFiError)ret); - return -1; - } - return Value; - } - - set - { - int ret = Interop.WiFi.AP.SetPrefixLength(_handle, (int)_family, value); - if (ret != (int)WiFiError.None) - { - Log.Error(Globals.LogTag, "It failed to set prefix length, " + (WiFiError)ret); - WiFiErrorFactory.ThrowWiFiException(ret, _handle.DangerousGetHandle()); - } - } - } - - public DnsConfigType DnsConfigType - { - get - { - int Value; - int ret = Interop.WiFi.AP.GetDnsConfigType(_handle, (int)_family, out Value); - if ((WiFiError)ret != WiFiError.None) - { - Log.Error(Globals.LogTag, "It failed to get DNS config type, " + (WiFiError)ret); - } - return (DnsConfigType)Value; - } - set - { - int ret = Interop.WiFi.AP.SetDnsConfigType(_handle, (int)_family, (int)value); - if ((WiFiError)ret != WiFiError.None) - { - Log.Error(Globals.LogTag, "It failed to set DNS config type, " + (WiFiError)ret); - WiFiErrorFactory.ThrowWiFiException(ret, _handle.DangerousGetHandle()); - } - } - } - - /// - /// DHCP server address. It is only supported for IPv4 address family. - /// - /// Represents DHCP server address. - public System.Net.IPAddress DhcpServerAddress - { - get - { - string dhcpServer; - int ret = Interop.WiFi.AP.GetDhcpServerAddress(_handle, AddressFamily.IPv4, out dhcpServer); - if (ret != (int)WiFiError.None) - { - Log.Error(Globals.LogTag, "Failed to get DHCP server address, Error - " + (WiFiError)ret); - } - - if (dhcpServer == null || dhcpServer.Length == 0) - { - return IPAddress.Parse("0.0.0.0"); - } - - return IPAddress.Parse(dhcpServer); - } - } - - } -} diff --git a/src/Tizen.Network.WiFi/Tizen.Network.WiFi/WiFiConfiguration.cs b/src/Tizen.Network.WiFi/Tizen.Network.WiFi/WiFiConfiguration.cs deleted file mode 100755 index 199785db2..000000000 --- a/src/Tizen.Network.WiFi/Tizen.Network.WiFi/WiFiConfiguration.cs +++ /dev/null @@ -1,232 +0,0 @@ -/* - * 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.Net; -using System.Threading.Tasks; -using System.Runtime.InteropServices; -using Tizen.Network.Connection; - -namespace Tizen.Network.WiFi -{ - /// - /// A class for managing the configuration of Wi-Fi. - /// - /// 3 - public class WiFiConfiguration : IDisposable - { - private IntPtr _configHandle = IntPtr.Zero; - private bool _disposed = false; - private WiFiEapConfiguration _eapConfig; - - /// - /// The name of the access point (AP). - /// - /// 3 - /// Name assigned to AP in the Wi-Fi configuration. - public string Name - { - get - { - IntPtr strPtr; - int ret = Interop.WiFi.Config.GetName(_configHandle, out strPtr); - if (ret != (int)WiFiError.None) - { - Log.Error(Globals.LogTag, "Failed to get name, Error - " + (WiFiError)ret); - return ""; - } - return Marshal.PtrToStringAnsi(strPtr); - } - } - - /// - /// The security type of the access point (AP). - /// - /// 3 - /// Security type of AP in the Wi-Fi configuration. - public WiFiSecurityType SecurityType - { - get - { - int type; - int ret = Interop.WiFi.Config.GetSecurityType(_configHandle, out type); - if (ret != (int)WiFiError.None) - { - Log.Error(Globals.LogTag, "Failed to get security type, Error - " + (WiFiError)ret); - } - return (WiFiSecurityType)type; - } - } - - /// - /// The proxy address. - /// - /// 3 - /// Proxy address of the access point. - /// Thrown while setting this property when Wi-Fi is not supported. - /// Thrown while setting this property due to an invalid parameter. - /// Thrown while setting this value due to an invalid operation. - public string ProxyAddress - { - get - { - IntPtr strPtr; - int addressFamily; - int ret = Interop.WiFi.Config.GetProxyAddress(_configHandle, out addressFamily, out strPtr); - if (ret != (int)WiFiError.None) - { - Log.Error(Globals.LogTag, "Failed to get proxy address, Error - " + (WiFiError)ret); - return ""; - } - return Marshal.PtrToStringAnsi(strPtr); - } - set - { - if (_disposed) - { - throw new ObjectDisposedException("Invalid WiFiConfiguration instance (Object may have been disposed or released)"); - } - int ret = Interop.WiFi.Config.SetProxyAddress(_configHandle, (int)AddressFamily.IPv4, value); - if (ret != (int)WiFiError.None) - { - Log.Error(Globals.LogTag, "Failed to set proxy address, Error - " + (WiFiError)ret); - WiFiErrorFactory.ThrowWiFiException(ret, _configHandle); - } - } - } - - /// - /// A property check whether the access point (AP) is hidden. - /// - /// 3 - /// Boolean value indicating whether the AP is hidden. - /// Thrown while setting this property when the Wi-Fi is not supported. - /// Thrown while setting this property due to an invalid parameter. - /// Thrown while setting this value due to an invalid operation. - public bool IsHidden - { - get - { - bool hidden; - int ret = Interop.WiFi.Config.GetHiddenAPProperty(_configHandle, out hidden); - if (ret != (int)WiFiError.None) - { - Log.Error(Globals.LogTag, "Failed to get isHidden, Error - " + (WiFiError)ret); - } - return hidden; - } - set - { - if (_disposed) - { - throw new ObjectDisposedException("Invalid WiFiConfiguration instance (Object may have been disposed or released)"); - } - int ret = Interop.WiFi.Config.SetHiddenAPProperty(_configHandle, value); - if (ret != (int)WiFiError.None) - { - Log.Error(Globals.LogTag, "Failed to set IsHidden, Error - " + (WiFiError)ret); - WiFiErrorFactory.ThrowWiFiException(ret, _configHandle); - } - } - } - - /// - /// EAP configuration. - /// - /// 3 - /// EAP configuration assigned to the Wi-Fi. - public WiFiEapConfiguration EapConfiguration - { - get - { - return _eapConfig; - } - } - - internal WiFiConfiguration(IntPtr handle) - { - _configHandle = handle; - Interop.WiFi.SafeWiFiConfigHandle configHandle = new Interop.WiFi.SafeWiFiConfigHandle(handle); - _eapConfig = new WiFiEapConfiguration(configHandle); - } - - /// - /// Creates a WiFiConfiguration object with the given name, passphrase, and securetype. - /// - /// 3 - /// Name of the Wi-Fi. - /// Password to access the Wi-Fi. - /// Security type of the Wi-Fi. - /// http://tizen.org/feature/network.wifi - /// http://tizen.org/privilege/network.get - /// Thrown when the Wi-Fi is not supported. - /// Thrown when permission is denied. - /// Thrown when the object is constructed with name as null. - /// Thrown when the system is out of memory. - /// Thrown when the method failed due to an invalid parameter. - /// Thrown when the method failed due to an invalid operation. - public WiFiConfiguration(string name, string passPhrase, WiFiSecurityType type) - { - if (name == null) - { - throw new ArgumentNullException("Name of the WiFi is null"); - } - - int ret = Interop.WiFi.Config.Create(WiFiManagerImpl.Instance.GetSafeHandle(), name, passPhrase, (int)type, out _configHandle); - if (ret != (int)WiFiError.None) - { - Log.Error(Globals.LogTag, "Failed to create config handle, Error - " + (WiFiError)ret); - WiFiErrorFactory.ThrowWiFiException(ret, WiFiManagerImpl.Instance.GetSafeHandle().DangerousGetHandle()); - } - - Interop.WiFi.SafeWiFiConfigHandle configHandle = new Interop.WiFi.SafeWiFiConfigHandle(_configHandle); - _eapConfig = new WiFiEapConfiguration(configHandle); - } - - ~WiFiConfiguration() - { - Dispose(false); - } - - /// - /// A method to destroy the managed objects in the WiFiConfiguration. - /// - /// 3 - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - - private void Dispose(bool disposing) - { - if (_disposed) - return; - - if (disposing) - { - Interop.WiFi.Config.Destroy(_configHandle); - _configHandle = IntPtr.Zero; - } - _disposed = true; - } - - internal IntPtr GetHandle() - { - return _configHandle; - } - } //WiFiNetworkConfiguratin -} diff --git a/src/Tizen.Network.WiFi/Tizen.Network.WiFi/WiFiEap.cs b/src/Tizen.Network.WiFi/Tizen.Network.WiFi/WiFiEap.cs deleted file mode 100755 index ace465d07..000000000 --- a/src/Tizen.Network.WiFi/Tizen.Network.WiFi/WiFiEap.cs +++ /dev/null @@ -1,325 +0,0 @@ -/* - * 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.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; -using System.Runtime.InteropServices; - -namespace Tizen.Network.WiFi -{ - /// - /// A class for managing the EAP information of the access point (AP). - /// - /// 3 - public class WiFiEap : IWiFiEap - { - private Interop.WiFi.SafeWiFiAPHandle _apHandle; - - /// - /// The file path of CA Certificate of EAP. - /// - /// 3 - /// CA certification file of EAP. - /// Thrown while setting this value when Wi-Fi is not supported. - /// Thrown while setting this value when the file value is null. - /// Thrown while setting this property due to an invalid parameter. - /// Thrown while setting this value due to an invalid operation. - public string CaCertificationFile - { - get - { - IntPtr strPtr; - int ret = Interop.WiFi.AP.GetEapCaCertFile(_apHandle, out strPtr); - if (ret != (int)WiFiError.None) - { - Log.Error(Globals.LogTag, "Failed to get caCertFile, Error - " + (WiFiError)ret); - return ""; - } - return Marshal.PtrToStringAnsi(strPtr); - } - set - { - if (value == null) - { - throw new ArgumentNullException("File value is null"); - } - int ret = Interop.WiFi.AP.SetEapCaCertFile(_apHandle, value); - if (ret != (int)WiFiError.None) - { - Log.Error(Globals.LogTag, "Failed to set caCertFile, Error - " + (WiFiError)ret); - WiFiErrorFactory.ThrowWiFiException(ret, _apHandle.DangerousGetHandle()); - } - } - } - - /// - /// The EAP type of Wi-Fi. - /// - /// 3 - /// Type of EAP. - /// Thrown while setting this value when Wi-Fi is not supported. - /// Thrown while setting this property due to an invalid parameter. - /// Thrown while setting this value due to an invalid operation. - public WiFiEapType EapType - { - get - { - int type; - int ret = Interop.WiFi.AP.GetEapType(_apHandle, out type); - if (ret != (int)WiFiError.None) - { - Log.Error(Globals.LogTag, "Failed to get eap type, Error - " + (WiFiError)ret); - } - return (WiFiEapType)type; - } - set - { - int ret = Interop.WiFi.AP.SetEapType(_apHandle, (int)value); - if (ret != (int)WiFiError.None) - { - Log.Error(Globals.LogTag, "Failed to set eap type, Error - " + (WiFiError)ret); - WiFiErrorFactory.ThrowWiFiException(ret, _apHandle.DangerousGetHandle()); - } - } - } - - /// - /// The type of EAP phase 2 authentication of the Wi-Fi. - /// - /// 3 - /// Authentication type of the Wi-Fi. - /// Thrown while setting this value when Wi-Fi is not supported. - /// Thrown while setting this property due to an invalid parameter. - /// Thrown while setting this value due to an invalid operation. - public WiFiAuthenticationType AuthenticationType - { - get - { - int type; - int ret = Interop.WiFi.AP.GetEapAuthType(_apHandle, out type); - if (ret != (int)WiFiError.None) - { - Log.Error(Globals.LogTag, "Failed to get auth type, Error - " + (WiFiError)ret); - } - return (WiFiAuthenticationType)type; - } - set - { - int ret = Interop.WiFi.AP.SetEapAuthType(_apHandle, (int)value); - if (ret != (int)WiFiError.None) - { - Log.Error(Globals.LogTag, "Failed to set eap auth type, Error - " + (WiFiError)ret); - WiFiErrorFactory.ThrowWiFiException(ret, _apHandle.DangerousGetHandle()); - } - } - } - - internal WiFiEap(Interop.WiFi.SafeWiFiAPHandle apHandle) - { - _apHandle = apHandle; - } - - /// - /// Gets the private key file of EAP. - /// - /// 3 - /// The file path of private key. - /// http://tizen.org/feature/network.wifi - /// Thrown when the Wi-Fi is not supported. - /// Thrown when the system is out of memory. - /// Thrown when the method fails due to an invalid parameter. - /// Thrown when the method fails due to an invalid operation. - public string GetPrivateKeyFile() - { - IntPtr strPtr; - int ret = Interop.WiFi.AP.GetEapPrivateKeyFile(_apHandle, out strPtr); - if (ret != (int)WiFiError.None) - { - Log.Error(Globals.LogTag, "Failed to get private key file, Error - " + (WiFiError)ret); - WiFiErrorFactory.ThrowWiFiException(ret, _apHandle.DangerousGetHandle()); - } - return Marshal.PtrToStringAnsi(strPtr); - } - - /// - /// Sets the private key information of EAP. - /// - /// 3 - /// The file path of private key. - /// The password. - /// http://tizen.org/feature/network.wifi - /// Thrown when the Wi-Fi is not supported. - /// Thrown when the file path of private key is null. - /// Thrown when the method failed due to an invalid parameter. - /// Thrown when the method failed due an to invalid operation. - public void SetPrivateKeyFile(string privateKeyFile, string password) - { - if (privateKeyFile == null) - { - throw new ArgumentNullException("File path of private key is null"); - } - int ret = Interop.WiFi.AP.SetEapPrivateKeyFile(_apHandle, privateKeyFile, password); - if (ret != (int)WiFiError.None) - { - Log.Error(Globals.LogTag, "Failed to set private key file, Error - " + (WiFiError)ret); - WiFiErrorFactory.ThrowWiFiException(ret, _apHandle.DangerousGetHandle()); - } - } - - /// - /// Gets the client certificate of EAP. - /// - /// 3 - /// The file path of client certificate. - /// http://tizen.org/feature/network.wifi - /// Thrown when the Wi-Fi is not supported. - /// Thrown when the system is out of memory. - /// Thrown when the method failed due to an invalid parameter. - /// Thrown when the method failed due an to invalid operation. - public string GetClientCertFile() - { - IntPtr strPtr; - int ret = Interop.WiFi.AP.GetEapClientCertFile(_apHandle, out strPtr); - if (ret != (int)WiFiError.None) - { - Log.Error(Globals.LogTag, "Failed to get client cert file, Error - " + (WiFiError)ret); - WiFiErrorFactory.ThrowWiFiException(ret, _apHandle.DangerousGetHandle()); - } - return Marshal.PtrToStringAnsi(strPtr); - } - - /// - /// Sets the CA certificate of EAP. - /// - /// 3 - /// The file path of client certificate. - /// http://tizen.org/feature/network.wifi - /// Thrown when the Wi-Fi is not supported. - /// Thrown when the file path of client certificate is null. - /// Thrown when the method failed due to an invalid parameter. - /// Thrown when the method failed due to an invalid operation. - public void SetClientCertFile(string clientCertFile) - { - if (clientCertFile == null) - { - throw new ArgumentNullException("File path of Client certificate is null"); - } - int ret = Interop.WiFi.AP.SetEapClientCertFile(_apHandle, clientCertFile); - if (ret != (int)WiFiError.None) - { - Log.Error(Globals.LogTag, "Failed to set client cert file, Error - " + (WiFiError)ret); - WiFiErrorFactory.ThrowWiFiException(ret, _apHandle.DangerousGetHandle()); - } - } - - /// - /// Gets the username of EAP passphrase. - /// - /// 3 - /// The user name - /// http://tizen.org/feature/network.wifi - /// Thrown when the Wi-Fi is not supported. - /// Thrown when the system is out of memory. - /// Thrown when the method failed due to an invalid parameter. - /// Thrown when the method failed due to an invalid operation. - public string GetUserName() - { - IntPtr strptr; - bool passwordSet; - int ret = Interop.WiFi.AP.GetEapPassphrase(_apHandle, out strptr, out passwordSet); - if (ret != (int)WiFiError.None) - { - Log.Error(Globals.LogTag, "Failed to get user name in eap passphrase, Error - " + (WiFiError)ret); - WiFiErrorFactory.ThrowWiFiException(ret, _apHandle.DangerousGetHandle()); - } - return Marshal.PtrToStringAnsi(strptr); - } - - /// - /// Returns whether the password is set or not. - /// - /// 3 - /// True if password is set, false if password is not set. - /// http://tizen.org/feature/network.wifi - /// Thrown when the Wi-Fi is not supported. - /// Thrown when the system is out of memory. - /// Thrown when the method failed due to an invalid parameter. - /// Thrown when the method failed due to an invalid operation. - public bool IsPasswordSet() - { - IntPtr strptr; - bool passwordSet; - int ret = Interop.WiFi.AP.GetEapPassphrase(_apHandle, out strptr, out passwordSet); - if (ret != (int)WiFiError.None) - { - Log.Error(Globals.LogTag, "Failed to get IsPasswordSet in passphrase, Error - " + (WiFiError)ret); - WiFiErrorFactory.ThrowWiFiException(ret, _apHandle.DangerousGetHandle()); - } - return passwordSet; - } - - /// - /// Sets the user name of EAP. - /// - /// 3 - /// The user name - /// http://tizen.org/feature/network.wifi - /// Thrown when the Wi-Fi is not supported. - /// Thrown when the user name is passed as null. - /// Thrown when the method failed due to an invalid parameter. - /// Thrown when the method failed due to an invalid operation. - public void SetUserName(string userName) - { - if (userName == null) - { - throw new ArgumentNullException("User name is null"); - } - int ret = Interop.WiFi.AP.SetEapPassphrase(_apHandle, userName, null); - if (ret != (int)WiFiError.None) - { - Log.Error(Globals.LogTag, "Failed to set username, Error - " + (WiFiError)ret); - WiFiErrorFactory.ThrowWiFiException(ret, _apHandle.DangerousGetHandle()); - } - } - - /// - /// Sets the password of EAP. - /// - /// 3 - /// The password - /// http://tizen.org/feature/network.wifi - /// Thrown when the Wi-Fi is not supported. - /// Thrown when the password is passed as null. - /// Thrown when the method failed due to an invalid parameter. - /// Thrown when the method failed due to an invalid operation. - public void SetPassword(string password) - { - if (password == null) - { - throw new ArgumentNullException("Password is null"); - } - int ret = Interop.WiFi.AP.SetEapPassphrase(_apHandle, null, password); - if (ret != (int)WiFiError.None) - { - Log.Error(Globals.LogTag, "Failed to set password, Error - " + (WiFiError)ret); - WiFiErrorFactory.ThrowWiFiException(ret, _apHandle.DangerousGetHandle()); - } - } - } //WiFiEapInformation -} diff --git a/src/Tizen.Network.WiFi/Tizen.Network.WiFi/WiFiEapConfiguration.cs b/src/Tizen.Network.WiFi/Tizen.Network.WiFi/WiFiEapConfiguration.cs deleted file mode 100755 index 0add9485d..000000000 --- a/src/Tizen.Network.WiFi/Tizen.Network.WiFi/WiFiEapConfiguration.cs +++ /dev/null @@ -1,266 +0,0 @@ -/* - * 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; - -namespace Tizen.Network.WiFi -{ - /// - /// A class for managing the EAP configuration. - /// - /// 3 - public class WiFiEapConfiguration : IWiFiEap - { - private Interop.WiFi.SafeWiFiConfigHandle _configHandle; - - /// - /// The file path of CA certificate of EAP. - /// - /// 3 - /// CA certification file of EAP. - /// Thrown while setting this value when Wi-Fi is not supported. - /// Thrown while setting this property due to an invalid parameter. - /// Thrown while setting this value due to an invalid operation. - public string CaCertificationFile - { - get - { - IntPtr strPtr; - int ret = Interop.WiFi.Config.GetEapCaCertFile(_configHandle, out strPtr); - if (ret != (int)WiFiError.None) - { - Log.Error(Globals.LogTag, "Failed to get caCertFile Error - " + (WiFiError)ret); - return ""; - } - return Marshal.PtrToStringAnsi(strPtr); - } - set - { - int ret = Interop.WiFi.Config.SetEapCaCertFile(_configHandle, value); - if (ret != (int)WiFiError.None) - { - Log.Error(Globals.LogTag, "Failed to set caCertFile, Error - " + (WiFiError)ret); - WiFiErrorFactory.ThrowWiFiException(ret, _configHandle.DangerousGetHandle()); - } - } - } - - /// - /// The EAP type of the Wi-Fi. - /// - /// 3 - /// Type of EAP. - /// Thrown while setting this value when Wi-Fi is not supported. - /// Thrown while setting this property due to an invalid parameter. - /// Thrown while setting this value due to an invalid operation. - public WiFiEapType EapType - { - get - { - int type; - int ret = Interop.WiFi.Config.GetEapType(_configHandle, out type); - if (ret != (int)WiFiError.None) - { - Log.Error(Globals.LogTag, "Failed to eap type Error - " + (WiFiError)ret); - } - return (WiFiEapType)type; - } - set - { - int ret = Interop.WiFi.Config.SetEapType(_configHandle, (int)value); - if (ret != (int)WiFiError.None) - { - Log.Error(Globals.LogTag, "Failed to set eap type, Error - " + (WiFiError)ret); - WiFiErrorFactory.ThrowWiFiException(ret, _configHandle.DangerousGetHandle()); - } - } - } - - /// - /// The type of EAP phase2 authentication of the Wi-Fi. - /// - /// 3 - /// Authentication type of the Wi-Fi. - /// Thrown while setting this value when Wi-Fi is not supported. - /// Thrown while setting this property due to an invalid parameter. - /// Thrown while setting this value due to an invalid operation. - public WiFiAuthenticationType AuthenticationType - { - get - { - int type; - int ret = Interop.WiFi.Config.GetEapAuthType(_configHandle, out type); - if (ret != (int)WiFiError.None) - { - Log.Error(Globals.LogTag, "Failed to get auth type Error - " + (WiFiError)ret); - } - return (WiFiAuthenticationType)type; - } - set - { - int ret = Interop.WiFi.Config.SetEapAuthType(_configHandle, (int)value); - if (ret != (int)WiFiError.None) - { - Log.Error(Globals.LogTag, "Failed to set eap auth type, Error - " + (WiFiError)ret); - WiFiErrorFactory.ThrowWiFiException(ret, _configHandle.DangerousGetHandle()); - } - } - } - - /// - /// The anonymous identity of the access point (AP). - /// - /// 3 - /// Represents the anonymous identity of the access point. - /// Thrown while setting this value when Wi-Fi is not supported. - /// Thrown while setting this property due to an invalid parameter. - /// Thrown while setting this value due to an invalid operation. - public string AnonymousIdentify - { - get - { - IntPtr strPtr; - int ret = Interop.WiFi.Config.GetEapAnonymousIdentity(_configHandle, out strPtr); - if (ret != (int)WiFiError.None) - { - Log.Error(Globals.LogTag, "Failed to get anonymous identify Error - " + (WiFiError)ret); - return ""; - } - return Marshal.PtrToStringAnsi(strPtr); - } - set - { - int ret = Interop.WiFi.Config.SetEapAnonymousIdentity(_configHandle, value); - if (ret != (int)WiFiError.None) - { - Log.Error(Globals.LogTag, "Failed to set anonymous identify, Error - " + (WiFiError)ret); - WiFiErrorFactory.ThrowWiFiException(ret, _configHandle.DangerousGetHandle()); - } - } - } - - /// - /// The identity of the access point (AP). - /// - /// 3 - /// Represents the identity of the access point. - /// Thrown while setting this value when Wi-Fi is not supported. - /// Thrown while setting this property due to an invalid parameter. - /// Thrown while setting this value due to an invalid operation. - public string Identity - { - get - { - IntPtr strPtr; - int ret = Interop.WiFi.Config.GetEapIdentity(_configHandle, out strPtr); - if (ret != (int)WiFiError.None) - { - Log.Error(Globals.LogTag, "Failed to get identify Error - " + (WiFiError)ret); - return ""; - } - return Marshal.PtrToStringAnsi(strPtr); - } - set - { - int ret = Interop.WiFi.Config.SetEapIdentity(_configHandle, value); - if (ret != (int)WiFiError.None) - { - Log.Error(Globals.LogTag, "Failed to set identify, Error - " + (WiFiError)ret); - WiFiErrorFactory.ThrowWiFiException(ret, _configHandle.DangerousGetHandle()); - } - } - } - - /// - /// The subject match of the access point (AP). - /// - /// 3 - /// Represents the subject match of the AP. - /// Thrown while setting this value when Wi-Fi is not supported. - /// Thrown while setting this property due to an invalid parameter. - /// Thrown while setting this value due to an invalid operation. - public string SubjectMatch - { - get - { - IntPtr strPtr; - int ret = Interop.WiFi.Config.GetEapSubjectMatch(_configHandle, out strPtr); - if (ret != (int)WiFiError.None) - { - Log.Error(Globals.LogTag, "Failed to get subject match Error - " + (WiFiError)ret); - return ""; - } - return Marshal.PtrToStringAnsi(strPtr); - } - set - { - int ret = Interop.WiFi.Config.SetEapSubjectMatch(_configHandle, value); - if (ret != (int)WiFiError.None) - { - Log.Error(Globals.LogTag, "Failed to set subject match, Error - " + (WiFiError)ret); - WiFiErrorFactory.ThrowWiFiException(ret, _configHandle.DangerousGetHandle()); - } - } - } - - internal WiFiEapConfiguration(Interop.WiFi.SafeWiFiConfigHandle handle) - { - _configHandle = handle; - } - - /// - /// Gets the access point client certificate file from the configuration. - /// - /// 3 - /// The certification authority (CA) certificates file of the access point. - /// http://tizen.org/feature/network.wifi - /// Thrown when the Wi-Fi is not supported. - /// Thrown when the method failed due to an invalid parameter. - /// Thrown when the method failed due to an invalid operation. - public string GetClientCertFile() - { - IntPtr strPtr; - int ret = Interop.WiFi.Config.GetEapClientCertFile(_configHandle, out strPtr); - if (ret != (int)WiFiError.None) - { - Log.Error(Globals.LogTag, "Failed to get client cert file, Error - " + (WiFiError)ret); - WiFiErrorFactory.ThrowWiFiException(ret, _configHandle.DangerousGetHandle()); - } - return Marshal.PtrToStringAnsi(strPtr); - } - - /// - /// Sets the access point client certificate file to configuration. - /// - /// 3 - /// The private key file. - /// The certification authority(CA) certifies the files of access points. - /// http://tizen.org/feature/network.wifi - /// Thrown when the Wi-Fi is not supported. - /// Thrown when the method failed due to an invalid parameter. - /// Thrown when the method failed due to an invalid operation. - public void SetClientCertFile(string privateKey, string clientCert) - { - int ret = Interop.WiFi.Config.SetEapClientCertFile(_configHandle, privateKey, clientCert); - if (ret != (int)WiFiError.None) - { - Log.Error(Globals.LogTag, "Failed to set client cert file, Error - " + (WiFiError)ret); - WiFiErrorFactory.ThrowWiFiException(ret, _configHandle.DangerousGetHandle()); - } - } - } //WiFiEapConfiguration -} diff --git a/src/Tizen.Network.WiFi/Tizen.Network.WiFi/WiFiEnumerations.cs b/src/Tizen.Network.WiFi/Tizen.Network.WiFi/WiFiEnumerations.cs deleted file mode 100755 index 2fc3656f5..000000000 --- a/src/Tizen.Network.WiFi/Tizen.Network.WiFi/WiFiEnumerations.cs +++ /dev/null @@ -1,198 +0,0 @@ -/* - * 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.Network.WiFi -{ - /// - /// Enumeration for the Wi-Fi EAP types. - /// - /// 3 - public enum WiFiEapType - { - /// - /// EAP PEAP type. - /// - /// 3 - Peap = 0, - /// - /// EAP TLS type. - /// - /// 3 - Tls = 1, - /// - /// The EAP TTLS type. - /// - /// 3 - Ttls = 2, - /// - /// EAP SIM type. - /// - /// 3 - Sim = 3, - /// - /// EAP AKA type. - /// - /// 3 - Aka = 4 - } - - /// - /// Enumeration for the Wi-Fi RSSI levels. - /// - /// 3 - public enum WiFiRssiLevel - { - /// - /// Level 0. - /// - /// 3 - Level0 = 0, - /// - /// Level 1. - /// - /// 3 - Level1 = 1, - /// - /// Level 2. - /// - /// 3 - Level2 = 2, - /// - /// Level 3. - /// - /// 3 - Level3 = 3, - /// - /// Level 4. - /// - /// 3 - Level4 = 4 - } - - /// - /// Enumeration for the Wi-Fi connection states. - /// - /// 3 - public enum WiFiConnectionState - { - /// - /// Connection failed state. - /// - /// 3 - Failure = -1, - /// - /// Disconnected state. - /// - /// 3 - Disconnected = 0, - /// - /// Association state. - /// - /// 3 - Association = 1, - /// - /// Configuration state. - /// - /// 3 - Congfiguration = 2, - /// - /// Connected state. - /// - /// 3 - Connected = 3 - } - - /// - /// Enumeration for the Wi-Fi device states. - /// - /// 3 - public enum WiFiDeviceState - { - /// - /// Wi-Fi is deactivated. - /// - /// 3 - Deactivated = 0, - /// - /// Wi-Fi is activated. - /// - /// 3 - Activated = 1 - } - - /// - /// Enumeration for the Wi-Fi proxy types. - /// - /// 3 - public enum WiFiProxyType - { - /// - /// Direct connection. - /// - /// 3 - Direct = 0, - /// - /// Auto configuration(Use PAC file). If the URL property is not set, DHCP/WPAD auto-discover will be tried. - /// - /// 3 - Auto = 1, - /// - /// Manual configuration. - /// - /// 3 - Manual = 2 - } - - /// - /// Enumeration for the Wi-Fi authentication types. - /// - /// 3 - public enum WiFiAuthenticationType - { - /// - /// EAP phase 2 authentication none. - /// - /// 3 - None = 0, - /// - /// EAP phase 2 authentication PAP. - /// - /// 3 - Pap = 1, - /// - /// EAP phase 2 authentication MSCHAP. - /// - /// 3 - Mschap = 2, - /// - /// EAP phase 2 authentication MSCHAPv2. - /// - /// 3 - Mschapv2 = 3, - /// - /// EAP phase 2 authentication GTC. - /// - /// 3 - Gtc = 4, - /// - /// EAP phase 2 authentication MD5. - /// - /// 3 - Md5 = 5 - } -} diff --git a/src/Tizen.Network.WiFi/Tizen.Network.WiFi/WiFiErrorFactory.cs b/src/Tizen.Network.WiFi/Tizen.Network.WiFi/WiFiErrorFactory.cs deleted file mode 100755 index 1b43a1db0..000000000 --- a/src/Tizen.Network.WiFi/Tizen.Network.WiFi/WiFiErrorFactory.cs +++ /dev/null @@ -1,100 +0,0 @@ -/* - * 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.Network.WiFi -{ - internal enum WiFiError - { - None = ErrorCode.None, - InvalidParameterError = ErrorCode.InvalidParameter, - OutOfMemoryError = ErrorCode.OutOfMemory, - InvalidOperationError = ErrorCode.InvalidOperation, - AddressFamilyNotSupportedError = ErrorCode.AddressFamilyNotSupported, - OperationFailedError = -0x01C50000 | 0x0301, - NoConnectionError = -0x01C50000 | 0x0302, - NowInProgressError = ErrorCode.NowInProgress, - AlreadyExistsError = -0x01C50000 | 0x0303, - OperationAbortedError = -0x01C50000 | 0x0304, - DhcpFailedError = -0x01C50000 | 0x0306, - InvalidKeyError = -0x01C50000 | 0x0307, - NoReplyError = -0x01C50000 | 0x0308, - SecurityRestrictedError = -0x01C50000 | 0x0309, - PermissionDeniedError = ErrorCode.PermissionDenied, - NotSupportedError = ErrorCode.NotSupported - } - - internal static class WiFiErrorFactory - { - static internal void ThrowWiFiException(int e, IntPtr handle) - { - ThrowExcption(e, (handle == IntPtr.Zero), false, ""); - } - - static internal void ThrowWiFiException(int e, IntPtr handle1, IntPtr handle2) - { - ThrowExcption(e, (handle1 == IntPtr.Zero), (handle2 == IntPtr.Zero), ""); - } - - static internal void ThrowWiFiException(int e, string message) - { - ThrowExcption(e, false, false, message); - } - - static internal void ThrowWiFiException(int e, IntPtr handle, string message) - { - ThrowExcption(e, (handle == IntPtr.Zero), false, message); - } - - static internal void ThrowWiFiException(int e, IntPtr handle1, IntPtr handle2, string message) - { - ThrowExcption(e, (handle1 == IntPtr.Zero), (handle2 == IntPtr.Zero), message); - } - - static private void ThrowExcption(int e, bool isHandle1Null, bool isHandle2Null, string message) - { - WiFiError err = (WiFiError)e; - if (err == WiFiError.NotSupportedError) - { - throw new NotSupportedException("Unsupported feature http://tizen.org/feature/network.wifi"); - } - - if (err == WiFiError.PermissionDeniedError) - { - throw new UnauthorizedAccessException("Permission denied " + message); - } - - if (err == WiFiError.OutOfMemoryError) - { - throw new OutOfMemoryException("Out of memory"); - } - - if (err == WiFiError.InvalidParameterError || err == WiFiError.InvalidKeyError) - { - if (isHandle1Null || isHandle2Null) - { - throw new InvalidOperationException("Invalid instance (object may have been disposed or released)"); - } - - throw new ArgumentException("Invalid parameter"); - } - - throw new InvalidOperationException(err.ToString()); - } - } -} diff --git a/src/Tizen.Network.WiFi/Tizen.Network.WiFi/WiFiManager.cs b/src/Tizen.Network.WiFi/Tizen.Network.WiFi/WiFiManager.cs deleted file mode 100755 index 1f2dbc98f..000000000 --- a/src/Tizen.Network.WiFi/Tizen.Network.WiFi/WiFiManager.cs +++ /dev/null @@ -1,378 +0,0 @@ -/* - * 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.Collections.Generic; -using System.Runtime.InteropServices; -using System.Threading.Tasks; -using System.ComponentModel; - -namespace Tizen.Network.WiFi -{ - /// - /// A class for managing the WiFiManager handle. - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public sealed class SafeWiFiManagerHandle : SafeHandle - { - internal SafeWiFiManagerHandle() : base(IntPtr.Zero, true) - { - } - - /// - /// Checks the validity of the handle. - /// - /// Represents the validity of the handle. - public override bool IsInvalid - { - get - { - return this.handle == IntPtr.Zero; - } - } - - protected override bool ReleaseHandle() - { - Interop.WiFi.Deinitialize(this.handle); - this.SetHandle(IntPtr.Zero); - return true; - } - } - - /// - /// A manager class which allows applications to connect to a Wireless Local Area Network (WLAN) and transfer data over the network.
- /// The Wi-Fi Manager enables your application to activate and deactivate a local Wi-Fi device, and to connect to a WLAN network in the infrastructure mode. - ///
- /// 3 - static public class WiFiManager - { - /// - /// The local MAC address. - /// - /// 3 - /// Represents the MAC address of the Wi-Fi. - /// http://tizen.org/privilege/network.get - static public string MacAddress - { - get - { - return WiFiManagerImpl.Instance.MacAddress; - } - } - - /// - /// The name of the network interface. - /// - /// 3 - /// Interface name of the Wi-Fi. - /// http://tizen.org/privilege/network.get - static public string InterfaceName - { - get - { - return WiFiManagerImpl.Instance.InterfaceName; - } - } - - /// - /// The network connection state. - /// - /// 3 - /// Represents the connection state of the Wi-Fi. - /// http://tizen.org/privilege/network.get - static public WiFiConnectionState ConnectionState - { - get - { - return WiFiManagerImpl.Instance.ConnectionState; - } - } - - /// - /// A property to check whether Wi-Fi is activated. - /// - /// 3 - /// Boolean value to check whether Wi-Fi is activated or not. - /// http://tizen.org/privilege/network.get - static public bool IsActive - { - get - { - return WiFiManagerImpl.Instance.IsActive; - } - } - - /// - /// DeviceStateChanged is raised when the device state is changed. - /// - /// 3 - /// http://tizen.org/privilege/network.get - /// http://tizen.org/feature/network.wifi - static public event EventHandler DeviceStateChanged - { - add - { - WiFiManagerImpl.Instance.DeviceStateChanged += value; - } - remove - { - WiFiManagerImpl.Instance.DeviceStateChanged -= value; - } - } - - /// - /// ConnectionStateChanged is raised when the connection state is changed. - /// - /// 3 - /// http://tizen.org/privilege/network.get - /// http://tizen.org/feature/network.wifi - static public event EventHandler ConnectionStateChanged - { - add - { - WiFiManagerImpl.Instance.ConnectionStateChanged += value; - } - remove - { - WiFiManagerImpl.Instance.ConnectionStateChanged -= value; - } - } - - /// - /// RssiLevelChanged is raised when the RSSI of the connected Wi-Fi is changed. - /// - /// 3 - /// http://tizen.org/privilege/network.get - /// http://tizen.org/feature/network.wifi - static public event EventHandler RssiLevelChanged - { - add - { - WiFiManagerImpl.Instance.RssiLevelChanged += value; - } - remove - { - WiFiManagerImpl.Instance.RssiLevelChanged -= value; - } - } - - /// - /// BackgroundScanFinished is raised when the background scan is finished. - /// The background scan starts automatically when Wi-Fi is activated. The callback will be invoked periodically. - /// - /// 3 - /// http://tizen.org/privilege/network.get - /// http://tizen.org/feature/network.wifi - static public event EventHandler BackgroundScanFinished - { - add - { - WiFiManagerImpl.Instance.BackgroundScanFinished += value; - } - remove - { - WiFiManagerImpl.Instance.BackgroundScanFinished -= value; - } - } - - /// - /// Gets the Wi-Fi safe handle. - /// - /// 3 - /// The instance of the SafeWiFiManagerHandle. - /// http://tizen.org/feature/network.wifi - /// http://tizen.org/privilege/network.get - /// Thrown when the Wi-Fi is not supported. - /// Thrown when the permission is denied. - /// Thrown when the system is out of memory. - /// Thrown when the method failed due to an invalid parameter. - /// Thrown when the method failed due to an invalid operation. - [EditorBrowsable(EditorBrowsableState.Never)] - public static SafeWiFiManagerHandle GetWiFiHandle() - { - return WiFiManagerImpl.Instance.GetSafeHandle(); - } - - /// - /// Gets the result of the scan. - /// - /// 3 - /// A list of the WiFiAP objects. - /// http://tizen.org/feature/network.wifi - /// http://tizen.org/privilege/network.get - /// Thrown when the Wi-Fi is not supported. - /// Thrown when the permission is denied. - /// Thrown when the method failed due to an invalid parameter. - /// Thrown when the method failed due to an invalid operation. - static public IEnumerable GetFoundAPs() - { - return WiFiManagerImpl.Instance.GetFoundAPs(); - } - - /// - /// Gets the result of ScanSpecificAPAsync(string essid) API. - /// - /// 3 - /// A list containing the WiFiAP objects. - /// http://tizen.org/feature/network.wifi - /// http://tizen.org/privilege/network.get - /// Thrown when the Wi-Fi is not supported. - /// Thrown when the permission is denied. - /// Thrown when the method failed due to an invalid parameter. - /// Thrown when the method failed due to an invalid operation. - static public IEnumerable GetFoundSpecificAPs() - { - return WiFiManagerImpl.Instance.GetFoundSpecificAPs(); - } - - /// - /// Gets the list of Wi-Fi configurations. - /// - /// 3 - /// A list containing the WiFiConfiguration objects. - /// http://tizen.org/feature/network.wifi - /// http://tizen.org/privilege/network.profile - /// Thrown when the Wi-Fi is not supported. - /// Thrown when the permission is denied. - /// Thrown when system is out of memory. - /// Thrown when the method failed due to an invalid parameter. - /// Thrown when the method failed due to an invalid operation. - static public IEnumerable GetWiFiConfigurations() - { - return WiFiManagerImpl.Instance.GetWiFiConfigurations(); - } - - /// - /// Saves the Wi-Fi configuration of the access point. - /// - /// 3 - /// The configuration to be stored. - /// http://tizen.org/feature/network.wifi - /// http://tizen.org/privilege/network.profile - /// Thrown when the Wi-Fi is not supported. - /// Thrown when the permission is denied. - /// Thrown when WiFiConfiguration is passed as null. - /// Thrown when the method failed due to an invalid parameter. - /// Thrown when the method failed due to an invalid operation. - static public void SaveWiFiConfiguration(WiFiConfiguration configuration) - { - WiFiManagerImpl.Instance.SaveWiFiNetworkConfiguration(configuration); - } - - /// - /// Gets the object of the connected WiFiAP. - /// - /// 3 - /// The connected Wi-Fi access point (AP) information. - /// http://tizen.org/feature/network.wifi - /// http://tizen.org/privilege/network.get - /// Thrown when the Wi-Fi is not supported. - /// Thrown when the permission is denied. - /// Thrown when system is out of memory. - /// Thrown when the method failed due to an invalid parameter. - /// Thrown when the method failed due to an invalid operation. - static public WiFiAP GetConnectedAP() - { - return WiFiManagerImpl.Instance.GetConnectedAP(); - } - - /// - /// Activates the Wi-Fi asynchronously. - /// - /// 3 - /// A task indicating whether the activate method is done or not. - /// http://tizen.org/feature/network.wifi - /// http://tizen.org/privilege/network.set - /// http://tizen.org/privilege/network.get - /// Thrown when the Wi-Fi is not supported. - /// Thrown when the permission is denied. - /// Thrown when the method failed due to an invalid parameter. - /// Thrown when the method failed due to an invalid operation. - static public Task ActivateAsync() - { - return WiFiManagerImpl.Instance.ActivateAsync(); - } - - /// - /// Activates the Wi-Fi asynchronously and displays the Wi-Fi picker (popup) when the Wi-Fi is not automatically connected. - /// - /// 3 - /// A task indicating whether the ActivateWithPicker method is done or not. - /// http://tizen.org/feature/network.wifi - /// http://tizen.org/privilege/network.set - /// http://tizen.org/privilege/network.get - /// Thrown when the Wi-Fi is not supported. - /// Thrown when the permission is denied. - /// Thrown when the method failed due to an invalid parameter. - /// Thrown when the method failed due to an invalid operation. - static public Task ActivateWithPickerAsync() - { - return WiFiManagerImpl.Instance.ActivateWithWiFiPickerTestedAsync(); - } - - /// - /// Deactivates the Wi-Fi asynchronously. - /// - /// 3 - /// A task indicating whether the deactivate method is done or not. - /// http://tizen.org/feature/network.wifi - /// http://tizen.org/privilege/network.set - /// http://tizen.org/privilege/network.get - /// Thrown when the Wi-Fi is not supported. - /// Thrown when the permission is denied. - /// Thrown when the method failed due to an invalid parameter. - /// Thrown when the method failed due to an invalid operation. - static public Task DeactivateAsync() - { - return WiFiManagerImpl.Instance.DeactivateAsync(); - } - - /// - /// Starts the scan asynchronously. - /// - /// 3 - /// A task indicating whether the scan method is done or not. - /// http://tizen.org/feature/network.wifi - /// http://tizen.org/privilege/network.set - /// http://tizen.org/privilege/network.get - /// Thrown when the Wi-Fi is not supported. - /// Thrown when the permission is denied. - /// Thrown when the method failed due to an invalid parameter. - /// Thrown when the method failed due to an invalid operation. - static public Task ScanAsync() - { - return WiFiManagerImpl.Instance.ScanAsync(); - } - - /// - /// Starts a specific access point scan asynchronously. - /// - /// 3 - /// A task indicating whether the ScanSpecificAP method is done or not. - /// The ESSID of the hidden AP. - /// http://tizen.org/feature/network.wifi - /// http://tizen.org/privilege/network.set - /// http://tizen.org/privilege/network.get - /// Thrown when the Wi-Fi is not supported. - /// Thrown when the permission is denied. - /// Thrown when the method failed due to an invalid parameter. - /// Thrown when the method failed due to an invalid operation. - static public Task ScanSpecificAPAsync(string essid) - { - return WiFiManagerImpl.Instance.ScanSpecificAPAsync(essid); - } - } -} diff --git a/src/Tizen.Network.WiFi/Tizen.Network.WiFi/WiFiManagerImpl.cs b/src/Tizen.Network.WiFi/Tizen.Network.WiFi/WiFiManagerImpl.cs deleted file mode 100755 index 10865c409..000000000 --- a/src/Tizen.Network.WiFi/Tizen.Network.WiFi/WiFiManagerImpl.cs +++ /dev/null @@ -1,434 +0,0 @@ -/* - * 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.Collections.Generic; -using System.Threading; -using System.Threading.Tasks; -using System.Runtime.InteropServices; - -namespace Tizen.Network.WiFi -{ - static internal class Globals - { - internal const string LogTag = "Tizen.Network.WiFi"; - } - - internal class HandleHolder - { - private SafeWiFiManagerHandle _handle; - - internal HandleHolder() - { - _handle = WiFiManagerImpl.Instance.Initialize(); - Log.Debug(Globals.LogTag, "Handle: " + _handle); - } - - internal SafeWiFiManagerHandle GetSafeHandle() - { - Log.Debug(Globals.LogTag, "Handleholder safehandle = " + _handle); - return _handle; - } - } - - internal partial class WiFiManagerImpl - { - private static WiFiManagerImpl _instance = null; - private Dictionary _callback_map = new Dictionary(); - private int _requestId = 0; - private string _macAddress; - - internal string MacAddress - { - get - { - if (String.IsNullOrEmpty(_macAddress)) - { - string address; - int ret = Interop.WiFi.GetMacAddress(GetSafeHandle(), out address); - if (ret != (int)WiFiError.None) - { - Log.Error(Globals.LogTag, "Failed to get mac address, Error - " + (WiFiError)ret); - _macAddress = ""; - } - else - { - _macAddress = address; - } - } - return _macAddress; - } - } - - internal string InterfaceName - { - get - { - string name; - int ret = Interop.WiFi.GetNetworkInterfaceName(GetSafeHandle(), out name); - if (ret != (int)WiFiError.None) - { - Log.Error(Globals.LogTag, "Failed to get interface name, Error - " + (WiFiError)ret); - return ""; - } - return name; - } - } - - internal WiFiConnectionState ConnectionState - { - get - { - int state; - int ret = Interop.WiFi.GetConnectionState(GetSafeHandle(), out state); - if (ret != (int)WiFiError.None) - { - Log.Error(Globals.LogTag, "Failed to get connection state, Error - " + (WiFiError)ret); - return WiFiConnectionState.Failure; - } - return (WiFiConnectionState)state; - } - } - - internal bool IsActive - { - get - { - bool active; - int ret = Interop.WiFi.IsActive(GetSafeHandle(), out active); - if (ret != (int)WiFiError.None) - { - Log.Error(Globals.LogTag, "Failed to get isActive, Error - " + (WiFiError)ret); - } - return active; - } - } - - internal static WiFiManagerImpl Instance - { - get - { - if (_instance == null) - { - Log.Debug(Globals.LogTag, "Instance is null"); - _instance = new WiFiManagerImpl(); - } - - return _instance; - } - } - - private static ThreadLocal s_threadName = new ThreadLocal(() => - { - Log.Info(Globals.LogTag, "In threadlocal delegate"); - return new HandleHolder(); - }); - - private WiFiManagerImpl() - { - } - - internal SafeWiFiManagerHandle GetSafeHandle() - { - return s_threadName.Value.GetSafeHandle(); - } - - internal SafeWiFiManagerHandle Initialize() - { - SafeWiFiManagerHandle handle; - int ret = Interop.WiFi.Initialize(out handle); - if (ret != (int)WiFiError.None) - { - Log.Error(Globals.LogTag, "Failed to initialize wifi, Error - " + (WiFiError)ret); - WiFiErrorFactory.ThrowWiFiException(ret, "http://tizen.org/privilege/network.get"); - } - return handle; - } - - internal IEnumerable GetFoundAPs() - { - Log.Debug(Globals.LogTag, "GetFoundAPs"); - List apList = new List(); - Interop.WiFi.HandleCallback callback = (IntPtr apHandle, IntPtr userData) => - { - if (apHandle != IntPtr.Zero) - { - IntPtr clonedHandle; - Interop.WiFi.AP.Clone(out clonedHandle, apHandle); - WiFiAP apItem = new WiFiAP(clonedHandle); - apList.Add(apItem); - return true; - } - return false; - }; - - int ret = Interop.WiFi.GetForeachFoundAPs(GetSafeHandle(), callback, IntPtr.Zero); - if (ret != (int)WiFiError.None) - { - Log.Error(Globals.LogTag, "Failed to get all APs, Error - " + (WiFiError)ret); - WiFiErrorFactory.ThrowWiFiException(ret, GetSafeHandle().DangerousGetHandle(), "http://tizen.org/privilege/network.get"); - } - - return apList; - } - - internal IEnumerable GetFoundSpecificAPs() - { - Log.Debug(Globals.LogTag, "GetFoundSpecificAPs"); - List apList = new List(); - Interop.WiFi.HandleCallback callback = (IntPtr apHandle, IntPtr userData) => - { - if (apHandle != IntPtr.Zero) - { - IntPtr clonedHandle; - Interop.WiFi.AP.Clone(out clonedHandle, apHandle); - WiFiAP apItem = new WiFiAP(clonedHandle); - apList.Add(apItem); - return true; - } - return false; - - }; - - int ret = Interop.WiFi.GetForeachFoundSpecificAPs(GetSafeHandle(), callback, IntPtr.Zero); - if (ret != (int)WiFiError.None) - { - Log.Error(Globals.LogTag, "Failed to get specific APs, Error - " + (WiFiError)ret); - WiFiErrorFactory.ThrowWiFiException(ret, GetSafeHandle().DangerousGetHandle(), "http://tizen.org/privilege/network.get"); - } - - return apList; - } - - internal IEnumerable GetWiFiConfigurations() - { - Log.Debug(Globals.LogTag, "GetWiFiConfigurations"); - List configList = new List(); - Interop.WiFi.HandleCallback callback = (IntPtr configHandle, IntPtr userData) => - { - if (configHandle != IntPtr.Zero) - { - IntPtr clonedConfig; - Interop.WiFi.Config.Clone(configHandle, out clonedConfig); - WiFiConfiguration configItem = new WiFiConfiguration(clonedConfig); - configList.Add(configItem); - return true; - } - return false; - }; - - int ret = Interop.WiFi.Config.GetForeachConfiguration(GetSafeHandle(), callback, IntPtr.Zero); - if (ret != (int)WiFiError.None) - { - Log.Error(Globals.LogTag, "Failed to get configurations, Error - " + (WiFiError)ret); - WiFiErrorFactory.ThrowWiFiException(ret, GetSafeHandle().DangerousGetHandle(), "http://tizen.org/privilege/network.profile"); - } - - return configList; - } - - internal void SaveWiFiNetworkConfiguration(WiFiConfiguration config) - { - Log.Debug(Globals.LogTag, "SaveWiFiNetworkConfiguration"); - if (config == null) - { - throw new ArgumentNullException("WiFi configuration is null"); - } - - IntPtr configHandle = config.GetHandle(); - int ret = Interop.WiFi.Config.SaveConfiguration(GetSafeHandle(), configHandle); - if (ret != (int)WiFiError.None) - { - Log.Error(Globals.LogTag, "Failed to save configuration, Error - " + (WiFiError)ret); - WiFiErrorFactory.ThrowWiFiException(ret, GetSafeHandle().DangerousGetHandle(), "http://tizen.org/privilege/network.profile"); - } - } - - internal WiFiAP GetConnectedAP() - { - Log.Debug(Globals.LogTag, "GetConnectedAP"); - IntPtr apHandle; - int ret = Interop.WiFi.GetConnectedAP(GetSafeHandle(), out apHandle); - if (ret != (int)WiFiError.None) - { - Log.Error(Globals.LogTag, "Failed to connect with AP, Error - " + (WiFiError)ret); - WiFiErrorFactory.ThrowWiFiException(ret, GetSafeHandle().DangerousGetHandle(), "http://tizen.org/privilege/network.get"); - } - WiFiAP ap = new WiFiAP(apHandle); - return ap; - } - - internal Task ActivateAsync() - { - Log.Debug(Globals.LogTag, "ActivateAsync"); - TaskCompletionSource task = new TaskCompletionSource(); - IntPtr id; - lock (_callback_map) - { - id = (IntPtr)_requestId++; - _callback_map[id] = (error, key) => - { - Log.Debug(Globals.LogTag, "wifi activated"); - if (error != (int)WiFiError.None) - { - Log.Error(Globals.LogTag, "Error occurs during WiFi activating, " + (WiFiError)error); - task.SetException(new InvalidOperationException("Error occurs during WiFi activating, " + (WiFiError)error)); - } - task.SetResult(true); - lock (_callback_map) - { - _callback_map.Remove(key); - } - }; - } - int ret = Interop.WiFi.Activate(GetSafeHandle(), _callback_map[id], id); - if (ret != (int)WiFiError.None) - { - Log.Error(Globals.LogTag, "Failed to activate wifi, Error - " + (WiFiError)ret); - WiFiErrorFactory.ThrowWiFiException(ret, GetSafeHandle().DangerousGetHandle()); - } - return task.Task; - } - - internal Task ActivateWithWiFiPickerTestedAsync() - { - Log.Debug(Globals.LogTag, "ActivateWithWiFiPickerTestedAsync"); - TaskCompletionSource task = new TaskCompletionSource(); - IntPtr id; - lock (_callback_map) - { - id = (IntPtr)_requestId++; - _callback_map[id] = (error, key) => - { - Log.Debug(Globals.LogTag, "Activation finished"); - if (error != (int)WiFiError.None) - { - Log.Error(Globals.LogTag, "Error occurs during WiFi activating, " + (WiFiError)error); - task.SetException(new InvalidOperationException("Error occurs during WiFi activating, " + (WiFiError)error)); - } - task.SetResult(true); - lock (_callback_map) - { - _callback_map.Remove(key); - } - }; - } - int ret = Interop.WiFi.ActivateWithWiFiPickerTested(GetSafeHandle(), _callback_map[id], id); - if (ret != (int)WiFiError.None) - { - Log.Error(Globals.LogTag, "Failed to activate wifi, Error - " + (WiFiError)ret); - WiFiErrorFactory.ThrowWiFiException(ret, GetSafeHandle().DangerousGetHandle()); - } - return task.Task; - } - - internal Task DeactivateAsync() - { - Log.Debug(Globals.LogTag, "DeactivateAsync"); - TaskCompletionSource task = new TaskCompletionSource(); - IntPtr id; - lock (_callback_map) - { - id = (IntPtr)_requestId++; - _callback_map[id] = (error, key) => - { - Log.Debug(Globals.LogTag, "Deactivation finished"); - if (error != (int)WiFiError.None) - { - Log.Error(Globals.LogTag, "Error occurs during WiFi deactivating, " + (WiFiError)error); - task.SetException(new InvalidOperationException("Error occurs during WiFi deactivating, " + (WiFiError)error)); - } - task.SetResult(true); - lock (_callback_map) - { - _callback_map.Remove(key); - } - }; - } - int ret = Interop.WiFi.Deactivate(GetSafeHandle(), _callback_map[id], id); - if (ret != (int)WiFiError.None) - { - Log.Error(Globals.LogTag, "Failed to deactivate wifi, Error - " + (WiFiError)ret); - WiFiErrorFactory.ThrowWiFiException(ret, GetSafeHandle().DangerousGetHandle()); - } - return task.Task; - } - - internal Task ScanAsync() - { - Log.Debug(Globals.LogTag, "ScanAsync"); - TaskCompletionSource task = new TaskCompletionSource(); - IntPtr id; - lock (_callback_map) - { - id = (IntPtr)_requestId++; - _callback_map[id] = (error, key) => - { - Log.Debug(Globals.LogTag, "Scanning finished"); - if (error != (int)WiFiError.None) - { - Log.Error(Globals.LogTag, "Error occurs during WiFi scanning, " + (WiFiError)error); - task.SetException(new InvalidOperationException("Error occurs during WiFi scanning, " + (WiFiError)error)); - } - task.SetResult(true); - lock (_callback_map) - { - _callback_map.Remove(key); - } - }; - } - int ret = Interop.WiFi.Scan(GetSafeHandle(), _callback_map[id], id); - if (ret != (int)WiFiError.None) - { - Log.Error(Globals.LogTag, "Failed to scan all AP, Error - " + (WiFiError)ret); - WiFiErrorFactory.ThrowWiFiException(ret, GetSafeHandle().DangerousGetHandle()); - } - return task.Task; - } - - internal Task ScanSpecificAPAsync(string essid) - { - Log.Debug(Globals.LogTag, "ScanSpecificAPAsync " + essid); - TaskCompletionSource task = new TaskCompletionSource(); - IntPtr id; - lock (_callback_map) - { - id = (IntPtr)_requestId++; - _callback_map[id] = (error, key) => - { - Log.Debug(Globals.LogTag, "Scanning with specific AP finished"); - if (error != (int)WiFiError.None) - { - Log.Error(Globals.LogTag, "Error occurs during WiFi scanning, " + (WiFiError)error); - task.SetException(new InvalidOperationException("Error occurs during WiFi scanning, " + (WiFiError)error)); - } - task.SetResult(true); - lock (_callback_map) - { - _callback_map.Remove(key); - } - }; - } - int ret = Interop.WiFi.ScanSpecificAP(GetSafeHandle(), essid, _callback_map[id], id); - if (ret != (int)WiFiError.None) - { - Log.Error(Globals.LogTag, "Failed to scan with specific AP, Error - " + (WiFiError)ret); - WiFiErrorFactory.ThrowWiFiException(ret, GetSafeHandle().DangerousGetHandle()); - } - return task.Task; - } - } -} diff --git a/src/Tizen.Network.WiFi/Tizen.Network.WiFi/WiFiNetwork.cs b/src/Tizen.Network.WiFi/Tizen.Network.WiFi/WiFiNetwork.cs deleted file mode 100755 index d77be57cd..000000000 --- a/src/Tizen.Network.WiFi/Tizen.Network.WiFi/WiFiNetwork.cs +++ /dev/null @@ -1,360 +0,0 @@ -/* - * 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.Collections.Generic; -using System.Net; -using System.Runtime.InteropServices; -using Tizen.Network.Connection; - -namespace Tizen.Network.WiFi -{ - /// - /// A class for managing the Wi-Fi network information. - /// - /// 3 - public class WiFiNetwork - { - private Interop.WiFi.SafeWiFiAPHandle _apHandle; - private IAddressInformation _ipv4; - private IAddressInformation _ipv6; - private string _essid; - - /// - /// The Extended Service Set Identifier (ESSID). - /// - /// 3 - /// ESSID of the Wi-Fi. - public string Essid - { - get - { - if (string.IsNullOrEmpty(_essid)) - { - IntPtr strPtr; - int ret = Interop.WiFi.AP.GetEssid(_apHandle, out strPtr); - if (ret != (int)WiFiError.None) - { - Log.Error(Globals.LogTag, "Failed to get essid, Error - " + (WiFiError)ret); - _essid = ""; - } - else - { - _essid = Marshal.PtrToStringAnsi(strPtr); - } - } - return _essid; - } - } - - /// - /// The Basic Service Set Identifier (BSSID). - /// - /// 3 - /// BSSID of the Wi-Fi. - public string Bssid - { - get - { - IntPtr strPtr; - int ret = Interop.WiFi.AP.GetBssid(_apHandle, out strPtr); - if (ret != (int)WiFiError.None) - { - Log.Error(Globals.LogTag, "Failed to get bssid, Error - " + (WiFiError)ret); - return ""; - } - return Marshal.PtrToStringAnsi(strPtr); - } - } - - /// - /// The address information for IPv4. - /// - /// 3 - /// IP address information for IPv4 type. - public IAddressInformation IPv4Setting - { - get - { - return _ipv4; - } - } - - /// - /// The address information for IPv6. - /// - /// 3 - /// IP address information for IPv6 type. - public IAddressInformation IPv6Setting - { - get - { - return _ipv6; - } - } - - /// - /// The proxy address. - /// - /// 3 - /// Represents the proxy address of the Wi-Fi. - /// Thrown while setting this property when Wi-Fi is not supported. - /// Thrown while setting this property due to an invalid parameter. - /// Thrown while setting this value due to an invalid operation. - public string ProxyAddress - { - get - { - IntPtr strPtr; - int ret = Interop.WiFi.AP.GetProxyAddress(_apHandle, (int)AddressFamily.IPv4, out strPtr); - if (ret != (int)WiFiError.None) - { - Log.Error(Globals.LogTag, "Failed to get proxy address, Error - " + (WiFiError)ret); - return ""; - } - return Marshal.PtrToStringAnsi(strPtr); - } - set - { - int ret = Interop.WiFi.AP.SetProxyAddress(_apHandle, (int)AddressFamily.IPv4, value); - if (ret != (int)WiFiError.None) - { - Log.Error(Globals.LogTag, "Failed to set proxy address, Error - " + (WiFiError)ret); - WiFiErrorFactory.ThrowWiFiException(ret, _apHandle.DangerousGetHandle()); - } - } - } - - /// - /// The proxy type (IPv6). - /// - /// 3 - /// Represents the proxy type of the Wi-Fi. - /// Thrown while setting this property when Wi-Fi is not supported. - /// Thrown while setting this property due to an invalid parameter. - /// Thrown while setting this value due to an invalid operation. - public WiFiProxyType ProxyType - { - get - { - int type; - int ret = Interop.WiFi.AP.GetProxyType(_apHandle, out type); - if (ret != (int)WiFiError.None) - { - Log.Error(Globals.LogTag, "Failed to get proxy type, Error - " + (WiFiError)ret); - } - return (WiFiProxyType)type; - } - set - { - int ret = Interop.WiFi.AP.SetProxyType(_apHandle, (int)value); - if (ret != (int)WiFiError.None) - { - Log.Error(Globals.LogTag, "Failed to set proxy type, Error - " + (WiFiError)ret); - WiFiErrorFactory.ThrowWiFiException(ret, _apHandle.DangerousGetHandle()); - } - } - } - - /// - /// The frequency band (MHz). - /// - /// 3 - /// Represents the frequency band value. - public int Frequency - { - get - { - int freq; - int ret = Interop.WiFi.AP.GetFrequency(_apHandle, out freq); - if (ret != (int)WiFiError.None) - { - Log.Error(Globals.LogTag, "Failed to get frequency, Error - " + (WiFiError)ret); - } - return freq; - } - } - - /// - /// The received signal strength indicator (RSSI). - /// - /// 3 - /// Represents RSSI of Wi-Fi (dbm). - public int Rssi - { - get - { - int rssi; - int ret = Interop.WiFi.AP.GetRssi(_apHandle, out rssi); - if (ret != (int)WiFiError.None) - { - Log.Error(Globals.LogTag, "Failed to get rssi, Error - " + (WiFiError)ret); - } - return rssi; - } - } - - /// - /// The Received signal strength indication(RSSI). - /// - /// 4 - /// Represents Rssi level of WiFi. - /// http://tizen.org/feature/network.wifi - /// Thrown while setting this property when WiFi is not supported. - public WiFiRssiLevel RssiLevel - { - get - { - int rssi; - int ret = Interop.WiFi.AP.GetRssiLevel(_apHandle, out rssi); - if (ret != (int)WiFiError.None) - { - Log.Error(Globals.LogTag, "Failed to get rssi level, Error - " + (WiFiError)ret); - } - return (WiFiRssiLevel)rssi; - } - } - - /// - /// The max speed (Mbps). - /// - /// 3 - /// Represents the max speed value. - public int MaxSpeed - { - get - { - int maxSpeed; - int ret = Interop.WiFi.AP.GetMaxSpeed(_apHandle, out maxSpeed); - if (ret != (int)WiFiError.None) - { - Log.Error(Globals.LogTag, "Failed to get max speed, Error - " + (WiFiError)ret); - } - return maxSpeed; - } - } - - /// - /// A property to check whether the access point is a favorite or not. - /// - /// 3 - /// Boolean value to check if the access point is a favorite or not. - public bool IsFavorite - { - get - { - bool isFavorite; - int ret = Interop.WiFi.AP.IsFavorite(_apHandle, out isFavorite); - if (ret != (int)WiFiError.None) - { - Log.Error(Globals.LogTag, "Failed to get favorite, Error - " + (WiFiError)ret); - } - return isFavorite; - } - } - - /// - /// A property to check whether the access point is a passpoint or not. - /// - /// 3 - /// Boolean value to check if the access point is a passpoint or not. - public bool IsPasspoint - { - get - { - bool isPasspoint; - Log.Debug(Globals.LogTag, "Handle: " + _apHandle); - int ret = Interop.WiFi.AP.IsPasspoint(_apHandle, out isPasspoint); - if (ret != (int)WiFiError.None) - { - Log.Error(Globals.LogTag, "Failed to get isPassport, Error - " + (WiFiError)ret); - } - return isPasspoint; - } - } - - /// - /// The connection state. - /// - /// 3 - /// Represents the connection state of the Wi-Fi. - public WiFiConnectionState ConnectionState - { - get - { - int state; - int ret = Interop.WiFi.AP.GetConnectionState(_apHandle, out state); - if (ret != (int)WiFiError.None) - { - Log.Error(Globals.LogTag, "Failed to get connection state, Error - " + (WiFiError)ret); - } - return (WiFiConnectionState)state; - } - } - - /// - /// Gets all IPv6 addresses of the access point. - /// - /// 3 - /// A list of IPv6 addresses of the access point. - /// http://tizen.org/feature/network.wifi - /// Thrown when the Wi-Fi is not supported. - /// Thrown when the method failed due to an invalid parameter. - /// Thrown when the method failed due to an invalid operation. - public IEnumerable GetAllIPv6Addresses() - { - Log.Debug(Globals.LogTag, "GetAllIPv6Addresses"); - List ipList = new List(); - Interop.WiFi.HandleCallback callback = (IntPtr ipv6Address, IntPtr userData) => - { - if (ipv6Address != IntPtr.Zero) - { - string ipv6 = Marshal.PtrToStringAnsi(ipv6Address); - if (ipv6.Length == 0) - ipList.Add(System.Net.IPAddress.Parse("::")); - else - ipList.Add(System.Net.IPAddress.Parse(ipv6)); - return true; - } - return false; - }; - - int ret = Interop.WiFi.AP.GetAllIPv6Addresses(_apHandle, callback, IntPtr.Zero); - if (ret != (int)WiFiError.None) - { - Log.Error(Globals.LogTag, "Failed to get all IPv6 addresses, Error - " + (WiFiError)ret); - WiFiErrorFactory.ThrowWiFiException(ret, _apHandle.DangerousGetHandle()); - } - - return ipList; - } - - internal WiFiNetwork(Interop.WiFi.SafeWiFiAPHandle apHandle) - { - _apHandle = apHandle; - _ipv4 = new WiFiAddressInformation(apHandle, AddressFamily.IPv4); - _ipv6 = new WiFiAddressInformation(apHandle, AddressFamily.IPv6); - - IntPtr strPtr; - int ret = Interop.WiFi.AP.GetEssid(_apHandle, out strPtr); - if (ret != (int)WiFiError.None) - { - Log.Error(Globals.LogTag, "Failed to get essid, Error - " + (WiFiError)ret); - } - _essid = Marshal.PtrToStringAnsi(strPtr); - } - } //WiFiNetworkInformation -} diff --git a/src/Tizen.Network.WiFi/Tizen.Network.WiFi/WiFiNetworkChange.cs b/src/Tizen.Network.WiFi/Tizen.Network.WiFi/WiFiNetworkChange.cs deleted file mode 100755 index ac1eabf38..000000000 --- a/src/Tizen.Network.WiFi/Tizen.Network.WiFi/WiFiNetworkChange.cs +++ /dev/null @@ -1,234 +0,0 @@ -/* - * 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.Threading.Tasks; - -namespace Tizen.Network.WiFi -{ - internal static class EventHandlerExtension - { - internal static void SafeInvoke(this EventHandler evt, object sender, EventArgs e) - { - var handler = evt; - if (handler != null) - { - handler(sender, e); - } - } - - internal static void SafeInvoke(this EventHandler evt, object sender, T e) where T : EventArgs - { - var handler = evt; - if (handler != null) - { - handler(sender, e); - } - } - } - - internal partial class WiFiManagerImpl - { - private event EventHandler _deviceStateChanged; - private event EventHandler _connectionStateChanged; - private event EventHandler _rssiLevelChanged; - private event EventHandler _backgroundScanFinished; - - private Interop.WiFi.DeviceStateChangedCallback _deviceChangedCallback; - private Interop.WiFi.ConnectionStateChangedCallback _connectionChangedCallback; - private Interop.WiFi.RssiLevelChangedCallback _rssiChangedCallback; - private Interop.WiFi.VoidCallback _backgroundScanFinishedCallback; - - internal event EventHandler DeviceStateChanged - { - add - { - if (_deviceStateChanged == null) - { - RegisterDeviceStateChangedEvent(); - } - _deviceStateChanged += value; - } - remove - { - _deviceStateChanged -= value; - if (_deviceStateChanged == null) - { - UnregisterDeviceStateChangedEvent(); - } - } - } - - internal event EventHandler ConnectionStateChanged - { - add - { - if (_connectionStateChanged == null) - { - RegisterConnectionStateChangedEvent(); - } - _connectionStateChanged += value; - } - remove - { - _connectionStateChanged -= value; - if (_connectionStateChanged == null) - { - UnregisterConnectionStateChangedEvent(); - } - } - } - - internal event EventHandler RssiLevelChanged - { - add - { - if (_rssiLevelChanged == null) - { - RegisterRssiLevelChangedEvent(); - } - _rssiLevelChanged += value; - } - remove - { - _rssiLevelChanged -= value; - if (_rssiLevelChanged == null) - { - UnregisterRssiLevelChangedEvent(); - } - } - } - - internal event EventHandler BackgroundScanFinished - { - add - { - if (_backgroundScanFinished == null) - { - RegisterBackgroundScanFinishedEvent(); - } - _backgroundScanFinished += value; - } - remove - { - _backgroundScanFinished -= value; - if (_backgroundScanFinished == null) - { - UnregisterBackgroundScanFinishedEvent(); - } - } - } - - private void RegisterDeviceStateChangedEvent() - { - _deviceChangedCallback = (int deviceState, IntPtr userDate) => - { - WiFiDeviceState state = (WiFiDeviceState)deviceState; - DeviceStateChangedEventArgs e = new DeviceStateChangedEventArgs(state); - _deviceStateChanged.SafeInvoke(null, e); - }; - int ret = Interop.WiFi.SetDeviceStateChangedCallback(GetSafeHandle(), _deviceChangedCallback, IntPtr.Zero); - if (ret != (int)WiFiError.None) - { - Log.Error(Globals.LogTag, "Failed to set device state changed callback, Error - " + (WiFiError)ret); - } - } - - private void UnregisterDeviceStateChangedEvent() - { - int ret = Interop.WiFi.UnsetDeviceStateChangedCallback(GetSafeHandle()); - if (ret != (int)WiFiError.None) - { - Log.Error(Globals.LogTag, "Failed to unset device state changed callback, Error - " + (WiFiError)ret); - } - } - - private void RegisterConnectionStateChangedEvent() - { - _connectionChangedCallback = (int connectionState, IntPtr ap, IntPtr userData) => - { - if (ap != IntPtr.Zero) - { - WiFiConnectionState state = (WiFiConnectionState)connectionState; - ConnectionStateChangedEventArgs e = new ConnectionStateChangedEventArgs(state, ap); - _connectionStateChanged.SafeInvoke(null, e); - } - }; - int ret = Interop.WiFi.SetConnectionStateChangedCallback(GetSafeHandle(), _connectionChangedCallback, IntPtr.Zero); - if (ret != (int)WiFiError.None) - { - Log.Error(Globals.LogTag, "Failed to set copnnection state changed callback, Error - " + (WiFiError)ret); - } - } - - private void UnregisterConnectionStateChangedEvent() - { - int ret = Interop.WiFi.UnsetConnectionStateChangedCallback(GetSafeHandle()); - if (ret != (int)WiFiError.None) - { - Log.Error(Globals.LogTag, "Failed to unset device state changed callback, Error - " + (WiFiError)ret); - } - } - - private void RegisterRssiLevelChangedEvent() - { - - _rssiChangedCallback = (int rssiLevel, IntPtr userDate) => - { - WiFiRssiLevel level = (WiFiRssiLevel)rssiLevel; - RssiLevelChangedEventArgs e = new RssiLevelChangedEventArgs(level); - _rssiLevelChanged.SafeInvoke(null, e); - }; - int ret = Interop.WiFi.SetRssiLevelchangedCallback(GetSafeHandle(), _rssiChangedCallback, IntPtr.Zero); - if (ret != (int)WiFiError.None) - { - Log.Error(Globals.LogTag, "Failed to set rssi level changed callback, Error - " + (WiFiError)ret); - } - } - - private void UnregisterRssiLevelChangedEvent() - { - int ret = Interop.WiFi.UnsetRssiLevelchangedCallback(GetSafeHandle()); - if (ret != (int)WiFiError.None) - { - Log.Error(Globals.LogTag, "Failed to unset rssi level changed callback, Error - " + (WiFiError)ret); - } - } - - private void RegisterBackgroundScanFinishedEvent() - { - _backgroundScanFinishedCallback = (int result, IntPtr userDate) => - { - EventArgs e = new EventArgs(); - _backgroundScanFinished.SafeInvoke(null, e); - }; - int ret = Interop.WiFi.SetBackgroundScanCallback(GetSafeHandle(), _backgroundScanFinishedCallback, IntPtr.Zero); - if (ret != (int)WiFiError.None) - { - Log.Error(Globals.LogTag, "Failed to set background scan callback, Error - " + (WiFiError)ret); - } - } - - private void UnregisterBackgroundScanFinishedEvent() - { - int ret = Interop.WiFi.UnsetBackgroundScanCallback(GetSafeHandle()); - if (ret != (int)WiFiError.None) - { - Log.Error(Globals.LogTag, "Failed to unset background scan callback, Error - " + (WiFiError)ret); - } - } - } -} diff --git a/src/Tizen.Network.WiFi/Tizen.Network.WiFi/WiFiSecurity.cs b/src/Tizen.Network.WiFi/Tizen.Network.WiFi/WiFiSecurity.cs deleted file mode 100755 index d32850424..000000000 --- a/src/Tizen.Network.WiFi/Tizen.Network.WiFi/WiFiSecurity.cs +++ /dev/null @@ -1,174 +0,0 @@ -/* - * 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.Network.Connection; - -namespace Tizen.Network.WiFi -{ - /// - /// A class for managing the Wi-Fi security information. - /// - /// 3 - public class WiFiSecurity - { - private Interop.WiFi.SafeWiFiAPHandle _apHandle; - private WiFiEap _eap; - - /// - /// The type of Wi-Fi security. - /// - /// 3 - /// Represents the security type of the Wi-Fi. - /// Thrown while setting this property when Wi-Fi is not supported. - /// Thrown while setting this property due to an invalid parameter. - /// Thrown while setting this value due to an invalid operation. - public WiFiSecurityType SecurityType - { - get - { - int type; - int ret = Interop.WiFi.AP.GetSecurityType(_apHandle, out type); - if (ret != (int)WiFiError.None) - { - Log.Error(Globals.LogTag, "Failed to get security type, Error - " + (WiFiError)ret); - } - return (WiFiSecurityType)type; - } - set - { - int ret = Interop.WiFi.AP.SetSecurityType(_apHandle, (int)value); - if (ret != (int)WiFiError.None) - { - Log.Error(Globals.LogTag, "Failed to set security type, Error - " + (WiFiError)ret); - WiFiErrorFactory.ThrowWiFiException(ret, _apHandle.DangerousGetHandle()); - } - } - } - - /// - /// The type of Wi-Fi encryption. - /// - /// 3 - /// Represents the encryption type of the Wi-Fi. - /// Thrown while setting this property when Wi-Fi is not supported. - /// Thrown while setting this property due to an invalid parameter. - /// Thrown while setting this value due to an invalid operation. - public WiFiEncryptionType EncryptionType - { - get - { - int type; - int ret = Interop.WiFi.AP.GetEncryptionType(_apHandle, out type); - if (ret != (int)WiFiError.None) - { - Log.Error(Globals.LogTag, "Failed to get encryption type, Error - " + (WiFiError)ret); - } - return (WiFiEncryptionType)type; - } - set - { - int ret = Interop.WiFi.AP.SetEncryptionType(_apHandle, (int)value); - if (ret != (int)WiFiError.None) - { - Log.Error(Globals.LogTag, "Failed to set encryption type, Error - " + (WiFiError)ret); - WiFiErrorFactory.ThrowWiFiException(ret, _apHandle.DangerousGetHandle()); - } - } - } - - /// - /// The EAP information. - /// - /// 3 - /// EAP information of the Wi-Fi. - public WiFiEap EapInformation - { - get - { - return _eap; - } - } - - /// - /// A property to check whether the passphrase is required or not. - /// - /// 3 - /// Boolean value to check if the passphrase is required or not. - public bool IsPassphraseRequired - { - get - { - bool required; - int ret = Interop.WiFi.AP.IsPassphraseRequired(_apHandle, out required); - if (ret != (int)WiFiError.None) - { - Log.Error(Globals.LogTag, "Failed to get isPassportRequired, Error - " + (WiFiError)ret); - } - return required; - } - } - - /// - /// A property to check whether Wi-Fi Protected Setup (WPS) is supported. - /// - /// 3 - /// Boolean value to check if WPS is supported. - public bool IsWpsSupported - { - get - { - bool supported; - int ret = Interop.WiFi.AP.IsWpsSupported(_apHandle, out supported); - if (ret != (int)WiFiError.None) - { - Log.Error(Globals.LogTag, "Failed to get isWapSupported, Error - " + (WiFiError)ret); - } - return supported; - } - } - - internal WiFiSecurity(Interop.WiFi.SafeWiFiAPHandle apHandle) - { - _apHandle = apHandle; - _eap = new WiFiEap(apHandle); - } - - /// - /// Sets the passphrase. - /// - /// 3 - /// The passphrase of the access point. - /// http://tizen.org/feature/network.wifi - /// Thrown when Wi-Fi is not supported. - /// Thrown when the passphrase is passed as null. - /// Thrown when the method failed due to an invalid parameter. - /// Thrown when the method failed due to an invalid operation. - public void SetPassphrase(string passphrase) - { - if (passphrase == null) - { - throw new ArgumentNullException("Passphrase is null"); - } - int ret = Interop.WiFi.AP.SetPassphrase(_apHandle, passphrase); - if (ret != (int)WiFiError.None) - { - Log.Error(Globals.LogTag, "Failed to set passphrase, Error - " + (WiFiError)ret); - WiFiErrorFactory.ThrowWiFiException(ret, _apHandle.DangerousGetHandle()); - } - } - } //WiFiSecurityInformation -} diff --git a/src/Tizen.Network.WiFiDirect/Interop/Interop.Libraries.cs b/src/Tizen.Network.WiFiDirect/Interop/Interop.Libraries.cs deleted file mode 100644 index c036d470d..000000000 --- a/src/Tizen.Network.WiFiDirect/Interop/Interop.Libraries.cs +++ /dev/null @@ -1,25 +0,0 @@ -/* - * 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 WiFiDirect = "libwifi-direct.so.1"; - public const string Glib = "libglib-2.0.so.0"; - public const string Libc = "libc.so.6"; - } -} diff --git a/src/Tizen.Network.WiFiDirect/Interop/Interop.WiFiDirect.cs b/src/Tizen.Network.WiFiDirect/Interop/Interop.WiFiDirect.cs deleted file mode 100644 index 6ff39f153..000000000 --- a/src/Tizen.Network.WiFiDirect/Interop/Interop.WiFiDirect.cs +++ /dev/null @@ -1,231 +0,0 @@ -/* - * 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.Network.WiFiDirect; -using System.Runtime.InteropServices; - -/// -/// The Interop class for Wi-Fi Direct. -/// -internal static partial class Interop -{ - /// - /// The Wi-Fi Direct native APIs. - /// - internal static partial class WiFiDirect - { - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void DiscoveryStateChangedCallback(int result, WiFiDirectDiscoveryState state, IntPtr userData); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void PeerFoundCallback(int result, WiFiDirectDiscoveryState state, string address, IntPtr userData); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void DeviceStateChangedCallback(int result, WiFiDirectDeviceState state, IntPtr userData); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void ConnectionStateChangedCallback(int result, WiFiDirectConnectionState state, string address, IntPtr userData); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void ClientIpAddressAssignedCallback(string macAddress, string ipAddress, string interfaceAddress, IntPtr userData); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void ServiceStateChangedCallback(int result, WiFiDirectServiceDiscoveryState state, WiFiDirectServiceType type, IntPtr responseData, string address, IntPtr userData); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void StateChangedCallback(WiFiDirectState state, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool DiscoveredPeerCallback(ref DiscoveredPeerStruct peer, IntPtr userData); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool ConnectedPeerCallback(ref ConnectedPeerStruct peer, IntPtr userData); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool WpsTypeCallback(WiFiDirectWpsType type, IntPtr userData); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool PersistentGroupCallback(string address, string ssid, IntPtr userData); - - [DllImport(Libraries.WiFiDirect,EntryPoint = "wifi_direct_set_state_changed_cb")] - internal static extern int SetStateChangedCallback(StateChangedCallback stateChangedCb, IntPtr userData); - [DllImport(Libraries.WiFiDirect,EntryPoint = "wifi_direct_unset_state_changed_cb")] - internal static extern int UnsetStateChangedCallback(); - - [DllImport(Libraries.WiFiDirect,EntryPoint = "wifi_direct_set_device_state_changed_cb")] - internal static extern int SetDeviceStateChangedCallback(DeviceStateChangedCallback deviceChangedCb, IntPtr userData); - [DllImport(Libraries.WiFiDirect,EntryPoint = "wifi_direct_unset_device_state_changed_cb")] - internal static extern int UnsetDeviceStateChangedCallback(); - - [DllImport(Libraries.WiFiDirect,EntryPoint = "wifi_direct_set_discovery_state_changed_cb")] - internal static extern int SetDiscoveryStateChangedCallback(DiscoveryStateChangedCallback discoveryStateChangedCb, IntPtr userData); - [DllImport(Libraries.WiFiDirect,EntryPoint = "wifi_direct_unset_discovery_state_changed_cb")] - internal static extern int UnsetDiscoveryStateChangedCallback(); - - [DllImport(Libraries.WiFiDirect,EntryPoint = "wifi_direct_set_peer_found_cb")] - internal static extern int SetPeerFoundCallback(PeerFoundCallback peerFoundCb, IntPtr userData); - [DllImport(Libraries.WiFiDirect,EntryPoint = "wifi_direct_unset_peer_found_cb")] - internal static extern int UnsetPeerFoundCallback(); - - [DllImport(Libraries.WiFiDirect,EntryPoint = "wifi_direct_set_connection_state_changed_cb")] - internal static extern int SetConnectionChangedCallback(ConnectionStateChangedCallback connectionCb, IntPtr userData); - [DllImport(Libraries.WiFiDirect,EntryPoint = "wifi_direct_unset_connection_state_changed_cb")] - internal static extern int UnsetConnectionChangedCallback(); - - [DllImport(Libraries.WiFiDirect,EntryPoint = "wifi_direct_set_client_ip_address_assigned_cb")] - internal static extern int SetIpAddressAssignedCallback(ClientIpAddressAssignedCallback callback, IntPtr userData); - [DllImport(Libraries.WiFiDirect,EntryPoint = "wifi_direct_unset_client_ip_address_assigned_cb")] - internal static extern int UnsetIpAddressAssignedCallback(); - - [DllImport(Libraries.WiFiDirect,EntryPoint = "wifi_direct_set_service_state_changed_cb")] - internal static extern int SetServiceStateChangedCallback(ServiceStateChangedCallback serviceStateChangedCb, IntPtr userData); - [DllImport(Libraries.WiFiDirect,EntryPoint = "wifi_direct_unset_service_state_changed_cb")] - internal static extern int UnsetServiceStateChangedCallback(); - - [DllImport(Libraries.WiFiDirect,EntryPoint = "wifi_direct_initialize")] - internal static extern int Initialize(); - [DllImport(Libraries.WiFiDirect,EntryPoint = "wifi_direct_deinitialize")] - internal static extern int Deinitialize(); - [DllImport(Libraries.WiFiDirect,EntryPoint = "wifi_direct_activate")] - internal static extern int Activate(); - [DllImport(Libraries.WiFiDirect,EntryPoint = "wifi_direct_deactivate")] - internal static extern int Deactivate(); - [DllImport(Libraries.WiFiDirect,EntryPoint = "wifi_direct_start_discovery_specific_channel")] - internal static extern int StartDiscoveryInChannel(bool listenOnly, int timeout, WiFiDirectDiscoveryChannel channel); - [DllImport(Libraries.WiFiDirect,EntryPoint = "wifi_direct_cancel_discovery")] - internal static extern int StopDiscovery(); - [DllImport(Libraries.WiFiDirect,EntryPoint = "wifi_direct_foreach_discovered_peers")] - internal static extern int GetDiscoveredPeers(DiscoveredPeerCallback callback, IntPtr userData); - [DllImport(Libraries.WiFiDirect,EntryPoint = "wifi_direct_connect")] - internal static extern int Connect(string address); - [DllImport(Libraries.WiFiDirect,EntryPoint = "wifi_direct_cancel_connection")] - internal static extern int CancelConnection(string address); - [DllImport(Libraries.WiFiDirect,EntryPoint = "wifi_direct_disconnect_all")] - internal static extern int DisconnectAll(); - [DllImport(Libraries.WiFiDirect,EntryPoint = "wifi_direct_disconnect")] - internal static extern int Disconnect(string address); - [DllImport(Libraries.WiFiDirect,EntryPoint = "wifi_direct_foreach_connected_peers")] - internal static extern int GetConnectedPeers(ConnectedPeerCallback callback, IntPtr userData); - [DllImport(Libraries.WiFiDirect,EntryPoint = "wifi_direct_create_group")] - internal static extern int CreateGroup(); - [DllImport(Libraries.WiFiDirect,EntryPoint = "wifi_direct_destroy_group")] - internal static extern int DestroyGroup(); - [DllImport(Libraries.WiFiDirect,EntryPoint = "wifi_direct_is_group_owner")] - internal static extern int IsGroupOwner(out bool isGroupOwner); - [DllImport(Libraries.WiFiDirect,EntryPoint = "wifi_direct_is_autonomous_group")] - internal static extern int IsAutonomousGroup(out bool isAutonomous); - [DllImport(Libraries.WiFiDirect,EntryPoint = "wifi_direct_set_device_name")] - internal static extern int SetName(string name); - [DllImport(Libraries.WiFiDirect,EntryPoint = "wifi_direct_get_device_name")] - internal static extern int GetName(out string name); - [DllImport(Libraries.WiFiDirect,EntryPoint = "wifi_direct_get_ssid")] - internal static extern int GetSsid(out string ssid); - [DllImport(Libraries.WiFiDirect,EntryPoint = "wifi_direct_get_network_interface_name")] - internal static extern int GetInterfaceName(out string name); - [DllImport(Libraries.WiFiDirect,EntryPoint = "wifi_direct_get_ip_address")] - internal static extern int GetIpAddress(out string address); - [DllImport(Libraries.WiFiDirect,EntryPoint = "wifi_direct_get_subnet_mask")] - internal static extern int GetSubnetMask(out string mask); - [DllImport(Libraries.WiFiDirect,EntryPoint = "wifi_direct_get_gateway_address")] - internal static extern int GetGatewayAddress(out string address); - [DllImport(Libraries.WiFiDirect,EntryPoint = "wifi_direct_get_mac_address")] - internal static extern int GetMacAddress(out string address); - [DllImport(Libraries.WiFiDirect,EntryPoint = "wifi_direct_get_state")] - internal static extern int GetState(out WiFiDirectState state); - [DllImport(Libraries.WiFiDirect,EntryPoint = "wifi_direct_is_discoverable")] - internal static extern int IsDiscoverable(out bool isDiscoverable); - [DllImport(Libraries.WiFiDirect,EntryPoint = "wifi_direct_is_listening_only")] - internal static extern int IsListeningOnly(out bool listenOnly); - [DllImport(Libraries.WiFiDirect,EntryPoint = "wifi_direct_get_primary_device_type")] - internal static extern int GetPrimaryType(out WiFiDirectPrimaryDeviceType type); - [DllImport(Libraries.WiFiDirect,EntryPoint = "wifi_direct_get_secondary_device_type")] - internal static extern int GetSecondaryType(out WiFiDirectSecondaryDeviceType type); - [DllImport(Libraries.WiFiDirect,EntryPoint = "wifi_direct_activate_pushbutton")] - internal static extern int ActivatePushButton(); - [DllImport(Libraries.WiFiDirect,EntryPoint = "wifi_direct_set_wps_pin")] - internal static extern int SetWpsPin(string pin); - [DllImport(Libraries.WiFiDirect,EntryPoint = "wifi_direct_get_wps_pin")] - internal static extern int GetWpsPin(out string pin); - [DllImport(Libraries.WiFiDirect,EntryPoint = "wifi_direct_get_supported_wps_mode")] - internal static extern int GetWpsMode(out int mode); - [DllImport(Libraries.WiFiDirect,EntryPoint = "wifi_direct_foreach_supported_wps_types")] - internal static extern int GetWpsTypes(WpsTypeCallback callback, IntPtr userData); - [DllImport(Libraries.WiFiDirect,EntryPoint = "wifi_direct_get_local_wps_type")] - internal static extern int GetLocalWpsType(out WiFiDirectWpsType type); - [DllImport(Libraries.WiFiDirect,EntryPoint = "wifi_direct_set_req_wps_type")] - internal static extern int SetReqWpsType(WiFiDirectWpsType type); - [DllImport(Libraries.WiFiDirect,EntryPoint = "wifi_direct_get_req_wps_type")] - internal static extern int GetReqWpsType(out WiFiDirectWpsType type); - [DllImport(Libraries.WiFiDirect,EntryPoint = "wifi_direct_set_group_owner_intent")] - internal static extern int SetIntent(int intent); - [DllImport(Libraries.WiFiDirect,EntryPoint = "wifi_direct_get_group_owner_intent")] - internal static extern int GetIntent(out int intent); - [DllImport(Libraries.WiFiDirect,EntryPoint = "wifi_direct_set_max_clients")] - internal static extern int SetMaxClients(int max); - [DllImport(Libraries.WiFiDirect,EntryPoint = "wifi_direct_get_max_clients")] - internal static extern int GetMaxClients(out int max); - [DllImport(Libraries.WiFiDirect,EntryPoint = "wifi_direct_set_passphrase")] - internal static extern int SetPassPhrase(string passphrase); - [DllImport(Libraries.WiFiDirect,EntryPoint = "wifi_direct_get_passphrase")] - internal static extern int GetPassPhrase(out string passphrase); - [DllImport(Libraries.WiFiDirect,EntryPoint = "wifi_direct_get_operating_channel")] - internal static extern int GetChannel(out int channel); - [DllImport(Libraries.WiFiDirect,EntryPoint = "wifi_direct_set_autoconnection_mode")] - internal static extern int SetAutoConnectionMode(bool mode); - [DllImport(Libraries.WiFiDirect,EntryPoint = "wifi_direct_is_autoconnection_mode")] - internal static extern int GetAutoConnectionMode(out bool mode); - [DllImport(Libraries.WiFiDirect,EntryPoint = "wifi_direct_set_autoconnection_peer")] - internal static extern int SetAutoConnectionPeer(string address); - [DllImport(Libraries.WiFiDirect,EntryPoint = "wifi_direct_set_persistent_group_enabled")] - internal static extern int SetPersistentGroupState(bool enabled); - [DllImport(Libraries.WiFiDirect,EntryPoint = "wifi_direct_is_persistent_group_enabled")] - internal static extern int GetPersistentGroupState(out bool enabled); - [DllImport(Libraries.WiFiDirect,EntryPoint = "wifi_direct_foreach_persistent_groups")] - internal static extern int GetPersistentGroups(PersistentGroupCallback callback, IntPtr userData); - [DllImport(Libraries.WiFiDirect,EntryPoint = "wifi_direct_remove_persistent_group")] - internal static extern int RemovePersistentGroup(string address, string ssid); - [DllImport(Libraries.WiFiDirect,EntryPoint = "wifi_direct_start_service_discovery")] - internal static extern int StartServiceDiscovery(string address, WiFiDirectServiceType type); - [DllImport(Libraries.WiFiDirect,EntryPoint = "wifi_direct_cancel_service_discovery")] - internal static extern int StopServiceDiscovery(string address, WiFiDirectServiceType type); - [DllImport(Libraries.WiFiDirect,EntryPoint = "wifi_direct_register_service")] - internal static extern int RegisterService(WiFiDirectServiceType type, string info1, string info2, out uint serviceId); - [DllImport(Libraries.WiFiDirect,EntryPoint = "wifi_direct_deregister_service")] - internal static extern int DeregisterService(uint serviceId); - [DllImport(Libraries.WiFiDirect,EntryPoint = "wifi_direct_init_miracast")] - internal static extern int InitMiracast(bool enable); - [DllImport(Libraries.WiFiDirect,EntryPoint = "wifi_direct_get_peer_info")] - internal static extern int GetDiscoveredPeerInfo(string address, out IntPtr peer); - [DllImport(Libraries.WiFiDirect,EntryPoint = "wifi_direct_init_display")] - internal static extern int InitDisplay(); - [DllImport(Libraries.WiFiDirect,EntryPoint = "wifi_direct_deinit_display")] - internal static extern int DeinitDisplay(); - [DllImport(Libraries.WiFiDirect,EntryPoint = "wifi_direct_set_display")] - internal static extern int SetDisplay(WiFiDirectDisplayType type, int port, int hdcp); - [DllImport(Libraries.WiFiDirect,EntryPoint = "wifi_direct_set_display_availability")] - internal static extern int SetDisplayAvailability(bool availability); - [DllImport(Libraries.WiFiDirect,EntryPoint = "wifi_direct_get_peer_display_type")] - internal static extern int GetDisplayType(string address, out WiFiDirectDisplayType type); - [DllImport(Libraries.WiFiDirect,EntryPoint = "wifi_direct_get_peer_display_availability")] - internal static extern int GetDisplayAvailability(string address, out bool availability); - [DllImport(Libraries.WiFiDirect,EntryPoint = "wifi_direct_get_peer_display_hdcp")] - internal static extern int GetDisplayHdcp(string address, out int hdcp); - [DllImport(Libraries.WiFiDirect,EntryPoint = "wifi_direct_get_peer_display_port")] - internal static extern int GetDisplayPort(string address, out int port); - [DllImport(Libraries.WiFiDirect,EntryPoint = "wifi_direct_get_peer_display_throughput")] - internal static extern int GetDisplayThroughput(string address, out int throughput); - [DllImport(Libraries.WiFiDirect,EntryPoint = "wifi_direct_get_peer_rssi")] - internal static extern int GetRssi(string address, out int rssi); - [DllImport(Libraries.WiFiDirect,EntryPoint = "wifi_direct_get_session_timer")] - internal static extern int GetSessionTimer(out int seconds); - [DllImport(Libraries.WiFiDirect,EntryPoint = "wifi_direct_set_session_timer")] - internal static extern int SetSessionTimer(int seconds); - [DllImport(Libraries.WiFiDirect,EntryPoint = "wifi_direct_set_auto_group_removal")] - internal static extern int SetAutoGroupRemoval(bool enable); - } -} diff --git a/src/Tizen.Network.WiFiDirect/Tizen.Network.WiFiDirect.csproj b/src/Tizen.Network.WiFiDirect/Tizen.Network.WiFiDirect.csproj deleted file mode 100644 index 4c51c4197..000000000 --- a/src/Tizen.Network.WiFiDirect/Tizen.Network.WiFiDirect.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - netstandard2.0 - - - - - - - - \ No newline at end of file diff --git a/src/Tizen.Network.WiFiDirect/Tizen.Network.WiFiDirect.sln b/src/Tizen.Network.WiFiDirect/Tizen.Network.WiFiDirect.sln deleted file mode 100755 index d005b553c..000000000 --- a/src/Tizen.Network.WiFiDirect/Tizen.Network.WiFiDirect.sln +++ /dev/null @@ -1,34 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26430.12 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Network.WiFiDirect", "Tizen.Network.WiFiDirect.csproj", "{5DC9DD9A-CBBE-4530-8981-1D536BCE61A8}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen", "..\Tizen\Tizen.csproj", "{B67770FC-C563-4BB5-B0A0-0B0A8B546D55}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Log", "..\Tizen.Log\Tizen.Log.csproj", "{565F2935-FA76-4D11-B79D-C7F19FA498C8}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {5DC9DD9A-CBBE-4530-8981-1D536BCE61A8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {5DC9DD9A-CBBE-4530-8981-1D536BCE61A8}.Debug|Any CPU.Build.0 = Debug|Any CPU - {5DC9DD9A-CBBE-4530-8981-1D536BCE61A8}.Release|Any CPU.ActiveCfg = Release|Any CPU - {5DC9DD9A-CBBE-4530-8981-1D536BCE61A8}.Release|Any CPU.Build.0 = Release|Any CPU - {B67770FC-C563-4BB5-B0A0-0B0A8B546D55}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B67770FC-C563-4BB5-B0A0-0B0A8B546D55}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B67770FC-C563-4BB5-B0A0-0B0A8B546D55}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B67770FC-C563-4BB5-B0A0-0B0A8B546D55}.Release|Any CPU.Build.0 = Release|Any CPU - {565F2935-FA76-4D11-B79D-C7F19FA498C8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {565F2935-FA76-4D11-B79D-C7F19FA498C8}.Debug|Any CPU.Build.0 = Debug|Any CPU - {565F2935-FA76-4D11-B79D-C7F19FA498C8}.Release|Any CPU.ActiveCfg = Release|Any CPU - {565F2935-FA76-4D11-B79D-C7F19FA498C8}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/src/Tizen.Network.WiFiDirect/Tizen.Network.WiFiDirect/NamespaceDoc.cs b/src/Tizen.Network.WiFiDirect/Tizen.Network.WiFiDirect/NamespaceDoc.cs deleted file mode 100644 index 305250224..000000000 --- a/src/Tizen.Network.WiFiDirect/Tizen.Network.WiFiDirect/NamespaceDoc.cs +++ /dev/null @@ -1,7 +0,0 @@ -/** - -The Tizen.Network.WiFiDirect namespace provides classes to manage the settings of Wi-Fi Direct. -In addition, this namespace provides classes to connect and disconnect remote devices using Wi-Fi Direct. - -*/ -namespace Tizen.Network.WiFiDirect {} diff --git a/src/Tizen.Network.WiFiDirect/Tizen.Network.WiFiDirect/WiFiDirectData.cs b/src/Tizen.Network.WiFiDirect/Tizen.Network.WiFiDirect/WiFiDirectData.cs deleted file mode 100644 index a40a80899..000000000 --- a/src/Tizen.Network.WiFiDirect/Tizen.Network.WiFiDirect/WiFiDirectData.cs +++ /dev/null @@ -1,160 +0,0 @@ -/* - * 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; -using System.Collections.ObjectModel; - -namespace Tizen.Network.WiFiDirect -{ - [StructLayout(LayoutKind.Sequential)] - internal struct DiscoveredPeerStruct - { - [MarshalAsAttribute(UnmanagedType.LPStr)] - internal string _name; - - [MarshalAsAttribute(UnmanagedType.LPStr)] - internal string _macAddress; - - [MarshalAsAttribute(UnmanagedType.LPStr)] - internal string _interfaceAddress; - - internal int _channel; - - [MarshalAsAttribute(UnmanagedType.I1)] - internal bool _isConnected; - - [MarshalAsAttribute(UnmanagedType.I1)] - internal bool _isGroupOwner; - - internal WiFiDirectPrimaryDeviceType _primaryType; - - internal WiFiDirectSecondaryDeviceType _secondaryType; - - internal int _wpsTypes; - - [MarshalAsAttribute(UnmanagedType.I1)] - internal bool _isP2PInvitationSupported; - - internal uint _serviceCount; - - internal IntPtr _serviceList; - - [MarshalAsAttribute(UnmanagedType.I1)] - internal bool _isMiracast; - } - [StructLayout(LayoutKind.Sequential)] - internal struct ConnectedPeerStruct - { - [MarshalAsAttribute(UnmanagedType.LPStr)] - internal string _name; - - [MarshalAsAttribute(UnmanagedType.LPStr)] - internal string _ipAddress; - - [MarshalAsAttribute(UnmanagedType.LPStr)] - internal string _macAddress; - - [MarshalAsAttribute(UnmanagedType.LPStr)] - internal string _interfaceAddress; - - internal int _channel; - - [MarshalAsAttribute(UnmanagedType.I1)] - internal bool _isP2PSupport; - - internal WiFiDirectPrimaryDeviceType _primaryType; - - internal WiFiDirectSecondaryDeviceType _secondaryType; - - internal uint _serviceCount; - - internal IntPtr _serviceList; - - [MarshalAsAttribute(UnmanagedType.I1)] - internal bool _isMiracast; - } - - internal static class WiFiDirectUtils - { - internal static WiFiDirectPeer ConvertStructToDiscoveredPeer(DiscoveredPeerStruct peer) - { - WiFiDirectPeer resultPeer = new WiFiDirectPeer(); - resultPeer._peerDeviceName = peer._name; - resultPeer._peerMacAddress = peer._macAddress; - resultPeer._peerInterfaceAddress = peer._interfaceAddress; - resultPeer._peerChannel = peer._channel; - resultPeer._isPeerConnected = peer._isConnected; - resultPeer._isPeerGroupOwner = peer._isGroupOwner; - resultPeer._peerPrimaryType = peer._primaryType; - resultPeer._peerSecondaryType = peer._secondaryType; - resultPeer._peerWpsTypes = peer._wpsTypes; - resultPeer._p2PInvitationSupported = peer._isP2PInvitationSupported; - Collection uuidList = null; - - if (peer._serviceCount > 0) - { - IntPtr[] serviceList = new IntPtr[peer._serviceCount]; - Marshal.Copy(peer._serviceList, serviceList, 0, (int)peer._serviceCount); - uuidList = new Collection(); - foreach (IntPtr service in serviceList) - { - string registeredService = Marshal.PtrToStringAnsi(service); - uuidList.Add(registeredService); - } - - resultPeer._peerServiceCount = peer._serviceCount; - resultPeer._peerServiceList = uuidList; - } - - resultPeer._isPeerMiracastDevice = peer._isMiracast; - return resultPeer; - } - - internal static WiFiDirectPeer ConvertStructToConnectedPeer(ConnectedPeerStruct peer) - { - WiFiDirectPeer resultPeer = new WiFiDirectPeer(); - resultPeer._peerDeviceName = peer._name; - resultPeer._peerIpAddress = peer._ipAddress; - resultPeer._peerMacAddress = peer._macAddress; - resultPeer._peerInterfaceAddress = peer._interfaceAddress; - resultPeer._peerChannel = peer._channel; - resultPeer._peerP2PSupport = peer._isP2PSupport; - resultPeer._peerPrimaryType = peer._primaryType; - resultPeer._peerSecondaryType = peer._secondaryType; - Collection uuidList = null; - - if (peer._serviceCount > 0) - { - IntPtr[] serviceList = new IntPtr[peer._serviceCount]; - Marshal.Copy(peer._serviceList, serviceList, 0, (int)peer._serviceCount); - uuidList = new Collection(); - foreach (IntPtr service in serviceList) - { - string registeredService = Marshal.PtrToStringAnsi(service); - uuidList.Add(registeredService); - } - - resultPeer._peerServiceCount = peer._serviceCount; - resultPeer._peerServiceList = uuidList; - } - - resultPeer._isPeerMiracastDevice = peer._isMiracast; - return resultPeer; - } - } - -} diff --git a/src/Tizen.Network.WiFiDirect/Tizen.Network.WiFiDirect/WiFiDirectEnumerations.cs b/src/Tizen.Network.WiFiDirect/Tizen.Network.WiFiDirect/WiFiDirectEnumerations.cs deleted file mode 100644 index 398437bb0..000000000 --- a/src/Tizen.Network.WiFiDirect/Tizen.Network.WiFiDirect/WiFiDirectEnumerations.cs +++ /dev/null @@ -1,649 +0,0 @@ -/* - * 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.Network.WiFiDirect -{ - /// - /// Enumeration for the Wi-Fi Direct discovery state. - /// - public enum WiFiDirectDiscoveryState - { - /// - /// Only listen has started. - /// - OnlyListenStarted = 0, - /// - /// Discovery started. - /// - Started, - /// - /// A remote peer is found. - /// - Found, - /// - /// Discovery finished. - /// - Finished, - /// - /// A remote peer is lost. - /// - Lost - } - - /// - /// Enumeration for the Wi-Fi Direct display device types. - /// - public enum WiFiDirectDisplayType - { - /// - /// Configure as the WFD source. - /// - Source = 0, - /// - /// Configure as the WFD primary sink. - /// - Prisink, - /// - /// Configure as the WFD secondary sink. - /// - Secsink, - /// - /// Configure as the WFD dual role. - /// - Dual - } - - /// - /// Enumeration for the Wi-Fi Discovery channel. - /// - public enum WiFiDirectDiscoveryChannel - { - /// - /// Scan full channel. - /// - FullScan = 0, - /// - /// The social channel. - /// - SocialChannel = 1611, - /// - /// Scan channel 1. - /// - Channel1 = 1, - /// - /// Scan channel 6. - /// - Channel6 = 6, - /// - /// Scan channel 11. - /// - Channel11 = 11 - } - - /// - /// Enumeration for the Wi-Fi Direct connection state. - /// - public enum WiFiDirectConnectionState - { - /// - /// Connection is requested. - /// - ConnectionRequest, - /// - /// WPS is requested. - /// - ConnectionWpsRequest, - /// - /// Connection in progress. - /// - ConnectionInProgress, - /// - /// Connected. - /// - ConnectionRsp, - /// - /// Disconnected by the remote group client. - /// - DisassociationInd, - /// - /// Disconnected by the local device. - /// - DisconnectRsp, - /// - /// Disconnected by the remote group owner. - /// - DisconnectInd, - /// - /// Group is created. - /// - GroupCreated, - /// - /// Group is destroyed. - /// - GroupDestroyed - } - - /// - /// Enumeration for the Wi-Fi Direct primary device type. - /// - public enum WiFiDirectPrimaryDeviceType - { - /// - /// Computer. - /// - Computer = 1, - /// - /// Input device. - /// - InputDevice = 2, - /// - /// Printer. - /// - Printer = 3, - /// - /// Camera. - /// - Camera = 4, - /// - /// Storage. - /// - Storage = 5, - /// - /// Network Infrastructure. - /// - NetworkInfrastructure = 6, - /// - /// Display. - /// - Display = 7, - /// - /// Multimedia device. - /// - MultimediaDevice = 8, - /// - /// Game device. - /// - GameDevice = 9, - /// - /// Telephone. - /// - Telephone = 10, - /// - /// Audio. - /// - Audio = 11, - /// - /// Others. - /// - Other = 255 - } - - /// - /// Enumeration for the Wi-Fi Direct secondary device type. - /// - public enum WiFiDirectSecondaryDeviceType - { - /// - /// Computer PC. - /// - ComputerPc = 1, - /// - /// Computer server. - /// - ComputerServer = 2, - /// - /// Computer media center. - /// - ComputerMediaCenter = 3, - /// - /// Computer UMPC. - /// - ComputerUmpc = 4, - /// - /// Computer notebook. - /// - ComputerNotebook = 5, - /// - /// Computer desktop. - /// - ComputerDesktop = 6, - /// - /// Computer MID. - /// - ComputerMid = 7, - /// - /// Computer netbook. - /// - ComputerNetbook = 8, - /// - /// Input keyboard. - /// - InputKeyboard = 1, - /// - /// Input mouse. - /// - InputMouse = 2, - /// - /// Input joystick. - /// - InputJoystick = 3, - /// - /// Input trackball. - /// - InputTrackball = 4, - /// - /// Input controller. - /// - InputController = 5, - /// - /// Input remote. - /// - InputRemote = 6, - /// - /// Input touch screen. - /// - InputTouchScreen = 7, - /// - /// Input biometric reader. - /// - InputBiometricReader = 8, - /// - /// Input barcode reader. - /// - InputBarcodeReader = 9, - /// - /// Printer. - /// - Printer = 1, - /// - /// Printer scanner. - /// - PrinterScanner = 2, - /// - /// Printer fax. - /// - PrinterFax = 3, - /// - /// Printer copier. - /// - PrinterCopier = 4, - /// - /// Printer all-in-one. - /// - PrinterAllInOne = 5, - /// - /// Digital still camera. - /// - CameraDigital = 1, - /// - /// Video camera. - /// - CameraVideo = 2, - /// - /// Webcam. - /// - CameraWebcam = 3, - /// - /// Security camera. - /// - CameraSecurity = 4, - /// - /// Storage NAS. - /// - StorageNas = 1, - /// - /// Network AP. - /// - NetworkAp = 1, - /// - /// Network router. - /// - NetworkRouter = 2, - /// - /// Network switch. - /// - NetworkSwitch = 3, - /// - /// Network gateway. - /// - NetworkGateway = 4, - /// - /// Display TV. - /// - DisplayTv = 1, - /// - /// Display picture frame. - /// - DisplayPicFrame = 2, - /// - /// Display projector. - /// - DisplayProjector = 3, - /// - /// Display monitor. - /// - DisplayMonitor = 4, - /// - /// Multimedia DAR. - /// - MultimediaDar = 1, - /// - /// Multimedia PVR. - /// - MultimediaPvr = 2, - /// - /// Multimedia MCX. - /// - MultimediaMcx = 3, - /// - /// Multimedia set-top box. - /// - MultimediaStb = 4, - /// - /// Media Server/Media Adapter/Media Extender. - /// - MultimediaMsMaMe = 5, - /// - /// Multimedia portable video player. - /// - MultimediaPvp = 6, - /// - /// Game xbox. - /// - GameXbox = 1, - /// - /// Game xbox 360. - /// - GameXbox360, - /// - /// Game play station. - /// - GamePlayStation = 2, - /// - /// Game console. - /// - GameConsole = 3, - /// - /// Game portable. - /// - GamePortable = 4, - /// - /// Windows mobile. - /// - TelephoneWindowsMobile = 1, - /// - /// Phone - single mode. - /// - TelephonePhoneSingle = 2, - /// - /// Phone - dual mode. - /// - TelephonePhoneDual = 3, - /// - /// Smartphone - single mode. - /// - TelephoneSmartphoneSingle = 4, - /// - /// Smartphone - dual mode. - /// - TelephoneSmartphoneDual = 5, - /// - /// Audio tuner. - /// - AudioTuner = 1, - /// - /// Audio speaker. - /// - AudioSpeaker = 2, - /// - /// Audio PMP. - /// - AudioPmp = 3, - /// - /// Audio headset. - /// - AudioHeadset = 4, - /// - /// Audio headphone. - /// - AudioHeadphone = 5, - /// - /// Audio microphone. - /// - AudioMic = 6 - } - - /// - /// Enumeration for the Wi-Fi Direct link status. - /// - public enum WiFiDirectState - { - /// - /// Deactivated. - /// - Deactivated = 0, - /// - /// Deactivating. - /// - Deactivating, - /// - /// Activating. - /// - Activating, - /// - /// Activated. - /// - Activated, - /// - /// Discovering. - /// - Discovering, - /// - /// Connecting. - /// - Connecting, - /// - /// Disconnecting. - /// - Disconnecting, - /// - /// Connected. - /// - Connected, - /// - /// Group owner. - /// - GroupOwner - } - - /// - /// Enumeration for the Wi-Fi WPS type. - /// - public enum WiFiDirectWpsType - { - /// - /// No WPS type. - /// - None = 0x00, - /// - /// Push button configuration. - /// - Pbc = 0x01, - /// - /// Display pin code. - /// - PinDisplay = 0x02, - /// - /// Provide the keypad to input the pin. - /// - PinKeypad = 0x04 - } - - /// - /// Enumeration for the service discovery type. - /// - public enum WiFiDirectServiceType - { - /// - /// The service discovery type All. - /// - All, - /// - /// The service discovery type Bonjour. - /// - Bonjour, - /// - /// The service discovery type UPNP. - /// - Upnp, - /// - /// The service discovery type WS Discovery. - /// - WsDiscovery, - /// - /// The service discovery type Wi-Fi Display. - /// - WiFiDisplay, - /// - /// The service discovery type BT Address. - /// - BtAddress, - /// - /// The service discovery type Contact Info. - /// - ContactInfo, - /// - /// The service discovery type vendor-specific. - /// - Vendor - } - - /// - /// Enumeration for the Wi-Fi Direct service discovery state. - /// - public enum WiFiDirectServiceDiscoveryState - { - /// - /// The service discovery Started. - /// - Started, - /// - /// The service discovery Found. - /// - Found, - /// - /// The service discovery Finished. - /// - Finished - } - - /// - /// Enumeration for the Wi-Fi Direct device state. - /// - public enum WiFiDirectDeviceState - { - /// - /// Activated. - /// - Activated, - /// - /// Deactivated. - /// - Deactivated - } - - /// - /// Enumeration for the Wi-Fi Direct error code. - /// - public enum WiFiDirectError - { - /// - /// Successful. - /// - None = ErrorCode.None, - /// - /// Operation not permitted. - /// - NotPermitted = ErrorCode.NotPermitted, - /// - /// Out of memory. - /// - OutOfMemory = ErrorCode.OutOfMemory, - /// - /// Permission denied. - /// - PermissionDenied = ErrorCode.PermissionDenied, - /// - /// Device or the resource is busy. - /// - ResourceBusy = ErrorCode.ResourceBusy, - /// - /// Invalid function parameter. - /// - InvalidParameter = ErrorCode.InvalidParameter, - /// - /// Connection timed out. - /// - ConnectionTimeOut = ErrorCode.ConnectionTimeout, - /// - /// Not supported. - /// - NotSupported = ErrorCode.NotSupported, - /// - /// Not initialized. - /// - NotInitialized = -0x01C60000 | 0x01, - /// - /// I/O error. - /// - CommunicationFailed = -0x01C60000 | 0x02, - /// - /// Wi-Fi is being used. - /// - WiFiUsed = -0x01C60000 | 0x03, - /// - /// Mobile AP is being used. - /// - MobileApUsed = -0x01C60000 | 0x04, - /// - /// Connection failed. - /// - ConnectionFailed = -0x01C60000 | 0x05, - /// - /// Authentication failed. - /// - AuthFailed = -0x01C60000 | 0x06, - /// - /// Operation failed. - /// - OperationFailed = -0x01C60000 | 0x07, - /// - /// Too many clients. - /// - TooManyClient = -0x01C60000 | 0x08, - /// - /// Already initialized the client. - /// - AlreadyInitialized = -0x01C60000 | 0x09, - /// - /// Connection cancelled by the local device. - /// - ConnectionCancelled = -0x01C60000 | 0x10 - } -} diff --git a/src/Tizen.Network.WiFiDirect/Tizen.Network.WiFiDirect/WiFiDirectError.cs b/src/Tizen.Network.WiFiDirect/Tizen.Network.WiFiDirect/WiFiDirectError.cs deleted file mode 100644 index 80e929efe..000000000 --- a/src/Tizen.Network.WiFiDirect/Tizen.Network.WiFiDirect/WiFiDirectError.cs +++ /dev/null @@ -1,65 +0,0 @@ -/* - * 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.Network.WiFiDirect -{ - internal static class WiFiDirectErrorFactory - { - internal static void ThrowWiFiDirectException(int exception) - { - WiFiDirectError _error = (WiFiDirectError)exception; - switch (_error) - { - case WiFiDirectError.InvalidParameter: - throw new InvalidOperationException("Invalid parameter"); - case WiFiDirectError.AlreadyInitialized: - throw new InvalidOperationException("Already initialized"); - case WiFiDirectError.AuthFailed: - throw new InvalidOperationException("Authentication failed"); - case WiFiDirectError.CommunicationFailed: - throw new InvalidOperationException("Communication failed"); - case WiFiDirectError.ConnectionCancelled: - throw new InvalidOperationException("Connection cancelled"); - case WiFiDirectError.ConnectionFailed: - throw new InvalidOperationException("Connection failed"); - case WiFiDirectError.ConnectionTimeOut: - throw new InvalidOperationException("Connection timed out"); - case WiFiDirectError.MobileApUsed: - throw new InvalidOperationException("Mobile Ap is being used"); - case WiFiDirectError.NotInitialized: - throw new InvalidOperationException("Not initialized"); - case WiFiDirectError.NotPermitted: - throw new InvalidOperationException("Not permitted"); - case WiFiDirectError.NotSupported: - throw new NotSupportedException("Not supported"); - case WiFiDirectError.OperationFailed: - throw new InvalidOperationException("Operation failed"); - case WiFiDirectError.OutOfMemory: - throw new InvalidOperationException("Out of memory"); - case WiFiDirectError.PermissionDenied: - throw new UnauthorizedAccessException("Permission denied (http://tizen.org/privilege/wifidirect)"); - case WiFiDirectError.ResourceBusy: - throw new InvalidOperationException("Resource is busy"); - case WiFiDirectError.TooManyClient: - throw new InvalidOperationException("Too many client"); - case WiFiDirectError.WiFiUsed: - throw new InvalidOperationException("Wi-fi is being used"); - } - } - } -} diff --git a/src/Tizen.Network.WiFiDirect/Tizen.Network.WiFiDirect/WiFiDirectEventArgs.cs b/src/Tizen.Network.WiFiDirect/Tizen.Network.WiFiDirect/WiFiDirectEventArgs.cs deleted file mode 100644 index 5675c8a73..000000000 --- a/src/Tizen.Network.WiFiDirect/Tizen.Network.WiFiDirect/WiFiDirectEventArgs.cs +++ /dev/null @@ -1,382 +0,0 @@ -/* - * 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.Collections.Generic; - -namespace Tizen.Network.WiFiDirect -{ - /// - /// An extended EventArgs class which contains the changed connection state during connecting or disconnecting the peer device. - /// - public class ConnectionStateChangedEventArgs : EventArgs - { - private WiFiDirectError _error; - private WiFiDirectConnectionState _state; - private string _macAddress; - - internal ConnectionStateChangedEventArgs(WiFiDirectError error, WiFiDirectConnectionState state, string macAddress) - { - _error = error; - _state = state; - _macAddress = macAddress; - } - - /// - /// The Wi-Fi Direct result. - /// - public WiFiDirectError Error - { - get - { - return _error; - } - } - - /// - /// The Wi-Fi Direct connection state of the peer. - /// - public WiFiDirectConnectionState State - { - get - { - return _state; - } - } - - /// - /// The MacAddress of the peer. - /// - public string MacAddress - { - get - { - return _macAddress; - } - } - } - - /// - /// An extended EventArgs class which contains address properties of the peer when it connects to a group owner. - /// - public class IpAddressAssignedEventArgs : EventArgs - { - private string _macAddress; - private string _ipAddress; - private string _interfaceAddress; - - internal IpAddressAssignedEventArgs(string macAddress, string ipAddress, string interfaceAddress) - { - _macAddress = macAddress; - _ipAddress = ipAddress; - _interfaceAddress = interfaceAddress; - } - - /// - /// The MacAddress of the connected peer. - /// - public string MacAddress - { - get - { - return _macAddress; - } - } - - /// - /// The IpAddress of the connected peer. - /// - public string IpAddress - { - get - { - return _ipAddress; - } - } - - /// - /// The InterfaceAddress of the connected peer. - /// - public string InterfaceAddress - { - get - { - return _interfaceAddress; - } - } - } - - /// - /// An extended EventArgs class which contains the changed Wi-Fi Direct state of the local device. - /// - public class StateChangedEventArgs : EventArgs - { - private WiFiDirectState _state; - - internal StateChangedEventArgs(WiFiDirectState state) - { - _state = state; - } - - /// - /// The Wi-Fi Direct state. - /// - public WiFiDirectState State - { - get - { - return _state; - } - } - } - - /// - /// An extended EventArgs class which contains the changed Wi-Fi Direct discovery state during the Wi-Fi Direct scan operation. - /// - public class DiscoveryStateChangedEventArgs : EventArgs - { - private WiFiDirectError _error; - private WiFiDirectDiscoveryState _state; - - internal DiscoveryStateChangedEventArgs(WiFiDirectError error, WiFiDirectDiscoveryState state) - { - _error = error; - _state = state; - } - - /// - /// The Wi-Fi Direct result. - /// - public WiFiDirectError Error - { - get - { - return _error; - } - } - - /// - /// The Wi-Fi Direct discovery state. - /// - public WiFiDirectDiscoveryState DiscoveryState - { - get - { - return _state; - } - } - } - - /// - /// An extended EventArgs class which contains the found peer information during the Wi-Fi Direct scan operation. - /// - public class PeerFoundEventArgs : EventArgs - { - private WiFiDirectError _error; - private WiFiDirectDiscoveryState _state; - private WiFiDirectPeer _peer; - - internal PeerFoundEventArgs(WiFiDirectError error, WiFiDirectDiscoveryState state, WiFiDirectPeer peer) - { - _error = error; - _state = state; - _peer = peer; - } - - /// - /// The Wi-Fi Direct result. - /// - public WiFiDirectError Error - { - get - { - return _error; - } - } - - /// - /// The Wi-Fi Direct discovery state. - /// - public WiFiDirectDiscoveryState DiscoveryState - { - get - { - return _state; - } - } - - /// - /// The found peer. - /// - public WiFiDirectPeer Peer - { - get - { - return _peer; - } - } - } - - /// - /// An extended EventArgs class which contains the changed device state during activation or deactivation. - /// - public class DeviceStateChangedEventArgs : EventArgs - { - private WiFiDirectError _error; - private WiFiDirectDeviceState _state; - - internal DeviceStateChangedEventArgs(WiFiDirectError error, WiFiDirectDeviceState state) - { - _error = error; - _state = state; - } - - /// - /// The Wi-Fi Direct result. - /// - public WiFiDirectError Error - { - get - { - return _error; - } - } - - /// - /// The state of the device. - /// - public WiFiDirectDeviceState DeviceState - { - get - { - return _state; - } - } - } - - /// - /// An extended EventArgs class which contains the changed service information during the service discovery. - /// - public class ServiceStateChangedEventArgs : EventArgs - { - private WiFiDirectError _error; - private WiFiDirectServiceDiscoveryState _state; - private WiFiDirectServiceType _type; - private string _response; - private WiFiDirectPeer _peer; - - internal ServiceStateChangedEventArgs(WiFiDirectError error, WiFiDirectServiceDiscoveryState state, WiFiDirectServiceType type, string response, WiFiDirectPeer peer) - { - _error = error; - _state = state; - _type = type; - _response = response; - _peer = peer; - } - - /// - /// The Wi-Fi Direct result. - /// - public WiFiDirectError Error - { - get - { - return _error; - } - } - - /// - /// The service discovery state. - /// - public WiFiDirectServiceDiscoveryState ServiceDiscoveryState - { - get - { - return _state; - } - } - - /// - /// The types of service. - /// - public WiFiDirectServiceType ServiceType - { - get - { - return _type; - } - } - - /// - /// The received response. - /// - public string Response - { - get - { - return _response; - } - } - - /// - /// The peer servicing device. - /// - public WiFiDirectPeer Peer - { - get - { - return _peer; - } - } - } - - /// - /// An extended EventArgs class which contains the changed connection state during disconnecting of all peers or grouping related operations. - /// - public class ConnectionStatusChangedEventArgs : EventArgs - { - private WiFiDirectError _error; - private WiFiDirectConnectionState _state; - - internal ConnectionStatusChangedEventArgs(WiFiDirectError error, WiFiDirectConnectionState state) - { - _error = error; - _state = state; - } - - /// - /// The Wi-Fi Direct result. - /// - public WiFiDirectError Error - { - get - { - return _error; - } - } - - /// - /// The connection state. - /// - public WiFiDirectConnectionState ConnectionState - { - get - { - return _state; - } - } - } -} diff --git a/src/Tizen.Network.WiFiDirect/Tizen.Network.WiFiDirect/WiFiDirectManager.cs b/src/Tizen.Network.WiFiDirect/Tizen.Network.WiFiDirect/WiFiDirectManager.cs deleted file mode 100644 index c7751a6d8..000000000 --- a/src/Tizen.Network.WiFiDirect/Tizen.Network.WiFiDirect/WiFiDirectManager.cs +++ /dev/null @@ -1,1628 +0,0 @@ -/* - * 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.ComponentModel; -using System.Collections.Generic; - -namespace Tizen.Network.WiFiDirect -{ - /// - /// A class which is used to manage settings of Wi-Fi Direct.
- /// This class is used to discover peer devices and manage settings of Wi-Fi Direct. - ///
- public static class WiFiDirectManager - { - /// - /// Gets the IsInitialized. - /// - /// - /// A property to check whether the Wifidirect is initialized or not. - /// - /// - /// http://tizen.org/privilege/wifidirect - /// - /// - /// If it is not initialized, false will be returned. - /// - /// The required feature is not supported. - /// Thrown when application does not have privilege to access this method. - [EditorBrowsable(EditorBrowsableState.Never)] - public static bool IsInitialized - { - get - { - return WiFiDirectManagerImpl.Instance.IsInitialize; - } - } - /// - /// Gets the IsGroupOwner. - /// - /// - /// A property to check whether the device is group owner or not. - /// - /// - /// http://tizen.org/privilege/wifidirect - /// - /// - /// Wi-Fi Direct must be activated. - /// If it is deactivated, false will be returned. - /// - /// The required feature is not supported. - /// Thrown when application does not have privilege to access this method. - public static bool IsGroupOwner - { - get - { - if (Globals.IsActivated) - { - return WiFiDirectManagerImpl.Instance.IsGroupOwner; - } - - else - { - return false; - } - } - } - - /// - /// Gets the IsAutonomousGroup. - /// - /// - /// A property to check whether the current group is the autonomous group or not. - /// - /// - /// http://tizen.org/privilege/wifidirect - /// - /// - /// Wi-Fi Direct must be activated. - /// If it is deactivated, false will be returned. - /// - /// The required feature is not supported. - /// Thrown when application does not have privilege to access this method. - public static bool IsAutonomousGroup - { - get - { - if (Globals.IsActivated) - { - return WiFiDirectManagerImpl.Instance.IsAutonomousGroup; - } - - else - { - return false; - } - } - } - - /// - /// Gets the Ssid. - /// - /// - /// SSID of local device. - /// - /// - /// http://tizen.org/privilege/wifidirect - /// - /// - /// If there is any error, null will be returned. - /// - /// The required feature is not supported. - /// Thrown when application does not have privilege to access this method. - public static string Ssid - { - get - { - if (Globals.IsInitialize) - { - return WiFiDirectManagerImpl.Instance.Ssid; - } - - else - { - return null; - } - } - } - - /// - /// Gets the NetworkInterface. - /// - /// - /// Name of network interface. - /// - /// - /// http://tizen.org/privilege/wifidirect - /// - /// - /// Wi-Fi Direct must be activated. - /// If it is deactivated, null will be returned. - /// - /// The required feature is not supported. - /// Thrown when application does not have privilege to access this method. - public static string NetworkInterface - { - get - { - if (Globals.IsActivated) - { - return WiFiDirectManagerImpl.Instance.NetworkInterface; - } - - else - { - return null; - } - } - } - - /// - /// Gets the IpAddress. - /// - /// - /// IP address of a local device. - /// - /// - /// http://tizen.org/privilege/wifidirect - /// - /// - /// Wi-Fi Direct must be activated. - /// If it is deactivated, null will be returned. - /// - /// The required feature is not supported. - /// Thrown when application does not have privilege to access this method. - public static string IpAddress - { - get - { - if (Globals.IsActivated) - { - return WiFiDirectManagerImpl.Instance.IpAddress; - } - - else - { - return null; - } - } - } - - /// - /// Gets the SubnetMask. - /// - /// - /// Subnet mask. - /// - /// - /// http://tizen.org/privilege/wifidirect - /// - /// - /// Wi-Fi Direct must be activated. - /// If it is deactivated, null will be returned. - /// - /// The required feature is not supported. - /// Thrown when application does not have privilege to access this method. - public static string SubnetMask - { - get - { - if (Globals.IsActivated) - { - return WiFiDirectManagerImpl.Instance.SubnetMask; - } - - else - { - return null; - } - } - } - - /// - /// Gets the GatewayAddress. - /// - /// - /// Gateway address. - /// - /// - /// http://tizen.org/privilege/wifidirect - /// - /// - /// Wi-Fi Direct must be activated. - /// If it is deactivated, null will be returned. - /// - /// The required feature is not supported. - /// Thrown when application does not have privilege to access this method. - public static string GatewayAddress - { - get - { - if (Globals.IsActivated) - { - return WiFiDirectManagerImpl.Instance.GatewayAddress; - } - - else - { - return null; - } - } - } - - /// - /// Gets the MacAddress. - /// - /// - /// Mac address of a local device. - /// - /// - /// http://tizen.org/privilege/wifidirect - /// - /// - /// If there is any error, null will be returned. - /// - /// The required feature is not supported. - /// Thrown when application does not have privilege to access this method. - public static string MacAddress - { - get - { - if (Globals.IsInitialize) - { - return WiFiDirectManagerImpl.Instance.MacAddress; - } - - else - { - return null; - } - } - } - - /// - /// Gets the State. - /// - /// - /// State of Wi-Fi direct service. - /// - /// - /// http://tizen.org/privilege/wifidirect - /// - /// The required feature is not supported. - /// Thrown when application does not have privilege to access this method. - public static WiFiDirectState State - { - get - { - return WiFiDirectManagerImpl.Instance.State; - } - } - - /// - /// A property to check whether the device is discoverable or not by P2P discovery. - /// - /// - /// - /// - /// - /// http://tizen.org/privilege/wifidirect - /// - /// The required feature is not supported. - /// Thrown when application does not have privilege to access this method. - public static bool IsDiscoverable - { - get - { - if (Globals.IsInitialize) - { - return WiFiDirectManagerImpl.Instance.IsDiscoverable; - } - - else - { - return false; - } - } - } - - /// - /// Gets the IsListenOnly. - /// - /// - /// A property to check whether the local device is listening only. - /// - /// - /// http://tizen.org/privilege/wifidirect - /// - /// - /// Wi-Fi Direct must be activated. - /// If it is deactivated, false will be returned. - /// - /// The required feature is not supported. - /// Thrown when application does not have privilege to access this method. - public static bool IsListenOnly - { - get - { - if (Globals.IsActivated) - { - return WiFiDirectManagerImpl.Instance.IsListenOnly; - } - - else - { - return false; - } - } - } - - /// - /// Gets the PrimaryType. - /// - /// - /// Primary device type of local device. - /// - /// - /// http://tizen.org/privilege/wifidirect - /// - /// - /// If there is any error, 0 will be returned. - /// - /// The required feature is not supported. - /// Thrown when application does not have privilege to access this method. - public static WiFiDirectPrimaryDeviceType PrimaryType - { - get - { - if (Globals.IsInitialize) - { - return WiFiDirectManagerImpl.Instance.PrimaryType; - } - - else - { - return default(WiFiDirectPrimaryDeviceType); - } - } - } - - /// - /// Gets the SecondaryType. - /// - /// - /// Secondary device type of local device. - /// - /// - /// http://tizen.org/privilege/wifidirect - /// - /// - /// If there is any error, 0 will be returned. - /// - /// The required feature is not supported. - /// Thrown when application does not have privilege to access this method. - public static WiFiDirectSecondaryDeviceType SecondaryType - { - get - { - if (Globals.IsInitialize) - { - return WiFiDirectManagerImpl.Instance.SecondaryType; - } - - else - { - return default(WiFiDirectSecondaryDeviceType); - } - } - } - - /// - /// Gets the WpsMode. - /// - /// - /// Supported WPS (Wi-Fi Protected Setup) types at local device. - /// - /// - /// http://tizen.org/privilege/wifidirect - /// - /// - /// If there is any error, -1 will be returned. - /// - /// The required feature is not supported. - /// Thrown when application does not have privilege to access this method. - public static int WpsMode - { - get - { - if (Globals.IsInitialize) - { - return WiFiDirectManagerImpl.Instance.WpsMode; - } - - else - { - return -1; - } - } - } - - /// - /// Gets the Wps. - /// - /// - /// WPS (Wi-Fi Protected Setup) type. - /// - /// - /// http://tizen.org/privilege/wifidirect - /// - /// The required feature is not supported. - /// Thrown when application does not have privilege to access this method. - public static WiFiDirectWpsType Wps - { - get - { - if (Globals.IsInitialize) - { - return WiFiDirectManagerImpl.Instance.WpsType; - } - - else - { - return default(WiFiDirectWpsType); - } - } - } - - /// - /// Gets the OperatingChannel. - /// - /// - /// Channel number on which the P2P Device is operating as the P2P Group. - /// - /// - /// http://tizen.org/privilege/wifidirect - /// - /// - /// If there is any error, -1 will be returned. - /// - /// The required feature is not supported. - /// Thrown when application does not have privilege to access this method. - public static int OperatingChannel - { - get - { - if (Globals.IsInitialize) - { - return WiFiDirectManagerImpl.Instance.OperatingChannel; - } - - else - { - return -1; - } - } - } - - /// - /// Gets and sets the PersistentGroupEnabled. - /// - /// - /// A property to check whether persistent group is enabled. - /// - /// - /// http://tizen.org/privilege/wifidirect - /// - /// The object is in invalid state. - /// The required feature is not supported. - /// Thrown when application does not have privilege to access this method. - public static bool PersistentGroupEnabled - { - get - { - if (Globals.IsInitialize) - { - return WiFiDirectManagerImpl.Instance.PersistentGroupEnabled; - } - - else - { - return false; - } - } - - set - { - if (Globals.IsInitialize) - { - WiFiDirectManagerImpl.Instance.PersistentGroupEnabled = value; - } - } - } - - /// - /// Gets and sets the AutoConnect. - /// - /// - /// Autoconnection mode status. - /// - /// - /// http://tizen.org/privilege/wifidirect - /// - /// The object is in invalid state. - /// The required feature is not supported. - /// Thrown when application does not have privilege to access this method. - public static bool AutoConnect - { - get - { - if (Globals.IsInitialize) - { - return WiFiDirectManagerImpl.Instance.AutoConnect; - } - - else - { - return false; - } - } - - set - { - if (Globals.IsInitialize) - { - WiFiDirectManagerImpl.Instance.AutoConnect = value; - } - } - } - - /// - /// Gets and sets the WpsPin. - /// - /// - /// WPS PIN number. - /// - /// - /// http://tizen.org/privilege/wifidirect - /// - /// - /// Wi-Fi Direct must be activated. - /// If it is deactivated, null will be returned during get and Not permitted exception message will be returned during set. - /// - /// The object is in invalid state. - /// The required feature is not supported. - /// Thrown when application does not have privilege to access this method. - public static string WpsPin - { - get - { - if (Globals.IsActivated) - { - return WiFiDirectManagerImpl.Instance.WpsPin; - } - - else - { - return null; - } - } - - set - { - if (Globals.IsActivated) - { - WiFiDirectManagerImpl.Instance.WpsPin = value; - } - - else - { - Log.Error(Globals.LogTag, "Wifi-direct is not activated"); - WiFiDirectErrorFactory.ThrowWiFiDirectException((int)WiFiDirectError.NotPermitted); - } - } - } - - /// - /// Gets and sets the Name. - /// - /// - /// Name of local device. - /// - /// - /// http://tizen.org/privilege/wifidirect - /// - /// The object is in invalid state. - /// The required feature is not supported. - /// Thrown when application does not have privilege to access this method. - public static string Name - { - get - { - if (Globals.IsInitialize) - { - return WiFiDirectManagerImpl.Instance.Name; - } - - else - { - return null; - } - } - - set - { - if (Globals.IsInitialize) - { - WiFiDirectManagerImpl.Instance.Name = value; - } - } - } - - /// - /// Gets and sets the RequestedWps. - /// - /// - /// Requested WPS (Wi-Fi Protected Setup) type. - /// - /// - /// http://tizen.org/privilege/wifidirect - /// - /// The object is in invalid state. - /// The required feature is not supported. - /// Thrown when application does not have privilege to access this method. - public static WiFiDirectWpsType RequestedWps - { - get - { - if (Globals.IsInitialize) - { - return WiFiDirectManagerImpl.Instance.RequestedWps; - } - - else - { - return default(WiFiDirectWpsType); - } - } - - set - { - if (Globals.IsInitialize) - { - WiFiDirectManagerImpl.Instance.RequestedWps = value; - } - } - } - - /// - /// Gets and sets the GroupOwnerIntent. - /// - /// - /// Intent of the group owner. - /// - /// - /// http://tizen.org/privilege/wifidirect - /// - /// The object is in invalid state. - /// The required feature is not supported. - /// Thrown when application does not have privilege to access this method. - public static int GroupOwnerIntent - { - get - { - if (Globals.IsInitialize) - { - return WiFiDirectManagerImpl.Instance.GroupOwnerIntent; - } - - else - { - return -1; - } - } - - set - { - if (Globals.IsInitialize) - { - WiFiDirectManagerImpl.Instance.GroupOwnerIntent = value; - } - } - } - - /// - /// Gets and sets the MaxClients. - /// - /// - /// Max number of clients. - /// - /// - /// http://tizen.org/privilege/wifidirect - /// - /// The object is in invalid state. - /// The required feature is not supported. - /// Thrown when application does not have privilege to access this method. - public static int MaxClients - { - get - { - if (Globals.IsInitialize) - { - return WiFiDirectManagerImpl.Instance.MaxClients; - } - - else - { - return -1; - } - } - - set - { - if (Globals.IsInitialize) - { - WiFiDirectManagerImpl.Instance.MaxClients = value; - } - } - } - - /// - /// Gets and sets the Passphrase. - /// It is used during Wi-Fi Direct Group creation. - /// - /// - /// Wi-Fi Protected Access (WPA) password. - /// - /// - /// http://tizen.org/privilege/wifidirect - /// - /// - /// Wi-Fi Direct must be activated. - /// If it is deactivated, null will be returned during get and Not permitted exception message will be returned during set. - /// - /// The object is in invalid state. - /// The required feature is not supported. - /// Thrown when application does not have privilege to access this method. - public static string Passphrase - { - get - { - if (Globals.IsActivated) - { - return WiFiDirectManagerImpl.Instance.Passphrase; - } - - else - { - return null; - } - } - - set - { - if (Globals.IsActivated) - { - WiFiDirectManagerImpl.Instance.Passphrase = value; - } - - else - { - Log.Error(Globals.LogTag, "Wi-Fi direct is not activated"); - WiFiDirectErrorFactory.ThrowWiFiDirectException((int)WiFiDirectError.NotPermitted); - } - } - } - - /// - /// Gets and sets the SessionTimer. - /// - /// - /// Connection session timer value in second. - /// - /// - /// http://tizen.org/privilege/wifidirect - /// - /// - /// Wi-Fi Direct must be activated. - /// If it is deactivated, -1 will be returned during get and Not permitted exception message will be returned during set. - /// - /// The object is in invalid state. - /// The required feature is not supported. - /// Thrown when application does not have privilege to access this method. - public static int SessionTimer - { - get - { - if (Globals.IsActivated) - { - return WiFiDirectManagerImpl.Instance.SessionTimer; - } - - else - { - return -1; - } - } - - set - { - if (Globals.IsActivated) - { - WiFiDirectManagerImpl.Instance.SessionTimer = value; - } - - else - { - Log.Error(Globals.LogTag, "Wi-Fi direct is not activated"); - WiFiDirectErrorFactory.ThrowWiFiDirectException((int)WiFiDirectError.NotPermitted); - } - } - } - - /// - /// (event) StateChanged is raised when Wi-Fi Direct state is changed. - /// - public static event EventHandler StateChanged - { - add - { - WiFiDirectManagerImpl.Instance.StateChanged += value; - } - - remove - { - WiFiDirectManagerImpl.Instance.StateChanged -= value; - } - } - - /// - /// (event) DiscoveryStateChanged is raised when Wi-Fi Direct discovery state is changed. - /// - public static event EventHandler DiscoveryStateChanged - { - add - { - if (Globals.IsInitialize) - { - WiFiDirectManagerImpl.Instance.DiscoveryStateChanged += value; - } - } - - remove - { - if (Globals.IsInitialize) - { - WiFiDirectManagerImpl.Instance.DiscoveryStateChanged -= value; - } - } - } - - /// - /// (event) DeviceStateChanged is raised when device state is changed. - /// - public static event EventHandler DeviceStateChanged - { - add - { - if (Globals.IsInitialize) - { - WiFiDirectManagerImpl.Instance.DeviceStateChanged += value; - } - } - - remove - { - if (Globals.IsInitialize) - { - WiFiDirectManagerImpl.Instance.DeviceStateChanged -= value; - } - } - } - - /// - /// (event) PeerFound is raised when peer is found. - /// - public static event EventHandler PeerFound - { - add - { - if (Globals.IsInitialize) - { - WiFiDirectManagerImpl.Instance.PeerFound += value; - } - } - - remove - { - if (Globals.IsInitialize) - { - WiFiDirectManagerImpl.Instance.PeerFound -= value; - } - } - } - - /// - /// (event) ConnectionStatusChanged is raised when status of connection is changed. - /// - public static event EventHandler ConnectionStatusChanged - { - add - { - if (Globals.IsInitialize) - { - WiFiDirectManagerImpl.Instance.ConnectionStatusChanged += value; - } - } - - remove - { - if (Globals.IsInitialize) - { - WiFiDirectManagerImpl.Instance.ConnectionStatusChanged -= value; - } - } - } - - /// - /// Activates the Wi-Fi Direct service. - /// - /// - /// If this succeeds, DeviceStateChanged event will be invoked. - /// - /// The object is in invalid state. - /// The required feature is not supported. - /// Thrown when application does not have privilege to access this method. - public static void Activate() - { - if (Globals.IsInitialize) - { - WiFiDirectManagerImpl.Instance.Activate(); - } - - else - { - Log.Error(Globals.LogTag, "Wi-Fi direct is not initialized"); - WiFiDirectErrorFactory.ThrowWiFiDirectException((int)WiFiDirectError.NotInitialized); - } - } - - /// - /// Deactivates the Wi-Fi Direct service. - /// - /// - /// http://tizen.org/privilege/wifidirect - /// - /// - /// http://tizen.org/feature/network.wifidirect - /// - /// - /// Wi-Fi Direct must be activated. - /// If this succeeds, DeviceStateChanged event will be invoked. - /// - /// The object is in invalid state. - /// The required feature is not supported. - /// Thrown when application does not have privilege to access this method. - public static void Deactivate() - { - if (Globals.IsActivated) - { - WiFiDirectManagerImpl.Instance.Deactivate(); - } - - else - { - Log.Error(Globals.LogTag, "Wi-Fi direct is not activated"); - WiFiDirectErrorFactory.ThrowWiFiDirectException((int)WiFiDirectError.NotPermitted); - } - } - - /// - /// Starts discovery to find all P2P capable devices. - /// - /// Listen status.If False, then cycle between Scan and Listen.If True, then skip the initial 802.11 Scan and enter Listen state. - /// Duration of discovery period, in seconds. - /// Discovery channel.It is optional, default enum value FullScan is assigned. - /// - /// http://tizen.org/privilege/wifidirect - /// - /// - /// http://tizen.org/feature/network.wifidirect - /// - /// - /// Wi-Fi Direct must be activated. - /// If this succeeds, DiscoveryStateChanged and PeerFound event will be invoked. - /// - /// The object is in invalid state. - /// The required feature is not supported. - /// Thrown when application does not have privilege to access this method. - public static void StartDiscovery(bool listenOnly, int duration, WiFiDirectDiscoveryChannel channel = WiFiDirectDiscoveryChannel.FullScan) - { - if (Globals.IsActivated) - { - WiFiDirectManagerImpl.Instance.StartDiscovery(listenOnly, duration, channel); - } - - else - { - Log.Error(Globals.LogTag, "Wi-Fi direct is not activated"); - WiFiDirectErrorFactory.ThrowWiFiDirectException((int)WiFiDirectError.NotPermitted); - } - } - - /// - /// Cancels discovery process. - /// - /// - /// http://tizen.org/privilege/wifidirect - /// - /// - /// http://tizen.org/feature/network.wifidirect - /// - /// - /// Discovery must be started by StartDiscovery. - /// If this succeeds, DiscoveryStateChanged and PeerFound event will be invoked. - /// - /// The object is in invalid state. - /// The required feature is not supported. - /// Thrown when application does not have privilege to access this method. - public static void CancelDiscovery() - { - if (WiFiDirectManager.State == WiFiDirectState.Discovering) - { - WiFiDirectManagerImpl.Instance.CancelDiscovery(); - } - - else - { - Log.Error(Globals.LogTag, "Wi-Fi direct discovery is not started"); - WiFiDirectErrorFactory.ThrowWiFiDirectException((int)WiFiDirectError.NotPermitted); - } - } - - /// - /// Gets the information of discovered peers. - /// - /// List of discovered peer objects. - /// - /// http://tizen.org/privilege/wifidirect - /// - /// - /// http://tizen.org/feature/network.wifidirect - /// - /// - /// Wi-Fi Direct must be activated. - /// - /// The object is in invalid state. - /// The required feature is not supported. - /// Thrown when application does not have privilege to access this method. - public static IEnumerable GetDiscoveredPeers() - { - if (Globals.IsActivated) - { - return WiFiDirectManagerImpl.Instance.GetDiscoveredPeers(); - } - - else - { - return null; - } - } - - /// - /// Gets the information of connected peers. - /// - /// List of connected peer objects. - /// - /// http://tizen.org/privilege/wifidirect - /// - /// - /// http://tizen.org/feature/network.wifidirect - /// - /// - /// Wi-Fi Direct must be activated. - /// - /// The object is in invalid state. - /// The required feature is not supported. - /// Thrown when application does not have privilege to access this method. - public static IEnumerable GetConnectedPeers() - { - if (Globals.IsActivated) - { - return WiFiDirectManagerImpl.Instance.GetConnectedPeers(); - } - - else - { - return null; - } - } - - /// - /// Disconnects all connected links to peers. - /// - /// - /// http://tizen.org/privilege/wifidirect - /// - /// - /// http://tizen.org/feature/network.wifidirect - /// - /// - /// Wi-Fi Direct must be activated. - /// If this succeeds, ConnectionStatusChanged event will be invoked. - /// - /// The object is in invalid state. - /// The required feature is not supported. - /// Thrown when application does not have privilege to access this method. - public static void DisconnectAll() - { - if (Globals.IsActivated) - { - WiFiDirectManagerImpl.Instance.DisconnectAll(); - } - - else - { - Log.Error(Globals.LogTag, "Wifi-direct is not activated"); - WiFiDirectErrorFactory.ThrowWiFiDirectException((int)WiFiDirectError.NotPermitted); - } - } - - /// - /// Creates a Wi-Fi Direct group and sets up device as the group owner. - /// - /// - /// http://tizen.org/privilege/wifidirect - /// - /// - /// http://tizen.org/feature/network.wifidirect - /// - /// - /// Wi-Fi Direct must be activated. - /// If this succeeds, ConnectionStatusChanged event will be invoked with GroupCreated. - /// - /// The object is in invalid state. - /// The required feature is not supported. - /// Thrown when application does not have privilege to access this method. - public static void CreateGroup() - { - if (Globals.IsActivated) - { - WiFiDirectManagerImpl.Instance.CreateGroup(); - } - - else - { - Log.Error(Globals.LogTag, "Wifi-direct is not activated"); - WiFiDirectErrorFactory.ThrowWiFiDirectException((int)WiFiDirectError.NotPermitted); - } - } - - /// - /// Destroys the Wi-Fi Direct group owned by a local device.If creating a group is in progress, this API cancels that process. - /// - /// - /// http://tizen.org/privilege/wifidirect - /// - /// - /// http://tizen.org/feature/network.wifidirect - /// - /// - /// Wi-Fi Direct must be activated. - /// If this succeeds, ConnectionStatusChanged event will be invoked with GroupDestroyed. - /// - /// The object is in invalid state. - /// The required feature is not supported. - /// Thrown when application does not have privilege to access this method. - public static void DestroyGroup() - { - if (Globals.IsActivated) - { - WiFiDirectManagerImpl.Instance.DestroyGroup(); - } - - else - { - Log.Error(Globals.LogTag, "Wifi-direct is not activated"); - WiFiDirectErrorFactory.ThrowWiFiDirectException((int)WiFiDirectError.NotPermitted); - } - } - - /// - /// Set the WPS config PBC as preferred method for connection. - /// - /// - /// http://tizen.org/privilege/wifidirect - /// - /// - /// http://tizen.org/feature/network.wifidirect - /// - /// The object is in invalid state. - /// The required feature is not supported. - /// Thrown when application does not have privilege to access this method. - public static void ActivatePushButton() - { - if (Globals.IsActivated) - { - WiFiDirectManagerImpl.Instance.ActivatePushButton(); - } - - else - { - Log.Error(Globals.LogTag, "Wifi-direct is not activated"); - WiFiDirectErrorFactory.ThrowWiFiDirectException((int)WiFiDirectError.NotPermitted); - } - } - - /// - /// Gets the supported WPS types. - /// - /// The list of supported wps types. - /// - /// http://tizen.org/privilege/wifidirect - /// - /// - /// http://tizen.org/feature/network.wifidirect - /// - /// The object is in invalid state. - /// The required feature is not supported. - /// Thrown when application does not have privilege to access this method. - public static IEnumerable GetSupportedWpsTypes() - { - if (Globals.IsInitialize) - { - return WiFiDirectManagerImpl.Instance.GetSupportedWpsTypes(); - } - - else - { - return null; - } - } - - /// - /// Gets the persistent groups. - /// - /// List of the persistent group objects. - /// - /// http://tizen.org/privilege/wifidirect - /// - /// - /// http://tizen.org/feature/network.wifidirect - /// - /// The object is in invalid state. - /// The required feature is not supported. - /// Thrown when application does not have privilege to access this method. - public static IEnumerable GetPersistentGroups() - { - if (Globals.IsInitialize) - { - return WiFiDirectManagerImpl.Instance.GetPersistentGroups(); - } - - else - { - return null; - } - } - - /// - /// Removes a persistent group. - /// - /// Persistent group owner. - /// - /// http://tizen.org/privilege/wifidirect - /// - /// - /// http://tizen.org/feature/network.wifidirect - /// - /// The object is in invalid state. - /// The required feature is not supported. - /// Thrown when application does not have privilege to access this method. - public static void RemovePersistentGroup(WiFiDirectPersistentGroup group) - { - if (Globals.IsInitialize) - { - WiFiDirectManagerImpl.Instance.RemovePersistentGroup(group); - } - - else - { - Log.Error(Globals.LogTag, "Wifi-direct is not activated"); - WiFiDirectErrorFactory.ThrowWiFiDirectException((int)WiFiDirectError.NotInitialized); - } - } - - /// - /// Initializes or Deintializes the Wi-Fi Direct Display(MIRACAST) service. - /// - /// Enables/Disables service. - /// - /// http://tizen.org/privilege/wifidirect - /// - /// - /// http://tizen.org/feature/network.wifidirect - /// http://tizen.org/feature/network.wifi.direct.display - /// - /// - /// Wi-Fi Direct must be activated. - /// - /// - /// Thrown during one of the following cases : - /// 1. When the wifidirect is not supported - /// 2. When the wifidirect display feature is not supported - /// - /// The object is in invalid state. - /// Thrown when application does not have privilege to access this method. - public static void InitMiracast(bool enable) - { - if (Globals.IsActivated) - { - WiFiDirectManagerImpl.Instance.InitMiracast(enable); - } - - else - { - Log.Error(Globals.LogTag, "Wifi-direct is not activated"); - WiFiDirectErrorFactory.ThrowWiFiDirectException((int)WiFiDirectError.NotPermitted); - } - } - - /// - /// Enables Wi-Fi Display functionality. - /// - /// - /// http://tizen.org/privilege/wifidirect - /// - /// - /// http://tizen.org/feature/network.wifidirect - /// http://tizen.org/feature/network.wifi.direct.display - /// - /// - /// Wi-Fi Direct must be activated. - /// - /// - /// Thrown during one of the following cases : - /// 1. When the wifidirect is not supported - /// 2. When the wifidirect display feature is not supported - /// - /// The object is in invalid state. - /// Thrown when application does not have privilege to access this method. - public static void InitDisplay() - { - if (Globals.IsActivated) - { - WiFiDirectManagerImpl.Instance.InitDisplay(); - } - - else - { - Log.Error(Globals.LogTag, "Wifi-direct is not activated"); - WiFiDirectErrorFactory.ThrowWiFiDirectException((int)WiFiDirectError.NotPermitted); - } - } - - /// - /// Disable Wi-Fi Display(WFD) functionality and disable the support of WFD Information Element(IE). - /// - /// - /// http://tizen.org/privilege/wifidirect - /// - /// - /// http://tizen.org/feature/network.wifidirect - /// http://tizen.org/feature/network.wifi.direct.display - /// - /// - /// Wi-Fi Direct must be activated and WFD must be enabled. - /// - /// - /// Thrown during one of the following cases : - /// 1. When the wifidirect is not supported - /// 2. When the wifidirect display feature is not supported - /// - /// The object is in invalid state. - /// Thrown when application does not have privilege to access this method. - public static void DeinitDisplay() - { - if (Globals.IsActivated && Globals.s_isDisplay) - { - WiFiDirectManagerImpl.Instance.DeinitDisplay(); - } - - else - { - Log.Error(Globals.LogTag, "Wifi-direct is not activated and/or Wi-Fi display is not enabled"); - WiFiDirectErrorFactory.ThrowWiFiDirectException((int)WiFiDirectError.NotPermitted); - } - } - - /// - /// Sets the Wi-Fi Display parameters for the WFD IE of local device. - /// - /// WFD Device Type: define the Role of WFD device like source or sink. - /// Specifies Session Management Control Port number. It should be 2 bytes(0~65535). - /// CP support bit: (1 = enable the hdcp support, 0 = disable the hdcp support). - /// - /// http://tizen.org/privilege/wifidirect - /// - /// - /// http://tizen.org/feature/network.wifidirect - /// http://tizen.org/feature/network.wifi.direct.display - /// - /// - /// Wi-Fi Direct must be activated and WFD must be enabled. - /// - /// - /// Thrown during one of the following cases : - /// 1. When the wifidirect is not supported - /// 2. When the wifidirect display feature is not supported - /// - /// The object is in invalid state. - /// Thrown when application does not have privilege to access this method. - public static void SetDisplay(WiFiDirectDisplayType type, int port, int hdcp) - { - if (Globals.IsActivated && Globals.s_isDisplay) - { - WiFiDirectManagerImpl.Instance.SetDisplay(type, port, hdcp); - } - - else - { - Log.Error(Globals.LogTag, "Wifi-direct is not activated and/or Wi-Fi display is not enabled"); - WiFiDirectErrorFactory.ThrowWiFiDirectException((int)WiFiDirectError.NotPermitted); - } - } - - /// - /// Sets the Wi-Fi Display session availability. - /// - /// Wi-Fi Display session availability. - /// - /// http://tizen.org/privilege/wifidirect - /// - /// - /// http://tizen.org/feature/network.wifidirect - /// http://tizen.org/feature/network.wifi.direct.display - /// - /// - /// Wi-Fi Direct must be activated and WFD must be enabled. - /// - /// - /// Thrown during one of the following cases : - /// 1. When the wifidirect is not supported - /// 2. When the wifidirect display feature is not supported - /// - /// The object is in invalid state. - /// Thrown when application does not have privilege to access this method. - public static void SetDisplayAvailability(bool availability) - { - if (Globals.IsActivated && Globals.s_isDisplay) - { - WiFiDirectManagerImpl.Instance.SetDisplayAvailability(availability); - } - - else - { - Log.Error(Globals.LogTag, "Wifi-direct is not activated and/or Wi-Fi display is not enabled"); - WiFiDirectErrorFactory.ThrowWiFiDirectException((int)WiFiDirectError.NotPermitted); - } - } - - /// - /// Sets the automatic group removal feature when all peers are disconnected. - /// - /// Enables/Disables group removal feature. - /// - /// http://tizen.org/privilege/wifidirect - /// - /// - /// http://tizen.org/feature/network.wifidirect - /// - /// - /// Wi-Fi Direct must be activated. - /// ConnectionStatusChanged event will be invoked with GroupDestroyed when this feature is enabled and there's no connected group client and if device is group owner. - /// - /// The object is in invalid state. - /// The required feature is not supported. - /// Thrown when application does not have privilege to access this method. - public static void SetAutoGroupRemove(bool enable) - { - if (Globals.IsActivated) - { - WiFiDirectManagerImpl.Instance.SetAutoGroupRemove(enable); - } - - else - { - Log.Error(Globals.LogTag, "Wifi-direct is not activated"); - WiFiDirectErrorFactory.ThrowWiFiDirectException((int)WiFiDirectError.NotPermitted); - } - } - - /// - /// Registers the service. - /// - /// The service Id of service getting registered. - /// Type of Wi-Fi Direct Service. - /// Service specific information. - /// Service information. - /// - /// http://tizen.org/privilege/wifidirect - /// - /// - /// http://tizen.org/feature/network.wifidirect - /// http://tizen.org/feature/network.wifi.direct.service_discovery - /// - /// - /// Wi-Fi Direct must be activated. - /// If there is any error while registering service, 0 will be returned. - /// - /// - /// Thrown during one of the following cases : - /// 1. When the wifidirect is not supported - /// 2. When the wifidirect service discovery is not supported - /// - /// The object is in invalid state. - /// Thrown when application does not have privilege to access this method. - public static uint RegisterService(WiFiDirectServiceType type, string info, string serviceInfo) - { - if (Globals.IsActivated) - { - return WiFiDirectManagerImpl.Instance.RegisterService(type, info, serviceInfo); - } - - else - { - return 0; - } - } - - /// - /// Deregisters for a service used for WiFi Direct Service Discovery. - /// - /// Service ID for which service has to be deregistered. - /// - /// http://tizen.org/privilege/wifidirect - /// - /// - /// http://tizen.org/feature/network.wifidirect - /// http://tizen.org/feature/network.wifi.direct.service_discovery - /// - /// - /// Wi-Fi Direct must be activated. - /// - /// - /// Thrown during one of the following cases : - /// 1. When the wifidirect is not supported - /// 2. When the wifidirect service discovery is not supported - /// - /// The object is in invalid state. - /// Thrown when application does not have privilege to access this method. - public static void DeregisterService(uint serviceId) - { - if (Globals.IsActivated) - { - WiFiDirectManagerImpl.Instance.DeregisterService(serviceId); - } - - else - { - Log.Error(Globals.LogTag, "Wifi-direct is not activated"); - WiFiDirectErrorFactory.ThrowWiFiDirectException((int)WiFiDirectError.NotPermitted); - } - } - } -} diff --git a/src/Tizen.Network.WiFiDirect/Tizen.Network.WiFiDirect/WiFiDirectManagerImpl.cs b/src/Tizen.Network.WiFiDirect/Tizen.Network.WiFiDirect/WiFiDirectManagerImpl.cs deleted file mode 100644 index 252afa1da..000000000 --- a/src/Tizen.Network.WiFiDirect/Tizen.Network.WiFiDirect/WiFiDirectManagerImpl.cs +++ /dev/null @@ -1,1248 +0,0 @@ -/* - * 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.Collections.Generic; -using System.Runtime.InteropServices; -using System.Threading; - -namespace Tizen.Network.WiFiDirect -{ - internal class WiFiDirectThreadLocal - { - private int _threadId; - internal WiFiDirectThreadLocal(int id) - { - _threadId = id; - } - - public int ThreadId - { - get - { - return _threadId; - } - } - - ~WiFiDirectThreadLocal() - { - Log.Info(Globals.LogTag, "Deinitializing Wi-Fi direct"); - int ret = Interop.WiFiDirect.Deinitialize(); - if (ret != (int)WiFiDirectError.None) - { - Log.Error(Globals.LogTag, "Failed to deinitialize Wi-Fi direct, Error - " + (WiFiDirectError)ret); - WiFiDirectErrorFactory.ThrowWiFiDirectException(ret); - } - - else - { - Globals.s_isInitialize = false; - } - } - } - - internal static class Globals - { - internal const string LogTag = "Tizen.Network.WiFiDirect"; - internal static bool s_isInitialize = false; - internal static bool s_isDisplay = false; - private static ThreadLocal s_threadName = new ThreadLocal(() => - { - Log.Info(Globals.LogTag, "In threadlocal delegate"); - return new WiFiDirectThreadLocal(Thread.CurrentThread.ManagedThreadId); - }); - internal static bool IsActivated - { - get - { - WiFiDirectState _state = WiFiDirectManager.State; - if (IsInitialize) - { - if (_state == WiFiDirectState.Deactivated || _state == WiFiDirectState.Deactivating) - { - return false; - } - - else - { - return true; - } - } - - else - { - return false; - } - } - } - - private static bool IsUniqueThread() - { - if (s_threadName.IsValueCreated) - { - Log.Info(Globals.LogTag, "This thread is old"); - return false; - } - - else - { - WiFiDirectThreadLocal obj = s_threadName.Value; - Log.Info(Globals.LogTag, "This thread is new , Id = " + obj.ThreadId); - return true; - } - } - - internal static bool IsInitialize - { - get - { - if(Globals.IsUniqueThread() || !Globals.s_isInitialize) - { - WiFiDirectManagerImpl.Instance.Initialize(); - } - - return (Globals.s_isInitialize); - } - } - } - - /// - /// The implementation of Wi-Fi Direct APIs. - /// - internal partial class WiFiDirectManagerImpl : IDisposable - { - private event EventHandler _stateChanged; - private event EventHandler _discoveryStateChanged; - private event EventHandler _peerFound; - private event EventHandler _deviceStateChanged; - private event EventHandler _connectionStatusChanged; - - private Interop.WiFiDirect.StateChangedCallback _stateChangedCallback; - private Interop.WiFiDirect.DiscoveryStateChangedCallback _discoveryStateChangedCallback; - private Interop.WiFiDirect.PeerFoundCallback _peerFoundCallback; - private Interop.WiFiDirect.DeviceStateChangedCallback _deviceStateChangedCallback; - private Interop.WiFiDirect.ConnectionStateChangedCallback _connectionChangedCallback; - - internal event EventHandler StateChanged - { - add - { - if (_stateChanged == null) - { - RegisterStateChangedEvent(); - } - - _stateChanged += value; - } - - remove - { - _stateChanged -= value; - if (_stateChanged == null) - { - UnregisterStateChangedEvent(); - } - } - } - - internal event EventHandler DiscoveryStateChanged - { - add - { - if (_discoveryStateChanged == null) - { - RegisterDiscoveryStateChangedEvent(); - } - - _discoveryStateChanged += value; - } - - remove - { - _discoveryStateChanged -= value; - if (_discoveryStateChanged == null) - { - UnregisterDiscoveryStateChangedEvent(); - } - } - } - - internal event EventHandler PeerFound - { - add - { - if (_peerFound == null) - { - RegisterPeerFoundEvent(); - } - - _peerFound += value; - } - - remove - { - _peerFound -= value; - if (_peerFound == null) - { - UnregisterPeerFoundEvent(); - } - } - } - - internal event EventHandler DeviceStateChanged - { - add - { - if (_deviceStateChanged == null) - { - RegisterDeviceStateChangedEvent(); - } - - _deviceStateChanged += value; - } - - remove - { - _deviceStateChanged -= value; - if (_deviceStateChanged == null) - { - UnregisterDeviceStateChangedEvent(); - } - } - } - - internal event EventHandler ConnectionStatusChanged - { - add - { - if (_connectionStatusChanged == null) - { - RegisterConnectionStatusChangedEvent(); - } - - _connectionStatusChanged += value; - } - - remove - { - _connectionStatusChanged -= value; - if (_connectionStatusChanged == null) - { - UnregisterConnectionStatusChangedEvent(); - } - } - } - - private bool _disposed = false; - private static WiFiDirectManagerImpl _instance; - - private void RegisterStateChangedEvent() - { - _stateChangedCallback = (WiFiDirectState stateInfo, IntPtr userData) => - { - if (_stateChanged != null) - { - WiFiDirectState state = stateInfo; - _stateChanged(null, new StateChangedEventArgs(state)); - } - }; - int ret = Interop.WiFiDirect.SetStateChangedCallback(_stateChangedCallback, IntPtr.Zero); - if (ret != (int)WiFiDirectError.None) - { - Log.Error(Globals.LogTag, "Failed to set Wi-Fi Direct state changed callback, Error - " + (WiFiDirectError)ret); - } - } - - private void UnregisterStateChangedEvent() - { - int ret = Interop.WiFiDirect.UnsetStateChangedCallback(); - if (ret != (int)WiFiDirectError.None) - { - Log.Error(Globals.LogTag, "Failed to unset Wi-Fi Direct state changed callback, Error - " + (WiFiDirectError)ret); - } - } - - private void RegisterDiscoveryStateChangedEvent() - { - _discoveryStateChangedCallback = (int result, WiFiDirectDiscoveryState stateInfo, IntPtr userData) => - { - if (_discoveryStateChanged != null) - { - WiFiDirectError error = (WiFiDirectError)result; - WiFiDirectDiscoveryState state = stateInfo; - _discoveryStateChanged(null, new DiscoveryStateChangedEventArgs(error, state)); - } - }; - int ret = Interop.WiFiDirect.SetDiscoveryStateChangedCallback(_discoveryStateChangedCallback, IntPtr.Zero); - if (ret != (int)WiFiDirectError.None) - { - Log.Error(Globals.LogTag, "Failed to set Wi-Fi Direct discovery state changed callback, Error - " + (WiFiDirectError)ret); - } - } - - private void UnregisterDiscoveryStateChangedEvent() - { - int ret = Interop.WiFiDirect.UnsetDiscoveryStateChangedCallback(); - if (ret != (int)WiFiDirectError.None) - { - Log.Error(Globals.LogTag, "Failed to unset Wi-Fi Direct discovery state changed callback, Error - " + (WiFiDirectError)ret); - } - } - - private void RegisterPeerFoundEvent() - { - _peerFoundCallback = (int result, WiFiDirectDiscoveryState stateInfo, string address, IntPtr userData) => - { - if (_peerFound != null && stateInfo == WiFiDirectDiscoveryState.Found) - { - WiFiDirectError error = (WiFiDirectError)result; - WiFiDirectDiscoveryState state = stateInfo; - IntPtr peer; - Interop.WiFiDirect.GetDiscoveredPeerInfo(address, out peer); - DiscoveredPeerStruct peerStruct = (DiscoveredPeerStruct)Marshal.PtrToStructure(peer, typeof(DiscoveredPeerStruct)); - _peerFound(null, new PeerFoundEventArgs(error, state, WiFiDirectUtils.ConvertStructToDiscoveredPeer(peerStruct))); - } - }; - int ret = Interop.WiFiDirect.SetPeerFoundCallback(_peerFoundCallback, IntPtr.Zero); - if (ret != (int)WiFiDirectError.None) - { - Log.Error(Globals.LogTag, "Failed to set Wi-Fi Direct discovery state changed callback, Error - " + (WiFiDirectError)ret); - } - } - - private void UnregisterPeerFoundEvent() - { - int ret = Interop.WiFiDirect.UnsetPeerFoundCallback(); - if (ret != (int)WiFiDirectError.None) - { - Log.Error(Globals.LogTag, "Failed to unset Wi-Fi Direct discovery state changed callback, Error - " + (WiFiDirectError)ret); - } - } - - private void RegisterDeviceStateChangedEvent() - { - _deviceStateChangedCallback = (int result, WiFiDirectDeviceState stateInfo, IntPtr userData) => - { - if (_deviceStateChanged != null) - { - WiFiDirectError error = (WiFiDirectError)result; - WiFiDirectDeviceState state = stateInfo; - _deviceStateChanged(null, new DeviceStateChangedEventArgs(error, state)); - } - }; - int ret = Interop.WiFiDirect.SetDeviceStateChangedCallback(_deviceStateChangedCallback, IntPtr.Zero); - if (ret != (int)WiFiDirectError.None) - { - Log.Error(Globals.LogTag, "Failed to set device state changed callback, Error - " + (WiFiDirectError)ret); - } - } - - private void UnregisterDeviceStateChangedEvent() - { - int ret = Interop.WiFiDirect.UnsetDeviceStateChangedCallback(); - if (ret != (int)WiFiDirectError.None) - { - Log.Error(Globals.LogTag, "Failed to unset device state changed callback, Error - " + (WiFiDirectError)ret); - } - } - - private void RegisterConnectionStatusChangedEvent() - { - _connectionChangedCallback = (int result, WiFiDirectConnectionState stateInfo, string address, IntPtr userData) => - { - if (_connectionStatusChanged != null) - { - WiFiDirectError error = (WiFiDirectError)result; - WiFiDirectConnectionState state = stateInfo; - - _connectionStatusChanged(null, new ConnectionStatusChangedEventArgs(error, state)); - } - }; - int ret = Interop.WiFiDirect.SetConnectionChangedCallback(_connectionChangedCallback, IntPtr.Zero); - if (ret != (int)WiFiDirectError.None) - { - Log.Error(Globals.LogTag, "Failed to set connection status changed callback, Error - " + (WiFiDirectError)ret); - } - } - - private void UnregisterConnectionStatusChangedEvent() - { - int ret = Interop.WiFiDirect.UnsetConnectionChangedCallback(); - if (ret != (int)WiFiDirectError.None) - { - Log.Error(Globals.LogTag, "Failed to unset connection status changed callback, Error - " + (WiFiDirectError)ret); - } - } - - internal bool IsInitialize - { - get - { - return Globals.IsInitialize; - } - } - internal bool IsGroupOwner - { - get - { - bool isGroupOwner; - int ret = Interop.WiFiDirect.IsGroupOwner(out isGroupOwner); - if (ret != (int)WiFiDirectError.None) - { - Log.Error(Globals.LogTag, "Failed to get whether this device is the group owner or not, Error - " + (WiFiDirectError)ret); - } - - return isGroupOwner; - } - } - - internal bool IsAutonomousGroup - { - get - { - bool isAutonomousGroup; - int ret = Interop.WiFiDirect.IsAutonomousGroup(out isAutonomousGroup); - if (ret != (int)WiFiDirectError.None) - { - Log.Error(Globals.LogTag, "Failed to check whether the current group is autonomous or not, Error - " + (WiFiDirectError)ret); - } - - return isAutonomousGroup; - } - } - - internal string Ssid - { - get - { - string ssid; - int ret = Interop.WiFiDirect.GetSsid(out ssid); - if (ret != (int)WiFiDirectError.None) - { - Log.Error(Globals.LogTag, "Failed to get SSID of local device, Error - " + (WiFiDirectError)ret); - return null; - } - - return ssid; - } - } - - internal string NetworkInterface - { - get - { - string networkInterface; - int ret = Interop.WiFiDirect.GetInterfaceName(out networkInterface); - if (ret != (int)WiFiDirectError.None) - { - Log.Error(Globals.LogTag, "Failed to get name of network interface, Error - " + (WiFiDirectError)ret); - return ""; - } - - return networkInterface; - } - } - - internal string IpAddress - { - get - { - string ipAddress; - int ret = Interop.WiFiDirect.GetIpAddress(out ipAddress); - if (ret != (int)WiFiDirectError.None) - { - Log.Error(Globals.LogTag, "Failed to get IP address of local device, Error - " + (WiFiDirectError)ret); - return ""; - } - - return ipAddress; - } - } - - internal string SubnetMask - { - get - { - string subnetMask; - int ret = Interop.WiFiDirect.GetSubnetMask(out subnetMask); - if (ret != (int)WiFiDirectError.None) - { - Log.Error(Globals.LogTag, "Failed to get subnet mask, Error - " + (WiFiDirectError)ret); - return ""; - } - - return subnetMask; - } - } - - internal string GatewayAddress - { - get - { - string gatewayAddress; - int ret = Interop.WiFiDirect.GetGatewayAddress(out gatewayAddress); - if (ret != (int)WiFiDirectError.None) - { - Log.Error(Globals.LogTag, "Failed to get gateway address, Error - " + (WiFiDirectError)ret); - return ""; - } - - return gatewayAddress; - } - } - - internal string MacAddress - { - get - { - string macAddress; - int ret = Interop.WiFiDirect.GetMacAddress(out macAddress); - if (ret != (int)WiFiDirectError.None) - { - Log.Error(Globals.LogTag, "Failed to get mac address, Error - " + (WiFiDirectError)ret); - return null; - } - - return macAddress; - } - } - - internal WiFiDirectState State - { - get - { - WiFiDirectState state; - int ret = Interop.WiFiDirect.GetState(out state); - if (ret != (int)WiFiDirectError.None) - { - Log.Error(Globals.LogTag, "Failed to get state of Wi-Fi direct service, Error - " + (WiFiDirectError)ret); - } - - return state; - } - } - - internal bool IsDiscoverable - { - get - { - bool isDiscoverable; - int ret = Interop.WiFiDirect.IsDiscoverable(out isDiscoverable); - if (ret != (int)WiFiDirectError.None) - { - Log.Error(Globals.LogTag, "Failed to check whether the device is discoverable, Error - " + (WiFiDirectError)ret); - } - - return isDiscoverable; - } - } - - internal bool IsListenOnly - { - get - { - bool isListenOnly; - int ret = Interop.WiFiDirect.IsListeningOnly(out isListenOnly); - if (ret != (int)WiFiDirectError.None) - { - Log.Error(Globals.LogTag, "Failed to check whether the local device is listening only, Error - " + (WiFiDirectError)ret); - } - - return isListenOnly; - } - } - - internal WiFiDirectPrimaryDeviceType PrimaryType - { - get - { - WiFiDirectPrimaryDeviceType primaryType; - int ret = Interop.WiFiDirect.GetPrimaryType(out primaryType); - if (ret != (int)WiFiDirectError.None) - { - Log.Error(Globals.LogTag, "Failed to get the primary device type of local device, Error - " + (WiFiDirectError)ret); - } - - return primaryType; - } - } - - internal WiFiDirectSecondaryDeviceType SecondaryType - { - get - { - WiFiDirectSecondaryDeviceType secondaryType; - int ret = Interop.WiFiDirect.GetSecondaryType(out secondaryType); - if (ret != (int)WiFiDirectError.None) - { - Log.Error(Globals.LogTag, "Failed to get the secondary device type of local device, Error - " + (WiFiDirectError)ret); - } - - return secondaryType; - } - } - - internal int WpsMode - { - get - { - int mode; - int ret = Interop.WiFiDirect.GetWpsMode(out mode); - if (ret != (int)WiFiDirectError.None) - { - Log.Error(Globals.LogTag, "Failed to get supproted wps modes at local device, Error - " + (WiFiDirectError)ret); - return -1; - } - - return mode; - } - } - - internal WiFiDirectWpsType WpsType - { - get - { - WiFiDirectWpsType wpsType; - int ret = Interop.WiFiDirect.GetLocalWpsType(out wpsType); - if (ret != (int)WiFiDirectError.None) - { - Log.Error(Globals.LogTag, "Failed to get the WPS type, Error - " + (WiFiDirectError)ret); - } - - return wpsType; - } - } - - internal int OperatingChannel - { - get - { - int channel; - int ret = Interop.WiFiDirect.GetChannel(out channel); - if (ret != (int)WiFiDirectError.None) - { - Log.Error(Globals.LogTag, "Failed to get operating channel, Error - " + (WiFiDirectError)ret); - return -1; - } - - return channel; - } - } - - internal bool PersistentGroupEnabled - { - get - { - bool isEnabled; - int ret = Interop.WiFiDirect.GetPersistentGroupState(out isEnabled); - if (ret != (int)WiFiDirectError.None) - { - Log.Error(Globals.LogTag, "Failed to check persistent group state, Error - " + (WiFiDirectError)ret); - } - - return isEnabled; - } - - set - { - int ret = Interop.WiFiDirect.SetPersistentGroupState(value); - if (ret != (int)WiFiDirectError.None) - { - Log.Error(Globals.LogTag, "Failed to set the persistent group state, Error - " + (WiFiDirectError)ret); - WiFiDirectErrorFactory.ThrowWiFiDirectException(ret); - } - } - } - - internal bool AutoConnect - { - get - { - bool isAutoConnect; - int ret = Interop.WiFiDirect.GetAutoConnectionMode(out isAutoConnect); - if (ret != (int)WiFiDirectError.None) - { - Log.Error(Globals.LogTag, "Failed to get autoconnection mode status, Error - " + (WiFiDirectError)ret); - } - - return isAutoConnect; - } - - set - { - int ret = Interop.WiFiDirect.SetAutoConnectionMode(value); - if (ret != (int)WiFiDirectError.None) - { - Log.Error(Globals.LogTag, "Failed to set the autoconnection mode, Error - " + (WiFiDirectError)ret); - WiFiDirectErrorFactory.ThrowWiFiDirectException(ret); - } - } - } - - internal string WpsPin - { - get - { - string pin; - int ret = Interop.WiFiDirect.GetWpsPin(out pin); - if (ret != (int)WiFiDirectError.None) - { - Log.Error(Globals.LogTag, "Failed to get WPS pin, Error - " + (WiFiDirectError)ret); - } - - return pin; - } - - set - { - int ret = Interop.WiFiDirect.SetWpsPin(value.ToString()); - if (ret != (int)WiFiDirectError.None) - { - Log.Error(Globals.LogTag, "Failed to set or update WPS pin, Error - " + (WiFiDirectError)ret); - WiFiDirectErrorFactory.ThrowWiFiDirectException(ret); - } - } - } - - internal string Name - { - get - { - string name; - int ret = Interop.WiFiDirect.GetName(out name); - if (ret != (int)WiFiDirectError.None) - { - Log.Error(Globals.LogTag, "Failed to get name of local device, Error - " + (WiFiDirectError)ret); - return null; - } - - return name; - } - - set - { - int ret = Interop.WiFiDirect.SetName(value.ToString()); - if (ret != (int)WiFiDirectError.None) - { - Log.Error(Globals.LogTag, "Failed to set name of local device, Error - " + (WiFiDirectError)ret); - WiFiDirectErrorFactory.ThrowWiFiDirectException(ret); - } - } - } - - internal WiFiDirectWpsType RequestedWps - { - get - { - WiFiDirectWpsType wpsType; - int ret = Interop.WiFiDirect.GetReqWpsType(out wpsType); - if (ret != (int)WiFiDirectError.None) - { - Log.Error(Globals.LogTag, "Failed to get the requested WPS type, Error - " + (WiFiDirectError)ret); - } - - return wpsType; - } - - set - { - int ret = Interop.WiFiDirect.SetReqWpsType(value); - if (ret != (int)WiFiDirectError.None) - { - Log.Error(Globals.LogTag, "Failed to set the requested WPS type, Error - " + (WiFiDirectError)ret); - WiFiDirectErrorFactory.ThrowWiFiDirectException(ret); - } - } - } - - internal int GroupOwnerIntent - { - get - { - int intent; - int ret = Interop.WiFiDirect.GetIntent(out intent); - if (ret != (int)WiFiDirectError.None) - { - Log.Error(Globals.LogTag, "Failed to get the intent of the group owner, Error - " + (WiFiDirectError)ret); - } - - return intent; - } - - set - { - int ret = Interop.WiFiDirect.SetIntent(value); - if (ret != (int)WiFiDirectError.None) - { - Log.Error(Globals.LogTag, "Failed to set the intent of the group owner, Error - " + (WiFiDirectError)ret); - WiFiDirectErrorFactory.ThrowWiFiDirectException(ret); - } - } - } - - internal int MaxClients - { - get - { - int maxClients; - int ret = Interop.WiFiDirect.GetMaxClients(out maxClients); - if (ret != (int)WiFiDirectError.None) - { - Log.Error(Globals.LogTag, "Failed to get the max number of clients, Error - " + (WiFiDirectError)ret); - } - - return maxClients; - } - - set - { - int ret = Interop.WiFiDirect.SetMaxClients(value); - if (ret != (int)WiFiDirectError.None) - { - Log.Error(Globals.LogTag, "Failed to set the max number of clients, Error - " + (WiFiDirectError)ret); - WiFiDirectErrorFactory.ThrowWiFiDirectException(ret); - } - } - } - - internal string Passphrase - { - get - { - string passphrase; - int ret = Interop.WiFiDirect.GetPassPhrase(out passphrase); - if (ret != (int)WiFiDirectError.None) - { - Log.Error(Globals.LogTag, "Failed to get Wi-Fi Protected Access password, Error - " + (WiFiDirectError)ret); - return ""; - } - - return passphrase; - } - - set - { - int ret = Interop.WiFiDirect.SetPassPhrase(value.ToString()); - if (ret != (int)WiFiDirectError.None) - { - Log.Error(Globals.LogTag, "Failed to set or update Wi-Fi Protected Access password, Error - " + (WiFiDirectError)ret); - WiFiDirectErrorFactory.ThrowWiFiDirectException(ret); - } - } - } - - internal int SessionTimer - { - get - { - int sessionTimer; - int ret = Interop.WiFiDirect.GetSessionTimer(out sessionTimer); - if (ret != (int)WiFiDirectError.None) - { - Log.Error(Globals.LogTag, "Failed to get the timer used to expire the connection session, Error - " + (WiFiDirectError)ret); - } - - return sessionTimer; - } - - set - { - int ret = Interop.WiFiDirect.SetSessionTimer(value); - if (ret != (int)WiFiDirectError.None) - { - Log.Error(Globals.LogTag, "Failed to set the timer used to expire the connection session, Error - " + (WiFiDirectError)ret); - WiFiDirectErrorFactory.ThrowWiFiDirectException(ret); - } - } - } - - internal void Activate() - { - int ret = Interop.WiFiDirect.Activate(); - if (ret != (int)WiFiDirectError.None) - { - Log.Error(Globals.LogTag, "Failed to activate Wi-Fi direct service, Error - " + (WiFiDirectError)ret); - WiFiDirectErrorFactory.ThrowWiFiDirectException(ret); - } - } - - internal void Deactivate() - { - int ret = Interop.WiFiDirect.Deactivate(); - if (ret != (int)WiFiDirectError.None) - { - Log.Error(Globals.LogTag, "Failed to deactivate Wi-Fi direct service, Error - " + (WiFiDirectError)ret); - WiFiDirectErrorFactory.ThrowWiFiDirectException(ret); - } - } - - internal void StartDiscovery(bool listenOnly, int duration, WiFiDirectDiscoveryChannel channel = WiFiDirectDiscoveryChannel.FullScan) - { - int ret = Interop.WiFiDirect.StartDiscoveryInChannel(listenOnly, duration, channel); - if (ret != (int)WiFiDirectError.None) - { - Log.Error(Globals.LogTag, "Failed to start discovery, Error - " + (WiFiDirectError)ret); - WiFiDirectErrorFactory.ThrowWiFiDirectException(ret); - } - } - - internal void CancelDiscovery() - { - int ret = Interop.WiFiDirect.StopDiscovery(); - if (ret != (int)WiFiDirectError.None) - { - Log.Error(Globals.LogTag, "Failed to cancel discovery, Error - " + (WiFiDirectError)ret); - WiFiDirectErrorFactory.ThrowWiFiDirectException(ret); - } - } - - internal IEnumerable GetDiscoveredPeers() - { - List discoveredPeerList = new List(); - Interop.WiFiDirect.DiscoveredPeerCallback callback = (ref DiscoveredPeerStruct peer, IntPtr userData) => - { - if (!peer.Equals(null)) - { - discoveredPeerList.Add(WiFiDirectUtils.ConvertStructToDiscoveredPeer(peer)); - } - - return true; - }; - int ret = Interop.WiFiDirect.GetDiscoveredPeers(callback, IntPtr.Zero); - if (ret != (int)WiFiDirectError.None) - { - Log.Error(Globals.LogTag, "Failed to get information of discovered peers, Error - " + (WiFiDirectError)ret); - WiFiDirectErrorFactory.ThrowWiFiDirectException(ret); - } - - return discoveredPeerList; - } - - internal IEnumerable GetConnectedPeers() - { - List connectedPeerList = new List(); - Interop.WiFiDirect.ConnectedPeerCallback callback = (ref ConnectedPeerStruct peer, IntPtr userData) => - { - if (!peer.Equals(null)) - { - connectedPeerList.Add(WiFiDirectUtils.ConvertStructToConnectedPeer(peer)); - } - - return true; - }; - int ret = Interop.WiFiDirect.GetConnectedPeers(callback, IntPtr.Zero); - if (ret != (int)WiFiDirectError.None) - { - Log.Error(Globals.LogTag, "Failed to get information of connected peers, Error - " + (WiFiDirectError)ret); - WiFiDirectErrorFactory.ThrowWiFiDirectException(ret); - } - - return connectedPeerList; - } - - internal void DisconnectAll() - { - int ret = Interop.WiFiDirect.DisconnectAll(); - if (ret != (int)WiFiDirectError.None) - { - Log.Error(Globals.LogTag, "Failed to disconnect all connected links, Error - " + (WiFiDirectError)ret); - WiFiDirectErrorFactory.ThrowWiFiDirectException(ret); - } - } - - internal void CreateGroup() - { - int ret = Interop.WiFiDirect.CreateGroup(); - if (ret != (int)WiFiDirectError.None) - { - Log.Error(Globals.LogTag, "Failed to create a WiFi-Direct group, Error - " + (WiFiDirectError)ret); - WiFiDirectErrorFactory.ThrowWiFiDirectException(ret); - } - } - - internal void DestroyGroup() - { - int ret = Interop.WiFiDirect.DestroyGroup(); - if (ret != (int)WiFiDirectError.None) - { - Log.Error(Globals.LogTag, "Failed to destroy the WiFi-Direct group, Error - " + (WiFiDirectError)ret); - WiFiDirectErrorFactory.ThrowWiFiDirectException(ret); - } - } - - internal void ActivatePushButton() - { - int ret = Interop.WiFiDirect.ActivatePushButton(); - if (ret != (int)WiFiDirectError.None) - { - Log.Error(Globals.LogTag, "Failed to set the Wps config PBC, Error - " + (WiFiDirectError)ret); - WiFiDirectErrorFactory.ThrowWiFiDirectException(ret); - } - } - - internal IEnumerable GetSupportedWpsTypes() - { - List wpsList = new List(); - Interop.WiFiDirect.WpsTypeCallback callback = (WiFiDirectWpsType type, IntPtr userData) => - { - if (!type.Equals(null)) - { - wpsList.Add(type); - } - - return true; - }; - int ret = Interop.WiFiDirect.GetWpsTypes(callback, IntPtr.Zero); - if (ret != (int)WiFiDirectError.None) - { - Log.Error(Globals.LogTag, "Failed to get the supported WPS types, Error - " + (WiFiDirectError)ret); - WiFiDirectErrorFactory.ThrowWiFiDirectException(ret); - } - - return wpsList; - } - - internal IEnumerable GetPersistentGroups() - { - List persistentGroupList = new List(); - Interop.WiFiDirect.PersistentGroupCallback callback = (string address, string ssid, IntPtr userData) => - { - if (address != null && ssid != null) - { - persistentGroupList.Add(new WiFiDirectPersistentGroup(address, ssid)); - } - - return true; - }; - int ret = Interop.WiFiDirect.GetPersistentGroups(callback, IntPtr.Zero); - if (ret != (int)WiFiDirectError.None) - { - Log.Error(Globals.LogTag, "Failed to get the persistent groups, Error - " + (WiFiDirectError)ret); - WiFiDirectErrorFactory.ThrowWiFiDirectException(ret); - } - - return persistentGroupList; - } - - internal void RemovePersistentGroup(WiFiDirectPersistentGroup group) - { - int ret = Interop.WiFiDirect.RemovePersistentGroup(group.MacAddress, group.Ssid); - if (ret != (int)WiFiDirectError.None) - { - Log.Error(Globals.LogTag, "Failed to remove a persistent group, Error - " + (WiFiDirectError)ret); - WiFiDirectErrorFactory.ThrowWiFiDirectException(ret); - } - } - - internal void InitMiracast(bool enable) - { - int ret = Interop.WiFiDirect.InitMiracast(enable); - if (ret != (int)WiFiDirectError.None) - { - Log.Error(Globals.LogTag, "Failed to set the WiFi-Direct Display(MIRACAST) service, Error - " + (WiFiDirectError)ret); - WiFiDirectErrorFactory.ThrowWiFiDirectException(ret); - } - } - - internal void InitDisplay() - { - int ret = Interop.WiFiDirect.InitDisplay(); - if (ret != (int)WiFiDirectError.None) - { - Log.Error(Globals.LogTag, "Failed to enable Wi-Fi Display functionality, Error - " + (WiFiDirectError)ret); - WiFiDirectErrorFactory.ThrowWiFiDirectException(ret); - } - - else - { - Globals.s_isDisplay = true; - } - } - - internal void DeinitDisplay() - { - int ret = Interop.WiFiDirect.DeinitDisplay(); - if (ret != (int)WiFiDirectError.None) - { - Log.Error(Globals.LogTag, "Failed to disable Wi-Fi Display functionality, Error - " + (WiFiDirectError)ret); - WiFiDirectErrorFactory.ThrowWiFiDirectException(ret); - } - - else - { - Globals.s_isDisplay = false; - } - } - - internal void SetDisplay(WiFiDirectDisplayType type, int port, int hdcp) - { - int ret = Interop.WiFiDirect.SetDisplay(type, port, hdcp); - if (ret != (int)WiFiDirectError.None) - { - Log.Error(Globals.LogTag, "Failed to set the Wi-Fi Display parameters, Error - " + (WiFiDirectError)ret); - WiFiDirectErrorFactory.ThrowWiFiDirectException(ret); - } - } - - internal void SetDisplayAvailability(bool availability) - { - int ret = Interop.WiFiDirect.SetDisplayAvailability(availability); - if (ret != (int)WiFiDirectError.None) - { - Log.Error(Globals.LogTag, "Failed to set the Wi-Fi Display session availability, Error - " + (WiFiDirectError)ret); - WiFiDirectErrorFactory.ThrowWiFiDirectException(ret); - } - } - - internal void SetAutoGroupRemove(bool enable) - { - int ret = Interop.WiFiDirect.SetAutoGroupRemoval(enable); - if (ret != (int)WiFiDirectError.None) - { - Log.Error(Globals.LogTag, "Failed to set automatic group removal feature when all peers are disconnected, Error - " + (WiFiDirectError)ret); - WiFiDirectErrorFactory.ThrowWiFiDirectException(ret); - } - } - - internal uint RegisterService(WiFiDirectServiceType type, string info, string serviceInfo) - { - uint serviceId; - int ret = Interop.WiFiDirect.RegisterService(type, info, serviceInfo, out serviceId); - if (ret != (int)WiFiDirectError.None) - { - Log.Error(Globals.LogTag, "Failed to register for service, Error - " + (WiFiDirectError)ret); - WiFiDirectErrorFactory.ThrowWiFiDirectException(ret); - } - - return serviceId; - } - - internal void DeregisterService(uint serviceId) - { - int ret = Interop.WiFiDirect.DeregisterService(serviceId); - if (ret != (int)WiFiDirectError.None) - { - Log.Error(Globals.LogTag, "Failed to deregister service, Error - " + (WiFiDirectError)ret); - WiFiDirectErrorFactory.ThrowWiFiDirectException(ret); - } - } - - internal static WiFiDirectManagerImpl Instance - { - get - { - if (_instance == null) - { - _instance = new WiFiDirectManagerImpl(); - } - - return _instance; - } - } - - private WiFiDirectManagerImpl() - { - } - - internal void Initialize() - { - int ret = Interop.WiFiDirect.Initialize(); - if (ret != (int)WiFiDirectError.None) - { - Log.Error(Globals.LogTag, "Failed to initialize Wi-Fi direct, Error - " + (WiFiDirectError)ret); - WiFiDirectErrorFactory.ThrowWiFiDirectException(ret); - } - - else - { - Globals.s_isInitialize = true; - } - } - - ~WiFiDirectManagerImpl() - { - Dispose(false); - } - - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - - private void Dispose(bool disposing) - { - if (_disposed) - { - return; - } - - if (disposing) - { - // Free managed objects. - } - - //Free unmanaged objects - RemoveAllRegisteredEvent(); - Deinitialize(); - _disposed = true; - } - - private void Deinitialize() - { - int ret = Interop.WiFiDirect.Deinitialize(); - if (ret != (int)WiFiDirectError.None) - { - Log.Error(Globals.LogTag, "Failed to deinitialize Wi-Fi direct, Error - " + (WiFiDirectError)ret); - WiFiDirectErrorFactory.ThrowWiFiDirectException(ret); - } - - else - { - Globals.s_isInitialize = false; - } - } - - private void RemoveAllRegisteredEvent() - { - //unregister all remaining events when this object is released. - if (_stateChanged != null) - { - UnregisterStateChangedEvent(); - } - - if (_discoveryStateChanged != null) - { - UnregisterDiscoveryStateChangedEvent(); - } - - if (_peerFound != null) - { - UnregisterPeerFoundEvent(); - } - - if (_deviceStateChanged != null) - { - UnregisterDeviceStateChangedEvent(); - } - - if (_connectionStatusChanged != null) - { - UnregisterConnectionStatusChangedEvent(); - } - } - } -} diff --git a/src/Tizen.Network.WiFiDirect/Tizen.Network.WiFiDirect/WiFiDirectPeer.cs b/src/Tizen.Network.WiFiDirect/Tizen.Network.WiFiDirect/WiFiDirectPeer.cs deleted file mode 100644 index 12afe951a..000000000 --- a/src/Tizen.Network.WiFiDirect/Tizen.Network.WiFiDirect/WiFiDirectPeer.cs +++ /dev/null @@ -1,754 +0,0 @@ -/* - * 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.Collections.Generic; -using System.Runtime.InteropServices; -using System.Collections.Concurrent; -using System.Collections.ObjectModel; -using System.Collections.Specialized; - -namespace Tizen.Network.WiFiDirect -{ - /// - /// The WiFiDirectPeer class is used to handle the connection with remote devices using Wi-Fi Direct. - /// - /// http://tizen.org/privilege/wifidirect - public class WiFiDirectPeer - { - private event EventHandler _connectionStateChanged; - private event EventHandler _ipAddressAssigned; - private event EventHandler _serviceStateChanged; - - private Interop.WiFiDirect.ConnectionStateChangedCallback _connectionStateChangedCallback; - private Interop.WiFiDirect.ClientIpAddressAssignedCallback _ipAddressAssignedCallback; - private Interop.WiFiDirect.ServiceStateChangedCallback _serviceStateChangedCallback; - - internal string _peerDeviceName; - internal string _peerIpAddress; - internal string _peerMacAddress; - internal string _peerInterfaceAddress; - internal int _peerChannel; - internal bool _isPeerConnected; - internal bool _isPeerGroupOwner; - internal bool _peerP2PSupport; - internal WiFiDirectPrimaryDeviceType _peerPrimaryType; - internal WiFiDirectSecondaryDeviceType _peerSecondaryType; - internal int _peerWpsTypes; - internal bool _p2PInvitationSupported; - internal uint _peerServiceCount; - internal IEnumerable _peerServiceList; - internal bool _isPeerMiracastDevice; - - internal WiFiDirectPeer() - { - } - - /// - /// The name of the peer device. - /// - public string Name - { - get - { - return _peerDeviceName; - } - } - - /// - /// The IP address of the peer device. - /// - public string IpAddress - { - get - { - return _peerIpAddress; - } - } - - /// - /// The MAC address of the peer device. - /// - public string MacAddress - { - get - { - return _peerMacAddress; - } - } - - /// - /// The Interface address of the peer device. - /// - public string InterfaceAddress - { - get - { - return _peerInterfaceAddress; - } - } - - /// - /// The listening channel of the peer device. - /// - public int Channel - { - get - { - return _peerChannel; - } - } - - /// - /// The connected state of the peer device. - /// - public bool IsConnected - { - get - { - return _isPeerConnected; - } - } - - /// - /// The P2P group state of the peer device. - /// - public bool IsGroupOwner - { - get - { - return _isPeerGroupOwner; - } - } - - /// - /// The P2P state of the peer device. - /// - public bool P2PSupport - { - get - { - return _peerP2PSupport; - } - } - - /// - /// The primary catagory of the peer device. - /// - public WiFiDirectPrimaryDeviceType PrimaryType - { - get - { - return _peerPrimaryType; - } - } - - /// - /// The sub category of the peer device. - /// - public WiFiDirectSecondaryDeviceType SecondaryType - { - get - { - return _peerSecondaryType; - } - } - - /// - /// The list of the supported WPS type of the peer device. - /// - public int WpsTypes - { - get - { - return _peerWpsTypes; - } - } - - /// - /// The P2P invitation state of the peer device. - /// - public bool IsP2PInvitationSupported - { - get - { - return _p2PInvitationSupported; - } - } - - /// - /// The number of registered services of the peer device. - /// - public uint ServiceCount - { - get - { - return _peerServiceCount; - } - } - - /// - /// The list of registered services of the peer device. - /// - public IEnumerable ServiceList - { - get - { - return _peerServiceList; - } - } - - /// - /// Checks if the peer device is a Wi-Fi display device. - /// - public bool IsMiracastDevice - { - get - { - return _isPeerMiracastDevice; - } - } - - /// - /// The Wi-Fi display device type of the peer device. - /// - /// - /// Wi-Fi Direct must be activated. - /// If there is any error, a default value of WiFiDirectDisplayType will be returned. - /// - public WiFiDirectDisplayType Display - { - get - { - if (Globals.IsActivated) - { - WiFiDirectDisplayType displayType; - int ret = Interop.WiFiDirect.GetDisplayType(_peerMacAddress, out displayType); - if (ret != (int)WiFiDirectError.None) - { - Log.Error(Globals.LogTag, "Failed to get the peer display type, Error - " + (WiFiDirectError)ret); - } - - return displayType; - } - - else - { - return default(WiFiDirectDisplayType); - } - } - } - - /// - /// The Wi-Fi display session availability of the peer device. - /// - /// - /// Wi-Fi Direct must be activated. - /// If there is any error, false will be returned. - /// - public bool DisplayAvailability - { - get - { - if (Globals.IsActivated) - { - bool displayAvailability; - int ret = Interop.WiFiDirect.GetDisplayAvailability(_peerMacAddress, out displayAvailability); - if (ret != (int)WiFiDirectError.None) - { - Log.Error(Globals.LogTag, "Failed to get the peer display availability, Error - " + (WiFiDirectError)ret); - } - - return displayAvailability; - } - - else - { - return false; - } - } - } - - /// - /// The HDCP information of the peer device. - /// - /// - /// Wi-Fi Direct must be activated. - /// If there is any error, -1 will be returned. - /// - public int Hdcp - { - get - { - if (Globals.IsActivated) - { - int hdcpSupport; - int ret = Interop.WiFiDirect.GetDisplayHdcp(_peerMacAddress, out hdcpSupport); - if (ret != (int)WiFiDirectError.None) - { - Log.Error(Globals.LogTag, "Failed to get the peer display hdcp support, Error - " + (WiFiDirectError)ret); - return -1; - } - - return hdcpSupport; - } - - else - { - return -1; - } - } - } - - /// - /// The port of the connected peer device. - /// - /// - /// Wi-Fi Direct must be activated. - /// If there is any error, -1 will be returned. - /// - public int Port - { - get - { - if (Globals.IsActivated) - { - int displayPort; - int ret = Interop.WiFiDirect.GetDisplayPort(_peerMacAddress, out displayPort); - if (ret != (int)WiFiDirectError.None) - { - Log.Error(Globals.LogTag, "Failed to get the peer display port, Error - " + (WiFiDirectError)ret); - return -1; - } - - return displayPort; - } - - else - { - return -1; - } - } - } - - /// - /// The Wi-Fi display maximum throughput of the peer device. - /// - /// - /// Wi-Fi Direct must be activated. - /// If there is any error, -1 will be returned. - /// - public int Throughput - { - get - { - if (Globals.IsActivated) - { - int displayThroughput; - int ret = Interop.WiFiDirect.GetDisplayThroughput(_peerMacAddress, out displayThroughput); - if (ret != (int)WiFiDirectError.None) - { - Log.Error(Globals.LogTag, "Failed to get the peer display max throughput, Error - " + (WiFiDirectError)ret); - return -1; - } - - return displayThroughput; - } - - else - { - return -1; - } - } - } - - /// - /// The Wi-Fi RSSI value of the peer device. - /// - /// - /// Wi-Fi Direct must be activated. - /// If there is any error, -1 will be returned. - /// - public int Rssi - { - get - { - if (Globals.IsActivated) - { - int rssi; - int ret = Interop.WiFiDirect.GetRssi(_peerMacAddress, out rssi); - if (ret != (int)WiFiDirectError.None) - { - Log.Error(Globals.LogTag, "Failed to get the peer RSSI, Error - " + (WiFiDirectError)ret); - return -1; - } - - return rssi; - } - - else - { - return -1; - } - } - } - /// - /// The ConnectionStateChanged event is raised when the connection state of the peer device changes. - /// - public event EventHandler ConnectionStateChanged - { - add - { - if (Globals.IsInitialize) - { - if (_connectionStateChanged == null) - { - RegisterConnectionStateChangedEvent(); - } - - _connectionStateChanged += value; - } - } - - remove - { - if (Globals.IsInitialize) - { - _connectionStateChanged -= value; - if (_connectionStateChanged == null) - { - UnregisterConnectionStateChangedEvent(); - } - } - } - } - - /// - /// The IpAddressAssigned event is raised when the IP address of the peer device is assigned. - /// - public event EventHandler IpAddressAssigned - { - add - { - if (Globals.IsInitialize) - { - if (_ipAddressAssigned == null) - { - RegisterIpAddressAssignedEvent(); - } - - _ipAddressAssigned += value; - } - } - - remove - { - if (Globals.IsInitialize) - { - _ipAddressAssigned -= value; - if (_ipAddressAssigned == null) - { - UnregisterIpAddressAssignedEvent(); - } - } - } - } - - /// - /// The ServiceStateChanged event is raised when the state of service discovery is changed. - /// - public event EventHandler ServiceStateChanged - { - add - { - if (Globals.IsInitialize) - { - if (_serviceStateChanged == null) - { - RegisterServiceStateChangedEvent(); - } - - _serviceStateChanged += value; - } - } - - remove - { - if (Globals.IsInitialize) - { - _serviceStateChanged -= value; - if (_serviceStateChanged == null) - { - UnregisterServiceStateChangedEvent(); - } - } - } - } - - private void RegisterConnectionStateChangedEvent() - { - _connectionStateChangedCallback = (int result, WiFiDirectConnectionState state, string address, IntPtr userData) => - { - if (_connectionStateChanged != null) - { - WiFiDirectError res = (WiFiDirectError)result; - _connectionStateChanged(null, new ConnectionStateChangedEventArgs(res, state, address)); - } - }; - int ret = Interop.WiFiDirect.SetConnectionChangedCallback(_connectionStateChangedCallback, IntPtr.Zero); - if (ret != (int)WiFiDirectError.None) - { - Log.Error(Globals.LogTag, "Failed to set connection state changed callback, Error - " + (WiFiDirectError)ret); - } - } - - private void UnregisterConnectionStateChangedEvent() - { - int ret = Interop.WiFiDirect.UnsetConnectionChangedCallback(); - if (ret != (int)WiFiDirectError.None) - { - Log.Error(Globals.LogTag, "Failed to unset connection state changed callback, Error - " + (WiFiDirectError)ret); - } - } - - private void RegisterIpAddressAssignedEvent() - { - _ipAddressAssignedCallback = (string macAddress, string ipAddress, string interfaceAddress, IntPtr userData) => - { - if (_ipAddressAssigned != null) - { - _ipAddressAssigned(null, new IpAddressAssignedEventArgs(macAddress, ipAddress, interfaceAddress)); - } - }; - int ret = Interop.WiFiDirect.SetIpAddressAssignedCallback(_ipAddressAssignedCallback, IntPtr.Zero); - if (ret != (int)WiFiDirectError.None) - { - Log.Error(Globals.LogTag, "Failed to set ip address assigned callback, Error - " + (WiFiDirectError)ret); - } - } - - private void UnregisterIpAddressAssignedEvent() - { - int ret = Interop.WiFiDirect.UnsetIpAddressAssignedCallback(); - if (ret != (int)WiFiDirectError.None) - { - Log.Error(Globals.LogTag, "Failed to unset ip address assigned callback, Error - " + (WiFiDirectError)ret); - } - } - - private void RegisterServiceStateChangedEvent() - { - _serviceStateChangedCallback = (int result, WiFiDirectServiceDiscoveryState stateInfo, WiFiDirectServiceType typeInfo, IntPtr responseData, string address, IntPtr userData) => - { - if (_serviceStateChanged != null) - { - WiFiDirectError error = (WiFiDirectError)result; - WiFiDirectServiceDiscoveryState state = stateInfo; - WiFiDirectServiceType type = typeInfo; - string response = Marshal.PtrToStringAnsi(responseData); - IntPtr peer; - Interop.WiFiDirect.GetDiscoveredPeerInfo(address, out peer); - DiscoveredPeerStruct peerStruct = (DiscoveredPeerStruct)Marshal.PtrToStructure(peer, typeof(DiscoveredPeerStruct)); - - _serviceStateChanged(null, new ServiceStateChangedEventArgs(error, state, type, response, WiFiDirectUtils.ConvertStructToDiscoveredPeer(peerStruct))); - } - }; - int ret = Interop.WiFiDirect.SetServiceStateChangedCallback(_serviceStateChangedCallback, IntPtr.Zero); - if (ret != (int)WiFiDirectError.None) - { - Log.Error(Globals.LogTag, "Failed to set service state changed callback, Error - " + (WiFiDirectError)ret); - } - } - - private void UnregisterServiceStateChangedEvent() - { - int ret = Interop.WiFiDirect.UnsetServiceStateChangedCallback(); - if (ret != (int)WiFiDirectError.None) - { - Log.Error(Globals.LogTag, "Failed to unset service state changed callback, Error - " + (WiFiDirectError)ret); - } - } - - /// - /// Connects to a specified remote device. - /// - /// - /// Wi-Fi Direct must be activated. - /// If this succeeds, the ConnectionStateChanged event will be invoked. - /// - /// Thrown when the Wi-Fi Direct is not supported - public void Connect() - { - if (Globals.IsActivated) - { - int ret = Interop.WiFiDirect.Connect(_peerMacAddress); - if (ret != (int)WiFiDirectError.None) - { - Log.Error(Globals.LogTag, "Failed to connect, Error - " + (WiFiDirectError)ret); - WiFiDirectErrorFactory.ThrowWiFiDirectException(ret); - } - } - - else - { - Log.Error(Globals.LogTag, "Wifi-direct is not activated"); - WiFiDirectErrorFactory.ThrowWiFiDirectException((int)WiFiDirectError.NotPermitted); - } - } - - /// - /// Cancels the connection now in progress. - /// - /// - /// Wi-Fi Direct must be activated. - /// - /// Thrown when the Wi-Fi Direct is not supported. - public void CancelConnection() - { - if (Globals.IsActivated) - { - int ret = Interop.WiFiDirect.CancelConnection(_peerMacAddress); - if (ret != (int)WiFiDirectError.None) - { - Log.Error(Globals.LogTag, "Failed to cancel the connection, Error - " + (WiFiDirectError)ret); - WiFiDirectErrorFactory.ThrowWiFiDirectException(ret); - } - } - - else - { - Log.Error(Globals.LogTag, "Wifi-direct is not activated"); - WiFiDirectErrorFactory.ThrowWiFiDirectException((int)WiFiDirectError.NotPermitted); - } - } - - /// - /// Disconnects the specified remote device. - /// - /// - /// Wi-Fi Direct must be activated. - /// If this succeeds, the ConnectionStateChanged event will be invoked. - /// - /// Thrown when the Wi-Fi Direct is not supported. - public void Disconnect() - { - if (Globals.IsActivated) - { - int ret = Interop.WiFiDirect.Disconnect(_peerMacAddress); - if (ret != (int)WiFiDirectError.None) - { - Log.Error(Globals.LogTag, "Failed to disconnect, Error - " + (WiFiDirectError)ret); - WiFiDirectErrorFactory.ThrowWiFiDirectException(ret); - } - } - - else - { - Log.Error(Globals.LogTag, "Wifi-direct is not activated"); - WiFiDirectErrorFactory.ThrowWiFiDirectException((int)WiFiDirectError.NotPermitted); - } - } - - /// - /// Allows a device to connect automatically. - /// - /// - /// Wi-Fi Direct must be activated. - /// - /// Thrown when the Wi-Fi Direct is not supported. - public void SetAutoConnect() - { - if (Globals.IsActivated) - { - int ret = Interop.WiFiDirect.SetAutoConnectionPeer(_peerMacAddress); - if (ret != (int)WiFiDirectError.None) - { - Log.Error(Globals.LogTag, "Failed to set auto connection, Error - " + (WiFiDirectError)ret); - WiFiDirectErrorFactory.ThrowWiFiDirectException(ret); - } - } - - else - { - Log.Error(Globals.LogTag, "Wifi-direct is not activated"); - WiFiDirectErrorFactory.ThrowWiFiDirectException((int)WiFiDirectError.NotPermitted); - } - } - - /// - /// Starts the Wi-Fi Direct service discovery. - /// - /// - /// Wi-Fi Direct must be activated. - /// If this succeeds, the ServiceStateChanged event will be invoked. - /// - /// - /// Thrown during one of the following cases: - /// 1. When the Wi-Fi Direct is not supported. - /// 2. When the Wi-Fi Direct service discovery is not supported. - /// - /// The type of the service. - public void StartServiceDiscovery(WiFiDirectServiceType type) - { - if (Globals.IsActivated) - { - int ret = Interop.WiFiDirect.StartServiceDiscovery(_peerMacAddress, type); - if (ret != (int)WiFiDirectError.None) - { - Log.Error(Globals.LogTag, "Failed to start Wi-Fi Direct service discovery, Error - " + (WiFiDirectError)ret); - WiFiDirectErrorFactory.ThrowWiFiDirectException(ret); - } - } - - else - { - Log.Error(Globals.LogTag, "Wifi-direct is not activated"); - WiFiDirectErrorFactory.ThrowWiFiDirectException((int)WiFiDirectError.NotPermitted); - } - } - - /// - /// Stops the Wi-Fi Direct service discovery. - /// - /// - /// Wi-Fi Direct must be activated. - /// - /// - /// Thrown during one of the following cases: - /// 1. When the Wi-Fi Direct is not supported. - /// 2. When the Wi-Fi Direct service discovery is not supported. - /// - /// The type of the service. - public void CancelServiceDiscovery(WiFiDirectServiceType type) - { - if (Globals.IsActivated) - { - int ret = Interop.WiFiDirect.StopServiceDiscovery(_peerMacAddress, type); - if (ret != (int)WiFiDirectError.None) - { - Log.Error(Globals.LogTag, "Failed to stop Wi-Fi Direct service discovery, Error - " + (WiFiDirectError)ret); - WiFiDirectErrorFactory.ThrowWiFiDirectException(ret); - } - } - - else - { - Log.Error(Globals.LogTag, "Wifi-direct is not activated"); - WiFiDirectErrorFactory.ThrowWiFiDirectException((int)WiFiDirectError.NotPermitted); - } - } - } -} diff --git a/src/Tizen.Network.WiFiDirect/Tizen.Network.WiFiDirect/WiFiDirectPersistentGroup.cs b/src/Tizen.Network.WiFiDirect/Tizen.Network.WiFiDirect/WiFiDirectPersistentGroup.cs deleted file mode 100644 index 0473bdb95..000000000 --- a/src/Tizen.Network.WiFiDirect/Tizen.Network.WiFiDirect/WiFiDirectPersistentGroup.cs +++ /dev/null @@ -1,57 +0,0 @@ -/* - * 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.Network.WiFiDirect -{ - /// - /// A class to handle persistent groups. - /// - public class WiFiDirectPersistentGroup - { - private string _address; - private string _ssid; - - internal WiFiDirectPersistentGroup(string address, string id) - { - _address = address; - _ssid = id; - } - - /// - /// The MAC address of the persistent group owner. - /// - public string MacAddress - { - get - { - return _address; - } - } - - /// - /// The SSID (Service Set Identifier) of the persistent group owner. - /// - public string Ssid - { - get - { - return _ssid; - } - } - } -} diff --git a/src/Tizen.PhonenumberUtils/Interop/Interop.Libraries.cs b/src/Tizen.PhonenumberUtils/Interop/Interop.Libraries.cs deleted file mode 100755 index 82c7dc184..000000000 --- a/src/Tizen.PhonenumberUtils/Interop/Interop.Libraries.cs +++ /dev/null @@ -1,23 +0,0 @@ -/* - * 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 PhonenumberUtils = "libphonenumber-utils.so.0"; - } -} diff --git a/src/Tizen.PhonenumberUtils/Interop/Interop.PhonenumberUtils.cs b/src/Tizen.PhonenumberUtils/Interop/Interop.PhonenumberUtils.cs deleted file mode 100755 index 614b41a67..000000000 --- a/src/Tizen.PhonenumberUtils/Interop/Interop.PhonenumberUtils.cs +++ /dev/null @@ -1,38 +0,0 @@ -/* - * 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.Runtime.InteropServices; - -internal static partial class Interop -{ - internal static partial class PhonenumberUtils - { - [DllImport(Libraries.PhonenumberUtils, EntryPoint = "phone_number_connect")] - internal static extern int Connect(); - - [DllImport(Libraries.PhonenumberUtils, EntryPoint = "phone_number_disconnect")] - internal static extern int Disconnect(); - - [DllImport(Libraries.PhonenumberUtils, EntryPoint = "phone_number_get_location_from_number")] - internal static extern int GetLocationFromNumber(string number, int region, int language, out string location); - - [DllImport(Libraries.PhonenumberUtils, EntryPoint = "phone_number_get_formatted_number")] - internal static extern int GetFormmatedNumber(string number, int region, out string normalizedNumber); - - [DllImport(Libraries.PhonenumberUtils, EntryPoint = "phone_number_get_normalized_number")] - internal static extern int GetNormailizedNumber(string number, out string normalizedNumber); - } -} diff --git a/src/Tizen.PhonenumberUtils/Tizen.PhonenumberUtils.csproj b/src/Tizen.PhonenumberUtils/Tizen.PhonenumberUtils.csproj deleted file mode 100644 index 7f4584ffe..000000000 --- a/src/Tizen.PhonenumberUtils/Tizen.PhonenumberUtils.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - netstandard2.0 - - - - - - - - diff --git a/src/Tizen.PhonenumberUtils/Tizen.PhonenumberUtils.sln b/src/Tizen.PhonenumberUtils/Tizen.PhonenumberUtils.sln deleted file mode 100755 index 5975f962e..000000000 --- a/src/Tizen.PhonenumberUtils/Tizen.PhonenumberUtils.sln +++ /dev/null @@ -1,34 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26430.12 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.PhonenumberUtils", "Tizen.PhonenumberUtils.csproj", "{EF7F0E1F-57D3-405D-A4D4-9F6B64A3D274}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen", "..\Tizen\Tizen.csproj", "{187B346D-47A5-4A25-81B3-C58BA724A1AF}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Log", "..\Tizen.Log\Tizen.Log.csproj", "{38BB464B-8315-4688-9023-8EB97A779355}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {EF7F0E1F-57D3-405D-A4D4-9F6B64A3D274}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {EF7F0E1F-57D3-405D-A4D4-9F6B64A3D274}.Debug|Any CPU.Build.0 = Debug|Any CPU - {EF7F0E1F-57D3-405D-A4D4-9F6B64A3D274}.Release|Any CPU.ActiveCfg = Release|Any CPU - {EF7F0E1F-57D3-405D-A4D4-9F6B64A3D274}.Release|Any CPU.Build.0 = Release|Any CPU - {187B346D-47A5-4A25-81B3-C58BA724A1AF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {187B346D-47A5-4A25-81B3-C58BA724A1AF}.Debug|Any CPU.Build.0 = Debug|Any CPU - {187B346D-47A5-4A25-81B3-C58BA724A1AF}.Release|Any CPU.ActiveCfg = Release|Any CPU - {187B346D-47A5-4A25-81B3-C58BA724A1AF}.Release|Any CPU.Build.0 = Release|Any CPU - {38BB464B-8315-4688-9023-8EB97A779355}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {38BB464B-8315-4688-9023-8EB97A779355}.Debug|Any CPU.Build.0 = Debug|Any CPU - {38BB464B-8315-4688-9023-8EB97A779355}.Release|Any CPU.ActiveCfg = Release|Any CPU - {38BB464B-8315-4688-9023-8EB97A779355}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/src/Tizen.PhonenumberUtils/Tizen.PhonenumberUtils/NamespaceDoc.cs b/src/Tizen.PhonenumberUtils/Tizen.PhonenumberUtils/NamespaceDoc.cs deleted file mode 100644 index 42e91c1a1..000000000 --- a/src/Tizen.PhonenumberUtils/Tizen.PhonenumberUtils/NamespaceDoc.cs +++ /dev/null @@ -1,7 +0,0 @@ -/// -/// The Tizen.PhonenumberUtils namespace provides a class for parsing, formatting and normalizing phone numbers. -/// -/// -/// The Tizen.PhonenumberUtils namespace provides a class for parsing, formatting and normalizing phone numbers. -/// -namespace Tizen.PhonenumberUtils {} diff --git a/src/Tizen.PhonenumberUtils/Tizen.PhonenumberUtils/PhonenumberUtils.cs b/src/Tizen.PhonenumberUtils/Tizen.PhonenumberUtils/PhonenumberUtils.cs deleted file mode 100644 index c410568f5..000000000 --- a/src/Tizen.PhonenumberUtils/Tizen.PhonenumberUtils/PhonenumberUtils.cs +++ /dev/null @@ -1,152 +0,0 @@ -/* - * 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.PhonenumberUtils -{ - /// - /// The PhonenumberUtils class provides methods for parsing, formatting and normalizing phone numbers. - /// - public class PhonenumberUtils : IDisposable - { - private bool disposed = false; - - public PhonenumberUtils() - { - int ret; - - ret = Interop.PhonenumberUtils.Connect(); - if (ret != (int)PhonenumberUtilsError.None) - { - Log.Error(Globals.LogTag, "Failed to connect, Error - " + (PhonenumberUtilsError)ret); - PhonenumberUtilsErrorFactory.ThrowPhonenumberUtilsException(ret); - } - } - - ~PhonenumberUtils() - { - Dispose(false); - } - - /// - /// Releases all resources used by the PhonenumberUtils. - /// It should be called after finished using of the object. - /// - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - - private void Dispose(bool disposing) - { - if (disposed) - return; - - // Free unmanaged objects - int ret; - - ret = Interop.PhonenumberUtils.Disconnect(); - if (ret != (int)PhonenumberUtilsError.None) - Log.Error(Globals.LogTag, "Failed to disconnect, Error - " + (PhonenumberUtilsError)ret); - - disposed = true; - } - - /// - /// Gets the location string from number, region, and language. - /// - /// The number - /// The region of number - /// The language of location - /// The location string - /// Thrown when method failed due to invalid operation - /// Thrown when phonenumber-utils is not supported - /// Thrown when input coordinates are invalid - /// Thrown when failed due to out of memory - public string GetLocationFromNumber(string number, Region region, Language language) - { - int ret; - string result; - - ret = Interop.PhonenumberUtils.GetLocationFromNumber(number, (int)region, (int)language, out result); - if (ret != (int)PhonenumberUtilsError.None) - { - Log.Error(Globals.LogTag, "Failed to get location, Error - " + (PhonenumberUtilsError)ret); - PhonenumberUtilsErrorFactory.ThrowPhonenumberUtilsException(ret); - } - - return result; - } - - /// - /// Gets the formatted number. - /// - /// The number - /// The region of number - /// The formatted number string - /// Thrown when method failed due to invalid operation - /// Thrown when phonenumber-utils is not supported - /// Thrown when input coordinates are invalid - /// Thrown when failed due to out of memory - public string GetFormattedNumber(string number, Region region) - { - int ret; - string result; - - ret = Interop.PhonenumberUtils.GetFormmatedNumber(number, (int)region, out result); - if (ret != (int)PhonenumberUtilsError.None) - { - Log.Error(Globals.LogTag, "Failed to get formatted number, Error - " + (PhonenumberUtilsError)ret); - PhonenumberUtilsErrorFactory.ThrowPhonenumberUtilsException(ret); - } - - return result; - } - - /// - /// Gets the normalized number. - /// - /// The number - /// The normalized number - /// http://tizen.org/privilege/telephony - /// http://tizen.org/feature/network.telephony - /// Thrown when method failed due to invalid operation - /// Thrown when phonenumber-utils is not supported - /// Thrown when input coordinates are invalid - /// Thrown when failed due to out of memory - /// Thrown when application does not have proper privileges - /// - /// Normalized number starts with plus('+') and country code, and excludes the separators such as dash or space. - /// It is a format of E.164 standard including the country code based on current network. - /// - public string GetNormalizedNumber(string number) - { - int ret; - string result; - - ret = Interop.PhonenumberUtils.GetNormailizedNumber(number, out result); - if (ret != (int)PhonenumberUtilsError.None) - { - Log.Error(Globals.LogTag, "Failed to get normalized number, Error - " + (PhonenumberUtilsError)ret); - PhonenumberUtilsErrorFactory.ThrowPhonenumberUtilsException(ret); - } - - return result; - } - } -} diff --git a/src/Tizen.PhonenumberUtils/Tizen.PhonenumberUtils/PhonenumberUtilsEnumerations.cs b/src/Tizen.PhonenumberUtils/Tizen.PhonenumberUtils/PhonenumberUtilsEnumerations.cs deleted file mode 100644 index 871086606..000000000 --- a/src/Tizen.PhonenumberUtils/Tizen.PhonenumberUtils/PhonenumberUtilsEnumerations.cs +++ /dev/null @@ -1,1138 +0,0 @@ -/* -* 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. -*/ - -namespace Tizen.PhonenumberUtils -{ - /// - /// Enumeration for language type. - /// - public enum Language - { - /// - /// Amharic - /// - Amharic, - /// - /// Arabic - /// - Arabic, - /// - /// Belarusian - /// - Belarusian, - /// - /// Bulgarian - /// - Bulgarian, - /// - /// Chinese - /// - Chinese, - /// - /// Chinese (Traditional) - /// - ChineseTraditional, - /// - /// Czech - /// - Czech, - /// - /// Dutch - /// - Dutch, - /// - /// English - /// - English, - /// - /// Finnish - /// - Finnish, - /// - /// French - /// - French, - /// - /// German - /// - German, - /// - /// Greek - /// - Greek, - /// - /// Hungarian - /// - Hungarian, - /// - /// Indonesian - /// - Indonesian, - /// - /// Italian - /// - Italian, - /// - /// Japanese - /// - Japanese, - /// - /// Korean - /// - Korean, - /// - /// Nothern Sami - /// - NorthernSami, - /// - /// Persian - /// - Persian, - /// - /// Polish - /// - Polish, - /// - /// Portuguese - /// - Portuguese, - /// - /// Romanian - /// - Romanian, - /// - /// Russian - /// - Russian, - /// - /// Serbian - /// - Serbian, - /// - /// Spanish - /// - Spanish, - /// - /// Swedish - /// - Swedish, - /// - /// Thai - /// - Thai, - /// - /// Turkish - /// - Turkish, - /// - /// Vietnamese - /// - Vietnamese, - /// - /// Current System Value - /// - System, - Max - } - - /// - /// Enumeration for region type. - /// - public enum Region - { - /// - /// Aland Islands - /// - AlandIslands, - /// - /// Albania - /// - Albania, - /// - /// Algeria - /// - Algeria, - /// - /// American Samoa - /// - AmericanSamoa, - /// - /// Angola - /// - Angola, - /// - /// Anguilla - /// - Anguilla, - /// - /// Argentina - /// - Argentina, - /// - /// Armenia - /// - Armenia, - /// - /// Ascension Island - /// - AscensionIsland, - /// - /// Antigua and Barbuda - /// - AntiguaAndBarbuda, - /// - /// Austria - /// - Austria, - /// - /// Bahamas - /// - Bahamas, - /// - /// Barbados - /// - Barbados, - /// - /// Belarus - /// - Belarus, - /// - /// Belgium - /// - Belgium, - /// - /// Benin - /// - Benin, - /// - /// Bermuda - /// - Bermuda, - /// - /// Bonaire, Sint Eustatius and Saba - /// - BonaireSintEustatiusAndSaba, - /// - /// Botswana - /// - Botswana, - /// - /// Brazil - /// - Brazil, - /// - /// Bulgaria - /// - Bulgaria, - /// - /// Burkina Faso - /// - BurkinaFaso, - /// - /// Burundi - /// - Burundi, - /// - /// Cape Verde (Cabo Verde) - /// - CapeVerde, - /// - /// Cameroon - /// - Cameroon, - /// - /// Canada - /// - Canada, - /// - /// Cayman Island - /// - CaymanIsland, - /// - /// Chile - /// - Chile, - /// - /// China - /// - China, - /// - /// Colombia - /// - Colombia, - /// - /// Comoros - /// - Comoros, - /// - /// Congo - /// - Congo, - /// - /// Ivory Coast (Cote d'Ivoire) - /// - IvoryCoast, - /// - /// Cuba - /// - Cuba, - /// - /// Curacao - /// - Curacao, - /// - /// Czech Republic - /// - CzechRepublic, - /// - /// Congo, Democratic Republic of the - /// - DemocraticRepublicOfTheCongo, - /// - /// Dominica - /// - Dominica, - /// - /// Dominican Republic - /// - DominicanRepublic, - /// - /// Egypt - /// - Egypt, - /// - /// Estonia - /// - Estonia, - /// - /// Ethiopia - /// - Ethiopia, - /// - /// Finland - /// - Finland, - /// - /// France - /// - France, - /// - /// Gabon - /// - Gabon, - /// - /// Gambia - /// - Gambia, - /// - /// Germany - /// - Germany, - /// - /// Ghana - /// - Ghana, - /// - /// Greece - /// - Greece, - /// - /// Greenland - /// - Greenland, - /// - /// Grenada - /// - Grenada, - /// - /// Guam - /// - Guam, - /// - /// Guernsey - /// - Guernsey, - /// - /// Guinea - /// - Guinea, - /// - /// Guinea-Bissau - /// - GuineaBissau, - /// - /// Hungary - /// - Hungary, - /// - /// Iceland - /// - Iceland, - /// - /// India - /// - India, - /// - /// Indonesia - /// - Indonesia, - /// - /// Ireland - /// - Ireland, - /// - /// Iran, Islamic Republic of - /// - Iran, - /// - /// Isle of Man - /// - IsleOfMan, - /// - /// Italy - /// - Italy, - /// - /// Jamaica - /// - Jamaica, - /// - /// Japan - /// - Japan, - /// - /// Jersey - /// - Jersey, - /// - /// Jordan - /// - Jordan, - /// - /// Kazakhstan - /// - Kazakhstan, - /// - /// Kenya - /// - Kenya, - /// - /// Kiribati - /// - Kiribati, - /// - /// Latvia - /// - Latvia, - /// - /// Lesotho - /// - Lesotho, - /// - /// Lithuania - /// - Lithuania, - /// - /// Luxembourg - /// - Luxembourg, - /// - /// Madagascar - /// - Madagascar, - /// - /// Mauritania - /// - Mauritania, - /// - /// Mauritius - /// - Mauritius, - /// - /// Montserrat - /// - Montserrat, - /// - /// Morocco - /// - Morocco, - /// - /// Mozambique - /// - Mozambique, - /// - /// Namibia - /// - Namibia, - /// - /// Netherlands - /// - Netherlands, - /// - /// Nigeria - /// - Nigeria, - /// - /// Northern Mariana Islands - /// - NorthernMarianaIslands, - /// - /// Norway - /// - Norway, - /// - /// Peru - /// - Peru, - /// - /// Poland - /// - Poland, - /// - /// Portugal - /// - Portugal, - /// - /// Puerto Rico - /// - PuertoRico, - /// - /// Korea (Republic of) - /// - Korea, - /// - /// Moldova (Republic of) - /// - Moldova, - /// - /// Romania - /// - Romania, - /// - /// Russian Federation - /// - RussianFederation, - /// - /// Saint Helena, Ascension and Tristan da Cunha - /// - SaintHelena, - /// - /// Saint Kitts and Nevis - /// - SaintKittsAndNevis, - /// - /// Saint Lucia - /// - SaintLucia, - /// - /// Saint Vincent and the Grenadines - /// - SaintVicentAndTheGrenadines, - /// - /// Saint Thomas And Principe (Sao Tome and Principe) - /// - SaintThomasAndPrincipe, - /// - /// Saudi Arabia - /// - SaudiArabia, - /// - /// Senegal - /// - Senegal, - /// - /// Serbia - /// - Serbia, - /// - /// Sierra Leone - /// - SierraLeone, - /// - /// Saint Martin (Sint Maarten), Dutch part - /// - SintMaarten, - /// - /// Slovakia - /// - Slovakia, - /// - /// Somalia - /// - Somalia, - /// - /// South Africa - /// - SouthAfrica, - /// - /// Spain - /// - Spain, - /// - /// Sri Lanka - /// - SriLanka, - /// - /// Sudan - /// - Sudan, - /// - /// Svalbard and Jan Mayen - /// - SvalbardAndJanMayen, - /// - /// Swaziland - /// - Swaziland, - /// - /// Sweden - /// - Sweden, - /// - /// Switzerland - /// - Switzerland, - /// - /// Taiwan, Province of China - /// - Taiwan, - /// - /// Thailand - /// - Thailand, - /// - /// Macedonia (the Former Yugoslav Republic of) - /// - Macedonia, - /// - /// Togo - /// - Togo, - /// - /// Trinidad and Tobago - /// - TrinidadAndTobago, - /// - /// Tristan da Cunha - /// - TristanDaCunha, - /// - /// Tunisia - /// - Tunisia, - /// - /// Turkey - /// - Turkey, - /// - /// Turks and Caicos Islands - /// - TurksAndCaicosIslands, - /// - /// Uganda - /// - Uganda, - /// - /// United Kingdom - /// - UnitedKingdom, - /// - /// United States of America - /// - UnitedStatesOfAmerica, - /// - /// Venezuela - /// - Venezuela, - /// - /// Viet Nam - /// - VietNam, - /// - /// Virgin Island (British) - /// - VirginIslandBritish, - /// - /// Virgin Island (U.S.) - /// - VirginIslandUs, - /// - /// Western Sahara - /// - WesternSahara, - /// - /// Zambia - /// - Zambia, - /// - /// Zimbabwe - /// - Zimbabwe, - /// - /// Andorra - /// - Andorra, - /// - /// United Arab Emirates - /// - UnitedArabEmirates, - /// - /// Afghanistan - /// - Afghanistan, - /// - /// Australia - /// - Australia, - /// - /// Aruba - /// - Aruba, - /// - /// Azerbaijan - /// - Azerbaijan, - /// - /// Bosnia and Herzegovina - /// - BosniaAndHerzegovina, - /// - /// Bangladesh - /// - Bangladesh, - /// - /// Bahrain - /// - Bahrain, - /// - /// Saint Barthelemy, French Antilles - /// - SaintBarthelemy, - /// - /// Brunei Darussalam - /// - BruneiDarussalam, - /// - /// Bolivia - /// - Bolivia, - /// - /// Bhutan - /// - Bhutan, - /// - /// Belize - /// - Belize, - /// - /// Cocos Islands - /// - CocosIslands, - /// - /// Central African Republic - /// - CentralAfricanRepublic, - /// - /// Cook Islands - /// - CookIslands, - /// - /// Costa Rica - /// - CostaRica, - /// - /// Christmas Islands - /// - ChristmasIslands, - /// - /// Cyprus - /// - Cyprus, - /// - /// Djibouti - /// - Djibouti, - /// - /// Denmark - /// - Denmark, - /// - /// Ecuador - /// - Ecuador, - /// - /// Eritrea - /// - Eritrea, - /// - /// Fiji - /// - Fiji, - /// - /// Falkland Islands - /// - FalklandIslands, - /// - /// Micronesia, Federated States of - /// - Micronesia, - /// - /// Faroe Islands - /// - FaroeIslands, - /// - /// Georgia - /// - Georgia, - /// - /// French Guiana - /// - FrenchGuiana, - /// - /// Gibraltar - /// - Gibraltar, - /// - /// Guadeloupe - /// - Guadeloupe, - /// - /// Equatorial Guinea - /// - EquatorialGuinea, - /// - /// Guatemala - /// - Guatemala, - /// - /// Guyana - /// - Guyana, - /// - /// Hong Kong - /// - HongKong, - /// - /// Honduras - /// - Honduras, - /// - /// Croatia - /// - Croatia, - /// - /// Haiti - /// - Haiti, - /// - /// Israel - /// - Israel, - /// - /// British Indian Ocean Territory / Diego Garcia - /// - DiegoGarcia, - /// - /// Iraq - /// - Iraq, - /// - /// Kyrgyzstan - /// - Kyrgyzstan, - /// - /// Cambodia - /// - Cambodia, - /// - /// Korea, Dem. People's Rep. of - /// - NorthKorea, - /// - /// Kuwait - /// - Kuwait, - /// - /// Lao People's Dem. Rep. - /// - Laos, - /// - /// Lebanon - /// - Lebanon, - /// - /// Liechtenstein - /// - Liechtenstein, - /// - /// Liberia - /// - Liberia, - /// - /// Libya (Soc. People's Libyan Arab Jamahiriva) - /// - Libya, - /// - /// Monaco - /// - Monaco, - /// - /// Montenegro - /// - Montenegro, - /// - /// Saint Martin, French part - /// - SaintMartin, - /// - /// Marshall Islands - /// - MarshallIslands, - /// - /// Mali - /// - Mali, - /// - /// Myanmar - /// - Myanmar, - /// - /// Mongolia - /// - Mongolia, - /// - /// Macao, China - /// - Macao, - /// - /// Martinique (French Dept. of) - /// - Martinique, - /// - /// Malta - /// - Malta, - /// - /// Maldives - /// - Maldives, - /// - /// Malawi - /// - Malawi, - /// - /// Mexico - /// - Mexico, - /// - /// Malaysia - /// - Malaysia, - /// - /// New Caledonia - /// - NewCaledonia, - /// - /// Niger - /// - Niger, - /// - /// Norfolk Island - /// - NorfolkIsland, - /// - /// Nicaragua - /// - Nicaragua, - /// - /// Nepal - /// - Nepal, - /// - /// Nauru - /// - Nauru, - /// - /// Niue - /// - Niue, - /// - /// New Zealand - /// - NewZealand, - /// - /// Oman - /// - Oman, - /// - /// Panama - /// - Panama, - /// - /// French Polynesia - /// - FrenchPolynesia, - /// - /// Papua New Guinea - /// - PapuaNewGuinea, - /// - /// Philippines - /// - Philippines, - /// - /// Pakistan - /// - Pakistan, - /// - /// Saint Pierre and Miquelon - /// - SaintPierreAndMiquelon, - /// - /// Palestine - /// - Palestine, - /// - /// Palau - /// - Palau, - /// - /// Paraguay - /// - Paraguay, - /// - /// Qatar - /// - Qatar, - /// - /// Reunion - /// - Reunion, - /// - /// Rwanda - /// - Rwanda, - /// - /// Solomon Islands - /// - SolomonIslands, - /// - /// Seychelles - /// - Seychelles, - /// - /// Singapore - /// - Singapore, - /// - /// Slovenia - /// - Slovenia, - /// - /// San Marino - /// - SanMarino, - /// - /// Suriname - /// - Suriname, - /// - /// South Sudan - /// - SouthSudan, - /// - /// El Salvador - /// - ElSalvador, - /// - /// Syrian Arab Republic - /// - SyrianArabRepublic, - /// - /// Chad - /// - Chad, - /// - /// Tajikistan - /// - Tajikistan, - /// - /// Tokelau - /// - Tokelau, - /// - /// Timor-Leste (East Timor) - /// - TimorLeste, - /// - /// Turkmenistan - /// - Turkmenistan, - /// - /// Tonga - /// - Tonga, - /// - /// Tuvalu - /// - Tuvalu, - /// - /// Tanzania - /// - Tanzania, - /// - /// Ukraine - /// - Ukraine, - /// - /// Uruguay - /// - Uruguay, - /// - /// Uzbekistan - /// - Uzbekistan, - /// - /// Vatican City - /// - VaticanCity, - /// - /// Vanuatu - /// - Vanuatu, - /// - /// Wallis and Futuna - /// - WallisAndFutuna, - /// - /// Samoa - /// - Samoa, - /// - /// Yemen - /// - Yemen, - /// - /// Mayotte - /// - Mayotte, - /// - /// Current System Value - /// - System, - Max - } -} diff --git a/src/Tizen.PhonenumberUtils/Tizen.PhonenumberUtils/PhonenumberUtilsErrorFactory.cs b/src/Tizen.PhonenumberUtils/Tizen.PhonenumberUtils/PhonenumberUtilsErrorFactory.cs deleted file mode 100644 index afac3efe2..000000000 --- a/src/Tizen.PhonenumberUtils/Tizen.PhonenumberUtils/PhonenumberUtilsErrorFactory.cs +++ /dev/null @@ -1,61 +0,0 @@ -/* - * 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.PhonenumberUtils -{ - internal enum PhonenumberUtilsError - { - None = ErrorCode.None, - IoError = ErrorCode.IoError, - OutOfMemory = ErrorCode.OutOfMemory, - InvalidParameter = ErrorCode.InvalidParameter, - FileNoSpaceOnDevice = ErrorCode.FileNoSpaceOnDevice, - PermissionDenied = ErrorCode.PermissionDenied, - NotSupported = ErrorCode.NotSupported, - NoData = ErrorCode.NoData, - System = -0x02020000 | 0xEF, - } - - static internal class Globals - { - internal const string LogTag = "Tizen.PhonenumberUtils"; - } - - internal static class PhonenumberUtilsErrorFactory - { - static internal void ThrowPhonenumberUtilsException(int e) - { - PhonenumberUtilsError err = (PhonenumberUtilsError)e; - - switch (err) - { - case PhonenumberUtilsError.InvalidParameter: - throw new ArgumentException(err.ToString()); - case PhonenumberUtilsError.NotSupported: - throw new NotSupportedException(err.ToString()); - case PhonenumberUtilsError.PermissionDenied: - throw new UnauthorizedAccessException(err.ToString()); - case PhonenumberUtilsError.OutOfMemory: - throw new OutOfMemoryException(err.ToString()); - default: - throw new InvalidOperationException(err.ToString()); - } - } - } -} diff --git a/src/Tizen.Pims.Calendar/Interop/Interop.Database.cs b/src/Tizen.Pims.Calendar/Interop/Interop.Database.cs deleted file mode 100644 index 9fa68a136..000000000 --- a/src/Tizen.Pims.Calendar/Interop/Interop.Database.cs +++ /dev/null @@ -1,76 +0,0 @@ -/* - * 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 Database - { - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void DBChangedCallback(string uri, IntPtr userData); - - [DllImport(Libraries.Calendar, EntryPoint = "calendar_db_insert_record")] - internal static extern int Insert(IntPtr recordHandle, out int recordId); - [DllImport(Libraries.Calendar, EntryPoint = "calendar_db_get_record")] - internal static extern int Get(string uri, int recordId, out IntPtr recordHandle); - [DllImport(Libraries.Calendar, EntryPoint = "calendar_db_update_record")] - internal static extern int Update(IntPtr recordHandle); - [DllImport(Libraries.Calendar, EntryPoint = "calendar_db_delete_record")] - internal static extern int Delete(string uri, int recordId); - [DllImport(Libraries.Calendar, EntryPoint = "calendar_db_get_all_records")] - internal static extern int GetAllRecords(string uri, int offset, int limit, out IntPtr recordListHandle); - [DllImport(Libraries.Calendar, EntryPoint = "calendar_db_get_records_with_query")] - internal static extern int GetRecords(IntPtr queryHandle, int offset, int limit, out IntPtr recordListHandle); - [DllImport(Libraries.Calendar, EntryPoint = "calendar_db_get_count")] - internal static extern int GetCount(string uri, out int count); - [DllImport(Libraries.Calendar, EntryPoint = "calendar_db_get_count_with_query")] - internal static extern int GetCountWithQuery(IntPtr queryHandle, out int count); - [DllImport(Libraries.Calendar, EntryPoint = "calendar_db_insert_records")] - internal static extern int InsertRecords(IntPtr recordListHandle, out IntPtr recordIds, out int count); - [DllImport(Libraries.Calendar, EntryPoint = "calendar_db_update_records")] - internal static extern int UpdateRecords(IntPtr recordListHandle); - [DllImport(Libraries.Calendar, EntryPoint = "calendar_db_delete_records")] - internal static extern int DeleteRecords(string uri, int[] ids, int count); - [DllImport(Libraries.Calendar, EntryPoint = "calendar_db_get_current_version")] - internal static extern int GetCurrentVersion(out int version); - [DllImport(Libraries.Calendar, EntryPoint = "calendar_db_add_changed_cb")] - internal static extern int AddChangedCallback(string uri, DBChangedCallback callback, IntPtr userData); - [DllImport(Libraries.Calendar, EntryPoint = "calendar_db_remove_changed_cb")] - internal static extern int RemoveChangedCallback(string uri, DBChangedCallback callback, IntPtr userData); - [DllImport(Libraries.Calendar, EntryPoint = "calendar_db_get_changes_by_version")] - internal static extern int GetChangesByVersion(string uri, int bookId, int dbVersion, out IntPtr recordListHandle, out int currentDBVersion); - [DllImport(Libraries.Calendar, EntryPoint = "calendar_db_insert_vcalendars")] - internal static extern int InsertVcalendars(string stream, out IntPtr recordIds, out int count); - [DllImport(Libraries.Calendar, EntryPoint = "calendar_db_replace_vcalendars")] - internal static extern int ReplaceVcalendars(string stream, int[] ids, int count); - [DllImport(Libraries.Calendar, EntryPoint = "calendar_db_replace_record")] - internal static extern int Replace(IntPtr recordHandle, int recordId); - [DllImport(Libraries.Calendar, EntryPoint = "calendar_db_replace_records")] - internal static extern int ReplaceRecords(IntPtr recordListHandle, int[] ids, int count); - [DllImport(Libraries.Calendar, EntryPoint = "calendar_db_get_last_change_version")] - internal static extern int GetLastChangeVersion(out int lastChangeVersion); - [DllImport(Libraries.Calendar, EntryPoint = "calendar_db_get_changes_exception_by_version")] - internal static extern int GetChangesException(string uri, int eventId, int dbVersion, out IntPtr recordListHandle); - [DllImport(Libraries.Calendar, EntryPoint = "calendar_db_clean_after_sync")] - internal static extern int Clean(int bookId, int dbVersion); - [DllImport(Libraries.Calendar, EntryPoint = "calendar_db_link_record")] - internal static extern int LinkRecord(int baseId, int recordId); - [DllImport(Libraries.Calendar, EntryPoint = "calendar_db_unlink_record")] - internal static extern int UnlinkRecord(int recordId); - } -} diff --git a/src/Tizen.Pims.Calendar/Interop/Interop.Filter.cs b/src/Tizen.Pims.Calendar/Interop/Interop.Filter.cs deleted file mode 100644 index daca14285..000000000 --- a/src/Tizen.Pims.Calendar/Interop/Interop.Filter.cs +++ /dev/null @@ -1,44 +0,0 @@ -/* - * 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; -using static Tizen.Pims.Calendar.CalendarFilter; - -internal static partial class Interop -{ - internal static partial class Filter - { - [DllImport(Libraries.Calendar, EntryPoint = "calendar_filter_create")] - internal static extern int Create(string uri, out IntPtr filterHandle); - [DllImport(Libraries.Calendar, EntryPoint = "calendar_filter_destroy")] - internal static extern int Destroy(IntPtr filterHandle); - [DllImport(Libraries.Calendar, EntryPoint = "calendar_filter_add_str")] - internal static extern int AddString(IntPtr filterHandle, uint propertyId, StringMatchType match, string value); - [DllImport(Libraries.Calendar, EntryPoint = "calendar_filter_add_int")] - internal static extern int AddInteger(IntPtr filterHandle, uint propertyId, IntegerMatchType match, int value); - [DllImport(Libraries.Calendar, EntryPoint = "calendar_filter_add_double")] - internal static extern int AddDouble(IntPtr filterHandle, uint propertyId, IntegerMatchType match, double value); - [DllImport(Libraries.Calendar, EntryPoint = "calendar_filter_add_lli")] - internal static extern int AddLong(IntPtr filterHandle, uint propertyId, IntegerMatchType match, long value); - [DllImport(Libraries.Calendar, EntryPoint = "calendar_filter_add_caltime")] - internal static extern int AddCalendarTime(IntPtr filterHandle, uint propertyId, IntegerMatchType match, Interop.Record.DateTime value); - [DllImport(Libraries.Calendar, EntryPoint = "calendar_filter_add_filter")] - internal static extern int AddFilter(IntPtr parentFilterHandle, IntPtr childFilterHandle); - [DllImport(Libraries.Calendar, EntryPoint = "calendar_filter_add_operator")] - internal static extern int AddOperator(IntPtr filterHandle, LogicalOperator type); - } -} diff --git a/src/Tizen.Pims.Calendar/Interop/Interop.Libraries.cs b/src/Tizen.Pims.Calendar/Interop/Interop.Libraries.cs deleted file mode 100644 index ffb5218b3..000000000 --- a/src/Tizen.Pims.Calendar/Interop/Interop.Libraries.cs +++ /dev/null @@ -1,24 +0,0 @@ -/* - * 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 Calendar = "libcalendar-service2.so.0"; - } -} - diff --git a/src/Tizen.Pims.Calendar/Interop/Interop.List.cs b/src/Tizen.Pims.Calendar/Interop/Interop.List.cs deleted file mode 100644 index 39a8eac9c..000000000 --- a/src/Tizen.Pims.Calendar/Interop/Interop.List.cs +++ /dev/null @@ -1,45 +0,0 @@ -/* - * 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 List - { - [DllImport(Libraries.Calendar, EntryPoint = "calendar_list_create")] - internal static extern int Create(out IntPtr listHandle); - [DllImport(Libraries.Calendar, EntryPoint = "calendar_list_destroy")] - internal static extern int Destroy(IntPtr listHandle, bool delete); - [DllImport(Libraries.Calendar, EntryPoint = "calendar_list_get_count")] - internal static extern int GetCount(IntPtr listHandle, out int count); - [DllImport(Libraries.Calendar, EntryPoint = "calendar_list_add")] - internal static extern int Add(IntPtr listHandle, IntPtr recordHandle); - [DllImport(Libraries.Calendar, EntryPoint = "calendar_list_remove")] - internal static extern int Remove(IntPtr listHandle, IntPtr recordHandle); - [DllImport(Libraries.Calendar, EntryPoint = "calendar_list_get_current_record_p")] - internal static extern int GetCurrentRecordP(IntPtr listHandle, out IntPtr recordHandle); - [DllImport(Libraries.Calendar, EntryPoint = "calendar_list_prev")] - internal static extern int Prev(IntPtr listHandle); - [DllImport(Libraries.Calendar, EntryPoint = "calendar_list_next")] - internal static extern int Next(IntPtr listHandle); - [DllImport(Libraries.Calendar, EntryPoint = "calendar_list_first")] - internal static extern int First(IntPtr listHandle); - [DllImport(Libraries.Calendar, EntryPoint = "calendar_list_last")] - internal static extern int Last(IntPtr listHandle); - } -} diff --git a/src/Tizen.Pims.Calendar/Interop/Interop.Query.cs b/src/Tizen.Pims.Calendar/Interop/Interop.Query.cs deleted file mode 100644 index 4fdbde707..000000000 --- a/src/Tizen.Pims.Calendar/Interop/Interop.Query.cs +++ /dev/null @@ -1,37 +0,0 @@ -/* - * 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 Query - { - [DllImport(Libraries.Calendar, EntryPoint = "calendar_query_create")] - internal static extern int Create(string uri, out IntPtr queryHandle); - [DllImport(Libraries.Calendar, EntryPoint = "calendar_query_destroy")] - internal static extern int Destroy(IntPtr queryHandle); - [DllImport(Libraries.Calendar, EntryPoint = "calendar_query_set_projection")] - internal static extern int SetProjection(IntPtr queryHandle, uint[] propertyIdArray, int count); - [DllImport(Libraries.Calendar, EntryPoint = "calendar_query_set_distinct")] - internal static extern int SetDistinct(IntPtr queryHandle, bool set); - [DllImport(Libraries.Calendar, EntryPoint = "calendar_query_set_filter")] - internal static extern int SetFilter(IntPtr queryHandle, IntPtr filterHandle); - [DllImport(Libraries.Calendar, EntryPoint = "calendar_query_set_sort")] - internal static extern int SetSort(IntPtr queryHandle, uint propertyId, bool isAscending); - } -} diff --git a/src/Tizen.Pims.Calendar/Interop/Interop.Record.cs b/src/Tizen.Pims.Calendar/Interop/Interop.Record.cs deleted file mode 100644 index be79a6ab8..000000000 --- a/src/Tizen.Pims.Calendar/Interop/Interop.Record.cs +++ /dev/null @@ -1,78 +0,0 @@ -/* - * 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 Record - { - [StructLayout(LayoutKind.Sequential)] - internal struct DateTime - { - internal int type; - internal long utime; - internal int year; - internal int month; - internal int mday; - internal int hour; - internal int minute; - internal int second; - }; - - [DllImport(Libraries.Calendar, EntryPoint = "calendar_record_create")] - internal static extern int Create(string uri, out IntPtr recordHandle); - [DllImport(Libraries.Calendar, EntryPoint = "calendar_record_destroy")] - internal static extern int Destroy(IntPtr recordHandle, bool isDeleteChild); - [DllImport(Libraries.Calendar, EntryPoint = "calendar_record_clone")] - internal static extern int Clone(IntPtr recordHandle, out IntPtr cloneHandle); - [DllImport(Libraries.Calendar, EntryPoint = "calendar_record_get_uri_p")] - internal static extern int GetUriPointer(IntPtr recordHandle, out IntPtr uri); - [DllImport(Libraries.Calendar, EntryPoint = "calendar_record_get_str")] - internal static extern int GetString(IntPtr recordHandle, uint propertyId, out string str); - [DllImport(Libraries.Calendar, EntryPoint = "calendar_record_get_str_p")] - internal static extern int GetStringPointer(IntPtr recordHandle, uint propertyId, out string str); - [DllImport(Libraries.Calendar, EntryPoint = "calendar_record_get_int")] - internal static extern int GetInteger(IntPtr recordHandle, uint propertyId, out int value); - [DllImport(Libraries.Calendar, EntryPoint = "calendar_record_get_double")] - internal static extern int GetDouble(IntPtr recordHandle, uint propertyId, out double value); - [DllImport(Libraries.Calendar, EntryPoint = "calendar_record_get_lli")] - internal static extern int GetLli(IntPtr recordHandle, uint propertyId, out long value); - [DllImport(Libraries.Calendar, EntryPoint = "calendar_record_get_caltime")] - internal static extern int GetCalendarTime(IntPtr recordHandle, uint propertyId, out DateTime value); - [DllImport(Libraries.Calendar, EntryPoint = "calendar_record_set_str")] - internal static extern int SetString(IntPtr recordHandle, uint propertyId, string str); - [DllImport(Libraries.Calendar, EntryPoint = "calendar_record_set_int")] - internal static extern int SetInteger(IntPtr recordHandle, uint propertyId, int value); - [DllImport(Libraries.Calendar, EntryPoint = "calendar_record_set_double")] - internal static extern int SetDouble(IntPtr recordHandle, uint propertyId, double value); - [DllImport(Libraries.Calendar, EntryPoint = "calendar_record_set_lli")] - internal static extern int SetLli(IntPtr recordHandle, uint propertyId, long value); - [DllImport(Libraries.Calendar, EntryPoint = "calendar_record_set_caltime")] - internal static extern int SetCalendarTime(IntPtr recordHandle, uint propertyId, DateTime value); - [DllImport(Libraries.Calendar, EntryPoint = "calendar_record_add_child_record")] - internal static extern int AddChildRecord(IntPtr recordHandle, uint propertyId, IntPtr childHandle); - [DllImport(Libraries.Calendar, EntryPoint = "calendar_record_remove_child_record")] - internal static extern int RemoveChildRecord(IntPtr recordHandle, uint propertyId, IntPtr childHandle); - [DllImport(Libraries.Calendar, EntryPoint = "calendar_record_get_child_record_count")] - internal static extern int GetChildRecordCount(IntPtr recordHandle, uint propertyId, out int count); - [DllImport(Libraries.Calendar, EntryPoint = "calendar_record_get_child_record_at_p")] - internal static extern int GetChildRecordPointer(IntPtr recordHandle, uint propertyId, int index, out IntPtr childHandle); - [DllImport(Libraries.Calendar, EntryPoint = "calendar_record_clone_child_record_list")] - internal static extern int CloneChildRecordList(IntPtr childRecordHandle, uint propertyId, out IntPtr listHandle); - } -} diff --git a/src/Tizen.Pims.Calendar/Interop/Interop.Reminder.cs b/src/Tizen.Pims.Calendar/Interop/Interop.Reminder.cs deleted file mode 100644 index ca63c4a0f..000000000 --- a/src/Tizen.Pims.Calendar/Interop/Interop.Reminder.cs +++ /dev/null @@ -1,32 +0,0 @@ -/* - * 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 Reminder - { - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void ReminderAlertedCallback(string param, IntPtr userData); - - [DllImport(Libraries.Calendar, EntryPoint = "calendar_reminder_add_cb")] - internal static extern int Add(ReminderAlertedCallback callback, IntPtr userData); - [DllImport(Libraries.Calendar, EntryPoint = "calendar_db_remove_changed_cb")] - internal static extern int Remove(ReminderAlertedCallback callback, IntPtr userData); - } -} diff --git a/src/Tizen.Pims.Calendar/Interop/Interop.Service.cs b/src/Tizen.Pims.Calendar/Interop/Interop.Service.cs deleted file mode 100644 index 809267864..000000000 --- a/src/Tizen.Pims.Calendar/Interop/Interop.Service.cs +++ /dev/null @@ -1,34 +0,0 @@ -/* - * 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.Runtime.InteropServices; - -internal static partial class Interop -{ - internal static partial class Service - { - [DllImport(Libraries.Calendar, EntryPoint = "calendar_connect")] - internal static extern int Connect(); - [DllImport(Libraries.Calendar, EntryPoint = "calendar_disconnect")] - internal static extern int Disconnect(); - [DllImport(Libraries.Calendar, EntryPoint = "calendar_connect_on_thread")] - internal static extern int ConnectOnThread(); - [DllImport(Libraries.Calendar, EntryPoint = "calendar_disconnect_on_thread")] - internal static extern int DisconnectOnThread(); - [DllImport(Libraries.Calendar, EntryPoint = "calendar_connect_with_flags")] - internal static extern int ConnectWithFlags(uint flags); - } -} diff --git a/src/Tizen.Pims.Calendar/Interop/Interop.Vcalendar.cs b/src/Tizen.Pims.Calendar/Interop/Interop.Vcalendar.cs deleted file mode 100644 index 3ccd6e676..000000000 --- a/src/Tizen.Pims.Calendar/Interop/Interop.Vcalendar.cs +++ /dev/null @@ -1,33 +0,0 @@ -/* - * 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 Vcalendar - { - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool ParseCallback(IntPtr recordHandle, IntPtr userData); - [DllImport(Libraries.Calendar, EntryPoint = "calendar_vcalendar_make_from_records")] - internal static extern int Compose(IntPtr listHandle, out string stream); - [DllImport(Libraries.Calendar, EntryPoint = "calendar_vcalendar_parse_to_calendar")] - internal static extern int Parse(string stream, out IntPtr listHandle); - [DllImport(Libraries.Calendar, EntryPoint = "calendar_vcalendar_parse_to_calendar_foreach")] - internal static extern int ParseForEach(string filePath, ParseCallback parseCb, IntPtr userData); - } -} diff --git a/src/Tizen.Pims.Calendar/Tizen.Pims.Calendar.csproj b/src/Tizen.Pims.Calendar/Tizen.Pims.Calendar.csproj deleted file mode 100644 index 7f4584ffe..000000000 --- a/src/Tizen.Pims.Calendar/Tizen.Pims.Calendar.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - netstandard2.0 - - - - - - - - diff --git a/src/Tizen.Pims.Calendar/Tizen.Pims.Calendar.sln b/src/Tizen.Pims.Calendar/Tizen.Pims.Calendar.sln deleted file mode 100755 index 342a80fc2..000000000 --- a/src/Tizen.Pims.Calendar/Tizen.Pims.Calendar.sln +++ /dev/null @@ -1,34 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26430.12 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Pims.Calendar", "Tizen.Pims.Calendar.csproj", "{9B929385-6459-48A7-B393-B554FBDD8BE2}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen", "..\Tizen\Tizen.csproj", "{3E7535C3-30BE-4367-ABCE-AB81BD23C685}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Log", "..\Tizen.Log\Tizen.Log.csproj", "{9D3D6DBC-8951-48B8-95D9-34EB1F248F5A}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {9B929385-6459-48A7-B393-B554FBDD8BE2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {9B929385-6459-48A7-B393-B554FBDD8BE2}.Debug|Any CPU.Build.0 = Debug|Any CPU - {9B929385-6459-48A7-B393-B554FBDD8BE2}.Release|Any CPU.ActiveCfg = Release|Any CPU - {9B929385-6459-48A7-B393-B554FBDD8BE2}.Release|Any CPU.Build.0 = Release|Any CPU - {3E7535C3-30BE-4367-ABCE-AB81BD23C685}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {3E7535C3-30BE-4367-ABCE-AB81BD23C685}.Debug|Any CPU.Build.0 = Debug|Any CPU - {3E7535C3-30BE-4367-ABCE-AB81BD23C685}.Release|Any CPU.ActiveCfg = Release|Any CPU - {3E7535C3-30BE-4367-ABCE-AB81BD23C685}.Release|Any CPU.Build.0 = Release|Any CPU - {9D3D6DBC-8951-48B8-95D9-34EB1F248F5A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {9D3D6DBC-8951-48B8-95D9-34EB1F248F5A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {9D3D6DBC-8951-48B8-95D9-34EB1F248F5A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {9D3D6DBC-8951-48B8-95D9-34EB1F248F5A}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/src/Tizen.Pims.Calendar/Tizen.Pims.Calendar/CalendarDatabase.cs b/src/Tizen.Pims.Calendar/Tizen.Pims.Calendar/CalendarDatabase.cs deleted file mode 100644 index 60d94100a..000000000 --- a/src/Tizen.Pims.Calendar/Tizen.Pims.Calendar/CalendarDatabase.cs +++ /dev/null @@ -1,589 +0,0 @@ -/* - * 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.Collections.Generic; -using System.Runtime.InteropServices; -using System.Diagnostics.CodeAnalysis; - -namespace Tizen.Pims.Calendar -{ - /// - /// CalendarDatabase provides methods to manage calendar information from/to the database. - /// - /// - /// This class allows user to access/create/update db operations for calendar information. - /// - public class CalendarDatabase - { - private Object thisLock = new Object(); - private Dictionary> _eventHandlerMap = new Dictionary>(); - private Dictionary _callbackMap = new Dictionary(); - private Interop.Database.DBChangedCallback _dbChangedDelegate; - - internal CalendarDatabase() - { - ///To be created in CalendarManager only - } - - /// - /// The calendar database version. - /// - /// The current calendar database version. - [SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic")] - public int Version - { - get - { - int version = -1; - int error = Interop.Database.GetCurrentVersion(out version); - if (CalendarError.None != (CalendarError)error) - { - Log.Error(Globals.LogTag, "Version Failed with error " + error); - } - return version; - } - } - - /// - /// Gets last successful changed calendar database version on the current connection. - /// - /// The last successful changed calendar database version on the current connection - /// http://tizen.org/privilege/calendar.read - /// Thrown when method failed due to invalid operation - /// Thrown when failed due to out of memory - /// Thrown when application does not have proper privileges - /// The last successful changed calendar database version on the current connection. - [SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic")] - public int LastChangeVersion - { - get - { - int version = -1; - int error = Interop.Database.GetLastChangeVersion(out version); - if (CalendarError.None != (CalendarError)error) - { - Log.Error(Globals.LogTag, "LastChangeVersion Failed with error " + error); - } - return version; - } - } - - /// - /// Inserts a record into the calendar database. - /// - /// The record to be inserted - /// The ID of inserted record - /// http://tizen.org/privilege/calendar.write - /// Thrown when method failed due to invalid operation - /// Thrown when an invoked method is not supported - /// Thrown when one of the arguments provided to a method is not valid - /// Thrown when failed due to out of memory - /// Thrown when application does not have proper privileges - [SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic")] - public int Insert(CalendarRecord record) - { - int id = -1; - int error = Interop.Database.Insert(record._recordHandle, out id); - if (CalendarError.None != (CalendarError)error) - { - Log.Error(Globals.LogTag, "Insert Failed with error " + error); - throw CalendarErrorFactory.GetException(error); - } - return id; - } - - /// - /// Gets a record from the calendar database. - /// - /// The view URI of a record - /// The record ID - /// - /// The record associated with the record ID - /// - /// http://tizen.org/privilege/calendar.read - /// Thrown when method failed due to invalid operation - /// Thrown when an invoked method is not supported - /// Thrown when one of the arguments provided to a method is not valid - /// Thrown when failed due to out of memory - /// Thrown when application does not have proper privileges - [SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic")] - [SuppressMessage("Microsoft.Design", "CA1054:UriParametersShouldNotBeStrings")] - public CalendarRecord Get(string viewUri, int recordId) - { - IntPtr handle; - int error = Interop.Database.Get(viewUri, recordId, out handle); - if (CalendarError.None != (CalendarError)error) - { - if (CalendarError.DBNotFound == (CalendarError)error) - { - Log.Error(Globals.LogTag, "No data" + error); - return null; - } - Log.Error(Globals.LogTag, "Get Failed with error " + error); - throw CalendarErrorFactory.GetException(error); - } - return new CalendarRecord(handle); - } - - /// - /// Updates a record in the calendar database. - /// - /// The record to be updated - /// http://tizen.org/privilege/calendar.write - /// Thrown when method failed due to invalid operation - /// Thrown when an invoked method is not supported - /// Thrown when one of the arguments provided to a method is not valid - /// Thrown when failed due to out of memory - /// Thrown when application does not have proper privileges - [SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic")] - public void Update(CalendarRecord record) - { - int error = Interop.Database.Update(record._recordHandle); - if (CalendarError.None != (CalendarError)error) - { - Log.Error(Globals.LogTag, "Update Failed with error " + error); - throw CalendarErrorFactory.GetException(error); - } - } - - /// - /// Deletes a record from the calendar database with related child records. - /// - /// The view URI of a record - /// The record ID to be deleted - /// http://tizen.org/privilege/calendar.write - /// Thrown when method failed due to invalid operation - /// Thrown when an invoked method is not supported - /// Thrown when one of the arguments provided to a method is not valid - /// Thrown when failed due to out of memory - /// Thrown when application does not have proper privileges - [SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic")] - [SuppressMessage("Microsoft.Design", "CA1054:UriParametersShouldNotBeStrings")] - public void Delete(string viewUri, int recordId) - { - int error = Interop.Database.Delete(viewUri, recordId); - if (CalendarError.None != (CalendarError)error) - { - Log.Error(Globals.LogTag, "Delete Failed with error " + error); - throw CalendarErrorFactory.GetException(error); - } - } - - /// - /// Replaces a record in the calendar database. - /// - /// The record to be replaced - /// the record id - /// http://tizen.org/privilege/calendar.write - /// Thrown when method failed due to invalid operation - /// Thrown when an invoked method is not supported - /// Thrown when one of the arguments provided to a method is not valid - /// Thrown when failed due to out of memory - /// Thrown when application does not have proper privileges - [SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic")] - public void Replace(CalendarRecord record, int id) - { - int error = Interop.Database.Replace(record._recordHandle, id); - if (CalendarError.None != (CalendarError)error) - { - Log.Error(Globals.LogTag, "Replace Failed with error " + error); - throw CalendarErrorFactory.GetException(error); - } - } - - /// - /// Retrieves all records as a list. - /// - /// The view URI to get records from - /// The index from which results are received - /// The maximum number of results(value 0 is used for all records) - /// - /// The record list - /// - /// http://tizen.org/privilege/calendar.read - /// Thrown when method failed due to invalid operation - /// Thrown when an invoked method is not supported - /// Thrown when one of the arguments provided to a method is not valid - /// Thrown when failed due to out of memory - /// Thrown when application does not have proper privileges - [SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic")] - [SuppressMessage("Microsoft.Design", "CA1054:UriParametersShouldNotBeStrings")] - public CalendarList GetAll(string viewUri, int offset, int limit) - { - IntPtr handle; - int error = Interop.Database.GetAllRecords(viewUri, offset, limit, out handle); - if (CalendarError.None != (CalendarError)error) - { - Log.Error(Globals.LogTag, "GetAll Failed with error " + error); - throw CalendarErrorFactory.GetException(error); - } - return new CalendarList(handle); - } - - /// - /// Retrieves records using a query. - /// - /// The query used to filter results - /// The index from which results are received - /// The maximum number of results(value 0 is used for all records) - /// - /// CalendarList - /// - /// http://tizen.org/privilege/calendar.read - /// Thrown when method failed due to invalid operation - /// Thrown when an invoked method is not supported - /// Thrown when one of the arguments provided to a method is not valid - /// Thrown when failed due to out of memory - /// Thrown when application does not have proper privileges - [SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic")] - public CalendarList GetRecordsWithQuery(CalendarQuery query, int offset, int limit) - { - IntPtr handle; - int error = Interop.Database.GetRecords(query._queryHandle, offset, limit, out handle); - if (CalendarError.None != (CalendarError)error) - { - Log.Error(Globals.LogTag, "GetAllWithQuery Failed with error " + error); - throw CalendarErrorFactory.GetException(error); - } - return new CalendarList(handle); - } - - /// - /// Inserts multiple records into the calendar database as a batch operation. - /// - /// The record list - /// - /// The inserted record id array - /// - /// http://tizen.org/privilege/calendar.write - /// Thrown when method failed due to invalid operation - /// Thrown when an invoked method is not supported - /// Thrown when one of the arguments provided to a method is not valid - /// Thrown when failed due to out of memory - /// Thrown when application does not have proper privileges - [SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic")] - public int[] Insert(CalendarList list) - { - IntPtr ids; - int count; - int error = Interop.Database.InsertRecords(list._listHandle, out ids, out count); - if (CalendarError.None != (CalendarError)error) - { - Log.Error(Globals.LogTag, "Insert Failed with error " + error); - throw CalendarErrorFactory.GetException(error); - } - int[] idArr = new int[count]; - Marshal.Copy(ids, idArr, 0, count); - - return idArr; - } - - /// - /// Updates multiple records into the calendar database as a batch operation. - /// - /// The record list - /// http://tizen.org/privilege/calendar.write - /// Thrown when method failed due to invalid operation - /// Thrown when an invoked method is not supported - /// Thrown when one of the arguments provided to a method is not valid - /// Thrown when failed due to out of memory - /// Thrown when application does not have proper privileges - [SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic")] - public void Update(CalendarList list) - { - int error = Interop.Database.UpdateRecords(list._listHandle); - if (CalendarError.None != (CalendarError)error) - { - Log.Error(Globals.LogTag, "Update Failed with error " + error); - throw CalendarErrorFactory.GetException(error); - } - } - - /// - /// Deletes multiple records with related child records from the calendar database as a batch operation. - /// - /// The view URI of the records to delete - /// The record IDs to delete - /// http://tizen.org/privilege/calendar.write - /// Thrown when method failed due to invalid operation - /// Thrown when an invoked method is not supported - /// Thrown when one of the arguments provided to a method is not valid - /// Thrown when failed due to out of memory - /// Thrown when application does not have proper privileges - [SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic")] - [SuppressMessage("Microsoft.Design", "CA1054:UriParametersShouldNotBeStrings")] - public void Delete(string viewUri, int[] idArray) - { - int error = Interop.Database.DeleteRecords(viewUri, idArray, idArray.Length); - if (CalendarError.None != (CalendarError)error) - { - Log.Error(Globals.LogTag, "Delete Failed with error " + error); - throw CalendarErrorFactory.GetException(error); - } - } - - /// - /// Deletes multiple records with related child records from the calendar database as a batch operation. - /// - /// The record list - /// http://tizen.org/privilege/calendar.write - /// Thrown when method failed due to invalid operation - /// Thrown when an invoked method is not supported - /// Thrown when one of the arguments provided to a method is not valid - /// Thrown when failed due to out of memory - /// Thrown when application does not have proper privileges - public void Delete(CalendarList list) - { - CalendarRecord record = null; - if (list.Count <= 0) - return; - - int[] ids = new int[list.Count]; - int i; - uint propertyId = 0; - list.MoveFirst(); - for (i = 0; i < list.Count; i++) - { - record = list.GetCurrentRecord(); - if (0 == propertyId) - { - if (0 == String.Compare(CalendarViews.Book.Uri, record.Uri)) - propertyId = CalendarViews.Book.Id; - else if (0 == String.Compare(CalendarViews.Event.Uri, record.Uri)) - propertyId = CalendarViews.Event.Id; - else if (0 == String.Compare(CalendarViews.Todo.Uri, record.Uri)) - propertyId = CalendarViews.Todo.Id; - else if (0 == String.Compare(CalendarViews.Timezone.Uri, record.Uri)) - propertyId = CalendarViews.Timezone.Id; - else if (0 == String.Compare(CalendarViews.Extended.Uri, record.Uri)) - propertyId = CalendarViews.Extended.Id; - else - { - Log.Error(Globals.LogTag, "Invalid uri [" + record.Uri + "]"); - continue; - } - } - ids[i] = record.Get(propertyId); - list.MoveNext(); - } - Delete(record.Uri, ids); - } - - /// - /// Replaces multiple records in the calendar database as a batch operation. - /// - /// The record list - /// The record IDs - /// http://tizen.org/privilege/calendar.write - /// Thrown when method failed due to invalid operation - /// Thrown when an invoked method is not supported - /// Thrown when one of the arguments provided to a method is not valid - /// Thrown when failed due to out of memory - /// Thrown when application does not have proper privileges - [SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic")] - public void Replace(CalendarList list, int[] idArray) - { - int error = Interop.Database.ReplaceRecords(list._listHandle, idArray, idArray.Length); - if (CalendarError.None != (CalendarError)error) - { - Log.Error(Globals.LogTag, "Replace Failed with error " + error); - throw CalendarErrorFactory.GetException(error); - } - } - - /// - /// Retrieves records with the given calendar database version. - /// - /// The view URI to get records from - /// The calendar book ID to filter - /// The calendar database version - /// The current calendar database version - /// - /// The record list - /// - /// http://tizen.org/privilege/calendar.read - /// Thrown when method failed due to invalid operation - /// Thrown when an invoked method is not supported - /// Thrown when one of the arguments provided to a method is not valid - /// Thrown when failed due to out of memory - /// Thrown when application does not have proper privileges - [SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic")] - [SuppressMessage("Microsoft.Design", "CA1054:UriParametersShouldNotBeStrings")] - public CalendarList GetChangesByVersion(string viewUri, int BookId, int calendarDBVersion, out int currentDBVersion) - { - IntPtr recordList; - int error = Interop.Database.GetChangesByVersion(viewUri, BookId, calendarDBVersion, out recordList, out currentDBVersion); - if (CalendarError.None != (CalendarError)error) - { - Log.Error(Globals.LogTag, "GetChangesByVersion Failed with error " + error); - throw CalendarErrorFactory.GetException(error); - } - return new CalendarList(recordList); - } - - /// - /// Gets the record count of a specific view. - /// - /// The view URI to get records from - /// - /// The count of records - /// - /// http://tizen.org/privilege/calendar.read - [SuppressMessage("Microsoft.Design", "CA1822:MarkMembersAsStatic")] - [SuppressMessage("Microsoft.Design", "CA1054:UriParametersShouldNotBeStrings")] - public int GetCount(string viewUri) - { - int count = -1; - int error = Interop.Database.GetCount(viewUri, out count); - if (CalendarError.None != (CalendarError)error) - { - Log.Error(Globals.LogTag, "GetCount Failed with error " + error); - throw CalendarErrorFactory.GetException(error); - } - return count; - } - - /// - /// Gets the record count with a query. - /// - /// The query used for filtering the results - /// - /// The count of records - /// - /// http://tizen.org/privilege/calendar.read - [SuppressMessage("Microsoft.Design", "CA1822:MarkMembersAsStatic")] - public int GetCount(CalendarQuery query) - { - int count = -1; - int error = Interop.Database.GetCountWithQuery(query._queryHandle, out count); - if (CalendarError.None != (CalendarError)error) - { - Log.Error(Globals.LogTag, "GetCount Failed with error " + error); - throw CalendarErrorFactory.GetException(error); - } - return count; - } - - /// - /// Registers a callback function to be invoked when a record changes. - /// - /// The view URI of the record to subscribe for change notifications - /// The EventHandler to register - /// http://tizen.org/privilege/calendar.read - [SuppressMessage("Microsoft.Design", "CA1054:UriParametersShouldNotBeStrings")] - public void AddDBChangedDelegate(string viewUri, EventHandler DBChanged) - { - Log.Debug(Globals.LogTag, "AddDBChangedDelegate"); - - if (!_callbackMap.ContainsKey(viewUri)) - { - _callbackMap[viewUri] = (string uri, IntPtr userData) => - { - DBChangedEventArgs args = new DBChangedEventArgs(uri); - _eventHandlerMap[uri]?.Invoke(this, args); - }; - - int error = Interop.Database.AddChangedCallback(viewUri, _dbChangedDelegate, IntPtr.Zero); - if (CalendarError.None != (CalendarError)error) - { - Log.Error(Globals.LogTag, "AddDBChangedDelegate Failed with error " + error); - throw CalendarErrorFactory.GetException(error); - } - } - - EventHandler handler = null; - if (!_eventHandlerMap.TryGetValue(viewUri, out handler)) - _eventHandlerMap.Add(viewUri, null); - - _eventHandlerMap[viewUri] = handler + DBChanged; - } - - /// - /// Deregisters a callback function. - /// - /// The view URI of the record to subscribe for change notifications - /// The EventHandler to deregister - /// http://tizen.org/privilege/calendar.read - [SuppressMessage("Microsoft.Design", "CA1054:UriParametersShouldNotBeStrings")] - public void RemoveDBChangedDelegate(string viewUri, EventHandler DBChanged) - { - Log.Debug(Globals.LogTag, "RemoveDBChangedDelegate"); - - EventHandler handler = null; - if (!_eventHandlerMap.TryGetValue(viewUri, out handler)) - _eventHandlerMap.Add(viewUri, null); - else - _eventHandlerMap[viewUri] = handler - DBChanged; - - if (_eventHandlerMap[viewUri] == null) - { - int error = Interop.Database.RemoveChangedCallback(viewUri, _callbackMap[viewUri], IntPtr.Zero); - if (CalendarError.None != (CalendarError)error) - { - Log.Error(Globals.LogTag, "RemoveDBChangedDelegate Failed with error " + error); - throw CalendarErrorFactory.GetException(error); - } - _callbackMap.Remove(viewUri); - } - } - - /// - /// Link a record to another record. - /// - /// The base record ID - /// The record ID to link to - /// http://tizen.org/privilege/calendar.write - /// Thrown when method failed due to invalid operation - /// Thrown when an invoked method is not supported - /// Thrown when one of the arguments provided to a method is not valid - /// Thrown when failed due to out of memory - /// Thrown when application does not have proper privileges - [SuppressMessage("Microsoft.Design", "CA1822:MarkMembersAsStatic")] - public void LinkRecord(int baseId, int recordId) - { - Log.Debug(Globals.LogTag, "LinkRecord"); - int error = Interop.Database.LinkRecord(baseId, recordId); - if (CalendarError.None != (CalendarError)error) - { - Log.Error(Globals.LogTag, "LinkRecor Failed with error " + error); - throw CalendarErrorFactory.GetException(error); - } - } - - /// - /// Unlink a record from base record. - /// - /// The record ID to unlink - /// http://tizen.org/privilege/calendar.write - /// Thrown when method failed due to invalid operation - /// Thrown when an invoked method is not supported - /// Thrown when one of the arguments provided to a method is not valid - /// Thrown when failed due to out of memory - /// Thrown when application does not have proper privileges - [SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic")] - public void UnlinkRecord(int recordId) - { - Log.Debug(Globals.LogTag, "UnlinkRecord"); - int error = Interop.Database.UnlinkRecord(recordId); - if (CalendarError.None != (CalendarError)error) - { - Log.Error(Globals.LogTag, "UnlinkRecor Failed with error " + error); - throw CalendarErrorFactory.GetException(error); - } - } - } -} diff --git a/src/Tizen.Pims.Calendar/Tizen.Pims.Calendar/CalendarErrorFactory.cs b/src/Tizen.Pims.Calendar/Tizen.Pims.Calendar/CalendarErrorFactory.cs deleted file mode 100644 index 9e97d31b7..000000000 --- a/src/Tizen.Pims.Calendar/Tizen.Pims.Calendar/CalendarErrorFactory.cs +++ /dev/null @@ -1,113 +0,0 @@ -/* - * 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.Pims.Calendar -{ - internal enum CalendarError - { - None = Tizen.Internals.Errors.ErrorCode.None, /**< Successful */ - OutOfMemory = Tizen.Internals.Errors.ErrorCode.OutOfMemory, /**< Out of Memory (-12) */ - InvalidParameter = Tizen.Internals.Errors.ErrorCode.InvalidParameter, /**< Invalid parameter (-22) */ - FileNoSpace = Tizen.Internals.Errors.ErrorCode.FileNoSpaceOnDevice, /** - /// A filter includes the conditions for the search. - /// - public class CalendarFilter:IDisposable - { - internal IntPtr _filterHandle; - - /// - /// Creates a filter with a condition for a string type. - /// - /// The view URI of a filter - /// The property ID to add a condition - /// The match flag - /// The match value - /// Thrown when an invoked method is not supported - /// Thrown when one of the arguments provided to a method is not valid - /// Thrown when failed due to out of memory - [SuppressMessage("Microsoft.Design", "CA1054:UriParametersShouldNotBeStrings")] - public CalendarFilter(string viewUri, uint propertyId, StringMatchType matchType, string matchValue) - { - int error = 0; - error = Interop.Filter.Create(viewUri, out _filterHandle); - if (CalendarError.None != (CalendarError)error) - { - Log.Error(Globals.LogTag, "CalendarFilter Failed with error " + error); - throw CalendarErrorFactory.GetException(error); - } - - error = Interop.Filter.AddString(_filterHandle, propertyId, matchType, matchValue); - if (CalendarError.None != (CalendarError)error) - { - Log.Error(Globals.LogTag, "CalendarFilter Failed with error " + error); - throw CalendarErrorFactory.GetException(error); - } - } - - /// - /// Creates a filter with a condition for an integer type. - /// - /// The view URI of a filter - /// The property ID to add a condition - /// The match flag - /// The match value - /// Thrown when an invoked method is not supported - /// Thrown when one of the arguments provided to a method is not valid - /// Thrown when failed due to out of memory - [SuppressMessage("Microsoft.Design", "CA1054:UriParametersShouldNotBeStrings")] - public CalendarFilter(string viewUri, uint propertyId, IntegerMatchType matchType, int matchValue) - { - int error = 0; - error = Interop.Filter.Create(viewUri, out _filterHandle); - if (CalendarError.None != (CalendarError)error) - { - Log.Error(Globals.LogTag, "CalendarFilter Failed with error " + error); - throw CalendarErrorFactory.GetException(error); - } - - error = Interop.Filter.AddInteger(_filterHandle, propertyId, matchType, matchValue); - if (CalendarError.None != (CalendarError)error) - { - Log.Error(Globals.LogTag, "CalendarFilter Failed with error " + error); - throw CalendarErrorFactory.GetException(error); - } - } - - /// - /// Creates a filter with a condition for long type. - /// - /// The view URI of a filter - /// The property ID to add a condition - /// The match flag - /// The match value - /// Thrown when an invoked method is not supported - /// Thrown when one of the arguments provided to a method is not valid - /// Thrown when failed due to out of memory - [SuppressMessage("Microsoft.Design", "CA1054:UriParametersShouldNotBeStrings")] - public CalendarFilter(string viewUri, uint propertyId, IntegerMatchType matchType, long matchValue) - { - int error = 0; - error = Interop.Filter.Create(viewUri, out _filterHandle); - if (CalendarError.None != (CalendarError)error) - { - Log.Error(Globals.LogTag, "CalendarFilter Failed with error " + error); - throw CalendarErrorFactory.GetException(error); - } - - error = Interop.Filter.AddLong(_filterHandle, propertyId, matchType, matchValue); - if (CalendarError.None != (CalendarError)error) - { - Log.Error(Globals.LogTag, "CalendarFilter Failed with error " + error); - throw CalendarErrorFactory.GetException(error); - } - } - - /// - /// Creates a filter with a condition for double type. - /// - /// The view URI of a filter - /// The property ID to add a condition - /// The match flag - /// The match value - /// Thrown when an invoked method is not supported - /// Thrown when one of the arguments provided to a method is not valid - /// Thrown when failed due to out of memory - [SuppressMessage("Microsoft.Design", "CA1054:UriParametersShouldNotBeStrings")] - public CalendarFilter(string viewUri, uint propertyId, IntegerMatchType matchType, double matchValue) - { - int error = 0; - error = Interop.Filter.Create(viewUri, out _filterHandle); - if (CalendarError.None != (CalendarError)error) - { - Log.Error(Globals.LogTag, "CalendarFilter Failed with error " + error); - throw CalendarErrorFactory.GetException(error); - } - - error = Interop.Filter.AddDouble(_filterHandle, propertyId, matchType, matchValue); - if (CalendarError.None != (CalendarError)error) - { - Log.Error(Globals.LogTag, "CalendarFilter Failed with error " + error); - throw CalendarErrorFactory.GetException(error); - } - } - - /// - /// Creates a filter with a condition for CalendarTime type. - /// - /// The view URI of a filter - /// The property ID to add a condition - /// The match flag - /// The match value - /// Thrown when an invoked method is not supported - /// Thrown when one of the arguments provided to a method is not valid - /// Thrown when failed due to out of memory - [SuppressMessage("Microsoft.Design", "CA1054:UriParametersShouldNotBeStrings")] - public CalendarFilter(string viewUri, uint propertyId, IntegerMatchType matchType, CalendarTime matchValue) - { - int error = 0; - error = Interop.Filter.Create(viewUri, out _filterHandle); - if (CalendarError.None != (CalendarError)error) - { - Log.Error(Globals.LogTag, "CalendarFilter Failed with error " + error); - throw CalendarErrorFactory.GetException(error); - } - - Interop.Record.DateTime time = CalendarRecord.ConvertCalendarTimeToStruct(matchValue); - error = Interop.Filter.AddCalendarTime(_filterHandle, propertyId, matchType, time); - if (CalendarError.None != (CalendarError)error) - { - Log.Error(Globals.LogTag, "CalendarFilter Failed with error " + error); - throw CalendarErrorFactory.GetException(error); - } - } - - /// - /// Destroy filter. - /// - ~CalendarFilter() - { - Dispose(false); - } - - /// - /// Enumeration for the filter match type of a string. - /// - public enum StringMatchType - { - /// - /// Full string, case-sensitive - /// - Exactly, - /// - /// Full string, case-insensitive - /// - FullString, - /// - /// Sub string, case-insensitive - /// - Contains, - /// - /// Start with, case-insensitive - /// - StartsWith, - /// - /// End with, case-insensitive - /// - EndsWith, - /// - /// IS NOT NUL - /// - Exists, - } - - /// - /// Enumeration for the filter match type of an integer. - /// - public enum IntegerMatchType - { - /// - /// '=' - /// - Equal, - /// - /// '>' - /// - GreaterThan, - /// - /// '>=' - /// - GreaterThanOrEqual, - /// - /// < - /// - LessThan, - /// - /// <= - /// - LessThanOrEqual, - /// - /// <>, this flag can yield poor performance - /// - NotEqual, - /// - /// IS NULL - /// - None, - } - - /// - /// Enumeration for a filter operator. - /// - public enum LogicalOperator - { - /// - /// AND - /// - And, - /// - /// OR - /// - Or, - } - -#region IDisposable Support - private bool disposedValue = false; // To detect redundant calls - - /// - /// Dispose - /// - /// true to release both managed and unmanaged resources; false to release only unmanaged resources. - protected virtual void Dispose(bool disposing) - { - if (!disposedValue) - { - Log.Debug(Globals.LogTag, "Dispose :" + disposing); - - int error = Interop.Filter.Destroy(_filterHandle); - if (CalendarError.None != (CalendarError)error) - { - Log.Error(Globals.LogTag, "Destroy Failed with error " + error); - throw CalendarErrorFactory.GetException(error); - } - disposedValue = true; - } - } - - /// - /// Releases all resources used by the CalendarFilter. - /// It should be called after having finished using of the object. - /// - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } -#endregion - - /// - /// Adds a condition for the string type. - /// - /// The operator type - /// The property ID to add a condition - /// The match flag - /// The match value - /// Thrown when an invoked method is not supported - /// Thrown when one of the arguments provided to a method is not valid - public void AddCondition(LogicalOperator logicalOperator, uint propertyId, StringMatchType matchType, string matchValue) - { - int error = Interop.Filter.AddOperator(_filterHandle, logicalOperator); - if (CalendarError.None != (CalendarError)error) - { - Log.Error(Globals.LogTag, "AddCondition Failed with error " + error); - throw CalendarErrorFactory.GetException(error); - } - - error = Interop.Filter.AddString(_filterHandle, propertyId, matchType, matchValue); - if (CalendarError.None != (CalendarError)error) - { - Log.Error(Globals.LogTag, "AddCondition Failed with error " + error); - throw CalendarErrorFactory.GetException(error); - } - } - - /// - /// Adds a condition for the integer type. - /// - /// The operator type - /// The property ID to add a condition - /// The match flag - /// The match value - /// Thrown when an invoked method is not supported - /// Thrown when one of the arguments provided to a method is not valid - public void AddCondition(LogicalOperator logicalOperator, uint propertyId, IntegerMatchType matchType, int matchValue) - { - int error = Interop.Filter.AddOperator(_filterHandle, logicalOperator); - if (CalendarError.None != (CalendarError)error) - { - Log.Error(Globals.LogTag, "AddCondition Failed with error " + error); - throw CalendarErrorFactory.GetException(error); - } - - error = Interop.Filter.AddInteger(_filterHandle, propertyId, matchType, matchValue); - if (CalendarError.None != (CalendarError)error) - { - Log.Error(Globals.LogTag, "AddCondition Failed with error " + error); - throw CalendarErrorFactory.GetException(error); - } - } - - /// - /// Adds a condition for the long type. - /// - /// The operator type - /// The property ID to add a condition - /// The match flag - /// The match value - /// Thrown when an invoked method is not supported - /// Thrown when one of the arguments provided to a method is not valid - public void AddCondition(LogicalOperator logicalOperator, uint propertyId, IntegerMatchType matchType, long matchValue) - { - int error = Interop.Filter.AddOperator(_filterHandle, logicalOperator); - if (CalendarError.None != (CalendarError)error) - { - Log.Error(Globals.LogTag, "AddCondition Failed with error " + error); - throw CalendarErrorFactory.GetException(error); - } - - error = Interop.Filter.AddLong(_filterHandle, propertyId, matchType, matchValue); - if (CalendarError.None != (CalendarError)error) - { - Log.Error(Globals.LogTag, "AddCondition Failed with error " + error); - throw CalendarErrorFactory.GetException(error); - } - } - - /// - /// Adds a condition for the double type. - /// - /// The operator type - /// The property ID to add a condition - /// The match flag - /// The match value - /// Thrown when an invoked method is not supported - /// Thrown when one of the arguments provided to a method is not valid - public void AddCondition(LogicalOperator logicalOperator, uint propertyId, IntegerMatchType matchType, double matchValue) - { - int error = Interop.Filter.AddOperator(_filterHandle, logicalOperator); - if (CalendarError.None != (CalendarError)error) - { - Log.Error(Globals.LogTag, "AddCondition Failed with error " + error); - throw CalendarErrorFactory.GetException(error); - } - - error = Interop.Filter.AddDouble(_filterHandle, propertyId, matchType, matchValue); - if (CalendarError.None != (CalendarError)error) - { - Log.Error(Globals.LogTag, "AddCondition Failed with error " + error); - throw CalendarErrorFactory.GetException(error); - } - } - - /// - /// Adds a condition for the CalendarTime type. - /// - /// The operator type - /// The property ID to add a condition - /// The match flag - /// The match value - /// Thrown when an invoked method is not supported - /// Thrown when one of the arguments provided to a method is not valid - public void AddCondition(LogicalOperator logicalOperator, uint propertyId, IntegerMatchType matchType, CalendarTime matchValue) - { - int error = Interop.Filter.AddOperator(_filterHandle, logicalOperator); - if (CalendarError.None != (CalendarError)error) - { - Log.Error(Globals.LogTag, "AddCondition Failed with error " + error); - throw CalendarErrorFactory.GetException(error); - } - - Interop.Record.DateTime time = CalendarRecord.ConvertCalendarTimeToStruct(matchValue); - error = Interop.Filter.AddCalendarTime(_filterHandle, propertyId, matchType, time); - if (CalendarError.None != (CalendarError)error) - { - Log.Error(Globals.LogTag, "AddCondition Failed with error " + error); - throw CalendarErrorFactory.GetException(error); - } - } - - /// - /// Adds a child filter to a parent filter. - /// - /// The operator type - /// The child filter - /// Thrown when an invoked method is not supported - /// Thrown when one of the arguments provided to a method is not valid - public void AddFilter(LogicalOperator logicalOperator, CalendarFilter filter) - { - int error = Interop.Filter.AddOperator(_filterHandle, logicalOperator); - if (CalendarError.None != (CalendarError)error) - { - Log.Error(Globals.LogTag, "AddCondition Failed with error " + error); - throw CalendarErrorFactory.GetException(error); - } - - error = Interop.Filter.AddFilter(_filterHandle, filter._filterHandle); - if (CalendarError.None != (CalendarError)error) - { - Log.Error(Globals.LogTag, "AddFilter Failed with error " + error); - throw CalendarErrorFactory.GetException(error); - } - } - } -} diff --git a/src/Tizen.Pims.Calendar/Tizen.Pims.Calendar/CalendarList.cs b/src/Tizen.Pims.Calendar/Tizen.Pims.Calendar/CalendarList.cs deleted file mode 100644 index c462db98b..000000000 --- a/src/Tizen.Pims.Calendar/Tizen.Pims.Calendar/CalendarList.cs +++ /dev/null @@ -1,252 +0,0 @@ -/* - * 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.Pims.Calendar -{ - /// - /// A list of records with the same type. - /// - public class CalendarList:IDisposable - { - private Int64 _memoryPressure = 20; - internal int _count = -1; - internal IntPtr _listHandle; - - internal CalendarList(IntPtr handle) - { - _listHandle = handle; - - _memoryPressure += this.Count * CalendarViews.Record.AverageSize; - GC.AddMemoryPressure(_memoryPressure); - } - - /// - /// Creates a calendar list. - /// - /// Thrown when an invoked method is not supported - /// Thrown when failed due to out of memory - public CalendarList() - { - int error = Interop.List.Create(out _listHandle); - if (CalendarError.None != (CalendarError)error) - { - Log.Error(Globals.LogTag, "CalendarList Failed with error " + error); - throw CalendarErrorFactory.GetException(error); - } - GC.AddMemoryPressure(_memoryPressure); - } - - /// - /// The count of the calendar entity. - /// - /// The count of calendar entity. - public int Count - { - get - { - if (_count == -1) - { - int count = -1; - int error = Interop.List.GetCount(_listHandle, out count); - if (CalendarError.None != (CalendarError)error) - { - Log.Error(Globals.LogTag, "GetCount Failed with error " + error); - } - _count = count; - } - return _count; - } - } - - /// - /// Destroy CalendarList resource. - /// - ~CalendarList() - { - Dispose(false); - } - -#region IDisposable Support - private bool disposedValue = false; // To detect redundant calls - - /// - /// Disposes of the resources (other than memory) used by the CalendarList. - /// - /// true to release both managed and unmanaged resources; false to release only unmanaged resources. - protected virtual void Dispose(bool disposing) - { - if (!disposedValue) - { - Log.Debug(Globals.LogTag, "Dispose :" + disposing); - - int error = Interop.List.Destroy(_listHandle, true); - if (CalendarError.None != (CalendarError)error) - { - Log.Error(Globals.LogTag, "Destroy Failed with error " + error); - throw CalendarErrorFactory.GetException(error); - } - disposedValue = true; - GC.RemoveMemoryPressure(_memoryPressure); - } - } - - /// - /// Releases all resources used by the CalendarList. - /// It should be called after having finished using of the object. - /// - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } -#endregion - - /// - /// Adds a record to the calendar list. - /// - /// The record to be added - /// Thrown when an invoked method is not supported - /// Thrown when one of the arguments provided to a method is not valid - public void AddRecord(CalendarRecord record) - { - int error = Interop.List.Add(_listHandle, record._recordHandle); - if (CalendarError.None != (CalendarError)error) - { - Log.Error(Globals.LogTag, "AddRecord Failed with error " + error); - throw CalendarErrorFactory.GetException(error); - } - record._disposedValue = true; - _count = -1; - _memoryPressure += CalendarViews.Record.AverageSize; - } - - /// - /// Removes a record from the calendar list. - /// - /// The record to be removed - /// Thrown when an invoked method is not supported - /// Thrown when one of the arguments provided to a method is not valid - public void RemoveRecord(CalendarRecord record) - { - int error = Interop.List.Remove(_listHandle, record._recordHandle); - if (CalendarError.None != (CalendarError)error) - { - Log.Error(Globals.LogTag, "RemoveRecord Failed with error " + error); - throw CalendarErrorFactory.GetException(error); - } - record._disposedValue = false; - _count = -1; - _memoryPressure -= CalendarViews.Record.AverageSize; - } - - /// - /// Retrieves a record from the calendar list. - /// - /// - /// calendar record - /// - public CalendarRecord GetCurrentRecord() - { - IntPtr handle; - int error = Interop.List.GetCurrentRecordP(_listHandle, out handle); - if (CalendarError.None != (CalendarError)error) - { - Log.Error(Globals.LogTag, "GetCurrentRecord Failed with error " + error); - throw CalendarErrorFactory.GetException(error); - } - return new CalendarRecord(handle, true); - } - - /// - /// Moves a calendar list to the previous position. - /// - /// - /// if cursor is moved to the end, it returns false. - /// - public bool MovePrevious() - { - int error = Interop.List.Prev(_listHandle); - if (CalendarError.None == (CalendarError)error) - { - return true; - } - else if (this.Count > 0 && CalendarError.NoData == (CalendarError)error) - { - Log.Debug(Globals.LogTag, "Nodata MovePrevious " + error); - return false; - } - else - { - Log.Error(Globals.LogTag, "MovePrevious Failed with error " + error); - throw CalendarErrorFactory.GetException(error); - } - } - - /// - /// Moves a calendar list to the next position. - /// - /// - /// if cursor is moved to the end, it returns false. - /// - public bool MoveNext() - { - int error = Interop.List.Next(_listHandle); - if (CalendarError.None == (CalendarError)error) - { - return true; - } - else if (this.Count > 0 && CalendarError.NoData == (CalendarError)error) - { - Log.Debug(Globals.LogTag, "Nodata MoveNext" + error); - return false; - } - else - { - Log.Error(Globals.LogTag, "MoveNext Failed with error " + error); - throw CalendarErrorFactory.GetException(error); - } - } - - /// - /// Moves a calendar list to the first position. - /// - public void MoveFirst() - { - int error = Interop.List.First(_listHandle); - if (CalendarError.None != (CalendarError)error) - { - Log.Error(Globals.LogTag, "MoveFirst Failed with error " + error); - throw CalendarErrorFactory.GetException(error); - } - } - - /// - /// Moves a calendar list to the last position. - /// - public void MoveLast() - { - int error = Interop.List.Last(_listHandle); - if (CalendarError.None != (CalendarError)error) - { - Log.Error(Globals.LogTag, "MoveLast Failed with error " + error); - throw CalendarErrorFactory.GetException(error); - } - } - - } -} diff --git a/src/Tizen.Pims.Calendar/Tizen.Pims.Calendar/CalendarManager.cs b/src/Tizen.Pims.Calendar/Tizen.Pims.Calendar/CalendarManager.cs deleted file mode 100644 index d289ec457..000000000 --- a/src/Tizen.Pims.Calendar/Tizen.Pims.Calendar/CalendarManager.cs +++ /dev/null @@ -1,98 +0,0 @@ -/* - * 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.Pims.Calendar -{ - /// - /// A class for managing calendar information. It allows applications to use calendar service. - /// - public class CalendarManager : IDisposable - { - private CalendarDatabase _db = null; - - /// - /// Create a manager. - /// - /// Thrown when method failed due to invalid operation - public CalendarManager() - { - int error = Interop.Service.Connect(); - if (CalendarError.None != (CalendarError)error) - { - Log.Error(Globals.LogTag, "Connect Failed with error " + error); - throw CalendarErrorFactory.GetException(error); - } - _db = new CalendarDatabase(); - } - - /// - /// Destroy CalendarManager resource. - /// - ~CalendarManager() - { - Dispose(false); - } - -#region IDisposable Support - /// To detect redundant calls - private bool disposedValue = false; - - /// - /// Disposes of the resources (other than memory) used by the CalendarManager. - /// - /// true to release both managed and unmanaged resources; false to release only unmanaged resources. - protected virtual void Dispose(bool disposing) - { - if (!disposedValue) - { - Log.Debug(Globals.LogTag, "Dispose :" + disposing); - - int error = Interop.Service.Disconnect(); - if (CalendarError.None != (CalendarError)error) - { - Log.Error(Globals.LogTag, "Disconnect Failed with error " + error); - throw CalendarErrorFactory.GetException(error); - } - disposedValue = true; - } - } - - /// - /// Releases all resources used by the CalendarManager. - /// It should be called after having finished using of the object. - /// - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } -#endregion - - /// - /// Get database. - /// - /// The database instance - public CalendarDatabase Database - { - get - { - return _db; - } - } - } -} diff --git a/src/Tizen.Pims.Calendar/Tizen.Pims.Calendar/CalendarQuery.cs b/src/Tizen.Pims.Calendar/Tizen.Pims.Calendar/CalendarQuery.cs deleted file mode 100644 index 5ddf14906..000000000 --- a/src/Tizen.Pims.Calendar/Tizen.Pims.Calendar/CalendarQuery.cs +++ /dev/null @@ -1,161 +0,0 @@ -/* - * 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.Diagnostics.CodeAnalysis; - -namespace Tizen.Pims.Calendar -{ - /// - /// A query is used to retrieve data which satisfies given criteria. - /// - /// - /// A query is used to retrieve calendar data which satisfies a given criteria, - /// such as an integer property being greater than a given value, - /// or a string property containing a given substring. - /// A query needs a filter which can set the conditions for the search. - /// - public class CalendarQuery:IDisposable - { - internal IntPtr _queryHandle; - - /// - /// Creates a query. - /// - /// The view URI of a query - /// Thrown when an invoked method is not supported - /// Thrown when one of the arguments provided to a method is not valid - /// Thrown when failed due to out of memory - [SuppressMessage("Microsoft.Design", "CA1054:UriParametersShouldNotBeStrings")] - public CalendarQuery(string viewUri) - { - int error = Interop.Query.Create(viewUri, out _queryHandle); - if (CalendarError.None != (CalendarError)error) - { - Log.Error(Globals.LogTag, "CalendarQuery Failed with error " + error); - throw CalendarErrorFactory.GetException(error); - } - } - - internal CalendarQuery(IntPtr handle) - { - _queryHandle = handle; - } - - /// - /// Destructor - /// - ~CalendarQuery() - { - Dispose(false); - } - -#region IDisposable Support - private bool disposedValue = false; - - /// - /// Disposes of the resources (other than memory) used by the CalendarQuery. - /// - /// true to release both managed and unmanaged resources; false to release only unmanaged resources. - protected virtual void Dispose(bool disposing) - { - if (!disposedValue) - { - Log.Debug(Globals.LogTag, "Dispose :" + disposing); - - int error = Interop.Query.Destroy(_queryHandle); - if (CalendarError.None != (CalendarError)error) - { - Log.Error(Globals.LogTag, "CalendarQueryDestroy Failed with error " + error); - throw CalendarErrorFactory.GetException(error); - } - disposedValue = true; - } - } - - /// - /// Releases all resources used by the CalendarQuery. - /// It should be called after having finished using of the object. - /// - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } -#endregion - - /// - /// Adds property IDs for projection. - /// - /// The property ID array - /// Thrown when one of the arguments provided to a method is not valid - public void SetProjection(uint[] propertyIdArray) - { - int error = Interop.Query.SetProjection(_queryHandle, propertyIdArray, propertyIdArray.Length); - if (CalendarError.None != (CalendarError)error) - { - Log.Error(Globals.LogTag, "SetProjection Failed with error " + error); - throw CalendarErrorFactory.GetException(error); - } - } - - /// - /// Sets the "distinct" option for projection. - /// - /// If true it is set, otherwise if false it is unset - /// Thrown when one of the arguments provided to a method is not valid - public void SetDistinct(bool set) - { - int error = Interop.Query.SetDistinct(_queryHandle, set); - if (CalendarError.None != (CalendarError)error) - { - Log.Error(Globals.LogTag, "SetDistinct Failed with error " + error); - throw CalendarErrorFactory.GetException(error); - } - } - - /// - /// Sets the filter for a query. - /// - /// The filter - /// Thrown when one of the arguments provided to a method is not valid - public void SetFilter(CalendarFilter filter) - { - int error = Interop.Query.SetFilter(_queryHandle, filter._filterHandle); - if (CalendarError.None != (CalendarError)error) - { - Log.Error(Globals.LogTag, "SetFilter Failed with error " + error); - throw CalendarErrorFactory.GetException(error); - } - } - - /// - /// Sets the sort mode for a query. - /// - /// The property ID to sort - /// If true it sorts in the ascending order, otherwise if false it sorts in the descending order - /// Thrown when one of the arguments provided to a method is not valid - public void SetSort(uint propertyId, bool isAscending) - { - int error = Interop.Query.SetSort(_queryHandle, propertyId, isAscending); - if (CalendarError.None != (CalendarError)error) - { - Log.Error(Globals.LogTag, "SetSort Failed with error " + error); - throw CalendarErrorFactory.GetException(error); - } - } - } -} diff --git a/src/Tizen.Pims.Calendar/Tizen.Pims.Calendar/CalendarRecord.cs b/src/Tizen.Pims.Calendar/Tizen.Pims.Calendar/CalendarRecord.cs deleted file mode 100644 index 7d458e65e..000000000 --- a/src/Tizen.Pims.Calendar/Tizen.Pims.Calendar/CalendarRecord.cs +++ /dev/null @@ -1,463 +0,0 @@ -/* - * 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; -using System.Diagnostics.CodeAnalysis; - -namespace Tizen.Pims.Calendar -{ - /// - /// A record represents an actual record in the database - /// - /// - /// A record represents an actual record in the database, - /// but you can also consider it a piece of information, such as an alarm, attendee and extended. - /// A record can be a complex set of data, containing other data. - /// For example, a calendar record contains the alarm property, which is a reference to an alarm record. - /// An alarm record could belong to a event record, - /// and its alarm id property is set to the identifier of the corresponding event. - /// In this case, the alarm is the child record of the event and the event is the parent record. - /// - public class CalendarRecord : IDisposable - { - internal string _uri; - internal uint _id; - private Int64 _memoryPressure = CalendarViews.Record.AverageSize; - internal IntPtr _recordHandle; - - internal CalendarRecord(IntPtr handle) - { - _recordHandle = handle; - - IntPtr viewUri; - int error = Interop.Record.GetUriPointer(handle, out viewUri); - if (CalendarError.None != (CalendarError)error) - { - Log.Error(Globals.LogTag, "GetUriPointer Failed with error " + error); - throw CalendarErrorFactory.GetException(error); - } - _uri = Marshal.PtrToStringAnsi(viewUri); - GC.AddMemoryPressure(_memoryPressure); - } - - internal CalendarRecord(IntPtr handle, bool disposedValue) - { - _recordHandle = handle; - _disposedValue = disposedValue; - - IntPtr viewUri; - int error = Interop.Record.GetUriPointer(handle, out viewUri); - if (CalendarError.None != (CalendarError)error) - { - Log.Error(Globals.LogTag, "GetUriPointer Failed with error " + error); - throw CalendarErrorFactory.GetException(error); - } - _uri = Marshal.PtrToStringAnsi(viewUri); - if (!_disposedValue) - GC.AddMemoryPressure(_memoryPressure); - } - - internal CalendarRecord(IntPtr handle, int id) - { - _recordHandle = handle; - _id = (uint)id; - - IntPtr viewUri; - int error = Interop.Record.GetUriPointer(handle, out viewUri); - if (CalendarError.None != (CalendarError)error) - { - Log.Error(Globals.LogTag, "GetUriPointer Failed with error " + error); - throw CalendarErrorFactory.GetException(error); - } - _uri = Marshal.PtrToStringAnsi(viewUri); - GC.AddMemoryPressure(_memoryPressure); - } - - /// - /// Creates a record. - /// - /// The view URI - /// Thrown when an invoked method is not supported - /// Thrown when one of the arguments provided to a method is not valid - /// Thrown when failed due to out of memory - [SuppressMessage("Microsoft.Design", "CA1054:UriParametersShouldNotBeStrings")] - public CalendarRecord(string viewUri) - { - int error = 0; - error = Interop.Record.Create(viewUri, out _recordHandle); - if (CalendarError.None != (CalendarError)error) - { - Log.Error(Globals.LogTag, "CalendarRecord Failed with error " + error); - throw CalendarErrorFactory.GetException(error); - } - _uri = viewUri; - GC.AddMemoryPressure(_memoryPressure); - } - - /// - /// Destructor - /// - ~CalendarRecord() - { - Dispose(false); - } - -#region IDisposable Support - /// To detect redundant calls - internal bool _disposedValue = false; - - /// - /// Disposes of the resources (other than memory) used by the CalendarRecord. - /// - /// true to release both managed and unmanaged resources; false to release only unmanaged resources. - protected virtual void Dispose(bool disposing) - { - if (!_disposedValue) - { - Log.Debug(Globals.LogTag, "Dispose :" + disposing); - - int error = Interop.Record.Destroy(_recordHandle, false); - if (CalendarError.None != (CalendarError)error) - { - Log.Error(Globals.LogTag, "Destroy Failed with error " + error); - throw CalendarErrorFactory.GetException(error); - } - _disposedValue = true; - GC.RemoveMemoryPressure(_memoryPressure); - } - } - - /// - /// Releases all resources used by the CalendarRecord. - /// It should be called after having finished using of the object. - /// - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } -#endregion - - internal static Interop.Record.DateTime ConvertCalendarTimeToStruct(CalendarTime value) - { - Interop.Record.DateTime time = new Interop.Record.DateTime(); - time.type = value._type; - - if ((int)CalendarTime.Type.Utc == value._type) - { - DateTime epoch = new DateTime(1970, 1, 1, 0, 0, 0); - time.utime = (value.UtcTime.Ticks - epoch.Ticks) / 10000000; - } - else - { - time.year = value.LocalTime.Year; - time.month = value.LocalTime.Month; - time.mday = value.LocalTime.Day; - time.hour = value.LocalTime.Hour; - time.minute = value.LocalTime.Minute; - time.second = value.LocalTime.Second; - } - return time; - } - - internal static CalendarTime ConvertIntPtrToCalendarTime(Interop.Record.DateTime time) - { - CalendarTime value; - if ((int)CalendarTime.Type.Utc == time.type) - { - DateTime epoch = new DateTime(1970, 1, 1, 0, 0, 0); - value = new CalendarTime(time.utime * 10000000 + epoch.Ticks); - } - else - { - value = new CalendarTime(time.year, time.month, time.mday, time.hour, time.minute, time.second); - } - value._type = time.type; - return value; - } - - /// - /// Makes a clone of a record. - /// - /// - /// A cloned record - /// - /// Thrown when failed due to out of memory - public CalendarRecord Clone() - { - IntPtr _clonedRecordHandle; - int error = Interop.Record.Clone(_recordHandle, out _clonedRecordHandle); - if (CalendarError.None != (CalendarError)error) - { - Log.Error(Globals.LogTag, "Clone Failed with error " + error); - throw CalendarErrorFactory.GetException(error); - } - return new CalendarRecord(_clonedRecordHandle, (int)_id); - } - - /// - /// Get record URI. - /// - /// The URI of the record - [SuppressMessage("Microsoft.Design", "CA1056:UriPropertiesShouldNotBeStrings")] - public string Uri - { - get - { - return _uri; - } - } - - /// - /// Gets a object from a record. - /// - /// The property ID - /// - /// The value of the property corresponding to property id. - /// - /// Thrown when one of the arguments provided to a method is not valid - public T Get(uint propertyId) - { - object parsedValue = null; - if (typeof(T) == typeof(string)) - { - string val; - int error = Interop.Record.GetString(_recordHandle, propertyId, out val); - if (CalendarError.None != (CalendarError)error) - { - Log.Error(Globals.LogTag, "Get String Failed [" + error + "]" + String.Format("{0:X}", propertyId)); - throw CalendarErrorFactory.GetException(error); - } - parsedValue = Convert.ChangeType(val, typeof(T)); - } - else if (typeof(T) == typeof(int)) - { - int val; - int error = Interop.Record.GetInteger(_recordHandle, propertyId, out val); - if (CalendarError.None != (CalendarError)error) - { - Log.Error(Globals.LogTag, "Get Intger Failed [" + error + "]" + String.Format("{0:X}", propertyId)); - throw CalendarErrorFactory.GetException(error); - } - parsedValue = Convert.ChangeType(val, typeof(T)); - } - else if (typeof(T) == typeof(long)) - { - long val; - int error = Interop.Record.GetLli(_recordHandle, propertyId, out val); - if (CalendarError.None != (CalendarError)error) - { - Log.Error(Globals.LogTag, "Get Long Failed [" + error + "]" + String.Format("{0:X}", propertyId)); - throw CalendarErrorFactory.GetException(error); - } - parsedValue = Convert.ChangeType(val, typeof(T)); - } - else if (typeof(T) == typeof(double)) - { - double val; - int error = Interop.Record.GetDouble(_recordHandle, propertyId, out val); - if (CalendarError.None != (CalendarError)error) - { - Log.Error(Globals.LogTag, "Get Double Failed [" + error + "]" + String.Format("{0:X}", propertyId)); - throw CalendarErrorFactory.GetException(error); - } - parsedValue = Convert.ChangeType(val, typeof(T)); - } - else if (typeof(T) == typeof(CalendarTime)) - { - Interop.Record.DateTime time; - int error = Interop.Record.GetCalendarTime(_recordHandle, propertyId, out time); - if (CalendarError.None != (CalendarError)error) - { - Log.Error(Globals.LogTag, "Get CalendarTime Failed [" + error + "]" + String.Format("{0:X}", propertyId)); - throw CalendarErrorFactory.GetException(error); - } - CalendarTime val = ConvertIntPtrToCalendarTime(time); - parsedValue = Convert.ChangeType(val, typeof(T)); - } - else - { - Log.Error(Globals.LogTag, "Not supported Data T/ype"); - throw CalendarErrorFactory.GetException((int)CalendarError.NotSupported); - } - return (T)parsedValue; - } - - /// - /// Sets a value of the property to a record. - /// - /// The property ID - /// value - /// Thrown when one of the arguments provided to a method is not valid - public void Set(uint propertyId, T value) - { - if (typeof(T) == typeof(string)) - { - string val = Convert.ToString(value); - int error = Interop.Record.SetString(_recordHandle, propertyId, val); - if (CalendarError.None != (CalendarError)error) - { - Log.Error(Globals.LogTag, "Set String Failed [" + error + "]" + String.Format("{0:X}", propertyId)); - throw CalendarErrorFactory.GetException(error); - } - } - else if (typeof(T) == typeof(int)) - { - int val = Convert.ToInt32(value); - int error = Interop.Record.SetInteger(_recordHandle, propertyId, val); - if (CalendarError.None != (CalendarError)error) - { - Log.Error(Globals.LogTag, "Set Integer Failed [" + error + "]" + String.Format("{0:X}", propertyId)); - throw CalendarErrorFactory.GetException(error); - } - } - else if (typeof(T) == typeof(long)) - { - long val = Convert.ToInt64(value); - int error = Interop.Record.SetLli(_recordHandle, propertyId, val); - if (CalendarError.None != (CalendarError)error) - { - Log.Error(Globals.LogTag, "Set Long Failed [" + error + "]" + String.Format("{0:X}", propertyId)); - throw CalendarErrorFactory.GetException(error); - } - } - else if (typeof(T) == typeof(double)) - { - double val = Convert.ToDouble(value); - int error = Interop.Record.SetDouble(_recordHandle, propertyId, val); - if (CalendarError.None != (CalendarError)error) - { - Log.Error(Globals.LogTag, "Set Double Failed [" + error + "]" + String.Format("{0:X}", propertyId)); - throw CalendarErrorFactory.GetException(error); - } - } - else if (typeof(T) == typeof(CalendarTime)) - { - CalendarTime time = (CalendarTime)Convert.ChangeType(value, typeof(CalendarTime)); - Interop.Record.DateTime val = ConvertCalendarTimeToStruct(time); - int error = Interop.Record.SetCalendarTime(_recordHandle, propertyId, val); - if (CalendarError.None != (CalendarError)error) - { - Log.Error(Globals.LogTag, "Set CalendarTime Failed [" + error + "]" + String.Format("{0:X}", propertyId)); - throw CalendarErrorFactory.GetException(error); - } - } - else - { - Log.Error(Globals.LogTag, "Not supported Data T/ype"); - throw CalendarErrorFactory.GetException((int)CalendarError.NotSupported); - } - } - - /// - /// Adds a child record to the parent record. - /// - /// The property ID - /// The child record - /// Thrown when one of the arguments provided to a method is not valid - public void AddChildRecord(uint propertyId, CalendarRecord childRecord) - { - int error = Interop.Record.AddChildRecord(_recordHandle, propertyId, childRecord._recordHandle); - if (CalendarError.None != (CalendarError)error) - { - Log.Error(Globals.LogTag, "AddChildRecord Failed [" + error + "]" + String.Format("{0:X}", propertyId)); - throw CalendarErrorFactory.GetException(error); - } - childRecord._disposedValue = true; - } - - /// - /// Removes a child record from the parent record. - /// - /// The property ID - /// The child record - /// Thrown when one of the arguments provided to a method is not valid - public void RemoveChildRecord(uint propertyId, CalendarRecord childRecord) - { - int error = Interop.Record.RemoveChildRecord(_recordHandle, propertyId, childRecord._recordHandle); - if (CalendarError.None != (CalendarError)error) - { - Log.Error(Globals.LogTag, "RemoveChildRecord Failed [" + error + "]" + String.Format("{0:X}", propertyId)); - throw CalendarErrorFactory.GetException(error); - } - childRecord._disposedValue = false; - } - - /// - /// Gets a child record from the parent record - /// - /// The property ID - /// - /// The number of child records corresponding to property ID - /// - /// Thrown when one of the arguments provided to a method is not valid - public int GetChildRecordCount(uint propertyId) - { - int count = 0; - int error = Interop.Record.GetChildRecordCount(_recordHandle, propertyId, out count); - if (CalendarError.None != (CalendarError)error) - { - Log.Error(Globals.LogTag, "GetChildRecordCount Failed [" + error + "]" + String.Format("{0:X}", propertyId)); - throw CalendarErrorFactory.GetException(error); - } - return count; - } - - /// - /// Gets a child record from the parent record - /// - /// The property ID - /// The child record index - /// - /// The record - /// - /// Thrown when one of the arguments provided to a method is not valid - public CalendarRecord GetChildRecord(uint propertyId, int index) - { - IntPtr handle; - - int error = Interop.Record.GetChildRecordPointer(_recordHandle, propertyId, index, out handle); - if (CalendarError.None != (CalendarError)error) - { - Log.Error(Globals.LogTag, "GetChildRecord Failed [" + error + "]" + String.Format("{0:X}", propertyId)); - throw CalendarErrorFactory.GetException(error); - } - return new CalendarRecord(handle, true); - } - - /// - /// Clones a child record list corresponding to property ID - /// - /// The property ID - /// - /// the record list - /// - /// Thrown when one of the arguments provided to a method is not valid - public CalendarList CloneChildRecordList(uint propertyId) - { - IntPtr listHandle; - int error = Interop.Record.CloneChildRecordList(_recordHandle, propertyId, out listHandle); - if (CalendarError.None != (CalendarError)error) - { - Log.Error(Globals.LogTag, "CloneChildRecordList Failed with [" + error + "]" + String.Format("{0:X}", propertyId)); - throw CalendarErrorFactory.GetException(error); - } - CalendarList list = new CalendarList(listHandle); - return list; - } - } -} diff --git a/src/Tizen.Pims.Calendar/Tizen.Pims.Calendar/CalendarReminder.cs b/src/Tizen.Pims.Calendar/Tizen.Pims.Calendar/CalendarReminder.cs deleted file mode 100644 index f5e376061..000000000 --- a/src/Tizen.Pims.Calendar/Tizen.Pims.Calendar/CalendarReminder.cs +++ /dev/null @@ -1,104 +0,0 @@ -/* - * 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.Pims.Calendar -{ - /// - /// A class for reminder for event. - /// - /// - /// The client who wants to be alerted at specific time should register MIME("application/x-tizen.calendar.reminder") type in manifest.xml file. - /// - public class CalendarReminder:IDisposable - { -#region IDisposable Support - private bool disposedValue = false; - - internal CalendarReminder() - { - } - - /// - /// Disposes of the resources (other than memory) used by the CalendarReminder. - /// - /// true to release both managed and unmanaged resources; false to release only unmanaged resources. - protected virtual void Dispose(bool disposing) - { - if (!disposedValue) - { - disposedValue = true; - } - } - - /// - /// Releases all resources used by the CalendarReminder. - /// It should be called after having finished using of the object. - /// - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } -#endregion - - private static readonly Interop.Reminder.ReminderAlertedCallback _reminderAlertedCallback = (string param, IntPtr userData) => - { - ReminderAlertedEventArgs args = new ReminderAlertedEventArgs(param); - s_reminderAlerted?.Invoke(null, args); - }; - - private static event EventHandler s_reminderAlerted; - - /// - /// Reminder event is triggered when the alarm is alerted. - /// - public static event EventHandler ReminderAlerted - { - add - { - Log.Debug(Globals.LogTag, "Add Reminder"); - - if (s_reminderAlerted == null) - { - int error = Interop.Reminder.Add(_reminderAlertedCallback, IntPtr.Zero); - if (CalendarError.None != (CalendarError)error) - { - Log.Error(Globals.LogTag, "Add reminder Failed with error " + error); - } - } - s_reminderAlerted += value; - } - - remove - { - Log.Debug(Globals.LogTag, "Remove Reminder"); - - s_reminderAlerted -= value; - if (s_reminderAlerted == null) - { - /// _reminderAlertedCallback is removed by .Net Core - int error = Interop.Reminder.Remove(_reminderAlertedCallback, IntPtr.Zero); - if (CalendarError.None != (CalendarError)error) - { - Log.Error(Globals.LogTag, "Remove reminder Failed with error " + error); - } - } - } - } - } -} diff --git a/src/Tizen.Pims.Calendar/Tizen.Pims.Calendar/CalendarStructs.cs b/src/Tizen.Pims.Calendar/Tizen.Pims.Calendar/CalendarStructs.cs deleted file mode 100644 index 002ecba4a..000000000 --- a/src/Tizen.Pims.Calendar/Tizen.Pims.Calendar/CalendarStructs.cs +++ /dev/null @@ -1,138 +0,0 @@ -/* - * 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.Pims.Calendar -{ - /// - /// A class for time to set, get or calculate. - /// - public class CalendarTime:IComparable - { - internal int _type; - internal const int milliseconds = 10000000; - - /// - /// Enumeration for the time type. - /// - public enum Type - { - /// - /// UTC time - /// - Utc, - /// - /// Local time - /// - Local - } - - /// - /// Create UTC CalendarTime - /// - /// UTC epoch time. 0 is 1971/01/01 - public CalendarTime(long utcTime) - { - _type = (int)Type.Utc; - utcTime -= utcTime % milliseconds; /* delete millisecond */ - UtcTime = new DateTime(utcTime); - } - - /// - /// Create Local CalendarTime - /// - /// year - /// month - /// day - /// hour - /// minute - /// second - /// Thrown when one of the arguments provided to a method is not valid - /// Thrown when failed due to out of memory - public CalendarTime(int year, int month, int day, int hour, int minute, int second) - { - _type = (int)Type.Local; - LocalTime = new DateTime(year, month, day, hour, minute, second); - } - - /// - /// Get UtcTime - /// - /// The Utc time - public DateTime UtcTime - { - get; - } - - /// - /// Get localTime - /// - /// The Localtime - public DateTime LocalTime - { - get; - } - - /// - /// Compare CalendarTime - /// - /// The CalendarTime to be compared - /// - /// A 32-bit signed integer that indicates the relative order of the objects being compared. - /// - /// Thrown when one of the arguments provided to a method is not valid - /// Thrown when failed due to out of memory - public int CompareTo(CalendarTime other) - { - if (_type != other._type) - { - Log.Error(Globals.LogTag, "Not to compare with different type"); - throw CalendarErrorFactory.GetException((int)CalendarError.InvalidParameter); - } - - if (_type == (int)Type.Utc) - return UtcTime.CompareTo(other.UtcTime); - else - return LocalTime.CompareTo(other.LocalTime); - } - - /// - /// Equals CalendarTime - /// - /// The CalendarTime to be compared - /// - /// A 32-bit signed integer that indicates the relative order of the objects being compared. - /// - /// Thrown when one of the arguments provided to a method is not valid - /// Thrown when failed due to out of memory - public override bool Equals(object obj) - { - var other = obj as CalendarTime; - if (_type != other._type) - { - Log.Error(Globals.LogTag, "Not to compare with different type"); - throw CalendarErrorFactory.GetException((int)CalendarError.InvalidParameter); - } - - if (_type == (int)Type.Utc) - return UtcTime.Equals(other.UtcTime); - else - return LocalTime.Equals(other.LocalTime); - } - } -} - diff --git a/src/Tizen.Pims.Calendar/Tizen.Pims.Calendar/CalendarTypes.cs b/src/Tizen.Pims.Calendar/Tizen.Pims.Calendar/CalendarTypes.cs deleted file mode 100644 index 4beb345ac..000000000 --- a/src/Tizen.Pims.Calendar/Tizen.Pims.Calendar/CalendarTypes.cs +++ /dev/null @@ -1,455 +0,0 @@ -/* -* 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. -*/ - -namespace Tizen.Pims.Calendar -{ - /// - /// This class provides enumerations about calendar information. - /// - /// - /// Most enumerations are based on vcalendar, icalendar(ver 2.0) specification. - /// https://www.ietf.org/rfc/rfc2445.txt - /// - public static class CalendarTypes - { - /// - /// Enumeration for Default book - /// - public enum DefaultBook - { - /// - /// Default event calendar book. - /// - Event, - /// - /// Default Todo calendar book. - /// - Todo, - /// - /// Default Birthday calendar book. - /// - Birthday, - } - - /// - /// Enumeration for Store type - /// - public enum StoreType - { - /// - /// Book type - /// - Book, - /// - /// Event type - /// - Event, - /// - /// Todo type - /// - Todo, - } - - /// - /// Enumeration for the book mode. - /// - public enum BookMode - { - /// - /// All modules can read and write records of this calendar_book - /// - Default, - /// - /// All modules can only read records of this calendar book - /// - ReadOnly, - } - - /// - /// Enumeration for the event status. - /// - public enum EventStatus - { - /// - /// No status - /// - None = 0x01, - /// - /// The event is tentative - /// - Tentative = 0x02, - /// - /// The event is confirmed - /// - Confirmed = 0x04, - /// - /// The event is cancelled - /// - Cancelled = 0x08, - } - - /// - /// Enumeration for for the status of a to-do. - /// - public enum TodoStatus - { - /// - /// No status - /// - None = 0x0100, - /// - /// Needs action status - /// - NeedAction = 0x0200, - /// - /// Completed status - /// - Completed = 0x0400, - /// - /// Work in process status - /// - InProcess = 0x0800, - /// - /// Cancelled status - /// - Cancelled = 0x1000, - } - - /// - /// Enumeration for the busy status of an event. - /// - public enum BusyStatus - { - /// - /// The free status - /// - Free, - /// - /// The busy status - /// - Busy, - /// - /// The unavailable status - /// - Unavailable, - /// - /// The tentative status - /// - Tentative, - } - - /// - /// Enumeration for the calendar sensitivity type. - /// - public enum Sensitivity - { - /// - /// Public Sensitivity - /// - Public, - /// - /// Private Sensitivity - /// - Private, - /// - /// Confidential Sensitivity - /// - Confidential, - } - - /// - /// Enumeration for the meeting status. - /// - public enum MeetingStatus - { - /// - /// No meeting - /// - NoMeeting, - /// - /// Meeting exists - /// - Meeting, - /// - /// Meeting received - /// - Received, - /// - /// Meeting cancelled - /// - Cancelled, - } - - /// - /// Enumeration for the calendar event item's priority - /// - public enum Priority - { - /// - /// No priority - /// - None = 0x01, - /// - /// Low priority - /// - High = 0x02, - /// - /// Normal priority - /// - Normal = 0x04, - /// - /// High priority - /// - Low = 0x08, - } - - /// - /// Enumeration for the frequency of an event's recurrence. - /// - public enum Recurrence - { - /// - /// No recurrence event - /// - None, - /// - /// An event occurs every day - /// - Daily, - /// - /// An event occurs on the same day of every week. According to the week flag, the event will recur every day of the week - /// - Weekly, - /// - /// An event occurs on the same day of every month - /// - Monthly, - /// - /// An event occurs on the same day of every year - /// - Yearly, - } - - /// - /// Enumeration for the range type. - /// - public enum RangeType - { - /// - /// Range until - /// - Until, - /// - /// Range count - /// - Count, - /// - /// No range - /// - None, - } - - /// - /// Enumeration for the system type. - /// - public enum SystemType - { - /// - /// Locale's default calendar - /// - Default, - /// - /// Locale's default calendar - /// - Gregorian, - /// - /// East Asian lunisolar calendar - /// - Lunisolar, - } - - /// - /// Enumeration for the alarm time unit type of an event, such as minutes, hours, days, and so on. - /// - public enum TickUnit - { - /// - /// No reminder set - /// - None = -1, - /// - /// Specific in seconds - /// - Specific = 1, - /// - /// Alarm time unit in minutes - /// - Minute = 60, - /// - /// Alarm time unit in hours - /// - Hour = 3600, - /// - /// Alarm time unit in days - /// - Day = 86400, - /// - /// Alarm time unit in weeks - /// - Week = 604800, - } - - /// - /// Enumeration for weekdays. - /// - public enum WeekDay - { - /// - /// Sunday - /// - Sunday = 1, - /// - /// Monday - /// - Monday, - /// - /// Tuesday - /// - Tuesday, - /// - /// Wednesday - /// - Wednesday, - /// - /// Thursday - /// - Thursday, - /// - /// Friday - /// - Friday, - /// - /// Saturday - /// - Saturday, - } - - /// - /// Enumeration to specify the type of calendar user specified by the property. - /// - public enum Cutype - { - /// - /// An individual - /// - Individual, - /// - /// A group of individuals - /// - Group, - /// - /// A physical resource - /// - Resource, - /// - /// A room resource - /// - Room, - /// - /// Otherwise not known - /// - Unknown, - } - - /// - /// Enumeration for the attendee role. - /// - public enum AttendeeRole - { - /// - /// Participation is required - /// - ReqParticipant, - /// - /// Accepted status - /// - OptParticipant, - /// - /// Non-Participant - /// - NonParticipant, - /// - /// Chairperson - /// - Chair, - } - - /// - /// Enumeration for the attendee status. - /// - public enum AttendeeStatus - { - /// - /// Pending status - /// - Pending, - /// - /// Accepted status - /// - Accepted, - /// - /// Declined status - /// - Declined, - /// - /// Tentative status - /// - Tentative, - /// - /// Delegated status - /// - Delegated, - /// - /// Completed status - /// - Completed, - /// - /// In process status - /// - InProcess, - } - - /// - /// Enumeration for the alarm action. - /// - public enum Action - { - /// - /// Audio action - /// - Audio, - /// - /// Display action - /// - Display, - /// - /// Email action - /// - Email, - } - } -} - diff --git a/src/Tizen.Pims.Calendar/Tizen.Pims.Calendar/CalendarVcalendar.cs b/src/Tizen.Pims.Calendar/Tizen.Pims.Calendar/CalendarVcalendar.cs deleted file mode 100644 index d79e6c5e6..000000000 --- a/src/Tizen.Pims.Calendar/Tizen.Pims.Calendar/CalendarVcalendar.cs +++ /dev/null @@ -1,104 +0,0 @@ -/* - * 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.Pims.Calendar -{ - /// - /// Parsing vcalendar file callback function. - /// - /// The record - /// true to continue with the next iteration of the loop, otherwise false to break out of the loop - public delegate bool ParseCallback(CalendarRecord record); - - /// - /// A class for parsing and composing vCalendar. - /// - /// - /// It's based on the vCalendar v2.0 specification - /// - public static class CalendarVcalendar - { - /// - /// Retrieves a vcalendar stream from a calendar list. - /// - /// The calendar list - /// - /// The composed stream. - /// - /// Thrown when one of the arguments provided to a method is not valid - /// Thrown when failed due to out of memory - public static string Compose(CalendarList list) - { - string stream; - int error = Interop.Vcalendar.Compose(list._listHandle, out stream); - if (CalendarError.None != (CalendarError)error) - { - Log.Error(Globals.LogTag, "MakeVcalendar Failed with error " + error); - throw CalendarErrorFactory.GetException(error); - } - return stream; - } - - /// - /// Retrieves all calendars from a vcalendar stream. - /// - /// The vcalendar stream - /// - /// the record list - /// - /// Thrown when one of the arguments provided to a method is not valid - /// Thrown when failed due to out of memory - public static CalendarList Parse(string stream) - { - int error = 0; - IntPtr _listHandle; - error = Interop.Vcalendar.Parse(stream, out _listHandle); - if (CalendarError.None != (CalendarError)error) - { - Log.Error(Globals.LogTag, "Parse Vcalendar Failed [" + error + "]"); - throw CalendarErrorFactory.GetException(error); - } - return new CalendarList(_listHandle); - } - - /// - /// Parse vcalendar file with ForEach - /// - /// The file path of the vCalendar stream file - /// he callback function to invoke - /// Thrown when method failed due to invalid operation - /// Thrown when one of the arguments provided to a method is not valid - /// Thrown when failed due to out of memory - public static void ParseForEach(string path, ParseCallback callback) - { - int error = 0; - - Interop.Vcalendar.ParseCallback cb = (IntPtr handle, IntPtr data) => - { - return callback(new CalendarRecord(handle, true)); - }; - - error = Interop.Vcalendar.ParseForEach(path, cb, IntPtr.Zero); - if (CalendarError.None != (CalendarError)error) - { - Log.Error(Globals.LogTag, "Parse ForEach Vcalendar Failed [" + error + "]"); - throw CalendarErrorFactory.GetException(error); - } - } - } -} diff --git a/src/Tizen.Pims.Calendar/Tizen.Pims.Calendar/CalendarViews.cs b/src/Tizen.Pims.Calendar/Tizen.Pims.Calendar/CalendarViews.cs deleted file mode 100644 index d711daa4f..000000000 --- a/src/Tizen.Pims.Calendar/Tizen.Pims.Calendar/CalendarViews.cs +++ /dev/null @@ -1,1500 +0,0 @@ -/* - * 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.Diagnostics.CodeAnalysis; - -namespace Tizen.Pims.Calendar -{ - /// - /// This namespace provides information about views with properties. - /// - /// - /// s are provided to access and handle entities. A view is a structure, which has property elements. - /// A view is almost the same as a database "VIEW", which limits access and guarantees performance. - /// A "record" represents a single row of the views. - /// A record can have basic properties of five types: integer, string, long, double, CalendarTime. - /// - namespace CalendarViews - { - internal static class Property - { - /// data type mask 0x0FF00000 - private const uint Mask = 0xFF000000; - private const uint Book = 0x01000000; - private const uint Event = 0x02000000; - private const uint Todo = 0x03000000; - private const uint Timezone = 0x04000000; - private const uint Attendee = 0x05000000; - private const uint Alarm = 0x06000000; - private const uint InstanceUtimeBook = 0x07000000; - private const uint InstanceLocaltimeBook = 0x08000000; - private const uint UpdateInfo = 0x09000000; - private const uint Extended = 0x0A000000; - private const uint InstanceUtimeBookExtended = 0x0B000000; - private const uint InstanceLocaltimeBookExtended = 0x0C000000; - - private const uint DataTypeMask = 0x000FF000; - private const uint DataTypeInteger = 0x00001000; - private const uint DataTypeString = 0x00002000; - private const uint DataTypeDouble = 0x00003000; - private const uint DataTypeLong = 0x00004000; - private const uint DataTypeCaltime = 0x00005000; - private const uint DataTypeRecord = 0x00006000; - - /// property : mask 0x0000F000 - private const uint PropertyMask = 0x00F00000; - private const uint PropertyFilter = 0x00100000; - private const uint PropertyProjection = 0x00200000; - private const uint PropertyReadOnly = 0x00300000; - - internal enum Id : uint - { - None, - - /// book - BookId = (Book|DataTypeInteger|PropertyReadOnly), - BookUid = (Book|DataTypeString) + 1, - BookName = (Book|DataTypeString) + 2, - BookDescription = (Book|DataTypeString) + 3, - BookColor = (Book|DataTypeString) + 4, - BookLocation = (Book|DataTypeString) + 5, - BookVisibility = (Book|DataTypeInteger) + 6, - BookSyncEvent = (Book|DataTypeInteger) + 7, - BookAccountId = (Book|DataTypeInteger) + 8, - BookStoreType = (Book|DataTypeInteger) + 9, - BookSyncData1 = (Book|DataTypeString) + 10, - BookSyncData2 = (Book|DataTypeString) + 11, - BookSyncData3 = (Book|DataTypeString) + 12, - BookSyncData4 = (Book|DataTypeString) + 13, - BookMode = (Book|DataTypeInteger) + 14, - - /// Event - EventId = (Event|DataTypeInteger|PropertyReadOnly), - EventBookId = (Event|DataTypeInteger) + 1, - EventSummary = (Event|DataTypeString) + 2, - EventDescription = (Event|DataTypeString) + 3, - EventLocation = (Event|DataTypeString) + 4, - EventCategories = (Event|DataTypeString) + 5, - EventExdate = (Event|DataTypeString) + 6, - EventEventStatus = (Event|DataTypeInteger) + 7, - EventPriority = (Event|DataTypeInteger) + 8, - EventTimezone = (Event|DataTypeInteger) + 9, - EventContactId = (Event|DataTypeInteger) + 10, - EventBusyStatus = (Event|DataTypeInteger) + 11, - EventSensitivity = (Event|DataTypeInteger) + 12, - EventUid = (Event|DataTypeString) + 13, - EventOrganizerName = (Event|DataTypeString) + 14, - EventOrganizerEmail = (Event|DataTypeString) + 15, - EventMeetingStatus = (Event|DataTypeInteger) + 16, - EventOriginalEventId = (Event|DataTypeInteger) + 17, - EventLatitude = (Event|DataTypeDouble) + 18, - EventLongitude = (Event|DataTypeDouble) + 19, - EventEmailId = (Event|DataTypeInteger) + 20, - EventCreatedTime = (Event|DataTypeLong) + 21, - EventLastModifiedTime = (Event|DataTypeLong|PropertyReadOnly) + 22, - EventIsDeleted = (Event|DataTypeInteger|PropertyReadOnly) + 23, - EventFreq = (Event|DataTypeInteger) + 24, - EventRangeType = (Event|DataTypeInteger) + 25, - EventUntil = (Event|DataTypeCaltime) + 26, - EventCount = (Event|DataTypeInteger) + 27, - EventInterval = (Event|DataTypeInteger) + 28, - EventBysecond = (Event|DataTypeString) + 29, - EventByminute = (Event|DataTypeString) + 30, - EventByhour = (Event|DataTypeString) + 31, - EventByday = (Event|DataTypeString) + 32, - EventBymonthday = (Event|DataTypeString) + 33, - EventByyearday = (Event|DataTypeString) + 34, - EventByweekno = (Event|DataTypeString) + 35, - EventBymonth = (Event|DataTypeString) + 36, - EventBysetpos = (Event|DataTypeString) + 37, - EventWkst = (Event|DataTypeInteger) + 38, - EventRecurrenceId = (Event|DataTypeString) + 39, - EventRdate = (Event|DataTypeString) + 40, - EventHasAttendee = (Event|DataTypeInteger|PropertyReadOnly) + 41, - EventHasAlarm = (Event|DataTypeInteger|PropertyReadOnly) + 42, - EventSyncData1 = (Event|DataTypeString) + 43, - EventSyncData2 = (Event|DataTypeString) + 44, - EventSyncData3 = (Event|DataTypeString) + 45, - EventSyncData4 = (Event|DataTypeString) + 46, - EventStart = (Event|DataTypeCaltime) + 47, - EventEnd = (Event|DataTypeCaltime) + 48, - EventAlarm = (Event|DataTypeRecord) + 49, - EventAttendee = (Event|DataTypeRecord) + 50, - EventCalendarSystemType = (Event|DataTypeInteger) + 51, - EventStartTzid = (Event|DataTypeString) + 52, - EventEndTzid = (Event|DataTypeString) + 53, - EventException = (Event|DataTypeRecord) + 54, - EventExtended = (Event|DataTypeRecord) + 55, - EventIsAllday = (Event|DataTypeInteger|PropertyReadOnly) + 56, - EventLinkCount = (Event|DataTypeInteger|PropertyReadOnly) + 57, - EventLinkBaseId = (Event|DataTypeInteger|PropertyReadOnly) + 58, - - /// Todo - TodoId = (Todo|DataTypeInteger|PropertyReadOnly), - TodoBookId = (Todo|DataTypeInteger) + 1, - TodoSummary = (Todo|DataTypeString) + 2, - TodoDescription = (Todo|DataTypeString) + 3, - TodoLocation = (Todo|DataTypeString) + 4, - TodoCategories = (Todo|DataTypeString) + 5, - TodoStatus = (Todo|DataTypeInteger) + 6, - TodoPriority = (Todo|DataTypeInteger) + 7, - TodoSensitivity = (Todo|DataTypeInteger) + 8, - TodoUid = (Todo|DataTypeString) + 9, - TodoLatitude = (Todo|DataTypeDouble) + 10, - TodoLongitude = (Todo|DataTypeDouble) + 11, - TodoProgress = (Todo|DataTypeInteger) + 12, - TodoCreatedTime = (Todo|DataTypeLong) + 13, - TodoLastModifiedTime = (Todo|DataTypeLong|PropertyReadOnly) + 14, - TodoCompletedTime = (Todo|DataTypeLong) + 15, - TodoIsDeleted = (Todo|DataTypeInteger|PropertyReadOnly) + 16, - TodoFreq = (Todo|DataTypeInteger) + 17, - TodoRangeType = (Todo|DataTypeInteger) + 18, - TodoUntil = (Todo|DataTypeCaltime) + 19, - TodoCount = (Todo|DataTypeInteger) + 20, - TodoInterval = (Todo|DataTypeInteger) + 21, - TodoBysecond = (Todo|DataTypeString) + 22, - TodoByminute = (Todo|DataTypeString) + 23, - TodoByhour = (Todo|DataTypeString) + 24, - TodoByday = (Todo|DataTypeString) + 25, - TodoBymonthday = (Todo|DataTypeString) + 26, - TodoByyearday = (Todo|DataTypeString) + 27, - TodoByweekno = (Todo|DataTypeString) + 28, - TodoBymonth = (Todo|DataTypeString) + 29, - TodoBysetpos = (Todo|DataTypeString) + 30, - TodoWkst = (Todo|DataTypeInteger) + 31, - TodoHasAlarm = (Todo|DataTypeInteger|PropertyReadOnly) + 32, - TodoSyncData1 = (Todo|DataTypeString) + 33, - TodoSyncData2 = (Todo|DataTypeString) + 34, - TodoSyncData3 = (Todo|DataTypeString) + 35, - TodoSyncData4 = (Todo|DataTypeString) + 36, - TodoStart = (Todo|DataTypeCaltime) + 37, - TodoDue = (Todo|DataTypeCaltime) + 38, - TodoAlarm = (Todo|DataTypeRecord) + 39, - TodoStartTzid = (Todo|DataTypeString) + 40, - TodoDueTzid = (Todo|DataTypeString) + 41, - TodoOrganizerName = (Todo|DataTypeString) + 42, - TodoOrganizerEmail = (Todo|DataTypeString) + 43, - TodoHasAttendee = (Todo|DataTypeInteger|PropertyReadOnly) + 44, - TodoAttendee = (Todo|DataTypeRecord) + 45, - TodoExtended = (Todo|DataTypeRecord) + 46, - TodoIsAllday = (Todo|DataTypeInteger|PropertyReadOnly) + 47, - - /// Timezone - TimezoneId = (Timezone|DataTypeInteger|PropertyReadOnly), - TimezoneTzOffsetFromGmt = (Timezone|DataTypeInteger) + 1, - TimezoneStandardName = (Timezone|DataTypeString) + 2, - TimezoneStdStartMonth = (Timezone|DataTypeInteger) + 3, - TimezoneStdStartPositionOfWeek = (Timezone|DataTypeInteger) + 4, - TimezoneStdStartDay = (Timezone|DataTypeInteger) + 5, - TimezoneStdStartHour = (Timezone|DataTypeInteger) + 6, - TimezoneStandardBias = (Timezone|DataTypeInteger) + 7, - TimezoneDayLightName = (Timezone|DataTypeString) + 8, - TimezoneDayLightStartMonth = (Timezone|DataTypeInteger) + 9, - TimezoneDayLightStartPositionOfWeek = (Timezone|DataTypeInteger) + 10, - TimezoneDayLightStartDay = (Timezone|DataTypeInteger) + 11, - TimezoneDayLightStartHour = (Timezone|DataTypeInteger) + 12, - TimezoneDayLightBias = (Timezone|DataTypeInteger) + 13, - TimezoneCalendarId = (Timezone|DataTypeInteger) + 14, - - AttendeeNumber = (Attendee|DataTypeString), - AttendeeCutype = (Attendee|DataTypeInteger) + 1, - AttendeeCtIndex = (Attendee|DataTypeInteger) + 2, - AttendeeUid = (Attendee|DataTypeString) + 3, - AttendeeGroup = (Attendee|DataTypeString) + 4, - AttendeeEmail = (Attendee|DataTypeString) + 5, - AttendeeRole = (Attendee|DataTypeInteger) + 6, - AttendeeStatus = (Attendee|DataTypeInteger) + 7, - AttendeeRsvp = (Attendee|DataTypeInteger) + 8, - AttendeeDelegateeUri = (Attendee|DataTypeString) + 9, - AttendeeDelegatorUri = (Attendee|DataTypeString) + 10, - AttendeeName = (Attendee|DataTypeString) + 11, - AttendeeMember = (Attendee|DataTypeString) + 12, - AttendeeParentId = (Attendee|DataTypeInteger|PropertyReadOnly) + 13, - - AlarmTick = (Alarm|DataTypeInteger), - AlarmTickUnit = (Alarm|DataTypeInteger) + 1, - AlarmDescription = (Alarm|DataTypeString) + 2, - AlarmParentId = (Alarm|DataTypeInteger|PropertyReadOnly) + 3, - AlarmSummary = (Alarm|DataTypeString) + 4, - AlarmAction = (Alarm|DataTypeInteger) + 5, - AlarmAttach = (Alarm|DataTypeString) + 6, - AlarmAlarm = (Alarm|DataTypeCaltime) + 7, - - InstanceUtimeBookEventId = (InstanceUtimeBook|DataTypeInteger), - InstanceUtimeBookStart = (InstanceUtimeBook|DataTypeCaltime) + 1, - InstanceUtimeBookEnd = (InstanceUtimeBook|DataTypeCaltime) + 2, - InstanceUtimeBookSummary = (InstanceUtimeBook|DataTypeString) + 3, - InstanceUtimeBookLocation = (InstanceUtimeBook|DataTypeString) + 4, - InstanceUtimeBookBookId = (InstanceUtimeBook|DataTypeInteger) + 5, - InstanceUtimeBookDescription = (InstanceUtimeBook|DataTypeString) + 6, - InstanceUtimeBookBusyStatus = (InstanceUtimeBook|DataTypeInteger) + 7, - InstanceUtimeBookEventStatus = (InstanceUtimeBook|DataTypeInteger) + 8, - InstanceUtimeBookPriority = (InstanceUtimeBook|DataTypeInteger) + 9, - InstanceUtimeBookSensitivity = (InstanceUtimeBook|DataTypeInteger) + 10, - InstanceUtimeBookHasRrule = (InstanceUtimeBook|DataTypeInteger) + 11, - InstanceUtimeBookLatitude = (InstanceUtimeBook|DataTypeDouble) + 12, - InstanceUtimeBookLongitude = (InstanceUtimeBook|DataTypeDouble) + 13, - InstanceUtimeBookHasAlarm = (InstanceUtimeBook|DataTypeInteger) + 14, - InstanceUtimeBookOriginalEventId = (InstanceUtimeBook|DataTypeInteger) + 15, - InstanceUtimeBookLastModifiedTime = (InstanceUtimeBook|DataTypeLong) + 16, - InstanceUtimeBookSyncData1 = (InstanceUtimeBook|DataTypeString) + 17, - - InstanceLocaltimeBookEventId = (InstanceLocaltimeBook|DataTypeInteger), - InstanceLocaltimeBookStart = (InstanceLocaltimeBook|DataTypeCaltime) + 1, - InstanceLocaltimeBookEnd = (InstanceLocaltimeBook|DataTypeCaltime) + 2, - InstanceLocaltimeBookSummary = (InstanceLocaltimeBook|DataTypeString) + 3, - InstanceLocaltimeBookLocation = (InstanceLocaltimeBook|DataTypeString) + 4, - InstanceLocaltimeBookBookId = (InstanceLocaltimeBook|DataTypeInteger) + 5, - InstanceLocaltimeBookDescription = (InstanceLocaltimeBook|DataTypeString) + 6, - InstanceLocaltimeBookBusyStatus = (InstanceLocaltimeBook|DataTypeInteger) + 7, - InstanceLocaltimeBookEventStatus = (InstanceLocaltimeBook|DataTypeInteger) + 8, - InstanceLocaltimeBookPriority = (InstanceLocaltimeBook|DataTypeInteger) + 9, - InstanceLocaltimeBookSensitivity = (InstanceLocaltimeBook|DataTypeInteger) + 10, - InstanceLocaltimeBookHasRrule = (InstanceLocaltimeBook|DataTypeInteger) + 11, - InstanceLocaltimeBookLatitude = (InstanceLocaltimeBook|DataTypeDouble) + 12, - InstanceLocaltimeBookLongitude = (InstanceLocaltimeBook|DataTypeDouble) + 13, - InstanceLocaltimeBookHasAlarm = (InstanceLocaltimeBook|DataTypeInteger) + 14, - InstanceLocaltimeBookOriginalEventId = (InstanceLocaltimeBook|DataTypeInteger) + 15, - InstanceLocaltimeBookLastModifiedTime = (InstanceLocaltimeBook|DataTypeLong) + 16, - InstanceLocaltimeBookSyncData1 = (InstanceLocaltimeBook|DataTypeString) + 17, - InstanceLocaltimeBookIsAllday = (InstanceLocaltimeBook|DataTypeInteger|PropertyReadOnly) + 18, - - InstanceUtimeBookExtendedEventId = (InstanceUtimeBookExtended|DataTypeInteger), - InstanceUtimeBookExtendedStart = (InstanceUtimeBookExtended|DataTypeCaltime) + 1, - InstanceUtimeBookExtendedEnd = (InstanceUtimeBookExtended|DataTypeCaltime) + 2, - InstanceUtimeBookExtendedSummary = (InstanceUtimeBookExtended|DataTypeString) + 3, - InstanceUtimeBookExtendedLocation = (InstanceUtimeBookExtended|DataTypeString) + 4, - InstanceUtimeBookExtendedBookId = (InstanceUtimeBookExtended|DataTypeInteger) + 5, - InstanceUtimeBookExtendedDescription = (InstanceUtimeBookExtended|DataTypeString) + 6, - InstanceUtimeBookExtendedBusyStatus = (InstanceUtimeBookExtended|DataTypeInteger) + 7, - InstanceUtimeBookExtendedEventStatus = (InstanceUtimeBookExtended|DataTypeInteger) + 8, - InstanceUtimeBookExtendedPriority = (InstanceUtimeBookExtended|DataTypeInteger) + 9, - InstanceUtimeBookExtendedSensitivity = (InstanceUtimeBookExtended|DataTypeInteger) + 10, - InstanceUtimeBookExtendedHasRrule = (InstanceUtimeBookExtended|DataTypeInteger) + 11, - InstanceUtimeBookExtendedLatitude = (InstanceUtimeBookExtended|DataTypeDouble) + 12, - InstanceUtimeBookExtendedLongitude = (InstanceUtimeBookExtended|DataTypeDouble) + 13, - InstanceUtimeBookExtendedHasAlarm = (InstanceUtimeBookExtended|DataTypeInteger) + 14, - InstanceUtimeBookExtendedOriginalEventId = (InstanceUtimeBookExtended|DataTypeInteger) + 15, - InstanceUtimeBookExtendedLastModifiedTime = (InstanceUtimeBookExtended|DataTypeLong) + 16, - InstanceUtimeBookExtendedSyncData1 = (InstanceUtimeBookExtended|DataTypeString) + 17, - InstanceUtimeBookExtendedOrganizerName = (InstanceUtimeBookExtended|DataTypeString) + 18, - InstanceUtimeBookExtendedCategories = (InstanceUtimeBookExtended|DataTypeString) + 19, - InstanceUtimeBookExtendedHasAttendee = (InstanceUtimeBookExtended|DataTypeInteger) + 20, - InstanceUtimeBookExtendedSyncData2 = (InstanceUtimeBookExtended|DataTypeString) + 21, - InstanceUtimeBookExtendedSyncData3 = (InstanceUtimeBookExtended|DataTypeString) + 22, - InstanceUtimeBookExtendedSyncData4 = (InstanceUtimeBookExtended|DataTypeString) + 23, - - InstanceLocaltimeBookExtendedEventId = (InstanceLocaltimeBookExtended|DataTypeInteger), - InstanceLocaltimeBookExtendedStart = (InstanceLocaltimeBookExtended|DataTypeCaltime) + 1, - InstanceLocaltimeBookExtendedEnd = (InstanceLocaltimeBookExtended|DataTypeCaltime) + 2, - InstanceLocaltimeBookExtendedSummary = (InstanceLocaltimeBookExtended|DataTypeString) + 3, - InstanceLocaltimeBookExtendedLocation = (InstanceLocaltimeBookExtended|DataTypeString) + 4, - InstanceLocaltimeBookExtendedBookId = (InstanceLocaltimeBookExtended|DataTypeInteger) + 5, - InstanceLocaltimeBookExtendedDescription = (InstanceLocaltimeBookExtended|DataTypeString) + 6, - InstanceLocaltimeBookExtendedBusyStatus = (InstanceLocaltimeBookExtended|DataTypeInteger) + 7, - InstanceLocaltimeBookExtendedEventStatus = (InstanceLocaltimeBookExtended|DataTypeInteger) + 8, - InstanceLocaltimeBookExtendedPriority = (InstanceLocaltimeBookExtended|DataTypeInteger) + 9, - InstanceLocaltimeBookExtendedSensitivity = (InstanceLocaltimeBookExtended|DataTypeInteger) + 10, - InstanceLocaltimeBookExtendedHasRrule = (InstanceLocaltimeBookExtended|DataTypeInteger) + 11, - InstanceLocaltimeBookExtendedLatitude = (InstanceLocaltimeBookExtended|DataTypeDouble) + 12, - InstanceLocaltimeBookExtendedLongitude = (InstanceLocaltimeBookExtended|DataTypeDouble) + 13, - InstanceLocaltimeBookExtendedHasAlarm = (InstanceLocaltimeBookExtended|DataTypeInteger) + 14, - InstanceLocaltimeBookExtendedOriginalEventId = (InstanceLocaltimeBookExtended|DataTypeInteger) + 15, - InstanceLocaltimeBookExtendedLastModifiedTime = (InstanceLocaltimeBookExtended|DataTypeLong) + 16, - InstanceLocaltimeBookExtendedSyncData1 = (InstanceLocaltimeBookExtended|DataTypeString) + 17, - InstanceLocaltimeBookExtendedOrganizerName = (InstanceLocaltimeBookExtended|DataTypeString) + 18, - InstanceLocaltimeBookExtendedCategories = (InstanceLocaltimeBookExtended|DataTypeString) + 19, - InstanceLocaltimeBookExtendedHasAttendee = (InstanceLocaltimeBookExtended|DataTypeInteger) + 20, - InstanceLocaltimeBookExtendedSyncData2 = (InstanceLocaltimeBookExtended|DataTypeString) + 21, - InstanceLocaltimeBookExtendedSyncData3 = (InstanceLocaltimeBookExtended|DataTypeString) + 22, - InstanceLocaltimeBookExtendedSyncData4 = (InstanceLocaltimeBookExtended|DataTypeString) + 23, - InstanceLocaltimeBookExtendedIsAllday = (InstanceLocaltimeBookExtended|DataTypeInteger|PropertyReadOnly) + 24, - - UpdateInfoId = (UpdateInfo|DataTypeInteger), - UpdateInfoCalendarId = (UpdateInfo|DataTypeInteger) + 1, - UpdateInfoType = (UpdateInfo|DataTypeInteger) + 2, - UpdateInfoVersion = (UpdateInfo|DataTypeInteger) + 3, - - ExtendedId = (Extended|DataTypeInteger|PropertyReadOnly), - ExtendedRecordId = (Extended|DataTypeInteger) + 1, - ExtendedRecordType = (Extended|DataTypeInteger) + 2, - ExtendedKey = (Extended|DataTypeString) + 3, - ExtendedValue = (Extended|DataTypeString) + 4, - } - } - - internal static class Record - { - ///average size - internal const uint AverageSize = 56; - } - - /// - /// Describes properties of a Book record. - /// - public static class Book - { - /// - /// Identifier of this calendar book view - /// - public const string Uri = "tizen.calendar_view.book"; - /// - /// DB record ID of the calendar book - /// - public const uint Id = (uint)Property.Id.BookId; - /// - /// Unique identifier - /// - public const uint Uid = (uint)Property.Id.BookUid; - /// - /// Calendar book name - /// - public const uint Name = (uint)Property.Id.BookName; - /// - /// Calendar book description - /// - public const uint Description = (uint)Property.Id.BookDescription; - /// - /// Calendar book color for UX - /// - public const uint Color = (uint)Property.Id.BookColor; - /// - /// Location of the event - /// - public const uint Location = (uint)Property.Id.BookLocation; - /// - /// Visibility of the calendar book for UX - /// - public const uint Visibility = (uint)Property.Id.BookVisibility; - /// - /// Currently NOT Used - /// - public const uint SyncEvent = (uint)Property.Id.BookSyncEvent; - /// - /// Account for this calendar - /// - public const uint AccountId = (uint)Property.Id.BookAccountId; - /// - /// Type of calendar contents(refer to the CalendarTypes.StoreType) - /// - public const uint StoreType = (uint)Property.Id.BookStoreType; - /// - /// Generic data for use by syncing - /// - public const uint SyncData1 = (uint)Property.Id.BookSyncData1; - /// - /// Generic data for use by syncing - /// - public const uint SyncData2 = (uint)Property.Id.BookSyncData2; - /// - /// Generic data for use by syncing - /// - public const uint SyncData3 = (uint)Property.Id.BookSyncData3; - /// - /// Generic data for use by syncing - /// - public const uint SyncData4 = (uint)Property.Id.BookSyncData4; - /// - /// Calendar book mode(refer to the CalendarTypes.BookMode) - /// - public const uint Mode = (uint)Property.Id.BookMode; - } - - /// - /// Describes properties of a Event record. - /// - [SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords")] - public static class Event - { - /// - /// Identifier of this event view - /// - public const string Uri = "tizen.calendar_view.event"; - /// - /// DB record ID of the event - /// - public const uint Id = (uint)Property.Id.EventId; - /// - /// ID of the calendar book to which the event belongs - /// - public const uint BookId = (uint)Property.Id.EventBookId; - /// - /// The short description of the event - /// - public const uint Summary = (uint)Property.Id.EventSummary; - /// - /// The description of the event - /// - public const uint Description = (uint)Property.Id.EventDescription; - /// - /// The location of the event - /// - public const uint Location = (uint)Property.Id.EventLocation; - /// - /// The category of the event. For example APPOINTMENT, BIRTHDAY - /// - public const uint Categories = (uint)Property.Id.EventCategories; - /// - /// The exception list of the event. If this event has a recurrence rule, the instance of the exdate is removed. Format is "YYYYMMDD"(allday event) or "YYYYMMDDTHHMMSS". Multiple exceptions can be included with a comma - /// - public const uint Exdate = (uint)Property.Id.EventExdate; - /// - /// The status of event(refer to the CalendarTypes.EventStatus). - /// - public const uint EventStatus = (uint)Property.Id.EventEventStatus; - /// - /// The priority of event(refer to the CalendarTypes.Priority). - /// - public const uint Priority = (uint)Property.Id.EventPriority; - /// - /// The timezone_id of the event if it exists. - /// - public const uint Timezone = (uint)Property.Id.EventTimezone; - /// - /// The person_id of the event if the event is a birthday. Refer to the contacts-service - /// - public const uint ContactId = (uint)Property.Id.EventContactId; - /// - /// The busy status of event(refer to the CalendarTypes.BusyStatus). - /// - public const uint BusyStatus = (uint)Property.Id.EventBusyStatus; - /// - /// The Sensitivity of event(refer to the CalendarTypes.Sensitivity). - /// - public const uint Sensitivity = (uint)Property.Id.EventSensitivity; - /// - /// The unique ID of the event - /// - public const uint Uid = (uint)Property.Id.EventUid; - /// - /// The name of organizer of the event - /// - public const uint OrganizerName = (uint)Property.Id.EventOrganizerName; - /// - /// The email address of the organizer of the event - /// - public const uint OrganizerEmail = (uint)Property.Id.EventOrganizerEmail; - /// - /// The meeting status of event(refer to the CalendarTypes.MeetingStatus). - /// - public const uint MeetingStatus = (uint)Property.Id.EventMeetingStatus; - /// - /// The ID of the original event if the event is an exception. - /// - public const uint OriginalEventId = (uint)Property.Id.EventOriginalEventId; - /// - /// The latitude of the location of the event - /// - public const uint Latitude = (uint)Property.Id.EventLatitude; - /// - /// The longitude of the location of the event - /// - public const uint Longitude = (uint)Property.Id.EventLongitude; - /// - /// ID of the email_id. Refer to the email-service. - /// - public const uint EmailId = (uint)Property.Id.EventEmailId; - /// - /// The time when the event is created - /// - public const uint CreatedTime = (uint)Property.Id.EventCreatedTime; - /// - /// The time when the event is updated - /// - public const uint LastModifiedTime = (uint)Property.Id.EventLastModifiedTime; - /// - /// Whether or not the event is deleted - /// - public const uint IsDeleted = (uint)Property.Id.EventIsDeleted; - /// - /// The frequent type of event recurrence(refer to the CalendarTypes.Recurrence). - /// - public const uint Freq = (uint)Property.Id.EventFreq; - /// - /// The range type of event recurrence(refer to the CalendarTypes.RangeType). - /// - public const uint RangeType = (uint)Property.Id.EventRangeType; - /// - /// The end time of the event recurrence. Only if this is used with RangeType.Until. - /// - public const uint Until = (uint)Property.Id.EventUntil; - /// - /// The count of the event recurrence. Only if this is used with RangeType.Count. - /// - public const uint Count = (uint)Property.Id.EventCount; - /// - /// The interval of the event recurrence - /// - public const uint Interval = (uint)Property.Id.EventInterval; - /// - /// The second list of the event recurrence. The value can be from 0 to 59. The list is separated by comma - /// - public const uint Bysecond = (uint)Property.Id.EventBysecond; - /// - /// The minute list of the event recurrence. The value can be from 0 to 59. The list is separated by commas - /// - public const uint Byminute = (uint)Property.Id.EventByminute; - /// - /// The hour list of the event recurrence. The value can be from 0 to 23. The list is separated by commas - /// - public const uint Byhour = (uint)Property.Id.EventByhour; - /// - /// The day list of the event recurrence. The value can be SU, MO, TU, WE, TH, FR, SA. The list is separated by commas. - /// - public const uint Byday = (uint)Property.Id.EventByday; - /// - /// The month day list of the event recurrence. The value can be from 1 to 31 and from -31 to -1. The list is separated by commas. - /// - public const uint Bymonthday = (uint)Property.Id.EventBymonthday; - /// - /// The year day list of the event recurrence. The value can be from 1 to 366 and from -366 to -1. The list is separated by commas - /// - public const uint Byyearday = (uint)Property.Id.EventByyearday; - /// - /// The week number list of the event recurrence. The value can be from 1 to 53 and from -53 to -1. The list is separated by commas - /// - public const uint Byweekno = (uint)Property.Id.EventByweekno; - /// - /// The month list of the event recurrence. The value can be from 1 to 12. The list is separated by commas - /// - public const uint Bymonth = (uint)Property.Id.EventBymonth; - /// - /// The position list of the event recurrence. The value can be from 1 to 366 and from -366 to -1. The list is separated by commas - /// - public const uint Bysetpos = (uint)Property.Id.EventBysetpos; - /// - /// The start day of the week(refer to the CalendarTypes.WeekDay). - /// - public const uint Wkst = (uint)Property.Id.EventWkst; - /// - /// RECURRENCE-ID of RFC #2445 - /// - public const uint RecurrenceId = (uint)Property.Id.EventRecurrenceId; - /// - /// RDATE of RFC #2445 - /// - public const uint Rdate = (uint)Property.Id.EventRdate; - /// - /// Whether or not the event has an attendee list - /// - public const uint HasAttendee = (uint)Property.Id.EventHasAttendee; - /// - /// Whether or not the event has an alarm list - /// - public const uint HasAlarm = (uint)Property.Id.EventHasAlarm; - /// - /// The sync data of the event. If developer need to save some information related to the event, they can use this property - /// - public const uint SyncData1 = (uint)Property.Id.EventSyncData1; - /// - /// The sync data of the event. If developer need to save some information related to the event, they can use this property - /// - public const uint SyncData2 = (uint)Property.Id.EventSyncData2; - /// - /// The sync data of the event. If developer need to save some information related to the event, they can use this property - /// - public const uint SyncData3 = (uint)Property.Id.EventSyncData3; - /// - /// The sync data of the event. If developer need to save some information related to the event, they can use this property - /// - public const uint SyncData4 = (uint)Property.Id.EventSyncData4; - /// - /// The start time of the event - /// - public const uint Start = (uint)Property.Id.EventStart; - /// - /// The end time of the event - /// - public const uint End = (uint)Property.Id.EventEnd; - /// - /// The alarm list of the event. - /// - public const uint Alarm = (uint)Property.Id.EventAlarm; - /// - /// The attendee list of the event. - /// - public const uint Attendee = (uint)Property.Id.EventAttendee; - /// - /// The Calendar system type(refer to the CalendarTypes.SystemType). - /// - public const uint CalendarSystemType = (uint)Property.Id.EventCalendarSystemType; - /// - /// The timezone of the start_time - /// - public const uint StartTzid = (uint)Property.Id.EventStartTzid; - /// - /// The timezone of the end_time - /// - public const uint EndTzid = (uint)Property.Id.EventEndTzid; - /// - /// The exception mod event list of the event - /// - public const uint Exception = (uint)Property.Id.EventException; - /// - /// The extended property list of the event. - /// - public const uint Extended = (uint)Property.Id.EventExtended; - /// - /// The event is an allday event or not - /// - public const uint IsAllday = (uint)Property.Id.EventIsAllday; - /// - /// The linked event count - /// - public const uint LinkCount = (uint)Property.Id.EventLinkCount; - /// - /// The event is an base linked event - /// - public const uint LinkBaseId = (uint)Property.Id.EventLinkBaseId; - } - - /// - /// Describes properties of a Todo record. - /// - public static class Todo - { - /// - /// Identifier of this todo view - /// - public const string Uri = "tizen.calendar_view.todo"; - /// - /// DB record ID of the todo - /// - public const uint Id = (uint)Property.Id.TodoId; - /// - /// ID of the calendar book to which the todo belongs - /// - public const uint BookId = (uint)Property.Id.TodoBookId; - /// - /// The short description of the todo - /// - public const uint Summary = (uint)Property.Id.TodoSummary; - /// - /// The description of the todo - /// - public const uint Description = (uint)Property.Id.TodoDescription; - /// - /// The location of the todo - /// - public const uint Location = (uint)Property.Id.TodoLocation; - /// - /// The category of the todo. i.g. APPOINTMENT, BIRTHDAY - /// - public const uint Categories = (uint)Property.Id.TodoCategories; - /// - /// The status of todo(refer to the CalendarTypes.TodoStatus). - /// - public const uint TodoStatus = (uint)Property.Id.TodoStatus; - /// - /// The Priority of todo(refer to the CalendarTypes.Priority). - /// - public const uint Priority = (uint)Property.Id.TodoPriority; - /// - /// The Sensitivity of todo(refer to the CalendarTypes.Sensitivity). - /// - public const uint Sensitivity = (uint)Property.Id.TodoSensitivity; - /// - /// The unique ID of the todo - /// - public const uint Uid = (uint)Property.Id.TodoUid; - /// - /// The latitude of the location of the todo - /// - public const uint Latitude = (uint)Property.Id.TodoLatitude; - /// - /// The longitude of the location of the todo - /// - public const uint Longitude = (uint)Property.Id.TodoLongitude; - /// - /// The progression of the todo. The value can be from 0 to 100 - /// - public const uint Progress = (uint)Property.Id.TodoProgress; - /// - /// The time when the todo is create - /// - public const uint CreatedTime = (uint)Property.Id.TodoCreatedTime; - /// - /// The time when the todo is updated - /// - public const uint LastModifiedTime = (uint)Property.Id.TodoLastModifiedTime; - /// - /// The time when the todo is completed - /// - public const uint CompletedTime = (uint)Property.Id.TodoCompletedTime; - /// - /// Whether or not the todo is deleted - /// - public const uint IsDeleted = (uint)Property.Id.TodoIsDeleted; - /// - /// The frequent type of todo recurrence(refer to the CalendarTypes.Recurrence). - /// - public const uint Freq = (uint)Property.Id.TodoFreq; - /// - /// The range type of todo recurrence(refer to the CalendarTypes.RangeType). - /// - public const uint RangeType = (uint)Property.Id.TodoRangeType; - /// - /// The end time of the todo recurrence. Only if this is used with RangeType.Until. - /// - public const uint Until = (uint)Property.Id.TodoUntil; - /// - /// The count of the todo recurrence. Only if this is used with RangeType.Count. - /// - public const uint Count = (uint)Property.Id.TodoCount; - /// - /// The interval of the todo recurrence - /// - public const uint Interval = (uint)Property.Id.TodoInterval; - /// - /// The second list of the todo recurrence. The value can be from 0 to 59. The list is separated by commas - /// - public const uint Bysecond = (uint)Property.Id.TodoBysecond; - /// - /// The minute list of the todo recurrence. The value can be from 0 to 59. The list is separated by commas - /// - public const uint Byminute = (uint)Property.Id.TodoByminute; - /// - /// The hour list of the todo recurrence. The value can be from 0 to 23. The list is separated by commas - /// - public const uint Byhour = (uint)Property.Id.TodoByhour; - /// - /// The day list of the todo recurrence. The value can be SU, MO, TU, WE, TH, FR, SA. The list is separated by commas - /// - public const uint Byday = (uint)Property.Id.TodoByday; - /// - /// The month day list of the todo recurrence. The value can be from 1 to 31 and from -31 to -1. The list is separated by commas - /// - public const uint Bymonthday = (uint)Property.Id.TodoBymonthday; - /// - /// The year day list of the todo recurrence. The value can be from 1 to 366 and from -366 to -1. The list is separated by commas - /// - public const uint Byyearday = (uint)Property.Id.TodoByyearday; - /// - /// The week number list of the todo recurrence. The value can be from 1 to 53 and from -53 to -1. The list is separated by commas - /// - public const uint Byweekno = (uint)Property.Id.TodoByweekno; - /// - /// The month list of the todo recurrence. The value can be from 1 to 12. The list is separated by commas - /// - public const uint Bymonth = (uint)Property.Id.TodoBymonth; - /// - /// The position list of the todo recurrence. The value can be from 1 to 366 and from -366 to -1. The list is separated by commas - /// - public const uint Bysetpos = (uint)Property.Id.TodoBysetpos; - /// - /// The start day of the week(refer to the CalendarTypes.WeekDay). - /// - public const uint Wkst = (uint)Property.Id.TodoWkst; - /// - /// Whether or not the todo has an alarm list - /// - public const uint HasAlarm = (uint)Property.Id.TodoHasAlarm; - /// - /// The sync data of the todo. If developers need to save some information related to the todo, they can use this property - /// - public const uint SyncData1 = (uint)Property.Id.TodoSyncData1; - /// - /// The sync data of the todo. If developers need to save some information related to the todo, they can use this property - /// - public const uint SyncData2 = (uint)Property.Id.TodoSyncData2; - /// - /// The sync data of the todo. If developers need to save some information related to the todo, they can use this property - /// - public const uint SyncData3 = (uint)Property.Id.TodoSyncData3; - /// - /// The sync data of the todo. If developers need to save some information related to the todo, they can use this property - /// - public const uint SyncData4 = (uint)Property.Id.TodoSyncData4; - /// - /// The start time of the todo - /// - public const uint Start = (uint)Property.Id.TodoStart; - /// - /// The due time of the todo - /// - public const uint Due = (uint)Property.Id.TodoDue; - /// - /// The alarm list of the todo. - /// - public const uint Alarm = (uint)Property.Id.TodoAlarm; - /// - /// The timezone of the start_time - /// - public const uint StartTzid = (uint)Property.Id.TodoStartTzid; - /// - /// The timezone of the due_time - /// - public const uint DueTzid = (uint)Property.Id.TodoDueTzid; - /// - /// The name of the organizer of the event - /// - public const uint OrganizerName = (uint)Property.Id.TodoOrganizerName; - /// - /// The email address of the organizer of the todo - /// - public const uint OrganizerEmail = (uint)Property.Id.TodoOrganizerEmail; - /// - /// Whether or not the todo has an attendee list - /// - public const uint HasAttendee = (uint)Property.Id.TodoHasAttendee; - /// - /// The attendee list of the todo. - /// - public const uint Attendee = (uint)Property.Id.TodoAttendee; - /// - /// The extended property list of the todo. - /// - public const uint Extended = (uint)Property.Id.TodoExtended; - /// - /// The todo is an allday event or not - /// - public const uint IsAllday = (uint)Property.Id.TodoIsAllday; - } - - /// - /// Describes properties of a Timezone record. - /// - public static class Timezone - { - /// - /// Identifier of this timezone view - /// - public const string Uri = "tizen.calendar_view.timezone"; - /// - /// DB record ID of the timezone - /// - public const uint Id = (uint)Property.Id.TimezoneId; - /// - /// UTC offset which is in use when the onset of this time zone observance begins. Valid values are -720(-12:00) to 840(+14:00) - /// - public const uint TzOffsetFromGmt = (uint)Property.Id.TimezoneTzOffsetFromGmt; - /// - /// Name of the Standard Time - /// - public const uint StandardName = (uint)Property.Id.TimezoneStandardName; - /// - /// Starting month of the Standard Time. Month is 0-based. eg, 0 for January - /// - public const uint StdStartMonth = (uint)Property.Id.TimezoneStdStartMonth; - /// - /// Starting day-of-week-in-month of the Standard Time. Day is 1-based - /// - public const uint StdStartPositionOfWeek = (uint)Property.Id.TimezoneStdStartPositionOfWeek; - /// - /// Starting day-of-week of the Standard Time. Valid values are 1(SUNDAY) to 7(SATURDAY) - /// - public const uint StdStartDay = (uint)Property.Id.TimezoneStdStartDay; - /// - /// Starting hour of the Standard Time. Valid values are 0 to 23 - /// - public const uint StdStartHour = (uint)Property.Id.TimezoneStdStartHour; - /// - /// The number of minutes added during the Standard Time - /// - public const uint StandardBias = (uint)Property.Id.TimezoneStandardBias; - /// - /// Name of Daylight - /// - public const uint DayLightName = (uint)Property.Id.TimezoneDayLightName; - /// - /// Starting month of Daylight. Month is 0-based. eg, 0 for January - /// - public const uint DayLightStartMonth = (uint)Property.Id.TimezoneDayLightStartMonth; - /// - /// Starting day-of-week-in-month of Daylight. Day is 1-based - /// - public const uint DayLightStartPositionOfWeek = (uint)Property.Id.TimezoneDayLightStartPositionOfWeek; - /// - /// Starting day-of-week of Daylight. Valid values are 1(SUNDAY) to 7(SATURDAY) - /// - public const uint DayLightStartDay = (uint)Property.Id.TimezoneDayLightStartDay; - /// - /// Starting hour of Daylight. Valid values are 0 to 23 - /// - public const uint DayLightStartHour = (uint)Property.Id.TimezoneDayLightStartHour; - /// - /// The number of minutes added during Daylight Time - /// - public const uint DayLightBias = (uint)Property.Id.TimezoneDayLightBias; - /// - /// DB record ID of a related calendar book - /// - public const uint CalendarId = (uint)Property.Id.TimezoneCalendarId; - } - - /// - /// Describes properties of a Attendee record. - /// - public static class Attendee - { - /// - /// Identifier of this calendar attendee view - /// - public const string Uri = "tizen.calendar_view.attendee"; - /// - /// The number of the attendee - /// - public const uint Number = (uint)Property.Id.AttendeeNumber; - /// - /// The type of attendee(refer to the CalendarTypes.Cutype). - /// - public const uint Cutype = (uint)Property.Id.AttendeeCutype; - /// - /// CtIndex - /// - public const uint CtIndex = (uint)Property.Id.AttendeeCtIndex; - /// - /// Unique identifier - /// - public const uint Uid = (uint)Property.Id.AttendeeUid; - /// - /// Group - /// - public const uint Group = (uint)Property.Id.AttendeeGroup; - /// - /// The email address of the attendee - /// - public const uint Email = (uint)Property.Id.AttendeeEmail; - /// - /// Attendee role(refer to the CalendarTypes.AttendeeRole). - /// - public const uint Role = (uint)Property.Id.AttendeeRole; - /// - /// Attendee status(refer to the CalendarTypes.AttendeeStatus). - /// - public const uint Status = (uint)Property.Id.AttendeeStatus; - /// - /// RSVP invitation reply (one of true, false) - /// - public const uint Rsvp = (uint)Property.Id.AttendeeRsvp; - /// - /// Delegatee (DELEGATED-TO) - /// - public const uint DelegateeUri = (uint)Property.Id.AttendeeDelegateeUri; - /// - /// Delegator (DELEGATED-FROM) - /// - public const uint DelegatorUri = (uint)Property.Id.AttendeeDelegatorUri; - /// - /// Attendee name - /// - public const uint Name = (uint)Property.Id.AttendeeName; - /// - /// Group that the attendee belongs to - /// - public const uint Member = (uint)Property.Id.AttendeeMember; - /// - /// Event/TODO that the attendee belongs to - /// - public const uint ParentId = (uint)Property.Id.AttendeeParentId; - } - - /// - /// Describes properties of a Alarm record. - /// - public static class Alarm - { - /// - /// Identifier of this calendar alarm view - /// - public const string Uri = "tizen.calendar_view.alarm"; - /// - /// The number of unit before start time. This MUST be used with one of TickUnit. - /// - public const uint Tick = (uint)Property.Id.AlarmTick; - /// - /// Reminder tick time unit(refer to the CalendarTypes.TickUnit). - /// - public const uint TickUnit = (uint)Property.Id.AlarmTickUnit; - /// - /// Alarm description - /// - public const uint Description = (uint)Property.Id.AlarmDescription; - /// - /// Event that the alarm belongs to - /// - public const uint ParentId = (uint)Property.Id.AlarmParentId; - /// - /// Alarm summary - /// - public const uint Summary = (uint)Property.Id.AlarmSummary; - /// - /// Action of alarm(refer to the CalendarTypes.Action). - /// - public const uint Action = (uint)Property.Id.AlarmAction; - /// - /// Alarm tone path - /// - public const uint Attach = (uint)Property.Id.AlarmAttach; - /// - /// The alarm time - /// - public const uint AlarmTime = (uint)Property.Id.AlarmAlarm; - } - - /// - /// Describes properties of a InstanceUtimeBook record. - /// - /// Read only view - public static class InstanceUtimeBook - { - /// - /// Identifier of this instance utime book - /// - public const string Uri = "tizen.calendar_view.instance_utime/book"; - /// - /// Event id - /// - public const uint EventId = (uint)Property.Id.InstanceUtimeBookEventId; - /// - /// Start time - /// - public const uint Start = (uint)Property.Id.InstanceUtimeBookStart; - /// - /// End time - /// - public const uint End = (uint)Property.Id.InstanceUtimeBookEnd; - /// - /// Summary - /// - public const uint Summary = (uint)Property.Id.InstanceUtimeBookSummary; - /// - /// Location - /// - public const uint Location = (uint)Property.Id.InstanceUtimeBookLocation; - /// - /// Book id - /// - public const uint BookId = (uint)Property.Id.InstanceUtimeBookBookId; - /// - /// Description - /// - public const uint Description = (uint)Property.Id.InstanceUtimeBookDescription; - /// - /// BusyStatus - /// - public const uint BusyStatus = (uint)Property.Id.InstanceUtimeBookBusyStatus; - /// - /// EventStatus - /// - public const uint EventStatus = (uint)Property.Id.InstanceUtimeBookEventStatus; - /// - /// Priority - /// - public const uint Priority = (uint)Property.Id.InstanceUtimeBookPriority; - /// - /// Sensitivity - /// - public const uint Sensitivity = (uint)Property.Id.InstanceUtimeBookSensitivity; - /// - /// HasRrule - /// - public const uint HasRrule = (uint)Property.Id.InstanceUtimeBookHasRrule; - /// - /// Latitude - /// - public const uint Latitude = (uint)Property.Id.InstanceUtimeBookLatitude; - /// - /// Longitude - /// - public const uint Longitude = (uint)Property.Id.InstanceUtimeBookLongitude; - /// - /// HasAlarm - /// - public const uint HasAlarm = (uint)Property.Id.InstanceUtimeBookHasAlarm; - /// - /// OriginalEventId - /// - public const uint OriginalEventId = (uint)Property.Id.InstanceUtimeBookOriginalEventId; - /// - /// LastModifiedtime - /// - public const uint LastModifiedtime = (uint)Property.Id.InstanceUtimeBookLastModifiedTime; - /// - /// SyncData1 - /// - public const uint SyncData1 = (uint)Property.Id.InstanceUtimeBookSyncData1; - } - - /// - /// Describes properties of a InstanceLocaltimeBook record. - /// - /// Read only view - public static class InstanceLocaltimeBook - { - /// - /// Uri - /// - public const string Uri = "tizen.calendar_view.instance_localtime/book"; - /// - /// EventId - /// - public const uint EventId = (uint)Property.Id.InstanceLocaltimeBookEventId; - /// - /// Start - /// - public const uint Start = (uint)Property.Id.InstanceLocaltimeBookStart; - /// - /// End - /// - public const uint End = (uint)Property.Id.InstanceLocaltimeBookEnd; - /// - /// Summary - /// - public const uint Summary = (uint)Property.Id.InstanceLocaltimeBookSummary; - /// - /// Location - /// - public const uint Location = (uint)Property.Id.InstanceLocaltimeBookLocation; - /// - /// BookId - /// - public const uint BookId = (uint)Property.Id.InstanceLocaltimeBookBookId; - /// - /// Description - /// - public const uint Description = (uint)Property.Id.InstanceLocaltimeBookDescription; - /// - /// BusyStatus - /// - public const uint BusyStatus = (uint)Property.Id.InstanceLocaltimeBookBusyStatus; - /// - /// EventStatus - /// - public const uint EventStatus = (uint)Property.Id.InstanceLocaltimeBookEventStatus; - /// - /// Priority - /// - public const uint Priority = (uint)Property.Id.InstanceLocaltimeBookPriority; - /// - /// Sensitivity - /// - public const uint Sensitivity = (uint)Property.Id.InstanceLocaltimeBookSensitivity; - /// - /// HasRrule - /// - public const uint HasRrule = (uint)Property.Id.InstanceLocaltimeBookHasRrule; - /// - /// Latitude - /// - public const uint Latitude = (uint)Property.Id.InstanceLocaltimeBookLatitude; - /// - /// Longitude - /// - public const uint Longitude = (uint)Property.Id.InstanceLocaltimeBookLongitude; - /// - /// HasAlarm - /// - public const uint HasAlarm = (uint)Property.Id.InstanceLocaltimeBookHasAlarm; - /// - /// OriginalEventId - /// - public const uint OriginalEventId = (uint)Property.Id.InstanceLocaltimeBookOriginalEventId; - /// - /// LastModifiedTime - /// - public const uint LastModifiedTime = (uint)Property.Id.InstanceLocaltimeBookLastModifiedTime; - /// - /// SyncData1 - /// - public const uint SyncData1 = (uint)Property.Id.InstanceLocaltimeBookSyncData1; - /// - /// IsAllday - /// - public const uint IsAllday = (uint)Property.Id.InstanceLocaltimeBookIsAllday; - } - - /// - /// Describes properties of a InstanceUtimeBookExtended record. - /// - /// Read only view - public static class InstanceUtimeBookExtended - { - /// - /// Uri - /// - public const string Uri = "tizen.calendar_view.extended/instance_utime/book"; - /// - /// EventId - /// - public const uint EventId = (uint)Property.Id.InstanceUtimeBookExtendedEventId; - /// - /// Start - /// - public const uint Start = (uint)Property.Id.InstanceUtimeBookExtendedStart; - /// - /// End - /// - public const uint End = (uint)Property.Id.InstanceUtimeBookExtendedEnd; - /// - /// Summary - /// - public const uint Summary = (uint)Property.Id.InstanceUtimeBookExtendedSummary; - /// - /// Location - /// - public const uint Location = (uint)Property.Id.InstanceUtimeBookExtendedLocation; - /// - /// BookId - /// - public const uint BookId = (uint)Property.Id.InstanceUtimeBookExtendedBookId; - /// - /// Description - /// - public const uint Description = (uint)Property.Id.InstanceUtimeBookExtendedDescription; - /// - /// BusyStatus - /// - public const uint BusyStatus = (uint)Property.Id.InstanceUtimeBookExtendedBusyStatus; - /// - /// EventStatus - /// - public const uint EventStatus = (uint)Property.Id.InstanceUtimeBookExtendedEventStatus; - /// - /// Priority - /// - public const uint Priority = (uint)Property.Id.InstanceUtimeBookExtendedPriority; - /// - /// Sensitivity - /// - public const uint Sensitivity = (uint)Property.Id.InstanceUtimeBookExtendedSensitivity; - /// - /// HasRrule - /// - public const uint HasRrule = (uint)Property.Id.InstanceUtimeBookExtendedHasRrule; - /// - /// Latitude - /// - public const uint Latitude = (uint)Property.Id.InstanceUtimeBookExtendedLatitude; - /// - /// Longitude - /// - public const uint Longitude = (uint)Property.Id.InstanceUtimeBookExtendedLongitude; - /// - /// HasAlarm - /// - public const uint HasAlarm = (uint)Property.Id.InstanceUtimeBookExtendedHasAlarm; - /// - /// OriginalEventId - /// - public const uint OriginalEventId = (uint)Property.Id.InstanceUtimeBookExtendedOriginalEventId; - /// - /// LastModifiedTime - /// - public const uint LastModifiedTime = (uint)Property.Id.InstanceUtimeBookExtendedLastModifiedTime; - /// - /// SyncData1 - /// - public const uint SyncData1 = (uint)Property.Id.InstanceUtimeBookExtendedSyncData1; - /// - /// OrganizerName - /// - public const uint OrganizerName = (uint)Property.Id.InstanceUtimeBookExtendedOrganizerName; - /// - /// Categories - /// - public const uint Categories = (uint)Property.Id.InstanceUtimeBookExtendedCategories; - /// - /// HasAttendee - /// - public const uint HasAttendee = (uint)Property.Id.InstanceUtimeBookExtendedHasAttendee; - /// - /// SyncData2 - /// - public const uint SyncData2 = (uint)Property.Id.InstanceUtimeBookExtendedSyncData2; - /// - /// SyncData3 - /// - public const uint SyncData3 = (uint)Property.Id.InstanceUtimeBookExtendedSyncData3; - /// - /// SyncData4 - /// - public const uint SyncData4 = (uint)Property.Id.InstanceUtimeBookExtendedSyncData4; - } - - /// - /// Describes properties of a InstanceLocaltimeBookExtended record. - /// - /// Read only view - public static class InstanceLocaltimeBookExtended - { - /// - /// Uri - /// - public const string Uri = "tizen.calendar_view.extended/instance_localtime/book"; - /// - /// EventId - /// - public const uint EventId = (uint)Property.Id.InstanceLocaltimeBookExtendedEventId; - /// - /// Start - /// - public const uint Start = (uint)Property.Id.InstanceLocaltimeBookExtendedStart; - /// - /// End - /// - public const uint End = (uint)Property.Id.InstanceLocaltimeBookExtendedEnd; - /// - /// Summary - /// - public const uint Summary = (uint)Property.Id.InstanceLocaltimeBookExtendedSummary; - /// - /// Location - /// - public const uint Location = (uint)Property.Id.InstanceLocaltimeBookExtendedLocation; - /// - /// BookId - /// - public const uint BookId = (uint)Property.Id.InstanceLocaltimeBookExtendedBookId; - /// - /// Description - /// - public const uint Description = (uint)Property.Id.InstanceLocaltimeBookExtendedDescription; - /// - /// BusyStatus - /// - public const uint BusyStatus = (uint)Property.Id.InstanceLocaltimeBookExtendedBusyStatus; - /// - /// EventStatus - /// - public const uint EventStatus = (uint)Property.Id.InstanceLocaltimeBookExtendedEventStatus; - /// - /// Priority - /// - public const uint Priority = (uint)Property.Id.InstanceLocaltimeBookExtendedPriority; - /// - /// Sensitivity - /// - public const uint Sensitivity = (uint)Property.Id.InstanceLocaltimeBookExtendedSensitivity; - /// - /// HasRrule - /// - public const uint HasRrule = (uint)Property.Id.InstanceLocaltimeBookExtendedHasRrule; - /// - /// Latitude - /// - public const uint Latitude = (uint)Property.Id.InstanceLocaltimeBookExtendedLatitude; - /// - /// Longitude - /// - public const uint Longitude = (uint)Property.Id.InstanceLocaltimeBookExtendedLongitude; - /// - /// HasAlarm - /// - public const uint HasAlarm = (uint)Property.Id.InstanceLocaltimeBookExtendedHasAlarm; - /// - /// OriginalEventId - /// - public const uint OriginalEventId = (uint)Property.Id.InstanceLocaltimeBookExtendedOriginalEventId; - /// - /// LastModifiedTime - /// - public const uint LastModifiedTime = (uint)Property.Id.InstanceLocaltimeBookExtendedLastModifiedTime; - /// - /// SyncData1 - /// - public const uint SyncData1 = (uint)Property.Id.InstanceLocaltimeBookExtendedSyncData1; - /// - /// OrganizerName - /// - public const uint OrganizerName = (uint)Property.Id.InstanceLocaltimeBookExtendedOrganizerName; - /// - /// Categories - /// - public const uint Categories = (uint)Property.Id.InstanceLocaltimeBookExtendedCategories; - /// - /// HasAttendee - /// - public const uint HasAttendee = (uint)Property.Id.InstanceLocaltimeBookExtendedHasAttendee; - /// - /// SyncData2 - /// - public const uint SyncData2 = (uint)Property.Id.InstanceLocaltimeBookExtendedSyncData2; - /// - /// SyncData3 - /// - public const uint SyncData3 = (uint)Property.Id.InstanceLocaltimeBookExtendedSyncData3; - /// - /// SyncData4 - /// - public const uint SyncData4 = (uint)Property.Id.InstanceLocaltimeBookExtendedSyncData4; - /// - /// IsAllday - /// - public const uint IsAllday = (uint)Property.Id.InstanceLocaltimeBookExtendedIsAllday; - } - - /// - /// Describes properties of a UpdatedInfo record. - /// - /// Read only view - public static class UpdatedInfo - { - /// - /// Identifier of this updatedInfo view - /// - public const string Uri = "tizen.calendar_view.updated_info"; - /// - /// Modified event(or todo) record ID - /// - public const uint Id = (uint)Property.Id.UpdateInfoId; - /// - /// Calendar book ID of the modified event(or todo) record - /// - public const uint CalendarId = (uint)Property.Id.UpdateInfoCalendarId; - /// - /// Enumeration value of the modified status. - /// - public const uint Type = (uint)Property.Id.UpdateInfoType; - /// - /// Version after change - /// - public const uint Version = (uint)Property.Id.UpdateInfoVersion; - } - - /// - /// Describes properties of a Extended record. - /// - public static class Extended - { - /// - /// Identifier of this extended_property view - /// - public const string Uri = "tizen.calendar_view.extended_property"; - /// - /// DB record ID of the extended_property - /// - public const uint Id = (uint)Property.Id.ExtendedId; - /// - /// Related record ID - /// - public const uint RecordId = (uint)Property.Id.ExtendedRecordId; - /// - /// Enumeration value of the record type. - /// - public const uint RecordType = (uint)Property.Id.ExtendedRecordType; - /// - /// The key of the property - /// - public const uint Key = (uint)Property.Id.ExtendedKey; - /// - /// The value of the property - /// - public const uint Value = (uint)Property.Id.ExtendedValue; - } - } -} - diff --git a/src/Tizen.Pims.Calendar/Tizen.Pims.Calendar/DBChangedEventArgs.cs b/src/Tizen.Pims.Calendar/Tizen.Pims.Calendar/DBChangedEventArgs.cs deleted file mode 100644 index 7fc8a9c72..000000000 --- a/src/Tizen.Pims.Calendar/Tizen.Pims.Calendar/DBChangedEventArgs.cs +++ /dev/null @@ -1,40 +0,0 @@ -/* -* 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.Pims.Calendar -{ - /// - /// Event arguments passed when calendar database is changed - /// - public class DBChangedEventArgs : EventArgs - { - internal DBChangedEventArgs(string viewUri) - { - ViewUri = viewUri; - } - - /// - /// The calendar view URI changed. - /// - public string ViewUri - { - get; - internal set; - } - } -} diff --git a/src/Tizen.Pims.Calendar/Tizen.Pims.Calendar/NamespaceDoc.cs b/src/Tizen.Pims.Calendar/Tizen.Pims.Calendar/NamespaceDoc.cs deleted file mode 100644 index 2d090bdab..000000000 --- a/src/Tizen.Pims.Calendar/Tizen.Pims.Calendar/NamespaceDoc.cs +++ /dev/null @@ -1,24 +0,0 @@ -/* - * 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. - */ - -/// -/// The Tizen.Pims.Calendar namespace provides classes for managing calendar information for schedule. -/// -/// -/// The Tizen.Pims.Calendar namespace provides classes for managing calendar information for schedule. -/// -namespace Tizen.Pims.Calendar {} - diff --git a/src/Tizen.Pims.Calendar/Tizen.Pims.Calendar/ReminderEventArgs.cs b/src/Tizen.Pims.Calendar/Tizen.Pims.Calendar/ReminderEventArgs.cs deleted file mode 100644 index e5e533403..000000000 --- a/src/Tizen.Pims.Calendar/Tizen.Pims.Calendar/ReminderEventArgs.cs +++ /dev/null @@ -1,44 +0,0 @@ -/* - * 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.Pims.Calendar -{ - /// - /// Event arguments passed when alarm is alerted. - /// - public class ReminderAlertedEventArgs : EventArgs - { - internal ReminderAlertedEventArgs(string param) - { - Param = param; - Log.Debug(Globals.LogTag, "[TEST]" + param); - } - - /// - /// The parameter which data is combined. - /// - /// - /// The combination of reminder data(Value string like id=value&time=value&tick=value&unit=value&type=value) - /// - public string Param - { - get; - internal set; - } - } -} diff --git a/src/Tizen.Pims.Contacts/Interop/Interop.Activity.cs b/src/Tizen.Pims.Contacts/Interop/Interop.Activity.cs deleted file mode 100755 index 70335260e..000000000 --- a/src/Tizen.Pims.Contacts/Interop/Interop.Activity.cs +++ /dev/null @@ -1,32 +0,0 @@ -/* - * 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.Runtime.InteropServices; - -/// -/// Partial Interop Class -/// -internal static partial class Interop -{ - internal static class Activity - { - [DllImport(Libraries.Contacts, EntryPoint = "contacts_activity_delete_by_contact_id")] - internal static extern int DeleteByContactId(int contactId); - - [DllImport(Libraries.Contacts, EntryPoint = "contacts_activity_delete_by_account_id")] - internal static extern int DeleteByAccountId(int accountId); - } -} diff --git a/src/Tizen.Pims.Contacts/Interop/Interop.Database.cs b/src/Tizen.Pims.Contacts/Interop/Interop.Database.cs deleted file mode 100644 index 787baaa94..000000000 --- a/src/Tizen.Pims.Contacts/Interop/Interop.Database.cs +++ /dev/null @@ -1,118 +0,0 @@ -/* - * 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 enum ContactsChanged - { - Inserted, - Updated, - Deleted - } - - internal static partial class Database - { - [DllImport(Libraries.Contacts, EntryPoint = "contacts_db_insert_record")] - internal static extern int Insert(IntPtr recordHandle, out int recordId); - - [DllImport(Libraries.Contacts, EntryPoint = "contacts_db_get_record")] - internal static extern int Get(string uri, int recordId, out IntPtr recordHandle); - - [DllImport(Libraries.Contacts, EntryPoint = "contacts_db_update_record")] - internal static extern int Update(IntPtr recordHandle); - - [DllImport(Libraries.Contacts, EntryPoint = "contacts_db_delete_record")] - internal static extern int Delete(string uri, int recordId); - - [DllImport(Libraries.Contacts, EntryPoint = "contacts_db_replace_record")] - internal static extern int Replace(IntPtr recordHandle, int recordId); - - [DllImport(Libraries.Contacts, EntryPoint = "contacts_db_get_all_records")] - internal static extern int GetRecords(string uri, int offset, int limit, out IntPtr listHandle); - - [DllImport(Libraries.Contacts, EntryPoint = "contacts_db_get_records_with_query")] - internal static extern int GetRecords(IntPtr queryHandle, int offset, int limit, out IntPtr listHandle); - - [DllImport(Libraries.Contacts, EntryPoint = "contacts_db_insert_records")] - internal static extern int InsertRecords(IntPtr listHandle, out IntPtr ids, out int count); - - [DllImport(Libraries.Contacts, EntryPoint = "contacts_db_update_records")] - internal static extern int UpdateRecords(IntPtr listHandle); - - [DllImport(Libraries.Contacts, EntryPoint = "contacts_db_delete_records")] - internal static extern int DeleteRecords(string uri, int[] recordIdArray, int count); - - [DllImport(Libraries.Contacts, EntryPoint = "contacts_db_replace_records")] - internal static extern int ReplaceRecords(IntPtr listHandle, int[] recordIdArray, int count); - - [DllImport(Libraries.Contacts, EntryPoint = "contacts_db_get_current_version")] - internal static extern int GetVersion(out int contactsDBVersion); - - [DllImport(Libraries.Contacts, EntryPoint = "contacts_db_add_changed_cb")] - internal static extern int AddChangedCb(string uri, ContactsDBChangedCallback callback, IntPtr userData); - - [DllImport(Libraries.Contacts, EntryPoint = "contacts_db_remove_changed_cb")] - internal static extern int RemoveChangedCb(string uri, ContactsDBChangedCallback callback, IntPtr userData); - - [DllImport(Libraries.Contacts, EntryPoint = "contacts_db_get_changes_by_version")] - internal static extern int GetChangesByVersion(string uri, int addressBookId, int contactsDBVersion, out IntPtr changeRecordList, out int currentContactsDBVersion); - - [DllImport(Libraries.Contacts, EntryPoint = "contacts_db_search_records")] - internal static extern int Search(string uri, string keyword, int offset, int limit, out IntPtr listHandle); - - [DllImport(Libraries.Contacts, EntryPoint = "contacts_db_search_records_with_query")] - internal static extern int Search(IntPtr queryHandle, string keyword, int offset, int limit, out IntPtr listHandle); - - [DllImport(Libraries.Contacts, EntryPoint = "contacts_db_search_records_with_range")] - internal static extern int Search(string uri, string keyword, int offset, int limit, int range, out IntPtr listHandle); - - [DllImport(Libraries.Contacts, EntryPoint = "contacts_db_search_records_for_snippet")] - internal static extern int Search(string uri, string keyword, int offset, int limit, string startMatch, string endMatch, int tokenNumber, out IntPtr listHandle); - - [DllImport(Libraries.Contacts, EntryPoint = "contacts_db_search_records_with_query_for_snippet")] - internal static extern int Search(IntPtr queryHandle, string keyword, int offset, int limit, string startMatch, string endMatch, int tokenNumber, out IntPtr listHandle); - - [DllImport(Libraries.Contacts, EntryPoint = "contacts_db_search_records_with_range_for_snippet")] - internal static extern int Search(string uri, string keyword, int offset, int limit, int range, string startMatch, string endMatch, int tokenNumber, out IntPtr listHandle); - - [DllImport(Libraries.Contacts, EntryPoint = "contacts_db_get_count")] - internal static extern int GetCount(string uri, out int count); - - [DllImport(Libraries.Contacts, EntryPoint = "contacts_db_get_count_with_query")] - internal static extern int GetCount(IntPtr queryHandle, out int count); - - [DllImport(Libraries.Contacts, EntryPoint = "contacts_db_get_last_change_version")] - internal static extern int GetLastChangeVersion(out int version); - - [DllImport(Libraries.Contacts, EntryPoint = "contacts_db_get_status")] - internal static extern int GetStatus(out Tizen.Pims.Contacts.ContactsDatabase.DBStatus status); - - [DllImport(Libraries.Contacts, EntryPoint = "contacts_db_add_changed_cb")] - internal static extern int AddStatusChangedCb(ContactsDBStatusChangedCallback callback, IntPtr userData); - - [DllImport(Libraries.Contacts, EntryPoint = "contacts_db_remove_changed_cb")] - internal static extern int RemoveStatusChangedCb(ContactsDBStatusChangedCallback callback, IntPtr userData); - - [UnmanagedFunctionPointerAttribute(CallingConvention.Cdecl)] - internal delegate void ContactsDBChangedCallback(string uri, IntPtr userData); - - [UnmanagedFunctionPointerAttribute(CallingConvention.Cdecl)] - internal delegate void ContactsDBStatusChangedCallback(Tizen.Pims.Contacts.ContactsDatabase.DBStatus status, IntPtr userData); - } -} diff --git a/src/Tizen.Pims.Contacts/Interop/Interop.Filter.cs b/src/Tizen.Pims.Contacts/Interop/Interop.Filter.cs deleted file mode 100644 index 8435ef85e..000000000 --- a/src/Tizen.Pims.Contacts/Interop/Interop.Filter.cs +++ /dev/null @@ -1,54 +0,0 @@ -/* - * 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; -using static Tizen.Pims.Contacts.ContactsFilter; - -internal static partial class Interop -{ - internal static partial class Filter - { - [DllImport(Libraries.Contacts, EntryPoint = "contacts_filter_create")] - internal static extern int ContactsFilterCreate(string uri, out IntPtr filterHandle); - - [DllImport(Libraries.Contacts, EntryPoint = "contacts_filter_destroy")] - internal static extern int ContactsFilterDestroy(IntPtr filterHandle); - - [DllImport(Libraries.Contacts, EntryPoint = "contacts_filter_add_str")] - internal static extern int ContactsFilterAddStr(IntPtr filterHandle, uint propertyId, StringMatchType match, string matchValue); - - [DllImport(Libraries.Contacts, EntryPoint = "contacts_filter_add_int")] - internal static extern int ContactsFilterAddInt(IntPtr filterHandle, uint propertyId, IntegerMatchType match, int matchValue); - - [DllImport(Libraries.Contacts, EntryPoint = "contacts_filter_add_lli")] - internal static extern int ContactsFilterAddLli(IntPtr filterHandle, uint propertyId, IntegerMatchType match, long matchValue); - - [DllImport(Libraries.Contacts, EntryPoint = "contacts_filter_add_double")] - internal static extern int ContactsFilterAddDouble(IntPtr filterHandle, uint propertyId, IntegerMatchType match, double matchValue); - - [DllImport(Libraries.Contacts, EntryPoint = "contacts_filter_add_bool")] - internal static extern int ContactsFilterAddBool(IntPtr filterHandle, uint propertyId, bool matchValue); - - [DllImport(Libraries.Contacts, EntryPoint = "contacts_filter_add_operator")] - internal static extern int ContactsFilterAddOperator(IntPtr filterHandle, LogicalOperator operatorType); - - [DllImport(Libraries.Contacts, EntryPoint = "contacts_filter_add_filter")] - internal static extern int ContactsFilterAddFilter(IntPtr parentFilter, IntPtr childFilter); - - - } -} diff --git a/src/Tizen.Pims.Contacts/Interop/Interop.Group.cs b/src/Tizen.Pims.Contacts/Interop/Interop.Group.cs deleted file mode 100755 index 9eb1ab75c..000000000 --- a/src/Tizen.Pims.Contacts/Interop/Interop.Group.cs +++ /dev/null @@ -1,38 +0,0 @@ -/* - * 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.Runtime.InteropServices; - -/// -/// Partial Interop Class -/// -internal static partial class Interop -{ - /// - /// Contacts Interop Class - /// - internal static class Group - { - [DllImport(Libraries.Contacts, EntryPoint = "contacts_group_add_contact")] - internal static extern int AddContact(int groupId, int contactId); - - [DllImport(Libraries.Contacts, EntryPoint = "contacts_group_remove_contact")] - internal static extern int RemoveContact(int groupId, int contactId); - - [DllImport(Libraries.Contacts, EntryPoint = "contacts_group_set_group_order")] - internal static extern int SetGroupOrder(int groupId, int previousGroupId, int nextGroupId); - } -} \ No newline at end of file diff --git a/src/Tizen.Pims.Contacts/Interop/Interop.Libraries.cs b/src/Tizen.Pims.Contacts/Interop/Interop.Libraries.cs deleted file mode 100755 index b916131aa..000000000 --- a/src/Tizen.Pims.Contacts/Interop/Interop.Libraries.cs +++ /dev/null @@ -1,26 +0,0 @@ -/* - * 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. - */ - -/// -/// Partial Interop Class -/// -internal static partial class Interop -{ - internal static partial class Libraries - { - public const string Contacts = "libcontacts-service2.so.0"; - } -} diff --git a/src/Tizen.Pims.Contacts/Interop/Interop.List.cs b/src/Tizen.Pims.Contacts/Interop/Interop.List.cs deleted file mode 100755 index 67454cb5f..000000000 --- a/src/Tizen.Pims.Contacts/Interop/Interop.List.cs +++ /dev/null @@ -1,56 +0,0 @@ -/* - * 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 List - { - [DllImport(Libraries.Contacts, EntryPoint = "contacts_list_create")] - internal static extern int ContactsListCreate(out IntPtr contactsList); - - [DllImport(Libraries.Contacts, EntryPoint = "contacts_list_destroy")] - internal static extern int ContactsListDestroy(IntPtr contactsList, bool deleteChild); - - [DllImport(Libraries.Contacts, EntryPoint = "contacts_list_get_count")] - internal static extern int ContactsListGetCount(IntPtr contactsList, out int count); - - [DllImport(Libraries.Contacts, EntryPoint = "contacts_list_add")] - internal static extern int ContactsListAdd(IntPtr contactsList, IntPtr recordHandle); - - [DllImport(Libraries.Contacts, EntryPoint = "contacts_list_remove")] - internal static extern int ContactsListRemove(IntPtr contactsList, IntPtr recordHandle); - - [DllImport(Libraries.Contacts, EntryPoint = "contacts_list_get_current_record_p")] - internal static extern int ContactsListGetCurrentRecordP(IntPtr contactsList, out IntPtr recordHandle); - - [DllImport(Libraries.Contacts, EntryPoint = "contacts_list_prev")] - internal static extern int ContactsListPrev(IntPtr contactsList); - - [DllImport(Libraries.Contacts, EntryPoint = "contacts_list_next")] - internal static extern int ContactsListNext(IntPtr contactsList); - - [DllImport(Libraries.Contacts, EntryPoint = "contacts_list_first")] - internal static extern int ContactsListFirst(IntPtr contactsList); - - [DllImport(Libraries.Contacts, EntryPoint = "contacts_list_last")] - internal static extern int ContactsListLast(IntPtr contactsList); - - - } -} diff --git a/src/Tizen.Pims.Contacts/Interop/Interop.Person.cs b/src/Tizen.Pims.Contacts/Interop/Interop.Person.cs deleted file mode 100644 index f52ef157c..000000000 --- a/src/Tizen.Pims.Contacts/Interop/Interop.Person.cs +++ /dev/null @@ -1,70 +0,0 @@ -/* - * 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 enum ContactsPersonProperty - { - NameContact, // Default contacts record - Number, // Default number record - Email, // Default Email record - Image // Default image record - }; - - internal enum ContactsUsageType - { - None, - OutgoingCall, - OutgoingMsg, - OutgoingEmail, - IncomingCall, - IncomingMsg, - IncomingEmail, - MissedCall, - RejectedCall, - BlockedCall, - BlockedMsg - }; - - internal static partial class Person - { - [DllImport(Libraries.Contacts, EntryPoint = "contacts_person_link_person")] - internal static extern int ContactsPersonLinkPerson(int basePersonId, int personId); - - [DllImport(Libraries.Contacts, EntryPoint = "contacts_person_unlink_contact")] - internal static extern int ContactsPersonUnlinkContact(int personId, int contactId, out int unlinkedPersonId); - - [DllImport(Libraries.Contacts, EntryPoint = "contacts_person_reset_usage")] - internal static extern int ContactsPersonResetUsage(int personId, ContactsUsageType type); - - [DllImport(Libraries.Contacts, EntryPoint = "contacts_person_set_favorite_order")] - internal static extern int ContactsPersonSetFavoriteOrder(int personId, int previousPersonId, int nextPersonId); - - [DllImport(Libraries.Contacts, EntryPoint = "contacts_person_set_default_property")] - internal static extern int ContactsPersonSetDefaultProperty(ContactsPersonProperty property, int personId, int id); - - [DllImport(Libraries.Contacts, EntryPoint = "contacts_person_get_default_property")] - internal static extern int ContactsPersonGetDefaultProperty(ContactsPersonProperty property, int personId, out int id); - - [DllImport(Libraries.Contacts, EntryPoint = "contacts_person_get_aggregation_suggestions")] - internal static extern int ContactsPersonGetAggregationSuggestions(int personId, int limit, out IntPtr listHandle); - - - } -} diff --git a/src/Tizen.Pims.Contacts/Interop/Interop.PhoneLog.cs b/src/Tizen.Pims.Contacts/Interop/Interop.PhoneLog.cs deleted file mode 100755 index f530c5ff5..000000000 --- a/src/Tizen.Pims.Contacts/Interop/Interop.PhoneLog.cs +++ /dev/null @@ -1,32 +0,0 @@ -/* - * 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.Runtime.InteropServices; - -/// -/// Partial Interop Class -/// -internal static partial class Interop -{ - internal static class PhoneLog - { - [DllImport(Libraries.Contacts, EntryPoint = "contacts_phone_log_reset_statistics")] - internal static extern int resetStatistics(); - - [DllImport(Libraries.Contacts, EntryPoint = "contacts_phone_log_reset_statistics_by_sim")] - internal static extern int resetStatisticsBySim(int simSlotNo); - } -} diff --git a/src/Tizen.Pims.Contacts/Interop/Interop.Query.cs b/src/Tizen.Pims.Contacts/Interop/Interop.Query.cs deleted file mode 100755 index 7c23038a6..000000000 --- a/src/Tizen.Pims.Contacts/Interop/Interop.Query.cs +++ /dev/null @@ -1,44 +0,0 @@ -/* - * 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 Query - { - [DllImport(Libraries.Contacts, EntryPoint = "contacts_query_create")] - internal static extern int ContactsQueryCreate(string uri, out IntPtr queryHandle); - - [DllImport(Libraries.Contacts, EntryPoint = "contacts_query_destroy")] - internal static extern int ContactsQueryDestroy(IntPtr queryHandle); - - [DllImport(Libraries.Contacts, EntryPoint = "contacts_query_set_projection")] - internal static extern int ContactsQuerySetProjection(IntPtr queryHandle, uint[] propertyIdArray, int count); - - [DllImport(Libraries.Contacts, EntryPoint = "contacts_query_set_distinct")] - internal static extern int ContactsQuerySetDistinct(IntPtr queryHandle, bool set); - - [DllImport(Libraries.Contacts, EntryPoint = "contacts_query_set_filter")] - internal static extern int ContactsQuerySetFilter(IntPtr queryHandle, IntPtr filterHandle); - - [DllImport(Libraries.Contacts, EntryPoint = "contacts_query_set_sort")] - internal static extern int ContactsQuerySetSort(IntPtr queryHandle, uint propertyId, bool isAscending); - - - } -} diff --git a/src/Tizen.Pims.Contacts/Interop/Interop.Record.cs b/src/Tizen.Pims.Contacts/Interop/Interop.Record.cs deleted file mode 100644 index 82f67a13c..000000000 --- a/src/Tizen.Pims.Contacts/Interop/Interop.Record.cs +++ /dev/null @@ -1,84 +0,0 @@ -/* - * 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 Record - { - [DllImport(Libraries.Contacts, EntryPoint = "contacts_record_create")] - internal static extern int Create(string uri, out IntPtr recordIdHandle); - - [DllImport(Libraries.Contacts, EntryPoint = "contacts_record_destroy")] - internal static extern int Destroy(IntPtr recordHandle, bool deleteChild); - - [DllImport(Libraries.Contacts, EntryPoint = "contacts_record_clone")] - internal static extern int Clone(IntPtr recordHandle, out IntPtr clonedRecordHandle); - - [DllImport(Libraries.Contacts, EntryPoint = "contacts_record_get_str")] - internal static extern int GetStr(IntPtr recordHandle, uint propertyId, out string value); - - [DllImport(Libraries.Contacts, EntryPoint = "contacts_record_get_str_p")] - internal static extern int GetStrP(IntPtr recordHandle, uint propertyId, out string value); - - [DllImport(Libraries.Contacts, EntryPoint = "contacts_record_set_str")] - internal static extern int SetStr(IntPtr recordHandle, uint propertyId, string value); - - [DllImport(Libraries.Contacts, EntryPoint = "contacts_record_get_int")] - internal static extern int GetInt(IntPtr recordHandle, uint propertyId, out int value); - - [DllImport(Libraries.Contacts, EntryPoint = "contacts_record_set_int")] - internal static extern int SetInt(IntPtr recordHandle, uint propertyId, int value); - - [DllImport(Libraries.Contacts, EntryPoint = "contacts_record_get_lli")] - internal static extern int GetLli(IntPtr recordHandle, uint propertyId, out long value); - - [DllImport(Libraries.Contacts, EntryPoint = "contacts_record_set_lli")] - internal static extern int SetLli(IntPtr recordHandle, uint propertyId, long value); - - [DllImport(Libraries.Contacts, EntryPoint = "contacts_record_get_bool")] - internal static extern int GetBool(IntPtr recordHandle, uint propertyId, out bool value); - - [DllImport(Libraries.Contacts, EntryPoint = "contacts_record_set_bool")] - internal static extern int SetBool(IntPtr recordHandle, uint propertyId, bool value); - - [DllImport(Libraries.Contacts, EntryPoint = "contacts_record_get_double")] - internal static extern int GetDouble(IntPtr recordHandle, uint propertyId, out double value); - - [DllImport(Libraries.Contacts, EntryPoint = "contacts_record_set_double")] - internal static extern int SetDouble(IntPtr recordHandle, uint propertyId, double value); - - [DllImport(Libraries.Contacts, EntryPoint = "contacts_record_add_child_record")] - internal static extern int AddChildRecord(IntPtr recordHandle, uint propertyId, IntPtr childRecordHandle); - - [DllImport(Libraries.Contacts, EntryPoint = "contacts_record_remove_child_record")] - internal static extern int RemoveChildRecord(IntPtr recordHandle, uint propertyId, IntPtr childRecordHandle); - - [DllImport(Libraries.Contacts, EntryPoint = "contacts_record_get_child_record_count")] - internal static extern int GetChildRecordCount(IntPtr recordHandle, uint propertyId, out int count); - - [DllImport(Libraries.Contacts, EntryPoint = "contacts_record_get_child_record_at_p")] - internal static extern int GetChildRecordAtP(IntPtr recordHandle, uint propertyId, int index, out IntPtr childRecordHandle); - - [DllImport(Libraries.Contacts, EntryPoint = "contacts_record_clone_child_record_list")] - internal static extern int CloneChildRecordList(IntPtr recordHandle, uint propertyId, out IntPtr clonedListHandle); - - [DllImport(Libraries.Contacts, EntryPoint = "contacts_record_get_uri_p")] - internal static extern int GetUriP(IntPtr recordHandle, out IntPtr uri); - } -} diff --git a/src/Tizen.Pims.Contacts/Interop/Interop.Service.cs b/src/Tizen.Pims.Contacts/Interop/Interop.Service.cs deleted file mode 100644 index 223b5a332..000000000 --- a/src/Tizen.Pims.Contacts/Interop/Interop.Service.cs +++ /dev/null @@ -1,44 +0,0 @@ -/* - * 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.Runtime.InteropServices; - -/// -/// Partial Interop Class -/// -internal static partial class Interop -{ - /// - /// Contacts Interop Class - /// - internal static class Service - { - [DllImport(Libraries.Contacts, EntryPoint = "contacts_connect")] - internal static extern int Connect(); - - [DllImport(Libraries.Contacts, EntryPoint = "contacts_disconnect")] - internal static extern int Disconnect(); - - [DllImport(Libraries.Contacts, EntryPoint = "contacts_connect_on_thread")] - internal static extern int OnThreadConnect(); - - [DllImport(Libraries.Contacts, EntryPoint = "contacts_disconnect_on_thread")] - internal static extern int OnThreadDisconnect(); - - [DllImport(Libraries.Contacts, EntryPoint = "contacts_connect_with_flags")] - internal static extern int DisconnectWithFlags(uint flags); - } -} diff --git a/src/Tizen.Pims.Contacts/Interop/Interop.Setting.cs b/src/Tizen.Pims.Contacts/Interop/Interop.Setting.cs deleted file mode 100755 index 902d7e3cc..000000000 --- a/src/Tizen.Pims.Contacts/Interop/Interop.Setting.cs +++ /dev/null @@ -1,59 +0,0 @@ -/* - * 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; -using Tizen.Pims.Contacts; - -/// -/// Partial Interop Class -/// -internal static partial class Interop -{ - internal static class Setting - { - [DllImport(Libraries.Contacts, EntryPoint = "contacts_setting_get_name_display_order")] - internal static extern int GetNameDisplayOrder(out ContactDisplayOrder nameDisplayOrder); - - [DllImport(Libraries.Contacts, EntryPoint = "contacts_setting_set_name_display_order")] - internal static extern int SetNameDisplayOrder(ContactDisplayOrder nameDisplayOrder); - - [DllImport(Libraries.Contacts, EntryPoint = "contacts_setting_get_name_sorting_order")] - internal static extern int GetNameSortingOrder(out ContactSortingOrder nameSortingOrder); - - [DllImport(Libraries.Contacts, EntryPoint = "contacts_setting_set_name_sorting_order")] - internal static extern int SetNameSortingOrder(ContactSortingOrder nameSortingOrder); - - [DllImport(Libraries.Contacts, EntryPoint = "contacts_setting_add_name_display_order_changed_cb")] - internal static extern int AddNameDisplayOrderChangedCB(DisplayOrderChangedCallback callback, IntPtr userData); - - [DllImport(Libraries.Contacts, EntryPoint = "contacts_setting_remove_name_display_order_changed_cb")] - internal static extern int RemoveNameDisplayOrderChangedCB(DisplayOrderChangedCallback callback, IntPtr userData); - - [DllImport(Libraries.Contacts, EntryPoint = "contacts_setting_add_name_sorting_order_changed_cb")] - internal static extern int AddNameSortingOrderChangedCB(SortingOrderChangedCallback callback, IntPtr userData); - - [DllImport(Libraries.Contacts, EntryPoint = "contacts_setting_remove_name_sorting_order_changed_cb")] - internal static extern int RemoveNameSortingOrderChangedCB(SortingOrderChangedCallback callback, IntPtr userData); - - - [UnmanagedFunctionPointerAttribute(CallingConvention.Cdecl)] - internal delegate void DisplayOrderChangedCallback(ContactDisplayOrder nameDisplayOrder, IntPtr userData); - - [UnmanagedFunctionPointerAttribute(CallingConvention.Cdecl)] - internal delegate void SortingOrderChangedCallback(ContactSortingOrder nameSortingOrder, IntPtr userData); - } -} diff --git a/src/Tizen.Pims.Contacts/Interop/Interop.Sim.cs b/src/Tizen.Pims.Contacts/Interop/Interop.Sim.cs deleted file mode 100755 index 488a5f637..000000000 --- a/src/Tizen.Pims.Contacts/Interop/Interop.Sim.cs +++ /dev/null @@ -1,36 +0,0 @@ -/* - * 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; - -/// -/// Partial Interop Class -/// -internal static partial class Interop -{ - internal static class Sim - { - [DllImport(Libraries.Contacts, EntryPoint = "contacts_sim_import_all_contacts_by_sim_slot_no")] - internal static extern int ImportAllContactsBySimSlotNo(int sim_slot_no, ContactsSimImportProgressCallback callback, IntPtr userData); - - [DllImport(Libraries.Contacts, EntryPoint = "contacts_sim_get_initialization_status_by_sim_slot_no")] - internal static extern int GetInitializatOnStatusBySimSlotNo(int sim_slot_no, out bool completed); - - [UnmanagedFunctionPointerAttribute(CallingConvention.Cdecl)] - internal delegate void ContactsSimImportProgressCallback(string uri, IntPtr userData); - } -} diff --git a/src/Tizen.Pims.Contacts/Interop/Interop.Vcard.cs b/src/Tizen.Pims.Contacts/Interop/Interop.Vcard.cs deleted file mode 100755 index 47f135b81..000000000 --- a/src/Tizen.Pims.Contacts/Interop/Interop.Vcard.cs +++ /dev/null @@ -1,51 +0,0 @@ -/* - * 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 Vcard - { - [DllImport(Libraries.Contacts, EntryPoint = "contacts_vcard_parse_to_contact_foreach")] - internal static extern int ContactsVcardParseToContactForeach(string vcardFilePath, ContactsVcardParseCallback callback, IntPtr /* void */ userData); - - [DllImport(Libraries.Contacts, EntryPoint = "contacts_vcard_parse_to_contacts")] - internal static extern int ContactsVcardParseToContacts(string vcardStream, out IntPtr contactsList); - - [DllImport(Libraries.Contacts, EntryPoint = "contacts_vcard_make_from_contact")] - internal static extern int ContactsVcardMakeFromContact(IntPtr contact, out string vcardStream); - - [DllImport(Libraries.Contacts, EntryPoint = "contacts_vcard_make_from_my_profile")] - internal static extern int ContactsVcardMakeFromMyProfile(IntPtr myProfile, out string vcardStream); - - [DllImport(Libraries.Contacts, EntryPoint = "contacts_vcard_make_from_person")] - internal static extern int ContactsVcardMakeFromPerson(IntPtr person, out string vcardStream); - - [DllImport(Libraries.Contacts, EntryPoint = "contacts_vcard_get_entity_count")] - internal static extern int ContactsVcardGetEntityCount(string vcardFilePath, out int count); - - [DllImport(Libraries.Contacts, EntryPoint = "contacts_vcard_get_limit_size_of_photo")] - internal static extern int ContactsVcardGetLimitSizeOfPhoto(out uint limitSize); - - [DllImport(Libraries.Contacts, EntryPoint = "contacts_vcard_set_limit_size_of_photo")] - internal static extern int ContactsVcardSetLimitSizeOfPhoto(uint limitSize); - - [UnmanagedFunctionPointerAttribute(CallingConvention.Cdecl)] - internal delegate bool ContactsVcardParseCallback(IntPtr recordHandle, IntPtr /* void */ userData); - } -} diff --git a/src/Tizen.Pims.Contacts/Tizen.Pims.Contacts.csproj b/src/Tizen.Pims.Contacts/Tizen.Pims.Contacts.csproj deleted file mode 100644 index 4c51c4197..000000000 --- a/src/Tizen.Pims.Contacts/Tizen.Pims.Contacts.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - netstandard2.0 - - - - - - - - \ No newline at end of file diff --git a/src/Tizen.Pims.Contacts/Tizen.Pims.Contacts.sln b/src/Tizen.Pims.Contacts/Tizen.Pims.Contacts.sln deleted file mode 100644 index 238d76e0d..000000000 --- a/src/Tizen.Pims.Contacts/Tizen.Pims.Contacts.sln +++ /dev/null @@ -1,34 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26430.13 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Pims.Contacts", "Tizen.Pims.Contacts.csproj", "{5B40ACBE-A9D5-492B-AB98-11DD8581941E}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen", "..\Tizen\Tizen.csproj", "{03465933-6740-4C5D-AAD7-1BD28DE3531F}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Log", "..\Tizen.Log\Tizen.Log.csproj", "{7EF15371-8CDA-480D-BE0E-78177DD16ADB}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {5B40ACBE-A9D5-492B-AB98-11DD8581941E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {5B40ACBE-A9D5-492B-AB98-11DD8581941E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {5B40ACBE-A9D5-492B-AB98-11DD8581941E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {5B40ACBE-A9D5-492B-AB98-11DD8581941E}.Release|Any CPU.Build.0 = Release|Any CPU - {03465933-6740-4C5D-AAD7-1BD28DE3531F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {03465933-6740-4C5D-AAD7-1BD28DE3531F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {03465933-6740-4C5D-AAD7-1BD28DE3531F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {03465933-6740-4C5D-AAD7-1BD28DE3531F}.Release|Any CPU.Build.0 = Release|Any CPU - {7EF15371-8CDA-480D-BE0E-78177DD16ADB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7EF15371-8CDA-480D-BE0E-78177DD16ADB}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7EF15371-8CDA-480D-BE0E-78177DD16ADB}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7EF15371-8CDA-480D-BE0E-78177DD16ADB}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/src/Tizen.Pims.Contacts/Tizen.Pims.Contacts/ContactsDatabase.cs b/src/Tizen.Pims.Contacts/Tizen.Pims.Contacts/ContactsDatabase.cs deleted file mode 100644 index b5a529b34..000000000 --- a/src/Tizen.Pims.Contacts/Tizen.Pims.Contacts/ContactsDatabase.cs +++ /dev/null @@ -1,767 +0,0 @@ -/* -* 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.Collections.Generic; -using System.Diagnostics.CodeAnalysis; -using System.Runtime.InteropServices; - -namespace Tizen.Pims.Contacts -{ - - /// - /// ContactsDatabase provides methods to manage contacts information from/to the database. - /// - /// - /// This class allows user to access/create/update db operations for contacts information. - /// - public class ContactsDatabase - { - private Object thisLock = new Object(); - private Interop.Database.ContactsDBStatusChangedCallback _contactsDBStatusChangedCallback; - private EventHandler _dbStatusChanged; - private Dictionary> _eventHandlerMap = new Dictionary>(); - private Dictionary _callbackMap = new Dictionary(); - - internal ContactsDatabase() - { - /*To be created in ContactsManager only.*/ - } - - /// - /// Enumeration for contacts database status. - /// - public enum DBStatus - { - /// - /// Normal - /// - Normal, - /// - /// Changing collation. - /// - ChangingCollation - } - - /// - /// Enumeration for Contacts search range. - /// - [Flags] - public enum SearchRanges - { - /// - /// None - /// - None = 0, - /// - /// Search record from name - /// - Name = 0x00000001, - /// - /// Search record from number - /// - Number = 0x00000002, - /// - /// Search record from data - /// - Data = 0x00000004, - /// - /// Search record from email. Now, support only PersonEmail view - /// - Email = 0x00000008, - } - - /// - /// Occurs when contacts database status is changed. - /// - public event EventHandler DBStatusChanged - { - add - { - lock (thisLock) - { - if (_contactsDBStatusChangedCallback == null) - { - _contactsDBStatusChangedCallback = (DBStatus status, IntPtr userData) => - { - DBStatusChangedEventArgs args = new DBStatusChangedEventArgs(status); - _dbStatusChanged?.Invoke(this, args); - }; - } - - if (_dbStatusChanged == null) - { - int error = Interop.Database.AddStatusChangedCb(_contactsDBStatusChangedCallback, IntPtr.Zero); - if ((int)ContactsError.None != error) - { - Log.Error(Globals.LogTag, "Add StatusChanged Failed with error " + error); - } - } - - _dbStatusChanged += value; - } - - } - - remove - { - lock (thisLock) - { - _dbStatusChanged -= value; - - if (_dbStatusChanged == null) - { - int error = Interop.Database.RemoveStatusChangedCb(_contactsDBStatusChangedCallback, IntPtr.Zero); - if ((int)ContactsError.None != error) - { - Log.Error(Globals.LogTag, "Remove StatusChanged Failed with error " + error); - } - } - } - } - - } - - /// - /// The current contacts database version. - /// - /// The current contacts database version. - [SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic")] - public int Version - { - get - { - int version = -1; - int error = Interop.Database.GetVersion(out version); - if ((int)ContactsError.None != error) - { - Log.Error(Globals.LogTag, "Version Failed with error " + error); - } - return version; - } - } - - /// - /// The last successful changed contacts database version on the current connection. - /// - /// The last successful changed contacts database version on the current connection. - [SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic")] - public int LastChangeVersion - { - get - { - int version = -1; - int error = Interop.Database.GetLastChangeVersion(out version); - if ((int)ContactsError.None != error) - { - Log.Error(Globals.LogTag, "LastChangeVersion Failed with error " + error); - } - return version; - } - } - - /// - /// The contacts database status. - /// - /// The contacts database status. - [SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic")] - public DBStatus Status - { - get - { - DBStatus status = DBStatus.Normal; - int error = Interop.Database.GetStatus(out status); - if ((int)ContactsError.None != error) - { - Log.Error(Globals.LogTag, "GetStatus Failed with error " + error); - } - return status; - } - } - - /// - /// Inserts a record into the contacts database. - /// - /// The record to insert - /// The ID of inserted record - /// http://tizen.org/privilege/contact.write - /// http://tizen.org/privilege/callhistory.write - /// Thrown when method failed due to invalid operation - /// Thrown when an invoked method is not supported - /// Thrown when one of the arguments provided to a method is not valid - /// Thrown when failed due to out of memory - /// Thrown when application does not have proper privileges - [SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic")] - public int Insert(ContactsRecord record) - { - int id = -1; - int error = Interop.Database.Insert(record._recordHandle, out id); - if ((int)ContactsError.None != error) - { - Log.Error(Globals.LogTag, "Insert Failed with error " + error); - throw ContactsErrorFactory.CheckAndCreateException(error); - } - return id; - } - - /// - /// Inserts multiple records into the contacts database as a batch operation. - /// - /// The record list - /// The inserted record ID array - /// http://tizen.org/privilege/contact.write - /// http://tizen.org/privilege/callhistory.write - /// Thrown when method failed due to invalid operation - /// Thrown when an invoked method is not supported - /// Thrown when one of the arguments provided to a method is not valid - /// Thrown when failed due to out of memory - /// Thrown when application does not have proper privileges - [SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic")] - public int[] Insert(ContactsList list) - { - IntPtr ids; - int count; - int error = Interop.Database.InsertRecords(list._listHandle, out ids, out count); - if ((int)ContactsError.None != error) - { - Log.Error(Globals.LogTag, "Insert Failed with error " + error); - throw ContactsErrorFactory.CheckAndCreateException(error); - } - - int[] idArr = new int[count]; - Marshal.Copy(ids, idArr, 0, count); - - return idArr; - } - - /// - /// Gets a record from the contacts database. - /// - /// The view URI of a record - /// The record ID - /// The record associated with the record ID - /// http://tizen.org/privilege/contact.read - /// http://tizen.org/privilege/callhistory.read - /// Thrown when method failed due to invalid operation - /// Thrown when an invoked method is not supported - /// Thrown when one of the arguments provided to a method is not valid - /// Thrown when failed due to out of memory - /// Thrown when application does not have proper privileges - [SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic")] - [SuppressMessage("Microsoft.Design", "CA1054:UriParametersShouldNotBeStrings")] - public ContactsRecord Get(string viewUri, int recordId) - { - IntPtr handle; - int error = Interop.Database.Get(viewUri, recordId, out handle); - if ((int)ContactsError.None != error) - { - Log.Error(Globals.LogTag, "Get Failed with error " + error); - throw ContactsErrorFactory.CheckAndCreateException(error); - } - return new ContactsRecord(handle); - } - - /// - /// Updates a record in the contacts database. - /// - /// The record to update - /// http://tizen.org/privilege/contact.write - /// http://tizen.org/privilege/callhistory.write - /// Thrown when method failed due to invalid operation - /// Thrown when an invoked method is not supported - /// Thrown when one of the arguments provided to a method is not valid - /// Thrown when failed due to out of memory - /// Thrown when application does not have proper privileges - [SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic")] - public void Update(ContactsRecord record) - { - int error = Interop.Database.Update(record._recordHandle); - if ((int)ContactsError.None != error) - { - Log.Error(Globals.LogTag, "Update Failed with error " + error); - throw ContactsErrorFactory.CheckAndCreateException(error); - } - } - - /// - /// Updates multiple records in the contacts database as a batch operation. - /// - /// The record list - /// http://tizen.org/privilege/contact.write - /// http://tizen.org/privilege/callhistory.write - /// Thrown when method failed due to invalid operation - /// Thrown when an invoked method is not supported - /// Thrown when one of the arguments provided to a method is not valid - /// Thrown when failed due to out of memory - /// Thrown when application does not have proper privileges - [SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic")] - public void Update(ContactsList list) - { - int error = Interop.Database.UpdateRecords(list._listHandle); - if ((int)ContactsError.None != error) - { - Log.Error(Globals.LogTag, "Update Failed with error " + error); - throw ContactsErrorFactory.CheckAndCreateException(error); - } - } - - /// - /// Deletes a record from the contacts database with related child records. - /// - /// The view URI of a record - /// The record ID to delete - /// http://tizen.org/privilege/contact.write - /// http://tizen.org/privilege/callhistory.write - /// Thrown when method failed due to invalid operation - /// Thrown when an invoked method is not supported - /// Thrown when one of the arguments provided to a method is not valid - /// Thrown when failed due to out of memory - /// Thrown when application does not have proper privileges - [SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic")] - [SuppressMessage("Microsoft.Design", "CA1054:UriParametersShouldNotBeStrings")] - public void Delete(string viewUri, int recordId) - { - int error = Interop.Database.Delete(viewUri, recordId); - if ((int)ContactsError.None != error) - { - Log.Error(Globals.LogTag, "Delete Failed with error " + error); - throw ContactsErrorFactory.CheckAndCreateException(error); - } - } - - /// - /// Deletes multiple records with related child records from the contacts database as a batch operation. - /// - /// The view URI of the records to delete - /// The record IDs to delete - /// http://tizen.org/privilege/contact.write - /// http://tizen.org/privilege/callhistory.write - /// Thrown when method failed due to invalid operation - /// Thrown when an invoked method is not supported - /// Thrown when one of the arguments provided to a method is not valid - /// Thrown when failed due to out of memory - /// Thrown when application does not have proper privileges - [SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic")] - [SuppressMessage("Microsoft.Design", "CA1054:UriParametersShouldNotBeStrings")] - public void Delete(string viewUri, int[] idArray) - { - int error = Interop.Database.DeleteRecords(viewUri, idArray, idArray.Length); - if ((int)ContactsError.None != error) - { - Log.Error(Globals.LogTag, "Delete Failed with error " + error); - throw ContactsErrorFactory.CheckAndCreateException(error); - } - } - - /// - /// Replaces a record in the contacts database. - /// - /// The record to replace - /// the record ID to be replaced - /// http://tizen.org/privilege/contact.write - /// http://tizen.org/privilege/callhistory.write - /// Thrown when method failed due to invalid operation - /// Thrown when an invoked method is not supported - /// Thrown when one of the arguments provided to a method is not valid - /// Thrown when failed due to out of memory - /// Thrown when application does not have proper privileges - [SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic")] - public void Replace(ContactsRecord record, int recordId) - { - int error = Interop.Database.Replace(record._recordHandle, recordId); - if ((int)ContactsError.None != error) - { - Log.Error(Globals.LogTag, "Replace Failed with error " + error); - throw ContactsErrorFactory.CheckAndCreateException(error); - } - } - - /// - /// Replaces multiple records in the contacts database as a batch operation. - /// - /// The record list to replace - /// The record IDs to be replaced - /// http://tizen.org/privilege/contact.write - /// http://tizen.org/privilege/callhistory.write - /// Thrown when method failed due to invalid operation - /// Thrown when an invoked method is not supported - /// Thrown when one of the arguments provided to a method is not valid - /// Thrown when failed due to out of memory - /// Thrown when application does not have proper privileges - [SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic")] - public void Replace(ContactsList list, int[] idArray) - { - int error = Interop.Database.ReplaceRecords(list._listHandle, idArray, idArray.Length); - if ((int)ContactsError.None != error) - { - Log.Error(Globals.LogTag, "Replace Failed with error " + error); - throw ContactsErrorFactory.CheckAndCreateException(error); - } - } - - /// - /// Retrieves all records as a list. - /// - /// The view URI to get records - /// The index from which results - /// The number to limit results(value 0 is used for all records) - /// - /// The record list - /// - /// http://tizen.org/privilege/contact.read - /// http://tizen.org/privilege/callhistory.read - /// Thrown when method failed due to invalid operation - /// Thrown when an invoked method is not supported - /// Thrown when one of the arguments provided to a method is not valid - /// Thrown when failed due to out of memory - /// Thrown when application does not have proper privileges - [SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic")] - [SuppressMessage("Microsoft.Design", "CA1054:UriParametersShouldNotBeStrings")] - public ContactsList GetAll(string viewUri, int offset, int limit) - { - IntPtr handle; - int error = Interop.Database.GetRecords(viewUri, offset, limit, out handle); - if ((int)ContactsError.None != error) - { - Log.Error(Globals.LogTag, "GetAll Failed with error " + error); - throw ContactsErrorFactory.CheckAndCreateException(error); - } - return new ContactsList(handle); - } - - /// - /// Retrieves records using a query. - /// - /// The query to filter the results - /// The index from which to get results - /// The number to limit results(value 0 is used for get all records) - /// - /// The record list - /// - /// http://tizen.org/privilege/contact.read - /// http://tizen.org/privilege/callhistory.read - /// Thrown when method failed due to invalid operation - /// Thrown when an invoked method is not supported - /// Thrown when one of the arguments provided to a method is not valid - /// Thrown when failed due to out of memory - /// Thrown when application does not have proper privileges - [SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic")] - public ContactsList GetRecordsWithQuery(ContactsQuery query, int offset, int limit) - { - IntPtr handle; - int error = Interop.Database.GetRecords(query._queryHandle, offset, limit, out handle); - if ((int)ContactsError.None != error) - { - Log.Error(Globals.LogTag, "GetAllWithQuery Failed with error " + error); - throw ContactsErrorFactory.CheckAndCreateException(error); - } - return new ContactsList(handle); - } - - /// - /// Retrieves records changes since the given database version. - /// - /// The view URI to get records - /// The address book ID to filter - /// The contacts database version - /// The current contacts database version - /// - /// The record list - /// - /// http://tizen.org/privilege/contact.read - /// Thrown when method failed due to invalid operation - /// Thrown when an invoked method is not supported - /// Thrown when one of the arguments provided to a method is not valid - /// Thrown when failed due to out of memory - /// Thrown when application does not have proper privileges - [SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic")] - [SuppressMessage("Microsoft.Design", "CA1054:UriParametersShouldNotBeStrings")] - public ContactsList GetChangesByVersion(string viewUri, int addressBookId, int contactsDBVersion, out int currentDBVersion) - { - IntPtr recordList; - int error = Interop.Database.GetChangesByVersion(viewUri, addressBookId, contactsDBVersion, out recordList,out currentDBVersion); - if ((int)ContactsError.None != error) - { - Log.Error(Globals.LogTag, "GetChangesByVersion Failed with error " + error); - throw ContactsErrorFactory.CheckAndCreateException(error); - } - return new ContactsList(recordList); - } - - /// - /// Finds records based on a given keyword. - /// - /// - /// This API works only for the Views below. - /// Person, PersonContact, PersonGroupRelation, PersonGroupAssigned and PersonGroupNotAssigned. - /// - /// The view URI to find records - /// The keyword - /// The index from which to get results - /// The number to limit results(value 0 is used for get all records) - /// The record list - /// http://tizen.org/privilege/contact.read - [SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic")] - [SuppressMessage("Microsoft.Design", "CA1054:UriParametersShouldNotBeStrings")] - public ContactsList Search(string viewUri, string keyword, int offset, int limit) - { - IntPtr recordList; - int error = Interop.Database.Search(viewUri, keyword, offset, limit, out recordList); - if ((int)ContactsError.None != error) - { - Log.Error(Globals.LogTag, "Search Failed with error " + error); - throw ContactsErrorFactory.CheckAndCreateException(error); - } - return new ContactsList(recordList); - } - - /// - /// Finds records based on given query and keyword. - /// - /// - /// This API works only for the Views below. - /// Person, PersonContact, PersonGroupRelation, PersonGroupAssigned and PersonGroupNotAssigned. - /// - /// The query to filter - /// The keyword - /// The index from which to get results - /// The number to limit results(value 0 used for get all records) - /// The record list - [SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic")] - public ContactsList Search(ContactsQuery query, string keyword, int offset, int limit) - { - IntPtr recordList; - int error = Interop.Database.Search(query._queryHandle, keyword, offset, limit, out recordList); - if ((int)ContactsError.None != error) - { - Log.Error(Globals.LogTag, "Search Failed with error " + error); - throw ContactsErrorFactory.CheckAndCreateException(error); - } - return new ContactsList(recordList); - } - - /// - /// Finds records based on a keyword and range. - /// - /// - /// This API works only for the Views below. - /// Person, PersonContact, PersonGroupRelation, PersonGroupAssigned, PersonGroupNotAssigned, PersonNumber and PersonEmail - /// - /// The view URI - /// The keyword - /// The index from which to get results - /// The number to limit results(value 0 is used for get all records) - /// The search range, it should be a element of SearchRange or bitwise OR operation of them - /// The record list - [SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic")] - [SuppressMessage("Microsoft.Design", "CA1054:UriParametersShouldNotBeStrings")] - public ContactsList Search(string viewUri, string keyword, int offset, int limit, int range) - { - IntPtr recordList; - int error = Interop.Database.Search(viewUri, keyword, offset, limit, range, out recordList); - if ((int)ContactsError.None != error) - { - Log.Error(Globals.LogTag, "Search Failed with error " + error); - throw ContactsErrorFactory.CheckAndCreateException(error); - } - return new ContactsList(recordList); - } - - /// - /// Finds records based on a given keyword for snippet - /// - /// - /// This API works only for the Views below. - /// Person, PersonContact, PersonGroupRelation, PersonGroupAssigned and PersonGroupNotAssigned. - /// Because start match and end match are needed to be composed with keyword, this API performance is lower than Search(string viewUri, string keyword, int offset, int limit). - /// - /// The view URI to find records - /// The keyword - /// The index from which to get results - /// The number to limit results(value 0 used for get all records) - /// The text which is inserted into the fragment before the keyword(If NULL, default is "[") - /// The text which is inserted into the fragment after the keyword(If NULL, default is "]") - /// The one side extra number of tokens near keyword(If negative value, full sentence is printed. e.g. if token number is 3 with 'abc' keyword, "my name is [abc]de and my home") - /// The record list - [SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic")] - [SuppressMessage("Microsoft.Design", "CA1054:UriParametersShouldNotBeStrings")] - public ContactsList Search(string viewUri, string keyword, int offset, int limit, string startMatch, string endMatch, int tokenNumber) - { - IntPtr recordList; - int error = Interop.Database.Search(viewUri, keyword, offset, limit, startMatch, endMatch, tokenNumber, out recordList); - if ((int)ContactsError.None != error) - { - Log.Error(Globals.LogTag, "Search Failed with error " + error); - throw ContactsErrorFactory.CheckAndCreateException(error); - } - return new ContactsList(recordList); - } - - /// - /// Finds records based on given query and keyword for snippet. - /// - /// - /// This API works only for the Views below. - /// Person, PersonContact, PersonGroupRelation, PersonGroupAssigned and PersonGroupNotAssigned. - /// Because start match and end match are needed to be composed with keyword, this API performance is lower than Search(ContactsQuery query, string keyword, int offset, int limit). - /// - /// The query to filter - /// The keyword - /// The index from which to get results - /// The number to limit results(value 0 used for get all records) - /// The text which is inserted into the fragment before the keyword(If NULL, default is "[") - /// The text which is inserted into the fragment after the keyword(If NULL, default is "]") - /// The one side extra number of tokens near keyword(If negative value, full sentence is printed. e.g. if token number is 3 with 'abc' keyword, "my name is [abc]de and my home") - /// The record list - [SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic")] - public ContactsList Search(ContactsQuery query, string keyword, int offset, int limit, string startMatch, string endMatch, int tokenNumber) - { - IntPtr recordList; - int error = Interop.Database.Search(query._queryHandle, keyword, offset, limit, startMatch, endMatch, tokenNumber, out recordList); - if ((int)ContactsError.None != error) - { - Log.Error(Globals.LogTag, "Search Failed with error " + error); - throw ContactsErrorFactory.CheckAndCreateException(error); - } - return new ContactsList(recordList); - } - - /// - /// Finds records based on a keyword and range for snippet. - /// - /// - /// This API works only for the Views below. - /// Person, PersonContact, PersonGroupRelation, PersonGroupAssigned, PersonGroupNotAssigned, PersonNumber and PersonEmail - /// Because start match and end match are needed to be composed with keyword, this API performance is lower than Search(string viewUri, string keyword, int offset, int limit, int range). - /// - /// The view URI - /// The keyword - /// The index from which to get results - /// The number to limit results(value 0 is used for get all records) - /// The search range, it should be a element of SearchRange or bitwise OR operation of them - /// The text which is inserted into the fragment before the keyword(If NULL, default is "[") - /// The text which is inserted into the fragment after the keyword(If NULL, default is "]") - /// The one side extra number of tokens near keyword(If negative value, full sentence is printed. e.g. if token number is 3 with 'abc' keyword, "my name is [abc]de and my home") - /// The record list - [SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic")] - [SuppressMessage("Microsoft.Design", "CA1054:UriParametersShouldNotBeStrings")] - public ContactsList Search(string viewUri, string keyword, int offset, int limit, int range, string startMatch, string endMatch, int tokenNumber) - { - IntPtr recordList; - int error = Interop.Database.Search(viewUri, keyword, offset, limit, range, startMatch, endMatch, tokenNumber, out recordList); - if ((int)ContactsError.None != error) - { - Log.Error(Globals.LogTag, "Search Failed with error " + error); - throw ContactsErrorFactory.CheckAndCreateException(error); - } - return new ContactsList(recordList); - } - - /// - /// Gets the number of records in a specific view - /// - /// The view URI - /// The count of records - [SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic")] - [SuppressMessage("Microsoft.Design", "CA1054:UriParametersShouldNotBeStrings")] - public int GetCount(string viewUri) - { - int count = -1; - int error = Interop.Database.GetCount(viewUri, out count); - if ((int)ContactsError.None != error) - { - Log.Error(Globals.LogTag, "GetCount Failed with error " + error); - throw ContactsErrorFactory.CheckAndCreateException(error); - } - return count; - } - - /// - /// Gets the number of records matching a query. - /// - /// The query used for filtering the results - /// The count of records - [SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic")] - public int GetCount(ContactsQuery query) - { - int count = -1; - int error = Interop.Database.GetCount(query._queryHandle, out count); - if ((int)ContactsError.None != error) - { - Log.Error(Globals.LogTag, "GetCount Failed with error " + error); - throw ContactsErrorFactory.CheckAndCreateException(error); - } - return count; - } - - /// - /// Registers a EventHandler to be invoked when a record changes. - /// - /// The view URI of records whose changes are monitored - /// The EventHandler to register - [SuppressMessage("Microsoft.Design", "CA1054:UriParametersShouldNotBeStrings")] - public void AddDBChangedEventHandler(string viewUri, EventHandler DBChanged) - { - if (!_callbackMap.ContainsKey(viewUri)) - { - _callbackMap[viewUri] = (string uri, IntPtr userData) => - { - DBChangedEventArgs args = new DBChangedEventArgs(uri); - _eventHandlerMap[uri]?.Invoke(this, args); - }; - - int error = Interop.Database.AddChangedCb(viewUri, _callbackMap[viewUri], IntPtr.Zero); - if ((int)ContactsError.None != error) - { - Log.Error(Globals.LogTag, "AddDBChangedEventHandler Failed with error " + error); - throw ContactsErrorFactory.CheckAndCreateException(error); - } - } - - EventHandler handler = null; - if (!_eventHandlerMap.TryGetValue(viewUri, out handler)) - _eventHandlerMap.Add(viewUri, null); - - _eventHandlerMap[viewUri] = handler + DBChanged; - } - - /// - /// Deregisters a EventHandler. - /// - /// The view URI of records whose changes are monitored - /// The EventHandler to deregister - [SuppressMessage("Microsoft.Design", "CA1054:UriParametersShouldNotBeStrings")] - public void RemoveDBChangedEventHandler(string viewUri, EventHandler DBChanged) - { - EventHandler handler = null; - if (!_eventHandlerMap.TryGetValue(viewUri, out handler)) - _eventHandlerMap.Add(viewUri, null); - else - _eventHandlerMap[viewUri] = handler - DBChanged; - - if (_eventHandlerMap[viewUri] == null) - { - int error = Interop.Database.RemoveChangedCb(viewUri, _callbackMap[viewUri], IntPtr.Zero); - if ((int)ContactsError.None != error) - { - Log.Error(Globals.LogTag, "RemoveDBChangedEventHandler Failed with error " + error); - throw ContactsErrorFactory.CheckAndCreateException(error); - } - _callbackMap.Remove(viewUri); - } - } - } -} diff --git a/src/Tizen.Pims.Contacts/Tizen.Pims.Contacts/ContactsErrorFactory.cs b/src/Tizen.Pims.Contacts/Tizen.Pims.Contacts/ContactsErrorFactory.cs deleted file mode 100644 index b542c5709..000000000 --- a/src/Tizen.Pims.Contacts/Tizen.Pims.Contacts/ContactsErrorFactory.cs +++ /dev/null @@ -1,80 +0,0 @@ -/* - * 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.Pims.Contacts -{ - internal enum ContactsError - { - None = (int)ErrorCode.None, - InvalidParameter = (int)ErrorCode.InvalidParameter, - NotSupported = (int)ErrorCode.NotSupported, - PermissionDenied = (int)ErrorCode.PermissionDenied, - OutOfMemory = (int)ErrorCode.OutOfMemory, - FileNoSpaceOnDevice = (int)ErrorCode.FileNoSpaceOnDevice, - NoData = (int)ErrorCode.NoData, - - DatabaseLocked = -0x02010000 | 0x81, - Database = -0x02010000 | 0x9F, - IpcNotAvaliable = -0x02010000 | 0xB1, - Ipc = -0x02010000 | 0xBF, - System = -0x02010000 | 0xEF - } - - internal static class Globals - { - internal const string LogTag = "Tizen.Pims.Contacts"; - } - - internal static class ContactsErrorFactory - { - static internal Exception CheckAndCreateException(int error) - { - ContactsError e = (ContactsError)error; - switch (e) - { - case ContactsError.None: - return null; - case ContactsError.InvalidParameter: - return new ArgumentException("Invalid Parameters Provided"); - case ContactsError.NotSupported: - return new NotSupportedException("Not Supported"); - case ContactsError.PermissionDenied: - return new UnauthorizedAccessException("Permission Denied"); - case ContactsError.OutOfMemory: - return new OutOfMemoryException("Out of Memory"); - case ContactsError.FileNoSpaceOnDevice: - return new InvalidOperationException("File System is Full"); - case ContactsError.NoData: - return new InvalidOperationException("No Data"); - case ContactsError.DatabaseLocked: - return new InvalidOperationException("Database Locked"); - case ContactsError.Database: - return new InvalidOperationException("Database Failed"); - case ContactsError.IpcNotAvaliable: - return new InvalidOperationException("IPC Not Avaliable"); - case ContactsError.Ipc: - return new InvalidOperationException("IPC failed"); - case ContactsError.System: - return new InvalidOperationException("Internal system error"); - default: - return new InvalidOperationException("Unknown Error Code"); - } - } - } -} diff --git a/src/Tizen.Pims.Contacts/Tizen.Pims.Contacts/ContactsFilter.cs b/src/Tizen.Pims.Contacts/Tizen.Pims.Contacts/ContactsFilter.cs deleted file mode 100644 index 826a73ca3..000000000 --- a/src/Tizen.Pims.Contacts/Tizen.Pims.Contacts/ContactsFilter.cs +++ /dev/null @@ -1,454 +0,0 @@ -/* -* 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.Diagnostics.CodeAnalysis; - -namespace Tizen.Pims.Contacts -{ - /// - /// A filter includes the conditions for the search - /// - public class ContactsFilter:IDisposable - { - internal IntPtr _filterHandle; - - /// - /// Creates a filter with a condition for a string type property. - /// - /// The view URI of a filter - /// The property ID to add a condition - /// The match flag - /// The match value - /// Thrown when an invoked method is not supported - /// Thrown when one of the arguments provided to a method is not valid - /// Thrown when failed due to out of memory - [SuppressMessage("Microsoft.Design", "CA1054:UriParametersShouldNotBeStrings")] - public ContactsFilter(string viewUri, uint propertyId, StringMatchType matchType, string matchValue) - { - int error = Interop.Filter.ContactsFilterCreate(viewUri, out _filterHandle); - if ((int)ContactsError.None != error) - { - Log.Error(Globals.LogTag, "ContactsFilter Failed with error " + error); - throw ContactsErrorFactory.CheckAndCreateException(error); - } - - error = Interop.Filter.ContactsFilterAddStr(_filterHandle, propertyId, matchType, matchValue); - if ((int)ContactsError.None != error) - { - Interop.Filter.ContactsFilterDestroy(_filterHandle); - Log.Error(Globals.LogTag, "ContactsFilter Failed with error " + error); - throw ContactsErrorFactory.CheckAndCreateException(error); - } - } - - /// - /// Creates a filter with a condition for an integer type property. - /// - /// The view URI of a filter - /// The property ID to add a condition - /// The match flag - /// The match value - /// Thrown when an invoked method is not supported - /// Thrown when one of the arguments provided to a method is not valid - /// Thrown when failed due to out of memory - [SuppressMessage("Microsoft.Design", "CA1054:UriParametersShouldNotBeStrings")] - public ContactsFilter(string viewUri, uint propertyId, IntegerMatchType matchType, int matchValue) - { - int error = Interop.Filter.ContactsFilterCreate(viewUri, out _filterHandle); - if ((int)ContactsError.None != error) - { - Log.Error(Globals.LogTag, "ContactsFilter Failed with error " + error); - throw ContactsErrorFactory.CheckAndCreateException(error); - } - - error = Interop.Filter.ContactsFilterAddInt(_filterHandle, propertyId, matchType, matchValue); - if ((int)ContactsError.None != error) - { - Interop.Filter.ContactsFilterDestroy(_filterHandle); - Log.Error(Globals.LogTag, "ContactsFilter Failed with error " + error); - throw ContactsErrorFactory.CheckAndCreateException(error); - } - } - - /// - /// Creates a filter with a condition for a long type property. - /// - /// The view URI of a filter - /// The property ID to add a condition - /// The match flag - /// The match value - /// Thrown when an invoked method is not supported - /// Thrown when one of the arguments provided to a method is not valid - /// Thrown when failed due to out of memory - [SuppressMessage("Microsoft.Design", "CA1054:UriParametersShouldNotBeStrings")] - public ContactsFilter(string viewUri, uint propertyId, IntegerMatchType matchType, long matchValue) - { - int error = Interop.Filter.ContactsFilterCreate(viewUri, out _filterHandle); - if ((int)ContactsError.None != error) - { - Log.Error(Globals.LogTag, "ContactsFilter Failed with error " + error); - throw ContactsErrorFactory.CheckAndCreateException(error); - } - - error = Interop.Filter.ContactsFilterAddLli(_filterHandle, propertyId, matchType, matchValue); - if ((int)ContactsError.None != error) - { - Interop.Filter.ContactsFilterDestroy(_filterHandle); - Log.Error(Globals.LogTag, "ContactsFilter Failed with error " + error); - throw ContactsErrorFactory.CheckAndCreateException(error); - } - } - - /// - /// Creates a filter with a condition for a double type property. - /// - /// The view URI of a filter - /// The property ID to add a condition - /// The match flag - /// The match value - /// Thrown when an invoked method is not supported - /// Thrown when one of the arguments provided to a method is not valid - /// Thrown when failed due to out of memory - [SuppressMessage("Microsoft.Design", "CA1054:UriParametersShouldNotBeStrings")] - public ContactsFilter(string viewUri, uint propertyId, IntegerMatchType matchType, double matchValue) - { - int error = Interop.Filter.ContactsFilterCreate(viewUri, out _filterHandle); - if ((int)ContactsError.None != error) - { - Log.Error(Globals.LogTag, "ContactsFilter Failed with error " + error); - throw ContactsErrorFactory.CheckAndCreateException(error); - } - - error = Interop.Filter.ContactsFilterAddDouble(_filterHandle, propertyId, matchType, matchValue); - if ((int)ContactsError.None != error) - { - Interop.Filter.ContactsFilterDestroy(_filterHandle); - Log.Error(Globals.LogTag, "ContactsFilter Failed with error " + error); - throw ContactsErrorFactory.CheckAndCreateException(error); - } - } - - /// - /// Creates a filter with a condition for a boolean type property. - /// - /// The view URI of a filter - /// The property ID to add a condition - /// The match value - /// Thrown when an invoked method is not supported - /// Thrown when one of the arguments provided to a method is not valid - /// Thrown when failed due to out of memory - [SuppressMessage("Microsoft.Design", "CA1054:UriParametersShouldNotBeStrings")] - public ContactsFilter(string viewUri, uint propertyId, bool matchValue) - { - int error = Interop.Filter.ContactsFilterCreate(viewUri, out _filterHandle); - if ((int)ContactsError.None != error) - { - Log.Error(Globals.LogTag, "ContactsFilter Failed with error " + error); - throw ContactsErrorFactory.CheckAndCreateException(error); - } - - error = Interop.Filter.ContactsFilterAddBool(_filterHandle, propertyId, matchValue); - if ((int)ContactsError.None != error) - { - Interop.Filter.ContactsFilterDestroy(_filterHandle); - Log.Error(Globals.LogTag, "ContactsFilter Failed with error " + error); - throw ContactsErrorFactory.CheckAndCreateException(error); - } - } - - /// - /// Destructor - /// - ~ContactsFilter() - { - Dispose(false); - } - - /// - /// Enumeration for the filter match type of a string. - /// - public enum StringMatchType - { - /// - /// Full string, case-sensitive - /// - Exactly, - /// - /// Full string, case-insensitive - /// - FullString, - /// - /// Sub string, case-insensitive - /// - Contains, - /// - /// Start with, case-insensitive - /// - StartsWith, - /// - /// End with, case-insensitive - /// - EndsWith, - /// - /// IS NOT NUL - /// - Exists, - } - - /// - /// Enumeration for the filter match type of an integer. - /// - public enum IntegerMatchType - { - /// - /// = - /// - Equal, - /// - /// > - /// - GreaterThan, - /// - /// >= - /// - GreaterThanOrEqual, - /// - /// < - /// - LessThan, - /// - /// <= - /// - LessThanOrEqual, - /// - /// <>, this flag can yield poor performance - /// - NotEqual, - /// - /// IS NULL - /// - None, - } - - /// - /// Enumeration for a filter operator. - /// - public enum LogicalOperator - { - /// - /// AND - /// - And, - /// - /// OR - /// - Or, - } - - #region IDisposable Support - private bool disposedValue = false; // To detect redundant calls - - /// - /// Releases all resources used by the ContactsFilter. - /// - /// Disposing by User - protected virtual void Dispose(bool disposing) - { - if (disposing) - { - //Called by User - //Release your own managed resources here. - //You should release all of your own disposable objects here - } - - if (!disposedValue) - { - int error = Interop.Filter.ContactsFilterDestroy(_filterHandle); - if ((int)ContactsError.None != error) - { - Log.Error(Globals.LogTag, "ContactsFilterDestroy Failed with error " + error); - } - - disposedValue = true; - } - } - - /// - /// Releases all resources used by the ContactsFilter. - /// It should be called after finished using of the object. - /// - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - #endregion - - /// - /// Adds a condition for a string type property. - /// - /// The operator type - /// The property ID to add a condition - /// The match flag - /// The match value - /// Thrown when an invoked method is not supported - /// Thrown when one of the arguments provided to a method is not valid - public void AddCondition(LogicalOperator logicalOperator, uint propertyId, StringMatchType matchType, string matchValue) - { - int error = Interop.Filter.ContactsFilterAddOperator(_filterHandle, logicalOperator); - if ((int)ContactsError.None != error) - { - Log.Error(Globals.LogTag, "AddCondition Failed with error " + error); - throw ContactsErrorFactory.CheckAndCreateException(error); - } - - error = Interop.Filter.ContactsFilterAddStr(_filterHandle, propertyId, matchType, matchValue); - if ((int)ContactsError.None != error) - { - Log.Error(Globals.LogTag, "AddCondition Failed with error " + error); - throw ContactsErrorFactory.CheckAndCreateException(error); - } - } - - /// - /// Adds a condition for a integer type property. - /// - /// The operator type - /// The property ID to add a condition - /// The match flag - /// The match value - /// Thrown when an invoked method is not supported - /// Thrown when one of the arguments provided to a method is not valid - public void AddCondition(LogicalOperator logicalOperator, uint propertyId, IntegerMatchType matchType, int matchValue) - { - int error = Interop.Filter.ContactsFilterAddOperator(_filterHandle, logicalOperator); - if ((int)ContactsError.None != error) - { - Log.Error(Globals.LogTag, "AddCondition Failed with error " + error); - throw ContactsErrorFactory.CheckAndCreateException(error); - } - - error = Interop.Filter.ContactsFilterAddInt(_filterHandle, propertyId, matchType, matchValue); - if ((int)ContactsError.None != error) - { - Log.Error(Globals.LogTag, "AddCondition Failed with error " + error); - throw ContactsErrorFactory.CheckAndCreateException(error); - } - } - - /// - /// Adds a condition for a long type property. - /// - /// The operator type - /// The property ID to add a condition - /// The match flag - /// The match value - /// Thrown when an invoked method is not supported - /// Thrown when one of the arguments provided to a method is not valid - public void AddCondition(LogicalOperator logicalOperator, uint propertyId, IntegerMatchType matchType, long matchValue) - { - int error = Interop.Filter.ContactsFilterAddOperator(_filterHandle, logicalOperator); - if ((int)ContactsError.None != error) - { - Log.Error(Globals.LogTag, "AddCondition Failed with error " + error); - throw ContactsErrorFactory.CheckAndCreateException(error); - } - - error = Interop.Filter.ContactsFilterAddLli(_filterHandle, propertyId, matchType, matchValue); - if ((int)ContactsError.None != error) - { - Log.Error(Globals.LogTag, "AddCondition Failed with error " + error); - throw ContactsErrorFactory.CheckAndCreateException(error); - } - } - - /// - /// Adds a condition for a double type property. - /// - /// The operator type - /// The property ID to add a condition - /// The match flag - /// The match value - /// Thrown when an invoked method is not supported - /// Thrown when one of the arguments provided to a method is not valid - public void AddCondition(LogicalOperator logicalOperator, uint propertyId, IntegerMatchType matchType, double matchValue) - { - int error = Interop.Filter.ContactsFilterAddOperator(_filterHandle, logicalOperator); - if ((int)ContactsError.None != error) - { - Log.Error(Globals.LogTag, "AddCondition Failed with error " + error); - throw ContactsErrorFactory.CheckAndCreateException(error); - } - - error = Interop.Filter.ContactsFilterAddDouble(_filterHandle, propertyId, matchType, matchValue); - if ((int)ContactsError.None != error) - { - Log.Error(Globals.LogTag, "AddCondition Failed with error " + error); - throw ContactsErrorFactory.CheckAndCreateException(error); - } - } - - /// - /// Adds a condition for a boolean type property. - /// - /// The operator type - /// The property ID to add a condition - /// The match value - /// Thrown when an invoked method is not supported - /// Thrown when one of the arguments provided to a method is not valid - public void AddCondition(LogicalOperator logicalOperator, uint propertyId, bool matchValue) - { - int error = Interop.Filter.ContactsFilterAddOperator(_filterHandle, logicalOperator); - if ((int)ContactsError.None != error) - { - Log.Error(Globals.LogTag, "AddCondition Failed with error " + error); - throw ContactsErrorFactory.CheckAndCreateException(error); - } - - error = Interop.Filter.ContactsFilterAddBool(_filterHandle, propertyId, matchValue); - if ((int)ContactsError.None != error) - { - Log.Error(Globals.LogTag, "AddCondition Failed with error " + error); - throw ContactsErrorFactory.CheckAndCreateException(error); - } - } - - /// - /// Adds a child filter to a parent filter. - /// - /// The operator type - /// The child filter - /// Thrown when an invoked method is not supported - /// Thrown when one of the arguments provided to a method is not valid - public void AddFilter(LogicalOperator logicalOperator, ContactsFilter filter) - { - int error = Interop.Filter.ContactsFilterAddOperator(_filterHandle, logicalOperator); - if ((int)ContactsError.None != error) - { - Log.Error(Globals.LogTag, "AddFilter Failed with error " + error); - throw ContactsErrorFactory.CheckAndCreateException(error); - } - - error = Interop.Filter.ContactsFilterAddFilter(_filterHandle, filter._filterHandle); - if ((int)ContactsError.None != error) - { - Log.Error(Globals.LogTag, "AddFilter Failed with error " + error); - throw ContactsErrorFactory.CheckAndCreateException(error); - } - } - } -} diff --git a/src/Tizen.Pims.Contacts/Tizen.Pims.Contacts/ContactsList.cs b/src/Tizen.Pims.Contacts/Tizen.Pims.Contacts/ContactsList.cs deleted file mode 100644 index fc62de16e..000000000 --- a/src/Tizen.Pims.Contacts/Tizen.Pims.Contacts/ContactsList.cs +++ /dev/null @@ -1,257 +0,0 @@ -/* -* 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.Pims.Contacts -{ - /// - /// A list of records with the same type - /// - public class ContactsList:IDisposable - { - private Int64 _memoryPressure = 20; - internal IntPtr _listHandle; - internal ContactsList(IntPtr handle) - { - int count; - - _listHandle = handle; - int error = Interop.List.ContactsListGetCount(_listHandle, out count); - if ((int)ContactsError.None != error) - { - Log.Error(Globals.LogTag, "ContactsList Failed with error " + error); - throw ContactsErrorFactory.CheckAndCreateException(error); - } - _memoryPressure += count * ContactsViews.Record.AverageSize; - GC.AddMemoryPressure(_memoryPressure); - } - - /// - /// Creates a contacts record list. - /// - /// Thrown when an invoked method is not supported - /// Thrown when failed due to out of memory - public ContactsList() - { - int error = Interop.List.ContactsListCreate(out _listHandle); - if ((int)ContactsError.None != error) - { - Log.Error(Globals.LogTag, "ContactsList Failed with error " + error); - throw ContactsErrorFactory.CheckAndCreateException(error); - } - GC.AddMemoryPressure(_memoryPressure); - } - - /// - /// Destructor - /// - ~ContactsList() - { - Dispose(false); - } - - /// - /// The count of contact entity. - /// - /// The count of contact entity. - public int Count - { - get - { - int count = -1; - int error = Interop.List.ContactsListGetCount(_listHandle, out count); - if ((int)ContactsError.None != error) - { - Log.Error(Globals.LogTag, "ContactsList Count Failed with error " + error); - } - return count; - } - } - - #region IDisposable Support - private bool disposedValue = false; // To detect redundant calls - - /// - /// Releases all resources used by the ContactsList. - /// - /// Disposing by User - protected virtual void Dispose(bool disposing) - { - if (disposing) - { - //Called by User - //Release your own managed resources here. - //You should release all of your own disposable objects here - } - - if (!disposedValue) - { - int error = Interop.List.ContactsListDestroy(_listHandle, true); - if ((int)ContactsError.None != error) - { - Log.Error(Globals.LogTag, "ContactsListDestroy Failed with error " + error); - } - - disposedValue = true; - GC.RemoveMemoryPressure(_memoryPressure); - } - } - - /// - /// Releases all resources used by the ContactsList. - /// It should be called after finished using of the object. - /// - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - #endregion - - /// - /// Adds a record to the contacts list. - /// - /// The record to add - /// Thrown when an invoked method is not supported - /// Thrown when one of the arguments provided to a method is not valid - public void AddRecord(ContactsRecord record) - { - int error = Interop.List.ContactsListAdd(_listHandle, record._recordHandle); - if ((int)ContactsError.None != error) - { - Log.Error(Globals.LogTag, "AddRecord Failed with error " + error); - throw ContactsErrorFactory.CheckAndCreateException(error); - } - record._disposedValue = true; - _memoryPressure += ContactsViews.Record.AverageSize; - } - - /// - /// Removes a record from the contacts list. - /// - /// The record to remove - /// Thrown when an invoked method is not supported - /// Thrown when one of the arguments provided to a method is not valid - public void RemoveRecord(ContactsRecord record) - { - int error = Interop.List.ContactsListRemove(_listHandle, record._recordHandle); - if ((int)ContactsError.None != error) - { - Log.Error(Globals.LogTag, "RemoveRecord Failed with error " + error); - throw ContactsErrorFactory.CheckAndCreateException(error); - } - record._disposedValue = false; - _memoryPressure -= ContactsViews.Record.AverageSize; - } - - /// - /// Retrieves a record from the contacts list. - /// - /// - /// contacts record - /// - public ContactsRecord GetCurrentRecord() - { - IntPtr handle; - int error = Interop.List.ContactsListGetCurrentRecordP(_listHandle, out handle); - if ((int)ContactsError.None != error) - { - Log.Error(Globals.LogTag, "GetCurrentRecord Failed with error " + error); - throw ContactsErrorFactory.CheckAndCreateException(error); - } - return new ContactsRecord(handle, true); - } - - /// - /// Moves a contacts list to the previous position. - /// - /// - /// When the cursor is already at the first position, it returns false. - /// - public bool MovePrevious() - { - int error = Interop.List.ContactsListPrev(_listHandle); - - if ((int)ContactsError.None == error) - { - return true; - } - else if (Count > 0 && (int)ContactsError.NoData == error) - { - Log.Debug(Globals.LogTag, "Nodata MovePrevious" + error); - return false; - } - else - { - Log.Error(Globals.LogTag, "MovePrevious Failed with error " + error); - throw ContactsErrorFactory.CheckAndCreateException(error); - } - } - - /// - /// Moves a contacts list to the next position. - /// - /// - /// When the cursor is already at the last position, it returns false. - /// - public bool MoveNext() - { - int error = Interop.List.ContactsListNext(_listHandle); - - if ((int)ContactsError.None == error) - { - return true; - } - else if (Count > 0 && (int)ContactsError.NoData == error) - { - Log.Debug(Globals.LogTag, "Nodata MoveNext" + error); - return false; - } - else - { - Log.Error(Globals.LogTag, "MoveNext Failed with error " + error); - throw ContactsErrorFactory.CheckAndCreateException(error); - } - } - - /// - /// Moves a contacts list to the first position. - /// - public void MoveFirst() - { - int error = Interop.List.ContactsListFirst(_listHandle); - if ((int)ContactsError.None != error) - { - Log.Error(Globals.LogTag, "MoveFirst Failed with error " + error); - throw ContactsErrorFactory.CheckAndCreateException(error); - } - } - - /// - /// Moves a contacts list to the last position. - /// - public void MoveLast() - { - int error = Interop.List.ContactsListLast(_listHandle); - if ((int)ContactsError.None != error) - { - Log.Error(Globals.LogTag, "MoveFirst Failed with error " + error); - throw ContactsErrorFactory.CheckAndCreateException(error); - } - } - } -} diff --git a/src/Tizen.Pims.Contacts/Tizen.Pims.Contacts/ContactsManager.cs b/src/Tizen.Pims.Contacts/Tizen.Pims.Contacts/ContactsManager.cs deleted file mode 100644 index 903c86f21..000000000 --- a/src/Tizen.Pims.Contacts/Tizen.Pims.Contacts/ContactsManager.cs +++ /dev/null @@ -1,303 +0,0 @@ -/* -* 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.Diagnostics.CodeAnalysis; - -namespace Tizen.Pims.Contacts -{ - /// - /// Enumeration for name display order. - /// - public enum ContactDisplayOrder - { - /// - /// First name comes at the first - /// - FirstLast, - /// - /// First name comes at the last - /// - LastFirst - }; - - /// - /// Enumeration for name sorting order. - /// - public enum ContactSortingOrder - { - /// - /// Contacts are first sorted based on the first name - /// - FirstLast, - /// - /// Contacts are first sorted based on the last name - /// - LastFirst - }; - - /// - /// A class for managing contact information. It allows applications to access contacts database. - /// - public class ContactsManager : IDisposable - { - private ContactsDatabase _db = null; - private Object thisLock = new Object(); - private Interop.Setting.DisplayOrderChangedCallback _displayOrderChangedCallback; - private Interop.Setting.SortingOrderChangedCallback _sortingOrderChangedCallback; - - /// - /// Creates a ContactsManager. - /// - /// Thrown when method failed due to invalid operation - public ContactsManager() - { - int error = Interop.Service.Connect(); - if ((int)ContactsError.None != error) - { - Log.Error(Globals.LogTag, "Connect Failed with error " + error); - throw ContactsErrorFactory.CheckAndCreateException(error); - } - _db = new ContactsDatabase(); - } - - /// - /// Destructor - /// - ~ContactsManager() - { - Dispose(false); - } - - #region IDisposable Support - private bool disposedValue = false; // To detect redundant calls - - /// - /// Releases all resources used by the ContactsManager. - /// - /// Disposing by User - protected virtual void Dispose(bool disposing) - { - if (disposing) - { - //Called by User - //Release your own managed resources here. - //You should release all of your own disposable objects here - } - - if (!disposedValue) - { - int error = Interop.Service.Disconnect(); - if ((int)ContactsError.None != error) - { - Log.Error(Globals.LogTag, "Disconnect Failed with error " + error); - } - - disposedValue = true; - } - } - - /// - /// Releases all resources used by the ContactsManager. - /// It should be called after finished using of the object. - /// - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - #endregion - - private EventHandler _nameDisplayOrderChanged; - private EventHandler _nameSortingOrderChanged; - - /// - /// (event) NameDisplayOrderChanged is raised when changing setting value of contacts name display order - /// - /// http://tizen.org/privilege/contact.read - public event EventHandler NameDisplayOrderChanged - { - add - { - lock (thisLock) - { - if (_displayOrderChangedCallback == null) - { - _displayOrderChangedCallback = (ContactDisplayOrder nameDisplayOrder, IntPtr userData) => - { - NameDisplayOrderChangedEventArgs args = new NameDisplayOrderChangedEventArgs(nameDisplayOrder); - _nameDisplayOrderChanged?.Invoke(this, args); - }; - } - - if (_nameDisplayOrderChanged == null) - { - int error = Interop.Setting.AddNameDisplayOrderChangedCB(_displayOrderChangedCallback, IntPtr.Zero); - if ((int)ContactsError.None != error) - { - Log.Error(Globals.LogTag, "Add NameDisplayOrderChangedCB Failed with error " + error); - } - } - - _nameDisplayOrderChanged += value; - } - } - - remove - { - lock (thisLock) - { - _nameDisplayOrderChanged -= value; - - if (_nameDisplayOrderChanged == null) - { - int error = Interop.Setting.RemoveNameDisplayOrderChangedCB(_displayOrderChangedCallback, IntPtr.Zero); - if ((int)ContactsError.None != error) - { - Log.Error(Globals.LogTag, "Remove StateChanged Failed with error " + error); - } - } - } - } - } - - /// - /// (event) NameSortingOrderChanged is raised when changing setting value of contacts name sorting order - /// - /// http://tizen.org/privilege/contact.read - public event EventHandler NameSortingOrderChanged - { - add - { - lock (thisLock) - { - if (_sortingOrderChangedCallback == null) - { - _sortingOrderChangedCallback = (ContactSortingOrder nameSortingOrder, IntPtr userData) => - { - NameSortingOrderChangedEventArgs args = new NameSortingOrderChangedEventArgs(nameSortingOrder); - _nameSortingOrderChanged?.Invoke(this, args); - }; - } - - if (_nameSortingOrderChanged == null) - { - int error = Interop.Setting.AddNameSortingOrderChangedCB(_sortingOrderChangedCallback, IntPtr.Zero); - if ((int)ContactsError.None != error) - { - Log.Error(Globals.LogTag, "Add NameSortingOrderChangedCB Failed with error " + error); - } - } - - _nameSortingOrderChanged += value; - } - } - - remove - { - lock (thisLock) - { - _nameSortingOrderChanged -= value; - - if (_nameSortingOrderChanged == null) - { - int error = Interop.Setting.RemoveNameSortingOrderChangedCB(_sortingOrderChangedCallback, IntPtr.Zero); - if ((int)ContactsError.None != error) - { - Log.Error(Globals.LogTag, "Remove StateChanged Failed with error " + error); - } - } - } - } - } - - /// - /// A ContactsDatabase - /// - /// A ContactsDatabase - public ContactsDatabase Database - { - get - { - return _db; - } - } - - /// - /// A setting value of contacts name display order - /// - /// A setting value of contacts name display order - /// - /// DisplayName of contacts returned from database are determined by this property - /// - /// http://tizen.org/privilege/contact.read - /// http://tizen.org/privilege/contact.write - [SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic")] - public ContactDisplayOrder NameDisplayOrder - { - get - { - ContactDisplayOrder contactDisplayOrder; - int error = Interop.Setting.GetNameDisplayOrder(out contactDisplayOrder); - if ((int)ContactsError.None != error) - { - Log.Error(Globals.LogTag, "Get NameDisplayOrder Failed with error " + error); - } - return contactDisplayOrder; - } - set - { - int error = Interop.Setting.SetNameDisplayOrder(value); - if ((int)ContactsError.None != error) - { - Log.Error(Globals.LogTag, "Set NameDisplayOrder Failed with error " + error); - } - } - } - - /// - /// A setting value of contacts name sorting order - /// - /// A setting value of contacts name sorting order - /// - /// Contacts returned from database are first sorted based on the first name or last name by this property - /// - /// http://tizen.org/privilege/contact.read - /// http://tizen.org/privilege/contact.write - [SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic")] - public ContactSortingOrder NameSortingOrder - { - get - { - ContactSortingOrder contactsSortingOrder; - int error = Interop.Setting.GetNameSortingOrder(out contactsSortingOrder); - if ((int)ContactsError.None != error) - { - Log.Error(Globals.LogTag, "Get NameSortingOrder Failed with error " + error); - } - return contactsSortingOrder; - } - set - { - int error = Interop.Setting.SetNameSortingOrder(value); - if ((int)ContactsError.None != error) - { - Log.Error(Globals.LogTag, "Set NameSortingOrder Failed with error " + error); - } - } - } - } -} diff --git a/src/Tizen.Pims.Contacts/Tizen.Pims.Contacts/ContactsQuery.cs b/src/Tizen.Pims.Contacts/Tizen.Pims.Contacts/ContactsQuery.cs deleted file mode 100644 index 4bb4efd2c..000000000 --- a/src/Tizen.Pims.Contacts/Tizen.Pims.Contacts/ContactsQuery.cs +++ /dev/null @@ -1,167 +0,0 @@ -/* -* 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.Diagnostics.CodeAnalysis; - -namespace Tizen.Pims.Contacts -{ - /// - /// A query is used to retrieve data which satisfies given criteria - /// - /// - /// A query is used to retrieve person, group, speed dial, and log data which satisfies a given criteria, such as an integer property being greater than a given value, or a string property containing a given substring. - /// A query needs a filter which can set the conditions for the search. - /// - public class ContactsQuery : IDisposable - { - internal IntPtr _queryHandle; - - /// - /// Creates a query. - /// - /// The view URI of a query - /// Thrown when an invoked method is not supported - /// Thrown when one of the arguments provided to a method is not valid - /// Thrown when failed due to out of memory - [SuppressMessage("Microsoft.Design", "CA1054:UriParametersShouldNotBeStrings")] - public ContactsQuery(string viewUri) - { - int error = Interop.Query.ContactsQueryCreate(viewUri, out _queryHandle); - if ((int)ContactsError.None != error) - { - Log.Error(Globals.LogTag, "ContactsQuery Failed with error " + error); - throw ContactsErrorFactory.CheckAndCreateException(error); - } - } - - internal ContactsQuery(IntPtr handle) - { - _queryHandle = handle; - } - - /// - /// Destructor - /// - ~ContactsQuery() - { - Dispose(false); - } - #region IDisposable Support - private bool disposedValue = false; - - /// - /// Releases all resources used by the ContactsQuery. - /// - /// Disposing by User - protected virtual void Dispose(bool disposing) - { - if (disposing) - { - //Called by User - //Release your own managed resources here. - //You should release all of your own disposable objects here - } - - if (!disposedValue) - { - int error = Interop.Query.ContactsQueryDestroy(_queryHandle); - if ((int)ContactsError.None != error) - { - Log.Error(Globals.LogTag, "ContactsQueryDestroy Failed with error " + error); - } - - disposedValue = true; - } - } - - /// - /// Releases all resources used by the ContactsQuery. - /// It should be called after finished using of the object. - /// - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - #endregion - - /// - /// Adds property IDs for projection. - /// - /// The property ID array - /// Thrown when one of the arguments provided to a method is not valid - public void SetProjection(uint[] propertyIdArray) - { - if (propertyIdArray == null) - { - throw new ArgumentException("Invalid Parameters Provided"); - } - - int error = Interop.Query.ContactsQuerySetProjection(_queryHandle, propertyIdArray, propertyIdArray.Length); - if ((int)ContactsError.None != error) - { - Log.Error(Globals.LogTag, "SetProjection Failed with error " + error); - throw ContactsErrorFactory.CheckAndCreateException(error); - } - } - - /// - /// Sets the "distinct" option for projection. - /// - /// If true it is set, otherwise if false it is unset - public void SetDistinct(bool set) - { - int error = Interop.Query.ContactsQuerySetDistinct(_queryHandle, set); - if ((int)ContactsError.None != error) - { - Log.Error(Globals.LogTag, "SetDistinct Failed with error " + error); - throw ContactsErrorFactory.CheckAndCreateException(error); - } - } - - /// - /// Sets the filter for a query. - /// - /// The filter - /// Thrown when one of the arguments provided to a method is not valid - public void SetFilter(ContactsFilter filter) - { - int error = Interop.Query.ContactsQuerySetFilter(_queryHandle, filter._filterHandle); - if ((int)ContactsError.None != error) - { - Log.Error(Globals.LogTag, "SetFilter Failed with error " + error); - throw ContactsErrorFactory.CheckAndCreateException(error); - } - } - - /// - /// Sets the sort mode for a query. - /// - /// The property ID to sort - /// If true it sorts in the ascending order, otherwise if false it sorts in the descending order - /// Thrown when one of the arguments provided to a method is not valid - public void SetSort(uint propertyId, bool isAscending) - { - int error = Interop.Query.ContactsQuerySetSort(_queryHandle, propertyId, isAscending); - if ((int)ContactsError.None != error) - { - Log.Error(Globals.LogTag, "SetSort Failed with error " + error); - throw ContactsErrorFactory.CheckAndCreateException(error); - } - } - } -} diff --git a/src/Tizen.Pims.Contacts/Tizen.Pims.Contacts/ContactsRecord.cs b/src/Tizen.Pims.Contacts/Tizen.Pims.Contacts/ContactsRecord.cs deleted file mode 100644 index 47dd62be9..000000000 --- a/src/Tizen.Pims.Contacts/Tizen.Pims.Contacts/ContactsRecord.cs +++ /dev/null @@ -1,414 +0,0 @@ -/* -* 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.Diagnostics.CodeAnalysis; -using System.Runtime.InteropServices; - -namespace Tizen.Pims.Contacts -{ - /// - /// A record represents an actual record in the database - /// - /// - /// A record represents an actual record in the database, but you can also consider it a piece of information, such as an address, a phone number, or a group of contacts. - /// A record can be a complex set of data, containing other data. For example, a contact record contains the address property, which is a reference to an address record. - /// An address record belongs to a contact record, and its ContactId property is set to the identifier of the corresponding contact. In this case, the address is the child record of the contact and the contact is the parent record. - /// - public class ContactsRecord : IDisposable - { - private string _uri = null; - private uint _id; - private Int64 _memoryPressure = ContactsViews.Record.AverageSize; - internal IntPtr _recordHandle; - - internal ContactsRecord(IntPtr handle) - { - _recordHandle = handle; - IntPtr viewUri; - int error = Interop.Record.GetUriP(handle, out viewUri); - if ((int)ContactsError.None != error) - { - Log.Error(Globals.LogTag, "ContactsRecord Failed with error " + error); - throw ContactsErrorFactory.CheckAndCreateException(error); - } - GC.AddMemoryPressure(_memoryPressure); - _uri = Marshal.PtrToStringAnsi(viewUri); - } - - internal ContactsRecord(IntPtr handle, bool disposedValue) - { - _recordHandle = handle; - _disposedValue = disposedValue; - IntPtr viewUri; - int error = Interop.Record.GetUriP(handle, out viewUri); - if ((int)ContactsError.None != error) - { - Log.Error(Globals.LogTag, "ContactsRecord Failed with error " + error); - throw ContactsErrorFactory.CheckAndCreateException(error); - } - - if (!_disposedValue) - GC.AddMemoryPressure(_memoryPressure); - _uri = Marshal.PtrToStringAnsi(viewUri); - } - - internal ContactsRecord(IntPtr handle, int id) - { - _recordHandle = handle; - _id = (uint)id; - IntPtr viewUri; - int error = Interop.Record.GetUriP(handle, out viewUri); - if ((int)ContactsError.None != error) - { - Log.Error(Globals.LogTag, "ContactsRecord Failed with error " + error); - throw ContactsErrorFactory.CheckAndCreateException(error); - } - _uri = Marshal.PtrToStringAnsi(viewUri); - GC.AddMemoryPressure(_memoryPressure); - } - - /// - /// Creates a record. - /// - /// The view URI - /// Thrown when an invoked method is not supported - /// Thrown when one of the arguments provided to a method is not valid - /// Thrown when failed due to out of memory - [SuppressMessage("Microsoft.Design", "CA1054:UriParametersShouldNotBeStrings")] - public ContactsRecord(string viewUri) - { - int error = Interop.Record.Create(viewUri, out _recordHandle); - if ((int)ContactsError.None != error) - { - Log.Error(Globals.LogTag, "ContactsRecord Failed with error " + error); - throw ContactsErrorFactory.CheckAndCreateException(error); - } - _uri = viewUri; - GC.AddMemoryPressure(_memoryPressure); - } - - /// - /// Destructor - /// - ~ContactsRecord() - { - Dispose(false); - } - - /// - /// The URI of the record - /// - /// The URI of the record - [SuppressMessage("Microsoft.Design", "CA1056:UriPropertiesShouldNotBeStrings")] - public string Uri - { - get - { - return _uri; - } - } - - #region IDisposable Support - internal bool _disposedValue = false; // To detect redundant calls - - /// - /// Releases all resources used by the ContactsRecord. - /// - /// Disposing by User - protected virtual void Dispose(bool disposing) - { - if (disposing) - { - //Called by User - //Release your own managed resources here. - //You should release all of your own disposable objects here - } - - if (!_disposedValue) - { - int error = Interop.Record.Destroy(_recordHandle, true); - if ((int)ContactsError.None != error) - { - Log.Error(Globals.LogTag, "Dispose Failed with error " + error); - } - _disposedValue = true; - GC.RemoveMemoryPressure(_memoryPressure); - } - } - - /// - /// Releases all resources used by the ContactsRecord. - /// It should be called after finished using of the object. - /// - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - #endregion - - /// - /// Makes a clone of a record. - /// - /// A cloned record - /// Thrown when failed due to out of memory - public ContactsRecord Clone() - { - IntPtr _clonedRecordHandle; - int error = Interop.Record.Clone(_recordHandle, out _clonedRecordHandle); - if ((int)ContactsError.None != error) - { - Log.Error(Globals.LogTag, "Clone Failed with error " + error); - throw ContactsErrorFactory.CheckAndCreateException(error); - } - return new ContactsRecord(_clonedRecordHandle, (int)_id); - } - - /// - /// Gets a value of the property from a record. - /// - /// The property ID - /// - /// The value of the property corresponding to property id. - /// - /// Thrown when one of the arguments provided to a method is not valid - public T Get(uint propertyId) - { - object parsedValue = null; - if (typeof(T) == typeof(string)) - { - string val; - int error = Interop.Record.GetStr(_recordHandle, propertyId, out val); - if ((int)ContactsError.None != error) - { - Log.Error(Globals.LogTag, "Get String Failed with error " + error); - throw ContactsErrorFactory.CheckAndCreateException(error); - } - parsedValue = Convert.ChangeType(val, typeof(T)); - } - else if (typeof(T) == typeof(int)) - { - int val; - int error = Interop.Record.GetInt(_recordHandle, propertyId, out val); - if ((int)ContactsError.None != error) - { - Log.Error(Globals.LogTag, "Get Int Failed with error " + error); - throw ContactsErrorFactory.CheckAndCreateException(error); - } - parsedValue = Convert.ChangeType(val, typeof(T)); - } - else if (typeof(T) == typeof(bool)) - { - bool val; - int error = Interop.Record.GetBool(_recordHandle, propertyId, out val); - if ((int)ContactsError.None != error) - { - Log.Error(Globals.LogTag, "Get Bool Failed with error " + error); - throw ContactsErrorFactory.CheckAndCreateException(error); - } - parsedValue = Convert.ChangeType(val, typeof(T)); - } - else if (typeof(T) == typeof(long)) - { - long val; - int error = Interop.Record.GetLli(_recordHandle, propertyId, out val); - if ((int)ContactsError.None != error) - { - Log.Error(Globals.LogTag, "Get Long Failed with error " + error); - throw ContactsErrorFactory.CheckAndCreateException(error); - } - parsedValue = Convert.ChangeType(val, typeof(T)); - } - else if (typeof(T) == typeof(double)) - { - double val; - int error = Interop.Record.GetDouble(_recordHandle, propertyId, out val); - if ((int)ContactsError.None != error) - { - Log.Error(Globals.LogTag, "Get Long Failed with error " + error); - throw ContactsErrorFactory.CheckAndCreateException(error); - } - parsedValue = Convert.ChangeType(val, typeof(T)); - } - else - { - Log.Error(Globals.LogTag, "Not Supported Data Type"); - throw ContactsErrorFactory.CheckAndCreateException((int)ContactsError.NotSupported); - } - return (T)parsedValue; - } - - /// - /// Sets a value of the property to a record. - /// - /// The property ID - /// The value to set - /// Thrown when one of the arguments provided to a method is not valid - public void Set(uint propertyId, T value) - { - if (typeof(T) == typeof(string)) - { - string val = Convert.ToString(value); - int error = Interop.Record.SetStr(_recordHandle, propertyId, val); - if ((int)ContactsError.None != error) - { - Log.Error(Globals.LogTag, "Set String Failed with error " + error); - throw ContactsErrorFactory.CheckAndCreateException(error); - } - } - else if (typeof(T) == typeof(int)) - { - int val = Convert.ToInt32(value); - int error = Interop.Record.SetInt(_recordHandle, propertyId, val); - if ((int)ContactsError.None != error) - { - Log.Error(Globals.LogTag, "Set Int Failed with error " + error); - throw ContactsErrorFactory.CheckAndCreateException(error); - } - } - else if (typeof(T) == typeof(bool)) - { - bool val = Convert.ToBoolean(value); - int error = Interop.Record.SetBool(_recordHandle, propertyId, val); - if ((int)ContactsError.None != error) - { - Log.Error(Globals.LogTag, "Set Bool Failed with error " + error); - throw ContactsErrorFactory.CheckAndCreateException(error); - } - } - else if (typeof(T) == typeof(long)) - { - long val = Convert.ToInt64(value); - int error = Interop.Record.SetLli(_recordHandle, propertyId, val); - if ((int)ContactsError.None != error) - { - Log.Error(Globals.LogTag, "Set Long Failed with error " + error); - throw ContactsErrorFactory.CheckAndCreateException(error); - } - } - else if (typeof(T) == typeof(double)) - { - double val = Convert.ToDouble(value); - int error = Interop.Record.SetDouble(_recordHandle, propertyId, val); - if ((int)ContactsError.None != error) - { - Log.Error(Globals.LogTag, "Get Long Failed with error " + error); - throw ContactsErrorFactory.CheckAndCreateException(error); - } - } - else - { - Log.Error(Globals.LogTag, "Not Supported Data Type"); - throw ContactsErrorFactory.CheckAndCreateException((int)ContactsError.NotSupported); - } - } - - /// - /// Adds a child record to the parent record. - /// - /// The property ID - /// The child record to add to parent record - /// Thrown when one of the arguments provided to a method is not valid - public void AddChildRecord(uint propertyId, ContactsRecord childRecord) - { - int error = Interop.Record.AddChildRecord(_recordHandle, propertyId, childRecord._recordHandle); - if ((int)ContactsError.None != error) - { - Log.Error(Globals.LogTag, "AddChildRecord Failed with error " + error); - throw ContactsErrorFactory.CheckAndCreateException(error); - } - childRecord._disposedValue = true; - } - - /// - /// Removes a child record from the parent record. - /// - /// The property ID - /// The child record to remove from parent record - /// Thrown when one of the arguments provided to a method is not valid - public void RemoveChildRecord(uint propertyId, ContactsRecord childRecord) - { - int error = Interop.Record.RemoveChildRecord(_recordHandle, propertyId, childRecord._recordHandle); - if ((int)ContactsError.None != error) - { - Log.Error(Globals.LogTag, "RemoveChildRecord Failed with error " + error); - throw ContactsErrorFactory.CheckAndCreateException(error); - } - childRecord._disposedValue = false; - } - - /// - /// Gets the number of child records of a parent record. - /// - /// The property ID - /// The number of child records corresponding to property ID - /// Thrown when one of the arguments provided to a method is not valid - public int GetChildRecordCount(uint propertyId) - { - int count = 0; - int error = Interop.Record.GetChildRecordCount(_recordHandle, propertyId, out count); - if ((int)ContactsError.None != error) - { - Log.Error(Globals.LogTag, "GetChildRecordCount Failed with error " + error); - throw ContactsErrorFactory.CheckAndCreateException(error); - } - return count; - } - - /// - /// Gets a child record from the parent record - /// - /// The property ID - /// The index of child record - /// The record - /// Thrown when one of the arguments provided to a method is not valid - public ContactsRecord GetChildRecord(uint propertyId, int index) - { - IntPtr handle; - - int error = Interop.Record.GetChildRecordAtP(_recordHandle, propertyId, index, out handle); - if ((int)ContactsError.None != error) - { - Log.Error(Globals.LogTag, "GetChildRecord Failed with error " + error); - throw ContactsErrorFactory.CheckAndCreateException(error); - } - return new ContactsRecord(handle, true); - } - - /// - /// Clones a child record list corresponding to property ID - /// - /// The property ID - /// - /// The record list - /// - /// Thrown when one of the arguments provided to a method is not valid - public ContactsList CloneChildRecordList(uint propertyId) - { - IntPtr listHandle; - - int error = Interop.Record.CloneChildRecordList(_recordHandle, propertyId, out listHandle); - if ((int)ContactsError.None != error) - { - Log.Error(Globals.LogTag, "CloneChildRecordList Failed with error " + error); - throw ContactsErrorFactory.CheckAndCreateException(error); - } - ContactsList list = new ContactsList(listHandle); - return list; - } - } -} diff --git a/src/Tizen.Pims.Contacts/Tizen.Pims.Contacts/ContactsVcard.cs b/src/Tizen.Pims.Contacts/Tizen.Pims.Contacts/ContactsVcard.cs deleted file mode 100644 index 8a7b7c03c..000000000 --- a/src/Tizen.Pims.Contacts/Tizen.Pims.Contacts/ContactsVcard.cs +++ /dev/null @@ -1,125 +0,0 @@ -/* -* 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.Pims.Contacts -{ - using ContactsViews; - - /// - /// Delegate for getting a record parsed from a vCard file - /// - /// The contacts record - /// true to continue with the next iteration of the loop, otherwise false to break out of the loop - public delegate bool ParseCallback(ContactsRecord record); - - /// - /// A class for parsing and making vCards. - /// - /// - /// It's based on the vCard v3.0 specification - /// - public static class ContactsVcard - { - /// - /// Retrieves the vCard stream from a contacts record. - /// - /// The contacts record - /// - /// The vCard stream. - /// - /// http://tizen.org/privilege/contact.read - /// Thrown when one of the arguments provided to a method is not valid - /// Thrown when failed due to out of memory - public static string Compose(ContactsRecord record) - { - int error = 0; - string stream = null; - - if (record.Uri.Equals(Person.Uri)) - { - error = Interop.Vcard.ContactsVcardMakeFromPerson(record._recordHandle, out stream); - } - else if (record.Uri.Equals(Contact.Uri)) - { - error = Interop.Vcard.ContactsVcardMakeFromContact(record._recordHandle, out stream); - } - else if (record.Uri.Equals(MyProfile.Uri)) - { - error = Interop.Vcard.ContactsVcardMakeFromMyProfile(record._recordHandle, out stream); - } - else - { - throw new ArgumentException("Invalid Parameters Provided"); - } - - if ((int)ContactsError.None != error) - { - Log.Error(Globals.LogTag, "Compose Failed with error " + error); - throw ContactsErrorFactory.CheckAndCreateException(error); - } - - return stream; - } - - /// - /// Retrieves all contacts with a contacts list from a vCard stream - /// - /// The vCard stream - /// - /// The contacts list - /// - /// Thrown when one of the arguments provided to a method is not valid - /// Thrown when failed due to out of memory - public static ContactsList Parse(string stream) - { - IntPtr listHandle; - - int error = Interop.Vcard.ContactsVcardParseToContacts(stream, out listHandle); - if ((int)ContactsError.None != error) - { - Log.Error(Globals.LogTag, "Parse Failed with error " + error); - throw ContactsErrorFactory.CheckAndCreateException(error); - } - - return new ContactsList(listHandle); - } - - /// - /// Retrieves all contacts with a record from a vCard file. - /// - /// The file path of vCard stream file - /// The callback function to invoke - /// Thrown when method failed due to invalid operation - /// Thrown when one of the arguments provided to a method is not valid - /// Thrown when failed due to out of memory - public static void ParseForEach(string path, ParseCallback callback) - { - Interop.Vcard.ContactsVcardParseCallback cb = (IntPtr handle, IntPtr data) => - { - return callback(new ContactsRecord(handle, true)); - }; - - int error = Interop.Vcard.ContactsVcardParseToContactForeach(path, cb, IntPtr.Zero); - if ((int)ContactsError.None != error) - { - Log.Error(Globals.LogTag, "ParseForEach Failed with error " + error); - throw ContactsErrorFactory.CheckAndCreateException(error); - } - } - } -} diff --git a/src/Tizen.Pims.Contacts/Tizen.Pims.Contacts/ContactsViews.cs b/src/Tizen.Pims.Contacts/Tizen.Pims.Contacts/ContactsViews.cs deleted file mode 100644 index 0620b5aa9..000000000 --- a/src/Tizen.Pims.Contacts/Tizen.Pims.Contacts/ContactsViews.cs +++ /dev/null @@ -1,3308 +0,0 @@ -/* -* 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.Diagnostics.CodeAnalysis; - -namespace Tizen.Pims.Contacts -{ - /// - /// This namespace provides information about views with properties. - /// - /// - /// Views are provided to access and handle entities. A view is a structure, which has property elements. - /// A view is almost the same as a database "VIEW", which limits access and guarantees performance. - /// A "record" represents a single row of the views. - /// A record can have basic properties of five types: integer, string, boolean, long, double. - /// - namespace ContactsViews - { - internal static class Property - { - private const uint AddressBook = 0x00100000; - private const uint Group = 0x00200000; - private const uint Person = 0x00300000; - private const uint Data = 0x00600000; - private const uint SpeedDial = 0x00700000; - private const uint Phonelog = 0x00800000; - private const uint UpdateInfo = 0x00900000; - private const uint PhonelogStat = 0x00B00000; - - private const uint Contact = 0x01000000; - private const uint Name = 0x01100000; - private const uint Number = 0x01200000; - private const uint Email = 0x01300000; - private const uint Address = 0x01400000; - private const uint URL = 0x01500000; - private const uint Event = 0x01600000; - private const uint GroupRelation = 0x01700000; - private const uint Relationship = 0x01800000; - private const uint Company = 0x01900000; - private const uint Nickname = 0x01A00000; - private const uint Messenger = 0x01B00000; - private const uint Note = 0x01C00000; - private const uint Profile = 0x01D00000; - private const uint Image = 0x01E00000; - private const uint Extension = 0x01F00000; - private const uint MyProfile = 0x02000000; - private const uint ActivityPhoto = 0x02100000; - private const uint Sip = 0x02200000; - - /* data_type mask 0x000FF000 */ - private const uint DataTypeBool = 0x00010000; - private const uint DataTypeInt = 0x00020000; - private const uint DataTypeLong = 0x00030000; - private const uint DataTypeString = 0x00040000; - private const uint DataTypeDouble = 0x00050000; - private const uint DataTypeRecord = 0x00060000; - - private const uint ReadOnly = 0x00001000; - - internal enum Id : uint - { - None, - - /* address book */ - AddressBookId = (AddressBook | DataTypeInt | ReadOnly), - AddressBookAccountId = (AddressBook | DataTypeInt) + 1, - AddressBookName = (AddressBook | DataTypeString) + 2, - AddressBookMode = (AddressBook | DataTypeInt) + 3, - - /* group */ - GroupId = (Group | DataTypeInt | ReadOnly), - GroupAddressBookId = (Group | DataTypeInt) + 1, - GroupName = (Group | DataTypeString) + 2, - GroupRingtone = (Group | DataTypeString) + 3, - GroupImage = (Group | DataTypeString) + 4, - GroupVibration = (Group | DataTypeString) + 5, - GroupExtraData = (Group | DataTypeString) + 6, - GroupIsReadOnly = (Group | DataTypeBool) + 7, - GroupMessageAlert = (Group | DataTypeString) + 8, - - /* person */ - PersonId = (Person | DataTypeInt | ReadOnly), - PersonDisplayName = (Person | DataTypeString | ReadOnly) + 1, - PersonDisplayContactId = (Person | DataTypeInt) + 2, - PersonRingtone = (Person | DataTypeString) + 3, - PersonThumbnail = (Person | DataTypeString | ReadOnly) + 4, - PersonVibration = (Person | DataTypeString) + 5, - PersonIsFavorite = (Person | DataTypeBool) + 6, - PersonFavoritePriority = (Person | DataTypeDouble | ReadOnly) + 7, - PersonLinkCount = (Person | DataTypeInt | ReadOnly) + 8, - PersonAddressBookIds = (Person | DataTypeString | ReadOnly) + 9, - PersonHasPhoneNumber = (Person | DataTypeBool | ReadOnly) + 10, - PersonHasEmail = (Person | DataTypeBool | ReadOnly) + 11, - PersonDisplayNameIndex = (Person | DataTypeString | ReadOnly) + 12, - PersonStatus = (Person | DataTypeString | ReadOnly) + 13, - PersonMessageAlert = (Person | DataTypeString) + 14, - PersonSnippetType = (Person | DataTypeInt | ReadOnly) + 15, - PersonSnippetString = (Person | DataTypeString | ReadOnly) + 16, - - /* person-stat */ - PersonUsageType = (Person | DataTypeInt) + 100, - PersonTimesUsed = (Person | DataTypeInt) + 101, - - /* simple contact : read only */ - /* contact */ - ContactId = (Contact | DataTypeInt | ReadOnly), - ContactDisplayName = (Contact | DataTypeString | ReadOnly) + 1, - ContactDisplaySourceDataId = (Contact | DataTypeInt | ReadOnly) + 2, - ContactAddressBookId = (Contact | DataTypeInt) + 3, - ContactRingtone = (Contact | DataTypeString) + 4, - ContactImage = (Contact | DataTypeRecord) + 5, - ContactThumbnail = (Contact | DataTypeString | ReadOnly) + 6, - ContactIsFavorite = (Contact | DataTypeBool) + 7, - ContactHasPhoneNumber = (Contact | DataTypeBool | ReadOnly) + 8, - ContactHasEmail = (Contact | DataTypeBool | ReadOnly) + 9, - ContactPersonId = (Contact | DataTypeInt) + 10, - ContactUId = (Contact | DataTypeString) + 11, - ContactVibration = (Contact | DataTypeString) + 12, - ContactChangedTime = (Contact | DataTypeInt | ReadOnly) + 13, - ContactName = (Contact | DataTypeRecord) + 14, - ContactCompany = (Contact | DataTypeRecord) + 15, - ContactNote = (Contact | DataTypeRecord) + 16, - ContactNumber = (Contact | DataTypeRecord) + 17, - ContactEmail = (Contact | DataTypeRecord) + 18, - ContactEvent = (Contact | DataTypeRecord) + 19, - ContactMessenger = (Contact | DataTypeRecord) + 20, - ContactAddress = (Contact | DataTypeRecord) + 21, - ContactURL = (Contact | DataTypeRecord) + 22, - ContactNickname = (Contact | DataTypeRecord) + 23, - ContactProfile = (Contact | DataTypeRecord) + 24, - ContactRelationship = (Contact | DataTypeRecord) + 25, - ContactGroupRelation = (Contact | DataTypeRecord) + 26, - ContactExtension = (Contact | DataTypeRecord) + 27, - ContactLinkMode = (Contact | DataTypeInt) + 28, - ContactMessageAlert = (Contact | DataTypeString) + 29, - ContactSip = (Contact | DataTypeRecord) + 30, - - /* my_profile */ - MyProfileId = (MyProfile | DataTypeInt | ReadOnly), - MyProfileDisplayName = (MyProfile | DataTypeString | ReadOnly) + 1, - MyProfileAddressBookId = (MyProfile | DataTypeInt) + 2, - MyProfileImage = (MyProfile | DataTypeRecord) + 3, - MyProfileThumbnail = (MyProfile | DataTypeString | ReadOnly) + 4, - MyProfileUId = (MyProfile | DataTypeString) + 5, - MyProfileChangedTime = (MyProfile | DataTypeInt) + 6, - MyProfileName = (MyProfile | DataTypeRecord) + 7, - MyProfileCompany = (MyProfile | DataTypeRecord) + 8, - MyProfileNote = (MyProfile | DataTypeRecord) + 9, - MyProfileNumber = (MyProfile | DataTypeRecord) + 10, - MyProfileEmail = (MyProfile | DataTypeRecord) + 11, - MyProfileEvent = (MyProfile | DataTypeRecord) + 12, - MyProfileMessenger = (MyProfile | DataTypeRecord) + 13, - MyProfileAddress = (MyProfile | DataTypeRecord) + 14, - MyProfileURL = (MyProfile | DataTypeRecord) + 15, - MyProfileNickname = (MyProfile | DataTypeRecord) + 16, - MyProfileProfile = (MyProfile | DataTypeRecord) + 17, - MyProfileRelationship = (MyProfile | DataTypeRecord) + 18, - MyProfileExtension = (MyProfile | DataTypeRecord) + 19, - MyProfileSip = (MyProfile | DataTypeRecord) + 20, - - /* data */ - DataId = (Data | DataTypeInt), - DataContactId = (Data | DataTypeInt) + 1, - DataType = (Data | DataTypeInt) + 2, - DataIsPrimaryDefault = (Data | DataTypeBool) + 3, - DataIsDefault = (Data | DataTypeBool) + 4, - DataData1 = (Data | DataTypeInt) + 5, - DataData2 = (Data | DataTypeString) + 6, - DataData3 = (Data | DataTypeString) + 7, - DataData4 = (Data | DataTypeString) + 8, - DataData5 = (Data | DataTypeString) + 9, - DataData6 = (Data | DataTypeString) + 10, - DataData7 = (Data | DataTypeString) + 11, - DataData8 = (Data | DataTypeString) + 12, - DataData9 = (Data | DataTypeString) + 13, - DataData10 = (Data | DataTypeString) + 14, - - /* contact_name */ - NameId = (Name | DataTypeInt | ReadOnly), - NameContactId = (Name | DataTypeInt) + 1, - NameFirst = (Name | DataTypeString) + 2, - NameLast = (Name | DataTypeString) + 3, - NameAddition = (Name | DataTypeString) + 4, - NameSuffix = (Name | DataTypeString) + 5, - NamePrefix = (Name | DataTypeString) + 6, - NamePhoneticFirst = (Name | DataTypeString) + 7, - NamePhoneticMiddle = (Name | DataTypeString) + 8, - NamePhoneticLast = (Name | DataTypeString) + 9, - - /* contact_number */ - NumberId = (Number | DataTypeInt | ReadOnly), - NumberContactId = (Number | DataTypeInt) + 1, - NumberType = (Number | DataTypeInt) + 2, - NumberLabel = (Number | DataTypeString) + 3, - NumberIsDefault = (Number | DataTypeBool) + 4, - NumberNumber = (Number | DataTypeString) + 5, - NumberNumberFilter = (Number | DataTypeString) + 6, - NumberNormalizedNumber = (Number | DataTypeString | ReadOnly) + 7, - NumberCleanedNumber = (Number | DataTypeString | ReadOnly) + 8, - - /* contact_email */ - EmailId = (Email | DataTypeInt | ReadOnly), - EmailContactId = (Email | DataTypeInt) + 1, - EmailType = (Email | DataTypeInt) + 2, - EmailLabel = (Email | DataTypeString) + 3, - EmailIsDefault = (Email | DataTypeBool) + 4, - EmailEmail = (Email | DataTypeString) + 5, - - /* contact_address */ - AddressId = (Address | DataTypeInt | ReadOnly), - AddressContactId = (Address | DataTypeInt) + 1, - AddressType = (Address | DataTypeInt) + 2, - AddressLabel = (Address | DataTypeString) + 3, - AddressPostbox = (Address | DataTypeString) + 4, - AddressPostalCode = (Address | DataTypeString) + 5, - AddressRegion = (Address | DataTypeString) + 6, - AddressLocality = (Address | DataTypeString) + 7, - AddressStreet = (Address | DataTypeString) + 8, - AddressCountry = (Address | DataTypeString) + 9, - AddressExtended = (Address | DataTypeString) + 10, - AddressIsDefault = (Address | DataTypeBool) + 11, - - /* contact_url */ - URLId = (URL | DataTypeInt | ReadOnly), - URLContactId = (URL | DataTypeInt) + 1, - URLType = (URL | DataTypeInt) + 2, - URLLabel = (URL | DataTypeString) + 3, - URLData = (URL | DataTypeString) + 4, - - /* contact_event */ - EventId = (Event | DataTypeInt | ReadOnly), - EventContactId = (Event | DataTypeInt) + 1, - EventType = (Event | DataTypeInt) + 2, - EventLabel = (Event | DataTypeString) + 3, - EventDate = (Event | DataTypeInt) + 4, - EventCalendarType = (Event | DataTypeInt) + 5, - EventIsLeapMonth = (Event | DataTypeBool) + 6, - - /* contact_grouprelation */ - GroupRelationId = (GroupRelation | DataTypeInt | ReadOnly), - GroupRelationGroupId = (GroupRelation | DataTypeInt) + 1, - GroupRelationContactId = (GroupRelation | DataTypeInt) + 2, - GroupRelationGroupName = (GroupRelation | DataTypeString) + 3, - - /* contact_relationship */ - RelationshipId = (Relationship | DataTypeInt | ReadOnly), - RelationshipContactId = (Relationship | DataTypeInt) + 1, - RelationshipType = (Relationship | DataTypeInt) + 2, - RelationshipLabel = (Relationship | DataTypeString) + 3, - RelationshipName = (Relationship | DataTypeString) + 4, - - /* contact_image */ - ImageId = (Image | DataTypeInt | ReadOnly), - ImageContactId = (Image | DataTypeInt) + 1, - ImageType = (Image | DataTypeInt) + 2, - ImageLabel = (Image | DataTypeString) + 3, - ImagePath = (Image | DataTypeString) + 4, - ImageIsDefault = (Image | DataTypeBool) + 5, - - /* contact_company */ - CompanyId = (Company | DataTypeInt | ReadOnly), - CompanyContactId = (Company | DataTypeInt) + 1, - CompanyType = (Company | DataTypeInt) + 2, - CompanyLabel = (Company | DataTypeString) + 3, - CompanyName = (Company | DataTypeString) + 4, - CompanyDepartment = (Company | DataTypeString) + 5, - CompanyJobTitle = (Company | DataTypeString) + 6, - CompanyRole = (Company | DataTypeString) + 7, - CompanyAssistantName = (Company | DataTypeString) + 8, - CompanyLogo = (Company | DataTypeString) + 9, - CompanyLocation = (Company | DataTypeString) + 10, - CompanyDescription = (Company | DataTypeString) + 11, - CompanyPhoneticName = (Company | DataTypeString) + 12, - - /* contact_nickname */ - NicknameId = (Nickname | DataTypeInt | ReadOnly), - NicknameContactId = (Nickname | DataTypeInt) + 1, - NicknameName = (Nickname | DataTypeString) + 2, - - /* contact_messenger */ - MessengerId = (Messenger | DataTypeInt | ReadOnly), - MessengerContactId = (Messenger | DataTypeInt) + 1, - MessengerType = (Messenger | DataTypeInt) + 2, - MessengerLabel = (Messenger | DataTypeString) + 3, - MessengerIMId = (Messenger | DataTypeString) + 4, - - /* contact_note */ - NoteId = (Note | DataTypeInt | ReadOnly), - NoteContactId = (Note | DataTypeInt) + 1, - NoteNote = (Note | DataTypeString) + 2, - - /* contact sip */ - SipId = (Sip | DataTypeInt | ReadOnly), - SipContactId = (Sip | DataTypeInt) + 1, - SipAddress = (Sip | DataTypeString) + 2, - SipType = (Sip | DataTypeInt) + 3, - SipLabel = (Sip | DataTypeString) + 4, - - /* contact_profile */ - ProfileId = (Profile | DataTypeInt | ReadOnly), - ProfileContactId = (Profile | DataTypeInt) + 1, - ProfileUId = (Profile | DataTypeString) + 2, - ProfileText = (Profile | DataTypeString) + 3, - ProfileOrder = (Profile | DataTypeInt) + 4, - ProfileServiceOperation = (Profile | DataTypeString) + 5, - ProfileMIME = (Profile | DataTypeString) + 6, - ProfileAppId = (Profile | DataTypeString) + 7, - ProfileUri = (Profile | DataTypeString) + 8, - ProfileCategory = (Profile | DataTypeString) + 9, - ProfileExtraData = (Profile | DataTypeString) + 10, - - ExtensionId = (Extension | DataTypeInt | ReadOnly), - ExtensionContactId = (Extension | DataTypeInt) + 1, - ExtensionData1 = (Extension | DataTypeInt) + 2, - ExtensionData2 = (Extension | DataTypeString) + 3, - ExtensionData3 = (Extension | DataTypeString) + 4, - ExtensionData4 = (Extension | DataTypeString) + 5, - ExtensionData5 = (Extension | DataTypeString) + 6, - ExtensionData6 = (Extension | DataTypeString) + 7, - ExtensionData7 = (Extension | DataTypeString) + 8, - ExtensionData8 = (Extension | DataTypeString) + 9, - ExtensionData9 = (Extension | DataTypeString) + 10, - ExtensionData10 = (Extension | DataTypeString) + 11, - ExtensionData11 = (Extension | DataTypeString) + 12, - ExtensionData12 = (Extension | DataTypeString) + 13, - - /* speeddial */ - SpeedDialDialNumber = (SpeedDial | DataTypeInt), - SpeedDialNumberId = (SpeedDial | DataTypeInt) + 1, - SpeedDialNumber = (SpeedDial | DataTypeString | ReadOnly) + 2, - SpeedDialNumberLabel = (SpeedDial | DataTypeString | ReadOnly) + 3, - SpeedDialNumberType = (SpeedDial | DataTypeInt | ReadOnly) + 4, - SpeedDialPersonId = (SpeedDial | DataTypeInt | ReadOnly) + 5, - SpeedDialDisplayName = (SpeedDial | DataTypeString | ReadOnly) + 6, - SpeedDialThumbnail = (SpeedDial | DataTypeString | ReadOnly) + 7, - SpeedDialNormalizedNumber = (SpeedDial | DataTypeString | ReadOnly) + 8, - SpeedDialCleanedNumber = (SpeedDial | DataTypeString | ReadOnly) + 9, - SpeedDialNumberFilter = (SpeedDial | DataTypeString | ReadOnly) + 10, - - /* phonelog */ - PhonelogId = (Phonelog | DataTypeInt | ReadOnly), - PhonelogPersonId = (Phonelog | DataTypeInt) + 1, - PhonelogAddress = (Phonelog | DataTypeString) + 2, - PhonelogLogTime = (Phonelog | DataTypeInt) + 3, - PhonelogLogType = (Phonelog | DataTypeInt) + 4, - PhonelogExtraData1 = (Phonelog | DataTypeInt) + 5, - PhonelogExtraData2 = (Phonelog | DataTypeString) + 6, - PhonelogNormalizedAddress = (Phonelog | DataTypeString | ReadOnly) + 7, - PhonelogCleanedAddress = (Phonelog | DataTypeString | ReadOnly) + 8, - PhonelogAddressFilter = (Phonelog | DataTypeString | ReadOnly) + 9, - PhonelogSIMSlotNo = (Phonelog | DataTypeInt) + 10, - - /* phonelog_stat */ - PhonelogStatLogCount = (PhonelogStat | DataTypeInt | ReadOnly), - PhonelogStatLogType = (PhonelogStat | DataTypeInt | ReadOnly) + 1, - PhonelogStatSIMSlotNo = (PhonelogStat | DataTypeInt | ReadOnly) + 2, - - /* updated_info : read only */ - UpdateInfoId = (UpdateInfo | DataTypeInt), - UpdateInfoAddressBookId = (UpdateInfo | DataTypeInt) + 1, - UpdateInfoType = (UpdateInfo | DataTypeInt) + 2, - UpdateInfoVersion = (UpdateInfo | DataTypeInt) + 3, - UpdateInfoImageChanged = (UpdateInfo | DataTypeBool) + 4, - UpdateInfoLastChangedType = (UpdateInfo | DataTypeInt) + 5, - } - } - - internal static class Record - { - internal const uint AverageSize = 120; /* average size of person record */ - } - - /// - /// Enumeration for contact change state. - /// - public enum ChangeType - { - /// - /// Inserted - /// - Inserted, - /// - /// Updated - /// - Updated, - /// - /// Deleted - /// - Deleted, - } - - /// - /// Describes properties of a Address book record. - /// - public static class AddressBook - { - /// - /// Identifier of this contacts address book view - /// - public const string Uri = "tizen.contacts_view.addressbook"; - /// - /// integer, read only, DB record ID of the address book - /// - public const uint Id = (uint)Property.Id.AddressBookId; - /// - /// integer, read/write once, Account ID that the address book belongs to - /// - public const uint AccountId = (uint)Property.Id.AddressBookAccountId; - /// - /// string, read/write, It cannot be NULL. Duplicate names are not allowed. - /// - public const uint Name = (uint)Property.Id.AddressBookName; - /// - /// integer, read/write, AddressBook mode, refer to the ModeValue - /// - public const uint Mode = (uint)Property.Id.AddressBookMode; - - /// - /// Enumeration for Address book mode. - /// - public enum ModeValue - { - /// - /// All module can read and write contacts of this address_book - /// - None, - /// - /// All module can only read contacts of this address_book - /// - ReadOnly, - } - } - - /// - /// Describes properties of a Group record. - /// - public static class Group - { - /// - /// Identifier of this contacts group view - /// - public const string Uri = "tizen.contacts_view.group"; - /// - /// DB record ID of the group - /// - public const uint Id = (uint)Property.Id.GroupId; - /// - /// AddressBook ID that the group belongs to - /// - public const uint AddressBookId = (uint)Property.Id.GroupAddressBookId; - /// - /// Group name - /// - public const uint Name = (uint)Property.Id.GroupName; - /// - /// Ringtone path of the group - /// - public const uint RingtonePath = (uint)Property.Id.GroupRingtone; - /// - /// Image path of the group - /// - public const uint ImagePath = (uint)Property.Id.GroupImage; - /// - /// Vibration path of the group - /// - public const uint Vibration = (uint)Property.Id.GroupVibration; - /// - /// Extra data for default group name - /// - public const uint ExtraData = (uint)Property.Id.GroupExtraData; - /// - /// The group is read only or not - /// - public const uint IsReadOnly = (uint)Property.Id.GroupIsReadOnly; - /// - /// Message alert path of the group - /// - public const uint MessageAlert = (uint)Property.Id.GroupMessageAlert; - } - - /// - /// Describes properties of a Person record. - /// - public static class Person - { - /// - /// Identifier of this contacts person view - /// - public const string Uri = "tizen.contacts_view.person"; - /// - /// DB record ID of the person - /// - public const uint Id = (uint)Property.Id.PersonId; - /// - /// Display name of the person - /// - public const uint DisplayName = (uint)Property.Id.PersonDisplayName; - /// - /// The first character of first string for grouping. This is normalized using ICU (projection) - /// - public const uint DisplayNameIndex = (uint)Property.Id.PersonDisplayNameIndex; - /// - /// Display contact ID that the person belongs to - /// - public const uint DisplayContactId = (uint)Property.Id.PersonDisplayContactId; - /// - /// Ringtone path of the person - /// - public const uint RingtonePath = (uint)Property.Id.PersonRingtone; - /// - /// Image thumbnail path of the person - /// - public const uint ThumbnailPath = (uint)Property.Id.PersonThumbnail; - /// - /// Vibration path of the person - /// - public const uint Vibration = (uint)Property.Id.PersonVibration; - /// - /// Message alert path of the person - /// - public const uint MessageAlert = (uint)Property.Id.PersonMessageAlert; - /// - /// Status of social account - /// - public const uint Status = (uint)Property.Id.PersonStatus; - /// - /// The person is favorite or not - /// - public const uint IsFavorite = (uint)Property.Id.PersonIsFavorite; - /// - /// The priority of favorite contacts. it can be used as sorting key - /// - public const uint FavoritePriority = (uint)Property.Id.PersonFavoritePriority; - /// - /// Link count of contact records (projection) - /// - public const uint LinkCount = (uint)Property.Id.PersonLinkCount; - /// - /// AddressBook IDs that the person belongs to (projection) - /// - public const uint AddressBookIds = (uint)Property.Id.PersonAddressBookIds; - /// - /// The person has phone number or not - /// - public const uint HasPhoneNumber = (uint)Property.Id.PersonHasPhoneNumber; - /// - /// The person has email or not - /// - public const uint HasEmail = (uint)Property.Id.PersonHasEmail; - /// - /// keyword matched data type - /// - public const uint SnippetType = (uint)Property.Id.PersonSnippetType; - /// - /// keyword matched data string - /// - public const uint SnippetString = (uint)Property.Id.PersonSnippetString; - } - - /// - /// Describes properties of a Contact record. - /// - public static class Contact - { - /// - /// Identifier of this contact view - /// - public const string Uri = "tizen.contacts_view.contact"; - /// - /// DB record ID of the contact - /// - public const uint Id = (uint)Property.Id.ContactId; - /// - /// Display name of the contact - /// - public const uint DisplayName = (uint)Property.Id.ContactDisplayName; - /// - /// The source type of display name, refer to the DisplayNameSourceType - /// - public const uint DisplaySourceType = (uint)Property.Id.ContactDisplaySourceDataId; - /// - /// AddressBook ID that the contact belongs to - /// - public const uint AddressBookId = (uint)Property.Id.ContactAddressBookId; - /// - /// Ringtone path of the contact - /// - public const uint RingtonePath = (uint)Property.Id.ContactRingtone; - /// - /// Image thumbnail path of the contact - /// - public const uint ThumbnailPath = (uint)Property.Id.ContactThumbnail; - /// - /// The contact is favorite or not - /// - public const uint IsFavorite = (uint)Property.Id.ContactIsFavorite; - /// - /// The contact has phone number or not - /// - public const uint HasPhoneNumber = (uint)Property.Id.ContactHasPhoneNumber; - /// - /// The contact has email or not - /// - public const uint HasEmail = (uint)Property.Id.ContactHasEmail; - /// - /// Person ID that the contact belongs to. If set when inserting, a contact will be linked to person - /// - public const uint PersonId = (uint)Property.Id.ContactPersonId; - /// - /// Unique identifier - /// - public const uint UId = (uint)Property.Id.ContactUId; - /// - /// Vibration path of the contact - /// - public const uint Vibration = (uint)Property.Id.ContactVibration; - /// - /// Message alert path of the contact - /// - public const uint MessageAlert = (uint)Property.Id.ContactMessageAlert; - /// - /// Last changed contact time - /// - public const uint ChangedTime = (uint)Property.Id.ContactChangedTime; - /// - /// The link mode, refer to the LinkModeValue. If the person_id was set, this value will be ignored - /// - public const uint LinkMode = (uint)Property.Id.ContactLinkMode; - /// - /// Name child record (single) - /// - public const uint Name = (uint)Property.Id.ContactName; - /// - /// Company child record (multiple) - /// - public const uint Company = (uint)Property.Id.ContactCompany; - /// - /// Note child record (multiple) - /// - public const uint Note = (uint)Property.Id.ContactNote; - /// - /// Number child record (multiple) - /// - public const uint Number = (uint)Property.Id.ContactNumber; - /// - /// Email child record (multiple) - /// - public const uint Email = (uint)Property.Id.ContactEmail; - /// - /// Event child record (multiple) - /// - public const uint Event = (uint)Property.Id.ContactEvent; - /// - /// Messenger child record (multiple) - /// - public const uint Messenger = (uint)Property.Id.ContactMessenger; - /// - /// Address child record (multiple) - /// - public const uint Address = (uint)Property.Id.ContactAddress; - /// - /// URL child record (multiple) - /// - public const uint URL = (uint)Property.Id.ContactURL; - /// - /// Nickname child record (multiple) - /// - public const uint Nickname = (uint)Property.Id.ContactNickname; - /// - /// Profile child record (multiple) - /// - public const uint Profile = (uint)Property.Id.ContactProfile; - /// - /// Relationship child record (multiple) - /// - public const uint Relationship = (uint)Property.Id.ContactRelationship; - /// - /// Image child record (multiple) - /// - public const uint Image = (uint)Property.Id.ContactImage; - /// - /// GroupRelation child record (multiple) - /// - public const uint GroupRelation = (uint)Property.Id.ContactGroupRelation; - /// - /// Extension child record (multiple) - /// - public const uint Extension = (uint)Property.Id.ContactExtension; - /// - /// Sip child record (multiple) - /// - public const uint Sip = (uint)Property.Id.ContactSip; - - /// - /// Enumeration for link mode when inserting contact. - /// - public enum LinkModeValue - { - /// - /// Auto link immediately - /// - Auto, - /// - /// Do not auto link when the contact is inserted - /// - None - } - - /// - /// Enumeration for Contact display name source type. - /// - public enum DisplayNameSourceType - { - /// - /// Invalid source of display name - /// - Invalid, - /// - /// Produced display name from email record - /// - Email, - /// - /// Produced display name from number record - /// - Number, - /// - /// Produced display name from nickname record - /// - Nickname, - /// - /// Produced display name from company record - /// - Company, - /// - /// Produced display name from name record - /// - Name, - } - - /// - /// Enumeration for contacts data type. - /// - public enum DataType - { - /// - /// None - /// - None, - /// - /// Name - /// - Name = 1, - /// - /// Address - /// - Address = 2, - /// - /// Messenger - /// - Messenger = 3, - /// - /// URL - /// - URL = 4, - /// - /// Event - /// - Event = 5, - /// - /// Company - /// - Company = 6, - /// - /// Nickname - /// - Nickname = 7, - /// - /// Number - /// - Number = 8, - /// - /// Email - /// - Email = 9, - /// - /// Profile - /// - Profile = 10, - /// - /// Relationship - /// - Relationship = 11, - /// - /// Note - /// - Note = 12, - /// - /// Image - /// - Image = 13, - /// - /// SIP - /// - Sip = 14, - /// - /// Extension - /// - Extension = 100 - } - } - - /// - /// Describes properties of a Simple contact record. - /// - public static class SimpleContact - { - /// - /// Identifier of this simple contact view - /// - public const string Uri = "tizen.contacts_view.simple_contact"; - /// - /// DB record ID of the contact - /// - public const uint Id = (uint)Property.Id.ContactId; - /// - /// Display name of the contact - /// - public const uint DisplayName = (uint)Property.Id.ContactDisplayName; - /// - /// The source type of display name, refer to the Contact.DisplayNameSourceType - /// - public const uint DisplaySourceType = (uint)Property.Id.ContactDisplaySourceDataId; - /// - /// AddressBook that the contact belongs to - /// - public const uint AddressBookId = (uint)Property.Id.ContactAddressBookId; - /// - /// Ringtone path of the contact - /// - public const uint RingtonePath = (uint)Property.Id.ContactRingtone; - /// - /// Image thumbnail path of the contact - /// - public const uint ThumbnailPath = (uint)Property.Id.ContactThumbnail; - /// - /// The contact is favorite or not - /// - public const uint IsFavorite = (uint)Property.Id.ContactIsFavorite; - /// - /// The contact has phone number or not - /// - public const uint HasPhoneNumber = (uint)Property.Id.ContactHasPhoneNumber; - /// - /// The contact has email or not - /// - public const uint HasEmail = (uint)Property.Id.ContactHasEmail; - /// - /// Person ID that the contact belongs to - /// - public const uint PersonId = (uint)Property.Id.ContactPersonId; - /// - /// Unique identifier - /// - public const uint UId = (uint)Property.Id.ContactUId; - /// - /// Vibration path of the contact - /// - public const uint Vibration = (uint)Property.Id.ContactVibration; - /// - /// Message alert path of the contact - /// - public const uint MessageAlert = (uint)Property.Id.ContactMessageAlert; - /// - /// Last changed contact time - /// - public const uint ChangedTime = (uint)Property.Id.ContactChangedTime; - } - - /// - /// Describes properties of a My profile record. - /// - public static class MyProfile - { - /// - /// Identifier of this my profile view - /// - public const string Uri = "tizen.contacts_view.my_profile"; - /// - /// DB record ID of the my profile - /// - public const uint Id = (uint)Property.Id.MyProfileId; - /// - /// Display name of the profile - /// - public const uint DisplayName = (uint)Property.Id.MyProfileDisplayName; - /// - /// AddressBook ID that the profile belongs to - /// - public const uint AddressBookId = (uint)Property.Id.MyProfileAddressBookId; - /// - /// Image thumbnail path of the profile - /// - public const uint ThumbnailPath = (uint)Property.Id.MyProfileThumbnail; - /// - /// Unique identifier - /// - public const uint UId = (uint)Property.Id.MyProfileUId; - /// - /// Last changed profile time - /// - public const uint ChangedTime = (uint)Property.Id.MyProfileChangedTime; - /// - /// Name child record (single) - /// - public const uint Name = (uint)Property.Id.MyProfileName; - /// - /// Company child record (multiple) - /// - public const uint Company = (uint)Property.Id.MyProfileCompany; - /// - /// Note child record (multiple) - /// - public const uint Note = (uint)Property.Id.MyProfileNote; - /// - /// Number child record (multiple) - /// - public const uint Number = (uint)Property.Id.MyProfileNumber; - /// - /// Email child record (multiple) - /// - public const uint Email = (uint)Property.Id.MyProfileEmail; - /// - /// Event child record (multiple) - /// - public const uint Event = (uint)Property.Id.MyProfileEvent; - /// - /// Messenger child record (multiple) - /// - public const uint Messenger = (uint)Property.Id.MyProfileMessenger; - /// - /// Address child record (multiple) - /// - public const uint Address = (uint)Property.Id.MyProfileAddress; - /// - /// URL child record (multiple) - /// - public const uint URL = (uint)Property.Id.MyProfileURL; - /// - /// Nickname child record (multiple) - /// - public const uint Nickname = (uint)Property.Id.MyProfileNickname; - /// - /// Profile child record (multiple) - /// - public const uint Profile = (uint)Property.Id.MyProfileProfile; - /// - /// Relationship child record (multiple) - /// - public const uint Relationship = (uint)Property.Id.MyProfileRelationship; - /// - /// Image child record (multiple) - /// - public const uint Image = (uint)Property.Id.MyProfileImage; - /// - /// Extension child record (multiple) - /// - public const uint Extension = (uint)Property.Id.MyProfileExtension; - /// - /// Sip child record (multiple) - /// - public const uint Sip = (uint)Property.Id.MyProfileSip; - } - - /// - /// Describes properties of a Name record. - /// - public static class Name - { - /// - /// Identifier of this contacts name view - /// - public const string Uri = "tizen.contacts_view.name"; - /// - /// DB record ID of the name - /// - public const uint Id = (uint)Property.Id.NameId; - /// - /// Contacts ID that the name record belongs to - /// - public const uint ContactId = (uint)Property.Id.NameContactId; - /// - /// First name - /// - public const uint First = (uint)Property.Id.NameFirst; - /// - /// Last name - /// - public const uint Last = (uint)Property.Id.NameLast; - /// - /// Middle name - /// - public const uint Addition = (uint)Property.Id.NameAddition; - /// - /// Suffix - /// - public const uint Suffix = (uint)Property.Id.NameSuffix; - /// - /// Prefix - /// - public const uint Prefix = (uint)Property.Id.NamePrefix; - /// - /// Pronounce the first name - /// - public const uint PhoneticFirst = (uint)Property.Id.NamePhoneticFirst; - /// - /// Pronounce the middle name - /// - public const uint PhoneticMiddle = (uint)Property.Id.NamePhoneticMiddle; - /// - /// Pronounce the last name - /// - public const uint PhoneticLast = (uint)Property.Id.NamePhoneticLast; - } - - /// - /// Describes properties of a Number record. - /// - public static class Number - { - /// - /// Identifier of this contacts number view - /// - public const string Uri = "tizen.contacts_view.number"; - /// - /// DB record ID of the number - /// - public const uint Id = (uint)Property.Id.NumberId; - /// - /// Contact ID that the number belongs to - /// - public const uint ContactId = (uint)Property.Id.NumberContactId; - /// - /// Number type, refer to the Types - /// - public const uint Type = (uint)Property.Id.NumberType; - /// - /// Custom number type label, when the number type is Types.Custom - /// - public const uint Label = (uint)Property.Id.NumberLabel; - /// - /// The number is default number or not - /// - public const uint IsDefault = (uint)Property.Id.NumberIsDefault; - /// - /// Number - /// - public const uint NumberData = (uint)Property.Id.NumberNumber; - /// - /// You can only use this property for search filter. - /// - public const uint NormalizedNumber = (uint)Property.Id.NumberNormalizedNumber; - /// - /// You can only use this property for search filter. - /// - public const uint CleanedNumber = (uint)Property.Id.NumberCleanedNumber; - /// - /// You can only use this property for search filter. - /// - public const uint NumberFilter = (uint)Property.Id.NumberNumberFilter; - - /// - /// Enumeration for number type. - /// - [Flags] - public enum Types - { - /// - /// Other number type - /// - Other = 0, - /// - /// Custom number type - /// - Custom = 1 << 0, - /// - /// A telephone number associated with a residence - /// - Home = 1 << 1, - /// - /// A telephone number associated with a place of work - /// - Work = 1 << 2, - /// - /// A voice telephone number - /// - Voice = 1 << 3, - /// - /// A facsimile telephone number - /// - Fax = 1 << 4, - /// - /// The telephone number has voice messaging support - /// - Message = 1 << 5, - /// - /// A cellular telephone number - /// - Cell = 1 << 6, - /// - /// A paging device telephone number - /// - Pager = 1 << 7, - /// - /// A bulletin board system telephone number - /// - BBS = 1 << 8, - /// - /// A MODEM connected telephone number - /// - Modem = 1 << 9, - /// - /// A car-phone telephone number - /// - Car = 1 << 10, - /// - /// An ISDN service telephone number - /// - ISDN = 1 << 11, - /// - /// A video conferencing telephone number - /// - Video = 1 << 12, - /// - /// A personal communication services telephone number - /// - PCS = 1 << 13, - /// - /// A company main number - /// - Company = 1 << 14, - /// - /// A radio phone number - /// - Radio = 1 << 15, - /// - /// An additional type for main - /// - Main = 1 << 29, - /// - /// An additional type for assistant - /// - Assistant = 1 << 30, - } - } - - /// - /// Describes properties of a Email record. - /// - public static class Email - { - /// - /// Identifier of this contacts email view - /// - public const string Uri = "tizen.contacts_view.email"; - /// - /// DB record ID of the email - /// - public const uint Id = (uint)Property.Id.EmailId; - /// - /// Contact ID that the email belongs to - /// - public const uint ContactId = (uint)Property.Id.EmailContactId; - /// - /// Email type, refer to the Types - /// - public const uint Type = (uint)Property.Id.EmailType; - /// - /// Custom mail type label, when the email type is Types.Custom - /// - public const uint Label = (uint)Property.Id.EmailLabel; - /// - /// The email is default email or not - /// - public const uint IsDefault = (uint)Property.Id.EmailIsDefault; - /// - /// Email address - /// - public const uint Address = (uint)Property.Id.EmailEmail; - - /// - /// Enumeration for Contact email type. - /// - [Flags] - public enum Types - { - /// - /// Other email type - /// - Other = 0, - /// - /// Custom email type - /// - Custom = 1 << 0, - /// - /// An email address associated with a residence - /// - Home = 1 << 1, - /// - /// An email address associated with a place of work - /// - Work = 1 << 2, - /// - /// A mobile email address - /// - Mobile = 1 << 3, - } - } - - /// - /// Describes properties of a Address record. - /// - public static class Address - { - /// - /// Identifier of this contacts address view - /// - public const string Uri = "tizen.contacts_view.address"; - /// - /// DB record ID of the address - /// - public const uint Id = (uint)Property.Id.AddressId; - /// - /// Contact ID that the address belongs to - /// - public const uint ContactId = (uint)Property.Id.AddressContactId; - /// - /// Address type, refer to the Types - /// - public const uint Type = (uint)Property.Id.AddressType; - /// - /// Address type label, when the address type is Types.Custom - /// - public const uint Label = (uint)Property.Id.AddressLabel; - /// - /// Post office box - /// - public const uint Postbox = (uint)Property.Id.AddressPostbox; - /// - /// Postal code - /// - public const uint PostalCode = (uint)Property.Id.AddressPostalCode; - /// - /// Region - /// - public const uint Region = (uint)Property.Id.AddressRegion; - /// - /// Locality - /// - public const uint Locality = (uint)Property.Id.AddressLocality; - /// - /// Street - /// - public const uint Street = (uint)Property.Id.AddressStreet; - /// - /// Country - /// - public const uint Country = (uint)Property.Id.AddressCountry; - /// - /// Extended address - /// - public const uint Extended = (uint)Property.Id.AddressExtended; - /// - /// The address is default or not - /// - public const uint IsDefault = (uint)Property.Id.AddressIsDefault; - - /// - /// Enumeration for Contact address type. - /// - [Flags] - public enum Types - { - /// - /// Other address type - /// - Other = 0, - /// - /// Custom address type - /// - Custom = 1 << 0, - /// - /// A delivery address for a residence - /// - Home = 1 << 1, - /// - /// A delivery address for a place of work - /// - Work = 1 << 2, - /// - /// A domestic delivery address - /// - Domestic = 1 << 3, - /// - /// An international delivery address - /// - International = 1 << 4, - /// - /// A postal delivery address - /// - Postal = 1 << 5, - /// - /// A parcel delivery address - /// - Parcel = 1 << 6, - } - } - - /// - /// Describes properties of a Note record. - /// - public static class Note - { - /// - /// Identifier of this contacts note view - /// - public const string Uri = "tizen.contacts_view.note"; - /// - /// DB record ID of the note - /// - public const uint Id = (uint)Property.Id.NoteId; - /// - /// Contact ID that the note belongs to - /// - public const uint ContactId = (uint)Property.Id.NoteContactId; - /// - /// Note contents - /// - public const uint Contents = (uint)Property.Id.NoteNote; - } - - /// - /// Describes properties of a URL record. - /// - public static class URL - { - /// - /// Identifier of this contacts URL view - /// - public const string Uri = "tizen.contacts_view.url"; - /// - /// DB record ID of the URL - /// - public const uint Id = (uint)Property.Id.URLId; - /// - /// Contact ID that the URL belongs to - /// - public const uint ContactId = (uint)Property.Id.URLContactId; - /// - /// URL type, refer to the TypeValue - /// - public const uint Type = (uint)Property.Id.URLType; - /// - /// Custom URL type label, when the URL type is TypeValue.Custom - /// - public const uint Label = (uint)Property.Id.URLLabel; - /// - /// URL - /// - public const uint URLData = (uint)Property.Id.URLData; - - /// - /// Enumeration for Contact URL type. - /// - public enum TypeValue - { - /// - /// Other URL type - /// - Other, - /// - /// Custom URL type - /// - Custom, - /// - /// Home URL type - /// - Home, - /// - /// Work URL type - /// - Work, - } - } - - /// - /// Describes properties of a Event record. - /// - [SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords")] - public static class Event - { - /// - /// Identifier of this contacts event view - /// - public const string Uri = "tizen.contacts_view.event"; - /// - /// DB record ID of the event - /// - public const uint Id = (uint)Property.Id.EventId; - /// - /// Contact ID that the event belongs to - /// - public const uint ContactId = (uint)Property.Id.EventContactId; - /// - /// Event type, refer to the TypeValue - /// - public const uint Type = (uint)Property.Id.EventType; - /// - /// Custom event type label, when the event type is TypeValue.Custom - /// - public const uint Label = (uint)Property.Id.EventLabel; - /// - /// Event date(YYYYMMDD). e.g. 2014/1/1 : 20140101. Even if the calendar_type is set as CONTACTS_EVENT_CALENDAR_TYPE_CHINESE, you SHOULD set Gregorian date - /// - public const uint Date = (uint)Property.Id.EventDate; - /// - /// Calendar type, refer to the CalendarType - /// - public const uint IsLeapMonth = (uint)Property.Id.EventIsLeapMonth; - - /// - /// Enumeration for Contact event type. - /// - public enum TypeValue - { - /// - /// Other event type - /// - Other, - /// - /// Custom event type - /// - Custom, - /// - /// Birthday event type - /// - Birthday, - /// - /// Anniversary event type - /// - Anniversary - } - - /// - /// Enumeration for Contact event calendar type. - /// - public enum CalendarType - { - /// - /// Gregorian calendar - /// - Gregorian, - /// - /// Chinese calendar - /// - Chinese - } - } - - /// - /// Describes properties of a Relationship record. - /// - public static class Relationship - { - /// - /// Identifier of this relationship view - /// - public const string Uri = "tizen.contacts_view.relationship"; - /// - /// DB record ID of the relationship - /// - public const uint Id = (uint)Property.Id.RelationshipId; - /// - /// Contact ID that the relationship belongs to - /// - public const uint ContactId = (uint)Property.Id.RelationshipContactId; - /// - /// Relationship type, refer to the TypeValue - /// - public const uint Type = (uint)Property.Id.RelationshipType; - /// - /// Custom relationship type label, when the relationship type is TypeValue.Custom - /// - public const uint Label = (uint)Property.Id.RelationshipLabel; - /// - /// Selected contact name that the relationship belongs to - /// - public const uint Name = (uint)Property.Id.RelationshipName; - - /// - /// Enumeration for Contact relationship type. - /// - public enum TypeValue - { - /// - /// Other relationship type - /// - Other, - /// - /// Assistant type - /// - Assistant, - /// - /// Brother type - /// - Brother, - /// - /// Child type - /// - Child, - /// - /// Domestic Partner type - /// - DomesticPartner, - /// - /// Father type - /// - Father, - /// - /// Friend type - /// - Friend, - /// - /// Manager type - /// - Manager, - /// - /// Mother type - /// - Mother, - /// - /// Parent type - /// - Parent, - /// - /// Partner type - /// - Partner, - /// - /// Referred by type - /// - ReferredBy, - /// - /// Relative type - /// - Relative, - /// - /// Sister type - /// - Sister, - /// - /// Spouse type - /// - Spouse, - /// - /// Custom type - /// - Custom, - } - } - - /// - /// Describes properties of a Image record. - /// - public static class Image - { - /// - /// Identifier of this contacts image view - /// - public const string Uri = "tizen.contacts_view.image"; - /// - /// DB record ID of the image - /// - public const uint Id = (uint)Property.Id.ImageId; - /// - /// Contact ID that the image belongs to - /// - public const uint ContactId = (uint)Property.Id.ImageContactId; - /// - /// Image type, refer to the TypeValue - /// - public const uint Type = (uint)Property.Id.ImageType; - /// - /// Custom image type label, when the image type is TypeValue.Custom - /// - public const uint Label = (uint)Property.Id.ImageLabel; - /// - /// Image thumbnail path - /// - public const uint Path = (uint)Property.Id.ImagePath; - /// - /// The Image is default or not - /// - public const uint IsDefault = (uint)Property.Id.ImageIsDefault; - - /// - /// Enumeration for Contact image type. - /// - public enum TypeValue - { - /// - /// Other type - /// - Other, - /// - /// Custom type - /// - Custom, - } - } - - /// - /// Describes properties of a Company record. - /// - public static class Company - { - /// - /// Identifier of this contacts company view - /// - public const string Uri = "tizen.contacts_view.company"; - /// - /// DB record ID of the company - /// - public const uint Id = (uint)Property.Id.CompanyId; - /// - /// Contact ID that the company belongs to - /// - public const uint ContactId = (uint)Property.Id.CompanyContactId; - /// - /// Company type, refer to the TypeValue - /// - public const uint Type = (uint)Property.Id.CompanyType; - /// - /// Custom company type label, when the company type is TypeValue.Custom - /// - public const uint Label = (uint)Property.Id.CompanyLabel; - /// - /// Company name - /// - public const uint Name = (uint)Property.Id.CompanyName; - /// - /// Department - /// - public const uint Department = (uint)Property.Id.CompanyDepartment; - /// - /// Job title - /// - public const uint JobTitle = (uint)Property.Id.CompanyJobTitle; - /// - /// Assistant name - /// - public const uint AssistantName = (uint)Property.Id.CompanyAssistantName; - /// - /// Role - /// - public const uint Role = (uint)Property.Id.CompanyRole; - /// - /// Company logo image file path - /// - public const uint Logo = (uint)Property.Id.CompanyLogo; - /// - /// Company location - /// - public const uint Location = (uint)Property.Id.CompanyLocation; - /// - /// Description - /// - public const uint Description = (uint)Property.Id.CompanyDescription; - /// - /// Pronounce the company name - /// - public const uint PhoneticName = (uint)Property.Id.CompanyPhoneticName; - - /// - /// Enumeration for Contact company type. - /// - public enum TypeValue - { - /// - /// Other type - /// - Other = 0, - /// - /// Custom type - /// - Custom = 1 << 0, - /// - /// Work type - /// - Work = 1 << 1, - } - } - - /// - /// Describes properties of a Nickname record. - /// - public static class Nickname - { - /// - /// Identifier of this contacts nickname view - /// - public const string Uri = "tizen.contacts_view.nickname"; - /// - /// DB record ID of the nickname - /// - public const uint Id = (uint)Property.Id.NicknameId; - /// - /// Contact ID that the nickname belongs to - /// - public const uint ContactId = (uint)Property.Id.NicknameContactId; - /// - /// Nickname - /// - public const uint Name = (uint)Property.Id.NicknameName; - } - - /// - /// Describes properties of a Messenger record. - /// - public static class Messenger - { - /// - /// Identifier of this contacts messenger view - /// - public const string Uri = "tizen.contacts_view.messenger"; - /// - /// DB record ID of the messenger - /// - public const uint Id = (uint)Property.Id.MessengerId; - /// - /// Contact ID that the messenger belongs to - /// - public const uint ContactId = (uint)Property.Id.MessengerContactId; - /// - /// Messenger type, refer to the TypeValue - /// - public const uint Type = (uint)Property.Id.MessengerType; - /// - /// Custom messenger type label, when the messenger type is TypeValue.Custom - /// - public const uint Label = (uint)Property.Id.MessengerLabel; - /// - /// Messenger ID (email address or email ID...) - /// - public const uint IMId = (uint)Property.Id.MessengerIMId; - - /// - /// Enumeration for Contact messenger type. - /// - public enum TypeValue - { - /// - /// Other messenger type - /// - Other, - /// - /// Custom messenger type - /// - Custom, - /// - /// Google messenger type - /// - Google, - /// - /// Windows live messenger type - /// - WindowsLive, - /// - /// Yahoo messenger type - /// - Yahoo, - /// - /// Facebook messenger type - /// - Facebook, - /// - /// ICQ type - /// - ICQ, - /// - /// AOL instance messenger type - /// - AOL, - /// - /// QQ type - /// - QQ, - /// - /// Jabber type - /// - Jabber, - /// - /// Skype type - /// - Skype, - /// - /// IRC type - /// - IRC, - } - } - - /// - /// Describes properties of a Profile record. - /// - [SuppressMessage("Microsoft.Naming", "CA1724:TypeNamesShouldNotMatchNamespaces")] - public static class Profile - { - /// - /// Identifier of this contacts profile view - /// - public const string Uri = "tizen.contacts_view.profile"; - /// - /// DB record ID of profile - /// - public const uint Id = (uint)Property.Id.ProfileId; - /// - /// Contacts ID that the profile belongs to - /// - public const uint ContactId = (uint)Property.Id.ProfileContactId; - /// - /// Unique identifier - /// - public const uint UId = (uint)Property.Id.ProfileUId; - /// - /// Profile contents - /// - public const uint Text = (uint)Property.Id.ProfileText; - /// - /// Priority to display the profile - /// - public const uint Order = (uint)Property.Id.ProfileOrder; - /// - /// Data for app_control_set_operation - /// - public const uint ServiceOperation = (uint)Property.Id.ProfileServiceOperation; - /// - /// Data for app_control_set_mime - /// - public const uint Mime = (uint)Property.Id.ProfileMIME; - /// - /// Data for app_control_set_app_id - /// - public const uint AppId = (uint)Property.Id.ProfileAppId; - /// - /// Data for app_control_set_uri - /// - public const uint ProfileUri = (uint)Property.Id.ProfileUri; - /// - /// Data for app_control_set_category - /// - public const uint Category = (uint)Property.Id.ProfileCategory; - /// - /// It includes "key:value,key:value," pairs. You should parse it. And you must base64 encode each key and value - /// - public const uint ExtraData = (uint)Property.Id.ProfileExtraData; - } - - /// - /// Describes properties of a Sip record. - /// - public static class Sip - { - /// - /// Identifier of this contacts sip view - /// - public const string Uri = "tizen.contacts_view.sip"; - /// - /// DB record ID of the sip - /// - public const uint Id = (uint)Property.Id.SipId; - /// - /// Contact ID that the sip belongs to - /// - public const uint ContactId = (uint)Property.Id.SipContactId; - /// - /// SIP address - /// - public const uint Address = (uint)Property.Id.SipAddress; - /// - /// sip type, refer to the TypeValue - /// - public const uint Type = (uint)Property.Id.SipType; - /// - /// Custom sip type label, when the sip type is TypeValue.Custom - /// - public const uint Label = (uint)Property.Id.SipLabel; - - /// - /// Enumeration for Contact SIP type. - /// - public enum TypeValue - { - /// - /// Other SIP type - /// - Other, - /// - /// Custom SIP type - /// - Custom, - /// - /// Home SIP type - /// - Home, - /// - /// Work SIP type - /// - Work, - } - } - - /// - /// Describes properties of a Extension record. - /// - public static class Extension - { - /// - /// Identifier of this contacts extension view - /// - public const string Uri = "tizen.contacts_view.extension"; - /// - /// DB record ID of the contact extension - /// - public const uint Id = (uint)Property.Id.ExtensionId; - /// - /// Contact ID that the contact extension belongs to - /// - public const uint ContactId = (uint)Property.Id.ExtensionContactId; - /// - /// The extra child record format for non-provided from contacts-service - /// - public const uint Data1 = (uint)Property.Id.ExtensionData1; - /// - /// The extra child record format for non-provided from contacts-service - /// - public const uint Data2 = (uint)Property.Id.ExtensionData2; - /// - /// The extra child record format for non-provided from contacts-service - /// - public const uint Data3 = (uint)Property.Id.ExtensionData3; - /// - /// The extra child record format for non-provided from contacts-service - /// - public const uint Data4 = (uint)Property.Id.ExtensionData4; - /// - /// The extra child record format for non-provided from contacts-service - /// - public const uint Data5 = (uint)Property.Id.ExtensionData5; - /// - /// The extra child record format for non-provided from contacts-service - /// - public const uint Data6 = (uint)Property.Id.ExtensionData6; - /// - /// The extra child record format for non-provided from contacts-service - /// - public const uint Data7 = (uint)Property.Id.ExtensionData7; - /// - /// The extra child record format for non-provided from contacts-service - /// - public const uint Data8 = (uint)Property.Id.ExtensionData8; - /// - /// The extra child record format for non-provided from contacts-service - /// - public const uint Data9 = (uint)Property.Id.ExtensionData9; - /// - /// The extra child record format for non-provided from contacts-service - /// - public const uint Data10 = (uint)Property.Id.ExtensionData10; - /// - /// The extra child record format for non-provided from contacts-service - /// - public const uint Data11 = (uint)Property.Id.ExtensionData11; - /// - /// The extra child record format for non-provided from contacts-service - /// - public const uint Data12 = (uint)Property.Id.ExtensionData12; - } - - /// - /// Describes properties of a Group relation record. - /// - public static class GroupRelation - { - /// - /// Identifier of this relationship view - /// - public const string Uri = "tizen.contacts_view.group_relation"; - /// - /// DB record ID of the group relation (can not be used as filter) - /// - public const uint Id = (uint)Property.Id.GroupRelationId; - /// - /// DB record ID of the group - /// - public const uint GroupId = (uint)Property.Id.GroupRelationGroupId; - /// - /// DB record ID of the contact - /// - public const uint ContactId = (uint)Property.Id.GroupRelationContactId; - /// - /// Group name - /// - public const uint Name = (uint)Property.Id.GroupRelationGroupName; - } - - /// - /// Describes properties of a Speed dial record. - /// - public static class SpeedDial - { - /// - /// Identifier of this contact speed dial view - /// - public const string Uri = "tizen.contacts_view.speeddial"; - /// - /// Stored speed dial number - /// - public const uint SpeedDialNumber = (uint)Property.Id.SpeedDialDialNumber; - /// - /// Number ID that the speed dial belongs to - /// - public const uint NumberId = (uint)Property.Id.SpeedDialNumberId; - /// - /// Contact number of specified speed dial - /// - public const uint Number = (uint)Property.Id.SpeedDialNumber; - /// - /// Contact number label of specified speed dial, when the number type is Number.Types.Custom - /// - public const uint NumberLabel = (uint)Property.Id.SpeedDialNumberLabel; - /// - /// Contact number type, refer to the Number.Types - /// - public const uint NumberType = (uint)Property.Id.SpeedDialNumberType; - /// - /// Person ID that the speed dial belongs to - /// - public const uint PersonId = (uint)Property.Id.SpeedDialPersonId; - /// - /// Display name that the speed dial belongs to - /// - public const uint DisplayName = (uint)Property.Id.SpeedDialDisplayName; - /// - /// Image thumbnail path that the speed dial belongs to - /// - public const uint ThumbnailPath = (uint)Property.Id.SpeedDialThumbnail; - /// - /// You can only use this property for search filter - /// - public const uint NormalizedNumber = (uint)Property.Id.SpeedDialNormalizedNumber; - /// - /// You can only use this property for search filter - /// - public const uint CleanedNumber = (uint)Property.Id.SpeedDialCleanedNumber; - /// - /// If you add filter with this property, the string will be normalized as minimal match length internally and the match rule will be applied ContactsFilter.StringMatchType.Exactly - /// - public const uint NumberFilter = (uint)Property.Id.SpeedDialNumberFilter; - } - - /// - /// Describes properties of a Phone log record. - /// - public static class PhoneLog - { - /// - /// Identifier of this phone log view - /// - public const string Uri = "tizen.contacts_view.phonelog"; - /// - /// DB record ID of phone log - /// - public const uint Id = (uint)Property.Id.PhonelogId; - /// - /// Person ID that the phone log belongs to - /// - public const uint PersonId = (uint)Property.Id.PhonelogPersonId; - /// - /// Number or Email that the phone log displays - /// - public const uint Address = (uint)Property.Id.PhonelogAddress; - /// - /// Call end time. The value means number of seconds since 1970-01-01 00:00:00 (UTC) - /// - public const uint LogTime = (uint)Property.Id.PhonelogLogTime; - /// - /// Log type, refer to the Type - /// - public const uint LogType = (uint)Property.Id.PhonelogLogType; - /// - /// You can set the related integer data (e.g. message_id, email_id or duration(seconds) of call) - /// - public const uint ExtraData1 = (uint)Property.Id.PhonelogExtraData1; - /// - /// You can set the related string data (e.g. short message, subject) - /// - public const uint ExtraData2 = (uint)Property.Id.PhonelogExtraData2; - /// - /// You can only use this property for search filter - /// - public const uint NormalizedAddress = (uint)Property.Id.PhonelogNormalizedAddress; - /// - /// You can only use this property for search filter - /// - public const uint CleanedAddress = (uint)Property.Id.PhonelogCleanedAddress; - /// - /// You can only use this property for search filter - /// - public const uint AddressFilter = (uint)Property.Id.PhonelogAddressFilter; - /// - /// You can set the related SIM slot number. SimSlotNo 0 means first SIM card, SimSlotNo 1 means second SIM. - /// - public const uint SimSlotNo = (uint)Property.Id.PhonelogSIMSlotNo; - - /// - /// Enumeration for Phone log type. - /// - public enum Type - { - /// - /// None - /// - None, - /// - /// Incoming call - /// - VoiceIncoming = 1, - /// - /// Outgoing call - /// - VoiceOutgoing = 2, - /// - /// Incoming video call - /// - VideoIncoming = 3, - /// - /// Outgoing video call - /// - VideoOutgoing = 4, - /// - /// Not confirmed missed call - /// - VoiceMissedUnseen = 5, - /// - /// Confirmed missed call - /// - VoiceMissedSeen = 6, - /// - /// Not confirmed missed video call - /// - VideoMissedUnseen = 7, - /// - /// Confirmed missed video call - /// - VideoMissedSeen = 8, - /// - /// Rejected call - /// - VoiceRejected = 9, - /// - /// Rejected video call - /// - VideoRejected = 10, - /// - /// Blocked call - /// - VoiceBlocked = 11, - /// - /// Blocked video call - /// - VideoBlocked = 12, - /// - /// Incoming MMS - /// - MMSIncoming = 101, - /// - /// Outgoing MMS - /// - MMSOutgoing = 102, - /// - /// Incoming SMS - /// - SMSIncoming = 103, - /// - /// Outgoing SMS - /// - SMSOutgoing = 104, - /// - /// Blocked SMS - /// - SMSBlocked = 105, - /// - /// Blocked MMS - /// - MMSBlocked = 106, - /// - /// Received email - /// - EmailReceived = 201, - /// - /// Sent email - /// - EmailSent = 202, - - } - } - - /// - /// Describes properties of a Contact updated information record. - /// - /// Read only view - public static class ContactUpdatedInfo - { - /// - /// Identifier of this contact updated info view - /// - public const string Uri = "tizen.contacts_view.contacts_updated_info"; - /// - /// Updated contact ID - /// - public const uint ContactId = (uint)Property.Id.UpdateInfoId; - /// - /// AddressBook ID that the updated contact belongs to - /// - public const uint AddressBookId = (uint)Property.Id.UpdateInfoAddressBookId; - /// - /// Contact change type, refer to the ContactsViews.ChangeType - /// - public const uint Type = (uint)Property.Id.UpdateInfoType; - /// - /// Updated version - /// - public const uint Version = (uint)Property.Id.UpdateInfoVersion; - /// - /// Contact image is changed or not - /// - public const uint ImageChanged = (uint)Property.Id.UpdateInfoImageChanged; - } - - /// - /// Describes properties of a My profile updated information record. - /// - /// Read only view - public static class MyProfileUpdatedInfo - { - /// - /// Identifier of this my profile updated info view - /// - public const string Uri = "tizen.contacts_view.my_profile_updated_info"; - /// - /// Address book ID that the updated my profile belongs to - /// - public const uint AddressBookId = (uint)Property.Id.UpdateInfoAddressBookId; - /// - /// MyProfile change type, refer to the ContactsViews.ChangeType - /// - public const uint LastChangedType = (uint)Property.Id.UpdateInfoLastChangedType; - /// - /// Updated version - /// - public const uint Version = (uint)Property.Id.UpdateInfoVersion; - } - - /// - /// Describes properties of a Group updated information record. - /// - /// Read only view - public static class GroupUpdatedInfo - { - /// - /// Identifier of this group updated info view - /// - public const string Uri = "tizen.contacts_view.groups_updated_info"; - /// - /// Updated group ID - /// - public const uint GroupId = (uint)Property.Id.UpdateInfoId; - /// - /// Address book ID that the updated group belongs to - /// - public const uint AddressBookId = (uint)Property.Id.UpdateInfoAddressBookId; - /// - /// Group change type, refer to the ContactsViews.ChangeType - /// - public const uint Type = (uint)Property.Id.UpdateInfoType; - /// - /// Updated version - /// - public const uint Version = (uint)Property.Id.UpdateInfoVersion; - } - - /// - /// Describes properties of a Group Member updated information record. - /// - /// Read only view - public static class GroupMemberUpdatedInfo - { - /// - /// Identifier of this group member updated info view - /// - public const string Uri = "tizen.contacts_view.groups_member_updated_info"; - /// - /// Updated group ID - /// - public const uint GroupId = (uint)Property.Id.UpdateInfoId; - /// - /// Address book ID that the updated group belongs to - /// - public const uint AddressBookId = (uint)Property.Id.UpdateInfoAddressBookId; - /// - /// Updated version - /// - public const uint Version = (uint)Property.Id.UpdateInfoVersion; - } - - /// - /// Describes properties of a Relation updated information record. - /// - /// Read only view - public static class GroupRelationUpdatedInfo - { - /// - /// Identifier of this group relation updated info view - /// - public const string Uri = "tizen.contacts_view.group_relations_updated_info"; - /// - /// Group ID of group relation - /// - public const uint GroupId = (uint)Property.Id.GroupId; - /// - /// Contact ID of the updated group relation - /// - public const uint ContactId = (uint)Property.Id.ContactId; - /// - /// Address book ID of contact that the updated group relation - /// - public const uint AddressBookId = (uint)Property.Id.AddressBookId; - /// - /// Group relation change type, refer to the ContactsViews.ChangeType - /// - public const uint Type = (uint)Property.Id.UpdateInfoType; - /// - /// Updated version - /// - public const uint Version = (uint)Property.Id.UpdateInfoVersion; - } - - /// - /// Describes properties of a PersonContact record. - /// - /// Read only view - public static class PersonContact - { - /// - /// Identifier of this person contact view - /// - public const string Uri = "tizen.contacts_view.person/simple_contact"; - /// - /// DB record ID of the person - /// - public const uint PersonId = (uint)Property.Id.PersonId; - /// - /// Display name of the person - /// - public const uint DisplayName = (uint)Property.Id.PersonDisplayName; - /// - /// The first character of first string for grouping. This is normalized using ICU (projection) - /// - public const uint DisplayNameIndex = (uint)Property.Id.PersonDisplayNameIndex; - /// - /// Display contact ID that the person belongs to (projection) - /// - public const uint DisplayContactId = (uint)Property.Id.PersonDisplayContactId; - /// - /// Ringtone path of the person (projection) - /// - public const uint RingtonePath = (uint)Property.Id.PersonRingtone; - /// - /// Image thumbnail path of the person (projection) - /// - public const uint ThumbnailPath = (uint)Property.Id.PersonThumbnail; - /// - /// Vibration path of the person (projection) - /// - public const uint Vibration = (uint)Property.Id.PersonVibration; - /// - /// Message alert path of the person (projection) - /// - public const uint MessageAlert = (uint)Property.Id.PersonMessageAlert; - /// - /// Status of social account (projection) - /// - public const uint Status = (uint)Property.Id.PersonStatus; - /// - /// The person is favorite or not - /// - public const uint IsFavorite = (uint)Property.Id.PersonIsFavorite; - /// - /// Link count of contact records (projection) - /// - public const uint LinkCount = (uint)Property.Id.PersonLinkCount; - /// - /// Contact ID that the person belongs to - /// - public const uint ContactId = (uint)Property.Id.ContactId; - /// - /// AddressBook IDs that the person belongs to (projection) - /// - public const uint AddressBookIds = (uint)Property.Id.PersonAddressBookIds; - /// - /// The person has phone number or not - /// - public const uint HasPhoneNumber = (uint)Property.Id.PersonHasPhoneNumber; - /// - /// The person has email or not - /// - public const uint HasEmail = (uint)Property.Id.PersonHasEmail; - /// - /// AddressBook ID that the person belongs to - /// - public const uint AddressBookId = (uint)Property.Id.ContactAddressBookId; - /// - /// AddressBook mode, refer to the AddressBook.Mode - /// - public const uint AddressBookMode = (uint)Property.Id.AddressBookMode; - /// - /// AddressBook name that the person belongs to - /// - public const uint AddressBookName = (uint)Property.Id.AddressBookName; - /// - /// keyword matched data type, refer to the Contact.DataType - /// - public const uint SnippetType = (uint)Property.Id.PersonSnippetType; - /// - /// keyword matched data string - /// - public const uint SnippetString = (uint)Property.Id.PersonSnippetString; - }; - - /// - /// Describes properties of a PersonNumber record. - /// - /// Read only view - public static class PersonNumber - { - /// - /// Identifier of this person number view - /// - public const string Uri = "tizen.contacts_view.person/simple_contact/number"; - /// - /// DB record ID of the person - /// - public const uint PersonId = (uint)Property.Id.PersonId; - /// - /// Display name of the person - /// - public const uint DisplayName = (uint)Property.Id.PersonDisplayName; - /// - /// The first character of first string for grouping. This is normalized using ICU (projection) - /// - public const uint DisplayNameIndex = (uint)Property.Id.PersonDisplayNameIndex; - /// - /// Display contact ID that the person belongs to (projection) - /// - public const uint DisplayContactId = (uint)Property.Id.PersonDisplayContactId; - /// - /// Ringtone path of the person (projection) - /// - public const uint RingtonePath = (uint)Property.Id.PersonRingtone; - /// - /// Image thumbnail path of the person (projection) - /// - public const uint ThumbnailPath = (uint)Property.Id.PersonThumbnail; - /// - /// Vibration path of the person (projection) - /// - public const uint Vibration = (uint)Property.Id.PersonVibration; - /// - /// Message alert path of the person (projection) - /// - public const uint MessageAlert = (uint)Property.Id.PersonMessageAlert; - /// - /// The person is favorite or not - /// - public const uint IsFavorite = (uint)Property.Id.PersonIsFavorite; - /// - /// The person has phone number or not - /// - public const uint HasPhoneNumber = (uint)Property.Id.PersonHasPhoneNumber; - /// - /// The person has email or not - /// - public const uint HasEmail = (uint)Property.Id.PersonHasEmail; - /// - /// Number ID that the person belongs to - /// - public const uint NumberId = (uint)Property.Id.NumberId; - /// - /// Number type, refer to the Number.Types (projection) - /// - public const uint Type = (uint)Property.Id.NumberType; - /// - /// Custom number type label, when the number type is Number.Types.Custom (projection) - /// - public const uint Label = (uint)Property.Id.NumberLabel; - /// - /// The number is default number or not - /// - public const uint IsPrimaryDefault = (uint)Property.Id.DataIsPrimaryDefault; - /// - /// Number - /// - public const uint Number = (uint)Property.Id.NumberNumber; - /// - /// If you add filter with this property, the string will be normalized as minimal match length internally and the match rule will be applied ContactsFilter.StringMatchType.Exactly. - /// - public const uint NumberFilter = (uint)Property.Id.NumberNumberFilter; - /// - /// You can only use this property for search filter - /// - public const uint NormalizedNumber = (uint)Property.Id.NumberNormalizedNumber; - /// - /// You can only use this property for search filter - /// - public const uint CleanedNumber = (uint)Property.Id.NumberCleanedNumber; - /// - /// keyword matched data type, refer to they Contact.DataType - /// - public const uint SnippetType = (uint)Property.Id.PersonSnippetType; - /// - /// keyword matched data string - /// - public const uint SnippetString = (uint)Property.Id.PersonSnippetString; - }; - - /// - /// Describes properties of a PersonEmail record. - /// - /// Read only view - public static class PersonEmail - { - /// - /// Identifier of this person email view - /// - public const string Uri = "tizen.contacts_view.person/simple_contact/email"; - /// - /// DB record ID of the person - /// - public const uint PersonId = (uint)Property.Id.PersonId; - /// - /// Display name of the person - /// - public const uint DisplayName = (uint)Property.Id.PersonDisplayName; - /// - /// The first character of first string for grouping. This is normalized using ICU (projection) - /// - public const uint DisplayNameIndex = (uint)Property.Id.PersonDisplayNameIndex; - /// - /// Display contact ID that the person belongs to (projection) - /// - public const uint DisplayContactId = (uint)Property.Id.PersonDisplayContactId; - /// - /// Ringtone path of the person (projection) - /// - public const uint RingtonePath = (uint)Property.Id.PersonRingtone; - /// - /// Image thumbnail path of the person (projection) - /// - public const uint ThumbnailPath = (uint)Property.Id.PersonThumbnail; - /// - /// Vibration path of the person (projection) - /// - public const uint Vibration = (uint)Property.Id.PersonVibration; - /// - /// Message alert path of the person (projection) - /// - public const uint MessageAlert = (uint)Property.Id.PersonMessageAlert; - /// - /// The person is favorite or not - /// - public const uint IsFavorite = (uint)Property.Id.PersonIsFavorite; - /// - /// The person has phone number or not - /// - public const uint HasPhoneNumber = (uint)Property.Id.PersonHasPhoneNumber; - /// - /// The person has email or not - /// - public const uint HasEmail = (uint)Property.Id.PersonHasEmail; - /// - /// Email ID that the person belongs to - /// - public const uint EmailId = (uint)Property.Id.EmailId; - /// - /// Email type, refer to the Email.Types (projection) - /// - public const uint Type = (uint)Property.Id.EmailType; - /// - /// Custom mail type label, when the email type is Email.Types.Custom (projection) - /// - public const uint Label = (uint)Property.Id.EmailLabel; - /// - /// The email is default email or not - /// - public const uint IsPrimaryDefault = (uint)Property.Id.DataIsPrimaryDefault; - /// - /// Email address - /// - public const uint Email = (uint)Property.Id.EmailEmail; - /// - /// keyword matched data type, refer to they Contact.DataType - /// - public const uint SnippetType = (uint)Property.Id.PersonSnippetType; - /// - /// keyword matched data string - /// - public const uint SnippetString = (uint)Property.Id.PersonSnippetString; - }; - - /// - /// Describes properties of a PersonGroupRelation record. - /// - /// Read only view - public static class PersonGroupRelation - { - /// - /// Identifier of this person group relation view - /// - public const string Uri = "tizen.contacts_view.person/simple_contact/group"; - /// - /// DB record ID of the person - /// - public const uint PersonId = (uint)Property.Id.PersonId; - /// - /// Display name of the person - /// - public const uint DisplayName = (uint)Property.Id.PersonDisplayName; - /// - /// The first character of first string for grouping. This is normalized using ICU (projection) - /// - public const uint DisplayNameIndex = (uint)Property.Id.PersonDisplayNameIndex; - /// - /// Display contact ID that the person belongs to (projection) - /// - public const uint DisplayContactId = (uint)Property.Id.PersonDisplayContactId; - /// - /// Ringtone path of the person (projection) - /// - public const uint RingtonePath = (uint)Property.Id.PersonRingtone; - /// - /// Image thumbnail path of the person (projection) - /// - public const uint ThumbnailPath = (uint)Property.Id.PersonThumbnail; - /// - /// Vibration path of the person (projection) - /// - public const uint Vibration = (uint)Property.Id.PersonVibration; - /// - /// Message alert path of the person (projection) - /// - public const uint MessageAlert = (uint)Property.Id.PersonMessageAlert; - /// - /// Status of social account (projection) - /// - public const uint Status = (uint)Property.Id.PersonStatus; - /// - /// The person is favorite or not - /// - public const uint IsFavorite = (uint)Property.Id.PersonIsFavorite; - /// - /// The person has phone number or not - /// - public const uint HasPhoneNumber = (uint)Property.Id.PersonHasPhoneNumber; - /// - /// The person has email or not - /// - public const uint HasEmail = (uint)Property.Id.PersonHasEmail; - /// - /// Link count of contact records (projection) - /// - public const uint LinkCount = (uint)Property.Id.PersonLinkCount; - /// - /// AddressBook IDs that the person belongs to (projection) - /// - public const uint AddressBookIds = (uint)Property.Id.PersonAddressBookIds; - /// - /// AddressBook ID that the person belongs to - /// - public const uint AddressBookId = (uint)Property.Id.ContactAddressBookId; - /// - /// AddressBook name that the person belongs to - /// - public const uint AddressBookName = (uint)Property.Id.AddressBookName; - /// - /// AddressBook mode, refer to the AddressBook.Mode - /// - public const uint AddressBookMode = (uint)Property.Id.AddressBookMode; - /// - /// Group ID that the person belongs to - /// - public const uint GroupId = (uint)Property.Id.GroupRelationGroupId; - /// - /// Contact ID that the person belongs to (projection) - /// - public const uint ContactId = (uint)Property.Id.GroupRelationContactId; - /// - /// keyword matched data type, refer to they Contact.DataType - /// - public const uint SnippetType = (uint)Property.Id.PersonSnippetType; - /// - /// keyword matched data string - /// - public const uint SnippetString = (uint)Property.Id.PersonSnippetString; - }; - - /// - /// Describes properties of a PersonGroupAssignedrecord. - /// - /// Read only view - public static class PersonGroupAssigned - { - /// - /// Identifier of this person group assigned view - /// - public const string Uri = "tizen.contacts_view.person/simple_contact/group_assigned"; - /// - /// DB record ID of the person - /// - public const uint PersonId = (uint)Property.Id.PersonId; - /// - /// Display name of the person - /// - public const uint DisplayName = (uint)Property.Id.PersonDisplayName; - /// - /// The first character of first string for grouping. This is normalized using ICU (projection) - /// - public const uint DisplayNameIndex = (uint)Property.Id.PersonDisplayNameIndex; - /// - /// Display contact ID that the person belongs to (projection) - /// - public const uint DisplayContactId = (uint)Property.Id.PersonDisplayContactId; - /// - /// Ringtone path of the person (projection) - /// - public const uint RingtonePath = (uint)Property.Id.PersonRingtone; - /// - /// Image thumbnail path of the person (projection) - /// - public const uint ThumbnailPath = (uint)Property.Id.PersonThumbnail; - /// - /// Vibration path of the person (projection) - /// - public const uint Vibration = (uint)Property.Id.PersonVibration; - /// - /// Message alert path of the person (projection) - /// - public const uint MessageAlert = (uint)Property.Id.PersonMessageAlert; - /// - /// Status of social account (projection) - /// - public const uint Status = (uint)Property.Id.PersonStatus; - /// - /// The person is favorite or not - /// - public const uint IsFavorite = (uint)Property.Id.PersonIsFavorite; - /// - /// The person has phone number or not - /// - public const uint HasPhoneNumber = (uint)Property.Id.PersonHasPhoneNumber; - /// - /// The person has email or not - /// - public const uint HasEmail = (uint)Property.Id.PersonHasEmail; - /// - /// Link count of contact records (projection) - /// - public const uint LinkCount = (uint)Property.Id.PersonLinkCount; - /// - /// AddressBook IDs that the linked person belongs to (projection) - /// - public const uint AddressBookIds = (uint)Property.Id.PersonAddressBookIds; - /// - /// AddressBook ID that the person belongs to - /// - public const uint AddressBookId = (uint)Property.Id.ContactAddressBookId; - /// - /// AddressBook mode, refer to the AddressBook.Mode - /// - public const uint AddressBookMode = (uint)Property.Id.AddressBookMode; - /// - /// Group ID that the person belongs to - /// - public const uint GroupId = (uint)Property.Id.GroupRelationGroupId; - /// - /// Contact ID that the person belongs to (projection) - /// - public const uint ContactId = (uint)Property.Id.GroupRelationContactId; - /// - /// keyword matched data type, refer to they Contact.DataType - /// - public const uint SnippetType = (uint)Property.Id.PersonSnippetType; - /// - /// keyword matched data string - /// - public const uint SnippetString = (uint)Property.Id.PersonSnippetString; - }; - - /// - /// Describes properties of a PersonGroupNotAssigned record. - /// - /// Read only view - public static class PersonGroupNotAssigned - { - /// - /// Identifier of this person group not assigned view - /// - public const string Uri = "tizen.contacts_view.person/simple_contact/group_not_assigned"; - /// - /// DB record ID of the person - /// - public const uint PersonId = (uint)Property.Id.PersonId; - /// - /// Display name of the person - /// - public const uint DisplayName = (uint)Property.Id.PersonDisplayName; - /// - /// The first character of first string for grouping. This is normalized using ICU (projection) - /// - public const uint DisplayNameIndex = (uint)Property.Id.PersonDisplayNameIndex; - /// - /// Display contact ID that the person belongs to (projection) - /// - public const uint DisplayContactId = (uint)Property.Id.PersonDisplayContactId; - /// - /// Ringtone path of the person (projection) - /// - public const uint RingtonePath = (uint)Property.Id.PersonRingtone; - /// - /// Image thumbnail path of the person (projection) - /// - public const uint ThumbnailPath = (uint)Property.Id.PersonThumbnail; - /// - /// Vibration path of the person (projection) - /// - public const uint Vibration = (uint)Property.Id.PersonVibration; - /// - /// Message alert path of the person (projection) - /// - public const uint MessageAlert = (uint)Property.Id.PersonMessageAlert; - /// - /// Status of social account (projection) - /// - public const uint Status = (uint)Property.Id.PersonStatus; - /// - /// The person is favorite or not - /// - public const uint IsFavorite = (uint)Property.Id.PersonIsFavorite; - /// - /// The person has phone number or not - /// - public const uint HasPhoneNumber = (uint)Property.Id.PersonHasPhoneNumber; - /// - /// The person has email or not - /// - public const uint HasEmail = (uint)Property.Id.PersonHasEmail; - /// - /// Link count of contact records (projection) - /// - public const uint LinkCount = (uint)Property.Id.PersonLinkCount; - /// - /// AddressBook IDs that the linked person belongs to (projection) - /// - public const uint AddressBookIds = (uint)Property.Id.PersonAddressBookIds; - /// - /// AddressBook ID that the person belongs to - /// - public const uint AddressBookId = (uint)Property.Id.ContactAddressBookId; - /// - /// AddressBook mode, refer to the AddressBook.Mode - /// - public const uint AddressBookMode = (uint)Property.Id.AddressBookMode; - /// - /// Contact ID that the person belongs to (projection) - /// - public const uint ContactId = (uint)Property.Id.ContactId; - /// - /// keyword matched data type, refer to they Contact.DataType - /// - public const uint SnippetType = (uint)Property.Id.PersonSnippetType; - /// - /// keyword matched data string - /// - public const uint SnippetString = (uint)Property.Id.PersonSnippetString; - }; - - /// - /// Describes properties of a PersonPhoneLog record. - /// - /// Read only view - public static class PersonPhoneLog - { - /// - /// Identifier of this phone log view - /// - public const string Uri = "tizen.contacts_view.person/simple_contact/phonelog"; - /// - /// DB record ID of the person - /// - public const uint PersonId = (uint)Property.Id.PersonId; - /// - /// Display name of the person - /// - public const uint DisplayName = (uint)Property.Id.PersonDisplayName; - /// - /// Image thumbnail path of the person (projection) - /// - public const uint ThumbnailPath = (uint)Property.Id.PersonThumbnail; - /// - /// DB record ID of phone log - /// - public const uint LogId = (uint)Property.Id.PhonelogId; - /// - /// Number or Email that the phone log displays - /// - public const uint Address = (uint)Property.Id.PhonelogAddress; - /// - /// Number or Email type (projection) - /// - public const uint AddressType = (uint)Property.Id.DataData1; - /// - /// Call end time. The value means number of seconds since 1970-01-01 00:00:00 (UTC) - /// - public const uint LogTime = (uint)Property.Id.PhonelogLogTime; - /// - /// Log type, refer to the PhoneLog.Types - /// - public const uint LogType = (uint)Property.Id.PhonelogLogType; - /// - /// You can set the related integer data (e.g. message_id, email_id or duration(seconds) of call) (projection) - /// - public const uint ExtraData1 = (uint)Property.Id.PhonelogExtraData1; - /// - /// You can set the related string data (e.g. short message, subject) (projection) - /// - public const uint ExtraData2 = (uint)Property.Id.PhonelogExtraData2; - /// - /// You can only use this property for search filter - /// - public const uint NormalizedAddress = (uint)Property.Id.PhonelogNormalizedAddress; - /// - /// You can only use this property for search filter - /// - public const uint CleanedAddress = (uint)Property.Id.PhonelogCleanedAddress; - /// - /// You can only use this property for search filter - /// - public const uint AddressFilter = (uint)Property.Id.PhonelogAddressFilter; - /// - /// It is related to the SIM slot number. SimSlotNo 0 means first SIM card, SimSlotNo 1 means second SIM. - /// - public const uint SIMSlotNo = (uint)Property.Id.PhonelogSIMSlotNo; - }; - - /// - /// Describes properties of a Person Usage record. - /// - /// Read only view - public static class PersonUsage - { - /// - /// Identifier of this person usage view - /// - public const string Uri = "tizen.contacts_view.person/usag"; - /// - /// DB record ID of the person - /// - public const uint PersonId = (uint)Property.Id.PersonId; - /// - /// Display name of the person - /// - public const uint DisplayName = (uint)Property.Id.PersonDisplayName; - /// - /// The first character of first string for grouping. This is normalized using ICU (projection) - /// - public const uint DisplayNameIndex = (uint)Property.Id.PersonDisplayNameIndex; - /// - /// Display contact ID that the person belongs to (projection) - /// - public const uint DisplayContactId = (uint)Property.Id.PersonDisplayContactId; - /// - /// Ringtone path of the person (projection) - /// - public const uint RingtonePath = (uint)Property.Id.PersonRingtone; - /// - /// Image thumbnail path of the person (projection) - /// - public const uint ThumbnailPath = (uint)Property.Id.PersonThumbnail; - /// - /// Vibration path of the person (projection) - /// - public const uint Vibration = (uint)Property.Id.PersonVibration; - /// - /// Message alert path of the person (projection) - /// - public const uint MessageAlert = (uint)Property.Id.PersonMessageAlert; - /// - /// The person is favorite or not - /// - public const uint IsFavorite = (uint)Property.Id.PersonIsFavorite; - /// - /// The person has phone number or not - /// - public const uint HasPhoneNumber = (uint)Property.Id.PersonHasPhoneNumber; - /// - /// The person has email or not - /// - public const uint HasEmail = (uint)Property.Id.PersonHasEmail; - /// - /// Usage type, refer to the Type - /// - public const uint UsageType = (uint)Property.Id.PersonUsageType; - /// - /// Usage number of person - /// - public const uint TimesUsed = (uint)Property.Id.PersonTimesUsed; - - /// - /// Enumeration for Person usage type. - /// - public enum Type - { - /// - /// None - /// - None, - /// - /// Outgoing call - /// - OutgoingCall, - /// - /// Outgoing message - /// - OutgoingMessage, - /// - /// Outgoing email - /// - OutgoingEmail, - /// - /// Incoming call - /// - IncomingCall, - /// - /// Incoming message - /// - IncomingMessage, - /// - /// Incoming email - /// - IncomingEmail, - /// - /// Missed call - /// - MissedCall, - /// - /// Rejected call - /// - RejectedCall, - /// - /// Blocked call - /// - BlockedCall, - /// - /// Blocked message - /// - BlockedMessage - } - }; - - /// - /// Describes properties of a ContactNumber record. - /// - /// Read only view - public static class ContactNumber - { - /// - /// Identifier of this contacts number view - /// - public const string Uri = "tizen.contacts_view.simple_contact/number"; - /// - /// Contact ID that the number belongs to - /// - public const uint ContactId = (uint)Property.Id.ContactId; - /// - /// Display name of contact that the number belongs to - /// - public const uint DisplayName = (uint)Property.Id.ContactDisplayName; - /// - /// The source type of display name, refer to the Contact.DisplayNameSourceType (projection) - /// - public const uint DisplaySourceType = (uint)Property.Id.ContactDisplaySourceDataId; - /// - /// AddressBook ID that the number belongs to - /// - public const uint AddressBookId = (uint)Property.Id.ContactAddressBookId; - /// - /// Person ID that the number belongs to - /// - public const uint PersonId = (uint)Property.Id.ContactPersonId; - /// - /// Ringtone path that the number belongs to (projection) - /// - public const uint RingtonePath = (uint)Property.Id.ContactRingtone; - /// - /// Image thumbnail path that the number belongs to (projection) - /// - public const uint ThumbnailPath = (uint)Property.Id.ContactThumbnail; - /// - /// DB record ID of the number - /// - public const uint NumberId = (uint)Property.Id.NumberId; - /// - /// Number type, refer to the Number.Types (projection) - /// - public const uint Type = (uint)Property.Id.NumberType; - /// - /// Custom number type label, when the number type is Number.Types.Custom (projection) - /// - public const uint Label = (uint)Property.Id.NumberLabel; - /// - /// The number is default number or not - /// - public const uint IsDefault = (uint)Property.Id.NumberIsDefault; - /// - /// Number - /// - public const uint Number = (uint)Property.Id.NumberNumber; - /// - /// If you add filter with this property, the string will be normalized as minimal match length internally and the match rule will be applied ContactsFilter.StringMatchType.Exactly - /// - public const uint NumberFilter = (uint)Property.Id.NumberNumberFilter; - /// - /// You can only use this property for search filter - /// - public const uint NormalizedNumber = (uint)Property.Id.NumberNormalizedNumber; - /// - /// You can only use this property for search filter - /// - public const uint CleanedNumber = (uint)Property.Id.NumberCleanedNumber; - }; - - /// - /// Describes properties of a ContactEmail record. - /// - /// Read only view - public static class ContactEmail - { - /// - /// Identifier of this contacts email view - /// - public const string Uri = "tizen.contacts_view.simple_contact/email"; - /// - /// Contact ID that the number belongs to - /// - public const uint ContactId = (uint)Property.Id.ContactId; - /// - /// Display name of contact that the number belongs to - /// - public const uint DisplayName = (uint)Property.Id.ContactDisplayName; - /// - /// The source type of display name, refer to the Contact.DisplayNameSourceType (projection) - /// - public const uint DisplaySourceType = (uint)Property.Id.ContactDisplaySourceDataId; - /// - /// AddressBook ID that the number belongs to - /// - public const uint AddressBookId = (uint)Property.Id.ContactAddressBookId; - /// - /// Person ID that the number belongs to - /// - public const uint PersonId = (uint)Property.Id.ContactPersonId; - /// - /// Ringtone path that the number belongs to (projection) - /// - public const uint RingtonePath = (uint)Property.Id.ContactRingtone; - /// - /// Image thumbnail path that the number belongs to (projection) - /// - public const uint ThumbnailPath = (uint)Property.Id.ContactThumbnail; - /// - /// DB record ID of the email - /// - public const uint EmailId = (uint)Property.Id.EmailId; - /// - /// Email type, refer to the Email.Types (projection) - /// - public const uint Type = (uint)Property.Id.EmailType; - /// - /// Custom mail type label, when the email type is Email.Types.Custom (projection) - /// - public const uint Label = (uint)Property.Id.EmailLabel; - /// - /// Email is default email or not - /// - public const uint IsDefault = (uint)Property.Id.EmailIsDefault; - /// - /// Email address - /// - public const uint Email = (uint)Property.Id.EmailEmail; - }; - - /// - /// Describes properties of a ContactGroupRelation record. - /// - /// Read only view - public static class ContactGroupRelation - { - /// - /// Identifier of this contact group relation view - /// - public const string Uri = "tizen.contacts_view.simple_contact/group"; - /// - /// Contact ID that the number belongs to - /// - public const uint ContactId = (uint)Property.Id.ContactId; - /// - /// Display name of contact that the number belongs to - /// - public const uint DisplayName = (uint)Property.Id.ContactDisplayName; - /// - /// The source type of display name, refer to the Contact.DisplayNameSourceType (projection) - /// - public const uint DisplaySourceType = (uint)Property.Id.ContactDisplaySourceDataId; - /// - /// AddressBook ID that the number belongs to - /// - public const uint AddressBookId = (uint)Property.Id.ContactAddressBookId; - /// - /// Person ID that the number belongs to - /// - public const uint PersonId = (uint)Property.Id.ContactPersonId; - /// - /// Ringtone path that the number belongs to (projection) - /// - public const uint RingtonePath = (uint)Property.Id.ContactRingtone; - /// - /// Image thumbnail path that the number belongs to (projection) - /// - public const uint ThumbnailPath = (uint)Property.Id.ContactThumbnail; - /// - /// DB record ID of the group relation - /// - public const uint GroupId = (uint)Property.Id.GroupRelationGroupId; - /// - /// Group name (projection) - /// - public const uint GroupName = (uint)Property.Id.GroupRelationGroupName; - }; - - /// - /// Describes properties of a Phone Log Statistics record. - /// - /// Read only view - public static class PhoneLogStatistics - { - /// - /// Identifier of this log statistics view - /// - public const string Uri = "tizen.contacts_view.phonelog_stat"; - /// - /// Log count (projection) - /// - public const uint LogCount = (uint)Property.Id.PhonelogStatLogCount; - /// - /// Log type, see the contacts_phone_log_type_e - /// - public const uint LogType = (uint)Property.Id.PhonelogStatLogType; - /// - /// It is related to the SIM slot number. sim_slot_no 0 means first SIM card, sim_slot_no 1 means second SIM. It is same with handle index of telephony handle list. Refer to the telephony_init() - /// - public const uint SIMSlotNo = (uint)Property.Id.PhonelogStatSIMSlotNo; - }; - } -} diff --git a/src/Tizen.Pims.Contacts/Tizen.Pims.Contacts/DBChangedEventArgs.cs b/src/Tizen.Pims.Contacts/Tizen.Pims.Contacts/DBChangedEventArgs.cs deleted file mode 100644 index 591c4a029..000000000 --- a/src/Tizen.Pims.Contacts/Tizen.Pims.Contacts/DBChangedEventArgs.cs +++ /dev/null @@ -1,40 +0,0 @@ -/* -* 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.Pims.Contacts -{ - /// - /// Event arguments passed when contacts database is changed - /// - public class DBChangedEventArgs : EventArgs - { - internal DBChangedEventArgs(string viewUri) - { - ViewUri = viewUri; - } - - /// - /// The contacts view URI changed. - /// - public string ViewUri - { - get; - internal set; - } - } -} diff --git a/src/Tizen.Pims.Contacts/Tizen.Pims.Contacts/DBStatusChangedEventArgs.cs b/src/Tizen.Pims.Contacts/Tizen.Pims.Contacts/DBStatusChangedEventArgs.cs deleted file mode 100644 index ca1a79b0b..000000000 --- a/src/Tizen.Pims.Contacts/Tizen.Pims.Contacts/DBStatusChangedEventArgs.cs +++ /dev/null @@ -1,41 +0,0 @@ -/* -* 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 static Tizen.Pims.Contacts.ContactsDatabase; - -namespace Tizen.Pims.Contacts -{ - /// - /// Event arguments passed when contacts database status is changed - /// - public class DBStatusChangedEventArgs : EventArgs - { - internal DBStatusChangedEventArgs(DBStatus status) - { - Status = status; - } - - /// - /// The contacts database status. - /// - public DBStatus Status - { - get; - internal set; - } - } -} diff --git a/src/Tizen.Pims.Contacts/Tizen.Pims.Contacts/NameDisplayOrderChangedEventArgs.cs b/src/Tizen.Pims.Contacts/Tizen.Pims.Contacts/NameDisplayOrderChangedEventArgs.cs deleted file mode 100644 index 228318c4a..000000000 --- a/src/Tizen.Pims.Contacts/Tizen.Pims.Contacts/NameDisplayOrderChangedEventArgs.cs +++ /dev/null @@ -1,40 +0,0 @@ -/* -* 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.Pims.Contacts -{ - /// - /// Event arguments passed when setting value of contacts name display order is changed - /// - public class NameDisplayOrderChangedEventArgs : EventArgs - { - internal NameDisplayOrderChangedEventArgs(ContactDisplayOrder displayOrder) - { - NameDisplayOrder = displayOrder; - } - - /// - /// A setting value of contacts name display order - /// - public ContactDisplayOrder NameDisplayOrder - { - get; - internal set; - } - } -} diff --git a/src/Tizen.Pims.Contacts/Tizen.Pims.Contacts/NameSortingOrderChangedEventArgs.cs b/src/Tizen.Pims.Contacts/Tizen.Pims.Contacts/NameSortingOrderChangedEventArgs.cs deleted file mode 100644 index 152ef0b8e..000000000 --- a/src/Tizen.Pims.Contacts/Tizen.Pims.Contacts/NameSortingOrderChangedEventArgs.cs +++ /dev/null @@ -1,40 +0,0 @@ -/* -* 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.Pims.Contacts -{ - /// - /// Event arguments passed when setting value of contacts name sorting order is changed - /// - public class NameSortingOrderChangedEventArgs : EventArgs - { - internal NameSortingOrderChangedEventArgs(ContactSortingOrder SortingOrder) - { - NameSortingOrder = SortingOrder; - } - - /// - /// A setting value of contacts name sorting order - /// - public ContactSortingOrder NameSortingOrder - { - get; - internal set; - } - } -} diff --git a/src/Tizen.Pims.Contacts/Tizen.Pims.Contacts/NamespaceDoc.cs b/src/Tizen.Pims.Contacts/Tizen.Pims.Contacts/NamespaceDoc.cs deleted file mode 100644 index 487113c27..000000000 --- a/src/Tizen.Pims.Contacts/Tizen.Pims.Contacts/NamespaceDoc.cs +++ /dev/null @@ -1,23 +0,0 @@ -/* - * 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. - */ - -/// -/// The Tizen.Pims.Contacts namespace provides classes for managing contact information for people. -/// -/// -/// The Tizen.Pims.Contacts namespace provides classes for managing contact information for people. -/// -namespace Tizen.Pims.Contacts {} diff --git a/src/Tizen.Security.SecureRepository/Interop/Interop.CkmcErrors.cs b/src/Tizen.Security.SecureRepository/Interop/Interop.CkmcErrors.cs deleted file mode 100644 index 3e1254703..000000000 --- a/src/Tizen.Security.SecureRepository/Interop/Interop.CkmcErrors.cs +++ /dev/null @@ -1,46 +0,0 @@ -/* - * 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; - -internal static partial class Interop -{ - private const int TizenErrorKeyManager = -0x01E10000; - private const string LogTag = "Tizen.Security.SecureRepository"; - - internal enum KeyManagerError : int - { - None = ErrorCode.None, - InvalidParameter = ErrorCode.InvalidParameter, - VerificationFailed = TizenErrorKeyManager | 0x0D // CKMC_ERROR_VERIFICATION_FAILED - }; - - internal static void CheckNThrowException(int err, string msg) - { - switch (err) - { - case (int)KeyManagerError.None: - return; - case (int)KeyManagerError.InvalidParameter: - throw new ArgumentException(string.Format("[{0}] {1}, error={2}", - LogTag, msg, ErrorFacts.GetErrorMessage(err))); - default: - throw new InvalidOperationException(string.Format("[{0}] {1}, error={2}", - LogTag, msg, ErrorFacts.GetErrorMessage(err))); - } - } -} diff --git a/src/Tizen.Security.SecureRepository/Interop/Interop.CkmcManager.cs b/src/Tizen.Security.SecureRepository/Interop/Interop.CkmcManager.cs deleted file mode 100644 index 51141d06f..000000000 --- a/src/Tizen.Security.SecureRepository/Interop/Interop.CkmcManager.cs +++ /dev/null @@ -1,140 +0,0 @@ -/* - * 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 CkmcManager - { - [DllImport(Libraries.KeyManager, EntryPoint = "ckmc_save_key", CallingConvention = CallingConvention.Cdecl)] - public static extern int SaveKey(string alias, CkmcKey key, CkmcPolicy policy); - // int ckmc_save_key(const char *alias, const ckmc_key_s key, const ckmc_policy_s policy); - - [DllImport(Libraries.KeyManager, EntryPoint = "ckmc_get_key", CallingConvention = CallingConvention.Cdecl)] - public static extern int GetKey(string alias, string password, out IntPtr key); - // int ckmc_get_key(const char *alias, const char *password, ckmc_key_s **ppkey); - - [DllImport(Libraries.KeyManager, EntryPoint = "ckmc_get_key_alias_list", CallingConvention = CallingConvention.Cdecl)] - public static extern int GetKeyAliasList(out IntPtr aliases); - // int ckmc_get_key_alias_list(ckmc_alias_list_s **ppalias_list); - - - [DllImport(Libraries.KeyManager, EntryPoint = "ckmc_save_cert", CallingConvention = CallingConvention.Cdecl)] - public static extern int SaveCert(string alias, CkmcCert cert, CkmcPolicy policy); - // int ckmc_save_cert(const char *alias, const ckmc_cert_s cert, const ckmc_policy_s policy); - - [DllImport(Libraries.KeyManager, EntryPoint = "ckmc_get_cert", CallingConvention = CallingConvention.Cdecl)] - public static extern int GetCert(string alias, string password, out IntPtr data); - // int ckmc_get_cert(const char *alias, const char *password, ckmc_cert_s** ppcert); - - [DllImport(Libraries.KeyManager, EntryPoint = "ckmc_get_cert_alias_list", CallingConvention = CallingConvention.Cdecl)] - public static extern int GetCertAliasList(out IntPtr aliases); - // int ckmc_get_cert_alias_list(ckmc_alias_list_s **ppalias_list); - - - [DllImport(Libraries.KeyManager, EntryPoint = "ckmc_save_data", CallingConvention = CallingConvention.Cdecl)] - public static extern int SaveData(string alias, CkmcRawBuffer data, CkmcPolicy policy); - // int ckmc_save_data(const char *alias, ckmc_raw_buffer_s data, const ckmc_policy_s policy); - - [DllImport(Libraries.KeyManager, EntryPoint = "ckmc_get_data", CallingConvention = CallingConvention.Cdecl)] - public static extern int GetData(string alias, string password, out IntPtr data); - // int ckmc_get_data(const char* alias, const char* password, ckmc_raw_buffer_s **ppdata); - - [DllImport(Libraries.KeyManager, EntryPoint = "ckmc_get_data_alias_list", CallingConvention = CallingConvention.Cdecl)] - public static extern int GetDataAliasList(out IntPtr aliases); - // int ckmc_get_data_alias_list(ckmc_alias_list_s **ppalias_list); - - - [DllImport(Libraries.KeyManager, EntryPoint = "ckmc_remove_alias", CallingConvention = CallingConvention.Cdecl)] - public static extern int RemoveAlias(string alias); - // int ckmc_remove_alias(const char *alias); - - - [DllImport(Libraries.KeyManager, EntryPoint = "ckmc_save_pkcs12", CallingConvention = CallingConvention.Cdecl)] - public static extern int SavePkcs12(string alias, IntPtr p12, CkmcPolicy keyPolicy, CkmcPolicy certPolicy); - // int ckmc_save_pkcs12(const char *alias, const ckmc_pkcs12_s* pkcs, const ckmc_policy_s key_policy, const ckmc_policy_s cert_policy); - - [DllImport(Libraries.KeyManager, EntryPoint = "ckmc_get_pkcs12", CallingConvention = CallingConvention.Cdecl)] - public static extern int GetPkcs12(string alias, string keyPassword, string certPassword, out IntPtr pkcs12); - // int ckmc_get_pkcs12(const char *alias, const char *key_password, const char* cert_password, ckmc_pkcs12_s **pkcs12); - - [DllImport(Libraries.KeyManager, EntryPoint = "ckmc_set_permission", CallingConvention = CallingConvention.Cdecl)] - public static extern int SetPermission(string alias, string accessor, int permissions); - // int ckmc_set_permission(const char *alias, const char *accessor, int permissions); - - - [DllImport(Libraries.KeyManager, EntryPoint = "ckmc_create_key_pair_rsa", CallingConvention = CallingConvention.Cdecl)] - public static extern int CreateKeyPairRsa(UIntPtr size, string privateKeyAlias, string publicKeyAlias, - CkmcPolicy privateKeyPolicy, CkmcPolicy publicKeyPolicy); - // int ckmc_create_key_pair_rsa(const size_t size, const char* private_key_alias, const char* public_key_alias, - // const ckmc_policy_s policy_private_key, const ckmc_policy_s policy_public_key); - - [DllImport(Libraries.KeyManager, EntryPoint = "ckmc_create_key_pair_dsa", CallingConvention = CallingConvention.Cdecl)] - public static extern int CreateKeyPairDsa(UIntPtr size, string privateKeyAlias, string publicKeyAlias, - CkmcPolicy privateKeyPolicy, CkmcPolicy publicKeyPolicy); - // int ckmc_create_key_pair_dsa(const size_t size, const char* private_key_alias, const char* public_key_alias, - // const ckmc_policy_s policy_private_key, const ckmc_policy_s policy_public_key); - - [DllImport(Libraries.KeyManager, EntryPoint = "ckmc_create_key_pair_ecdsa", CallingConvention = CallingConvention.Cdecl)] - public static extern int CreateKeyPairEcdsa(int ecType, string privateKeyAlias, string publicKeyAlias, - CkmcPolicy privateKeyPolicy, CkmcPolicy publicKeyPolicy); - // int ckmc_create_key_pair_ecdsa(const ckmc_ec_type_e type, const char* private_key_alias, const char* public_key_alias, - // const ckmc_policy_s policy_private_key, const ckmc_policy_s policy_public_key); - - [DllImport(Libraries.KeyManager, EntryPoint = "ckmc_create_key_aes", CallingConvention = CallingConvention.Cdecl)] - public static extern int CreateKeyAes(UIntPtr size, string ceyAlias, CkmcPolicy keyPolicy); - // int ckmc_create_key_aes(size_t size, const char* key_alias, ckmc_policy_s key_policy); - - [DllImport(Libraries.KeyManager, EntryPoint = "ckmc_create_signature", CallingConvention = CallingConvention.Cdecl)] - public static extern int CreateSignature(string privateKeyAlias, string password, CkmcRawBuffer message, - int hashAlgorithm, int paddingAlgorithm, out IntPtr signature); - // int ckmc_create_signature(const char *private_key_alias, const char* password, const ckmc_raw_buffer_s message, - // const ckmc_hash_algo_e hash, const ckmc_rsa_padding_algo_e padding, ckmc_raw_buffer_s **ppsignature); - - [DllImport(Libraries.KeyManager, EntryPoint = "ckmc_verify_signature", CallingConvention = CallingConvention.Cdecl)] - public static extern int VerifySignature(string publicKeyAlias, string password, CkmcRawBuffer message, - CkmcRawBuffer signature, int hashAlgorithm, int paddingAlgorithm); - // int ckmc_verify_signature(const char *public_key_alias, const char* password, const ckmc_raw_buffer_s message, - // const ckmc_raw_buffer_s signature, const ckmc_hash_algo_e hash, const ckmc_rsa_padding_algo_e padding); - - [DllImport(Libraries.KeyManager, EntryPoint = "ckmc_encrypt_data", CallingConvention = CallingConvention.Cdecl)] - public static extern int EncryptData(IntPtr parameters, string keyAlias, string password, CkmcRawBuffer plainText, out IntPtr cipherText); - // int ckmc_encrypt_data(ckmc_param_list_h params, const char* key_alias, const char* password, - // const ckmc_raw_buffer_s decrypted, ckmc_raw_buffer_s **ppencrypted); - - [DllImport(Libraries.KeyManager, EntryPoint = "ckmc_decrypt_data", CallingConvention = CallingConvention.Cdecl)] - public static extern int DecryptData(IntPtr parameters, string keyAlias, string password, CkmcRawBuffer cipherText, out IntPtr plainText); - // int ckmc_decrypt_data(ckmc_param_list_h params, const char* key_alias, const char* password, - // const ckmc_raw_buffer_s encrypted, ckmc_raw_buffer_s **ppdecrypted); - - - [DllImport(Libraries.KeyManager, EntryPoint = "ckmc_get_cert_chain", CallingConvention = CallingConvention.Cdecl)] - public static extern int GetCertChain(IntPtr cert, IntPtr untrustedCerts, out IntPtr certChain); - // int ckmc_get_cert_chain(const ckmc_cert_s *cert, const ckmc_cert_list_s* untrustedcerts, ckmc_cert_list_s **ppcert_chain_list); - - [DllImport(Libraries.KeyManager, EntryPoint = "ckmc_get_cert_chain_with_trustedcert", CallingConvention = CallingConvention.Cdecl)] - public static extern int GetCertChainWithTrustedCerts(IntPtr cert, IntPtr untrustedCerts, IntPtr trustedCerts, - bool useTrustedSystemCerts, out IntPtr certChain); - // int ckmc_get_cert_chain_with_trustedcert(const ckmc_cert_s *cert, const ckmc_cert_list_s* untrustedcerts, - // const ckmc_cert_list_s* trustedcerts, const bool use_trustedsystemcerts, ckmc_cert_list_s **ppcert_chain_list); - - [DllImport(Libraries.KeyManager, EntryPoint = "ckmc_ocsp_check", CallingConvention = CallingConvention.Cdecl)] - public static extern int OcspCheck(IntPtr certChain, ref int ocspStatus); - // int ckmc_ocsp_check(const ckmc_cert_list_s *pcert_chain_list, ckmc_ocsp_status_e* ocsp_status); - } -} diff --git a/src/Tizen.Security.SecureRepository/Interop/Interop.CkmcTypes.cs b/src/Tizen.Security.SecureRepository/Interop/Interop.CkmcTypes.cs deleted file mode 100644 index 6482a3551..000000000 --- a/src/Tizen.Security.SecureRepository/Interop/Interop.CkmcTypes.cs +++ /dev/null @@ -1,214 +0,0 @@ -/* - * 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 -{ - [StructLayout(LayoutKind.Sequential)] - internal struct CkmcPolicy - { - public CkmcPolicy(string password, bool extractable) - { - this.password = password; - this.extractable = extractable; - } - [MarshalAs(UnmanagedType.LPStr)] - public readonly string password; - [MarshalAs(UnmanagedType.Bool)] - public readonly bool extractable; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct CkmcKey - { - public CkmcKey(IntPtr binary, int keySize, int keyType, string password) - { - this.rawKey = binary; - this.size = (UIntPtr)keySize; - this.keyType = keyType; - this.password = password; - } - public readonly IntPtr rawKey; - public readonly UIntPtr size; - public readonly int keyType; - [MarshalAs(UnmanagedType.LPStr)] - public readonly string password; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct CkmcCert - { - public CkmcCert(IntPtr binary, int size, int dataFormat) - { - this.rawCert = binary; - this.size = (UIntPtr)size; - this.dataFormat = dataFormat; - } - public readonly IntPtr rawCert; - public readonly UIntPtr size; - public readonly int dataFormat; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct CkmcRawBuffer - { - public CkmcRawBuffer(IntPtr binary, int size) - { - this.data = binary; - this.size = (UIntPtr)size; - } - public readonly IntPtr data; - public readonly UIntPtr size; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct CkmcAliasList - { - public readonly IntPtr alias; - public readonly IntPtr next; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct CkmcCertList - { - public CkmcCertList(IntPtr cert, IntPtr next) - { - this.cert = cert; - this.next = next; - } - public readonly IntPtr cert; - public readonly IntPtr next; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct CkmcPkcs12 - { - public CkmcPkcs12(IntPtr privateKey, IntPtr certificate, IntPtr caChain) - { - this.privateKey = privateKey; - this.certificate = certificate; - this.caChain = caChain; - } - public readonly IntPtr privateKey; - public readonly IntPtr certificate; - public readonly IntPtr caChain; - } - - internal static partial class CkmcTypes - { - [DllImport(Libraries.KeyManager, EntryPoint = "ckmc_key_new", CallingConvention = CallingConvention.Cdecl)] - public static extern int KeyNew(byte[] rawKey, UIntPtr size, int keyType, string password, out IntPtr cert); - // int ckmc_key_new(unsigned char *raw_key, size_t key_size, ckmc_key_type_e key_type, char *password, ckmc_key_s **ppkey); - // - [DllImport(Libraries.KeyManager, EntryPoint = "ckmc_key_free", CallingConvention = CallingConvention.Cdecl)] - public static extern void KeyFree(IntPtr buffer); - // void ckmc_key_free(ckmc_key_s *key); - - [DllImport(Libraries.KeyManager, EntryPoint = "ckmc_buffer_new", CallingConvention = CallingConvention.Cdecl)] - public static extern int BufferNew(byte[] data, UIntPtr size, out IntPtr buffer); - // int ckmc_buffer_new(unsigned char *data, size_t size, ckmc_raw_buffer_s** ppbuffer); - - [DllImport(Libraries.KeyManager, EntryPoint = "ckmc_buffer_free", CallingConvention = CallingConvention.Cdecl)] - public static extern void BufferFree(IntPtr buffer); - // void ckmc_buffer_free(ckmc_raw_buffer_s* buffer); - - [DllImport(Libraries.KeyManager, EntryPoint = "ckmc_cert_new", CallingConvention = CallingConvention.Cdecl)] - public static extern int CertNew(byte[] rawCert, UIntPtr size, int dataFormat, out IntPtr cert); - // int ckmc_cert_new(unsigned char *raw_cert, size_t cert_size, ckmc_data_format_e data_format, ckmc_cert_s** ppcert); - - [DllImport(Libraries.KeyManager, EntryPoint = "ckmc_cert_free", CallingConvention = CallingConvention.Cdecl)] - public static extern void CertFree(IntPtr buffer); - // void ckmc_cert_free(ckmc_cert_s *cert); - - [DllImport(Libraries.KeyManager, EntryPoint = "ckmc_load_cert_from_file", CallingConvention = CallingConvention.Cdecl)] - public static extern int LoadCertFromFile(string filePath, out IntPtr cert); - // int ckmc_load_cert_from_file(const char *file_path, ckmc_cert_s **cert); - - [DllImport(Libraries.KeyManager, EntryPoint = "ckmc_pkcs12_new", CallingConvention = CallingConvention.Cdecl)] - public static extern int Pkcs12New(IntPtr key, IntPtr cert, IntPtr caCerts, out IntPtr p12_bundle); - // int ckmc_pkcs12_new(ckmc_key_s *private_key, ckmc_cert_s* cert, ckmc_cert_list_s *ca_cert_list, ckmc_pkcs12_s** pkcs12_bundle); - - [DllImport(Libraries.KeyManager, EntryPoint = "ckmc_pkcs12_load", CallingConvention = CallingConvention.Cdecl)] - public static extern int Pkcs12Load(string filePath, string password, out IntPtr pkcs12); - // int ckmc_pkcs12_load(const char *file_path, const char* passphrase, ckmc_pkcs12_s **pkcs12_bundle); - - [DllImport(Libraries.KeyManager, EntryPoint = "ckmc_pkcs12_free", CallingConvention = CallingConvention.Cdecl)] - public static extern void Pkcs12Free(IntPtr pkcs12); - // void ckmc_pkcs12_free(ckmc_pkcs12_s *pkcs12); - - [DllImport(Libraries.KeyManager, EntryPoint = "ckmc_alias_list_new", CallingConvention = CallingConvention.Cdecl)] - public static extern int AliasListNew(string alias, out IntPtr aliasList); - // int ckmc_alias_list_new(char *alias, ckmc_alias_list_s **ppalias_list); - - [DllImport(Libraries.KeyManager, EntryPoint = "ckmc_alias_list_add", CallingConvention = CallingConvention.Cdecl)] - public static extern int AliasListAdd(IntPtr previous, string alias, out IntPtr aliasList); - // int ckmc_alias_list_add(ckmc_alias_list_s *previous, char* alias, ckmc_alias_list_s **pplast); - - [DllImport(Libraries.KeyManager, EntryPoint = "ckmc_alias_list_free", CallingConvention = CallingConvention.Cdecl)] - public static extern void AliasListFree(IntPtr first); - // void ckmc_alias_list_free(ckmc_alias_list_s* first); - - [DllImport(Libraries.KeyManager, EntryPoint = "ckmc_alias_list_all_free", CallingConvention = CallingConvention.Cdecl)] - public static extern void AliasListAllFree(IntPtr first); - // void ckmc_alias_list_all_free(ckmc_alias_list_s* first); - - [DllImport(Libraries.KeyManager, EntryPoint = "ckmc_cert_list_new", CallingConvention = CallingConvention.Cdecl)] - public static extern int CertListNew(IntPtr cert, out IntPtr certList); - // int ckmc_cert_list_new(ckmc_cert_s *cert, ckmc_cert_list_s **ppcert_list); - - [DllImport(Libraries.KeyManager, EntryPoint = "ckmc_cert_list_add", CallingConvention = CallingConvention.Cdecl)] - public static extern int CertListAdd(IntPtr previous, IntPtr cert, out IntPtr certList); - // int ckmc_cert_list_add(ckmc_cert_list_s *previous, ckmc_cert_s *cert, ckmc_cert_list_s** pplast); - - [DllImport(Libraries.KeyManager, EntryPoint = "ckmc_cert_list_free", CallingConvention = CallingConvention.Cdecl)] - public static extern void CertListFree(IntPtr first); - // void ckmc_cert_list_free(ckmc_cert_list_s *first); - - [DllImport(Libraries.KeyManager, EntryPoint = "ckmc_cert_list_all_free", CallingConvention = CallingConvention.Cdecl)] - public static extern void CertListAllFree(IntPtr first); - // void ckmc_cert_list_all_free(ckmc_cert_list_s *first); - - [DllImport(Libraries.KeyManager, EntryPoint = "ckmc_param_list_new", CallingConvention = CallingConvention.Cdecl)] - public static extern int ParamListNew(out IntPtr paramList); - // int ckmc_param_list_new(ckmc_param_list_h *pparams); - - [DllImport(Libraries.KeyManager, EntryPoint = "ckmc_param_list_set_integer", CallingConvention = CallingConvention.Cdecl)] - public static extern int ParamListSetInteger(IntPtr paramList, int name, long value); - // int ckmc_param_list_set_integer(ckmc_param_list_h params, ckmc_param_name_e name, uint64_t value); - - [DllImport(Libraries.KeyManager, EntryPoint = "ckmc_param_list_set_buffer", CallingConvention = CallingConvention.Cdecl)] - public static extern int ParamListSetBuffer(IntPtr paramList, int name, IntPtr buffer); - // int ckmc_param_list_set_buffer(ckmc_param_list_h params, ckmc_param_name_e name, const ckmc_raw_buffer_s* buffer); - - [DllImport(Libraries.KeyManager, EntryPoint = "ckmc_param_list_get_integer", CallingConvention = CallingConvention.Cdecl)] - public static extern int ParamListGetInteger(IntPtr paramList, int name, out long value); - // int ckmc_param_list_get_integer(ckmc_param_list_h params, ckmc_param_name_e name, uint64_t *pvalue); - - [DllImport(Libraries.KeyManager, EntryPoint = "ckmc_param_list_get_buffer", CallingConvention = CallingConvention.Cdecl)] - public static extern int ParamListGetBuffer(IntPtr paramList, int name, out IntPtr buffer); - // int ckmc_param_list_get_buffer(ckmc_param_list_h params, ckmc_param_name_e name, ckmc_raw_buffer_s **ppbuffer); - - [DllImport(Libraries.KeyManager, EntryPoint = "ckmc_param_list_free", CallingConvention = CallingConvention.Cdecl)] - public static extern void ParamListFree(IntPtr first); - // void ckmc_param_list_free(ckmc_param_list_h params); - - [DllImport(Libraries.KeyManager, EntryPoint = "ckmc_generate_new_params", CallingConvention = CallingConvention.Cdecl)] - public static extern int GenerateNewParam(int algoType, out IntPtr paramList); - // int ckmc_generate_new_params(ckmc_algo_type_e type, ckmc_param_list_h *pparams); - } -} diff --git a/src/Tizen.Security.SecureRepository/Interop/Interop.Libraries.cs b/src/Tizen.Security.SecureRepository/Interop/Interop.Libraries.cs deleted file mode 100644 index d9822691c..000000000 --- a/src/Tizen.Security.SecureRepository/Interop/Interop.Libraries.cs +++ /dev/null @@ -1,23 +0,0 @@ -/* - * 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 KeyManager = "libkey-manager-client.so.1"; - } -} diff --git a/src/Tizen.Security.SecureRepository/NamespaceDoc.cs b/src/Tizen.Security.SecureRepository/NamespaceDoc.cs deleted file mode 100644 index c14b195cd..000000000 --- a/src/Tizen.Security.SecureRepository/NamespaceDoc.cs +++ /dev/null @@ -1,41 +0,0 @@ -/** - -Secure Repository function is provided by key-manager module in Tizen. The key manager provides a secure repository for keys, certificates, and sensitive data related to users and their password-protected APPs. Additionally, it provides secure cryptographic operations for non-exportable keys without revealing the key values to clients. - - - -

Overview

- -Secure Repository stores keys, certificates, and sensitive user data in a central secure repository. The central secure repository is protected by a password. - - - -Data Store Policy -A client can specify simple access rules when storing data in the key manager: - Extractable or non-extractable - - Only for data tagged as extractable, the key manager returns the raw value of the data. - - If data is tagged as non-extractable, the key manager does not return its raw value. In that case, the key manager provides secure cryptographic operations for non-exportable keys without revealing the key values to the clients. - Per key password - - All data in the key manager is protected by a user password. - - A client can encrypt its data using their own password additionally. - - If a client provides a password when storing data, the data is encrypted with the password. This password must be provided when getting the data from the key manager. - - - -Data Access Control - By default, only the owner of a data can access to the data. - If the owner grants the access to other applications, those applications can read or delete the data from key-manager DB. - When an application is deleted, the data and access control information granted by the application are also removed. - - - -Alias Format - The format of alias is "package_id name" and the name should not contain any white space characters. - If package_id is not provided by a client, the key-manager will add the package_id of the client to the name internally. - The client can specify only its own pacakge id in the alias when storing a key, certificate, or data. - A client should specify the pacakge id of the owner in the alias to retrieve a a key, certificate, or data shared by other applications. - Aliases are returned from the key-manager as the format of package_id name. - -
-*/ -namespace Tizen.Security.SecureRepository {} diff --git a/src/Tizen.Security.SecureRepository/Tizen.Security.SecureRepository.csproj b/src/Tizen.Security.SecureRepository/Tizen.Security.SecureRepository.csproj deleted file mode 100644 index 4c51c4197..000000000 --- a/src/Tizen.Security.SecureRepository/Tizen.Security.SecureRepository.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - netstandard2.0 - - - - - - - - \ No newline at end of file diff --git a/src/Tizen.Security.SecureRepository/Tizen.Security.SecureRepository.sln b/src/Tizen.Security.SecureRepository/Tizen.Security.SecureRepository.sln deleted file mode 100755 index 9301848fd..000000000 --- a/src/Tizen.Security.SecureRepository/Tizen.Security.SecureRepository.sln +++ /dev/null @@ -1,34 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26430.12 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Security.SecureRepository", "Tizen.Security.SecureRepository.csproj", "{FDDA7B1F-E516-419B-BCFD-30E036E7F5AE}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen", "..\Tizen\Tizen.csproj", "{B8B1271F-D61B-42C3-8BE5-F08180CE800F}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Log", "..\Tizen.Log\Tizen.Log.csproj", "{F38CD986-E81B-4C82-B6CA-F7EC96B2297D}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {FDDA7B1F-E516-419B-BCFD-30E036E7F5AE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {FDDA7B1F-E516-419B-BCFD-30E036E7F5AE}.Debug|Any CPU.Build.0 = Debug|Any CPU - {FDDA7B1F-E516-419B-BCFD-30E036E7F5AE}.Release|Any CPU.ActiveCfg = Release|Any CPU - {FDDA7B1F-E516-419B-BCFD-30E036E7F5AE}.Release|Any CPU.Build.0 = Release|Any CPU - {B8B1271F-D61B-42C3-8BE5-F08180CE800F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B8B1271F-D61B-42C3-8BE5-F08180CE800F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B8B1271F-D61B-42C3-8BE5-F08180CE800F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B8B1271F-D61B-42C3-8BE5-F08180CE800F}.Release|Any CPU.Build.0 = Release|Any CPU - {F38CD986-E81B-4C82-B6CA-F7EC96B2297D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F38CD986-E81B-4C82-B6CA-F7EC96B2297D}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F38CD986-E81B-4C82-B6CA-F7EC96B2297D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F38CD986-E81B-4C82-B6CA-F7EC96B2297D}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/src/Tizen.Security.SecureRepository/Tizen.Security.SecureRepository/Certificate.cs b/src/Tizen.Security.SecureRepository/Tizen.Security.SecureRepository/Certificate.cs deleted file mode 100644 index 99c02d586..000000000 --- a/src/Tizen.Security.SecureRepository/Tizen.Security.SecureRepository/Certificate.cs +++ /dev/null @@ -1,129 +0,0 @@ -/* - * 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; -using static Interop; - -namespace Tizen.Security.SecureRepository -{ - /// - /// The class that represents a certificate. - /// - /// 3 - public class Certificate - { - /// - /// Loads Certificate from the given file path. - /// - /// 3 - /// The path of certificate file to be loaded. - /// Loaded certificate class instance. - /// - /// The filePath should not be null - /// - /// - /// Invalid certificate file format. Provided file path does not exist or - /// cannot be accessed. - /// - static public Certificate Load(string filePath) - { - if (filePath == null) - throw new ArgumentNullException("filepath should not be null"); - - IntPtr ptr = IntPtr.Zero; - - Interop.CheckNThrowException( - CkmcTypes.LoadCertFromFile(filePath, out ptr), - "Failed to load Certificate: " + filePath); - - return new Certificate(ptr); - } - - /// - /// A constructor of Certificate that takes the binary and its format. - /// - /// 3 - /// The binary data of a certificate. - /// The format of the binary data. - public Certificate(byte[] binary, DataFormat format) - { - this.Binary = binary; - this.Format = format; - } - - internal Certificate(IntPtr ptr) - { - if (ptr == IntPtr.Zero) - throw new ArgumentNullException("Returned ptr from CAPI cannot be null"); - - var ckmcCert = Marshal.PtrToStructure(ptr); - this.Binary = new byte[(int)ckmcCert.size]; - Marshal.Copy(ckmcCert.rawCert, this.Binary, 0, this.Binary.Length); - this.Format = (DataFormat)ckmcCert.dataFormat; - } - - // Refresh handle(IntPtr) always. Because C# layer - // properties(Binary, Format) could be changed. - internal IntPtr GetHandle() - { - IntPtr ptr = IntPtr.Zero; - try - { - CheckNThrowException( - CkmcTypes.CertNew( - this.Binary, (UIntPtr)this.Binary.Length, (int)this.Format, - out ptr), - "Failed to create cert"); - - return ptr; - } - catch - { - if (ptr != IntPtr.Zero) - CkmcTypes.CertFree(ptr); - - throw; - } - } - - /// - /// The binary value of a certificate. - /// - /// 3 - public byte[] Binary - { - get; set; - } - - /// - /// The format of the binary value. - /// - /// 3 - public DataFormat Format - { - get; set; - } - - internal CkmcCert ToCkmcCert() - { - return new Interop.CkmcCert( - (Binary == null) ? IntPtr.Zero : new PinnedObject(this.Binary), - (Binary == null) ? 0 : this.Binary.Length, - (int)Format); - } - } -} diff --git a/src/Tizen.Security.SecureRepository/Tizen.Security.SecureRepository/CertificateManager.cs b/src/Tizen.Security.SecureRepository/Tizen.Security.SecureRepository/CertificateManager.cs deleted file mode 100644 index 631de763f..000000000 --- a/src/Tizen.Security.SecureRepository/Tizen.Security.SecureRepository/CertificateManager.cs +++ /dev/null @@ -1,306 +0,0 @@ -/* - * 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.Collections.Generic; -using static Interop; - -namespace Tizen.Security.SecureRepository -{ - /// - /// This class provides the methods handling certificates. - /// - /// 3 - public class CertificateManager : Manager - { - /// - /// Gets a certificate from the secure repository. - /// - /// 3 - /// The name of a certificate to be retrieved. - /// - /// The password used in decrypting a certificate value. If password of - /// policy is provided in SaveCertificate(), the same password should be - /// provided. - /// - /// A certificate specified by alias. - /// - /// The alias argument is null. - /// - /// - /// The alias argument is in an invalid format. - /// - /// - /// The certificate does not exist with the alias or certificate-protecting - /// password isn't matched. - /// - static public Certificate Get(string alias, string password) - { - if (alias == null) - throw new ArgumentNullException("alias cannot be null"); - - IntPtr ptr = IntPtr.Zero; - - try - { - Interop.CheckNThrowException( - Interop.CkmcManager.GetCert(alias, password, out ptr), - "Failed to get certificate. alias=" + alias); - return new Certificate(ptr); - } - finally - { - if (ptr != IntPtr.Zero) - Interop.CkmcTypes.CertFree(ptr); - } - } - - /// - /// Gets all aliases of certificates, which the client can access. - /// - /// 3 - /// All aliases of certificates, which the client can access. - /// No alias to get. - static public IEnumerable GetAliases() - { - IntPtr ptr = IntPtr.Zero; - - try - { - Interop.CheckNThrowException( - Interop.CkmcManager.GetCertAliasList(out ptr), - "Failed to get certificate aliases."); - return new SafeAliasListHandle(ptr).Aliases; - } - finally - { - if (ptr != IntPtr.Zero) - Interop.CkmcTypes.AliasListAllFree(ptr); - } - } - - /// - /// Stores a certificate inside the secure repository based on the provided policy. - /// - /// 3 - /// The name of a certificate to be stored. - /// The certificate's binary value to be stored. - /// - /// The policy about how to store a certificate securely. - /// - /// - /// Any of argument is null. - /// - /// - /// The alias argument is in the invalid format. cert argument is in the invalid format. - /// - /// - /// The certificate with alias already exist. - /// - static public void Save(string alias, Certificate cert, Policy policy) - { - if (alias == null || cert == null || policy == null) - throw new ArgumentNullException("More than one of argument is null"); - - Interop.CheckNThrowException( - Interop.CkmcManager.SaveCert( - alias, cert.ToCkmcCert(), policy.ToCkmcPolicy()), - "Failed to save certificate. alias=" + alias); - } - - /// - /// Verifies a certificate chain and returns that chain. - /// - /// 3 - /// The certificate to be verified. - /// - /// The untrusted CA certificates to be used in verifying a certificate chain. - /// - /// A newly created certificate chain. - /// - /// The certificate argument is null. - /// - /// - /// Some of the certificates in arguments are invalid. - /// - /// - /// Some of the certificates in arguments are expired or not valid yet. - /// Certificate cannot build chain. - /// The root certificate is not in the trusted system certificate store. - /// - /// - /// The trusted root certificate of the chain should exist in the system's - /// certificate storage. - /// - /// - /// The trusted root certificate of the chain in the system's certificate storage - /// is added to the certificate chain. - /// - static public IEnumerable GetCertificateChain( - Certificate certificate, IEnumerable untrustedCertificates) - { - if (certificate == null) - throw new ArgumentNullException("Certificate is null"); - - IntPtr ptrCertChain = IntPtr.Zero; - IntPtr certPtr = IntPtr.Zero; - IntPtr untrustedPtr = IntPtr.Zero; - - try - { - var untrusted = new SafeCertificateListHandle(untrustedCertificates); - - certPtr = certificate.GetHandle(); - untrustedPtr = untrusted.GetHandle(); - - Interop.CheckNThrowException( - Interop.CkmcManager.GetCertChain( - certPtr, untrustedPtr, - out ptrCertChain), - "Failed to get certificate chain"); - - return new SafeCertificateListHandle(ptrCertChain).Certificates; - } - finally - { - if (certPtr != IntPtr.Zero) - Interop.CkmcTypes.CertFree(certPtr); - if (untrustedPtr != IntPtr.Zero) - Interop.CkmcTypes.CertListAllFree(untrustedPtr); - } - } - - /// - /// Verifies a certificate chain and returns that chain using user entered - /// trusted and untrusted CA certificates. - /// - /// 3 - /// The certificate to be verified. - /// - /// The untrusted CA certificates to be used in verifying a certificate chain. - /// - /// - /// The trusted CA certificates to be used in verifying a certificate chain. - /// - /// - /// The flag indicating the use of the trusted root certificates in the - /// system's certificate storage. - /// - /// A newly created certificate chain. - /// - /// The certificate argument is null. - /// - /// - /// Some of the certificates in arguments are invalid. - /// - /// - /// Some of the certificates in arguments are expired or not valid yet. - /// Certificate cannot build chain. - /// The root certificate is not in the trusted system certificate store. - /// - /// - /// The trusted root certificate of the chain in the system's certificate storage - /// is added to the certificate chain. - /// - static public IEnumerable GetCertificateChain( - Certificate certificate, IEnumerable untrustedCertificates, - IEnumerable trustedCertificates, - bool useTrustedSystemCertificates) - { - if (certificate == null) - throw new ArgumentNullException("Certificate is null"); - - IntPtr certPtr = IntPtr.Zero; - IntPtr untrustedPtr = IntPtr.Zero; - IntPtr trustedPtr = IntPtr.Zero; - IntPtr ptrCertChain = IntPtr.Zero; - - try - { - var untrusted = new SafeCertificateListHandle(untrustedCertificates); - var trusted = new SafeCertificateListHandle(trustedCertificates); - - certPtr = certificate.GetHandle(); - untrustedPtr = untrusted.GetHandle(); - trustedPtr = trusted.GetHandle(); - - Interop.CheckNThrowException( - Interop.CkmcManager.GetCertChainWithTrustedCerts( - certPtr, untrustedPtr, trustedPtr, - useTrustedSystemCertificates, out ptrCertChain), - "Failed to get certificate chain with trusted certificates"); - return new SafeCertificateListHandle(ptrCertChain).Certificates; - } - finally - { - if (certPtr != IntPtr.Zero) - Interop.CkmcTypes.CertFree(certPtr); - if (untrustedPtr != IntPtr.Zero) - Interop.CkmcTypes.CertListAllFree(untrustedPtr); - if (trustedPtr != IntPtr.Zero) - Interop.CkmcTypes.CertListAllFree(trustedPtr); - } - } - - /// - /// Perform OCSP, which checks whether the certificate is revoked or not. - /// - /// 3 - /// - /// Valid certificate chain to perform the OCSP check. - /// - /// A status result of the OCSP check. - /// - /// The certificateChain argument is null. - /// - /// - /// The certificateChain is not valid chain or certificate. - /// - /// - /// Some of the certificates in chain are expired or not valid yet. - /// - static public OcspStatus CheckOcsp(IEnumerable certificateChain) - { - if (certificateChain == null) - throw new ArgumentNullException("Certificate chain is null"); - - IntPtr ptr = IntPtr.Zero; - - try - { - int ocspStatus = (int)OcspStatus.Good; - var certChain = new SafeCertificateListHandle(certificateChain); - - ptr = certChain.GetHandle(); - - Interop.CheckNThrowException( - Interop.CkmcManager.OcspCheck(ptr, ref ocspStatus), - "Failed to get certificate chain with trusted certificates"); - return (OcspStatus)ocspStatus; - } - finally - { - if (ptr != IntPtr.Zero) - Interop.CkmcTypes.CertListAllFree(ptr); - } - } - - // to be static class safely - internal CertificateManager() - { - } - } -} diff --git a/src/Tizen.Security.SecureRepository/Tizen.Security.SecureRepository/Crypto/AesCbcCipherParameters.cs b/src/Tizen.Security.SecureRepository/Tizen.Security.SecureRepository/Crypto/AesCbcCipherParameters.cs deleted file mode 100644 index 69cfb9edc..000000000 --- a/src/Tizen.Security.SecureRepository/Tizen.Security.SecureRepository/Crypto/AesCbcCipherParameters.cs +++ /dev/null @@ -1,34 +0,0 @@ -/* - * 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 - */ - -namespace Tizen.Security.SecureRepository.Crypto -{ - /// - /// A class for holding parameters for the AES algorithm with the CBC mode. - /// - /// 3 - public class AesCbcCipherParameters : AesCipherParameters - { - /// - /// A default constructor. - /// - /// 3 - /// The CipherAlgorithmType in CipherParameters is set to CipherAlgorithmType.AesCbc. - public AesCbcCipherParameters() : base(CipherAlgorithmType.AesCbc) - { - } - } -} diff --git a/src/Tizen.Security.SecureRepository/Tizen.Security.SecureRepository/Crypto/AesCfbCipherParameters.cs b/src/Tizen.Security.SecureRepository/Tizen.Security.SecureRepository/Crypto/AesCfbCipherParameters.cs deleted file mode 100644 index efff9da80..000000000 --- a/src/Tizen.Security.SecureRepository/Tizen.Security.SecureRepository/Crypto/AesCfbCipherParameters.cs +++ /dev/null @@ -1,34 +0,0 @@ -/* - * 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 - */ - -namespace Tizen.Security.SecureRepository.Crypto -{ - /// - /// A class for holding parameters for the AES algorithm with the CFB mode. - /// - /// 3 - public class AesCfbCipherParameters : AesCipherParameters - { - /// - /// A default constructor. - /// - /// 3 - /// The CipherAlgorithmType in CipherParameters is set to CipherAlgorithmType.AesCfb. - public AesCfbCipherParameters() : base(CipherAlgorithmType.AesCfb) - { - } - } -} diff --git a/src/Tizen.Security.SecureRepository/Tizen.Security.SecureRepository/Crypto/AesCipherParameters.cs b/src/Tizen.Security.SecureRepository/Tizen.Security.SecureRepository/Crypto/AesCipherParameters.cs deleted file mode 100644 index 78c05dc7c..000000000 --- a/src/Tizen.Security.SecureRepository/Tizen.Security.SecureRepository/Crypto/AesCipherParameters.cs +++ /dev/null @@ -1,44 +0,0 @@ -/* - * 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 - */ - -namespace Tizen.Security.SecureRepository.Crypto -{ - /// - /// An abstract class for holding parameters for the AES algorithm. - /// - /// 3 - public abstract class AesCipherParameters : CipherParameters - { - /// - /// An initialization vector. - /// - /// 3 - public byte[] IV - { - get { return this.GetBuffer(CipherParameterName.IV); } - set { this.Add(CipherParameterName.IV, value); } - } - - // for inherited in internal only - internal AesCipherParameters() - { - } - - internal AesCipherParameters(CipherAlgorithmType algorithm) : base(algorithm) - { - } - } -} diff --git a/src/Tizen.Security.SecureRepository/Tizen.Security.SecureRepository/Crypto/AesCtrCipherParameters.cs b/src/Tizen.Security.SecureRepository/Tizen.Security.SecureRepository/Crypto/AesCtrCipherParameters.cs deleted file mode 100644 index 222f8bfd1..000000000 --- a/src/Tizen.Security.SecureRepository/Tizen.Security.SecureRepository/Crypto/AesCtrCipherParameters.cs +++ /dev/null @@ -1,57 +0,0 @@ -/* - * 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.Security.SecureRepository.Crypto -{ - /// - /// A class for holding parameters for the AES algorithm with the counter mode. - /// - /// 3 - public class AesCtrCipherParameters : AesCipherParameters - { - /// - /// A default constructor. - /// - /// 3 - /// The CipherAlgorithmType in CipherParameters is set to CipherAlgorithmType.AesCtr. - public AesCtrCipherParameters() : base(CipherAlgorithmType.AesCtr) - { - } - - /// - /// Length of the counter block in bits. - /// - /// 3 - /// Optional, only 128b is supported at the moment. - /// The value should be positive. - public long CounterLength - { - get - { - return GetInteger(CipherParameterName.CounterLength); - } - set - { - if (value < 0) - throw new ArgumentOutOfRangeException( - string.Format("invalid value{0} on CounterLength", value)); - Add(CipherParameterName.CounterLength, value); - } - } - } -} diff --git a/src/Tizen.Security.SecureRepository/Tizen.Security.SecureRepository/Crypto/AesGcmCipherParameters.cs b/src/Tizen.Security.SecureRepository/Tizen.Security.SecureRepository/Crypto/AesGcmCipherParameters.cs deleted file mode 100644 index be09b0205..000000000 --- a/src/Tizen.Security.SecureRepository/Tizen.Security.SecureRepository/Crypto/AesGcmCipherParameters.cs +++ /dev/null @@ -1,73 +0,0 @@ -/* - * 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.Security.SecureRepository.Crypto -{ - /// - /// A class for holding parameters for the AES algorithm with the GCM mode. - /// - /// 3 - public class AesGcmCipherParameters : AesCipherParameters - { - /// - /// A default constructor. - /// - /// 3 - /// The CipherAlgorithmType in CipherParameters is set to CipherAlgorithmType.AesGcm. - public AesGcmCipherParameters() : base(CipherAlgorithmType.AesGcm) - { - } - - /// - /// GCM tag length in bits. - /// - /// 3 - /// One of {32, 64, 96, 104, 112, 120, 128} (optional), if not present the length 128 is used. - /// TagLength should be one of {32, 64, 96, 104, 112, 120, 128}. - public long TagLength - { - get - { - return GetInteger(CipherParameterName.TagLength); - } - set - { - if (value != 32 && value != 64 && value != 96 && value != 104 && - value != 112 && value != 120 && value != 128) - { - throw new ArgumentOutOfRangeException( - string.Format("invalid value{0} on TagLength", value)); - } - else - { - Add(CipherParameterName.TagLength, value); - } - } - } - - /// - /// Additional authentication data (optional). - /// - /// 3 - public byte[] AAD - { - get { return GetBuffer(CipherParameterName.AAD); } - set { Add(CipherParameterName.AAD, value); } - } - } -} diff --git a/src/Tizen.Security.SecureRepository/Tizen.Security.SecureRepository/Crypto/Cipher.cs b/src/Tizen.Security.SecureRepository/Tizen.Security.SecureRepository/Crypto/Cipher.cs deleted file mode 100644 index d3e38fc00..000000000 --- a/src/Tizen.Security.SecureRepository/Tizen.Security.SecureRepository/Crypto/Cipher.cs +++ /dev/null @@ -1,158 +0,0 @@ -/* - * 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.Security.SecureRepository.Crypto -{ - /// - /// This class provides the methods for encrypting and decrypting data. - /// - /// 3 - public class Cipher - { - private readonly CipherParameters _parameters; - - /// - /// A constructor of Cipher that takes the algorithm specific parameters. - /// - /// 3 - /// The algorithm specific parameters. - public Cipher(CipherParameters parameters) - { - _parameters = parameters; - } - - /// - /// The algorithm specific parameters. - /// - /// 3 - public CipherParameters Parameters - { - get { return _parameters; } - } - - /// - /// Decrypts data using the selected key and the algorithm. - /// - /// 3 - /// Alias of the key to be used for decryption. - /// - /// The password used in decrypting a key value. If password of policy is - /// provided in SaveKey(), the same password should be provided. - /// - /// - /// Data to be decrypted (some algorithms may require additional information - /// embedded in encrypted data.AES GCM is an example). - /// - /// Decrypted data. - /// - /// The keyAlias or cipherText is null. - /// - /// - /// The mandatory algorithm parameter is missing or invalid. - /// The optional algorithm parameter is invalid. - /// - /// - /// The key-protecting password isn't matched. - /// The key does not exist with the keyAlias. - /// - /// - /// The key type specified by keyAlias should be compatible with the algorithm - /// specified in Parameters. - /// - public byte[] Decrypt(string keyAlias, string password, byte[] cipherText) - { - if (keyAlias == null || cipherText == null) - throw new ArgumentNullException("alias and ciphertxt should not be null"); - - IntPtr ptr = IntPtr.Zero; - - try - { - Interop.CheckNThrowException( - Interop.CkmcManager.DecryptData( - Parameters.Ptr, keyAlias, password, - new Interop.CkmcRawBuffer( - new PinnedObject(cipherText), cipherText.Length), - out ptr), - "Failed to decrypt data"); - return new SafeRawBufferHandle(ptr).Data; - } - finally - { - if (ptr != IntPtr.Zero) - Interop.CkmcTypes.BufferFree(ptr); - } - } - - /// - /// Encrypts data using selected key and algorithm. - /// - /// 3 - /// Alias of the key to be used for encryption. - /// - /// The password used in decrypting a key value. If password of policy is - /// provided in SaveKey(), the same password should be provided. - /// - /// - /// Data to be encrypted. In case of the AES algorithm, there are no restrictions on - /// the size of data. For RSA, the size must be smaller or equal to (key_size_in - /// bytes - 42). Example: For 1024 RSA key, the maximum data size is - /// 1024/8 - 42 = 86. - /// - /// Encrypted data. - /// - /// The keyAlias or plainText is null. - /// - /// - /// The mandatory algorithm parameter is missing or invalid. - /// The optional algorithm parameter is invalid. - /// - /// - /// The key-protecting password isn't matched. - /// The key does not exist with the keyAlias. - /// - /// - /// The key type specified by the keyAlias should be compatible with the algorithm - /// specified in Parameters. - /// - public byte[] Encrypt(string keyAlias, string password, byte[] plainText) - { - if (keyAlias == null || plainText == null) - throw new ArgumentNullException("alias or plaintxt should not be null"); - - IntPtr ptr = IntPtr.Zero; - - try - { - Interop.CheckNThrowException( - Interop.CkmcManager.EncryptData( - Parameters.Ptr, keyAlias, password, - new Interop.CkmcRawBuffer( - new PinnedObject(plainText), plainText.Length), - out ptr), - "Failed to encrypt data"); - return new SafeRawBufferHandle(ptr).Data; - } - finally - { - if (ptr != IntPtr.Zero) - Interop.CkmcTypes.BufferFree(ptr); - } - } - } -} diff --git a/src/Tizen.Security.SecureRepository/Tizen.Security.SecureRepository/Crypto/CipherAlgorithmType.cs b/src/Tizen.Security.SecureRepository/Tizen.Security.SecureRepository/Crypto/CipherAlgorithmType.cs deleted file mode 100644 index 274634f2e..000000000 --- a/src/Tizen.Security.SecureRepository/Tizen.Security.SecureRepository/Crypto/CipherAlgorithmType.cs +++ /dev/null @@ -1,67 +0,0 @@ -/* - * 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 - */ - -namespace Tizen.Security.SecureRepository.Crypto -{ - /// - /// Enumeration for the crypto cipher algorithm types. - /// - /// 3 - public enum CipherAlgorithmType : int - { - /// - /// The AES-CTR algorithm. - /// Supported parameters: - /// - ParameterName.AlgorithmType = AesCtr(mandatory), - /// - ParameterName.IV = 16 - byte initialization vector(mandatory) - /// - ParameterName.CounterLength = length of counter block in bits - /// (optional, only 128b is supported at the moment) - /// - AesCtr = 0x01, - /// - /// The AES-CBC algorithm. - /// Supported parameters: - /// - ParameterName.AlgorithmType = AesCbc(mandatory), - /// - ParameterName.IV = 16-byte initialization vector(mandatory) - /// - AesCbc, - /// - /// The AES-GCM algorithm. - /// Supported parameters: - /// - ParameterName.AlgorithmType = AesGcm(mandatory), - /// - ParameterName.IV = initialization vector(mandatory) - /// - ParameterName.TagLength = GCM tag length in bits. One of - /// {32, 64, 96, 104, 112, 120, 128} (optional, if not present the length 128 is used) - /// - CKMC_PARAM_ED_AAD = additional authentication data(optional) - /// - AesGcm, - /// - /// Th AES-CFB algorithm. - /// Supported parameters: - /// - ParameterName.AlgorithmType = AesCfb(mandatory), - /// - ParameterName.IV = 16-byte initialization vector(mandatory) - /// - AesCfb, - /// - /// The RSA-OAEP algorithm. - /// Supported parameters: - /// - ParameterName.AlgorithmType = RsaOaep(required), - /// - ParameterName.Label = label to be associated with the message - /// (optional, not supported at the moment) - /// - RsaOaep - } -} diff --git a/src/Tizen.Security.SecureRepository/Tizen.Security.SecureRepository/Crypto/CipherParameterName.cs b/src/Tizen.Security.SecureRepository/Tizen.Security.SecureRepository/Crypto/CipherParameterName.cs deleted file mode 100644 index 27a1ea187..000000000 --- a/src/Tizen.Security.SecureRepository/Tizen.Security.SecureRepository/Crypto/CipherParameterName.cs +++ /dev/null @@ -1,51 +0,0 @@ -/* - * 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 - */ - -namespace Tizen.Security.SecureRepository.Crypto -{ - /// - /// Enumeration for the cipher algorithm parameters. - /// - /// 3 - public enum CipherParameterName : int - { - /// - /// The Algorithm Type. - /// - AlgorithmType = 0x01, - /// - /// Initial Vector, 16B buffer (up to 2^64-1 bytes long in case of AES GCM). - /// - IV = 101, - /// - /// Integer - ctr length in bits. - /// - CounterLength = 102, - /// - /// Additional authenticated data(AAD). - /// - AAD = 103, - /// - /// Tag Length. - /// - TagLength = 104, - /// - /// Label. - /// - Label = 105 - } - -} diff --git a/src/Tizen.Security.SecureRepository/Tizen.Security.SecureRepository/Crypto/CipherParameters.cs b/src/Tizen.Security.SecureRepository/Tizen.Security.SecureRepository/Crypto/CipherParameters.cs deleted file mode 100644 index 57b8aa43d..000000000 --- a/src/Tizen.Security.SecureRepository/Tizen.Security.SecureRepository/Crypto/CipherParameters.cs +++ /dev/null @@ -1,77 +0,0 @@ -/* - * 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.Security.SecureRepository.Crypto -{ - /// - /// An abstract class for holding parameters for encryption and decryption. - /// - /// 3 - abstract public class CipherParameters - { - private SafeCipherParametersHandle _handle; - - /// - /// The Cipher algorithm type. - /// - /// 3 - public CipherAlgorithmType Algorithm - { - get - { - return (CipherAlgorithmType)GetInteger( - CipherParameterName.AlgorithmType); - } - } - - // for inherited in internal only - internal CipherParameters() - { - } - - internal CipherParameters(CipherAlgorithmType algorithm) - { - this._handle = new SafeCipherParametersHandle(algorithm); - } - - internal void Add(CipherParameterName name, long value) - { - this._handle.SetInteger(name, value); - } - - internal void Add(CipherParameterName name, byte[] value) - { - this._handle.SetBuffer(name, value); - } - - internal long GetInteger(CipherParameterName name) - { - return this._handle.GetInteger(name); - } - - internal byte[] GetBuffer(CipherParameterName name) - { - return this._handle.GetBuffer(name); - } - - internal IntPtr Ptr - { - get { return this._handle.Ptr; } - } - } -} diff --git a/src/Tizen.Security.SecureRepository/Tizen.Security.SecureRepository/Crypto/DsaSignatureParameters.cs b/src/Tizen.Security.SecureRepository/Tizen.Security.SecureRepository/Crypto/DsaSignatureParameters.cs deleted file mode 100644 index cd7d6100d..000000000 --- a/src/Tizen.Security.SecureRepository/Tizen.Security.SecureRepository/Crypto/DsaSignatureParameters.cs +++ /dev/null @@ -1,33 +0,0 @@ -/* - * 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 - */ - -namespace Tizen.Security.SecureRepository.Crypto -{ - /// - /// A class for holding parameters for the DSA signature algorithm. - /// - /// 3 - public class DsaSignatureParameters : SignatureParameters - { - /// - /// A default constructor. - /// - /// 3 - public DsaSignatureParameters() : base(SignatureAlgorithmType.Dsa) - { - } - } -} diff --git a/src/Tizen.Security.SecureRepository/Tizen.Security.SecureRepository/Crypto/EcdsaSignatureParameters.cs b/src/Tizen.Security.SecureRepository/Tizen.Security.SecureRepository/Crypto/EcdsaSignatureParameters.cs deleted file mode 100644 index 31e584c32..000000000 --- a/src/Tizen.Security.SecureRepository/Tizen.Security.SecureRepository/Crypto/EcdsaSignatureParameters.cs +++ /dev/null @@ -1,33 +0,0 @@ -/* - * 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 - */ - -namespace Tizen.Security.SecureRepository.Crypto -{ - /// - /// A class for holding parameters for the ECDSA signature algorithm. - /// - /// 3 - public class EcdsaSignatureParameters : SignatureParameters - { - /// - /// A default constructor. - /// - /// 3 - public EcdsaSignatureParameters() : base(SignatureAlgorithmType.Ecdsa) - { - } - } -} diff --git a/src/Tizen.Security.SecureRepository/Tizen.Security.SecureRepository/Crypto/HashAlgorithm.cs b/src/Tizen.Security.SecureRepository/Tizen.Security.SecureRepository/Crypto/HashAlgorithm.cs deleted file mode 100644 index 636d1635f..000000000 --- a/src/Tizen.Security.SecureRepository/Tizen.Security.SecureRepository/Crypto/HashAlgorithm.cs +++ /dev/null @@ -1,46 +0,0 @@ -/* - * 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 - */ - -namespace Tizen.Security.SecureRepository.Crypto -{ - /// - /// Enumeration for the hash algorithm. - /// - /// 3 - public enum HashAlgorithm : int - { - /// - /// The no hash algorithm. - /// - None = 0, - /// - /// The hash algorithm SHA1. - /// - Sha1, - /// - /// The hash algorithm SHA256. - /// - Sha256, - /// - /// The hash algorithm SHA384. - /// - Sha384, - /// - /// The hash algorithm SHA512. - /// - Sha512 - } -} diff --git a/src/Tizen.Security.SecureRepository/Tizen.Security.SecureRepository/Crypto/RsaOaepCipherParameters.cs b/src/Tizen.Security.SecureRepository/Tizen.Security.SecureRepository/Crypto/RsaOaepCipherParameters.cs deleted file mode 100644 index dd1b7357d..000000000 --- a/src/Tizen.Security.SecureRepository/Tizen.Security.SecureRepository/Crypto/RsaOaepCipherParameters.cs +++ /dev/null @@ -1,34 +0,0 @@ -/* - * 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 - */ - -namespace Tizen.Security.SecureRepository.Crypto -{ - /// - /// A class for holding parameters for the RSA algorithm with the OAEP mode. - /// - /// 3 - public class RsaOaepCipherParameters : CipherParameters - { - /// - /// A default constructor. - /// - /// 3 - /// The CipherAlgorithmType in CipherParameters is set to CipherAlgorithmType.RsaOaep. - public RsaOaepCipherParameters() : base(CipherAlgorithmType.RsaOaep) - { - } - } -} diff --git a/src/Tizen.Security.SecureRepository/Tizen.Security.SecureRepository/Crypto/RsaPaddingAlgorithm.cs b/src/Tizen.Security.SecureRepository/Tizen.Security.SecureRepository/Crypto/RsaPaddingAlgorithm.cs deleted file mode 100644 index 39b34fe66..000000000 --- a/src/Tizen.Security.SecureRepository/Tizen.Security.SecureRepository/Crypto/RsaPaddingAlgorithm.cs +++ /dev/null @@ -1,38 +0,0 @@ -/* - * 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 - */ - -namespace Tizen.Security.SecureRepository.Crypto -{ - /// - /// Enumeration for the RSA padding algorithm. - /// - /// 3 - public enum RsaPaddingAlgorithm : int - { - /// - /// No padding. - /// - None = 0, - /// - /// PKCS#1 padding. - /// - Pkcs1, - /// - /// X9.31 padding. - /// - X931 - } -} diff --git a/src/Tizen.Security.SecureRepository/Tizen.Security.SecureRepository/Crypto/RsaSignatureParameters.cs b/src/Tizen.Security.SecureRepository/Tizen.Security.SecureRepository/Crypto/RsaSignatureParameters.cs deleted file mode 100644 index 7274f8903..000000000 --- a/src/Tizen.Security.SecureRepository/Tizen.Security.SecureRepository/Crypto/RsaSignatureParameters.cs +++ /dev/null @@ -1,44 +0,0 @@ -/* - * 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 - */ - -namespace Tizen.Security.SecureRepository.Crypto -{ - /// - /// A class for holding parameters for the RSA signature algorithm. - /// - /// 3 - public class RsaSignatureParameters : SignatureParameters - { - /// - /// A default constructor. - /// - /// 3 - /// The RsaPadding is set to RsaPaddingAlgorithm.None. - public RsaSignatureParameters() : base(SignatureAlgorithmType.Rsa) - { - } - - /// - /// The RSA padding algorithm. - /// - /// 3 - public RsaPaddingAlgorithm RsaPadding - { - get { return (RsaPaddingAlgorithm)Get(SignatureParameterName.RsaPaddingAlgorithm); } - set { Add(SignatureParameterName.RsaPaddingAlgorithm, (int)value); } - } - } -} diff --git a/src/Tizen.Security.SecureRepository/Tizen.Security.SecureRepository/Crypto/SafeCipherParametersHandle.cs b/src/Tizen.Security.SecureRepository/Tizen.Security.SecureRepository/Crypto/SafeCipherParametersHandle.cs deleted file mode 100644 index 8d7e8cf2d..000000000 --- a/src/Tizen.Security.SecureRepository/Tizen.Security.SecureRepository/Crypto/SafeCipherParametersHandle.cs +++ /dev/null @@ -1,113 +0,0 @@ -/* - * 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; - -namespace Tizen.Security.SecureRepository.Crypto -{ - internal class SafeCipherParametersHandle : SafeHandle - { - internal SafeCipherParametersHandle(CipherAlgorithmType algorithm) : - base(IntPtr.Zero, true) - { - IntPtr ptr = IntPtr.Zero; - Interop.CkmcTypes.GenerateNewParam((int)algorithm, out ptr); - this.SetHandle(ptr); - } - - internal void SetInteger(CipherParameterName name, long value) - { - Interop.CheckNThrowException( - Interop.CkmcTypes.ParamListSetInteger( - Ptr, (int)name, value), - "Failed to add parameter."); - } - - internal void SetBuffer(CipherParameterName name, byte[] value) - { - var rawBuff = new Interop.CkmcRawBuffer(new PinnedObject(value), value.Length); - IntPtr ptr = Marshal.AllocHGlobal(Marshal.SizeOf(rawBuff)); - try - { - Marshal.StructureToPtr(rawBuff, ptr, false); - Interop.CheckNThrowException( - Interop.CkmcTypes.ParamListSetBuffer( - Ptr, (int)name, ptr), - "Failed to add parameter."); - } - finally - { - Marshal.FreeHGlobal(ptr); - } - } - - internal long GetInteger(CipherParameterName name) - { - long value = 0; - Interop.CheckNThrowException( - Interop.CkmcTypes.ParamListGetInteger( - Ptr, (int)name, out value), - "Failed to get parameter."); - return value; - } - - internal byte[] GetBuffer(CipherParameterName name) - { - IntPtr ptr = IntPtr.Zero; - - try - { - Interop.CheckNThrowException( - Interop.CkmcTypes.ParamListGetBuffer( - Ptr, (int)name, out ptr), - "Failed to get parameter."); - return new SafeRawBufferHandle(ptr).Data; - } - finally - { - if (ptr != IntPtr.Zero) - Interop.CkmcTypes.BufferFree(ptr); - } - } - - internal CipherAlgorithmType Algorithm - { - get - { - return (CipherAlgorithmType)GetInteger( - CipherParameterName.AlgorithmType); - } - } - - internal IntPtr Ptr - { - get { return this.handle; } - } - - public override bool IsInvalid - { - get { return this.handle == IntPtr.Zero; } - } - - protected override bool ReleaseHandle() - { - Interop.CkmcTypes.ParamListFree(this.handle); - this.SetHandle(IntPtr.Zero); - return true; - } - } -} diff --git a/src/Tizen.Security.SecureRepository/Tizen.Security.SecureRepository/Crypto/Signature.cs b/src/Tizen.Security.SecureRepository/Tizen.Security.SecureRepository/Crypto/Signature.cs deleted file mode 100644 index 65d78242c..000000000 --- a/src/Tizen.Security.SecureRepository/Tizen.Security.SecureRepository/Crypto/Signature.cs +++ /dev/null @@ -1,184 +0,0 @@ -/* - * 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.Security.SecureRepository.Crypto -{ - /// - /// This class provides the methods for creating and verifying a signature. - /// - /// 3 - public class Signature - { - private SignatureParameters _parameters; - - /// - /// A constructor of Signature that takes the algorithm specific parameters. - /// - /// 3 - /// The algorithm specific parameters. - public Signature(SignatureParameters parameters) - { - _parameters = parameters; - } - - /// - /// The algorithm specific parameters. - /// - /// 3 - public SignatureParameters Parameters - { - get { return _parameters; } - } - - /// - /// Creates a signature on a given message using a private key and returns - /// the signature. - /// - /// 3 - /// The name of private key. - /// - /// The password used in decrypting a private key value. - /// - /// The message that is signed with a private key. - /// A newly created signature. - /// - /// The privateKeyAlias or message is null. - /// - /// - /// The privateKeyAlias is invalid format. - /// - /// - /// The key-protecting password isn't matched. - /// The key does not exist with the privateKeyAlias. - /// - /// - /// The key type specified by the privateKeyAlias should be compatible with the - /// algorithm specified in Parameters. - /// - /// - /// If the password of policy is provided during storing a key, the same password - /// should be provided. - /// - public byte[] Sign(string privateKeyAlias, string password, byte[] message) - { - if (privateKeyAlias == null || message == null) - throw new ArgumentNullException("alias and message should not be null"); - - int hash = (int)HashAlgorithm.None; - try - { - hash = (int)Parameters.Get(SignatureParameterName.HashAlgorithm); - } - catch {} - - int rsaPadding = (int)RsaPaddingAlgorithm.None; - try - { - rsaPadding = (int)Parameters.Get(SignatureParameterName.RsaPaddingAlgorithm); - } - catch {} - - IntPtr ptr = IntPtr.Zero; - - try - { - Interop.CheckNThrowException( - Interop.CkmcManager.CreateSignature( - privateKeyAlias, password, - new Interop.CkmcRawBuffer( - new PinnedObject(message), message.Length), - hash, rsaPadding, out ptr), - "Failed to generate signature"); - return new SafeRawBufferHandle(ptr).Data; - } - finally - { - if (ptr != IntPtr.Zero) - Interop.CkmcTypes.BufferFree(ptr); - } - } - - /// - /// Verifies a given signature on a given message using a public key and returns - /// the signature status. - /// - /// 3 - /// The name of public key. - /// - /// The password used in decrypting a public key value. - /// - /// The input on which the signature is created. - /// The signature that is verified with public key. - /// - /// The signature status. True is returned when the signature is valid. - /// - /// - /// The publicKeyAlias, message or signature is null. - /// - /// - /// The publicKeyAlias is invalid format. - /// - /// - /// The key-protecting password isn't matched. - /// The key does not exist with the publicKeyAlias. - /// - /// - /// The key type specified by publicKeyAlias should be compatible with the - /// algorithm specified in Parameters. - /// - /// - /// If password of policy is provided during storing a key, the same password - /// should be provided. - /// - public bool Verify( - string publicKeyAlias, string password, byte[] message, byte[] signature) - { - if (publicKeyAlias == null || message == null || signature == null) - throw new ArgumentNullException("mandatory arg should not be null"); - - int hash = (int)HashAlgorithm.None; - try - { - hash = (int)Parameters.Get(SignatureParameterName.HashAlgorithm); - } - catch {} - - int rsaPadding = (int)RsaPaddingAlgorithm.None; - try - { - rsaPadding = (int)Parameters.Get(SignatureParameterName.RsaPaddingAlgorithm); - } - catch {} - - - int ret = Interop.CkmcManager.VerifySignature( - publicKeyAlias, - password, - new Interop.CkmcRawBuffer(new PinnedObject(message), message.Length), - new Interop.CkmcRawBuffer(new PinnedObject(signature), signature.Length), - hash, - rsaPadding); - - if (ret == (int)Interop.KeyManagerError.VerificationFailed) - return false; - Interop.CheckNThrowException(ret, "Failed to verify signature"); - - return true; - } - } -} diff --git a/src/Tizen.Security.SecureRepository/Tizen.Security.SecureRepository/Crypto/SignatureAlgorithmType.cs b/src/Tizen.Security.SecureRepository/Tizen.Security.SecureRepository/Crypto/SignatureAlgorithmType.cs deleted file mode 100644 index de8376549..000000000 --- a/src/Tizen.Security.SecureRepository/Tizen.Security.SecureRepository/Crypto/SignatureAlgorithmType.cs +++ /dev/null @@ -1,38 +0,0 @@ -/* - * 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 - */ - -namespace Tizen.Security.SecureRepository.Crypto -{ - /// - /// Enumeration for signature algorithm types. - /// - /// 3 - public enum SignatureAlgorithmType : int - { - /// - /// The RSA signature algorithm. - /// - Rsa = 0x01, - /// - /// The DSA signature algorithm. - /// - Dsa, - /// - /// The ECDSA signature algorithm. - /// - Ecdsa - } -} diff --git a/src/Tizen.Security.SecureRepository/Tizen.Security.SecureRepository/Crypto/SignatureParameterName.cs b/src/Tizen.Security.SecureRepository/Tizen.Security.SecureRepository/Crypto/SignatureParameterName.cs deleted file mode 100644 index c265ad19a..000000000 --- a/src/Tizen.Security.SecureRepository/Tizen.Security.SecureRepository/Crypto/SignatureParameterName.cs +++ /dev/null @@ -1,38 +0,0 @@ -/* - * 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 - */ - -namespace Tizen.Security.SecureRepository.Crypto -{ - /// - /// Enumeration for the signature algorithm parameters. - /// - /// 3 - internal enum SignatureParameterName : int - { - /// - /// The signature algorithm type. - /// - AlgorithmType = 0x01, - /// - /// The hash algorithm type. - /// - HashAlgorithm, - /// - /// The RSA padding algorithm type. - /// - RsaPaddingAlgorithm - } -} diff --git a/src/Tizen.Security.SecureRepository/Tizen.Security.SecureRepository/Crypto/SignatureParameters.cs b/src/Tizen.Security.SecureRepository/Tizen.Security.SecureRepository/Crypto/SignatureParameters.cs deleted file mode 100644 index a61224329..000000000 --- a/src/Tizen.Security.SecureRepository/Tizen.Security.SecureRepository/Crypto/SignatureParameters.cs +++ /dev/null @@ -1,73 +0,0 @@ -/* - * 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.Collections.Generic; - -namespace Tizen.Security.SecureRepository.Crypto -{ - /// - /// An abstract class for holding parameters for signing and verification. - /// - /// 3 - abstract public class SignatureParameters - { - private Dictionary _parameters; - - /// - /// The signature algorithm type. - /// - /// 3 - public SignatureAlgorithmType SignatureAlgorithm - { - get { return (SignatureAlgorithmType)Get(SignatureParameterName.AlgorithmType); } - } - - /// - /// The hash algorithm used in signing anve verification. - /// - /// 3 - public HashAlgorithm HashAlgorithm - { - get { return (HashAlgorithm)Get(SignatureParameterName.HashAlgorithm); } - set { Add(SignatureParameterName.HashAlgorithm, (int)value); } - } - - // for inherited in internal only - internal SignatureParameters() - { - } - - internal SignatureParameters(SignatureAlgorithmType algorithm) - { - _parameters = new Dictionary(); - Add(SignatureParameterName.AlgorithmType, (int)algorithm); - } - - internal void Add(SignatureParameterName name, int value) - { - _parameters.Add(name, value); - } - - internal int Get(SignatureParameterName name) - { - if (_parameters.ContainsKey(name)) - return _parameters[name]; - else - throw new ArgumentException("No parameter for a given SignatureParameterName "); - } - } -} diff --git a/src/Tizen.Security.SecureRepository/Tizen.Security.SecureRepository/DataFormat.cs b/src/Tizen.Security.SecureRepository/Tizen.Security.SecureRepository/DataFormat.cs deleted file mode 100644 index 6b3fac49b..000000000 --- a/src/Tizen.Security.SecureRepository/Tizen.Security.SecureRepository/DataFormat.cs +++ /dev/null @@ -1,39 +0,0 @@ -/* - * 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 - */ - -namespace Tizen.Security.SecureRepository -{ - /// - /// Enumeration for data format. - /// - /// 3 - public enum DataFormat : int - { - /// - /// The DER format base64 encoded data. - /// - DerBase64 = 0, - /// - /// The DER encoded data. - /// - Der, - /// - /// The PEM encoded data. It consists of the DER format base64 encoded - /// with additional header and footer lines. - /// - Pem - } -} diff --git a/src/Tizen.Security.SecureRepository/Tizen.Security.SecureRepository/DataManager.cs b/src/Tizen.Security.SecureRepository/Tizen.Security.SecureRepository/DataManager.cs deleted file mode 100644 index 556522b11..000000000 --- a/src/Tizen.Security.SecureRepository/Tizen.Security.SecureRepository/DataManager.cs +++ /dev/null @@ -1,130 +0,0 @@ -/* - * 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.Collections.Generic; -using static Interop; - -namespace Tizen.Security.SecureRepository -{ - /// - /// This class provides the methods for storing and retrieving data. - /// - /// 3 - public class DataManager : Manager - { - /// - /// Gets data from the secure repository. - /// - /// 3 - /// The name of a certificate to retrieve. - /// - /// The password used in decrypting a data value. - /// If password of policy is provided in SaveData(), the same password should - /// be provided. - /// - /// Data specified by alias. - /// - /// The alias argument is null. - /// - /// - /// The alias argument is in the invalid format. - /// - /// - /// Data does not exist with the alias or data-protecting password isn't matched. - /// - static public byte[] Get(string alias, string password) - { - if (alias == null) - throw new ArgumentNullException("alias cannot be null"); - - IntPtr ptr = IntPtr.Zero; - - try - { - Interop.CheckNThrowException( - Interop.CkmcManager.GetData(alias, password, out ptr), - "Failed to get certificate. alias=" + alias); - return new SafeRawBufferHandle(ptr).Data; - } - finally - { - if (ptr != IntPtr.Zero) - Interop.CkmcTypes.BufferFree(ptr); - } - } - - /// - /// Gets all aliases of data, which the client can access. - /// - /// 3 - /// All aliases of data, which the client can access. - /// No alias to get. - static public IEnumerable GetAliases() - { - IntPtr ptr = IntPtr.Zero; - - try - { - Interop.CheckNThrowException( - Interop.CkmcManager.GetDataAliasList(out ptr), - "Failed to get data aliases"); - return new SafeAliasListHandle(ptr).Aliases; - } - finally - { - if (ptr != IntPtr.Zero) - Interop.CkmcTypes.AliasListAllFree(ptr); - } - } - - /// - /// Stores data inside the secure repository based on the provided policy. - /// - /// 3 - /// The name of data to be stored. - /// The binary value to be stored. - /// The policy about how to store data securely. - /// - /// Any of argument is null. - /// - /// - /// The alias argument is in the invalid format. Data policy cannot be unextractable. - /// - /// - /// Data with alias already exist. - /// - static public void Save(string alias, byte[] data, Policy policy) - { - if (alias == null || data == null || policy == null) - throw new ArgumentNullException("alias and policy should be null"); - else if (policy.Extractable == false) - throw new ArgumentException("Data should be extractable"); - - Interop.CheckNThrowException( - Interop.CkmcManager.SaveData( - alias, - new Interop.CkmcRawBuffer(new PinnedObject(data), data.Length), - policy.ToCkmcPolicy()), - "Failed to save data. alias=" + alias); - } - - // to be static class safely - internal DataManager() - { - } - } -} diff --git a/src/Tizen.Security.SecureRepository/Tizen.Security.SecureRepository/EllipticCurveType.cs b/src/Tizen.Security.SecureRepository/Tizen.Security.SecureRepository/EllipticCurveType.cs deleted file mode 100644 index d2c13b17f..000000000 --- a/src/Tizen.Security.SecureRepository/Tizen.Security.SecureRepository/EllipticCurveType.cs +++ /dev/null @@ -1,38 +0,0 @@ -/* - * 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 - */ - -namespace Tizen.Security.SecureRepository -{ - /// - /// Enumeration for the elliptic curve. - /// - /// 3 - public enum EllipticCurveType : int - { - /// - /// The elliptic curve domain "secp192r1" listed in "SEC 2" recommended elliptic curve domain. - /// - Prime192V1 = 0, - /// - /// The "SEC 2" recommended elliptic curve domain - secp256r1. - /// - Prime256V1, - /// - /// The NIST curve P-384(covers "secp384r1", the elliptic curve domain listed in See SEC 2. - /// - Secp384R1 - } -} diff --git a/src/Tizen.Security.SecureRepository/Tizen.Security.SecureRepository/Key.cs b/src/Tizen.Security.SecureRepository/Tizen.Security.SecureRepository/Key.cs deleted file mode 100644 index 675fc0a3d..000000000 --- a/src/Tizen.Security.SecureRepository/Tizen.Security.SecureRepository/Key.cs +++ /dev/null @@ -1,120 +0,0 @@ -/* - * 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; -using static Interop; - -namespace Tizen.Security.SecureRepository -{ - /// - /// The class that represents a key. - /// - /// 3 - public class Key - { - /// - /// A constructor of Key that takes the binary, its type, and optional password - /// of binary. - /// - /// 3 - /// - /// The binary value of a key. This binary may be encrypted with binaryPassword. - /// - /// The key's type. - /// - /// The password used to decrypt binary when binary is encrypted. - /// - public Key(byte[] binary, KeyType type, string binaryPassword) - { - this.Binary = binary; - this.Type = type; - this.BinaryPassword = binaryPassword; - } - - internal Key(IntPtr ptr) - { - if (ptr == IntPtr.Zero) - throw new ArgumentNullException("Returned ptr from CAPI cannot be null"); - - var ckmcKey = Marshal.PtrToStructure(ptr); - this.Binary = new byte[(int)ckmcKey.size]; - Marshal.Copy(ckmcKey.rawKey, this.Binary, 0, this.Binary.Length); - this.Type = (KeyType)ckmcKey.keyType; - this.BinaryPassword = ckmcKey.password; - } - - // Refresh handle(IntPtr) always. Because C# layer - // properties(Binary, Type, BinaryPassword) could be changed. - internal IntPtr GetHandle() - { - IntPtr ptr = IntPtr.Zero; - try - { - CheckNThrowException( - Interop.CkmcTypes.KeyNew( - this.Binary, (UIntPtr)this.Binary.Length, (int)this.Type, - this.BinaryPassword, out ptr), - "Failed to create key"); - - return ptr; - } - catch - { - if (ptr != IntPtr.Zero) - Interop.CkmcTypes.KeyFree(ptr); - - throw; - } - } - - /// - /// The binary value of a key. - /// - /// 3 - public byte[] Binary - { - get; set; - } - - /// - /// The key's type. - /// - /// 3 - public KeyType Type - { - get; set; - } - - /// - /// The password used to decrypt binary when binary is encrypted. It's optional. - /// - /// 3 - public string BinaryPassword - { - get; set; - } - - internal CkmcKey ToCkmcKey() - { - return new Interop.CkmcKey( - (Binary == null) ? IntPtr.Zero : new PinnedObject(this.Binary), - (Binary == null) ? 0 : this.Binary.Length, - (int)this.Type, - this.BinaryPassword); - } - } -} diff --git a/src/Tizen.Security.SecureRepository/Tizen.Security.SecureRepository/KeyManager.cs b/src/Tizen.Security.SecureRepository/Tizen.Security.SecureRepository/KeyManager.cs deleted file mode 100644 index f1e3bac0c..000000000 --- a/src/Tizen.Security.SecureRepository/Tizen.Security.SecureRepository/KeyManager.cs +++ /dev/null @@ -1,304 +0,0 @@ -/* - * 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.Collections.Generic; - -namespace Tizen.Security.SecureRepository -{ - /// - /// This class provides the methods for storing, retrieving, and creating keys. - /// - /// 3 - public class KeyManager : Manager - { - /// - /// Gets a key from the secure repository. - /// - /// 3 - /// The name of a key to retrieve. - /// - /// The password used in decrypting a key value. - /// If password of policy is provided in SaveKey(), the same password should - /// be provided. - /// - /// A key specified by alias. - /// - /// The alias argument is null. - /// - /// - /// The alias argument is in the invalid format. - /// - /// - /// The key does not exist with the alias or the key-protecting password isn't matched. - /// - static public Key Get(string alias, string password) - { - if (alias == null) - throw new ArgumentNullException("alias cannot be null"); - - IntPtr ptr = IntPtr.Zero; - - try - { - Interop.CheckNThrowException( - Interop.CkmcManager.GetKey(alias, password, out ptr), - "Failed to get key. alias=" + alias); - return new Key(ptr); - } - finally - { - if (ptr != IntPtr.Zero) - Interop.CkmcTypes.KeyFree(ptr); - } - } - - /// - /// Gets all aliases of keys, which the client can access. - /// - /// 3 - /// All aliases of keys, which the client can access. - /// No alias to get. - static public IEnumerable GetAliases() - { - IntPtr ptr = IntPtr.Zero; - - try - { - Interop.CheckNThrowException( - Interop.CkmcManager.GetKeyAliasList(out ptr), - "Failed to get key aliases."); - return new SafeAliasListHandle(ptr).Aliases; - } - finally - { - if (ptr != IntPtr.Zero) - Interop.CkmcTypes.AliasListAllFree(ptr); - } - } - - /// - /// Stores a key inside the secure repository based on the provided policy. - /// - /// 3 - /// The name of a key to be stored. - /// The key's binary value to be stored. - /// The policy about how to store a key securely. - /// - /// Any of argument is null. - /// - /// - /// The alias argument is in the invalid format. key argument is in the invalid format. - /// - /// - /// The key with alias does already exist. - /// - /// - /// The type in key may be set to KeyType.None as an input. - /// The type is determined inside the secure reposioty during storing keys. - /// - /// - /// If the password in policy is provided, the key is additionally encrypted with - /// the password in policy. - /// - static public void Save(string alias, Key key, Policy policy) - { - if (alias == null || key == null || policy == null) - throw new ArgumentNullException("More than one of argument is null"); - - Interop.CheckNThrowException( - Interop.CkmcManager.SaveKey( - alias, key.ToCkmcKey(), policy.ToCkmcPolicy()), - "Failed to save Key. alias=" + alias); - } - - /// - /// Creates the RSA private/public key pair and stores them inside the secure repository - /// based on each policy. - /// - /// 3 - /// - /// The size of key strength to be created. 1024, 2048, and 4096 are supported. - /// - /// The name of private key to be stored. - /// The name of public key to be stored. - /// - /// The policy about how to store a private key securely. - /// - /// - /// The policy about how to store a public key securely. - /// - /// - /// Any of argument is null. - /// - /// - /// The size is invalid. privateKeyAlias or publicKeyAlias is invalid format. - /// - /// - /// The key with privateKeyAlias or publicKeyAlias does already exist. - /// - /// - /// If the password in policy is provided, the key is additionally encrypted with the - /// password in policy. - /// - static public void CreateRsaKeyPair( - int size, string privateKeyAlias, string publicKeyAlias, - Policy privateKeyPolicy, Policy publicKeyPolicy) - { - if (size != 1024 && size != 2048 && size != 4096) - throw new ArgumentException(string.Format("Invalid key size({0})", size)); - else if (privateKeyAlias == null || publicKeyAlias == null || - privateKeyPolicy == null || publicKeyPolicy == null) - throw new ArgumentNullException("alias and policy should not be null"); - - Interop.CheckNThrowException( - Interop.CkmcManager.CreateKeyPairRsa( - (UIntPtr)size, privateKeyAlias, publicKeyAlias, - privateKeyPolicy.ToCkmcPolicy(), publicKeyPolicy.ToCkmcPolicy()), - "Failed to Create RSA Key Pair"); - } - - /// - /// Creates the DSA private/public key pair and stores them inside the secure repository - /// based on each policy. - /// - /// 3 - /// - /// The size of key strength to be created. 1024, 2048, 3072, and 4096 are - /// supported. - /// - /// The name of private key to be stored. - /// The name of public key to be stored. - /// - /// The policy about how to store a private key securely. - /// - /// - /// The policy about how to store a public key securely. - /// - /// - /// Any of argument is null. - /// - /// - /// The size is invalid. privateKeyAlias or publicKeyAlias is invalid format. - /// - /// - /// The key with privateKeyAlias or publicKeyAlias does already exist. - /// - /// - /// If the password in policy is provided, the key is additionally encrypted with - /// the password in policy. - /// - static public void CreateDsaKeyPair( - int size, string privateKeyAlias, string publicKeyAlias, - Policy privateKeyPolicy, Policy publicKeyPolicy) - { - if (size != 1024 && size != 2048 && size != 3072 && size != 4096) - throw new ArgumentException(string.Format("Invalid key size({0})", size)); - else if (privateKeyAlias == null || publicKeyAlias == null || - privateKeyPolicy == null || publicKeyPolicy == null) - throw new ArgumentNullException("alias and policy should not be null"); - - Interop.CheckNThrowException( - Interop.CkmcManager.CreateKeyPairDsa( - (UIntPtr)size, privateKeyAlias, publicKeyAlias, - privateKeyPolicy.ToCkmcPolicy(), publicKeyPolicy.ToCkmcPolicy()), - "Failed to Create DSA Key Pair"); - } - - /// - /// Creates the ECDSA private/public key pair and stores them inside secure repository - /// based on each policy. - /// - /// 3 - /// The type of elliptic curve of ECDSA. - /// The name of private key to be stored. - /// The name of public key to be stored. - /// - /// The policy about how to store a private key securely. - /// - /// - /// The policy about how to store a public key securely. - /// - /// - /// Any of argument is null. - /// - /// - /// The elliptic curve type is invalid. privateKeyAlias or publicKeyAlias is in the - /// invalid format. - /// - /// - /// The key with privateKeyAlias or publicKeyAlias does already exist. - /// - /// - /// If the password in policy is provided, the key is additionally encrypted with - /// the password in policy. - /// - static public void CreateEcdsaKeyPair( - EllipticCurveType type, string privateKeyAlias, string publicKeyAlias, - Policy privateKeyPolicy, Policy publicKeyPolicy) - { - if (privateKeyAlias == null || publicKeyAlias == null || - privateKeyPolicy == null || publicKeyPolicy == null) - throw new ArgumentNullException("alias and policy should not be null"); - - Interop.CheckNThrowException( - Interop.CkmcManager.CreateKeyPairEcdsa( - (int)type, privateKeyAlias, publicKeyAlias, - privateKeyPolicy.ToCkmcPolicy(), publicKeyPolicy.ToCkmcPolicy()), - "Failed to Create ECDSA Key Pair"); - } - - /// - /// Creates the AES key and stores it inside the secure repository based on each policy. - /// - /// 3 - /// - /// The size of the key strength to be created. 128, 192 and 256 are supported. - /// - /// The name of key to be stored. - /// The policy about how to store the key securely. - /// - /// The keyAlias or policy is null. - /// - /// - /// The key size is invalid. keyAlias is in the invalid format. - /// - /// - /// The key with privateKeyAlias or publicKeyAlias does already exist. - /// - /// - /// If the password in policy is provided, the key is additionally encrypted with - /// the password in policy. - /// - static public void CreateAesKey(int size, string keyAlias, Policy policy) - { - if (size != 128 && size != 192 && size != 256) - throw new ArgumentException(string.Format("Invalid key size({0})", size)); - else if (keyAlias == null || policy == null) - throw new ArgumentNullException("alias and policy should not be null"); - - Interop.CheckNThrowException( - Interop.CkmcManager.CreateKeyAes( - (UIntPtr)size, keyAlias, policy.ToCkmcPolicy()), - "Failed to AES Key"); - } - - // to be static class safely - internal KeyManager() - { - } - } -} diff --git a/src/Tizen.Security.SecureRepository/Tizen.Security.SecureRepository/KeyType.cs b/src/Tizen.Security.SecureRepository/Tizen.Security.SecureRepository/KeyType.cs deleted file mode 100644 index 2458f76ed..000000000 --- a/src/Tizen.Security.SecureRepository/Tizen.Security.SecureRepository/KeyType.cs +++ /dev/null @@ -1,58 +0,0 @@ -/* - * 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 - */ - -namespace Tizen.Security.SecureRepository -{ - /// - /// Enumeration for key types of key manager. - /// - /// 3 - public enum KeyType : int - { - /// - /// Key type not specified. - /// - None = 0, - /// - /// The RSA public key. - /// - RsaPublic, - /// - /// The RSA private key. - /// - RsaPrivate, - /// - /// The ECDSA public key. - /// - EcdsaPublic, - /// - /// The ECDSA private key. - /// - EcdsaPrivate, - /// - /// The DSA public key. - /// - DsaPublic, - /// - /// The DSA private key. - /// - DsaPrivate, - /// - /// The AES key. - /// - Aes - } -} diff --git a/src/Tizen.Security.SecureRepository/Tizen.Security.SecureRepository/Manager.cs b/src/Tizen.Security.SecureRepository/Tizen.Security.SecureRepository/Manager.cs deleted file mode 100644 index 9df853b7b..000000000 --- a/src/Tizen.Security.SecureRepository/Tizen.Security.SecureRepository/Manager.cs +++ /dev/null @@ -1,114 +0,0 @@ -/* - * 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.Security.SecureRepository -{ - /// - /// This class is a base class of the XxxManager classes. It provides the common methods - /// for all sub classes. - /// - /// 3 - public class Manager - { - /// - /// Creates a new full alias, which is concatenation of owner ID and alias. - /// - /// 3 - /// Data owner's ID. This should be package ID if data - /// owner is application. If you want to access data stored by system services, - /// use CreateFullSystemAlias() instead. - /// Data alias. - static public string CreateFullAlias(string ownerId, string alias) - { - return ownerId + Manager.OwnerIdSeperator + alias; - } - - /// - /// Creates a new full alias, which is concatenation of system service's - /// owner ID and alias. - /// - /// 3 - /// Data alias, which is owned by system service. - static public string CreateFullSystemAlias(string alias) - { - return Manager.CreateFullAlias(Manager.SystemOwnerId, alias); - } - - /// - /// Removes an entry (no matter of type) from the key manager. - /// - /// 3 - /// Item alias to be removed. - /// The alias is null. - /// The alias is in the invalid format. - /// The alias does not exist. - /// - /// To remove item, client must remove permission to the specified item. - /// - /// The item owner can remove by default. - static public void RemoveAlias(string alias) - { - if (alias == null) - throw new ArgumentNullException("alias should not be null"); - - Interop.CheckNThrowException( - Interop.CkmcManager.RemoveAlias(alias), - "Failed to remove alias. alias=" + alias); - } - - /// - /// Allows another application to access client's application data. - /// - /// 3 - /// Item alias for which access will be granted. - /// - /// Package ID of the application that will gain access rights. - /// - /// - /// Mask of permissions(Permission enum) granted for an application with - /// otherPackageId. - /// - /// - /// The alias or otherPackageId is null. - /// - /// - /// The alias or otherPackageId is in the invalid format. - /// - /// The alias does not exist. - /// Data identified by alias should exist. - /// The item owner can set permissions. - static public void SetPermission( - string alias, string otherPackageId, int permissions) - { - if (alias == null || otherPackageId == null) - throw new ArgumentNullException("alias or otherPackageId is null"); - - Interop.CheckNThrowException( - Interop.CkmcManager.SetPermission(alias, otherPackageId, permissions), - "Failed to set permission. alias=" + alias); - } - - // to being static base class - internal Manager() - { - } - - private const string OwnerIdSeperator = " "; - private const string SystemOwnerId = "/System"; - } -} diff --git a/src/Tizen.Security.SecureRepository/Tizen.Security.SecureRepository/OcspStatus.cs b/src/Tizen.Security.SecureRepository/Tizen.Security.SecureRepository/OcspStatus.cs deleted file mode 100644 index 4e581359e..000000000 --- a/src/Tizen.Security.SecureRepository/Tizen.Security.SecureRepository/OcspStatus.cs +++ /dev/null @@ -1,68 +0,0 @@ -/* - * 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.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Tizen.Security.SecureRepository -{ - /// - /// Enumeration for the OCSP status. - /// - /// 3 - public enum OcspStatus : int - { - /// - /// The OCSP status is good. - /// - Good = 0x00, - /// - /// The certificate is revoked. - /// - Revoked = 0x01, - /// - /// Unknown error. - /// - Unknown = 0x02, - /// - /// The certificate does not provide the OCSP extension. - /// - Unsupported = 0x03, - /// - /// The invalid URL in the certificate OCSP extension. - /// - InvalidUrl = 0x04, - /// - /// The invalid response from the OCSP server. - /// - InvalidResponse = 0x05, - /// - /// The OCSP remote server error. - /// - RemoteError = 0x06, - /// - /// The Network connection error. - /// - NetworkError = 0x07, - /// - /// An Internal error. - /// - InternalError = 0x08 - } -} diff --git a/src/Tizen.Security.SecureRepository/Tizen.Security.SecureRepository/Permission.cs b/src/Tizen.Security.SecureRepository/Tizen.Security.SecureRepository/Permission.cs deleted file mode 100644 index 33a3f9524..000000000 --- a/src/Tizen.Security.SecureRepository/Tizen.Security.SecureRepository/Permission.cs +++ /dev/null @@ -1,39 +0,0 @@ -/* - * 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 - */ - -namespace Tizen.Security.SecureRepository -{ - - /// - /// Enumeration for permissions to access/modify alias. - /// - /// 3 - public enum Permission : int - { - /// - /// Clear permissions. - /// - None = 0x00, - /// - /// Read allowed. - /// - Read = 0x01, - /// - /// Remove allowed. - /// - Remove = 0x02 - } -} diff --git a/src/Tizen.Security.SecureRepository/Tizen.Security.SecureRepository/PinnedObject.cs b/src/Tizen.Security.SecureRepository/Tizen.Security.SecureRepository/PinnedObject.cs deleted file mode 100644 index 83d3e4df6..000000000 --- a/src/Tizen.Security.SecureRepository/Tizen.Security.SecureRepository/PinnedObject.cs +++ /dev/null @@ -1,56 +0,0 @@ -/* - * 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; - -namespace Tizen.Security.SecureRepository -{ - internal class PinnedObject : IDisposable - { - private bool _disposed = false; - private GCHandle _pinnedObj; - - public PinnedObject(Object obj) - { - _pinnedObj = GCHandle.Alloc(obj, GCHandleType.Pinned); - } - - ~PinnedObject() - { - Dispose(false); - } - - public static implicit operator IntPtr(PinnedObject pinned) - { - return pinned._pinnedObj.AddrOfPinnedObject(); - } - - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - - protected virtual void Dispose(bool disposing) - { - if (_disposed) - return; - _pinnedObj.Free(); - _disposed = true; - } - } -} diff --git a/src/Tizen.Security.SecureRepository/Tizen.Security.SecureRepository/Pkcs12.cs b/src/Tizen.Security.SecureRepository/Tizen.Security.SecureRepository/Pkcs12.cs deleted file mode 100644 index 0afb0e3f6..000000000 --- a/src/Tizen.Security.SecureRepository/Tizen.Security.SecureRepository/Pkcs12.cs +++ /dev/null @@ -1,192 +0,0 @@ -/* - * 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.Collections.Generic; -using System.Runtime.InteropServices; -using static Interop; - -namespace Tizen.Security.SecureRepository -{ - /// - /// The class that represents a PKCS#12 contents. - /// It has a private key or its certificate or all the members of a chain of trust. - /// - /// 3 - public class Pkcs12 - { - private SafeCertificateListHandle _certChainHandle = null; - - /// - /// Loads the Pkcs12 from the given PKCS#12 file path. - /// - /// 3 - /// The path of the PKCS12 file to be loaded. - /// The passphrase used to decrypt the PCKS12 file. - /// If the PKCS12 file is not encrypted, passphrase can be null. - /// The filePath is null. - /// - /// No file on filePath. - /// No permission to access file. - /// File is in the invalid PKCS12 format. - /// File cannot be extracted with provided filePassword. - /// - static public Pkcs12 Load(string filePath, string filePassword) - { - if (filePath == null) - throw new ArgumentNullException("filePath should not be null"); - - IntPtr ptr = IntPtr.Zero; - - try - { - Interop.CheckNThrowException( - Interop.CkmcTypes.Pkcs12Load(filePath, filePassword, out ptr), - "Failed to load PKCS12. file=" + filePath); - return new Pkcs12(ptr); - } - finally - { - if (ptr != IntPtr.Zero) - Interop.CkmcTypes.Pkcs12Free(ptr); - } - } - - /// - /// A constructor of Key that takes a private key. - /// - /// 3 - /// A private key. - public Pkcs12(Key privateKey) - { - this.PrivateKey = privateKey; - this.Certificate = null; - this.CaChain = null; - } - - /// - /// A constructor of Key that takes a private key, its corresponding certicate, - /// and CA's certificate chain. - /// - /// 3 - /// A private key. - /// A certificate corresponding the private key. - /// - /// A certificate chain of CA(Certificate Authority) that issued the certificate. - /// - public Pkcs12(Key privateKey, - Certificate certificate, - IEnumerable caChain) - { - this.PrivateKey = privateKey; - this.Certificate = certificate; - this.CaChain = caChain; - } - - internal Pkcs12(IntPtr ptr) - { - var ckmcPkcs12 = Marshal.PtrToStructure(ptr); - - this.PrivateKey = new Key(ckmcPkcs12.privateKey); - if (ckmcPkcs12.certificate != IntPtr.Zero) - this.Certificate = new Certificate(ckmcPkcs12.certificate); - if (ckmcPkcs12.caChain != IntPtr.Zero) - this._certChainHandle = new SafeCertificateListHandle(ckmcPkcs12.caChain); - } - - internal IntPtr GetHandle() - { - IntPtr keyPtr = IntPtr.Zero; - IntPtr certPtr = IntPtr.Zero; - IntPtr cacertPtr = IntPtr.Zero; - IntPtr p12Ptr = IntPtr.Zero; - try - { - keyPtr = this.PrivateKey.GetHandle(); - - if (this.Certificate != null) - certPtr = this.Certificate.GetHandle(); - - if (this._certChainHandle != null) - cacertPtr = this._certChainHandle.GetHandle(); - - Interop.CheckNThrowException( - Interop.CkmcTypes.Pkcs12New(keyPtr, certPtr, cacertPtr, out p12Ptr), - "Failed to create pkcs12"); - - return p12Ptr; - } - catch - { - if (p12Ptr != IntPtr.Zero) - { - Interop.CkmcTypes.Pkcs12Free(p12Ptr); - } - else - { - if (keyPtr != IntPtr.Zero) - Interop.CkmcTypes.KeyFree(keyPtr); - if (certPtr != IntPtr.Zero) - Interop.CkmcTypes.CertFree(certPtr); - if (cacertPtr != IntPtr.Zero) - Interop.CkmcTypes.CertListAllFree(cacertPtr); - } - - throw; - } - } - - /// - /// A private key. - /// - /// 3 - public Key PrivateKey - { - get; set; - } - - /// - /// A certificate corresponding to the private key. - /// - /// 3 - public Certificate Certificate - { - get; set; - } - - /// - /// A certificate chain of CA(Certificate Authority) that issued the certificate. - /// - /// 3 - public IEnumerable CaChain - { - get - { - if (this._certChainHandle == null) - return null; - else - return this._certChainHandle.Certificates; - } - set - { - if (value == null) - this._certChainHandle = null; - else - this._certChainHandle = new SafeCertificateListHandle(value); - } - } - } -} diff --git a/src/Tizen.Security.SecureRepository/Tizen.Security.SecureRepository/Pkcs12Manager.cs b/src/Tizen.Security.SecureRepository/Tizen.Security.SecureRepository/Pkcs12Manager.cs deleted file mode 100644 index 8775ab5f3..000000000 --- a/src/Tizen.Security.SecureRepository/Tizen.Security.SecureRepository/Pkcs12Manager.cs +++ /dev/null @@ -1,125 +0,0 @@ -/* - * 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 static Interop; - -namespace Tizen.Security.SecureRepository -{ - /// - /// This class provides the methods for storing and retrieving the Pkcs12 contents. - /// - /// 3 - public class Pkcs12Manager : Manager - { - /// - /// Gets Pkcs12 contents from the secure repository. - /// - /// 3 - /// The name of data to retrieve. - /// - /// The password used in decrypting a private key value. If password of - /// keyPolicy is provided in SavePkcs12(), the same password should be provided. - /// - /// - /// The password used in decrypting a certificate value. If password of - /// certificatePolicy is provided in SavePkcs12(), the same password should be - /// provided. - /// - /// A Pkcs12 data specified by alias. - /// The alias argument is null. - /// - /// The alias argument is in the invalid format. - /// - /// - /// Pkcs12 does not exist with the alias. - /// Optional password of key in Pkcs12 isn't matched. - /// Optional password of certificate in Pkcs12 isn't matched. - /// - static public Pkcs12 Get( - string alias, string keyPassword, string cerificatePassword) - { - if (alias == null) - throw new ArgumentNullException("alias should not be null"); - - IntPtr ptr = IntPtr.Zero; - - try - { - Interop.CheckNThrowException( - Interop.CkmcManager.GetPkcs12( - alias, keyPassword, cerificatePassword, out ptr), - "Failed to get PKCS12. alias=" + alias); - return new Pkcs12(ptr); - } - finally - { - if (ptr != IntPtr.Zero) - Interop.CkmcTypes.Pkcs12Free(ptr); - } - } - - /// - /// Stores PKCS12's contents inside key manager based on the provided policies. - /// All items from the PKCS12 will use the same alias. - /// - /// 3 - /// The name of a data to be stored. - /// The pkcs12 data to be stored. - /// - /// The policy about how to store pkcs's private key. - /// - /// - /// The policy about how to store pkcs's certificate. - /// - /// Any of argument is null. - /// - /// The alias argument is in the invalid format. Pkcs12 argument is in the invalid format. - /// - /// - /// Pkcs12 with alias does already exist. - /// - static public void Save( - string alias, Pkcs12 pkcs12, Policy keyPolicy, Policy certificatePolicy) - { - if (alias == null || pkcs12 == null || keyPolicy == null || - certificatePolicy == null) - throw new ArgumentNullException("any of argument is null"); - - IntPtr ptr = IntPtr.Zero; - try - { - ptr = pkcs12.GetHandle(); - - Interop.CheckNThrowException( - Interop.CkmcManager.SavePkcs12( - alias, ptr, keyPolicy.ToCkmcPolicy(), - certificatePolicy.ToCkmcPolicy()), - "Failed to save PKCS12. alias=" + alias); - } - finally - { - if (ptr != IntPtr.Zero) - Interop.CkmcTypes.Pkcs12Free(ptr); - } - } - - // to be static class safely - internal Pkcs12Manager() - { - } - } -} diff --git a/src/Tizen.Security.SecureRepository/Tizen.Security.SecureRepository/Policy.cs b/src/Tizen.Security.SecureRepository/Tizen.Security.SecureRepository/Policy.cs deleted file mode 100644 index ba3a8851f..000000000 --- a/src/Tizen.Security.SecureRepository/Tizen.Security.SecureRepository/Policy.cs +++ /dev/null @@ -1,75 +0,0 @@ -/* - * 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 static Interop; - -namespace Tizen.Security.SecureRepository -{ - /// - /// A class for a policy for storing key, certificate, and binary data. - /// - /// 3 - public class Policy - { - /// - /// A default constructor of Policy with default policy. - /// - /// 3 - /// The default value for Password is null and the default value for Extractabl is false. - public Policy() - { - Password = null; - Extractable = true; - } - - /// - /// A constructor of Key that takes the password and the flag for extractable. - /// - /// 3 - /// Used to encrypt data secure repository. - /// If true, key may be extracted from the secure repository. - public Policy(String password, bool extractable) - { - Password = password; - Extractable = extractable; - } - - /// - /// Used to encrypt data secure repository. If it is not null, the data - /// (or key, or certificate) is stored encrypted with this password inside secure repository. - /// - /// 3 - public String Password - { - get; set; - } - - /// - /// If true, key may be extracted from the secure repository. - /// - /// 3 - public bool Extractable - { - get; set; - } - - internal CkmcPolicy ToCkmcPolicy() - { - return new Interop.CkmcPolicy(Password, Extractable); - } - } -} diff --git a/src/Tizen.Security.SecureRepository/Tizen.Security.SecureRepository/SafeAliasListHandle.cs b/src/Tizen.Security.SecureRepository/Tizen.Security.SecureRepository/SafeAliasListHandle.cs deleted file mode 100644 index 13c15d6ea..000000000 --- a/src/Tizen.Security.SecureRepository/Tizen.Security.SecureRepository/SafeAliasListHandle.cs +++ /dev/null @@ -1,45 +0,0 @@ -/* - * 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.Collections.Generic; -using System.Runtime.InteropServices; -using static Interop; - -namespace Tizen.Security.SecureRepository -{ - internal class SafeAliasListHandle - { - public SafeAliasListHandle(IntPtr ptr) - { - var cur = ptr; - var aliases = new List(); - while (cur != IntPtr.Zero) - { - var ckmcAliasList = Marshal.PtrToStructure(cur); - aliases.Add(Marshal.PtrToStringAnsi(ckmcAliasList.alias)); - cur = ckmcAliasList.next; - } - - this.Aliases = aliases; - } - - public List Aliases - { - get; set; - } - } -} diff --git a/src/Tizen.Security.SecureRepository/Tizen.Security.SecureRepository/SafeCertificateListHandle.cs b/src/Tizen.Security.SecureRepository/Tizen.Security.SecureRepository/SafeCertificateListHandle.cs deleted file mode 100644 index 7b1f75a0b..000000000 --- a/src/Tizen.Security.SecureRepository/Tizen.Security.SecureRepository/SafeCertificateListHandle.cs +++ /dev/null @@ -1,102 +0,0 @@ -/* - * 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.Collections.Generic; -using System.Runtime.InteropServices; -using static Interop; - -namespace Tizen.Security.SecureRepository -{ - internal class SafeCertificateListHandle - { - private IEnumerable _certificates; - - public SafeCertificateListHandle(IEnumerable certs) - { - _certificates = certs; - } - - public SafeCertificateListHandle(IntPtr ptr) - { - var cur = ptr; - var certs = new List(); - while (cur != IntPtr.Zero) - { - var ckmcCertList = Marshal.PtrToStructure(cur); - certs.Add(new Certificate(ckmcCertList.cert)); - cur = ckmcCertList.next; - } - - this._certificates = certs; - } - - public IEnumerable Certificates - { - get { return _certificates; } - } - - internal IntPtr GetHandle() - { - if (_certificates == null) - return IntPtr.Zero; - - IntPtr first = IntPtr.Zero; - IntPtr previous = IntPtr.Zero; - IntPtr certPtr = IntPtr.Zero; - - try - { - foreach (var cert in this._certificates) - { - // initialize local variables to release memory safely for - // in case of exception occured - certPtr = IntPtr.Zero; - - certPtr = cert.GetHandle(); - - IntPtr outCertList; - if (previous == IntPtr.Zero) - { - Interop.CheckNThrowException( - Interop.CkmcTypes.CertListNew(certPtr, out outCertList), - "Failed to create new CertificateList."); - first = outCertList; - } - else - { - Interop.CheckNThrowException( - Interop.CkmcTypes.CertListAdd(previous, certPtr, - out outCertList), - "Failed to add Certificate to CertificateList."); - } - previous = outCertList; - } - - return first; - } - catch - { - if (first != IntPtr.Zero) - Interop.CkmcTypes.CertListAllFree(first); - if (certPtr != IntPtr.Zero) - Interop.CkmcTypes.CertFree(certPtr); - - throw; - } - } - } -} diff --git a/src/Tizen.Security.SecureRepository/Tizen.Security.SecureRepository/SafeRawBufferHandle.cs b/src/Tizen.Security.SecureRepository/Tizen.Security.SecureRepository/SafeRawBufferHandle.cs deleted file mode 100644 index 04c0db652..000000000 --- a/src/Tizen.Security.SecureRepository/Tizen.Security.SecureRepository/SafeRawBufferHandle.cs +++ /dev/null @@ -1,62 +0,0 @@ -/* - * 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; -using static Interop; - -namespace Tizen.Security.SecureRepository -{ - internal class SafeRawBufferHandle - { - public SafeRawBufferHandle(IntPtr ptr) - { - if (ptr == IntPtr.Zero) - throw new ArgumentNullException("Returned ptr from CAPI cannot be null"); - - var ckmcBuf = Marshal.PtrToStructure(ptr); - byte[] data = new byte[(int)ckmcBuf.size]; - Marshal.Copy(ckmcBuf.data, data, 0, data.Length); - this.Data = data; - } - - internal IntPtr GetHandle() - { - IntPtr ptr = IntPtr.Zero; - try - { - CheckNThrowException( - Interop.CkmcTypes.BufferNew( - this.Data, (UIntPtr)this.Data.Length, out ptr), - "Failed to create buf"); - - return ptr; - } - catch - { - if (ptr != IntPtr.Zero) - Interop.CkmcTypes.BufferFree(ptr); - - throw; - } - } - - public byte[] Data - { - get; set; - } - } -} diff --git a/src/Tizen.Security.TEEC/.gitignore b/src/Tizen.Security.TEEC/.gitignore deleted file mode 100644 index a6c57f5fb..000000000 --- a/src/Tizen.Security.TEEC/.gitignore +++ /dev/null @@ -1 +0,0 @@ -*.json diff --git a/src/Tizen.Security.TEEC/Interop/Interop.Errors.cs b/src/Tizen.Security.TEEC/Interop/Interop.Errors.cs deleted file mode 100644 index eb8642217..000000000 --- a/src/Tizen.Security.TEEC/Interop/Interop.Errors.cs +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Interop.Errors.cs - * - * Created on: Apr 4, 2017 - * Author: k.dynowski - */ - -using System; - -internal static partial class Interop -{ - - private const string LogTag = "Tizen.Security.Libteec"; - internal enum LibteecError : uint - { - None = 0, - NotImplemented = 0xFFFF0009, - CommunicationFailed = 0xFFFF000E, - }; - - internal static void CheckNThrowException(int err, string msg) - { - switch ((uint)err) - { - case (uint)LibteecError.None: - return ; - case (uint)LibteecError.NotImplemented: - throw new NotSupportedException(string.Format("[{0}] {1} error=0x{2}", - LogTag, msg, err.ToString("X"))); - case (uint)LibteecError.CommunicationFailed: - throw new Exception(string.Format("[{0}] {1} error=0x{2}", - LogTag, msg, err.ToString("X"))); - default: - throw new InvalidOperationException(string.Format("[{0}] {1}, error=0x{2}", - LogTag, msg, err.ToString("X"))); - - } - } -} diff --git a/src/Tizen.Security.TEEC/Interop/Interop.Libraries.cs b/src/Tizen.Security.TEEC/Interop/Interop.Libraries.cs deleted file mode 100644 index 25c903eeb..000000000 --- a/src/Tizen.Security.TEEC/Interop/Interop.Libraries.cs +++ /dev/null @@ -1,23 +0,0 @@ -/* - * 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 Libteec = "libteec.so"; - } -} diff --git a/src/Tizen.Security.TEEC/Interop/Interop.Libteec.cs b/src/Tizen.Security.TEEC/Interop/Interop.Libteec.cs deleted file mode 100644 index 9680956ce..000000000 --- a/src/Tizen.Security.TEEC/Interop/Interop.Libteec.cs +++ /dev/null @@ -1,130 +0,0 @@ -/* - * Copyright (c) 2017 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; -//using Interop.Liibteec.Types; - -internal static partial class Interop -{ - internal static partial class Libteec - { - /// - /// This function initializes a new TEE Context, forming a connection between this client application and the - /// TEE identified by the string identifier name. - /// The client application may pass a name with a value of null, which means that the implementation must - /// select a default TEE to connect to. The supported name strings, the mapping of these names to a specific - /// TEE, and the nature of the default TEE are implementation-defined. - /// - //TEEC_Result TEEC_InitializeContext(const char *name, TEEC_Context *context); - [DllImport(Libraries.Libteec, EntryPoint = "TEEC_InitializeContext", CallingConvention = CallingConvention.Cdecl)] - static public extern int InitializeContext(string name, ref TEEC_Context context); - - /// - /// This function destroys an initialized TEE Context, closing the connection between the client application - /// and the TEE. The client application must only call this function when all sessions inside this TEE - /// context have been closed and all shared memory blocks have been released. - /// The implementation of this function must not fail; after this function returns, the client - /// application must be able to consider that the context has been closed. - /// The function implementation must do nothing if the value of the context pointer is null. - /// - //void TEEC_FinalizeContext(TEEC_Context *context); - [DllImport(Libraries.Libteec, EntryPoint = "TEEC_FinalizeContext", CallingConvention = CallingConvention.Cdecl)] - static public extern void FinalizeContext(ref TEEC_Context context); - - /// - /// This function registers a block of existing client application memory as a block of shared memory within - /// the scope of the specified TEE Context, in accordance with the parameters which have been set by the - /// client application inside the shared memory structure. - /// The input context must point to an initialized TEE Context. - /// The input shared Memory must point to the shared memory structure defining the memory region to register. - /// - //EEC_Result TEEC_RegisterSharedMemory(TEEC_Context *context, TEEC_SharedMemory *sharedMem); - [DllImport(Libraries.Libteec, EntryPoint = "TEEC_RegisterSharedMemory", CallingConvention = CallingConvention.Cdecl)] - static public extern int RegisterSharedMemory(ref TEEC_Context context, ref TEEC_SharedMemory sharedMem); - - /// - /// This function allocates a new block of memory as a block of shared memory within the scope of the - /// specified TEE Context, in accordance with the parameters which have been set by the client application - /// inside the shared memory structure. - /// The input context must point to an initialized TEE Context. - /// The input shared memory must point to the shared memory structure defining the region to allocate. - /// - //TEEC_Result TEEC_AllocateSharedMemory(TEEC_Context *context, TEEC_SharedMemory *sharedMem); - [DllImport(Libraries.Libteec, EntryPoint = "TEEC_AllocateSharedMemory", CallingConvention = CallingConvention.Cdecl)] - static public extern int AllocateSharedMemory(ref TEEC_Context context, ref TEEC_SharedMemory sharedMem); - - /// - /// This function deregisters or deallocates a previously initialized block of the shared memory. - /// For a memory buffer allocated using AllocateSharedMemory, the implementation must free the - /// underlying memory and the client application must not access this region after this function has been - /// called. In this case, the implementation must set the buffer and size fields of the shared memory - /// structure to null and 0 respectively before returning. - /// For memory registered using RegisterSharedMemory, the implementation must deregister the - /// underlying memory from the TEE, but the memory region will stay available to the client application for - /// other purposes as the memory is owned by it. - /// The implementation must do nothing if the value of the shared memory parameter is null. - /// - //void TEEC_ReleaseSharedMemory(TEEC_SharedMemory *sharedMem); - [DllImport(Libraries.Libteec, EntryPoint = "TEEC_ReleaseSharedMemory", CallingConvention = CallingConvention.Cdecl)] - static public extern void ReleaseSharedMemory(ref TEEC_SharedMemory sharedMem); - - /// - /// This function opens a new session between the client application and the specified trusted application. - /// The implementation must assume that all fields of this session structure are in an undefined state. - /// When this function returns TEEC_SUCCESS, the implementation must have populated this structure with - /// any information necessary for subsequent operations within the session. - /// The target trusted application is identified by the UUID passed in the parameter destination. - /// - //TEEC_Result TEEC_OpenSession(TEEC_Context *context, TEEC_Session *session, const TEEC_UUID *destination, uint connectionMethod, const void *connectionData, TEEC_Operation *operation, uint *returnOrigin); - [DllImport(Libraries.Libteec, EntryPoint = "TEEC_OpenSession", CallingConvention = CallingConvention.Cdecl)] - static public extern int OpenSession(ref TEEC_Context context, ref TEEC_Session session, TEEC_UUID destination, uint connectionMethod, byte[] connectionData, ref TEEC_Operation operation, out uint returnOrigin); - - /// - /// This function closes a session which has been opened with a trusted application. - /// All commands within the session must have completed before this function can be called. - /// The implementation must do nothing if the input session parameter is null. - /// The implementation of this function must not fail; after this function returns, the Client - /// Application must be able to consider that the session has been closed. - /// - //void TEEC_CloseSession(TEEC_Session *session); - [DllImport(Libraries.Libteec, EntryPoint = "TEEC_CloseSession", CallingConvention = CallingConvention.Cdecl)] - static public extern void CloseSession(ref TEEC_Session session); - - /// - /// This function invokes a command within the specified session. - /// The parameter session must point to a valid open session. - /// The parameter commandID is an identifier that is used to indicate which of the exposed Trusted - /// Application functions should be invoked. The supported command identifier values are defined by the - /// trusted application's protocol. - /// - //TEEC_Result TEEC_InvokeCommand(TEEC_Session *session, uint commandID, TEEC_Operation *operation, uint *returnOrigin); - [DllImport(Libraries.Libteec, EntryPoint = "TEEC_InvokeCommand", CallingConvention = CallingConvention.Cdecl)] - static public extern int InvokeCommand(ref TEEC_Session session, uint commandID, ref TEEC_Operation operation, out uint returnOrigin); - - /// - /// This function requests the cancelation of a pending open session operation or a command invocation - /// operation. As this is a synchronous API, this function must be called from a thread other than the one - /// executing the OpenSession or InvokeCommand function. - /// This function just sends a cancelation signal to the TEE and returns immediately; the operation is not - /// guaranteed to have been canceled when this function returns. In addition, the cancelation request is just - /// a hint; the TEE or the trusted application may ignore the cancelation request. - /// - //void TEEC_RequestCancellation(TEEC_Operation *operation); - [DllImport(Libraries.Libteec, EntryPoint = "TEEC_RequestCancellation", CallingConvention = CallingConvention.Cdecl)] - static public extern void RequestCancellation(ref TEEC_Operation operation); - } -} diff --git a/src/Tizen.Security.TEEC/Interop/Interop.Types.cs b/src/Tizen.Security.TEEC/Interop/Interop.Types.cs deleted file mode 100644 index 75955d1b0..000000000 --- a/src/Tizen.Security.TEEC/Interop/Interop.Types.cs +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright (c) 2017 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 -{ - [StructLayout(LayoutKind.Sequential)] - internal struct TEEC_Context - { - public readonly IntPtr imp; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct TEEC_Session - { - public readonly IntPtr imp; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct TEEC_UUID - { - public UInt32 timeLow; - public UInt16 timeMid; - public UInt16 timeHiAndVersion; - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)] - public byte[] clockSeqAndNode; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct sTEEC_SharedMemoryImp - { - public IntPtr context; - public IntPtr context_imp; - public UInt32 flags; - public UInt32 memid; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct TEEC_SharedMemory - { - public IntPtr buffer; - public UInt32 size; - public UInt32 flags; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct TEEC_Parameter - { - public UInt32 a; - public UInt32 b; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct TEEC_Operation - { - public UInt32 started; - public UInt32 paramTypes; - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)] - public TEEC_Parameter[] paramlist; - public IntPtr imp; - } -} - diff --git a/src/Tizen.Security.TEEC/Tizen.Security.TEEC.csproj b/src/Tizen.Security.TEEC/Tizen.Security.TEEC.csproj deleted file mode 100644 index 4c51c4197..000000000 --- a/src/Tizen.Security.TEEC/Tizen.Security.TEEC.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - netstandard2.0 - - - - - - - - \ No newline at end of file diff --git a/src/Tizen.Security.TEEC/Tizen.Security.TEEC.sln b/src/Tizen.Security.TEEC/Tizen.Security.TEEC.sln deleted file mode 100755 index 3d3a8794b..000000000 --- a/src/Tizen.Security.TEEC/Tizen.Security.TEEC.sln +++ /dev/null @@ -1,34 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26430.12 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Security.TEEC", "Tizen.Security.TEEC.csproj", "{97FA66C9-A286-42FF-ADDC-80DC8CC9E446}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen", "..\Tizen\Tizen.csproj", "{6E871A27-B671-400B-A05D-58A6B3CBDAED}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Log", "..\Tizen.Log\Tizen.Log.csproj", "{E8348A68-09CD-427F-A0E3-0A36E37B949D}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {97FA66C9-A286-42FF-ADDC-80DC8CC9E446}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {97FA66C9-A286-42FF-ADDC-80DC8CC9E446}.Debug|Any CPU.Build.0 = Debug|Any CPU - {97FA66C9-A286-42FF-ADDC-80DC8CC9E446}.Release|Any CPU.ActiveCfg = Release|Any CPU - {97FA66C9-A286-42FF-ADDC-80DC8CC9E446}.Release|Any CPU.Build.0 = Release|Any CPU - {6E871A27-B671-400B-A05D-58A6B3CBDAED}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6E871A27-B671-400B-A05D-58A6B3CBDAED}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6E871A27-B671-400B-A05D-58A6B3CBDAED}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6E871A27-B671-400B-A05D-58A6B3CBDAED}.Release|Any CPU.Build.0 = Release|Any CPU - {E8348A68-09CD-427F-A0E3-0A36E37B949D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E8348A68-09CD-427F-A0E3-0A36E37B949D}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E8348A68-09CD-427F-A0E3-0A36E37B949D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E8348A68-09CD-427F-A0E3-0A36E37B949D}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/src/Tizen.Security.TEEC/Tizen.Security.TEEC/Libteec.cs b/src/Tizen.Security.TEEC/Tizen.Security.TEEC/Libteec.cs deleted file mode 100644 index f05cb7477..000000000 --- a/src/Tizen.Security.TEEC/Tizen.Security.TEEC/Libteec.cs +++ /dev/null @@ -1,608 +0,0 @@ -/* - * 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.Collections.Generic; -using System.Threading; -using System.Threading.Tasks; - -namespace Tizen.Security.TEEC -{ - /// - /// This type denotes the Session Login Method used in OpenSession. - /// - /// 3 - public class LoginMethod - { - /// No login data is provided. - public const uint Public = 0x00000000; - /// Login data about the user running the client application process is provided. - public const uint User = 0x00000001; - /// Login data about the group running the client application process is provided. - public const uint Group = 0x00000002; - /// Login data about the running client application itself is provided. - public const uint Application = 0x00000003; - } - - /// - /// This type denotes the Value parameter. - /// - /// 3 - public enum TEFValueType : UInt32 - { - /// The parameter is a ValueType tagged as the input. - Input = 0x00000001, - /// The parameter is a ValueType tagged as the output. - Output = 0x00000002, - /// The parameter is a ValueType tagged as both the input and the output. - InOut = 0x00000003, - } - - /// - /// This type denotes the TempMemoryReference parameter - /// describing a region of memory which needs to be temporarily registered for the duration of the operation. - /// - /// 3 - public enum TEFTempMemoryType : UInt32 - { - /// The parameter is a TempMemoryType and is tagged as the input. - Input = 0x00000005, - /// Same as the input, but the Memory Reference is tagged as the output. - Output = 0x00000006, - /// A Temporary Memory Reference tagged as both the input and the output. - InOut = 0x00000007, - } - - /// - /// This type denotes the SharedMemoryReference parameter. - /// - /// 3 - public enum TEFRegisteredMemoryType : UInt32 - { - /// The parameter is a registered memory reference that refers to the entirety of its parent shared memory block. - Whole = 0x0000000C, - /// A registered memory reference structure that refers to a partial region of its parent shared mMemory block and is tagged as the input. - PartialInput = 0x0000000D, - /// A registered memory reference structure that refers to a partial region of its parent shared memory block and is tagged as the output. - PartialOutput = 0x0000000E, - /// A registered memory reference structure that refers to a partial region of its parent shared memory block and is tagged as both the input and the output. - PartialInOut = 0x0000000F, - } - - /// - /// This type denotes the SharedMemory access direction. - /// - /// 3 - [Flags] - public enum SharedMemoryFlags : UInt32 - { - /// A flag indicates the shared memory can be read. - Input = 0x00000001, - /// A flag indicates the shared memory can be written. - Output = 0x00000002, - /// A flag indicates the shared memory can be read and written. - InOut = Input | Output, - } - - /// - /// This type denotes a shared memory block which has been either registered - /// with the implementation or allocated by it. - /// - /// 3 - public sealed class SharedMemory - { - internal Interop.TEEC_SharedMemory shm; - internal SharedMemory(Interop.TEEC_SharedMemory shm) - { - this.shm=shm; - } - /// - /// This property represents the shared memory size in bytes. - /// - /// 3 - public UInt32 Size - { - get { return shm.size; } - } - /// - /// This property represents the start address of the shared memory block. - /// - /// 3 - public IntPtr Address - { - get { return shm.buffer; } - } - - /// - /// This function makes a copy and is designed for convenient operations on small buffers. - /// For large buffers, the direct address should be used. - /// - /// 3 - /// The source data buffer to copy data from. - /// The starting offset in the destination shared memory. - /// The operation is invalid. - public void SetData(byte[] data, int dstOffs) - { - if ((shm.flags & (uint)SharedMemoryFlags.Output) == 0) throw new InvalidOperationException("No write access"); - //TODO copy data into shared memory starting at given offset - } - /// - /// This function makes a copy and is designed for convenient operations on small buffers. - /// For large buffers, the direct address should be used. - /// - /// 3 - /// The destination data buffer to copy data into. - /// The starting offset in the source shared memory. - /// The operation is invalid. - public void GetData(byte[] data, int srcOffs) - { - if ((shm.flags & (uint)SharedMemoryFlags.Input) == 0) throw new InvalidOperationException("No read access"); - //TODO copy data from shared memory starting at given offset - } - }; - - /// - /// This type defines the payload of either an open session operation or an invoke command operation. It is - /// also used for cancelation of operations, which may be desirable even if no payload is passed. - /// Parameters are used to exchange data between CA and TA. - /// - /// 3 - public abstract class Parameter - { - internal Parameter(uint t) - { - this.NativeType = t; - } - internal uint NativeType { get; } - }; - - /// - /// This type defines a template for the parameter types. - /// - /// 3 - public abstract class BaseParameter : Parameter where TEnum : struct, IComparable, IFormattable, IConvertible // as close to Enum as possible - { - internal BaseParameter(TEnum t) : base((uint)(object)t) - { - Type = t; - } - - /// - /// This property represents the access type to this parameter. - /// - /// 3 - public TEnum Type { get; } - } - - /// - /// This type defines a temporary memory reference. - /// - /// 3 - public sealed class TempMemoryReference : BaseParameter - { - /// - /// Constructs a parameter object which holds information about the temporary memory copied to or from TA. - /// - /// 3 - /// The address of the allocated memory buffer. - /// The size of the buffer. - /// The kind of access allowed for TA . - public TempMemoryReference(IntPtr buffer, uint size, TEFTempMemoryType type) : - base(type) - { - this.Buffer = buffer; - this.Size = size; - } - /// - /// This property represents the memory address of the buffer. - /// - /// 3 - public IntPtr Buffer { get; } - /// - /// This property represents the size of the buffer. - /// - /// 3 - public uint Size { get; } - }; - - /// - /// This type defines a memory reference that uses a pre-registered or pre-allocated shared memory block. - /// - /// 3 - public sealed class RegisteredMemoryReference : BaseParameter - { - /// - /// Constructs a parameter object which holds information about the registered memory shared with TA. - /// - /// 3 - /// The shared memory - registered or allocated. - /// The size of the buffer part. - /// The offset of the buffer in the shared memory. - /// The kind of access allowed for TA . - public RegisteredMemoryReference(SharedMemory parent, uint size, uint offset, TEFRegisteredMemoryType type) : - base(type) - { - this.Parent = parent; - this.Size = size; - this.Offset = offset; - } - /// - /// This property represents the shared memory that is referred to. - /// - /// 3 - public SharedMemory Parent { get; } - /// - /// This property represents the size (in bytes) of the shared memory. - /// - /// 3 - public uint Size { get; } - /// - /// This property represents the offset (in bytes) from the start of the shared memory. - /// - /// 3 - public uint Offset { get; } - }; - - /// - /// This type defines a parameter that is not referencing the shared memory, but carries instead small raw data - /// passed by a value. - /// - /// 3 - public sealed class Value : BaseParameter - { - /// - /// Constructs a parameter object which holds information about integer values copied to or from TA. - /// - /// 3 - /// User paramter A. - /// User paramter B. - /// The kind of access allowed for TA . - public Value(uint a, uint b, TEFValueType type) : - base(type) - { - this.A = a; - this.B = b; - } - /// - /// This property represents an unsigned integer A. - /// - /// 3 - public uint A { get; } - /// - /// This property represents an unsigned integer B. - /// - /// 3 - public uint B { get; } - }; - - - /// - /// This type denotes a TEE Session, the logical container linking a client application with a particular trusted application. - /// - /// 3 - public sealed class Session - { - private Interop.TEEC_Context context; - private Interop.TEEC_Session session; - - internal Session(Interop.TEEC_Context context) { - this.context = context; - this.session = new Interop.TEEC_Session(); - } - - ~Session() - { - Close(); - } - - internal void Open(Guid destination, uint loginMethod, byte[] connectionData, Parameter[] paramlist) - { - Interop.TEEC_UUID uuid = new Interop.TEEC_UUID(); - Interop.TEEC_Operation op = new Interop.TEEC_Operation(); - uint ro; - - int ret = Interop.Libteec.OpenSession(ref context, ref session, uuid, loginMethod, connectionData, ref op, out ro); - //MAYBE map origin of return code to specyfic Exception - Interop.CheckNThrowException(ret, string.Format("OpenSession('{0}')", destination)); - } - - /// - /// This function closes a session which has been opened with a trusted application. - /// All commands within the session must be completed before this function can be called. - /// - /// 3 - /// http://tizen.org/privilege/tee.client - /// partner - /// http://tizen.org/feature/security.tee - /// Thrown when an application does not have the privilege to access this method. - /// The required feature is not supported. - /// The operation is invalid. - public void Close() { - Interop.Libteec.CloseSession(ref session); - //session = null; - } - - /// - /// This function invokes a command within the specified session. - /// The parameter commandID is an identifier that is used to indicate which of the exposed trusted - /// application functions should be invoked. The supported command identifier values are defined by the - /// trusted application's protocol. - /// There can be up to four parameter objects given in the array. - /// - /// 3 - /// The command. - /// The array of parameters. - /// http://tizen.org/privilege/tee.client - /// partner - /// http://tizen.org/feature/security.tee - /// Thrown when an application does not have the privilege to access this method. - /// The required feature is not supported. - /// The operation is invalid. - /// The argument is wrong. - public void InvokeCommand(uint commandID, Parameter[] paramlist) - { - Interop.TEEC_Operation op = new Interop.TEEC_Operation(); - op.started=0; - op.paramTypes=0; - - for (int i=0; i < 4; ++i) { - Parameter p = paramlist[i]; - //TODO fill TEEC_Operation struct - } - - uint ro; - int ret = Interop.Libteec.InvokeCommand(ref session, commandID, ref op, out ro); - //MAYBE map origin of return code to specific Exception - Interop.CheckNThrowException(ret, string.Format("InvokeCommand({0})", commandID)); - } - - /// - /// The asynchronous version of the InvokeCommand. - /// - /// 3 - /// The command. - /// The array of parameters. - /// The token for task manipulation. - /// Returns a task executing an invoke command in the background. - /// http://tizen.org/privilege/tee.client - /// partner - /// http://tizen.org/feature/security.tee - /// Thrown when an application does not have the privilege to access this method. - /// The required feature is not supported. - /// The operation is invalid. - /// One of the arguments is wrong. - public async Task InvokeCommandAsync(uint commandID, Parameter[] paramlist, CancellationToken token = default(CancellationToken)) - { - await Task.Factory.StartNew(() => InvokeCommand(commandID, paramlist)); - } - - }; - - /// - /// This type denotes a TEE Context, the main logical container linking a Client Application with a particular TEE. - /// - /// 3 - public sealed class Context : IDisposable - { - private Interop.TEEC_Context context; - - /// - /// This function (constructor) initializes a new TEE Context, forming a connection between this client application and the - /// TEE identified by the string identifier name (empty or null name denotes a default TEE). - /// - /// 3 - /// The TEE name. - /// http://tizen.org/privilege/tee.client - /// partner - /// http://tizen.org/feature/security.tee - /// Thrown when an application does not have the privilege to access this method. - /// The required feature is not supported. - /// The operation is invalid. - public Context(string name) - { - context = new Interop.TEEC_Context(); - int ret = Interop.Libteec.InitializeContext(name, ref context); - Interop.CheckNThrowException(ret, string.Format("InititalizeContext('{0}')", name)); - } - - ~Context() - { - Dispose(); - } - - /// - /// This function implements the IDisposable interface. - /// - /// 3 - /// http://tizen.org/privilege/tee.client - /// partner - /// http://tizen.org/feature/security.tee - public void Dispose() { - Interop.Libteec.FinalizeContext(ref context); - //context.imp = null; - } - - /// - /// This function opens a new session between the client application and the specified trusted application. - /// The target trusted application is identified by an UUID passed in the parameter destination. - /// There can be up to four parameter objects given in the array. - /// - /// 3 - /// The UUID of the destination TA. - /// The authentication algorithm . - /// The data to be verified by a given login method. - /// The parameters to be passed to TA open-session-callback. - /// Returns opened session. - /// http://tizen.org/privilege/tee.client - /// partner - /// http://tizen.org/feature/security.tee - /// Thrown when an application does not have the privilege to access this method. - /// The required feature is not supported. - /// The operation is invalid. - /// One of the arguments is wrong. - public Session OpenSession(Guid destination, uint loginMethod, byte[] connectionData, Parameter[] paramlist) - { - Session ses = new Session(context); - ses.Open(destination, loginMethod, connectionData, paramlist); - return ses; - } - /// - /// @see OpenSession (Guid destination, uint connectionMethod, byte[] connectionData, Parameter[] paramlist, CancellationToken token). - /// - /// 3 - /// The UUID of the destination TA. - /// Returns opened session. - /// http://tizen.org/privilege/tee.client - /// partner - /// http://tizen.org/feature/security.tee - /// Thrown when an application does not have the privilege to access this method. - /// The required feature is not supported. - /// The operation is invalid. - public Session OpenSession(Guid destination) - { - Session ses = new Session(context); - ses.Open(destination, LoginMethod.Public, null, null); - return ses; - } - - /// - /// The asynchronous version of the OpenSession. - /// @see OpenSession (Guid destination, uint connectionMethod, byte[] connectionData, Parameter[] paramlist, CancellationToken token). - /// - /// 3 - /// The UUID of the destination TA. - /// The authentication algorithm . - /// The data to be verified by a given login method. - /// The parameters to be passed to the TA open-session-callback. - /// The token for the task manipulation. - /// Returns a Task executing the session open in the background. - /// http://tizen.org/privilege/tee.client - /// partner - /// http://tizen.org/feature/security.tee - /// Thrown when an application does not have the privilege to access this method. - /// The required feature is not supported. - /// The operation is invalid. - /// One of the arguments is wrong. - public async Task OpenSessionAsync(Guid destination, uint loginMethod, byte[] connectionData, Parameter[] paramlist, CancellationToken token = default(CancellationToken)) - { - Task task = Task.Factory.StartNew(() => - { - return OpenSession(destination, loginMethod, connectionData, paramlist); - }); - return await task; - } - /// - /// The asynchronous version of the OpenSession. - /// @see OpenSession (Guid destination, uint connectionMethod, byte[] connectionData, Parameter[] paramlist, CancellationToken token). - /// - /// 3 - /// The UUID of the destination TA. - /// The token for a task manipulation. - /// Returns a task executing session open in the background. - /// http://tizen.org/privilege/tee.client - /// partner - /// http://tizen.org/feature/security.tee - /// Thrown when an application does not have the privilege to access this method. - /// The required feature is not supported. - /// The operation is invalid. - public async Task OpenSessionAsync(Guid destination, CancellationToken token = default(CancellationToken)) - { - Task task = Task.Factory.StartNew(() => - { - return OpenSession(destination); - }); - return await task; - } - - /// - /// This function registers a block of the existing client application memory as a block of shared memory within - /// the scope of the specified context, in accordance with the parameters. - /// The input must point to the shared memory region to register. - /// - /// 3 - /// The address of the shared memory. - /// The size of the shared memory. - /// The flags describing the access modes (Input and/or Output). - /// Returns the SharedMemory handler. - /// http://tizen.org/privilege/tee.client - /// partner - /// http://tizen.org/feature/security.tee - /// Thrown when an application does not have the privilege to access this method. - /// The required feature is not supported. - /// The operation is invalid. - /// The argument is wrong. - public SharedMemory RegisterSharedMemory(IntPtr memaddr, UInt32 size, SharedMemoryFlags flags) - { - Interop.TEEC_SharedMemory shm = new Interop.TEEC_SharedMemory(); - shm.buffer = memaddr; - shm.size = size; - shm.flags = (UInt32)flags; - int ret = Interop.Libteec.RegisterSharedMemory(ref context, ref shm); - Interop.CheckNThrowException(ret, "RegisterSharedMemory"); - return new SharedMemory(shm); - } - - /// - /// This function allocates a new block of memory as a block of shared memory within the scope of the - /// specified context, in accordance with the parameters. - /// - /// 3 - /// The size of shared memory. - /// The flags describing access modes (Input and/or Output). - /// Returns the Shared Memory handler. - /// http://tizen.org/privilege/tee.client - /// partner - /// http://tizen.org/feature/security.tee - /// Thrown when an application does not have the privilege to access this method. - /// The required feature is not supported. - /// The operation is invalid. - public SharedMemory AllocateSharedMemory(UInt32 size, SharedMemoryFlags flags) - { - Interop.TEEC_SharedMemory shm = new Interop.TEEC_SharedMemory(); - shm.size = size; - shm.flags = (UInt32)flags; - int ret = Interop.Libteec.AllocateSharedMemory(ref context, ref shm); - Interop.CheckNThrowException(ret, "AllocateSharedMemory"); - return new SharedMemory(shm); - } - - /// - /// This function deregisters or deallocates a previously initialized block of the shared memory. - /// - /// - /// For a memory buffer allocated using AllocateSharedMemory, the implementation must free the - /// underlying memory and the client application must not access this region after this function has been - /// called. In this case, the implementation must clear the buffer and size fields of the shared memory - /// structure before returning. - /// For memory registered using RegisterSharedMemory, the implementation must deregister the - /// underlying memory from the TEE, but the memory region will stay available to the client application for - /// other purposes as the memory is owned by it. - /// - /// 3 - /// The shared memory object returned by RegisterSharedMemory or AllocateSharedMemory. - /// http://tizen.org/privilege/tee.client - /// partner - /// http://tizen.org/feature/security.tee - /// Thrown when an application does not have the privilege to access this method. - /// The required feature is not supported. - /// The operation is invalid. - /// The argument is wrong. - public void ReleaseSharedMemory(SharedMemory shm) - { - Interop.Libteec.ReleaseSharedMemory(ref shm.shm); - } - }; -} diff --git a/src/Tizen.Security.TEEC/Tizen.Security.TEEC/NamespaceDoc.cs b/src/Tizen.Security.TEEC/Tizen.Security.TEEC/NamespaceDoc.cs deleted file mode 100644 index 4edd14471..000000000 --- a/src/Tizen.Security.TEEC/Tizen.Security.TEEC/NamespaceDoc.cs +++ /dev/null @@ -1,78 +0,0 @@ -/** - -The communication API for connecting Client Applications running in a rich operating environment -with security related Trusted Applications running inside a Trusted Execution Environment (TEE). - - - -

Overview

- -A TEE provides an execution environment with security capabilities, which are either available to Trusted Applications -running inside the TEE or exposed externally to Client Applications. -The TEE Client API concentrates on the interface to enable efficient communications between -a Client Application and a Trusted Application running inside the TEE. -Higher level standards and protocol layers may be built on top of the foundation -provided by the TEE Client API – for example, to cover common tasks, such as secure storage, -cryptography, and run-time installation of new Trusted Applications. -The separation between the rich environment and the TEE is guaranted. - - -The key design principles of the TEE Client API are: - - - Client-side memory allocations - - Where possible the design of the TEE Client API has placed the responsibility for memory - allocation on the calling Client Application code. This gives the Client developer choice of - memory allocation locations, enabling simple optimizations, such as stack-based allocation - or enhanced flexibility using placements in static global memory or thread-local storage.
- This design choice is evident in the API by the use of pointers to structures rather than - opaque handles to represent any manipulated objects. -
-
- - Aim for zero-copy data transfer - - The features of the TEE Client API are chosen to maximize the possibility of zero-copy - data transfer between the Client Application and the Trusted Application.
- However, short messages can also be passed by copy, which avoids the overhead of - sharing memory. -
-
- - Support memory sharing by pointers - - The TEE Client API will be used to implement higher-level APIs, such as cryptography or - secure storage, where the caller will often provide memory buffers for input or output data - using simple C pointers. The TEE Client API must allow efficient sharing of this type of - memory, and as such does not rely on the Client Application being able to use bulk - memory buffers allocated by the TEE Client API. - - - - Specify only communication mechanisms - - This API focuses on defining the underlying communications channel. It does not define - the format of the messages which pass over the channel, or the protocols used by specific - Trusted Applications. - - - -
-
-
- - -The following example demonstrates how to invoke command on Trused Application. - - Guid ta_uuid = new Guid("TA-guid-put-here"); - Context ctx = new Context(null); - Session ses = ctx.OpenSession(ta_uuid); - Parameter[] p = { new Value(1,2,TEFValueType.In) }; - ses.InvokeCommand(1, p); - ses.Close(); - ctx.Dispose(); - - -*/ -namespace Tizen.Security.TEEC {} diff --git a/src/Tizen.Security/Interop/Interop.Libraries.cs b/src/Tizen.Security/Interop/Interop.Libraries.cs deleted file mode 100644 index 7188262e3..000000000 --- a/src/Tizen.Security/Interop/Interop.Libraries.cs +++ /dev/null @@ -1,23 +0,0 @@ -/* - * 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 Privilege = "libprivilege-info.so.1"; - } -} diff --git a/src/Tizen.Security/Interop/Interop.Privilege.cs b/src/Tizen.Security/Interop/Interop.Privilege.cs deleted file mode 100755 index 8b921e8bb..000000000 --- a/src/Tizen.Security/Interop/Interop.Privilege.cs +++ /dev/null @@ -1,46 +0,0 @@ -/* - * 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; - -using Tizen.Security; - -internal static partial class Interop -{ - internal static partial class Privilege - { - internal static string LogTag = "Tizen.Security.Privilege"; - - [DllImport(Libraries.Privilege, EntryPoint = "privilege_info_get_display_name")] - internal static extern int GetDisplayName(string apiVersion, string privilege, out string displayName); - - [DllImport(Libraries.Privilege, EntryPoint = "privilege_info_get_description")] - internal static extern int GetDescription(string apiVersion, string privilege, out string description); - - [DllImport(Libraries.Privilege, EntryPoint = "privilege_info_get_display_name_by_pkgtype")] - internal static extern int GetDisplayNameByPkgtype(string packageType, string apiVersion, string privilege, out string displayName); - - [DllImport(Libraries.Privilege, EntryPoint = "privilege_info_get_description_by_pkgtype")] - internal static extern int GetDescriptionByPkgtype(string packageType, string apiVersion, string privilege, out string description); - - [DllImport(Libraries.Privilege, EntryPoint = "privilege_info_get_privacy_display_name")] - internal static extern int GetPrivacyDisplayName(string privilege, out string displayName); - - [DllImport(Libraries.Privilege, EntryPoint = "privilege_info_get_privacy_privilege_status")] - internal static extern int GetPrivacyPrivilegeStatus(string privilege, out bool status); - } -} diff --git a/src/Tizen.Security/Tizen.Security.csproj b/src/Tizen.Security/Tizen.Security.csproj deleted file mode 100644 index eec4f4a34..000000000 --- a/src/Tizen.Security/Tizen.Security.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - netstandard2.0 - - - - - - - - \ No newline at end of file diff --git a/src/Tizen.Security/Tizen.Security.sln b/src/Tizen.Security/Tizen.Security.sln deleted file mode 100755 index 3c2346aff..000000000 --- a/src/Tizen.Security/Tizen.Security.sln +++ /dev/null @@ -1,46 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26430.12 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Security", "Tizen.Security.csproj", "{6A821E85-59E5-42E6-9AC9-B4764B24119E}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen", "..\Tizen\Tizen.csproj", "{E62A797A-D04B-49ED-AEA0-A7AC99583944}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Log", "..\Tizen.Log\Tizen.Log.csproj", "{65691173-8279-4E5A-98FE-566A69865837}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Applications.Common", "..\Tizen.Applications.Common\Tizen.Applications.Common.csproj", "{55E14C3C-6D5F-42A0-A79C-C17A10090189}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Applications.PackageManager", "..\Tizen.Applications.PackageManager\Tizen.Applications.PackageManager.csproj", "{F6B24357-F790-463D-BB16-CDF228742C20}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {6A821E85-59E5-42E6-9AC9-B4764B24119E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6A821E85-59E5-42E6-9AC9-B4764B24119E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6A821E85-59E5-42E6-9AC9-B4764B24119E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6A821E85-59E5-42E6-9AC9-B4764B24119E}.Release|Any CPU.Build.0 = Release|Any CPU - {E62A797A-D04B-49ED-AEA0-A7AC99583944}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E62A797A-D04B-49ED-AEA0-A7AC99583944}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E62A797A-D04B-49ED-AEA0-A7AC99583944}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E62A797A-D04B-49ED-AEA0-A7AC99583944}.Release|Any CPU.Build.0 = Release|Any CPU - {65691173-8279-4E5A-98FE-566A69865837}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {65691173-8279-4E5A-98FE-566A69865837}.Debug|Any CPU.Build.0 = Debug|Any CPU - {65691173-8279-4E5A-98FE-566A69865837}.Release|Any CPU.ActiveCfg = Release|Any CPU - {65691173-8279-4E5A-98FE-566A69865837}.Release|Any CPU.Build.0 = Release|Any CPU - {55E14C3C-6D5F-42A0-A79C-C17A10090189}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {55E14C3C-6D5F-42A0-A79C-C17A10090189}.Debug|Any CPU.Build.0 = Debug|Any CPU - {55E14C3C-6D5F-42A0-A79C-C17A10090189}.Release|Any CPU.ActiveCfg = Release|Any CPU - {55E14C3C-6D5F-42A0-A79C-C17A10090189}.Release|Any CPU.Build.0 = Release|Any CPU - {F6B24357-F790-463D-BB16-CDF228742C20}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F6B24357-F790-463D-BB16-CDF228742C20}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F6B24357-F790-463D-BB16-CDF228742C20}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F6B24357-F790-463D-BB16-CDF228742C20}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/src/Tizen.Security/Tizen.Security/Privilege.cs b/src/Tizen.Security/Tizen.Security/Privilege.cs deleted file mode 100755 index 6e2d606d1..000000000 --- a/src/Tizen.Security/Tizen.Security/Privilege.cs +++ /dev/null @@ -1,212 +0,0 @@ -/* - * 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; -using Tizen.Internals.Errors; -using Tizen.Applications; - -namespace Tizen.Security -{ - /// - /// This class provides the information of the given privilege and the API version. - /// - /// 3 - public static class Privilege - { - internal static readonly string PackageTypeTpk = "PRVINFO_PACKAGE_TYPE_NATIVE"; - internal static readonly string PackageTypeWgt = "PRVINFO_PACKAGE_TYPE_WEB"; - internal static string ToPackageTypeString(PackageType type) - { - if (type == PackageType.TPK) - { - return PackageTypeTpk; - } - else if (type == PackageType.WGT) - { - return PackageTypeWgt; - } - else - { - Tizen.Log.Error(Interop.Privilege.LogTag, "Invalid Parameter: PackageType doesn't include TPK or WGT"); - throw new ArgumentException(); - } - } - - /// - /// Gets the display name of the given privilege. - /// - /// 3 - /// If there's no matching privilege, then it returns last token of the given privilege. - /// The API version. - /// The privilege. - /// The display name of the given privilege at the given API version. - /// Thrown when there is a null parameter. - /// Thrown when there is an invalid parameter. - /// Thrown when out of memory occurs. - /// Thrown when an internal error occurs. - public static string GetDisplayName(string apiVersion, string privilege) - { - string displayName; - if (apiVersion == null || privilege == null) - PrivilegeErrorFactory.ThrowException(new ArgumentNullException(), "apiVersion and privilege should not be null."); - PrivilegeErrorFactory.CheckNThrowException( - Interop.Privilege.GetDisplayName(apiVersion, privilege, out displayName), - "Failed to Get Privilege's Display Name."); - return displayName; - } - - /// - /// Gets the display name of the given privilege. - /// - /// 3 - /// If there's no matching privilege, then it returns last token of the given privilege. - /// The API version. - /// The privilege. - /// The type of application package. - /// The display name of the given privilege at the given API version and the package type. - /// Thrown when there is a null parameter. - /// Thrown when there is an invalid parameter. - /// Thrown when out of memory occurs. - /// Thrown when an internal error occurs. - public static string GetDisplayName(string apiVersion, string privilege, PackageType packageType) - { - string displayName; - if (apiVersion == null || privilege == null) - PrivilegeErrorFactory.ThrowException(new ArgumentNullException(), "apiVersion and privilege should not be null."); - PrivilegeErrorFactory.CheckNThrowException( - Interop.Privilege.GetDisplayNameByPkgtype(ToPackageTypeString(packageType), apiVersion, privilege, out displayName), - "Failed to Get Privilege's Display Name."); - return displayName; - } - - /// - /// Gets the description of the given privilege. - /// - /// 3 - /// If there's no matching privilege, then it returns description string for undefined privilege. - /// The API version. - /// The privilege. - /// The description of given privilege at the given API version - /// Thrown when there is a null parameter. - /// Thrown when there is an invalid parameter. - /// Thrown when out of memory occurs. - /// Thrown when an internal error occurs. - public static string GetDescription(string apiVersion, string privilege) - { - string description; - if (apiVersion == null || privilege == null) - PrivilegeErrorFactory.ThrowException(new ArgumentNullException(), "apiVersion and privilege should not be null."); - PrivilegeErrorFactory.CheckNThrowException( - Interop.Privilege.GetDescription(apiVersion, privilege, out description), - "Failed to Get Privilege's Description."); - return description; - } - - /// - /// Gets the description of the given privilege. - /// - /// 3 - /// If there's no matching privilege, then it returns description string for undefined privilege. - /// The API version. - /// The privilege. - /// The type of application package. - /// The description of given privilege at the given API version and the package type. - /// Thrown when there is a null parameter. - /// Thrown when there is an invalid parameter. - /// Thrown when out of memory occurs. - /// Thrown when an internal error occurs. - public static string GetDescription(string apiVersion, string privilege, PackageType packageType) - { - string description; - if (apiVersion == null || privilege == null) - PrivilegeErrorFactory.ThrowException(new ArgumentNullException(), "apiVersion and privilege should not be null."); - PrivilegeErrorFactory.CheckNThrowException( - Interop.Privilege.GetDescriptionByPkgtype(ToPackageTypeString(packageType),apiVersion, privilege, out description), - "Failed to Get Privilege's Description."); - return description; - } - - /// - /// Gets the display name of the privacy group in which the given privilege is included. - /// - /// 3 - /// The privilege. - /// The privilege must be privacy related. - /// The privacy group's display name that the given privilege is included in. - /// Thrown when there is a null parameter. - /// Thrown when there is an invalid parameter. - /// Thrown when out of memory occurs. - /// Thrown when an internal error occurs. - public static string GetPrivacyDisplayName(string privilege) - { - string displayName; - if (privilege == null) - PrivilegeErrorFactory.ThrowException(new ArgumentNullException(), "privilege should not be null."); - PrivilegeErrorFactory.CheckNThrowException( - Interop.Privilege.GetPrivacyDisplayName(privilege, out displayName), - "Failed to Get Privacy's Display Name in Which the Given Privilege is included."); - return displayName; - } - - /// - /// Gets the status of the given privacy related privilege. - /// - /// 3 - /// The privilege. - /// The privilege must be privacy related. - /// Status true if the privilege is on and false if the privilege is off. - /// Thrown when there is a null parameter. - /// Thrown when there is an invalid parameter. - /// Thrown when out of memory occurs. - /// Thrown when an internal error occurs. - public static bool GetPrivacyPrivilegeStatus(string privilege) - { - bool status; - if (privilege == null) - PrivilegeErrorFactory.ThrowException(new ArgumentNullException(), "privilege should not be null."); - PrivilegeErrorFactory.CheckNThrowException( - Interop.Privilege.GetPrivacyPrivilegeStatus(privilege, out status), - "Failed to Get Privacy Privilege's Status."); - return status; - } - } - - internal static class PrivilegeErrorFactory - { - internal static void ThrowException(Exception e, string msg) - { - Tizen.Log.Error(Interop.Privilege.LogTag, "[" + e.ToString() + "] " + msg); - throw e; - } - internal static void CheckNThrowException(int err, string msg) - { - if (err == (int)ErrorCode.None) - return; - string errorMessage = string.Format("[{0}] {1}", ErrorFacts.GetErrorMessage(err), msg); - Tizen.Log.Error(Interop.Privilege.LogTag, errorMessage); - switch (err) - { - case (int)ErrorCode.InvalidParameter: - throw new ArgumentException(); - case (int)ErrorCode.OutOfMemory: - throw new OutOfMemoryException(); - default: - throw new InvalidOperationException(); - } - } - } -} diff --git a/src/Tizen.Sensor/Interop/Interop.Libraries.cs b/src/Tizen.Sensor/Interop/Interop.Libraries.cs deleted file mode 100644 index 4c856be4f..000000000 --- a/src/Tizen.Sensor/Interop/Interop.Libraries.cs +++ /dev/null @@ -1,24 +0,0 @@ -/* - * 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 Sensor = "libcapi-system-sensor.so.0"; - public const string Libc = "libc.so.6"; - } -} \ No newline at end of file diff --git a/src/Tizen.Sensor/Interop/Interop.Sensor.cs b/src/Tizen.Sensor/Interop/Interop.Sensor.cs deleted file mode 100644 index 160c03364..000000000 --- a/src/Tizen.Sensor/Interop/Interop.Sensor.cs +++ /dev/null @@ -1,136 +0,0 @@ -/* - * 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; -using Tizen.Sensor; - -internal static partial class Interop -{ - internal static class Sensor - { - //Sensor Hardware CAPI - [DllImport(Libraries.Sensor, EntryPoint = "sensor_get_name")] - internal static extern int GetName(IntPtr sensorhandle, out String name); - - [DllImport(Libraries.Sensor, EntryPoint = "sensor_get_vendor")] - internal static extern int GetVendor(IntPtr sensorHandle, out String vendor); - - [DllImport(Libraries.Sensor, EntryPoint = "sensor_get_type")] - internal static extern int GetType(IntPtr sensorHandle, out SensorType type); - - [DllImport(Libraries.Sensor, EntryPoint = "sensor_get_min_range")] - internal static extern int GetMinRange(IntPtr sensorHandle, out float minRange); - - [DllImport(Libraries.Sensor, EntryPoint = "sensor_get_max_range")] - internal static extern int GetMaxRange(IntPtr sensorHandle, out float maxRange); - - [DllImport(Libraries.Sensor, EntryPoint = "sensor_get_resolution")] - internal static extern int GetResolution(IntPtr sensorHandle, out float resolution); - - [DllImport(Libraries.Sensor, EntryPoint = "sensor_get_min_interval")] - internal static extern int GetMinInterval(IntPtr sensorHandle, out int minInterval); - - [DllImport(Libraries.Sensor, EntryPoint = "sensor_get_fifo_count")] - internal static extern int GetFifoCount(IntPtr sensorHandle, out int fifoCount); - - [DllImport(Libraries.Sensor, EntryPoint = "sensor_get_max_batch_count")] - internal static extern int GetMaxBatchCount(IntPtr sensorHandle, out int maxBatchCount); - } - internal static class SensorListener - { - //Sensor Listener CAPI - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void SensorEventCallback(IntPtr sensorHandle, IntPtr eventData, IntPtr data); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void SensorAccuracyCallback(IntPtr sensorHandle, ulong timestamp, SensorDataAccuracy accuracy, IntPtr data); - - [DllImport(Libraries.Sensor, EntryPoint = "sensor_create_listener")] - internal static extern int CreateListener(IntPtr sensorHandle, out IntPtr listenerHandle); - - [DllImport(Libraries.Sensor, EntryPoint = "sensor_destroy_listener")] - internal static extern int DestroyListener(IntPtr listenerHandle); - - [DllImport(Libraries.Sensor, EntryPoint = "sensor_listener_start")] - internal static extern int StartListener(IntPtr listenerHandle); - - [DllImport(Libraries.Sensor, EntryPoint = "sensor_listener_stop")] - internal static extern int StopListener(IntPtr listenerHandle); - - [DllImport(Libraries.Sensor, EntryPoint = "sensor_listener_set_event_cb")] - internal static extern int SetEventCallback(IntPtr listenerHandle, uint intervalMs, SensorEventCallback callback, IntPtr data); - - [DllImport(Libraries.Sensor, EntryPoint = "sensor_listener_unset_event_cb")] - internal static extern int UnsetEventCallback(IntPtr listernerHandle); - - [DllImport(Libraries.Sensor, EntryPoint = "sensor_listener_set_accuracy_cb")] - internal static extern int SetAccuracyCallback(IntPtr listenerHandle, SensorAccuracyCallback callback, IntPtr data); - - [DllImport(Libraries.Sensor, EntryPoint = "sensor_listener_unset_accuracy_cb")] - internal static extern int UnsetAccuracyCallback(IntPtr listernerHandle); - - [DllImport(Libraries.Sensor, EntryPoint = "sensor_listener_set_interval")] - internal static extern int SetInterval(IntPtr listenerHandle, uint intervalMs); - - [DllImport(Libraries.Sensor, EntryPoint = "sensor_listener_set_max_batch_latency")] - internal static extern int SetMaxBatchLatency(IntPtr listenerHandle, uint maxBatchLatency); - - [DllImport(Libraries.Sensor, EntryPoint = "sensor_listener_set_attribute_int")] - internal static extern int SetAttribute(IntPtr listenerHandle, SensorAttribute sensorAttribute, int option); - } - - internal static class SensorManager - { - //Sensor Manager CAPI - [DllImport(Libraries.Sensor, EntryPoint = "sensor_is_supported")] - internal static extern int SensorIsSupported(SensorType type, out bool supported); - - [DllImport(Libraries.Sensor, EntryPoint = "sensor_get_default_sensor")] - internal static extern int GetDefaultSensor(SensorType type, out IntPtr sensor); - - [DllImport(Libraries.Sensor, EntryPoint = "sensor_get_sensor_list")] - internal static extern int GetSensorList(SensorType type, out IntPtr list, out int sensor_count); - } - - internal static partial class Libc - { - [DllImport(Libraries.Libc, EntryPoint = "free", CallingConvention = CallingConvention.Cdecl)] - internal static extern int Free(IntPtr ptr); - } - - [StructLayout(LayoutKind.Sequential, Pack = 0)] - internal struct SensorEventStruct - { - internal SensorDataAccuracy accuracy; - internal UInt64 timestamp; - internal int value_count; - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 16)] - internal float[] values; - } - - internal static IntPtr[] IntPtrToIntPtrArray(IntPtr unmanagedArray, int size) - { - IntPtr[] managedArray = new IntPtr[size]; - Marshal.Copy(unmanagedArray, managedArray, 0, size); - return managedArray; - } - - internal static SensorEventStruct IntPtrToEventStruct(IntPtr unmanagedVariable) - { - SensorEventStruct outStruct = (SensorEventStruct)Marshal.PtrToStructure(unmanagedVariable); - return outStruct; - } -} diff --git a/src/Tizen.Sensor/Tizen.Sensor.csproj b/src/Tizen.Sensor/Tizen.Sensor.csproj deleted file mode 100644 index 348907fb1..000000000 --- a/src/Tizen.Sensor/Tizen.Sensor.csproj +++ /dev/null @@ -1,11 +0,0 @@ - - - - netstandard2.0 - - - - - - - \ No newline at end of file diff --git a/src/Tizen.Sensor/Tizen.Sensor.sln b/src/Tizen.Sensor/Tizen.Sensor.sln deleted file mode 100755 index e261c3e56..000000000 --- a/src/Tizen.Sensor/Tizen.Sensor.sln +++ /dev/null @@ -1,40 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26430.12 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Sensor", "Tizen.Sensor.csproj", "{91E5DA56-23A7-4828-B425-EB6C40E1A3C5}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.System.Information", "..\Tizen.System.Information\Tizen.System.Information.csproj", "{E4BF60C5-0708-492F-91D9-84F34F5E3355}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen", "..\Tizen\Tizen.csproj", "{F6DEA95B-9E6F-4EF1-BD11-40BCA7BEB5EB}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Log", "..\Tizen.Log\Tizen.Log.csproj", "{94DB8186-F970-4298-A321-6FFD12F47DBA}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {91E5DA56-23A7-4828-B425-EB6C40E1A3C5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {91E5DA56-23A7-4828-B425-EB6C40E1A3C5}.Debug|Any CPU.Build.0 = Debug|Any CPU - {91E5DA56-23A7-4828-B425-EB6C40E1A3C5}.Release|Any CPU.ActiveCfg = Release|Any CPU - {91E5DA56-23A7-4828-B425-EB6C40E1A3C5}.Release|Any CPU.Build.0 = Release|Any CPU - {E4BF60C5-0708-492F-91D9-84F34F5E3355}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E4BF60C5-0708-492F-91D9-84F34F5E3355}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E4BF60C5-0708-492F-91D9-84F34F5E3355}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E4BF60C5-0708-492F-91D9-84F34F5E3355}.Release|Any CPU.Build.0 = Release|Any CPU - {F6DEA95B-9E6F-4EF1-BD11-40BCA7BEB5EB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F6DEA95B-9E6F-4EF1-BD11-40BCA7BEB5EB}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F6DEA95B-9E6F-4EF1-BD11-40BCA7BEB5EB}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F6DEA95B-9E6F-4EF1-BD11-40BCA7BEB5EB}.Release|Any CPU.Build.0 = Release|Any CPU - {94DB8186-F970-4298-A321-6FFD12F47DBA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {94DB8186-F970-4298-A321-6FFD12F47DBA}.Debug|Any CPU.Build.0 = Debug|Any CPU - {94DB8186-F970-4298-A321-6FFD12F47DBA}.Release|Any CPU.ActiveCfg = Release|Any CPU - {94DB8186-F970-4298-A321-6FFD12F47DBA}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/src/Tizen.Sensor/Tizen.Sensor/EventArgs/AccelerometerDataUpdatedEventArgs.cs b/src/Tizen.Sensor/Tizen.Sensor/EventArgs/AccelerometerDataUpdatedEventArgs.cs deleted file mode 100755 index 3f99237d4..000000000 --- a/src/Tizen.Sensor/Tizen.Sensor/EventArgs/AccelerometerDataUpdatedEventArgs.cs +++ /dev/null @@ -1,54 +0,0 @@ -/* - * 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.Sensor -{ - /// - /// The Accelerometer changed event arguments class is used for storing the data returned by a accelerometer. - /// - public class AccelerometerDataUpdatedEventArgs : EventArgs - { - internal AccelerometerDataUpdatedEventArgs(float[] values) - { - X = values[0]; - Y = values[1]; - Z = values[2]; - } - - /// - /// Gets the X component of the acceleration. - /// - /// 3 - /// X - public float X { get; private set; } - - /// - /// Gets the Y component of the acceleration. - /// - /// 3 - /// Y - public float Y { get; private set; } - - /// - /// Gets the Z component of the acceleration. - /// - /// 3 - /// Z - public float Z { get; private set; } - } -} \ No newline at end of file diff --git a/src/Tizen.Sensor/Tizen.Sensor/EventArgs/FaceDownGestureDetectorDataUpdatedEventArgs.cs b/src/Tizen.Sensor/Tizen.Sensor/EventArgs/FaceDownGestureDetectorDataUpdatedEventArgs.cs deleted file mode 100755 index fc232884a..000000000 --- a/src/Tizen.Sensor/Tizen.Sensor/EventArgs/FaceDownGestureDetectorDataUpdatedEventArgs.cs +++ /dev/null @@ -1,38 +0,0 @@ -/* - * 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.Sensor -{ - /// - /// The FaceDownGestureDetector changed event arguments class is used for storing the data returned by a face down gesture detector. - /// - public class FaceDownGestureDetectorDataUpdatedEventArgs : EventArgs - { - internal FaceDownGestureDetectorDataUpdatedEventArgs(float state) - { - FaceDown = (DetectorState) state; - } - - /// - /// Gets the face down state. - /// - /// 3 - /// The face down state. - public DetectorState FaceDown { get; private set; } - } -} diff --git a/src/Tizen.Sensor/Tizen.Sensor/EventArgs/GravitySensorDataUpdatedEventArgs.cs b/src/Tizen.Sensor/Tizen.Sensor/EventArgs/GravitySensorDataUpdatedEventArgs.cs deleted file mode 100755 index e99062afd..000000000 --- a/src/Tizen.Sensor/Tizen.Sensor/EventArgs/GravitySensorDataUpdatedEventArgs.cs +++ /dev/null @@ -1,54 +0,0 @@ -/* - * 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.Sensor -{ - /// - /// The GravitySensor changed event arguments class is used for storing the data returned by a gravity sensor. - /// - public class GravitySensorDataUpdatedEventArgs : EventArgs - { - internal GravitySensorDataUpdatedEventArgs(float[] values) - { - X = values[0]; - Y = values[1]; - Z = values[2]; - } - - /// - /// Gets the X component of the gravity. - /// - /// 3 - /// X - public float X { get; private set; } - - /// - /// Gets the Y component of the gravity. - /// - /// 3 - /// Y - public float Y { get; private set; } - - /// - /// Gets the Z component of the gravity. - /// - /// 3 - /// Z - public float Z { get; private set; } - } -} diff --git a/src/Tizen.Sensor/Tizen.Sensor/EventArgs/GyroscopeDataUpdatedEventArgs.cs b/src/Tizen.Sensor/Tizen.Sensor/EventArgs/GyroscopeDataUpdatedEventArgs.cs deleted file mode 100755 index 849b5703c..000000000 --- a/src/Tizen.Sensor/Tizen.Sensor/EventArgs/GyroscopeDataUpdatedEventArgs.cs +++ /dev/null @@ -1,54 +0,0 @@ -/* - * 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.Sensor -{ - /// - /// The Gyroscope changed event arguments class is used for storing the data returned by a gyroscope. - /// - public class GyroscopeDataUpdatedEventArgs : EventArgs - { - internal GyroscopeDataUpdatedEventArgs(float[] values) - { - X = values[0]; - Y = values[1]; - Z = values[2]; - } - - /// - /// Gets the X component of the gyroscope data. - /// - /// 3 - /// X - public float X { get; private set; } - - /// - /// Gets the Y component of the gyroscope data. - /// - /// 3 - /// Y - public float Y { get; private set; } - - /// - /// Gets the Z component of the gyroscope data. - /// - /// 3 - /// Z - public float Z { get; private set; } - } -} \ No newline at end of file diff --git a/src/Tizen.Sensor/Tizen.Sensor/EventArgs/GyroscopeRotationVectorSensorDataUpdatedEventArgs.cs b/src/Tizen.Sensor/Tizen.Sensor/EventArgs/GyroscopeRotationVectorSensorDataUpdatedEventArgs.cs deleted file mode 100755 index f5fb5774b..000000000 --- a/src/Tizen.Sensor/Tizen.Sensor/EventArgs/GyroscopeRotationVectorSensorDataUpdatedEventArgs.cs +++ /dev/null @@ -1,70 +0,0 @@ -/* - * 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.Sensor -{ - /// - /// The GyroscopeRotationVectorSensor changed event arguments class is used for storing the data returned by a gyroscope rotation vector sensor. - /// - public class GyroscopeRotationVectorSensorDataUpdatedEventArgs : EventArgs - { - internal GyroscopeRotationVectorSensorDataUpdatedEventArgs(float[] values, SensorDataAccuracy accuracy) - { - X = values[0]; - Y = values[1]; - Z = values[2]; - W = values[3]; - Accuracy = accuracy; - } - - /// - /// Gets the X component of the gyroscope rotation vector. - /// - /// 3 - /// X - public float X { get; private set; } - - /// - /// Gets the Y component of the gyroscope rotation vector. - /// - /// 3 - /// Y - public float Y { get; private set; } - - /// - /// Gets the Z component of the gyroscope rotation vector. - /// - /// 3 - /// Z - public float Z { get; private set; } - - /// - /// Gets the W component of the gyroscope rotation vector. - /// - /// 3 - /// W - public float W { get; private set; } - - /// - /// Gets the accuracy of the gyroscope rotation vector data. - /// - /// 3 - /// Accuracy - public SensorDataAccuracy Accuracy { get; private set; } - } -} diff --git a/src/Tizen.Sensor/Tizen.Sensor/EventArgs/HeartRateMonitorDataUpdatedEventArgs.cs b/src/Tizen.Sensor/Tizen.Sensor/EventArgs/HeartRateMonitorDataUpdatedEventArgs.cs deleted file mode 100755 index a51322727..000000000 --- a/src/Tizen.Sensor/Tizen.Sensor/EventArgs/HeartRateMonitorDataUpdatedEventArgs.cs +++ /dev/null @@ -1,38 +0,0 @@ -/* - * 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.Sensor -{ - /// - /// The HeartRateMonitor changed event arguments class is used for storing the data returned by a heart rate monitor. - /// - public class HeartRateMonitorDataUpdatedEventArgs : EventArgs - { - internal HeartRateMonitorDataUpdatedEventArgs(int heartRate) - { - HeartRate = heartRate; - } - - /// - /// Gets the value of the heart rate. - /// - /// 3 - /// The heart rate. - public int HeartRate { get; private set; } - } -} \ No newline at end of file diff --git a/src/Tizen.Sensor/Tizen.Sensor/EventArgs/HumiditySensorDataUpdatedEventArgs.cs b/src/Tizen.Sensor/Tizen.Sensor/EventArgs/HumiditySensorDataUpdatedEventArgs.cs deleted file mode 100755 index 452410a0f..000000000 --- a/src/Tizen.Sensor/Tizen.Sensor/EventArgs/HumiditySensorDataUpdatedEventArgs.cs +++ /dev/null @@ -1,38 +0,0 @@ -/* - * 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.Sensor -{ - /// - /// The HumiditySensor changed event arguments class is used for storing the data returned by a humidity sensor. - /// - public class HumiditySensorDataUpdatedEventArgs : EventArgs - { - internal HumiditySensorDataUpdatedEventArgs(float humidity) - { - Humidity = humidity; - } - - /// - /// Gets the value of the humidity. - /// - /// 3 - /// Humidity - public float Humidity { get; private set; } - } -} diff --git a/src/Tizen.Sensor/Tizen.Sensor/EventArgs/InVehicleActivityDetectorDataUpdatedEventArgs.cs b/src/Tizen.Sensor/Tizen.Sensor/EventArgs/InVehicleActivityDetectorDataUpdatedEventArgs.cs deleted file mode 100755 index 73bb7c186..000000000 --- a/src/Tizen.Sensor/Tizen.Sensor/EventArgs/InVehicleActivityDetectorDataUpdatedEventArgs.cs +++ /dev/null @@ -1,38 +0,0 @@ -/* - * 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.Sensor -{ - /// - /// The InVehicleActivityDetector changed event arguments class is used for storing the data returned by a in-vehicle activity detector. - /// - public class InVehicleActivityDetectorDataUpdatedEventArgs : EventArgs - { - internal InVehicleActivityDetectorDataUpdatedEventArgs(float state) - { - InVehicle = (DetectorState) state; - } - - /// - /// Gets the in-vehicle state. - /// - /// 3 - /// The in-vehicle state. - public DetectorState InVehicle { get; private set; } - } -} diff --git a/src/Tizen.Sensor/Tizen.Sensor/EventArgs/LightSensorDataUpdatedEventArgs.cs b/src/Tizen.Sensor/Tizen.Sensor/EventArgs/LightSensorDataUpdatedEventArgs.cs deleted file mode 100755 index 4f1dc4cf7..000000000 --- a/src/Tizen.Sensor/Tizen.Sensor/EventArgs/LightSensorDataUpdatedEventArgs.cs +++ /dev/null @@ -1,38 +0,0 @@ -/* - * 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.Sensor -{ - /// - /// The LightSensor changed event arguments class is used for storing the data returned by a light sensor. - /// - public class LightSensorDataUpdatedEventArgs : EventArgs - { - internal LightSensorDataUpdatedEventArgs(float level) - { - Level = level; - } - - /// - /// Gets the level of the light. - /// - /// 3 - /// The light level. - public float Level { get; private set; } - } -} diff --git a/src/Tizen.Sensor/Tizen.Sensor/EventArgs/LinearAccelerationSensorDataUpdatedEventArgs.cs b/src/Tizen.Sensor/Tizen.Sensor/EventArgs/LinearAccelerationSensorDataUpdatedEventArgs.cs deleted file mode 100755 index cf920bf93..000000000 --- a/src/Tizen.Sensor/Tizen.Sensor/EventArgs/LinearAccelerationSensorDataUpdatedEventArgs.cs +++ /dev/null @@ -1,54 +0,0 @@ -/* - * 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.Sensor -{ - /// - /// The LinearAccelerationSensor changed event arguments class is used for storing the data returned by a linear acceleration sensor. - /// - public class LinearAccelerationSensorDataUpdatedEventArgs : EventArgs - { - internal LinearAccelerationSensorDataUpdatedEventArgs(float[] values) - { - X = values[0]; - Y = values[1]; - Z = values[2]; - } - - /// - /// Gets the X component of the linear acceleration. - /// - /// 3 - /// X - public float X { get; private set; } - - /// - /// Gets the Y component of the linear acceleration. - /// - /// 3 - /// Y - public float Y { get; private set; } - - /// - /// Gets the Z component of the linear acceleration. - /// - /// 3 - /// Z - public float Z { get; private set; } - } -} diff --git a/src/Tizen.Sensor/Tizen.Sensor/EventArgs/MagnetometerDataUpdatedEventArgs.cs b/src/Tizen.Sensor/Tizen.Sensor/EventArgs/MagnetometerDataUpdatedEventArgs.cs deleted file mode 100755 index e0deb3090..000000000 --- a/src/Tizen.Sensor/Tizen.Sensor/EventArgs/MagnetometerDataUpdatedEventArgs.cs +++ /dev/null @@ -1,54 +0,0 @@ -/* - * 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.Sensor -{ - /// - /// The Magnetometer changed event arguments class is used for storing the data returned by a magnetometer sensor. - /// - public class MagnetometerDataUpdatedEventArgs : EventArgs - { - internal MagnetometerDataUpdatedEventArgs(float[] values) - { - X = values[0]; - Y = values[1]; - Z = values[2]; - } - - /// - /// Gets the X component of the magnetometer. - /// - /// 3 - /// X - public float X { get; private set; } - - /// - /// Gets the Y component of the magnetometer. - /// - /// 3 - /// Y - public float Y { get; private set; } - - /// - /// Gets the Z component of the magnetometer. - /// - /// 3 - /// Z - public float Z { get; private set; } - } -} diff --git a/src/Tizen.Sensor/Tizen.Sensor/EventArgs/MagnetometerRotationVectorSensorDataUpdatedEventArgs.cs b/src/Tizen.Sensor/Tizen.Sensor/EventArgs/MagnetometerRotationVectorSensorDataUpdatedEventArgs.cs deleted file mode 100755 index 4e1fc9306..000000000 --- a/src/Tizen.Sensor/Tizen.Sensor/EventArgs/MagnetometerRotationVectorSensorDataUpdatedEventArgs.cs +++ /dev/null @@ -1,70 +0,0 @@ -/* - * 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.Sensor -{ - /// - /// The MagnetometerRotationVectorSensor changed event arguments class is used for storing the data returned by a magnetometer rotation vector sensor. - /// - public class MagnetometerRotationVectorSensorDataUpdatedEventArgs : EventArgs - { - internal MagnetometerRotationVectorSensorDataUpdatedEventArgs(float[] values, SensorDataAccuracy accuracy) - { - X = values[0]; - Y = values[1]; - Z = values[2]; - W = values[3]; - Accuracy = accuracy; - } - - /// - /// Gets the X component of the magnetometer rotation vector. - /// - /// 3 - /// X - public float X { get; private set; } - - /// - /// Gets the Y component of the magnetometer rotation vector. - /// - /// 3 - /// Y - public float Y { get; private set; } - - /// - /// Gets the Z component of the magnetometer rotation vector. - /// - /// 3 - /// Z - public float Z { get; private set; } - - /// - /// Gets the W component of the magnetometer rotation vector. - /// - /// 3 - /// W - public float W { get; private set; } - - /// - /// Gets the accuracy of the magnetometer rotation vector data. - /// - /// 3 - /// Accuracy - public SensorDataAccuracy Accuracy { get; private set; } - } -} diff --git a/src/Tizen.Sensor/Tizen.Sensor/EventArgs/OrientationSensorDataUpdatedEventArgs.cs b/src/Tizen.Sensor/Tizen.Sensor/EventArgs/OrientationSensorDataUpdatedEventArgs.cs deleted file mode 100755 index c7f623995..000000000 --- a/src/Tizen.Sensor/Tizen.Sensor/EventArgs/OrientationSensorDataUpdatedEventArgs.cs +++ /dev/null @@ -1,54 +0,0 @@ -/* - * 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.Sensor -{ - /// - /// The OrientationSensor changed event arguments class is used for storing the data returned by a orientation sensor. - /// - public class OrientationSensorDataUpdatedEventArgs : EventArgs - { - internal OrientationSensorDataUpdatedEventArgs(float[] values) - { - Azimuth = values[0]; - Pitch = values[1]; - Roll = values[2]; - } - - /// - /// Gets the azimuth component of the orientation. - /// - /// 3 - /// Azimuth - public float Azimuth { get; private set; } - - /// - /// Gets the pitch component of the orientation. - /// - /// 3 - /// Pitch - public float Pitch { get; private set; } - - /// - /// Gets the roll component of the orientation. - /// - /// 3 - /// Roll - public float Roll { get; private set; } - } -} diff --git a/src/Tizen.Sensor/Tizen.Sensor/EventArgs/PedometerDataUpdatedEventArgs.cs b/src/Tizen.Sensor/Tizen.Sensor/EventArgs/PedometerDataUpdatedEventArgs.cs deleted file mode 100755 index 0a73a8e0a..000000000 --- a/src/Tizen.Sensor/Tizen.Sensor/EventArgs/PedometerDataUpdatedEventArgs.cs +++ /dev/null @@ -1,94 +0,0 @@ -/* - * 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.Sensor -{ - /// - /// The Pedometer changed event arguments class is used for storing the data returned by a pedometer. - /// - public class PedometerDataUpdatedEventArgs : EventArgs - { - internal PedometerDataUpdatedEventArgs(float[] values) - { - StepCount = (uint) values[0]; - WalkStepCount = (uint) values[1]; - RunStepCount = (uint) values[2]; - MovingDistance = values[3]; - CalorieBurned = values[4]; - LastSpeed = values[5]; - LastSteppingFrequency = values[6]; - LastStepStatus = (PedometerState) values[7]; - } - - /// - /// Gets the step count. - /// - /// 3 - /// The step count. - public uint StepCount { get; private set; } - - /// - /// Gets the walking step count. - /// - /// 3 - /// The walk step count. - public uint WalkStepCount { get; private set; } - - /// - /// Gets the running step count. - /// - /// 3 - /// The run step count. - public uint RunStepCount { get; private set; } - - /// - /// Gets the moving distance. - /// - /// 3 - /// The moving distance. - public float MovingDistance { get; private set; } - - /// - /// Gets the calorie burned. - /// - /// 3 - /// The calorie burned. - public float CalorieBurned { get; private set; } - - /// - /// Gets the last speed. - /// - /// 3 - /// The last speed. - public float LastSpeed { get; private set; } - - /// - /// Gets the last stepping frequency. - /// - /// 3 - /// The last stepping frequency. - public float LastSteppingFrequency { get; private set; } - - /// - /// Gets the last step status. - /// - /// 3 - /// The last stepping status. - public PedometerState LastStepStatus { get; private set; } - } -} diff --git a/src/Tizen.Sensor/Tizen.Sensor/EventArgs/PickUpGestureDetectorDataUpdatedEventArgs.cs b/src/Tizen.Sensor/Tizen.Sensor/EventArgs/PickUpGestureDetectorDataUpdatedEventArgs.cs deleted file mode 100755 index 82b5b8890..000000000 --- a/src/Tizen.Sensor/Tizen.Sensor/EventArgs/PickUpGestureDetectorDataUpdatedEventArgs.cs +++ /dev/null @@ -1,38 +0,0 @@ -/* - * 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.Sensor -{ - /// - /// The PickUpGestureDetector changed event arguments class is used for storing the data returned by a pickup gesture detector. - /// - public class PickUpGestureDetectorDataUpdatedEventArgs : EventArgs - { - internal PickUpGestureDetectorDataUpdatedEventArgs(float state) - { - PickUp = (DetectorState) state; - } - - /// - /// Gets the pick up state. - /// - /// 3 - /// The pick up state. - public DetectorState PickUp { get; private set; } - } -} diff --git a/src/Tizen.Sensor/Tizen.Sensor/EventArgs/PressureSensorDataUpdatedEventArgs.cs b/src/Tizen.Sensor/Tizen.Sensor/EventArgs/PressureSensorDataUpdatedEventArgs.cs deleted file mode 100755 index 4bbe48e77..000000000 --- a/src/Tizen.Sensor/Tizen.Sensor/EventArgs/PressureSensorDataUpdatedEventArgs.cs +++ /dev/null @@ -1,38 +0,0 @@ -/* - * 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.Sensor -{ - /// - /// The PressureSensor changed event arguments class is used for storing the data returned by a pressure sensor. - /// - public class PressureSensorDataUpdatedEventArgs : EventArgs - { - internal PressureSensorDataUpdatedEventArgs(float pressure) - { - Pressure = pressure; - } - - /// - /// Gets the value of the pressure. - /// - /// 3 - /// Pressure - public float Pressure { get; private set; } - } -} diff --git a/src/Tizen.Sensor/Tizen.Sensor/EventArgs/ProximitySensorDataUpdatedEventArgs.cs b/src/Tizen.Sensor/Tizen.Sensor/EventArgs/ProximitySensorDataUpdatedEventArgs.cs deleted file mode 100755 index 27faa158e..000000000 --- a/src/Tizen.Sensor/Tizen.Sensor/EventArgs/ProximitySensorDataUpdatedEventArgs.cs +++ /dev/null @@ -1,38 +0,0 @@ -/* - * 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.Sensor -{ - /// - /// The ProximitySensor changed event arguments class is used for storing the data returned by a proximity sensor. - /// - public class ProximitySensorDataUpdatedEventArgs : EventArgs - { - internal ProximitySensorDataUpdatedEventArgs(float proximity) - { - Proximity = (ProximitySensorState) proximity; - } - - /// - /// Gets the proximity state. - /// - /// 3 - /// The proximity state. - public ProximitySensorState Proximity { get; private set; } - } -} diff --git a/src/Tizen.Sensor/Tizen.Sensor/EventArgs/RotationVectorSensorDataUpdatedEventArgs.cs b/src/Tizen.Sensor/Tizen.Sensor/EventArgs/RotationVectorSensorDataUpdatedEventArgs.cs deleted file mode 100755 index 98229ee86..000000000 --- a/src/Tizen.Sensor/Tizen.Sensor/EventArgs/RotationVectorSensorDataUpdatedEventArgs.cs +++ /dev/null @@ -1,70 +0,0 @@ -/* - * 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.Sensor -{ - /// - /// The RotationVectorSensor changed event arguments class is used for storing the data returned by a rotation vector sensor. - /// - public class RotationVectorSensorDataUpdatedEventArgs : EventArgs - { - internal RotationVectorSensorDataUpdatedEventArgs(float[] values, SensorDataAccuracy accuracy) - { - X = values[0]; - Y = values[1]; - Z = values[2]; - W = values[3]; - Accuracy = accuracy; - } - - /// - /// Gets the X component of the rotation vector. - /// - /// 3 - /// X - public float X { get; private set; } - - /// - /// Gets the Y component of the rotation vector. - /// - /// 3 - /// Y - public float Y { get; private set; } - - /// - /// Gets the Z component of the rotation vector. - /// - /// 3 - /// Z - public float Z { get; private set; } - - /// - /// Gets the W component of the rotation vector. - /// - /// 3 - /// W - public float W { get; private set;} - - /// - /// Gets the accuracy of the rotation vector data. - /// - /// 3 - /// Accuracy - public SensorDataAccuracy Accuracy { get; private set; } - } -} diff --git a/src/Tizen.Sensor/Tizen.Sensor/EventArgs/RunningActivityDetectorDataUpdatedEventArgs.cs b/src/Tizen.Sensor/Tizen.Sensor/EventArgs/RunningActivityDetectorDataUpdatedEventArgs.cs deleted file mode 100755 index 66c6d7e4e..000000000 --- a/src/Tizen.Sensor/Tizen.Sensor/EventArgs/RunningActivityDetectorDataUpdatedEventArgs.cs +++ /dev/null @@ -1,38 +0,0 @@ -/* - * 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.Sensor -{ - /// - /// The RunningActivityDetector changed event arguments class is used for storing the data returned by a running activity detector. - /// - public class RunningActivityDetectorDataUpdatedEventArgs : EventArgs - { - internal RunningActivityDetectorDataUpdatedEventArgs(float state) - { - Running = (DetectorState) state; - } - - /// - /// Gets the running state. - /// - /// 3 - /// The running state. - public DetectorState Running { get; private set; } - } -} diff --git a/src/Tizen.Sensor/Tizen.Sensor/EventArgs/SensorAccuracyChangedEventArgs.cs b/src/Tizen.Sensor/Tizen.Sensor/EventArgs/SensorAccuracyChangedEventArgs.cs deleted file mode 100755 index 3735cc0db..000000000 --- a/src/Tizen.Sensor/Tizen.Sensor/EventArgs/SensorAccuracyChangedEventArgs.cs +++ /dev/null @@ -1,46 +0,0 @@ -/* - * 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.Sensor -{ - /// - /// The sensor accuracy changed event arguments class contains the parameters to be returned through the accuracy callback. - /// - public class SensorAccuracyChangedEventArgs : EventArgs - { - internal SensorAccuracyChangedEventArgs(TimeSpan timespan, SensorDataAccuracy accuracy) - { - TimeSpan = timespan; - Accuracy = accuracy; - } - - /// - /// Gets the time stamp. - /// - /// 3 - /// The time span. - public TimeSpan TimeSpan { get; private set; } - - /// - /// Gets the accuracy. - /// - /// 3 - /// Accuracy - public SensorDataAccuracy Accuracy { get; private set; } - } -} \ No newline at end of file diff --git a/src/Tizen.Sensor/Tizen.Sensor/EventArgs/SleepMonitorDataUpdatedEventArgs.cs b/src/Tizen.Sensor/Tizen.Sensor/EventArgs/SleepMonitorDataUpdatedEventArgs.cs deleted file mode 100755 index 82074fd11..000000000 --- a/src/Tizen.Sensor/Tizen.Sensor/EventArgs/SleepMonitorDataUpdatedEventArgs.cs +++ /dev/null @@ -1,38 +0,0 @@ -/* - * 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.Sensor -{ - /// - /// The SleepMonitor changed event arguments class is used for storing the data returned by a sleep monitor. - /// - public class SleepMonitorDataUpdatedEventArgs : EventArgs - { - internal SleepMonitorDataUpdatedEventArgs(int sleepState) - { - SleepState = (SleepMonitorState) sleepState; - } - - /// - /// Gets the value of the sleep state. - /// - /// 3 - /// The sleep state. - public SleepMonitorState SleepState { get; private set; } - } -} diff --git a/src/Tizen.Sensor/Tizen.Sensor/EventArgs/StationaryActivityDetectorDataUpdatedEventArgs.cs b/src/Tizen.Sensor/Tizen.Sensor/EventArgs/StationaryActivityDetectorDataUpdatedEventArgs.cs deleted file mode 100755 index aaf393a30..000000000 --- a/src/Tizen.Sensor/Tizen.Sensor/EventArgs/StationaryActivityDetectorDataUpdatedEventArgs.cs +++ /dev/null @@ -1,38 +0,0 @@ -/* - * 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.Sensor -{ - /// - /// The StationaryActivityDetector changed event arguments class is used for storing the data returned by a stationary activity detector. - /// - public class StationaryActivityDetectorDataUpdatedEventArgs : EventArgs - { - internal StationaryActivityDetectorDataUpdatedEventArgs(float state) - { - Stationary = (DetectorState) state; - } - - /// - /// Gets the stationary state. - /// - /// 3 - /// The stationary state. - public DetectorState Stationary { get; private set; } - } -} diff --git a/src/Tizen.Sensor/Tizen.Sensor/EventArgs/TemperatureSensorDataUpdatedEventArgs.cs b/src/Tizen.Sensor/Tizen.Sensor/EventArgs/TemperatureSensorDataUpdatedEventArgs.cs deleted file mode 100755 index 3b4a6baa8..000000000 --- a/src/Tizen.Sensor/Tizen.Sensor/EventArgs/TemperatureSensorDataUpdatedEventArgs.cs +++ /dev/null @@ -1,38 +0,0 @@ -/* - * 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.Sensor -{ - /// - /// The TemperatureSensor changed event arguments class is used for storing the data returned by a temperature sensor. - /// - public class TemperatureSensorDataUpdatedEventArgs : EventArgs - { - internal TemperatureSensorDataUpdatedEventArgs(float temperature) - { - Temperature = temperature; - } - - /// - /// Gets the value of the temperature. - /// - /// 3 - /// Temperature - public float Temperature { get; private set; } - } -} diff --git a/src/Tizen.Sensor/Tizen.Sensor/EventArgs/UltravioletSensorDataUpdatedEventArgs.cs b/src/Tizen.Sensor/Tizen.Sensor/EventArgs/UltravioletSensorDataUpdatedEventArgs.cs deleted file mode 100755 index b42b1e351..000000000 --- a/src/Tizen.Sensor/Tizen.Sensor/EventArgs/UltravioletSensorDataUpdatedEventArgs.cs +++ /dev/null @@ -1,38 +0,0 @@ -/* - * 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.Sensor -{ - /// - /// The UltravioletSensor changed event arguments class is used for storing the data returned by a ultraviolet sensor. - /// - public class UltravioletSensorDataUpdatedEventArgs : EventArgs - { - internal UltravioletSensorDataUpdatedEventArgs(float ultravioletIndex) - { - UltravioletIndex = ultravioletIndex; - } - - /// - /// Gets the value of the ultraviolet index. - /// - /// 3 - /// The ultraviolet index. - public float UltravioletIndex { get; private set; } - } -} diff --git a/src/Tizen.Sensor/Tizen.Sensor/EventArgs/UncalibratedGyroscopeDataUpdatedEventArgs.cs b/src/Tizen.Sensor/Tizen.Sensor/EventArgs/UncalibratedGyroscopeDataUpdatedEventArgs.cs deleted file mode 100755 index b358ef9ee..000000000 --- a/src/Tizen.Sensor/Tizen.Sensor/EventArgs/UncalibratedGyroscopeDataUpdatedEventArgs.cs +++ /dev/null @@ -1,78 +0,0 @@ -/* - * 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.Sensor -{ - /// - /// The UncalibratedGyroscope changed event arguments class is used for storing the data returned by a uncalibrated gyroscope. - /// - public class UncalibratedGyroscopeDataUpdatedEventArgs : EventArgs - { - internal UncalibratedGyroscopeDataUpdatedEventArgs(float[] values) - { - X = values[0]; - Y = values[1]; - Z = values[2]; - BiasX = values[3]; - BiasY = values[4]; - BiasZ = values[5]; - } - - /// - /// Gets the X component of the uncalibrated gyroscope data. - /// - /// 3 - /// X - public float X { get; private set; } - - /// - /// Gets the Y component of the uncalibrated gyroscope data. - /// - /// 3 - /// Y - public float Y { get; private set; } - - /// - /// Gets the Z component of the uncalibrated gyroscope data. - /// - /// 3 - /// Z - public float Z { get; private set; } - - /// - /// Gets the BiasX component of the uncalibrated gyroscope data. - /// - /// 3 - /// The X bias. - public float BiasX { get; private set; } - - /// - /// Gets the BiasY component of the uncalibrated gyroscope data. - /// - /// 3 - /// The Y bias. - public float BiasY { get; private set; } - - /// - /// Gets the BiasZ component of the uncalibrated gyroscope data. - /// - /// 3 - /// The Z bias. - public float BiasZ { get; private set; } - } -} diff --git a/src/Tizen.Sensor/Tizen.Sensor/EventArgs/UncalibratedMagnetometerDataUpdatedEventArgs.cs b/src/Tizen.Sensor/Tizen.Sensor/EventArgs/UncalibratedMagnetometerDataUpdatedEventArgs.cs deleted file mode 100755 index c8a2f538e..000000000 --- a/src/Tizen.Sensor/Tizen.Sensor/EventArgs/UncalibratedMagnetometerDataUpdatedEventArgs.cs +++ /dev/null @@ -1,78 +0,0 @@ -/* - * 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.Sensor -{ - /// - /// The UncalibratedMagnetometer changed event arguments class is used for storing the data returned by a uncalibrated magnetometer. - /// - public class UncalibratedMagnetometerDataUpdatedEventArgs : EventArgs - { - internal UncalibratedMagnetometerDataUpdatedEventArgs(float[] values) - { - X = values[0]; - Y = values[1]; - Z = values[2]; - BiasX = values[3]; - BiasY = values[4]; - BiasZ = values[5]; - } - - /// - /// Gets the X component of the uncalibrated magnetometer data. - /// - /// 3 - /// X - public float X { get; private set; } - - /// - /// Gets the Y component of the uncalibrated magnetometer data. - /// - /// 3 - /// Y - public float Y { get; private set; } - - /// - /// Gets the Z component of the uncalibrated magnetometer data. - /// - /// 3 - /// Z - public float Z { get; private set; } - - /// - /// Gets the BiasX component of the uncalibrated magnetometer data. - /// - /// 3 - /// The X bias. - public float BiasX { get; private set; } - - /// - /// Gets the BiasY component of the uncalibrated magnetometer data. - /// - /// 3 - /// The Y bias. - public float BiasY { get; private set; } - - /// - /// Gets the BiasZ component of the uncalibrated magnetometer data. - /// - /// 3 - /// The Z bias. - public float BiasZ { get; private set; } - } -} diff --git a/src/Tizen.Sensor/Tizen.Sensor/EventArgs/WalkingActivityDetectorDataUpdatedEventArgs.cs b/src/Tizen.Sensor/Tizen.Sensor/EventArgs/WalkingActivityDetectorDataUpdatedEventArgs.cs deleted file mode 100755 index 014204710..000000000 --- a/src/Tizen.Sensor/Tizen.Sensor/EventArgs/WalkingActivityDetectorDataUpdatedEventArgs.cs +++ /dev/null @@ -1,38 +0,0 @@ -/* - * 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.Sensor -{ - /// - /// The WalkingActivityDetector changed event arguments class is used for storing the data returned by a walking activity detector. - /// - public class WalkingActivityDetectorDataUpdatedEventArgs : EventArgs - { - internal WalkingActivityDetectorDataUpdatedEventArgs(float state) - { - Walking = (DetectorState) state; - } - - /// - /// Gets the walking state. - /// - /// 3 - /// The walking state. - public DetectorState Walking { get; private set; } - } -} diff --git a/src/Tizen.Sensor/Tizen.Sensor/EventArgs/WristUpGestureDetectorDataUpdatedEventArgs.cs b/src/Tizen.Sensor/Tizen.Sensor/EventArgs/WristUpGestureDetectorDataUpdatedEventArgs.cs deleted file mode 100755 index 2ac31fefa..000000000 --- a/src/Tizen.Sensor/Tizen.Sensor/EventArgs/WristUpGestureDetectorDataUpdatedEventArgs.cs +++ /dev/null @@ -1,38 +0,0 @@ -/* - * 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.Sensor -{ - /// - /// The WristUpGestureDetector changed event arguments class is used for storing the data returned by a wrist up gesture detector. - /// - public class WristUpGestureDetectorDataUpdatedEventArgs : EventArgs - { - internal WristUpGestureDetectorDataUpdatedEventArgs(float state) - { - WristUp = (DetectorState) state; - } - - /// - /// Gets the wrist up state. - /// - /// 3 - /// The wrist up state. - public DetectorState WristUp { get; private set; } - } -} diff --git a/src/Tizen.Sensor/Tizen.Sensor/Plugins/Accelerometer.cs b/src/Tizen.Sensor/Tizen.Sensor/Plugins/Accelerometer.cs deleted file mode 100755 index 3c0867fa9..000000000 --- a/src/Tizen.Sensor/Tizen.Sensor/Plugins/Accelerometer.cs +++ /dev/null @@ -1,152 +0,0 @@ -/* - * 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.Sensor -{ - /// - /// The Accelerometer Sensor class is used for registering callbacks for the accelerometer and getting the accelerometer data. - /// - public sealed class Accelerometer : Sensor - { - private static string AccelerometerKey = "http://tizen.org/feature/sensor.accelerometer"; - /// - /// Gets the X component of the acceleration. - /// - /// 3 - /// X - public float X { get; private set; } = float.MinValue; - - /// - /// Gets the Y component of the acceleration. - /// - /// 3 - /// Y - public float Y { get; private set; } = float.MinValue; - - /// - /// Gets the Z component of the acceleration. - /// - /// 3 - /// Z - public float Z { get; private set; } = float.MinValue; - - /// - /// Returns true or false based on whether accelerometer sensor is supported by the device. - /// - /// 3 - /// true if supported; otherwise false. - public static bool IsSupported - { - get - { - Log.Info(Globals.LogTag, "Checking if the Accelerometer sensor is supported"); - return CheckIfSupported(SensorType.Accelerometer, AccelerometerKey); - } - } - - /// - /// Returns the number of accelerometer sensors available on the device. - /// - /// 3 - /// The count of accelerometer sensors. - /// Thrown when the operation is invalid for the current state. - public static int Count - { - get - { - Log.Info(Globals.LogTag, "Getting the count of accelerometer sensors"); - return GetCount(); - } - } - - /// - /// Initializes a new instance of the class. - /// - /// 3 - /// http://tizen.org/feature/sensor.accelerometer - /// Thrown when an invalid argument is used. - /// Thrown when the sensor is not supported. - /// Thrown when the operation is invalid for the current state. - /// - /// Index. Default value for this is 0. Index refers to a particular accelerometer sensor in case of multiple sensors. - /// - public Accelerometer(uint index = 0) : base(index) - { - Log.Info(Globals.LogTag, "Creating Accelerometer object"); - } - - internal override SensorType GetSensorType() - { - return SensorType.Accelerometer; - } - - /// - /// An event handler for storing the callback functions for the event corresponding to the change in the accelerometer sensor data. - /// - /// 3 - public event EventHandler DataUpdated; - - private static int GetCount() - { - IntPtr list; - int count; - int error = Interop.SensorManager.GetSensorList(SensorType.Accelerometer, out list, out count); - if (error != (int)SensorError.None) - { - Log.Error(Globals.LogTag, "Error getting sensor list for accelerometer"); - count = 0; - } - else - Interop.Libc.Free(list); - return count; - } - - private static Interop.SensorListener.SensorEventCallback _callback; - - internal override void EventListenStart() - { - _callback = (IntPtr sensorHandle, IntPtr eventPtr, IntPtr data) => { - Interop.SensorEventStruct sensorData = Interop.IntPtrToEventStruct(eventPtr); - - TimeSpan = new TimeSpan((Int64)sensorData.timestamp); - X = sensorData.values[0]; - Y = sensorData.values[1]; - Z = sensorData.values[2]; - - DataUpdated?.Invoke(this, new AccelerometerDataUpdatedEventArgs(sensorData.values)); - }; - - int error = Interop.SensorListener.SetEventCallback(ListenerHandle, Interval, _callback, IntPtr.Zero); - if (error != (int)SensorError.None) - { - Log.Error(Globals.LogTag, "Error setting event callback for accelerometer sensor"); - throw SensorErrorFactory.CheckAndThrowException(error, "Unable to set event callback for accelerometer"); - } - } - - internal override void EventListenStop() - { - int error = Interop.SensorListener.UnsetEventCallback(ListenerHandle); - if (error != (int)SensorError.None) - { - Log.Error(Globals.LogTag, "Error unsetting event callback for accelerometer sensor"); - throw SensorErrorFactory.CheckAndThrowException(error, "Unable to unset event callback for accelerometer"); - } - } - } -} diff --git a/src/Tizen.Sensor/Tizen.Sensor/Plugins/ActivityDetector.cs b/src/Tizen.Sensor/Tizen.Sensor/Plugins/ActivityDetector.cs deleted file mode 100755 index 061557d34..000000000 --- a/src/Tizen.Sensor/Tizen.Sensor/Plugins/ActivityDetector.cs +++ /dev/null @@ -1,49 +0,0 @@ -/* - * 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.Sensor -{ - /// - /// The Activity Detector class is used for storing the common activity information. - /// - public abstract class ActivityDetector : Sensor - { - protected const int ActivityAttribute = (((int)SensorType.InVehicleActivityDetector << 8) | 0x80 | 0x1); - - protected enum ActivityType - { - Unknown = 1, - Stationary = 2, - Walking = 4, - Running = 8, - InVehicle = 16, - OnBicycle = 32, - }; - - /// - /// Gets the activity accuracy of the activity detector. - /// - /// 3 - /// The activity accuracy. - public SensorDataAccuracy ActivityAccuracy { get; protected set; } - - internal ActivityDetector(uint index) : base(index) - { - } - } -} diff --git a/src/Tizen.Sensor/Tizen.Sensor/Plugins/FaceDownGestureDetector.cs b/src/Tizen.Sensor/Tizen.Sensor/Plugins/FaceDownGestureDetector.cs deleted file mode 100755 index 734012486..000000000 --- a/src/Tizen.Sensor/Tizen.Sensor/Plugins/FaceDownGestureDetector.cs +++ /dev/null @@ -1,136 +0,0 @@ -/* - * 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.Sensor -{ - /// - /// The FaceDownGestureDetector class is used for registering callbacks for the face down gesture detector and getting the face down state. - /// - public sealed class FaceDownGestureDetector : Sensor - { - private static string GestureDetectorKey = "http://tizen.org/feature/sensor.gesture_recognition"; - - /// - /// Gets the state of the face down gesture. - /// - /// 3 - /// The face down state. - public DetectorState FaceDown { get; private set; } = DetectorState.Unknown; - - /// - /// Returns true or false based on whether the face down gesture detector is supported by the device. - /// - /// 3 - /// true if supported; otherwise false. - public static bool IsSupported - { - get - { - Log.Info(Globals.LogTag, "Checking if the face down gesture detector is supported"); - return CheckIfSupported(SensorType.FaceDownGestureDetector, GestureDetectorKey); - } - } - - /// - /// Returns the number of face down gesture detectors available on the device. - /// - /// 3 - /// The count of face down gesture detectors. - public static int Count - { - get - { - Log.Info(Globals.LogTag, "Getting the count of face down gesture detectors"); - return GetCount(); - } - } - - /// - /// Initializes a new instance of the class. - /// - /// 3 - /// http://tizen.org/feature/sensor.gesture_recognition - /// Thrown when an invalid argument is used. - /// Thrown when the sensor is not supported. - /// Thrown when the operation is invalid for the current state. - /// - /// Index. Default value for this is 0. Index refers to a particular face down gesture detector in case of multiple sensors. - /// - public FaceDownGestureDetector(uint index = 0) : base(index) - { - Log.Info(Globals.LogTag, "Creating face down gesture detector object"); - } - - internal override SensorType GetSensorType() - { - return SensorType.FaceDownGestureDetector; - } - - private static int GetCount() - { - IntPtr list; - int count; - int error = Interop.SensorManager.GetSensorList(SensorType.FaceDownGestureDetector, out list, out count); - if (error != (int)SensorError.None) - { - Log.Error(Globals.LogTag, "Error getting sensor list for face down gesture detector"); - count = 0; - } - else - Interop.Libc.Free(list); - return count; - } - - /// - /// An event handler for storing the callback functions for the event corresponding to the change in the face down gesture detector data. - /// - /// 3 - public event EventHandler DataUpdated; - - private static Interop.SensorListener.SensorEventCallback _callback; - - internal override void EventListenStart() - { - _callback = (IntPtr sensorHandle, IntPtr eventPtr, IntPtr data) => { - Interop.SensorEventStruct sensorData = Interop.IntPtrToEventStruct(eventPtr); - - TimeSpan = new TimeSpan((Int64)sensorData.timestamp); - FaceDown = (DetectorState) sensorData.values[0]; - - DataUpdated?.Invoke(this, new FaceDownGestureDetectorDataUpdatedEventArgs(sensorData.values[0])); - }; - - int error = Interop.SensorListener.SetEventCallback(ListenerHandle, Interval, _callback, IntPtr.Zero); - if (error != (int)SensorError.None) - { - Log.Error(Globals.LogTag, "Error setting event callback for face down gesture detector"); - throw SensorErrorFactory.CheckAndThrowException(error, "Unable to set event callback for face down gesture detector"); - } - } - - internal override void EventListenStop() - { - int error = Interop.SensorListener.UnsetEventCallback(ListenerHandle); - if (error != (int)SensorError.None) - { - Log.Error(Globals.LogTag, "Error unsetting event callback for face down gesture detector"); - throw SensorErrorFactory.CheckAndThrowException(error, "Unable to unset event callback for face down gesture detector"); - } - } - } -} diff --git a/src/Tizen.Sensor/Tizen.Sensor/Plugins/GravitySensor.cs b/src/Tizen.Sensor/Tizen.Sensor/Plugins/GravitySensor.cs deleted file mode 100755 index 746fef8a4..000000000 --- a/src/Tizen.Sensor/Tizen.Sensor/Plugins/GravitySensor.cs +++ /dev/null @@ -1,205 +0,0 @@ -/* - * 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.Sensor -{ - /// - /// The GravitySensor class is used for registering callbacks for the gravity sensor and getting the gravity data. - /// - public sealed class GravitySensor : Sensor - { - private const string GravitySensorKey = "http://tizen.org/feature/sensor.gravity"; - - private event EventHandler _accuracyChanged; - /// - /// Gets the X component of the gravity. - /// - /// 3 - /// X - public float X { get; private set; } = float.MinValue; - - /// - /// Gets the Y component of the gravity. - /// - /// 3 - /// Y - public float Y { get; private set; } = float.MinValue; - - /// - /// Gets the Z component of the gravity. - /// - /// 3 - /// Z - public float Z { get; private set; } = float.MinValue; - - /// - /// Returns true or false based on whether the gravity sensor is supported by the device. - /// - /// 3 - /// true if supported; otherwise false. - public static bool IsSupported - { - get - { - Log.Info(Globals.LogTag, "Checking if the GravitySensor is supported"); - return CheckIfSupported(SensorType.GravitySensor, GravitySensorKey); - } - } - - /// - /// Returns the number of gravity sensors available on the device. - /// - /// 3 - /// The count of gravity sensors. - public static int Count - { - get - { - Log.Info(Globals.LogTag, "Getting the count of gravity sensors"); - return GetCount(); - } - } - - /// - /// Initializes a new instance of the class. - /// - /// 3 - /// http://tizen.org/feature/sensor.gravity - /// Thrown when an invalid argument is used. - /// Thrown when the sensor is not supported. - /// Thrown when the operation is invalid for the current state. - /// - /// Index. Default value for this is 0. Index refers to a particular gravity sensor in case of multiple sensors. - /// - public GravitySensor (uint index = 0) : base(index) - { - Log.Info(Globals.LogTag, "Creating GravitySensor object"); - } - - internal override SensorType GetSensorType() - { - return SensorType.GravitySensor; - } - - /// - /// An event handler for storing the callback functions for the event corresponding to the change in the gravity sensor data. - /// - /// 3 - - public event EventHandler DataUpdated; - - /// - /// An event handler for accuracy changed events. - /// - /// 3 - public event EventHandler AccuracyChanged - { - add - { - if (_accuracyChanged == null) - { - AccuracyListenStart(); - } - _accuracyChanged += value; - } - remove - { - _accuracyChanged -= value; - if (_accuracyChanged == null) - { - AccuracyListenStop(); - } - } - } - - private static int GetCount() - { - IntPtr list; - int count; - int error = Interop.SensorManager.GetSensorList(SensorType.GravitySensor, out list, out count); - if (error != (int)SensorError.None) - { - Log.Error(Globals.LogTag, "Error getting sensor list for gravity"); - count = 0; - } - else - Interop.Libc.Free(list); - return count; - } - - private static Interop.SensorListener.SensorEventCallback _callback; - - internal override void EventListenStart() - { - _callback = (IntPtr sensorHandle, IntPtr eventPtr, IntPtr data) => { - Interop.SensorEventStruct sensorData = Interop.IntPtrToEventStruct(eventPtr); - - TimeSpan = new TimeSpan((Int64)sensorData.timestamp); - X = sensorData.values[0]; - Y = sensorData.values[1]; - Z = sensorData.values[2]; - - DataUpdated?.Invoke(this, new GravitySensorDataUpdatedEventArgs(sensorData.values)); - }; - - int error = Interop.SensorListener.SetEventCallback(ListenerHandle, Interval, _callback, IntPtr.Zero); - if (error != (int)SensorError.None) - { - Log.Error(Globals.LogTag, "Error setting event callback for gravity sensor"); - throw SensorErrorFactory.CheckAndThrowException(error, "Unable to set event callback for gravity"); - } - } - - internal override void EventListenStop() - { - int error = Interop.SensorListener.UnsetEventCallback(ListenerHandle); - if (error != (int)SensorError.None) - { - Log.Error(Globals.LogTag, "Error unsetting event callback for gravity sensor"); - throw SensorErrorFactory.CheckAndThrowException(error, "Unable to unset event callback for gravity"); - } - } - - private static Interop.SensorListener.SensorAccuracyCallback _accuracyCallback; - - private void AccuracyListenStart() - { - _accuracyCallback = (IntPtr sensorHandle, UInt64 timestamp, SensorDataAccuracy accuracy, IntPtr data) => { - TimeSpan = new TimeSpan((Int64)timestamp); - _accuracyChanged?.Invoke(this, new SensorAccuracyChangedEventArgs(new TimeSpan((Int64)timestamp), accuracy)); - }; - - int error = Interop.SensorListener.SetAccuracyCallback(ListenerHandle, _accuracyCallback, IntPtr.Zero); - if (error != (int)SensorError.None) - { - Log.Error(Globals.LogTag, "Error setting accuracy event callback for gravity sensor"); - throw SensorErrorFactory.CheckAndThrowException(error, "Unable to set accuracy event callback for gravity"); - } - } - - private void AccuracyListenStop() - { - int error = Interop.SensorListener.UnsetAccuracyCallback(ListenerHandle); - if (error != (int)SensorError.None) - { - Log.Error(Globals.LogTag, "Error unsetting accuracy event callback for gravity sensor"); - throw SensorErrorFactory.CheckAndThrowException(error, "Unable to unset accuracy event callback for gravity"); - } - } - } -} diff --git a/src/Tizen.Sensor/Tizen.Sensor/Plugins/Gyroscope.cs b/src/Tizen.Sensor/Tizen.Sensor/Plugins/Gyroscope.cs deleted file mode 100755 index 2045448be..000000000 --- a/src/Tizen.Sensor/Tizen.Sensor/Plugins/Gyroscope.cs +++ /dev/null @@ -1,153 +0,0 @@ -/* - * 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.Sensor -{ - /// - /// The Gyroscope Sensor class is used for registering callbacks for the gyroscope and getting the gyroscope data. - /// - public sealed class Gyroscope : Sensor - { - private const string GyroscopeKey = "http://tizen.org/feature/sensor.gyroscope"; - - /// - /// Gets the X component of the acceleration. - /// - /// 3 - /// X - public float X { get; private set; } = float.MinValue; - - /// - /// Gets the Y component of the acceleration. - /// - /// 3 - /// Y - public float Y { get; private set; } = float.MinValue; - - /// - /// Gets the Z component of the acceleration. - /// - /// 3 - /// Z - public float Z { get; private set; } = float.MinValue; - - /// - /// Returns true or false based on whether the gyroscope sensor is supported by the device. - /// - /// 3 - /// true if supported; otherwise false. - public static bool IsSupported - { - get - { - Log.Info(Globals.LogTag, "Checking if the Gyroscope sensor is supported"); - return CheckIfSupported(SensorType.Gyroscope, GyroscopeKey); - } - } - - /// - /// Returns the number of the gyroscope sensors available on the device. - /// - /// 3 - /// The count of the gyroscope sensors. - public static int Count - { - get - { - Log.Info(Globals.LogTag, "Getting the count of gyroscope sensors"); - return GetCount(); - } - } - - /// - /// Initializes a new instance of the class. - /// - /// 3 - /// http://tizen.org/feature/sensor.gyroscope - /// Thrown when an invalid argument is used. - /// Thrown when the sensor is not supported. - /// Thrown when the operation is invalid for the current state. - /// - /// Index. Default value for this is 0. Index refers to a particular gyroscope sensor in case of multiple sensors. - /// - public Gyroscope(uint index = 0) : base(index) - { - Log.Info(Globals.LogTag, "Creating Gyroscope object"); - } - - internal override SensorType GetSensorType() - { - return SensorType.Gyroscope; - } - - /// - /// An event handler for storing the callback functions for the event corresponding to the change in the gyroscope sensor data. - /// - /// 3 - - public event EventHandler DataUpdated; - - private static int GetCount() - { - IntPtr list; - int count; - int error = Interop.SensorManager.GetSensorList(SensorType.Gyroscope, out list, out count); - if (error != (int)SensorError.None) - { - Log.Error(Globals.LogTag, "Error getting sensor list for gyroscope"); - count = 0; - } - else - Interop.Libc.Free(list); - return count; - } - - private static Interop.SensorListener.SensorEventCallback _callback; - - internal override void EventListenStart() - { - _callback = (IntPtr sensorHandle, IntPtr eventPtr, IntPtr data) => { - Interop.SensorEventStruct sensorData = Interop.IntPtrToEventStruct(eventPtr); - - TimeSpan = new TimeSpan((Int64)sensorData.timestamp); - X = sensorData.values[0]; - Y = sensorData.values[1]; - Z = sensorData.values[2]; - - DataUpdated?.Invoke(this, new GyroscopeDataUpdatedEventArgs(sensorData.values)); - }; - - int error = Interop.SensorListener.SetEventCallback(ListenerHandle, Interval, _callback, IntPtr.Zero); - if (error != (int)SensorError.None) - { - Log.Error(Globals.LogTag, "Error setting event callback for gyroscope sensor"); - throw SensorErrorFactory.CheckAndThrowException(error, "Unable to set event callback for gyroscope"); - } - } - - internal override void EventListenStop() - { - int error = Interop.SensorListener.UnsetEventCallback(ListenerHandle); - if (error != (int)SensorError.None) - { - Log.Error(Globals.LogTag, "Error unsetting event callback for gyroscope sensor"); - throw SensorErrorFactory.CheckAndThrowException(error, "Unable to unset event callback for gyroscope"); - } - } - } -} diff --git a/src/Tizen.Sensor/Tizen.Sensor/Plugins/GyroscopeRotationVectorSensor.cs b/src/Tizen.Sensor/Tizen.Sensor/Plugins/GyroscopeRotationVectorSensor.cs deleted file mode 100755 index 0ab13a972..000000000 --- a/src/Tizen.Sensor/Tizen.Sensor/Plugins/GyroscopeRotationVectorSensor.cs +++ /dev/null @@ -1,169 +0,0 @@ -/* - * 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.Sensor -{ - /// - /// The GyroscopeRotationVectorSensor class is used for registering callbacks for the gyroscope rotation vector sensor and getting the gyroscope rotation vector data. - /// - public sealed class GyroscopeRotationVectorSensor : Sensor - { - private const string GyroscopeRVKey = "http://tizen.org/feature/sensor.gyroscope_rotation_vector"; - - /// - /// Gets the X component of the gyroscope rotation vector. - /// - /// 3 - /// X - public float X { get; private set; } = float.MinValue; - - /// - /// Gets the Y component of the gyroscope rotation vector. - /// - /// 3 - /// Y - public float Y { get; private set; } = float.MinValue; - - /// - /// Gets the Z component of the gyroscope rotation vector. - /// - /// 3 - /// Z - public float Z { get; private set; } = float.MinValue; - - /// - /// Gets the W component of the gyroscope rotation vector. - /// - /// 3 - /// W - public float W { get; private set; } = float.MinValue; - - /// - /// Gets the accuracy of the gyroscope rotation vector data. - /// - /// 3 - /// Accuracy - public SensorDataAccuracy Accuracy { get; private set; } - - /// - /// Returns true or false based on whether the gyroscope rotation vector sensor is supported by the device. - /// - /// 3 - /// true if supported; otherwise false. - public static bool IsSupported - { - get - { - Log.Info(Globals.LogTag, "Checking if the GyroscopeRotationVectorSensor is supported"); - return CheckIfSupported(SensorType.GyroscopeRotationVectorSensor, GyroscopeRVKey); - } - } - - /// - /// Returns the number of the gyroscope rotation vector sensors available on the device. - /// - /// 3 - /// The count of accelerometer rotation vector sensors. - public static int Count - { - get - { - Log.Info(Globals.LogTag, "Getting the count of gyroscope rotation vector sensors"); - return GetCount(); - } - } - - /// - /// Initializes a new instance of the class. - /// - /// 3 - /// http://tizen.org/feature/sensor.gyroscope_rotation_vector - /// Thrown when an invalid argument is used. - /// Thrown when the sensor is not supported. - /// Thrown when the operation is invalid for the current state. - /// - /// Index. Default value for this is 0. Index refers to a particular gyroscope rotation vector sensor in case of multiple sensors. - /// - public GyroscopeRotationVectorSensor(uint index = 0) : base(index) - { - Log.Info(Globals.LogTag, "Creating GyroscopeRotationVectorSensor object"); - } - - internal override SensorType GetSensorType() - { - return SensorType.GyroscopeRotationVectorSensor; - } - - /// - /// An event handler for storing the callback functions for the event corresponding to the change in the gyroscope rotation vector sensor data. - /// - /// 3 - - public event EventHandler DataUpdated; - - private static int GetCount() - { - IntPtr list; - int count; - int error = Interop.SensorManager.GetSensorList(SensorType.GyroscopeRotationVectorSensor, out list, out count); - if (error != (int)SensorError.None) - { - Log.Error(Globals.LogTag, "Error getting sensor list for gyroscope rotation vector"); - count = 0; - } - else - Interop.Libc.Free(list); - return count; - } - - private static Interop.SensorListener.SensorEventCallback _callback; - - internal override void EventListenStart() - { - _callback = (IntPtr sensorHandle, IntPtr eventPtr, IntPtr data) => { - Interop.SensorEventStruct sensorData = Interop.IntPtrToEventStruct(eventPtr); - - TimeSpan = new TimeSpan((Int64)sensorData.timestamp); - X = sensorData.values[0]; - Y = sensorData.values[1]; - Z = sensorData.values[2]; - W = sensorData.values[3]; - Accuracy = sensorData.accuracy; - - DataUpdated?.Invoke(this, new GyroscopeRotationVectorSensorDataUpdatedEventArgs(sensorData.values, sensorData.accuracy)); - }; - - int error = Interop.SensorListener.SetEventCallback(ListenerHandle, Interval, _callback, IntPtr.Zero); - if (error != (int)SensorError.None) - { - Log.Error(Globals.LogTag, "Error setting event callback for gyroscope rotation vector sensor"); - throw SensorErrorFactory.CheckAndThrowException(error, "Unable to set event callback for gyroscope rotation vector"); - } - } - - internal override void EventListenStop() - { - int error = Interop.SensorListener.UnsetEventCallback(ListenerHandle); - if (error != (int)SensorError.None) - { - Log.Error(Globals.LogTag, "Error unsetting event callback for gyroscope rotation vector sensor"); - throw SensorErrorFactory.CheckAndThrowException(error, "Unable to unset event callback for gyroscope rotation vector"); - } - } - } -} diff --git a/src/Tizen.Sensor/Tizen.Sensor/Plugins/HeartRateMonitor.cs b/src/Tizen.Sensor/Tizen.Sensor/Plugins/HeartRateMonitor.cs deleted file mode 100755 index 330628ceb..000000000 --- a/src/Tizen.Sensor/Tizen.Sensor/Plugins/HeartRateMonitor.cs +++ /dev/null @@ -1,139 +0,0 @@ -/* - * 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.Sensor -{ - /// - /// The HeartRateMonitor class is used for registering callbacks for the heart rate monitor and getting the heart rate data. - /// - public sealed class HeartRateMonitor : Sensor - { - private const string HRMKey = "http://tizen.org/feature/sensor.heart_rate_monitor"; - - /// - /// Gets the value of the heart rate monitor. - /// - /// 3 - /// The heart rate. - public int HeartRate { get; private set; } = int.MinValue; - - /// - /// Returns true or false based on whether the heart rate monitor is supported by the device. - /// - /// 3 - /// true if supported; otherwise false. - public static bool IsSupported - { - get - { - Log.Info(Globals.LogTag, "Checking if the HeartRateMonitor is supported"); - return CheckIfSupported(SensorType.HeartRateMonitor, HRMKey); - } - } - - /// - /// Returns the number of heart rate monitors available on the device. - /// - /// 3 - /// The count of heart rate monitors. - public static int Count - { - get - { - Log.Info(Globals.LogTag, "Getting the count of heart rate monitors"); - return GetCount(); - } - } - - /// - /// Initializes a new instance of the class. - /// - /// 3 - /// http://tizen.org/privilege/healthinfo - /// public - /// http://tizen.org/feature/sensor.heart_rate_monitor - /// Thrown when an invalid argument is used. - /// Thrown when the sensor is not supported. - /// Thrown when the application has no privilege to use the sensor. - /// Thrown when the operation is invalid for the current state. - /// - /// Index. Default value for this is 0. Index refers to a particular heart rate monitor in case of multiple sensors. - /// - public HeartRateMonitor(uint index = 0) : base(index) - { - Log.Info(Globals.LogTag, "Creating HeartRateMonitor object"); - } - - internal override SensorType GetSensorType() - { - return SensorType.HeartRateMonitor; - } - - /// - /// An event handler for storing the callback functions for the event corresponding to the change in the heart rate monitor data. - /// - /// 3 - public event EventHandler DataUpdated; - - private static int GetCount() - { - IntPtr list; - int count; - int error = Interop.SensorManager.GetSensorList(SensorType.HeartRateMonitor, out list, out count); - if (error != (int)SensorError.None) - { - Log.Error(Globals.LogTag, "Error getting sensor list for heart rate"); - count = 0; - } - else - Interop.Libc.Free(list); - return count; - } - - private static Interop.SensorListener.SensorEventCallback _callback; - - internal override void EventListenStart() - { - _callback = (IntPtr sensorHandle, IntPtr eventPtr, IntPtr data) => { - Interop.SensorEventStruct sensorData = Interop.IntPtrToEventStruct(eventPtr); - - TimeSpan = new TimeSpan((Int64)sensorData.timestamp); - HeartRate = (int)sensorData.values[0]; - - DataUpdated?.Invoke(this, new HeartRateMonitorDataUpdatedEventArgs((int)sensorData.values[0])); - }; - - int error = Interop.SensorListener.SetEventCallback(ListenerHandle, Interval, _callback, IntPtr.Zero); - if (error != (int)SensorError.None) - { - Log.Error(Globals.LogTag, "Error setting event callback for heart rate monitor"); - throw SensorErrorFactory.CheckAndThrowException(error, "Unable to set event callback for heart rate"); - } - } - - internal override void EventListenStop() - { - int error = Interop.SensorListener.UnsetEventCallback(ListenerHandle); - if (error != (int)SensorError.None) - { - Log.Error(Globals.LogTag, "Error unsetting event callback for heart rate monitor"); - throw SensorErrorFactory.CheckAndThrowException(error, "Unable to unset event callback for heart rate"); - } - } - } -} diff --git a/src/Tizen.Sensor/Tizen.Sensor/Plugins/HumiditySensor.cs b/src/Tizen.Sensor/Tizen.Sensor/Plugins/HumiditySensor.cs deleted file mode 100755 index d2abaf3ae..000000000 --- a/src/Tizen.Sensor/Tizen.Sensor/Plugins/HumiditySensor.cs +++ /dev/null @@ -1,137 +0,0 @@ -/* - * 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.Sensor -{ - /// - /// The HumiditySensor class is used for registering callbacks for the humidity sensor and getting the humidity data. - /// - public sealed class HumiditySensor : Sensor - { - private const string HumiditySensorKey = "http://tizen.org/feature/sensor.humidity"; - - /// - /// Gets the value of the humidity sensor. - /// - /// 3 - /// Humidity - public float Humidity { get; private set; } = float.MinValue; - - /// - /// Returns true or false based on whether the humidity sensor is supported by the device. - /// - /// 3 - /// true if supported; otherwise false. - public static bool IsSupported - { - get - { - Log.Info(Globals.LogTag, "Checking if the HumiditySensor is supported"); - return CheckIfSupported(SensorType.HumiditySensor, HumiditySensorKey); - } - } - - /// - /// Returns the number of humidity sensors available on the device. - /// - /// 3 - /// The count of humidity sensors. - public static int Count - { - get - { - Log.Info(Globals.LogTag, "Getting the count of humidity sensors"); - return GetCount(); - } - } - - /// - /// Initializes a new instance of the class. - /// - /// 3 - /// http://tizen.org/feature/sensor.humidity - /// Thrown when an invalid argument is used. - /// Thrown when the sensor is not supported. - /// Thrown when the operation is invalid for the current state. - /// - /// Index. Default value for this is 0. Index refers to a particular humidity sensor in case of multiple sensors. - /// - public HumiditySensor(uint index = 0) : base(index) - { - Log.Info(Globals.LogTag, "Creating HumiditySensor object"); - } - - internal override SensorType GetSensorType() - { - return SensorType.HumiditySensor; - } - - /// - /// An event handler for storing the callback functions for the event corresponding to the change in the humidity sensor data. - /// - /// 3 - - public event EventHandler DataUpdated; - - private static int GetCount() - { - IntPtr list; - int count; - int error = Interop.SensorManager.GetSensorList(SensorType.HumiditySensor, out list, out count); - if (error != (int)SensorError.None) - { - Log.Error(Globals.LogTag, "Error getting sensor list for humidity"); - count = 0; - } - else - Interop.Libc.Free(list); - return count; - } - - private static Interop.SensorListener.SensorEventCallback _callback; - - internal override void EventListenStart() - { - _callback = (IntPtr sensorHandle, IntPtr eventPtr, IntPtr data) => { - Interop.SensorEventStruct sensorData = Interop.IntPtrToEventStruct(eventPtr); - - TimeSpan = new TimeSpan((Int64)sensorData.timestamp); - Humidity = sensorData.values[0]; - - DataUpdated?.Invoke(this, new HumiditySensorDataUpdatedEventArgs(sensorData.values[0])); - }; - - int error = Interop.SensorListener.SetEventCallback(ListenerHandle, Interval, _callback, IntPtr.Zero); - if (error != (int)SensorError.None) - { - Log.Error(Globals.LogTag, "Error setting event callback for humidity sensor"); - throw SensorErrorFactory.CheckAndThrowException(error, "Unable to set event callback for humidity"); - } - } - - internal override void EventListenStop() - { - int error = Interop.SensorListener.UnsetEventCallback(ListenerHandle); - if (error != (int)SensorError.None) - { - Log.Error(Globals.LogTag, "Error unsetting event callback for humidity sensor"); - throw SensorErrorFactory.CheckAndThrowException(error, "Unable to unset event callback for humidity"); - } - } - } -} diff --git a/src/Tizen.Sensor/Tizen.Sensor/Plugins/InVehicleActivityDetector.cs b/src/Tizen.Sensor/Tizen.Sensor/Plugins/InVehicleActivityDetector.cs deleted file mode 100755 index 787d2d63e..000000000 --- a/src/Tizen.Sensor/Tizen.Sensor/Plugins/InVehicleActivityDetector.cs +++ /dev/null @@ -1,138 +0,0 @@ -/* - * 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.Sensor -{ - /// - /// The InVehicleActivityDetector class is used for registering callbacks for the in-vehicle activity detector and getting the in-vehicle state. - /// - public sealed class InVehicleActivityDetector : ActivityDetector - { - private const string ActivityDetectorKey = "http://tizen.org/feature/sensor.activity_recognition"; - - /// - /// Gets the state of the in-vehicle activity detector. - /// - /// 3 - /// The in-vehicle state. - public DetectorState InVehicle { get; private set; } = DetectorState.Unknown; - - /// - /// Returns true or false based on whether the in-vehicle activity detector is supported by the device. - /// - /// 3 - /// true if supported; otherwise false. - public static bool IsSupported - { - get - { - Log.Info(Globals.LogTag, "Checking if the in-vehicle activity detector is supported"); - return CheckIfSupported(SensorType.InVehicleActivityDetector, ActivityDetectorKey); - } - } - - /// - /// Returns the number of in-vehicle activity detectors available on the device. - /// - /// 3 - /// The count of in-vehicle activity detectors. - public static int Count - { - get - { - Log.Info(Globals.LogTag, "Getting the count of in-vehicle activity detectors"); - return GetCount(); - } - } - - /// - /// Initializes a new instance of the class. - /// - /// 3 - /// http://tizen.org/feature/sensor.activity_recognition - /// Thrown when an invalid argument is used. - /// Thrown when the sensor is not supported. - /// Thrown when the operation is invalid for the current state. - /// - /// Index. Default value for this is 0. Index refers to a particular in-vehicle activity detector in case of multiple sensors. - /// - public InVehicleActivityDetector(uint index = 0) : base(index) - { - SetAttribute((SensorAttribute)ActivityAttribute, (int)ActivityType.InVehicle); - Log.Info(Globals.LogTag, "Creating in-vehicle activity detector object"); - } - - private static int GetCount() - { - IntPtr list; - int count; - int error = Interop.SensorManager.GetSensorList(SensorType.InVehicleActivityDetector, out list, out count); - if (error != (int)SensorError.None) - { - Log.Error(Globals.LogTag, "Error getting sensor list for in-vehicle activity detector"); - count = 0; - } - else - Interop.Libc.Free(list); - return count; - } - - /// - /// An event handler for storing the callback functions for the event corresponding to the change in the in-vehicle activity detector data. - /// - /// 3 - public event EventHandler DataUpdated; - - private static Interop.SensorListener.SensorEventCallback _callback; - - internal override void EventListenStart() - { - _callback = (IntPtr sensorHandle, IntPtr eventPtr, IntPtr data) => { - Interop.SensorEventStruct sensorData = Interop.IntPtrToEventStruct(eventPtr); - - TimeSpan = new TimeSpan((Int64)sensorData.timestamp); - InVehicle = (DetectorState)sensorData.values[0]; - ActivityAccuracy = (SensorDataAccuracy) sensorData.accuracy; - - DataUpdated?.Invoke(this, new InVehicleActivityDetectorDataUpdatedEventArgs(sensorData.values[0])); - }; - - int error = Interop.SensorListener.SetEventCallback(ListenerHandle, Interval, _callback, IntPtr.Zero); - if (error != (int)SensorError.None) - { - Log.Error(Globals.LogTag, "Error setting event callback for invehicle activity detector"); - throw SensorErrorFactory.CheckAndThrowException(error, "Unable to set event callback for invehicle activity detector"); - } - } - - internal override void EventListenStop() - { - int error = Interop.SensorListener.UnsetEventCallback(ListenerHandle); - if (error != (int)SensorError.None) - { - Log.Error(Globals.LogTag, "Error unsetting event callback for invehicle activity detector"); - throw SensorErrorFactory.CheckAndThrowException(error, "Unable to unset event callback for invehicle activity detector"); - } - } - - internal override SensorType GetSensorType() - { - return SensorType.InVehicleActivityDetector; - } - } -} diff --git a/src/Tizen.Sensor/Tizen.Sensor/Plugins/LightSensor.cs b/src/Tizen.Sensor/Tizen.Sensor/Plugins/LightSensor.cs deleted file mode 100755 index 16d7615b5..000000000 --- a/src/Tizen.Sensor/Tizen.Sensor/Plugins/LightSensor.cs +++ /dev/null @@ -1,137 +0,0 @@ -/* - * 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.Sensor -{ - /// - /// The LightSensor class is used for registering callbacks for the light sensor and getting the light data. - /// - public sealed class LightSensor : Sensor - { - private const string LightSensorKey = "http://tizen.org/feature/sensor.photometer"; - - /// - /// Gets the level of the light. - /// - /// 3 - /// The light level. - public float Level { get; private set; } = float.MinValue; - - /// - /// Returns true or false based on whether the light sensor is supported by the device. - /// - /// 3 - /// true if supported; otherwise false. - public static bool IsSupported - { - get - { - Log.Info(Globals.LogTag, "Checking if the LightSensor is supported"); - return CheckIfSupported(SensorType.LightSensor, LightSensorKey); - } - } - - /// - /// Returns the number of light sensors available on the device. - /// - /// 3 - /// The count of light sensors. - public static int Count - { - get - { - Log.Info(Globals.LogTag, "Getting the count of light sensors"); - return GetCount(); - } - } - - /// - /// Initializes a new instance of the class. - /// - /// 3 - /// http://tizen.org/feature/sensor.photometer - /// Thrown when an invalid argument is used. - /// Thrown when the sensor is not supported. - /// Thrown when the operation is invalid for the current state. - /// - /// Index. Default value for this is 0. Index refers to a particular light sensor in case of multiple sensors. - /// - public LightSensor(uint index = 0) : base(index) - { - Log.Info(Globals.LogTag, "Creating LightSensor object"); - } - - internal override SensorType GetSensorType() - { - return SensorType.LightSensor; - } - - /// - /// An event handler for storing the callback functions for the event corresponding to the change in the light sensor data. - /// - /// 3 - - public event EventHandler DataUpdated; - - private static int GetCount() - { - IntPtr list; - int count; - int error = Interop.SensorManager.GetSensorList(SensorType.LightSensor, out list, out count); - if (error != (int)SensorError.None) - { - Log.Error(Globals.LogTag, "Error getting sensor list for light"); - count = 0; - } - else - Interop.Libc.Free(list); - return count; - } - - private static Interop.SensorListener.SensorEventCallback _callback; - - internal override void EventListenStart() - { - _callback = (IntPtr sensorHandle, IntPtr eventPtr, IntPtr data) => { - Interop.SensorEventStruct sensorData = Interop.IntPtrToEventStruct(eventPtr); - - TimeSpan = new TimeSpan((Int64)sensorData.timestamp); - Level = sensorData.values[0]; - - DataUpdated?.Invoke(this, new LightSensorDataUpdatedEventArgs(sensorData.values[0])); - }; - - int error = Interop.SensorListener.SetEventCallback(ListenerHandle, Interval, _callback, IntPtr.Zero); - if (error != (int)SensorError.None) - { - Log.Error(Globals.LogTag, "Error setting event callback for light sensor"); - throw SensorErrorFactory.CheckAndThrowException(error, "Unable to set event callback for light"); - } - } - - internal override void EventListenStop() - { - int error = Interop.SensorListener.UnsetEventCallback(ListenerHandle); - if (error != (int)SensorError.None) - { - Log.Error(Globals.LogTag, "Error unsetting event callback for light sensor"); - throw SensorErrorFactory.CheckAndThrowException(error, "Unable to unset event callback for light"); - } - } - } -} diff --git a/src/Tizen.Sensor/Tizen.Sensor/Plugins/LinearAccelerationSensor.cs b/src/Tizen.Sensor/Tizen.Sensor/Plugins/LinearAccelerationSensor.cs deleted file mode 100755 index b75a2de3e..000000000 --- a/src/Tizen.Sensor/Tizen.Sensor/Plugins/LinearAccelerationSensor.cs +++ /dev/null @@ -1,205 +0,0 @@ -/* - * 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.Sensor -{ - /// - /// The LinearAccelerationSensor class is used for registering callbacks for the linear acceleration sensor and getting the linear acceleration data. - /// - public sealed class LinearAccelerationSensor : Sensor - { - private const string LinearAccelerationSensorKey = "http://tizen.org/feature/sensor.linear_acceleration"; - - private event EventHandler _accuracyChanged; - /// - /// Gets the X component of the linear acceleration. - /// - /// 3 - /// X - public float X { get; private set; } = float.MinValue; - - /// - /// Gets the Y component of the linear acceleration. - /// - /// 3 - /// Y - public float Y { get; private set; } = float.MinValue; - - /// - /// Gets the Z component of the linear acceleration. - /// - /// 3 - /// Z - public float Z { get; private set; } = float.MinValue; - - /// - /// Returns true or false based on whether the linear acceleration sensor is supported by the device. - /// - /// 3 - /// true if supported; otherwise false. - public static bool IsSupported - { - get - { - Log.Info(Globals.LogTag, "Checking if the LinearAccelerationSensor is supported"); - return CheckIfSupported(SensorType.LinearAccelerationSensor, LinearAccelerationSensorKey); - } - } - - /// - /// Returns the number of linear acceleration sensors available on the device. - /// - /// 3 - /// The count of linear acceleration sensors. - public static int Count - { - get - { - Log.Info(Globals.LogTag, "Getting the count of linear acceleration sensors"); - return GetCount(); - } - } - - /// - /// Initializes a new instance of the class. - /// - /// 3 - /// http://tizen.org/feature/sensor.linear_acceleration - /// Thrown when an invalid argument is used. - /// Thrown when the sensor is not supported. - /// Thrown when the operation is invalid for the current state. - /// - /// Index. Default value for this is 0. Index refers to a particular linear acceleration sensor in case of multiple sensors. - /// - public LinearAccelerationSensor(uint index = 0) : base(index) - { - Log.Info(Globals.LogTag, "Creating LinearAccelerationSensor object"); - } - - internal override SensorType GetSensorType() - { - return SensorType.LinearAccelerationSensor; - } - - /// - /// An event handler for storing the callback functions for the event corresponding to the change in the linear acceleration sensor data. - /// - /// 3 - - public event EventHandler DataUpdated; - - /// - /// An event handler for accuracy changed events. - /// - /// 3 - public event EventHandler AccuracyChanged - { - add - { - if (_accuracyChanged == null) - { - AccuracyListenStart(); - } - _accuracyChanged += value; - } - remove - { - _accuracyChanged -= value; - if (_accuracyChanged == null) - { - AccuracyListenStop(); - } - } - } - - private static int GetCount() - { - IntPtr list; - int count; - int error = Interop.SensorManager.GetSensorList(SensorType.LinearAccelerationSensor, out list, out count); - if (error != (int)SensorError.None) - { - Log.Error(Globals.LogTag, "Error getting sensor list for linear acceleration sensor"); - count = 0; - } - else - Interop.Libc.Free(list); - return count; - } - - private static Interop.SensorListener.SensorEventCallback _callback; - - internal override void EventListenStart() - { - _callback = (IntPtr sensorHandle, IntPtr eventPtr, IntPtr data) => { - Interop.SensorEventStruct sensorData = Interop.IntPtrToEventStruct(eventPtr); - - TimeSpan = new TimeSpan((Int64)sensorData.timestamp); - X = sensorData.values[0]; - Y = sensorData.values[1]; - Z = sensorData.values[2]; - - DataUpdated?.Invoke(this, new LinearAccelerationSensorDataUpdatedEventArgs(sensorData.values)); - }; - - int error = Interop.SensorListener.SetEventCallback(ListenerHandle, Interval, _callback, IntPtr.Zero); - if (error != (int)SensorError.None) - { - Log.Error(Globals.LogTag, "Error setting event callback for linear acceleration sensor"); - throw SensorErrorFactory.CheckAndThrowException(error, "Unable to set event callback for linear acceleration sensor"); - } - } - - internal override void EventListenStop() - { - int error = Interop.SensorListener.UnsetEventCallback(ListenerHandle); - if (error != (int)SensorError.None) - { - Log.Error(Globals.LogTag, "Error unsetting event callback for linear acceleration sensor"); - throw SensorErrorFactory.CheckAndThrowException(error, "Unable to unset event callback for linear acceleration"); - } - } - - private static Interop.SensorListener.SensorAccuracyCallback _accuracyCallback; - - private void AccuracyListenStart() - { - _accuracyCallback = (IntPtr sensorHandle, UInt64 timestamp, SensorDataAccuracy accuracy, IntPtr data) => { - TimeSpan = new TimeSpan((Int64)timestamp); - _accuracyChanged?.Invoke(this, new SensorAccuracyChangedEventArgs(new TimeSpan((Int64)timestamp), accuracy)); - }; - - int error = Interop.SensorListener.SetAccuracyCallback(ListenerHandle, _accuracyCallback, IntPtr.Zero); - if (error != (int)SensorError.None) - { - Log.Error(Globals.LogTag, "Error setting accuracy event callback for linear acceleration sensor"); - throw SensorErrorFactory.CheckAndThrowException(error, "Unable to set accuracy event callback for linear acceleration sensor"); - } - } - - private void AccuracyListenStop() - { - int error = Interop.SensorListener.UnsetAccuracyCallback(ListenerHandle); - if (error != (int)SensorError.None) - { - Log.Error(Globals.LogTag, "Error unsetting accuracy event callback for linear acceleration sensor"); - throw SensorErrorFactory.CheckAndThrowException(error, "Unable to unset accuracy event callback for linear acceleration sensor"); - } - } - } -} diff --git a/src/Tizen.Sensor/Tizen.Sensor/Plugins/Magnetometer.cs b/src/Tizen.Sensor/Tizen.Sensor/Plugins/Magnetometer.cs deleted file mode 100755 index 9845eaeb8..000000000 --- a/src/Tizen.Sensor/Tizen.Sensor/Plugins/Magnetometer.cs +++ /dev/null @@ -1,205 +0,0 @@ -/* - * 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.Sensor -{ - /// - /// The Magnetometer class is used for registering callbacks for the magnetometer and getting the magnetometer data. - /// - public sealed class Magnetometer : Sensor - { - private static string MagnetometerKey = "http://tizen.org/feature/sensor.magnetometer"; - - private event EventHandler _accuracyChanged; - /// - /// Gets the X component of the magnetometer. - /// - /// 3 - /// X - public float X { get; private set; } = float.MinValue; - - /// - /// Gets the Y component of the magnetometer. - /// - /// 3 - /// Y - public float Y { get; private set; } = float.MinValue; - - /// - /// Gets the Z component of the magnetometer. - /// - /// 3 - /// Z - public float Z { get; private set; } = float.MinValue; - - /// - /// Returns true or false based on whether magnetometer is supported by the device. - /// - /// 3 - /// true if supported; otherwise false. - public static bool IsSupported - { - get - { - Log.Info(Globals.LogTag, "Checking if the Magnetometer is supported"); - return CheckIfSupported(SensorType.Magnetometer, MagnetometerKey); - } - } - - /// - /// Returns the number of magnetometers available on the device. - /// - /// 3 - /// The count of magnetometers. - public static int Count - { - get - { - Log.Info(Globals.LogTag, "Getting the count of magnetometers"); - return GetCount(); - } - } - - /// - /// Initializes a new instance of the class. - /// - /// 3 - /// http://tizen.org/feature/sensor.magnetometer - /// Thrown when an invalid argument is used. - /// Thrown when the sensor is not supported. - /// Thrown when the operation is invalid for the current state. - /// - /// Index. Default value for this is 0. Index refers to a particular magnetometer in case of multiple sensors. - /// - public Magnetometer(uint index = 0) : base(index) - { - Log.Info(Globals.LogTag, "Creating Magnetometer object"); - } - - internal override SensorType GetSensorType() - { - return SensorType.Magnetometer; - } - - /// - /// An event handler for storing the callback functions for the event corresponding to the change in the magnetometer data. - /// - /// 3 - - public event EventHandler DataUpdated; - - /// - /// An event handler for accuracy changed events. - /// - /// 3 - public event EventHandler AccuracyChanged - { - add - { - if (_accuracyChanged == null) - { - AccuracyListenStart(); - } - _accuracyChanged += value; - } - remove - { - _accuracyChanged -= value; - if (_accuracyChanged == null) - { - AccuracyListenStop(); - } - } - } - - private static int GetCount() - { - IntPtr list; - int count; - int error = Interop.SensorManager.GetSensorList(SensorType.Magnetometer, out list, out count); - if (error != (int)SensorError.None) - { - Log.Error(Globals.LogTag, "Error getting sensor list for magnetometer"); - count = 0; - } - else - Interop.Libc.Free(list); - return count; - } - - private static Interop.SensorListener.SensorEventCallback _callback; - - internal override void EventListenStart() - { - _callback = (IntPtr sensorHandle, IntPtr eventPtr, IntPtr data) => { - Interop.SensorEventStruct sensorData = Interop.IntPtrToEventStruct(eventPtr); - - TimeSpan = new TimeSpan((Int64)sensorData.timestamp); - X = sensorData.values[0]; - Y = sensorData.values[1]; - Z = sensorData.values[2]; - - DataUpdated?.Invoke(this, new MagnetometerDataUpdatedEventArgs(sensorData.values)); - }; - - int error = Interop.SensorListener.SetEventCallback(ListenerHandle, Interval, _callback, IntPtr.Zero); - if (error != (int)SensorError.None) - { - Log.Error(Globals.LogTag, "Error setting event callback for magnetometer"); - throw SensorErrorFactory.CheckAndThrowException(error, "Unable to set event callback for magnetometer"); - } - } - - internal override void EventListenStop() - { - int error = Interop.SensorListener.UnsetEventCallback(ListenerHandle); - if (error != (int)SensorError.None) - { - Log.Error(Globals.LogTag, "Error unsetting event callback for magnetometer"); - throw SensorErrorFactory.CheckAndThrowException(error, "Unable to unset event callback for magnetometer"); - } - } - - private static Interop.SensorListener.SensorAccuracyCallback _accuracyCallback; - - private void AccuracyListenStart() - { - _accuracyCallback = (IntPtr sensorHandle, UInt64 timestamp, SensorDataAccuracy accuracy, IntPtr data) => { - TimeSpan = new TimeSpan((Int64)timestamp); - _accuracyChanged?.Invoke(this, new SensorAccuracyChangedEventArgs(new TimeSpan((Int64)timestamp), accuracy)); - }; - - int error = Interop.SensorListener.SetAccuracyCallback(ListenerHandle, _accuracyCallback, IntPtr.Zero); - if (error != (int)SensorError.None) - { - Log.Error(Globals.LogTag, "Error setting accuracy event callback for magnetometer"); - throw SensorErrorFactory.CheckAndThrowException(error, "Unable to set accuracy event callback for magnetometer"); - } - } - - private void AccuracyListenStop() - { - int error = Interop.SensorListener.UnsetAccuracyCallback(ListenerHandle); - if (error != (int)SensorError.None) - { - Log.Error(Globals.LogTag, "Error unsetting accuracy event callback for magnetometer"); - throw SensorErrorFactory.CheckAndThrowException(error, "Unable to unset accuracy event callback for magnetometer"); - } - } - } -} diff --git a/src/Tizen.Sensor/Tizen.Sensor/Plugins/MagnetometerRotationVectorSensor.cs b/src/Tizen.Sensor/Tizen.Sensor/Plugins/MagnetometerRotationVectorSensor.cs deleted file mode 100755 index 2a103d3a9..000000000 --- a/src/Tizen.Sensor/Tizen.Sensor/Plugins/MagnetometerRotationVectorSensor.cs +++ /dev/null @@ -1,234 +0,0 @@ -/* - * 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.Sensor -{ - /// - /// The MagnetometerRotationVectorSensor class is used for registering callbacks for the magnetometer rotation vector sensor and getting the magnetometer rotation vector data. - /// - public sealed class MagnetometerRotationVectorSensor : Sensor - { - private static string MagnetometerRVKey = "http://tizen.org/feature/sensor.geomagnetic_rotation_vector"; - - private event EventHandler _accuracyChanged; - /// - /// Gets the X component of the magnetometer rotation vector. - /// - /// 3 - /// X - public float X { get; private set; } = float.MinValue; - - /// - /// Gets the Y component of the magnetometer rotation vector. - /// - /// 3 - /// Y - public float Y { get; private set; } = float.MinValue; - - /// - /// Gets the Z component of the magnetometer rotation vector. - /// - /// 3 - /// Z - public float Z { get; private set; } = float.MinValue; - - /// - /// Gets the W component of the magnetometer rotation vector. - /// - /// 3 - /// W - public float W { get; private set; } = float.MinValue; - - /// - /// Gets the accuracy of the magnetometer rotation vector data. - /// - /// 3 - /// Accuracy - public SensorDataAccuracy Accuracy { get; private set; } - - /// - /// Returns true or false based on whether the magnetometer rotation vector sensor is supported by the device. - /// - /// 3 - /// true if supported; otherwise false. - public static bool IsSupported - { - get - { - Log.Info(Globals.LogTag, "Checking if the MagnetometerRotationVectorSensor is supported"); - return CheckIfSupported(SensorType.MagnetometerRotationVectorSensor, MagnetometerRVKey); - } - } - - /// - /// Returns the number of magnetometer rotation vector sensors available on the device. - /// - /// 3 - /// The count of magnetometer rotation vector sensors. - public static int Count - { - get - { - Log.Info(Globals.LogTag, "Getting the count of magnetometer rotation vector sensors"); - return GetCount(); - } - } - - /// - /// Initializes a new instance of the class. - /// - /// 3 - /// http://tizen.org/feature/sensor.geomagnetic_rotation_vector - /// Thrown when an invalid argument is used. - /// Thrown when the sensor is not supported. - /// Thrown when the operation is invalid for the current state. - /// - /// Index. Default value for this is 0. Index refers to a particular magnetometer rotation vector sensor in case of multiple sensors. - /// - public MagnetometerRotationVectorSensor(uint index = 0) : base(index) - { - Log.Info(Globals.LogTag, "Creating MagnetometerRotationVectorSensor object"); - } - - internal override SensorType GetSensorType() - { - return SensorType.MagnetometerRotationVectorSensor; - } - - /// - /// An event handler for storing the callback functions for the event corresponding to the change in the magnetometer rotation vector sensor data. - /// - /// 3 - - public event EventHandler DataUpdated; - - /// - /// An event handler for accuracy changed events. - /// - /// 3 - public event EventHandler AccuracyChanged - { - add - { - if (_accuracyChanged == null) - { - AccuracyListenStart(); - } - _accuracyChanged += value; - } - remove - { - _accuracyChanged -= value; - if (_accuracyChanged == null) - { - AccuracyListenStop(); - } - } - } - - private static bool CheckIfSupported() - { - bool isSupported; - int error = Interop.SensorManager.SensorIsSupported(SensorType.MagnetometerRotationVectorSensor, out isSupported); - if (error != (int)SensorError.None) - { - Log.Error(Globals.LogTag, "Error checking if magnetometer rotation vector sensor is supported"); - isSupported = false; - } - return isSupported; - } - - private static int GetCount() - { - IntPtr list; - int count; - int error = Interop.SensorManager.GetSensorList(SensorType.MagnetometerRotationVectorSensor, out list, out count); - if (error != (int)SensorError.None) - { - Log.Error(Globals.LogTag, "Error getting sensor list for magnetometer rotation vector"); - count = 0; - } - else - Interop.Libc.Free(list); - return count; - } - - private static Interop.SensorListener.SensorEventCallback _callback; - - internal override void EventListenStart() - { - _callback = (IntPtr sensorHandle, IntPtr eventPtr, IntPtr data) => { - Interop.SensorEventStruct sensorData = Interop.IntPtrToEventStruct(eventPtr); - - TimeSpan = new TimeSpan((Int64)sensorData.timestamp); - X = sensorData.values[0]; - Y = sensorData.values[1]; - Z = sensorData.values[2]; - W = sensorData.values[3]; - Accuracy = sensorData.accuracy; - - DataUpdated?.Invoke(this, new MagnetometerRotationVectorSensorDataUpdatedEventArgs(sensorData.values, sensorData.accuracy)); - }; - - int error = Interop.SensorListener.SetEventCallback(ListenerHandle, Interval, _callback, IntPtr.Zero); - if (error != (int)SensorError.None) - { - Log.Error(Globals.LogTag, "Error setting event callback for magnetometer rotation vector sensor"); - throw SensorErrorFactory.CheckAndThrowException(error, "Unable to set event callback for magnetometer rotation vector"); - } - } - - internal override void EventListenStop() - { - int error = Interop.SensorListener.UnsetEventCallback(ListenerHandle); - if (error != (int)SensorError.None) - { - Log.Error(Globals.LogTag, "Error unsetting event callback for magnetometer rotation vector sensor"); - throw SensorErrorFactory.CheckAndThrowException(error, "Unable to unset event callback for magnetometer rotation vector"); - } - } - - private static Interop.SensorListener.SensorAccuracyCallback _accuracyCallback; - - private void AccuracyListenStart() - { - _accuracyCallback = (IntPtr sensorHandle, UInt64 timestamp, SensorDataAccuracy accuracy, IntPtr data) => { - TimeSpan = new TimeSpan((Int64)timestamp); - Accuracy = accuracy; - _accuracyChanged?.Invoke(this, new SensorAccuracyChangedEventArgs(new TimeSpan((Int64)timestamp), accuracy)); - }; - - int error = Interop.SensorListener.SetAccuracyCallback(ListenerHandle, _accuracyCallback, IntPtr.Zero); - if (error != (int)SensorError.None) - { - Log.Error(Globals.LogTag, "Error setting accuracy event callback for magnetometer rotation vector sensor"); - throw SensorErrorFactory.CheckAndThrowException(error, "Unable to set accuracy event callback for magnetometer rotation vector"); - } - } - - private void AccuracyListenStop() - { - int error = Interop.SensorListener.UnsetAccuracyCallback(ListenerHandle); - if (error != (int)SensorError.None) - { - Log.Error(Globals.LogTag, "Error unsetting accuracy event callback for magnetometer rotation vector sensor"); - throw SensorErrorFactory.CheckAndThrowException(error, "Unable to unset accuracy event callback for magnetometer rotation vector"); - } - } - } -} diff --git a/src/Tizen.Sensor/Tizen.Sensor/Plugins/OrientationSensor.cs b/src/Tizen.Sensor/Tizen.Sensor/Plugins/OrientationSensor.cs deleted file mode 100755 index de58ddc10..000000000 --- a/src/Tizen.Sensor/Tizen.Sensor/Plugins/OrientationSensor.cs +++ /dev/null @@ -1,205 +0,0 @@ -/* - * 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.Sensor -{ - /// - /// The OrientationSensor class is used for registering callbacks for the orientation sensor and getting the orientation data. - /// - public sealed class OrientationSensor : Sensor - { - private static string OrientationSensorKey = "http://tizen.org/feature/sensor.tiltmeter"; - - private event EventHandler _accuracyChanged; - /// - /// Gets the azimuth component of the orientation. - /// - /// 3 - /// Azimuth - public float Azimuth { get; private set; } = float.MinValue; - - /// - /// Gets the pitch component of the orientation. - /// - /// 3 - /// Pitch - public float Pitch { get; private set; } = float.MinValue; - - /// - /// Gets the roll component of the orientation. - /// - /// 3 - /// Roll - public float Roll { get; private set; } = float.MinValue; - - /// - /// Returns true or false based on whether the orientation sensor is supported by the device. - /// - /// 3 - /// true if supported; otherwise false. - public static bool IsSupported - { - get - { - Log.Info(Globals.LogTag, "Checking if the OrientationSensor is supported"); - return CheckIfSupported(SensorType.OrientationSensor, OrientationSensorKey); - } - } - - /// - /// Returns the number of orientation sensors available on the device. - /// - /// 3 - /// The count of orientation sensors. - public static int Count - { - get - { - Log.Info(Globals.LogTag, "Getting the count of orientation sensors"); - return GetCount(); - } - } - - /// - /// Initializes a new instance of the class. - /// - /// 3 - /// http://tizen.org/feature/sensor.tiltmeter - /// Thrown when an invalid argument is used. - /// Thrown when the sensor is not supported. - /// Thrown when the operation is invalid for the current state. - /// - /// Index. Default value for this is 0. Index refers to a particular orientation sensor in case of multiple sensors. - /// - public OrientationSensor(uint index = 0) : base(index) - { - Log.Info(Globals.LogTag, "Creating OrientationSensor object"); - } - - internal override SensorType GetSensorType() - { - return SensorType.OrientationSensor; - } - - /// - /// An event handler for storing the callback functions for the event corresponding to the change in the orientation sensor data. - /// - /// 3 - - public event EventHandler DataUpdated; - - /// - /// An event handler for accuracy changed events. - /// - /// 3 - public event EventHandler AccuracyChanged - { - add - { - if (_accuracyChanged == null) - { - AccuracyListenStart(); - } - _accuracyChanged += value; - } - remove - { - _accuracyChanged -= value; - if (_accuracyChanged == null) - { - AccuracyListenStop(); - } - } - } - - private static int GetCount() - { - IntPtr list; - int count; - int error = Interop.SensorManager.GetSensorList(SensorType.OrientationSensor, out list, out count); - if (error != (int)SensorError.None) - { - Log.Error(Globals.LogTag, "Error getting sensor list for orientation"); - count = 0; - } - else - Interop.Libc.Free(list); - return count; - } - - private static Interop.SensorListener.SensorEventCallback _callback; - - internal override void EventListenStart() - { - _callback = (IntPtr sensorHandle, IntPtr eventPtr, IntPtr data) => { - Interop.SensorEventStruct sensorData = Interop.IntPtrToEventStruct(eventPtr); - - TimeSpan = new TimeSpan((Int64)sensorData.timestamp); - Azimuth = sensorData.values[0]; - Pitch = sensorData.values[1]; - Roll = sensorData.values[2]; - - DataUpdated?.Invoke(this, new OrientationSensorDataUpdatedEventArgs(sensorData.values)); - }; - - int error = Interop.SensorListener.SetEventCallback(ListenerHandle, Interval, _callback, IntPtr.Zero); - if (error != (int)SensorError.None) - { - Log.Error(Globals.LogTag, "Error setting event callback for orientation sensor"); - throw SensorErrorFactory.CheckAndThrowException(error, "Unable to set event callback for orientation"); - } - } - - internal override void EventListenStop() - { - int error = Interop.SensorListener.UnsetEventCallback(ListenerHandle); - if (error != (int)SensorError.None) - { - Log.Error(Globals.LogTag, "Error unsetting event callback for orientation sensor"); - throw SensorErrorFactory.CheckAndThrowException(error, "Unable to unset event callback for orientation"); - } - } - - private static Interop.SensorListener.SensorAccuracyCallback _accuracyCallback; - - private void AccuracyListenStart() - { - _accuracyCallback = (IntPtr sensorHandle, UInt64 timestamp, SensorDataAccuracy accuracy, IntPtr data) => { - TimeSpan = new TimeSpan((Int64)timestamp); - _accuracyChanged?.Invoke(this, new SensorAccuracyChangedEventArgs(new TimeSpan((Int64)timestamp), accuracy)); - }; - - int error = Interop.SensorListener.SetAccuracyCallback(ListenerHandle, _accuracyCallback, IntPtr.Zero); - if (error != (int)SensorError.None) - { - Log.Error(Globals.LogTag, "Error setting accuracy event callback for orientation sensor"); - throw SensorErrorFactory.CheckAndThrowException(error, "Unable to set accuracy accuracy event callback for orientation"); - } - } - - private void AccuracyListenStop() - { - int error = Interop.SensorListener.UnsetAccuracyCallback(ListenerHandle); - if (error != (int)SensorError.None) - { - Log.Error(Globals.LogTag, "Error unsetting event callback for orientation sensor"); - throw SensorErrorFactory.CheckAndThrowException(error, "Unable to unset accuracy event callback for orientation"); - } - } - } -} diff --git a/src/Tizen.Sensor/Tizen.Sensor/Plugins/Pedometer.cs b/src/Tizen.Sensor/Tizen.Sensor/Plugins/Pedometer.cs deleted file mode 100755 index 4c9c50280..000000000 --- a/src/Tizen.Sensor/Tizen.Sensor/Plugins/Pedometer.cs +++ /dev/null @@ -1,196 +0,0 @@ -/* - * 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.Sensor -{ - /// - /// The Pedometer Sensor class is used for registering callbacks for the pedometer and getting the pedometer data. - /// - public sealed class Pedometer : Sensor - { - private static string PedometerKey = "http://tizen.org/feature/sensor.pedometer"; - - /// - /// Gets the step count. - /// - /// 3 - /// The step count. - public uint StepCount { get; private set; } = 0; - - /// - /// Gets the walking step count. - /// - /// 3 - /// The walk step count. - public uint WalkStepCount { get; private set; } = 0; - - /// - /// Gets the running step count. - /// - /// 3 - /// The run step count. - public uint RunStepCount { get; private set; } = 0; - - /// - /// Gets the moving distance. - /// - /// 3 - /// The moving distance. - public float MovingDistance { get; private set; } = 0; - - /// - /// Gets the calorie burned. - /// - /// 3 - /// The calorie burned. - public float CalorieBurned { get; private set; } = 0; - - /// - /// Gets the last speed. - /// - /// 3 - /// The last speed. - public float LastSpeed { get; private set; } = 0; - - /// - /// Gets the last stepping frequency. - /// - /// 3 - /// The last stepping frequency. - public float LastSteppingFrequency { get; private set; } = 0; - - /// - /// Gets the last step status. - /// - /// 3 - /// The last step status. - public PedometerState LastStepStatus { get; private set; } = PedometerState.Unknown; - - /// - /// Returns true or false based on whether the pedometer sensor is supported by the device. - /// - /// 3 - /// true if supported; otherwise false. - public static bool IsSupported - { - get - { - Log.Info(Globals.LogTag, "Checking if the Pedometer sensor is supported"); - return CheckIfSupported(SensorType.Pedometer, PedometerKey); - } - } - - /// - /// Returns the number of pedometer sensors available on the device. - /// - /// 3 - /// The count of pedometer sensors. - public static int Count - { - get - { - Log.Info(Globals.LogTag, "Getting the count of pedometer sensors"); - return GetCount(); - } - } - - /// - /// Initializes a new instance of the class. - /// - /// 3 - /// http://tizen.org/privilege/healthinfo - /// public - /// http://tizen.org/feature/sensor.pedometer - /// Thrown when an invalid argument is used. - /// Thrown when the sensor is not supported. - /// Thrown when the application has no privilege to use the sensor. - /// Thrown when the operation is invalid for the current state. - /// - /// Index. Default value for this is 0. Index refers to a particular pedometer sensor in case of multiple sensors. - /// - public Pedometer(uint index = 0) : base(index) - { - Log.Info(Globals.LogTag, "Creating Pedometer object"); - } - - internal override SensorType GetSensorType() - { - return SensorType.Pedometer; - } - - /// - /// An event handler for storing the callback functions for the event corresponding to the change in the pedometer sensor data. - /// - /// 3 - - public event EventHandler DataUpdated; - - private static int GetCount() - { - IntPtr list; - int count; - int error = Interop.SensorManager.GetSensorList(SensorType.Pedometer, out list, out count); - if (error != (int)SensorError.None) - { - Log.Error(Globals.LogTag, "Error getting sensor list for pedometer"); - count = 0; - } - else - Interop.Libc.Free(list); - return count; - } - - private static Interop.SensorListener.SensorEventCallback _callback; - - internal override void EventListenStart() - { - _callback = (IntPtr sensorHandle, IntPtr eventPtr, IntPtr data) => { - Interop.SensorEventStruct sensorData = Interop.IntPtrToEventStruct(eventPtr); - - TimeSpan = new TimeSpan((Int64)sensorData.timestamp); - StepCount = (uint)sensorData.values[0]; - WalkStepCount = (uint)sensorData.values[1]; - RunStepCount = (uint)sensorData.values[2]; - MovingDistance = sensorData.values[3]; - CalorieBurned = sensorData.values[4]; - LastSpeed = sensorData.values[5]; - LastSteppingFrequency = sensorData.values[6]; - LastStepStatus = (PedometerState)sensorData.values[7]; - - DataUpdated?.Invoke(this, new PedometerDataUpdatedEventArgs(sensorData.values)); - }; - - int error = Interop.SensorListener.SetEventCallback(ListenerHandle, Interval, _callback, IntPtr.Zero); - if (error != (int)SensorError.None) - { - Log.Error(Globals.LogTag, "Error setting event callback for pedometer sensor"); - throw SensorErrorFactory.CheckAndThrowException(error, "Unable to set event callback for pedometer"); - } - } - - internal override void EventListenStop() - { - int error = Interop.SensorListener.UnsetEventCallback(ListenerHandle); - if (error != (int)SensorError.None) - { - Log.Error(Globals.LogTag, "Error unsetting event callback for pedometer sensor"); - throw SensorErrorFactory.CheckAndThrowException(error, "Unable to unset event callback for pedometer"); - } - } - } -} diff --git a/src/Tizen.Sensor/Tizen.Sensor/Plugins/PickUpGestureDetector.cs b/src/Tizen.Sensor/Tizen.Sensor/Plugins/PickUpGestureDetector.cs deleted file mode 100755 index 115afc108..000000000 --- a/src/Tizen.Sensor/Tizen.Sensor/Plugins/PickUpGestureDetector.cs +++ /dev/null @@ -1,148 +0,0 @@ -/* - * 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.Sensor -{ - /// - /// The PickUpGestureDetector class is used for registering callbacks for the pick up activity detector and getting the pick up state. - /// - public sealed class PickUpGestureDetector : Sensor - { - private static string GestureDetectorKey = "http://tizen.org/feature/sensor.gesture_recognition"; - - /// - /// Gets the state of the pick up gesture. - /// - /// 3 - /// The pick up state. - public DetectorState PickUp { get; private set; } = DetectorState.Unknown; - - /// - /// Returns true or false based on whether the pick up gesture detector is supported by the device. - /// - /// 3 - /// true if supported; otherwise false. - public static bool IsSupported - { - get - { - Log.Info(Globals.LogTag, "Checking if the pick up gesture detector is supported"); - return CheckIfSupported(SensorType.PickUpGestureDetector, GestureDetectorKey); - } - } - - /// - /// Returns the number of pick up gesture detectors available on the device. - /// - /// 3 - /// The count of pick up gesture detectors. - public static int Count - { - get - { - Log.Info(Globals.LogTag, "Getting the count of pick up gesture detectors"); - return GetCount(); - } - } - - /// - /// Initializes a new instance of the class. - /// - /// 3 - /// http://tizen.org/feature/sensor.gesture_recognition - /// Thrown when an invalid argument is used. - /// Thrown when the sensor is not supported. - /// Thrown when the operation is invalid for the current state. - /// - /// Index. Default value for this is 0. Index refers to a particular pick up gesture detector in case of multiple sensors. - /// - public PickUpGestureDetector(uint index = 0) : base(index) - { - Log.Info(Globals.LogTag, "Creating pick up gesture detector object"); - } - - internal override SensorType GetSensorType() - { - return SensorType.PickUpGestureDetector; - } - - private static bool CheckIfSupported() - { - bool isSupported; - int error = Interop.SensorManager.SensorIsSupported(SensorType.PickUpGestureDetector, out isSupported); - if (error != (int)SensorError.None) - { - Log.Error(Globals.LogTag, "Error checking if pick up gesture detector is supported"); - isSupported = false; - } - return isSupported; - } - - private static int GetCount() - { - IntPtr list; - int count; - int error = Interop.SensorManager.GetSensorList(SensorType.PickUpGestureDetector, out list, out count); - if (error != (int)SensorError.None) - { - Log.Error(Globals.LogTag, "Error getting sensor list for pick up gesture detector"); - count = 0; - } - else - Interop.Libc.Free(list); - return count; - } - - /// - /// An event handler for storing the callback functions for the event corresponding to the change in the pick up gesture detector data. - /// - /// 3 - public event EventHandler DataUpdated; - - private static Interop.SensorListener.SensorEventCallback _callback; - - internal override void EventListenStart() - { - _callback = (IntPtr sensorHandle, IntPtr eventPtr, IntPtr data) => { - Interop.SensorEventStruct sensorData = Interop.IntPtrToEventStruct(eventPtr); - - TimeSpan = new TimeSpan((Int64)sensorData.timestamp); - PickUp = (DetectorState) sensorData.values[0]; - - DataUpdated?.Invoke(this, new PickUpGestureDetectorDataUpdatedEventArgs(sensorData.values[0])); - }; - - int error = Interop.SensorListener.SetEventCallback(ListenerHandle, Interval, _callback, IntPtr.Zero); - if (error != (int)SensorError.None) - { - Log.Error(Globals.LogTag, "Error setting event callback for pick up gesture detector"); - throw SensorErrorFactory.CheckAndThrowException(error, "Unable to set event callback for pick up gesture detector"); - } - } - - internal override void EventListenStop() - { - int error = Interop.SensorListener.UnsetEventCallback(ListenerHandle); - if (error != (int)SensorError.None) - { - Log.Error(Globals.LogTag, "Error unsetting event callback for pick up gesture detector"); - throw SensorErrorFactory.CheckAndThrowException(error, "Unable to unset event callback for pick up gesture detector"); - } - } - } -} diff --git a/src/Tizen.Sensor/Tizen.Sensor/Plugins/PressureSensor.cs b/src/Tizen.Sensor/Tizen.Sensor/Plugins/PressureSensor.cs deleted file mode 100755 index e8fc7eb4b..000000000 --- a/src/Tizen.Sensor/Tizen.Sensor/Plugins/PressureSensor.cs +++ /dev/null @@ -1,138 +0,0 @@ -/* - * 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.Sensor -{ - /// - /// The PressureSensor class is used for registering callbacks for the pressure sensor and getting the pressure data. - /// - public sealed class PressureSensor : Sensor - { - private static string PressureSensorKey = "http://tizen.org/feature/sensor.barometer"; - - /// - /// Gets the value of the pressure sensor. - /// - /// 3 - /// Pressure - public float Pressure { get; private set; } = float.MinValue; - - /// - /// Returns true or false based on whether the pressure sensor is supported by the device. - /// - /// 3 - /// true if supported; otherwise false. - public static bool IsSupported - { - get - { - Log.Info(Globals.LogTag, "Checking if the PressureSensor is supported"); - return CheckIfSupported(SensorType.PressureSensor, PressureSensorKey); - } - } - - /// - /// Returns the number of pressure sensors available on the device. - /// - /// 3 - /// The count of pressure sensors. - public static int Count - { - get - { - Log.Info(Globals.LogTag, "Getting the count of pressure sensors"); - return GetCount(); - } - } - - /// - /// Initializes a new instance of the class. - /// - /// 3 - /// http://tizen.org/feature/sensor.barometer - /// Thrown when an invalid argument is used. - /// Thrown when the sensor is not supported. - /// Thrown when the operation is invalid for the current state. - /// - /// Index. Default value for this is 0. Index refers to a particular pressure sensor in case of multiple sensors. - /// - public PressureSensor(uint index = 0) : base(index) - { - Log.Info(Globals.LogTag, "Creating PressureSensor object"); - } - - internal override SensorType GetSensorType() - { - return SensorType.PressureSensor; - } - - /// - /// An event handler for storing the callback functions for the event corresponding to the change in the pressure sensor data. - /// - /// 3 - - public event EventHandler DataUpdated; - - - private static int GetCount() - { - IntPtr list; - int count; - int error = Interop.SensorManager.GetSensorList(SensorType.PressureSensor, out list, out count); - if (error != (int)SensorError.None) - { - Log.Error(Globals.LogTag, "Error getting sensor list for pressure"); - count = 0; - } - else - Interop.Libc.Free(list); - return count; - } - - private static Interop.SensorListener.SensorEventCallback _callback; - - internal override void EventListenStart() - { - _callback = (IntPtr sensorHandle, IntPtr eventPtr, IntPtr data) => { - Interop.SensorEventStruct sensorData = Interop.IntPtrToEventStruct(eventPtr); - - TimeSpan = new TimeSpan((Int64)sensorData.timestamp); - Pressure = sensorData.values[0]; - - DataUpdated?.Invoke(this, new PressureSensorDataUpdatedEventArgs(sensorData.values[0])); - }; - - int error = Interop.SensorListener.SetEventCallback(ListenerHandle, Interval, _callback, IntPtr.Zero); - if (error != (int)SensorError.None) - { - Log.Error(Globals.LogTag, "Error setting event callback for pressure sensor"); - throw SensorErrorFactory.CheckAndThrowException(error, "Unable to set event callback for pressure"); - } - } - - internal override void EventListenStop() - { - int error = Interop.SensorListener.UnsetEventCallback(ListenerHandle); - if (error != (int)SensorError.None) - { - Log.Error(Globals.LogTag, "Error unsetting event callback for pressure sensor"); - throw SensorErrorFactory.CheckAndThrowException(error, "Unable to unset event callback for pressure"); - } - } - } -} diff --git a/src/Tizen.Sensor/Tizen.Sensor/Plugins/ProximitySensor.cs b/src/Tizen.Sensor/Tizen.Sensor/Plugins/ProximitySensor.cs deleted file mode 100755 index 9d2d8f8b4..000000000 --- a/src/Tizen.Sensor/Tizen.Sensor/Plugins/ProximitySensor.cs +++ /dev/null @@ -1,137 +0,0 @@ -/* - * 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.Sensor -{ - /// - /// The ProximitySensor class is used for registering callbacks for the proximity sensor and getting the proximity data. - /// - public sealed class ProximitySensor : Sensor - { - private static string ProximitySensorKey = "http://tizen.org/feature/sensor.proximity"; - - /// - /// Gets the proximity state. - /// - /// 3 - /// The proximity state. - public ProximitySensorState Proximity { get; private set; } = ProximitySensorState.Unknown; - - /// - /// Returns true or false based on whether the proximity sensor is supported by the device. - /// - /// 3 - /// true if supported; otherwise false. - public static bool IsSupported - { - get - { - Log.Info(Globals.LogTag, "Checking if the ProximitySensor is supported"); - return CheckIfSupported(SensorType.ProximitySensor, ProximitySensorKey); - } - } - - /// - /// Returns the number of proximity sensors available on the device. - /// - /// 3 - /// The count of proximity sensors. - public static int Count - { - get - { - Log.Info(Globals.LogTag, "Getting the count of proximity sensors"); - return GetCount(); - } - } - - /// - /// Initializes a new instance of the class. - /// - /// 3 - /// http://tizen.org/feature/sensor.proximity - /// Thrown when an invalid argument is used. - /// Thrown when the sensor is not supported. - /// Thrown when the operation is invalid for the current state.exception> - /// - /// Index. Default value for this is 0. Index refers to a particular proximity sensor in case of multiple sensors. - /// - public ProximitySensor(uint index = 0) : base(index) - { - Log.Info(Globals.LogTag, "Creating ProximitySensor object"); - } - - internal override SensorType GetSensorType() - { - return SensorType.ProximitySensor; - } - - /// - /// An event handler for storing the callback functions for the event corresponding to the change in the proximity sensor data. - /// - /// 3 - - public event EventHandler DataUpdated; - - private static int GetCount() - { - IntPtr list; - int count; - int error = Interop.SensorManager.GetSensorList(SensorType.ProximitySensor, out list, out count); - if (error != (int)SensorError.None) - { - Log.Error(Globals.LogTag, "Error getting sensor list for proximity"); - count = 0; - } - else - Interop.Libc.Free(list); - return count; - } - - private static Interop.SensorListener.SensorEventCallback _callback; - - internal override void EventListenStart() - { - _callback = (IntPtr sensorHandle, IntPtr eventPtr, IntPtr data) => { - Interop.SensorEventStruct sensorData = Interop.IntPtrToEventStruct(eventPtr); - - TimeSpan = new TimeSpan((Int64)sensorData.timestamp); - Proximity = (ProximitySensorState) sensorData.values[0]; - - DataUpdated?.Invoke(this, new ProximitySensorDataUpdatedEventArgs(sensorData.values[0])); - }; - - int error = Interop.SensorListener.SetEventCallback(ListenerHandle, Interval, _callback, IntPtr.Zero); - if (error != (int)SensorError.None) - { - Log.Error(Globals.LogTag, "Error setting event callback for proximity sensor"); - throw SensorErrorFactory.CheckAndThrowException(error, "Unable to set event callback for proximity"); - } - } - - internal override void EventListenStop() - { - int error = Interop.SensorListener.UnsetEventCallback(ListenerHandle); - if (error != (int)SensorError.None) - { - Log.Error(Globals.LogTag, "Error unsetting event callback for proximity sensor"); - throw SensorErrorFactory.CheckAndThrowException(error, "Unable to unset event callback for proximity"); - } - } - } -} diff --git a/src/Tizen.Sensor/Tizen.Sensor/Plugins/RotationVectorSensor.cs b/src/Tizen.Sensor/Tizen.Sensor/Plugins/RotationVectorSensor.cs deleted file mode 100755 index a07e058ef..000000000 --- a/src/Tizen.Sensor/Tizen.Sensor/Plugins/RotationVectorSensor.cs +++ /dev/null @@ -1,222 +0,0 @@ -/* - * 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.Sensor -{ - /// - /// The RotationVectorSensor class is used for registering callbacks for the rotation vector sensor and getting the rotation vector data. - /// - public sealed class RotationVectorSensor : Sensor - { - private static string RotationVectorKey = "http://tizen.org/feature/sensor.rotation_vector"; - - private event EventHandler _accuracyChanged; - /// - /// Gets the X component of the rotation vector. - /// - /// 3 - /// X - public float X { get; private set; } = float.MinValue; - - /// - /// Gets the Y component of the rotation vector. - /// - /// 3 - /// Y - public float Y { get; private set; } = float.MinValue; - - /// - /// Gets the Z component of the rotation vector. - /// - /// 3 - /// Z - public float Z { get; private set; } = float.MinValue; - - /// - /// Gets the W component of the rotation vector. - /// - /// 3 - /// W - public float W { get; private set; } = float.MinValue; - - /// - /// Gets the accuracy of the rotation vector data. - /// - /// 3 - /// Accuracy - public SensorDataAccuracy Accuracy { get; private set; } = SensorDataAccuracy.Undefined; - - /// - /// Returns true or false based on whether the rotation vector sensor is supported by the device. - /// - /// 3 - /// true if supported; otherwise false. - public static bool IsSupported - { - get - { - Log.Info(Globals.LogTag, "Checking if the RotationVectorSensor is supported"); - return CheckIfSupported(SensorType.RotationVectorSensor, RotationVectorKey); - } - } - - /// - /// Returns the number of rotation vector sensors available on the device. - /// - /// 3 - /// The count of rotation vector sensors. - public static int Count - { - get - { - Log.Info(Globals.LogTag, "Getting the count of rotation vector sensors"); - return GetCount(); - } - } - - /// - /// Initializes a new instance of the class. - /// - /// 3 - /// http://tizen.org/feature/sensor.rotation_vector - /// Thrown when an invalid argument is used. - /// Thrown when the sensor is not supported. - /// Thrown when the operation is invalid for the current state. - /// - /// Index. Default value for this is 0. Index refers to a particular rotation vector sensor in case of multiple sensors. - /// - public RotationVectorSensor(uint index = 0) : base(index) - { - Log.Info(Globals.LogTag, "Creating RotationVectorSensor object"); - } - - internal override SensorType GetSensorType() - { - return SensorType.RotationVectorSensor; - } - - /// - /// An event handler for storing the callback functions for the event corresponding to the change in the rotation vector sensor data. - /// - /// 3 - - public event EventHandler DataUpdated; - - /// - /// An event handler for accuracy changed events. - /// - /// 3 - public event EventHandler AccuracyChanged - { - add - { - if (_accuracyChanged == null) - { - AccuracyListenStart(); - } - _accuracyChanged += value; - } - remove - { - _accuracyChanged -= value; - if (_accuracyChanged == null) - { - AccuracyListenStop(); - } - } - } - - private static int GetCount() - { - IntPtr list; - int count; - int error = Interop.SensorManager.GetSensorList(SensorType.RotationVectorSensor, out list, out count); - if (error != (int)SensorError.None) - { - Log.Error(Globals.LogTag, "Error getting sensor list for rotation vector"); - count = 0; - } - else - Interop.Libc.Free(list); - return count; - } - - private static Interop.SensorListener.SensorEventCallback _callback; - - internal override void EventListenStart() - { - _callback = (IntPtr sensorHandle, IntPtr eventPtr, IntPtr data) => { - Interop.SensorEventStruct sensorData = Interop.IntPtrToEventStruct(eventPtr); - - TimeSpan = new TimeSpan((Int64)sensorData.timestamp); - X = sensorData.values[0]; - Y = sensorData.values[1]; - Z = sensorData.values[2]; - W = sensorData.values[3]; - Accuracy = sensorData.accuracy; - - DataUpdated?.Invoke(this, new RotationVectorSensorDataUpdatedEventArgs(sensorData.values, sensorData.accuracy)); - }; - - int error = Interop.SensorListener.SetEventCallback(ListenerHandle, Interval, _callback, IntPtr.Zero); - if (error != (int)SensorError.None) - { - Log.Error(Globals.LogTag, "Error setting event callback for rotation vector sensor"); - throw SensorErrorFactory.CheckAndThrowException(error, "Unable to set event callback for rotation vector"); - } - } - - internal override void EventListenStop() - { - int error = Interop.SensorListener.UnsetEventCallback(ListenerHandle); - if (error != (int)SensorError.None) - { - Log.Error(Globals.LogTag, "Error unsetting event callback for rotation vector sensor"); - throw SensorErrorFactory.CheckAndThrowException(error, "Unable to unset event callback for rotation vector"); - } - } - - private static Interop.SensorListener.SensorAccuracyCallback _accuracyCallback; - - private void AccuracyListenStart() - { - _accuracyCallback = (IntPtr sensorHandle, UInt64 timestamp, SensorDataAccuracy accuracy, IntPtr data) => { - TimeSpan = new TimeSpan((Int64)timestamp); - Accuracy = accuracy; - _accuracyChanged?.Invoke(this, new SensorAccuracyChangedEventArgs(new TimeSpan((Int64)timestamp), accuracy)); - }; - - int error = Interop.SensorListener.SetAccuracyCallback(ListenerHandle, _accuracyCallback, IntPtr.Zero); - if (error != (int)SensorError.None) - { - Log.Error(Globals.LogTag, "Error setting accuracy event callback for rotation vector sensor"); - throw SensorErrorFactory.CheckAndThrowException(error, "Unable to set accuracy event callback for rotation vector"); - } - } - - private void AccuracyListenStop() - { - int error = Interop.SensorListener.UnsetAccuracyCallback(ListenerHandle); - if (error != (int)SensorError.None) - { - Log.Error(Globals.LogTag, "Error unsetting accuracy event callback for rotation vector sensor"); - throw SensorErrorFactory.CheckAndThrowException(error, "Unable to unset accuracy event callback for rotation vector"); - } - } - } -} diff --git a/src/Tizen.Sensor/Tizen.Sensor/Plugins/RunningActivityDetector.cs b/src/Tizen.Sensor/Tizen.Sensor/Plugins/RunningActivityDetector.cs deleted file mode 100755 index f2a3be7d0..000000000 --- a/src/Tizen.Sensor/Tizen.Sensor/Plugins/RunningActivityDetector.cs +++ /dev/null @@ -1,138 +0,0 @@ -/* - * 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.Sensor -{ - /// - /// The RunningActivityDetector class is used for registering callbacks for running the activity detector and getting the running state. - /// - public sealed class RunningActivityDetector : ActivityDetector - { - private static string ActivityDetectorKey = "http://tizen.org/feature/sensor.activity_recognition"; - - /// - /// Gets the state of the running activity detector. - /// - /// 3 - /// The running state. - public DetectorState Running { get; private set; } = DetectorState.Unknown; - - /// - /// Returns true or false based on whether the running activity detector is supported by the device. - /// - /// 3 - /// true if supported; otherwise false. - public static bool IsSupported - { - get - { - Log.Info(Globals.LogTag, "Checking if the running activity detector is supported"); - return CheckIfSupported(SensorType.RunningActivityDetector, ActivityDetectorKey); - } - } - - /// - /// Returns the number of running activity detectors available on the device. - /// - /// 3 - /// The count of running activity detectors. - public static int Count - { - get - { - Log.Info(Globals.LogTag, "Getting the count of running activity detectors"); - return GetCount(); - } - } - - /// - /// Initializes a new instance of the class. - /// - /// 3 - /// http://tizen.org/feature/sensor.activity_recognition - /// Thrown when an invalid argument is used. - /// Thrown when the sensor is not supported. - /// Thrown when the operation is invalid for the current state. - /// - /// Index. Default value for this is 0. Index refers to a particular running activity detector in case of multiple sensors. - /// - public RunningActivityDetector(uint index = 0) : base(index) - { - SetAttribute((SensorAttribute)ActivityAttribute, (int)ActivityType.Running); - Log.Info(Globals.LogTag, "Creating running activity detector object"); - } - - private static int GetCount() - { - IntPtr list; - int count; - int error = Interop.SensorManager.GetSensorList(SensorType.RunningActivityDetector, out list, out count); - if (error != (int)SensorError.None) - { - Log.Error(Globals.LogTag, "Error getting sensor list for running activity detector"); - count = 0; - } - else - Interop.Libc.Free(list); - return count; - } - - /// - /// An event handler for storing the callback functions for the event corresponding to the change in running the activity detector data. - /// - /// 3 - public event EventHandler DataUpdated; - - private static Interop.SensorListener.SensorEventCallback _callback; - - internal override void EventListenStart() - { - _callback = (IntPtr sensorHandle, IntPtr eventPtr, IntPtr data) => { - Interop.SensorEventStruct sensorData = Interop.IntPtrToEventStruct(eventPtr); - - TimeSpan = new TimeSpan((Int64)sensorData.timestamp); - Running = (DetectorState)sensorData.values[0]; - ActivityAccuracy = (SensorDataAccuracy) sensorData.accuracy; - - DataUpdated?.Invoke(this, new RunningActivityDetectorDataUpdatedEventArgs(sensorData.values[0])); - }; - - int error = Interop.SensorListener.SetEventCallback(ListenerHandle, Interval, _callback, IntPtr.Zero); - if (error != (int)SensorError.None) - { - Log.Error(Globals.LogTag, "Error setting event callback for running activity detector"); - throw SensorErrorFactory.CheckAndThrowException(error, "Unable to set event callback for running activity detector"); - } - } - - internal override void EventListenStop() - { - int error = Interop.SensorListener.UnsetEventCallback(ListenerHandle); - if (error != (int)SensorError.None) - { - Log.Error(Globals.LogTag, "Error unsetting event callback for running activity detector"); - throw SensorErrorFactory.CheckAndThrowException(error, "Unable to unset event callback for running activity detector"); - } - } - - internal override SensorType GetSensorType() - { - return SensorType.RunningActivityDetector; - } - } -} diff --git a/src/Tizen.Sensor/Tizen.Sensor/Plugins/SleepMonitor.cs b/src/Tizen.Sensor/Tizen.Sensor/Plugins/SleepMonitor.cs deleted file mode 100755 index 7ac0b4659..000000000 --- a/src/Tizen.Sensor/Tizen.Sensor/Plugins/SleepMonitor.cs +++ /dev/null @@ -1,141 +0,0 @@ -/* - * 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.Sensor -{ - /// - /// The SleepMonitor class is used for registering callbacks for the sleep monitor and getting the sleep data. - /// - public sealed class SleepMonitor : Sensor - { - private static string SleepMonitorKey = "http://tizen.org/feature/sensor.sleep_monitor"; - - /// - /// Gets the value of the sleep state. - /// - /// 3 - /// The sleep state. - public SleepMonitorState SleepState { get; private set; } = SleepMonitorState.Unknown; - - /// - /// Returns true or false based on whether the sleep monitor is supported by the device. - /// - /// 3 - /// true if supported; otherwise false. - public static bool IsSupported - { - get - { - Log.Info(Globals.LogTag, "Checking if the SleepMonitor is supported"); - return CheckIfSupported(SensorType.SleepMonitor, SleepMonitorKey); - } - } - - /// - /// Returns the number of sleep monitors available on the device. - /// - /// 3 - /// The count of sleep monitors. - public static int Count - { - get - { - Log.Info(Globals.LogTag, "Getting the count of sleep monitors"); - return GetCount(); - } - } - - /// - /// Initializes a new instance of the class. - /// - /// 3 - /// http://tizen.org/privilege/healthinfo - /// public - /// http://tizen.org/feature/sensor.sleep_monitor - /// Thrown when an invalid argument is used. - /// Thrown when the sensor is not supported. - /// Thrown when the application has no privilege to use the sensor. - /// Thrown when the operation is invalid for the current state. - /// - /// Index. Default value for this is 0. Index refers to a particular sleep monitor in case of multiple sensors. - /// - public SleepMonitor(uint index = 0) : base(index) - { - Log.Info(Globals.LogTag, "Creating SleepMonitor object"); - } - - internal override SensorType GetSensorType() - { - return SensorType.SleepMonitor; - } - - /// - /// An event handler for storing the callback functions for the event corresponding to the change in the sleep monitor data. - /// - /// 3 - - public event EventHandler DataUpdated; - - - private static int GetCount() - { - IntPtr list; - int count; - int error = Interop.SensorManager.GetSensorList(SensorType.SleepMonitor, out list, out count); - if (error != (int)SensorError.None) - { - Log.Error(Globals.LogTag, "Error getting sensor list for sleep"); - count = 0; - } - else - Interop.Libc.Free(list); - return count; - } - - private static Interop.SensorListener.SensorEventCallback _callback; - - internal override void EventListenStart() - { - _callback = (IntPtr sensorHandle, IntPtr eventPtr, IntPtr data) => { - Interop.SensorEventStruct sensorData = Interop.IntPtrToEventStruct(eventPtr); - - TimeSpan = new TimeSpan((Int64)sensorData.timestamp); - SleepState = (SleepMonitorState)sensorData.values[0]; - - DataUpdated?.Invoke(this, new SleepMonitorDataUpdatedEventArgs((int)sensorData.values[0])); - }; - - int error = Interop.SensorListener.SetEventCallback(ListenerHandle, Interval, _callback, IntPtr.Zero); - if (error != (int)SensorError.None) - { - Log.Error(Globals.LogTag, "Error setting event callback for sleep monitor"); - throw SensorErrorFactory.CheckAndThrowException(error, "Unable to set event callback for sleep"); - } - } - - internal override void EventListenStop() - { - int error = Interop.SensorListener.UnsetEventCallback(ListenerHandle); - if (error != (int)SensorError.None) - { - Log.Error(Globals.LogTag, "Error unsetting event callback for sleep monitor"); - throw SensorErrorFactory.CheckAndThrowException(error, "Unable to unset event callback for sleep"); - } - } - } -} diff --git a/src/Tizen.Sensor/Tizen.Sensor/Plugins/StationaryActivityDetector.cs b/src/Tizen.Sensor/Tizen.Sensor/Plugins/StationaryActivityDetector.cs deleted file mode 100755 index 79ebddb19..000000000 --- a/src/Tizen.Sensor/Tizen.Sensor/Plugins/StationaryActivityDetector.cs +++ /dev/null @@ -1,138 +0,0 @@ -/* - * 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.Sensor -{ - /// - /// The StationaryActivityDetector class is used for registering callbacks for the stationary activity detector and getting the stationary state. - /// - public sealed class StationaryActivityDetector : ActivityDetector - { - private static string ActivityDetectorKey = "http://tizen.org/feature/sensor.activity_recognition"; - - /// - /// Gets the state of the stationary activity detector. - /// - /// 3 - /// The stationary state. - public DetectorState Stationary { get; private set; } = DetectorState.Unknown; - - /// - /// Returns true or false based on whether the stationary activity detector is supported by the device. - /// - /// 3 - /// true if supported; otherwise false. - public static bool IsSupported - { - get - { - Log.Info(Globals.LogTag, "Checking if the stationary activity detector is supported"); - return CheckIfSupported(SensorType.StationaryActivityDetector, ActivityDetectorKey); - } - } - - /// - /// Returns the number of stationary activity detectors available on the device. - /// - /// 3 - /// The count of stationary activity detectors. - public static int Count - { - get - { - Log.Info(Globals.LogTag, "Getting the count of stationary activity detectors"); - return GetCount(); - } - } - - /// - /// Initializes a new instance of the class. - /// - /// 3 - /// http://tizen.org/feature/sensor.activity_recognition - /// Thrown when an invalid argument is used. - /// Thrown when the sensor is not supported. - /// Thrown when the operation is invalid for the current state. - /// - /// Index. Default value for this is 0. Index refers to a particular stationary activity detector in case of multiple sensors. - /// - public StationaryActivityDetector(uint index = 0) : base(index) - { - SetAttribute((SensorAttribute)ActivityAttribute, (int)ActivityType.Stationary); - Log.Info(Globals.LogTag, "Creating stationary activity detector object"); - } - - private static int GetCount() - { - IntPtr list; - int count; - int error = Interop.SensorManager.GetSensorList(SensorType.StationaryActivityDetector, out list, out count); - if (error != (int)SensorError.None) - { - Log.Error(Globals.LogTag, "Error getting sensor list for stationary activity detector"); - count = 0; - } - else - Interop.Libc.Free(list); - return count; - } - - /// - /// An event handler for storing the callback functions for the event corresponding to the change in the stationary activity detector data. - /// - /// 3 - public event EventHandler DataUpdated; - - internal static Interop.SensorListener.SensorEventCallback _callback; - - internal override void EventListenStart() - { - _callback = (IntPtr sensorHandle, IntPtr eventPtr, IntPtr data) => { - Interop.SensorEventStruct sensorData = Interop.IntPtrToEventStruct(eventPtr); - - TimeSpan = new TimeSpan((Int64)sensorData.timestamp); - Stationary = (DetectorState)sensorData.values[0]; - ActivityAccuracy = (SensorDataAccuracy) sensorData.accuracy; - - DataUpdated?.Invoke(this, new StationaryActivityDetectorDataUpdatedEventArgs(sensorData.values[0])); - }; - - int error = Interop.SensorListener.SetEventCallback(ListenerHandle, Interval, _callback, IntPtr.Zero); - if (error != (int)SensorError.None) - { - Log.Error(Globals.LogTag, "Error setting event callback for stationary activity detector"); - throw SensorErrorFactory.CheckAndThrowException(error, "Unable to set event callback for stationary activity detector"); - } - } - - internal override void EventListenStop() - { - int error = Interop.SensorListener.UnsetEventCallback(ListenerHandle); - if (error != (int)SensorError.None) - { - Log.Error(Globals.LogTag, "Error unsetting event callback for stationary activity detector"); - throw SensorErrorFactory.CheckAndThrowException(error, "Unable to unset event callback for stationary activity detector"); - } - } - - internal override SensorType GetSensorType() - { - return SensorType.StationaryActivityDetector; - } - } -} diff --git a/src/Tizen.Sensor/Tizen.Sensor/Plugins/TemperatureSensor.cs b/src/Tizen.Sensor/Tizen.Sensor/Plugins/TemperatureSensor.cs deleted file mode 100755 index b7dcfb892..000000000 --- a/src/Tizen.Sensor/Tizen.Sensor/Plugins/TemperatureSensor.cs +++ /dev/null @@ -1,138 +0,0 @@ -/* - * 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.Sensor -{ - /// - /// The TemperatureSensor class is used for registering callbacks for the temperature sensor and getting the temperature data. - /// - public sealed class TemperatureSensor : Sensor - { - private static string TemperatureSensorKey = "http://tizen.org/feature/sensor.temperature"; - - /// - /// Gets the value of the temperature sensor. - /// - /// 3 - /// Temperature (Celsius) - public float Temperature { get; private set; } = float.MinValue; - - /// - /// Returns true or false based on whether the temperature sensor is supported by the device. - /// - /// 3 - /// true if supported; otherwise false. - public static bool IsSupported - { - get - { - Log.Info(Globals.LogTag, "Checking if the TemperatureSensor is supported"); - return CheckIfSupported(SensorType.TemperatureSensor, TemperatureSensorKey); - } - } - - /// - /// Returns the number of temperature sensors available on the device. - /// - /// 3 - /// The count of temperature sensors. - public static int Count - { - get - { - Log.Info(Globals.LogTag, "Getting the count of temperature sensors"); - return GetCount(); - } - } - - /// - /// Initializes a new instance of the class. - /// - /// 3 - /// http://tizen.org/feature/sensor.temperature - /// Thrown when an invalid argument is used. - /// Thrown when the sensor is not supported. - /// Thrown when the operation is invalid for the current state. - /// - /// Index. Default value for this is 0. Index refers to a particular temperature sensor in case of multiple sensors. - /// - public TemperatureSensor(uint index = 0) : base(index) - { - Log.Info(Globals.LogTag, "Creating TemperatureSensor object"); - } - - internal override SensorType GetSensorType() - { - return SensorType.TemperatureSensor; - } - - /// - /// An event handler for storing the callback functions for the event corresponding to the change in the temperature sensor data. - /// - /// 3 - - public event EventHandler DataUpdated; - - - private static int GetCount() - { - IntPtr list; - int count; - int error = Interop.SensorManager.GetSensorList(SensorType.TemperatureSensor, out list, out count); - if (error != (int)SensorError.None) - { - Log.Error(Globals.LogTag, "Error getting sensor list for temperature"); - count = 0; - } - else - Interop.Libc.Free(list); - return count; - } - - private static Interop.SensorListener.SensorEventCallback _callback; - - internal override void EventListenStart() - { - _callback = (IntPtr sensorHandle, IntPtr eventPtr, IntPtr data) => { - Interop.SensorEventStruct sensorData = Interop.IntPtrToEventStruct(eventPtr); - - TimeSpan = new TimeSpan((Int64)sensorData.timestamp); - Temperature = sensorData.values[0]; - - DataUpdated?.Invoke(this, new TemperatureSensorDataUpdatedEventArgs(sensorData.values[0])); - }; - - int error = Interop.SensorListener.SetEventCallback(ListenerHandle, Interval, _callback, IntPtr.Zero); - if (error != (int)SensorError.None) - { - Log.Error(Globals.LogTag, "Error setting event callback for temperature sensor"); - throw SensorErrorFactory.CheckAndThrowException(error, "Unable to set event callback for temperature"); - } - } - - internal override void EventListenStop() - { - int error = Interop.SensorListener.UnsetEventCallback(ListenerHandle); - if (error != (int)SensorError.None) - { - Log.Error(Globals.LogTag, "Error unsetting event callback for temperature sensor"); - throw SensorErrorFactory.CheckAndThrowException(error, "Unable to unset event callback for temperature"); - } - } - } -} diff --git a/src/Tizen.Sensor/Tizen.Sensor/Plugins/UltravioletSensor.cs b/src/Tizen.Sensor/Tizen.Sensor/Plugins/UltravioletSensor.cs deleted file mode 100755 index 491716ab2..000000000 --- a/src/Tizen.Sensor/Tizen.Sensor/Plugins/UltravioletSensor.cs +++ /dev/null @@ -1,138 +0,0 @@ -/* - * 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.Sensor -{ - /// - /// The UltravioletSensor class is used for registering callbacks for the ultraviolet sensor and getting the ultraviolet data. - /// - public sealed class UltravioletSensor : Sensor - { - private static string UltravioletSensorKey = "http://tizen.org/feature/sensor.ultraviolet"; - - /// - /// Gets the value of the ultraviolet sensor. - /// - /// 3 - /// The ultraviolet index. - public float UltravioletIndex { get; private set; } = float.MinValue; - - /// - /// Returns true or false based on whether the ultraviolet sensor is supported by the device. - /// - /// 3 - /// true if supported; otherwise false. - public static bool IsSupported - { - get - { - Log.Info(Globals.LogTag, "Checking if the UltravioletSensor is supported"); - return CheckIfSupported(SensorType.UltravioletSensor, UltravioletSensorKey); - } - } - - /// - /// Returns the number of ultraviolet sensors available on the device. - /// - /// 3 - /// The count of ultraviolet sensors. - public static int Count - { - get - { - Log.Info(Globals.LogTag, "Getting the count of ultraviolet sensors"); - return GetCount(); - } - } - - /// - /// Initializes a new instance of the class. - /// - /// 3 - /// http://tizen.org/feature/sensor.ultraviolet - /// Thrown when an invalid argument is used. - /// Thrown when the sensor is not supported. - /// Thrown when the operation is invalid for the current state. - /// - /// Index. Default value for this is 0. Index refers to a particular ultraviolet sensor in case of multiple sensors. - /// - public UltravioletSensor(uint index = 0) : base(index) - { - Log.Info(Globals.LogTag, "Creating UltravioletSensor object"); - } - - internal override SensorType GetSensorType() - { - return SensorType.UltravioletSensor; - } - - /// - /// An event handler for storing the callback functions for the event corresponding to the change in the ultraviolet sensor data. - /// - /// 3 - - public event EventHandler DataUpdated; - - - private static int GetCount() - { - IntPtr list; - int count; - int error = Interop.SensorManager.GetSensorList(SensorType.UltravioletSensor, out list, out count); - if (error != (int)SensorError.None) - { - Log.Error(Globals.LogTag, "Error getting sensor list for ultraviolet"); - count = 0; - } - else - Interop.Libc.Free(list); - return count; - } - - private static Interop.SensorListener.SensorEventCallback _callback; - - internal override void EventListenStart() - { - _callback = (IntPtr sensorHandle, IntPtr eventPtr, IntPtr data) => { - Interop.SensorEventStruct sensorData = Interop.IntPtrToEventStruct(eventPtr); - - TimeSpan = new TimeSpan((Int64)sensorData.timestamp); - UltravioletIndex = sensorData.values[0]; - - DataUpdated?.Invoke(this, new UltravioletSensorDataUpdatedEventArgs(sensorData.values[0])); - }; - - int error = Interop.SensorListener.SetEventCallback(ListenerHandle, Interval, _callback, IntPtr.Zero); - if (error != (int)SensorError.None) - { - Log.Error(Globals.LogTag, "Error setting event callback for ultraviolet sensor"); - throw SensorErrorFactory.CheckAndThrowException(error, "Unable to set event callback for ultraviolet"); - } - } - - internal override void EventListenStop() - { - int error = Interop.SensorListener.UnsetEventCallback(ListenerHandle); - if (error != (int)SensorError.None) - { - Log.Error(Globals.LogTag, "Error unsetting event callback for ultraviolet sensor"); - throw SensorErrorFactory.CheckAndThrowException(error, "Unable to unset event callback for ultraviolet"); - } - } - } -} diff --git a/src/Tizen.Sensor/Tizen.Sensor/Plugins/UncalibratedGyroscope.cs b/src/Tizen.Sensor/Tizen.Sensor/Plugins/UncalibratedGyroscope.cs deleted file mode 100755 index 58d90ae4f..000000000 --- a/src/Tizen.Sensor/Tizen.Sensor/Plugins/UncalibratedGyroscope.cs +++ /dev/null @@ -1,177 +0,0 @@ -/* - * 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.Sensor -{ - /// - /// The UncalibratedGyroscope sensor class is used for registering callbacks for the uncalibrated gyroscope and getting the uncalibrated gyroscope data. - /// - public sealed class UncalibratedGyroscope : Sensor - { - private static string UncalibratedGyroscopeKey = "http://tizen.org/feature/sensor.gyroscope.uncalibrated"; - - /// - /// Gets the X component of the acceleration. - /// - /// 3 - /// X - public float X { get; private set; } = float.MinValue; - - /// - /// Gets the Y component of the acceleration. - /// - /// 3 - /// Y - public float Y { get; private set; } = float.MinValue; - - /// - /// Gets the Z component of the acceleration. - /// - /// 3 - /// Z - public float Z { get; private set; } = float.MinValue; - - /// - /// Gets the BiasX component of the uncalibrated gyroscope data. - /// - /// 3 - /// The X bias. - public float BiasX { get; private set; } = 0; - - /// - /// Gets the BiasY component of the uncalibrated gyroscope data. - /// - /// 3 - /// The Y bias. - public float BiasY { get; private set; } = 0; - - /// - /// Gets the BiasZ component of the uncalibrated gyroscope data. - /// - /// 3 - /// The Z bias. - public float BiasZ { get; private set; } = 0; - - /// - /// Returns true or false based on whether the uncalibrated gyroscope sensor is supported by the device. - /// - /// 3 - /// true if supported; otherwise false. - public static bool IsSupported - { - get - { - Log.Info(Globals.LogTag, "Checking if the UncalibratedGyroscope sensor is supported"); - return CheckIfSupported(SensorType.UncalibratedGyroscope, UncalibratedGyroscopeKey); - } - } - - /// - /// Returns the number of the uncalibrated gyroscope sensors available on the device. - /// - /// 3 - /// The count of the uncalibrated gyroscope sensors. - public static int Count - { - get - { - Log.Info(Globals.LogTag, "Getting the count of uncalibrated gyroscope sensors"); - return GetCount(); - } - } - - /// - /// Initializes a new instance of the class. - /// - /// 3 - /// http://tizen.org/feature/sensor.gyroscope.uncalibrated - /// Thrown when an invalid argument is used. - /// Thrown when the sensor is not supported. - /// Thrown when the operation is invalid for the current state. - /// - /// Index. Default value for this is 0. Index refers to a particular uncalibrated gyroscope sensor in case of multiple sensors. - /// - public UncalibratedGyroscope(uint index = 0) : base(index) - { - Log.Info(Globals.LogTag, "Creating UncalibratedGyroscope object"); - } - - internal override SensorType GetSensorType() - { - return SensorType.UncalibratedGyroscope; - } - - /// - /// An event handler for storing the callback functions for the event corresponding to the change in the uncalibrated gyroscope sensor data. - /// - /// 3 - - public event EventHandler DataUpdated; - - private static int GetCount() - { - IntPtr list; - int count; - int error = Interop.SensorManager.GetSensorList(SensorType.UncalibratedGyroscope, out list, out count); - if (error != (int)SensorError.None) - { - Log.Error(Globals.LogTag, "Error getting sensor list for uncalibrated gyroscope"); - count = 0; - } - else - Interop.Libc.Free(list); - return count; - } - - private static Interop.SensorListener.SensorEventCallback _callback; - - internal override void EventListenStart() - { - _callback = (IntPtr sensorHandle, IntPtr eventPtr, IntPtr data) => { - Interop.SensorEventStruct sensorData = Interop.IntPtrToEventStruct(eventPtr); - - TimeSpan = new TimeSpan((Int64)sensorData.timestamp); - X = sensorData.values[0]; - Y = sensorData.values[1]; - Z = sensorData.values[2]; - BiasX = sensorData.values[3]; - BiasY = sensorData.values[4]; - BiasZ = sensorData.values[5]; - - DataUpdated?.Invoke(this, new UncalibratedGyroscopeDataUpdatedEventArgs(sensorData.values)); - }; - - int error = Interop.SensorListener.SetEventCallback(ListenerHandle, Interval, _callback, IntPtr.Zero); - if (error != (int)SensorError.None) - { - Log.Error(Globals.LogTag, "Error setting event callback for uncalibrated gyroscope sensor"); - throw SensorErrorFactory.CheckAndThrowException(error, "Unable to set event callback for uncalibrated gyroscope"); - } - } - - internal override void EventListenStop() - { - int error = Interop.SensorListener.UnsetEventCallback(ListenerHandle); - if (error != (int)SensorError.None) - { - Log.Error(Globals.LogTag, "Error unsetting event callback for uncalibrated gyroscope sensor"); - throw SensorErrorFactory.CheckAndThrowException(error, "Unable to unset event callback for uncalibrated gyroscope"); - } - } - } -} diff --git a/src/Tizen.Sensor/Tizen.Sensor/Plugins/UncalibratedMagnetometer.cs b/src/Tizen.Sensor/Tizen.Sensor/Plugins/UncalibratedMagnetometer.cs deleted file mode 100755 index 8eb53e91d..000000000 --- a/src/Tizen.Sensor/Tizen.Sensor/Plugins/UncalibratedMagnetometer.cs +++ /dev/null @@ -1,229 +0,0 @@ -/* - * 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.Sensor -{ - /// - /// The UncalibratedMagnetometer sensor class is used for registering callbacks for the uncalibrated magnetometer and getting the uncalibrated magnetometer data. - /// - public sealed class UncalibratedMagnetometer : Sensor - { - private static string UncalibratedMagnetometerKey = "http://tizen.org/feature/sensor.magnetometer.uncalibrated"; - - private event EventHandler _accuracyChanged; - /// - /// Gets the X component of the acceleration. - /// - /// 3 - /// X - public float X { get; private set; } = float.MinValue; - - /// - /// Gets the Y component of the acceleration. - /// - /// 3 - /// Y - public float Y { get; private set; } = float.MinValue; - - /// - /// Gets the Z component of the acceleration. - /// - /// 3 - /// Z - public float Z { get; private set; } = float.MinValue; - - /// - /// Gets the BiasX component of the uncalibrated magnetometer data. - /// - /// 3 - /// The X bias. - public float BiasX { get; private set; } = 0; - - /// - /// Gets the BiasY component of the uncalibrated magnetometer data. - /// - /// 3 - /// The Y bias. - public float BiasY { get; private set; } = 0; - - /// - /// Gets the BiasZ component of the uncalibrated magnetometer data. - /// - /// 3 - /// The Z bias. - public float BiasZ { get; private set; } = 0; - - /// - /// Returns true or false based on whether the uncalibrated magnetometer sensor is supported by the device. - /// - /// 3 - /// true if supported; otherwise false. - public static bool IsSupported - { - get - { - Log.Info(Globals.LogTag, "Checking if the UncalibratedMagnetometer sensor is supported"); - return CheckIfSupported(SensorType.UncalibratedMagnetometer, UncalibratedMagnetometerKey); - } - } - - /// - /// Returns the number of uncalibrated magnetometer sensors available on the device. - /// - /// 3 - /// The count of uncalibrated magnetometer sensors. - public static int Count - { - get - { - Log.Info(Globals.LogTag, "Getting the count of uncalibrated magnetometer sensors"); - return GetCount(); - } - } - - /// - /// Initializes a new instance of the class. - /// - /// 3 - /// http://tizen.org/feature/sensor.magnetometer.uncalibrated - /// Thrown when an invalid argument is used. - /// Thrown when the sensor is not supported. - /// Thrown when the operation is invalid for the current state. - /// - /// Index. Default value for this is 0. Index refers to a particular uncalibrated magnetometer sensor in case of multiple sensors. - /// - public UncalibratedMagnetometer(uint index = 0) : base(index) - { - Log.Info(Globals.LogTag, "Creating UncalibratedMagnetometer object"); - } - - internal override SensorType GetSensorType() - { - return SensorType.UncalibratedMagnetometer; - } - - /// - /// An event handler for storing the callback functions for the event corresponding to the change in the uncalibrated magnetometer sensor data. - /// - /// 3 - - public event EventHandler DataUpdated; - - /// - /// An event handler for accuracy changed events. - /// - /// 3 - public event EventHandler AccuracyChanged - { - add - { - if (_accuracyChanged == null) - { - AccuracyListenStart(); - } - _accuracyChanged += value; - } - remove - { - _accuracyChanged -= value; - if (_accuracyChanged == null) - { - AccuracyListenStop(); - } - } - } - - private static int GetCount() - { - IntPtr list; - int count; - int error = Interop.SensorManager.GetSensorList(SensorType.UncalibratedMagnetometer, out list, out count); - if (error != (int)SensorError.None) - { - Log.Error(Globals.LogTag, "Error getting sensor list for uncalibrated magnetometer"); - count = 0; - } - else - Interop.Libc.Free(list); - return count; - } - - private static Interop.SensorListener.SensorEventCallback _callback; - - internal override void EventListenStart() - { - _callback = (IntPtr sensorHandle, IntPtr eventPtr, IntPtr data) => { - Interop.SensorEventStruct sensorData = Interop.IntPtrToEventStruct(eventPtr); - - TimeSpan = new TimeSpan((Int64)sensorData.timestamp); - X = sensorData.values[0]; - Y = sensorData.values[1]; - Z = sensorData.values[2]; - BiasX = sensorData.values[3]; - BiasY = sensorData.values[4]; - BiasZ = sensorData.values[5]; - - DataUpdated?.Invoke(this, new UncalibratedMagnetometerDataUpdatedEventArgs(sensorData.values)); - }; - - int error = Interop.SensorListener.SetEventCallback(ListenerHandle, Interval, _callback, IntPtr.Zero); - if (error != (int)SensorError.None) - { - Log.Error(Globals.LogTag, "Error setting event callback for uncalibrated magnetometer sensor"); - throw SensorErrorFactory.CheckAndThrowException(error, "Unable to set event callback for uncalibrated magnetometer"); - } - } - - internal override void EventListenStop() - { - int error = Interop.SensorListener.UnsetEventCallback(ListenerHandle); - if (error != (int)SensorError.None) - { - Log.Error(Globals.LogTag, "Error unsetting event callback for uncalibrated magnetometer sensor"); - throw SensorErrorFactory.CheckAndThrowException(error, "Unable to unset event callback for uncalibrated magnetometer"); - } - } - - private static Interop.SensorListener.SensorAccuracyCallback _accuracyCallback; - - private void AccuracyListenStart() - { - _accuracyCallback = (IntPtr sensorHandle, UInt64 timestamp, SensorDataAccuracy accuracy, IntPtr data) => { - TimeSpan = new TimeSpan((Int64)timestamp); - _accuracyChanged?.Invoke(this, new SensorAccuracyChangedEventArgs(new TimeSpan((Int64)timestamp), accuracy)); - }; - - int error = Interop.SensorListener.SetAccuracyCallback(ListenerHandle, _accuracyCallback, IntPtr.Zero); - if (error != (int)SensorError.None) - { - Log.Error(Globals.LogTag, "Error setting accuracy event callback for uncalibrated magnetometer"); - throw SensorErrorFactory.CheckAndThrowException(error, "Unable to set accuracy event callback for uncalibrated magnetometer"); - } - } - - private void AccuracyListenStop() - { - int error = Interop.SensorListener.UnsetAccuracyCallback(ListenerHandle); - if (error != (int)SensorError.None) - { - Log.Error(Globals.LogTag, "Error unsetting accuracy event callback for uncalibrated magnetometer"); - throw SensorErrorFactory.CheckAndThrowException(error, "Unable to unset accuracy event callback for uncalibrated magnetometer"); - } - } - } -} diff --git a/src/Tizen.Sensor/Tizen.Sensor/Plugins/WalkingActivityDetector.cs b/src/Tizen.Sensor/Tizen.Sensor/Plugins/WalkingActivityDetector.cs deleted file mode 100755 index d2b7906dd..000000000 --- a/src/Tizen.Sensor/Tizen.Sensor/Plugins/WalkingActivityDetector.cs +++ /dev/null @@ -1,138 +0,0 @@ -/* - * 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.Sensor -{ - /// - /// The WalkingActivityDetector class is used for registering callbacks for the walking activity detector and getting the walking state. - /// - public sealed class WalkingActivityDetector : ActivityDetector - { - private static string ActivityDetectorKey = "http://tizen.org/feature/sensor.activity_recognition"; - - /// - /// Gets the state of the walking activity detector. - /// - /// 3 - /// The walking state. - public DetectorState Walking { get; private set; } = DetectorState.Unknown; - - /// - /// Returns true or false based on whether the walking activity detector is supported by the device. - /// - /// 3 - /// true if supported; otherwise false. - public static bool IsSupported - { - get - { - Log.Info(Globals.LogTag, "Checking if the walking activity detector is supported"); - return CheckIfSupported(SensorType.WalkingActivityDetector, ActivityDetectorKey); - } - } - - /// - /// Returns the number of walking activity detectors available on the device. - /// - /// 3 - /// The count of walking activity detectors. - public static int Count - { - get - { - Log.Info(Globals.LogTag, "Getting the count of walking activity detectors"); - return GetCount(); - } - } - - /// - /// Initializes a new instance of the class. - /// - /// 3 - /// http://tizen.org/feature/sensor.activity_recognition - /// Thrown when an invalid argument is used. - /// Thrown when the sensor is not supported. - /// Thrown when the operation is invalid for the current state. - /// - /// Index. Default value for this is 0. Index refers to a particular walking activity detector in case of multiple sensors. - /// - public WalkingActivityDetector(uint index = 0) : base(index) - { - SetAttribute((SensorAttribute)ActivityAttribute, (int)ActivityType.Walking); - Log.Info(Globals.LogTag, "Creating walking activity gesture detector object"); - } - - private static int GetCount() - { - IntPtr list; - int count; - int error = Interop.SensorManager.GetSensorList(SensorType.WalkingActivityDetector, out list, out count); - if (error != (int)SensorError.None) - { - Log.Error(Globals.LogTag, "Error getting sensor list for walking activity detector"); - count = 0; - } - else - Interop.Libc.Free(list); - return count; - } - - /// - /// An event handler for storing the callback functions for the event corresponding to the change in the walking activity gesture detector data. - /// - /// 3 - public event EventHandler DataUpdated; - - internal static Interop.SensorListener.SensorEventCallback _callback; - - internal override void EventListenStart() - { - _callback = (IntPtr sensorHandle, IntPtr eventPtr, IntPtr data) => { - Interop.SensorEventStruct sensorData = Interop.IntPtrToEventStruct(eventPtr); - - TimeSpan = new TimeSpan((Int64)sensorData.timestamp); - Walking = (DetectorState)sensorData.values[0]; - ActivityAccuracy = (SensorDataAccuracy) sensorData.accuracy; - - DataUpdated?.Invoke(this, new WalkingActivityDetectorDataUpdatedEventArgs(sensorData.values[0])); - }; - - int error = Interop.SensorListener.SetEventCallback(ListenerHandle, Interval, _callback, IntPtr.Zero); - if (error != (int)SensorError.None) - { - Log.Error(Globals.LogTag, "Error setting event callback for walking activity detector"); - throw SensorErrorFactory.CheckAndThrowException(error, "Unable to set event callback for walking activity detector"); - } - } - - internal override void EventListenStop() - { - int error = Interop.SensorListener.UnsetEventCallback(ListenerHandle); - if (error != (int)SensorError.None) - { - Log.Error(Globals.LogTag, "Error unsetting event callback for walking activity detector"); - throw SensorErrorFactory.CheckAndThrowException(error, "Unable to unset event callback for walking activity detector"); - } - } - - internal override SensorType GetSensorType() - { - return SensorType.WalkingActivityDetector; - } - } -} diff --git a/src/Tizen.Sensor/Tizen.Sensor/Plugins/WristUpGestureDetector.cs b/src/Tizen.Sensor/Tizen.Sensor/Plugins/WristUpGestureDetector.cs deleted file mode 100755 index b4a3636bd..000000000 --- a/src/Tizen.Sensor/Tizen.Sensor/Plugins/WristUpGestureDetector.cs +++ /dev/null @@ -1,136 +0,0 @@ -/* - * 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.Sensor -{ - /// - /// The WristUpGestureDetector class is used for registering callbacks for the wrist up gesture detector and getting the wrist up state. - /// - public sealed class WristUpGestureDetector : Sensor - { - private static string WristUpKey = "http://tizen.org/feature/sensor.wrist_up"; - - /// - /// Gets the state of the wrist up gesture. - /// - /// 3 - /// The wrist up state. - public DetectorState WristUp { get; private set; } = DetectorState.Unknown; - - /// - /// Returns true or false based on whether the wrist up gesture detector is supported by the device. - /// - /// 3 - /// true if supported; otherwise false. - public static bool IsSupported - { - get - { - Log.Info(Globals.LogTag, "Checking if the wrist up gesture detector is supported"); - return CheckIfSupported(SensorType.WristUpGestureDetector, WristUpKey); - } - } - - /// - /// Returns the number of wrist up gesture detectors available on the device. - /// - /// 3 - /// The count of wrist up gesture detectors. - public static int Count - { - get - { - Log.Info(Globals.LogTag, "Getting the count of wrist up gesture detectors"); - return GetCount(); - } - } - - /// - /// Initializes a new instance of the class. - /// - /// 3 - /// http://tizen.org/feature/sensor.wrist_up - /// Thrown when an invalid argument is used. - /// Thrown when the sensor is not supported. - /// Thrown when the operation is invalid for the current state. - /// - /// Index. Default value for this is 0. Index refers to a particular wrist up gesture detector in case of multiple sensors. - /// - public WristUpGestureDetector(uint index = 0) : base(index) - { - Log.Info(Globals.LogTag, "Creating wrist up gesture detector object"); - } - - internal override SensorType GetSensorType() - { - return SensorType.WristUpGestureDetector; - } - - private static int GetCount() - { - IntPtr list; - int count; - int error = Interop.SensorManager.GetSensorList(SensorType.WristUpGestureDetector, out list, out count); - if (error != (int)SensorError.None) - { - Log.Error(Globals.LogTag, "Error getting sensor list for wrist up gesture detector"); - count = 0; - } - else - Interop.Libc.Free(list); - return count; - } - - /// - /// An event handler for storing the callback functions for the event corresponding to the change in the wrist up gesture detector data. - /// - /// 3 - public event EventHandler DataUpdated; - - private static Interop.SensorListener.SensorEventCallback _callback; - - internal override void EventListenStart() - { - _callback = (IntPtr sensorHandle, IntPtr eventPtr, IntPtr data) => { - Interop.SensorEventStruct sensorData = Interop.IntPtrToEventStruct(eventPtr); - - TimeSpan = new TimeSpan((Int64)sensorData.timestamp); - WristUp = (DetectorState) sensorData.values[0]; - - DataUpdated?.Invoke(this, new WristUpGestureDetectorDataUpdatedEventArgs(sensorData.values[0])); - }; - - int error = Interop.SensorListener.SetEventCallback(ListenerHandle, Interval, _callback, IntPtr.Zero); - if (error != (int)SensorError.None) - { - Log.Error(Globals.LogTag, "Error setting event callback for wrist up gesture detector"); - throw SensorErrorFactory.CheckAndThrowException(error, "Unable to set event callback for wrist up gesture detector"); - } - } - - internal override void EventListenStop() - { - int error = Interop.SensorListener.UnsetEventCallback(ListenerHandle); - if (error != (int)SensorError.None) - { - Log.Error(Globals.LogTag, "Error unsetting event callback for wrist up gesture detector"); - throw SensorErrorFactory.CheckAndThrowException(error, "Unable to unset event callback for wrist up gesture detector"); - } - } - } -} diff --git a/src/Tizen.Sensor/Tizen.Sensor/Sensor.cs b/src/Tizen.Sensor/Tizen.Sensor/Sensor.cs deleted file mode 100755 index 2210fd3cd..000000000 --- a/src/Tizen.Sensor/Tizen.Sensor/Sensor.cs +++ /dev/null @@ -1,533 +0,0 @@ -/* - * 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.System; - -namespace Tizen.Sensor -{ - internal static class Globals - { - internal const string LogTag = "Tizen.Sensor"; - } - - /// - /// The Sensor class is used for storing the hardware information about a particular sensor. - /// - public abstract class Sensor : IDisposable - { - private string _name; - private string _vendor; - private float _minValue; - private float _maxValue; - private float _resolution; - private int _minInterval; - private int _fifoCount; - private int _maxBatchCount; - private bool _isSensing = false; - private bool _disposed = false; - private TimeSpan _timeSpan; - private uint _interval = 0; - private uint _maxBatchLatency = 0; - private SensorPausePolicy _pausePolicy = SensorPausePolicy.None; - private IntPtr _sensorHandle = IntPtr.Zero; - private IntPtr _listenerHandle = IntPtr.Zero; - - internal abstract SensorType GetSensorType(); - internal abstract void EventListenStart(); - internal abstract void EventListenStop(); - - internal Sensor(uint index) - { - SensorType type = GetSensorType(); - GetHandleList(type, index); - if (CheckSensorHandle()) - { - CreateListener(); - GetProperty(); - } - } - - ~Sensor() - { - Dispose(false); - } - - /// - /// Property: Gets the name of the sensor. - /// - /// 3 - /// The name of the sensor. - public string Name - { - get - { - Log.Info(Globals.LogTag, "Getting the sensor name"); - return _name; - } - } - - /// - /// Property: Gets the vendor. - /// - /// 3 - /// The vendor name of the sensor. - public string Vendor - { - get - { - Log.Info(Globals.LogTag, "Getting the sensor vendor name"); - return _vendor; - } - } - - /// - /// Property: Gets the minimum value of the range of the sensor data. - /// - /// 3 - /// The lower bound of the range of the sensor reading. - public float MinValue - { - get - { - Log.Info(Globals.LogTag, "Getting the min value of the sensor"); - return _minValue; - } - } - - /// - /// Property: Gets the maximum value of the range of the sensor data. - /// - /// 3 - /// The upper bound of the range of the sensor reading. - public float MaxValue - { - get - { - Log.Info(Globals.LogTag, "Getting the max value of the sensor"); - return _maxValue; - } - } - - /// - /// Property: Gets the resolution. - /// - /// 3 - /// The resolution. - public float Resolution - { - get - { - Log.Info(Globals.LogTag, "Getting the resolution of the sensor"); - return _resolution; - } - } - - /// - /// Property: Gets the minimum interval. - /// - /// 3 - /// The minimum update interval. - public int MinInterval - { - get - { - Log.Info(Globals.LogTag, "Getting the min interval for the sensor"); - return _minInterval; - } - } - - /// - /// Property: Gets the FIFO count. - /// - /// 3 - /// The size of the hardware FIFO. - public int FifoCount - { - get - { - Log.Info(Globals.LogTag, "Getting the fifo count of the sensor"); - return _fifoCount; - } - } - - /// - /// Property: Gets the maximum batch count. - /// - /// 3 - /// The maximum batch count. - public int MaxBatchCount - { - get - { - Log.Info(Globals.LogTag, "Getting the max batch count of the sensor"); - return _maxBatchCount; - } - } - - /// - /// Sets the interval of the sensor for the sensor data event. - /// Callbacks will be called at the frequency of this interval. - /// - /// 3 - /// Thrown when the operation is invalid for the current state. - /// The interval of the sensor. - public uint Interval - { - set - { - Log.Info(Globals.LogTag, "Setting the interval of the sensor"); - _interval = value; - SetInterval(); - } - get - { - Log.Info(Globals.LogTag, "Getting the interval of the sensor"); - return _interval; - } - } - - /// - /// Sets the maximum batch latency for the sensor corresponding to the sensor data event. - /// - /// 3 - /// Thrown when the operation is invalid for the current state. - /// The maximum batch latency. - public uint MaxBatchLatency - { - set - { - Log.Info(Globals.LogTag, "Setting the max batch latency of the sensor"); - _maxBatchLatency = value; - SetMaxBatchLatency(); - } - get - { - Log.Info(Globals.LogTag, "Getting the max batch latency of the sensor"); - return _maxBatchLatency; - } - } - - /// - /// Sets the pause policy of the sensor. - /// - /// 3 - /// The pause policy. - /// Thrown when the operation is invalid for the current state. - /// The pause policy. - public SensorPausePolicy PausePolicy - { - set - { - Log.Info(Globals.LogTag, "Setting the pause policy of the sensor"); - _pausePolicy = value; - SetAttribute(SensorAttribute.PausePolicy, (int)_pausePolicy); - } - get - { - Log.Info(Globals.LogTag, "Getting the pause policy of the sensor"); - return _pausePolicy; - } - } - - /// - /// Gets or sets the time span. - /// - /// 3 - /// The time span. - public TimeSpan TimeSpan - { - set - { - Log.Info(Globals.LogTag, "Setting the timespan of the sensor values"); - _timeSpan = value; - } - get - { - Log.Info(Globals.LogTag, "Getting the timespan of the sensor values"); - return _timeSpan; - } - } - - /// - /// Indicates whether this sensor is sensing. - /// - /// 3 - /// true if this sensor is sensing; otherwise false. - public bool IsSensing - { - get - { - Log.Info(Globals.LogTag, "Checking if the sensor is started"); - return _isSensing; - } - } - - internal IntPtr ListenerHandle - { - get - { - return _listenerHandle; - } - } - - internal static bool CheckIfSupported(SensorType type, String key) - { - bool isSupported = false; - bool error = Information.TryGetValue(key, out isSupported); - - if (!error || !isSupported) - { - Log.Error(Globals.LogTag, "Error checking if sensor is supported(systeminfo)"); - return false; - } - - int ret = Interop.SensorManager.SensorIsSupported(type, out isSupported); - if (ret != (int)SensorError.None) - { - Log.Error(Globals.LogTag, "Error checking if sensor is supported"); - isSupported = false; - } - - return isSupported; - } - - /// - /// Starts the sensor. - /// After this, event handlers will start receiving events. - /// - /// 3 - /// Thrown when the operation is invalid for the current state. - public void Start() - { - Log.Info(Globals.LogTag, "Starting the sensor"); - if (CheckListenerHandle()) - { - int error = Interop.SensorListener.StartListener(_listenerHandle); - if (error != (int)SensorError.None) - { - Log.Error(Globals.LogTag, "Error starting sensor"); - throw SensorErrorFactory.CheckAndThrowException(error, "Unable to Start Sensor Listener"); - } - EventListenStart(); - _isSensing = true; - Log.Info(Globals.LogTag, "Sensor started"); - } - } - - /// - /// Stops the sensor. - /// After this, event handlers will stop receiving events. - /// - /// 3 - /// Thrown when the operation is invalid for the current state. - public void Stop() - { - Log.Info(Globals.LogTag, "Stopping the sensor"); - if (_isSensing) - { - int error = Interop.SensorListener.StopListener(_listenerHandle); - if (error != (int)SensorError.None) - { - Log.Error(Globals.LogTag, "Error stopping the sensor"); - throw SensorErrorFactory.CheckAndThrowException(error, "Unable to Stop Sensor Listener"); - } - EventListenStop(); - _isSensing = false; - Log.Info(Globals.LogTag, "Sensor stopped"); - } - } - - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - - protected virtual void Dispose(bool disposing) - { - if (_disposed) - return; - - DestroyHandles(); - _disposed = true; - } - - internal void SetAttribute(SensorAttribute attribute, int option) - { - if (CheckListenerHandle()) - { - int error = Interop.SensorListener.SetAttribute(_listenerHandle, attribute, option); - if (error != (int)SensorError.None) - { - Log.Error(Globals.LogTag, "Error setting sensor pause policy"); - throw SensorErrorFactory.CheckAndThrowException(error, "Setting Sensor.PausePolicy Failed"); - } - } - } - - private void GetHandleList(SensorType type, uint index) - { - IntPtr list; - IntPtr[] sensorList; - int count; - int error = Interop.SensorManager.GetSensorList(type, out list, out count); - if (error != (int)SensorError.None) - { - Log.Error(Globals.LogTag, "Error getting sensor list"); - throw SensorErrorFactory.CheckAndThrowException(error, "Sensor.GetSensorList Failed"); - } - sensorList = Interop.IntPtrToIntPtrArray(list, count); - _sensorHandle = sensorList[index]; - Interop.Libc.Free(list); - } - - private void GetProperty() - { - int error = (int)SensorError.None; - - error = Interop.Sensor.GetName(_sensorHandle, out _name); - if (error != (int)SensorError.None) - { - Log.Error(Globals.LogTag, "Error getting sensor name"); - throw SensorErrorFactory.CheckAndThrowException(error, "Sensor.Name Failed"); - } - - error = Interop.Sensor.GetVendor(_sensorHandle, out _vendor); - if (error != (int)SensorError.None) - { - Log.Error(Globals.LogTag, "Error getting sensor vendor name"); - throw SensorErrorFactory.CheckAndThrowException(error, "Sensor.Vendor Failed"); - } - - error = Interop.Sensor.GetMinRange(_sensorHandle, out _minValue); - if (error != (int)SensorError.None) - { - Log.Error(Globals.LogTag, "Error getting sensor min value"); - throw SensorErrorFactory.CheckAndThrowException(error, "Sensor.MinValue Failed"); - } - - error = Interop.Sensor.GetMaxRange(_sensorHandle, out _maxValue); - if (error != (int)SensorError.None) - { - Log.Error(Globals.LogTag, "Error getting sensor max value"); - throw SensorErrorFactory.CheckAndThrowException(error, "Sensor.MaxValue Failed"); - } - - error = Interop.Sensor.GetResolution(_sensorHandle, out _resolution); - if (error != (int)SensorError.None) - { - Log.Error(Globals.LogTag, "Error getting sensor resolution"); - throw SensorErrorFactory.CheckAndThrowException(error, "Sensor.Resolution Failed"); - } - - error = Interop.Sensor.GetMinInterval(_sensorHandle, out _minInterval); - if (error != (int)SensorError.None) - { - Log.Error(Globals.LogTag, "Error getting sensor min interval"); - throw SensorErrorFactory.CheckAndThrowException(error, "Sensor.MinInterval Failed"); - } - - error = Interop.Sensor.GetFifoCount(_sensorHandle, out _fifoCount); - if (error != (int)SensorError.None) - { - Log.Error(Globals.LogTag, "Error getting sensor fifo count"); - throw SensorErrorFactory.CheckAndThrowException(error, "Sensor.FifoCount Failed"); - } - - error = Interop.Sensor.GetMaxBatchCount(_sensorHandle, out _maxBatchCount); - if (error != (int)SensorError.None) - { - Log.Error(Globals.LogTag, "Error getting sensor max batch count"); - throw SensorErrorFactory.CheckAndThrowException(error, "Sensor.MaxBatchCount Failed"); - } - } - - private void CreateListener() - { - int error = Interop.SensorListener.CreateListener(_sensorHandle, out _listenerHandle); - if (error != (int)SensorError.None) - { - Log.Error(Globals.LogTag, "Error cerating sensor listener handle"); - throw SensorErrorFactory.CheckAndThrowException(error, "Sensor.CreateListener Failed"); - } - } - - private void SetInterval() - { - if (CheckListenerHandle()) - { - if (_isSensing) - { - int error = Interop.SensorListener.SetInterval(_listenerHandle, _interval); - if (error != (int)SensorError.None) - { - Log.Error(Globals.LogTag, "Error setting sensor interval"); - throw SensorErrorFactory.CheckAndThrowException(error, "Setting Sensor.SetInterval Failed"); - } - } - } - } - - private void SetMaxBatchLatency() - { - if (CheckListenerHandle()) - { - int error = Interop.SensorListener.SetMaxBatchLatency(_listenerHandle, _maxBatchLatency); - if (error != (int)SensorError.None) - { - Log.Error(Globals.LogTag, "Error setting max batch latency"); - throw SensorErrorFactory.CheckAndThrowException(error, "Setting Sensor.MaxBatchLatency Failed"); - } - } - } - - private bool CheckListenerHandle() - { - bool result = false; - if (_listenerHandle != IntPtr.Zero) - { - result = true; - } - else - { - Log.Error(Globals.LogTag, "Sensor listener handle is null"); - throw new ArgumentException("Invalid Parameter: Sensor is null"); - } - return result; - } - - private bool CheckSensorHandle() - { - bool result = false; - if (_sensorHandle != IntPtr.Zero) - { - result = true; - } - else - { - Log.Error(Globals.LogTag, "Sensor handle is null"); - throw new ArgumentException("Invalid Parameter: Sensor is null"); - } - return result; - } - - private void DestroyHandles() - { - Interop.SensorListener.DestroyListener(_listenerHandle); - } - } -} diff --git a/src/Tizen.Sensor/Tizen.Sensor/SensorEnumerations.cs b/src/Tizen.Sensor/Tizen.Sensor/SensorEnumerations.cs deleted file mode 100755 index dc1c7d167..000000000 --- a/src/Tizen.Sensor/Tizen.Sensor/SensorEnumerations.cs +++ /dev/null @@ -1,322 +0,0 @@ -/* - * 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.Sensor -{ - /// - /// The SensorType Enum defintion for all sensor types. - /// - internal enum SensorType - { - /// - /// All sensors. This can be used to retrieve the Sensor class object for all available sensors. - /// - All = -1, - /// - /// Accelerometer sensor. - /// - Accelerometer = 0, - /// - /// Gravity sensor. - /// - GravitySensor = 1, - /// - /// Linear Acceleration sensor. - /// - LinearAccelerationSensor = 2, - /// - /// Magnetometer sensor. - /// - Magnetometer = 3, - /// - /// Rotation Vector sensor. - /// - RotationVectorSensor = 4, - /// - /// Orientation sensor. - /// - OrientationSensor = 5, - /// - /// The Gyroscope sensor. - /// - Gyroscope = 6, - /// - /// Light sensor. - /// - LightSensor = 7, - /// - /// Proximity sensor. - /// - ProximitySensor = 8, - /// - /// Pressure sensor. - /// - PressureSensor = 9, - /// - /// Ultraviolet sensor. - /// - UltravioletSensor = 10, - /// - /// Temperature sensor. - /// - TemperatureSensor = 11, - /// - /// Humidity sensor. - /// - HumiditySensor = 12, - /// - /// Hear rate monitor sensor. - /// - HeartRateMonitor = 13, - /// - /// The Uncalibrated Gyroscope sensor. - /// - UncalibratedGyroscope = 17, - /// - /// Uncalibrated Geomagnetic sensor. - /// - UncalibratedMagnetometer = 18, - /// - /// The Gyroscope-based rotation vector sensor. - /// - GyroscopeRotationVectorSensor = 19, - /// - /// Geomagnetic-based rotation vector sensor. - /// - MagnetometerRotationVectorSensor = 20, - /// - /// Pedometer sensor. - /// - Pedometer = 0x300, - /// - /// Sleep monitor sensor. - /// - SleepMonitor = 0x301, - /// - /// Walking activity detector. - /// - WalkingActivityDetector = 0x1A00, - /// - /// Running activity detector. - /// - RunningActivityDetector = 0x1A00, - /// - /// Stationary activity detector. - /// - StationaryActivityDetector = 0x1A00, - /// - /// InVehicle activity detector. - /// - InVehicleActivityDetector = 0x1A00, - /// - /// Wrist up gesture detector. - /// - WristUpGestureDetector = 0x1201, - /// - /// Pick up gesture detector. - /// - PickUpGestureDetector = 0x1204, - /// - /// Face down gesture detector. - /// - FaceDownGestureDetector = 0x1205 - } - - /// - /// The sensor attribute. - /// - internal enum SensorAttribute - { - /// - /// The axis orientation. - /// - AxisOrientation, - - /// - /// The pause policy. - /// - PausePolicy - } - - /// - /// The SensorDataAccuracy Enum definition for all possible sensor data accuracy values. - /// - /// 3 - public enum SensorDataAccuracy - { - /// - /// Undefined sensor data accuracy. - /// - /// 3 - Undefined = -1, - /// - /// Sensor data not accurate. - /// - /// 3 - Bad = 0, - /// - /// Moderately accurate sensor data. - /// - /// 3 - Normal = 1, - /// - /// Highly accurate sensor data. - /// - /// 3 - Good = 2, - /// - /// Very highly accurate sensor data. - /// - /// 3 - VeryGood = 3 - } - - /// - /// The Sensor Option Enum definition for sensor option values. - /// - /// 3 - public enum SensorPausePolicy - { - /// - /// Does not receive data when the LCD is off and in the power save mode. - /// - /// 3 - None, - /// - /// Receives data when the LCD is off. - /// - /// 3 - DisplayOff, - /// - /// Receives data in the power save mode. - /// - /// 3 - PowerSaveMode, - /// - /// Receives data when the LCD is off and in the power save mode. - /// - /// 3 - All - } - - /// - /// The pedometer state. - /// - /// 3 - public enum PedometerState - { - /// - /// Unknown. - /// - /// 3 - Unknown = -1, - - /// - /// Stop state. - /// - /// 3 - Stop, - - /// - /// Walking state. - /// - /// 3 - Walk, - - /// - /// Running state. - /// - /// 3 - Run - } - - /// - /// The sleep monitor state. - /// - /// 3 - public enum SleepMonitorState - { - /// - /// Unknown. - /// - /// 3 - Unknown = -1, - - /// - /// The wake state. - /// - /// 3 - Wake, - - /// - /// The sleeping state. - /// - /// 3 - Sleep - } - - /// - /// The proximity sensor state. - /// - /// 3 - public enum ProximitySensorState - { - /// - /// Unknown. - /// - /// 3 - Unknown = -1, - - /// - /// Near sate. - /// - /// 3 - Near = 0, - - /// - /// Far state. - /// - /// 3 - Far = 5 - } - - /// - /// The detector sensor state. - /// - /// 3 - public enum DetectorState - { - /// - /// Unknown. - /// - /// 3 - Unknown = -1, - - /// - /// None sate. - /// - /// 3 - NotDetected = 0, - - /// - /// Detected state. - /// - /// 3 - Detected = 1 - } -} diff --git a/src/Tizen.Sensor/Tizen.Sensor/SensorErrorFactory.cs b/src/Tizen.Sensor/Tizen.Sensor/SensorErrorFactory.cs deleted file mode 100644 index 67cf82bf2..000000000 --- a/src/Tizen.Sensor/Tizen.Sensor/SensorErrorFactory.cs +++ /dev/null @@ -1,62 +0,0 @@ -/* - * 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.Sensor -{ - internal enum SensorError - { - None = ErrorCode.None, - IOError = ErrorCode.IoError, - InvalidParameter = ErrorCode.InvalidParameter, - NotSupported = ErrorCode.NotSupported, - PermissionDenied = ErrorCode.PermissionDenied, - OutOfMemory = ErrorCode.OutOfMemory, - NotNeedCalibration = -0x02440000 | 0x03, - OperationFailed = -0x02440000 | 0x06 - } - - internal static class SensorErrorFactory - { - static internal Exception CheckAndThrowException(int error, string msg) - { - SensorError e = (SensorError)error; - switch (e) - { - case SensorError.None: - return null; - case SensorError.IOError: - return new InvalidOperationException("I/O Error: " + msg); - case SensorError.InvalidParameter: - return new ArgumentException("Invalid Parameter: " + msg); - case SensorError.NotSupported: - return new NotSupportedException("Not Supported: " + msg); - case SensorError.PermissionDenied: - return new UnauthorizedAccessException("Permission Denied: " + msg); - case SensorError.OutOfMemory: - return new InvalidOperationException("Out of Memory: " + msg); - case SensorError.NotNeedCalibration: - return new InvalidOperationException("Sensor doesn't need calibration: " + msg); - case SensorError.OperationFailed: - return new InvalidOperationException("Operation Failed: " + msg); - default: - return new InvalidOperationException("Unknown Error Code: " + msg); - } - } - } -} diff --git a/src/Tizen.System.Feedback/Feedback/Feedback.cs b/src/Tizen.System.Feedback/Feedback/Feedback.cs deleted file mode 100644 index 6eaad732a..000000000 --- a/src/Tizen.System.Feedback/Feedback/Feedback.cs +++ /dev/null @@ -1,375 +0,0 @@ -/* -* 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.Collections.Generic; - - -namespace Tizen.System -{ - /// - /// The class for constants. - /// - internal static class Constants - { - internal const int NumberOfPattern = 39; - } - - /// - /// The Feedback API provides functions to control haptic and sound. - /// The Feedback API provides the way to play and stop feedback, and get the information whether a specific pattern is supported. - /// Below is the supported pattern string: - /// Tap - /// SoftInputPanel - /// Key0 - /// Key1 - /// Key2 - /// Key3 - /// Key4 - /// Key5 - /// Key6 - /// Key7 - /// Key8 - /// Key9 - /// KeyStar - /// KeySharp - /// KeyBack - /// Hold - /// HardwareKeyPressed - /// HardwareKeyHold - /// Message - /// Email - /// WakeUp - /// Schedule - /// Timer - /// General - /// PowerOn - /// PowerOff - /// ChargerConnected - /// ChargingError - /// FullyCharged - /// LowBattery - /// Lock - /// UnLock - /// VibrationModeAbled - /// SilentModeDisabled - /// BluetoothDeviceConnected - /// BluetoothDeviceDisconnected - /// ListReorder - /// ListSlider - /// VolumeKeyPressed - /// - /// - /// For controlling the haptic device: - /// 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"; - - private readonly FeedbackPattern[] Pattern = new FeedbackPattern[39]; - public Feedback() - { - Pattern[0].PatternNumber = 0; - Pattern[0].PatternString = "Tap"; - Pattern[1].PatternNumber = 1; - Pattern[1].PatternString = "SoftInputPanel"; - Pattern[2].PatternNumber = 6; - Pattern[2].PatternString = "Key0"; - Pattern[3].PatternNumber = 7; - Pattern[3].PatternString = "Key1"; - Pattern[4].PatternNumber = 8; - Pattern[4].PatternString = "Key2"; - Pattern[5].PatternNumber = 9; - Pattern[5].PatternString = "Key3"; - Pattern[6].PatternNumber = 10; - Pattern[6].PatternString = "Key4"; - Pattern[7].PatternNumber = 11; - Pattern[7].PatternString = "Key5"; - Pattern[8].PatternNumber = 12; - Pattern[8].PatternString = "Key6"; - Pattern[9].PatternNumber = 13; - Pattern[9].PatternString = "Key7"; - Pattern[10].PatternNumber = 14; - Pattern[10].PatternString = "Key8"; - Pattern[11].PatternNumber = 15; - Pattern[11].PatternString = "Key9"; - Pattern[12].PatternNumber = 16; - Pattern[12].PatternString = "KeyStar"; - Pattern[13].PatternNumber = 17; - Pattern[13].PatternString = "KeySharp"; - Pattern[14].PatternNumber = 18; - Pattern[14].PatternString = "KeyBack"; - Pattern[15].PatternNumber = 19; - Pattern[15].PatternString = "Hold"; - Pattern[16].PatternNumber = 21; - Pattern[16].PatternString = "HardwareKeyPressed"; - Pattern[17].PatternNumber = 22; - Pattern[17].PatternString = "HardwareKeyHold"; - Pattern[18].PatternNumber = 23; - Pattern[18].PatternString = "Message"; - Pattern[19].PatternNumber = 25; - Pattern[19].PatternString = "Email"; - Pattern[20].PatternNumber = 27; - Pattern[20].PatternString = "WakeUp"; - Pattern[21].PatternNumber = 29; - Pattern[21].PatternString = "Schedule"; - Pattern[22].PatternNumber = 31; - Pattern[22].PatternString = "Timer"; - Pattern[23].PatternNumber = 33; - Pattern[23].PatternString = "General"; - Pattern[24].PatternNumber = 36; - Pattern[24].PatternString = "PowerOn"; - Pattern[25].PatternNumber = 37; - Pattern[25].PatternString = "PowerOff"; - Pattern[26].PatternNumber = 38; - Pattern[26].PatternString = "ChargerConnected"; - Pattern[27].PatternNumber = 40; - Pattern[27].PatternString = "ChargingError"; - Pattern[28].PatternNumber = 42; - Pattern[28].PatternString = "FullyCharged"; - Pattern[29].PatternNumber = 44; - Pattern[29].PatternString = "LowBattery"; - Pattern[30].PatternNumber = 46; - Pattern[30].PatternString = "Lock"; - Pattern[31].PatternNumber = 47; - Pattern[31].PatternString = "UnLock"; - Pattern[32].PatternNumber = 55; - Pattern[32].PatternString = "VibrationModeAbled"; - Pattern[33].PatternNumber = 56; - Pattern[33].PatternString = "SilentModeDisabled"; - Pattern[34].PatternNumber = 57; - Pattern[34].PatternString = "BluetoothDeviceConnected"; - Pattern[35].PatternNumber = 58; - Pattern[35].PatternString = "BluetoothDeviceDisconnected"; - Pattern[36].PatternNumber = 62; - Pattern[36].PatternString = "ListReorder"; - Pattern[37].PatternNumber = 63; - Pattern[37].PatternString = "ListSlider"; - Pattern[38].PatternNumber = 64; - Pattern[38].PatternString = "VolumeKeyPressed"; - - Interop.Feedback.FeedbackError res = (Interop.Feedback.FeedbackError)Interop.Feedback.Initialize(); - if (res != Interop.Feedback.FeedbackError.None) - { - Log.Warn(LogTag, string.Format("Failed to initialize feedback. err = {0}", res)); - switch (res) - { - case Interop.Feedback.FeedbackError.NotSupported: - throw new NotSupportedException("Device is not supported"); - default: - throw new InvalidOperationException("Failed to initialize"); - } - } - } - - ~Feedback() - { - Interop.Feedback.FeedbackError res = (Interop.Feedback.FeedbackError)Interop.Feedback.Deinitialize(); - if (res != Interop.Feedback.FeedbackError.None) - { - Log.Warn(LogTag, string.Format("Failed to deinitialize feedback. err = {0}", res)); - switch (res) - { - case Interop.Feedback.FeedbackError.NotInitialized: - throw new Exception("Not initialized"); - default: - throw new InvalidOperationException("Failed to initialize"); - } - } - } - - /// - /// Gets the supported information about a specific type and pattern. - /// - /// - /// Now, IsSupportedPattern is not working for FeedbackType.All. - /// This API is working for FeedbackType.Sound and FeedbackType.Vibration only. - /// If you use FeedbackType.All for type parameter, this API will throw ArgumentException. - /// To get the supported information for Vibration type, the application should have http://tizen.org/privilege/haptic privilege. - /// - /// 3 - /// The feedback type. - /// The feedback pattern string. - /// Information whether a pattern is supported. - /// Thrown when failed because the feedback is not initialized. - /// Thrown when failed because of an invalid arguament. - /// Thrown when failed becuase the device (haptic, sound) is not supported. - /// Thrown when failed because the access is not granted (No privilege). - /// Thrown when failed because of a system error. - /// http://tizen.org/privilege/haptic - /// - /// - /// Feedback feedback = new Feedback(); - /// bool res = feedback.IsSupportedPattern(FeedbackType.Vibration, "Tap"); - /// - /// - public bool IsSupportedPattern(FeedbackType type, String pattern) - { - bool supported = false; - bool found = false; - int i = 0; - Interop.Feedback.FeedbackError res; - - for (i = 0; i < Constants.NumberOfPattern; i++) - { - if (String.Compare(pattern, Pattern[i].PatternString) == 0) - { - found = true; - break; - } - } - - if (!found) - throw new ArgumentException("Invalid Arguments"); - - res = (Interop.Feedback.FeedbackError)Interop.Feedback.IsSupportedPattern((Interop.Feedback.FeedbackType)type, Pattern[i].PatternNumber, out supported); - - - if (res != Interop.Feedback.FeedbackError.None) - { - Log.Warn(LogTag, string.Format("Failed to get supported information. err = {0}", res)); - switch (res) - { - case Interop.Feedback.FeedbackError.NotInitialized: - throw new Exception("Not initialized"); - case Interop.Feedback.FeedbackError.InvalidParameter: - throw new ArgumentException("Invalid Arguments"); - case Interop.Feedback.FeedbackError.NotSupported: - throw new NotSupportedException("Device is not supported"); - case Interop.Feedback.FeedbackError.PermissionDenied: - throw new UnauthorizedAccessException("Access is not granted"); - case Interop.Feedback.FeedbackError.OperationFailed: - default: - throw new InvalidOperationException("Failed to get supported information"); - } - } - return supported; - } - - /// - /// Plays a specific feedback pattern. - /// - /// - /// To play Vibration type, app should have http://tizen.org/privilege/haptic privilege. - /// - /// 3 - /// The feedback type. - /// The feedback pattern string. - /// Thrown when failed because feedback is not initialized. - /// Thrown when failed because of an invalid arguament. - /// Thrown when failed because the device (haptic, sound) or a specific pattern is not supported. - /// Thrown when failed because the access is not granted(No privilege) - /// Thrown when failed because of a system error. - /// http://tizen.org/privilege/haptic - /// - /// - /// Feedback feedback = new Feedback(); - /// feedback.Play(FeedbackType.All, "Tap"); - /// - /// - public void Play(FeedbackType type, String pattern) - { - bool found = false; - int i = 0; - Interop.Feedback.FeedbackError res; - - for (i = 0; i < Constants.NumberOfPattern; i++) - { - if (String.Compare(pattern, Pattern[i].PatternString) == 0) - { - found = true; - break; - } - } - - if (!found) - throw new ArgumentException("Invalid Arguments"); - - if (type == FeedbackType.All) - res = (Interop.Feedback.FeedbackError)Interop.Feedback.Play(Pattern[i].PatternNumber); - else - res = (Interop.Feedback.FeedbackError)Interop.Feedback.PlayType((Interop.Feedback.FeedbackType)type, Pattern[i].PatternNumber); - - if (res != Interop.Feedback.FeedbackError.None) - { - Log.Warn(LogTag, string.Format("Failed to play feedback. err = {0}", res)); - switch (res) - { - case Interop.Feedback.FeedbackError.NotInitialized: - throw new Exception("Not initialized"); - case Interop.Feedback.FeedbackError.InvalidParameter: - throw new ArgumentException("Invalid Arguments"); - case Interop.Feedback.FeedbackError.NotSupported: - throw new NotSupportedException("Not supported"); - case Interop.Feedback.FeedbackError.PermissionDenied: - throw new UnauthorizedAccessException("Access is not granted"); - case Interop.Feedback.FeedbackError.OperationFailed: - default: - throw new InvalidOperationException("Failed to play pattern"); - } - } - } - - /// - /// Stops to play the feedback. - /// - /// - /// To stop vibration, the application should have http://tizen.org/privilege/haptic privilege. - /// - /// 3 - /// Thrown when failed because the feedback is not initialized. - /// Thrown when failed because of an invalid arguament - /// Thrown when failed because the device (haptic, sound) or a specific pattern is not supported. - /// Thrown when failed because the access is not granted (No privilege). - /// Thrown when failed because of a system error. - /// http://tizen.org/privilege/haptic - /// - /// - /// Feedback Feedback1 = new Feedback(); - /// Feedback1.Stop(); - /// - /// - public void Stop() - { - Interop.Feedback.FeedbackError res = (Interop.Feedback.FeedbackError)Interop.Feedback.Stop(); - - if (res != Interop.Feedback.FeedbackError.None) - { - Log.Warn(LogTag, string.Format("Failed to stop feedback. err = {0}", res)); - switch (res) - { - case Interop.Feedback.FeedbackError.NotInitialized: - throw new Exception("Not initialized"); - case Interop.Feedback.FeedbackError.InvalidParameter: - throw new ArgumentException("Invalid Arguments"); - case Interop.Feedback.FeedbackError.NotSupported: - throw new NotSupportedException("Not supported"); - case Interop.Feedback.FeedbackError.PermissionDenied: - throw new UnauthorizedAccessException("Access is not granted"); - case Interop.Feedback.FeedbackError.OperationFailed: - default: - throw new InvalidOperationException("Failed to stop pattern"); - } - } - } - } -} diff --git a/src/Tizen.System.Feedback/Feedback/FeedbackPattern.cs b/src/Tizen.System.Feedback/Feedback/FeedbackPattern.cs deleted file mode 100644 index 3bb346fb7..000000000 --- a/src/Tizen.System.Feedback/Feedback/FeedbackPattern.cs +++ /dev/null @@ -1,33 +0,0 @@ -/* -* 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. -*/ - -namespace Tizen.System -{ - /// - /// String and enumeration for feedback patterns. - /// - internal struct FeedbackPattern - { - internal int PatternNumber; - internal string PatternString; - - internal FeedbackPattern(int n, string s) - { - PatternNumber = n; - PatternString = s; - } - } -} diff --git a/src/Tizen.System.Feedback/Feedback/FeedbackType.cs b/src/Tizen.System.Feedback/Feedback/FeedbackType.cs deleted file mode 100644 index e94fd3876..000000000 --- a/src/Tizen.System.Feedback/Feedback/FeedbackType.cs +++ /dev/null @@ -1,41 +0,0 @@ -/* -* 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. -*/ - -namespace Tizen.System -{ - /// - /// Enumeration for feedback device types. - /// - /// 3 - public enum FeedbackType - { - /// - /// Sound and vibration. - /// - /// 3 - All = 0, - /// - /// Sound feedback. - /// - /// 3 - Sound = Interop.Feedback.FeedbackType.Sound, - /// - /// Vibration feedback. - /// /// - /// 3 - Vibration = Interop.Feedback.FeedbackType.Vibration, - } -} diff --git a/src/Tizen.System.Feedback/Interop/Interop.Feedback.cs b/src/Tizen.System.Feedback/Interop/Interop.Feedback.cs deleted file mode 100644 index 6b3e5723c..000000000 --- a/src/Tizen.System.Feedback/Interop/Interop.Feedback.cs +++ /dev/null @@ -1,59 +0,0 @@ -/* -* 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 Feedback - { - internal enum FeedbackError - { - None = Tizen.Internals.Errors.ErrorCode.None, - OperationFailed = Tizen.Internals.Errors.ErrorCode.NotPermitted, - InvalidParameter = Tizen.Internals.Errors.ErrorCode.InvalidParameter, - NotSupported = Tizen.Internals.Errors.ErrorCode.NoSuchDevice, - PermissionDenied = Tizen.Internals.Errors.ErrorCode.PermissionDenied, - NotInitialized = -0x00020000 | 0x12, - } - - // Any change here might require changes in Tizen.System.FeedbackType enum - internal enum FeedbackType - { - Sound = 1, - Vibration = 2, - } - - [DllImport(Libraries.Feedback, EntryPoint = "feedback_initialize")] - internal static extern int Initialize(); - - [DllImport(Libraries.Feedback, EntryPoint = "feedback_deinitialize")] - internal static extern int Deinitialize(); - - [DllImport(Libraries.Feedback, EntryPoint = "feedback_play")] - internal static extern int Play(int pattern); - - [DllImport(Libraries.Feedback, EntryPoint = "feedback_play_type")] - internal static extern int PlayType(FeedbackType type, int pattern); - - [DllImport(Libraries.Feedback, EntryPoint = "feedback_stop")] - internal static extern int Stop(); - - [DllImport(Libraries.Feedback, EntryPoint = "feedback_is_supported_pattern")] - internal static extern int IsSupportedPattern(FeedbackType type, int pattern, out bool supported); - } -} diff --git a/src/Tizen.System.Feedback/Interop/Interop.Libraries.cs b/src/Tizen.System.Feedback/Interop/Interop.Libraries.cs deleted file mode 100644 index c84daae57..000000000 --- a/src/Tizen.System.Feedback/Interop/Interop.Libraries.cs +++ /dev/null @@ -1,23 +0,0 @@ -/* -* 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 - { - internal const string Feedback = "libfeedback.so.0"; - } -} diff --git a/src/Tizen.System.Feedback/Tizen.System.Feedback.csproj b/src/Tizen.System.Feedback/Tizen.System.Feedback.csproj deleted file mode 100644 index 4c51c4197..000000000 --- a/src/Tizen.System.Feedback/Tizen.System.Feedback.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - netstandard2.0 - - - - - - - - \ No newline at end of file diff --git a/src/Tizen.System.Feedback/Tizen.System.Feedback.sln b/src/Tizen.System.Feedback/Tizen.System.Feedback.sln deleted file mode 100755 index ebf5716a2..000000000 --- a/src/Tizen.System.Feedback/Tizen.System.Feedback.sln +++ /dev/null @@ -1,34 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26430.12 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.System.Feedback", "Tizen.System.Feedback.csproj", "{07D88466-8BF2-4477-96C9-84C066C7AB81}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen", "..\Tizen\Tizen.csproj", "{82ED038B-DF94-4EF8-B4C2-03342C580A57}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Log", "..\Tizen.Log\Tizen.Log.csproj", "{85B9CB65-3AEA-475D-A86D-DC4A9C1DF13E}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {07D88466-8BF2-4477-96C9-84C066C7AB81}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {07D88466-8BF2-4477-96C9-84C066C7AB81}.Debug|Any CPU.Build.0 = Debug|Any CPU - {07D88466-8BF2-4477-96C9-84C066C7AB81}.Release|Any CPU.ActiveCfg = Release|Any CPU - {07D88466-8BF2-4477-96C9-84C066C7AB81}.Release|Any CPU.Build.0 = Release|Any CPU - {82ED038B-DF94-4EF8-B4C2-03342C580A57}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {82ED038B-DF94-4EF8-B4C2-03342C580A57}.Debug|Any CPU.Build.0 = Debug|Any CPU - {82ED038B-DF94-4EF8-B4C2-03342C580A57}.Release|Any CPU.ActiveCfg = Release|Any CPU - {82ED038B-DF94-4EF8-B4C2-03342C580A57}.Release|Any CPU.Build.0 = Release|Any CPU - {85B9CB65-3AEA-475D-A86D-DC4A9C1DF13E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {85B9CB65-3AEA-475D-A86D-DC4A9C1DF13E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {85B9CB65-3AEA-475D-A86D-DC4A9C1DF13E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {85B9CB65-3AEA-475D-A86D-DC4A9C1DF13E}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/src/Tizen.System.Information/.vs/Tizen.System.Information/v14/.suo b/src/Tizen.System.Information/.vs/Tizen.System.Information/v14/.suo deleted file mode 100644 index e542b8945..000000000 Binary files a/src/Tizen.System.Information/.vs/Tizen.System.Information/v14/.suo and /dev/null differ diff --git a/src/Tizen.System.Information/Common/Information.cs b/src/Tizen.System.Information/Common/Information.cs deleted file mode 100755 index 5ec9dc01c..000000000 --- a/src/Tizen.System.Information/Common/Information.cs +++ /dev/null @@ -1,197 +0,0 @@ -/* -* Copyright (c) 2017 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.Collections.Generic; -using System.ComponentModel; -using System.IO; - -namespace Tizen.System -{ - /// - /// The Information class provides functions to obtain various system information. - /// - public static class Information - { - internal const string HttpPrefix = "http://"; - internal const string RuntimeInfoStringKeyPrefix = "tizen.org/runtimefeature/"; - - internal const string RuntimeInfoStringKeyBluetooth = "bluetooth"; - internal const string RuntimeInfoStringKeyTetheringWiFi = "tethering.wifi"; - internal const string RuntimeInfoStringKeyTetheringBluetooth = "tethering.bluetooth"; - internal const string RuntimeInfoStringKeyTetheringUsb = "tethering.usb"; - internal const string RuntimeInfoStringKeyPacketData = "packetdata"; - internal const string RuntimeInfoStringKeyDataRoaming = "dataroaming"; - internal const string RuntimeInfoStringKeyVibration = "vibration"; - internal const string RuntimeInfoStringKeyAudioJackConnected = "audiojack.connected"; - internal const string RuntimeInfoStringKeyBatteryCharging = "battery.charging"; - internal const string RuntimeInfoStringKeyTvOut = "tvout"; - internal const string RuntimeInfoStringKeyCharger = "charger"; - internal const string RuntimeInfoStringKeyAutoRotation = "autorotation"; - internal const string RuntimeInfoStringKeyGps = "gps"; - internal const string RuntimeInfoStringKeyAudioJackType = "audiojack.type"; - - - private static readonly Dictionary StringEnumMapping = new Dictionary - { - [RuntimeInfoStringKeyPrefix + RuntimeInfoStringKeyBluetooth] = RuntimeInfoKey.Bluetooth, - [RuntimeInfoStringKeyPrefix + RuntimeInfoStringKeyTetheringWiFi] = RuntimeInfoKey.WifiHotspot, - [RuntimeInfoStringKeyPrefix + RuntimeInfoStringKeyTetheringBluetooth] = RuntimeInfoKey.BluetoothTethering, - [RuntimeInfoStringKeyPrefix + RuntimeInfoStringKeyTetheringUsb] = RuntimeInfoKey.UsbTethering, - [RuntimeInfoStringKeyPrefix + RuntimeInfoStringKeyPacketData] = RuntimeInfoKey.PacketData, - [RuntimeInfoStringKeyPrefix + RuntimeInfoStringKeyDataRoaming] = RuntimeInfoKey.DataRoaming, - [RuntimeInfoStringKeyPrefix + RuntimeInfoStringKeyVibration] = RuntimeInfoKey.Vibration, - [RuntimeInfoStringKeyPrefix + RuntimeInfoStringKeyAudioJackConnected] = RuntimeInfoKey.AudioJack, - [RuntimeInfoStringKeyPrefix + RuntimeInfoStringKeyBatteryCharging] = RuntimeInfoKey.BatteryIsCharging, - [RuntimeInfoStringKeyPrefix + RuntimeInfoStringKeyTvOut] = RuntimeInfoKey.TvOut, - [RuntimeInfoStringKeyPrefix + RuntimeInfoStringKeyCharger] = RuntimeInfoKey.Charger, - [RuntimeInfoStringKeyPrefix + RuntimeInfoStringKeyAutoRotation] = RuntimeInfoKey.AutoRotation, - [RuntimeInfoStringKeyPrefix + RuntimeInfoStringKeyGps] = RuntimeInfoKey.Gps, - [RuntimeInfoStringKeyPrefix + RuntimeInfoStringKeyAudioJackType] = RuntimeInfoKey.AudioJackConnector - }; - - internal static readonly Dictionary EnumStringMapping = new Dictionary - { - [RuntimeInfoKey.Bluetooth] = RuntimeInfoStringKeyBluetooth, - [RuntimeInfoKey.WifiHotspot] = RuntimeInfoStringKeyTetheringWiFi, - [RuntimeInfoKey.BluetoothTethering] = RuntimeInfoStringKeyTetheringBluetooth, - [RuntimeInfoKey.UsbTethering] = RuntimeInfoStringKeyTetheringUsb, - [RuntimeInfoKey.PacketData] = RuntimeInfoStringKeyPacketData, - [RuntimeInfoKey.DataRoaming] = RuntimeInfoStringKeyDataRoaming, - [RuntimeInfoKey.Vibration] = RuntimeInfoStringKeyVibration, - [RuntimeInfoKey.AudioJack] = RuntimeInfoStringKeyAudioJackConnected, - [RuntimeInfoKey.BatteryIsCharging] = RuntimeInfoStringKeyBatteryCharging, - [RuntimeInfoKey.TvOut] = RuntimeInfoStringKeyTvOut, - [RuntimeInfoKey.Charger] = RuntimeInfoStringKeyCharger, - [RuntimeInfoKey.AutoRotation] = RuntimeInfoStringKeyAutoRotation, - [RuntimeInfoKey.Gps] = RuntimeInfoStringKeyGps, - [RuntimeInfoKey.AudioJackConnector] = RuntimeInfoStringKeyAudioJackType - }; - - [EditorBrowsable(EditorBrowsableState.Never)] - private static bool ConvertStringToRuntimeInfoKey(string key, out RuntimeInfoKey feature) - { - string filteredKey = key.StartsWith(HttpPrefix) ? key.Substring(HttpPrefix.Length) : key; - feature = default(RuntimeInfoKey); - - return StringEnumMapping.TryGetValue(filteredKey, out feature); - } - - [EditorBrowsable(EditorBrowsableState.Never)] - private static bool TryGetRuntimeInfoValue(RuntimeInfoKey key, out T value) - { - value = default(T); - - if (!RuntimeInfo.Is(key)) - { - Log.Error(InformationErrorFactory.LogTag, "Invalid return type"); - return false; - } - - return RuntimeInfo.TryGetValue(key, out value); - } - - [EditorBrowsable(EditorBrowsableState.Never)] - private static bool TryGetSystemInfoValue(string key, out T value) - { - value = default(T); - - if (!SystemInfo.IsValidKey(key)) - { - Log.Error(InformationErrorFactory.LogTag, "Invalid key"); - return false; - } - - if (!SystemInfo.Is(key)) - { - Log.Error(InformationErrorFactory.LogTag, "Invalid return type"); - return false; - } - - return SystemInfo.TryGetValue(key, out value); - } - - /// - /// Gets the value of the feature. - /// - /// 4 - /// The type of . - /// The name of the feature. - /// The value of the given feature. - /// Returns true on success, otherwise false. - public static bool TryGetValue(string key, out T value) - { - RuntimeInfoKey runtimeFeature; - - if (ConvertStringToRuntimeInfoKey(key, out runtimeFeature)) - { - return TryGetRuntimeInfoValue(runtimeFeature, out value); - } - else - { - return TryGetSystemInfoValue(key, out value); - } - } - - /// - /// Registers a change event callback for given runtime feature key. - /// - /// - /// This function is only for runtime feature. - /// - /// 4 - /// The name of runtime feature which wants to register callback. - /// The callback function to subscribe. - /// Thrown when the is invalid. - /// Thrown when the feature related is not supported. - public static void SetCallback(string key, EventHandler callback) - { - RuntimeInfoKey runtimeFeature; - - if (!ConvertStringToRuntimeInfoKey(key, out runtimeFeature)) - { - Log.Error(InformationErrorFactory.LogTag, "Invalid key"); - InformationErrorFactory.ThrowException(InformationError.InvalidParameter); - } - - RuntimeInfo.SetCallback(runtimeFeature, callback); - } - - /// - /// Unregisters a change event callback for given runtime feature key. - /// - /// - /// This function is only for runtime feature. - /// - /// 4 - /// The name of runtime feature which wants to unregister callback. - /// The callback function to unsubscribe. - /// Thrown when the is invalid. - /// Thrown when the feature related is not supported. - public static void UnsetCallback(string key, EventHandler callback) - { - RuntimeInfoKey runtimeFeature; - - if (!ConvertStringToRuntimeInfoKey(key, out runtimeFeature)) - { - Log.Error(InformationErrorFactory.LogTag, "Invalid key"); - InformationErrorFactory.ThrowException(InformationError.InvalidParameter); - } - - RuntimeInfo.UnsetCallback(runtimeFeature, callback); - } - } -} diff --git a/src/Tizen.System.Information/Common/InformationErrorFactory.cs b/src/Tizen.System.Information/Common/InformationErrorFactory.cs deleted file mode 100755 index 906961d16..000000000 --- a/src/Tizen.System.Information/Common/InformationErrorFactory.cs +++ /dev/null @@ -1,75 +0,0 @@ -/* -* 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.IO; -using System.ComponentModel; -using Tizen.Internals.Errors; - -namespace Tizen.System -{ - [EditorBrowsable(EditorBrowsableState.Never)] - internal enum InformationError - { - None = ErrorCode.None, - InvalidParameter = ErrorCode.InvalidParameter, - OutOfMemory = ErrorCode.OutOfMemory, - Io = ErrorCode.IoError, - RemoteIo = ErrorCode.RemoteIo, - PermissionDenied = ErrorCode.PermissionDenied, - NotSupported = ErrorCode.NotSupported, - NoData = ErrorCode.NoData - } - - [EditorBrowsable(EditorBrowsableState.Never)] - internal static class InformationErrorFactory - { - internal const string LogTag = "Tizen.System.Information"; - - internal static void ThrowException(InformationError err) - { - InformationError error = (InformationError)err; - if (error == InformationError.InvalidParameter) - { - throw new ArgumentException("Invalid parameter"); - } - else if (error == InformationError.OutOfMemory) - { - throw new OutOfMemoryException("Out of memory"); - } - else if (error == InformationError.Io) - { - throw new IOException("I/O Error"); - } - else if (error == InformationError.RemoteIo) - { - throw new IOException("Remote I/O Error"); - } - else if (error == InformationError.PermissionDenied) - { - throw new UnauthorizedAccessException("Permission denied"); - } - else if (error == InformationError.NotSupported) - { - throw new NotSupportedException("Not supported"); - } - else if (error == InformationError.NoData) - { - throw new NotSupportedException("No data"); - } - } - } -} diff --git a/src/Tizen.System.Information/Interop/Interop.Libraries.cs b/src/Tizen.System.Information/Interop/Interop.Libraries.cs deleted file mode 100644 index ddb18845f..000000000 --- a/src/Tizen.System.Information/Interop/Interop.Libraries.cs +++ /dev/null @@ -1,24 +0,0 @@ -/* -* 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 - { - internal const string RuntimeInfo = "libcapi-system-runtime-info.so.0"; - internal const string SystemInfo = "libcapi-system-info.so.0"; - } -} diff --git a/src/Tizen.System.Information/Interop/Interop.RuntimeInfo.cs b/src/Tizen.System.Information/Interop/Interop.RuntimeInfo.cs deleted file mode 100755 index d34d53aee..000000000 --- a/src/Tizen.System.Information/Interop/Interop.RuntimeInfo.cs +++ /dev/null @@ -1,104 +0,0 @@ -/* -* 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; -using Tizen.System; - -internal static partial class Interop -{ - internal static partial class RuntimeInfo - { - public delegate void RuntimeInformationChangedCallback(RuntimeInfoKey key, IntPtr userData); - - [StructLayout(LayoutKind.Sequential)] - public struct MemoryInfo - { - public readonly int Total; - public readonly int Used; - public readonly int Free; - public readonly int Cache; - public readonly int Swap; - } - - [StructLayout(LayoutKind.Sequential)] - public struct ProcessMemoryInfo - { - public readonly int Vsz; - public readonly int Rss; - public readonly int Pss; - public readonly int SharedClean; - public readonly int SharedDirty; - public readonly int PrivateClean; - public readonly int PrivateDirty; - } - - [StructLayout(LayoutKind.Sequential)] - public struct CpuUsage - { - public readonly double User; - public readonly double System; - public readonly double Nice; - public readonly double IoWait; - } - - [StructLayout(LayoutKind.Sequential)] - public struct ProcessCpuUsage - { - public readonly uint UTime; - public readonly uint STime; - } - - [DllImport(Libraries.RuntimeInfo, EntryPoint = "runtime_info_get_value_int")] - public static extern InformationError GetValue(RuntimeInfoKey key, out int status); - - [DllImport(Libraries.RuntimeInfo, EntryPoint = "runtime_info_get_value_bool")] - public static extern InformationError GetValue(RuntimeInfoKey key, out bool status); - - [DllImport(Libraries.RuntimeInfo, EntryPoint = "runtime_info_get_value_double")] - public static extern InformationError GetValue(RuntimeInfoKey key, out double status); - - [DllImport(Libraries.RuntimeInfo, EntryPoint = "runtime_info_get_value_string")] - public static extern InformationError GetValue(RuntimeInfoKey key, out string status); - - [DllImport(Libraries.RuntimeInfo, EntryPoint = "runtime_info_get_system_memory_info")] - public static extern InformationError GetSystemMemoryInfo(out MemoryInfo memoryInfo); - - [DllImport(Libraries.RuntimeInfo, EntryPoint = "runtime_info_get_process_memory_info")] - public static extern InformationError GetProcessMemoryInfo(int[] pid, int size, ref IntPtr array); - - [DllImport(Libraries.RuntimeInfo, EntryPoint = "runtime_info_get_cpu_usage")] - public static extern InformationError GetCpuUsage(out CpuUsage cpuUsage); - - [DllImport(Libraries.RuntimeInfo, EntryPoint = "runtime_info_get_process_cpu_usage")] - public static extern InformationError GetProcessCpuUsage(int[] pid, int size, ref IntPtr array); - - [DllImport(Libraries.RuntimeInfo, EntryPoint = "runtime_info_get_processor_count")] - public static extern InformationError GetProcessorCount(out int processorCount); - - [DllImport(Libraries.RuntimeInfo, EntryPoint = "runtime_info_get_processor_current_frequency")] - public static extern InformationError GetProcessorCurrentFrequency(int coreId, out int cpuFreq); - - [DllImport(Libraries.RuntimeInfo, EntryPoint = "runtime_info_get_processor_max_frequency")] - public static extern InformationError GetProcessorMaxFrequency(int coreId, out int cpuFreq); - - [DllImport(Libraries.RuntimeInfo, EntryPoint = "runtime_info_set_changed_cb")] - public static extern InformationError SetRuntimeInfoChangedCallback(RuntimeInfoKey runtimeInfoKey, RuntimeInformationChangedCallback cb, IntPtr userData); - - [DllImport(Libraries.RuntimeInfo, EntryPoint = "runtime_info_unset_changed_cb")] - public static extern InformationError UnsetRuntimeInfoChangedCallback(RuntimeInfoKey runtimeInfoKey); - } -} diff --git a/src/Tizen.System.Information/Interop/Interop.SystemInfo.cs b/src/Tizen.System.Information/Interop/Interop.SystemInfo.cs deleted file mode 100755 index 2e820bee9..000000000 --- a/src/Tizen.System.Information/Interop/Interop.SystemInfo.cs +++ /dev/null @@ -1,69 +0,0 @@ -/* -* 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 Tizen.System; -using System.Runtime.InteropServices; - -internal static partial class Interop -{ - internal static partial class SystemInfo - { - internal enum SystemInfoValueType - { - Bool = 0, - Int = 1, - Double = 2, - String = 3, - } - - internal enum SystemInfoType - { - platform, - Custom, - None, - } - - [DllImport(Libraries.SystemInfo, EntryPoint = "system_info_get_platform_type")] - internal static extern InformationError SystemInfoGetPlatformType(string key, out SystemInfoValueType type); - - [DllImport(Libraries.SystemInfo, EntryPoint = "system_info_get_custom_type")] - internal static extern InformationError SystemInfoGetCustomType(string key, out SystemInfoValueType type); - - [DllImport(Libraries.SystemInfo, EntryPoint = "system_info_get_platform_bool")] - internal static extern InformationError SystemInfoGetPlatformBool(string key, out bool value); - - [DllImport(Libraries.SystemInfo, EntryPoint = "system_info_get_platform_int")] - internal static extern InformationError SystemInfoGetPlatformInt(string key, out int value); - - [DllImport(Libraries.SystemInfo, EntryPoint = "system_info_get_platform_double")] - internal static extern InformationError SystemInfoGetPlatformDouble(string key, out double value); - - [DllImport(Libraries.SystemInfo, EntryPoint = "system_info_get_platform_string")] - internal static extern InformationError SystemInfoGetPlatformString(string key, out string value); - - [DllImport(Libraries.SystemInfo, EntryPoint = "system_info_get_custom_bool")] - internal static extern InformationError SystemInfoGetCustomBool(string key, out bool value); - - [DllImport(Libraries.SystemInfo, EntryPoint = "system_info_get_custom_int")] - internal static extern InformationError SystemInfoGetCustomInt(string key, out int value); - - [DllImport(Libraries.SystemInfo, EntryPoint = "system_info_get_custom_double")] - internal static extern InformationError SystemInfoGetCustomDouble(string key, out double value); - - [DllImport(Libraries.SystemInfo, EntryPoint = "system_info_get_custom_string")] - internal static extern InformationError SystemInfoGetCustomString(string key, out string value); - } -} diff --git a/src/Tizen.System.Information/RuntimeInfo/Enumerations.cs b/src/Tizen.System.Information/RuntimeInfo/Enumerations.cs deleted file mode 100755 index ea0281d95..000000000 --- a/src/Tizen.System.Information/RuntimeInfo/Enumerations.cs +++ /dev/null @@ -1,124 +0,0 @@ -/* -* 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.ComponentModel; - -namespace Tizen.System -{ - [EditorBrowsable(EditorBrowsableState.Never)] - /// - /// Enumeration for the runtime information key. - /// - internal enum RuntimeInfoKey - { - /// - /// Indicates whether Bluetooth is enabled. - /// - Bluetooth = 2, - /// - /// Indicates whether Wi-Fi hotspot is enabled. - /// - WifiHotspot = 3, - /// - /// Indicates whether Bluetooth tethering is enabled. - /// - BluetoothTethering = 4, - /// - /// Indicates whether USB tethering is enabled. - /// - UsbTethering = 5, - /// - /// Indicates whether packet data through 3G network is enabled. - /// - PacketData = 9, - /// - /// Indicates whether data roaming is enabled. - /// - DataRoaming = 10, - /// - /// Indicates whether vibration is enabled. - /// - Vibration = 12, - /// - /// Indicates whether audio jack is connected. - /// - AudioJack = 17, - /// - /// Indicates the current status of GPS. - /// - /// - Gps = 18, - /// - /// Indicates whether the battery is currently charging. - /// - BatteryIsCharging = 19, - /// - /// Indicates whether TV out is connected. - /// - TvOut = 20, - /// - /// Indicates change in the audio jack connector type. - /// - /// - AudioJackConnector = 21, - /// - /// Indicates whether the charger is connected. - /// - Charger = 24, - /// - /// Indicates whether auto rotation is enabled. - /// - AutoRotation = 26 - } - - /// - /// Enumeration for the GPS status. - /// - public enum GpsStatus - { - /// - /// The GPS is disabled. - /// - Disabled, - /// - /// The GPS is searching for satellites. - /// - Searching, - /// - /// The GPS connection is established. - /// - Connected - } - - /// - /// Enumeration for the type of audio jack connected. - /// - public enum AudioJackConnectionType - { - /// - /// The audio jack is not connected. - /// - Unconnected, - /// - /// The 3-conductor wire is connected. - /// - ThreeWireConnected, - /// - /// The 4-conductor wire is connected. - /// - FourWireConnected - } -} diff --git a/src/Tizen.System.Information/RuntimeInfo/RuntimeFeatureStatusChangedEventArgs.cs b/src/Tizen.System.Information/RuntimeInfo/RuntimeFeatureStatusChangedEventArgs.cs deleted file mode 100755 index dbfacd85f..000000000 --- a/src/Tizen.System.Information/RuntimeInfo/RuntimeFeatureStatusChangedEventArgs.cs +++ /dev/null @@ -1,32 +0,0 @@ -/* -* 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.System -{ - /// - /// RuntimeFeatureStatusChangedEventArgs is an extended EventArgs class. This class contains event arguments for runtime event listeners. - /// - public class RuntimeFeatureStatusChangedEventArgs : EventArgs - { - /// - /// The key indicating the runtime system preference which was changed. - /// It includes the prefix "http://" though you don't use for registering callback. - /// - public String Key { get; internal set; } - } -} diff --git a/src/Tizen.System.Information/RuntimeInfo/RuntimeInfo.cs b/src/Tizen.System.Information/RuntimeInfo/RuntimeInfo.cs deleted file mode 100755 index 9ce011a5e..000000000 --- a/src/Tizen.System.Information/RuntimeInfo/RuntimeInfo.cs +++ /dev/null @@ -1,219 +0,0 @@ -/* -* Copyright (c) 2016 - 2017 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.Collections.Generic; -using System.IO; -using System.ComponentModel; - -namespace Tizen.System -{ - [EditorBrowsable(EditorBrowsableState.Never)] - internal static class RuntimeInfo - { - private static RuntimeInfoEventHandler BluetoothEnabled = new RuntimeInfoEventHandler(RuntimeInfoKey.Bluetooth); - private static RuntimeInfoEventHandler WifiHotspotEnabled = new RuntimeInfoEventHandler(RuntimeInfoKey.WifiHotspot); - private static RuntimeInfoEventHandler BluetoothTetheringEnabled = new RuntimeInfoEventHandler(RuntimeInfoKey.BluetoothTethering); - private static RuntimeInfoEventHandler UsbTetheringEnabled = new RuntimeInfoEventHandler(RuntimeInfoKey.UsbTethering); - private static RuntimeInfoEventHandler PacketDataEnabled = new RuntimeInfoEventHandler(RuntimeInfoKey.PacketData); - private static RuntimeInfoEventHandler DataRoamingEnabled = new RuntimeInfoEventHandler(RuntimeInfoKey.DataRoaming); - private static RuntimeInfoEventHandler VibrationEnabled = new RuntimeInfoEventHandler(RuntimeInfoKey.Vibration); - private static RuntimeInfoEventHandler AudioJackConnected = new RuntimeInfoEventHandler(RuntimeInfoKey.AudioJack); - private static RuntimeInfoEventHandler GpsStatusChanged = new RuntimeInfoEventHandler(RuntimeInfoKey.Gps); - private static RuntimeInfoEventHandler BatteryIsCharging = new RuntimeInfoEventHandler(RuntimeInfoKey.BatteryIsCharging); - private static RuntimeInfoEventHandler TvOutConnected = new RuntimeInfoEventHandler(RuntimeInfoKey.TvOut); - private static RuntimeInfoEventHandler AudioJackConnectorChanged = new RuntimeInfoEventHandler(RuntimeInfoKey.AudioJackConnector); - private static RuntimeInfoEventHandler ChargerConnected = new RuntimeInfoEventHandler(RuntimeInfoKey.Charger); - private static RuntimeInfoEventHandler AutoRotationEnabled = new RuntimeInfoEventHandler(RuntimeInfoKey.AutoRotation); - - internal static readonly Dictionary s_keyDataTypeMapping = new Dictionary - { - [RuntimeInfoKey.Bluetooth] = typeof(bool), - [RuntimeInfoKey.WifiHotspot] = typeof(bool), - [RuntimeInfoKey.BluetoothTethering] = typeof(bool), - [RuntimeInfoKey.UsbTethering] = typeof(bool), - [RuntimeInfoKey.PacketData] = typeof(bool), - [RuntimeInfoKey.DataRoaming] = typeof(bool), - [RuntimeInfoKey.Vibration] = typeof(bool), - [RuntimeInfoKey.AudioJack] = typeof(bool), - [RuntimeInfoKey.BatteryIsCharging] = typeof(bool), - [RuntimeInfoKey.TvOut] = typeof(bool), - [RuntimeInfoKey.Charger] = typeof(bool), - [RuntimeInfoKey.AutoRotation] = typeof(bool), - [RuntimeInfoKey.Gps] = typeof(int), - [RuntimeInfoKey.AudioJackConnector] = typeof(int) - }; - - /// - /// Validates the data type of the status represented by the runtime key. - /// Note that this is a generic method. - /// - /// The generic type to validate. - /// The runtime information key for which the status type is validated. - /// True if the data type matches. - /// Thrown when the is invalid. - internal static bool Is(RuntimeInfoKey key) - { - if (!s_keyDataTypeMapping.ContainsKey(key)) - { - Log.Error(InformationErrorFactory.LogTag, "Invalid data type"); - throw new ArgumentException("Invalid parameter"); - } - - return s_keyDataTypeMapping[key] == typeof(T); - } - - /// - /// Gets the status of runtime key. - /// Note that this is a generic method. - /// - /// The generic type to return. - /// The runtime information key for which the current should be read. - /// The value of the given feature. - /// Returns true on success, otherwise false. - internal static bool TryGetValue(RuntimeInfoKey key, out T value) - { - Type type; - value = default(T); - - if (!s_keyDataTypeMapping.TryGetValue(key, out type)) - { - Log.Error(InformationErrorFactory.LogTag, "Invalid key"); - return false; - } - - if (type == typeof(bool)) - { - InformationError ret = Interop.RuntimeInfo.GetValue(TvProductHelper.ConvertKeyIfTvProduct(key), out bool val); - - if (ret != InformationError.None) - { - Log.Error(InformationErrorFactory.LogTag, "Interop failed to get value for key {0}", key.ToString()); - return false; - } - - value = (T)(object)val; - } - else if(type == typeof(int)) - { - InformationError ret = Interop.RuntimeInfo.GetValue(TvProductHelper.ConvertKeyIfTvProduct(key), out int val); - - if (ret != InformationError.None) - { - Log.Error(InformationErrorFactory.LogTag, "Interop failed to get value for key {0}", key.ToString()); - return false; - } - - value = (T)(object)val; - } - - return true; - } - - private static void FindEventHandler(RuntimeInfoKey key, ref RuntimeInfoEventHandler handler) - { - switch (key) - { - case RuntimeInfoKey.Bluetooth: - handler = BluetoothEnabled; - break; - case RuntimeInfoKey.WifiHotspot: - handler = WifiHotspotEnabled; - break; - case RuntimeInfoKey.BluetoothTethering: - handler = BluetoothTetheringEnabled; - break; - case RuntimeInfoKey.UsbTethering: - handler = UsbTetheringEnabled; - break; - case RuntimeInfoKey.PacketData: - handler = PacketDataEnabled; - break; - case RuntimeInfoKey.DataRoaming: - handler = DataRoamingEnabled; - break; - case RuntimeInfoKey.Vibration: - handler = VibrationEnabled; - break; - case RuntimeInfoKey.AudioJack: - handler = AudioJackConnected; - break; - case RuntimeInfoKey.Gps: - handler = GpsStatusChanged; - break; - case RuntimeInfoKey.BatteryIsCharging: - handler = BatteryIsCharging; - break; - case RuntimeInfoKey.TvOut: - handler = TvOutConnected; - break; - case RuntimeInfoKey.AudioJackConnector: - handler = AudioJackConnectorChanged; - break; - case RuntimeInfoKey.Charger: - handler = ChargerConnected; - break; - case RuntimeInfoKey.AutoRotation: - handler = AutoRotationEnabled; - break; - default: - handler = null; - break; - } - } - - /// - /// Registers a change event callback for given key. - /// - /// The runtime information key which wants to register callback. - /// The callback function to subscribe. - /// Thrown when the is invalid. - /// Thrown when the feature related is not supported. - internal static void SetCallback(RuntimeInfoKey key, EventHandler callback) - { - RuntimeInfoEventHandler handler = null; - - FindEventHandler(key, ref handler); - if (handler == null) - { - Log.Error(InformationErrorFactory.LogTag, "Invalid key"); - InformationErrorFactory.ThrowException(InformationError.InvalidParameter); - } - - handler.EventHandler += callback; - } - - /// - /// Unregisters a change event callback for given key. - /// - /// The runtime information key which wants to unregister callback. - /// The callback function to unsubscribe. - /// Thrown when the is invalid. - internal static void UnsetCallback(RuntimeInfoKey key, EventHandler callback) - { - RuntimeInfoEventHandler handler = null; - - FindEventHandler(key, ref handler); - if (handler == null) - { - Log.Error(InformationErrorFactory.LogTag, "Invalid key"); - InformationErrorFactory.ThrowException(InformationError.InvalidParameter); - } - - handler.EventHandler -= callback; - } - } -} diff --git a/src/Tizen.System.Information/RuntimeInfo/RuntimeInfoEventHandler.cs b/src/Tizen.System.Information/RuntimeInfo/RuntimeInfoEventHandler.cs deleted file mode 100755 index 733e0f1c4..000000000 --- a/src/Tizen.System.Information/RuntimeInfo/RuntimeInfoEventHandler.cs +++ /dev/null @@ -1,74 +0,0 @@ -/* -* Copyright (c) 2016 - 2017 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.ComponentModel; - -namespace Tizen.System -{ - [EditorBrowsable(EditorBrowsableState.Never)] - internal class RuntimeInfoEventHandler - { - private RuntimeInfoKey Key; - private event EventHandler Handler; - - internal RuntimeInfoEventHandler(RuntimeInfoKey key) - { - Key = key; - Handler = null; - } - - internal event EventHandler EventHandler - { - add - { - if (Handler == null) - { - InformationError ret = Interop.RuntimeInfo.SetRuntimeInfoChangedCallback(TvProductHelper.ConvertKeyIfTvProduct(Key), RuntimeInformationChangedCallback, IntPtr.Zero); - if (ret != InformationError.None) - { - Log.Error(InformationErrorFactory.LogTag, "Interop failed to add event handler"); - InformationErrorFactory.ThrowException(ret); - } - } - Handler += value; - } - remove - { - Handler -= value; - if (Handler == null) - { - InformationError ret = Interop.RuntimeInfo.UnsetRuntimeInfoChangedCallback(TvProductHelper.ConvertKeyIfTvProduct(Key)); - if (ret != InformationError.None) - { - Log.Error(InformationErrorFactory.LogTag, "Interop failed to add event handler"); - InformationErrorFactory.ThrowException(ret); - } - } - } - } - - private void RuntimeInformationChangedCallback(RuntimeInfoKey key, IntPtr userData) - { - RuntimeFeatureStatusChangedEventArgs eventArgs = new RuntimeFeatureStatusChangedEventArgs() - { - Key = Information.HttpPrefix + Information.RuntimeInfoStringKeyPrefix + (Information.EnumStringMapping.ContainsKey(key) ? Information.EnumStringMapping[key] : "Invalid") - }; - - Handler?.Invoke(null, eventArgs); - } - } -} diff --git a/src/Tizen.System.Information/RuntimeInfo/TvProductHelper.cs b/src/Tizen.System.Information/RuntimeInfo/TvProductHelper.cs deleted file mode 100755 index df9e3a249..000000000 --- a/src/Tizen.System.Information/RuntimeInfo/TvProductHelper.cs +++ /dev/null @@ -1,80 +0,0 @@ -/* -* Copyright (c) 2016 - 2017 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.Collections.Generic; -using System.ComponentModel; - -namespace Tizen.System -{ - [EditorBrowsable(EditorBrowsableState.Never)] - internal static class TvProductHelper - { - private static int is_TV_product = -1; - - private static readonly Dictionary s_keyTVkeyMapping = new Dictionary - { - [RuntimeInfoKey.Bluetooth] = 5, - [RuntimeInfoKey.WifiHotspot] = 6, - [RuntimeInfoKey.BluetoothTethering] = 7, - [RuntimeInfoKey.UsbTethering] = 8, - [RuntimeInfoKey.PacketData] = 13, - [RuntimeInfoKey.DataRoaming] = 14, - [RuntimeInfoKey.Vibration] = 16, - [RuntimeInfoKey.AudioJack] = 20, - [RuntimeInfoKey.BatteryIsCharging] = 22, - [RuntimeInfoKey.TvOut] = 18, - [RuntimeInfoKey.Charger] = 26, - [RuntimeInfoKey.AutoRotation] = 28, - [RuntimeInfoKey.Gps] = 21, - [RuntimeInfoKey.AudioJackConnector] = 20 - }; - - /// This function is for a TV product. It will be removed. - internal static RuntimeInfoKey ConvertKeyIfTvProduct(RuntimeInfoKey key) - { - bool is_key_existed = false; - string profile; - int key_TV = -1; - - if (is_TV_product == -1) - { - is_key_existed = SystemInfo.TryGetValue("http://com.samsung/build_config/product_type", out profile); - if (is_key_existed && String.Compare(profile, "TV") == 0) - { - is_TV_product = 1; - } - else - { - is_TV_product = 0; - } - } - - if (is_TV_product == 0) - { - return key; - } - else - { - if (!s_keyTVkeyMapping.TryGetValue(key, out key_TV)) - { - InformationErrorFactory.ThrowException(InformationError.InvalidParameter); - } - return (RuntimeInfoKey)key_TV; - } - } - } -} diff --git a/src/Tizen.System.Information/SystemInfo/SystemInfo.cs b/src/Tizen.System.Information/SystemInfo/SystemInfo.cs deleted file mode 100755 index dccc4bac4..000000000 --- a/src/Tizen.System.Information/SystemInfo/SystemInfo.cs +++ /dev/null @@ -1,262 +0,0 @@ -/* -* 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.ComponentModel; - -namespace Tizen.System -{ - [Obsolete("Use class Tizen.System.Information")] - [EditorBrowsable(EditorBrowsableState.Never)] - public static class SystemInfo - { - [EditorBrowsable(EditorBrowsableState.Never)] - private static Interop.SystemInfo.SystemInfoType GetValueType(string key, out Interop.SystemInfo.SystemInfoValueType valueType) - { - InformationError err = Interop.SystemInfo.SystemInfoGetPlatformType(key, out valueType); - if (err == InformationError.None) - { - return Interop.SystemInfo.SystemInfoType.platform; - } - - Log.Debug(InformationErrorFactory.LogTag, string.Format("Key {0} not in platform system info", key)); - err = Interop.SystemInfo.SystemInfoGetCustomType(key, out valueType); - if (err == InformationError.None) - { - return Interop.SystemInfo.SystemInfoType.Custom; - } - - Log.Debug(InformationErrorFactory.LogTag, string.Format("Key {0} not in custom system info", key)); - return Interop.SystemInfo.SystemInfoType.None; - } - - /// - /// Checks if the type of value for the given feature is T. - /// - /// Type of value for the feature key. - /// The name of the feature. - /// True if type of value for the given feature is T, otherwise false. - internal static bool Is(string key) - { - Interop.SystemInfo.SystemInfoValueType valueType; - Interop.SystemInfo.SystemInfoType keyType = GetValueType(key, out valueType); - if (keyType == Interop.SystemInfo.SystemInfoType.None) - { - return false; - } - - switch (valueType) - { - case Interop.SystemInfo.SystemInfoValueType.Bool: - return typeof(T) == typeof(bool); - case Interop.SystemInfo.SystemInfoValueType.Double: - return typeof(T) == typeof(double); - case Interop.SystemInfo.SystemInfoValueType.Int: - return typeof(T) == typeof(int); - case Interop.SystemInfo.SystemInfoValueType.String: - return typeof(T) == typeof(string); - } - return false; - } - - /// - /// Checks if the given key is a valid feature. - /// - /// The name of the feature. - /// True if the key is valid, otherwise false. - internal static bool IsValidKey(string key) - { - Interop.SystemInfo.SystemInfoValueType valueType; - return GetValueType(key, out valueType) != Interop.SystemInfo.SystemInfoType.None; - } - - /// - /// Gets the value of the feature. - /// - /// Type of key value. - /// The name of the feature. - /// The value of the given feature. - /// Returns true on success, otherwise false. - public static bool TryGetValue(string key, out T value) - { - bool res = false; - if (typeof(T) == typeof(bool)) - { - bool val; - res = TryGetValue(key, out val); - value = (T)(object)val; - } - else if (typeof(T) == typeof(int)) - { - int val; - res = TryGetValue(key, out val); - value = (T)(object)val; - } - else if (typeof(T) == typeof(double)) - { - double val; - res = TryGetValue(key, out val); - value = (T)(object)val; - } - else if (typeof(T) == typeof(string)) - { - string val; - res = TryGetValue(key, out val); - value = (T)(object)val; - } - else - { - value = default(T); - } - return res; - } - - /// - /// Gets the bool value of the feature. - /// - /// The name of the feature. - /// The value of the given feature. - /// Returns true on success, otherwise false. - public static bool TryGetValue(string key, out bool value) - { - Interop.SystemInfo.SystemInfoValueType valueType; - Interop.SystemInfo.SystemInfoType keyType = GetValueType(key, out valueType); - - InformationError err = InformationError.InvalidParameter; - if (keyType == Interop.SystemInfo.SystemInfoType.platform) - { - err = Interop.SystemInfo.SystemInfoGetPlatformBool(key, out value); - } - else if (keyType == Interop.SystemInfo.SystemInfoType.Custom) - { - err = Interop.SystemInfo.SystemInfoGetCustomBool(key, out value); - } else - { - value = false; - } - - if (err != InformationError.None) - { - Log.Warn(InformationErrorFactory.LogTag, string.Format("Failed to get value for key: {0}. err = {1}", key, err)); - return false; - } - - return true; - } - - /// - /// Gets the int value of the feature. - /// - /// The name of the feature. - /// The value of the given feature. - /// Returns true on success, otherwise false. - public static bool TryGetValue(string key, out int value) - { - Interop.SystemInfo.SystemInfoValueType valueType; - Interop.SystemInfo.SystemInfoType keyType = GetValueType(key, out valueType); - - InformationError err = InformationError.InvalidParameter; - if (keyType == Interop.SystemInfo.SystemInfoType.platform) - { - err = Interop.SystemInfo.SystemInfoGetPlatformInt(key, out value); - } - else if (keyType == Interop.SystemInfo.SystemInfoType.Custom) - { - err = Interop.SystemInfo.SystemInfoGetCustomInt(key, out value); - } - else - { - value = 0; - } - - if (err != InformationError.None) - { - Log.Warn(InformationErrorFactory.LogTag, string.Format("Failed to get value for key: {0}. err = {1}", key, err)); - return false; - } - - return true; - } - - /// - /// Gets the double value of the feature. - /// - /// The name of the feature. - /// The value of the given feature. - /// Returns true on success, otherwise false. - public static bool TryGetValue(string key, out double value) - { - Interop.SystemInfo.SystemInfoValueType valueType; - Interop.SystemInfo.SystemInfoType keyType = GetValueType(key, out valueType); - - InformationError err = InformationError.InvalidParameter; - if (keyType == Interop.SystemInfo.SystemInfoType.platform) - { - err = Interop.SystemInfo.SystemInfoGetPlatformDouble(key, out value); - } - else if (keyType == Interop.SystemInfo.SystemInfoType.Custom) - { - err = Interop.SystemInfo.SystemInfoGetCustomDouble(key, out value); - } - else - { - value = 0; - } - - if (err != InformationError.None) - { - Log.Warn(InformationErrorFactory.LogTag, string.Format("Failed to get value for key: {0}. err = {1}", key, err)); - return false; - } - - return true; - } - - /// - /// Gets the string value of the feature. - /// - /// The name of the feature. - /// The value of the given feature. - /// Returns true on success, otherwise false. - public static bool TryGetValue(string key, out string value) - { - Interop.SystemInfo.SystemInfoValueType valueType; - Interop.SystemInfo.SystemInfoType keyType = GetValueType(key, out valueType); - - InformationError err = InformationError.InvalidParameter; - if (keyType == Interop.SystemInfo.SystemInfoType.platform) - { - err = Interop.SystemInfo.SystemInfoGetPlatformString(key, out value); - } - else if (keyType == Interop.SystemInfo.SystemInfoType.Custom) - { - err = Interop.SystemInfo.SystemInfoGetCustomString(key, out value); - } - else - { - value = string.Empty; - } - - if (err != InformationError.None) - { - Log.Warn(InformationErrorFactory.LogTag, string.Format("Failed to get value for key: {0}. err = {1}", key, err)); - return false; - } - - return true; - } - } -} diff --git a/src/Tizen.System.Information/Tizen.System.Information.csproj b/src/Tizen.System.Information/Tizen.System.Information.csproj deleted file mode 100755 index 7f4584ffe..000000000 --- a/src/Tizen.System.Information/Tizen.System.Information.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - netstandard2.0 - - - - - - - - diff --git a/src/Tizen.System.Information/Tizen.System.Information.sln b/src/Tizen.System.Information/Tizen.System.Information.sln deleted file mode 100755 index edea34df5..000000000 --- a/src/Tizen.System.Information/Tizen.System.Information.sln +++ /dev/null @@ -1,34 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26430.12 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.System.Information", "Tizen.System.Information.csproj", "{6FFC2F92-C7D9-4D58-8A3A-8C239803350A}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen", "..\Tizen\Tizen.csproj", "{FABBAE4F-EA7A-424F-8497-DBB3A2F9F229}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Log", "..\Tizen.Log\Tizen.Log.csproj", "{E334BCA3-BF7F-4981-A814-299ADF54D37C}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {6FFC2F92-C7D9-4D58-8A3A-8C239803350A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6FFC2F92-C7D9-4D58-8A3A-8C239803350A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6FFC2F92-C7D9-4D58-8A3A-8C239803350A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6FFC2F92-C7D9-4D58-8A3A-8C239803350A}.Release|Any CPU.Build.0 = Release|Any CPU - {FABBAE4F-EA7A-424F-8497-DBB3A2F9F229}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {FABBAE4F-EA7A-424F-8497-DBB3A2F9F229}.Debug|Any CPU.Build.0 = Debug|Any CPU - {FABBAE4F-EA7A-424F-8497-DBB3A2F9F229}.Release|Any CPU.ActiveCfg = Release|Any CPU - {FABBAE4F-EA7A-424F-8497-DBB3A2F9F229}.Release|Any CPU.Build.0 = Release|Any CPU - {E334BCA3-BF7F-4981-A814-299ADF54D37C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E334BCA3-BF7F-4981-A814-299ADF54D37C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E334BCA3-BF7F-4981-A814-299ADF54D37C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E334BCA3-BF7F-4981-A814-299ADF54D37C}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/src/Tizen.System.Information/Usage/ProcessCpuUsage.cs b/src/Tizen.System.Information/Usage/ProcessCpuUsage.cs deleted file mode 100755 index 75a579c37..000000000 --- a/src/Tizen.System.Information/Usage/ProcessCpuUsage.cs +++ /dev/null @@ -1,123 +0,0 @@ -/* -* Copyright (c) 2016 - 2017 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.Collections.Generic; -using System.IO; -using System.Linq; -using System.Runtime.InteropServices; - -namespace Tizen.System -{ - /// - /// The class for CPU usage per process. - /// - public class ProcessCpuUsage - { - private int[] Pids; - private Interop.RuntimeInfo.ProcessCpuUsage[] Usages; - - /// - /// The constructor of ProcessCpuUsage class. - /// - /// 4 - /// List of unique process ids. - /// http://tizen.org/privilege/systemmonitor - /// Thrown when the is empty. - /// Thrown when an I/O error occurs while reading from the system or requesting to the resource management daemon. - /// Thrown when the memory is not enough to allocate. - /// Thrown when the caller does not have privilege to use this method. - public ProcessCpuUsage(IEnumerable pid) - { - Update(pid); - } - - /// - /// The number of usage entries. - /// - /// 4 - public int Count { get; internal set; } - - /// - /// Gets the amount of time this process has been scheduled in user mode. - /// - /// 4 - /// The process id. - /// The amount of time has been scheduled in user mode (clock ticks). - /// Thrown when the is invalid. - public uint GetUTime(int pid) - { - for (int i = 0; i < Count; i++) - if (pid == Pids[i]) - return Usages[i].UTime; - - Log.Error(InformationErrorFactory.LogTag, "Invalid pid"); - InformationErrorFactory.ThrowException(InformationError.InvalidParameter); - return 0; - } - - /// - /// Gets the amount of time this process has been scheduled in kernel mode. - /// - /// 4 - /// The process id. - /// The amount of time has been scheduled in kernel mode (clock ticks). - /// Thrown when the is invalid. - public uint GetSTime(int pid) - { - for (int i = 0; i < Count; i++) - if (pid == Pids[i]) - return Usages[i].STime; - - Log.Error(InformationErrorFactory.LogTag, "Invalid pid"); - InformationErrorFactory.ThrowException(InformationError.InvalidParameter); - return 0; - } - - /// - /// Update the process CPU usage to the latest. - /// - /// 4 - /// List of unique process ids. - /// http://tizen.org/privilege/systemmonitor - /// Thrown when the is empty. - /// Thrown when an I/O error occurs while reading from the system or requesting to the resource management daemon. - /// Thrown when the memory is not enough to allocate. - /// Thrown when the caller does not have privilege to use this method. - public void Update(IEnumerable pid) - { - InformationError ret; - - Pids = pid.ToArray(); - IntPtr ptr = new IntPtr(); - Count = Pids.Count(); - - ret = Interop.RuntimeInfo.GetProcessCpuUsage(Pids, Count, ref ptr); - if (ret != InformationError.None) - { - Log.Error(InformationErrorFactory.LogTag, "Interop failed to get Process cpu usage"); - InformationErrorFactory.ThrowException(ret); - } - - Usages = new Interop.RuntimeInfo.ProcessCpuUsage[Count]; - for (int i = 0; i < Count; i++) - { - Usages[i] = Marshal.PtrToStructure(ptr); - ptr += Marshal.SizeOf(); - } - } - } -} diff --git a/src/Tizen.System.Information/Usage/ProcessMemoryUsage.cs b/src/Tizen.System.Information/Usage/ProcessMemoryUsage.cs deleted file mode 100755 index c10c8c9c2..000000000 --- a/src/Tizen.System.Information/Usage/ProcessMemoryUsage.cs +++ /dev/null @@ -1,213 +0,0 @@ -/* -* Copyright (c) 2016 - 2017 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.Collections.Generic; -using System.IO; -using System.Linq; -using System.Runtime.InteropServices; - -namespace Tizen.System -{ - /// - /// The class for memory information per process. - /// - public class ProcessMemoryUsage - { - private int[] Pids; - private Interop.RuntimeInfo.ProcessMemoryInfo[] Usages; - - /// - /// The constructor of ProcessMemoryInformation class. - /// - /// 4 - /// List of unique process ids. - /// http://tizen.org/privilege/systemmonitor - /// Thrown when the is empty. - /// Thrown when an I/O error occurs while reading from the system or requesting to the resource management daemon. - /// Thrown when the memory is not enough to allocate. - /// Thrown when the caller does not have privilege to use this method. - public ProcessMemoryUsage(IEnumerable pid) - { - Update(pid); - } - - /// - /// The number of usage entries. - /// - /// 4 - public int Count { get; internal set; } - - /// - /// Gets the virtual memory size of a process. - /// - /// 4 - /// The process id. - /// The virtual memory size is using (KiB). - /// Thrown when the is invalid. - public int GetVsz(int pid) - { - for (int i = 0; i < Count; i++) - if (pid == Pids[i]) - return Usages[i].Vsz; - - Log.Error(InformationErrorFactory.LogTag, "Invalid pid"); - InformationErrorFactory.ThrowException(InformationError.InvalidParameter); - return 0; - } - - /// - /// Gets the resident set size of a process. - /// - /// 4 - /// The process id. - /// The resident set size is using (KiB). - /// Thrown when the is invalid. - public int GetRss(int pid) - { - for (int i = 0; i < Count; i++) - if (pid == Pids[i]) - return Usages[i].Rss; - - Log.Error(InformationErrorFactory.LogTag, "Invalid pid"); - InformationErrorFactory.ThrowException(InformationError.InvalidParameter); - return 0; - } - - /// - /// Gets the proportional set size of a process. - /// - /// 4 - /// The process id. - /// The proportional set size is using (KiB). - /// Thrown when the is invalid. - public int GetPss(int pid) - { - for (int i = 0; i < Count; i++) - if (pid == Pids[i]) - return Usages[i].Pss; - - Log.Error(InformationErrorFactory.LogTag, "Invalid pid"); - InformationErrorFactory.ThrowException(InformationError.InvalidParameter); - return 0; - } - - /// - /// Gets the size not modified and mapped by other processes of a process. - /// - /// 4 - /// The process id. - /// The shared clean memory size is using (KiB). - /// Thrown when the is invalid. - public int GetSharedClean(int pid) - { - for (int i = 0; i < Count; i++) - if (pid == Pids[i]) - return Usages[i].SharedClean; - - Log.Error(InformationErrorFactory.LogTag, "Invalid pid"); - InformationErrorFactory.ThrowException(InformationError.InvalidParameter); - return 0; - } - - /// - /// Gets the size modified and mapped by other processes of a process. - /// - /// 4 - /// The process id. - /// The shared dirty memory size is using (KiB). - /// Thrown when the is invalid. - public int GetSharedDirty(int pid) - { - for (int i = 0; i < Count; i++) - if (pid == Pids[i]) - return Usages[i].SharedDirty; - - Log.Error(InformationErrorFactory.LogTag, "Invalid pid"); - InformationErrorFactory.ThrowException(InformationError.InvalidParameter); - return 0; - } - - /// - /// Gets the size not modified and available only to that process of a process. - /// - /// 4 - /// The process id. - /// The private clean memory size is using (KiB). - /// Thrown when the is invalid. - public int GetPrivateClean(int pid) - { - for (int i = 0; i < Count; i++) - if (pid == Pids[i]) - return Usages[i].PrivateClean; - - Log.Error(InformationErrorFactory.LogTag, "Invalid pid"); - InformationErrorFactory.ThrowException(InformationError.InvalidParameter); - return 0; - } - - /// - /// Gets the size modified and available only to that process of a process. - /// - /// 4 - /// The process id. - /// The private dirty memory size is using (KiB). - /// Thrown when the is invalid. - public int GetPrivateDirty(int pid) - { - for (int i = 0; i < Count; i++) - if (pid == Pids[i]) - return Usages[i].PrivateDirty; - - Log.Error(InformationErrorFactory.LogTag, "Invalid pid"); - InformationErrorFactory.ThrowException(InformationError.InvalidParameter); - return 0; - } - - /// - /// Update the process memory information to the latest. - /// - /// 4 - /// List of unique process ids. - /// http://tizen.org/privilege/systemmonitor - /// Thrown when the is empty. - /// Thrown when an I/O error occurs while reading from the system or requesting to the resource management daemon. - /// Thrown when the memory is not enough to allocate. - /// Thrown when the caller does not have privilege to use this method. - public void Update(IEnumerable pid) - { - InformationError ret; - - Pids = pid.ToArray(); - IntPtr ptr = new IntPtr(); - Count = Pids.Count(); - - ret = Interop.RuntimeInfo.GetProcessMemoryInfo(Pids, Count, ref ptr); - if (ret != InformationError.None) - { - Log.Error(InformationErrorFactory.LogTag, "Interop failed to get Process cpu usage"); - InformationErrorFactory.ThrowException(ret); - } - - Usages = new Interop.RuntimeInfo.ProcessMemoryInfo[Count]; - for (int i = 0; i < Count; i++) - { - Usages[i] = Marshal.PtrToStructure(ptr); - ptr += Marshal.SizeOf(); - } - } - } -} diff --git a/src/Tizen.System.Information/Usage/SystemCpuUsage.cs b/src/Tizen.System.Information/Usage/SystemCpuUsage.cs deleted file mode 100755 index d72b4628e..000000000 --- a/src/Tizen.System.Information/Usage/SystemCpuUsage.cs +++ /dev/null @@ -1,180 +0,0 @@ -/* -* Copyright (c) 2016 - 2017 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.IO; - -namespace Tizen.System -{ - /// - /// The class for system CPU usage. - /// - public class SystemCpuUsage - { - private Interop.RuntimeInfo.CpuUsage Usage; - private int[] CurrentFrequencies; - private int[] MaxFrequencies; - - /// - /// The constructor of SystemCpuUsage class. - /// - /// 4 - /// Thrown when an I/O error occurs while reading from the system. - /// Thrown when this system does not store the current CPU frequency. - public SystemCpuUsage() - { - Update(); - } - - /// - /// Running time of un-niced user processes (Percent). - /// - /// 4 - public double User - { - get - { - return Usage.User; - } - } - - /// - /// Running time of kernel processes (Percent). - /// - /// 4 - public double System - { - get - { - return Usage.System; - } - } - - /// - /// Running time of niced user processes (Percent). - /// - /// 4 - public double Nice - { - get - { - return Usage.Nice; - } - } - - /// - /// Time waiting for I/O completion (Percent). - /// - /// 4 - public double IoWait - { - get - { - return Usage.IoWait; - } - } - - /// - /// The number of processors. - /// - /// 4 - public int ProcessorCount { get; internal set; } - - /// - /// Gets the current frequency of the processor. - /// - /// 4 - /// The index (from 0) of the CPU core that you want to know the frequency of. - /// The current frequency(MHz) of processor. - /// Thrown when the is invalid. - public int GetCurrentFrequency(int coreId) - { - if(coreId < 0 || coreId >= ProcessorCount) - { - Log.Error(InformationErrorFactory.LogTag, "Invalid core ID " + coreId); - InformationErrorFactory.ThrowException(InformationError.InvalidParameter); - } - - return CurrentFrequencies[coreId]; - } - - /// - /// Gets the max frequency of the processor. - /// - /// 4 - /// The index (from 0) of CPU core that you want to know the frequency of. - /// The max frequency(MHz) of processor. - /// Thrown when the is invalid. - public int GetMaxFrequency(int coreId) - { - if (coreId < 0 || coreId >= ProcessorCount) - { - Log.Error(InformationErrorFactory.LogTag, "Invalid core ID " + coreId); - InformationErrorFactory.ThrowException(InformationError.InvalidParameter); - } - - return MaxFrequencies[coreId]; - } - - /// - /// Update the system CPU usage to the latest. - /// - /// 4 - /// Thrown when an I/O error occurs while reading from the system. - /// Thrown when this system does not store the current CPU frequency. - public void Update() - { - InformationError ret; - int count; - - ret = Interop.RuntimeInfo.GetCpuUsage(out Usage); - if (ret != InformationError.None) - { - Log.Error(InformationErrorFactory.LogTag, "Interop failed to get cpu usage"); - InformationErrorFactory.ThrowException(ret); - } - - ret = Interop.RuntimeInfo.GetProcessorCount(out count); - if (ret != InformationError.None) - { - Log.Error(InformationErrorFactory.LogTag, "Interop failed to get Processor count"); - InformationErrorFactory.ThrowException(ret); - return; - } - - ProcessorCount = count; - CurrentFrequencies = new int[ProcessorCount]; - MaxFrequencies = new int[ProcessorCount]; - - for (int coreId = 0; coreId < ProcessorCount; coreId++) - { - ret = Interop.RuntimeInfo.GetProcessorCurrentFrequency(coreId, out CurrentFrequencies[coreId]); - if (ret != InformationError.None) - { - Log.Error(InformationErrorFactory.LogTag, "Interop failed to get the current frequency of processor " + coreId); - InformationErrorFactory.ThrowException(ret); - } - - ret = Interop.RuntimeInfo.GetProcessorMaxFrequency(coreId, out MaxFrequencies[coreId]); - if (ret != InformationError.None) - { - Log.Error(InformationErrorFactory.LogTag, "Interop failed to get the max frequency of processor " + coreId); - InformationErrorFactory.ThrowException(ret); - } - } - } - } -} diff --git a/src/Tizen.System.Information/Usage/SystemMemoryUsage.cs b/src/Tizen.System.Information/Usage/SystemMemoryUsage.cs deleted file mode 100755 index 41ec78f54..000000000 --- a/src/Tizen.System.Information/Usage/SystemMemoryUsage.cs +++ /dev/null @@ -1,113 +0,0 @@ -/* -* Copyright (c) 2016 - 2017 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.IO; - -namespace Tizen.System -{ - /// - /// The class for system memory information. - /// - public class SystemMemoryUsage - { - private Interop.RuntimeInfo.MemoryInfo Info; - - /// - /// The constructor of MemoryInformation class. - /// - /// 4 - /// Thrown when an I/O error occurs while reading from the system. - public SystemMemoryUsage() - { - Update(); - } - - /// - /// Total memory (KiB). - /// - /// 4 - public int Total - { - get - { - return Info.Total; - } - } - - /// - /// Used memory (KiB). - /// - /// 4 - public int Used - { - get - { - return Info.Used; - } - } - - /// - /// Free memory (KiB). - /// - /// 4 - public int Free - { - get - { - return Info.Free; - } - } - - /// - /// Cache memory (KiB). - /// - /// 4 - public int Cache - { - get - { - return Info.Cache; - } - } - - /// - /// Swap memory (KiB). - /// - /// 4 - public int Swap - { - get - { - return Info.Swap; - } - } - - /// - /// Update the system memory information to the latest. - /// - /// 4 - /// Thrown when I/O error occurs while reading from the system. - public void Update() - { - InformationError ret = Interop.RuntimeInfo.GetSystemMemoryInfo(out Info); - if (ret != InformationError.None) - { - Log.Error(InformationErrorFactory.LogTag, "Interop failed to get System memory information"); - InformationErrorFactory.ThrowException(ret); - } - } - } -} diff --git a/src/Tizen.System.MediaKey/Interop/Interop.Libraries.cs b/src/Tizen.System.MediaKey/Interop/Interop.Libraries.cs deleted file mode 100755 index 9902c9faf..000000000 --- a/src/Tizen.System.MediaKey/Interop/Interop.Libraries.cs +++ /dev/null @@ -1,23 +0,0 @@ -/* - * 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 MediaKey = "libcapi-system-media-key.so.0"; - } -} diff --git a/src/Tizen.System.MediaKey/Interop/Interop.MediaKey.cs b/src/Tizen.System.MediaKey/Interop/Interop.MediaKey.cs deleted file mode 100755 index d18aa9d9d..000000000 --- a/src/Tizen.System.MediaKey/Interop/Interop.MediaKey.cs +++ /dev/null @@ -1,60 +0,0 @@ -/* - * 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 MediaKey - { - internal enum KeyValue - { - Play, - Stop, - Pause, - Previous, - Next, - FastForward, - Rewind, - PlayPause, - Media, - Unknown - } - - internal enum KeyStatus - { - Pressed, - Released, - Unknown - } - - internal enum ErrorCode : int - { - None = Tizen.Internals.Errors.ErrorCode.None, - InvalidParameter = Tizen.Internals.Errors.ErrorCode.InvalidParameter, - OperationFailed = -0x02420000 | 0x01 - } - - internal delegate void EventCallback(KeyValue value, KeyStatus status, IntPtr userData); - - [DllImport(Libraries.MediaKey, EntryPoint = "media_key_reserve")] - internal static extern ErrorCode Reserve(EventCallback callback, IntPtr userData); - - [DllImport(Libraries.MediaKey, EntryPoint = "media_key_release")] - internal static extern ErrorCode Release(); - } -} diff --git a/src/Tizen.System.MediaKey/Tizen.System.MediaKey.csproj b/src/Tizen.System.MediaKey/Tizen.System.MediaKey.csproj deleted file mode 100644 index 4c51c4197..000000000 --- a/src/Tizen.System.MediaKey/Tizen.System.MediaKey.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - netstandard2.0 - - - - - - - - \ No newline at end of file diff --git a/src/Tizen.System.MediaKey/Tizen.System.MediaKey.sln b/src/Tizen.System.MediaKey/Tizen.System.MediaKey.sln deleted file mode 100755 index 0a5e2cb51..000000000 --- a/src/Tizen.System.MediaKey/Tizen.System.MediaKey.sln +++ /dev/null @@ -1,34 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26430.12 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.System.MediaKey", "Tizen.System.MediaKey.csproj", "{9856F9DA-1E0B-4CE2-91A9-F68F7366901C}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen", "..\Tizen\Tizen.csproj", "{86463940-1D9C-416E-9928-6B85B4BF3A5F}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Log", "..\Tizen.Log\Tizen.Log.csproj", "{2AD70B7D-131C-42D5-9C5D-63C1DD47E93F}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {9856F9DA-1E0B-4CE2-91A9-F68F7366901C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {9856F9DA-1E0B-4CE2-91A9-F68F7366901C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {9856F9DA-1E0B-4CE2-91A9-F68F7366901C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {9856F9DA-1E0B-4CE2-91A9-F68F7366901C}.Release|Any CPU.Build.0 = Release|Any CPU - {86463940-1D9C-416E-9928-6B85B4BF3A5F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {86463940-1D9C-416E-9928-6B85B4BF3A5F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {86463940-1D9C-416E-9928-6B85B4BF3A5F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {86463940-1D9C-416E-9928-6B85B4BF3A5F}.Release|Any CPU.Build.0 = Release|Any CPU - {2AD70B7D-131C-42D5-9C5D-63C1DD47E93F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {2AD70B7D-131C-42D5-9C5D-63C1DD47E93F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {2AD70B7D-131C-42D5-9C5D-63C1DD47E93F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {2AD70B7D-131C-42D5-9C5D-63C1DD47E93F}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/src/Tizen.System.MediaKey/Tizen.System/MediaKey.cs b/src/Tizen.System.MediaKey/Tizen.System/MediaKey.cs deleted file mode 100755 index 38a69c5c9..000000000 --- a/src/Tizen.System.MediaKey/Tizen.System/MediaKey.cs +++ /dev/null @@ -1,176 +0,0 @@ -/* - * 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.System -{ - /// - /// The class for event arguments of the media key. - /// - public class MediaKeyEventArgs : EventArgs - { - /// - /// Enumeration for the key value. - /// - /// 3 - public enum KeyValue - { - /// - /// The play key. - /// - Play, - - /// - /// The stop key. - /// - Stop, - - /// - /// The pause key. - /// - Pause, - - /// - /// The previous key. - /// - Previous, - - /// - /// The next key. - /// - Next, - - /// - /// The fast forward key. - /// - FastForward, - - /// - /// The rewind key. - /// - Rewind, - - /// - /// The play-pause key. - /// - PlayPause, - - /// - /// The media key for the earjack. - /// - Media, - - /// - /// The unknown key. - /// - Unknown - } - - /// - /// Enumeration for the key status. - /// - /// 3 - public enum KeyStatus - { - /// - /// The pressed status. - /// - Pressed, - - /// - /// The released status. - /// - Released, - - /// - /// The unknown status. - /// - Unknown - } - - /// - /// The key value. - /// - /// 3 - public KeyValue Value { get; internal set; } - - /// - /// The key status. - /// - /// 3 - public KeyStatus Status { get; internal set; } - } - - /// - /// The class for receiving events of media keys. - /// - public static class MediaKey - { - private static EventHandler s_eventHandler; - private static Interop.MediaKey.EventCallback s_callback; - - private static void OnEvent(Interop.MediaKey.KeyValue value, Interop.MediaKey.KeyStatus status, IntPtr userData) - { - s_eventHandler?.Invoke(null, new MediaKeyEventArgs() - { - Value = (MediaKeyEventArgs.KeyValue)value, - Status = (MediaKeyEventArgs.KeyStatus)status - }); - } - - /// - /// Adds or removes events for all media keys. - /// - /// 3 - /// Failed to reserve or release the key. - public static event EventHandler Event - { - add - { - if (s_eventHandler == null) - { - if (s_callback == null) - s_callback = new Interop.MediaKey.EventCallback(OnEvent); - Interop.MediaKey.ErrorCode err = Interop.MediaKey.Reserve(s_callback, IntPtr.Zero); - - if (err != Interop.MediaKey.ErrorCode.None) - { - throw new InvalidOperationException("Failed to reserve key. err = " + err); - } - - } - s_eventHandler += value; - - } - remove - { - s_eventHandler -= value; - if (s_eventHandler == null) - { - Interop.MediaKey.ErrorCode err = Interop.MediaKey.Release(); - - if (err != Interop.MediaKey.ErrorCode.None) - { - throw new InvalidOperationException("Failed to release key. err = " + err); - } - s_callback = null; - } - } - } - } -} - diff --git a/src/Tizen.System.PlatformConfig/Interop/Interop.PlatformConfig.cs b/src/Tizen.System.PlatformConfig/Interop/Interop.PlatformConfig.cs deleted file mode 100755 index bdcdf7bc2..000000000 --- a/src/Tizen.System.PlatformConfig/Interop/Interop.PlatformConfig.cs +++ /dev/null @@ -1,41 +0,0 @@ -/* - * 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.Runtime.InteropServices; -using System; - -internal static partial class Interop -{ - internal static partial class Libraries - { - public const string PlatformConfig = "libtzplatform-config-2.0.so.2"; - } - - internal static partial class PlatformConfig - { - [DllImport(Libraries.PlatformConfig, EntryPoint = "tzplatform_getenv", CallingConvention = CallingConvention.Cdecl)] - internal static extern IntPtr _GetEnv(int id); - - [DllImport(Libraries.PlatformConfig, EntryPoint = "tzplatform_getid", CallingConvention = CallingConvention.Cdecl)] - internal static extern int GetId(string name); - - internal static string GetEnv(int id) - { - var text = _GetEnv(id); - return Marshal.PtrToStringAnsi(text); - } - } -} diff --git a/src/Tizen.System.PlatformConfig/Tizen.System.PlatformConfig.csproj b/src/Tizen.System.PlatformConfig/Tizen.System.PlatformConfig.csproj deleted file mode 100644 index 4c51c4197..000000000 --- a/src/Tizen.System.PlatformConfig/Tizen.System.PlatformConfig.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - netstandard2.0 - - - - - - - - \ No newline at end of file diff --git a/src/Tizen.System.PlatformConfig/Tizen.System.PlatformConfig.sln b/src/Tizen.System.PlatformConfig/Tizen.System.PlatformConfig.sln deleted file mode 100755 index 16b928d59..000000000 --- a/src/Tizen.System.PlatformConfig/Tizen.System.PlatformConfig.sln +++ /dev/null @@ -1,34 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26430.12 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.System.PlatformConfig", "Tizen.System.PlatformConfig.csproj", "{E2CDAE3B-9A1E-4BCA-9420-6E23225CA661}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen", "..\Tizen\Tizen.csproj", "{5DF94605-55E3-432D-A830-FF1920796A75}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Log", "..\Tizen.Log\Tizen.Log.csproj", "{B2F4BFB5-B446-418C-A4F4-351B660BEB14}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {E2CDAE3B-9A1E-4BCA-9420-6E23225CA661}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E2CDAE3B-9A1E-4BCA-9420-6E23225CA661}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E2CDAE3B-9A1E-4BCA-9420-6E23225CA661}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E2CDAE3B-9A1E-4BCA-9420-6E23225CA661}.Release|Any CPU.Build.0 = Release|Any CPU - {5DF94605-55E3-432D-A830-FF1920796A75}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {5DF94605-55E3-432D-A830-FF1920796A75}.Debug|Any CPU.Build.0 = Debug|Any CPU - {5DF94605-55E3-432D-A830-FF1920796A75}.Release|Any CPU.ActiveCfg = Release|Any CPU - {5DF94605-55E3-432D-A830-FF1920796A75}.Release|Any CPU.Build.0 = Release|Any CPU - {B2F4BFB5-B446-418C-A4F4-351B660BEB14}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B2F4BFB5-B446-418C-A4F4-351B660BEB14}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B2F4BFB5-B446-418C-A4F4-351B660BEB14}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B2F4BFB5-B446-418C-A4F4-351B660BEB14}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/src/Tizen.System.PlatformConfig/Tizen.System/PlatformConfig.cs b/src/Tizen.System.PlatformConfig/Tizen.System/PlatformConfig.cs deleted file mode 100755 index 093f3b25d..000000000 --- a/src/Tizen.System.PlatformConfig/Tizen.System/PlatformConfig.cs +++ /dev/null @@ -1,37 +0,0 @@ -/* - * 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.IO; -using System.Runtime.CompilerServices; -using System.ComponentModel; - -namespace Tizen.System -{ - [EditorBrowsable(EditorBrowsableState.Never)] - public class PlatformConfig - { - private static int GetId(string name) - { - return Interop.PlatformConfig.GetId(name); - } - - public static string GetEnv(string name) - { - return Interop.PlatformConfig.GetEnv(Interop.PlatformConfig.GetId(name)); - } - } -} diff --git a/src/Tizen.System.Storage/Interop/Interop.Libraries.cs b/src/Tizen.System.Storage/Interop/Interop.Libraries.cs deleted file mode 100644 index 0180f70b3..000000000 --- a/src/Tizen.System.Storage/Interop/Interop.Libraries.cs +++ /dev/null @@ -1,23 +0,0 @@ -/* -* 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 - { - internal const string Storage = "libstorage.so.0.1"; - } -} diff --git a/src/Tizen.System.Storage/Interop/Interop.Storage.cs b/src/Tizen.System.Storage/Interop/Interop.Storage.cs deleted file mode 100644 index 5f04e0825..000000000 --- a/src/Tizen.System.Storage/Interop/Interop.Storage.cs +++ /dev/null @@ -1,96 +0,0 @@ -/* -* 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 Storage - { - internal enum ErrorCode - { - None = Tizen.Internals.Errors.ErrorCode.None, - InvalidParameter = Tizen.Internals.Errors.ErrorCode.InvalidParameter, - OutOfMemory = Tizen.Internals.Errors.ErrorCode.OutOfMemory, - NotSupported = Tizen.Internals.Errors.ErrorCode.NoSuchDevice, - OperationFailed = -0x00020000 | 0x12, - } - - // Any change here might require changes in Tizen.System.StorageArea enum - internal enum StorageArea - { - Internal = 0, - External = 1, - } - - // Any change here might require changes in Tizen.System.StorageState enum - internal enum StorageState - { - Unmountable = -2, - Removed = -1, - Mounted = 0, - MountedReadOnly = 1, - } - - // Any change here might require changes in Tizen.System.directoryType enum - internal enum DirectoryType - { - Images = 0, - Sounds = 1, - Videos = 2, - Camera = 3, - Downloads = 4, - Music = 5, - Documents = 6, - Others = 7, - Ringtones = 8, - } - - [UnmanagedFunctionPointerAttribute(CallingConvention.Cdecl)] - internal delegate void StorageStateChangedCallback(int id, StorageState state, IntPtr userData); - - [DllImport(Libraries.Storage, EntryPoint = "storage_get_root_directory")] - internal static extern ErrorCode StorageGetRootDirectory(int id, out string path); - - [DllImport(Libraries.Storage, EntryPoint = "storage_get_directory")] - internal static extern ErrorCode StorageGetAbsoluteDirectory(int id, DirectoryType type, out string path); - - [DllImport(Libraries.Storage, EntryPoint = "storage_get_state")] - internal static extern ErrorCode StorageGetState(int id, out StorageState state); - - [DllImport(Libraries.Storage, EntryPoint = "storage_get_type")] - internal static extern ErrorCode StorageGetType(int id, out StorageArea type); - - [DllImport(Libraries.Storage, EntryPoint = "storage_set_state_changed_cb")] - internal static extern ErrorCode StorageSetStateChanged(int id, StorageStateChangedCallback callback, IntPtr userData); - - [DllImport(Libraries.Storage, EntryPoint = "storage_unset_state_changed_cb")] - internal static extern ErrorCode StorageUnsetStateChanged(int id, StorageStateChangedCallback callback); - - [DllImport(Libraries.Storage, EntryPoint = "storage_get_total_space")] - internal static extern ErrorCode StorageGetTotalSpace(int id, out ulong bytes); - - [DllImport(Libraries.Storage, EntryPoint = "storage_get_available_space")] - internal static extern ErrorCode StorageGetAvailableSpace(int id, out ulong bytes); - - [UnmanagedFunctionPointerAttribute(CallingConvention.Cdecl)] - internal delegate bool StorageDeviceSupportedCallback(int storageID, StorageArea type, StorageState state, string rootDirectory, IntPtr userData); - - [DllImport(Libraries.Storage, EntryPoint = "storage_foreach_device_supported")] - public static extern ErrorCode StorageManagerGetForeachDeviceSupported(StorageDeviceSupportedCallback callback, IntPtr userData); - } -} diff --git a/src/Tizen.System.Storage/Storage/DirectoryType.cs b/src/Tizen.System.Storage/Storage/DirectoryType.cs deleted file mode 100644 index e3b996f51..000000000 --- a/src/Tizen.System.Storage/Storage/DirectoryType.cs +++ /dev/null @@ -1,71 +0,0 @@ -/* -* 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. -*/ - -namespace Tizen.System -{ - /// - /// Enumeration for the DirectoryType storage. - /// - /// 3 - public enum DirectoryType - { - /// - /// Image directory. - /// - /// 3 - Images = Interop.Storage.DirectoryType.Images, - /// - /// Sounds directory. - /// - /// 3 - Sounds = Interop.Storage.DirectoryType.Sounds, - /// - /// Videos directory. - /// - /// 3 - Videos = Interop.Storage.DirectoryType.Videos, - /// - /// Camera directory. - /// - /// 3 - Camera = Interop.Storage.DirectoryType.Camera, - /// - /// Downloads directory. - /// - /// 3 - Downloads = Interop.Storage.DirectoryType.Downloads, - /// - /// Music directory. - /// - /// 3 - Music = Interop.Storage.DirectoryType.Music, - /// - /// Documents directory. - /// - /// 3 - Documents = Interop.Storage.DirectoryType.Documents, - /// - /// Others directory. - /// - /// 3 - Others = Interop.Storage.DirectoryType.Others, - /// - /// System ringtones directory is only available for an internal storage. - /// - /// 3 - Ringtones = Interop.Storage.DirectoryType.Ringtones, - } -} diff --git a/src/Tizen.System.Storage/Storage/Storage.cs b/src/Tizen.System.Storage/Storage/Storage.cs deleted file mode 100644 index adc6359c0..000000000 --- a/src/Tizen.System.Storage/Storage/Storage.cs +++ /dev/null @@ -1,224 +0,0 @@ -/* -* 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.System -{ - /// - /// The class to access the storage device information. - /// - public class Storage - { - private const string LogTag = "Tizen.System"; - private Interop.Storage.StorageState _state; - private ulong _totalSpace; - - internal Storage(int storageID, Interop.Storage.StorageArea storageType, Interop.Storage.StorageState storagestate, string rootDirectory) - { - Id = storageID; - StorageType = (StorageArea)storageType; - RootDirectory = rootDirectory; - _state = storagestate; - - Interop.Storage.ErrorCode err = Interop.Storage.StorageGetTotalSpace(Id, out _totalSpace); - if (err != Interop.Storage.ErrorCode.None) - { - Log.Warn(LogTag, string.Format("Failed to get total storage space for storage Id: {0}. err = {1}", Id, err)); - } - - s_stateChangedEventCallback = (id, state, userData) => - { - if (id == Id) - { - _state = state; - s_stateChangedEventHandler?.Invoke(this, EventArgs.Empty); - } - }; - } - - private EventHandler s_stateChangedEventHandler; - private Interop.Storage.StorageStateChangedCallback s_stateChangedEventCallback; - - private void RegisterStateChangedEvent() - { - Interop.Storage.ErrorCode err = Interop.Storage.StorageSetStateChanged(Id, s_stateChangedEventCallback, IntPtr.Zero); - if (err != Interop.Storage.ErrorCode.None) - { - Log.Warn(LogTag, string.Format("Failed to Register state changed event callback for storage Id: {0}. err = {1}", Id, err)); - } - } - - private void UnregisterStateChangedEvent() - { - Interop.Storage.ErrorCode err = Interop.Storage.StorageUnsetStateChanged(Id, s_stateChangedEventCallback); - if (err != Interop.Storage.ErrorCode.None) - { - Log.Warn(LogTag, string.Format("Failed to Register state changed event callback for storage Id: {0}. err = {1}", Id, err)); - } - } - - /// - /// StorageStateChanged event. This event is occurred when a storage state changes. - /// - /// - /// The storage state will be updated before calling the event handler. - /// - /// 3 - /// - /// - /// myStorage.StorageStateChanged += (s, e) => - /// { - /// var storage = s as Storage; - /// Console.WriteLine(string.Format("State Changed to {0}", storage.State)); - /// } - /// - /// - public event EventHandler StorageStateChanged - { - add - { - if (s_stateChangedEventHandler == null) - { - _state = (Interop.Storage.StorageState)State; - RegisterStateChangedEvent(); - } - s_stateChangedEventHandler += value; - } - remove - { - if (s_stateChangedEventHandler != null) - { - s_stateChangedEventHandler -= value; - if (s_stateChangedEventHandler == null) - { - UnregisterStateChangedEvent(); - } - } - } - } - - /// - /// The storage ID. - /// - /// 3 - public int Id { get; } - /// - /// The type of storage. - /// - /// 3 - public StorageArea StorageType { get; } - /// - /// The root directory for the storage. - /// - /// 3 - public string RootDirectory { get; } - /// - /// The total storage size in bytes. - /// - /// 3 - public ulong TotalSpace { get { return _totalSpace; } } - - /// - /// The StorageState. - /// - /// 3 - public StorageState State - { - get - { - if (s_stateChangedEventHandler == null) - { - Interop.Storage.ErrorCode err = Interop.Storage.StorageGetState(Id, out _state); - if (err != Interop.Storage.ErrorCode.None) - { - Log.Warn(LogTag, string.Format("Failed to get storage state for storage Id: {0}. err = {1}", Id, err)); - } - } - return (StorageState)_state; - } - } - - /// - /// The available storage size in bytes. - /// - /// 3 - public ulong AvaliableSpace - { - get - { - ulong available; - Interop.Storage.ErrorCode err = Interop.Storage.StorageGetAvailableSpace(Id, out available); - if (err != Interop.Storage.ErrorCode.None) - { - Log.Warn(LogTag, string.Format("Failed to get available storage stace for storage Id: {0}. err = {1}", Id, err)); - } - - return available; - } - } - - /// - /// Absolute path for a given directory type in the storage. - /// - /// - /// The returned directory path may not exist, so you must make sure that it exists before using it. - /// For accessing internal storage except the ringtones directory, the application should have http://tizen.org/privilege/mediastorage privilege. - /// For accessing ringtones directory, the application should have http://tizen.org/privilege/systemsettings privilege. - /// For accessing external storage, the application should have http://tizen.org/privilege/externalstorage privilege. - /// - /// 3 - /// Directory type. - /// Absolute path for a given directory type in the storage. - /// Thrown when failed because of an invalid argument. - /// Thrown when failed due to out of memory exception. - /// Thrown when failed if the storage is not supported or the application does not have the permission to access the directory path. - /// http://tizen.org/privilege/mediastorage - /// http://tizen.org/privilege/systemsettings - /// http://tizen.org/privilege/externalstorage - /// - /// - /// // To get the video directories for all the supported storage, - /// var storageList = StorageManager.Storages as List<Storage>; - /// foreach (var storage in storageList) - /// { - /// string pathForVideoDir = storage.GetAbsolutePath(DirectoryType.Videos); - /// } - /// - /// - public string GetAbsolutePath(DirectoryType dirType) - { - string path; - Interop.Storage.ErrorCode err = Interop.Storage.StorageGetAbsoluteDirectory(Id, (Interop.Storage.DirectoryType)dirType, out path); - if (err != Interop.Storage.ErrorCode.None) - { - Log.Warn(LogTag, string.Format("Failed to get package Id. err = {0}", err)); - switch (err) - { - case Interop.Storage.ErrorCode.InvalidParameter: - throw new ArgumentException("Invalid Arguments"); - case Interop.Storage.ErrorCode.OutOfMemory: - throw new OutOfMemoryException("Out of Memory"); - case Interop.Storage.ErrorCode.NotSupported: - throw new NotSupportedException("Operation Not Supported"); - default: - throw new InvalidOperationException("Error = " + err); - } - } - return path; - } - } -} diff --git a/src/Tizen.System.Storage/Storage/StorageArea.cs b/src/Tizen.System.Storage/Storage/StorageArea.cs deleted file mode 100644 index 2d9a26b5b..000000000 --- a/src/Tizen.System.Storage/Storage/StorageArea.cs +++ /dev/null @@ -1,36 +0,0 @@ -/* -* 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. -*/ - -namespace Tizen.System -{ - /// - /// Enumeration for the storage area types. - /// - /// 3 - public enum StorageArea - { - /// - /// Internal device storage (built-in storage in a device, non-removable). - /// - /// 3 - Internal = Interop.Storage.StorageArea.Internal, - /// - /// External storage. - /// - /// 3 - External = Interop.Storage.StorageArea.External, - } -} diff --git a/src/Tizen.System.Storage/Storage/StorageManager.cs b/src/Tizen.System.Storage/Storage/StorageManager.cs deleted file mode 100644 index 0335b2e90..000000000 --- a/src/Tizen.System.Storage/Storage/StorageManager.cs +++ /dev/null @@ -1,53 +0,0 @@ -/* -* 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.Collections.Generic; - -namespace Tizen.System -{ - /// - /// The StorageManager provides the properties or methods to access storage in the device. - /// - public static class StorageManager - { - private const string LogTag = "Tizen.System"; - - /// - /// List of all storage in the device. - /// - /// 3 - public static IEnumerable Storages - { - get - { - List storageList = new List(); - Interop.Storage.StorageDeviceSupportedCallback cb = (int storageID, Interop.Storage.StorageArea type, Interop.Storage.StorageState state, string rootDirectory, IntPtr userData) => - { - storageList.Add(new Storage(storageID, type, state, rootDirectory)); - return true; - }; - - Interop.Storage.ErrorCode err = Interop.Storage.StorageManagerGetForeachDeviceSupported(cb, IntPtr.Zero); - if (err != Interop.Storage.ErrorCode.None) - { - Log.Warn(LogTag, string.Format("Failed to get storage list. err = {0}", err)); - } - return storageList; - } - } - } -} diff --git a/src/Tizen.System.Storage/Storage/StorageState.cs b/src/Tizen.System.Storage/Storage/StorageState.cs deleted file mode 100644 index fc60550e1..000000000 --- a/src/Tizen.System.Storage/Storage/StorageState.cs +++ /dev/null @@ -1,46 +0,0 @@ -/* -* 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. -*/ - -namespace Tizen.System -{ - /// - /// Enumeration for the state of storage devices. - /// - /// 3 - public enum StorageState - { - /// - /// The storage is present but cannot be mounted. Typically, it happens if the file system of the storage is corrupted. - /// - /// 3 - Unmountable = Interop.Storage.StorageState.Unmountable, - /// - /// The storage is not present or removed. - /// - /// 3 - Removed = Interop.Storage.StorageState.Removed, - /// - /// The storage is mounted with read/write access. - /// - /// 3 - Mounted = Interop.Storage.StorageState.Mounted, - /// - /// The storage is mounted with read-only access. - /// - /// 3 - MountedReadOnly = Interop.Storage.StorageState.MountedReadOnly, - } -} diff --git a/src/Tizen.System.Storage/Tizen.System.Storage.csproj b/src/Tizen.System.Storage/Tizen.System.Storage.csproj deleted file mode 100644 index 4c51c4197..000000000 --- a/src/Tizen.System.Storage/Tizen.System.Storage.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - netstandard2.0 - - - - - - - - \ No newline at end of file diff --git a/src/Tizen.System.Storage/Tizen.System.Storage.sln b/src/Tizen.System.Storage/Tizen.System.Storage.sln deleted file mode 100755 index ba236b602..000000000 --- a/src/Tizen.System.Storage/Tizen.System.Storage.sln +++ /dev/null @@ -1,34 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26430.12 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.System.Storage", "Tizen.System.Storage.csproj", "{D12EC4B0-E131-4B3A-8195-1E4B29F06323}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen", "..\Tizen\Tizen.csproj", "{B8571691-4533-4CD5-8FD9-8F0F7E100923}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Log", "..\Tizen.Log\Tizen.Log.csproj", "{4FD8A49E-BE20-4138-81F4-732A281197E5}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {D12EC4B0-E131-4B3A-8195-1E4B29F06323}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D12EC4B0-E131-4B3A-8195-1E4B29F06323}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D12EC4B0-E131-4B3A-8195-1E4B29F06323}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D12EC4B0-E131-4B3A-8195-1E4B29F06323}.Release|Any CPU.Build.0 = Release|Any CPU - {B8571691-4533-4CD5-8FD9-8F0F7E100923}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B8571691-4533-4CD5-8FD9-8F0F7E100923}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B8571691-4533-4CD5-8FD9-8F0F7E100923}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B8571691-4533-4CD5-8FD9-8F0F7E100923}.Release|Any CPU.Build.0 = Release|Any CPU - {4FD8A49E-BE20-4138-81F4-732A281197E5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {4FD8A49E-BE20-4138-81F4-732A281197E5}.Debug|Any CPU.Build.0 = Debug|Any CPU - {4FD8A49E-BE20-4138-81F4-732A281197E5}.Release|Any CPU.ActiveCfg = Release|Any CPU - {4FD8A49E-BE20-4138-81F4-732A281197E5}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/src/Tizen.System.SystemSettings/Interop/Interop.SystemSettings.cs b/src/Tizen.System.SystemSettings/Interop/Interop.SystemSettings.cs deleted file mode 100644 index 3925cd58f..000000000 --- a/src/Tizen.System.SystemSettings/Interop/Interop.SystemSettings.cs +++ /dev/null @@ -1,52 +0,0 @@ -/* - * 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; -using Tizen.System; - -internal static partial class Interop -{ - internal static partial class Settings - { - [DllImport("capi-system-system-settings.so.0", EntryPoint = "system_settings_set_value_int", CallingConvention = CallingConvention.Cdecl)] - internal static extern int SystemSettingsSetValueInt(SystemSettingsKeys key, int value); - - [DllImport("capi-system-system-settings.so.0", EntryPoint = "system_settings_set_value_bool", CallingConvention = CallingConvention.Cdecl)] - internal static extern int SystemSettingsSetValueBool(SystemSettingsKeys key, bool value); - - [DllImport("capi-system-system-settings.so.0", EntryPoint = "system_settings_set_value_string", CallingConvention = CallingConvention.Cdecl)] - internal static extern int SystemSettingsSetValueString(SystemSettingsKeys key, string value); - - - [DllImport("capi-system-system-settings.so.0", EntryPoint = "system_settings_get_value_int", CallingConvention = CallingConvention.Cdecl)] - internal static extern int SystemSettingsGetValueInt(SystemSettingsKeys key, out int value); - - [DllImport("capi-system-system-settings.so.0", EntryPoint = "system_settings_get_value_bool", CallingConvention = CallingConvention.Cdecl)] - internal static extern int SystemSettingsGetValueBool(SystemSettingsKeys key, out bool value); - - [DllImport("capi-system-system-settings.so.0", EntryPoint = "system_settings_get_value_string", CallingConvention = CallingConvention.Cdecl)] - internal static extern int SystemSettingsGetValueString(SystemSettingsKeys key, out string value); - - // Callback - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void SystemSettingsChangedCallback(SystemSettingsKeys key, IntPtr data); - [DllImport("capi-system-system-settings.so.0", EntryPoint = "system_settings_set_changed_cb", CallingConvention = CallingConvention.Cdecl)] - internal static extern int SystemSettingsSetCallback(SystemSettingsKeys systemSettingsKey, SystemSettingsChangedCallback cb, IntPtr data); - [DllImport("capi-system-system-settings.so.0", EntryPoint = "system_settings_unset_changed_cb", CallingConvention = CallingConvention.Cdecl)] - internal static extern int SystemSettingsRemoveCallback(SystemSettingsKeys systemSettingsKey); - } -} diff --git a/src/Tizen.System.SystemSettings/Tizen.System.SystemSettings.csproj b/src/Tizen.System.SystemSettings/Tizen.System.SystemSettings.csproj deleted file mode 100644 index 7f4584ffe..000000000 --- a/src/Tizen.System.SystemSettings/Tizen.System.SystemSettings.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - netstandard2.0 - - - - - - - - diff --git a/src/Tizen.System.SystemSettings/Tizen.System.SystemSettings.sln b/src/Tizen.System.SystemSettings/Tizen.System.SystemSettings.sln deleted file mode 100755 index bd62df9bf..000000000 --- a/src/Tizen.System.SystemSettings/Tizen.System.SystemSettings.sln +++ /dev/null @@ -1,34 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26430.12 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.System.SystemSettings", "Tizen.System.SystemSettings.csproj", "{608ECBF5-4D2F-4B89-9EB1-B435017A46EC}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen", "..\Tizen\Tizen.csproj", "{6A20C62F-B0B8-4C28-8477-E1608654DD8F}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Log", "..\Tizen.Log\Tizen.Log.csproj", "{91413DDA-947D-40CA-B757-7CC7A651E257}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {608ECBF5-4D2F-4B89-9EB1-B435017A46EC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {608ECBF5-4D2F-4B89-9EB1-B435017A46EC}.Debug|Any CPU.Build.0 = Debug|Any CPU - {608ECBF5-4D2F-4B89-9EB1-B435017A46EC}.Release|Any CPU.ActiveCfg = Release|Any CPU - {608ECBF5-4D2F-4B89-9EB1-B435017A46EC}.Release|Any CPU.Build.0 = Release|Any CPU - {6A20C62F-B0B8-4C28-8477-E1608654DD8F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {6A20C62F-B0B8-4C28-8477-E1608654DD8F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {6A20C62F-B0B8-4C28-8477-E1608654DD8F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {6A20C62F-B0B8-4C28-8477-E1608654DD8F}.Release|Any CPU.Build.0 = Release|Any CPU - {91413DDA-947D-40CA-B757-7CC7A651E257}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {91413DDA-947D-40CA-B757-7CC7A651E257}.Debug|Any CPU.Build.0 = Debug|Any CPU - {91413DDA-947D-40CA-B757-7CC7A651E257}.Release|Any CPU.ActiveCfg = Release|Any CPU - {91413DDA-947D-40CA-B757-7CC7A651E257}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/src/Tizen.System.SystemSettings/Tizen.System.SystemSettings/SystemSettings.cs b/src/Tizen.System.SystemSettings/Tizen.System.SystemSettings/SystemSettings.cs deleted file mode 100755 index 2af722365..000000000 --- a/src/Tizen.System.SystemSettings/Tizen.System.SystemSettings/SystemSettings.cs +++ /dev/null @@ -1,1989 +0,0 @@ -/* - * 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.System -{ - /// - /// The System Settings API provides APIs for sharing the configuration over a system. - /// - /// - /// The System Settings API provides functions for getting the system configuration related to user preferences. - /// The main features of the System Settings API include accessing system-wide configurations, such as ringtones, wallpapers, and so on. - /// - public static class SystemSettings - { - /// - /// The file path of the current ringtone. - /// - /// http://tizen.org/privilege/systemsettings.admin - /// platform - public static string IncomingCallRingtone - { - get - { - string filePath; - SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsGetValueString(SystemSettingsKeys.IncomingCallRingtone, out filePath); - if (res != SystemSettingsError.None) - { - throw SystemSettingsExceptionFactory.CreateException(res, "unable to get IncomingCallRingtone system setting."); - } - return filePath; - } - set - { - SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsSetValueString(SystemSettingsKeys.IncomingCallRingtone, value); - if (res != SystemSettingsError.None) - { - throw SystemSettingsExceptionFactory.CreateException(res, "unable to set IncomingCallRingtone system setting."); - } - } - } - - /// - /// The file path of the current home-screen wallpaper. - /// - /// http://tizen.org/privilege/systemsettings.admin - /// platform - public static string WallpaperHomeScreen - { - get - { - string filePath; - SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsGetValueString(SystemSettingsKeys.WallpaperHomeScreen, out filePath); - if (res != SystemSettingsError.None) - { - throw SystemSettingsExceptionFactory.CreateException(res, "unable to get WallpaperHomeScreen system setting."); - } - return filePath; - } - set - { - SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsSetValueString(SystemSettingsKeys.WallpaperHomeScreen, value); - if (res != SystemSettingsError.None) - { - throw SystemSettingsExceptionFactory.CreateException(res, "unable to set WallpaperHomeScreen system setting."); - } - } - } - - /// - /// The file path of the current lock-screen wallpaper. - /// - /// http://tizen.org/privilege/systemsettings.admin - /// platform - public static string WallpaperLockScreen - { - get - { - string filePath; - SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsGetValueString(SystemSettingsKeys.WallpaperLockScreen, out filePath); - if (res != SystemSettingsError.None) - { - throw SystemSettingsExceptionFactory.CreateException(res, "unable to get WallpaperLockScreen system setting."); - } - return filePath; - } - set - { - SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsSetValueString(SystemSettingsKeys.WallpaperLockScreen, value); - if (res != SystemSettingsError.None) - { - throw SystemSettingsExceptionFactory.CreateException(res, "unable to set WallpaperLockScreen system setting."); - } - } - } - - /// - /// The current system font size. - /// - /// http://tizen.org/privilege/systemsettings.admin - /// platform - public static SystemSettingsFontSize FontSize - { - get - { - int fontSize; - SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsGetValueInt(SystemSettingsKeys.FontSize, out fontSize); - if (res != SystemSettingsError.None) - { - throw SystemSettingsExceptionFactory.CreateException(res, "unable to get FontSize system setting."); - } - return (SystemSettingsFontSize)fontSize; - } - set - { - SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsSetValueInt(SystemSettingsKeys.FontSize, (int)value); - if (res != SystemSettingsError.None) - { - throw SystemSettingsExceptionFactory.CreateException(res, "unable to set FontSize system setting."); - } - } - } - - /// - /// The current system font type. - /// - /// http://tizen.org/privilege/systemsettings.admin - /// platform - public static string FontType - { - get - { - string fontType; - SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsGetValueString(SystemSettingsKeys.FontType, out fontType); - if (res != SystemSettingsError.None) - { - throw SystemSettingsExceptionFactory.CreateException(res, "unable to get FontType system setting."); - } - return fontType; - } - set - { - SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsSetValueString(SystemSettingsKeys.FontType, value); - if (res != SystemSettingsError.None) - { - throw SystemSettingsExceptionFactory.CreateException(res, "unable to set FontType system setting."); - } - } - } - - /// - /// Indicates whether the motion service is activated. - /// - /// http://tizen.org/privilege/systemsettings.admin - /// platform - public static bool MotionActivationEnabled - { - get - { - bool isMotionServiceActivated; - SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsGetValueBool(SystemSettingsKeys.MotionActivationEnabled, out isMotionServiceActivated); - if (res != SystemSettingsError.None) - { - throw SystemSettingsExceptionFactory.CreateException(res, "unable to get MotionActivation system setting."); - } - return isMotionServiceActivated; - } - set - { - SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsSetValueBool(SystemSettingsKeys.MotionActivationEnabled, value); - if (res != SystemSettingsError.None) - { - throw SystemSettingsExceptionFactory.CreateException(res, "unable to set MotionActivation system setting."); - } - } - } - - /// - /// The file path of the current email alert ringtone. - /// - /// http://tizen.org/privilege/systemsettings.admin - /// platform - public static string EmailAlertRingtone - { - get - { - string filePath; - SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsGetValueString(SystemSettingsKeys.EmailAlertRingtone, out filePath); - if (res != SystemSettingsError.None) - { - throw SystemSettingsExceptionFactory.CreateException(res, "unable to get EmailAlertRingtone system setting."); - } - return filePath; - } - set - { - SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsSetValueString(SystemSettingsKeys.EmailAlertRingtone, value); - if (res != SystemSettingsError.None) - { - throw SystemSettingsExceptionFactory.CreateException(res, "unable to set EmailAlertRingtone system setting."); - } - } - } - /// - /// Indicates whether the USB debugging is enabled. - /// - /// http://tizen.org/privilege/systemsettings.admin - /// platform - public static bool UsbDebuggingEnabled - { - get - { - bool isusbDebuggingEnabled; - SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsGetValueBool(SystemSettingsKeys.UsbDebuggingEnabled, out isusbDebuggingEnabled); - if (res != SystemSettingsError.None) - { - throw SystemSettingsExceptionFactory.CreateException(res, "unable to get UsbDebuggingEnabled system setting."); - } - return isusbDebuggingEnabled; - } - set - { - SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsSetValueBool(SystemSettingsKeys.UsbDebuggingEnabled, value); - if (res != SystemSettingsError.None) - { - throw SystemSettingsExceptionFactory.CreateException(res, "unable to set UsbDebuggingEnabled system setting."); - } - } - } - - /// - /// Indicates whether the 3G data network is enabled. - /// - /// http://tizen.org/privilege/systemsettings.admin - /// platform - public static bool Data3GNetworkEnabled - { - get - { - bool is3GDataEnabled; - SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsGetValueBool(SystemSettingsKeys.Data3GNetworkEnabled, out is3GDataEnabled); - if (res != SystemSettingsError.None) - { - throw SystemSettingsExceptionFactory.CreateException(res, "unable to get Data3GNetworkEnabled system setting."); - } - return is3GDataEnabled; - } - set - { - SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsSetValueBool(SystemSettingsKeys.Data3GNetworkEnabled, value); - if (res != SystemSettingsError.None) - { - throw SystemSettingsExceptionFactory.CreateException(res, "unable to set Data3GNetworkEnabled system setting."); - } - } - } - - /// - /// Indicates the lock-screen application package name. - /// - /// http://tizen.org/privilege/systemsettings.admin - /// platform - public static string LockscreenApp - { - get - { - string pkgName; - SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsGetValueString(SystemSettingsKeys.LockscreenApp, out pkgName); - if (res != SystemSettingsError.None) - { - throw SystemSettingsExceptionFactory.CreateException(res, "unable to get LockscreenApp system setting."); - } - return pkgName; - } - set - { - SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsSetValueString(SystemSettingsKeys.LockscreenApp, value); - if (res != SystemSettingsError.None) - { - throw SystemSettingsExceptionFactory.CreateException(res, "unable to set LockscreenApp system setting."); - } - } - } - - /// - /// The current system default font type (only supports Get). - /// - /// http://tizen.org/privilege/systemsettings.admin - /// platform - public static string DefaultFontType - { - get - { - string defaultFontType; - SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsGetValueString(SystemSettingsKeys.DefaultFontType, out defaultFontType); - if (res != SystemSettingsError.None) - { - throw SystemSettingsExceptionFactory.CreateException(res, "unable to get DefaultFontType system setting value."); - } - return defaultFontType; - } - } - - /// - /// Indicates the current country setting in the <LANGUAGE>_<REGION> syntax. - /// The country setting is in the ISO 639-2 format, - /// and the region setting is in the ISO 3166-1 alpha-2 format. - /// - /// http://tizen.org/privilege/systemsettings.admin - /// platform - public static string LocaleCountry - { - get - { - string countrySetting; - SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsGetValueString(SystemSettingsKeys.LocaleCountry, out countrySetting); - if (res != SystemSettingsError.None) - { - throw SystemSettingsExceptionFactory.CreateException(res, "unable to get LocaleCountry system setting."); - } - return countrySetting; - } - set - { - SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsSetValueString(SystemSettingsKeys.LocaleCountry, value); - if (res != SystemSettingsError.None) - { - throw SystemSettingsExceptionFactory.CreateException(res, "unable to set LocaleCountry system setting."); - } - } - } - - /// - /// Indicates the current language setting in the <LANGUAGE>_<REGION> syntax. - /// The language setting is in the ISO 639-2 format, - /// and the region setting is in the ISO 3166-1 alpha-2 format. - /// - /// http://tizen.org/privilege/systemsettings.admin - /// platform - public static string LocaleLanguage - { - get - { - string languageSetting; - SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsGetValueString(SystemSettingsKeys.LocaleLanguage, out languageSetting); - if (res != SystemSettingsError.None) - { - throw SystemSettingsExceptionFactory.CreateException(res, "unable to get LocaleLanguage system setting."); - } - return languageSetting; - } - set - { - SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsSetValueString(SystemSettingsKeys.LocaleLanguage, value); - if (res != SystemSettingsError.None) - { - throw SystemSettingsExceptionFactory.CreateException(res, "unable to set LocaleLanguage system setting."); - } - } - } - - /// - /// Indicates whether the 24-hour clock is used. - /// If the value is false, the 12-hour clock is used. - /// - /// http://tizen.org/privilege/systemsettings.admin - /// platform - public static bool LocaleTimeFormat24HourEnabled - { - get - { - bool is24HrFormat; - SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsGetValueBool(SystemSettingsKeys.LocaleTimeFormat24HourEnabled, out is24HrFormat); - if (res != SystemSettingsError.None) - { - throw SystemSettingsExceptionFactory.CreateException(res, "unable to get LocaleTimeFormat24Hour system setting."); - } - return is24HrFormat; - } - set - { - SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsSetValueBool(SystemSettingsKeys.LocaleTimeFormat24HourEnabled, value); - if (res != SystemSettingsError.None) - { - throw SystemSettingsExceptionFactory.CreateException(res, "unable to set LocaleTimeFormat24Hour system setting."); - } - } - } - - /// - /// Indicates the current time zone, for example, Pacific/Tahiti. - /// - /// http://tizen.org/privilege/systemsettings.admin - /// platform - public static string LocaleTimeZone - { - get - { - string timeZone; - SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsGetValueString(SystemSettingsKeys.LocaleTimeZone, out timeZone); - if (res != SystemSettingsError.None) - { - throw SystemSettingsExceptionFactory.CreateException(res, "unable to get LocaleTimeZone system setting."); - } - return timeZone; - } - set - { - SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsSetValueString(SystemSettingsKeys.LocaleTimeZone, value); - if (res != SystemSettingsError.None) - { - throw SystemSettingsExceptionFactory.CreateException(res, "unable to set LocaleTimeZone system setting."); - } - } - } - - /// - /// Once the system changes time, this event occurs to notify the time change. - /// - /// http://tizen.org/privilege/systemsettings.admin - /// platform - public static int Time - { - get - { - int time; - SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsGetValueInt(SystemSettingsKeys.Time, out time); - if (res != SystemSettingsError.None) - { - throw SystemSettingsExceptionFactory.CreateException(res, "unable to get Time system setting."); - } - return time; - } - } - /// - /// Indicates whether the screen lock sound is enabled on the device, for example, the LCD on or off sound. - /// - /// http://tizen.org/privilege/systemsettings.admin - /// platform - public static bool SoundLockEnabled - { - get - { - bool isSoundLockEnabled; - SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsGetValueBool(SystemSettingsKeys.SoundLockEnabled, out isSoundLockEnabled); - if (res != SystemSettingsError.None) - { - throw SystemSettingsExceptionFactory.CreateException(res, "unable to get SoundLock system setting."); - } - return isSoundLockEnabled; - } - } - - /// - /// Indicates whether the device is in the silent mode. - /// - /// http://tizen.org/privilege/systemsettings.admin - /// platform - public static bool SoundSilentModeEnabled - { - get - { - bool isSilent; - SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsGetValueBool(SystemSettingsKeys.SoundSilentModeEnabled, out isSilent); - if (res != SystemSettingsError.None) - { - throw SystemSettingsExceptionFactory.CreateException(res, "unable to get SoundSilentMode system setting."); - } - return isSilent; - } - } - - /// - /// Indicates whether the screen touch sound is enabled on the device. - /// - /// http://tizen.org/privilege/systemsettings.admin - /// platform - public static bool SoundTouchEnabled - { - get - { - bool isTouchSoundEnabled; - SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsGetValueBool(SystemSettingsKeys.SoundTouchEnabled, out isTouchSoundEnabled); - if (res != SystemSettingsError.None) - { - throw SystemSettingsExceptionFactory.CreateException(res, "unable to get SoundTouch system setting value."); - } - return isTouchSoundEnabled; - } - } - - /// - /// Indicates whether the rotation control is automatic. - /// - /// http://tizen.org/privilege/systemsettings.admin - /// platform - public static bool DisplayScreenRotationAutoEnabled - { - get - { - bool isRotationAutomatic; - SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsGetValueBool(SystemSettingsKeys.DisplayScreenRotationAutoEnabled, out isRotationAutomatic); - if (res != SystemSettingsError.None) - { - throw SystemSettingsExceptionFactory.CreateException(res, "unable to get DisplayScreenRotationAuto system setting."); - } - return isRotationAutomatic; - } - } - - /// - /// Indicates the device name. - /// - /// http://tizen.org/privilege/systemsettings.admin - /// platform - public static string DeviceName - { - get - { - string deviceName; - SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsGetValueString(SystemSettingsKeys.DeviceName, out deviceName); - if (res != SystemSettingsError.None) - { - throw SystemSettingsExceptionFactory.CreateException(res, "unable to get DeviceName system setting value."); - } - return deviceName; - } - } - /// - /// Indicates whether the device user has enabled the motion feature. - /// - /// http://tizen.org/privilege/systemsettings.admin - /// platform - public static bool MotionEnabled - { - get - { - bool isMotionEnabled; - SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsGetValueBool(SystemSettingsKeys.MotionEnabled, out isMotionEnabled); - if (res != SystemSettingsError.None) - { - throw SystemSettingsExceptionFactory.CreateException(res, "unable to get MotionEnabled system setting value."); - } - return isMotionEnabled; - } - } - - /// - /// Indicates whether Wi-Fi related notifications are enabled on the device. - /// - /// http://tizen.org/privilege/systemsettings.admin - /// platform - public static bool NetworkWifiNotificationEnabled - { - get - { - bool isWifiNotificationEnabled; - SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsGetValueBool(SystemSettingsKeys.NetworkWifiNotificationEnabled, out isWifiNotificationEnabled); - if (res != SystemSettingsError.None) - { - throw SystemSettingsExceptionFactory.CreateException(res, "unable to get NetworkWifiNotification system setting."); - } - return isWifiNotificationEnabled; - } - } - - /// - /// Indicates whether the device is in the flight mode. - /// - /// http://tizen.org/privilege/systemsettings.admin - /// platform - public static bool NetworkFlightModeEnabled - { - get - { - bool isFlightModeEnabled; - SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsGetValueBool(SystemSettingsKeys.NetworkFlightModeEnabled, out isFlightModeEnabled); - if (res != SystemSettingsError.None) - { - throw SystemSettingsExceptionFactory.CreateException(res, "unable to get NetworkFlightMode system setting."); - } - return isFlightModeEnabled; - } - } - - /// - /// Indicates the backlight time (in seconds). The following values can be used: 15, 30, 60, 120, 300, and 600. - /// - /// http://tizen.org/privilege/systemsettings.admin - /// platform - public static int ScreenBacklightTime - { - get - { - int backlightTime; - SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsGetValueInt(SystemSettingsKeys.ScreenBacklightTime, out backlightTime); - if (res != SystemSettingsError.None) - { - throw SystemSettingsExceptionFactory.CreateException(res, "unable to get ScreenBacklightTime system setting."); - } - return backlightTime; - } - set - { - SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsSetValueInt(SystemSettingsKeys.ScreenBacklightTime, value); - if (res != SystemSettingsError.None) - { - throw SystemSettingsExceptionFactory.CreateException(res, "unable to set ScreenBacklightTime system setting."); - } - } - } - - /// - /// Indicates the file path of the current notification tone set by the user. - /// - /// http://tizen.org/privilege/systemsettings.admin - /// platform - public static string SoundNotification - { - get - { - string filePath; - SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsGetValueString(SystemSettingsKeys.SoundNotification, out filePath); - if (res != SystemSettingsError.None) - { - throw SystemSettingsExceptionFactory.CreateException(res, "unable to get SoundNotification system setting."); - } - return filePath; - } - set - { - SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsSetValueString(SystemSettingsKeys.SoundNotification, value); - if (res != SystemSettingsError.None) - { - throw SystemSettingsExceptionFactory.CreateException(res, "unable to set SoundNotification system setting."); - } - } - } - - /// - /// Indicates the time period for notification repetitions. - /// - /// http://tizen.org/privilege/systemsettings.admin - /// platform - public static int SoundNotificationRepetitionPeriod - { - get - { - int notificationRepetitionPeriod; - SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsGetValueInt(SystemSettingsKeys.SoundNotificationRepetitionPeriod, out notificationRepetitionPeriod); - if (res != SystemSettingsError.None) - { - throw SystemSettingsExceptionFactory.CreateException(res, "unable to get SoundNotificationRepetitionPeriod system setting."); - } - return notificationRepetitionPeriod; - } - set - { - SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsSetValueInt(SystemSettingsKeys.SoundNotificationRepetitionPeriod, value); - if (res != SystemSettingsError.None) - { - throw SystemSettingsExceptionFactory.CreateException(res, "unable to set SoundNotificationRepetitionPeriod system setting."); - } - } - } - - /// - /// Indicates the current lock state. - /// - /// http://tizen.org/privilege/systemsettings.admin - /// platform - public static SystemSettingsIdleLockState LockState - { - get - { - int LockState; - SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsGetValueInt(SystemSettingsKeys.LockState, out LockState); - if (res != SystemSettingsError.None) - { - throw SystemSettingsExceptionFactory.CreateException(res, "unable to get LockState system setting."); - } - return (SystemSettingsIdleLockState)LockState; - } - set - { - SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsSetValueInt(SystemSettingsKeys.LockState, (int)value); - if (res != SystemSettingsError.None) - { - throw SystemSettingsExceptionFactory.CreateException(res, "unable to set LockState system setting."); - } - } - } - - /// - /// The current system ADS ID. - /// - /// http://tizen.org/privilege/systemsettings.admin - /// platform - public static string AdsId - { - get - { - string adsId; - SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsGetValueString(SystemSettingsKeys.AdsId, out adsId); - if (res != SystemSettingsError.None) - { - throw SystemSettingsExceptionFactory.CreateException(res, "unable to get AdsId system setting."); - } - return adsId; - } - set - { - SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsSetValueString(SystemSettingsKeys.AdsId, value); - if (res != SystemSettingsError.None) - { - throw SystemSettingsExceptionFactory.CreateException(res, "unable to set AdsId system setting."); - } - } - } - - - /// - /// Indicates the time period for notification repetitions. - /// - /// http://tizen.org/privilege/systemsettings.admin - /// platform - public static SystemSettingsUdsState UltraDataSave - { - get - { - int UltraDataSave; - SystemSettingsError res = (SystemSettingsError)Interop.Settings.SystemSettingsGetValueInt(SystemSettingsKeys.UltraDataSave, out UltraDataSave); - if (res != SystemSettingsError.None) - { - throw SystemSettingsExceptionFactory.CreateException(res, "unable to get UltraDataSave system setting."); - } - return (SystemSettingsUdsState)UltraDataSave; - } - } - - - - private static readonly Interop.Settings.SystemSettingsChangedCallback s_incomingCallRingtoneChangedCallback = (SystemSettingsKeys key, IntPtr userData) => - { - string path = SystemSettings.IncomingCallRingtone; - IncomingCallRingtoneChangedEventArgs eventArgs = new IncomingCallRingtoneChangedEventArgs(path); - s_incomingCallRingtoneChanged?.Invoke(null, eventArgs); - }; - private static event EventHandler s_incomingCallRingtoneChanged; - /// - /// The IncomingCallRingtoneChanged event is triggered when the file path of the incoming ringtone is changed. - /// - /// http://tizen.org/privilege/systemsettings.admin - /// platform - public static event EventHandler IncomingCallRingtoneChanged - { - add - { - if (s_incomingCallRingtoneChanged == null) - { - SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.IncomingCallRingtone, s_incomingCallRingtoneChangedCallback, IntPtr.Zero); - if (ret != SystemSettingsError.None) - { - throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling"); - } - } - s_incomingCallRingtoneChanged += value; - } - - remove - { - s_incomingCallRingtoneChanged -= value; - if (s_incomingCallRingtoneChanged == null) - { - SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.IncomingCallRingtone); - if (ret != SystemSettingsError.None) - { - throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling"); - } - } - } - } - - private static readonly Interop.Settings.SystemSettingsChangedCallback s_wallpaperHomeScreenChangedCallback = (SystemSettingsKeys key, IntPtr userData) => - { - string path = SystemSettings.WallpaperHomeScreen; - WallpaperHomeScreenChangedEventArgs eventArgs = new WallpaperHomeScreenChangedEventArgs(path); - s_wallpaperHomeScreenChanged?.Invoke(null, eventArgs); - }; - private static event EventHandler s_wallpaperHomeScreenChanged; - /// - /// THe WallpaperHomeScreenChanged event is triggered when the file path of the current home screen wallpaper is changed. - /// - /// http://tizen.org/privilege/systemsettings.admin - /// platform - public static event EventHandler WallpaperHomeScreenChanged - { - add - { - if (s_wallpaperHomeScreenChanged == null) - { - SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.WallpaperHomeScreen, s_wallpaperHomeScreenChangedCallback, IntPtr.Zero); - if (ret != SystemSettingsError.None) - { - throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling"); - } - } - s_wallpaperHomeScreenChanged += value; - } - - remove - { - s_wallpaperHomeScreenChanged -= value; - if (s_wallpaperHomeScreenChanged == null) - { - SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.WallpaperHomeScreen); - if (ret != SystemSettingsError.None) - { - throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling"); - } - } - } - } - - private static readonly Interop.Settings.SystemSettingsChangedCallback s_wallpaperLockScreenChangedCallback = (SystemSettingsKeys key, IntPtr userData) => - { - string path = SystemSettings.WallpaperLockScreen; - WallpaperLockScreenChangedEventArgs eventArgs = new WallpaperLockScreenChangedEventArgs(path); - s_wallpaperLockScreenChanged?.Invoke(null, eventArgs); - }; - private static event EventHandler s_wallpaperLockScreenChanged; - /// - /// The WallpaperLockScreenChanged event is triggered when the file path of the current lock screen wallpaper is changed. - /// - /// http://tizen.org/privilege/systemsettings.admin - /// platform - public static event EventHandler WallpaperLockScreenChanged - { - add - { - if (s_wallpaperLockScreenChanged == null) - { - SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.WallpaperLockScreen, s_wallpaperLockScreenChangedCallback, IntPtr.Zero); - if (ret != SystemSettingsError.None) - { - throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling"); - } - } - s_wallpaperLockScreenChanged += value; - } - - remove - { - s_wallpaperLockScreenChanged -= value; - if (s_wallpaperLockScreenChanged == null) - { - SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.WallpaperLockScreen); - if (ret != SystemSettingsError.None) - { - throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling"); - } - } - } - } - - private static readonly Interop.Settings.SystemSettingsChangedCallback s_fontSizeChangedCallback = (SystemSettingsKeys key, IntPtr userData) => - { - SystemSettingsFontSize fontSize = SystemSettings.FontSize; - FontSizeChangedEventArgs eventArgs = new FontSizeChangedEventArgs(fontSize); - s_fontSizeChanged?.Invoke(null, eventArgs); - }; - private static event EventHandler s_fontSizeChanged; - /// - /// The FontSizeChanged event is triggered when the current system font size is changed. - /// - /// http://tizen.org/privilege/systemsettings.admin - /// platform - public static event EventHandler FontSizeChanged - { - add - { - if (s_fontSizeChanged == null) - { - SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.FontSize, s_fontSizeChangedCallback, IntPtr.Zero); - if (ret != SystemSettingsError.None) - { - throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling"); - } - } - s_fontSizeChanged += value; - } - - remove - { - s_fontSizeChanged -= value; - if (s_fontSizeChanged == null) - { - SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.FontSize); - if (ret != SystemSettingsError.None) - { - throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling"); - } - } - } - } - - private static readonly Interop.Settings.SystemSettingsChangedCallback s_fontTypeChangedCallback = (SystemSettingsKeys key, IntPtr userData) => - { - string fontType = SystemSettings.FontType; - FontTypeChangedEventArgs eventArgs = new FontTypeChangedEventArgs(fontType); - s_fontTypeChanged?.Invoke(null, eventArgs); - }; - private static event EventHandler s_fontTypeChanged; - /// - /// The FontTypeChanged event is triggered when the current system font type is changed. - /// - /// http://tizen.org/privilege/systemsettings.admin - /// platform - public static event EventHandler FontTypeChanged - { - add - { - if (s_fontTypeChanged == null) - { - SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.FontType, s_fontTypeChangedCallback, IntPtr.Zero); - if (ret != SystemSettingsError.None) - { - throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling"); - } - } - s_fontTypeChanged += value; - } - - remove - { - s_fontTypeChanged -= value; - if (s_fontTypeChanged == null) - { - SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.FontType); - if (ret != SystemSettingsError.None) - { - throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling"); - } - } - } - } - - private static readonly Interop.Settings.SystemSettingsChangedCallback s_motionActivationChangedCallback = (SystemSettingsKeys key, IntPtr userData) => - { - bool motionActivation = SystemSettings.MotionActivationEnabled; - MotionActivationSettingChangedEventArgs eventArgs = new MotionActivationSettingChangedEventArgs(motionActivation); - s_motionActivationChanged?.Invoke(null, eventArgs); - }; - private static event EventHandler s_motionActivationChanged; - /// - /// The MotionActivationChanged event is triggered when the motion service status is changed. - /// - /// http://tizen.org/privilege/systemsettings.admin - /// platform - public static event EventHandler MotionActivationSettingChanged - { - add - { - if (s_motionActivationChanged == null) - { - SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.MotionActivationEnabled, s_motionActivationChangedCallback, IntPtr.Zero); - if (ret != SystemSettingsError.None) - { - throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling"); - } - } - s_motionActivationChanged += value; - } - - remove - { - s_motionActivationChanged -= value; - if (s_motionActivationChanged == null) - { - SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.MotionActivationEnabled); - if (ret != SystemSettingsError.None) - { - throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling"); - } - } - } - } - - private static readonly Interop.Settings.SystemSettingsChangedCallback s_emailAlertRingtoneChangedCallback = (SystemSettingsKeys key, IntPtr userData) => - { - string emailAlertRingtone = SystemSettings.EmailAlertRingtone; - EmailAlertRingtoneChangedEventArgs eventArgs = new EmailAlertRingtoneChangedEventArgs(emailAlertRingtone); - s_emailAlertRingtoneChanged?.Invoke(null, eventArgs); - }; - private static event EventHandler s_emailAlertRingtoneChanged; - /// - /// The EmailAlertRingtoneChanged event is triggered when the file path of the current email alert ringtone is changed. - /// - /// http://tizen.org/privilege/systemsettings.admin - /// platform - public static event EventHandler EmailAlertRingtoneChanged - { - add - { - if (s_emailAlertRingtoneChanged == null) - { - SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.EmailAlertRingtone, s_emailAlertRingtoneChangedCallback, IntPtr.Zero); - if (ret != SystemSettingsError.None) - { - throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling"); - } - } - s_emailAlertRingtoneChanged += value; - } - - remove - { - s_emailAlertRingtoneChanged -= value; - if (s_emailAlertRingtoneChanged == null) - { - SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.EmailAlertRingtone); - if (ret != SystemSettingsError.None) - { - throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling"); - } - } - } - } - - private static readonly Interop.Settings.SystemSettingsChangedCallback s_usbDebuggingSettingChangedCallback = (SystemSettingsKeys key, IntPtr userData) => - { - bool usbDebuggingEnabled = SystemSettings.UsbDebuggingEnabled; - UsbDebuggingSettingChangedEventArgs eventArgs = new UsbDebuggingSettingChangedEventArgs(usbDebuggingEnabled); - s_usbDebuggingSettingChanged?.Invoke(null, eventArgs); - }; - private static event EventHandler s_usbDebuggingSettingChanged; - /// - /// The UsbDebuggingSettingChangedEventArgs event is triggered when the USB debugging status is changed. - /// - /// http://tizen.org/privilege/systemsettings.admin - /// platform - public static event EventHandler UsbDebuggingSettingChanged - { - add - { - if (s_usbDebuggingSettingChanged == null) - { - SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.UsbDebuggingEnabled, s_usbDebuggingSettingChangedCallback, IntPtr.Zero); - if (ret != SystemSettingsError.None) - { - throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling"); - } - } - s_usbDebuggingSettingChanged += value; - } - - remove - { - s_usbDebuggingSettingChanged -= value; - if (s_usbDebuggingSettingChanged == null) - { - SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.UsbDebuggingEnabled); - if (ret != SystemSettingsError.None) - { - throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling"); - } - } - } - } - - private static readonly Interop.Settings.SystemSettingsChangedCallback s_data3GNetworkSettingChangedCallback = (SystemSettingsKeys key, IntPtr userData) => - { - bool data3GEnabled = SystemSettings.Data3GNetworkEnabled; - Data3GNetworkSettingChangedEventArgs eventArgs = new Data3GNetworkSettingChangedEventArgs(data3GEnabled); - s_data3GNetworkSettingChanged?.Invoke(null, eventArgs); - }; - private static event EventHandler s_data3GNetworkSettingChanged; - /// - /// The Data3GNetworkSettingChanged event is triggered when the 3G data network status is changed. - /// - /// http://tizen.org/privilege/systemsettings.admin - /// platform - public static event EventHandler Data3GNetworkSettingChanged - { - add - { - if (s_data3GNetworkSettingChanged == null) - { - SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.Data3GNetworkEnabled, s_data3GNetworkSettingChangedCallback, IntPtr.Zero); - if (ret != SystemSettingsError.None) - { - throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling"); - } - } - s_data3GNetworkSettingChanged += value; - } - - remove - { - s_data3GNetworkSettingChanged -= value; - if (s_data3GNetworkSettingChanged == null) - { - SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.Data3GNetworkEnabled); - if (ret != SystemSettingsError.None) - { - throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling"); - } - } - } - } - - private static readonly Interop.Settings.SystemSettingsChangedCallback s_lockscreenAppChangedCallback = (SystemSettingsKeys key, IntPtr userData) => - { - string lockScreenApp = SystemSettings.LockscreenApp; - LockscreenAppChangedEventArgs eventArgs = new LockscreenAppChangedEventArgs(lockScreenApp); - s_lockscreenAppChanged?.Invoke(null, eventArgs); - }; - private static event EventHandler s_lockscreenAppChanged; - /// - /// The LockscreenAppChanged event is triggered when the lockscreen application package name is changed. - /// - /// http://tizen.org/privilege/systemsettings.admin - /// platform - public static event EventHandler LockscreenAppChanged - { - add - { - if (s_lockscreenAppChanged == null) - { - SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.LockscreenApp, s_lockscreenAppChangedCallback, IntPtr.Zero); - if (ret != SystemSettingsError.None) - { - throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling"); - } - } - s_lockscreenAppChanged += value; - } - - remove - { - s_lockscreenAppChanged -= value; - if (s_lockscreenAppChanged == null) - { - SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.LockscreenApp); - if (ret != SystemSettingsError.None) - { - throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling"); - } - } - } - } - - private static readonly Interop.Settings.SystemSettingsChangedCallback s_localeCountryChangedCallback = (SystemSettingsKeys key, IntPtr userData) => - { - string localeCountry = SystemSettings.LocaleCountry; - LocaleCountryChangedEventArgs eventArgs = new LocaleCountryChangedEventArgs(localeCountry); - s_localeCountryChanged?.Invoke(null, eventArgs); - }; - private static event EventHandler s_localeCountryChanged; - /// - /// The LocaleCountryChanged event is triggered when the current country setting in the <LANGUAGE>_<REGION> syntax, is changed. - /// - /// http://tizen.org/privilege/systemsettings.admin - /// platform - public static event EventHandler LocaleCountryChanged - { - add - { - if (s_localeCountryChanged == null) - { - SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.LocaleCountry, s_localeCountryChangedCallback, IntPtr.Zero); - if (ret != SystemSettingsError.None) - { - throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling"); - } - } - s_localeCountryChanged += value; - } - - remove - { - s_localeCountryChanged -= value; - if (s_localeCountryChanged == null) - { - SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.LocaleCountry); - if (ret != SystemSettingsError.None) - { - throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling"); - } - } - } - } - - private static readonly Interop.Settings.SystemSettingsChangedCallback s_localeLanguageChangedCallback = (SystemSettingsKeys key, IntPtr userData) => - { - string localeLanguage = SystemSettings.LocaleLanguage; - LocaleLanguageChangedEventArgs eventArgs = new LocaleLanguageChangedEventArgs(localeLanguage); - s_localeLanguageChanged?.Invoke(null, eventArgs); - }; - private static event EventHandler s_localeLanguageChanged; - /// - /// The LocaleLanguageChanged event is triggered when the current language setting in the <LANGUAGE>_<REGION> syntax, is changed. - /// - /// http://tizen.org/privilege/systemsettings.admin - /// platform - public static event EventHandler LocaleLanguageChanged - { - add - { - if (s_localeLanguageChanged == null) - { - SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.LocaleLanguage, s_localeLanguageChangedCallback, IntPtr.Zero); - if (ret != SystemSettingsError.None) - { - throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling"); - } - } - s_localeLanguageChanged += value; - } - - remove - { - s_localeLanguageChanged -= value; - if (s_localeLanguageChanged == null) - { - SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.LocaleLanguage); - if (ret != SystemSettingsError.None) - { - throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling"); - } - } - } - } - - private static readonly Interop.Settings.SystemSettingsChangedCallback s_localeTimeFormat24HourChangedCallback = (SystemSettingsKeys key, IntPtr userData) => - { - bool localeTimeFormat24Hour = SystemSettings.LocaleTimeFormat24HourEnabled; - LocaleTimeFormat24HourSettingChangedEventArgs eventArgs = new LocaleTimeFormat24HourSettingChangedEventArgs(localeTimeFormat24Hour); - s_localeTimeFormat24HourChanged?.Invoke(null, eventArgs); - }; - private static event EventHandler s_localeTimeFormat24HourChanged; - /// - /// The LocaleTimeFormat24HourChanged event is triggered when the time format is changed. - /// - /// http://tizen.org/privilege/systemsettings.admin - /// platform - public static event EventHandler LocaleTimeFormat24HourSettingChanged - { - add - { - if (s_localeTimeFormat24HourChanged == null) - { - SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.LocaleTimeFormat24HourEnabled, s_localeTimeFormat24HourChangedCallback, IntPtr.Zero); - if (ret != SystemSettingsError.None) - { - throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling"); - } - } - s_localeTimeFormat24HourChanged += value; - } - - remove - { - s_localeTimeFormat24HourChanged -= value; - if (s_localeTimeFormat24HourChanged == null) - { - SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.LocaleTimeFormat24HourEnabled); - if (ret != SystemSettingsError.None) - { - throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling"); - } - } - } - } - - private static readonly Interop.Settings.SystemSettingsChangedCallback s_localeTimeZoneChangedCallback = (SystemSettingsKeys key, IntPtr userData) => - { - string localeTimeZone = SystemSettings.LocaleTimeZone; - LocaleTimeZoneChangedEventArgs eventArgs = new LocaleTimeZoneChangedEventArgs(localeTimeZone); - s_localeTimeZoneChanged?.Invoke(null, eventArgs); - }; - private static event EventHandler s_localeTimeZoneChanged; - /// - /// The LocaleTimeZoneChanged event is triggered when the current time zone is changed. - /// - /// http://tizen.org/privilege/systemsettings.admin - /// platform - public static event EventHandler LocaleTimeZoneChanged - { - add - { - if (s_localeTimeZoneChanged == null) - { - SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.LocaleTimeZone, s_localeTimeZoneChangedCallback, IntPtr.Zero); - if (ret != SystemSettingsError.None) - { - throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling"); - } - } - s_localeTimeZoneChanged += value; - } - - remove - { - s_localeTimeZoneChanged -= value; - if (s_localeTimeZoneChanged == null) - { - SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.LocaleTimeZone); - if (ret != SystemSettingsError.None) - { - throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling"); - } - } - } - } - - private static readonly Interop.Settings.SystemSettingsChangedCallback s_timeChangedCallback = (SystemSettingsKeys key, IntPtr userData) => - { - - int time = SystemSettings.Time; - TimeChangedEventArgs eventArgs = new TimeChangedEventArgs(time); - s_timeChanged?.Invoke(null, eventArgs); - }; - private static event EventHandler s_timeChanged; - /// - /// The TimeChanged event is triggered when the system time is changed. - /// - /// http://tizen.org/privilege/systemsettings.admin - /// platform - public static event EventHandler TimeChanged - { - add - { - if (s_timeChanged == null) - { - SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.Time, s_timeChangedCallback, IntPtr.Zero); - if (ret != SystemSettingsError.None) - { - throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling"); - } - } - s_timeChanged += value; - } - - remove - { - s_timeChanged -= value; - if (s_timeChanged == null) - { - SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.Time); - if (ret != SystemSettingsError.None) - { - throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling"); - } - } - } - } - - private static readonly Interop.Settings.SystemSettingsChangedCallback s_soundLockChangedCallback = (SystemSettingsKeys key, IntPtr userData) => - { - bool soundLock = SystemSettings.SoundLockEnabled; - SoundLockSettingChangedEventArgs eventArgs = new SoundLockSettingChangedEventArgs(soundLock); - s_soundLockChanged?.Invoke(null, eventArgs); - }; - private static event EventHandler s_soundLockChanged; - /// - /// The SoundLockChanged event is triggered when the screen lock sound enabled status is changed. - /// - /// http://tizen.org/privilege/systemsettings.admin - /// platform - public static event EventHandler SoundLockSettingChanged - { - add - { - if (s_soundLockChanged == null) - { - SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.SoundLockEnabled, s_soundLockChangedCallback, IntPtr.Zero); - if (ret != SystemSettingsError.None) - { - throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling"); - } - } - s_soundLockChanged += value; - } - - remove - { - s_soundLockChanged -= value; - if (s_soundLockChanged == null) - { - SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.SoundLockEnabled); - if (ret != SystemSettingsError.None) - { - throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling"); - } - } - } - } - - private static readonly Interop.Settings.SystemSettingsChangedCallback s_soundSilentModeChangedCallback = (SystemSettingsKeys key, IntPtr userData) => - { - bool soundSilentMode = SystemSettings.SoundSilentModeEnabled; - SoundSilentModeSettingChangedEventArgs eventArgs = new SoundSilentModeSettingChangedEventArgs(soundSilentMode); - s_soundSilentModeChanged?.Invoke(null, eventArgs); - }; - private static event EventHandler s_soundSilentModeChanged; - /// - /// The SoundSilentModeChanged event is triggered when the silent mode status is changed. - /// - /// http://tizen.org/privilege/systemsettings.admin - /// platform - public static event EventHandler SoundSilentModeSettingChanged - { - add - { - if (s_soundSilentModeChanged == null) - { - SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.SoundSilentModeEnabled, s_soundSilentModeChangedCallback, IntPtr.Zero); - if (ret != SystemSettingsError.None) - { - throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling"); - } - } - s_soundSilentModeChanged += value; - } - - remove - { - s_soundSilentModeChanged -= value; - if (s_soundSilentModeChanged == null) - { - SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.SoundSilentModeEnabled); - if (ret != SystemSettingsError.None) - { - throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling"); - } - } - } - } - - private static readonly Interop.Settings.SystemSettingsChangedCallback s_soundTouchChangedCallback = (SystemSettingsKeys key, IntPtr userData) => - { - bool soundTouch = SystemSettings.SoundTouchEnabled; - SoundTouchSettingChangedEventArgs eventArgs = new SoundTouchSettingChangedEventArgs(soundTouch); - s_soundTouchChanged?.Invoke(null, eventArgs); - }; - private static event EventHandler s_soundTouchChanged; - /// - /// THe SoundTouchChanged event is triggered when the screen touch sound enabled status is changed. - /// - /// http://tizen.org/privilege/systemsettings.admin - /// platform - public static event EventHandler SoundTouchSettingChanged - { - add - { - if (s_soundTouchChanged == null) - { - SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.SoundTouchEnabled, s_soundTouchChangedCallback, IntPtr.Zero); - if (ret != SystemSettingsError.None) - { - throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling"); - } - } - s_soundTouchChanged += value; - } - - remove - { - s_soundTouchChanged -= value; - if (s_soundTouchChanged == null) - { - SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.SoundTouchEnabled); - if (ret != SystemSettingsError.None) - { - throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling"); - } - } - } - } - - private static readonly Interop.Settings.SystemSettingsChangedCallback s_displayScreenRotationAutoChangedCallback = (SystemSettingsKeys key, IntPtr userData) => - { - bool displayScreenRotationAuto = SystemSettings.DisplayScreenRotationAutoEnabled; - DisplayScreenRotationAutoSettingChangedEventArgs eventArgs = new DisplayScreenRotationAutoSettingChangedEventArgs(displayScreenRotationAuto); - s_displayScreenRotationAutoChanged?.Invoke(null, eventArgs); - }; - private static event EventHandler s_displayScreenRotationAutoChanged; - /// - /// The DisplayScreenRotationAutoChanged event is triggered when the automatic rotation control status is changed. - /// - /// http://tizen.org/privilege/systemsettings.admin - /// platform - public static event EventHandler DisplayScreenRotationAutoSettingChanged - { - add - { - if (s_displayScreenRotationAutoChanged == null) - { - SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.DisplayScreenRotationAutoEnabled, s_displayScreenRotationAutoChangedCallback, IntPtr.Zero); - if (ret != SystemSettingsError.None) - { - throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling"); - } - } - s_displayScreenRotationAutoChanged += value; - } - - remove - { - s_displayScreenRotationAutoChanged -= value; - if (s_displayScreenRotationAutoChanged == null) - { - SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.DisplayScreenRotationAutoEnabled); - if (ret != SystemSettingsError.None) - { - throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling"); - } - } - } - } - - private static readonly Interop.Settings.SystemSettingsChangedCallback s_deviceNameChangedCallback = (SystemSettingsKeys key, IntPtr userData) => - { - string deviceName = SystemSettings.DeviceName; - DeviceNameChangedEventArgs eventArgs = new DeviceNameChangedEventArgs(deviceName); - s_deviceNameChanged?.Invoke(null, eventArgs); - }; - private static event EventHandler s_deviceNameChanged; - /// - /// The DeviceNameChanged event is triggered when the device name is changed. - /// - /// http://tizen.org/privilege/systemsettings.admin - /// platform - public static event EventHandler DeviceNameChanged - { - add - { - if (s_deviceNameChanged == null) - { - SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.DeviceName, s_deviceNameChangedCallback, IntPtr.Zero); - if (ret != SystemSettingsError.None) - { - throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling"); - } - } - s_deviceNameChanged += value; - } - - remove - { - s_deviceNameChanged -= value; - if (s_deviceNameChanged == null) - { - SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.DeviceName); - if (ret != SystemSettingsError.None) - { - throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling"); - } - } - } - } - - private static readonly Interop.Settings.SystemSettingsChangedCallback s_motionSettingChangedCallback = (SystemSettingsKeys key, IntPtr userData) => - { - bool motionEnabled = SystemSettings.MotionEnabled; - MotionSettingChangedEventArgs eventArgs = new MotionSettingChangedEventArgs(motionEnabled); - s_motionSettingChanged?.Invoke(null, eventArgs); - }; - private static event EventHandler s_motionSettingChanged; - /// - /// The MotionSettingChanged event is triggered when the motion feature enabled status is changed. - /// - /// http://tizen.org/privilege/systemsettings.admin - /// platform - public static event EventHandler MotionSettingChanged - { - add - { - if (s_motionSettingChanged == null) - { - SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.MotionEnabled, s_motionSettingChangedCallback, IntPtr.Zero); - if (ret != SystemSettingsError.None) - { - throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling"); - } - } - s_motionSettingChanged += value; - } - - remove - { - s_motionSettingChanged -= value; - if (s_motionSettingChanged == null) - { - SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.MotionEnabled); - if (ret != SystemSettingsError.None) - { - throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling"); - } - } - } - } - - private static readonly Interop.Settings.SystemSettingsChangedCallback s_networkWifiNotificationChangedCallback = (SystemSettingsKeys key, IntPtr userData) => - { - bool networkWifiNotification = SystemSettings.NetworkWifiNotificationEnabled; - NetworkWifiNotificationSettingChangedEventArgs eventArgs = new NetworkWifiNotificationSettingChangedEventArgs(networkWifiNotification); - s_networkWifiNotificationChanged?.Invoke(null, eventArgs); - }; - private static event EventHandler s_networkWifiNotificationChanged; - /// - /// The NetworkWifiNotificationChanged event is triggered when the WiFi-related notifications enabled status is changed. - /// - /// http://tizen.org/privilege/systemsettings.admin - /// platform - public static event EventHandler NetworkWifiNotificationSettingChanged - { - add - { - if (s_networkWifiNotificationChanged == null) - { - SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.NetworkWifiNotificationEnabled, s_networkWifiNotificationChangedCallback, IntPtr.Zero); - if (ret != SystemSettingsError.None) - { - throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling"); - } - } - s_networkWifiNotificationChanged += value; - } - - remove - { - s_networkWifiNotificationChanged -= value; - if (s_networkWifiNotificationChanged == null) - { - SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.NetworkWifiNotificationEnabled); - if (ret != SystemSettingsError.None) - { - throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling"); - } - } - } - } - - private static readonly Interop.Settings.SystemSettingsChangedCallback s_networkFlightModeChangedCallback = (SystemSettingsKeys key, IntPtr userData) => - { - bool networkFlightMode = SystemSettings.NetworkFlightModeEnabled; - NetworkFlightModeSettingChangedEventArgs eventArgs = new NetworkFlightModeSettingChangedEventArgs(networkFlightMode); - s_networkFlightModeChanged?.Invoke(null, eventArgs); - }; - private static event EventHandler s_networkFlightModeChanged; - /// - /// The NetworkFlightModeChanged event is triggered when the flight mode status is changed. - /// - /// http://tizen.org/privilege/systemsettings.admin - /// platform - public static event EventHandler NetworkFlightModeSettingChanged - { - add - { - if (s_networkFlightModeChanged == null) - { - SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.NetworkFlightModeEnabled, s_networkFlightModeChangedCallback, IntPtr.Zero); - if (ret != SystemSettingsError.None) - { - throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling"); - } - } - s_networkFlightModeChanged += value; - } - - remove - { - s_networkFlightModeChanged -= value; - if (s_networkFlightModeChanged == null) - { - SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.NetworkFlightModeEnabled); - if (ret != SystemSettingsError.None) - { - throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling"); - } - } - } - } - - private static readonly Interop.Settings.SystemSettingsChangedCallback s_screenBacklightTimeChangedCallback = (SystemSettingsKeys key, IntPtr userData) => - { - int screenBacklightTime = SystemSettings.ScreenBacklightTime; - ScreenBacklightTimeChangedEventArgs eventArgs = new ScreenBacklightTimeChangedEventArgs(screenBacklightTime); - s_screenBacklightTimeChanged?.Invoke(null, eventArgs); - }; - private static event EventHandler s_screenBacklightTimeChanged; - /// - /// THe ScreenBacklightTimeChanged event is triggered when the backlight time is changed. - /// - /// http://tizen.org/privilege/systemsettings.admin - /// platform - public static event EventHandler ScreenBacklightTimeChanged - { - add - { - if (s_screenBacklightTimeChanged == null) - { - SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.ScreenBacklightTime, s_screenBacklightTimeChangedCallback, IntPtr.Zero); - if (ret != SystemSettingsError.None) - { - throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling"); - } - } - s_screenBacklightTimeChanged += value; - } - - remove - { - s_screenBacklightTimeChanged -= value; - if (s_screenBacklightTimeChanged == null) - { - SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.ScreenBacklightTime); - if (ret != SystemSettingsError.None) - { - throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling"); - } - } - } - } - - private static readonly Interop.Settings.SystemSettingsChangedCallback s_soundNotificationChangedCallback = (SystemSettingsKeys key, IntPtr userData) => - { - string soundNotification = SystemSettings.SoundNotification; - SoundNotificationChangedEventArgs eventArgs = new SoundNotificationChangedEventArgs(soundNotification); - s_soundNotificationChanged?.Invoke(null, eventArgs); - }; - private static event EventHandler s_soundNotificationChanged; - /// - /// The SoundNotificationChanged event is triggered when the file path of the current notification tone set by the user is changed. - /// - /// http://tizen.org/privilege/systemsettings.admin - /// platform - public static event EventHandler SoundNotificationChanged - { - add - { - if (s_soundNotificationChanged == null) - { - SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.SoundNotification, s_soundNotificationChangedCallback, IntPtr.Zero); - if (ret != SystemSettingsError.None) - { - throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling"); - } - } - s_soundNotificationChanged += value; - } - - remove - { - s_soundNotificationChanged -= value; - if (s_soundNotificationChanged == null) - { - SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.SoundNotification); - if (ret != SystemSettingsError.None) - { - throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling"); - } - } - } - } - - private static readonly Interop.Settings.SystemSettingsChangedCallback s_soundNotificationRepetitionPeriodChangedCallback = (SystemSettingsKeys key, IntPtr userData) => - { - int soundNotificationRepetitionPeriod = SystemSettings.SoundNotificationRepetitionPeriod; - SoundNotificationRepetitionPeriodChangedEventArgs eventArgs = new SoundNotificationRepetitionPeriodChangedEventArgs(soundNotificationRepetitionPeriod); - s_soundNotificationRepetitionPeriodChanged?.Invoke(null, eventArgs); - }; - private static event EventHandler s_soundNotificationRepetitionPeriodChanged; - /// - /// The SoundNotificationRepetitionPeriodChanged event is triggered when the time period for notification repetitions is changed. - /// - /// http://tizen.org/privilege/systemsettings.admin - /// platform - public static event EventHandler SoundNotificationRepetitionPeriodChanged - { - add - { - if (s_soundNotificationRepetitionPeriodChanged == null) - { - SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.SoundNotificationRepetitionPeriod, s_soundNotificationRepetitionPeriodChangedCallback, IntPtr.Zero); - if (ret != SystemSettingsError.None) - { - throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling"); - } - } - s_soundNotificationRepetitionPeriodChanged += value; - } - - remove - { - s_soundNotificationRepetitionPeriodChanged -= value; - if (s_soundNotificationRepetitionPeriodChanged == null) - { - SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.SoundNotificationRepetitionPeriod); - if (ret != SystemSettingsError.None) - { - throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling"); - } - } - } - } - - private static readonly Interop.Settings.SystemSettingsChangedCallback s_lockStateChangedCallback = (SystemSettingsKeys key, IntPtr userData) => - { - SystemSettingsIdleLockState lockState = SystemSettings.LockState; - LockStateChangedEventArgs eventArgs = new LockStateChangedEventArgs(lockState); - s_lockStateChanged?.Invoke(null, eventArgs); - }; - private static event EventHandler s_lockStateChanged; - /// - /// The LockStateChanged event is triggered when the current lock state is changed. - /// - /// http://tizen.org/privilege/systemsettings.admin - /// platform - public static event EventHandler LockStateChanged - { - add - { - if (s_lockStateChanged == null) - { - SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.LockState, s_lockStateChangedCallback, IntPtr.Zero); - if (ret != SystemSettingsError.None) - { - throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling"); - } - } - s_lockStateChanged += value; - } - - remove - { - s_lockStateChanged -= value; - if (s_lockStateChanged == null) - { - SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.LockState); - if (ret != SystemSettingsError.None) - { - throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling"); - } - } - } - } - - private static readonly Interop.Settings.SystemSettingsChangedCallback s_adsIdChangedCallback = (SystemSettingsKeys key, IntPtr userData) => - { - string adsId = SystemSettings.AdsId; - AdsIdChangedEventArgs eventArgs = new AdsIdChangedEventArgs(adsId); - s_adsIdChanged?.Invoke(null, eventArgs); - }; - private static event EventHandler s_adsIdChanged; - /// - /// The AdsIdChanged event is triggered when the current ADS ID state is changed. - /// - /// http://tizen.org/privilege/systemsettings.admin - /// platform - public static event EventHandler AdsIdChanged - { - add - { - if (s_adsIdChanged == null) - { - SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.AdsId, s_adsIdChangedCallback, IntPtr.Zero); - if (ret != SystemSettingsError.None) - { - throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling"); - } - } - s_adsIdChanged += value; - } - - remove - { - s_adsIdChanged -= value; - if (s_adsIdChanged == null) - { - SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.AdsId); - if (ret != SystemSettingsError.None) - { - throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling"); - } - } - } - } - - private static readonly Interop.Settings.SystemSettingsChangedCallback s_ultraDataSaveChangedCallback = (SystemSettingsKeys key, IntPtr userData) => - { - SystemSettingsUdsState ultraDataSave = SystemSettings.UltraDataSave; - UltraDataSaveChangedEventArgs eventArgs = new UltraDataSaveChangedEventArgs(ultraDataSave); - s_ultraDataSaveChanged?.Invoke(null, eventArgs); - }; - private static event EventHandler s_ultraDataSaveChanged; - /// - /// The UltraDataSaveChanged event is triggered when the current Ultra Data Save state is changed. - /// - /// http://tizen.org/privilege/systemsettings.admin - /// platform - public static event EventHandler UltraDataSaveChanged - { - add - { - if (s_ultraDataSaveChanged == null) - { - SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.UltraDataSave, s_ultraDataSaveChangedCallback, IntPtr.Zero); - if (ret != SystemSettingsError.None) - { - throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling"); - } - } - s_ultraDataSaveChanged += value; - } - - remove - { - s_ultraDataSaveChanged -= value; - if (s_ultraDataSaveChanged == null) - { - SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.UltraDataSave); - if (ret != SystemSettingsError.None) - { - throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling"); - } - } - } - } - - private static readonly Interop.Settings.SystemSettingsChangedCallback s_ultraDataSavePackageListChangedCallback = (SystemSettingsKeys key, IntPtr userData) => - { - string ultraDataSavePackageList = "None"; - UltraDataSavePackageListChangedEventArgs eventArgs = new UltraDataSavePackageListChangedEventArgs(ultraDataSavePackageList); - s_ultraDataSavePackageListChanged?.Invoke(null, eventArgs); - }; - private static event EventHandler s_ultraDataSavePackageListChanged; - /// - /// The UltraDataSavePackageListChanged event is triggered when the current ADS ID state is changed. - /// - /// http://tizen.org/privilege/systemsettings.admin - /// platform - public static event EventHandler UltraDataSavePackageListChanged - { - add - { - if (s_ultraDataSavePackageListChanged == null) - { - SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsSetCallback(SystemSettingsKeys.UltraDataSavePackageList, s_ultraDataSavePackageListChangedCallback, IntPtr.Zero); - if (ret != SystemSettingsError.None) - { - throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling"); - } - } - s_ultraDataSavePackageListChanged += value; - } - - remove - { - s_ultraDataSavePackageListChanged -= value; - if (s_ultraDataSavePackageListChanged == null) - { - SystemSettingsError ret = (SystemSettingsError)Interop.Settings.SystemSettingsRemoveCallback(SystemSettingsKeys.UltraDataSavePackageList); - if (ret != SystemSettingsError.None) - { - throw SystemSettingsExceptionFactory.CreateException(ret, "Error in callback handling"); - } - } - } - } - } -} - diff --git a/src/Tizen.System.SystemSettings/Tizen.System.SystemSettings/SystemSettingsEnums.cs b/src/Tizen.System.SystemSettings/Tizen.System.SystemSettings/SystemSettingsEnums.cs deleted file mode 100755 index b40268751..000000000 --- a/src/Tizen.System.SystemSettings/Tizen.System.SystemSettings/SystemSettingsEnums.cs +++ /dev/null @@ -1,216 +0,0 @@ -/* - * 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. - */ - -namespace Tizen.System -{ - /// - /// Enumeration for all the available system settings. - /// - public enum SystemSettingsKeys : int - { - /// - /// GET (string) The file path of the current ringtone. - /// - IncomingCallRingtone = 0, - /// - /// GET (string) The file path of the current home-screen wallpaper. - /// - WallpaperHomeScreen, - /// - /// GET (string) The file path of the current lock-screen wallpaper. - /// - WallpaperLockScreen, - /// - /// GET (int) The current system font size. - /// - FontSize, - /// - /// GET (string) The current system font type. - /// - FontType, - /// - /// GET (bool) Indicates whether the motion service is activated. - /// - MotionActivationEnabled, - /// - /// GET (string) The file path of the current email alert ringtone. - /// - EmailAlertRingtone, - /// - /// GET (bool) Indicates whether the USB debugging is enabled. - /// - UsbDebuggingEnabled, - /// - /// GET (bool) Indicates whether the 3G-data network is enabled. - /// - Data3GNetworkEnabled, - /// - /// GET (string) Indicates the lock-screen application package name. - /// - LockscreenApp = Data3GNetworkEnabled + 2, - /// - /// GET (string) The current system default font type (only supports Get). - /// - DefaultFontType, - /// - /// GET (string) Indicates the current country setting in the <LANGUAGE>_<REGION> syntax. - /// The country setting is in the ISO 639-2 format, - /// and the region setting is in the ISO 3166-1 alpha-2 format. - /// - LocaleCountry, - /// - /// GET (string) Indicates the current language setting in the <LANGUAGE>_<REGION> syntax. - /// The language setting is in the ISO 639-2 format, - /// and the region setting is in the ISO 3166-1 alpha-2 format. - /// - LocaleLanguage, - /// - /// GET (bool) Indicates whether the 24-hour clock is used. - /// If the value is false, the 12-hour clock is used. - /// - LocaleTimeFormat24HourEnabled, - /// - /// GET (string) Indicates the current time zone, for example, Pacific/Tahiti. - /// - LocaleTimeZone, - /// - /// GET (int) Once system changes the time, this event occurs to notify the time change. - /// - Time, - /// - /// GET (bool) Indicates whether the screen lock sound is enabled on the device, for example, the LCD on or off sound. - /// - SoundLockEnabled, - /// - /// GET (bool) Indicates whether the device is in the silent mode. - /// - SoundSilentModeEnabled, - /// - /// GET (bool) Indicates whether the screen touch sound is enabled on the device. - /// - SoundTouchEnabled, - /// - /// GET (bool) Indicates whether the rotation control is automatic. - /// - DisplayScreenRotationAutoEnabled, - /// - /// GET (string) Indicates the device name. - /// - DeviceName, - /// - /// GET (bool) Indicates whether the device user has the enabled motion feature. - /// - MotionEnabled, - /// - /// GET (bool) Indicates whether WiFi-related notifications are enabled on the device. - /// - NetworkWifiNotificationEnabled, - /// - /// GET (bool) Indicates whether the device is in the flight mode. - /// - NetworkFlightModeEnabled, - /// - /// GET (int) Indicates the backlight time (in seconds). The following values can be used: 15, 30, 60, 120, 300, and 600. - /// - ScreenBacklightTime, - /// - /// GET (string) Indicates the file path of the current notification tone set by the user. - /// - SoundNotification, - /// - /// GET (int) Indicates the time period for notification repetitions. - /// - SoundNotificationRepetitionPeriod, - /// - /// GET (int) Indicates the current lock state. - /// - LockState, - /// - /// GET (string) Indicates the ADS ID for each device. - /// - AdsId, - /// - /// GET (int) Indicates the Ultra Data Save status, one of the #SystemSettingsUdsState values. - /// - UltraDataSave, - /// - /// GET (string) Indicates the Ultra Data Save Package List. Since 4.0, the list is a string containing whitelisted package names separated with semicolons (;). - /// - UltraDataSavePackageList - } - /// - /// Enumeration for the Idle Lock State. - /// - public enum SystemSettingsIdleLockState : int - { - /// - /// The device is unlocked. - /// - Unlock = 0, - /// - /// The device is locked. - /// - Lock, - /// - /// The device is being locked. - /// - LaunchingLock - } - /// - /// Enumeration for the font size. - /// - public enum SystemSettingsFontSize : int - { - /// - /// A small size. - /// - Small = 0, - /// - /// A normal size. - /// - Normal, - /// - /// A large size. - /// - Large, - /// - /// A huge size. - /// - Huge, - /// - /// A giant size. - /// - Giant - } - /// - /// Enumeration for the ultra data save. - /// - public enum SystemSettingsUdsState : int - { - /// - /// UDS Off. - /// - UdsOff = 0, - /// - /// UDS On. - /// - UdsOn, - /// - /// UDS On and the application is whitelisted. - /// - UdsOnWhitelisted, - } -} diff --git a/src/Tizen.System.SystemSettings/Tizen.System.SystemSettings/SystemSettingsEventArgs.cs b/src/Tizen.System.SystemSettings/Tizen.System.SystemSettings/SystemSettingsEventArgs.cs deleted file mode 100755 index 13da678e9..000000000 --- a/src/Tizen.System.SystemSettings/Tizen.System.SystemSettings/SystemSettingsEventArgs.cs +++ /dev/null @@ -1,712 +0,0 @@ -/* - * 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.System -{ - /// - /// EventArgs type for the IncomingCallRingtoneChanged event. - /// - public class IncomingCallRingtoneChangedEventArgs : EventArgs - { - private readonly string _incomingCallRingtone = null; - internal IncomingCallRingtoneChangedEventArgs(string val) - { - _incomingCallRingtone = val; - } - - /// - /// The file path of the current ringtone. - /// - public string Value - { - get - { - return _incomingCallRingtone; - } - } - } - - /// - /// EventArgs type for the WallpaperHomeScreenChanged event. - /// - public class WallpaperHomeScreenChangedEventArgs : EventArgs - { - private readonly string _wallpaperHomeScreen = null; - internal WallpaperHomeScreenChangedEventArgs(string val) - { - _wallpaperHomeScreen = val; - } - - /// - /// The file path of the current home screen wallpaper. - /// - public string Value - { - get - { - return _wallpaperHomeScreen; - } - } - } - - /// - /// EventArgs type for the WallpaperLockScreenChanged event. - /// - public class WallpaperLockScreenChangedEventArgs : EventArgs - { - private readonly string _wallpaperLockScreen = null; - internal WallpaperLockScreenChangedEventArgs(string val) - { - _wallpaperLockScreen = val; - } - - /// - /// The file path of the current lock screen wallpaper. - /// - public string Value - { - get - { - return _wallpaperLockScreen; - } - } - } - - /// - /// EventArgs type for the FontSizeChanged event. - /// - public class FontSizeChangedEventArgs : EventArgs - { - private readonly SystemSettingsFontSize _fontSize; - internal FontSizeChangedEventArgs(SystemSettingsFontSize val) - { - _fontSize = val; - } - - /// - /// The current system font size. - /// - public SystemSettingsFontSize Value - { - get - { - return _fontSize; - } - } - } - - /// - /// EventArgs type for the FontTypeChanged event. - /// - public class FontTypeChangedEventArgs : EventArgs - { - private readonly string _fontType = null; - internal FontTypeChangedEventArgs(string val) - { - _fontType = val; - } - - /// - /// The current system font type. - /// - public string Value - { - get - { - return _fontType; - } - } - } - - /// - /// EventArgs type for the MotionActivationChanged event. - /// - public class MotionActivationSettingChangedEventArgs : EventArgs - { - private readonly bool _motionActivation; - internal MotionActivationSettingChangedEventArgs(bool val) - { - _motionActivation = val; - } - - /// - /// Indicates whether the motion service is activated. - /// - public bool Value - { - get - { - return _motionActivation; - } - } - } - - /// - /// EventArgs type for the EmailAlertRingtoneChanged event. - /// - public class EmailAlertRingtoneChangedEventArgs : EventArgs - { - private readonly string _emailAlertRingtone = null; - internal EmailAlertRingtoneChangedEventArgs(string val) - { - _emailAlertRingtone = val; - } - - /// - /// The file path of the current email alert ringtone. - /// - public string Value - { - get - { - return _emailAlertRingtone; - } - } - } - - /// - /// EventArgs type for the UsbDebuggingSettingChanged event. - /// - public class UsbDebuggingSettingChangedEventArgs : EventArgs - { - private readonly bool _usbDebuggingEnabled; - internal UsbDebuggingSettingChangedEventArgs(bool val) - { - _usbDebuggingEnabled = val; - } - - /// - /// Indicates whether the USB debugging is enabled. - /// - public bool Value - { - get - { - return _usbDebuggingEnabled; - } - } - } - - /// - /// EventArgs type for the Data3GNetworkSettingChanged event. - /// - public class Data3GNetworkSettingChangedEventArgs : EventArgs - { - private readonly bool _data3GNetworkEnabled; - internal Data3GNetworkSettingChangedEventArgs(bool val) - { - _data3GNetworkEnabled = val; - } - - /// - /// Indicates whether the 3G data network is enabled. - /// - public bool Value - { - get - { - return _data3GNetworkEnabled; - } - } - } - - /// - /// EventArgs type for the LockscreenAppChanged event. - /// - public class LockscreenAppChangedEventArgs : EventArgs - { - private readonly string _lockscreenApp = null; - internal LockscreenAppChangedEventArgs(string val) - { - _lockscreenApp = val; - } - - /// - /// Indicates the lock screen application package name. - /// - public string Value - { - get - { - return _lockscreenApp; - } - } - } - - /// - /// EventArgs type for the LocaleCountryChanged event. - /// - public class LocaleCountryChangedEventArgs : EventArgs - { - private readonly string _localeCountry = null; - internal LocaleCountryChangedEventArgs(string val) - { - _localeCountry = val; - } - - /// - /// Indicates the current country setting in the <LANGUAGE>_<REGION> syntax. - /// The country setting is in the ISO 639-2 format, and the region setting is in the ISO 3166-1 alpha-2 format. - /// - public string Value - { - get - { - return _localeCountry; - } - } - } - - /// - /// EventArgs type for the LocaleLanguageChanged event. - /// - public class LocaleLanguageChangedEventArgs : EventArgs - { - private readonly string _localeLanguage = null; - internal LocaleLanguageChangedEventArgs(string val) - { - _localeLanguage = val; - } - - /// - /// Indicates the current language setting in the <LANGUAGE>_<REGION> syntax. - /// The language setting is in the ISO 639-2 format and the region setting is in the ISO 3166-1 alpha-2 format. - /// - public string Value - { - get - { - return _localeLanguage; - } - } - } - - /// - /// EventArgs type for the LocaleTimeFormat24HourChanged event. - /// - public class LocaleTimeFormat24HourSettingChangedEventArgs : EventArgs - { - private readonly bool _localeTimeFormat24Hour; - internal LocaleTimeFormat24HourSettingChangedEventArgs(bool val) - { - _localeTimeFormat24Hour = val; - } - - /// - /// Indicates whether the 24-hour clock is used. If the value is false, the 12-hour clock is used. - /// - public bool Value - { - get - { - return _localeTimeFormat24Hour; - } - } - } - - /// - /// EventArgs type for the LocaleTimeZoneChanged event. - /// - public class LocaleTimeZoneChangedEventArgs : EventArgs - { - private readonly string _localeTimeZone = null; - internal LocaleTimeZoneChangedEventArgs(string val) - { - _localeTimeZone = val; - } - - /// - /// Indicates the current time zone. - /// - public string Value - { - get - { - return _localeTimeZone; - } - } - } - - /// - /// EventArgs type for the TimeChanged event. - /// - public class TimeChangedEventArgs : EventArgs - { - private readonly int _time; - internal TimeChangedEventArgs(int val) - { - _time = val; - } - - /// - /// Indicates the current time. - /// - public int Value - { - get - { - return _time; - } - } - } - - /// - /// EventArgs type for the SoundLockChanged event. - /// - public class SoundLockSettingChangedEventArgs : EventArgs - { - private readonly bool _soundLock; - internal SoundLockSettingChangedEventArgs(bool val) - { - _soundLock = val; - } - - /// - /// Indicates whether the screen lock sound is enabled on the device, for example, the LCD on or off sound. - /// - public bool Value - { - get - { - return _soundLock; - } - } - } - - /// - /// EventArgs type for the SoundSilentModeChanged event. - /// - public class SoundSilentModeSettingChangedEventArgs : EventArgs - { - private readonly bool _soundSilentMode; - internal SoundSilentModeSettingChangedEventArgs(bool val) - { - _soundSilentMode = val; - } - - /// - /// Indicates whether the device is in the silent mode. - /// - public bool Value - { - get - { - return _soundSilentMode; - } - } - } - - /// - /// EventArgs type for the SoundTouchChanged event. - /// - public class SoundTouchSettingChangedEventArgs : EventArgs - { - private readonly bool _soundTouch; - internal SoundTouchSettingChangedEventArgs(bool val) - { - _soundTouch = val; - } - - /// - /// Indicates whether the screen touch sound is enabled on the device. - /// - public bool Value - { - get - { - return _soundTouch; - } - } - } - - /// - /// EventArgs type for the DisplayScreenRotationAutoChanged event. - /// - public class DisplayScreenRotationAutoSettingChangedEventArgs : EventArgs - { - private readonly bool _displayScreenRotationAuto; - internal DisplayScreenRotationAutoSettingChangedEventArgs(bool val) - { - _displayScreenRotationAuto = val; - } - - /// - /// Indicates whether the rotation control is automatic. - /// - public bool Value - { - get - { - return _displayScreenRotationAuto; - } - } - } - - /// - /// EventArgs type for the DeviceNameChanged event. - /// - public class DeviceNameChangedEventArgs : EventArgs - { - private readonly string _deviceName = null; - internal DeviceNameChangedEventArgs(string val) - { - _deviceName = val; - } - - /// - /// Indicates the device name. - /// - public string Value - { - get - { - return _deviceName; - } - } - } - - /// - /// EventArgs type for the MotionSettingChanged event. - /// - public class MotionSettingChangedEventArgs : EventArgs - { - private readonly bool _motionEnabled; - internal MotionSettingChangedEventArgs(bool val) - { - _motionEnabled = val; - } - - /// - /// Indicates whether the device user has enabled the motion feature. - /// - public bool Value - { - get - { - return _motionEnabled; - } - } - } - - /// - /// EventArgs type for the NetworkWifiNotificationChanged event. - /// - public class NetworkWifiNotificationSettingChangedEventArgs : EventArgs - { - private readonly bool _networkWifiNotification; - internal NetworkWifiNotificationSettingChangedEventArgs(bool val) - { - _networkWifiNotification = val; - } - - /// - /// Indicates whether Wi-Fi-related notifications are enabled on the device. - /// - public bool Value - { - get - { - return _networkWifiNotification; - } - } - } - - /// - /// EventArgs type for the NetworkFlightModeChanged event. - /// - public class NetworkFlightModeSettingChangedEventArgs : EventArgs - { - private readonly bool _networkFlightMode; - internal NetworkFlightModeSettingChangedEventArgs(bool val) - { - _networkFlightMode = val; - } - - /// - /// Indicates whether the device is in the flight mode. - /// - public bool Value - { - get - { - return _networkFlightMode; - } - } - } - - /// - /// EventArgs type for the ScreenBacklightTimeChanged event. - /// - public class ScreenBacklightTimeChangedEventArgs : EventArgs - { - private readonly int _screenBacklightTime; - internal ScreenBacklightTimeChangedEventArgs(int val) - { - _screenBacklightTime = val; - } - - /// - /// Indicates the backlight time (in seconds). - /// - public int Value - { - get - { - return _screenBacklightTime; - } - } - } - - /// - /// EventArgs type for the SoundNotificationChanged event. - /// - public class SoundNotificationChangedEventArgs : EventArgs - { - private readonly string _soundNotification = null; - internal SoundNotificationChangedEventArgs(string val) - { - _soundNotification = val; - } - - /// - /// Indicates the file path of the current notification tone set by the user. - /// - public string Value - { - get - { - return _soundNotification; - } - } - } - - /// - /// EventArgs type for the SoundNotificationRepetitionPeriodChanged event. - /// - public class SoundNotificationRepetitionPeriodChangedEventArgs : EventArgs - { - private readonly int _soundNotificationRepetitionPeriod; - internal SoundNotificationRepetitionPeriodChangedEventArgs(int val) - { - _soundNotificationRepetitionPeriod = val; - } - - /// - /// Indicates the time period for notification repetitions. - /// - public int Value - { - get - { - return _soundNotificationRepetitionPeriod; - } - } - } - - /// - /// EventArgs type for the LockStateChanged event. - /// - public class LockStateChangedEventArgs : EventArgs - { - private readonly SystemSettingsIdleLockState _lockState; - internal LockStateChangedEventArgs(SystemSettingsIdleLockState val) - { - _lockState = val; - } - - /// - /// Indicates the current lock state. - /// - public SystemSettingsIdleLockState Value - { - get - { - return _lockState; - } - } - } - - /// - /// EventArgs type for the AdsIdChanged event. - /// - public class AdsIdChangedEventArgs : EventArgs - { - private readonly string _adsId = null; - internal AdsIdChangedEventArgs(string val) - { - _adsId = val; - } - - /// - /// Indicates the current lock state. - /// - public string Value - { - get - { - return _adsId; - } - } - } - - /// - /// EventArgs type for the UltraDataSaveChanged event. - /// - public class UltraDataSaveChangedEventArgs : EventArgs - { - private readonly SystemSettingsUdsState _ultraDataSave = SystemSettingsUdsState.UdsOff; - internal UltraDataSaveChangedEventArgs(SystemSettingsUdsState val) - { - _ultraDataSave = val; - } - - /// - /// Indicates the current lock state. - /// - public SystemSettingsUdsState Value - { - get - { - return _ultraDataSave; - } - } - } - - /// - /// EventArgs type for the UltraDataSavePackageListChanged event. - /// - public class UltraDataSavePackageListChangedEventArgs : EventArgs - { - private readonly string _ultraDataSavePackageList = null; - internal UltraDataSavePackageListChangedEventArgs(string val) - { - _ultraDataSavePackageList = val; - } - - /// - /// Indicates the current lock state. - /// - public string Value - { - get - { - return _ultraDataSavePackageList; - } - } - } -} diff --git a/src/Tizen.System.SystemSettings/Tizen.System.SystemSettings/SystemSettingsExceptionFactory.cs b/src/Tizen.System.SystemSettings/Tizen.System.SystemSettings/SystemSettingsExceptionFactory.cs deleted file mode 100644 index 039ff412d..000000000 --- a/src/Tizen.System.SystemSettings/Tizen.System.SystemSettings/SystemSettingsExceptionFactory.cs +++ /dev/null @@ -1,61 +0,0 @@ -/* - * 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.System -{ - internal enum SystemSettingsError - { - None = Tizen.Internals.Errors.ErrorCode.None, - InvalidParameter = Tizen.Internals.Errors.ErrorCode.InvalidParameter, - OutOfMemory = Tizen.Internals.Errors.ErrorCode.OutOfMemory, - IoError = Tizen.Internals.Errors.ErrorCode.IoError, - PermissionDenied = Tizen.Internals.Errors.ErrorCode.PermissionDenied, - NotSupported = Tizen.Internals.Errors.ErrorCode.NotSupported, - LockScreenAppPasswordMode = -0x01140000 | 0x01 - }; - internal class SystemSettingsExceptionFactory - { - internal const string LogTag = "Tizen.System.SystemSettings"; - - internal static Exception CreateException(SystemSettingsError err, string msg) - { - Exception exp; - switch (err) - { - case SystemSettingsError.InvalidParameter: - exp = new ArgumentException(msg); - break; - case SystemSettingsError.NotSupported: - exp = new NotSupportedException(msg); - break; - case SystemSettingsError.OutOfMemory: - //fall through - case SystemSettingsError.IoError: - //fall through - case SystemSettingsError.PermissionDenied: - //fall through - case SystemSettingsError.LockScreenAppPasswordMode: - //fall through - default: - exp = new InvalidOperationException(msg); - break; - } - return exp; - } - } -} diff --git a/src/Tizen.System/Device/Battery.cs b/src/Tizen.System/Device/Battery.cs deleted file mode 100755 index 9e5682550..000000000 --- a/src/Tizen.System/Device/Battery.cs +++ /dev/null @@ -1,334 +0,0 @@ -/* -* 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.System -{ - /// - /// Enumeration for the battery levels. - /// - /// 3 - public enum BatteryLevelStatus - { - /// - /// The battery goes empty. - /// Prepare for the safe termination of the application, - /// because the device starts a shutdown process soon - /// after entering this level. - /// - /// 3 - Empty = 0, - /// - /// The battery charge is at a critical state. - /// You may have to stop using the multimedia features, - /// because they are not guaranteed to work correctly - /// with this battery status. - /// - /// 3 - Critical, - /// - /// The battery has little charge left. - /// - /// 3 - Low, - /// - /// The battery status is not to be careful. - /// - /// 3 - High, - /// - /// The battery status is fully charged. - /// It means no more charge. - /// - /// 3 - Full - } - - /// - /// The Battery class provides the properties and events for the device battery. - /// - /// - /// The Battery API provides the way to get the current battery capacity value (Percent), - /// the battery state, and the charging state. It also provides the events for an application - /// to receive the battery status change events from the device. - /// To receive the battery event, the application should register with the respective EventHandler. - /// - /// - /// Console.WriteLine("battery Charging state is: {0}", Tizen.System.Battery.IsCharging); - /// Console.WriteLine("battery Percent is: {0}", Tizen.System.Battery.Percent); - /// - public static class Battery - { - private static readonly object s_lock = new object(); - /// - /// Gets the battery charge percentage. - /// - /// 3 - /// It returns an integer value from 0 to 100 that indicates the remaining - /// battery charge as a percentage of the maximum level. - public static int Percent - { - get - { - int percent = 0; - DeviceError res = (DeviceError)Interop.Device.DeviceBatteryGetPercent(out percent); - if (res != DeviceError.None) - { - Log.Warn(DeviceExceptionFactory.LogTag, "unable to get battery percentage."); - } - return percent; - } - } - /// - /// Gets the current battery level. - /// - /// 3 - public static BatteryLevelStatus Level - { - get - { - int level = 0; - DeviceError res = (DeviceError)Interop.Device.DeviceBatteryGetLevelStatus(out level); - if (res != DeviceError.None) - { - Log.Warn(DeviceExceptionFactory.LogTag, "unable to get battery status."); - } - return (BatteryLevelStatus)level; - } - } - /// - /// Gets the current charging state. - /// - /// 3 - public static bool IsCharging - { - get - { - bool charging; - DeviceError res = (DeviceError)Interop.Device.DeviceBatteryIsCharging(out charging); - if (res != DeviceError.None) - { - Log.Warn(DeviceExceptionFactory.LogTag, "unable to get battery charging state."); - } - return charging; - } - } - - private static EventHandler s_capacityChanged; - /// - /// CapacityChanged is triggered when the battery charge percentage is changed. - /// - /// 3 - /// - /// public static async Task BatteryEventHandler() - /// { - /// EventHandler handler = null; - /// handler = (object sender, BatteryChargingStateChangedEventArgs args) => - /// { - /// Console.WriteLine("battery Percent is: {0}", args.Percent); - /// } - /// Battery.PercentChanged += handler; - /// await Task.Delay(20000); - /// } - /// - public static event EventHandler PercentChanged - { - add - { - lock (s_lock) - { - if (s_capacityChanged == null) - { - EventListenerStart(EventType.BatteryPercent); - } - s_capacityChanged += value; - } - } - remove - { - lock (s_lock) - { - s_capacityChanged -= value; - if (s_capacityChanged == null) - { - EventListenerStop(EventType.BatteryPercent); - } - } - } - } - - private static event EventHandler s_levelChanged; - - /// - /// LevelChanged is triggered when the battery level is changed. - /// - /// 3 - /// - /// public static async Task BatteryEventHandler() - /// { - /// EventHandler handler = null; - /// handler = (object sender, BatteryLevelChangedEventArgs args) => - /// { - /// Console.WriteLine("battery Level is: {0}", args.Level); - /// } - /// Battery.LevelChanged += handler; - /// await Task.Delay(20000); - /// } - /// - public static event EventHandler LevelChanged - { - add - { - lock (s_lock) - { - if (s_levelChanged == null) - { - EventListenerStart(EventType.BatteryLevel); - } - s_levelChanged += value; - } - } - remove - { - lock (s_lock) - { - s_levelChanged -= value; - if (s_levelChanged == null) - { - EventListenerStop(EventType.BatteryLevel); - } - } - } - } - - private static event EventHandler s_chargingStateChanged; - /// - /// ChargingStatusChanged is triggered when the battery charging status is changed. - /// This event is triggered when the charger is connected/disconnected. - /// - /// 3 - /// - /// public static async Task BatteryEventHandler() - /// { - /// EventHandler handler = null; - /// handler = (object sender, BatteryChargingStateChangedEventArgs args) => - /// { - /// Console.WriteLine("battery Level is: {0}", args.IsCharging); - /// } - /// Battery.ChargingStateChanged += handler; - /// await Task.Delay(20000); - /// } - /// - public static event EventHandler ChargingStateChanged - { - add - { - lock (s_lock) - { - if (s_chargingStateChanged == null) - { - EventListenerStart(EventType.BatteryCharging); - } - s_chargingStateChanged += value; - } - } - remove - { - lock (s_lock) - { - s_chargingStateChanged -= value; - if (s_chargingStateChanged == null) - { - EventListenerStop(EventType.BatteryCharging); - } - } - } - } - - private static Interop.Device.deviceCallback s_cpacityHandler; - private static Interop.Device.deviceCallback s_levelHandler; - private static Interop.Device.deviceCallback s_chargingHandler; - - private static void EventListenerStart(EventType eventType) - { - switch (eventType) - { - case EventType.BatteryPercent: - s_cpacityHandler = (int type, IntPtr value, IntPtr data) => - { - int val = value.ToInt32(); - BatteryPercentChangedEventArgs e = new BatteryPercentChangedEventArgs() - { - Percent = val - }; - s_capacityChanged?.Invoke(null, e); - return true; - }; - - Interop.Device.DeviceAddCallback(eventType, s_cpacityHandler, IntPtr.Zero); - break; - - case EventType.BatteryLevel: - s_levelHandler = (int type, IntPtr value, IntPtr data) => - { - int val = value.ToInt32(); - BatteryLevelChangedEventArgs e = new BatteryLevelChangedEventArgs() - { - Level = (BatteryLevelStatus)val - }; - s_levelChanged?.Invoke(null, e); - return true; - }; - - Interop.Device.DeviceAddCallback(eventType, s_levelHandler, IntPtr.Zero); - break; - - case EventType.BatteryCharging: - s_chargingHandler = (int type, IntPtr value, IntPtr data) => - { - bool val = (value.ToInt32() == 1); - BatteryChargingStateChangedEventArgs e = new BatteryChargingStateChangedEventArgs() - { - IsCharging = val - }; - s_chargingStateChanged?.Invoke(null, e); - return true; - }; - Interop.Device.DeviceAddCallback(eventType, s_chargingHandler, IntPtr.Zero); - break; - } - } - - private static void EventListenerStop(EventType eventType) - { - switch (eventType) - { - case EventType.BatteryPercent: - Interop.Device.DeviceRemoveCallback(eventType, s_cpacityHandler); - break; - - case EventType.BatteryLevel: - Interop.Device.DeviceRemoveCallback(eventType, s_levelHandler); - break; - - case EventType.BatteryCharging: - Interop.Device.DeviceRemoveCallback(eventType, s_chargingHandler); - break; - } - } - } -} diff --git a/src/Tizen.System/Device/DeviceEventArgs.cs b/src/Tizen.System/Device/DeviceEventArgs.cs deleted file mode 100644 index 53a75bb15..000000000 --- a/src/Tizen.System/Device/DeviceEventArgs.cs +++ /dev/null @@ -1,86 +0,0 @@ -/* -* 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.System -{ - /// - /// BatteryPercentChangedEventArgs is an extended EventArgs class. This class contains event arguments for the BatteryPercentChanged event from the battery class. - /// - public class BatteryPercentChangedEventArgs : EventArgs - { - internal BatteryPercentChangedEventArgs(){} - /// - /// The current capacity of the battery. - /// Capacity is an integer value from 0 to 100 that indicates the remaining battery charge as a percentage of the maximum level. - /// - /// 3 - public int Percent { get; internal set; } - } - - /// - /// BatteryLevelChangedEventArgs is an extended EventArgs class. This class contains event arguments for the BatteryLevelChanged event from the battery class. - /// - public class BatteryLevelChangedEventArgs : EventArgs - { - internal BatteryLevelChangedEventArgs(){} - /// - /// The level indicates the current battery level status which is a type of the BatteryLevelStatus. - /// - /// 3 - public BatteryLevelStatus Level { get; internal set; } - } - - /// - /// BatteryChargingStateChangedEventArgs is an extended EventArgs class. This class contains event arguments for the BatteryChargingStateChanged event from the battery class. - /// - public class BatteryChargingStateChangedEventArgs : EventArgs - { - internal BatteryChargingStateChangedEventArgs() {} - /// - /// The charging state of the battery. Charging is a type of a boolean which indicates true/false based on the current charging status. - /// - /// 3 - public bool IsCharging { get; internal set; } - } - - /// - /// DisplayStateChangedEventArgs is an extended EventArgs class. This class contains event arguments for the DisplayStateChanged event from the display class. - /// - public class DisplayStateChangedEventArgs : EventArgs - { - internal DisplayStateChangedEventArgs() {} - /// - /// The state indicates the current display state of the device which is an enumeration of the type DisplayState. - /// - /// 3 - public DisplayState State { get; internal set; } - } - - /// - /// LedBrightnessChangedEventArgs is an extended EventArgs class. This class contains event arguments for the LedBrightnessChanged event from the LED class. - /// - public class LedBrightnessChangedEventArgs : EventArgs - { - internal LedBrightnessChangedEventArgs() {} - /// - /// Brightness indicates the current brightness level of the display as an integer. - /// - /// 3 - public int Brightness { get; internal set; } - } -} diff --git a/src/Tizen.System/Device/DeviceExceptionFactory.cs b/src/Tizen.System/Device/DeviceExceptionFactory.cs deleted file mode 100644 index 96c1eeb29..000000000 --- a/src/Tizen.System/Device/DeviceExceptionFactory.cs +++ /dev/null @@ -1,73 +0,0 @@ -/* -* 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.Collections.Generic; -using System.Linq; -using System.Text; - -namespace Tizen.System -{ - internal enum DeviceError - { - None = Tizen.Internals.Errors.ErrorCode.None, - InvalidParameter = Tizen.Internals.Errors.ErrorCode.InvalidParameter, - PermissionDenied = Tizen.Internals.Errors.ErrorCode.PermissionDenied, - InvalidOperation = Tizen.Internals.Errors.ErrorCode.InvalidOperation, - AlreadyInProgress = Tizen.Internals.Errors.ErrorCode.NowInProgress, - NotSupported = Tizen.Internals.Errors.ErrorCode.NotSupported, - ResourceBusy = Tizen.Internals.Errors.ErrorCode.ResourceBusy, - OperationFailed = -0x01140000 | 0x01, - NotInitialized = -0x01140000 | 0x02 - }; - - class DeviceExceptionFactory - { - internal const string LogTag = "Tizen.System.Device"; - - internal static Exception CreateException(DeviceError err, string msg) - { - Exception exp; - switch (err) - { - case DeviceError.InvalidParameter: - case DeviceError.NotInitialized: - //fall through - exp = new ArgumentException(msg); - break; - case DeviceError.NotSupported: - exp = new NotSupportedException(msg +" : Device does not support the Operation."); - break; - case DeviceError.AlreadyInProgress: - //fall through - case DeviceError.ResourceBusy: - //fall through - case DeviceError.OperationFailed: - //fall through - case DeviceError.InvalidOperation: - exp = new InvalidOperationException(msg); - break; - case DeviceError.PermissionDenied: - exp = new UnauthorizedAccessException(msg); - break; - default: - exp = new InvalidOperationException("Unknown error occured."); - break; - } - return exp; - } - } -} diff --git a/src/Tizen.System/Device/Display.cs b/src/Tizen.System/Device/Display.cs deleted file mode 100644 index 4ee57c0de..000000000 --- a/src/Tizen.System/Device/Display.cs +++ /dev/null @@ -1,255 +0,0 @@ -/* -* 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.Collections.Generic; -namespace Tizen.System -{ - /// - /// Enumeration for the available display states. - /// An application cannot put the device into the power off state or the suspend state. - /// - /// 3 - public enum DisplayState - { - /// - /// Normal state. - /// - /// 3 - Normal = 0, - /// - /// Screen dim state. - /// - /// 3 - Dim, - /// - /// Screen off state. - /// - /// 3 - Off - } - - /// - /// The Display class provides the properties and events to control the display status and brightness. - /// - /// - /// The Display API provides the way to get the current display brightness value, - /// the display state, and the total number of available displays. - /// It also provides the events for an application to receive the display state change events from the device. - /// To receive the display event, the application should register with an associated EventHandler. - /// - /// - /// 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; - private static readonly object s_lock = new object(); - private static Lazy> _lazyDisplays; - private Display(int deviceNumber) - { - _displayId = deviceNumber; - } - - /// - /// The number of available display devices. - /// - /// 3 - public static int NumberOfDisplays - { - get - { - int number = 0; - DeviceError res = (DeviceError)Interop.Device.DeviceDisplayGetNumbers(out number); - if (res != DeviceError.None) - { - Log.Warn(DeviceExceptionFactory.LogTag, "unable to get number of displays."); - } - return number; - } - } - /// - /// Gets all the available displays. - /// The display at the index zero is always assigned to the main display. - /// - /// 3 - public static IReadOnlyList Displays - { - get - { - _lazyDisplays = new Lazy>(() => GetAllDisplayes()); - return _lazyDisplays.Value; - } - } - - - private static IReadOnlyList GetAllDisplayes() - { - List displays = new List(); - - for (int i = 0; i < NumberOfDisplays; i++) - { - displays.Add(new Display(i)); - } - return displays; - - } - /// - /// 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 - { - int max = 0; - DeviceError res = (DeviceError)Interop.Device.DeviceDisplayGetMaxBrightness(_displayId, out max); - if (res != DeviceError.None) - { - Log.Warn(DeviceExceptionFactory.LogTag, "unable to get max brightness."); - } - return max; - } - } - - /// - /// The brightness value of the display. - /// - /// - /// The brightness value should be less than or equal to the MaxBrightness value. - /// - /// 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 - { - int brightness = 0; - DeviceError res = (DeviceError)Interop.Device.DeviceDisplayGetBrightness(_displayId, out brightness); - if (res != DeviceError.None) - { - Log.Warn(DeviceExceptionFactory.LogTag, "unable to get brightness."); - } - return brightness; - } - set - { - //TODO: Check for maximum throw exception.. - DeviceError res = (DeviceError)Interop.Device.DeviceDisplaySetBrightness(_displayId, value); - if (res != DeviceError.None) - { - throw DeviceExceptionFactory.CreateException(res, "unable to set brightness value"); - } - } - } - /// - /// The current device display state. - /// - /// 3 - public static DisplayState State - { - get - { - int state = 0; - DeviceError res = (DeviceError)Interop.Device.DeviceDisplayGetState(out state); - if (res != DeviceError.None) - { - Log.Warn(DeviceExceptionFactory.LogTag, "unable to get Display state."); - } - return (DisplayState)state; - } - } - - private static event EventHandler s_stateChanged; - /// - /// StateChanged is raised when the state of the display is changed. - /// - /// 3 - /// - /// DisplayStateChangedEventArgs is an object that contains the changed state. - /// - /// public static async Task DisplayEventHandler() - /// { - /// EventHandler handler = null; - /// handler = (object sender, DisplayStateChangedEventArgs args) => - /// { - /// Console.WriteLine("Display State is: {0}", args.State); - /// } - /// Battery.StateChanged += handler; - /// await Task.Delay(20000); - /// } - /// - public static event EventHandler StateChanged - { - add - { - lock (s_lock) - { - if (s_stateChanged == null) - { - EventListenerStart(); - } - s_stateChanged += value; - } - } - remove - { - lock (s_lock) - { - s_stateChanged -= value; - if (s_stateChanged == null) - { - EventListenerStop(); - } - } - } - } - - private static Interop.Device.deviceCallback s_handler; - private static void EventListenerStart() - { - s_handler = (int type, IntPtr value, IntPtr data) => - { - int val = value.ToInt32(); - DisplayStateChangedEventArgs e = new DisplayStateChangedEventArgs() - { - State = (DisplayState)val - }; - s_stateChanged?.Invoke(null, e); - return true; - }; - Interop.Device.DeviceAddCallback(EventType.DisplayState, s_handler, IntPtr.Zero); - } - - private static void EventListenerStop() - { - Interop.Device.DeviceRemoveCallback(EventType.DisplayState, s_handler); - } - } -} diff --git a/src/Tizen.System/Device/Haptic.cs b/src/Tizen.System/Device/Haptic.cs deleted file mode 100644 index c8543e66d..000000000 --- a/src/Tizen.System/Device/Haptic.cs +++ /dev/null @@ -1,202 +0,0 @@ -/* -* 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.Collections.Generic; -namespace Tizen.System -{ - /// - /// The Vibrator class provides the properties and methods to control a vibrator. - /// - /// - /// The Vibrator API provides the way to access the vibrators in the device. - /// It allows the management of the device's vibrator parameters, such as the vibration count and level. - /// It provides the methods to vibrate and stop the vibration. - /// - /// - /// 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; - private IntPtr _hapticHandle = IntPtr.Zero; - private bool _disposedValue = false; - private static Lazy> _lazyVibrators; - private static int _maxcount = 0; - private Vibrator(int id) - { - _vibratorId = id; - DeviceError res = (DeviceError)Interop.Device.DeviceHapticOpen(_vibratorId, out _hapticHandle); - if (res != DeviceError.None) - { - throw DeviceExceptionFactory.CreateException(res, "unable to create Vibrator for given Id"); - } - res = (DeviceError)Interop.Device.DeviceHapticGetCount(out _maxcount); - if (res != DeviceError.None) - { - Log.Warn(DeviceExceptionFactory.LogTag, "unable to get Vibrators count."); - } - - } - - ~Vibrator() - { - Dispose(false); - } - /// - /// Gets the number of the available vibrators. - /// - /// 3 - public static int NumberOfVibrators - { - get - { - int count = 0; - DeviceError res = (DeviceError)Interop.Device.DeviceHapticGetCount(out count); - if (res != DeviceError.None) - { - Log.Warn(DeviceExceptionFactory.LogTag, "unable to get Vibrators count."); - } - return count; - } - } - /// - /// Gets all the available vibrators. - /// - /// 3 - public static IReadOnlyList Vibrators - { - get - { - _lazyVibrators = new Lazy>(() => GetAllVibrators()); - return _lazyVibrators.Value; - } - } - private static IReadOnlyList GetAllVibrators() - { - int count = 0; - List vibrators = new List(); - DeviceError res = (DeviceError)Interop.Device.DeviceHapticGetCount(out count); - if (res != DeviceError.None) - { - throw DeviceExceptionFactory.CreateException(res, "unable to get Vibrators count."); - } - for (int i = 0; i < NumberOfVibrators; i++) - { - vibrators.Add(new Vibrator(i)); - } - return vibrators; - - } - /// - /// Vibrates during the specified time with a constant intensity. - /// This function can be used to start monotonous vibration for the specified time. - /// - /// 3 - /// The play duration in milliseconds. - /// The amount of the intensity variation (0 ~ 100). - /// When an invalid parameter value is set. - /// 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 - /// { - /// vibrator.Vibrate(2000, 70); - /// } - /// Catch(Exception e) - /// { - /// } - /// - - public void Vibrate(int duration, int feedback) - { - IntPtr effect; - DeviceError res = DeviceError.None; - if (_hapticHandle == IntPtr.Zero) - { - res = (DeviceError)Interop.Device.DeviceHapticOpen(_vibratorId, out _hapticHandle); - if (res != DeviceError.None) - { - throw DeviceExceptionFactory.CreateException(res, "unable to get vibrator."); - } - } - - res = (DeviceError)Interop.Device.DeviceHapticVibrate(_hapticHandle, duration, feedback, out effect); - if (res != DeviceError.None) - { - throw DeviceExceptionFactory.CreateException(res, "unable to vibrate the current vibrator."); - } - } - /// - /// Stops all the vibration effects which are being played. - /// This function can be used to stop all the effects started by Vibrate(). - /// - /// 3 - /// In case an invalid vibrator instance is used. - /// 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 - /// { - /// vibrator.Stop(); - /// } - /// Catch(Exception e) - /// { - /// } - /// - public void Stop() - { - if (_hapticHandle != IntPtr.Zero) - { - DeviceError res = (DeviceError)Interop.Device.DeviceHapticStop(_hapticHandle, IntPtr.Zero); - if (res != DeviceError.None) - { - throw DeviceExceptionFactory.CreateException(res, "unable to stop the current vibrator."); - } - } - } - /// - /// Dispose API for closing the internal resources. - /// This function can be used to stop all the effects started by Vibrate(). - /// - /// 3 - public void Dispose() - { - Dispose(true); - GC.SuppressFinalize(this); - } - - protected virtual void Dispose(bool disposing) - { - if (!_disposedValue) - { - if (_hapticHandle != IntPtr.Zero) - { - Interop.Device.DeviceHapticClose(_hapticHandle); - _hapticHandle = IntPtr.Zero; - } - _disposedValue = true; - } - } - } -} diff --git a/src/Tizen.System/Device/IR.cs b/src/Tizen.System/Device/IR.cs deleted file mode 100644 index 5a41b099f..000000000 --- a/src/Tizen.System/Device/IR.cs +++ /dev/null @@ -1,89 +0,0 @@ -/* -* 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.Collections.Generic; -using System.Linq; - -namespace Tizen.System -{ - /// - /// The IR API provides the functions to control the IR transmitter. - /// The IR API provides the way to get the information if IR is available and then transmit the IR command. - /// - /// - /// http://tizen.org/privilege/use_ir - /// - /// - /// Console.WriteLine("IR availability for this device is: {0}", IR.IsAvailable); - /// - public static class IR - { - /// - /// Gets the information whether the IR module is available. - /// - /// 3 - public static bool IsAvailable - { - get - { - bool available = false; - DeviceError res = (DeviceError)Interop.Device.DeviceIRIsAvailable(out available); - if (res != DeviceError.None) - { - Log.Warn(DeviceExceptionFactory.LogTag, "unable to get ir status."); - } - return available; - } - } - - /// - /// Transmits the IR command. - /// - /// 3 - /// - /// The carrier frequency to transmit the IR command (Hertz). - /// - /// - /// The IR command list of type integer. - /// - /// When an invalid parameter value is set. - /// If the privilege is not set. - /// In case of any system error. - /// In case the device does not support this behavior. - /// - /// try - /// { - /// List pattern = new List(); - /// pattern.Add(10); - /// pattern.Add(50); - /// IR.Transmit(60657, pattern); - /// } - /// catch(Exception e) - /// { - /// } - /// - public static void Transmit(int carrierFreequency, IList pattern) - { - int[] patternArray = pattern.ToArray(); - DeviceError res = (DeviceError)Interop.Device.DeviceIRTransmit(carrierFreequency, patternArray, pattern.Count()); - if (res != DeviceError.None) - { - throw DeviceExceptionFactory.CreateException(res, "unable to trasmit IR command."); - } - } - } -} diff --git a/src/Tizen.System/Device/Led.cs b/src/Tizen.System/Device/Led.cs deleted file mode 100644 index 7d00ca81f..000000000 --- a/src/Tizen.System/Device/Led.cs +++ /dev/null @@ -1,218 +0,0 @@ -/* -* 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.Common; - -namespace Tizen.System -{ - /// - /// The LED class provides the properties and methods to control the attached LED device. - /// - /// - /// The LED API provides the way to control the attached LED device, such as the camera flash and service LED. It supports to turn on the camera flash and set the pattern to the service LED which is located at the front of the device. - /// Related features: - /// http://tizen.org/feature/led - /// http://tizen.org/feature/camera.back.flash - /// It is recommended to design the feature related codes in your application for reliability. - /// You can check if a device supports the related features for this API by using system information, thereby controlling the procedure of your application. - /// - /// - /// 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 - { - /// - /// Gets the maximum brightness value of the LED that is located next to the camera. - /// 3 - /// When an invalid parameter value is set. - /// If the privilege is not set. - /// In case the device does not support this behavior. - /// - public static int MaxBrightness - { - get - { - int max = 0; - DeviceError res = (DeviceError)Interop.Device.DeviceFlashGetMaxBrightness(out max); - if (res != DeviceError.None) - { - Log.Warn(DeviceExceptionFactory.LogTag, "unable to get max brightness value."); - } - return max; - } - } - - private static readonly object s_lock = new object(); - - /// - /// Gets the brightness value of the LED that is located next to the camera. - /// - /// The brightness value range of the LED is 0 to Tizen.System.Led.MaxBrightness value. - /// Changing the brightness value will invoke the registered EventHandler for the LED BrightnessChanged (if any). - /// - /// 3 - /// 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 - { - get - { - int brightness = 0; - DeviceError res = (DeviceError)Interop.Device.DeviceFlashGetBrightness(out brightness); - if (res != DeviceError.None) - { - Log.Warn(DeviceExceptionFactory.LogTag, "unable to get brightness value."); - } - return brightness; - } - set - { - DeviceError res = (DeviceError) Interop.Device.DeviceFlashSetBrightness(value); - if (res != DeviceError.None) - { - throw DeviceExceptionFactory.CreateException(res, "unable to set brightness value"); - } - } - } - - /// - /// Plays the LED that is located at the front of the device. - /// - /// 3 - /// Turn on time in milliseconds. - /// Turn off time in milliseconds. - /// - /// The Color value - /// The first byte means opaque and the other 3 bytes are the RGB values. - /// - /// When an invalid parameter value is set. - /// If the privilege is not set. - /// In case of any system error. - /// In case the device does not support this behavior. - /// - /// try - /// { - /// Led.Play(500, 200, Color.FromRgba(255, 255, 255, 1)); - /// } - /// Catch(Exception e) - /// { - /// } - /// - public static void Play(int on, int off, Color color) - { - //looks like only blink option is supported. So hard coded to default blink option. - DeviceError res = (DeviceError)Interop.Device.DeviceLedPlayCustom(on, off, Convert.ToUInt32(color.GetArgb()), 1); - if (res != DeviceError.None) - { - throw DeviceExceptionFactory.CreateException(res, "failed to play Led."); - } - } - - /// - /// Stops the LED that is located at the front of the device. - /// - /// 3 - /// If the privilege is not set. - /// In case of any system error. - /// In case the device does not support this behavior. - /// - /// try - /// { - /// Led.Play(500, 200, Color.FromRgba(255, 255, 255, 1)); - /// //wait for a while and stop... - /// Led.Stop(); - /// } - /// Catch(Exception e) - /// { - /// } - /// - - public static void Stop() - { - DeviceError res = (DeviceError)Interop.Device.DeviceLedStopCustom(); - if (res != DeviceError.None) - { - throw DeviceExceptionFactory.CreateException(res, "failed to stop Led."); - } - } - - - private static EventHandler s_brightnessChanged; - /// - /// StateChanged is raised when the LED state is changed. - /// - /// 3 - public static event EventHandler BrightnessChanged - { - add - { - lock (s_lock) - { - if (s_brightnessChanged == null) - { - EventListenerStart(); - } - s_brightnessChanged += value; - } - } - remove - { - lock (s_lock) - { - s_brightnessChanged -= value; - if (s_brightnessChanged == null) - { - EventListenerStop(); - } - } - } - } - - private static Interop.Device.deviceCallback s_handler; - private static void EventListenerStart() - { - s_handler = (int type, IntPtr value, IntPtr data) => - { - int val = value.ToInt32(); - LedBrightnessChangedEventArgs e = new LedBrightnessChangedEventArgs() - { - Brightness = val - }; - s_brightnessChanged?.Invoke(null, e); - return true; - }; - Interop.Device.DeviceAddCallback(EventType.FlashBrightness, s_handler, IntPtr.Zero); - } - - private static void EventListenerStop() - { - Interop.Device.DeviceRemoveCallback(EventType.FlashBrightness, s_handler); - } - } -} diff --git a/src/Tizen.System/Device/Power.cs b/src/Tizen.System/Device/Power.cs deleted file mode 100644 index bc0c58997..000000000 --- a/src/Tizen.System/Device/Power.cs +++ /dev/null @@ -1,78 +0,0 @@ -/* -* 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.System -{ - /// - /// The Power class provides methods to control the power service. - /// - /// - /// The Power API provides the way to control the power service. - /// It can be made to hold the specific state to avoid the CPU state internally. - /// - /// - /// http://tizen.org/privilege/display - /// - public static class Power - { - /// - /// Locks the CPU for a specified time. - /// After the given timeout (in milliseconds), unlock the given lock state automatically. - /// - /// - /// If the process dies, then every lock will be removed. - /// - /// 3 - /// - /// The positive number in milliseconds or 0 for the permanent lock. - /// So you must release the permanent lock of the power state with ReleaseCpuLock() if timeout_ms is zero. - /// - /// 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) - { - DeviceError res = (DeviceError)Interop.Device.DevicePowerRequestLock(0, timeout); - if (res != DeviceError.None) - { - throw DeviceExceptionFactory.CreateException(res, "unable to acquire power lock."); - } - } - /// - /// Releases the CPU lock state. - /// - /// 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); - if (res != DeviceError.None) - { - throw DeviceExceptionFactory.CreateException(res, "unable to release power lock."); - } - } - } -} diff --git a/src/Tizen.System/Interop/Interop.Device.cs b/src/Tizen.System/Interop/Interop.Device.cs deleted file mode 100644 index 3862edd10..000000000 --- a/src/Tizen.System/Interop/Interop.Device.cs +++ /dev/null @@ -1,101 +0,0 @@ -/* -* 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; - -namespace Tizen.System -{ - internal enum EventType - { - BatteryPercent, - BatteryLevel, - BatteryCharging, - DisplayState, - FlashBrightness - } -} -internal static partial class Interop -{ - internal static partial class Device - { - // Battery - [DllImport(Libraries.Device, EntryPoint = "device_battery_get_percent", CallingConvention = CallingConvention.Cdecl)] - public static extern int DeviceBatteryGetPercent(out int percent); - [DllImport(Libraries.Device, EntryPoint = "device_battery_is_charging", CallingConvention = CallingConvention.Cdecl)] - public static extern int DeviceBatteryIsCharging(out bool charging); - [DllImport(Libraries.Device, EntryPoint = "device_battery_get_level_status", CallingConvention = CallingConvention.Cdecl)] - public static extern int DeviceBatteryGetLevelStatus(out int status); - - // Display - [DllImport(Libraries.Device, EntryPoint = "device_display_get_numbers", CallingConvention = CallingConvention.Cdecl)] - public static extern int DeviceDisplayGetNumbers(out int device_number); - [DllImport(Libraries.Device, EntryPoint = "device_display_get_max_brightness", CallingConvention = CallingConvention.Cdecl)] - public static extern int DeviceDisplayGetMaxBrightness(int index, out int max_brightness); - [DllImport(Libraries.Device, EntryPoint = "device_display_get_brightness", CallingConvention = CallingConvention.Cdecl)] - public static extern int DeviceDisplayGetBrightness(int index, out int status); - [DllImport(Libraries.Device, EntryPoint = "device_display_set_brightness", CallingConvention = CallingConvention.Cdecl)] - public static extern int DeviceDisplaySetBrightness(int index, int brightness); - [DllImport(Libraries.Device, EntryPoint = "device_display_get_state", CallingConvention = CallingConvention.Cdecl)] - public static extern int DeviceDisplayGetState(out int state); - [DllImport(Libraries.Device, EntryPoint = "device_display_change_state", CallingConvention = CallingConvention.Cdecl)] - public static extern int DeviceDisplayChangeState(int state); - - // Haptic - [DllImport(Libraries.Device, EntryPoint = "device_haptic_get_count", CallingConvention = CallingConvention.Cdecl)] - internal static extern int DeviceHapticGetCount(out int device_number); - [DllImport(Libraries.Device, EntryPoint = "device_haptic_open", CallingConvention = CallingConvention.Cdecl)] - internal static extern int DeviceHapticOpen(int index, out IntPtr handle); - [DllImport(Libraries.Device, EntryPoint = "device_haptic_close", CallingConvention = CallingConvention.Cdecl)] - internal static extern int DeviceHapticClose(IntPtr handle); - [DllImport(Libraries.Device, EntryPoint = "device_haptic_vibrate", CallingConvention = CallingConvention.Cdecl)] - internal static extern int DeviceHapticVibrate(IntPtr handle, int duration, int feedback, out IntPtr effect); - [DllImport(Libraries.Device, EntryPoint = "device_haptic_stop", CallingConvention = CallingConvention.Cdecl)] - internal static extern int DeviceHapticStop(IntPtr handle, IntPtr effect); - - // Led - [DllImport(Libraries.Device, EntryPoint = "device_flash_get_max_brightness", CallingConvention = CallingConvention.Cdecl)] - internal static extern int DeviceFlashGetMaxBrightness(out int max_brightness); - [DllImport(Libraries.Device, EntryPoint = "device_flash_get_brightness", CallingConvention = CallingConvention.Cdecl)] - internal static extern int DeviceFlashGetBrightness(out int brightness); - [DllImport(Libraries.Device, EntryPoint = "device_flash_set_brightness", CallingConvention = CallingConvention.Cdecl)] - internal static extern int DeviceFlashSetBrightness(int brightness); - [DllImport(Libraries.Device, EntryPoint = "device_led_play_custom", CallingConvention = CallingConvention.Cdecl)] - internal static extern int DeviceLedPlayCustom(int on, int off, uint color, uint flags); - [DllImport(Libraries.Device, EntryPoint = "device_led_stop_custom", CallingConvention = CallingConvention.Cdecl)] - internal static extern int DeviceLedStopCustom(); - - // Power - [DllImport(Libraries.Device, EntryPoint = "device_power_request_lock", CallingConvention = CallingConvention.Cdecl)] - internal static extern int DevicePowerRequestLock(int type, int timeout_ms); - [DllImport(Libraries.Device, EntryPoint = "device_power_release_lock", CallingConvention = CallingConvention.Cdecl)] - internal static extern int DevicePowerReleaseLock(int type); - - //IR - [DllImport(Libraries.Device, EntryPoint = "device_ir_is_available", CallingConvention = CallingConvention.Cdecl)] - internal static extern int DeviceIRIsAvailable(out bool available); - [DllImport(Libraries.Device, EntryPoint = "device_ir_transmit", CallingConvention = CallingConvention.Cdecl)] - internal static extern int DeviceIRTransmit(int carrierFreequency, int[] pattern, int size); - - // Callback - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool deviceCallback(int type, IntPtr value, IntPtr data); - [DllImport(Libraries.Device, EntryPoint = "device_add_callback", CallingConvention = CallingConvention.Cdecl)] - internal static extern int DeviceAddCallback(Tizen.System.EventType type, deviceCallback cb, IntPtr data); - [DllImport(Libraries.Device, EntryPoint = "device_remove_callback", CallingConvention = CallingConvention.Cdecl)] - internal static extern int DeviceRemoveCallback(Tizen.System.EventType type, deviceCallback cb); - } -} diff --git a/src/Tizen.System/Interop/Interop.Libraries.cs b/src/Tizen.System/Interop/Interop.Libraries.cs deleted file mode 100644 index a2252c4e3..000000000 --- a/src/Tizen.System/Interop/Interop.Libraries.cs +++ /dev/null @@ -1,23 +0,0 @@ -/* -* 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 - { - internal const string Device = "libcapi-system-device.so.0"; - } -} diff --git a/src/Tizen.System/Tizen.System.csproj b/src/Tizen.System/Tizen.System.csproj deleted file mode 100644 index 4c51c4197..000000000 --- a/src/Tizen.System/Tizen.System.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - netstandard2.0 - - - - - - - - \ No newline at end of file diff --git a/src/Tizen.System/Tizen.System.sln b/src/Tizen.System/Tizen.System.sln deleted file mode 100755 index 1d2c3d557..000000000 --- a/src/Tizen.System/Tizen.System.sln +++ /dev/null @@ -1,34 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26430.12 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.System", "Tizen.System.csproj", "{C746BBD5-97D6-476F-BD3D-7B3A1AAA06DE}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen", "..\Tizen\Tizen.csproj", "{F919D01F-1707-4D81-9C57-8E09CE48804C}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Log", "..\Tizen.Log\Tizen.Log.csproj", "{2992FC24-7B41-4765-8A9C-559CCB922A99}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {C746BBD5-97D6-476F-BD3D-7B3A1AAA06DE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {C746BBD5-97D6-476F-BD3D-7B3A1AAA06DE}.Debug|Any CPU.Build.0 = Debug|Any CPU - {C746BBD5-97D6-476F-BD3D-7B3A1AAA06DE}.Release|Any CPU.ActiveCfg = Release|Any CPU - {C746BBD5-97D6-476F-BD3D-7B3A1AAA06DE}.Release|Any CPU.Build.0 = Release|Any CPU - {F919D01F-1707-4D81-9C57-8E09CE48804C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F919D01F-1707-4D81-9C57-8E09CE48804C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F919D01F-1707-4D81-9C57-8E09CE48804C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F919D01F-1707-4D81-9C57-8E09CE48804C}.Release|Any CPU.Build.0 = Release|Any CPU - {2992FC24-7B41-4765-8A9C-559CCB922A99}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {2992FC24-7B41-4765-8A9C-559CCB922A99}.Debug|Any CPU.Build.0 = Debug|Any CPU - {2992FC24-7B41-4765-8A9C-559CCB922A99}.Release|Any CPU.ActiveCfg = Release|Any CPU - {2992FC24-7B41-4765-8A9C-559CCB922A99}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/src/Tizen.Tapi/Interop/Interop.Libraries.cs b/src/Tizen.Tapi/Interop/Interop.Libraries.cs deleted file mode 100755 index 242a922b7..000000000 --- a/src/Tizen.Tapi/Interop/Interop.Libraries.cs +++ /dev/null @@ -1,25 +0,0 @@ -/* - * 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 Tapi = "libSLP-tapi.so.0"; - public const string Glib = "libglib-2.0.so.0"; - public const string Libc = "libc.so.6"; - } -} diff --git a/src/Tizen.Tapi/Interop/Interop.Tapi.cs b/src/Tizen.Tapi/Interop/Interop.Tapi.cs deleted file mode 100755 index 9881c986f..000000000 --- a/src/Tizen.Tapi/Interop/Interop.Tapi.cs +++ /dev/null @@ -1,371 +0,0 @@ -/* - * 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; -using Tizen.Tapi; - -/// -/// Interop class for Tapi -/// -internal static partial class Interop -{ - /// - /// Tapi Native Apis - /// - internal static partial class Tapi - { - //Callback for event - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void TapiNotificationCallback(IntPtr handle, IntPtr id, IntPtr data, IntPtr userData); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void TapiResponseCallback(IntPtr handle, int result, IntPtr data, IntPtr userData); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void TapiStateCallback(int state, IntPtr userData); - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void CallStatusCallback(ref CallStatusStruct info, IntPtr userData); - - //Tapi-common - [DllImport(Libraries.Tapi, EntryPoint = "tel_get_cp_name_list")] - internal static extern IntPtr GetCpNames(); - [DllImport(Libraries.Tapi, EntryPoint = "tel_init")] - internal static extern IntPtr InitTapi(string cpName); - [DllImport(Libraries.Tapi, EntryPoint = "tel_deinit")] - internal static extern int DeinitTapi(IntPtr handle); - [DllImport(Libraries.Tapi, EntryPoint = "tel_register_noti_event")] - internal static extern int RegisterNotiEvent(IntPtr handle, string notificationId, TapiNotificationCallback cb, IntPtr userData); - [DllImport(Libraries.Tapi, EntryPoint = "tel_deregister_noti_event")] - internal static extern int DeregisterNotiEvent(IntPtr handle, string notificationId); - [DllImport(Libraries.Tapi, EntryPoint = "tel_get_property_int")] - internal static extern int GetIntProperty(IntPtr handle, string property, out int result); - [DllImport(Libraries.Tapi, EntryPoint = "tel_get_property_string")] - internal static extern int GetStringProperty(IntPtr handle, string property, out string result); - [DllImport(Libraries.Tapi, EntryPoint = "tel_get_ready_state")] - internal static extern int GetReadyState(out int state); - [DllImport(Libraries.Tapi, EntryPoint = "tel_register_ready_state_cb")] - internal static extern int RegisterReadyStateCb(TapiStateCallback cb, IntPtr userData); - [DllImport(Libraries.Tapi, EntryPoint = "tel_deregister_ready_state_cb")] - internal static extern int DeregisterReadyStateCb(TapiStateCallback cb); - - //Phonebook - internal static class Phonebook - { - [DllImport(Libraries.Tapi, EntryPoint = "tel_get_sim_pb_init_info")] - internal static extern int GetPhonebookInitInfo(IntPtr handle, out int initCompleted, out SimPhonebookListStruct pbList); - [DllImport(Libraries.Tapi, EntryPoint = "tel_get_sim_pb_count")] - internal static extern int GetPhonebookStorage(IntPtr handle, PhonebookType pbType, TapiResponseCallback cb, IntPtr userData); - [DllImport(Libraries.Tapi, EntryPoint = "tel_get_sim_pb_meta_info")] - internal static extern int GetPhonebookMetaInfo(IntPtr handle, PhonebookType pbType, TapiResponseCallback cb, IntPtr userData); - [DllImport(Libraries.Tapi, EntryPoint = "tel_get_sim_pb_usim_meta_info")] - internal static extern int GetPhonebookMetaInfo3G(IntPtr handle, TapiResponseCallback cb, IntPtr userData); - [DllImport(Libraries.Tapi, EntryPoint = "tel_read_sim_pb_record")] - internal static extern int ReadPhonebookRecord(IntPtr handle, PhonebookType pbType, ushort pbIndex, TapiResponseCallback cb, IntPtr userData); - [DllImport(Libraries.Tapi, EntryPoint = "tel_update_sim_pb_record")] - internal static extern int UpdatePhonebookRecord(IntPtr handle, ref PhonebookRecordStruct data, TapiResponseCallback cb, IntPtr userData); - [DllImport(Libraries.Tapi, EntryPoint = "tel_delete_sim_pb_record")] - internal static extern int DeletePhonebookRecord(IntPtr handle, PhonebookType pbType, ushort pbIndex, TapiResponseCallback cb, IntPtr userData); - } - - //Sat - internal static class Sat - { - [DllImport(Libraries.Tapi, EntryPoint = "tel_select_sat_menu")] - internal static extern int SatSendSelectMenu(IntPtr handle, ref SatMenuSelectionInfoStruct info, TapiResponseCallback cb, IntPtr userData); - [DllImport(Libraries.Tapi, EntryPoint = "tel_download_sat_event")] - internal static extern int SatDownloadEvent(IntPtr handle, ref SatEventDownloadInfoStruct info, TapiResponseCallback cb, IntPtr userData); - [DllImport(Libraries.Tapi, EntryPoint = "tel_send_sat_ui_display_status")] - internal static extern int SatSendUiDisplayStatus(IntPtr handle, int commandId, SatUiDisplayStatus status); - [DllImport(Libraries.Tapi, EntryPoint = "tel_send_sat_ui_user_confirm")] - internal static extern int SatSendUiUserConfim(IntPtr handle, ref SatUiUserConfirmInfoStruct confirmInfo); - [DllImport(Libraries.Tapi, EntryPoint = "tel_get_sat_main_menu_info")] - internal static extern int SatGetMainMenuInfo(IntPtr handle, out SatMainMenuInfoStruct mainMenuInfo); - [DllImport(Libraries.Tapi, EntryPoint = "tel_send_sat_app_exec_result")] - internal static extern int SatExecutionResult(IntPtr handle, out SatResultDataStruct resultData); - } - - //Sim - internal static class Sim - { - [DllImport(Libraries.Tapi, EntryPoint = "tel_get_sim_init_info")] - internal static extern int SimGetInitInfo(IntPtr handle, out SimCardStatus status, out int cardChanged); - [DllImport(Libraries.Tapi, EntryPoint = "tel_get_sim_type")] - internal static extern int SimGetType(IntPtr handle, out SimCardType type); - [DllImport(Libraries.Tapi, EntryPoint = "tel_get_sim_imsi")] - internal static extern int SimGetImsi(IntPtr handle, out SimImsiInfoStruct imsiInfo); - [DllImport(Libraries.Tapi, EntryPoint = "tel_get_sim_ecc")] - internal static extern int SimGetEcc(IntPtr handle, out SimEccInfoListStruct eccInfo); - [DllImport(Libraries.Tapi, EntryPoint = "tel_get_sim_iccid")] - internal static extern int SimGetIccId(IntPtr handle, TapiResponseCallback cb, IntPtr userData); - [DllImport(Libraries.Tapi, EntryPoint = "tel_get_sim_language")] - internal static extern int SimGetLanguage(IntPtr handle, TapiResponseCallback cb, IntPtr userData); - [DllImport(Libraries.Tapi, EntryPoint = "tel_set_sim_language")] - internal static extern int SimSetLanguage(IntPtr handle, SimLanguagePreference language, TapiResponseCallback cb, IntPtr userData); - [DllImport(Libraries.Tapi, EntryPoint = "tel_get_sim_callforwarding_info")] - internal static extern int SimGetCallForwardingInfo(IntPtr handle, TapiResponseCallback cb, IntPtr userData); - [DllImport(Libraries.Tapi, EntryPoint = "tel_set_sim_callforwarding_info")] - internal static extern int SimSetCallForwardingInfo(IntPtr handle, ref SimCallForwardRequestStruct request, TapiResponseCallback cb, IntPtr userData); - [DllImport(Libraries.Tapi, EntryPoint = "tel_get_sim_messagewaiting_info")] - internal static extern int SimGetMessageWaitingInfo(IntPtr handle, TapiResponseCallback cb, IntPtr userData); - [DllImport(Libraries.Tapi, EntryPoint = "tel_set_sim_messagewaiting_info")] - internal static extern int SimSetMessageWaitingInfo(IntPtr handle, ref SimMessageWaitingRequestStruct request, TapiResponseCallback cb, IntPtr userData); - [DllImport(Libraries.Tapi, EntryPoint = "tel_get_sim_mailbox_info")] - internal static extern int SimGetMailboxInfo(IntPtr handle, TapiResponseCallback cb, IntPtr userData); - [DllImport(Libraries.Tapi, EntryPoint = "tel_set_sim_mailbox_info")] - internal static extern int SimSetMailboxInfo(IntPtr handle, ref SimMailboxNumberStruct mailbox, TapiResponseCallback cb, IntPtr userData); - [DllImport(Libraries.Tapi, EntryPoint = "tel_get_sim_cphs_info")] - internal static extern int SimGetCphsInfo(IntPtr handle, TapiResponseCallback cb, IntPtr userData); - [DllImport(Libraries.Tapi, EntryPoint = "tel_get_sim_service_table")] - internal static extern int SimGetServiceTable(IntPtr handle, TapiResponseCallback cb, IntPtr userData); - [DllImport(Libraries.Tapi, EntryPoint = "tel_get_sim_msisdn")] - internal static extern int SimGetMsisdn(IntPtr handle, TapiResponseCallback cb, IntPtr userData); - [DllImport(Libraries.Tapi, EntryPoint = "tel_get_sim_oplmnwact")] - internal static extern int SimGetOplmnwact(IntPtr handle, TapiResponseCallback cb, IntPtr userData); - [DllImport(Libraries.Tapi, EntryPoint = "tel_get_sim_spn")] - internal static extern int SimGetSpn(IntPtr handle, TapiResponseCallback cb, IntPtr userData); - [DllImport(Libraries.Tapi, EntryPoint = "tel_get_sim_cphs_netname")] - internal static extern int SimGetCphsNetName(IntPtr handle, TapiResponseCallback cb, IntPtr userData); - [DllImport(Libraries.Tapi, EntryPoint = "tel_req_sim_authentication")] - internal static extern int SimExecuteAuthentication(IntPtr handle, ref SimAuthenticationDataStruct authenticationData, TapiResponseCallback cb, IntPtr userData); - [DllImport(Libraries.Tapi, EntryPoint = "tel_verifiy_sim_pins")] - internal static extern int SimVerifyPins(IntPtr handle, ref SimPinDataStruct pinData, TapiResponseCallback cb, IntPtr userData); - [DllImport(Libraries.Tapi, EntryPoint = "tel_verify_sim_puks")] - internal static extern int SimVerifyPuks(IntPtr handle, ref SimPinDataStruct pukData, ref SimPinDataStruct newPinData, TapiResponseCallback cb, IntPtr userData); - [DllImport(Libraries.Tapi, EntryPoint = "tel_change_sim_pins")] - internal static extern int SimChangePins(IntPtr handle, ref SimPinDataStruct oldPin, ref SimPinDataStruct newPin, TapiResponseCallback cb, IntPtr userData); - [DllImport(Libraries.Tapi, EntryPoint = "tel_disable_sim_facility")] - internal static extern int SimDisableFacility(IntPtr handle, ref SimFacilityStruct facility, TapiResponseCallback cb, IntPtr userData); - [DllImport(Libraries.Tapi, EntryPoint = "tel_enable_sim_facility")] - internal static extern int SimEnableFacility(IntPtr handle, ref SimFacilityStruct facility, TapiResponseCallback cb, IntPtr userData); - [DllImport(Libraries.Tapi, EntryPoint = "tel_get_sim_facility")] - internal static extern int SimGetFacility(IntPtr handle, SimLockType lockType, TapiResponseCallback cb, IntPtr userData); - [DllImport(Libraries.Tapi, EntryPoint = "tel_get_sim_lock_info")] - internal static extern int SimGetLockInfo(IntPtr handle, SimLockType lockType, TapiResponseCallback cb, IntPtr userData); - [DllImport(Libraries.Tapi, EntryPoint = "tel_set_sim_power_state")] - internal static extern int SimSetPowerState(IntPtr handle, SimPowerState state, TapiResponseCallback cb, IntPtr userData); - [DllImport(Libraries.Tapi, EntryPoint = "tel_req_sim_apdu")] - internal static extern int SimRequestApdu(IntPtr handle, ref SimApduStruct apdu, TapiResponseCallback cb, IntPtr userData); - [DllImport(Libraries.Tapi, EntryPoint = "tel_req_sim_atr")] - internal static extern int SimRequestAtr(IntPtr handle, TapiResponseCallback cb, IntPtr userData); - [DllImport(Libraries.Tapi, EntryPoint = "tel_get_sim_application_list")] - internal static extern int SimGetApplicationList(IntPtr handle, out byte appList); - [DllImport(Libraries.Tapi, EntryPoint = "tel_get_sim_impi")] - internal static extern int SimGetImpi(IntPtr handle, TapiResponseCallback cb, IntPtr userData); - [DllImport(Libraries.Tapi, EntryPoint = "tel_get_sim_impu")] - internal static extern int SimGetImpu(IntPtr handle, TapiResponseCallback cb, IntPtr userData); - [DllImport(Libraries.Tapi, EntryPoint = "tel_get_sim_domain")] - internal static extern int SimGetDomain(IntPtr handle, TapiResponseCallback cb, IntPtr userData); - [DllImport(Libraries.Tapi, EntryPoint = "tel_get_sim_pcscf")] - internal static extern int SimGetPcscf(IntPtr handle, TapiResponseCallback cb, IntPtr userData); - [DllImport(Libraries.Tapi, EntryPoint = "tel_get_sim_isim_service_table")] - internal static extern int SimGetIsimServiceTable(IntPtr handle, TapiResponseCallback cb, IntPtr userData); - - } - - //Ss - internal static class Ss - { - [DllImport(Libraries.Tapi, EntryPoint = "tel_set_ss_barring")] - internal static extern int SsSetBarring(IntPtr handle, ref SsBarringInfoStruct info, TapiResponseCallback cb, IntPtr userData); - [DllImport(Libraries.Tapi, EntryPoint = "tel_get_ss_barring_status")] - internal static extern int SsGetBarringStatus(IntPtr handle, SsClass ssClass, SsBarringType type, TapiResponseCallback cb, IntPtr userData); - [DllImport(Libraries.Tapi, EntryPoint = "tel_change_ss_barring_password")] - internal static extern int SsChangeBarringPassword(IntPtr handle, string oldPassword, string newPassword, string newPasswordAgain, TapiResponseCallback cb, IntPtr userData); - [DllImport(Libraries.Tapi, EntryPoint = "tel_set_ss_forward")] - internal static extern int SsSetForward(IntPtr handle, ref SsForwardInfoStruct info, TapiResponseCallback cb, IntPtr userData); - [DllImport(Libraries.Tapi, EntryPoint = "tel_get_ss_forward_status")] - internal static extern int SsGetForwardStatus(IntPtr handle, SsClass ssClass, SsForwardCondition condition, TapiResponseCallback cb, IntPtr userData); - [DllImport(Libraries.Tapi, EntryPoint = "tel_set_ss_waiting")] - internal static extern int SsSetWaiting(IntPtr handle, ref SsWaitingInfoStruct info, TapiResponseCallback cb, IntPtr userData); - [DllImport(Libraries.Tapi, EntryPoint = "tel_get_ss_waiting_status")] - internal static extern int SsGetWaitingStatus(IntPtr handle, SsClass ssClass, TapiResponseCallback cb, IntPtr userData); - [DllImport(Libraries.Tapi, EntryPoint = "tel_set_ss_cli_status")] - internal static extern int SsSetCliStatus(IntPtr handle, SsCliType type, SsCliStatus status, TapiResponseCallback cb, IntPtr userData); - [DllImport(Libraries.Tapi, EntryPoint = "tel_get_ss_cli_status")] - internal static extern int SsGetCliStatus(IntPtr handle, SsCliType type, TapiResponseCallback cb, IntPtr userData); - [DllImport(Libraries.Tapi, EntryPoint = "tel_send_ss_ussd_request")] - internal static extern int SsSendUssdRequest(IntPtr handle, ref SsUssdMsgInfoStruct info, TapiResponseCallback cb, IntPtr userData); - } - - //Call - internal static class Call - { - [DllImport(Libraries.Tapi, EntryPoint = "tel_dial_call")] - internal static extern int DialCall(IntPtr handle, ref CallInformationStruct info, TapiResponseCallback cb, IntPtr userData); - [DllImport(Libraries.Tapi, EntryPoint = "tel_answer_call")] - internal static extern int AnswerCall(IntPtr handle, uint callHandle, CallAnswerType type, TapiResponseCallback cb, IntPtr userData); - [DllImport(Libraries.Tapi, EntryPoint = "tel_end_call")] - internal static extern int EndCall(IntPtr handle, uint callHandle, CallEndType type, TapiResponseCallback cb, IntPtr userData); - [DllImport(Libraries.Tapi, EntryPoint = "tel_hold_call")] - internal static extern int HoldCall(IntPtr handle, uint callHandle, TapiResponseCallback cb, IntPtr userData); - [DllImport(Libraries.Tapi, EntryPoint = "tel_active_call")] - internal static extern int ActiveCall(IntPtr handle, uint callHandle, TapiResponseCallback cb, IntPtr userData); - [DllImport(Libraries.Tapi, EntryPoint = "tel_swap_call")] - internal static extern int SwapCall(IntPtr handle, uint callHandle1, uint callHandle2, TapiResponseCallback cb, IntPtr userData); - [DllImport(Libraries.Tapi, EntryPoint = "tel_start_call_cont_dtmf")] - internal static extern int StartContDtmfCall(IntPtr handle, byte dtmfDigit, TapiResponseCallback cb, IntPtr userData); - [DllImport(Libraries.Tapi, EntryPoint = "tel_stop_call_cont_dtmf")] - internal static extern int StopContDtmfCall(IntPtr handle, TapiResponseCallback cb, IntPtr userData); - [DllImport(Libraries.Tapi, EntryPoint = "tel_send_call_burst_dtmf")] - internal static extern int SendBurstDtmfCall(IntPtr handle, ref CallBurstDtmfStruct info, TapiResponseCallback cb, IntPtr userData); - [DllImport(Libraries.Tapi, EntryPoint = "tel_join_call")] - internal static extern int JoinCall(IntPtr handle, uint callHandle1, uint callHandle2, TapiResponseCallback cb, IntPtr userData); - [DllImport(Libraries.Tapi, EntryPoint = "tel_split_call")] - internal static extern int SplitCall(IntPtr handle, uint callHandle, TapiResponseCallback cb, IntPtr userData); - [DllImport(Libraries.Tapi, EntryPoint = "tel_transfer_call")] - internal static extern int TransferCall(IntPtr handle, uint callHandle, TapiResponseCallback cb, IntPtr userData); - [DllImport(Libraries.Tapi, EntryPoint = "tel_get_call_status")] - internal static extern int GetCallStatus(IntPtr handle, int callId, out CallStatusStruct statusInfo); - [DllImport(Libraries.Tapi, EntryPoint = "tel_get_call_status_all")] - internal static extern int GetAllCallStatus(IntPtr handle, CallStatusCallback cb, IntPtr userData); - [DllImport(Libraries.Tapi, EntryPoint = "tel_deflect_call")] - internal static extern int DeflectCall(IntPtr handle, uint callHandle, ref CallDeflectDestStruct info, TapiResponseCallback cb, IntPtr userData); - [DllImport(Libraries.Tapi, EntryPoint = "tel_get_call_volume_info")] - internal static extern int GetCallVolumeInfo(IntPtr handle, SoundDevice device, SoundType type, TapiResponseCallback cb, IntPtr userData); - [DllImport(Libraries.Tapi, EntryPoint = "tel_set_call_volume_info")] - internal static extern int SetCallVolumeInfo(IntPtr handle, ref CallVolumeRecordStruct info, TapiResponseCallback cb, IntPtr userData); - [DllImport(Libraries.Tapi, EntryPoint = "tel_set_call_sound_path")] - internal static extern int SetCallSoundPath(IntPtr handle, ref CallSoundPathStruct path, TapiResponseCallback cb, IntPtr userData); - [DllImport(Libraries.Tapi, EntryPoint = "tel_set_call_mute_status")] - internal static extern int SetCallMuteStatus(IntPtr handle, SoundMuteStatus status, SoundMutePath path, TapiResponseCallback cb, IntPtr userData); - [DllImport(Libraries.Tapi, EntryPoint = "tel_get_call_mute_status")] - internal static extern int GetCallMuteStatus(IntPtr handle, TapiResponseCallback cb, IntPtr userData); - [DllImport(Libraries.Tapi, EntryPoint = "tel_get_call_privacy_mode")] - internal static extern int GetCallPrivacyMode(IntPtr handle, TapiResponseCallback cb, IntPtr userData); - [DllImport(Libraries.Tapi, EntryPoint = "tel_set_call_privacy_mode")] - internal static extern int SetCallPrivacyMode(IntPtr handle, CallPrivacyMode mode, TapiResponseCallback cb, IntPtr userData); - [DllImport(Libraries.Tapi, EntryPoint = "tel_set_call_preferred_voice_subscription")] - internal static extern int SetCallPreferredVoiceSubs(IntPtr handle, CallPreferredVoiceSubscription subscription, TapiResponseCallback cb, IntPtr userData); - [DllImport(Libraries.Tapi, EntryPoint = "tel_get_call_preferred_voice_subscription")] - internal static extern int GetCallPreferredVoiceSubs(IntPtr handle, out CallPreferredVoiceSubscription subscription); - } - - //Oem - internal static class Oem - { - [DllImport(Libraries.Tapi, EntryPoint = "tel_send_oem_data")] - internal static extern int SendOemData(IntPtr handle, int id, IntPtr data, uint length); - [DllImport(Libraries.Tapi, EntryPoint = "tel_send_oem_data_sync")] - internal static extern int SendOemDataSync(IntPtr handle, int id, IntPtr data, uint length, out OemDataStruct info); - [DllImport(Libraries.Tapi, EntryPoint = "tel_send_oem_data_async")] - internal static extern int SendOemDataAsync(IntPtr handle, int id, IntPtr data, uint length, TapiResponseCallback cb, IntPtr userData); - } - - //Modem - internal static class Modem - { - [DllImport(Libraries.Tapi, EntryPoint = "tel_process_power_command")] - internal static extern int ProcessPowerCommand(IntPtr handle, PhonePowerCommand cmd, TapiResponseCallback cb, IntPtr userData); - [DllImport(Libraries.Tapi, EntryPoint = "tel_set_flight_mode")] - internal static extern int SetFlightMode(IntPtr handle, PowerFlightModeRequest mode, TapiResponseCallback cb, IntPtr userData); - [DllImport(Libraries.Tapi, EntryPoint = "tel_get_flight_mode")] - internal static extern int GetFlightMode(IntPtr handle, TapiResponseCallback cb, IntPtr userData); - [DllImport(Libraries.Tapi, EntryPoint = "tel_get_misc_me_version")] - internal static extern int GetMiscMeVersion(IntPtr handle, TapiResponseCallback cb, IntPtr userData); - [DllImport(Libraries.Tapi, EntryPoint = "tel_get_misc_me_version_sync")] - internal static extern IntPtr GetMiscMeVersionSync(IntPtr handle); - [DllImport(Libraries.Tapi, EntryPoint = "tel_get_misc_me_sn")] - internal static extern int GetMiscMeSn(IntPtr handle, TapiResponseCallback cb, IntPtr userData); - [DllImport(Libraries.Tapi, EntryPoint = "tel_get_misc_me_sn_sync")] - internal static extern IntPtr GetMiscMeSnSync(IntPtr handle); - [DllImport(Libraries.Tapi, EntryPoint = "tel_get_misc_me_imei")] - internal static extern int GetMiscMeImei(IntPtr handle, TapiResponseCallback cb, IntPtr userData); - [DllImport(Libraries.Tapi, EntryPoint = "tel_get_misc_me_imei_sync")] - internal static extern string GetMiscMeImeiSync(IntPtr handle); - [DllImport(Libraries.Tapi, EntryPoint = "tel_check_modem_power_status")] - internal static extern int CheckPowerStatus(IntPtr handle, out int result); - [DllImport(Libraries.Tapi, EntryPoint = "tel_get_device_info")] - internal static extern int GetDeviceInfo(IntPtr handle, TapiResponseCallback cb, IntPtr userData); - } - - //Sms - internal static class Sms - { - [DllImport(Libraries.Tapi, EntryPoint = "tel_send_sms")] - internal static extern int SendSms(IntPtr handle, ref SmsDataPackageStruct info, int moreMsg, TapiResponseCallback cb, IntPtr userData); - [DllImport(Libraries.Tapi, EntryPoint = "tel_read_sms_in_sim")] - internal static extern int ReadSmsSim(IntPtr handle, int index, TapiResponseCallback cb, IntPtr userData); - [DllImport(Libraries.Tapi, EntryPoint = "tel_write_sms_in_sim")] - internal static extern int WriteSmsSim(IntPtr handle, ref SmsDataStruct data, TapiResponseCallback cb, IntPtr userData); - [DllImport(Libraries.Tapi, EntryPoint = "tel_delete_sms_in_sim")] - internal static extern int DeleteSmsSim(IntPtr handle, int index, TapiResponseCallback cb, IntPtr userData); - [DllImport(Libraries.Tapi, EntryPoint = "tel_get_sms_count")] - internal static extern int GetSmsCount(IntPtr handle, TapiResponseCallback cb, IntPtr userData); - [DllImport(Libraries.Tapi, EntryPoint = "tel_set_sms_cb_config")] - internal static extern int SetSmsCbconfig(IntPtr handle, ref SmsCbConfigStruct config, TapiResponseCallback cb, IntPtr userData); - [DllImport(Libraries.Tapi, EntryPoint = "tel_get_sms_cb_config")] - internal static extern int GetSmsCbconfig(IntPtr handle, TapiResponseCallback cb, IntPtr userData); - [DllImport(Libraries.Tapi, EntryPoint = "tel_get_sms_parameters")] - internal static extern int GetSmsParams(IntPtr handle, int index, TapiResponseCallback cb, IntPtr userData); - [DllImport(Libraries.Tapi, EntryPoint = "tel_set_sms_parameters")] - internal static extern int SetSmsParams(IntPtr handle, ref SmsParamsStruct info, TapiResponseCallback cb, IntPtr userData); - [DllImport(Libraries.Tapi, EntryPoint = "tel_send_sms_deliver_report")] - internal static extern int SendSmsDeliverReport(IntPtr handle, ref SmsDataPackageStruct info, SmsResponse response, TapiResponseCallback cb, IntPtr userData); - [DllImport(Libraries.Tapi, EntryPoint = "tel_set_sms_sca")] - internal static extern int SetSmsSca(IntPtr handle, ref SmsAddressStruct info, int index, TapiResponseCallback cb, IntPtr userData); - [DllImport(Libraries.Tapi, EntryPoint = "tel_get_sms_sca")] - internal static extern int GetSmsSca(IntPtr handle, int index, TapiResponseCallback cb, IntPtr userData); - [DllImport(Libraries.Tapi, EntryPoint = "tel_set_sms_memory_status")] - internal static extern int SetSmsMemoryStatus(IntPtr handle, int status, TapiResponseCallback cb, IntPtr userData); - [DllImport(Libraries.Tapi, EntryPoint = "tel_set_sms_message_status")] - internal static extern int SetSmsMsgStatus(IntPtr handle, int index, SmsMessageStatus status, TapiResponseCallback cb, IntPtr userData); - [DllImport(Libraries.Tapi, EntryPoint = "tel_get_sms_parameter_count")] - internal static extern int GetSmsParamCount(IntPtr handle, TapiResponseCallback cb, IntPtr userData); - [DllImport(Libraries.Tapi, EntryPoint = "tel_check_sms_device_status")] - internal static extern int CheckSmsDeviceStatus(IntPtr handle, out int readyStatus); - } - - //Network - internal static class Network - { - [DllImport(Libraries.Tapi, EntryPoint = "tel_select_network_automatic")] - internal static extern int SelectAutoNetwork(IntPtr handle, TapiResponseCallback cb, IntPtr userData); - [DllImport(Libraries.Tapi, EntryPoint = "tel_select_network_manual")] - internal static extern int SelectManualNetwork(IntPtr handle, string plmn, int act, TapiResponseCallback cb, IntPtr userData); - [DllImport(Libraries.Tapi, EntryPoint = "tel_search_network")] - internal static extern int SearchNetwork(IntPtr handle, TapiResponseCallback cb, IntPtr userData); - [DllImport(Libraries.Tapi, EntryPoint = "tel_get_network_selection_mode")] - internal static extern int GetNetworkSelectMode(IntPtr handle, TapiResponseCallback cb, IntPtr userData); - [DllImport(Libraries.Tapi, EntryPoint = "tel_set_network_preferred_plmn")] - internal static extern int SetNetworkPreferredPlmn(IntPtr handle, NetworkPreferredPlmnOp operation, ref NetworkPreferredPlmnStruct info, TapiResponseCallback cb, IntPtr userData); - [DllImport(Libraries.Tapi, EntryPoint = "tel_get_network_preferred_plmn")] - internal static extern int GetNetworkPreferredPlmn(IntPtr handle, TapiResponseCallback cb, IntPtr userData); - [DllImport(Libraries.Tapi, EntryPoint = "tel_cancel_network_manual_search")] - internal static extern int CancelNetworkManualSearch(IntPtr handle, TapiResponseCallback cb, IntPtr userData); - [DllImport(Libraries.Tapi, EntryPoint = "tel_get_network_serving")] - internal static extern int GetNetworkServing(IntPtr handle, TapiResponseCallback cb, IntPtr userData); - [DllImport(Libraries.Tapi, EntryPoint = "tel_set_network_mode")] - internal static extern int SetNetworkMode(IntPtr handle, int mode, TapiResponseCallback cb, IntPtr userData); - [DllImport(Libraries.Tapi, EntryPoint = "tel_get_network_mode")] - internal static extern int GetNetworkMode(IntPtr handle, TapiResponseCallback cb, IntPtr userData); - [DllImport(Libraries.Tapi, EntryPoint = "tel_get_network_neighboring_cell_info")] - internal static extern int GetNetworkNeighborCell(IntPtr handle, TapiResponseCallback cb, IntPtr userData); - [DllImport(Libraries.Tapi, EntryPoint = "tel_set_network_emergency_callback_mode")] - internal static extern int SetNetworkEmergencyCallback(IntPtr handle, NetworkEmergencyCallbackMode mode, TapiResponseCallback cb, IntPtr userData); - [DllImport(Libraries.Tapi, EntryPoint = "tel_set_network_roaming_preference")] - internal static extern int SetNetworkRoamPreference(IntPtr handle, NetworkPreferred prefRoam, TapiResponseCallback cb, IntPtr userData); - [DllImport(Libraries.Tapi, EntryPoint = "tel_get_network_roaming_preference")] - internal static extern int GetNetworkRoamPreference(IntPtr handle, TapiResponseCallback cb, IntPtr userData); - [DllImport(Libraries.Tapi, EntryPoint = "tel_set_network_default_data_subscription")] - internal static extern int SetNetworkDefaultDataSubs(IntPtr handle, TapiResponseCallback cb, IntPtr userData); - [DllImport(Libraries.Tapi, EntryPoint = "tel_get_network_default_data_subscription")] - internal static extern int GetNetworkDefaultDataSubs(IntPtr handle, out NetworkDefaultDataSubscription subscription); - [DllImport(Libraries.Tapi, EntryPoint = "tel_set_network_default_subscription")] - internal static extern int SetNetworkDefaultSubs(IntPtr handle, TapiResponseCallback cb, IntPtr userData); - [DllImport(Libraries.Tapi, EntryPoint = "tel_get_network_default_subscription")] - internal static extern int GetNetworkDefaultSubs(IntPtr handle, out NetworkDefaultSubscription subscription); - } - } -} diff --git a/src/Tizen.Tapi/Tizen.Tapi.csproj b/src/Tizen.Tapi/Tizen.Tapi.csproj deleted file mode 100644 index 4c51c4197..000000000 --- a/src/Tizen.Tapi/Tizen.Tapi.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - netstandard2.0 - - - - - - - - \ No newline at end of file diff --git a/src/Tizen.Tapi/Tizen.Tapi.sln b/src/Tizen.Tapi/Tizen.Tapi.sln deleted file mode 100755 index c69915653..000000000 --- a/src/Tizen.Tapi/Tizen.Tapi.sln +++ /dev/null @@ -1,34 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26430.12 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Tapi", "Tizen.Tapi.csproj", "{77F9FF6F-DF82-4A48-AFF8-9031B5065AA5}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen", "..\Tizen\Tizen.csproj", "{79F086CB-DB6C-452F-A15C-274676452682}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Log", "..\Tizen.Log\Tizen.Log.csproj", "{29669E98-429B-4FDD-8E21-85D78B07346F}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {77F9FF6F-DF82-4A48-AFF8-9031B5065AA5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {77F9FF6F-DF82-4A48-AFF8-9031B5065AA5}.Debug|Any CPU.Build.0 = Debug|Any CPU - {77F9FF6F-DF82-4A48-AFF8-9031B5065AA5}.Release|Any CPU.ActiveCfg = Release|Any CPU - {77F9FF6F-DF82-4A48-AFF8-9031B5065AA5}.Release|Any CPU.Build.0 = Release|Any CPU - {79F086CB-DB6C-452F-A15C-274676452682}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {79F086CB-DB6C-452F-A15C-274676452682}.Debug|Any CPU.Build.0 = Debug|Any CPU - {79F086CB-DB6C-452F-A15C-274676452682}.Release|Any CPU.ActiveCfg = Release|Any CPU - {79F086CB-DB6C-452F-A15C-274676452682}.Release|Any CPU.Build.0 = Release|Any CPU - {29669E98-429B-4FDD-8E21-85D78B07346F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {29669E98-429B-4FDD-8E21-85D78B07346F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {29669E98-429B-4FDD-8E21-85D78B07346F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {29669E98-429B-4FDD-8E21-85D78B07346F}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/src/Tizen.Tapi/Tizen.Tapi/Call.cs b/src/Tizen.Tapi/Tizen.Tapi/Call.cs deleted file mode 100755 index c33adb632..000000000 --- a/src/Tizen.Tapi/Tizen.Tapi/Call.cs +++ /dev/null @@ -1,1187 +0,0 @@ -/* - * 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.Collections.Generic; -using System.Runtime.InteropServices; -using System.Threading.Tasks; - -namespace Tizen.Tapi -{ - /// - /// This class provides functions to manage call related setup and methods. - /// - public class Call - { - private IntPtr _handle; - private Dictionary _response_map = new Dictionary(); - private Interop.Tapi.CallStatusCallback _callStatusCb; - private int _requestId = 0; - - /// - /// A public constructor for Call class to create a Call instance for the given tapi handle. - /// - /// The tapi handle. - public Call(TapiHandle handle) - { - if (handle == null) - { - throw new ArgumentNullException("TapiHandle parameter is null"); - } - - _handle = handle._handle; - } - - /// - /// Setup the call to be dialled asynchronously. - /// - /// Information of call type and number. - /// A task indicating whether the DialCall method is done or not. - /// http://tizen.org/privilege/telephony.admin - /// platform - /// http://tizen.org/feature/network.telephony - /// - /// Register the telephony event with proper Notification enum value which is to be listened using RegisterNotiEvent. - /// - /// Thrown when feature is not supported. - /// Thrown when privilege access is denied. - /// Thrown when CallInformation argument is null. - /// Thrown when call instance is invalid or when method failed due to invalid operation. - public Task DialCall(CallInformation info) - { - if (info != null) - { - TaskCompletionSource task = new TaskCompletionSource(); - IntPtr id; - id = (IntPtr)_requestId++; - _response_map[id] = (IntPtr handle, int result, IntPtr data, IntPtr key) => - { - Task resultTask = new Task(() => - { - if (result != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Error occurs during call dial setup, " + (TapiError)result); - task.SetException(new InvalidOperationException("Error occurs during call dial setup, " + (TapiError)result)); - return; - } - - task.SetResult(true); - }); - - resultTask.Start(); - resultTask.Wait(); - _response_map.Remove(key); - }; - - CallInformationStruct callInfoStruct = CallClassConversions.ConvertCallInformationToStruct(info); - int ret = Interop.Tapi.Call.DialCall(_handle, ref callInfoStruct, _response_map[id], id); - if (ret != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Failed to dial call and do the call setup, Error: " + (TapiError)ret); - TapiUtility.ThrowTapiException(ret, _handle, "http://tizen.org/privilege/telephony.admin"); - } - - return task.Task; - } - - else - { - throw new ArgumentNullException("CallInformation argument is null"); - } - } - - /// - /// Supports answering the incoming call by accepting or rejecting the call asynchronously. - /// - /// Unique handle that refer to the call. - /// The answer type. - /// The call id of answer call. This call handle is available to the application through an incoming call(IncomingVoiceCall) event. - /// http://tizen.org/privilege/telephony.admin - /// platform - /// http://tizen.org/feature/network.telephony - /// - /// There can be a maximum of one existing call. - /// Register the telephony event with proper Notification enum value which is to be listened using RegisterNotiEvent. - /// - /// Thrown when feature is not supported. - /// Thrown when privilege access is denied. - /// Thrown when call instance is invalid or when method failed due to invalid operation. - public Task AnswerCall(uint callHandle, CallAnswerType type) - { - TaskCompletionSource task = new TaskCompletionSource(); - IntPtr id; - id = (IntPtr)_requestId++; - _response_map[id] = (IntPtr handle, int result, IntPtr data, IntPtr key) => - { - Task resultTask = new Task(() => - { - if (result != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Error occurs during answering call, " + (TapiError)result); - task.SetException(new InvalidOperationException("Error occurs during answering call, " + (TapiError)result)); - return; - } - - CallOperationsStruct ansStruct = Marshal.PtrToStructure(data); - task.SetResult(ansStruct.id); - }); - - resultTask.Start(); - resultTask.Wait(); - _response_map.Remove(key); - }; - - int ret = Interop.Tapi.Call.AnswerCall(_handle, callHandle, type, _response_map[id], id); - if (ret != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Failed to answer the incoming call, Error: " + (TapiError)ret); - TapiUtility.ThrowTapiException(ret, _handle, "http://tizen.org/privilege/telephony.admin"); - } - - return task.Task; - } - - /// - /// Releases the call asynchronously irrespective of whether the call is in the hold or active state. - /// - /// Unique handle that refer to the call. - /// The end call type. - /// Instance of CallEndData. - /// http://tizen.org/privilege/telephony.admin - /// platform - /// http://tizen.org/feature/network.telephony - /// - /// There should be an existing call in the active/hold state. - /// Register the telephony event with proper Notification enum value which is to be listened using RegisterNotiEvent. - /// - /// Thrown when feature is not supported. - /// Thrown when privilege access is denied. - /// Thrown when call instance is invalid or when method failed due to invalid operation. - public Task EndCall(uint callHandle, CallEndType type) - { - TaskCompletionSource task = new TaskCompletionSource(); - IntPtr id; - id = (IntPtr)_requestId++; - _response_map[id] = (IntPtr handle, int result, IntPtr data, IntPtr key) => - { - Task resultTask = new Task(() => - { - if (result != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Error occurs during ending call, " + (TapiError)result); - task.SetException(new InvalidOperationException("Error occurs during ending call, " + (TapiError)result)); - return; - } - - CallEndStruct endStruct = Marshal.PtrToStructure(data); - CallEndData endDataClass = new CallEndData(endStruct.type, endStruct.id); - task.SetResult(endDataClass); - }); - - resultTask.Start(); - resultTask.Wait(); - _response_map.Remove(key); - }; - - int ret = Interop.Tapi.Call.EndCall(_handle, callHandle, type, _response_map[id], id); - if (ret != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Failed to end the call, Error: " + (TapiError)ret); - TapiUtility.ThrowTapiException(ret, _handle, "http://tizen.org/privilege/telephony.admin"); - } - - return task.Task; - } - - /// - /// Puts the given call on hold asynchoronously. - /// - /// Unique handle for referring the call. - /// The call id of hold call. - /// http://tizen.org/privilege/telephony.admin - /// platform - /// http://tizen.org/feature/network.telephony - /// - /// The call should be in the active state. - /// Register the telephony event with proper Notification enum value which is to be listened using RegisterNotiEvent. - /// - /// Thrown when feature is not supported. - /// Thrown when privilege access is denied. - /// Thrown when call instance is invalid or when method failed due to invalid operation. - public Task HoldCall(uint callHandle) - { - TaskCompletionSource task = new TaskCompletionSource(); - IntPtr id; - id = (IntPtr)_requestId++; - _response_map[id] = (IntPtr handle, int result, IntPtr data, IntPtr key) => - { - Task resultTask = new Task(() => - { - if (result != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Error occurs during putting call on hold, " + (TapiError)result); - task.SetException(new InvalidOperationException("Error occurs during putting call on hold, " + (TapiError)result)); - return; - } - - CallOperationsStruct holdStruct = Marshal.PtrToStructure(data); - task.SetResult(holdStruct.id); - }); - - resultTask.Start(); - resultTask.Wait(); - _response_map.Remove(key); - }; - - int ret = Interop.Tapi.Call.HoldCall(_handle, callHandle, _response_map[id], id); - if (ret != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Failed to put the call on hold, Error: " + (TapiError)ret); - TapiUtility.ThrowTapiException(ret, _handle, "http://tizen.org/privilege/telephony.admin"); - } - - return task.Task; - } - - /// - /// Retrieves the call being held asynchoronously. - /// - /// Unique handle for referring the call. - /// The call id of active call. - /// http://tizen.org/privilege/telephony.admin - /// platform - /// http://tizen.org/feature/network.telephony - /// - /// Call should be in the held state in order to retrieve it into the active state unless no active call is present. - /// Register the telephony event with proper Notification enum value which is to be listened using RegisterNotiEvent. - /// - /// Thrown when feature is not supported. - /// Thrown when privilege access is denied. - /// Thrown when call instance is invalid or when method failed due to invalid operation. - public Task ActiveCall(uint callHandle) - { - TaskCompletionSource task = new TaskCompletionSource(); - IntPtr id; - id = (IntPtr)_requestId++; - _response_map[id] = (IntPtr handle, int result, IntPtr data, IntPtr key) => - { - Task resultTask = new Task(() => - { - if (result != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Error occurs during retrieving the hold call, " + (TapiError)result); - task.SetException(new InvalidOperationException("Error occurs during retrieving the hold call, " + (TapiError)result)); - return; - } - - CallOperationsStruct activeStruct = Marshal.PtrToStructure(data); - task.SetResult(activeStruct.id); - }); - - resultTask.Start(); - resultTask.Wait(); - _response_map.Remove(key); - }; - - int ret = Interop.Tapi.Call.ActiveCall(_handle, callHandle, _response_map[id], id); - if (ret != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Failed to retrieve the call which was on hold, Error: " + (TapiError)ret); - TapiUtility.ThrowTapiException(ret, _handle, "http://tizen.org/privilege/telephony.admin"); - } - - return task.Task; - } - - /// - /// Swaps calls asynchoronously. This is only for calls dialed or answered with Telephony. - /// - /// Active call. - /// Held call. - /// The call id of swap call. - /// http://tizen.org/privilege/telephony.admin - /// platform - /// http://tizen.org/feature/network.telephony - /// - /// Register the telephony event with proper Notification enum value which is to be listened using RegisterNotiEvent. - /// - /// Thrown when feature is not supported. - /// Thrown when privilege access is denied. - /// Thrown when call instance is invalid or when method failed due to invalid operation. - public Task SwapCall(uint activeCallHandle, uint heldCallHandle) - { - TaskCompletionSource task = new TaskCompletionSource(); - IntPtr id; - id = (IntPtr)_requestId++; - _response_map[id] = (IntPtr handle, int result, IntPtr data, IntPtr key) => - { - Task resultTask = new Task(() => - { - if (result != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Error occurs during swapping calls, " + (TapiError)result); - task.SetException(new InvalidOperationException("Error occurs during swapping calls, " + (TapiError)result)); - return; - } - - CallOperationsStruct activeStruct = Marshal.PtrToStructure(data); - task.SetResult(activeStruct.id); - }); - - resultTask.Start(); - resultTask.Wait(); - _response_map.Remove(key); - }; - - int ret = Interop.Tapi.Call.SwapCall(_handle, activeCallHandle, heldCallHandle, _response_map[id], id); - if (ret != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Failed to swap the active and held calls, Error: " + (TapiError)ret); - TapiUtility.ThrowTapiException(ret, _handle, "http://tizen.org/privilege/telephony.admin"); - } - - return task.Task; - } - - /// - /// Starts continuous dtmf by sending a single digit during the call asynchronously. - /// - /// The dtmf digit to be sent. - /// A task indicating whether the StartContDtmfCall method is done or not. - /// http://tizen.org/privilege/telephony.admin - /// platform - /// http://tizen.org/feature/network.telephony - /// An active call should be present. This is to be invoked in the following cases: - /// i. Key Release (post key press) during on-going call. - /// ii. Dtmf digits passed with PAUSE(,) or WAIT(;). - /// In case of PAUSE and WAIT, every StartContDtmfCall() call needs to be followed by StopContDtmfCall() sequentially (for every digit) without waiting for response from StartContDtmfCall(). - /// - /// Thrown when feature is not supported. - /// Thrown when privilege access is denied. - /// Thrown when call instance is invalid or when method failed due to invalid operation. - public Task StartContDtmfCall(byte digit) - { - TaskCompletionSource task = new TaskCompletionSource(); - IntPtr id; - id = (IntPtr)_requestId++; - _response_map[id] = (IntPtr handle, int result, IntPtr data, IntPtr key) => - { - Task resultTask = new Task(() => - { - if (result != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Error occurs during starting continuous dtmf, " + (TapiError)result); - task.SetException(new InvalidOperationException("Error occurs during starting continuous dtmf, " + (TapiError)result)); - return; - } - - task.SetResult(true); - }); - - resultTask.Start(); - resultTask.Wait(); - _response_map.Remove(key); - }; - - int ret = Interop.Tapi.Call.StartContDtmfCall(_handle, digit, _response_map[id], id); - if (ret != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Failed to start continuous dtmf during the call, Error: " + (TapiError)ret); - TapiUtility.ThrowTapiException(ret, _handle, "http://tizen.org/privilege/telephony.admin"); - } - - return task.Task; - } - - /// - /// Stops continuous dtmf during the call asynchronously. - /// - /// A task indicating whether the StopContDtmfCall method is done or not. - /// http://tizen.org/privilege/telephony.admin - /// platform - /// http://tizen.org/feature/network.telephony - /// An active call should be present. This is to be invoked in the following cases: - /// i. Key Release (post key press) during on-going call. - /// ii. Dtmf digits passed with PAUSE(,) or WAIT(;). - /// Every StartContDtmfCall() call needs to be followed by StopContDtmfCall() sequentially. - /// - /// Thrown when feature is not supported. - /// Thrown when privilege access is denied. - /// Thrown when call instance is invalid or when method failed due to invalid operation. - public Task StopContDtmfCall() - { - TaskCompletionSource task = new TaskCompletionSource(); - IntPtr id; - id = (IntPtr)_requestId++; - _response_map[id] = (IntPtr handle, int result, IntPtr data, IntPtr key) => - { - Task resultTask = new Task(() => - { - if (result != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Error occurs during stopping continuous dtmf, " + (TapiError)result); - task.SetException(new InvalidOperationException("Error occurs during stopping continuous dtmf, " + (TapiError)result)); - return; - } - - task.SetResult(true); - }); - - resultTask.Start(); - resultTask.Wait(); - _response_map.Remove(key); - }; - - int ret = Interop.Tapi.Call.StopContDtmfCall(_handle, _response_map[id], id); - if (ret != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Failed to stop continuous dtmf during the call, Error: " + (TapiError)ret); - TapiUtility.ThrowTapiException(ret, _handle, "http://tizen.org/privilege/telephony.admin"); - } - - return task.Task; - } - - /// - /// Send one or more dtmf digits during the call asynchronously. - /// - /// A burst dtmf info containing dtmf string, pulse width, and inter digit interval. - /// A task indicating whether the SendBurstDtmfCall method is done or not. - /// http://tizen.org/privilege/telephony.admin - /// platform - /// http://tizen.org/feature/network.telephony - /// - /// There will be a single asynchronous notification for all the dtmf digits sent. If the users of this API need an asynchronous - /// response for each dtmf digit then the user has to call this API multiple times passing each single dtmf digit in CallBurstDtmfData. - /// - /// Thrown when feature is not supported. - /// Thrown when privilege access is denied. - /// Thrown when CallBurstDtmfData argument is null. - /// Thrown when call instance is invalid or when method failed due to invalid operation. - public Task SendBurstDtmfCall(CallBurstDtmfData dtmfData) - { - if (dtmfData != null) - { - TaskCompletionSource task = new TaskCompletionSource(); - IntPtr id; - id = (IntPtr)_requestId++; - _response_map[id] = (IntPtr handle, int result, IntPtr data, IntPtr key) => - { - Task resultTask = new Task(() => - { - if (result != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Error occurs while sending dtmf digits, " + (TapiError)result); - task.SetException(new InvalidOperationException("Error occurs while sending dtmf digits, " + (TapiError)result)); - return; - } - - task.SetResult(true); - }); - - resultTask.Start(); - resultTask.Wait(); - _response_map.Remove(key); - }; - - CallBurstDtmfStruct callBurstStruct = CallClassConversions.ConvertCallBurstToStruct(dtmfData); - int ret = Interop.Tapi.Call.SendBurstDtmfCall(_handle, ref callBurstStruct, _response_map[id], id); - if (ret != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Failed to send dtmf digits during the call, Error: " + (TapiError)ret); - TapiUtility.ThrowTapiException(ret, _handle, "http://tizen.org/privilege/telephony.admin"); - } - - return task.Task; - } - - else - { - throw new ArgumentNullException("CallBurstDtmfData argument is null"); - } - } - - /// - /// Joins the given two calls (one call in the active conversation state and the other call in the held state) into conference asynchronously. - /// - /// Unique handle which is either an active call or a held call. - /// Unique call handle. - /// The call id of join call. - /// http://tizen.org/privilege/telephony.admin - /// platform - /// http://tizen.org/feature/network.telephony - /// - /// For a multiparty call or for joining two calls into conference, there should be one call in the active state and another call in the held state. - /// Register the telephony event with proper Notification enum value which is to be listened using RegisterNotiEvent. - /// - /// Thrown when feature is not supported. - /// Thrown when privilege access is denied. - /// Thrown when call instance is invalid or when method failed due to invalid operation. - public Task JoinCall(uint activeCallhandle, uint callHandle) - { - TaskCompletionSource task = new TaskCompletionSource(); - IntPtr id; - id = (IntPtr)_requestId++; - _response_map[id] = (IntPtr handle, int result, IntPtr data, IntPtr key) => - { - Task resultTask = new Task(() => - { - if (result != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Error occurs during joining the two calls, " + (TapiError)result); - task.SetException(new InvalidOperationException("Error occurs during joining the two calls, " + (TapiError)result)); - return; - } - - CallOperationsStruct joinStruct = Marshal.PtrToStructure(data); - task.SetResult(joinStruct.id); - }); - - resultTask.Start(); - resultTask.Wait(); - _response_map.Remove(key); - }; - - int ret = Interop.Tapi.Call.JoinCall(_handle, activeCallhandle, callHandle, _response_map[id], id); - if (ret != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Failed to join the given two calls into conference, Error: " + (TapiError)ret); - TapiUtility.ThrowTapiException(ret, _handle, "http://tizen.org/privilege/telephony.admin"); - } - - return task.Task; - } - - /// - /// Triggers splitting a private call from a multiparty call asynchronously. - /// - /// The handle of the call to be made private. The call handle referring to the call that is to be split from the conference. - /// The call id of split call. - /// http://tizen.org/privilege/telephony.admin - /// platform - /// http://tizen.org/feature/network.telephony - /// - /// The call should be in a multiparty conference call.The split call will be the active call and the conference call will be the held call. - /// Register the telephony event with proper Notification enum value which is to be listened using RegisterNotiEvent. - /// - /// Thrown when feature is not supported. - /// Thrown when privilege access is denied. - /// Thrown when call instance is invalid or when method failed due to invalid operation. - public Task SplitCall(uint callHandle) - { - TaskCompletionSource task = new TaskCompletionSource(); - IntPtr id; - id = (IntPtr)_requestId++; - _response_map[id] = (IntPtr handle, int result, IntPtr data, IntPtr key) => - { - Task resultTask = new Task(() => - { - if (result != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Error occurs during splitting a private call from a multiparty call, " + (TapiError)result); - task.SetException(new InvalidOperationException("Error occurs during splitting a private call from a multiparty call, " + (TapiError)result)); - return; - } - - CallOperationsStruct splitStruct = Marshal.PtrToStructure(data); - task.SetResult(splitStruct.id); - }); - - resultTask.Start(); - resultTask.Wait(); - _response_map.Remove(key); - }; - - int ret = Interop.Tapi.Call.SplitCall(_handle, callHandle, _response_map[id], id); - if (ret != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Failed to split a private call from a multiparty call, Error: " + (TapiError)ret); - TapiUtility.ThrowTapiException(ret, _handle, "http://tizen.org/privilege/telephony.admin"); - } - - return task.Task; - } - - /// - /// Triggers making an explicit call transfer by connecting the two parties where one party is being active(active state) and another party is being held(held state) asynchronously. - /// - /// The call handle of an active call. - /// The call id of transferred call. - /// http://tizen.org/privilege/telephony.admin - /// platform - /// http://tizen.org/feature/network.telephony - /// - /// In order to transfer call, served mobile subscriber should have 2 calls, one in the active state and another one in the held state. - /// Register the telephony event with proper Notification enum value which is to be listened using RegisterNotiEvent. - /// - /// Thrown when feature is not supported. - /// Thrown when privilege access is denied. - /// Thrown when call instance is invalid or when method failed due to invalid operation. - public Task TransferCall(uint activeCallHandle) - { - TaskCompletionSource task = new TaskCompletionSource(); - IntPtr id; - id = (IntPtr)_requestId++; - _response_map[id] = (IntPtr handle, int result, IntPtr data, IntPtr key) => - { - Task resultTask = new Task(() => - { - if (result != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Error occurs during transferring call, " + (TapiError)result); - task.SetException(new InvalidOperationException("Error occurs during transferring call, " + (TapiError)result)); - return; - } - - CallOperationsStruct splitStruct = Marshal.PtrToStructure(data); - task.SetResult(splitStruct.id); - }); - - resultTask.Start(); - resultTask.Wait(); - _response_map.Remove(key); - }; - - int ret = Interop.Tapi.Call.TransferCall(_handle, activeCallHandle, _response_map[id], id); - if (ret != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Failed to make explicit call transfer by connecting two calls - active call and held call, Error: " + (TapiError)ret); - TapiUtility.ThrowTapiException(ret, _handle, "http://tizen.org/privilege/telephony.admin"); - } - - return task.Task; - } - - /// - /// Redirects the incoming call to another subscriber asynchronously. - /// - /// Incoming call handle. - /// The destination number. - /// A task indicating whether the DeflectCall method is done or not. - /// http://tizen.org/privilege/telephony.admin - /// platform - /// http://tizen.org/feature/network.telephony - /// Register the telephony event with proper Notification enum value which is to be listened using RegisterNotiEvent. - /// Thrown when feature is not supported. - /// Thrown when privilege access is denied. - /// Thrown when destinationNumber argument is invalid. - /// Thrown when call instance is invalid or when method failed due to invalid operation. - public Task DeflectCall(uint incomingCallHandle, byte[] destinationNumber) - { - TaskCompletionSource task = new TaskCompletionSource(); - IntPtr id; - id = (IntPtr)_requestId++; - CallDeflectDestStruct deflectStruct = CallClassConversions.ConvertByteDestinationToStruct(destinationNumber); - _response_map[id] = (IntPtr handle, int result, IntPtr data, IntPtr key) => - { - Task resultTask = new Task(() => - { - if (result != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Error occurs during deflecting incoming call, " + (TapiError)result); - task.SetException(new InvalidOperationException("Error occurs during deflecting incoming call, " + (TapiError)result)); - return; - } - - task.SetResult(true); - }); - - resultTask.Start(); - resultTask.Wait(); - _response_map.Remove(key); - Marshal.FreeHGlobal(deflectStruct.DestinationNumber); - }; - - int ret = Interop.Tapi.Call.DeflectCall(_handle, incomingCallHandle, ref deflectStruct, _response_map[id], id); - if (ret != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Failed to redirect the incoming call to another subscriber, Error: " + (TapiError)ret); - TapiUtility.ThrowTapiException(ret, _handle, "http://tizen.org/privilege/telephony.admin"); - } - - return task.Task; - } - - /// - /// Gets the status of the current call. - /// - /// A unique handle for referring the call. - /// The call status information like destination number, call direction, call type, whether call is in the conference state or not. - /// http://tizen.org/privilege/telephony - /// http://tizen.org/feature/network.telephony - /// Thrown when feature is not supported. - /// Thrown when privilege access is denied. - /// Thrown when call instance is invalid or when method failed due to invalid operation. - public CallStatus GetCallStatus(int callId) - { - CallStatusStruct statusStruct; - int ret = Interop.Tapi.Call.GetCallStatus(_handle, callId, out statusStruct); - if (ret != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Failed to get the status of the current call, Error: " + (TapiError)ret); - TapiUtility.ThrowTapiException(ret, _handle, "http://tizen.org/privilege/telephony"); - } - - CallStatus statusData = CallStructConversions.ConvertStatusStruct(statusStruct); - return statusData; - } - - /// - /// Get the list of status of the current call. - /// - /// List of CallStatus. - /// http://tizen.org/privilege/telephony - /// http://tizen.org/feature/network.telephony - /// Thrown when feature is not supported. - /// Thrown when privilege access is denied. - /// Thrown when call instance is invalid or when method failed due to invalid operation. - public IEnumerable GetAllCallStatus() - { - List callStatusList = new List(); - _callStatusCb = (ref CallStatusStruct info, IntPtr userData) => - { - if (!info.Equals(null)) - { - callStatusList.Add(CallStructConversions.ConvertStatusStruct(info)); - } - }; - - int ret = Interop.Tapi.Call.GetAllCallStatus(_handle, _callStatusCb, IntPtr.Zero); - if (ret != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Failed to get all status of the current call, Error: " + (TapiError)ret); - TapiUtility.ThrowTapiException(ret, _handle, "http://tizen.org/privilege/telephony"); - } - - return callStatusList; - } - - /// - /// Get the call volume asynchronously. - /// - /// The sound device. - /// The sound type. - /// Instance of CallVolumeInfo. - /// http://tizen.org/privilege/telephony - /// http://tizen.org/feature/network.telephony - /// Thrown when feature is not supported. - /// Thrown when privilege access is denied. - /// Thrown when call instance is invalid or when method failed due to invalid operation. - public Task GetCallVolumeInfo(SoundDevice device, SoundType type) - { - TaskCompletionSource task = new TaskCompletionSource(); - IntPtr id; - id = (IntPtr)_requestId++; - _response_map[id] = (IntPtr handle, int result, IntPtr data, IntPtr key) => - { - Task resultTask = new Task(() => - { - if (result != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Error occurs during getting the call volume, " + (TapiError)result); - task.SetException(new InvalidOperationException("Error occurs during getting the call volume, " + (TapiError)result)); - return; - } - - CallVolumeStruct volumeStruct = Marshal.PtrToStructure(data); - CallVolumeInfo volumeInfo = CallStructConversions.ConvertVolumeStruct(volumeStruct); - task.SetResult(volumeInfo); - }); - - resultTask.Start(); - resultTask.Wait(); - _response_map.Remove(key); - }; - - int ret = Interop.Tapi.Call.GetCallVolumeInfo(_handle, device, type, _response_map[id], id); - if (ret != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Failed to get the call volume, Error: " + (TapiError)ret); - TapiUtility.ThrowTapiException(ret, _handle, "http://tizen.org/privilege/telephony"); - } - - return task.Task; - } - - /// - /// Set the call volume asynchronously. - /// - /// The call volume information. - /// A task indicating whether the SetCallVolumeInfo method is done or not. - /// http://tizen.org/privilege/telephony.admin - /// platform - /// http://tizen.org/feature/network.telephony - /// Thrown when feature is not supported. - /// Thrown when privilege access is denied. - /// Thrown when CallVolumeRecord argument is null. - /// Thrown when call instance is invalid or when method failed due to invalid operation. - public Task SetCallVolumeInfo(CallVolumeRecord record) - { - if (record != null) - { - TaskCompletionSource task = new TaskCompletionSource(); - IntPtr id; - id = (IntPtr)_requestId++; - _response_map[id] = (IntPtr handle, int result, IntPtr data, IntPtr key) => - { - Task resultTask = new Task(() => - { - if (result != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Error occurs during setting the call volume, " + (TapiError)result); - task.SetException(new InvalidOperationException("Error occurs during setting the call volume, " + (TapiError)result)); - return; - } - - task.SetResult(true); - }); - - resultTask.Start(); - resultTask.Wait(); - _response_map.Remove(key); - }; - - CallVolumeRecordStruct volumeStruct = CallClassConversions.ConvertVolumeRecordToStruct(record); - int ret = Interop.Tapi.Call.SetCallVolumeInfo(_handle, ref volumeStruct, _response_map[id], id); - if (ret != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Failed to set the call volume, Error: " + (TapiError)ret); - TapiUtility.ThrowTapiException(ret, _handle, "http://tizen.org/privilege/telephony.admin"); - } - - return task.Task; - } - - else - { - throw new ArgumentNullException("CallVolumeRecord argument is null"); - } - } - - /// - /// Set the call sound path asynchronously. - /// - /// The call sound path information. - /// A task indicating whether the SetCallSoundPath method is done or not. - /// http://tizen.org/privilege/telephony.admin - /// platform - /// http://tizen.org/feature/network.telephony - /// Thrown when feature is not supported. - /// Thrown when privilege access is denied. - /// Thrown when CallSoundPathInfo argument is null. - /// Thrown when call instance is invalid or when method failed due to invalid operation. - public Task SetCallSoundPath(CallSoundPathInfo path) - { - if (path != null) - { - TaskCompletionSource task = new TaskCompletionSource(); - IntPtr id; - id = (IntPtr)_requestId++; - _response_map[id] = (IntPtr handle, int result, IntPtr data, IntPtr key) => - { - Task resultTask = new Task(() => - { - if (result != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Error occurs during setting the call sound path, " + (TapiError)result); - task.SetException(new InvalidOperationException("Error occurs during setting the call sound path, " + (TapiError)result)); - return; - } - - task.SetResult(true); - }); - - resultTask.Start(); - resultTask.Wait(); - _response_map.Remove(key); - }; - - CallSoundPathStruct pathStruct = CallClassConversions.ConvertSoundPathToStruct(path); - int ret = Interop.Tapi.Call.SetCallSoundPath(_handle, ref pathStruct, _response_map[id], id); - if (ret != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Failed to set the call sound path, Error: " + (TapiError)ret); - TapiUtility.ThrowTapiException(ret, _handle, "http://tizen.org/privilege/telephony.admin"); - } - - return task.Task; - } - - else - { - throw new ArgumentNullException("CallSoundPathInfo argument is null"); - } - } - - /// - /// Set the call mute state asynchronously. - /// - /// The call mute status information. - /// A task indicating whether the SetCallMuteStatus method is done or not. - /// http://tizen.org/privilege/telephony.admin - /// platform - /// http://tizen.org/feature/network.telephony - /// Thrown when feature is not supported. - /// Thrown when privilege access is denied. - /// Thrown when CallMuteStatusRecord argument is null. - /// Thrown when call instance is invalid or when method failed due to invalid operation. - public Task SetCallMuteStatus(CallMuteStatusRecord record) - { - if (record != null) - { - TaskCompletionSource task = new TaskCompletionSource(); - IntPtr id; - id = (IntPtr)_requestId++; - _response_map[id] = (IntPtr handle, int result, IntPtr data, IntPtr key) => - { - Task resultTask = new Task(() => - { - if (result != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Error occurs during setting the call mute state, " + (TapiError)result); - task.SetException(new InvalidOperationException("Error occurs during setting the call mute state, " + (TapiError)result)); - return; - } - - task.SetResult(true); - }); - - resultTask.Start(); - resultTask.Wait(); - _response_map.Remove(key); - }; - - int ret = Interop.Tapi.Call.SetCallMuteStatus(_handle, record.Status, record.Path, _response_map[id], id); - if (ret != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Failed to set the call mute state, Error: " + (TapiError)ret); - TapiUtility.ThrowTapiException(ret, _handle, "http://tizen.org/privilege/telephony.admin"); - } - - return task.Task; - } - - else - { - throw new ArgumentNullException("CallMuteStatusRecord argument is null"); - } - } - - /// - /// Get the call mute state asynchronously. - /// - /// Instance of CallMuteStatusRecord. - /// http://tizen.org/privilege/telephony - /// http://tizen.org/feature/network.telephony - /// Thrown when feature is not supported. - /// Thrown when privilege access is denied. - /// Thrown when call instance is invalid or when method failed due to invalid operation. - public Task GetCallMuteStatus() - { - TaskCompletionSource task = new TaskCompletionSource(); - IntPtr id; - id = (IntPtr)_requestId++; - _response_map[id] = (IntPtr handle, int result, IntPtr data, IntPtr key) => - { - Task resultTask = new Task(() => - { - if (result != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Error occurs during getting the call mute state, " + (TapiError)result); - task.SetException(new InvalidOperationException("Error occurs during getting the call mute state, " + (TapiError)result)); - return; - } - - CallMuteStatusStruct muteStruct = Marshal.PtrToStructure(data); - CallMuteStatusRecord muteStatusRecord = new CallMuteStatusRecord(muteStruct.Path, muteStruct.Status); - task.SetResult(muteStatusRecord); - }); - - resultTask.Start(); - resultTask.Wait(); - _response_map.Remove(key); - }; - - int ret = Interop.Tapi.Call.GetCallMuteStatus(_handle, _response_map[id], id); - if (ret != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Failed to get the call mute state, Error: " + (TapiError)ret); - TapiUtility.ThrowTapiException(ret, _handle, "http://tizen.org/privilege/telephony"); - } - - return task.Task; - } - - /// - /// Get the voice privacy mode in the phone asynchronously. - /// - /// CallPrivacyMode value. - /// http://tizen.org/privilege/telephony - /// http://tizen.org/feature/network.telephony - /// Register the telephony event with proper Notification enum value which is to be listened using RegisterNotiEvent. - /// Thrown when feature is not supported. - /// Thrown when privilege access is denied. - /// Thrown when call instance is invalid or when method failed due to invalid operation. - public Task GetCallPrivacyMode() - { - TaskCompletionSource task = new TaskCompletionSource(); - IntPtr id; - id = (IntPtr)_requestId++; - _response_map[id] = (IntPtr handle, int result, IntPtr data, IntPtr key) => - { - Task resultTask = new Task(() => - { - if (result != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Error occurs during getting the voice privacy mode, " + (TapiError)result); - task.SetException(new InvalidOperationException("Error occurs during getting the voice privacy mode, " + (TapiError)result)); - return; - } - - CallPrivacyModeStruct privacyStruct = Marshal.PtrToStructure(data); - CallPrivacyMode mode = privacyStruct.Mode; - task.SetResult(mode); - }); - - resultTask.Start(); - resultTask.Wait(); - _response_map.Remove(key); - }; - - int ret = Interop.Tapi.Call.GetCallMuteStatus(_handle, _response_map[id], id); - if (ret != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Failed to get the voice privacy mode in the phone, Error: " + (TapiError)ret); - TapiUtility.ThrowTapiException(ret, _handle, "http://tizen.org/privilege/telephony"); - } - - return task.Task; - } - - /// - /// Set the voice privacy mode in the phone asynchronously. It is available only where a call exists. - /// - /// Voice privacy option mode value. - /// A task indicating whether the SetCallPrivacyMode method is done or not. - /// http://tizen.org/privilege/telephony.admin - /// platform - /// http://tizen.org/feature/network.telephony - /// Register the telephony event with proper Notification enum value which is to be listened using RegisterNotiEvent. - /// Thrown when feature is not supported. - /// Thrown when privilege access is denied. - /// Thrown when call instance is invalid or when method failed due to invalid operation. - public Task SetCallPrivacyMode(CallPrivacyMode mode) - { - TaskCompletionSource task = new TaskCompletionSource(); - IntPtr id; - id = (IntPtr)_requestId++; - _response_map[id] = (IntPtr handle, int result, IntPtr data, IntPtr key) => - { - Task resultTask = new Task(() => - { - if (result != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Error occurs during setting the voice privacy mode, " + (TapiError)result); - task.SetException(new InvalidOperationException("Error occurs during setting the voice privacy mode, " + (TapiError)result)); - return; - } - - task.SetResult(true); - }); - - resultTask.Start(); - resultTask.Wait(); - _response_map.Remove(key); - }; - - int ret = Interop.Tapi.Call.SetCallPrivacyMode(_handle, mode, _response_map[id], id); - if (ret != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Failed to set the voice privacy mode, Error: " + (TapiError)ret); - TapiUtility.ThrowTapiException(ret, _handle, "http://tizen.org/privilege/telephony.admin"); - } - - return task.Task; - } - - /// - /// Set the preferred voice subscription asynchronously. - /// - /// Preferred voice subscription value. - /// A task indicating whether the SetCallPreferredVoiceSubscription method is done or not. - /// http://tizen.org/privilege/telephony.admin - /// platform - /// http://tizen.org/feature/network.telephony - /// Thrown when feature is not supported. - /// Thrown when privilege access is denied. - /// Thrown when call instance is invalid or when method failed due to invalid operation. - public Task SetCallPreferredVoiceSubscription(CallPreferredVoiceSubscription subscription) - { - TaskCompletionSource task = new TaskCompletionSource(); - IntPtr id; - id = (IntPtr)_requestId++; - _response_map[id] = (IntPtr handle, int result, IntPtr data, IntPtr key) => - { - Task resultTask = new Task(() => - { - if (result != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Error occurs during setting preferred voice subscription, " + (TapiError)result); - task.SetException(new InvalidOperationException("Error occurs during setting preferred voice subscription, " + (TapiError)result)); - return; - } - - task.SetResult(true); - }); - - resultTask.Start(); - resultTask.Wait(); - _response_map.Remove(key); - }; - - int ret = Interop.Tapi.Call.SetCallPreferredVoiceSubs(_handle, subscription, _response_map[id], id); - if (ret != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Failed to set preferred voice subscription, Error: " + (TapiError)ret); - TapiUtility.ThrowTapiException(ret, _handle, "http://tizen.org/privilege/telephony.admin"); - } - - return task.Task; - } - - /// - /// Get the preferred voice subscription. - /// - /// CallPreferredVoiceSubscription value. - /// http://tizen.org/privilege/telephony - /// http://tizen.org/feature/network.telephony - /// Thrown when feature is not supported. - /// Thrown when privilege access is denied. - /// Thrown when call instance is invalid or when method failed due to invalid operation. - public CallPreferredVoiceSubscription GetCallPreferredVoiceSubscription() - { - CallPreferredVoiceSubscription subscription; - int ret = Interop.Tapi.Call.GetCallPreferredVoiceSubs(_handle, out subscription); - if (ret != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Failed to get preferred voice subscription, Error: " + (TapiError)ret); - TapiUtility.ThrowTapiException(ret, _handle, "http://tizen.org/privilege/telephony"); - } - - return subscription; - } - } -} diff --git a/src/Tizen.Tapi/Tizen.Tapi/CallData.cs b/src/Tizen.Tapi/Tizen.Tapi/CallData.cs deleted file mode 100755 index a47b1207f..000000000 --- a/src/Tizen.Tapi/Tizen.Tapi/CallData.cs +++ /dev/null @@ -1,928 +0,0 @@ -/* - * 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.Collections.Generic; - -namespace Tizen.Tapi -{ - /// - /// A class containing information about call idle status notification data. - /// - public class CallIdleStatusNotificationData - { - internal uint Id; - internal CallEndCause Cause; - - internal CallIdleStatusNotificationData() - { - } - - /// - /// Notification id. - /// - /// Notificatio id in unsigned integer format. - public uint NotiId - { - get - { - return Id; - } - } - - /// - /// End cause for the call indicates whether the call is released normally or due to some other cause. - /// - /// En cause enum value. - public CallEndCause EndCause - { - get - { - return Cause; - } - } - } - - /// - /// A class which contains calling name information. - /// - public class CallerNameInfo - { - internal CallNameMode Mode; - internal string NameData; - - internal CallerNameInfo() - { - } - - /// - /// Display mode of the name. - /// - /// Enum value for call name mode - public CallNameMode NameMode - { - get - { - return Mode; - } - } - - /// - /// Calling party name string. - /// - /// String value representing calling party name. - public string Name - { - get - { - return NameData; - } - } - } - - /// - /// A class which contains details about call information. - /// - public class CallIncomingInfo - { - internal uint Handle; - internal CallType Type; - internal string Number; - internal CallerNameInfo Name; - internal CallCliMode Cli; - internal CallNoCliCause Cause; - internal bool IsFwded; - internal CallActiveLine Line; - - internal CallIncomingInfo() - { - } - - /// - /// Call handle indicates the handle of the call for the application. - /// - /// Call handle represented in unsigned integer format. - public uint CallHandle - { - get - { - return Handle; - } - } - - /// - /// Call type. - /// - /// Call type indicating whether the requested call is a voice or video call. - public CallType CallType - { - get - { - return Type; - } - } - - /// - /// Caller number, null terminated ASCII. - /// - /// A string representing calling party number. - public string CallerNumber - { - get - { - return Number; - } - } - - /// - /// Call name info. If there is no information from the network, this information will be null. - /// - /// A CallerNameInfo which contains information about the calling party name. - public CallerNameInfo NameInfo - { - get - { - return Name; - } - } - - /// - /// CLI mode. - /// - /// Enum value representing CLI mode. - public CallCliMode CliMode - { - get - { - return Cli; - } - } - - /// - /// No CLI cause. - /// - /// Enum value representing the cause for no CLI. - public CallNoCliCause CliCause - { - get - { - return Cause; - } - } - - /// - /// Checks whether the incoming call is a forwarded call or not. - /// - /// True or false. If the incoming call is a forwarded call, then true else false. - public bool IsForwarded - { - get - { - return IsFwded; - } - } - - /// - /// Current Active Line. - /// - /// Enum value representing call active line. - public CallActiveLine ActiveLine - { - get - { - return Line; - } - } - } - - /// - /// A class which contains information about call line control. - /// - public class CallRecordLineControl - { - internal byte PolarityInc; - internal byte Toggle; - internal byte ReversePol; - internal byte PowerTime; - - internal CallRecordLineControl() - { - } - - /// - /// Polarity included. - /// - /// Polarity value represented in byte format. - public byte PolarityIncluded - { - get - { - return PolarityInc; - } - } - - /// - /// Toggle mode. - /// - /// Toggle mode represented in byte format. - public byte ToggleMode - { - get - { - return Toggle; - } - } - - /// - /// Reverse polarity. - /// - /// Reverse polarity value represented in byte format. - public byte ReversePolarity - { - get - { - return ReversePol; - } - } - - /// - /// Power denial time. - /// - /// Time value in byte which represents power denial time. - public byte PowerDenialTime - { - get - { - return PowerTime; - } - } - } - - /// - /// A class which contains information about call record. - /// - public class CallRecord - { - internal uint Id; - internal CallRecordType Type; - internal string Name; - internal string Number; - internal CallRecordLineControl LineCtrl; - - internal CallRecord() - { - } - - /// - /// Call id - /// - /// Call id which is represented in unsigned integer format. - public uint CallId - { - get - { - return Id; - } - } - - /// - /// Call record type. - /// - /// An enum value representing the call record type. - public CallRecordType CallRecordType - { - get - { - return Type; - } - } - - /// - /// Name record. - /// - /// - /// This value will be filled only if CallRecordType is Name, otherwise it is null. - /// - /// Name record represented in string. - public string NameRecord - { - get - { - return Name; - } - } - - /// - /// Number record. - /// - /// - /// This value will be filled only if CallRecordType is Record, otherwise it is null. - /// - /// Number record reprensented in string. - public string NumberRecord - { - get - { - return Number; - } - } - - /// - /// Gets the line control info. - /// - /// - /// This value will be filled only if CallRecordType is LineControl, otherwise it is null. - /// - /// An instance of CallRecordLineControl class. - public CallRecordLineControl LineControlInfo - { - get - { - return LineCtrl; - } - } - } - - /// - /// A class which contains information about call signal notification. - /// - public class CallSignalNotification - { - internal CallAlertSignal Signal; - internal CallAlertPitch Pitch; - internal CallToneSignal Tone; - internal CallIsdnAlertSignal Isdn; - internal CallIs54bAlertSignal Is54b; - - internal CallSignalNotification() - { - } - - /// - /// Gets the call signal type. - /// - /// Signal type of the call represented as CallAlertSignal enum. - public CallAlertSignal SignalType - { - get - { - return Signal; - } - } - - /// - /// Gets the call pitch type. - /// - /// Pitch type of the call represented as CallAlertPitch enum. - public CallAlertPitch PitchType - { - get - { - return Pitch; - } - } - - /// - /// Gets the call signal tone type. - /// - /// - /// This value will be filled only if SignalType is Tone. - /// - /// Signal tone type of the call represented in CallToneSignal enum. - public CallToneSignal ToneType - { - get - { - return Tone; - } - } - - /// - /// Gets the signal ISDN Alert type. - /// - /// - /// This value will be filled only if SignalType is IsdnAlert. - /// - /// Signal ISDN alert type of the call represented in CallIsdnAlertSignal enum. - public CallIsdnAlertSignal IsdnAlertType - { - get - { - return Isdn; - } - } - - /// - /// Gets the signal IS54B alert type. - /// - /// - /// This value will be filled only if SignalType is Is54bAlert. - /// - /// Signal IS54B alerty type of the call represented in CallIs54bAlertSignal enum. - public CallIs54bAlertSignal Is54bAlertType - { - get - { - return Is54b; - } - } - } - - /// - /// A class which contains information about call upgrade/downgrade request of VoLTE call. - /// - public class CallUpgradeDowngradeRequestNoti - { - internal int Handle; - internal CallConfigType Type; - - internal CallUpgradeDowngradeRequestNoti() - { - } - - /// - /// Gets the call handle. - /// - /// Call handle value represented in integer format. - public int CallHandle - { - get - { - return Handle; - } - } - - /// - /// Gets the call upgrade/downgrade config type. - /// - /// Call upgrade/downgrade type represented in CallConfigType enum. - public CallConfigType UpgradeType - { - get - { - return Type; - } - } - } - - /// - /// A class which contains information about an outgoing call. - /// - public class CallInformation - { - private CallType _type; - private EmergencyType _etype; - private string _number; - private CallInformation() - { - } - - /// - /// A parameterized constructor of CallInformation. - /// - /// Type of call(voice, data, video, emergency). - /// Emergency category. - /// Destination phone number. - public CallInformation(CallType type, EmergencyType etype, string phoneNumber) - { - _type = type; - _etype = etype; - _number = phoneNumber; - } - - internal CallType Type - { - get - { - return _type; - } - } - - internal EmergencyType EType - { - get - { - return _etype; - } - } - - internal string PhoneNumber - { - get - { - return _number; - } - } - } - - /// - /// A class which contains information about call end response data. - /// - public class CallEndData - { - private CallEndType _type; - private uint _id; - - private CallEndData() - { - } - - internal CallEndData(CallEndType type, uint id) - { - _type = type; - _id = id; - } - - /// - /// End type. - /// - public CallEndType Type - { - get - { - return _type; - } - } - - /// - /// Id. - /// - public uint Id - { - get - { - return _id; - } - } - } - - /// - /// A class which contains information about burst DTMF in CDMA. - /// - public class CallBurstDtmfData - { - private string _dtmf; - private CallDtmfPulseWidth _width; - private CallDtmfDigitInterval _interval; - - private CallBurstDtmfData() - { - } - - /// - /// A parameterized constructor of CallBurstDtmfData. - /// - /// Burst DTMF string. - /// DTMF Pulse Width. - /// DTMF Inter Digit Interval. - public CallBurstDtmfData(string dtmf, CallDtmfPulseWidth width, CallDtmfDigitInterval interval) - { - _dtmf = dtmf; - _width = width; - _interval = interval; - } - - internal string Dtmf - { - get - { - return _dtmf; - } - } - - internal CallDtmfPulseWidth Width - { - get - { - return _width; - } - } - - internal CallDtmfDigitInterval Interval - { - get - { - return _interval; - } - } - } - - /// - /// A class which contains information about call status. - /// - public class CallStatus - { - private int _handle; - private bool _isMoCall; - private string _number; - private CallType _type; - private CallState _state; - private bool _isConferenceState; - private bool _isVolteCall; - internal CallStatus() - { - } - - /// - /// Call handle. - /// - public int CallHandle - { - get - { - return _handle; - } - - internal set - { - _handle = value; - } - } - - /// - /// Status will be true for MO calls. If MT call, then its false. - /// - public bool IsMoCall - { - get - { - return _isMoCall; - } - - internal set - { - _isMoCall = value; - } - } - - /// - /// Mobile number. - /// - public string PhoneNumber - { - get - { - return _number; - } - - internal set - { - _number = value; - } - } - - /// - /// Type of call(voice, data, emergency). - /// - public CallType Type - { - get - { - return _type; - } - - internal set - { - _type = value; - } - } - - /// - /// Current call state. - /// - public CallState State - { - get - { - return _state; - } - - internal set - { - _state = value; - } - } - - /// - /// Whether call is in conference state. - /// - public bool IsConferenceState - { - get - { - return _isConferenceState; - } - - internal set - { - _isConferenceState = value; - } - } - - /// - /// Whether call is volte call. - /// - public bool IsVolteCall - { - get - { - return _isVolteCall; - } - - internal set - { - _isVolteCall = value; - } - } - } - - /// - /// A class that contains call volume info. - /// - public class CallVolumeRecord - { - private SoundDevice _device; - private SoundType _type; - private SoundVolume _volume; - private CallVolumeRecord() - { - } - - /// - /// A parameterized constructor of CallVolumeRecord. - /// - /// Call sound device. - /// Call sound type. - /// Call sound volume. - public CallVolumeRecord(SoundDevice device, SoundType type, SoundVolume volume) - { - _device = device; - _type = type; - _volume = volume; - } - - /// - /// Call sound device info. - /// - public SoundDevice Device - { - get - { - return _device; - } - } - - /// - /// Call sound type info. - /// - public SoundType Type - { - get - { - return _type; - } - } - - /// - /// Call sound volume info. - /// - public SoundVolume Volume - { - get - { - return _volume; - } - } - } - - /// - /// A class which contains call volume info reponse data. - /// - public class CallVolumeInfo - { - private uint _id; - private IEnumerable _recordList; - - private CallVolumeInfo() - { - } - - internal CallVolumeInfo(uint id, IEnumerable list) - { - _id = id; - _recordList = list; - } - - /// - /// Record number. - /// - public uint RecordId - { - get - { - return _id; - } - } - - /// - /// Volume info record. - /// - public IEnumerable Records - { - get - { - return _recordList; - } - } - } - - /// - /// A class which contains call sound path and volume information. - /// - public class CallSoundPathInfo - { - private SoundPath _path; - private ExtraVolume _exVolume; - private CallSoundPathInfo() - { - } - - /// - /// A parameterized constructor of CallSoundPathInfo. - /// - /// Sound path. - /// Extra volume status. - public CallSoundPathInfo(SoundPath path, ExtraVolume exVolume) - { - _path = path; - _exVolume = exVolume; - } - - internal SoundPath Path - { - get - { - return _path; - } - } - - internal ExtraVolume ExVolume - { - get - { - return _exVolume; - } - } - } - - /// - /// A class which contains call mute status reponse data. - /// - public class CallMuteStatusRecord - { - private SoundMutePath _path; - private SoundMuteStatus _status; - private CallMuteStatusRecord() - { - } - - /// - /// A parameterized constructor of CallMuteStatusRecord. - /// - /// Mute path. - /// Mute status. - public CallMuteStatusRecord(SoundMutePath path, SoundMuteStatus status) - { - _path = path; - _status = status; - } - - public SoundMutePath Path - { - get - { - return _path; - } - } - - public SoundMuteStatus Status - { - get - { - return _status; - } - } - } -} diff --git a/src/Tizen.Tapi/Tizen.Tapi/CallEnumerations.cs b/src/Tizen.Tapi/Tizen.Tapi/CallEnumerations.cs deleted file mode 100755 index 37b7671b7..000000000 --- a/src/Tizen.Tapi/Tizen.Tapi/CallEnumerations.cs +++ /dev/null @@ -1,1597 +0,0 @@ -/* - * 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. - */ - -namespace Tizen.Tapi -{ - /// - /// Enumeration for call end cause. - /// - public enum CallEndCause - { - /// - /// No Cause. - /// - None = 0x00, - /// - /// Unassigned Number. - /// - UnassignedNumber, - /// - /// No Route to Destination. - /// - NoRouteToDestination, - /// - /// Channel Unacceptable. - /// - ChannelUnaccept, - /// - /// Operator Determined Barring. - /// - OperatorBarring, - /// - /// Normal Call Clearing. - /// - NormalCallClearing, - /// - /// User Busy. - /// - UserBusy, - /// - /// No user responding. - /// - NoUserRespond, - /// - /// User Alerting no Answer. - /// - UserAlertNoAnswer, - /// - /// Call Rejected. - /// - CallRejected, - /// - /// Number Changed. - /// - NumberChanged, - /// - /// Non Selected User Clearing. - /// - NonSelectUserClearing, - /// - /// Destination out of Order. - /// - DestinationOutOfOrder, - /// - /// Invalid Number Format. - /// - InvalidNumberFormat, - /// - /// Facility Rejected. - /// - FacilityRejected, - /// - /// Response to Status Enquiry. - /// - ResponseStatusEnquiry, - /// - /// Normal Unspecified. - /// - NormalUnspecified, - /// - /// No Circuit Channel Available. - /// - NoAvailableChannel, - /// - /// Network out of Order. - /// - NetworkOutOfOrder, - /// - /// Temporary Failure. - /// - TemporaryFailure, - /// - /// Switching Equipment Congestion. - /// - SwitchEquipmentCongestion, - /// - /// Access Information Discarded. - /// - AccessInfoDiscarded, - /// - /// Requested Circuit channel not available. - /// - NotAvailableRequestedChannel, - /// - /// Resources unavailable and unspecified. - /// - ResourceUnavailableUnspecified, - /// - /// Quality of service unavailable. - /// - ServiceQualityUnavailable, - /// - /// Requested facility not subscribed. - /// - NotSubscribedRequestedFacility, - /// - /// Incoming call barred within CUG. - /// - IncomingCallBarredWithinCug, - /// - /// Bearer capability not Authorised. - /// - BearerCapabilityUnauthorised, - /// - /// Bearer capability not presently Available. - /// - BearerCapabilityNotAvailable, - /// - /// Service or Option not available. - /// - ServiceOptionNotAvailable, - /// - /// Service not implemented. - /// - BearerServiceNotImplemented, - /// - /// ACM GEQ ACMAX. - /// - AcmGeqAcmax, - /// - /// Requested facility not implemented. - /// - RequestedFacilityNotImplemented, - /// - /// Restricted digital info BC not available - /// - OnlyRestrictedDigitalBcInfoAvailable, - /// - /// Service or Option not Implemented. - /// - ServiceOptionNotImplemented, - /// - /// Transaction ID value. - /// - TransactionIdValue, - /// - /// Not a member of CUG. - /// - UserNotCugMember, - /// - /// Incompatible Destination. - /// - IncompatibleDestination, - /// - /// Transit Network selection. - /// - TransitNetworkSelect, - /// - /// Semantically Incorrect message. - /// - SemanticIncorrectMessage, - /// - /// Invalid Mandatory Message. - /// - InvalidMandatoryInfo, - /// - /// Message Type Non Existent. - /// - MessageTypeNotExist, - /// - /// Message type not compatible with Prot state. - /// - MessageTypeNotCompatibleWithProtState, - /// - /// IE non exitent or not implemented. - /// - IeNotExistOrNotImplemented, - /// - /// Conditional IE error. - /// - ConditionalIeError, - /// - /// Not Compatible with protocol state. - /// - NotCompatibleWithProtocolState, - /// - /// Recovery on timer expiry. - /// - RecoveryOnTimeExpiry, - /// - /// Protocol error unspecified. - /// - ProtocolErrorUnspecified, - /// - /// Interworking unspecified. - /// - InterworkingUnspecified, - /// - /// Reorder. - /// - Reorder, - /// - /// End unspecified. - /// - EndUnspecified = 128, - /// - /// IMSI unknown in HLR. - /// - RejectCauseImsiUnknownInHlr, - /// - /// Illegal MS. - /// - RejectCauseIllegalMs, - /// - /// IMSI unknown in VLR. - /// - RejectCauseImsiUnknownInVlr, - /// - /// IMEI not accepted. - /// - RejectCauseImeiNotAccepted, - /// - /// Illegal ME. - /// - RejectCauseIllegalMe, - /// - /// GPRS service not allowed. - /// - RejectCauseGprsServiceNotAllowed, - /// - /// GPRS services and Non-GPRS services not allowed. - /// - RejectCauseGprsAndNonGprsServiceNotAllowed, - /// - /// MS device cannot be derived by the network. - /// - RejectCauseMsIdentityNotDerivedByNetwork, - /// - /// Implicitly detached. - /// - RejectCauseImplicitlyDetached, - /// - /// PLMN not allowed. - /// - RejectCausePlmnNotAllowed, - /// - /// LA not allowed. - /// - RejectCauseLaNotAllowed, - /// - /// National roaming not allowed. - /// - RejectCauseNationalRoamingNotAllowed, - /// - /// GPRS services not allowed in this PLMN. - /// - RejectCauseGprsServiceNotAllowedInPlmn, - /// - /// No suitable cells in the LA. - /// - RejectCauseNoSuitableCellsInLa, - /// - /// MSC temporarily not reachable. - /// - RejectCauseMscTempNotReachable, - /// - /// Network unavailable. - /// - RejectCauseNetworkFailure, - /// - /// MAC failure. - /// - RejectCauseMacFailure, - /// - /// SYNCH failure. - /// - RejectCauseSynchFailure, - /// - /// Congestion. - /// - RejectCauseCongestion, - /// - /// GSM Auth unaccepted. - /// - RejectCauseGsmAuthUnaccepted, - /// - /// Service option not supported. - /// - RejectCauseServiceOptionNotSupported, - /// - /// REQ_SERV option not suscribed. - /// - RejectCauseReqServOptionNotSubscribed, - /// - /// Service OPT out of order. - /// - RejectCauseServiceOptOutOfOrder, - /// - /// Call cannot be identified. - /// - RejectCauseCallUnidentified, - /// - /// No PDP context Activated. - /// - RejectCauseNoPdpContextActivated, - /// - /// Retry upon entry into a new call min value. - /// - RejectCauseRetryUponEntryToNewCallMinValue, - /// - /// Retry upon entry into a new call max value. - /// - RejectCauseRetryUponEntryToNewCallMaxValue, - /// - /// Semantically incorret message. - /// - RejectCauseSemanticIncorrectMessage, - /// - /// Invalid mandatory information. - /// - RejectCauseInvalidMandatoryInfo, - /// - /// Message type non-existant. - /// - RejectCauseMessageTypeNotExist, - /// - /// Message type not COMP PRT ST. - /// - RejectCauseMessageTypeNotCompPrtSt, - /// - /// IE non existent. - /// - RejectCauseIeNotExist, - /// - /// MSG not compatible protocol state. - /// - RejectCauseMessageNotCompatibleProtocolState, - /// - /// REJ unspecified. - /// - RejectCauseUnspecified, - /// - /// RR release indication. - /// - RejectCauseRrReleaseInd, - /// - /// Random Access Failure. - /// - RejectCauseRandomAccessFailure, - /// - /// RRC release indication. - /// - RejectCauseRrcReleaseInd, - /// - /// RRC close session indication. - /// - RejectCasueRrcCloseInd, - /// - /// RRC open session failure. - /// - RejectCauseRrcOpenSessionFailure, - /// - /// Low level failure. - /// - RejectCauseLowLevelFail, - /// - /// Low level failure redial not alowed. - /// - RejectCauseLowLevelFailRedialNotAllowed, - /// - /// Low level immediate retry. - /// - RejectCauseLowLevelRetry, - /// - /// Invalid SIM. - /// - RejectCauseInvalidSim, - /// - /// No service. - /// - RejectCauseNoService, - /// - /// Timer T3230 expiry. - /// - RejectCauseTimerT3230Expiry, - /// - /// No cell available. - /// - RejectCauseNoCellAvailable, - /// - /// Wrong state. - /// - RejectCauseWrongState, - /// - /// Access class blocked. - /// - RejectCauseAccessClassBlocked, - /// - /// Abort Message received. - /// - RejectCauseAbortMessageReceived, - /// - /// Other cause. - /// - OtherCause, - /// - /// Timer T303 expiry. - /// - RejectCauseTimerT303Expiry, - /// - /// Rejected due to unavailibilty of resources. - /// - RejectCauseNoResources, - /// - /// MM release pending. - /// - RejectCauseMmReleasePending, - /// - /// Invalid user data. - /// - RejectCauseInvalidUserData, - /// - /// Maximum End Cause limit for GSM/WCDMA. - /// - EndCauseMax = 255, - /// - /// Call Released by User. - /// - CdmaEndCauseReleasedByUser = 0x1001, - /// - /// Call Released by Network. - /// - CdmaEndCauseReleasedByNet, - /// - /// Call Released because the network is busy. - /// - CdmaEndCauseNetworkBusy, - /// - /// Call Released because of No Service area. - /// - CdmaEndCauseNoService, - /// - /// Call Released because of Fading. - /// - CdmaEndCauseFading, - /// - /// Call Released because of reorder. - /// - CdmaEndCauseReleaseByReorder, - /// - /// Call Released because of intercept. - /// - CdmaEndCauseReleaseByIntercept, - /// - /// Call Released because of silent zone retry. - /// - CdmaEndCauseSilentZoneRetry, - /// - /// Call Released because of OTA call failure. - /// - CdmaEndCauseOtaCallFail, - /// - /// Call Released because phone is offline. - /// - CdmaEndCausePhoneOffline, - /// - /// Call Released because CDMA is locked. - /// - CdmaEndCauseCdmaLocked, - /// - /// Call Released because of the flash-is-in-progress error. - /// - CdmaEndCauseFlashInProgressError, - /// - /// Call Released because of the e911 mode. - /// - CdmaEndCauseE911ModeError, - /// - /// Call Released by Others. - /// - CdmaEndCauseOthers, - /// - /// Maximum End Cause limit for CDMA. - /// - CdmaEndCauseMax - } - - /// - /// Enumeration for call type to be used by applications. - /// - public enum CallType - { - /// - /// Voice call type. - /// - Voice, - /// - /// Data call type - (for modem, fax, packet, and other such calls). - /// - Data, - /// - /// Emergency call type. - /// - Emergency - } - - /// - /// Enumeration for the call name mode. - /// - public enum CallNameMode - { - /// - /// This identifier refers to presenting the calling party's name identity to the called party. - /// - Available = 0, - /// - /// This identifier refers to restricting the name identity of the calling party from being presented to the called party. - /// - Restricted = 1, - /// - /// This identifier refers to the unavailability of the calling party's name identity from being offered to the called party. - /// - Unavailable = 2, - /// - /// This identifier refers to offering the calling party's name identity to the called party with which the presentation restriction is overridden. - /// - AvailRestricted = 3 - } - - /// - /// Enumeration for the "Cli mode" value. - /// - public enum CallCliMode - { - /// - /// Presentation Allowed. - /// - PresentationAvailable, - /// - /// Presentation Restricted. - /// - PresentationRestricted, - /// - /// Number not available. - /// - NumberUnavailable, - /// - /// Presentation default. - /// - PresentationDefault - } - - /// - /// Enumeration for "No Cli cause" value. - /// - public enum CallNoCliCause - { - /// - /// None. - /// - None = -1, - /// - /// Unavailable. - /// - Unavailable = 0x00, - /// - /// Rejected by user. - /// - RejectByUser = 0x01, - /// - /// Other services. - /// - InteractionOtherServices = 0x02, - /// - /// Coin line phone. - /// - CoinLinePayPhone = 0x03 - } - - /// - /// Enumeration for call active line(IN GSM ONLY: call identification number). - /// - public enum CallActiveLine - { - /// - /// Line 1. - /// - Line1, - /// - /// Line 2. - /// - Line2 - } - - /// - /// Enumeration for the call record info type. - /// - public enum CallRecordType - { - /// - /// Name type. - /// - Name, - /// - /// Number type. - /// - Number, - /// - /// Line control type. - /// - LineControl - } - - /// - /// Enumeration for the voice privacy option mode. (CDMA only). - /// - public enum CallPrivacyMode - { - /// - /// Standard mode. - /// - Standard = 0x00, - /// - /// Enhanced mode. - /// - Enhanced - } - - /// - /// Enumeration for the OTASP Status. (CDMA only) - /// - public enum CallOtaspStatus - { - /// - /// SPL unlocked ok. - /// - SplUnlockedOk = 0x01, - /// - /// A-Key excess ok. - /// - AKeyExcessOk, - /// - /// SSD update ok. - /// - SsdUpdateOk, - /// - /// NAM download ok. - /// - NamDownloadOk, - /// - /// MDN download ok. - /// - MdnDownloadOk, - /// - /// IMSI download ok. - /// - ImsiDownloadOk, - /// - /// PRL download ok. - /// - PrlDownloadOk, - /// - /// Commit ok. - /// - CommitOk, - /// - /// Programming ok. - /// - ProgrammingOk, - /// - /// Success. - /// - Success, - /// - /// Unsuccess. - /// - Unsuccess, - /// - /// OTAPA verify ok. - /// - OtapaVerifyOk, - /// - /// Progress. - /// - Progress, - /// - /// SPC excess failure. - /// - SpcExcessFailure, - /// - /// Lock code password set. - /// - LockCodePasswordSet - } - - /// - /// Enumeration for the OTAPA status. (CDMA only) - /// - public enum CallOtapaStatus - { - /// - /// Stop. - /// - Stop = 0x00, - /// - /// Start. - /// - Start - } - - /// - /// Enumeration for call sound path. - /// - public enum SoundPath - { - /// - /// Audio path is handset. - /// - Handset = 0x01, - /// - /// Audio path is handset. - /// - Headset = 0x02, - /// - /// Audio path is Handsfree. - /// - Handsfree = 0x03, - /// - /// Audio path is bluetooth. - /// - Bluetooth = 0x04, - /// - /// Audio path is stereo bluetooth. - /// - StereoBluetooth = 0x05, - /// - /// Audio path is speaker phone. - /// - SpeakerPhone = 0x06, - /// - /// Audio path is headset_3_5PI. - /// - Headset35Pi = 0x07, - /// - /// Audio path Bluetooth NSEC is off. - /// - BluetoothNsecOff = 0x08, - /// - /// Audio path Mic one. - /// - Mic1 = 0x09, - /// - /// Audio path Bluetooth Mic two. - /// - Mic2 = 0x0A, - /// - /// Audio path is Bluetooth WB. - /// - BluetoothWb = 0x0B, - /// - /// Audio path is BT nsec off WB. - /// - BluetoothNsecOffWb = 0x0C, - /// - /// Audio path is headset HAC. - /// - HeadsetHac = 0x0D, - /// - /// Audio path is Bikemode Near. - /// - BikemodeNear = 0x17, - /// - /// Audio path is Bikemode Far. - /// - BikemodeFar = 0x18, - /// - /// Audio path is VoLTE handset. - /// - VolteHandset = 0x1F, - /// - /// Audio path is VoLTE headset. - /// - VolteHeadset = 0x20, - /// - /// Audio path is VoLTE Handsfree. - /// - VolteSpeaker = 0x21, - /// - /// Audio path is VoLTE bluetooth. - /// - VolteBluetooth = 0x22, - /// - /// Audio path is VoLTE stereo bluetooth. - /// - VolteStereoBluetooth = 0x23, - /// - /// Audio path is VoLTE speaker phone. - /// - VolteHeadPhone = 0x24, - /// - /// Audio path is VoLTE headset_3_5PI. - /// - VolteHeadset35Pi = 0x25, - /// - /// Audio path VoLTE Bluetooth NSEC is off. - /// - VolteBluetoothNsecOff = 0x26, - /// - /// Audio path is VoLTE Bluetooth WB. - /// - VolteBluetoothWb = 0x27, - /// - /// Audio path is VoLTE BT nsec off WB. - /// - VolteBluetoothNsecOffWb = 0x28, - /// - /// Audio path is VoLTE handset HAC. - /// - VolteHandsetHac = 0x29, - /// - /// Audio path is call forwarding. - /// - CallForward = 0x32, - /// - /// Audio path is Loopback Mic1+Ear. - /// - HeadsetMic1 = 0x33, - /// - /// Audio path is Loopback Mic2+Ear. - /// - HeadsetMic2 = 0x34, - /// - /// Audio path is Loopback Mic3+Ear. - /// - HeadsetMic3 = 0x35 - } - - /// - /// Enumeration for the Alert Signal Type. (CDMA only) - /// - public enum CallAlertSignal - { - /// - /// Tone. - /// - Tone = 0x00, - /// - /// ISDN Alerting. - /// - IsdnAlert, - /// - /// IS54B Alerting. - /// - Is54bAlert, - /// - /// Reserved. - /// - Reserved - } - - /// - /// Enumeration for the Alert Pitch Type. (CDMA only) - /// - public enum CallAlertPitch - { - /// - /// Alert Pitch Medium. - /// - Medium = 0x00, - /// - /// Alert Pitch High. - /// - High, - /// - /// Alert Pitch Low. - /// - Low, - /// - /// Reserved. - /// - Reserved - } - - /// - /// Enumeration for the signals specific to the alert signal type. (CDMA only) - /// - public enum CallToneSignal - { - /// - /// Dial. - /// - Dial = 0x00, - /// - /// Ringback Tone ON. - /// - RingbackToneOn, - /// - /// Intercept Tone ON. - /// - InterceptToneOn, - /// - /// Abbreviation Tone. - /// - AbbreviationTone, - /// - /// Network Congestion Tone ON. - /// - NetworkCongestionToneOn, - /// - /// Abbreviation Network Congestion. - /// - AbbreviationNetworkCongestion, - /// - /// Busy Tone ON> - /// - BusyToneOn, - /// - /// CFRM Tone ON. - /// - CfrmToneOn, - /// - /// Answer Tone ON. - /// - AnswerToneOn, - /// - /// Call Waiting Tone ON. - /// - CallWaitingToneOn, - /// - /// Pipe Tone ON. - /// - PipeToneOn, - /// - /// Tone OFF. - /// - Off - } - - /// - /// Enumeration for the call ISDN Alert signal. (CDMA only) - /// - public enum CallIsdnAlertSignal - { - /// - /// Normal. - /// - Normal = 0x00, - /// - /// Inter group. - /// - InterGroup, - /// - /// Special Priority. - /// - SpecialPriority, - /// - /// ISDN Reserved1. - /// - IsdnReserved1, - /// - /// Ping Ring. - /// - PingRing, - /// - /// ISDN Reserved2. - /// - IsdnReserved2, - /// - /// ISDN Reserved3. - /// - IsdnReserved3, - /// - /// ISDN Reserved4. - /// - IsdnReserved4, - /// - /// Alert OFF. - /// - Off - } - - /// - /// Enumeration for the call IS54B Alert signal types. - /// - public enum CallIs54bAlertSignal - { - /// - /// No Tone. - /// - NoTone = 0x00, - /// - /// Long. - /// - Long, - /// - /// Short Short. - /// - ShortShort, - /// - /// Short Short Long. - /// - ShortShortLong, - /// - /// Short Short 2. - /// - ShortShort2, - /// - /// Short Long Short. - /// - ShortLongShort, - /// - /// Short Short Short Short. - /// - ShortShortShortShort, - /// - /// PBX Long. - /// - PbxLong, - /// - /// PBX(Private Branch Exchange) Short Short. - /// - PbxShortShort, - /// - /// PBX Short Short Long. - /// - PbxShortShortLong, - /// - /// PBX Short Long Short. - /// - PbxShortLongShort, - /// - /// PBX Short Short Short Short. - /// - PbxShortShortShortShort, - /// - /// PIP PIP PIP PIP. - /// - PipPipPipPip - } - - /// - /// Enumeration for call sound ringback tone notification data. - /// - public enum CallSoundRingbackNoti - { - /// - /// Ringback Tone End. - /// - End, - /// - /// Ringback Tone Start. - /// - Start - } - - /// - /// Enumeration for call sound WBAMR notification data. - /// - public enum CallSoundWbamrNoti - { - /// - /// Status OFF. - /// - Off, - /// - /// Status ON. - /// - On, - /// - /// Status OFF 16k. - /// - Off16k, - /// - /// Status ON 8k. - /// - On8k - } - - /// - /// Enumeration for call sound noise reduction. - /// - public enum CallSoundNoiseReduction - { - /// - /// Sound noise reduction off. - /// - Off, - /// - /// Sound noise reduction on. - /// - On - } - - /// - /// Enumeration for call preferred voice subscription. - /// - public enum CallPreferredVoiceSubscription - { - /// - /// Unknown status. - /// - Unknown = -1, - /// - /// Current network. - /// - CurrentNetwork = 0, - /// - /// Ask Always. - /// - AskAlways, - /// - /// Sim 1. - /// - Sim1, - /// - /// Sim 2. - /// - Sim2 - } - - /// - /// Enumeration for specifying type for call upgrade/downgrade. - /// - public enum CallConfigType - { - /// - /// Call type is invalid. - /// - Invalid = -1, - /// - /// Call type is Audio. - /// - Audio = 2, - /// - /// Call type is Video Share TX. - /// - VideoShareTx = 3, - /// - /// Call type is Video Share RX. - /// - VideoShareRx = 4, - /// - /// Call type is Inbound Video Call. - /// - InboundVideoCall = 5, - /// - /// Call type is HD Video. - /// - HdVideo = 6, - /// - /// Call type is Video Conference. - /// - VideoConference = 7, - /// - /// Call type is QCIF Video Conference. - /// - QcifVideoConference = 8, - /// - /// Call type is QVGA. - /// - QvgaVideo = 9, - /// - /// Call type is QCIF Video. - /// - QcifVideo = 10, - /// - /// Call type is tty Full. - /// - TtyFull = 11, - /// - /// Call type is tty HCO. - /// - TtyHco = 12, - /// - /// Call type is tty VCO. - /// - TtyVco = 13, - /// - /// Call type USSD. - /// - Ussd = 14, - /// - /// Call type is HDVideo Land. - /// - HdVideoLand = 15, - /// - /// Call type is E911 - Emergency Call. - /// - E911 = 20, - /// - /// Call type is Audio conference. - /// - AudioConference = 21, - /// - /// Call type is E911 Emergency video call. - /// - E911Video = 22, - /// - /// Call type is E911 Emergency video call HD. - /// - E911VideoHd = 23, - /// - /// Call type is E911 Emergency video call HD Land. - /// - E911VideoHdLand = 24, - /// - /// Call type is E911 Emergency video call Land. - /// - E911VideoLand = 25, - /// - /// Call type is E911 Emergency video call HD QVGA Land. - /// - E911VideoHdQvgaLand = 26, - /// - /// Call type is CIF Video Call. - /// - CifVideo = 27, - /// - /// Call type is HD 720 video call. - /// - Hd720Video = 28, - /// - /// Call type is E911 video hold call. - /// - VideoHold = 29, - /// - /// Call type is switch VOIP to VT call. - /// - VoipToVtInProgress = 30 - } - - /// - /// Enumeration for the emergency call category type. - /// - public enum EmergencyType - { - /// - /// Default case - /// - Default = 0x00, - /// - /// Police emergency - /// - Police = 0x01, - /// - /// Ambulance emergency - /// - Ambulance = 0x02, - /// - /// Firebrigade emergency - /// - FireBrigade = 0x04, - /// - /// Marineguard emergency - /// - MarineGuard = 0x08, - /// - /// Mountain rescue emergency - /// - MountainRescue = 0x10, - /// - /// Manual emergency call - /// - ManualECall = 0x20, - /// - /// Automatic emergency call - /// - AutoECall = 0x40, - /// - /// Unspecified emergency - /// - None = 0xff - } - - /// - /// Enumeration for the call answer type. - /// - public enum CallAnswerType - { - /// - /// Answer an incoming call when there are no current active calls. - /// - Accept, - /// - /// Reject the incoming call. - /// - Reject, - /// - /// Release current active call and accept the waiting call. - /// - Replace, - /// - /// Hold the current active call, and accept the waiting call. - /// - HoldAndAccept - } - - /// - /// Enumeration for the call end type. - /// - public enum CallEndType - { - /// - /// End specific call. - /// - End, - /// - /// End all calls. - /// - EndAll, - /// - /// End all active calls. - /// - ActiveAll, - /// - /// End all held calls. - /// - HoldAll - } - - /// - /// Enumeration for the onlength to send DTMF. - /// - public enum CallDtmfPulseWidth - { - /// - /// 95 ms. - /// - OnLength95ms, - /// - /// 150 ms. - /// - OnLength150ms, - /// - /// 200 ms. - /// - OnLength200ms, - /// - /// 250 ms. - /// - OnLength250ms, - /// - /// 300 ms. - /// - OnLength300ms, - /// - /// 350 ms. - /// - OnLength350ms, - /// - /// Sms. - /// - OnLengthSms - } - - /// - /// Enumeration for the offlength to send DTMF. - /// - public enum CallDtmfDigitInterval - { - /// - /// 60 ms. - /// - OffLength60ms, - /// - /// 100 ms. - /// - OffLength100ms, - /// - /// 150 ms. - /// - OffLength150ms, - /// - /// 200 ms. - /// - OffLength200ms - } - - /// - /// Enumeration for call states. - /// - public enum CallState - { - /// - /// Idle state - i.e. no call. - /// - Idle, - /// - /// Connected and conversation state. - /// - Active, - /// - /// Held State. - /// - Held, - /// - /// Dialing state. - /// - Dialing, - /// - /// Alerting state. - /// - Alert, - /// - /// Incoming state. - /// - Incoming, - /// - /// Answered state, and waiting for connected indication event. - /// - Waiting, - /// - /// Unknown state. - /// - Unknown - } - - /// - /// Enumeration for call sound device type. - /// - public enum SoundDevice - { - /// - /// Device type receiver. - /// - Receiver, - /// - /// Device type speaker. - /// - Speaker, - /// - /// Device type handsfree. - /// - HandsFree, - /// - /// Device type headset. - /// - Headset, - /// - /// Device type bluetooth. - /// - Bluetooth, - /// - /// Device type external. - /// - External - } - - /// - /// Enumeration for call sound type. - /// - public enum SoundType - { - /// - /// Sound type voice. - /// - Voice, - /// - /// Sound type keytone. - /// - Keytone, - /// - /// Sound type bell. - /// - Bell, - /// - /// Sound type message - /// - Message, - /// - /// Sound type alarm - /// - Alarm, - /// - /// Sound type PDA miscellaneous. - /// - PDAMisc - } - - /// - /// Enumeration for call sound volume level. - /// - public enum SoundVolume - { - /// - /// Sound is mute. - /// - Mute = 0x00, - /// - /// Volume level is 1. - /// - Level1 = 0x01, - /// - /// Volume level is 2. - /// - Level2 = 0x02, - /// - /// Volume level is 3. - /// - Level3 = 0x03, - /// - /// Volume level is 4. - /// - Level4 = 0x04, - /// - /// Volume level is 5. - /// - Level5 = 0x05, - /// - /// Volume level is 6. - /// - Level6 = 0x06, - /// - /// Volume level is 7. - /// - Level7 = 0x07, - /// - /// Volume level is 8. - /// - Level8 = 0x08, - /// - /// Volume level is 9. - /// - Level9 = 0x09 - } - - /// - /// Enumeration for call extra volume. - /// - public enum ExtraVolume - { - /// - /// Off. - /// - Off, - /// - /// On. - /// - On - } - - /// - /// Enumeration for call sound mute status. - /// - public enum SoundMuteStatus - { - /// - /// Off. - /// - MuteOff, - /// - /// On. - /// - MuteOn - } - - /// - /// Enumeration for call sound mute path. - /// - public enum SoundMutePath - { - /// - /// Transmit. - /// - TX, - /// - /// Receiver. - /// - RX, - /// - /// All. - /// - All - } -} diff --git a/src/Tizen.Tapi/Tizen.Tapi/CallStructs.cs b/src/Tizen.Tapi/Tizen.Tapi/CallStructs.cs deleted file mode 100755 index f36f1d5c3..000000000 --- a/src/Tizen.Tapi/Tizen.Tapi/CallStructs.cs +++ /dev/null @@ -1,362 +0,0 @@ -/* - * 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.Collections.Generic; -using System.Runtime.InteropServices; - -namespace Tizen.Tapi -{ - [StructLayout(LayoutKind.Sequential)] - internal struct CallIdleStatusNotiStruct - { - internal uint Id; - internal CallEndCause Cause; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct CallIncomingInfoStruct - { - internal uint Handle; - internal CallType Type; - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = TapiUtility.CallDialNumberMaxLen)] - internal string CallerNumber; - internal CallerName NameData; - internal CallCliMode CliMode; - internal CallNoCliCause CliCause; - internal int IsForwarded; - internal CallActiveLine ActiveLine; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct CallerName - { - internal CallNameMode NameMode; - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = TapiUtility.CallNameMaxSize)] - internal string Name; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct CallRecordLineControlStruct - { - internal byte PolarityIncluded; - internal byte ToggleMode; - internal byte ReversePolarity; - internal byte PowerDenialTime; - } - - [StructLayout(LayoutKind.Explicit)] - internal struct CallRecordDataStruct - { - [MarshalAs(UnmanagedType.LPStr)] - [FieldOffset(0)] - internal IntPtr Name; - [MarshalAs(UnmanagedType.LPStr)] - [FieldOffset(0)] - internal IntPtr Number; - [FieldOffset(0)] - internal CallRecordLineControlStruct LineCtrl; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct CallRecordStruct - { - internal uint Id; - internal CallRecordType Type; - internal CallRecordDataStruct Data; - } - - [StructLayout(LayoutKind.Explicit)] - internal struct CallSignalStruct - { - [FieldOffset(0)] - internal CallToneSignal SignalTone; - [FieldOffset(0)] - internal CallIsdnAlertSignal IsdnAlert; - [FieldOffset(0)] - internal CallIs54bAlertSignal Is54bAlert; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct CallSignalInfoStruct - { - internal CallAlertSignal SignalType; - internal CallAlertPitch PitchType; - internal CallSignalStruct CallSignal; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct CallInformationStruct - { - internal CallType Type; - internal EmergencyType EType; - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = TapiUtility.CallDialNumberMaxLen)] - internal string PhoneNumber; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct CallBurstDtmfStruct - { - [MarshalAs(UnmanagedType.LPStr)] - internal string Dtmf; - internal CallDtmfPulseWidth Width; - internal CallDtmfDigitInterval Interval; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct CallStatusStruct - { - internal int CallHandle; - internal int BMoCall; - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = TapiUtility.CallDialNumberMaxLen)] - internal string PhoneNumber; - internal CallType Type; - internal CallState State; - internal int BConferenceState; - internal int BVolteCall; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct CallDeflectDestStruct - { - internal IntPtr DestinationNumber; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct CallVolumeRecordStruct - { - internal SoundDevice Device; - internal SoundType Type; - internal SoundVolume Volume; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct CallSoundPathStruct - { - internal SoundPath Path; - internal ExtraVolume ExVolume; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct CallUpgradeDowngradeNotiStruct - { - internal int CallHandle; - internal CallConfigType ConfigType; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct CallOperationsStruct - { - internal uint id; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct CallEndStruct - { - internal CallEndType type; - internal uint id; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct CallVolumeStruct - { - internal uint number; - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 20, ArraySubType = UnmanagedType.LPStruct)] - internal CallVolumeRecordStruct[] recordList; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct CallMuteStatusStruct - { - internal SoundMutePath Path; - internal SoundMuteStatus Status; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct CallPrivacyModeStruct - { - internal CallPrivacyMode Mode; - } - - internal static class CallStructConversions - { - internal static CallIdleStatusNotificationData ConvertCallIdleStatusNoti(CallIdleStatusNotiStruct idleStatusNoti) - { - CallIdleStatusNotificationData idleStatusNotiData = new CallIdleStatusNotificationData(); - idleStatusNotiData.Id = idleStatusNoti.Id; - idleStatusNotiData.Cause = idleStatusNoti.Cause; - return idleStatusNotiData; - } - - internal static CallIncomingInfo ConvertIncomingCallInfo(CallIncomingInfoStruct incomingInfo) - { - CallIncomingInfo callIncoming = new CallIncomingInfo(); - callIncoming.Handle = incomingInfo.Handle; - callIncoming.Type = incomingInfo.Type; - callIncoming.Number = incomingInfo.CallerNumber; - CallerNameInfo nameData = new CallerNameInfo(); - nameData.Mode = incomingInfo.NameData.NameMode; - nameData.NameData = incomingInfo.NameData.Name; - - callIncoming.Name = nameData; - callIncoming.Cli = incomingInfo.CliMode; - callIncoming.Cause = incomingInfo.CliCause; - if (incomingInfo.IsForwarded == 1) - { - callIncoming.IsFwded = true; - } - - else if (incomingInfo.IsForwarded == 0) - { - callIncoming.IsFwded = false; - } - - callIncoming.Line = incomingInfo.ActiveLine; - - return callIncoming; - } - - internal static CallRecord ConvertCallRecordStruct(CallRecordStruct record) - { - CallRecord recordData = new CallRecord(); - recordData.Id = record.Id; - recordData.Type = record.Type; - if (record.Type == CallRecordType.Name) - { - recordData.Name = Marshal.PtrToStringAnsi(record.Data.Name); - } - - else if (record.Type == CallRecordType.Number) - { - recordData.Number = Marshal.PtrToStringAnsi(record.Data.Number); - } - - else if (record.Type == CallRecordType.LineControl) - { - CallRecordLineControl lineCtrl = new CallRecordLineControl(); - lineCtrl.PolarityInc = record.Data.LineCtrl.PolarityIncluded; - lineCtrl.Toggle = record.Data.LineCtrl.ToggleMode; - lineCtrl.ReversePol = record.Data.LineCtrl.ReversePolarity; - lineCtrl.PowerTime = record.Data.LineCtrl.PowerDenialTime; - recordData.LineCtrl = lineCtrl; - } - - return recordData; - } - - internal static CallSignalNotification ConvertCallSignalInfo(CallSignalInfoStruct signalInfo) - { - CallSignalNotification signalNoti = new CallSignalNotification(); - signalNoti.Signal = signalInfo.SignalType; - signalNoti.Pitch = signalInfo.PitchType; - if (signalInfo.SignalType == CallAlertSignal.Tone) - { - signalNoti.Tone = signalInfo.CallSignal.SignalTone; - } - - else if (signalInfo.SignalType == CallAlertSignal.IsdnAlert) - { - signalNoti.Isdn = signalInfo.CallSignal.IsdnAlert; - } - - else if (signalInfo.SignalType == CallAlertSignal.Is54bAlert) - { - signalNoti.Is54b = signalInfo.CallSignal.Is54bAlert; - } - - return signalNoti; - } - - internal static CallUpgradeDowngradeRequestNoti ConvertCallUpgradeNoti(CallUpgradeDowngradeNotiStruct notiStruct) - { - CallUpgradeDowngradeRequestNoti requestNoti = new CallUpgradeDowngradeRequestNoti(); - requestNoti.Handle = notiStruct.CallHandle; - requestNoti.Type = notiStruct.ConfigType; - return requestNoti; - } - - internal static CallStatus ConvertStatusStruct(CallStatusStruct statusStruct) - { - CallStatus statusData = new CallStatus(); - statusData.CallHandle = statusStruct.CallHandle; - statusData.IsMoCall = Convert.ToBoolean(statusStruct.BMoCall); - statusData.PhoneNumber = statusStruct.PhoneNumber; - statusData.Type = statusStruct.Type; - statusData.State = statusStruct.State; - statusData.IsConferenceState = Convert.ToBoolean(statusStruct.BConferenceState); - statusData.IsVolteCall = Convert.ToBoolean(statusStruct.BVolteCall); - return statusData; - } - - internal static CallVolumeInfo ConvertVolumeStruct(CallVolumeStruct volumeStruct) - { - List records = new List(); - foreach(CallVolumeRecordStruct record in volumeStruct.recordList) - { - records.Add(new CallVolumeRecord(record.Device, record.Type, record.Volume)); - } - - CallVolumeInfo volumeInfo = new CallVolumeInfo(volumeStruct.number, records); - return volumeInfo; - } - } - - internal static class CallClassConversions - { - internal static CallInformationStruct ConvertCallInformationToStruct(CallInformation info) - { - CallInformationStruct callInfoStruct = new CallInformationStruct(); - callInfoStruct.Type = info.Type; - callInfoStruct.EType = info.EType; - callInfoStruct.PhoneNumber = info.PhoneNumber; - return callInfoStruct; - } - - internal static CallBurstDtmfStruct ConvertCallBurstToStruct(CallBurstDtmfData data) - { - CallBurstDtmfStruct callBurstStruct = new CallBurstDtmfStruct(); - callBurstStruct.Dtmf = data.Dtmf; - callBurstStruct.Width = data.Width; - callBurstStruct.Interval = data.Interval; - return callBurstStruct; - } - - internal static CallDeflectDestStruct ConvertByteDestinationToStruct(byte[] number) - { - CallDeflectDestStruct callDeflectStruct = new CallDeflectDestStruct(); - callDeflectStruct.DestinationNumber = Marshal.AllocHGlobal(83); - Marshal.Copy(number, 0, callDeflectStruct.DestinationNumber, Math.Min(83, number.Length)); - return callDeflectStruct; - } - - internal static CallVolumeRecordStruct ConvertVolumeRecordToStruct(CallVolumeRecord record) - { - CallVolumeRecordStruct volumeStruct = new CallVolumeRecordStruct(); - volumeStruct.Device = record.Device; - volumeStruct.Type = record.Type; - volumeStruct.Volume = record.Volume; - return volumeStruct; - } - - internal static CallSoundPathStruct ConvertSoundPathToStruct(CallSoundPathInfo info) - { - CallSoundPathStruct pathStruct = new CallSoundPathStruct(); - pathStruct.Path = info.Path; - pathStruct.ExVolume = info.ExVolume; - return pathStruct; - } - } -} diff --git a/src/Tizen.Tapi/Tizen.Tapi/Modem.cs b/src/Tizen.Tapi/Tizen.Tapi/Modem.cs deleted file mode 100755 index 2408faa54..000000000 --- a/src/Tizen.Tapi/Tizen.Tapi/Modem.cs +++ /dev/null @@ -1,442 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Runtime.InteropServices; -using System.Text; -using System.Threading.Tasks; - -namespace Tizen.Tapi -{ - /// - /// This class provides functions for modem services. - /// - public class Modem - { - private IntPtr _handle; - private Dictionary _response_map = new Dictionary(); - private int _requestId = 0; - - /// - /// A public constructor for Modem class to create a Modem instance for the given tapi handle. - /// - /// The tapi handle. - public Modem(TapiHandle handle) - { - if (handle == null) - { - throw new ArgumentNullException("TapiHandle parameter is null"); - } - - _handle = handle._handle; - } - - /// - /// Turn the modem on/off asynchronously. - /// - /// Power command value. - /// A task indicating whether the ProcessPowerCommand method is done or not. - /// http://tizen.org/privilege/telephony.admin - /// platform - /// http://tizen.org/feature/network.telephony - /// Thrown when feature is not supported. - /// Thrown when privilege access is denied. - /// Thrown when modem instance is invalid or when method failed due to invalid operation. - public Task ProcessPowerCommand(PhonePowerCommand cmd) - { - TaskCompletionSource task = new TaskCompletionSource(); - IntPtr id; - id = (IntPtr)_requestId++; - _response_map[id] = (IntPtr handle, int result, IntPtr data, IntPtr key) => - { - Task resultTask = new Task(() => - { - if (result != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Error occurs during turning modem on/off, " + (TapiError)result); - task.SetException(new InvalidOperationException("Error occurs during turning modem on/off, " + (TapiError)result)); - return; - } - - task.SetResult(true); - }); - - resultTask.Start(); - resultTask.Wait(); - _response_map.Remove(key); - }; - - int ret = Interop.Tapi.Modem.ProcessPowerCommand(_handle, cmd, _response_map[id], id); - if (ret != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Failed to turn the modem on/off, Error: " + (TapiError)ret); - TapiUtility.ThrowTapiException(ret, _handle, "http://tizen.org/privilege/telephony.admin"); - } - - return task.Task; - } - - /// - /// Switch the flight mode on/off asynchronously. - /// - /// Flight mode request value. - /// A task indicating whether the SetFlightMode method is done or not. - /// http://tizen.org/privilege/telephony.admin - /// platform - /// http://tizen.org/feature/network.telephony - /// Thrown when feature is not supported. - /// Thrown when privilege access is denied. - /// Thrown when modem instance is invalid or when method failed due to invalid operation. - public Task SetFlightMode(PowerFlightModeRequest mode) - { - TaskCompletionSource task = new TaskCompletionSource(); - IntPtr id; - id = (IntPtr)_requestId++; - _response_map[id] = (IntPtr handle, int result, IntPtr data, IntPtr key) => - { - Task resultTask = new Task(() => - { - if ((mode == PowerFlightModeRequest.Leave && result != (int)PowerFlightModeResponse.Off) || - (mode == PowerFlightModeRequest.Enter && result != (int)PowerFlightModeResponse.On)) - { - Log.Error(TapiUtility.LogTag, "Error occurs during switching flight mode on/off, " + (PowerFlightModeResponse)result); - task.SetException(new InvalidOperationException("Error occurs during switching flight mode on/off, " + (PowerFlightModeResponse)result)); - return; - } - - task.SetResult(true); - }); - - resultTask.Start(); - resultTask.Wait(); - _response_map.Remove(key); - }; - - int ret = Interop.Tapi.Modem.SetFlightMode(_handle, mode, _response_map[id], id); - if (ret != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Failed to switch the flight mode on/off, Error: " + (TapiError)ret); - TapiUtility.ThrowTapiException(ret, _handle, "http://tizen.org/privilege/telephony.admin"); - } - - return task.Task; - } - - /// - /// Get the flight mode asynchronously. - /// - /// If flight mode is On, it returns true else it returns false. - /// http://tizen.org/privilege/telephony - /// http://tizen.org/feature/network.telephony - /// Thrown when feature is not supported. - /// Thrown when privilege access is denied. - /// Thrown when modem instance is invalid or when method failed due to invalid operation. - public Task GetFlightMode() - { - TaskCompletionSource task = new TaskCompletionSource(); - IntPtr id; - id = (IntPtr)_requestId++; - _response_map[id] = (IntPtr handle, int result, IntPtr data, IntPtr key) => - { - Task resultTask = new Task(() => - { - if (result != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Error occurs during getting the flight mode, " + (TapiError)result); - task.SetException(new InvalidOperationException("Error occurs during getting the flight mode, " + (TapiError)result)); - return; - } - - int mode = Marshal.ReadInt32(data); - if (mode == 1) - { - task.SetResult(true); - } - - else - { - task.SetResult(false); - } - }); - - resultTask.Start(); - resultTask.Wait(); - _response_map.Remove(key); - }; - - int ret = Interop.Tapi.Modem.GetFlightMode(_handle, _response_map[id], id); - if (ret != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Failed to get the flight mode, Error: " + (TapiError)ret); - TapiUtility.ThrowTapiException(ret, _handle, "http://tizen.org/privilege/telephony"); - } - - return task.Task; - } - - /// - /// Get Me version information asynchronously. - /// - /// Instance of MiscVersionInformation. - /// http://tizen.org/privilege/telephony - /// http://tizen.org/feature/network.telephony - /// Thrown when feature is not supported. - /// Thrown when privilege access is denied. - /// Thrown when modem instance is invalid or when method failed due to invalid operation. - public Task GetMiscMeVersion() - { - TaskCompletionSource task = new TaskCompletionSource(); - IntPtr id; - id = (IntPtr)_requestId++; - _response_map[id] = (IntPtr handle, int result, IntPtr data, IntPtr key) => - { - Task resultTask = new Task(() => - { - if (result != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Error occurs during getting the Me version, " + (TapiError)result); - task.SetException(new InvalidOperationException("Error occurs during getting the Me version, " + (TapiError)result)); - return; - } - - MiscVersionInfoStruct infoStruct = Marshal.PtrToStructure(data); - MiscVersionInformation versionInfoClass = ModemStructConversions.ConvertVersionStruct(infoStruct); - task.SetResult(versionInfoClass); - }); - - resultTask.Start(); - resultTask.Wait(); - _response_map.Remove(key); - }; - - int ret = Interop.Tapi.Modem.GetMiscMeVersion(_handle, _response_map[id], id); - if (ret != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Failed to get the Me version information, Error: " + (TapiError)ret); - TapiUtility.ThrowTapiException(ret, _handle, "http://tizen.org/privilege/telephony"); - } - - return task.Task; - } - - /// - /// Misc me version information. - /// - /// http://tizen.org/privilege/telephony - /// http://tizen.org/feature/network.telephony - /// Returns null in case of failure. - public MiscVersionInformation MiscMeVersionSync - { - get - { - IntPtr info = Interop.Tapi.Modem.GetMiscMeVersionSync(_handle); - MiscVersionInfoStruct infoStruct = Marshal.PtrToStructure(info); - if (infoStruct.Equals(null)) - { - return null; - } - - MiscVersionInformation versionInfoClass = ModemStructConversions.ConvertVersionStruct(infoStruct); - return versionInfoClass; - } - } - - /// - /// Get the Me Esn/Meid for each phone type asynchronously. - /// - /// Instance of MiscSerialNumberInformation. - /// http://tizen.org/privilege/telephony - /// http://tizen.org/feature/network.telephony - /// Thrown when feature is not supported. - /// Thrown when privilege access is denied. - /// Thrown when modem instance is invalid or when method failed due to invalid operation. - public Task GetMiscMeSn() - { - TaskCompletionSource task = new TaskCompletionSource(); - IntPtr id; - id = (IntPtr)_requestId++; - _response_map[id] = (IntPtr handle, int result, IntPtr data, IntPtr key) => - { - Task resultTask = new Task(() => - { - if (result != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Error occurs during getting the Me Esn/Meid, " + (TapiError)result); - task.SetException(new InvalidOperationException("Error occurs during getting the Me Esn/Meid, " + (TapiError)result)); - return; - } - - MiscSerialNumInfoStruct infoStruct = Marshal.PtrToStructure(data); - MiscSerialNumberInformation serialNumberClass = ModemStructConversions.ConvertSerialNumberStruct(infoStruct); - task.SetResult(serialNumberClass); - }); - - resultTask.Start(); - resultTask.Wait(); - _response_map.Remove(key); - }; - - int ret = Interop.Tapi.Modem.GetMiscMeSn(_handle, _response_map[id], id); - if (ret != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Failed to get the Me Esn/Meid information for each phone type, Error: " + (TapiError)ret); - TapiUtility.ThrowTapiException(ret, _handle, "http://tizen.org/privilege/telephony"); - } - - return task.Task; - } - - /// - /// Misc me serial number information. - /// - /// http://tizen.org/privilege/telephony - /// http://tizen.org/feature/network.telephony - /// Returns null in case of failure. - public MiscSerialNumberInformation MiscMeSnSync - { - get - { - IntPtr info = Interop.Tapi.Modem.GetMiscMeSnSync(_handle); - MiscSerialNumInfoStruct infoStruct = Marshal.PtrToStructure(info); - if (infoStruct.Equals(null)) - { - return null; - } - - MiscSerialNumberInformation versionInfoClass = ModemStructConversions.ConvertSerialNumberStruct(infoStruct); - return versionInfoClass; - } - } - - /// - /// Get the Misc Me Imei asynchronously. - /// - /// The imei string. - /// http://tizen.org/privilege/telephony - /// http://tizen.org/feature/network.telephony - /// Thrown when feature is not supported. - /// Thrown when privilege access is denied. - /// Thrown when modem instance is invalid or when method failed due to invalid operation. - public Task GetMiscMeImei() - { - TaskCompletionSource task = new TaskCompletionSource(); - IntPtr id; - id = (IntPtr)_requestId++; - _response_map[id] = (IntPtr handle, int result, IntPtr data, IntPtr key) => - { - Task resultTask = new Task(() => - { - if (result != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Error occurs during getting the Misc Me Imei, " + (TapiError)result); - task.SetException(new InvalidOperationException("Error occurs during getting the Misc Me Imei, " + (TapiError)result)); - return; - } - - task.SetResult(Marshal.PtrToStringAnsi(data)); - }); - - resultTask.Start(); - resultTask.Wait(); - _response_map.Remove(key); - }; - - int ret = Interop.Tapi.Modem.GetMiscMeImei(_handle, _response_map[id], id); - if (ret != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Failed to get the Misc Me Imei information, Error: " + (TapiError)ret); - TapiUtility.ThrowTapiException(ret, _handle, "http://tizen.org/privilege/telephony"); - } - - return task.Task; - } - - /// - /// Misc me Imei information. - /// - /// http://tizen.org/privilege/telephony - /// http://tizen.org/feature/network.telephony - /// Returns null in case of failure. - public string MiscMeImeiSync - { - get - { - string imei = Interop.Tapi.Modem.GetMiscMeImeiSync(_handle); - if (imei == null) - { - return null; - } - - return imei; - } - } - - /// - /// Check the modem power status. - /// - /// Phone power status value. - /// http://tizen.org/privilege/telephony - /// http://tizen.org/feature/network.telephony - /// Thrown when feature is not supported. - /// Thrown when privilege access is denied. - /// Thrown when modem instance is invalid or when method failed due to invalid operation. - public PhonePowerStatus CheckPowerStatus() - { - int result; - int ret = Interop.Tapi.Modem.CheckPowerStatus(_handle, out result); - if (ret != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Failed to check the modem power status, Error: " + (TapiError)ret); - TapiUtility.ThrowTapiException(ret, _handle, "http://tizen.org/privilege/telephony"); - } - - return (PhonePowerStatus)result; - } - - /// - /// Get device vendor name and device name of cellular dongle. - /// - /// Instance of MiscDeviceInfo. - /// http://tizen.org/privilege/telephony - /// http://tizen.org/feature/network.telephony - /// - /// Result can be delivered with only cellular dongle insertion. - /// - /// Thrown when feature is not supported. - /// Thrown when privilege access is denied. - /// Thrown when modem instance is invalid or when method failed due to invalid operation. - public Task GetDeviceInfo() - { - TaskCompletionSource task = new TaskCompletionSource(); - IntPtr id; - id = (IntPtr)_requestId++; - _response_map[id] = (IntPtr handle, int result, IntPtr data, IntPtr key) => - { - Task resultTask = new Task(() => - { - if (result != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Error occurs during getting the device name and vendor name, " + (TapiError)result); - task.SetException(new InvalidOperationException("Error occurs during getting the device name and vendor name, " + (TapiError)result)); - return; - } - - MiscDeviceInfoStruct infoStruct = Marshal.PtrToStructure(data); - MiscDeviceInfo deviceInfo = ModemStructConversions.ConvertMiscInfoStruct(infoStruct); - task.SetResult(deviceInfo); - }); - - resultTask.Start(); - resultTask.Wait(); - _response_map.Remove(key); - }; - - int ret = Interop.Tapi.Modem.GetDeviceInfo(_handle, _response_map[id], id); - if (ret != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Failed to get the device vendor name and device name, Error: " + (TapiError)ret); - TapiUtility.ThrowTapiException(ret, _handle, "http://tizen.org/privilege/telephony"); - } - - return task.Task; - } - } -} diff --git a/src/Tizen.Tapi/Tizen.Tapi/ModemData.cs b/src/Tizen.Tapi/Tizen.Tapi/ModemData.cs deleted file mode 100755 index a7dfe2463..000000000 --- a/src/Tizen.Tapi/Tizen.Tapi/ModemData.cs +++ /dev/null @@ -1,228 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; - -namespace Tizen.Tapi -{ - /// - /// A class containing information about mobile equipment version. - /// - public class MiscVersionInformation - { - internal byte Version; - internal string SwVers; - internal string HwVers; - internal string CalcDate; - internal string ProdCode; - internal string Model; - internal byte PrlNamNum; - internal string PrlVers; - internal byte EriNamNum; - internal string EriVers; - internal MiscVersionInformation() - { - } - - /// - /// Version mask. - /// - public byte VersionMask - { - get - { - return Version; - } - } - - /// - /// Software version. - /// - public string SwVersion - { - get - { - return SwVers; - } - } - - /// - /// Hardware version. - /// - public string HwVersion - { - get - { - return HwVers; - } - } - - /// - /// Calculation date. - /// - public string CalculationDate - { - get - { - return CalcDate; - } - } - - /// - /// Product code. - /// - public string ProductCode - { - get - { - return ProdCode; - } - } - - /// - /// Model id. - /// - public string ModelId - { - get - { - return Model; - } - } - - /// - /// Number of prl nam fields. - /// - public byte PrlNam - { - get - { - return PrlNamNum; - } - } - - /// - /// Prl version (only for CDMA). - /// - public string PrlVersion - { - get - { - return PrlVers; - } - } - - /// - /// Number of Eri nam fields. - /// - public byte EriNam - { - get - { - return EriNamNum; - } - } - - /// - /// Eri version. - /// - public string EriVersion - { - get - { - return EriVers; - } - } - } - - /// - /// A class containing information about mobile serial number. - /// - public class MiscSerialNumberInformation - { - internal string SzEsn; - internal string SzMeid; - internal string SzImei; - internal string SzImeiSv; - internal MiscSerialNumberInformation() - { - } - - /// - /// Esn number. - /// - public string Esn - { - get - { - return SzEsn; - } - } - - /// - /// Meid number. - /// - public string MeId - { - get - { - return SzMeid; - } - } - - /// - /// Imei number. - /// - public string Imei - { - get - { - return SzImei; - } - } - - /// - /// Imeisv number. - /// - public string ImeiSv - { - get - { - return SzImeiSv; - } - } - } - - /// - /// A class containing device information of cellular dongle. - /// - public class MiscDeviceInfo - { - internal string Vendor; - internal string Device; - internal MiscDeviceInfo() - { - } - - /// - /// Vendor name. - /// - public string VendorName - { - get - { - return Vendor; - } - } - - /// - /// Device name. - /// - public string DeviceName - { - get - { - return Device; - } - } - } -} diff --git a/src/Tizen.Tapi/Tizen.Tapi/ModemEnumerations.cs b/src/Tizen.Tapi/Tizen.Tapi/ModemEnumerations.cs deleted file mode 100755 index 2b253a48f..000000000 --- a/src/Tizen.Tapi/Tizen.Tapi/ModemEnumerations.cs +++ /dev/null @@ -1,118 +0,0 @@ -/* - * 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. - */ - -namespace Tizen.Tapi -{ - /// - /// Enumeration for the phone power status values. - /// - public enum PhonePowerStatus - { - /// - /// Unknown. - /// - Unknown = -1, - /// - /// Power on. - /// - On, - /// - /// Power off. - /// - Off, - /// - /// Power reset. - /// - Reset, - /// - /// Power low. - /// - Low, - /// - /// Error. - /// - Error - } - - /// - /// Enumeration for the phone power reset commands. - /// - public enum PhonePowerCommand - { - /// - /// On. - /// - On = 0, - /// - /// Off. - /// - Off, - /// - /// Reset. - /// - Reset, - /// - /// Low value. - /// - Low, - /// - /// Max value. - /// - Max = Low - } - - /// - /// Enumeration for flight mode request type. - /// - public enum PowerFlightModeRequest - { - /// - /// Off. - /// - Enter = 0x01, - /// - /// On. - /// - Leave, - /// - /// Max value. - /// - Max - } - - /// - /// Enumeration for flight mode request type. - /// - public enum PowerFlightModeResponse - { - /// - /// Flight mode on success. - /// - On = 0x01, - /// - /// Flight mode off success. - /// - Off, - /// - /// Flight mode request fail. - /// - Fail, - /// - /// Max value. - /// - Max - } -} diff --git a/src/Tizen.Tapi/Tizen.Tapi/ModemStructs.cs b/src/Tizen.Tapi/Tizen.Tapi/ModemStructs.cs deleted file mode 100755 index fbba5d4ed..000000000 --- a/src/Tizen.Tapi/Tizen.Tapi/ModemStructs.cs +++ /dev/null @@ -1,102 +0,0 @@ -/* - * 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; - -namespace Tizen.Tapi -{ - [StructLayout(LayoutKind.Sequential)] - internal struct MiscVersionInfoStruct - { - internal byte Mask; - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = TapiUtility.MaxVersionLen)] - internal string SwVersion; - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = TapiUtility.MaxVersionLen)] - internal string HwVersion; - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = TapiUtility.MaxVersionLen)] - internal string CalDate; - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = TapiUtility.MiscProdCodeMaxLen)] - internal string ProductCode; - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = TapiUtility.ModelIdMaxLen)] - internal string ModelId; - internal byte PrlNam; - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = TapiUtility.MiscPrlEriVersionMaxLen*3)] - internal string PrlVersion; - internal byte EriNam; - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = TapiUtility.MiscPrlEriVersionMaxLen * 3)] - internal string EriVersion; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct MiscSerialNumInfoStruct - { - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = TapiUtility.MiscMeSnMaxLen)] - internal string Esn; - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = TapiUtility.MiscMeSnMaxLen)] - internal string MeId; - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = TapiUtility.MiscMeSnMaxLen)] - internal string Imei; - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = TapiUtility.MiscMeSnMaxLen)] - internal string ImeiSv; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct MiscDeviceInfoStruct - { - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = TapiUtility.MiscMeDeviceNameMaxLen + 1)] - internal string Vendor; - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = TapiUtility.MiscMeDeviceNameMaxLen + 1)] - internal string Device; - } - - internal class ModemStructConversions - { - internal static MiscVersionInformation ConvertVersionStruct(MiscVersionInfoStruct infoStruct) - { - MiscVersionInformation versionInfo = new MiscVersionInformation(); - versionInfo.CalcDate = infoStruct.CalDate; - versionInfo.EriNamNum = infoStruct.EriNam; - versionInfo.EriVers = infoStruct.EriVersion; - versionInfo.HwVers = infoStruct.HwVersion; - versionInfo.SwVers = infoStruct.SwVersion; - versionInfo.PrlNamNum = infoStruct.PrlNam; - versionInfo.PrlVers = infoStruct.PrlVersion; - versionInfo.ProdCode = infoStruct.ProductCode; - versionInfo.Version = infoStruct.Mask; - versionInfo.Model = infoStruct.ModelId; - return versionInfo; - } - - internal static MiscSerialNumberInformation ConvertSerialNumberStruct(MiscSerialNumInfoStruct infoStruct) - { - MiscSerialNumberInformation serialNumberInfo = new MiscSerialNumberInformation(); - serialNumberInfo.SzEsn = infoStruct.Esn; - serialNumberInfo.SzImei = infoStruct.Imei; - serialNumberInfo.SzImeiSv = infoStruct.ImeiSv; - serialNumberInfo.SzMeid = infoStruct.MeId; - return serialNumberInfo; - } - - internal static MiscDeviceInfo ConvertMiscInfoStruct(MiscDeviceInfoStruct infoStruct) - { - MiscDeviceInfo deviceInfo = new MiscDeviceInfo(); - deviceInfo.Vendor = infoStruct.Vendor; - deviceInfo.Device = infoStruct.Device; - return deviceInfo; - } - } -} diff --git a/src/Tizen.Tapi/Tizen.Tapi/Network.cs b/src/Tizen.Tapi/Tizen.Tapi/Network.cs deleted file mode 100755 index 886261ddc..000000000 --- a/src/Tizen.Tapi/Tizen.Tapi/Network.cs +++ /dev/null @@ -1,812 +0,0 @@ -/* - * 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.Collections.Generic; -using System.Runtime.InteropServices; -using System.Threading.Tasks; - -namespace Tizen.Tapi -{ - /// - /// This class provides functions for managing telephony service network. - /// - public class Network - { - private IntPtr _handle; - private Dictionary _response_map = new Dictionary(); - private int _requestId = 0; - - /// - /// A public constructor for Network class to create a Network instance for the given tapi handle. - /// - /// The tapi handle. - public Network(TapiHandle handle) - { - if (handle == null) - { - throw new ArgumentNullException("TapiHandle parameter is null"); - } - - _handle = handle._handle; - } - - /// - /// Request the lower layers to select the network automatically asynchronously. - /// - /// http://tizen.org/privilege/telephony.admin - /// platform - /// http://tizen.org/feature/network.telephony - /// Thrown when feature is not supported. - /// Thrown when privilege access is denied. - /// Thrown when network instance is invalid or when method failed due to invalid operation. - public Task SelectNetworkAutomatic() - { - TaskCompletionSource task = new TaskCompletionSource(); - IntPtr id; - id = (IntPtr)_requestId++; - _response_map[id] = (IntPtr handle, int result, IntPtr data, IntPtr key) => - { - Task resultTask = new Task(() => - { - if (result != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Error occurs during selecting the network, " + (TapiError)result); - task.SetException(new InvalidOperationException("Error occurs during selecting the network, " + (TapiError)result)); - return; - } - - task.SetResult(true); - }); - - resultTask.Start(); - resultTask.Wait(); - _response_map.Remove(key); - }; - - int ret = Interop.Tapi.Network.SelectAutoNetwork(_handle, _response_map[id], id); - if (ret != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Failed to select the network automatically, Error: " + (TapiError)ret); - TapiUtility.ThrowTapiException(ret, _handle, "http://tizen.org/privilege/telephony.admin"); - } - - return task.Task; - } - - /// - /// Request the lower layers to select the network which is selected by the user from the network list asynchronously. - /// - /// The user selected plmn. - /// The user selected access technology. - /// http://tizen.org/privilege/telephony.admin - /// platform - /// http://tizen.org/feature/network.telephony - /// Thrown when feature is not supported. - /// Thrown when privilege access is denied. - /// Thrown when network instance is invalid or when method failed due to invalid operation. - public Task SelectNetworkManual(string plmn, int act) - { - TaskCompletionSource task = new TaskCompletionSource(); - IntPtr id; - id = (IntPtr)_requestId++; - _response_map[id] = (IntPtr handle, int result, IntPtr data, IntPtr key) => - { - Task resultTask = new Task(() => - { - if (result != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Error occurs during selecting the network, " + (TapiError)result); - task.SetException(new InvalidOperationException("Error occurs during selecting the network, " + (TapiError)result)); - return; - } - - task.SetResult(true); - }); - - resultTask.Start(); - resultTask.Wait(); - _response_map.Remove(key); - }; - - int ret = Interop.Tapi.Network.SelectManualNetwork(_handle, plmn, act, _response_map[id], id); - if (ret != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Failed to select the network manually, Error: " + (TapiError)ret); - TapiUtility.ThrowTapiException(ret, _handle, "http://tizen.org/privilege/telephony.admin"); - } - - return task.Task; - } - - /// - /// Sends a request to do manual search for the available networks and provides the Network List to the user asynchronously. - /// - /// Instance of NetworkPlmnList. - /// http://tizen.org/privilege/telephony.admin - /// platform - /// http://tizen.org/feature/network.telephony - /// Thrown when feature is not supported. - /// Thrown when privilege access is denied. - /// Thrown when network instance is invalid or when method failed due to invalid operation. - public Task SearchNetwork() - { - TaskCompletionSource task = new TaskCompletionSource(); - IntPtr id; - id = (IntPtr)_requestId++; - _response_map[id] = (IntPtr handle, int result, IntPtr dataResponse, IntPtr key) => - { - Task resultTask = new Task(() => - { - if (result != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Error occurs during manual search for the available networks, " + (TapiError)result); - task.SetException(new InvalidOperationException("Error occurs during manual search for the available networks, " + (TapiError)result)); - return; - } - - NetworkPlmnListStruct listStruct = Marshal.PtrToStructure(dataResponse); - NetworkPlmnList plmnClass = NetworkStructConversions.ConvertNetworkPlmnListStruct(listStruct); - task.SetResult(plmnClass); - }); - - resultTask.Start(); - resultTask.Wait(); - _response_map.Remove(key); - }; - - int ret = Interop.Tapi.Network.SearchNetwork(_handle, _response_map[id], id); - if (ret != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Failed to do manual search for the available networks, Error: " + (TapiError)ret); - TapiUtility.ThrowTapiException(ret, _handle, "http://tizen.org/privilege/telephony.admin"); - } - - return task.Task; - } - - /// - /// Get the present network selection mode i.e. automatic or manual asynchronously. - /// - /// Value of NetworkSelectionMode. - /// http://tizen.org/privilege/telephony - /// http://tizen.org/feature/network.telephony - /// Thrown when feature is not supported. - /// Thrown when privilege access is denied. - /// Thrown when network instance is invalid or when method failed due to invalid operation. - public Task GetNetworkSelectionMode() - { - TaskCompletionSource task = new TaskCompletionSource(); - IntPtr id; - id = (IntPtr)_requestId++; - _response_map[id] = (IntPtr handle, int result, IntPtr dataResponse, IntPtr key) => - { - Task resultTask = new Task(() => - { - if (result != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Error occurs during getting the present network selection mode, " + (TapiError)result); - task.SetException(new InvalidOperationException("Error occurs during getting the present network selection mode, " + (TapiError)result)); - return; - } - - task.SetResult((NetworkSelectionMode)Marshal.ReadInt32(dataResponse)); - }); - - resultTask.Start(); - resultTask.Wait(); - _response_map.Remove(key); - }; - - int ret = Interop.Tapi.Network.GetNetworkSelectMode(_handle, _response_map[id], id); - if (ret != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Failed to get the present network selection mode, Error: " + (TapiError)ret); - TapiUtility.ThrowTapiException(ret, _handle, "http://tizen.org/privilege/telephony"); - } - - return task.Task; - } - - /// - /// Set the network preferred plmn asynchronously. - /// - /// The operation to be done on the preferred plmn. - /// The preferred plmn info. - /// A task indicating whether the SetNetworkPreferredPlmn method is done or not. - /// http://tizen.org/privilege/telephony.admin - /// platform - /// http://tizen.org/feature/network.telephony - /// Thrown when feature is not supported. - /// Thrown when privilege access is denied. - /// Thrown when NetworkPreferredPlmnInfo argument is null. - /// Thrown when network instance is invalid or when method failed due to invalid operation. - public Task SetNetworkPreferredPlmn(NetworkPreferredPlmnOp operation, NetworkPreferredPlmnInfo info) - { - if (info != null) - { - TaskCompletionSource task = new TaskCompletionSource(); - IntPtr id; - id = (IntPtr)_requestId++; - _response_map[id] = (IntPtr handle, int result, IntPtr dataResponse, IntPtr key) => - { - Task resultTask = new Task(() => - { - if (result != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Error occurs during setting the network preferred plmn, " + (TapiError)result); - task.SetException(new InvalidOperationException("Error occurs during setting the network preferred plmn, " + (TapiError)result)); - return; - } - - task.SetResult(true); - }); - - resultTask.Start(); - resultTask.Wait(); - _response_map.Remove(key); - }; - - NetworkPreferredPlmnStruct plmnStruct = NetworkClassConversions.ConvertNetworkPreferredPlmn(info); - int ret = Interop.Tapi.Network.SetNetworkPreferredPlmn(_handle, operation, ref plmnStruct, _response_map[id], id); - if (ret != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Failed to set the network preferred plmn, Error: " + (TapiError)ret); - TapiUtility.ThrowTapiException(ret, _handle, "http://tizen.org/privilege/telephony.admin"); - } - - return task.Task; - } - - else - { - throw new ArgumentNullException("NetworkPreferredPlmnInfo argument is null"); - } - } - - /// - /// Get the preferred plmn list asynchronously. - /// - /// List of NetworkPreferredPlmnInfo. - /// http://tizen.org/privilege/telephony - /// http://tizen.org/feature/network.telephony - /// Thrown when feature is not supported. - /// Thrown when privilege access is denied. - /// Thrown when network instance is invalid or when method failed due to invalid operation. - public Task> GetNetworkPreferredPlmn() - { - TaskCompletionSource> task = new TaskCompletionSource>(); - IntPtr id; - id = (IntPtr)_requestId++; - _response_map[id] = (IntPtr handle, int result, IntPtr dataResponse, IntPtr key) => - { - Task resultTask = new Task(() => - { - if (result != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Error occurs during getting the preferred plmn list, " + (TapiError)result); - task.SetException(new InvalidOperationException("Error occurs during getting the preferred plmn list, " + (TapiError)result)); - return; - } - - NetworkPreferredPlmnListStruct plmnStruct = Marshal.PtrToStructure(dataResponse); - IEnumerable plmnInfo = NetworkStructConversions.ConvertNetworkPreferredPlmnStruct(plmnStruct); - task.SetResult(plmnInfo); - }); - - resultTask.Start(); - resultTask.Wait(); - _response_map.Remove(key); - }; - - int ret = Interop.Tapi.Network.GetNetworkPreferredPlmn(_handle, _response_map[id], id); - if (ret != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Failed to get the preferred plmn list, Error: " + (TapiError)ret); - TapiUtility.ThrowTapiException(ret, _handle, "http://tizen.org/privilege/telephony"); - } - - return task.Task; - } - - /// - /// Cancel the triggered manual network search asynchronously. - /// - /// A task indicating whether the CancelNetworkManualSearch method is done or not. - /// http://tizen.org/privilege/telephony.admin - /// platform - /// http://tizen.org/feature/network.telephony - /// Thrown when feature is not supported. - /// Thrown when privilege access is denied. - /// Thrown when network instance is invalid or when method failed due to invalid operation. - public Task CancelNetworkManualSearch() - { - TaskCompletionSource task = new TaskCompletionSource(); - IntPtr id; - id = (IntPtr)_requestId++; - _response_map[id] = (IntPtr handle, int result, IntPtr dataResponse, IntPtr key) => - { - Task resultTask = new Task(() => - { - if (result != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Error occurs during cancelling the network manual search, " + (TapiError)result); - task.SetException(new InvalidOperationException("Error occurs during cancelling the network manual search, " + (TapiError)result)); - return; - } - - task.SetResult(true); - }); - - resultTask.Start(); - resultTask.Wait(); - _response_map.Remove(key); - }; - - int ret = Interop.Tapi.Network.CancelNetworkManualSearch(_handle, _response_map[id], id); - if (ret != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Failed to cancel the network manual search, Error: " + (TapiError)ret); - TapiUtility.ThrowTapiException(ret, _handle, "http://tizen.org/privilege/telephony.admin"); - } - - return task.Task; - } - - /// - /// Get the network serving information asynchronously. - /// - /// Instance of NetworkServing. - /// http://tizen.org/privilege/telephony - /// http://tizen.org/feature/network.telephony - /// Thrown when feature is not supported. - /// Thrown when privilege access is denied. - /// Thrown when network instance is invalid or when method failed due to invalid operation. - public Task GetNetworkServing() - { - TaskCompletionSource task = new TaskCompletionSource(); - IntPtr id; - id = (IntPtr)_requestId++; - _response_map[id] = (IntPtr handle, int result, IntPtr dataResponse, IntPtr key) => - { - Task resultTask = new Task(() => - { - if (result != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Error occurs during getting the network serving information, " + (TapiError)result); - task.SetException(new InvalidOperationException("Error occurs during getting the network serving information, " + (TapiError)result)); - return; - } - - NetworkServingStruct servStruct = Marshal.PtrToStructure(dataResponse); - NetworkServing servingInfo = NetworkStructConversions.ConvertNetworkServingStruct(servStruct); - task.SetResult(servingInfo); - }); - - resultTask.Start(); - resultTask.Wait(); - _response_map.Remove(key); - }; - - int ret = Interop.Tapi.Network.GetNetworkServing(_handle, _response_map[id], id); - if (ret != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Failed to get the network serving information, Error: " + (TapiError)ret); - TapiUtility.ThrowTapiException(ret, _handle, "http://tizen.org/privilege/telephony"); - } - - return task.Task; - } - - /// - /// Set the network mode asynchronously. - /// - /// The network mode. - /// A task indicating whether the SetNetworkMode method is done or not. - /// http://tizen.org/privilege/telephony.admin - /// platform - /// http://tizen.org/feature/network.telephony - /// Thrown when feature is not supported. - /// Thrown when privilege access is denied. - /// Thrown when network instance is invalid or when method failed due to invalid operation. - public Task SetNetworkMode(NetworkMode mode) - { - TaskCompletionSource task = new TaskCompletionSource(); - IntPtr id; - id = (IntPtr)_requestId++; - _response_map[id] = (IntPtr handle, int result, IntPtr dataResponse, IntPtr key) => - { - Task resultTask = new Task(() => - { - if (result != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Error occurs during getting the network mode, " + (TapiError)result); - task.SetException(new InvalidOperationException("Error occurs during getting the network mode, " + (TapiError)result)); - return; - } - - task.SetResult(true); - }); - - resultTask.Start(); - resultTask.Wait(); - _response_map.Remove(key); - }; - - int ret = Interop.Tapi.Network.SetNetworkMode(_handle, (int)mode, _response_map[id], id); - if (ret != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Failed to get the network mode, Error: " + (TapiError)ret); - TapiUtility.ThrowTapiException(ret, _handle, "http://tizen.org/privilege/telephony.admin"); - } - - return task.Task; - } - - /// - /// Get the network mode asynchronously. - /// - /// Value of NetworkMode. - /// http://tizen.org/privilege/telephony - /// http://tizen.org/feature/network.telephony - /// Thrown when feature is not supported. - /// Thrown when privilege access is denied. - /// Thrown when network instance is invalid or when method failed due to invalid operation. - public Task GetNetworkMode() - { - TaskCompletionSource task = new TaskCompletionSource(); - IntPtr id; - id = (IntPtr)_requestId++; - _response_map[id] = (IntPtr handle, int result, IntPtr dataResponse, IntPtr key) => - { - Task resultTask = new Task(() => - { - if (result != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Error occurs during getting the network mode, " + (TapiError)result); - task.SetException(new InvalidOperationException("Error occurs during getting the network mode, " + (TapiError)result)); - return; - } - - task.SetResult((NetworkMode)Marshal.ReadInt32(dataResponse)); - }); - - resultTask.Start(); - resultTask.Wait(); - _response_map.Remove(key); - }; - - int ret = Interop.Tapi.Network.GetNetworkMode(_handle, _response_map[id], id); - if (ret != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Failed to get the network mode, Error: " + (TapiError)ret); - TapiUtility.ThrowTapiException(ret, _handle, "http://tizen.org/privilege/telephony"); - } - - return task.Task; - } - - /// - /// Get the neighboring cell info asynchronously. - /// - /// Instance of NetworkNeighboringCell. - /// http://tizen.org/privilege/telephony - /// http://tizen.org/feature/network.telephony - /// Thrown when feature is not supported. - /// Thrown when privilege access is denied. - /// Thrown when network instance is invalid or when method failed due to invalid operation. - public Task GetNeighborCellNetwork() - { - TaskCompletionSource task = new TaskCompletionSource(); - IntPtr id; - id = (IntPtr)_requestId++; - _response_map[id] = (IntPtr handle, int result, IntPtr dataResponse, IntPtr key) => - { - Task resultTask = new Task(() => - { - if (result != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Error occurs during getting the neigboring cell info, " + (TapiError)result); - task.SetException(new InvalidOperationException("Error occurs during getting the neigboring cell info, " + (TapiError)result)); - return; - } - - NetworkNeighboringCellStruct cellStruct = Marshal.PtrToStructure(dataResponse); - NetworkNeighboringCell cell = NetworkStructConversions.ConvertNeighborCellStruct(cellStruct); - task.SetResult(cell); - }); - - resultTask.Start(); - resultTask.Wait(); - _response_map.Remove(key); - }; - - int ret = Interop.Tapi.Network.GetNetworkNeighborCell(_handle, _response_map[id], id); - if (ret != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Failed to get the neigboring cell info, Error: " + (TapiError)ret); - TapiUtility.ThrowTapiException(ret, _handle, "http://tizen.org/privilege/telephony"); - } - - return task.Task; - } - - /// - /// Enters or exits the emergency callback mode asynchronously. - /// - /// The emergency callback mode. - /// A task indicating whether the SetEmergencyCallbackMode method is done or not. - /// http://tizen.org/privilege/telephony.admin - /// platform - /// http://tizen.org/feature/network.telephony - /// Thrown when feature is not supported. - /// Thrown when privilege access is denied. - /// Thrown when network instance is invalid or when method failed due to invalid operation. - public Task SetEmergencyCallbackMode(NetworkEmergencyCallbackMode mode) - { - TaskCompletionSource task = new TaskCompletionSource(); - IntPtr id; - id = (IntPtr)_requestId++; - _response_map[id] = (IntPtr handle, int result, IntPtr dataResponse, IntPtr key) => - { - Task resultTask = new Task(() => - { - if (result != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Error occurs during setting the emergency callback mode, " + (TapiError)result); - task.SetException(new InvalidOperationException("Error occurs during setting the emergency callback mode, " + (TapiError)result)); - return; - } - - task.SetResult(true); - }); - - resultTask.Start(); - resultTask.Wait(); - _response_map.Remove(key); - }; - - int ret = Interop.Tapi.Network.SetNetworkEmergencyCallback(_handle, mode, _response_map[id], id); - if (ret != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Failed to set the emergency callback mode, Error: " + (TapiError)ret); - TapiUtility.ThrowTapiException(ret, _handle, "http://tizen.org/privilege/telephony.admin"); - } - - return task.Task; - } - - /// - /// Set the network roaming preference asynchronously. - /// - /// The network roaming preference. - /// A task indicating whether the SetRoamingPreference method is done or not. - /// http://tizen.org/privilege/telephony.admin - /// platform - /// http://tizen.org/feature/network.telephony - /// Thrown when feature is not supported. - /// Thrown when privilege access is denied. - /// Thrown when network instance is invalid or when method failed due to invalid operation. - public Task SetRoamingPreference(NetworkPreferred roamPref) - { - TaskCompletionSource task = new TaskCompletionSource(); - IntPtr id; - id = (IntPtr)_requestId++; - _response_map[id] = (IntPtr handle, int result, IntPtr dataResponse, IntPtr key) => - { - Task resultTask = new Task(() => - { - if (result != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Error occurs during setting the network roaming preference, " + (TapiError)result); - task.SetException(new InvalidOperationException("Error occurs during setting the network roaming preference, " + (TapiError)result)); - return; - } - - task.SetResult(true); - }); - - resultTask.Start(); - resultTask.Wait(); - _response_map.Remove(key); - }; - - int ret = Interop.Tapi.Network.SetNetworkRoamPreference(_handle, roamPref, _response_map[id], id); - if (ret != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Failed to set the network roaming preference, Error: " + (TapiError)ret); - TapiUtility.ThrowTapiException(ret, _handle, "http://tizen.org/privilege/telephony.admin"); - } - - return task.Task; - } - - /// - /// Get the network roaming preference asynchronously. - /// - /// Value of NetworkPreferred. - /// http://tizen.org/privilege/telephony - /// http://tizen.org/feature/network.telephony - /// Thrown when feature is not supported. - /// Thrown when privilege access is denied. - /// Thrown when network instance is invalid or when method failed due to invalid operation. - public Task GetRoamingPreference() - { - TaskCompletionSource task = new TaskCompletionSource(); - IntPtr id; - id = (IntPtr)_requestId++; - _response_map[id] = (IntPtr handle, int result, IntPtr dataResponse, IntPtr key) => - { - Task resultTask = new Task(() => - { - if (result != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Error occurs during getting the network roaming preference, " + (TapiError)result); - task.SetException(new InvalidOperationException("Error occurs during getting the network roaming preference, " + (TapiError)result)); - return; - } - - task.SetResult((NetworkPreferred)Marshal.ReadInt32(dataResponse)); - }); - - resultTask.Start(); - resultTask.Wait(); - _response_map.Remove(key); - }; - - int ret = Interop.Tapi.Network.GetNetworkRoamPreference(_handle, _response_map[id], id); - if (ret != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Failed to get the network roaming preference, Error: " + (TapiError)ret); - TapiUtility.ThrowTapiException(ret, _handle, "http://tizen.org/privilege/telephony"); - } - - return task.Task; - } - - /// - /// Set the default data subscription asynchronously. - /// - /// A task indicating whether the SetDefaultDataSubscription method is done or not. - /// http://tizen.org/privilege/telephony.admin - /// platform - /// http://tizen.org/feature/network.telephony - /// Thrown when feature is not supported. - /// Thrown when privilege access is denied. - /// Thrown when network instance is invalid or when method failed due to invalid operation. - public Task SetDefaultDataSubscription() - { - TaskCompletionSource task = new TaskCompletionSource(); - IntPtr id; - id = (IntPtr)_requestId++; - _response_map[id] = (IntPtr handle, int result, IntPtr dataResponse, IntPtr key) => - { - Task resultTask = new Task(() => - { - if (result != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Error occurs during setting the default data subscription, " + (TapiError)result); - task.SetException(new InvalidOperationException("Error occurs during setting the default data subscription, " + (TapiError)result)); - return; - } - - task.SetResult(true); - }); - - resultTask.Start(); - resultTask.Wait(); - _response_map.Remove(key); - }; - - int ret = Interop.Tapi.Network.SetNetworkDefaultDataSubs(_handle, _response_map[id], id); - if (ret != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Failed to set the default data subscription, Error: " + (TapiError)ret); - TapiUtility.ThrowTapiException(ret, _handle, "http://tizen.org/privilege/telephony.admin"); - } - - return task.Task; - } - - /// - /// Get the default data subscription. - /// - /// Value of NetworkDefaultDataSubscription. - /// http://tizen.org/privilege/telephony - /// http://tizen.org/feature/network.telephony - /// Thrown when feature is not supported. - /// Thrown when privilege access is denied. - /// Thrown when network instance is invalid or when method failed due to invalid operation. - public NetworkDefaultDataSubscription GetDefaultDataSubscription() - { - NetworkDefaultDataSubscription defaultDataSubs; - int ret = Interop.Tapi.Network.GetNetworkDefaultDataSubs(_handle, out defaultDataSubs); - if (ret != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Failed to get the default data subscription, Error: " + (TapiError)ret); - TapiUtility.ThrowTapiException(ret, _handle, "http://tizen.org/privilege/telephony"); - } - - return defaultDataSubs; - } - - /// - /// Set the default subscription for voice asynchronously. - /// - /// A task indicating whether the SetNetworkDefaultSubscription method is done or not. - /// http://tizen.org/privilege/telephony.admin - /// platform - /// http://tizen.org/feature/network.telephony - /// Thrown when feature is not supported. - /// Thrown when privilege access is denied. - /// Thrown when network instance is invalid or when method failed due to invalid operation. - public Task SetNetworkDefaultSubscription() - { - TaskCompletionSource task = new TaskCompletionSource(); - IntPtr id; - id = (IntPtr)_requestId++; - _response_map[id] = (IntPtr handle, int result, IntPtr dataResponse, IntPtr key) => - { - Task resultTask = new Task(() => - { - if (result != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Error occurs during setting the default subscription for voice, " + (TapiError)result); - task.SetException(new InvalidOperationException("Error occurs during setting the default subscription for voice, " + (TapiError)result)); - return; - } - - task.SetResult(true); - }); - - resultTask.Start(); - resultTask.Wait(); - _response_map.Remove(key); - }; - - int ret = Interop.Tapi.Network.SetNetworkDefaultDataSubs(_handle, _response_map[id], id); - if (ret != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Failed to set the default subscription for voice, Error: " + (TapiError)ret); - TapiUtility.ThrowTapiException(ret, _handle, "http://tizen.org/privilege/telephony.admin"); - } - - return task.Task; - } - - /// - /// Get the default subscription for voice. - /// - /// Value of NetworkDefaultSubscription. - /// http://tizen.org/privilege/telephony - /// http://tizen.org/feature/network.telephony - /// Thrown when feature is not supported. - /// Thrown when privilege access is denied. - /// Thrown when network instance is invalid or when method failed due to invalid operation. - public NetworkDefaultSubscription GetNetworkDefaultSubscription() - { - NetworkDefaultSubscription defaultSubs; - int ret = Interop.Tapi.Network.GetNetworkDefaultSubs(_handle, out defaultSubs); - if (ret != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Failed to get the default subscription, Error: " + (TapiError)ret); - TapiUtility.ThrowTapiException(ret, _handle, "http://tizen.org/privilege/telephony"); - } - - return defaultSubs; - } - } -} diff --git a/src/Tizen.Tapi/Tizen.Tapi/NetworkData.cs b/src/Tizen.Tapi/Tizen.Tapi/NetworkData.cs deleted file mode 100755 index ed4a3ba3e..000000000 --- a/src/Tizen.Tapi/Tizen.Tapi/NetworkData.cs +++ /dev/null @@ -1,1275 +0,0 @@ -/* - * 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.Collections.Generic; - -namespace Tizen.Tapi -{ - /// - /// A class which defines network registration status. - /// - public class NetworkRegistrationStatus - { - internal NetworkServiceLevel Cs; - internal NetworkServiceLevel Ps; - internal NetworkServiceType SvcType; - internal bool Roaming; - - internal NetworkRegistrationStatus() - { - } - - /// - /// Circuit Switched status. - /// - /// Status of circuit switched data. - public NetworkServiceLevel CircuitStatus - { - get - { - return Cs; - } - } - - /// - /// Packet Switched status. - /// - /// Status of packet switched data. - public NetworkServiceLevel PacketStatus - { - get - { - return Ps; - } - } - - /// - /// Registration service type. - /// - /// Service type represented in NetworkServiceType enum. - public NetworkServiceType Type - { - get - { - return SvcType; - } - } - - /// - /// Roaming status - /// - /// Boolean value to check the roaming status. - public bool IsRoaming - { - get - { - return Roaming; - } - } - } - - /// - /// A class which defines network cell info notification. - /// - public class NetworkCellNoti - { - internal int Location; - internal int Id; - - internal NetworkCellNoti() - { - } - - /// - /// Location Area Code (In case of LTE network, it represents Tracking Area Code). - /// - /// Location area code represented in integer. - public int Lac - { - get - { - return Location; - } - } - - /// - /// Cell ID. - /// - /// Cell id represented in integer. - public int CellId - { - get - { - return Id; - } - } - } - - /// - /// A class which defines network change notification. - /// - public class NetworkChangeNoti - { - internal NetworkSystemType Type; - internal string NwPlmn; - - internal NetworkChangeNoti() - { - } - - /// - /// Access technology. - /// - /// Access technology represented in NetworkSystemType enum. - public NetworkSystemType Act - { - get - { - return Type; - } - } - - /// - /// Network PLMN. - /// - /// Plmn value represented as string. - public string Plmn - { - get - { - return NwPlmn; - } - } - } - - /// - /// A class which defines network time notification. - /// - public class NetworkTimeNoti - { - internal DateTime TimeInfo; - internal int WDayInfo; - internal int GmtOffInfo; - internal int DstOffInfo; - internal bool Dst; - internal string NetworkPlmn; - - internal NetworkTimeNoti() - { - } - - /// - /// Date time information. - /// - /// An instance of DateTime representing date time information. - public DateTime Time - { - get - { - return TimeInfo; - } - } - - /// - /// Wday information. - /// - /// Wday info represented in integer. - public int WDay - { - get - { - return WDayInfo; - } - } - - /// - /// GMT Off. - /// - /// GMT off info represented in integer. - public int GmtOff - { - get - { - return GmtOffInfo; - } - } - - /// - /// DST Off. - /// - /// DST off info represented in integer. - public int DstOff - { - get - { - return DstOffInfo; - } - } - - /// - /// Flag for checking if it is DST. - /// - /// Boolean value to check if the time is DST or not. - public bool IsDst - { - get - { - return Dst; - } - } - - /// - /// Network PLMN. - /// - /// PLMN value represented in string. - public string Plmn - { - get - { - return NetworkPlmn; - } - } - } - - /// - /// A class which defines network identity notification. - /// - public class NetworkIdentityNoti - { - internal string NwPlmn; - internal string NwShortName; - internal string NwFullName; - - internal NetworkIdentityNoti() - { - } - - /// - /// Network PLMN. - /// - /// Plmn value represented in string. - public string Plmn - { - get - { - return NwPlmn; - } - } - - /// - /// Short network name. - /// - /// Short name of the network in string. - public string ShortName - { - get - { - return NwShortName; - } - } - - /// - /// Full network name. - /// - /// Full name of the network in string. - public string FullName - { - get - { - return NwFullName; - } - } - } - - /// - /// A class which defines network VoLTE status notification. - /// - public class NetworkVolteStatus - { - internal bool NwIsRegistered; - internal int NwFeatureMask; - internal VolteNetworkType NwType; - - internal NetworkVolteStatus() - { - } - - /// - /// VoLTE status. - /// - /// Boolean value to check if it is registered. - public bool IsRegistered - { - get - { - return NwIsRegistered; - } - } - - /// - /// Services registered for. - /// - /// Service mask represented in integer. - public int FeatureMask - { - get - { - return NwFeatureMask; - } - } - - /// - /// Network on which VoLTE is registered. - /// - /// Type of VoLTE network represented in VolteNetworkType enum. - public VolteNetworkType Type - { - get - { - return NwType; - } - } - } - - /// - /// A class which defines network identity. - /// - public class NetworkIdentity - { - internal string IdName; - internal string SvcProviderName; - internal string PlmnName; - internal uint Id; - internal NetworkPlmnType PlmnNwType; - internal NetworkSystemType SysType; - internal NetworkIdentity() - { - } - - /// - /// Network name. - /// - public string Name - { - get - { - return IdName; - } - } - - /// - /// Service provider name. - /// - public string ServiceProviderName - { - get - { - return SvcProviderName; - } - } - - /// - /// Network plmn. - /// - public string Plmn - { - get - { - return PlmnName; - } - } - - /// - /// Plmn Id. - /// - public uint PlmnId - { - get - { - return Id; - } - } - - /// - /// Plmn type. - /// - public NetworkPlmnType PlmnType - { - get - { - return PlmnNwType; - } - } - - /// - /// Access technology. - /// - public NetworkSystemType SystemType - { - get - { - return SysType; - } - } - } - - /// - /// A class for the network plmn list. - /// - public class NetworkPlmnList - { - internal byte NwCount; - internal IEnumerable NwList; - - internal NetworkPlmnList() - { - } - - /// - /// Network plmn count. - /// - /// Count of the network plmn. - public byte NetworkCount - { - get - { - return NwCount; - } - } - - /// - /// Network list. - /// - /// List of NetworkIdentity. - public IEnumerable NetworkList - { - get - { - return NwList; - } - } - } - - /// - /// A class which defines the preferred plmn information. - /// - public class NetworkPreferredPlmnInfo - { - internal byte idex; - internal string NwPlmn; - internal string NwName; - internal string SvcProvName; - internal NetworkSystemType SysType; - - /// - /// Preferred plmn list index. - /// - ///Index of preferred plmn list. - public byte Index - { - get - { - return idex; - } - - set - { - idex = value; - } - } - - /// - /// Preferred plmn. - /// - /// Plmn string. - public string Plmn - { - get - { - return NwPlmn; - } - - set - { - NwPlmn = value; - } - } - - /// - /// Network name. - /// - /// Name of network. - public string NetworkName - { - get - { - return NwName; - } - - set - { - NwName = value; - } - } - - /// - /// Service provider name. - /// - /// Name of service provider. - public string ServiceProviderName - { - get - { - return SvcProvName; - } - - set - { - SvcProvName = value; - } - } - - /// - /// System type of network. - /// - /// System type of network. - public NetworkSystemType SystemType - { - get - { - return SysType; - } - - set - { - SysType = value; - } - } - } - - /// - /// A class containing information related to a cdma system. - /// - public class NetworkCdmaSysInfo - { - internal int Car; - internal uint SysId; - internal uint NwId; - internal uint BaseStnId; - internal int BaseStnLatitude; - internal int BaseStnLongitude; - internal uint RegZone; - internal uint Offset; - internal NetworkCdmaSysInfo() - { - } - - /// - /// Cdma carrier. - /// - /// Cdma carrier. - public int Carrier - { - get - { - return Car; - } - } - - /// - /// System Id. - /// - /// System Id. - public uint SystemId - { - get - { - return SysId; - } - } - - /// - /// Network Id. - /// - /// Id of network. - public uint NetworkId - { - get - { - return NwId; - } - } - - /// - /// Base station Id. - /// - /// Id of base station. - public uint BaseStationId - { - get - { - return BaseStnId; - } - } - - /// - /// Latitude of the current base station. - /// - /// Latitude of the current base station. - public int BaseStationLatitude - { - get - { - return BaseStnLatitude; - } - } - - /// - /// Longitude of the current base station. - /// - /// Longitude of the current base station. - public int BaseStationLongitude - { - get - { - return BaseStnLongitude; - } - } - - /// - /// Registration zone. - /// - /// Registration zone. - public uint RegistrationZone - { - get - { - return RegZone; - } - } - - /// - /// Pilot offset. - /// - /// Offset of pilot. - public uint PilotOffset - { - get - { - return Offset; - } - } - } - - /// - /// A class containing information about network area. - /// - public class NetworkAreaInfo - { - internal int Code; - internal NetworkCdmaSysInfo Cdma; - internal NetworkAreaInfo() - { - } - - /// - /// Location area code. - /// - /// Area code of location. - public int Lac - { - get - { - return Code; - } - } - - /// - /// Instance of NetworkCdmaSysInfo. - /// - /// Instance of NetworkCdmaSysInfo. - public NetworkCdmaSysInfo CdmaInfo - { - get - { - return Cdma; - } - } - } - - /// - /// A class containing information of serving network. - /// - public class NetworkServing - { - internal NetworkSystemType Type; - internal string NwPlmn; - internal NetworkAreaInfo Area; - internal NetworkServing() - { - } - - /// - /// Access technology. - /// - /// System type of network. - public NetworkSystemType SystemType - { - get - { - return Type; - } - } - - /// - /// Network plmn. - /// - /// Plmn of network. - public string Plmn - { - get - { - return NwPlmn; - } - } - - /// - /// Area information of network. - /// - /// Instance of NetworkAreaInfo. - public NetworkAreaInfo AreaInfo - { - get - { - return Area; - } - } - } - - /// - /// A class containing information of cdma cell. - /// - public class NetworkCdmaCell - { - internal uint SysId; - internal uint NwId; - internal uint BaseStnId; - internal uint RefPn; - internal int BaseStnLatitude; - internal int BaseStnLongitude; - internal NetworkCdmaCell() - { - } - - /// - /// System Id info. - /// - /// System Id. - public uint SystemId - { - get - { - return SysId; - } - } - - /// - /// Network Id. - /// - /// Network Id. - public uint NetworkId - { - get - { - return NwId; - } - } - - /// - /// Base station Id. - /// - /// Base station id. - public uint BaseStationId - { - get - { - return BaseStnId; - } - } - - /// - /// Reference pn. - /// - /// Reference pn. - public uint ReferencePn - { - get - { - return RefPn; - } - } - - /// - /// Latitude of the current base station. - /// - /// Latitude of the current base station. - public int BaseStationLatitude - { - get - { - return BaseStnLatitude; - } - } - - /// - /// Longitude of the current base station. - /// - /// Longitude of the current base station. - public int BaseStationLongitude - { - get - { - return BaseStnLongitude; - } - } - } - - /// - /// A class containing information of lte cell. - /// - public class NetworkLteCell - { - internal int Id; - internal int Lc; - internal int PId; - internal int Erf; - internal int Tc; - internal int Rs; - internal NetworkLteCell() - { - } - - /// - /// Value of cell Id. -1 indicates that cell Id information is not present. - /// - /// Cell Id. - public int CellId - { - get - { - return Id; - } - } - - /// - /// Location area code. This field is ignored when CellId is not present. - /// - /// Code of area. - public int Lac - { - get - { - return Lc; - } - } - - /// - /// Physical cell id info. - /// - /// Physical cell id. - public int PhysicalId - { - get - { - return PId; - } - } - - /// - /// E-Utra absolute rf channel number. - /// - /// E-Utra absolute rf channel number. - public int Earfcn - { - get - { - return Erf; - } - } - - /// - /// Tracking area code. - /// - /// Area code for tracking. - public int Tac - { - get - { - return Tc; - } - } - - /// - /// Rssi in dBm(signed) - /// - /// Rssi in dBm. - public int Rssi - { - get - { - return Rs; - } - } - } - - /// - /// A class containing information of umts cell. - /// - public class NetworkUmtsCell - { - internal int Id; - internal int Lc; - internal int Arf; - internal int Ps; - internal int Rsc; - internal NetworkUmtsCell() - { - } - - /// - /// Ucid. -1 indicates that cell Id information is not present. - /// - /// RNCID + Cell ID(16 bit). - public int CellId - { - get - { - return Id; - } - } - - /// - /// Location area code. This field is ignored when CellId is not present. - /// - /// Code of area. - public int Lac - { - get - { - return Lc; - } - } - - /// - /// Utra absolute rf channel number. - /// - /// Utra absolute rf channel number. - public int Arfcn - { - get - { - return Arf; - } - } - - /// - /// Primary scrambling code. - /// - /// Primary scrambling code. - public int Psc - { - get - { - return Ps; - } - } - - /// - /// Received signal code power. Valid values are (0-96, 255). - /// - /// Power of received signal code. - public int Rscp - { - get - { - return Rsc; - } - } - - } - - /// - /// A class containing information of geran cell. - /// - public class NetworkGeranCell - { - internal int Id; - internal int Lc; - internal int Bc; - internal int Bs; - internal int Rx; - internal NetworkGeranCell() - { - } - - /// - /// Value of cell Id. -1 indicates that cell Id information is not present. - /// - /// Cell Id. - public int CellId - { - get - { - return Id; - } - } - - /// - /// Location area code. This field is ignored when CellId is not present. - /// - /// Code of area. - public int Lac - { - get - { - return Lc; - } - } - - /// - /// Broadcast control channel frequency number. - /// - /// Broadcast control channel frequency number. - public int Bcch - { - get - { - return Bc; - } - } - - /// - /// Base station identification code. - /// - /// Id code of base station. - public int Bsic - { - get - { - return Bs; - } - } - - /// - /// Received signal strength level. Valid values are (0-63, 99). - /// - /// Strength of received signal. - public int Rxlev - { - get - { - return Rx; - } - } - } - - /// - /// A class which contains geran, umts, cdma and lte cell information. - /// - public class Cell - { - internal NetworkGeranCell Geran; - internal NetworkCdmaCell Cdma; - internal NetworkUmtsCell Umts; - internal NetworkLteCell Lte; - internal Cell() - { - } - - /// - /// Geran cell information. - /// - /// Instance of NetworkGeranCell. - public NetworkGeranCell GeranCell - { - get - { - return Geran; - } - } - - /// - /// Cdma cell information. - /// - /// Instance of NetworkCdmaCell. - public NetworkCdmaCell CdmaCell - { - get - { - return Cdma; - } - } - - /// - /// Umts cell information. - /// - /// Instance of NetworkUmtsCell. - public NetworkUmtsCell UmtsCell - { - get - { - return Umts; - } - } - - /// - /// Lte cell information. - /// - /// Instance of NetworkLteCell. - public NetworkLteCell LteCell - { - get - { - return Lte; - } - } - } - - /// - /// A class which contains serving cell information. - /// - public class NetworkServingCell - { - internal NetworkSystemType SysType; - internal int MCountryCode; - internal int MNwCode; - internal Cell Info; - internal NetworkServingCell() - { - } - - /// - /// Access technology. - /// - /// Network system type. - public NetworkSystemType SystemType - { - get - { - return SysType; - } - } - - /// - /// Mobile country code. - /// - /// Country code of the mobile. - public int MobileCountryCode - { - get - { - return MCountryCode; - } - } - - /// - /// Mobile network code. - /// - /// Network code of the mobile. - public int MobileNetworkCode - { - get - { - return MNwCode; - } - } - - /// - /// Information of cell. - /// - ///Instance of Cell. - public Cell CellInfo - { - get - { - return Info; - } - } - } - - /// - /// A class which contains neighboring cell information. - /// - public class NetworkNeighboringCell - { - internal NetworkServingCell ServCell; - internal IEnumerable GrList; - internal IEnumerable UmtList; - internal IEnumerable LtList; - internal NetworkNeighboringCell() - { - } - - /// - /// Serving cell information. - /// - /// Instance of NetworkServingCell. - public NetworkServingCell ServingCell - { - get - { - return ServCell; - } - } - - /// - /// Geran cell info list. - /// - /// List of NetworkGeranCell. - public IEnumerable GeranList - { - get - { - return GrList; - } - } - - /// - /// Umts cell info list. - /// - /// List of NetworkUmtsCell. - public IEnumerable UmtsList - { - get - { - return UmtList; - } - } - - /// - /// Lte cell info list. - /// - /// List of NetworkLteCell. - public IEnumerable LteList - { - get - { - return LtList; - } - } - } -} diff --git a/src/Tizen.Tapi/Tizen.Tapi/NetworkEnumerations.cs b/src/Tizen.Tapi/Tizen.Tapi/NetworkEnumerations.cs deleted file mode 100755 index f047dfb71..000000000 --- a/src/Tizen.Tapi/Tizen.Tapi/NetworkEnumerations.cs +++ /dev/null @@ -1,490 +0,0 @@ -/* - * 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. - */ - -namespace Tizen.Tapi -{ - /// - /// Enumeration for the status of the network service. - /// - public enum NetworkServiceLevel - { - /// - /// No service available in the network ME is camped. - /// - No, - /// - /// Only emergency service available in the network ME is camped. - /// - Emergency, - /// - /// FULL service available in the network ME is camped - /// - Full, - /// - /// Searching for service. - /// - Search - } - - /// - /// Enumeration for the service types of TAPI. - /// - public enum NetworkServiceType - { - /// - /// Service type is Unknown. - /// - Unknown = 0x0, - /// - /// No Service available. - /// - NoService, - /// - /// Service type is Emergency. - /// - Emergency, - /// - /// Service type is Searching. - /// - Search, - /// - /// Service type is 2G. In case of CDMA, service type is set to 2G when System Type is IS95A/IS95B/CDMA_1X. - /// - Type2G, - /// - /// Service type is 2.5G. - /// - Type2And5G, - /// - /// Service type is 2.5G (EDGE). - /// - TypeAnd5GEdge, - /// - /// Service type is 3G. In case of CDMA, service type is set to 3G when System Type is EVDO_REV_0/REV_A/REV_B/EHRPD. - /// - Type3G, - /// - /// Service type is HSDPA. - /// - Hsdpa, - /// - /// Service type is LTE. - /// - Lte - } - - /// - /// Enumeration for the system types of network. - /// - public enum NetworkSystemType - { - /// - /// No Service available. - /// - NoService = 0x01, - /// - /// Available service is GSM. - /// - Gsm, - /// - /// Available service is GPRS. - /// - Gprs, - /// - /// Available service is EGPRS. - /// - EGprs, - /// - /// Available service is PCS1900 band. - /// - Pcs1900, - /// - /// Available service is UMTS. - /// - Umts, - /// - /// Both GSM and UMTS systems available. - /// - GsmandUmts, - /// - /// Available service is HSDPA. - /// - Hsdpa, - /// - /// Available service is IS95A. - /// - Is95A, - /// - /// Available service is IS95B. - /// - Is95B, - /// - /// Available service is CDMA 1X. - /// - Cdma1x, - /// - /// Available service is EV-DO rev0. - /// - EvdoRev0, - /// - /// Available service is 1X and EV-DO rev0. - /// - Hybrid1xandEvdoRev0, - /// - /// Available service is EV-DO revA. - /// - EvdoRevA, - /// - /// Available service is 1X and EV-DO revA. - /// - Hybrid1xandEvdoRevA, - /// - /// Available service is EV-DO revB. - /// - EvdoRevB, - /// - /// Available service is 1X and EV-DO revB. - /// - Hybrid1xandEvdoRevB, - /// - /// Available service is EV-DV. - /// - Evdv, - /// - /// Available service is EHRPD. - /// - Ehrpd, - /// - /// Available service is LTE. - /// - Lte - } - - /// - /// Enumeration for the network emergency callback mode states (3GPP2 specific enum). - /// - public enum NetworkEmergencyCallbackMode - { - /// - /// Enter emergency callback mode. - /// - Enter, - /// - /// Exit emergency callback mode. - /// - Exit - } - - /// - /// Enumeration for the possible default Data Subscriptions. - /// - public enum NetworkDefaultDataSubscription - { - /// - /// Unknown status. - /// - Unknown = -1, - /// - /// SIM 1. - /// - Sim1 = 0, - /// - /// SIM 2. - /// - Sim2 - } - - /// - /// Enumeration for the possible default Subscriptions for CS (Voice). - /// - public enum NetworkDefaultSubscription - { - /// - /// Unknown status. - /// - Unknown = -1, - /// - /// SIM 1 network. - /// - Sim1 = 0, - /// - /// SIM 2 network. - /// - Sim2 - } - - /// - /// Enumeration for type of network on which VoLTE is registered. - /// - public enum VolteNetworkType - { - /// - /// Unknown. - /// - Unknown, - /// - /// Mobile. - /// - Mobile, - /// - /// WiFi. - /// - Wifi - } - - /// - /// Enumeration for the packet service protocol type. - /// - public enum NetworkPsType - { - /// - /// Unknown PS type. - /// - Unknown, - /// - /// HSDPA. - /// - Hsdpa, - /// - /// HSUPA. - /// - Hsupa, - /// - /// HSPA. - /// - Hspa, - /// - /// HSPAP. - /// - Hspap - } - - /// - /// Enumeration for the network name display condition type. - /// - public enum NetworkNameDisplayCondition - { - /// - /// Invalid Display Condition. - /// - Invalid = 0x00, - /// - /// Display Condition is SPN. - /// - Spn = 0x01, - /// - /// Display Condition is PLMN. - /// - Plmn = 0x02, - /// - /// Display Condition is SPN or PLMN. - /// - SpnOrPlmn = 0x03 - } - - /// - /// Enumeration for the different serving network LTE band type. - /// - public enum NetworkLteBandType - { - /// - /// Unknown. - /// - Unknown = 0x00, - /// - /// FDD. - /// - Fdd, - /// - /// TDD. - /// - Tdd - } - - /// - /// Enumeration for the operation that can be done on a preferred PLMN. - /// - public enum NetworkPreferredPlmnOp - { - /// - /// Addition to the Network Preferred PLMN list. - /// - Add = 0x01, - /// - /// Edit the network Preferred PLMN list. - /// - Edit, - /// - /// Delete the entry to the network Preferred PLMN list. - /// - Delete - } - - /// - /// Enumeration for the CDMA Preferred Network Type(CDMA only). - /// - public enum NetworkPreferred - { - /// - /// Home only. - /// - HomeOnly, - /// - /// Affiliated. - /// - Affiliated, - /// - /// Automatic. - /// - Automatic, - /// - /// Automatic-A. - /// - AutomaticA, - /// - /// Automatic-B. - /// - AutomaticB, - /// - /// Roam domestic. - /// - RoamDomestic, - /// - /// Roam international. - /// - RoamInternational, - /// - /// Roam dual. - /// - RoamDual, - /// - /// Blank. - /// - Blank - } - - /// - /// Enumeration for the different network operation causes. - /// - public enum NetworkOperationCause - { - /// - /// No error for any operation. - /// - NoError, - /// - /// Aborted. - /// - Aborted, - /// - /// Error. - /// - Failed, - /// - /// Phone is in use(eg: Voice / Data call in progress). - /// - PhoneInUse, - /// - /// Phone is in offline mode. - /// - Offline, - /// - /// Modem is unable to process the config settings information. - /// - ConfigSettingsFailure, - /// - /// Internal failure. - /// - InternalFailure, - /// - /// Memory is full. - /// - MemoryFull - } - - /// - /// Enumeration for the network plmn type. - /// - public enum NetworkPlmnType - { - /// - /// Unknown. - /// - Unknown, - /// - /// Home plmn. - /// - Home, - /// - /// Available. - /// - Available, - /// - /// Forbidden. - /// - Forbidden - } - - /// - /// Enumeration for the network selection mode. - /// - public enum NetworkSelectionMode - { - /// - /// Automatic selection mode. - /// - Auto, - /// - /// Manual selection mode (Not applicable to CDMA). - /// - Manual - } - - /// - /// Enumeration for the different network modes. - /// - public enum NetworkMode - { - /// - /// Auto. - /// - Auto = 0x00, - /// - /// Gsm. - /// - Gsm = 0x01, - /// - /// Wcdma. - /// - Wcdma = 0x02, - /// - /// Rtt1x. - /// - Rtt1x = 0x04, - /// - /// Lte. - /// - Lte = 0x08, - /// - /// Evdo. - /// - Evdo = 0x10, - /// - /// Cdma. - /// - Cdma = 0x14 - } -} diff --git a/src/Tizen.Tapi/Tizen.Tapi/NetworkStructs.cs b/src/Tizen.Tapi/Tizen.Tapi/NetworkStructs.cs deleted file mode 100755 index 5d180f56b..000000000 --- a/src/Tizen.Tapi/Tizen.Tapi/NetworkStructs.cs +++ /dev/null @@ -1,506 +0,0 @@ -/* - * 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.Collections.Generic; -using System.Runtime.InteropServices; - -namespace Tizen.Tapi -{ - [StructLayout(LayoutKind.Sequential)] - internal struct NetworkRegistrationStatusStruct - { - internal NetworkServiceLevel Cs; - internal NetworkServiceLevel Ps; - internal NetworkServiceType Type; - internal int IsRoaming; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct NetworkCellNotiStruct - { - internal int Lac; - internal int CellId; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct NetworkChangeNotiStruct - { - internal NetworkSystemType Act; - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 7)] - internal string Plmn; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct NetworkTimeNotiStruct - { - internal int Year; - internal int Month; - internal int Day; - internal int Hour; - internal int Minute; - internal int Second; - internal int WDay; - internal int GmtOff; - internal int DstOff; - internal int IsDst; - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 7)] - internal string Plmn; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct NetworkIdentityNotiStruct - { - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 7)] - internal string Plmn; - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 17)] - internal string ShortName; - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 33)] - internal string FullName; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct NetworkVolteStatusStruct - { - internal int IsRegistered; - internal int FeatureMask; - internal VolteNetworkType NetworkType; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct NetworkPreferredPlmnStruct - { - internal byte Index; - [MarshalAs(UnmanagedType.ByValTStr, SizeConst=7)] - internal string Plmn; - [MarshalAs(UnmanagedType.ByValTStr, SizeConst=41)] - internal string NetworkName; - [MarshalAs(UnmanagedType.ByValTStr, SizeConst=41)] - internal string SnName; - internal NetworkSystemType Type; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct NetworkIdentityStruct - { - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 41)] - internal string NwName; - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 41)] - internal string SvcName; - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 7)] - internal string NwPlmn; - internal uint PlmnId; - internal NetworkPlmnType Type; - internal NetworkSystemType Act; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct NetworkPlmnListStruct - { - internal byte NwCount; - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 20, ArraySubType = UnmanagedType.LPStruct)] - internal NetworkIdentityStruct[] NwList; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct NetworkPreferredPlmnListStruct - { - internal uint Count; - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 150, ArraySubType = UnmanagedType.LPStruct)] - internal NetworkPreferredPlmnStruct[] PlmnList; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct NetworkCdmaSysStruct - { - internal int Carrier; - internal uint SysId; - internal uint NwId; - internal uint BaseStnId; - internal int BaseStnLatitude; - internal int BaseStnLongitude; - internal uint RegZone; - internal uint Offset; - } - - [StructLayout(LayoutKind.Explicit)] - internal struct NetworkAreaStruct - { - [FieldOffset(0)] - internal int Lac; - [FieldOffset(0)] - internal NetworkCdmaSysStruct Cdma; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct NetworkServingStruct - { - internal NetworkSystemType SysType; - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 7)] - internal string Plmn; - internal NetworkAreaStruct Area; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct NetworkGeranCellStruct - { - internal int CellId; - internal int Lac; - internal int Bcch; - internal int Bsic; - internal int Rxlev; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct NetworkUmtsCellStruct - { - internal int CellId; - internal int Lac; - internal int Arfcn; - internal int Psc; - internal int Rscp; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct NetworkLteCellStruct - { - internal int CellId; - internal int Lac; - internal int Pcid; - internal int Earfcn; - internal int Tac; - internal int Rssi; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct NetworkCdmaCellStruct - { - internal uint SystemId; - internal uint NetworkId; - internal uint BaseId; - internal uint RefPn; - internal int BaseStnLatitude; - internal int BaseStnLongitude; - } - - [StructLayout(LayoutKind.Explicit)] - internal struct CellStruct - { - [FieldOffset(0)] - internal NetworkGeranCellStruct Geran; - [FieldOffset(0)] - internal NetworkUmtsCellStruct Umts; - [FieldOffset(0)] - internal NetworkLteCellStruct Lte; - [FieldOffset(0)] - internal NetworkCdmaCellStruct Cdma; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct NetworkServingCellStruct - { - internal NetworkSystemType SystemType; - internal int MobileCountryCode; - internal int MobileNetworkCode; - internal CellStruct Cell; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct NetworkNeighboringCellStruct - { - internal NetworkServingCellStruct ServCell; - internal int GeranCount; - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 6, ArraySubType = UnmanagedType.LPStruct)] - internal NetworkGeranCellStruct[] GeranList; - internal int UmtsCount; - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 24, ArraySubType = UnmanagedType.LPStruct)] - internal NetworkUmtsCellStruct[] UmtsList; - internal int LteCount; - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 24, ArraySubType = UnmanagedType.LPStruct)] - internal NetworkLteCellStruct[] LteList; - } - - internal static class NetworkStructConversions - { - internal static NetworkRegistrationStatus ConvertNetworkRegistrationStruct(NetworkRegistrationStatusStruct statusStruct) - { - NetworkRegistrationStatus status = new NetworkRegistrationStatus(); - status.Cs = statusStruct.Cs; - status.Ps = statusStruct.Ps; - status.SvcType = statusStruct.Type; - if (statusStruct.IsRoaming == 1) - { - status.Roaming = true; - } - - else if (statusStruct.IsRoaming == 0) - { - status.Roaming = false; - } - - return status; - } - - internal static NetworkCellNoti ConvertNetworkCellNotiStruct(NetworkCellNotiStruct notiStruct) - { - NetworkCellNoti noti = new NetworkCellNoti(); - noti.Location = notiStruct.Lac; - noti.Id = notiStruct.CellId; - return noti; - } - - internal static NetworkChangeNoti ConvertNetworkChangeStruct(NetworkChangeNotiStruct changeStruct) - { - NetworkChangeNoti changeNoti = new NetworkChangeNoti(); - changeNoti.Type = changeStruct.Act; - changeNoti.NwPlmn = changeStruct.Plmn; - return changeNoti; - } - - internal static NetworkTimeNoti ConvertNetworkTimeNotiStruct(NetworkTimeNotiStruct notiStruct) - { - NetworkTimeNoti time = new NetworkTimeNoti(); - time.TimeInfo = new DateTime(notiStruct.Year, notiStruct.Month, notiStruct.Day, notiStruct.Hour, notiStruct.Minute, notiStruct.Second); - time.WDayInfo = notiStruct.WDay; - time.GmtOffInfo = notiStruct.GmtOff; - time.DstOffInfo = notiStruct.DstOff; - if (notiStruct.IsDst == 1) - { - time.Dst = true; - } - - else if (notiStruct.IsDst == 0) - { - time.Dst = false; - } - - time.NetworkPlmn = notiStruct.Plmn; - return time; - } - - internal static NetworkIdentityNoti ConvertNetworkIdentityStruct(NetworkIdentityNotiStruct notiStruct) - { - NetworkIdentityNoti identity = new NetworkIdentityNoti(); - identity.NwPlmn = notiStruct.Plmn; - identity.NwShortName = notiStruct.ShortName; - identity.NwFullName = notiStruct.FullName; - return identity; - } - - internal static NetworkVolteStatus ConvertNetworkVolteStruct(NetworkVolteStatusStruct notiStruct) - { - NetworkVolteStatus volteStatus = new NetworkVolteStatus(); - if (notiStruct.IsRegistered == 1) - { - volteStatus.NwIsRegistered = true; - } - - else if (notiStruct.IsRegistered == 0) - { - volteStatus.NwIsRegistered = false; - } - - volteStatus.NwFeatureMask = notiStruct.FeatureMask; - volteStatus.NwType = notiStruct.NetworkType; - return volteStatus; - } - - internal static NetworkPlmnList ConvertNetworkPlmnListStruct(NetworkPlmnListStruct listStruct) - { - NetworkPlmnList plmnList = new NetworkPlmnList(); - List records = new List(); - - foreach (NetworkIdentityStruct idStruct in listStruct.NwList) - { - NetworkIdentity identity = new NetworkIdentity(); - identity.Id = idStruct.PlmnId; - identity.SvcProviderName = idStruct.SvcName; - identity.IdName = idStruct.NwName; - identity.PlmnName = idStruct.NwPlmn; - identity.PlmnNwType = idStruct.Type; - identity.SysType = idStruct.Act; - records.Add(identity); - } - - plmnList.NwCount = listStruct.NwCount; - plmnList.NwList = records; - return plmnList; - } - - internal static IEnumerable ConvertNetworkPreferredPlmnStruct(NetworkPreferredPlmnListStruct plmnStruct) - { - List plmnList = new List(); - - for (int i = 0; i <= plmnStruct.Count; i++) - { - NetworkPreferredPlmnInfo plmnInfo = new NetworkPreferredPlmnInfo(); - plmnInfo.idex = plmnStruct.PlmnList[i].Index; - plmnInfo.NwName = plmnStruct.PlmnList[i].NetworkName; - plmnInfo.NwPlmn = plmnStruct.PlmnList[i].Plmn; - plmnInfo.SvcProvName = plmnStruct.PlmnList[i].SnName; - plmnInfo.SysType = plmnStruct.PlmnList[i].Type; - plmnList.Add(plmnInfo); - } - - return plmnList; - } - - internal static NetworkCdmaSysInfo ConvertCdmaStruct(NetworkCdmaSysStruct cdmaStruct) - { - NetworkCdmaSysInfo cdmaInfo = new NetworkCdmaSysInfo(); - cdmaInfo.Car = cdmaStruct.Carrier; - cdmaInfo.BaseStnId = cdmaStruct.BaseStnId; - cdmaInfo.BaseStnLatitude = cdmaStruct.BaseStnLatitude; - cdmaInfo.BaseStnLongitude = cdmaStruct.BaseStnLongitude; - cdmaInfo.NwId = cdmaStruct.NwId; - cdmaInfo.Offset = cdmaStruct.Offset; - cdmaInfo.RegZone = cdmaStruct.RegZone; - cdmaInfo.SysId = cdmaStruct.SysId; - return cdmaInfo; - } - - internal static NetworkServing ConvertNetworkServingStruct(NetworkServingStruct servStruct) - { - NetworkServing servingInfo = new NetworkServing(); - NetworkAreaStruct areaStruct = servStruct.Area; - NetworkCdmaSysStruct cdmaStruct = areaStruct.Cdma; - NetworkCdmaSysInfo cdmaInfo = ConvertCdmaStruct(cdmaStruct); - - NetworkAreaInfo areaInfo = new NetworkAreaInfo(); - areaInfo.Code = areaStruct.Lac; - areaInfo.Cdma = cdmaInfo; - - servingInfo.NwPlmn = servStruct.Plmn; - servingInfo.Type = servStruct.SysType; - servingInfo.Area = areaInfo; - - return servingInfo; - } - - internal static NetworkGeranCell ConvertGeranStruct(NetworkGeranCellStruct geranStruct) - { - NetworkGeranCell geranCell = new NetworkGeranCell(); - geranCell.Bc = geranStruct.Bcch; - geranCell.Bs = geranStruct.Bsic; - geranCell.Id = geranStruct.CellId; - geranCell.Lc = geranStruct.Lac; - geranCell.Rx = geranStruct.Rxlev; - return geranCell; - } - - internal static NetworkUmtsCell ConvertUmtsStruct(NetworkUmtsCellStruct umtsStruct) - { - NetworkUmtsCell umtsCell = new NetworkUmtsCell(); - umtsCell.Arf = umtsStruct.Arfcn; - umtsCell.Id = umtsStruct.CellId; - umtsCell.Lc = umtsStruct.Lac; - umtsCell.Ps = umtsStruct.Psc; - umtsCell.Rsc = umtsStruct.Rscp; - return umtsCell; - } - - internal static NetworkLteCell ConvertLteStruct(NetworkLteCellStruct lteStruct) - { - NetworkLteCell lteCell = new NetworkLteCell(); - lteCell.Id = lteStruct.CellId; - lteCell.Erf = lteStruct.Earfcn; - lteCell.Lc = lteStruct.Lac; - lteCell.PId = lteStruct.Pcid; - lteCell.Tc = lteStruct.Tac; - lteCell.Rs = lteStruct.Rssi; - return lteCell; - } - - internal static NetworkNeighboringCell ConvertNeighborCellStruct(NetworkNeighboringCellStruct neighborStruct) - { - NetworkNeighboringCell neighborCell = new NetworkNeighboringCell(); - NetworkServingCellStruct servStruct = neighborStruct.ServCell; - CellStruct cellStruct = servStruct.Cell; - NetworkGeranCellStruct geranStruct = cellStruct.Geran; - NetworkCdmaCellStruct cdmaStruct = cellStruct.Cdma; - NetworkUmtsCellStruct umtsStruct = cellStruct.Umts; - NetworkLteCellStruct lteStruct = cellStruct.Lte; - - NetworkGeranCell geranCell = ConvertGeranStruct(geranStruct); - - NetworkCdmaCell cdmaCell = new NetworkCdmaCell(); - cdmaCell.BaseStnId = cdmaStruct.BaseId; - cdmaCell.BaseStnLatitude = cdmaStruct.BaseStnLatitude; - cdmaCell.BaseStnLongitude = cdmaStruct.BaseStnLongitude; - cdmaCell.NwId = cdmaStruct.NetworkId; - cdmaCell.RefPn = cdmaStruct.RefPn; - cdmaCell.SysId = cdmaStruct.SystemId; - - NetworkUmtsCell umtsCell = ConvertUmtsStruct(umtsStruct); - - NetworkLteCell lteCell = ConvertLteStruct(lteStruct); - - Cell cell = new Cell(); - cell.Geran = geranCell; - cell.Cdma = cdmaCell; - cell.Umts = umtsCell; - cell.Lte = lteCell; - - NetworkServingCell servingCell = new NetworkServingCell(); - servingCell.SysType = servStruct.SystemType; - servingCell.MCountryCode = servStruct.MobileCountryCode; - servingCell.MNwCode = servStruct.MobileNetworkCode; - servingCell.Info = cell; - - neighborCell.ServCell = servingCell; - List geranCellList = new List(); - for(int i=0;i umtsCellList = new List(); - for (int i = 0; i < neighborStruct.UmtsCount; i++) - { - NetworkUmtsCell umts = ConvertUmtsStruct(neighborStruct.UmtsList[i]); - umtsCellList.Add(umts); - } - - List lteCellList = new List(); - for (int i = 0; i < neighborStruct.GeranCount; i++) - { - NetworkLteCell lte = ConvertLteStruct(neighborStruct.LteList[i]); - lteCellList.Add(lte); - } - - neighborCell.GrList = geranCellList; - neighborCell.UmtList = umtsCellList; - neighborCell.LtList = lteCellList; - return neighborCell; - - } - } - - internal static class NetworkClassConversions - { - internal static NetworkPreferredPlmnStruct ConvertNetworkPreferredPlmn(NetworkPreferredPlmnInfo plmnInfo) - { - NetworkPreferredPlmnStruct plmnStruct = new NetworkPreferredPlmnStruct(); - plmnStruct.Index = plmnInfo.idex; - plmnStruct.NetworkName = plmnInfo.NwName; - plmnStruct.Plmn = plmnInfo.NwPlmn; - plmnStruct.SnName = plmnInfo.SvcProvName; - plmnStruct.Type = plmnInfo.SysType; - return plmnStruct; - } - } -} diff --git a/src/Tizen.Tapi/Tizen.Tapi/Oem.cs b/src/Tizen.Tapi/Tizen.Tapi/Oem.cs deleted file mode 100755 index 3aa69ac80..000000000 --- a/src/Tizen.Tapi/Tizen.Tapi/Oem.cs +++ /dev/null @@ -1,151 +0,0 @@ -/* - * 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.Collections.Generic; -using System.Runtime.InteropServices; -using System.Threading.Tasks; - -namespace Tizen.Tapi -{ - /// - /// This class provides functions for sending oem related data. - /// - public class Oem - { - private IntPtr _handle; - private Dictionary _response_map = new Dictionary(); - private int _requestId = 0; - - /// - /// A public constructor for Oem class to create a Oem instance for the given tapi handle. - /// - /// The tapi handle. - public Oem(TapiHandle handle) - { - if (handle == null) - { - throw new ArgumentNullException("TapiHandle parameter is null"); - } - - _handle = handle._handle; - } - - /// - /// Sends oem data directly. - /// - /// Oem id for user specification. - /// Oem data for sending. - /// http://tizen.org/privilege/telephony.admin - /// platform - /// http://tizen.org/feature/network.telephony - /// Thrown when feature is not supported. - /// Thrown when privilege access is denied. - /// Thrown when oem instance is invalid or when method failed due to invalid operation. - public void SendOemData(int oemId, byte[] data) - { - int length = data.Length; - IntPtr oemData = Marshal.AllocHGlobal(length); - Marshal.Copy(data, 0, oemData, length); - int ret = Interop.Tapi.Oem.SendOemData(_handle, oemId, oemData, Convert.ToUInt32(length)); - if (ret != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Failed to send oem data directly, Error: " + (TapiError)ret); - TapiUtility.ThrowTapiException(ret, _handle, "http://tizen.org/privilege/telephony.admin"); - } - } - - /// - /// Sends oem data directly. - /// - /// Oem id for user specification. - /// Oem data for sending. - /// The oem data which is sent. - /// http://tizen.org/privilege/telephony.admin - /// platform - /// http://tizen.org/feature/network.telephony - /// Thrown when feature is not supported. - /// Thrown when privilege access is denied. - /// Thrown when call instance is invalid or when method failed due to invalid operation. - public OemData SendOemDataSync(int oemId, byte[] data) - { - OemDataStruct oemStruct; - int length = data.Length; - IntPtr oemData = Marshal.AllocHGlobal(length); - Marshal.Copy(data, 0, oemData, length); - int ret = Interop.Tapi.Oem.SendOemDataSync(_handle, oemId, oemData, Convert.ToUInt32(length), out oemStruct); - if (ret != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Failed to send oem data directly, Error: " + (TapiError)ret); - TapiUtility.ThrowTapiException(ret, _handle, "http://tizen.org/privilege/telephony.admin"); - } - - OemData oemDataSend = OemStructConversions.ConvertOemStruct(oemStruct); - return oemDataSend; - } - - /// - /// Sends oem data directly. - /// - /// Oem id for user specification. - /// Oem data for sending. - /// The oem data which is sent. - /// http://tizen.org/privilege/telephony.admin - /// platform - /// http://tizen.org/feature/network.telephony - /// Thrown when feature is not supported. - /// Thrown when privilege access is denied. - /// Thrown when call instance is invalid or when method failed due to invalid operation. - public Task SendOemDataAsync(int oemId, byte[] data) - { - TaskCompletionSource task = new TaskCompletionSource(); - IntPtr id; - id = (IntPtr)_requestId++; - _response_map[id] = (IntPtr handle, int result, IntPtr dataResponse, IntPtr key) => - { - Task resultTask = new Task(() => - { - if (result != (int)NetworkOperationCause.NoError) - { - Log.Error(TapiUtility.LogTag, "Error occurs during sending oem data, " + (NetworkOperationCause)result); - task.SetException(new InvalidOperationException("Error occurs during sending oem data, " + (NetworkOperationCause)result)); - return; - } - - OemDataStruct oemStruct = Marshal.PtrToStructure(dataResponse); - OemData oemClass = OemStructConversions.ConvertOemStruct(oemStruct); - task.SetResult(oemClass); - }); - - resultTask.Start(); - resultTask.Wait(); - _response_map.Remove(key); - }; - - int length = data.Length; - IntPtr oemData = Marshal.AllocHGlobal(length); - Marshal.Copy(data, 0, oemData, length); - int ret = Interop.Tapi.Oem.SendOemDataAsync(_handle, oemId, oemData, Convert.ToUInt32(length), _response_map[id], id); - if (ret != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Failed to send oem data, Error: " + (TapiError)ret); - TapiUtility.ThrowTapiException(ret, _handle, "http://tizen.org/privilege/telephony.admin"); - } - - return task.Task; - } - } -} \ No newline at end of file diff --git a/src/Tizen.Tapi/Tizen.Tapi/OemData.cs b/src/Tizen.Tapi/Tizen.Tapi/OemData.cs deleted file mode 100755 index f008d9680..000000000 --- a/src/Tizen.Tapi/Tizen.Tapi/OemData.cs +++ /dev/null @@ -1,56 +0,0 @@ -/* - * 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.Tapi -{ - /// - /// A class which defines OEM data base structure. - /// - public class OemData - { - internal uint OemId; - internal byte[] OemDataInfo; - internal OemData() - { - } - - /// - /// Oem ID. - /// - /// Oem id represented in unsigned integer. - public uint Id - { - get - { - return OemId; - } - } - - /// - /// Oem data. - /// - /// Oem data represented in byte array. - public byte[] Data - { - get - { - return OemDataInfo; - } - } - } -} diff --git a/src/Tizen.Tapi/Tizen.Tapi/OemStructs.cs b/src/Tizen.Tapi/Tizen.Tapi/OemStructs.cs deleted file mode 100755 index 903fb1c27..000000000 --- a/src/Tizen.Tapi/Tizen.Tapi/OemStructs.cs +++ /dev/null @@ -1,42 +0,0 @@ -/* - * 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; - -namespace Tizen.Tapi -{ - [StructLayout(LayoutKind.Sequential)] - internal struct OemDataStruct - { - internal uint OemId; - internal uint Length; - internal IntPtr Data; - } - - internal static class OemStructConversions - { - internal static OemData ConvertOemStruct(OemDataStruct info) - { - OemData data = new OemData(); - data.OemId = info.OemId; - int length = Convert.ToInt32(info.Length); - data.OemDataInfo = new byte[length]; - Marshal.Copy(info.Data, data.OemDataInfo, 0, length); - return data; - } - } -} diff --git a/src/Tizen.Tapi/Tizen.Tapi/Phonebook.cs b/src/Tizen.Tapi/Tizen.Tapi/Phonebook.cs deleted file mode 100755 index 217d39077..000000000 --- a/src/Tizen.Tapi/Tizen.Tapi/Phonebook.cs +++ /dev/null @@ -1,364 +0,0 @@ -/* - * 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.Threading.Tasks; -using System.Runtime.InteropServices; -using System.Collections.Generic; - -namespace Tizen.Tapi -{ - /// - /// A class which manages sim phonebook record information. - /// - public class Phonebook - { - private IntPtr _handle = IntPtr.Zero; - private Dictionary _callbackMap = new Dictionary(); - private int _requestId = 0; - - private Phonebook() - { - } - - /// - /// Gets the instance of Phonebook class. - /// - /// An instance of TapiHandle obtained from InitTapi in TapiManager API. - /// Thrown when handle is passed as null. - public Phonebook(TapiHandle handle) - { - if (handle == null) - { - throw new ArgumentNullException("Handle is null"); - } - - _handle = handle._handle; - } - - /// - /// Gets the current inserted SIM phonebook init status, available phonebook list, and first valid index in case of FDN, ADN, and 3G phonebook. - /// - /// An instance of SimPhonebookStatus containing init status and phonebook list information. - /// http://tizen.org/feature/network.telephony - /// http://tizen.org/privilege/telephony - /// Thrown when telephony feature is not supported. - /// Thrown when privilege access is denied. - /// Thrown when it is failed due to invalid parameter. - /// Thrown when it is failed due to invalid operation. - public SimPhonebookStatus GetPhonebookInitInfo() - { - SimPhonebookStatusStruct pbStatus; - int ret = Interop.Tapi.Phonebook.GetPhonebookInitInfo(_handle, out int isInitCompleted, out SimPhonebookListStruct pbList); - if (ret != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Failed to get phonebook init info, Error: " + (TapiError)ret); - TapiUtility.ThrowTapiException(ret, _handle, "http://tizen.org/privilege/telephony"); - } - - pbStatus.IsInitCompleted = isInitCompleted; - pbStatus.PbList = pbList; - return PhonebookStructConversions.ConvertSimPhonebookStatusStruct(pbStatus); - } - - /// - /// Gets the number of used records and total records of a specific SIM phonebook type. - /// - /// The different storage types to be selected in the SIM. - /// A task containing an instance of PhonebookStorageInfo. - /// http://tizen.org/feature/network.telephony - /// http://tizen.org/privilege/telephony - /// Thrown when telephony feature is not supported. - /// Thrown when privilege access is denied. - /// Thrown when it is failed due to invalid parameter. - /// Thrown when it is failed due to invalid operation. - public Task GetPhonebookStorage(PhonebookType type) - { - TaskCompletionSource task = new TaskCompletionSource(); - IntPtr id = (IntPtr)_requestId++; - _callbackMap[id] = (handle, result, data, key) => - { - Task taskResult = new Task(() => - { - if (result != (int)PhonebookAccessResult.Success) - { - Log.Error(TapiUtility.LogTag, "Error occurs during getting phone book storage: " + (PhonebookAccessResult)result); - task.SetException(new InvalidOperationException("Error occurs during getting phone book storage, " + (PhonebookAccessResult)result)); - return; - } - - PhonebookStorageInfoStruct info = Marshal.PtrToStructure(data); - task.SetResult(PhonebookStructConversions.ConvertPhonebookStorageStruct(info)); - }); - taskResult.Start(); - taskResult.Wait(); - _callbackMap.Remove(key); - }; - - int ret = Interop.Tapi.Phonebook.GetPhonebookStorage(_handle, type, _callbackMap[id], id); - if (ret != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Failed to get phonebook storage info, Error: " + (TapiError)ret); - TapiUtility.ThrowTapiException(ret, _handle, "http://tizen.org/privilege/telephony"); - } - - return task.Task; - } - - /// - /// Gets the max text length and max number length supported by the SIM phone book elementary file. - /// - /// The different storage types to be selected in the SIM. - /// A task containing an instance of PhonebookMetaInfo. - /// http://tizen.org/feature/network.telephony - /// http://tizen.org/privilege/telephony - /// Thrown when telephony feature is not supported. - /// Thrown when privilege access is denied. - /// Thrown when it is failed due to invalid parameter. - /// Thrown when it is failed due to invalid operation. - public Task GetPhonebookMetaInfo(PhonebookType type) - { - TaskCompletionSource task = new TaskCompletionSource(); - IntPtr id = (IntPtr)_requestId++; - _callbackMap[id] = (handle, result, data, key) => - { - Task taskResult = new Task(() => - { - if (result != (int)PhonebookAccessResult.Success) - { - Log.Error(TapiUtility.LogTag, "Error occurs during getting phone book meta info: " + (PhonebookAccessResult)result); - task.SetException(new InvalidOperationException("Error occurs during getting phone book meta info, " + (PhonebookAccessResult)result)); - return; - } - - PhonebookMetaInfoStruct info = Marshal.PtrToStructure(data); - task.SetResult(PhonebookStructConversions.ConvertPhonebookMetaInfoStruct(info)); - }); - taskResult.Start(); - taskResult.Wait(); - _callbackMap.Remove(key); - }; - - int ret = Interop.Tapi.Phonebook.GetPhonebookMetaInfo(_handle, type, _callbackMap[id], id); - if (ret != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Failed to get phonebook meta info, Error: " + (TapiError)ret); - TapiUtility.ThrowTapiException(ret, _handle, "http://tizen.org/privilege/telephony"); - } - - return task.Task; - } - - /// - /// Gets SIM 3G phonebook supported EFs like ANR, SNE, GRP, EMAIL and the corresponding EFs max text length, number length, and size. - /// - /// A task containing an instance of PhonebookMetaInfo3G. - /// http://tizen.org/feature/network.telephony - /// http://tizen.org/privilege/telephony - /// Thrown when telephony feature is not supported. - /// Thrown when privilege access is denied. - /// Thrown when it is failed due to invalid parameter. - /// Thrown when it is failed due to invalid operation. - public Task GetPhonebookMetaInfo3G() - { - TaskCompletionSource task = new TaskCompletionSource(); - IntPtr id = (IntPtr)_requestId++; - _callbackMap[id] = (handle, result, data, key) => - { - Task taskResult = new Task(() => - { - if (result != (int)PhonebookAccessResult.Success) - { - Log.Error(TapiUtility.LogTag, "Error occurs during getting 3G phone book meta info: " + (PhonebookAccessResult)result); - task.SetException(new InvalidOperationException("Error occurs during getting 3G phone book meta info, " + (PhonebookAccessResult)result)); - return; - } - - PhonebookMetaInfo3GStruct metaInfo = Marshal.PtrToStructure(data); - task.SetResult(PhonebookStructConversions.ConvertPhonebookMetaInfo3GStruct(metaInfo)); - }); - taskResult.Start(); - taskResult.Wait(); - _callbackMap.Remove(key); - }; - - int ret = Interop.Tapi.Phonebook.GetPhonebookMetaInfo3G(_handle, _callbackMap[id], id); - if (ret != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Failed to get 3G phonebook meta info, Error: " + (TapiError)ret); - TapiUtility.ThrowTapiException(ret, _handle, "http://tizen.org/privilege/telephony"); - } - - return task.Task; - } - - /// - /// Reads SIM phone book entry information from the given storage type and index. - /// - /// The different storage types to be selected in the SIM. - /// The index for accessing the SIM data. - /// A task containing an instance of PhonebookRecord. - /// http://tizen.org/feature/network.telephony - /// http://tizen.org/privilege/telephony - /// Thrown when telephony feature is not supported. - /// Thrown when privilege access is denied. - /// Thrown when it is failed due to invalid parameter. - /// Thrown when it is failed due to invalid operation. - public Task ReadPhonebookRecord(PhonebookType type, ushort index) - { - TaskCompletionSource task = new TaskCompletionSource(); - IntPtr id = (IntPtr)_requestId++; - _callbackMap[id] = (handle, result, data, key) => - { - Task taskResult = new Task(() => - { - if (result != (int)PhonebookAccessResult.Success) - { - Log.Error(TapiUtility.LogTag, "Error occurs during reading phone book record: " + (PhonebookAccessResult)result); - task.SetException(new InvalidOperationException("Error occurs during reading phone book record, " + (PhonebookAccessResult)result)); - return; - } - - PhonebookRecordStruct record = Marshal.PtrToStructure(data); - task.SetResult(PhonebookStructConversions.ConvertPhonebookRecordStruct(record)); - }); - taskResult.Start(); - taskResult.Wait(); - _callbackMap.Remove(key); - }; - - if (index == 0) - { - throw new ArgumentException("Index should not be zero"); - } - - int ret = Interop.Tapi.Phonebook.ReadPhonebookRecord(_handle, type, index, _callbackMap[id], id); - if (ret != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Failed to read phonebook record, Error: " + (TapiError)ret); - TapiUtility.ThrowTapiException(ret, _handle, "http://tizen.org/privilege/telephony"); - } - - return task.Task; - } - - /// - /// Adds or edits SIM phone book record entry information. - /// - /// The phonebook data to be updated or added. - /// A task indicating whether the updation is done or not. - /// http://tizen.org/feature/network.telephony - /// platform - /// http://tizen.org/privilege/telephony.admin - /// Thrown when telephony feature is not supported. - /// Thrown when privilege access is denied. - /// Thrown when record is passed as null. - /// Thrown when it is failed due to invalid parameter. - /// Thrown when it is failed due to invalid operation. - public Task UpdatePhonebookRecord(PhonebookRecord record) - { - TaskCompletionSource task = new TaskCompletionSource(); - IntPtr id = (IntPtr)_requestId++; - _callbackMap[id] = (handle, result, data, key) => - { - Task taskResult = new Task(() => - { - if (result != (int)PhonebookAccessResult.Success) - { - Log.Error(TapiUtility.LogTag, "Error occurs during updation of phone book record: " + (PhonebookAccessResult)result); - task.SetException(new InvalidOperationException("Error occurs during updation of phone book record, " + (PhonebookAccessResult)result)); - return; - } - - task.SetResult(true); - }); - taskResult.Start(); - taskResult.Wait(); - _callbackMap.Remove(key); - }; - - if (record == null) - { - throw new ArgumentNullException("Phonebook record is null"); - } - - if (record.Index == 0) - { - throw new ArgumentException("Index in phonebook record is zero"); - } - - PhonebookRecordStruct recordStruct = PhonebookClassConversions.ConvertPhonebookrecord(record); - int ret = Interop.Tapi.Phonebook.UpdatePhonebookRecord(_handle, ref recordStruct, _callbackMap[id], id); - if (ret != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Failed to update phonebook record, Error: " + (TapiError)ret); - TapiUtility.ThrowTapiException(ret, _handle, "http://tizen.org/privilege/telephony.admin"); - } - - return task.Task; - } - - /// - /// Deletes a SIM phonebook record. - /// - /// The different storage types to be selected in the SIM. - /// The index of the record to be deleted. - /// A task indicating whether deletion is done or not. - /// http://tizen.org/feature/network.telephony - /// platform - /// http://tizen.org/privilege/telephony.admin - /// Thrown when telephony feature is not supported. - /// Thrown when privilege access is denied. - /// Thrown when it is failed due to invalid parameter. - /// Thrown when it is failed due to invalid operation. - public Task DeletePhonebookRecord(PhonebookType type, ushort index) - { - TaskCompletionSource task = new TaskCompletionSource(); - IntPtr id = (IntPtr)_requestId++; - _callbackMap[id] = (handle, result, data, key) => - { - Task taskResult = new Task(() => - { - if (result != (int)PhonebookAccessResult.Success) - { - Log.Error(TapiUtility.LogTag, "Error occurs during deletion of phone book record: " + (PhonebookAccessResult)result); - task.SetException(new InvalidOperationException("Error occurs during deletion of phone book record, " + (PhonebookAccessResult)result)); - return; - } - - task.SetResult(true); - }); - taskResult.Start(); - taskResult.Wait(); - _callbackMap.Remove(key); - }; - - if (index == 0) - { - throw new ArgumentException("Index of the record is zero"); - } - - int ret = Interop.Tapi.Phonebook.DeletePhonebookRecord(_handle, type, index, _callbackMap[id], id); - if (ret != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Failed to delete phonebook record, Error: " + (TapiError)ret); - TapiUtility.ThrowTapiException(ret, _handle, "http://tizen.org/privilege/telephony.admin"); - } - - return task.Task; - } - } -} diff --git a/src/Tizen.Tapi/Tizen.Tapi/PhonebookData.cs b/src/Tizen.Tapi/Tizen.Tapi/PhonebookData.cs deleted file mode 100755 index f28cd939b..000000000 --- a/src/Tizen.Tapi/Tizen.Tapi/PhonebookData.cs +++ /dev/null @@ -1,816 +0,0 @@ -/* - * 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.Collections.Generic; - -namespace Tizen.Tapi -{ - /// - /// A class which defines the list of phone book availability of the current SIM. - /// - public class SimPhonebookList - { - internal int PbFdn; - internal int PbAdn; - internal int PbSdn; - internal int PbUsim; - internal int PbAas; - internal int PbGas; - - internal SimPhonebookList() - { - } - - /// - /// Fixed Dialing Number. - /// - /// Fdn represented in integer format. - public int Fdn - { - get - { - return PbFdn; - } - } - - /// - /// SIM - ADN(2G phonebook, Under DF phonebook). - /// - /// Adn represented in integer format. - public int Adn - { - get - { - return PbAdn; - } - } - - /// - /// Service Dialing Number. - /// - /// Sdn represented in integer format. - public int Sdn - { - get - { - return PbSdn; - } - } - - /// - /// USIM - 3G phonebook. - /// - /// Usim represented in integer format. - public int Usim - { - get - { - return PbUsim; - } - } - - /// - /// Additional number Alpha String phonebook. - /// - /// Aas represented in integer format. - public int Aas - { - get - { - return PbAas; - } - } - - /// - /// Grouping information Alpha String phonebook. - /// - /// Gas represented in integer format. - public int Gas - { - get - { - return PbGas; - } - } - } - - /// - /// A class which defines phone book status of the current SIM. - /// - public class SimPhonebookStatus - { - internal bool InitStatus; - internal SimPhonebookList List; - - internal SimPhonebookStatus() - { - } - - /// - /// Init completed or not. - /// - /// Boolean value to check the status of Init. - public bool IsInitCompleted - { - get - { - return InitStatus; - } - } - - /// - /// List of phonebook. - /// - /// An instance of SimPhonebookList containing the list of available phone book. - public SimPhonebookList PbList - { - get - { - return List; - } - } - } - - /// - /// A class which defines phonebook contact change information. - /// - public class PhonebookContactChangeInfo - { - internal PhonebookType PbType; - internal ushort ChangedIndex; - internal PhonebookOperationType OpType; - - internal PhonebookContactChangeInfo() - { - } - - /// - /// Storage file type. - /// - /// Type of phonebook storage represented as PhonebookType enum. - public PhonebookType Type - { - get - { - return PbType; - } - } - - /// - /// Changed index. - /// - /// Index value represented in unsigned short. - public ushort Index - { - get - { - return ChangedIndex; - } - } - - /// - /// Phonebook operation. - /// - /// Operation indicating the action on phonebook contact. - public PhonebookOperationType Operation - { - get - { - return OpType; - } - } - } - - /// - /// A class which defines phone book storage count information. - /// - public class PhonebookStorageInfo - { - internal PhonebookType PbType; - internal ushort PbTotalRecord; - internal ushort PbUsedRecord; - internal PhonebookStorageInfo() - { - } - - /// - /// Storage file type. - /// - /// Type of phone book storage file. - public PhonebookType Type - { - get - { - return PbType; - } - } - - /// - /// Total record count. - /// - /// Count of total phonebook record. - public ushort TotalRecord - { - get - { - return PbTotalRecord; - } - } - - /// - /// Used record count. - /// - /// Number of used phonebook record. - public ushort UsedRecord - { - get - { - return PbUsedRecord; - } - } - } - - /// - /// A class which defines phone book entry information. - /// - public class PhonebookMetaInfo - { - internal PhonebookType MetaType; - internal ushort MinIdx; - internal ushort MaxIdx; - internal ushort NumMaxLength; - internal ushort TextMaxLen; - internal ushort UsedRecCount; - internal PhonebookMetaInfo() - { - } - - /// - /// Storage file type. - /// - /// Type of phonebook storage. - public PhonebookType Type - { - get - { - return MetaType; - } - } - - /// - /// Phone book minimum index. - /// - /// Minimum index value of the phone book record. - public ushort MinIndex - { - get - { - return MinIdx; - } - } - - /// - /// Phone book maximum index. - /// - /// Maximum index value of the phone book record. - public ushort MaxIndex - { - get - { - return MaxIdx; - } - } - - /// - /// Phone number's maximum length - /// - /// Maximum length of the phone number. - public ushort NumberMaxLength - { - get - { - return NumMaxLength; - } - } - - /// - /// Text's maximum length. - /// - /// Maximum length of the text. - public ushort TextMaxLength - { - get - { - return TextMaxLen; - } - } - - /// - /// Phone book used record count. - /// - /// Number of used phone book record. - public ushort UsedCount - { - get - { - return UsedRecCount; - } - } - } - - /// - /// A class which defines 3G phone book capability information. - /// - public class FileTypeCapabilityInfo3G - { - internal PhonebookFileType3G Type; - internal ushort MaxIdx; - internal ushort TextMaxLen; - internal ushort UsedRecCount; - internal FileTypeCapabilityInfo3G() - { - } - - /// - /// 3G phonebook file type. - /// - /// File type of the 3G phonebook. - public PhonebookFileType3G FileType - { - get - { - return Type; - } - } - - /// - /// Max index. - /// - /// Maximum index value present in 3G phonebook. - public ushort MaxIndex - { - get - { - return MaxIdx; - } - } - - /// - /// Max text length. - /// - /// Maximum text length in unsigned short. - public ushort TextMaxLength - { - get - { - return TextMaxLen; - } - } - - /// - /// Used record count. - /// - /// Number of used record in 3G phonebook. - public ushort UsedCount - { - get - { - return UsedRecCount; - } - } - } - - /// - /// A class which manages Sim phonebook and its capabilities information. - /// - public class PhonebookMetaInfo3G - { - internal ushort FileCount; - internal IEnumerable FileInfo; - internal PhonebookMetaInfo3G() - { - } - - /// - /// Phonebook file type count. - /// - /// Filetype count of the 3G phonebook. - public ushort FileTypeCount - { - get - { - return FileCount; - } - } - - /// - /// Phonebook file type information. - /// - /// A list of FileTypeCapabilityInfo3G instances. - public IEnumerable FileTypeInfo - { - get - { - return FileInfo; - } - } - } - - /// - /// A class which contains information about phonebook record. - /// - public class PhonebookRecord - { - private PhonebookType _type; - private ushort _index; - private ushort _nextIndex; - private string _name; - private TextEncryptionType _dcs; - private string _number; - private SimTypeOfNumber _ton; - private string _sne; - private TextEncryptionType _sneDcs; - private string _anr1; - private SimTypeOfNumber _anr1Ton; - private string _anr2; - private SimTypeOfNumber _anr2Ton; - private string _anr3; - private SimTypeOfNumber _anr3Ton; - private string _email1; - private string _email2; - private string _email3; - private string _email4; - private ushort _groupIndex; - private ushort _pbControl; - - /// - /// Phonebook type. - /// - /// Type of the phonebook used. - public PhonebookType Type - { - get - { - return _type; - } - - set - { - _type = value; - } - } - - /// - /// Index. - /// - /// Index value represented in unsigned short. - public ushort Index - { - get - { - return _index; - } - - set - { - _index = value; - } - } - - /// - /// Next index (This field is not used in the add/update case). - /// - /// Next index represented in unsigned short. - public ushort NextIndex - { - get - { - return _nextIndex; - } - - set - { - _nextIndex = value; - } - } - - /// - /// Name. - /// - /// Name in phonebook record. - public string Name - { - get - { - return _name; - } - - set - { - _name = value; - } - } - - /// - /// Dcs. - /// - /// Sim encryption type. - public TextEncryptionType Dcs - { - get - { - return _dcs; - } - - set - { - _dcs = value; - } - } - - /// - /// Number. - /// - /// Number in phonebook record. - public string Number - { - get - { - return _number; - } - - set - { - _number = value; - } - } - - /// - /// Ton. - /// - /// Sim type of number. - public SimTypeOfNumber Ton - { - get - { - return _ton; - } - - set - { - _ton = value; - } - } - - /// - /// SNE(Second Name Entry). - /// - /// Second name entry in byte array. - public string Sne - { - get - { - return _sne; - } - - set - { - _sne = value; - } - } - - /// - /// SNE DCS. - /// - /// SNE text encryption type. - public TextEncryptionType SneDcs - { - get - { - return _sneDcs; - } - - set - { - _sneDcs = value; - } - } - - /// - /// Additional Number1. - /// - /// Additional number1 represented in byte array. - public string Anr1 - { - get - { - return _anr1; - } - - set - { - _anr1 = value; - } - } - - /// - /// ANR1 TON. - /// - /// Additional number1 type of number. - public SimTypeOfNumber Anr1Ton - { - get - { - return _anr1Ton; - } - - set - { - _anr1Ton = value; - } - } - - /// - /// Additional Number2. - /// - /// Additional number2 represented in byte array. - public string Anr2 - { - get - { - return _anr2; - } - - set - { - _anr2 = value; - } - } - - /// - /// ANR2 TON. - /// - /// Additional number2 type of number. - public SimTypeOfNumber Anr2Ton - { - get - { - return _anr2Ton; - } - - set - { - _anr2Ton = value; - } - } - - /// - /// Additional number3. - /// - /// Additional number3 represented in byte array. - public string Anr3 - { - get - { - return _anr3; - } - - set - { - _anr3 = value; - } - } - - /// - /// ANR3 TON. - /// - /// Additional number3 type of number. - public SimTypeOfNumber Anr3Ton - { - get - { - return _anr3Ton; - } - - set - { - _anr3Ton = value; - } - } - - /// - /// Email1. - /// - /// Email1 represented in byte array. - public string Email1 - { - get - { - return _email1; - } - - set - { - _email1 = value; - } - } - - /// - /// Email2. - /// - /// Email2 represented in byte array. - public string Email2 - { - get - { - return _email2; - } - - set - { - _email2 = value; - } - } - - /// - /// Email3. - /// - /// Email3 represented in byte array. - public string Email3 - { - get - { - return _email3; - } - - set - { - _email3 = value; - } - } - - /// - /// Email4. - /// - /// Email4 reprensented in byte array. - public string Email4 - { - get - { - return _email4; - } - - set - { - _email4 = value; - } - } - - /// - /// Group index. - /// - /// Group index represented in unsigned short. - public ushort GroupIndex - { - get - { - return _groupIndex; - } - - set - { - _groupIndex = value; - } - } - - /// - /// Phonebook control. - /// - /// Phonebook control represented in unsigned short. - public ushort PbControl - { - get - { - return _pbControl; - } - - set - { - _pbControl = value; - } - } - } -} diff --git a/src/Tizen.Tapi/Tizen.Tapi/PhonebookEnumerations.cs b/src/Tizen.Tapi/Tizen.Tapi/PhonebookEnumerations.cs deleted file mode 100755 index 414ecbcaa..000000000 --- a/src/Tizen.Tapi/Tizen.Tapi/PhonebookEnumerations.cs +++ /dev/null @@ -1,181 +0,0 @@ -/* - * 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. - */ - -namespace Tizen.Tapi -{ - /// - /// Enumeration for the storage types to be selected in the SIM or USIM. - /// - public enum PhonebookType - { - /// - /// Fixed Dialing Number. - /// - Fdn, - /// - /// Sim - ADN. - /// - Adn, - /// - /// Service Dialing Number. - /// - Sdn, - /// - /// USIM - 3G phone book. - /// - Usim, - /// - /// Additional number Alpha String. - /// - Aas, - /// - /// Grouping identifier Alpha String. - /// - Gas, - /// - /// Unknown file type. - /// - Unknown = 0xFF - } - - /// - /// Enumeration for the phonebook operation types. - /// - public enum PhonebookOperationType - { - /// - /// Contact added or updated. - /// - Update, - /// - /// Existing contact deleted. - /// - Delete, - /// - /// Max value. - /// - Max - } - - /// - /// Enumeration for the storage field types in the 3G Phone book. - /// - public enum PhonebookFileType3G - { - /// - /// Name. - /// - Name = 0x01, - /// - /// Number. - /// - Number, - /// - /// First Another number. - /// - Anr1, - /// - /// Second Another number. - /// - Anr2, - /// - /// Third Another number. - /// - Anr3, - /// - /// First Email. - /// - Email1, - /// - /// Second Email. - /// - Email2, - /// - /// Third Email. - /// - Email3, - /// - /// Fourth Email. - /// - Email4, - /// - /// Second name entry of the main name. - /// - Sne, - /// - /// Group. - /// - Group, - /// - /// 1 byte control info and 1 byte hidden info. - /// - Pbc - } - - /// - /// Enumeration for the text encryption type. - /// - public enum TextEncryptionType - { - /// - /// ASCII Encoding. - /// - Ascii, - /// - /// GSM 7 Bit Encoding. - /// - Gsm7Bit, - /// - /// UCS2 Encoding. - /// - Ucs2, - /// - /// HEX Encoding. - /// - Hex - } - - /// - /// Enumeration for the phonebook access result. - /// - public enum PhonebookAccessResult - { - /// - /// SIM phonebook operation successful. - /// - Success, - /// - /// SIM phonebook operation failure. - /// - Fail, - /// - /// The index passed is not a valid index. - /// - InvalidIndex, - /// - /// The number length exceeds the max length allowed (or 0). - /// - InvalidNumberLength, - /// - /// The name length exceeds the max length allowed (or 0). - /// - InvalidNameLength, - /// - /// Access condition for PB file is not satisfied. - /// - AccessConditionNotSatisfied - } -} diff --git a/src/Tizen.Tapi/Tizen.Tapi/PhonebookStructs.cs b/src/Tizen.Tapi/Tizen.Tapi/PhonebookStructs.cs deleted file mode 100755 index 74d8cf539..000000000 --- a/src/Tizen.Tapi/Tizen.Tapi/PhonebookStructs.cs +++ /dev/null @@ -1,263 +0,0 @@ -/* - * 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.Runtime.InteropServices; -using System.Text; -using System.Collections.Generic; - -namespace Tizen.Tapi -{ - [StructLayout(LayoutKind.Sequential)] - internal struct PhonebookRecordStruct - { - internal PhonebookType Type; - internal ushort Index; - internal ushort NextIndex; - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] - internal string Name; - internal TextEncryptionType Dcs; - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] - internal string Number; - internal SimTypeOfNumber Ton; - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] - internal string Sne; - internal TextEncryptionType SneDcs; - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] - internal string Anr1; - internal SimTypeOfNumber Anr1Ton; - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] - internal string Anr2; - internal SimTypeOfNumber Anr2Ton; - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] - internal string Anr3; - internal SimTypeOfNumber Anr3Ton; - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] - internal string Email1; - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] - internal string Email2; - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] - internal string Email3; - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] - internal string Email4; - internal ushort GroupIndex; - internal ushort PbControl; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct SimPhonebookListStruct - { - internal int Fdn; - internal int Adn; - internal int Sdn; - internal int Usim; - internal int Aas; - internal int Gas; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct SimPhonebookStatusStruct - { - internal int IsInitCompleted; - internal SimPhonebookListStruct PbList; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct PhonebookContactChangeInfoStruct - { - internal PhonebookType Type; - internal ushort Index; - internal PhonebookOperationType Operation; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct PhonebookStorageInfoStruct - { - internal PhonebookType Type; - internal ushort TotalRecord; - internal ushort UsedRecord; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct PhonebookMetaInfoStruct - { - internal PhonebookType Type; - internal ushort MinIndex; - internal ushort MaxIndex; - internal ushort NumMaxLength; - internal ushort TextMaxLength; - internal ushort UsedCount; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct FileTypeCapabilityInfo3GStruct - { - internal PhonebookFileType3G FileType; - internal ushort MaxIndex; - internal ushort MaxTextLen; - internal ushort UsedCount; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct PhonebookMetaInfo3GStruct - { - internal ushort FileTypeCount; - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 13, ArraySubType = UnmanagedType.LPStruct)] - internal FileTypeCapabilityInfo3GStruct[] FileTypeInfo; - } - - internal static class PhonebookStructConversions - { - internal static SimPhonebookList ConvertSimPhonebookListStruct(SimPhonebookListStruct listStruct) - { - SimPhonebookList list = new SimPhonebookList(); - list.PbFdn = listStruct.Fdn; - list.PbAdn = listStruct.Adn; - list.PbSdn = listStruct.Sdn; - list.PbUsim = listStruct.Usim; - list.PbAas = listStruct.Aas; - list.PbGas = listStruct.Gas; - return list; - } - - internal static SimPhonebookStatus ConvertSimPhonebookStatusStruct(SimPhonebookStatusStruct statusStruct) - { - SimPhonebookStatus status = new SimPhonebookStatus(); - if (statusStruct.IsInitCompleted == 1) - { - status.InitStatus = true; - } - - else if (statusStruct.IsInitCompleted == 0) - { - status.InitStatus = false; - } - - status.List = ConvertSimPhonebookListStruct(statusStruct.PbList); - return status; - } - - internal static PhonebookStorageInfo ConvertPhonebookStorageStruct(PhonebookStorageInfoStruct storageStruct) - { - PhonebookStorageInfo storageInfo = new PhonebookStorageInfo(); - storageInfo.PbType = storageStruct.Type; - storageInfo.PbTotalRecord = storageStruct.TotalRecord; - storageInfo.PbUsedRecord = storageStruct.UsedRecord; - return storageInfo; - } - - internal static PhonebookMetaInfo ConvertPhonebookMetaInfoStruct(PhonebookMetaInfoStruct metaStruct) - { - PhonebookMetaInfo info = new PhonebookMetaInfo(); - info.MetaType = metaStruct.Type; - info.MinIdx = metaStruct.MinIndex; - info.MaxIdx = metaStruct.MaxIndex; - info.NumMaxLength = metaStruct.NumMaxLength; - info.TextMaxLen = metaStruct.TextMaxLength; - info.UsedRecCount = metaStruct.UsedCount; - return info; - } - - internal static FileTypeCapabilityInfo3G ConvertFileTypeCapabilityInfo3GStruct(FileTypeCapabilityInfo3GStruct infoStruct) - { - FileTypeCapabilityInfo3G info = new FileTypeCapabilityInfo3G(); - info.Type = infoStruct.FileType; - info.MaxIdx = infoStruct.MaxIndex; - info.TextMaxLen = infoStruct.MaxTextLen; - info.UsedRecCount = infoStruct.UsedCount; - return info; - } - - internal static PhonebookMetaInfo3G ConvertPhonebookMetaInfo3GStruct(PhonebookMetaInfo3GStruct infoStruct) - { - PhonebookMetaInfo3G info = new PhonebookMetaInfo3G(); - info.FileCount = infoStruct.FileTypeCount; - List capabilityList = new List(); - foreach (FileTypeCapabilityInfo3GStruct capabilityInfo in infoStruct.FileTypeInfo) - { - capabilityList.Add(ConvertFileTypeCapabilityInfo3GStruct(capabilityInfo)); - } - - info.FileInfo = capabilityList; - return info; - } - - internal static PhonebookContactChangeInfo ConvertPhonebookContactChangeStruct(PhonebookContactChangeInfoStruct infoStruct) - { - PhonebookContactChangeInfo info = new PhonebookContactChangeInfo(); - info.PbType = infoStruct.Type; - info.ChangedIndex = infoStruct.Index; - info.OpType = infoStruct.Operation; - return info; - } - - internal static PhonebookRecord ConvertPhonebookRecordStruct(PhonebookRecordStruct recordStruct) - { - PhonebookRecord record = new PhonebookRecord(); - record.Type = recordStruct.Type; - record.Index = recordStruct.Index; - record.NextIndex = recordStruct.NextIndex; - record.Name = recordStruct.Name; - record.Dcs = recordStruct.Dcs; - record.Number = recordStruct.Number; - record.Ton = recordStruct.Ton; - record.Sne = recordStruct.Sne; - record.SneDcs = recordStruct.SneDcs; - record.Anr1 = recordStruct.Anr1; - record.Anr1Ton = recordStruct.Anr1Ton; - record.Anr2 = recordStruct.Anr2; - record.Anr2Ton = recordStruct.Anr2Ton; - record.Anr3 = recordStruct.Anr3; - record.Anr3Ton = recordStruct.Anr3Ton; - record.Email1 = recordStruct.Email1; - record.Email2 = recordStruct.Email2; - record.Email3 = recordStruct.Email3; - record.Email4 = recordStruct.Email4; - record.GroupIndex = recordStruct.GroupIndex; - record.PbControl = recordStruct.PbControl; - return record; - } - } - - internal static class PhonebookClassConversions - { - internal static PhonebookRecordStruct ConvertPhonebookrecord(PhonebookRecord record) - { - PhonebookRecordStruct recordStruct = new PhonebookRecordStruct(); - recordStruct.Type = record.Type; - recordStruct.Index = record.Index; - recordStruct.NextIndex = record.NextIndex; - recordStruct.Name = record.Name; - recordStruct.Dcs = record.Dcs; - recordStruct.Number = record.Number; - recordStruct.Ton = record.Ton; - recordStruct.Sne = record.Sne; - recordStruct.SneDcs = record.SneDcs; - recordStruct.Anr1 = record.Anr1; - recordStruct.Anr1Ton = record.Anr1Ton; - recordStruct.Anr2 = record.Anr2; - recordStruct.Anr2Ton = record.Anr2Ton; - recordStruct.Anr3 = record.Anr3; - recordStruct.Anr3Ton = record.Anr3Ton; - recordStruct.Email1 = record.Email1; - recordStruct.Email2 = record.Email2; - recordStruct.Email3 = record.Email3; - recordStruct.Email4 = record.Email4; - recordStruct.GroupIndex = record.GroupIndex; - recordStruct.PbControl = record.PbControl; - return recordStruct; - } - } -} diff --git a/src/Tizen.Tapi/Tizen.Tapi/SatData.cs b/src/Tizen.Tapi/Tizen.Tapi/SatData.cs deleted file mode 100755 index 0a2f215d0..000000000 --- a/src/Tizen.Tapi/Tizen.Tapi/SatData.cs +++ /dev/null @@ -1,2097 +0,0 @@ -/* - * 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.Collections.Generic; - -namespace Tizen.Tapi -{ - /// - /// A class which defines SAT main menu info. - /// - public class SatMainMenuInfo - { - internal int Id; - internal bool IsPresent; - internal string Title; - internal IEnumerable Items; - internal ushort Num; - internal bool IsHelpInfo; - internal bool IsUpdated; - internal SatIconIdInfo IcnId; - internal SatIconIdListInfo IdList; - - internal SatMainMenuInfo() - { - } - - /// - /// Proactive command number sent by USIM. - /// - /// Command number represented in integer format. - public int CommandId - { - get - { - return Id; - } - } - - /// - /// Flag for checking whether main menu is present or not. - /// - /// Boolean value checking the presence of main menu. - public bool IsMainMenuPresent - { - get - { - return IsPresent; - } - } - - /// - /// Menu title text. - /// - /// Title text of the menu item represented in string. - public string MenuTitle - { - get - { - return Title; - } - } - - /// - /// Menu items. - /// - /// List of SatMenuInfo objects. - public IEnumerable MenuItems - { - get - { - return Items; - } - } - - /// - /// Number of menu itmes. - /// - /// An unsigned value representing the number of menu items. - public ushort MainMenuCount - { - get - { - return Num; - } - } - - /// - /// Flag for a help information request. - /// - /// Boolean value for checking the flag for help information request. - public bool IsMainMenuHelpInfo - { - get - { - return IsHelpInfo; - } - } - - /// - /// Updated Sat main menu or not. - /// - /// Boolean value to check whether Sat main menu is updated or not. - public bool IsUpdatedMainMenu - { - get - { - return IsUpdated; - } - } - - /// - /// Icon Identifier. - /// - /// An instance of SatIconIdInfo class representing the icon identifier. - public SatIconIdInfo IconId - { - get - { - return IcnId; - } - } - - /// - /// List of Icon Identifiers. - /// - /// An instance of SatIconIdListInfo class representing the icon identifier list. - public SatIconIdListInfo IconIdList - { - get - { - return IdList; - } - } - } - - - /// - /// A class which contains menu item information for the setup menu. - /// - public class SatMenuInfo - { - internal string Item; - internal char Id; - - internal SatMenuInfo() - { - } - - /// - /// Menu item character data. - /// - /// Menu item data represented in string. - public string MenuItem - { - get - { - return Item; - } - } - - /// - /// Identifies the item on the menu that the user selected. - /// - /// Item identifier value represented as a character. - public char ItemId - { - get - { - return Id; - } - } - } - - /// - /// A class defining the icon data object. - /// - public class SatIconIdInfo - { - internal bool IsPresent; - internal SatIconQualifierType Qualifier; - internal byte Id; - internal SatIconInfo Info; - - internal SatIconIdInfo() - { - } - - /// - /// Flag for checking whether the icon identifier exists. - /// - /// Boolean value representing if the icon exists or not. - public bool IsIconPresent - { - get - { - return IsPresent; - } - } - - /// - /// Icon qualifier type. - /// - /// Icon qualifier type represented as SatIconQualifierType enum. - public SatIconQualifierType IconQualifier - { - get - { - return Qualifier; - } - } - - /// - /// Icon identifier. - /// - /// A byte value representing the icon identifier. - public byte IconId - { - get - { - return Id; - } - } - - /// - /// Icon info. - /// - /// An instance of SatIconInfo class. - public SatIconInfo IconInfo - { - get - { - return Info; - } - } - } - - /// - /// A class containing the definition of icon info object. - /// - public class SatIconInfo - { - internal byte IconWidth; - internal byte IconHeight; - internal SatImageCodingScheme Scheme; - internal ushort IconLength; - internal ushort ClutLength; - internal string IcnFile; - internal string CltFile; - - internal SatIconInfo() - { - } - - /// - /// Icon width. - /// - /// Width of the icon represented in byte. - public byte Width - { - get - { - return IconWidth; - } - } - - /// - /// Icon height. - /// - /// Height of the icon represented in byte. - public byte Height - { - get - { - return IconHeight; - } - } - - /// - /// Image coding scheme. - /// - /// Image coding scheme represented as SatImageCodingScheme enum. - public SatImageCodingScheme Ics - { - get - { - return Scheme; - } - } - - /// - /// Icon data length. - /// - /// Data length of the icon represented in ushort. - public ushort IconDataLength - { - get - { - return IconLength; - } - } - - /// - /// Clut data length. - /// - /// Data length of the clut represented in ushort. - public ushort ClutDataLength - { - get - { - return ClutLength; - } - } - - /// - /// Icon file. - /// - /// Icon file string. - public string IconFile - { - get - { - return IcnFile; - } - } - - /// - /// Clut file. - /// - /// Clut file string. - public string ClutFile - { - get - { - return CltFile; - } - } - } - - /// - /// A class which defines the icon identifier data object. - /// - public class SatIconIdListInfo - { - internal bool IsPresent; - internal SatIconQualifierType Qualifier; - internal byte Count; - internal byte[] IconList; - internal IEnumerable Info; - - internal SatIconIdListInfo() - { - } - - /// - /// Flag for checking whether the icon identifier exists. - /// - /// Boolean value indicating the presence of icon. - public bool IsIconPresent - { - get - { - return IsPresent; - } - } - - /// - /// Icon list qualifier. - /// - /// Icon list qualifier represented in SatIconQualifierType enum. - public SatIconQualifierType IconListQualifier - { - get - { - return Qualifier; - } - } - - /// - /// Number of icons. - /// - /// Byte value indicating the number of icons. - public byte IconCount - { - get - { - return Count; - } - } - - /// - /// Icon identifier list. - /// - /// A byte array containing the list of Icon identifier. - public byte[] IconIdList - { - get - { - return IconList; - } - } - - /// - /// Icon list info. - /// - /// List of icon info. - public IEnumerable IconInfo - { - get - { - return Info; - } - } - } - - /// - /// A class containing display text proactive command for SAT UI. - /// - public class SatDisplayTextData - { - internal int Id; - internal SatTextInfo Text; - internal uint Drtn; - internal bool IsPrtyHigh; - internal bool IsRespRequired; - internal bool IsImmediateResp; - internal SatIconIdInfo IcnId; - - internal SatDisplayTextData() - { - } - - /// - /// Proactive command number sent by USIM. - /// - /// Command id in integer format. - public int CommandId - { - get - { - return Id; - } - } - - /// - /// Character data to display on screen. - /// - /// An instance of SatTextInfo containing text information. - public SatTextInfo TextInfo - { - get - { - return Text; - } - } - - /// - /// Duration of the display. - /// - /// Duration in integer format. - public uint Duration - { - get - { - return Drtn; - } - } - - /// - /// Flag that indicates whether text is to be displayed if some other app is using the screen. - /// - /// Boolean value checking the priority of the display. - public bool IsPriorityHigh - { - get - { - return IsPrtyHigh; - } - } - - /// - /// Flag that indicates whether user response is required. - /// - /// Boolean value to check the need of user response. - public bool IsUserResponseRequired - { - get - { - return IsRespRequired; - } - } - - /// - /// Flag for checking whether immediate response is required. - /// - /// Boolean value to check the immediate response status. - public bool IsImmediateResponse - { - get - { - return IsImmediateResp; - } - } - - /// - /// Icon Identifier. - /// - /// An instance of SatIconIdInfo class. - public SatIconIdInfo IconId - { - get - { - return IcnId; - } - } - } - - /// - /// A class defining character data for the SAT engine data structure. - /// - public class SatTextInfo - { - internal ushort Length; - internal byte[] Data; - - internal SatTextInfo() - { - } - - /// - /// Character data length. - /// - /// An unsigned short value representing the string length. - public ushort StringLength - { - get - { - return Length; - } - } - - /// - /// Character data. - /// - /// A byte array representing the string data. - public byte[] StringData - { - get - { - return Data; - } - } - } - - /// - /// A class which defines select item proactive command data for SAT UI. - /// - public class SatSelectItemData - { - internal int Id; - internal bool IsHelpAvailable; - internal SatTextInfo Text; - internal char DefaultIndex; - internal char ItemCount; - internal IEnumerable Items; - internal SatIconIdInfo IcnId; - internal SatIconIdListInfo IdList; - - internal SatSelectItemData() - { - } - - /// - /// Proactive command number sent by USIM. - /// - /// Command id represented in integer format. - public int CommandId - { - get - { - return Id; - } - } - - /// - /// Flag for a help information request. - /// - /// Boolean value to check whether help information is availale or not. - public bool IsHelpInfoAvailable - { - get - { - return IsHelpAvailable; - } - } - - /// - /// Menu title text. - /// - /// An instance of SatTextInfo class containing the text information. - public SatTextInfo TextInfo - { - get - { - return Text; - } - } - - /// - /// Selected default item. - /// - /// Default item index of the given items. - public char DefaultItemIndex - { - get - { - return DefaultIndex; - } - } - - /// - /// Number of menu items. - /// - /// Menu items count represented as a character. - public char MenuItemCount - { - get - { - return ItemCount; - } - } - - /// - /// Menu items. - /// - /// A list of SatMenuItemInfo objects. - public IEnumerable MenuItems - { - get - { - return Items; - } - } - - /// - /// Icon Identifier. - /// - /// An instance of SatIconIdInfo class. - public SatIconIdInfo IconId - { - get - { - return IcnId; - } - } - - /// - /// List of Icon Identifiers. - /// - /// An instance of SatIconIdListInfo class containing the list of icon identifiers. - public SatIconIdListInfo IconIdList - { - get - { - return IdList; - } - } - } - - /// - /// A class which defines the menu item data object. - /// - public class SatMenuItemInfo - { - internal byte Id; - internal byte Length; - internal byte[] Txt; - - internal SatMenuItemInfo() - { - } - - /// - /// Item identifier. - /// - /// Item Id represented in byte. - public byte ItemId - { - get - { - return Id; - } - } - - /// - /// Text length. - /// - /// Length of the text represented in byte. - public byte TextLength - { - get - { - return Length; - } - } - - /// - /// Text information. - /// - /// A byte array of length TextLength containing the text information. - public byte[] Text - { - get - { - return Txt; - } - } - } - - /// - /// A class which defines get inkey proactive command data for SAT UI. - /// - public class SatGetInKeyData - { - internal int Id; - internal SatInKeyType Type; - internal SatInputAlphabetType AlphabetType; - internal bool IsNumericFlag; - internal bool IsHelpAvailable; - internal SatTextInfo Text; - internal uint Duratn; - internal SatIconIdInfo IcnId; - - internal SatGetInKeyData() - { - } - - /// - /// Proactive command number sent by USIM. - /// - /// Command id represented in integer format. - public int CommandId - { - get - { - return Id; - } - } - - /// - /// Input Type. - /// - /// Character Set or Yes/No. - public SatInKeyType KeyType - { - get - { - return Type; - } - } - - /// - /// Input character mode. - /// - /// SMS default, UCS2. - public SatInputAlphabetType InputAlphabetType - { - get - { - return AlphabetType; - } - } - - /// - /// Flag for checking whether input character is numeric. - /// - /// Boolean value for checking whether input character is numeric or not. - public bool IsNumeric - { - get - { - return IsNumericFlag; - } - } - - /// - /// Help info request flag. - /// - /// Boolean value for checking whether help info is available or not. - public bool IsHelpInfoAvailable - { - get - { - return IsHelpAvailable; - } - } - - /// - /// Character data to display on the screen. - /// - /// An instance of SatTextInfo class containing the text information. - public SatTextInfo TextInfo - { - get - { - return Text; - } - } - - /// - /// Duration of the display. - /// - /// Display duration represented in unsigned integer. - public uint Duration - { - get - { - return Duratn; - } - } - - /// - /// Icon identifier. - /// - /// An instance of SatIconIdInfo class containing the Icon identifier information. - public SatIconIdInfo IconId - { - get - { - return IcnId; - } - } - } - - /// - /// A class which defines get input proactive command data for SAT UI. - /// - public class SatGetInputData - { - internal int Id; - internal SatInputAlphabetType Type; - internal bool IsNumericFlag; - internal bool IsHelpAvailable; - internal bool IsEcho; - internal SatTextInfo Text; - internal SatResponseLengthInfo RespLength; - internal SatTextInfo Default; - internal SatIconIdInfo IcnId; - - internal SatGetInputData() - { - } - - /// - /// Proactive command number sent by USIM. - /// - /// Command id represented in integer format. - public int CommandId - { - get - { - return Id; - } - } - - /// - /// Input character mode. - /// - /// SMS default, UCS2. - public SatInputAlphabetType AlphabetType - { - get - { - return Type; - } - } - - /// - /// Flag to check whether input character is numeric. - /// - /// Boolean value to check the nature of input character. - public bool IsNumeric - { - get - { - return IsNumericFlag; - } - } - - /// - /// Help info request flag. - /// - /// Boolean value to check help information availability. - public bool IsHelpInfoAvailable - { - get - { - return IsHelpAvailable; - } - } - - /// - /// Flag that indicates whether to show input data on the screen. - /// - /// Boolean value to check the availability of input data on the screen. - public bool IsEchoInput - { - get - { - return IsEcho; - } - } - - /// - /// Character data to display on the screen. - /// - /// An instance of SatTextInfo. - public SatTextInfo TextInfo - { - get - { - return Text; - } - } - - /// - /// Input data min, max length. - /// - /// An instance of SatResponseLengthInfo. - public SatResponseLengthInfo ResponseLength - { - get - { - return RespLength; - } - } - - /// - /// Default input character data. - /// - /// An instance of SatTextInfo. - public SatTextInfo DefualtText - { - get - { - return Default; - } - } - - /// - /// Icon identifier. - /// - /// An instance of SatIconIdInfo. - public SatIconIdInfo IconId - { - get - { - return IcnId; - } - } - } - - /// - /// A class which defines expected user response length. - /// - public class SatResponseLengthInfo - { - internal byte Min; - internal byte Max; - - internal SatResponseLengthInfo() - { - } - - /// - /// User response length's minimum value. - /// - /// Minimum value represented in byte. - public byte Minimum - { - get - { - return Min; - } - } - - /// - /// User response length's maximum value. - /// - /// Maximum value represented in byte. - public byte Maximum - { - get - { - return Max; - } - } - } - - /// - /// A class which defines refresh proactive command data for applications that are concerned with files residing on USIM. - /// - public class SatRefreshData - { - internal int Id; - internal SatRefreshAppType Type; - internal SatCmdQualiRefresh Mode; - internal byte Count; - internal IEnumerable IdList; - - internal SatRefreshData() - { - } - - /// - /// Proactive command number sent by USIM. - /// - /// Command id represented in integer format. - public int CommandId - { - get - { - return Id; - } - } - - /// - /// Concerned application type. - /// - /// Refresh app type represented in SatRefreshAppType enum. - public SatRefreshAppType AppType - { - get - { - return Type; - } - } - - /// - /// Refresh mode. - /// - /// Refresh mode represented in SatCmdQualiRefresh enum. - public SatCmdQualiRefresh RefreshMode - { - get - { - return Mode; - } - } - - /// - /// Refresh file count. - /// - /// File count represented in byte. - public byte FileCount - { - get - { - return Count; - } - } - - /// - /// Refresh file identifiers. - /// - /// A list of SimFileId enums. - public IEnumerable FileId - { - get - { - return IdList; - } - } - } - - /// - /// A class which defines send SMS proactive command data for the SMS application. - /// - public class SatSendSmsData - { - internal int Id; - internal bool IsPackRequired; - internal SatAddressData Addr; - internal SatSmsTpduInfo Info; - - internal SatSendSmsData() - { - } - - /// - /// Proactive Command Number sent by USIM. - /// - /// Command id represented in integer. - public int CommandId - { - get - { - return Id; - } - } - - /// - /// Flag to check if packing is required for SMS Tpdu. - /// - /// Boolean value to check the need of packing in SMS Tpdu data. - public bool IsPackingRequired - { - get - { - return IsPackRequired; - } - } - - /// - /// Destination address. - /// - /// An instance of SatAddressData containing the address info. - public SatAddressData Address - { - get - { - return Addr; - } - } - - /// - /// SMS Tpdu data. - /// - /// An instance of SatSmsTpduInfo. - public SatSmsTpduInfo TpduInfo - { - get - { - return Info; - } - } - } - - /// - /// A class which defines SAT address data object. - /// - public class SatAddressData - { - internal SimTypeOfNumber Type; - internal SimNumberPlanIdentity NumId; - internal byte NumLen; - internal string Number; - - internal SatAddressData() - { - } - - /// - /// Type of number. - /// - /// Sim type of number represented in SimTypeOfNumber enum. - public SimTypeOfNumber Ton - { - get - { - return Type; - } - } - - /// - /// Number plan identity. - /// - /// Sim number plan represented in SimNumberPlanIdentity enum. - public SimNumberPlanIdentity Npi - { - get - { - return NumId; - } - } - - /// - /// Length of dialling number. - /// - /// Dialling number length represented in byte. - public byte DiallingNumberLength - { - get - { - return NumLen; - } - } - - /// - /// Dialling number. - /// - /// Dialling number represented in string. - public string DiallingNumber - { - get - { - return Number; - } - } - } - - /// - /// A class which defines the Result data object. - /// - public class SatSmsTpduInfo - { - internal SatSmsTpduType Type; - internal byte Length; - internal byte[] Data; - - internal SatSmsTpduInfo() - { - } - - /// - /// SMS TPDU type. - /// - /// Tpdu type represented in SatSmsTpduType. - public SatSmsTpduType TpduType - { - get - { - return Type; - } - } - - /// - /// SMS TPDU data length. - /// - /// Length of Tpdu data represented in byte. - public byte DataLength - { - get - { - return Length; - } - } - - /// - /// SMS TPDU data. - /// - /// An array of bytes representing TPDU data. - public byte[] TpduData - { - get - { - return Data; - } - } - } - - /// - /// A class which defines Event list info. - /// - public class SatEventListData - { - internal bool IsDownloadActive; - internal bool IsCallEvent; - internal bool IsConnected; - internal bool IsDisconnected; - internal bool IsStatus; - internal bool IsUsrActivity; - internal bool IsIdleScreen; - internal bool IsReaderStatus; - internal bool IsLanguageSelect; - internal bool IsBrowserTerminate; - internal bool IsDataPresent; - internal bool IsCnlStatus; - - internal SatEventListData() - { - } - - /// - /// Flag to check if the event download is acive. - /// - /// Boolean value to check for active event download. - public bool IsEventDownloadActive - { - get - { - return IsDownloadActive; - } - } - - /// - /// Flag to check if the event is about Mt call event. - /// - /// Boolean value to check the event for Mt call event. - public bool IsMtCallEvent - { - get - { - return IsCallEvent; - } - } - - /// - /// Flag to check if the call is connected. - /// - /// Boolean value to check the connection of call. - public bool IsCallConnected - { - get - { - return IsConnected; - } - } - - /// - /// Flag to check if the call is disconnected. - /// - /// Boolean value to check the call disconnection. - public bool IsCallDisconnected - { - get - { - return IsDisconnected; - } - } - - /// - /// Flag to check if the event is aboout locaion status. - /// - /// Boolean value to check the presence of location status in the event. - public bool IsLocationStatus - { - get - { - return IsStatus; - } - } - - /// - /// Flag to check if the event is about user activity. - /// - /// Boolean value to check the presence of user activity. - public bool IsUserActivity - { - get - { - return IsUsrActivity; - } - } - - /// - /// Flag to check if idle screen is available. - /// - /// Boolean value to check the availability of idle screen. - public bool IsIdleScreenAvailable - { - get - { - return IsIdleScreen; - } - } - - /// - /// Flag to check if the event is about card reader status. - /// - /// Boolean value to check the status of card reader. - public bool IsCardReaderStatus - { - get - { - return IsReaderStatus; - } - } - - /// - /// Flag to check if the event is about language selection. - /// - /// Boolean value to check if the event is language selection. - public bool IsLanguageSelection - { - get - { - return IsLanguageSelect; - } - } - - /// - /// Flag to check if the browser is terminated. - /// - /// Boolean value to check the termination of browser. - public bool IsBrowserTermination - { - get - { - return IsBrowserTerminate; - } - } - - /// - /// Flag to check if the data is available. - /// - /// Boolean value to check availablility of data. - public bool IsDataAvailable - { - get - { - return IsDataPresent; - } - } - - /// - /// Flag to check if the event has channel status. - /// - /// Boolean value to check if this field is a channel status. - public bool IsChannelStatus - { - get - { - return IsCnlStatus; - } - } - } - - /// - /// A class which defines send DTMF proactive command data for the DTMF application. - /// - public class SatSendDtmfData - { - internal int Id; - internal bool IsHidden; - internal SatTextInfo Dtmf; - - internal SatSendDtmfData() - { - } - - /// - /// Proactive Command Number sent by USIM - /// - /// Command id represented in integer. - public int CommandId - { - get - { - return Id; - } - } - - /// - /// Hidden mode flag. - /// - /// Flag to check if the data is in hidden mode. - public bool IsHiddenMode - { - get - { - return IsHidden; - } - } - - /// - /// DTMF string data. - /// - /// An instance of SatTextInfo containing DTMF string data. - public SatTextInfo DtmfString - { - get - { - return Dtmf; - } - } - } - - /// - /// A class which defines call control confirm data for Call/Ss. - /// - public class SatCallCtrlData - { - internal SatTextInfo Addr; - internal SatTextInfo SubAddr; - internal SatBcRepeatIndicatorType RepeatIndicator; - internal SatTextInfo Ccparam1; - internal SatTextInfo Ccparam2; - - internal SatCallCtrlData() - { - } - - /// - /// Call destination address. - /// - /// An instance of SatTextInfo class. - public SatTextInfo Address - { - get - { - return Addr; - } - } - - /// - /// Call SUB address. - /// - /// An instance of SatTextInfo class. - public SatTextInfo SubAddress - { - get - { - return SubAddr; - } - } - - /// - /// BC repeat indicator. - /// - /// SatBcRepeatIndicatorType enum representing Bc repeat indicator. - public SatBcRepeatIndicatorType BcRepeatIndicator - { - get - { - return RepeatIndicator; - } - } - - /// - /// Configuration Capability Parameter 1. - /// - /// An instance of SatTextInfo class. - public SatTextInfo Ccp1 - { - get - { - return Ccparam1; - } - } - - /// - /// Configuration Capability Parameter 2. - /// - /// An instance of SatTextInfo class. - public SatTextInfo Ccp2 - { - get - { - return Ccparam2; - } - } - } - - /// - /// A class which defines common call control confirm data. - /// - public class SatCallCtrlConfirmData - { - internal SatCallType Type; - internal SatCallCtrlResultType Result; - internal SatTextInfo Data; - internal bool IsUserInfoEnabled; - internal SatCallCtrlData CallData; - internal SatCallCtrlData SsData; - internal SatTextInfo Ussd; - - internal SatCallCtrlConfirmData() - { - } - - /// - /// Call control confirm type - call, SS or USSD. - /// - /// Type of call represented in SatCallType enum. - public SatCallType CallType - { - get - { - return Type; - } - } - - /// - /// Call control result type. - /// - /// Type of call control result represented in SatCallCtrlResultType enum. - public SatCallCtrlResultType CallCtrlResult - { - get - { - return Result; - } - } - - /// - /// Call control display data. - /// - /// An instance of SatTextInfo class containing information about call control display data. - public SatTextInfo DisplayData - { - get - { - return Data; - } - } - - /// - /// Flag for checking existence of call control display. - /// - /// Boolean value to check existence of user info display. - public bool IsUserInfoDisplayEnabled - { - get - { - return IsUserInfoEnabled; - } - } - - /// - /// Call control call address. - /// - /// - /// This value will be filled only if CallType is MoVoice. Otherwise it will be null. - /// - /// An instance of SatCallCtrlData containing call control call address. - public SatCallCtrlData CallCtrlCallData - { - get - { - return CallData; - } - } - - /// - /// Call control SS string. - /// - /// - /// This value will be filled only if CallType is Ss. Otherwise it will be null. - /// - /// An instance of SatCallCtrlData containing call control SS string. - public SatCallCtrlData CallCtrlSsData - { - get - { - return SsData; - } - } - - /// - /// Call control USSD string. - /// - /// - /// This value will be filled only if CallType is Ussd. Otherwise it will be null. - /// - /// An instance of SatTextInfo class containing call control USSD string. - public SatTextInfo UssdString - { - get - { - return Ussd; - } - } - } - - /// - /// A class which defines the data coding scheme object. - /// - public class SatDataCodingScheme - { - internal bool IsCompressed; - internal SatAlphabetFormat Alphabet; - internal SatMsgClassType Msg; - internal byte Dcs; - - internal SatDataCodingScheme() - { - } - - /// - /// Flag to verify the compressed format. - /// - /// Boolean value to check the compressed value. - public bool IsCompressedFormat - { - get - { - return IsCompressed; - } - } - - /// - /// Alphabet format type. - /// - /// Represented in SatAlphabetFormat enum. - public SatAlphabetFormat AlphabetFormat - { - get - { - return Alphabet; - } - } - - /// - /// Type of message class. - /// - /// Message class represented in SatMsgClassType enum. - public SatMsgClassType MsgClass - { - get - { - return Msg; - } - } - - /// - /// Raw DCS info. - /// - /// Dcs info stored in byte. - public byte RawDcs - { - get - { - return Dcs; - } - } - } - - /// - /// A class which defines text string data object. - /// - public class SatTextTypeInfo - { - internal bool IsDigit; - internal SatDataCodingScheme CodingScheme; - internal ushort StringLen; - internal string Text; - - internal SatTextTypeInfo() - { - } - - /// - /// Flag for checking whether only digits are used. - /// - /// Boolean value for checking the usage of only digits. - public bool IsDigitOnly - { - get - { - return IsDigit; - } - } - - /// - /// Data coding scheme. - /// - /// An instance of SatDataCodingScheme class. - public SatDataCodingScheme DCS - { - get - { - return CodingScheme; - } - } - - /// - /// Text length. - /// - /// Length of the string in unsigned short format. - public ushort StringLength - { - get - { - return StringLen; - } - } - - /// - /// Text string. - /// - /// Text represented in string. - public string TextString - { - get - { - return Text; - } - } - } - - /// - /// A class which defines MO SMS control confirm data. - /// - public class SatMoSmsCtrlData - { - internal SatCallCtrlResultType Result; - internal bool IsUserInfo; - internal SatTextTypeInfo Data; - internal SatTextTypeInfo RpAddr; - internal SatTextTypeInfo TpAddr; - - internal SatMoSmsCtrlData() - { - } - - /// - /// Envelope result. - /// - /// Result of MO SMS control confirm data. - public SatCallCtrlResultType MoResult - { - get - { - return Result; - } - } - - /// - /// Display present flag. - /// - /// Boolean value to check the presence of user information display. - public bool IsUserInfoDisplayEnabled - { - get - { - return IsUserInfo; - } - } - - /// - /// Display data for sending SMS. - /// - /// An instance of SatTextTypeInfo containing display data for sending SMS. - public SatTextTypeInfo DisplayData - { - get - { - return Data; - } - } - - /// - /// The RP destination address of the service center. - /// - /// An instance of SatTextTypeInfo containing RP destination address. - public SatTextTypeInfo RpDestAddress - { - get - { - return RpAddr; - } - } - - /// - /// The TP destinationn address. - /// - /// An instance of SatTextTypeInfo containing TP destination address. - public SatTextTypeInfo TpDestAddress - { - get - { - return TpAddr; - } - } - } - - /// - /// A class which defines setup call proactive command data for the call application. - /// - public class SatSetupCallData - { - internal int Id; - internal SatCmdQualiSetupCall Type; - internal SatTextInfo Text; - internal SatTextInfo Number; - internal uint Duratn; - internal SatIconIdInfo IcnId; - - internal SatSetupCallData() - { - } - - /// - /// Proactive Command Number sent by USIM. - /// - /// Command Id represented in integer format. - public int CommandId - { - get - { - return Id; - } - } - - /// - /// Call type - /// - /// Type of call represented in SatCmdQualiSetupCall enum. - public SatCmdQualiSetupCall CallType - { - get - { - return Type; - } - } - - /// - /// Display data for calling. - /// - /// An instance of SatTextInfo containing display data for calling. - public SatTextInfo DisplayText - { - get - { - return Text; - } - } - - /// - /// Call number. - /// - /// An instance of SatTextInfo containing call number information. - public SatTextInfo CallNumber - { - get - { - return Number; - } - } - - /// - /// Maximum repeat duration. - /// - /// Max repeat duration represented in unsigned integer format. - public uint Duration - { - get - { - return Duratn; - } - } - - /// - /// Icon identifier for the call application. - /// - /// An instance of SatIconIdInfo containing Icon id information. - public SatIconIdInfo IconId - { - get - { - return IcnId; - } - } - } - - /// - /// A class which defines Send SS notification proactive command data for the applicaiton. - /// - public class SatSendSsData - { - internal int Id; - internal SimTypeOfNumber NumType; - internal SimNumberPlanIdentity Identity; - internal byte StringLen; - internal string Ss; - - internal SatSendSsData() - { - } - - /// - /// Proactive Command Number sent by USIM. - /// - /// Command id represented in integer format. - public int CommandId - { - get - { - return Id; - } - } - - /// - /// Type of Number. - /// - /// TON represented in SimTypeOfNumber enum. - public SimTypeOfNumber Ton - { - get - { - return NumType; - } - } - - /// - /// Numbering Plan Identity. - /// - /// NPI reprensented in SimNumberPlanIdentity enum. - public SimNumberPlanIdentity Npi - { - get - { - return Identity; - } - } - - /// - /// SS string length. - /// - /// Length of SS string represented in byte. - public byte StringLength - { - get - { - return StringLen; - } - } - - /// - /// SS string. - /// - /// Text string represented in string. - public string SsString - { - get - { - return Ss; - } - } - } - - /// - /// A class which defines send USSD notification proactive command data for the application. - /// - public class SatSetupUssdData - { - internal int Id; - internal byte Dcs; - internal byte StringLen; - internal string Ussd; - - internal SatSetupUssdData() - { - } - - /// - /// Proactive Command Number sent by USIM. - /// - /// Command id represented in integer format. - public int CommandId - { - get - { - return Id; - } - } - - /// - /// Raw DCS info. - /// - /// Raw DCS information represented in byte. - public byte RawDcs - { - get - { - return Dcs; - } - } - - /// - /// USSD string length. - /// - /// Length of USSD string in byte. - public byte UssdStringLength - { - get - { - return StringLen; - } - } - - /// - /// USSD string. - /// - /// Ussd text represented in string format. - public string UssdString - { - get - { - return Ussd; - } - } - } -} diff --git a/src/Tizen.Tapi/Tizen.Tapi/SatEnumerations.cs b/src/Tizen.Tapi/Tizen.Tapi/SatEnumerations.cs deleted file mode 100755 index f3477c084..000000000 --- a/src/Tizen.Tapi/Tizen.Tapi/SatEnumerations.cs +++ /dev/null @@ -1,471 +0,0 @@ -/* - * 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. - */ - -namespace Tizen.Tapi -{ - /// - /// Enumeration for the UI display status. - /// - public enum SatUiDisplayStatus - { - /// - /// Infoms about UI display success. - /// - Success = 0x00, - /// - /// Informs about UI display failure. - /// - Fail = 0x01 - } - - /// - /// Enumeration for the command qualifier values of the refresh command. - /// - public enum SatCmdQualiRefresh - { - /// - /// Command qualifier for Refresh SIM Init And Full File Change Notification. - /// - SimInitAndFullFcn = 0x00, - /// - /// Command qualifier for Refresh File Change Notification. - /// - Fcn = 0x01, - /// - /// Command qualifier for Refresh SIM Init And File Change Notification. - /// - SimInitAndFcn = 0x02, - /// - /// Command qualifier for Refresh Sim Init. - /// - SimInit = 0x03, - /// - /// Command qualifier for Refresh Sim Reset. - /// - SimReset = 0x04, - /// - /// Command qualifier for Refresh 3G Application Reset. - /// - ApplicationReset3G = 0x05, - /// - /// Command qualifier for Refresh 3G Session Reset. - /// - SessionReset = 0x06, - /// - /// Command qualifier for Refresh Reserved. - /// - Reserved = 0xFF - } - - /// - /// Enumeration for the icon qualifier. - /// - public enum SatIconQualifierType - { - /// - /// Icon Quali Self Explanatory. - /// - SelfExplanatory = 0, - /// - /// Icon Quali Not Self Explanatory. - /// - NotSelfExplanatory = 1, - /// - /// Reserved. - /// - Reserved = 0xFF - } - - /// - /// Enumeration for the SIM image coding scheme type. - /// - public enum SatImageCodingScheme - { - /// - /// Basic coding scheme. - /// - Basic = 0x11, - /// - /// Colour coding scheme. - /// - Colour = 0x21, - /// - /// Reserved. - /// - Reserved = 0xFF - } - - /// - /// Enumeration for the inkey type. - /// - public enum SatInKeyType - { - /// - /// Command qualifier for Inkey type character set enabled. - /// - CharacterSetEnabled = 0, - /// - /// Command qualifier for Inkey type Yes No requested. - /// - YesNoRequested = 1 - } - - /// - /// Enumeration for the user input type. - /// - public enum SatInputAlphabetType - { - /// - /// SMS default. - /// - SmsDefault = 1, - /// - /// UCS2 alphabet type. - /// - Ucs2 = 2 - } - - /// - /// Enumeration for the refresh application type. - /// - public enum SatRefreshAppType - { - /// - /// Phonebook type. - /// - Contact = 0x00, - /// - /// SMS type. - /// - Msg, - /// - /// Other. - /// - Other, - /// - /// Maximum value. - /// - Max - } - - /// - /// Enumeration for the SMS TPDU type. - /// - public enum SatSmsTpduType - { - /// - /// Deliver TPDU type. - /// - DeliverTpdu = 0, - /// - /// Deliver RPT type. - /// - DeliverRpt = 1, - /// - /// Submit TPDU type. - /// - SubmitTpdu = 2, - /// - /// Submit RPT type. - /// - SubmitRpt = 3, - /// - /// Status RPT type. - /// - StatusRpt = 4, - /// - /// TPDU CMD type. - /// - TpduCmd = 5 - } - - /// - /// Enumeration for the type of command and the next action indicator. - /// - public enum SatCommandType - { - /// - /// None. - /// - None = 0x00, - /// - /// Refresh. - /// - Refresh = 0x01, - /// - /// More time. - /// - MoreTime = 0x02, - /// - /// Setup event list. - /// - SetupEventList = 0x05, - /// - /// Setup call. - /// - SetupCall = 0x10, - /// - /// Send SS. - /// - SendSs = 0x11, - /// - /// Send USSD. - /// - SendUssd = 0x12, - /// - /// Send SMS. - /// - SendSms = 0x13, - /// - /// Send DTMF. - /// - SendDtmf = 0x14, - /// - /// Launch browser. - /// - LaunchBrowser = 0x15, - /// - /// Play tone. - /// - PlayTone = 0x20, - /// - /// Display text. - /// - DisplayText = 0x21, - /// - /// Get inkey. - /// - GetInKey = 0x22, - /// - /// Get input. - /// - GetInput = 0x23, - /// - /// Select item. - /// - SelectItem = 0x24, - /// - /// Setup menu. - /// - SetupMenu = 0x25, - /// - /// Provide local info. - /// - ProvideLocalInfo = 0x26, - /// - /// Setup idle mode text. - /// - SetupIdleModeText = 0x28, - /// - /// Language notification. - /// - LanguageNotification = 0x35, - /// - /// Open channel - class e. - /// - OpenChannel = 0x40, - /// - /// Close channel - class e. - /// - CloseChannel = 0x41, - /// - /// Receive data - class e. - /// - ReceiveData = 0x42, - /// - /// Send data. - /// - SendData = 0x43, - /// - /// Get channel status - class e. - /// - GetChannelStatus = 0x44, - /// - /// Inform to end the execution of a proactive command. - /// - EndOfAppExec = 0xFD, - /// - /// Inform end proactive session. - /// - EndProactiveSession = 0xFE, - /// - /// Reserved. - /// - Reserved = 0xFF - } - - /// - /// Enumeration for the SAT call type. - /// - public enum SatCallType - { - /// - /// MO voice. - /// - MoVoice = 0x00, - /// - /// MO SMS. - /// - MoSms, - /// - /// SS. - /// - Ss, - /// - /// USSD. - /// - Ussd, - /// - /// PDP context action. - /// - PdpContextAct, - /// - /// Max. - /// - Max - } - - /// - /// Enumeration for the result of call control by SIM. - /// - public enum SatCallCtrlResultType - { - /// - /// Allowed with no mod. - /// - AllowedNoMod = 0, - /// - /// Not allowed. - /// - NotAllowed = 1, - /// - /// Allowed with mod. - /// - AllowedWithMod = 2, - /// - /// Reserved. - /// - Reserved = 0xFF - } - - /// - /// Enumeration for the SIM ATK BC repeat indicator type. - /// - public enum SatBcRepeatIndicatorType - { - /// - /// Alternate mode. - /// - AlternateMode = 0x01, - /// - /// Sequential mode. - /// - SequentialMode = 0x03, - /// - /// Reserved. - /// - Reserved = 0xFF - } - - /// - /// Enumeration for alphabet format. - /// - public enum SatAlphabetFormat - { - /// - /// SMS default. - /// - SmsDefault = 0x00, - /// - /// 8Bit data. - /// - Data8Bit = 0x01, - /// - /// UCS2. - /// - Ucs2 = 0x02, - /// - /// Reserved. - /// - Reserved = 0x03 - } - - /// - /// Enumeration for the message class. - /// - public enum SatMsgClassType - { - /// - /// None. - /// - None = 0x00, - /// - /// Class 0. - /// - Class0 = 0x01, - /// - /// Class 1 Default meaning: ME - specific. - /// - Class1, - /// - /// Class 2 SIM specific message. - /// - Class2, - /// - /// Class 3 Default meaning : TE specific. - /// - Class3, - /// - /// Reserved. - /// - Reserved = 0xFF - } - - /// - /// Enumeration for the command qualifier values of the setup call command. - /// - public enum SatCmdQualiSetupCall - { - /// - /// Command qualifier for setup call if another call is not busy. - /// - AnotherCallNotBusy = 0x00, - /// - /// Command qualifier for setup call if another call is not busy with redial. - /// - AnotherCallNotBusyWithRedial = 0x01, - /// - /// Command qualifier for setup call putting all other calls on hold. - /// - PutAllOtherCallsOnHold = 0x02, - /// - /// Command qualifier for setup call putting all other calls on hold with redial. - /// - PutAllOtherCallsOnHoldWithRedial = 0x03, - /// - /// Command qualifier for setup call disconnecting all other calls. - /// - DisconnectAllOtherCalls = 0x04, - /// - /// Command qualifier for setup call disconnecting all other calls with redial. - /// - DisconnectAllOtherCallsWithRedial = 0x05, - /// - /// Reserved. - /// - Reserved = 0xFF - } -} diff --git a/src/Tizen.Tapi/Tizen.Tapi/SatStructs.cs b/src/Tizen.Tapi/Tizen.Tapi/SatStructs.cs deleted file mode 100755 index cac7b8220..000000000 --- a/src/Tizen.Tapi/Tizen.Tapi/SatStructs.cs +++ /dev/null @@ -1,947 +0,0 @@ -/* - * 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.Runtime.InteropServices; -using System.Collections.Generic; -using System.Text; -using System; - -namespace Tizen.Tapi -{ - [StructLayout(LayoutKind.Sequential)] - internal struct SatMenuSelectionInfoStruct - { - } - - [StructLayout(LayoutKind.Sequential)] - internal struct SatEventDownloadInfoStruct - { - } - - [StructLayout(LayoutKind.Sequential)] - internal struct SatUiUserConfirmInfoStruct - { - } - - [StructLayout(LayoutKind.Sequential)] - internal struct SatMainMenuInfoStruct - { - internal int CommandId; - internal int IsMainMenuPresent; - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] - internal string Title; - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 40, ArraySubType = UnmanagedType.LPStruct)] - internal SatMenuInfoStruct[] MenuItem; - internal ushort NumOfMenuItems; - internal int IsMainMenuHelpInfo; - internal int IsUpdatedMainMenu; - internal SatIconIdentifierStruct IconId; - internal SatIconIdentifierListStruct IconIdList; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct SatMenuInfoStruct - { - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 261)] - internal string Item; - internal char ItemId; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct SatIconIdentifierStruct - { - internal int IsPresent; - internal SatIconQualifierType IconQualifier; - internal byte IconIdentifier; - internal SatIconInfoStruct IconInfo; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct SatIconInfoStruct - { - internal byte Width; - internal byte Height; - internal SatImageCodingScheme Ics; - internal ushort IconDataLength; - internal ushort ClutDataLength; - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 50)] - internal string IconFile; - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 50)] - internal string ClutFile; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct SatIconIdentifierListStruct - { - internal int IsPresent; - internal SatIconQualifierType IconListQualifier; - internal byte IconCount; - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 50)] - internal string IconIdentifierList; - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 50, ArraySubType = UnmanagedType.LPStruct)] - internal SatIconInfoStruct[] IconInfoList; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct SatDisplayTextStruct - { - internal int CommandId; - internal SatTextInfoStruct Text; - internal uint Duration; - internal int IsPriorityHigh; - internal int IsUserResponseRequired; - internal int IsImmediateResponse; - internal SatIconIdentifierStruct IconId; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct SatTextInfoStruct - { - internal ushort Length; - internal IntPtr DataString; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct SatSelectItemStruct - { - internal int commandId; - internal int IsHelpInfoAvailable; - internal SatTextInfoStruct Text; - internal char DefaultItemIndex; - internal char MenuItemCount; - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 40, ArraySubType = UnmanagedType.LPStruct)] - internal SatMenuItemInfoStruct[] MenuItems; - internal SatIconIdentifierStruct IconId; - internal SatIconIdentifierListStruct IconIdList; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct SatMenuItemInfoStruct - { - internal byte ItemId; - internal byte TextLength; - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] - internal string Text; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct SatGetInKeyStruct - { - internal int CommandId; - internal SatInKeyType KeyType; - internal SatInputAlphabetType InputType; - internal int IsNumeric; - internal int IsHelpInfoAvailable; - internal SatTextInfoStruct Text; - internal uint Duration; - internal SatIconIdentifierStruct IconId; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct SatGetInputStruct - { - internal int CommandId; - internal SatInputAlphabetType Type; - internal int IsNumeric; - internal int IsHelpInfoAvailable; - internal int IsEchoInput; - internal SatTextInfoStruct Text; - internal SatResponseLengthStruct RespLength; - internal SatTextInfoStruct DefaultText; - internal SatIconIdentifierStruct IconId; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct SatResponseLengthStruct - { - internal byte Min; - internal byte Max; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct SatRefreshStruct - { - internal int CommandId; - internal SatRefreshAppType AppType; - internal SatCmdQualiRefresh RefreshMode; - internal byte FileCount; - [MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U4, SizeConst = 20)] - internal SimFileId[] fileId; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct SatSendSmsStruct - { - internal int CommandId; - internal int IsPackingRequired; - internal SatAddressStruct Address; - internal SatSmsTpduStruct SmsTpdu; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct SatAddressStruct - { - internal SimTypeOfNumber Ton; - internal SimNumberPlanIdentity Npi; - internal byte DiallingNumLength; - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 200)] - internal string DiallingNumber; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct SatSmsTpduStruct - { - internal SatSmsTpduType TpduType; - internal byte DataLength; - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 175)] - internal string Data; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct SatEventListDataStruct - { - internal int IsEventDownloadActive; - internal int IsMtCallEvent; - internal int IsCallConnected; - internal int IsCallDisconnected; - internal int IsLocationStatus; - internal int IsUserActivity; - internal int IsIdleScreenAvailable; - internal int IsCardReaderStatus; - internal int IsLanguageSelection; - internal int IsBrowserTermination; - internal int IsDataAvailable; - internal int IsChannelStatus; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct SatSendDtmfDataStruct - { - internal int CommandId; - internal int IsHiddenMode; - internal SatTextInfoStruct DtmfString; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct SatCallCtrlIndCallSsDataStruct - { - internal SatTextInfoStruct Address; - internal SatTextInfoStruct SubAddress; - internal SatBcRepeatIndicatorType BcRepeatIndicator; - internal SatTextInfoStruct Ccp1; - internal SatTextInfoStruct Ccp2; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct SatCallCtrlIndUssdDataStruct - { - internal SatTextInfoStruct UssdString; - } - - [StructLayout(LayoutKind.Explicit)] - internal struct SatCallCtrlIndStruct - { - [FieldOffset(0)] - internal SatCallCtrlIndCallSsDataStruct CallCtrlCnfCallData; - [FieldOffset(0)] - internal SatCallCtrlIndCallSsDataStruct CallCtrlCnfSsData; - [FieldOffset(0)] - internal SatCallCtrlIndUssdDataStruct CallCtrlCnfUssdData; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct SatCallCtrlIndDataStruct - { - internal SatCallType CallCtrlCnfType; - internal SatCallCtrlResultType CallCtrlResult; - internal SatTextInfoStruct DisplayData; - internal int IsUserInfoDispEnabled; - internal SatCallCtrlIndStruct CallCtrlIndData; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct SatTextTypeInfoStruct - { - internal int IsDigitOnly; - internal SatDataCodingSchemeStruct Dcs; - internal ushort StringLength; - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 501)] - internal string TextString; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct SatDataCodingSchemeStruct - { - internal int IsCompressedFormat; - internal SatAlphabetFormat AlphabetFormat; - internal SatMsgClassType MsgClass; - internal byte RawDcs; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct SatMoSmsCtrlDataStruct - { - internal SatCallCtrlResultType Result; - internal int IsUserInfoDisplayEnabled; - internal SatTextTypeInfoStruct DisplayData; - internal SatTextTypeInfoStruct RpDestAddr; - internal SatTextTypeInfoStruct TpDestAddr; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct SatSetupCallDataStruct - { - internal int CommandId; - internal SatCmdQualiSetupCall CallType; - internal SatTextInfoStruct DisplayText; - internal SatTextInfoStruct CallNumber; - internal uint Duration; - internal SatIconIdentifierStruct IconId; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct SatSendSsDataStruct - { - internal int CommandId; - internal SimTypeOfNumber Ton; - internal SimNumberPlanIdentity Npi; - internal byte StringLength; - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 161)] - internal string SsString; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct SatSetupUssdDataStruct - { - internal int CommandId; - internal byte RawDcs; - internal byte UssdStringLength; - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 266)] - internal string UssdString; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct SatResultDataStruct - { - } - - internal static class SatStructConversions - { - internal static SatTextInfo ConvertSatTextInfoStruct(SatTextInfoStruct textStruct) - { - SatTextInfo textInfo = new SatTextInfo(); - textInfo.Length = textStruct.Length; - Marshal.Copy(textStruct.DataString, textInfo.Data, 0, 501); - return textInfo; - } - - internal static SatIconInfo ConvertSatIconInfoStruct(SatIconInfoStruct iconStruct) - { - SatIconInfo iconInfo = new SatIconInfo(); - iconInfo.IconWidth = iconStruct.Width; - iconInfo.IconHeight = iconStruct.Height; - iconInfo.Scheme = iconStruct.Ics; - iconInfo.IconLength = iconStruct.IconDataLength; - iconInfo.ClutLength = iconStruct.ClutDataLength; - iconInfo.IcnFile = iconStruct.IconFile; - iconInfo.CltFile = iconStruct.ClutFile; - return iconInfo; - } - - internal static SatIconIdInfo ConvertSatIconIdentifierStruct(SatIconIdentifierStruct idStruct) - { - SatIconIdInfo iconId = new SatIconIdInfo(); - if (idStruct.IsPresent == 1) - { - iconId.IsPresent = true; - } - - else if (idStruct.IsPresent == 0) - { - iconId.IsPresent = false; - } - - iconId.Qualifier = idStruct.IconQualifier; - iconId.Id = idStruct.IconIdentifier; - iconId.Info = ConvertSatIconInfoStruct(idStruct.IconInfo); - return iconId; - } - - internal static SatIconIdListInfo ConvertSatIconIdListStruct(SatIconIdentifierListStruct listStruct) - { - SatIconIdListInfo iconIdList = new SatIconIdListInfo(); - if (listStruct.IsPresent == 1) - { - iconIdList.IsPresent = true; - } - - else if (listStruct.IsPresent == 0) - { - iconIdList.IsPresent = false; - } - - iconIdList.Qualifier = listStruct.IconListQualifier; - iconIdList.Count = listStruct.IconCount; - iconIdList.IconList = Encoding.ASCII.GetBytes(listStruct.IconIdentifierList); - List iconInfoList = new List(); - foreach (SatIconInfoStruct info in listStruct.IconInfoList) - { - iconInfoList.Add(ConvertSatIconInfoStruct(info)); - } - - iconIdList.Info = iconInfoList; - return iconIdList; - } - - internal static SatMainMenuInfo ConvertSatMainMenuInfoStruct(SatMainMenuInfoStruct infoStruct) - { - SatMainMenuInfo mainMenuInfo = new SatMainMenuInfo(); - mainMenuInfo.Id = infoStruct.CommandId; - if (infoStruct.IsMainMenuPresent == 1) - { - mainMenuInfo.IsPresent = true; - } - - else if (infoStruct.IsMainMenuPresent == 0) - { - mainMenuInfo.IsPresent = false; - } - - mainMenuInfo.Title = infoStruct.Title; - List menuInfoList = new List(); - foreach (SatMenuInfoStruct menu in infoStruct.MenuItem) - { - SatMenuInfo menuInfo = new SatMenuInfo(); - menuInfo.Item = menu.Item; - menuInfo.Id = menu.ItemId; - menuInfoList.Add(menuInfo); - } - - mainMenuInfo.Items = menuInfoList; - mainMenuInfo.Num = infoStruct.NumOfMenuItems; - if (infoStruct.IsMainMenuHelpInfo == 1) - { - mainMenuInfo.IsHelpInfo = true; - } - - else if (infoStruct.IsMainMenuHelpInfo == 0) - { - mainMenuInfo.IsHelpInfo = false; - } - - if (infoStruct.IsUpdatedMainMenu == 1) - { - mainMenuInfo.IsUpdated = true; - } - - else if (infoStruct.IsUpdatedMainMenu == 0) - { - mainMenuInfo.IsUpdated = false; - } - - mainMenuInfo.IcnId = ConvertSatIconIdentifierStruct(infoStruct.IconId); - mainMenuInfo.IdList = ConvertSatIconIdListStruct(infoStruct.IconIdList); - return mainMenuInfo; - } - - internal static SatDisplayTextData ConvertSatDisplayTextStruct(SatDisplayTextStruct textStruct) - { - SatDisplayTextData textData = new SatDisplayTextData(); - textData.Id = textStruct.CommandId; - textData.Text = ConvertSatTextInfoStruct(textStruct.Text); - textData.Drtn = textStruct.Duration; - if (textStruct.IsPriorityHigh == 1) - { - textData.IsPrtyHigh = true; - } - - else if (textStruct.IsPriorityHigh == 0) - { - textData.IsPrtyHigh = false; - } - - if (textStruct.IsUserResponseRequired == 1) - { - textData.IsRespRequired = true; - } - - else if (textStruct.IsUserResponseRequired == 0) - { - textData.IsRespRequired = false; - } - - if (textStruct.IsImmediateResponse == 1) - { - textData.IsImmediateResp = true; - } - - else if (textStruct.IsImmediateResponse == 0) - { - textData.IsImmediateResp = false; - } - - textData.IcnId = ConvertSatIconIdentifierStruct(textStruct.IconId); - return textData; - } - - internal static SatSelectItemData ConvertSatSelectItemStruct(SatSelectItemStruct itemStruct) - { - SatSelectItemData itemData = new SatSelectItemData(); - itemData.Id = itemStruct.commandId; - if (itemStruct.IsHelpInfoAvailable == 1) - { - itemData.IsHelpAvailable = true; - } - - else if (itemStruct.IsHelpInfoAvailable == 0) - { - itemData.IsHelpAvailable = false; - } - - itemData.Text = ConvertSatTextInfoStruct(itemStruct.Text); - itemData.DefaultIndex = itemStruct.DefaultItemIndex; - itemData.ItemCount = itemStruct.MenuItemCount; - - List items = new List(); - foreach(SatMenuItemInfoStruct infoStruct in itemStruct.MenuItems) - { - SatMenuItemInfo menuItem = new SatMenuItemInfo(); - menuItem.Id = infoStruct.ItemId; - menuItem.Length = infoStruct.TextLength; - menuItem.Txt = Encoding.ASCII.GetBytes(infoStruct.Text); - items.Add(menuItem); - } - - itemData.Items = items; - itemData.IcnId = ConvertSatIconIdentifierStruct(itemStruct.IconId); - itemData.IdList = ConvertSatIconIdListStruct(itemStruct.IconIdList); - return itemData; - } - - internal static SatGetInKeyData ConvertSatGetInKeyStruct(SatGetInKeyStruct inKeyStruct) - { - SatGetInKeyData inKeyData = new SatGetInKeyData(); - inKeyData.Id = inKeyStruct.CommandId; - inKeyData.Type = inKeyStruct.KeyType; - inKeyData.AlphabetType = inKeyStruct.InputType; - if (inKeyStruct.IsNumeric == 1) - { - inKeyData.IsNumericFlag = true; - } - - else if (inKeyStruct.IsNumeric == 0) - { - inKeyData.IsNumericFlag = false; - } - - if (inKeyStruct.IsHelpInfoAvailable == 1) - { - inKeyData.IsHelpAvailable = true; - } - - else if (inKeyStruct.IsHelpInfoAvailable == 0) - { - inKeyData.IsHelpAvailable = false; - } - - inKeyData.Text = ConvertSatTextInfoStruct(inKeyStruct.Text); - inKeyData.Duratn = inKeyStruct.Duration; - inKeyData.IcnId = ConvertSatIconIdentifierStruct(inKeyStruct.IconId); - return inKeyData; - } - - internal static SatGetInputData ConvertSatGetInputStruct(SatGetInputStruct inputStruct) - { - SatGetInputData inputData = new SatGetInputData(); - inputData.Id = inputStruct.CommandId; - inputData.Type = inputStruct.Type; - if (inputStruct.IsNumeric == 1) - { - inputData.IsNumericFlag = true; - } - - else if (inputStruct.IsNumeric == 0) - { - inputData.IsNumericFlag = false; - } - - if (inputStruct.IsHelpInfoAvailable == 1) - { - inputData.IsHelpAvailable = true; - } - - else if (inputStruct.IsHelpInfoAvailable == 0) - { - inputData.IsHelpAvailable = false; - } - - if (inputStruct.IsEchoInput == 1) - { - inputData.IsEcho = true; - } - - else if (inputStruct.IsEchoInput == 0) - { - inputData.IsEcho = false; - } - - inputData.Text = ConvertSatTextInfoStruct(inputStruct.Text); - - SatResponseLengthInfo responseLength = new SatResponseLengthInfo(); - responseLength.Min = inputStruct.RespLength.Min; - responseLength.Max = inputStruct.RespLength.Max; - - inputData.RespLength = responseLength; - inputData.Default = ConvertSatTextInfoStruct(inputStruct.DefaultText); - inputData.IcnId = ConvertSatIconIdentifierStruct(inputStruct.IconId); - return inputData; - } - - internal static SatRefreshData ConvertSatRefreshStruct(SatRefreshStruct refreshStruct) - { - SatRefreshData refreshData = new SatRefreshData(); - refreshData.Id = refreshStruct.CommandId; - refreshData.Type = refreshStruct.AppType; - refreshData.Mode = refreshStruct.RefreshMode; - refreshData.Count = refreshStruct.FileCount; - List fileId = new List(); - foreach(SimFileId id in refreshStruct.fileId) - { - fileId.Add(id); - } - refreshData.IdList = fileId; - return refreshData; - } - - internal static SatAddressData ConvertSatAddressStruct(SatAddressStruct addressStruct) - { - SatAddressData addressData = new SatAddressData(); - addressData.Type = addressStruct.Ton; - addressData.NumId = addressStruct.Npi; - addressData.NumLen = addressStruct.DiallingNumLength; - addressData.Number = addressStruct.DiallingNumber; - return addressData; - } - - internal static SatSmsTpduInfo ConvertSatSmsTpduStruct(SatSmsTpduStruct tpduStruct) - { - SatSmsTpduInfo tpduInfo = new SatSmsTpduInfo(); - tpduInfo.Type = tpduStruct.TpduType; - tpduInfo.Length = tpduStruct.DataLength; - tpduInfo.Data = Encoding.ASCII.GetBytes(tpduStruct.Data); - return tpduInfo; - } - - internal static SatSendSmsData ConvertSatSendSmsStruct(SatSendSmsStruct smsStruct) - { - SatSendSmsData smsData = new SatSendSmsData(); - smsData.Id = smsStruct.CommandId; - if (smsStruct.IsPackingRequired == 1) - { - smsData.IsPackRequired = true; - } - - else if (smsStruct.IsPackingRequired == 0) - { - smsData.IsPackRequired = false; - } - - smsData.Addr = ConvertSatAddressStruct(smsStruct.Address); - smsData.Info = ConvertSatSmsTpduStruct(smsStruct.SmsTpdu); - return smsData; - } - - internal static SatEventListData ConvertSatEventListStruct(SatEventListDataStruct listStruct) - { - SatEventListData listData = new SatEventListData(); - if (listStruct.IsEventDownloadActive == 1) - { - listData.IsDownloadActive = true; - } - - else if (listStruct.IsEventDownloadActive == 0) - { - listData.IsDownloadActive = false; - } - - if (listStruct.IsMtCallEvent == 1) - { - listData.IsCallEvent = true; - } - - else if (listStruct.IsMtCallEvent == 0) - { - listData.IsCallEvent = false; - } - - if (listStruct.IsCallConnected == 1) - { - listData.IsConnected = true; - } - - else if (listStruct.IsCallConnected == 0) - { - listData.IsConnected = false; - } - - if (listStruct.IsCallDisconnected == 1) - { - listData.IsDisconnected = true; - } - - else if (listStruct.IsCallDisconnected == 0) - { - listData.IsDisconnected = false; - } - - if (listStruct.IsLocationStatus == 1) - { - listData.IsStatus = true; - } - - else if (listStruct.IsLocationStatus == 0) - { - listData.IsStatus = false; - } - - if (listStruct.IsUserActivity == 1) - { - listData.IsUsrActivity = true; - } - - else if (listStruct.IsUserActivity == 0) - { - listData.IsUsrActivity = false; - } - - if (listStruct.IsIdleScreenAvailable == 1) - { - listData.IsIdleScreen = true; - } - - else if (listStruct.IsIdleScreenAvailable == 0) - { - listData.IsIdleScreen = false; - } - - if (listStruct.IsCardReaderStatus == 1) - { - listData.IsReaderStatus = true; - } - - else if (listStruct.IsCardReaderStatus == 0) - { - listData.IsReaderStatus = false; - } - - if (listStruct.IsLanguageSelection == 1) - { - listData.IsLanguageSelect = true; - } - - else if (listStruct.IsLanguageSelection == 0) - { - listData.IsLanguageSelect = false; - } - - if (listStruct.IsBrowserTermination == 1) - { - listData.IsBrowserTerminate = true; - } - - else if (listStruct.IsBrowserTermination == 0) - { - listData.IsBrowserTerminate = false; - } - - if (listStruct.IsDataAvailable == 1) - { - listData.IsDataPresent = true; - } - - else if (listStruct.IsDataAvailable == 0) - { - listData.IsDataPresent = false; - } - - if (listStruct.IsChannelStatus == 1) - { - listData.IsCnlStatus = true; - } - - else if (listStruct.IsChannelStatus == 0) - { - listData.IsCnlStatus = false; - } - - return listData; - } - - internal static SatSendDtmfData ConvertSatSendDtmfStruct(SatSendDtmfDataStruct dtmfStruct) - { - SatSendDtmfData dtmfData = new SatSendDtmfData(); - dtmfData.Id = dtmfStruct.CommandId; - if (dtmfStruct.IsHiddenMode == 1) - { - dtmfData.IsHidden = true; - } - - else if (dtmfStruct.IsHiddenMode == 0) - { - dtmfData.IsHidden = false; - } - - dtmfData.Dtmf = ConvertSatTextInfoStruct(dtmfStruct.DtmfString); - return dtmfData; - } - - internal static SatCallCtrlData ConvertSatCallCtrlIndCallSsDataStruct(SatCallCtrlIndCallSsDataStruct dataStruct) - { - SatCallCtrlData data = new SatCallCtrlData(); - data.Addr = ConvertSatTextInfoStruct(dataStruct.Address); - data.SubAddr = ConvertSatTextInfoStruct(dataStruct.SubAddress); - data.RepeatIndicator = dataStruct.BcRepeatIndicator; - data.Ccparam1 = ConvertSatTextInfoStruct(dataStruct.Ccp1); - data.Ccparam2 = ConvertSatTextInfoStruct(dataStruct.Ccp2); - return data; - } - - internal static SatCallCtrlConfirmData ConvertSatCallCtrlIndDataStruct(SatCallCtrlIndDataStruct dataStruct) - { - SatCallCtrlConfirmData data = new SatCallCtrlConfirmData(); - data.Type = dataStruct.CallCtrlCnfType; - data.Result = dataStruct.CallCtrlResult; - data.Data = ConvertSatTextInfoStruct(dataStruct.DisplayData); - if (dataStruct.IsUserInfoDispEnabled == 1) - { - data.IsUserInfoEnabled = true; - } - - else if (dataStruct.IsUserInfoDispEnabled == 0) - { - data.IsUserInfoEnabled = false; - } - - if (dataStruct.CallCtrlCnfType == SatCallType.MoVoice) - { - data.CallData = ConvertSatCallCtrlIndCallSsDataStruct(dataStruct.CallCtrlIndData.CallCtrlCnfCallData); - } - - else if (dataStruct.CallCtrlCnfType == SatCallType.Ss) - { - data.SsData = ConvertSatCallCtrlIndCallSsDataStruct(dataStruct.CallCtrlIndData.CallCtrlCnfSsData); - } - - else if (dataStruct.CallCtrlCnfType == SatCallType.Ussd) - { - data.Ussd = ConvertSatTextInfoStruct(dataStruct.CallCtrlIndData.CallCtrlCnfUssdData.UssdString); - } - - return data; - } - - internal static SatDataCodingScheme ConvertSatDataCodingSchemeStruct(SatDataCodingSchemeStruct dataStruct) - { - SatDataCodingScheme codingScheme = new SatDataCodingScheme(); - if (dataStruct.IsCompressedFormat == 1) - { - codingScheme.IsCompressed = true; - } - - else if (dataStruct.IsCompressedFormat == 0) - { - codingScheme.IsCompressed = false; - } - - codingScheme.Alphabet = dataStruct.AlphabetFormat; - codingScheme.Msg = dataStruct.MsgClass; - codingScheme.Dcs = dataStruct.RawDcs; - return codingScheme; - } - - internal static SatTextTypeInfo ConvertSatTextTypeInfoStruct(SatTextTypeInfoStruct infoStruct) - { - SatTextTypeInfo info = new SatTextTypeInfo(); - if (infoStruct.IsDigitOnly == 1) - { - info.IsDigit = true; - } - - else if (infoStruct.IsDigitOnly == 0) - { - info.IsDigit = false; - } - - info.CodingScheme = ConvertSatDataCodingSchemeStruct(infoStruct.Dcs); - info.StringLen = infoStruct.StringLength; - info.Text = infoStruct.TextString; - return info; - } - - internal static SatMoSmsCtrlData ConvertSatMoSmsCtrlDataStruct(SatMoSmsCtrlDataStruct dataStruct) - { - SatMoSmsCtrlData data = new SatMoSmsCtrlData(); - data.Result = dataStruct.Result; - if (dataStruct.IsUserInfoDisplayEnabled == 1) - { - data.IsUserInfo = true; - } - - else if (dataStruct.IsUserInfoDisplayEnabled == 0) - { - data.IsUserInfo = false; - } - - data.Data = ConvertSatTextTypeInfoStruct(dataStruct.DisplayData); - data.RpAddr = ConvertSatTextTypeInfoStruct(dataStruct.RpDestAddr); - data.TpAddr = ConvertSatTextTypeInfoStruct(dataStruct.TpDestAddr); - return data; - } - - internal static SatSetupCallData ConvertSatSetupCallDataStruct(SatSetupCallDataStruct dataStruct) - { - SatSetupCallData callData = new SatSetupCallData(); - callData.Id = dataStruct.CommandId; - callData.Type = dataStruct.CallType; - callData.Text = ConvertSatTextInfoStruct(dataStruct.DisplayText); - callData.Number = ConvertSatTextInfoStruct(dataStruct.CallNumber); - callData.Duratn = dataStruct.Duration; - callData.IcnId = ConvertSatIconIdentifierStruct(dataStruct.IconId); - return callData; - } - - internal static SatSendSsData ConvertSatSendSsDataStruct(SatSendSsDataStruct dataStruct) - { - SatSendSsData ssData = new SatSendSsData(); - ssData.Id = dataStruct.CommandId; - ssData.NumType = dataStruct.Ton; - ssData.Identity = dataStruct.Npi; - ssData.StringLen = dataStruct.StringLength; - ssData.Ss = dataStruct.SsString; - return ssData; - } - - internal static SatSetupUssdData ConvertSatSetupUssdDataStruct(SatSetupUssdDataStruct ussdStruct) - { - SatSetupUssdData ussdData = new SatSetupUssdData(); - ussdData.Id = ussdStruct.CommandId; - ussdData.Dcs = ussdStruct.RawDcs; - ussdData.StringLen = ussdStruct.UssdStringLength; - ussdData.Ussd = ussdStruct.UssdString; - return ussdData; - } - } -} diff --git a/src/Tizen.Tapi/Tizen.Tapi/Sim.cs b/src/Tizen.Tapi/Tizen.Tapi/Sim.cs deleted file mode 100755 index 440073727..000000000 --- a/src/Tizen.Tapi/Tizen.Tapi/Sim.cs +++ /dev/null @@ -1,1595 +0,0 @@ -/* - * 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.Threading.Tasks; -using System.Runtime.InteropServices; -using System.Collections.Generic; -using System.Text; - -namespace Tizen.Tapi -{ - /// - /// A class which manages SIM card services. - /// - public class Sim - { - private IntPtr _handle = IntPtr.Zero; - private Dictionary _callbackMap = new Dictionary(); - private int _requestId = 0; - private Sim() - { - } - - /// - /// A constructor to instantiate Sim class using the Tapi handle. - /// - /// An instance of TapiHandle obtained from InitTapi in TapiManager API. - /// Thrown when handle is passed as null. - public Sim(TapiHandle handle) - { - if (handle == null) - { - throw new ArgumentNullException("Handle is null"); - } - - _handle = handle._handle; - } - - /// - /// Gets SIM card initialization status and SIM card identification. - /// - /// An instance of SimInitInfo class in case of success. Null in case of failure. - public SimInitInfo InitInfo - { - get - { - SimCardStatus status; - int isCardChanged; - int ret = Interop.Tapi.Sim.SimGetInitInfo(_handle, out status, out isCardChanged); - if (ret != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Failed to get SIM init info, Error: " + (TapiError)ret); - return null; - } - - SimInitInfo initInfo = new SimInitInfo(); - initInfo.SimStatus = status; - if (isCardChanged == 1) - { - initInfo.IsChanged = true; - } - - else if (isCardChanged == 0) - { - initInfo.IsChanged = false; - } - - return initInfo; - } - } - - /// - /// Gets the card type (SIM/USIM). - /// - public SimCardType SimType - { - get - { - SimCardType type; - int ret = Interop.Tapi.Sim.SimGetType(_handle, out type); - if (ret != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Failed to get SIM card type, Error: " + (TapiError)ret); - return default(SimCardType); - } - - return type; - } - } - - /// - /// Gets SIM IMSI information. - /// - public SimImsiInfo Imsi - { - get - { - SimImsiInfoStruct imsi; - int ret = Interop.Tapi.Sim.SimGetImsi(_handle, out imsi); - if (ret != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Failed to get SIM IMSI info, Error: " + (TapiError)ret); - return null; - } - - return SimStructConversions.ConvertSimImsiInfoStruct(imsi); - } - } - - /// - /// Gets ECC(SIM) or UECC(USIM) data. - /// - public SimEccInfoList Ecc - { - get - { - SimEccInfoListStruct eccInfo; - int ret = Interop.Tapi.Sim.SimGetEcc(_handle, out eccInfo); - if (ret != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Failed to get SIM ECC info, Error: " + (TapiError)ret); - return null; - } - - return SimStructConversions.ConvertSimEccInfoListStruct(eccInfo); - } - } - - /// - /// Gets the list of application on UICC. - /// - /// A byte containing the masking value for SimAppType. - /// http://tizen.org/feature/network.telephony - /// http://tizen.org/privilege/telephony - /// Thrown when telephony feature is not supported. - /// Thrown when privilege access is denied. - /// Thrown when it is failed due to invalid parameter. - /// Thrown when it is failed due to invalid operation. - public byte SimGetApplicationList() - { - byte appList; - int ret = Interop.Tapi.Sim.SimGetApplicationList(_handle, out appList); - if (ret != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Failed to get list of applications, Error: " + (TapiError)ret); - TapiUtility.ThrowTapiException(ret, _handle, "http://tizen.org/privilege/telephony"); - } - - return appList; - } - - /// - /// Gets the unique identification number of the (U)ICC. - /// - /// A task containing ICCID information. - /// http://tizen.org/feature/network.telephony - /// http://tizen.org/privilege/telephony - /// Thrown when telephony feature is not supported. - /// Thrown when privilege access is denied. - /// Thrown when it is failed due to invalid parameter. - /// Thrown when it is failed due to invalid operation. - public Task SimGetIccId() - { - TaskCompletionSource task = new TaskCompletionSource(); - IntPtr id = (IntPtr)_requestId++; - _callbackMap[id] = (handle, result, data, key) => - { - Task taskResult = new Task(() => - { - if (result != (int)SimAccessResult.Success) - { - Log.Error(TapiUtility.LogTag, "Error occurs in getting ICCID info: " + (SimAccessResult)result); - task.SetException(new InvalidOperationException("Error occurs in getting ICCID info, " + (SimAccessResult)result)); - return; - } - - SimIccIdInfoStruct info = Marshal.PtrToStructure(data); - task.SetResult(SimStructConversions.ConvertSimIccIdInfoStruct(info)); - }); - taskResult.Start(); - taskResult.Wait(); - _callbackMap.Remove(key); - }; - - int ret = Interop.Tapi.Sim.SimGetIccId(_handle, _callbackMap[id], id); - if (ret != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Failed to get SIM ICCID info, Error: " + (TapiError)ret); - TapiUtility.ThrowTapiException(ret, _handle, "http://tizen.org/privilege/telephony"); - } - - return task.Task; - } - - /// - /// Gets language preference(indication) information. - /// - /// A task containing information about SIM language preference. - /// http://tizen.org/feature/network.telephony - /// http://tizen.org/privilege/telephony - /// Thrown when telephony feature is not supported. - /// Thrown when privilege access is denied. - /// Thrown when it is failed due to invalid parameter. - /// Thrown when it is failed due to invalid operation. - public Task SimGetLanguagePreference() - { - TaskCompletionSource task = new TaskCompletionSource(); - IntPtr id = (IntPtr)_requestId++; - _callbackMap[id] = (handle, result, data, key) => - { - Task taskResult = new Task(() => - { - if (result != (int)SimAccessResult.Success) - { - Log.Error(TapiUtility.LogTag, "Error occurs in getting language preference: " + (SimAccessResult)result); - task.SetException(new InvalidOperationException("Error occurs in getting language preference, " + (SimAccessResult)result)); - return; - } - - task.SetResult((SimLanguagePreference)Marshal.ReadInt32(data)); - }); - taskResult.Start(); - taskResult.Wait(); - _callbackMap.Remove(key); - }; - - int ret = Interop.Tapi.Sim.SimGetLanguage(_handle, _callbackMap[id], id); - if (ret != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Failed to get SIM language preference, Error: " + (TapiError)ret); - TapiUtility.ThrowTapiException(ret, _handle, "http://tizen.org/privilege/telephony"); - } - - return task.Task; - } - - /// - /// Updates language preference information to the SIM card. - /// - /// The language preference information. - /// A task indicating whether setting of language preference is done or not. - /// http://tizen.org/feature/network.telephony - /// platform - /// http://tizen.org/privilege/telephony.admin - /// Thrown when telephony feature is not supported. - /// Thrown when privilege access is denied. - /// Thrown when it is failed due to invalid parameter. - /// Thrown when it is failed due to invalid operation. - public Task SimSetLanguagePreference(SimLanguagePreference language) - { - TaskCompletionSource task = new TaskCompletionSource(); - IntPtr id = (IntPtr)_requestId++; - _callbackMap[id] = (handle, result, data, key) => - { - Task taskResult = new Task(() => - { - if (result != (int)SimAccessResult.Success) - { - Log.Error(TapiUtility.LogTag, "Error occurs in setting language preference: " + (SimAccessResult)result); - task.SetException(new InvalidOperationException("Error occurs in setting language preference, " + (SimAccessResult)result)); - return; - } - - task.SetResult(true); - }); - taskResult.Start(); - taskResult.Wait(); - _callbackMap.Remove(key); - }; - - int ret = Interop.Tapi.Sim.SimSetLanguage(_handle, language, _callbackMap[id], id); - if (ret != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Failed to set SIM language preference, Error: " + (TapiError)ret); - TapiUtility.ThrowTapiException(ret, _handle, "http://tizen.org/privilege/telephony.admin"); - } - - return task.Task; - } - - /// - /// Gets SIM call forwarding indication related data(EF-CFIS and CPHS case). - /// - /// A task containing call forward response information. - /// http://tizen.org/feature/network.telephony - /// http://tizen.org/privilege/telephony - /// Thrown when telephony feature is not supported. - /// Thrown when privilege access is denied. - /// Thrown when it is failed due to invalid parameter. - /// Thrown when it is failed due to invalid operation. - public Task SimGetCallForwardInfo() - { - TaskCompletionSource task = new TaskCompletionSource(); - IntPtr id = (IntPtr)_requestId++; - _callbackMap[id] = (handle, result, data, key) => - { - Task taskResult = new Task(() => - { - if (result != (int)SimAccessResult.Success) - { - Log.Error(TapiUtility.LogTag, "Error occurs in getting call forward info: " + (SimAccessResult)result); - task.SetException(new InvalidOperationException("Error occurs in getting call forward info, " + (SimAccessResult)result)); - return; - } - - SimCallForwardResponseStruct info = Marshal.PtrToStructure(data); - task.SetResult(SimStructConversions.ConvertSimCallForwardResponseStruct(info)); - }); - taskResult.Start(); - taskResult.Wait(); - _callbackMap.Remove(key); - }; - - int ret = Interop.Tapi.Sim.SimGetCallForwardingInfo(_handle, _callbackMap[id], id); - if (ret != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Failed to get SIM call forward info, Error: " + (TapiError)ret); - TapiUtility.ThrowTapiException(ret, _handle, "http://tizen.org/privilege/telephony"); - } - - return task.Task; - } - - /// - /// Sets SIM call forwarding indication related data(EF-CFIS and CPHS case). - /// - /// The data requesting for call forwarding. - /// A task indicating whether setting call forward info is done or not. - /// http://tizen.org/feature/network.telephony - /// platform - /// http://tizen.org/privilege/telephony.admin - /// Thrown when telephony feature is not supported. - /// Thrown when privilege access is denied. - /// Thrown when call forward request is passed as null. - /// Thrown when it is failed due to invalid parameter. - /// Thrown when it is failed due to invalid operation. - public Task SimSetCallForwardInfo(SimCallForwardRequest request) - { - TaskCompletionSource task = new TaskCompletionSource(); - IntPtr id = (IntPtr)_requestId++; - _callbackMap[id] = (handle, result, data, key) => - { - Task taskResult = new Task(() => - { - if (result != (int)SimAccessResult.Success) - { - Log.Error(TapiUtility.LogTag, "Error occurs in setting call forward info: " + (SimAccessResult)result); - task.SetException(new InvalidOperationException("Error occurs in setting call forward info, " + (SimAccessResult)result)); - return; - } - - task.SetResult(true); - }); - taskResult.Start(); - taskResult.Wait(); - _callbackMap.Remove(key); - }; - - if (request == null) - { - throw new ArgumentNullException("SIM call forward request is null"); - } - - SimCallForwardRequestStruct requestStruct = SimClassConversions.ConvertSimCallForwardRequest(request); - int ret = Interop.Tapi.Sim.SimSetCallForwardingInfo(_handle, ref requestStruct, _callbackMap[id], id); - if (ret != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Failed to set SIM call forward info, Error: " + (TapiError)ret); - TapiUtility.ThrowTapiException(ret, _handle, "http://tizen.org/privilege/telephony.admin"); - } - - return task.Task; - } - - /// - /// Gets SIM message waiting indication related data(EF-MWIS and CPHS case). - /// - /// A task containing message waiting response information. - /// http://tizen.org/feature/network.telephony - /// http://tizen.org/privilege/telephony - /// Thrown when telephony feature is not supported. - /// Thrown when privilege access is denied. - /// Thrown when it is failed due to invalid parameter. - /// Thrown when it is failed due to invalid operation. - public Task SimGetMessageWaitingInfo() - { - TaskCompletionSource task = new TaskCompletionSource(); - IntPtr id = (IntPtr)_requestId++; - _callbackMap[id] = (handle, result, data, key) => - { - Task taskResult = new Task(() => - { - if (result != (int)SimAccessResult.Success) - { - Log.Error(TapiUtility.LogTag, "Error occurs in getting message waiting info: " + (SimAccessResult)result); - task.SetException(new InvalidOperationException("Error occurs in getting message waiting info, " + (SimAccessResult)result)); - return; - } - - SimMessageWaitingResponseStruct info = Marshal.PtrToStructure(data); - task.SetResult(SimStructConversions.ConvertSimMessageWaitingRespStruct(info)); - }); - taskResult.Start(); - taskResult.Wait(); - _callbackMap.Remove(key); - }; - - int ret = Interop.Tapi.Sim.SimGetMessageWaitingInfo(_handle, _callbackMap[id], id); - if (ret != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Failed to get SIM message waiting info, Error: " + (TapiError)ret); - TapiUtility.ThrowTapiException(ret, _handle, "http://tizen.org/privilege/telephony"); - } - - return task.Task; - } - - /// - /// Sets SIM message waiting indication related data(EF-MWIS and CPHS case). - /// - /// The data requesting for message waiting. - /// A task indicating whether setting message waiting info is done or not. - /// http://tizen.org/feature/network.telephony - /// platform - /// http://tizen.org/privilege/telephony.admin - /// Thrown when telephony feature is not supported. - /// Thrown when privilege access is denied. - /// Thrown when message waiting request is passed as null. - /// Thrown when it is failed due to invalid parameter. - /// Thrown when it is failed due to invalid operation. - public Task SimSetMessageWaitingInfo(SimMessageWaitingRequest request) - { - TaskCompletionSource task = new TaskCompletionSource(); - IntPtr id = (IntPtr)_requestId++; - _callbackMap[id] = (handle, result, data, key) => - { - Task taskResult = new Task(() => - { - if (result != (int)SimAccessResult.Success) - { - Log.Error(TapiUtility.LogTag, "Error occurs in setting message waiting info: " + (SimAccessResult)result); - task.SetException(new InvalidOperationException("Error occurs in setting message waiting info, " + (SimAccessResult)result)); - return; - } - - task.SetResult(true); - }); - taskResult.Start(); - taskResult.Wait(); - _callbackMap.Remove(key); - }; - - if (request == null) - { - throw new ArgumentNullException("SIM message waiting request is null"); - } - - SimMessageWaitingRequestStruct requestStruct = SimClassConversions.ConvertSimMessageWaitingRequest(request); - int ret = Interop.Tapi.Sim.SimSetMessageWaitingInfo(_handle, ref requestStruct, _callbackMap[id], id); - if (ret != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Failed to set SIM message waiting info, Error: " + (TapiError)ret); - TapiUtility.ThrowTapiException(ret, _handle, "http://tizen.org/privilege/telephony.admin"); - } - - return task.Task; - } - - /// - /// Gets SIM mailbox related data(EF-MBDN, MBDI, and CPHS case). - /// - /// A task containing SimMailboxList information. - /// http://tizen.org/feature/network.telephony - /// http://tizen.org/privilege/telephony - /// Thrown when telephony feature is not supported. - /// Thrown when privilege access is denied. - /// Thrown when it is failed due to invalid parameter. - /// Thrown when it is failed due to invalid operation. - public Task SimGetMailboxInfo() - { - TaskCompletionSource task = new TaskCompletionSource(); - IntPtr id = (IntPtr)_requestId++; - _callbackMap[id] = (handle, result, data, key) => - { - Task taskResult = new Task(() => - { - if (result != (int)SimAccessResult.Success) - { - Log.Error(TapiUtility.LogTag, "Error occurs in getting mailbox info: " + (SimAccessResult)result); - task.SetException(new InvalidOperationException("Error occurs in getting mailbox info, " + (SimAccessResult)result)); - return; - } - - SimMailboxListStruct info = Marshal.PtrToStructure(data); - task.SetResult(SimStructConversions.ConvertSimMailboxListStruct(info)); - }); - taskResult.Start(); - taskResult.Wait(); - _callbackMap.Remove(key); - }; - - int ret = Interop.Tapi.Sim.SimGetMailboxInfo(_handle, _callbackMap[id], id); - if (ret != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Failed to get SIM mailbox info, Error: " + (TapiError)ret); - TapiUtility.ThrowTapiException(ret, _handle, "http://tizen.org/privilege/telephony"); - } - - return task.Task; - } - - /// - /// Sets SIM mailbox related data(EF-MBDN, MBDI and CPHS case). - /// - /// The data requesting for mailbox info. - /// A task indicating whether setting mailbox info is done or not. - /// http://tizen.org/feature/network.telephony - /// platform - /// http://tizen.org/privilege/telephony.admin - /// Thrown when telephony feature is not supported. - /// Thrown when privilege access is denied. - /// Thrown when mailbox number is passed as null. - /// Thrown when the system runs out of memory. - /// Thrown when it is failed due to invalid parameter. - /// Thrown when it is failed due to invalid operation. - public Task SimSetMailboxInfo(SimMailboxNumber mailboxNumber) - { - TaskCompletionSource task = new TaskCompletionSource(); - IntPtr id = (IntPtr)_requestId++; - _callbackMap[id] = (handle, result, data, key) => - { - Task taskResult = new Task(() => - { - if (result != (int)SimAccessResult.Success) - { - Log.Error(TapiUtility.LogTag, "Error occurs in setting mailbox info: " + (SimAccessResult)result); - task.SetException(new InvalidOperationException("Error occurs in setting mailbox info, " + (SimAccessResult)result)); - return; - } - - task.SetResult(true); - }); - taskResult.Start(); - taskResult.Wait(); - _callbackMap.Remove(key); - }; - - if (mailboxNumber == null) - { - throw new ArgumentNullException("SIM mailbox number is null"); - } - - SimMailboxNumberStruct mbStruct = SimClassConversions.ConvertSimMailboxNumber(mailboxNumber); - int ret = Interop.Tapi.Sim.SimSetMailboxInfo(_handle, ref mbStruct, _callbackMap[id], id); - if (ret != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Failed to set SIM mailbox info, Error: " + (TapiError)ret); - TapiUtility.ThrowTapiException(ret, _handle, "http://tizen.org/privilege/telephony.admin"); - } - - return task.Task; - } - - /// - /// Gets SIM CPHS specific data. - /// - /// A task containing SimCphs information. - /// http://tizen.org/feature/network.telephony - /// http://tizen.org/privilege/telephony - /// Thrown when telephony feature is not supported. - /// Thrown when privilege access is denied. - /// Thrown when it is failed due to invalid parameter. - /// Thrown when it is failed due to invalid operation. - public Task SimGetCphsInfo() - { - TaskCompletionSource task = new TaskCompletionSource(); - IntPtr id = (IntPtr)_requestId++; - _callbackMap[id] = (handle, result, data, key) => - { - Task taskResult = new Task(() => - { - if (result != (int)SimAccessResult.Success) - { - Log.Error(TapiUtility.LogTag, "Error occurs in getting CPHS info: " + (SimAccessResult)result); - task.SetException(new InvalidOperationException("Error occurs in getting CPHS info, " + (SimAccessResult)result)); - return; - } - - SimCphsInfoStruct info = Marshal.PtrToStructure(data); - task.SetResult(SimStructConversions.ConvertSimCphsInfoStruct(info)); - }); - taskResult.Start(); - taskResult.Wait(); - _callbackMap.Remove(key); - }; - - int ret = Interop.Tapi.Sim.SimGetCphsInfo(_handle, _callbackMap[id], id); - if (ret != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Failed to get SIM CPHS info, Error: " + (TapiError)ret); - TapiUtility.ThrowTapiException(ret, _handle, "http://tizen.org/privilege/telephony"); - } - - return task.Task; - } - - /// - /// Gets the SIM Service Table. - /// - /// A task containing SIM service table information. - /// http://tizen.org/feature/network.telephony - /// http://tizen.org/privilege/telephony - /// Thrown when telephony feature is not supported. - /// Thrown when privilege access is denied. - /// Thrown when it is failed due to invalid parameter. - /// Thrown when it is failed due to invalid operation. - public Task SimGetServiceTable() - { - TaskCompletionSource task = new TaskCompletionSource(); - IntPtr id = (IntPtr)_requestId++; - _callbackMap[id] = (handle, result, data, key) => - { - Task taskResult = new Task(() => - { - if (result != (int)SimAccessResult.Success) - { - Log.Error(TapiUtility.LogTag, "Error occurs in getting service table: " + (SimAccessResult)result); - task.SetException(new InvalidOperationException("Error occurs in getting service table, " + (SimAccessResult)result)); - return; - } - - SimServiceTableStruct info = Marshal.PtrToStructure(data); - task.SetResult(SimStructConversions.ConvertSimServiceTableStruct(info)); - }); - taskResult.Start(); - taskResult.Wait(); - _callbackMap.Remove(key); - }; - - int ret = Interop.Tapi.Sim.SimGetServiceTable(_handle, _callbackMap[id], id); - if (ret != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Failed to get SIM service table, Error: " + (TapiError)ret); - TapiUtility.ThrowTapiException(ret, _handle, "http://tizen.org/privilege/telephony"); - } - - return task.Task; - } - - /// - /// Gets SIM MSISDN data. - /// - /// A task containing SimMsisdnList information. - /// http://tizen.org/feature/network.telephony - /// http://tizen.org/privilege/telephony - /// Thrown when telephony feature is not supported. - /// Thrown when privilege access is denied. - /// Thrown when it is failed due to invalid parameter. - /// Thrown when it is failed due to invalid operation. - public Task SimGetMsisdn() - { - TaskCompletionSource task = new TaskCompletionSource(); - IntPtr id = (IntPtr)_requestId++; - _callbackMap[id] = (handle, result, data, key) => - { - Task taskResult = new Task(() => - { - if (result != (int)SimAccessResult.Success) - { - Log.Error(TapiUtility.LogTag, "Error occurs in getting MSISDN info: " + (SimAccessResult)result); - task.SetException(new InvalidOperationException("Error occurs in getting MSISDN info, " + (SimAccessResult)result)); - return; - } - - SimMsisdnListStruct info = Marshal.PtrToStructure(data); - task.SetResult(SimStructConversions.ConvertSimMsisdnListStruct(info)); - }); - taskResult.Start(); - taskResult.Wait(); - _callbackMap.Remove(key); - }; - - int ret = Interop.Tapi.Sim.SimGetMsisdn(_handle, _callbackMap[id], id); - if (ret != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Failed to get SIM MSISDN data, Error: " + (TapiError)ret); - TapiUtility.ThrowTapiException(ret, _handle, "http://tizen.org/privilege/telephony"); - } - - return task.Task; - } - - /// - /// Gets SIM OPLMNWACT(Operator controlled PLMN Selector with Access Technology) data. - /// - /// A task containing SimOplmnwactList information. - /// http://tizen.org/feature/network.telephony - /// http://tizen.org/privilege/telephony - /// Thrown when telephony feature is not supported. - /// Thrown when privilege access is denied. - /// Thrown when it is failed due to invalid parameter. - /// Thrown when it is failed due to invalid operation. - public Task SimGetOplmnwact() - { - TaskCompletionSource task = new TaskCompletionSource(); - IntPtr id = (IntPtr)_requestId++; - _callbackMap[id] = (handle, result, data, key) => - { - Task taskResult = new Task(() => - { - if (result != (int)SimAccessResult.Success) - { - Log.Error(TapiUtility.LogTag, "Error occurs in getting OPLMNWACT info: " + (SimAccessResult)result); - task.SetException(new InvalidOperationException("Error occurs in getting OPLMNWACT info, " + (SimAccessResult)result)); - return; - } - - SimOplmnwactListStruct info = Marshal.PtrToStructure(data); - task.SetResult(SimStructConversions.ConvertSimOplmnwactListStruct(info)); - }); - taskResult.Start(); - taskResult.Wait(); - _callbackMap.Remove(key); - }; - - int ret = Interop.Tapi.Sim.SimGetOplmnwact(_handle, _callbackMap[id], id); - if (ret != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Failed to get SIM OPLMNWACT info, Error: " + (TapiError)ret); - TapiUtility.ThrowTapiException(ret, _handle, "http://tizen.org/privilege/telephony"); - } - - return task.Task; - } - - /// - /// Gets SIM SPN data. - /// - /// A task containing SimSpn information. - /// http://tizen.org/feature/network.telephony - /// http://tizen.org/privilege/telephony - /// Thrown when telephony feature is not supported. - /// Thrown when privilege access is denied. - /// Thrown when it is failed due to invalid parameter. - /// Thrown when it is failed due to invalid operation. - public Task SimGetSpn() - { - TaskCompletionSource task = new TaskCompletionSource(); - IntPtr id = (IntPtr)_requestId++; - _callbackMap[id] = (handle, result, data, key) => - { - Task taskResult = new Task(() => - { - if (result != (int)SimAccessResult.Success) - { - Log.Error(TapiUtility.LogTag, "Error occurs in getting SPN info: " + (SimAccessResult)result); - task.SetException(new InvalidOperationException("Error occurs in getting SPN info, " + (SimAccessResult)result)); - return; - } - - SimSpnStruct info = Marshal.PtrToStructure(data); - task.SetResult(SimStructConversions.ConvertSimSpnStruct(info)); - }); - taskResult.Start(); - taskResult.Wait(); - _callbackMap.Remove(key); - }; - - int ret = Interop.Tapi.Sim.SimGetSpn(_handle, _callbackMap[id], id); - if (ret != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Failed to get SIM SPN info, Error: " + (TapiError)ret); - TapiUtility.ThrowTapiException(ret, _handle, "http://tizen.org/privilege/telephony"); - } - - return task.Task; - } - - /// - /// Gets SIM CPHS NETNAME data. - /// - /// A task containing SimCphsNetName information. - /// http://tizen.org/feature/network.telephony - /// http://tizen.org/privilege/telephony - /// Thrown when telephony feature is not supported. - /// Thrown when privilege access is denied. - /// Thrown when it is failed due to invalid parameter. - /// Thrown when it is failed due to invalid operation. - public Task SimGetCphsNetName() - { - TaskCompletionSource task = new TaskCompletionSource(); - IntPtr id = (IntPtr)_requestId++; - _callbackMap[id] = (handle, result, data, key) => - { - Task taskResult = new Task(() => - { - if (result != (int)SimAccessResult.Success) - { - Log.Error(TapiUtility.LogTag, "Error occurs in getting CPHS netname info: " + (SimAccessResult)result); - task.SetException(new InvalidOperationException("Error occurs in getting CPHS netname info, " + (SimAccessResult)result)); - return; - } - - SimCphsNetNameStruct info = Marshal.PtrToStructure(data); - task.SetResult(SimStructConversions.ConvertSimCphsNetNameStruct(info)); - }); - taskResult.Start(); - taskResult.Wait(); - _callbackMap.Remove(key); - }; - - int ret = Interop.Tapi.Sim.SimGetCphsNetName(_handle, _callbackMap[id], id); - if (ret != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Failed to get SIM CPHS netname info, Error: " + (TapiError)ret); - TapiUtility.ThrowTapiException(ret, _handle, "http://tizen.org/privilege/telephony"); - } - - return task.Task; - } - - /// - /// Executes an authentication procedure by using SIM. - /// - /// The authentication code to be validated by the ISIM, 3G, and GSM application in the SIM card. - /// A task containing SimAuthenticationResponse information. - /// http://tizen.org/feature/network.telephony - /// platform - /// http://tizen.org/privilege/telephony.admin - /// Thrown when telephony feature is not supported. - /// Thrown when privilege access is denied. - /// Thrown when authentication data is passed as null. - /// Thrown when it is failed due to invalid parameter. - /// Thrown when it is failed due to invalid operation. - public Task SimExecuteAuthentication(SimAuthenticationData authenticationData) - { - TaskCompletionSource task = new TaskCompletionSource(); - IntPtr id = (IntPtr)_requestId++; - _callbackMap[id] = (handle, result, data, key) => - { - Task taskResult = new Task(() => - { - if (result != (int)SimAccessResult.Success) - { - Log.Error(TapiUtility.LogTag, "Error occurs in executing authentication procedure: " + (SimAccessResult)result); - task.SetException(new InvalidOperationException("Error occurs in executing authentication procedure, " + (SimAccessResult)result)); - return; - } - - SimAuthenticationResponseStruct info = Marshal.PtrToStructure(data); - task.SetResult(SimStructConversions.ConvertSimAuthenticationResponseStruct(info)); - }); - taskResult.Start(); - taskResult.Wait(); - _callbackMap.Remove(key); - }; - - if (authenticationData == null) - { - throw new ArgumentNullException("SIM authentication data is null"); - } - - SimAuthenticationDataStruct authStruct = SimClassConversions.ConvertSimAuthenticationDataStruct(authenticationData); - int ret = Interop.Tapi.Sim.SimExecuteAuthentication(_handle, ref authStruct, _callbackMap[id], id); - if (ret != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Failed to execute authentication procedure, Error: " + (TapiError)ret); - TapiUtility.ThrowTapiException(ret, _handle, "http://tizen.org/privilege/telephony.admin"); - } - - return task.Task; - } - - /// - /// Performs PIN1/PIN2/SIM LOCK verification. - /// - /// The PIN code. - /// A task containing SimPinResult information. - /// http://tizen.org/feature/network.telephony - /// platform - /// http://tizen.org/privilege/telephony.admin - /// Thrown when telephony feature is not supported. - /// Thrown when privilege access is denied. - /// Thrown when pin data is passed as null. - /// Thrown when the system runs out of memory. - /// Thrown when it is failed due to invalid parameter. - /// Thrown when it is failed due to invalid operation. - public Task SimVerifyPins(SimPinData pinData) - { - TaskCompletionSource task = new TaskCompletionSource(); - IntPtr id = (IntPtr)_requestId++; - _callbackMap[id] = (handle, result, data, key) => - { - Task taskResult = new Task(() => - { - if (result != (int)SimAccessResult.Success) - { - Log.Error(TapiUtility.LogTag, "Error occurs in verifying SIM pins: " + (SimAccessResult)result); - task.SetException(new InvalidOperationException("Error occurs in verifying SIM pins, " + (SimAccessResult)result)); - return; - } - - SimPinResultStruct info = Marshal.PtrToStructure(data); - task.SetResult(SimStructConversions.ConvertSimPinResultStruct(info)); - }); - taskResult.Start(); - taskResult.Wait(); - _callbackMap.Remove(key); - }; - - if (pinData == null) - { - throw new ArgumentNullException("SIM PIN data is null"); - } - - SimPinDataStruct pinStruct = SimClassConversions.ConvertSimPinData(pinData); - int ret = Interop.Tapi.Sim.SimVerifyPins(_handle, ref pinStruct, _callbackMap[id], id); - if (ret != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Failed to verify SIM PIN, Error: " + (TapiError)ret); - TapiUtility.ThrowTapiException(ret, _handle, "http://tizen.org/privilege/telephony.admin"); - } - - return task.Task; - } - - /// - /// Performs PIN1/PIN2 unblocking operation based on PUK information. - /// - /// The unblocking PIN password. - /// The PIN password to use after the unblocking operation. - /// A task containing SimPinResult information. - /// http://tizen.org/feature/network.telephony - /// platform - /// http://tizen.org/privilege/telephony.admin - /// Thrown when telephony feature is not supported. - /// Thrown when privilege access is denied. - /// Thrown when either of pukData or newPinData is passed as null. - /// Thrown when the system runs out of memory. - /// Thrown when it is failed due to invalid parameter. - /// Thrown when it is failed due to invalid operation. - public Task SimVerifyPuks(SimPinData pukData, SimPinData newPinData) - { - TaskCompletionSource task = new TaskCompletionSource(); - IntPtr id = (IntPtr)_requestId++; - _callbackMap[id] = (handle, result, data, key) => - { - Task taskResult = new Task(() => - { - if (result != (int)SimAccessResult.Success) - { - Log.Error(TapiUtility.LogTag, "Error occurs in verifying SIM puks: " + (SimAccessResult)result); - task.SetException(new InvalidOperationException("Error occurs in verifying SIM puks, " + (SimAccessResult)result)); - return; - } - - SimPinResultStruct info = Marshal.PtrToStructure(data); - task.SetResult(SimStructConversions.ConvertSimPinResultStruct(info)); - }); - taskResult.Start(); - taskResult.Wait(); - _callbackMap.Remove(key); - }; - - if (pukData == null || newPinData == null) - { - throw new ArgumentNullException("SIM PIN/PUK data is null"); - } - - SimPinDataStruct pukStruct = SimClassConversions.ConvertSimPinData(pukData); - SimPinDataStruct pinStruct = SimClassConversions.ConvertSimPinData(newPinData); - int ret = Interop.Tapi.Sim.SimVerifyPuks(_handle, ref pukStruct, ref pinStruct, _callbackMap[id], id); - if (ret != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Failed to verify SIM puks, Error: " + (TapiError)ret); - TapiUtility.ThrowTapiException(ret, _handle, "http://tizen.org/privilege/telephony.admin"); - } - - return task.Task; - } - - /// - /// Changes the PIN1/PIN2 code based on the PIN type passed along with old PIN data and new PIN data. - /// - /// The old PIN code entered by the user. - /// The new PIN code entered by the user. - /// A task containing SimPinResult information. - /// http://tizen.org/feature/network.telephony - /// platform - /// http://tizen.org/privilege/telephony.admin - /// Thrown when telephony feature is not supported. - /// Thrown when privilege access is denied. - /// Thrown when either of oldPin or newPin is passed as null. - /// Thrown when the system runs out of memory. - /// Thrown when it is failed due to invalid parameter. - /// Thrown when it is failed due to invalid operation. - public Task SimChangePins(SimPinData oldPin, SimPinData newPin) - { - TaskCompletionSource task = new TaskCompletionSource(); - IntPtr id = (IntPtr)_requestId++; - _callbackMap[id] = (handle, result, data, key) => - { - Task taskResult = new Task(() => - { - if (result != (int)SimAccessResult.Success) - { - Log.Error(TapiUtility.LogTag, "Error occurs in changing SIM pins: " + (SimAccessResult)result); - task.SetException(new InvalidOperationException("Error occurs in changing SIM pins, " + (SimAccessResult)result)); - return; - } - - SimPinResultStruct info = Marshal.PtrToStructure(data); - task.SetResult(SimStructConversions.ConvertSimPinResultStruct(info)); - }); - taskResult.Start(); - taskResult.Wait(); - _callbackMap.Remove(key); - }; - - if (oldPin == null || newPin == null) - { - throw new ArgumentNullException("Old/new PIN data is null"); - } - - SimPinDataStruct oldPinStruct = SimClassConversions.ConvertSimPinData(oldPin); - SimPinDataStruct newPinStruct = SimClassConversions.ConvertSimPinData(newPin); - int ret = Interop.Tapi.Sim.SimChangePins(_handle, ref oldPinStruct, ref newPinStruct, _callbackMap[id], id); - if (ret != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Failed to change SIM pins, Error: " + (TapiError)ret); - TapiUtility.ThrowTapiException(ret, _handle, "http://tizen.org/privilege/telephony.admin"); - } - - return task.Task; - } - - /// - /// Disables the SIM facility. - /// - /// An object which contains the facility type and password. - /// A task containing SIM facility result information. - /// http://tizen.org/feature/network.telephony - /// platform - /// http://tizen.org/privilege/telephony.admin - /// Thrown when telephony feature is not supported. - /// Thrown when privilege access is denied. - /// Thrown when SIM facility info is passed as null. - /// Thrown when the system runs out of memory. - /// Thrown when it is failed due to invalid parameter. - /// Thrown when it is failed due to invalid operation. - public Task SimDisableFacility(SimFacility facility) - { - TaskCompletionSource task = new TaskCompletionSource(); - IntPtr id = (IntPtr)_requestId++; - _callbackMap[id] = (handle, result, data, key) => - { - Task taskResult = new Task(() => - { - if (result != (int)SimAccessResult.Success) - { - Log.Error(TapiUtility.LogTag, "Error occurs in disabling SIM facility: " + (SimAccessResult)result); - task.SetException(new InvalidOperationException("Error occurs in disabling SIM facility, " + (SimAccessResult)result)); - return; - } - - SimFacilityResultStruct info = Marshal.PtrToStructure(data); - task.SetResult(SimStructConversions.ConvertSimFacilityResultStruct(info)); - }); - taskResult.Start(); - taskResult.Wait(); - _callbackMap.Remove(key); - }; - - if (facility == null) - { - throw new ArgumentNullException("SIM facility info is null"); - } - - SimFacilityStruct facilityStruct = SimClassConversions.ConvertSimFacility(facility); - int ret = Interop.Tapi.Sim.SimDisableFacility(_handle, ref facilityStruct, _callbackMap[id], id); - if (ret != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Failed to disable SIM facility, Error: " + (TapiError)ret); - TapiUtility.ThrowTapiException(ret, _handle, "http://tizen.org/privilege/telephony.admin"); - } - - return task.Task; - } - - /// - /// Enables the SIM facility. - /// - /// An object which contains the facility type and password. - /// A task containing SIM facility result information. - /// http://tizen.org/feature/network.telephony - /// platform - /// http://tizen.org/privilege/telephony.admin - /// Thrown when telephony feature is not supported. - /// Thrown when privilege access is denied. - /// Thrown when SIM facility info is passed as null. - /// Thrown when the system runs out of memory. - /// Thrown when it is failed due to invalid parameter. - /// Thrown when it is failed due to invalid operation. - public Task SimEnableFacility(SimFacility facility) - { - TaskCompletionSource task = new TaskCompletionSource(); - IntPtr id = (IntPtr)_requestId++; - _callbackMap[id] = (handle, result, data, key) => - { - Task taskResult = new Task(() => - { - if (result != (int)SimAccessResult.Success) - { - Log.Error(TapiUtility.LogTag, "Error occurs in enabling SIM facility: " + (SimAccessResult)result); - task.SetException(new InvalidOperationException("Error occurs in enabling SIM facility, " + (SimAccessResult)result)); - return; - } - - SimFacilityResultStruct info = Marshal.PtrToStructure(data); - task.SetResult(SimStructConversions.ConvertSimFacilityResultStruct(info)); - }); - taskResult.Start(); - taskResult.Wait(); - _callbackMap.Remove(key); - }; - - if (facility == null) - { - throw new ArgumentNullException("SIM facility info is null"); - } - - SimFacilityStruct facilityStruct = SimClassConversions.ConvertSimFacility(facility); - int ret = Interop.Tapi.Sim.SimEnableFacility(_handle, ref facilityStruct, _callbackMap[id], id); - if (ret != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Failed to enable SIM facility, Error: " + (TapiError)ret); - TapiUtility.ThrowTapiException(ret, _handle, "http://tizen.org/privilege/telephony.admin"); - } - - return task.Task; - } - - /// - /// Gets the SIM facility. - /// - /// The type of security lock. - /// A task containing SIM facility information. - /// http://tizen.org/feature/network.telephony - /// http://tizen.org/privilege/telephony - /// Thrown when telephony feature is not supported. - /// Thrown when privilege access is denied. - /// Thrown when it is failed due to invalid parameter. - /// Thrown when it is failed due to invalid operation. - public Task SimGetFacility(SimLockType lockType) - { - TaskCompletionSource task = new TaskCompletionSource(); - IntPtr id = (IntPtr)_requestId++; - _callbackMap[id] = (handle, result, data, key) => - { - Task taskResult = new Task(() => - { - if (result != (int)SimAccessResult.Success) - { - Log.Error(TapiUtility.LogTag, "Error occurs in getting SIM facility: " + (SimAccessResult)result); - task.SetException(new InvalidOperationException("Error occurs in getting SIM facility, " + (SimAccessResult)result)); - return; - } - - SimFacilityInfoStruct info = Marshal.PtrToStructure(data); - task.SetResult(SimStructConversions.ConvertSimFacilityInfoStruct(info)); - }); - taskResult.Start(); - taskResult.Wait(); - _callbackMap.Remove(key); - }; - - int ret = Interop.Tapi.Sim.SimGetFacility(_handle, lockType, _callbackMap[id], id); - if (ret != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Failed to get SIM facility, Error: " + (TapiError)ret); - TapiUtility.ThrowTapiException(ret, _handle, "http://tizen.org/privilege/telephony"); - } - - return task.Task; - } - - /// - /// Gets SIM lock type info. - /// - /// The type of security lock. - /// A task containing SIM lock information. - /// http://tizen.org/feature/network.telephony - /// http://tizen.org/privilege/telephony - /// Thrown when telephony feature is not supported. - /// Thrown when privilege access is denied. - /// Thrown when it is failed due to invalid parameter. - /// Thrown when it is failed due to invalid operation. - public Task SimGetLockInfo(SimLockType lockType) - { - TaskCompletionSource task = new TaskCompletionSource(); - IntPtr id = (IntPtr)_requestId++; - _callbackMap[id] = (handle, result, data, key) => - { - Task taskResult = new Task(() => - { - if (result != (int)SimAccessResult.Success) - { - Log.Error(TapiUtility.LogTag, "Error occurs in getting SIM lock info: " + (SimAccessResult)result); - task.SetException(new InvalidOperationException("Error occurs in getting SIM lock info, " + (SimAccessResult)result)); - return; - } - - SimLockInfoStruct info = Marshal.PtrToStructure(data); - task.SetResult(SimStructConversions.ConvertSimLockInfoStruct(info)); - }); - taskResult.Start(); - taskResult.Wait(); - _callbackMap.Remove(key); - }; - - int ret = Interop.Tapi.Sim.SimGetLockInfo(_handle, lockType, _callbackMap[id], id); - if (ret != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Failed to get SIM lock info, Error: " + (TapiError)ret); - TapiUtility.ThrowTapiException(ret, _handle, "http://tizen.org/privilege/telephony"); - } - - return task.Task; - } - - /// - /// Sets the SIM power state. - /// - /// The state of SIM to be set. - /// A task indicating whether setting SIM power state is done or not. - /// http://tizen.org/feature/network.telephony - /// platform - /// http://tizen.org/privilege/telephony.admin - /// Thrown when telephony feature is not supported. - /// Thrown when privilege access is denied. - /// Thrown when it is failed due to invalid parameter. - /// Thrown when it is failed due to invalid operation. - public Task SimSetPowerState(SimPowerState state) - { - TaskCompletionSource task = new TaskCompletionSource(); - IntPtr id = (IntPtr)_requestId++; - _callbackMap[id] = (handle, result, data, key) => - { - Task taskResult = new Task(() => - { - if (result != (int)SimPowerSetResult.Success) - { - Log.Error(TapiUtility.LogTag, "Error occurs in setting SIM power state: " + (SimPowerSetResult)result); - task.SetException(new InvalidOperationException("Error occurs in setting SIM power state, " + (SimPowerSetResult)result)); - return; - } - - task.SetResult(true); - }); - taskResult.Start(); - taskResult.Wait(); - _callbackMap.Remove(key); - }; - - int ret = Interop.Tapi.Sim.SimSetPowerState(_handle, state, _callbackMap[id], id); - if (ret != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Failed to set SIM power state, Error: " + (TapiError)ret); - TapiUtility.ThrowTapiException(ret, _handle, "http://tizen.org/privilege/telephony.admin"); - } - - return task.Task; - } - - /// - /// Provides a common interface for accessing SIM data. - /// - /// The APDU data. - /// A task containing SIM APDU response information. - /// http://tizen.org/feature/network.telephony - /// platform - /// http://tizen.org/privilege/telephony.admin - /// Thrown when telephony feature is not supported. - /// Thrown when privilege access is denied. - /// Thrown when SIM APDU is passed as null. - /// Thrown when it is failed due to invalid parameter. - /// Thrown when it is failed due to invalid operation. - public Task SimRequestApdu(SimApdu apdu) - { - TaskCompletionSource task = new TaskCompletionSource(); - IntPtr id = (IntPtr)_requestId++; - _callbackMap[id] = (handle, result, data, key) => - { - Task taskResult = new Task(() => - { - if (result != (int)SimAccessResult.Success) - { - Log.Error(TapiUtility.LogTag, "Error occurs in requesting SIM APDU: " + (SimAccessResult)result); - task.SetException(new InvalidOperationException("Error occurs in requesting SIM APDU, " + (SimAccessResult)result)); - return; - } - - SimApduResponseStruct info = Marshal.PtrToStructure(data); - task.SetResult(SimStructConversions.ConvertSimApduResponseStruct(info)); - }); - taskResult.Start(); - taskResult.Wait(); - _callbackMap.Remove(key); - }; - - if (apdu == null) - { - throw new ArgumentNullException("SIM APDU is null"); - } - - SimApduStruct apduStruct = SimClassConversions.ConvertSimApdu(apdu); - int ret = Interop.Tapi.Sim.SimRequestApdu(_handle, ref apduStruct, _callbackMap[id], id); - if (ret != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Failed to request SIM APDU, Error: " + (TapiError)ret); - TapiUtility.ThrowTapiException(ret, _handle, "http://tizen.org/privilege/telephony.admin"); - } - - return task.Task; - } - - /// - /// Provides a common interface to get the SIM ATR(Answer To Reset) value. - /// - /// A task containing SIM ATR response information. - /// http://tizen.org/feature/network.telephony - /// http://tizen.org/privilege/telephony - /// Thrown when telephony feature is not supported. - /// Thrown when privilege access is denied. - /// Thrown when it is failed due to invalid parameter. - /// Thrown when it is failed due to invalid operation. - public Task SimRequestAtr() - { - TaskCompletionSource task = new TaskCompletionSource(); - IntPtr id = (IntPtr)_requestId++; - _callbackMap[id] = (handle, result, data, key) => - { - Task taskResult = new Task(() => - { - if (result != (int)SimAccessResult.Success) - { - Log.Error(TapiUtility.LogTag, "Error occurs in requesting SIM ATR: " + (SimAccessResult)result); - task.SetException(new InvalidOperationException("Error occurs in requesting SIM ATR, " + (SimAccessResult)result)); - return; - } - - SimAtrResponseStruct info = Marshal.PtrToStructure(data); - task.SetResult(SimStructConversions.ConvertSimAtrResponseStruct(info)); - }); - taskResult.Start(); - taskResult.Wait(); - _callbackMap.Remove(key); - }; - - int ret = Interop.Tapi.Sim.SimRequestAtr(_handle, _callbackMap[id], id); - if (ret != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Failed to request SIM ATR, Error: " + (TapiError)ret); - TapiUtility.ThrowTapiException(ret, _handle, "http://tizen.org/privilege/telephony"); - } - - return task.Task; - } - - /// - /// Gets the IMPI(IMS private user identity). (ISIM only). - /// - /// A task containing IMPI string. - /// http://tizen.org/feature/network.telephony - /// http://tizen.org/privilege/telephony - /// Thrown when telephony feature is not supported. - /// Thrown when privilege access is denied. - /// Thrown when it is failed due to invalid parameter. - /// Thrown when it is failed due to invalid operation. - public Task SimGetImpi() - { - TaskCompletionSource task = new TaskCompletionSource(); - IntPtr id = (IntPtr)_requestId++; - _callbackMap[id] = (handle, result, data, key) => - { - Task taskResult = new Task(() => - { - if (result != (int)SimAccessResult.Success) - { - Log.Error(TapiUtility.LogTag, "Error occurs in getting SIM IMPI: " + (SimAccessResult)result); - task.SetException(new InvalidOperationException("Error occurs in getting SIM IMPI, " + (SimAccessResult)result)); - return; - } - - task.SetResult(Marshal.PtrToStringAnsi(data)); - }); - taskResult.Start(); - taskResult.Wait(); - _callbackMap.Remove(key); - }; - - int ret = Interop.Tapi.Sim.SimGetImpi(_handle, _callbackMap[id], id); - if (ret != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Failed to get SIM IMPI, Error: " + (TapiError)ret); - TapiUtility.ThrowTapiException(ret, _handle, "http://tizen.org/privilege/telephony"); - } - - return task.Task; - } - - /// - /// Gets the IMPU(IMS public user identity). (ISIM only). - /// - /// A task containing SIM IMPU list information. - /// http://tizen.org/feature/network.telephony - /// http://tizen.org/privilege/telephony - /// Thrown when telephony feature is not supported. - /// Thrown when privilege access is denied. - /// Thrown when it is failed due to invalid parameter. - /// Thrown when it is failed due to invalid operation. - public Task SimGetImpu() - { - TaskCompletionSource task = new TaskCompletionSource(); - IntPtr id = (IntPtr)_requestId++; - _callbackMap[id] = (handle, result, data, key) => - { - Task taskResult = new Task(() => - { - if (result != (int)SimAccessResult.Success) - { - Log.Error(TapiUtility.LogTag, "Error occurs in getting SIM IMPU: " + (SimAccessResult)result); - task.SetException(new InvalidOperationException("Error occurs in getting SIM IMPU, " + (SimAccessResult)result)); - return; - } - - SimImpuListStruct info = Marshal.PtrToStructure(data); - task.SetResult(SimStructConversions.ConvertSimImpuListStruct(info)); - }); - taskResult.Start(); - taskResult.Wait(); - _callbackMap.Remove(key); - }; - - int ret = Interop.Tapi.Sim.SimGetImpu(_handle, _callbackMap[id], id); - if (ret != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Failed to get SIM IMPU, Error: " + (TapiError)ret); - TapiUtility.ThrowTapiException(ret, _handle, "http://tizen.org/privilege/telephony"); - } - - return task.Task; - } - - /// - /// Gets the Domain(Home Network Domain Name). (ISIM only) - /// - /// A task containing domain string. - /// http://tizen.org/feature/network.telephony - /// http://tizen.org/privilege/telephony - /// Thrown when telephony feature is not supported. - /// Thrown when privilege access is denied. - /// Thrown when it is failed due to invalid parameter. - /// Thrown when it is failed due to invalid operation. - public Task SimGetDomain() - { - TaskCompletionSource task = new TaskCompletionSource(); - IntPtr id = (IntPtr)_requestId++; - _callbackMap[id] = (handle, result, data, key) => - { - Task taskResult = new Task(() => - { - if (result != (int)SimAccessResult.Success) - { - Log.Error(TapiUtility.LogTag, "Error occurs in getting SIM domain: " + (SimAccessResult)result); - task.SetException(new InvalidOperationException("Error occurs in getting SIM domain, " + (SimAccessResult)result)); - return; - } - - task.SetResult(Marshal.PtrToStringAnsi(data)); - }); - taskResult.Start(); - taskResult.Wait(); - _callbackMap.Remove(key); - }; - - int ret = Interop.Tapi.Sim.SimGetDomain(_handle, _callbackMap[id], id); - if (ret != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Failed to get SIM domain, Error: " + (TapiError)ret); - TapiUtility.ThrowTapiException(ret, _handle, "http://tizen.org/privilege/telephony"); - } - - return task.Task; - } - - /// - /// Gets the P-CSCF(Proxy Call Session Control Function). (ISIM only) - /// - /// A task containing SIM PCSCF list information. - /// http://tizen.org/feature/network.telephony - /// http://tizen.org/privilege/telephony - /// Thrown when telephony feature is not supported. - /// Thrown when privilege access is denied. - /// Thrown when it is failed due to invalid parameter. - /// Thrown when it is failed due to invalid operation. - public Task SimGetPcscf() - { - TaskCompletionSource task = new TaskCompletionSource(); - IntPtr id = (IntPtr)_requestId++; - _callbackMap[id] = (handle, result, data, key) => - { - Task taskResult = new Task(() => - { - if (result != (int)SimAccessResult.Success) - { - Log.Error(TapiUtility.LogTag, "Error occurs in getting SIM PCSCF: " + (SimAccessResult)result); - task.SetException(new InvalidOperationException("Error occurs in getting SIM PCSCF, " + (SimAccessResult)result)); - return; - } - - SimPcscfListStruct info = Marshal.PtrToStructure(data); - task.SetResult(SimStructConversions.ConvertSimPcscfListStruct(info)); - }); - taskResult.Start(); - taskResult.Wait(); - _callbackMap.Remove(key); - }; - - int ret = Interop.Tapi.Sim.SimGetPcscf(_handle, _callbackMap[id], id); - if (ret != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Failed to get SIM PCSCF, Error: " + (TapiError)ret); - TapiUtility.ThrowTapiException(ret, _handle, "http://tizen.org/privilege/telephony"); - } - - return task.Task; - } - - /// - /// Gets the ISIM service table. (ISIM only). - /// - /// A task containing a byte array in which mask value of SimIsimService enum will be stored. - /// http://tizen.org/feature/network.telephony - /// http://tizen.org/privilege/telephony - /// Thrown when telephony feature is not supported. - /// Thrown when privilege access is denied. - /// Thrown when it is failed due to invalid parameter. - /// Thrown when it is failed due to invalid operation. - public Task SimGetIsimServiceTable() - { - TaskCompletionSource task = new TaskCompletionSource(); - IntPtr id = (IntPtr)_requestId++; - _callbackMap[id] = (handle, result, data, key) => - { - Task taskResult = new Task(() => - { - if (result != (int)SimAccessResult.Success) - { - Log.Error(TapiUtility.LogTag, "Error occurs in getting ISIM service table: " + (SimAccessResult)result); - task.SetException(new InvalidOperationException("Error occurs in getting ISIM service table, " + (SimAccessResult)result)); - return; - } - - task.SetResult(Encoding.ASCII.GetBytes(Marshal.PtrToStringAnsi(data))); - }); - taskResult.Start(); - taskResult.Wait(); - _callbackMap.Remove(key); - }; - - int ret = Interop.Tapi.Sim.SimGetIsimServiceTable(_handle, _callbackMap[id], id); - if (ret != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Failed to get ISIM service table, Error: " + (TapiError)ret); - TapiUtility.ThrowTapiException(ret, _handle, "http://tizen.org/privilege/telephony"); - } - - return task.Task; - } - } -} diff --git a/src/Tizen.Tapi/Tizen.Tapi/SimData.cs b/src/Tizen.Tapi/Tizen.Tapi/SimData.cs deleted file mode 100755 index 96a3cdbfe..000000000 --- a/src/Tizen.Tapi/Tizen.Tapi/SimData.cs +++ /dev/null @@ -1,2236 +0,0 @@ -/* - * 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.Collections.Generic; - -namespace Tizen.Tapi -{ - /// - /// A class which defines SIM card initialization information. - /// - public class SimInitInfo - { - internal SimCardStatus SimStatus; - internal bool IsChanged; - internal SimInitInfo() - { - } - - /// - /// The SIM initialization status from the Telephony server boot up time. - /// - public SimCardStatus Status - { - get - { - return SimStatus; - } - } - - /// - /// The SIM card identification value. It will be true when the current inserted SIM card differs from the previous SIM. False otherwise. - /// - public bool IsCardChanged - { - get - { - return IsChanged; - } - } - } - - /// - /// A class which defines data for IMSI information. - /// - public class SimImsiInfo - { - internal string CountryCode; - internal string NetworkCode; - internal string StationId; - internal SimImsiInfo() - { - } - - /// - /// Mobile Country Code. - /// - public string Mcc - { - get - { - return CountryCode; - } - } - - /// - /// Mobile Network Code. - /// - public string Mnc - { - get - { - return NetworkCode; - } - } - - /// - /// Mobile Station Identification Number. - /// - public string Msin - { - get - { - return StationId; - } - } - } - - /// - /// A class which defines data for ECC information of GSM/USIM/CDMA SIM. - /// - public class SimEccInfo - { - internal string NameInfo; - internal string NumberInfo; - internal SimEccEmergencyServiceType TypeInfo; - internal SimEccInfo() - { - } - - /// - /// Name. Applicable only for USIM(3G) SIM. - /// - public string Name - { - get - { - return NameInfo; - } - } - - /// - /// Number. - /// - public string Number - { - get - { - return NumberInfo; - } - } - - /// - /// Emergency service type. Applicable only for USIM(3G) SIM. - /// - public SimEccEmergencyServiceType Category - { - get - { - return TypeInfo; - } - } - } - - /// - /// A class which defines ECC information list. - /// - public class SimEccInfoList - { - internal int EccCount; - internal IEnumerable List; - internal SimEccInfoList() - { - } - - /// - /// ECC count. - /// - public int Count - { - get - { - return EccCount; - } - } - - /// - /// List of ECC. - /// - public IEnumerable EccList - { - get - { - return List; - } - } - } - - /// - /// A class which defines ICCID(Integrated Circuit Card Identifier). - /// - public class SimIccIdInfo - { - internal int Length; - internal string Number; - internal SimIccIdInfo() - { - } - - /// - /// Integrated Circuit Card number length. - /// - public int IccLength - { - get - { - return Length; - } - } - - /// - /// Integrated Circuit Card number. - /// - public string IccNumber - { - get - { - return Number; - } - } - } - - /// - /// A class which defines call forwarding indication status data. - /// - public class SimCfis - { - private int _recIndex; - private byte _mspNum; - private byte _cfuStatus; - private SimTypeOfNumber _ton; - private SimNumberPlanIdentity _npi; - private string _cfuNum; - private byte _cc2Id; - private byte _ext7Id; - - /// - /// Record index. - /// - public int RecIndex - { - get - { - return _recIndex; - } - - set - { - _recIndex = value; - } - } - - /// - /// MSP number. - /// - public byte MspNum - { - get - { - return _mspNum; - } - - set - { - _mspNum = value; - } - } - - /// - /// Call forwarding unconditional indication status. - /// - public byte CfuStatus - { - get - { - return _cfuStatus; - } - - set - { - _cfuStatus = value; - } - } - - /// - /// SIM Type of number. - /// - public SimTypeOfNumber Ton - { - get - { - return _ton; - } - - set - { - _ton = value; - } - } - - /// - /// SIM numbering plan identity. - /// - public SimNumberPlanIdentity Npi - { - get - { - return _npi; - } - - set - { - _npi = value; - } - } - - /// - /// Dialing Number/SSC String. - /// - public string CfuNum - { - get - { - return _cfuNum; - } - - set - { - _cfuNum = value; - } - } - - /// - /// Capability/Configuration 2 Record Identifier. - /// - public byte Cc2Id - { - get - { - return _cc2Id; - } - - set - { - _cc2Id = value; - } - } - - /// - /// Extension 7 Record Identifier. - /// - public byte Ext7Id - { - get - { - return _ext7Id; - } - - set - { - _ext7Id = value; - } - } - } - - /// - /// A class which defines call forwarding indication status list. - /// - public class SimCfisList - { - internal int Count; - internal IEnumerable List; - internal SimCfisList() - { - } - - /// - /// Profile count. - /// - public int ProfileCount - { - get - { - return Count; - } - } - - /// - /// List of CFIS. - /// - public IEnumerable CfisList - { - get - { - return List; - } - } - } - - /// - /// A class which defines CPHS call forwarding status data. - /// - public class SimCphsCf - { - private int _line1; - private int _line2; - private int _fax; - private int _data; - - /// - /// CallForwardUnconditionalLine 1. - /// - public int Line1 - { - get - { - return _line1; - } - - set - { - _line1 = value; - } - } - - /// - /// CallForwardUnconditionalLine 2. - /// - public int Line2 - { - get - { - return _line2; - } - - set - { - _line2 = value; - } - } - - /// - /// CallForwardUnconditional Fax. - /// - public int Fax - { - get - { - return _fax; - } - - set - { - _fax = value; - } - } - - /// - /// CallForwardUnconditional data. - /// - public int Data - { - get - { - return _data; - } - - set - { - _data = value; - } - } - } - - /// - /// A class which defines call forwarding response. - /// - public class SimCallForwardResponse - { - internal bool IsCphsCf; - internal SimCfisList List; - internal SimCphsCf CphsCfInfo; - internal SimCallForwardResponse() - { - } - - /// - /// CPHS or not. - /// - public bool IsCphs - { - get - { - return IsCphsCf; - } - } - - /// - /// List of CFIS. - /// - public SimCfisList CfList - { - get - { - return List; - } - } - - /// - /// CPHS CF. - /// - public SimCphsCf CphsCf - { - get - { - return CphsCfInfo; - } - } - } - - /// - /// A class which defines call forwarding request. - /// - public class SimCallForwardRequest - { - private bool _isCphs; - private SimCfis _cfis; - private SimCphsCf _cphsCf; - - /// - /// CPHS or not. - /// - public bool IsCphs - { - get - { - return _isCphs; - } - - set - { - _isCphs = value; - } - } - - /// - /// CFIS. - /// - /// - /// This should be filled only if IsCphs is false. - /// - public SimCfis Cfis - { - get - { - return _cfis; - } - - set - { - _cfis = value; - } - } - - /// - /// CPHS CF. - /// - /// - /// This should be filled only if IsCphs is true. - /// - public SimCphsCf CphsCf - { - get - { - return _cphsCf; - } - - set - { - _cphsCf = value; - } - } - } - - /// - /// A class which defines message waiting indication status data. - /// - public class SimMwis - { - private int _recIndex; - private byte _indicatorStatus; - private int _voiceCount; - private int _faxCount; - private int _emailCount; - private int _otherCount; - private int _videoCount; - - /// - /// Record index. - /// - public int RecIndex - { - get - { - return _recIndex; - } - - set - { - _recIndex = value; - } - } - - /// - /// Indicator type. - /// - public byte IndicatorStatus - { - get - { - return _indicatorStatus; - } - - set - { - _indicatorStatus = value; - } - } - - /// - /// VoiceMail count. - /// - public int VoiceCount - { - get - { - return _voiceCount; - } - - set - { - _voiceCount = value; - } - } - - /// - /// Fax count. - /// - public int FaxCount - { - get - { - return _faxCount; - } - - set - { - _faxCount = value; - } - } - - /// - /// Email count. - /// - public int EmailCount - { - get - { - return _emailCount; - } - - set - { - _emailCount = value; - } - } - - /// - /// Other count. - /// - public int OtherCount - { - get - { - return _otherCount; - } - - set - { - _otherCount = value; - } - } - - /// - /// VideoMail count. - /// - public int VideoCount - { - get - { - return _videoCount; - } - - set - { - _videoCount = value; - } - } - } - - /// - /// A class which defines message waiting indication status list. - /// - public class SimMwisList - { - internal int Count; - internal IEnumerable List; - internal SimMwisList() - { - } - - /// - /// Profile count. - /// - public int ProfileCount - { - get - { - return Count; - } - } - - /// - /// List of MWIS. - /// - public IEnumerable MwList - { - get - { - return List; - } - } - } - - /// - /// A class which defines CPHS message waiting status data. - /// - public class SimCphsMw - { - private bool _isVoice1; - private bool _isVoice2; - private bool _isFax; - private bool _isData; - - /// - /// VoiceMsgLine1 message waiting flag. - /// - public bool IsVoice1 - { - get - { - return _isVoice1; - } - - set - { - _isVoice1 = value; - } - } - - /// - /// VoiceMsgLine2 message waiting flag. - /// - public bool IsVoice2 - { - get - { - return _isVoice2; - } - - set - { - _isVoice2 = value; - } - } - - /// - /// FAX message waiting flag. - /// - public bool IsFax - { - get - { - return _isFax; - } - - set - { - _isFax = value; - } - } - - /// - /// Data message waiting flag. - /// - public bool IsData - { - get - { - return _isData; - } - - set - { - _isData = value; - } - } - } - - /// - /// A class which defines message waiting reponse. - /// - public class SimMessageWaitingResponse - { - internal bool IsCphsMw; - internal SimMwisList List; - internal SimCphsMw CphsMwInfo; - internal SimMessageWaitingResponse() - { - } - - /// - /// CPHS or not. - /// - public bool IsCphs - { - get - { - return IsCphsMw; - } - } - - /// - /// List of MWIS. - /// - public SimMwisList MwList - { - get - { - return List; - } - } - - /// - /// CPHS MW. - /// - public SimCphsMw CphsMw - { - get - { - return CphsMwInfo; - } - } - } - - /// - /// A class which defines message waiting request. - /// - public class SimMessageWaitingRequest - { - private bool _isCphs; - private SimMwis _mwis; - private SimCphsMw _cphsMw; - - /// - /// CPHS or not. - /// - public bool IsCphs - { - get - { - return _isCphs; - } - - set - { - _isCphs = value; - } - } - - /// - /// MWIS. - /// - /// - /// This should be filled only if IsCphs is false. - /// - public SimMwis Mwis - { - get - { - return _mwis; - } - - set - { - _mwis = value; - } - } - - /// - /// CPHS MW. - /// - /// - /// This should be filled only if IsCphs is true. - /// - public SimCphsMw CphsMw - { - get - { - return _cphsMw; - } - - set - { - _cphsMw = value; - } - } - } - - /// - /// A class which defines mailbox dialing number data. - /// - public class SimMailboxNumber - { - private bool _isCphs; - private int _recIndex; - private int _profileNumber; - private SimMailboxType _mbType; - private int _alphaMaxLength; - private string _alphaId; - private SimTypeOfNumber _ton; - private SimNumberPlanIdentity _npi; - private string _number; - private byte _ccId; - private byte _ext1Id; - - /// - /// CPHS or not. - /// - public bool IsCphs - { - get - { - return _isCphs; - } - - set - { - _isCphs = value; - } - } - - /// - /// Index which stands for the location where the record is saved in SIM. - /// - public int RecIndex - { - get - { - return _recIndex; - } - - set - { - _recIndex = value; - } - } - - /// - /// SIM profile index. - /// - public int ProfileNumber - { - get - { - return _profileNumber; - } - - set - { - _profileNumber = value; - } - } - - /// - /// Mailbox type. - /// - public SimMailboxType MbType - { - get - { - return _mbType; - } - - set - { - _mbType = value; - } - } - - /// - /// Alpha max length in SIM. - /// - public int AlphaMaxLength - { - get - { - return _alphaMaxLength; - } - - set - { - _alphaMaxLength = value; - } - } - - /// - /// Alpha Identifier. - /// - public string AlphaId - { - get - { - return _alphaId; - } - - set - { - _alphaId = value; - } - } - - /// - /// Type Of Number. - /// - public SimTypeOfNumber Ton - { - get - { - return _ton; - } - - set - { - _ton = value; - } - } - - /// - /// Number Plan Identity. - /// - public SimNumberPlanIdentity Npi - { - get - { - return _npi; - } - - set - { - _npi = value; - } - } - - /// - /// Dialing Number/SSC String. - /// - public string Number - { - get - { - return _number; - } - - set - { - _number = value; - } - } - - /// - /// Capability/Configuration Identifier. - /// - public byte CcId - { - get - { - return _ccId; - } - - set - { - _ccId = value; - } - } - - /// - /// Extension 1 Record Identifier. - /// - public byte Ext1Id - { - get - { - return _ext1Id; - } - - set - { - _ext1Id = value; - } - } - } - - /// - /// A class which defines mailbox dialing number list. - /// - public class SimMailboxList - { - internal int MbCount; - internal IEnumerable MbList; - internal SimMailboxList() - { - } - - /// - /// Mailbox count. - /// - public int Count - { - get - { - return MbCount; - } - } - - /// - /// List of mailbox. - /// - public IEnumerable List - { - get - { - return MbList; - } - } - } - - /// - /// A class which defines available optional CPHS SIM files. - /// - public class SimCphsServiceTable - { - internal int CustomerSvcProfile; - internal int SvcStringTable; - internal int MbNumbers; - internal int OperatorNameShort; - internal int InformationNum; - internal SimCphsServiceTable() - { - } - - /// - /// Customer Service Profile (CSP). - /// - public int CustomerServiceProfile - { - get - { - return CustomerSvcProfile; - } - } - - /// - /// Service String Table (SST). - /// - public int ServiceStringTable - { - get - { - return SvcStringTable; - } - } - - /// - /// MailBoxNumbers. - /// - public int MailboxNumbers - { - get - { - return MbNumbers; - } - } - - /// - /// Short form of operator name. - /// - public int OperatorNameShortForm - { - get - { - return OperatorNameShort; - } - } - - /// - /// Information numbers. - /// - public int InformationNumbers - { - get - { - return InformationNum; - } - } - } - - /// - /// A class which defines CPHS information data. - /// - public class SimCphsInfo - { - internal SimCphsPhaseType Phase; - internal SimCphsServiceTable CphsSvcTable; - internal SimCphsInfo() - { - } - - /// - /// CPHS phase type. - /// - public SimCphsPhaseType CphsPhase - { - get - { - return Phase; - } - } - - /// - /// CPHS service table. - /// - public SimCphsServiceTable CphsServiceTable - { - get - { - return CphsSvcTable; - } - } - } - - /// - /// A class which defines CSIM service table. - /// - public class SimCst - { - internal SimCdmaServiceTable CdmaSvc; - internal byte[] Cdma; - internal byte[] Csim; - internal SimCst() - { - } - - /// - /// Cdma service table; - /// - public SimCdmaServiceTable CdmaSvcTable - { - get - { - return CdmaSvc; - } - } - - /// - /// Cdma service. Gives mask value of SimCdmaService enum. - /// - /// - /// This will be filled only if CdmaSvcTable is Cdma. - /// - public byte[] CdmaService - { - get - { - return Cdma; - } - } - - /// - /// Csim service. Gives mask value of SimCsimService enum. - /// - /// - /// This will be filled only if CdmaSvcTable is Csim. - /// - public byte[] CsimService - { - get - { - return Csim; - } - } - } - - /// - /// A class which defines SIM service table. - /// - public class SimServiceTable - { - internal SimCardType Type; - internal byte[] Sst; - internal byte[] Ust; - internal SimCst Cst; - internal SimServiceTable() - { - } - - /// - /// SIM card type. - /// - public SimCardType SimType - { - get - { - return Type; - } - } - - /// - /// SIM service table. Gives mask value of SimSstService enum. - /// - /// - /// This will be filled only if SimType is Gsm. - /// - public byte[] SstService - { - get - { - return Sst; - } - } - - /// - /// USIM service table. Gives mask value of SimUstService enum. - /// - /// - /// This will be filled only if SimType is Usim. - /// - public byte[] UstService - { - get - { - return Ust; - } - } - - /// - /// CSIM service table. - /// - /// - /// This will be filled only if SimType is Ruim. - /// - public SimCst CstService - { - get - { - return Cst; - } - } - } - - /// - /// A class which defines MSISDN information of the GSM/CDMA SIM. - /// - public class SimSubscriberInfo - { - internal string MsisdnNum; - internal string MsisdnName; - internal SimSubscriberInfo() - { - } - - /// - /// MSISDN number. If it does not exist, a null string will be returned - /// - public string Number - { - get - { - return MsisdnNum; - } - } - - /// - /// MSISDN name. If it does not exist, a null string will be returned. Not applicable for CDMA. - /// - public string Name - { - get - { - return MsisdnName; - } - } - } - - /// - /// A class which defines MSISDN list. - /// - public class SimMsisdnList - { - internal int MsisdnCount; - internal IEnumerable SubscriberList; - internal SimMsisdnList() - { - } - - /// - /// Count. - /// - public int Count - { - get - { - return MsisdnCount; - } - } - - /// - /// List of subscriber info. - /// - public IEnumerable List - { - get - { - return SubscriberList; - } - } - } - - /// - /// A class which defines OPLMNwACT data. - /// - public class SimOplmnwact - { - internal string PlmnString; - internal bool UmtsFlag; - internal bool GsmFlag; - internal SimOplmnwact() - { - } - - /// - /// PLMN. - /// - public string Plmn - { - get - { - return PlmnString; - } - } - - /// - /// UMTS or not. - /// - public bool IsUmts - { - get - { - return UmtsFlag; - } - } - - /// - /// GSM or not. - /// - public bool IsGsm - { - get - { - return GsmFlag; - } - } - } - - /// - /// A class which defines OPLMNwACT list. - /// - public class SimOplmnwactList - { - internal int OplmnCount; - internal IEnumerable OplmnList; - internal SimOplmnwactList() - { - } - - /// - /// Count. - /// - public int Count - { - get - { - return OplmnCount; - } - } - - /// - /// List of OPLMNWACT. - /// - public IEnumerable List - { - get - { - return OplmnList; - } - } - } - - /// - /// A class which defines SPN(Service Provider Name). - /// - public class SimSpn - { - internal byte Condition; - internal string SpName; - internal SimSpn() - { - } - - /// - /// Display condition. - /// - public byte DisplayCondition - { - get - { - return Condition; - } - } - - /// - /// Service Provider Name. - /// - public string Spn - { - get - { - return SpName; - } - } - } - - /// - /// A class which defines CPHS network name. - /// - public class SimCphsNetName - { - internal string Full; - internal string Short; - internal SimCphsNetName() - { - } - - /// - /// Full name. - /// - public string FullName - { - get - { - return Full; - } - } - - /// - /// Short name. - /// - public string ShortName - { - get - { - return Short; - } - } - } - - /// - /// A class which defines authentication request data. - /// - public class SimAuthenticationData - { - private SimAuthenticationType _authType; - private int _randLength; - private int _autnLength; - private byte[] _randData; - private byte[] _autnData; - private SimAuthenticationData() - { - } - - /// - /// A constructor to instantiate SimAuthenticationData class with necessary parameters. - /// - /// Authentication type. - /// The length of RAND. - /// The length of AUTN. It is not used in case of GSM AUTH. - /// RAND data. - /// AUTN data. It is not used in case of GSM AUTH. - public SimAuthenticationData(SimAuthenticationType authType, int randLength, int autnLength, byte[] randData, byte[] autnData) - { - _authType = authType; - _randLength = randLength; - _autnLength = autnLength; - _randData = randData; - _autnData = autnData; - } - - internal SimAuthenticationType AuthType - { - get - { - return _authType; - } - } - - internal int RandLength - { - get - { - return _randLength; - } - } - - internal int AutnLength - { - get - { - return _autnLength; - } - } - - internal byte[] RandData - { - get - { - return _randData; - } - } - - internal byte[] AutnData - { - get - { - return _autnData; - } - } - } - - /// - /// A class which defines authentication result data. - /// - public class SimAuthenticationResponse - { - internal SimAuthenticationType Type; - internal SimAuthenticationResult Result; - internal int RespLength; - internal string RespData; - internal int AuthKeyLen; - internal string Key; - internal int CipherLen; - internal string Cipher; - internal int IntegrityLen; - internal string Integrity; - internal SimAuthenticationResponse() - { - } - - /// - /// Authentication type. - /// - public SimAuthenticationType AuthType - { - get - { - return Type; - } - } - - /// - /// Authentication result. - /// - public SimAuthenticationResult AuthResult - { - get - { - return Result; - } - } - - /// - /// Response length. - /// - public int ResponseLength - { - get - { - return RespLength; - } - } - - /// - /// Response data. - /// - public string ResponseData - { - get - { - return RespData; - } - } - - /// - /// The length of the authentication key. - /// - public int AuthKeyLength - { - get - { - return AuthKeyLen; - } - } - - /// - /// The data of the authentication key. - /// - public string AuthKey - { - get - { - return Key; - } - } - - /// - /// The length of the cipher key. - /// - public int CipherLength - { - get - { - return CipherLen; - } - } - - /// - /// Cipher key. - /// - public string CipherData - { - get - { - return Cipher; - } - } - - /// - /// The length of the integrity key. - /// - public int IntegrityLength - { - get - { - return IntegrityLen; - } - } - - /// - /// Integrity key. - /// - public string IntegrityData - { - get - { - return Integrity; - } - } - } - - /// - /// A class which defines information about SIM PIN data. - /// - public class SimPinData - { - private SimPinType _type; - private string _pin; - private uint _pinLength; - private SimPinData() - { - } - - /// - /// A constructor to instantiate SimPinData class which necessary parameters. - /// - /// PIN type. - /// PIN code. - /// PIN code length. - public SimPinData(SimPinType type, string pin, uint pinLength) - { - _type = type; - _pin = pin; - _pinLength = pinLength; - } - - internal SimPinType Type - { - get - { - return _type; - } - } - - internal string Pin - { - get - { - return _pin; - } - } - - internal uint PinLength - { - get - { - return _pinLength; - } - } - } - - /// - /// A class which defines PIN information. - /// - public class SimPinResult - { - internal SimPinType PinType; - internal int Retry; - internal SimPinResult() - { - } - - /// - /// Specifies the PIN or PUK type. - /// - public SimPinType Type - { - get - { - return PinType; - } - } - - /// - /// Number of attempts remaining for PIN/PUK verification. - /// - public int RetryCount - { - get - { - return Retry; - } - } - } - - /// - /// A class which is used to used to enable/disable facility. - /// - public class SimFacility - { - private SimLockType _lockType; - private string _password; - private int _passwordLength; - private SimFacility() - { - } - - /// - /// A constructor to instantiate SimFacility class with necessary parameters. - /// - /// Facility type. - /// Password. - /// Password length. - public SimFacility(SimLockType lockType, string password, int passwordLength) - { - _lockType = lockType; - _password = password; - _passwordLength = passwordLength; - } - - internal SimLockType LockType - { - get - { - return _lockType; - } - } - - internal string Password - { - get - { - return _password; - } - } - - internal int PasswordLength - { - get - { - return _passwordLength; - } - } - } - - /// - /// A class which defines facility result data. - /// - public class SimFacilityResult - { - internal SimLockType LockType; - internal int Count; - internal SimFacilityResult() - { - } - - /// - /// Specifies the PIN or PUK type. - /// - public SimLockType Type - { - get - { - return LockType; - } - } - - /// - /// Number of attempts remaining for PIN/PUK verification. - /// - public int RetryCount - { - get - { - return Count; - } - } - } - - /// - /// A class which defines facility info data. - /// - public class SimFacilityInfo - { - internal SimLockType LockType; - internal SimFacilityStatus FacilityStatus; - internal SimFacilityInfo() - { - } - - /// - /// Lock type. - /// - public SimLockType Type - { - get - { - return LockType; - } - } - - /// - /// Facility status. - /// - public SimFacilityStatus Status - { - get - { - return FacilityStatus; - } - } - } - - /// - /// A class which defines information about lock type. - /// - public class SimLockInfo - { - internal SimLockType LockType; - internal SimLockStatus LockStatus; - internal int Count; - internal SimLockInfo() - { - } - - /// - /// Lock type. - /// - public SimLockType Type - { - get - { - return LockType; - } - } - - /// - /// Lock status. - /// - public SimLockStatus Status - { - get - { - return LockStatus; - } - } - - /// - /// Retry counts. - /// - public int RetryCount - { - get - { - return Count; - } - } - } - - /// - /// A class which defines APDU information. - /// - public class SimApdu - { - private byte[] _apdu; - private SimApdu() - { - } - - /// - /// A constructor to instantiate SimApdu class with necessary parameters. - /// - /// APDU. - public SimApdu(byte[] apdu) - { - _apdu = apdu; - } - - internal byte[] Apdu - { - get - { - return _apdu; - } - } - } - - /// - /// A class which defines the response of sending APDU. - /// - public class SimApduResponse - { - internal ushort ApduLen; - internal byte[] ApduResp; - internal SimApduResponse() - { - } - - /// - /// Length of response APDU. - /// - public ushort ApduLength - { - get - { - return ApduLen; - } - } - - /// - /// Response APDU. - /// - public byte[] ApduResponse - { - get - { - return ApduResp; - } - } - } - - /// - /// A class which defines the response of sending ATR. - /// - public class SimAtrResponse - { - internal ushort AtrRespLen; - internal byte[] AtrResp; - internal SimAtrResponse() - { - } - - /// - /// Length of response ATR. - /// - public ushort AtrRespLength - { - get - { - return AtrRespLen; - } - } - - /// - /// Response ATR. - /// - public byte[] AtrResponse - { - get - { - return AtrResp; - } - } - } - - /// - /// A class which defines ISIM IMPU list data. - /// - public class SimImpuList - { - internal uint DataCount; - internal IEnumerable ImpuList; - internal SimImpuList() - { - } - - /// - /// ISIM IMPU data count. - /// - public uint Count - { - get - { - return DataCount; - } - } - - /// - /// ISIM IMPU list. - /// - public IEnumerable List - { - get - { - return ImpuList; - } - } - } - - /// - /// A class which defines ISIM P-CSCF data. - /// - public class SimPcscf - { - internal SimPcscfType PcscfType; - internal string PcscfData; - internal SimPcscf() - { - } - - /// - /// ISIM P-CSCF type. - /// - public SimPcscfType Type - { - get - { - return PcscfType; - } - } - - /// - /// ISIM P-CSCF data. - /// - public string Pcscf - { - get - { - return PcscfData; - } - } - } - - /// - /// A class which defines ISIM P-CSCF list data. - /// - public class SimPcscfList - { - internal uint DataCount; - internal IEnumerable PcscfList; - internal SimPcscfList() - { - } - - /// - /// ISIM P-CSCF data count. - /// - public uint Count - { - get - { - return DataCount; - } - } - - /// - /// ISIM P-CSCF list. - /// - public IEnumerable List - { - get - { - return PcscfList; - } - } - } -} diff --git a/src/Tizen.Tapi/Tizen.Tapi/SimEnumerations.cs b/src/Tizen.Tapi/Tizen.Tapi/SimEnumerations.cs deleted file mode 100755 index 7c115cd31..000000000 --- a/src/Tizen.Tapi/Tizen.Tapi/SimEnumerations.cs +++ /dev/null @@ -1,1779 +0,0 @@ -/* - * 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. - */ - -namespace Tizen.Tapi -{ - /// - /// Enumeration for the SIM card status. - /// - public enum SimCardStatus - { - /// - /// Bad card / On the fly SIM gone bad. - /// - Error = 0x00, - /// - /// Card not present. - /// - NotPresent = 0x01, - /// - /// SIM is in the Initializing state. - /// - Initializing = 0x02, - /// - /// SIM Initialization ok. - /// - InitCompleted = 0x03, - /// - /// PIN required state. - /// - PinRequired = 0x04, - /// - /// PUK required state. - /// - PukRequired = 0x05, - /// - /// PIN/PUK blocked(permanently blocked- All the attempts for PIN/PUK failed). - /// - Blocked = 0x06, - /// - /// Network Control Key required state. - /// - NckRequired = 0x07, - /// - /// Network Subset Control Key required state. - /// - NsckRequired = 0x08, - /// - /// Service Provider Control Key required state. - /// - SpckRequired = 0x09, - /// - /// Corporate Control Key required state. - /// - CckRequired = 0x0a, - /// - /// Card removed. - /// - Removed = 0x0b, - /// - /// PH-SIM (phone-SIM) locked state. - /// - LockRequired = 0x0c, - /// - /// Runtime SIM card error. - /// - Crashed = 0x0d, - /// - /// SIM card Powered OFF. - /// - PowerOff = 0x0e, - /// - /// Unknown status. It can be the initial status. - /// - Unknown = 0xff - } - - /// - /// Enumeration for the SIM card type. - /// - public enum SimCardType - { - /// - /// Unknown card. - /// - Unknown, - /// - /// SIM(GSM) card. - /// - Gsm, - /// - /// USIM card. - /// - Usim, - /// - /// CDMA card. - /// - Ruim, - /// - /// CDMA NV SIM. - /// - Nvsim, - /// - /// IMS card. - /// - Ims - } - - /// - /// Enumeration for the language preference code. - /// - public enum SimLanguagePreference - { - /// - /// German. - /// - German = 0x00, - /// - /// English. - /// - English = 0x01, - /// - /// Italian. - /// - Italian = 0x02, - /// - /// French. - /// - French = 0x03, - /// - /// Spanish. - /// - Spanish = 0x04, - /// - /// Dutch. - /// - Dutch = 0x05, - /// - /// Swedish. - /// - Swedish = 0x06, - /// - /// Danish. - /// - Danish = 0x07, - /// - /// Portuguese. - /// - Portuguese = 0x08, - /// - /// Finnish. - /// - Finnish = 0x09, - /// - /// Norwegian. - /// - Norwegian = 0x0A, - /// - /// Greek. - /// - Greek = 0x0B, - /// - /// Turkish. - /// - Turkish = 0x0C, - /// - /// Hungarian. - /// - Hungarian = 0x0D, - /// - /// Polish. - /// - Polish = 0x0E, - /// - /// Korean. - /// - Korean = 0x0F, - /// - /// Chinese. - /// - Chinese = 0x10, - /// - /// Russian. - /// - Russian = 0x11, - /// - /// Japanese. - /// - Japanese = 0x12, - /// - /// Unspecified. - /// - Unspecified = 0xFF - } - - /// - /// Enumeration for the security lock type. - /// - public enum SimLockType - { - /// - /// PH-SIM (phone-SIM) locked. Lock Phone to SIM/UICC card. - /// - PS = 0x01, - /// - /// PH-FSIM (phone-first-SIM) Lock Phone to the very first inserted SIM/UICC card. - /// - PF, - /// - /// SIM Lock (PIN, PIN2, PUK, PUK2) Lock SIM/UICC card. - /// - SC, - /// - /// FDN - SIM card or active application in the UICC (GSM or USIM). - /// - FD, - /// - /// Network Personalization. - /// - PN, - /// - /// Network subset Personalization. - /// - PU, - /// - /// Service Provider Personalization. - /// - PP, - /// - /// Corporate Personalization. - /// - PC - } - - /// - /// Enumeration for the power state of the SIM. - /// - public enum SimPowerState - { - /// - /// Off state. - /// - Off = 0x00, - /// - /// On state. - /// - On = 0x01, - /// - /// Unspecified state. - /// - Unspecified = 0xFF - } - /// - /// Enumeration for the file ID. - /// - public enum SimFileId - { - /// - /// Root Directory for the USIM. - /// - Dir = 0x2F00, - /// - /// The ICC Identification file. - /// - IccId = 0x2FE2, - /// - /// The IMSI file. - /// - Imsi = 0x6F07, - /// - /// The SIM Service Table file. - /// - Sst = 0x6F38, - /// - /// The Enabled Service Table file. - /// - Est = 0x6F56, - /// - /// The OPLMN List file. - /// - OplmnAct = 0x6F61, - /// - /// The Group Identifier Level 1. - /// - Gid1 = 0x6F3E, - /// - /// The Group Identifier Level 2. - /// - Gid2 = 0x6F3F, - /// - /// The Extended Language Preference file. - /// - Elp = 0x2F05, - /// - /// SIM: Language preference. - /// - Lp = 0x6F05, - /// - /// The Emergency Call Codes. - /// - Ecc = 0x6FB7, - /// - /// The Service Provider Name. - /// - Spn = 0x6F46, - /// - /// The Service provider display information. - /// - Spdi = 0x6FCD, - /// - /// The PLMN Network Name File. - /// - Pnn = 0x6FC5, - /// - /// The Operator PLMN List File. - /// - Opl = 0x6FC6, - /// - /// MSISDN. - /// - Msisdn = 0x6F40, - /// - /// Short Messages file. - /// - Sms = 0x6F3C, - /// - /// SMS Parameter. - /// - Smsp = 0x6F42, - /// - /// SMS Status. - /// - Smss = 0x6F43, - /// - /// Cell Broadcast Message Identifier. - /// - Cbmi = 0x6F45, - /// - /// SIM Mail Box Dialing Number file. - /// - Mbdn = 0x6FC7, - /// - /// Mailbox Identifier - linear fixed. - /// - UsimMbi = 0x6FC9, - /// - /// Message Waiting Indication Status - linear fixed. - /// - UsimMwis = 0x6FCA, - /// - /// Call forward indication status - linear fixed. - /// - UsimCfis = 0x6FCB, - /// - /// CPHS voice MSG waiting indication. - /// - CphsVoiceMsgWaiting = 0x6F11, - /// - /// CPHS service string table. - /// - CphsServiceStringTable = 0x6F12, - /// - /// CPHS call forward flags. - /// - CphsCallForwardFlags = 0x6F13, - /// - /// CPHS operator name string. - /// - CphsOperatorNameString = 0x6F14, - /// - /// CPHS customer service profile. - /// - CphsCustomerServiceProfile = 0x6F15, - /// - /// CPHS information. - /// - CphsInfo = 0x6F16, - /// - /// CPHS mail box numbers. - /// - CphsMailboxNumbers = 0x6F17, - /// - /// CPHS operator name short form string. - /// - CphsOperatorNameShortFormString = 0x6F18, - /// - /// CPHS information numbers. - /// - CphsInformationNumbers = 0x6F19, - /// - /// CPHS Dynamics flags. - /// - CphsDynamicFlags = 0x6F9F, - /// - /// CPHS Dynamics2 flags. - /// - CphsDynamic2Flag = 0x6F92, - /// - /// CPHS CSP2. - /// - CphsCustomerServiceProfileLine2 = 0x6F98, - /// - /// Invalid file. - /// - Invalid = 0xFFFF, - /// - /// Element to indicate an unknown file. - /// - Others - } - - /// - /// Enumeration for the SIM number type. - /// - public enum SimTypeOfNumber - { - /// - /// Unknown. - /// - Unknown = 0, - /// - /// International number. - /// - International, - /// - /// National number. - /// - National, - /// - /// Network specific number. - /// - NetworkSpecific, - /// - /// Subscriber number. - /// - DedicatedAccess, - /// - /// Alphanumeric, GSM 7-bit default alphabet. - /// - AlphaNumeric, - /// - /// Abbreviated number - /// - AbbreviatedNumber, - /// - /// Reserved for extension. - /// - ReservedForExt - } - - /// - /// Enumeration for the numbering plan identifier. - /// - public enum SimNumberPlanIdentity - { - /// - /// Unknown. - /// - Unknown, - /// - /// ISDN/Telephone numbering plan. - /// - IsdnTelephone, - /// - /// Data numbering plan - /// - Data, - /// - /// Telex numbering plan - /// - Telex, - /// - /// Service Center Specific plan. - /// - ServiceCenterSpecific, - /// - /// Service Center Specific plan 2. - /// - ServiceCenterSpecific2, - /// - /// National numbering plan. - /// - National, - /// - /// Private numbering plan. - /// - Private, - /// - /// ERMES numbering plan. - /// - Ermes, - /// - /// Reserved for extension. - /// - ReservedForExt - } - - /// - /// Enumeration for the emergency service type. - /// - public enum SimEccEmergencyServiceType - { - /// - /// Police. - /// - Police = 0x01, - /// - /// Ambulance. - /// - Ambulance = 0x02, - /// - /// Fire brigade. - /// - FireBrigade = 0x04, - /// - /// Marine guard. - /// - MarineGuard = 0x08, - /// - /// Mountain rescue. - /// - MountainRescue = 0x10, - /// - /// Spare. - /// - Spare = 0x00 - } - - /// - /// Enumeration for the SIM app type. - /// - public enum SimAppType - { - /// - /// SIM application. - /// - Sim = 0x01, - /// - /// USIM application. - /// - Usim = 0x02, - /// - /// CSIM application. - /// - Csim = 0x04, - /// - /// ISIM application. - /// - Isim = 0x08 - } - - /// - /// Enumeration for the SIM access result from the lower layers. - /// - public enum SimAccessResult - { - /// - /// Access to file is successful. - /// - Success, - /// - /// SIM card error. - /// - CardError, - /// - /// File not found. - /// - FileNotFound, - /// - /// Access condition is not fulfilled. - /// - ConditionNotSatisfied, - /// - /// Access failed. - /// - Failed - } - - /// - /// Enumeration for the mailbox type. - /// - public enum SimMailboxType - { - /// - /// Voicemail. - /// - Voice = 0x01, - /// - /// Fax. - /// - Fax = 0x02, - /// - /// Email. - /// - Email = 0x03, - /// - /// Other. - /// - Other = 0x04, - /// - /// Videomail. - /// - Video = 0x05, - /// - /// Data. - /// - Data = 0x06 - } - - /// - /// Enumeration for the current CPHS phase of the SIM card. - /// - public enum SimCphsPhaseType - { - /// - /// Phase 1. - /// - Phase1 = 0x01, - /// - /// Phase 2. - /// - Phase2 = 0x02, - /// - /// RFU. - /// - Rfu = 0xff - } - - /// - /// Enumeration for CDMA service table. - /// - public enum SimCdmaServiceTable - { - /// - /// CDMA service table. - /// - Cdma = 0, - /// - /// CSIM service table. - /// - Csim, - /// - /// MAX value. - /// - Max - } - - /// - /// Enumeration for the SIM Authentication type. - /// - public enum SimAuthenticationType - { - /// - /// IMS Authentication. - /// - Ims = 0x00, - /// - /// GSM Authentication. - /// - Gsm, - /// - /// 3G Authentication. - /// - Auth3G, - /// - /// CDMA CAVE Authentication. - /// - RuimCave, - /// - /// CDMA CHAP Authentication. - /// - RuimChap, - /// - /// CDMA MNHA Authentication. - /// - RuimMnha, - /// - /// CDMA MIPRRQ Authentication. - /// - RuimMiprrq, - /// - /// CDMA MNAAA Authentication. - /// - RuimMnaaa, - /// - /// CDMA HRPD Authentication. - /// - RuimHrpd, - /// - /// MAX value. - /// - Max - } - - /// - /// Enumeration for the SIM Authentication result. - /// - public enum SimAuthenticationResult - { - /// - /// Status - no error. - /// - NoError = 0x00, - /// - /// Status - can't perform authentication. - /// - CannotPerform, - /// - /// Status - skip authentication response. - /// - SkipResponse, - /// - /// Status - MAK(Multiple Activation Key) code failure. - /// - MakCodeFailure, - /// - /// Status - SQN(SeQuenceNumber) failure. - /// - SqnFailure, - /// - /// Status - synch failure. - /// - SynchFailure, - /// - /// Status - unsupported context. - /// - UnsupportedContext, - /// - /// Status - default error. - /// - Error, - /// - /// MAX value. - /// - Max - } - - /// - /// Enumeration for the PIN type. - /// - public enum SimPinType - { - /// - /// PIN 1 code. - /// - Pin1 = 0x00, - /// - /// PIN 2 code. - /// - Pin2 = 0x01, - /// - /// PUK 1 code. - /// - Puk1 = 0x02, - /// - /// PUK 2 code. - /// - Puk2 = 0x03, - /// - /// Universal PIN - Unused now. - /// - Upin = 0x04, - /// - /// Administrator - Unused now. - /// - Adm = 0x05, - /// - /// SIM Lock code. - /// - Sim = 0x06 - } - - /// - /// Enumeration for the PIN status. - /// - public enum SimFacilityStatus - { - /// - /// Facility disabled. - /// - Disabled = 0x00, - /// - /// Facility enabled. - /// - Enabled = 0x01, - /// - /// Facility unknown. - /// - Unknown = 0xFF - } - - /// - /// Enumeration for the security lock key information. - /// - public enum SimLockStatus - { - /// - /// Key not needed. - /// - NotNeeded = 0x00, - /// - /// PIN required. - /// - Pin = 0x01, - /// - /// PUK required. - /// - Puk = 0x02, - /// - /// PIN2 required. - /// - Pin2 = 0x03, - /// - /// PUK2 required. - /// - Puk2 = 0x04, - /// - /// Permanent block SIM. - /// - PermanentBlocked = 0x05 - } - - /// - /// Enumeration for P-CSCF type. - /// - public enum SimPcscfType - { - /// - /// Fully Qualified Domain Name. - /// - Fqdn, - /// - /// IPv4. - /// - IPv4, - /// - /// IPv6. - /// - IPv6 - } - - /// - /// Enumeration for the SIM power set result from the lower layers. - /// - public enum SimPowerSetResult - { - /// - /// Power Set is successful. - /// - Success, - /// - /// Power Set failure. - /// - Failure - } - - /// - /// Enumeration for the list of IST services in the ISIM Service Table (ISIM). - /// - public enum SimIsimService - { - /// - /// P-CSCF address. - /// - PcscfAddr = 0, - /// - /// Generic Bootstrapping Architecture. - /// - Gba, - /// - /// HTTP Digest. - /// - HttpDigest, - /// - /// GBA-based Local Key Establishment Mechanism. - /// - GbaLocalKey, - /// - /// Support of P-CSCF discovery for IMS Local Break Out. - /// - PcscfLocalBreakOut, - /// - /// Short Message Storage. - /// - Sms, - /// - /// Short Message Status Reports. - /// - Smsr, - /// - /// Support for SM-over-IP including data download via SMS-PP as defined in TS 31.111 [31] - /// - SmOverIP, - /// - /// Communication Control for IMS by ISIM. - /// - CommunicationControl = 8, - /// - /// Support of UICC access to IMS. - /// - AccessToIms, - /// - /// URI support by UICC. - /// - UriSupport - } - - /// - /// Enumeration for the list of SST services in the SIM Service Table (GSM). - /// - public enum SimSstService - { - /// - /// CHV1 disable function. - /// - Chv1DisableFunc = 0, - /// - /// Abbreviated Dialing number. - /// - Adn, - /// - /// Fixed Dialing number. - /// - Fdn, - /// - /// Short message storage. - /// - Sms, - /// - /// Advice of charge. - /// - Aoc, - /// - /// Capability configuration parameters. - /// - Ccp, - /// - /// PLMN selector. - /// - PlmnSelector, - /// - /// RFU. - /// - Rfu1, - /// - /// MSISDN. - /// - Msisdn = 8, - /// - /// Extension 1. - /// - Ext1, - /// - /// Extension 2. - /// - Ext2, - /// - /// SMS parameters. - /// - SmsParams, - /// - /// Last number dialed. - /// - Lnd, - /// - /// Cell broadcast message identifier. - /// - CellBroadcastMsgId, - /// - /// Group identifier level 1. - /// - GidLv1, - /// - /// Group identifier level 2. - /// - GidLv2, - /// - /// Service provider name. - /// - Spn = 16, - /// - /// Service Dialing number. - /// - Sdn, - /// - /// Extension3. - /// - Ext3, - /// - /// RFU. - /// - RFu2, - /// - /// VGCS group identifier (EF-VGCS, EF-VGCSS). - /// - VgcsGidList, - /// - /// VBS group identifier (EF-VBS, EF-VBSS). - /// - VbsGidList, - /// - /// Enhanced multi-level precedence and pre-emption service. - /// - EnhancedMultiLvPrecedencePreemptionSrvc, - /// - /// Automatic answer for EMLPP. - /// - AutoAnswerForEmlpp, - /// - /// Data download via SMS-CB. - /// - DataDownloadViaSmsCb = 24, - /// - /// Data download via SMS-PP. - /// - DataDownloadViaSmsPp, - /// - /// Menu selection. - /// - MenuSelection, - /// - /// Call control. - /// - CallCtrl, - /// - /// Proactive SIM command. - /// - ProactiveSim, - /// - /// Cell broadcast message identifier ranges. - /// - CellBroadcastMsgIdRanges, - /// - /// Barred Dialing numbers. - /// - Bdn, - /// - /// Extension 4. - /// - Ext4, - /// - /// De-personalization control keys. - /// - DepersonalizationCtrlKeys = 32, - /// - /// Co-operative network list. - /// - CooperativeNetworkList, - /// - /// Short message status reports. - /// - SmsStatusReports, - /// - /// Network's indication of alerting in the MS (NIA). - /// - Nia, - /// - /// Mobile-originated short message control by SIM. - /// - MoSmsCtrlBySim, - /// - /// GPRS. - /// - Gprs, - /// - /// Image. - /// - Img, - /// - /// Support of local service area. - /// - Solsa, - /// - /// USSD string data object supported in call control. - /// - UssdStrDataObjectSupportedInCallCtrl = 40, - /// - /// Run at COMMAND command. - /// - RunAtCmdCmd, - /// - /// User controlled PLMN selector with Access technology. - /// - UserCtrledPlmnSelectorWact, - /// - /// Operator controlled PLMN selector with Access technology. - /// - OperatorCtrledPlmnSelectorWact, - /// - /// HPLMN selector with access technology. - /// - HplmnSelectorWact, - /// - /// CPBCCH information. - /// - CpbcchInfo, - /// - /// Investigation scan. - /// - InvestigationScan, - /// - /// Extended capability configuration parameters. - /// - ExtendedCapaConfParams, - /// - /// MExE. - /// - Mexe = 48, - /// - /// RPLMN last used access technology. - /// - RplmnLastUsedAccessTech, - /// - /// PLMN Network Name. - /// - PlmnNetworkName, - /// - /// Operator PLMN List. - /// - OperatorPlmnList, - /// - /// Mailbox Dialling Numbers. - /// - Mbdn, - /// - /// Message Waiting Indication Status. - /// - Mwis, - /// - /// Call Forwarding Indication Status. - /// - Cfis, - /// - /// Service Provider Display Information. - /// - Spdi - } - - /// - /// Enumeration for the list of UST services in the SIM Service Table (USIM). - /// - public enum SimUstService - { - /// - /// Local phone book. - /// - LocalPb = 0, - /// - /// Fixed Dialing number. - /// - Fdn, - /// - /// Extension 2. - /// - Ext2, - /// - /// Service Dialing number. - /// - Sdn, - /// - /// Extension 3. - /// - Ext3, - /// - /// Barred Dialing numbers. - /// - Bdn, - /// - /// Extension 4. - /// - Ext4, - /// - /// Outgoing call information. - /// - OutgoingCallInfo, - /// - /// Incoming call information. - /// - IncomingCallInfo = 8, - /// - /// Short message storage. - /// - Sms, - /// - /// Short message status reports. - /// - SmsStatusReports, - /// - /// SMS parameters. - /// - SmsParams, - /// - /// Advice of charge. - /// - Aoc, - /// - /// Capability configuration parameters. - /// - Ccp, - /// - /// Cell broadcast message identifier. - /// - CellBroadcastMsgId, - /// - /// Cell broadcast message identifier ranges. - /// - CellBroadcastMsgIdRanges, - /// - /// Group identifier level 1. - /// - GidLv1 = 16, - /// - /// Group identifier level 2. - /// - GidLv2, - /// - /// Service provider name. - /// - Spn, - /// - /// User controlled PLMN selector with Access technology. - /// - UserCtrledPlmnSelectorWact, - /// - /// MSISDN. - /// - Msisdn, - /// - /// Image. - /// - Img, - /// - /// Support of local service area. - /// - Solsa, - /// - /// Enhanced multi-level precedence and pre-emption service. - /// - EnhancedMultiLvPrecedencePreemptionSrvc, - /// - /// Automatic answer for EMLPP. - /// - AutoAnswerForEmlpp = 24, - /// - /// RFU. - /// - Rfu1, - /// - /// GSM access. - /// - GsmAccess, - /// - /// Data download via SMS-PP. - /// - DataDownloadViaSmsPp, - /// - /// Data download via SMS-CB. - /// - DataDownloadViaSmsCb, - /// - /// Call control by USIM. - /// - CallCtrl, - /// - /// Mobile-originated short message control by USIM. - /// - MoSmsCtrl, - /// - /// Run at COMMAND command. - /// - RunAtCmdCmd, - /// - /// Shall be set to 1. - /// - ShallBeSetToOne = 32, - /// - /// Enabled service table. - /// - EnabledSrvcTable, - /// - /// APN control list. - /// - Acl, - /// - /// De-personalization control keys. - /// - DepersonalizationCtrlKeys, - /// - /// Co-operative network list. - /// - CooperativeNetworkList, - /// - /// GSM security context. - /// - GsmSecContext, - /// - /// CPBCCH information. - /// - CpbcchInfo, - /// - /// Investigation scan. - /// - InvestigationScan, - /// - /// MExE. - /// - Mexe = 40, - /// - /// Operator controlled PLMN selector with Access technology. - /// - OperatorCtrledPlmnSelectorWact, - /// - /// HPLMN selector with access technology. - /// - HplmnSelectorWact, - /// - /// Extension 5. - /// - Ext5, - /// - /// PLMN Network Name. - /// - PlmnNetworkName, - /// - /// Operator PLMN List. - /// - OperatorPlmnList, - /// - /// Mailbox Dialling Numbers. - /// - Mbdn, - /// - /// Message Waiting Indication Status. - /// - Mwis, - /// - /// Call Forwarding Indication Status. - /// - Cfis = 48, - /// - /// RPLMN last used access technology. - /// - RplmnLastUsedAccessTech, - /// - /// Service Provider Display Information. - /// - Spdi, - /// - /// Multi media messaging service. - /// - Mms, - /// - /// Extension 8. - /// - Ext8, - /// - /// Call control on GPRS by USIM. - /// - CallCtrlOnGprs, - /// - /// MMS user connectivity parameters. - /// - MmsUserConnectivityParams, - /// - /// Network's indication of alerting in the MS (NIA). - /// - Nia, - /// - /// VGCS group identifier List (EF-VGCS, EF-VGCSS). - /// - VgcsGidList = 56, - /// - /// VBS group identifier List (EF-VBS, EF-VBSS). - /// - VbsGidList, - /// - /// Pseudonym. - /// - Pseudonym, - /// - /// User controlled PLMN selector for I-WLAN access. - /// - UserCtrledPlmnSelectorIwlan, - /// - /// Operator controlled PLMN selector for I-WLAN access. - /// - OperatorCtrledPlmnSelectorIwlan, - /// - /// User controlled WSID list. - /// - UserCtrledWsidList, - /// - /// Opertor controlled Wsid list. - /// - OperatorCtrledWsidList, - /// - /// VGCS security. - /// - VgcsSec - } - - /// - /// Enumeration for the list of CST services in the CDMA Service Table. - /// - public enum SimCdmaService - { - /// - /// CHV Disable Option. - /// - ChvDisable = 0, - /// - /// Abbreviated Dialing number. - /// - Adn, - /// - /// Fixed Dialing number. - /// - Fdn, - /// - /// Short message storage. - /// - Sms, - /// - /// HRPD. - /// - Hrpd, - /// - /// Enhanced Phone Book. - /// - Epb, - /// - /// Multimedia domain. - /// - Mmd, - /// - /// SF_EUIMID- based EUIMID. - /// - Euimid, - /// - /// MEID. - /// - Meid = 8, - /// - /// Extension 1. - /// - Ext1, - /// - /// Extension 2. - /// - Ext2, - /// - /// SMS parameters. - /// - Smsp, - /// - /// Last number dialled. - /// - Lnd, - /// - /// Service Category Program for BC-SMS. - /// - Scp, - /// - /// RFU. - /// - Rfu1, - /// - /// RFU. - /// - Rfu2, - /// - /// CDMA Home Service Provider Name. - /// - Hspn = 16, - /// - /// Service Dialing number. - /// - Sdn, - /// - /// Extension 3. - /// - Ext3, - /// - /// 3GPD-SIP. - /// - St3GpdSip, - /// - /// RFU. - /// - Rfu3, - /// - /// RFU. - /// - Rfu4, - /// - /// RFU. - /// - Rfu5, - /// - /// RFU. - /// - Rfu6, - /// - /// Data download by SMS broadcast. - /// - Ddsmsb = 24, - /// - /// Data download by SMS PP. - /// - Ddsmspp, - /// - /// Menu Selection. - /// - Menu, - /// - /// Call Control. - /// - Callc, - /// - /// Proactive RUIM. - /// - Proactive, - /// - /// AKA. - /// - Aka, - /// - /// RFU. - /// - Rfu7, - /// - /// RFU. - /// - Rfu8, - /// - /// RFU. - /// - Rfu9 = 32, - /// - /// RFU. - /// - Rfu10, - /// - /// RFU. - /// - Rfu11, - /// - /// RFU. - /// - Rfu12, - /// - /// RFU. - /// - Rfu13, - /// - /// 3GPD- MIP. - /// - St3GpdMip, - /// - /// BCMCS. - /// - Bcmcs, - /// - /// Multimedia messaging service. - /// - Mms, - /// - /// Extension 8. - /// - Ext8 = 40, - /// - /// MMS User Connectivity Parameters. - /// - Mmsucp, - /// - /// Application Authentication. - /// - Aa, - /// - /// Group Identifier Level 1. - /// - Gil1, - /// - /// Group Identifier Level 2. - /// - Gil2, - /// - /// Depersonalisation control keys. - /// - Deperso, - /// - /// Co-operative Network List. - /// - Cnl - } - - /// - /// Enumeration for the list of CST services in the CSIM Service Table (CSIM). - /// - public enum SimCsimService - { - /// - /// Local Phone book. - /// - LocalPhonebook = 0, - /// - /// Fixed Dialing Numbers (FDN). - /// - Fdn, - /// - /// Extension 2. - /// - Ext2, - /// - /// Service Dialing Numbers (SDN). - /// - Sdn, - /// - /// Extension 3. - /// - Ext3, - /// - /// Short Message Storage (SMS). - /// - Sms, - /// - /// Short Message Parameters. - /// - Smsp, - /// - /// HRPD. - /// - Hrpd, - /// - /// Service Category Program for BC-SMS. - /// - Scp = 8, - /// - /// CDMA Home Service Provider Name. - /// - Hspn, - /// - /// Data Download via SMS Broadcast. - /// - DdSmsb, - /// - /// Data Download via SMS-PP. - /// - DdSmsPp, - /// - /// Call Control. - /// - Callc, - /// - /// 3GPD-SIP. - /// - St3GpdSip, - /// - /// 3GPD-MIP. - /// - St3GpdMip, - /// - /// AKA. - /// - Aka, - /// - /// IP-based Location Services (LCS). - /// - IPLcs = 16, - /// - /// BCMCS. - /// - Bcmcs, - /// - /// Multimedia Messaging Service (MMS). - /// - Mms, - /// - /// Extension 8. - /// - Ext8, - /// - /// MMS User Connectivity Parameters. - /// - Mmsucp, - /// - /// Application Authentication. - /// - Aa, - /// - /// Group Identifier Level 1. - /// - Gil1, - /// - /// Group Identifier Level 2. - /// - Gil2, - /// - /// De-Personalization Control Keys. - /// - Deperso = 24, - /// - /// Cooperative Network List. - /// - Cnl, - /// - /// Outgoing Call Information (OCI). - /// - Oci, - /// - /// Incoming Call Information (ICI). - /// - Ici, - /// - /// Extension 5. - /// - Ext5, - /// - /// Multimedia Storage. - /// - MmStorage, - /// - /// Image (EFIMG). - /// - Img, - /// - /// Enabled Services Table. - /// - Est, - /// - /// Capability Configuration Parameters (CCP). - /// - Ccp = 32, - /// - /// SF_EUIMID-based EUIMID. - /// - Euimidl, - /// - /// Messaging and 3GPD Extensions. - /// - St3GpdExt, - /// - /// Root Certificates. - /// - RootCerti, - /// - /// WAP Browser. - /// - Wap, - /// - /// Java. - /// - Java, - /// - /// Reserved for CDG. - /// - RsvdCdg1, - /// - /// Reserved for CDG. - /// - RsvdCdg2, - /// - /// IPv6. - /// - IPv6 = 40 - } -} diff --git a/src/Tizen.Tapi/Tizen.Tapi/SimStructs.cs b/src/Tizen.Tapi/Tizen.Tapi/SimStructs.cs deleted file mode 100755 index 24a38a6f2..000000000 --- a/src/Tizen.Tapi/Tizen.Tapi/SimStructs.cs +++ /dev/null @@ -1,1083 +0,0 @@ -/* - * 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; -using System.Collections.Generic; -using System.Text; - -namespace Tizen.Tapi -{ - [StructLayout(LayoutKind.Sequential)] - internal struct SimImsiInfoStruct - { - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 4)] - internal string Mcc; - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 4)] - internal string Mnc; - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 11)] - internal string Msin; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct SimEccInfoStruct - { - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 31)] - internal string Name; - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 7)] - internal string Number; - internal SimEccEmergencyServiceType Type; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct SimEccInfoListStruct - { - internal int Count; - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 15, ArraySubType = UnmanagedType.LPStruct)] - internal SimEccInfoStruct[] ListInfo; - } - - [StructLayout(LayoutKind.Explicit)] - internal struct CfDataStruct - { - [FieldOffset(0)] - internal SimCfisStruct Cfis; - [FieldOffset(0)] - internal SimCphsCfStruct CphsCf; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct SimCallForwardRequestStruct - { - internal int IsCphs; - internal CfDataStruct CfData; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct SimCfisStruct - { - internal int RecIndex; - internal byte MspNum; - internal byte CfuStatus; - internal SimTypeOfNumber Ton; - internal SimNumberPlanIdentity Npi; - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 21)] - internal string CfuNum; - internal byte Cc2Id; - internal byte Ext7Id; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct SimCfisListStruct - { - internal int ProfileCount; - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 2, ArraySubType = UnmanagedType.LPStruct)] - internal SimCfisStruct[] CfisList; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct SimCphsCfStruct - { - internal int Line1; - internal int Line2; - internal int Fax; - internal int Data; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct SimCallForwardResponseStruct - { - internal int IsCphs; - internal SimCfisListStruct CfList; - internal SimCphsCfStruct CphsCf; - } - - [StructLayout(LayoutKind.Explicit)] - internal struct MwData - { - [FieldOffset(0)] - internal SimMwisStruct Mwis; - [FieldOffset(0)] - internal SimCphsMwStruct CphsMw; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct SimMessageWaitingRequestStruct - { - internal int IsCphs; - internal MwData Mw; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct SimMwisStruct - { - internal int RecIndex; - internal byte IndicatorStatus; - internal int VoiceCount; - internal int FaxCount; - internal int EmailCount; - internal int OtherCount; - internal int VideoCount; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct SimMwisListStruct - { - internal int ProfileCount; - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 2, ArraySubType = UnmanagedType.LPStruct)] - internal SimMwisStruct[] MwList; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct SimCphsMwStruct - { - internal int Voice1; - internal int Voice2; - internal int Fax; - internal int Data; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct SimMessageWaitingResponseStruct - { - internal int IsCphs; - internal SimMwisListStruct MwList; - internal SimCphsMwStruct CphsMw; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct SimMailboxNumberStruct - { - internal int IsCphs; - internal int RecIndex; - internal int ProfileNum; - internal SimMailboxType MbType; - internal int AlphaMaxLen; - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 31)] - internal string AlphaId; - internal SimTypeOfNumber Ton; - internal SimNumberPlanIdentity Npi; - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 21)] - internal string Number; - internal byte CcId; - internal byte Ext1Id; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct SimMailboxListStruct - { - internal int Count; - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 10, ArraySubType = UnmanagedType.LPStruct)] - internal SimMailboxNumberStruct[] List; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct SimAuthenticationDataStruct - { - internal SimAuthenticationType AuthType; - internal int RandLength; - internal int AutnLength; - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] - internal string RandData; - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] - internal string AutnData; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct SimAuthenticationResponseStruct - { - internal SimAuthenticationType AuthType; - internal SimAuthenticationResult AuthResult; - internal int RespLength; - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)] - internal string RespData; - internal int AuthKeyLength; - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)] - internal string AuthKey; - internal int CipherLength; - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)] - internal string CipherData; - internal int IntegrityLength; - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 128)] - internal string IntegrityData; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct SimPinDataStruct - { - internal SimPinType Type; - [MarshalAs(UnmanagedType.LPStr)] - internal string Pin; - internal uint PinLength; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct SimFacilityStruct - { - internal SimLockType LockType; - [MarshalAs(UnmanagedType.LPStr)] - internal string Password; - internal int PasswordLength; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct SimFacilityResultStruct - { - internal SimLockType Type; - internal int RetryCount; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct SimFacilityInfoStruct - { - internal SimLockType Type; - internal SimFacilityStatus Status; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct SimApduStruct - { - internal ushort ApduLen; - [MarshalAs(UnmanagedType.LPStr)] - internal string Apdu; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct SimApduResponseStruct - { - internal ushort RespLen; - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 5120)] - internal byte[] ApduResp; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct SimIccIdInfoStruct - { - internal int IccLength; - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 20)] - internal string IccNumber; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct SimCphsServiceTableStruct - { - internal int CustomerServiceProfile; - internal int ServiceStringTable; - internal int MailboxNumbers; - internal int OperatorNameShortForm; - internal int InformationNumbers; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct SimCphsInfoStruct - { - internal SimCphsPhaseType CphsPhase; - internal SimCphsServiceTableStruct CphsServiceTable; - } - - [StructLayout(LayoutKind.Explicit)] - internal struct CstServiceStrct - { - [FieldOffset(0)] - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 47)] - internal string CdmaService; - [FieldOffset(0)] - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 41)] - internal string CsimService; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct SimCstStrct - { - internal SimCdmaServiceTable CdmaSvcTable; - internal CstServiceStrct Cst; - } - - [StructLayout(LayoutKind.Explicit)] - internal struct ServiceTable - { - [FieldOffset(0)] - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 56)] - internal string SimSstService; - [FieldOffset(0)] - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 64)] - internal string SimUstService; - [FieldOffset(0)] - internal SimCstStrct Cst; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct SimServiceTableStruct - { - internal SimCardType SimType; - internal ServiceTable Table; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct SimSubscriberInfoStruct - { - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 27)] - internal string Number; - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 31)] - internal string Name; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct SimMsisdnListStruct - { - internal int Count; - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 3, ArraySubType = UnmanagedType.LPStruct)] - internal SimSubscriberInfoStruct[] List; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct SimOplmnwactStruct - { - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 7)] - internal string Plmn; - internal int IsUmts; - internal int IsGsm; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct SimOplmnwactListStruct - { - internal int Count; - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 100, ArraySubType = UnmanagedType.LPStruct)] - internal SimOplmnwactStruct[] List; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct SimSpnStruct - { - internal byte DisplayCondition; - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 41)] - internal string Spn; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct SimCphsNetNameStruct - { - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 41)] - internal string FullName; - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 11)] - internal string ShortName; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct SimPinResultStruct - { - internal SimPinType Type; - internal int RetryCount; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct SimLockInfoStruct - { - internal SimLockType Type; - internal SimLockStatus Status; - internal int RetryCount; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct SimAtrResponseStruct - { - internal ushort AtrRespLen; - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 5120)] - internal byte[] AtrResp; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct SimImpuListStruct - { - internal uint Count; - internal IntPtr List; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct SimPcscfStruct - { - internal SimPcscfType Type; - [MarshalAs(UnmanagedType.LPStr)] - internal string Pcscf; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct SimPcscfListStruct - { - internal uint Count; - internal IntPtr List; - } - - internal static class SimStructConversions - { - internal static SimImsiInfo ConvertSimImsiInfoStruct(SimImsiInfoStruct imsiStruct) - { - SimImsiInfo imsi = new SimImsiInfo(); - imsi.CountryCode = imsiStruct.Mcc; - imsi.NetworkCode = imsiStruct.Mnc; - imsi.StationId = imsiStruct.Msin; - return imsi; - } - - internal static SimEccInfo ConvertSimEccInfoStruct(SimEccInfoStruct eccStruct) - { - SimEccInfo ecc = new SimEccInfo(); - ecc.NameInfo = eccStruct.Name; - ecc.NumberInfo = eccStruct.Number; - ecc.TypeInfo = eccStruct.Type; - return ecc; - } - - internal static SimEccInfoList ConvertSimEccInfoListStruct(SimEccInfoListStruct listStruct) - { - SimEccInfoList eccList = new SimEccInfoList(); - eccList.EccCount = listStruct.Count; - List eccInfoList = new List(); - foreach (SimEccInfoStruct info in listStruct.ListInfo) - { - eccInfoList.Add(ConvertSimEccInfoStruct(info)); - } - - eccList.List = eccInfoList; - return eccList; - } - - internal static SimIccIdInfo ConvertSimIccIdInfoStruct(SimIccIdInfoStruct iccStruct) - { - SimIccIdInfo iccId = new SimIccIdInfo(); - iccId.Length = iccStruct.IccLength; - iccId.Number = iccStruct.IccNumber; - return iccId; - } - - internal static SimCfis ConvertSimCfisStruct(SimCfisStruct cfisStruct) - { - SimCfis cfis = new SimCfis(); - cfis.RecIndex = cfisStruct.RecIndex; - cfis.MspNum = cfisStruct.MspNum; - cfis.CfuStatus = cfisStruct.CfuStatus; - cfis.Ton = cfisStruct.Ton; - cfis.Npi = cfisStruct.Npi; - cfis.CfuNum = cfisStruct.CfuNum; - cfis.Cc2Id = cfisStruct.Cc2Id; - cfis.Ext7Id = cfisStruct.Ext7Id; - return cfis; - } - - internal static SimCfisList ConvertSimCfisListStruct(SimCfisListStruct listStruct) - { - SimCfisList cfisList = new SimCfisList(); - cfisList.Count = listStruct.ProfileCount; - List cfis = new List(); - foreach (SimCfisStruct cfStruct in listStruct.CfisList) - { - cfis.Add(ConvertSimCfisStruct(cfStruct)); - } - - cfisList.List = cfis; - return cfisList; - } - - internal static SimCphsCf ConvertSimCphsCfStruct(SimCphsCfStruct cphsCfStruct) - { - SimCphsCf cphs = new SimCphsCf(); - cphs.Line1 = cphsCfStruct.Line1; - cphs.Line2 = cphsCfStruct.Line2; - cphs.Fax = cphsCfStruct.Fax; - cphs.Data = cphsCfStruct.Data; - return cphs; - } - - internal static SimCallForwardResponse ConvertSimCallForwardResponseStruct(SimCallForwardResponseStruct respStruct) - { - SimCallForwardResponse resp = new SimCallForwardResponse(); - if (respStruct.IsCphs == 1) - { - resp.IsCphsCf = true; - } - - else if (respStruct.IsCphs == 0) - { - resp.IsCphsCf = false; - } - - resp.List = ConvertSimCfisListStruct(respStruct.CfList); - resp.CphsCfInfo = ConvertSimCphsCfStruct(respStruct.CphsCf); - return resp; - } - - internal static SimMwis ConvertSimMwisStruct(SimMwisStruct mwisStruct) - { - SimMwis mwis = new SimMwis(); - mwis.RecIndex = mwisStruct.RecIndex; - mwis.IndicatorStatus = mwisStruct.IndicatorStatus; - mwis.VoiceCount = mwisStruct.VoiceCount; - mwis.FaxCount = mwisStruct.FaxCount; - mwis.EmailCount = mwisStruct.EmailCount; - mwis.OtherCount = mwisStruct.OtherCount; - mwis.VideoCount = mwisStruct.VideoCount; - return mwis; - } - - internal static SimMwisList ConvertSimMwisListStruct(SimMwisListStruct mwStruct) - { - SimMwisList mwList = new SimMwisList(); - mwList.Count = mwStruct.ProfileCount; - List mwisList = new List(); - foreach (SimMwisStruct mwisStruct in mwStruct.MwList) - { - mwisList.Add(ConvertSimMwisStruct(mwisStruct)); - } - - mwList.List = mwisList; - return mwList; - } - - internal static SimCphsMw ConvertSimCphsMwStruct(SimCphsMwStruct cphsStruct) - { - SimCphsMw cphsMw = new SimCphsMw(); - if (cphsStruct.Voice1 == 1) - { - cphsMw.IsVoice1 = true; - } - - else - { - cphsMw.IsVoice1 = false; - } - - if (cphsStruct.Voice2 == 1) - { - cphsMw.IsVoice2 = true; - } - - else - { - cphsMw.IsVoice2 = false; - } - - if (cphsStruct.Fax == 1) - { - cphsMw.IsFax = true; - } - - else - { - cphsMw.IsFax = false; - } - - if (cphsStruct.Data == 1) - { - cphsMw.IsData = true; - } - - else - { - cphsMw.IsData = false; - } - - return cphsMw; - } - - internal static SimMessageWaitingResponse ConvertSimMessageWaitingRespStruct(SimMessageWaitingResponseStruct responseStruct) - { - SimMessageWaitingResponse waitingResp = new SimMessageWaitingResponse(); - if (responseStruct.IsCphs == 1) - { - waitingResp.IsCphsMw = true; - } - - else - { - waitingResp.IsCphsMw = false; - } - - waitingResp.List = ConvertSimMwisListStruct(responseStruct.MwList); - waitingResp.CphsMwInfo = ConvertSimCphsMwStruct(responseStruct.CphsMw); - return waitingResp; - } - - internal static SimMailboxNumber ConvertSimMailboxNumberStruct(SimMailboxNumberStruct mbStruct) - { - SimMailboxNumber mbNumber = new SimMailboxNumber(); - if (mbStruct.IsCphs == 1) - { - mbNumber.IsCphs = true; - } - - else if (mbStruct.IsCphs == 0) - { - mbNumber.IsCphs = false; - } - - mbNumber.RecIndex = mbStruct.RecIndex; - mbNumber.ProfileNumber = mbStruct.ProfileNum; - mbNumber.MbType = mbStruct.MbType; - mbNumber.AlphaMaxLength = mbStruct.AlphaMaxLen; - mbNumber.AlphaId = mbStruct.AlphaId; - mbNumber.Ton = mbStruct.Ton; - mbNumber.Npi = mbStruct.Npi; - mbNumber.Number = mbStruct.Number; - mbNumber.CcId = mbStruct.CcId; - mbNumber.Ext1Id = mbStruct.Ext1Id; - return mbNumber; - } - - internal static SimMailboxList ConvertSimMailboxListStruct(SimMailboxListStruct mbListStruct) - { - SimMailboxList mbList = new SimMailboxList(); - mbList.MbCount = mbListStruct.Count; - List mbNumList = new List(); - foreach (SimMailboxNumberStruct mbStruct in mbListStruct.List) - { - mbNumList.Add(ConvertSimMailboxNumberStruct(mbStruct)); - } - - mbList.MbList = mbNumList; - return mbList; - } - - internal static SimCphsServiceTable ConvertSimCphsServiceTableStruct(SimCphsServiceTableStruct svcStruct) - { - SimCphsServiceTable svcTable = new SimCphsServiceTable(); - svcTable.CustomerSvcProfile = svcStruct.CustomerServiceProfile; - svcTable.SvcStringTable = svcStruct.ServiceStringTable; - svcTable.MbNumbers = svcStruct.MailboxNumbers; - svcTable.OperatorNameShort = svcStruct.OperatorNameShortForm; - svcTable.InformationNum = svcStruct.InformationNumbers; - return svcTable; - } - - internal static SimCphsInfo ConvertSimCphsInfoStruct(SimCphsInfoStruct cphsStruct) - { - SimCphsInfo cphsInfo = new SimCphsInfo(); - cphsInfo.Phase = cphsStruct.CphsPhase; - cphsInfo.CphsSvcTable = ConvertSimCphsServiceTableStruct(cphsStruct.CphsServiceTable); - return cphsInfo; - } - - internal static SimCst ConvertSimCstStruct(SimCstStrct cstStruct) - { - SimCst cst = new SimCst(); - cst.CdmaSvc = cstStruct.CdmaSvcTable; - if (cstStruct.CdmaSvcTable == SimCdmaServiceTable.Cdma) - { - cst.Cdma = Encoding.ASCII.GetBytes(cstStruct.Cst.CdmaService); - } - - else if (cstStruct.CdmaSvcTable == SimCdmaServiceTable.Csim) - { - cst.Csim = Encoding.ASCII.GetBytes(cstStruct.Cst.CsimService); - } - - return cst; - } - - internal static SimServiceTable ConvertSimServiceTableStruct(SimServiceTableStruct svcTableStruct) - { - SimServiceTable svcTable = new SimServiceTable(); - svcTable.Type = svcTableStruct.SimType; - if (svcTableStruct.SimType == SimCardType.Gsm) - { - svcTable.Sst = Encoding.ASCII.GetBytes(svcTableStruct.Table.SimSstService); - } - - else if (svcTableStruct.SimType == SimCardType.Usim) - { - svcTable.Ust = Encoding.ASCII.GetBytes(svcTableStruct.Table.SimUstService); - } - - else if (svcTableStruct.SimType == SimCardType.Ruim) - { - svcTable.Cst = ConvertSimCstStruct(svcTableStruct.Table.Cst); - } - - return svcTable; - } - - internal static SimSubscriberInfo ConvertSimSubscriberInfoStruct(SimSubscriberInfoStruct infoStruct) - { - SimSubscriberInfo subscriber = new SimSubscriberInfo(); - subscriber.MsisdnNum = infoStruct.Number; - subscriber.MsisdnName = infoStruct.Name; - return subscriber; - } - - internal static SimMsisdnList ConvertSimMsisdnListStruct(SimMsisdnListStruct msisdnStruct) - { - SimMsisdnList list = new SimMsisdnList(); - list.MsisdnCount = msisdnStruct.Count; - List subsList = new List(); - foreach (SimSubscriberInfoStruct subsStruct in msisdnStruct.List) - { - subsList.Add(ConvertSimSubscriberInfoStruct(subsStruct)); - } - - list.SubscriberList = subsList; - return list; - } - - internal static SimOplmnwact ConvertSimOplmnwactStruct(SimOplmnwactStruct oplmnStruct) - { - SimOplmnwact oplmn = new SimOplmnwact(); - oplmn.PlmnString = oplmnStruct.Plmn; - if (oplmnStruct.IsUmts == 1) - { - oplmn.UmtsFlag = true; - } - - else if (oplmnStruct.IsUmts == 0) - { - oplmn.UmtsFlag = false; - } - - if (oplmnStruct.IsGsm == 1) - { - oplmn.GsmFlag = true; - } - - else if (oplmnStruct.IsGsm == 0) - { - oplmn.GsmFlag = false; - } - - return oplmn; - } - - internal static SimOplmnwactList ConvertSimOplmnwactListStruct(SimOplmnwactListStruct listStruct) - { - SimOplmnwactList oplmnList = new SimOplmnwactList(); - oplmnList.OplmnCount = listStruct.Count; - List wactList = new List(); - foreach (SimOplmnwactStruct wactStruct in listStruct.List) - { - wactList.Add(ConvertSimOplmnwactStruct(wactStruct)); - } - - oplmnList.OplmnList = wactList; - return oplmnList; - } - - internal static SimSpn ConvertSimSpnStruct(SimSpnStruct spnStruct) - { - SimSpn spn = new SimSpn(); - spn.Condition = spnStruct.DisplayCondition; - spn.SpName = spnStruct.Spn; - return spn; - } - - internal static SimCphsNetName ConvertSimCphsNetNameStruct(SimCphsNetNameStruct cphsStruct) - { - SimCphsNetName cphsName = new SimCphsNetName(); - cphsName.Full = cphsStruct.FullName; - cphsName.Short = cphsStruct.ShortName; - return cphsName; - } - - internal static SimAuthenticationResponse ConvertSimAuthenticationResponseStruct(SimAuthenticationResponseStruct respStruct) - { - SimAuthenticationResponse response = new SimAuthenticationResponse(); - response.Type = respStruct.AuthType; - response.Result = respStruct.AuthResult; - response.RespLength = respStruct.RespLength; - response.RespData = respStruct.RespData; - response.AuthKeyLen = respStruct.AuthKeyLength; - response.Key = respStruct.AuthKey; - response.CipherLen = respStruct.CipherLength; - response.Cipher = respStruct.CipherData; - response.IntegrityLen = respStruct.IntegrityLength; - response.Integrity = respStruct.IntegrityData; - return response; - } - - internal static SimPinResult ConvertSimPinResultStruct(SimPinResultStruct resultStruct) - { - SimPinResult pinResult = new SimPinResult(); - pinResult.PinType = resultStruct.Type; - pinResult.Retry = resultStruct.RetryCount; - return pinResult; - } - - internal static SimFacilityResult ConvertSimFacilityResultStruct(SimFacilityResultStruct resultStruct) - { - SimFacilityResult facilityResult = new SimFacilityResult(); - facilityResult.LockType = resultStruct.Type; - facilityResult.Count = resultStruct.RetryCount; - return facilityResult; - } - - internal static SimFacilityInfo ConvertSimFacilityInfoStruct(SimFacilityInfoStruct infoStruct) - { - SimFacilityInfo facilityInfo = new SimFacilityInfo(); - facilityInfo.LockType = infoStruct.Type; - facilityInfo.FacilityStatus = infoStruct.Status; - return facilityInfo; - } - - internal static SimLockInfo ConvertSimLockInfoStruct(SimLockInfoStruct infoStruct) - { - SimLockInfo lockInfo = new SimLockInfo(); - lockInfo.LockType = infoStruct.Type; - lockInfo.LockStatus = infoStruct.Status; - lockInfo.Count = infoStruct.RetryCount; - return lockInfo; - } - - internal static SimApduResponse ConvertSimApduResponseStruct(SimApduResponseStruct respStruct) - { - SimApduResponse response = new SimApduResponse(); - response.ApduLen = respStruct.RespLen; - response.ApduResp = respStruct.ApduResp; - return response; - } - - internal static SimAtrResponse ConvertSimAtrResponseStruct(SimAtrResponseStruct respStruct) - { - SimAtrResponse atrResp = new SimAtrResponse(); - atrResp.AtrRespLen = respStruct.AtrRespLen; - atrResp.AtrResp = respStruct.AtrResp; - return atrResp; - } - - internal static SimImpuList ConvertSimImpuListStruct(SimImpuListStruct listStruct) - { - SimImpuList impuList = new SimImpuList(); - impuList.DataCount = listStruct.Count; - IntPtr[] ptrList = new IntPtr[listStruct.Count]; - Marshal.Copy(listStruct.List, ptrList, 0, (int)listStruct.Count); - List list = new List(); - for (int i = 0; i < listStruct.Count; i++) - { - list.Add(Marshal.PtrToStringAnsi(ptrList[i])); - } - - impuList.ImpuList = list; - return impuList; - } - - internal static SimPcscf ConvertSimPcscfStruct(SimPcscfStruct pcscfStruct) - { - SimPcscf pcscf = new SimPcscf(); - pcscf.PcscfType = pcscfStruct.Type; - pcscf.PcscfData = pcscfStruct.Pcscf; - return pcscf; - } - - internal static SimPcscfList ConvertSimPcscfListStruct(SimPcscfListStruct listStruct) - { - SimPcscfList pcscfList = new SimPcscfList(); - pcscfList.DataCount = listStruct.Count; - IntPtr[] ptrList = new IntPtr[listStruct.Count]; - Marshal.Copy(listStruct.List, ptrList, 0, (int)listStruct.Count); - List list = new List(); - for (int i = 0; i < listStruct.Count; i++) - { - list.Add(ConvertSimPcscfStruct(Marshal.PtrToStructure(ptrList[i]))); - } - - pcscfList.PcscfList = list; - return pcscfList; - } - } - - internal static class SimClassConversions - { - internal static SimCallForwardRequestStruct ConvertSimCallForwardRequest(SimCallForwardRequest request) - { - SimCallForwardRequestStruct cfStruct = new SimCallForwardRequestStruct(); - if (request.IsCphs == true) - { - cfStruct.IsCphs = 1; - } - - else if (request.IsCphs == false) - { - cfStruct.IsCphs = 0; - } - - if (request.IsCphs == true) - { - cfStruct.CfData.CphsCf.Line1 = request.CphsCf.Line1; - cfStruct.CfData.CphsCf.Line2 = request.CphsCf.Line2; - cfStruct.CfData.CphsCf.Fax = request.CphsCf.Fax; - cfStruct.CfData.CphsCf.Data = request.CphsCf.Data; - } - - else - { - cfStruct.CfData.Cfis.RecIndex = request.Cfis.RecIndex; - cfStruct.CfData.Cfis.MspNum = request.Cfis.MspNum; - cfStruct.CfData.Cfis.CfuStatus = request.Cfis.CfuStatus; - cfStruct.CfData.Cfis.Ton = request.Cfis.Ton; - cfStruct.CfData.Cfis.Npi = request.Cfis.Npi; - cfStruct.CfData.Cfis.CfuNum = request.Cfis.CfuNum; - cfStruct.CfData.Cfis.Cc2Id = request.Cfis.Cc2Id; - cfStruct.CfData.Cfis.Ext7Id = request.Cfis.Ext7Id; - } - - return cfStruct; - } - - internal static SimMwisStruct ConvertSimMwis(SimMwis mwis) - { - SimMwisStruct mwisStruct = new SimMwisStruct(); - mwisStruct.RecIndex = mwis.RecIndex; - mwisStruct.IndicatorStatus = mwis.IndicatorStatus; - mwisStruct.VoiceCount = mwis.VoiceCount; - mwisStruct.FaxCount = mwis.FaxCount; - mwisStruct.EmailCount = mwis.EmailCount; - mwisStruct.OtherCount = mwis.OtherCount; - mwisStruct.VideoCount = mwis.VideoCount; - return mwisStruct; - } - - internal static SimCphsMwStruct ConvertSimCphsMw(SimCphsMw cphsMw) - { - SimCphsMwStruct cphsStruct = new SimCphsMwStruct(); - if (cphsMw.IsVoice1 == true) - { - cphsStruct.Voice1 = 1; - } - - else - { - cphsStruct.Voice1 = 0; - } - - if (cphsMw.IsVoice2 == true) - { - cphsStruct.Voice2 = 1; - } - - else - { - cphsStruct.Voice2 = 0; - } - - if (cphsMw.IsFax == true) - { - cphsStruct.Fax = 1; - } - - else - { - cphsStruct.Fax = 0; - } - - if (cphsMw.IsData == true) - { - cphsStruct.Data = 1; - } - - else - { - cphsStruct.Data = 0; - } - - return cphsStruct; - } - - internal static SimMessageWaitingRequestStruct ConvertSimMessageWaitingRequest(SimMessageWaitingRequest request) - { - SimMessageWaitingRequestStruct requestStruct = new SimMessageWaitingRequestStruct(); - if (request.IsCphs == true) - { - requestStruct.IsCphs = 1; - } - - else - { - requestStruct.IsCphs = 0; - } - - if (request.IsCphs == true) - { - requestStruct.Mw.CphsMw = ConvertSimCphsMw(request.CphsMw); - } - - else - { - requestStruct.Mw.Mwis = ConvertSimMwis(request.Mwis); - } - - return requestStruct; - } - - internal static SimMailboxNumberStruct ConvertSimMailboxNumber(SimMailboxNumber mbNumber) - { - SimMailboxNumberStruct mbStruct = new SimMailboxNumberStruct(); - if (mbNumber.IsCphs) - { - mbStruct.IsCphs = 1; - } - - else - { - mbStruct.IsCphs = 0; - } - - mbStruct.RecIndex = mbNumber.RecIndex; - mbStruct.ProfileNum = mbNumber.ProfileNumber; - mbStruct.MbType = mbNumber.MbType; - mbStruct.AlphaMaxLen = mbNumber.AlphaMaxLength; - mbStruct.AlphaId = mbNumber.AlphaId; - mbStruct.Ton = mbNumber.Ton; - mbStruct.Npi = mbNumber.Npi; - mbStruct.Number = mbNumber.Number; - mbStruct.CcId = mbNumber.CcId; - mbStruct.Ext1Id = mbNumber.Ext1Id; - return mbStruct; - } - - internal static SimPinDataStruct ConvertSimPinData(SimPinData data) - { - SimPinDataStruct pinStruct = new SimPinDataStruct(); - pinStruct.Type = data.Type; - pinStruct.Pin = data.Pin; - pinStruct.PinLength = data.PinLength; - return pinStruct; - } - - internal static SimFacilityStruct ConvertSimFacility(SimFacility facility) - { - SimFacilityStruct facilityStruct = new SimFacilityStruct(); - facilityStruct.LockType = facility.LockType; - facilityStruct.Password = facility.Password; - facilityStruct.PasswordLength = facility.PasswordLength; - return facilityStruct; - } - - internal static SimApduStruct ConvertSimApdu(SimApdu apdu) - { - SimApduStruct apduStruct = new SimApduStruct(); - apduStruct.ApduLen = (ushort)apdu.Apdu.Length; - apduStruct.Apdu = Encoding.UTF8.GetString(apdu.Apdu); - return apduStruct; - } - - internal static SimAuthenticationDataStruct ConvertSimAuthenticationDataStruct(SimAuthenticationData authData) - { - SimAuthenticationDataStruct authStruct = new SimAuthenticationDataStruct(); - authStruct.AuthType = authData.AuthType; - authStruct.RandLength = authData.RandLength; - authStruct.AutnLength = authData.AutnLength; - authStruct.RandData = Encoding.UTF8.GetString(authData.RandData); - authStruct.AutnData = Encoding.UTF8.GetString(authData.AutnData); - return authStruct; - } - } -} diff --git a/src/Tizen.Tapi/Tizen.Tapi/SmsData.cs b/src/Tizen.Tapi/Tizen.Tapi/SmsData.cs deleted file mode 100755 index f17e09d0f..000000000 --- a/src/Tizen.Tapi/Tizen.Tapi/SmsData.cs +++ /dev/null @@ -1,184 +0,0 @@ -/* - * 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.Text; -using System.Collections.Generic; - -namespace Tizen.Tapi -{ - /// - /// A class which defines incoming SMS message notification data. - /// - public class SmsIncomingMessageNoti - { - internal string ScaVal; - internal int MsgLength; - internal string Data; - internal SmsNetType FormatType; - - internal SmsIncomingMessageNoti() - { - } - - /// - /// SCA. - /// - /// Sca value represented in string. - public string Sca - { - get - { - return ScaVal; - } - } - - /// - /// Message length. - /// - /// Length of incoming message. - public int MessageLength - { - get - { - return MsgLength; - } - } - - /// - /// Data. - /// - /// Data representing incoming message information. - public string SzData - { - get - { - return Data; - } - } - - /// - /// SMS format. - /// - /// Format of the incoming SMS. - public SmsNetType Format - { - get - { - return FormatType; - } - } - } - - /// - /// A class which defines incoming CB message notification data. - /// - public class SmsIncomingCbMessageNoti - { - internal SmsCbMsgType CbType; - internal short Len; - internal string Data; - - internal SmsIncomingCbMessageNoti() - { - } - - /// - /// Cell Broadcast message type. - /// - /// Type of cell broadcast message. - public SmsCbMsgType Type - { - get - { - return CbType; - } - } - - /// - /// Size of MsgData (which is the actual TPDU message). - /// - /// Length of message data. - public short Length - { - get - { - return Len; - } - } - - /// - /// Cell broadcast message data. - /// - /// Message data representing cell broadcast message. - public string SzMsgData - { - get - { - return Data; - } - } - } - - /// - /// A class which defines incoming ETWS message notification data. - /// - public class SmsIncomingEtwsMessageNoti - { - internal SmsEtwsMsgType EtwsType; - internal short Len; - internal string Data; - - internal SmsIncomingEtwsMessageNoti() - { - } - - /// - /// ETWS message type. - /// - /// Type of ETWS message. - public SmsEtwsMsgType Type - { - get - { - return EtwsType; - } - } - - /// - /// Size of MsgData (which is the actual TPDU message). - /// - /// Length of message data. - public short Length - { - get - { - return Len; - } - } - - /// - /// ETWS message data. - /// - /// Message data representing ETWS message. - public string SzMsgData - { - get - { - return Data; - } - } - } -} diff --git a/src/Tizen.Tapi/Tizen.Tapi/SmsEnumerations.cs b/src/Tizen.Tapi/Tizen.Tapi/SmsEnumerations.cs deleted file mode 100755 index d79e30f5d..000000000 --- a/src/Tizen.Tapi/Tizen.Tapi/SmsEnumerations.cs +++ /dev/null @@ -1,323 +0,0 @@ -/* - * 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. - */ - -namespace Tizen.Tapi -{ - /// - /// Enumeration for the type of sms network. - /// - public enum SmsNetType - { - /// - /// Network type is 3gpp. - /// - Net3GPP = 0x01, - /// - /// Network type is 3gpp2 (CDMA). - /// - Net3GPP2 = 0x02 - } - - /// - /// Enumeration for different CB message types. - /// - public enum SmsCbMsgType - { - /// - /// GSM Cell broadcast message. - /// - Gsm = 1, - /// - /// UMTSCell broadcast message. - /// - Umts, - /// - /// CDMA broadcast message. - /// - Cdma - } - - /// - /// Enumeration for different ETWS message types. - /// - public enum SmsEtwsMsgType - { - /// - /// Primary ETWS message. - /// - Primary = 0, - /// - /// GSM Secondary ETWS message. - /// - SecondaryGsm, - /// - /// UMTS Secondary ETWS message. - /// - SecondaryUmts, - /// - /// CDMA Seconday ETWS message. - /// - SecondaryCdma - } - - /// - /// Enumeration for memory status type. - /// - public enum SmsMemoryStatus - { - /// - /// PDA memory is available. - /// - PdaAvailable = 0x01, - /// - /// PDA memory is full. - /// - PdaFull = 0x02, - /// - /// Phone memory is available. - /// - PhoneAvailable = 0x03, - /// - /// Phone memory is full. - /// - PhoneFull = 0x04 - } - - /// - /// Enumeration for the sms ready status type. - /// - public enum SmsReadyStatus - { - /// - /// Non Ready Status. - /// - StatusNone = 0x00, - /// - /// SMS 3GPP Ready. - /// - Status3GPP = 0x01, - /// - /// SMS 3GPP2 Ready. - /// - Status3GPP2 = 0x02, - /// - /// SMS 3GPP and 3GPP2 Ready. - /// - Status3GPPAnd3GPP2 = 0x03 - } - - /// - /// Enumeration for sms status type. - /// - public enum SmsMessageStatus - { - /// - /// MT message, stored and read. - /// - Read, - /// - /// MT message, stored and unread. - /// - Unread, - /// - /// MO message, stored and sent. - /// - Sent, - /// - /// MO message, stored but not sent. - /// - Unsent, - /// - /// Delivered at destination. - /// - Delivered, - /// - /// Service centre forwarded message but is unable to confirm delivery. - /// - DeliveryUnconfirmed, - /// - /// Message has been replaced. - /// - MessageReplaced, - /// - /// Reserved for future use. - /// - Reserved - } - - /// - /// Enumeration for different response types that come in the sent status acknowledgement/notification after sending a message to the network. - /// - public enum SmsResponse - { - /// - /// Message sent successfully. - /// - Success, - /// - /// Message routing not available. - /// - NotAvailable, - /// - /// Invalid parameter present in TPDU - /// - InvalidParameter, - /// - /// Device failure. - /// - DeviceFail, - /// - /// Reserved Service. - /// - ServiceReserved, - /// - /// Invalid location. - /// - InvalidLocation, - /// - /// No SIM error. - /// - NoSim, - /// - /// SIM not ready error. - /// - SimNotReady, - /// - /// No response from network. - /// - NoNetworkResponse, - /// - /// Destination address restricted. - /// - DestinationAddressRestricted, - /// - /// Service center address restricted. - /// - SCAAddressRestricted, - /// - /// Resend an already done operation. - /// - ResendDone, - /// - /// SCA address not available. - /// - SCANotAvailable, - /// - /// Unassigned number. - /// - UnassignedNumber, - /// - /// Operator determined barring. - /// - OperatorBarring, - /// - /// Call barred. - /// - CallBarred, - /// - /// Message transfer rejected. - /// - MessageTransferRejected, - /// - /// Message capacity exceeded/memory full. - /// - MemoryCapacityExceeded, - /// - /// Destination number out of service. - /// - DestinationOutOfService, - /// - /// Unspecified subscriber. - /// - UnspecifiedSubscriber, - /// - /// Facility rejected. - /// - FacilityRejected, - /// - /// Unknown subscriber. - /// - UnknownSubscriber, - /// - /// Network out of order. - /// - NetworkOutOfOrder, - /// - /// Temporary failure. - /// - TemporaryFail, - /// - /// Congestion occured. - /// - Congestion, - /// - /// Resource unavilable. - /// - ResourceUnavailable, - /// - /// Facility not subscribed by the user. - /// - FacilityNotSubscribed, - /// - /// Facility not implemented. - /// - FacilityNotImplemented, - /// - /// Invalid reference value. - /// - InvalidReference, - /// - /// Invalid message. - /// - InvalidMessage, - /// - /// Invalid mandatory information. - /// - InvalidMandatoryInfo, - /// - /// Message type not implemented. - /// - MessageTypeNotImplemented, - /// - /// Message not compact protocol. - /// - MessageNotCompactProtocol, - /// - /// Information element not implemented. - /// - IENotImplemented, - /// - /// Protocol error. - /// - ProtocolError, - /// - /// Networking error. - /// - Interworking, - /// - /// Sms ME full. - /// - MeFull, - /// - /// Sms sim full. - /// - SimFull, - /// - /// Timeout error. - /// - Timeout - } -} diff --git a/src/Tizen.Tapi/Tizen.Tapi/SmsStructs.cs b/src/Tizen.Tapi/Tizen.Tapi/SmsStructs.cs deleted file mode 100755 index 0b47e126f..000000000 --- a/src/Tizen.Tapi/Tizen.Tapi/SmsStructs.cs +++ /dev/null @@ -1,162 +0,0 @@ -/* - * 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; - -namespace Tizen.Tapi -{ - [StructLayout(LayoutKind.Sequential)] - internal struct SmsIncomingMsgNotiStruct - { - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 20)] - internal string Sca; - internal int MsgLength; - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] - internal string SzData; - internal SmsNetType Format; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct SmsIncomingCbMsgNotiStruct - { - internal SmsCbMsgType CbMsgType; - internal short Length; - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 1253)] - internal string SzMsgData; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct SmsIncomingEtwsMsgNotiStruct - { - internal SmsEtwsMsgType EtwsMsgType; - internal short Length; - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 1253)] - internal string SzMsgData; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct SmsDataPackageStruct - { - [MarshalAs(UnmanagedType.ByValTStr, SizeConst=20)] - internal string Sca; - internal int Length; - [MarshalAs(UnmanagedType.ByValTStr, SizeConst=256)] - internal string SzData; - internal SmsNetType Format; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct SmsDataStruct - { - internal int Index; - internal SmsMessageStatus Status; - internal SmsDataPackageStruct Data; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct SmsCbConfigStruct - { - internal int Net3gppType; - internal int CbEnabled; - internal byte MsgIdMaxCount; - internal int MsgIdRangeCount; - [MarshalAs(UnmanagedType.ByValArray, SizeConst=50, ArraySubType = UnmanagedType.LPStruct)] - internal SmsCbMsgStruct[] MsgIds; - } - - [StructLayout(LayoutKind.Explicit)] - internal struct SmsCbMsgStruct - { - [FieldOffset(0)] - internal SmsCbMsg3gppStruct Net3gpp; - [FieldOffset(0)] - internal SmsCbMsg3gpp2Struct Net3gpp2; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct SmsCbMsg3gppStruct - { - internal ushort FromMsgId; - internal ushort ToMsgId; - internal byte Selected; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct SmsCbMsg3gpp2Struct - { - internal ushort CbCategory; - internal ushort CbLanguage; - internal byte Selected; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct SmsParamsStruct - { - internal byte RecordIndex; - internal byte RecordLength; - internal ulong AlphaIdLength; - [MarshalAs(UnmanagedType.ByValTStr, SizeConst=129)] - internal string AlphaId; - internal byte ParamIndicator; - internal SmsAddressStruct DestinationAddress; - internal SmsAddressStruct ServiceCenterAddress; - internal ushort TpProtocolId; - internal ushort TpDataCodingScheme; - internal ushort TpValidityPeriod; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct SmsAddressStruct - { - internal uint DialNumLength; - internal SimTypeOfNumber Type; - internal SimNumberPlanIdentity Identity; - [MarshalAs(UnmanagedType.ByValTStr, SizeConst=21)] - internal string DiallingNumber; - } - - internal static class SmsStructConversions - { - internal static SmsIncomingMessageNoti ConvertSmsIncomingStruct(SmsIncomingMsgNotiStruct msgStruct) - { - SmsIncomingMessageNoti msgNoti = new SmsIncomingMessageNoti(); - msgNoti.ScaVal = msgStruct.Sca; - msgNoti.MsgLength = msgStruct.MsgLength; - msgNoti.FormatType = msgStruct.Format; - msgNoti.Data = msgStruct.SzData; - return msgNoti; - } - - internal static SmsIncomingCbMessageNoti ConvertSmsIncomingCbStruct(SmsIncomingCbMsgNotiStruct msgStruct) - { - SmsIncomingCbMessageNoti msgNoti = new SmsIncomingCbMessageNoti(); - msgNoti.Len = msgStruct.Length; - msgNoti.CbType = msgStruct.CbMsgType; - msgNoti.Data = msgStruct.SzMsgData; - return msgNoti; - } - - internal static SmsIncomingEtwsMessageNoti ConvertSmsIncomingEtwsStruct(SmsIncomingEtwsMsgNotiStruct msgStruct) - { - SmsIncomingEtwsMessageNoti msgNoti = new SmsIncomingEtwsMessageNoti(); - msgNoti.Len = msgStruct.Length; - msgNoti.EtwsType = msgStruct.EtwsMsgType; - msgNoti.Data = msgStruct.SzMsgData; - return msgNoti; - } - } -} diff --git a/src/Tizen.Tapi/Tizen.Tapi/Ss.cs b/src/Tizen.Tapi/Tizen.Tapi/Ss.cs deleted file mode 100755 index 4d3397415..000000000 --- a/src/Tizen.Tapi/Tizen.Tapi/Ss.cs +++ /dev/null @@ -1,534 +0,0 @@ -/* - * 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.Threading.Tasks; -using System.Runtime.InteropServices; -using System.Collections.Generic; - -namespace Tizen.Tapi -{ - /// - /// A class which manages Supplementary Services of the SIM. - /// - public class Ss - { - private IntPtr _handle = IntPtr.Zero; - private Dictionary _callbackMap = new Dictionary(); - private int _requestId = 0; - private Ss() - { - } - - /// - /// A constructor to instantiate Ss class using the Tapi handle. - /// - /// An instance of TapiHandle obtained from InitTapi in TapiManager API. - /// Thrown when handle is passed as null. - public Ss(TapiHandle handle) - { - if (handle == null) - { - throw new ArgumentNullException("Handle is null"); - } - - _handle = handle._handle; - } - - /// - /// Sends a request to activate/deactivate call barring. - /// - /// The information about call barring. - /// A task containing an instance of SsBarringResponse which contains information about barring response. - /// http://tizen.org/feature/network.telephony - /// platform - /// http://tizen.org/privilege/telephony.admin - /// Thrown when telephony feature is not supported. - /// Thrown when privilege access is denied. - /// Thrown when barring info is passed as null. - /// Thrown when it is failed due to invalid parameter. - /// Thrown when it is failed due to invalid operation. - public Task SsSetBarring(SsBarringInfo info) - { - TaskCompletionSource task = new TaskCompletionSource(); - IntPtr id = (IntPtr)_requestId++; - _callbackMap[id] = (handle, result, data, key) => - { - Task taskResult = new Task(() => - { - if (result != (int)SsCause.Success) - { - Log.Error(TapiUtility.LogTag, "Error occurs during setting SS barring info: " + (SsCause)result); - task.SetException(new InvalidOperationException("Error occurs during setting SS barring info, " + (SsCause)result)); - return; - } - - SsBarringResponseStruct response = Marshal.PtrToStructure(data); - task.SetResult(SsStructConversions.ConvertBarringRspStruct(response)); - }); - taskResult.Start(); - taskResult.Wait(); - _callbackMap.Remove(key); - }; - - if (info == null) - { - throw new ArgumentNullException("Ss barring info is null"); - } - - SsBarringInfoStruct infoStruct = SsClassConversions.ConvertSsBarringInfo(info); - int ret = Interop.Tapi.Ss.SsSetBarring(_handle, ref infoStruct, _callbackMap[id], id); - if (ret != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Failed to set barring info, Error: " + (TapiError)ret); - TapiUtility.ThrowTapiException(ret, _handle, "http://tizen.org/privilege/telephony.admin"); - } - - return task.Task; - } - - /// - /// Gets call barring status. - /// - /// The type of call. - /// The barring type. - /// A task containing information about barring response. - /// http://tizen.org/feature/network.telephony - /// http://tizen.org/privilege/telephony - /// Thrown when telephony feature is not supported. - /// Thrown when privilege access is denied. - /// Thrown when it is failed due to invalid parameter. - /// Thrown when it is failed due to invalid operation. - public Task SsGetBarringStatus(SsClass ssClass, SsBarringType type) - { - TaskCompletionSource task = new TaskCompletionSource(); - IntPtr id = (IntPtr)_requestId++; - _callbackMap[id] = (handle, result, data, key) => - { - Task taskResult = new Task(() => - { - if (result != (int)SsCause.Success) - { - Log.Error(TapiUtility.LogTag, "Error occurs in getting barring status: " + (SsCause)result); - task.SetException(new InvalidOperationException("Error occurs in getting barring status, " + (SsCause)result)); - return; - } - - SsBarringResponseStruct response = Marshal.PtrToStructure(data); - task.SetResult(SsStructConversions.ConvertBarringRspStruct(response)); - }); - taskResult.Start(); - taskResult.Wait(); - _callbackMap.Remove(key); - }; - - int ret = Interop.Tapi.Ss.SsGetBarringStatus(_handle, ssClass, type, _callbackMap[id], id); - if (ret != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Failed to get barring status, Error: " + (TapiError)ret); - TapiUtility.ThrowTapiException(ret, _handle, "http://tizen.org/privilege/telephony"); - } - - return task.Task; - } - - /// - /// Allows changing of the barring password in the network. - /// - /// The old password set for Barring in the Network. - /// The new password set for Barring in the Network. - /// The new password again. - /// A task indicating whether the change of password is done or not. - /// http://tizen.org/feature/network.telephony - /// platform - /// http://tizen.org/privilege/telephony.admin - /// Thrown when telephony feature is not supported. - /// Thrown when privilege access is denied. - /// Thrown when any of the parameter is passed as null. - /// Thrown when it is failed due to invalid parameter. - /// Thrown when it is failed due to invalid operation. - public Task SsChangeBarringPassword(string oldPassword, string newPassword, string newPasswordAgain) - { - TaskCompletionSource task = new TaskCompletionSource(); - IntPtr id = (IntPtr)_requestId++; - _callbackMap[id] = (handle, result, data, key) => - { - Task taskResult = new Task(() => - { - if (result != (int)SsCause.Success) - { - Log.Error(TapiUtility.LogTag, "Error occurs in changing barring password: " + (SsCause)result); - task.SetException(new InvalidOperationException("Error occurs in changing barring password, " + (SsCause)result)); - return; - } - - task.SetResult(true); - }); - taskResult.Start(); - taskResult.Wait(); - _callbackMap.Remove(key); - }; - - if (oldPassword == null || newPassword == null || newPasswordAgain == null) - { - throw new ArgumentNullException("Old password/new password is null"); - } - - int ret = Interop.Tapi.Ss.SsChangeBarringPassword(_handle, oldPassword, newPassword, newPasswordAgain, _callbackMap[id], id); - if (ret != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Failed to change barring password, Error: " + (TapiError)ret); - TapiUtility.ThrowTapiException(ret, _handle, "http://tizen.org/privilege/telephony.admin"); - } - - return task.Task; - } - - /// - /// Allows to set the (register/erase/activate/deactivate) call forwarding option at the network. - /// - /// The Call forward information such as a forward mode, a forward type, and so on. - /// A task containing information about SS forward response. - /// http://tizen.org/feature/network.telephony - /// platform - /// http://tizen.org/privilege/telephony.admin - /// Thrown when telephony feature is not supported. - /// Thrown when privilege access is denied. - /// Thrown when forward info is passed as null. - /// Thrown when it is failed due to invalid parameter. - /// Thrown when it is failed due to invalid operation. - public Task SsSetForwardInfo(SsForwardInfo info) - { - TaskCompletionSource task = new TaskCompletionSource(); - IntPtr id = (IntPtr)_requestId++; - _callbackMap[id] = (handle, result, data, key) => - { - Task taskResult = new Task(() => - { - if (result != (int)SsCause.Success) - { - Log.Error(TapiUtility.LogTag, "Error occurs in setting SS forward info: " + (SsCause)result); - task.SetException(new InvalidOperationException("Error occurs in setting SS forward info, " + (SsCause)result)); - return; - } - - SsForwardResponseStruct response = Marshal.PtrToStructure(data); - task.SetResult(SsStructConversions.ConvertForwardRspStruct(response)); - }); - taskResult.Start(); - taskResult.Wait(); - _callbackMap.Remove(key); - }; - - if (info == null) - { - throw new ArgumentNullException("Ss forward info is null"); - } - - SsForwardInfoStruct infoStruct = SsClassConversions.ConvertSsForwardInfo(info); - int ret = Interop.Tapi.Ss.SsSetForward(_handle, ref infoStruct, _callbackMap[id], id); - if (ret != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Failed to set forward info, Error: " + (TapiError)ret); - TapiUtility.ThrowTapiException(ret, _handle, "http://tizen.org/privilege/telephony.admin"); - } - - return task.Task; - } - - /// - /// Provides an option to get the call forwarding status of different calls from the Network. - /// - /// The Forward call type. - /// The forward condition. - /// A task containing SS forward response information. - /// http://tizen.org/feature/network.telephony - /// http://tizen.org/privilege/telephony - /// Thrown when telephony feature is not supported. - /// Thrown when privilege access is denied. - /// Thrown when it is failed due to invalid parameter. - /// Thrown when it is failed due to invalid operation. - public Task SsGetForwardStatus(SsClass ssClass, SsForwardCondition condition) - { - TaskCompletionSource task = new TaskCompletionSource(); - IntPtr id = (IntPtr)_requestId++; - _callbackMap[id] = (handle, result, data, key) => - { - Task taskResult = new Task(() => - { - if (result != (int)SsCause.Success) - { - Log.Error(TapiUtility.LogTag, "Error occurs in getting SS forward status: " + (SsCause)result); - task.SetException(new InvalidOperationException("Error occurs in getting SS forward status, " + (SsCause)result)); - return; - } - - SsForwardResponseStruct response = Marshal.PtrToStructure(data); - task.SetResult(SsStructConversions.ConvertForwardRspStruct(response)); - }); - taskResult.Start(); - taskResult.Wait(); - _callbackMap.Remove(key); - }; - - int ret = Interop.Tapi.Ss.SsGetForwardStatus(_handle, ssClass, condition, _callbackMap[id], id); - if (ret != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Failed to get forward status, Error: " + (TapiError)ret); - TapiUtility.ThrowTapiException(ret, _handle, "http://tizen.org/privilege/telephony"); - } - - return task.Task; - } - - /// - /// Activates/deactivates the call waiting service. - /// - /// The status of call-waiting service. - /// A task containing SS waiting response information. - /// http://tizen.org/feature/network.telephony - /// platform - /// http://tizen.org/privilege/telephony.admin - /// Thrown when telephony feature is not supported. - /// Thrown when privilege access is denied. - /// Thrown when waiting info is passed as null. - /// Thrown when it is failed due to invalid parameter. - /// Thrown when it is failed due to invalid operation. - public Task SsSetWaitingInfo(SsWaitingInfo info) - { - TaskCompletionSource task = new TaskCompletionSource(); - IntPtr id = (IntPtr)_requestId++; - _callbackMap[id] = (handle, result, data, key) => - { - Task taskResult = new Task(() => - { - if (result != (int)SsCause.Success) - { - Log.Error(TapiUtility.LogTag, "Error occurs in setting SS waiting info: " + (SsCause)result); - task.SetException(new InvalidOperationException("Error occurs in setting SS waiting info, " + (SsCause)result)); - return; - } - - SsWaitingResponseStruct response = Marshal.PtrToStructure(data); - task.SetResult(SsStructConversions.ConvertWaitingRspStruct(response)); - }); - taskResult.Start(); - taskResult.Wait(); - _callbackMap.Remove(key); - }; - - if (info == null) - { - throw new ArgumentNullException("Ss waiting info is null"); - } - - SsWaitingInfoStruct infoStruct = SsClassConversions.ConvertSsWaitingInfo(info); - int ret = Interop.Tapi.Ss.SsSetWaiting(_handle, ref infoStruct, _callbackMap[id], id); - if (ret != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Failed to set waiting info, Error: " + (TapiError)ret); - TapiUtility.ThrowTapiException(ret, _handle, "http://tizen.org/privilege/telephony.admin"); - } - - return task.Task; - } - - /// - /// Gets the status of the call waiting service. - /// - /// The call types. - /// A task containing information about SS waiting response. - /// http://tizen.org/feature/network.telephony - /// http://tizen.org/privilege/telephony - /// Thrown when telephony feature is not supported. - /// Thrown when privilege access is denied. - /// Thrown when it is failed due to invalid parameter. - /// Thrown when it is failed due to invalid operation. - public Task SsGetWaitingInfo(SsClass ssClass) - { - TaskCompletionSource task = new TaskCompletionSource(); - IntPtr id = (IntPtr)_requestId++; - _callbackMap[id] = (handle, result, data, key) => - { - Task taskResult = new Task(() => - { - if (result != (int)SsCause.Success) - { - Log.Error(TapiUtility.LogTag, "Error occurs in getting SS waiting info: " + (SsCause)result); - task.SetException(new InvalidOperationException("Error occurs in getting SS waiting info, " + (SsCause)result)); - return; - } - - SsWaitingResponseStruct response = Marshal.PtrToStructure(data); - task.SetResult(SsStructConversions.ConvertWaitingRspStruct(response)); - }); - taskResult.Start(); - taskResult.Wait(); - _callbackMap.Remove(key); - }; - - int ret = Interop.Tapi.Ss.SsGetWaitingStatus(_handle, ssClass, _callbackMap[id], id); - if (ret != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Failed to get waiting info, Error: " + (TapiError)ret); - TapiUtility.ThrowTapiException(ret, _handle, "http://tizen.org/privilege/telephony"); - } - - return task.Task; - } - - /// - /// Activates/deactivates the status of the calling line identity service. - /// - /// The Cli service type. - /// The Cli Status. - /// A task indicating whether setting of CLI status is done or not. - /// http://tizen.org/feature/network.telephony - /// platform - /// http://tizen.org/privilege/telephony.admin - /// Thrown when telephony feature is not supported. - /// Thrown when privilege access is denied. - /// Thrown when it is failed due to invalid parameter. - /// Thrown when it is failed due to invalid operation. - public Task SsSetCliStatus(SsCliType type, SsCliStatus status) - { - TaskCompletionSource task = new TaskCompletionSource(); - IntPtr id = (IntPtr)_requestId++; - _callbackMap[id] = (handle, result, data, key) => - { - Task taskResult = new Task(() => - { - if (result != (int)SsCause.Success) - { - Log.Error(TapiUtility.LogTag, "Error occurs in setting SS CLI status: " + (SsCause)result); - task.SetException(new InvalidOperationException("Error occurs in setting SS CLI status, " + (SsCause)result)); - return; - } - - task.SetResult(true); - }); - taskResult.Start(); - taskResult.Wait(); - _callbackMap.Remove(key); - }; - - int ret = Interop.Tapi.Ss.SsSetCliStatus(_handle, type, status, _callbackMap[id], id); - if (ret != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Failed to set SS CLI status, Error: " + (TapiError)ret); - TapiUtility.ThrowTapiException(ret, _handle, "http://tizen.org/privilege/telephony.admin"); - } - - return task.Task; - } - - /// - /// Gets the status of the calling line identity service. - /// - /// The Cli service type. - /// A task containing SS CLI response information. - /// http://tizen.org/feature/network.telephony - /// http://tizen.org/privilege/telephony - /// Thrown when telephony feature is not supported. - /// Thrown when privilege access is denied. - /// Thrown when it is failed due to invalid parameter. - /// Thrown when it is failed due to invalid operation. - public Task SsGetCliStatus(SsCliType type) - { - TaskCompletionSource task = new TaskCompletionSource(); - IntPtr id = (IntPtr)_requestId++; - _callbackMap[id] = (handle, result, data, key) => - { - Task taskResult = new Task(() => - { - if (result != (int)SsCause.Success) - { - Log.Error(TapiUtility.LogTag, "Error occurs in getting SS CLI status: " + (SsCause)result); - task.SetException(new InvalidOperationException("Error occurs in getting SS CLI status, " + (SsCause)result)); - return; - } - - SsCliResponseStruct response = Marshal.PtrToStructure(data); - task.SetResult(SsStructConversions.ConvertSsCliResponseStruct(response)); - }); - taskResult.Start(); - taskResult.Wait(); - _callbackMap.Remove(key); - }; - - int ret = Interop.Tapi.Ss.SsGetCliStatus(_handle, type, _callbackMap[id], id); - if (ret != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Failed to get CLI status, Error: " + (TapiError)ret); - TapiUtility.ThrowTapiException(ret, _handle, "http://tizen.org/privilege/telephony"); - } - - return task.Task; - } - - /// - /// Sends a USSD string or User response to the Network. - /// - /// The data coding scheme used - /// A task containing SS USSD response information. - /// http://tizen.org/feature/network.telephony - /// platform - /// http://tizen.org/privilege/telephony.admin - /// Thrown when telephony feature is not supported. - /// Thrown when privilege access is denied. - /// Thrown when Ussd message info is passed as null. - /// Thrown when it is failed due to invalid parameter. - /// Thrown when it is failed due to invalid operation. - public Task SsSendUssdRequest(SsUssdMsgInfo info) - { - TaskCompletionSource task = new TaskCompletionSource(); - IntPtr id = (IntPtr)_requestId++; - _callbackMap[id] = (handle, result, data, key) => - { - Task taskResult = new Task(() => - { - if (result != (int)SsCause.Success) - { - Log.Error(TapiUtility.LogTag, "Error occurs in sending USSD request: " + (SsCause)result); - task.SetException(new InvalidOperationException("Error occurs in sending USSD request, " + (SsCause)result)); - return; - } - - SsUssdResponseStruct response = Marshal.PtrToStructure(data); - task.SetResult(SsStructConversions.ConvertSsUssdResponseStruct(response)); - }); - taskResult.Start(); - taskResult.Wait(); - _callbackMap.Remove(key); - }; - - if (info == null) - { - throw new ArgumentNullException("Ussd message info is null"); - } - - SsUssdMsgInfoStruct msgStruct = SsClassConversions.ConvertSsUssdMsgInfo(info); - int ret = Interop.Tapi.Ss.SsSendUssdRequest(_handle, ref msgStruct, _callbackMap[id], id); - if (ret != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Failed to send USSD request, Error: " + (TapiError)ret); - TapiUtility.ThrowTapiException(ret, _handle, "http://tizen.org/privilege/telephony.admin"); - } - - return task.Task; - } - } -} diff --git a/src/Tizen.Tapi/Tizen.Tapi/SsData.cs b/src/Tizen.Tapi/Tizen.Tapi/SsData.cs deleted file mode 100755 index 9901405da..000000000 --- a/src/Tizen.Tapi/Tizen.Tapi/SsData.cs +++ /dev/null @@ -1,784 +0,0 @@ -/* - * 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.Collections.Generic; - -namespace Tizen.Tapi -{ - /// - /// A class which defines values for USSD request type. Applicable to 3GPP(GSM/UMTS/LET) only. - /// - public class SsUssdMsgInfo - { - private SsUssdType _type; - private byte _dcs; - private int _length; - private string _ussdString; - - /// - /// USSD type. - /// - /// Type of USSD represented in SsUssdType enum. - public SsUssdType Type - { - get - { - return _type; - } - - set - { - _type = value; - } - } - - /// - /// DCS. - /// - /// Dcs value represented in byte. - public byte Dcs - { - get - { - return _dcs; - } - - set - { - _dcs = value; - } - } - - /// - /// USSD string length. - /// - /// Length of USSD string in integer. - public int Length - { - get - { - return _length; - } - - set - { - _length = value; - } - } - - /// - /// USSD string. - /// - /// Ussd string represented in string. - public string UssdString - { - get - { - return _ussdString; - } - - set - { - _ussdString = value; - } - } - } - - /// - /// A class which defines release complete message notification type. - /// - public class SsReleaseCompleteMsgInfo - { - internal byte Length; - internal byte[] Msg; - - internal SsReleaseCompleteMsgInfo() - { - } - - /// - /// Specifies the Release complete messageg length. - /// - /// Length of release complete message in byte. - public byte MsgLength - { - get - { - return Length; - } - } - - /// - /// Specifies the release complete message. - /// - /// Release complete message represented in byte array. - public byte[] Message - { - get - { - return Msg; - } - } - } - - /// - /// A class which defines SS forward record information. - /// - public class SsForwardRecord - { - internal SsClass SsClass; - internal SsStatus SsStatus; - internal SsForwardCondition Condition; - internal bool IsNumPresent; - internal SsNoReplyTime NoReply; - internal SsForwardTypeOfNumber Type; - internal SsForwardNumberingPlanIdentity NumIdPlan; - internal string ForwardNum; - - internal SsForwardRecord() - { - } - - /// - /// SS class - /// - /// SS class type. - public SsClass Class - { - get - { - return SsClass; - } - } - - /// - /// Call forwarding SS status. - /// - /// Status of SS call forwarding. - public SsStatus Status - { - get - { - return SsStatus; - } - } - - /// - /// Call forward types providing various conditions when a call can be forwarded. - /// - /// Forwarding condition of SS call forward. - public SsForwardCondition ForwardCondition - { - get - { - return Condition; - } - } - - /// - /// Flag that indicates whether call forwarding number is present. - /// - /// Boolean value to check the presence of call forwarding number. - public bool IsForwardingNumberPresent - { - get - { - return IsNumPresent; - } - } - - /// - /// No reply time. - /// - /// Waiting time when there is no reply. - public SsNoReplyTime NoReplyTime - { - get - { - return NoReply; - } - } - - /// - /// Type of number. - /// - /// SS call forward type of number. - public SsForwardTypeOfNumber Ton - { - get - { - return Type; - } - } - - /// - /// Numbering Plan Identity. - /// - /// SS call forward numbering plan identity. - public SsForwardNumberingPlanIdentity Npi - { - get - { - return NumIdPlan; - } - } - - /// - /// Forwarded number. - /// - /// Call forwarding number. - public string ForwardingNumber - { - get - { - return ForwardNum; - } - } - } - - /// - /// A class which defines values for SS call forwarding record. Applicable to 3GPP(GSM/UMTS/LTE) only. - /// - public class SsForwardResponse - { - internal int RecordNum; - internal IEnumerable RecordList; - - internal SsForwardResponse() - { - } - - /// - /// Record number. - /// - /// Record value represented in integer. - public int RecordNumber - { - get - { - return RecordNum; - } - } - - /// - /// Specifies the maximum of SS forward records. - /// - /// A list of instances of SsForwardRecord. - public IEnumerable Record - { - get - { - return RecordList; - } - } - } - - /// - /// A class which defines SS call barring record information. - /// - public class SsBarringRecord - { - internal SsClass SsClass; - internal SsStatus SsStatus; - internal SsBarringType SsType; - - internal SsBarringRecord() - { - } - - /// - /// SS class - /// - /// SS class type. - public SsClass Class - { - get - { - return SsClass; - } - } - - /// - /// SS status. - /// - /// Status of SS call barring. - public SsStatus Status - { - get - { - return SsStatus; - } - } - - /// - /// Call barring types providing various barring conditions on which calls are barred. - /// - /// Type of SS call barring. - public SsBarringType BarringType - { - get - { - return SsType; - } - } - } - - /// - /// A class which defines values for SS call barring record. Applicable to 3GPP(GSM/UMTS/LTE) only. - /// - public class SsBarringResponse - { - internal int RecordNum; - internal IEnumerable RecordList; - - internal SsBarringResponse() - { - } - - /// - /// Record number. - /// - /// Record value represented in integer. - public int RecordNumber - { - get - { - return RecordNum; - } - } - - /// - /// Specifies the maximum of SS barring records. - /// - /// A list of instances of SsBarringRecord. - public IEnumerable Record - { - get - { - return RecordList; - } - } - } - - /// - /// A class which defines SS waiting record information. - /// - public class SsWaitingRecord - { - internal SsClass SsClass; - internal SsStatus SsStatus; - - internal SsWaitingRecord() - { - } - - /// - /// SS class - /// - /// SS class type. - public SsClass Class - { - get - { - return SsClass; - } - } - - /// - /// SS status. - /// - /// Status of SS call waiting. - public SsStatus Status - { - get - { - return SsStatus; - } - } - } - - /// - /// A class which defines values for SS call waiting record. Applicable to 3GPP(GSM/UMTS/LTE) only. - /// - public class SsWaitingResponse - { - internal int RecordNum; - internal IEnumerable RecordList; - - internal SsWaitingResponse() - { - } - - /// - /// Record number. - /// - /// Record value represented in integer. - public int RecordNumber - { - get - { - return RecordNum; - } - } - - /// - /// Specifies the maximum of SS waiting records. - /// - /// A list of instances of SsWaitingRecord. - public IEnumerable Record - { - get - { - return RecordList; - } - } - } - - /// - /// A class which defines SUPS information message notification type. - /// - public class SsInfo - { - internal SsCause Cse; - internal SsInfoType Type; - - internal SsInfo() - { - } - - /// - /// SS error cause. - /// - /// Ss request result. - public SsCause Cause - { - get - { - return Cse; - } - } - - /// - /// SUPS information. - /// - /// Ss information type. - public SsInfoType SsType - { - get - { - return Type; - } - } - } - - /// - /// A class which defines parameters related to call barring. - /// - public class SsBarringInfo - { - private SsClass _class; - private SsBarringMode _mode; - private SsBarringType _type; - private string _password; - private SsBarringInfo() - { - } - - /// - /// A constructor for instantiating SsBarringInfo class with the necessary parameters. - /// - /// Call type. - /// Barring mode. - /// Barring type. - /// Password (3GPP(GSM/UMTS/LTE) Specific). - public SsBarringInfo(SsClass classType, SsBarringMode mode, SsBarringType type, string password) - { - _class = classType; - _mode = mode; - _type = type; - _password = password; - } - - internal SsClass Class - { - get - { - return _class; - } - } - - internal SsBarringMode Mode - { - get - { - return _mode; - } - } - - internal SsBarringType Type - { - get - { - return _type; - } - } - - internal string Password - { - get - { - return _password; - } - } - } - - /// - /// A class which defines the parameters related to forward info. - /// - public class SsForwardInfo - { - private SsClass _class; - private SsForwardMode _mode; - private SsForwardCondition _condition; - private SsNoReplyTime _noReplyTimer; - private SsForwardTypeOfNumber _ton; - private SsForwardNumberingPlanIdentity _npi; - private string _phoneNumber; - private SsForwardInfo() - { - } - - /// - /// A constructor for instantiating SsForwardInfo class with the necessary parameters. - /// - /// SS Class. - /// Forward Mode. - /// Forward Condition. - /// No reply wait time 5-30 secs in intervals of 5(3GPP(GSM/UMTS/LTE) Specific). - /// Type of number. - /// Numbering plan identity. - /// Phone number. - public SsForwardInfo(SsClass classType, SsForwardMode mode, SsForwardCondition condition, SsNoReplyTime time, SsForwardTypeOfNumber ton, SsForwardNumberingPlanIdentity npi, string number) - { - _class = classType; - _mode = mode; - _condition = condition; - _noReplyTimer = time; - _ton = ton; - _npi = npi; - _phoneNumber = number; - } - - internal SsClass Class - { - get - { - return _class; - } - } - - internal SsForwardMode Mode - { - get - { - return _mode; - } - } - - internal SsForwardCondition Condition - { - get - { - return _condition; - } - } - - internal SsNoReplyTime NoReplyTimer - { - get - { - return _noReplyTimer; - } - } - - internal SsForwardTypeOfNumber Ton - { - get - { - return _ton; - } - } - - internal SsForwardNumberingPlanIdentity Npi - { - get - { - return _npi; - } - } - - internal string PhoneNumber - { - get - { - return _phoneNumber; - } - } - } - - /// - /// A class which defines parameters related to call waiting. - /// - public class SsWaitingInfo - { - private SsClass _class; - private SsCallWaitingMode _mode; - private SsWaitingInfo() - { - } - - /// - /// A constructor for instantiating SsWaitingInfo class with necessary parameters. - /// - /// Call type. - /// Call waiting mode. - public SsWaitingInfo(SsClass ssClass, SsCallWaitingMode mode) - { - _class = ssClass; - _mode = mode; - } - - internal SsClass Class - { - get - { - return _class; - } - } - - internal SsCallWaitingMode Mode - { - get - { - return _mode; - } - } - } - - /// - /// A class which defines values for calling line identity service. Applicable to 3GPP(GSM/UMTS/LTE) only. - /// - public class SsCliResponse - { - internal SsLineIdentificationType LineType; - internal SsCliStatus CliStatus; - internal SsCliResponse() - { - } - - /// - /// Various line identification types. - /// - public SsLineIdentificationType Type - { - get - { - return LineType; - } - } - - /// - /// Line identification status from the network. - /// - public SsCliStatus Status - { - get - { - return CliStatus; - } - } - } - - /// - /// A class which defines USSD response data. Applicable to 3GPP(GSM/UMTS/LTE) only. - /// - public class SsUssdResponse - { - internal SsUssdType UssdType; - internal SsUssdStatus UssdStatus; - internal byte DcsInfo; - internal int UssdLength; - internal string UssdInfo; - internal SsUssdResponse() - { - } - - /// - /// USSD Type. - /// - public SsUssdType Type - { - get - { - return UssdType; - } - } - - /// - /// USSD Status. - /// - public SsUssdStatus Status - { - get - { - return UssdStatus; - } - } - - /// - /// DCS. - /// - public byte Dcs - { - get - { - return DcsInfo; - } - } - - /// - /// USSD string length. - /// - public int Length - { - get - { - return UssdLength; - } - } - - /// - /// USSD String. - /// - public string UssdString - { - get - { - return UssdInfo; - } - } - } -} diff --git a/src/Tizen.Tapi/Tizen.Tapi/SsEnumerations.cs b/src/Tizen.Tapi/Tizen.Tapi/SsEnumerations.cs deleted file mode 100755 index 9d9e4ac2f..000000000 --- a/src/Tizen.Tapi/Tizen.Tapi/SsEnumerations.cs +++ /dev/null @@ -1,836 +0,0 @@ -/* - * 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. - */ - -namespace Tizen.Tapi -{ - /// - /// Enumeration for the SS class type. - /// - public enum SsClass - { - /// - /// All Teleservices. - /// - AllTele = 0x10, - /// - /// Voice (Telephony). - /// - Voice = 0x11, - /// - /// All Data Teleservices. - /// - AllDataTele = 0x12, - /// - /// Fax Service. - /// - Fax = 0x13, - /// - /// SMS Service. - /// - Sms = 0x16, - /// - /// Voice Group Call Service. - /// - Vgcs = 0x17, - /// - /// Voice Broadcast. - /// - Vbs = 0x18, - /// - /// All teleservices except SMS. - /// - AllTeleExceptSms = 0x19, - /// - /// All Bearer services. - /// - AllBearer = 0x20, - /// - /// All Async services. - /// - AllAsync = 0x21, - /// - /// All Sync services. - /// - AllSync = 0x22, - /// - /// All Circuit switched sync services. - /// - AllCsSync = 0x24, - /// - /// All Circuit switched async services. - /// - AllCsAsync = 0x25, - /// - /// All Dedicated Packet Access. - /// - AllDedicatedPacketAccess = 0x26, - /// - /// All Dedicated PAD Access. - /// - AllDedicatedPadAccess = 0x27, - /// - /// All Data CDA. - /// - AllDataCda = 0x28, - /// - /// All PLMN specific teleservices. - /// - PlmnTeleAll = 0x50, - /// - /// PLMN specific teleservice 1. - /// - PlmnTele1 = 0x51, - /// - /// PLMN specific teleservice 2. - /// - PlmnTele2 = 0x52, - /// - /// PLMN specific teleservice 3. - /// - PlmnTele3 = 0x53, - /// - /// PLMN specific teleservice 4. - /// - PlmnTele4 = 0x54, - /// - /// PLMN specific teleservice 5. - /// - PlmnTele5 = 0x55, - /// - /// PLMN specific teleservice 6. - /// - PlmnTele6 = 0x56, - /// - /// PLMN specific teleservice 7. - /// - PlmnTele7 = 0x57, - /// - /// PLMN specific teleservice 8. - /// - PlmnTele8 = 0x58, - /// - /// PLMN specific teleservice 9. - /// - PlmnTele9 = 0x59, - /// - /// PLMN specific teleservice 10. - /// - PlmnTeleA = 0x60, - /// - /// PLMN specific teleservice 11. - /// - PlmnTeleB = 0x61, - /// - /// PLMN specific teleservice 12. - /// - PlmnTeleC = 0x62, - /// - /// PLMN specific teleservice 13. - /// - PlmnTeleD = 0x63, - /// - /// PLMN specific teleservice 14. - /// - PlmnTeleE = 0x64, - /// - /// PLMN specific teleservice 15. - /// - PlmnTeleF = 0x65, - /// - /// All PLMN specific bearer services. - /// - PlmnBearAll = 0x70, - /// - /// PLMN specific bearer service 1. - /// - PlmnBear1 = 0x71, - /// - /// PLMN specific bearer service 2. - /// - PlmnBear2 = 0x72, - /// - /// PLMN specific bearer service 3. - /// - PlmnBear3 = 0x73, - /// - /// PLMN specific bearer service 4. - /// - PlmnBear4 = 0x74, - /// - /// PLMN specific bearer service 5. - /// - PlmnBear5 = 0x75, - /// - /// PLMN specific bearer service 6. - /// - PlmnBear6 = 0x76, - /// - /// PLMN specific bearer service 7. - /// - PlmnBear7 = 0x77, - /// - /// PLMN specific bearer service 8. - /// - PlmnBear8 = 0x78, - /// - /// PLMN specific bearer service 9. - /// - PlmnBear9 = 0x79, - /// - /// PLMN specific bearer service 10. - /// - PlmnBearA = 0x80, - /// - /// PLMN specific bearer service 11. - /// - PlmnBearB = 0x81, - /// - /// PLMN specific bearer service 12. - /// - PlmnBearC = 0x82, - /// - /// PLMN specific bearer service 13. - /// - PlmnBearD = 0x83, - /// - /// PLMN specific bearer service 14. - /// - PlmnBearE = 0x84, - /// - /// PLMN specific bearer service 15. - /// - PlmnBearF = 0x85, - /// - /// Auxiliary Voice (Auxiliary telephony). - /// - AuxVoice = 0x89, - /// - /// All GPRS bearer services. - /// - AllGprsBearer = 0x99, - /// - /// All tele and bearer services. - /// - AllTeleBearer = 0xFF - } - - /// - /// Enumeration for various types of call barring. - /// - public enum SsBarringType - { - /// - /// Barring All Outgoing Calls. - /// - Baoc = 0x01, - /// - /// Barring Outgoing International Calls. - /// - Boic, - /// - /// Barring Outgoing International Calls except Home Country. - /// - BoicNotHc, - /// - /// Barring All Incoming Calls. - /// - Baic, - /// - /// Barring Incoming Calls when roaming outside the Home Country. - /// - BicRoam, - /// - /// All Barring Services. - /// - Ab, - /// - /// All Outgoing Barring Services. - /// - Aob, - /// - /// All Incoming Barring Services. - /// - Aib, - /// - /// Barring Incoming Calls which is not stored in the SIM memory. - /// - BicNotSim, - /// - /// Maximum Barring type. - /// - Max - } - - /// - /// Enumeration for the CLI service type. - /// - public enum SsCliType - { - /// - /// Calling Line Identification Presentation. - /// - Clip = 0x01, - /// - /// Calling Line Identification Restriction. - /// - Clir = 0x02, - /// - /// Connected Line Identification Presentation. 3GPP(GSM/UMTS/LTE) Specific. - /// - Colp = 0x03, - /// - /// Connected Line Identification Restriction. 3GPP(GSM/UMTS/LTE) Specific. - /// - Colr = 0x04, - /// - /// Called Line Identification Presentation. 3GPP(GSM/UMTS/LTE) Specific. - /// - Cdip = 0x05, - /// - /// Calling Name Presentation. 3GPP(GSM/UMTS/LTE) Specific. - /// - Cnap = 0x06 - } - - /// - /// Enumeration for the CLI service status. - /// - public enum SsCliStatus - { - /// - /// Service not provided by the service provider. - /// - NotProvisioned = 0x01, - /// - /// Service is provided by the service provider. - /// - Provisioned, - /// - /// Service is activated at the network. - /// - Activated, - /// - /// Service status is unknown. - /// - Unknown, - /// - /// Service is temporarily restricted. - /// - TempRestricted, - /// - /// Service is temporarily allowed. - /// - TempAllowed - } - - /// - /// Enumeration for the call forwarding condition. - /// - public enum SsForwardCondition - { - /// - /// Call Forwarding Unconditional. - /// - Unconditional = 0x01, - /// - /// Call Forwarding Mobile Busy. - /// - MobileBusy, - /// - /// Call Forwarding No Reply. - /// - NoReply, - /// - /// Call Forwarding Not Reachable. - /// - NotReachable, - /// - /// All Call Forwarding. - /// - All, - /// - /// All Conditional Call Forwarding. - /// - AllConditional, - /// - /// Max. - /// - Max - } - - /// - /// Enumeration for the USSD type. Applicable to 3GPP(GSM/UMTS/LTE) only. - /// - public enum SsUssdType - { - /// - /// USSD request type - User Initiated. - /// - UserInit = 0x01, - /// - /// USSD request type - User Response. - /// - UserResponse, - /// - /// USSD request type - User Release. - /// - UserRelease - } - - /// - /// Enumeration for the status of a supplementary service feature (e.g. call forwarding or call barring). - /// - /// - /// These enumerated values should be used as masks. - /// - public enum SsStatus - { - /// - /// Provisioned & registered (but not active/active-quiescent). - /// - Registered = 0x01, - /// - /// Provisioned but not registered (or active/active-quiescent). - /// - Provisioned, - /// - /// Provisioned & registered & active. - /// - Active, - /// - /// Provisioned & registered & active but quiescent. - /// - Quiescent, - /// - /// Not provisioned. - /// - Nothing - } - - /// - /// Enumeration for no-reply time. Applicable to 3GPP(GSM/UMTS/LTE) only. - /// - public enum SsNoReplyTime - { - /// - /// Timer value set to 5secs. - /// - Time5Secs = 5, - /// - /// Timer value set to 10secs. - /// - Time10Secs = 10, - /// - /// Timer value set to 15secs. - /// - Time15Secs = 15, - /// - /// Timer value set to 20secs. - /// - Time20Secs = 20, - /// - /// Timer value set to 25secs. - /// - Time25Secs = 25, - /// - /// Timer value set to 30secs. - /// - Time30Secs = 30 - } - - /// - /// Enumeration for the call forwarding type of number. - /// - public enum SsForwardTypeOfNumber - { - /// - /// Unknown. - /// - Unknown = 0, - /// - /// International number. - /// - International = 1, - /// - /// National number. - /// - National = 2, - /// - /// Network specific number. - /// - NetworkSpecific = 3, - /// - /// Subscriber number. - /// - DedicatedAccess = 4, - /// - /// Alphanumeric, GSM 7-bit default alphabet. - /// - AlphaNumeric = 5, - /// - /// Abbreviated number. - /// - AbbreviatedNumber = 6, - /// - /// Reserved for extension. - /// - ReservedForExt = 7 - } - - /// - /// Enumeration for the call forward numbering plan identity. - /// - public enum SsForwardNumberingPlanIdentity - { - /// - /// Unknown. - /// - Unknown = 0, - /// - /// ISDN/Telephone numbering plan. - /// - IsdnTel = 1, - /// - /// Data numbering plan. - /// - DataNumPlan = 3, - /// - /// Telex numbering plan. - /// - Telex = 4, - /// - /// Service Center Specific plan. - /// - ServiceCenterSpecificPlan = 5, - /// - /// Service Center Specific plan2. - /// - ServiceCenterSpecificPlan2 = 6, - /// - /// National numbering plan. - /// - National = 8, - /// - /// Private numbering plan. - /// - Private = 9, - /// - /// ERMES numbering plan. - /// - ErmesNumPlan = 10, - /// - /// Reserved for extension. - /// - ReservedForExt = 0xF - } - - /// - /// Enumeration for the supplementary service request results. - /// - public enum SsCause - { - /// - /// SS operation is successful. - /// - Success = 0x0, - /// - /// SS error indicating unknown/illegal subscriber - /// - UnknownSubscriber = 0x01, - /// - /// This error is returned when illegality of the access has been established by use of an authentication procedure. - /// - IllegalSubscriber = 0x09, - /// - /// The network returns this error when it is requested to perform an operation on a supplementary service. - /// - BearerServiceNotProvisioned = 0x0a, - /// - /// The network returns this error when it is requested to perform an operation on a supplementary service. - /// - TeleServiceNotProvisioned = 0x0b, - /// - /// This error is returned when the IMEI check procedure has shown that the IMEI is blacklisted or it is not whitelisted. - /// - IllegalEquipment = 0x0c, - /// - /// This error is returned by the network to the MS when call independent subscriber control procedures are barred by the operator. - /// - CallBarred = 0x0d, - /// - /// This error is returned by the network when it is requested to perform an illegal operation which is defined as not applicable for the relevant supplementary service. - /// - IllegalSsOperation = 0x10, - /// - /// This error is returned by the network when it is requested to perform an operation which is not compatible with the current status of the relevant supplementary service. - /// - ErrorStatus = 0x11, - /// - /// SS not available in the network. - /// - Unavailable = 0x12, - /// - /// SS service subscription violation. - /// - SubscriptionViolation = 0x13, - /// - /// This error is returned by the network when it is requested for a supplementary service operation that is incompatible with the status of another supplementary service or with the teleservice or bearer service for which the operation is requested. - /// - Incompatibility = 0x14, - /// - /// SS service facility not supported. - /// - FacilityNotSupported = 0x15, - /// - /// This error is returned when the subscriber has activated the detach service or the system detects the absence condition. - /// - AbsentSubscriber = 0x1b, - /// - /// This error is returned by the network, when it cannot perform an operation because of a failure in the network. - /// - SystemFailure = 0x22, - /// - /// This error is returned by the network when an optional parameter is missing in an invoke component or an inner data structure, while it is required by the context of the request. - /// - DataMissing = 0x23, - /// - /// SS error indicating an unexpected data value on the network side. - /// - UnexpectedDataValue = 0x24, - /// - /// SS error indicating a change password failure. - /// - PasswordRegistrationFailure = 0x25, - /// - /// SS error indicating a negative password check. - /// - NegativePasswordCheck = 0x26, - /// - /// SS error indicating violation in barring password attempts. - /// - PasswordAttemptsViolation = 0x2b, - /// - /// SS error indicating unknown SS data coding of an alphabet. - /// - UnknownAlphabet = 0x47, - /// - /// SS error indicating USSD Busy(Already SS / USSD is ongoing). - /// - UssdBusy = 0x48, - /// - /// SS error indicating Dialing number is not FDN. - /// - FdnOnly = 0x5F, - /// - /// SS operation rejected by the user. - /// - RejectedByUser = 0x79, - /// - /// SS operation rejected by the network. - /// - RejectedByNetwork = 0x7a, - /// - /// This error is returned if a diversion to the served subscriber's number is requested. - /// - DeflectionToServedSubscriber = 0x7b, - /// - /// This error is returned if a diversion to a special service code is requested. - /// - SpecialServiceCode = 0x7c, - /// - /// SS error indicating invalid deflected to a number. - /// - InvalidDeflectedToNumber = 0x7d, - /// - /// SS error indicating Maximum MPTY is reached. - /// - MaxMptyExceeded = 0x7e, - /// - /// SS error indicating resources not available in the network. - /// - ResourceUnavailable = 0x7f, - /// - /// SS error indicating resources not available in the network. - /// - RejectedByCallControl = 0x80, - /// - /// SS operation timer expired on the network. - /// - TimerExpire, - /// - /// SS operation is not allowed by the network. - /// - NotAllowed, - /// - /// SS error indicating an unknown error. - /// - UnknownError, - /// - /// If OEM does not support any SS requests, then this error will be returned. - /// - OemNotSupported - } - - /// - /// Enumeration for SS info type. - /// - public enum SsInfoType - { - /// - /// Barring. - /// - Barring = 0x00, - /// - /// Forwarding. - /// - Forwarding, - /// - /// Waiting. - /// - Waiting, - /// - /// CLI. - /// - Cli, - /// - /// Send Ussd. - /// - SendUssd, - /// - /// Max value. - /// - Max - } - - /// - /// Enumeration for the call barring operation mode. - /// - public enum SsBarringMode - { - /// - /// Activate call barring. - /// - Activate, - /// - /// Deactivate call barring. - /// - Deactivate - } - - /// - /// Enumeration for the forward mode. - /// - public enum SsForwardMode - { - /// - /// Deactivate call forwarding. - /// - Disable, - /// - /// Activate call forwarding. - /// - Enable, - /// - /// Register call forwarding. - /// - Registration, - /// - /// Deregister call forwarding. - /// - Erasure - } - - /// - /// Enumeration for the call waiting mode. - /// - public enum SsCallWaitingMode - { - /// - /// Activate call waiting. - /// - Activate, - /// - /// Deactivate call waiting. - /// - Deactivate - } - - /// - /// Enumeration for the types of identity presentation / restriction services. - /// - public enum SsLineIdentificationType - { - /// - /// Identify the party calling this phone. - /// - CallingLinePresentation = 0x01, - /// - /// Hide the identity of this phone when calling others. - /// - CallingLineRestriction, - /// - /// Identify the party to whom the calling party (this phone) is connected. 3GPP(GSM/UMTS/LTE) Specific. - /// - ConnectedLinePresentation, - /// - /// Restrict yourself from being identified by incoming calls, such as forwarded calls. 3GPP(GSM/UMTS/LTE) Specific. - /// - ConnectedLineRestriction, - /// - /// Called line identity presentation. 3GPP(GSM/UMTS/LTE) Specific. - /// - CalledLinePresentation, - /// - /// Calling Name Presentation. 3GPP(GSM/UMTS/LTE) Specific. - /// - CallingNamePresentation - } - - /// - /// Enumeration for the USSD indication type. Applicable to 3GPP(GSM/UMTS/LTE) only. - /// - public enum SsUssdStatus - { - /// - /// Notify : to display USSD data to the user. - /// - Notify = 0x00, - /// - /// No further user action required. - /// - NoActionRequire = 0x01, - /// - /// Further user action required. - /// - ActionRequire = 0x02, - /// - /// USSD terminated by the network. - /// - TerminatedByNetwork = 0x03, - /// - /// Other local client has responded. - /// - OtherClient = 0x04, - /// - /// Operation not supported. - /// - NotSupport = 0x05, - /// - /// Time out when there is no response from the network. - /// - TimeOut = 0x06 - } -} diff --git a/src/Tizen.Tapi/Tizen.Tapi/SsStructs.cs b/src/Tizen.Tapi/Tizen.Tapi/SsStructs.cs deleted file mode 100755 index 302a6b5a6..000000000 --- a/src/Tizen.Tapi/Tizen.Tapi/SsStructs.cs +++ /dev/null @@ -1,312 +0,0 @@ -/* - * 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.Collections.Generic; -using System.Runtime.InteropServices; -using System.Text; - -namespace Tizen.Tapi -{ - [StructLayout(LayoutKind.Sequential)] - internal struct SsBarringInfoStruct - { - internal SsClass Class; - internal SsBarringMode Mode; - internal SsBarringType Type; - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 4)] - internal string Password; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct SsBarringRecordStruct - { - internal SsClass Class; - internal SsStatus Status; - internal SsBarringType Type; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct SsBarringResponseStruct - { - internal int RecordNum; - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 5, ArraySubType = UnmanagedType.LPStruct)] - internal SsBarringRecordStruct[] Record; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct SsUssdMsgInfoStruct - { - internal SsUssdType Type; - internal byte Dcs; - internal int Length; - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 208)] - internal string UssdString; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct SsUssdResponseStruct - { - internal SsUssdType Type; - internal SsUssdStatus Status; - internal byte Dcs; - internal int Length; - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 208)] - internal string UssdString; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct SsReleaseCompleteMsgStruct - { - internal byte MsgLength; - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 260)] - internal string Message; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct SsWaitingInfoStruct - { - internal SsClass Class; - internal SsCallWaitingMode Mode; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct SsWaitingRecordStruct - { - internal SsClass Class; - internal SsStatus Status; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct SsWaitingResponseStruct - { - internal int RecordNum; - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 5, ArraySubType = UnmanagedType.LPStruct)] - internal SsWaitingRecordStruct[] Record; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct SsForwardInfoStruct - { - internal SsClass Class; - internal SsForwardMode Mode; - internal SsForwardCondition Condition; - internal SsNoReplyTime NoReplyTimer; - internal SsForwardTypeOfNumber Ton; - internal SsForwardNumberingPlanIdentity Npi; - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 82)] - internal string PhoneNumber; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct SsForwardRecordStruct - { - internal SsClass Class; - internal SsStatus Status; - internal SsForwardCondition Condition; - internal int IsForwardingNumPresent; - internal SsNoReplyTime NoReplyTime; - internal SsForwardTypeOfNumber Ton; - internal SsForwardNumberingPlanIdentity Npi; - [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 83)] - internal string ForwardingNum; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct SsForwardResponseStruct - { - internal int RecordNum; - [MarshalAs(UnmanagedType.ByValArray, SizeConst = 5, ArraySubType = UnmanagedType.LPStruct)] - internal SsForwardRecordStruct[] Record; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct SsInfoStruct - { - internal SsCause Cause; - internal SsInfoType Type; - } - - [StructLayout(LayoutKind.Sequential)] - internal struct SsCliResponseStruct - { - internal SsLineIdentificationType Type; - internal SsCliStatus Status; - } - - internal static class SsStructConversions - { - internal static SsForwardRecord ConvertSsForwardRecordStruct(SsForwardRecordStruct recordStruct) - { - SsForwardRecord record = new SsForwardRecord(); - record.SsClass = recordStruct.Class; - record.SsStatus = recordStruct.Status; - record.Condition = recordStruct.Condition; - if (recordStruct.IsForwardingNumPresent == 1) - { - record.IsNumPresent = true; - } - - else if (recordStruct.IsForwardingNumPresent == 0) - { - record.IsNumPresent = false; - } - - record.NoReply = recordStruct.NoReplyTime; - record.Type = recordStruct.Ton; - record.NumIdPlan = recordStruct.Npi; - record.ForwardNum = recordStruct.ForwardingNum; - return record; - } - - internal static SsUssdMsgInfo ConvertSsMsgStruct(SsUssdMsgInfoStruct msgStruct) - { - SsUssdMsgInfo info = new SsUssdMsgInfo(); - info.Length = msgStruct.Length; - info.Dcs = msgStruct.Dcs; - info.UssdString = msgStruct.UssdString; - info.Type = msgStruct.Type; - return info; - } - - internal static SsReleaseCompleteMsgInfo ConvertReleaseMsgStruct(SsReleaseCompleteMsgStruct msgStruct) - { - SsReleaseCompleteMsgInfo info = new SsReleaseCompleteMsgInfo(); - info.Length = msgStruct.MsgLength; - info.Msg = Encoding.ASCII.GetBytes(msgStruct.Message); - return info; - } - - internal static SsForwardResponse ConvertForwardRspStruct(SsForwardResponseStruct responseStruct) - { - SsForwardResponse info = new SsForwardResponse(); - List recordList = new List(); - foreach (SsForwardRecordStruct item in responseStruct.Record) - { - recordList.Add(ConvertSsForwardRecordStruct(item)); - } - - info.RecordNum = responseStruct.RecordNum; - info.RecordList = recordList; - return info; - } - - internal static SsBarringResponse ConvertBarringRspStruct(SsBarringResponseStruct responseStruct) - { - SsBarringResponse info = new SsBarringResponse(); - List barringList = new List(); - foreach (SsBarringRecordStruct item in responseStruct.Record) - { - SsBarringRecord record = new SsBarringRecord(); - record.SsClass = item.Class; - record.SsStatus = item.Status; - record.SsType = item.Type; - barringList.Add(record); - } - - info.RecordNum = responseStruct.RecordNum; - info.RecordList = barringList; - return info; - } - - internal static SsWaitingResponse ConvertWaitingRspStruct(SsWaitingResponseStruct responseStruct) - { - SsWaitingResponse info = new SsWaitingResponse(); - List waitingList = new List(); - foreach (SsWaitingRecordStruct item in responseStruct.Record) - { - SsWaitingRecord record = new SsWaitingRecord(); - record.SsClass = item.Class; - record.SsStatus = item.Status; - waitingList.Add(record); - } - - info.RecordNum = responseStruct.RecordNum; - info.RecordList = waitingList; - return info; - } - - internal static SsInfo ConvertInfoStruct(SsInfoStruct infoStruct) - { - SsInfo info = new SsInfo(); - info.Cse = infoStruct.Cause; - info.Type = infoStruct.Type; - return info; - } - - internal static SsCliResponse ConvertSsCliResponseStruct(SsCliResponseStruct responseStruct) - { - SsCliResponse response = new SsCliResponse(); - response.LineType = responseStruct.Type; - response.CliStatus = responseStruct.Status; - return response; - } - - internal static SsUssdResponse ConvertSsUssdResponseStruct(SsUssdResponseStruct responseStruct) - { - SsUssdResponse response = new SsUssdResponse(); - response.UssdType = responseStruct.Type; - response.UssdStatus = responseStruct.Status; - response.DcsInfo = responseStruct.Dcs; - response.UssdLength = responseStruct.Length; - response.UssdInfo = responseStruct.UssdString; - return response; - } - } - - internal static class SsClassConversions - { - internal static SsBarringInfoStruct ConvertSsBarringInfo(SsBarringInfo info) - { - SsBarringInfoStruct barringStruct = new SsBarringInfoStruct(); - barringStruct.Class = info.Class; - barringStruct.Mode = info.Mode; - barringStruct.Type = info.Type; - barringStruct.Password = info.Password; - return barringStruct; - } - - internal static SsForwardInfoStruct ConvertSsForwardInfo(SsForwardInfo info) - { - SsForwardInfoStruct forwardStruct = new SsForwardInfoStruct(); - forwardStruct.Class = info.Class; - forwardStruct.Mode = info.Mode; - forwardStruct.Condition = info.Condition; - forwardStruct.NoReplyTimer = info.NoReplyTimer; - forwardStruct.Ton = info.Ton; - forwardStruct.Npi = info.Npi; - forwardStruct.PhoneNumber = info.PhoneNumber; - return forwardStruct; - } - - internal static SsWaitingInfoStruct ConvertSsWaitingInfo(SsWaitingInfo info) - { - SsWaitingInfoStruct waitingStruct = new SsWaitingInfoStruct(); - waitingStruct.Class = info.Class; - waitingStruct.Mode = info.Mode; - return waitingStruct; - } - - internal static SsUssdMsgInfoStruct ConvertSsUssdMsgInfo(SsUssdMsgInfo info) - { - SsUssdMsgInfoStruct msgStruct = new SsUssdMsgInfoStruct(); - msgStruct.Type = info.Type; - msgStruct.Dcs = info.Dcs; - msgStruct.Length = info.Length; - msgStruct.UssdString = info.UssdString; - return msgStruct; - } - } -} diff --git a/src/Tizen.Tapi/Tizen.Tapi/TapiEnumerations.cs b/src/Tizen.Tapi/Tizen.Tapi/TapiEnumerations.cs deleted file mode 100755 index f08e736c1..000000000 --- a/src/Tizen.Tapi/Tizen.Tapi/TapiEnumerations.cs +++ /dev/null @@ -1,621 +0,0 @@ -/* - * 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. - */ - -namespace Tizen.Tapi -{ - /// - /// Enumerations for the types of Notification. - /// - public enum Notification - { - /// - /// Voice call idle status notification. - /// - /// Instance of CallIdleStatusNotificationData will be stored in Data property of NotificationChangedEventArgs. - IdleVoiceCall, - /// - /// Voice call active status notification. - /// - /// Active call Id will be stored in Data property of NotificationChangedEventArgs. - ActiveVoiceCall, - /// - /// Voice call held status notification. - /// - /// Held call Id will be stored in Data property of NotificationChangedEventArgs. - HeldVoiceCall, - /// - /// Voice call dialing status notification. - /// - /// Dialing call Id will be stored in Data property of NotificationChangedEventArgs. - DialingVoiceCall, - /// - /// Voice call alerting status notification. - /// - /// Alert call Id will be stored in Data property of NotificationChangedEventArgs. - AlertVoiceCall, - /// - /// Voice call incoming status notification. - /// - /// Instance of CallIncomingInfo will be stored in Data property of NotificationChangedEventArgs. - IncomingVoiceCall, - /// - /// Video call idle status notification. - /// - /// Instance of CallIdleStatusNotificationData will be stored in Data property of NotificationChangedEventArgs. - IdleVideoCall, - /// - /// Video call active status notification. - /// - /// Active call Id will be stored in Data property of NotificationChangedEventArgs. - ActiveVideoCall, - /// - /// Video call dialing status notification. - /// - /// Dialing call Id will be stored in Data property of NotificationChangedEventArgs. - DialingVideoCall, - /// - /// Video call alerting status notification. - /// - /// Alert call Id will be stored in Data property of NotificationChangedEventArgs. - AlertVideoCall, - /// - /// Video call incoming status notification. - /// - /// Instance of CallIncomingInfo will be stored in Data property of NotificationChangedEventArgs. - IncomingVideoCall, - /// - /// Outgoing call waiting nofificaiton. - /// - /// Waiting call Id will be stored in Data property of NotificationChangedEventArgs. - WaitingCallInfo, - /// - /// Outgoing call forwarded notification. - /// - /// Forward call Id will be stored in Data property of NotificationChangedEventArgs. - ForwardCallInfo, - /// - /// Incoming call barred notification. - /// - /// Barred incoming call Id will be stored in Data property of NotificationChangedEventArgs. - BarredIncomingCallInfo, - /// - /// Outgoing call barred notification. - /// - /// Barred outgoing call Id will be stored in Data property of NotificationChangedEventArgs. - BarredOutgoingCallInfo, - /// - /// Mo call deflected notification. - /// - /// Nothing is stored in Data property of NotificationChangedEventArgs. - DeflectCallInfo, - /// - /// CLIR suppression reject notification. - /// - /// Nothing is stored in Data property of NotificationChangedEventArgs. - ClirCallInfo, - /// - /// Unconditional call forward active notification. - /// - /// Unconditional forward call Id will be stored in Data property of NotificationChangedEventArgs. - ForwardUnconditionalCallInfo, - /// - /// Conditional call forward active notification. - /// - /// Conditional forward call Id will be stored in Data property of NotificationChangedEventArgs. - ForwardConditionalCallInfo, - /// - /// Incoming call forwarded notification. - /// - /// Forward call Id will be stored in Data property of NotificationChangedEventArgs. - ForwardedCallInfo, - /// - /// MT deflected call notification. - /// - /// Nothing is stored in Data property of NotificationChangedEventArgs. - DeflectedCallInfo, - /// - /// MT transferred call notification. - /// - /// Nothing is stored in Data property of NotificationChangedEventArgs. - TransferredCallInfo, - /// - /// Call is in held notification. - /// - /// Held call Id will be stored in Data property of NotificationChangedEventArgs. - HeldCallInfo, - /// - /// Call is in retrieved notificaiton. - /// - /// Active call Id will be stored in Data property of NotificationChangedEventArgs. - ActiveCallInfo, - /// - /// Call in in multiparty notificaiton. - /// - /// Joined call Id will be stored in Data property of NotificationChangedEventArgs. - JoinedCallInfo, - /// - /// Call transfer alerting notificaiton. - /// - /// Nothing is stored in Data property of NotificationChangedEventArgs. - TransferAlertCallInfo, - /// - /// Call forward check message notification. - /// - /// Nothing is stored in Data property of NotificationChangedEventArgs. - CfCheckMessageCallInfo, - /// - /// New call information notification (CDMA only). - /// - /// Instance of CallRecord will be stored in Data property of NotificationChangedEventArgs. - RecCallInfo, - /// - /// Call info fallback notification. - /// - /// Nothing is stored in Data property of NotificationChangedEventArgs. - FallbackCallInfo, - /// - /// Voice privacy mode change notification (CDMA only). - /// - /// CallPrivacyMode will be stored in Data property of NotificationChangedEventArgs. - PrivacyModeCall, - /// - /// OTASP(Over The Air Service Provisioning) status notification (CDMA only). - /// - /// CallOtaspStatus will be stored in Data property of NotificationChangedEventArgs. - OtaspCall, - /// - /// OTAPA(Over The Air Parameter Administration) status notification (CDMA only). - /// - /// CallOtapaStatus will be stored in Data property of NotificationChangedEventArgs. - OtapaCall, - /// - /// Call signal information notification (CDMA only). - /// - /// Instance of CallSignalNotification will be stored in Data property of NotificationChangedEventArgs. - CallSignalInfo, - /// - /// Call sound patch change notification. - /// - /// SoundPath will be stored in Data property of NotificationChangedEventArgs. - CallSoundPath, - /// - /// Call ringback tone sound patch change notification. - /// - /// CallSoundRingbackNoti will be stored in Data property of NotificationChangedEventArgs. - CallSoundRingbackTone, - /// - /// Call sound WB-AMR(Wide Band Adaptive Multi-Rate) status notification. - /// - /// CallSoundWbamrNoti will be stored in Data property of NotificationChangedEventArgs. - CallSoundWbamr, - /// - /// Call sound noise reduction notification. - /// - /// CallSoundNoiseReduction will be stored in Data property of NotificationChangedEventArgs. - CallSoundNoiceReduction, - /// - /// Call sound clock status notification. - /// - /// Boolean status value will be stored in Data property of NotificationChangedEventArgs. - CallSoundClock, - /// - /// Preferred voice subscription notification. - /// - /// CallPreferredVoiceSubscription will be stored in Data property of NotificationChangedEventArgs. - CallPreferredVoiceSubscription, - /// - /// VoLTE call which can provide upgrade/downgrade - caller/callee are all in VoLTE call. - /// - /// Nothing is stored in Data property of NotificationChangedEventArgs. - CallModifiableInfo, - /// - /// VoLTE call for which upgrade call request is initiated from MT. - /// - /// CallUpgradeDowngradeRequestNoti will be stored in Data property of NotificationChangedEventArgs. - CallupgradeRequested, - /// - /// VoLTE call for which downgrade call request is initiated from MT. - /// - /// CallUpgradeDowngradeRequestNoti will be stored in Data property of NotificationChangedEventArgs. - CallDowngraded, - /// - /// Modem power notification. - /// - /// PhonePowerStatus will be stored in Data property of NotificationChangedEventArgs. - ModemPower, - /// - /// SIM status notification. - /// - /// SimCardStatus will be stored in Data property of NotificationChangedEventArgs. - SimStatus, - /// - /// SIM refresh notification. - /// - /// SatCmdQualiRefresh will be stored in Data property of NotificationChangedEventArgs. - SimRefreshed, - /// - /// Sap card status notification. - /// - /// SatCmdQualiRefresh will be stored in Data property of NotificationChangedEventArgs. - SapStatus, - /// - /// Sap disconnect type notification. - /// - SapDisconnect, - /// - /// Sat setup menu notification. - /// - /// Instance of SatMainMenuInfo will be stored in Data property of NotificationChangedEventArgs. - SatSetupMenu, - /// - /// Sat display text notification. - /// - /// Instance of SatDisplayTextData will be stored in Data property of NotificationChangedEventArgs. - SatDisplayText, - /// - /// Sat select item notification. - /// - /// Instance of SatSelectItemData will be stored in Data property of NotificationChangedEventArgs. - SatSelectItem, - /// - /// Sat get inkey notification. - /// - /// Instance of SatGetInKeyData will be stored in Data property of NotificationChangedEventArgs. - SatGetInKey, - /// - /// Sat get input notification. - /// - /// Instance of SatGetInputData will be stored in Data property of NotificationChangedEventArgs. - SatGetInput, - /// - /// Sat refresh notification. - /// - /// Instance of SatRefreshData will be stored in Data property of NotificationChangedEventArgs. - SatRefresh, - /// - /// Sat send sms notification. - /// - /// Instance of SatSendSmsData will be stored in Data property of NotificationChangedEventArgs. - SatSendSms, - /// - /// Sat setup event list notification. - /// - /// Instance of SatEventListData will be stored in Data property of NotificationChangedEventArgs. - SatSetupEventList, - /// - /// Sat send dtmf notification. - /// - /// Instance of SatSendDtmfData will be stored in Data property of NotificationChangedEventArgs. - SatSendDtmf, - /// - /// Sat end proactive session notification. - /// - /// SatCommandType will be stored in Data property of NotificationChangedEventArgs. - SatEndProactiveSession, - /// - /// Sat call control result notification. - /// - /// Instance of SatCallCtrlConfirmData will be stored in Data property of NotificationChangedEventArgs. - SatCallControlResult, - /// - /// Sat mo sms control result notification. - /// - /// Instance of SatMoSmsCtrlData will be stored in Data property of NotificationChangedEventArgs. - SatMoSmControlResult, - /// - /// Sat setup call notification. - /// - /// Instance of SatSetupCallData will be stored in Data property of NotificationChangedEventArgs. - SatSetupCall, - /// - /// Sat send SS notification. - /// - /// Instance of SatSendSsData will be stored in Data property of NotificationChangedEventArgs. - SatSendSs, - /// - /// Sat setup USSD notification. - /// - /// Instance of SatSetupUssdData will be stored in Data property of NotificationChangedEventArgs. - SatSetupUssd, - /// - /// Phonebook status notification. - /// - /// Instance of SimPhonebookStatus will be stored in Data property of NotificationChangedEventArgs. - PhonebookStatus, - /// - /// Phonebook change notification. - /// - /// Instance of PhonebookContactChangeInfo will be stored in Data property of NotificationChangedEventArgs. - PhonebookContactChange, - /// - /// Network registration status notification. - /// - /// Instance of NetworkRegistrationStatus will be stored in Data property of NotificationChangedEventArgs. - NetworkRegistrationStatus, - /// - /// Network cell information notification. - /// - /// Instance of NetworkCellNoti will be stored in Data property of NotificationChangedEventArgs. - NetworkCellInfo, - /// - /// Network change notification. - /// - /// Instance of NetworkChangeNoti will be stored in Data property of NotificationChangedEventArgs. - NetworkChange, - /// - /// Network time information notification. - /// - /// Instance of NetworkTimeNoti will be stored in Data property of NotificationChangedEventArgs. - NetworkTimeInfo, - /// - /// Network identity notification. - /// - /// Instance of NetworkIdentityNoti will be stored in Data property of NotificationChangedEventArgs. - NetworkIdentity, - /// - /// Network signal strength notification. - /// - /// Signal Strength in dBm will be stored in Data property of NotificationChangedEventArgs. - NetworkSignalStrength, - /// - /// Network emergency callback mode notification. - /// - /// NetworkEmergencyCallbackMode will be stored in Data property of NotificationChangedEventArgs. - NetworkEmergencyCallbackMode, - /// - /// Network default data subscription notification. - /// - /// NetworkDefaultDataSubscription will be stored in Data property of NotificationChangedEventArgs. - NetworkDefaultDataSubscription, - /// - /// Network default subscription notification. - /// - /// NetworkDefaultSubscription will be stored in Data property of NotificationChangedEventArgs. - NetworkDefaultSubscription, - /// - /// Network cell ID. - /// - /// Int value will be stored in Data property of NotificationChangedEventArgs. - NetworkCellId, - /// - /// Network LAC (Location Area Code). - /// - /// Int value will be stored in Data property of NotificationChangedEventArgs. - NetworkLac, - /// - /// Network TAC (Tracking Area Code). - /// - /// Int value will be stored in Data property of NotificationChangedEventArgs. - NetworkTac, - /// - /// Network system ID. - /// - /// Int value will be stored in Data property of NotificationChangedEventArgs. - NetworkSystemId, - /// - /// Network network ID. - /// - /// Int value will be stored in Data property of NotificationChangedEventArgs. - NetworkNetworkId, - /// - /// Network base station ID. - /// - /// Int value will be stored in Data property of NotificationChangedEventArgs. - NetworkBsId, - /// - /// Network base station latitude. - /// - /// Int value will be stored in Data property of NotificationChangedEventArgs. - NetworkBsLatitude, - /// - /// Network base station longitude. - /// - /// Int value will be stored in Data property of NotificationChangedEventArgs. - NetworkBsLongitude, - /// - /// Network VoLTE status notification. - /// - /// Instance of NetworkVolteStatus will be stored in Data property of NotificationChangedEventArgs. - NetworkVolteStatus, - /// - /// Network EPDG status notification. - /// - /// Boolean value will be stored in Data property of NotificationChangedEventArgs. - NetworkEpdgStatus, - /// - /// Ss ussd receive notification. - /// - /// Instance of SsUssdMsgInfo will be stored in Data property of NotificationChangedEventArgs. - SsUssd, - /// - /// Ss release complete notification. - /// - /// Instance of SsReleaseCompleteMsgInfo will be stored in Data property of NotificationChangedEventArgs. - SsReleaseComplete, - /// - /// Ss call forwarding status notification. - /// - /// Instance of SsForwardResponse will be stored in Data property of NotificationChangedEventArgs. - SsNotifyForwarding, - /// - /// Ss call barring status notification. - /// - /// Instance of SsBarringResponse will be stored in Data property of NotificationChangedEventArgs. - SsNotifyBarring, - /// - /// Ss call waiting status notification. - /// - /// Instance of SsWaitingResponse will be stored in Data property of NotificationChangedEventArgs. - SsNotifyWaiting, - /// - /// Ss information notification. - /// - /// Instance of SsInfo will be stored in Data property of NotificationChangedEventArgs. - SsNotifyInfo, - /// - /// Sms incoming message notification. - /// - /// Instance of SmsIncomingMessageNoti will be stored in Data property of NotificationChangedEventArgs. - SmsIncomingMsg, - /// - /// Sms cell broadcast message incoming notification. - /// - /// Instance of SmsIncomingCbMessageNoti will be stored in Data property of NotificationChangedEventArgs. - SmsIncomingCbMsg, - /// - /// Sms ETWS(Earthquake and Tsunami Warning System) message incoming notification. - /// - /// Instance of SmsIncomingEtwsMessageNoti will be stored in Data property of NotificationChangedEventArgs. - SmsIncomingEtwsMsg, - /// - /// Sms device memory status notification. - /// - /// SmsMemoryStatus will be stored in Data property of NotificationChangedEventArgs. - SmsMemoryStatus, - /// - /// Sms ready notification. - /// - /// SmsReadyStatus will be stored in Data property of NotificationChangedEventArgs. - SmsReady, - /// - /// Oem data notification. - /// - /// Instance of OemData will be stored in Data property of NotificationChangedEventArgs. - OemData - } - - /// - /// Enumerations for the types of property definition. - /// - public enum Property - { - /// - /// Modem power property. - /// - /// PhonePowerStatus will be stored in Property property of PropertyChangedEventArgs. - ModemPower, - /// - /// Modem dongle status property. - /// - /// Boolean value will be stored in Property property of PropertyChangedEventArgs. - ModemDongleStatus, - /// - /// Modem dongle login property. - /// - /// Boolean value will be stored in Property property of PropertyChangedEventArgs. - ModemDongleLogin, - /// - /// SIM call forward state property. - /// - /// Boolean value will be stored in Property property of PropertyChangedEventArgs. - SimCallForwardState, - /// - /// Network LAC (Location Area Code) property. - /// - /// Unsigned int value will be stored in Property property of PropertyChangedEventArgs. - NetworkLac, - /// - /// Network TAC (Tracking Area Code) property (for LTE network). - /// - /// Unsigned int value will be stored in Property property of PropertyChangedEventArgs. - NetworkTac, - /// - /// Network PLMN property. - /// - /// String value will be stored in Property property of PropertyChangedEventArgs. - NetworkPlmn, - /// - /// Network cell-id property. - /// - /// Unsigned int value will be stored in Property property of PropertyChangedEventArgs. - NetworkCellId, - /// - /// Network physical cell-id property. - /// - /// Unsigned int value will be stored in Property property of PropertyChangedEventArgs. - NetworkPhysicalCellId, - /// - /// Network service type property. - /// - /// NetworkServiceType will be stored in Property property of PropertyChangedEventArgs. - NetworkServiceType, - /// - /// Network access technology property. - /// - /// NetworkSystemType will be stored in Property property of PropertyChangedEventArgs. - NetworkAct, - /// - /// Network ps type property. - /// - /// NetworkPsType will be stored in Property property of PropertyChangedEventArgs. - NetworkPsType, - /// - /// Network circuit status property. - /// - /// NetworkServiceLevel will be stored in Property property of PropertyChangedEventArgs. - NetworkCircuitStatus, - /// - /// Network packet status property. - /// - /// NetworkServiceLevel will be stored in Property property of PropertyChangedEventArgs. - NetworkPacketStatus, - /// - /// Network roaming status property. - /// - /// Boolean value will be stored in Property property of PropertyChangedEventArgs. - NetworkRoamingStatus, - /// - /// Network name option property. - /// - /// NetworkNameDisplayCondition will be stored in Property property of PropertyChangedEventArgs. - NetworkNameOption, - /// - /// Network name property. - /// - /// String value will be stored in Property property of PropertyChangedEventArgs. - NetworkName, - /// - /// SPN name property stored in SIM card. - /// - /// String value will be stored in Property property of PropertyChangedEventArgs. - NetworkSpnName, - /// - /// Network signal dbm property. - /// - /// Int value will be stored in Property property of PropertyChangedEventArgs. - NetworkSignalDbm, - /// - /// Network signal level property. - /// - /// Int value will be stored in Property property of PropertyChangedEventArgs. - NetworkSignalLevel, - /// - /// Network ims voice support status property. - /// - /// Boolean value will be stored in Property property of PropertyChangedEventArgs. - NetworkImsVoiceStatus, - /// - /// Network volte enable status notification. - /// - /// VolteNetworkType will be stored in Property property of PropertyChangedEventArgs. - NetworkVolteEnable, - /// - /// Network serving LTE band property. - /// - /// NetworkLteBandType will be stored in Property property of PropertyChangedEventArgs. - NetworkLteBand - } -} diff --git a/src/Tizen.Tapi/Tizen.Tapi/TapiEventArgs.cs b/src/Tizen.Tapi/Tizen.Tapi/TapiEventArgs.cs deleted file mode 100755 index 08d5520ec..000000000 --- a/src/Tizen.Tapi/Tizen.Tapi/TapiEventArgs.cs +++ /dev/null @@ -1,118 +0,0 @@ -/* - * 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.Tapi -{ - /// - /// An extended EventArgs class which contains changed tapi state. - /// - public class StateChangedEventArgs : EventArgs - { - private int _state; - - internal StateChangedEventArgs(int state) - { - _state = state; - } - - /// - /// Tapi ready state. - /// - public int State - { - get - { - return _state; - } - } - } - - /// - /// An extended EventArgs class which contains changed TAPI notification. - /// - public class NotificationChangedEventArgs : EventArgs - { - private Notification _id; - private object _data; - - internal NotificationChangedEventArgs(Notification id, object data) - { - _id = id; - _data = data; - } - - /// - /// Notification Id. - /// - public Notification Id - { - get - { - return _id; - } - } - - /// - /// Notification data. - /// - public object Data - { - get - { - return _data; - } - } - } - - /// - /// An extended EventArgs class which contains changed TAPI property. - /// - public class PropertyChangedEventArgs : EventArgs - { - private Property _property; - private object _data; - - internal PropertyChangedEventArgs(Property property, object data) - { - _property = property; - _data = data; - } - - /// - /// Property definition type. - /// - public Property Property - { - get - { - return _property; - } - } - - /// - /// Property data. - /// - public object Data - { - get - { - return _data; - } - } - } -} diff --git a/src/Tizen.Tapi/Tizen.Tapi/TapiHandle.cs b/src/Tizen.Tapi/Tizen.Tapi/TapiHandle.cs deleted file mode 100755 index 51b1a2e47..000000000 --- a/src/Tizen.Tapi/Tizen.Tapi/TapiHandle.cs +++ /dev/null @@ -1,685 +0,0 @@ -/* - * 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.Collections.Generic; -using System.Runtime.InteropServices; - -namespace Tizen.Tapi -{ - /// - /// This class is used for managing event callbacks for notifications and properties. - /// - public class TapiHandle - { - internal IntPtr _handle = IntPtr.Zero; - private event EventHandler _notificationChanged; - private event EventHandler _propertyChanged; - - private List _notificationChangedCbList = new List(); - private Interop.Tapi.TapiNotificationCallback _notificationChangedCb; - - /// - /// This event is called for the TAPI notification change. - /// - public event EventHandler NotificationChanged - { - add - { - _notificationChanged += value; - } - - remove - { - _notificationChanged -= value; - } - } - - /// - /// This event is called for the TAPI property change. - /// - public event EventHandler PropertyChanged - { - add - { - _propertyChanged += value; - } - - remove - { - _propertyChanged -= value; - } - } - - internal TapiHandle(IntPtr handle) - { - _handle = handle; - } - - /// - /// Registers a notification callback for notification change events on DBus interface. - /// - /// Notification id for which a callback has to be registered. - /// http://tizen.org/feature/network.telephony - /// Thrown when telephony feature is not supported. - /// Thrown when it is failed due to invalid parameter. - /// Thrown when it is failed due to invalid operation. - public void RegisterNotiEvent(Notification id) - { - _notificationChangedCb = (IntPtr handle, IntPtr notiIdPtr, IntPtr data, IntPtr userData) => - { - if (_notificationChanged != null) - { - string notiId = null; - object notiData = null; - Notification noti = default(Notification); - if (notiIdPtr != IntPtr.Zero) - { - notiId = Marshal.PtrToStringAnsi(notiIdPtr); - foreach (Notification n in Enum.GetValues(typeof(Notification))) - { - if (notiId == TapiUtility.ConvertNotiToString(n)) - { - noti = n; - break; - } - } - } - - switch (noti) - { - case Notification.IdleVoiceCall: - CallIdleStatusNotiStruct voiceIdleStatusNoti = Marshal.PtrToStructure(data); - notiData = CallStructConversions.ConvertCallIdleStatusNoti(voiceIdleStatusNoti); - break; - case Notification.ActiveVoiceCall: - notiData = (uint)Marshal.ReadInt32(data); - break; - case Notification.HeldVoiceCall: - notiData = (uint)Marshal.ReadInt32(data); - break; - case Notification.DialingVoiceCall: - notiData = (uint)Marshal.ReadInt32(data); - break; - case Notification.AlertVoiceCall: - notiData = (uint)Marshal.ReadInt32(data); - break; - case Notification.IncomingVoiceCall: - CallIncomingInfoStruct callIncomingInfo = Marshal.PtrToStructure(data); - notiData = CallStructConversions.ConvertIncomingCallInfo(callIncomingInfo); - break; - case Notification.IdleVideoCall: - CallIdleStatusNotiStruct videoIdleStatus = Marshal.PtrToStructure(data); - notiData = CallStructConversions.ConvertCallIdleStatusNoti(videoIdleStatus); - break; - case Notification.ActiveVideoCall: - notiData = (uint)Marshal.ReadInt32(data); - break; - case Notification.DialingVideoCall: - notiData = (uint)Marshal.ReadInt32(data); - break; - case Notification.AlertVideoCall: - notiData = (uint)Marshal.ReadInt32(data); - break; - case Notification.IncomingVideoCall: - CallIncomingInfoStruct videoIncomingInfo = Marshal.PtrToStructure(data); - notiData = CallStructConversions.ConvertIncomingCallInfo(videoIncomingInfo); - break; - case Notification.WaitingCallInfo: - notiData = (uint)Marshal.ReadInt32(data); - break; - case Notification.ForwardCallInfo: - notiData = (uint)Marshal.ReadInt32(data); - break; - case Notification.BarredIncomingCallInfo: - notiData = (uint)Marshal.ReadInt32(data); - break; - case Notification.BarredOutgoingCallInfo: - notiData = (uint)Marshal.ReadInt32(data); - break; - case Notification.ForwardUnconditionalCallInfo: - notiData = (uint)Marshal.ReadInt32(data); - break; - case Notification.ForwardConditionalCallInfo: - notiData = (uint)Marshal.ReadInt32(data); - break; - case Notification.ForwardedCallInfo: - notiData = (uint)Marshal.ReadInt32(data); - break; - case Notification.HeldCallInfo: - notiData = (uint)Marshal.ReadInt32(data); - break; - case Notification.ActiveCallInfo: - notiData = (uint)Marshal.ReadInt32(data); - break; - case Notification.JoinedCallInfo: - notiData = (uint)Marshal.ReadInt32(data); - break; - case Notification.RecCallInfo: - CallRecordStruct recordStruct = Marshal.PtrToStructure(data); - notiData = CallStructConversions.ConvertCallRecordStruct(recordStruct); - break; - case Notification.PrivacyModeCall: - notiData = (CallPrivacyMode)Marshal.ReadInt32(data); - break; - case Notification.OtaspCall: - notiData = (CallOtaspStatus)Marshal.ReadInt32(data); - break; - case Notification.OtapaCall: - notiData = (CallOtapaStatus)Marshal.ReadInt32(data); - break; - case Notification.CallSignalInfo: - CallSignalInfoStruct signalInfoStruct = Marshal.PtrToStructure(data); - notiData = CallStructConversions.ConvertCallSignalInfo(signalInfoStruct); - break; - case Notification.CallSoundPath: - notiData = (SoundPath)Marshal.ReadInt32(data); - break; - case Notification.CallSoundRingbackTone: - notiData = (CallSoundRingbackNoti)Marshal.ReadInt32(data); - break; - case Notification.CallSoundWbamr: - notiData = (CallSoundWbamrNoti)Marshal.ReadInt32(data); - break; - case Notification.CallSoundNoiceReduction: - notiData = (CallSoundNoiseReduction)Marshal.ReadInt32(data); - break; - case Notification.CallSoundClock: - int status = Marshal.ReadInt32(data); - if (status == 1) - { - notiData = true; - } - - else if (status == 0) - { - notiData = false; - } - - break; - case Notification.CallPreferredVoiceSubscription: - notiData = (CallPreferredVoiceSubscription)Marshal.ReadInt32(data); - break; - case Notification.CallupgradeRequested: - CallUpgradeDowngradeNotiStruct upgradeNotiStruct = Marshal.PtrToStructure(data); - notiData = CallStructConversions.ConvertCallUpgradeNoti(upgradeNotiStruct); - break; - case Notification.CallDowngraded: - CallUpgradeDowngradeNotiStruct downgradeNotiStruct = Marshal.PtrToStructure(data); - notiData = CallStructConversions.ConvertCallUpgradeNoti(downgradeNotiStruct); - break; - case Notification.ModemPower: - notiData = (PhonePowerStatus)Marshal.ReadInt32(data); - break; - case Notification.SimStatus: - notiData = (SimCardStatus)Marshal.ReadInt32(data); - break; - case Notification.SimRefreshed: - notiData = (SatCmdQualiRefresh)Marshal.ReadInt32(data); - break; - case Notification.SatSetupMenu: - SatMainMenuInfoStruct mainMenuStruct = Marshal.PtrToStructure(data); - notiData = SatStructConversions.ConvertSatMainMenuInfoStruct(mainMenuStruct); - break; - case Notification.SatDisplayText: - SatDisplayTextStruct textStruct = Marshal.PtrToStructure(data); - notiData = SatStructConversions.ConvertSatDisplayTextStruct(textStruct); - break; - case Notification.SatSelectItem: - SatSelectItemStruct itemStruct = Marshal.PtrToStructure(data); - notiData = SatStructConversions.ConvertSatSelectItemStruct(itemStruct); - break; - case Notification.SatGetInKey: - SatGetInKeyStruct inKeyStruct = Marshal.PtrToStructure(data); - notiData = SatStructConversions.ConvertSatGetInKeyStruct(inKeyStruct); - break; - case Notification.SatGetInput: - SatGetInputStruct inputStruct = Marshal.PtrToStructure(data); - notiData = SatStructConversions.ConvertSatGetInputStruct(inputStruct); - break; - case Notification.SatRefresh: - SatRefreshStruct refreshStruct = Marshal.PtrToStructure(data); - notiData = SatStructConversions.ConvertSatRefreshStruct(refreshStruct); - break; - case Notification.SatSendSms: - SatSendSmsStruct smsStruct = Marshal.PtrToStructure(data); - notiData = SatStructConversions.ConvertSatSendSmsStruct(smsStruct); - break; - case Notification.SatSetupEventList: - SatEventListDataStruct eventStruct = Marshal.PtrToStructure(data); - notiData = SatStructConversions.ConvertSatEventListStruct(eventStruct); - break; - case Notification.SatSendDtmf: - SatSendDtmfDataStruct dtmfStruct = Marshal.PtrToStructure(data); - notiData = SatStructConversions.ConvertSatSendDtmfStruct(dtmfStruct); - break; - case Notification.SatEndProactiveSession: - notiData = (SatCommandType)Marshal.ReadInt32(data); - break; - case Notification.SatCallControlResult: - SatCallCtrlIndDataStruct dataStruct = Marshal.PtrToStructure(data); - notiData = SatStructConversions.ConvertSatCallCtrlIndDataStruct(dataStruct); - break; - case Notification.SatMoSmControlResult: - SatMoSmsCtrlDataStruct moStruct = Marshal.PtrToStructure(data); - notiData = SatStructConversions.ConvertSatMoSmsCtrlDataStruct(moStruct); - break; - case Notification.SatSetupCall: - SatSetupCallDataStruct callDataStruct = Marshal.PtrToStructure(data); - notiData = SatStructConversions.ConvertSatSetupCallDataStruct(callDataStruct); - break; - case Notification.SatSendSs: - SatSendSsDataStruct ssStruct = Marshal.PtrToStructure(data); - notiData = SatStructConversions.ConvertSatSendSsDataStruct(ssStruct); - break; - case Notification.SatSetupUssd: - SatSetupUssdDataStruct ussdStruct = Marshal.PtrToStructure(data); - notiData = SatStructConversions.ConvertSatSetupUssdDataStruct(ussdStruct); - break; - case Notification.PhonebookStatus: - SimPhonebookStatusStruct statusStruct = Marshal.PtrToStructure(data); - notiData = PhonebookStructConversions.ConvertSimPhonebookStatusStruct(statusStruct); - break; - case Notification.PhonebookContactChange: - PhonebookContactChangeInfoStruct contactStruct = Marshal.PtrToStructure(data); - notiData = PhonebookStructConversions.ConvertPhonebookContactChangeStruct(contactStruct); - break; - case Notification.NetworkRegistrationStatus: - NetworkRegistrationStatusStruct nwStruct = Marshal.PtrToStructure(data); - notiData = NetworkStructConversions.ConvertNetworkRegistrationStruct(nwStruct); - break; - case Notification.NetworkCellInfo: - NetworkCellNotiStruct notiStruct = Marshal.PtrToStructure(data); - notiData = NetworkStructConversions.ConvertNetworkCellNotiStruct(notiStruct); - break; - case Notification.NetworkChange: - NetworkChangeNotiStruct changeStruct = Marshal.PtrToStructure(data); - notiData = NetworkStructConversions.ConvertNetworkChangeStruct(changeStruct); - break; - case Notification.NetworkTimeInfo: - NetworkTimeNotiStruct timeStruct = Marshal.PtrToStructure(data); - notiData = NetworkStructConversions.ConvertNetworkTimeNotiStruct(timeStruct); - break; - case Notification.NetworkIdentity: - NetworkIdentityNotiStruct idStruct = Marshal.PtrToStructure(data); - notiData = NetworkStructConversions.ConvertNetworkIdentityStruct(idStruct); - break; - case Notification.NetworkSignalStrength: - notiData = Marshal.ReadInt32(data); - break; - case Notification.NetworkEmergencyCallbackMode: - notiData = (NetworkEmergencyCallbackMode)Marshal.ReadInt32(data); - break; - case Notification.NetworkDefaultDataSubscription: - notiData = (NetworkDefaultDataSubscription)Marshal.ReadInt32(data); - break; - case Notification.NetworkDefaultSubscription: - notiData = (NetworkDefaultSubscription)Marshal.ReadInt32(data); - break; - case Notification.NetworkCellId: - notiData = Marshal.ReadInt32(data); - break; - case Notification.NetworkLac: - notiData = Marshal.ReadInt32(data); - break; - case Notification.NetworkTac: - notiData = Marshal.ReadInt32(data); - break; - case Notification.NetworkSystemId: - notiData = Marshal.ReadInt32(data); - break; - case Notification.NetworkNetworkId: - notiData = Marshal.ReadInt32(data); - break; - case Notification.NetworkBsId: - notiData = Marshal.ReadInt32(data); - break; - case Notification.NetworkBsLatitude: - notiData = Marshal.ReadInt32(data); - break; - case Notification.NetworkBsLongitude: - notiData = Marshal.ReadInt32(data); - break; - case Notification.NetworkVolteStatus: - NetworkVolteStatusStruct volteStruct = Marshal.PtrToStructure(data); - notiData = NetworkStructConversions.ConvertNetworkVolteStruct(volteStruct); - break; - case Notification.NetworkEpdgStatus: - int epdgStatus = Marshal.ReadInt32(data); - if (epdgStatus == 1) - { - notiData = true; - } - - else if (epdgStatus == 0) - { - notiData = false; - } - - break; - case Notification.SsUssd: - SsUssdMsgInfoStruct ussdInfoStruct = Marshal.PtrToStructure(data); - notiData = SsStructConversions.ConvertSsMsgStruct(ussdInfoStruct); - break; - case Notification.SsReleaseComplete: - SsReleaseCompleteMsgStruct msgStruct = Marshal.PtrToStructure(data); - notiData = SsStructConversions.ConvertReleaseMsgStruct(msgStruct); - break; - case Notification.SsNotifyForwarding: - SsForwardResponseStruct responseStruct = Marshal.PtrToStructure(data); - notiData = SsStructConversions.ConvertForwardRspStruct(responseStruct); - break; - case Notification.SsNotifyBarring: - SsBarringResponseStruct barringStruct = Marshal.PtrToStructure(data); - notiData = SsStructConversions.ConvertBarringRspStruct(barringStruct); - break; - case Notification.SsNotifyWaiting: - SsWaitingResponseStruct waitingStruct = Marshal.PtrToStructure(data); - notiData = SsStructConversions.ConvertWaitingRspStruct(waitingStruct); - break; - case Notification.SsNotifyInfo: - SsInfoStruct ssInfoStruct = Marshal.PtrToStructure(data); - notiData = SsStructConversions.ConvertInfoStruct(ssInfoStruct); - break; - case Notification.SmsIncomingMsg: - SmsIncomingMsgNotiStruct smsNotiStruct = Marshal.PtrToStructure(data); - notiData = SmsStructConversions.ConvertSmsIncomingStruct(smsNotiStruct); - break; - case Notification.SmsIncomingCbMsg: - SmsIncomingCbMsgNotiStruct smsCbStruct = Marshal.PtrToStructure(data); - notiData = SmsStructConversions.ConvertSmsIncomingCbStruct(smsCbStruct); - break; - case Notification.SmsIncomingEtwsMsg: - SmsIncomingEtwsMsgNotiStruct etwsStruct = Marshal.PtrToStructure(data); - notiData = SmsStructConversions.ConvertSmsIncomingEtwsStruct(etwsStruct); - break; - case Notification.SmsMemoryStatus: - notiData = (SmsMemoryStatus)Marshal.ReadInt32(data); - break; - case Notification.SmsReady: - notiData = (SmsReadyStatus)Marshal.ReadInt32(data); - break; - case Notification.OemData: - OemDataStruct oemStruct = Marshal.PtrToStructure(data); - notiData = OemStructConversions.ConvertOemStruct(oemStruct); - break; - } - - _notificationChanged(null, new NotificationChangedEventArgs(noti, notiData)); - } - }; - - _notificationChangedCbList.Add(_notificationChangedCb); - - int ret = Interop.Tapi.RegisterNotiEvent(_handle, TapiUtility.ConvertNotiToString(id), _notificationChangedCb, IntPtr.Zero); - if (ret != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Failed to register notification event, Error: " + (TapiError)ret); - TapiUtility.ThrowTapiException(ret, _handle); - } - } - - /// - /// Registers a notification callback for property change events on DBus interface. - /// - /// Property definition for which a callback has to be registered. - /// http://tizen.org/feature/network.telephony - /// Thrown when telephony feature is not supported. - /// Thrown when it is failed due to invalid parameter. - /// Thrown when it is failed due to invalid operation. - public void RegisterPropEvent(Property property) - { - _notificationChangedCb = (IntPtr handle, IntPtr propPtr, IntPtr data, IntPtr userData) => - { - if (_propertyChanged != null) - { - string prop = null; - object propData = null; - Property propertyId = default(Property); - if (propPtr != IntPtr.Zero) - { - prop = Marshal.PtrToStringAnsi(propPtr); - foreach (Property p in Enum.GetValues(typeof(Property))) - { - if (prop == TapiUtility.ConvertPropToString(p)) - { - propertyId = p; - break; - } - } - } - - switch (propertyId) - { - case Property.ModemPower: - propData = (PhonePowerStatus)Marshal.ReadInt32(data); - break; - case Property.ModemDongleStatus: - int dongleStatus = Marshal.ReadInt32(data); - if (dongleStatus == 1) - { - propData = true; - } - - else if (dongleStatus == 0) - { - propData = false; - } - - break; - case Property.ModemDongleLogin: - int loginStatus = Marshal.ReadInt32(data); - if (loginStatus == 1) - { - propData = true; - } - - else if (loginStatus == 0) - { - propData = false; - } - - break; - case Property.SimCallForwardState: - int forwardState = Marshal.ReadInt32(data); - if (forwardState == 1) - { - propData = true; - } - - else if (forwardState == 0) - { - propData = false; - } - - break; - case Property.NetworkLac: - propData = (uint)Marshal.ReadInt32(data); - break; - case Property.NetworkTac: - propData = (uint)Marshal.ReadInt32(data); - break; - case Property.NetworkPlmn: - propData = Marshal.PtrToStringAnsi(data); - break; - case Property.NetworkCellId: - propData = (uint)Marshal.ReadInt32(data); - break; - case Property.NetworkPhysicalCellId: - propData = (uint)Marshal.ReadInt32(data); - break; - case Property.NetworkServiceType: - propData = (NetworkServiceType)Marshal.ReadInt32(data); - break; - case Property.NetworkAct: - propData = (NetworkSystemType)Marshal.ReadInt32(data); - break; - case Property.NetworkPsType: - propData = (NetworkPsType)Marshal.ReadInt32(data); - break; - case Property.NetworkCircuitStatus: - propData = (NetworkServiceLevel)Marshal.ReadInt32(data); - break; - case Property.NetworkPacketStatus: - propData = (NetworkServiceLevel)Marshal.ReadInt32(data); - break; - case Property.NetworkRoamingStatus: - int roamingStatus = Marshal.ReadInt32(data); - if (roamingStatus == 1) - { - propData = true; - } - - else if (roamingStatus == 0) - { - propData = false; - } - - break; - case Property.NetworkNameOption: - propData = (NetworkNameDisplayCondition)Marshal.ReadInt32(data); - break; - case Property.NetworkName: - propData = Marshal.PtrToStringAnsi(data); - break; - case Property.NetworkSpnName: - propData = Marshal.PtrToStringAnsi(data); - break; - case Property.NetworkSignalDbm: - propData = Marshal.ReadInt32(data); - break; - case Property.NetworkSignalLevel: - propData = Marshal.ReadInt32(data); - break; - case Property.NetworkImsVoiceStatus: - int imsStatus = Marshal.ReadInt32(data); - if (imsStatus == 1) - { - propData = true; - } - - else if (imsStatus == 0) - { - propData = false; - } - - break; - case Property.NetworkVolteEnable: - propData = (VolteNetworkType)Marshal.ReadInt32(data); - break; - case Property.NetworkLteBand: - propData = (NetworkLteBandType)Marshal.ReadInt32(data); - break; - } - - _propertyChanged(null, new PropertyChangedEventArgs(propertyId, propData)); - } - }; - - _notificationChangedCbList.Add(_notificationChangedCb); - int ret = Interop.Tapi.RegisterNotiEvent(_handle, TapiUtility.ConvertPropToString(property), _notificationChangedCb, IntPtr.Zero); - if (ret != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Failed to register notification event for property change, Error: " + (TapiError)ret); - TapiUtility.ThrowTapiException(ret, _handle); - } - } - - /// - /// Deregisters notification callback for notification change events on DBus interface. - /// - /// Notification id for which the callback has to be de-registered. - /// http://tizen.org/feature/network.telephony - /// Thrown when telephony feature is not supported. - /// Thrown when it is failed due to invalid parameter. - /// Thrown when it is failed due to invalid operation. - public void DeregisterNotiEvent(Notification id) - { - int ret = Interop.Tapi.DeregisterNotiEvent(_handle, TapiUtility.ConvertNotiToString(id)); - if (ret != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Failed to deregister notification event, Error: " + (TapiError)ret); - TapiUtility.ThrowTapiException(ret, _handle); - } - } - - /// - /// Deregisters notification callback for property change events on DBus interface. - /// - /// Property definition for which the callback has to be de-registered. - /// http://tizen.org/feature/network.telephony - /// Thrown when telephony feature is not supported. - /// Thrown when it is failed due to invalid parameter. - /// Thrown when it is failed due to invalid operation. - public void DeregisterPropEvent(Property property) - { - int ret = Interop.Tapi.DeregisterNotiEvent(_handle, TapiUtility.ConvertPropToString(property)); - if (ret != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Failed to deregister notification event for property change, Error: " + (TapiError)ret); - TapiUtility.ThrowTapiException(ret, _handle); - } - } - - /// - /// Gets the property value in an integer format for the given property. - /// - /// The property to be retrieved from Dbus. - /// The property value in integer format. - /// http://tizen.org/feature/network.telephony - /// http://tizen.org/privilege/telephony - /// Thrown when telephony feature is not supported. - /// Thrown when permission is denied. - /// Thrown when it is failed due to invalid parameter. - /// Thrown when it is failed due to invalid operation. - public int GetIntProperty(Property property) - { - int result; - int ret = Interop.Tapi.GetIntProperty(_handle, TapiUtility.ConvertPropToString(property), out result); - if (ret != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Failed to get property in integer format, Error: " + (TapiError)ret); - TapiUtility.ThrowTapiException(ret, _handle, "http://tizen.org/privilege/telephony"); - } - - return result; - } - - /// - /// Gets the property value in a string format for the given property. - /// - /// The property to be retrieved from Dbus. - /// The property value in string format. - /// http://tizen.org/feature/network.telephony - /// http://tizen.org/privilege/telephony - /// Thrown when telephony feature is not supported. - /// Thrown when permission is denied. - /// Thrown when it is failed due to invalid parameter. - /// Thrown when it is failed due to invalid operation. - public string GetStringProperty(Property property) - { - string result; - int ret = Interop.Tapi.GetStringProperty(_handle, TapiUtility.ConvertPropToString(property), out result); - if (ret != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Failed to get property in string format, Error: " + (TapiError)ret); - TapiUtility.ThrowTapiException(ret, _handle, "http://tizen.org/privilege/telephony"); - } - - return result; - } - } -} diff --git a/src/Tizen.Tapi/Tizen.Tapi/TapiManager.cs b/src/Tizen.Tapi/Tizen.Tapi/TapiManager.cs deleted file mode 100755 index 589e54087..000000000 --- a/src/Tizen.Tapi/Tizen.Tapi/TapiManager.cs +++ /dev/null @@ -1,170 +0,0 @@ -/* - * 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.Collections.Generic; -using System.Linq; -using System.Runtime.InteropServices; -using Tizen; - -namespace Tizen.Tapi -{ - /// - /// This class is used for initializing/deinitializing Tapi and manages the state of it. - /// - public static class TapiManager - { - private static event EventHandler s_stateChanged; - private static Interop.Tapi.TapiStateCallback s_stateChangedCb; - - /// - /// Gets the state value if tapi is ready. - /// - /// The State value in integer format - 0 is False and 1 is True. Returns -1 in case of error. - public static int State - { - get - { - int state; - int ret = Interop.Tapi.GetReadyState(out state); - if (ret != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Failed to get ready state of tapi, Error: " + (TapiError)ret); - return -1; - } - - return state; - } - } - - /// - /// This event is raised when Tapi ready state changes. - /// - public static event EventHandler StateChanged - { - add - { - if (s_stateChanged == null) - { - RegisterStateChangedEvent(); - } - - s_stateChanged += value; - } - - remove - { - s_stateChanged -= value; - if (s_stateChanged == null) - { - UnregisterStateChangedEvent(); - } - } - } - - private static void RegisterStateChangedEvent() - { - s_stateChangedCb = (int state, IntPtr userData) => - { - s_stateChanged?.Invoke(null, new StateChangedEventArgs(state)); - }; - int ret = Interop.Tapi.RegisterReadyStateCb(s_stateChangedCb, IntPtr.Zero); - if (ret != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Failed to register tapi state changed callback, Error: " + (TapiError)ret); - } - } - - private static void UnregisterStateChangedEvent() - { - int ret = Interop.Tapi.DeregisterReadyStateCb(s_stateChangedCb); - if (ret != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Failed to deregister tapi state changed callback, Error: " + (TapiError)ret); - } - } - - /// - /// Fetches a list of available CPs. - /// - /// List of available CPs in case of success. Null in case of failure. - /// http://tizen.org/feature/network.telephony - public static IEnumerable GetCpNames() - { - IntPtr cpNames = Interop.Tapi.GetCpNames(); - if(cpNames == IntPtr.Zero) - { - return null; - } - - else - { - List cpList = new List(); - int offset = 0; - IntPtr cp = Marshal.ReadIntPtr(cpNames, offset); - if(cp != IntPtr.Zero) - { - do - { - string cpString = Marshal.PtrToStringAnsi(cp); - offset += Marshal.SizeOf(cp); - cpList.Add(cpString); - } - - while ((cp = Marshal.ReadIntPtr(cpNames, offset)) != IntPtr.Zero); - } - - return cpList; - } - } - - /// - /// Acquires a TAPI Handle for the specified CP name. - /// - /// The CP Name against which a TAPI handle is required (A NULL CP Name will return a #TapiHandle bound to the first CP in the list of available CPs). - /// Instance of TapiHandle on success, null on failure. - /// http://tizen.org/feature/network.telephony - public static TapiHandle InitTapi(string cpName) - { - IntPtr handle = Interop.Tapi.InitTapi(cpName); - if (handle == IntPtr.Zero) - { - return null; - } - - return new TapiHandle(handle); - } - - /// - /// Deinitializes the TAPI Handle. - /// - /// http://tizen.org/feature/network.telephony - /// Thrown when telephony feature is not supported. - /// Thrown when it is failed due to invalid parameter. - /// Thrown when it is failed due to invalid operation. - public static void DeinitTapi(TapiHandle handle) - { - int ret = Interop.Tapi.DeinitTapi(handle._handle); - if (ret != (int)TapiError.Success) - { - Log.Error(TapiUtility.LogTag, "Failed to deinitialize tapi, Error: " + (TapiError)ret); - TapiUtility.ThrowTapiException(ret, handle._handle); - } - - handle._handle = IntPtr.Zero; - } - } -} diff --git a/src/Tizen.Tapi/Tizen.Tapi/TapiUtility.cs b/src/Tizen.Tapi/Tizen.Tapi/TapiUtility.cs deleted file mode 100755 index 9e68e1bf1..000000000 --- a/src/Tizen.Tapi/Tizen.Tapi/TapiUtility.cs +++ /dev/null @@ -1,382 +0,0 @@ -/* - * 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.Tapi -{ - internal enum TapiError - { - Success = 0, - InvalidInput = -1, - InvalidPtr = -2, - NotSupported = -3, - Depricated = -4, - SystemOutOfMemory = -5, - SystemRpcLinkDown = -6, - ServiceNotReady = -7, - ServerFailure = -8, - OemPluginFailure = -9, - TransportLayerFailure = -10, - InvalidDataLength = -11, - RequestMaxInProgress = -12, - OfflineModeError = -13, - EventClassUnknown = -14, - EventUnknown = -15, - RegistrationOpFailed = -16, - OperationFailed = -17, - InvalidOperation = -18, - AccessDenied = -19, - SystemRpcLinkNotEst = -100, - ApiNotSupported = -101, - ServerLayerFailure = -102, - InvalidCallId = -200, - CallContextOverflow = -201, - CouldNotGetCallContext = -202, - ContextSearchRetNonCallContext = -203, - CouldNotDestroyContext = -204, - InvalidLineId = -205, - InvalidCallHandle = -206, - InvalidCallState = -207, - CallPreCondFailed = -208, - CallSameReqPending = -209, - ModemPoweredOff = -300, - ModemAlreadyOn = -301, - ModemAlreadyOff = -302, - NetTextDeviceNotReady = -400, - NetTextScaAddrNotSet = -401, - NetTextInvalidDataLength = -402, - NetTextScaAddressNotSet = -403, - SimCardError = -500, - SimNotFound = -501, - SimNotInitialized = -502, - SimLocked = -503, - SimPermBlocked = -504, - SimServiceDisabled = -505, - SatInvalidCommandId = -600, - SatCommandTypeMismatch = -601, - SatEventNotRequiredByUsim = -602, - NetworkInvalidContext = -700, - NetworkPlmnNotAllowed = -701, - NetworkRoamingNotAllowed = -702, - MiscReturnNull = -800, - MiscvalidityError = -801, - MiscInputParamError = -802, - MiscOutParamNull = -803 - } - - internal static class TapiUtility - { - internal const string LogTag = "Tizen.Tapi"; - internal const int MaxVersionLen = 32; - internal const int MiscProdCodeMaxLen = 32; - internal const int ModelIdMaxLen = 17; - internal const int MiscPrlEriVersionMaxLen = 17; - internal const int MiscMeSnMaxLen = 32; - internal const int MiscMeDeviceNameMaxLen = 32; - internal const int CallDialNumberMaxLen = 83; - internal const int CallNameMaxSize = 97; - - internal static string ConvertNotiToString(Notification noti) - { - switch(noti) - { - case Notification.IdleVoiceCall: - return "org.tizen.telephony.Call:VoiceCallStatusIdle"; - case Notification.ActiveVoiceCall: - return "org.tizen.telephony.Call:VoiceCallStatusActive"; - case Notification.HeldVoiceCall: - return "org.tizen.telephony.Call:VoiceCallStatusHeld"; - case Notification.DialingVoiceCall: - return "org.tizen.telephony.Call:VoiceCallStatusDialing"; - case Notification.AlertVoiceCall: - return "org.tizen.telephony.Call:VoiceCallStatusAlert"; - case Notification.IncomingVoiceCall: - return "org.tizen.telephony.Call:VoiceCallStatusIncoming"; - case Notification.IdleVideoCall: - return "org.tizen.telephony.Call:VideoCallStatusIdle"; - case Notification.ActiveVideoCall: - return "org.tizen.telephony.Call:VideoCallStatusActive"; - case Notification.DialingVideoCall: - return "org.tizen.telephony.Call:VideoCallStatusDialing"; - case Notification.AlertVideoCall: - return "org.tizen.telephony.Call:VideoCallStatusAlert"; - case Notification.IncomingVideoCall: - return "org.tizen.telephony.Call:VideoCallStatusIncoming"; - case Notification.WaitingCallInfo: - return "org.tizen.telephony.Call:Waiting"; - case Notification.ForwardCallInfo: - return "org.tizen.telephony.Call:Forwarded"; - case Notification.BarredIncomingCallInfo: - return "org.tizen.telephony.Call:BarredIncoming"; - case Notification.BarredOutgoingCallInfo: - return "org.tizen.telephony.Call:BarredOutgoing"; - case Notification.DeflectCallInfo: - return "org.tizen.telephony.Call:Deflected"; - case Notification.ClirCallInfo: - return "org.tizen.telephony.Call:ClirSuppressionReject"; - case Notification.ForwardUnconditionalCallInfo: - return "org.tizen.telephony.Call:ForwardUnconditional"; - case Notification.ForwardConditionalCallInfo: - return "org.tizen.telephony.Call:ForwardConditional"; - case Notification.ForwardedCallInfo: - return "org.tizen.telephony.Call:ForwardedCall"; - case Notification.DeflectedCallInfo: - return "org.tizen.telephony.Call:DeflectedCall"; - case Notification.TransferredCallInfo: - return "org.tizen.telephony.Call:TransferedCall"; - case Notification.HeldCallInfo: - return "org.tizen.telephony.Call:CallHeld"; - case Notification.ActiveCallInfo: - return "org.tizen.telephony.Call:CallActive"; - case Notification.JoinedCallInfo: - return "org.tizen.telephony.Call:CallJoined"; - case Notification.TransferAlertCallInfo: - return "org.tizen.telephony.Call:TransferAlert"; - case Notification.CfCheckMessageCallInfo: - return "org.tizen.telephony.Call:CfCheckMessage"; - case Notification.RecCallInfo: - return "org.tizen.telephony.Call:CallInfoRec"; - case Notification.FallbackCallInfo: - return "org.tizen.telephony.Call:CallFallback"; - case Notification.PrivacyModeCall: - return "org.tizen.telephony.Call:CallPrivacyMode"; - case Notification.OtaspCall: - return "org.tizen.telephony.Call:CallOtaspStatus"; - case Notification.OtapaCall: - return "org.tizen.telephony.Call:CallOtapaStatus"; - case Notification.CallSignalInfo: - return "org.tizen.telephony.Call:CallSignalInfo"; - case Notification.CallSoundPath: - return "org.tizen.telephony.Call:CallSoundPath"; - case Notification.CallSoundRingbackTone: - return "org.tizen.telephony.Call:CallSoundRingbackTone"; - case Notification.CallSoundWbamr: - return "org.tizen.telephony.Call:CallSoundWbamr"; - case Notification.CallSoundNoiceReduction: - return "org.tizen.telephony.Call:CallSoundNoiseReduction"; - case Notification.CallSoundClock: - return "org.tizen.telephony.Call:CallSoundClockStatus"; - case Notification.CallPreferredVoiceSubscription: - return "org.tizen.telephony.Call:CallPreferredVoiceSubscription"; - case Notification.CallModifiableInfo: - return "org.tizen.telephony.Call:Modifiable"; - case Notification.CallupgradeRequested: - return "org.tizen.telephony.Call:CallUpgradeRequested"; - case Notification.CallDowngraded: - return "org.tizen.telephony.Call:CallDowngraded"; - case Notification.ModemPower: - return "org.tizen.telephony.Modem:Power"; - case Notification.SimStatus: - return "org.tizen.telephony.Sim:Status"; - case Notification.SimRefreshed: - return "org.tizen.telephony.Sim:Refreshed"; - case Notification.SapStatus: - return "org.tizen.telephony.Sap:Status"; - case Notification.SapDisconnect: - return "org.tizen.telephony.Sap:Disconnect"; - case Notification.SatSetupMenu: - return "org.tizen.telephony.SAT:SetupMenu"; - case Notification.SatDisplayText: - return "org.tizen.telephony.SAT:DisplayText"; - case Notification.SatSelectItem: - return "org.tizen.telephony.SAT:SelectItem"; - case Notification.SatGetInKey: - return "org.tizen.telephony.SAT:GetInkey"; - case Notification.SatGetInput: - return "org.tizen.telephony.SAT:GetInput"; - case Notification.SatRefresh: - return "org.tizen.telephony.SAT:Refresh"; - case Notification.SatSendSms: - return "org.tizen.telephony.SAT:SendSMS"; - case Notification.SatSetupEventList: - return "org.tizen.telephony.SAT:SetupEventList"; - case Notification.SatSendDtmf: - return "org.tizen.telephony.SAT:SendDtmf"; - case Notification.SatEndProactiveSession: - return "org.tizen.telephony.SAT:EndProactiveSession"; - case Notification.SatCallControlResult: - return "org.tizen.telephony.SAT:CallControlResult"; - case Notification.SatMoSmControlResult: - return "org.tizen.telephony.SAT:MoSmControlResult"; - case Notification.SatSetupCall: - return "org.tizen.telephony.SAT:SetupCall"; - case Notification.SatSendSs: - return "org.tizen.telephony.SAT:SendSS"; - case Notification.SatSetupUssd: - return "org.tizen.telephony.SAT:SetupUSSD"; - case Notification.PhonebookStatus: - return "org.tizen.telephony.Phonebook:Status"; - case Notification.PhonebookContactChange: - return "org.tizen.telephony.Phonebook:ContactChange"; - case Notification.NetworkRegistrationStatus: - return "org.tizen.telephony.Network:RegistrationStatus"; - case Notification.NetworkCellInfo: - return "org.tizen.telephony.Network:CellInfo"; - case Notification.NetworkChange: - return "org.tizen.telephony.Network:Change"; - case Notification.NetworkTimeInfo: - return "org.tizen.telephony.Network:TimeInfo"; - case Notification.NetworkIdentity: - return "org.tizen.telephony.Network:Identity"; - case Notification.NetworkSignalStrength: - return "org.tizen.telephony.Network:SignalStrength"; - case Notification.NetworkEmergencyCallbackMode: - return "org.tizen.telephony.Network:EmergencyCallbackMode"; - case Notification.NetworkDefaultDataSubscription: - return "org.tizen.telephony.Network:DefaultDataSubscription"; - case Notification.NetworkDefaultSubscription: - return "org.tizen.telephony.Network:DefaultSubscription"; - case Notification.NetworkCellId: - return "org.tizen.telephony.Network:CellId"; - case Notification.NetworkLac: - return "org.tizen.telephony.Network:Lac"; - case Notification.NetworkTac: - return "org.tizen.telephony.Network:Tac"; - case Notification.NetworkSystemId: - return "org.tizen.telephony.Network:SystemId"; - case Notification.NetworkNetworkId: - return "org.tizen.telephony.Network:NetworkId"; - case Notification.NetworkBsId: - return "org.tizen.telephony.Network:BsId"; - case Notification.NetworkBsLatitude: - return "org.tizen.telephony.Network:BsLatitude"; - case Notification.NetworkBsLongitude: - return "org.tizen.telephony.Network:BsLongitude"; - case Notification.NetworkVolteStatus: - return "org.tizen.telephony.Network:VolteStatus"; - case Notification.NetworkEpdgStatus: - return "org.tizen.telephony.Network:EpdgStatus"; - case Notification.SsUssd: - return "org.tizen.telephony.Ss:NotifyUSSD"; - case Notification.SsReleaseComplete: - return "org.tizen.telephony.Ss:ReleaseComplete"; - case Notification.SsNotifyForwarding: - return "org.tizen.telephony.Ss:NotifyForwarding"; - case Notification.SsNotifyBarring: - return "org.tizen.telephony.Ss:NotifyBarring"; - case Notification.SsNotifyWaiting: - return "org.tizen.telephony.Ss:NotifyWaiting"; - case Notification.SsNotifyInfo: - return "org.tizen.telephony.Ss:NotifySsInfo"; - case Notification.SmsIncomingMsg: - return "org.tizen.telephony.sms:IncommingMsg"; - case Notification.SmsIncomingCbMsg: - return "org.tizen.telephony.sms:IncommingCbMsg"; - case Notification.SmsIncomingEtwsMsg: - return "org.tizen.telephony.sms:IncommingEtwsMsg"; - case Notification.SmsMemoryStatus: - return "org.tizen.telephony.sms:MemoryStatus"; - case Notification.SmsReady: - return "org.tizen.telephony.sms:SmsReady"; - case Notification.OemData: - return "org.tizen.telephony.OEM:OemData"; - default: - return null; - } - } - - internal static string ConvertPropToString(Property prop) - { - switch(prop) - { - case Property.ModemPower: - return "org.tizen.telephony.Modem:power"; - case Property.ModemDongleStatus: - return "org.tizen.telephony.Modem:dongle_status"; - case Property.ModemDongleLogin: - return "org.tizen.telephony.Modem:dongle_login"; - case Property.SimCallForwardState: - return "org.tizen.telephony.Sim:cf_state"; - case Property.NetworkLac: - return "org.tizen.telephony.Network:lac"; - case Property.NetworkTac: - return "org.tizen.telephony.Network:tac"; - case Property.NetworkPlmn: - return "org.tizen.telephony.Network:plmn"; - case Property.NetworkCellId: - return ".tizen.telephony.Network:cell_id"; - case Property.NetworkPhysicalCellId: - return "org.tizen.telephony.Network:physical_cell_id"; - case Property.NetworkServiceType: - return "org.tizen.telephony.Network:service_type"; - case Property.NetworkAct: - return "org.tizen.telephony.Network:access_technology"; - case Property.NetworkPsType: - return "org.tizen.telephony.Network:ps_type"; - case Property.NetworkCircuitStatus: - return "org.tizen.telephony.Network:circuit_status"; - case Property.NetworkPacketStatus: - return "org.tizen.telephony.Network:packet_status"; - case Property.NetworkRoamingStatus: - return "org.tizen.telephony.Network:roaming_status"; - case Property.NetworkNameOption: - return "org.tizen.telephony.Network:name_option"; - case Property.NetworkName: - return "org.tizen.telephony.Network:network_name"; - case Property.NetworkSpnName: - return "org.tizen.telephony.Network:spn_name"; - case Property.NetworkSignalDbm: - return "org.tizen.telephony.Network:sig_dbm"; - case Property.NetworkSignalLevel: - return "org.tizen.telephony.Network:sig_level"; - case Property.NetworkImsVoiceStatus: - return "org.tizen.telephony.Network:ims_voice_status"; - case Property.NetworkVolteEnable: - return "org.tizen.telephony.Network:volte_enable"; - case Property.NetworkLteBand: - return "org.tizen.telephony.Network:lte_band_type"; - default: - return null; - } - } - - internal static void ThrowTapiException(int exception, IntPtr handle) - { - ThrowException(exception, (handle == IntPtr.Zero), ""); - } - - internal static void ThrowTapiException(int exception, IntPtr handle, string message) - { - ThrowException(exception, (handle == IntPtr.Zero), message); - } - - private static void ThrowException(int exception, bool isHandleNull, string message) - { - TapiError _error = (TapiError)exception; - switch (_error) - { - case TapiError.NotSupported: - throw new NotSupportedException("Unsupported feature http://tizen.org/feature/network.telephony"); - case TapiError.AccessDenied: - throw new UnauthorizedAccessException("Permission denied " + message); - case TapiError.SystemOutOfMemory: - throw new OutOfMemoryException("System out of memory"); - case TapiError.InvalidPtr: - if (isHandleNull) - { - throw new InvalidOperationException("Invalid instance (object may have been disposed or released)"); - } - else - throw new ArgumentException("Invalid parameter"); - case TapiError.InvalidInput: - throw new ArgumentException("Invalid parameter"); - default: - throw new InvalidOperationException(_error.ToString()); - } - } - } -} diff --git a/src/Tizen.Telephony/Interop/Interop.Call.cs b/src/Tizen.Telephony/Interop/Interop.Call.cs deleted file mode 100755 index f28db6d54..000000000 --- a/src/Tizen.Telephony/Interop/Interop.Call.cs +++ /dev/null @@ -1,87 +0,0 @@ -/* - * 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; -using Tizen.Telephony; -using static Tizen.Telephony.CallHandle; - -/// -/// The Partial Interop class. -/// -internal static partial class Interop -{ - /// - /// The Call Interop class. - /// - internal static partial class Call - { - [DllImport(Libraries.Telephony, EntryPoint = "telephony_call_get_preferred_voice_subscription")] - internal static extern Telephony.TelephonyError GetPreferredVoiceSubscription(IntPtr handle, out CallPreferredVoiceSubscription callSub); - - [DllImport(Libraries.Telephony, EntryPoint = "telephony_call_get_call_list")] - internal static extern Telephony.TelephonyError GetCallList(IntPtr handle, out uint count, out IntPtr callList); - - [DllImport(Libraries.Telephony, EntryPoint = "telephony_call_release_call_list")] - internal static extern Telephony.TelephonyError ReleaseCallList(uint count, IntPtr callList); - - [DllImport(Libraries.Telephony, EntryPoint = "telephony_call_get_handle_id")] - internal static extern Telephony.TelephonyError GetHandleId(IntPtr callHandle, out uint handleId); - - [DllImport(Libraries.Telephony, EntryPoint = "telephony_call_get_number")] - internal static extern Telephony.TelephonyError GetNumber(IntPtr callHandle, out string number); - - [DllImport(Libraries.Telephony, EntryPoint = "telephony_call_get_type")] - internal static extern Telephony.TelephonyError GetType(IntPtr callHandle, out CallType type); - - [DllImport(Libraries.Telephony, EntryPoint = "telephony_call_get_status")] - internal static extern Telephony.TelephonyError GetStatus(IntPtr callHandle, out CallStatus status); - - [DllImport(Libraries.Telephony, EntryPoint = "telephony_call_get_direction")] - internal static extern Telephony.TelephonyError GetDirection(IntPtr callHandle, out CallDirection direction); - - [DllImport(Libraries.Telephony, EntryPoint = "telephony_call_get_conference_status")] - internal static extern Telephony.TelephonyError GetConferenceStatus(IntPtr callHandle, out bool conferenceStatus); - - internal sealed class SafeCallList : SafeHandle - { - public SafeCallList() - : base(IntPtr.Zero, true) - { - } - - public SafeCallList(IntPtr handle, uint count) - : base(handle, true) - { - Count = count; - } - - public override bool IsInvalid - { - get { return this.handle == IntPtr.Zero; } - } - - protected override bool ReleaseHandle() - { - ReleaseCallList(Count, this.handle); - this.SetHandle(IntPtr.Zero); - return true; - } - - internal uint Count; - } - } -} diff --git a/src/Tizen.Telephony/Interop/Interop.Libraries.cs b/src/Tizen.Telephony/Interop/Interop.Libraries.cs deleted file mode 100755 index a346305e1..000000000 --- a/src/Tizen.Telephony/Interop/Interop.Libraries.cs +++ /dev/null @@ -1,29 +0,0 @@ -/* - * 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. - */ - -/// -/// The Partial Interop class. -/// -internal static partial class Interop -{ - /// - /// The Libraries Interop class. - /// - internal static partial class Libraries - { - public const string Telephony = "libcapi-telephony.so.0"; - } -} \ No newline at end of file diff --git a/src/Tizen.Telephony/Interop/Interop.Modem.cs b/src/Tizen.Telephony/Interop/Interop.Modem.cs deleted file mode 100755 index 6284cfa17..000000000 --- a/src/Tizen.Telephony/Interop/Interop.Modem.cs +++ /dev/null @@ -1,39 +0,0 @@ -/* - * 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; - -/// -/// The Partial Interop class. -/// -internal static partial class Interop -{ - /// - /// The Modem Interop class. - /// - internal static partial class Modem - { - [DllImport(Libraries.Telephony, EntryPoint = "telephony_modem_get_imei")] - internal static extern Telephony.TelephonyError GetImei(IntPtr handle, out string imei); - - [DllImport(Libraries.Telephony, EntryPoint = "telephony_modem_get_power_status")] - internal static extern Telephony.TelephonyError GetPowerStatus(IntPtr handle, out Tizen.Telephony.Modem.PowerStatus status); - - [DllImport(Libraries.Telephony, EntryPoint = "telephony_modem_get_meid")] - internal static extern Telephony.TelephonyError GetMeid(IntPtr handle, out string meid); - } -} diff --git a/src/Tizen.Telephony/Interop/Interop.Network.cs b/src/Tizen.Telephony/Interop/Interop.Network.cs deleted file mode 100755 index 8da8b6b4d..000000000 --- a/src/Tizen.Telephony/Interop/Interop.Network.cs +++ /dev/null @@ -1,90 +0,0 @@ -/* - * 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; - -/// -/// The Partial Interop class. -/// -internal static partial class Interop -{ - /// - /// The Network Interop class. - /// - internal static partial class Network - { - [DllImport(Libraries.Telephony, EntryPoint = "telephony_network_get_lac")] - internal static extern Telephony.TelephonyError GetLac(IntPtr handle, out int lac); - - [DllImport(Libraries.Telephony, EntryPoint = "telephony_network_get_cell_id")] - internal static extern Telephony.TelephonyError GetCellId(IntPtr handle, out int cellId); - - [DllImport(Libraries.Telephony, EntryPoint = "telephony_network_get_rssi")] - internal static extern Telephony.TelephonyError GetRssi(IntPtr handle, out Tizen.Telephony.Network.Rssi rssi); - - [DllImport(Libraries.Telephony, EntryPoint = "telephony_network_get_roaming_status")] - internal static extern Telephony.TelephonyError GetRoamingStatus(IntPtr handle, out bool status); - - [DllImport(Libraries.Telephony, EntryPoint = "telephony_network_get_mcc")] - internal static extern Telephony.TelephonyError GetMcc(IntPtr handle, out string mcc); - - [DllImport(Libraries.Telephony, EntryPoint = "telephony_network_get_mnc")] - internal static extern Telephony.TelephonyError GetMnc(IntPtr handle, out string mnc); - - [DllImport(Libraries.Telephony, EntryPoint = "telephony_network_get_network_name")] - internal static extern Telephony.TelephonyError GetNetworkName(IntPtr handle, out string networkName); - - [DllImport(Libraries.Telephony, EntryPoint = "telephony_network_get_type")] - internal static extern Telephony.TelephonyError GetType(IntPtr handle, out Tizen.Telephony.Network.Type networkType); - - [DllImport(Libraries.Telephony, EntryPoint = "telephony_network_get_ps_type")] - internal static extern Telephony.TelephonyError GetPsType(IntPtr handle, out Tizen.Telephony.Network.PsType psType); - - [DllImport(Libraries.Telephony, EntryPoint = "telephony_network_get_network_name_option")] - internal static extern Telephony.TelephonyError GetNetworkNameOption(IntPtr handle, out Tizen.Telephony.Network.NameOption networkNameOption); - - [DllImport(Libraries.Telephony, EntryPoint = "telephony_network_get_service_state")] - internal static extern Telephony.TelephonyError GetServiceState(IntPtr handle, out Tizen.Telephony.Network.ServiceState networkServiceState); - - [DllImport(Libraries.Telephony, EntryPoint = "telephony_network_get_default_data_subscription")] - internal static extern Telephony.TelephonyError GetDefaultDataSubscription(IntPtr handle, out Tizen.Telephony.Network.DefaultDataSubscription defaultSub); - - [DllImport(Libraries.Telephony, EntryPoint = "telephony_network_get_default_subscription")] - internal static extern Telephony.TelephonyError GetDefaultSubscription(IntPtr handle, out Tizen.Telephony.Network.DefaultSubscription defaultSub); - - [DllImport(Libraries.Telephony, EntryPoint = "telephony_network_get_selection_mode")] - internal static extern Telephony.TelephonyError GetSelectionMode(IntPtr handle, out Tizen.Telephony.Network.SelectionMode mode); - - [DllImport(Libraries.Telephony, EntryPoint = "telephony_network_get_tac")] - internal static extern Telephony.TelephonyError GetTac(IntPtr handle, out int tac); - - [DllImport(Libraries.Telephony, EntryPoint = "telephony_network_get_system_id")] - internal static extern Telephony.TelephonyError GetSystemId(IntPtr handle, out int sid); - - [DllImport(Libraries.Telephony, EntryPoint = "telephony_network_get_network_id")] - internal static extern Telephony.TelephonyError GetNetworkId(IntPtr handle, out int nid); - - [DllImport(Libraries.Telephony, EntryPoint = "telephony_network_get_base_station_id")] - internal static extern Telephony.TelephonyError GetBaseStationId(IntPtr handle, out int bsId); - - [DllImport(Libraries.Telephony, EntryPoint = "telephony_network_get_base_station_latitude")] - internal static extern Telephony.TelephonyError GetBaseStationLatitude(IntPtr handle, out int bsLatitude); - - [DllImport(Libraries.Telephony, EntryPoint = "telephony_network_get_base_station_longitude")] - internal static extern Telephony.TelephonyError GetBaseStationLongitude(IntPtr handle, out int bsLongitude); - } -} diff --git a/src/Tizen.Telephony/Interop/Interop.Sim.cs b/src/Tizen.Telephony/Interop/Interop.Sim.cs deleted file mode 100755 index dab6ac45c..000000000 --- a/src/Tizen.Telephony/Interop/Interop.Sim.cs +++ /dev/null @@ -1,66 +0,0 @@ -/* - * 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; - -/// -/// The Partial Interop class. -/// -internal static partial class Interop -{ - /// - /// The SIM Interop class. - /// - internal static partial class Sim - { - [DllImport(Libraries.Telephony, EntryPoint = "telephony_sim_get_icc_id")] - internal static extern Telephony.TelephonyError GetIccId(IntPtr handle, out string iccId); - - [DllImport(Libraries.Telephony, EntryPoint = "telephony_sim_get_operator")] - internal static extern Telephony.TelephonyError GetOperator(IntPtr handle, out string simOperator); - - [DllImport(Libraries.Telephony, EntryPoint = "telephony_sim_get_msin")] - internal static extern Telephony.TelephonyError GetMsin(IntPtr handle, out string msin); - - [DllImport(Libraries.Telephony, EntryPoint = "telephony_sim_get_spn")] - internal static extern Telephony.TelephonyError GetSpn(IntPtr handle, out string spn); - - [DllImport(Libraries.Telephony, EntryPoint = "telephony_sim_is_changed")] - internal static extern Telephony.TelephonyError IsChanged(IntPtr handle, out int isChanged); - - [DllImport(Libraries.Telephony, EntryPoint = "telephony_sim_get_state")] - internal static extern Telephony.TelephonyError GetState(IntPtr handle, out Tizen.Telephony.Sim.State simState); - - [DllImport(Libraries.Telephony, EntryPoint = "telephony_sim_get_application_list")] - internal static extern Telephony.TelephonyError GetApplicationList(IntPtr handle, out uint appList); - - [DllImport(Libraries.Telephony, EntryPoint = "telephony_sim_get_subscriber_number")] - internal static extern Telephony.TelephonyError GetSubscriberNumber(IntPtr handle, out string subscriberNumber); - - [DllImport(Libraries.Telephony, EntryPoint = "telephony_sim_get_subscriber_id")] - internal static extern Telephony.TelephonyError GetSubscriberId(IntPtr handle, out string subscriberId); - - [DllImport(Libraries.Telephony, EntryPoint = "telephony_sim_get_lock_state")] - internal static extern Telephony.TelephonyError GetLockState(IntPtr handle, out Tizen.Telephony.Sim.LockState lockState); - - [DllImport(Libraries.Telephony, EntryPoint = "telephony_sim_get_group_id1")] - internal static extern Telephony.TelephonyError GetGroupId1(IntPtr handle, out string gid1); - - [DllImport(Libraries.Telephony, EntryPoint = "telephony_sim_get_call_forwarding_indicator_state")] - internal static extern Telephony.TelephonyError GetCallForwardingIndicatorState(IntPtr handle, out bool state); - } -} diff --git a/src/Tizen.Telephony/Interop/Interop.Telephony.cs b/src/Tizen.Telephony/Interop/Interop.Telephony.cs deleted file mode 100755 index 736575803..000000000 --- a/src/Tizen.Telephony/Interop/Interop.Telephony.cs +++ /dev/null @@ -1,78 +0,0 @@ -/* - * 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; -using Tizen.Telephony; - -/// -/// The Partial Interop class. -/// -internal static partial class Interop -{ - /// - /// The Telephony Interop class. - /// - internal static class Telephony - { - private const int TIZEN_ERROR_TELEPHONY = -0x02600000; - internal static string LogTag = "Tizen.Telephony"; - internal enum TelephonyError - { - None = Tizen.Internals.Errors.ErrorCode.None, - OutOfMemory = Tizen.Internals.Errors.ErrorCode.OutOfMemory, - InvalidParameter = Tizen.Internals.Errors.ErrorCode.InvalidParameter, - PermissionDenied = Tizen.Internals.Errors.ErrorCode.PermissionDenied, - NotSupported = Tizen.Internals.Errors.ErrorCode.NotSupported, - OperationFailed = TIZEN_ERROR_TELEPHONY | 0x0001, - SIMNotAvailable = TIZEN_ERROR_TELEPHONY | 0x1001 - }; - - [StructLayout(LayoutKind.Sequential)] - internal struct HandleList - { - internal uint Count; - internal IntPtr HandleArrayPointer; - }; - - [DllImport(Libraries.Telephony, EntryPoint = "telephony_set_noti_cb")] - internal static extern TelephonyError TelephonySetNotiCb(IntPtr handle, Tizen.Telephony.ChangeNotificationEventArgs.Notification notiId, NotificationCallback cb, IntPtr userData); - - [DllImport(Libraries.Telephony, EntryPoint = "telephony_unset_noti_cb")] - internal static extern TelephonyError TelephonyUnsetNotiCb(IntPtr handle, Tizen.Telephony.ChangeNotificationEventArgs.Notification notiId); - - [DllImport(Libraries.Telephony, EntryPoint = "telephony_init")] - internal static extern TelephonyError TelephonyInit(out HandleList list); - - [DllImport(Libraries.Telephony, EntryPoint = "telephony_deinit")] - internal static extern TelephonyError TelephonyDeinit(ref HandleList list); - - [DllImport(Libraries.Telephony, EntryPoint = "telephony_get_state")] - internal static extern TelephonyError TelephonyGetState(out State state); - - [DllImport(Libraries.Telephony, EntryPoint = "telephony_set_state_changed_cb")] - internal static extern TelephonyError TelephonySetStateChangedCb(StateChangedCallback callback, IntPtr userData); - - [DllImport(Libraries.Telephony, EntryPoint = "telephony_unset_state_changed_cb")] - internal static extern TelephonyError TelephonyUnsetStateChangedCb(StateChangedCallback callback); - - [UnmanagedFunctionPointerAttribute(CallingConvention.Cdecl)] - internal delegate void NotificationCallback(IntPtr handle, ChangeNotificationEventArgs.Notification notiId, IntPtr data, IntPtr userData); - - [UnmanagedFunctionPointerAttribute(CallingConvention.Cdecl)] - internal delegate void StateChangedCallback(State state, IntPtr userData); - } -} \ No newline at end of file diff --git a/src/Tizen.Telephony/Tizen.Telephony.csproj b/src/Tizen.Telephony/Tizen.Telephony.csproj deleted file mode 100644 index 4c51c4197..000000000 --- a/src/Tizen.Telephony/Tizen.Telephony.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - netstandard2.0 - - - - - - - - \ No newline at end of file diff --git a/src/Tizen.Telephony/Tizen.Telephony.sln b/src/Tizen.Telephony/Tizen.Telephony.sln deleted file mode 100755 index 5496d1679..000000000 --- a/src/Tizen.Telephony/Tizen.Telephony.sln +++ /dev/null @@ -1,34 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26430.12 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Telephony", "Tizen.Telephony.csproj", "{EF90160B-8DCD-4E41-84D2-0E600DE11A2B}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen", "..\Tizen\Tizen.csproj", "{5EEFBC22-B72B-4691-8374-54B68A69427D}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Log", "..\Tizen.Log\Tizen.Log.csproj", "{E0AB6C62-2F27-4DD0-A7B9-CF6D35343124}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {EF90160B-8DCD-4E41-84D2-0E600DE11A2B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {EF90160B-8DCD-4E41-84D2-0E600DE11A2B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {EF90160B-8DCD-4E41-84D2-0E600DE11A2B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {EF90160B-8DCD-4E41-84D2-0E600DE11A2B}.Release|Any CPU.Build.0 = Release|Any CPU - {5EEFBC22-B72B-4691-8374-54B68A69427D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {5EEFBC22-B72B-4691-8374-54B68A69427D}.Debug|Any CPU.Build.0 = Debug|Any CPU - {5EEFBC22-B72B-4691-8374-54B68A69427D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {5EEFBC22-B72B-4691-8374-54B68A69427D}.Release|Any CPU.Build.0 = Release|Any CPU - {E0AB6C62-2F27-4DD0-A7B9-CF6D35343124}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {E0AB6C62-2F27-4DD0-A7B9-CF6D35343124}.Debug|Any CPU.Build.0 = Debug|Any CPU - {E0AB6C62-2F27-4DD0-A7B9-CF6D35343124}.Release|Any CPU.ActiveCfg = Release|Any CPU - {E0AB6C62-2F27-4DD0-A7B9-CF6D35343124}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/src/Tizen.Telephony/Tizen.Telephony/Call.cs b/src/Tizen.Telephony/Tizen.Telephony/Call.cs deleted file mode 100644 index 2e0f12784..000000000 --- a/src/Tizen.Telephony/Tizen.Telephony/Call.cs +++ /dev/null @@ -1,124 +0,0 @@ -/* - * 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.Collections.Generic; -using System.Runtime.InteropServices; -using static Interop.Telephony; - -namespace Tizen.Telephony -{ - /// - /// The Call APIs allow you to get the voice and video call states. - /// It provides the list of CallHandle which can be used to get the information about call related actions. - /// - public class Call - { - internal IntPtr _handle; - private List _callHandle = new List(); - private List _list = new List(); - private IntPtr _callList; - private Interop.Call.SafeCallList _safeCallList; - - /// - /// The public constructor. - /// - /// 3 - /// - /// SlotHandle received in the Manager.Init API. - /// - /// http://tizen.org/feature/network.telephony - /// The required feature is not supported. - /// - /// This exception occurs if the handle provided is null. - /// - public Call(SlotHandle handle) - { - if (handle == null) - { - throw new ArgumentNullException(); - } - - _handle = handle._handle; - } - - /// - /// Gets the current value for the preferred voice call subscription. - /// - /// 3 - /// http://tizen.org/privilege/telephony - /// - /// The currently set preferred voicecall subscription value. - /// - public CallPreferredVoiceSubscription PreferredVoiceSubscription - { - get - { - CallPreferredVoiceSubscription subs = CallPreferredVoiceSubscription.Unknown; - TelephonyError error = Interop.Call.GetPreferredVoiceSubscription(_handle, out subs); - if (error != TelephonyError.None) - { - Tizen.Log.Error(Interop.Telephony.LogTag, "GetPreferredVoiceSubscription Failed with error " + error); - return CallPreferredVoiceSubscription.Unknown; - } - - return subs; - } - } - - /// - /// Gets the list of the current call. - /// - /// 3 - /// - /// The list of the CallHandle for existing calls. - /// - /// http://tizen.org/privilege/telephony - /// http://tizen.org/feature/network.telephony - /// The required feature is not supported. - /// In case of an invalid parameter. - /// In case of any system error. - /// In case of privileges not defined. - /// In case of out of memory. - public IEnumerable GetCallHandleList() - { - uint count; - _callList = new IntPtr(); - _list.Clear(); - TelephonyError error = Interop.Call.GetCallList(_handle, out count, out _callList); - if (error != TelephonyError.None) - { - Tizen.Log.Error(Interop.Telephony.LogTag, "GetCallList Failed with error " + error); - throw ExceptionFactory.CreateException(error); - } - - _callHandle.Clear(); - if (count > 0) - { - IntPtr[] handleArray = new IntPtr[count]; - Marshal.Copy(_callList, handleArray, 0, (int)count); - foreach (IntPtr handle in handleArray) - { - CallHandle info = new CallHandle(handle); - _list.Add(info); - } - - _safeCallList = new Interop.Call.SafeCallList(_callList, count); - } - return _list; - } - } -} diff --git a/src/Tizen.Telephony/Tizen.Telephony/CallHandle.cs b/src/Tizen.Telephony/Tizen.Telephony/CallHandle.cs deleted file mode 100644 index ca8542309..000000000 --- a/src/Tizen.Telephony/Tizen.Telephony/CallHandle.cs +++ /dev/null @@ -1,257 +0,0 @@ -/* - * 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 static Interop.Telephony; - -namespace Tizen.Telephony -{ - /// - /// This class provides the APIs to get the information about calls. - /// - public class CallHandle - { - private IntPtr _callHandle; - - /// - /// Enumeration for the call status. - /// - public enum CallStatus - { - /// - /// Idle status. - /// - Idle, - /// - /// Active status. - /// - Active, - /// - /// Held status. - /// - Held, - /// - /// Dialing status. - /// - Dialing, - /// - /// Alerting status. - /// - Alerting, - /// - /// Incoming status. - /// - Incoming, - /// - /// Unavailable. - /// - Unavailable - }; - - /// - /// Enumeration for the call type. - /// - public enum CallType - { - /// - /// Voice call. - /// - Voice, - /// - /// Video call. - /// - Video, - /// - /// Emergency call. - /// - E911, - /// - /// Unavailable. - /// - Unavailable - }; - - /// - /// Enumeration for the call direction. - /// - public enum CallDirection - { - /// - /// MO(Mobile Originated) call. - /// - Mo, - /// - /// MT(Mobile Terminated) call. - /// - Mt, - /// - /// Unavailable. - /// - Unavailable - }; - - /// - /// Gets the call handle ID. - /// - /// 3 - /// - /// The ID of the call handle. - /// 0 if unable to complete the operation. - /// - public uint HandleId - { - get - { - uint handleId; - TelephonyError error = Interop.Call.GetHandleId(_callHandle, out handleId); - if (error != TelephonyError.None) - { - Tizen.Log.Error(Interop.Telephony.LogTag, "GetHandleId Failed with Error " + error); - return 0; - } - - return handleId; - } - } - - /// - /// Gets the call number. - /// - /// 3 - /// - /// The number of the call. - /// Empty string if unable to complete the operation. - /// - public string Number - { - get - { - string number; - TelephonyError error = Interop.Call.GetNumber(_callHandle, out number); - if (error != TelephonyError.None) - { - Tizen.Log.Error(Interop.Telephony.LogTag, "GetNumber Failed with Error " + error); - return ""; - } - - return number; - } - } - - /// - /// Gets the call type. - /// - /// 3 - /// - /// The type of the call. - /// - public CallType Type - { - get - { - CallType callType; - TelephonyError error = Interop.Call.GetType(_callHandle, out callType); - if (error != TelephonyError.None) - { - Tizen.Log.Error(Interop.Telephony.LogTag, "GetType Failed with Error " + error); - return CallType.Unavailable; - } - - return callType; - } - } - - /// - /// Gets the call status. - /// - /// 3 - /// - /// The status of the call. - /// - public CallStatus Status - { - get - { - CallStatus callStatus; - TelephonyError error = Interop.Call.GetStatus(_callHandle, out callStatus); - if (error != TelephonyError.None) - { - Tizen.Log.Error(Interop.Telephony.LogTag, "GetStatus Failed with Error " + error); - return CallStatus.Unavailable; - } - - return callStatus; - } - } - - /// - /// Gets whether the call is MO(Mobile Originated) call or MT(Mobile Terminated) call. - /// - /// 3 - /// - /// The direction of the call. - /// - /// - /// This Exception can occur due to: - /// 1. Operation Not Supported. - /// - public CallDirection Direction - { - get - { - CallDirection callDirection; - TelephonyError error = Interop.Call.GetDirection(_callHandle, out callDirection); - if (error != TelephonyError.None) - { - Tizen.Log.Error(Interop.Telephony.LogTag, "GetDirection Failed with Error " + error); - return CallDirection.Unavailable; - } - - return callDirection; - } - - } - - /// - /// Gets whether the call is a conference call or not. - /// - /// 3 - /// - /// The value whether the call is a conference call or not (true: Conference call, false: Single call). - /// - public bool ConferenceStatus - { - get - { - bool callConfStatus; - TelephonyError error = Interop.Call.GetConferenceStatus(_callHandle, out callConfStatus); - if (error != TelephonyError.None) - { - Tizen.Log.Error(Interop.Telephony.LogTag, "GetConferenceStatus Failed with Error " + error); - return false; - } - - return callConfStatus; - } - - } - - internal CallHandle(IntPtr handle) - { - _callHandle = handle; - } - } -} diff --git a/src/Tizen.Telephony/Tizen.Telephony/ChangeNotificationEventArgs.cs b/src/Tizen.Telephony/Tizen.Telephony/ChangeNotificationEventArgs.cs deleted file mode 100644 index 0c4b6de50..000000000 --- a/src/Tizen.Telephony/Tizen.Telephony/ChangeNotificationEventArgs.cs +++ /dev/null @@ -1,319 +0,0 @@ -/* - * 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.Telephony -{ - /// - /// This class contains the data related to the Notification event. - /// - public class ChangeNotificationEventArgs : EventArgs - { - internal ChangeNotificationEventArgs(Notification noti, object data) - { - NotificationType = noti; - NotificationData = data; - } - - /// - /// Enumeration for the Telephony Notification. - /// - public enum Notification - { - /// - /// The notification to be invoked when the SIM card state changes. - /// SIM.State will be delivered in the notification data. - /// - /// 3 - /// - /// http://tizen.org/privilege/telephony - /// - SimStatus = 0x10, - /// - /// The notification to be invoked when the SIM call forwarding indicator state changes. - /// 'state(bool)' will be delivered in the notification data. - /// - /// 3 - /// - /// http://tizen.org/privilege/telephony - /// - SimCallForwardingIndicatorState, - /// - /// The notification to be invoked when the network service state changes. - /// Network.ServiceState will be delivered in the notification data. - /// - /// 3 - /// - /// http://tizen.org/privilege/telephony - /// - NetworkServiceState = 0x20, - /// - /// The notification to be invoked when the cell ID changes. - /// 'cell_id(int)' will be delivered in the notification data. - /// - /// 3 - /// - /// http://tizen.org/privilege/location.coarse - /// - NetworkCellid, - /// - /// The notification to be invoked when the roaming status changes. - /// 'roaming_status(bool)' will be delivered in the notification data. - /// - /// 3 - /// - /// http://tizen.org/privilege/telephony - /// - NetworkRoamingStatus, - /// - /// The notification to be invoked when the signal strength changes. - /// Network.Rssi will be delivered in the notification data. - /// - /// 3 - /// - /// http://tizen.org/privilege/telephony - /// - NetworkSignalstrengthLevel, - /// - /// The notification to be invoked when the network name changes. - /// 'network_name(string)' will be delivered in the notification data. - /// - /// 3 - /// - /// http://tizen.org/privilege/telephony - /// - NetworkNetworkName, - /// - /// The notification to be invoked when the PS type changes. - /// Network.PSType will be delivered in the notification data. - /// - /// 3 - /// - /// http://tizen.org/privilege/telephony - /// - NetworkPsType, - /// - /// The notification to be invoked when the default data subscription changes. - /// Network.DefaultDataSubscription will be delivered in the notification data. - /// - /// 3 - /// - /// http://tizen.org/privilege/telephony - /// - NetworkDefaultDataSubscription, - /// - /// The notification to be invoked when the default subscription changes. - /// Network.DefaultSubscription will be delivered in the notification data. - /// - /// 3 - /// - /// http://tizen.org/privilege/telephony - /// - NetworkDefaultSubscription, - /// - /// The notification to be invoked when the LAC (Location Area Code) changes. - /// 'lac(int)' will be delivered in the notification data. - /// - /// 3 - /// - /// http://tizen.org/privilege/location.coarse - /// - NetworkLac, - /// - /// The notification to be invoked when the TAC (Tracking Area Code) changes. - /// 'tac(int)' will be delivered in the notification data. - /// - /// 3 - /// - /// http://tizen.org/privilege/location.coarse - /// - NetworkTac, - /// - /// The notification to be invoked when the system ID changes. - /// 'sid(int)' will be delivered in the notification data. - /// - /// 3 - /// - /// http://tizen.org/privilege/location.coarse - /// - NetworkSystemId, - /// - /// The notification to be invoked when the network ID changes. - /// 'nid(int)' will be delivered in the notification data. - /// - /// 3 - /// - /// http://tizen.org/privilege/location.coarse - /// - NetworkId, - /// - /// The notification to be invoked when the base station ID changes. - /// 'id(int)' will be delivered in the notification data. - /// - /// 3 - /// - /// http://tizen.org/privilege/location.coarse - /// - NetworkBsId, - /// - /// The notification to be invoked when the base station latitude changes. - /// 'latitude(int)' will be delivered in the notification data. - /// - /// 3 - /// - /// http://tizen.org/privilege/location.coarse - /// - NetworkBsLatitude, - /// - /// The notification to be invoked when the base station longitude changes. - /// 'longitue(int)' will be delivered in the notification data. - /// - /// 3 - /// - /// http://tizen.org/privilege/location.coarse - /// - NetworkBsLongitude, - /// - /// The notification to be invoked when a voice call is in the idle status. - /// 'handle id(uint)' will be delivered in the notification data. - /// - /// 3 - /// - /// http://tizen.org/privilege/telephony - /// - VoiceCallStatusIdle, - /// - /// The notification to be invoked when a voice call is in the active status. - /// 'handle id(uint)' will be delivered in the notification data. - /// - /// 3 - /// - /// http://tizen.org/privilege/telephony - /// - VoiceCallStatusActive, - /// - /// The notification to be invoked when a voice call is in the held status. - /// 'handle id(uint)' will be delivered in the notification data. - /// - /// 3 - /// - /// http://tizen.org/privilege/telephony - /// - VoiceCallStatusHeld, - /// - /// The notification to be invoked when a voice call is in the dialing status. - /// 'handle id(uint)' will be delivered in the notification data. - /// - /// 3 - /// - /// http://tizen.org/privilege/telephony - /// - VoiceCallStatusDialing, - /// - /// The notification to be invoked when a voice call is in the alerting status. - /// 'handle id(uint)' will be delivered in the notification data. - /// - /// 3 - /// - /// http://tizen.org/privilege/telephony - /// - VoiceCallStatusAlerting, - /// - /// The notification to be invoked when a voice call is in the incoming status. - /// 'handle id(uint)' will be delivered in the notification data. - /// - /// 3 - /// - /// http://tizen.org/privilege/telephony - /// - VoiceCallStatusIncoming, - /// - /// The notification to be invoked when a video call is in the idle status. - /// 'handle id(uint)' will be delivered in the notification data. - /// - /// 3 - /// - /// http://tizen.org/privilege/telephony - /// - VideoCallStatusIdle, - /// - /// The notification to be invoked when a video call is in the active status. - /// 'handle id(uint)' will be delivered in the notification data. - /// - /// 3 - /// - /// http://tizen.org/privilege/telephony - /// - VideoCallStatusActive, - /// - /// The notification to be invoked when a video call is in the dialing status. - /// 'handle id(uint)' will be delivered in the notification data. - /// - /// 3 - /// - /// http://tizen.org/privilege/telephony - /// - VideoCallStatusDialing, - /// - /// The notification to be invoked when a video call is in the alerting status. - /// 'handle id(uint)' will be delivered in the notification data. - /// - /// 3 - /// - /// http://tizen.org/privilege/telephony - /// - VideoCallStatusAlerting, - /// - /// The notification to be invoked when a video call is in the incoming status. - /// 'handle id(uint)' will be delivered in the notification data. - /// - /// 3 - /// - /// http://tizen.org/privilege/telephony - /// - VideoCallStatusIncoming, - /// - /// The notification to be invoked when the preferred voice subscription changes. - /// CallPreferredVoiceSubscription will be delivered in the notification data. - /// - /// 3 - /// - /// http://tizen.org/privilege/telephony - /// - CallPreferredVoiceSubscription - }; - - /// - /// The Telephony Notification type. - /// - /// 3 - public Notification NotificationType - { - get; - internal set; - } - - /// - /// The data as per the Notification type. - /// - /// 3 - public object NotificationData - { - get; - internal set; - } - } -} diff --git a/src/Tizen.Telephony/Tizen.Telephony/ExceptionFactory.cs b/src/Tizen.Telephony/Tizen.Telephony/ExceptionFactory.cs deleted file mode 100644 index 885b138c3..000000000 --- a/src/Tizen.Telephony/Tizen.Telephony/ExceptionFactory.cs +++ /dev/null @@ -1,77 +0,0 @@ -/* - * 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.Telephony -{ - internal static class ExceptionFactory - { - internal static Exception CreateException(Interop.Telephony.TelephonyError err) - { - Tizen.Log.Error(Interop.Telephony.LogTag, "Error " + err); - Exception exp; - switch (err) - { - case Interop.Telephony.TelephonyError.InvalidParameter: - { - exp = new ArgumentException("Invalid Parameters Provided"); - break; - } - - case Interop.Telephony.TelephonyError.NotSupported: - { - exp = new NotSupportedException("Not Supported"); - break; - } - - case Interop.Telephony.TelephonyError.OperationFailed: - { - exp = new InvalidOperationException("Operation Failed"); - break; - } - - case Interop.Telephony.TelephonyError.OutOfMemory: - { - exp = new OutOfMemoryException("Out Of Memory"); - break; - } - - case Interop.Telephony.TelephonyError.PermissionDenied: - { - exp = new UnauthorizedAccessException("Permission Denied"); - break; - } - - case Interop.Telephony.TelephonyError.SIMNotAvailable: - { - exp = new InvalidOperationException("SIM is Not Available"); - break; - } - - default: - { - exp = new Exception(""); - break; - } - - } - - return exp; - } - - } -} diff --git a/src/Tizen.Telephony/Tizen.Telephony/Modem.cs b/src/Tizen.Telephony/Tizen.Telephony/Modem.cs deleted file mode 100644 index ea19eebf8..000000000 --- a/src/Tizen.Telephony/Tizen.Telephony/Modem.cs +++ /dev/null @@ -1,154 +0,0 @@ -/* - * 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 static Interop.Telephony; -namespace Tizen.Telephony -{ - /// - /// This class provides APIs to obtain information from the modem. - /// - public class Modem - { - internal IntPtr _handle; - - /// - /// The Modem class constructor. - /// - /// 3 - /// - /// SlotHandle received in the Manager.Init API. - /// - /// http://tizen.org/feature/network.telephony - /// The required feature is not supported. - /// - /// This exception occurs if the handle provided is null. - /// - public Modem(SlotHandle handle) - { - if (handle == null) - { - throw new ArgumentNullException(); - } - - _handle = handle._handle; - } - - /// - /// Enumeration for the Modem Power Status. - /// - public enum PowerStatus - { - /// - /// Unknown. - /// - Unknown = -1, - /// - /// Modem power ON. - /// - On, - /// - /// Modem power OFF. - /// - Off, - /// - /// Modem power RESET. - /// - Reset, - /// - /// Modem power LOW. - /// - Low - }; - - /// - /// Gets the IMEI (International Mobile Station Equipment Identity) of a mobile phone. - /// The IMEI number is used by a GSM network to identify valid devices and therefore, can be used for stopping a stolen phone from accessing that network. - /// - /// 3 - /// http://tizen.org/privilege/telephony - /// - /// The International Mobile Station Equipment Identity. - /// Empty string if unable to complete the operation. - /// - public string Imei - { - get - { - string imei; - TelephonyError error = Interop.Modem.GetImei(_handle, out imei); - if (error != TelephonyError.None) - { - Tizen.Log.Error(Interop.Telephony.LogTag, "GetImei Failed with error " + error); - return ""; - } - - return imei; - } - } - - /// - /// Gets the power status of the modem. - /// - /// 3 - /// http://tizen.org/privilege/telephony - /// - /// The Modem power status (0=on,1=off,2=reset,3=low). - /// - public PowerStatus CurrentPowerStatus - { - get - { - PowerStatus status; - TelephonyError error = Interop.Modem.GetPowerStatus(_handle, out status); - if (error != TelephonyError.None) - { - Tizen.Log.Error(Interop.Telephony.LogTag, "GetImei Failed with error " + error); - return PowerStatus.Unknown; - } - - return status; - } - - } - - /// - /// Gets the MEID (Mobile Equipment Identifier) of a mobile phone (for CDMA). - /// - /// 3 - /// http://tizen.org/privilege/telephony - /// - /// The Mobile Equipment Identifier. - /// Empty string if unable to complete the operation. - /// - public string Meid - { - get - { - string meid; - TelephonyError error = Interop.Modem.GetMeid(_handle, out meid); - if (error != TelephonyError.None) - { - Tizen.Log.Error(Interop.Telephony.LogTag, "GetMeid Failed with error " + error); - return ""; - } - - return meid; - } - - } - } -} diff --git a/src/Tizen.Telephony/Tizen.Telephony/Network.cs b/src/Tizen.Telephony/Tizen.Telephony/Network.cs deleted file mode 100644 index 5f078c0eb..000000000 --- a/src/Tizen.Telephony/Tizen.Telephony/Network.cs +++ /dev/null @@ -1,831 +0,0 @@ -/* - * 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 static Interop.Telephony; -namespace Tizen.Telephony -{ - /// - /// The Network class provides APIs to obtain information about the current telephony service network. - /// - public class Network - { - internal IntPtr _handle; - - /// - /// The Network class constructor. - /// - /// 3 - /// - /// SlotHandle received in the Manager.Init API. - /// - /// http://tizen.org/feature/network.telephony - /// The required feature is not supported. - /// - /// This exception occurs if the handle provided is null. - /// - public Network(SlotHandle handle) - { - if (handle == null) - { - throw new ArgumentNullException(); - } - - _handle = handle._handle; - } - - /// - /// Enumeration for the RSSI (Receive Signal Strength Indicator). - /// Rssi6 indicates the highest strength. - /// - public enum Rssi - { - /// - /// Strength 0. - /// - Rssi0, - /// - /// Strength 1. - /// - Rssi1, - /// - /// Strength 2. - /// - Rssi2, - /// - /// Strength 3. - /// - Rssi3, - /// - /// Strength 4. - /// - Rssi4, - /// - /// Strength 5. - /// - Rssi5, - /// - /// Strength 6. - /// - Rssi6, - /// - /// Unavailable. - /// - Unavailable - } - - /// - /// Enumeration for the network types. - /// - public enum Type - { - /// - /// Unknown. - /// - Unknown, - /// - /// 2G GSM network type. - /// - Gsm, - /// - /// 2.5G GPRS network type. - /// - Gprs, - /// - /// 2.5G EDGE network type. - /// - Edge, - /// - /// 3G UMTS network type. - /// - Umts, - /// - /// HSDPA network type. - /// - Hsdpa, - /// - /// LTE network type. - /// - Lte, - /// - /// IS95A network type. - /// - Is95a, - /// - /// IS95B network type. - /// - Is95b, - /// - /// CDMA 1x network type. - /// - Cdma1X, - /// - /// EVDO revision 0 network type. - /// - EvdoRev0, - /// - /// EVDO revision A network type. - /// - EvdoRevA, - /// - /// EVDO revision B network type. - /// - EvdoRevB, - /// - /// EVDV network type. - /// - Evdv, - /// - /// EHRPD network type. - /// - Ehrpd - } - - /// - /// Enumeration for the PS types. - /// - public enum PsType - { - /// - /// Unknown. - /// - Unknown, - /// - /// HSDPA PS type. - /// - Hsdpa, - /// - /// HSUPA PS type. - /// - Hsupa, - /// - /// HSPA PS type. - /// - Hspa, - /// - /// HSPAP PS type. - /// - Hspap - } - - /// - /// Enumeration for the network service states. - /// - public enum ServiceState - { - /// - /// In service. - /// - InService, - /// - /// Out of service. - /// - OutOfService, - /// - /// Only emergency call is allowed. - /// - EmergencyOnly, - /// - /// Unavailable. - /// - Unavailable - } - - /// - /// Enumeration for the network name priority. - /// - public enum NameOption - { - /// - /// Unknown. - /// - Unknown, - /// - /// The network name displayed by the SPN. - /// - Spn, - /// - /// The network name displayed by the Network. - /// - Network, - /// - /// The network name displayed by the SPN or the Network. - /// - Any - } - - /// - /// Enumeration for the possible 'default' Data Subscriptions for the Packet Switched(PS). - /// - public enum DefaultDataSubscription - { - /// - /// Unknown status. - /// - Unknown = -1, - /// - /// SIM 1. - /// - Sim1, - /// - /// SIM 2. - /// - Sim2 - } - - /// - /// Enumeration for defining the possible 'default' Subscriptions for the Circuit Switched(CS). - /// - public enum DefaultSubscription - { - /// - /// Unknown status. - /// - Unknown = -1, - /// - /// SIM 1 network. - /// - Sim1, - /// - /// SIM 2 network. - /// - Sim2 - } - - /// - /// Enumeration for the network selection modes. - /// - public enum SelectionMode - { - /// - /// Automatic mode. - /// - Automatic, - /// - /// Manual mode. - /// - Manual, - /// - /// Unavailable. - /// - Unavailable - } - - /// - /// Gets the LAC (Location Area Code) of the current location. - /// - /// 3 - /// http://tizen.org/privilege/location.coarse - /// - /// This API can be used in the GSM/WCDMA network. - /// - /// - /// The Location Area Code, -1 if unknown. - /// - public int Lac - { - get - { - int lac; - TelephonyError error = Interop.Network.GetLac(_handle, out lac); - if (error != TelephonyError.None) - { - Tizen.Log.Error(Interop.Telephony.LogTag, "GetLac Failed with error " + error); - return -1; - } - - Log.Info(Interop.Telephony.LogTag, "Lac Value " + lac); - return lac; - } - - } - - /// - /// Gets the cell ID of the current location. - /// - /// 3 - /// http://tizen.org/privilege/location.coarse - /// - /// This API can be used in the GSM/WCDMA/LTE network. - /// - /// - /// The cell identification number, -1 if unknown. - /// - public int CellId - { - get - { - int cellId; - TelephonyError error = Interop.Network.GetCellId(_handle, out cellId); - if (error != TelephonyError.None) - { - Tizen.Log.Error(Interop.Telephony.LogTag, "GetCellId Failed with error " + error); - return -1; - } - - Log.Info(Interop.Telephony.LogTag, "CellId Value " + cellId); - return cellId; - } - } - - /// - /// Gets the RSSI (Received Signal Strength Indicator). - /// - /// 3 - /// http://tizen.org/privilege/telephony - /// - /// The Received Signal Strength Indicator. - /// Higher the received number, the stronger the signal strength. - /// - public Rssi CurrentRssi - { - get - { - Rssi currentRssi; - TelephonyError error = Interop.Network.GetRssi(_handle, out currentRssi); - if (error != TelephonyError.None) - { - Tizen.Log.Error(Interop.Telephony.LogTag, "GetRssi Failed with error " + error); - return Rssi.Unavailable; - } - - Log.Info(Interop.Telephony.LogTag, "CurrentRssi Value " + currentRssi); - return currentRssi; - } - } - - /// - /// Gets the roaming state of the current registered network. - /// - /// 3 - /// http://tizen.org/privilege/telephony - /// - /// true if roaming, otherwise false if not roaming. - /// - public bool RoamingStatus - { - get - { - bool roamingStatus; - TelephonyError error = Interop.Network.GetRoamingStatus(_handle, out roamingStatus); - if (error != TelephonyError.None) - { - Tizen.Log.Error(Interop.Telephony.LogTag, "GetRoamingStatus Failed with error " + error); - return false; - } - - return roamingStatus; - } - } - - /// - /// Gets the MCC (Mobile Country Code) of the current registered network. - /// - /// 3 - /// http://tizen.org/privilege/telephony - /// - /// This API can be used in the GSM/WCDMA/LTE network. - /// - /// - /// The Mobile Country Code (three digits). The Mobile Country Code (MCC) identifies the country where the cell is being used. - /// Empty string if unknown. - /// - public string Mcc - { - get - { - string mcc; - TelephonyError error = Interop.Network.GetMcc(_handle, out mcc); - if (error != TelephonyError.None) - { - Tizen.Log.Error(Interop.Telephony.LogTag, "GetMcc Failed with error " + error); - return ""; - } - - return mcc; - } - } - - /// - /// Gets the MNC (Mobile Network Code) of the current registered network. - /// - /// 3 - /// http://tizen.org/privilege/telephony - /// - /// This API can be used in the GSM/WCDMA/LTE network. - /// - /// - /// The Mobile Network Code (three digits). The Mobile Network Code (MNC) identifies the mobile phone operator and the network provider. - /// Empty string if unknown. - /// - public string Mnc - { - get - { - string mnc; - TelephonyError error = Interop.Network.GetMnc(_handle, out mnc); - if (error != TelephonyError.None) - { - Tizen.Log.Error(Interop.Telephony.LogTag, "GetMnc Failed with error " + error); - return ""; - } - - return mnc; - } - } - - /// - /// Gets the name of the current registered network. - /// - /// 3 - /// http://tizen.org/privilege/telephony - /// - /// This API can be used in the GSM/WCDMA/LTE network. - /// - /// - /// The name of the current registered network. - /// Empty string if unknown. - /// - public string NetworkName - { - get - { - string networkName; - TelephonyError error = Interop.Network.GetNetworkName(_handle, out networkName); - if (error != TelephonyError.None) - { - Tizen.Log.Error(Interop.Telephony.LogTag, "GetNetworkName Failed with error " + error); - return ""; - } - - return networkName; - } - } - - /// - /// Gets the network service type of the current registered network. - /// - /// 3 - /// http://tizen.org/privilege/telephony - /// - /// This API can be used in case the network is in service. - /// - /// - /// The network service type. - /// - public Type NetworkType - { - get - { - Type networkType; - TelephonyError error = Interop.Network.GetType(_handle, out networkType); - if (error != TelephonyError.None) - { - Tizen.Log.Error(Interop.Telephony.LogTag, "GetType Failed with error " + error); - return Type.Unknown; - } - - return networkType; - } - } - - /// - /// Gets the packet service type of the current registered network. - /// - /// 3 - /// http://tizen.org/privilege/telephony - /// - /// This API can be used in the HSDPA network. - /// - /// - /// The type of the packet service. - /// - public PsType NetworkPsType - { - get - { - PsType networkPsType; - TelephonyError error = Interop.Network.GetPsType(_handle, out networkPsType); - if (error != TelephonyError.None) - { - Tizen.Log.Error(Interop.Telephony.LogTag, "GetPsType Failed with error " + error); - return PsType.Unknown; - } - - return networkPsType; - } - - } - - /// - /// Gets the network name option of the current registered network. - /// - /// 3 - /// http://tizen.org/privilege/telephony - /// - /// The network name display option. - /// - public NameOption NetworkNameOption - { - get - { - NameOption networkNameOption; - TelephonyError error = Interop.Network.GetNetworkNameOption(_handle, out networkNameOption); - if (error != TelephonyError.None) - { - Tizen.Log.Error(Interop.Telephony.LogTag, "GetNetworkNameOption Failed with error " + error); - return NameOption.Unknown; - } - - return networkNameOption; - } - - } - - /// - /// Gets the current network state of the telephony service. - /// - /// 3 - /// http://tizen.org/privilege/telephony - /// - /// The current network state. - /// - public ServiceState NetworkServiceState - { - get - { - ServiceState networkServiceState; - TelephonyError error = Interop.Network.GetServiceState(_handle, out networkServiceState); - if (error != TelephonyError.None) - { - Tizen.Log.Error(Interop.Telephony.LogTag, "GetServiceState Failed with error " + error); - return ServiceState.Unavailable; - } - - return networkServiceState; - } - - } - - /// - /// Gets the current default subscription for the data service (Packet Switched). - /// - /// 3 - /// http://tizen.org/privilege/telephony - /// - /// The current default data subscription. - /// - public DefaultDataSubscription NetworkDefaultDataSubscription - { - get - { - DefaultDataSubscription networkDefaultDataSubs; - TelephonyError error = Interop.Network.GetDefaultDataSubscription(_handle, out networkDefaultDataSubs); - if (error != TelephonyError.None) - { - Tizen.Log.Error(Interop.Telephony.LogTag, "GetDefaultDataSubscription Failed with error " + error); - return DefaultDataSubscription.Unknown; - } - - return networkDefaultDataSubs; - } - - } - - /// - /// Gets the current default subscription for the voice service (Circuit Switched). - /// - /// 3 - /// http://tizen.org/privilege/telephony - /// - /// The current default voice subscription. - /// - public DefaultSubscription NetworkDefaultSubscription - { - get - { - DefaultSubscription networkDefaultSubscription; - TelephonyError error = Interop.Network.GetDefaultSubscription(_handle, out networkDefaultSubscription); - if (error != TelephonyError.None) - { - Tizen.Log.Error(Interop.Telephony.LogTag, "GetDefaultSubscription Failed with error " + error); - return DefaultSubscription.Unknown; - } - - return networkDefaultSubscription; - } - - } - - /// - /// Gets the network selection mode. - /// - /// 3 - /// http://tizen.org/privilege/telephony - /// - /// The network selection mode. - /// - public SelectionMode NetworkSelectionMode - { - get - { - SelectionMode networkSelectionMode; - TelephonyError error = Interop.Network.GetSelectionMode(_handle, out networkSelectionMode); - if (error != TelephonyError.None) - { - Tizen.Log.Error(Interop.Telephony.LogTag, "GetSelectionMode Failed with error " + error); - return SelectionMode.Unavailable; - } - - return networkSelectionMode; - } - - } - - /// - /// Gets the TAC (Tracking Area Code) of the current location. - /// - /// 3 - /// http://tizen.org/privilege/location.coarse - /// - /// This API can be used in the LTE network. - /// - /// - /// The Tracking Area Code. - /// -1 if unknown. - /// - public int Tac - { - get - { - int tac; - TelephonyError error = Interop.Network.GetTac(_handle, out tac); - if (error != TelephonyError.None) - { - Tizen.Log.Error(Interop.Telephony.LogTag, "GetTac Failed with error " + error); - return -1; - } - - return tac; - } - - } - - /// - /// Gets the system ID of the current location. - /// - /// 3 - /// http://tizen.org/privilege/location.coarse - /// - /// This API can be used in the CDMA network. - /// - /// - /// The system ID. - /// -1 if unknown. - /// - public int SystemId - { - get - { - int systemId; - TelephonyError error = Interop.Network.GetSystemId(_handle, out systemId); - if (error != TelephonyError.None) - { - Tizen.Log.Error(Interop.Telephony.LogTag, "GetSystemId Failed with error " + error); - return -1; - } - - return systemId; - } - - } - - /// - /// Gets the network ID of the current location. - /// - /// 3 - /// http://tizen.org/privilege/location.coarse - /// - /// This API can be used in the CDMA network. - /// - /// - /// The network ID. - /// -1 if unknown. - /// - public int NetworkId - { - get - { - int networkId; - TelephonyError error = Interop.Network.GetNetworkId(_handle, out networkId); - if (error != TelephonyError.None) - { - Tizen.Log.Error(Interop.Telephony.LogTag, "GetNetworkId Failed with error " + error); - return -1; - } - - return networkId; - } - - } - - /// - /// Gets the base station ID of the current location. - /// - /// 3 - /// http://tizen.org/privilege/location.coarse> - /// - /// This API can be used in the CDMA network. - /// - /// - /// The base station ID. - /// -1 if unknown. - /// - - public int BaseStationId - { - get - { - int baseStationId; - TelephonyError error = Interop.Network.GetBaseStationId(_handle, out baseStationId); - if (error != TelephonyError.None) - { - Tizen.Log.Error(Interop.Telephony.LogTag, "GetBaseStationId Failed with error " + error); - return -1; - } - - return baseStationId; - } - - } - - /// - /// Gets the base station latitude of the current location. - /// - /// 3 - /// http://tizen.org/privilege/location.coarse - /// - /// This API can be used in the CDMA network. - /// - /// - /// The base station latitude. - /// 0x7FFFFFFF if unknown. - /// - public int BaseStationLatitude - { - get - { - int baseStationLatitude; - TelephonyError error = Interop.Network.GetBaseStationLatitude(_handle, out baseStationLatitude); - if (error != TelephonyError.None) - { - Tizen.Log.Error(Interop.Telephony.LogTag, "GetBaseStationLatitude Failed with error " + error); - return 0x7FFFFFFF; - } - - return baseStationLatitude; - } - } - - /// - /// Gets the base station longitude of the current location. - /// - /// 3 - /// http://tizen.org/privilege/location.coarse - /// - /// This API can be used in the CDMA network. - /// - /// - /// The base station latitude. - /// 0x7FFFFFFF if unknown. - /// - public int BaseStationLongitude - { - get - { - int baseStationLongitude; - TelephonyError error = Interop.Network.GetBaseStationLongitude(_handle, out baseStationLongitude); - if (error != TelephonyError.None) - { - Tizen.Log.Error(Interop.Telephony.LogTag, "GetBaseStationLongitude Failed with error " + error); - return 0x7FFFFFFF; - } - - return baseStationLongitude; - } - } - } -} diff --git a/src/Tizen.Telephony/Tizen.Telephony/Sim.cs b/src/Tizen.Telephony/Tizen.Telephony/Sim.cs deleted file mode 100644 index afd68289f..000000000 --- a/src/Tizen.Telephony/Tizen.Telephony/Sim.cs +++ /dev/null @@ -1,465 +0,0 @@ -/* - * 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 static Interop.Telephony; - -namespace Tizen.Telephony -{ - /// - /// This class provides APIs that allow you to extract the information stored on a SIM card. - /// - public class Sim - { - internal IntPtr _handle; - - /// - /// The SIM class constructor. - /// - /// 3 - /// - /// SlotHandle received in the Manager.Init API. - /// - /// http://tizen.org/feature/network.telephony - /// The required feature is not supported. - /// - /// This exception occurs if the handle provided is null. - /// - public Sim(SlotHandle handle) - { - if (handle == null) - { - throw new ArgumentNullException(); - } - - _handle = handle._handle; - } - - /// - /// Enumeration for the state of the SIM card. - /// - public enum State - { - /// - /// The SIM is not available on this device. - /// - Unavailable, - /// - /// The SIM is locked. - /// - Locked, - /// - /// The SIM is available on this device (SIM is not locked). - /// - Available, - /// - /// The SIM is in transition between states. - /// - Unknown - } - - /// - /// Enumeration for the lock state of the SIM card. - /// - public enum LockState - { - /// - /// The SIM is not in lock. - /// - Unknown, - /// - /// The SIM is PIN (Personal Identification Number) locked. - /// - PinRequired, - /// - /// The SIM is PUK (Personal Unblocking Code) locked. - /// - PukRequired, - /// - /// The SIM is permanently blocked (All the attempts for PIN/PUK failed). - /// - PermLocked, - /// - /// The SIM is NCK (Network Control Key) locked. - /// - NckRequired - } - - /// - /// Enumeration for the type of the SIM card. - /// - public enum ApplicationType - { - /// - /// SIM (GSM) application. - /// - Sim = 0x01, - /// - /// USIM application. - /// - Usim = 0x02, - /// - /// CDMA application. - /// - Csim = 0x04, - /// - /// ISIM application. - /// - Isim = 0x08 - } - - /// - /// Gets the Integrated Circuit Card IDentification (ICC-ID). - /// The Integrated Circuit Card Identification number internationally identifies SIM cards. - /// - /// 3 - /// http://tizen.org/privilege/telephony - /// - /// The Integrated Circuit Card Identification. - /// Empty string if unable to complete the operation. - /// - /// - /// The SIM state must be Available. - /// - public string IccId - { - get - { - string iccId; - TelephonyError error = Interop.Sim.GetIccId(_handle, out iccId); - if (error != TelephonyError.None) - { - Tizen.Log.Error(Interop.Telephony.LogTag, "GetIccId Failed with error " + error); - return ""; - } - - return iccId; - } - } - - /// - /// Gets the SIM Operator (MCC [3 digits] + MNC [2~3 digits]). - /// The Operator is embedded in the SIM card. - /// - /// 3 - /// http://tizen.org/privilege/telephony - /// - /// The SIM Operator. - /// Empty string if unable to complete the operation. - /// - /// - /// The SIM state must be Available. - /// - public string Operator - { - get - { - string simOperator; - TelephonyError error = Interop.Sim.GetOperator(_handle, out simOperator); - if (error != TelephonyError.None) - { - Tizen.Log.Error(Interop.Telephony.LogTag, "GetOperator Failed with error " + error); - return ""; - } - - return simOperator; - } - } - - /// - /// Gets the Mobile Subscription Identification Number (MSIN [9~10 digits]) of the SIM provider. - /// - /// 3 - /// http://tizen.org/privilege/telephony - /// - /// The Mobile Subscription Identification Number. - /// Empty string if unable to complete the operation. - /// - /// - /// The SIM state must be Available. - /// - public string Msin - { - get - { - string msin; - TelephonyError error = Interop.Sim.GetMsin(_handle, out msin); - if (error != TelephonyError.None) - { - Tizen.Log.Error(Interop.Telephony.LogTag, "GetMsin Failed with error " + error); - return ""; - } - - return msin; - } - } - - /// - /// Gets the Service Provider Name (SPN) of the SIM card. - /// Gets Service Provider Name embedded in the SIM card. If this value is not stored in the SIM card, an empty string will be returned. - /// - /// 3 - /// http://tizen.org/privilege/telephony - /// - /// The Service Provider Name. - /// Empty string if unable to complete the operation. - /// - /// - /// The SIM state must be Available. - /// - public string Spn - { - get - { - string spn; - TelephonyError error = Interop.Sim.GetSpn(_handle, out spn); - if (error != TelephonyError.None) - { - Tizen.Log.Error(Interop.Telephony.LogTag, "GetSpn Failed with error " + error); - return ""; - } - - return spn; - } - } - - /// - /// Checks whether the current SIM card is different from the previous SIM card. - /// - /// 3 - /// http://tizen.org/privilege/telephony - /// - /// true if the current SIM card is different from the previous SIM card, otherwise false if the SIM card is not changed. - /// - /// - /// The SIM state must be Available. - /// - public bool IsChanged - { - get - { - int ischanged; - bool isChanged = false; ; - TelephonyError error = Interop.Sim.IsChanged(_handle, out ischanged); - if (error != TelephonyError.None) - { - Tizen.Log.Error(Interop.Telephony.LogTag, "IsChanged Failed with error " + error); - return false; - } - - if (ischanged > 0) - { - isChanged = true; - } - - return isChanged; - } - } - - /// - /// Gets the state of the SIM. - /// - /// 3 - /// http://tizen.org/privilege/telephony - /// - /// The current state of the SIM. - /// - public State CurrentState - { - get - { - State currentState; - TelephonyError error = Interop.Sim.GetState(_handle, out currentState); - if (error != TelephonyError.None) - { - Tizen.Log.Error(Interop.Telephony.LogTag, "GetState Failed with error " + error); - return State.Unavailable; - } - - return currentState; - } - } - - /// - /// Gets the count of an application on the UICC. - /// - /// 3 - /// http://tizen.org/privilege/telephony - /// - /// The masking value for below values are provided by the enumeration ApplicationType. - /// 0 if unable to complete the operation. - /// - /// - /// The SIM state must be Available. - /// - public uint ApplicationList - { - get - { - uint appList; - TelephonyError error = Interop.Sim.GetApplicationList(_handle, out appList); - if (error != TelephonyError.None) - { - Tizen.Log.Error(Interop.Telephony.LogTag, "GetApplicationList Failed with error " + error); - return 0; - } - - return appList; - } - } - - /// - /// Gets the subscriber number embedded in the SIM card. This value contains the MSISDN related to the subscriber. - /// If this value is not stored in SIM card, an empty string will be returned. - /// - /// 3 - /// http://tizen.org/privilege/telephony - /// - /// The subscriber number in the SIM. - /// Empty string if unable to complete the operation. - /// - /// - /// The SIM state must be Available. - /// - public string SubscriberNumber - { - get - { - string subscriberNumber; - TelephonyError error = Interop.Sim.GetSubscriberNumber(_handle, out subscriberNumber); - if (error != TelephonyError.None) - { - Tizen.Log.Error(Interop.Telephony.LogTag, "GetSubscriberNumber Failed with error " + error); - return ""; - } - - return subscriberNumber; - } - } - - /// - /// Gets the subscriber ID. - /// - /// 3 - /// http://tizen.org/privilege/telephony - /// - /// The subscriber ID. - /// Empty string if unable to complete the operation. - /// - /// - /// The SIM state must be Available. - /// - public string SubscriberId - { - get - { - string subscriberId; - TelephonyError error = Interop.Sim.GetSubscriberId(_handle, out subscriberId); - if (error != TelephonyError.None) - { - Tizen.Log.Error(Interop.Telephony.LogTag, "GetSubscriberId Failed with error " + error); - return ""; - } - - return subscriberId; - } - } - - /// - /// Gets the lock state of the SIM. - /// - /// 3 - /// http://tizen.org/privilege/telephony - /// - /// The current lock state of the SIM. - /// - /// - /// The SIM state must be Available. - /// - public LockState CurrentLockState - { - get - { - LockState currentLockState; - TelephonyError error = Interop.Sim.GetLockState(_handle, out currentLockState); - if (error != TelephonyError.None) - { - Tizen.Log.Error(Interop.Telephony.LogTag, "GetLockState Failed with error " + error); - return LockState.Unknown; - } - - return currentLockState; - } - } - - /// - /// Gets the GID1 (Group Identifier Level 1). - /// Gets Group Identifier Level 1 (GID1) embedded in the SIM card. If this value is not stored in SIM card, an empty string will be returned. - /// - /// 3 - /// http://tizen.org/privilege/telephony - /// - /// The GID1 (Group Identifier Level 1). - /// Empty string if unable to complete the operation. - /// - /// - /// The SIM state must be Available. - /// - public string GroupId1 - { - get - { - string groupId1; - TelephonyError error = Interop.Sim.GetGroupId1(_handle, out groupId1); - if (error != TelephonyError.None) - { - Tizen.Log.Error(Interop.Telephony.LogTag, "GetGroupId1 Failed with error " + error); - return ""; - } - - return groupId1; - } - } - - /// - /// Gets the call forwarding indicator state of the SIM. - /// If the state is true, the incoming call will be forwarded to the selected number. State indicates the CFU (Call Forwarding Unconditional) indicator status - Voice (3GPP TS 31.102 4.2.64 EF CFIS). - /// - /// 3 - /// http://tizen.org/privilege/telephony - /// - /// The value whether the incoming call will be forwarded or not (true: forwarded, false: not forwarded). - /// - /// - /// The SIM state must be Available. - /// - public bool CallForwardingIndicatorState - { - get - { - bool callForwardingIndicatorState; - TelephonyError error = Interop.Sim.GetCallForwardingIndicatorState(_handle, out callForwardingIndicatorState); - if (error != TelephonyError.None) - { - Tizen.Log.Error(Interop.Telephony.LogTag, "GetCallForwardingIndicatorState Failed with error " + error); - return false; - } - - return callForwardingIndicatorState; - } - } - } -} diff --git a/src/Tizen.Telephony/Tizen.Telephony/SlotHandle.cs b/src/Tizen.Telephony/Tizen.Telephony/SlotHandle.cs deleted file mode 100644 index 613b6e063..000000000 --- a/src/Tizen.Telephony/Tizen.Telephony/SlotHandle.cs +++ /dev/null @@ -1,309 +0,0 @@ -/* - * 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.Collections.Generic; -using System.Runtime.InteropServices; - -namespace Tizen.Telephony -{ - /// - /// This class provides APIs that provide functionality related to the slot handle. - /// - public class SlotHandle - { - internal IntPtr _handle; - private List _changeNotificationList = new List(); - - internal SlotHandle(IntPtr handle) - { - _handle = handle; - } - - /// - /// The event handler for receiving the Telephony state changes. - /// This event will be triggered for the NotificationIds given in the SetNotificationId API. - /// - public event EventHandler ChangeNotification; - - internal IntPtr Handle - { - get - { - return _handle; - } - } - - /// - /// The notification IDs for which the ChangeNotification event will be triggered. - /// - /// 3 - /// - /// The list of notification IDs for which the ChangeNotification event will be triggered. - /// - /// http://tizen.org/feature/network.telephony - /// The required feature is not supported. - /// - /// This Exception can occur due to: - /// 1. Operation not supported. - /// 2. Operation failed. - /// - public void SetNotificationId(IEnumerable list) - { - try - { - foreach (ChangeNotificationEventArgs.Notification n in list) - { - SetCallback(n); - } - } - catch (Exception e) - { - Tizen.Log.Error(Interop.Telephony.LogTag, "SetNotificationId Failed with Error " + e.ToString()); - throw e; - } - } - - /// - /// The notification IDs for which the ChangeNotification event will not be triggered. - /// - /// 3 - /// - /// The list of notification IDs for which the ChangeNotification event will be not be triggered. - /// - /// http://tizen.org/feature/network.telephony - /// The required feature is not supported. - /// - /// This Exception can occur due to: - /// 1. Operation not supported. - /// 2. Operation failed. - /// - public void RemoveNotificationId(IEnumerable list) - { - foreach (ChangeNotificationEventArgs.Notification n in list) - { - Interop.Telephony.TelephonyError error = Interop.Telephony.TelephonyUnsetNotiCb(_handle, n); - if (error != Interop.Telephony.TelephonyError.None) - { - throw ExceptionFactory.CreateException(error); - } - } - } - - private void SetCallback(ChangeNotificationEventArgs.Notification n) - { - Interop.Telephony.NotificationCallback NotificationDelegate = (IntPtr handle, ChangeNotificationEventArgs.Notification notiId, IntPtr data, IntPtr userData) => - { - SlotHandle simHandle = Manager.FindHandle(handle); - object notiData = null; - switch (notiId) - { - case ChangeNotificationEventArgs.Notification.SimStatus: - { - notiData = (Sim.State)Marshal.ReadInt32(data); - break; - } - - case ChangeNotificationEventArgs.Notification.SimCallForwardingIndicatorState: - { - notiData = ((Marshal.ReadInt32(data) == 0) ? false : true); - break; - } - - case ChangeNotificationEventArgs.Notification.NetworkServiceState: - { - notiData = (Network.ServiceState)Marshal.ReadInt32(data); - break; - } - - case ChangeNotificationEventArgs.Notification.NetworkCellid: - { - notiData = Marshal.ReadInt32(data); - break; - } - - case ChangeNotificationEventArgs.Notification.NetworkRoamingStatus: - { - notiData = (Marshal.ReadInt32(data) == 0) ? false : true; - break; - } - - case ChangeNotificationEventArgs.Notification.NetworkSignalstrengthLevel: - { - notiData = (Network.Rssi)Marshal.ReadInt32(data); - break; - } - - case ChangeNotificationEventArgs.Notification.NetworkNetworkName: - { - notiData = Marshal.PtrToStringAnsi(data); - break; - } - - case ChangeNotificationEventArgs.Notification.NetworkPsType: - { - notiData = (Network.PsType)Marshal.ReadInt32(data); - break; - } - - case ChangeNotificationEventArgs.Notification.NetworkDefaultDataSubscription: - { - notiData = (Network.DefaultDataSubscription)Marshal.ReadInt32(data); - break; - } - - case ChangeNotificationEventArgs.Notification.NetworkDefaultSubscription: - { - notiData = (Network.DefaultSubscription)Marshal.ReadInt32(data); - break; - } - - case ChangeNotificationEventArgs.Notification.NetworkLac: - { - notiData = Marshal.ReadInt32(data); - break; - } - - case ChangeNotificationEventArgs.Notification.NetworkTac: - { - notiData = Marshal.ReadInt32(data); - break; - } - - case ChangeNotificationEventArgs.Notification.NetworkSystemId: - { - notiData = Marshal.ReadInt32(data); - break; - } - - case ChangeNotificationEventArgs.Notification.NetworkId: - { - notiData = Marshal.ReadInt32(data); - break; - } - - case ChangeNotificationEventArgs.Notification.NetworkBsId: - { - notiData = Marshal.ReadInt32(data); - break; - } - - case ChangeNotificationEventArgs.Notification.NetworkBsLatitude: - { - notiData = Marshal.ReadInt32(data); - break; - } - - case ChangeNotificationEventArgs.Notification.NetworkBsLongitude: - { - notiData = Marshal.ReadInt32(data); - break; - } - - case ChangeNotificationEventArgs.Notification.VoiceCallStatusIdle: - { - notiData = (uint)Marshal.ReadInt32(data); - break; - } - - case ChangeNotificationEventArgs.Notification.VoiceCallStatusActive: - { - notiData = (uint)Marshal.ReadInt32(data); - break; - } - - case ChangeNotificationEventArgs.Notification.VoiceCallStatusHeld: - { - notiData = (uint)Marshal.ReadInt32(data); - break; - } - - case ChangeNotificationEventArgs.Notification.VoiceCallStatusDialing: - { - notiData = (uint)Marshal.ReadInt32(data); - break; - } - - case ChangeNotificationEventArgs.Notification.VoiceCallStatusAlerting: - { - notiData = (uint)Marshal.ReadInt32(data); - break; - } - - case ChangeNotificationEventArgs.Notification.VoiceCallStatusIncoming: - { - notiData = (uint)Marshal.ReadInt32(data); - break; - } - - case ChangeNotificationEventArgs.Notification.VideoCallStatusIdle: - { - notiData = (uint)Marshal.ReadInt32(data); - break; - } - - case ChangeNotificationEventArgs.Notification.VideoCallStatusActive: - { - notiData = (uint)Marshal.ReadInt32(data); - break; - } - - case ChangeNotificationEventArgs.Notification.VideoCallStatusDialing: - { - notiData = (uint)Marshal.ReadInt32(data); - break; - } - - case ChangeNotificationEventArgs.Notification.VideoCallStatusAlerting: - { - notiData = (uint)Marshal.ReadInt32(data); - break; - } - - case ChangeNotificationEventArgs.Notification.VideoCallStatusIncoming: - { - notiData = (uint)Marshal.ReadInt32(data); - break; - } - - case ChangeNotificationEventArgs.Notification.CallPreferredVoiceSubscription: - { - notiData = (CallPreferredVoiceSubscription)Marshal.ReadInt32(data); - break; - } - - } - - ChangeNotificationEventArgs args = new ChangeNotificationEventArgs(notiId, notiData); - ChangeNotification?.Invoke(simHandle, args); - }; - _changeNotificationList.Add(NotificationDelegate); - - Interop.Telephony.TelephonyError error = Interop.Telephony.TelephonySetNotiCb(_handle, n, NotificationDelegate, IntPtr.Zero); - if (error != Interop.Telephony.TelephonyError.None) - { - Exception e = ExceptionFactory.CreateException(error); - // Check if error is Invalid Parameter then hide the error - if (e is ArgumentException) - { - e = new InvalidOperationException("Internal Error Occured"); - } - - throw e; - } - } - } -} diff --git a/src/Tizen.Telephony/Tizen.Telephony/StateEventArgs.cs b/src/Tizen.Telephony/Tizen.Telephony/StateEventArgs.cs deleted file mode 100644 index 44b67f5f3..000000000 --- a/src/Tizen.Telephony/Tizen.Telephony/StateEventArgs.cs +++ /dev/null @@ -1,40 +0,0 @@ -/* - * 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.Telephony -{ - /// - /// This class contains the data related to the State changed event. - /// - public class StateEventArgs : EventArgs - { - internal StateEventArgs(State s) - { - CurrentState = s; - } - - /// - /// The Current State. - /// - /// 3 - public State CurrentState - { - get; - internal set; - } - } -} diff --git a/src/Tizen.Telephony/Tizen.Telephony/Telephony.cs b/src/Tizen.Telephony/Tizen.Telephony/Telephony.cs deleted file mode 100644 index d26b7d5e9..000000000 --- a/src/Tizen.Telephony/Tizen.Telephony/Telephony.cs +++ /dev/null @@ -1,241 +0,0 @@ -/* - * 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.Collections.Generic; -using System.Runtime.InteropServices; -using static Interop.Telephony; - -namespace Tizen.Telephony -{ - /// - /// Enumeration for the telephony states. - /// - public enum State - { - /// - /// The telephony state is not ready. - /// - NotReady, - /// - /// The telephony state is ready. - /// - Ready, - /// - /// Unavailable. - /// - Unavailable - }; - - /// - /// Enumeration for the preferred voice call subscription. - /// - public enum CallPreferredVoiceSubscription - { - /// - /// Unknown status. - /// - Unknown = -1, - /// - /// Current network. - /// - CurrentNetwork = 0, - /// - /// Ask Always. - /// - AskAlways, - /// - /// SIM 1. - /// - Sim1, - /// - /// SIM 2. - /// - Sim2 - }; - - /// - /// This class provides APIs to initialize and deinitialize the framework. - /// It also provides APIs to get the SlotHandles, which can then be used to get other Network/Sim/Call/Modem information. - /// - public static class Manager - { - internal static List _telephonyHandle = new List(); - private static HandleList _handleList; - private static bool _isInitialized = false; - private static event EventHandler _stateChanged; - private static StateChangedCallback stateDelegate = delegate(State state, IntPtr userData) - { - StateEventArgs args = new StateEventArgs(state); - _stateChanged?.Invoke(null, args); - }; - - /// - /// The event handler to be invoked when the telephony state changes. - /// - /// 3 - public static event EventHandler StateChanged - { - add - { - if (_stateChanged == null) - { - Interop.Telephony.TelephonyError error = Interop.Telephony.TelephonySetStateChangedCb(stateDelegate, IntPtr.Zero); - if (error != TelephonyError.None) - { - Log.Error(LogTag, "Add StateChanged Failed with Error: " + error); - } - - else - { - _stateChanged += value; - } - - } - } - - remove - { - _stateChanged -= value; - if (_stateChanged == null) - { - Interop.Telephony.TelephonyError error = Interop.Telephony.TelephonyUnsetStateChangedCb(stateDelegate); - if (error != TelephonyError.None) - { - Log.Error(LogTag, "Remove StateChanged Failed with Error: " + error); - } - } - } - } - - /// - /// Acquires the telephony state value. - /// - /// 3 - /// - /// The state value of telephony. - /// - public static State CurrentState - { - get - { - State state = State.NotReady; - TelephonyError error = Interop.Telephony.TelephonyGetState(out state); - if (error != TelephonyError.None) - { - Tizen.Log.Error(Interop.Telephony.LogTag, "GetState Failed with Error " + error); - return State.Unavailable; - } - - return state; - } - } - - /// - /// Acquires the number of available handles to use the telephony API. - /// - /// 3 - /// - /// A list of telephony handles. - /// You will get 2 SlotHandles in case of the dual SIM device. - /// Where, SlotHandle at Index '0' represents the primary SIM and Index '1' represents the secondary SIM. - /// - /// http://tizen.org/feature/network.telephony - /// The required feature is not supported. - /// - /// This exception will be generated in the following cases: - /// 1. The system is out of memory. - /// 2. If the operation is not supported on the device. - /// 3. If the operation failed. - /// - public static IEnumerable Init() - { - //DeInitialize Previous Handles if present - if (_isInitialized) - { - Deinit(); - } - - TelephonyError err = Interop.Telephony.TelephonyInit(out _handleList); - if (err != TelephonyError.None) - { - Exception e = ExceptionFactory.CreateException(err); - // Check if error is Invalid Parameter then hide the error - if (e is ArgumentException) - { - e = new InvalidOperationException("Internal Error Occured"); - } - - throw e; - } - - int offset = 0; - for (int i = 0; i < _handleList.Count; i++) - { - _telephonyHandle.Add(new SlotHandle(Marshal.ReadIntPtr(_handleList.HandleArrayPointer, offset))); - offset += Marshal.SizeOf(_handleList.HandleArrayPointer); - } - - _isInitialized = true; - //Tizen.Log.Info(Interop.Telephony.LogTag, "Returning the number of sims " + _handleList.Count); - return _telephonyHandle; - } - - /// - /// Deinitializes the telephony handles. - /// - /// 3 - /// http://tizen.org/feature/network.telephony - /// The required feature is not supported. - /// - /// This exception can be generated in the following cases: - /// 1. If the operation is not supported on the device. - /// 2. If the operation failed. - /// - public static void Deinit() - { - TelephonyError error = Interop.Telephony.TelephonyDeinit(ref _handleList); - if (error != TelephonyError.None) - { - Exception e = ExceptionFactory.CreateException(error); - // Check if error is Invalid Parameter then hide the error - if (e is ArgumentException) - { - e = new InvalidOperationException("Internal Error Occured"); - } - - throw e; - } - - _isInitialized = false; - _telephonyHandle.Clear(); - } - - internal static SlotHandle FindHandle(IntPtr handle) - { - SlotHandle temp = _telephonyHandle[0]; - foreach (SlotHandle simHandle in _telephonyHandle) - { - if (simHandle._handle == handle) - { - temp = simHandle; - } - } - - return temp; - } - } -} diff --git a/src/Tizen.Tracer/Interop/Interop.Libraries.cs b/src/Tizen.Tracer/Interop/Interop.Libraries.cs deleted file mode 100755 index cee5a2940..000000000 --- a/src/Tizen.Tracer/Interop/Interop.Libraries.cs +++ /dev/null @@ -1,15 +0,0 @@ -// Copyright 2016 by Samsung Electronics, Inc., -// -// This software is the confidential and proprietary information -// of Samsung Electronics, Inc. ("Confidential Information"). You -// shall not disclose such Confidential Information and shall use -// it only in accordance with the terms of the license agreement -// you entered into with Samsung. - -internal static partial class Interop -{ - internal static partial class Libraries - { - public const string ttrace = "libttrace.so.1"; - } -} diff --git a/src/Tizen.Tracer/Interop/Interop.Tracer.cs b/src/Tizen.Tracer/Interop/Interop.Tracer.cs deleted file mode 100755 index cd35b1b5e..000000000 --- a/src/Tizen.Tracer/Interop/Interop.Tracer.cs +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright 2016 by Samsung Electronics, Inc., -// -// This software is the confidential and proprietary information -// of Samsung Electronics, Inc. ("Confidential Information"). You -// shall not disclose such Confidential Information and shall use -// it only in accordance with the terms of the license agreement -// you entered into with Samsung. - -using System; -using System.Runtime.InteropServices; - -internal static partial class Interop -{ - internal static partial class Tracer - { - [DllImport(Libraries.ttrace, EntryPoint = "trace_begin")] - internal static extern void Begin (String name); - - [DllImport(Libraries.ttrace, EntryPoint = "trace_end")] - internal static extern void End (); - - [DllImport(Libraries.ttrace, EntryPoint = "trace_async_begin")] - internal static extern void AsyncBegin (int cookie, String name); - - [DllImport(Libraries.ttrace, EntryPoint = "trace_async_end")] - internal static extern void AsyncEnd (int cookie, String name); - - [DllImport(Libraries.ttrace, EntryPoint = "trace_update_counter")] - internal static extern void TraceValue (int value, String name); - } -} diff --git a/src/Tizen.Tracer/Tizen.Tracer.csproj b/src/Tizen.Tracer/Tizen.Tracer.csproj deleted file mode 100644 index 4c51c4197..000000000 --- a/src/Tizen.Tracer/Tizen.Tracer.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - netstandard2.0 - - - - - - - - \ No newline at end of file diff --git a/src/Tizen.Tracer/Tizen.Tracer.sln b/src/Tizen.Tracer/Tizen.Tracer.sln deleted file mode 100755 index 005034215..000000000 --- a/src/Tizen.Tracer/Tizen.Tracer.sln +++ /dev/null @@ -1,34 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26430.12 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Tracer", "Tizen.Tracer.csproj", "{3B1A591D-0DBD-4456-9602-7039ED731C8C}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen", "..\Tizen\Tizen.csproj", "{F0F11E63-929A-4B32-92D0-736B84A1E910}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Log", "..\Tizen.Log\Tizen.Log.csproj", "{64B4C36E-29ED-4C51-BD81-E673B925A2EF}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {3B1A591D-0DBD-4456-9602-7039ED731C8C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {3B1A591D-0DBD-4456-9602-7039ED731C8C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {3B1A591D-0DBD-4456-9602-7039ED731C8C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {3B1A591D-0DBD-4456-9602-7039ED731C8C}.Release|Any CPU.Build.0 = Release|Any CPU - {F0F11E63-929A-4B32-92D0-736B84A1E910}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F0F11E63-929A-4B32-92D0-736B84A1E910}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F0F11E63-929A-4B32-92D0-736B84A1E910}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F0F11E63-929A-4B32-92D0-736B84A1E910}.Release|Any CPU.Build.0 = Release|Any CPU - {64B4C36E-29ED-4C51-BD81-E673B925A2EF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {64B4C36E-29ED-4C51-BD81-E673B925A2EF}.Debug|Any CPU.Build.0 = Debug|Any CPU - {64B4C36E-29ED-4C51-BD81-E673B925A2EF}.Release|Any CPU.ActiveCfg = Release|Any CPU - {64B4C36E-29ED-4C51-BD81-E673B925A2EF}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/src/Tizen.Tracer/Tizen/Tracer.cs b/src/Tizen.Tracer/Tizen/Tracer.cs deleted file mode 100755 index 020c97fb1..000000000 --- a/src/Tizen.Tracer/Tizen/Tracer.cs +++ /dev/null @@ -1,95 +0,0 @@ -/* - * 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 -{ - /// - /// Provides functions for writing a trace message to the system trace buffer. - /// - public static class Tracer - { - /// - /// Writes a trace event to indicate that a synchronous event has begun. - /// - /// - /// The specific error code can be obtained using the Tizen.Internals.Errors.ErrorFacts.GetLastResult() method. - /// - /// The name of an event (optionally containing format specifiers). - /// - public static void Begin (String name) - { - Interop.Tracer.Begin (name); - } - - /// - /// Writes a trace event to indicate that a synchronous event has ended. - /// - /// - /// Tizen.Tracer.End() ends the most recently called Tizen.Tracer.Begin(). - /// The specific error code can be obtained using the Tizen.Internals.Errors.ErrorFacts.GetLastResult() method. - /// - /// - public static void End () - { - Interop.Tracer.End (); - } - - /// - /// Writes a trace event to indicate that an asynchronous event has begun. - /// - /// - /// The specific error code can be obtained using the Tizen.Internals.Errors.ErrorFacts.GetLastResult() method. - /// - /// An unique identifier for distinguishing simultaneous events. - /// The name of an event (optionally containing format specifiers). - /// - public static void AsyncBegin (int cookie, String name) - { - Interop.Tracer.AsyncBegin (cookie, name); - } - - /// - /// Writes a trace event to indicate that an asynchronous event has ended. - /// - /// - /// Tizen.Tracer.AsyncEnd() ends matched Tizen.Tracer.AsyncBegin() which has the same cookie and name. - /// The specific error code can be obtained using the Tizen.Internals.Errors.ErrorFacts.GetLastResult() method. - /// - /// An unique identifier for distinguishing simultaneous events. - /// The name of an event (optionally containing format specifiers). - /// - public static void AsyncEnd (int cookie, String name) - { - Interop.Tracer.AsyncEnd (cookie, name); - } - - /// - /// Writes a trace event to track change of an integer value. - /// - /// - /// The specific error code can be obtained using the Tizen.Internals.Errors.ErrorFacts.GetLastResult() method. - /// - /// The integer variable to trace. - /// The name of an event (optionally containing format specifiers). - public static void TraceValue (int value, String name) - { - Interop.Tracer.TraceValue (value, name); - } - } -} - diff --git a/src/Tizen.Uix.InputMethod/Interop/Interop.EinaList.cs b/src/Tizen.Uix.InputMethod/Interop/Interop.EinaList.cs deleted file mode 100755 index 50a64ad9b..000000000 --- a/src/Tizen.Uix.InputMethod/Interop/Interop.EinaList.cs +++ /dev/null @@ -1,35 +0,0 @@ -/* -* 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; -using Tizen.Uix.InputMethod; - -/// -/// Partial Interop Class -/// -internal static partial class Interop -{ - /// - /// EinaList Interop Class - /// - internal static class EinaList - { - [DllImport(Libraries.Eina, EntryPoint = "eina_list_append")] - internal static extern IntPtr EinaListAppend(IntPtr list, IntPtr data); - } -} \ No newline at end of file diff --git a/src/Tizen.Uix.InputMethod/Interop/Interop.InputMethod.cs b/src/Tizen.Uix.InputMethod/Interop/Interop.InputMethod.cs deleted file mode 100755 index ba421a097..000000000 --- a/src/Tizen.Uix.InputMethod/Interop/Interop.InputMethod.cs +++ /dev/null @@ -1,327 +0,0 @@ -/* -* 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; -using Tizen.Uix.InputMethod; - -/// -/// Partial Interop Class -/// -internal static partial class Interop -{ - /// - /// InputMethod Interop Class - /// - internal static class InputMethod - { - internal static string LogTag = "Tizen.Uix.InputMethod"; - - private const int ErrorInputMethod = -0x02F20000; - - internal enum ErrorCode - { - None = Tizen.Internals.Errors.ErrorCode.None, /**< Successful */ - InvalidParameter = Tizen.Internals.Errors.ErrorCode.InvalidParameter, /**< Invalid parameter */ - PermissionDenied = Tizen.Internals.Errors.ErrorCode.PermissionDenied, /**< Permission denied */ - NoCallbackFunction = ErrorInputMethod | 0x0001, /**< Necessary callback function is not set */ - NotRunning = ErrorInputMethod | 0x0002, /**< IME main loop isn't started yet */ - OperationFailed = ErrorInputMethod | 0x0010, /**< Operation failed */ - OutOfMemory = Tizen.Internals.Errors.ErrorCode.OutOfMemory /**< out of memory */ - }; - - [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)] - internal struct ImeCallbackStruct - { - [MarshalAs(UnmanagedType.FunctionPtr)] - internal ImeCreateCb create; - [MarshalAs(UnmanagedType.FunctionPtr)] - internal ImeTerminateCb terminate; - [MarshalAs(UnmanagedType.FunctionPtr)] - internal ImeShowCb show; - [MarshalAs(UnmanagedType.FunctionPtr)] - internal ImeHideCb hide; - }; - - [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)] - internal struct ImePreEditAttributeStruct - { - internal uint start; - internal uint length; - internal int type; - internal uint value; - }; - - internal sealed class ImeCallbackStructGCHandle : IDisposable - { - internal ImeCallbackStruct _imeCallbackStruct; - internal GCHandle _imeCallbackStructHandle; - public ImeCallbackStructGCHandle() - { - _imeCallbackStruct = new ImeCallbackStruct(); - _imeCallbackStructHandle = GCHandle.Alloc(_imeCallbackStruct); - } - - #region IDisposable Support - private bool disposedValue = false; - - void Dispose(bool disposing) - { - Tizen.Log.Info(LogTag, "In Dispose"); - if (!disposedValue) - { - if (disposing) - { - Tizen.Log.Info(LogTag, "In Dispose free called"); - _imeCallbackStructHandle.Free(); - } - - disposedValue = true; - } - } - - public void Dispose() - { - Dispose(true); - } - #endregion - } - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void ImeRunCb(); - - [DllImport(Libraries.InputMethod, EntryPoint = "ime_run")] - internal static extern ErrorCode ImeRun(ref ImeCallbackStruct basicCB, IntPtr userData); - - [DllImport(Libraries.InputMethod, EntryPoint = "ime_event_set_focus_in_cb")] - internal static extern ErrorCode ImeEventSetFocusedInCb(ImeFocusedInCb callbackFunction, IntPtr userData); - - [DllImport(Libraries.InputMethod, EntryPoint = "ime_event_set_focus_out_cb")] - internal static extern ErrorCode ImeEventSetFocusedOutCb(ImeFocusedOutCb callbackFunction, IntPtr userData); - - [DllImport(Libraries.InputMethod, EntryPoint = "ime_event_set_surrounding_text_updated_cb")] - internal static extern ErrorCode ImeEventSetSurroundingTextUpdatedCb(ImeSurroundingTextUpdatedCb callbackFunction, IntPtr userData); - - [DllImport(Libraries.InputMethod, EntryPoint = "ime_event_set_input_context_reset_cb")] - internal static extern ErrorCode ImeEventSetInputContextResetCb(ImeInputContextResetCb callbackFunction, IntPtr userData); - - [DllImport(Libraries.InputMethod, EntryPoint = "ime_event_set_cursor_position_updated_cb")] - internal static extern ErrorCode ImeEventSetCursorPositionitionUpdatedCb(ImeCursorPositionitionUpdatedCb callbackFunction, IntPtr userData); - - [DllImport(Libraries.InputMethod, EntryPoint = "ime_event_set_language_requested_cb")] - internal static extern ErrorCode ImeEventSetLanguageRequestedCallbackCb(ImeLanguageRequestedCb callbackFunction, IntPtr userData); - - [DllImport(Libraries.InputMethod, EntryPoint = "ime_event_set_language_set_cb")] - internal static extern ErrorCode ImeEventSetLanguageSetCb(ImeLanguageSetCb callbackFunction, IntPtr userData); - - [DllImport(Libraries.InputMethod, EntryPoint = "ime_event_set_imdata_set_cb")] - internal static extern ErrorCode ImeEventSetImdataSetCb(ImeImdataSetCb callbackFunction, IntPtr userData); - - [DllImport(Libraries.InputMethod, EntryPoint = "ime_event_set_imdata_requested_cb")] - internal static extern ErrorCode ImeEventSetImdataRequestedCb(ImeImdataRequestedCb callbackFunction, IntPtr userData); - - [DllImport(Libraries.InputMethod, EntryPoint = "ime_event_set_layout_set_cb")] - internal static extern ErrorCode ImeEventSetLayoutSetCb(ImeLayoutSetCb callbackFunction, IntPtr userData); - - [DllImport(Libraries.InputMethod, EntryPoint = "ime_event_set_return_key_type_set_cb")] - internal static extern ErrorCode ImeEventSetReturnKeySetCb(ImeReturnKeySetCb callbackFunction, IntPtr userData); - - [DllImport(Libraries.InputMethod, EntryPoint = "ime_event_set_return_key_state_set_cb")] - internal static extern ErrorCode ImeEventSetReturnKeyStateSetCb(ImeReturnKeyStateSetCb callbackFunction, IntPtr userData); - - [DllImport(Libraries.InputMethod, EntryPoint = "ime_event_set_geometry_requested_cb")] - internal static extern ErrorCode ImeEventSetGeometryRequestedCallbackCb(ImeGeometryRequestedCb callbackFunction, IntPtr userData); - - [DllImport(Libraries.InputMethod, EntryPoint = "ime_event_set_process_key_event_cb")] - internal static extern ErrorCode ImeEventSetProcessKeyEventCb(ImeProcessKeyEventCb callbackFunction, IntPtr userData); - - [DllImport(Libraries.InputMethod, EntryPoint = "ime_event_set_display_language_changed_cb")] - internal static extern ErrorCode ImeEventSetDisplayLanguageChangedCb(ImeDisplayLanguageChangedCb callbackFunction, IntPtr userData); - - [DllImport(Libraries.InputMethod, EntryPoint = "ime_event_set_rotation_degree_changed_cb")] - internal static extern ErrorCode ImeEventSetRotationChangedCb(ImeRotationChangedCb callbackFunction, IntPtr userData); - - [DllImport(Libraries.InputMethod, EntryPoint = "ime_event_set_accessibility_state_changed_cb")] - internal static extern ErrorCode ImeEventSetAccessibilityStateChangedCb(ImeAccessibilityStateChangedCb callbackFunction, IntPtr userData); - - [DllImport(Libraries.InputMethod, EntryPoint = "ime_event_set_option_window_created_cb")] - internal static extern ErrorCode ImeEventSetOptionWindowCreatedCb(ImeOptionWindowCreatedCb callbackFunction, IntPtr userData); - - [DllImport(Libraries.InputMethod, EntryPoint = "ime_event_set_option_window_destroyed_cb")] - internal static extern ErrorCode ImeEventSetOptionWindowDestroyedCb(ImeOptionWindowDestroyedCb callbackFunction, IntPtr userData); - - [DllImport(Libraries.InputMethod, EntryPoint = "ime_send_key_event")] - internal static extern ErrorCode ImeSendKeyEvent(KeyCode keycode, KeyMask keymask, bool forwardKey); - - [DllImport(Libraries.InputMethod, EntryPoint = "ime_commit_string")] - internal static extern ErrorCode ImeCommitString(string str); - - [DllImport(Libraries.InputMethod, EntryPoint = "ime_show_preedit_string")] - internal static extern ErrorCode ImeShowPreeditString(); - - [DllImport(Libraries.InputMethod, EntryPoint = "ime_hide_preedit_string")] - internal static extern ErrorCode ImeHidePreeditString(); - - [DllImport(Libraries.InputMethod, EntryPoint = "ime_update_preedit_string")] - internal static extern ErrorCode ImeUpdatePreeditString(string str, IntPtr attrs); - - [DllImport(Libraries.InputMethod, EntryPoint = "ime_request_surrounding_text")] - internal static extern ErrorCode ImeRequestSurroundingText(int maxlenBefore, int maxlenAfter); - - [DllImport(Libraries.InputMethod, EntryPoint = "ime_delete_surrounding_text")] - internal static extern ErrorCode ImeDeleteSurroundingText(int offset, int len); - - [DllImport(Libraries.InputMethod, EntryPoint = "ime_get_surrounding_text")] - internal static extern ErrorCode ImeGetSurroundingText(int maxlenBefore, int maxlenAfter, out IntPtr text, out int cursorPos); - - [DllImport(Libraries.InputMethod, EntryPoint = "ime_set_selection")] - internal static extern ErrorCode ImeSetSelection(int start, int end); - - [DllImport(Libraries.InputMethod, EntryPoint = "ime_get_main_window")] - internal static extern IntPtr ImeGetMainWindow(); - - [DllImport(Libraries.InputMethod, EntryPoint = "ime_prepare")] - internal static extern ErrorCode ImePrepare(); - - [DllImport(Libraries.InputMethod, EntryPoint = "ime_initialize")] - internal static extern ErrorCode ImeInitialize(); - - [DllImport(Libraries.InputMethod, EntryPoint = "ime_finalize")] - internal static extern ErrorCode ImeFinalize(); - - [DllImport(Libraries.InputMethod, EntryPoint = "ime_set_size")] - internal static extern ErrorCode ImeSetSize(int portraitWidth, int portraitHeight, int landscapeWidth, int landscapeHeight); - - [DllImport(Libraries.InputMethod, EntryPoint = "ime_create_option_window")] - internal static extern ErrorCode ImeCreateOptionWindow(); - - [DllImport(Libraries.InputMethod, EntryPoint = "ime_destroy_option_window")] - internal static extern ErrorCode ImeDestroyOptionWindow(IntPtr window); - - [DllImport(Libraries.InputMethod, EntryPoint = "ime_context_get_layout")] - internal static extern ErrorCode ImeContextGetLayout(IntPtr context, out InputPanelLayout layout); - - [DllImport(Libraries.InputMethod, EntryPoint = "ime_context_get_layout_variation")] - internal static extern ErrorCode ImeContextGetLayoutVariation(IntPtr context, out LayoutVariation layoutVariation); - - [DllImport(Libraries.InputMethod, EntryPoint = "ime_context_get_cursor_position")] - internal static extern ErrorCode ImeContextGetCursorPositionition(IntPtr context, out int cursorPos); - - [DllImport(Libraries.InputMethod, EntryPoint = "ime_context_get_autocapital_type")] - internal static extern ErrorCode ImeContextGetAutocapitalType(IntPtr context, out AutoCapitalization autocapitalType); - - [DllImport(Libraries.InputMethod, EntryPoint = "ime_context_get_return_key_type")] - internal static extern ErrorCode ImeContextGetReturnKey(IntPtr context, out InputPanelReturnKey returnKeyType); - - [DllImport(Libraries.InputMethod, EntryPoint = "ime_context_get_return_key_state")] - internal static extern ErrorCode ImeContextGetReturnKeyState(IntPtr context, out bool returnKeyState); - - [DllImport(Libraries.InputMethod, EntryPoint = "ime_context_get_prediction_mode")] - internal static extern ErrorCode ImeContextGetPredictionMode(IntPtr context, out bool predictionMode); - - [DllImport(Libraries.InputMethod, EntryPoint = "ime_context_get_password_mode")] - internal static extern ErrorCode ImeContextGetPasswordMode(IntPtr context, out bool passwordMode); - - [DllImport(Libraries.InputMethod, EntryPoint = "ime_context_get_input_hint")] - internal static extern ErrorCode ImeContextGetInputHint(IntPtr context, out InputHints inputHint); - - [DllImport(Libraries.InputMethod, EntryPoint = "ime_context_get_bidi_direction")] - internal static extern ErrorCode ImeContextGetBidiDirection(IntPtr context, out BiDirection bidi); - - [DllImport(Libraries.InputMethod, EntryPoint = "ime_context_get_language")] - internal static extern ErrorCode ImeContextGetLanguage(IntPtr context, out InputPanelLanguage language); - - [DllImport(Libraries.InputMethod, EntryPoint = "ime_device_info_get_name")] - internal static extern ErrorCode ImeDeviceInfoGetName(IntPtr dev_info, out string devName); - - [DllImport(Libraries.InputMethod, EntryPoint = "ime_device_info_get_class")] - internal static extern ErrorCode ImeDeviceInfoGetClass(IntPtr dev_info, out DeviceClass devClass); - - [DllImport(Libraries.InputMethod, EntryPoint = "ime_device_info_get_subclass")] - internal static extern ErrorCode ImeDeviceInfoGetSubclass(IntPtr dev_info, out DeviceSubclass devSubClass); - - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void ImeCreateCb(IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void ImeTerminateCb(IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void ImeShowCb(int contextId, IntPtr context, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void ImeHideCb(int contextId, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void ImeFocusedInCb(int contextId, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void ImeFocusedOutCb(int contextId, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void ImeSurroundingTextUpdatedCb(int contextId, IntPtr text, int cursorPos, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void ImeInputContextResetCb(IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void ImeCursorPositionitionUpdatedCb(int cursorPos, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void ImeLanguageRequestedCb(IntPtr userData, out IntPtr langCode); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void ImeLanguageSetCb(InputPanelLanguage language, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void ImeImdataSetCb(IntPtr data, uint dataLength, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void ImeImdataRequestedCb(IntPtr userData, out IntPtr data, out uint dataLength); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void ImeLayoutSetCb(InputPanelLayout layout, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void ImeReturnKeySetCb(InputPanelReturnKey type, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void ImeReturnKeyStateSetCb(bool disabled, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void ImeGeometryRequestedCb(IntPtr userData, out int x, out int y, out int w, out int h); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool ImeProcessKeyEventCb(KeyCode keycode, KeyMask keymask, IntPtr devInfo, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void ImeDisplayLanguageChangedCb(IntPtr language, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void ImeRotationChangedCb(int degree, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void ImeAccessibilityStateChangedCb(bool state, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void ImeOptionWindowCreatedCb(IntPtr window, OptionWindowType type, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void ImeOptionWindowDestroyedCb(IntPtr window, IntPtr userData); - } -} diff --git a/src/Tizen.Uix.InputMethod/Interop/Interop.Libraries.cs b/src/Tizen.Uix.InputMethod/Interop/Interop.Libraries.cs deleted file mode 100755 index 888641afe..000000000 --- a/src/Tizen.Uix.InputMethod/Interop/Interop.Libraries.cs +++ /dev/null @@ -1,31 +0,0 @@ -/* -* 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. -*/ - - -/// -/// Partial Interop Class -/// -internal static partial class Interop -{ - /// - /// Partial Libraries Class - /// - internal static partial class Libraries - { - internal const string InputMethod = "libcapi-ui-inputmethod.so.0"; - internal const string Eina = "libeina.so.1"; - } -} diff --git a/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod.csproj b/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod.csproj deleted file mode 100644 index 973f0270c..000000000 --- a/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod.csproj +++ /dev/null @@ -1,13 +0,0 @@ - - - - netstandard2.0 - - - - - - - - - \ No newline at end of file diff --git a/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod.sln b/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod.sln deleted file mode 100755 index 862abe2cc..000000000 --- a/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod.sln +++ /dev/null @@ -1,40 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26430.12 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Uix.InputMethod", "Tizen.Uix.InputMethod.csproj", "{20D10C62-6D3C-4B63-9136-7CEEC564E02F}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ElmSharp", "..\ElmSharp\ElmSharp.csproj", "{4C740EB3-26AB-49C8-B25B-3568FBAB5067}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen", "..\Tizen\Tizen.csproj", "{AEB3A15E-F174-4436-84CD-3AAF4D6B91A3}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Log", "..\Tizen.Log\Tizen.Log.csproj", "{88A7DD62-995F-4772-A6D5-97CE462631EA}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {20D10C62-6D3C-4B63-9136-7CEEC564E02F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {20D10C62-6D3C-4B63-9136-7CEEC564E02F}.Debug|Any CPU.Build.0 = Debug|Any CPU - {20D10C62-6D3C-4B63-9136-7CEEC564E02F}.Release|Any CPU.ActiveCfg = Release|Any CPU - {20D10C62-6D3C-4B63-9136-7CEEC564E02F}.Release|Any CPU.Build.0 = Release|Any CPU - {4C740EB3-26AB-49C8-B25B-3568FBAB5067}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {4C740EB3-26AB-49C8-B25B-3568FBAB5067}.Debug|Any CPU.Build.0 = Debug|Any CPU - {4C740EB3-26AB-49C8-B25B-3568FBAB5067}.Release|Any CPU.ActiveCfg = Release|Any CPU - {4C740EB3-26AB-49C8-B25B-3568FBAB5067}.Release|Any CPU.Build.0 = Release|Any CPU - {AEB3A15E-F174-4436-84CD-3AAF4D6B91A3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {AEB3A15E-F174-4436-84CD-3AAF4D6B91A3}.Debug|Any CPU.Build.0 = Debug|Any CPU - {AEB3A15E-F174-4436-84CD-3AAF4D6B91A3}.Release|Any CPU.ActiveCfg = Release|Any CPU - {AEB3A15E-F174-4436-84CD-3AAF4D6B91A3}.Release|Any CPU.Build.0 = Release|Any CPU - {88A7DD62-995F-4772-A6D5-97CE462631EA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {88A7DD62-995F-4772-A6D5-97CE462631EA}.Debug|Any CPU.Build.0 = Debug|Any CPU - {88A7DD62-995F-4772-A6D5-97CE462631EA}.Release|Any CPU.ActiveCfg = Release|Any CPU - {88A7DD62-995F-4772-A6D5-97CE462631EA}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/AccessibilityStateChangedEventArgs.cs b/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/AccessibilityStateChangedEventArgs.cs deleted file mode 100755 index 45277e47c..000000000 --- a/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/AccessibilityStateChangedEventArgs.cs +++ /dev/null @@ -1,38 +0,0 @@ -/* -* 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. -*/ - -namespace Tizen.Uix.InputMethod -{ - /// - /// This Class contains data related to AccessibilityStateChanged Event - /// - public class AccessibilityStateChangedEventArgs - { - internal AccessibilityStateChangedEventArgs(bool state) - { - State = state; - } - - /// - /// Accessibility option state - /// - public bool State - { - get; - internal set; - } - } -} \ No newline at end of file diff --git a/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/CursorPositionUpdatedEventArgs.cs b/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/CursorPositionUpdatedEventArgs.cs deleted file mode 100755 index afbf44554..000000000 --- a/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/CursorPositionUpdatedEventArgs.cs +++ /dev/null @@ -1,38 +0,0 @@ -/* -* 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. -*/ - -namespace Tizen.Uix.InputMethod -{ - /// - /// This Class contains data related to CursorPositionitionUpdated Event - /// - public class CursorPositionitionUpdatedEventArgs - { - internal CursorPositionitionUpdatedEventArgs(int cursorPos) - { - CursorPosition = cursorPos; - } - - /// - /// The cursor position - /// - public int CursorPosition - { - get; - internal set; - } - } -} \ No newline at end of file diff --git a/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/DataSetEventArgs.cs b/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/DataSetEventArgs.cs deleted file mode 100755 index c1a722da6..000000000 --- a/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/DataSetEventArgs.cs +++ /dev/null @@ -1,49 +0,0 @@ -/* -* 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. -*/ - -namespace Tizen.Uix.InputMethod -{ - /// - /// This Class contains data related to DataSet Event - /// - public class SetDataEventArgs - { - internal SetDataEventArgs(byte[] destination, uint dataLength) - { - Data = destination; - DataLength = dataLength; - } - - /// - /// The specific data to be set to the input panel - /// - public byte[] Data - { - get; - internal set; - } - - /// - /// The length of data, in bytes, to send to the input panel - /// - public uint DataLength - { - get; - internal set; - } - - } -} \ No newline at end of file diff --git a/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/DisplayLanaguageChangedEventArgs.cs b/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/DisplayLanaguageChangedEventArgs.cs deleted file mode 100755 index b0712f358..000000000 --- a/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/DisplayLanaguageChangedEventArgs.cs +++ /dev/null @@ -1,38 +0,0 @@ -/* -* 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. -*/ - -namespace Tizen.Uix.InputMethod -{ - /// - /// This Class contains data related to DisplayLanaguageChanged Event - /// - public class DisplayLanaguageChangedEventArgs - { - internal DisplayLanaguageChangedEventArgs(string langauage) - { - Langauage = langauage; - } - - /// - /// The language code - /// - public string Langauage - { - get; - internal set; - } - } -} \ No newline at end of file diff --git a/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/EditorWindow.cs b/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/EditorWindow.cs deleted file mode 100755 index 82153a736..000000000 --- a/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/EditorWindow.cs +++ /dev/null @@ -1,72 +0,0 @@ -/* -* 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 Tizen; -using System; -using ElmSharp; -using static Interop.InputMethod; - -namespace Tizen.Uix.InputMethod -{ - /// - /// The Editor window class - /// - public class EditorWindow : Window - { - internal static IntPtr _handle = IntPtr.Zero; - private IntPtr _realHandle = IntPtr.Zero; - - internal EditorWindow():base("Edit") - { - _realHandle = _handle; - } - - protected override IntPtr CreateHandle(EvasObject parent) - { - return _handle; - } - - public IntPtr GetHandle() - { - return _handle; - } - - /// - /// This API updates the input panel window's size information. - /// - /// - /// http://tizen.org/privilege/ime - /// - /// The width in portrait mode - /// The height in portrait mode - /// The width in landscape mode - /// The height in landscape mode - /// - /// This can occur due to the following reasons: - /// 1) The application does not have the privilege to call this function - /// 2) IME main loop isn't started yet - /// - public static void SetSize(int portraitWidth, int portraitHeight, int landscapeWidth, int landscapeHeight) - { - ErrorCode error = ImeSetSize(portraitWidth, portraitHeight, landscapeWidth, landscapeHeight); - if (error != ErrorCode.None) - { - Log.Error(LogTag, "SetSize Failed with error " + error); - throw InputMethodExceptionFactory.CreateException(error); - } - } - } -} diff --git a/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/FocusedInEventArgs.cs b/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/FocusedInEventArgs.cs deleted file mode 100755 index 77dad6d5a..000000000 --- a/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/FocusedInEventArgs.cs +++ /dev/null @@ -1,38 +0,0 @@ -/* -* 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. -*/ - -namespace Tizen.Uix.InputMethod -{ - /// - /// This Class contains data related to FocusedIn Event - /// - public class FocusedInEventArgs - { - internal FocusedInEventArgs(int contextId) - { - ContextId = contextId; - } - - /// - /// The input context identification value of an associated text input UI control - /// - public int ContextId - { - get; - internal set; - } - } -} \ No newline at end of file diff --git a/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/FocusedOutEventArgs.cs b/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/FocusedOutEventArgs.cs deleted file mode 100755 index 9990ceaf2..000000000 --- a/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/FocusedOutEventArgs.cs +++ /dev/null @@ -1,38 +0,0 @@ -/* -* 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. -*/ - -namespace Tizen.Uix.InputMethod -{ - /// - /// This Class contains data related to FocusedOut Event - /// - public class FocusedOutEventArgs - { - internal FocusedOutEventArgs(int contextId) - { - ContextId = contextId; - } - - /// - /// The input context identification value of an associated text input UI control - /// - public int ContextId - { - get; - internal set; - } - } -} \ No newline at end of file diff --git a/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/InputMethodContext.cs b/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/InputMethodContext.cs deleted file mode 100755 index d5e4ba04e..000000000 --- a/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/InputMethodContext.cs +++ /dev/null @@ -1,493 +0,0 @@ -/* -* 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 static Interop.InputMethod; - -namespace Tizen.Uix.InputMethod -{ - /// - /// Enumeration for Input Panel Layout - /// - public enum InputPanelLayout - { - /// - /// Normal - /// - LayoutNormal, - /// - /// Number - /// - LayoutNumber, - /// - /// Email - /// - LayoutEMail, - /// - /// URL - /// - LayoutURL, - /// - /// Phone Number - /// - LayoutPhoneNumber, - /// - /// IP - /// - LayoutIP, - /// - /// Month - /// - LayoutMonth, - /// - /// Number Only - /// - LayoutNumberOnly, - /// - /// Invalid - /// - LayoutInvalid, - /// - /// HEX - /// - LayoutHEX, - /// - /// Terminal - /// - LayoutTerminal, - /// - /// Password - /// - LayoutPassword, - /// - /// Date Time - /// - LayoutDateTime, - /// - /// Emoticon - /// - LayoutEmoticon, - /// - /// Voice - /// - LayoutVoice, - /// - /// Undefined - /// - Undefined - }; - - /// - /// Enumeration for Layout Variation - /// - public enum LayoutVariation - { - /// - /// The plain normal layout - /// - NormalNormal = 0, - /// - /// Filename layout; symbols such as '/', '\*', '\', '|', '<', '>', '?', '"' and ':' should be disabled - /// - NormalFileName, - /// - /// The name of a person - /// - NormalPersonName, - /// - /// The plain normal number layout - /// - NumberOnlyNormal = 0, - /// - /// The number layout to allow a negative sign - /// - NumberOnlySigned, - /// - /// The number layout to allow decimal point to provide fractional value - /// - NumberOnlyDecimal, - /// - /// The number layout to allow decimal point and negative sign - /// - NumberOnlySignedAndDecimal, - /// - /// The normal password layout - /// - PasswordNormal = 0, - /// - /// The password layout to allow only number - /// - PasswordNumberOnly, - /// - /// Undefined - /// - Undefined - }; - - /// - /// Enumeration for AutoCapital Type - /// - public enum AutoCapitalization - { - /// - /// None - /// - None, - /// - /// Word - /// - Word, - /// - /// Sentence - /// - Sentence, - /// - /// All Character - /// - AllCharacter, - /// - /// Undefined - /// - Undefined - }; - - /// - /// Enumeration for InputPanel ReturnKey Type - /// - public enum InputPanelReturnKey - { - /// - /// Default - /// - Default, - /// - /// Done - /// - Done, - /// - /// Go - /// - Go, - /// - /// Join - /// - Join, - /// - /// Login - /// - Login, - /// - /// Next - /// - Next, - /// - /// Search - /// - Search, - /// - /// Send - /// - Send, - /// - /// SignIn - /// - SignIn, - /// - /// Undefined - /// - Undefined - }; - - /// - /// Enumeration for InputHints - /// - public enum InputHints - { - /// - /// None - /// - None, - /// - /// AutoComplete - /// - AutoComplete, - /// - /// SensitiveData - /// - SensitiveData, - /// - /// Multiline - /// - Multiline, - /// - /// Undefined - /// - Undefined - }; - - /// - /// Enumeration for BiDi Direction - /// - public enum BiDirection - { - /// - /// Neutral - /// - Neutral, - /// - /// LTR - /// - LTR, - /// - /// RTL - /// - RTL, - /// - /// Undefined - /// - Undefined - }; - - /// - /// Enumeration for InputPanel Language - /// - public enum InputPanelLanguage - { - /// - /// Automatic - /// - Automatic, - /// - /// Alphabet - /// - Alphabet, - /// - /// Undefined - /// - Undefined - }; - - /// - /// This class represents the context of InputMethodEditor - /// - public class InputMethodContext - { - private IntPtr _handle; - internal InputMethodContext(IntPtr handle) - { - _handle = handle; - } - - /// - /// Gets the layout information. - /// - public InputPanelLayout Layout - { - get - { - InputPanelLayout layout; - ErrorCode error = ImeContextGetLayout(_handle, out layout); - if (error != ErrorCode.None) - { - Log.Error(LogTag, "GetLayout Failed with error " + error); - return InputPanelLayout.Undefined; - } - return layout; - } - } - - /// - /// Gets the layout variation information. - /// - public LayoutVariation LayoutVariation - { - get - { - LayoutVariation layoutVariation; - ErrorCode error = ImeContextGetLayoutVariation(_handle, out layoutVariation); - if (error != ErrorCode.None) - { - Log.Error(LogTag, "GetLayoutVariation Failed with error " + error); - return LayoutVariation.Undefined; - } - return layoutVariation; - } - } - - /// - /// Gets the cursor position information. - /// - public int CursorPositionition - { - get - { - int cursorPosition; - ErrorCode error = ImeContextGetCursorPositionition(_handle, out cursorPosition); - if (error != ErrorCode.None) - { - Log.Error(LogTag, "GetCursorPositionition Failed with error " + error); - return -1; - } - return cursorPosition; - } - } - - /// - /// Gets the autocapital type information. - /// - public AutoCapitalization AutoCapitalization - { - get - { - AutoCapitalization autoCapitalType; - ErrorCode error = ImeContextGetAutocapitalType(_handle, out autoCapitalType); - if (error != ErrorCode.None) - { - Log.Error(LogTag, "GetAutoCapitalization Failed with error " + error); - return AutoCapitalization.Undefined; - } - return autoCapitalType; - } - } - - /// - /// Gets the Return key label type information. - /// - public InputPanelReturnKey ReturnKey - { - get - { - InputPanelReturnKey returnKeyType; - ErrorCode error = ImeContextGetReturnKey(_handle, out returnKeyType); - if (error != ErrorCode.None) - { - Log.Error(LogTag, "GetReturnKey Failed with error " + error); - return InputPanelReturnKey.Undefined; - } - return returnKeyType; - } - } - - /// - /// Gets the Return key state information. - /// - public bool ReturnKeyState - { - get - { - bool returnKeyState; - ErrorCode error = ImeContextGetReturnKeyState(_handle, out returnKeyState); - if (error != ErrorCode.None) - { - Log.Error(LogTag, "GetReturnKeyState Failed with error " + error); - return false; - } - return returnKeyState; - } - } - - /// - /// Gets the prediction mode information. - /// - public bool PredictionMode - { - get - { - bool predictionMode; - ErrorCode error = ImeContextGetPredictionMode(_handle, out predictionMode); - if (error != ErrorCode.None) - { - Log.Error(LogTag, "GetPredictionMode Failed with error " + error); - return false; - } - return predictionMode; - } - } - - /// - /// Gets the password mode information. - /// - public bool PasswordMode - { - get - { - bool passwordMode; - ErrorCode error = ImeContextGetPasswordMode(_handle, out passwordMode); - if (error != ErrorCode.None) - { - Log.Error(LogTag, "GetPasswordMode Failed with error " + error); - return false; - } - return passwordMode; - } - } - - /// - /// Gets the input hint information. - /// - public InputHints InputHint - { - get - { - InputHints inputHint; - ErrorCode error = ImeContextGetInputHint(_handle, out inputHint); - if (error != ErrorCode.None) - { - Log.Error(LogTag, "GetInputHint Failed with error " + error); - return InputHints.Undefined; - } - return inputHint; - } - } - - /// - /// Gets the text bidirectional information. - /// - public BiDirection BiDirection - { - get - { - BiDirection biDiDirection; - ErrorCode error = ImeContextGetBidiDirection(_handle, out biDiDirection); - if (error != ErrorCode.None) - { - Log.Error(LogTag, "GetBiDirection Failed with error " + error); - return BiDirection.Undefined; - } - return biDiDirection; - } - } - - /// - /// Gets the preferred language information. - /// - public InputPanelLanguage Language - { - get - { - InputPanelLanguage langauge; - ErrorCode error = ImeContextGetLanguage(_handle, out langauge); - if (error != ErrorCode.None) - { - Log.Error(LogTag, "GetLanguage Failed with error " + error); - return InputPanelLanguage.Undefined; - } - return langauge; - } - } - } -} diff --git a/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/InputMethodDeviceInformation.cs b/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/InputMethodDeviceInformation.cs deleted file mode 100755 index 6f3d788f1..000000000 --- a/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/InputMethodDeviceInformation.cs +++ /dev/null @@ -1,187 +0,0 @@ -/* -* 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.Collections.Generic; -using System.Text; -using static Interop.InputMethod; - -namespace Tizen.Uix.InputMethod -{ - /// - /// Enumeration for Device Class - /// - public enum DeviceClass - { - /// - /// None - /// - None, - /// - /// Seat - /// - Seat, - /// - /// Keyboard - /// - Keyboard, - /// - /// Mouse - /// - Mouse, - /// - /// Touch - /// - Touch, - /// - /// Pen - /// - Pen, - /// - /// Pointer - /// - Pointer, - /// - /// Gamepad - /// - Gamepad, - /// - /// Undefined - /// - Undefined - }; - - /// - /// Enumeration for Device SubClass - /// - public enum DeviceSubclass - { - /// - /// None - /// - None, - /// - /// Finger - /// - Finger, - /// - /// FingerNail - /// - FingerNail, - /// - /// Knuckle - /// - Knuckle, - /// - /// Palm - /// - Palm, - /// - /// HandSIze - /// - HandSIze, - /// - /// HandFlat - /// - HandFlat, - /// - /// PenTip - /// - PenTip, - /// - /// Trackpad - /// - Trackpad, - /// - /// Trackpoint - /// - Trackpoint, - /// - /// Trackball - /// - Trackball, - /// - /// Undefined - /// - Undefined - }; - - /// - /// this class gives the device information, like the name, class and subclass - /// - public class VoiceControlDeviceInformation - { - private IntPtr _handle; - internal VoiceControlDeviceInformation(IntPtr handle) - { - _handle = handle; - } - - /// - /// Gets the device name of the key event. - /// - public string Name - { - get - { - string name; - ErrorCode error = ImeDeviceInfoGetName(_handle, out name); - if (error != ErrorCode.None) - { - Log.Error(LogTag, "GetName Failed with error " + error); - return ""; - } - return name; - } - } - - /// - /// Gets the device class of the key event. - /// - public DeviceClass DeviceClass - { - get - { - DeviceClass devClass; - ErrorCode error = ImeDeviceInfoGetClass(_handle, out devClass); - if (error != ErrorCode.None) - { - Log.Error(LogTag, "GetClass Failed with error " + error); - return DeviceClass.Undefined; - } - return devClass; - } - } - - /// - /// Gets the device subclass of the key event. - /// - public DeviceSubclass DeviceSubclass - { - get - { - DeviceSubclass subclass; - ErrorCode error = ImeDeviceInfoGetSubclass(_handle, out subclass); - if (error != ErrorCode.None) - { - Log.Error(LogTag, "GetSubclass Failed with error " + error); - return DeviceSubclass.Undefined; - } - return subclass; - } - } - } -} diff --git a/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/InputMethodEditor.cs b/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/InputMethodEditor.cs deleted file mode 100755 index 1473c8c9c..000000000 --- a/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/InputMethodEditor.cs +++ /dev/null @@ -1,2133 +0,0 @@ -/* -* 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.Collections.Generic; -using System.Runtime.InteropServices; -using static Interop.InputMethod; - -namespace Tizen.Uix.InputMethod -{ - /// - /// Enumeration of the key codes. - /// If keycode & 0xff000000 == 0x01000000 then this key code is directly encoded 24-bit UCS character.The UCS value is keycode & 0x00ffffff. - /// Defines the list of keys supported by the system.Note that certain keys may not be available on all devices. - /// - public enum KeyCode - { - /// - /// The backspace key - /// - BackSpace = 0xFF08, - /// - /// The tab key - /// - Tab = 0xFF09, - /// - /// The linefeed key - /// - Linefeed = 0xFF0A, - /// - /// The clear key - /// - Clear = 0xFF0B, - /// - /// The return key - /// - Return = 0xFF0D, - /// - /// The pause key - /// - Pause = 0xFF13, - /// - /// The scroll lock key - /// - ScrollLock = 0xFF14, - /// - /// The sys req key - /// - SysReq = 0xFF15, - /// - /// The escape key - /// - Escape = 0xFF1B, - /// - /// The delete key - /// - Delete = 0xFFFF, - - /* Cursor control & motion */ - /// - /// The home key - /// - Home = 0xFF50, - /// - /// The left directional key - /// - Left = 0xFF51, - /// - /// The up directional key - /// - Up = 0xFF52, - /// - /// The right directional key - /// - Right = 0xFF53, - /// - /// The down directional key - /// - Down = 0xFF54, - /// - /// The prior, previous key - /// - Prior = 0xFF55, - /// - /// The page up key - /// - Page_Up = 0xFF55, - /// - /// The next key - /// - Next = 0xFF56, - /// - /// The page down key - /// - Page_Down = 0xFF56, - /// - /// The end key - /// - End = 0xFF57, - /// - /// The begin key - /// - Begin = 0xFF58, - - /* Misc Functions */ - /// - /// The select key - /// - Select = 0xFF60, - /// - /// The print key - /// - Print = 0xFF61, - /// - /// The execute, run, do key - /// - Execute = 0xFF62, - /// - /// The insert key - /// - Insert = 0xFF63, - /// - /// The undo key - /// - Undo = 0xFF65, - /// - /// The redo key - /// - Redo = 0xFF66, - /// - /// The menu key - /// - Menu = 0xFF67, - /// - /// The find key - /// - Find = 0xFF68, - /// - /// The cancel, stop, abort, exit key - /// - Cancel = 0xFF69, - /// - /// The help key - /// - Help = 0xFF6A, - /// - /// The break key - /// - Break = 0xFF6B, - /// - /// The character set switch key - /// - Mode_switch = 0xFF7E, - /// - /// The num lock key - /// - Num_Lock = 0xFF7F, - - /* Keypad */ - /// - /// The Numpad space key - /// - KPSpace = 0xFF80, - /// - /// The Numpad tab key - /// - KPTab = 0xFF89, - /// - /// The Numpad enter key - /// - KPEnter = 0xFF8D, - /// - /// The Numpad function 1 key - /// - KPF1 = 0xFF91, - /// - /// The Numpad function 2 key - /// - KPF2 = 0xFF92, - /// - /// The Numpad function 3 key - /// - KPF3 = 0xFF93, - /// - /// The Numpad function 4 key - /// - KPF4 = 0xFF94, - /// - /// The Numpad home key - /// - KPHome = 0xFF95, - /// - /// The Numpad left key - /// - KPLeft = 0xFF96, - /// - /// The Numpad up key - /// - KPUp = 0xFF97, - /// - /// The Numpad right key - /// - KPRight = 0xFF98, - /// - /// The Numpad down key - /// - KPDown = 0xFF99, - /// - /// The Numpad prior, previous key - /// - KPPrior = 0xFF9A, - /// - /// The Numpad page up key - /// - KPPage_Up = 0xFF9A, - /// - /// The Numpad next key - /// - KPNext = 0xFF9B, - /// - /// The Numpad page down key - /// - KPPage_Down = 0xFF9B, - /// - /// The Numpad end key - /// - KPEnd = 0xFF9C, - /// - /// The Numpad begin key - /// - KPBegin = 0xFF9D, - /// - /// The Numpad insert key - /// - KPInsert = 0xFF9E, - /// - /// The Numpad delete key - /// - KPDelete = 0xFF9F, - /// - /// The Numpad equal key - /// - KPEqual = 0xFFBD, - /// - /// The Numpad multiply key - /// - KPMultiply = 0xFFAA, - /// - /// The Numpad add key - /// - KPAdd = 0xFFAB, - /// - /// The Numpad separator key - /// - KPSeparator = 0xFFAC, - /// - /// The Numpad subtract key - /// - KPSubtract = 0xFFAD, - /// - /// The Numpad decimal key - /// - KPDecimal = 0xFFAE, - /// - /// The Numpad divide key - /// - KPDivide = 0xFFAF, - /// - /// The Numpad 0 key - /// - KP0 = 0xFFB0, - /// - /// The Numpad 1 key - /// - KP1 = 0xFFB1, - /// - /// The Numpad 2 key - /// - KP2 = 0xFFB2, - /// - /// The Numpad 3 key - /// - KP3 = 0xFFB3, - /// - /// The Numpad 4 key - /// - KP4 = 0xFFB4, - /// - /// The Numpad 5 key - /// - KP5 = 0xFFB5, - /// - /// The Numpad 6 key - /// - KP6 = 0xFFB6, - /// - /// The Numpad 7 key - /// - KP7 = 0xFFB7, - /// - /// The Numpad 8 key - /// - KP8 = 0xFFB8, - /// - /// The Numpad 9 key - /// - KP9 = 0xFFB9, - - /* Auxilliary Functions */ - /// - /// The function 1 key - /// - F1 = 0xFFBE, - /// - /// The function 2 key - /// - F2 = 0xFFBF, - /// - /// The function 3 key - /// - F3 = 0xFFC0, - /// - /// The function 4 key - /// - F4 = 0xFFC1, - /// - /// The function 5 key - /// - F5 = 0xFFC2, - /// - /// The function 6 key - /// - F6 = 0xFFC3, - /// - /// The function 7 key - /// - F7 = 0xFFC4, - /// - /// The function 8 key - /// - F8 = 0xFFC5, - /// - /// The function 9 key - /// - F9 = 0xFFC6, - /// - /// The function 10 key - /// - F10 = 0xFFC7, - /// - /// The function 11 key - /// - F11 = 0xFFC8, - /// - /// The function 12 key - /// - F12 = 0xFFC9, - /// - /// The function 13 key - /// - F13 = 0xFFCA, - /// - /// The function 14 key - /// - F14 = 0xFFCB, - /// - /// The function 15 key - /// - F15 = 0xFFCC, - /// - /// The function 16 key - /// - F16 = 0xFFCD, - /// - /// The function 17 key - /// - F17 = 0xFFCE, - /// - /// The function 18 key - /// - F18 = 0xFFCF, - /// - /// The function 19 key - /// - F19 = 0xFFD0, - /// - /// The function 20 key - /// - F20 = 0xFFD1, - /// - /// The function 21 key - /// - F21 = 0xFFD2, - /// - /// The function 22 key - /// - F22 = 0xFFD3, - /// - /// The function 23 key - /// - F23 = 0xFFD4, - /// - /// The function 24 key - /// - F24 = 0xFFD5, - /// - /// The function 25 key - /// - F25 = 0xFFD6, - /// - /// The function 26 key - /// - F26 = 0xFFD7, - /// - /// The function 27 key - /// - F27 = 0xFFD8, - /// - /// The function 28 key - /// - F28 = 0xFFD9, - /// - /// The function 29 key - /// - F29 = 0xFFDA, - /// - /// The function 30 key - /// - F30 = 0xFFDB, - /// - /// The function 31 key - /// - F31 = 0xFFDC, - /// - /// The function 32 key - /// - F32 = 0xFFDD, - /// - /// The function 33 key - /// - F33 = 0xFFDE, - /// - /// The function 34 key - /// - F34 = 0xFFDF, - /// - /// The function 35 key - /// - F35 = 0xFFE0, - - /* Modifier keys */ - /// - /// The left shift key - /// - ShiftL = 0xFFE1, - /// - /// The right shift key - /// - ShiftR = 0xFFE2, - /// - /// The left control key - /// - ControlL = 0xFFE3, - /// - /// The right control key - /// - ControlR = 0xFFE4, - /// - /// The caps lock key - /// - CapsLock = 0xFFE5, - /// - /// The shift lock key - /// - ShiftLock = 0xFFE6, - /// - /// The left meta key - /// - MetaL = 0xFFE7, - /// - /// The right meta key - /// - MetaR = 0xFFE8, - /// - /// The left alt key - /// - AltL = 0xFFE9, - /// - /// The right alt key - /// - AltR = 0xFFEA, - /// - /// The left super key - /// - SuperL = 0xFFEB, - /// - /// The right super key - /// - SuperR = 0xFFEC, - /// - /// The left hyper key - /// - HyperL = 0xFFED, - /// - /// The right hyper key - /// - HyperR = 0xFFEE, - - /* Latin 1 */ - /// - /// The space key - /// - Space = 0x020, - /// - /// The exclamation key - /// - Exclam = 0x021, - /// - /// The quotedbl key - /// - Quotedbl = 0x022, - /// - /// The number sign key - /// - NumberSign = 0x023, - /// - /// The dollar key - /// - Dollar = 0x024, - /// - /// The percent key - /// - Percent = 0x025, - /// - /// The ampersand key - /// - Ampersand = 0x026, - /// - /// The apostrophe key - /// - Apostrophe = 0x027, - /// - /// The parenleft key - /// - Parenleft = 0x028, - /// - /// The parenright key - /// - Parenright = 0x029, - /// - /// The asterisk key - /// - Asterisk = 0x02a, - /// - /// The plus key - /// - Plus = 0x02b, - /// - /// The comma key - /// - Comma = 0x02c, - /// - /// The minus key - /// - Minus = 0x02d, - /// - /// The period key - /// - Period = 0x02e, - /// - /// The slash key - /// - Slash = 0x02f, - /// - /// The 0 key - /// - Keypad0 = 0x030, - /// - /// The 1 key - /// - Keypad1 = 0x031, - /// - /// The 2 key - /// - Keypad2 = 0x032, - /// - /// The 3 key - /// - Keypad3 = 0x033, - /// - /// The 4 key - /// - Keypad4 = 0x034, - /// - /// The 5 key - /// - Keypad5 = 0x035, - /// - /// The 6 key - /// - Keypad6 = 0x036, - /// - /// The 7 key - /// - Keypad7 = 0x037, - /// - /// The 8 key - /// - Keypad8 = 0x038, - /// - /// The 9 key - /// - Keypad9 = 0x039, - /// - /// The colon key - /// - Colon = 0x03a, - /// - /// The semicolon key - /// - Semicolon = 0x03b, - /// - /// The less key - /// - Less = 0x03c, - /// - /// The equal key - /// - Equal = 0x03d, - /// - /// The greater key - /// - Greater = 0x03e, - /// - /// The question key - /// - Question = 0x03f, - /// - /// The at key - /// - At = 0x040, - /// - /// The A key - /// - KeypadA = 0x041, - /// - /// The B key - /// - KeypadB = 0x042, - /// - /// The C key - /// - KeypadC = 0x043, - /// - /// The D key - /// - KeypadD = 0x044, - /// - /// The E key - /// - KeypadE = 0x045, - /// - /// The F key - /// - KeypadF = 0x046, - /// - /// The G key - /// - KeypadG = 0x047, - /// - /// The H key - /// - KeypadH = 0x048, - /// - /// The I key - /// - KeypadI = 0x049, - /// - /// The J key - /// - KeypadJ = 0x04a, - /// - /// The K key - /// - KeypadK = 0x04b, - /// - /// The L key - /// - KeypadL = 0x04c, - /// - /// The M key - /// - KeypadM = 0x04d, - /// - /// The N key - /// - KeypadN = 0x04e, - /// - /// The O key - /// - KeypadO = 0x04f, - /// - /// The P key - /// - KeypadP = 0x050, - /// - /// The Q key - /// - KeypadQ = 0x051, - /// - /// The R key - /// - KeypadR = 0x052, - /// - /// The S key - /// - KeypadS = 0x053, - /// - /// The T key - /// - KeypadT = 0x054, - /// - /// The U key - /// - KeypadU = 0x055, - /// - /// The V key - /// - KeypadV = 0x056, - /// - /// The W key - /// - KeypadW = 0x057, - /// - /// The X key - /// - KeypadX = 0x058, - /// - /// The Y key - /// - KeypadY = 0x059, - /// - /// The Z key - /// - KeypadZ = 0x05a, - /// - /// The left bracket key - /// - BracketLeft = 0x05b, - /// - /// The backslash key - /// - Backslash = 0x05c, - /// - /// The right bracket key - /// - BracketRight = 0x05d, - /// - /// The circumflex key - /// - AsciiCircum = 0x05e, - /// - /// The underscore key - /// - Underscore = 0x05f, - /// - /// The grave key - /// - Grave = 0x060, - /// - /// The a key - /// - Keypada = 0x061, - /// - /// The b key - /// - Keypadb = 0x062, - /// - /// The c key - /// - Keypadc = 0x063, - /// - /// The d key - /// - Keypadd = 0x064, - /// - /// The e key - /// - Keypade = 0x065, - /// - /// The f key - /// - Keypadf = 0x066, - /// - /// The g key - /// - Keypadg = 0x067, - /// - /// The h key - /// - Keypadh = 0x068, - /// - /// The i key - /// - Keypadi = 0x069, - /// - /// The j key - /// - Keypadj = 0x06a, - /// - /// The k key - /// - Keypadk = 0x06b, - /// - /// The l key - /// - Keypadl = 0x06c, - /// - /// The m key - /// - Keypadm = 0x06d, - /// - /// The n key - /// - Keypadn = 0x06e, - /// - /// The o key - /// - Keypado = 0x06f, - /// - /// The p key - /// - Keypadp = 0x070, - /// - /// The q key - /// - Keypadq = 0x071, - /// - /// The r key - /// - Keypadr = 0x072, - /// - /// The s key - /// - Keypads = 0x073, - /// - /// The t key - /// - Keypadt = 0x074, - /// - /// The u key - /// - Keypadu = 0x075, - /// - /// The v key - /// - Keypadv = 0x076, - /// - /// The w key - /// - Keypadw = 0x077, - /// - /// The x key - /// - Keypadx = 0x078, - /// - /// The y key - /// - Keypady = 0x079, - /// - /// The z key - /// - Keypadz = 0x07a, - /// - /// The left brace key - /// - BraceLeft = 0x07b, - /// - /// The bar key - /// - Bar = 0x07c, - /// - /// The right brace key - /// - BraceRight = 0x07d, - /// - /// The tilde key - /// - AsciiTilde = 0x07e, - }; - - /// - /// Enumeration of the key masks. - /// The key masks indicate which modifier keys is pressed down during the keyboard hit.The special MASK_RELEASED indicates the key release event. - /// - public enum KeyMask - { - /// - /// Key press event without modifier key - /// - Pressed = 0, - /// - /// The Shift key is pressed down - /// - Shift = (1 << 0), - /// - /// The CapsLock key is pressed down - /// - CapsLock = (1 << 1), - /// - /// The Control key is pressed down - /// - Control = (1 << 2), - /// - /// The Alt key is pressed down - /// - Alt = (1 << 3), - /// - /// The Meta key is pressed down - /// - Meta = (1 << 4), - /// - /// The Win (between Control and Alt) is pressed down - /// - Win = (1 << 5), - /// - /// The Hyper key is pressed down - /// - Hyper = (1 << 6), - /// - /// The NumLock key is pressed down - /// - NumLock = (1 << 7), - /// - /// Key release event - /// - Released = (1 << 15), - } - - /// - /// This class contains api's related to IME(Input method editor) - /// - public static class InputMethodEditor - { - private static Object thisLock = new Object(); - private static ImeCallbackStructGCHandle _imeCallbackStructGCHandle = new ImeCallbackStructGCHandle(); - private static event EventHandler _focusIn; - private static ImeFocusedInCb _imeFocusedInDelegate; - private static event EventHandler _focusOut; - private static ImeFocusedOutCb _imeFocusedOutDelegate; - private static event EventHandler _surroundingTextUpdated; - private static ImeSurroundingTextUpdatedCb _imeSurroundingTextUpdatedDelegate; - private static event EventHandler _inputContextReset; - private static ImeInputContextResetCb _imeInputContextResetDelegate; - private static event EventHandler _cursorPositionUpdated; - private static ImeCursorPositionitionUpdatedCb _imeCursorPositionitionUpdatedDelegate; - private static event EventHandler _langaugeSet; - private static ImeLanguageSetCb _imeLanguageSetDelegate; - private static event EventHandler _imDataSet; - private static ImeImdataSetCb _imeDataSetDelegate; - private static event EventHandler _layoutSet; - private static ImeLayoutSetCb _imeLayoutSetDelegate; - private static event EventHandler _returnKeyTypeSet; - private static ImeReturnKeySetCb _imeReturnKeySetDelegate; - private static event EventHandler _returnKeyStateSet; - private static ImeReturnKeyStateSetCb _imeReturnKeyStateSetDelegate; - private static ImeProcessKeyEventCb _imeProcessKeyDelegate; - private static event EventHandler _displayLanaguageChanged; - private static ImeDisplayLanguageChangedCb _imeDisplayLanaguageChangedDelegate; - private static event EventHandler _rotationDegreeChanged; - private static ImeRotationChangedCb _imeRotationChangedDelegate; - private static event EventHandler _accessibilityStateChanged; - private static ImeAccessibilityStateChangedCb _imeAccessibilityStateChangedDelegate; - private static event EventHandler _optionWindowCreated; - private static ImeOptionWindowCreatedCb _imeOptionWindowCreatedDelegate; - private static event EventHandler _optionWindowDestroyed; - private static ImeOptionWindowDestroyedCb _imeOptionWindowDestroyedDelegate; - private static ImeLanguageRequestedCb _imeLanguageRequestedDelegate; - private static OutAction _languageRequestedDelegate; - private static BoolAction _processKeyDelagate; - private static ImeImdataRequestedCb _imeImDataRequestedDelegate; - private static OutArrayAction _imDataRequestedDelegate; - private static ImeGeometryRequestedCb _imeGeometryRequestedDelegate; - private static OutAction _geometryRequestedDelegate; - private static Action _userCreate; - private static Action _userTerminate; - private static Action _userShow; - private static Action _userHide; - private static ImeCreateCb _create = (IntPtr userData) => - { - Log.Info(LogTag, "In Create Delegate"); - _userCreate?.Invoke(); - }; - private static ImeTerminateCb _terminate = (IntPtr userData) => - { - Log.Info(LogTag, "In terminate Delegate"); - _userTerminate?.Invoke(); - _imeCallbackStructGCHandle.Dispose(); - }; - private static ImeShowCb _show = (int contextId, IntPtr context, IntPtr userData) => - { - Log.Info(LogTag, "In Show Delegate"); - _userShow?.Invoke(new ContextId(contextId), new InputMethodContext(context)); - }; - private static ImeHideCb _hide = (int contextId, IntPtr userData) => - { - Log.Info(LogTag, "In Hide Delegate"); - _userHide?.Invoke(new ContextId(contextId)); - }; - - /// - /// Structure representing ContextId - /// - public struct ContextId : IEquatable - { - internal ContextId(int id) - { - Id = id; - } - - internal int Id - { - get; - private set; - } - - public bool Equals(ContextId other) - { - return this.Id == other.Id; - } - } - - /// - /// rectangle representing the position and size of UI Control - /// - public struct Rect - { - /// - /// The x position in screen - /// - public int x; - - /// - /// The y position in screen - /// - public int y; - - /// - /// The window width - /// - public int w; - - /// - /// The window height - /// - public int h; - } - - /// - /// An Action with 1 out parameter - /// - /// Generic Type - /// The out parameter - public delegate void OutAction(out T a); - - /// - /// An Action with an array out parameter - /// - /// Generic Type - /// The out parameter 1 - public delegate void OutArrayAction(out T[] a); - - /// - /// An Action with 3 Input Parameter returning a bool - /// - /// Generic Type for Parameter 1 - /// Generic Type for Parameter 2 - /// Generic Type for Parameter 3 - /// The Input Parameter 1 - /// The Input Parameter 2 - /// The Input Parameter 3 - /// - public delegate bool BoolAction(T a, T1 b, T2 c); - - /// - /// Called when an associated text input UI control has focus. - /// - public static event EventHandler FocusedIn - { - add - { - lock (thisLock) - { - _imeFocusedInDelegate = (int contextId, IntPtr userData) => - { - FocusedInEventArgs args = new FocusedInEventArgs(contextId); - _focusIn?.Invoke(null, args); - }; - ErrorCode error = ImeEventSetFocusedInCb(_imeFocusedInDelegate, IntPtr.Zero); - if (error != ErrorCode.None) - { - Log.Error(LogTag, "Add FocusedIn Failed with error " + error); - } - else - { - _focusIn += value; - } - } - } - remove - { - lock (thisLock) - { - _focusIn -= value; - } - } - } - - /// - /// Called when an associated text input UI control loses focus. - /// - public static event EventHandler FocusedOut - { - add - { - lock (thisLock) - { - _imeFocusedOutDelegate = (int contextId, IntPtr userData) => - { - FocusedOutEventArgs args = new FocusedOutEventArgs(contextId); - _focusOut?.Invoke(null, args); - }; - ErrorCode error = ImeEventSetFocusedOutCb(_imeFocusedOutDelegate, IntPtr.Zero); - if (error != ErrorCode.None) - { - Log.Error(LogTag, "Add FocusedOut Failed with error " + error); - } - else - { - _focusOut += value; - } - } - } - remove - { - lock (thisLock) - { - _focusOut -= value; - } - } - } - - /// - /// Called when an associated text input UI control responds to a request with the surrounding text. - /// - public static event EventHandler SurroundingTextUpdated - { - add - { - lock (thisLock) - { - _imeSurroundingTextUpdatedDelegate = (int contextId, IntPtr text, int cursorPos, IntPtr userData) => - { - SurroundingTextUpdatedEventArgs args = new SurroundingTextUpdatedEventArgs(contextId, Marshal.PtrToStringAnsi(text), cursorPos); - _surroundingTextUpdated?.Invoke(null, args); - }; - ErrorCode error = ImeEventSetSurroundingTextUpdatedCb(_imeSurroundingTextUpdatedDelegate, IntPtr.Zero); - if (error != ErrorCode.None) - { - Log.Error(LogTag, "Add SurroundingTextUpdated Failed with error " + error); - } - else - { - _surroundingTextUpdated += value; - } - } - } - remove - { - lock (thisLock) - { - _surroundingTextUpdated -= value; - } - } - } - - /// - /// Called to reset the input context of an associated text input UI control. - /// - public static event EventHandler InputContextReset - { - add - { - lock (thisLock) - { - _imeInputContextResetDelegate = (IntPtr userData) => - { - _inputContextReset?.Invoke(null, EventArgs.Empty); - }; - ErrorCode error = ImeEventSetInputContextResetCb(_imeInputContextResetDelegate, IntPtr.Zero); - if (error != ErrorCode.None) - { - Log.Error(LogTag, "Add InputContextReset Failed with error " + error); - } - else - { - _inputContextReset += value; - } - } - } - remove - { - lock (thisLock) - { - _inputContextReset -= value; - } - } - } - - /// - /// Called when the position of the cursor in an associated text input UI control changes. - /// - public static event EventHandler CursorPositionitionUpdated - { - add - { - lock (thisLock) - { - _imeCursorPositionitionUpdatedDelegate = (int cursorPos, IntPtr userData) => - { - CursorPositionitionUpdatedEventArgs args = new CursorPositionitionUpdatedEventArgs(cursorPos); - _cursorPositionUpdated?.Invoke(null, args); - }; - ErrorCode error = ImeEventSetCursorPositionitionUpdatedCb(_imeCursorPositionitionUpdatedDelegate, IntPtr.Zero); - if (error != ErrorCode.None) - { - Log.Error(LogTag, "Add CursorPositionitionUpdated Failed with error " + error); - } - else - { - _cursorPositionUpdated += value; - } - } - } - remove - { - lock (thisLock) - { - _cursorPositionUpdated -= value; - } - } - } - - /// - /// Called to set the preferred language to the input panel. - /// It will be only called when the client application changes the edit field's language attribute after the input panel is shown. - /// - public static event EventHandler LanguageSet - { - add - { - lock (thisLock) - { - _imeLanguageSetDelegate = (InputPanelLanguage language, IntPtr userData) => - { - LanguageSetEventArgs args = new LanguageSetEventArgs(language); - _langaugeSet?.Invoke(null, args); - }; - ErrorCode error = ImeEventSetLanguageSetCb(_imeLanguageSetDelegate, IntPtr.Zero); - if (error != ErrorCode.None) - { - Log.Error(LogTag, "Add LanguageSet Failed with error " + error); - } - else - { - _langaugeSet += value; - } - } - } - remove - { - lock (thisLock) - { - _langaugeSet -= value; - } - } - } - - /// - /// Called to set the application specific data to deliver to the input panel. - /// - public static event EventHandler DataSet - { - add - { - lock (thisLock) - { - _imeDataSetDelegate = (IntPtr data, uint dataLength, IntPtr userData) => - { - byte[] destination = new byte[dataLength]; - Marshal.Copy(data, destination, 0, (int)dataLength); - SetDataEventArgs args = new SetDataEventArgs(destination, dataLength); - _imDataSet?.Invoke(null, args); - }; - ErrorCode error = ImeEventSetImdataSetCb(_imeDataSetDelegate, IntPtr.Zero); - if (error != ErrorCode.None) - { - Log.Error(LogTag, "Add DataSet Failed with error " + error); - } - else - { - _imDataSet += value; - } - } - } - remove - { - lock (thisLock) - { - _imDataSet -= value; - } - } - } - - /// - /// Called when an associated text input UI control requests the input panel to set its layout. - /// It will be only called when the client application changes the edit field's layout attribute after the input panel is shown. - /// - public static event EventHandler LayoutSet - { - add - { - lock (thisLock) - { - _imeLayoutSetDelegate = (InputPanelLayout layout, IntPtr userData) => - { - LayoutSetEventArgs args = new LayoutSetEventArgs(layout); - _layoutSet?.Invoke(null, args); - }; - ErrorCode error = ImeEventSetLayoutSetCb(_imeLayoutSetDelegate, IntPtr.Zero); - if (error != ErrorCode.None) - { - Log.Error(LogTag, "Add LayoutSet Failed with error " + error); - } - else - { - _layoutSet += value; - } - } - } - remove - { - lock (thisLock) - { - _layoutSet -= value; - } - } - } - - /// - /// Called when an associated text input UI control requests the input panel to set the Return key label. - /// The input panel can show text or image on the Return button according to the Return key action. - /// - public static event EventHandler ReturnKeySet - { - add - { - lock (thisLock) - { - _imeReturnKeySetDelegate = (InputPanelReturnKey type, IntPtr userData) => - { - ReturnKeySetEventArgs args = new ReturnKeySetEventArgs(type); - _returnKeyTypeSet?.Invoke(null, args); - }; - ErrorCode error = ImeEventSetReturnKeySetCb(_imeReturnKeySetDelegate, IntPtr.Zero); - if (error != ErrorCode.None) - { - Log.Error(LogTag, "Add ReturnKeySet Failed with error " + error); - } - else - { - _returnKeyTypeSet += value; - } - } - } - remove - { - lock (thisLock) - { - _returnKeyTypeSet -= value; - } - } - } - - /// - /// Called when an associated text input UI control requests the input panel to enable or disable the Return key state. - /// - public static event EventHandler ReturnKeyStateSet - { - add - { - lock (thisLock) - { - _imeReturnKeyStateSetDelegate = (bool state, IntPtr userData) => - { - ReturnKeyStateSetEventArgs args = new ReturnKeyStateSetEventArgs(state); - _returnKeyStateSet?.Invoke(null, args); - }; - ErrorCode error = ImeEventSetReturnKeyStateSetCb(_imeReturnKeyStateSetDelegate, IntPtr.Zero); - if (error != ErrorCode.None) - { - Log.Error(LogTag, "Add ReturnKeyStateSet Failed with error " + error); - } - else - { - _returnKeyStateSet += value; - } - } - } - remove - { - lock (thisLock) - { - _returnKeyStateSet -= value; - } - } - } - - /// - /// Called when the system display language is changed. - /// - public static event EventHandler DisplayLanaguageChanged - { - add - { - lock (thisLock) - { - _imeDisplayLanaguageChangedDelegate = (IntPtr language, IntPtr userData) => - { - DisplayLanaguageChangedEventArgs args = new DisplayLanaguageChangedEventArgs(Marshal.PtrToStringAnsi(language)); - _displayLanaguageChanged?.Invoke(null, args); - }; - ErrorCode error = ImeEventSetDisplayLanguageChangedCb(_imeDisplayLanaguageChangedDelegate, IntPtr.Zero); - if (error != ErrorCode.None) - { - Log.Error(LogTag, "Add DisplayLanaguageChanged Failed with error " + error); - } - else - { - _displayLanaguageChanged += value; - } - } - } - remove - { - lock (thisLock) - { - _displayLanaguageChanged -= value; - } - } - } - - /// - /// Called when the device is rotated. - /// - public static event EventHandler RotationChanged - { - add - { - lock (thisLock) - { - _imeRotationChangedDelegate = (int degree, IntPtr userData) => - { - RotationChangedEventArgs args = new RotationChangedEventArgs(degree); - _rotationDegreeChanged?.Invoke(null, args); - }; - ErrorCode error = ImeEventSetRotationChangedCb(_imeRotationChangedDelegate, IntPtr.Zero); - if (error != ErrorCode.None) - { - Log.Error(LogTag, "Add RotationChanged Failed with error " + error); - } - else - { - _rotationDegreeChanged += value; - } - } - } - remove - { - lock (thisLock) - { - _rotationDegreeChanged -= value; - } - } - } - - /// - /// Called when Accessibility in Settings application is on or off. - /// - public static event EventHandler AccessibilityStateChanged - { - add - { - lock (thisLock) - { - _imeAccessibilityStateChangedDelegate = (bool state, IntPtr userData) => - { - AccessibilityStateChangedEventArgs args = new AccessibilityStateChangedEventArgs(state); - _accessibilityStateChanged?.Invoke(null, args); - }; - ErrorCode error = ImeEventSetAccessibilityStateChangedCb(_imeAccessibilityStateChangedDelegate, IntPtr.Zero); - if (error != ErrorCode.None) - { - Log.Error(LogTag, "Add AccessibilityStateChanged Failed with error " + error); - } - else - { - _accessibilityStateChanged += value; - } - } - } - remove - { - lock (thisLock) - { - _accessibilityStateChanged -= value; - } - } - } - - /// - /// Called to create the option window. - /// - /// - /// if Input panel requests to open the option window, type will be OptionWindowType.Keyboard. - /// And if Settings application requests to open it, type will be OptionWindowType.SettingApplication. - /// - public static event EventHandler OptionWindowCreated - { - add - { - lock (thisLock) - { - _imeOptionWindowCreatedDelegate = (IntPtr window, OptionWindowType type, IntPtr userData) => - { - OptionWindow._handle = window; - OptionWindowCreatedEventArgs args = new OptionWindowCreatedEventArgs(new OptionWindow(), type); - _optionWindowCreated?.Invoke(null, args); - }; - ErrorCode error = ImeEventSetOptionWindowCreatedCb(_imeOptionWindowCreatedDelegate, IntPtr.Zero); - if (error != ErrorCode.None) - { - Log.Error(LogTag, "Add OptionWindowCreated Failed with error " + error); - } - else - { - _optionWindowCreated += value; - } - } - } - remove - { - lock (thisLock) - { - _optionWindowCreated -= value; - } - } - } - - /// - /// Called to destroy the option window. - /// - public static event EventHandler OptionWindowDestroyed - { - add - { - lock (thisLock) - { - _imeOptionWindowDestroyedDelegate = (IntPtr window, IntPtr userData) => - { - OptionWindow._handle = window; - OptionWindowDestroyedEventArgs args = new OptionWindowDestroyedEventArgs(new OptionWindow()); - _optionWindowDestroyed?.Invoke(null, args); - }; - ErrorCode error = ImeEventSetOptionWindowDestroyedCb(_imeOptionWindowDestroyedDelegate, IntPtr.Zero); - if (error != ErrorCode.None) - { - Log.Error(LogTag, "Add OptionWindowDestroyed Failed with error " + error); - } - else - { - _optionWindowDestroyed += value; - } - } - } - remove - { - lock (thisLock) - { - _optionWindowDestroyed -= value; - } - } - } - - /// - /// Sets the languageRequested Action - /// - /// - /// Called when an associated text input UI control requests the language from the input panel, requesting for language code. - /// - public static void SetLanguageRequestedCallback(OutAction languageRequested) - { - _imeLanguageRequestedDelegate = (IntPtr userData, out IntPtr langCode) => - { - string langauage; - _languageRequestedDelegate(out langauage); - char[] languageArray = langauage.ToCharArray(); - langCode = new IntPtr(); - Marshal.Copy(languageArray, 0, langCode, languageArray.Length); - }; - ErrorCode error = ImeEventSetLanguageRequestedCallbackCb(_imeLanguageRequestedDelegate, IntPtr.Zero); - if (error != ErrorCode.None) - { - Log.Error(LogTag, "Add SetLanguageRequestedCallback Failed with error " + error); - } - _languageRequestedDelegate = languageRequested; - } - - /// - /// Sets the processKey Action - /// If the key event is from the external device, DeviceInfo will have its name, class and subclass information. - /// - /// - /// The Action is alled when the key event is received from the external devices or SendKey function. - /// This Event processes the key event before an associated text input UI control does. - /// - public static void SetProcessKeyCallback(BoolAction processKey) - { - _imeProcessKeyDelegate = (KeyCode keyCode, KeyMask keyMask, IntPtr devInfo, IntPtr userData) => - { - return _processKeyDelagate(keyCode, keyMask, new VoiceControlDeviceInformation(devInfo)); - }; - ErrorCode error = ImeEventSetProcessKeyEventCb(_imeProcessKeyDelegate, IntPtr.Zero); - if (error != ErrorCode.None) - { - Log.Error(LogTag, "Add ProcessKey Failed with error " + error); - } - _processKeyDelagate = processKey; - } - - /// - /// Sets the imDataRequested Action - /// - /// - /// Called when an associated text input UI control requests the application specific data from the input panel, requesting for data array and it's length. - /// - public static void SetDataRequestedCallback(OutArrayAction imDataRequested) - { - _imeImDataRequestedDelegate = (IntPtr userData, out IntPtr data, out uint dataLength) => - { - byte[] dataArr; - _imDataRequestedDelegate(out dataArr); - data = new IntPtr(); - Marshal.Copy(dataArr, 0, data, dataArr.Length); - dataLength = (uint)dataArr.Length; - }; - ErrorCode error = ImeEventSetImdataRequestedCb(_imeImDataRequestedDelegate, IntPtr.Zero); - if (error != ErrorCode.None) - { - Log.Error(LogTag, "Add SetDataRequestedCallback Failed with error " + error); - } - _imDataRequestedDelegate = imDataRequested; - } - - /// - /// Sets the GeometryRequested Action - /// - /// - /// Called when an associated text input UI control requests the position and size from the input panel, requesting for x,y,w,h values. - /// - public static void SetGeometryRequestedCallback(OutAction geometryRequested) - { - _imeGeometryRequestedDelegate = (IntPtr userData, out int x, out int y, out int w, out int h) => - { - Rect rect = new Rect(); - _geometryRequestedDelegate(out rect); - x = rect.x; - y = rect.y; - w = rect.w; - h = rect.h; - }; - ErrorCode error = ImeEventSetGeometryRequestedCallbackCb(_imeGeometryRequestedDelegate, IntPtr.Zero); - if (error != ErrorCode.None) - { - Log.Error(LogTag, "Add SetGeometryRequestedCallback Failed with error " + error); - } - _geometryRequestedDelegate = geometryRequested; - } - - /// - /// Runs the main loop of IME application. - /// This function starts to run IME application's main loop. - /// - /// - /// http://tizen.org/privilege/ime - /// - /// - /// This API is a blocking call, as it starts the main loop of the application. - /// - /// This is called to initialize IME application before the main loop starts up - /// This is called when IME application is terminated - /// - /// This is called when IME application is shown - /// It provides the Context Inofrmation and the Context Id - /// - /// - /// This is called when IME application is hidden - /// It provides the Context Id - /// - /// - /// This can occur due to the following reasons: - /// 1) The application does not have the privilege to call this function - /// 2) Operation failed - /// - public static void Run(Action create, Action terminate, Action show, Action hide) - { - _userCreate = create; - _userTerminate = terminate; - _userShow = show; - _userHide = hide; - _imeCallbackStructGCHandle._imeCallbackStruct.create = _create; - _imeCallbackStructGCHandle._imeCallbackStruct.terminate = _terminate; - _imeCallbackStructGCHandle._imeCallbackStruct.hide = _hide; - _imeCallbackStructGCHandle._imeCallbackStruct.show = _show; - - ErrorCode error = ImeRun(ref _imeCallbackStructGCHandle._imeCallbackStruct, IntPtr.Zero); - if (error != ErrorCode.None) - { - Log.Error(LogTag, "Run Failed with error " + error); - throw InputMethodExceptionFactory.CreateException(error); - } - - } - - /// - /// Sends a key event to the associated text input UI control. - /// - /// - /// This function sends key down or up event with key mask to the client application. If forwardKey is true, this key event goes to the edit filed directly. - /// And if forwardKey is false, the ProcessKey event receives the key event before the edit field. - /// - /// - /// http://tizen.org/privilege/ime - /// - /// The key code to be sent - /// The modifier key mask - /// The flag to send the key event directly to the edit field - /// - /// This can occur due to the following reasons: - /// 1) The application does not have the privilege to call this function - /// 2) IME main loop isn't started yet - /// - public static void SendKeyEvent(KeyCode keyCode, KeyMask keyMask, bool forwardKey = false) - { - ErrorCode error = ImeSendKeyEvent(keyCode, keyMask, forwardKey); - if (error != ErrorCode.None) - { - Log.Error(LogTag, "SendEvent Failed with error " + error); - throw InputMethodExceptionFactory.CreateException(error); - } - } - - /// - /// Sends the text to the associated text input UI control. - /// - /// - /// http://tizen.org/privilege/ime - /// - /// The string to be committed - /// - /// This can occur due to the following reasons: - /// 1) The application does not have the privilege to call this function - /// 2) IME main loop isn't started yet - /// - public static void CommitString(string str) - { - ErrorCode error = ImeCommitString(str); - if (error != ErrorCode.None) - { - Log.Error(LogTag, "CommitString Failed with error " + error); - throw InputMethodExceptionFactory.CreateException(error); - } - } - - /// - /// Requests to show preedit string. - /// - /// - /// http://tizen.org/privilege/ime - /// - /// - /// This can occur due to the following reasons: - /// 1) The application does not have the privilege to call this function - /// 2) IME main loop isn't started yet - /// - public static void ShowPreEditString() - { - ErrorCode error = ImeShowPreeditString(); - if (error != ErrorCode.None) - { - Log.Error(LogTag, "ShowPreEditString Failed with error " + error); - throw InputMethodExceptionFactory.CreateException(error); - } - } - - /// - /// Requests to hide preedit string. - /// - /// - /// http://tizen.org/privilege/ime - /// - /// - /// This can occur due to the following reasons: - /// 1) The application does not have the privilege to call this function - /// 2) IME main loop isn't started yet - /// - public static void HidePreEditString() - { - ErrorCode error = ImeHidePreeditString(); - if (error != ErrorCode.None) - { - Log.Error(LogTag, "HidePreEditString Failed with error " + error); - throw InputMethodExceptionFactory.CreateException(error); - } - } - - /// - /// Updates a new preedit string. - /// - /// - /// http://tizen.org/privilege/ime - /// - /// The string to be updated in preedit - /// - /// The list which has ime_preedit_attribute lists, strings can be composed of multiple string attributes: underline, highlight color and reversal color. - /// The attrs list can be empty if no attributes to set - /// - /// - /// This can occur due to the following reasons: - /// 1) The application does not have the privilege to call this function - /// 2) IME main loop isn't started yet - /// 3) Invalid Parameter - /// - public static void UpdatePreEditString(string str, IEnumerable attrs) - { - IntPtr einaList = IntPtr.Zero; - List attributeHandleList = new List(); - foreach (PreEditAttribute attribute in attrs) - { - ImePreEditAttributeStruct imePreEditAttribute = new ImePreEditAttributeStruct(); - imePreEditAttribute.start = attribute.Start; - imePreEditAttribute.length = attribute.Length; - imePreEditAttribute.type = (int)attribute.Type; - imePreEditAttribute.value = attribute.Value; - GCHandle attributeHandle = GCHandle.Alloc(imePreEditAttribute, GCHandleType.Pinned); - attributeHandleList.Add(attributeHandle); - einaList = Interop.EinaList.EinaListAppend(einaList, attributeHandle.AddrOfPinnedObject()); - } - ErrorCode error = ImeUpdatePreeditString(str, einaList); - foreach (GCHandle handle in attributeHandleList) - { - handle.Free(); - } - if (error != ErrorCode.None) - { - Log.Error(LogTag, "UpdatePreEditString Failed with error " + error); - throw InputMethodExceptionFactory.CreateException(error); - } - } - - /// - /// Requests the surrounding text from the position of the cursor, asynchronously. - /// - /// - /// http://tizen.org/privilege/ime - /// - /// The maximum length of string to be retrieved before the cursor, -1 means unlimited - /// The maximum length of string to be retrieved after the cursor, -1 means unlimited - /// - /// This can occur due to the following reasons: - /// 1) The application does not have the privilege to call this function - /// 2) IME main loop isn't started yet - /// - /// - /// The requested surrounding text can be received using the SurroundingTextUpdated Event, only if it is set. - /// - public static void RequestSurroundingText(int maxLenBefore, int maxLenAfter) - { - ErrorCode error = ImeRequestSurroundingText(maxLenBefore, maxLenAfter); - if (error != ErrorCode.None) - { - Log.Error(LogTag, "RequestSurroundingText Failed with error " + error); - throw InputMethodExceptionFactory.CreateException(error); - } - } - - /// - /// Requests to delete surrounding text. - /// - /// - /// http://tizen.org/privilege/ime - /// - /// The offset value from the cursor position - /// The length of the text to delete - /// - /// This can occur due to the following reasons: - /// 1) The application does not have the privilege to call this function - /// 2) IME main loop isn't started yet - /// 3) Invalid Parameter - /// - public static void DeleteSurroundingText(int offset, int len) - { - ErrorCode error = ImeDeleteSurroundingText(offset, len); - if (error != ErrorCode.None) - { - Log.Error(LogTag, "DeleteSurroundingText Failed with error " + error); - throw InputMethodExceptionFactory.CreateException(error); - } - } - - /// - /// Gets the surrounding text from the position of the cursor, synchronously. - /// - /// - /// http://tizen.org/privilege/ime - /// - /// The maximum length of string to be retrieved before the cursor, -1 means unlimited - /// The maximum length of string to be retrieved after the cursor, -1 means unlimited - /// The surrounding text - /// The cursor position - /// - /// This can occur due to the following reasons: - /// 1) The application does not have the privilege to call this function - /// 2) IME main loop isn't started yet - /// 3) Invalid Parameter - /// 4) Failed to obtain text due to out of memory - /// - public static void GetSurroundingText(int maxLenBefore, int maxLenAfter, out string text, out int cursorPosition) - { - IntPtr txt; - ErrorCode error = ImeGetSurroundingText(maxLenBefore, maxLenAfter, out txt, out cursorPosition); - if (error != ErrorCode.None) - { - Log.Error(LogTag, "GetSurroundingText Failed with error " + error); - throw InputMethodExceptionFactory.CreateException(error); - } - text = Marshal.PtrToStringAnsi(txt); - } - - /// - /// Requests to set selection. - /// - /// - /// http://tizen.org/privilege/ime - /// - /// The start cursor position in text (in characters not bytes) - /// The end cursor position in text (in characters not bytes) - /// - /// This can occur due to the following reasons: - /// 1) The application does not have the privilege to call this function - /// 2) IME main loop isn't started yet - /// 3) Invalid Parameter - /// - public static void SetSelection(int start, int end) - { - ErrorCode error = ImeSetSelection(start, end); - if (error != ErrorCode.None) - { - Log.Error(LogTag, "SetSelection Failed with error " + error); - throw InputMethodExceptionFactory.CreateException(error); - } - } - - /// - /// This API returns the input panel main window. - /// - /// - /// http://tizen.org/privilege/ime - /// - /// The input panel main window object on success, otherwise null - /// - /// This can occur due to the following reasons: - /// 1) The application does not have the privilege to call this function - /// 2) IME main loop isn't started yet - /// 3) Operation Failed - /// - public static EditorWindow GetMainWindow() - { - EditorWindow._handle = ImeGetMainWindow(); - EditorWindow obj = new EditorWindow(); - ErrorCode error = (ErrorCode)Tizen.Internals.Errors.ErrorFacts.GetLastResult(); - if (error != ErrorCode.None) - { - Log.Error(LogTag, "GetMainWindow Failed with error " + error); - throw InputMethodExceptionFactory.CreateException(error); - } - return obj; - } - - /// - /// This API requests the InputMethodEditor to initialize - /// - /// - /// http://tizen.org/privilege/ime - /// - /// - /// This can occur due to the following reasons: - /// 1) The application does not have the privilege to call this function - /// 2) Operation Failed - /// - public static void Create() - { - ErrorCode error = ImeInitialize(); - Log.Info(LogTag, "ImeInitialize result : " + error); - if (error != ErrorCode.None) - { - Log.Error(LogTag, "ImeInitialize Failed with error " + error); - throw InputMethodExceptionFactory.CreateException(error); - } - - error = ImePrepare(); - Log.Info(LogTag, "ImePrepare result : " + error); - if (error != ErrorCode.None) - { - Log.Error(LogTag, "ImePrepare Failed with error " + error); - throw InputMethodExceptionFactory.CreateException(error); - } - } - - /// - /// This API requests the InputMethodEditor to finalize - /// - /// - /// http://tizen.org/privilege/ime - /// - /// - /// This can occur due to the following reasons: - /// 1) The application does not have the privilege to call this function - /// 2) Operation Failed - /// - public static void Destroy() - { - ErrorCode error = ImeFinalize(); - Log.Info(LogTag, "ImeFinalize result : " + error); - if (error != ErrorCode.None) - { - Log.Error(LogTag, "ImeFinalize Failed with error " + error); - throw InputMethodExceptionFactory.CreateException(error); - } - } - - /// - /// Requests to create an option window from the input panel. - /// The input panel can call this function to open the option window. This function calls OptionWindowCreated Event with OptionWindowType.Keyboard. - /// - /// - /// http://tizen.org/privilege/ime - /// - /// - /// This can occur due to the following reasons: - /// 1) The application does not have the privilege to call this function - /// 2) Operation failed - /// 3) IME main loop isn't started yet - /// 4) OptionWindowCreated event has not been set - /// - /// - /// OptionWindowCreated and OptionWindowDestroyed event should be set - /// - public static void CreateOptionWindow() - { - ErrorCode error = ImeCreateOptionWindow(); - if (error != ErrorCode.None) - { - Log.Error(LogTag, "CreapteOptionWindow Failed with error " + error); - throw InputMethodExceptionFactory.CreateException(error); - } - } - - /// - /// Requests to destroy an option window. - /// The input panel can call this function to close the option window which is created from either the input panel or Settings application. - /// - /// - /// http://tizen.org/privilege/ime - /// - /// The option window to destroy - /// - /// This can occur due to the following reasons: - /// 1) The application does not have the privilege to call this function - /// 2) Invalid Parameter - /// 3) IME main loop isn't started yet - /// - /// - /// OptionWindowDestroyed Event must be set. - /// - /// - /// This function triggers the OptionWindowDestroyed Event if it is set. - /// - public static void DestroyOptionWindow(OptionWindow window) - { - ErrorCode error = ImeDestroyOptionWindow(window); - if (error != ErrorCode.None) - { - Log.Error(LogTag, "DestroyOptionWindow Failed with error " + error); - throw InputMethodExceptionFactory.CreateException(error); - } - } - } -} diff --git a/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/InputMethodExceptionFactory.cs b/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/InputMethodExceptionFactory.cs deleted file mode 100755 index b4ed8bfa0..000000000 --- a/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/InputMethodExceptionFactory.cs +++ /dev/null @@ -1,83 +0,0 @@ -/* -* 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 static Interop.InputMethod; - -namespace Tizen.Uix.InputMethod -{ - internal static class InputMethodExceptionFactory - { - internal static Exception CreateException(ErrorCode err) - { - Tizen.Log.Error(LogTag, "Error " + err); - Exception exp; - switch (err) - { - case ErrorCode.OutOfMemory: - { - exp = new InvalidOperationException("Out Of Memory"); - break; - } - - - case ErrorCode.InvalidParameter: - { - exp = new InvalidOperationException("Invalid Parameters Provided"); - break; - } - - - case ErrorCode.PermissionDenied: - { - exp = new InvalidOperationException("Permission Denied"); - break; - } - - - case ErrorCode.OperationFailed: - { - exp = new InvalidOperationException("Operation Failed"); - break; - } - - - case ErrorCode.NotRunning: - { - exp = new InvalidOperationException("IME main loop isn't started yet"); - break; - } - - case ErrorCode.NoCallbackFunction: - { - exp = new InvalidOperationException("Necessary callback/events is not set"); - break; - } - - default: - { - exp = new Exception(""); - break; - } - - } - - return exp; - - } - } -} diff --git a/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/LanguageSetSetEventArgs.cs b/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/LanguageSetSetEventArgs.cs deleted file mode 100755 index 9cbf06b46..000000000 --- a/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/LanguageSetSetEventArgs.cs +++ /dev/null @@ -1,38 +0,0 @@ -/* -* 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. -*/ - -namespace Tizen.Uix.InputMethod -{ - /// - /// This Class contains data related to LanguageSet Event - /// - public class LanguageSetEventArgs - { - internal LanguageSetEventArgs(InputPanelLanguage language) - { - Language = language; - } - - /// - /// The preferred language that the client application wants - /// - public InputPanelLanguage Language - { - get; - internal set; - } - } -} \ No newline at end of file diff --git a/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/LayoutSetEventArgs.cs b/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/LayoutSetEventArgs.cs deleted file mode 100755 index 825770112..000000000 --- a/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/LayoutSetEventArgs.cs +++ /dev/null @@ -1,38 +0,0 @@ -/* -* 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. -*/ - -namespace Tizen.Uix.InputMethod -{ - /// - /// This Class contains data related to LayoutSet Event - /// - public class LayoutSetEventArgs - { - internal LayoutSetEventArgs(InputPanelLayout layout) - { - Layout = layout; - } - - /// - /// The input panel layout - /// - public InputPanelLayout Layout - { - get; - internal set; - } - } -} \ No newline at end of file diff --git a/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/OptionWindow.cs b/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/OptionWindow.cs deleted file mode 100755 index ca7510e6b..000000000 --- a/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/OptionWindow.cs +++ /dev/null @@ -1,51 +0,0 @@ -/* -* 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 Tizen; -using System; -using ElmSharp; -using static Interop.InputMethod; - -namespace Tizen.Uix.InputMethod -{ - /// - /// Option window Class - /// - public class OptionWindow : Window - { - internal static IntPtr _handle = IntPtr.Zero; - private IntPtr _realHandle = IntPtr.Zero; - - internal OptionWindow():base("Option") - { - _realHandle = _handle; - } - - protected override IntPtr CreateHandle(EvasObject parent) - { - return _handle; - } - - /// - /// The type of option window - /// - public OptionWindowType Type - { - get; - internal set; - } - } -} \ No newline at end of file diff --git a/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/OptionWindowCreatedEventArgs.cs b/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/OptionWindowCreatedEventArgs.cs deleted file mode 100755 index 0a327231d..000000000 --- a/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/OptionWindowCreatedEventArgs.cs +++ /dev/null @@ -1,54 +0,0 @@ -/* -* 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. -*/ - -namespace Tizen.Uix.InputMethod -{ - /// - /// Enumeration of the option window type. - /// - public enum OptionWindowType - { - /// - /// Open from Keyboard - /// - Keyboard, - /// - /// Open from Setting application - /// - SettingApplication - }; - - /// - /// This class contains information related to OptionWindowCreated event - /// - public class OptionWindowCreatedEventArgs - { - internal OptionWindowCreatedEventArgs(OptionWindow window, OptionWindowType type) - { - Window = window; - Window.Type = type; - } - - /// - /// The created window object - /// - public OptionWindow Window - { - get; - internal set; - } - } -} \ No newline at end of file diff --git a/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/OptionWindowDestroyedEventArgs.cs b/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/OptionWindowDestroyedEventArgs.cs deleted file mode 100755 index 975f6619b..000000000 --- a/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/OptionWindowDestroyedEventArgs.cs +++ /dev/null @@ -1,38 +0,0 @@ -/* -* 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. -*/ - -namespace Tizen.Uix.InputMethod -{ - /// - /// This class contains information related to the OptionWindowDestroyed event - /// - public class OptionWindowDestroyedEventArgs - { - internal OptionWindowDestroyedEventArgs(OptionWindow window) - { - Window = window; - } - - /// - /// The window object to destroy - /// - public OptionWindow Window - { - get; - internal set; - } - } -} \ No newline at end of file diff --git a/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/PreEditAttribute.cs b/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/PreEditAttribute.cs deleted file mode 100755 index e10dbf33f..000000000 --- a/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/PreEditAttribute.cs +++ /dev/null @@ -1,78 +0,0 @@ -/* -* 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.Collections.Generic; -using System.Text; - -namespace Tizen.Uix.InputMethod -{ - /// - /// Enumeration for Attribute Type - /// - public enum AttributeType - { - /// - /// No attribute - /// - None, - /// - /// A font style attribute, e.g., underline, etc. - /// - FontStyle - }; - /// - /// This class represents the attributes for preedit string. - /// - public class PreEditAttribute - { - /// - /// The start position in the string of this attribute - /// - public uint Start - { - get; - set; - } - - /// - /// The character length of this attribute, the range is [Start, Start+Length] - /// - public uint Length - { - get; - set; - } - - /// - /// The type of this attribute - /// - public AttributeType Type - { - get; - set; - } - - /// - /// The value of this attribute - /// - public uint Value - { - get; - set; - } - } -} diff --git a/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/ReturnKeyStateSetEventArgs.cs b/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/ReturnKeyStateSetEventArgs.cs deleted file mode 100755 index 57894aa46..000000000 --- a/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/ReturnKeyStateSetEventArgs.cs +++ /dev/null @@ -1,38 +0,0 @@ -/* -* 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. -*/ - -namespace Tizen.Uix.InputMethod -{ - /// - /// This Class contains data related to ReturnKeyStateSet Event - /// - public class ReturnKeyStateSetEventArgs - { - internal ReturnKeyStateSetEventArgs(bool state) - { - State = state; - } - - /// - /// The bool state to disable Return key. The Return key is enabled by default - /// - public bool State - { - get; - internal set; - } - } -} \ No newline at end of file diff --git a/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/ReturnKeyTypeSetEventArgs.cs b/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/ReturnKeyTypeSetEventArgs.cs deleted file mode 100755 index 339f4a0a7..000000000 --- a/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/ReturnKeyTypeSetEventArgs.cs +++ /dev/null @@ -1,38 +0,0 @@ -/* -* 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. -*/ - -namespace Tizen.Uix.InputMethod -{ - /// - /// This Class contains data related to ReturnKeySet Event - /// - public class ReturnKeySetEventArgs - { - internal ReturnKeySetEventArgs(InputPanelReturnKey type) - { - Type = type; - } - - /// - /// The type of Return key on the input panel - /// - public InputPanelReturnKey Type - { - get; - internal set; - } - } -} \ No newline at end of file diff --git a/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/RotationChangedEventArgs.cs b/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/RotationChangedEventArgs.cs deleted file mode 100755 index de4b207a6..000000000 --- a/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/RotationChangedEventArgs.cs +++ /dev/null @@ -1,38 +0,0 @@ -/* -* 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. -*/ - -namespace Tizen.Uix.InputMethod -{ - /// - /// This Class contains data related to RotationChanged Event - /// - public class RotationChangedEventArgs - { - internal RotationChangedEventArgs(int degree) - { - Degree = degree; - } - - /// - /// The rotation degree - /// - public int Degree - { - get; - internal set; - } - } -} \ No newline at end of file diff --git a/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/SurroundingTextUpdatedArgs.cs b/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/SurroundingTextUpdatedArgs.cs deleted file mode 100755 index 90b533b9f..000000000 --- a/src/Tizen.Uix.InputMethod/Tizen.Uix.InputMethod/SurroundingTextUpdatedArgs.cs +++ /dev/null @@ -1,58 +0,0 @@ -/* -* 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. -*/ - -namespace Tizen.Uix.InputMethod -{ - /// - /// This Class contains data related to SurroundingTextUpdated Event - /// - public class SurroundingTextUpdatedEventArgs - { - internal SurroundingTextUpdatedEventArgs(int contextId, string text, int cursorPos) - { - ContextId = contextId; - Text = text; - CursorPosition = cursorPos; - } - - /// - /// The input context identification value of an associated text input UI control - /// - public int ContextId - { - get; - internal set; - } - - /// - /// The cursor position - /// - public int CursorPosition - { - get; - internal set; - } - - /// - /// The string requested - /// - public string Text - { - get; - internal set; - } - } -} \ No newline at end of file diff --git a/src/Tizen.Uix.InputMethodManager/Interop/Interop.InputMethodManager.cs b/src/Tizen.Uix.InputMethodManager/Interop/Interop.InputMethodManager.cs deleted file mode 100755 index d9a434781..000000000 --- a/src/Tizen.Uix.InputMethodManager/Interop/Interop.InputMethodManager.cs +++ /dev/null @@ -1,58 +0,0 @@ -/* -* 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; - -/// -/// Partial interop class. -/// -internal static partial class Interop -{ - /// - /// InputMethodManager interop class. - /// - internal static class InputMethodManager - { - internal static string LogTag = "Tizen.Uix.InputMethodManager"; - - private const int ErrorInputMethodManager = -0x02F20000; - - internal enum ErrorCode - { - None = Tizen.Internals.Errors.ErrorCode.None, /**< Successful */ - InvalidParameter = Tizen.Internals.Errors.ErrorCode.InvalidParameter, /**< Invalid parameter */ - PermissionDenied = Tizen.Internals.Errors.ErrorCode.PermissionDenied, /**< Permission denied */ - OperationFailed = ErrorInputMethodManager | 0x0010, /**< Operation failed */ - }; - - [DllImport(Libraries.InputMethodManager, EntryPoint = "ime_manager_show_ime_list")] - internal static extern ErrorCode ImeManagerShowImeList(); - - [DllImport(Libraries.InputMethodManager, EntryPoint = "ime_manager_show_ime_selector")] - internal static extern ErrorCode ImeManagerShowImeSelector(); - - [DllImport(Libraries.InputMethodManager, EntryPoint = "ime_manager_is_ime_enabled")] - internal static extern ErrorCode ImeManagerIsImeEnabled(string appId, out bool isEnabled); - - [DllImport(Libraries.InputMethodManager, EntryPoint = "ime_manager_get_active_ime")] - internal static extern ErrorCode ImeManagerGetActiveIme(out string app_id); - - [DllImport(Libraries.InputMethodManager, EntryPoint = "ime_manager_get_enabled_ime_count")] - internal static extern int ImeManagerGetEnabledImeCount(); - } -} \ No newline at end of file diff --git a/src/Tizen.Uix.InputMethodManager/Interop/Interop.Libraries.cs b/src/Tizen.Uix.InputMethodManager/Interop/Interop.Libraries.cs deleted file mode 100755 index 1dc0112c7..000000000 --- a/src/Tizen.Uix.InputMethodManager/Interop/Interop.Libraries.cs +++ /dev/null @@ -1,30 +0,0 @@ -/* -* 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. -*/ - - -/// -/// Partial interop class. -/// -internal static partial class Interop -{ - /// - /// Partial libraries class. - /// - internal static partial class Libraries - { - public const string InputMethodManager = "libcapi-ui-inputmethod-manager.so.0"; - } -} diff --git a/src/Tizen.Uix.InputMethodManager/Tizen.Uix.InputMethodManager.csproj b/src/Tizen.Uix.InputMethodManager/Tizen.Uix.InputMethodManager.csproj deleted file mode 100644 index 4c51c4197..000000000 --- a/src/Tizen.Uix.InputMethodManager/Tizen.Uix.InputMethodManager.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - netstandard2.0 - - - - - - - - \ No newline at end of file diff --git a/src/Tizen.Uix.InputMethodManager/Tizen.Uix.InputMethodManager.sln b/src/Tizen.Uix.InputMethodManager/Tizen.Uix.InputMethodManager.sln deleted file mode 100755 index 49a6f2f35..000000000 --- a/src/Tizen.Uix.InputMethodManager/Tizen.Uix.InputMethodManager.sln +++ /dev/null @@ -1,34 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26430.12 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Uix.InputMethodManager", "Tizen.Uix.InputMethodManager.csproj", "{2599421D-2A39-4EB1-B2C8-41126B6EE803}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen", "..\Tizen\Tizen.csproj", "{9853E1C3-E95E-4AE9-855A-0B32C36DCB80}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Log", "..\Tizen.Log\Tizen.Log.csproj", "{A9FA0DB6-0919-4E3A-92F5-186486B8928D}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {2599421D-2A39-4EB1-B2C8-41126B6EE803}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {2599421D-2A39-4EB1-B2C8-41126B6EE803}.Debug|Any CPU.Build.0 = Debug|Any CPU - {2599421D-2A39-4EB1-B2C8-41126B6EE803}.Release|Any CPU.ActiveCfg = Release|Any CPU - {2599421D-2A39-4EB1-B2C8-41126B6EE803}.Release|Any CPU.Build.0 = Release|Any CPU - {9853E1C3-E95E-4AE9-855A-0B32C36DCB80}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {9853E1C3-E95E-4AE9-855A-0B32C36DCB80}.Debug|Any CPU.Build.0 = Debug|Any CPU - {9853E1C3-E95E-4AE9-855A-0B32C36DCB80}.Release|Any CPU.ActiveCfg = Release|Any CPU - {9853E1C3-E95E-4AE9-855A-0B32C36DCB80}.Release|Any CPU.Build.0 = Release|Any CPU - {A9FA0DB6-0919-4E3A-92F5-186486B8928D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {A9FA0DB6-0919-4E3A-92F5-186486B8928D}.Debug|Any CPU.Build.0 = Debug|Any CPU - {A9FA0DB6-0919-4E3A-92F5-186486B8928D}.Release|Any CPU.ActiveCfg = Release|Any CPU - {A9FA0DB6-0919-4E3A-92F5-186486B8928D}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/src/Tizen.Uix.InputMethodManager/Tizen.Uix.InputMethodManager/InputMethodManager.cs b/src/Tizen.Uix.InputMethodManager/Tizen.Uix.InputMethodManager/InputMethodManager.cs deleted file mode 100755 index f260b5933..000000000 --- a/src/Tizen.Uix.InputMethodManager/Tizen.Uix.InputMethodManager/InputMethodManager.cs +++ /dev/null @@ -1,158 +0,0 @@ -/* -* 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 static Interop.InputMethodManager; - -namespace Tizen.Uix.InputMethodManager -{ - /// - /// This class provides the function for launching the input method editor (IME) list and selector settings. A user can manage the installed IMEs in the system. - /// The input method editor (IME) is an input panel that lets users provide an input and the platform to receive the text data entered. - /// The manager is a module for managing the installed IMEs. - /// IME developers can use this module to open the installed IME list or the selector menu after their IME installation, and then guide to select the installed IME. - /// - public static class Manager - { - /// - /// Requests to open the installed IME list menu. - /// This API provides the installed IME list menu for IME developers who might want to open it to enable their IME. - /// - /// - /// http://tizen.org/privilege/imemanager - /// - /// - /// This exception can occur if: - /// 1) The application does not have the privilege to call this function. - /// 2) Operation failed. - /// - public static void ShowIMEList() - { - ErrorCode error = ImeManagerShowImeList(); - if (error != ErrorCode.None) - { - Log.Error(LogTag, "ShowIMEList Failed with error " + error); - throw InputMethodManagerExceptionFactory.CreateException(error); - } - } - - /// - /// Requests to open the IME selector menu. - /// This API provides the IME selector menu for the IME or other application developers who might want to change the default IME. - /// - /// - /// http://tizen.org/privilege/imemanager - /// - /// - /// This exception can occur if: - /// 1) The application does not have the privilege to call this function. - /// 2) Operation failed. - /// - public static void ShowIMESelector() - { - ErrorCode error = ImeManagerShowImeSelector(); - if (error != ErrorCode.None) - { - Log.Error(LogTag, "ShowIMESelector Failed with error " + error); - throw InputMethodManagerExceptionFactory.CreateException(error); - } - } - - /// - /// Checks if the specific IME is enabled or disabled in the system keyboard setting. - /// The IME developers can use this property to check if their IME is enabled or not. - /// - /// - /// http://tizen.org/privilege/imemanager - /// - /// The application ID of the IME. - /// The On (enabled) and Off (disabled) state of the IME. - /// - /// This exception can occur if an invalid parameter is provided. - /// - /// - /// This exception can occur if: - /// 1) The application does not have the privilege to call this function. - /// 2) Operation failed. - /// - public static bool IsIMEEnabled(string appId) - { - bool isIMEEnabled; - ErrorCode error = ImeManagerIsImeEnabled(appId, out isIMEEnabled); - if (error != ErrorCode.None) - { - Log.Error(LogTag, "IsIMEEnabled Failed with error " + error); - throw InputMethodManagerExceptionFactory.CreateException(error); - } - - return isIMEEnabled; - } - - /// - /// Checks which IME is the current activated (selected) IME. - /// - /// - /// http://tizen.org/privilege/imemanager - /// - /// - /// The current activated (selected) IME. - /// - /// - /// This exception can occur if: - /// 1) The application does not have the privilege to call this function. - /// 2) Operation failed. - /// - public static string GetActiveIME() - { - string activeIME; - ErrorCode error = ImeManagerGetActiveIme(out activeIME); - if (error != ErrorCode.None) - { - Log.Error(LogTag, "GetActiveIME Failed with error " + error); - throw InputMethodManagerExceptionFactory.CreateException(error); - } - - return activeIME; - } - - /// - /// Gets the number of IMEs that are enabled (usable). - /// - /// - /// http://tizen.org/privilege/imemanager - /// - /// - /// The number of enabled IMEs. - /// - /// - /// This exception can occur if: - /// 1) The application does not have the privilege to call this function. - /// 2) Operation failed. - /// - public static int GetEnabledIMECount() - { - int activeIME = ImeManagerGetEnabledImeCount(); - ErrorCode error = (ErrorCode)Tizen.Internals.Errors.ErrorFacts.GetLastResult(); - if (error != ErrorCode.None) - { - Log.Error(LogTag, "GetEnabledIMECount Failed with error " + error); - throw InputMethodManagerExceptionFactory.CreateException(error); - } - - return activeIME; - } - } -} \ No newline at end of file diff --git a/src/Tizen.Uix.InputMethodManager/Tizen.Uix.InputMethodManager/InputMethodManagerExceptionFactory.cs b/src/Tizen.Uix.InputMethodManager/Tizen.Uix.InputMethodManager/InputMethodManagerExceptionFactory.cs deleted file mode 100755 index 283b63360..000000000 --- a/src/Tizen.Uix.InputMethodManager/Tizen.Uix.InputMethodManager/InputMethodManagerExceptionFactory.cs +++ /dev/null @@ -1,64 +0,0 @@ -/* -* 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 static Interop.InputMethodManager; - -namespace Tizen.Uix.InputMethodManager -{ - internal static class InputMethodManagerExceptionFactory - { - internal static Exception CreateException(ErrorCode err) - { - Tizen.Log.Error(LogTag, "Error " + err); - Exception exp; - switch (err) - { - - case ErrorCode.InvalidParameter: - { - exp = new ArgumentException("Invalid Parameters Provided"); - break; - } - - - case ErrorCode.PermissionDenied: - { - exp = new InvalidOperationException("Permission Denied"); - break; - } - - - case ErrorCode.OperationFailed: - { - exp = new InvalidOperationException("Operation Failed"); - break; - } - - default: - { - exp = new Exception(""); - break; - } - - } - - return exp; - - } - } -} diff --git a/src/Tizen.Uix.Stt/Interop/Interop.Libraries.cs b/src/Tizen.Uix.Stt/Interop/Interop.Libraries.cs deleted file mode 100755 index a4bafe2dc..000000000 --- a/src/Tizen.Uix.Stt/Interop/Interop.Libraries.cs +++ /dev/null @@ -1,30 +0,0 @@ -/* -* 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. -*/ - - -/// -/// Partial interop class. -/// -internal static partial class Interop -{ - /// - /// Partial libraries class. - /// - internal static partial class Libraries - { - public const string Stt = "libstt.so"; - } -} diff --git a/src/Tizen.Uix.Stt/Interop/Interop.Stt.cs b/src/Tizen.Uix.Stt/Interop/Interop.Stt.cs deleted file mode 100755 index f29291cab..000000000 --- a/src/Tizen.Uix.Stt/Interop/Interop.Stt.cs +++ /dev/null @@ -1,188 +0,0 @@ -/* -* 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; - -/// -/// Partial interop class. -/// -internal static partial class Interop -{ - /// - /// Stt interop class. - /// - internal static class Stt - { - internal static string LogTag = "Tizen.Uix.Stt"; - - private const int ErrorStt = -0x02F00000; - - internal enum SttError - { - None = Tizen.Internals.Errors.ErrorCode.None, /**< Successful */ - OutOfMemory = Tizen.Internals.Errors.ErrorCode.OutOfMemory, /**< Out of Memory */ - IoError = Tizen.Internals.Errors.ErrorCode.IoError, /**< I/O error */ - InvalidParameter = Tizen.Internals.Errors.ErrorCode.InvalidParameter, /**< Invalid parameter */ - TimedOut = Tizen.Internals.Errors.ErrorCode.TimedOut, /**< No answer from the STT service */ - RecorderBusy = Tizen.Internals.Errors.ErrorCode.ResourceBusy, /**< Device or resource busy */ - OutOfNetwork = Tizen.Internals.Errors.ErrorCode.Networkdown, /**< Network is down */ - PermissionDenied = Tizen.Internals.Errors.ErrorCode.PermissionDenied, /**< Permission denied */ - NotSupported = Tizen.Internals.Errors.ErrorCode.NotSupported, /**< STT NOT supported */ - InvalidState = ErrorStt | 0x01, /**< Invalid state */ - InvalidLanguage = ErrorStt | 0x02, /**< Invalid language */ - EngineNotFound = ErrorStt | 0x03, /**< No available engine */ - OperationFailed = ErrorStt | 0x04, /**< Operation failed */ - NotSupportedFeature = ErrorStt | 0x05, /**< Not supported feature of current engine */ - RecordingTimedOut = ErrorStt | 0x06, /**< Recording timed out */ - NoSpeech = ErrorStt | 0x07, /**< No speech while recording*/ - InProgressToReady = ErrorStt | 0x08, /**< Progress to ready is not finished*/ - InProgressToRecording = ErrorStt | 0x09, /**< Progress to recording is not finished*/ - InProgressToProcessing = ErrorStt | 0x10, /**< Progress to processing is not finished*/ - ServiceReset = ErrorStt | 0x11 /**< Service reset*/ - }; - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool SupportedEngineCallback(IntPtr handle, IntPtr engineId, IntPtr engineName, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void RecognitionResultCallback(IntPtr handle, Tizen.Uix.Stt.ResultEvent e, IntPtr data, int dataCount, IntPtr msg, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool ResultTimeCallback(IntPtr handle, int index, Tizen.Uix.Stt.TimeEvent e, IntPtr text, IntPtr startTime, IntPtr endTime, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void StateChangedCallback(IntPtr handle, Tizen.Uix.Stt.State previous, Tizen.Uix.Stt.State current, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void ErrorCallback(IntPtr handle, SttError reason, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool SupportedLanguageCallback(IntPtr handle, IntPtr language, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void DefaultLanguageChangedCallback(IntPtr handle, IntPtr previousLanguage, IntPtr currentLanguage, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void EngineChangedCallback(IntPtr handle, IntPtr engineId, IntPtr language, bool supportSilence, bool needCredential, IntPtr userData); - - [DllImport(Libraries.Stt, EntryPoint = "stt_create", CallingConvention = CallingConvention.Cdecl)] - internal static extern SttError SttCreate(out IntPtr handle); - - [DllImport(Libraries.Stt, EntryPoint = "stt_destroy", CallingConvention = CallingConvention.Cdecl)] - internal static extern SttError SttDestroy(IntPtr handle); - - [DllImport(Libraries.Stt, EntryPoint = "stt_foreach_supported_engines", CallingConvention = CallingConvention.Cdecl)] - internal static extern SttError SttForeEachSupportedEngines(IntPtr handle, SupportedEngineCallback callback, IntPtr userData); - - [DllImport(Libraries.Stt, EntryPoint = "stt_get_engine", CallingConvention = CallingConvention.Cdecl)] - internal static extern SttError SttGetEngine(IntPtr handle, out string engineId); - - [DllImport(Libraries.Stt, EntryPoint = "stt_set_engine", CallingConvention = CallingConvention.Cdecl)] - internal static extern SttError SttSetEngine(IntPtr handle, string engineId); - - [DllImport(Libraries.Stt, EntryPoint = "stt_set_credential", CallingConvention = CallingConvention.Cdecl)] - internal static extern SttError SttSetcredential(IntPtr handle, string credential); - - [DllImport(Libraries.Stt, EntryPoint = "stt_set_private_data", CallingConvention = CallingConvention.Cdecl)] - internal static extern SttError SttSetPrivateData(IntPtr handle, string key, string data); - - [DllImport(Libraries.Stt, EntryPoint = "stt_get_private_data", CallingConvention = CallingConvention.Cdecl)] - internal static extern SttError SttGetPrivateData(IntPtr handle, string key, out string data); - - [DllImport(Libraries.Stt, EntryPoint = "stt_prepare", CallingConvention = CallingConvention.Cdecl)] - internal static extern SttError SttPrepare(IntPtr handle); - - [DllImport(Libraries.Stt, EntryPoint = "stt_unprepare", CallingConvention = CallingConvention.Cdecl)] - internal static extern SttError SttUnprepare(IntPtr handle); - - [DllImport(Libraries.Stt, EntryPoint = "stt_foreach_supported_languages", CallingConvention = CallingConvention.Cdecl)] - internal static extern SttError SttForeachSupportedLanguages(IntPtr handle, SupportedLanguageCallback callback, IntPtr userData); - - [DllImport(Libraries.Stt, EntryPoint = "stt_get_default_language", CallingConvention = CallingConvention.Cdecl)] - internal static extern SttError SttGetDefaultLanguage(IntPtr handle, out string language); - - [DllImport(Libraries.Stt, EntryPoint = "stt_get_state", CallingConvention = CallingConvention.Cdecl)] - internal static extern SttError SttGetState(IntPtr handle, out Tizen.Uix.Stt.State state); - - [DllImport(Libraries.Stt, EntryPoint = "stt_get_error_message", CallingConvention = CallingConvention.Cdecl)] - internal static extern SttError SttGetErrorMessage(IntPtr handle, out string err_msg); - - [DllImport(Libraries.Stt, EntryPoint = "stt_is_recognition_type_supported", CallingConvention = CallingConvention.Cdecl)] - internal static extern SttError SttIsRecognitionTypeSupported(IntPtr handle, string type, out bool support); - - [DllImport(Libraries.Stt, EntryPoint = "stt_set_silence_detection", CallingConvention = CallingConvention.Cdecl)] - internal static extern SttError SttSetSilenceDetection(IntPtr handle, Tizen.Uix.Stt.SilenceDetection type); - - [DllImport(Libraries.Stt, EntryPoint = "stt_set_start_sound", CallingConvention = CallingConvention.Cdecl)] - internal static extern SttError SttSetStartSound(IntPtr handle, string filename); - - [DllImport(Libraries.Stt, EntryPoint = "stt_unset_start_sound", CallingConvention = CallingConvention.Cdecl)] - internal static extern SttError SttUnsetStartSound(IntPtr handle); - - [DllImport(Libraries.Stt, EntryPoint = "stt_set_stop_sound", CallingConvention = CallingConvention.Cdecl)] - internal static extern SttError SttSetStopSound(IntPtr handle, string filename); - - [DllImport(Libraries.Stt, EntryPoint = "stt_unset_stop_sound", CallingConvention = CallingConvention.Cdecl)] - internal static extern SttError SttUnsetStopSound(IntPtr handle); - - [DllImport(Libraries.Stt, EntryPoint = "stt_start", CallingConvention = CallingConvention.Cdecl)] - internal static extern SttError SttStart(IntPtr handle, string language, string type); - - [DllImport(Libraries.Stt, EntryPoint = "stt_stop", CallingConvention = CallingConvention.Cdecl)] - internal static extern SttError SttStop(IntPtr handle); - - [DllImport(Libraries.Stt, EntryPoint = "stt_cancel", CallingConvention = CallingConvention.Cdecl)] - internal static extern SttError SttCancel(IntPtr handle); - - [DllImport(Libraries.Stt, EntryPoint = "stt_get_recording_volume", CallingConvention = CallingConvention.Cdecl)] - internal static extern SttError SttGetRecordingVolume(IntPtr handle, out float volume); - - [DllImport(Libraries.Stt, EntryPoint = "stt_foreach_detailed_result", CallingConvention = CallingConvention.Cdecl)] - internal static extern SttError SttForeachDetailedResult(IntPtr handle, ResultTimeCallback callback, IntPtr userData); - - [DllImport(Libraries.Stt, EntryPoint = "stt_set_recognition_result_cb", CallingConvention = CallingConvention.Cdecl)] - internal static extern SttError SttSetRecognitionResultCB(IntPtr handle, RecognitionResultCallback callback, IntPtr userData); - - [DllImport(Libraries.Stt, EntryPoint = "stt_unset_recognition_result_cb", CallingConvention = CallingConvention.Cdecl)] - internal static extern SttError SttUnsetRecognitionResultCB(IntPtr handle); - - [DllImport(Libraries.Stt, EntryPoint = "stt_set_state_changed_cb", CallingConvention = CallingConvention.Cdecl)] - internal static extern SttError SttSetStateChangedCB(IntPtr handle, StateChangedCallback callback, IntPtr userData); - - [DllImport(Libraries.Stt, EntryPoint = "stt_unset_state_changed_cb", CallingConvention = CallingConvention.Cdecl)] - internal static extern SttError SttUnsetStateChangedCB(IntPtr handle); - - [DllImport(Libraries.Stt, EntryPoint = "stt_set_error_cb", CallingConvention = CallingConvention.Cdecl)] - internal static extern SttError SttSetErrorCB(IntPtr handle, ErrorCallback callback, IntPtr userData); - - [DllImport(Libraries.Stt, EntryPoint = "stt_unset_error_cb", CallingConvention = CallingConvention.Cdecl)] - internal static extern SttError SttUnsetErrorCB(IntPtr handle); - - [DllImport(Libraries.Stt, EntryPoint = "stt_set_default_language_changed_cb", CallingConvention = CallingConvention.Cdecl)] - internal static extern SttError SttSetDefaultLanguageChangedCB(IntPtr handle, DefaultLanguageChangedCallback callback, IntPtr userData); - - [DllImport(Libraries.Stt, EntryPoint = "stt_unset_default_language_changed_cb", CallingConvention = CallingConvention.Cdecl)] - internal static extern SttError SttUnsetDefaultLanguageChangedCB(IntPtr handle); - - [DllImport(Libraries.Stt, EntryPoint = "stt_set_engine_changed_cb", CallingConvention = CallingConvention.Cdecl)] - internal static extern SttError SttSetEngineChangedCB(IntPtr handle, EngineChangedCallback callback, IntPtr userData); - - [DllImport(Libraries.Stt, EntryPoint = "stt_unset_engine_changed_cb", CallingConvention = CallingConvention.Cdecl)] - internal static extern SttError SttUnsetEngineChangedCB(IntPtr handle); - } -} \ No newline at end of file diff --git a/src/Tizen.Uix.Stt/Tizen.Uix.Stt.csproj b/src/Tizen.Uix.Stt/Tizen.Uix.Stt.csproj deleted file mode 100644 index 4c51c4197..000000000 --- a/src/Tizen.Uix.Stt/Tizen.Uix.Stt.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - netstandard2.0 - - - - - - - - \ No newline at end of file diff --git a/src/Tizen.Uix.Stt/Tizen.Uix.Stt.sln b/src/Tizen.Uix.Stt/Tizen.Uix.Stt.sln deleted file mode 100755 index 143671263..000000000 --- a/src/Tizen.Uix.Stt/Tizen.Uix.Stt.sln +++ /dev/null @@ -1,34 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26430.12 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Uix.Stt", "Tizen.Uix.Stt.csproj", "{F1D65BEF-6F84-4F6B-A4E8-24BE38776F62}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen", "..\Tizen\Tizen.csproj", "{7E3F1F2B-9EA3-4C2D-98F6-C5D97ACE201B}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Log", "..\Tizen.Log\Tizen.Log.csproj", "{82C686B6-E509-458A-950D-3DE2E8E09AF9}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {F1D65BEF-6F84-4F6B-A4E8-24BE38776F62}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {F1D65BEF-6F84-4F6B-A4E8-24BE38776F62}.Debug|Any CPU.Build.0 = Debug|Any CPU - {F1D65BEF-6F84-4F6B-A4E8-24BE38776F62}.Release|Any CPU.ActiveCfg = Release|Any CPU - {F1D65BEF-6F84-4F6B-A4E8-24BE38776F62}.Release|Any CPU.Build.0 = Release|Any CPU - {7E3F1F2B-9EA3-4C2D-98F6-C5D97ACE201B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {7E3F1F2B-9EA3-4C2D-98F6-C5D97ACE201B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {7E3F1F2B-9EA3-4C2D-98F6-C5D97ACE201B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {7E3F1F2B-9EA3-4C2D-98F6-C5D97ACE201B}.Release|Any CPU.Build.0 = Release|Any CPU - {82C686B6-E509-458A-950D-3DE2E8E09AF9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {82C686B6-E509-458A-950D-3DE2E8E09AF9}.Debug|Any CPU.Build.0 = Debug|Any CPU - {82C686B6-E509-458A-950D-3DE2E8E09AF9}.Release|Any CPU.ActiveCfg = Release|Any CPU - {82C686B6-E509-458A-950D-3DE2E8E09AF9}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/src/Tizen.Uix.Stt/Tizen.Uix.Stt/DefaultLanguageChangedEventArgs.cs b/src/Tizen.Uix.Stt/Tizen.Uix.Stt/DefaultLanguageChangedEventArgs.cs deleted file mode 100755 index ed3b72e5d..000000000 --- a/src/Tizen.Uix.Stt/Tizen.Uix.Stt/DefaultLanguageChangedEventArgs.cs +++ /dev/null @@ -1,53 +0,0 @@ -/* -* 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. -*/ - - - -namespace Tizen.Uix.Stt -{ - /// - /// This class holds information about the DefaultLanguageChanged event. - /// - /// 3 - public class DefaultLanguageChangedEventArgs - { - internal DefaultLanguageChangedEventArgs(string previous, string current) - { - PreviousLanguage = previous; - CurrentLanguage = current; - } - - /// - /// The previous language. - /// - /// 3 - public string PreviousLanguage - { - get; - internal set; - } - - /// - /// The current language. - /// - /// 3 - public string CurrentLanguage - { - get; - internal set; - } - } -} diff --git a/src/Tizen.Uix.Stt/Tizen.Uix.Stt/EngineChangedEventArgs.cs b/src/Tizen.Uix.Stt/Tizen.Uix.Stt/EngineChangedEventArgs.cs deleted file mode 100755 index 49b152c6e..000000000 --- a/src/Tizen.Uix.Stt/Tizen.Uix.Stt/EngineChangedEventArgs.cs +++ /dev/null @@ -1,74 +0,0 @@ -/* -* 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. -*/ - - -namespace Tizen.Uix.Stt -{ - /// - /// This class holds information related to the EngineChanged event. - /// - /// 3 - public class EngineChangedEventArgs - { - internal EngineChangedEventArgs(string engineId, string language, bool supportSilence, bool needCredential) - { - this.EngineId = engineId; - this.Language = language; - this.SupportSilence = supportSilence; - this.NeedCredential = needCredential; - } - - /// - /// The Engine ID. - /// - /// 3 - public string EngineId - { - get; - internal set; - } - - /// - /// The default language. - /// - /// 3 - public string Language - { - get; - internal set; - } - - /// - /// The necessity of the credential. - /// - /// 3 - public bool NeedCredential - { - get; - internal set; - } - - /// - /// Whether silence detection is supported or not. - /// - /// 3 - public bool SupportSilence - { - get; - internal set; - } - } -} diff --git a/src/Tizen.Uix.Stt/Tizen.Uix.Stt/ErrorOccurredEventArgs.cs b/src/Tizen.Uix.Stt/Tizen.Uix.Stt/ErrorOccurredEventArgs.cs deleted file mode 100755 index 64c1e3125..000000000 --- a/src/Tizen.Uix.Stt/Tizen.Uix.Stt/ErrorOccurredEventArgs.cs +++ /dev/null @@ -1,193 +0,0 @@ -/* -* 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 static Interop.Stt; - -namespace Tizen.Uix.Stt -{ - /// - /// This class holds information related to the STT ErrorOccurred event. - /// - /// 3 - public class ErrorOccurredEventArgs - { - private IntPtr _handle; - - internal ErrorOccurredEventArgs(IntPtr handle, Interop.Stt.SttError error) - { - this._handle = handle; - switch (error) - { - case Interop.Stt.SttError.None: - { - ErrorValue = Error.None; - break; - } - - case Interop.Stt.SttError.OutOfMemory: - { - ErrorValue = Error.OutOfMemory; - break; - } - - case Interop.Stt.SttError.IoError: - { - ErrorValue = Error.IoError; - break; - } - - case Interop.Stt.SttError.InvalidParameter: - { - ErrorValue = Error.InvalidParameter; - break; - } - - case Interop.Stt.SttError.TimedOut: - { - ErrorValue = Error.TimedOut; - break; - } - - case Interop.Stt.SttError.RecorderBusy: - { - ErrorValue = Error.RecorderBusy; - break; - } - - case Interop.Stt.SttError.OutOfNetwork: - { - ErrorValue = Error.OutOfNetwork; - break; - } - - case Interop.Stt.SttError.PermissionDenied: - { - ErrorValue = Error.PermissionDenied; - break; - } - - case Interop.Stt.SttError.NotSupported: - { - ErrorValue = Error.NotSupported; - break; - } - - case Interop.Stt.SttError.InvalidState: - { - ErrorValue = Error.InvalidState; - break; - } - - case Interop.Stt.SttError.InvalidLanguage: - { - ErrorValue = Error.InvalidLanguage; - break; - } - - case Interop.Stt.SttError.EngineNotFound: - { - ErrorValue = Error.EngineNotFound; - break; - } - - case Interop.Stt.SttError.OperationFailed: - { - ErrorValue = Error.OperationFailed; - break; - } - - case Interop.Stt.SttError.NotSupportedFeature: - { - ErrorValue = Error.NotSupportedFeature; - break; - } - - case Interop.Stt.SttError.RecordingTimedOut: - { - ErrorValue = Error.RecordingTimedOut; - break; - } - - case Interop.Stt.SttError.NoSpeech: - { - ErrorValue = Error.NoSpeech; - break; - } - - case Interop.Stt.SttError.InProgressToReady: - { - ErrorValue = Error.InProgressToReady; - break; - } - - case Interop.Stt.SttError.InProgressToRecording: - { - ErrorValue = Error.InProgressToRecording; - break; - } - - case Interop.Stt.SttError.InProgressToProcessing: - { - ErrorValue = Error.InProgressToProcessing; - break; - } - - case Interop.Stt.SttError.ServiceReset: - { - ErrorValue = Error.ServiceReset; - break; - } - - } - } - - /// - /// The error value. - /// - /// 3 - public Error ErrorValue - { - get; - internal set; - } - - /// - /// Gets the current error message. - /// - /// 3 - /// - /// String error message. - /// - public string ErrorMessage - { - get - { - string errorMesage = ""; - SttError error = SttGetErrorMessage(_handle, out errorMesage); - if (error != SttError.None) - { - Log.Error(LogTag, "GetErrorMessage Failed with error " + error); - return ""; - } - - return errorMesage; - } - - } - } -} diff --git a/src/Tizen.Uix.Stt/Tizen.Uix.Stt/ExceptionFactory.cs b/src/Tizen.Uix.Stt/Tizen.Uix.Stt/ExceptionFactory.cs deleted file mode 100755 index 6636ec35e..000000000 --- a/src/Tizen.Uix.Stt/Tizen.Uix.Stt/ExceptionFactory.cs +++ /dev/null @@ -1,151 +0,0 @@ -/* -* 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 static Interop.Stt; - -namespace Tizen.Uix.Stt -{ - internal static class ExceptionFactory - { - internal static Exception CreateException(SttError err) - { - Tizen.Log.Error(LogTag, "Error " + err); - Exception exp; - switch (err) - { - case SttError.OutOfMemory: - { - exp = new OutOfMemoryException("Out Of Memory"); - break; - } - - case SttError.IoError: - { - exp = new InvalidOperationException("I/O Error Occurred"); - break; - } - - case SttError.InvalidParameter: - { - exp = new ArgumentException("Invalid Parameters Provided"); - break; - } - - case SttError.TimedOut: - { - exp = new TimeoutException("No answer from the STT service"); - break; - } - - case SttError.OutOfNetwork: - { - exp = new InvalidOperationException("Network is down"); - break; - } - - case SttError.PermissionDenied: - { - exp = new UnauthorizedAccessException("Permission Denied"); - break; - } - - case SttError.NotSupported: - { - exp = new NotSupportedException("STT NOT supported"); - break; - } - - case SttError.InvalidState: - { - exp = new InvalidOperationException("Invalid state"); - break; - } - - case SttError.InvalidLanguage: - { - exp = new InvalidOperationException("Invalid language"); - break; - } - - case SttError.EngineNotFound: - { - exp = new InvalidOperationException("No available engine"); - break; - } - - case SttError.OperationFailed: - { - exp = new InvalidOperationException("Operation Failed"); - break; - } - - case SttError.NotSupportedFeature: - { - exp = new InvalidOperationException("Not supported feature of current engine"); - break; - } - - case SttError.RecordingTimedOut: - { - exp = new InvalidOperationException("Recording timed out"); - break; - } - - case SttError.NoSpeech: - { - exp = new InvalidOperationException("No speech while recording"); - break; - } - - case SttError.InProgressToReady: - { - exp = new InvalidOperationException("Progress to ready is not finished"); - break; - } - - case SttError.InProgressToRecording: - { - exp = new InvalidOperationException("Progress to recording is not finished"); - break; - } - - case SttError.InProgressToProcessing: - { - exp = new InvalidOperationException("Progress to processing is not finished"); - break; - } - - case SttError.ServiceReset: - { - exp = new InvalidOperationException("Service reset"); - break; - } - - default: - { - exp = new Exception(""); - break; - } - - } - - return exp; - - } - } -} diff --git a/src/Tizen.Uix.Stt/Tizen.Uix.Stt/RecognitionResultEventArgs.cs b/src/Tizen.Uix.Stt/Tizen.Uix.Stt/RecognitionResultEventArgs.cs deleted file mode 100755 index 7f5fb9548..000000000 --- a/src/Tizen.Uix.Stt/Tizen.Uix.Stt/RecognitionResultEventArgs.cs +++ /dev/null @@ -1,149 +0,0 @@ -/* -* 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.Collections.Generic; -using System.Runtime.InteropServices; -using static Interop.Stt; -using static Tizen.Uix.Stt.ResultTime; - -namespace Tizen.Uix.Stt -{ - /// - /// The recognition result from the engine. - /// - /// 3 - public class RecognitionResultEventArgs - { - private ResultEvent _result; - private List _data = new List(); - private ResultMessage _msg; - private int _dataCount; - - internal RecognitionResultEventArgs(ResultEvent e, IntPtr data, int count, string msg) - { - _result = e; - switch (msg) - { - case "stt.result.message.none": - { - _msg = ResultMessage.None; - break; - } - - case "stt.result.message.error.too.soon": - { - _msg = ResultMessage.TooSoon; - break; - } - - case "stt.result.message.error.too.short": - { - _msg = ResultMessage.TooShort; - break; - } - - case "stt.result.message.error.too.long": - { - _msg = ResultMessage.TooLong; - break; - } - - case "stt.result.message.error.too.quiet": - { - _msg = ResultMessage.TooQuiet; - break; - } - - case "stt.result.message.error.too.loud": - { - _msg = ResultMessage.TooLoud; - break; - } - - case "stt.result.message.error.too.fast": - { - _msg = ResultMessage.TooFast; - break; - } - - } - - this._dataCount = count; - - _data.Clear(); - if (count > 0) - { - IntPtr[] dataArray = new IntPtr[count]; - Marshal.Copy(data, dataArray, 0, count); - foreach (IntPtr handle in dataArray) - { - string info = Marshal.PtrToStringAnsi(handle); - _data.Add(info); - } - } - } - - /// - /// The result event. - /// - /// 3 - public ResultEvent Result - { - get - { - return _result; - } - } - - /// - /// The result text. - /// - /// 3 - public IEnumerable Data - { - get - { - return _data; - } - } - - /// - /// Returns the result text count. - /// - /// 3 - public int DataCount - { - get - { - return _dataCount; - } - } - - /// - /// The engine message. - /// - /// 3 - public ResultMessage Message - { - get - { - return _msg; - } - } - } -} diff --git a/src/Tizen.Uix.Stt/Tizen.Uix.Stt/ResultTime.cs b/src/Tizen.Uix.Stt/Tizen.Uix.Stt/ResultTime.cs deleted file mode 100755 index 5b25965d7..000000000 --- a/src/Tizen.Uix.Stt/Tizen.Uix.Stt/ResultTime.cs +++ /dev/null @@ -1,87 +0,0 @@ -/* -* 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 static Interop.Stt; - -namespace Tizen.Uix.Stt -{ - /// - /// This class represents the result of recognition result from the engine. - /// - /// 3 - public class ResultTime - { - internal ResultTime(int index, TimeEvent e, string text, long startTime, long endTime) - { - Index = index; - TokenEvent = e; - Text = text; - StartTime = startTime; - EndTime = endTime; - } - - /// - /// The result index. - /// - /// 3 - public int Index - { - get; - internal set; - } - - /// - /// The token event. - /// - /// 3 - public TimeEvent TokenEvent - { - get; - internal set; - } - - /// - /// The result text. - /// - /// 3 - public string Text - { - get; - internal set; - } - - /// - /// The start time of result text. - /// - /// 3 - public long StartTime - { - get; - internal set; - } - - /// - /// The end time of result text. - /// - /// 3 - public long EndTime - { - get; - internal set; - } - } -} diff --git a/src/Tizen.Uix.Stt/Tizen.Uix.Stt/StateChangedEventArgs.cs b/src/Tizen.Uix.Stt/Tizen.Uix.Stt/StateChangedEventArgs.cs deleted file mode 100755 index 6edbede2b..000000000 --- a/src/Tizen.Uix.Stt/Tizen.Uix.Stt/StateChangedEventArgs.cs +++ /dev/null @@ -1,51 +0,0 @@ -/* -* 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. -*/ - - -namespace Tizen.Uix.Stt -{ - /// - /// This class holds information related to the STT StateChanged event. - /// - /// 3 - public class StateChangedEventArgs - { - internal StateChangedEventArgs(State previous, State current) - { - Previous = previous; - Current = current; - } - - /// - /// The previous state. - /// - /// 3 - public State Previous - { - get; - internal set; - } - /// - /// The current state. - /// - /// 3 - public State Current - { - get; - internal set; - } - } -} diff --git a/src/Tizen.Uix.Stt/Tizen.Uix.Stt/SttClient.cs b/src/Tizen.Uix.Stt/Tizen.Uix.Stt/SttClient.cs deleted file mode 100644 index 1860270d3..000000000 --- a/src/Tizen.Uix.Stt/Tizen.Uix.Stt/SttClient.cs +++ /dev/null @@ -1,1519 +0,0 @@ -/* -* 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.Collections.Generic; -using System.Runtime.InteropServices; -using static Interop.Stt; - -namespace Tizen.Uix.Stt -{ - /// - /// The token event. - /// - /// 3 - public enum ResultEvent - { - /// - /// Event when the recognition for full or last result is ready. - /// - /// 3 - FinalResult = 0, - /// - /// Event when the recognition for partial result is ready. - /// - /// 3 - PartialResult, - /// - /// Event when the recognition has failed. - /// - /// 3 - Error - }; - - /// - /// Enumeration for representing the result message. - /// - /// 3 - public enum ResultMessage - { - /// - /// No Error. - /// - /// 3 - None, - /// - /// Recognition failed because the speech started too soon. - /// - /// 3 - TooSoon, - /// - /// Recognition failed because the speech is too short. - /// - /// 3 - TooShort, - /// - /// Recognition failed because the speech is too long. - /// - /// 3 - TooLong, - /// - /// Recognition failed because the speech is too quiet to listen. - /// - /// 3 - TooQuiet, - /// - /// Recognition failed because the speech is too loud to listen. - /// - /// 3 - TooLoud, - /// - /// Recognition failed because the speech is too fast to listen. - /// - /// 3 - TooFast - }; - - /// - /// Enumeration for the token types. - /// - /// 3 - public enum TimeEvent - { - /// - /// Event when the token is beginning type. - /// - /// 3 - Beginning = 0, - /// - /// Event when the token is middle type. - /// - /// 3 - Middle = 1, - /// - /// Event when the token is end type. - /// - /// 3 - End = 2 - }; - - /// - /// Enumeration for the error values that can occur. - /// - /// 3 - public enum Error - { - /// - /// Successful, No error. - /// - /// 3 - None, - /// - /// Out of Memory. - /// - /// 3 . - OutOfMemory, - /// - /// I/O error. - /// - /// 3 . - IoError, - /// - /// Invalid parameter. - /// - /// 3 - InvalidParameter, - /// - /// No answer from the STT service. - /// - /// 3 - TimedOut, - /// - /// Device or resource busy. - /// - /// 3 - RecorderBusy, - /// - /// Network is down. - /// - /// 3 - OutOfNetwork, - /// - /// Permission denied. - /// - /// 3 - PermissionDenied, - /// - /// STT NOT supported. - /// - /// 3 - NotSupported, - /// - /// Invalid state. - /// - /// 3 - InvalidState, - /// - /// Invalid language. - /// - /// 3 - InvalidLanguage, - /// - /// No available engine. - /// - /// 3 - EngineNotFound, - /// - /// Operation failed. - /// - /// 3 - OperationFailed, - /// - /// Not supported feature of current engine. - /// - /// 3 - NotSupportedFeature, - /// - /// Recording timed out. - /// - /// 3 - RecordingTimedOut, - /// - /// No speech while recording. - /// - /// 3 - NoSpeech, - /// - /// Progress to ready is not finished. - /// - /// 3 - InProgressToReady, - /// - /// Progress to recording is not finished. - /// - /// 3 - InProgressToRecording, - /// - /// Progress to processing is not finished. - /// - /// 3 - InProgressToProcessing, - /// - /// Service reset. - /// - /// 3 - ServiceReset - }; - - /// - /// Enumeration for the recognition types. - /// - /// 3 - public enum RecognitionType - { - /// - /// Free form dictation. - /// - /// 3 - Free, - /// - /// Continuous free dictation. - /// - /// 3 - Partial, - /// - /// Search. - /// - /// 3 - Search, - /// - /// Web search. - /// - /// 3 - WebSearch, - /// - /// Map. - /// - /// 3 - Map - }; - - /// - /// Enumeration for the state types. - /// - /// 3 - public enum State - { - /// - /// Created state. - /// - /// 3 - Created = 0, - /// - /// Ready state. - /// - /// 3 - Ready = 1, - /// - /// Recording state. - /// - /// 3 - Recording = 2, - /// - /// Processing state. - /// - /// 3 - Processing = 3, - /// - /// Unavailable. - /// - /// 3 - Unavailable - }; - - /// - /// Enumeration for the silence detection types. - /// - /// 3 - public enum SilenceDetection - { - /// - /// Silence detection type - False. - /// - /// 3 - False = 0, - /// - /// Silence detection type - True. - /// - /// 3 - True = 1, - /// - /// Silence detection type - Auto. - /// - /// 3 - Auto = 2 - }; - - /// - /// A main function of Speech-To-Text (below STT) API recognizes sound data recorded by users. - /// After choosing a language, the applications will start recording and recognizing. - /// After recording, the applications will receive the recognized result. - /// The STT has a client-server for the service of multi-applications. - /// The STT service always works in the background as a server. If the service is not working, client library will invoke it and the client will communicate with it. - /// The service has engines and a recorder, so that the client does not have the recorder itself. Only the client request commands to the STT service for using STT. - /// - /// 3 - public class SttClient : IDisposable - { - private IntPtr _handle; - private Object thisLock = new Object(); - private event EventHandler _recognitionResult; - private event EventHandler _stateChanged; - private event EventHandler _errorOccurred; - private event EventHandler _defaultLanguageChanged; - private event EventHandler _engineChanged; - private bool disposedValue = false; - private Interop.Stt.RecognitionResultCallback _resultDelegate; - private Interop.Stt.StateChangedCallback _stateDelegate; - private Interop.Stt.ErrorCallback _errorDelegate; - private Interop.Stt.DefaultLanguageChangedCallback _languageDelegate; - private Interop.Stt.EngineChangedCallback _engineDelegate; - private ResultTime _result; - private ResultTimeCallback _resultTimeDelegate; - - /// - /// Constructor to create a STT instance. - /// - /// 3 - /// - /// http://tizen.org/privilege/recorder - /// - /// - /// http://tizen.org/feature/speech.recognition - /// http://tizen.org/feature/microphone - /// - /// This exception can be due to operation failed. - /// This exception can be due to out of memory. - /// This exception can be due to STT not supported. - /// This exception can be due to permission denied. - public SttClient() - { - IntPtr handle; - SttError error = SttCreate(out handle); - if (error != SttError.None) - { - Log.Error(LogTag, "Create Failed with error " + error); - throw ExceptionFactory.CreateException(error); - } - - _handle = handle; - } - - /// - /// Event to be invoked when the recognition is done. - /// - /// 3 - public event EventHandler RecognitionResult - { - add - { - lock (thisLock) - { - _resultDelegate = (IntPtr handle, ResultEvent e, IntPtr data, int dataCount, IntPtr msg, IntPtr userData) => - { - Log.Info(LogTag, "Recognition Result Event Triggered"); - if (data != null && msg != null) - { - RecognitionResultEventArgs args = new RecognitionResultEventArgs(e, data, dataCount, Marshal.PtrToStringAnsi(msg)); - _recognitionResult?.Invoke(this, args); - } - else - { - Log.Info(LogTag, "Recognition Result Event null received"); - } - }; - SttError error = SttSetRecognitionResultCB(_handle, _resultDelegate, IntPtr.Zero); - if (error != SttError.None) - { - Log.Error(LogTag, "Add RecognitionResult Failed with error " + error); - } - else - { - _recognitionResult += value; - } - } - } - - remove - { - lock (thisLock) - { - SttError error = SttUnsetRecognitionResultCB(_handle); - if (error != SttError.None) - { - Log.Error(LogTag, "Remove RecognitionResult Failed with error " + error); - } - - _recognitionResult -= value; - } - } - } - - /// - /// Event to be invoked when the STT state changes. - /// - /// 3 - public event EventHandler StateChanged - { - add - { - lock (thisLock) - { - SttClient obj = this; - _stateDelegate = (IntPtr handle, State previous, State current, IntPtr userData) => - { - StateChangedEventArgs args = new StateChangedEventArgs(previous, current); - _stateChanged?.Invoke(obj, args); - }; - SttError error = SttSetStateChangedCB(_handle, _stateDelegate, IntPtr.Zero); - if (error != SttError.None) - { - Log.Error(LogTag, "Add StateChanged Failed with error " + error); - } - else - { - _stateChanged += value; - } - - } - } - - remove - { - lock (thisLock) - { - SttError error = SttUnsetStateChangedCB(_handle); - if (error != SttError.None) - { - Log.Error(LogTag, "Remove StateChanged Failed with error " + error); - } - - _stateChanged -= value; - } - } - - } - - /// - /// Event to be invoked when an error occurs. - /// - /// 3 - public event EventHandler ErrorOccurred - { - add - { - lock (thisLock) - { - _errorDelegate = (IntPtr handle, SttError reason, IntPtr userData) => - { - ErrorOccurredEventArgs args = new ErrorOccurredEventArgs(handle, reason); - _errorOccurred?.Invoke(this, args); - }; - SttError error = SttSetErrorCB(_handle, _errorDelegate, IntPtr.Zero); - if (error != SttError.None) - { - Log.Error(LogTag, "Add ErrorOccurred Failed with error " + error); - } - - else - { - _errorOccurred += value; - } - } - - } - - remove - { - lock (thisLock) - { - SttError error = SttUnsetErrorCB(_handle); - if (error != SttError.None) - { - Log.Error(LogTag, "Remove ErrorOccurred Failed with error " + error); - } - - _errorOccurred -= value; - } - } - } - - /// - /// Event to be invoked when the default language changes. - /// - /// 3 - public event EventHandler DefaultLanguageChanged - { - add - { - lock (thisLock) - { - _languageDelegate = (IntPtr handle, IntPtr previousLanguage, IntPtr currentLanguage, IntPtr userData) => - { - string previousLanguageString = Marshal.PtrToStringAnsi(previousLanguage); - string currentLanguageString = Marshal.PtrToStringAnsi(currentLanguage); - DefaultLanguageChangedEventArgs args = new DefaultLanguageChangedEventArgs(previousLanguageString, currentLanguageString); - _defaultLanguageChanged?.Invoke(this, args); - }; - SttError error = SttSetDefaultLanguageChangedCB(_handle, _languageDelegate, IntPtr.Zero); - if (error != SttError.None) - { - Log.Error(LogTag, "Add DefaultLanguageChanged Failed with error " + error); - } - - else - { - _defaultLanguageChanged += value; - } - } - - } - - remove - { - lock (thisLock) - { - SttError error = SttUnsetDefaultLanguageChangedCB(_handle); - if (error != SttError.None) - { - Log.Error(LogTag, "Remove DefaultLanguageChanged Failed with error " + error); - } - - _defaultLanguageChanged -= value; - } - } - - } - - /// - /// Event to be invoked to detect the engine change. - /// - /// 3 - public event EventHandler EngineChanged - { - add - { - lock (thisLock) - { - _engineDelegate = (IntPtr handle, IntPtr engineId, IntPtr language, bool supportSilence, bool needCredential, IntPtr userData) => - { - string engineIdString = Marshal.PtrToStringAnsi(engineId); - string languageString = Marshal.PtrToStringAnsi(language); - EngineChangedEventArgs args = new EngineChangedEventArgs(engineIdString, languageString, supportSilence, needCredential); - _engineChanged?.Invoke(this, args); - }; - SttError error = SttSetEngineChangedCB(_handle, _engineDelegate, IntPtr.Zero); - if (error != SttError.None) - { - Log.Error(LogTag, "Add EngineChanged Failed with error " + error); - } - else - { - _engineChanged += value; - } - } - } - - remove - { - lock (thisLock) - { - SttError error = SttUnsetEngineChangedCB(_handle); - if (error != SttError.None) - { - Log.Error(LogTag, "Remove EngineChanged Failed with error " + error); - } - - _engineChanged -= value; - } - } - } - - /// - /// Gets the default language set by the user. - /// The language is specified as an ISO 3166 alpha-2 two letter country-code followed by ISO 639-1 for the two-letter language code. - /// For example, "ko_KR" for Korean, "en_US" for American English. - /// - /// 3 - /// - /// Default language in STT. - /// - /// - /// http://tizen.org/privilege/recorder - /// - /// - /// Default Language string value. - /// - public string DefaultLanguage - { - get - { - string language; - lock (thisLock) - { - SttError error = SttGetDefaultLanguage(_handle, out language); - if (error != SttError.None) - { - Log.Error(LogTag, "DefaultLanguage Failed with error " + error); - return ""; - } - } - - return language; - } - } - - /// - /// Gets the microphone volume during recording. - /// - /// 3 - /// - /// Recording volume in STT. - /// - /// - /// http://tizen.org/privilege/recorder - /// - ///
-        /// The state must be recording.
-        /// 
- public float RecordingVolume - { - get - { - float volume; - lock (thisLock) - { - SttError error = SttGetRecordingVolume(_handle, out volume); - if (error != SttError.None) - { - Log.Error(LogTag, "GetRecordingVolume Failed with error " + error); - return 0.0f; - } - - } - - return volume; - } - - } - - /// - /// Gets the current STT state. - /// - /// 3 - /// - /// Current state of STT. - /// - /// - /// http://tizen.org/privilege/recorder - /// - /// - /// Current STT state value. - /// - public State CurrentState - { - get - { - State state; - lock (thisLock) - { - SttError error = SttGetState(_handle, out state); - if (error != SttError.None) - { - Log.Error(LogTag, "GetState Failed with error " + error); - return State.Unavailable; - } - } - - return state; - } - - } - - /// - /// This property can be used to get and set the current engine id. - /// - /// 3 - /// - /// Current STT engine id. - /// - /// - /// http://tizen.org/privilege/recorder - /// - /// - /// This exceptioncan occur while setting due to the following reasons: - /// 1. Operation Failed - /// 2. Invalid State - /// - /// This exception can be due to out of memory. - /// This exception can be due to STT not supported. - /// This exception can be due to permission denied. - /// This can happen if improper EngineId is provided while setting the value. - ///
-        /// The state must be created.
-        /// 
- public string Engine - { - get - { - string engineId; - lock (thisLock) - { - SttError error = SttGetEngine(_handle, out engineId); - if (error != SttError.None) - { - Log.Error(LogTag, "Get EngineId Failed with error " + error); - return ""; - } - } - - return engineId; - } - set - { - lock (thisLock) - { - SttError error = SttSetEngine(_handle, value); - if (error != SttError.None) - { - Log.Error(LogTag, "Set EngineId Failed with error " + error); - throw ExceptionFactory.CreateException(error); - } - } - - } - } - - /// - /// Retrieves the time stamp of the current recognition result. - /// - /// 3 - /// - /// List of ResultTime. - /// - /// - /// http://tizen.org/privilege/recorder - /// - /// - /// http://tizen.org/feature/speech.recognition - /// http://tizen.org/feature/microphone - /// - /// - /// This function should only be called in the RecognitionResult event. - /// - /// This exception can be due to operation failed. - /// This exception can be due to STT not supported. - /// This exception can be due to permission denied. - public IEnumerable GetDetailedResult() - { - List list = new List(); - _resultTimeDelegate = (IntPtr handle, int index, TimeEvent e, IntPtr text, IntPtr startTime, IntPtr endTime, IntPtr userData) => - { - _result = new ResultTime(index, e, Marshal.PtrToStringAnsi(text), (long)startTime, (long)endTime); - list.Add(_result); - return true; - }; - SttError error = SttForeachDetailedResult(_handle, _resultTimeDelegate, IntPtr.Zero); - if (error != SttError.None) - { - Log.Error(LogTag, "GetDetailedResult Failed with error " + error); - throw ExceptionFactory.CreateException(error); - } - return list; - } - - - /// - /// Gets the private data from the STT engine. - /// - /// 3 - /// - /// The key string. - /// - /// - /// The data corresponding to the key is provided. - /// - /// - /// http://tizen.org/privilege/recorder - /// - /// - /// http://tizen.org/feature/speech.recognition - /// http://tizen.org/feature/microphone - /// - /// This exception can be due to invalid state. - /// This exception can be due to STT not supported. - /// This exception can be due to No Answer from STT Service. - ///
-        /// The state must be ready.
-        /// 
- public string GetPrivateData(string key) - { - string data; - lock (thisLock) - { - SttError error = SttGetPrivateData(_handle, key, out data); - if (error != SttError.None) - { - Log.Error(LogTag, "GetPrivateData Failed with error " + error); - throw ExceptionFactory.CreateException(error); - } - } - - return data; - } - - /// - /// Sets the private data to the STT engine. - /// - /// 3 - /// - /// The key string. - /// - /// - /// The data string. - /// - /// - /// http://tizen.org/privilege/recorder - /// - /// - /// http://tizen.org/feature/speech.recognition - /// http://tizen.org/feature/microphone - /// - /// This exception can be due to invalid state. - /// This exception can be due to STT not supported. - /// This exception can be due to No Answer from STT Service. - /// This can happen if Improper value is provided while setting the value. - ///
-        /// The state must be ready.
-        /// 
- public void SetPrivateData(string key, string data) - { - lock (thisLock) - { - SttError error = SttSetPrivateData(_handle, key, data); - if (error != SttError.None) - { - Log.Error(LogTag, "SetPrivateData Failed with error " + error); - throw ExceptionFactory.CreateException(error); - } - } - } - - /// - /// Gets the list of supported engines. - /// - /// 3 - /// - /// IEnumerable<SupportedEngine> list of supported engines. - /// - /// - /// http://tizen.org/privilege/recorder - /// - /// - /// http://tizen.org/feature/speech.recognition - /// http://tizen.org/feature/microphone - /// - /// This exception can be due to operation failed. - /// This exception can be due to out of memory. - /// This exception can be due to STT not supported. - /// This exception can be due to permission denied. - public IEnumerable GetSupportedEngines() - { - List engineList = new List(); - lock (thisLock) - { - SupportedEngineCallback supportedEngineDelegate = (IntPtr handle, IntPtr engineId, IntPtr engineName, IntPtr userData) => - { - string id = Marshal.PtrToStringAnsi(engineId); - string name = Marshal.PtrToStringAnsi(engineName); - SupportedEngine engine = new SupportedEngine(id, name); - engineList.Add(engine); - return true; - }; - SttError error = SttForeEachSupportedEngines(_handle, supportedEngineDelegate, IntPtr.Zero); - if (error != SttError.None) - { - Log.Error(LogTag, "Create Failed with error " + error); - throw ExceptionFactory.CreateException(error); - } - } - - return engineList; - } - - /// - /// Sets the application credential. - /// - /// 3 - /// - /// The credential string. - /// - /// - /// http://tizen.org/privilege/recorder - /// - /// - /// http://tizen.org/feature/speech.recognition - /// http://tizen.org/feature/microphone - /// - /// - /// This exceptioncan be due to the following reasons: - /// 1. Operation Failed - /// 2. Invalid State - /// - /// This exception can be due to out of memory. - /// This exception can be due to STT not supported. - /// This exception can be due to permission denied. - /// This can happen if Improper value is provided while setting the value. - ///
-        /// The state must be created.
-        /// 
- public void SetCredential(string credential) - { - lock (thisLock) - { - SttError error = SttSetcredential(_handle, credential); - if (error != SttError.None) - { - Log.Error(LogTag, "SetCredential Failed with error " + error); - throw ExceptionFactory.CreateException(error); - } - } - } - - /// - /// Connects to the STT service asynchronously. - /// - /// 3 - /// - /// http://tizen.org/privilege/recorder - /// - /// - /// http://tizen.org/feature/speech.recognition - /// http://tizen.org/feature/microphone - /// - /// This exception can be due to invalid state. - /// This exception can be due to STT not supported. - /// This exception can be due to permission denied. - ///
-        /// The state must be created.
-        /// 
- /// - /// If this function is successful, the STT state will be ready. - /// If this function is unsuccessful, ErrorOccurred event will be invoked. - /// - public void Prepare() - { - lock (thisLock) - { - SttError error = SttPrepare(_handle); - if (error != SttError.None) - { - Log.Error(LogTag, "SetEngine Failed with error " + error); - throw ExceptionFactory.CreateException(error); - } - } - } - - /// - /// Disconnects from the STT service. - /// - /// 3 - /// - /// http://tizen.org/privilege/recorder - /// - /// - /// http://tizen.org/feature/speech.recognition - /// http://tizen.org/feature/microphone - /// - /// This exception can be due to invalid state. - /// This exception can be due to STT not supported. - /// This exception can be due to permission denied. - ///
-        /// The state must be ready.
-        /// 
- /// - /// If this function is successful, the STT state will be Created. - /// - public void Unprepare() - { - lock (thisLock) - { - SttError error = SttUnprepare(_handle); - if (error != SttError.None) - { - Log.Error(LogTag, "Unprepare Failed with error " + error); - throw ExceptionFactory.CreateException(error); - } - } - } - - /// - /// Retrieves all the supported languages of the current engine. - /// The language is specified as an ISO 3166 alpha-2 two letter country-code followed by ISO 639-1 for the two-letter language code. - /// For example, "ko_KR" for Korean, "en_US" for American English. - /// - /// 3 - /// - /// http://tizen.org/privilege/recorder - /// - /// - /// List of strings for supported languages. - /// - /// - /// http://tizen.org/feature/speech.recognition - /// http://tizen.org/feature/microphone - /// - /// - /// This exception can be due to the following reasons: - /// 1. Engine Not Found. - /// 2. Operation Failed. - /// - /// This exception can be due to STT not supported. - /// This exception can be due to permission denied. - public IEnumerable GetSupportedLanguages() - { - List languageList = new List(); - lock (thisLock) - { - SupportedLanguageCallback supportedLanguageDelegate = (IntPtr handle, IntPtr language, IntPtr userData) => - { - string lang = Marshal.PtrToStringAnsi(language); - languageList.Add(lang); - return true; - }; - - SttError error = SttForeachSupportedLanguages(_handle, supportedLanguageDelegate, IntPtr.Zero); - if (error != SttError.None) - { - Log.Error(LogTag, "GetSupportedLanguages Failed with error " + error); - throw ExceptionFactory.CreateException(error); - } - } - - return languageList; - } - - /// - /// Checks whether the recognition type is supported. - /// - /// 3 - /// - /// http://tizen.org/privilege/recorder - /// - /// - /// RecognitionType value. - /// - /// - /// Bool value indicating whether the recognition type is supported. - /// - /// - /// http://tizen.org/feature/speech.recognition - /// http://tizen.org/feature/microphone - /// - /// - /// This exception can be due to the following reasons: - /// 1. Invalid State - /// 2. Engine Not Found - /// 3. Operation Failed - /// - /// This exception can be due to STT not supported. - ///
-        /// The state should be ready.
-        /// 
- public bool IsRecognitionTypeSupported(RecognitionType type) - { - bool supported; - lock (thisLock) - { - string recType = "stt.recognition.type.FREE"; - switch (type) - { - case RecognitionType.Free: - { - recType = "stt.recognition.type.FREE"; - break; - } - - case RecognitionType.Partial: - { - recType = "stt.recognition.type.FREE.PARTIAL"; - break; - } - - case RecognitionType.Search: - { - recType = "stt.recognition.type.SEARCH"; - break; - } - - case RecognitionType.WebSearch: - { - recType = "stt.recognition.type.WEB_SEARCH"; - break; - } - - case RecognitionType.Map: - { - recType = "stt.recognition.type.MAP"; - break; - } - - } - - SttError error = SttIsRecognitionTypeSupported(_handle, recType, out supported); - if (error != SttError.None) - { - Log.Error(LogTag, "IsRecognitionTypeSupported Failed with error " + error); - throw ExceptionFactory.CreateException(error); - } - - } - - return supported; - } - - /// - /// Sets the silence detection. - /// - /// 3 - /// - /// http://tizen.org/privilege/recorder - /// - /// - /// SilenceDetection value. - /// - /// - /// http://tizen.org/feature/speech.recognition - /// http://tizen.org/feature/microphone - /// - /// - /// This exception can be due to the following reasons: - /// 1. Invalid State - /// 2. Not supported feature of current engine - /// 3. Operation Failed - /// - /// This exception can be due to STT not supported. - ///
-        /// The state should be ready.
-        /// 
- public void SetSilenceDetection(SilenceDetection type) - { - lock (thisLock) - { - SttError error = SttSetSilenceDetection(_handle, type); - if (error != SttError.None) - { - Log.Error(LogTag, "SetSilenceDetection Failed with error " + error); - throw ExceptionFactory.CreateException(error); - } - } - } - - /// - /// Sets the sound to start recording. - /// Sound file type should be .wav type. - /// - /// 3 - /// - /// http://tizen.org/privilege/recorder - /// - /// - /// File path for the sound. - /// - /// - /// http://tizen.org/feature/speech.recognition - /// http://tizen.org/feature/microphone - /// - /// - /// This exception can be due to the following reasons: - /// 1. Invalid State - /// 2. Operation Failed - /// - /// This exception can be due to STT not supported. - /// This exception can be due to permission denied. - /// If an Invalid Parameter is provided. - ///
-        /// The state should be ready.
-        /// 
- public void SetStartSound(string filePath) - { - lock (thisLock) - { - SttError error = SttSetStartSound(_handle, filePath); - if (error != SttError.None) - { - Log.Error(LogTag, "SetStartSound Failed with error " + error); - throw ExceptionFactory.CreateException(error); - } - } - } - - /// - /// Unsets the sound to start recording. - /// - /// 3 - /// - /// http://tizen.org/privilege/recorder - /// - /// - /// http://tizen.org/feature/speech.recognition - /// http://tizen.org/feature/microphone - /// - /// - /// This exception can be due to the following reasons: - /// 1. Invalid State - /// 2. Operation Failed - /// - /// This exception can be due to STT not supported. - /// This exception can be due to permission denied. - ///
-        /// The state should be ready.
-        /// 
- public void UnsetStartSound() - { - lock (thisLock) - { - SttError error = SttUnsetStartSound(_handle); - if (error != SttError.None) - { - Log.Error(LogTag, "UnsetStartSound Failed with error " + error); - throw ExceptionFactory.CreateException(error); - } - } - } - - /// - /// Sets the sound to stop recording. - /// Sound file type should be .wav type. - /// - /// 3 - /// - /// http://tizen.org/privilege/recorder - /// - /// - /// File Path for the sound. - /// - /// - /// http://tizen.org/feature/speech.recognition - /// http://tizen.org/feature/microphone - /// - /// - /// This exception can be due to the following reasons: - /// 1. Invalid State - /// 2. Operation Failed - /// - /// This exception can be due to STT not supported. - /// This exception can be due to permission denied. - /// This exception can be due to Invalid Parameter. - ///
-        /// The state should be ready.
-        /// 
- public void SetStopSound(string filePath) - { - lock (thisLock) - { - SttError error = SttSetStopSound(_handle, filePath); - if (error != SttError.None) - { - Log.Error(LogTag, "SetStopSound Failed with error " + error); - throw ExceptionFactory.CreateException(error); - } - } - } - - /// - /// Unsets the sound to stop recording. - /// - /// 3 - /// - /// http://tizen.org/privilege/recorder - /// - /// - /// http://tizen.org/feature/speech.recognition - /// http://tizen.org/feature/microphone - /// - /// - /// This exception can be due to the following reasons: - /// 1. Invalid State - /// 2. Operation Failed - /// - /// This exception can be due to STT not supported. - /// his exception can be due to permission denied. - ///
-        /// The state should be ready.
-        /// 
- public void UnsetStopSound() - { - lock (thisLock) - { - SttError error = SttUnsetStopSound(_handle); - if (error != SttError.None) - { - Log.Error(LogTag, "UnsetStopSound Failed with error " + error); - throw ExceptionFactory.CreateException(error); - } - } - } - - /// - /// Starts the recording and recognition asynchronously. - /// This function starts recording in the STT service and sends the recording data to the engine. - /// This work continues until stop, cancel, or silence is detected by engine. - /// - /// 3 - /// - /// http://tizen.org/privilege/recorder - /// - /// - /// The language selected. - /// - /// - /// The type for recognition. - /// - /// - /// http://tizen.org/feature/speech.recognition - /// http://tizen.org/feature/microphone - /// - /// - /// This exception can be due to the following reasons: - /// 1. Invalid State - /// 2. Operation Failed - /// 3. Recorder Busy - /// 4. Progress to recording is not finished - /// - /// This exception can be due to STT not supported. - /// This exception can be due to permission denied. - /// This exception can be due to an invalid language. - ///
-        /// The state should be ready.
-        /// 
- /// - /// It will invoke the StateChanged event, if registered. - /// If this function succeeds, the STT state will be recording. - /// If you call this function again before the state changes, you will receive ErrorINProgressToRecording. - /// - public void Start(string language, RecognitionType type) - { - lock (thisLock) - { - string recType = "stt.recognition.type.FREE"; - switch (type) - { - case RecognitionType.Free: - { - recType = "stt.recognition.type.FREE"; - break; - } - - case RecognitionType.Partial: - { - recType = "stt.recognition.type.FREE.PARTIAL"; - break; - } - - case RecognitionType.Search: - { - recType = "stt.recognition.type.SEARCH"; - break; - } - - case RecognitionType.WebSearch: - { - recType = "stt.recognition.type.WEB_SEARCH"; - break; - } - - case RecognitionType.Map: - { - recType = "stt.recognition.type.MAP"; - break; - } - - } - - SttError error = SttStart(_handle, language, recType); - if (error != SttError.None) - { - Log.Error(LogTag, "Start Failed with error " + error); - throw ExceptionFactory.CreateException(error); - } - } - } - - /// - /// Finishes the recording and starts recognition processing in the engine asynchronously. - /// - /// 3 - /// - /// http://tizen.org/privilege/recorder - /// - /// - /// http://tizen.org/feature/speech.recognition - /// http://tizen.org/feature/microphone - /// - /// - /// This exception can be due to the following reasons: - /// 1. Invalid State - /// 2. Operation Failed - /// 3. Progress to ready is not finished - /// 4. Progress to recording is not finished - /// 5. Progress to processing is not finished - /// - /// This exception can be due to STT not supported. - /// This exception can be due to permission denied. - ///
-        /// The state should be Recording.
-        /// 
- /// - /// It will invoke the StateChanged Event, if registered. - /// If this function succeeds, the STT state will be processing. - /// If you call this function again before the state changes, you will receive ErrorINProgressToProcessing. - /// After processing of engine, the RecognitionResult event is invoked. - /// - public void Stop() - { - lock (thisLock) - { - SttError error = SttStop(_handle); - if (error != SttError.None) - { - Log.Error(LogTag, "Stop Failed with error " + error); - throw ExceptionFactory.CreateException(error); - } - } - } - - /// - /// Cancels processing the recognition and recording asynchronously. - /// This function cancels recording and the engine cancels recognition processing. - /// After successful cancellation, the StateChanged event is invoked, otherwise if an error is occurs, the ErrorOccurred event is invoked. - /// - /// 3 - /// - /// http://tizen.org/privilege/recorder - /// - /// - /// http://tizen.org/feature/speech.recognition - /// http://tizen.org/feature/microphone - /// - /// - /// This exception can be due to the following reasons: - /// 1. Invalid State - /// 2. Operation Failed - /// 3. Progress to ready is not finished - /// 4. Progress to recording is not finished - /// 5. Progress to processing is not finished - /// - /// This exception can be due to STT not supported. - /// This exception can be due to permission denied. - ///
-        /// The state should be Recording or Processing.
-        /// 
- /// - /// It will invoke the StateChanged event, if registered. - /// If this function succeeds, the STT state will be ready. - /// If you call this function again before the state changes, you will receive ErrorINProgressToReady. - /// - public void Cancel() - { - lock (thisLock) - { - SttError error = SttCancel(_handle); - if (error != SttError.None) - { - Log.Error(LogTag, "Cancel Failed with error " + error); - throw ExceptionFactory.CreateException(error); - } - } - } - - /// - /// A method to release resources. - /// - public void Dispose() - { - Dispose(true); - } - - protected virtual void Dispose(bool disposing) - { - if (!disposedValue) - { - if (disposing) - { - SttError error = SttDestroy(_handle); - if (error != SttError.None) - { - Log.Error(LogTag, "Destroy Failed with error " + error); - } - } - - disposedValue = true; - } - } - } -} diff --git a/src/Tizen.Uix.Stt/Tizen.Uix.Stt/SupportedEngine.cs b/src/Tizen.Uix.Stt/Tizen.Uix.Stt/SupportedEngine.cs deleted file mode 100755 index ace1010fa..000000000 --- a/src/Tizen.Uix.Stt/Tizen.Uix.Stt/SupportedEngine.cs +++ /dev/null @@ -1,64 +0,0 @@ -/* -* 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. -*/ - - -namespace Tizen.Uix.Stt -{ - /// - /// This class provides the information related to STT engine. - /// - /// 3 - public class SupportedEngine - { - private string _engineId; - private string _engineName; - - internal SupportedEngine(string id, string name) - { - this._engineId = id; - this._engineName = name; - } - /// - /// The engine ID. - /// - /// 3 - /// - /// The string engine ID. - /// - public string EngineId - { - get - { - return _engineId; - } - } - - /// - /// The engine name. - /// - /// 3 - /// - /// The string engine name. - /// - public string EngineName - { - get - { - return _engineName; - } - } - } -} diff --git a/src/Tizen.Uix.SttEngine/Interop/Interop.Libraries.cs b/src/Tizen.Uix.SttEngine/Interop/Interop.Libraries.cs deleted file mode 100755 index 83566e5e9..000000000 --- a/src/Tizen.Uix.SttEngine/Interop/Interop.Libraries.cs +++ /dev/null @@ -1,30 +0,0 @@ -/* -* 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. -*/ - - -/// -/// Partial Interop Class -/// -internal static partial class Interop -{ - /// - /// Partial Libraries Class - /// - internal static partial class Libraries - { - internal const string SttEngine = "libstt_engine.so"; - } -} diff --git a/src/Tizen.Uix.SttEngine/Interop/Interop.SttEngine.cs b/src/Tizen.Uix.SttEngine/Interop/Interop.SttEngine.cs deleted file mode 100755 index dc07ccfbe..000000000 --- a/src/Tizen.Uix.SttEngine/Interop/Interop.SttEngine.cs +++ /dev/null @@ -1,198 +0,0 @@ -/* -* 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; -using Tizen.Uix.SttEngine; -using static Tizen.Uix.SttEngine.Engine; - -/// -/// Partial Interop Class -/// -internal static partial class Interop -{ - /// - /// SttEngine Interop Class - /// - internal static class SttEngine - { - internal static string LogTag = "Tizen.Uix.SttEngine"; - - private const int ErrorStt = -0x02F00000; - - public enum ErrorCode - { - None = Tizen.Internals.Errors.ErrorCode.None, /**< Successful */ - OutOfMemory = Tizen.Internals.Errors.ErrorCode.OutOfMemory, /**< Out of Memory */ - IoError = Tizen.Internals.Errors.ErrorCode.IoError, /**< I/O error */ - InvalidParameter = Tizen.Internals.Errors.ErrorCode.InvalidParameter, /**< Invalid parameter */ - NetworkDown = Tizen.Internals.Errors.ErrorCode.Networkdown, /**< Network down(Out of network) */ - InvalidState = ErrorStt | 0x01, /**< Invalid state */ - InvalidLanguage = ErrorStt | 0x02, /**< Invalid language */ - OperationFailed = ErrorStt | 0x04, /**< Operation failed */ - NotSupportedFeature = ErrorStt | 0x05, /**< Not supported feature of current engine */ - NotSupported = Tizen.Internals.Errors.ErrorCode.NotSupported, /**< Device or resource busy */ - PermissionDenied = Tizen.Internals.Errors.ErrorCode.PermissionDenied, /**< Permission denied */ - RecordingTimedOut = ErrorStt | 0x06, /**< Recording timed out */ - }; - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate Error InitializeCb(); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate Error DeinitializeCb(); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate Error ForEachSupportedLangsCb(SupportedLanguages cb, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate Error IsValidLanguageCb(IntPtr language, IntPtr isValid); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool SupportSilenceDetectionCb(); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate Error SupportRecognitionTypeCb(string type, out bool isSupported); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate Error GetRecordingFormatCb(out AudioType types, out int rate, out int channels); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate Error SetSilenceDetectionCb(bool isSet); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate Error CheckAppAgreedCb(string appid, out bool isAgreed); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool NeedAppCredentialCb(); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate Error ForEachResultTimeCb(IntPtr timeInfo, ResultTime callback, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate Error StartCb(IntPtr language, IntPtr type, IntPtr appid, IntPtr credential, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate Error SetRecordingDataCb(string data, uint length); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate Error StopCb(); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate Error CancelCb(); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate Error GetInfoCb(out IntPtr engineUuid, out IntPtr engineName, out IntPtr engineSetting, out IntPtr useNetwork); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate Error PrivateDataSetCb(string key, string data); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate Error PrivateDataRequestedCb(string key, out string data); - - [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)] - internal struct RequestCallbackStruct - { - internal int version; - [MarshalAs(UnmanagedType.FunctionPtr)] - internal GetInfoCb getInfo; - [MarshalAs(UnmanagedType.FunctionPtr)] - internal InitializeCb initialize; - [MarshalAs(UnmanagedType.FunctionPtr)] - internal DeinitializeCb deinitialize; - [MarshalAs(UnmanagedType.FunctionPtr)] - internal ForEachSupportedLangsCb supportedLanaguge; - [MarshalAs(UnmanagedType.FunctionPtr)] - internal IsValidLanguageCb validLanaguage; - [MarshalAs(UnmanagedType.FunctionPtr)] - internal SupportSilenceDetectionCb silence; - [MarshalAs(UnmanagedType.FunctionPtr)] - internal SupportRecognitionTypeCb recognitionType; - [MarshalAs(UnmanagedType.FunctionPtr)] - internal GetRecordingFormatCb recordingFormat; - [MarshalAs(UnmanagedType.FunctionPtr)] - internal ForEachResultTimeCb resultTime; - [MarshalAs(UnmanagedType.FunctionPtr)] - internal SetSilenceDetectionCb silenceDetection; - [MarshalAs(UnmanagedType.FunctionPtr)] - internal StartCb start; - [MarshalAs(UnmanagedType.FunctionPtr)] - internal SetRecordingDataCb recordingData; - [MarshalAs(UnmanagedType.FunctionPtr)] - internal StopCb stop; - [MarshalAs(UnmanagedType.FunctionPtr)] - internal CancelCb cancel; - [MarshalAs(UnmanagedType.FunctionPtr)] - internal CheckAppAgreedCb checkAppAgreed; - [MarshalAs(UnmanagedType.FunctionPtr)] - internal NeedAppCredentialCb needAppCredential; - }; - - internal sealed class CallbackStructGCHandle : IDisposable - { - internal RequestCallbackStruct CallbackStruct; - internal GCHandle CallbackStructHandle; - public CallbackStructGCHandle() - { - CallbackStruct = new RequestCallbackStruct(); - CallbackStructHandle = GCHandle.Alloc(CallbackStruct); - } - - #region IDisposable Support - private bool disposedValue = false; - - void Dispose(bool disposing) - { - Tizen.Log.Info(LogTag, "In Dispose"); - if (!disposedValue) - { - if (disposing) - { - Tizen.Log.Info(LogTag, "In Dispose free called"); - CallbackStructHandle.Free(); - } - - disposedValue = true; - } - } - - public void Dispose() - { - Dispose(true); - } - #endregion - } - - [DllImport(Libraries.SttEngine, EntryPoint = "stte_main")] - internal static extern Error STTEMain(int argc, string[] argv, IntPtr callback); - - [DllImport(Libraries.SttEngine, EntryPoint = "stte_send_result")] - internal static extern Error STTESendResult(ResultEvent resultEvent, string type, string[] result, int resultCount, string msg, IntPtr timeInfo, IntPtr userData); - - [DllImport(Libraries.SttEngine, EntryPoint = "stte_send_error")] - internal static extern Error STTESendError(Error error, string msg); - - [DllImport(Libraries.SttEngine, EntryPoint = "stte_send_speech_status")] - internal static extern Error STTESendSpeechStatus(SpeechStatus status, IntPtr userData); - - [DllImport(Libraries.SttEngine, EntryPoint = "stte_set_private_data_set_cb")] - internal static extern Error STTESetPrivateDataSetCb(PrivateDataSetCb callbackFunc); - - [DllImport(Libraries.SttEngine, EntryPoint = "stte_set_private_data_requested_cb")] - internal static extern Error STTESetPrivateDataRequestedCb(PrivateDataRequestedCb callbackFunc); - } -} diff --git a/src/Tizen.Uix.SttEngine/Tizen.Uix.SttEngine.csproj b/src/Tizen.Uix.SttEngine/Tizen.Uix.SttEngine.csproj deleted file mode 100755 index 4c51c4197..000000000 --- a/src/Tizen.Uix.SttEngine/Tizen.Uix.SttEngine.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - netstandard2.0 - - - - - - - - \ No newline at end of file diff --git a/src/Tizen.Uix.SttEngine/Tizen.Uix.SttEngine.sln b/src/Tizen.Uix.SttEngine/Tizen.Uix.SttEngine.sln deleted file mode 100755 index 4b499e7e2..000000000 --- a/src/Tizen.Uix.SttEngine/Tizen.Uix.SttEngine.sln +++ /dev/null @@ -1,34 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26430.12 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Uix.SttEngine", "Tizen.Uix.SttEngine.csproj", "{EBBE8616-439A-4C62-8E4A-F0777502AC82}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen", "..\Tizen\Tizen.csproj", "{CB914098-FA2E-47CE-8B1B-CE5E319AEF37}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Log", "..\Tizen.Log\Tizen.Log.csproj", "{CBF2A756-AFBE-406F-84F9-CFAA8EF96E4B}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {EBBE8616-439A-4C62-8E4A-F0777502AC82}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {EBBE8616-439A-4C62-8E4A-F0777502AC82}.Debug|Any CPU.Build.0 = Debug|Any CPU - {EBBE8616-439A-4C62-8E4A-F0777502AC82}.Release|Any CPU.ActiveCfg = Release|Any CPU - {EBBE8616-439A-4C62-8E4A-F0777502AC82}.Release|Any CPU.Build.0 = Release|Any CPU - {CB914098-FA2E-47CE-8B1B-CE5E319AEF37}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {CB914098-FA2E-47CE-8B1B-CE5E319AEF37}.Debug|Any CPU.Build.0 = Debug|Any CPU - {CB914098-FA2E-47CE-8B1B-CE5E319AEF37}.Release|Any CPU.ActiveCfg = Release|Any CPU - {CB914098-FA2E-47CE-8B1B-CE5E319AEF37}.Release|Any CPU.Build.0 = Release|Any CPU - {CBF2A756-AFBE-406F-84F9-CFAA8EF96E4B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {CBF2A756-AFBE-406F-84F9-CFAA8EF96E4B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {CBF2A756-AFBE-406F-84F9-CFAA8EF96E4B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {CBF2A756-AFBE-406F-84F9-CFAA8EF96E4B}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/src/Tizen.Uix.SttEngine/Tizen.Uix.SttEngine/ExceptionFactory.cs b/src/Tizen.Uix.SttEngine/Tizen.Uix.SttEngine/ExceptionFactory.cs deleted file mode 100755 index 29db48dbd..000000000 --- a/src/Tizen.Uix.SttEngine/Tizen.Uix.SttEngine/ExceptionFactory.cs +++ /dev/null @@ -1,107 +0,0 @@ -/* -* 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 static Interop.SttEngine; - - -namespace Tizen.Uix.SttEngine -{ - internal static class ExceptionFactory - { - internal static Exception CreateException(ErrorCode err) - { - Tizen.Log.Error(LogTag, "Error " + err); - Exception exp; - switch (err) - { - case ErrorCode.OutOfMemory: - { - exp = new OutOfMemoryException("Out Of Memory"); - break; - } - - case ErrorCode.IoError: - { - exp = new InvalidOperationException("I/O Error Occured"); - break; - } - - case ErrorCode.InvalidParameter: - { - exp = new ArgumentException("Invalid Parameters Provided"); - break; - } - - case ErrorCode.NetworkDown: - { - exp = new InvalidOperationException("Network down(Out of network)"); - break; - } - - case ErrorCode.InvalidState: - { - exp = new InvalidOperationException("Invalid state"); - break; - } - - case ErrorCode.InvalidLanguage: - { - exp = new InvalidOperationException("Invalid language"); - break; - } - - case ErrorCode.OperationFailed: - { - exp = new InvalidOperationException("Operation Failed"); - break; - } - - case ErrorCode.NotSupportedFeature: - { - exp = new InvalidOperationException("Not supported feature"); - break; - } - - case ErrorCode.NotSupported: - { - exp = new NotSupportedException("Not supported"); - break; - } - - case ErrorCode.PermissionDenied: - { - exp = new UnauthorizedAccessException("Permission Denied"); - break; - } - - case ErrorCode.RecordingTimedOut: - { - exp = new TimeoutException("Recording timed out"); - break; - } - - default: - { - exp = new Exception(""); - break; - } - } - - return exp; - } - } -} diff --git a/src/Tizen.Uix.SttEngine/Tizen.Uix.SttEngine/SttEngine.cs b/src/Tizen.Uix.SttEngine/Tizen.Uix.SttEngine/SttEngine.cs deleted file mode 100755 index 77f096518..000000000 --- a/src/Tizen.Uix.SttEngine/Tizen.Uix.SttEngine/SttEngine.cs +++ /dev/null @@ -1,829 +0,0 @@ -/* -* 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; -using static Interop.SttEngine; - -namespace Tizen.Uix.SttEngine -{ - /// - /// Enumeration for audio type. - /// - public enum AudioType - { - /// - /// Signed 16bit audio type, Little endian - /// - PcmS16Le = 0, - /// - /// Unsigned 8bit audio type - /// - PcmU8 - }; - - /// - /// Enumeration for result. - /// - public enum ResultEvent - { - /// - /// Event when either the full matched or the final result is delivered - /// - FinalResult = 0, - /// - /// Event when the partial matched result is delivered - /// - PartialResult, - /// - /// Event when the recognition has failed - /// - Error - }; - - /// - /// Enumeration for result time. - /// - public enum TimeEvent - { - /// - /// Event when the token is beginning type - /// - Beginning = 0, - /// - /// Event when the token is middle type - /// - Middle = 1, - /// - /// Event when the token is end type - /// - End = 2 - }; - - /// - /// Enumeration for speech status. - /// - public enum SpeechStatus - { - /// - /// Beginning point of speech is detected - /// - BeginningPointDetected = 0, - /// - /// End point of speech is detected - /// - EndPointDetected - }; - - /// - /// Enumeration representing the result message - /// - public enum ResultMessage - { - /// - /// No Error - /// - None, - /// - /// Recognition failed because the speech started too soon. - /// - TooSoon, - /// - /// Recognition failed because the speech is too short. - /// - TooShort, - /// - /// Recognition failed because the speech is too long. - /// - TooLong, - /// - /// Recognition failed because the speech is too quiet to listen. - /// - TooQuiet, - /// - /// Recognition failed because the speech is too loud to listen. - /// - TooLoud, - /// - /// Recognition failed because the speech is too fast to listen. - /// - TooFast - }; - - - /// - /// Enum for Error values that can occur - /// - public enum Error - { - /// - /// Successful, No error - /// - None = ErrorCode.None, - /// - /// Out of Memory - /// - OutOfMemory = ErrorCode.OutOfMemory, - /// - /// I/O error - /// - IoError = ErrorCode.IoError, - /// - /// Invalid parameter - /// - InvalidParameter = ErrorCode.InvalidParameter, - /// - /// Network down(Out of network) - /// - NetworkDown = ErrorCode.NetworkDown, - /// - /// Invalid state - /// - InvalidState = ErrorCode.InvalidState, - /// - /// Invalid language - /// - InvalidLanguage = ErrorCode.InvalidLanguage, - /// - /// Operation failed - /// - OperationFailed = ErrorCode.OperationFailed, - /// - /// Not supported feature of current engine - /// - NotSupportedFeature = ErrorCode.NotSupportedFeature, - /// - /// NOT supported - /// - NotSupported = ErrorCode.NotSupported, - /// - /// Permission denied - /// - PermissionDenied = ErrorCode.PermissionDenied, - /// - /// Recording timed out - /// - RecordingTimedOut = ErrorCode.RecordingTimedOut - }; - - /// - /// This Class represents the Stt Engine which has to be inherited to make the engine. - /// - public abstract class Engine - { - private CallbackStructGCHandle _callbackStructGCHandle = new CallbackStructGCHandle(); - private PrivateDataSetCb _privateDataSetCb; - private Action _privateDatacallback; - private PrivateDataRequestedCb _privateDataRequestedCb; - private OutAction _privateDataRequestedCallback; - private static Engine _engine; - private IntPtr _structIntPtrHandle; - - /// - /// An Action with 2 Input Parameter returning a Error - /// - /// Generic Type for Parameter 1 - /// The Input Parameter 1 - /// The Input Parameter 2 - /// Error Value - public delegate Error Action(T a, T b); - - /// - /// An Action with 2 Out Parameter returning a Error - /// - /// Generic Type for Parameter 1 - /// The Input Parameter 1 - /// The Input Parameter 2 - /// Error Value - public delegate Error OutAction(T a, out T b); - - /// - /// Called when Stt engine provides the time stamp of result to the engine service user. - /// This callback function is implemented by the engine service user. Therefore, the engine developer does NOT have to implement this callback function. - /// - /// The result index - /// The token event - /// The result text - /// The time started speaking the result text - /// The time finished speaking the result text - /// The User data - /// true to continue with the next iteration of the loop, false to break out of the loop - /// SendResult() should be called. - public delegate bool ResultTime(int index, TimeEvent resultEvent, string text, long startTime, long endTime, IntPtr userData); - - /// - /// Called when Stt engine informs the engine service user about whole supported language list. - /// This callback function is implemented by the engine service user. Therefore, the engine developer does NOT have to implement this callback function. - /// - /// The language is specified as an ISO 3166 alpha-2 two letter country-code - /// followed by ISO 639-1 for the two-letter language code - /// for example, "ko_KR" for Korean, "en_US" for American English - /// The User data - /// true to continue with the next iteration of the loop, false to break out of the loop - /// ForEachSupportedLanguages() should be called - public delegate bool SupportedLanguages(string language, IntPtr userData); - - /// - /// Called when the engine service user requests the basic information of Stt engine. - /// - /// - /// In order to upload the engine at Tizen Appstore, both a service app and a ui app are necessary. Therefore, engineSetting must be transferred to the engine service user. - /// - /// UUID of engine - /// Name of engine - /// The engine setting application(ui app)'s app ID - /// A variable for checking whether the network is used or not - /// - /// Following Error Codes can be returned - /// 1. None - /// 2. OperationFailed - /// 3. InvalidParameter - /// - public abstract Error GetInformation(out string engineUuid, out string engineName, out string engineSetting, out bool useNetwork); - - /// - /// Called when the engine service user initializes Stt engine. - /// This callback function is called by the engine service user to request for Stt engine to be started. - /// - /// - /// Following Error Codes can be returned - /// 1. None - /// 2. InvalidParameter - /// 3. InvalidState - /// 4. OperationFailed - /// - public abstract Error Initialize(); - - /// - /// Called when the engine service user deinitializes Stt engine. - /// This callback function is called by the engine service user to request for Stt engine to be deinitialized. - /// - /// - /// Following Error Codes can be returned - /// 1. None - /// 2. InvalidState - /// - public abstract Error Deinitialize(); - - /// - /// Called when the engine service user gets the whole supported language list. - /// - /// - /// In this function, the engine service user's callback function 'SupportedLanguages' is invoked repeatedly for getting all supported languages - /// and user_data must be transferred to 'SupportedLanguages'. If 'SupportedLanguages' returns false, it should be stopped to call 'SupportedLanguages'. - /// - /// The callback function - /// The user data which must be passed to the callback delegate 'SupportedLanguages' - /// - /// Following Error Codes can be returned - /// 1. None - /// 2. InvalidState - /// 3. InvalidParameter - /// - /// - /// This callback function invokes SupportedLanguages repeatedly for getting supported languages. - /// - public abstract Error ForEachSupportedLanguages(SupportedLanguages callback, IntPtr userData); - - /// - /// Called when the engine service user checks whether the corresponding language is valid or not in Stt engine. - /// - /// The language is specified as an ISO 3166 alpha-2 two letter country-code followed by ISO 639-1 for the two-letter language code - /// For example, "ko_KR" for Korean, "en_US" for American English - /// A variable for checking whether the corresponding language is valid or not. true to be valid, false to be invalid - /// - /// Following Error Codes can be returned - /// 1. None - /// 2. InvalidParameter - /// - public abstract Error IsValidLanguage(string language, out bool isValid); - - /// - /// Called when the engine service user checks whether Stt engine supports silence detection. - /// - /// true to support silence detection, false not to support silence detection - public abstract bool SupportSilenceDetection(); - - /// - /// Called when the engine service user checks whether Stt engine supports the corresponding recognition type. - /// - /// The type for recognition, "stt.recognition.type.FREE" or "stt.recognition.type.FREE.PARTIAL" - /// A variable for checking whether Stt engine supports the corresponding recognition type. - /// true to support recognition type, false not to support recognition type - /// - /// Following Error Codes can be returned - /// 1. None - /// 2. InvalidParameter - /// - public abstract Error SupportRecognitionType(string type, out bool isSupported); - - /// - /// Called when the engine service user gets the proper recording format of Stt engine. - /// The recording format is used for creating the recorder. - /// - /// The format used by the recorder - /// The sample rate used by the recorder - /// The number of channels used by the recorder - /// - /// Following Error Codes can be returned - /// 1. None - /// 2. InvalidState - /// - public abstract Error GetRecordingFormat(out AudioType types, out int rate, out int channels); - - /// - /// Called when the engine service user sets the silence detection. - /// If the engine service user sets this option as 'TRUE', Stt engine will detect the silence (EPD) and send the callback event about it. - /// - /// A variable for setting the silence detection. true to detect the silence, false not to detect the silence - /// - /// Following Error Codes can be returned - /// 1. None - /// 2. InvalidState - /// 3. NotSupportedFeature - /// - public abstract Error SetSilenceDetection(bool isSet); - - /// - /// Called when the engine service user requests for Stt engine to check whether the application agreed the usage of Stt engine. - /// This callback function is called when the engine service user requests for Stt engine to check the application's agreement about using the engine. - /// According to the need, the engine developer can provide some user interfaces to check the agreement. - /// - /// The Application ID - /// A variable for checking whether the application agreed to use Stt engine or not. true to agree, false to disagree - /// - /// Following Error Codes can be returned - /// 1. None - /// 2. InvalidState - /// 3. NotSupportedFeature - /// - public abstract Error CheckAppAgreed(string appid, out bool isAgreed); - - /// - /// Called when the engine service user checks whether Stt engine needs the application's credential. - /// - /// true if Stt engine needs the application's credential, otherwise false - public abstract bool NeedAppCredential(); - - /// - /// Called when the engine service user gets the result time information(stamp). - /// - /// - /// In this function, the engine service user's callback delegate 'ResultTime' is invoked repeatedly for sending the time information to the engine service user - /// and user_data must be transferred to 'ResultTime'. If 'ResultTime' returns false, it should be stopped to call 'ResultTime'. - /// timeInfo is transferred from SendResult. The type of timeInfo is up to the Stt engine developer. - /// - /// The time information - /// The callback function - /// The user data which must be passed to the callback function ResultTime - /// - /// Following Error Codes can be returned - /// 1. None - /// 2. InvalidState - /// 3. InvalidParameter - /// - /// - /// SendResult will invoke this function - /// - /// - /// This function invokes ResultTime repeatedly for getting result time information. - /// - public abstract Error ForEachResultTime(IntPtr timeInfo, ResultTime callback, IntPtr userData); - - /// - /// Called when the engine service user starts to recognize the recording data. - /// In this callback function, Stt engine must transfer the recognition result and userData to the engine service user using SendResult(). - /// Also, if Stt engine needs the application's credential, it sets the credential granted to the application. - /// - /// The language is specified as an ISO 3166 alpha-2 two letter country-code followed by ISO 639-1 for the two-letter language code - /// For example, "ko_KR" for Korean, "en_US" for American English - /// The recognition type, "stt.recognition.type.FREE" or "stt.recognition.type.FREE.PARTIAL" - /// The Application ID - /// The credential granted to the application - /// The user data to be passed to the callback function - /// - /// Following Error Codes can be returned - /// 1. None - /// 2. InvalidState - /// 3. InvalidParameter - /// 4. InvalidLanguage - /// 5. OperationFailed - /// 6. NetworkDown - /// - /// - /// The engine is not in recognition processing. - /// - public abstract Error Start(string language, string type, string appid, string credential, IntPtr userData); - - /// - /// Called when the engine service user sets and sends the recording data for speech recognition. - /// This callback function is called by the engine service user to send the recording data to Stt engine.The engine receives the recording data and uses for speech recognition. - /// this function should be returned immediately after recording data copy. - /// - /// The recording data - /// The length of recording data - /// - /// Following Error Codes can be returned - /// 1. None - /// 2. InvalidState - /// 3. InvalidParameter - /// 4. OperationFailed - /// - /// - /// Start should succeed - /// - /// If the engine supports partial result, SendResult() should be invoked. - public abstract Error SetRecordingData(string data, uint length); - - /// - /// Called when the engine service user stops to recognize the recording data. - /// This callback function is called by the engine service user to stop recording and to get the recognition result. - /// - /// Following Error Codes can be returned - /// 1. None - /// 2. InvalidState - /// 3. OperationFailed - /// 4. NetworkDown - /// - /// - /// Start should succeed - /// - /// After processing of the engine, , SendResult() should be invoked. - public abstract Error Stop(); - - /// - /// Called when the engine service user cancels to recognize the recording data. - /// This callback function is called by the engine service user to cancel to recognize the recording data.Also, when starting the recorder is failed, this function is called. - /// - /// - /// Following Error Codes can be returned - /// 1. None - /// 2. InvalidState - /// - /// Stt engine is in recognition processing or recording. - public abstract Error Cancel(); - - /// - /// Public Constructor - /// - /// - /// http://tizen.org/feature/speech.recognition - /// http://tizen.org/feature/microphone - /// - public Engine() - { - _engine = this; - } - - /// - /// Main function for Speech-To-Text (STT) engine. - /// This function is the main function for operating Stt engine. - /// - /// - /// http://tizen.org/privilege/recorder - /// - /// - /// http://tizen.org/feature/speech.recognition - /// http://tizen.org/feature/microphone - /// - /// - /// ServiceAppMain should be used for working the engine after this function. - /// - /// The Number of Arguments - /// The Arguments Array - /// Thrown in case of Invalid Parameter - /// Thrown in case of Permission denied - /// Thrown in case of Not supported - /// thrown in case of Operation failure - public void EngineMain(int argc, string[] argv) - { - _callbackStructGCHandle.CallbackStruct.version = 1; - _callbackStructGCHandle.CallbackStruct.getInfo = _getInfoCb; - _callbackStructGCHandle.CallbackStruct.initialize = Initialize; - _callbackStructGCHandle.CallbackStruct.deinitialize = _deinitializeCb; - _callbackStructGCHandle.CallbackStruct.supportedLanaguge = ForEachSupportedLanguages; - _callbackStructGCHandle.CallbackStruct.validLanaguage = _isValidLanguageCb; - _callbackStructGCHandle.CallbackStruct.silence = SupportSilenceDetection; - _callbackStructGCHandle.CallbackStruct.recognitionType = SupportRecognitionType; - _callbackStructGCHandle.CallbackStruct.recordingFormat = GetRecordingFormat; - _callbackStructGCHandle.CallbackStruct.resultTime = ForEachResultTime; - _callbackStructGCHandle.CallbackStruct.silenceDetection = SetSilenceDetection; - _callbackStructGCHandle.CallbackStruct.start = _startCb; - _callbackStructGCHandle.CallbackStruct.recordingData = SetRecordingData; - _callbackStructGCHandle.CallbackStruct.stop = Stop; - _callbackStructGCHandle.CallbackStruct.cancel = Cancel; - _callbackStructGCHandle.CallbackStruct.checkAppAgreed = CheckAppAgreed; - _callbackStructGCHandle.CallbackStruct.needAppCredential = NeedAppCredential; - _structIntPtrHandle = Marshal.AllocHGlobal(Marshal.SizeOf(_callbackStructGCHandle.CallbackStruct)); - Marshal.StructureToPtr(_callbackStructGCHandle.CallbackStruct, _structIntPtrHandle, false); - Error error = STTEMain(argc, argv, _structIntPtrHandle); - if (error != Error.None) - { - Log.Error(LogTag, "STTEMain Failed with error " + error); - throw ExceptionFactory.CreateException((ErrorCode)error); - } - - Log.Info(LogTag, "After STTEMain"); - } - - /// - /// Sends the recognition result to the engine service user. - /// - /// - /// http://tizen.org/feature/speech.recognition - /// http://tizen.org/feature/microphone - /// - /// - /// This API is used in SetRecordingData() and Stop(), when Stt engine sends the recognition result to the engine service user. - /// This function is called in the following situations; 1) after Stop() is called, 2) the end point of speech is detected from recording, or 3) partial result is occurred. - /// The recognition result must be transferred to the engine service user through this function. Also, timeInfo must be transferred to ForEachResultTime(). - /// The type of timeInfo is up to the Stt engine developer. - /// - /// The result event - /// The recognition type, "stt.recognition.type.FREE" or "stt.recognition.type.FREE.PARTIAL" - /// Result texts - /// Result text count - /// Engine message - /// The time information - /// Thrown in case of Invalid Parameter - /// Thrown in case of Permission denied - /// Thrown in case of Not supported - /// thrown in case of Operation failure - /// - /// EngineMain function should be invoked before this function is called. Stop will invoke this function. - /// - /// - /// This function invokes ForEachResultTime - /// - public void SendResult(ResultEvent resultEvent, string type, string[] result, int resultCount, ResultMessage msg, IntPtr timeInfo) - { - if ((result != null) && (result.Length != 0)) - { - - string message = "stt.result.message.none"; - switch (msg) - { - case ResultMessage.None: - message = "stt.result.message.none"; - break; - - case ResultMessage.TooFast: - message = "stt.result.message.error.too.fast"; - break; - - case ResultMessage.TooLong: - message = "stt.result.message.error.too.long"; - break; - - case ResultMessage.TooLoud: - message = "stt.result.message.error.too.loud"; - break; - - case ResultMessage.TooQuiet: - message = "stt.result.message.error.too.quiet"; - break; - - case ResultMessage.TooShort: - message = "stt.result.message.error.too.short"; - break; - - case ResultMessage.TooSoon: - message = "stt.result.message.error.too.soon"; - break; - } - - Error error = STTESendResult(resultEvent, type, result, resultCount, message, timeInfo, IntPtr.Zero); - if (error != Error.None) - { - Log.Error(LogTag, "STTESendResult Failed with error " + error); - throw ExceptionFactory.CreateException((ErrorCode)error); - } - - } - else - { - throw new ArgumentNullException("result", "is null or empty"); - } - } - - /// - /// Sends the error to the engine service user. - /// - /// - /// http://tizen.org/feature/speech.recognition - /// http://tizen.org/feature/microphone - /// - /// The Error Reason - /// The error message - /// Thrown in case of Invalid Parameter - /// Thrown in case of Permission denied - /// Thrown in case of Not supported - /// thrown in case of Operation failure - /// - /// Main function should be invoked before this function is called. - /// - public void SendError(Error error, string msg) - { - Error err = STTESendError(error, msg); - if (err != Error.None) - { - Log.Error(LogTag, "SendError Failed with error " + err); - throw ExceptionFactory.CreateException((ErrorCode)error); - } - - } - - /// - /// Sends the speech status to the engine service user when Stt engine notifies the change of the speech status. - /// - /// - /// http://tizen.org/feature/speech.recognition - /// http://tizen.org/feature/microphone - /// - /// - /// This API is invoked when Stt engine wants to notify the change of the speech status anytime. NOTE that this API can be invoked for recognizing the speech. - /// - /// SpeechStatus - /// Thrown in case of Invalid Parameter - /// Thrown in case of Permission denied - /// Thrown in case of Not supported - /// thrown in case of Operation failure - /// - /// Main function should be invoked before this function is called. Start() and SetRecordingData() will invoke this function. - /// - public void SendSpeechStatus(SpeechStatus status) - { - Error error = STTESendSpeechStatus(status, IntPtr.Zero); - if (error != Error.None) - { - Log.Error(LogTag, "SendSpeechStatus Failed with error " + error); - throw ExceptionFactory.CreateException((ErrorCode)error); - } - - } - - /// - /// Sets a callback function for setting the private data. - /// - /// - /// http://tizen.org/privilege/recorder - /// - /// - /// http://tizen.org/feature/speech.recognition - /// http://tizen.org/feature/microphone - /// - /// - /// Called when Stt engine receives the private data from the engine service user. - /// This callback function is called when the engine service user sends the private data to Stt engine. - /// In Parameters: - /// a = Key -- The key field of private data - /// b = data -- The data field of private data - /// Following Error Codes can be returned - /// 1. None - /// 2. InvalidParameter - /// 3. OperationFailed - /// - /// Thrown in case of Invalid Parameter - /// Thrown in case of Permission denied - /// Thrown in case of Not supported - /// thrown in case of Operation failure - /// - /// Main function should be invoked before this function is called. - /// - public void SetPrivateDataSetDelegate(Action callback) - { - _privateDatacallback = callback; - _privateDataSetCb = (string key, string data) => - { - return _privateDatacallback.Invoke(key, data); - }; - Error error = STTESetPrivateDataSetCb(_privateDataSetCb); - if (error != Error.None) - { - Log.Error(LogTag, "SetPrivateDataSetDelegate Failed with error " + error); - throw ExceptionFactory.CreateException((ErrorCode)error); - } - - } - - /// - /// Sets a callback delegate for requesting the private data. - /// - /// - /// http://tizen.org/privilege/recorder - /// - /// - /// http://tizen.org/feature/speech.recognition - /// http://tizen.org/feature/microphone - /// - /// callback function - /// Called when Stt engine provides the engine service user with the private data. - /// This callback function is called when the engine service user gets the private data from Stt engine. - /// Out Parameters: - /// a = Key -- The key field of private data - /// b = data -- The data field of private data - /// Following Error Codes can be returned - /// 1. None - /// 2. InvalidParameter - /// 3. OperationFailed - /// - /// Thrown in case of Invalid Parameter - /// Thrown in case of Permission denied - /// Thrown in case of Not supported - /// thrown in case of Operation failure - /// - /// Main function should be invoked before this function is called. - /// - public void SetPrivateDataRequestedDelegate(OutAction callback) - { - _privateDataRequestedCallback = callback; - _privateDataRequestedCb = (string key, out string data) => - { - return _privateDataRequestedCallback.Invoke(key, out data); - }; - Error error = STTESetPrivateDataRequestedCb(_privateDataRequestedCb); - if (error != Error.None) - { - Log.Error(LogTag, "SetPrivateDataRequestedDelegate Failed with error " + error); - throw ExceptionFactory.CreateException((ErrorCode)error); - } - - } - - private StartCb _startCb = (IntPtr language, IntPtr type, IntPtr appid, IntPtr credential, IntPtr userData) => - { - string lan = null; - string typ = null; - string apid = null; - string cre = null; - if (language != null) - lan = Marshal.PtrToStringAnsi(language); - if (type != null) - typ = Marshal.PtrToStringAnsi(type); - if (appid != null) - apid = Marshal.PtrToStringAnsi(appid); - if (credential != null) - cre = Marshal.PtrToStringAnsi(credential); - return _engine.Start(lan, typ, apid, cre, IntPtr.Zero); - }; - - private IsValidLanguageCb _isValidLanguageCb = (IntPtr langauge, IntPtr isValid) => - { - string langaugeStr = Marshal.PtrToStringAnsi(langauge); - bool valid; - Error err = _engine.IsValidLanguage(langaugeStr, out valid); - if (valid == true) - { - Marshal.WriteByte(isValid, 0, 1); - } - else - { - Marshal.WriteByte(isValid, 0, 0); - } - return err; - }; - - private GetInfoCb _getInfoCb = (out IntPtr engineUuid, out IntPtr engineName, out IntPtr engineSetting, out IntPtr useNetwork) => - { - string uuid; - string name; - string setting; - bool network; - Error err = _engine.GetInformation(out uuid, out name, out setting, out network); - int size = Marshal.SizeOf(); - IntPtr pBool = Marshal.AllocHGlobal(size); - if (network == true) - { - Marshal.WriteInt32(pBool, 0, 1); - } - else - { - Marshal.WriteInt32(pBool, 0, 0); - } - engineUuid = Marshal.StringToHGlobalAnsi(uuid); - engineName = Marshal.StringToHGlobalAnsi(name); - engineSetting = Marshal.StringToHGlobalAnsi(setting); - useNetwork = pBool; - return err; - }; - - private DeinitializeCb _deinitializeCb = () => - { - Marshal.FreeHGlobal(_engine._structIntPtrHandle); - return _engine.Deinitialize(); - }; - } -} \ No newline at end of file diff --git a/src/Tizen.Uix.Tts/Interop/Interop.Libraries.cs b/src/Tizen.Uix.Tts/Interop/Interop.Libraries.cs deleted file mode 100755 index 2161d63ca..000000000 --- a/src/Tizen.Uix.Tts/Interop/Interop.Libraries.cs +++ /dev/null @@ -1,29 +0,0 @@ -/* -* 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. -*/ - -/// -/// Partial interop class. -/// -internal static partial class Interop -{ - /// - /// Partial libraries class. - /// - internal static partial class Libraries - { - public const string Tts = "libtts.so"; - } -} diff --git a/src/Tizen.Uix.Tts/Interop/Interop.Tts.cs b/src/Tizen.Uix.Tts/Interop/Interop.Tts.cs deleted file mode 100755 index 32b49babd..000000000 --- a/src/Tizen.Uix.Tts/Interop/Interop.Tts.cs +++ /dev/null @@ -1,172 +0,0 @@ -/* -* 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; -using Tizen.Uix.Tts; - -/// -/// Partial interop class. -/// -internal static partial class Interop -{ - /// - /// Tts interop class. - /// - internal static class Tts - { - internal static string LogTag = "Tizen.Uix.Tts"; - - private const int ErrorTts = -0x02F10000; - - internal enum TtsError - { - None = Tizen.Internals.Errors.ErrorCode.None, /**< Successful */ - OutOfMemory = Tizen.Internals.Errors.ErrorCode.OutOfMemory, /**< Out of Memory */ - IoError = Tizen.Internals.Errors.ErrorCode.IoError, /**< I/O error */ - InvalidParameter = Tizen.Internals.Errors.ErrorCode.InvalidParameter, /**< Invalid parameter */ - OutOfNetwork = Tizen.Internals.Errors.ErrorCode.Networkdown, /**< Network is down */ - TimedOut = Tizen.Internals.Errors.ErrorCode.TimedOut, /**< No answer from the STT service */ - PermissionDenied = Tizen.Internals.Errors.ErrorCode.PermissionDenied, /**< Permission denied */ - NotSupported = Tizen.Internals.Errors.ErrorCode.NotSupported, /**< STT NOT supported */ - InvalidState = ErrorTts | 0x01, /**< Invalid state */ - InvalidVoice = ErrorTts | 0x02, /**< Invalid language */ - EngineNotFound = ErrorTts | 0x03, /**< No available engine */ - OperationFailed = ErrorTts | 0x04, /**< Operation failed */ - AudioPolicyBlocked = ErrorTts | 0x05, /**< Audio policy blocked */ - NotSupportedFeature = ErrorTts | 0x06, /**< Not supported feature of current engine*/ - ServiceReset = ErrorTts | 0x07 /**< Service reset*/ - }; - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void TtsStateChangedCB(IntPtr handle, State previous, State current, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void TtsUtteranceStartedCB(IntPtr handle, int uttId, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void TtsUtteranceCompletedCB(IntPtr handle, int uttId, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void TtsErrorCB(IntPtr handle, int uttId, TtsError reason, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool TtsSupportedVoiceCB(IntPtr handle, IntPtr language, int voiceType, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void TtsDefaultVoiceChangedCB(IntPtr handle, IntPtr previous_language, int previous_voice_type, IntPtr current_language, int current_voice_type, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void TtsEngineChangedCB(IntPtr handle, IntPtr engine_id, IntPtr language, int voice_type, bool need_credential, IntPtr userData); - - [DllImport(Libraries.Tts, EntryPoint = "tts_create", CallingConvention = CallingConvention.Cdecl)] - internal static extern TtsError TtsCreate(out IntPtr handle); - - [DllImport(Libraries.Tts, EntryPoint = "tts_destroy", CallingConvention = CallingConvention.Cdecl)] - internal static extern TtsError TtsDestroy(IntPtr handle); - - [DllImport(Libraries.Tts, EntryPoint = "tts_set_mode", CallingConvention = CallingConvention.Cdecl)] - internal static extern TtsError TtsSetMode(IntPtr handle, Mode m); - - [DllImport(Libraries.Tts, EntryPoint = "tts_get_mode", CallingConvention = CallingConvention.Cdecl)] - internal static extern TtsError TtsGetMode(IntPtr handle, out Mode m); - - [DllImport(Libraries.Tts, EntryPoint = "tts_set_credential", CallingConvention = CallingConvention.Cdecl)] - internal static extern TtsError TtsSetCredential(IntPtr handle, string credential); - - [DllImport(Libraries.Tts, EntryPoint = "tts_prepare", CallingConvention = CallingConvention.Cdecl)] - internal static extern TtsError TtsPrepare(IntPtr handle); - - [DllImport(Libraries.Tts, EntryPoint = "tts_unprepare", CallingConvention = CallingConvention.Cdecl)] - internal static extern TtsError TtsUnprepare(IntPtr handle); - - [DllImport(Libraries.Tts, EntryPoint = "tts_foreach_supported_voices", CallingConvention = CallingConvention.Cdecl)] - internal static extern TtsError TtsForeachSupportedVoices(IntPtr handle, TtsSupportedVoiceCB callback, IntPtr userData); - - [DllImport(Libraries.Tts, EntryPoint = "tts_get_default_voice", CallingConvention = CallingConvention.Cdecl)] - internal static extern TtsError TtsGetDefaultVoice(IntPtr handle, out string language, out int voice_type); - - [DllImport(Libraries.Tts, EntryPoint = "tts_set_private_data", CallingConvention = CallingConvention.Cdecl)] - internal static extern TtsError TtsSetPrivateData(IntPtr handle, string key, string data); - - [DllImport(Libraries.Tts, EntryPoint = "tts_get_private_data", CallingConvention = CallingConvention.Cdecl)] - internal static extern TtsError TtsGetPrivateData(IntPtr handle, string key, out string data); - - [DllImport(Libraries.Tts, EntryPoint = "tts_get_max_text_size", CallingConvention = CallingConvention.Cdecl)] - internal static extern TtsError TtsGetMaxTextSize(IntPtr handle, out uint size); - - [DllImport(Libraries.Tts, EntryPoint = "tts_get_state", CallingConvention = CallingConvention.Cdecl)] - internal static extern TtsError TtsGetState(IntPtr handle, out State state); - - [DllImport(Libraries.Tts, EntryPoint = "tts_get_speed_range", CallingConvention = CallingConvention.Cdecl)] - internal static extern TtsError TtsGetSpeedRange(IntPtr handle, out int min, out int normal, out int max); - - [DllImport(Libraries.Tts, EntryPoint = "tts_get_error_message", CallingConvention = CallingConvention.Cdecl)] - internal static extern TtsError TtsGetErrorMessage(IntPtr handle, out string err_msg); - - [DllImport(Libraries.Tts, EntryPoint = "tts_is_recognition_type_supported", CallingConvention = CallingConvention.Cdecl)] - internal static extern TtsError TtsIsRecognitionTypeSupported(IntPtr handle, string type, out bool support); - - [DllImport(Libraries.Tts, EntryPoint = "tts_add_text", CallingConvention = CallingConvention.Cdecl)] - internal static extern TtsError TtsAddText(IntPtr handle, string text, string language, int voice_type, int speed, out int uttId); - - [DllImport(Libraries.Tts, EntryPoint = "tts_play", CallingConvention = CallingConvention.Cdecl)] - internal static extern TtsError TtsPlay(IntPtr handle); - - [DllImport(Libraries.Tts, EntryPoint = "tts_stop", CallingConvention = CallingConvention.Cdecl)] - internal static extern TtsError TtsStop(IntPtr handle); - - [DllImport(Libraries.Tts, EntryPoint = "tts_pause", CallingConvention = CallingConvention.Cdecl)] - internal static extern TtsError TtsPause(IntPtr handle); - - [DllImport(Libraries.Tts, EntryPoint = "tts_set_state_changed_cb", CallingConvention = CallingConvention.Cdecl)] - internal static extern TtsError TtsSetStateChangedCB(IntPtr handle, TtsStateChangedCB callback, IntPtr userData); - - [DllImport(Libraries.Tts, EntryPoint = "tts_unset_state_changed_cb", CallingConvention = CallingConvention.Cdecl)] - internal static extern TtsError TtsUnsetStateChangedCB(IntPtr handle); - - [DllImport(Libraries.Tts, EntryPoint = "tts_set_utterance_started_cb", CallingConvention = CallingConvention.Cdecl)] - internal static extern TtsError TtsSetUtteranceStartedCB(IntPtr handle, TtsUtteranceStartedCB callback, IntPtr userData); - - [DllImport(Libraries.Tts, EntryPoint = "tts_unset_utterance_started_cb", CallingConvention = CallingConvention.Cdecl)] - internal static extern TtsError TtsUnsetUtteranceStartedCB(IntPtr handle); - - [DllImport(Libraries.Tts, EntryPoint = "tts_set_utterance_completed_cb", CallingConvention = CallingConvention.Cdecl)] - internal static extern TtsError TtsSetUtteranceCompletedCB(IntPtr handle, TtsUtteranceCompletedCB callback, IntPtr userData); - - [DllImport(Libraries.Tts, EntryPoint = "tts_unset_utterance_completed_cb", CallingConvention = CallingConvention.Cdecl)] - internal static extern TtsError TtsUnsetUtteranceCompletedCB(IntPtr handle); - - [DllImport(Libraries.Tts, EntryPoint = "tts_set_error_cb", CallingConvention = CallingConvention.Cdecl)] - internal static extern TtsError TtsSetErrorCB(IntPtr handle, TtsErrorCB callback, IntPtr userData); - - [DllImport(Libraries.Tts, EntryPoint = "tts_unset_error_cb", CallingConvention = CallingConvention.Cdecl)] - internal static extern TtsError TtsUnsetErrorCB(IntPtr handle); - - [DllImport(Libraries.Tts, EntryPoint = "tts_set_default_voice_changed_cb", CallingConvention = CallingConvention.Cdecl)] - internal static extern TtsError TtsSetDefaultVoiceChangedCB(IntPtr handle, TtsDefaultVoiceChangedCB callback, IntPtr userData); - - [DllImport(Libraries.Tts, EntryPoint = "tts_unset_default_voice_changed_cb", CallingConvention = CallingConvention.Cdecl)] - internal static extern TtsError TtsUnsetDefaultVoiceChangedCB(IntPtr handle); - - [DllImport(Libraries.Tts, EntryPoint = "tts_set_engine_changed_cb", CallingConvention = CallingConvention.Cdecl)] - internal static extern TtsError TtsSetEngineChangedCB(IntPtr handle, TtsEngineChangedCB callback, IntPtr userData); - - [DllImport(Libraries.Tts, EntryPoint = "tts_unset_engine_changed_cb", CallingConvention = CallingConvention.Cdecl)] - internal static extern TtsError TtsUnsetEngineChangedCB(IntPtr handle); - } -} diff --git a/src/Tizen.Uix.Tts/Tizen.Uix.Tts.csproj b/src/Tizen.Uix.Tts/Tizen.Uix.Tts.csproj deleted file mode 100644 index 4c51c4197..000000000 --- a/src/Tizen.Uix.Tts/Tizen.Uix.Tts.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - netstandard2.0 - - - - - - - - \ No newline at end of file diff --git a/src/Tizen.Uix.Tts/Tizen.Uix.Tts.sln b/src/Tizen.Uix.Tts/Tizen.Uix.Tts.sln deleted file mode 100755 index 35fdcdd9b..000000000 --- a/src/Tizen.Uix.Tts/Tizen.Uix.Tts.sln +++ /dev/null @@ -1,34 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26430.12 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Uix.Tts", "Tizen.Uix.Tts.csproj", "{D82A5965-D75B-4E58-B569-115B08241957}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen", "..\Tizen\Tizen.csproj", "{FB391E59-A54B-40A5-BD1F-9A06FA8E3A76}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Log", "..\Tizen.Log\Tizen.Log.csproj", "{B2D8270C-90AA-4E16-9A3E-D6988789A93C}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {D82A5965-D75B-4E58-B569-115B08241957}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D82A5965-D75B-4E58-B569-115B08241957}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D82A5965-D75B-4E58-B569-115B08241957}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D82A5965-D75B-4E58-B569-115B08241957}.Release|Any CPU.Build.0 = Release|Any CPU - {FB391E59-A54B-40A5-BD1F-9A06FA8E3A76}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {FB391E59-A54B-40A5-BD1F-9A06FA8E3A76}.Debug|Any CPU.Build.0 = Debug|Any CPU - {FB391E59-A54B-40A5-BD1F-9A06FA8E3A76}.Release|Any CPU.ActiveCfg = Release|Any CPU - {FB391E59-A54B-40A5-BD1F-9A06FA8E3A76}.Release|Any CPU.Build.0 = Release|Any CPU - {B2D8270C-90AA-4E16-9A3E-D6988789A93C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B2D8270C-90AA-4E16-9A3E-D6988789A93C}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B2D8270C-90AA-4E16-9A3E-D6988789A93C}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B2D8270C-90AA-4E16-9A3E-D6988789A93C}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/src/Tizen.Uix.Tts/Tizen.Uix.Tts/DefaultVoiceChangedEventArgs.cs b/src/Tizen.Uix.Tts/Tizen.Uix.Tts/DefaultVoiceChangedEventArgs.cs deleted file mode 100755 index 1cfd40c38..000000000 --- a/src/Tizen.Uix.Tts/Tizen.Uix.Tts/DefaultVoiceChangedEventArgs.cs +++ /dev/null @@ -1,52 +0,0 @@ -/* -* 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. -*/ - - -namespace Tizen.Uix.Tts -{ - /// - /// This class holds information related to the DefaultVoiceChanged event. - /// - /// 3 - public class DefaultVoiceChangedEventArgs - { - internal DefaultVoiceChangedEventArgs(string previousLanguage, int previousVoiceType, string currentLanguage, int currentVoiceType) - { - this.Previous = new SupportedVoice(previousLanguage, previousVoiceType); - this.Current = new SupportedVoice(currentLanguage, currentVoiceType); - } - - /// - /// The previous SupportedVoice. - /// - /// 3 - public SupportedVoice Previous - { - get; - internal set; - } - - /// - /// The current SupportedVoice. - /// - /// 3 - public SupportedVoice Current - { - get; - internal set; - } - } -} diff --git a/src/Tizen.Uix.Tts/Tizen.Uix.Tts/EngineChangedEventArgs.cs b/src/Tizen.Uix.Tts/Tizen.Uix.Tts/EngineChangedEventArgs.cs deleted file mode 100755 index 5a3c00a17..000000000 --- a/src/Tizen.Uix.Tts/Tizen.Uix.Tts/EngineChangedEventArgs.cs +++ /dev/null @@ -1,65 +0,0 @@ -/* -* 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 static Tizen.Uix.Tts.SupportedVoice; - -namespace Tizen.Uix.Tts -{ - /// - /// This class holds information related to the EngineChanged event. - /// - /// 3 - public class EngineChangedEventArgs - { - internal EngineChangedEventArgs(string engineId, string language, int voiceType, bool needCredential) - { - this.EngineId = engineId; - this.VoiceType = new SupportedVoice(language, voiceType); - this.NeedCredential = needCredential; - } - - /// - /// The engine ID. - /// - /// 3 - public string EngineId - { - get; - internal set; - } - - /// - /// The necessity of the credential. - /// - /// 3 - public bool NeedCredential - { - get; - internal set; - } - - /// - /// The supported voice. - /// - /// 3 - public SupportedVoice VoiceType - { - get; - internal set; - } - } -} diff --git a/src/Tizen.Uix.Tts/Tizen.Uix.Tts/ErrorOccurredEventArgs.cs b/src/Tizen.Uix.Tts/Tizen.Uix.Tts/ErrorOccurredEventArgs.cs deleted file mode 100755 index 0a184db6f..000000000 --- a/src/Tizen.Uix.Tts/Tizen.Uix.Tts/ErrorOccurredEventArgs.cs +++ /dev/null @@ -1,161 +0,0 @@ -/* -* 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 static Interop.Tts; - -namespace Tizen.Uix.Tts -{ - /// - /// This class holds information related to the TTS ErrorOccurred event. - /// - /// 3 - public class ErrorOccurredEventArgs - { - private IntPtr _handle; - - internal ErrorOccurredEventArgs(IntPtr handle, int utteranceId, Interop.Tts.TtsError error) - { - this._handle = handle; - this.UtteranceId = utteranceId; - switch (error) - { - case Interop.Tts.TtsError.None: - { - ErrorValue = Error.None; - break; - } - - case Interop.Tts.TtsError.OutOfMemory: - { - ErrorValue = Error.OutOfMemory; - break; - } - - case Interop.Tts.TtsError.IoError: - { - ErrorValue = Error.IoError; - break; - } - - case Interop.Tts.TtsError.InvalidParameter: - { - ErrorValue = Error.InvalidParameter; - break; - } - - case Interop.Tts.TtsError.TimedOut: - { - ErrorValue = Error.TimedOut; - break; - } - - case Interop.Tts.TtsError.OutOfNetwork: - { - ErrorValue = Error.OutOfNetwork; - break; - } - - case Interop.Tts.TtsError.PermissionDenied: - { - ErrorValue = Error.PermissionDenied; - break; - } - - case Interop.Tts.TtsError.NotSupported: - { - ErrorValue = Error.NotSupported; - break; - } - - case Interop.Tts.TtsError.InvalidState: - { - ErrorValue = Error.InvalidState; - break; - } - - case Interop.Tts.TtsError.InvalidVoice: - { - ErrorValue = Error.InvalidVoice; - break; - } - - case Interop.Tts.TtsError.EngineNotFound: - { - ErrorValue = Error.EngineNotFound; - break; - } - - case Interop.Tts.TtsError.OperationFailed: - { - ErrorValue = Error.OperationFailed; - break; - } - - case Interop.Tts.TtsError.AudioPolicyBlocked: - { - ErrorValue = Error.AudioPolicyBlocked; - break; - } - } - } - - /// - /// The utterance ID. - /// - /// 3 - public int UtteranceId - { - get; - internal set; - } - - /// - /// The error value. - /// - /// 3 - public Error ErrorValue - { - get; - internal set; - } - - /// - /// Gets the current error message. - /// - /// 3 - /// - /// String error message. - /// - public string ErrorMessage - { - get - { - string errorMesage = ""; - TtsError error = TtsGetErrorMessage(_handle, out errorMesage); - if (error != TtsError.None) - { - Log.Error(LogTag, "GetErrorMessage Failed with error " + error); - return ""; - } - - return errorMesage; - } - - } - } -} diff --git a/src/Tizen.Uix.Tts/Tizen.Uix.Tts/ExceptionFactory.cs b/src/Tizen.Uix.Tts/Tizen.Uix.Tts/ExceptionFactory.cs deleted file mode 100755 index a471f7df0..000000000 --- a/src/Tizen.Uix.Tts/Tizen.Uix.Tts/ExceptionFactory.cs +++ /dev/null @@ -1,127 +0,0 @@ -/* -* 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 static Interop.Tts; - -namespace Tizen.Uix.Tts -{ - internal static class ExceptionFactory - { - internal static Exception CreateException(TtsError err) - { - Tizen.Log.Error(LogTag, "Error " + err); - Exception exp; - switch (err) - { - case TtsError.OutOfMemory: - { - exp = new OutOfMemoryException("Out Of Memory"); - break; - } - - case TtsError.IoError: - { - exp = new InvalidOperationException("I/O Error Occurred"); - break; - } - - case TtsError.InvalidParameter: - { - exp = new ArgumentException("Invalid Parameters Provided"); - break; - } - - case TtsError.TimedOut: - { - exp = new TimeoutException("No answer from the TTS service"); - break; - } - - case TtsError.OutOfNetwork: - { - exp = new InvalidOperationException("Network is down"); - break; - } - - case TtsError.PermissionDenied: - { - exp = new UnauthorizedAccessException("Permission Denied"); - break; - } - - case TtsError.NotSupported: - { - exp = new NotSupportedException("TTS NOT supported"); - break; - } - - case TtsError.InvalidState: - { - exp = new InvalidOperationException("Invalid state"); - break; - } - - case TtsError.InvalidVoice: - { - exp = new InvalidOperationException("Invalid Voice"); - break; - } - - case TtsError.EngineNotFound: - { - exp = new InvalidOperationException("No available engine"); - break; - } - - case TtsError.OperationFailed: - { - exp = new InvalidOperationException("Operation Failed"); - break; - } - - case TtsError.AudioPolicyBlocked: - { - exp = new InvalidOperationException("AudioPolicyBlocked"); - break; - } - - case TtsError.NotSupportedFeature: - { - exp = new InvalidOperationException("Feature NotSupported"); - break; - } - - case TtsError.ServiceReset: - { - exp = new InvalidOperationException("Service Reset"); - break; - } - - default: - { - exp = new Exception(""); - break; - } - - } - - return exp; - - } - } -} diff --git a/src/Tizen.Uix.Tts/Tizen.Uix.Tts/SpeedRange.cs b/src/Tizen.Uix.Tts/Tizen.Uix.Tts/SpeedRange.cs deleted file mode 100755 index 2ed55c320..000000000 --- a/src/Tizen.Uix.Tts/Tizen.Uix.Tts/SpeedRange.cs +++ /dev/null @@ -1,63 +0,0 @@ -/* -* 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. -*/ - - -namespace Tizen.Uix.Tts -{ - /// - /// This class holds the speed range values. - /// - /// 3 - public class SpeedRange - { - internal SpeedRange(int min, int normal, int max) - { - this.Min = min; - this.Normal = normal; - this.Max = max; - } - - /// - /// The max speed range value. - /// - /// 3 - public int Max - { - get; - internal set; - } - - /// - /// The min speed range value. - /// - /// 3 - public int Min - { - get; - internal set; - } - - /// - /// The normal speed range value. - /// - /// 3 - public int Normal - { - get; - internal set; - } - } -} diff --git a/src/Tizen.Uix.Tts/Tizen.Uix.Tts/StateChangedEventArgs.cs b/src/Tizen.Uix.Tts/Tizen.Uix.Tts/StateChangedEventArgs.cs deleted file mode 100755 index 8339eb59f..000000000 --- a/src/Tizen.Uix.Tts/Tizen.Uix.Tts/StateChangedEventArgs.cs +++ /dev/null @@ -1,52 +0,0 @@ -/* -* 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. -*/ - - -namespace Tizen.Uix.Tts -{ - /// - /// This class holds information related to the TTS StateChanged event. - /// - /// 3 - public class StateChangedEventArgs - { - internal StateChangedEventArgs(State previous, State current) - { - Previous = previous; - Current = current; - } - - /// - /// The previous state. - /// - /// 3 - public State Previous - { - get; - internal set; - } - - /// - /// The current state. - /// - /// 3 - public State Current - { - get; - internal set; - } - } -} diff --git a/src/Tizen.Uix.Tts/Tizen.Uix.Tts/SupportedVoice.cs b/src/Tizen.Uix.Tts/Tizen.Uix.Tts/SupportedVoice.cs deleted file mode 100755 index e99108b21..000000000 --- a/src/Tizen.Uix.Tts/Tizen.Uix.Tts/SupportedVoice.cs +++ /dev/null @@ -1,72 +0,0 @@ -/* -* 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. -*/ - - -namespace Tizen.Uix.Tts -{ - /// - /// This class holds information about the supported voices. - /// - /// 3 - public class SupportedVoice - { - internal SupportedVoice(string lang, int voiceType) - { - this.Language = lang; - if (voiceType == 0) - { - this.VoiceType = Voice.Auto; - } - - else if (voiceType == 1) - { - this.VoiceType = Voice.Male; - } - - else if (voiceType == 2) - { - this.VoiceType = Voice.Female; - } - - else if (voiceType == 3) - { - this.VoiceType = Voice.Child; - } - } - - internal SupportedVoice() - { - this.Language = ""; - this.VoiceType = Voice.Auto; - } - - /// - /// Language specified as an ISO 3166 alpha-2 two letter country-code followed by ISO 639-1 for the two-letter language code (for example, "ko_KR" for Korean, "en_US" for American English). - /// - /// 3 - public string Language - { - get; - internal set; - } - - public Voice VoiceType - { - get; - internal set; - } - } -} diff --git a/src/Tizen.Uix.Tts/Tizen.Uix.Tts/TtsClient.cs b/src/Tizen.Uix.Tts/Tizen.Uix.Tts/TtsClient.cs deleted file mode 100755 index f8af3a1ad..000000000 --- a/src/Tizen.Uix.Tts/Tizen.Uix.Tts/TtsClient.cs +++ /dev/null @@ -1,1069 +0,0 @@ -/* -* 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.Collections.Generic; -using System.Runtime.InteropServices; -using static Interop.Tts; - -namespace Tizen.Uix.Tts -{ - /// - /// Enumeration for the states. - /// - /// 3 - public enum State - { - /// - /// Created state. - /// - /// 3 - Created = 0, - - /// - /// Ready state. - /// - /// 3 - Ready = 1, - - /// - /// Playing state. - /// - /// 3 - Playing = 2, - - /// - /// Paused state. - /// - /// 3 - Paused = 3, - - /// - /// Unavailable state. - /// - /// 3 - Unavailable - }; - - /// - /// Enumeration for TTS mode. - /// - /// 3 - public enum Mode - { - /// - /// Default mode for normal application. - /// - /// 3 - Default = 0, - - /// - /// Notification mode. - /// - /// 3 - Notification = 1, - - /// - /// Accessibility mode. - /// - /// 3 - ScreenReader = 2 - }; - - /// - /// Enumeration for error values that can occur. - /// - /// 3 - public enum Error - { - /// - /// Successful, no error. - /// - /// 3 - None, - /// - /// Out of memory. - /// - /// 3 - OutOfMemory, - /// - /// I/O error. - /// - /// 3 - IoError, - /// - /// Invalid parameter. - /// - /// 3 - InvalidParameter, - /// - /// No answer from the STT service. - /// - /// 3 - TimedOut, - /// - /// Network is down. - /// - /// 3 - OutOfNetwork, - /// - /// Permission denied. - /// - /// 3 - PermissionDenied, - /// - /// STT not supported. - /// - /// 3 - NotSupported, - /// - /// Invalid state. - /// - /// 3 - InvalidState, - /// - /// Invalid voice. - /// - /// 3 - InvalidVoice, - /// - /// No available engine. - /// - /// 3 - EngineNotFound, - /// - /// Operation failed. - /// - /// 3 - OperationFailed, - /// - /// Audio policy blocked. - /// - /// 3 - AudioPolicyBlocked - }; - - /// - /// Enumeration for the voice types. - /// - /// 3 - public enum Voice - { - /// - /// The automatic voice type. - /// - /// 3 - Auto, - - /// - /// The male voice type. - /// - /// 3 - Male, - - /// - /// The female voice type. - /// - /// 3 - Female, - - /// - /// The child voice type. - /// - /// 3 - Child - }; - - /// - /// You can use Text-To-Speech (TTS) API's to read sound data transformed by the engine from input texts. - /// Applications can add input-text to queue for reading continuously and control the player that can play, pause, and stop sound data synthesized from text. - /// - /// 3 - public class TtsClient : IDisposable - { - private IntPtr _handle; - private event EventHandler _stateChanged; - private event EventHandler _utteranceStarted; - private event EventHandler _utteranceCompleted; - private event EventHandler _errorOccurred; - private event EventHandler _defaultVoiceChanged; - private event EventHandler _engineChanged; - private bool disposedValue = false; - private Object thisLock = new Object(); - private TtsStateChangedCB _stateDelegate; - private TtsUtteranceStartedCB _utteranceStartedResultDelegate; - private TtsUtteranceCompletedCB _utteranceCompletedResultDelegate; - private TtsErrorCB _errorDelegate; - private TtsDefaultVoiceChangedCB _voiceChangedDelegate; - private TtsEngineChangedCB _engineDelegate; - private TtsSupportedVoiceCB _supportedvoiceDelegate; - - /// - /// Constructor to create a TTS instance. - /// - /// 3 - /// - /// http://tizen.org/feature/speech.synthesis - /// - /// - /// This exception can be due to the following reasons: - /// 1. Operation Failed - /// 2. Engine Not Found - /// - /// This exception can be due to out Of memory. - /// This exception can be due to TTS not supported. - public TtsClient() - { - IntPtr handle; - TtsError error = TtsCreate(out handle); - if (error != TtsError.None) - { - Log.Error(LogTag, "Create Failed with error " + error); - throw ExceptionFactory.CreateException(error); - } - - _handle = handle; - } - - /// - /// Event to be invoked when TTS state changes. - /// - /// 3 - public event EventHandler StateChanged - { - add - { - lock (thisLock) - { - _stateDelegate = (IntPtr handle, State previous, State current, IntPtr userData) => - { - StateChangedEventArgs args = new StateChangedEventArgs(previous, current); - _stateChanged?.Invoke(this, args); - }; - TtsError error = TtsSetStateChangedCB(_handle, _stateDelegate, IntPtr.Zero); - if (error != TtsError.None) - { - Log.Error(LogTag, "Add StateChanged Failed with error " + error); - } - else - { - _stateChanged += value; - } - } - - } - - remove - { - lock (thisLock) - { - TtsError error = TtsUnsetStateChangedCB(_handle); - if (error != TtsError.None) - { - Log.Error(LogTag, "Remove StateChanged Failed with error " + error); - } - - _stateChanged -= value; - } - } - - } - - /// - /// Event to be invoked when the utterance starts. - /// - /// 3 - public event EventHandler UtteranceStarted - { - add - { - lock (thisLock) - { - _utteranceStartedResultDelegate = (IntPtr handle, int uttId, IntPtr userData) => - { - UtteranceEventArgs args = new UtteranceEventArgs(uttId); - _utteranceStarted?.Invoke(this, args); - }; - TtsError error = TtsSetUtteranceStartedCB(_handle, _utteranceStartedResultDelegate, IntPtr.Zero); - if (error != TtsError.None) - { - Log.Error(LogTag, "Add UtteranceStarted Failed with error " + error); - } - else - { - _utteranceStarted += value; - } - } - } - - remove - { - lock (thisLock) - { - TtsError error = TtsUnsetUtteranceStartedCB(_handle); - if (error != TtsError.None) - { - Log.Error(LogTag, "Remove UtteranceStarted Failed with error " + error); - } - - _utteranceStarted -= value; - } - } - } - - /// - /// Event to be invoked when the utterance completes. - /// - /// 3 - public event EventHandler UtteranceCompleted - { - add - { - lock (thisLock) - { - _utteranceCompletedResultDelegate = (IntPtr handle, int uttId, IntPtr userData) => - { - UtteranceEventArgs args = new UtteranceEventArgs(uttId); - _utteranceCompleted?.Invoke(this, args); - }; - TtsError error = TtsSetUtteranceCompletedCB(_handle, _utteranceCompletedResultDelegate, IntPtr.Zero); - if (error != TtsError.None) - { - Log.Error(LogTag, "Add UtteranceCompleted Failed with error " + error); - } - else - { - _utteranceCompleted += value; - } - } - } - - remove - { - lock (thisLock) - { - TtsError error = TtsUnsetUtteranceCompletedCB(_handle); - if (error != TtsError.None) - { - Log.Error(LogTag, "Remove UtteranceCompleted Failed with error " + error); - } - - _utteranceCompleted -= value; - } - } - } - - /// - /// Event to be invoked when an error occurs. - /// - /// 3 - public event EventHandler ErrorOccurred - { - add - { - lock (thisLock) - { - _errorDelegate = (IntPtr handle, int uttId, TtsError reason, IntPtr userData) => - { - ErrorOccurredEventArgs args = new ErrorOccurredEventArgs(handle, uttId, reason); - _errorOccurred?.Invoke(this, args); - }; - TtsError error = TtsSetErrorCB(_handle, _errorDelegate, IntPtr.Zero); - if (error != TtsError.None) - { - Log.Error(LogTag, "Add ErrorOccurred Failed with error " + error); - } - - else - { - _errorOccurred += value; - } - } - } - - remove - { - lock (thisLock) - { - TtsError error = TtsUnsetErrorCB(_handle); - if (error != TtsError.None) - { - Log.Error(LogTag, "Remove ErrorOccurred Failed with error " + error); - } - - _errorOccurred -= value; - } - } - } - - /// - /// Event to be invoked when an error occurs. - /// - /// 3 - public event EventHandler DefaultVoiceChanged - { - add - { - lock (thisLock) - { - _voiceChangedDelegate = (IntPtr handle, IntPtr previousLanguage, int previousVoiceType, IntPtr currentLanguage, int currentVoiceType, IntPtr userData) => - { - string previousLanguageString = Marshal.PtrToStringAnsi(previousLanguage); - string currentLanguageString = Marshal.PtrToStringAnsi(currentLanguage); - DefaultVoiceChangedEventArgs args = new DefaultVoiceChangedEventArgs(previousLanguageString, previousVoiceType, currentLanguageString, currentVoiceType); - _defaultVoiceChanged?.Invoke(this, args); - }; - TtsError error = TtsSetDefaultVoiceChangedCB(_handle, _voiceChangedDelegate, IntPtr.Zero); - if (error != TtsError.None) - { - Log.Error(LogTag, "Add DefaultVoiceChanged Failed with error " + error); - } - - else - { - _defaultVoiceChanged += value; - } - } - - } - - remove - { - lock (thisLock) - { - TtsError error = TtsUnsetDefaultVoiceChangedCB(_handle); - if (error != TtsError.None) - { - Log.Error(LogTag, "Remove DefaultVoiceChanged Failed with error " + error); - } - - _defaultVoiceChanged -= value; - } - } - } - - /// - /// Event to be invoked to detect engine change. - /// - /// 3 - public event EventHandler EngineChanged - { - add - { - lock (thisLock) - { - _engineDelegate = (IntPtr handle, IntPtr engineId, IntPtr language, int voiceType, bool needCredential, IntPtr userData) => - { - string engineIdString = Marshal.PtrToStringAnsi(engineId); - string languageString = Marshal.PtrToStringAnsi(language); - EngineChangedEventArgs args = new EngineChangedEventArgs(engineIdString, languageString, voiceType, needCredential); - _engineChanged?.Invoke(this, args); - }; - TtsError error = TtsSetEngineChangedCB(_handle, _engineDelegate, IntPtr.Zero); - if (error != TtsError.None) - { - Log.Error(LogTag, "Add EngineChanged Failed with error " + error); - } - else - { - _engineChanged += value; - } - } - } - - remove - { - lock (thisLock) - { - TtsError error = TtsUnsetEngineChangedCB(_handle); - if (error != TtsError.None) - { - Log.Error(LogTag, "Remove EngineChanged Failed with error " + error); - } - - _engineChanged -= value; - } - } - } - - /// - /// Gets the default voice set by the user. - /// - /// 3 - /// - /// The default voice in TTS. - /// - /// - /// The default voice SupportedVoice value. - /// - public SupportedVoice DefaultVoice - { - get - { - lock (thisLock) - { - string language; - int voiceType; - TtsError error = TtsGetDefaultVoice(_handle, out language, out voiceType); - if (error != TtsError.None) - { - Log.Error(LogTag, "DefaultVoice Failed with error " + error); - return new SupportedVoice(); - } - - return new SupportedVoice(language, voiceType); - } - } - } - - /// - /// Gets the maximum byte size for text. - /// - /// 3 - /// - /// The Maximum byte size for text. - /// - /// - /// The Default Voice SupportedVoice value, 0 if unable to get the value. - /// - ///
-        /// The State should be ready.
-        /// 
- public uint MaxTextSize - { - get - { - uint maxTextSize; - lock (thisLock) - { - TtsError error = TtsGetMaxTextSize(_handle, out maxTextSize); - if (error != TtsError.None) - { - Log.Error(LogTag, "MaxTextSize Failed with error " + error); - return 0; - } - - } - - return maxTextSize; - } - - } - - /// - /// Gets the current TTS state. - /// - /// 3 - /// - /// The current state of TTS. - /// - /// - /// Current TTS State value. - /// - public State CurrentState - { - get - { - State state; - lock (thisLock) - { - TtsError error = TtsGetState(_handle, out state); - if (error != TtsError.None) - { - Log.Error(LogTag, "CurrentState Failed with error " + error); - return State.Unavailable; - } - - } - - return state; - } - - } - - /// - /// The TTS Mode can be set using this property. - /// - /// 3 - /// - /// The current TTS mode (default, screen-reader, notification). - /// - /// - /// The Mode value. - /// - /// - /// This exception can be due to the following reasons while setting the value: - /// 1. Operation Failed - /// 2. Engine Not Found - /// - /// This exception can be due to out Of memory. - /// This exception can be due to TTS not supported. - ///
-        /// The State should be created.
-        /// 
- public Mode CurrentMode - { - get - { - Mode mode = Mode.Default; - lock (thisLock) - { - TtsError error = TtsGetMode(_handle, out mode); - if (error != TtsError.None) - { - Log.Error(LogTag, "Get Mode Failed with error " + error); - return Mode.Default; - } - } - - return mode; - } - set - { - TtsError error; - lock (thisLock) - { - error = TtsSetMode(_handle, value); - } - - if (error != TtsError.None) - { - Log.Error(LogTag, "Set Mode Failed with error " + error); - throw ExceptionFactory.CreateException(error); - } - } - } - - /// - /// Sets the application credential. - /// - /// 3 - /// . - /// The credential string. - /// - /// - /// http://tizen.org/feature/speech.synthesis - /// - /// This exception can be due to an invalid state. - /// This exception can be due to TTS not supported. - /// This exception can be due to improper value provided while setting the value. - ///
-        /// The State should be created or ready.
-        /// 
- public void SetCredential(string credential) - { - lock (thisLock) - { - TtsError error = TtsSetCredential(_handle, credential); - if (error != TtsError.None) - { - Tizen.Log.Error(LogTag, "SetCredential Failed with error " + error); - throw ExceptionFactory.CreateException(error); - } - } - } - - /// - /// Connects to the TTS service asynchronously. - /// - /// 3 - /// - /// http://tizen.org/feature/speech.synthesis - /// - /// This exception can be due to an invalid state. - /// This exception can be due to TTS not supported. - ///
-        /// The State must be Created.
-        /// 
- /// - /// If this function is successful, the TTS state will be ready. - /// If this function is unsuccessful, ErrorOccurred event will be invoked. - /// - public void Prepare() - { - lock (thisLock) - { - TtsError error = TtsPrepare(_handle); - if (error != TtsError.None) - { - Log.Error(LogTag, "Prepare Failed with error " + error); - throw ExceptionFactory.CreateException(error); - } - } - } - - /// - /// Disconnects from the STT service. - /// - /// 3 - /// - /// http://tizen.org/feature/speech.synthesis - /// - /// This exception can be due to an invalid state. - /// This exception can be due to TTS not supported. - ///
-        /// The state must be ready.
-        /// 
- /// - /// If this function is successful, the TTS state will be created. - /// - public void Unprepare() - { - lock (thisLock) - { - TtsError error = TtsUnprepare(_handle); - if (error != TtsError.None) - { - Log.Error(LogTag, "Unprepare Failed with error " + error); - throw ExceptionFactory.CreateException(error); - } - } - } - - /// - /// Retrieves all supported voices of the current engine. - /// - /// 3 - /// - /// The list of SupportedVoice. - /// - /// - /// http://tizen.org/feature/speech.synthesis - /// - /// - /// This exception can be due to the following reasons: - /// 1. Engine Not Found - /// 2. Operation Failed - /// - /// This exception can be due to TTS not supported. - public IEnumerable GetSupportedVoices() - { - List voicesList = new List(); - lock (thisLock) - { - _supportedvoiceDelegate = (IntPtr handle, IntPtr language, int voiceType, IntPtr userData) => - { - string lang = Marshal.PtrToStringAnsi(language); - SupportedVoice voice = new SupportedVoice(lang, voiceType); - voicesList.Add(voice); - return true; - }; - TtsError error = TtsForeachSupportedVoices(_handle, _supportedvoiceDelegate, IntPtr.Zero); - if (error != TtsError.None) - { - Log.Error(LogTag, "GetSupportedVoices Failed with error " + error); - throw ExceptionFactory.CreateException(error); - } - - } - - return voicesList; - } - - /// - /// Gets the private data from TTS engine. - /// - /// 3 - /// - /// The key string. - /// - /// - /// The data corresponding to the provided key. - /// - /// - /// http://tizen.org/feature/speech.synthesis - /// - /// - /// This exception can be due to the following reasons: - /// 1. Invalid State - /// 2. Engine Not found - /// 3. Operation Failure - /// - /// This exception can be due to TTS not supported. - ///
-        /// The state must be ready.
-        /// 
- public string GetPrivateData(string key) - { - string data; - lock (thisLock) - { - TtsError error = TtsGetPrivateData(_handle, key, out data); - if (error != TtsError.None) - { - Log.Error(LogTag, "GetPrivateData Failed with error " + error); - throw ExceptionFactory.CreateException(error); - } - - } - - return data; - } - - /// - /// Sets the private data to tts engine. - /// - /// 3 - /// - /// The key string. - /// - /// - /// The data string. - /// - /// - /// http://tizen.org/feature/speech.synthesis - /// - /// - /// This exception can be due to the following reasons: - /// 1. Invalid State - /// 2. Engine Not found - /// 3. Operation Failure - /// - /// This exception can be due to TTS not supported. - /// This exception can be due to improper value provided while setting the value. - ///
-        /// The state must be ready.
-        /// 
- public void SetPrivateData(string key, string data) - { - lock (thisLock) - { - TtsError error = TtsSetPrivateData(_handle, key, data); - if (error != TtsError.None) - { - Log.Error(LogTag, "SetPrivateData Failed with error " + error); - throw ExceptionFactory.CreateException(error); - } - } - } - - /// - /// Gets the speed range. - /// - /// 3 - /// - /// The SpeedRange value. - /// - /// - /// http://tizen.org/feature/speech.synthesis - /// - /// - /// This exception can be due to the following reasons: - /// 1. Invalid State - /// 2. Operation Failure - /// - /// This exception can be due to TTS not supported. - ///
-        /// The state must be created.
-        /// 
- public SpeedRange GetSpeedRange() - { - int min = 0, max = 0, normal = 0; - lock (thisLock) - { - TtsError error = TtsGetSpeedRange(_handle, out min, out normal, out max); - if (error != TtsError.None) - { - Log.Error(LogTag, "GetSpeedRange Failed with error " + error); - throw ExceptionFactory.CreateException(error); - } - - } - - return new SpeedRange(min, normal, max); - } - - /// - /// Adds a text to the queue. - /// - /// 3 - /// - /// Locale MUST be set for UTF-8 text validation check. - /// - /// - /// An input text based UTF-8. - /// - /// - /// The language selected from the SupportedVoice.Language Property obtained from GetSupportedVoices()(e.g. 'NULL'(Automatic),'en_US'). - /// - /// - /// The voice type selected from the SupportedVoice.VoiceType Property obtained from GetSupportedVoices(). - /// - /// - /// A speaking speed (e.g.0 for Auto or the value from SpeedRange Property). - /// - /// - /// The utterance ID. - /// - /// - /// http://tizen.org/feature/speech.synthesis - /// - /// - /// This exception can be due to the following reasons: - /// 1. Invalid State - /// 2. Operation Failure - /// 3. Invalid Voice - /// - /// This exception can be due to TTS not supported. - /// This exception can be due to permission denied. - /// This exception can be due to improper value provided while setting the value. - ///
-        /// The state must be ready or playing or paused.
-        /// 
- public int AddText(string text, string language, int voiceType, int speed) - { - int id; - lock (thisLock) - { - TtsError error = TtsAddText(_handle, text, language, voiceType, speed, out id); - if (error != TtsError.None) - { - Log.Error(LogTag, "AddText Failed with error " + error); - throw ExceptionFactory.CreateException(error); - } - - } - - return id; - } - - /// - /// Starts synthesizing voice from the text and plays the synthesized audio data. - /// - /// 3 - /// - /// http://tizen.org/feature/speech.synthesis - /// - /// - /// This exception can be due to the following reasons: - /// 1. Invalid State - /// 2. Operation Failure - /// 3. Out of Network - /// - /// This exception can be due to TTS not supported. - /// This exception can be due to permission denied. - ///
-        /// The state must be ready or paused.
-        /// 
- /// - /// If this function succeeds, the TTS state will be playing. - /// - public void Play() - { - lock (thisLock) - { - TtsError error = TtsPlay(_handle); - if (error != TtsError.None) - { - Log.Error(LogTag, "Play Failed with error " + error); - throw ExceptionFactory.CreateException(error); - } - } - } - - /// - /// Stops playing the utterance and clears the queue. - /// - /// 3 - /// - /// http://tizen.org/feature/speech.synthesis - /// - /// - /// This exception can be due to the following reasons: - /// 1. Invalid Stat - /// 2. Operation Failure - /// - /// This exception can be due to TTS not supported. - ///
-        /// The state must be ready or playing or paused.
-        /// 
- /// - /// If this function succeeds, the TTS state will be ready. - /// This function will remove all text added via AddText() and synthesized sound data. - /// - public void Stop() - { - lock (thisLock) - { - TtsError error = TtsStop(_handle); - if (error != TtsError.None) - { - Log.Error(LogTag, "Stop Failed with error " + error); - throw ExceptionFactory.CreateException(error); - } - } - } - - /// - /// Pauses the currently playing utterance. - /// - /// 3 - /// - /// http://tizen.org/feature/speech.synthesis - /// - /// - /// This exception can be due to the following reasons: - /// 1. Invalid State - /// 2. Operation Failure - /// - /// This exception can be due to TTS not supported. - ///
-        /// The state must be playing.
-        /// 
- /// - /// If this function succeeds, the TTS state will be Paused. - /// - public void Pause() - { - lock (thisLock) - { - TtsError error = TtsPause(_handle); - if (error != TtsError.None) - { - Log.Error(LogTag, "Pause Failed with error " + error); - throw ExceptionFactory.CreateException(error); - } - } - } - - /// - /// Method to release resources. - /// - /// 3 - public void Dispose() - { - Dispose(true); - } - - protected virtual void Dispose(bool disposing) - { - if (!disposedValue) - { - if (disposing) - { - TtsError error = TtsDestroy(_handle); - if (error != TtsError.None) - { - Log.Error(LogTag, "Destroy Failed with error " + error); - } - } - - disposedValue = true; - } - } - } -} diff --git a/src/Tizen.Uix.Tts/Tizen.Uix.Tts/UtteranceEventArgs.cs b/src/Tizen.Uix.Tts/Tizen.Uix.Tts/UtteranceEventArgs.cs deleted file mode 100755 index a37c33604..000000000 --- a/src/Tizen.Uix.Tts/Tizen.Uix.Tts/UtteranceEventArgs.cs +++ /dev/null @@ -1,41 +0,0 @@ -/* -* 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. -*/ - - -namespace Tizen.Uix.Tts -{ - /// - /// This class holds information related to UtteranceStared and UtteranceCompleted events. - /// - /// 3 - public class UtteranceEventArgs - { - internal UtteranceEventArgs(int uttId) - { - this.UtteranceId = uttId; - } - - /// - /// The utterance ID. - /// - /// 3 - public int UtteranceId - { - get; - internal set; - } - } -} diff --git a/src/Tizen.Uix.TtsEngine/Interop/Interop.Libraries.cs b/src/Tizen.Uix.TtsEngine/Interop/Interop.Libraries.cs deleted file mode 100755 index 178808e6e..000000000 --- a/src/Tizen.Uix.TtsEngine/Interop/Interop.Libraries.cs +++ /dev/null @@ -1,30 +0,0 @@ -/* -* 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. -*/ - - -/// -/// Partial Interop Class -/// -internal static partial class Interop -{ - /// - /// Partial Libraries Class - /// - internal static partial class Libraries - { - internal const string TtsEngine = "libtts_engine.so"; - } -} diff --git a/src/Tizen.Uix.TtsEngine/Interop/Interop.TtsEngine.cs b/src/Tizen.Uix.TtsEngine/Interop/Interop.TtsEngine.cs deleted file mode 100755 index 0a2a9620f..000000000 --- a/src/Tizen.Uix.TtsEngine/Interop/Interop.TtsEngine.cs +++ /dev/null @@ -1,180 +0,0 @@ -/* -* 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; -using Tizen.Uix.TtsEngine; -using static Tizen.Uix.TtsEngine.Engine; - -/// -/// Partial Interop Class -/// -internal static partial class Interop -{ - /// - /// TtsEngine Interop Class - /// - internal static class TtsEngine - { - internal static string LogTag = "Tizen.Uix.TtsEngine"; - - private const int ErrorTts = -0x02F10000; - - public enum ErrorCode - { - None = Tizen.Internals.Errors.ErrorCode.None, /**< Successful */ - OutOfMemory = Tizen.Internals.Errors.ErrorCode.OutOfMemory, /**< Out of Memory */ - IoError = Tizen.Internals.Errors.ErrorCode.IoError, /**< I/O error */ - InvalidParameter = Tizen.Internals.Errors.ErrorCode.InvalidParameter, /**< Invalid parameter */ - NetworkDown = Tizen.Internals.Errors.ErrorCode.Networkdown, /**< Network down(Out of network) */ - PermissionDenied = Tizen.Internals.Errors.ErrorCode.PermissionDenied, /**< Permission denied */ - InvalidState = ErrorTts | 0x01, /**< Invalid state */ - InvalidVoice = ErrorTts | 0x02, /**< Invalid voice */ - OperationFailed = ErrorTts | 0x04, /**< Operation failed */ - NotSupportedFeature = ErrorTts | 0x06, /**< Not supported feature of current engine */ - NotSupported = Tizen.Internals.Errors.ErrorCode.NotSupported, /**< Device or resource busy */ - }; - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate Error InitializeCb(); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate Error DeinitializeCb(); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate Error ForEachSupportedVoicesCb(SupportedVoice cb, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate Error IsValidVoiceCb(string language, int type, out bool isValid); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate Error SetPitchCb(int pitch); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate Error LoadVoiceCb(string langauge, int type); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate Error UnloadVoiceCb(string language, int type); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate Error CheckAppAgreedCb(string appid, out bool isAgreed); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool NeedAppCredentialCb(); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate Error StartSynthesisCb(IntPtr language, int type, IntPtr text, int speed, IntPtr appid, IntPtr credential, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate Error CancelSynthesisCb(); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate Error GetInfoCb(out IntPtr engineUuid, out IntPtr engineName, out IntPtr engineSetting, out int useNetwork); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate Error PrivateDataSetCb(string key, string data); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate Error PrivateDataRequestedCb(string key, out string data); - - [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)] - internal struct RequestCallbackStruct - { - internal int version; - [MarshalAs(UnmanagedType.FunctionPtr)] - internal GetInfoCb getInfo; - [MarshalAs(UnmanagedType.FunctionPtr)] - internal InitializeCb initialize; - [MarshalAs(UnmanagedType.FunctionPtr)] - internal DeinitializeCb deinitialize; - [MarshalAs(UnmanagedType.FunctionPtr)] - internal ForEachSupportedVoicesCb supportedVoice; - [MarshalAs(UnmanagedType.FunctionPtr)] - internal IsValidVoiceCb validVoice; - [MarshalAs(UnmanagedType.FunctionPtr)] - internal SetPitchCb pitch; - [MarshalAs(UnmanagedType.FunctionPtr)] - internal LoadVoiceCb loadVoice; - [MarshalAs(UnmanagedType.FunctionPtr)] - internal UnloadVoiceCb unloadVoice; - [MarshalAs(UnmanagedType.FunctionPtr)] - internal StartSynthesisCb startSynthesis; - [MarshalAs(UnmanagedType.FunctionPtr)] - internal CancelSynthesisCb cancelSynthesis; - [MarshalAs(UnmanagedType.FunctionPtr)] - internal CheckAppAgreedCb checkAppAgreed; - [MarshalAs(UnmanagedType.FunctionPtr)] - internal NeedAppCredentialCb needAppCredential; - }; - - internal sealed class CallbackStructGCHandle : IDisposable - { - internal RequestCallbackStruct CallbackStruct; - internal GCHandle CallbackStructHandle; - public CallbackStructGCHandle() - { - CallbackStruct = new RequestCallbackStruct(); - CallbackStructHandle = GCHandle.Alloc(CallbackStruct); - } - - #region IDisposable Support - private bool disposedValue = false; - - void Dispose(bool disposing) - { - Tizen.Log.Info(LogTag, "In Dispose"); - if (!disposedValue) - { - if (disposing) - { - Tizen.Log.Info(LogTag, "In Dispose free called"); - CallbackStructHandle.Free(); - } - - disposedValue = true; - } - } - - public void Dispose() - { - Dispose(true); - } - #endregion - } - - [DllImport(Libraries.TtsEngine, EntryPoint = "ttse_main")] - internal static extern Error TTSEMain(int argc, string[] argv, IntPtr callback); - - [DllImport(Libraries.TtsEngine, EntryPoint = "ttse_get_speed_range")] - internal static extern Error TTSEGetSpeedRange(out int min, out int normal, out int max); - - [DllImport(Libraries.TtsEngine, EntryPoint = "ttse_get_pitch_range")] - internal static extern Error TTSEGetPitchRange(out int min, out int normal, out int max); - - [DllImport(Libraries.TtsEngine, EntryPoint = "ttse_send_result")] - internal static extern Error TTSESendResult(ResultEvent resultEvent, IntPtr data, int dataSize, AudioType audioType, int rate, IntPtr userData); - - [DllImport(Libraries.TtsEngine, EntryPoint = "ttse_send_error")] - internal static extern Error TTSESendError(Error error, string msg); - - [DllImport(Libraries.TtsEngine, EntryPoint = "ttse_set_private_data_set_cb")] - internal static extern Error TTSESetPrivateDataSetCb(PrivateDataSetCb callbackFunc); - - [DllImport(Libraries.TtsEngine, EntryPoint = "ttse_set_private_data_requested_cb")] - internal static extern Error TTSESetPrivateDataRequestedCb(PrivateDataRequestedCb callbackFunc); - } -} diff --git a/src/Tizen.Uix.TtsEngine/Tizen.Uix.TtsEngine.csproj b/src/Tizen.Uix.TtsEngine/Tizen.Uix.TtsEngine.csproj deleted file mode 100755 index 4c51c4197..000000000 --- a/src/Tizen.Uix.TtsEngine/Tizen.Uix.TtsEngine.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - netstandard2.0 - - - - - - - - \ No newline at end of file diff --git a/src/Tizen.Uix.TtsEngine/Tizen.Uix.TtsEngine.sln b/src/Tizen.Uix.TtsEngine/Tizen.Uix.TtsEngine.sln deleted file mode 100755 index 6ebf29ec2..000000000 --- a/src/Tizen.Uix.TtsEngine/Tizen.Uix.TtsEngine.sln +++ /dev/null @@ -1,34 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26430.12 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Uix.TtsEngine", "Tizen.Uix.TtsEngine.csproj", "{D3C68E4C-8017-4832-A2ED-C17F81339521}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen", "..\Tizen\Tizen.csproj", "{92801CFC-EC18-4F1B-9702-6B3C4CD5430A}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Log", "..\Tizen.Log\Tizen.Log.csproj", "{FD365530-2EF1-4A2D-974C-D6BB12AE2361}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {D3C68E4C-8017-4832-A2ED-C17F81339521}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {D3C68E4C-8017-4832-A2ED-C17F81339521}.Debug|Any CPU.Build.0 = Debug|Any CPU - {D3C68E4C-8017-4832-A2ED-C17F81339521}.Release|Any CPU.ActiveCfg = Release|Any CPU - {D3C68E4C-8017-4832-A2ED-C17F81339521}.Release|Any CPU.Build.0 = Release|Any CPU - {92801CFC-EC18-4F1B-9702-6B3C4CD5430A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {92801CFC-EC18-4F1B-9702-6B3C4CD5430A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {92801CFC-EC18-4F1B-9702-6B3C4CD5430A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {92801CFC-EC18-4F1B-9702-6B3C4CD5430A}.Release|Any CPU.Build.0 = Release|Any CPU - {FD365530-2EF1-4A2D-974C-D6BB12AE2361}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {FD365530-2EF1-4A2D-974C-D6BB12AE2361}.Debug|Any CPU.Build.0 = Debug|Any CPU - {FD365530-2EF1-4A2D-974C-D6BB12AE2361}.Release|Any CPU.ActiveCfg = Release|Any CPU - {FD365530-2EF1-4A2D-974C-D6BB12AE2361}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/src/Tizen.Uix.TtsEngine/Tizen.Uix.TtsEngine/ExceptionFactory.cs b/src/Tizen.Uix.TtsEngine/Tizen.Uix.TtsEngine/ExceptionFactory.cs deleted file mode 100755 index 07951503e..000000000 --- a/src/Tizen.Uix.TtsEngine/Tizen.Uix.TtsEngine/ExceptionFactory.cs +++ /dev/null @@ -1,101 +0,0 @@ -/* -* 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 static Interop.TtsEngine; - - -namespace Tizen.Uix.TtsEngine -{ - internal static class ExceptionFactory - { - internal static Exception CreateException(ErrorCode err) - { - Tizen.Log.Error(LogTag, "Error " + err); - Exception exp; - switch (err) - { - case ErrorCode.OutOfMemory: - { - exp = new OutOfMemoryException("Out Of Memory"); - break; - } - - case ErrorCode.IoError: - { - exp = new InvalidOperationException("I/O Error Occured"); - break; - } - - case ErrorCode.InvalidParameter: - { - exp = new ArgumentException("Invalid Parameters Provided"); - break; - } - - case ErrorCode.NetworkDown: - { - exp = new InvalidOperationException("Network down(Out of network)"); - break; - } - - case ErrorCode.InvalidState: - { - exp = new InvalidOperationException("Invalid state"); - break; - } - - case ErrorCode.InvalidVoice: - { - exp = new InvalidOperationException("Invalid Voice"); - break; - } - - case ErrorCode.OperationFailed: - { - exp = new InvalidOperationException("Operation Failed"); - break; - } - - case ErrorCode.NotSupportedFeature: - { - exp = new InvalidOperationException("Not supported feature"); - break; - } - - case ErrorCode.NotSupported: - { - exp = new NotSupportedException("Not supported"); - break; - } - - case ErrorCode.PermissionDenied: - { - exp = new UnauthorizedAccessException("Permission Denied"); - break; - } - - default: - { - exp = new Exception(""); - break; - } - } - - return exp; - } - } -} diff --git a/src/Tizen.Uix.TtsEngine/Tizen.Uix.TtsEngine/TtsEngine.cs b/src/Tizen.Uix.TtsEngine/Tizen.Uix.TtsEngine/TtsEngine.cs deleted file mode 100755 index e957b7452..000000000 --- a/src/Tizen.Uix.TtsEngine/Tizen.Uix.TtsEngine/TtsEngine.cs +++ /dev/null @@ -1,650 +0,0 @@ -/* -* 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; -using static Interop.TtsEngine; - -namespace Tizen.Uix.TtsEngine -{ - /// - /// Enumeration for audio type. - /// - public enum AudioType - { - /// - /// Signed 16-bit audio type - /// - RawS16 = 0, - /// - /// Unsigned 8-bit audio type - /// - RawU8, - /// - /// Maximum Value - /// - Max - }; - - /// - /// Enumeration for result. - /// - public enum ResultEvent - { - /// - /// Event when the voice synthesis is failed - /// - Fail = -1, - /// - /// Event when the sound data is first data by callback function - /// - Start = 1, - /// - /// Event when the next sound data exist, not first and not last - /// - Continue = 2, - /// - /// Event when the sound data is last data or sound data is only one result - /// - Finish = 3 - }; - - /// - /// Enumeration for Voice Type - /// - public enum VoiceType - { - /// - /// male voice type. - /// - Male = 1, - /// - /// female voice type. - /// - Female = 2, - /// - /// child's voice type. - /// - Child = 3 - } - - /// - /// Enum for Error values that can occur - /// - public enum Error - { - /// - /// Successful, No error - /// - None = ErrorCode.None, - /// - /// Out of Memory - /// - OutOfMemory = ErrorCode.OutOfMemory, - /// - /// I/O error - /// - IoError = ErrorCode.IoError, - /// - /// Invalid parameter - /// - InvalidParameter = ErrorCode.InvalidParameter, - /// - /// Network down(Out of network) - /// - NetworkDown = ErrorCode.NetworkDown, - /// - /// Invalid state - /// - InvalidState = ErrorCode.InvalidState, - /// - /// Invalid voice - /// - InvalidVoice = ErrorCode.InvalidVoice, - /// - /// Operation failed - /// - OperationFailed = ErrorCode.OperationFailed, - /// - /// Not supported feature of current engine - /// - NotSupportedFeature = ErrorCode.NotSupportedFeature, - /// - /// NOT supported - /// - NotSupported = ErrorCode.NotSupported, - /// - /// Permission denied - /// - PermissionDenied = ErrorCode.PermissionDenied - }; - - /// - /// This Class represents the Tts Engine which has to be inherited to make the engine. - /// - public abstract class Engine - { - private CallbackStructGCHandle _callbackStructGCHandle = new CallbackStructGCHandle(); - private PrivateDataSetCb _privateDataSetCb; - private Action _privateDatacallback; - private PrivateDataRequestedCb _privateDataRequestedCb; - private OutAction _privateDataRequestedCallback; - private static Engine _engine; - private IntPtr _structIntPtrHandle; - - /// - /// An Action with 2 Input Parameter returning a Error - /// - /// Generic Type for Parameter 1 - /// The Input Parameter 1 - /// The Input Parameter 2 - /// Error Value - public delegate Error Action(T a, T b); - - /// - /// An Action with 2 Out Parameter returning a Error - /// - /// Generic Type for Parameter 1 - /// The Input Parameter 1 - /// The Input Parameter 2 - /// Error Value - public delegate Error OutAction(T a, out T b); - - /// - /// Called when TTS engine informs the engine service user about whole supported language and voice type list. - /// This callback function is implemented by the engine service user.Therefore, the engine developer does NOT have to implement this callback function. - /// - /// - /// This callback function is called by ForEachSupportedVoices() to inform the whole supported voice list. userData must be transferred from ForEachSupportedVoices(). - /// - /// The language is specified as an ISO 3166 alpha-2 two-letter country code followed by ISO 639-1 for the two-letter language code. - /// For example, "ko_KR" for Korean, "en_US" for American English - /// The voice type - /// The user data passed from ForEachSupportedVoices() - /// true to continue with the next iteration of the loop false to break out of the loop - /// ForEachSupportedVoices() will invoke this callback function. - public delegate bool SupportedVoice(string language, VoiceType type, IntPtr userData); - - /// - /// Called when the engine service user starts to synthesize a voice, asynchronously. - /// - /// - /// In this callback function, TTS engine must transfer the synthesized result to the engine service user using SendResult(). - /// Also, if TTS engine needs the application's credential, it can set the credential granted to the application. - /// - /// The language is specified as an ISO 3166 alpha-2 two-letter country code followed by ISO 639-1 for the two-letter language code. - /// For example, "ko_KR" for Korean, "en_US" for American English - /// The voice type - /// Texts - /// The speed of speaking - /// The Application ID - /// The credential granted to the application - /// The user data which must be passed to SendResult() function - /// - /// Following Error Codes can be returned - /// 1. None - /// 2. InvalidState - /// 3. InvalidParameter - /// 4. InvalidVoice - /// 5. OperationFailed - /// 6. NetworkDown - /// 7. PermissionDenied - /// - /// This function invokes SendResult() - public abstract Error StartSynthesis(string language, int type, string text, int speed, string appid, string credential, IntPtr userData); - - /// - /// Called when the engine service user requests the basic information of TTS engine. - /// - /// - /// The allocated engineUuid, engineName, and engineSetting will be released internally. - /// In order to upload the engine at Tizen Appstore, both a service app and a ui app are necessary. - /// Therefore, engineSetting must be transferred to the engine service user. - /// - /// UUID of engine - /// Name of engine - /// The engine setting application(ui app)'s app ID - /// The status for using network - /// - /// Following Error Codes can be returned - /// 1. None - /// 2. InvalidState - /// - public abstract Error GetInformation(out string engineUuid, out string engineName, out string engineSetting, out bool useNetwork); - - /// - /// Called when the engine service user initializes TTS engine. - /// - /// - /// Following Error Codes can be returned - /// 1. None - /// 2. InvalidState - /// 3. NotSupportedFeature - /// 4. PermissionDenied - /// - public abstract Error Initialize(); - - /// - /// Called when the engine service user deinitializes TTS engine. - /// - /// - /// NOTE that the engine may be terminated automatically. When this callback function is invoked, the release of resources is necessary. - /// - /// - /// Following Error Codes can be returned - /// 1. None - /// 2. InvalidState - /// - public abstract Error Deinitialize(); - - /// - /// Called when the engine service user gets the whole supported voice list. - /// - /// - /// In this function, the engine service user's callback function 'SupportedVoice()' is invoked repeatedly for getting all supported voices, - /// and userData must be transferred to 'SupportedVoice()'. If 'SupportedVoice()' returns false, it should be stopped to call 'SupportedVoice()'. - /// The callback function - /// The user data which must be passed to SupportedVoice() - /// - /// Following Error Codes can be returned - /// 1. None - /// 2. OperationFailed - /// - /// This callback function invokes SupportedVoice() repeatedly for getting all supported voices. - public abstract Error ForEachSupportedVoices(SupportedVoice callback, IntPtr userData); - - /// - /// Called when the engine service user checks whether the voice is valid or not in TTS engine. - /// - /// The language is specified as an ISO 3166 alpha-2 two-letter country code followed by ISO 639-1 for the two-letter language code. - /// For example, "ko_KR" for Korean, "en_US" for American English - /// The voice type - /// A variable for checking whether the corresponding voice is valid or not. true to be valid, false to be invalid - /// - /// Following Error Codes can be returned - /// 1. None - /// 2. InvalidParameter - /// - public abstract Error IsValidVoice(string language, int type, out bool isValid); - - /// - /// Called when the engine service user sets the default pitch of TTS engine. - /// - /// The default pitch - /// - /// Following Error Codes can be returned - /// 1. None - /// 2. InvalidState - /// 3. OperationFailed - /// 4. InvalidParameter - /// - public abstract Error SetPitch(int pitch); - - /// - /// Called when the engine service user requests to load the corresponding voice type for the first time. - /// - /// The language is specified as an ISO 3166 alpha-2 two-letter country code followed by ISO 639-1 for the two-letter language code. - /// For example, "ko_KR" for Korean, "en_US" for American English - /// The voice type - /// - /// Following Error Codes can be returned - /// 1. None - /// 2. InvalidState - /// 3. OperationFailed - /// 4. InvalidVoice - /// 5. InvalidParameter - /// 6. OutOfMemory - /// - public abstract Error LoadVoice(string language, int type); - - /// - /// Called when the engine service user requests to unload the corresponding voice type or to stop using voice. - /// - /// The language is specified as an ISO 3166 alpha-2 two-letter country code followed by ISO 639-1 for the two-letter language code. - /// For example, "ko_KR" for Korean, "en_US" for American English - /// The voice type - /// - /// Following Error Codes can be returned - /// 1. None - /// 2. InvalidState - /// 3. OperationFailed - /// 4. InvalidVoice - /// 5. InvalidParameter - /// - public abstract Error UnloadVoice(string language, int type); - - /// - /// Called when the engine service user requests for TTS engine to check whether the application agreed the usage of TTS engine. - /// This callback function is called when the engine service user requests for TTS engine to check the application's agreement about using the engine. - /// According to the need, the engine developer can provide some user interfaces to check the agreement. - /// - /// - /// If the TTS engine developer wants not to check the agreement, the developer has need to return proper values as isAgreed in accordance with the intention. - /// true if the developer regards that every application agreed the usage of the engine, false if the developer regards that every application disagreed. - /// NOTE that, however, there may be any legal issue unless the developer checks the agreement. - /// Therefore, we suggest that the engine developers should provide a function to check the agreement. - /// - /// The Application ID - /// A variable for checking whether the application agreed to use TTS engine or not. true to agree, false to disagree - /// - /// Following Error Codes can be returned - /// 1. None - /// 2. InvalidState - /// 3. NotSupportedFeature - /// 4. InvalidParameter - /// - public abstract Error CheckAppAgreed(string appid, out bool isAgreed); - - /// - /// Called when the engine service user checks whether TTS engine needs the application's credential. - /// - /// true if TTS engine needs the application's credential, otherwise false - public abstract bool NeedAppCredential(); - - /// - /// Called when the engine service user cancels to synthesize a voice. - /// - /// - /// Following Error Codes can be returned - /// 1. None - /// 2. InvalidState - /// - /// - /// StartSynthesis should be performed - /// - public abstract Error CancelSynthesis(); - - /// - /// Public Constructor - /// - /// - /// http://tizen.org/feature/speech.synthesis - /// - public Engine() - { - _engine = this; - } - - /// - /// Main function for Text-To-Speech (TTS) engine. - /// This function is the main function for operating TTS engine. - /// - /// - /// http://tizen.org/feature/speech.synthesis - /// - /// - /// ServiceAppMain should be used for working the engine after this function. - /// - /// The argument count(original) - /// The argument(original) - /// Thrown in case of Invalid Parameter - /// Thrown in case of Not supported - /// thrown in case of Operation failure - public void EngineMain(int argc, string[] argv) - { - _callbackStructGCHandle.CallbackStruct.version = 1; - _callbackStructGCHandle.CallbackStruct.getInfo = _getInfoCb; - _callbackStructGCHandle.CallbackStruct.initialize = Initialize; - _callbackStructGCHandle.CallbackStruct.deinitialize = _deinitializeCb; - _callbackStructGCHandle.CallbackStruct.supportedVoice = ForEachSupportedVoices; - _callbackStructGCHandle.CallbackStruct.validVoice = IsValidVoice; - _callbackStructGCHandle.CallbackStruct.pitch = SetPitch; - _callbackStructGCHandle.CallbackStruct.loadVoice = LoadVoice; - _callbackStructGCHandle.CallbackStruct.unloadVoice = UnloadVoice; - _callbackStructGCHandle.CallbackStruct.startSynthesis = _startSynthesisCb; - _callbackStructGCHandle.CallbackStruct.cancelSynthesis = CancelSynthesis; - _callbackStructGCHandle.CallbackStruct.checkAppAgreed = CheckAppAgreed; - _callbackStructGCHandle.CallbackStruct.needAppCredential = NeedAppCredential; - _structIntPtrHandle = Marshal.AllocHGlobal(Marshal.SizeOf(_callbackStructGCHandle.CallbackStruct)); - Marshal.StructureToPtr(_callbackStructGCHandle.CallbackStruct, _structIntPtrHandle, false); - Error error = TTSEMain(argc, argv, _structIntPtrHandle); - if (error != Error.None) - { - Log.Error(LogTag, "TTSEMain Failed with error " + error); - throw ExceptionFactory.CreateException((ErrorCode)error); - } - - Log.Info(LogTag, "After TTSEMain"); - } - - /// - /// Gets the speed range from Tizen platform - /// - /// - /// http://tizen.org/feature/speech.synthesis - /// - /// - /// This API is used when TTS engine wants to get the speed range from Tizen platform - /// - /// The minimum speed value - /// The normal speed value - /// The maximum speed value - /// Thrown in case of Not supported - /// thrown in case of Operation failure - public void GetSpeedRange(out int min, out int normal, out int max) - { - Error error = TTSEGetSpeedRange(out min, out normal, out max); - if (error != Error.None) - { - Log.Error(LogTag, "TTSEGetSpeedRange Failed with error " + error); - throw ExceptionFactory.CreateException((ErrorCode)error); - } - - } - - /// - /// Gets the pitch range from Tizen platform. - /// - /// - /// http://tizen.org/feature/speech.synthesis - /// - /// - /// This API is used when TTS engine wants to get the pitch range from Tizen platform. - /// - /// The minimum pitch value - /// The normal pitch value - /// The maximum pitch value - /// Thrown in case of Not supported - /// thrown in case of Operation failure - public void GetPitchRange(out int min, out int normal, out int max) - { - Error error = TTSEGetPitchRange(out min, out normal, out max); - if (error != Error.None) - { - Log.Error(LogTag, "TTSEGetPitchRange Failed with error " + error); - throw ExceptionFactory.CreateException((ErrorCode)error); - } - - } - - /// - /// Sends the synthesized result to the engine service user. - /// - /// - /// http://tizen.org/feature/speech.synthesis - /// - /// - /// This API is used in StartSynthesis(), when TTS engine sends the synthesized result to the engine service user. - /// The synthesized result must be transferred to the engine service user through this function. - /// - /// The result event - /// Result data - /// Result data size - /// The audio type - /// The sample rate - /// Thrown in case of Invalid Parameter - /// Thrown in case of Not supported - /// thrown in case of Operation failure - /// - /// EngineMain function should be invoked before this function is called. StartSynthesis() will invoke this function. - /// - public void SendResult(ResultEvent resultEvent, IntPtr data, int dataSize, AudioType audioType, int rate) - { - Error error = TTSESendResult(resultEvent, data, dataSize, audioType, rate, IntPtr.Zero); - if (error != Error.None) - { - Log.Error(LogTag, "TTSESendResult Failed with error " + error); - throw ExceptionFactory.CreateException((ErrorCode)error); - } - } - - /// - /// Sends the error to the engine service user. - /// - /// - /// http://tizen.org/feature/speech.synthesis - /// - /// The error reason - /// The error message - /// - /// EngineMain function should be invoked before this function is called. - /// - public void SendError(Error error, string msg) - { - Error err = TTSESendError(error, msg); - if (err != Error.None) - { - Log.Error(LogTag, "SendError Failed with error " + err); - throw ExceptionFactory.CreateException((ErrorCode)error); - } - - } - - /// - /// Sets a callback function for setting the private data. - /// - /// - /// http://tizen.org/feature/speech.synthesis - /// - /// - /// Called when the engine service user gets the private data from Tts engine. - /// In Parameters: - /// a = Key -- The key field of private data - /// b = data -- The data field of private data - /// Following Error Codes can be returned - /// 1. None - /// 2. InvalidParameter - /// 3. OperationFailed - /// 4. NotSupported - /// - /// Thrown in case of Invalid Parameter - /// Thrown in case of Permission denied - /// Thrown in case of Not supported - /// thrown in case of Operation failure - /// - /// Main function should be invoked before this function is called. - /// - public void SetPrivateDataSetDelegate(Action callback) - { - _privateDatacallback = callback; - _privateDataSetCb = (string key, string data) => - { - return _privateDatacallback.Invoke(key, data); - }; - Error error = TTSESetPrivateDataSetCb(_privateDataSetCb); - if (error != Error.None) - { - Log.Error(LogTag, "SetPrivateDataSetDelegate Failed with error " + error); - throw ExceptionFactory.CreateException((ErrorCode)error); - } - - } - - /// - /// Sets a callback function for setting the private data. - /// - /// - /// http://tizen.org/feature/speech.synthesis - /// - /// callback function - /// Called when TTS engine receives the private data from the engine service user. - /// This callback function is called when the engine service user sends the private data to TTS engine. - /// Out Parameters: - /// a = Key -- The key field of private data - /// b = data -- The data field of private data - /// Following Error Codes can be returned - /// 1. None - /// 2. InvalidParameter - /// 3. OperationFailed - /// 4. NotSupported - /// - /// Thrown in case of Invalid Parameter - /// Thrown in case of Permission denied - /// Thrown in case of Not supported - /// thrown in case of Operation failure - /// - /// Main function should be invoked before this function is called. - /// - public void SetPrivateDataRequestedDelegate(OutAction callback) - { - _privateDataRequestedCallback = callback; - _privateDataRequestedCb = (string key, out string data) => - { - return _privateDataRequestedCallback.Invoke(key, out data); - }; - Error error = TTSESetPrivateDataRequestedCb(_privateDataRequestedCb); - if (error != Error.None) - { - Log.Error(LogTag, "SetPrivateDataRequestedDelegate Failed with error " + error); - throw ExceptionFactory.CreateException((ErrorCode)error); - } - - } - private StartSynthesisCb _startSynthesisCb = (IntPtr language, int type, IntPtr text, int speed, IntPtr appid, IntPtr credential, IntPtr userData) => - { - string lan = null; - string txt = null; - string apid = null; - string cre = null; - if (language != null) - lan = Marshal.PtrToStringAnsi(language); - if (text != null) - txt = Marshal.PtrToStringAnsi(text); - if (appid != null) - apid = Marshal.PtrToStringAnsi(appid); - if (credential != null) - cre = Marshal.PtrToStringAnsi(credential); - return _engine.StartSynthesis(lan, type, txt, speed, apid, cre, IntPtr.Zero); - }; - - private GetInfoCb _getInfoCb = (out IntPtr engineUuid, out IntPtr engineName, out IntPtr engineSetting, out int useNetwork) => - { - string uuid; - string name; - string setting; - bool network; - Error err = _engine.GetInformation(out uuid, out name, out setting, out network); - if (network == true) - { - useNetwork = 1; - } - else - { - useNetwork = 0; - } - engineUuid = Marshal.StringToHGlobalAnsi(uuid); - engineName = Marshal.StringToHGlobalAnsi(name); - engineSetting = Marshal.StringToHGlobalAnsi(setting); - return err; - }; - - private DeinitializeCb _deinitializeCb = () => - { - Marshal.FreeHGlobal(_engine._structIntPtrHandle); - return _engine.Deinitialize(); - }; - } -} \ No newline at end of file diff --git a/src/Tizen.Uix.VoiceControl/Interop/Interop.Libraries.cs b/src/Tizen.Uix.VoiceControl/Interop/Interop.Libraries.cs deleted file mode 100755 index c336e9abd..000000000 --- a/src/Tizen.Uix.VoiceControl/Interop/Interop.Libraries.cs +++ /dev/null @@ -1,29 +0,0 @@ -/* -* 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. -*/ - -/// -/// Partial interop class. -/// -internal static partial class Interop -{ - /// - /// Partial libraries class. - /// - internal static partial class Libraries - { - internal const string VoiceControl = "libvc.so"; - } -} diff --git a/src/Tizen.Uix.VoiceControl/Interop/Interop.VoiceControl.cs b/src/Tizen.Uix.VoiceControl/Interop/Interop.VoiceControl.cs deleted file mode 100755 index f6d386e2e..000000000 --- a/src/Tizen.Uix.VoiceControl/Interop/Interop.VoiceControl.cs +++ /dev/null @@ -1,156 +0,0 @@ -/* -* 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; -using Tizen.Uix.VoiceControl; -using static Interop.VoiceControlCommand; - -/// -/// Partial interop class. -/// -internal static partial class Interop -{ - /// - /// VoiceControl interop class. - /// - internal static class VoiceControl - { - internal static string LogTag = "Tizen.Uix.VoiceControl"; - - private const int ErrorVoiceControl = -0x02F50000; - - internal enum ErrorCode - { - None = Tizen.Internals.Errors.ErrorCode.None, /**< Successful */ - OutOfMemory = Tizen.Internals.Errors.ErrorCode.OutOfMemory, /**< Out of Memory */ - IoError = Tizen.Internals.Errors.ErrorCode.IoError, /**< I/O error */ - InvalidParameter = Tizen.Internals.Errors.ErrorCode.InvalidParameter, /**< Invalid parameter */ - TimedOut = Tizen.Internals.Errors.ErrorCode.TimedOut, /**< No answer from service */ - RecorderBusy = Tizen.Internals.Errors.ErrorCode.ResourceBusy, /**< Busy recorder */ - PermissionDenied = Tizen.Internals.Errors.ErrorCode.PermissionDenied, /**< Permission denied */ - NotSupported = Tizen.Internals.Errors.ErrorCode.NotSupported, /**< VC NOT supported */ - InvalidState = ErrorVoiceControl | 0x011, /**< Invalid state */ - InvalidLanguage = ErrorVoiceControl | 0x012, /**< Invalid language */ - EngineNotFound = ErrorVoiceControl | 0x013, /**< No available engine */ - OperationFailed = ErrorVoiceControl | 0x014, /**< Operation failed */ - OperationRejected = ErrorVoiceControl | 0x015, /**< Operation rejected */ - IterationEnd = ErrorVoiceControl | 0x016, /**< List reached end */ - Empty = ErrorVoiceControl | 0x017, /**< List empty */ - ServiceReset = ErrorVoiceControl | 0x018, /**< Service daemon reset (Since 3.0) */ - InProgressToReady = ErrorVoiceControl | 0x019, /**< In progress to ready (Since 3.0) */ - InProgressToRecording = ErrorVoiceControl | 0x020, /**< In progress to recording (Since 3.0) */ - InProgressToProcessing = ErrorVoiceControl | 0x021 /**< In progress to processing (Since 3.0) */ - }; - - internal enum VoiceCommandType - { - Foreground = 1, /* Foreground command type. */ - BackGround = 2 /* background command type. */ - }; - - [DllImport(Libraries.VoiceControl, EntryPoint = "vc_initialize")] - internal static extern ErrorCode VcInitialize(); - - [DllImport(Libraries.VoiceControl, EntryPoint = "vc_deinitialize")] - internal static extern ErrorCode VcDeinitialize(); - - [DllImport(Libraries.VoiceControl, EntryPoint = "vc_prepare")] - internal static extern ErrorCode VcPrepare(); - - [DllImport(Libraries.VoiceControl, EntryPoint = "vc_unprepare")] - internal static extern ErrorCode VcUnprepare(); - - [DllImport(Libraries.VoiceControl, EntryPoint = "vc_foreach_supported_languages")] - internal static extern ErrorCode VcForeachSupportedLanguages(VcSupportedLanguageCb callback, IntPtr userData); - - [DllImport(Libraries.VoiceControl, EntryPoint = "vc_get_current_language")] - internal static extern ErrorCode VcGetCurrentLanguage(out string language); - - [DllImport(Libraries.VoiceControl, EntryPoint = "vc_get_state")] - internal static extern ErrorCode VcGetState(out State state); - - [DllImport(Libraries.VoiceControl, EntryPoint = "vc_get_service_state")] - internal static extern ErrorCode VcGetServiceState(out ServiceState state); - - [DllImport(Libraries.VoiceControl, EntryPoint = "vc_get_system_command_list")] - internal static extern ErrorCode VcGetSystemCommandList(out IntPtr vc_sys_cmd_list); - - [DllImport(Libraries.VoiceControl, EntryPoint = "vc_set_invocation_name")] - internal static extern ErrorCode VcSetInvocationName(string name); - - [DllImport(Libraries.VoiceControl, EntryPoint = "vc_request_dialog")] - internal static extern ErrorCode VcRequestDialog(string dispText, string uttText, bool autoStart); - - [DllImport(Libraries.VoiceControl, EntryPoint = "vc_set_command_list")] - internal static extern ErrorCode VcSetCommandList(SafeCommandListHandle cmdList, VoiceCommandType type); - - [DllImport(Libraries.VoiceControl, EntryPoint = "vc_unset_command_list")] - internal static extern ErrorCode VcUnsetCommandList(VoiceCommandType type); - - [DllImport(Libraries.VoiceControl, EntryPoint = "vc_get_result")] - internal static extern ErrorCode VcGetResult(VcResultCb callback, IntPtr userData); - - [DllImport(Libraries.VoiceControl, EntryPoint = "vc_set_result_cb")] - internal static extern ErrorCode VcSetResultCb(VcResultCb callback, IntPtr userData); - - [DllImport(Libraries.VoiceControl, EntryPoint = "vc_unset_result_cb")] - internal static extern ErrorCode VcUnsetResultCb(); - - [DllImport(Libraries.VoiceControl, EntryPoint = "vc_set_service_state_changed_cb")] - internal static extern ErrorCode VcSetServiceStateChangedCb(VcServiceStateChangedCb callback, IntPtr userData); - - [DllImport(Libraries.VoiceControl, EntryPoint = "vc_unset_service_state_changed_cb")] - internal static extern ErrorCode VcUnsetServiceStateChangedCb(); - - [DllImport(Libraries.VoiceControl, EntryPoint = "vc_set_state_changed_cb")] - internal static extern ErrorCode VcSetStateChangedCb(VcStateChangedCb callback, IntPtr userData); - - [DllImport(Libraries.VoiceControl, EntryPoint = "vc_unset_state_changed_cb")] - internal static extern ErrorCode VcUnsetStateChangedCb(); - - [DllImport(Libraries.VoiceControl, EntryPoint = "vc_set_current_language_changed_cb")] - internal static extern ErrorCode VcSetCurrentLanguageChangedCb(VcCurrentLanguageChangedCb callback, IntPtr userData); - - [DllImport(Libraries.VoiceControl, EntryPoint = "vc_unset_current_language_changed_cb")] - internal static extern ErrorCode VcUnsetCurrentLanguageChangedCb(); - - [DllImport(Libraries.VoiceControl, EntryPoint = "vc_set_error_cb")] - internal static extern ErrorCode VcSetErrorCb(VcErrorCb callback, IntPtr userData); - - [DllImport(Libraries.VoiceControl, EntryPoint = "vc_unset_error_cb")] - internal static extern ErrorCode VcUnsetErrorCb(); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void VcResultCb(ResultEvent evt, IntPtr cmdList, IntPtr result, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void VcCurrentLanguageChangedCb(IntPtr previous, IntPtr current, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool VcSupportedLanguageCb(IntPtr language, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void VcStateChangedCb(State previous, State current, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void VcServiceStateChangedCb(ServiceState previous, ServiceState current, IntPtr userData); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate void VcErrorCb(ErrorCode reason, IntPtr userData); - } -} \ No newline at end of file diff --git a/src/Tizen.Uix.VoiceControl/Interop/Interop.VoiceControlCommand.cs b/src/Tizen.Uix.VoiceControl/Interop/Interop.VoiceControlCommand.cs deleted file mode 100755 index 18dd3385a..000000000 --- a/src/Tizen.Uix.VoiceControl/Interop/Interop.VoiceControlCommand.cs +++ /dev/null @@ -1,169 +0,0 @@ -/* -* 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; -using Tizen; -using Tizen.Uix.VoiceControl; - -/// -/// Partial interop class. -/// -internal static partial class Interop -{ - /// - /// VoiceControlCommand interop class. - /// - internal static class VoiceControlCommand - { - [DllImport(Libraries.VoiceControl, EntryPoint = "vc_cmd_list_create")] - internal static extern Interop.VoiceControl.ErrorCode VcCmdListCreate(out SafeCommandListHandle cmdList); - - [DllImport(Libraries.VoiceControl, EntryPoint = "vc_cmd_list_destroy")] - internal static extern Interop.VoiceControl.ErrorCode VcCmdListDestroy(IntPtr cmdList, bool freeCommand); - - [DllImport(Libraries.VoiceControl, EntryPoint = "vc_cmd_list_get_count")] - internal static extern Interop.VoiceControl.ErrorCode VcCmdListGetCount(SafeCommandListHandle cmdList, out int count); - - [DllImport(Libraries.VoiceControl, EntryPoint = "vc_cmd_list_add")] - internal static extern Interop.VoiceControl.ErrorCode VcCmdListAdd(SafeCommandListHandle cmdList, SafeCommandHandle vcCommand); - - [DllImport(Libraries.VoiceControl, EntryPoint = "vc_cmd_list_remove")] - internal static extern Interop.VoiceControl.ErrorCode VcCmdListRemove(SafeCommandListHandle cmdList, SafeCommandHandle vcCommand); - - [DllImport(Libraries.VoiceControl, EntryPoint = "vc_cmd_list_foreach_commands")] - internal static extern Interop.VoiceControl.ErrorCode VcCmdListForeachCommands(SafeCommandListHandle cmdList, VcCmdListCb callback, IntPtr userData); - - [DllImport(Libraries.VoiceControl, EntryPoint = "vc_cmd_list_first")] - internal static extern Interop.VoiceControl.ErrorCode VcCmdListFirst(SafeCommandListHandle cmdList); - - [DllImport(Libraries.VoiceControl, EntryPoint = "vc_cmd_list_last")] - internal static extern Interop.VoiceControl.ErrorCode VcCmdListLast(SafeCommandListHandle cmdList); - - [DllImport(Libraries.VoiceControl, EntryPoint = "vc_cmd_list_next")] - internal static extern Interop.VoiceControl.ErrorCode VcCmdListNext(SafeCommandListHandle cmdList); - - [DllImport(Libraries.VoiceControl, EntryPoint = "vc_cmd_list_prev")] - internal static extern Interop.VoiceControl.ErrorCode VcCmdListPrev(SafeCommandListHandle cmdList); - - [DllImport(Libraries.VoiceControl, EntryPoint = "vc_cmd_list_get_current")] - internal static extern Interop.VoiceControl.ErrorCode VcCmdListGetCurrent(SafeCommandListHandle cmdList, out SafeCommandHandle vcCommand); - - [DllImport(Libraries.VoiceControl, EntryPoint = "vc_cmd_create")] - internal static extern Interop.VoiceControl.ErrorCode VcCmdCreate(out SafeCommandHandle vcCommand); - - [DllImport(Libraries.VoiceControl, EntryPoint = "vc_cmd_destroy")] - internal static extern Interop.VoiceControl.ErrorCode VcCmdDestroy(IntPtr vcCommand); - - [DllImport(Libraries.VoiceControl, EntryPoint = "vc_cmd_set_command")] - internal static extern Interop.VoiceControl.ErrorCode VcCmdSetCommand(SafeCommandHandle vcCommand, string command); - - [DllImport(Libraries.VoiceControl, EntryPoint = "vc_cmd_get_command")] - internal static extern Interop.VoiceControl.ErrorCode VcCmdGetCommand(SafeCommandHandle vcCommand, out string command); - - [DllImport(Libraries.VoiceControl, EntryPoint = "vc_cmd_get_unfixed_command")] - internal static extern Interop.VoiceControl.ErrorCode VcCmdGetUnfixedCommand(SafeCommandHandle vcCommand, out string command); - - [DllImport(Libraries.VoiceControl, EntryPoint = "vc_cmd_set_type")] - internal static extern Interop.VoiceControl.ErrorCode VcCmdSetType(SafeCommandHandle vcCommand, CommandType type); - - [DllImport(Libraries.VoiceControl, EntryPoint = "vc_cmd_get_type")] - internal static extern Interop.VoiceControl.ErrorCode VcCmdGetType(SafeCommandHandle vcCommand, out int type); - - [DllImport(Libraries.VoiceControl, EntryPoint = "vc_cmd_set_format")] - internal static extern Interop.VoiceControl.ErrorCode VcCmdSetFormat(SafeCommandHandle vcCommand, CommandFormat format); - - [DllImport(Libraries.VoiceControl, EntryPoint = "vc_cmd_get_format")] - internal static extern Interop.VoiceControl.ErrorCode VcCmdGetFormat(SafeCommandHandle vcCommand, out CommandFormat format); - - [UnmanagedFunctionPointer(CallingConvention.Cdecl)] - internal delegate bool VcCmdListCb(IntPtr vcCommand, IntPtr userData); - - internal sealed class SafeCommandListHandle : SafeHandle - { - internal bool _ownership; - - public SafeCommandListHandle(IntPtr handle) - : base(handle, true) - { - _ownership = true; - } - - public SafeCommandListHandle() - : base(IntPtr.Zero, true) - { - _ownership = true; - } - - public override bool IsInvalid - { - get { return this.handle == IntPtr.Zero; } - } - - protected override bool ReleaseHandle() - { - if (_ownership && !IsInvalid) - { - Interop.VoiceControl.ErrorCode error = VcCmdListDestroy(this.handle, false); - if (error != Interop.VoiceControl.ErrorCode.None) - { - Log.Error(VoiceControl.LogTag, "Destroy Failed with error " + error); - } - } - this.SetHandle(IntPtr.Zero); - return true; - } - } - - internal sealed class SafeCommandHandle : SafeHandle - { - internal bool _ownership; - - public SafeCommandHandle(IntPtr handle) - : base(handle, true) - { - _ownership = true; - } - - public SafeCommandHandle() - : base(IntPtr.Zero, true) - { - _ownership = true; - } - - public override bool IsInvalid - { - get { return this.handle == IntPtr.Zero; } - } - - protected override bool ReleaseHandle() - { - Interop.VoiceControl.ErrorCode error = VoiceControl.ErrorCode.None; - if (_ownership && !IsInvalid) - { - error = VcCmdDestroy(this.handle); - if (error != Interop.VoiceControl.ErrorCode.None) - { - Log.Error(VoiceControl.LogTag, "Destroy Failed with error " + error); - } - } - this.SetHandle(IntPtr.Zero); - return true; - } - } - } -} \ No newline at end of file diff --git a/src/Tizen.Uix.VoiceControl/Tizen.Uix.VoiceControl.csproj b/src/Tizen.Uix.VoiceControl/Tizen.Uix.VoiceControl.csproj deleted file mode 100644 index 4c51c4197..000000000 --- a/src/Tizen.Uix.VoiceControl/Tizen.Uix.VoiceControl.csproj +++ /dev/null @@ -1,12 +0,0 @@ - - - - netstandard2.0 - - - - - - - - \ No newline at end of file diff --git a/src/Tizen.Uix.VoiceControl/Tizen.Uix.VoiceControl.sln b/src/Tizen.Uix.VoiceControl/Tizen.Uix.VoiceControl.sln deleted file mode 100755 index 2b6df867b..000000000 --- a/src/Tizen.Uix.VoiceControl/Tizen.Uix.VoiceControl.sln +++ /dev/null @@ -1,34 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26430.12 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Uix.VoiceControl", "Tizen.Uix.VoiceControl.csproj", "{5CEF41F8-A2B9-4C32-BB6B-91D7FF261120}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen", "..\Tizen\Tizen.csproj", "{90B368FB-387B-4822-9161-854A59FCF749}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.Log", "..\Tizen.Log\Tizen.Log.csproj", "{44082C95-BC74-48AE-B7C3-F6F6DB759D15}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {5CEF41F8-A2B9-4C32-BB6B-91D7FF261120}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {5CEF41F8-A2B9-4C32-BB6B-91D7FF261120}.Debug|Any CPU.Build.0 = Debug|Any CPU - {5CEF41F8-A2B9-4C32-BB6B-91D7FF261120}.Release|Any CPU.ActiveCfg = Release|Any CPU - {5CEF41F8-A2B9-4C32-BB6B-91D7FF261120}.Release|Any CPU.Build.0 = Release|Any CPU - {90B368FB-387B-4822-9161-854A59FCF749}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {90B368FB-387B-4822-9161-854A59FCF749}.Debug|Any CPU.Build.0 = Debug|Any CPU - {90B368FB-387B-4822-9161-854A59FCF749}.Release|Any CPU.ActiveCfg = Release|Any CPU - {90B368FB-387B-4822-9161-854A59FCF749}.Release|Any CPU.Build.0 = Release|Any CPU - {44082C95-BC74-48AE-B7C3-F6F6DB759D15}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {44082C95-BC74-48AE-B7C3-F6F6DB759D15}.Debug|Any CPU.Build.0 = Debug|Any CPU - {44082C95-BC74-48AE-B7C3-F6F6DB759D15}.Release|Any CPU.ActiveCfg = Release|Any CPU - {44082C95-BC74-48AE-B7C3-F6F6DB759D15}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/src/Tizen.Uix.VoiceControl/Tizen.Uix.VoiceControl/CurrentLanguageChangedEventArgs.cs b/src/Tizen.Uix.VoiceControl/Tizen.Uix.VoiceControl/CurrentLanguageChangedEventArgs.cs deleted file mode 100755 index f5afbbe69..000000000 --- a/src/Tizen.Uix.VoiceControl/Tizen.Uix.VoiceControl/CurrentLanguageChangedEventArgs.cs +++ /dev/null @@ -1,51 +0,0 @@ -/* -* 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. -*/ - -namespace Tizen.Uix.VoiceControl -{ - /// - /// This class holds information about the CurrentLanguageChanged event. - /// - /// 3 - public class CurrentLanguageChangedEventArgs - { - internal CurrentLanguageChangedEventArgs(string previous, string current) - { - PreviousLanguage = previous; - CurrentLanguage = current; - } - - /// - /// The previous language. - /// - /// 3 - public string PreviousLanguage - { - get; - internal set; - } - - /// - /// The current language. - /// - /// 3 - public string CurrentLanguage - { - get; - internal set; - } - } -} diff --git a/src/Tizen.Uix.VoiceControl/Tizen.Uix.VoiceControl/ErrorOccuredEventArgs.cs b/src/Tizen.Uix.VoiceControl/Tizen.Uix.VoiceControl/ErrorOccuredEventArgs.cs deleted file mode 100755 index da5c5f4f9..000000000 --- a/src/Tizen.Uix.VoiceControl/Tizen.Uix.VoiceControl/ErrorOccuredEventArgs.cs +++ /dev/null @@ -1,158 +0,0 @@ -/* -* 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 static Interop.VoiceControl; - -namespace Tizen.Uix.VoiceControl -{ - /// - /// This class holds information related to the VoiceControl ErrorOccured event. - /// - /// 3 - public class ErrorOccuredEventArgs - { - internal ErrorOccuredEventArgs(ErrorCode error) - { - switch (error) - { - case ErrorCode.None: - { - ErrorValue = Error.None; - break; - } - - case ErrorCode.OutOfMemory: - { - ErrorValue = Error.OutOfMemory; - break; - } - - case ErrorCode.IoError: - { - ErrorValue = Error.IoError; - break; - } - - case ErrorCode.InvalidParameter: - { - ErrorValue = Error.InvalidParameter; - break; - } - - case ErrorCode.TimedOut: - { - ErrorValue = Error.TimedOut; - break; - } - - case ErrorCode.RecorderBusy: - { - ErrorValue = Error.RecorderBusy; - break; - } - - case ErrorCode.PermissionDenied: - { - ErrorValue = Error.PermissionDenied; - break; - } - - case ErrorCode.NotSupported: - { - ErrorValue = Error.NotSupported; - break; - } - - case ErrorCode.InvalidState: - { - ErrorValue = Error.InvalidState; - break; - } - - case ErrorCode.InvalidLanguage: - { - ErrorValue = Error.InvalidLanguage; - break; - } - - case ErrorCode.EngineNotFound: - { - ErrorValue = Error.EngineNotFound; - break; - } - - case ErrorCode.OperationFailed: - { - ErrorValue = Error.OperationFailed; - break; - } - - case ErrorCode.OperationRejected: - { - ErrorValue = Error.OperationRejected; - break; - } - - case ErrorCode.IterationEnd: - { - ErrorValue = Error.IterationEnd; - break; - } - - case ErrorCode.Empty: - { - ErrorValue = Error.Empty; - break; - } - - case ErrorCode.InProgressToReady: - { - ErrorValue = Error.InProgressToReady; - break; - } - - case ErrorCode.InProgressToRecording: - { - ErrorValue = Error.InProgressToRecording; - break; - } - - case ErrorCode.InProgressToProcessing: - { - ErrorValue = Error.InProgressToProcessing; - break; - } - - case ErrorCode.ServiceReset: - { - ErrorValue = Error.ServiceReset; - break; - } - } - } - - /// - /// The error value. - /// - /// 3 - public Error ErrorValue - { - get; - internal set; - } - } -} diff --git a/src/Tizen.Uix.VoiceControl/Tizen.Uix.VoiceControl/ExceptionFactory.cs b/src/Tizen.Uix.VoiceControl/Tizen.Uix.VoiceControl/ExceptionFactory.cs deleted file mode 100755 index 8c6e35fa9..000000000 --- a/src/Tizen.Uix.VoiceControl/Tizen.Uix.VoiceControl/ExceptionFactory.cs +++ /dev/null @@ -1,148 +0,0 @@ -/* -* 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 static Interop.VoiceControl; - -namespace Tizen.Uix.VoiceControl -{ - internal static class ExceptionFactory - { - internal static Exception CreateException(ErrorCode err) - { - Tizen.Log.Error(LogTag, "Error " + err); - Exception exp; - switch (err) - { - case ErrorCode.OutOfMemory: - { - exp = new OutOfMemoryException("Out Of Memory"); - break; - } - - case ErrorCode.IoError: - { - exp = new InvalidOperationException("I/O Error Occured"); - break; - } - - case ErrorCode.InvalidParameter: - { - exp = new ArgumentException("Invalid Parameters Provided"); - break; - } - - case ErrorCode.TimedOut: - { - exp = new TimeoutException("No answer from service"); - break; - } - - case ErrorCode.RecorderBusy: - { - exp = new InvalidOperationException("Recorder is Busy "); - break; - } - - case ErrorCode.PermissionDenied: - { - exp = new UnauthorizedAccessException("Permission Denied"); - break; - } - - case ErrorCode.NotSupported: - { - exp = new NotSupportedException("VC NOT supported"); - break; - } - - case ErrorCode.InvalidState: - { - exp = new InvalidOperationException("Invalid state"); - break; - } - - case ErrorCode.InvalidLanguage: - { - exp = new InvalidOperationException("Invalid language"); - break; - } - - case ErrorCode.EngineNotFound: - { - exp = new InvalidOperationException("No available engine"); - break; - } - - case ErrorCode.OperationFailed: - { - exp = new InvalidOperationException("Operation Failed"); - break; - } - - case ErrorCode.OperationRejected: - { - exp = new InvalidOperationException("Operation Rejected"); - break; - } - - case ErrorCode.IterationEnd: - { - exp = new InvalidOperationException("List Reached End"); - break; - } - - case ErrorCode.Empty: - { - exp = new InvalidOperationException("List Empty"); - break; - } - - case ErrorCode.InProgressToReady: - { - exp = new InvalidOperationException("Progress to ready is not finished"); - break; - } - - case ErrorCode.InProgressToRecording: - { - exp = new InvalidOperationException("Progress to recording is not finished"); - break; - } - - case ErrorCode.InProgressToProcessing: - { - exp = new InvalidOperationException("Progress to processing is not finished"); - break; - } - - case ErrorCode.ServiceReset: - { - exp = new InvalidOperationException("Service reset"); - break; - } - - default: - { - exp = new Exception(""); - break; - } - } - - return exp; - } - } -} diff --git a/src/Tizen.Uix.VoiceControl/Tizen.Uix.VoiceControl/RecognitionResult.cs b/src/Tizen.Uix.VoiceControl/Tizen.Uix.VoiceControl/RecognitionResult.cs deleted file mode 100755 index 523a672f4..000000000 --- a/src/Tizen.Uix.VoiceControl/Tizen.Uix.VoiceControl/RecognitionResult.cs +++ /dev/null @@ -1,83 +0,0 @@ -/* -* 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.Collections.Generic; -using System.Runtime.InteropServices; -using static Interop.VoiceControl; -using static Interop.VoiceControlCommand; - -namespace Tizen.Uix.VoiceControl -{ - /// - /// The recognition result from the engine. - /// If the duplicated commands are recognized, the event(e.g. Result.Rejected) of a command may be rejected - /// for selecting the command as a priority. If you set similar or same commands, or the recognized results are multi-results, the CommandList has multi commands. - /// - /// 3 - public class RecognitionResult - { - private ResultEvent _resultEvent; - private VoiceCommandList _list; - private string _result; - - internal RecognitionResult(ResultEvent evt, IntPtr cmdList, IntPtr result) - { - _resultEvent = evt; - SafeCommandListHandle handle = new SafeCommandListHandle(cmdList); - handle._ownership = false; - _list = new VoiceCommandList(handle); - _result = Marshal.PtrToStringAnsi(result); - } - - /// - /// The result event. - /// - /// 3 - public ResultEvent Result - { - get - { - return _resultEvent; - } - } - - /// - /// The spoken text. - /// - /// 3 - public string ResultMessage - { - get - { - return _result; - } - } - - - /// - /// The recognized command list. - /// - /// 3 - public VoiceCommandList CommandList - { - get - { - return _list; - } - } - } -} diff --git a/src/Tizen.Uix.VoiceControl/Tizen.Uix.VoiceControl/RecognitionResultEventArgs.cs b/src/Tizen.Uix.VoiceControl/Tizen.Uix.VoiceControl/RecognitionResultEventArgs.cs deleted file mode 100755 index 536f216ee..000000000 --- a/src/Tizen.Uix.VoiceControl/Tizen.Uix.VoiceControl/RecognitionResultEventArgs.cs +++ /dev/null @@ -1,46 +0,0 @@ -/* -* 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.Uix.VoiceControl -{ - /// - /// The recognition result from the engine. - /// - /// 3 - public class RecognitionResultEventArgs : EventArgs - { - private RecognitionResult _result; - internal RecognitionResultEventArgs(RecognitionResult result) - { - _result = result; - } - - /// - /// Gets the recognition result. - /// - /// 3 - public RecognitionResult Result - { - get - { - return _result; - } - } - - } -} diff --git a/src/Tizen.Uix.VoiceControl/Tizen.Uix.VoiceControl/ServiceStateChangedEventArgs.cs b/src/Tizen.Uix.VoiceControl/Tizen.Uix.VoiceControl/ServiceStateChangedEventArgs.cs deleted file mode 100755 index a20281c8f..000000000 --- a/src/Tizen.Uix.VoiceControl/Tizen.Uix.VoiceControl/ServiceStateChangedEventArgs.cs +++ /dev/null @@ -1,51 +0,0 @@ -/* -* 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. -*/ - -namespace Tizen.Uix.VoiceControl -{ - /// - /// This class holds information related to the VoiceControl service ServiceStateChanged event. - /// - /// 3 - public class ServiceStateChangedEventArgs - { - internal ServiceStateChangedEventArgs(ServiceState previous, ServiceState current) - { - Previous = previous; - Current = current; - } - - /// - /// The previous state. - /// - /// 3 - public ServiceState Previous - { - get; - internal set; - } - - /// - /// The current state. - /// - /// 3 - public ServiceState Current - { - get; - internal set; - } - } -} diff --git a/src/Tizen.Uix.VoiceControl/Tizen.Uix.VoiceControl/StateChangedEventArgs.cs b/src/Tizen.Uix.VoiceControl/Tizen.Uix.VoiceControl/StateChangedEventArgs.cs deleted file mode 100755 index 011554d44..000000000 --- a/src/Tizen.Uix.VoiceControl/Tizen.Uix.VoiceControl/StateChangedEventArgs.cs +++ /dev/null @@ -1,51 +0,0 @@ -/* -* 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. -*/ - -namespace Tizen.Uix.VoiceControl -{ - /// - /// This class holds information related to the VoiceControl client StateChanged event. - /// - /// 3 - public class StateChangedEventArgs - { - internal StateChangedEventArgs(State previous, State current) - { - Previous = previous; - Current = current; - } - - /// - /// The previous state. - /// - /// 3 - public State Previous - { - get; - internal set; - } - - /// - /// The current state. - /// - /// 3 - public State Current - { - get; - internal set; - } - } -} diff --git a/src/Tizen.Uix.VoiceControl/Tizen.Uix.VoiceControl/VoiceCommand.cs b/src/Tizen.Uix.VoiceControl/Tizen.Uix.VoiceControl/VoiceCommand.cs deleted file mode 100755 index 1175c4ae2..000000000 --- a/src/Tizen.Uix.VoiceControl/Tizen.Uix.VoiceControl/VoiceCommand.cs +++ /dev/null @@ -1,209 +0,0 @@ -/* -* 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 static Interop.VoiceControl; -using static Interop.VoiceControlCommand; - -namespace Tizen.Uix.VoiceControl -{ - /// - /// Enumeration for the command format. - /// - /// 3 - public enum CommandFormat - { - /// - /// The fixed command format. - /// - Fixed = 0, - /// - /// The fixed and variable fixed command format. - /// - FixedAndVFixed = 1, - /// - /// The variable fixed and fixed command format. - /// - VFixedAndFixed = 2, - /// - /// The fixed and non-fixed command format. - /// - FixedAndNonFixed = 3, - /// - /// The non-fixed and fixed command format. - /// - NonFixedAndFixed = 4, - /// - /// Undefined. - /// - Undefined = 5 - }; - - /// - /// This class represents a voice command. - /// - /// 3 - public class VoiceCommand - { - internal SafeCommandHandle _handle; - - /// - /// The public constructor. - /// - /// 3 - /// This exception can be due to an invalid state. - /// This exception can be due to out Of memory. - /// This exception can be due to permission denied. - /// This exception can be due to not supported. - public VoiceCommand() - { - SafeCommandHandle handle; - ErrorCode error = VcCmdCreate(out handle); - if (error != ErrorCode.None) - { - Log.Error(LogTag, "Create Failed with error " + error); - throw ExceptionFactory.CreateException(error); - } - _handle = handle; - } - - internal VoiceCommand(SafeCommandHandle handle) - { - _handle = handle; - } - - /// - /// Gets the unfixed command. - /// This property should be used for commands which have non-fixed format. - /// An empty string will be returned in case of some internal error. - /// - /// 3 - public string UnfixedCommand - { - get - { - string unfixedCommand; - ErrorCode error = VcCmdGetUnfixedCommand(_handle, out unfixedCommand); - if (error != ErrorCode.None) - { - Log.Error(LogTag, "UnfixedCommand Failed with error " + error); - return ""; - } - - return unfixedCommand; - } - } - - /// - /// Gets or sets the command type. - /// - /// 3 - /// If you do not set the command type, the default value is undefined. You should set the type if the command is valid. - /// This exception can be due to permission denied. - /// This exception can be due to not supported. - public CommandType Type - { - get - { - CommandType cmdType = CommandType.Undefined; - int type; - ErrorCode error = VcCmdGetType(_handle, out type); - if (error != ErrorCode.None) - { - Log.Error(LogTag, "GetType Failed with error " + error); - return CommandType.Undefined; - } - - if (type != -1) - { - cmdType = (CommandType)type; - } - - return cmdType; - } - set - { - ErrorCode error = VcCmdSetType(_handle, value); - if (error != ErrorCode.None) - { - Log.Error(LogTag, "SetType Failed with error " + error); - } - } - } - - /// - /// Gets or sets the command format. - /// - /// 3 - /// The default format is Fixed. - /// This exception can be due to permission denied. - /// This exception can be due to not supported. - public CommandFormat Format - { - get - { - CommandFormat format; - ErrorCode error = VcCmdGetFormat(_handle, out format); - if (error != ErrorCode.None) - { - Log.Error(LogTag, "GetFormat Failed with error " + error); - return CommandFormat.Undefined; - } - - return format; - } - set - { - ErrorCode error = VcCmdSetFormat(_handle, value); - if (error != ErrorCode.None) - { - Log.Error(LogTag, "SetFormat Failed with error " + error); - } - } - } - - /// - /// Gets or sets the command. - /// A get empty string will be returned in case of some internal error. - /// - /// 3 - /// This exception can be due to permission denied. - /// This exception can be due to not supported. - public string Command - { - get - { - string command; - ErrorCode error = VcCmdGetCommand(_handle, out command); - if (error != ErrorCode.None) - { - Log.Error(LogTag, "GetCommand Failed with error " + error); - return ""; - } - - return command; - } - set - { - ErrorCode error = VcCmdSetCommand(_handle, value); - if (error != ErrorCode.None) - { - Log.Error(LogTag, "SetCommand Failed with error " + error); - } - } - } - } -} diff --git a/src/Tizen.Uix.VoiceControl/Tizen.Uix.VoiceControl/VoiceCommandList.cs b/src/Tizen.Uix.VoiceControl/Tizen.Uix.VoiceControl/VoiceCommandList.cs deleted file mode 100755 index 8573076b2..000000000 --- a/src/Tizen.Uix.VoiceControl/Tizen.Uix.VoiceControl/VoiceCommandList.cs +++ /dev/null @@ -1,365 +0,0 @@ -/* -* 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.Collections.Generic; -using static Interop.VoiceControl; -using static Interop.VoiceControlCommand; - -namespace Tizen.Uix.VoiceControl -{ - /// - /// This class represents a list of the voice commands. - /// - /// 3 - public class VoiceCommandList - { - internal SafeCommandListHandle _handle; - private List _list; - private VcCmdListCb _callback; - private int _index; - - /// - /// The public constructor. - /// - /// 3 - /// - /// http://tizen.org/privilege/recorder - /// - /// - /// public - /// - /// - /// http://tizen.org/feature/speech.control - /// http://tizen.org/feature/microphone - /// - /// This exception can be due to out of memory. - /// This exception can be due to an invalid parameter. - /// This exception can be due to permission denied. - /// This exception can be due to not supported. - public VoiceCommandList() - { - SafeCommandListHandle handle; - ErrorCode error = VcCmdListCreate(out handle); - if (error != ErrorCode.None) - { - Log.Error(LogTag, "Create Failed with error " + error); - throw ExceptionFactory.CreateException(error); - } - _handle = handle; - _list = new List(); - _index = 0; - } - - internal VoiceCommandList(SafeCommandListHandle handle) - { - _handle = handle; - _index = 0; - - _list = new List(); - _callback = (IntPtr vcCommand, IntPtr userData) => - { - SafeCommandHandle cmdHandle = new SafeCommandHandle(vcCommand); - cmdHandle._ownership = false; - _list.Add(new VoiceCommand(cmdHandle)); - return true; - }; - ErrorCode error = VcCmdListForeachCommands(_handle, _callback, IntPtr.Zero); - if (error != ErrorCode.None) - { - Log.Error(LogTag, "GetAllCommands Failed with error " + error); - throw ExceptionFactory.CreateException(error); - } - } - - /// - /// Gets a command count of the list. - /// -1 is returned in case of an internal failure. - /// - /// 3 - /// - /// Command count of the list. - /// - /// - /// http://tizen.org/privilege/recorder - /// - /// - /// public - /// - public int Count - { - get - { - int count; - ErrorCode error = VcCmdListGetCount(_handle, out count); - if (error != ErrorCode.None) - { - Log.Error(LogTag, "Count Failed with error " + error); - return -1; - } - - return count; - } - } - - /// - /// Gets the current command from the command list by index. - /// Null will be returned in case of an empty list. - /// - /// 3 - /// - /// Current command from the command list. - /// - /// - /// http://tizen.org/privilege/recorder - /// - /// - /// public - /// - public VoiceCommand Current - { - get - { - SafeCommandHandle current; - ErrorCode error = VcCmdListGetCurrent(_handle, out current); - if (ErrorCode.None != error) - { - Log.Error(LogTag, "Current Failed with error " + error); - return null; - } - - current._ownership = false; - return _list[_index]; - } - } - - /// - /// Adds a command to the command list. - /// - /// 3 - /// - /// http://tizen.org/privilege/recorder - /// - /// - /// public - /// - /// - /// http://tizen.org/feature/speech.control - /// http://tizen.org/feature/microphone - /// - /// The command - /// This exception can be due to permission denied. - /// This exception can be due to not supported. - /// This will occur if the provided parameter is null. - public void Add(VoiceCommand command) - { - ErrorCode error = VcCmdListAdd(_handle, command._handle); - if (error != ErrorCode.None) - { - Log.Error(LogTag, "Add Failed with error " + error); - throw ExceptionFactory.CreateException(error); - } - - _list.Add(command); - } - - /// - /// Removes a command from the command list. - /// - /// 3 - /// - /// http://tizen.org/privilege/recorder - /// - /// - /// public - /// - /// - /// http://tizen.org/feature/speech.control - /// http://tizen.org/feature/microphone - /// - /// The command - /// This exception can be due to permission denied. - /// This exception can be due to not supported. - /// This will occur if the provided parameter is null. - public void Remove(VoiceCommand command) - { - ErrorCode error = VcCmdListRemove(_handle, command._handle); - if (error != ErrorCode.None) - { - Log.Error(LogTag, "Remove Failed with error " + error); - throw ExceptionFactory.CreateException(error); - } - - _list.Remove(command); - } - - /// - /// Retrieves all commands from the command list. - /// - /// 3 - /// - /// http://tizen.org/privilege/recorder - /// - /// - /// public - /// - /// - /// http://tizen.org/feature/speech.control - /// http://tizen.org/feature/microphone - /// - /// This exception can be due to permission denied. - /// This exception can be due to not supported. - public IEnumerable GetAllCommands() - { - _callback = (IntPtr vcCommand, IntPtr userData) => - { - if (IntPtr.Zero == vcCommand) { - Log.Error(LogTag, "Invalid command pointer"); - return false; - } - return true; - }; - ErrorCode error = VcCmdListForeachCommands(_handle, _callback, IntPtr.Zero); - if (error != ErrorCode.None) - { - Log.Error(LogTag, "GetAllCommands Failed with error " + error); - throw ExceptionFactory.CreateException(error); - } - - return _list; - } - - /// - /// Moves an index to the first command. - /// - /// 3 - /// - /// http://tizen.org/privilege/recorder - /// - /// - /// public - /// - /// - /// http://tizen.org/feature/speech.control - /// http://tizen.org/feature/microphone - /// - /// This exception can be due to list empty. - /// This exception can be due to permission denied. - /// This exception can be due to not supported. - public void First() - { - ErrorCode error = VcCmdListFirst(_handle); - if (ErrorCode.None != error) - { - Log.Error(LogTag, "First Failed with error " + error); - throw ExceptionFactory.CreateException(error); - } - _index = 0; - } - - /// - /// Moves an index to the last command. - /// - /// 3 - /// - /// http://tizen.org/privilege/recorder - /// - /// - /// public - /// - /// - /// http://tizen.org/feature/speech.control - /// http://tizen.org/feature/microphone - /// - /// This exception can be due to list empty. - /// This exception can be due to permission denied. - /// This exception can be due to not supported. - public void Last() - { - ErrorCode error = VcCmdListLast(_handle); - if (ErrorCode.None != error) - { - Log.Error(LogTag, "Last Failed with error " + error); - throw ExceptionFactory.CreateException(error); - } - _index = Count - 1; - } - - /// - /// Moves an index to the next command. - /// - /// 3 - /// - /// http://tizen.org/privilege/recorder - /// - /// - /// public - /// - /// - /// http://tizen.org/feature/speech.control - /// http://tizen.org/feature/microphone - /// - /// - /// This exception can be due to the following reasons: - /// 1. List empty - /// 2. List reached end - /// - /// This exception can be due to permission denied. - /// This exception can be due to not supported. - public void Next() - { - ErrorCode error = VcCmdListNext(_handle); - if (ErrorCode.None != error) - { - Log.Error(LogTag, "Next Failed with error " + error); - throw ExceptionFactory.CreateException(error); - } - _index++; - } - - /// - /// Moves an index to the previous command. - /// - /// 3 - /// - /// http://tizen.org/privilege/recorder - /// - /// - /// public - /// - /// - /// http://tizen.org/feature/speech.control - /// http://tizen.org/feature/microphone - /// - /// - /// This exception can be due to the following reasons: - /// 1. List empty - /// 2. List reached end - /// - /// This exception can be due to permission denied. - /// This exception can be due to not supported. - public void Previous() - { - ErrorCode error = VcCmdListPrev(_handle); - if (ErrorCode.None != error) - { - Log.Error(LogTag, "Previous Failed with error " + error); - throw ExceptionFactory.CreateException(error); - } - _index--; - } - } -} diff --git a/src/Tizen.Uix.VoiceControl/Tizen.Uix.VoiceControl/VoiceControlClient.cs b/src/Tizen.Uix.VoiceControl/Tizen.Uix.VoiceControl/VoiceControlClient.cs deleted file mode 100755 index b6133977a..000000000 --- a/src/Tizen.Uix.VoiceControl/Tizen.Uix.VoiceControl/VoiceControlClient.cs +++ /dev/null @@ -1,946 +0,0 @@ -/* -* 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.Collections.Generic; -using System.Runtime.InteropServices; -using static Interop.VoiceControl; -using static Interop.VoiceControlCommand; - -namespace Tizen.Uix.VoiceControl -{ - /// - /// Enumeration for the error values that can occur. - /// - /// 3 - public enum Error - { - /// - /// Successful, no error. - /// - None, - /// - /// Out of memory. - /// - OutOfMemory, - /// - /// I/O error. - /// - IoError, - /// - /// Invalid parameter. - /// - InvalidParameter, - /// - /// No answer from the STT service. - /// - TimedOut, - /// - /// Device or resource busy. - /// - RecorderBusy, - /// - /// Permission denied. - /// - PermissionDenied, - /// - /// VC NOT supported. - /// - NotSupported, - /// - /// Invalid state. - /// - InvalidState, - /// - /// Invalid language. - /// - InvalidLanguage, - /// - /// No available engine. - /// - EngineNotFound, - /// - /// Operation failed. - /// - OperationFailed, - /// - /// Operation rejected. - /// - OperationRejected, - /// - /// List reached end. - /// - IterationEnd, - /// - /// List empty. - /// - Empty, - /// - /// Service reset. - /// - ServiceReset, - /// - /// Progress to ready is not finished. - /// - InProgressToReady, - /// - /// Progress to recording is not finished. - /// - InProgressToRecording, - /// - /// Progress to processing is not finished. - /// - InProgressToProcessing - }; - - /// - /// Enumeration for the client state. - /// - /// 3 - public enum State - { - /// - /// 'None' state. - /// - None = 0, - /// - /// 'Initialized' state. - /// - Initialized = 1, - /// - /// 'Ready' state. - /// - Ready = 2, - /// - /// The state cannot be determined. - /// - Unavailable - }; - - /// - /// Enumeration for the service state. - /// - /// 3 - public enum ServiceState - { - /// - /// 'None' state. - /// - None = 0, - /// - /// 'Ready' state. - /// - Ready = 1, - /// - /// 'Recording' state. - /// - Recording = 2, - /// - /// 'Processing' state. - /// - Processing = 3, - /// - /// The state cannot be determined. - /// - Unavailable - }; - - /// - /// Enumeration for the result event. - /// - /// 3 - public enum ResultEvent - { - /// - /// Normal result. - /// - Success = 0, - /// - /// Rejected result. - /// - Rejected = 1 - }; - - /// - /// Enumeration for the command type. - /// - /// 3 - public enum CommandType - { - /// - /// Foreground command by the client. - /// - Foreground = 1, - /// - /// Background command by the client. - /// - Background = 2, - /// - /// The undefined command. - /// - Undefined = -1 - }; - - /// - /// A main function of the voice control API registers the command and gets a notification for the recognition result. - /// Applications can add their own commands and provide results when their command is recognized by the user voice input. - /// - /// 3 - public static class VoiceControlClient - { - private static event EventHandler _recognitionResult; - private static event EventHandler _stateChanged; - private static event EventHandler _serviceStateChanged; - private static event EventHandler _errorOccured; - private static event EventHandler _currentLanguageChanged; - private static VcResultCb s_resultDelegate; - private static VcStateChangedCb s_stateDelegate; - private static VcServiceStateChangedCb s_serviceStateDelegate; - private static VcErrorCb s_errorDelegate; - private static VcCurrentLanguageChangedCb s_languageDelegate; - private static List s_supportedLanguages; - private static VcSupportedLanguageCb s_supportedLanguagesCb; - private static VcResultCb s_resultCb; - private static RecognitionResult s_recognitionResult; - - /// - /// Gets the current language. - /// A language is specified as an ISO 3166 alpha-2 two letter country-code - /// followed by ISO 639-1 for the two-letter language code. - /// For example, "ko_KR" for Korean, "en_US" for American English. - /// An empty string is returned in case of some internal error. - /// - /// 3 - /// - /// The current language in voice control. - /// - /// - /// http://tizen.org/privilege/recorder - /// - ///
-        /// The state must be initialized or ready.
-        /// 
- public static string CurrentLanguage - { - get - { - string currentLanguage; - - ErrorCode error = VcGetCurrentLanguage(out currentLanguage); - if (error != ErrorCode.None) - { - Log.Error(LogTag, "CurrentLanguage Failed with error " + error); - return ""; - } - - return currentLanguage; - } - } - - /// - /// Gets the current state of the voice control client. - /// - /// 3 - /// - /// The current state of the voice control client. - /// - /// - /// http://tizen.org/privilege/recorder - /// - ///
-        /// The state must be initialized or ready.
-        /// 
- public static State State - { - get - { - State state; - - ErrorCode error = VcGetState(out state); - if (error != ErrorCode.None) - { - Log.Error(LogTag, "State Failed with error " + error); - return State.Unavailable; - } - - return state; - } - } - - /// - /// Gets the current state of the voice control service. - /// - /// 3 - /// - /// The current state of the voice control service. - /// - /// - /// http://tizen.org/privilege/recorder - /// - ///
-        /// The state must be ready.
-        /// 
- public static ServiceState ServiceState - { - get - { - ServiceState state; - - ErrorCode error = VcGetServiceState(out state); - if (error != ErrorCode.None) - { - Log.Error(LogTag, "ServiceState Failed with error " + error); - return ServiceState.Unavailable; - } - - return state; - } - } - - /// - /// Sets the invocation name. - /// - /// 3 - /// - /// http://tizen.org/privilege/recorder - /// - /// - /// public - /// - /// - /// http://tizen.org/feature/speech.control - /// http://tizen.org/feature/microphone - /// - /// - /// The invocation name is used to activate background commands. The invocation name can be same as the application name or any other phrase. - /// For example, an application "Tizen Sample" has a background command, "Play music", and the invocation name of the application is set to "Tizen Sample". - /// In order to activate the background command, users can say "Tizen Sample, Play music". The invocation name is dependent on the current language. - /// For example, if the current language is "en_US"(English), the invocation name is also "en_US". - /// If the current language is "ja_JP"(Japanese) and the invocation name is "en_US", the invocation name will not be recognized. - /// This function should be called before the SetCommandList(). - /// - /// Invocation name to be invoked by an application. - /// This exception can be due to an invalid state. - /// This exception can be due to an invalid parameter. - /// This exception can be due to not supported. - /// This exception can be due to permission denied. - ///
-        /// The state must be ready.
-        /// 
- public static void SetInvocationName(string name) - { - ErrorCode error = VcSetInvocationName(name); - if (error != ErrorCode.None) - { - Log.Error(LogTag, "SetInvocationName Failed with error " + error); - throw ExceptionFactory.CreateException(error); - } - } - - /// - /// Initializes the voice control. - /// - /// 3 - /// - /// http://tizen.org/privilege/recorder - /// - /// - /// public - /// - /// - /// http://tizen.org/feature/speech.control - /// http://tizen.org/feature/microphone - /// - /// This exception can be due to operation failed. - /// This exception can be due to out Of memory. - /// This exception can be due to not supported. - /// This exception can be due to permission denied. - /// - /// The state will be initialized. - /// - public static void Initialize() - { - ErrorCode error = VcInitialize(); - if (error != ErrorCode.None) - { - Log.Error(LogTag, "Initialize Failed with error " + error); - throw ExceptionFactory.CreateException(error); - } - } - - /// - /// Deinitializes the voice control. - /// - /// 3 - /// - /// http://tizen.org/privilege/recorder - /// - /// - /// public - /// - /// - /// http://tizen.org/feature/speech.control - /// http://tizen.org/feature/microphone - /// - /// This exception can be due to an invalid state. - /// This exception can be due to operation failed. - /// This exception can be due to not supported. - /// This exception can be due to permission denied. - public static void Deinitialize() - { - ErrorCode error = VcDeinitialize(); - if (error != ErrorCode.None) - { - Log.Error(LogTag, "Deinitialize Failed with error " + error); - throw ExceptionFactory.CreateException(error); - } - } - - /// - /// Connects the voice control service. - /// - /// 3 - /// - /// http://tizen.org/privilege/recorder - /// - /// - /// public - /// - /// - /// http://tizen.org/feature/speech.control - /// http://tizen.org/feature/microphone - /// - /// This exception can be due to an invalid state. - /// This exception can be due to operation failed. - /// This exception can be due to not supported. - /// This exception can be due to permission denied. - ///
-        /// The state must be initialized.
-        /// 
- /// - /// The state must be ready. - /// - public static void Prepare() - { - ErrorCode error = VcPrepare(); - if (error != ErrorCode.None) - { - Log.Error(LogTag, "Prepare Failed with error " + error); - throw ExceptionFactory.CreateException(error); - } - } - - /// - /// Disconnects the voice control service. - /// - /// 3 - /// - /// http://tizen.org/privilege/recorder - /// - /// - /// public - /// - /// - /// http://tizen.org/feature/speech.control - /// http://tizen.org/feature/microphone - /// - /// This exception can be due to an invalid state. - /// This exception can be due to not supported. - /// This exception can be due to permission denied. - ///
-        /// The state must be ready.
-        /// 
- /// - /// The state must be initialized. - /// - public static void Unprepare() - { - ErrorCode error = VcUnprepare(); - if (error != ErrorCode.None) - { - Log.Error(LogTag, "Unprepare Failed with error " + error); - throw ExceptionFactory.CreateException(error); - } - } - - /// - /// Retrieves all the supported languages. - /// A language is specified as an ISO 3166 alpha-2 two letter country-code - /// followed by ISO 639-1 for the two-letter language code. - /// For example, "ko_KR" for Korean, "en_US" for American English. - /// - /// 3 - /// - /// http://tizen.org/privilege/recorder - /// - /// - /// public - /// - /// - /// http://tizen.org/feature/speech.control - /// http://tizen.org/feature/microphone - /// - /// This exception can be due to an invalid state. - /// This exception can be due to operation failed. - /// This exception can be due to not supported. - /// This exception can be due to permission denied. - ///
-        /// The state must be ready or initialized.
-        /// 
- public static IEnumerable GetSupportedLanguages() - { - s_supportedLanguages = new List(); - s_supportedLanguagesCb = (IntPtr language, IntPtr userData) => - { - string languageStr = Marshal.PtrToStringAnsi(language); - s_supportedLanguages.Add(languageStr); - return true; - }; - ErrorCode error = VcForeachSupportedLanguages(s_supportedLanguagesCb, IntPtr.Zero); - if (error != ErrorCode.None) - { - Log.Error(LogTag, "GetSupportedLanguages Failed with error " + error); - throw ExceptionFactory.CreateException(error); - } - - return s_supportedLanguages; - } - - /// - /// Gets the system command list. - /// - /// 3 - /// - /// The command list, else null in case of no system commands. - /// - /// - /// http://tizen.org/privilege/recorder - /// - /// - /// public. - /// - /// - /// http://tizen.org/feature/speech.control - /// http://tizen.org/feature/microphone - /// - /// - /// In the system command list, there are system commands predefined by product manufacturers. - /// Those commands have the highest priority. Therefore, the user cannot set any commands similar to system commands. - /// - /// This exception can be due to an invalid state. - /// This exception can be due to operation failed. - /// This exception can be due to not supported. - /// This exception can be due to permission denied. - ///
-        /// The state must be ready.
-        /// 
- public static VoiceCommandList GetSystemCommandList() - { - IntPtr handle = IntPtr.Zero; - ErrorCode error = VcGetSystemCommandList(out handle); - if (error != ErrorCode.None) - { - Log.Error(LogTag, "GetSystemCommandList Failed with error " + error); - throw ExceptionFactory.CreateException(error); - } - - if (handle == IntPtr.Zero) - { - Log.Error(LogTag, "GetSystemCommandList handle is null"); - return null; - } - - SafeCommandListHandle list = new SafeCommandListHandle(handle); - return new VoiceCommandList(list); - } - - /// - /// Requests to start the dialogue. - /// By using this function, the developer can start requesting the dialogue to the framework. - /// When the developer requests the dialogue, two types of texts, dispText and uttText can be sent by this function. dispText is a text for displaying and uttText is that for uttering. - /// For example, if dispText is "October 10th" and uttText is "Today is October 10th.", "October 10th" will be displayed on the screen and "Today is October 10th." will be spoken. - /// Also, the developer can set whether the dialogue starts automatically or not, using autoStart. - /// If the developer sets autoStart as True, the framework will start to record the next speech and continue the dialogue. - /// - /// 3 - /// - /// http://tizen.org/privilege/recorder - /// - /// - /// public - /// - /// - /// http://tizen.org/feature/speech.control - /// http://tizen.org/feature/microphone - /// - /// - /// If autoStart is True, the recognition will start again. In this case, it can be restarted up to 4 times. - /// - /// Text to be displayed on the screen. - /// Text to be spoken. - /// A variable for setting whether the dialog session will be restarted automatically or not. - /// This exception can be due to an invalid state. - /// This exception can be due to an invalid parameter. - /// This exception can be due to not supported. - /// This exception can be due to permission denied. - ///
-        /// The state must be ready.
-        /// 
- public static void RequestDialog(string dispText, string uttText, bool autoStart) - { - ErrorCode error = VcRequestDialog(dispText, uttText, autoStart); - if (error != ErrorCode.None) - { - Log.Error(LogTag, "RequestDialog Failed with error " + error); - throw ExceptionFactory.CreateException(error); - } - } - - /// - /// Sets the command list. - /// - /// 3 - /// - /// http://tizen.org/privilege/recorder - /// - /// - /// public - /// - /// - /// http://tizen.org/feature/speech.control - /// http://tizen.org/feature/microphone - /// - /// - /// The command type is valid for CommandType 'Foreground' or 'Background'. - /// The matched commands of the command list should be set and they should include type and command text at least. - /// - /// Command list - /// Command type - /// This exception can be due to an invalid state. - /// This exception can be due to an invalid parameter. - /// This exception can be due to not supported. - /// This exception can be due to permission denied. - ///
-        /// The state must be ready.
-        /// 
- public static void SetCommandList(VoiceCommandList list, CommandType type) - { - if ((type == CommandType.Foreground) || (type == CommandType.Background)) - { - ErrorCode error = VcSetCommandList(list._handle, (VoiceCommandType)type); - if (error != ErrorCode.None) - { - Log.Error(LogTag, "SetCommandList Failed with error " + error); - throw ExceptionFactory.CreateException(error); - } - } - - else - { - throw ExceptionFactory.CreateException(ErrorCode.InvalidParameter); - } - } - - /// - /// Unsets the command list. - /// - /// 3 - /// - /// http://tizen.org/privilege/recorder - /// - /// - /// public - /// - /// - /// http://tizen.org/feature/speech.control - /// http://tizen.org/feature/microphone - /// - /// Command type - /// This exception can be due to an invalid state. - /// This exception can be due to an invalid parameter. - /// This exception can be due to not supported. - /// This exception can be due to permission denied. - ///
-        /// The state should be ready.
-        /// 
- public static void UnsetCommandList(CommandType type) - { - if ((type == CommandType.Foreground) || (type == CommandType.Background)) - { - VoiceCommandType commandType = VoiceCommandType.Foreground; - if (type == CommandType.Background) - commandType = VoiceCommandType.BackGround; - ErrorCode error = VcUnsetCommandList(commandType); - if (error != ErrorCode.None) - { - Log.Error(LogTag, "UnsetCommandList Failed with error " + error); - throw ExceptionFactory.CreateException(error); - } - } - - else - { - throw ExceptionFactory.CreateException(ErrorCode.InvalidParameter); - } - } - - /// - /// Gets the recognition result. - /// - /// 3 - /// - /// http://tizen.org/privilege/recorder - /// - /// - /// public - /// - /// - /// http://tizen.org/feature/speech.control - /// http://tizen.org/feature/microphone - /// - /// This exception can be due to an invalid state. - /// This exception can be due to an invalid parameter. - /// This exception can be due to not supported. - /// The recognition result if possible, else a null object. - ///
-        /// The state must be ready.
-        /// 
- public static RecognitionResult GetResult() - { - s_recognitionResult = null; - s_resultCb = (ResultEvent evt, IntPtr cmdList, IntPtr result, IntPtr userData) => - { - s_recognitionResult = new RecognitionResult(evt, cmdList, result); - }; - ErrorCode error = VcGetResult(s_resultCb, IntPtr.Zero); - if (error != ErrorCode.None) - { - Log.Error(LogTag, "GetResult Failed with error " + error); - throw ExceptionFactory.CreateException(error); - } - - return s_recognitionResult; - } - - /// - /// Event to be invoked when the recognition is done. - /// - /// 3 - ///
-        /// The state must be initialized.
-        /// 
- public static event EventHandler RecognitionResult - { - add - { - s_resultDelegate = (ResultEvent evt, IntPtr cmdList, IntPtr result, IntPtr userData) => - { - Log.Info(LogTag, "Recognition Result Event Triggered"); - if ((cmdList != null) && (result != null)) - { - RecognitionResultEventArgs args = new RecognitionResultEventArgs(new RecognitionResult( evt, cmdList, result)); - _recognitionResult?.Invoke(null, args); - } - else - { - Log.Info(LogTag, "Recognition Result Event null received"); - } - }; - ErrorCode error = VcSetResultCb(s_resultDelegate, IntPtr.Zero); - if (error != ErrorCode.None) - { - Log.Error(LogTag, "Add RecognitionResult Failed with error " + error); - } - else - { - _recognitionResult += value; - } - } - - remove - { - ErrorCode error = VcUnsetResultCb(); - if (error != ErrorCode.None) - { - Log.Error(LogTag, "Remove RecognitionResult Failed with error " + error); - } - - _recognitionResult -= value; - } - } - - /// - /// Event to be invoked when the VoiceControl service state changes. - /// - /// 3 - ///
-        /// The state must be initialized.
-        /// 
- public static event EventHandler ServiceStateChanged - { - add - { - s_serviceStateDelegate = (ServiceState previous, ServiceState current, IntPtr userData) => - { - ServiceStateChangedEventArgs args = new ServiceStateChangedEventArgs(previous, current); - _serviceStateChanged?.Invoke(null, args); - }; - ErrorCode error = VcSetServiceStateChangedCb(s_serviceStateDelegate, IntPtr.Zero); - if (error != ErrorCode.None) - { - Log.Error(LogTag, "Add ServiceStateChanged Failed with error " + error); - } - else - { - _serviceStateChanged += value; - } - } - - remove - { - ErrorCode error = VcUnsetServiceStateChangedCb(); - if (error != ErrorCode.None) - { - Log.Error(LogTag, "Remove ServiceStateChanged Failed with error " + error); - } - - _serviceStateChanged -= value; - } - } - - /// - /// Event to be invoked when the VoiceControl client state changes. - /// - /// 3 - ///
-        /// The state must be initialized.
-        /// 
- public static event EventHandler StateChanged - { - add - { - s_stateDelegate = (State previous, State current, IntPtr userData) => - { - StateChangedEventArgs args = new StateChangedEventArgs(previous, current); - _stateChanged?.Invoke(null, args); - }; - ErrorCode error = VcSetStateChangedCb(s_stateDelegate, IntPtr.Zero); - if (error != ErrorCode.None) - { - Log.Error(LogTag, "Add StateChanged Failed with error " + error); - } - else - { - _stateChanged += value; - } - } - - remove - { - ErrorCode error = VcUnsetStateChangedCb(); - if (error != ErrorCode.None) - { - Log.Error(LogTag, "Remove StateChanged Failed with error " + error); - } - - _stateChanged -= value; - } - } - - /// - /// Event to be invoked when an error occurs. - /// - /// 3 - ///
-        /// The state must be initialized.
-        /// 
- public static event EventHandler ErrorOccured - { - add - { - s_errorDelegate = (ErrorCode reason, IntPtr userData) => - { - ErrorOccuredEventArgs args = new ErrorOccuredEventArgs(reason); - _errorOccured?.Invoke(null, args); - }; - ErrorCode error = VcSetErrorCb(s_errorDelegate, IntPtr.Zero); - if (error != ErrorCode.None) - { - Log.Error(LogTag, "Add ErrorOccured Failed with error " + error); - } - - else - { - _errorOccured += value; - } - } - - - remove - { - ErrorCode error = VcUnsetErrorCb(); - if (error != ErrorCode.None) - { - Log.Error(LogTag, "Remove ErrorOccured Failed with error " + error); - } - - _errorOccured -= value; - } - } - - /// - /// Event to be invoked when the default language changes. - /// - /// 3 - ///
-        /// The state must be initialized.
-        /// 
- public static event EventHandler CurrentLanguageChanged - { - add - { - s_languageDelegate = (IntPtr previousLanguage, IntPtr currentLanguage, IntPtr userData) => - { - string previousLanguageString = Marshal.PtrToStringAnsi(previousLanguage); - string currentLanguageString = Marshal.PtrToStringAnsi(currentLanguage); - CurrentLanguageChangedEventArgs args = new CurrentLanguageChangedEventArgs(previousLanguageString, currentLanguageString); - _currentLanguageChanged?.Invoke(null, args); - }; - ErrorCode error = VcSetCurrentLanguageChangedCb(s_languageDelegate, IntPtr.Zero); - if (error != ErrorCode.None) - { - Log.Error(LogTag, "Add CurrentLanguageChanged Failed with error " + error); - } - - else - { - _currentLanguageChanged += value; - } - } - - remove - { - ErrorCode error = VcUnsetCurrentLanguageChangedCb(); - if (error != ErrorCode.None) - { - Log.Error(LogTag, "Remove CurrentLanguageChanged Failed with error " + error); - } - - _currentLanguageChanged -= value; - } - } - } -} diff --git a/src/Tizen.WebView/Interop/Interop.ChromiumEwk.Context.cs b/src/Tizen.WebView/Interop/Interop.ChromiumEwk.Context.cs deleted file mode 100644 index 7930e1c21..000000000 --- a/src/Tizen.WebView/Interop/Interop.ChromiumEwk.Context.cs +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2017 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 ChromiumEwk - { - public enum CacheModel - { - DocumentViewer, - DocumentBrowser, - PrimaryWebBrowser - } - - [DllImport(Libraries.ChromiumEwk)] - internal static extern IntPtr ewk_context_cookie_manager_get(IntPtr context); - - [DllImport(Libraries.ChromiumEwk)] - [return: MarshalAs(UnmanagedType.U1)] - internal static extern bool ewk_context_cache_model_set(IntPtr context, CacheModel model); - - [DllImport(Libraries.ChromiumEwk)] - internal static extern CacheModel ewk_context_cache_model_get(IntPtr context); - } -} diff --git a/src/Tizen.WebView/Interop/Interop.ChromiumEwk.CookieManager.cs b/src/Tizen.WebView/Interop/Interop.ChromiumEwk.CookieManager.cs deleted file mode 100644 index 23fb70e40..000000000 --- a/src/Tizen.WebView/Interop/Interop.ChromiumEwk.CookieManager.cs +++ /dev/null @@ -1,46 +0,0 @@ -/* - * Copyright (c) 2017 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 ChromiumEwk - { - public enum CookieAcceptPolicy - { - Always, - Never, - NoThirdParty - } - - public enum CookiePersistentStorage - { - Text, - SqlLite - } - - [DllImport(Libraries.ChromiumEwk)] - internal static extern void ewk_cookie_manager_accept_policy_set(IntPtr manager, CookieAcceptPolicy policy); - - [DllImport(Libraries.ChromiumEwk)] - internal static extern void ewk_cookie_manager_cookies_clear(IntPtr manager); - - [DllImport(Libraries.ChromiumEwk)] - internal static extern void ewk_cookie_manager_persistent_storage_set(IntPtr manager, string path, CookiePersistentStorage storage); - } -} diff --git a/src/Tizen.WebView/Interop/Interop.ChromiumEwk.Error.cs b/src/Tizen.WebView/Interop/Interop.ChromiumEwk.Error.cs deleted file mode 100644 index 7d22a3d81..000000000 --- a/src/Tizen.WebView/Interop/Interop.ChromiumEwk.Error.cs +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) 2017 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 ChromiumEwk - { - [DllImport(Libraries.ChromiumEwk, EntryPoint = "ewk_error_url_get", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true, CharSet = CharSet.Ansi)] - internal static extern IntPtr _ewk_error_url_get(IntPtr error); - - internal static string ewk_error_url_get(IntPtr error) - { - IntPtr ptr = _ewk_error_url_get(error); - return Marshal.PtrToStringAnsi(ptr); - } - - [DllImport(Libraries.ChromiumEwk)] - internal static extern int ewk_error_code_get(IntPtr error); - - [DllImport(Libraries.ChromiumEwk, EntryPoint = "ewk_error_description_get", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true, CharSet = CharSet.Ansi)] - internal static extern IntPtr _ewk_error_description_get(IntPtr error); - - internal static string ewk_error_description_get(IntPtr error) - { - IntPtr ptr = _ewk_error_description_get(error); - return Marshal.PtrToStringAnsi(ptr); - } - - [DllImport(Libraries.ChromiumEwk)] - [return: MarshalAs(UnmanagedType.U1)] - internal static extern bool ewk_error_cancellation_get(IntPtr error); - } -} diff --git a/src/Tizen.WebView/Interop/Interop.ChromiumEwk.Settings.cs b/src/Tizen.WebView/Interop/Interop.ChromiumEwk.Settings.cs deleted file mode 100644 index ab7a5efe0..000000000 --- a/src/Tizen.WebView/Interop/Interop.ChromiumEwk.Settings.cs +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) 2017 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 ChromiumEwk - { - [DllImport(Libraries.ChromiumEwk)] - [return: MarshalAs(UnmanagedType.U1)] - internal static extern bool ewk_settings_javascript_enabled_set(IntPtr settings, bool enable); - - [DllImport(Libraries.ChromiumEwk)] - [return: MarshalAs(UnmanagedType.U1)] - internal static extern bool ewk_settings_javascript_enabled_get(IntPtr settings); - - [DllImport(Libraries.ChromiumEwk)] - [return: MarshalAs(UnmanagedType.U1)] - internal static extern bool ewk_settings_loads_images_automatically_set(IntPtr settings, bool enable); - - [DllImport(Libraries.ChromiumEwk)] - [return: MarshalAs(UnmanagedType.U1)] - internal static extern bool ewk_settings_loads_images_automatically_get(IntPtr settings); - - [DllImport(Libraries.ChromiumEwk)] - [return: MarshalAs(UnmanagedType.U1)] - internal static extern bool ewk_settings_default_text_encoding_name_set(IntPtr settings, string encoding); - - [DllImport(Libraries.ChromiumEwk, EntryPoint = "ewk_settings_default_text_encoding_name_get", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true, CharSet = CharSet.Ansi)] - internal static extern IntPtr _ewk_settings_default_text_encoding_name_get(IntPtr settings); - - internal static string ewk_settings_default_text_encoding_name_get(IntPtr settings) - { - IntPtr ptr = _ewk_settings_default_text_encoding_name_get(settings); - return Marshal.PtrToStringAnsi(ptr); - } - - [DllImport(Libraries.ChromiumEwk)] - [return: MarshalAs(UnmanagedType.U1)] - internal static extern bool ewk_settings_default_font_size_set(IntPtr settings, int size); - - [DllImport(Libraries.ChromiumEwk)] - internal static extern int ewk_settings_default_font_size_get(IntPtr settings); - } -} diff --git a/src/Tizen.WebView/Interop/Interop.ChromiumEwk.View.cs b/src/Tizen.WebView/Interop/Interop.ChromiumEwk.View.cs deleted file mode 100644 index 75a50ccc8..000000000 --- a/src/Tizen.WebView/Interop/Interop.ChromiumEwk.View.cs +++ /dev/null @@ -1,127 +0,0 @@ -/* - * Copyright (c) 2017 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 ChromiumEwk - { - [DllImport(Libraries.ChromiumEwk)] - internal static extern IntPtr ewk_view_add(IntPtr evas); - - [DllImport(Libraries.ChromiumEwk)] - internal static extern IntPtr ewk_view_context_get(IntPtr obj); - - [DllImport(Libraries.ChromiumEwk)] - internal static extern IntPtr ewk_view_settings_get(IntPtr obj); - - [DllImport(Libraries.ChromiumEwk)] - [return: MarshalAs(UnmanagedType.U1)] - internal static extern bool ewk_view_url_set(IntPtr obj, string url); - - [DllImport(Libraries.ChromiumEwk, EntryPoint = "ewk_view_url_get", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true, CharSet = CharSet.Ansi)] - internal static extern IntPtr _ewk_view_url_get(IntPtr obj); - - internal static string ewk_view_url_get(IntPtr obj) - { - IntPtr ptr = _ewk_view_url_get(obj); - return Marshal.PtrToStringAnsi(ptr); - } - - [DllImport(Libraries.ChromiumEwk)] - [return: MarshalAs(UnmanagedType.U1)] - internal static extern bool ewk_view_html_string_load(IntPtr obj, string html, string baseUrl, string unreachableUrl); - - [DllImport(Libraries.ChromiumEwk)] - [return: MarshalAs(UnmanagedType.U1)] - internal static extern bool ewk_view_reload(IntPtr obj); - - [DllImport(Libraries.ChromiumEwk)] - [return: MarshalAs(UnmanagedType.U1)] - internal static extern bool ewk_view_stop(IntPtr obj); - - [DllImport(Libraries.ChromiumEwk)] - [return: MarshalAs(UnmanagedType.U1)] - internal static extern bool ewk_view_back(IntPtr obj); - - [DllImport(Libraries.ChromiumEwk)] - [return: MarshalAs(UnmanagedType.U1)] - internal static extern bool ewk_view_forward(IntPtr obj); - - [DllImport(Libraries.ChromiumEwk)] - [return: MarshalAs(UnmanagedType.U1)] - internal static extern bool ewk_view_back_possible(IntPtr obj); - - [DllImport(Libraries.ChromiumEwk)] - [return: MarshalAs(UnmanagedType.U1)] - internal static extern bool ewk_view_forward_possible(IntPtr obj); - - internal delegate void ScriptExcuteCallback(IntPtr obj, IntPtr resultValue, IntPtr userData); - - [DllImport(Libraries.ChromiumEwk)] - [return: MarshalAs(UnmanagedType.U1)] - internal static extern bool ewk_view_script_execute(IntPtr obj, string script, ScriptExcuteCallback callback, IntPtr userData); - - [DllImport(Libraries.ChromiumEwk, EntryPoint = "ewk_view_title_get", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true, CharSet = CharSet.Ansi)] - internal static extern IntPtr _ewk_view_title_get(IntPtr obj); - - internal static string ewk_view_title_get(IntPtr obj) - { - IntPtr ptr = _ewk_view_title_get(obj); - return Marshal.PtrToStringAnsi(ptr); - } - - [DllImport(Libraries.ChromiumEwk, EntryPoint = "ewk_view_user_agent_get", CallingConvention = CallingConvention.Cdecl, ExactSpelling = true, CharSet = CharSet.Ansi)] - internal static extern IntPtr _ewk_view_user_agent_get(IntPtr obj); - - internal static string ewk_view_user_agent_get(IntPtr obj) - { - IntPtr ptr = _ewk_view_user_agent_get(obj); - return Marshal.PtrToStringAnsi(ptr); - } - - [DllImport(Libraries.ChromiumEwk)] - [return: MarshalAs(UnmanagedType.U1)] - internal static extern bool ewk_view_user_agent_set(IntPtr obj, string userAgent); - - [DllImport(Libraries.ChromiumEwk)] - [return: MarshalAs(UnmanagedType.U1)] - internal static extern bool ewk_view_focus_set(IntPtr obj, bool focused); - - [DllImport(Libraries.ChromiumEwk)] - [return: MarshalAs(UnmanagedType.U1)] - internal static extern bool ewk_view_focus_get(IntPtr obj); - - [StructLayout(LayoutKind.Sequential, CharSet =CharSet.Ansi)] - internal struct ScriptMessage - { - public IntPtr name; - public IntPtr body; - } - - internal delegate void ScriptMessageCallback(IntPtr obj, ScriptMessage message); - - [DllImport(Libraries.ChromiumEwk)] - [return: MarshalAs(UnmanagedType.U1)] - internal static extern bool ewk_view_javascript_message_handler_add(IntPtr obj, ScriptMessageCallback callback, string name); - - [DllImport(Libraries.ChromiumEwk)] - [return: MarshalAs(UnmanagedType.U1)] - internal static extern bool ewk_view_evaluate_javascript(IntPtr obj, string name, string result); - } -} diff --git a/src/Tizen.WebView/Interop/Interop.ChromiumEwk.cs b/src/Tizen.WebView/Interop/Interop.ChromiumEwk.cs deleted file mode 100644 index cd9ca31e4..000000000 --- a/src/Tizen.WebView/Interop/Interop.ChromiumEwk.cs +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (c) 2017 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 ChromiumEwk - { - [DllImport(Libraries.ChromiumEwk)] - internal static extern int ewk_init(); - - [DllImport(Libraries.ChromiumEwk)] - internal static extern int ewk_shutdown(); - } -} diff --git a/src/Tizen.WebView/Interop/Interop.Elementary.cs b/src/Tizen.WebView/Interop/Interop.Elementary.cs deleted file mode 100644 index e981fe209..000000000 --- a/src/Tizen.WebView/Interop/Interop.Elementary.cs +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2017 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 Elementary - { - [DllImport(Libraries.Elementary)] - internal static extern IntPtr elm_layout_add(IntPtr obj); - - [DllImport(Libraries.Elementary)] - [return: MarshalAs(UnmanagedType.U1)] - internal static extern bool elm_layout_theme_set(IntPtr obj, string klass, string group, string style); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_object_part_content_set(IntPtr obj, string part, IntPtr content); - - [DllImport(Libraries.Elementary)] - internal static extern void elm_object_focus_allow_set(IntPtr obj, bool enable); - } -} \ No newline at end of file diff --git a/src/Tizen.WebView/Interop/Interop.Evas.cs b/src/Tizen.WebView/Interop/Interop.Evas.cs deleted file mode 100644 index 52eef2c99..000000000 --- a/src/Tizen.WebView/Interop/Interop.Evas.cs +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2017 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 Evas - { - [DllImport(Libraries.Evas)] - internal static extern IntPtr evas_object_evas_get(IntPtr obj); - } -} diff --git a/src/Tizen.WebView/Interop/Interop.Libraries.cs b/src/Tizen.WebView/Interop/Interop.Libraries.cs deleted file mode 100644 index 7dab1c45a..000000000 --- a/src/Tizen.WebView/Interop/Interop.Libraries.cs +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2017 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 -{ - private static class Libraries - { - internal const string ChromiumEwk = "libchromium-ewk.so"; - internal const string Elementary = "libelementary.so.1"; - internal const string Evas = "libevas.so.1"; - } -} diff --git a/src/Tizen.WebView/Tizen.WebView.csproj b/src/Tizen.WebView/Tizen.WebView.csproj deleted file mode 100644 index 48e80f026..000000000 --- a/src/Tizen.WebView/Tizen.WebView.csproj +++ /dev/null @@ -1,11 +0,0 @@ - - - - netstandard2.0 - - - - - - - \ No newline at end of file diff --git a/src/Tizen.WebView/Tizen.WebView.sln b/src/Tizen.WebView/Tizen.WebView.sln deleted file mode 100755 index d4a4aaded..000000000 --- a/src/Tizen.WebView/Tizen.WebView.sln +++ /dev/null @@ -1,28 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26430.12 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen.WebView", "Tizen.WebView.csproj", "{8A77A6CA-543D-48CB-BBD8-1706EC47D57A}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ElmSharp", "..\ElmSharp\ElmSharp.csproj", "{2F66C9E2-BE24-4096-96DA-F86CCFBBB059}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {8A77A6CA-543D-48CB-BBD8-1706EC47D57A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {8A77A6CA-543D-48CB-BBD8-1706EC47D57A}.Debug|Any CPU.Build.0 = Debug|Any CPU - {8A77A6CA-543D-48CB-BBD8-1706EC47D57A}.Release|Any CPU.ActiveCfg = Release|Any CPU - {8A77A6CA-543D-48CB-BBD8-1706EC47D57A}.Release|Any CPU.Build.0 = Release|Any CPU - {2F66C9E2-BE24-4096-96DA-F86CCFBBB059}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {2F66C9E2-BE24-4096-96DA-F86CCFBBB059}.Debug|Any CPU.Build.0 = Debug|Any CPU - {2F66C9E2-BE24-4096-96DA-F86CCFBBB059}.Release|Any CPU.ActiveCfg = Release|Any CPU - {2F66C9E2-BE24-4096-96DA-F86CCFBBB059}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/src/Tizen.WebView/Tizen.WebView/Chromium.cs b/src/Tizen.WebView/Tizen.WebView/Chromium.cs deleted file mode 100644 index ca220ed9f..000000000 --- a/src/Tizen.WebView/Tizen.WebView/Chromium.cs +++ /dev/null @@ -1,42 +0,0 @@ -/* - * Copyright (c) 2017 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. - */ - -namespace Tizen.WebView -{ - /// - /// This class provides methods to initialize and shutdown Chromium-efl. - /// - public static class Chromium - { - /// - /// Initializes Chromium's instance. - /// - /// A reference count of Chromium's instance - public static int Initialize() - { - return Interop.ChromiumEwk.ewk_init(); - } - - /// - /// Decreases a reference count of WebKit's instance, possibly destroying it. - /// - /// A reference count of Chromium's instance - public static int Shutdown() - { - return Interop.ChromiumEwk.ewk_shutdown(); - } - } -} diff --git a/src/Tizen.WebView/Tizen.WebView/Context.cs b/src/Tizen.WebView/Tizen.WebView/Context.cs deleted file mode 100644 index 097da624a..000000000 --- a/src/Tizen.WebView/Tizen.WebView/Context.cs +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Copyright (c) 2017 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.WebView -{ - /// - /// Enumeration that contains option for cache model. - /// - public enum CacheModel - { - /// - /// Use the smallest cache capacity. - /// - DocumentViewer, - /// - /// Use bigger cache capacity than DocumentBrowser. - /// - DocumentBrowser, - /// - /// Use the biggest cache capacity. - /// - PrimaryWebBrowser - } - - /// - /// This class encapsulates all pages related to the specific use of Chromium-efl. - /// - /// - /// Applications have the option of creating a context different from the default one and using it for a group of pages. - /// All pages in the same context share the same preferences, visited link set, local storage, and so on. - /// - public class Context - { - private IntPtr _handle; - private CookieManager _cookieManager; - - internal Context(IntPtr handle) - { - _handle = handle; - } - - /// - /// The cache model. - /// - /// - /// The default cache model is DocumentViewer. - /// - public CacheModel CacheModel - { - get - { - return (CacheModel)Interop.ChromiumEwk.ewk_context_cache_model_get(_handle); - } - - set - { - Interop.ChromiumEwk.ewk_context_cache_model_set(_handle, (Interop.ChromiumEwk.CacheModel)value); - } - } - - /// - /// Gets the CookieManager object for this context. - /// - /// The CookieManager object - public CookieManager GetCookieManager() - { - if (_cookieManager == null) - { - IntPtr cookieManagerHandle = Interop.ChromiumEwk.ewk_context_cookie_manager_get(_handle); - if (cookieManagerHandle == IntPtr.Zero) - { - return null; - } - _cookieManager = new CookieManager(cookieManagerHandle); - } - return _cookieManager; - } - } -} diff --git a/src/Tizen.WebView/Tizen.WebView/CookieManager.cs b/src/Tizen.WebView/Tizen.WebView/CookieManager.cs deleted file mode 100644 index f7ed53805..000000000 --- a/src/Tizen.WebView/Tizen.WebView/CookieManager.cs +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright (c) 2017 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.WebView -{ - /// - /// Enumeration that contains accept policies for the cookies. - /// - public enum CookieAcceptPolicy - { - /// - /// Accepts every cookie sent from any page. - /// - Always, - /// - /// Rejects all cookies. - /// - Never, - /// - /// Accepts only cookies set by the main document loaded. - /// - NoThirdParty - } - - /// - /// Enumeration that creates a type name for the storage of persistent cookies. - /// - public enum CookiePersistentStorage - { - /// - /// Cookies are stored in a text file in the Mozilla "cookies.txt" format. - /// - Text, - /// - /// Cookies are stored in a SQLite file in the current Mozilla format. - /// - SqlLite - } - - /// - /// This class provides methods for the cookie manager. - /// - public class CookieManager - { - private IntPtr _handle; - - internal CookieManager(IntPtr handle) - { - _handle = handle; - } - - /// - /// Sets the cookie acceptance policy. - /// - /// - /// By default, only cookies set by the main document loaded are accepted. - /// - /// The cookie acceptance policy - public void SetCookieAcceptPolicy(CookieAcceptPolicy policy) - { - Interop.ChromiumEwk.ewk_cookie_manager_accept_policy_set(_handle, (Interop.ChromiumEwk.CookieAcceptPolicy)policy); - } - - /// - /// Deletes all the cookies. - /// - public void ClearCookies() - { - Interop.ChromiumEwk.ewk_cookie_manager_cookies_clear(_handle); - } - - /// - /// Sets the storage where non-session cookies are stored persistently to read/write the cookies. - /// - /// http://tizen.org/privilege/mediastorage - /// http://tizen.org/privilege/externalstorage - /// The path where to read/write Cookies - /// The type of storage - public void SetPersistentStorage(string path, CookiePersistentStorage storage) - { - Interop.ChromiumEwk.ewk_cookie_manager_persistent_storage_set(_handle, path, (Interop.ChromiumEwk.CookiePersistentStorage)storage); - } - } -} diff --git a/src/Tizen.WebView/Tizen.WebView/JavaScriptMessage.cs b/src/Tizen.WebView/Tizen.WebView/JavaScriptMessage.cs deleted file mode 100644 index 07454ed2a..000000000 --- a/src/Tizen.WebView/Tizen.WebView/JavaScriptMessage.cs +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Copyright (c) 2017 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; -using System.Text; - -namespace Tizen.WebView -{ - public delegate void JavaScriptMessageHandler(JavaScriptMessage message); - - /// - /// A Script message contains information that sent from JavaScript runtime. - /// - public class JavaScriptMessage - { - private string _name; - private IntPtr _body; - - internal JavaScriptMessage(Interop.ChromiumEwk.ScriptMessage message) - { - _name = Marshal.PtrToStringAnsi(message.name); - _body = message.body; - } - - /// - /// Obect name in JavaScript. - /// - public string Name - { - get - { - return _name; - } - } - - /// - /// Gets the value of body as integer type. - /// - /// The value of body as integer type - public int GetBodyAsInteger() - { - if (_body == IntPtr.Zero) - { - return 0; - } - return Marshal.ReadInt32(_body, 0); - } - - /// - /// Gets the value of body as double type. - /// - /// The value of body as double type - public double GetBodyAsDouble() - { - if (_body == IntPtr.Zero) - { - return 0d; - } - double[] ret = new double[1] ; - Marshal.Copy(_body, ret, 0, 1); - return ret[0]; - } - - /// - /// Gets the value of body as boolean type. - /// - /// The value of body as boolean type - public bool GetBodyAsBoolean() - { - if (_body == IntPtr.Zero) - { - return false; - } - return Marshal.ReadByte(_body) != (byte)0; - } - - /// - /// Gets the value of body as string type. - /// - /// The value of body as string type - public string GetBodyAsString() - { - if (_body == IntPtr.Zero) - { - return string.Empty; - } - return Marshal.PtrToStringAnsi(_body); - } - } -} diff --git a/src/Tizen.WebView/Tizen.WebView/Settings.cs b/src/Tizen.WebView/Tizen.WebView/Settings.cs deleted file mode 100644 index b9fcba360..000000000 --- a/src/Tizen.WebView/Tizen.WebView/Settings.cs +++ /dev/null @@ -1,97 +0,0 @@ -/* - * Copyright (c) 2017 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.WebView -{ - /// - /// This class provides properties for setting the preference of a specific WebView. - /// - public class Settings - { - private IntPtr _handle; - - internal Settings(IntPtr handle) - { - _handle = handle; - } - - /// - /// Whether JavaScript can be executable. - /// - public bool JavaScriptEnabled - { - get - { - return Interop.ChromiumEwk.ewk_settings_javascript_enabled_get(_handle); - } - - set - { - Interop.ChromiumEwk.ewk_settings_javascript_enabled_set(_handle, value); - } - } - - /// - /// Whether images can be loaded automatically. - /// - public bool LoadImageAutomatically - { - get - { - return Interop.ChromiumEwk.ewk_settings_loads_images_automatically_get(_handle); - } - - set - { - Interop.ChromiumEwk.ewk_settings_loads_images_automatically_set(_handle, value); - } - } - - /// - /// The default text encoding name. - /// - public string DefaultTextEncodingName - { - get - { - return Interop.ChromiumEwk.ewk_settings_default_text_encoding_name_get(_handle); - } - - set - { - Interop.ChromiumEwk.ewk_settings_default_text_encoding_name_set(_handle, value); - } - } - - /// - /// The default font size of a pixel. - /// - public int DefaultFontSize - { - get - { - return Interop.ChromiumEwk.ewk_settings_default_font_size_get(_handle); - } - - set - { - Interop.ChromiumEwk.ewk_settings_default_font_size_set(_handle, value); - } - } - } -} diff --git a/src/Tizen.WebView/Tizen.WebView/SmartCallbackArgs.cs b/src/Tizen.WebView/Tizen.WebView/SmartCallbackArgs.cs deleted file mode 100644 index 9e0f01dd5..000000000 --- a/src/Tizen.WebView/Tizen.WebView/SmartCallbackArgs.cs +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Copyright (c) 2017 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; - -namespace Tizen.WebView -{ - /// - /// Argument from the SmartCallback. - /// - public class SmartCallbackArgs : EventArgs - { - private IntPtr _arg; - - internal SmartCallbackArgs(IntPtr arg) - { - _arg = arg; - } - - /// - /// Gets argument as integer type. - /// - /// Argument as integer type - public int GetAsInteger() - { - if (_arg == IntPtr.Zero) - { - return 0; - } - return Marshal.ReadInt32(_arg, 0); - } - - /// - /// Gets argument as double type. - /// - /// Argument as double type - public double GetAsDouble() - { - if (_arg == IntPtr.Zero) - { - return 0d; - } - double[] ret = new double[1]; - Marshal.Copy(_arg, ret, 0, 1); - return ret[0]; - } - - /// - /// Gets argument as boolean type. - /// - /// Argument as boolean type - public bool GetAsBoolean() - { - if (_arg == IntPtr.Zero) - { - return false; - } - return Marshal.ReadByte(_arg) != (byte)0; - } - - /// - /// Gets argument as string type. - /// - /// Argument as string type - public string GetAsString() - { - if (_arg == IntPtr.Zero) - { - return string.Empty; - } - return Marshal.PtrToStringAnsi(_arg); - } - - internal static SmartCallbackArgs CreateFromSmartEvent(IntPtr data, IntPtr obj, IntPtr info) - { - return new SmartCallbackArgs(info); - } - } -} diff --git a/src/Tizen.WebView/Tizen.WebView/SmartCallbackLoadErrorArgs.cs b/src/Tizen.WebView/Tizen.WebView/SmartCallbackLoadErrorArgs.cs deleted file mode 100644 index 28323bb0d..000000000 --- a/src/Tizen.WebView/Tizen.WebView/SmartCallbackLoadErrorArgs.cs +++ /dev/null @@ -1,150 +0,0 @@ -/* - * Copyright (c) 2017 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; - -namespace Tizen.WebView -{ - /// - /// Enumeration that provides an option to error codes. - /// - public enum LoadErrorCode - { - /// - /// Unknown - /// - Unknown = 0, - /// - /// User canceled - /// - Canceled, - /// - /// Can't show page for this MIME Type. - /// - CantSupportMimetype, - /// - /// File IO error - /// - FailedFileIo, - /// - /// Cannot connect to network. - /// - CantConnect, - /// - /// Fail to look up host from DNS. - /// - CantLookupHost, - /// - /// Fail to SSL/TLS handshake. - /// - FailedTlsHandshake, - /// - /// Received certificate is invalid. - /// - InvalidCertificate, - /// - /// Connection timeout - /// - RequestTimeout, - /// - /// Too many redirects - /// - TooManyRedirects, - /// - /// Too many requests during this load - /// - TooManyRequests, - /// - /// Malformed url - /// - BadUrl, - /// - /// Unsupported scheme - /// - UnsupportedScheme, - /// - /// User authentication failed on server - /// - Authentication, - /// - /// Web server has internal server error. - /// - InternalServer, - } - - /// - /// Argument from the LoadError SmartCallback. - /// - public class SmartCallbackLoadErrorArgs : EventArgs - { - IntPtr _handle; - - internal SmartCallbackLoadErrorArgs(IntPtr handle) - { - _handle = handle; - } - - /// - /// Failing URL for the error. - /// - public string Url - { - get - { - return Interop.ChromiumEwk.ewk_error_url_get(_handle); - } - } - - /// - /// The error code. - /// - public LoadErrorCode Code - { - get - { - return (LoadErrorCode)Interop.ChromiumEwk.ewk_error_code_get(_handle); - } - } - - /// - /// The description for the error. - /// - public string Description - { - get - { - return Interop.ChromiumEwk.ewk_error_description_get(_handle); - } - } - - /// - /// Whether the error should be treated as a cancellation. - /// - public bool Cancellation - { - get - { - return Interop.ChromiumEwk.ewk_error_cancellation_get(_handle); - } - } - - internal static SmartCallbackLoadErrorArgs CreateFromSmartEvent(IntPtr data, IntPtr obj, IntPtr info) - { - return new SmartCallbackLoadErrorArgs(info); - } - } -} diff --git a/src/Tizen.WebView/Tizen.WebView/WebView.cs b/src/Tizen.WebView/Tizen.WebView/WebView.cs deleted file mode 100644 index 3b30cd8a8..000000000 --- a/src/Tizen.WebView/Tizen.WebView/WebView.cs +++ /dev/null @@ -1,342 +0,0 @@ -/* - * Copyright (c) 2017 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 ElmSharp; -using System; -using System.Collections.Generic; -using System.Runtime.InteropServices; - -namespace Tizen.WebView -{ - /// - /// A view used to render web contents. - /// - public class WebView: EvasObject - { - private static IDictionary _javaScriptMessageHandlerMap = new Dictionary(); - - private IntPtr _handle; - private IntPtr _realHandle; - private Context _context; - private Settings _settings; - - // focus dummy - private SmartEvent _focusIn; - private SmartEvent _focusOut; - - // Smart events - private SmartEvent _loadStarted; - private SmartEvent _loadFinished; - private SmartEvent _loadError; - private SmartEvent _titleChanged; - private SmartEvent _urlChanged; - - - - /// - /// Event that occurs when load started. - /// - public event EventHandler LoadStarted; - - /// - /// Event that occurs when load finished. - /// - public event EventHandler LoadFinished; - - /// - /// Event that occurs when load error. - /// - public event EventHandler LoadError; - - /// - /// Event that occurs when title of main frame was changed. - /// - public event EventHandler TitleChanged; - - /// - /// Event that occurs when URL of main frame was changed. - /// - public event EventHandler UrlChanged; - - /// - /// Current URL of the main frame. - /// - public string Url - { - get - { - return Interop.ChromiumEwk.ewk_view_url_get(_realHandle); - } - } - - /// - /// Current title of the main frame. - /// - public string Title - { - get - { - return Interop.ChromiumEwk.ewk_view_title_get(_realHandle); - } - } - - /// - /// Current user agent string of this view. - /// - public string UserAgent - { - get - { - return Interop.ChromiumEwk.ewk_view_user_agent_get(_realHandle); - } - - set - { - Interop.ChromiumEwk.ewk_view_user_agent_set(_realHandle, value); - } - } - - /// - /// Whether a view has the focus. - /// - public bool HasFocus - { - get - { - return Interop.ChromiumEwk.ewk_view_focus_get(_realHandle); - } - } - - /// - /// Create a WebView object. - /// - /// Parent object of WebView - public WebView(EvasObject parent) : base(parent) - { - InitializeSmartEvent(); - } - - /// - /// Gets the Context object of this view. - /// - /// The Context object of this view - public Context GetContext() - { - if (_context == null) - { - IntPtr contextHandle = Interop.ChromiumEwk.ewk_view_context_get(_realHandle); - if (contextHandle == IntPtr.Zero) - { - return null; - } - _context = new Context(contextHandle); - } - return _context; - } - - /// - /// Gets the Settings object of this view. - /// - /// The Settings object of this view - public Settings GetSettings() - { - if (_settings == null) - { - IntPtr settingsHandle = Interop.ChromiumEwk.ewk_view_settings_get(_realHandle); - if (settingsHandle == IntPtr.Zero) - { - return null; - } - _settings = new Settings(settingsHandle); - } - return _settings; - } - - /// - /// Asks the object to load the given URL. - /// - /// - /// You can only be sure that url changed after UrlChanged event. - /// - /// The uniform resource identifier to load - public void LoadUrl(string url) - { - Interop.ChromiumEwk.ewk_view_url_set(_realHandle, url); - } - - /// - /// Loads the specified html string as the content of the view. - /// - /// HTML data to load - /// Base URL used for relative paths to external objects - public void LoadHtml(string html, string baseUrl) - { - Interop.ChromiumEwk.ewk_view_html_string_load(_realHandle, html, baseUrl, null); - } - - /// - /// Asks the main frame to stop loading. - /// - public void StopLoading() - { - Interop.ChromiumEwk.ewk_view_stop(_realHandle); - } - - /// - /// Asks the main frame to reload the current document. - /// - public void Reload() - { - Interop.ChromiumEwk.ewk_view_reload(_realHandle); - } - - /// - /// Asks the main frame to navigate back in history. - /// - public void GoBack() - { - Interop.ChromiumEwk.ewk_view_back(_realHandle); - } - - /// - /// Asks the main frame to navigate forward in history. - /// - public void GoForward() - { - Interop.ChromiumEwk.ewk_view_forward(_realHandle); - } - - /// - /// Checks whether it is possible to navigate backwards one item in history. - /// - /// Whether it is possible to navigate backwards one item in history - public bool CanGoBack() - { - return Interop.ChromiumEwk.ewk_view_back_possible(_realHandle); - } - - /// - /// Checks whether it is possible to navigate forwards one item in history. - /// - /// Whether it is possible to navigate forwards one item in history - public bool CanGoForward() - { - return Interop.ChromiumEwk.ewk_view_forward_possible(_realHandle); - } - - /// - /// Injects the supplied javascript message handler into the view. - /// - /// The message callback - /// The name used to expose the object in JavaScript - /// 'true' on success, otherwise 'false' - public bool AddJavaScriptMessageHandler(string name, JavaScriptMessageHandler handler) - { - lock (_javaScriptMessageHandlerMap) - { - if (_javaScriptMessageHandlerMap.ContainsKey(name)) - { - return false; - } - _javaScriptMessageHandlerMap[name] = handler; - } - Interop.ChromiumEwk.ScriptMessageCallback callback = (handle, message) => - { - JavaScriptMessage convertedMessage = new JavaScriptMessage(message); - lock (_javaScriptMessageHandlerMap) - { - if (_javaScriptMessageHandlerMap.ContainsKey(convertedMessage.Name)) - { - _javaScriptMessageHandlerMap[convertedMessage.Name](convertedMessage); - } - } - }; - if (!Interop.ChromiumEwk.ewk_view_javascript_message_handler_add(_realHandle, callback, name)) - { - lock (_javaScriptMessageHandlerMap) - { - _javaScriptMessageHandlerMap.Remove(name); - return false; - } - } - return true; - } - - /// - /// Requests the execution of given name and result to the JavaScript runtime. - /// - /// The name used to expose the object in JavaScript - /// The result to the JavaScript runtime - public void EvalWithResult(string name, string result) - { - Interop.ChromiumEwk.ewk_view_evaluate_javascript(_realHandle, name, result); - } - - /// - /// Requests the execution of the given script. - /// - /// The JavaScript code string to execute - public void Eval(string script) - { - Interop.ChromiumEwk.ewk_view_script_execute(_realHandle, script, null, IntPtr.Zero); - } - - /// - /// Requests to set or unset a view as the currently focused one. - /// - /// 'true' to set the focus on the view, 'false' to remove the focus from the view - public void SetFocus(bool focused) - { - Interop.ChromiumEwk.ewk_view_focus_set(_realHandle, focused); - } - - protected override IntPtr CreateHandle(EvasObject parent) - { - // focus dummy - _handle = Interop.Elementary.elm_layout_add((IntPtr)parent); - Interop.Elementary.elm_layout_theme_set(_handle, "layout", "elm_widget", "default"); - Interop.Elementary.elm_object_focus_allow_set(_handle, true); - - IntPtr evas = Interop.Evas.evas_object_evas_get(parent); - _realHandle = Interop.ChromiumEwk.ewk_view_add(evas); - Interop.Elementary.elm_object_part_content_set(_handle, "elm.swallow.content", _realHandle); - - return _handle; - } - - private void InitializeSmartEvent() - { - // focus dummy - _focusIn = new SmartEvent(this, "focused"); - _focusOut = new SmartEvent(this, "unfocused"); - - _focusIn.On += (s, e) => { ((WebView)s).SetFocus(true); }; - _focusOut.On += (s, e) => { ((WebView)s).SetFocus(false); }; - - _loadStarted = new SmartEvent(this, _realHandle, "load,started"); - _loadFinished = new SmartEvent(this, _realHandle, "load,finished"); - _loadError = new SmartEvent(this, _realHandle, "load,error", SmartCallbackLoadErrorArgs.CreateFromSmartEvent); - _titleChanged = new SmartEvent(this, _realHandle, "title,changed", SmartCallbackArgs.CreateFromSmartEvent); - _urlChanged = new SmartEvent(this, _realHandle, "url,changed", SmartCallbackArgs.CreateFromSmartEvent); - - _loadStarted.On += (s, e) => { LoadStarted?.Invoke(this, EventArgs.Empty); }; - _loadFinished.On += (s, e) => { LoadFinished?.Invoke(this, EventArgs.Empty); }; - _loadError.On += (s, e) => { LoadError?.Invoke(this, e); }; - _titleChanged.On += (s, e) => { TitleChanged?.Invoke(this, e); }; - _urlChanged.On += (s, e) => { UrlChanged?.Invoke(this, e); }; - } - } -} diff --git a/src/Tizen/Interop/Interop.CommonError.cs b/src/Tizen/Interop/Interop.CommonError.cs deleted file mode 100644 index 284ba22d7..000000000 --- a/src/Tizen/Interop/Interop.CommonError.cs +++ /dev/null @@ -1,35 +0,0 @@ -/* - * 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 Libraries - { - public const string Base = "libcapi-base-common.so.0"; - } - - internal static partial class CommonError - { - [DllImport(Libraries.Base, EntryPoint = "get_last_result")] - internal static extern int GetLastResult(); - - [DllImport(Libraries.Base, EntryPoint = "get_error_message")] - internal static extern IntPtr GetErrorMessage(int errorCode); - } -} diff --git a/src/Tizen/Interop/Interop.Dlog.cs b/src/Tizen/Interop/Interop.Dlog.cs deleted file mode 100644 index 697daa1b4..000000000 --- a/src/Tizen/Interop/Interop.Dlog.cs +++ /dev/null @@ -1,48 +0,0 @@ -/* - * 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.Runtime.InteropServices; - -internal static partial class Interop -{ - internal static partial class Libraries - { - public const string Dlog = "libdlog.so.0"; - } - - internal static partial class Dlog - { - internal enum LogPriority - { - DLOG_UNKNOWN = 0, - DLOG_DEFAULT, - DLOG_VERBOSE, - DLOG_DEBUG, - DLOG_INFO, - DLOG_WARN, - DLOG_ERROR, - DLOG_FATAL, - DLOG_SILENT, - DLOG_PRIO_MAX, - } - [DllImportAttribute(Libraries.Dlog, EntryPoint = "dlog_print", CallingConvention = CallingConvention.Cdecl)] - internal static extern int Print(LogPriority prio, string tag, string fmt, string msg); - - [DllImportAttribute(Libraries.Dlog, EntryPoint = "dlog_print", CallingConvention = CallingConvention.Cdecl)] - internal static extern int Print(LogPriority prio, string tag, string fmt, string file, string func, int line, string msg); - } -} - diff --git a/src/Tizen/Tizen.Common/Color.cs b/src/Tizen/Tizen.Common/Color.cs deleted file mode 100644 index 53224aead..000000000 --- a/src/Tizen/Tizen.Common/Color.cs +++ /dev/null @@ -1,349 +0,0 @@ -/* - * 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 -{ - /// - /// Structure that represents a color as RGBA. - /// - public struct Color : IEquatable - { - /// - /// Empty color instance. All components are 0. - /// - public static readonly Color Empty = FromRgba(0, 0, 0, 0); - - /// - /// Transparent color instance. All components are 0. - /// - public static readonly Color Transparent = FromRgba(0, 0, 0, 0); - - /// - /// Aqua color instance. Its RGB value is (0, 255, 255). - /// - public static readonly Color Aqua = FromRgb(0, 255, 255); - - /// - /// Black color instance. Its RGB value is (0, 0, 0). - /// - public static readonly Color Black = FromRgb(0, 0, 0); - - /// - /// Blue color instance. Its RGB value is (0, 0, 255). - /// - public static readonly Color Blue = FromRgb(0, 0, 255); - - /// - /// Fuchsia color instance. Its RGB value is (255, 0, 255). - /// - public static readonly Color Fuchsia = FromRgb(255, 0, 255); - - /// - /// Gray color instance. Its RGB value is (128, 128, 128). - /// - public static readonly Color Gray = FromRgb(128, 128, 128); - - /// - /// Green color instance. Its RGB value is (0, 128, 0). - /// - public static readonly Color Green = FromRgb(0, 128, 0); - - /// - /// Lime color instance. Its RGB value is (0, 255, 0). - /// - public static readonly Color Lime = FromRgb(0, 255, 0); - - /// - /// Maroon color instance. Its RGB value is (128, 0, 0). - /// - public static readonly Color Maroon = FromRgb(128, 0, 0); - - /// - /// Navy color instance. Its RGB value is (0, 0, 128). - /// - public static readonly Color Navy = FromRgb(0, 0, 128); - - /// - /// Olive color instance. Its RGB value is (128, 128, 0). - /// - public static readonly Color Olive = FromRgb(128, 128, 0); - - /// - /// Purple color instance. Its RGB value is (128, 0, 128). - /// - public static readonly Color Purple = FromRgb(128, 0, 128); - - /// - /// Pink color instance. Its RGB value is (255, 102, 255). - /// - public static readonly Color Pink = FromRgb(255, 102, 255); - - /// - /// Red color instance. Its RGB value is (255, 0, 0). - /// - public static readonly Color Red = FromRgb(255, 0, 0); - - /// - /// Silver color instance. Its RGB value is (192, 192, 192). - /// - public static readonly Color Silver = FromRgb(192, 192, 192); - - /// - /// Teal color instance. Its RGB value is (0, 128, 128). - /// - public static readonly Color Teal = FromRgb(0, 128, 128); - - /// - /// White color instance. Its RGB value is (255, 255, 255). - /// - public static readonly Color White = FromRgb(255, 255, 255); - - /// - /// Yellow color instance. Its RGB value is (255, 255, 0). - /// - public static readonly Color Yellow = FromRgb(255, 255, 0); - - private int _value; - - /// - /// Initiates new Color with r,g,b,a components. - /// - /// Red (0 ~ 255) - /// Green (0 ~ 255) - /// Blue (0 ~ 255) - /// Alpha (0 ~ 255) - public Color(int r, int g, int b, int a) - { - if (r > 255 || r < 0) - throw CreateColorArgumentException(r, "red"); - if (g > 255 || g < 0) - throw CreateColorArgumentException(g, "green"); - if (b > 255 || b < 0) - throw CreateColorArgumentException(b, "blue"); - if (a > 255 || a < 0) - throw CreateColorArgumentException(a, "alpha"); - - _value = (int)(((uint)r << 24) + ((uint)g << 16) + ((uint)b << 8) + (uint)a); - } - - /// - /// Initiates new Color with r,g,b components. The alpha value will be 255 as default. - /// - /// Red (0 ~ 255) - /// Green (0 ~ 255) - /// Blue (0 ~ 255) - public Color(int r, int g, int b) : this(r, g, b, 255) - { - } - - #region Properties - - /// - /// Gets the Red component of the color. - /// - public int R - { - get { return (byte)(_value >> 24); } - } - - /// - /// Gets the Green component of the color. - /// - public int G - { - get { return (byte)(_value >> 16); } - } - - /// - /// Gets the blue component of the color. - /// - public int B - { - get { return (byte)(_value >> 8); } - } - - /// - /// Gets the alpha component of the color. - /// - public int A - { - get { return (byte)_value; } - } - - #endregion // Properties - - #region Static Methods - - /// - /// Returns a boolean indicating whether the two given Colors are equal. - /// - /// The first Color to compare. - /// The second Color to compare. - /// True if the Colors are equal; False otherwise. - public static bool operator ==(Color color1, Color color2) - { - return color1.Equals(color2); - } - - /// - /// Returns a boolean indicating whether the two given Colors are not equal. - /// - /// The first Color to compare. - /// The second Color to compare. - /// True if the Colors are not equal; False if they are equal. - public static bool operator !=(Color color1, Color color2) - { - return !color1.Equals(color2); - } - - /// - /// Returns a new RGB color instance. - /// - /// The red component of the color. - /// The green component of the color. - /// The blue component of the color. - /// - public static Color FromRgb(int r, int g, int b) - { - return new Color(r, g, b); - } - - /// - /// Returns a new RGBA color instance. - /// - /// The red component of the color. - /// The green component of the color. - /// The blue component of the color. - /// The alpha component of the color. - /// the RGBA color instance. - public static Color FromRgba(int r, int g, int b, int a) - { - return new Color(r, g, b, a); - } - - /// - /// Returns a new RGB Color instance with the requested Red, Green, and Blue channels. The Alpha channel is set if hex contains one. - /// - /// A string that contains the hexadecimal RGB(A) color representation. - /// the RGBA color instance. - public static Color FromHex(string hex) - { - if (hex == null) - { - throw new ArgumentNullException("hex"); - } - - // #fff - // #ffffff - // #ffff - // #ffffffff - if (hex.Length > 0 && hex[0] == '#') hex = hex.Substring(1); - if (hex.Length == 3) hex += "F"; - if (hex.Length == 4) - hex = new String(new char[] { hex[0], hex[0], hex[1], hex[1], hex[2], hex[2], hex[3], hex[3] }); - if (hex.Length == 6) hex += "FF"; - if (hex.Length != 8) - { - throw new ArgumentException(@"Hex string is not valid color. length of hex should be 3, 4, 6, 8"); - } - Color c = new Color(); - c._value = Convert.ToInt32(hex, 16); - return c; - } - - private static ArgumentException CreateColorArgumentException(int value, string color) - { - return new ArgumentException(string.Format("'{0}' is not a valid" + - " value for '{1}'. '{1}' should be greater or equal to 0 and" + - " less than or equal to 255.", value, color)); - } - - #endregion // Static Methods - - #region Methods - - /// - /// Gets the 32-bits RGBA value of the color. - /// - public int GetRgba() - { - return _value; - } - - /// - /// Gets the 32-bits ARGB value of the color. - /// - public int GetArgb() - { - return (int)((uint)A << 24 | (uint)R << 16 | (uint)G << 8 | (uint)B); - } - - /// - /// Returns a string representation in Hex. (ex: \#FFFFFFFF in RGBA order) - /// - /// The string representation in Hex. - public string ToHex() - { - return "#" + _value.ToString("X8"); - } - - /// - /// Returns a boolean indicating whether the given Color is equal to this Color instance. - /// - /// The Color to compare this instance to. - /// True if the other Color is equal to this instance; False otherwise. - public bool Equals(Color other) - { - return _value == other._value; - } - - /// - /// Returns a boolean indicating whether the given Object is equal to this Color instance. - /// - /// The Object to compare against. - /// True if the Object is equal to this Color; False otherwise. - public override bool Equals(object obj) - { - if (obj is Color) - { - return Equals((Color)obj); - } - return false; - } - - /// - /// Returns a string representation of the Color. - /// - /// The string representation. - public override string ToString() - { - return string.Format("Color [R={0}, G={1}, B={2}, A={3}]", R, G, B, A); - } - - /// - /// Returns the hash code for this instance. - /// - /// The hash code. - public override int GetHashCode() - { - return _value.GetHashCode(); - } - - #endregion // Methods - } -} diff --git a/src/Tizen/Tizen.Internals.Errors/ErrorCode.cs b/src/Tizen/Tizen.Internals.Errors/ErrorCode.cs deleted file mode 100644 index c21dc6042..000000000 --- a/src/Tizen/Tizen.Internals.Errors/ErrorCode.cs +++ /dev/null @@ -1,122 +0,0 @@ -/* - * 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. - */ - -namespace Tizen.Internals.Errors -{ - public enum ErrorCode : int - { - None = 0, // 0, /**< Successful */ - NotPermitted = -1, // -EPERM, /**< Operation not permitted */ - NoSuchFile = -2, // -ENOENT, /**< No such file or directory */ - NoSuchProcess = -3, // -ESRCH, /**< No such process */ - InterruptedSysCall = -4, // -EINTR, /**< Interrupted system call */ - IoError = -5, // -EIO, /**< I/O error */ - NoSuchDevice = -6, // -ENXIO, /**< No such device or address */ - ArgumentListTooLong = -7, // -E2BIG, /**< Argument list too long */ - ExecFormatError = -8, // -ENOEXEC, /**< Exec format error */ - BadFileNumber = -9, // -EBADF, /**< Bad file number */ - TryAgain = -11, // -EAGAIN, /**< Try again */ - OutOfMemory = -12, // -ENOMEM, /**< Out of memory */ - PermissionDenied = -13, // -EACCES, /**< Permission denied */ - BadAddress = -14, // -EFAULT, /**< Bad address */ - BlockDeviceRequired = -15, // -ENOTBLK, /**< Block device required */ - ResourceBusy = -16, // -EBUSY, /**< Device or resource busy */ - FileExists = -17, // -EEXIST, /**< File exists */ - CrossDeviceLink = -18, // -EXDEV, /**< Cross-device link */ - NotaDirectory = -20, // -ENOTDIR, /**< Not a directory */ - IsADirectory = -21, // -EISDIR, /**< Is a directory */ - InvalidParameter = -22, // -EINVAL, /**< Invalid function parameter */ - FileTableOverflow = -23, // -ENFILE, /**< File table overflow */ - TooManyOpenFiles = -24, // -EMFILE, /**< Too many open files */ - TooNotaTerminal = -25, // -ENOTTY, /**< Not a terminal */ - TooTextFileBusy = -26, // -ETXTBSY, /**< Not a terminal */ - FileTooLarge = -27, // -EFBIG, /**< File too large */ - FileNoSpaceOnDevice = -28, // -ENOSPC, /**< No space left on device */ - IllegalSeek = -29, // -ESPIPE, /**< Illegal seek */ - ReadOnlyFilesystem = -30, // -EROFS, /**< Read-only file system */ - NoData = -61, // -ENODATA, /**< No data available */ - TooManyLinks = -31, // -EMLINK, /**< Too many links */ - BrokenPipe = -32, // -EPIPE, /**< Broken pipe */ - ArgumentOutOfDomain = -33, // -EDOM, /**< Math argument out of domain of func */ - ResultOutOfRange = -34, // -ERANGE, /**< Math result not representable */ - WouldCauseDeadlock = -35, // -EDEADLK, /**< Resource deadlock would occur */ - FileNameTooLong = -36, // -ENAMETOOLONG,/**< File name too long */ - FileNoLocksAvailable = -37, // -ENOLCK, /**< No record locks available */ - InvalidOperation = -38, // -ENOSYS, /**< Function not implemented */ - DirNotEmpty = -39, // -ENOTEMPTY, /**< Directory not empty */ - TooManySymbolicLinks = -40, // -ELOOP, /**< Too many symbolic links encountered */ - WouldBlock = -11, // TryAgain (-EAGAIN), /**< Operation would block */ - CorruptedSharedLib = -80, // -ELIBBAD, /**< Accessing a corrupted shared library */ - LibSectionCorrupted = -81, // -ELIBSCN, /**< .lib section in a.out corrupted */ - LinkTooManySharedLib = -82, // -ELIBMAX, /**< Attempting to link in too many shared libraries */ - SharedLibExec = -83, // -ELIBEXEC, /**< Cannot exec a shared library directly */ - IllegalByteSeq = -84, // -EILSEQ, /**< Illegal byte sequence */ - SystemCallRestart = -85, // -ERESTART, /**< Interrupted system call should be restarted */ - StreamsPipe = -86, // -ESTRPIPE, /**< Streams pipe error */ - TooManyUsers = -87, // -EUSERS, /**< Too many users */ - NonSocket = -88, // -ENOTSOCK, /**< Socket operation on non-socket */ - NoDestAddress = -89, // -EDESTADDRREQ, /**< Destination address required */ - MsgTooLong = -90, // -EMSGSIZE, /**< Message too long */ - ProtocolWrongType = -91, // -EPROTOTYPE, /**< Protocol wrong type for socket */ - ProtocolNotAvaliable = -92, // -ENOPROTOOPT, /**< Protocol not available */ - ProtocolNotSupported = -93, // -EPROTONOSUPPORT, /**< Protocol not supported */ - SocketTypeNotSupported = -94, // -ESOCKTNOSUPPORT, /**< Socket type not supported */ - EndpointOperatinNotSupported = -95, // -EOPNOTSUPP, /**< Operation not supported on transport endpoint */ - ProtocolFamilyNotSupported = -96, // -EPFNOSUPPORT, /**< Protocol family not supported */ - AddressFamilyNotSupported = -97, // -EAFNOSUPPORT, /**< Address family not supported by protocol */ - AddresInUse = -98, // -EADDRINUSE, /**< Address already in use */ - CannotAssignAddress = -99, // -EADDRNOTAVAIL, /**< Cannot assign requested address */ - Networkdown = -100, // -ENETDOWN, /**< Network is down */ - NetworkUnreachable = -101, // -ENETUNREACH, /**< Network is unreachable */ - NetworkReset = -102, // -ENETRESET, /**< Network dropped connection because of reset */ - ConnectionAborted = -103, // -ECONNABORTED, /**< Software caused connection abort */ - ConnectionResetByPeer = -104, // -ECONNRESET, /**< Connection reset by peer */ - BufferSpace = -105, // -ENOBUFS, /**< No buffer space available */ - EndpointConnected = -106, // -EISCONN, /**< Transport endpoint is already connected */ - EndpointNotConnected = -107, // -ENOTCONN, /**< Transport endpoint is not connected */ - EndpointShutdown = -108, // -ESHUTDOWN, /**< Cannot send after transport endpoint shutdown */ - TooManyReferences = -109, // -ETOOMANYREFS, /**< Too many references: cannot splice */ - ConnectionTimeout = -110, // -ETIMEDOUT, /**< Connection timed out */ - ConnectionRefused = -111, // -ECONNREFUSED, /**< Connection refused */ - Hostdown = -112, // -EHOSTDOWN, /**< Host is down */ - NoRouteToHost = -113, // -EHOSTUNREACH, /**< No route to host */ - AlreadyInProgress = -114, // -EALREADY, /**< Operation already in progress */ - NowInProgress = -115, // -EINPROGRESS, /**< Operation now in progress */ - StaleNfsFileHandle = -116, // -ESTALE, /**< Stale NFS file handle */ - StructureUnclean = -117, // -EUCLEAN, /**< Structure needs cleaning */ - NotXenixNamedTypeFile = -118, // -ENOTNAM, /**< Not a XENIX named type file */ - NoXenixSemaphoresAvailable = -119, // -ENAVAIL, /**< No XENIX semaphores available */ - IsNamedTypeFile = -120, // -EISNAM, /**< Is a named type file */ - RemoteIo = -121, // -EREMOTEIO, /**< Remote I/O error */ - QuotaExceeded = -122, // -EDQUOT, /**< Quota exceeded */ - NoMedium = -123, // -ENOMEDIUM, /**< No medium found */ - WrongMediumType = -124, // -EMEDIUMTYPE, /**< Wrong medium type */ - Canceled = -125, // -ECANCELED, /**< Operation Canceled */ - KeyNotAvailable = -126, // -ENOKEY, /**< Required key not available */ - KeyExpired = -127, // -EKEYEXPIRED, /**< Key has expired */ - KeyRevoked = -128, // -EKEYREVOKED, /**< Key has been revoked */ - KeyRejected = -129, // -EKEYREJECTED, /**< Key was rejected by service */ - - OwnerDead = -130, // -EOWNERDEAD, /**< Owner died (for robust mutexes) */ - - Unknown = -1073741824, // TIZEN_ERROR_MIN_PLATFORM_ERROR, /**< Unknown error */ - - TimedOut, // /**< Time out */ - NotSupported, // /**< Not Supported */ - UserNotConsented,// /**< Not Consented */ - EndofCollection // - } -} diff --git a/src/Tizen/Tizen.Internals.Errors/ErrorFacts.cs b/src/Tizen/Tizen.Internals.Errors/ErrorFacts.cs deleted file mode 100644 index f5ec90de2..000000000 --- a/src/Tizen/Tizen.Internals.Errors/ErrorFacts.cs +++ /dev/null @@ -1,47 +0,0 @@ -/* - * 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; - -namespace Tizen.Internals.Errors -{ - /// - /// - /// - public static class ErrorFacts - { - /// - /// - /// - /// - public static int GetLastResult() - { - return Interop.CommonError.GetLastResult(); - } - - /// - /// - /// - /// - /// - public static string GetErrorMessage(int errorCode) - { - IntPtr errorPtr = Interop.CommonError.GetErrorMessage(errorCode); - return Marshal.PtrToStringAnsi(errorPtr); - } - } -} diff --git a/src/Tizen/Tizen.csproj b/src/Tizen/Tizen.csproj deleted file mode 100644 index dbdcea46b..000000000 --- a/src/Tizen/Tizen.csproj +++ /dev/null @@ -1,7 +0,0 @@ - - - - netstandard2.0 - - - diff --git a/src/Tizen/Tizen.sln b/src/Tizen/Tizen.sln deleted file mode 100755 index 8ad942641..000000000 --- a/src/Tizen/Tizen.sln +++ /dev/null @@ -1,22 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 15 -VisualStudioVersion = 15.0.26430.12 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tizen", "Tizen.csproj", "{891C5B11-36F1-405A-8935-E1ABBD1D5C81}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|Any CPU = Debug|Any CPU - Release|Any CPU = Release|Any CPU - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {891C5B11-36F1-405A-8935-E1ABBD1D5C81}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {891C5B11-36F1-405A-8935-E1ABBD1D5C81}.Debug|Any CPU.Build.0 = Debug|Any CPU - {891C5B11-36F1-405A-8935-E1ABBD1D5C81}.Release|Any CPU.ActiveCfg = Release|Any CPU - {891C5B11-36F1-405A-8935-E1ABBD1D5C81}.Release|Any CPU.Build.0 = Release|Any CPU - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection -EndGlobal diff --git a/test/ElmSharp.Test/ElmSharp.Test.csproj b/test/ElmSharp.Test/ElmSharp.Test.csproj deleted file mode 100755 index 5842abeb7..000000000 --- a/test/ElmSharp.Test/ElmSharp.Test.csproj +++ /dev/null @@ -1,53 +0,0 @@ - - - - - - $(MSBuildExtensionsPath)\Tizen\VisualStudio\ - - - - - - - - Exe - netcoreapp2.0 - - - - - true - $(PackageTargetFallback);portable-net45+wp80+win81+wpa81 - - - - portable - - - None - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/test/ElmSharp.Test/Log.cs b/test/ElmSharp.Test/Log.cs deleted file mode 100644 index 37313aa72..000000000 --- a/test/ElmSharp.Test/Log.cs +++ /dev/null @@ -1,60 +0,0 @@ -using System; -using System.IO; -using System.Runtime.InteropServices; -using System.Runtime.CompilerServices; - -namespace ElmSharp.Test -{ - internal static class Log - { - const string Library = "libdlog.so.0"; - const string TAG = "ElmSharp.Test"; - - public static void Debug(string message, - [CallerFilePath] string file = "", - [CallerMemberName] string func = "", - [CallerLineNumber] int line = 0) - { - Print(LogPriority.DLOG_DEBUG, TAG, message, file, func, line); - } - - public static void Info(string message, - [CallerFilePath] string file = "", - [CallerMemberName] string func = "", - [CallerLineNumber] int line = 0) - { - Print(LogPriority.DLOG_DEBUG, TAG, message, file, func, line); - } - - public static void Error(string message, - [CallerFilePath] string file = "", - [CallerMemberName] string func = "", - [CallerLineNumber] int line = 0) - { - Print(LogPriority.DLOG_DEBUG, TAG, message, file, func, line); - } - - internal enum LogPriority - { - DLOG_UNKNOWN = 0, - DLOG_DEFAULT, - DLOG_VERBOSE, - DLOG_DEBUG, - DLOG_INFO, - DLOG_WARN, - DLOG_ERROR, - DLOG_FATAL, - DLOG_SILENT, - DLOG_PRIO_MAX, - } - - private static void Print(LogPriority priority, string tag, string message, string file, string func, int line) - { - FileInfo finfo = new FileInfo(file); - Print(priority, tag, "%s: %s(%d) > %s", finfo.Name, func, line, message); - } - - [DllImportAttribute(Library, EntryPoint = "dlog_print")] - internal static extern int Print(LogPriority prio, string tag, string fmt, string file, string func, int line, string msg); - } -} diff --git a/test/ElmSharp.Test/TC/AccessibilityRelationTest.cs b/test/ElmSharp.Test/TC/AccessibilityRelationTest.cs deleted file mode 100644 index 53ccf2c97..000000000 --- a/test/ElmSharp.Test/TC/AccessibilityRelationTest.cs +++ /dev/null @@ -1,254 +0,0 @@ -/* - * 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.Linq; -using ElmSharp; -using ElmSharp.Accessible; - -namespace ElmSharp.Test -{ - class AccessibilityRelationTest : TestCaseBase - { - public override string TestName => "AccessibilityRelationTest"; - public override string TestDescription => "Accessibility Relation API test"; - - public override void Run(Window win) - { - Conformant conformant = new Conformant(win); - conformant.Show(); - - Box box = new Box(win); - box.Show(); - conformant.SetContent(box); - - Button button1 = new Button(win) { WeightX = 1, AlignmentX = -1, Text = "LabelledBy" }; - Label label1 = new Label(win) { Text = "LabelFor" }; - - button1.Show(); - label1.Show(); - - box.PackEnd(button1); - box.PackEnd(label1); - - ((IAccessibleObject)button1).AppendRelation(new LabelledBy() { Target = label1 }); - ((IAccessibleObject)label1).AppendRelation(new LabelFor() { Target = button1 }); - - button1.Clicked += (s, e) => - { - ((IAccessibleObject)button1).RemoveRelation(new LabelledBy() { Target = label1 }); - ((IAccessibleObject)label1).RemoveRelation(new LabelFor() { Target = button1 }); - }; - - Label label8 = new Label(win) { WeightX = 1, AlignmentX = -1, Text = "ControlledBy" }; - Button button3 = new Button(win) { WeightX = 1, AlignmentX = -1, Text = "ControllerFor" }; - - label8.Show(); - button3.Show(); - - box.PackEnd(label8); - box.PackEnd(button3); - - ((IAccessibleObject)label8).AppendRelation(new ControlledBy() { Target = button3 }); - ((IAccessibleObject)button3).AppendRelation(new ControllerFor() { Target = label8 }); - - button3.Clicked += (s, e) => - { - ((IAccessibleObject)label8).RemoveRelation(new ControlledBy() { Target = button3 }); - ((IAccessibleObject)button3).RemoveRelation(new ControllerFor() { Target = label8 }); - }; - - Box box2 = new Box(win) { WeightX = 1, AlignmentX = -1}; - Label label2 = new Label(win) { Text = "Group" }; - Button button4 = new Button(win) { WeightX = 1, AlignmentX = -1, Text = "Member" }; - - box2.Show(); - label2.Show(); - button4.Show(); - - ((IAccessibleObject)label2).AppendRelation(new LabelFor() { Target = box2 }); - ((IAccessibleObject)label2).AppendRelation(new MemberOf() { Target = box2 }); - ((IAccessibleObject)box2).AppendRelation(new LabelledBy() { Target = label2 }); - ((IAccessibleObject)button4).AppendRelation(new MemberOf() { Target = box2 }); - - box2.PackEnd(label2); - box2.PackEnd(button4); - box.PackEnd(box2); - - button4.Clicked += (s, e) => - { - ((IAccessibleObject)label2).RemoveRelation(new LabelFor() { Target = box2 }); - ((IAccessibleObject)label2).RemoveRelation(new MemberOf() { Target = box2 }); - ((IAccessibleObject)box2).RemoveRelation(new LabelledBy() { Target = label2 }); - ((IAccessibleObject)button4).RemoveRelation(new MemberOf() { Target = box2 }); - }; - - Button button6 = new Button(win) { WeightX = 1, AlignmentX = -1, Text = "Xbutton" }; - Label label3 = new Label(win) { Text = "Tooltip of Xbutton" }; - - button6.Show(); - label3.Show(); - - ((IAccessibleObject)label3).AppendRelation(new TooltipFor() { Target = button6 }); - - box.PackEnd(button6); - box.PackEnd(label3); - - button6.Clicked += (s, e) => - { - ((IAccessibleObject)label3).RemoveRelation(new TooltipFor() { Target = button6 }); - }; - - Box box3 = new Box(win) { WeightX = 1, AlignmentX = -1}; - Label label4 = new Label(win) { Text = "Child of inner box" }; - Button button7 = new Button(win) { WeightX = 1, AlignmentX = -1, Text = "child of inner box" }; - - box3.Show(); - label4.Show(); - button7.Show(); - - ((IAccessibleObject)box3).AppendRelation(new ParentOf() { Target = label4 }); - ((IAccessibleObject)box3).AppendRelation(new ParentOf() { Target = button7 }); - ((IAccessibleObject)label4).AppendRelation(new ChildOf() { Target = box3 }); - ((IAccessibleObject)button7).AppendRelation(new ChildOf() { Target = box3 }); - - box3.PackEnd(label4); - box3.PackEnd(button7); - box.PackEnd(box3); - - button7.Clicked += (s, e) => - { - ((IAccessibleObject)box3).RemoveRelation(new ParentOf() { Target = label4 }); - ((IAccessibleObject)box3).RemoveRelation(new ParentOf() { Target = button7 }); - ((IAccessibleObject)label4).RemoveRelation(new ChildOf() { Target = box3 }); - ((IAccessibleObject)button7).RemoveRelation(new ChildOf() { Target = box3 }); - }; - - Label label6 = new Label(win) { Text = "Extended" }; - Button button12 = new Button(win) { WeightX = 1, AlignmentX = -1, Text = "Not Extended" }; - - label6.Show(); - button12.Show(); - - ((IAccessibleObject)label6).AppendRelation(new Extended() { Target = button12 }); - - box.PackEnd(button12); - box.PackEnd(label6); - - button12.Clicked += (s, e) => - { - ((IAccessibleObject)label6).RemoveRelation(new Extended() { Target = button12 }); - }; - - Button button8 = new Button(win) { WeightX = 1, AlignmentX = -1, Text = "FlowsTo" }; - Button button9 = new Button(win) { WeightX = 1, AlignmentX = -1, Text = "FlowsFrom" }; - - button8.Show(); - button9.Show(); - - ((IAccessibleObject)button8).AppendRelation(new FlowsTo() { Target = button9 }); - ((IAccessibleObject)button9).AppendRelation(new FlowsFrom() { Target = button8 }); - - box.PackEnd(button8); - box.PackEnd(button9); - - button8.Clicked += (s, e) => - { - ((IAccessibleObject)button8).RemoveRelation(new FlowsTo() { Target = button9 }); - }; - - button9.Clicked += (s, e) => - { - ((IAccessibleObject)button9).RemoveRelation(new FlowsFrom() { Target = button8 }); - }; - - Button button10 = new Button(win) { WeightX = 1, AlignmentX = -1, Text = "EmbeddedBy" }; - - button10.Show(); - - ((IAccessibleObject)button10).AppendRelation(new EmbeddedBy() { Target = box }); - ((IAccessibleObject)box).AppendRelation(new Embeds() { Target = button10 }); - - box.PackEnd(button10); - - button10.Clicked += (s, e) => - { - ((IAccessibleObject)button10).RemoveRelation(new EmbeddedBy() { Target = box }); - ((IAccessibleObject)box).RemoveRelation(new Embeds() { Target = button10 }); - }; - - Button button11 = new Button(win) { WeightX = 1, AlignmentX = -1, Text = "popup" }; - - button11.Show(); - - Popup popup = new Popup(win) - { - Orientation = PopupOrientation.Top, - Timeout = 5 - }; - popup.Append("Popup!!"); - - ((IAccessibleObject)popup).AppendRelation(new PopupFor() { Target = button11 }); - ((IAccessibleObject)popup).AppendRelation(new SubwindowOf() { Target = box }); - ((IAccessibleObject)box).AppendRelation(new ParentWindowOf() { Target = popup }); - - popup.OutsideClicked += (s, e) => - { - popup.Hide(); - }; - - - button11.Clicked += (s, e) => - { - popup.Show(); - }; - - box.PackEnd(button11); - - Button button13 = new Button(win) { WeightX = 1, AlignmentX = -1, Text = "Remove Popup Relation"}; - - button13.Show(); - - box.PackEnd(button13); - - button13.Clicked += (s, e) => - { - ((IAccessibleObject)popup).RemoveRelation(new PopupFor() { Target = button11 }); - ((IAccessibleObject)popup).RemoveRelation(new SubwindowOf() { Target = box }); - ((IAccessibleObject)box).RemoveRelation(new ParentWindowOf() { Target = popup }); - }; - - Label label7 = new Label(win) { WeightX = 1, AlignmentX = -1, - Text = "This is Test for Accessibility Relation Append Test"}; - label7.Show(); - - ((IAccessibleObject)label7).AppendRelation(new DescriptionFor() { Target = box }); - ((IAccessibleObject)box).AppendRelation(new DescribedBy() { Target = label7 }); - - box.PackEnd(label7); - - Button button14 = new Button(win) { WeightX = 1, AlignmentX = -1, Text = "Remove Description Relation"}; - button14.Show(); - box.PackEnd(button14); - - button14.Clicked += (s, e) => - { - ((IAccessibleObject)label7).RemoveRelation(new DescriptionFor() { Target = box }); - ((IAccessibleObject)box).RemoveRelation(new DescribedBy() { Target = label7 }); - }; - } - } -} diff --git a/test/ElmSharp.Test/TC/AccessibilityRoleTest.cs b/test/ElmSharp.Test/TC/AccessibilityRoleTest.cs deleted file mode 100644 index 216ee3d93..000000000 --- a/test/ElmSharp.Test/TC/AccessibilityRoleTest.cs +++ /dev/null @@ -1,56 +0,0 @@ -/* - * 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.Linq; -using ElmSharp; -using ElmSharp.Accessible; - -namespace ElmSharp.Test -{ - class AccessibilityRoleTest : TestCaseBase - { - public override string TestName => "AccessibilityRoleTest"; - public override string TestDescription => "Accessibility Role API test"; - - public override void Run(Window win) - { - Conformant conformant = new Conformant(win); - conformant.Show(); - - Box box = new Box(win); - box.Show(); - - // AcceleratorLabel - Label acceleratorLabel = new Label(win) - { - Text = "AcceleratorLabel" - }; - - Label alertLabel = new Label(win) - { - Text = "Alert" - }; - - Label Animation = new Label(win) - { - }; - - conformant.SetContent(conformant); - } - } -} - diff --git a/test/ElmSharp.Test/TC/AccessibilityTest.cs b/test/ElmSharp.Test/TC/AccessibilityTest.cs deleted file mode 100644 index 3072f1b1d..000000000 --- a/test/ElmSharp.Test/TC/AccessibilityTest.cs +++ /dev/null @@ -1,286 +0,0 @@ -/* - * 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.Linq; -using ElmSharp; -using ElmSharp.Accessible; - -namespace ElmSharp.Test -{ - class AccessibilityTest : TestCaseBase - { - public override string TestName => "AccessibilityTest"; - public override string TestDescription => "Accessibility API test"; - - int sequence = 0; - Naviframe navi; - - Array accessRoleValues; - - public override void Run(Window window) - { - accessRoleValues = Enum.GetValues(typeof(AccessRole)); - - Conformant conformant = new Conformant(window); - conformant.Show(); - - navi = new Naviframe(window) - { - PreserveContentOnPop = true, - DefaultBackButtonEnabled = true - }; - - navi.Push(CreatePage(window, "Main page"), "first page"); - navi.Show(); - conformant.SetContent(navi); - } - - static string StatusStr(ReadingStatus status) - { - if (status == ReadingStatus.Unknown) - { - return "Unknown"; - } - else if (status == ReadingStatus.Cancelled) - { - return "Cancelled"; - } - else if (status == ReadingStatus.Stoppped) - { - return "Stopped"; - } - else if (status == ReadingStatus.Skipped) - { - return "Skipped"; - } - else - { - return "invalid"; - } - } - - Widget CreatePage(Window win, string pageName) - { - Box box = new Box(win); - ((IAccessibleObject)box).Name = pageName; - - box.Show(); - - Button abutton = new Button(win) - { - Text = "Accessibility-normal", - WeightX = 1, - AlignmentX = -1 - }; - ((IAccessibleObject)abutton).TranslationDomain = "kr"; - ((IAccessibleObject)abutton).Name = "Accessibility"; - ((IAccessibleObject)abutton).Description = "Description for Accessibility"; - - Label abutton_label = new Label(win) - { - WeightX = 1, - AlignmentX = -1 - }; - abutton_label.Text = - "domain : " + ((IAccessibleObject)abutton).TranslationDomain + - ", name : " + ((IAccessibleObject)abutton).Name + - ", desc : " + ((IAccessibleObject)abutton).Description; - - Button bbutton = new Button(win) - { - Text = "Accessibility-provider", - WeightX = 1, - AlignmentX = -1 - }; - ((IAccessibleObject)bbutton).NameProvider = (obj) => "Name-provider"; - ((IAccessibleObject)bbutton).DescriptionProvider = (obj) => "Description-provider"; - - Label bbutton_label = new Label(win) - { - WeightX = 1, - AlignmentX = -1 - }; - bbutton_label.Text = - "name : " + ((IAccessibleObject)bbutton).Name + - ", desc : " + ((IAccessibleObject)bbutton).Description; - - Button cbutton = new Button(win) - { - Text = "Readingtype,CanHighlight", - WeightX = 1, - AlignmentX = -1 - }; - ((IAccessibleObject)cbutton).ReadingInfoType = - ReadingInfoType.Name | ReadingInfoType.Role | ReadingInfoType.Description; - ((IAccessibleObject)cbutton).Name = "FooFoo"; - ((IAccessibleObject)cbutton).Role = AccessRole.Text; - ((IAccessibleObject)cbutton).Description = "FooFooButton"; - Label name_onoff_label = new Label(win) - { - Text = "ReadingInfoType.Name : " + - ((((IAccessibleObject)cbutton).ReadingInfoType & ReadingInfoType.Name) != 0 ? "on" : "off"), - WeightX = 1, - AlignmentX = -1 - }; - Label role_onoff_label = new Label(win) - { - Text = "ReadingInfoType.Role : " + - ((((IAccessibleObject)cbutton).ReadingInfoType & ReadingInfoType.Role) != 0 ? "on" : "off"), - WeightX = 1, - AlignmentX = -1 - }; - Label description_onoff_label = new Label(win) - { - Text = "ReadingInfoType.Description : " + - ((((IAccessibleObject)cbutton).ReadingInfoType & ReadingInfoType.Description) != 0 ? "on" : "off"), - WeightX = 1, - AlignmentX = -1 - }; - Label state_onoff_label = new Label(win) - { - Text = "ReadingInfoType.State : " + - ((((IAccessibleObject)cbutton).ReadingInfoType & ReadingInfoType.State) != 0 ? "on" : "off"), - WeightX = 1, - AlignmentX = -1 - }; - - Button saybutton = new Button(win) - { - Text = "HHGG with false", - WeightX = 1, - AlignmentX = -1 - }; - - Button saybutton2 = new Button(win) - { - Text = "HHGG with true", - WeightX = 1, - AlignmentX = -1 - }; - - int labelIndex = 0; - Button roleButton = new Button(win) - { - WeightX = 1, - AlignmentX = -1 - }; - - roleButton.Clicked += (s, e) => - { - if (labelIndex >= accessRoleValues.Length) - { - labelIndex = 0; - } - - IAccessibleObject obj = roleButton as IAccessibleObject; - AccessRole role = (AccessRole) accessRoleValues.GetValue(labelIndex); - obj.Role = role; - roleButton.Text = Enum.GetName(typeof(AccessRole), obj.Role); - - labelIndex++; - }; - - Label label = new Label(win) - { - Text = string.Format("{0} Apple", sequence++), - WeightX = 1, - AlignmentX = -1 - }; - ((IAccessibleObject)label).Name = "Apple"; - - Button push = new Button(win) - { - Text = "Push", - WeightX = 1, - AlignmentX = -1 - }; - ((IAccessibleObject)push).Name = "PushButton"; - - Button pop = new Button(win) - { - Text = "pop", - WeightX = 1, - AlignmentX = -1, - }; - ((IAccessibleObject)pop).Name = "PopButton"; - - abutton.Show(); - abutton_label.Show(); - bbutton.Show(); - bbutton_label.Show(); - cbutton.Show(); - name_onoff_label.Show(); - role_onoff_label.Show(); - description_onoff_label.Show(); - state_onoff_label.Show(); - saybutton.Show(); - saybutton2.Show(); - roleButton.Show(); - label.Show(); - push.Show(); - pop.Show(); - - push.Clicked += (s, e) => - { - NaviItem item = navi.Push(CreatePage(win, string.Format("Apple {0}", sequence -1)), string.Format("Page {0}", sequence -1)); - }; - - Label statusLog = new Label(win) - { - WeightX = 1, - AlignmentX = -1 - }; - statusLog.Show(); - - saybutton.Clicked += (s, e) => - { - AccessibleUtil.Say("The Hitchhiker's Guide to the Galaxy", false) - .ContinueWith(status => { statusLog.Text = StatusStr(status.Result); }); - }; - saybutton2.Clicked += (s, e) => - { - AccessibleUtil.Say("The Hitchhiker's Guide to the Galaxy", true) - .ContinueWith(status => { statusLog.Text = StatusStr(status.Result); }); - }; - - pop.Clicked += (s, e) => - { - var item = navi.NavigationStack.LastOrDefault(); - navi.Pop(); - }; - - box.PackEnd(abutton); - box.PackEnd(abutton_label); - box.PackEnd(bbutton); - box.PackEnd(bbutton_label); - box.PackEnd(cbutton); - box.PackEnd(name_onoff_label); - box.PackEnd(role_onoff_label); - box.PackEnd(description_onoff_label); - box.PackEnd(state_onoff_label); - box.PackEnd(saybutton); - box.PackEnd(saybutton2); - box.PackEnd(roleButton); - box.PackEnd(label); - box.PackEnd(push); - box.PackEnd(pop); - box.PackEnd(statusLog); - - return box; - } - } -} diff --git a/test/ElmSharp.Test/TC/BackgroundColorTest1.cs b/test/ElmSharp.Test/TC/BackgroundColorTest1.cs deleted file mode 100644 index c8073f360..000000000 --- a/test/ElmSharp.Test/TC/BackgroundColorTest1.cs +++ /dev/null @@ -1,101 +0,0 @@ -/* - * 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 ElmSharp; - -namespace ElmSharp.Test -{ - class BackgroundColorTest1 : TestCaseBase - { - public override string TestName => "BackgroundColorTest1"; - public override string TestDescription => "To test basic operation of Widget's background Color"; - - - - public override void Run(Window window) - { - Button button1 = new Button(window) { - Text = "Target Button", - }; - button1.Resize(window.ScreenSize.Width, 100); - button1.Move(0, 0); - button1.Show(); - - Label label1 = new Label(window) { - Text = button1.BackgroundColor.ToString(), - BackgroundColor = Color.Black, - Color = Color.White - }; - label1.Resize(window.ScreenSize.Width, 100); - label1.Move(0, 100); - label1.Show(); - - Button button2 = new Button(window) { - Text = "Set Color.Red", - BackgroundColor = Color.Red, - }; - button2.Clicked += (e, o) => - { - button1.BackgroundColor = Color.Red; - label1.Text = button1.BackgroundColor.ToString(); - }; - button2.Resize(window.ScreenSize.Width, 100); - button2.Move(0, 400); - button2.Show(); - - Button button3 = new Button(window) { - Text = "Set Color(125,200,255, 150)", - BackgroundColor = new Color(125,200,255, 150) - }; - button3.Clicked += (e, o) => - { - button1.BackgroundColor = button3.BackgroundColor; - label1.Text = button1.BackgroundColor.ToString(); - }; - button3.Resize(window.ScreenSize.Width, 100); - button3.Move(0, 500); - button3.Show(); - - Button button4 = new Button(window) { - Text = "Set Color(125, 200, 255, 10)", - BackgroundColor = new Color(125, 200, 255, 10) - }; - button4.Clicked += (e,o) => - { - button1.BackgroundColor = button4.BackgroundColor; - label1.Text = button1.BackgroundColor.ToString(); - }; - button4.Resize(window.ScreenSize.Width, 100); - button4.Move(0, 600); - button4.Show(); - - Button button5 = new Button(window) { - Text = "Set Color.Default", - BackgroundColor = Color.Default - }; - button5.Clicked += (e, o) => - { - button1.BackgroundColor = button5.BackgroundColor; - label1.Text = button1.BackgroundColor.ToString(); - }; - button5.Resize(window.ScreenSize.Width, 100); - button5.Move(0, 700); - button5.Show(); - } - - } -} diff --git a/test/ElmSharp.Test/TC/BackgroundTest1.cs b/test/ElmSharp.Test/TC/BackgroundTest1.cs deleted file mode 100644 index ed2a447f9..000000000 --- a/test/ElmSharp.Test/TC/BackgroundTest1.cs +++ /dev/null @@ -1,54 +0,0 @@ -/* - * 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 ElmSharp; - -namespace ElmSharp.Test -{ - class BackgroundTest1 : TestCaseBase - { - public override string TestName => "BackgroundTest1"; - public override string TestDescription => "To test basic operation of Background"; - - public override void Run(Window window) - { - Background bg1 = new Background(window) - { - Color = Color.Orange - }; - - Background bg2 = new Background(window) - { - File = "/home/owner/apps_rw/ElmSharpTest/res/picture.png", - BackgroundOption = BackgroundOptions.Center, - BackgroundColor = Color.Gray - }; - - bg2.SetFileLoadSize(50, 50); - - Show(bg1, 0, 0, 100, 100); - Show(bg2, 0, 100, 700, 700); - } - - void Show(Background bg, int x, int y, int w, int h) - { - bg.Show(); - bg.Move(x, y); - bg.Resize(w, h); - } - } -} \ No newline at end of file diff --git a/test/ElmSharp.Test/TC/BackgroundTest2.cs b/test/ElmSharp.Test/TC/BackgroundTest2.cs deleted file mode 100644 index 09581bc4a..000000000 --- a/test/ElmSharp.Test/TC/BackgroundTest2.cs +++ /dev/null @@ -1,52 +0,0 @@ -/* - * 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 ElmSharp; - -namespace ElmSharp.Test -{ - public class BackgroundTest2 : TestCaseBase - { - public override string TestName => "BackgroundTest2"; - public override string TestDescription => "To test basic operation of Background"; - - public override void Run(Window window) - { - Background bg1 = new Background(window) - { - Color = Color.Orange - }; - - Background bg2 = new Background(window) - { - Color = new Color(60, 128, 255, 100) - }; - Show(bg1, 0, 0, 500, 500); - Show(bg2, 100, 100, 500, 500); - - Console.WriteLine("bg1.Color : {0}", bg1.Color.ToString()); - Console.WriteLine("bg2.Color : {0}", bg2.Color.ToString()); - } - - void Show(Background bg, int x, int y, int w, int h) - { - bg.Move(x, y); - bg.Resize(w, h); - bg.Show(); - } - } -} diff --git a/test/ElmSharp.Test/TC/BackgroundTest3.cs b/test/ElmSharp.Test/TC/BackgroundTest3.cs deleted file mode 100644 index 788aa3b34..000000000 --- a/test/ElmSharp.Test/TC/BackgroundTest3.cs +++ /dev/null @@ -1,109 +0,0 @@ -/* - * 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 ElmSharp; - -namespace ElmSharp.Test -{ - public class BackgroundTest3 : TestCaseBase - { - public override string TestName => "BackgroundTest3"; - public override string TestDescription => "To test basic operation of Background"; - - public override void Run(Window window) - { - - Conformant conformant = new Conformant(window); - conformant.Show(); - - Box box = new Box(window) - { - AlignmentY = -1, - AlignmentX = -1, - WeightX = 1, - WeightY = 1, - }; - box.Show(); - conformant.SetContent(box); - Background bg = new Background(window) - { - AlignmentY = -1, - AlignmentX = -1, - WeightX = 1, - WeightY = 1, - }; - bg.Show(); - box.PackEnd(bg); - Slider red = new Slider(window) - { - Minimum = 0, - Maximum = 255, - Text = "Red", - AlignmentX = -1, - WeightX = 1 - }; - Slider green = new Slider(window) - { - Minimum = 0, - Maximum = 255, - Text = "Green", - AlignmentX = -1, - WeightX = 1 - }; - Slider blue = new Slider(window) - { - Minimum = 0, - Maximum = 255, - Text = "Blue", - AlignmentX = -1, - WeightX = 1 - }; - Slider alpha = new Slider(window) - { - Minimum = 0, - Maximum = 255, - Text = "Alpha", - AlignmentX = -1, - WeightX = 1 - }; - red.Show(); - green.Show(); - blue.Show(); - alpha.Show(); - box.PackEnd(red); - box.PackEnd(green); - box.PackEnd(blue); - box.PackEnd(alpha); - red.Value = 255; - green.Value = 255; - blue.Value = 255; - alpha.Value = 255; - - bg.Color = new Color(255, 255, 255, 255); - - EventHandler handler = (s, e) => - { - bg.Color = new Color((int)red.Value, (int)green.Value, (int)blue.Value, (int)alpha.Value); - }; - - red.ValueChanged += handler; - green.ValueChanged += handler; - blue.ValueChanged += handler; - alpha.ValueChanged += handler; - } - } -} diff --git a/test/ElmSharp.Test/TC/BoxLayoutTest1.cs b/test/ElmSharp.Test/TC/BoxLayoutTest1.cs deleted file mode 100644 index ebe68b4bb..000000000 --- a/test/ElmSharp.Test/TC/BoxLayoutTest1.cs +++ /dev/null @@ -1,112 +0,0 @@ -/* - * 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.Linq; - -namespace ElmSharp.Test -{ - public class BoxLayoutTest1 : TestCaseBase - { - public override string TestName => "BoxLayoutTest1"; - public override string TestDescription => "Box Layout callback test"; - - Naviframe _navi; - int _sequence = 0; - - public override void Run(Window window) - { - Conformant conformant = new Conformant(window); - conformant.Show(); - - Naviframe navi = new Naviframe(window) - { - PreserveContentOnPop = true, - DefaultBackButtonEnabled = true - }; - _navi = navi; - - navi.Popped += (s, e) => - { - Console.WriteLine("----- Naviframe was popped {0:x} ", (int)(IntPtr)e.Content); - }; - - navi.Push(CreatePage(window), "0 Page"); - navi.Show(); - conformant.SetContent(navi); - } - - EvasObject CreatePage(Window parent) - { - Box box = new Box(parent); - box.Show(); - - Label label = new Label(parent) - { - Text = string.Format("{0} Page", _sequence++), - WeightX = 1, - AlignmentX = -1, - }; - Button push = new Button(parent) - { - Text = "Push", - WeightX = 1, - AlignmentX = -1, - }; - Button pop = new Button(parent) - { - Text = "pop", - WeightX = 1, - AlignmentX = -1, - }; - - label.Show(); - push.Show(); - pop.Show(); - - push.Clicked += (s, e) => - { - _navi.Push(CreatePage(parent), string.Format("{0} Page", _sequence - 1)); - }; - - pop.Clicked += (s, e) => - { - var item = _navi.NavigationStack.LastOrDefault(); - int nativePointer = (int)(IntPtr)(item.Content); - Console.WriteLine("----- Before Call _navi.Pop() {0:x} ", nativePointer); - _navi.Pop(); - Console.WriteLine("----- After Call _navi.Pop() {0:x} ", nativePointer); - }; - - push.Resize(500, 100); - pop.Resize(500, 100); - label.Resize(500, 100); - box.SetLayoutCallback(() => - { - Console.WriteLine("Layout callback with : {0}", box.Geometry); - var rect = box.Geometry; - label.Move(rect.X, rect.Y); - push.Move(rect.X, rect.Y + 100); - pop.Move(rect.X, rect.Y + 200); - }); - - box.PackEnd(label); - box.PackEnd(push); - box.PackEnd(pop); - return box; - } - } -} diff --git a/test/ElmSharp.Test/TC/BoxTest1.cs b/test/ElmSharp.Test/TC/BoxTest1.cs deleted file mode 100644 index e927724a7..000000000 --- a/test/ElmSharp.Test/TC/BoxTest1.cs +++ /dev/null @@ -1,80 +0,0 @@ -/* - * 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 ElmSharp; - -namespace ElmSharp.Test -{ - class BoxTest1 : TestCaseBase - { - public override string TestName => "BoxTest1"; - public override string TestDescription => "To test basic operation of Box"; - - Box box; - - public override void Run(Window window) - { - Conformant conformant = new Conformant(window); - conformant.Show(); - box = new Box(window); - box.BackgroundColor = Color.Orange; - conformant.SetContent(box); - box.Show(); - - Button button1 = new Button(window) { - Text = "Button 1", - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1 - }; - Button button2 = new Button(window) { - Text = "Button 2", - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - BackgroundColor = new Color(50,100,200,75) - }; - Button button3 = new Button(window) { - Text = "Button 3", - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - BackgroundColor = Color.Olive - }; - - box.PackEnd(button1); - box.PackEnd(button2); - box.PackEnd(button3); - - button1.Show(); - button2.Show(); - button3.Show(); - - button1.Clicked += Button1_Clicked; - button2.Clicked += Button1_Clicked; - button3.Clicked += Button1_Clicked; - } - - private void Button1_Clicked(object sender, EventArgs e) - { - Console.WriteLine("{0} Clicked! - Button's BG Color : {1}, Box's BG Color : {2}", ((Button)sender).Text, ((Button)sender).BackgroundColor, box.BackgroundColor); - } - } -} diff --git a/test/ElmSharp.Test/TC/ButtonTest1.cs b/test/ElmSharp.Test/TC/ButtonTest1.cs deleted file mode 100644 index ab39a6108..000000000 --- a/test/ElmSharp.Test/TC/ButtonTest1.cs +++ /dev/null @@ -1,92 +0,0 @@ -/* - * 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 ElmSharp; - -namespace ElmSharp.Test -{ - class ButtonTest1 : TestCaseBase - { - public override string TestName => "ButtonTest1"; - public override string TestDescription => "To test basic operation of Button"; - - void SetButtonEventHandler(Button button) - { - button.Clicked += (s, e) => - { - Console.WriteLine("{0} Clicked! : {1}", button.Text, button.BackgroundColor); - Console.WriteLine("{0} Clicked! : {1}", button.Text, button.ClassName); - Console.WriteLine("{0} Clicked! : {1}", button.Text, button.ClassName.ToLower()); - Console.WriteLine("{0} Clicked! : {1}", button.Text, button.ClassName.ToLower().Replace("elm_", "")); - Console.WriteLine("{0} Clicked! : {1}", button.Text, button.ClassName.ToLower().Replace("elm_", "") + "/" + "bg"); - }; - - button.Pressed += (s, e) => - { - Console.WriteLine("{0} Pressed!", button.Text); - }; - - button.Released += (s, e) => - { - Console.WriteLine("{0} Released!", button.Text); - }; - - button.Repeated += (s, e) => - { - Console.WriteLine("{0} Repeated!", button.Text); - }; - - button.Show(); - } - - public override void Run(Window window) - { - Button button1 = new Button(window) { - Text = "Button 1", - }; - button1.SetPartColor("bg", Color.Red); - SetButtonEventHandler(button1); - button1.Resize(500, 100); - button1.Move(0, 0); - - Button button2 = new Button(window) { - Text = "Button 2", - BackgroundColor = Color.Red, - }; - SetButtonEventHandler(button2); - button2.Resize(500, 100); - button2.Move(0, 200); - - Button button3 = new Button(window) { - Text = "Button 3", - BackgroundColor = new Color(125,200,255, 150) - }; - SetButtonEventHandler(button3); - button3.Resize(500, 100); - button3.Move(0, 400); - - Button button4 = new Button(window) { - Text = "Button 4", - BackgroundColor = new Color(125, 200, 255, 10) - }; - SetButtonEventHandler(button4); - button4.Resize(500, 100); - button4.Move(0, 600); - } - - } -} diff --git a/test/ElmSharp.Test/TC/CalendarTest1.cs b/test/ElmSharp.Test/TC/CalendarTest1.cs deleted file mode 100644 index 291d5f57d..000000000 --- a/test/ElmSharp.Test/TC/CalendarTest1.cs +++ /dev/null @@ -1,228 +0,0 @@ -/* - * 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.Collections.Generic; -using ElmSharp; - -namespace ElmSharp.Test -{ - class CalendarTest1 : TestCaseBase - { - public override string TestName => "CalendarTest1"; - public override string TestDescription => "To test basic operation of Calendar"; - - public override void Run(Window window) - { - Background bg = new Background(window); - bg.Color = Color.White; - bg.Move(0, 0); - bg.Resize(window.ScreenSize.Width, window.ScreenSize.Height); - bg.Show(); - - Calendar calendar = new Calendar(window) - { - FirstDayOfWeek = DayOfWeek.Monday, - WeekDayNames = new List() { "S", "M", "T", "W", "T", "F", "S" }, - MinimumYear = DateTime.MinValue.Year, - MaximumYear = DateTime.MaxValue.Year - }; - - IList marks = new List(); - - var mark = calendar.AddMark("holiday", DateTime.Today, CalendarMarkRepeatType.Unique); - marks.Add(mark); - - Label label1 = new Label(window) - { - Text = string.Format("WeekDayLabel.Count={0}", calendar.WeekDayNames.Count), - Color = Color.Black, - }; - - Label label2 = new Label(window) - { - Text = string.Format("WeekDayLabel.FirstDayOfWeek={0}", calendar.FirstDayOfWeek), - Color = Color.Black, - }; - - Label label3 = new Label(window) - { - Text = string.Format("WeekDayLabel.SelectedDate={0}", calendar.SelectedDate), - Color = Color.Black, - }; - - var selectMode = new Label(window) - { - Text = string.Format("SelectMode = {0}", calendar.SelectMode), - Color = Color.Black, - }; - - var addMark = new Button(window) - { - Text = "Add Mark" - }; - - var i = 1; - - addMark.Clicked += (s, e) => - { - var newMark = calendar.AddMark("holiday", DateTime.Today.AddDays(i), CalendarMarkRepeatType.Unique); - - Console.WriteLine("Call Add Mark : " + DateTime.Today.AddDays(i)); - marks.Add(newMark); - calendar.DrawMarks(); - i++; - }; - - var delMark = new Button(window) - { - Text = "Delete Mark" - }; - - delMark.Clicked += (s, e) => - { - if (marks.Count > 0) - { - calendar.DeleteMark(marks[0]); - marks.Remove(marks[0]); - calendar.DrawMarks(); - } - }; - - var changeMode = new Button(window) - { - Text = "Change Select Mode" - }; - - changeMode.Clicked += (s, e) => - { - if (calendar.SelectMode == CalendarSelectMode.Always || calendar.SelectMode == CalendarSelectMode.Default) - { - calendar.SelectMode = CalendarSelectMode.None; - } - else if (calendar.SelectMode == CalendarSelectMode.None) - { - calendar.SelectMode = CalendarSelectMode.OnDemand; - } - else - { - calendar.SelectMode = CalendarSelectMode.Always; - } - selectMode.Text = string.Format("SelectMode = {0}", calendar.SelectMode); - }; - - calendar.DateChanged += (object sender, DateChangedEventArgs e) => - { - label1.Text = string.Format("Old.Day={0}, Month={1}, Year={2}", e.OldDate.Day, e.OldDate.Month, e.OldDate.Year); - label2.Text = string.Format("New.Day={0}, Month={1}, Year={2}", e.NewDate.Day, e.NewDate.Month, e.NewDate.Year); - label3.Text = string.Format("SelectedDate={0}", calendar.SelectedDate); - }; - - calendar.DisplayedMonthChanged += (object sender, DisplayedMonthChangedEventArgs e) => - { - label3.Text = string.Format("Old Month={0}, New Month={1}", e.OldMonth, e.NewMonth); - }; - - var label4 = new Label(window) - { - Text = string.Format("Selectable={0}", calendar.Selectable), - Color = Color.Black, - }; - - var changeSelectable = new Button(window) - { - Text = "Change Selectable" - }; - - calendar.Selectable = CalendarSelectable.Month; - - changeSelectable.Clicked += (s, e) => - { - if (calendar.Selectable == CalendarSelectable.None) - { - calendar.Selectable = CalendarSelectable.Year; - } - else if (calendar.Selectable == CalendarSelectable.Year) - { - calendar.Selectable = CalendarSelectable.Month; - } - else if (calendar.Selectable == CalendarSelectable.Month) - { - calendar.Selectable = CalendarSelectable.Day; - } - else - { - calendar.Selectable = CalendarSelectable.None; - } - label4.Text = string.Format("Selectable={0}", calendar.Selectable); - }; - - var setTime = new Button(window) - { - Text = "Set 2015,1,1", - }; - - setTime.Clicked += (s, e) => - { - calendar.SelectedDate = new DateTime(2015, 1, 1); - }; - - calendar.Resize(600, 600); - calendar.Move(0, 150); - calendar.Show(); - - label1.Resize(600, 30); - label1.Move(0, 0); - label1.Show(); - - label2.Resize(600, 30); - label2.Move(0, 30); - label2.Show(); - - label3.Resize(600, 30); - label3.Move(0, 60); - label3.Show(); - - selectMode.Resize(600, 30); - selectMode.Move(0, 90); - selectMode.Show(); - - addMark.Resize(600, 100); - addMark.Move(0, 750); - addMark.Show(); - - delMark.Resize(600, 100); - delMark.Move(0, 850); - delMark.Show(); - - changeMode.Resize(600, 100); - changeMode.Move(0, 950); - changeMode.Show(); - - label4.Resize(600, 30); - label4.Move(0, 1050); - label4.Show(); - - changeSelectable.Resize(600, 100); - changeSelectable.Move(0, 1080); - changeSelectable.Show(); - - setTime.Resize(600, 100); - setTime.Move(0, 1180); - setTime.Show(); - } - } -} \ No newline at end of file diff --git a/test/ElmSharp.Test/TC/CheckTest1.cs b/test/ElmSharp.Test/TC/CheckTest1.cs deleted file mode 100644 index e11c83528..000000000 --- a/test/ElmSharp.Test/TC/CheckTest1.cs +++ /dev/null @@ -1,74 +0,0 @@ -/* - * 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 ElmSharp; - -namespace ElmSharp.Test -{ - class CheckTest1 : TestCaseBase - { - public override string TestName => "CheckTest1"; - public override string TestDescription => "To test basic operation of Check"; - - public override void Run(Window window) - { - Background bg = new Background(window); - bg.Color = Color.White; - bg.Move(0, 0); - bg.Resize(window.ScreenSize.Width, window.ScreenSize.Height); - bg.Show(); - - Check check = new Check(window) - { - Text = "This is Check", - Style = "default", - }; - - Label label1 = new Label(window) { - Text = string.Format("IsChecked ={0}, Style={1}", check.IsChecked, check.Style), - }; - - Label label2 = new Label(window); - - Label label3 = new Label(window); - - check.StateChanged += (object sender, CheckStateChangedEventArgs e) => - { - check.Style = check.Style == "default" ? "on&off": "default"; - label1.Text = string.Format("IsChecked ={0}, Style={1}", check.IsChecked, check.Style); - label2.Text = string.Format("OldState={0}", e.OldState); - label3.Text = string.Format("NewState={0}", e.NewState); - }; - - check.Resize(600, 100); - check.Move(0, 300); - check.Show(); - - label1.Resize(600, 100); - label1.Move(0, 0); - label1.Show(); - - label2.Resize(600, 100); - label2.Move(0, 100); - label2.Show(); - - label3.Resize(600, 100); - label3.Move(0, 200); - label3.Show(); - } - } -} \ No newline at end of file diff --git a/test/ElmSharp.Test/TC/ClipperTest1.cs b/test/ElmSharp.Test/TC/ClipperTest1.cs deleted file mode 100644 index d222bbc58..000000000 --- a/test/ElmSharp.Test/TC/ClipperTest1.cs +++ /dev/null @@ -1,89 +0,0 @@ -/* - * 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 ElmSharp; - -namespace ElmSharp.Test -{ - public class ClipperTest1 : TestCaseBase - { - public override string TestName => "ClipperTest1"; - public override string TestDescription => "ClipperTest1 test"; - - public override void Run(Window window) - { - Conformant conformant = new Conformant(window); - conformant.Show(); - - Naviframe navi = new Naviframe(window) - { - PreserveContentOnPop = true, - DefaultBackButtonEnabled = true - }; - - Scroller scroller = new Scroller(window) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - ScrollBlock = ScrollBlock.None, - }; - scroller.Show(); - Box container = new Box(window); - scroller.SetContent(container); - - var rect1 = new Rectangle(window) - { - AlignmentX = -1, - WeightX = 1, - Color = Color.Blue, - MinimumHeight = 500 - }; - rect1.Show(); - - var clipper = new Rectangle(window); - clipper.Color = new ElmSharp.Color(200, 200, 200, 200); - clipper.Geometry = rect1.Geometry; - rect1.Moved += (s, e) => - { - clipper.Geometry = ((Rectangle)s).Geometry; - }; - rect1.SetClip(clipper); - clipper.Show(); - container.PackEnd(rect1); - - Color[] colors = { Color.Red, Color.Olive, Color.Green, Color.Gray, Color.Lime, Color.Maroon }; - for (int i = 0; i < 6; i++) - { - var rect = new Rectangle(window) - { - AlignmentX = -1, - WeightX = 1, - Color = colors[i], - MinimumHeight = 500 - }; - rect.Show(); - container.PackEnd(rect); - } - - navi.Push(scroller, "Scroll Page"); - navi.Show(); - conformant.SetContent(navi); - } - } -} diff --git a/test/ElmSharp.Test/TC/ColorSelectorTest1.cs b/test/ElmSharp.Test/TC/ColorSelectorTest1.cs deleted file mode 100644 index 1938d60b3..000000000 --- a/test/ElmSharp.Test/TC/ColorSelectorTest1.cs +++ /dev/null @@ -1,69 +0,0 @@ -/* - * 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 ElmSharp; - -namespace ElmSharp.Test -{ - class ColorSelectorTest1 : TestCaseBase - { - public override string TestName => "ColorSelectorTest1"; - public override string TestDescription => "To test basic operation of ColorSelector"; - - public override void Run(Window window) - { - Background bg = new Background(window); - bg.Color = Color.White; - bg.Move(0, 0); - bg.Resize(window.ScreenSize.Width, window.ScreenSize.Height); - bg.Show(); - - ColorSelector cs = new ColorSelector(window); - - Label label1 = new Label(window) { - Text = string.Format("Selected Color={0}", cs.SelectedColor), - }; - - Label label2 = new Label(window); - - Label label3 = new Label(window); - - cs.ColorChanged += (object sender, ColorChangedEventArgs e) => - { - label1.Text = string.Format("Selected Color={0}", cs.SelectedColor); - label2.Text = string.Format("Old Color={0}", e.OldColor); - label3.Text = string.Format("New Color={0}", e.NewColor); - }; - - cs.Resize(600, 600); - cs.Move(0, 300); - cs.Show(); - - label1.Resize(600, 100); - label1.Move(0, 0); - label1.Show(); - - label2.Resize(600, 100); - label2.Move(0, 100); - label2.Show(); - - label3.Resize(600, 100); - label3.Move(0, 200); - label3.Show(); - } - } -} \ No newline at end of file diff --git a/test/ElmSharp.Test/TC/ContextPopupTest1.cs b/test/ElmSharp.Test/TC/ContextPopupTest1.cs deleted file mode 100644 index 22ef5caa5..000000000 --- a/test/ElmSharp.Test/TC/ContextPopupTest1.cs +++ /dev/null @@ -1,76 +0,0 @@ -/* - * 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 ElmSharp; - -namespace ElmSharp.Test -{ - public class ContextPopupTest1 : TestCaseBase - { - public override string TestName => "ContextPopupTest1"; - public override string TestDescription => "To test basic operation of ContextPopup"; - private int _count = 0; - public override void Run(Window window) - { - Background bg = new Background(window); - bg.Color = Color.White; - bg.Move(0, 0); - bg.Resize(window.ScreenSize.Width, window.ScreenSize.Height); - bg.Show(); - - ContextPopup ctxPopup = new ContextPopup(bg) - { - IsHorizontal = false, - AutoHide = false, - }; - - for (int i = 0; i < 5; i++) - { - ctxPopup.Append(string.Format("{0} item", _count++)); - } - - ctxPopup.Dismissed += (e, o) => { - Console.WriteLine("Dismissed"); - }; - ctxPopup.Show(); - - bool ctxPopupVisible = true; - string dismissCaption = "Dismiss ContextPopup!"; - string showCaption = "Show ContextPopup!"; - - Button button = new Button(window) { - Text = dismissCaption - }; - button.Clicked += (E, o) => - { - if(ctxPopupVisible) - { - ctxPopup.Dismiss(); - } - else - { - ctxPopup.Show(); - } - ctxPopupVisible = !ctxPopupVisible; - button.Text = ctxPopupVisible?dismissCaption:showCaption; - }; - button.Move(200, 100); - button.Resize(500, 100); - button.Show(); - } - } -} diff --git a/test/ElmSharp.Test/TC/DateTimeSelectorTest1.cs b/test/ElmSharp.Test/TC/DateTimeSelectorTest1.cs deleted file mode 100644 index 2cd239e08..000000000 --- a/test/ElmSharp.Test/TC/DateTimeSelectorTest1.cs +++ /dev/null @@ -1,75 +0,0 @@ -/* - * 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.Collections.Generic; -using ElmSharp; - -namespace ElmSharp.Test -{ - class DateTimeSelectorTest1 : TestCaseBase - { - public override string TestName => "DateTimeSelectorTest1"; - public override string TestDescription => "To test basic operation of DateTimeSelector"; - - public override void Run(Window window) - { - Background bg = new Background(window); - bg.Color = Color.Gray; - bg.Move(0, 0); - bg.Resize(window.ScreenSize.Width, window.ScreenSize.Height); - bg.Show(); - - DateTimeSelector dateTime = new DateTimeSelector(window) - { - MinimumDateTime = new DateTime(2015,1,1), - MaximumDateTime = DateTime.Now, - DateTime = DateTime.Now - }; - - Label label1 = new Label(window); - - Label label2 = new Label(window); - - Label label3 = new Label(window) { - Text = string.Format("Current DateTime={0}", dateTime.DateTime), - }; - - dateTime.DateTimeChanged += (object sender, DateChangedEventArgs e) => - { - label1.Text = string.Format("Old DateTime={0}", e.OldDate); - label2.Text = string.Format("New DateTime={0}", e.NewDate); - label3.Text = string.Format("Current DateTime={0}", dateTime.DateTime); - }; - - dateTime.Resize(720, 600); - dateTime.Move(0, 300); - dateTime.Show(); - - label1.Resize(600, 100); - label1.Move(0, 0); - label1.Show(); - - label2.Resize(600, 100); - label2.Move(0, 100); - label2.Show(); - - label3.Resize(600, 100); - label3.Move(0, 200); - label3.Show(); - } - } -} \ No newline at end of file diff --git a/test/ElmSharp.Test/TC/DateTimeSelectorTest2.cs b/test/ElmSharp.Test/TC/DateTimeSelectorTest2.cs deleted file mode 100644 index bbe8c75a1..000000000 --- a/test/ElmSharp.Test/TC/DateTimeSelectorTest2.cs +++ /dev/null @@ -1,75 +0,0 @@ -/* - * 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.Collections.Generic; -using ElmSharp; - -namespace ElmSharp.Test -{ - class DateTimeSelectorTest2 : TestCaseBase - { - public override string TestName => "DateTimeSelectorTest2"; - public override string TestDescription => "To test basic operation of DateTimeSelector"; - - public override void Run(Window window) - { - Background bg = new Background(window); - bg.Color = Color.Gray; - bg.Move(0, 0); - bg.Resize(window.ScreenSize.Width, window.ScreenSize.Height); - bg.Show(); - - DateTimeSelector dateTime = new DateTimeSelector(window) - { - DateTime = DateTime.Today, - Style = "time_layout", - Format = "%d/%b/%Y %I:%M %p" - }; - - Label label1 = new Label(window); - - Label label2 = new Label(window); - - Label label3 = new Label(window) { - Text = string.Format("Current DateTime={0}", dateTime.DateTime), - }; - - dateTime.DateTimeChanged += (object sender, DateChangedEventArgs e) => - { - label1.Text = string.Format("Old DateTime={0}", e.OldDate); - label2.Text = string.Format("New DateTime={0}", e.NewDate); - label3.Text = string.Format("Current DateTime={0}", dateTime.DateTime); - }; - - dateTime.Resize(720, 600); - dateTime.Move(0, 300); - dateTime.Show(); - - label1.Resize(600, 100); - label1.Move(0, 0); - label1.Show(); - - label2.Resize(600, 100); - label2.Move(0, 100); - label2.Show(); - - label3.Resize(600, 100); - label3.Move(0, 200); - label3.Show(); - } - } -} diff --git a/test/ElmSharp.Test/TC/EcoreTimelineAnimatorTest1.cs b/test/ElmSharp.Test/TC/EcoreTimelineAnimatorTest1.cs deleted file mode 100644 index e112cbb70..000000000 --- a/test/ElmSharp.Test/TC/EcoreTimelineAnimatorTest1.cs +++ /dev/null @@ -1,87 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using ElmSharp; - -namespace ElmSharp.Test -{ - class EcoreTimelineAnimatorTest1 : TestCaseBase - - { - public override string TestName => "Timeline Animator Test1"; - - public override string TestDescription => "Ecore Timeline Animator Test1"; - - EcoreTimelineAnimator timelineAnimator; - - int X1, Y1, X2, Y2; - - Tuple[] mappers = - { - new Tuple("Linear", new LinearMotionMapper()), - new Tuple("Accelerate", new AccelerateMotionMapper()), - new Tuple("Decelerate", new DecelerateMotionMapper()), - new Tuple("Sinusoida", new SinusoidalMotionMapper()), - new Tuple("Bounce", new BounceMotionMapper{ Bounces = 3, DecayFactor = 1.8 }), - new Tuple("Spring", new SpringMotionMapper{ Wobbles = 3, DecayFactor = 1.8 }), - new Tuple("AccelerateFactor", new AccelerateFactorMotionMapper{ PowerFactor = 1.5 }), - new Tuple("DecelerateFactor", new DecelerateFactorMotionMapper{ PowerFactor = 1.5 }), - new Tuple("SinusoidaFactor", new SinusoidalFactorMotionMapper{ PowerFactor = 1.5 }), - new Tuple("DivisorInterpolate", new DivisorInterpolatedMotionMapper{ Divisor = 1.0, Power = 2.0 }), - new Tuple("CubicBezier", new CubicBezierMotionMapper{ X1 = 0, X2 = 1, Y1 = 0, Y2 = 1}) - }; - - int map_index = 0; - - Rectangle square; - - public override void Run(Window window) - { - Rect rect = new Rect(0, 0, window.ScreenSize.Width, window.ScreenSize.Height); - - X1 = rect.X; - Y1 = rect.Y; - X2 = rect.X + rect.Width - rect.Width / 10; - Y2 = rect.Y; - - square = new Rectangle(window) - { - Geometry = new Rect(X1, Y1, rect.Width / 10, rect.Height / 6), - Color = Color.Red - }; - square.Show(); - - Button btn = new Button(window) - { - Geometry = new Rect(rect.X, rect.Y + rect.Height - rect.Height / 4, rect.Width, rect.Height / 4), - Text = mappers[map_index].Item1 - }; - btn.Show(); - - timelineAnimator = new EcoreTimelineAnimator(1.0, OnTimeline); - - btn.Clicked += Btn_Clicked; - timelineAnimator.Finished += (s, e) => - { - map_index = (map_index + 1) % mappers.Length; - btn.IsEnabled = true; - }; - } - - private void Btn_Clicked(object sender, EventArgs e) - { - timelineAnimator.Start(); - ((Button)sender).IsEnabled = false; - Log.Debug(mappers[map_index].Item1); - } - - void OnTimeline() - { - double o = mappers[map_index].Item2.Caculate(timelineAnimator.Position); - int x = (int)((X2 * o) + (X1 * (1.0 - o))); - int y = (int)((Y2 * o) + (Y1 * (1.0 - o))); - - square.Move(x, y); - } - } -} diff --git a/test/ElmSharp.Test/TC/EcoreTimerTest1.cs b/test/ElmSharp.Test/TC/EcoreTimerTest1.cs deleted file mode 100644 index 325f6a46b..000000000 --- a/test/ElmSharp.Test/TC/EcoreTimerTest1.cs +++ /dev/null @@ -1,86 +0,0 @@ -/* - * 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 ElmSharp.Test -{ - class EcoreTimerTest1 : TestCaseBase - { - public override string TestName => "EcoreTimerTest1"; - public override string TestDescription => "To timer operation of EcoreMainLoop"; - - public override void Run(Window window) - { - Background bg = new Background(window) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - Color = Color.White - }; - bg.Show(); - window.AddResizeObject(bg); - - Conformant conformant = new Conformant(window); - conformant.Show(); - - - int number = 0; - bool bReturn = true; - Label label1 = new Label(window); - label1.Move(150, 150); - label1.Resize(300, 100); - - Button btnTimerSwitch = new Button(window); - btnTimerSwitch.Text = "Timer : On"; - btnTimerSwitch.Move(0, 300); - btnTimerSwitch.Resize(300, 100); - - Func handler = () => - { - label1.Text = (++number).ToString(); - label1.EdjeObject["elm.text"].TextStyle = "DEFAULT='color=#000000 font_size=64 align=left valign=bottom wrap=word'"; - return bReturn; - }; - IntPtr prevId = EcoreMainloop.AddTimer(1.0, handler); - btnTimerSwitch.Clicked += (s, e) => - { - if(bReturn) - { - bReturn = false; - btnTimerSwitch.Text = "Timer : Off"; - } - else - { - bReturn = true; - btnTimerSwitch.Text = "Timer : On"; - EcoreMainloop.RemoveTimer(prevId); - prevId = EcoreMainloop.AddTimer(1.0, handler); - } - }; - - window.BackButtonPressed += (s, e) => - { - EcoreMainloop.RemoveTimer(prevId); - }; - - label1.Show(); - btnTimerSwitch.Show(); - } - } -} diff --git a/test/ElmSharp.Test/TC/EntryTest1.cs b/test/ElmSharp.Test/TC/EntryTest1.cs deleted file mode 100644 index 2dc84375f..000000000 --- a/test/ElmSharp.Test/TC/EntryTest1.cs +++ /dev/null @@ -1,164 +0,0 @@ -/* - * 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 ElmSharp; - -namespace ElmSharp.Test -{ - class EntryTest1 : TestCaseBase - { - public override string TestName => "EntryTest1"; - public override string TestDescription => "To test basic operation of Entry"; - - public override void Run(Window window) - { - Background bg = new Background(window) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - Color = Color.White - }; - bg.Show(); - window.AddResizeObject(bg); - - Conformant conformant = new Conformant(window); - conformant.Show(); - Box box = new Box(window); - conformant.SetContent(box); - box.Show(); - - Entry entry1 = new Entry(window) - { - AlignmentX = -1, - AlignmentY = 0, - WeightX = 1, - WeightY = 1, - IsSingleLine = true, - }; - entry1.SetPartText("guide", "Single Line"); - - Entry entry2 = new Entry(window) - { - AlignmentX = -1, - AlignmentY = 0, - WeightX = 1, - WeightY = 1, - IsPassword = true - }; - entry2.SetPartText("guide", "Password"); - - Entry entry3 = new Entry(window) - { - AlignmentX = -1, - AlignmentY = 0, - WeightX = 1, - WeightY = 1, - IsSingleLine = true, - Scrollable = true, - }; - entry3.SetPartText("guide", "Enter a System.Double"); - //entry3.Geometry = new Rect(0, 163, 720, 37); - entry3.Show(); - - var capital1 = new Entry(window) - { - AlignmentX = -1, - AlignmentY = 0, - WeightX = 1, - WeightY = 1, - Text = "Auto Capital : Word", - AutoCapital = AutoCapital.Word - }; - - var capital2 = new Entry(window) - { - AlignmentX = -1, - AlignmentY = 0, - WeightX = 1, - WeightY = 1, - Text = "Auto Capital : Sentence", - AutoCapital = AutoCapital.Sentence - }; - - var capital3 = new Entry(window) - { - AlignmentX = -1, - AlignmentY = 0, - WeightX = 1, - WeightY = 1, - Text = "Auto Capital : All", - AutoCapital = AutoCapital.All - }; - - var getText = new Entry(window) - { - AlignmentX = -1, - AlignmentY = 0, - WeightX = 1, - WeightY = 1, - Text = "get cursor content test", - }; - - var label = new Label(window) - { - AlignmentX = -1, - AlignmentY = 0, - WeightX = 1, - WeightY = 1, - }; - - getText.CursorChanged += (s, e) => - { - label.Text = getText.GetCursorContent(); - }; - - //var autoSave = new Entry(window) - //{ - // AlignmentX = -1, - // AlignmentY = 0, - // WeightX = 1, - // WeightY = 1, - // Text = "Auto Save", - // IsAutoSave = true - //}; - - var btn = new Button(window) - { - }; - - box.PackEnd(entry1); - box.PackEnd(entry2); - box.PackEnd(entry3); - box.PackEnd(capital1); - box.PackEnd(capital2); - box.PackEnd(capital3); - box.PackEnd(getText); - box.PackEnd(label); - - entry1.Show(); - entry2.Show(); - entry3.Show(); - capital1.Show(); - capital2.Show(); - capital3.Show(); - getText.Show(); - label.Show(); - } - } -} \ No newline at end of file diff --git a/test/ElmSharp.Test/TC/EntryTest2.cs b/test/ElmSharp.Test/TC/EntryTest2.cs deleted file mode 100644 index 06c9f7c18..000000000 --- a/test/ElmSharp.Test/TC/EntryTest2.cs +++ /dev/null @@ -1,80 +0,0 @@ -/* - * 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 ElmSharp; - -namespace ElmSharp.Test -{ - class EntryTest2 : TestCaseBase - { - public override string TestName => "EntryTest2"; - public override string TestDescription => "To test basic operation of Entry"; - - public override void Run(Window window) - { - Background bg = new Background(window) { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - Color = Color.Yellow - }; - bg.Show(); - window.AddResizeObject(bg); - - Conformant conformant = new Conformant(window); - conformant.Show(); - Box box = new Box(window); - conformant.SetContent(box); - box.Show(); - - Check check = new Check(window) { - AlignmentX = -1, - AlignmentY = 0.9, - WeightX = 1, - WeightY = 0.1, - Text = "Select All", - }; - check.Show(); - - Entry entry = new Entry(window) { - AlignmentX = -1, - AlignmentY = 0.1, - WeightX = 1, - WeightY = 1, - IsSingleLine = true, - Text = "Hello, Tizen !!!" - }; - entry.Show(); - - check.StateChanged += (object sender, CheckStateChangedEventArgs e) => - { - if (e.NewState == true) - { - entry.SelectAll(); - } - else - { - entry.SelectNone(); - } - }; - - box.PackEnd(check); - box.PackEnd(entry); - } - } -} diff --git a/test/ElmSharp.Test/TC/EntryTest3.cs b/test/ElmSharp.Test/TC/EntryTest3.cs deleted file mode 100644 index 755f8876c..000000000 --- a/test/ElmSharp.Test/TC/EntryTest3.cs +++ /dev/null @@ -1,102 +0,0 @@ -/* - * 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 ElmSharp; - -namespace ElmSharp.Test -{ - class EntryTest3 : TestCaseBase - { - public override string TestName => "EntryTest3"; - public override string TestDescription => "To test basic operation of Entry"; - - public override void Run(Window window) - { - Background bg = new Background(window) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - Color = Color.Yellow - }; - bg.Show(); - window.AddResizeObject(bg); - - Conformant conformant = new Conformant(window); - conformant.Show(); - Box box = new Box(window); - conformant.SetContent(box); - box.Show(); - - Entry entry = new Entry(window) - { - AlignmentX = -1, - AlignmentY = 1, - WeightX = 1, - WeightY = 1, - IsSingleLine = true, - Text = "Hello, Tizen" - }; - - var btn = new Button(window) - { - AlignmentX = -1, - AlignmentY = 1, - WeightX = 1, - WeightY = 1, - Text = "Set Filter" - }; - btn.Show(); - - //var filter = new Entry.TextFilter(SetFilter); - btn.Clicked += (s, e) => - { - entry.AppendMarkUpFilter(SetFilter); - }; - - var btn1 = new Button(window) - { - AlignmentX = -1, - AlignmentY = 1, - WeightX = 1, - WeightY = 1, - Text = "Remove Filter" - }; - btn1.Show(); - btn1.Clicked += (s, e) => - { - entry.RemoveMarkUpFilter(SetFilter); - }; - - //entry.AppendMarkUpFilter(new Entry.Filter(SetFilter)); - - entry.Show(); - box.PackEnd(entry); - box.PackEnd(btn); - box.PackEnd(btn1); - } - - public string SetFilter(Entry entry, string text) - { - if (text.Equals("a") || text.Equals("b") || text.Equals("c") || text.Equals("d")) - return text; - else - return "Tizen"; - } - } -} \ No newline at end of file diff --git a/test/ElmSharp.Test/TC/EvasMapTest1.cs b/test/ElmSharp.Test/TC/EvasMapTest1.cs deleted file mode 100644 index 498dd1617..000000000 --- a/test/ElmSharp.Test/TC/EvasMapTest1.cs +++ /dev/null @@ -1,113 +0,0 @@ -using System; -using ElmSharp; - -namespace ElmSharp.Test -{ - class EvasMapTest1 : TestCaseBase - { - public override string TestName => "EvasMapTest1"; - public override string TestDescription => "Test EvasMap on different levels of hierarchy"; - - public override void Run(Window window) - { - var box = new Box(window) - { - IsHorizontal = false, - }; - box.SetAlignment(-1.0, -1.0); - box.SetWeight(1.0, 1.0); - box.Show(); - - var text = new Label(box) - { - Text = "Target", - AlignmentX = -1.0, - AlignmentY = -1.0, - WeightX = 1.0, - WeightY = 1.0, - }; - text.Show(); - - var textBox = new Box(box) - { - AlignmentX = -1.0, - WeightX = 1.0, - WeightY = 0.7, - }; - textBox.PackEnd(text); - textBox.Show(); - - double angle = 0.0; - - var reset = new Button(box) - { - Text = "Reset", - AlignmentX = -1.0, - WeightX = 1.0, - WeightY = 0.1, - }; - reset.Show(); - - double zx = 1.0; - double zy = 1.0; - reset.Clicked += (object sender, EventArgs e) => - { - text.IsMapEnabled = false; - angle = 0.0; - zx = 1.0; - zy = 1.0; - }; - - var zoom = new Button(box) - { - Text = "Zoom Target", - AlignmentX = -1.0, - WeightX = 1.0, - WeightY = 0.1, - }; - zoom.Show(); - - zoom.Clicked += (object sender, EventArgs e) => - { - zx += 0.1; - zy += 0.1; - var map = new EvasMap(4); - var g = text.Geometry; - map.PopulatePoints(g, 0); - map.Rotate3D(0, 0, angle, g.X + g.Width / 2, g.Y + g.Height / 2, 0); - map.Zoom(zx, zy, g.X, g.Y); - text.EvasMap = map; - text.IsMapEnabled = true; - }; - - var rotate = new Button(box) - { - Text = "Rotate Target", - AlignmentX = -1.0, - WeightX = 1.0, - WeightY = 0.1, - }; - rotate.Show(); - - rotate.Clicked += (object sender, EventArgs e) => - { - angle += 5.0; - var map = new EvasMap(4); - var g = text.Geometry; - map.PopulatePoints(g, 0); - map.Rotate3D(0, 0, angle, g.X + g.Width / 2, g.Y + g.Height / 2, 0); - map.Zoom(zx, zy, g.X, g.Y); - text.EvasMap = map; - text.IsMapEnabled = true; - }; - - box.PackEnd(textBox); - box.PackEnd(reset); - box.PackEnd(zoom); - box.PackEnd(rotate); - - box.Resize(window.ScreenSize.Width, window.ScreenSize.Height); - box.Move(0, 0); - } - } -} \ No newline at end of file diff --git a/test/ElmSharp.Test/TC/EvasMapTest2.cs b/test/ElmSharp.Test/TC/EvasMapTest2.cs deleted file mode 100644 index 17d411e8a..000000000 --- a/test/ElmSharp.Test/TC/EvasMapTest2.cs +++ /dev/null @@ -1,131 +0,0 @@ -using System; -using ElmSharp; - -namespace ElmSharp.Test -{ - class EvasMapTest2 : TestCaseBase - { - public override string TestName => "EvasMapTest2"; - public override string TestDescription => "Test EvasMap on different levels of hierarchy"; - - public override void Run(Window window) - { - var box = new Box(window) - { - IsHorizontal = false, - }; - box.SetAlignment(-1.0, -1.0); // fill - box.SetWeight(1.0, 1.0); // expand - box.Show(); - - var group = new Box(box) - { - IsHorizontal = true, - BackgroundColor = Color.White, - }; - group.Show(); - - var x = new Label(group) - { - Text = "X", - }; - x.Show(); - - var y = new Label(group) - { - Text = "Y", - }; - y.Show(); - - var z = new Label(group) - { - Text = "Z", - }; - z.Show(); - group.PackEnd(x); - group.PackEnd(y); - group.PackEnd(z); - - var top = new Rectangle(box) - { - Color = Color.Red, - }; - top.SetAlignment(-1.0, -1.0); // fill - top.SetWeight(1.0, 1.0); // expand - top.Show(); - - var bottom = new Rectangle(box) - { - Color = Color.Green, - }; - bottom.SetAlignment(-1.0, -1.0); // fill - bottom.SetWeight(1.0, 1.0); // expand - bottom.Show(); - - double angle = 0.0; - - var reset = new Button(box) - { - Text = "Reset", - AlignmentX = -1.0, - WeightX = 1.0, - }; - reset.Show(); - - reset.Clicked += (object sender, EventArgs e) => - { - group.IsMapEnabled = false; - x.IsMapEnabled = false; - angle = 0.0; - }; - - var zoom = new Button(box) - { - Text = "Zoom group", - AlignmentX = -1.0, - WeightX = 1.0, - }; - zoom.Show(); - - zoom.Clicked += (object sender, EventArgs e) => - { - var map = new EvasMap(4); - var g = group.Geometry; - map.PopulatePoints(g, 0); - map.Zoom(3.0, 3.0, g.X + g.Width / 2, g.Y + g.Height / 2); - group.EvasMap = map; - group.IsMapEnabled = true; - }; - - var rotate = new Button(box) - { - Text = "Rotate X", - AlignmentX = -1.0, - WeightX = 1.0, - }; - rotate.Show(); - - rotate.Clicked += (object sender, EventArgs e) => - { - angle += 5.0; - - var map = new EvasMap(4); - var g = x.Geometry; - map.PopulatePoints(g, 0); - map.Rotate3D(0, 0, angle, g.X + g.Width / 2, g.Y + g.Height / 2, 0); - x.EvasMap = map; - x.IsMapEnabled = true; - }; - - box.PackEnd(top); - box.PackEnd(group); - box.PackEnd(bottom); - box.PackEnd(reset); - box.PackEnd(zoom); - box.PackEnd(rotate); - - box.Resize(window.ScreenSize.Width, window.ScreenSize.Height); - box.Move(0, 0); - } - } -} \ No newline at end of file diff --git a/test/ElmSharp.Test/TC/EventTest1.cs b/test/ElmSharp.Test/TC/EventTest1.cs deleted file mode 100644 index 25dda2776..000000000 --- a/test/ElmSharp.Test/TC/EventTest1.cs +++ /dev/null @@ -1,130 +0,0 @@ -using System.Diagnostics; - -/* - * 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. - */ - -namespace ElmSharp.Test -{ - class EventTest1 : TestCaseBase - { - public override string TestName => "EventTest1"; - public override string TestDescription => "event propagation test"; - - Box gParent; - GestureLayer _gParentLayer, _parentLayer, childLayer, chLayer; - - public override void Run(Window window) - { - Conformant conformant = new Conformant(window); - conformant.Show(); - gParent = new Box(window) - { - BackgroundColor = Color.Yellow, - PassEvents = false, - PropagateEvents = false, - }; - conformant.SetContent(gParent); - - Box parent = new Box(gParent) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - BackgroundColor = Color.Green, - PassEvents = false, - PropagateEvents = false, - }; - Box child = new Box(parent) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - BackgroundColor = Color.Blue, - PassEvents = false, - PropagateEvents = false, - }; - - Check ch = new Check(child) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - BackgroundColor = Color.Silver, - PassEvents = false, - PropagateEvents = false, - }; - - gParent.PackEnd(parent); - parent.PackEnd(child); - child.PackEnd(ch); - - gParent.Show(); - parent.Show(); - child.Show(); - ch.Show(); - - _gParentLayer = new GestureLayer(gParent); - _gParentLayer.Attach(gParent); - _gParentLayer.SetTapCallback(GestureLayer.GestureType.Tap, GestureLayer.GestureState.End, (info) => - { - Debug.WriteLine($"@@@ Grand Parent Tap : {gParent.PassEvents}, {gParent.PropagateEvents}, {gParent.RepeatEvents}"); - }); - _parentLayer = new GestureLayer(parent); - _parentLayer.Attach(parent); - _parentLayer.SetTapCallback(GestureLayer.GestureType.Tap, GestureLayer.GestureState.End, (info) => - { - Debug.WriteLine($"@@@ Parent Tap : {parent.PassEvents}, {parent.PropagateEvents}, {parent.RepeatEvents}"); - }); - childLayer = new GestureLayer(child); - childLayer.Attach(child); - childLayer.SetTapCallback(GestureLayer.GestureType.Tap, GestureLayer.GestureState.End, (info) => - { - Debug.WriteLine($"@@@ Child Tap : {child.PassEvents}, {child.PropagateEvents}, {child.RepeatEvents}"); - }); - - chLayer = new GestureLayer(ch); - chLayer.Attach(ch); - chLayer.SetTapCallback(GestureLayer.GestureType.Tap, GestureLayer.GestureState.End, (info) => - { - Debug.WriteLine($"@@@ Check1 Tap : {ch.PassEvents}, {ch.PropagateEvents}, {ch.RepeatEvents}"); - }); - - EvasObjectEvent eventGrand = new EvasObjectEvent(gParent, EvasObjectCallbackType.MouseDown); - eventGrand.On += (s, e) => - { - Debug.WriteLine($"@@@ Grand Parent down : {gParent.PassEvents}, {gParent.PropagateEvents}, {gParent.RepeatEvents}"); - }; - EvasObjectEvent evnetParent = new EvasObjectEvent(parent, EvasObjectCallbackType.MouseDown); - evnetParent.On += (s, e) => - { - Debug.WriteLine($"@@@ Parent down : {parent.PassEvents}, {parent.PropagateEvents}, {parent.RepeatEvents}"); - }; - EvasObjectEvent eventChild = new EvasObjectEvent(child, EvasObjectCallbackType.MouseDown); - eventChild.On += (s, e) => - { - Debug.WriteLine($"@@@ Child down : {child.PassEvents}, {child.PropagateEvents}, {child.RepeatEvents}"); - }; - EvasObjectEvent eventCh = new EvasObjectEvent(ch, ch.RealHandle, EvasObjectCallbackType.MouseDown); - eventCh.On += (s, e) => - { - Debug.WriteLine($"@@@ Check down : {ch.PassEvents}, {ch.PropagateEvents}, {ch.RepeatEvents}"); - }; - } - } -} \ No newline at end of file diff --git a/test/ElmSharp.Test/TC/FlipSelectorTest.cs b/test/ElmSharp.Test/TC/FlipSelectorTest.cs deleted file mode 100644 index 0c2a85dce..000000000 --- a/test/ElmSharp.Test/TC/FlipSelectorTest.cs +++ /dev/null @@ -1,113 +0,0 @@ -using System; -using ElmSharp; - -namespace ElmSharp.Test -{ - public class FlipSelectorTest : TestCaseBase - { - public override string TestName => "FlipSelectorTest"; - public override string TestDescription => "To test FlipSelector"; - - public override void Run(Window window) - { - Conformant conformant = new Conformant(window); - conformant.Show(); - - Box outterBox = new Box(window) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - IsHorizontal = false, - }; - outterBox.Show(); - - Box box = new Box(window) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - IsHorizontal = true, - }; - box.Show(); - - FlipSelector flip = new FlipSelector(window) - { - Interval = 1.0, - }; - - flip.Append("two"); - flip.Prepend("one"); - - flip.Show(); - box.PackEnd(flip); - - conformant.SetContent(outterBox); - outterBox.PackEnd(box); - - Button prev = new Button(window) - { - AlignmentX = -1, - WeightX = 1, - Text = "Prev" - }; - prev.Clicked += (s, e) => { flip.Prev(); }; - prev.Show(); - - Button next = new Button(window) - { - AlignmentX = -1, - WeightX = 1, - Text = "next" - }; - next.Clicked += (s, e) => { flip.Next(); }; - next.Show(); - - Button prepend = new Button(window) - { - AlignmentX = -1, - WeightX = 1, - Text = "prepend" - }; - prepend.Clicked += (s, e) => { - - var random = new Random(); - int value = random.Next(99); - flip.Prepend(value.ToString()); - }; - prepend.Show(); - - Button append = new Button(window) - { - AlignmentX = -1, - WeightX = 1, - Text = "append" - }; - append.Clicked += (s, e) => { - - var random = new Random(); - int value = random.Next(99); - flip.Append(value.ToString()); - }; - append.Show(); - - Button remove = new Button(window) - { - AlignmentX = -1, - WeightX = 1, - Text = "remove" - }; - remove.Clicked += (s, e) => { flip.Remove(flip.SelectedItem); }; - remove.Show(); - - outterBox.PackEnd(box); - outterBox.PackEnd(prev); - outterBox.PackEnd(next); - outterBox.PackEnd(append); - outterBox.PackEnd(prepend); - outterBox.PackEnd(remove); - } - } -} diff --git a/test/ElmSharp.Test/TC/FloatingButtonTest.cs b/test/ElmSharp.Test/TC/FloatingButtonTest.cs deleted file mode 100644 index 61c0a6211..000000000 --- a/test/ElmSharp.Test/TC/FloatingButtonTest.cs +++ /dev/null @@ -1,143 +0,0 @@ -/* - * 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 ElmSharp; - -namespace ElmSharp.Test -{ - class FloatingButtonTest : TestCaseBase - { - public override string TestName => "FloatingButtonTest"; - public override string TestDescription => "To test FloatingButton"; - - Button _RedButton = null; - Button _GreenButton = null; - - public Button CreateButton(Window window, string text) - { - return new Button(window) - { - Text = text, - AlignmentY = -1, - AlignmentX = -1, - }; - } - - public override void Run(Window window) - { - Conformant conformant = new Conformant(window); - conformant.Show(); - Box box = new Box(window) - { - AlignmentY = -1, - AlignmentX = -1, - WeightX = 1, - WeightY = 1, - }; - box.Show(); - conformant.SetContent(box); - - FloatingButton floatingButton = new FloatingButton(window) - { - Mode = FloatingButtonMode.All, - AlignmentY = -1, - AlignmentX = -1, - WeightX = 1, - WeightY = 1, - }; - floatingButton.Show(); - floatingButton.Resize(700, 700); - floatingButton.Move(0, 400); - - Box backGround = new Box(window) - { - AlignmentY = -1, - AlignmentX = -1, - WeightX = 1, - WeightY = 1, - }; - backGround.Show(); - - Button button1 = CreateButton(window, "Mode change to LeftRightOnly"); - button1.Clicked += (s, e) => { - if (floatingButton.Mode == FloatingButtonMode.All) - { - floatingButton.Mode = FloatingButtonMode.LeftRightOnly; - button1.Text = "Mode change to All"; - } - else - { - floatingButton.Mode = FloatingButtonMode.All; - button1.Text = "Mode change to LeftRightOnly"; - } - }; - button1.Show(); - - Button button2 = CreateButton(window, "MovementBlock Set"); - button2.Clicked += (s, e) => { - floatingButton.MovementBlock = !floatingButton.MovementBlock; - if (floatingButton.MovementBlock) button2.Text = "MovementBlock Unset"; - else button2.Text = "MovementBlock Set"; - }; - button2.Show(); - - Button button3 = CreateButton(window, "RedButton Set"); - button3.Clicked += (s, e) => { - if (_RedButton == null) - { - _RedButton = CreateButton(window, "RedButton"); - _RedButton.BackgroundColor = Color.Red; - floatingButton.SetPartContent("button1", _RedButton, true); - button3.Text = "RedButton Unset"; - } - else - { - _RedButton.Unrealize(); - _RedButton = null; - floatingButton.SetPartContent("button1", _RedButton, true); - button3.Text = "RedButton Set"; - } - }; - button3.Show(); - - Button button4 = CreateButton(window, "GreenButton Set"); - button4.Clicked += (s, e) => { - if (_GreenButton == null) - { - _GreenButton = CreateButton(window, "GreenButton"); - _GreenButton.BackgroundColor = Color.Green; - floatingButton.SetPartContent("button2", _GreenButton, true); - button4.Text = "GreenButton Unset"; - } - else - { - _GreenButton.Unrealize(); - _GreenButton = null; - floatingButton.SetPartContent("button2", _GreenButton, true); - button4.Text = "GreenButton Unset"; - } - }; - button4.Show(); - - box.PackEnd(backGround); - box.PackEnd(button1); - box.PackEnd(button2); - box.PackEnd(button3); - box.PackEnd(button4); - } - } -} \ No newline at end of file diff --git a/test/ElmSharp.Test/TC/FocusAutoScrollModeTest.cs b/test/ElmSharp.Test/TC/FocusAutoScrollModeTest.cs deleted file mode 100644 index c0aa049c0..000000000 --- a/test/ElmSharp.Test/TC/FocusAutoScrollModeTest.cs +++ /dev/null @@ -1,203 +0,0 @@ -/* - * 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 ElmSharp; - -namespace ElmSharp.Test -{ - public class FocusAutoScrollModeTest : TestCaseBase - { - public override string TestName => "FocusAutoScrollModeTest"; - public override string TestDescription => "To test basic operation of Elementary.FocusAutoScrollMode"; - - public override void Run(Window window) - { - Conformant conformant = new Conformant(window); - conformant.Show(); - GenGrid grid = new GenGrid(window) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - ItemAlignmentX = -1, - ItemAlignmentY = -1, - ItemWidth = window.ScreenSize.Width / 3, - ItemHeight = window.ScreenSize.Width / 3, - }; - - GenItemClass defaultClass = new GenItemClass("default") - { - GetTextHandler = (obj, part) => - { - Color item = (Color)obj; - return String.Format("#{0:X}{1:X}{2:X}", item.R, item.G, item.B); - }, - GetContentHandler = (obj, part) => - { - Color item = (Color)obj; - if (part == "elm.swallow.icon") - { - var colorbox = new Rectangle(window) - { - Color = item - }; - return colorbox; - } - return null; - } - - }; - - GenGridItem firstitem = null; - GenGridItem lastitem = null; - - var rnd = new Random(); - for (int i = 0; i < 102; i++) - { - int r = rnd.Next(255); - int g = rnd.Next(255); - int b = rnd.Next(255); - Color color = Color.FromRgb(r, g, b); - var item = grid.Append(defaultClass, color); - if (i == 0) - firstitem = item; - if (i == 101) - lastitem = item; - } - grid.Show(); - Box box = new Box(window) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - }; - box.Show(); - conformant.SetContent(box); - - box.PackEnd(grid); - - Button show = new Button(window) - { - Text = "Show", - AlignmentX = -1, - WeightX = 1, - }; - Button none = new Button(window) - { - Text = "None", - AlignmentX = -1, - WeightX = 1, - }; - Button bringIn = new Button(window) - { - Text = "BringIn", - AlignmentX = -1, - WeightX = 1, - }; - - show.Clicked += (s, e) => - { - Elementary.FocusAutoScrollMode = FocusAutoScrollMode.Show; - Console.WriteLine("FocusAutoScrollMode : {0}", Elementary.FocusAutoScrollMode); - }; - none.Clicked += (s, e) => - { - Elementary.FocusAutoScrollMode = FocusAutoScrollMode.None; - Console.WriteLine("FocusAutoScrollMode : {0}", Elementary.FocusAutoScrollMode); - }; - bringIn.Clicked += (s, e) => - { - Elementary.FocusAutoScrollMode = FocusAutoScrollMode.BringIn; - Console.WriteLine("FocusAutoScrollMode : {0}", Elementary.FocusAutoScrollMode); - }; - - show.Show(); - none.Show(); - bringIn.Show(); - - box.PackEnd(show); - box.PackEnd(none); - box.PackEnd(bringIn); - - grid.ItemActivated += Grid_ItemActivated; - grid.ItemSelected += Grid_ItemSelected; - grid.ItemUnselected += Grid_ItemUnselected; - grid.ItemRealized += Grid_ItemRealized; - grid.ItemUnrealized += Grid_ItemUnrealized; - grid.ItemPressed += Grid_ItemPressed; - grid.ItemReleased += Grid_ItemReleased; - grid.ItemLongPressed += Grid_ItemLongPressed; - grid.ItemDoubleClicked += Grid_ItemDoubleClicked; - } - - private void Grid_ItemDoubleClicked(object sender, GenGridItemEventArgs e) - { - Color color = (Color)e.Item.Data; - Console.WriteLine("#{0:X}{1:X}{2:X} is Double clicked", color.R, color.G, color.B); - } - - private void Grid_ItemLongPressed(object sender, GenGridItemEventArgs e) - { - Color color = (Color)e.Item.Data; - Console.WriteLine("#{0:X}{1:X}{2:X} is LongPressed", color.R, color.G, color.B); - } - - private void Grid_ItemReleased(object sender, GenGridItemEventArgs e) - { - Color color = (Color)e.Item.Data; - Console.WriteLine("#{0:X}{1:X}{2:X} is Released", color.R, color.G, color.B); - } - - private void Grid_ItemPressed(object sender, GenGridItemEventArgs e) - { - Color color = (Color)e.Item.Data; - Console.WriteLine("#{0:X}{1:X}{2:X} is Pressed", color.R, color.G, color.B); - } - - private void Grid_ItemUnselected(object sender, GenGridItemEventArgs e) - { - Color color = (Color)e.Item.Data; - Console.WriteLine("#{0:X}{1:X}{2:X} is Unselected", color.R, color.G, color.B); - } - - private void Grid_ItemRealized(object sender, GenGridItemEventArgs e) - { - Color color = (Color)e.Item.Data; - Console.WriteLine("#{0:X}{1:X}{2:X} is Realized", color.R, color.G, color.B); - } - - private void Grid_ItemUnrealized(object sender, GenGridItemEventArgs e) - { - Color color = (Color)e.Item.Data; - Console.WriteLine("#{0:X}{1:X}{2:X} is Unrealized", color.R, color.G, color.B); - } - - private void Grid_ItemSelected(object sender, GenGridItemEventArgs e) - { - Color color = (Color)e.Item.Data; - Console.WriteLine("#{0:X}{1:X}{2:X} is Selected", color.R, color.G, color.B); - } - - private void Grid_ItemActivated(object sender, GenGridItemEventArgs e) - { - Color color = (Color)e.Item.Data; - Console.WriteLine("#{0:X}{1:X}{2:X} is Activated", color.R, color.G, color.B); - } - } -} diff --git a/test/ElmSharp.Test/TC/FocusTest1.cs b/test/ElmSharp.Test/TC/FocusTest1.cs deleted file mode 100644 index 033280bd8..000000000 --- a/test/ElmSharp.Test/TC/FocusTest1.cs +++ /dev/null @@ -1,288 +0,0 @@ -/* - * 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 ElmSharp.Test -{ - public class FocusTest1 : TestCaseBase - { - public override string TestName => "FocusTest1"; - public override string TestDescription => "To test basic operation of Focus"; - - Button currentButton; - Label lbInfo; - - public override void Run(Window window) - { - Conformant conformant = new Conformant(window); - conformant.Show(); - Box box = new Box(window); - conformant.SetContent(box); - box.Show(); - - Box buttonBox1 = new Box(window) - { - IsHorizontal = true, - AlignmentX = -1, - AlignmentY = 0, - }; - buttonBox1.Show(); - - Box buttonBox2 = new Box(window) - { - IsHorizontal = true, - AlignmentX = -1, - AlignmentY = 0, - }; - buttonBox2.Show(); - - Box buttonBox3 = new Box(window) - { - IsHorizontal = true, - AlignmentX = -1, - AlignmentY = 0, - }; - buttonBox3.Show(); - - Button leftButton = new Button(window) - { - Text = "Left", - BackgroundColor = Color.Gray, - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1 - }; - leftButton.Show(); - - Button rightButton = new Button(window) - { - Text = "Right", - BackgroundColor = Color.Gray, - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1 - }; - rightButton.Show(); - - Button upButton = new Button(window) - { - Text = "Up", - BackgroundColor = Color.Gray, - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1 - }; - upButton.Show(); - - Button downButton = new Button(window) - { - Text = "Down", - BackgroundColor = Color.Gray, - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1 - }; - downButton.Show(); - - leftButton.Focused += Button_Focused; - leftButton.Unfocused += Button_Unfocused; - rightButton.Focused += Button_Focused; - rightButton.Unfocused += Button_Unfocused; - upButton.Focused += Button_Focused; - upButton.Unfocused += Button_Unfocused; - downButton.Focused += Button_Focused; - downButton.Unfocused += Button_Unfocused; - - leftButton.AllowFocus(false); - rightButton.AllowFocus(false); - upButton.AllowFocus(false); - downButton.AllowFocus(false); - - buttonBox1.PackEnd(leftButton); - buttonBox1.PackEnd(rightButton); - buttonBox1.PackEnd(upButton); - buttonBox1.PackEnd(downButton); - - Button buttonA = new Button(window) - { - Text = "A", - AlignmentX = 0.5, - WeightX = 1, - WeightY = 1 - }; - buttonA.Show(); - - Button buttonB = new Button(window) - { - Text = "B", - AlignmentX = 0.5, - WeightX = 1, - WeightY = 1 - }; - buttonB.Show(); - - buttonBox2.PackEnd(buttonA); - buttonBox2.PackEnd(buttonB); - - buttonA.Focused += Button_Focused; - buttonA.Unfocused += Button_Unfocused; - buttonB.Focused += Button_Focused; - buttonB.Unfocused += Button_Unfocused; - - Button itemButton1 = new Button(window) - { - Text = "No.1", - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1 - }; - itemButton1.Show(); - - Button itemButton2 = new Button(window) - { - Text = "No.2", - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1 - }; - itemButton2.Show(); - - Button itemButton3 = new Button(window) - { - Text = "No.3", - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1 - }; - itemButton3.Show(); - - Button itemButton4 = new Button(window) { - Text = "No.4", - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1 - }; - itemButton4.Show(); - - itemButton1.Focused += Button_Focused; - itemButton1.Unfocused += Button_Unfocused; - itemButton2.Focused += Button_Focused; - itemButton2.Unfocused += Button_Unfocused; - itemButton3.Focused += Button_Focused; - itemButton3.Unfocused += Button_Unfocused; - itemButton4.Focused += Button_Focused; - itemButton4.Unfocused += Button_Unfocused; - - itemButton1.SetNextFocusObject(itemButton4, FocusDirection.Left); - itemButton2.SetNextFocusObject(itemButton1, FocusDirection.Left); - itemButton3.SetNextFocusObject(itemButton2, FocusDirection.Left); - itemButton4.SetNextFocusObject(itemButton3, FocusDirection.Left); - itemButton1.SetNextFocusObject(itemButton2, FocusDirection.Right); - itemButton2.SetNextFocusObject(itemButton3, FocusDirection.Right); - itemButton3.SetNextFocusObject(itemButton4, FocusDirection.Right); - itemButton4.SetNextFocusObject(itemButton1, FocusDirection.Right); - itemButton1.SetNextFocusObject(buttonA, FocusDirection.Up); - itemButton2.SetNextFocusObject(buttonA, FocusDirection.Up); - itemButton3.SetNextFocusObject(buttonA, FocusDirection.Up); - itemButton4.SetNextFocusObject(buttonA, FocusDirection.Up); - - buttonA.SetNextFocusObject(buttonB, FocusDirection.Left); - buttonB.SetNextFocusObject(buttonA, FocusDirection.Left); - buttonA.SetNextFocusObject(buttonB, FocusDirection.Right); - buttonB.SetNextFocusObject(buttonA, FocusDirection.Right); - buttonA.SetNextFocusObject(itemButton1, FocusDirection.Down); - buttonB.SetNextFocusObject(itemButton1, FocusDirection.Down); - - buttonBox3.PackEnd(itemButton1); - buttonBox3.PackEnd(itemButton2); - buttonBox3.PackEnd(itemButton3); - buttonBox3.PackEnd(itemButton4); - - leftButton.Clicked += (s, e) => - { - if (currentButton != null) - { - currentButton.FocusNext(FocusDirection.Left); - } - }; - rightButton.Clicked += (s, e) => - { - if (currentButton != null) - { - currentButton.FocusNext(FocusDirection.Right); - } - }; - upButton.Clicked += (s, e) => - { - if (currentButton != null) - { - currentButton.FocusNext(FocusDirection.Up); - } - }; - downButton.Clicked += (s, e) => - { - if (currentButton != null) - { - currentButton.FocusNext(FocusDirection.Down); - } - }; - - lbInfo = new Label(window) { - Color = Color.White, - AlignmentX = -1, - AlignmentY = 0, - WeightX = 1 - }; - lbInfo.Show(); - - box.PackEnd(lbInfo); - box.PackEnd(buttonBox1); - box.PackEnd(buttonBox2); - box.PackEnd(buttonBox3); - } - - void Button_Focused(object sender, EventArgs e) - { - var btn = sender as Button; - if (btn!=null) - { - btn.BackgroundColor = Color.Red; - currentButton = btn; - lbInfo.Text = "Focused Button : " + btn.Text; - } - } - - void Button_Unfocused(object sender, EventArgs e) - { - var btn = sender as Button; - if (btn != null) - { - btn.BackgroundColor = Color.Default; - currentButton = btn; - lbInfo.Text = ""; - } - } - } -} diff --git a/test/ElmSharp.Test/TC/GenGridTest1.cs b/test/ElmSharp.Test/TC/GenGridTest1.cs deleted file mode 100644 index da4752eb5..000000000 --- a/test/ElmSharp.Test/TC/GenGridTest1.cs +++ /dev/null @@ -1,92 +0,0 @@ -/* - * 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 ElmSharp; - -namespace ElmSharp.Test -{ - public class GenGridTest1 : TestCaseBase - { - public override string TestName => "GenGridTest1"; - public override string TestDescription => "To test basic operation of GenGrid"; - - public override void Run(Window window) - { - Conformant conformant = new Conformant(window); - conformant.Show(); - GenGrid grid = new GenGrid(window) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - ItemAlignmentX = -1, - ItemAlignmentY = -1, - ItemWidth = window.ScreenSize.Width / 3, - ItemHeight = window.ScreenSize.Width / 3, - HorizontalScrollBarVisiblePolicy = ScrollBarVisiblePolicy.Invisible, - VerticalScrollBarVisiblePolicy = ScrollBarVisiblePolicy.Invisible - }; - - GenItemClass defaultClass = new GenItemClass("default") - { - GetTextHandler = (obj, part) => - { - Color item = (Color)obj; - return String.Format("#{0:X}{1:X}{2:X}", item.R, item.G, item.B); - }, - GetContentHandler = (obj, part) => - { - Color item = (Color)obj; - Console.WriteLine("{0} part create requested", part); - if (part == "elm.swallow.icon") - { - var colorbox = new Rectangle(window) - { - Color = item - }; - return colorbox; - } - return null; - } - }; - - var rnd = new Random(); - for (int i = 0; i < 10; i++) - { - int r = rnd.Next(255); - int g = rnd.Next(255); - int b = rnd.Next(255); - Color color = Color.FromRgb(r, g, b); - var griditem = grid.Append(defaultClass, color); - griditem.SetTooltipText("AAAAAA"); - //griditem.TooltipStyle = "transparent"; - - griditem.TooltipContentDelegate = () => { return new Button(window); }; - - } - - grid.Show(); - conformant.SetContent(grid); - } - - private void List_ItemSelected(object sender, GenListItemEventArgs e) - { - Console.WriteLine("{0} Item was selected", (string)(e.Item.Data)); - } - } -} \ No newline at end of file diff --git a/test/ElmSharp.Test/TC/GenGridTest2.cs b/test/ElmSharp.Test/TC/GenGridTest2.cs deleted file mode 100644 index c8de4b19f..000000000 --- a/test/ElmSharp.Test/TC/GenGridTest2.cs +++ /dev/null @@ -1,185 +0,0 @@ -/* - * 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 ElmSharp; - -namespace ElmSharp.Test -{ - public class GenGridTest2 : TestCaseBase - { - public override string TestName => "GenGridTest2"; - public override string TestDescription => "To test basic operation of GenGrid"; - - public override void Run(Window window) - { - Conformant conformant = new Conformant(window); - conformant.Show(); - GenGrid grid = new GenGrid(window) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - ItemAlignmentX = -1, - ItemAlignmentY = -1, - ItemWidth = window.ScreenSize.Width / 3, - ItemHeight = window.ScreenSize.Width / 3, - }; - - GenItemClass defaultClass = new GenItemClass("default") - { - GetTextHandler = (obj, part) => - { - Color item = (Color)obj; - return String.Format("#{0:X}{1:X}{2:X}", item.R, item.G, item.B); - }, - GetContentHandler = (obj, part) => - { - Color item = (Color)obj; - if (part == "elm.swallow.icon") - { - var colorbox = new Rectangle(window) - { - Color = item - }; - return colorbox; - } - return null; - } - - }; - - GenGridItem firstitem = null; - GenGridItem lastitem = null; - - var rnd = new Random(); - for (int i = 0; i < 102; i++) - { - int r = rnd.Next(255); - int g = rnd.Next(255); - int b = rnd.Next(255); - Color color = Color.FromRgb(r, g, b); - var item = grid.Append(defaultClass, color); - if (i == 0) - firstitem = item; - if (i == 101) - lastitem = item; - } - grid.Show(); - Box box = new Box(window) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - }; - box.Show(); - conformant.SetContent(box); - - box.PackEnd(grid); - - Button first = new Button(window) - { - Text = "First", - AlignmentX = -1, - WeightX = 1, - }; - Button last = new Button(window) - { - Text = "Last", - AlignmentX = -1, - WeightX = 1, - }; - first.Clicked += (s, e) => - { - grid.ScrollTo(firstitem, ScrollToPosition.In, true); - }; - last.Clicked += (s, e) => - { - grid.ScrollTo(lastitem, ScrollToPosition.In, true); - }; - first.Show(); - last.Show(); - - box.PackEnd(first); - box.PackEnd(last); - grid.ItemActivated += Grid_ItemActivated; - grid.ItemSelected += Grid_ItemSelected; - grid.ItemUnselected += Grid_ItemUnselected; - grid.ItemRealized += Grid_ItemRealized; - grid.ItemUnrealized += Grid_ItemUnrealized; - grid.ItemPressed += Grid_ItemPressed; - grid.ItemReleased += Grid_ItemReleased; - grid.ItemLongPressed += Grid_ItemLongPressed; - grid.ItemDoubleClicked += Grid_ItemDoubleClicked; - } - - private void Grid_ItemDoubleClicked(object sender, GenGridItemEventArgs e) - { - Color color = (Color)e.Item.Data; - Console.WriteLine("#{0:X}{1:X}{2:X} is Double clicked", color.R, color.G, color.B); - } - - private void Grid_ItemLongPressed(object sender, GenGridItemEventArgs e) - { - Color color = (Color)e.Item.Data; - Console.WriteLine("#{0:X}{1:X}{2:X} is LongPressed", color.R, color.G, color.B); - } - - private void Grid_ItemReleased(object sender, GenGridItemEventArgs e) - { - Color color = (Color)e.Item.Data; - Console.WriteLine("#{0:X}{1:X}{2:X} is Released", color.R, color.G, color.B); - } - - private void Grid_ItemPressed(object sender, GenGridItemEventArgs e) - { - Color color = (Color)e.Item.Data; - Console.WriteLine("#{0:X}{1:X}{2:X} is Pressed", color.R, color.G, color.B); - } - - private void Grid_ItemUnselected(object sender, GenGridItemEventArgs e) - { - Color color = (Color)e.Item.Data; - Console.WriteLine("#{0:X}{1:X}{2:X} is Unselected", color.R, color.G, color.B); - } - - private void Grid_ItemRealized(object sender, GenGridItemEventArgs e) - { - Color color = (Color)e.Item.Data; - Console.WriteLine("#{0:X}{1:X}{2:X} is Realized", color.R, color.G, color.B); - } - - private void Grid_ItemUnrealized(object sender, GenGridItemEventArgs e) - { - Color color = (Color)e.Item.Data; - Console.WriteLine("#{0:X}{1:X}{2:X} is Unrealized", color.R, color.G, color.B); - } - - private void Grid_ItemSelected(object sender, GenGridItemEventArgs e) - { - Color color = (Color)e.Item.Data; - Console.WriteLine("#{0:X}{1:X}{2:X} is Selected", color.R, color.G, color.B); - } - - private void Grid_ItemActivated(object sender, GenGridItemEventArgs e) - { - Color color = (Color)e.Item.Data; - Console.WriteLine("#{0:X}{1:X}{2:X} is Activated", color.R, color.G, color.B); - } - } -} diff --git a/test/ElmSharp.Test/TC/GenListTest1.cs b/test/ElmSharp.Test/TC/GenListTest1.cs deleted file mode 100644 index 86a2c87c7..000000000 --- a/test/ElmSharp.Test/TC/GenListTest1.cs +++ /dev/null @@ -1,62 +0,0 @@ -/* - * 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 ElmSharp; - -namespace ElmSharp.Test -{ - class GenListTest1 : TestCaseBase - { - public override string TestName => "GenListTest1"; - public override string TestDescription => "To test basic operation of GenList"; - - public override void Run(Window window) - { - Conformant conformant = new Conformant(window); - conformant.Show(); - GenList list = new GenList(window) - { - Homogeneous = true, - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1 - }; - - GenItemClass defaultClass = new GenItemClass("default") - { - GetTextHandler = (obj, part) => - { - return string.Format("{0} - {1}",(string)obj, part); - } - }; - - for (int i = 0; i < 100; i++) - { - list.Append(defaultClass, string.Format("{0} Item", i)); - } - list.Show(); - list.ItemSelected += List_ItemSelected; ; - conformant.SetContent(list); - } - - private void List_ItemSelected(object sender, GenListItemEventArgs e) - { - Console.WriteLine("{0} Item was selected", (string)(e.Item.Data)); - } - } -} diff --git a/test/ElmSharp.Test/TC/GenListTest10.cs b/test/ElmSharp.Test/TC/GenListTest10.cs deleted file mode 100644 index ba4774149..000000000 --- a/test/ElmSharp.Test/TC/GenListTest10.cs +++ /dev/null @@ -1,150 +0,0 @@ -/* - * 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.Collections.Generic; -using ElmSharp; - -namespace ElmSharp.Test -{ - class GenListTest10 : TestCaseBase - { - public override string TestName => "GenListTest10"; - public override string TestDescription => "To test InsertBefore operation of GenList with full style"; - - public override void Run(Window window) - { - Conformant conformant = new Conformant(window); - conformant.Show(); - Box box = new Box(window) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - }; - box.Show(); - conformant.SetContent(box); - - GenList list = new GenList(window) - { - Homogeneous = false, - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1 - }; - - GenItemClass defaultClass = new GenItemClass("full") - { - GetContentHandler = (obj, part) => - { - Console.WriteLine("{0} part create requested", part); - var btn = new Button(window) - { - Text = obj.ToString(), - AlignmentX = -1, - WeightX = 1, - }; - return btn; - } - }; - - GenItemClass headerClass = new GenItemClass("full") - { - GetContentHandler = (obj, part) => - { - Console.WriteLine("{0} part create requested", part); - var btn = new Button(window) - { - Text = obj.ToString(), - AlignmentX = -1, - WeightX = 1, - }; - btn.Show(); - - var label = new Label(window) - { - Text = "GenItem with full style" - }; - label.Show(); - - Box hBox = new Box(window) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - }; - hBox.Show(); - hBox.PackEnd(btn); - hBox.PackEnd(label); - return hBox; - } - - }; - - List itemList = new List(); - GenListItem firstItem = null; - - for (int i = 0; i < 5; i++) - { - GenListItem now = list.Append(defaultClass, string.Format("{0} Item", i)); - itemList.Add(now); - - if (firstItem == null) - { - firstItem = now; - } - } - list.Show(); - list.ItemSelected += List_ItemSelected; - box.PackEnd(list); - - Button first = new Button(window) - { - Text = "First", - AlignmentX = -1, - WeightX = 1, - }; - Button last = new Button(window) - { - Text = "last", - AlignmentX = -1, - WeightX = 1, - }; - - first.Clicked += (s, e) => - { - firstItem = list.InsertBefore(headerClass, "Header", firstItem); - }; - last.Clicked += (s, e) => - { - list.Append(headerClass, "Footer"); - }; - - first.Show(); - last.Show(); - box.PackEnd(first); - box.PackEnd(last); - } - - private void List_ItemSelected(object sender, GenListItemEventArgs e) - { - Console.WriteLine("{0} Item was selected", (string)(e.Item.Data)); - } - } -} diff --git a/test/ElmSharp.Test/TC/GenListTest11.cs b/test/ElmSharp.Test/TC/GenListTest11.cs deleted file mode 100755 index 731a9fcfc..000000000 --- a/test/ElmSharp.Test/TC/GenListTest11.cs +++ /dev/null @@ -1,115 +0,0 @@ -/* - * 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 ElmSharp; -using System.Collections.Generic; - -namespace ElmSharp.Test -{ - class GenListTest11 : TestCaseBase - { - public override string TestName => "GenListTest11"; - public override string TestDescription => "To test InsertSorted operation of GenList"; - - public int myCompare(object t1, object t2) - { - int c1 = Convert.ToInt32((string)t1); - int c2 = Convert.ToInt32((string)t2); - - return c1 - c2; - } - - public override void Run(Window window) - { - Conformant conformant = new Conformant(window); - conformant.Show(); - Box box = new Box(window) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - }; - box.Show(); - conformant.SetContent(box); - - GenList list = new GenList(window) - { - Homogeneous = true, - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1 - }; - - GenItemClass defaultClass = new GenItemClass("default") - { - GetTextHandler = (obj, part) => - { - return string.Format("{0} - {1}", (string)obj, part); - } - }; - - List items = new List(); - int idx = 20; - for (int t = 1; t < 10; t++) - { - items.Add(list.InsertSorted(defaultClass, idx.ToString(), myCompare, GenListItemType.Normal, null)); - idx--; - } - list.Show(); - list.ItemSelected += List_ItemSelected; - - box.PackEnd(list); - Button first = new Button(window) - { - Text = "Check first and last item", - AlignmentX = -1, - WeightX = 1, - }; - - Button Add = new Button(window) - { - Text = "Add", - AlignmentX = -1, - WeightX = 1, - }; - Add.Clicked += (s, e) => - { - items.Add(list.InsertSorted(defaultClass, idx.ToString(), myCompare, GenListItemType.Normal, null)); - idx--; - }; - - first.Clicked += (s, e) => - { - Console.WriteLine("Last Item's Data : " + list.LastItem.Data); - Console.WriteLine("First date of Items " + items[0].Data); - Console.WriteLine("Result for comparinson " + (bool)(list.LastItem == list.LastItem)); - }; - - first.Show(); - Add.Show(); - box.PackEnd(first); - box.PackEnd(Add); - } - - private void List_ItemSelected(object sender, GenListItemEventArgs e) - { - Console.WriteLine("{0} Item was selected", (string)(e.Item.Data)); - } - } -} diff --git a/test/ElmSharp.Test/TC/GenListTest2.cs b/test/ElmSharp.Test/TC/GenListTest2.cs deleted file mode 100644 index a22311a9e..000000000 --- a/test/ElmSharp.Test/TC/GenListTest2.cs +++ /dev/null @@ -1,117 +0,0 @@ -/* - * 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 ElmSharp; -using System.Collections.Generic; - -namespace ElmSharp.Test -{ - class GenListTest2 : TestCaseBase - { - public override string TestName => "GenListTest2"; - public override string TestDescription => "To test ScrollTo operation of GenList"; - - public override void Run(Window window) - { - Conformant conformant = new Conformant(window); - conformant.Show(); - Box box = new Box(window) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - }; - box.Show(); - conformant.SetContent(box); - - - GenList list = new GenList(window) - { - Homogeneous = true, - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1 - }; - - GenItemClass defaultClass = new GenItemClass("default") - { - GetTextHandler = (obj, part) => - { - return string.Format("{0} - {1}", (string)obj, part); - } - }; - - GenListItem[] items = new GenListItem[100]; - int i = 0; - for (i = 0; i < 100; i++) - { - items[i] = list.Append(defaultClass, string.Format("{0} Item", i)); - } - list.Show(); - list.ItemSelected += List_ItemSelected; - - GenListItem scroll = items[0]; - - box.PackEnd(list); - Button first = new Button(window) - { - Text = "First", - AlignmentX = -1, - WeightX = 1, - }; - Button last = new Button(window) - { - Text = "last", - AlignmentX = -1, - WeightX = 1, - }; - Button Add = new Button(window) - { - Text = "Add", - AlignmentX = -1, - WeightX = 1, - }; - Add.Clicked += (s, e) => - { - scroll = list.InsertBefore(defaultClass, string.Format("{0} Item", i++), scroll); - list.ScrollTo(scroll, ScrollToPosition.In, false); - }; - first.Clicked += (s, e) => - { - list.ScrollTo(scroll, ScrollToPosition.In, true); - }; - last.Clicked += (s, e) => - { - list.ScrollTo(items[99], ScrollToPosition.In, true); - }; - first.Show(); - last.Show(); - Add.Show(); - box.PackEnd(first); - box.PackEnd(last); - box.PackEnd(Add); - - } - - private void List_ItemSelected(object sender, GenListItemEventArgs e) - { - Console.WriteLine("{0} Item was selected", (string)(e.Item.Data)); - } - } -} diff --git a/test/ElmSharp.Test/TC/GenListTest3.cs b/test/ElmSharp.Test/TC/GenListTest3.cs deleted file mode 100644 index f26e92ddb..000000000 --- a/test/ElmSharp.Test/TC/GenListTest3.cs +++ /dev/null @@ -1,101 +0,0 @@ -/* - * 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 ElmSharp; - -namespace ElmSharp.Test -{ - class GenListTest3 : TestCaseBase - { - public override string TestName => "GenListTest3"; - public override string TestDescription => "To test group operation of GenList"; - - public override void Run(Window window) - { - Conformant conformant = new Conformant(window); - conformant.Show(); - GenList list = new GenList(window) - { - Homogeneous = false, - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1 - }; - - GenItemClass groupClass = new GenItemClass("group_index") - { - GetTextHandler = (obj, part) => - { - return string.Format("{0} - {1}", (string)obj, part); - } - }; - - GenListItem[] groups = new GenListItem[10]; - - for (int i = 0; i< 10; i++) - { - groups[i] = list.Append(groupClass, string.Format("{0}", i) , GenListItemType.Group); - } - - - GenItemClass defaultClass = new GenItemClass("default") - { - GetTextHandler = (obj, part) => - { - return string.Format("{0} - {1}", (string)obj, part); - }, - GetContentHandler = (obj, part) => - { - Console.WriteLine("{0} - {1}", (string)obj, part); - return null; - } - }; - - GenItemClass fullyCustomizeClass = new GenItemClass("full") - { - GetContentHandler = (obj, part) => - { - Console.WriteLine("{0} part create requested", part); - var btn = new Button(window) { - Text = "Button in List", - AlignmentX = -1, - WeightX = 1, - }; - return btn; - } - }; - - for (int j = 0; j < 10; j++) - { - for (int i = 0; i < 20; i++) - { - list.Append( j == 0 ? fullyCustomizeClass : defaultClass, string.Format("{0} Item", i), GenListItemType.Normal, groups[j]); - } - } - - list.Show(); - list.ItemSelected += List_ItemSelected; ; - conformant.SetContent(list); - } - - private void List_ItemSelected(object sender, GenListItemEventArgs e) - { - Console.WriteLine("{0} Item was selected", (string)(e.Item.Data)); - } - } -} diff --git a/test/ElmSharp.Test/TC/GenListTest4.cs b/test/ElmSharp.Test/TC/GenListTest4.cs deleted file mode 100644 index 53bea96be..000000000 --- a/test/ElmSharp.Test/TC/GenListTest4.cs +++ /dev/null @@ -1,73 +0,0 @@ -/* - * 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 ElmSharp; - -namespace ElmSharp.Test -{ - class GenListTest4 : TestCaseBase - { - public override string TestName => "GenListTest4"; - public override string TestDescription => "To test Append/Prepend/InsertBefore operation of GenList"; - - public override void Run(Window window) - { - Conformant conformant = new Conformant(window); - conformant.Show(); - GenList list = new GenList(window) - { - Homogeneous = true, - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1 - }; - - GenItemClass defaultClass = new GenItemClass("default") - { - GetTextHandler = (obj, part) => - { - return string.Format("{0} - {1}", (string)obj, part); - } - }; - - GenListItem[] items = new GenListItem[100]; - for (int i = 0; i < 100; i++) - { - if (i < 30) - { - items[i] = list.Append(defaultClass, string.Format("{0} Item", i)); - } - else if (i < 60) - { - items[i] = list.Prepend(defaultClass, string.Format("{0} Item", i)); - }else - { - items[i] = list.InsertBefore(defaultClass, string.Format("{0} Item", i), items[50]); - } - } - list.Show(); - list.ItemSelected += List_ItemSelected; ; - conformant.SetContent(list); - } - - private void List_ItemSelected(object sender, GenListItemEventArgs e) - { - Console.WriteLine("{0} Item was selected", (string)(e.Item.Data)); - } - } -} diff --git a/test/ElmSharp.Test/TC/GenListTest5.cs b/test/ElmSharp.Test/TC/GenListTest5.cs deleted file mode 100644 index b68404830..000000000 --- a/test/ElmSharp.Test/TC/GenListTest5.cs +++ /dev/null @@ -1,110 +0,0 @@ -/* - * 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 ElmSharp; - -namespace ElmSharp.Test -{ - public class GenListTest5 : TestCaseBase - { - public override string TestName => "GenListTest5"; - public override string TestDescription => "To test event operation of GenList"; - - public override void Run(Window window) - { - Conformant conformant = new Conformant(window); - conformant.Show(); - GenList list = new GenList(window) - { - Homogeneous = true, - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1 - }; - - GenItemClass defaultClass = new GenItemClass("default") - { - GetTextHandler = (obj, part) => - { - return string.Format("{0} - {1}", (string)obj, part); - } - }; - - for (int i = 0; i < 100; i++) - { - list.Append(defaultClass, string.Format("{0} Item", i)); - } - list.Show(); - list.ItemSelected += List_ItemSelected; ; - list.ItemActivated += List_ItemActivated; - list.ItemUnselected += List_ItemUnselected; - list.ItemPressed += List_ItemPressed; - list.ItemRealized += List_ItemRealized; - list.ItemReleased += List_ItemReleased; - list.ItemUnrealized += List_ItemUnrealized; - list.ItemLongPressed += List_ItemLongPressed; - list.ItemDoubleClicked += List_ItemDoubleClicked; - conformant.SetContent(list); - } - - private void List_ItemDoubleClicked(object sender, GenListItemEventArgs e) - { - Console.WriteLine("{0} Item was double clicked", (string)(e.Item.Data)); - } - - private void List_ItemLongPressed(object sender, GenListItemEventArgs e) - { - Console.WriteLine("{0} Item was Long pressed", (string)(e.Item.Data)); - } - - private void List_ItemUnrealized(object sender, GenListItemEventArgs e) - { - Console.WriteLine("{0} Item was unrealzed", (string)(e.Item.Data)); - } - - private void List_ItemReleased(object sender, GenListItemEventArgs e) - { - Console.WriteLine("{0} Item was released", (string)(e.Item.Data)); - } - - private void List_ItemRealized(object sender, GenListItemEventArgs e) - { - Console.WriteLine("{0} Item was Realized", (string)(e.Item.Data)); - } - - private void List_ItemPressed(object sender, GenListItemEventArgs e) - { - Console.WriteLine("{0} Item was Pressed", (string)(e.Item.Data)); - } - - private void List_ItemUnselected(object sender, GenListItemEventArgs e) - { - Console.WriteLine("{0} Item was unselected", (string)(e.Item.Data)); - } - - private void List_ItemActivated(object sender, GenListItemEventArgs e) - { - Console.WriteLine("{0} Item was Activated", (string)(e.Item.Data)); - } - - private void List_ItemSelected(object sender, GenListItemEventArgs e) - { - Console.WriteLine("{0} Item was selected", (string)(e.Item.Data)); - } - } -} diff --git a/test/ElmSharp.Test/TC/GenListTest6.cs b/test/ElmSharp.Test/TC/GenListTest6.cs deleted file mode 100644 index 9a1739cca..000000000 --- a/test/ElmSharp.Test/TC/GenListTest6.cs +++ /dev/null @@ -1,141 +0,0 @@ -/* - * 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 ElmSharp; - -namespace ElmSharp.Test -{ - class GenListTest6 : TestCaseBase - { - public override string TestName => "GenListTest6"; - public override string TestDescription => "To test deletion of GenListItem"; - GenListItem selected = null; - - - public override void Run(Window window) - { - Conformant conformant = new Conformant(window); - conformant.Show(); - Box box = new Box(window) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - }; - box.Show(); - conformant.SetContent(box); - - - GenList list = new GenList(window) - { - Homogeneous = true, - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1 - }; - - GenItemClass defaultClass = new GenItemClass("default") - { - GetTextHandler = (obj, part) => - { - return string.Format("{0} - {1}", (string)obj, part); - }, - DeleteHandler = new GenItemClass.DeleteDelegate((obj) => - { - Console.WriteLine("DeleteHandler was called with... {0}", (string)obj); - }), - }; - GenListItem[] items = new GenListItem[100]; - for (int i = 0; i < 100; i++) - { - items[i] = list.Append(defaultClass, string.Format("{0} Item", i)); - } - list.Show(); - list.ItemSelected += List_ItemSelected; - list.ItemActivated += List_ItemActivated; - list.ItemUnselected += List_ItemUnselected; - list.ItemPressed += List_ItemPressed; - list.ItemRealized += List_ItemRealized; - list.ItemReleased += List_ItemReleased; - list.ItemUnrealized += List_ItemUnrealized; - list.ItemLongPressed += List_ItemLongPressed; - list.ItemDoubleClicked += List_ItemDoubleClicked; - box.PackEnd(list); - Button first = new Button(window) - { - Text = "Delete", - AlignmentX = -1, - WeightX = 1, - }; - first.Clicked += (s, e) => - { - selected?.Delete(); - }; - first.Show(); - box.PackEnd(first); - - } - - private void List_ItemSelected(object sender, GenListItemEventArgs e) - { - selected = e.Item; - Console.WriteLine("{0} Item was selected", (string)(e.Item.Data)); - } - private void List_ItemDoubleClicked(object sender, GenListItemEventArgs e) - { - Console.WriteLine("{0} Item was double clicked", (string)(e.Item.Data)); - } - - private void List_ItemLongPressed(object sender, GenListItemEventArgs e) - { - Console.WriteLine("{0} Item was Long pressed", (string)(e.Item.Data)); - } - - private void List_ItemUnrealized(object sender, GenListItemEventArgs e) - { - Console.WriteLine("!!!! Item was Unrealized!!!"); - Console.WriteLine("{0} Item was unrealzed", (string)(e.Item.Data)); - } - - private void List_ItemReleased(object sender, GenListItemEventArgs e) - { - Console.WriteLine("{0} Item was released", (string)(e.Item.Data)); - } - - private void List_ItemRealized(object sender, GenListItemEventArgs e) - { - Console.WriteLine("{0} Item was Realized", (string)(e.Item.Data)); - } - - private void List_ItemPressed(object sender, GenListItemEventArgs e) - { - Console.WriteLine("{0} Item was Pressed", (string)(e.Item.Data)); - } - - private void List_ItemUnselected(object sender, GenListItemEventArgs e) - { - Console.WriteLine("{0} Item was unselected", (string)(e.Item.Data)); - } - - private void List_ItemActivated(object sender, GenListItemEventArgs e) - { - Console.WriteLine("{0} Item was Activated", (string)(e.Item.Data)); - } - } -} diff --git a/test/ElmSharp.Test/TC/GenListTest7.cs b/test/ElmSharp.Test/TC/GenListTest7.cs deleted file mode 100644 index 114b6e137..000000000 --- a/test/ElmSharp.Test/TC/GenListTest7.cs +++ /dev/null @@ -1,98 +0,0 @@ -/* - * 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 ElmSharp; -using System.Collections.Generic; - -namespace ElmSharp.Test -{ - class GenListTest7 : TestCaseBase - { - public override string TestName => "GenListTest7"; - public override string TestDescription => "To test basic operation of GenList"; - - public override void Run(Window window) - { - Conformant conformant = new Conformant(window); - conformant.Show(); - Box box = new Box(window); - conformant.SetContent(box); - box.Show(); - - GenList list = new GenList(window) - { - Homogeneous = true, - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1 - }; - - Button button = new Button(window) - { - Text = "Remove", - AlignmentX = -1, - AlignmentY = -1, - }; - - GenItemClass defaultClass = new GenItemClass("default") - { - GetTextHandler = (obj, part) => - { - return string.Format("{0} - {1}",(string)obj, part); - } - }; - - GenListItem[] itemArr = new GenListItem[9]; - for (int i = 0; i < 9; i++) - { - itemArr[i] = list.Append(defaultClass, string.Format("{0} Item", i)); - } - - int idx = 0; - button.Clicked += (s, e) => - { - if (idx < 9) { - Console.WriteLine("GenListItem deleted"); - itemArr[idx++].Delete(); - } - }; - button.Show(); - - list.Show(); - list.ItemSelected += List_ItemSelected; - list.ItemRealized += List_ItemRealized; - list.ItemUnrealized += List_ItemUnrealized; - - box.PackEnd(list); - box.PackEnd(button); - } - - private void List_ItemSelected(object sender, GenListItemEventArgs e) - { - Console.WriteLine("{0} Item was selected", (string)(e.Item.Data)); - } - private void List_ItemRealized(object sender, GenListItemEventArgs e) - { - Console.WriteLine("{0} Item was realized", (string)(e.Item.Data)); - } - private void List_ItemUnrealized(object sender, GenListItemEventArgs e) - { - Console.WriteLine("{0} Item was unrealized", (string)(e.Item.Data)); - } - } -} diff --git a/test/ElmSharp.Test/TC/GenListTest8.cs b/test/ElmSharp.Test/TC/GenListTest8.cs deleted file mode 100644 index 6316235d1..000000000 --- a/test/ElmSharp.Test/TC/GenListTest8.cs +++ /dev/null @@ -1,111 +0,0 @@ -/* - * 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 ElmSharp; -using System.Collections.Generic; - -namespace ElmSharp.Test -{ - class GenListTest8 : TestCaseBase - { - - Dictionary _cacheMap = new Dictionary(); - public override string TestName => "GenListTest8"; - public override string TestDescription => "To test group operation of GenList"; - - public override void Run(Window window) - { - Background bg = new Background(window) - { - Color = Color.White, - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1 - }; - bg.Show(); - bg.Lower(); - - window.AddResizeObject(bg); - Conformant conformant = new Conformant(window); - conformant.Show(); - Box box = new Box(window) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1 - }; - Check check = new Check(window); - check.Show(); - check.IsChecked = true; - check.Text = "Reuse?"; - - GenList list = new GenList(window) - { - Homogeneous = false, - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1 - }; - - GenItemClass fullyCustomizeClass = new GenItemClass("full") - { - GetContentHandler = (obj, part) => - { - Console.WriteLine("{0} part create requested", part); - var btn = new Button(window) - { - AlignmentX = -1, - WeightX = 1, - Text = (string)obj - }; - return btn; - }, - ReusableContentHandler = (object data, string part, EvasObject old) => - { - Console.WriteLine("{0} part reuse requested", part); - if (!check.IsChecked) - { - return null; - } - var btn = old as Button; - btn.Text = (string)data; - return old; - } - }; - - for (int i = 0; i < 100; i++) - { - list.Append(fullyCustomizeClass, string.Format("{0} Item", i), GenListItemType.Normal); - } - - list.Show(); - list.ItemSelected += List_ItemSelected; ; - box.Show(); - box.PackEnd(check); - box.PackEnd(list); - conformant.SetContent(box); - } - - private void List_ItemSelected(object sender, GenListItemEventArgs e) - { - Console.WriteLine("{0} Item was selected", (string)(e.Item.Data)); - } - } -} diff --git a/test/ElmSharp.Test/TC/GenListTest9.cs b/test/ElmSharp.Test/TC/GenListTest9.cs deleted file mode 100644 index 39a03251f..000000000 --- a/test/ElmSharp.Test/TC/GenListTest9.cs +++ /dev/null @@ -1,111 +0,0 @@ -/* - * 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 ElmSharp; -using System.Collections.Generic; - -namespace ElmSharp.Test -{ - class GenListTest9 : TestCaseBase - { - - public class ItemContext - { - public object Data; - public GenListItem Item; - public EvasObject Realized; - } - - Dictionary _cacheMap = new Dictionary(); - - Dictionary _realizedMap = new Dictionary(); - public override string TestName => "GenListTest9"; - public override string TestDescription => "To test FieldUpdate operation of GenList"; - - public override void Run(Window window) - { - Background bg = new Background(window) - { - Color = Color.White, - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1 - }; - bg.Show(); - bg.Lower(); - - window.AddResizeObject(bg); - Conformant conformant = new Conformant(window); - conformant.Show(); - Box box = new Box(window) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1 - }; - GenList list = new GenList(window) - { - Homogeneous = false, - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1 - }; - - GenItemClass fullyCustomizeClass = new GenItemClass("full") - { - GetContentHandler = (obj, part) => - { - Console.WriteLine("{0} part create requested", part); - var btn = new Button(window) - { - AlignmentX = -1, - WeightX = 1, - Text = (string)(obj as ItemContext).Data - }; - btn.MinimumHeight = 100; - (obj as ItemContext).Realized = btn; - (obj as ItemContext).Item?.UpdateField("elm.swallow.content", GenListItemFieldType.None); - return btn; - }, - }; - - for (int i = 0; i < 100; i++) - { - var context = new ItemContext(); - context.Data = string.Format("{0} Item", i); - context.Item = list.Append(fullyCustomizeClass, context, GenListItemType.Normal); - } - - list.Show(); - list.ItemSelected += List_ItemSelected; ; - box.Show(); - box.PackEnd(list); - conformant.SetContent(box); - } - - private void List_ItemSelected(object sender, GenListItemEventArgs e) - { - var itemContext = e.Item.Data as ItemContext; - Console.WriteLine("{0} Item was selected", (string)(itemContext.Data)); - itemContext.Realized.MinimumHeight += 20; - e.Item.UpdateField("elm.swallow.content", GenListItemFieldType.None); - } - } -} diff --git a/test/ElmSharp.Test/TC/GestureLayerTest1.cs b/test/ElmSharp.Test/TC/GestureLayerTest1.cs deleted file mode 100644 index b59cbcc25..000000000 --- a/test/ElmSharp.Test/TC/GestureLayerTest1.cs +++ /dev/null @@ -1,86 +0,0 @@ -using System; -using ElmSharp; -using System.Collections.Generic; - -namespace ElmSharp.Test -{ - class GestureLayerTest1 : TestCaseBase - { - public override string TestName => "GestureLayerTest1"; - public override string TestDescription => "Demonstrate GestureLayer features: Tap, DoubleTap, Rotate, Zoom detection."; - - private GestureLayer _glayer; - private Label _log; - private List _logEntries; - private Background _background; - private Rectangle _box1; - - public override void Run(Window window) - { - _background = new Background(window); - var windowSize = window.ScreenSize; - _background.Color = Color.White; - _background.Resize(windowSize.Width, windowSize.Height); - _background.Show(); - - _box1 = new Rectangle(window) - { - Color = Color.Yellow - }; - _box1.Resize(400, 600); - _box1.Move(160, 160); - _box1.Show(); - - _log = new Label(window); - _log.Resize(700, 1280 - 780); - _log.Move(10, 770); - _log.Show(); - _logEntries = new List(); - Log("Double tap to register additional gestures. Tripple tap to unregister them."); - - _glayer = new GestureLayer(_box1); - _glayer.Attach(_box1); - - _glayer.SetTapCallback(GestureLayer.GestureType.Tap, GestureLayer.GestureState.End, (info) => { - Log("Tap {0},{1}", info.X, info.Y); - }); - - _glayer.SetTapCallback(GestureLayer.GestureType.DoubleTap, GestureLayer.GestureState.End, (info) => { - Log("DoubleTap {0},{1} {2}", info.X, info.Y, info.FingersCount); - _glayer.SetLineCallback(GestureLayer.GestureState.End, (line) => { - Log("Line {0},{1}-{2},{3}, M:{4},{5}", line.X1, line.Y1, line.X2, line.Y2, line.HorizontalMomentum, line.VerticalMomentum); - }); - _glayer.SetFlickCallback(GestureLayer.GestureState.End, (flick) => { - Log("Flick {0},{1}-{2},{3}, M:{4},{5}", flick.X1, flick.Y1, flick.X2, flick.Y2, flick.HorizontalMomentum, flick.VerticalMomentum); - }); - _glayer.RotateStep = 3; - _glayer.SetRotateCallback(GestureLayer.GestureState.Move, (rotate) => { - Log("Rotation {0},{1} a:{2:F3} ba:{3:F3}", rotate.X, rotate.Y, rotate.Angle, rotate.BaseAngle); - }); - _glayer.SetZoomCallback(GestureLayer.GestureState.End, (zoom) => { - Log("Zoom {0},{1} r:{2} z:{3:F3}", zoom.X, zoom.Y, zoom.Radius, zoom.Zoom); - }); - Log("Line, Flick, Rotate, and Zoom callbacks enabled."); - }); - - _glayer.SetTapCallback(GestureLayer.GestureType.TripleTap, GestureLayer.GestureState.End, (info) => { - Log("TrippleTap {0},{1} {2}", info.X, info.Y, info.FingersCount); - _glayer.SetLineCallback(GestureLayer.GestureState.End, null); - _glayer.SetFlickCallback(GestureLayer.GestureState.End, null); - _glayer.SetRotateCallback(GestureLayer.GestureState.Move, null); - _glayer.SetZoomCallback(GestureLayer.GestureState.End, null); - Log("Cleared Line, Flick, Rotate, and Zoom callbacks."); - }); - // Momentum is not used, it seems that it conflicts with Rotate and Zoom - } - - private void Log(string format, params object[] args) - { - var entry = string.Format(format, args); - if (_logEntries.Count > 15) - _logEntries.RemoveRange(0, _logEntries.Count - 15); - _logEntries.Add(entry); - _log.Text = string.Join("
", _logEntries); - } - } -} diff --git a/test/ElmSharp.Test/TC/GestureLayerTest2.cs b/test/ElmSharp.Test/TC/GestureLayerTest2.cs deleted file mode 100644 index 37190b324..000000000 --- a/test/ElmSharp.Test/TC/GestureLayerTest2.cs +++ /dev/null @@ -1,126 +0,0 @@ -using System.Collections.Generic; - -namespace ElmSharp.Test -{ - class GestureLayerTest2 : TestCaseBase - { - public override string TestName => "GestureLayerTest2"; - public override string TestDescription => "GestureLayer feature : Momentum & Rotate Test."; - - private GestureLayer _glayer; - private Label _log; - private List _logEntries; - private Background _background; - private Rectangle _box1; - - int _angle = 0; - int _prevAngle = 0; - int _totalX = 0; - int _totalY = 0; - - public override void Run(Window window) - { - _background = new Background(window); - var windowSize = window.ScreenSize; - _background.Color = Color.White; - _background.Resize(windowSize.Width, windowSize.Height); - _background.Show(); - - _box1 = new Rectangle(window) - { - Color = Color.Yellow - }; - _box1.Resize(400, 600); - _box1.Move(160, 160); - _box1.Show(); - - _log = new Label(window); - _log.Resize(700, 1280 - 780); - _log.Move(10, 770); - _log.Show(); - _logEntries = new List(); - Log("Momentum & Roate Gesture Test."); - - _glayer = new GestureLayer(_box1); - _glayer.Attach(_box1); - - _glayer.RotateStep = 3; - _glayer.SetRotateCallback(GestureLayer.GestureState.Start, (rotate) => - { - _prevAngle = (int)rotate.BaseAngle; - }); - - _glayer.SetRotateCallback(GestureLayer.GestureState.Move, (rotate) => - { - if (_box1.IsMapEnabled) - { - _angle += (int)rotate.Angle - _prevAngle; - _prevAngle = (int)rotate.Angle; - Log($"@@ Rotation XY:({rotate.X},{rotate.Y}) a:{rotate.Angle:F2} ba:{rotate.BaseAngle:F2} total:{_angle}"); - ApplyTransformation(); - } - }); - - int prevX = 0, prevY = 0; - _glayer.SetMomentumCallback(GestureLayer.GestureState.Start, (data) => - { - if (data.FingersCount == 1) - { - prevX = _glayer.EvasCanvas.Pointer.X; - prevY = _glayer.EvasCanvas.Pointer.Y; - } - }); - _glayer.SetMomentumCallback(GestureLayer.GestureState.Move, (data) => - { - if (data.FingersCount == 1) - { - data.X2 = _glayer.EvasCanvas.Pointer.X; - data.Y2 = _glayer.EvasCanvas.Pointer.Y; - _totalX += (data.X2 - prevX); - _totalY += (data.Y2 - prevY); - prevX = data.X2; - prevY = data.Y2; - Log($"@@ Momentum X:({prevX},{data.X2}), Y({prevY},{data.Y2}) = Total:({(data.X2 - prevX)}, {(data.Y2 - prevY)})"); - ApplyTransformation(); - } - }); - _glayer.SetMomentumCallback(GestureLayer.GestureState.Abort, (data) => - { - Log($"@@ Momentum Abort"); - }); - _glayer.SetMomentumCallback(GestureLayer.GestureState.End, (data) => - { - Log($"@@ Momentum End"); - }); - } - - void ApplyTransformation() - { - EvasMap map = new EvasMap(4); - Rect geometry = _box1.Geometry; - map.PopulatePoints(geometry, 0); - - map.Rotate3D(0, 0, _angle, (int)(geometry.X + geometry.Width * 0.5), (int)(geometry.Y + geometry.Height * 0.5), 0); - - Point3D p; - for (int i = 0; i < 4; i++) - { - p = map.GetPointCoordinate(i); - p.X += _totalX; - p.Y += _totalY; - map.SetPointCoordinate(i, p); - } - _box1.EvasMap = map; - _box1.IsMapEnabled = true; - } - - private void Log(string format, params object[] args) - { - var entry = string.Format(format, args); - if (_logEntries.Count > 15) - _logEntries.RemoveRange(0, _logEntries.Count - 15); - _logEntries.Add(entry); - _log.Text = string.Join("
", _logEntries); - } - } -} \ No newline at end of file diff --git a/test/ElmSharp.Test/TC/HoverselTest1.cs b/test/ElmSharp.Test/TC/HoverselTest1.cs deleted file mode 100644 index 122d98b18..000000000 --- a/test/ElmSharp.Test/TC/HoverselTest1.cs +++ /dev/null @@ -1,94 +0,0 @@ -/* - * 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 ElmSharp; -using System.Collections.Generic; - -namespace ElmSharp.Test -{ - public class HoverselTest1 : TestCaseBase - { - public override string TestName => "HoverselTest1"; - public override string TestDescription => "To test basic operation of Hoversel"; - - public override void Run(Window window) - { - Background bg = new Background(window) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - Color = Color.White - }; - bg.Show(); - window.AddResizeObject(bg); - - Hoversel hoversel = new Hoversel(window) - { - IsHorizontal = false, - HoverParent = window, - Text = "Hoversel" - }; - hoversel.ItemSelected += (s, e) => - { - Console.WriteLine("ItemSelected : " + e.Item.Label); - }; - hoversel.Dismissed += (s, e) => - { - Console.WriteLine("Hoversel is dismissed"); - }; - hoversel.Clicked += (s, e) => - { - Console.WriteLine("Hoversel is Clicked"); - }; - hoversel.Expanded += (s, e) => - { - Console.WriteLine("Hoversel is Expanded"); - }; - - HoverselItem item1 = hoversel.AddItem("item1"); - HoverselItem item2 = hoversel.AddItem("item2"); - HoverselItem item3 = hoversel.AddItem("item3"); - - EventHandler handler = (s, e) => - { - var item = s as HoverselItem; - Console.WriteLine($"{item?.Label} is selected"); - }; - item1.ItemSelected += handler; - item2.ItemSelected += handler; - item3.ItemSelected += handler; - - hoversel.Resize(200, 100); - hoversel.Move(100, 100); - hoversel.Show(); - - Button beginButton = new Button(window) - { - Text = "Begin" - }; - beginButton.Clicked += (s, e) => - { - hoversel.HoverBegin(); - }; - beginButton.Resize(200, 100); - beginButton.Move(100, 500); - beginButton.Show(); - } - } -} diff --git a/test/ElmSharp.Test/TC/IconTest1.cs b/test/ElmSharp.Test/TC/IconTest1.cs deleted file mode 100644 index 137bc00f4..000000000 --- a/test/ElmSharp.Test/TC/IconTest1.cs +++ /dev/null @@ -1,80 +0,0 @@ -/* - * 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 ElmSharp; -using System.Collections.Generic; - -namespace ElmSharp.Test -{ - public class IconTest1 : TestCaseBase - { - public override string TestName => "IconTest1"; - public override string TestDescription => "To test basic operation of Icon"; - - public override void Run(Window window) - { - Background bg = new Background(window) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - Color = Color.White - }; - bg.Show(); - window.AddResizeObject(bg); - - Conformant conformant = new Conformant(window); - conformant.Show(); - Scroller scroller = new Scroller(window); - scroller.Show(); - conformant.SetContent(scroller); - Box box = new Box(window); - box.Show(); - scroller.SetContent(box); - - List iconList = new List{ "home", "close", "apps", "arrow_up", "arrow_down", "arrow_left", "arrow_right", "chat", "clock", "delete", "edit", "refresh", "folder", "file", - "menu/home", "menu/close", "menu/apps", "menu/arrow_up", "menu/arrow_down", "menu/arrow_left", "menu/arrow_right", "menu/chat", "menu/clock", "menu/delete", "menu/edit", "menu/refresh", "menu/folder", - "menu/file", "media_player/forward", "media_player/info", "media_player/next", "media_player/pause", "media_player/play", "media_player/prev", "media_player/rewind", "media_player/stop"}; - - foreach (var iconName in iconList) - { - Label label = new Label(window) - { - Text = iconName, - }; - Icon icon = new Icon(window) - { - IconLookupOrder = IconLookupOrder.ThemeFirst, - StandardIconName = iconName, - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - MinimumHeight = 100, - MinimumWidth = 100, - }; - icon.Show(); - label.Show(); - box.PackEnd(icon); - box.PackEnd(label); - } - - - } - } -} diff --git a/test/ElmSharp.Test/TC/ImageTest1.cs b/test/ElmSharp.Test/TC/ImageTest1.cs deleted file mode 100644 index d013a4cc0..000000000 --- a/test/ElmSharp.Test/TC/ImageTest1.cs +++ /dev/null @@ -1,255 +0,0 @@ -/* - * 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.IO; -using ElmSharp; -using System.Collections.Generic; - -namespace ElmSharp.Test -{ - public class ImageTest1 : TestCaseBase - { - public override string TestName => "ImageTest1"; - public override string TestDescription => "To test basic operation of Image"; - - Image image; - Label lbInfo; - - public override void Run(Window window) - { - Conformant conformant = new Conformant(window); - conformant.Show(); - Box box = new Box(window); - conformant.SetContent(box); - box.Show(); - - Box buttonBox1 = new Box(window) - { - IsHorizontal = true, - AlignmentX = -1, - AlignmentY = 0, - }; - buttonBox1.Show(); - - Box buttonBox2 = new Box(window) - { - IsHorizontal = true, - AlignmentX = -1, - AlignmentY = 0, - }; - buttonBox2.Show(); - - Button btnFile1 = new Button(window) - { - Text = "File1", - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1 - }; - btnFile1.Show(); - - Button btnFile2 = new Button(window) - { - Text = "File2", - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1 - }; - btnFile2.Show(); - - Button btnUri1 = new Button(window) - { - Text = "Uri", - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1 - }; - btnUri1.Show(); - - Button btnStream1 = new Button(window) - { - Text = "Strm", - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1 - }; - btnStream1.Show(); - - buttonBox1.PackEnd(btnFile1); - buttonBox1.PackEnd(btnFile2); - buttonBox1.PackEnd(btnUri1); - buttonBox1.PackEnd(btnStream1); - - - Button btnFileAsync1 = new Button(window) - { - Text = "FileA1", - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1 - }; - btnFileAsync1.Show(); - - Button btnFileAsync2 = new Button(window) - { - Text = "FileA2", - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1 - }; - btnFileAsync2.Show(); - - Button btnUriAsync1 = new Button(window) - { - Text = "UriA", - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1 - }; - btnUriAsync1.Show(); - - Button btnStreamAsync1 = new Button(window) - { - Text = "StrmA", - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1 - }; - btnStreamAsync1.Show(); - - buttonBox2.PackEnd(btnFileAsync1); - buttonBox2.PackEnd(btnFileAsync2); - buttonBox2.PackEnd(btnUriAsync1); - buttonBox2.PackEnd(btnStreamAsync1); - - - lbInfo = new Label(window) - { - Color = Color.White, - AlignmentX = -1, - AlignmentY = 0, - WeightX = 1 - }; - lbInfo.Show(); - - image = new Image(window) - { - IsFixedAspect = true, - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1 - }; - image.Show(); - image.Load(Path.Combine(TestRunner.ResourceDir, "picture.png")); - image.Clicked += (s, e) => - { - Console.WriteLine("Image has been clicked. (IsFixedAspect = {0}", image.IsFixedAspect); - image.IsFixedAspect = image.IsFixedAspect == true ? false : true; - }; - image.LoadingCompleted += (s, e) => - { - Console.WriteLine("Image has been loaded successfully."); - }; - image.LoadingFailed += (s, e) => - { - Console.WriteLine("Image loading has been failed."); - }; - - btnFile1.Clicked += (s, e) => LoadFile("TED/large/a.jpg"); - btnFile2.Clicked += (s, e) => LoadFile("TED/large/b.jpg"); - btnUri1.Clicked += (s, e) => LoadUri("http://pe.tedcdn.com/images/ted/2e306b9655267cee35e45688ace775590b820510_615x461.jpg"); - btnStream1.Clicked += (s, e) => LoadStream(new FileStream(Path.Combine(TestRunner.ResourceDir, "TED/large/c.jpg"), FileMode.Open, FileAccess.Read)); - - btnFileAsync1.Clicked += (s, e) => LoadFileAsync("TED/large/d.jpg"); - btnFileAsync2.Clicked += (s, e) => LoadFileAsync("TED/large/e.jpg"); - btnUriAsync1.Clicked += (s, e) => LoadUriAsync("http://pe.tedcdn.com/images/ted/2e306b9655267cee35e45688ace775590b820510_615x461.jpg"); - btnStreamAsync1.Clicked += (s, e) => LoadStreamAsync(new FileStream(Path.Combine(TestRunner.ResourceDir, "TED/large/f.jpg"), FileMode.Open, FileAccess.Read)); - box.PackEnd(buttonBox1); - box.PackEnd(buttonBox2); - box.PackEnd(lbInfo); - box.PackEnd(image); - } - - void LoadFile(string file) - { - bool ret = image.Load(Path.Combine(TestRunner.ResourceDir, file)); - if (ret) - UpdateLabelText(lbInfo, image.File); - else - UpdateLabelText(lbInfo, "Loading Failed."); - } - - void LoadUri(string uri) - { - bool ret = image.Load(uri); - if (ret) - UpdateLabelText(lbInfo, image.File); - else - UpdateLabelText(lbInfo, "Loading Failed."); - } - - void LoadStream(Stream stream) - { - bool ret = image.Load(stream); - if (ret) - UpdateLabelText(lbInfo, image.File); - else - UpdateLabelText(lbInfo, "Loading Failed."); - } - - async void LoadFileAsync(string file) - { - var ret = await image.LoadAsync(Path.Combine(TestRunner.ResourceDir, file)); - if (ret) - UpdateLabelText(lbInfo, image.File); - else - UpdateLabelText(lbInfo, "Loading Failed."); - } - - async void LoadUriAsync(string uri) - { - var ret = await image.LoadAsync(uri); - if (ret) - UpdateLabelText(lbInfo, image.File); - else - UpdateLabelText(lbInfo, "Loading Failed."); - } - - async void LoadStreamAsync(Stream stream) - { - var ret = await image.LoadAsync(stream); - if (ret) - UpdateLabelText(lbInfo, image.File); - else - UpdateLabelText(lbInfo, "Loading Failed."); - } - - void UpdateLabelText(Label lable, string text) - { - lable.Text = "" + text + ""; - } - } -} diff --git a/test/ElmSharp.Test/TC/ImageTest2.cs b/test/ElmSharp.Test/TC/ImageTest2.cs deleted file mode 100644 index b82f35795..000000000 --- a/test/ElmSharp.Test/TC/ImageTest2.cs +++ /dev/null @@ -1,124 +0,0 @@ -/* - * 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.IO; - -namespace ElmSharp.Test -{ - public class ImageTest2 : TestCaseBase - { - public override string TestName => "ImageTest2"; - public override string TestDescription => "To test basic operation of Image"; - - Image image; - Label lbInfo; - - public override void Run(Window window) - { - Conformant conformant = new Conformant(window); - conformant.Show(); - Box box = new Box(window); - conformant.SetContent(box); - box.Show(); - - Box buttonBox1 = new Box(window) { - IsHorizontal = true, - AlignmentX = -1, - AlignmentY = 0, - }; - buttonBox1.Show(); - - Button btnFile1 = new Button(window) { - Text = "Blue", - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1 - }; - btnFile1.Show(); - - Button btnFile2 = new Button(window) { - Text = "Default", - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1 - }; - btnFile2.Show(); - - Button btnFile3 = new Button(window) { - Text = "Aspect", - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1 - }; - btnFile3.Show(); - - Button btnFile4 = new Button(window) { - Text = "Rotate", - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1 - }; - btnFile4.Show(); - - buttonBox1.PackEnd(btnFile1); - buttonBox1.PackEnd(btnFile2); - buttonBox1.PackEnd(btnFile3); - buttonBox1.PackEnd(btnFile4); - - lbInfo = new Label(window) { - Color = Color.White, - AlignmentX = -1, - AlignmentY = 0, - WeightX = 1 - }; - lbInfo.Show(); - - image = new Image(window) { - IsFixedAspect = true, - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1 - }; - image.Show(); - image.Load(Path.Combine(TestRunner.ResourceDir, "picture.png")); - image.Clicked += (s, e) => - { - Console.WriteLine("Image has been clicked. (IsFixedAspect = {0}", image.IsFixedAspect); - image.IsFixedAspect = image.IsFixedAspect == true ? false : true; - }; - - btnFile1.Clicked += (s, e) => { image.BackgroundColor = Color.Blue; UpdateLabelText(image.BackgroundColor.ToString()); }; - btnFile2.Clicked += (s, e) => { image.BackgroundColor = Color.Default; UpdateLabelText(image.BackgroundColor.ToString()); }; - btnFile3.Clicked += (s, e) => { image.IsFixedAspect = image.IsFixedAspect == true ? false : true; }; - btnFile4.Clicked += (s, e) => { image.Orientation = image.Orientation == ImageOrientation.None ? ImageOrientation.Rotate270 : ImageOrientation.None; }; - - box.PackEnd(buttonBox1); - box.PackEnd(lbInfo); - box.PackEnd(image); - } - - void UpdateLabelText(string text) - { - lbInfo.Text = " BackgroundColor => " + text + ""; - } - } -} diff --git a/test/ElmSharp.Test/TC/ImageTest3.cs b/test/ElmSharp.Test/TC/ImageTest3.cs deleted file mode 100644 index db3617b23..000000000 --- a/test/ElmSharp.Test/TC/ImageTest3.cs +++ /dev/null @@ -1,135 +0,0 @@ -/* - * 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.IO; - -namespace ElmSharp.Test -{ - public class ImageTest3 : TestCaseBase - { - public override string TestName => "ImageTest3"; - public override string TestDescription => "To test basic operation of Image"; - - Image image; - Label lbInfo; - - public override void Run(Window window) - { - Conformant conformant = new Conformant(window); - conformant.Show(); - Box box = new Box(window); - conformant.SetContent(box); - box.Show(); - - Box buttonBox1 = new Box(window) { - IsHorizontal = true, - AlignmentX = -1, - AlignmentY = 0, - }; - buttonBox1.Show(); - - Box buttonBox2 = new Box(window) { - IsHorizontal = true, - AlignmentX = -1, - AlignmentY = 0, - }; - buttonBox2.Show(); - - Button btnFile1 = new Button(window) { - Text = "Blue (BG)", - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1 - }; - btnFile1.Show(); - - Button btnFile2 = new Button(window) { - Text = "Default (BG)", - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1 - }; - btnFile2.Show(); - - Button btnFile3 = new Button(window) { - Text = "Blue (FG)", - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1 - }; - btnFile3.Show(); - - Button btnFile4 = new Button(window) { - Text = "Default (FG)", - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1 - }; - btnFile4.Show(); - - buttonBox1.PackEnd(btnFile1); - buttonBox1.PackEnd(btnFile2); - buttonBox2.PackEnd(btnFile3); - buttonBox2.PackEnd(btnFile4); - - lbInfo = new Label(window) { - Color = Color.White, - AlignmentX = -1, - AlignmentY = 0, - WeightX = 1 - }; - lbInfo.Show(); - - image = new Image(window) { - IsFixedAspect = true, - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1 - }; - image.Show(); - image.Load(Path.Combine(TestRunner.ResourceDir, "btn_delete.png")); - image.Clicked += (s, e) => - { - Console.WriteLine("Image has been clicked. (IsFixedAspect = {0}", image.IsFixedAspect); - image.IsFixedAspect = image.IsFixedAspect == true ? false : true; - }; - - btnFile1.Clicked += (s, e) => { image.BackgroundColor = Color.Blue; UpdateLabelText(image.BackgroundColor.ToString()); }; - btnFile2.Clicked += (s, e) => { image.BackgroundColor = Color.Default; UpdateLabelText(image.BackgroundColor.ToString()); }; - btnFile3.Clicked += (s, e) => { image.Color = Color.Blue; UpdateLabelText(image.Color.ToString(), false); }; - btnFile4.Clicked += (s, e) => { image.Color = Color.Default; UpdateLabelText(image.Color.ToString(), false); }; - - box.PackEnd(buttonBox1); - box.PackEnd(buttonBox2); - box.PackEnd(lbInfo); - box.PackEnd(image); - } - - void UpdateLabelText(string text, bool isBackground = true) - { - if(isBackground) - lbInfo.Text = " Background Color => " + text + ""; - else - lbInfo.Text = " Foreground Color => " + text + ""; - } - } -} diff --git a/test/ElmSharp.Test/TC/ImageTest4.cs b/test/ElmSharp.Test/TC/ImageTest4.cs deleted file mode 100644 index 6c54c3506..000000000 --- a/test/ElmSharp.Test/TC/ImageTest4.cs +++ /dev/null @@ -1,86 +0,0 @@ -/* - * 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.Diagnostics; -using System.IO; - -namespace ElmSharp.Test -{ - public class ImageTest4 : TestCaseBase - { - public override string TestName => "ImageTest4"; - public override string TestDescription => "To test border operation of Image"; - - Image image, image2; - - public override void Run(Window window) - { - Background bg = new Background(window); - bg.Color = Color.White; - bg.Move(0, 0); - bg.Resize(window.ScreenSize.Width, window.ScreenSize.Height); - bg.Show(); - - Button btnBorder = new Button(window) - { - Text = "Border Set : off", - }; - btnBorder.Move(10, 10); - btnBorder.Resize(300, 100); - btnBorder.Show(); - - Button btnBorderCenterFillMode = new Button(window) - { - Text = "BoderCenterFillMode", - }; - btnBorderCenterFillMode.Move(310, 10); - btnBorderCenterFillMode.Resize(300, 100); - btnBorderCenterFillMode.Show(); - - image2 = new Image(window); - image2.Load(Path.Combine(TestRunner.ResourceDir, "TED/large/a.jpg")); - image2.MinimumWidth = 300; - image2.MinimumHeight = 300; - image2.Move(50, 500); - image2.Resize(600, 500); - image2.Show(); - - image = new Image(window); - image.Load(Path.Combine(TestRunner.ResourceDir, "picture.png")); - image.MinimumWidth = image.ObjectSize.Width; - image.MinimumHeight = image.ObjectSize.Height; - image.Move(100, 600); - image.Resize(image.ObjectSize.Width, image.ObjectSize.Height); - image.Show(); - - - btnBorder.Clicked += (s, e) => - { - int nX = image.ObjectSize.Width / 6; - int nY = image.ObjectSize.Height / 6; - image.SetBorder(nX, nX, nY, nY); - btnBorder.Text = "Border Set : on"; - }; - - btnBorderCenterFillMode.Clicked += (s, e) => - { - image.BorderCenterFillMode = ((ImageBorderFillMode)Enum.ToObject(typeof(ImageBorderFillMode), ((int)image.BorderCenterFillMode + 1) % Enum.GetValues(typeof(ImageBorderFillMode)).Length)); - btnBorderCenterFillMode.Text = image.BorderCenterFillMode.ToString(); - }; - } - } -} \ No newline at end of file diff --git a/test/ElmSharp.Test/TC/IndexTest1.cs b/test/ElmSharp.Test/TC/IndexTest1.cs deleted file mode 100644 index 767b7b0f7..000000000 --- a/test/ElmSharp.Test/TC/IndexTest1.cs +++ /dev/null @@ -1,116 +0,0 @@ -/* - * 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 ElmSharp; -using System.Collections.Generic; - -namespace ElmSharp.Test -{ - class IndexTest1 : TestCaseBase - { - Dictionary _indexTable = new Dictionary(); - public override string TestName => "IndexTest1"; - public override string TestDescription => "To test group operation of Index"; - public override void Run(Window window) - { - Conformant conformant = new Conformant(window); - conformant.Show(); - Box box = new Box(window) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - IsHorizontal = true, - }; - box.Show(); - GenList list = new GenList(window) - { - Homogeneous = false, - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1 - }; - list.Show(); - Index index = new Index(window) - { - IsHorizontal = false, - AlignmentY = -1, - WeightY = 1, - MinimumWidth = 100, - AutoHide = false, - Style = "fastscroll" - }; - index.Show(); - - GenItemClass groupClass = new GenItemClass("group_index") - { - GetTextHandler = (obj, part) => - { - return string.Format("{0} - {1}", (string)obj, part); - } - }; - - GenListItem[] groups = new GenListItem[10]; - - for (int i = 0; i < 10; i++) - { - groups[i] = list.Append(groupClass, string.Format("{0}", i), GenListItemType.Group); - var indexitem = index.Append(string.Format("{0}", i)); - indexitem.Selected += (s, e) => - { - Console.WriteLine("Index selected : {0}", ((IndexItem)s).Text); - list.ScrollTo(_indexTable[(IndexItem)s], ScrollToPosition.In, true); - }; - _indexTable[indexitem] = groups[i]; - } - - GenItemClass defaultClass = new GenItemClass("default") - { - GetTextHandler = (obj, part) => - { - return string.Format("{0} - {1}", (string)obj, part); - } - }; - - for (int j = 0; j < 10; j++) - { - for (int i = 0; i < 20; i++) - { - list.Append(defaultClass, string.Format("{0} Item", i), GenListItemType.Normal, groups[j]); - } - } - - list.ItemSelected += List_ItemSelected; - index.Update(0); - box.PackEnd(list); - box.PackEnd(index); - box.SetLayoutCallback(() => - { - list.Geometry = box.Geometry; - index.Geometry = box.Geometry; - }); - conformant.SetContent(box); - } - - private void List_ItemSelected(object sender, GenListItemEventArgs e) - { - Console.WriteLine("{0} Item was selected", (string)(e.Item.Data)); - } - } -} diff --git a/test/ElmSharp.Test/TC/IndexTest2.cs b/test/ElmSharp.Test/TC/IndexTest2.cs deleted file mode 100644 index 9f9efc8ad..000000000 --- a/test/ElmSharp.Test/TC/IndexTest2.cs +++ /dev/null @@ -1,145 +0,0 @@ -/* - * 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 ElmSharp; -using System.Collections.Generic; - -namespace ElmSharp.Test -{ - public class IndexTest2 : TestCaseBase - { - Dictionary _indexTable = new Dictionary(); - - public override string TestName => "IndexTest2"; - public override string TestDescription => "To test basic operation of Index"; - public override void Run(Window window) - { - Conformant conformant = new Conformant(window); - conformant.Show(); - Box outterBox = new Box(window) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - IsHorizontal = false, - }; - outterBox.Show(); - Scroller scroller = new Scroller(window) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - ScrollBlock = ScrollBlock.Vertical, - HorizontalPageScrollLimit = 1, - }; - scroller.SetPageSize(1.0, 1.0); - scroller.Show(); - - Box box = new Box(window) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - IsHorizontal = true, - }; - box.Show(); - scroller.SetContent(box); - - Index index = new Index(window) - { - IsHorizontal = true, - Style = "pagecontrol", - AlignmentX = -1, - WeightX = 1, - MinimumHeight = 200, - }; - index.Show(); - - var rnd = new Random(); - for (int i = 0; i < 10; i++) - { - int r = rnd.Next(255); - int g = rnd.Next(255); - int b = rnd.Next(255); - Color color = Color.FromRgb(r, g, b); - Rectangle colorBox = new Rectangle(window) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - Color = color, - MinimumWidth = window.ScreenSize.Width, - }; - colorBox.Show(); - Console.WriteLine("Height = {0}", colorBox.Geometry.Height); - box.PackEnd(colorBox); - var item = index.Append(string.Format("{0}", i)); - item.Selected += (s, e) => - { - scroller.ScrollTo(_indexTable[(IndexItem)s], 0, true); - }; - _indexTable[item] = i; - } - - conformant.SetContent(outterBox); - outterBox.PackEnd(scroller); - - Button prev = new Button(window) - { - AlignmentX = -1, - WeightX = 1, - Text = "Prev" - }; - Button next = new Button(window) - { - AlignmentX = -1, - WeightX = 1, - Text = "next" - }; - prev.Clicked += (s, e) => - { - scroller.ScrollTo(scroller.HorizontalPageIndex > 0 ? scroller.HorizontalPageIndex - 1 : 0, scroller.VerticalPageIndex, true); - }; - next.Clicked += (s, e) => - { - scroller.ScrollTo(scroller.HorizontalPageIndex + 1, scroller.VerticalPageIndex, true); - }; - prev.Show(); - next.Show(); - outterBox.PackEnd(prev); - outterBox.PackEnd(next); - outterBox.PackEnd(index); - - scroller.DragStart += Scroller_DragStart; - scroller.DragStop += Scroller_DragStop; - } - - private void Scroller_DragStop(object sender, EventArgs e) - { - Console.WriteLine("Drag stop"); - } - - private void Scroller_DragStart(object sender, EventArgs e) - { - Console.WriteLine("Drag start"); - } - } -} diff --git a/test/ElmSharp.Test/TC/KeyEventTest1.cs b/test/ElmSharp.Test/TC/KeyEventTest1.cs deleted file mode 100644 index 0f6efd796..000000000 --- a/test/ElmSharp.Test/TC/KeyEventTest1.cs +++ /dev/null @@ -1,108 +0,0 @@ -/* - * 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 ElmSharp; - -namespace ElmSharp.Test -{ - class KeyEventTest1 : TestCaseBase - { - public override string TestName => "KeyEventTest1"; - public override string TestDescription => "To test basic operation of KeyEvent"; - - Box box; - - public override void Run(Window window) - { - Conformant conformant = new Conformant(window); - conformant.Show(); - box = new Box(window); - box.BackgroundColor = Color.Orange; - conformant.SetContent(box); - box.Show(); - - Button button1 = new Button(window) { - Text = "Button 1", - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1 - }; - Button button2 = new Button(window) { - Text = "Button 2", - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - BackgroundColor = new Color(50,100,200,75) - }; - - Box innerBox = new Box(window) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - }; - innerBox.Show(); - Button button3 = new Button(window) - { - Text = "Button 3", - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - BackgroundColor = new Color(50, 100, 200, 75) - }; - - box.PackEnd(button1); - box.PackEnd(button2); - box.PackEnd(innerBox); - innerBox.PackEnd(button3); - - - button1.Show(); - button2.Show(); - button3.Show(); - - box.KeyDown += (s, e) => - { - System.Console.WriteLine("Key down {0} on box has onHold {1}", e.KeyName, e.Flags); - }; - button1.KeyDown += (s, e) => - { - System.Console.WriteLine("Key down {0} on button1 has onHold {1}", e.KeyName, e.Flags); - e.Flags = EvasEventFlag.OnHold; - }; - button2.KeyDown += (s, e) => - { - System.Console.WriteLine("Key down {0} on button2 has onHold {1}", e.KeyName, e.Flags); - }; - button3.KeyDown += (s, e) => - { - System.Console.WriteLine("Key down {0} on button3 has onHold {1}", e.KeyName, e.Flags); - }; - innerBox.KeyDown += (s, e) => - { - System.Console.WriteLine("Key down {0} on innerbox has onHold {1}", e.KeyName, e.Flags); - e.Flags = EvasEventFlag.OnHold; - }; - - - } - } -} diff --git a/test/ElmSharp.Test/TC/LabelTest1.cs b/test/ElmSharp.Test/TC/LabelTest1.cs deleted file mode 100644 index d09b8ffbe..000000000 --- a/test/ElmSharp.Test/TC/LabelTest1.cs +++ /dev/null @@ -1,45 +0,0 @@ -/* - * 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 ElmSharp; - -namespace ElmSharp.Test -{ - class LabelTest1 : TestCaseBase - { - public override string TestName => "LabelTest1"; - public override string TestDescription => "To test basic operation of Label"; - - public override void Run(Window window) - { - Background bg = new Background(window); - bg.Color = Color.White; - bg.Move(0, 0); - bg.Resize(window.ScreenSize.Width, window.ScreenSize.Height); - bg.Show(); - - Label label1 = new Label(window); - label1.Color = Color.Black; - label1.Text = "Label Test!!!"; - - label1.Show(); - label1.Resize(200, 30); - label1.Move(0, 0); - } - - } -} diff --git a/test/ElmSharp.Test/TC/LabelTest2.cs b/test/ElmSharp.Test/TC/LabelTest2.cs deleted file mode 100644 index 25a2b5626..000000000 --- a/test/ElmSharp.Test/TC/LabelTest2.cs +++ /dev/null @@ -1,83 +0,0 @@ -/* - * 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 ElmSharp; - -namespace ElmSharp.Test -{ - class LabelTest2 : TestCaseBase - { - public override string TestName => "LabelTest2"; - public override string TestDescription => "To test basic operation of Label"; - - public override void Run(Window window) - { - Background bg = new Background(window); - bg.Color = Color.White; - bg.Move(0, 0); - bg.Resize(window.ScreenSize.Width, window.ScreenSize.Height); - bg.Show(); - - Label label1 = new Label(window); - label1.Text = "[default valign=top] gyj [bottom gyp], [top gyp], [middle gyp]"; - label1.TextStyle = "DEFAULT = 'color=#000000FF backing_color=#ff0000 backing=on font_size=25 align=left valign=top wrap=word'"; - label1.Resize(650, 0); - var size = label1.EdjeObject["elm.text"].TextBlockFormattedSize; - label1.Show(); - label1.Resize(size.Width, size.Height); - label1.Move(0, 0); - - Label label2 = new Label(window); - label2.Move(0, size.Height + 10); - label2.Text = "[default valign=middle] gyj [bottom gyp], [top gyp], [middle gyp]"; - label2.TextStyle = "DEFAULT = 'color=#000000FF backing_color=#ff0000 backing=on font_size=25 align=left valign=middle wrap=word'"; - label2.Resize(650, 0); - size = label2.EdjeObject["elm.text"].TextBlockFormattedSize; - label2.Show(); - label2.Resize(size.Width, size.Height); - - Label label3 = new Label(window); - label3.Move(0, label2.Geometry.Y + size.Height + 10); - label3.Text = "[default valign=bottom] gyj [bottom gyp], [top gyp], [middle gyp]"; - label3.TextStyle = "DEFAULT = 'color=#000000FF backing_color=#ff0000 backing=on font_size=25 align=left valign=bottom wrap=word'"; - label3.Resize(650, 0); - size = label3.EdjeObject["elm.text"].TextBlockFormattedSize; - label3.Show(); - label3.Resize(size.Width, size.Height); - - Label label4 = new Label(window); - label4.Move(0, label3.Geometry.Y + size.Height + 10); - label4.Text = "[No TextStyle]" + - "[bottom gyp], " + - "[top gyp], " + - "[middle gyp]"; - label4.Resize(650, 0); - size = label4.EdjeObject["elm.text"].TextBlockFormattedSize; - label4.Show(); - label4.Resize(size.Width, size.Height); - - Label label5 = new Label(window); - label5.Move(0, label4.Geometry.Y + size.Height + 10); - label5.Text = "[top gyp]"; - label5.Resize(650, 0); - size = label5.EdjeObject["elm.text"].TextBlockFormattedSize; - label5.Show(); - label5.Resize(size.Width, size.Height); - } - - } -} diff --git a/test/ElmSharp.Test/TC/LabelTest3.cs b/test/ElmSharp.Test/TC/LabelTest3.cs deleted file mode 100644 index eaf5aeb14..000000000 --- a/test/ElmSharp.Test/TC/LabelTest3.cs +++ /dev/null @@ -1,77 +0,0 @@ -/* - * 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 ElmSharp; -using System.Collections.Generic; - -namespace ElmSharp.Test -{ - public class LabelTest3 : TestCaseBase - { - public override string TestName => "LabelTest3"; - public override string TestDescription => "To test basic operation of Label"; - - public override void Run(Window window) - { - Background bg = new Background(window) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - Color = Color.White - }; - bg.Show(); - window.AddResizeObject(bg); - - Conformant conformant = new Conformant(window); - conformant.Show(); - Scroller scroller = new Scroller(window); - scroller.Show(); - conformant.SetContent(scroller); - Box box = new Box(window); - box.SetLayoutCallback(() => { }); - box.Show(); - scroller.SetContent(box); - - Size size; - - Label label1 = new Label(window); - box.PackEnd(label1); - Label label2 = new Label(window); - box.PackEnd(label2); - - - label1.Text = "Jo Ann Buckner"; - label1.TextStyle = "DEFAULT='color=#000000FF font_size=24 align=left valign=bottom wrap=word'"; - label1.Show(); - label1.Resize(100000, 0); - size = label1.EdjeObject["elm.text"].TextBlockFormattedSize; - label1.Geometry = new Rect(55, 213, size.Width, size.Height); - - label2.Text = "Customer Success Engineer"; - label2.TextStyle = "DEFAULT='color=#000000FF font_size=16 align=left valign=bottom wrap=word'"; - label2.Show(); - - label2.Resize(100000, 0); - size = label2.EdjeObject["elm.text"].TextBlockFormattedSize; - label2.Geometry = new Rect(55, 300, size.Width, size.Height); - - - } - } -} diff --git a/test/ElmSharp.Test/TC/LabelTest4.cs b/test/ElmSharp.Test/TC/LabelTest4.cs deleted file mode 100644 index c7dab02df..000000000 --- a/test/ElmSharp.Test/TC/LabelTest4.cs +++ /dev/null @@ -1,51 +0,0 @@ -/* - * 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 ElmSharp; -using System.Collections.Generic; - -namespace ElmSharp.Test -{ - public class LabelTest4 : TestCaseBase - { - public override string TestName => "LabelTest4"; - public override string TestDescription => "To test slide Animation of Label"; - - public override void Run(Window window) - { - Background bg = new Background(window); - bg.Color = Color.White; - bg.Move(0, 0); - bg.Resize(window.ScreenSize.Width, window.ScreenSize.Height); - bg.Show(); - - Label label1 = new Label(window) - { - Style = "slide_long", - SlideDuration = 3, - SlideMode = LabelSlideMode.Always, - Color = Color.Black, - Text = "Lab test12345678" - }; - - label1.Show(); - label1.Resize(200, 30); - label1.Move(0, 0); - label1.PlaySlide(); - } - } -} diff --git a/test/ElmSharp.Test/TC/LabelTest5.cs b/test/ElmSharp.Test/TC/LabelTest5.cs deleted file mode 100644 index 46294e41d..000000000 --- a/test/ElmSharp.Test/TC/LabelTest5.cs +++ /dev/null @@ -1,112 +0,0 @@ -/* - * 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 ElmSharp; -using System.Collections.Generic; - -namespace ElmSharp.Test -{ - public class LabelTest5 : TestCaseBase - { - public override string TestName => "LabelTest5"; - public override string TestDescription => "To test Slide Animation Speed of Label"; - - public override void Run(Window window) - { - Background bg = new Background(window) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - Color = Color.White - }; - bg.Show(); - window.AddResizeObject(bg); - - Conformant conformant = new Conformant(window); - conformant.Show(); - Box box = new Box(window) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1 - }; - conformant.SetContent(box); - box.Show(); - - Label label1 = new Label(window) - { - Text = "Test Slide Animaiton", - Color = Color.Black, - Style = "slide_long", - SlideSpeed = 100, - SlideMode = LabelSlideMode.Always, - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1 - }; - label1.Show(); - label1.PlaySlide(); - - Button btnCurrentSpeed = new Button(window) - { - Text = "Current Speed : 100", - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - }; - - Button btnSpeedUp = new Button(window) - { - Text = "Speed + 10", - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - }; - btnSpeedUp.Clicked += (s, e) => - { - label1.SlideSpeed += 10; - btnCurrentSpeed.Text = string.Format("Current Speed : {0}", label1.SlideSpeed); - label1.PlaySlide(); - }; - Button btnSpeedDown = new Button(window) - { - Text = "Speed - 10", - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - }; - btnSpeedDown.Clicked += (s, e) => - { - label1.SlideSpeed -= 10; - btnCurrentSpeed.Text = string.Format("Current Speed : {0}", label1.SlideSpeed); - label1.PlaySlide(); - }; - - box.PackEnd(label1); - box.PackEnd(btnCurrentSpeed); - box.PackEnd(btnSpeedUp); - box.PackEnd(btnSpeedDown); - btnCurrentSpeed.Show(); - btnSpeedUp.Show(); - btnSpeedDown.Show(); - } - } -} diff --git a/test/ElmSharp.Test/TC/LabelTest6.cs b/test/ElmSharp.Test/TC/LabelTest6.cs deleted file mode 100644 index 31a2c108f..000000000 --- a/test/ElmSharp.Test/TC/LabelTest6.cs +++ /dev/null @@ -1,95 +0,0 @@ -/* - * 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. - */ - - -namespace ElmSharp.Test.Wearable -{ - public class LabelTest6 : TestCaseBase - { - public override string TestName => "LabelTest6"; - public override string TestDescription => "To test Horizontal align of Label"; - - int count = 0; - public override void Run(Window window) - { - - Background bg = new Background(window) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - Color = Color.White - }; - bg.Show(); - window.AddResizeObject(bg); - - Conformant conformant = new Conformant(window); - conformant.Show(); - Box box = new Box(window); - box.Show(); - conformant.SetContent(box); - - box.Resize(window.ScreenSize.Width, window.ScreenSize.Height); - - var label = new Label(window); - var label2 = new Label(window); - var button = new Button(window); - - box.SetLayoutCallback(() => - { - label.Geometry = new Rect(10, box.Geometry.Y, box.Geometry.Width - 20, 100); - label2.Geometry = new Rect(10, label.Geometry.Y + 120, box.Geometry.Width - 20, 100); - button.Geometry = new Rect(0, box.Geometry.Y + 300, box.Geometry.Width, 200); - }); - - - label.BackgroundColor = Color.Aqua; - label.LineWrapType = WrapType.Word; - label.IsEllipsis = false; - label.TextStyle = "DEFAULT = 'align=left'"; - - label2.BackgroundColor = Color.Aqua; - label2.LineWrapType = WrapType.None; - label2.IsEllipsis = false; - label2.TextStyle = "DEFAULT = 'align=left'"; - - label.Show(); - label2.Show(); - box.PackEnd(label); - box.PackEnd(label2); - - - button.SetAlignment(-1, -1); - button.SetWeight(1, 1); - button.Text = "Append"; - button.Show(); - box.PackEnd(button); - - - button.Clicked += (s, e) => - { - string alpahbat = "ABCDEFGHIJKLMOPQRSTUVWXYZ"; - label.Text += alpahbat[count % alpahbat.Length]; - label.Text += alpahbat[count % alpahbat.Length]; - label2.Text += alpahbat[count % alpahbat.Length]; - label2.Text += alpahbat[count % alpahbat.Length]; - count++; - }; - - } - } -} diff --git a/test/ElmSharp.Test/TC/LabelValignTest1.cs b/test/ElmSharp.Test/TC/LabelValignTest1.cs deleted file mode 100644 index 5d72b7334..000000000 --- a/test/ElmSharp.Test/TC/LabelValignTest1.cs +++ /dev/null @@ -1,126 +0,0 @@ -/* - * 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 ElmSharp; -using System.Collections.Generic; - -namespace ElmSharp.Test -{ - public class LabelValignTest1 : TestCaseBase - { - public override string TestName => "LabelValignTest1"; - public override string TestDescription => "To test Vertical align of Label"; - - public override void Run(Window window) - { - Background bg = new Background(window) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - Color = Color.White - }; - bg.Show(); - window.AddResizeObject(bg); - - Conformant conformant = new Conformant(window); - conformant.Show(); - Box box = new Box(window) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1 - }; - box.Show(); - conformant.SetContent(box); - - Box labelBox = new Box(window) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - MinimumHeight = 400, - BackgroundColor = Color.Blue, - }; - labelBox.Show(); - - - - Label label1 = new Label(window) - { - Text = "Align Test", - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1 - }; - label1.TextStyle = "DEFAULT = 'color=#000000FF font_size=100 align=center wrap=word'"; - label1.Show(); - labelBox.PackEnd(label1); - - Button top = new Button(window) - { - Text = "Top", - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - }; - - Button middle = new Button(window) - { - Text = "Middle", - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - }; - Button bottom = new Button(window) - { - Text = "bottom", - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - }; - - top.Clicked += (s, e) => - { - label1.SetVerticalTextAlignment("elm.text", 0); - }; - - middle.Clicked += (s, e) => - { - label1.SetVerticalTextAlignment("elm.text", 0.5); - }; - - bottom.Clicked += (s, e) => - { - label1.SetVerticalTextAlignment("elm.text", 1.0); - }; - - top.Show(); - labelBox.Show(); - middle.Show(); - bottom.Show(); - box.PackEnd(labelBox); - box.PackEnd(top); - box.PackEnd(middle); - box.PackEnd(bottom); - } - } -} diff --git a/test/ElmSharp.Test/TC/ListTest1.cs b/test/ElmSharp.Test/TC/ListTest1.cs deleted file mode 100644 index b81e28558..000000000 --- a/test/ElmSharp.Test/TC/ListTest1.cs +++ /dev/null @@ -1,123 +0,0 @@ -/* - * 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 ElmSharp; - -namespace ElmSharp.Test -{ - public class ListTest1 : TestCaseBase - { - public override string TestName => "ListTest1"; - public override string TestDescription => "To test basic operation of List"; - private int _count = 0; - public override void Run(Window window) - { - Conformant conformant = new Conformant(window); - conformant.Show(); - Box box = new Box(window) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - }; - box.Show(); - conformant.SetContent(box); - - List list = new List(window) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1 - }; - - for (int i = 0; i < 5; i++) - { - list.Append(string.Format("{0} item", _count++)); - } - - list.ItemSelected += List_Selected; - list.ItemUnselected += List_Unselected; - list.ItemActivated += List_ItemActivated; - list.ItemDoubleClicked += List_ItemDoubleClicked; - list.ItemLongPressed += List_ItemLongPressed; - list.RenderPost += List_RenderPost; - list.Update(); - list.Show(); - - box.PackEnd(list); - Button append = new Button(window) - { - Text = "Append", - AlignmentX = -1, - WeightX = 1, - }; - Button prepend = new Button(window) - { - Text = "Prepend", - AlignmentX = -1, - WeightX = 1, - }; - append.Clicked += (s, e) => - { - list.Append(string.Format("{0} item", _count++)); - list.Update(); - }; - prepend.Clicked += (s, e) => - { - list.Prepend(string.Format("{0} item", _count++)); - list.Update(); - }; - append.Show(); - prepend.Show(); - box.PackEnd(append); - box.PackEnd(prepend); - } - - int count = 0; - private void List_RenderPost(object sender, EventArgs e) - { - Console.WriteLine("{0} List_RenderPost", count++); - } - - private void List_ItemLongPressed(object sender, ListItemEventArgs e) - { - Console.WriteLine("{0} item was long pressed", e.Item.Text); - } - - private void List_ItemDoubleClicked(object sender, ListItemEventArgs e) - { - Console.WriteLine("{0} item was Double clicked", e.Item.Text); - } - - private void List_ItemActivated(object sender, ListItemEventArgs e) - { - Console.WriteLine("{0} item was Activated", e.Item.Text); - } - - private void List_Unselected(object sender, ListItemEventArgs e) - { - Console.WriteLine("{0} item was unselected", e.Item.Text); - } - - private void List_Selected(object sender, ListItemEventArgs e) - { - Console.WriteLine("{0} item was selected", e.Item.Text); - } - } -} diff --git a/test/ElmSharp.Test/TC/MultibuttonEntryTest1.cs b/test/ElmSharp.Test/TC/MultibuttonEntryTest1.cs deleted file mode 100644 index 2ed7932d2..000000000 --- a/test/ElmSharp.Test/TC/MultibuttonEntryTest1.cs +++ /dev/null @@ -1,119 +0,0 @@ -/* - * 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.Collections.Generic; -using ElmSharp; - -namespace ElmSharp.Test -{ - class MultiButtonEntryTest1 : TestCaseBase - { - public override string TestName => "MultiButtonEntryTest1"; - public override string TestDescription => "To test basic operation of MultiButtonEntry"; - - public override void Run(Window window) - { - Background bg = new Background(window); - bg.Color = Color.White; - bg.Move(0, 0); - bg.Resize(window.ScreenSize.Width, window.ScreenSize.Height); - bg.Show(); - - MultiButtonEntry mbe = new MultiButtonEntry(window) - { - IsEditable = true, - IsExpanded = true, - Text = "To: " - }; - - var test = mbe.Append("test"); - mbe.Prepend("prepend"); - mbe.Append("append"); - mbe.InsertBefore(test, "insertBefore"); - mbe.InsertAfter(test, "insertAfter"); - - mbe.ItemSelected += (s, e) => - { - Console.WriteLine("item selected: " + e.Item.Label); - if (e.Item.Next != null) - Console.WriteLine("next item: " + e.Item.Next); - if (e.Item.Prev != null) - Console.WriteLine("previous item: " + e.Item.Prev); - }; - - mbe.ItemClicked += (s, e) => - { - Console.WriteLine("item clicked: " + e.Item.Label); - }; - - mbe.ItemLongPressed += (s, e) => - { - Console.WriteLine("item longpressed: " + e.Item.Label); - }; - - mbe.ItemAdded += (s, e) => - { - Console.WriteLine("item added: " + e.Item.Label); - }; - - mbe.ItemDeleted += (s, e) => - { - Console.WriteLine("item deleted: " + e.Item.Label); - }; - - mbe.AppendFilter((label) => - { - if (label.Contains("a")) - { - Console.WriteLine("appended filter : Item has 'a', It won't be added until 'a' is removed."); - return false; - } - else - { - return true; - } - }); - - mbe.PrependFilter((label) => - { - if (label.Contains("p")) - { - Console.WriteLine("prepended filter : Item has 'p', It won't be added until 'p' is removed."); - return false; - } - else - { - return true; - } - }); - - Label label1 = new Label(window) - { - Text = "MultiButtonEntry Test", - Color = Color.Blue - }; - - label1.Resize(600, 100); - label1.Move(50, 50); - label1.Show(); - - mbe.Resize(600, 600); - mbe.Move(0, 100); - mbe.Show(); - } - } -} \ No newline at end of file diff --git a/test/ElmSharp.Test/TC/MultibuttonEntryTest2.cs b/test/ElmSharp.Test/TC/MultibuttonEntryTest2.cs deleted file mode 100644 index 8639099d6..000000000 --- a/test/ElmSharp.Test/TC/MultibuttonEntryTest2.cs +++ /dev/null @@ -1,114 +0,0 @@ -/* - * 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.Collections.Generic; -using ElmSharp; - -namespace ElmSharp.Test -{ - class MultiButtonEntryTest2 : TestCaseBase - { - public override string TestName => "MultiButtonEntryTest2"; - public override string TestDescription => "To test basic operation of MultiButtonEntry"; - - bool _setCallback = false; - - public override void Run(Window window) - { - Background bg = new Background(window); - bg.Color = Color.White; - bg.Move(0, 0); - bg.Resize(window.ScreenSize.Width, window.ScreenSize.Height); - bg.Show(); - - MultiButtonEntry mbe = new MultiButtonEntry(window) - { - IsEditable = true, - IsExpanded = true, - Text = "To: " - }; - - mbe.Append("Append1"); - mbe.Append("Append2"); - mbe.Append("Append3"); - mbe.Append("Append4"); - mbe.Append("Append5"); - mbe.Append("Append6"); - mbe.Append("Append7"); - mbe.Append("Append8"); - mbe.Append("Append9"); - mbe.Append("Append10"); - mbe.Append("Append11"); - mbe.Append("Append12"); - - Label label1 = new Label(window) - { - Text = "MultiButtonEntry Test", - Color = Color.Blue - }; - - var expandButton = new Button(window) - { - Text = "IsExpanded", - AlignmentX = -1, - WeightX = 1, - }; - - var formatButton = new Button(window) - { - Text = "format", - AlignmentX = -1, - WeightX = 1, - }; - - expandButton.Clicked += (sender, e) => - { - mbe.IsExpanded = !mbe.IsExpanded; - }; - - formatButton.Clicked += (sender, e) => - { - if (_setCallback) - { - mbe.SetFormatCallback(null); - _setCallback = false; - } - else - { - mbe.SetFormatCallback((count) => { return "(" + count + ")"; }); - _setCallback = true; - } - }; - - label1.Resize(600, 100); - label1.Move(50, 50); - label1.Show(); - - mbe.Resize(600, 600); - mbe.Move(0, 100); - mbe.Show(); - - expandButton.Resize(200, 100); - expandButton.Move(50, 700); - expandButton.Show(); - - formatButton.Resize(200, 100); - formatButton.Move(300, 700); - formatButton.Show(); - } - } -} \ No newline at end of file diff --git a/test/ElmSharp.Test/TC/NaviframeTest1.cs b/test/ElmSharp.Test/TC/NaviframeTest1.cs deleted file mode 100644 index 64118bcd9..000000000 --- a/test/ElmSharp.Test/TC/NaviframeTest1.cs +++ /dev/null @@ -1,62 +0,0 @@ -/* - * 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 ElmSharp; - -namespace ElmSharp.Test -{ - class NaviframeTest1 : TestCaseBase - { - public override string TestName => "NaviframeTest1"; - public override string TestDescription => "Naviframe test"; - - public override void Run(Window window) - { - Conformant conformant = new Conformant(window); - conformant.Show(); - - Naviframe navi = new Naviframe(window) - { - PreserveContentOnPop = true, - DefaultBackButtonEnabled = true - }; - - navi.Popped += (s, e) => - { - Console.WriteLine("naviframe was popped : " + e.Content.GetType()); - }; - - Rectangle rect1 = new Rectangle(window) - { - Color = Color.Red, - Geometry = new Rect(0, 0, 200, 200) - }; - - navi.Push(rect1, "First Page"); - - Rectangle rect2 = new Rectangle(window) - { - Color = Color.Blue, - Geometry = new Rect(0, 0, 200, 200) - }; - - navi.Push(rect2, "Second Page"); - navi.Show(); - conformant.SetContent(navi); - } - } -} diff --git a/test/ElmSharp.Test/TC/NaviframeTest2.cs b/test/ElmSharp.Test/TC/NaviframeTest2.cs deleted file mode 100644 index 064640bda..000000000 --- a/test/ElmSharp.Test/TC/NaviframeTest2.cs +++ /dev/null @@ -1,176 +0,0 @@ -/* - * 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.Linq; - -namespace ElmSharp.Test -{ - public class NaviframeTest2 : TestCaseBase - { - public override string TestName => "NaviframeTest2"; - public override string TestDescription => "Naviframe test"; - - Naviframe _navi; - int _sequence = 0; - - public override void Run(Window window) - { - Conformant conformant = new Conformant(window); - conformant.Show(); - - Naviframe navi = new Naviframe(window) - { - PreserveContentOnPop = true, - DefaultBackButtonEnabled = true - }; - _navi = navi; - - navi.Popped += (s, e) => - { - Console.WriteLine("----- Naviframe was popped {0:x} ", (int)(IntPtr)e.Content); - }; - - navi.Push(CreatePage(window), "0 Page"); - navi.Show(); - conformant.SetContent(navi); - } - - EvasObject CreatePage(Window parent) - { - Box box = new Box(parent); - box.Show(); - - Label label = new Label(parent) { - Text = string.Format("{0} Page", _sequence++), - WeightX = 1, - AlignmentX = -1, - }; - Button push = new Button(parent) { - Text = "Push", - WeightX = 1, - AlignmentX = -1, - }; - Button pop = new Button(parent) { - Text = "pop", - WeightX = 1, - AlignmentX = -1, - }; - Button insertBeforeTop = new Button(parent) { - Text = "insertBeforeTop", - WeightX = 1, - AlignmentX = -1, - }; - Button insertAfterTop = new Button(parent) { - Text = "insertAfterTop", - WeightX = 1, - AlignmentX = -1, - }; - - Button removeTop = new Button(parent) - { - Text = "removeTop", - WeightX = 1, - AlignmentX = -1, - }; - - Button barChange = new Button(parent) - { - Text = "TitleBarColor Change", - WeightX = 1, - AlignmentX = -1, - }; - - Button barColorDefault = new Button(parent) - { - Text = "TitleBarColor - Default", - WeightX = 1, - AlignmentX = -1, - }; - - label.Show(); - push.Show(); - pop.Show(); - insertBeforeTop.Show(); - insertAfterTop.Show(); - removeTop.Show(); - barChange.Show(); - barColorDefault.Show(); - - push.Clicked += (s, e) => - { - _navi.Push(CreatePage(parent), string.Format("{0} Page", _sequence-1)); - }; - - pop.Clicked += (s, e) => - { - var item = _navi.NavigationStack.LastOrDefault(); - int nativePointer = (int)(IntPtr)(item.Content); - Console.WriteLine("----- Before Call _navi.Pop() {0:x} ", nativePointer); - _navi.Pop(); - Console.WriteLine("----- After Call _navi.Pop() {0:x} ", nativePointer); - }; - - insertBeforeTop.Clicked += (s, e) => - { - _navi.InsertBefore(_navi.NavigationStack.LastOrDefault(), CreatePage(parent), string.Format("{0} Page", _sequence - 1)); - }; - - insertAfterTop.Clicked += (s, e) => - { - _navi.InsertAfter(_navi.NavigationStack.LastOrDefault(), CreatePage(parent), string.Format("{0} Page", _sequence - 1)); - }; - removeTop.Clicked += (s, e) => - { - var item = _navi.NavigationStack.LastOrDefault(); - int nativePointer = (int)(IntPtr)(item.Content); - Console.WriteLine("----- Before Call NaviItem.Delete() {0:x} ", nativePointer); - item.Delete(); - Console.WriteLine("----- After Call NaviItem.Delete() {0:x} ", nativePointer); - }; - - Random rand = new Random(DateTime.Now.Millisecond); - barChange.Clicked += (s, e) => - { - int currentIndex = _navi.NavigationStack.Count - 1; - if (currentIndex >= 0) - { - _navi.NavigationStack[currentIndex].TitleBarBackgroundColor = Color.FromHex(string.Format("#{0:X8}", rand.Next())); - } - }; - - barColorDefault.Clicked += (s, e) => - { - int currentIndex = _navi.NavigationStack.Count - 1; - if (currentIndex >= 0) - { - _navi.NavigationStack[currentIndex].TitleBarBackgroundColor = Color.Default; - } - }; - - box.PackEnd(label); - box.PackEnd(push); - box.PackEnd(pop); - box.PackEnd(insertBeforeTop); - box.PackEnd(insertAfterTop); - box.PackEnd(removeTop); - box.PackEnd(barChange); - box.PackEnd(barColorDefault); - - return box; - } - } -} diff --git a/test/ElmSharp.Test/TC/NaviframeTest3.cs b/test/ElmSharp.Test/TC/NaviframeTest3.cs deleted file mode 100644 index 6c3537641..000000000 --- a/test/ElmSharp.Test/TC/NaviframeTest3.cs +++ /dev/null @@ -1,178 +0,0 @@ -/* - * 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.Linq; - -namespace ElmSharp.Test -{ - public class NaviframeTest3 : TestCaseBase - { - public override string TestName => "NaviframeTest3"; - public override string TestDescription => "Naviframe test"; - - Naviframe _navi; - int _sequence = 0; - - public override void Run(Window window) - { - Conformant conformant = new Conformant(window); - conformant.Show(); - - Naviframe navi = new Naviframe(window) - { - PreserveContentOnPop = true, - DefaultBackButtonEnabled = true - }; - _navi = navi; - - navi.Popped += (s, e) => - { - Console.WriteLine("----- Naviframe was popped {0:x} ", (int)(IntPtr)e.Content); - }; - - NaviItem item = navi.Push(CreatePage(window), "0 Page"); - item.SetPartContent("title_left_btn", new Button(window) { Text = "LEFT" , Style = "naviframe/title_left"} ); - item.SetPartContent("title_right_btn", new Button(window) { Text = "RIGHT", Style = "naviframe/title_right" }); - navi.Show(); - conformant.SetContent(navi); - } - - EvasObject CreatePage(Window parent) - { - Box box = new Box(parent); - box.Show(); - - Label label = new Label(parent) { - Text = string.Format("{0} Page", _sequence++), - WeightX = 1, - AlignmentX = -1, - }; - Button push = new Button(parent) { - Text = "Push", - WeightX = 1, - AlignmentX = -1, - }; - Button pop = new Button(parent) { - Text = "pop", - WeightX = 1, - AlignmentX = -1, - }; - Button insertBeforeTop = new Button(parent) { - Text = "insertBeforeTop", - WeightX = 1, - AlignmentX = -1, - }; - Button insertAfterTop = new Button(parent) { - Text = "insertAfterTop", - WeightX = 1, - AlignmentX = -1, - }; - - Button removeTop = new Button(parent) - { - Text = "removeTop", - WeightX = 1, - AlignmentX = -1, - }; - - Button barChange = new Button(parent) - { - Text = "TitleBarColor Change", - WeightX = 1, - AlignmentX = -1, - }; - - Button barColorDefault = new Button(parent) - { - Text = "TitleBarColor - Default", - WeightX = 1, - AlignmentX = -1, - }; - - label.Show(); - push.Show(); - pop.Show(); - insertBeforeTop.Show(); - insertAfterTop.Show(); - removeTop.Show(); - barChange.Show(); - barColorDefault.Show(); - - push.Clicked += (s, e) => - { - _navi.Push(CreatePage(parent), string.Format("{0} Page", _sequence-1)); - }; - - pop.Clicked += (s, e) => - { - var item = _navi.NavigationStack.LastOrDefault(); - int nativePointer = (int)(IntPtr)(item.Content); - Console.WriteLine("----- Before Call _navi.Pop() {0:x} ", nativePointer); - _navi.Pop(); - Console.WriteLine("----- After Call _navi.Pop() {0:x} ", nativePointer); - }; - - insertBeforeTop.Clicked += (s, e) => - { - _navi.InsertBefore(_navi.NavigationStack.LastOrDefault(), CreatePage(parent), string.Format("{0} Page", _sequence - 1)); - }; - - insertAfterTop.Clicked += (s, e) => - { - _navi.InsertAfter(_navi.NavigationStack.LastOrDefault(), CreatePage(parent), string.Format("{0} Page", _sequence - 1)); - }; - removeTop.Clicked += (s, e) => - { - var item = _navi.NavigationStack.LastOrDefault(); - int nativePointer = (int)(IntPtr)(item.Content); - Console.WriteLine("----- Before Call NaviItem.Delete() {0:x} ", nativePointer); - item.Delete(); - Console.WriteLine("----- After Call NaviItem.Delete() {0:x} ", nativePointer); - }; - - Random rand = new Random(DateTime.Now.Millisecond); - barChange.Clicked += (s, e) => - { - int currentIndex = _navi.NavigationStack.Count - 1; - if (currentIndex >= 0) - { - _navi.NavigationStack[currentIndex].TitleBarBackgroundColor = Color.FromHex(string.Format("#{0:X8}", rand.Next())); - } - }; - - barColorDefault.Clicked += (s, e) => - { - int currentIndex = _navi.NavigationStack.Count - 1; - if (currentIndex >= 0) - { - _navi.NavigationStack[currentIndex].TitleBarBackgroundColor = Color.Default; - } - }; - - box.PackEnd(label); - box.PackEnd(push); - box.PackEnd(pop); - box.PackEnd(insertBeforeTop); - box.PackEnd(insertAfterTop); - box.PackEnd(removeTop); - box.PackEnd(barChange); - box.PackEnd(barColorDefault); - - return box; - } - } -} diff --git a/test/ElmSharp.Test/TC/PanelTest1.cs b/test/ElmSharp.Test/TC/PanelTest1.cs deleted file mode 100644 index d88fcd997..000000000 --- a/test/ElmSharp.Test/TC/PanelTest1.cs +++ /dev/null @@ -1,102 +0,0 @@ -/* - * 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 ElmSharp; - -namespace ElmSharp.Test -{ - public class PanelTest1 : TestCaseBase - { - public override string TestName => "PanelTest1"; - public override string TestDescription => "To test basic operation of Panel"; - - public override void Run(Window window) - { - Conformant conformant = new Conformant(window); - conformant.Show(); - Box box = new Box(window); - conformant.SetContent(box); - box.Show(); - - Label label = new Label(window) - { - Text = "Panel as NonScrollable", - AlignmentX = -1, - WeightX = 1, - }; - label.Show(); - box.PackEnd(label); - - Panel panel = new Panel(window) - { - Direction = PanelDirection.Left, - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - }; - panel.SetScrollable(false); - - Rectangle redbox = new Rectangle(window) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - Color = Color.Red, - }; - redbox.Show(); - panel.SetContent(redbox); - panel.Show(); - panel.IsOpen = true; - box.PackEnd(panel); - - Button button1 = new Button(window) - { - Text = "Toggle open", - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - }; - Button button2 = new Button(window) - { - Text = "Toggle direction", - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - }; - box.PackEnd(button1); - box.PackEnd(button2); - button1.Show(); - button2.Show(); - - button1.Clicked += (s, e) => - { - panel.Toggle(); - }; - button2.Clicked += (s, e) => - { - panel.Direction = (PanelDirection)((int)(panel.Direction+1) % 4); - }; - panel.Toggled += (s, e) => - { - Console.WriteLine("Panel Toggled!"); - }; - } - - } -} diff --git a/test/ElmSharp.Test/TC/PanelTest2.cs b/test/ElmSharp.Test/TC/PanelTest2.cs deleted file mode 100644 index 2cb047b9b..000000000 --- a/test/ElmSharp.Test/TC/PanelTest2.cs +++ /dev/null @@ -1,103 +0,0 @@ -/* - * 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 ElmSharp; - -namespace ElmSharp.Test -{ - public class PanelTest2 : TestCaseBase - { - public override string TestName => "PanelTest2"; - public override string TestDescription => "To test basic operation of Panel"; - - public override void Run(Window window) - { - Conformant conformant = new Conformant(window); - conformant.Show(); - Box box = new Box(window); - conformant.SetContent(box); - box.Show(); - - Label label = new Label(window) - { - Text = "Panel as Scrollable", - AlignmentX = -1, - WeightX = 1, - }; - label.Show(); - box.PackEnd(label); - - Panel panel = new Panel(window) - { - Direction = PanelDirection.Left, - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - }; - panel.SetScrollable(true); - panel.SetScrollableArea(1.0); - - Rectangle redbox = new Rectangle(window) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - Color = Color.Red, - }; - redbox.Show(); - panel.SetContent(redbox); - panel.Show(); - panel.IsOpen = true; - box.PackEnd(panel); - - Button button1 = new Button(window) - { - Text = "Toggle open", - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - }; - Button button2 = new Button(window) - { - Text = "Toggle direction", - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - }; - box.PackEnd(button1); - box.PackEnd(button2); - button1.Show(); - button2.Show(); - - button1.Clicked += (s, e) => - { - panel.Toggle(); - }; - button2.Clicked += (s, e) => - { - panel.Direction = (PanelDirection)((int)(panel.Direction + 1) % 4); - }; - panel.Toggled += (s, e) => - { - Console.WriteLine("Panel Toggled!"); - }; - } - - } -} diff --git a/test/ElmSharp.Test/TC/PanesTest1.cs b/test/ElmSharp.Test/TC/PanesTest1.cs deleted file mode 100644 index 146169e34..000000000 --- a/test/ElmSharp.Test/TC/PanesTest1.cs +++ /dev/null @@ -1,89 +0,0 @@ -/* - * 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 ElmSharp; - -namespace ElmSharp.Test -{ - public class PanesTest1 : TestCaseBase - { - public override string TestName => "PanesTest1"; - public override string TestDescription => "To test basic operation of Panes"; - - public override void Run(Window window) - { - Conformant conformant = new Conformant(window); - conformant.Show(); - Box box = new Box(window); - conformant.SetContent(box); - box.Show(); - - Rectangle redBox = new Rectangle(window) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - Color = Color.Red, - }; - redBox.Show(); - Rectangle blueBox = new Rectangle(window) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - Color = Color.Blue, - }; - Rectangle greenBox = new Rectangle(window) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - Color = Color.Green, - }; - Panes subPanes = new Panes(window) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - Proportion = 0.3, - IsHorizontal = false - }; - subPanes.Show(); - subPanes.SetPartContent("left", blueBox); - subPanes.SetPartContent("right", greenBox); - Panes panes = new Panes(window) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - Proportion = 0.1, - IsFixed = true, - IsHorizontal = true, - }; - panes.SetPartContent("left", redBox); - panes.SetPartContent("right", subPanes); - panes.Show(); - box.PackEnd(panes); - } - - } -} diff --git a/test/ElmSharp.Test/TC/PerformanceTest.cs b/test/ElmSharp.Test/TC/PerformanceTest.cs deleted file mode 100644 index b5bb77e50..000000000 --- a/test/ElmSharp.Test/TC/PerformanceTest.cs +++ /dev/null @@ -1,204 +0,0 @@ -/* - * 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 ElmSharp; - -namespace ElmSharp.Test -{ - public class PerformanceTest : TestCaseBase - { - public override string TestName => "PerformanceTest"; - public override string TestDescription => "To test Performance of GenList"; - - const int TestItemMax = 2000; - const double TimeSet = 5.0; - - string[] arrLabel = { - "Time Warner Cable(Cable)", - "ComCast (Cable)", - "Dish (Satellite)", - "DirecTV (Satellite)", - "Tata Sky (Satellite)", - "Nextra Cable(Cable)", - "DD Plus (Cable)", - "Tikona Cable(Cable)", - "True Provider (Cable)", - "Vodafone (Satellite)", - "Sample Text" - }; - - GenList list; - Box box; - Box box2; - GenListItem ItemTarget = null; - double _enteringSpeed = 0; - int _frameCount = 0; - int _ecoreCount = 0; - double _frameSet = 0; - IntPtr _anim = IntPtr.Zero; - double FrameFPS = 0; - double AnimatorFPS = 0; - - public override void Run(Window window) - { - Conformant conformant = new Conformant(window); - conformant.Show(); - - Naviframe navi = new Naviframe(window) - { - PreserveContentOnPop = true, - DefaultBackButtonEnabled = true - }; - - box = new Box(window) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - }; - box.Show(); - - box2 = new Box(box); - //elm_box_padding_set(box2, ELM_SCALE_SIZE(10), ELM_SCALE_SIZE(10)); ºÎºÐ ºüÁü. - box2.Show(); - box.PackEnd(box2); - - list = new GenList(window) - { - Homogeneous = true, - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - Style = "solid/default" - }; - box.PackEnd(list); - navi.Push(box, "Performance"); - - InitializeListItem(); - - list.Changed += List_Changed; - list.ScrollAnimationStarted += List_ScrollAnimationStarted; - list.ScrollAnimationStopped += List_ScrollAnimationStopped; - list.Show(); - - navi.Show(); - conformant.SetContent(navi); - } - - private void InitializeListItem() - { - GenItemClass defaultClass = new GenItemClass("default") - { - GetTextHandler = (obj, part) => - { - return (string)obj; - } - }; - - for (int i = 0; i < TestItemMax; ++i) - { - if (i == 999) - ItemTarget = list.Append(defaultClass, new string(arrLabel[i % 10].ToCharArray())); - else - list.Append(defaultClass, new string(arrLabel[i % 10].ToCharArray())); - } - } - - private void List_ScrollAnimationStopped(object sender, EventArgs e) - { - list.RenderPost -= List_RenderPostFrame; - list.ScrollAnimationStarted -= List_ScrollAnimationStarted; - list.ScrollAnimationStopped -= List_ScrollAnimationStopped; - - EcoreAnimator.RemoveAnimator(_anim); - Elementary.BringInScrollFriction = _frameSet; - - FrameFPS = _frameCount / TimeSet; - AnimatorFPS = _ecoreCount / TimeSet; - - Button btn1 = new Button(box2) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - }; - btn1.Text = string.Format("Entering Speed : {0:f1} msec", _enteringSpeed); - btn1.Show(); - box2.PackEnd(btn1); - Button btn2 = new Button(box2) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - }; - btn2.Text = string.Format("Animator FPS : {0:f1} fps", AnimatorFPS); - btn2.Show(); - box2.PackEnd(btn2); - Button btn3 = new Button(box2) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - }; - btn3.Text = string.Format("Evas FPS : {0:f1} fps", FrameFPS); - btn3.Show(); - box2.PackEnd(btn3); - box2.SetAlignment(-1, -1); - box2.SetWeight(1, 0.07); - } - - private void List_RenderPost(object sender, EventArgs e) - { - list.RenderPost -= List_RenderPost; - _enteringSpeed = (EcoreAnimator.GetCurrentTime() - _enteringSpeed) * 1000; - - _frameSet = Elementary.BringInScrollFriction; - Elementary.BringInScrollFriction = TimeSet; - list.ScrollTo(ItemTarget, ScrollToPosition.In, true); - } - - private void List_ScrollAnimationStarted(object sender, EventArgs e) - { - _ecoreCount = 0; - _anim = EcoreAnimator.AddAnimator(OnEcoreCheck); - list.RenderPost += List_RenderPostFrame; - } - - private bool OnEcoreCheck() - { - _ecoreCount++; - return true; - } - - private void List_RenderPostFrame(object sender, EventArgs e) - { - _frameCount++; - } - - private void List_Changed(object sender, EventArgs e) - { - _enteringSpeed = EcoreAnimator.GetCurrentTime(); - list.Changed -= List_Changed; - list.RenderPost += List_RenderPost; - } - } -} \ No newline at end of file diff --git a/test/ElmSharp.Test/TC/PolygonTest1.cs b/test/ElmSharp.Test/TC/PolygonTest1.cs deleted file mode 100644 index 66223f062..000000000 --- a/test/ElmSharp.Test/TC/PolygonTest1.cs +++ /dev/null @@ -1,65 +0,0 @@ -/* - * 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 ElmSharp; - -namespace ElmSharp.Test -{ - class PolygonTest1 : TestCaseBase - { - public override string TestName => "PolygonTest1"; - public override string TestDescription => "To test basic operation of Polygon"; - - public override void Run(Window window) - { - Background bg = new Background(window); - bg.Color = Color.White; - bg.Move(0, 0); - bg.Resize(window.ScreenSize.Width, window.ScreenSize.Height); - bg.Show(); - - Polygon triangle1 = new Polygon(window); - triangle1.Color = Color.Blue; - triangle1.AddPoint(100, 100); - triangle1.AddPoint(100, 500); - triangle1.AddPoint(500, 500); - triangle1.Show(); - - Polygon triange2 = new Polygon(window); - triange2.AddPoint(300, 300); - triange2.AddPoint(new Point{X=600, Y=300}); - triange2.AddPoint(new Point{X=600, Y=600}); - triange2.Color = Color.Green; - triange2.Show(); - - Polygon hexagon = new Polygon(window); - hexagon.Color = Color.Pink; - hexagon.AddPoint(0, 0); - hexagon.AddPoint(700, 0); - hexagon.ClearPoints(); - for (double a=0; a < 2 * Math.PI; a += Math.PI / 3) - { - hexagon.AddPoint( - 300 + (int)(120 * Math.Sin(a)), - 580 + (int)(120 * Math.Cos(a)) - ); - } - hexagon.Show(); - } - - } -} diff --git a/test/ElmSharp.Test/TC/PopupTest1.cs b/test/ElmSharp.Test/TC/PopupTest1.cs deleted file mode 100644 index 90eda9c47..000000000 --- a/test/ElmSharp.Test/TC/PopupTest1.cs +++ /dev/null @@ -1,99 +0,0 @@ -/* - * 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 ElmSharp; - -namespace ElmSharp.Test -{ - public class PopupTest1 : TestCaseBase - { - public override string TestName => "PopupTest1"; - public override string TestDescription => "To test basic operation of Popup"; - - public override void Run(Window window) - { - Conformant conformant = new Conformant(window); - conformant.Show(); - Box box = new Box(window); - box.Show(); - Button btn = new Button(window) - { - AlignmentX = -1, - WeightX = 1, - Text = "Open" - }; - btn.Show(); - - Popup popup = new Popup(window) - { - Orientation = PopupOrientation.Bottom, - Timeout = 5, - }; - - popup.Dismissed += (s, e) => - { - Console.WriteLine("Popup dismissed"); - }; - - popup.ShowAnimationFinished += (s, e) => - { - Console.WriteLine("Popup show animation finished"); - }; - - popup.OutsideClicked += (s, e) => - { - Console.WriteLine("Popup outside clicked"); - }; - - popup.TimedOut += (s, e) => - { - Console.WriteLine("Popup time out"); - }; - - popup.Append("Label1"); - popup.Append("Label2"); - popup.Append("Label3"); - - popup.BackButtonPressed += (s, e) => - { - Console.WriteLine("!!! BackButtonPressed Event on Popup!!"); - popup.Hide(); - }; - - btn.Clicked += (s, e) => - { - popup.Show(); - }; - - Button close = new Button(popup) - { - AlignmentX = -1, - WeightX = 1, - Text = "Close" - }; - popup.SetPartContent("button1", close); - - close.Clicked += (s, e) => - { - popup.Hide(); - }; - - box.PackEnd(btn); - conformant.SetContent(box); - } - } -} diff --git a/test/ElmSharp.Test/TC/ProgressBarTest1.cs b/test/ElmSharp.Test/TC/ProgressBarTest1.cs deleted file mode 100644 index 04a04cf79..000000000 --- a/test/ElmSharp.Test/TC/ProgressBarTest1.cs +++ /dev/null @@ -1,164 +0,0 @@ -/* - * 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.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace ElmSharp.Test -{ - class ProgressBarTest1 : TestCaseBase - { - public override string TestName => "ProgressBarTest1"; - public override string TestDescription => "To test basic operation of ProgressBar"; - - public override void Run(Window window) - { - Conformant conformant = new Conformant(window); - conformant.Show(); - Table table = new Table(window); - conformant.SetContent(table); - table.Show(); - - ProgressBar pb1 = new ProgressBar(window) - { - Text = "ProgressBar Test", - UnitFormat = "%.0f %%", - Value = 0.1, - AlignmentX = -1, - AlignmentY = 0, - WeightX = 1, - WeightY = 1 - }; - - Label lb1 = new Label(window) - { - AlignmentX = -1, - AlignmentY = 0, - WeightX = 1, - WeightY = 1 - }; - - Label lb2 = new Label(window) - { - AlignmentX = -1, - AlignmentY = 0, - WeightX = 1, - WeightY = 1 - }; - - Button bt1 = new Button(window) - { - Text = "Increase Value", - AlignmentX = -1, - AlignmentY = 0, - WeightX = 1, - WeightY = 1 - }; - - Button bt2 = new Button(window) - { - Text = "Decrease Value", - AlignmentX = -1, - AlignmentY = 0, - WeightX = 1, - WeightY = 1 - }; - - Button bt3 = new Button(window) - { - Text = "Increase PartValue", - AlignmentX = -1, - AlignmentY = 0, - WeightX = 1, - WeightY = 1 - }; - - Button bt4 = new Button(window) - { - Text = "Decrease PartValue", - AlignmentX = -1, - AlignmentY = 0, - WeightX = 1, - WeightY = 1 - }; - - string part = "elm.cur.progressbar"; - double unit = 0.1; - double max = 1.0; - double min = 0; - - pb1.ValueChanged += (s, e) => - { - lb1.Text = string.Format("Value Changed: {0}", pb1.Value); - lb1.EdjeObject["elm.text"].TextStyle = "DEFAULT='color=#ffffff'"; - - lb2.Text = string.Format("PartValue Changed: {0}", pb1.GetPartValue(part)); - lb2.EdjeObject["elm.text"].TextStyle = "DEFAULT='color=#ffffff'"; - }; - - bt1.Clicked += (s, e) => - { - var val = pb1.Value + unit; - if (val <= max) - pb1.Value = val; - }; - - bt2.Clicked += (s, e) => - { - var val = pb1.Value - unit; - if (val >= min) - { - pb1.Value = val; - } - }; - - bt3.Clicked += (s, e) => - { - var val = pb1.GetPartValue(part) + unit; - if (val <= max) - pb1.SetPartValue(part, val); - }; - - bt4.Clicked += (s, e) => - { - var val = pb1.GetPartValue(part) - unit; - if (val >= min) - { - pb1.SetPartValue(part, val); - } - }; - - table.Pack(pb1, 1, 1, 2, 1); - table.Pack(lb1, 1, 2, 2, 1); - table.Pack(lb2, 1, 3, 2, 1); - table.Pack(bt1, 1, 4, 1, 1); - table.Pack(bt2, 1, 5, 1, 1); - table.Pack(bt3, 1, 6, 1, 1); - table.Pack(bt4, 1, 7, 1, 1); - - pb1.Show(); - lb1.Show(); - lb2.Show(); - bt1.Show(); - bt2.Show(); - bt3.Show(); - bt4.Show(); - } - } -} \ No newline at end of file diff --git a/test/ElmSharp.Test/TC/ProgressBarTest2.cs b/test/ElmSharp.Test/TC/ProgressBarTest2.cs deleted file mode 100644 index d85847e09..000000000 --- a/test/ElmSharp.Test/TC/ProgressBarTest2.cs +++ /dev/null @@ -1,106 +0,0 @@ -/* - * 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.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace ElmSharp.Test -{ - class ProgressBarTest2 : TestCaseBase - { - public override string TestName => "ProgressBarTest2"; - public override string TestDescription => "To test basic operation of ProgressBar"; - - public override void Run(Window window) - { - Conformant conformant = new Conformant(window); - conformant.Show(); - Box table = new Box(window) - { - BackgroundColor = Color.White, - }; - conformant.SetContent(table); - table.Show(); - - ProgressBar pb1 = new ProgressBar(window) - { - Text = "ProgressBar Test", - Style = "process_medium", - Value = 0.1, - AlignmentX = 0, - AlignmentY = 0, - WeightX = 0, - WeightY = 1 - }; - pb1.PlayPulse(); - Label lb1 = new Label(window) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - }; - - Button bt1 = new Button(window) - { - Text = "Increase Value", - AlignmentX = -1, - AlignmentY = 0, - WeightX = 1, - WeightY = 1 - }; - - bt1.Clicked += (s, e) => - { - Random rand = new Random(DateTime.UtcNow.Millisecond); - pb1.Color = new Color(rand.Next(255), rand.Next(255), rand.Next(255)); - lb1.Text = pb1.Color.ToString(); - }; - - Button bt2 = new Button(window) - { - Text = "zoom", - AlignmentX = -1, - AlignmentY = 0, - WeightX = 1, - WeightY = 1 - }; - - bt2.Clicked += (s, e) => - { - var map = new EvasMap(4); - var g = pb1.Geometry; - map.PopulatePoints(g, 0); - map.Zoom(2, 2, g.X, g.Y); - pb1.EvasMap = map; - pb1.IsMapEnabled = true; - }; - - table.PackEnd(pb1); - table.PackEnd(lb1); - table.PackEnd(bt1); - table.PackEnd(bt2); - - pb1.Show(); - lb1.Show(); - bt1.Show(); - bt2.Show(); - } - } -} \ No newline at end of file diff --git a/test/ElmSharp.Test/TC/RadioTest1.cs b/test/ElmSharp.Test/TC/RadioTest1.cs deleted file mode 100644 index 0462e7ada..000000000 --- a/test/ElmSharp.Test/TC/RadioTest1.cs +++ /dev/null @@ -1,99 +0,0 @@ -/* - * 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.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace ElmSharp.Test -{ - class RadioTest1 : TestCaseBase - { - public override string TestName => "RadioTest1"; - public override string TestDescription => "To test basic operation of Radio"; - - Label _lb1; - - public override void Run(Window window) - { - Conformant conformant = new Conformant(window); - conformant.Show(); - Box box = new Box(window); - conformant.SetContent(box); - box.Show(); - - Radio rd1 = new Radio(window) - { - StateValue = 1, - Text = "Value #1", - AlignmentX = -1, - AlignmentY = 0, - WeightX = 1, - WeightY = 1 - }; - Radio rd2 = new Radio(window) - { - StateValue = 2, - Text = "Value #2", - AlignmentX = -1, - AlignmentY = 0, - WeightX = 1, - WeightY = 1 - }; - Radio rd3 = new Radio(window) - { - StateValue = 3, - Text = "Value #3", - AlignmentX = -1, - AlignmentY = 0, - WeightX = 1, - WeightY = 1 - }; - rd2.SetGroup(rd1); - rd3.SetGroup(rd2); - - rd1.ValueChanged += OnRadioValueChanged; - rd2.ValueChanged += OnRadioValueChanged; - rd3.ValueChanged += OnRadioValueChanged; - - _lb1 = new Label(window) - { - AlignmentX = -1, - AlignmentY = 0, - WeightX = 1, - WeightY = 1 - }; - - box.PackEnd(_lb1); - box.PackEnd(rd1); - box.PackEnd(rd2); - box.PackEnd(rd3); - - _lb1.Show(); - rd1.Show(); - rd2.Show(); - rd3.Show(); - } - - void OnRadioValueChanged(object sender, EventArgs e) - { - _lb1.Text = string.Format("Value Changed: {0}", ((Radio)sender).GroupValue); - _lb1.EdjeObject["elm.text"].TextStyle = "DEFAULT='color=#ffffff'"; - } - } -} diff --git a/test/ElmSharp.Test/TC/RectangleTest1.cs b/test/ElmSharp.Test/TC/RectangleTest1.cs deleted file mode 100644 index 23e58f5ad..000000000 --- a/test/ElmSharp.Test/TC/RectangleTest1.cs +++ /dev/null @@ -1,45 +0,0 @@ -/* - * 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 ElmSharp; - -namespace ElmSharp.Test -{ - class RectangleTest1 : TestCaseBase - { - public override string TestName => "RectangleTest1"; - public override string TestDescription => "Add one Red Rectangle and one Orange Rectangle"; - - public override void Run(Window window) - { - Rectangle box1 = new Rectangle(window) - { - Color = Color.Red - }; - box1.Show(); - box1.Resize(100, 100); - box1.Move(0, 0); - Rectangle box2 = new Rectangle(window) - { - Color = Color.Orange - }; - box2.Show(); - box2.Resize(100, 100); - box2.Move(100, 100); - } - } -} diff --git a/test/ElmSharp.Test/TC/ScreenInformationTest.cs b/test/ElmSharp.Test/TC/ScreenInformationTest.cs deleted file mode 100644 index 5150454f8..000000000 --- a/test/ElmSharp.Test/TC/ScreenInformationTest.cs +++ /dev/null @@ -1,45 +0,0 @@ -/* - * 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. - */ - -namespace ElmSharp.Test -{ - public class ScreenInformationTest : TestCaseBase - { - public override string TestName => "ScreenInformationTest"; - public override string TestDescription => "To get screen information"; - - public override void Run(Window window) - { - Conformant conformant = new Conformant(window); - conformant.Show(); - Box box = new Box(window); - box.Show(); - conformant.SetContent(box); - Label label = new Label(window); - label.SetAlignment(-1, 0); - label.SetWeight(1, 0); - label.Text = string.Format("ScreenSize : {0}x{1}", window.ScreenSize.Width, window.ScreenSize.Height); - label.Show(); - box.PackEnd(label); - Label label2 = new Label(window); - label2.SetAlignment(-1, 0); - label2.SetWeight(1, 0); - label2.Text = string.Format("ScreenDPI : xdpi : {0} ydpi : {1}", window.ScreenDpi.X, window.ScreenDpi.Y); - label2.Show(); - box.PackEnd(label2); - } - } -} diff --git a/test/ElmSharp.Test/TC/ScrollerTest1.cs b/test/ElmSharp.Test/TC/ScrollerTest1.cs deleted file mode 100644 index 2bfdbba66..000000000 --- a/test/ElmSharp.Test/TC/ScrollerTest1.cs +++ /dev/null @@ -1,80 +0,0 @@ -/* - * 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 ElmSharp; - -namespace ElmSharp.Test -{ - public class ScrollerTest1 : TestCaseBase - { - public override string TestName => "ScrollerTest1"; - public override string TestDescription => "To test basic operation of Scroller"; - - public override void Run(Window window) - { - Conformant conformant = new Conformant(window); - conformant.Show(); - Scroller scroller = new Scroller(window) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - ScrollBlock = ScrollBlock.None, - }; - scroller.Show(); - conformant.SetContent(scroller); - - Box box = new Box(window) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1 - }; - box.Show(); - scroller.SetContent(box); - - var rnd = new Random(); - for (int i = 0; i < 102; i++) - { - int r = rnd.Next(255); - int g = rnd.Next(255); - int b = rnd.Next(255); - Color color = Color.FromRgb(r, g, b); - Rectangle colorBox = new Rectangle(window) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - Color = color, - MinimumHeight = 400, - }; - colorBox.Show(); - Console.WriteLine("Height = {0}", colorBox.Geometry.Height); - box.PackEnd(colorBox); - } - scroller.Scrolled += Scroller_Scrolled; - } - - private void Scroller_Scrolled(object sender, EventArgs e) - { - Console.WriteLine("Scrolled : {0}x{1}", ((Scroller)sender).CurrentRegion.X, ((Scroller)sender).CurrentRegion.Y); - } - } -} diff --git a/test/ElmSharp.Test/TC/ScrollerTest2.cs b/test/ElmSharp.Test/TC/ScrollerTest2.cs deleted file mode 100644 index f246a66a6..000000000 --- a/test/ElmSharp.Test/TC/ScrollerTest2.cs +++ /dev/null @@ -1,126 +0,0 @@ -/* - * 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 ElmSharp; - -namespace ElmSharp.Test -{ - public class ScrollerTest2 : TestCaseBase - { - public override string TestName => "ScrollerTest2"; - public override string TestDescription => "To test basic operation of Scroller"; - - public override void Run(Window window) - { - Conformant conformant = new Conformant(window); - conformant.Show(); - Box outterBox = new Box(window) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - IsHorizontal = false, - }; - outterBox.Show(); - Scroller scroller = new Scroller(window) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - ScrollBlock = ScrollBlock.Vertical, - HorizontalPageScrollLimit = 1, - }; - scroller.SetPageSize(1.0, 1.0); - scroller.Show(); - - Box box = new Box(window) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - IsHorizontal = true, - }; - box.Show(); - scroller.SetContent(box); - - var rnd = new Random(); - for (int i = 0; i < 102; i++) - { - int r = rnd.Next(255); - int g = rnd.Next(255); - int b = rnd.Next(255); - Color color = Color.FromRgb(r, g, b); - Rectangle colorBox = new Rectangle(window) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - Color = color, - MinimumWidth = window.ScreenSize.Width, - }; - colorBox.Show(); - Console.WriteLine("Height = {0}", colorBox.Geometry.Height); - box.PackEnd(colorBox); - } - - conformant.SetContent(outterBox); - outterBox.PackEnd(scroller); - - Button prev = new Button(window) - { - AlignmentX = -1, - WeightX = 1, - Text = "Prev" - }; - Button next = new Button(window) - { - AlignmentX = -1, - WeightX = 1, - Text = "next" - }; - prev.Clicked += (s, e) => - { - scroller.ScrollTo(scroller.HorizontalPageIndex > 0 ? scroller.HorizontalPageIndex - 1: 0, scroller.VerticalPageIndex, true); - }; - next.Clicked += (s, e) => - { - scroller.ScrollTo(scroller.HorizontalPageIndex + 1, scroller.VerticalPageIndex, true); - }; - prev.Show(); - next.Show(); - outterBox.PackEnd(prev); - outterBox.PackEnd(next); - - scroller.DragStart += Scroller_DragStart; - scroller.DragStop += Scroller_DragStop; - } - - private void Scroller_DragStop(object sender, EventArgs e) - { - Console.WriteLine("Drag stop"); - } - - private void Scroller_DragStart(object sender, EventArgs e) - { - Console.WriteLine("Drag start"); - } - } -} diff --git a/test/ElmSharp.Test/TC/ScrollerTest3.cs b/test/ElmSharp.Test/TC/ScrollerTest3.cs deleted file mode 100755 index 90d7015fc..000000000 --- a/test/ElmSharp.Test/TC/ScrollerTest3.cs +++ /dev/null @@ -1,122 +0,0 @@ -/* - * 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 ElmSharp; - -namespace ElmSharp.Test -{ - public class ScrollerTest3 : TestCaseBase - { - public override string TestName => "ScrollerTest3"; - public override string TestDescription => "To test ScrollTo operation of Scroller"; - - public override void Run(Window window) - { - Conformant conformant = new Conformant(window); - conformant.Show(); - Box outterBox = new Box(window) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - IsHorizontal = false, - }; - outterBox.Show(); - Scroller scroller = new Scroller(window) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - ScrollBlock = ScrollBlock.Vertical, - HorizontalPageScrollLimit = 1, - }; - scroller.SetPageSize(1.0, 1.0); - scroller.Show(); - - Box box = new Box(window) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1 - }; - box.Show(); - scroller.SetContent(box); - - for (int i = 0; i < 30; i++) - { - Label addlabel = new Label(window) - { - Text = i + " Label Test", - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - }; - addlabel.Show(); - box.PackEnd(addlabel); - } - - conformant.SetContent(outterBox); - outterBox.PackEnd(scroller); - - Button prev = new Button(window) - { - AlignmentX = -1, - WeightX = 1, - Text = "Prev" - }; - Button next = new Button(window) - { - AlignmentX = -1, - WeightX = 1, - Text = "next" - }; - prev.Clicked += (s, e) => - { - Rect region = new Rect(0, 0, scroller.Geometry.Width, scroller.Geometry.Width); - Console.WriteLine("{0} {1}\n", scroller.Geometry.Width, scroller.Geometry.Width); - scroller.ScrollTo(region, true); - }; - next.Clicked += (s, e) => - { - Rect region = new Rect(0, scroller.Geometry.Height, scroller.Geometry.Width, scroller.Geometry.Height); - Console.WriteLine("{0} {1}\n", scroller.Geometry.Width, scroller.Geometry.Width); - scroller.ScrollTo(region, true); - }; - prev.Show(); - next.Show(); - outterBox.PackEnd(prev); - outterBox.PackEnd(next); - - scroller.DragStart += Scroller_DragStart; - scroller.DragStop += Scroller_DragStop; - } - - private void Scroller_DragStop(object sender, EventArgs e) - { - Console.WriteLine("Drag stop"); - } - - private void Scroller_DragStart(object sender, EventArgs e) - { - Console.WriteLine("Drag start"); - } - } -} diff --git a/test/ElmSharp.Test/TC/ScrollerTest4.cs b/test/ElmSharp.Test/TC/ScrollerTest4.cs deleted file mode 100644 index 235594c0c..000000000 --- a/test/ElmSharp.Test/TC/ScrollerTest4.cs +++ /dev/null @@ -1,148 +0,0 @@ -/* - * 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 ElmSharp; - -namespace ElmSharp.Test -{ - public class ScrollerTest4 : TestCaseBase - { - public override string TestName => "ScrollerTest4"; - public override string TestDescription => "To test basic operation of Scroller"; - - public override void Run(Window window) - { - //Conformant conformant = new Conformant(window); - //conformant.Show(); - Box outterBox = new Box(window) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - IsHorizontal = false, - }; - outterBox.Show(); - - var button = new Button(window) - { - Text = "Button1", - Color = Color.White, - }; - button.Show(); - button.Resize(200, 100); - button.Move(300, 100); - - var button2 = new Button(window) - { - Text = "Button2", - Color = Color.White, - }; - button2.Show(); - button2.Resize(200, 100); - button2.Move(300, 300); - - var button3 = new Button(window) - { - Text = "Button3", - Color = Color.White, - }; - button3.Show(); - button3.Resize(200, 100); - button3.Move(300, 500); - - Scroller scroller = new Scroller(window); - scroller.Show(); - scroller.Resize(200, 400); - scroller.Move(100, 600); - - Box box = new Box(window) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1 - }; - box.Show(); - scroller.SetContent(box); - - var rnd = new Random(); - for (int i = 0; i < 20; i++) - { - int r = rnd.Next(255); - int g = rnd.Next(255); - int b = rnd.Next(255); - Color color = Color.FromRgb(r, g, b); - var colorBox1 = new Label(window) - { - Text = "Label" + i.ToString(), - BackgroundColor = color, - MinimumHeight = 40, - }; - colorBox1.Show(); - box.PackEnd(colorBox1); - } - - Scroller scroller2 = new Scroller(window); - scroller2.Show(); - scroller2.Resize(200, 400); - scroller2.Move(700, 600); - - Box box2 = new Box(window) - { - MinimumWidth = 400, - MinimumHeight = 200, - }; - box2.BackgroundColor = Color.White; - box2.Show(); - scroller2.SetContent(box2); - - rnd = new Random(); - for (int i = 0; i < 20; i++) - { - int r = rnd.Next(255); - int g = rnd.Next(255); - int b = rnd.Next(255); - Color color = Color.FromRgb(r, g, b); - var colorBox2 = new Label(scroller2) - { - BackgroundColor = color, - MinimumHeight = 40, - Text = "GOGOGO" - }; - colorBox2.Show(); - box2.PackEnd(colorBox2); - } - - //conformant.SetContent(outterBox); - //outterBox.PackEnd(button); - //outterBox.PackEnd(button2); - //outterBox.PackEnd(button3); - //outterBox.PackEnd(scroller); - //outterBox.PackEnd(scroller2); - - //outterBox.SetLayoutCallback(() => - //{ - // scroller.Move(100, 800); - // button.Move(300, 100); - // button2.Move(300, 300); - // button3.Move(300, 500); - // scroller2.Move(700, 800); - //}); - } - } -} \ No newline at end of file diff --git a/test/ElmSharp.Test/TC/SliderTest1.cs b/test/ElmSharp.Test/TC/SliderTest1.cs deleted file mode 100644 index 0d0f53a32..000000000 --- a/test/ElmSharp.Test/TC/SliderTest1.cs +++ /dev/null @@ -1,129 +0,0 @@ -/* - * 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.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace ElmSharp.Test -{ - class SliderTest1 : TestCaseBase - { - public override string TestName => "SliderTest1"; - public override string TestDescription => "To test basic operation of Slider"; - - public override void Run(Window window) - { - Conformant conformant = new Conformant(window); - conformant.Show(); - Table table = new Table(window); - conformant.SetContent(table); - table.Show(); - - Slider sld1 = new Slider(window) - { - Text = "Slider Test", - IndicatorFormat = "%1.2f meters", - Minimum = 0.0, - Maximum = 100.0, - Value = 0.1, - AlignmentX = -1, - AlignmentY = 0.5, - WeightX = 1, - WeightY = 1, - IsIndicatorFocusable = true - }; - - Button btn = new Button(window) - { - AlignmentX = -1, - AlignmentY = 0, - WeightX = 1, - WeightY = 1, - Text = "Set IsIndicatorFocusable" - }; - btn.Clicked += (s, e) => - { - if (sld1.IsIndicatorFocusable) - { - sld1.IsIndicatorFocusable = false; - } - else - { - sld1.IsIndicatorFocusable = true; - } - }; - - Button btn2 = new Button(window) - { - AlignmentX = -1, - AlignmentY = 0, - WeightX = 1, - WeightY = 1, - Text = "Set IndicatorVisibleMode" - }; - btn2.Clicked += (s, e) => - { - if (sld1.IndicatorVisibleMode == SliderIndicatorVisibleMode.Default) - { - sld1.IndicatorVisibleMode = SliderIndicatorVisibleMode.Always; - btn2.Text = "Always"; - } - else if (sld1.IndicatorVisibleMode == SliderIndicatorVisibleMode.Always) - { - sld1.IndicatorVisibleMode = SliderIndicatorVisibleMode.OnFocus; - btn2.Text = "OnFocus"; - } - else if (sld1.IndicatorVisibleMode == SliderIndicatorVisibleMode.OnFocus) - { - sld1.IndicatorVisibleMode = SliderIndicatorVisibleMode.None; - btn2.Text = "None"; - } - else - { - sld1.IndicatorVisibleMode = SliderIndicatorVisibleMode.Default; - btn2.Text = "Default"; - } - }; - - Label lb1 = new Label(window) - { - AlignmentX = -1, - AlignmentY = 0, - WeightX = 1, - WeightY = 1 - }; - - table.Pack(sld1, 1, 1, 2, 1); - table.Pack(btn, 1, 2, 2, 1); - table.Pack(btn2, 1, 3, 2, 1); - table.Pack(lb1, 1, 4, 2, 1); - - sld1.Show(); - btn.Show(); - lb1.Show(); - btn2.Show(); - - sld1.ValueChanged += (s, e) => - { - lb1.Text = string.Format("Value Changed: {0}", sld1.Value); - lb1.EdjeObject["elm.text"].TextStyle = "DEFAULT='color=#ffffff'"; - }; - } - } -} \ No newline at end of file diff --git a/test/ElmSharp.Test/TC/SliderTest2.cs b/test/ElmSharp.Test/TC/SliderTest2.cs deleted file mode 100644 index b17ca383d..000000000 --- a/test/ElmSharp.Test/TC/SliderTest2.cs +++ /dev/null @@ -1,124 +0,0 @@ -/* - * 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.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace ElmSharp.Test -{ - class SliderTest2 : TestCaseBase - { - public override string TestName => "SliderTest2"; - public override string TestDescription => "To test basic operation of Slider"; - - public override void Run(Window window) - { - Conformant conformant = new Conformant(window); - conformant.Show(); - Table table = new Table(window); - conformant.SetContent(table); - table.Show(); - - Slider sld = new Slider(window) - { - Text = "Slider Test", - IndicatorFormat = "%1.2f meters", - Minimum = 0.0, - Maximum = 100.0, - Value = 0.1, - AlignmentX = -1, - AlignmentY = 0.5, - WeightX = 1, - WeightY = 1, - IsIndicatorFocusable = true - }; - - Label lb1 = new Label(window) - { - AlignmentX = -1, - AlignmentY = 0, - WeightX = 1, - WeightY = 1, - Text = string.Format("IndicatorVisibleMode={0}", sld.IndicatorVisibleMode.ToString()), - }; - lb1.EdjeObject["elm.text"].TextStyle = "DEFAULT='color=#ffffff'"; - - Label lb2 = new Label(window) - { - AlignmentX = -1, - AlignmentY = 0, - WeightX = 1, - WeightY = 1, - Text = string.Format("IndicatorVisibleMode={0}", sld.IndicatorVisibleMode.ToString()), - }; - lb2.EdjeObject["elm.text"].TextStyle = "DEFAULT='color=#ffffff'"; - - Button btn1 = new Button(window) - { - AlignmentX = -1, - AlignmentY = 0, - WeightX = 1, - WeightY = 1, - Text = "Change IndicatorVisibleMode" - }; - btn1.Clicked += (s, e) => - { - sld.IndicatorVisibleMode = (SliderIndicatorVisibleMode)(((int)sld.IndicatorVisibleMode + 1) % 4); - lb1.Text = string.Format("IndicatorVisibleMode={0}", sld.IndicatorVisibleMode.ToString()); - lb1.EdjeObject["elm.text"].TextStyle = "DEFAULT='color=#ffffff'"; - }; - - Button btn2 = new Button(window) - { - AlignmentX = -1, - AlignmentY = 0, - WeightX = 1, - WeightY = 1, - Text = "Change IsIndicatorVisible" - }; - btn2.Clicked += (s, e) => - { - sld.IsIndicatorVisible = !sld.IsIndicatorVisible; - lb2.Text = string.Format("IsIndicatorVisible={0}", sld.IsIndicatorVisible.ToString()); - lb2.EdjeObject["elm.text"].TextStyle = "DEFAULT='color=#ffffff'"; - }; - - table.Pack(sld, 1, 1, 2, 1); - table.Pack(lb1, 1, 2, 2, 1); - table.Pack(lb2, 1, 3, 2, 1); - table.Pack(btn1, 1, 4, 2, 1); - table.Pack(btn2, 1, 5, 2, 1); - - sld.Show(); - lb1.Show(); - lb2.Show(); - btn1.Show(); - btn2.Show(); - - sld.ValueChanged += (s, e) => - { - lb1.Text = string.Format("IndicatorVisibleMode={0}", sld.IndicatorVisibleMode.ToString()); - lb1.EdjeObject["elm.text"].TextStyle = "DEFAULT='color=#ffffff'"; - - lb2.Text = string.Format("IsIndicatorVisible={0}", sld.IsIndicatorVisible.ToString()); - lb2.EdjeObject["elm.text"].TextStyle = "DEFAULT='color=#ffffff'"; - }; - } - } -} \ No newline at end of file diff --git a/test/ElmSharp.Test/TC/SpinnerTest1.cs b/test/ElmSharp.Test/TC/SpinnerTest1.cs deleted file mode 100644 index 419bfffef..000000000 --- a/test/ElmSharp.Test/TC/SpinnerTest1.cs +++ /dev/null @@ -1,71 +0,0 @@ -/* - * 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 ElmSharp.Test -{ - class SpinnerTest1 : TestCaseBase - { - public override string TestName => "SpinnerTest1"; - public override string TestDescription => "To test basic operation of Spinner"; - - public override void Run(Window window) - { - Conformant conformant = new Conformant(window); - conformant.Show(); - Table table = new Table(window); - conformant.SetContent(table); - table.Show(); - - Spinner spn1 = new Spinner(window) - { - Text = "Slider Test", - LabelFormat = "%1.2f Value", - Minimum = 1, - Maximum = 12, - Value = 1.5, - Step = 0.5, - Interval = 0.5, - AlignmentX = -1, - AlignmentY = 0.5, - WeightX = 1, - WeightY = 1 - }; - spn1.AddSpecialValue(5, "Five !!!!"); - - Label lb1 = new Label(window) - { - AlignmentX = -1, - AlignmentY = 0, - WeightX = 1, - WeightY = 1 - }; - - table.Pack(spn1, 1, 1, 2, 1); - table.Pack(lb1, 1, 2, 2, 1); - - spn1.Show(); - lb1.Show(); - - spn1.ValueChanged += (s, e) => - { - lb1.Text = string.Format("Value Changed: {0}", spn1.Value); - lb1.EdjeObject["elm.text"].TextStyle = "DEFAULT='color=#ffffff'"; - }; - } - } -} diff --git a/test/ElmSharp.Test/TC/TableTest1.cs b/test/ElmSharp.Test/TC/TableTest1.cs deleted file mode 100644 index 24ca0d689..000000000 --- a/test/ElmSharp.Test/TC/TableTest1.cs +++ /dev/null @@ -1,73 +0,0 @@ -/* - * 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 ElmSharp; - -namespace ElmSharp.Test -{ - public class TableTest1 : TestCaseBase - { - public override string TestName => "TableTest1"; - public override string TestDescription => "To test basic operation of Table"; - - public override void Run(Window window) - { - Conformant conformant = new Conformant(window); - conformant.Show(); - Table table = new Table(window) { - PaddingX = 10, - PaddingY = 10 - }; - // table.BackgroundColor = Color.Orange; - conformant.SetContent(table); - table.Show(); - - Button button1 = new Button(window) { - Text = "Button (set Color.Oranage)", - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1 - }; - button1.Clicked += (e,o) => - { - table.BackgroundColor = Color.Orange; - Console.WriteLine("{0} Clicked! - Button's BG Color : {1}, Table's BG Color : {2}", ((Button)e).Text, ((Button)e).BackgroundColor, table.BackgroundColor); - }; - - Button button2 = new Button(window) { - Text = "Button 2 (set Color.Defalut)", - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - BackgroundColor = new Color(50, 100, 200, 75) - }; - button2.Clicked += (e, o) => - { - table.BackgroundColor = Color.Default; - Console.WriteLine("{0} Clicked! - Button's BG Color : {1}, Table's BG Color : {2}", ((Button)e).Text, ((Button)e).BackgroundColor, table.BackgroundColor); - }; - - table.Pack(button1,0,0,3,3); - table.Pack(button2,3,1,1,1); - - button1.Show(); - button2.Show(); - } - } -} diff --git a/test/ElmSharp.Test/TC/ToolbarTest1.cs b/test/ElmSharp.Test/TC/ToolbarTest1.cs deleted file mode 100644 index 5849dfc84..000000000 --- a/test/ElmSharp.Test/TC/ToolbarTest1.cs +++ /dev/null @@ -1,116 +0,0 @@ -/* - * 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 ElmSharp; -using System.Collections.Generic; - -namespace ElmSharp.Test -{ - public class ToolbarTest1 : TestCaseBase - { - Dictionary _itemTable = new Dictionary(); - Dictionary _reverseItemTable = new Dictionary(); - int currentItemIndex = 0; - public override string TestName => "ToolbarTest1"; - public override string TestDescription => "To test basic operation of Toolbar"; - public override void Run(Window window) - { - Conformant conformant = new Conformant(window); - conformant.Show(); - Box outterBox = new Box(window) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - IsHorizontal = false, - }; - outterBox.Show(); - - Toolbar toolbar = new Toolbar(window) - { - AlignmentX = -1, - WeightX = 1, - ShrinkMode = ToolbarShrinkMode.Scroll - }; - - toolbar.Show(); - outterBox.PackEnd(toolbar); - - - Scroller scroller = new Scroller(window) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - ScrollBlock = ScrollBlock.Vertical, - HorizontalPageScrollLimit = 1, - }; - scroller.SetPageSize(1.0, 1.0); - scroller.Show(); - - Box box = new Box(window) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - IsHorizontal = true, - }; - box.Show(); - scroller.SetContent(box); - - var rnd = new Random(); - for (int i = 0; i < 5; i++) - { - int r = rnd.Next(255); - int g = rnd.Next(255); - int b = rnd.Next(255); - Color color = Color.FromRgb(r, g, b); - Rectangle colorBox = new Rectangle(window) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - Color = color, - MinimumWidth = window.ScreenSize.Width, - }; - colorBox.Show(); - box.PackEnd(colorBox); - ToolbarItem item = toolbar.Append(string.Format("{0} Item", i), "home"); - _itemTable[item] = i; - _reverseItemTable[i] = item; - item.Selected += (s, e) => - { - scroller.ScrollTo(_itemTable[(ToolbarItem)s], 0, true); - }; - } - scroller.Scrolled += (s, e) => - { - if (scroller.HorizontalPageIndex != currentItemIndex) - { - currentItemIndex = scroller.HorizontalPageIndex; - _reverseItemTable[currentItemIndex].IsSelected = true; - } - }; - conformant.SetContent(outterBox); - outterBox.PackEnd(scroller); - } - } -} diff --git a/test/ElmSharp.Test/TC/ToolbarTest2.cs b/test/ElmSharp.Test/TC/ToolbarTest2.cs deleted file mode 100644 index 07780fbb0..000000000 --- a/test/ElmSharp.Test/TC/ToolbarTest2.cs +++ /dev/null @@ -1,87 +0,0 @@ -/* - * 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 ElmSharp; -using System.Collections.Generic; - -namespace ElmSharp.Test -{ - public class ToolbarTest2 : TestCaseBase - { - Dictionary _itemTable = new Dictionary(); - Dictionary _reverseItemTable = new Dictionary(); - public override string TestName => "ToolbarTest2"; - public override string TestDescription => "To test basic operation of Toolbar"; - public override void Run(Window window) - { - Conformant conformant = new Conformant(window); - conformant.Show(); - Box outerBox = new Box(window) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - IsHorizontal = false, - BackgroundColor = Color.Aqua, - }; - outerBox.Show(); - - Toolbar toolbar = new Toolbar(window) - { - AlignmentX = -1, - WeightX = 1, - }; - toolbar.Show(); - outerBox.PackEnd(toolbar); - - List items = new List(); - items.Add(toolbar.Append(string.Format("{0} home", items.Count), "home")); - - Button bt = new Button(window) - { - Text = "Add ToolbarItem", - MinimumWidth = 400 - }; - bt.Clicked += (s, e) => - { - items.Add(toolbar.Append(string.Format("{0} home", items.Count), "home")); - }; - - Button removebt = new Button(window) - { - Text = "Remove first ToolbarItem", - MinimumWidth = 400 - }; - removebt.Clicked += (s, e) => - { - foreach (var cur in items) - { - items.Remove(cur); - cur.Delete(); - return; - } - }; - - bt.Show(); - removebt.Show(); - outerBox.PackEnd(bt); - outerBox.PackEnd(removebt); - conformant.SetContent(outerBox); - } - } -} diff --git a/test/ElmSharp.Test/TC/ToolbarTest3.cs b/test/ElmSharp.Test/TC/ToolbarTest3.cs deleted file mode 100644 index 55680880d..000000000 --- a/test/ElmSharp.Test/TC/ToolbarTest3.cs +++ /dev/null @@ -1,83 +0,0 @@ -/* - * 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 ElmSharp; -using System.Collections.Generic; - -namespace ElmSharp.Test -{ - public class ToolbarTest3 : TestCaseBase - { - Dictionary _itemTable = new Dictionary(); - Dictionary _reverseItemTable = new Dictionary(); - public override string TestName => "ToolbarTest3"; - public override string TestDescription => "To test basic operation of Toolbar for changing bg color"; - public override void Run(Window window) - { - Conformant conformant = new Conformant(window); - conformant.Show(); - Box outterBox = new Box(window) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - IsHorizontal = false, - BackgroundColor = Color.Aqua, - }; - outterBox.Show(); - - Toolbar toolbar = new Toolbar(window) - { - AlignmentX = -1, - WeightX = 1, - }; - - var rnd = new Random(); - toolbar.BackgroundColor = Color.FromRgb(rnd.Next(255), rnd.Next(255), rnd.Next(255)); - toolbar.Show(); - outterBox.PackEnd(toolbar); - - toolbar.Selected += (s, e) => - { - e.Item.DeletePartColor("bg"); - }; - - Label lb = new Label(window) - { - Text = "Please, click an item for delete part color", - }; - lb.Show(); - outterBox.PackEnd(lb); - - for (int i = 0; i < 5; i++) - { - ToolbarItem item = toolbar.Append(string.Format("{0} home", i), "home"); - Color bgColor = Color.FromRgb(rnd.Next(255), rnd.Next(255), rnd.Next(255)); - item.SetPartColor("bg", bgColor); - - item.Clicked += (s, e) => - { - lb.Text = (s as ToolbarItem).Text+" clicked"; - }; - } - - - conformant.SetContent(outterBox); - } - } -} diff --git a/test/ElmSharp.Test/TC/ToolbarTest4.cs b/test/ElmSharp.Test/TC/ToolbarTest4.cs deleted file mode 100644 index 268aadf3c..000000000 --- a/test/ElmSharp.Test/TC/ToolbarTest4.cs +++ /dev/null @@ -1,135 +0,0 @@ -/* - * 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 ElmSharp; -using System.Collections.Generic; - -namespace ElmSharp.Test -{ - public class ToolbarTest4 : TestCaseBase - { - public override string TestName => "ToolbarTest4"; - public override string TestDescription => "To test basic operation of Toolbar"; - - public override void Run(Window window) - { - Conformant conformant = new Conformant(window); - conformant.Show(); - Box outterBox = new Box(window) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - IsHorizontal = false, - BackgroundColor = Color.Aqua, - }; - outterBox.Show(); - - Toolbar toolbar = new Toolbar(window) - { - AlignmentX = -1, - WeightX = 1, - ShrinkMode = ToolbarShrinkMode.Scroll, - IconLookupOrder = ToolbarIconLookupOrder.ThemeFreedesktop, - }; - toolbar.Show(); - outterBox.PackEnd(toolbar); - - toolbar.Append("FirstItem", "home"); - toolbar.Append("LastItem", "home"); - ToolbarItem result = toolbar.InsertAfter(toolbar.FirstItem, "Result", ""); - - Button bt1 = new Button(window) - { - Text = "Change IconSize", - MinimumWidth = 400 - }; - bt1.Clicked += (s, e) => - { - if (toolbar.IconSize < 50) - toolbar.IconSize = 100; - else - toolbar.IconSize = 32; - result.Text = string.Format("IconSize{0}", toolbar.IconSize.ToString()); - }; - bt1.Show(); - outterBox.PackEnd(bt1); - - Button bt2 = new Button(window) - { - Text = "Find FirstItem", - MinimumWidth = 400 - }; - bt2.Clicked += (s, e) => - { - ToolbarItem item1 = toolbar.FirstItem; - ToolbarItem item2 = toolbar.FindItemByLabel("FirstItem"); - if (item1 == null || item2 == null || item1 != item2) - result.Text = "FAIL"; - else - result.Text = "PASS"; - }; - bt2.Show(); - outterBox.PackEnd(bt2); - - Button bt3 = new Button(window) - { - Text = "Find LastItem", - MinimumWidth = 400 - }; - bt3.Clicked += (s, e) => - { - ToolbarItem item1 = toolbar.LastItem; - ToolbarItem item2 = toolbar.FindItemByLabel("LastItem"); - if (item1 == null || item2 == null || item1 != item2) - result.Text = "FAIL"; - else - result.Text = "PASS"; - }; - bt3.Show(); - outterBox.PackEnd(bt3); - - Button bt4 = new Button(window) - { - Text = "Get ItemsCount", - MinimumWidth = 400 - }; - bt4.Clicked += (s, e) => - { - result.Text = toolbar.ItemsCount.ToString(); - }; - bt4.Show(); - outterBox.PackEnd(bt4); - - Button bt5 = new Button(window) - { - Text = "Change IconLookupOrder", - MinimumWidth = 400 - }; - bt5.Clicked += (s, e) => - { - toolbar.IconLookupOrder = (ToolbarIconLookupOrder)(((int)toolbar.IconLookupOrder + 1) % 4); - result.Text = toolbar.IconLookupOrder.ToString(); - }; - bt5.Show(); - outterBox.PackEnd(bt5); - - conformant.SetContent(outterBox); - } - } -} diff --git a/test/ElmSharp.Test/TC/TooltipTest1.cs b/test/ElmSharp.Test/TC/TooltipTest1.cs deleted file mode 100755 index 8c2636405..000000000 --- a/test/ElmSharp.Test/TC/TooltipTest1.cs +++ /dev/null @@ -1,106 +0,0 @@ -/* - * 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 ElmSharp; - -namespace ElmSharp.Test -{ - class TooltipTest1 : TestCaseBase - { - public override string TestName => "TooltipTest1"; - public override string TestDescription => "To test basic operation of Tooltip"; - - void SetButtonEventHandler(Button button) - { - button.Clicked += (s, e) => - { - Console.WriteLine("{0} Clicked! : {1}", button.Text, button.BackgroundColor); - Console.WriteLine("{0} Clicked! : {1}", button.Text, button.ClassName); - Console.WriteLine("{0} Clicked! : {1}", button.Text, button.ClassName.ToLower()); - Console.WriteLine("{0} Clicked! : {1}", button.Text, button.ClassName.ToLower().Replace("elm_", "")); - Console.WriteLine("{0} Clicked! : {1}", button.Text, button.ClassName.ToLower().Replace("elm_", "") + "/" + "bg"); - - Console.WriteLine("Tooltip's Orientation {0}", button.TooltipOrientation); - Console.WriteLine("Tooltip's Window mode {0}", button.TooltipWindowMode); - Console.WriteLine("Tooltip's Style {0}", button.TooltipStyle); - }; - - button.Pressed += (s, e) => - { - Console.WriteLine("{0} Pressed!", button.Text); - }; - - button.Released += (s, e) => - { - Console.WriteLine("{0} Released!", button.Text); - }; - - button.Repeated += (s, e) => - { - Console.WriteLine("{0} Repeated!", button.Text); - }; - - button.Show(); - } - - public override void Run(Window window) - { - Button button1 = new Button(window) { - Text = "Basic operation of Tooltip", - }; - button1.SetPartColor("bg", Color.Red); - button1.Resize(600, 100); - button1.Move(0, 0); - button1.SetTooltipText("Tooltip Tes1"); - SetButtonEventHandler(button1); - - Button button2 = new Button(window) { - Text = "Orientation of Tooltip", - BackgroundColor = Color.Pink, - }; - button2.Resize(600, 100); - button2.Move(0, 200); - button2.SetTooltipText("Tooltip Test2"); - button2.TooltipOrientation = TooltipOrientation.Bottom; - button2.Text = button2.TooltipOrientation.ToString(); - SetButtonEventHandler(button2); - - Button button3 = new Button(window) { - Text = "Style of Tooltip", - BackgroundColor = Color.Purple - }; - button3.SetTooltipText("Tooltip Test3"); - button3.TooltipStyle = "transparent"; - button3.Text = button3.TooltipStyle; - button3.Resize(600, 100); - button3.Move(0, 400); - SetButtonEventHandler(button3); - - Button button4 = new Button(window) { - Text = "Window mode of Tooltip", - BackgroundColor = Color.Green - }; - button4.SetTooltipText("Tooltip Test4"); - button4.TooltipWindowMode = true; - button4.Text = button4.TooltipWindowMode.ToString(); - button4.Resize(600, 100); - button4.Move(0, 600); - SetButtonEventHandler(button4); - } - - } -} diff --git a/test/ElmSharp.Test/TC/TransitTest.cs b/test/ElmSharp.Test/TC/TransitTest.cs deleted file mode 100644 index 6bab1e2d3..000000000 --- a/test/ElmSharp.Test/TC/TransitTest.cs +++ /dev/null @@ -1,89 +0,0 @@ -/* - * 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 ElmSharp; - -namespace ElmSharp.Test -{ - class TransitTest : TestCaseBase - { - public override string TestName => "TransitTest"; - public override string TestDescription => "To test basic operation of Transit"; - - Transit CreateTransit() - { - Transit transit = new Transit(); - transit.Deleted += (s, e) => { Console.WriteLine("Transit Deleted"); }; - transit.Repeat = 1; - transit.AutoReverse = true; - transit.Duration = 1; - return transit; - } - - public override void Run(Window window) - { - Button button1 = new Button(window) { - Text = "Effect", - }; - button1.Move(0, 0); - button1.Resize(270, 200); - button1.Show(); - - Button button2 = new Button(window) - { - Text = "Chain Effect", - }; - button2.Move(270, 200); - button2.Resize(270, 200); - button2.Show(); - - Point begin = new Point(); - begin.X = begin.Y = 0; - Point end = new Point(); - end.X = end.Y = 200; - TranslationEffect translation = new TranslationEffect(begin, end); - translation.EffectEnded += (s, e) => { Console.WriteLine("Translation Effect Ended"); }; - - RotationEffect rotation = new RotationEffect(0, 180); - rotation.EffectEnded += (s, e) => { Console.WriteLine("Rotation Effect Ended"); }; - - button1.Clicked += (s, e) => { - Transit transit1 = CreateTransit(); - transit1.Objects.Add(button1); - transit1.Objects.Add(button2); - transit1.AddEffect(translation); - transit1.AddEffect(rotation); - transit1.Go(); - }; - - button2.Clicked += (s, e) => { - Transit transit1 = CreateTransit(); - transit1.Objects.Add(button1); - transit1.AddEffect(translation); - transit1.AddEffect(rotation); - - Transit transit2 = CreateTransit(); - transit2.Objects.Add(button2); - transit2.AddEffect(translation); - transit2.AddEffect(rotation); - - transit1.Chains.Add(transit2); - transit1.Go(); - }; - } - } -} \ No newline at end of file diff --git a/test/ElmSharp.Test/TC/Wearable/BackgroundColorTest1.cs b/test/ElmSharp.Test/TC/Wearable/BackgroundColorTest1.cs deleted file mode 100644 index 0903c6e89..000000000 --- a/test/ElmSharp.Test/TC/Wearable/BackgroundColorTest1.cs +++ /dev/null @@ -1,54 +0,0 @@ -/* - * 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.Collections.Generic; -using System.Text; - -namespace ElmSharp.Test.Wearable -{ - class BackgroundColorTest : WearableTestCase - { - public override string TestName => "BackgroundColorTest1"; - public override string TestDescription => "To test basic operation of Widget's background Color"; - - Color[] _colors = new Color[] { - Color.Red, - new Color(125,200,255, 150), - new Color(125, 200, 255, 10), - Color.Default - }; - - public override void Run(Window window) - { - Rect square = window.GetInnerSquare(); - - Button colorButton = new Button(window); - colorButton.Geometry = square; - Log.Debug(colorButton.Geometry.ToString()); - colorButton.Text = colorButton.BackgroundColor.ToString(); - colorButton.Show(); - - int colorIndex = 0; - colorButton.Clicked += (s, e) => - { - colorButton.BackgroundColor = _colors[colorIndex++]; - colorButton.Text = colorButton.BackgroundColor.ToString(); - if (colorIndex == _colors.Length) colorIndex = 0; - }; - } - } -} diff --git a/test/ElmSharp.Test/TC/Wearable/BackgroundTest1.cs b/test/ElmSharp.Test/TC/Wearable/BackgroundTest1.cs deleted file mode 100644 index 7f25d34d4..000000000 --- a/test/ElmSharp.Test/TC/Wearable/BackgroundTest1.cs +++ /dev/null @@ -1,60 +0,0 @@ -/* - * 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.Collections.Generic; -using System.Text; - -namespace ElmSharp.Test.Wearable -{ - class BackgroundTest1 : WearableTestCase - - { - public override string TestName => "BackgroundTest1"; - public override string TestDescription => "To test basic operation of Background"; - - public override void Run(Window window) - { - Rect square = window.GetInnerSquare(); - - Background bg1 = new Background(window) - { - Color = Color.Orange, - Geometry = new Rect(square.X, square.Y, square.Width / 2, square.Height / 2) - }; - - Background bg2 = new Background(window) - { - Color = new Color(60, 128, 255, 100), - Geometry = new Rect(square.X, square.Y + square.Height / 2, square.Width / 2, square.Height / 2) - }; - - Background bg3 = new Background(window) - { - File = "/home/owner/apps_rw/ElmSharpTest/res/picture.png", - BackgroundOption = BackgroundOptions.Center, - BackgroundColor = Color.Gray, - Geometry = new Rect(square.X + square.Width/2, square.Y, square.Width / 2, square.Height) - }; - - bg3.SetFileLoadSize(square.Width/2, square.Height); - - bg1.Show(); - bg2.Show(); - bg3.Show(); - } - } -} diff --git a/test/ElmSharp.Test/TC/Wearable/BackgroundTest2.cs b/test/ElmSharp.Test/TC/Wearable/BackgroundTest2.cs deleted file mode 100644 index 5520cad6a..000000000 --- a/test/ElmSharp.Test/TC/Wearable/BackgroundTest2.cs +++ /dev/null @@ -1,107 +0,0 @@ -/* - * 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.Collections.Generic; -using System.Text; - -namespace ElmSharp.Test.Wearable -{ - class BackgroundTest2 : WearableTestCase - { - public override string TestName => "BackgroundTest2"; - public override string TestDescription => "To test basic operation of Background"; - - public override void Run(Window window) - { - Rect square = window.GetInnerSquare(); - - Conformant conformant = new Conformant(window); - conformant.Show(); - - Box box = new Box(window) - { - Geometry = square - }; - box.Show(); - Background bg = new Background(window) - { - AlignmentY = -1, - AlignmentX = -1, - WeightX = 1, - WeightY = 1, - }; - bg.Show(); - box.PackEnd(bg); - Slider red = new Slider(window) - { - Minimum = 0, - Maximum = 255, - Text = "Red", - AlignmentX = -1, - WeightX = 1 - }; - Slider green = new Slider(window) - { - Minimum = 0, - Maximum = 255, - Text = "Green", - AlignmentX = -1, - WeightX = 1 - }; - Slider blue = new Slider(window) - { - Minimum = 0, - Maximum = 255, - Text = "Blue", - AlignmentX = -1, - WeightX = 1 - }; - Slider alpha = new Slider(window) - { - Minimum = 0, - Maximum = 255, - Text = "Alpha", - AlignmentX = -1, - WeightX = 1 - }; - red.Show(); - green.Show(); - blue.Show(); - alpha.Show(); - box.PackEnd(red); - box.PackEnd(green); - box.PackEnd(blue); - box.PackEnd(alpha); - red.Value = 255; - green.Value = 255; - blue.Value = 255; - alpha.Value = 255; - - bg.Color = new Color(255, 255, 255, 255); - - EventHandler handler = (s, e) => - { - bg.Color = new Color((int)red.Value, (int)green.Value, (int)blue.Value, (int)alpha.Value); - }; - - red.ValueChanged += handler; - green.ValueChanged += handler; - blue.ValueChanged += handler; - alpha.ValueChanged += handler; - } - } -} diff --git a/test/ElmSharp.Test/TC/Wearable/BoxLayoutTest1.cs b/test/ElmSharp.Test/TC/Wearable/BoxLayoutTest1.cs deleted file mode 100644 index 8fbab67e5..000000000 --- a/test/ElmSharp.Test/TC/Wearable/BoxLayoutTest1.cs +++ /dev/null @@ -1,120 +0,0 @@ -/* - * 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.Collections.Generic; -using System.Linq; -using System.Text; - -namespace ElmSharp.Test.Wearable -{ - // under construct - class BoxLayoutTest1 : WearableTestCase - { - public override string TestName => "BoxLayoutTest1"; - public override string TestDescription => "Box Layout callback test"; - - Naviframe _navi; - int _sequence = 0; - Rect _square; - - public override void Run(Window window) - { - _square = window.GetInnerSquare(); - - Conformant conformant = new Conformant(window); - conformant.Show(); - - Naviframe navi = new Naviframe(window) - { - PreserveContentOnPop = true, - DefaultBackButtonEnabled = true - }; - _navi = navi; - - navi.Popped += (s, e) => - { - Console.WriteLine("----- Naviframe was popped {0:x} ", (int)(IntPtr)e.Content); - }; - - navi.Push(CreatePage(window)); - navi.Show(); - //navi.Geometry = _square; - conformant.SetContent(navi); - } - - EvasObject CreatePage(Window parent) - { - Box box = new Box(parent); - box.Show(); - box.BackgroundColor = Color.Gray; - - Label label = new Label(parent) - { - Text = string.Format("{0} Page", _sequence++), - WeightX = 1, - AlignmentX = -1, - }; - Button push = new Button(parent) - { - Text = "Push", - WeightX = 1, - AlignmentX = -1, - }; - Button pop = new Button(parent) - { - Text = "pop", - WeightX = 1, - AlignmentX = -1, - }; - - label.Show(); - push.Show(); - pop.Show(); - - push.Clicked += (s, e) => - { - _navi.Push(CreatePage(parent)); - }; - - pop.Clicked += (s, e) => - { - var item = _navi.NavigationStack.LastOrDefault(); - int nativePointer = (int)(IntPtr)(item.Content); - Console.WriteLine("----- Before Call _navi.Pop() {0:x} ", nativePointer); - _navi.Pop(); - Console.WriteLine("----- After Call _navi.Pop() {0:x} ", nativePointer); - }; - - push.Resize(_square.Width, _square.Height / 6); - pop.Resize(_square.Width, _square.Height / 6); - label.Resize(_square.Width, _square.Height / 6); - box.SetLayoutCallback(() => - { - Console.WriteLine("Layout callback with : {0}", _square); - var rect = box.Geometry; - label.Move(_square.X, rect.Y); - push.Move(_square.X, rect.Y + _square.Height / 6 + 5); - pop.Move(_square.X, rect.Y + _square.Height / 3 + 10); - }); - - box.PackEnd(label); - box.PackEnd(push); - box.PackEnd(pop); - return box; - } - } -} diff --git a/test/ElmSharp.Test/TC/Wearable/ButtonTest1.cs b/test/ElmSharp.Test/TC/Wearable/ButtonTest1.cs deleted file mode 100644 index d1addb8d6..000000000 --- a/test/ElmSharp.Test/TC/Wearable/ButtonTest1.cs +++ /dev/null @@ -1,99 +0,0 @@ -/* - * 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.Collections.Generic; -using System.Text; - -namespace ElmSharp.Test.Wearable -{ - class ButtonTest1 : WearableTestCase - { - public override string TestName => "ButtonTest1"; - public override string TestDescription => "To test basic operation of Button"; - - void SetButtonEventHandler(Button button) - { - button.Clicked += (s, e) => - { - Log.Debug($"{button.Text} Clicked! : {button.BackgroundColor}"); - Log.Debug($"{button.Text} Clicked! : {button.ClassName}"); - Log.Debug($"{button.Text} Clicked! : {button.ClassName.ToLower()}"); - Log.Debug($"{button.Text} Clicked! : {button.ClassName.ToLower().Replace("elm_", "")}"); - Log.Debug($"{button.Text} Clicked! : {button.ClassName.ToLower().Replace("elm_", "") + "/" + "bg"}"); - }; - - button.Pressed += (s, e) => - { - Log.Debug("{button.Text} Pressed!"); - }; - - button.Released += (s, e) => - { - Log.Debug("{button.Text} Released!"); - }; - - button.Repeated += (s, e) => - { - Log.Debug("{button.Text} Repeated!"); - }; - - button.Show(); - } - - public override void Run(Window window) - { - Rect square = window.GetInnerSquare(); - Log.Debug(square.ToString()); - - Button button1 = new Button(window) - { - Text = "Button 1", - }; - button1.SetPartColor("bg", Color.Red); - SetButtonEventHandler(button1); - button1.Resize(square.Width, square.Height/4); - button1.Move(square.X, square.Y); - - Button button2 = new Button(window) - { - Text = "Button 2", - BackgroundColor = Color.Red, - }; - SetButtonEventHandler(button2); - button2.Resize(square.Width, square.Height / 4); - button2.Move(square.X, square.Y + square.Height / 4); - - Button button3 = new Button(window) - { - Text = "Button 3", - BackgroundColor = new Color(125, 200, 255, 150) - }; - SetButtonEventHandler(button3); - button3.Resize(square.Width, square.Height / 4); - button3.Move(square.X, square.Y + square.Height / 2); - - Button button4 = new Button(window) - { - Text = "Button 4", - BackgroundColor = new Color(125, 200, 255, 10) - }; - SetButtonEventHandler(button4); - button4.Resize(square.Width, square.Height / 4); - button4.Move(square.X, square.Y + square.Height * 3 / 4); - } - } -} diff --git a/test/ElmSharp.Test/TC/Wearable/ButtonTest2.cs b/test/ElmSharp.Test/TC/Wearable/ButtonTest2.cs deleted file mode 100644 index 11c68bc92..000000000 --- a/test/ElmSharp.Test/TC/Wearable/ButtonTest2.cs +++ /dev/null @@ -1,59 +0,0 @@ -/* - * 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.Collections.Generic; -using System.Text; - -namespace ElmSharp.Test.Wearable -{ - class ButtonTest2 : WearableTestCase - { - public override string TestName => "ButtonTest2"; - public override string TestDescription => "To Test Wearable Circular Buttons"; - - public override void Run(Window window) - { - Background bg = new Background(window); - bg.Color = Color.Black; - bg.Show(); - - Button btn_bottom = new Button(window) - { - Style = "bottom", - Text = "Down", - Geometry = new Rect((window.ScreenSize.Width - 360) / 2, (window.ScreenSize.Height - 100), 360, 100) - }; - btn_bottom.Show(); - - Button btn_left = new Button(window) - { - Style = "popup/circle/left", - Text = "Left", - Geometry = new Rect(0, 0, 64, 360) - }; - btn_left.Show(); - - Button btn_right = new Button(window) - { - Style = "popup/circle/right", - Text = "Right", - Geometry = new Rect(window.ScreenSize.Width - 64, 0, 64, 360) - }; - btn_right.Show(); - } - } -} diff --git a/test/ElmSharp.Test/TC/Wearable/CheckTest1.cs b/test/ElmSharp.Test/TC/Wearable/CheckTest1.cs deleted file mode 100644 index 3dce19954..000000000 --- a/test/ElmSharp.Test/TC/Wearable/CheckTest1.cs +++ /dev/null @@ -1,92 +0,0 @@ -/* - * 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.Collections.Generic; -using System.Text; - -namespace ElmSharp.Test.Wearable -{ - class CheckTest1 : WearableTestCase - { - public override string TestName => "CheckTest1"; - public override string TestDescription => "To test basic operation of Check"; - - public override void Run(Window window) - { - Rect square = window.GetInnerSquare(); - - Background bg = new Background(window); - bg.Color = Color.Black; - bg.Geometry = square; - bg.Show(); - - Check check = new Check(window) - { - Text = "This is Check", - Style = "default" - }; - - Check onoff = new Check(window) - { - Text = "On or Off", - Style = "on&off" - }; - - Label label1 = new Label(window); - Label label2 = new Label(window); - Label label3 = new Label(window); - Label label4 = new Label(window); - - EventHandler update = (s, e) => - { - Check c = s as Check; - label1.Text = string.Format("IsChecked ={0}", c.IsChecked); - label2.Text = string.Format("Style={0}", c.Style); - if (e != null) - { - label3.Text = string.Format("OldState={0}", e.OldState); - label4.Text = string.Format("NewState={0}", e.NewState); - } - }; - - check.StateChanged += (s, e) => update(s, e); - - onoff.StateChanged += (s, e) => update(s, e); - - Rect pieces = square; - pieces.Height /= 5; - - label1.Geometry = new Rect(pieces.X, pieces.Y, pieces.Width, pieces.Height); - label1.Show(); - - label2.Geometry = new Rect(pieces.X, pieces.Y + pieces.Height, pieces.Width, pieces.Height); - label2.Show(); - - label3.Geometry = new Rect(pieces.X, pieces.Y + pieces.Height * 2, pieces.Width, pieces.Height); - label3.Show(); - - label4.Geometry = new Rect(pieces.X, pieces.Y + pieces.Height * 3, pieces.Width, pieces.Height); - label4.Show(); - - check.Geometry = new Rect(pieces.X, pieces.Y + pieces.Height * 4, pieces.Width/2, pieces.Height); - check.Show(); - - onoff.Geometry = new Rect(pieces.X + pieces.Width/2, pieces.Y + pieces.Height * 4, pieces.Width / 2, pieces.Height); - onoff.Show(); - } - } -} diff --git a/test/ElmSharp.Test/TC/Wearable/CircleTool.cs b/test/ElmSharp.Test/TC/Wearable/CircleTool.cs deleted file mode 100644 index 11e371ff5..000000000 --- a/test/ElmSharp.Test/TC/Wearable/CircleTool.cs +++ /dev/null @@ -1,37 +0,0 @@ -/* - * 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.Collections.Generic; -using System.Text; - -namespace ElmSharp.Test.Wearable -{ - public static class CircleTool - { - static Rect _inSquare; - public static Rect GetInnerSquare(this Window window) - { - Size screenSize = window.ScreenSize; - int min = Math.Min(screenSize.Height, screenSize.Width); - int width = (int)(min * Math.Cos(Math.PI / 4)); - int x = screenSize.Width / 2 - width / 2; - int y = screenSize.Height / 2 - width / 2; - - return _inSquare == default(Rect) ? (_inSquare = new Rect(x, y, width, width)) : _inSquare; - } - } -} diff --git a/test/ElmSharp.Test/TC/Wearable/ClipperTest1.cs b/test/ElmSharp.Test/TC/Wearable/ClipperTest1.cs deleted file mode 100644 index 5a44d79ba..000000000 --- a/test/ElmSharp.Test/TC/Wearable/ClipperTest1.cs +++ /dev/null @@ -1,92 +0,0 @@ -/* - * 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.Collections.Generic; -using System.Text; - -namespace ElmSharp.Test.Wearable -{ - class ClipperTest1 : WearableTestCase - { - public override string TestName => "ClipperTest1"; - public override string TestDescription => "ClipperTest1 test"; - - public override void Run(Window window) - { - Rect square = window.GetInnerSquare(); - - Conformant conformant = new Conformant(window); - conformant.Show(); - - Naviframe navi = new Naviframe(window) - { - PreserveContentOnPop = true, - DefaultBackButtonEnabled = true - }; - - Scroller scroller = new Scroller(window) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - ScrollBlock = ScrollBlock.None, - }; - scroller.Show(); - Box container = new Box(window); - scroller.SetContent(container); - - var rect1 = new Rectangle(window) - { - AlignmentX = -1, - WeightX = 1, - Color = Color.Blue, - MinimumHeight = square.Height / 3 - }; - rect1.Show(); - - var clipper = new Rectangle(window); - clipper.Color = new Color(200, 200, 200, 200); - clipper.Geometry = rect1.Geometry; - rect1.Moved += (s, e) => - { - clipper.Geometry = ((Rectangle)s).Geometry; - }; - rect1.SetClip(clipper); - clipper.Show(); - container.PackEnd(rect1); - - Color[] colors = { Color.Red, Color.Olive, Color.Green, Color.Gray, Color.Lime, Color.Maroon }; - for (int i = 0; i < 6; i++) - { - var rect = new Rectangle(window) - { - AlignmentX = -1, - WeightX = 1, - Color = colors[i], - MinimumHeight = square.Height / 3 - }; - rect.Show(); - container.PackEnd(rect); - } - - navi.Push(scroller, "Scroll Page"); - navi.Show(); - conformant.SetContent(navi); - } - } -} diff --git a/test/ElmSharp.Test/TC/Wearable/ContextPopupTest1.cs b/test/ElmSharp.Test/TC/Wearable/ContextPopupTest1.cs deleted file mode 100644 index 5badc7c85..000000000 --- a/test/ElmSharp.Test/TC/Wearable/ContextPopupTest1.cs +++ /dev/null @@ -1,81 +0,0 @@ -/* - * 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.Collections.Generic; -using System.Text; - -namespace ElmSharp.Test.Wearable -{ - class ContextPopupTest1 : WearableTestCase - { - public override string TestName => "ContextPopupTest1"; - public override string TestDescription => "To test basic operation of ContextPopup"; - private int _count = 0; - public override void Run(Window window) - { - Rect square = window.GetInnerSquare(); - - Background bg = new Background(window); - bg.Color = Color.Olive; - bg.Move(0, 0); - bg.Resize(window.ScreenSize.Width, window.ScreenSize.Height); - bg.Show(); - - ContextPopup ctxPopup = new ContextPopup(bg) - { - IsHorizontal = false, - AutoHide = false, - }; - - for (int i = 0; i < 5; i++) - { - ctxPopup.Append(string.Format("{0} item", _count++)); - } - - ctxPopup.Dismissed += (e, o) => { - Console.WriteLine("Dismissed"); - }; - ctxPopup.Geometry = new Rect(square.X, square.Y, square.Width / 4, square.Height); - ctxPopup.Show(); - - bool ctxPopupVisible = true; - string dismissCaption = "Dismiss ContextPopup!"; - string showCaption = "Show ContextPopup!"; - - Button button = new Button(window) - { - Text = dismissCaption - }; - button.Clicked += (E, o) => - { - if (ctxPopupVisible) - { - ctxPopup.Dismiss(); - } - else - { - ctxPopup.Show(); - } - ctxPopupVisible = !ctxPopupVisible; - button.Text = ctxPopupVisible ? dismissCaption : showCaption; - }; - - button.Geometry = new Rect(square.X + square.Width/2, square.Y, square.Width / 2, square.Height); - button.Show(); - } - } -} diff --git a/test/ElmSharp.Test/TC/Wearable/DateTimeSelectorTest1.cs b/test/ElmSharp.Test/TC/Wearable/DateTimeSelectorTest1.cs deleted file mode 100644 index 60cc932ab..000000000 --- a/test/ElmSharp.Test/TC/Wearable/DateTimeSelectorTest1.cs +++ /dev/null @@ -1,82 +0,0 @@ -/* - * 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.Collections.Generic; -using System.Text; - -namespace ElmSharp.Test.Wearable -{ - class DateTimeSelectorTest1 : WearableTestCase - { - public override string TestName => "DateTimeSelectorTest1"; - public override string TestDescription => "To test basic operation of DateTimeSelector"; - - public override void Run(Window window) - { - Conformant conformant = new Conformant(window); - conformant.Show(); - - Background bg = new Background(window); - bg.Color = Color.Black; - bg.Show(); - conformant.SetContent(bg); - - DateTimeSelector dateTime = new DateTimeSelector(window) - { - MinimumDateTime = new DateTime(2015, 1, 1), - MaximumDateTime = DateTime.Now, - DateTime = DateTime.Now - }; - - dateTime.Geometry = new Rect(0, 0, window.ScreenSize.Width, window.ScreenSize.Height); - dateTime.Show(); - - dateTime.DateTimeChanged += (object sender, DateChangedEventArgs e) => - { - Log.Debug($"Old DateTime={e.OldDate}"); - Log.Debug($"New DateTime={e.NewDate}"); - Log.Debug($"Current DateTime={dateTime.DateTime}"); - }; - - Button btn_left = new Button(window) - { - Style = "popup/circle/left", - Text = "Left", - Geometry = new Rect(0, 0, 64, 360) - }; - btn_left.Show(); - - Button btn_right = new Button(window) - { - Style = "popup/circle/right", - Text = "Right", - Geometry = new Rect(window.ScreenSize.Width - 64, 0, 64, 360) - }; - btn_right.Show(); - - btn_left.Clicked += (s, e) => - { - dateTime.DateTime -= new TimeSpan(1, 0, 0, 0, 0); - }; - - btn_right.Clicked += (s, e) => - { - dateTime.DateTime += new TimeSpan(1, 0, 0, 0, 0); - }; - } - } -} diff --git a/test/ElmSharp.Test/TC/Wearable/DateTimeSelectorTest2.cs b/test/ElmSharp.Test/TC/Wearable/DateTimeSelectorTest2.cs deleted file mode 100644 index 9b3ca95b6..000000000 --- a/test/ElmSharp.Test/TC/Wearable/DateTimeSelectorTest2.cs +++ /dev/null @@ -1,56 +0,0 @@ -/* - * 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.Collections.Generic; -using System.Text; - -namespace ElmSharp.Test.Wearable -{ - class DateTimeSelectorTest2 : WearableTestCase - { - public override string TestName => "DateTimeSelectorTest2"; - public override string TestDescription => "To test basic operation of DateTimeSelector"; - - public override void Run(Window window) - { - Conformant conformant = new Conformant(window); - conformant.Show(); - - Background bg = new Background(window); - bg.Color = Color.Black; - bg.Show(); - conformant.SetContent(bg); - - DateTimeSelector dateTime = new DateTimeSelector(window) - { - DateTime = DateTime.Today, - Style = "time_layout", - Format = "%I:%M %p" - }; - - dateTime.Geometry = new Rect(0, 0, window.ScreenSize.Width, window.ScreenSize.Height); - dateTime.Show(); - - dateTime.DateTimeChanged += (object sender, DateChangedEventArgs e) => - { - Log.Debug($"Old DateTime={e.OldDate}"); - Log.Debug($"New DateTime={e.NewDate}"); - Log.Debug($"Current DateTime={dateTime.DateTime}"); - }; - } - } -} diff --git a/test/ElmSharp.Test/TC/Wearable/EcoreTimelineAnimatorTest1.cs b/test/ElmSharp.Test/TC/Wearable/EcoreTimelineAnimatorTest1.cs deleted file mode 100644 index 16e023f14..000000000 --- a/test/ElmSharp.Test/TC/Wearable/EcoreTimelineAnimatorTest1.cs +++ /dev/null @@ -1,87 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using ElmSharp; - -namespace ElmSharp.Test.Wearable -{ - class EcoreTimelineAnimatorTest1 : WearableTestCase - - { - public override string TestName => "Timeline Animator Test1"; - - public override string TestDescription => "Ecore Timeline Animator Test1"; - - EcoreTimelineAnimator timelineAnimator; - - int X1, Y1, X2, Y2; - - Tuple[] mappers = - { - new Tuple("Linear", new LinearMotionMapper()), - new Tuple("Accelerate", new AccelerateMotionMapper()), - new Tuple("Decelerate", new DecelerateMotionMapper()), - new Tuple("Sinusoida", new SinusoidalMotionMapper()), - new Tuple("Bounce", new BounceMotionMapper{ Bounces = 3, DecayFactor = 1.8 }), - new Tuple("Spring", new SpringMotionMapper{ Wobbles = 3, DecayFactor = 1.8 }), - new Tuple("AccelerateFactor", new AccelerateFactorMotionMapper{ PowerFactor = 1.5 }), - new Tuple("DecelerateFactor", new DecelerateFactorMotionMapper{ PowerFactor = 1.5 }), - new Tuple("SinusoidaFactor", new SinusoidalFactorMotionMapper{ PowerFactor = 1.5 }), - new Tuple("DivisorInterpolate", new DivisorInterpolatedMotionMapper{ Divisor = 1.0, Power = 2.0 }), - new Tuple("CubicBezier", new CubicBezierMotionMapper{ X1 = 0, X2 = 1, Y1 = 0, Y2 = 1}) - }; - - int map_index = 0; - - Rectangle square; - - public override void Run(Window window) - { - Rect rect = window.GetInnerSquare(); - - X1 = rect.X; - Y1 = rect.Y; - X2 = rect.X + rect.Width - rect.Width / 10; - Y2 = rect.Y; - - square = new Rectangle(window) - { - Geometry = new Rect(X1, Y1, rect.Width / 10, rect.Height / 6), - Color = Color.Red - }; - square.Show(); - - Button btn = new Button(window) - { - Geometry = new Rect(rect.X, rect.Y + rect.Height - rect.Height / 4, rect.Width, rect.Height / 4), - Text = mappers[map_index].Item1 - }; - btn.Show(); - - timelineAnimator = new EcoreTimelineAnimator(1.0, OnTimeline); - - btn.Clicked += Btn_Clicked; - timelineAnimator.Finished += (s, e) => - { - map_index = (map_index + 1) % mappers.Length; - btn.IsEnabled = true; - }; - } - - private void Btn_Clicked(object sender, EventArgs e) - { - timelineAnimator.Start(); - ((Button)sender).IsEnabled = false; - Log.Debug(mappers[map_index].Item1); - } - - void OnTimeline() - { - double o = mappers[map_index].Item2.Caculate(timelineAnimator.Position); - int x = (int)((X2 * o) + (X1 * (1.0 - o))); - int y = (int)((Y2 * o) + (Y1 * (1.0 - o))); - - square.Move(x, y); - } - } -} diff --git a/test/ElmSharp.Test/TC/Wearable/EcoreTimerTest1.cs b/test/ElmSharp.Test/TC/Wearable/EcoreTimerTest1.cs deleted file mode 100644 index 03118dbaa..000000000 --- a/test/ElmSharp.Test/TC/Wearable/EcoreTimerTest1.cs +++ /dev/null @@ -1,86 +0,0 @@ -/* - * 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 ElmSharp.Test.Wearable -{ - class EcoreTimerTest1 : WearableTestCase - { - public override string TestName => "EcoreTimerTest1"; - public override string TestDescription => "To timer operation of EcoreMainLoop"; - - public override void Run(Window window) - { - var square = window.GetInnerSquare(); - - Background bg = new Background(window) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - Color = Color.Gray - }; - bg.Show(); - window.AddResizeObject(bg); - - Conformant conformant = new Conformant(window); - conformant.Show(); - - - int number = 0; - bool bReturn = true; - Label label1 = new Label(window); - label1.Geometry = new Rect(square.X, square.Y, square.Width, square.Height / 2); - - Button btnTimerSwitch = new Button(window); - btnTimerSwitch.Text = "Timer : On"; - btnTimerSwitch.Geometry = new Rect(square.X, square.Y + square.Height / 2, square.Width, square.Height / 2); - - Func handler = () => - { - label1.Text = (++number).ToString(); - label1.EdjeObject["elm.text"].TextStyle = "DEFAULT='color=#000000 font_size=64 align=left valign=bottom wrap=word'"; - return bReturn; - }; - IntPtr prevId = EcoreMainloop.AddTimer(1.0, handler); - btnTimerSwitch.Clicked += (s, e) => - { - if (bReturn) - { - bReturn = false; - btnTimerSwitch.Text = "Timer : Off"; - } - else - { - bReturn = true; - btnTimerSwitch.Text = "Timer : On"; - EcoreMainloop.RemoveTimer(prevId); - prevId = EcoreMainloop.AddTimer(1.0, handler); - } - }; - - window.BackButtonPressed += (s, e) => - { - EcoreMainloop.RemoveTimer(prevId); - }; - - label1.Show(); - btnTimerSwitch.Show(); - } - } -} diff --git a/test/ElmSharp.Test/TC/Wearable/EntryTest1.cs b/test/ElmSharp.Test/TC/Wearable/EntryTest1.cs deleted file mode 100644 index c2342c3da..000000000 --- a/test/ElmSharp.Test/TC/Wearable/EntryTest1.cs +++ /dev/null @@ -1,90 +0,0 @@ -/* - * 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 ElmSharp; - -namespace ElmSharp.Test.Wearable -{ - class EntryTest1 : WearableTestCase - { - public override string TestName => "EntryTest1"; - public override string TestDescription => "To test basic operation of Entry"; - - public override void Run(Window window) - { - var square = window.GetInnerSquare(); - - Background bg = new Background(window) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - Color = Color.Black - }; - bg.Show(); - window.AddResizeObject(bg); - - Conformant conformant = new Conformant(window); - conformant.Show(); - Box box = new Box(window); - //conformant.SetContent(box); - box.Show(); - box.Geometry = square; - - Entry entry1 = new Entry(window) - { - AlignmentX = -1, - AlignmentY = 0, - WeightX = 1, - WeightY = 1, - IsSingleLine = true, - }; - entry1.SetPartText("guide", "Single Line"); - - Entry entry2 = new Entry(window) - { - AlignmentX = -1, - AlignmentY = 0, - WeightX = 1, - WeightY = 1, - IsPassword = true - }; - entry2.SetPartText("guide", "Password"); - - Entry entry3 = new Entry(window) - { - AlignmentX = -1, - AlignmentY = 0, - WeightX = 1, - WeightY = 1, - IsSingleLine = true, - Scrollable = true, - }; - entry3.SetPartText("guide", "Enter a System.Double"); - entry3.Show(); - - box.PackEnd(entry1); - box.PackEnd(entry2); - box.PackEnd(entry3); - - entry1.Show(); - entry2.Show(); - entry3.Show(); - } - } -} diff --git a/test/ElmSharp.Test/TC/Wearable/EntryTest2.cs b/test/ElmSharp.Test/TC/Wearable/EntryTest2.cs deleted file mode 100644 index 9e990b413..000000000 --- a/test/ElmSharp.Test/TC/Wearable/EntryTest2.cs +++ /dev/null @@ -1,111 +0,0 @@ -/* - * 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 ElmSharp; - -namespace ElmSharp.Test.Wearable -{ - class EntryTest2 : WearableTestCase - { - public override string TestName => "EntryTest2"; - public override string TestDescription => "To test basic operation of Entry"; - - public override void Run(Window window) - { - Background bg = new Background(window) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - Color = Color.Black - }; - bg.Show(); - window.AddResizeObject(bg); - - Conformant conformant = new Conformant(window); - conformant.Show(); - Box box = new Box(window); - box.Geometry = window.GetInnerSquare(); - box.Show(); - - var capital1 = new Entry(window) - { - AlignmentX = -1, - AlignmentY = 0, - WeightX = 1, - WeightY = 1, - Text = " Word", - AutoCapital = AutoCapital.Word - }; - - var capital2 = new Entry(window) - { - AlignmentX = -1, - AlignmentY = 0, - WeightX = 1, - WeightY = 1, - Text = "Sentence", - AutoCapital = AutoCapital.Sentence - }; - - var capital3 = new Entry(window) - { - AlignmentX = -1, - AlignmentY = 0, - WeightX = 1, - WeightY = 1, - Text = "All", - AutoCapital = AutoCapital.All - }; - - var getText = new Entry(window) - { - AlignmentX = -1, - AlignmentY = 0, - WeightX = 1, - WeightY = 1, - Text = "get cursor content test", - }; - - var label = new Label(window) - { - AlignmentX = -1, - AlignmentY = 0, - WeightX = 1, - WeightY = 1, - }; - - getText.CursorChanged += (s, e) => - { - label.Text = getText.GetCursorContent(); - }; - - box.PackEnd(capital1); - box.PackEnd(capital2); - box.PackEnd(capital3); - box.PackEnd(getText); - box.PackEnd(label); - - capital1.Show(); - capital2.Show(); - capital3.Show(); - getText.Show(); - label.Show(); - } - } -} \ No newline at end of file diff --git a/test/ElmSharp.Test/TC/Wearable/EntryTest3.cs b/test/ElmSharp.Test/TC/Wearable/EntryTest3.cs deleted file mode 100644 index 431585ecf..000000000 --- a/test/ElmSharp.Test/TC/Wearable/EntryTest3.cs +++ /dev/null @@ -1,80 +0,0 @@ -/* - * 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 ElmSharp; - -namespace ElmSharp.Test.Wearable -{ - class EntryTest3 : WearableTestCase - { - public override string TestName => "EntryTest3"; - public override string TestDescription => "To test basic operation of Entry"; - - public override void Run(Window window) - { - Background bg = new Background(window) { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - Color = Color.Black - }; - bg.Show(); - window.AddResizeObject(bg); - - Conformant conformant = new Conformant(window); - conformant.Show(); - Box box = new Box(window); - box.Geometry = window.GetInnerSquare(); - box.Show(); - - Check check = new Check(window) { - AlignmentX = -1, - AlignmentY = 0.9, - WeightX = 1, - WeightY = 0.1, - Text = "Select All", - }; - check.Show(); - - Entry entry = new Entry(window) { - AlignmentX = -1, - AlignmentY = 0.1, - WeightX = 1, - WeightY = 1, - IsSingleLine = true, - Text = "Hello, Tizen !!!" - }; - entry.Show(); - - check.StateChanged += (object sender, CheckStateChangedEventArgs e) => - { - if (e.NewState == true) - { - entry.SelectAll(); - } - else - { - entry.SelectNone(); - } - }; - - box.PackEnd(check); - box.PackEnd(entry); - } - } -} diff --git a/test/ElmSharp.Test/TC/Wearable/EntryTest4.cs b/test/ElmSharp.Test/TC/Wearable/EntryTest4.cs deleted file mode 100644 index 850c76b67..000000000 --- a/test/ElmSharp.Test/TC/Wearable/EntryTest4.cs +++ /dev/null @@ -1,102 +0,0 @@ -/* - * 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 ElmSharp; - -namespace ElmSharp.Test.Wearable -{ - class EntryTest4 : WearableTestCase - { - public override string TestName => "EntryTest4"; - public override string TestDescription => "To test basic operation of Entry"; - - public override void Run(Window window) - { - Background bg = new Background(window) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - Color = Color.Black - }; - bg.Show(); - window.AddResizeObject(bg); - - Conformant conformant = new Conformant(window); - conformant.Show(); - Box box = new Box(window); - box.Geometry = window.GetInnerSquare(); - box.Show(); - - Entry entry = new Entry(window) - { - AlignmentX = -1, - AlignmentY = 1, - WeightX = 1, - WeightY = 1, - IsSingleLine = true, - Text = "Hello, Tizen" - }; - - var btn = new Button(window) - { - AlignmentX = -1, - AlignmentY = 1, - WeightX = 1, - WeightY = 1, - Text = "Set Filter" - }; - btn.Show(); - - //var filter = new Entry.TextFilter(SetFilter); - btn.Clicked += (s, e) => - { - entry.AppendMarkUpFilter(SetFilter); - }; - - var btn1 = new Button(window) - { - AlignmentX = -1, - AlignmentY = 1, - WeightX = 1, - WeightY = 1, - Text = "Remove Filter" - }; - btn1.Show(); - btn1.Clicked += (s, e) => - { - entry.RemoveMarkUpFilter(SetFilter); - }; - - //entry.AppendMarkUpFilter(new Entry.Filter(SetFilter)); - - entry.Show(); - box.PackEnd(entry); - box.PackEnd(btn); - box.PackEnd(btn1); - } - - public string SetFilter(Entry entry, string text) - { - if (text.Equals("a") || text.Equals("b") || text.Equals("c") || text.Equals("d")) - return text; - else - return "Tizen"; - } - } -} \ No newline at end of file diff --git a/test/ElmSharp.Test/TC/Wearable/EvasMapTest1.cs b/test/ElmSharp.Test/TC/Wearable/EvasMapTest1.cs deleted file mode 100644 index dac34571e..000000000 --- a/test/ElmSharp.Test/TC/Wearable/EvasMapTest1.cs +++ /dev/null @@ -1,109 +0,0 @@ -/* - * 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 ElmSharp; - -namespace ElmSharp.Test.Wearable -{ - class EvasMapTest1 : WearableTestCase - { - public override string TestName => "EvasMapTest1"; - public override string TestDescription => "Test EvasMap on different levels of hierarchy"; - - public override void Run(Window window) - { - var square = window.GetInnerSquare(); - - var box = new Box(window) - { - Geometry = new Rect(square.X, square.Y, square.Width, square.Height / 2), - BackgroundColor = Color.Gray - }; - box.Show(); - - var text = new Label(box) - { - Text = "Target", - AlignmentX = -1.0, - AlignmentY = -1.0, - WeightX = 1.0, - WeightY = 1.0, - }; - text.Show(); - - box.PackEnd(text); - - double angle = 0.0; - - var reset = new Button(box) - { - Text = "Reset", - Geometry = new Rect(square.X, square.Y + square.Height / 2, square.Width, square.Height / 6) - }; - reset.Show(); - - double zx = 1.0; - double zy = 1.0; - reset.Clicked += (object sender, EventArgs e) => - { - text.IsMapEnabled = false; - angle = 0.0; - zx = 1.0; - zy = 1.0; - }; - - var zoom = new Button(box) - { - Text = "Zoom Target", - Geometry = new Rect(square.X, square.Y + square.Height / 2 + square.Height / 6, square.Width, square.Height / 6) - }; - zoom.Show(); - - zoom.Clicked += (object sender, EventArgs e) => - { - zx += 0.1; - zy += 0.1; - var map = new EvasMap(4); - var g = text.Geometry; - map.PopulatePoints(g, 0); - map.Rotate3D(0, 0, angle, g.X + g.Width / 2, g.Y + g.Height / 2, 0); - map.Zoom(zx, zy, g.X, g.Y); - text.EvasMap = map; - text.IsMapEnabled = true; - }; - - var rotate = new Button(box) - { - Text = "Rotate Target", - Geometry = new Rect(square.X, square.Y + square.Height / 2 + square.Height * 2 / 6, square.Width, square.Height / 6) - }; - rotate.Show(); - - rotate.Clicked += (object sender, EventArgs e) => - { - angle += 5.0; - var map = new EvasMap(4); - var g = text.Geometry; - map.PopulatePoints(g, 0); - map.Rotate3D(0, 0, angle, g.X + g.Width / 2, g.Y + g.Height / 2, 0); - map.Zoom(zx, zy, g.X, g.Y); - text.EvasMap = map; - text.IsMapEnabled = true; - }; - } - } -} \ No newline at end of file diff --git a/test/ElmSharp.Test/TC/Wearable/EvasMapTest2.cs b/test/ElmSharp.Test/TC/Wearable/EvasMapTest2.cs deleted file mode 100644 index d662f0ef4..000000000 --- a/test/ElmSharp.Test/TC/Wearable/EvasMapTest2.cs +++ /dev/null @@ -1,138 +0,0 @@ -/* - * 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 ElmSharp; - -namespace ElmSharp.Test.Wearable -{ - class EvasMapTest2 : WearableTestCase - { - public override string TestName => "EvasMapTest2"; - public override string TestDescription => "Test EvasMap on different levels of hierarchy"; - - public override void Run(Window window) - { - var square = window.GetInnerSquare(); - var box = new Box(window) - { - Geometry = new Rect(square.X, square.Y, square.Width, square.Height / 2), - BackgroundColor = Color.Gray - }; - box.Show(); - - var group = new Box(box) - { - IsHorizontal = true, - BackgroundColor = Color.White, - }; - group.Show(); - - var x = new Label(group) - { - Text = "X", - }; - x.Show(); - - var y = new Label(group) - { - Text = "Y", - }; - y.Show(); - - var z = new Label(group) - { - Text = "Z", - }; - z.Show(); - group.PackEnd(x); - group.PackEnd(y); - group.PackEnd(z); - - var top = new Rectangle(box) - { - Color = Color.Red, - }; - top.SetAlignment(-1.0, -1.0); // fill - top.SetWeight(1.0, 1.0); // expand - top.Show(); - - var bottom = new Rectangle(box) - { - Color = Color.Green, - }; - bottom.SetAlignment(-1.0, -1.0); // fill - bottom.SetWeight(1.0, 1.0); // expand - bottom.Show(); - - double angle = 0.0; - - var reset = new Button(box) - { - Text = "Reset", - Geometry = new Rect(square.X, square.Y + square.Height / 2, square.Width, square.Height / 6) - }; - reset.Show(); - - reset.Clicked += (object sender, EventArgs e) => - { - group.IsMapEnabled = false; - x.IsMapEnabled = false; - angle = 0.0; - }; - - var zoom = new Button(box) - { - Text = "Zoom group", - Geometry = new Rect(square.X, square.Y + square.Height / 2 + square.Height / 6, square.Width, square.Height / 6) - }; - zoom.Show(); - - zoom.Clicked += (object sender, EventArgs e) => - { - var map = new EvasMap(4); - var g = group.Geometry; - map.PopulatePoints(g, 0); - map.Zoom(3.0, 3.0, g.X + g.Width / 2, g.Y + g.Height / 2); - group.EvasMap = map; - group.IsMapEnabled = true; - }; - - var rotate = new Button(box) - { - Text = "Rotate X", - Geometry = new Rect(square.X, square.Y + square.Height / 2 + square.Height * 2 / 6, square.Width, square.Height / 6) - }; - rotate.Show(); - - rotate.Clicked += (object sender, EventArgs e) => - { - angle += 5.0; - - var map = new EvasMap(4); - var g = x.Geometry; - map.PopulatePoints(g, 0); - map.Rotate3D(0, 0, angle, g.X + g.Width / 2, g.Y + g.Height / 2, 0); - x.EvasMap = map; - x.IsMapEnabled = true; - }; - - box.PackEnd(top); - box.PackEnd(group); - box.PackEnd(bottom); - } - } -} \ No newline at end of file diff --git a/test/ElmSharp.Test/TC/Wearable/FocusTest1.cs b/test/ElmSharp.Test/TC/Wearable/FocusTest1.cs deleted file mode 100644 index 8db74119d..000000000 --- a/test/ElmSharp.Test/TC/Wearable/FocusTest1.cs +++ /dev/null @@ -1,128 +0,0 @@ -/* - * 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 ElmSharp.Test.Wearable -{ - public class FocusTest1 : WearableTestCase - { - public override string TestName => "FocusTest1"; - public override string TestDescription => "To test basic operation of Focus"; - - string[] btn_names = new string[] { "a", "b", "c", "d", "e", "f", "g", "h", "i" }; - string previous; - - Button current; - - public override void Run(Window window) - { - var square = window.GetInnerSquare(); - - Button[] btns = new Button[9]; - - Size btnSize = new Size(square.Width / 3 - 2, square.Height / 4 - 2); - for (int i=0; i<3; i++) - { - for (int j=0; j<3; j++) - { - btns[i*3+j] = new Button(window) { Text = btn_names[i * 3 + j] }; - int x = i * btnSize.Width + i * 2; - int y = j * btnSize.Height + j*2; - btns[i*3+j].Geometry = new Rect(square.X + x, square.Y + y, btnSize.Width, btnSize.Height); - - btns[i * 3 + j].Focused += Button_Focused; - btns[i * 3 + j].Unfocused += Button_Unfocused; - btns[i * 3 + j].Show(); - } - } - - for (int i = 0; i < 3; i++) - { - for (int j=0; j<3; j++) - { - if (j > 0) - { - btns[i * 3 + j].SetNextFocusObject(btns[i * 3 + (j - 1)], FocusDirection.Up); - } - if (i > 0) - { - btns[i * 3 + j].SetNextFocusObject(btns[(i - 1) * 3 + j], FocusDirection.Left); - } - if (j < 2) - { - btns[i * 3 + j].SetNextFocusObject(btns[i * 3 + (j + 1)], FocusDirection.Down); - } - if (i < 2) - { - btns[i * 3 + j].SetNextFocusObject(btns[(i + 1) * 3 + j], FocusDirection.Right); - } - } - } - - Size arrowSize = new Size(square.Width / 4, square.Height / 4); - - Button left= new Button(window) { Text = "<", Geometry = new Rect(square.X, square.Y + square.Height * 3 / 4, arrowSize.Width, arrowSize.Height) }; - Button right = new Button(window) { Text = ">", Geometry = new Rect(square.X + arrowSize.Width, square.Y + square.Height * 3 / 4, arrowSize.Width, arrowSize.Height) }; - Button up = new Button(window) { Text = "^", Geometry = new Rect(square.X + arrowSize.Width*2, square.Y + square.Height * 3 / 4, arrowSize.Width, arrowSize.Height) }; - Button down = new Button(window) { Text = "v", Geometry = new Rect(square.X + arrowSize.Width*3, square.Y + square.Height * 3 / 4, arrowSize.Width, arrowSize.Height) }; - - current = btns[0]; - previous = current.Text; - - current.Text = "X"; - - left.Clicked += (s, e) => current.FocusNext(FocusDirection.Left); - right.Clicked += (s, e) => current.FocusNext(FocusDirection.Right); - up.Clicked += (s, e) => current.FocusNext(FocusDirection.Up); - down.Clicked += (s, e) => current.FocusNext(FocusDirection.Down); - - left.AllowFocus(false); - right.AllowFocus(false); - up.AllowFocus(false); - down.AllowFocus(false); - - left.Show(); - right.Show(); - up.Show(); - down.Show(); - } - - void Button_Focused(object sender, EventArgs e) - { - var btn = sender as Button; - if (btn != null) - { - btn.BackgroundColor = Color.Red; - current = btn; - previous = btn.Text; - btn.Text = "X"; - } - } - - void Button_Unfocused(object sender, EventArgs e) - { - var btn = sender as Button; - if (btn != null) - { - btn.BackgroundColor = Color.Default; - current = btn; - btn.Text = previous; - previous = ""; - } - } - } -} diff --git a/test/ElmSharp.Test/TC/Wearable/GenGridTest1.cs b/test/ElmSharp.Test/TC/Wearable/GenGridTest1.cs deleted file mode 100644 index b59b85db7..000000000 --- a/test/ElmSharp.Test/TC/Wearable/GenGridTest1.cs +++ /dev/null @@ -1,92 +0,0 @@ -/* - * 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 ElmSharp; - -namespace ElmSharp.Test.Wearable -{ - public class GenGridTest1 : WearableTestCase - { - public override string TestName => "GenGridTest1"; - public override string TestDescription => "To test basic operation of GenGrid"; - - public override void Run(Window window) - { - Conformant conformant = new Conformant(window); - conformant.Show(); - GenGrid grid = new GenGrid(window) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - ItemAlignmentX = -1, - ItemAlignmentY = -1, - ItemWidth = window.ScreenSize.Width / 3, - ItemHeight = window.ScreenSize.Width / 3, - HorizontalScrollBarVisiblePolicy = ScrollBarVisiblePolicy.Invisible, - VerticalScrollBarVisiblePolicy = ScrollBarVisiblePolicy.Invisible - }; - - GenItemClass defaultClass = new GenItemClass("default") - { - GetTextHandler = (obj, part) => - { - Color item = (Color)obj; - return String.Format("#{0:X}{1:X}{2:X}", item.R, item.G, item.B); - }, - GetContentHandler = (obj, part) => - { - Color item = (Color)obj; - Console.WriteLine("{0} part create requested", part); - if (part == "elm.swallow.icon") - { - var colorbox = new Rectangle(window) - { - Color = item - }; - return colorbox; - } - return null; - } - }; - - var rnd = new Random(); - for (int i = 0; i < 10; i++) - { - int r = rnd.Next(255); - int g = rnd.Next(255); - int b = rnd.Next(255); - Color color = Color.FromRgb(r, g, b); - var griditem = grid.Append(defaultClass, color); - griditem.SetTooltipText("AAAAAA"); - //griditem.TooltipStyle = "transparent"; - - griditem.TooltipContentDelegate = () => { return new Button(window); }; - - } - - grid.Show(); - grid.Geometry = window.GetInnerSquare(); - } - - private void List_ItemSelected(object sender, GenListItemEventArgs e) - { - Console.WriteLine("{0} Item was selected", (string)(e.Item.Data)); - } - } -} \ No newline at end of file diff --git a/test/ElmSharp.Test/TC/Wearable/GenGridTest2.cs b/test/ElmSharp.Test/TC/Wearable/GenGridTest2.cs deleted file mode 100644 index 3d5b5ce7f..000000000 --- a/test/ElmSharp.Test/TC/Wearable/GenGridTest2.cs +++ /dev/null @@ -1,177 +0,0 @@ -/* - * 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 ElmSharp; - -namespace ElmSharp.Test.Wearable -{ - public class GenGridTest2 : WearableTestCase - { - public override string TestName => "GenGridTest2"; - public override string TestDescription => "To test basic operation of GenGrid"; - - public override void Run(Window window) - { - Conformant conformant = new Conformant(window); - conformant.Show(); - GenGrid grid = new GenGrid(window) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - ItemAlignmentX = -1, - ItemAlignmentY = -1, - ItemWidth = window.ScreenSize.Width / 3, - ItemHeight = window.ScreenSize.Width / 3, - }; - - GenItemClass defaultClass = new GenItemClass("default") - { - GetTextHandler = (obj, part) => - { - Color item = (Color)obj; - return String.Format("#{0:X}{1:X}{2:X}", item.R, item.G, item.B); - }, - GetContentHandler = (obj, part) => - { - Color item = (Color)obj; - if (part == "elm.swallow.icon") - { - var colorbox = new Rectangle(window) - { - Color = item - }; - return colorbox; - } - return null; - } - - }; - - GenGridItem firstitem = null; - GenGridItem lastitem = null; - - var rnd = new Random(); - for (int i = 0; i < 102; i++) - { - int r = rnd.Next(255); - int g = rnd.Next(255); - int b = rnd.Next(255); - Color color = Color.FromRgb(r, g, b); - var item = grid.Append(defaultClass, color); - if (i == 0) - firstitem = item; - if (i == 101) - lastitem = item; - } - grid.Show(); - var square = window.GetInnerSquare(); - grid.Geometry = new Rect(square.X, square.Y, square.Width, square.Height * 3/ 4); - - Button first = new Button(window) - { - Text = "First", - BackgroundColor = Color.Red - }; - Button last = new Button(window) - { - Text = "Last", - BackgroundColor = Color.Blue - }; - first.Clicked += (s, e) => - { - grid.ScrollTo(firstitem, ScrollToPosition.In, true); - Log.Debug(first.Text); - }; - last.Clicked += (s, e) => - { - grid.ScrollTo(lastitem, ScrollToPosition.In, true); - Log.Debug(last.Text); - }; - first.Show(); - last.Show(); - - first.Geometry = new Rect(square.X, square.Y + square.Height * 3 / 4, square.Width / 2, square.Height); - last.Geometry = new Rect(square.X + square.Width / 2, square.Y + square.Height * 3 / 4, square.Width / 2, square.Height); - - grid.ItemActivated += Grid_ItemActivated; - grid.ItemSelected += Grid_ItemSelected; - grid.ItemUnselected += Grid_ItemUnselected; - grid.ItemRealized += Grid_ItemRealized; - grid.ItemUnrealized += Grid_ItemUnrealized; - grid.ItemPressed += Grid_ItemPressed; - grid.ItemReleased += Grid_ItemReleased; - grid.ItemLongPressed += Grid_ItemLongPressed; - grid.ItemDoubleClicked += Grid_ItemDoubleClicked; - } - - private void Grid_ItemDoubleClicked(object sender, GenGridItemEventArgs e) - { - Color color = (Color)e.Item.Data; - Log.Debug(string.Format("#{0:X}{1:X}{2:X} is Double clicked", color.R, color.G, color.B)); - } - - private void Grid_ItemLongPressed(object sender, GenGridItemEventArgs e) - { - Color color = (Color)e.Item.Data; - Log.Debug(string.Format("#{0:X}{1:X}{2:X} is LongPressed", color.R, color.G, color.B)); - } - - private void Grid_ItemReleased(object sender, GenGridItemEventArgs e) - { - Color color = (Color)e.Item.Data; - Log.Debug(string.Format("#{0:X}{1:X}{2:X} is Released", color.R, color.G, color.B)); - } - - private void Grid_ItemPressed(object sender, GenGridItemEventArgs e) - { - Color color = (Color)e.Item.Data; - Log.Debug(string.Format("#{0:X}{1:X}{2:X} is Pressed", color.R, color.G, color.B)); - } - - private void Grid_ItemUnselected(object sender, GenGridItemEventArgs e) - { - Color color = (Color)e.Item.Data; - Log.Debug(string.Format("#{0:X}{1:X}{2:X} is Unselected", color.R, color.G, color.B)); - } - - private void Grid_ItemRealized(object sender, GenGridItemEventArgs e) - { - Color color = (Color)e.Item.Data; - Log.Debug(string.Format("#{0:X}{1:X}{2:X} is Realized", color.R, color.G, color.B)); - } - - private void Grid_ItemUnrealized(object sender, GenGridItemEventArgs e) - { - Color color = (Color)e.Item.Data; - Log.Debug(string.Format("#{0:X}{1:X}{2:X} is Unrealized", color.R, color.G, color.B)); - } - - private void Grid_ItemSelected(object sender, GenGridItemEventArgs e) - { - Color color = (Color)e.Item.Data; - Log.Debug(string.Format("#{0:X}{1:X}{2:X} is Selected", color.R, color.G, color.B)); - } - - private void Grid_ItemActivated(object sender, GenGridItemEventArgs e) - { - Color color = (Color)e.Item.Data; - Log.Debug(string.Format("#{0:X}{1:X}{2:X} is Activated", color.R, color.G, color.B)); - } - } -} diff --git a/test/ElmSharp.Test/TC/Wearable/GenListTest1.cs b/test/ElmSharp.Test/TC/Wearable/GenListTest1.cs deleted file mode 100644 index 260fcd4c6..000000000 --- a/test/ElmSharp.Test/TC/Wearable/GenListTest1.cs +++ /dev/null @@ -1,62 +0,0 @@ -/* - * 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 ElmSharp; - -namespace ElmSharp.Test.Wearable -{ - class GenListTest1 : WearableTestCase - { - public override string TestName => "GenListTest1"; - public override string TestDescription => "To test basic operation of GenList"; - - public override void Run(Window window) - { - Conformant conformant = new Conformant(window); - conformant.Show(); - GenList list = new GenList(window) - { - Homogeneous = true, - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1 - }; - - GenItemClass defaultClass = new GenItemClass("default") - { - GetTextHandler = (obj, part) => - { - return string.Format("{0} - {1}", (string)obj, part); - } - }; - - for (int i = 0; i < 100; i++) - { - list.Append(defaultClass, string.Format("{0} Item", i)); - } - list.Show(); - list.ItemSelected += List_ItemSelected; ; - list.Geometry = window.GetInnerSquare(); - } - - private void List_ItemSelected(object sender, GenListItemEventArgs e) - { - Console.WriteLine("{0} Item was selected", (string)(e.Item.Data)); - } - } -} diff --git a/test/ElmSharp.Test/TC/Wearable/GenListTest10.cs b/test/ElmSharp.Test/TC/Wearable/GenListTest10.cs deleted file mode 100644 index 12f3c3f7e..000000000 --- a/test/ElmSharp.Test/TC/Wearable/GenListTest10.cs +++ /dev/null @@ -1,143 +0,0 @@ -/* - * 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.Collections.Generic; -using ElmSharp; - -namespace ElmSharp.Test.Wearable -{ - class GenListTest10 : WearableTestCase - { - public override string TestName => "GenListTest10"; - public override string TestDescription => "To test InsertBefore operation of GenList with full style"; - - public override void Run(Window window) - { - Conformant conformant = new Conformant(window); - conformant.Show(); - - GenList list = new GenList(window) - { - Homogeneous = false, - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1 - }; - - GenItemClass defaultClass = new GenItemClass("full") - { - GetContentHandler = (obj, part) => - { - Console.WriteLine("{0} part create requested", part); - var btn = new Button(window) - { - Text = obj.ToString(), - AlignmentX = -1, - WeightX = 1, - }; - return btn; - } - }; - - GenItemClass headerClass = new GenItemClass("full") - { - GetContentHandler = (obj, part) => - { - Console.WriteLine("{0} part create requested", part); - var btn = new Button(window) - { - Text = obj.ToString(), - AlignmentX = -1, - WeightX = 1, - }; - btn.Show(); - - var label = new Label(window) - { - Text = "GenItem with full style" - }; - label.Show(); - - Box hBox = new Box(window) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - }; - hBox.Show(); - hBox.PackEnd(btn); - hBox.PackEnd(label); - return hBox; - } - - }; - - List itemList = new List(); - GenListItem firstItem = null; - - for (int i = 0; i < 5; i++) - { - GenListItem now = list.Append(defaultClass, string.Format("{0} Item", i)); - itemList.Add(now); - - if (firstItem == null) - { - firstItem = now; - } - } - list.Show(); - list.ItemSelected += List_ItemSelected; - - Button first = new Button(window) - { - Text = "First", - AlignmentX = -1, - WeightX = 1, - }; - Button last = new Button(window) - { - Text = "last", - AlignmentX = -1, - WeightX = 1, - }; - - first.Clicked += (s, e) => - { - firstItem = list.InsertBefore(headerClass, "Header", firstItem); - }; - last.Clicked += (s, e) => - { - list.Append(headerClass, "Footer"); - }; - - first.Show(); - last.Show(); - - var square = window.GetInnerSquare(); - list.Geometry = new Rect(square.X, square.Y, square.Width, square.Height * 3 / 4); - first.Geometry = new Rect(square.X, square.Y + square.Height * 3 / 4, square.Width / 2, square.Height / 4); - last.Geometry = new Rect(square.X + square.Width / 2, square.Y + square.Height * 3 / 4, square.Width / 2, square.Height / 4); - } - - private void List_ItemSelected(object sender, GenListItemEventArgs e) - { - Console.WriteLine("{0} Item was selected", (string)(e.Item.Data)); - } - } -} diff --git a/test/ElmSharp.Test/TC/Wearable/GenListTest2.cs b/test/ElmSharp.Test/TC/Wearable/GenListTest2.cs deleted file mode 100644 index 9ed922989..000000000 --- a/test/ElmSharp.Test/TC/Wearable/GenListTest2.cs +++ /dev/null @@ -1,109 +0,0 @@ -/* - * 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 ElmSharp; -using System.Collections.Generic; - -namespace ElmSharp.Test.Wearable -{ - class GenListTest2 : WearableTestCase - { - public override string TestName => "GenListTest2"; - public override string TestDescription => "To test ScrollTo operation of GenList"; - - public override void Run(Window window) - { - Conformant conformant = new Conformant(window); - conformant.Show(); - - GenList list = new GenList(window) - { - Homogeneous = true, - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1 - }; - - GenItemClass defaultClass = new GenItemClass("default") - { - GetTextHandler = (obj, part) => - { - return string.Format("{0} - {1}", (string)obj, part); - } - }; - - GenListItem[] items = new GenListItem[100]; - int i = 0; - for (i = 0; i < 100; i++) - { - items[i] = list.Append(defaultClass, string.Format("{0} Item", i)); - } - list.Show(); - list.ItemSelected += List_ItemSelected; - - GenListItem scroll = items[0]; - - Button first = new Button(window) - { - Text = "F", - AlignmentX = -1, - WeightX = 1, - }; - Button last = new Button(window) - { - Text = "L", - AlignmentX = -1, - WeightX = 1, - }; - Button add = new Button(window) - { - Text = "A", - AlignmentX = -1, - WeightX = 1, - }; - add.Clicked += (s, e) => - { - scroll = list.InsertBefore(defaultClass, string.Format("{0} Item", i++), scroll); - list.ScrollTo(scroll, ScrollToPosition.In, false); - }; - first.Clicked += (s, e) => - { - list.ScrollTo(scroll, ScrollToPosition.In, true); - }; - last.Clicked += (s, e) => - { - list.ScrollTo(items[99], ScrollToPosition.In, true); - }; - first.Show(); - last.Show(); - add.Show(); - - var square = window.GetInnerSquare(); - - list.Geometry = new Rect(square.X, square.Y, square.Width, square.Height * 3 / 4); - first.Geometry = new Rect(square.X, square.Y + square.Height * 3 / 4, square.Width / 3, square.Height / 4); - last.Geometry = new Rect(square.X + square.Width / 3, square.Y + square.Height * 3 / 4, square.Width / 3, square.Height / 4); - add.Geometry = new Rect(square.X + square.Width * 2 / 3, square.Y + square.Height * 3 / 4, square.Width / 3, square.Height / 4); - } - - private void List_ItemSelected(object sender, GenListItemEventArgs e) - { - Console.WriteLine("{0} Item was selected", (string)(e.Item.Data)); - } - } -} diff --git a/test/ElmSharp.Test/TC/Wearable/GenListTest3.cs b/test/ElmSharp.Test/TC/Wearable/GenListTest3.cs deleted file mode 100644 index debec3dbb..000000000 --- a/test/ElmSharp.Test/TC/Wearable/GenListTest3.cs +++ /dev/null @@ -1,102 +0,0 @@ -/* - * 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 ElmSharp; - -namespace ElmSharp.Test.Wearable -{ - class GenListTest3 : WearableTestCase - { - public override string TestName => "GenListTest3"; - public override string TestDescription => "To test group operation of GenList"; - - public override void Run(Window window) - { - Conformant conformant = new Conformant(window); - conformant.Show(); - GenList list = new GenList(window) - { - Homogeneous = false, - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1 - }; - - GenItemClass groupClass = new GenItemClass("group_index") - { - GetTextHandler = (obj, part) => - { - return string.Format("{0} - {1}", (string)obj, part); - } - }; - - GenListItem[] groups = new GenListItem[10]; - - for (int i = 0; i < 10; i++) - { - groups[i] = list.Append(groupClass, string.Format("{0}", i), GenListItemType.Group); - } - - - GenItemClass defaultClass = new GenItemClass("default") - { - GetTextHandler = (obj, part) => - { - return string.Format("{0} - {1}", (string)obj, part); - }, - GetContentHandler = (obj, part) => - { - Console.WriteLine("{0} - {1}", (string)obj, part); - return null; - } - }; - - GenItemClass fullyCustomizeClass = new GenItemClass("full") - { - GetContentHandler = (obj, part) => - { - Console.WriteLine("{0} part create requested", part); - var btn = new Button(window) - { - Text = "Button in List", - AlignmentX = -1, - WeightX = 1, - }; - return btn; - } - }; - - for (int j = 0; j < 10; j++) - { - for (int i = 0; i < 20; i++) - { - list.Append(j == 0 ? fullyCustomizeClass : defaultClass, string.Format("{0} Item", i), GenListItemType.Normal, groups[j]); - } - } - - list.Show(); - list.ItemSelected += List_ItemSelected; - list.Geometry = window.GetInnerSquare(); - } - - private void List_ItemSelected(object sender, GenListItemEventArgs e) - { - Console.WriteLine("{0} Item was selected", (string)(e.Item.Data)); - } - } -} diff --git a/test/ElmSharp.Test/TC/Wearable/GenListTest4.cs b/test/ElmSharp.Test/TC/Wearable/GenListTest4.cs deleted file mode 100644 index dea63a41f..000000000 --- a/test/ElmSharp.Test/TC/Wearable/GenListTest4.cs +++ /dev/null @@ -1,74 +0,0 @@ -/* - * 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 ElmSharp; - -namespace ElmSharp.Test.Wearable -{ - class GenListTest4 : WearableTestCase - { - public override string TestName => "GenListTest4"; - public override string TestDescription => "To test Append/Prepend/InsertBefore operation of GenList"; - - public override void Run(Window window) - { - Conformant conformant = new Conformant(window); - conformant.Show(); - GenList list = new GenList(window) - { - Homogeneous = true, - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1 - }; - - GenItemClass defaultClass = new GenItemClass("default") - { - GetTextHandler = (obj, part) => - { - return string.Format("{0} - {1}", (string)obj, part); - } - }; - - GenListItem[] items = new GenListItem[100]; - for (int i = 0; i < 100; i++) - { - if (i < 30) - { - items[i] = list.Append(defaultClass, string.Format("{0} Item", i)); - } - else if (i < 60) - { - items[i] = list.Prepend(defaultClass, string.Format("{0} Item", i)); - } - else - { - items[i] = list.InsertBefore(defaultClass, string.Format("{0} Item", i), items[50]); - } - } - list.Show(); - list.ItemSelected += List_ItemSelected; ; - conformant.SetContent(list); - } - - private void List_ItemSelected(object sender, GenListItemEventArgs e) - { - Console.WriteLine("{0} Item was selected", (string)(e.Item.Data)); - } - } -} diff --git a/test/ElmSharp.Test/TC/Wearable/GenListTest5.cs b/test/ElmSharp.Test/TC/Wearable/GenListTest5.cs deleted file mode 100644 index 91bddba64..000000000 --- a/test/ElmSharp.Test/TC/Wearable/GenListTest5.cs +++ /dev/null @@ -1,107 +0,0 @@ -/* - * 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 ElmSharp; - -namespace ElmSharp.Test.Wearable -{ - public class GenListTest5 : WearableTestCase - { - public override string TestName => "GenListTest5"; - public override string TestDescription => "To test event operation of GenList"; - - public override void Run(Window window) - { - Conformant conformant = new Conformant(window); - conformant.Show(); - GenList list = new GenList(window) - { - Homogeneous = true - }; - - GenItemClass defaultClass = new GenItemClass("default") - { - GetTextHandler = (obj, part) => - { - return string.Format("{0} - {1}", (string)obj, part); - } - }; - - for (int i = 0; i < 100; i++) - { - list.Append(defaultClass, string.Format("{0} Item", i)); - } - list.Show(); - list.ItemSelected += List_ItemSelected; ; - list.ItemActivated += List_ItemActivated; - list.ItemUnselected += List_ItemUnselected; - list.ItemPressed += List_ItemPressed; - list.ItemRealized += List_ItemRealized; - list.ItemReleased += List_ItemReleased; - list.ItemUnrealized += List_ItemUnrealized; - list.ItemLongPressed += List_ItemLongPressed; - list.ItemDoubleClicked += List_ItemDoubleClicked; - - list.Geometry = window.GetInnerSquare(); - } - - private void List_ItemDoubleClicked(object sender, GenListItemEventArgs e) - { - Log.Debug(string.Format("{0} Item was double clicked", (string)(e.Item.Data))); - } - - private void List_ItemLongPressed(object sender, GenListItemEventArgs e) - { - Log.Debug(string.Format("{0} Item was Long pressed", (string)(e.Item.Data))); - } - - private void List_ItemUnrealized(object sender, GenListItemEventArgs e) - { - Log.Debug(string.Format("{0} Item was unrealzed", (string)(e.Item.Data))); - } - - private void List_ItemReleased(object sender, GenListItemEventArgs e) - { - Log.Debug(string.Format("{0} Item was released", (string)(e.Item.Data))); - } - - private void List_ItemRealized(object sender, GenListItemEventArgs e) - { - Log.Debug(string.Format("{0} Item was Realized", (string)(e.Item.Data))); - } - - private void List_ItemPressed(object sender, GenListItemEventArgs e) - { - Log.Debug(string.Format("{0} Item was Pressed", (string)(e.Item.Data))); - } - - private void List_ItemUnselected(object sender, GenListItemEventArgs e) - { - Log.Debug(string.Format("{0} Item was unselected", (string)(e.Item.Data))); - } - - private void List_ItemActivated(object sender, GenListItemEventArgs e) - { - Log.Debug(string.Format("{0} Item was Activated", (string)(e.Item.Data))); - } - - private void List_ItemSelected(object sender, GenListItemEventArgs e) - { - Log.Debug(string.Format("{0} Item was selected", (string)(e.Item.Data))); - } - } -} diff --git a/test/ElmSharp.Test/TC/Wearable/GenListTest6.cs b/test/ElmSharp.Test/TC/Wearable/GenListTest6.cs deleted file mode 100644 index d68bea72b..000000000 --- a/test/ElmSharp.Test/TC/Wearable/GenListTest6.cs +++ /dev/null @@ -1,134 +0,0 @@ -/* - * 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 ElmSharp; - -namespace ElmSharp.Test.Wearable -{ - class GenListTest6 : WearableTestCase - { - public override string TestName => "GenListTest6"; - public override string TestDescription => "To test deletion of GenListItem"; - GenListItem selected = null; - - - public override void Run(Window window) - { - Conformant conformant = new Conformant(window); - conformant.Show(); - - GenList list = new GenList(window) - { - Homogeneous = true, - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1 - }; - - GenItemClass defaultClass = new GenItemClass("default") - { - GetTextHandler = (obj, part) => - { - return string.Format("{0} - {1}", (string)obj, part); - }, - DeleteHandler = new GenItemClass.DeleteDelegate((obj) => - { - Log.Debug($"DeleteHandler was called with... {(string)obj}"); - }), - }; - GenListItem[] items = new GenListItem[100]; - for (int i = 0; i < 100; i++) - { - items[i] = list.Append(defaultClass, string.Format("{0} Item", i)); - } - list.Show(); - list.ItemSelected += List_ItemSelected; - list.ItemActivated += List_ItemActivated; - list.ItemUnselected += List_ItemUnselected; - list.ItemPressed += List_ItemPressed; - list.ItemRealized += List_ItemRealized; - list.ItemReleased += List_ItemReleased; - list.ItemUnrealized += List_ItemUnrealized; - list.ItemLongPressed += List_ItemLongPressed; - list.ItemDoubleClicked += List_ItemDoubleClicked; - - var square = window.GetInnerSquare(); - - list.Geometry = new Rect(square.X, square.Y, square.Width, square.Height * 3 / 4); - - Button first = new Button(window) - { - Text = "Delete", - AlignmentX = -1, - WeightX = 1, - }; - first.Clicked += (s, e) => - { - selected?.Delete(); - }; - first.Show(); - first.Geometry = new Rect(square.X, square.Y + square.Height * 3 / 4, square.Width, square.Height / 4); - } - - private void List_ItemSelected(object sender, GenListItemEventArgs e) - { - selected = e.Item; - Console.WriteLine("{0} Item was selected", (string)(e.Item.Data)); - } - private void List_ItemDoubleClicked(object sender, GenListItemEventArgs e) - { - Console.WriteLine("{0} Item was double clicked", (string)(e.Item.Data)); - } - - private void List_ItemLongPressed(object sender, GenListItemEventArgs e) - { - Console.WriteLine("{0} Item was Long pressed", (string)(e.Item.Data)); - } - - private void List_ItemUnrealized(object sender, GenListItemEventArgs e) - { - Console.WriteLine("!!!! Item was Unrealized!!!"); - Console.WriteLine("{0} Item was unrealzed", (string)(e.Item.Data)); - } - - private void List_ItemReleased(object sender, GenListItemEventArgs e) - { - Console.WriteLine("{0} Item was released", (string)(e.Item.Data)); - } - - private void List_ItemRealized(object sender, GenListItemEventArgs e) - { - Console.WriteLine("{0} Item was Realized", (string)(e.Item.Data)); - } - - private void List_ItemPressed(object sender, GenListItemEventArgs e) - { - Console.WriteLine("{0} Item was Pressed", (string)(e.Item.Data)); - } - - private void List_ItemUnselected(object sender, GenListItemEventArgs e) - { - Console.WriteLine("{0} Item was unselected", (string)(e.Item.Data)); - } - - private void List_ItemActivated(object sender, GenListItemEventArgs e) - { - Console.WriteLine("{0} Item was Activated", (string)(e.Item.Data)); - } - } -} diff --git a/test/ElmSharp.Test/TC/Wearable/GenListTest7.cs b/test/ElmSharp.Test/TC/Wearable/GenListTest7.cs deleted file mode 100644 index e0be28328..000000000 --- a/test/ElmSharp.Test/TC/Wearable/GenListTest7.cs +++ /dev/null @@ -1,97 +0,0 @@ -/* - * 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 ElmSharp; -using System.Collections.Generic; - -namespace ElmSharp.Test.Wearable -{ - class GenListTest7 : WearableTestCase - { - public override string TestName => "GenListTest7"; - public override string TestDescription => "To test basic operation of GenList"; - - public override void Run(Window window) - { - Conformant conformant = new Conformant(window); - conformant.Show(); - - GenList list = new GenList(window) - { - Homogeneous = true, - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1 - }; - - Button button = new Button(window) - { - Text = "Remove", - AlignmentX = -1, - AlignmentY = -1, - }; - - GenItemClass defaultClass = new GenItemClass("default") - { - GetTextHandler = (obj, part) => - { - return string.Format("{0} - {1}", (string)obj, part); - } - }; - - GenListItem[] itemArr = new GenListItem[9]; - for (int i = 0; i < 9; i++) - { - itemArr[i] = list.Append(defaultClass, string.Format("{0} Item", i)); - } - - int idx = 0; - button.Clicked += (s, e) => - { - if (idx < 9) - { - Console.WriteLine("GenListItem deleted"); - itemArr[idx++].Delete(); - } - }; - button.Show(); - - list.Show(); - list.ItemSelected += List_ItemSelected; - list.ItemRealized += List_ItemRealized; - list.ItemUnrealized += List_ItemUnrealized; - - var square = window.GetInnerSquare(); - list.Geometry = new Rect(square.X, square.Y, square.Width, square.Height * 3 / 4); - button.Geometry = new Rect(square.X, square.Y + square.Height * 3 / 4, square.Width, square.Height / 4); - } - - private void List_ItemSelected(object sender, GenListItemEventArgs e) - { - Console.WriteLine("{0} Item was selected", (string)(e.Item.Data)); - } - private void List_ItemRealized(object sender, GenListItemEventArgs e) - { - Console.WriteLine("{0} Item was realized", (string)(e.Item.Data)); - } - private void List_ItemUnrealized(object sender, GenListItemEventArgs e) - { - Console.WriteLine("{0} Item was unrealized", (string)(e.Item.Data)); - } - } -} diff --git a/test/ElmSharp.Test/TC/Wearable/GenListTest8.cs b/test/ElmSharp.Test/TC/Wearable/GenListTest8.cs deleted file mode 100644 index 3fe5575a8..000000000 --- a/test/ElmSharp.Test/TC/Wearable/GenListTest8.cs +++ /dev/null @@ -1,105 +0,0 @@ -/* - * 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 ElmSharp; -using System.Collections.Generic; - -namespace ElmSharp.Test.Wearable -{ - class GenListTest8 : WearableTestCase - { - - Dictionary _cacheMap = new Dictionary(); - public override string TestName => "GenListTest8"; - public override string TestDescription => "To test group operation of GenList"; - - public override void Run(Window window) - { - Background bg = new Background(window) - { - Color = Color.Gray, - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1 - }; - bg.Show(); - bg.Lower(); - - window.AddResizeObject(bg); - Conformant conformant = new Conformant(window); - conformant.Show(); - Check check = new Check(window); - check.Show(); - check.IsChecked = true; - check.Text = "Reuse?"; - - GenList list = new GenList(window) - { - Homogeneous = false, - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1 - }; - - GenItemClass fullyCustomizeClass = new GenItemClass("full") - { - GetContentHandler = (obj, part) => - { - Log.Debug(string.Format("{0} part create requested", part)); - var btn = new Button(window) - { - AlignmentX = -1, - WeightX = 1, - Text = (string)obj - }; - return btn; - }, - ReusableContentHandler = (object data, string part, EvasObject old) => - { - Log.Debug(string.Format("{0} part reuse requested", part)); - if (!check.IsChecked) - { - return null; - } - var btn = old as Button; - btn.Text = (string)data; - return old; - } - }; - - for (int i = 0; i < 100; i++) - { - list.Append(fullyCustomizeClass, string.Format("{0} Item", i), GenListItemType.Normal); - } - - list.Show(); - list.ItemSelected += List_ItemSelected; - - var square = window.GetInnerSquare(); - - check.Geometry = new Rect(square.X, square.Y, square.Width, square.Height / 4); - list.Geometry = new Rect(square.X, square.Y + square.Height / 4, square.Width, square.Height * 3 / 4); - } - - private void List_ItemSelected(object sender, GenListItemEventArgs e) - { - Log.Debug(string.Format("{0} Item was selected", (string)(e.Item.Data))); - } - } -} diff --git a/test/ElmSharp.Test/TC/Wearable/GenListTest9.cs b/test/ElmSharp.Test/TC/Wearable/GenListTest9.cs deleted file mode 100644 index 7a038a27f..000000000 --- a/test/ElmSharp.Test/TC/Wearable/GenListTest9.cs +++ /dev/null @@ -1,103 +0,0 @@ -/* - * 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 ElmSharp; -using System.Collections.Generic; - -namespace ElmSharp.Test.Wearable -{ - class GenListTest9 : WearableTestCase - { - - public class ItemContext - { - public object Data; - public GenListItem Item; - public EvasObject Realized; - } - - Dictionary _cacheMap = new Dictionary(); - - Dictionary _realizedMap = new Dictionary(); - public override string TestName => "GenListTest9"; - public override string TestDescription => "To test FieldUpdate operation of GenList"; - - public override void Run(Window window) - { - Background bg = new Background(window) - { - Color = Color.Gray, - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1 - }; - bg.Show(); - bg.Lower(); - - window.AddResizeObject(bg); - Conformant conformant = new Conformant(window); - conformant.Show(); - GenList list = new GenList(window) - { - Homogeneous = false, - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1 - }; - - GenItemClass fullyCustomizeClass = new GenItemClass("full") - { - GetContentHandler = (obj, part) => - { - Log.Debug(string.Format("{0} part create requested", part)); - var btn = new Button(window) - { - AlignmentX = -1, - WeightX = 1, - Text = (string)(obj as ItemContext).Data - }; - btn.MinimumHeight = 100; - (obj as ItemContext).Realized = btn; - (obj as ItemContext).Item?.UpdateField("elm.swallow.content", GenListItemFieldType.None); - return btn; - }, - }; - - for (int i = 0; i < 100; i++) - { - var context = new ItemContext(); - context.Data = string.Format("{0} Item", i); - context.Item = list.Append(fullyCustomizeClass, context, GenListItemType.Normal); - } - - list.Show(); - list.ItemSelected += List_ItemSelected; - - list.Geometry = window.GetInnerSquare(); - } - - private void List_ItemSelected(object sender, GenListItemEventArgs e) - { - var itemContext = e.Item.Data as ItemContext; - Log.Debug(string.Format("{0} Item was selected", (string)(itemContext.Data))); - itemContext.Realized.MinimumHeight += 20; - e.Item.UpdateField("elm.swallow.content", GenListItemFieldType.None); - } - } -} diff --git a/test/ElmSharp.Test/TC/Wearable/GestureLayerTest1.cs b/test/ElmSharp.Test/TC/Wearable/GestureLayerTest1.cs deleted file mode 100644 index 0a02dbee1..000000000 --- a/test/ElmSharp.Test/TC/Wearable/GestureLayerTest1.cs +++ /dev/null @@ -1,91 +0,0 @@ -/* - * 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 ElmSharp; -using System.Collections.Generic; - -namespace ElmSharp.Test.Wearable -{ - class GestureLayerTest1 : WearableTestCase - { - public override string TestName => "GestureLayerTest1"; - public override string TestDescription => "Demonstrate GestureLayer features: Tap, DoubleTap, Rotate, Zoom detection."; - - private GestureLayer _glayer; - private Background _background; - private Rectangle _box1; - - public override void Run(Window window) - { - _background = new Background(window); - var windowSize = window.ScreenSize; - _background.Color = Color.White; - _background.Resize(windowSize.Width, windowSize.Height); - _background.Show(); - - _box1 = new Rectangle(window) - { - Color = Color.Yellow - }; - _box1.Geometry = window.GetInnerSquare(); - _box1.Show(); - - Msg("Double tap to register additional gestures. Tripple tap to unregister them."); - - _glayer = new GestureLayer(_box1); - _glayer.Attach(_box1); - - _glayer.SetTapCallback(GestureLayer.GestureType.Tap, GestureLayer.GestureState.End, (info) => { - Msg("Tap {0},{1}", info.X, info.Y); - }); - - _glayer.SetTapCallback(GestureLayer.GestureType.DoubleTap, GestureLayer.GestureState.End, (info) => { - Msg("DoubleTap {0},{1} {2}", info.X, info.Y, info.FingersCount); - _glayer.SetLineCallback(GestureLayer.GestureState.End, (line) => { - Msg("Line {0},{1}-{2},{3}, M:{4},{5}", line.X1, line.Y1, line.X2, line.Y2, line.HorizontalMomentum, line.VerticalMomentum); - }); - _glayer.SetFlickCallback(GestureLayer.GestureState.End, (flick) => { - Msg("Flick {0},{1}-{2},{3}, M:{4},{5}", flick.X1, flick.Y1, flick.X2, flick.Y2, flick.HorizontalMomentum, flick.VerticalMomentum); - }); - _glayer.RotateStep = 3; - _glayer.SetRotateCallback(GestureLayer.GestureState.Move, (rotate) => { - Msg("Rotation {0},{1} a:{2:F3} ba:{3:F3}", rotate.X, rotate.Y, rotate.Angle, rotate.BaseAngle); - }); - _glayer.SetZoomCallback(GestureLayer.GestureState.End, (zoom) => { - Msg("Zoom {0},{1} r:{2} z:{3:F3}", zoom.X, zoom.Y, zoom.Radius, zoom.Zoom); - }); - Msg("Line, Flick, Rotate, and Zoom callbacks enabled."); - }); - - _glayer.SetTapCallback(GestureLayer.GestureType.TripleTap, GestureLayer.GestureState.End, (info) => { - Msg("TrippleTap {0},{1} {2}", info.X, info.Y, info.FingersCount); - _glayer.SetLineCallback(GestureLayer.GestureState.End, null); - _glayer.SetFlickCallback(GestureLayer.GestureState.End, null); - _glayer.SetRotateCallback(GestureLayer.GestureState.Move, null); - _glayer.SetZoomCallback(GestureLayer.GestureState.End, null); - Msg("Cleared Line, Flick, Rotate, and Zoom callbacks."); - }); - // Momentum is not used, it seems that it conflicts with Rotate and Zoom - } - - private void Msg(string format, params object[] args) - { - var entry = string.Format(format, args); - Log.Debug(entry); - } - } -} diff --git a/test/ElmSharp.Test/TC/Wearable/IconTest1.cs b/test/ElmSharp.Test/TC/Wearable/IconTest1.cs deleted file mode 100644 index 215a07f49..000000000 --- a/test/ElmSharp.Test/TC/Wearable/IconTest1.cs +++ /dev/null @@ -1,80 +0,0 @@ -/* - * 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 ElmSharp; -using System.Collections.Generic; - -namespace ElmSharp.Test.Wearable -{ - public class IconTest1 : WearableTestCase - { - public override string TestName => "IconTest1"; - public override string TestDescription => "To test basic operation of Icon"; - - public override void Run(Window window) - { - Background bg = new Background(window) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - Color = Color.Gray - }; - bg.Show(); - window.AddResizeObject(bg); - - Conformant conformant = new Conformant(window); - conformant.Show(); - Scroller scroller = new Scroller(window); - scroller.Show(); - scroller.Geometry = window.GetInnerSquare(); - Box box = new Box(window); - box.Show(); - scroller.SetContent(box); - - List iconList = new List{ "home", "close", "apps", "arrow_up", "arrow_down", "arrow_left", "arrow_right", "chat", "clock", "delete", "edit", "refresh", "folder", "file", - "menu/home", "menu/close", "menu/apps", "menu/arrow_up", "menu/arrow_down", "menu/arrow_left", "menu/arrow_right", "menu/chat", "menu/clock", "menu/delete", "menu/edit", "menu/refresh", "menu/folder", - "menu/file", "media_player/forward", "media_player/info", "media_player/next", "media_player/pause", "media_player/play", "media_player/prev", "media_player/rewind", "media_player/stop"}; - - foreach (var iconName in iconList) - { - Label label = new Label(window) - { - Text = iconName, - }; - Icon icon = new Icon(window) - { - IconLookupOrder = IconLookupOrder.ThemeFirst, - StandardIconName = iconName, - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - MinimumHeight = 100, - MinimumWidth = 100, - }; - icon.Show(); - label.Show(); - box.PackEnd(icon); - box.PackEnd(label); - } - - - } - } -} diff --git a/test/ElmSharp.Test/TC/Wearable/ImageTest1.cs b/test/ElmSharp.Test/TC/Wearable/ImageTest1.cs deleted file mode 100644 index ddb003f16..000000000 --- a/test/ElmSharp.Test/TC/Wearable/ImageTest1.cs +++ /dev/null @@ -1,147 +0,0 @@ -/* - * 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.IO; - -namespace ElmSharp.Test.Wearable -{ - public class ImageTest1 : WearableTestCase - { - public override string TestName => "ImageTest1"; - public override string TestDescription => "To test basic operation of Image"; - - Image image; - Label lbInfo; - string[] btn_names = new string[] {"File1", "File2", "Uri", "Strm", "FileA1", "FileA2", "UriA", "StrmA"}; - - public override void Run(Window window) - { - Rect square = window.GetInnerSquare(); - - Button[] btns = new Button[8]; - Size btnSize = new Size(square.Width / 4 - 2, square.Height / 5 - 1); - for (int i = 0; i < 2; i++) - { - for (int j = 0; j < 4; j++) - { - btns[i * 4 + j] = new Button(window) - { - Text = "" + btn_names[i * 4 + j] + "", - }; - int x = j * btnSize.Width + j *2; - int y = i * btnSize.Height + i; - btns[i * 4 + j].Geometry = new Rect(square.X + x, square.Y + y, btnSize.Width, btnSize.Height); - btns[i * 4 + j].Show(); - } - } - - lbInfo = new Label(window) - { - Color = Color.White, - AlignmentX = -1, - AlignmentY = 0, - WeightX = 1 - }; - lbInfo.Show(); - lbInfo.Geometry = new Rect(square.X, square.Y + square.Height, square.Width, 15); - - image = new Image(window) - { - IsFixedAspect = true, - AlignmentX = -1, - AlignmentY = -1, - }; - image.Show(); - image.Load(Path.Combine(TestRunner.ResourceDir, "picture.png")); - image.Geometry = new Rect(square.X, square.Y + btnSize.Height * 2 + 2 , square.Width, btnSize.Height * 3); - image.Clicked += (s, e) => - { - Console.WriteLine("Image has been clicked. (IsFixedAspect = {0}", image.IsFixedAspect); - image.IsFixedAspect = image.IsFixedAspect == true ? false : true; - }; - - btns[0].Clicked += (s, e) => LoadFile("TED/large/a.jpg"); - btns[1].Clicked += (s, e) => LoadFile("TED/large/b.jpg"); - btns[2].Clicked += (s, e) => LoadUri("http://pe.tedcdn.com/images/ted/2e306b9655267cee35e45688ace775590b820510_615x461.jpg"); - btns[3].Clicked += (s, e) => LoadStream(new FileStream(Path.Combine(TestRunner.ResourceDir, "TED/large/c.jpg"), FileMode.Open, FileAccess.Read)); - - btns[4].Clicked += (s, e) => LoadFileAsync("TED/large/d.jpg"); - btns[5].Clicked += (s, e) => LoadFileAsync("TED/large/e.jpg"); - btns[6].Clicked += (s, e) => LoadUriAsync("http://pe.tedcdn.com/images/ted/2e306b9655267cee35e45688ace775590b820510_615x461.jpg"); - btns[7].Clicked += (s, e) => LoadStreamAsync(new FileStream(Path.Combine(TestRunner.ResourceDir, "TED/large/f.jpg"), FileMode.Open, FileAccess.Read)); - } - - void LoadFile(string file) - { - bool ret = image.Load(Path.Combine(TestRunner.ResourceDir, file)); - if (ret) - UpdateLabelText(lbInfo, image.File); - else - UpdateLabelText(lbInfo, "Loading Failed."); - } - - void LoadUri(string uri) - { - bool ret = image.Load(uri); - if (ret) - UpdateLabelText(lbInfo, image.File); - else - UpdateLabelText(lbInfo, "Loading Failed."); - } - - void LoadStream(Stream stream) - { - bool ret = image.Load(stream); - if (ret) - UpdateLabelText(lbInfo, image.File); - else - UpdateLabelText(lbInfo, "Loading Failed."); - } - - async void LoadFileAsync(string file) - { - var ret = await image.LoadAsync(Path.Combine(TestRunner.ResourceDir, file)); - if (ret) - UpdateLabelText(lbInfo, image.File); - else - UpdateLabelText(lbInfo, "Loading Failed."); - } - - async void LoadUriAsync(string uri) - { - var ret = await image.LoadAsync(uri); - if (ret) - UpdateLabelText(lbInfo, image.File); - else - UpdateLabelText(lbInfo, "Loading Failed."); - } - - async void LoadStreamAsync(Stream stream) - { - var ret = await image.LoadAsync(stream); - if (ret) - UpdateLabelText(lbInfo, image.File); - else - UpdateLabelText(lbInfo, "Loading Failed."); - } - - void UpdateLabelText(Label lable, string text) - { - lable.Text = "" + text + ""; - } - } -} diff --git a/test/ElmSharp.Test/TC/Wearable/ImageTest2.cs b/test/ElmSharp.Test/TC/Wearable/ImageTest2.cs deleted file mode 100755 index 4842c01cc..000000000 --- a/test/ElmSharp.Test/TC/Wearable/ImageTest2.cs +++ /dev/null @@ -1,84 +0,0 @@ -/* - * 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.IO; - -namespace ElmSharp.Test.Wearable -{ - public class ImageTest2 : WearableTestCase - { - public override string TestName => "ImageTest2"; - public override string TestDescription => "To test basic operation of Image"; - - Image image; - Label lbInfo; - - string[] btn_names = new string[] { "Blue", "Default", "Aspect", "Rotate" }; - - public override void Run(Window window) - { - Rect square = window.GetInnerSquare(); - - Button[] btns = new Button[4]; - Size btnSize = new Size(square.Width / 4 - 2, square.Height / 4); - for (int i = 0; i < 4; i++) - { - btns[i] = new Button(window) - { - Text = "" + btn_names[i] + "", - }; - int x = i * btnSize.Width + i * 2; - btns[i].Geometry = new Rect(square.X + x, square.Y, btnSize.Width, btnSize.Height); - btns[i].Show(); - } - - lbInfo = new Label(window) { - Color = Color.White, - AlignmentX = -1, - AlignmentY = 0, - WeightX = 1 - }; - lbInfo.Show(); - lbInfo.Geometry = new Rect(square.X, square.Y + square.Height, square.Width, 15); - - image = new Image(window) { - IsFixedAspect = true, - AlignmentX = -1, - AlignmentY = -1, - }; - image.Show(); - image.Load(Path.Combine(TestRunner.ResourceDir, "picture.png")); - image.Geometry = new Rect(square.X, square.Y + btnSize.Height, square.Width, btnSize.Height * 3); - - image.Clicked += (s, e) => - { - Console.WriteLine("Image has been clicked. (IsFixedAspect = {0}", image.IsFixedAspect); - image.IsFixedAspect = image.IsFixedAspect == true ? false : true; - }; - - btns[0].Clicked += (s, e) => { image.BackgroundColor = Color.Blue; UpdateLabelText(image.BackgroundColor.ToString()); }; - btns[1].Clicked += (s, e) => { image.BackgroundColor = Color.Default; UpdateLabelText(image.BackgroundColor.ToString()); }; - btns[2].Clicked += (s, e) => { image.IsFixedAspect = image.IsFixedAspect == true ? false : true; }; - btns[3].Clicked += (s, e) => { image.Orientation = image.Orientation == ImageOrientation.None ? ImageOrientation.Rotate270 : ImageOrientation.None; }; - } - - void UpdateLabelText(string text) - { - lbInfo.Text = " BackgroundColor => " + text + ""; - } - } -} diff --git a/test/ElmSharp.Test/TC/Wearable/ImageTest3.cs b/test/ElmSharp.Test/TC/Wearable/ImageTest3.cs deleted file mode 100755 index fa96a6e37..000000000 --- a/test/ElmSharp.Test/TC/Wearable/ImageTest3.cs +++ /dev/null @@ -1,96 +0,0 @@ -/* - * 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.IO; - -namespace ElmSharp.Test.Wearable -{ - public class ImageTest3 : WearableTestCase - { - public override string TestName => "ImageTest3"; - public override string TestDescription => "To test basic operation of Image"; - - Image image; - Label lbInfo; - - string[] btn_names = new string[] { "Blue(BG)", "Default(BG)", "Blue(FG)", "Default(FG)" }; - - public override void Run(Window window) - { - - Rect square = window.GetInnerSquare(); - - Button[] btns = new Button[4]; - Size btnSize = new Size(square.Width / 2 , square.Height / 5); - for (int i = 0; i < 2; i++) - { - for (int j = 0; j < 2; j++) - { - btns[i * 2 + j] = new Button(window) - { - Text = "" + btn_names[i * 2 + j] + "", - - }; - int x = j * btnSize.Width + j * 2; - int y = i * btnSize.Height + i; - btns[i * 2 + j].Geometry = new Rect(square.X + x, square.Y + y, btnSize.Width, btnSize.Height); - btns[i * 2 + j].Show(); - } - } - - lbInfo = new Label(window) { - Color = Color.White, - AlignmentX = -1, - AlignmentY = 0, - WeightX = 1 - }; - lbInfo.Show(); - lbInfo.Geometry = new Rect(square.X, square.Y + square.Height, square.Width, 15); - - image = new Image(window) { - IsFixedAspect = true, - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1 - }; - image.Show(); - image.Load(Path.Combine(TestRunner.ResourceDir, "btn_delete.png")); - image.Geometry = new Rect(square.X, square.Y + btnSize.Height * 2 + 2, square.Width, btnSize.Height * 3 ); - - image.Clicked += (s, e) => - { - Console.WriteLine("Image has been clicked. (IsFixedAspect = {0}", image.IsFixedAspect); - image.IsFixedAspect = image.IsFixedAspect == true ? false : true; - }; - - btns[0].Clicked += (s, e) => { image.BackgroundColor = Color.Blue; UpdateLabelText(image.BackgroundColor.ToString()); }; - btns[1].Clicked += (s, e) => { image.BackgroundColor = Color.Default; UpdateLabelText(image.BackgroundColor.ToString()); }; - btns[2].Clicked += (s, e) => { image.Color = Color.Blue; UpdateLabelText(image.Color.ToString(), false); }; - btns[3].Clicked += (s, e) => { image.Color = Color.Default; UpdateLabelText(image.Color.ToString(), false); }; - - } - - void UpdateLabelText(string text, bool isBackground = true) - { - if(isBackground) - lbInfo.Text = " Background Color => " + text + ""; - else - lbInfo.Text = " Foreground Color => " + text + ""; - } - } -} diff --git a/test/ElmSharp.Test/TC/Wearable/ImageTest4.cs b/test/ElmSharp.Test/TC/Wearable/ImageTest4.cs deleted file mode 100755 index f44a3917f..000000000 --- a/test/ElmSharp.Test/TC/Wearable/ImageTest4.cs +++ /dev/null @@ -1,77 +0,0 @@ -/* - * 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.IO; - -namespace ElmSharp.Test.Wearable -{ - public class ImageTest4 : WearableTestCase - { - public override string TestName => "ImageTest4"; - public override string TestDescription => "To test border operation of Image"; - - Image image; - - public override void Run(Window window) - { - Rect square = window.GetInnerSquare(); - Log.Debug(square.ToString()); - - Button btnBorder = new Button(window) - { - Text = "Set : off", - }; - btnBorder.Resize(square.Width / 2, square.Height / 4); - btnBorder.Move(square.X, square.Y); - btnBorder.Show(); - - Button btnBorderCenterFillMode = new Button(window) - { - Text = "FillMode", - }; - btnBorderCenterFillMode.Resize(square.Width / 2, square.Height / 4); - btnBorderCenterFillMode.Move(square.X + square.Width / 2 , square.Y); - btnBorderCenterFillMode.Show(); - - image = new Image(window); - image.Load(Path.Combine(TestRunner.ResourceDir, "picture.png")); - image.MinimumWidth = square.Width; - image.MinimumHeight = square.Height * 3 / 4; - image.Move(square.X, square.Y + square.Height / 4); - image.Resize(square.Width, square.Height * 3 / 4); - image.Show(); - - - btnBorder.Clicked += (s, e) => - { - int nX = square.Width / 6; - int nY = square.Height / 8; - Log.Debug("image.Width" + image.ObjectSize.Width.ToString()); - Log.Debug("image.Height" + image.ObjectSize.Height.ToString()); - Log.Debug("nX :" + nX + ", nY :" + nY); - image.SetBorder(nX, nX, nY, nY); - btnBorder.Text = "Border Set : on"; - }; - - btnBorderCenterFillMode.Clicked += (s, e) => - { - image.BorderCenterFillMode = ((ImageBorderFillMode)Enum.ToObject(typeof(ImageBorderFillMode), ((int)image.BorderCenterFillMode + 1) % Enum.GetValues(typeof(ImageBorderFillMode)).Length)); - btnBorderCenterFillMode.Text = image.BorderCenterFillMode.ToString(); - }; - } - } -} \ No newline at end of file diff --git a/test/ElmSharp.Test/TC/Wearable/IndexTest1.cs b/test/ElmSharp.Test/TC/Wearable/IndexTest1.cs deleted file mode 100755 index 4199fccda..000000000 --- a/test/ElmSharp.Test/TC/Wearable/IndexTest1.cs +++ /dev/null @@ -1,115 +0,0 @@ -/* - * 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.Collections.Generic; - -namespace ElmSharp.Test.Wearable -{ - class IndexTest1 : WearableTestCase - { - Dictionary _indexTable = new Dictionary(); - public override string TestName => "IndexTest1"; - public override string TestDescription => "To test group operation of Index"; - public override void Run(Window window) - { - Conformant conformant = new Conformant(window); - conformant.Show(); - Box box = new Box(window) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - IsHorizontal = true, - }; - box.Show(); - GenList list = new GenList(window) - { - Homogeneous = false, - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1 - }; - list.Show(); - Index index = new Index(window) - { - IsHorizontal = false, - AlignmentY = -1, - WeightY = 1, - MinimumWidth = 100, - AutoHide = false, - Style = "fastscroll" - }; - index.Show(); - - GenItemClass groupClass = new GenItemClass("group_index") - { - GetTextHandler = (obj, part) => - { - return string.Format("{0} - {1}", (string)obj, part); - } - }; - - GenListItem[] groups = new GenListItem[10]; - - for (int i = 0; i < 10; i++) - { - groups[i] = list.Append(groupClass, string.Format("{0}", i), GenListItemType.Group); - var indexitem = index.Append(string.Format("{0}", i)); - indexitem.Selected += (s, e) => - { - Console.WriteLine("Index selected : {0}", ((IndexItem)s).Text); - list.ScrollTo(_indexTable[(IndexItem)s], ScrollToPosition.In, true); - }; - _indexTable[indexitem] = groups[i]; - } - - GenItemClass defaultClass = new GenItemClass("default") - { - GetTextHandler = (obj, part) => - { - return string.Format("{0} - {1}", (string)obj, part); - } - }; - - for (int j = 0; j < 10; j++) - { - for (int i = 0; i < 20; i++) - { - list.Append(defaultClass, string.Format("{0} Item", i), GenListItemType.Normal, groups[j]); - } - } - - list.ItemSelected += List_ItemSelected; - index.Update(0); - box.PackEnd(list); - box.PackEnd(index); - box.SetLayoutCallback(() => - { - list.Geometry = box.Geometry; - index.Geometry = box.Geometry; - }); - conformant.SetContent(box); - } - - private void List_ItemSelected(object sender, GenListItemEventArgs e) - { - Console.WriteLine("{0} Item was selected", (string)(e.Item.Data)); - } - } -} diff --git a/test/ElmSharp.Test/TC/Wearable/IndexTest2.cs b/test/ElmSharp.Test/TC/Wearable/IndexTest2.cs deleted file mode 100755 index e6fcbb245..000000000 --- a/test/ElmSharp.Test/TC/Wearable/IndexTest2.cs +++ /dev/null @@ -1,153 +0,0 @@ -/* - * 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.Collections.Generic; - -namespace ElmSharp.Test.Wearable -{ - public class IndexTest2 : WearableTestCase - { - Dictionary _indexTable = new Dictionary(); - - public override string TestName => "IndexTest2"; - public override string TestDescription => "To test basic operation of Index"; - public override void Run(Window window) - { - Conformant conformant = new Conformant(window); - conformant.Show(); - Box outterBox = new Box(window) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - IsHorizontal = false, - }; - outterBox.Show(); - Scroller scroller = new Scroller(window) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - ScrollBlock = ScrollBlock.Vertical, - HorizontalPageScrollLimit = 1, - }; - scroller.SetPageSize(1.0, 1.0); - scroller.Show(); - - Box box = new Box(window) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - IsHorizontal = true, - }; - box.Show(); - scroller.SetContent(box); - - Index index = new Index(window) - { - IsHorizontal = true, - Style = "pagecontrol", - AlignmentX = -1, - WeightX = 1, - MinimumHeight = 100, - }; - index.Show(); - - var rnd = new Random(); - for (int i = 0; i < 10; i++) - { - int r = rnd.Next(255); - int g = rnd.Next(255); - int b = rnd.Next(255); - Color color = Color.FromRgb(r, g, b); - Rectangle colorBox = new Rectangle(window) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - Color = color, - MinimumWidth = window.ScreenSize.Width, - }; - colorBox.Show(); - Console.WriteLine("Height = {0}", colorBox.Geometry.Height); - box.PackEnd(colorBox); - var item = index.Append(string.Format("{0}", i)); - item.Selected += (s, e) => - { - scroller.ScrollTo(_indexTable[(IndexItem)s], 0, true); - }; - _indexTable[item] = i; - } - - conformant.SetContent(outterBox); - outterBox.PackEnd(scroller); - - Box buttonBox = new Box(window) - { - IsHorizontal = true, - AlignmentX = -1, - AlignmentY = 0, - }; - buttonBox.Show(); - - Button prev = new Button(window) - { - AlignmentX = -1, - WeightX = 1, - Text = "Prev" - }; - Button next = new Button(window) - { - AlignmentX = -1, - WeightX = 1, - Text = "next" - }; - prev.Clicked += (s, e) => - { - scroller.ScrollTo(scroller.HorizontalPageIndex > 0 ? scroller.HorizontalPageIndex - 1 : 0, scroller.VerticalPageIndex, true); - }; - next.Clicked += (s, e) => - { - scroller.ScrollTo(scroller.HorizontalPageIndex + 1, scroller.VerticalPageIndex, true); - }; - prev.Show(); - next.Show(); - buttonBox.PackEnd(prev); - buttonBox.PackEnd(next); - outterBox.PackEnd(buttonBox); - outterBox.PackEnd(index); - - scroller.DragStart += Scroller_DragStart; - scroller.DragStop += Scroller_DragStop; - } - - private void Scroller_DragStop(object sender, EventArgs e) - { - Log.Debug("Drag stop"); - } - - private void Scroller_DragStart(object sender, EventArgs e) - { - Log.Debug("Drag start"); - } - } -} diff --git a/test/ElmSharp.Test/TC/Wearable/LabelTest1.cs b/test/ElmSharp.Test/TC/Wearable/LabelTest1.cs deleted file mode 100644 index 808e52f3a..000000000 --- a/test/ElmSharp.Test/TC/Wearable/LabelTest1.cs +++ /dev/null @@ -1,45 +0,0 @@ -/* - * 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. - */ - - -namespace ElmSharp.Test.Wearable -{ - class LabelTest1 : WearableTestCase - { - public override string TestName => "LabelTest1"; - public override string TestDescription => "To test basic operation of Label"; - - public override void Run(Window window) - { - Background bg = new Background(window); - bg.Color = Color.White; - bg.Move(0, 0); - bg.Resize(window.ScreenSize.Width, window.ScreenSize.Height); - bg.Show(); - - Label label1 = new Label(window); - label1.Color = Color.Black; - label1.Text = "Label Test!!!"; - - label1.Show(); - int width = 200; - int height = 30; - label1.Resize(width, height); - label1.Move(window.ScreenSize.Width/2 - width/2, window.ScreenSize.Height/2 - height/2); - } - - } -} diff --git a/test/ElmSharp.Test/TC/Wearable/LabelTest2.cs b/test/ElmSharp.Test/TC/Wearable/LabelTest2.cs deleted file mode 100644 index 7f707a57e..000000000 --- a/test/ElmSharp.Test/TC/Wearable/LabelTest2.cs +++ /dev/null @@ -1,81 +0,0 @@ -/* - * 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. - */ - - -namespace ElmSharp.Test.Wearable -{ - class LabelTest2 : WearableTestCase - { - public override string TestName => "LabelTest2"; - public override string TestDescription => "To test basic operation of Label"; - - public override void Run(Window window) - { - Background bg = new Background(window); - bg.Color = Color.White; - bg.Move(0, 0); - bg.Resize(window.ScreenSize.Width, window.ScreenSize.Height); - bg.Show(); - - Label label1 = new Label(window); - label1.Text = "[default valign=top] gyj [bottom gyp], [top gyp], [middle gyp]"; - label1.TextStyle = "DEFAULT = 'color=#000000FF backing_color=#ff0000 backing=on font_size=25 align=left valign=top wrap=word'"; - label1.Resize(650, 0); - var size = label1.EdjeObject["elm.text"].TextBlockFormattedSize; - label1.Show(); - label1.Resize(size.Width, size.Height); - label1.Move(0, 0); - - Label label2 = new Label(window); - label2.Move(0, size.Height + 10); - label2.Text = "[default valign=middle] gyj [bottom gyp], [top gyp], [middle gyp]"; - label2.TextStyle = "DEFAULT = 'color=#000000FF backing_color=#ff0000 backing=on font_size=25 align=left valign=middle wrap=word'"; - label2.Resize(650, 0); - size = label2.EdjeObject["elm.text"].TextBlockFormattedSize; - label2.Show(); - label2.Resize(size.Width, size.Height); - - Label label3 = new Label(window); - label3.Move(0, label2.Geometry.Y + size.Height + 10); - label3.Text = "[default valign=bottom] gyj [bottom gyp], [top gyp], [middle gyp]"; - label3.TextStyle = "DEFAULT = 'color=#000000FF backing_color=#ff0000 backing=on font_size=25 align=left valign=bottom wrap=word'"; - label3.Resize(650, 0); - size = label3.EdjeObject["elm.text"].TextBlockFormattedSize; - label3.Show(); - label3.Resize(size.Width, size.Height); - - Label label4 = new Label(window); - label4.Move(0, label3.Geometry.Y + size.Height + 10); - label4.Text = "[No TextStyle]" + - "[bottom gyp], " + - "[top gyp], " + - "[middle gyp]"; - label4.Resize(650, 0); - size = label4.EdjeObject["elm.text"].TextBlockFormattedSize; - label4.Show(); - label4.Resize(size.Width, size.Height); - - Label label5 = new Label(window); - label5.Move(0, label4.Geometry.Y + size.Height + 10); - label5.Text = "[top gyp]"; - label5.Resize(650, 0); - size = label5.EdjeObject["elm.text"].TextBlockFormattedSize; - label5.Show(); - label5.Resize(size.Width, size.Height); - } - - } -} diff --git a/test/ElmSharp.Test/TC/Wearable/LabelTest3.cs b/test/ElmSharp.Test/TC/Wearable/LabelTest3.cs deleted file mode 100644 index 666b996bf..000000000 --- a/test/ElmSharp.Test/TC/Wearable/LabelTest3.cs +++ /dev/null @@ -1,74 +0,0 @@ -/* - * 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. - */ - - -namespace ElmSharp.Test.Wearable -{ - public class LabelTest3 : WearableTestCase - { - public override string TestName => "LabelTest3"; - public override string TestDescription => "To test basic operation of Label"; - - public override void Run(Window window) - { - Background bg = new Background(window) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - Color = Color.White - }; - bg.Show(); - window.AddResizeObject(bg); - - Conformant conformant = new Conformant(window); - conformant.Show(); - Scroller scroller = new Scroller(window); - scroller.Show(); - conformant.SetContent(scroller); - Box box = new Box(window); - box.SetLayoutCallback(() => { }); - box.Show(); - scroller.SetContent(box); - - Size size; - - Label label1 = new Label(window); - box.PackEnd(label1); - Label label2 = new Label(window); - box.PackEnd(label2); - - - label1.Text = "Jo Ann Buckner"; - label1.TextStyle = "DEFAULT='color=#000000FF font_size=24 align=left valign=bottom wrap=word'"; - label1.Show(); - label1.Resize(100000, 0); - size = label1.EdjeObject["elm.text"].TextBlockFormattedSize; - label1.Geometry = new Rect(55, 213, size.Width, size.Height); - - label2.Text = "Customer Success Engineer"; - label2.TextStyle = "DEFAULT='color=#000000FF font_size=16 align=left valign=bottom wrap=word'"; - label2.Show(); - - label2.Resize(100000, 0); - size = label2.EdjeObject["elm.text"].TextBlockFormattedSize; - label2.Geometry = new Rect(55, 300, size.Width, size.Height); - - - } - } -} diff --git a/test/ElmSharp.Test/TC/Wearable/LabelTest4.cs b/test/ElmSharp.Test/TC/Wearable/LabelTest4.cs deleted file mode 100644 index 503b98120..000000000 --- a/test/ElmSharp.Test/TC/Wearable/LabelTest4.cs +++ /dev/null @@ -1,50 +0,0 @@ -/* - * 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. - */ - - -namespace ElmSharp.Test.Wearable -{ - public class LabelTest4 : WearableTestCase - { - public override string TestName => "LabelTest4"; - public override string TestDescription => "To test slide Animation of Label"; - - public override void Run(Window window) - { - Background bg = new Background(window); - bg.Color = Color.White; - bg.Move(0, 0); - bg.Resize(window.ScreenSize.Width, window.ScreenSize.Height); - bg.Show(); - - Label label1 = new Label(window) - { - Style = "slide_long", - SlideDuration = 3, - SlideMode = LabelSlideMode.Always, - Color = Color.Black, - Text = "Lab test12345678" - }; - - label1.Show(); - int width = 200; - int height = 30; - label1.Resize(width, height); - label1.Move(window.ScreenSize.Width/2 - width/2, window.ScreenSize.Height/2 - height/2); - label1.PlaySlide(); - } - } -} diff --git a/test/ElmSharp.Test/TC/Wearable/LabelTest5.cs b/test/ElmSharp.Test/TC/Wearable/LabelTest5.cs deleted file mode 100644 index 432a5ff8b..000000000 --- a/test/ElmSharp.Test/TC/Wearable/LabelTest5.cs +++ /dev/null @@ -1,105 +0,0 @@ -/* - * 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. - */ - - -namespace ElmSharp.Test.Wearable -{ - public class LabelTest5 : WearableTestCase - { - public override string TestName => "LabelTest5"; - public override string TestDescription => "To test Slide Animation Speed of Label"; - - public override void Run(Window window) - { - Rect square = window.GetInnerSquare(); - - Background bg = new Background(window) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - Color = Color.White - }; - bg.Geometry = square; - bg.Show(); - - Rect pieces = square; - pieces.Height /= 4; - - Label label1 = new Label(window) - { - Text = "Test Slide Animaiton", - Color = Color.Black, - Style = "slide_long", - SlideSpeed = 100, - SlideMode = LabelSlideMode.Always, - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1 - }; - - Button btnCurrentSpeed = new Button(window) - { - Text = "Current Speed : 100", - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - }; - - Button btnSpeedUp = new Button(window) - { - Text = "Speed + 10", - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - }; - btnSpeedUp.Clicked += (s, e) => - { - label1.SlideSpeed += 10; - btnCurrentSpeed.Text = string.Format("Current Speed : {0}", label1.SlideSpeed); - label1.PlaySlide(); - }; - Button btnSpeedDown = new Button(window) - { - Text = "Speed - 10", - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - }; - btnSpeedDown.Clicked += (s, e) => - { - label1.SlideSpeed -= 10; - btnCurrentSpeed.Text = string.Format("Current Speed : {0}", label1.SlideSpeed); - label1.PlaySlide(); - }; - - label1.Geometry = new Rect(pieces.X, pieces.Y, pieces.Width, pieces.Height); - label1.Show(); - label1.PlaySlide(); - - btnCurrentSpeed.Geometry = new Rect(pieces.X, pieces.Y + pieces.Height, pieces.Width, pieces.Height); - btnCurrentSpeed.Show(); - - btnSpeedUp.Geometry = new Rect(pieces.X, pieces.Y + pieces.Height*2, pieces.Width, pieces.Height); - btnSpeedUp.Show(); - - btnSpeedDown.Geometry = new Rect(pieces.X, pieces.Y + pieces.Height*3, pieces.Width, pieces.Height); - btnSpeedDown.Show(); - } - } -} diff --git a/test/ElmSharp.Test/TC/Wearable/LabelValignTest1.cs b/test/ElmSharp.Test/TC/Wearable/LabelValignTest1.cs deleted file mode 100644 index 622d4c391..000000000 --- a/test/ElmSharp.Test/TC/Wearable/LabelValignTest1.cs +++ /dev/null @@ -1,103 +0,0 @@ -/* - * 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. - */ - - -namespace ElmSharp.Test.Wearable -{ - public class LabelValignTest1 : WearableTestCase - { - public override string TestName => "LabelValignTest1"; - public override string TestDescription => "To test Vertical align of Label"; - - public override void Run(Window window) - { - Rect square = window.GetInnerSquare(); - - Background bg = new Background(window) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - Color = Color.White - }; - bg.Geometry = square; - bg.Show(); - - Rect pieces = square; - pieces.Height /= 4; - - Label label1 = new Label(window) - { - Text = "Align Test", - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1 - }; - label1.TextStyle = "DEFAULT = 'color=#000000FF font_size=30 align=center wrap=word'"; - label1.Geometry = new Rect(pieces.X, pieces.Y, pieces.Width, pieces.Height); - label1.Show(); - - Button top = new Button(window) - { - Text = "Top", - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - }; - - Button middle = new Button(window) - { - Text = "Middle", - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - }; - Button bottom = new Button(window) - { - Text = "bottom", - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - }; - - top.Clicked += (s, e) => - { - label1.SetVerticalTextAlignment("elm.text", 0); - }; - - middle.Clicked += (s, e) => - { - label1.SetVerticalTextAlignment("elm.text", 0.5); - }; - - bottom.Clicked += (s, e) => - { - label1.SetVerticalTextAlignment("elm.text", 1.0); - }; - - top.Geometry = new Rect(pieces.X, pieces.Y + pieces.Height, pieces.Width, pieces.Height); - top.Show(); - - middle.Geometry = new Rect(pieces.X, pieces.Y + pieces.Height*2, pieces.Width, pieces.Height); - middle.Show(); - - bottom.Geometry = new Rect(pieces.X, pieces.Y + pieces.Height*3, pieces.Width, pieces.Height); - bottom.Show(); - } - } -} diff --git a/test/ElmSharp.Test/TC/Wearable/ListTest1.cs b/test/ElmSharp.Test/TC/Wearable/ListTest1.cs deleted file mode 100755 index fbcc53610..000000000 --- a/test/ElmSharp.Test/TC/Wearable/ListTest1.cs +++ /dev/null @@ -1,134 +0,0 @@ -/* - * 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 ElmSharp.Test.Wearable -{ - public class ListTest1 : WearableTestCase - { - public override string TestName => "ListTest1"; - public override string TestDescription => "To test basic operation of List"; - private int _count = 0; - public override void Run(Window window) - { - Conformant conformant = new Conformant(window); - conformant.Show(); - Box box = new Box(window) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - }; - box.Show(); - conformant.SetContent(box); - - List list = new List(window) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1 - }; - - _count = 0; - - for (int i = 0; i < 5; i++) - { - list.Append(string.Format("{0} item", _count++)); - } - - list.ItemSelected += List_Selected; - list.ItemUnselected += List_Unselected; - list.ItemActivated += List_ItemActivated; - list.ItemDoubleClicked += List_ItemDoubleClicked; - list.ItemLongPressed += List_ItemLongPressed; - list.RenderPost += List_RenderPost; - list.Update(); - list.Show(); - - box.PackEnd(list); - - Box buttonBox = new Box(window) - { - IsHorizontal = true, - AlignmentX = -1, - AlignmentY = 0, - }; - buttonBox.Show(); - - Button append = new Button(window) - { - Text = "Append", - AlignmentX = -1, - WeightX = 1, - }; - Button prepend = new Button(window) - { - Text = "Prepend", - AlignmentX = -1, - WeightX = 1, - }; - append.Clicked += (s, e) => - { - list.Append(string.Format("{0} item", _count++)); - list.Update(); - }; - prepend.Clicked += (s, e) => - { - list.Prepend(string.Format("{0} item", _count++)); - list.Update(); - }; - append.Show(); - prepend.Show(); - buttonBox.PackEnd(append); - buttonBox.PackEnd(prepend); - box.PackEnd(buttonBox); - } - - int count = 0; - private void List_RenderPost(object sender, EventArgs e) - { - Console.WriteLine("{0} List_RenderPost", count++); - } - - private void List_ItemLongPressed(object sender, ListItemEventArgs e) - { - Console.WriteLine("{0} item was long pressed", e.Item.Text); - } - - private void List_ItemDoubleClicked(object sender, ListItemEventArgs e) - { - Console.WriteLine("{0} item was Double clicked", e.Item.Text); - } - - private void List_ItemActivated(object sender, ListItemEventArgs e) - { - Console.WriteLine("{0} item was Activated", e.Item.Text); - } - - private void List_Unselected(object sender, ListItemEventArgs e) - { - Console.WriteLine("{0} item was unselected", e.Item.Text); - } - - private void List_Selected(object sender, ListItemEventArgs e) - { - Console.WriteLine("{0} item was selected", e.Item.Text); - } - } -} diff --git a/test/ElmSharp.Test/TC/Wearable/NaviframeTest1.cs b/test/ElmSharp.Test/TC/Wearable/NaviframeTest1.cs deleted file mode 100644 index c11196c9f..000000000 --- a/test/ElmSharp.Test/TC/Wearable/NaviframeTest1.cs +++ /dev/null @@ -1,64 +0,0 @@ -/* - * 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 ElmSharp; - -namespace ElmSharp.Test.Wearable -{ - class NaviframeTest1 : WearableTestCase - { - public override string TestName => "NaviframeTest1"; - public override string TestDescription => "Naviframe test"; - - public override void Run(Window window) - { - var square = window.GetInnerSquare(); - Conformant conformant = new Conformant(window); - conformant.Show(); - - Naviframe navi = new Naviframe(window) - { - PreserveContentOnPop = true, - DefaultBackButtonEnabled = true, - Geometry = square - }; - - navi.Popped += (s, e) => - { - Console.WriteLine("naviframe was popped : " + e.Content.GetType()); - }; - - Rectangle rect1 = new Rectangle(window) - { - Color = Color.Red, - Geometry = new Rect(square.X, square.Y, square.Width, square.Height) - }; - - navi.Push(rect1, "First Page"); - - Rectangle rect2 = new Rectangle(window) - { - Color = Color.Blue, - Geometry = new Rect(square.X, square.Y, square.Width, square.Height) - }; - - navi.Push(rect2, "Second Page"); - navi.Show(); - conformant.SetContent(navi); - } - } -} diff --git a/test/ElmSharp.Test/TC/Wearable/NaviframeTest2.cs b/test/ElmSharp.Test/TC/Wearable/NaviframeTest2.cs deleted file mode 100644 index f4a7625f8..000000000 --- a/test/ElmSharp.Test/TC/Wearable/NaviframeTest2.cs +++ /dev/null @@ -1,200 +0,0 @@ -/* - * 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.Linq; - -namespace ElmSharp.Test.Wearable -{ - public class NaviframeTest2 : WearableTestCase - { - public override string TestName => "NaviframeTest2"; - public override string TestDescription => "Naviframe test"; - - Naviframe _navi; - int _sequence = 0; - Rect square; - - public override void Run(Window window) - { - Conformant conformant = new Conformant(window); - conformant.Show(); - square = window.GetInnerSquare(); - - Naviframe navi = new Naviframe(window) - { - PreserveContentOnPop = true, - DefaultBackButtonEnabled = true - }; - _navi = navi; - - navi.Popped += (s, e) => - { - Console.WriteLine("----- Naviframe was popped {0:x} ", (int)(IntPtr)e.Content); - }; - - navi.Push(CreatePage(window), "0 Page"); - - navi.Show(); - conformant.SetContent(navi); - } - - EvasObject CreatePage(Window parent) - { - Table table = new Table(parent); - table.Geometry = square; - table.Show(); - - Label label = new Label(parent) { - Text = string.Format("{0} Page", _sequence++), - WeightX = 1, - AlignmentX = -1, - BackgroundColor = Color.Black, - Geometry = new Rect(square.X, square.Y, square.Width, square.Height/9) - }; - - Button push = new Button(parent) { - Text = "Push", - WeightX = 1, - AlignmentX = -1, - BackgroundColor = Color.Black, - Geometry = new Rect(square.X, square.Y + square.Height/9, square.Width/2, square.Height/9) - }; - - Button pop = new Button(parent) { - Text = "pop", - WeightX = 1, - AlignmentX = -1, - BackgroundColor = Color.Black, - Geometry = new Rect(square.X + square.Width/2, square.Y + square.Height/9, square.Width/2, square.Height/9) - }; - - Button insertBeforeTop = new Button(parent) { - Text = "insertBeforeTop", - WeightX = 1, - AlignmentX = -1, - BackgroundColor = Color.Black, - Geometry = new Rect(square.X, square.Y + square.Height / 9*2, square.Width / 2, square.Height / 9) - }; - - Button insertAfterTop = new Button(parent) { - Text = "insertAfterTop", - WeightX = 1, - AlignmentX = -1, - BackgroundColor = Color.Black, - Geometry = new Rect(square.X + square.Width / 2, square.Y + square.Height / 9*2, square.Width / 2, square.Height / 9) - }; - - Button removeTop = new Button(parent) - { - Text = "removeTop", - WeightX = 1, - AlignmentX = -1, - BackgroundColor = Color.Black, - Geometry = new Rect(square.X, square.Y + square.Height / 9 * 3, square.Width, square.Height / 9) - }; - - Button barChange = new Button(parent) - { - Text = "TitleBarColor Change", - WeightX = 1, - AlignmentX = -1, - BackgroundColor = Color.Black, - Geometry = new Rect(square.X, square.Y + square.Height / 9 * 4, square.Width / 2, square.Height / 9) - }; - - Button barColorDefault = new Button(parent) - { - Text = "TitleBarColor - Default", - WeightX = 1, - AlignmentX = -1, - BackgroundColor = Color.Black, - Geometry = new Rect(square.X + square.Width / 2, square.Y + square.Height / 9 * 4, square.Width / 2, square.Height / 9) - }; - - label.Show(); - push.Show(); - pop.Show(); - insertBeforeTop.Show(); - insertAfterTop.Show(); - removeTop.Show(); - barChange.Show(); - barColorDefault.Show(); - - push.Clicked += (s, e) => - { - _navi.Push(CreatePage(parent), string.Format("{0} Page", _sequence-1)); - }; - - pop.Clicked += (s, e) => - { - var item = _navi.NavigationStack.LastOrDefault(); - int nativePointer = (int)(IntPtr)(item.Content); - Console.WriteLine("----- Before Call _navi.Pop() {0:x} ", nativePointer); - _navi.Pop(); - Console.WriteLine("----- After Call _navi.Pop() {0:x} ", nativePointer); - }; - - insertBeforeTop.Clicked += (s, e) => - { - _navi.InsertBefore(_navi.NavigationStack.LastOrDefault(), CreatePage(parent), string.Format("{0} Page", _sequence - 1)); - }; - - insertAfterTop.Clicked += (s, e) => - { - _navi.InsertAfter(_navi.NavigationStack.LastOrDefault(), CreatePage(parent), string.Format("{0} Page", _sequence - 1)); - }; - removeTop.Clicked += (s, e) => - { - var item = _navi.NavigationStack.LastOrDefault(); - int nativePointer = (int)(IntPtr)(item.Content); - Console.WriteLine("----- Before Call NaviItem.Delete() {0:x} ", nativePointer); - item.Delete(); - Console.WriteLine("----- After Call NaviItem.Delete() {0:x} ", nativePointer); - }; - - Random rand = new Random(DateTime.Now.Millisecond); - barChange.Clicked += (s, e) => - { - int currentIndex = _navi.NavigationStack.Count - 1; - if (currentIndex >= 0) - { - _navi.NavigationStack[currentIndex].TitleBarBackgroundColor = Color.FromHex(string.Format("#{0:X8}", rand.Next())); - } - }; - - barColorDefault.Clicked += (s, e) => - { - int currentIndex = _navi.NavigationStack.Count - 1; - if (currentIndex >= 0) - { - _navi.NavigationStack[currentIndex].TitleBarBackgroundColor = Color.Default; - } - }; - - table.Pack(label, 0,0,1,1); - table.Pack(push, 0,1,1,1); - table.Pack(pop, 1,1,1,1); - table.Pack(insertBeforeTop, 0, 2, 1, 1); - table.Pack(insertAfterTop, 1, 2, 1, 1); - table.Pack(removeTop, 0, 3, 1, 1); - table.Pack(barChange, 0, 4, 1, 1); - table.Pack(barColorDefault, 1, 4, 1, 1); - - return table; - } - } -} diff --git a/test/ElmSharp.Test/TC/Wearable/NaviframeTest3.cs b/test/ElmSharp.Test/TC/Wearable/NaviframeTest3.cs deleted file mode 100644 index 0ba309fd5..000000000 --- a/test/ElmSharp.Test/TC/Wearable/NaviframeTest3.cs +++ /dev/null @@ -1,188 +0,0 @@ -/* - * 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.Linq; - -namespace ElmSharp.Test.Wearable -{ - public class NaviframeTest3 : WearableTestCase - { - public override string TestName => "NaviframeTest3"; - public override string TestDescription => "Naviframe test"; - - Naviframe _navi; - int _sequence = 0; - Rect square; - - public override void Run(Window window) - { - Conformant conformant = new Conformant(window); - conformant.Show(); - square = window.GetInnerSquare(); - - Naviframe navi = new Naviframe(window) - { - PreserveContentOnPop = true, - DefaultBackButtonEnabled = true - }; - _navi = navi; - - navi.Popped += (s, e) => - { - Console.WriteLine("----- Naviframe was popped {0:x} ", (int)(IntPtr)e.Content); - }; - - NaviItem item = navi.Push(CreatePage(window), "0 Page"); - item.SetPartContent("title_left_btn", new Button(window) { Text = "LEFT" , Style = "naviframe/title_left"} ); - item.SetPartContent("title_right_btn", new Button(window) { Text = "RIGHT", Style = "naviframe/title_right" }); - navi.Show(); - conformant.SetContent(navi); - } - - EvasObject CreatePage(Window parent) - { - Table table = new Table(parent); - table.Geometry = square; - table.Show(); - - Label label = new Label(parent) { - Text = string.Format("{0} Page", _sequence++), - WeightX = 1, - AlignmentX = -1, - }; - Button push = new Button(parent) { - Text = "Push", - WeightX = 1, - AlignmentX = -1, - BackgroundColor = Color.Black, - }; - Button pop = new Button(parent) { - Text = "pop", - WeightX = 1, - AlignmentX = -1, - BackgroundColor = Color.Black, - }; - Button insertBeforeTop = new Button(parent) { - Text = "insertBeforeTop", - WeightX = 1, - AlignmentX = -1, - BackgroundColor = Color.Black, - }; - Button insertAfterTop = new Button(parent) { - Text = "insertAfterTop", - WeightX = 1, - AlignmentX = -1, - BackgroundColor = Color.Black, - }; - - Button removeTop = new Button(parent) - { - Text = "removeTop", - WeightX = 1, - AlignmentX = -1, - BackgroundColor = Color.Black, - }; - - Button barChange = new Button(parent) - { - Text = "TitleBarColor Change", - WeightX = 1, - AlignmentX = -1, - BackgroundColor = Color.Black, - }; - - Button barColorDefault = new Button(parent) - { - Text = "TitleBarColor - Default", - WeightX = 1, - AlignmentX = -1, - BackgroundColor = Color.Black, - }; - - label.Show(); - push.Show(); - pop.Show(); - insertBeforeTop.Show(); - insertAfterTop.Show(); - removeTop.Show(); - barChange.Show(); - barColorDefault.Show(); - - push.Clicked += (s, e) => - { - _navi.Push(CreatePage(parent), string.Format("{0} Page", _sequence-1)); - }; - - pop.Clicked += (s, e) => - { - var item = _navi.NavigationStack.LastOrDefault(); - int nativePointer = (int)(IntPtr)(item.Content); - Console.WriteLine("----- Before Call _navi.Pop() {0:x} ", nativePointer); - _navi.Pop(); - Console.WriteLine("----- After Call _navi.Pop() {0:x} ", nativePointer); - }; - - insertBeforeTop.Clicked += (s, e) => - { - _navi.InsertBefore(_navi.NavigationStack.LastOrDefault(), CreatePage(parent), string.Format("{0} Page", _sequence - 1)); - }; - - insertAfterTop.Clicked += (s, e) => - { - _navi.InsertAfter(_navi.NavigationStack.LastOrDefault(), CreatePage(parent), string.Format("{0} Page", _sequence - 1)); - }; - removeTop.Clicked += (s, e) => - { - var item = _navi.NavigationStack.LastOrDefault(); - int nativePointer = (int)(IntPtr)(item.Content); - Console.WriteLine("----- Before Call NaviItem.Delete() {0:x} ", nativePointer); - item.Delete(); - Console.WriteLine("----- After Call NaviItem.Delete() {0:x} ", nativePointer); - }; - - Random rand = new Random(DateTime.Now.Millisecond); - barChange.Clicked += (s, e) => - { - int currentIndex = _navi.NavigationStack.Count - 1; - if (currentIndex >= 0) - { - _navi.NavigationStack[currentIndex].TitleBarBackgroundColor = Color.FromHex(string.Format("#{0:X8}", rand.Next())); - } - }; - - barColorDefault.Clicked += (s, e) => - { - int currentIndex = _navi.NavigationStack.Count - 1; - if (currentIndex >= 0) - { - _navi.NavigationStack[currentIndex].TitleBarBackgroundColor = Color.Default; - } - }; - - table.Pack(label, 0, 0, 1, 1); - table.Pack(push, 0, 1, 1, 1); - table.Pack(pop, 1, 1, 1, 1); - table.Pack(insertBeforeTop, 0, 2, 1, 1); - table.Pack(insertAfterTop, 1, 2, 1, 1); - table.Pack(removeTop, 0, 3, 1, 1); - table.Pack(barChange, 0, 4, 1, 1); - table.Pack(barColorDefault, 1, 4, 1, 1); - - return table; - } - } -} diff --git a/test/ElmSharp.Test/TC/Wearable/PanelTest1.cs b/test/ElmSharp.Test/TC/Wearable/PanelTest1.cs deleted file mode 100644 index 5e5fac6c4..000000000 --- a/test/ElmSharp.Test/TC/Wearable/PanelTest1.cs +++ /dev/null @@ -1,95 +0,0 @@ -/* - * 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 ElmSharp; -using ElmSharp.Test.Wearable; - -namespace ElmSharp.Test.Wearable -{ - public class PanelTest1 : WearableTestCase - { - public override string TestName => "PanelTest1"; - public override string TestDescription => "To test basic operation of Panel"; - - public override void Run(Window window) - { - var square = window.GetInnerSquare(); - - Label label = new Label(window) { - Text = "Panel as NonScrollable", - AlignmentX = -1, - WeightX = 1, - Geometry = new Rect(square.X, square.Y, square.Width, square.Height/6) - }; - label.Show(); - - Panel panel = new Panel(window) { - Direction = PanelDirection.Left, - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - Geometry = new Rect(square.X, square.Y+ square.Height/6, square.Width, square.Height/5*2) - }; - panel.SetScrollable(false); - - Rectangle redbox = new Rectangle(window) { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - Color = Color.Red, - Geometry = new Rect(square.X, square.Y + square.Height/6, square.Width/2, square.Height/5*2) - }; - redbox.Show(); - panel.SetContent(redbox); - panel.Show(); - panel.IsOpen = true; - - Button button1 = new Button(window) { - Text = "Toggle open", - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - Geometry = new Rect(square.X, square.Y + square.Height/6 + square.Height/5*2+5, square.Width, square.Height/5) - }; - Button button2 = new Button(window) { - Text = "Toggle direction", - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - Geometry = new Rect(square.X, square.Y + square.Height/6 + square.Height/5*3+5, square.Width, square.Height/5) - }; - button1.Show(); - button2.Show(); - - button1.Clicked += (s, e) => - { - panel.Toggle(); - }; - button2.Clicked += (s, e) => - { - panel.Direction = (PanelDirection)((int)(panel.Direction + 1) % 4); - }; - panel.Toggled += (s, e) => - { - Console.WriteLine("Panel Toggled!"); - }; - } - - } -} diff --git a/test/ElmSharp.Test/TC/Wearable/PanelTest2.cs b/test/ElmSharp.Test/TC/Wearable/PanelTest2.cs deleted file mode 100644 index 2198ffe7b..000000000 --- a/test/ElmSharp.Test/TC/Wearable/PanelTest2.cs +++ /dev/null @@ -1,100 +0,0 @@ -/* - * 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 ElmSharp; - -namespace ElmSharp.Test.Wearable -{ - public class PanelTest2 : WearableTestCase - { - public override string TestName => "PanelTest2"; - public override string TestDescription => "To test basic operation of Panel"; - - public override void Run(Window window) - { - var square = window.GetInnerSquare(); - - Label label = new Label(window) - { - Text = "Panel as Scrollable", - AlignmentX = -1, - WeightX = 1, - Geometry = new Rect(square.X, square.Y, square.Width, square.Height / 6) - }; - label.Show(); - - Panel panel = new Panel(window) - { - Direction = PanelDirection.Left, - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - Geometry = new Rect(square.X, square.Y + square.Height / 6, square.Width, square.Height / 5 * 2) - }; - panel.SetScrollable(true); - panel.SetScrollableArea(1.0); - - Rectangle redbox = new Rectangle(window) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - Color = Color.Red, - Geometry = new Rect(square.X, square.Y + square.Height / 6, square.Width / 2, square.Height / 5 * 2) - }; - redbox.Show(); - panel.SetContent(redbox); - panel.Show(); - panel.IsOpen = true; - - Button button1 = new Button(window) - { - Text = "Toggle open", - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - Geometry = new Rect(square.X, square.Y + square.Height / 6 + square.Height / 5 * 2 + 5, square.Width, square.Height / 5) - }; - Button button2 = new Button(window) - { - Text = "Toggle direction", - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - Geometry = new Rect(square.X, square.Y + square.Height / 6 + square.Height / 5 * 3 + 5, square.Width, square.Height / 5) - }; - button1.Show(); - button2.Show(); - - button1.Clicked += (s, e) => - { - panel.Toggle(); - }; - button2.Clicked += (s, e) => - { - panel.Direction = (PanelDirection)((int)(panel.Direction + 1) % 4); - }; - panel.Toggled += (s, e) => - { - Console.WriteLine("Panel Toggled!"); - }; - } - - } -} diff --git a/test/ElmSharp.Test/TC/Wearable/PanesTest1.cs b/test/ElmSharp.Test/TC/Wearable/PanesTest1.cs deleted file mode 100644 index 1e4463be6..000000000 --- a/test/ElmSharp.Test/TC/Wearable/PanesTest1.cs +++ /dev/null @@ -1,89 +0,0 @@ -/* - * 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 ElmSharp; - -namespace ElmSharp.Test.Wearable -{ - public class PanesTest1 : WearableTestCase - { - public override string TestName => "PanesTest1"; - public override string TestDescription => "To test basic operation of Panes"; - - public override void Run(Window window) - { - Conformant conformant = new Conformant(window); - conformant.Show(); - Box box = new Box(window); - conformant.SetContent(box); - box.Show(); - - Rectangle redBox = new Rectangle(window) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - Color = Color.Red, - }; - redBox.Show(); - Rectangle blueBox = new Rectangle(window) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - Color = Color.Blue, - }; - Rectangle greenBox = new Rectangle(window) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - Color = Color.Green, - }; - Panes subPanes = new Panes(window) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - Proportion = 0.3, - IsHorizontal = false - }; - subPanes.Show(); - subPanes.SetPartContent("left", blueBox); - subPanes.SetPartContent("right", greenBox); - Panes panes = new Panes(window) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - Proportion = 0.1, - IsFixed = true, - IsHorizontal = true, - }; - panes.SetPartContent("left", redBox); - panes.SetPartContent("right", subPanes); - panes.Show(); - box.PackEnd(panes); - } - - } -} diff --git a/test/ElmSharp.Test/TC/Wearable/PerformanceTest.cs b/test/ElmSharp.Test/TC/Wearable/PerformanceTest.cs deleted file mode 100644 index 3347aa9e2..000000000 --- a/test/ElmSharp.Test/TC/Wearable/PerformanceTest.cs +++ /dev/null @@ -1,209 +0,0 @@ -/* - * 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 ElmSharp; - -namespace ElmSharp.Test.Wearable -{ - public class PerformanceTest : WearableTestCase - { - public override string TestName => "PerformanceTest"; - public override string TestDescription => "To test Performance of GenList"; - - const int TestItemMax = 2000; - const double TimeSet = 5.0; - - string[] arrLabel = { - "Time Warner Cable(Cable)", - "ComCast (Cable)", - "Dish (Satellite)", - "DirecTV (Satellite)", - "Tata Sky (Satellite)", - "Nextra Cable(Cable)", - "DD Plus (Cable)", - "Tikona Cable(Cable)", - "True Provider (Cable)", - "Vodafone (Satellite)", - "Sample Text" - }; - - GenList list; - Box box; - Box box2; - GenListItem ItemTarget = null; - double _enteringSpeed = 0; - int _frameCount = 0; - int _ecoreCount = 0; - double _frameSet = 0; - IntPtr _anim = IntPtr.Zero; - double FrameFPS = 0; - double AnimatorFPS = 0; - Rect square; - - public override void Run(Window window) - { - Conformant conformant = new Conformant(window); - conformant.Show(); - - square = window.GetInnerSquare(); - - Naviframe navi = new Naviframe(window) - { - PreserveContentOnPop = true, - DefaultBackButtonEnabled = true, - Geometry = square - }; - - box = new Box(window) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - Geometry = new Rect(square.X, square.Y, square.Width, square.Height) - }; - box.Show(); - - box2 = new Box(box); - box2.Geometry = new Rect(square.X, square.Y + square.Height/6, square.Width, square.Height/2); - box2.Show(); - box.PackEnd(box2); - - list = new GenList(window) - { - Homogeneous = true, - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - Style = "solid/default" - }; - box.PackEnd(list); - navi.Push(box, "Performance"); - - InitializeListItem(); - - list.Changed += List_Changed; - list.ScrollAnimationStarted += List_ScrollAnimationStarted; - list.ScrollAnimationStopped += List_ScrollAnimationStopped; - list.Show(); - - navi.Show(); - conformant.SetContent(navi); - } - - private void InitializeListItem() - { - GenItemClass defaultClass = new GenItemClass("default") - { - GetTextHandler = (obj, part) => - { - return (string)obj; - } - }; - - for (int i = 0; i < TestItemMax; ++i) - { - if (i == 999) - ItemTarget = list.Append(defaultClass, new string(arrLabel[i % 10].ToCharArray())); - else - list.Append(defaultClass, new string(arrLabel[i % 10].ToCharArray())); - } - } - - private void List_ScrollAnimationStopped(object sender, EventArgs e) - { - list.RenderPost -= List_RenderPostFrame; - list.ScrollAnimationStarted -= List_ScrollAnimationStarted; - list.ScrollAnimationStopped -= List_ScrollAnimationStopped; - - EcoreAnimator.RemoveAnimator(_anim); - Elementary.BringInScrollFriction = _frameSet; - - FrameFPS = _frameCount / TimeSet; - AnimatorFPS = _ecoreCount / TimeSet; - - Button btn1 = new Button(box2) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - Geometry = new Rect(square.X, square.Y, square.Width, square.Height / 3) - }; - btn1.Text = string.Format("Entering Speed : {0:f1} msec", _enteringSpeed); - btn1.Show(); - - Button btn2 = new Button(box2) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - Geometry = new Rect(square.X, square.Y+ square.Height / 3, square.Width, square.Height / 3) - }; - btn2.Text = string.Format("Animator FPS : {0:f1} fps", AnimatorFPS); - btn2.Show(); - - Button btn3 = new Button(box2) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - Geometry = new Rect(square.X, square.Y + square.Height / 3*2, square.Width, square.Height / 3) - }; - btn3.Text = string.Format("Evas FPS : {0:f1} fps", FrameFPS); - btn3.Show(); - } - - private void List_RenderPost(object sender, EventArgs e) - { - list.RenderPost -= List_RenderPost; - _enteringSpeed = (EcoreAnimator.GetCurrentTime() - _enteringSpeed) * 1000; - - _frameSet = Elementary.BringInScrollFriction; - Elementary.BringInScrollFriction = TimeSet; - list.ScrollTo(ItemTarget, ScrollToPosition.In, true); - } - - private void List_ScrollAnimationStarted(object sender, EventArgs e) - { - _ecoreCount = 0; - _anim = EcoreAnimator.AddAnimator(OnEcoreCheck); - list.RenderPost += List_RenderPostFrame; - } - - private bool OnEcoreCheck() - { - _ecoreCount++; - return true; - } - - private void List_RenderPostFrame(object sender, EventArgs e) - { - _frameCount++; - } - - private void List_Changed(object sender, EventArgs e) - { - _enteringSpeed = EcoreAnimator.GetCurrentTime(); - list.Changed -= List_Changed; - list.RenderPost += List_RenderPost; - } - } -} \ No newline at end of file diff --git a/test/ElmSharp.Test/TC/Wearable/PolygonTest1.cs b/test/ElmSharp.Test/TC/Wearable/PolygonTest1.cs deleted file mode 100644 index 7f6a4e00c..000000000 --- a/test/ElmSharp.Test/TC/Wearable/PolygonTest1.cs +++ /dev/null @@ -1,66 +0,0 @@ -/* - * 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 ElmSharp; - -namespace ElmSharp.Test.Wearable -{ - class PolygonTest1 : WearableTestCase - { - public override string TestName => "PolygonTest1"; - public override string TestDescription => "To test basic operation of Polygon"; - - public override void Run(Window window) - { - var square = window.GetInnerSquare(); - Background bg = new Background(window); - bg.Color = Color.White; - bg.Move(0, 0); - bg.Resize(window.ScreenSize.Width, window.ScreenSize.Height); - bg.Show(); - - Polygon triangle1 = new Polygon(window); - triangle1.Color = Color.Blue; - triangle1.AddPoint(square.X, square.Y + square.Height/6); - triangle1.AddPoint(square.X, square.Y + square.Height/3); - triangle1.AddPoint(square.X + square.Width/2, square.Y + square.Height/5); - triangle1.Show(); - - Polygon triange2 = new Polygon(window); - triange2.AddPoint(square.X + square.Width/2, square.Y + square.Height/5); - triange2.AddPoint(new Point{X= square.X + square.Width, Y= square.Y + square.Height/5 }); - triange2.AddPoint(new Point{X= square.X + square.Width, Y= square.Y + square.Height/3 }); - triange2.Color = Color.Green; - triange2.Show(); - - Polygon hexagon = new Polygon(window); - hexagon.Color = Color.Pink; - hexagon.AddPoint(square.X, square.Y); - hexagon.AddPoint(square.X + square.Width, square.Y); - hexagon.ClearPoints(); - for (double a=0; a < 2 * Math.PI; a += Math.PI / 3) - { - hexagon.AddPoint( - square.X + square.Width/2 + (int)(120 * Math.Sin(a)), - square.Y + square.Height/2+square.Height/6 + (int)(120 * Math.Cos(a)) - ); - } - hexagon.Show(); - } - - } -} diff --git a/test/ElmSharp.Test/TC/Wearable/PopupTest1.cs b/test/ElmSharp.Test/TC/Wearable/PopupTest1.cs deleted file mode 100644 index 75080ea88..000000000 --- a/test/ElmSharp.Test/TC/Wearable/PopupTest1.cs +++ /dev/null @@ -1,99 +0,0 @@ -/* - * 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 ElmSharp; - -namespace ElmSharp.Test.Wearable -{ - public class PopupTest1 : WearableTestCase - { - public override string TestName => "PopupTest1"; - public override string TestDescription => "To test basic operation of Popup"; - - public override void Run(Window window) - { - Conformant conformant = new Conformant(window); - conformant.Show(); - Box box = new Box(window); - box.Show(); - Button btn = new Button(window) - { - AlignmentX = -1, - WeightX = 1, - Text = "Open" - }; - btn.Show(); - - Popup popup = new Popup(window) - { - Orientation = PopupOrientation.Bottom, - Timeout = 5, - }; - - popup.Dismissed += (s, e) => - { - Console.WriteLine("Popup dismissed"); - }; - - popup.ShowAnimationFinished += (s, e) => - { - Console.WriteLine("Popup show animation finished"); - }; - - popup.OutsideClicked += (s, e) => - { - Console.WriteLine("Popup outside clicked"); - }; - - popup.TimedOut += (s, e) => - { - Console.WriteLine("Popup time out"); - }; - - popup.Append("Label1"); - popup.Append("Label2"); - popup.Append("Label3"); - - popup.BackButtonPressed += (s, e) => - { - Console.WriteLine("!!! BackButtonPressed Event on Popup!!"); - popup.Hide(); - }; - - btn.Clicked += (s, e) => - { - popup.Show(); - }; - - Button close = new Button(popup) - { - AlignmentX = -1, - WeightX = 1, - Text = "Close" - }; - popup.SetPartContent("button1", close); - - close.Clicked += (s, e) => - { - popup.Hide(); - }; - - box.PackEnd(btn); - conformant.SetContent(box); - } - } -} diff --git a/test/ElmSharp.Test/TC/Wearable/ProgressBarTest1.cs b/test/ElmSharp.Test/TC/Wearable/ProgressBarTest1.cs deleted file mode 100755 index 1a4184ea1..000000000 --- a/test/ElmSharp.Test/TC/Wearable/ProgressBarTest1.cs +++ /dev/null @@ -1,158 +0,0 @@ -/* - * 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. - */ - -namespace ElmSharp.Test.Wearable -{ - class ProgressBarTest1 : WearableTestCase - { - public override string TestName => "ProgressBarTest1"; - public override string TestDescription => "To test basic operation of ProgressBar"; - - public override void Run(Window window) - { - Conformant conformant = new Conformant(window); - conformant.Show(); - Table table = new Table(window); - conformant.SetContent(table); - table.Show(); - - ProgressBar pb1 = new ProgressBar(window) - { - Text = "ProgressBar Test", - UnitFormat = "%.0f %%", - Value = 0.1, - AlignmentX = -1, - AlignmentY = 0, - WeightX = 1, - WeightY = 1 - }; - - Label lb1 = new Label(window) - { - AlignmentX = -1, - AlignmentY = 0, - WeightX = 1, - WeightY = 1 - }; - - Label lb2 = new Label(window) - { - AlignmentX = -1, - AlignmentY = 0, - WeightX = 1, - WeightY = 1 - }; - - Button bt1 = new Button(window) - { - Text = "Increase Value", - AlignmentX = -1, - AlignmentY = 0, - WeightX = 1, - WeightY = 1 - }; - - Button bt2 = new Button(window) - { - Text = "Decrease Value", - AlignmentX = -1, - AlignmentY = 0, - WeightX = 1, - WeightY = 1 - }; - - Button bt3 = new Button(window) - { - Text = "Increase PartValue", - AlignmentX = -1, - AlignmentY = 0, - WeightX = 1, - WeightY = 1 - }; - - Button bt4 = new Button(window) - { - Text = "Decrease PartValue", - AlignmentX = -1, - AlignmentY = 0, - WeightX = 1, - WeightY = 1 - }; - - string part = "elm.cur.progressbar"; - double unit = 0.1; - double max = 1.0; - double min = 0; - - pb1.ValueChanged += (s, e) => - { - lb1.Text = string.Format("Value Changed: {0}", pb1.Value); - lb1.EdjeObject["elm.text"].TextStyle = "DEFAULT='color=#ffffff'"; - - lb2.Text = string.Format("PartValue Changed: {0}", pb1.GetPartValue(part)); - lb2.EdjeObject["elm.text"].TextStyle = "DEFAULT='color=#ffffff'"; - }; - - bt1.Clicked += (s, e) => - { - var val = pb1.Value + unit; - if (val <= max) - pb1.Value = val; - }; - - bt2.Clicked += (s, e) => - { - var val = pb1.Value - unit; - if (val >= min) - { - pb1.Value = val; - } - }; - - bt3.Clicked += (s, e) => - { - var val = pb1.GetPartValue(part) + unit; - if (val <= max) - pb1.SetPartValue(part, val); - }; - - bt4.Clicked += (s, e) => - { - var val = pb1.GetPartValue(part) - unit; - if (val >= min) - { - pb1.SetPartValue(part, val); - } - }; - - table.Pack(bt1, 1, 1, 1, 1); - table.Pack(bt2, 2, 1, 1, 1); - table.Pack(pb1, 1, 2, 2, 1); - table.Pack(lb1, 1, 3, 2, 1); - table.Pack(lb2, 1, 4, 2, 1); - table.Pack(bt3, 1, 5, 1, 1); - table.Pack(bt4, 2, 5, 1, 1); - - pb1.Show(); - lb1.Show(); - lb2.Show(); - bt1.Show(); - bt2.Show(); - bt3.Show(); - bt4.Show(); - } - } -} \ No newline at end of file diff --git a/test/ElmSharp.Test/TC/Wearable/ProgressBarTest2.cs b/test/ElmSharp.Test/TC/Wearable/ProgressBarTest2.cs deleted file mode 100755 index c91cb09f5..000000000 --- a/test/ElmSharp.Test/TC/Wearable/ProgressBarTest2.cs +++ /dev/null @@ -1,80 +0,0 @@ -/* - * 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. - */ - - -namespace ElmSharp.Test.Wearable -{ - class ProgressBarTest2 : WearableTestCase - { - public override string TestName => "ProgressBarTest2"; - public override string TestDescription => "To test basic operation of ProgressBar"; - - public override void Run(Window window) - { - Conformant conformant = new Conformant(window); - conformant.Show(); - Scroller scroller = new Scroller(window) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - ScrollBlock = ScrollBlock.None, - }; - scroller.Show(); - conformant.SetContent(scroller); - - Box box = new Box(window) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1 - }; - box.Show(); - scroller.SetContent(box); - - ProgressBar pb1 = new ProgressBar(window) - { - Text = "ProgressBar Test", - Style = "process", - Value = 0.1, - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1 - }; - pb1.PlayPulse(); - pb1.Show(); - - ProgressBar pb2 = new ProgressBar(window) - { - Text = "ProgressBar Test", - Style = "process/small", - Value = 0.1, - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1 - }; - pb2.PlayPulse(); - pb2.Show(); - - box.PackEnd(pb1); - box.PackEnd(pb2); - } - } -} \ No newline at end of file diff --git a/test/ElmSharp.Test/TC/Wearable/RadioTest1.cs b/test/ElmSharp.Test/TC/Wearable/RadioTest1.cs deleted file mode 100755 index abdec2b7c..000000000 --- a/test/ElmSharp.Test/TC/Wearable/RadioTest1.cs +++ /dev/null @@ -1,99 +0,0 @@ -/* - * 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.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace ElmSharp.Test.Wearable -{ - class RadioTest1 : WearableTestCase - { - public override string TestName => "RadioTest1"; - public override string TestDescription => "To test basic operation of Radio"; - - Label _lb1; - - public override void Run(Window window) - { - Conformant conformant = new Conformant(window); - conformant.Show(); - Box box = new Box(window); - conformant.SetContent(box); - box.Show(); - - Radio rd1 = new Radio(window) - { - StateValue = 1, - Text = "Value #1", - AlignmentX = -1, - AlignmentY = 0, - WeightX = 1, - WeightY = 1 - }; - Radio rd2 = new Radio(window) - { - StateValue = 2, - Text = "Value #2", - AlignmentX = -1, - AlignmentY = 0, - WeightX = 1, - WeightY = 1 - }; - Radio rd3 = new Radio(window) - { - StateValue = 3, - Text = "Value #3", - AlignmentX = -1, - AlignmentY = 0, - WeightX = 1, - WeightY = 1 - }; - rd2.SetGroup(rd1); - rd3.SetGroup(rd2); - - rd1.ValueChanged += OnRadioValueChanged; - rd2.ValueChanged += OnRadioValueChanged; - rd3.ValueChanged += OnRadioValueChanged; - - _lb1 = new Label(window) - { - AlignmentX = -1, - AlignmentY = 0, - WeightX = 1, - WeightY = 1 - }; - - box.PackEnd(_lb1); - box.PackEnd(rd1); - box.PackEnd(rd2); - box.PackEnd(rd3); - - _lb1.Show(); - rd1.Show(); - rd2.Show(); - rd3.Show(); - } - - void OnRadioValueChanged(object sender, EventArgs e) - { - _lb1.Text = string.Format("Value Changed: {0}", ((Radio)sender).GroupValue); - _lb1.EdjeObject["elm.text"].TextStyle = "DEFAULT='color=#ffffff'"; - } - } -} diff --git a/test/ElmSharp.Test/TC/Wearable/RectangleTest1.cs b/test/ElmSharp.Test/TC/Wearable/RectangleTest1.cs deleted file mode 100755 index a0696a589..000000000 --- a/test/ElmSharp.Test/TC/Wearable/RectangleTest1.cs +++ /dev/null @@ -1,46 +0,0 @@ -/* - * 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 ElmSharp; - -namespace ElmSharp.Test.Wearable -{ - class RectangleTest1 : WearableTestCase - { - public override string TestName => "RectangleTest1"; - public override string TestDescription => "Add one Red Rectangle and one Orange Rectangle"; - - public override void Run(Window window) - { - Rect square = window.GetInnerSquare(); - Rectangle box1 = new Rectangle(window) - { - Color = Color.Red - }; - box1.Show(); - box1.Resize(square.Width / 2, square.Height / 2); - box1.Move(square.X, square.Y); - Rectangle box2 = new Rectangle(window) - { - Color = Color.Orange - }; - box2.Show(); - box2.Resize(square.Width / 2, square.Height / 2); - box2.Move(square.X + square.Width / 2, square.Y + square.Height / 2); - } - } -} diff --git a/test/ElmSharp.Test/TC/Wearable/ScreenInformationTest.cs b/test/ElmSharp.Test/TC/Wearable/ScreenInformationTest.cs deleted file mode 100755 index 92ac97cc3..000000000 --- a/test/ElmSharp.Test/TC/Wearable/ScreenInformationTest.cs +++ /dev/null @@ -1,45 +0,0 @@ -/* - * 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. - */ - -namespace ElmSharp.Test.Wearable -{ - public class ScreenInformationTest : WearableTestCase - { - public override string TestName => "ScreenInformationTest"; - public override string TestDescription => "To get screen information"; - - public override void Run(Window window) - { - Conformant conformant = new Conformant(window); - conformant.Show(); - Box box = new Box(window); - box.Show(); - conformant.SetContent(box); - Label label = new Label(window); - label.SetAlignment(-1, 0); - label.SetWeight(1, 0); - label.Text = string.Format("ScreenSize : {0}x{1}", window.ScreenSize.Width, window.ScreenSize.Height); - label.Show(); - box.PackEnd(label); - Label label2 = new Label(window); - label2.SetAlignment(-1, 0); - label2.SetWeight(1, 0); - label2.Text = string.Format("ScreenDPI : xdpi : {0} ydpi : {1}", window.ScreenDpi.X, window.ScreenDpi.Y); - label2.Show(); - box.PackEnd(label2); - } - } -} diff --git a/test/ElmSharp.Test/TC/Wearable/ScrollerTest1.cs b/test/ElmSharp.Test/TC/Wearable/ScrollerTest1.cs deleted file mode 100755 index 5d364ff9b..000000000 --- a/test/ElmSharp.Test/TC/Wearable/ScrollerTest1.cs +++ /dev/null @@ -1,79 +0,0 @@ -/* - * 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 ElmSharp.Test.Wearable -{ - public class ScrollerTest1 : WearableTestCase - { - public override string TestName => "ScrollerTest1"; - public override string TestDescription => "To test basic operation of Scroller"; - - public override void Run(Window window) - { - Conformant conformant = new Conformant(window); - conformant.Show(); - Scroller scroller = new Scroller(window) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - ScrollBlock = ScrollBlock.None, - }; - scroller.Show(); - conformant.SetContent(scroller); - - Box box = new Box(window) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1 - }; - box.Show(); - scroller.SetContent(box); - - var rnd = new Random(); - for (int i = 0; i < 102; i++) - { - int r = rnd.Next(255); - int g = rnd.Next(255); - int b = rnd.Next(255); - Color color = Color.FromRgb(r, g, b); - Rectangle colorBox = new Rectangle(window) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - Color = color, - MinimumHeight = 400, - }; - colorBox.Show(); - Console.WriteLine("Height = {0}", colorBox.Geometry.Height); - box.PackEnd(colorBox); - } - scroller.Scrolled += Scroller_Scrolled; - } - - private void Scroller_Scrolled(object sender, EventArgs e) - { - Console.WriteLine("Scrolled : {0}x{1}", ((Scroller)sender).CurrentRegion.X, ((Scroller)sender).CurrentRegion.Y); - } - } -} diff --git a/test/ElmSharp.Test/TC/Wearable/ScrollerTest2.cs b/test/ElmSharp.Test/TC/Wearable/ScrollerTest2.cs deleted file mode 100755 index adf2b72ad..000000000 --- a/test/ElmSharp.Test/TC/Wearable/ScrollerTest2.cs +++ /dev/null @@ -1,134 +0,0 @@ -/* - * 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 ElmSharp.Test.Wearable -{ - public class ScrollerTest2 : WearableTestCase - { - public override string TestName => "ScrollerTest2"; - public override string TestDescription => "To test basic operation of Scroller"; - - public override void Run(Window window) - { - Conformant conformant = new Conformant(window); - conformant.Show(); - Box outterBox = new Box(window) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - IsHorizontal = false, - }; - outterBox.Show(); - Scroller scroller = new Scroller(window) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - ScrollBlock = ScrollBlock.Vertical, - HorizontalPageScrollLimit = 1, - }; - scroller.SetPageSize(1.0, 1.0); - scroller.Show(); - - Box box = new Box(window) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - IsHorizontal = true, - }; - box.Show(); - scroller.SetContent(box); - - var rnd = new Random(); - for (int i = 0; i < 102; i++) - { - int r = rnd.Next(255); - int g = rnd.Next(255); - int b = rnd.Next(255); - Color color = Color.FromRgb(r, g, b); - Rectangle colorBox = new Rectangle(window) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - Color = color, - MinimumWidth = window.ScreenSize.Width, - }; - colorBox.Show(); - Console.WriteLine("Height = {0}", colorBox.Geometry.Height); - box.PackEnd(colorBox); - } - - conformant.SetContent(outterBox); - outterBox.PackEnd(scroller); - - Box buttonBox = new Box(window) - { - IsHorizontal = true, - AlignmentX = -1, - AlignmentY = 0, - }; - buttonBox.Show(); - - Button prev = new Button(window) - { - AlignmentX = -1, - WeightX = 1, - Text = "Prev" - }; - Button next = new Button(window) - { - AlignmentX = -1, - WeightX = 1, - Text = "next" - }; - prev.Clicked += (s, e) => - { - scroller.ScrollTo(scroller.HorizontalPageIndex > 0 ? scroller.HorizontalPageIndex - 1: 0, scroller.VerticalPageIndex, true); - }; - next.Clicked += (s, e) => - { - scroller.ScrollTo(scroller.HorizontalPageIndex + 1, scroller.VerticalPageIndex, true); - }; - prev.Show(); - next.Show(); - buttonBox.PackEnd(prev); - buttonBox.PackEnd(next); - outterBox.PackEnd(buttonBox); - - scroller.DragStart += Scroller_DragStart; - scroller.DragStop += Scroller_DragStop; - } - - private void Scroller_DragStop(object sender, EventArgs e) - { - Console.WriteLine("Drag stop"); - } - - private void Scroller_DragStart(object sender, EventArgs e) - { - Console.WriteLine("Drag start"); - } - } -} diff --git a/test/ElmSharp.Test/TC/Wearable/ScrollerTest3.cs b/test/ElmSharp.Test/TC/Wearable/ScrollerTest3.cs deleted file mode 100755 index 5b403dd48..000000000 --- a/test/ElmSharp.Test/TC/Wearable/ScrollerTest3.cs +++ /dev/null @@ -1,130 +0,0 @@ -/* - * 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 ElmSharp.Test.Wearable -{ - public class ScrollerTest3 : WearableTestCase - { - public override string TestName => "ScrollerTest3"; - public override string TestDescription => "To test ScrollTo operation of Scroller"; - - public override void Run(Window window) - { - Conformant conformant = new Conformant(window); - conformant.Show(); - Box outterBox = new Box(window) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - IsHorizontal = false, - }; - outterBox.Show(); - Scroller scroller = new Scroller(window) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - ScrollBlock = ScrollBlock.Vertical, - HorizontalPageScrollLimit = 1, - }; - scroller.SetPageSize(1.0, 1.0); - scroller.Show(); - - Box box = new Box(window) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1 - }; - box.Show(); - scroller.SetContent(box); - - for (int i = 0; i < 30; i++) - { - Label addlabel = new Label(window) - { - Text = i + " Label Test", - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - }; - addlabel.Show(); - box.PackEnd(addlabel); - } - - conformant.SetContent(outterBox); - outterBox.PackEnd(scroller); - - Box buttonBox = new Box(window) - { - IsHorizontal = true, - AlignmentX = -1, - AlignmentY = 0, - }; - buttonBox.Show(); - - Button prev = new Button(window) - { - AlignmentX = -1, - WeightX = 1, - Text = "Prev" - }; - Button next = new Button(window) - { - AlignmentX = -1, - WeightX = 1, - Text = "next" - }; - prev.Clicked += (s, e) => - { - Rect region = new Rect(0, 0, scroller.Geometry.Width, scroller.Geometry.Width); - Console.WriteLine("{0} {1}\n", scroller.Geometry.Width, scroller.Geometry.Width); - scroller.ScrollTo(region, true); - }; - next.Clicked += (s, e) => - { - Rect region = new Rect(0, scroller.Geometry.Height, scroller.Geometry.Width, scroller.Geometry.Height); - Console.WriteLine("{0} {1}\n", scroller.Geometry.Width, scroller.Geometry.Width); - scroller.ScrollTo(region, true); - }; - prev.Show(); - next.Show(); - buttonBox.PackEnd(prev); - buttonBox.PackEnd(next); - outterBox.PackEnd(buttonBox); - - scroller.DragStart += Scroller_DragStart; - scroller.DragStop += Scroller_DragStop; - } - - private void Scroller_DragStop(object sender, EventArgs e) - { - Console.WriteLine("Drag stop"); - } - - private void Scroller_DragStart(object sender, EventArgs e) - { - Console.WriteLine("Drag start"); - } - } -} diff --git a/test/ElmSharp.Test/TC/Wearable/SliderTest1.cs b/test/ElmSharp.Test/TC/Wearable/SliderTest1.cs deleted file mode 100755 index 40342b18a..000000000 --- a/test/ElmSharp.Test/TC/Wearable/SliderTest1.cs +++ /dev/null @@ -1,166 +0,0 @@ -/* - * 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. - */ - -namespace ElmSharp.Test.Wearable -{ - class SliderTest1 : WearableTestCase - { - public override string TestName => "SliderTest1"; - public override string TestDescription => "To test basic operation of Slider"; - - public override void Run(Window window) - { - Conformant conformant = new Conformant(window); - conformant.Show(); - Box box = new Box(window) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - IsHorizontal = false, - }; - box.Show(); - conformant.SetContent(box); - - Slider sld1 = new Slider(window) - { - Text = "Slider Test", - IndicatorFormat = "%1.2f meters", - Minimum = 0.0, - Maximum = 100.0, - Value = 0.1, - AlignmentX = -1, - AlignmentY = 0.5, - WeightX = 1, - WeightY = 1, - IsIndicatorFocusable = true - }; - - Label lb1 = new Label(window) - { - AlignmentX = -1, - AlignmentY = 1, - WeightX = 1, - WeightY = 1 - }; - - Label lb2 = new Label(window) - { - AlignmentX = -1, - AlignmentY = 1, - WeightX = 1, - WeightY = 1, - Text = string.Format("IsIndicatorFocusable : {0}", sld1.IsIndicatorFocusable.ToString()), - }; - - Label lb3 = new Label(window) - { - AlignmentX = -1, - AlignmentY = 1, - WeightX = 1, - WeightY = 1, - Text = string.Format("IndicatorVisibleMode : {0}", sld1.IndicatorVisibleMode.ToString()), - }; - - Box buttonBox = new Box(window) - { - IsHorizontal = true, - AlignmentX = -1, - AlignmentY = 0, - }; - buttonBox.Show(); - - Button btn = new Button(window) - { - AlignmentX = -1, - AlignmentY = 0, - WeightX = 1, - WeightY = 1, - Text = "IsIndicatorFocusable" - }; - btn.Clicked += (s, e) => - { - if (sld1.IsIndicatorFocusable) - { - sld1.IsIndicatorFocusable = false; - } - else - { - sld1.IsIndicatorFocusable = true; - } - lb2.Text = string.Format("IsIndicatorFocusable : {0}", sld1.IsIndicatorFocusable.ToString()); - lb2.EdjeObject["elm.text"].TextStyle = "DEFAULT='color=#ffffff'"; - }; - - Button btn2 = new Button(window) - { - AlignmentX = -1, - AlignmentY = 0, - WeightX = 1, - WeightY = 1, - Text = "IndicatorVisibleMode" - }; - btn2.Clicked += (s, e) => - { - if (sld1.IndicatorVisibleMode == SliderIndicatorVisibleMode.Default) - { - sld1.IndicatorVisibleMode = SliderIndicatorVisibleMode.Always; - } - else if (sld1.IndicatorVisibleMode == SliderIndicatorVisibleMode.Always) - { - sld1.IndicatorVisibleMode = SliderIndicatorVisibleMode.OnFocus; - } - else if (sld1.IndicatorVisibleMode == SliderIndicatorVisibleMode.OnFocus) - { - sld1.IndicatorVisibleMode = SliderIndicatorVisibleMode.None; - } - else - { - sld1.IndicatorVisibleMode = SliderIndicatorVisibleMode.Default; - } - - lb3.Text = string.Format("IndicatorVisibleMode : {0}", sld1.IndicatorVisibleMode.ToString()); - lb3.EdjeObject["elm.text"].TextStyle = "DEFAULT='color=#ffffff'"; - }; - - sld1.Show(); - lb1.Show(); - lb2.Show(); - lb3.Show(); - btn.Show(); - btn2.Show(); - - buttonBox.PackEnd(btn); - buttonBox.PackEnd(btn2); - - box.PackEnd(lb1); - box.PackEnd(lb2); - box.PackEnd(lb3); - box.PackEnd(sld1); - box.PackEnd(buttonBox); - - lb2.EdjeObject["elm.text"].TextStyle = "DEFAULT='color=#ffffff'"; - lb3.EdjeObject["elm.text"].TextStyle = "DEFAULT='color=#ffffff'"; - - sld1.ValueChanged += (s, e) => - { - lb1.Text = string.Format("Value Changed: {0}", sld1.Value); - lb1.EdjeObject["elm.text"].TextStyle = "DEFAULT='color=#ffffff'"; - }; - } - } -} \ No newline at end of file diff --git a/test/ElmSharp.Test/TC/Wearable/SliderTest2.cs b/test/ElmSharp.Test/TC/Wearable/SliderTest2.cs deleted file mode 100755 index fa9aca723..000000000 --- a/test/ElmSharp.Test/TC/Wearable/SliderTest2.cs +++ /dev/null @@ -1,147 +0,0 @@ -/* - * 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. - */ - - -namespace ElmSharp.Test.Wearable -{ - class SliderTest2 : WearableTestCase - { - public override string TestName => "SliderTest2"; - public override string TestDescription => "To test basic operation of Slider"; - - public override void Run(Window window) - { - Conformant conformant = new Conformant(window); - conformant.Show(); - Box box = new Box(window) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - IsHorizontal = false, - }; - box.Show(); - conformant.SetContent(box); - - Slider sld = new Slider(window) - { - Text = "Slider Test", - IndicatorFormat = "%1.2f meters", - Minimum = 0.0, - Maximum = 100.0, - Value = 0.1, - AlignmentX = -1, - AlignmentY = 0.5, - WeightX = 1, - WeightY = 1, - IsIndicatorFocusable = true - }; - - Label Emptylb = new Label(window) - { - AlignmentX = -1, - AlignmentY = 0, - WeightX = 1, - WeightY = 1, - Text=" " - }; - - Label lb1 = new Label(window) - { - AlignmentX = -1, - AlignmentY = 0, - WeightX = 1, - WeightY = 1, - Text = string.Format("IndicatorVisibleMode={0}", sld.IndicatorVisibleMode.ToString()), - }; - lb1.EdjeObject["elm.text"].TextStyle = "DEFAULT='color=#ffffff'"; - - Label lb2 = new Label(window) - { - AlignmentX = -1, - AlignmentY = 0, - WeightX = 1, - WeightY = 1, - Text = string.Format("IsIndicatorVisible={0}", sld.IsIndicatorVisible.ToString()), - }; - lb2.EdjeObject["elm.text"].TextStyle = "DEFAULT='color=#ffffff'"; - - Box buttonBox = new Box(window) - { - IsHorizontal = true, - AlignmentX = -1, - AlignmentY = 0, - }; - buttonBox.Show(); - - Button btn1 = new Button(window) - { - AlignmentX = -1, - AlignmentY = 0, - WeightX = 1, - WeightY = 1, - Text = "IndicatorVisibleMode" - }; - btn1.Clicked += (s, e) => - { - sld.IndicatorVisibleMode = (SliderIndicatorVisibleMode)(((int)sld.IndicatorVisibleMode + 1) % 4); - lb1.Text = string.Format("IndicatorVisibleMode={0}", sld.IndicatorVisibleMode.ToString()); - lb1.EdjeObject["elm.text"].TextStyle = "DEFAULT='color=#ffffff'"; - }; - - Button btn2 = new Button(window) - { - AlignmentX = -1, - AlignmentY = 0, - WeightX = 1, - WeightY = 1, - Text = "IsIndicatorVisible" - }; - btn2.Clicked += (s, e) => - { - sld.IsIndicatorVisible = !sld.IsIndicatorVisible; - lb2.Text = string.Format("IsIndicatorVisible={0}", sld.IsIndicatorVisible.ToString()); - lb2.EdjeObject["elm.text"].TextStyle = "DEFAULT='color=#ffffff'"; - }; - - sld.Show(); - Emptylb.Show(); - lb1.Show(); - lb2.Show(); - btn1.Show(); - btn2.Show(); - - buttonBox.PackEnd(btn1); - buttonBox.PackEnd(btn2); - - box.PackEnd(Emptylb); - box.PackEnd(lb1); - box.PackEnd(lb2); - box.PackEnd(sld); - box.PackEnd(buttonBox); - - sld.ValueChanged += (s, e) => - { - lb1.Text = string.Format("IndicatorVisibleMode={0}", sld.IndicatorVisibleMode.ToString()); - lb1.EdjeObject["elm.text"].TextStyle = "DEFAULT='color=#ffffff'"; - - lb2.Text = string.Format("IsIndicatorVisible={0}", sld.IsIndicatorVisible.ToString()); - lb2.EdjeObject["elm.text"].TextStyle = "DEFAULT='color=#ffffff'"; - }; - } - } -} \ No newline at end of file diff --git a/test/ElmSharp.Test/TC/Wearable/SpinnerTest1.cs b/test/ElmSharp.Test/TC/Wearable/SpinnerTest1.cs deleted file mode 100755 index d2cf3485d..000000000 --- a/test/ElmSharp.Test/TC/Wearable/SpinnerTest1.cs +++ /dev/null @@ -1,67 +0,0 @@ -/* - * 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 ElmSharp.Test.Wearable -{ - class SpinnerTest1 : WearableTestCase - { - public override string TestName => "SpinnerTest1"; - public override string TestDescription => "To test basic operation of Spinner"; - - public override void Run(Window window) - { - Rect square = window.GetInnerSquare(); - - Spinner spn1 = new Spinner(window) - { - Text = "Slider Test", - LabelFormat = "%1.2f Value", - Minimum = 1, - Maximum = 12, - Value = 1.5, - Step = 0.5, - Interval = 0.5, - AlignmentX = -1, - AlignmentY = 0.5, - WeightX = 1, - WeightY = 1 - }; - spn1.AddSpecialValue(5, "Five !!!!"); - - Label lb1 = new Label(window) - { - AlignmentX = -1, - AlignmentY = 0, - WeightX = 1, - WeightY = 1 - }; - - spn1.Geometry = new Rect(square.X, square.Y, square.Width , square.Height / 4); - spn1.Show(); - - lb1.Geometry = new Rect(square.X, square.Y + square.Width * 2 / 4 , square.Width, square.Height / 4); - lb1.Show(); - - spn1.ValueChanged += (s, e) => - { - lb1.Text = string.Format("Value Changed: {0}", spn1.Value); - lb1.EdjeObject["elm.text"].TextStyle = "DEFAULT='color=#ffffff'"; - }; - } - } -} diff --git a/test/ElmSharp.Test/TC/Wearable/TableTest1.cs b/test/ElmSharp.Test/TC/Wearable/TableTest1.cs deleted file mode 100644 index ce3113353..000000000 --- a/test/ElmSharp.Test/TC/Wearable/TableTest1.cs +++ /dev/null @@ -1,72 +0,0 @@ -/* - * 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 ElmSharp.Test.Wearable -{ - public class TableTest1 : WearableTestCase - { - public override string TestName => "TableTest1"; - public override string TestDescription => "To test basic operation of Table"; - - public override void Run(Window window) - { - Conformant conformant = new Conformant(window); - conformant.Show(); - Table table = new Table(window) { - PaddingX = 10, - PaddingY = 10 - }; - // table.BackgroundColor = Color.Orange; - conformant.SetContent(table); - table.Show(); - - Button button1 = new Button(window) { - Text = "Button (set Color.Oranage)", - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1 - }; - button1.Clicked += (e,o) => - { - table.BackgroundColor = Color.Orange; - Console.WriteLine("{0} Clicked! - Button's BG Color : {1}, Table's BG Color : {2}", ((Button)e).Text, ((Button)e).BackgroundColor, table.BackgroundColor); - }; - - Button button2 = new Button(window) { - Text = "Button 2 (set Color.Defalut)", - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - BackgroundColor = new Color(50, 100, 200, 75) - }; - button2.Clicked += (e, o) => - { - table.BackgroundColor = Color.Default; - Console.WriteLine("{0} Clicked! - Button's BG Color : {1}, Table's BG Color : {2}", ((Button)e).Text, ((Button)e).BackgroundColor, table.BackgroundColor); - }; - - table.Pack(button1,0,0,3,3); - table.Pack(button2,3,1,1,1); - - button1.Show(); - button2.Show(); - } - } -} diff --git a/test/ElmSharp.Test/TC/Wearable/TransitTest.cs b/test/ElmSharp.Test/TC/Wearable/TransitTest.cs deleted file mode 100755 index 36d41f3a3..000000000 --- a/test/ElmSharp.Test/TC/Wearable/TransitTest.cs +++ /dev/null @@ -1,90 +0,0 @@ -/* - * 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 ElmSharp; - -namespace ElmSharp.Test.Wearable -{ - class TransitTest : WearableTestCase - { - public override string TestName => "TransitTest"; - public override string TestDescription => "To test basic operation of Transit"; - - Transit CreateTransit() - { - Transit transit = new Transit(); - transit.Deleted += (s, e) => { Console.WriteLine("Transit Deleted"); }; - transit.Repeat = 1; - transit.AutoReverse = true; - transit.Duration = 1; - return transit; - } - - public override void Run(Window window) - { - Rect square = window.GetInnerSquare(); - Button button1 = new Button(window) { - Text = "Effect", - }; - button1.Move(square.X, square.Y); - button1.Resize(square.Width / 2, square.Height / 2); - button1.Show(); - - Button button2 = new Button(window) - { - Text = "Chain Effect", - }; - button2.Move(square.X + square.Width / 2, square.Y + square.Height / 2); - button2.Resize(square.Width / 2, square.Height / 2); - button2.Show(); - - Point begin = new Point(); - begin.X = begin.Y = 0; - Point end = new Point(); - end.X = end.Y = square.Height / 2; - TranslationEffect translation = new TranslationEffect(begin, end); - translation.EffectEnded += (s, e) => { Console.WriteLine("Translation Effect Ended"); }; - - RotationEffect rotation = new RotationEffect(0, 180); - rotation.EffectEnded += (s, e) => { Console.WriteLine("Rotation Effect Ended"); }; - - button1.Clicked += (s, e) => { - Transit transit1 = CreateTransit(); - transit1.Objects.Add(button1); - transit1.Objects.Add(button2); - transit1.AddEffect(translation); - transit1.AddEffect(rotation); - transit1.Go(); - }; - - button2.Clicked += (s, e) => { - Transit transit1 = CreateTransit(); - transit1.Objects.Add(button1); - transit1.AddEffect(translation); - transit1.AddEffect(rotation); - - Transit transit2 = CreateTransit(); - transit2.Objects.Add(button2); - transit2.AddEffect(translation); - transit2.AddEffect(rotation); - - transit1.Chains.Add(transit2); - transit1.Go(); - }; - } - } -} \ No newline at end of file diff --git a/test/ElmSharp.Test/TC/Wearable/WindowInternalTest.cs b/test/ElmSharp.Test/TC/Wearable/WindowInternalTest.cs deleted file mode 100755 index 2307fb565..000000000 --- a/test/ElmSharp.Test/TC/Wearable/WindowInternalTest.cs +++ /dev/null @@ -1,97 +0,0 @@ -using Tizen.Applications; -/* - * 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 ElmSharp.Test.Wearable -{ - class WindowInternalTest : WearableTestCase - { - public override string TestName => "WindowInternalTest"; - public override string TestDescription => "Window Test"; - - public override void Run(Window window) - { - var firstWindow = (Application.Current as TestRunner)?._firstPageWindow; - firstWindow.Hide(); - firstWindow.Unrealize(); - - Rect square = window.GetInnerSquare(); - - Button button1 = new Button(window) { - Text = "Iconified", - }; - button1.Resize(square.Width, square.Height / 3); - button1.Move(square.X, square.Y); - button1.Show(); - - button1.Clicked += (e, o) => - { - window.Iconified = true; - }; - - Button button2 = new Button(window) - { - Text = "WinKeyGrab", - }; - button2.Resize(square.Width, square.Height / 3); - button2.Move( square.X, square.Y + square.Height / 3); - button2.Show(); - - button2.Clicked += (e, o) => - { - Log.Debug("@@KeyGrab"); - window.KeyGrab(EvasKeyEventArgs.PlatformHomeButtonName, true); - window.WinKeyGrab(EvasKeyEventArgs.PlatformHomeButtonName, KeyGrabMode.Exclusive); - }; - - Button button3 = new Button(window) - { - Text = "WinUnKeyGrab", - }; - button3.Resize(square.Width, square.Height / 3); - button3.Move(square.X, square.Y + square.Height * 2 / 3); - button3.Show(); - - button3.Clicked += (e, o) => - { - Log.Debug("@@UnKeyGrab"); - window.WinKeyUngrab(EvasKeyEventArgs.PlatformHomeButtonName); - window.KeyUngrab(EvasKeyEventArgs.PlatformHomeButtonName); - - }; - window.KeyGrab(EvasKeyEventArgs.PlatformBackButtonName, true); - EventHandler handler = (s, e) => - { - Log.Debug("@@KeyDown start" + e.KeyName); - - if (e.KeyName == EvasKeyEventArgs.PlatformBackButtonName) - { - Application.Current.Exit(); - } - if (e.KeyName == EvasKeyEventArgs.PlatformHomeButtonName) - { - Log.Debug("@@KeyDown OK : " + window.Iconified); - window.Iconified = !window.Iconified; - } - }; - - window.KeyUp += handler; - } - - } -} diff --git a/test/ElmSharp.Test/TC/WindowInternalTest.cs b/test/ElmSharp.Test/TC/WindowInternalTest.cs deleted file mode 100644 index c238b744d..000000000 --- a/test/ElmSharp.Test/TC/WindowInternalTest.cs +++ /dev/null @@ -1,97 +0,0 @@ -using Tizen.Applications; -/* - * 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 ElmSharp; -using System.Diagnostics; - -namespace ElmSharp.Test -{ - class WindowInternalTest : TestCaseBase - { - public override string TestName => "WindowInternalTest"; - public override string TestDescription => "Window Test"; - - public override void Run(Window window) - { - var firstWindow = (Application.Current as TestRunner)?._firstPageWindow; - firstWindow.Hide(); - firstWindow.Unrealize(); - - Button button1 = new Button(window) { - Text = "Iconified", - }; - button1.Resize(window.ScreenSize.Width, 100); - button1.Move(0, 0); - button1.Show(); - - button1.Clicked += (e, o) => - { - window.Iconified = true; - }; - - Button button2 = new Button(window) - { - Text = "WinKeyGrab", - }; - button2.Resize(window.ScreenSize.Width, 100); - button2.Move(0, 100); - button2.Show(); - - button2.Clicked += (e, o) => - { - Debug.WriteLine("@@KeyGrab"); - window.KeyGrab(EvasKeyEventArgs.PlatformHomeButtonName, true); - window.WinKeyGrab(EvasKeyEventArgs.PlatformHomeButtonName, KeyGrabMode.Exclusive); - }; - - Button button3 = new Button(window) - { - Text = "WinUnKeyGrab", - }; - button3.Resize(window.ScreenSize.Width, 100); - button3.Move(0, 200); - button3.Show(); - - button3.Clicked += (e, o) => - { - Debug.WriteLine("@@UnKeyGrab"); - window.WinKeyUngrab(EvasKeyEventArgs.PlatformHomeButtonName); - window.KeyUngrab(EvasKeyEventArgs.PlatformHomeButtonName); - - }; - window.KeyGrab(EvasKeyEventArgs.PlatformBackButtonName, true); - EventHandler handler = (s, e) => - { - Debug.WriteLine("@@KeyDown start" + e.KeyName); - - if (e.KeyName == EvasKeyEventArgs.PlatformBackButtonName) - { - Application.Current.Exit(); - } - if (e.KeyName == EvasKeyEventArgs.PlatformHomeButtonName) - { - Debug.WriteLine("@@KeyDown OK : " + window.Iconified); - window.Iconified = !window.Iconified; - } - }; - - window.KeyUp += handler; - } - - } -} diff --git a/test/ElmSharp.Test/TestCaseBase.cs b/test/ElmSharp.Test/TestCaseBase.cs deleted file mode 100644 index 04987dc75..000000000 --- a/test/ElmSharp.Test/TestCaseBase.cs +++ /dev/null @@ -1,40 +0,0 @@ -/* - * 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 ElmSharp.Test -{ - [Flags] - public enum TargetProfile - { - Mobile = 1, - Tv = 2, - Wearable = 4 - } - public abstract class TestCaseBase - { - public abstract string TestName { get; } - public abstract string TestDescription { get; } - public virtual TargetProfile TargetProfile => TargetProfile.Mobile | TargetProfile.Tv; - public abstract void Run(Window window); - } - - public abstract class WearableTestCase : TestCaseBase - { - public override TargetProfile TargetProfile => TargetProfile.Wearable; - } -} diff --git a/test/ElmSharp.Test/TestRunner.cs b/test/ElmSharp.Test/TestRunner.cs deleted file mode 100644 index 315cb0b26..000000000 --- a/test/ElmSharp.Test/TestRunner.cs +++ /dev/null @@ -1,234 +0,0 @@ -/* - * 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.IO; -using System.Linq; -using System.Reflection; -using System.Collections.Generic; - -using Tizen.Applications; - -namespace ElmSharp.Test -{ - public class TestRunner : CoreUIApplication - { - internal Window _firstPageWindow; - private static bool s_terminated; - - public static string ResourceDir { get; private set; } - - public string Profile { get; set; } - - public TestRunner() - { - s_terminated = false; - } - - protected override void OnCreate() - { - ResourceDir = DirectoryInfo.Resource; - - var testCases = GetTestCases(); - CreateFirstPage(testCases); - base.OnCreate(); - } - - protected override void OnTerminate() - { - s_terminated = true; - base.OnTerminate(); - } - - public void RunStandalone(string[] args) - { - ResourceDir = Path.Combine(Path.GetDirectoryName(typeof(TestRunner).GetTypeInfo().Assembly.Location), "res"); - - EcoreSynchronizationContext.Initialize(); - - var testCases = GetTestCases(); - TestCaseBase theTest = null; - - if (args.Count() > 0) - { - theTest = testCases.Where((testCase) => testCase.TestName == args[0] || testCase.GetType().ToString() == args[0]).FirstOrDefault(); - } - - if (theTest != null) - { - StartTC(theTest); - EcoreMainloop.Begin(); - } - else - { - CreateFirstPage(testCases); - EcoreMainloop.Begin(); - } - - Elementary.Shutdown(); - } - - private IEnumerable GetTestCases() - { - Assembly asm = typeof(TestRunner).GetTypeInfo().Assembly; - Type testCaseType = typeof(TestCaseBase); - - var tests = from test in asm.GetTypes() - where testCaseType.IsAssignableFrom(test) && !test.GetTypeInfo().IsInterface && !test.GetTypeInfo().IsAbstract - select Activator.CreateInstance(test) as TestCaseBase; - - return from test in tests - orderby test.TestName - select test; - } - - internal static void UIExit() - { - EcoreMainloop.Quit(); - } - - private Window CreateWindow(bool isSecond = false) - { - Window window = new Window("ElmSharp UI Tests") - { - AvailableRotations = DisplayRotation.Degree_0 | DisplayRotation.Degree_180 | DisplayRotation.Degree_270 | DisplayRotation.Degree_90 - }; - window.Show(); - if (isSecond) - { - window.BackButtonPressed += (s, e) => - { - window.Hide(); - window.Unrealize(); - GC.Collect(); - GC.WaitForPendingFinalizers(); - }; - } - else - { - window.BackButtonPressed += (s, e) => - { - UIExit(); - }; - } - return window; - } - - private void CreateFirstPage(IEnumerable testCases) - { - _firstPageWindow = CreateWindow(); - Console.WriteLine("Screen DPI : {0}", _firstPageWindow.ScreenDpi.X); - Conformant conformant = new Conformant(_firstPageWindow); - conformant.Show(); - Box box = new Box(_firstPageWindow) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - }; - box.Show(); - var bg = new Background(_firstPageWindow); - bg.Color = Color.White; - bg.SetContent(box); - conformant.SetContent(bg); - - GenList list = new GenList(_firstPageWindow) - { - Homogeneous = true, - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1 - }; - - GenItemClass defaultClass = new GenItemClass("default") - { - GetTextHandler = (data, part) => - { - TestCaseBase tc = data as TestCaseBase; - return tc == null ? "" : tc.TestName; - } - }; - - foreach (var tc in testCases.Where((tc) => tc.TargetProfile.HasFlag(GetTargetProfile()))) - { - list.Append(defaultClass, tc); - } - - if (Profile == "wearable") - { - list.Prepend(defaultClass, null); - list.Append(defaultClass, null); - } - - list.ItemSelected += (s, e) => - { - TestCaseBase tc = e.Item.Data as TestCaseBase; - StartTCFromList(tc); - }; - list.Show(); - - box.PackEnd(list); - } - - private void StartTC(TestCaseBase tc) - { - Window window = CreateWindow(); - tc.Run(window); - } - - private void StartTCFromList(TestCaseBase tc) - { - Window window = CreateWindow(true); - tc.Run(window); - } - - private TargetProfile GetTargetProfile() - { - switch (Profile) - { - case "wearable" : - return TargetProfile.Wearable; - case "mobile" : - return TargetProfile.Mobile; - case "tv": - return TargetProfile.Tv; - } - return TargetProfile.Mobile; - } - - static void Main(string[] args) - { - Elementary.Initialize(); - Elementary.ThemeOverlay(); - - var profile = Elementary.GetProfile(); - Console.WriteLine("ELM_PROFILE : {0}", profile); - Console.WriteLine("ELM_SCALE : {0}", Elementary.GetScale()); - - TestRunner testRunner = new TestRunner(); - testRunner.Profile = profile; - testRunner.Run(args); - - // if running with appfw is failed, below line will be executed. - if (!s_terminated) - { - testRunner.RunStandalone(args); - } - } - } -} diff --git a/test/ElmSharp.Test/res/TED/app_icn_ted.png b/test/ElmSharp.Test/res/TED/app_icn_ted.png deleted file mode 100755 index ab726c817..000000000 Binary files a/test/ElmSharp.Test/res/TED/app_icn_ted.png and /dev/null differ diff --git a/test/ElmSharp.Test/res/TED/large/a.jpg b/test/ElmSharp.Test/res/TED/large/a.jpg deleted file mode 100755 index ff184399c..000000000 Binary files a/test/ElmSharp.Test/res/TED/large/a.jpg and /dev/null differ diff --git a/test/ElmSharp.Test/res/TED/large/b.jpg b/test/ElmSharp.Test/res/TED/large/b.jpg deleted file mode 100755 index e34e60b53..000000000 Binary files a/test/ElmSharp.Test/res/TED/large/b.jpg and /dev/null differ diff --git a/test/ElmSharp.Test/res/TED/large/c.jpg b/test/ElmSharp.Test/res/TED/large/c.jpg deleted file mode 100755 index ae2a56c11..000000000 Binary files a/test/ElmSharp.Test/res/TED/large/c.jpg and /dev/null differ diff --git a/test/ElmSharp.Test/res/TED/large/d.jpg b/test/ElmSharp.Test/res/TED/large/d.jpg deleted file mode 100755 index bb7d72a94..000000000 Binary files a/test/ElmSharp.Test/res/TED/large/d.jpg and /dev/null differ diff --git a/test/ElmSharp.Test/res/TED/large/e.jpg b/test/ElmSharp.Test/res/TED/large/e.jpg deleted file mode 100755 index d35a60dd6..000000000 Binary files a/test/ElmSharp.Test/res/TED/large/e.jpg and /dev/null differ diff --git a/test/ElmSharp.Test/res/TED/large/f.jpg b/test/ElmSharp.Test/res/TED/large/f.jpg deleted file mode 100755 index 238d72222..000000000 Binary files a/test/ElmSharp.Test/res/TED/large/f.jpg and /dev/null differ diff --git a/test/ElmSharp.Test/res/TED/large/g.jpg b/test/ElmSharp.Test/res/TED/large/g.jpg deleted file mode 100755 index 873c9f3fa..000000000 Binary files a/test/ElmSharp.Test/res/TED/large/g.jpg and /dev/null differ diff --git a/test/ElmSharp.Test/res/TED/thumbnail/a.jpg b/test/ElmSharp.Test/res/TED/thumbnail/a.jpg deleted file mode 100755 index 4d1659444..000000000 Binary files a/test/ElmSharp.Test/res/TED/thumbnail/a.jpg and /dev/null differ diff --git a/test/ElmSharp.Test/res/TED/thumbnail/b.jpg b/test/ElmSharp.Test/res/TED/thumbnail/b.jpg deleted file mode 100755 index f3dc3dd0d..000000000 Binary files a/test/ElmSharp.Test/res/TED/thumbnail/b.jpg and /dev/null differ diff --git a/test/ElmSharp.Test/res/TED/thumbnail/c.jpg b/test/ElmSharp.Test/res/TED/thumbnail/c.jpg deleted file mode 100755 index a0a4c1a3b..000000000 Binary files a/test/ElmSharp.Test/res/TED/thumbnail/c.jpg and /dev/null differ diff --git a/test/ElmSharp.Test/res/TED/thumbnail/d.jpg b/test/ElmSharp.Test/res/TED/thumbnail/d.jpg deleted file mode 100755 index 4dfda7cea..000000000 Binary files a/test/ElmSharp.Test/res/TED/thumbnail/d.jpg and /dev/null differ diff --git a/test/ElmSharp.Test/res/TED/thumbnail/e.jpg b/test/ElmSharp.Test/res/TED/thumbnail/e.jpg deleted file mode 100755 index 0d4ded3d1..000000000 Binary files a/test/ElmSharp.Test/res/TED/thumbnail/e.jpg and /dev/null differ diff --git a/test/ElmSharp.Test/res/TED/thumbnail/f.jpg b/test/ElmSharp.Test/res/TED/thumbnail/f.jpg deleted file mode 100755 index a3fc74442..000000000 Binary files a/test/ElmSharp.Test/res/TED/thumbnail/f.jpg and /dev/null differ diff --git a/test/ElmSharp.Test/res/TED/thumbnail/g.jpg b/test/ElmSharp.Test/res/TED/thumbnail/g.jpg deleted file mode 100755 index 33c46c166..000000000 Binary files a/test/ElmSharp.Test/res/TED/thumbnail/g.jpg and /dev/null differ diff --git a/test/ElmSharp.Test/res/btn_delete.png b/test/ElmSharp.Test/res/btn_delete.png deleted file mode 100644 index 7bafac6e1..000000000 Binary files a/test/ElmSharp.Test/res/btn_delete.png and /dev/null differ diff --git a/test/ElmSharp.Test/res/picture.png b/test/ElmSharp.Test/res/picture.png deleted file mode 100644 index 7522362aa..000000000 Binary files a/test/ElmSharp.Test/res/picture.png and /dev/null differ diff --git a/test/ElmSharp.Test/shared/res/ElmSharp.Test.png b/test/ElmSharp.Test/shared/res/ElmSharp.Test.png deleted file mode 100644 index 9765b1bda..000000000 Binary files a/test/ElmSharp.Test/shared/res/ElmSharp.Test.png and /dev/null differ diff --git a/test/ElmSharp.Test/test.sh b/test/ElmSharp.Test/test.sh deleted file mode 100755 index aa3cbc7e7..000000000 --- a/test/ElmSharp.Test/test.sh +++ /dev/null @@ -1,84 +0,0 @@ -#!/bin/bash - -TARGET_USER=owner -TARGET_DIR=/home/$TARGET_USER/elmsharp_test -TARGET_RES_DIR=$TARGET_DIR/res - -TO_COPY_FILES="bin/Debug" - -exit_on_error() { - if [ $1 -ne "0" ] - then - exit $1 - fi -} - -sdb_cmd() { - sdb shell su -l $TARGET_USER -c "$1" -} - -usage() { - echo "Usage: $0 [options] [testcase]" - echo " Options:" - echo " -h, --help Show this usages message" - echo " -i, --install Install test cases to target device" - echo " -r, --install-res Install resource files for test cases to target device" - echo " -m, --use-mono Execute test case by using mono instead of corerun" -} - -install() { - echo "install" - sdb root on - sdb_cmd "rm -fr $TARGET_DIR" - sdb_cmd "mkdir -p $TARGET_DIR" - sdb push $TO_COPY_FILES/Tizen*.dll $TARGET_DIR - sdb push $TO_COPY_FILES/ElmSharp*.dll $TARGET_DIR - sdb push $TO_COPY_FILES/ElmSharp*.exe $TARGET_DIR - exit_on_error $? -} - -install_res() { - sdb root on - sdb_cmd "rm -fr $TARGET_RES_DIR" - sdb_cmd "mkdir -p $TARGET_RES_DIR" - sdb push $TO_COPY_FILES/res $TARGET_RES_DIR - exit_on_error $? -} - -run() { - sdb root on - sdb_cmd "/usr/share/tizen.net/corerun $TARGET_DIR/ElmSharp.Test.exe $1" - exit_on_error $? -} - -run_mono() { - sdb root on - sdb_cmd "MONO_TRACE_LISTENER=Console.Error mono $TARGET_DIR/ElmSharp.Test.exe $1" - exit_on_error $? -} - -OPTS=`getopt -o hirm --long help,install,install-res,use-mono -n 'test' -- "$@"` -if [ $? != 0 ] ; then echo "Failed parsing options." >&2 ; usage; exit 1 ; fi -eval set -- "$OPTS" - -FLAG_HELP=false -FLAG_INSTALL=false -FLAG_INSTALL_RES=false -FLAG_USE_MONO=false - -while true; do - case "$1" in - -h|--help) FLAG_HELP=true; shift ;; - -i|--install) FLAG_INSTALL=true; shift ;; - -r|--install-res) FLAG_INSTALL_RES=true; shift ;; - -m|--use-mono) FLAG_USE_MONO=true; shift ;; - --) shift; break ;; - *) break ;; - esac -done - -if $FLAG_HELP; then usage; exit 1; fi - -if $FLAG_INSTALL; then install; fi -if $FLAG_INSTALL_RES; then install_res; fi -if $FLAG_USE_MONO; then run_mono $@; else run $@; fi diff --git a/test/ElmSharp.Test/tizen-manifest.xml b/test/ElmSharp.Test/tizen-manifest.xml deleted file mode 100755 index bf61e8aa4..000000000 --- a/test/ElmSharp.Test/tizen-manifest.xml +++ /dev/null @@ -1,12 +0,0 @@ - - - - - ElmSharp.Test.png - - - - - http://tizen.org/privilege/internet - - diff --git a/test/ElmSharp.Wearable.Test/ElmSharp.Wearable.Test.csproj b/test/ElmSharp.Wearable.Test/ElmSharp.Wearable.Test.csproj deleted file mode 100644 index d32515b5c..000000000 --- a/test/ElmSharp.Wearable.Test/ElmSharp.Wearable.Test.csproj +++ /dev/null @@ -1,54 +0,0 @@ - - - - - - $(MSBuildExtensionsPath)\Tizen\VisualStudio\ - - - - - - - - Exe - netcoreapp2.0 - - - - - true - $(PackageTargetFallback);portable-net45+wp80+win81+wpa81 - - - - portable - - - None - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/test/ElmSharp.Wearable.Test/TC/CircleDateTimeSelectorTest1.cs b/test/ElmSharp.Wearable.Test/TC/CircleDateTimeSelectorTest1.cs deleted file mode 100644 index 4318a7579..000000000 --- a/test/ElmSharp.Wearable.Test/TC/CircleDateTimeSelectorTest1.cs +++ /dev/null @@ -1,65 +0,0 @@ -/* - * 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 ElmSharp.Wearable; - -namespace ElmSharp.Test.TC -{ - class CircleDateTimeSelectorTest1 : TestCaseBase - { - public override string TestName => "CircleDateTimeSelectorTest1"; - public override string TestDescription => "To display a date time selector with circle UI"; - - public override void Run(Window window) - { - Conformant conformant = new Conformant(window); - conformant.Show(); - - Layout layout = new Layout(window); - - layout.SetTheme("layout", "circle", "datetime"); - - conformant.SetContent(layout); - - DateTimeSelector datetime = new CircleDateTimeSelector(conformant) - { - MinimumDateTime = new DateTime(2015, 1, 1), - MaximumDateTime = DateTime.Now, - DateTime = DateTime.Now - }; - - layout.SetContent(datetime); - - Button btn = new Button(layout) - { - Text = "OK", - Style = "bottom", - }; - - layout.SetPartContent("elm.swallow.btn", btn); - - layout.SetPartText("elm.text", "Set date"); - - datetime.DateTimeChanged += (object sender, DateChangedEventArgs e) => - { - Log.Debug(TestName, "Old DateTime={0}", e.OldDate.ToString()); - Log.Debug(TestName, "New DateTime={0}", e.NewDate.ToString()); - Log.Debug(TestName, "Current DateTime={0}", datetime.DateTime.ToString()); - }; - } - } -} \ No newline at end of file diff --git a/test/ElmSharp.Wearable.Test/TC/CircleDateTimeSelectorTest2.cs b/test/ElmSharp.Wearable.Test/TC/CircleDateTimeSelectorTest2.cs deleted file mode 100644 index 6e3bdf0bb..000000000 --- a/test/ElmSharp.Wearable.Test/TC/CircleDateTimeSelectorTest2.cs +++ /dev/null @@ -1,64 +0,0 @@ -/* - * 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 ElmSharp.Wearable; - -namespace ElmSharp.Test.TC -{ - class CircleDateTimeSelectorTest2 : TestCaseBase - { - public override string TestName => "CircleDateTimeSelectorTest2"; - public override string TestDescription => "To display a date time selector with circle UI"; - - public override void Run(Window window) - { - Conformant conformant = new Conformant(window); - conformant.Show(); - - Layout layout = new Layout(window); - - layout.SetTheme("layout", "circle", "datetime"); - - conformant.SetContent(layout); - - DateTimeSelector datetime = new CircleDateTimeSelector(conformant) - { - DateTime = DateTime.Now, - Style = "timepicker/circle" - }; - - layout.SetContent(datetime); - - Button btn = new Button(layout) - { - Text = "OK", - Style = "bottom", - }; - - layout.SetPartContent("elm.swallow.btn", btn); - - layout.SetPartText("elm.text", "Set time"); - - datetime.DateTimeChanged += (object sender, DateChangedEventArgs e) => - { - Log.Debug(TestName, "Old DateTime={0}", e.OldDate.ToString()); - Log.Debug(TestName, "New DateTime={0}", e.NewDate.ToString()); - Log.Debug(TestName, "Current DateTime={0}", datetime.DateTime.ToString()); - }; - } - } -} \ No newline at end of file diff --git a/test/ElmSharp.Wearable.Test/TC/CircleDateTimeSelectorTest3.cs b/test/ElmSharp.Wearable.Test/TC/CircleDateTimeSelectorTest3.cs deleted file mode 100644 index 8ac190760..000000000 --- a/test/ElmSharp.Wearable.Test/TC/CircleDateTimeSelectorTest3.cs +++ /dev/null @@ -1,65 +0,0 @@ -/* - * 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 ElmSharp.Wearable; - -namespace ElmSharp.Test.TC -{ - class CircleDateTimeSelectorTest3 : TestCaseBase - { - public override string TestName => "CircleDateTimeSelectorTest3"; - public override string TestDescription => "To display a date time selector with circle UI"; - - public override void Run(Window window) - { - Conformant conformant = new Conformant(window); - conformant.Show(); - - Layout layout = new Layout(window); - - layout.SetTheme("layout", "circle", "datetime"); - - conformant.SetContent(layout); - - DateTimeSelector datetime = new CircleDateTimeSelector(conformant) - { - DateTime = DateTime.Now, - Style = "timepicker/circle", - Disabled = true - }; - - layout.SetContent(datetime); - - Button btn = new Button(layout) - { - Text = "OK", - Style = "bottom", - }; - - layout.SetPartContent("elm.swallow.btn", btn); - - layout.SetPartText("elm.text", "Set time"); - - datetime.DateTimeChanged += (object sender, DateChangedEventArgs e) => - { - Log.Debug(TestName, "Old DateTime={0}", e.OldDate.ToString()); - Log.Debug(TestName, "New DateTime={0}", e.NewDate.ToString()); - Log.Debug(TestName, "Current DateTime={0}", datetime.DateTime.ToString()); - }; - } - } -} \ No newline at end of file diff --git a/test/ElmSharp.Wearable.Test/TC/CircleDateTimeSelectorTest4.cs b/test/ElmSharp.Wearable.Test/TC/CircleDateTimeSelectorTest4.cs deleted file mode 100644 index 3a93ab563..000000000 --- a/test/ElmSharp.Wearable.Test/TC/CircleDateTimeSelectorTest4.cs +++ /dev/null @@ -1,67 +0,0 @@ -/* - * 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 ElmSharp.Wearable; - -namespace ElmSharp.Test.TC -{ - class CircleDateTimeSelectorTest4 : TestCaseBase - { - public override string TestName => "CircleDateTimeSelectorTest4"; - public override string TestDescription => "To display a date time selector with circle UI"; - - public override void Run(Window window) - { - Conformant conformant = new Conformant(window); - conformant.Show(); - - Layout layout = new Layout(window); - - layout.SetTheme("layout", "circle", "datetime"); - - conformant.SetContent(layout); - - DateTimeSelector datetime = new CircleDateTimeSelector(conformant) - { - DateTime = DateTime.Now, - Style = "timepicker/circle", - MarkerLineWidth = 40, - MarkerColor = Color.Pink, - MarkerRadius = 100, - }; - - layout.SetContent(datetime); - - Button btn = new Button(layout) - { - Text = "OK", - Style = "bottom", - }; - - layout.SetPartContent("elm.swallow.btn", btn); - - layout.SetPartText("elm.text", "Set time"); - - datetime.DateTimeChanged += (object sender, DateChangedEventArgs e) => - { - Log.Debug(TestName, "Old DateTime={0}", e.OldDate.ToString()); - Log.Debug(TestName, "New DateTime={0}", e.NewDate.ToString()); - Log.Debug(TestName,"Current DateTime={0}", datetime.DateTime.ToString()); - }; - } - } -} \ No newline at end of file diff --git a/test/ElmSharp.Wearable.Test/TC/CircleGenListTest1.cs b/test/ElmSharp.Wearable.Test/TC/CircleGenListTest1.cs deleted file mode 100644 index 03de32b67..000000000 --- a/test/ElmSharp.Wearable.Test/TC/CircleGenListTest1.cs +++ /dev/null @@ -1,61 +0,0 @@ -/* - * 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 ElmSharp.Wearable; - -namespace ElmSharp.Test.TC -{ - class CircleGenListTest1 : TestCaseBase - { - public override string TestName => "CircleGenListTest1"; - public override string TestDescription => "To display a genlist applied a circle UI on a conformant"; - - public override void Run(Window window) - { - Conformant conformant = new Conformant(window); - conformant.Show(); - - var list = new CircleGenList(conformant) - { - Homogeneous = true, - VerticalScrollBarColor = Color.Red, - VerticalScrollBackgroundColor = Color.Pink, - VerticalScrollBarVisiblePolicy = ScrollBarVisiblePolicy.Visible, - }; - - conformant.SetContent(list); - - GenItemClass defaultClass = new GenItemClass("default") - { - GetTextHandler = (obj, part) => - { - return string.Format("{0} - {1}",(string)obj, part); - } - }; - - for (int i = 0; i < 100; i++) - { - list.Append(defaultClass, string.Format("{0} Item", i)); - } - list.ItemSelected += List_ItemSelected; ; - } - - private void List_ItemSelected(object sender, GenListItemEventArgs e) - { - Log.Debug(TestName, "{0} Item was selected", (string)(e.Item.Data)); - } - } -} diff --git a/test/ElmSharp.Wearable.Test/TC/CircleGenListTest2.cs b/test/ElmSharp.Wearable.Test/TC/CircleGenListTest2.cs deleted file mode 100644 index ff1e9fdf4..000000000 --- a/test/ElmSharp.Wearable.Test/TC/CircleGenListTest2.cs +++ /dev/null @@ -1,70 +0,0 @@ -/* - * 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 ElmSharp.Wearable; - -namespace ElmSharp.Test.TC -{ - class CircleGenListTest2 : TestCaseBase - { - public override string TestName => "CircleGenListTest2"; - public override string TestDescription => "To display a genlist applied a circle UI on a layout"; - - public override void Run(Window window) - { - var layout = new Layout(window); - layout.Show(); - - layout.Move(0, 0); - layout.Resize(360, 360); - - var list = new CircleGenList(layout) - { - Homogeneous = true, - VerticalScrollBackgroundRadius = 165, - VerticalScrollBarRadius = 165, - VerticalScrollBackgroundLineWidth = 30, - VerticalScrollBarLineWidth = 30, - }; - list.Show(); - - list.Move(0, 0); - list.Resize(360, 360); - list.Lower(); - - - GenItemClass defaultClass = new GenItemClass("default") - { - GetTextHandler = (obj, part) => - { - return string.Format("{0} - {1}",(string)obj, part); - } - }; - - for (int i = 0; i < 100; i++) - { - list.Append(defaultClass, string.Format("{0} Item", i)); - } - list.ItemSelected += List_ItemSelected; ; - } - - private void List_ItemSelected(object sender, GenListItemEventArgs e) - { - Log.Debug(TestName, "{0} Item was selected", (string)(e.Item.Data)); - } - } -} diff --git a/test/ElmSharp.Wearable.Test/TC/CircleGenListTest3.cs b/test/ElmSharp.Wearable.Test/TC/CircleGenListTest3.cs deleted file mode 100644 index 6dc5f53d5..000000000 --- a/test/ElmSharp.Wearable.Test/TC/CircleGenListTest3.cs +++ /dev/null @@ -1,65 +0,0 @@ -/* - * 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 ElmSharp.Wearable; - -namespace ElmSharp.Test.TC -{ - class CircleGenListTest3 : TestCaseBase - { - public override string TestName => "CircleGenListTest3"; - public override string TestDescription => "To display a genlist applied a circle UI on a naviframe"; - - public override void Run(Window window) - { - Conformant conformant = new Conformant(window); - conformant.Show(); - - var naviframe = new Naviframe(conformant); - - conformant.SetContent(naviframe); - - var list = new CircleGenList(naviframe) - { - Homogeneous = true, - VerticalScrollBarVisiblePolicy = ScrollBarVisiblePolicy.Auto, - Disabled = true, - }; - - var item = naviframe.Push(list); - item.Style = "empty"; - - GenItemClass defaultClass = new GenItemClass("default") - { - GetTextHandler = (obj, part) => - { - return string.Format("{0} - {1}",(string)obj, part); - } - }; - - for (int i = 0; i < 100; i++) - { - list.Append(defaultClass, string.Format("{0} Item", i)); - } - list.ItemSelected += List_ItemSelected; ; - } - - private void List_ItemSelected(object sender, GenListItemEventArgs e) - { - Log.Debug(TestName, "{0} Item was selected", (string)(e.Item.Data)); - } - } -} diff --git a/test/ElmSharp.Wearable.Test/TC/CircleGenListTest4.cs b/test/ElmSharp.Wearable.Test/TC/CircleGenListTest4.cs deleted file mode 100644 index d5190abc1..000000000 --- a/test/ElmSharp.Wearable.Test/TC/CircleGenListTest4.cs +++ /dev/null @@ -1,58 +0,0 @@ -/* - * 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 ElmSharp.Wearable; - -namespace ElmSharp.Test.TC -{ - class CircleGenListTest4 : TestCaseBase - { - public override string TestName => "CircleGenListTest4"; - public override string TestDescription => "To display a genlist applied a circle UI on an window"; - - public override void Run(Window window) - { - var list = new CircleGenList(window) - { - Homogeneous = true, - VerticalScrollBarVisiblePolicy = ScrollBarVisiblePolicy.Invisible, - }; - list.Show(); - - list.Move(0, 0); - list.Resize(360, 360); - - GenItemClass defaultClass = new GenItemClass("default") - { - GetTextHandler = (obj, part) => - { - return string.Format("{0} - {1}",(string)obj, part); - } - }; - - for (int i = 0; i < 100; i++) - { - list.Append(defaultClass, string.Format("{0} Item", i)); - } - list.ItemSelected += List_ItemSelected; ; - } - - private void List_ItemSelected(object sender, GenListItemEventArgs e) - { - Log.Debug(TestName, "{0} Item was selected", (string)(e.Item.Data)); - } - } -} diff --git a/test/ElmSharp.Wearable.Test/TC/CircleProgressBarTest1.cs b/test/ElmSharp.Wearable.Test/TC/CircleProgressBarTest1.cs deleted file mode 100644 index a0bc3cba1..000000000 --- a/test/ElmSharp.Wearable.Test/TC/CircleProgressBarTest1.cs +++ /dev/null @@ -1,71 +0,0 @@ -/* - * 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 ElmSharp.Wearable; - -namespace ElmSharp.Test.TC -{ - public class CircleProgressBarTest1 : TestCaseBase - { - public override string TestName => "CircleProgressBarTest1"; - public override string TestDescription => "To test basic operation of CircleProgressBar"; - - public override void Run(Window window) - { - Log.Debug(TestName, "CircleProgressBar run"); - Conformant conformant = new Conformant(window); - conformant.Show(); - - CircleProgressBar pb1 = new CircleProgressBar(conformant) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - - // default - Value = 20, - Maximum = 100, - Minimum = 0, - BarRadius = 80, - BarLineWidth = 6, - - // background - BackgroundRadius = 80, - BackgroundLineWidth = 6, - }; - pb1.Show(); - conformant.SetContent(pb1); - Label lb1 = new Label(window) - { - Text = string.Format("{0} %", pb1.Value), - }; - - lb1.Resize(window.ScreenSize.Width, window.ScreenSize.Height); - lb1.Move(170, window.ScreenSize.Height / 2 - 20); - lb1.Show(); - - EcoreMainloop.AddTimer(0.05, () => - { - pb1.Value += 1; - lb1.Text = string.Format("{0} %", pb1.Value); - - return true; - }); - } - } -} diff --git a/test/ElmSharp.Wearable.Test/TC/CircleProgressBarTest2.cs b/test/ElmSharp.Wearable.Test/TC/CircleProgressBarTest2.cs deleted file mode 100644 index d41034d05..000000000 --- a/test/ElmSharp.Wearable.Test/TC/CircleProgressBarTest2.cs +++ /dev/null @@ -1,75 +0,0 @@ -/* - * 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 ElmSharp.Wearable; - -namespace ElmSharp.Test.TC -{ - public class CircleProgressBarTest2 : TestCaseBase - { - public override string TestName => "CircleProgressBarTest2"; - public override string TestDescription => "To test property related with background of CircleProgressBar"; - - public override void Run(Window window) - { - Log.Debug(TestName, "CircleProgressBar run"); - Conformant conformant = new Conformant(window); - conformant.Show(); - - CircleProgressBar pb1 = new CircleProgressBar(conformant) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - - // bar - Value = 20, - Maximum = 100, - Minimum = 0, - BarRadius = 100, - BarLineWidth = 10, - BarColor = Color.Green, - - // Test purpose : to test property related with background - - // background - BackgroundRadius = 110, - BackgroundLineWidth = 10, - BackgroundColor = Color.Aqua - }; - pb1.Show(); - conformant.SetContent(pb1); - Label lb1 = new Label(window) - { - Text = string.Format("S {0} %", pb1.Value), - }; - - lb1.Resize(window.ScreenSize.Width, window.ScreenSize.Height); - lb1.Move(160, window.ScreenSize.Height / 2 - 20); - lb1.Show(); - - EcoreMainloop.AddTimer(0.05, () => - { - pb1.Value += 1; - lb1.Text = string.Format("S {0} %", pb1.Value); - - return true; - }); - } - } -} diff --git a/test/ElmSharp.Wearable.Test/TC/CircleProgressBarTest3.cs b/test/ElmSharp.Wearable.Test/TC/CircleProgressBarTest3.cs deleted file mode 100644 index 66a2ba6d4..000000000 --- a/test/ElmSharp.Wearable.Test/TC/CircleProgressBarTest3.cs +++ /dev/null @@ -1,89 +0,0 @@ -/* - * 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 ElmSharp.Wearable; - -namespace ElmSharp.Test.TC -{ - public class CircleProgressBarTest3 : TestCaseBase - { - public override string TestName => "CircleProgressBarTest3"; - public override string TestDescription => "To test property related with angle of CircleProgressBar"; - - public override void Run(Window window) - { - Log.Debug(TestName, "CircleProgressBar run"); - Conformant conformant = new Conformant(window); - conformant.Show(); - - CircleProgressBar pb1 = new CircleProgressBar(conformant) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - - // Test purpose : to test property related with angle - - // bar - Maximum = 100, - BarRadius = 100, - BarLineWidth = 20, - BarColor = Color.Green, - BarAngleOffset = 90, - BarAngle = 90, - BarAngleMaximum = 180, - - // background - BackgroundRadius = 100, - BackgroundLineWidth = 20, - BackgroundColor = Color.Aqua, - BackgroundAngleOffset = 90, - BackgroundAngle = 180, - }; - pb1.Show(); - conformant.SetContent(pb1); - Label lb1 = new Label(window) - { - Text = string.Format("V {0} %", pb1.Value), - }; - - lb1.Resize(window.ScreenSize.Width, window.ScreenSize.Height); - lb1.Move(160, window.ScreenSize.Height / 2 - 40); - lb1.Show(); - - Label lb2 = new Label(window) - { - Text = string.Format("A {0} ", pb1.BarAngle), - }; - - lb2.Resize(window.ScreenSize.Width, window.ScreenSize.Height); - lb2.Move(160, window.ScreenSize.Height / 2); - lb2.Show(); - - EcoreMainloop.AddTimer(0.5, () => - { - pb1.Value += 1; - - lb1.Text = string.Format("V {0} %", pb1.Value); - lb2.Text = string.Format("A {0} ", pb1.BarAngle); - - return true; - }); - } - } -} diff --git a/test/ElmSharp.Wearable.Test/TC/CircleProgressBarTest4.cs b/test/ElmSharp.Wearable.Test/TC/CircleProgressBarTest4.cs deleted file mode 100644 index 9ff9d4836..000000000 --- a/test/ElmSharp.Wearable.Test/TC/CircleProgressBarTest4.cs +++ /dev/null @@ -1,84 +0,0 @@ -/* - * 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 ElmSharp.Wearable; - -namespace ElmSharp.Test.TC -{ - public class CircleProgressBarTest4 : TestCaseBase - { - public override string TestName => "CircleProgressBarTest4"; - public override string TestDescription => "To test Disabled property of CircleProgressBar"; - - public override void Run(Window window) - { - Log.Debug(TestName, "CircleProgressBar run"); - Conformant conformant = new Conformant(window); - conformant.Show(); - - CircleProgressBar pb1 = new CircleProgressBar(conformant) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - - // bar - Value = 0, - Maximum = 100, - Minimum = 0, - BarRadius = 100, - BarLineWidth = 15, - BarColor = Color.Green, - - // background - BackgroundRadius = 100, - BackgroundLineWidth = 15, - BackgroundColor = Color.Aqua, - }; - pb1.Show(); - conformant.SetContent(pb1); - Label lb1 = new Label(window) - { - Text = string.Format("S {0} %", pb1.Value), - }; - - lb1.Resize(window.ScreenSize.Width, window.ScreenSize.Height); - lb1.Move(160, window.ScreenSize.Height / 2 - 40); - lb1.Show(); - - EcoreMainloop.AddTimer(0.05, () => - { - if (pb1.Value == pb1.Maximum/2) - { - // Test purpose : set disable - pb1.Disabled = true; - } - - if (pb1.Value == pb1.Maximum) - { - EcoreMainloop.RemoveTimer(pb1); - } - - pb1.Value += 1; - lb1.Text = string.Format("S {0} %", pb1.Value); - - return true; - }); - } - } -} diff --git a/test/ElmSharp.Wearable.Test/TC/CircleScrollerTest1.cs b/test/ElmSharp.Wearable.Test/TC/CircleScrollerTest1.cs deleted file mode 100644 index 21d7a335a..000000000 --- a/test/ElmSharp.Wearable.Test/TC/CircleScrollerTest1.cs +++ /dev/null @@ -1,75 +0,0 @@ -/* - * 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 ElmSharp.Wearable; - -namespace ElmSharp.Test.TC -{ - public class CircleScrollerTest1 : TestCaseBase - { - public override string TestName => "CircleScrollerTest1"; - public override string TestDescription => "To test basic operation of CircleScroller"; - - public override void Run(Window window) - { - Conformant conformant = new Conformant(window); - conformant.Show(); - - CircleScroller circleScroller = new CircleScroller(conformant) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - VerticalScrollBarVisiblePolicy = ScrollBarVisiblePolicy.Auto, - HorizontalScrollBarVisiblePolicy = ScrollBarVisiblePolicy.Invisible, - }; - circleScroller.Show(); - conformant.SetContent(circleScroller); - Box box = new Box(window) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1 - }; - box.Show(); - circleScroller.SetContent(box); - - var rnd = new Random(); - for (int i = 0; i < 10; i++) - { - int r = rnd.Next(255); - int g = rnd.Next(255); - int b = rnd.Next(255); - Color color = Color.FromRgb(r, g, b); - Rectangle colorBox = new Rectangle(window) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - Color = color, - MinimumHeight = window.ScreenSize.Height, - }; - colorBox.Show(); - box.PackEnd(colorBox); - } - circleScroller.Scrolled += (s, e) => Log.Debug(TestName, "Circle Scrolled Scrolled"); - } - } -} diff --git a/test/ElmSharp.Wearable.Test/TC/CircleScrollerTest2.cs b/test/ElmSharp.Wearable.Test/TC/CircleScrollerTest2.cs deleted file mode 100644 index b968e530e..000000000 --- a/test/ElmSharp.Wearable.Test/TC/CircleScrollerTest2.cs +++ /dev/null @@ -1,81 +0,0 @@ -/* - * 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 ElmSharp.Wearable; - -namespace ElmSharp.Test.TC -{ - public class CircleScrollerTest2 : TestCaseBase - { - public override string TestName => "CircleScrollerTest2"; - public override string TestDescription => "To test basic operation of CircleScroller"; - - public override void Run(Window window) - { - Layout layout = new Layout(window); - layout.Show(); - layout.Move(0, 0); - layout.Resize(360, 360); - - CircleScroller circleScroller = new CircleScroller(layout) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - VerticalScrollBarVisiblePolicy = ScrollBarVisiblePolicy.Invisible, - HorizontalScrollBarVisiblePolicy = ScrollBarVisiblePolicy.Auto, - }; - circleScroller.Show(); - circleScroller.Move(0, 0); - circleScroller.Resize(360, 360); - circleScroller.Lower(); - - Box box = new Box(window) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - IsHorizontal = true, - }; - box.Show(); - circleScroller.SetContent(box); - - var rnd = new Random(); - for (int i = 0; i < 10; i++) - { - int r = rnd.Next(255); - int g = rnd.Next(255); - int b = rnd.Next(255); - Color color = Color.FromRgb(r, g, b); - Rectangle colorBox = new Rectangle(window) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - Color = color, - MinimumWidth = window.ScreenSize.Width, - }; - colorBox.Show(); - box.PackEnd(colorBox); - } - circleScroller.Scrolled += (s, e) => Log.Debug(TestName, "Horizental Circle Scroll Scrolled"); - } - } -} diff --git a/test/ElmSharp.Wearable.Test/TC/CircleScrollerTest3.cs b/test/ElmSharp.Wearable.Test/TC/CircleScrollerTest3.cs deleted file mode 100644 index 412e1e05c..000000000 --- a/test/ElmSharp.Wearable.Test/TC/CircleScrollerTest3.cs +++ /dev/null @@ -1,85 +0,0 @@ -/* - * 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 ElmSharp.Wearable; - -namespace ElmSharp.Test.TC -{ - public class CircleScrollerTest3 : TestCaseBase - { - public override string TestName => "CircleScrollerTest3"; - public override string TestDescription => "To test basic operation of CircleScroller"; - - public override void Run(Window window) - { - Conformant conformant = new Conformant(window); - conformant.Show(); - - Naviframe naviframe = new Naviframe(conformant); - - CircleScroller circleScroller = new CircleScroller(naviframe) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - VerticalScrollBarVisiblePolicy = ScrollBarVisiblePolicy.Invisible, - HorizontalScrollBarVisiblePolicy = ScrollBarVisiblePolicy.Auto, - HorizontalScrollBarColor = new Color(255, 0, 0, 50), - HorizontalScrollBackgroundColor = Color.Orange, - HorizontalScrollBarLineWidth = 15, - HorizontalScrollBackgroundLineWidth = 15, - }; - circleScroller.Show(); - naviframe.Push(circleScroller); - naviframe.Show(); - conformant.SetContent(naviframe); - - Box box = new Box(window) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - IsHorizontal = true, - }; - box.Show(); - circleScroller.SetContent(box); - - var rnd = new Random(); - for (int i = 0; i < 10; i++) - { - int r = rnd.Next(255); - int g = rnd.Next(255); - int b = rnd.Next(255); - Color color = Color.FromRgb(r, g, b); - Rectangle colorBox = new Rectangle(window) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - Color = color, - MinimumWidth = window.ScreenSize.Width, - }; - colorBox.Show(); - box.PackEnd(colorBox); - } - circleScroller.Scrolled += (s, e) => Log.Debug(TestName, "Horizental Circle Scroll Scrolled"); - } - } -} diff --git a/test/ElmSharp.Wearable.Test/TC/CircleScrollerTest4.cs b/test/ElmSharp.Wearable.Test/TC/CircleScrollerTest4.cs deleted file mode 100644 index 13a3db82d..000000000 --- a/test/ElmSharp.Wearable.Test/TC/CircleScrollerTest4.cs +++ /dev/null @@ -1,79 +0,0 @@ -/* - * 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 ElmSharp.Wearable; - -namespace ElmSharp.Test.TC -{ - public class CircleScrollerTest4 : TestCaseBase - { - public override string TestName => "CircleScrollerTest4"; - public override string TestDescription => "To test basic operation of CircleScroller"; - - public override void Run(Window window) - { - - CircleScroller circleScroller = new CircleScroller(window) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - VerticalScrollBarVisiblePolicy = ScrollBarVisiblePolicy.Auto, - HorizontalScrollBarVisiblePolicy = ScrollBarVisiblePolicy.Invisible, - VerticalScrollBarColor = Color.Yellow, - VerticalScrollBackgroundColor = Color.Red, - VerticalScrollBarRadius = 170, - VerticalScrollBackgroundRadius = 170, - }; - circleScroller.Show(); - circleScroller.Move(0, 0); - circleScroller.Resize(360, 360); - - Box box = new Box(window) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - }; - box.Show(); - circleScroller.SetContent(box); - - var rnd = new Random(); - for (int i = 0; i < 10; i++) - { - int r = rnd.Next(255); - int g = rnd.Next(255); - int b = rnd.Next(255); - Color color = Color.FromRgb(r, g, b); - Rectangle colorBox = new Rectangle(window) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - Color = color, - MinimumHeight = window.ScreenSize.Height, - }; - colorBox.Show(); - box.PackEnd(colorBox); - } - circleScroller.Scrolled += (s, e) => Log.Debug(TestName, "Horizental Circle Scroll Scrolled"); - } - } -} diff --git a/test/ElmSharp.Wearable.Test/TC/CircleSliderTest1.cs b/test/ElmSharp.Wearable.Test/TC/CircleSliderTest1.cs deleted file mode 100644 index 91a4cc2e3..000000000 --- a/test/ElmSharp.Wearable.Test/TC/CircleSliderTest1.cs +++ /dev/null @@ -1,62 +0,0 @@ -/* - * 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 ElmSharp.Wearable; - -namespace ElmSharp.Test.TC -{ - public class CircleSliderTest1 : TestCaseBase - { - public override string TestName => "CircleSliderTest1"; - public override string TestDescription => "To test basic operation of CircleSlider"; - - public override void Run(Window window) - { - Conformant conformant = new Conformant(window); - conformant.Show(); - - - CircleSlider circleSlider = new CircleSlider(conformant) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - Minimum = 0, - Maximum = 100, - Value = 25, - Step = 5, - }; - circleSlider.Show(); - conformant.SetContent(circleSlider); - - Label label1 = new Label(window) - { - Text = string.Format("{0}", circleSlider.Value), - Color = Color.White, - }; - - label1.Resize(window.ScreenSize.Width, window.ScreenSize.Height); - label1.Move(170, window.ScreenSize.Height / 2 - 20); - label1.Show(); - - circleSlider.Changed += (s, e) => - { - label1.Text = string.Format("{0}", circleSlider.Value); - }; - } - } -} diff --git a/test/ElmSharp.Wearable.Test/TC/CircleSliderTest2.cs b/test/ElmSharp.Wearable.Test/TC/CircleSliderTest2.cs deleted file mode 100644 index 9f0c2620b..000000000 --- a/test/ElmSharp.Wearable.Test/TC/CircleSliderTest2.cs +++ /dev/null @@ -1,84 +0,0 @@ -/* - * 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 ElmSharp.Wearable; - -namespace ElmSharp.Test.TC -{ - public class CircleSliderTest2 : TestCaseBase - { - public override string TestName => "CircleSliderTest2"; - public override string TestDescription => "To test basic operation of CircleSlider"; - - public override void Run(Window window) - { - Conformant conformant = new Conformant(window); - conformant.Show(); - - - CircleSlider circleSlider = new CircleSlider(conformant) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - Minimum = 0, - Maximum = 15, - BarColor = Color.Purple, - BackgroundColor = Color.Red, - BarRadius = 160, - BackgroundRadius = 160, - BarLineWidth = 15, - BackgroundLineWidth = 15, - BackgroundAngleOffset = 90, - BackgroundAngle = 270, - BarAngleOffset = 90.0, - BarAngleMinimum = 0.0, - BarAngleMaximum = 270.0, - Value = 3, - Step = 0.5, - }; - circleSlider.Show(); - conformant.SetContent(circleSlider); - Label label1 = new Label(window) - { - Text = string.Format("{0:F1}", circleSlider.Value), - Color = Color.White, - }; - - label1.Resize(window.ScreenSize.Width, window.ScreenSize.Height); - label1.Move(170, window.ScreenSize.Height / 2 - 30); - label1.Show(); - - Label label2 = new Label(window) - { - Text = string.Format("min:{0},max{1}", circleSlider.Minimum, circleSlider.Maximum), - Color = Color.White, - }; - - label2.Resize(window.ScreenSize.Width, window.ScreenSize.Height); - label2.Move(110, window.ScreenSize.Height / 2 + 10); - label2.Show(); - - Log.Debug(TestName, "CircleSliderTest2 step:" + circleSlider.Step); - - circleSlider.Changed += (s, e) => - { - label1.Text = string.Format("{0:F1}", circleSlider.Value); - }; - } - } -} diff --git a/test/ElmSharp.Wearable.Test/TC/CircleSpinnerTest1.cs b/test/ElmSharp.Wearable.Test/TC/CircleSpinnerTest1.cs deleted file mode 100644 index d67564eb8..000000000 --- a/test/ElmSharp.Wearable.Test/TC/CircleSpinnerTest1.cs +++ /dev/null @@ -1,71 +0,0 @@ -/* - * 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 ElmSharp.Wearable; - -namespace ElmSharp.Test.TC -{ - class CircleSpinnerTest1 : TestCaseBase - { - public override string TestName => "CircleSpinnerTest1"; - public override string TestDescription => "To test basic operation of Circle Spinner"; - - public override void Run(Window window) - { - Log.Debug(TestName, "CircleSpinnerTest run"); - Conformant conformant = new Conformant(window); - conformant.Show(); - - Layout layout = new Layout(window); - layout.SetTheme("layout", "circle", "spinner"); - conformant.SetContent(layout); - - CircleSpinner spn1 = new CircleSpinner(conformant) - { - Text = "Spinner Test", - LabelFormat = "%d Value", - Style = "circle", - AngleRatio = 3.0, - Minimum = 0, - Maximum = 360, - Value = 0, - Step = 10, - Interval = 0.5, - AlignmentX = -1, - AlignmentY = 1, - WeightX = 1, - WeightY = 1 - }; - spn1.AddSpecialValue(50, "50 match !!!!"); - layout.SetContent(spn1); - - Button btn = new Button(layout) { - Text = "OK", - Style = "bottom", - }; - - btn.Clicked += (s, e) => - { - spn1.Disabled = true; - spn1.Text = "100 match"; - spn1.Value = 0; - }; - - layout.SetPartContent("elm.swallow.btn", btn); - layout.SetPartText("elm.text", "Set value"); - } - } -} diff --git a/test/ElmSharp.Wearable.Test/TC/CircleSpinnerTest2.cs b/test/ElmSharp.Wearable.Test/TC/CircleSpinnerTest2.cs deleted file mode 100644 index 59adefd43..000000000 --- a/test/ElmSharp.Wearable.Test/TC/CircleSpinnerTest2.cs +++ /dev/null @@ -1,68 +0,0 @@ -/* - * 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 ElmSharp.Wearable; - -namespace ElmSharp.Test.TC -{ - class CircleSpinnerTest2 : TestCaseBase - { - public override string TestName => "CircleSpinnerTest2"; - public override string TestDescription => "To test basic operation of Circle Spinner"; - - public override void Run(Window window) - { - Log.Debug(TestName, "CircleSpinnerTest run"); - Conformant conformant = new Conformant(window); - conformant.Show(); - - Layout layout = new Layout(window); - layout.SetTheme("layout", "circle", "spinner"); - conformant.SetContent(layout); - - CircleSpinner spn1 = new CircleSpinner(conformant) - { - Text = "Slider Test", - LabelFormat = "%d Value", - Style = "circle", - AngleRatio = 3.0, - Minimum = 0, - Maximum = 360, - Value = 0, - Step = 10, - Interval = 0.5, - AlignmentX = -1, - AlignmentY = 1, - WeightX = 1, - WeightY = 1, - // change marker - MarkerLineWidth = 40, - MarkerColor = Color.Pink, - MarkerRadius = 100, - }; - spn1.AddSpecialValue(50, "50 match !!!!"); - layout.SetContent(spn1); - - Button btn = new Button(layout) { - Text = "OK", - Style = "bottom", - }; - - layout.SetPartContent("elm.swallow.btn", btn); - layout.SetPartText("elm.text", "Set value"); - } - } -} diff --git a/test/ElmSharp.Wearable.Test/TC/CircleTool.cs b/test/ElmSharp.Wearable.Test/TC/CircleTool.cs deleted file mode 100644 index b12b5077a..000000000 --- a/test/ElmSharp.Wearable.Test/TC/CircleTool.cs +++ /dev/null @@ -1,37 +0,0 @@ -/* - * 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.Collections.Generic; -using System.Text; - -namespace ElmSharp.Test -{ - public static class CircleTool - { - static Rect _inSquare; - public static Rect GetInnerSquare(this Window window) - { - Size screenSize = window.ScreenSize; - int min = Math.Min(screenSize.Height, screenSize.Width); - int width = (int)(min * Math.Cos(Math.PI / 4)); - int x = screenSize.Width / 2 - width / 2; - int y = screenSize.Height / 2 - width / 2; - - return _inSquare == default(Rect) ? (_inSquare = new Rect(x, y, width, width)) : _inSquare; - } - } -} diff --git a/test/ElmSharp.Wearable.Test/TC/Log.cs b/test/ElmSharp.Wearable.Test/TC/Log.cs deleted file mode 100644 index 37313aa72..000000000 --- a/test/ElmSharp.Wearable.Test/TC/Log.cs +++ /dev/null @@ -1,60 +0,0 @@ -using System; -using System.IO; -using System.Runtime.InteropServices; -using System.Runtime.CompilerServices; - -namespace ElmSharp.Test -{ - internal static class Log - { - const string Library = "libdlog.so.0"; - const string TAG = "ElmSharp.Test"; - - public static void Debug(string message, - [CallerFilePath] string file = "", - [CallerMemberName] string func = "", - [CallerLineNumber] int line = 0) - { - Print(LogPriority.DLOG_DEBUG, TAG, message, file, func, line); - } - - public static void Info(string message, - [CallerFilePath] string file = "", - [CallerMemberName] string func = "", - [CallerLineNumber] int line = 0) - { - Print(LogPriority.DLOG_DEBUG, TAG, message, file, func, line); - } - - public static void Error(string message, - [CallerFilePath] string file = "", - [CallerMemberName] string func = "", - [CallerLineNumber] int line = 0) - { - Print(LogPriority.DLOG_DEBUG, TAG, message, file, func, line); - } - - internal enum LogPriority - { - DLOG_UNKNOWN = 0, - DLOG_DEFAULT, - DLOG_VERBOSE, - DLOG_DEBUG, - DLOG_INFO, - DLOG_WARN, - DLOG_ERROR, - DLOG_FATAL, - DLOG_SILENT, - DLOG_PRIO_MAX, - } - - private static void Print(LogPriority priority, string tag, string message, string file, string func, int line) - { - FileInfo finfo = new FileInfo(file); - Print(priority, tag, "%s: %s(%d) > %s", finfo.Name, func, line, message); - } - - [DllImportAttribute(Library, EntryPoint = "dlog_print")] - internal static extern int Print(LogPriority prio, string tag, string fmt, string file, string func, int line, string msg); - } -} diff --git a/test/ElmSharp.Wearable.Test/TC/MoreOptionTest.cs b/test/ElmSharp.Wearable.Test/TC/MoreOptionTest.cs deleted file mode 100644 index 4c0e2b84a..000000000 --- a/test/ElmSharp.Wearable.Test/TC/MoreOptionTest.cs +++ /dev/null @@ -1,91 +0,0 @@ -using System; -using System.Collections.Generic; -using System.IO; -using System.Linq; -using System.Text; - -using ElmSharp.Wearable; - -namespace ElmSharp.Test.TC -{ - class MoreOptionTest : TestCaseBase - { - public override string TestName => "MoreOptionTest"; - - public override string TestDescription => "Wearable More Option Widget Test"; - - class ColorMoreOptionItem : MoreOptionItem - { - public Color Color; - public ColorMoreOptionItem(Window window, string iconName, Color color) - { - MainText = (iconName.First().ToString().ToUpper() + iconName.Substring(1)).Replace('_', ' '); - SubText = color.ToString(); - Icon = new Image(window); - Icon.Show(); - Icon.Load(Path.Combine(TestRunner.ResourceDir, "icons", iconName+".png")); - Color = color; - } - } - - static Color Deep(Color color) - { - return new Color(color.R / 2, color.G / 2, color.B / 2); - } - - public override void Run(Window window) - { - Conformant conf = new Conformant(window); - conf.Show(); - - MoreOption option = new MoreOption(window) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - Direction = MoreOptionDirection.Right - }; - option.Show(); - //option.Move(window.ScreenSize.Width/2, window.ScreenSize.Height/2); - conf.SetContent(option); - - option.Items.Add(new ColorMoreOptionItem(window, "icon_aquamarine_260_me", Color.FromHex("#800000"))); - option.Items.Add(new ColorMoreOptionItem(window, "icon_auamarine_260_me", Color.FromHex("#800012"))); - option.Items.Add(new ColorMoreOptionItem(window, "icon_azure_215_me", Color.FromHex("#800034"))); - option.Items.Add(new ColorMoreOptionItem(window, "icon_beige_330_me", Color.FromHex("#800056"))); - option.Items.Add(new ColorMoreOptionItem(window, "icon_blue_45_me", Color.FromHex("#800067"))); - option.Items.Add(new ColorMoreOptionItem(window, "icon_brown_90_me", Color.FromHex("#800087"))); - option.Items.Add(new ColorMoreOptionItem(window, "icon_cyan_230_me", Color.FromHex("#800023"))); - option.Items.Add(new ColorMoreOptionItem(window, "icon_firebrick_95_me", Color.FromHex("#804300"))); - option.Items.Add(new ColorMoreOptionItem(window, "icon_gold_75_me", Color.FromHex("#854000"))); - option.Items.Add(new ColorMoreOptionItem(window, "icon_green_60_me", Color.FromHex("#800340"))); - option.Items.Add(new ColorMoreOptionItem(window, "icon_honeydew_285_me", Color.FromHex("#823000"))); - option.Items.Add(new ColorMoreOptionItem(window, "icon_ivory_315_me", Color.FromHex("#806700"))); - option.Items.Add(new ColorMoreOptionItem(window, "icon_khaki_360_me", Color.FromHex("#80ab00"))); - option.Items.Add(new ColorMoreOptionItem(window, "icon_lime_300_me", Color.FromHex("#800c30"))); - option.Items.Add(new ColorMoreOptionItem(window, "icon_maroon_120_me", Color.FromHex("#8fd000"))); - option.Items.Add(new ColorMoreOptionItem(window, "icon_me", Color.FromHex("#800000"))); - option.Items.Add(new ColorMoreOptionItem(window, "icon_orchid_160_me", Color.FromHex("#8d3000"))); - option.Items.Add(new ColorMoreOptionItem(window, "icon_pink_145_me", Color.FromHex("#8002d0"))); - option.Items.Add(new ColorMoreOptionItem(window, "icon_purple_200_me", Color.FromHex("#8ff000"))); - option.Items.Add(new ColorMoreOptionItem(window, "icon_red_30_me", Color.FromHex("#800fa0"))); - option.Items.Add(new ColorMoreOptionItem(window, "icon_snow_75_me", Color.FromHex("#80f200"))); - option.Items.Add(new ColorMoreOptionItem(window, "icon_snow_80_me", Color.FromHex("#80d200"))); - option.Items.Add(new ColorMoreOptionItem(window, "icon_teal_245_me", Color.FromHex("#80f300"))); - option.Items.Add(new ColorMoreOptionItem(window, "icon_violet_180_me", Color.FromHex("#80fb00"))); - option.Items.Add(new ColorMoreOptionItem(window, "icon_yellow_345_me", Color.FromHex("#800b30"))); - - option.Opened += (s, e) => Log.Debug(TestName, "Opened!"); - option.Closed += (s, e) => Log.Debug(TestName, "Closed!"); - option.Selected += (s, e) => Log.Debug(TestName, "Selected! : " + e?.Item?.MainText); - option.Clicked += (s, e) => Log.Debug(TestName, "Clicked! : " + e?.Item?.MainText); - - option.Opened += (s, e) => option.BackgroundColor = Color.Aqua; - option.Closed += (s, e) => option.BackgroundColor = Color.Black; - - option.Selected += (s, e) => option.BackgroundColor = (e?.Item as ColorMoreOptionItem).Color; - option.Clicked += (s, e) => option.BackgroundColor = Deep((e?.Item as ColorMoreOptionItem).Color); - } - } -} diff --git a/test/ElmSharp.Wearable.Test/TC/RotaryEvent1.cs b/test/ElmSharp.Wearable.Test/TC/RotaryEvent1.cs deleted file mode 100644 index a4faf1f75..000000000 --- a/test/ElmSharp.Wearable.Test/TC/RotaryEvent1.cs +++ /dev/null @@ -1,55 +0,0 @@ -using ElmSharp.Wearable; -using System; -using System.Collections.Generic; -using System.Text; - -namespace ElmSharp.Test.TC -{ - public class RotaryEvent1 : TestCaseBase - { - public override string TestName => "Rotary Event Test 1"; - - public override string TestDescription => "Wearable test for Rotary event"; - - public override void Run(Window window) - { - Log.Debug("window id is " + window.Handle.ToString()); - Rect square = window.GetInnerSquare(); - - Log.Debug(square.ToString()); - - Rectangle redSquare = new Rectangle(window) - { - Color = Color.Red, - Geometry = square - }; - redSquare.Show(); - - double degrees = 0; - - RotaryEventHandler handler = (args) => - { - if (args.IsClockwise) degrees += 10; - else degrees -= 10; - - if (degrees < 0) degrees = 360; - else if (degrees > 360) degrees = 0; - - Rect rect = redSquare.Geometry; - EvasMap map = new EvasMap(4); - map.PopulatePoints(redSquare, 0); - map.Rotate(degrees, rect.X + rect.Width / 2, rect.Y + rect.Height / 2); - redSquare.EvasMap = map; - redSquare.IsMapEnabled = true; - }; - - RotaryEventManager.Rotated += handler; - - window.BackButtonPressed += (s, e) => - { - RotaryEventManager.Rotated -= handler; - Log.Debug("handler is Removed!!!!!!!"); - }; - } - } -} diff --git a/test/ElmSharp.Wearable.Test/TC/RotaryEvent2.cs b/test/ElmSharp.Wearable.Test/TC/RotaryEvent2.cs deleted file mode 100644 index 8893d57fe..000000000 --- a/test/ElmSharp.Wearable.Test/TC/RotaryEvent2.cs +++ /dev/null @@ -1,53 +0,0 @@ -using ElmSharp.Wearable; -using System; -using System.Collections.Generic; -using System.Text; - -namespace ElmSharp.Test.TC -{ - public class RotaryEvent2 : TestCaseBase - { - public override string TestName => "Rotary Event Test 2"; - - public override string TestDescription => "Wearable test for Rotary object event"; - - Rectangle rect; - - double degrees = 0; - - void EventHandler(RotaryEventArgs args) - { - if (args.IsClockwise) degrees += 10; - else degrees -= 10; - - if (degrees < 0) degrees = 360; - else if (degrees > 360) degrees = 0; - - Rect r = rect.Geometry; - EvasMap map = new EvasMap(4); - map.PopulatePoints(rect, 0); - map.Rotate(degrees, r.X + r.Width / 2, r.Y + r.Height / 2); - rect.EvasMap = map; - rect.IsMapEnabled = true; - } - - public override void Run(Window window) - { - Rect square = window.GetInnerSquare(); - - Log.Debug(square.ToString()); - - rect = new Rectangle(window) - { - Color = Color.Blue, - Geometry = square - }; - rect.Show(); - - rect.AddRotaryEventHandler(EventHandler); - rect.Activate(); - - window.BackButtonPressed += (s, e) => rect.RemoveRotaryEventHandler(EventHandler); - } - } -} diff --git a/test/ElmSharp.Wearable.Test/TC/RotaryEvent3.cs b/test/ElmSharp.Wearable.Test/TC/RotaryEvent3.cs deleted file mode 100644 index 8c439c179..000000000 --- a/test/ElmSharp.Wearable.Test/TC/RotaryEvent3.cs +++ /dev/null @@ -1,82 +0,0 @@ -using ElmSharp.Wearable; -using System; -using System.Collections.Generic; -using System.Text; - -namespace ElmSharp.Test.TC -{ - public class RotaryEvent3 : TestCaseBase - { - public override string TestName => "Rotary Event Test 3"; - - public override string TestDescription => "Multiple wearable test for Rotary event"; - - public override void Run(Window window) - { - Log.Debug("window id is " + window.Handle.ToString()); - Rect square = window.GetInnerSquare(); - - Log.Debug(square.ToString()); - - Rectangle redSquare = new Rectangle(window) - { - Color = Color.Red, - Geometry = square - }; - redSquare.Show(); - - Rectangle blueSquare = new Rectangle(window) - { - Color = Color.Blue, - Geometry = new Rect(square.X + square.Width / 4, square.Y + square.Height / 4, square.Width / 2, square.Height / 2) - }; - blueSquare.Show(); - - double degrees = 0; - double degrees2 = 0; - - RotaryEventHandler handler1 = (args) => - { - Log.Debug((args.IsClockwise ? "CW" : "CCW") + " : " + args.Timestamp); - if (args.IsClockwise) degrees2 += 10; - else degrees2 -= 10; - - if (degrees2 < 0) degrees2 = 360; - else if (degrees2 > 360) degrees2 = 0; - - Rect rect = blueSquare.Geometry; - EvasMap map = new EvasMap(4); - map.PopulatePoints(blueSquare, 0); - map.Rotate(degrees2, rect.X + rect.Width / 2, rect.Y + rect.Height / 2); - blueSquare.EvasMap = map; - blueSquare.IsMapEnabled = true; - }; - - RotaryEventHandler handler2 = (args) => - { - if (args.IsClockwise) degrees += 10; - else degrees -= 10; - - if (degrees < 0) degrees = 360; - else if (degrees > 360) degrees = 0; - - Rect rect = redSquare.Geometry; - EvasMap map = new EvasMap(4); - map.PopulatePoints(redSquare, 0); - map.Rotate(degrees, rect.X + rect.Width / 2, rect.Y + rect.Height / 2); - redSquare.EvasMap = map; - redSquare.IsMapEnabled = true; - }; - - RotaryEventManager.Rotated += handler1; - RotaryEventManager.Rotated += handler2; - - window.BackButtonPressed += (s, e) => - { - RotaryEventManager.Rotated -= handler1; - RotaryEventManager.Rotated -= handler2; - Log.Debug("handler is Removed!!!!!!!"); - }; - } - } -} diff --git a/test/ElmSharp.Wearable.Test/TC/RotarySelectorTest.cs b/test/ElmSharp.Wearable.Test/TC/RotarySelectorTest.cs deleted file mode 100644 index 549c58041..000000000 --- a/test/ElmSharp.Wearable.Test/TC/RotarySelectorTest.cs +++ /dev/null @@ -1,98 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Text; -using System.Linq; -using System.IO; - -using ElmSharp.Wearable; - -namespace ElmSharp.Test.TC -{ - class RotarySelectorTest : TestCaseBase - { - public override string TestName => "RotarySelectorTest"; - - public override string TestDescription => "Rotary Selector Widget Test"; - - Window _window; - - class MyRotarySelectorItem : RotarySelectorItem - { - public Color Color { get; set; } - public string Message { get; set; } - } - - MyRotarySelectorItem NewItem(string iconName, Color color) - { - Image img = new Image(_window); - img.Load(Path.Combine(TestRunner.ResourceDir, "icons", iconName + ".png")); - - string title = (iconName.First().ToString().ToUpper() + iconName.Substring(1)).Replace('_', ' '); - - return new MyRotarySelectorItem - { - Color = color, - Message = title, - MainText = title, - SubText = color.ToString(), - NormalIconImage = img, - - //PressedIconColor = Color.Green, - //IconColor = Color.Red, - - //BackgroundImage = img, - //BackgroundColor = Color.Blue, - //PressedBackgroundColor = Color.Red - - }; - } - - public override void Run(Window window) - { - this._window = window; - Conformant conf = new Conformant(window); - conf.Show(); - - RotarySelector selector = new RotarySelector(window) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1 - }; - selector.Show(); - - selector.Items.Add(NewItem("icon_aquamarine_260_me", Color.FromHex("#800000"))); - selector.Items.Add(NewItem("icon_auamarine_260_me", Color.FromHex("#800012"))); - selector.Items.Add(NewItem("icon_azure_215_me", Color.FromHex("#800034"))); - selector.Items.Add(NewItem("icon_beige_330_me", Color.FromHex("#800056"))); - selector.Items.Add(NewItem("icon_blue_45_me", Color.FromHex("#800067"))); - selector.Items.Add(NewItem("icon_brown_90_me", Color.FromHex("#800087"))); - selector.Items.Add(NewItem("icon_cyan_230_me", Color.FromHex("#800023"))); - selector.Items.Add(NewItem("icon_firebrick_95_me", Color.FromHex("#804300"))); - selector.Items.Add(NewItem("icon_gold_75_me", Color.FromHex("#854000"))); - selector.Items.Add(NewItem("icon_green_60_me", Color.FromHex("#800340"))); - selector.Items.Add(NewItem("icon_honeydew_285_me", Color.FromHex("#823000"))); - selector.Items.Add(NewItem("icon_ivory_315_me", Color.FromHex("#806700"))); - selector.Items.Add(NewItem("icon_khaki_360_me", Color.FromHex("#80ab00"))); - selector.Items.Add(NewItem("icon_lime_300_me", Color.FromHex("#800c30"))); - selector.Items.Add(NewItem("icon_maroon_120_me", Color.FromHex("#8fd000"))); - selector.Items.Add(NewItem("icon_me", Color.FromHex("#800000"))); - selector.Items.Add(NewItem("icon_orchid_160_me", Color.FromHex("#8d3000"))); - selector.Items.Add(NewItem("icon_pink_145_me", Color.FromHex("#8002d0"))); - selector.Items.Add(NewItem("icon_purple_200_me", Color.FromHex("#8ff000"))); - selector.Items.Add(NewItem("icon_red_30_me", Color.FromHex("#800fa0"))); - selector.Items.Add(NewItem("icon_snow_75_me", Color.FromHex("#80f200"))); - selector.Items.Add(NewItem("icon_snow_80_me", Color.FromHex("#80d200"))); - selector.Items.Add(NewItem("icon_teal_245_me", Color.FromHex("#80f300"))); - selector.Items.Add(NewItem("icon_violet_180_me", Color.FromHex("#80fb00"))); - selector.Items.Add(NewItem("icon_yellow_345_me", Color.FromHex("#800b30"))); - //selector.BackgroundImage = new Image(window); - //selector.BackgroundImage.Load(Path.Combine(TestRunner.ResourceDir, "icons", "round_bg_green.png")); - //selector.BackgroundColor = Color.Pink; - //selector.PressedBackgroundColor = Color.Gray; - conf.SetContent(selector); - - } - } -} diff --git a/test/ElmSharp.Wearable.Test/TestCaseBase.cs b/test/ElmSharp.Wearable.Test/TestCaseBase.cs deleted file mode 100644 index 5803eaad2..000000000 --- a/test/ElmSharp.Wearable.Test/TestCaseBase.cs +++ /dev/null @@ -1,28 +0,0 @@ -/* - * 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 ElmSharp; - -namespace ElmSharp.Test -{ - public abstract class TestCaseBase - { - public abstract string TestName { get; } - public abstract string TestDescription { get; } - public abstract void Run(Window window); - } -} diff --git a/test/ElmSharp.Wearable.Test/TestRunner.cs b/test/ElmSharp.Wearable.Test/TestRunner.cs deleted file mode 100644 index 927f2b698..000000000 --- a/test/ElmSharp.Wearable.Test/TestRunner.cs +++ /dev/null @@ -1,217 +0,0 @@ -/* - * 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.IO; -using System.Linq; -using System.Reflection; -using System.Collections.Generic; - -using Tizen.Applications; - -namespace ElmSharp.Test -{ - public class TestRunner : CoreUIApplication - { - internal Window _firstPageWindow; - private static bool s_terminated; - - public static string ResourceDir { get; private set; } - - public TestRunner() - { - s_terminated = false; - } - - protected override void OnCreate() - { - ResourceDir = DirectoryInfo.Resource; - - var testCases = GetTestCases(); - CreateFirstPage(testCases); - base.OnCreate(); - } - - protected override void OnTerminate() - { - s_terminated = true; - base.OnTerminate(); - } - - public void RunStandalone(string[] args) - { - ResourceDir = Path.Combine(Path.GetDirectoryName(typeof(TestRunner).GetTypeInfo().Assembly.Location), "res"); - - EcoreSynchronizationContext.Initialize(); - - var testCases = GetTestCases(); - TestCaseBase theTest = null; - - if (args.Count() > 0) - { - theTest = testCases.Where((testCase) => testCase.TestName == args[0] || testCase.GetType().ToString() == args[0]).FirstOrDefault(); - } - - if (theTest != null) - { - StartTC(theTest); - EcoreMainloop.Begin(); - } - else - { - CreateFirstPage(testCases); - EcoreMainloop.Begin(); - } - - Elementary.Shutdown(); - } - - private IEnumerable GetTestCases() - { - Assembly asm = typeof(TestRunner).GetTypeInfo().Assembly; - Type testCaseType = typeof(TestCaseBase); - - var tests = from test in asm.GetTypes() - where testCaseType.IsAssignableFrom(test) && !test.GetTypeInfo().IsInterface && !test.GetTypeInfo().IsAbstract - select Activator.CreateInstance(test) as TestCaseBase; - - return from test in tests - orderby test.TestName - select test; - } - - internal static void UIExit() - { - EcoreMainloop.Quit(); - } - - private Window CreateWindow(bool isSecond = false) - { - Window window = new Window("ElmSharp UI Tests") - { - AvailableRotations = DisplayRotation.Degree_0 | DisplayRotation.Degree_180 | DisplayRotation.Degree_270 | DisplayRotation.Degree_90 - }; - window.Show(); - if (isSecond) - { - window.BackButtonPressed += (s, e) => - { - window.Hide(); - window.Unrealize(); - GC.Collect(); - GC.WaitForPendingFinalizers(); - }; - } - else - { - window.BackButtonPressed += (s, e) => - { - UIExit(); - }; - } - return window; - } - - private void CreateFirstPage(IEnumerable testCases) - { - _firstPageWindow = CreateWindow(); - Console.WriteLine("Screen DPI : {0}", _firstPageWindow.ScreenDpi.X); - Conformant conformant = new Conformant(_firstPageWindow); - conformant.Show(); - Box box = new Box(_firstPageWindow) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - }; - box.Show(); - var bg = new Background(_firstPageWindow); - bg.Color = Color.White; - bg.SetContent(box); - conformant.SetContent(bg); - - GenList list = new GenList(_firstPageWindow) - { - Homogeneous = true, - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1 - }; - - GenItemClass defaultClass = new GenItemClass("default") - { - GetTextHandler = (data, part) => - { - return string.Format("{0}",(string)data); - } - }; - - list.Append(defaultClass, ""); - foreach (var tc in testCases) - { - list.Append(defaultClass, tc.TestName); - } - list.Append(defaultClass, ""); - - list.ItemSelected += (s, e) => - { - foreach (var tc in testCases) - { - if (tc.TestName == (string)(e.Item.Data)) - { - StartTCFromList(tc); - break; - } - } - }; - list.Show(); - - box.PackEnd(list); - } - - private void StartTC(TestCaseBase tc) - { - Window window = CreateWindow(); - tc.Run(window); - } - - private void StartTCFromList(TestCaseBase tc) - { - Window window = CreateWindow(true); - tc.Run(window); - } - - static void Main(string[] args) - { - Elementary.Initialize(); - Elementary.ThemeOverlay(); - - Console.WriteLine("ELM_PROFILE : {0}", Elementary.GetProfile()); - Console.WriteLine("ELM_SCALE : {0}", Elementary.GetScale()); - - TestRunner testRunner = new TestRunner(); - testRunner.Run(args); - - // if running with appfw is failed, below line will be executed. - if (!s_terminated) - { - testRunner.RunStandalone(args); - } - } - } -} diff --git a/test/ElmSharp.Wearable.Test/res/icons/bg_black.png b/test/ElmSharp.Wearable.Test/res/icons/bg_black.png deleted file mode 100644 index 08a258a2b..000000000 Binary files a/test/ElmSharp.Wearable.Test/res/icons/bg_black.png and /dev/null differ diff --git a/test/ElmSharp.Wearable.Test/res/icons/bg_red.png b/test/ElmSharp.Wearable.Test/res/icons/bg_red.png deleted file mode 100644 index b8ccbb5b4..000000000 Binary files a/test/ElmSharp.Wearable.Test/res/icons/bg_red.png and /dev/null differ diff --git a/test/ElmSharp.Wearable.Test/res/icons/bg_white.png b/test/ElmSharp.Wearable.Test/res/icons/bg_white.png deleted file mode 100644 index 1041aa08d..000000000 Binary files a/test/ElmSharp.Wearable.Test/res/icons/bg_white.png and /dev/null differ diff --git a/test/ElmSharp.Wearable.Test/res/icons/icon_aquamarine_260_me.png b/test/ElmSharp.Wearable.Test/res/icons/icon_aquamarine_260_me.png deleted file mode 100644 index f6ea11067..000000000 Binary files a/test/ElmSharp.Wearable.Test/res/icons/icon_aquamarine_260_me.png and /dev/null differ diff --git a/test/ElmSharp.Wearable.Test/res/icons/icon_auamarine_260_me.png b/test/ElmSharp.Wearable.Test/res/icons/icon_auamarine_260_me.png deleted file mode 100644 index d35eeca1b..000000000 Binary files a/test/ElmSharp.Wearable.Test/res/icons/icon_auamarine_260_me.png and /dev/null differ diff --git a/test/ElmSharp.Wearable.Test/res/icons/icon_azure_215_me.png b/test/ElmSharp.Wearable.Test/res/icons/icon_azure_215_me.png deleted file mode 100644 index 17e613c61..000000000 Binary files a/test/ElmSharp.Wearable.Test/res/icons/icon_azure_215_me.png and /dev/null differ diff --git a/test/ElmSharp.Wearable.Test/res/icons/icon_beige_330_me.png b/test/ElmSharp.Wearable.Test/res/icons/icon_beige_330_me.png deleted file mode 100644 index 7bfac095a..000000000 Binary files a/test/ElmSharp.Wearable.Test/res/icons/icon_beige_330_me.png and /dev/null differ diff --git a/test/ElmSharp.Wearable.Test/res/icons/icon_blue_45_me.png b/test/ElmSharp.Wearable.Test/res/icons/icon_blue_45_me.png deleted file mode 100644 index 7da3ffa3a..000000000 Binary files a/test/ElmSharp.Wearable.Test/res/icons/icon_blue_45_me.png and /dev/null differ diff --git a/test/ElmSharp.Wearable.Test/res/icons/icon_brown_90_me.png b/test/ElmSharp.Wearable.Test/res/icons/icon_brown_90_me.png deleted file mode 100644 index 4b176aa9b..000000000 Binary files a/test/ElmSharp.Wearable.Test/res/icons/icon_brown_90_me.png and /dev/null differ diff --git a/test/ElmSharp.Wearable.Test/res/icons/icon_cyan_230_me.png b/test/ElmSharp.Wearable.Test/res/icons/icon_cyan_230_me.png deleted file mode 100644 index c846907dd..000000000 Binary files a/test/ElmSharp.Wearable.Test/res/icons/icon_cyan_230_me.png and /dev/null differ diff --git a/test/ElmSharp.Wearable.Test/res/icons/icon_firebrick_95_me.png b/test/ElmSharp.Wearable.Test/res/icons/icon_firebrick_95_me.png deleted file mode 100644 index faaeb6c19..000000000 Binary files a/test/ElmSharp.Wearable.Test/res/icons/icon_firebrick_95_me.png and /dev/null differ diff --git a/test/ElmSharp.Wearable.Test/res/icons/icon_gold_75_me.png b/test/ElmSharp.Wearable.Test/res/icons/icon_gold_75_me.png deleted file mode 100644 index b0a23b7ed..000000000 Binary files a/test/ElmSharp.Wearable.Test/res/icons/icon_gold_75_me.png and /dev/null differ diff --git a/test/ElmSharp.Wearable.Test/res/icons/icon_green_60_me.png b/test/ElmSharp.Wearable.Test/res/icons/icon_green_60_me.png deleted file mode 100644 index 617703f16..000000000 Binary files a/test/ElmSharp.Wearable.Test/res/icons/icon_green_60_me.png and /dev/null differ diff --git a/test/ElmSharp.Wearable.Test/res/icons/icon_honeydew_285_me.png b/test/ElmSharp.Wearable.Test/res/icons/icon_honeydew_285_me.png deleted file mode 100644 index b25e59c08..000000000 Binary files a/test/ElmSharp.Wearable.Test/res/icons/icon_honeydew_285_me.png and /dev/null differ diff --git a/test/ElmSharp.Wearable.Test/res/icons/icon_ivory_315_me.png b/test/ElmSharp.Wearable.Test/res/icons/icon_ivory_315_me.png deleted file mode 100644 index 1617f72dc..000000000 Binary files a/test/ElmSharp.Wearable.Test/res/icons/icon_ivory_315_me.png and /dev/null differ diff --git a/test/ElmSharp.Wearable.Test/res/icons/icon_khaki_360_me.png b/test/ElmSharp.Wearable.Test/res/icons/icon_khaki_360_me.png deleted file mode 100644 index 89ee89780..000000000 Binary files a/test/ElmSharp.Wearable.Test/res/icons/icon_khaki_360_me.png and /dev/null differ diff --git a/test/ElmSharp.Wearable.Test/res/icons/icon_lime_300_me.png b/test/ElmSharp.Wearable.Test/res/icons/icon_lime_300_me.png deleted file mode 100644 index 685c002d7..000000000 Binary files a/test/ElmSharp.Wearable.Test/res/icons/icon_lime_300_me.png and /dev/null differ diff --git a/test/ElmSharp.Wearable.Test/res/icons/icon_maroon_120_me.png b/test/ElmSharp.Wearable.Test/res/icons/icon_maroon_120_me.png deleted file mode 100644 index 822d1ecac..000000000 Binary files a/test/ElmSharp.Wearable.Test/res/icons/icon_maroon_120_me.png and /dev/null differ diff --git a/test/ElmSharp.Wearable.Test/res/icons/icon_me.png b/test/ElmSharp.Wearable.Test/res/icons/icon_me.png deleted file mode 100644 index a0ec18c5d..000000000 Binary files a/test/ElmSharp.Wearable.Test/res/icons/icon_me.png and /dev/null differ diff --git a/test/ElmSharp.Wearable.Test/res/icons/icon_orchid_160_me.png b/test/ElmSharp.Wearable.Test/res/icons/icon_orchid_160_me.png deleted file mode 100644 index c06348381..000000000 Binary files a/test/ElmSharp.Wearable.Test/res/icons/icon_orchid_160_me.png and /dev/null differ diff --git a/test/ElmSharp.Wearable.Test/res/icons/icon_pink_145_me.png b/test/ElmSharp.Wearable.Test/res/icons/icon_pink_145_me.png deleted file mode 100644 index d0934f0b8..000000000 Binary files a/test/ElmSharp.Wearable.Test/res/icons/icon_pink_145_me.png and /dev/null differ diff --git a/test/ElmSharp.Wearable.Test/res/icons/icon_purple_200_me.png b/test/ElmSharp.Wearable.Test/res/icons/icon_purple_200_me.png deleted file mode 100644 index 69468e21a..000000000 Binary files a/test/ElmSharp.Wearable.Test/res/icons/icon_purple_200_me.png and /dev/null differ diff --git a/test/ElmSharp.Wearable.Test/res/icons/icon_red_30_me.png b/test/ElmSharp.Wearable.Test/res/icons/icon_red_30_me.png deleted file mode 100644 index 66bbd09d4..000000000 Binary files a/test/ElmSharp.Wearable.Test/res/icons/icon_red_30_me.png and /dev/null differ diff --git a/test/ElmSharp.Wearable.Test/res/icons/icon_snow_75_me.png b/test/ElmSharp.Wearable.Test/res/icons/icon_snow_75_me.png deleted file mode 100644 index e6d82d77a..000000000 Binary files a/test/ElmSharp.Wearable.Test/res/icons/icon_snow_75_me.png and /dev/null differ diff --git a/test/ElmSharp.Wearable.Test/res/icons/icon_snow_80_me.png b/test/ElmSharp.Wearable.Test/res/icons/icon_snow_80_me.png deleted file mode 100644 index b419131a0..000000000 Binary files a/test/ElmSharp.Wearable.Test/res/icons/icon_snow_80_me.png and /dev/null differ diff --git a/test/ElmSharp.Wearable.Test/res/icons/icon_teal_245_me.png b/test/ElmSharp.Wearable.Test/res/icons/icon_teal_245_me.png deleted file mode 100644 index db1a10c37..000000000 Binary files a/test/ElmSharp.Wearable.Test/res/icons/icon_teal_245_me.png and /dev/null differ diff --git a/test/ElmSharp.Wearable.Test/res/icons/icon_violet_180_me.png b/test/ElmSharp.Wearable.Test/res/icons/icon_violet_180_me.png deleted file mode 100644 index df07406e2..000000000 Binary files a/test/ElmSharp.Wearable.Test/res/icons/icon_violet_180_me.png and /dev/null differ diff --git a/test/ElmSharp.Wearable.Test/res/icons/icon_yellow_345_me.png b/test/ElmSharp.Wearable.Test/res/icons/icon_yellow_345_me.png deleted file mode 100644 index 9af0e0f1e..000000000 Binary files a/test/ElmSharp.Wearable.Test/res/icons/icon_yellow_345_me.png and /dev/null differ diff --git a/test/ElmSharp.Wearable.Test/res/icons/make_icon.sh b/test/ElmSharp.Wearable.Test/res/icons/make_icon.sh deleted file mode 100644 index 31f6fe884..000000000 --- a/test/ElmSharp.Wearable.Test/res/icons/make_icon.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/sh - -OPTIND=1 - -while getopts "h?c:r:" opt; do - case "$opt" in - h|\?) - echo "$0 [-c color] [-r degree]" - exit 0 - ;; - c) color=$OPTARG - ;; - r) rotate=$OPTARG - ;; - esac -done - -shift $((OPTIND-1)) -filename=$1 -iconname=$2 - -if [ -z $color ]; then - color="white" -fi - -if [ -z $rotate ]; then - rotate=0 -fi - -if [ -z $toname ]; then - iconname="icon_${color}_${rotate}_$filename" -fi - -convert $filename -resize 75x75 \ - -stroke $color -fill none -draw "stroke-width 5 circle 37, 37, 60, 60" \ - \( +clone -threshold -1 -negate -fill white -draw "ellipse 37, 37 36, 36 4, 176 ellipse 37, 37, 36, 36 184, 356" \) \ - -distort SRT $rotate \ - -alpha off -compose copy_opacity -composite $iconname - diff --git a/test/ElmSharp.Wearable.Test/res/icons/me.png b/test/ElmSharp.Wearable.Test/res/icons/me.png deleted file mode 100644 index 1653fa654..000000000 Binary files a/test/ElmSharp.Wearable.Test/res/icons/me.png and /dev/null differ diff --git a/test/ElmSharp.Wearable.Test/res/icons/me_circle.png b/test/ElmSharp.Wearable.Test/res/icons/me_circle.png deleted file mode 100644 index f52d56a2a..000000000 Binary files a/test/ElmSharp.Wearable.Test/res/icons/me_circle.png and /dev/null differ diff --git a/test/ElmSharp.Wearable.Test/res/icons/me_small.png b/test/ElmSharp.Wearable.Test/res/icons/me_small.png deleted file mode 100644 index f024c7932..000000000 Binary files a/test/ElmSharp.Wearable.Test/res/icons/me_small.png and /dev/null differ diff --git a/test/ElmSharp.Wearable.Test/res/icons/pressed.png b/test/ElmSharp.Wearable.Test/res/icons/pressed.png deleted file mode 100644 index a0a9abbe9..000000000 Binary files a/test/ElmSharp.Wearable.Test/res/icons/pressed.png and /dev/null differ diff --git a/test/ElmSharp.Wearable.Test/res/icons/round_bg_green.png b/test/ElmSharp.Wearable.Test/res/icons/round_bg_green.png deleted file mode 100644 index c13f8c1f7..000000000 Binary files a/test/ElmSharp.Wearable.Test/res/icons/round_bg_green.png and /dev/null differ diff --git a/test/ElmSharp.Wearable.Test/res/icons/round_bg_white.png b/test/ElmSharp.Wearable.Test/res/icons/round_bg_white.png deleted file mode 100644 index 9499af8ae..000000000 Binary files a/test/ElmSharp.Wearable.Test/res/icons/round_bg_white.png and /dev/null differ diff --git a/test/ElmSharp.Wearable.Test/res/icons/round_bg_yellow.png b/test/ElmSharp.Wearable.Test/res/icons/round_bg_yellow.png deleted file mode 100644 index a2e1d91c9..000000000 Binary files a/test/ElmSharp.Wearable.Test/res/icons/round_bg_yellow.png and /dev/null differ diff --git a/test/ElmSharp.Wearable.Test/res/icons/round_content_black.png b/test/ElmSharp.Wearable.Test/res/icons/round_content_black.png deleted file mode 100644 index 403479192..000000000 Binary files a/test/ElmSharp.Wearable.Test/res/icons/round_content_black.png and /dev/null differ diff --git a/test/ElmSharp.Wearable.Test/res/icons/round_content_blue.png b/test/ElmSharp.Wearable.Test/res/icons/round_content_blue.png deleted file mode 100644 index f4e5be9fe..000000000 Binary files a/test/ElmSharp.Wearable.Test/res/icons/round_content_blue.png and /dev/null differ diff --git a/test/ElmSharp.Wearable.Test/res/icons/round_content_red.png b/test/ElmSharp.Wearable.Test/res/icons/round_content_red.png deleted file mode 100644 index 1951a9df0..000000000 Binary files a/test/ElmSharp.Wearable.Test/res/icons/round_content_red.png and /dev/null differ diff --git a/test/ElmSharp.Wearable.Test/shared/res/ElmSharp.Wearable.Test.png b/test/ElmSharp.Wearable.Test/shared/res/ElmSharp.Wearable.Test.png deleted file mode 100644 index 9765b1bda..000000000 Binary files a/test/ElmSharp.Wearable.Test/shared/res/ElmSharp.Wearable.Test.png and /dev/null differ diff --git a/test/ElmSharp.Wearable.Test/tizen-manifest.xml b/test/ElmSharp.Wearable.Test/tizen-manifest.xml deleted file mode 100644 index 2953a1652..000000000 --- a/test/ElmSharp.Wearable.Test/tizen-manifest.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - ElmSharp.Wearable.Test.png - - - diff --git a/test/NUITestSample/NUITestSample/NUITestSample.cs b/test/NUITestSample/NUITestSample/NUITestSample.cs new file mode 100755 index 000000000..e5131abd2 --- /dev/null +++ b/test/NUITestSample/NUITestSample/NUITestSample.cs @@ -0,0 +1,51 @@ +using System; + +namespace NUITestSample +{ + class Application + { + /// + /// The main entry point for the application. + /// + [STAThread] + static void Main(string[] args) + { + new HelloWorld.Example().Run(args); + //new WatchSample.Program().Run(args); + //new ImageViewUserShaderTest2.Test().Run(args); + //new ImageViewUserShaderTest.Test().Run(args); + //new ScreenPositionTest.Test().Run(args); + //new ImageViewOrientationCorrectionTest.Test().Run(args); + //new VisaulAnimationExample.Example().Run(args); + + //new ControlDashboard.Example().Run(args); + //new DatePickerTest.Example().Run(args); + //new DatePickerUsingJson.Example().Run(args); + //new HelloTest.Example().Run(args); + //new HelloWorldTest.Example().Run(args); + //new Test1.Example().Run(args); + //new SiblingOrderTest.Example().Run(args); + //new UserAlphaFunctionTest.Example().Run(args); + //new MyCSharpExample.Example().Run(args); + //new CustomControlTest.Example().Run(args); + //new ScrollViewTest.Example().Run(args); + //new ImageViewTest.Example().Run(args); + //new FlexContainerTest.SampleMain().Run(args); + //new DaliTest.Example().Run(args); + //new RelativeVectorTest.Example().Run(args); + //new VisaulAnimationExample.Example2().Run(args); + //new VisaulAnimationExample.Example3().Run(args); + //new VisualViewTest.Example().Run(args); + //new VisualViewTest2.VisualSample().Run(args); + //new PositionUsesPivotPointTest.Example().Run(args); + //new VisualViewTest3.Example().Run(args); + //new VisualsUsingCustomView.VisualsExample().Run(args); + //new FirstScreen.FirstScreenApp().Run(args); + //new VisualsExampleTest.Example().Run(args); + //new AsIsTest.Example().Run(args); + //new WidgetViewTest.Example().Run(args); + //new DisposeTest.Example().Run(args); + //new SvgTest.Program().Run(args); + } + } +} diff --git a/test/NUITestSample/NUITestSample/examples/HelloWorld.cs b/test/NUITestSample/NUITestSample/examples/HelloWorld.cs new file mode 100755 index 000000000..94ba48b01 --- /dev/null +++ b/test/NUITestSample/NUITestSample/examples/HelloWorld.cs @@ -0,0 +1,72 @@ +/* +* Copyright (c) 2017 Samsung Electronics Co., Ltd. +* +* 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.Threading.Tasks; +using Tizen.NUI; +using Tizen.NUI.BaseComponents; + +namespace HelloWorld +{ + class Example : NUIApplication + { + private Animation _animation; + private TextLabel _text; + private int cnt; + private View _view; + TextField textFieldPlaceholderTest; + TextLabel keySubclassTest; + + protected override void OnCreate() + { + base.OnCreate(); + Initialize(); + } + + public void Initialize() + { + Window window = Window.Instance; + window.BackgroundColor = Color.White; + + _text = new TextLabel("Hello NUI World"); + _text.Position2D = new Position2D(10, 500); + _text.HorizontalAlignment = HorizontalAlignment.Center; + _text.PointSize = 20.0f; + _text.TextColor = Color.Magenta; + window.Add(_text); + + _animation = new Animation + { + Duration = 2000 + }; + _animation.AnimateTo(_text, "Orientation", new Rotation(new Radian(new Degree(180.0f)), PositionAxis.X), 0, 500); + _animation.AnimateTo(_text, "Orientation", new Rotation(new Radian(new Degree(0.0f)), PositionAxis.X), 500, 1000); + _animation.AnimateBy(_text, "ScaleX", 3, 1000, 1500); + _animation.AnimateBy(_text, "ScaleY", 4.0f, 1500, 2000); + _animation.EndAction = Animation.EndActions.Discard; + _animation.Looping = true; + _animation.Play(); + } + + [STAThread] + static void _Main(string[] args) + { + Example example = new Example(); + example.Run(args); + } + } +} diff --git a/test/NUITestSample/NUITestSample/examples/ImageViewOrientationCorrectionTest.cs b/test/NUITestSample/NUITestSample/examples/ImageViewOrientationCorrectionTest.cs new file mode 100755 index 000000000..74c8011a4 --- /dev/null +++ b/test/NUITestSample/NUITestSample/examples/ImageViewOrientationCorrectionTest.cs @@ -0,0 +1,119 @@ +using Tizen.NUI; +using Tizen.NUI.BaseComponents; + +namespace ImageViewOrientationCorrectionTest +{ + class Test : NUIApplication + { + private static string resourcePath = Tizen.Applications.Application.Current.DirectoryInfo.Resource; + static string testUrl0 = resourcePath + "/images/test-image0.png"; + static string testUrl1 = resourcePath + "/images/test-image1.png"; + static string testUrl3 = resourcePath + "/images/test-image2.jpg"; + static string testUrl4 = resourcePath + "/images/test-image3.jpg"; + + string TAG = "NUI"; + + protected override void OnCreate() + { + base.OnCreate(); + Initialize(); + } + + TextField[] textField = new TextField[5]; + ImageView[] imageView = new ImageView[5]; + int resol = 1; + int iPointSize = 20; + + void Initialize() + { + Window window = Window.Instance; + window.BackgroundColor = Color.White; + Vector2 dpi = new Vector2(); + dpi = window.Dpi; + Tizen.Log.Fatal(TAG, $"Window.Dpi X={dpi.X}, Y={dpi.Y}"); + + textField[0] = new TextField(); + textField[0].Size2D = new Size2D(350 * resol, 64 * resol); + textField[0].Position2D = new Position2D(10 * resol, 600 * resol); + textField[0].PivotPoint = PivotPoint.TopLeft; + textField[0].BackgroundColor = Color.White; + textField[0].PointSize = iPointSize * resol; + textField[0].Text = "png file, orientation correct=false"; + textField[0].TextColor = Color.Red; + + textField[1] = new TextField(); + textField[1].Size2D = new Size2D(350 * resol, 64 * resol); + textField[1].Position2D = new Position2D(400 * resol, 600 * resol); + textField[1].PivotPoint = PivotPoint.TopLeft; + textField[1].BackgroundColor = Color.White; + textField[1].PointSize = iPointSize * resol; + textField[1].Text = "png file, orientation correct=true"; + textField[1].TextColor = Color.Red; + + textField[2] = new TextField(); + textField[2].Size2D = new Size2D(350 * resol, 64 * resol); + textField[2].Position2D = new Position2D(750 * resol, 600 * resol); + textField[2].PivotPoint = PivotPoint.TopLeft; + textField[2].BackgroundColor = Color.White; + textField[2].PointSize = iPointSize * resol; + textField[2].Text = "jpg file, orientation correct=false"; + textField[2].TextColor = Color.Red; + + textField[3] = new TextField(); + textField[3].Size2D = new Size2D(350 * resol, 64 * resol); + textField[3].Position2D = new Position2D(1100 * resol, 600 * resol); + textField[3].PivotPoint = PivotPoint.TopLeft; + textField[3].BackgroundColor = Color.White; + textField[3].PointSize = iPointSize * resol; + textField[3].Text = "jpg file, orientation correct=true"; + textField[3].TextColor = Color.Red; + + window.Add(textField[0]); + window.Add(textField[1]); + window.Add(textField[2]); + window.Add(textField[3]); + + //Tizen.Log.Fatal(TAG, $"imageView[0].ResourceUrl={imageView[0].ResourceUrl}"); + + imageView[0] = new ImageView(); + imageView[0].ResourceUrl = testUrl0; + //imageView[0].OrientationCorrection = false; + imageView[0].Size2D = new Size2D(300 * resol, 400 * resol); + imageView[0].Position2D = new Position2D(10 * resol, 20 * resol); + imageView[0].PivotPoint = PivotPoint.TopLeft; + imageView[0].ParentOrigin = ParentOrigin.TopLeft; + imageView[0].BackgroundColor = Color.Black; + window.Add(imageView[0]); + + imageView[1] = new ImageView(); + imageView[1].ResourceUrl = testUrl1; + //imageView[1].OrientationCorrection = true; + imageView[1].Size2D = new Size2D(300 * resol, 400 * resol); + imageView[1].Position2D = new Position2D(400 * resol, 20 * resol); + imageView[1].PivotPoint = PivotPoint.TopLeft; + imageView[1].ParentOrigin = ParentOrigin.TopLeft; + imageView[1].BackgroundColor = Color.Black; + window.Add(imageView[1]); + + imageView[2] = new ImageView(); + imageView[2].ResourceUrl = testUrl3; + //imageView[2].OrientationCorrection = false; + imageView[2].Size2D = new Size2D(300 * resol, 400 * resol); + imageView[2].Position2D = new Position2D(750 * resol, 20 * resol); + imageView[2].PivotPoint = PivotPoint.TopLeft; + imageView[2].ParentOrigin = ParentOrigin.TopLeft; + imageView[2].BackgroundColor = Color.Black; + window.Add(imageView[2]); + + imageView[3] = new ImageView(); + imageView[3].ResourceUrl = testUrl4; + //imageView[3].OrientationCorrection = true; + imageView[3].Size2D = new Size2D(300 * resol, 400 * resol); + imageView[3].Position2D = new Position2D(1100 * resol, 20 * resol); + imageView[3].PivotPoint = PivotPoint.TopLeft; + imageView[3].ParentOrigin = ParentOrigin.TopLeft; + imageView[3].BackgroundColor = Color.Black; + window.Add(imageView[3]); + } + } +} diff --git a/test/NUITestSample/NUITestSample/examples/ImageViewUserShaderTest.cs b/test/NUITestSample/NUITestSample/examples/ImageViewUserShaderTest.cs new file mode 100755 index 000000000..97e1f9a53 --- /dev/null +++ b/test/NUITestSample/NUITestSample/examples/ImageViewUserShaderTest.cs @@ -0,0 +1,145 @@ +using System; +using Tizen.NUI; +using Tizen.NUI.BaseComponents; + +namespace ImageViewUserShaderTest +{ + class Test : NUIApplication + { + public Test() : base("", WindowMode.Transparent) + { + } + + protected override void OnCreate() + { + base.OnCreate(); + Initialize(); + } + static string TAG = "NUI"; + static readonly string vertexShaderSource = + "attribute mediump vec2 aPosition;\n" + + "uniform mediump mat4 uMvpMatrix;\n" + + "uniform mediump vec3 uSize;\n" + + "varying mediump vec2 vTexCoord;\n" + + "\n" + + "void main()\n" + + "{\n" + + " mediump vec4 position = vec4( aPosition, 0.0, 1.0 );\n" + + " position.xyz *= uSize;\n" + + " gl_Position = uMvpMatrix * position;\n" + + " vTexCoord = aPosition + vec2( 0.5 );\n" + + "}\n"; + + static readonly string fragmentShaderSource = + "varying mediump vec2 vTexCoord;\n" + + "uniform lowp vec4 uColor;\n" + + "uniform sampler2D sTexture;\n" + + "\n" + + "void main()\n" + + "{\n" + + " lowp vec4 color = texture2D( sTexture, vTexCoord ) * uColor;\n" + + " gl_FragColor = vec4(vec3(1.0) - color.rgb, color.a);\n" + + "}\n"; + + Timer timer; + Window window; + ImageView imageView, imageView2; + private static string resourcePath = Tizen.Applications.Application.Current.DirectoryInfo.Resource; + static string url_shader = resourcePath + "/images/image-2.jpg"; + void Initialize() + { + window = Window.Instance; + window.BackgroundColor = new Color(0.0f, 0.0f, 0.0f, 0.0f); + + Tizen.Log.Fatal(TAG, $"url_shader={url_shader}"); + imageView = new ImageView(url_shader); + imageView.PositionUsesPivotPoint = true; + imageView.PivotPoint = PivotPoint.Center; + imageView.ParentOrigin = ParentOrigin.Center; + imageView.Size2D = new Size2D(500, 500); + Tizen.Log.Fatal(TAG, $"#1 imageView.LoadingStatus={imageView.LoadingStatus}"); + window.Add(imageView); + + map = new PropertyMap(); + customShader = new PropertyMap(); + customShader.Add("vertexShader", new PropertyValue(vertexShaderSource)); + customShader.Add("fragmentShader", new PropertyValue(fragmentShaderSource)); + map.Add("shader", new PropertyValue(customShader)); + //imageView.Image = map; + + Tizen.Log.Fatal(TAG, $"#2 imageView.LoadingStatus={imageView.LoadingStatus}"); + + timer = new Timer(1000); + timer.Tick += Timer_Tick; + timer.Start(); + + string url = " "; + imageView2 = new ImageView(url); + imageView2.PositionUsesPivotPoint = true; + imageView2.PivotPoint = PivotPoint.BottomCenter; + imageView2.ParentOrigin = ParentOrigin.BottomCenter; + imageView2.Size2D = new Size2D(300, 300); + Tizen.Log.Fatal(TAG, $"###1 imageView2.LoadingStatus={imageView2.LoadingStatus}"); + window.Add(imageView2); + Tizen.Log.Fatal(TAG, $"###2 imageView2.LoadingStatus={imageView2.LoadingStatus}"); + } + + int cnt; + PropertyMap map; + PropertyMap customShader; + private bool Timer_Tick(object source, Timer.TickEventArgs e) + { + Tizen.Log.Fatal(TAG, $"#3 imageView.LoadingStatus={imageView?.LoadingStatus}"); + Tizen.Log.Fatal(TAG, $"###3 imageView2.LoadingStatus={imageView2?.LoadingStatus}"); + Tizen.Log.Fatal(TAG, $"Timer_Tick() comes!"); + + if (cnt++ % 2 == 0) + { + map.Clear(); + customShader.Clear(); + map.Add("shader", new PropertyValue(customShader)); + //imageView.Image = map; + } + else + { + map.Clear(); + customShader.Clear(); + customShader.Add("vertexShader", new PropertyValue(vertexShaderSource)); + customShader.Add("fragmentShader", new PropertyValue(fragmentShaderSource)); + map.Add("shader", new PropertyValue(customShader)); + //imageView.Image = map; + } + + Tizen.Log.Fatal(TAG, $"#4 imageView.LoadingStatus={imageView.LoadingStatus}"); + + if (cnt % 3 == 0) + { + //window.SetTransparency(false); + Random rand = new Random(); + float value = rand.Next(0, 255) / 255.0f; + window.BackgroundColor = new Color(value, value, 1 - value, 1.0f); + } + else + { + //window.SetTransparency(true); + window.BackgroundColor = new Color(0, 0, 0, 0); + } + + string url1 = resourcePath + "/images/image-" + (cnt % 3 + 1) + ".jpg"; + Tizen.Log.Fatal(TAG, $"url1={url1}"); + imageView2?.Dispose(); + imageView2 = null; + imageView2 = new ImageView(url1); + imageView2.PositionUsesPivotPoint = true; + imageView2.PivotPoint = PivotPoint.BottomCenter; + imageView2.ParentOrigin = ParentOrigin.BottomCenter; + imageView2.Size2D = new Size2D(300, 300); + Tizen.Log.Fatal(TAG, $"###4 imageView2.LoadingStatus={imageView2.LoadingStatus}"); + window.Add(imageView2); + + Tizen.Log.Fatal(TAG, $"#5 imageView.LoadingStatus={imageView.LoadingStatus}"); + Tizen.Log.Fatal(TAG, $"###5 imageView2.LoadingStatus={imageView2.LoadingStatus}"); + return true; + } + } +} diff --git a/test/NUITestSample/NUITestSample/examples/ImageViewUserShaderTest2.cs b/test/NUITestSample/NUITestSample/examples/ImageViewUserShaderTest2.cs new file mode 100755 index 000000000..4e77a393d --- /dev/null +++ b/test/NUITestSample/NUITestSample/examples/ImageViewUserShaderTest2.cs @@ -0,0 +1,110 @@ +using Tizen.NUI; +using Tizen.NUI.BaseComponents; + +namespace ImageViewUserShaderTest2 +{ + internal class Test : NUIApplication + { + private string vertexShader = + "attribute mediump vec2 aPosition;\n" + + "uniform mediump mat4 uMvpMatrix;\n" + + "uniform mediump vec3 uSize;\n" + + "varying mediump vec2 vTexCoord;\n" + + "\n" + + "void main()\n" + + "{\n" + + " mediump vec4 position = vec4( aPosition, 0.0, 1.0 );\n" + + " position.xyz *= uSize;\n" + + " gl_Position = uMvpMatrix * position;\n" + + " vTexCoord = aPosition + vec2( 0.5 );\n" + + "}\n"; + + private readonly string fragmentShader = + + "varying mediump vec2 vTexCoord;\n" + + "uniform lowp vec4 uColor;\n" + + "uniform sampler2D sTexture;\n" + + "uniform mediump vec4 userColor;\n" + + "\n" + + "void main()\n" + + "{\n" + + " mediump vec4 blend_color = userColor;\n" + + " mediump vec4 fColor = vec4(1.0, 1.0, 1.0, texture2D( sTexture, vTexCoord ).a);\n" + + " gl_FragColor = blend_color * fColor * uColor;\n" + + "}\n"; + + + private View myView; + private ImageView myImageView; + private int count = 0; + private bool changeImgResource = true; + static string res = Tizen.Applications.Application.Current.DirectoryInfo.Resource; + + protected override void OnCreate() + { + base.OnCreate(); + + Window.Instance.BackgroundColor = Color.White; + + //Create a View instance and add it to the stage + myView = new View(); + myView.Focusable = true; + myView.KeyEvent += MyView_KeyEvent; + + Window.Instance.GetDefaultLayer().Add(myView); + + myImageView = new ImageView(@res + @"/images/star-dim.png"); + myImageView.Size2D = new Size2D(96, 96); + myImageView.Position2D = new Position2D(400, 400); + + ChangePropertyMap(Color.Red); + + Window.Instance.GetDefaultLayer().Add(myImageView); + + FocusManager.Instance.SetCurrentFocusView(myView); + } + + private bool MyView_KeyEvent(object source, View.KeyEventArgs e) + { + if (e.Key.State == Key.StateType.Down) + { + if (e.Key.KeyPressedName == "Right") + { + switch (count++ % 2) + { + case 0: + if (changeImgResource) + { + myImageView.SetImage(@res + @"/images/mask.png"); + } + ChangePropertyMap(Color.Blue); + break; + case 1: + if (changeImgResource) + { + myImageView.SetImage(@res + @"/images/star-dim.png"); + } + ChangePropertyMap(Color.Green); + break; + } + } + } + + return false; + } + + private void ChangePropertyMap(Color color) + { + PropertyMap shaderMap = new PropertyMap(); + shaderMap.Add("vertexShader", new PropertyValue(vertexShader)); + shaderMap.Add("fragmentShader", new PropertyValue(fragmentShader)); + + PropertyMap imageMap = new PropertyMap(); + imageMap.Add("shader", new PropertyValue(shaderMap)); + //myImageView.Image = imageMap; + + myImageView.RegisterProperty("userColor", new PropertyValue(color)); + } + + } +} \ No newline at end of file diff --git a/test/NUITestSample/NUITestSample/examples/ScreenPositionTest.cs b/test/NUITestSample/NUITestSample/examples/ScreenPositionTest.cs new file mode 100755 index 000000000..44d9c2a01 --- /dev/null +++ b/test/NUITestSample/NUITestSample/examples/ScreenPositionTest.cs @@ -0,0 +1,226 @@ +using System; +using Tizen.NUI; +using Tizen.NUI.BaseComponents; + +namespace ScreenPositionTest +{ + class Test : NUIApplication + { + protected override void OnCreate() + { + base.OnCreate(); + StartTest(); + } + const string TAG = "NUI"; + public class MyView + { + public TextLabel textLabelName; + public TextLabel textLabelPosition; + public TextLabel textLabelScreenPosition; + public View myView; + public MyView(string name, Size2D mySize, View parent, int textSize) + { + myView = new View(); + myView.Name = name; + + textLabelName = new TextLabel($"{name} size=({mySize.Width},{mySize.Height}) parent name={parent?.Name} "); + textLabelName.PositionUsesPivotPoint = true; + textLabelName.ParentOrigin = Tizen.NUI.ParentOrigin.TopLeft; + textLabelName.PivotPoint = Tizen.NUI.PivotPoint.TopLeft; + textLabelName.PixelSize = textSize; + myView.Add(textLabelName); + + textLabelPosition = new TextLabel("Not Set"); + textLabelPosition.PositionUsesPivotPoint = true; + textLabelPosition.ParentOrigin = Tizen.NUI.ParentOrigin.CenterLeft; + textLabelPosition.PivotPoint = Tizen.NUI.PivotPoint.CenterLeft; + textLabelPosition.PixelSize = textSize; + myView.Add(textLabelPosition); + + textLabelScreenPosition = new TextLabel("Not Available"); + textLabelScreenPosition.PositionUsesPivotPoint = true; + textLabelScreenPosition.ParentOrigin = Tizen.NUI.ParentOrigin.BottomLeft; + textLabelScreenPosition.PivotPoint = Tizen.NUI.PivotPoint.BottomLeft; + textLabelScreenPosition.PixelSize = textSize; + myView.Add(textLabelScreenPosition); + + myView.Size2D = mySize; + Random rand = new Random(); + float col = rand.Next(1, 255) / 255.0f; + myView.BackgroundColor = new Color(col, 1 - col, col, 1.0f); + + if (parent == null) + { + Window.Instance.Add(myView); + } + else + { + parent.Add(myView); + } + + myView.Focusable = true; + Tizen.Log.Fatal(TAG, $"myView constructor! name={name}"); + } + Position2D myPos; + public Position2D MyPosition + { + set + { + myPos = value; + myView.Position2D = myPos; + } + get + { + return myPos; + } + } + int updatedCnt = 0; + public void UpdateMe() + { + textLabelPosition.Text = $"position=({(int)myView.Position2D.X},{(int)myView.Position2D.Y}) updated count={updatedCnt++} "; + textLabelScreenPosition.Text = $"screen position=({(int)myView.ScreenPosition.X},{(int)myView.ScreenPosition.Y}) "; + //Tizen.Log.Fatal(TAG, $"### now UpdateMe()!"); + } + } + + MyView myView1, myView2, myView3; + TextLabel parent; + Animation ani; + Timer timer; + void ScreenPositionTest() + { + parent = new TextLabel("This is parent view: Position(100,100) ParentOrigin & PivotPoint are all TopLeft, Push OK button! then Grid coordinate will be updated!"); + parent.PixelSize = 17; + parent.Size2D = new Size2D(1000, 50); + parent.Position2D = new Position2D(100, 100); + parent.Name = "parent view"; + parent.BackgroundColor = Color.Yellow; + Window.Instance.Add(parent); + + myView1 = new MyView("my view1", new Size2D(500, 100), parent, 20); + myView1.MyPosition = new Position2D(100, 100); + + myView2 = new MyView("my view2", new Size2D(500, 100), myView1.myView, 20); + myView2.MyPosition = new Position2D(100, 100); + + myView3 = new MyView("my view3", new Size2D(500, 100), myView2.myView, 20); + myView3.MyPosition = new Position2D(100, 100); + + timer = new Timer(300); + timer.Tick += Timer_Tick; + timer.Start(); + + ani = new Animation(); + ani.AnimateTo(myView1.myView, "Position", new Position(1000, 100, 0), 1000, 50000); + ani.AnimateTo(myView2.myView, "Position", new Position(100, 1000, 0), 1000, 50000); + ani.AnimateTo(myView3.myView, "Position", new Position(-800, 100, 0), 1000, 50000); + ani.EndAction = Animation.EndActions.Discard; + ani.Looping = true; + ani.Play(); + } + private bool Timer_Tick(object source, Timer.TickEventArgs e) + { + myView1.UpdateMe(); + myView2.UpdateMe(); + myView3.UpdateMe(); + return true; + } + + public class MyGrid + { + public TextLabel textLabel; + public View myGrid; + public MyGrid(Position2D myPosition, Size2D mySize, View parent, int textSize) + { + myGrid = new View(); + myGrid.Position2D = myPosition; + myGrid.Size2D = mySize; + Random rand = new Random(); + float col = rand.Next(1, 255) / 255.0f; + myGrid.BackgroundColor = new Color(col, 1 - col, col, 1.0f); + + textLabel = new TextLabel($"({myGrid.ScreenPosition?.X},{myGrid.ScreenPosition?.Y})"); + textLabel.PixelSize = textSize; + textLabel.Position2D = new Position2D(10, 10); + textLabel.Size2D = new Size2D(100, 100); + myGrid.Add(textLabel); + + if (parent == null) + { + Window.Instance.Add(myGrid); + } + else + { + parent.Add(myGrid); + } + } + public void UpdateMe() + { + textLabel.Text = $"({ myGrid.ScreenPosition.X},{ myGrid.ScreenPosition.Y})"; + } + } + + MyGrid[] gridVertical = new MyGrid[20]; + MyGrid[] gridHorizontal = new MyGrid[11]; + void DrawGrid() + { + gridVertical[0] = new MyGrid(new Position2D(0, 0), new Size2D(2, 1100), null, 10); + for (int i = 1; i < 20; i++) + { + gridVertical[i] = new MyGrid(new Position2D(100, 0), new Size2D(2, 1100), gridVertical[i - 1].myGrid, 10); + } + + gridHorizontal[0] = new MyGrid(new Position2D(0, 0), new Size2D(2000, 2), null, 10); + for (int i = 1; i < 11; i++) + { + gridHorizontal[i] = new MyGrid(new Position2D(0, 100), new Size2D(2000, 2), gridHorizontal[i - 1].myGrid, 10); + } + } + + TextLabel title; + public void StartTest() + { + Window window = Window.Instance; + window.BackgroundColor = Color.White; + window.KeyEvent += OnWindowKeyEvent; + + title = new TextLabel("ScreenPosition Test"); + title.Position2D = new Position2D(10, 10); + title.PixelSize = 40.0f; + window.Add(title); + + DrawGrid(); + ScreenPositionTest(); + } + + public void OnWindowKeyEvent(object sender, Window.KeyEventArgs e) + { + Tizen.Log.Fatal("NUI", "e.Key.KeyPressedName=" + e.Key.KeyPressedName); + + if (e.Key.State == Key.StateType.Down) + { + if (e.Key.KeyPressedName == "Up") + { + } + else if (e.Key.KeyPressedName == "Down") + { + } + else if (e.Key.KeyPressedName == "Return") + { + for (int i = 0; i < 20; i++) + { + gridVertical[i].UpdateMe(); + } + for (int i = 0; i < 11; i++) + { + gridHorizontal[i].UpdateMe(); + } + } + else if (e.Key.KeyPressedName == "XF86Exit" || e.Key.KeyPressedName == "XF86Back") + { + //Exit(); + } + } + } + } +} \ No newline at end of file diff --git a/test/NUITestSample/NUITestSample/examples/VisaulAnimationExample.cs b/test/NUITestSample/NUITestSample/examples/VisaulAnimationExample.cs new file mode 100755 index 000000000..4d1f5dbf8 --- /dev/null +++ b/test/NUITestSample/NUITestSample/examples/VisaulAnimationExample.cs @@ -0,0 +1,274 @@ +using System; +using Tizen.NUI; +using Tizen.NUI.UIComponents; +using Tizen.NUI.BaseComponents; + +namespace VisaulAnimationExample +{ + class Example : NUIApplication + { + public Example() : base("", WindowMode.Opaque) + { + } + protected override void OnCreate() + { + base.OnCreate(); + CreateLayout(); + ScreenPositionTest(); + } + + const string TAG = "NUI"; + + #region screen position test + Timer timer; + void ScreenPositionTest() + { + timer = new Timer(1000); + timer.Tick += Timer_Tick; + timer.Start(); + } + private bool Timer_Tick(object source, Timer.TickEventArgs e) + { + Tizen.Log.Fatal(TAG, $"button1 position=({button1?.Position2D.X},{button1?.Position2D.Y}), screen position=({button1?.ScreenPosition.X},{button1?.ScreenPosition.Y})"); + Tizen.Log.Fatal(TAG, $"button2 position=({button2?.Position2D.X},{button2?.Position2D.Y}), screen position=({button2?.ScreenPosition.X},{button2?.ScreenPosition.Y})"); + Tizen.Log.Fatal(TAG, $"contentView position=({contentView?.Position2D.X},{contentView?.Position2D.Y}), screen position=({contentView?.ScreenPosition.X},{contentView?.ScreenPosition.Y})"); + return true; + } + #endregion + + #region visual view animation test + VisualView contentView; + TextLabel title; + PushButton button1, button2, button3; + bool active = false; + static readonly string _resPath = Tizen.Applications.Application.Current.DirectoryInfo.Resource; + + Animation animation1; + bool transitionInProgress = false; + int cnt1, cnt2; + + SVGVisual svgVisual; + AnimatedImageVisual gifVisual; + ImageVisual icon; + + Window window; + TableView titleLayout, contentLayout; + VisualView visualView1, visualView2; + void CreateLayout() + { + window = Window.Instance; + //window.SetTransparency(true); + window.BackgroundColor = new Color(1.0f, 1.0f, 1.0f, 0.7f); + + titleLayout = new TableView(2, 1); + titleLayout.Name = ("TitleLayout"); + titleLayout.PositionUsesPivotPoint = true; + titleLayout.ParentOrigin = ParentOrigin.Center; + titleLayout.PivotPoint = PivotPoint.Center; + var layoutSizeWidth = window.Size.Width * 0.7f; + var layoutSizeHeight = window.Size.Height * 0.7f; + titleLayout.Size2D = new Size2D((int)(layoutSizeWidth), (int)(layoutSizeHeight)); + titleLayout.SetCellPadding(new Size2D(10, 10)); + titleLayout.BackgroundColor = Color.Cyan; + window.Add(titleLayout); + + title = new TextLabel("Visual Transition / SVG / AGIF Example"); + title.Name = ("Title"); + title.SetStyleName("Title"); + title.WidthResizePolicy = ResizePolicyType.FillToParent; + title.HeightResizePolicy = ResizePolicyType.UseNaturalSize; + title.HorizontalAlignment = HorizontalAlignment.Center; + titleLayout.AddChild(title, new TableView.CellPosition(0, 0)); + titleLayout.SetFitHeight(0); + + contentLayout = new TableView(3, 2); + contentLayout.Name = ("ContentLayout"); + contentLayout.WidthResizePolicy = ResizePolicyType.FillToParent; + contentLayout.HeightResizePolicy = ResizePolicyType.FillToParent; + contentLayout.PivotPoint = PivotPoint.TopLeft; + contentLayout.SetCellPadding(new Size2D(10, 10)); + contentLayout.BackgroundColor = Color.Magenta; + titleLayout.AddChild(contentLayout, new TableView.CellPosition(1, 0)); + + ////////////////////////////////////////////////////////////////////// + // Create a content view + contentView = new VisualView(); + contentView.WidthResizePolicy = ResizePolicyType.SizeRelativeToParent; + contentView.HeightResizePolicy = ResizePolicyType.SizeRelativeToParent; + //contentView.Size2D = new Size2D(250, 250); + contentView.BackgroundImage = _resPath + "/images/background-blocks.jpg"; + + icon = new ImageVisual(); + icon.URL = _resPath + "/images/application-icon-0.png"; + icon.DepthIndex = 1; + icon.Size = new Size2D(50, 50); + icon.SizePolicy = VisualTransformPolicyType.Absolute; + icon.Position = new Position2D(5, 5); + icon.PositionPolicy = VisualTransformPolicyType.Absolute; + icon.Origin = Visual.AlignType.TopBegin; + icon.AnchorPoint = Visual.AlignType.TopBegin; + icon.MixColor = new Color(0, 1, 0, 0.5f); + icon.Opacity = 0.5f; + contentView.AddVisual("icon_visual1", icon); + + contentLayout.AddChild(contentView, new TableView.CellPosition(0, 0)); + + button1 = new PushButton(); + button1.LabelText = "Toggle Transition"; + button1.Name = ("ToggleTransition"); + button1.ParentOrigin = ParentOrigin.Center; + button1.PivotPoint = PivotPoint.Center; + button1.Clicked += (obj, ev) => + { + active = !active; + StartTransition(active); + return true; + }; + button1.WidthResizePolicy = ResizePolicyType.FillToParent; + button1.HeightResizePolicy = ResizePolicyType.FillToParent; + button1.Focusable = true; + button1.UpFocusableView = button3; + button1.DownFocusableView = button2; + contentLayout.AddChild(button1, new TableView.CellPosition(0, 1)); + + ////////////////////////////////////////////////////////////////////// + // make NPatch visual test + NPatchVisual npatch1 = new NPatchVisual(); + npatch1.URL = _resPath + "/images/gallery-2.jpg"; + npatch1.Size = new Size2D(400, 400); + npatch1.SizePolicy = VisualTransformPolicyType.Absolute; + npatch1.Position = new Position2D(400, 0); + npatch1.PositionPolicy = VisualTransformPolicyType.Absolute; + npatch1.Origin = Visual.AlignType.TopBegin; + npatch1.AnchorPoint = Visual.AlignType.TopBegin; + npatch1.Border = new Rectangle(100, 100, 100, 100); + npatch1.DepthIndex = 2; + npatch1.MixColor = new Color(1, 0, 0, 1); + npatch1.Opacity = 0.5f; + contentView.AddVisual("npatchImageVisual1", npatch1); + + ////////////////////////////////////////////////////////////////////// + // make SVG visual test + visualView1 = new VisualView(); + visualView1.WidthResizePolicy = ResizePolicyType.FillToParent; + visualView1.HeightResizePolicy = ResizePolicyType.FillToParent; + visualView1.BackgroundColor = Color.Black; + contentLayout.AddChild(visualView1, new TableView.CellPosition(1, 0)); + + svgVisual = new SVGVisual(); + svgVisual.URL = _resPath + "/images/Kid1.svg"; + svgVisual.Size = new Size2D(300, 300); + svgVisual.SizePolicy = VisualTransformPolicyType.Absolute; + svgVisual.Position = new Position2D(0, 0); + svgVisual.PositionPolicy = VisualTransformPolicyType.Absolute; + svgVisual.Origin = Visual.AlignType.TopBegin; + svgVisual.AnchorPoint = Visual.AlignType.TopBegin; + visualView1.AddVisual("svg_visual1", svgVisual); + + button2 = new PushButton(); + button2.LabelText = "SVG Visual Test"; + button2.Name = ("svg_visual_test"); + button2.PivotPoint = PivotPoint.Center; + button2.WidthResizePolicy = ResizePolicyType.FillToParent; + button2.HeightResizePolicy = ResizePolicyType.FillToParent; + button2.Clicked += (obj, ev) => + { + cnt1++; + if (cnt1 % 2 == 0) + { + svgVisual.URL = _resPath + "/images/World.svg"; + } + else + { + svgVisual.URL = _resPath + "/images/Mail.svg"; + } + Tizen.Log.Fatal(TAG, "svg button clicked!"); + return true; + }; + button2.Focusable = true; + button2.UpFocusableView = button1; + button2.DownFocusableView = button2; + contentLayout.AddChild(button2, new TableView.CellPosition(1, 1)); + + ////////////////////////////////////////////////////////////////////// + // make AnimatedImage visual test + visualView2 = new VisualView(); + visualView2.WidthResizePolicy = ResizePolicyType.FillToParent; + visualView2.HeightResizePolicy = ResizePolicyType.FillToParent; + visualView2.BackgroundColor = Color.Blue; + contentLayout.AddChild(visualView2, new TableView.CellPosition(2, 0)); + + gifVisual = new AnimatedImageVisual(); + gifVisual.URL = _resPath + "/images/dog-anim.gif"; + gifVisual.Size = new Size2D(200, 200); + gifVisual.SizePolicy = VisualTransformPolicyType.Absolute; + gifVisual.Position = new Position2D(0, 0); + gifVisual.PositionPolicy = VisualTransformPolicyType.Absolute; + gifVisual.Origin = Visual.AlignType.TopBegin; + gifVisual.AnchorPoint = Visual.AlignType.TopBegin; + visualView2.AddVisual("gif_visual", gifVisual); + + button3 = new PushButton(); + button3.LabelText = "AnimatedImage Visual Test"; + button3.Name = ("gif_visual_test"); + button3.PivotPoint = PivotPoint.Center; + button3.WidthResizePolicy = ResizePolicyType.FillToParent; + button3.HeightResizePolicy = ResizePolicyType.FillToParent; + button3.Clicked += (obj, ev) => + { + Tizen.Log.Fatal(TAG, "gif button clicked!"); + cnt2++; + int gifNum = cnt2 % 15; + gifVisual.URL = _resPath + "/images/anim-gif/" + gifNum + ".gif"; + button3.LabelText = "file:" + gifNum + ".gif"; + return true; + }; + button3.Focusable = true; + button3.DownFocusableView = button1; + button3.UpFocusableView = button2; + contentLayout.AddChild(button3, new TableView.CellPosition(2, 1)); + + FocusManager.Instance.SetCurrentFocusView(button1); + } + + private void StartTransition(bool activate) + { + if (animation1) + { + animation1.Stop(); + animation1.Finished += OnTransitionFinished1; + } + + if (activate) + { + contentView.AnimateVisualAdd(icon, "Size", new Size2D(150, 150), 0, 1000, AlphaFunction.BuiltinFunctions.Linear); + contentView.AnimateVisualAdd(icon, "Position", new Position2D(40, 40), 0, 1000); + animation1 = contentView.AnimateVisualAddFinish(); + } + else + { + contentView.AnimateVisualAdd(icon, "Size", new Position2D(50, 50), 0, 1000, AlphaFunction.BuiltinFunctions.Linear); + contentView.AnimateVisualAdd(icon, "Position", new Position2D(5, 5), 0, 1000); + animation1 = contentView.AnimateVisualAddFinish(); + } + + if (animation1) + { + animation1.Finished += OnTransitionFinished1; + transitionInProgress = true; + animation1.Play(); + } + } + private void OnTransitionFinished1(object sender, EventArgs e) + { + transitionInProgress = false; + if (animation1) + { + animation1.Finished += OnTransitionFinished1; + animation1.Reset(); + } + } + #endregion + + } +} diff --git a/test/NUITestSample/NUITestSample/examples/WatchFace.cs b/test/NUITestSample/NUITestSample/examples/WatchFace.cs new file mode 100755 index 000000000..95b2ac112 --- /dev/null +++ b/test/NUITestSample/NUITestSample/examples/WatchFace.cs @@ -0,0 +1,65 @@ +using Tizen.NUI; +using Tizen.NUI.BaseComponents; + +namespace WatchSample +{ + class Program : NUIWatchApplication + { + private TextLabel text; + protected override void OnCreate() + { + base.OnCreate(); + Initialize(); + } + + protected override void OnTimeTick(TimeTickEventArgs e) + { + base.OnTimeTick(e); + text.Text = "Hello NUI Watch \n" + e.WatchTime.Hour + ":" + e.WatchTime.Minute + ":" + e.WatchTime.Second + ":" + e.WatchTime.Millisecond; + Tizen.Log.Error("NUI", "TimeTick " + e.WatchTime.TimeZone + "(" + e.WatchTime.DaylightSavingTimeStatus + ") | " + e.WatchTime.Year + "/" + e.WatchTime.Month + "/" + e.WatchTime.Day + "(" + e.WatchTime.DayOfWeek + ") " + e.WatchTime.Hour + "(" + e.WatchTime.Hour24 + "):" + e.WatchTime.Minute + ":" + e.WatchTime.Second + ":" + e.WatchTime.Millisecond + "\n"); + } + + protected override void OnAmbientTick(AmbientTickEventArgs e) + { + base.OnAmbientTick(e); + Tizen.Log.Error("NUI", "AmbientTick " + e.WatchTime.TimeZone + "(" + e.WatchTime.DaylightSavingTimeStatus + ") | " + e.WatchTime.Year + "/" + e.WatchTime.Month + "/" + e.WatchTime.Day + "(" + e.WatchTime.DayOfWeek + ") " + e.WatchTime.Hour + "(" + e.WatchTime.Hour24 + "):" + e.WatchTime.Minute + ":" + e.WatchTime.Second + ":" + e.WatchTime.Millisecond + "\n"); + } + + protected override void OnAmbientChanged(AmbientChangedEventArgs e) + { + base.OnAmbientChanged(e); + Tizen.Log.Error("NUI", "AmbientChanged " + e.Changed + "\n"); + } + + void Initialize() + { + Window window = this.Window; + window.KeyEvent += OnKeyEvent; + + text = new TextLabel("Hello Tizen NUI World"); + text.HorizontalAlignment = HorizontalAlignment.Center; + text.VerticalAlignment = VerticalAlignment.Center; + text.TextColor = Color.White; + text.PointSize = 10.0f; + text.HeightResizePolicy = ResizePolicyType.FillToParent; + text.WidthResizePolicy = ResizePolicyType.FillToParent; + text.MultiLine = true; + window.GetDefaultLayer().Add(text); + } + + public void OnKeyEvent(object sender, Window.KeyEventArgs e) + { + if (e.Key.State == Key.StateType.Down && (e.Key.KeyPressedName == "XF86Back" || e.Key.KeyPressedName == "Escape")) + { + Exit(); + } + } + + static void _Main(string[] args) + { + Tizen.Log.Error("NUI", "App Start....\n"); + var app = new Program(); + app.Run(args); + } + } +} diff --git a/test/NUITestSample/NUITestSample/examples/as-is-test-sample.cs b/test/NUITestSample/NUITestSample/examples/as-is-test-sample.cs new file mode 100755 index 000000000..17121cbfd --- /dev/null +++ b/test/NUITestSample/NUITestSample/examples/as-is-test-sample.cs @@ -0,0 +1,255 @@ +using System; +using Tizen.NUI.BaseComponents; +using Tizen.NUI; + +namespace AsIsTest +{ + class Example : NUIApplication + { + private Timer myTimer; + + private View myView; + private TextLabel myTextLabel; + + + //=========================== + Layer layer; + View vi1, vi2, vi3; + TextLabel tl1, tl2, tl3; + ToggleButton tb1, tb2, tb3; + + + protected override void OnCreate() + { + base.OnCreate(); + + myView = new View(); + myView.Size2D = new Size2D(100, 100); + myView.Position = new Position(100, 100, 0); + myView.BackgroundColor = Color.Red; + myView.Name = "myView"; + myView.SizeWidth = 111; + + Window.Instance.GetDefaultLayer().Add(myView); + + myTextLabel = new TextLabel(); + myTextLabel.Position = new Position(100, 100, 0); + myTextLabel.Size2D = new Size2D(100, 100); + myTextLabel.Name = "myTextLabel"; + + myView.Add(myTextLabel); + + //=========================== + LayerTest2(); + + myTimer = new Timer(500); + myTimer.Tick += Mytimer_Tick; + myTimer.Start(); + } + + private void ObjectDumpTrigger() + { + //for (int i = 0; i < Window.LayerCount; i++) + //{ + // BFS(Window.GetLayer((uint)i), 1); + //} + } + + + + private static void BFS(Animatable o, int depth) + { + if (o == null) + { + Tizen.Log.Fatal("NUI-APP", "##### o == null! return here!"); + return; + } + + Tizen.Log.Fatal("NUI-APP", "##### o.GetTypeName()=" + o.GetTypeName()); + + if (o is View) + { + View myView = o as View; + + if (o is TextLabel) + { + TextLabel myTextLabel = o as TextLabel; + + Tizen.Log.Fatal("NUI-APP", string.Format("it is TextLabel, {0}", myTextLabel.Text)); + + return; + } + else + { + Tizen.Log.Fatal("NUI-APP", string.Format("it is not TextLaebl")); + } + + for (int i = 0; i < myView.ChildCount; i++) + { + BFS(myView.GetChildAt((uint)i), depth + 1); + } + } + else if (o is Layer) + { + Layer myLayer = o as Layer; + + for (int i = 0; i < myLayer.ChildCount; i++) + { + BFS(myLayer.GetChildAt((uint)i), depth + 1); + } + } + else + { + return; + } + } + + private bool Mytimer_Tick(object source, Timer.TickEventArgs e) + { + ObjectDumpTrigger(); + ObjectDumpTrigger2(); + Tizen.Log.Debug("NUI", " === Size property set/get test!"); + myView.Size2D.Width += 5; //this is not working, because stage's Size is Vector2 but view's Size is Vector3. need to figure out. + myView.SizeHeight += 5; + Tizen.Log.Debug("NUI", $" view's size width= {myView.Size2D.Width} heigh={myView.Size2D.Height}"); + + return true; + } + + + + //====================================================================== + void LayerTest2() + { + layer = new Layer(); + + vi1 = new View(); + vi2 = new View(); + vi3 = new View(); + + tl1 = new TextLabel(); + tl2 = new TextLabel(); + tl3 = new TextLabel(); + + tb1 = new ToggleButton(); + tb2 = new ToggleButton(); + tb3 = new ToggleButton(); + + vi1.Add(vi3); + vi1.Add(tl1); + vi1.Add(tl2); + + vi3.Add(tb1); + vi3.Add(tb2); + + vi2.Add(tl3); + + layer.Add(vi1); + layer.Add(vi2); + layer.Add(tb3); + + Window.Instance.AddLayer(layer); + } + + void ObjectDumpTrigger2() + { + //uint layerCnt = Window.LayerCount; + //Tizen.Log.Fatal("NUI-APP", "layerCnt=" + layerCnt); + + //for (uint i = 0; i < layerCnt; i++) + //{ + // Tizen.Log.Fatal("NUI-APP", "T[" + DateTime.Now + "]__________ layer #" + i + " traverse"); + // CheckViewsInLayer(Window.GetLayer(i)); + //} + } + void CheckViewsInLayer(Animatable obj) + { + if (obj is Layer) + { + var layer = obj as Layer; + if (layer == null) + { + Tizen.Log.Fatal("NUI-APP", "### layer is null! just return!"); + return; + } + uint childCnt = layer.ChildCount; + if (childCnt > 0) + { + for (uint i = 0; i < childCnt; i++) + { + var temp = layer.GetChildAt(i) as View; + Tizen.Log.Fatal("NUI-APP", "depth[1] child in layer! type=" + temp?.GetTypeName()); + ViewCheckRecurse(temp, 1); + } + } + else + { + Tizen.Log.Fatal("NUI-APP", "### there is no child in this layer! just return!"); + } + } + else + { + Tizen.Log.Fatal("NUI-APP", "obj is NOT Layer! do nothing!"); + } + } + void ViewCheckRecurse(View view, int depth) + { + if (view) + { + uint childCnt = view.ChildCount; + if (childCnt > 0) + { + depth = depth + 1; + for (uint i = 0; i < childCnt; i++) + { + var temp = view.GetChildAt(i) as View; + Tizen.Log.Fatal("NUI-APP", "depth[" + depth + "] child in layer! type=" + temp.GetTypeName() + " AS-IS Test: IsView?=" + (temp is View) + " IsTextLabel?=" + (temp is TextLabel) ); + + if (temp is TextLabel) + { + ToggleButton _toggleBt = temp as ToggleButton; + if(_toggleBt == null) + { + Tizen.Log.Debug("NUI", $"temp is TextLabel! try to do invalid cast! should return null! OK!GOOD!"); + } + else + { + Tizen.Log.Debug("NUI", $"temp is TextLabel! try to do invalid cast! should return null! BAD!ERROR!"); + } + } + else if (temp is ToggleButton) + { + TextLabel _textLb = temp as TextLabel; + if(_textLb == null) + { + Tizen.Log.Debug("NUI", $"temp is ToggleButton! try to do invalid cast! should return null! OK!GOOD!"); + } + else + { + Tizen.Log.Debug("NUI", $"temp is ToggleButton! try to do invalid cast! should return null! BAD!ERROR!"); + } + } + + ViewCheckRecurse(temp, depth); + } + } + else + { + //Tizen.Log.Fatal("NUI-APP", "depth[" + depth + "] child in layer! type=" + view.GetTypeName()); + return; + } + } + else + { + //Tizen.Log.Fatal("NUI-APP", "### view is null! just return!"); + } + } + + private static void _Main(string[] args) + { + //Create an Application + Example myProgram = new Example(); + myProgram.Run(args); + } + } +} \ No newline at end of file diff --git a/test/NUITestSample/NUITestSample/examples/color-test.cs b/test/NUITestSample/NUITestSample/examples/color-test.cs new file mode 100755 index 000000000..04bc20a35 --- /dev/null +++ b/test/NUITestSample/NUITestSample/examples/color-test.cs @@ -0,0 +1,89 @@ +using Tizen.NUI; +using Tizen.NUI.BaseComponents; + +namespace ColorTest +{ + internal class Example : NUIApplication + { + View mainView; + TextLabel title; + + public Example() : base("", WindowMode.Transparent) + { + } + + Size2D screenSize; + int pixelSize; + + protected override void OnCreate() + { + base.OnCreate(); + + Window.Instance.BackgroundColor = Color.Transparent; + Window.Instance.KeyEvent += Instance_KeyEvent; + + screenSize = Window.Instance.Size; + pixelSize = screenSize.Width / 10; + + mainView = new View(); + mainView.Size2D = screenSize; + mainView.BackgroundColor = new Color(0.0f, 0.0f, 0.0f, 1.0f); + mainView.PivotPoint = PivotPoint.TopLeft; + mainView.Position = new Position(0, 0, 0); + Window.Instance.GetDefaultLayer().Add(mainView); + + title = new TextLabel("Ambient is the new off"); + title.PivotPoint = PivotPoint.TopLeft; + title.Size2D = new Size2D(screenSize.Width, screenSize.Height / 2); + title.Position = new Position(0, 0, 0); + //title.TextColor = new Color(1.0f, 1.0f, 1.0f, 1.0f); + title.TextColor = new Color(255.0f, 255.0f, 255.0f, 255.0f); + title.PixelSize = pixelSize; + title.HorizontalAlignment = HorizontalAlignment.Center; + title.VerticalAlignment = VerticalAlignment.Center; + title.MultiLine = true; + + mainView.Add(title); + } + + private void Instance_KeyEvent(object sender, Window.KeyEventArgs e) + { + //////NUILog.Debug("State=" + e.Key.State.ToString() + " Pressed=" + e.Key.KeyPressedName + " Time=" + e.Key.Time); + + if (e.Key.State == Key.StateType.Down && (e.Key.KeyPressedName == "BackSpace" || e.Key.KeyPressedName == "XF86Back")) + { + //Exit(); + } + + if (e.Key.State == Key.StateType.Down) + { + if (e.Key.KeyPressedName == "Left") + { + mainView.Remove(title); + title.Dispose(); + title = null; + + mainView = new View(); + mainView.Size2D = screenSize; + mainView.BackgroundColor = new Color(0.0f, 0.0f, 0.0f, 1.0f); + mainView.PivotPoint = PivotPoint.TopLeft; + mainView.Position = new Position(0, 0, 0); + Window.Instance.GetDefaultLayer().Add(mainView); + + title = new TextLabel("Ambient is the new off"); + title.PivotPoint = PivotPoint.TopLeft; + title.Size2D = new Size2D(screenSize.Width, screenSize.Height / 2); + title.Position = new Position(0, 0, 0); + //title.TextColor = new Color(1.0f, 1.0f, 1.0f, 1.0f); + title.TextColor = new Color(255.0f, 255.0f, 255.0f, 255.0f); + title.PixelSize = pixelSize; + title.HorizontalAlignment = HorizontalAlignment.Center; + title.VerticalAlignment = VerticalAlignment.Center; + title.MultiLine = true; + + mainView.Add(title); + } + } + } + } +} \ No newline at end of file diff --git a/test/NUITestSample/NUITestSample/examples/control-dashboard.cs b/test/NUITestSample/NUITestSample/examples/control-dashboard.cs new file mode 100755 index 000000000..8ebb7662e --- /dev/null +++ b/test/NUITestSample/NUITestSample/examples/control-dashboard.cs @@ -0,0 +1,497 @@ +/* + * Copyright (c) 2017 Samsung Electronics Co., Ltd. + * + * 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; +using Tizen.NUI; +using Tizen.NUI.UIComponents; +using Tizen.NUI.BaseComponents; +using Tizen.NUI.Constants; + +namespace ControlDashboard +{ + class Example : NUIApplication + { + // This is simple structure to contain Control name and implement state at once + // name : control name + // isImplemented : the state which the control is implemented in public or not + private struct Item + { + public String name; + public bool isImplemented; + + public Item(String name, bool isImplemented) + { + this.name = name; + this.isImplemented = isImplemented; + } + } + + private TableView _contentContainer; + private Timer _timer; + private Window _window; + private Popup _popup; + private ProgressBar _progressBar; + //private const string _resPath = "/home/owner/apps_rw/NUISamples.TizenTV/res"; + private const string _resPath = "./res"; //for ubuntu + + + // List of items + private Item[] mViewList = { + new Item("PushButton", true), new Item("DropDown", false), new Item("Toggle", true), + new Item("InputField", false), new Item("AnimateGif", false), new Item("Loading", false), + new Item("ProgressBar", true), new Item("CheckBox", false), new Item("RadioButton", true), + new Item("Tooltip", true), new Item("Popup", true), new Item("Toast", true), + new Item("ItemView", false), new Item("CheckBox", true) + }; + + public Example() : base() + { + } + + public Example(string stylesheet) : base(stylesheet) + { + } + + public Example(string stylesheet, NUIApplication.WindowMode windowMode) : base(stylesheet, windowMode) + { + } + + protected override void OnCreate() + { + base.OnCreate(); + Initialize(); + } + + public void Initialize() + { + Tizen.Log.Debug("NUI", "Customized Application Initialize event handler"); + _window = Window.Instance; + _window.BackgroundColor = Color.White; + + // Top label + TextLabel topLabel = new TextLabel(); + topLabel.WidthResizePolicy = ResizePolicyType.FillToParent; + topLabel.HeightResizePolicy = ResizePolicyType.SizeRelativeToParent; + topLabel.PivotPoint = PivotPoint.TopCenter; + topLabel.SetSizeModeFactor(new Vector3(0.0f, 0.1f, 0.0f)); + topLabel.BackgroundColor = new Color(43.0f / 255.0f, 145.0f / 255.0f, 175.0f / 255.0f, 1.0f); + topLabel.TextColor = Color.White; + topLabel.Text = " DALi Views"; + topLabel.HorizontalAlignment = HorizontalAlignment.Begin; + topLabel.VerticalAlignment = VerticalAlignment.Center; + topLabel.PointSize = 42.0f; + _window.Add(topLabel); + //StyleManager.Get().ApplyStyle(topLabel, _resPath + "/json/control-dashboard-theme.json", "TextFieldFontSize4"); + topLabel.SetStyleName("TextFieldFontSize4"); + + // Grid container to contain items. Use tableView because FlexContainer support focus navigation just two direction ( up/down or left/right ) + _contentContainer = new TableView(6, 5); + _contentContainer.WidthResizePolicy = ResizePolicyType.FillToParent; + _contentContainer.HeightResizePolicy = ResizePolicyType.SizeRelativeToParent; + _contentContainer.SetSizeModeFactor(new Vector3(0.0f, 0.9f, 0.0f)); + _contentContainer.PivotPoint = PivotPoint.BottomCenter; + _contentContainer.Position = new Position(0, _window.Size.Height * 0.1f, 0); + _contentContainer.SetRelativeHeight(0, 0.07f); + _contentContainer.SetRelativeHeight(1, 0.26f); + _contentContainer.SetRelativeHeight(2, 0.07f); + _contentContainer.SetRelativeHeight(3, 0.26f); + _contentContainer.SetRelativeHeight(4, 0.07f); + _contentContainer.SetRelativeHeight(5, 0.26f); + _contentContainer.Focusable = (true); + _window.Add(_contentContainer); + + CreateContent(); + + FocusManager.Instance.PreFocusChange += OnPreFocusChange; + } + + // Callback for KeyboardFocusManager + private View OnPreFocusChange(object source, FocusManager.PreFocusChangeEventArgs e) + { + if (!e.ProposedView && !e.CurrentView) + { + e.ProposedView = _contentContainer.GetChildAt(1); + } + return e.ProposedView; + } + + private void CreateContent() + { + for (int i = 0; i < mViewList.Length; i++) + { + CreateItem(mViewList[i], i); + } + } + + private void CreateItem(Item item, int idx) + { + // Make label for item + TextLabel itemLabel = new TextLabel(" " + item.name); + itemLabel.Size2D = new Size2D((int)(_window.Size.Width * 0.2f), (int)(_window.Size.Height * 0.05f)); + itemLabel.HorizontalAlignment = HorizontalAlignment.Begin; + itemLabel.VerticalAlignment = VerticalAlignment.Bottom; + //itemLabel.PointSize = 18.0f; + _contentContainer.AddChild(itemLabel, new TableView.CellPosition(((uint)idx / 5) * 2, (uint)idx % 5)); + + // If item is implemented in public, attach it on window + if (item.isImplemented) + { + if (item.name.CompareTo("PushButton") == 0) + { + PushButton pushButton = new PushButton(); + pushButton.LabelText = "Push Button"; + pushButton.WidthResizePolicy = ResizePolicyType.FillToParent; + pushButton.HeightResizePolicy = ResizePolicyType.FillToParent; + pushButton.UnselectedColor = new Vector4(1.0f, 0.0f, 0.0f, 1.0f); + pushButton.SelectedColor = new Vector4(0.0f, 1.0f, 0.0f, 1.0f); + pushButton.Clicked += (obj, e) => + { + Button sender = obj as Button; + sender.LabelText = "Click Me"; + sender.UnselectedColor = new Vector4(0.0f, 0.0f, 1.0f, 1.0f); + return true; + }; + + _contentContainer.AddChild(pushButton, new TableView.CellPosition(((uint)idx / 5) * 2 + 1, (uint)idx % 5)); + } + if (item.name.CompareTo("DropDown") == 0) + { + + } + if (item.name.CompareTo("Toggle") == 0) + { + ToggleButton toggleButton = new ToggleButton(); + PropertyArray array = new PropertyArray(); + array.Add(new PropertyValue(_resPath + "/images/star-highlight.png")); + array.Add(new PropertyValue(_resPath + "/images/star-mod.png")); + array.Add(new PropertyValue(_resPath + "/images/star-dim.png")); + toggleButton.StateVisuals = array; + + PropertyArray tooltips = new PropertyArray(); + tooltips.Add(new PropertyValue("State A")); + tooltips.Add(new PropertyValue("State B")); + tooltips.Add(new PropertyValue("State C")); + toggleButton.Tooltips = tooltips; + + toggleButton.WidthResizePolicy = ResizePolicyType.FillToParent; + toggleButton.HeightResizePolicy = ResizePolicyType.FillToParent; + toggleButton.Clicked += (obj, e) => + { + Tizen.Log.Debug("NUI", "Toggle button state changed."); + return true; + }; + + _contentContainer.AddChild(toggleButton, new TableView.CellPosition(((uint)idx / 5) * 2 + 1, (uint)idx % 5)); + } + if (item.name.CompareTo("InputField") == 0) + { + + } + if (item.name.CompareTo("AnimateGif") == 0) + { + + } + if (item.name.CompareTo("Loading") == 0) + { + + } + if (item.name.CompareTo("ProgressBar") == 0) + { + _progressBar = new ProgressBar(); + _progressBar.WidthResizePolicy = ResizePolicyType.FillToParent; + _progressBar.HeightResizePolicy = ResizePolicyType.Fixed; + _progressBar.Size2D = new Size2D(0, 100); + + _progressBar.ValueChanged += OnProgressBarValueChanged; + + _timer = new Timer(100); + _timer.Tick += (obj, e) => + { + float progress = (float)Math.Round(_progressBar.ProgressValue, 2); + + if (progress == 1.0f) + { + _progressBar.ProgressValue = 0.0f; + _progressBar.SecondaryProgressValue = 0.01f; + } + else + { + _progressBar.ProgressValue = progress + 0.01f; + _progressBar.SecondaryProgressValue = progress + 0.21f; + } + return true; + }; + _timer.Start(); + + _contentContainer.AddChild(_progressBar, new TableView.CellPosition(((uint)idx / 5) * 2 + 1, (uint)idx % 5)); + } + if (item.name.CompareTo("ScrollBar") == 0) + { + + } + if (item.name.CompareTo("CheckBox") == 0) + { + CheckBoxButton checkBoxButton = new CheckBoxButton(); + checkBoxButton.LabelText = "Yes"; + + _contentContainer.AddChild(checkBoxButton, new TableView.CellPosition(((uint)idx / 5) * 2 + 1, (uint)idx % 5)); + } + if (item.name.CompareTo("RadioButton") == 0) + { + TableView tableView = new TableView(2, 1); + tableView.WidthResizePolicy = ResizePolicyType.FillToParent; + tableView.HeightResizePolicy = ResizePolicyType.FillToParent; + + RadioButton rButton = new RadioButton(); + rButton.LabelText = "Yes"; + rButton.Selected = true; + tableView.AddChild(rButton, new TableView.CellPosition(0, 0)); + + rButton = new RadioButton(); + rButton.LabelText = "No"; + + tableView.AddChild(rButton, new TableView.CellPosition(1, 0)); + + _contentContainer.AddChild(tableView, new TableView.CellPosition(((uint)idx / 5) * 2 + 1, (uint)idx % 5)); + } + if (item.name.CompareTo("Tooltip") == 0) + { + TableView tableView = new TableView(2, 1); + tableView.WidthResizePolicy = ResizePolicyType.FillToParent; + tableView.HeightResizePolicy = ResizePolicyType.FillToParent; + + // Create two push buttons and add them to a table view + PushButton buttonWithSimpleTooltip = new PushButton(); + buttonWithSimpleTooltip.LabelText = "Tooltip with text only"; + buttonWithSimpleTooltip.UnselectedColor = new Vector4(0.5f, 0.5f, 0.7f, 1.0f); + buttonWithSimpleTooltip.SelectedColor = new Vector4(0.7f, 0.5f, 0.7f, 1.0f); + buttonWithSimpleTooltip.WidthResizePolicy = ResizePolicyType.FillToParent; + tableView.AddChild(buttonWithSimpleTooltip, new TableView.CellPosition(0, 0)); + + PushButton buttonWithIconTooltip = new PushButton(); + buttonWithIconTooltip.LabelText = "Tooltip with Text and Icon"; + buttonWithIconTooltip.WidthResizePolicy = ResizePolicyType.FillToParent; + buttonWithIconTooltip.UnselectedColor = new Vector4(0.5f, 0.5f, 0.7f, 1.0f); + buttonWithIconTooltip.SelectedColor = new Vector4(0.7f, 0.5f, 0.7f, 1.0f); + tableView.AddChild(buttonWithIconTooltip, new TableView.CellPosition(1, 0)); + + // Add a simple text only tooltip to the first push button + buttonWithSimpleTooltip.TooltipText = "Simple Tooltip"; + + // Create a property map for a tooltip with one icon and one text + PropertyArray iconTooltipContent = new PropertyArray(); + + PropertyMap iconVisual = new PropertyMap(); + iconVisual.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.Image)) + .Add(ImageVisualProperty.URL, new PropertyValue(_resPath + "/images/star-highlight.png")); + iconTooltipContent.Add(new PropertyValue(iconVisual)); + + PropertyMap textVisual = new PropertyMap(); + textVisual.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.Text)) + .Add(TextVisualProperty.Text, new PropertyValue("Tooltip with Icon")); + iconTooltipContent.Add(new PropertyValue(textVisual)); + + PropertyMap iconTooltip = new PropertyMap(); + iconTooltip.Add(Tizen.NUI.Constants.Tooltip.Property.Content, new PropertyValue(iconTooltipContent)) + .Add(Tizen.NUI.Constants.Tooltip.Property.Tail, new PropertyValue(true)); + + // Add the tooltip with icon and text to the second push button + buttonWithIconTooltip.Tooltip = iconTooltip; + + _contentContainer.AddChild(tableView, new TableView.CellPosition(((uint)idx / 5) * 2 + 1, (uint)idx % 5)); + } + if (item.name.CompareTo("Popup") == 0) + { + PushButton button = new PushButton(); + button.LabelText = "Popup"; + button.PivotPoint = PivotPoint.Center; + button.MaximumSize = new Size2D(150, 100); + _popup = CreatePopup(); + _popup.SetTitle(CreateTitle("Popup")); + + TextLabel text = new TextLabel("This will erase the file permanently. Are you sure?"); + text.BackgroundColor = Color.White; + text.MultiLine = true; + text.WidthResizePolicy = ResizePolicyType.FillToParent; + text.HeightResizePolicy = ResizePolicyType.DimensionDependency; + text.SetPadding(new PaddingType(10.0f, 10.0f, 20.0f, 0.0f)); + _popup.SetContent(text); + _popup.Focusable = (true); + _popup.SetDisplayState(Popup.DisplayStateType.Hidden); + + button.Clicked += (obj, ee) => + { + _window.Add(_popup); + _popup.SetDisplayState(Popup.DisplayStateType.Shown); + FocusManager.Instance.SetCurrentFocusView((_popup.FindChildByName("Footer")).FindChildByName("OKButton")); + return true; + }; + _contentContainer.AddChild(button, new TableView.CellPosition(((uint)idx / 5) * 2 + 1, (uint)idx % 5)); + } + if (item.name.CompareTo("Toast") == 0) + { + PushButton button = new PushButton(); + button.LabelText = "Toast"; + button.PivotPoint = PivotPoint.Center; + button.Clicked += (obj, ee) => + { + Popup toast = new Popup(); + toast.SizeModeFactor = new Vector3(0.75f, 0.75f, 0.75f); + toast.WidthResizePolicy = ResizePolicyType.SizeRelativeToParent; + toast.HeightResizePolicy = ResizePolicyType.UseNaturalSize; + toast.ContextualMode = Popup.ContextualModeType.NonContextual; + toast.AnimationDuration = 0.65f; + toast.TailVisibility = false; + + // Disable the dimmed backing. + toast.BackingEnabled = false; + + // The toast popup should fade in (not zoom). + toast.AnimationMode = Popup.AnimationModeType.Fade; + + // The toast popup should auto-hide. + toast.AutoHideDelay = 3000; + + // Align to the bottom of the screen. + toast.ParentOrigin = new Position(0.5f, 0.94f, 0.5f); + toast.PivotPoint = PivotPoint.BottomCenter; + + // Let events pass through the toast popup. + toast.TouchTransparent = true; + + TextLabel text = new TextLabel("This is a Toast.\nIt will auto-hide itself"); + text.TextColor = Color.White; + text.MultiLine = true; + text.HorizontalAlignment = HorizontalAlignment.Center; + toast.SetTitle(text); + _window.Add(toast); + toast.DisplayState = Popup.DisplayStateType.Shown; + + return true; + }; + _contentContainer.AddChild(button, new TableView.CellPosition(((uint)idx / 5) * 2 + 1, (uint)idx % 5)); + } + if (item.name.CompareTo("ItemView") == 0) + { + + } + } + else + { + ImageView notSupportView = new ImageView(_resPath + "/images/not_yet_sign.png"); + notSupportView.Size2D = new Size2D((int)(_window.Size.Width * 0.2f), (int)(_window.Size.Height * 0.25f)); + notSupportView.Focusable = (true); + _contentContainer.AddChild(notSupportView, new TableView.CellPosition(((uint)idx / 5) * 2 + 1, (uint)idx % 5)); + } + } + Popup CreatePopup() + { + Popup confirmationPopup = new Popup(); + + View footer = new View(); + footer.Name = ("Footer"); + footer.WidthResizePolicy = ResizePolicyType.FillToParent; + footer.HeightResizePolicy = ResizePolicyType.Fixed; + footer.Size2D = new Size2D(0, 80); + footer.PivotPoint = PivotPoint.Center; + + PushButton okButton = CreateOKButton(); + okButton.PivotPoint = PivotPoint.Center; + okButton.WidthResizePolicy = ResizePolicyType.SizeFixedOffsetFromParent; + okButton.HeightResizePolicy = ResizePolicyType.SizeFixedOffsetFromParent; + okButton.SetSizeModeFactor(new Vector3(-20.0f, -20.0f, 0.0f)); + + PushButton cancelButton = CreateCancelButton(); + cancelButton.PivotPoint = PivotPoint.Center; + cancelButton.WidthResizePolicy = ResizePolicyType.SizeFixedOffsetFromParent; + cancelButton.HeightResizePolicy = ResizePolicyType.SizeFixedOffsetFromParent; + cancelButton.SetSizeModeFactor(new Vector3(-20.0f, -20.0f, 0.0f)); + + TableView controlLayout = new TableView(1, 2); + controlLayout.PivotPoint = PivotPoint.Center; + controlLayout.WidthResizePolicy = ResizePolicyType.FillToParent; + controlLayout.HeightResizePolicy = ResizePolicyType.FillToParent; + controlLayout.SetCellPadding(new Size2D(10, 10)); + controlLayout.SetRelativeWidth(0, 0.5f); + controlLayout.SetRelativeWidth(1, 0.5f); + controlLayout.SetCellAlignment(new TableView.CellPosition(0, 0), HorizontalAlignmentType.Center, VerticalAlignmentType.Center); + controlLayout.SetCellAlignment(new TableView.CellPosition(0, 1), HorizontalAlignmentType.Center, VerticalAlignmentType.Center); + controlLayout.AddChild(okButton, new TableView.CellPosition(0, 0)); + controlLayout.AddChild(cancelButton, new TableView.CellPosition(0, 1)); + + footer.Add(controlLayout); + + confirmationPopup.SetFooter(footer); + return confirmationPopup; + } + View CreateTitle(string title) + { + TextLabel titleView = new TextLabel(title); + titleView.TextColor = Color.White; + titleView.MultiLine = true; + titleView.HorizontalAlignment = HorizontalAlignment.Center; + return titleView; + } + + PushButton CreateOKButton() + { + PushButton okayButton = new PushButton(); + okayButton.Name = ("OKButton"); + okayButton.LabelText = "OK"; + okayButton.Focusable = (true); + okayButton.Clicked += (obj, ee) => + { + _popup.SetDisplayState(Popup.DisplayStateType.Hidden); + return true; + }; + return okayButton; + } + PushButton CreateCancelButton() + { + PushButton cancelButton = new PushButton(); + cancelButton.LabelText = "Cancel"; + cancelButton.Focusable = (true); + cancelButton.Clicked += (obj, ee) => + { + _popup.SetDisplayState(Popup.DisplayStateType.Hidden); + return true; + }; + return cancelButton; + } + + void OnProgressBarValueChanged(object source, ProgressBar.ValueChangedEventArgs e) + { + PropertyMap labelVisual = new PropertyMap(); + labelVisual.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.Text)) + .Add(TextVisualProperty.Text, new PropertyValue(Math.Round(e.ProgressBar.ProgressValue, 2) + " / " + Math.Round(e.ProgressBar.SecondaryProgressValue, 2))) + .Add(TextVisualProperty.PointSize, new PropertyValue(10.0f)); + e.ProgressBar.LabelVisual = labelVisual; + return; + } + + [STAThread] + static void _Main(string[] args) + { + Tizen.Log.Debug("NUI", "Hello Mono World"); + + Example example = new Example("/home/owner/apps_rw/NUISamples.TizenTV/res/json/control-dashboard-theme.json"); + + example.Run(args); + } + } +} diff --git a/test/NUITestSample/NUITestSample/examples/custom-control.cs b/test/NUITestSample/NUITestSample/examples/custom-control.cs new file mode 100755 index 000000000..df9e60eb9 --- /dev/null +++ b/test/NUITestSample/NUITestSample/examples/custom-control.cs @@ -0,0 +1,261 @@ +/* + * Copyright (c) 2017 Samsung Electronics Co., Ltd. + * + * 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; +using Tizen.NUI.UIComponents; +using Tizen.NUI.BaseComponents; +using Tizen.NUI; + +namespace CustomControlTest +{ + + // A custom control for star rating (draggable to change the rating) + class StarRating : CustomView + { + private const string resources = "/home/owner/apps_rw/NUISamples.TizenTV/res"; + private FlexContainer _container; + private ImageView[] _images; + private Vector3 _gestureDisplacement; + private int _currentValue; + private int _myRating; + private bool _myDragEnabled; + + // Called by DALi Builder if it finds a StarRating control in a JSON file + static CustomView CreateInstance() + { + return new StarRating(); + } + + // static constructor registers the control type (only runs once) + static StarRating() + { + // ViewRegistry registers control type with DALi type registery + // also uses introspection to find any properties that need to be registered with type registry + CustomViewRegistry.Instance.Register(CreateInstance, typeof(StarRating) ); + } + + public StarRating() : base(typeof(StarRating).Name, CustomViewBehaviour.ViewBehaviourDefault) + { + } + + public override void OnInitialize() + { + // Create a container for the star images + _container = new FlexContainer(); + + _container.FlexDirection = FlexContainer.FlexDirectionType.Row; + _container.WidthResizePolicy = ResizePolicyType.FillToParent; + _container.HeightResizePolicy = ResizePolicyType.FillToParent; + + this.Add(_container); + + // Create the images + _images = new ImageView[5]; + + for(int i = 0; i < 5; i++) + { + _images[i] = new ImageView(resources+"/images/star-dim.png"); + _container.Add( _images[i] ); + } + + // Update the images according to the rating (dimmed star by default) + _myRating = 0; + UpdateStartImages(_myRating); + + // Enable pan gesture detection + EnableGestureDetection(Gesture.GestureType.Pan); + _myDragEnabled = true; // Allow dragging by default (can be disabled) + } + + // Pan gesture handling + public override void OnPan(PanGesture gesture) + { + // Only handle pan gesture if dragging is allowed + if(_myDragEnabled) + { + switch (gesture.State) + { + case Gesture.StateType.Started: + { + _gestureDisplacement = new Vector3(0.0f, 0.0f, 0.0f); + _currentValue = 0; + break; + } + case Gesture.StateType.Continuing: + { + // Calculate the rating according to pan desture displacement + _gestureDisplacement.X += gesture.Displacement.X; + int delta = (int)Math.Ceiling(_gestureDisplacement.X / 40.0f); + _currentValue = _myRating + delta; + + // Clamp the rating + if(_currentValue < 0) _currentValue = 0; + if(_currentValue > 5) _currentValue = 5; + + // Update the images according to the rating + UpdateStartImages(_currentValue); + break; + } + default: + { + _myRating = _currentValue; + break; + } + } + } + } + + // Update the images according to the rating + private void UpdateStartImages(int rating) + { + for(int i = 0; i < rating; i++) + { + _images[i].WidthResizePolicy = ResizePolicyType.UseNaturalSize; + _images[i].HeightResizePolicy = ResizePolicyType.UseNaturalSize; + _images[i].SetImage(resources+"/images/star-highlight.png"); + } + + for(int i = rating; i < 5; i++) + { + _images[i].WidthResizePolicy = ResizePolicyType.UseNaturalSize; + _images[i].HeightResizePolicy = ResizePolicyType.UseNaturalSize; + _images[i].SetImage(resources+"/images/star-dim.png"); + } + } + + // Rating property of type int: + public int Rating + { + get + { + return _myRating; + } + set + { + _myRating = value; + UpdateStartImages(_myRating); + } + } + + // DragEnabled property of type bool: + public bool DragEnabled + { + get + { + return _myDragEnabled; + } + set + { + _myDragEnabled = value; + } + } + } + + class Example : NUIApplication + { + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + delegate void CallbackDelegate(); + private const string resources = "/home/owner/apps_rw/NUISamples.TizenTV/res"; + + + public Example() : base() + { + } + + public Example(string stylesheet) : base(stylesheet) + { + } + + public Example(string stylesheet, WindowMode windowMode) : base(stylesheet, windowMode) + { + } + + protected override void OnCreate() + { + base.OnCreate(); + Initialize(); + } + + public void Initialize() + { + Window window = Window.Instance; + window.BackgroundColor = Color.White; + + // Create a container to layout the rows of image and rating vertically + FlexContainer container = new FlexContainer(); + + container.ParentOrigin = ParentOrigin.TopLeft; + container.PivotPoint = PivotPoint.TopLeft; + container.FlexDirection = (int)FlexContainer.FlexDirectionType.Column; + container.WidthResizePolicy = ResizePolicyType.FillToParent; + container.HeightResizePolicy = ResizePolicyType.FillToParent; + + window.Add(container); + + Random random = new Random(); + + for(int i = 0; i < 6; i++) // 6 rows in total + { + // Create a container to layout the image and rating (in each row) horizontally + FlexContainer imageRow = new FlexContainer(); + imageRow.ParentOrigin = ParentOrigin.TopLeft; + imageRow.PivotPoint = PivotPoint.TopLeft; + imageRow.FlexDirection = FlexContainer.FlexDirectionType.Row; + imageRow.Flex = 1.0f; + container.Add(imageRow); + + // Add the image view to the row + ImageView image = new ImageView(resources+"/images/gallery-" + i + ".jpg"); + image.Size2D = new Size2D(120, 120); + image.WidthResizePolicy = ResizePolicyType.Fixed; + image.HeightResizePolicy = ResizePolicyType.Fixed; + image.AlignSelf = (int)FlexContainer.Alignment.AlignCenter; + image.Flex = 0.3f; + image.FlexMargin = new Vector4(10.0f, 0.0f, 0.0f, 0.0f); + imageRow.Add(image); + + // Create a rating control + StarRating view = new StarRating(); + + // Add the rating control to the row + view.ParentOrigin = ParentOrigin.Center; + view.PivotPoint = PivotPoint.Center; + view.Size2D = new Size2D(200, 40); + view.Flex = 0.7f; + view.AlignSelf = (int)FlexContainer.Alignment.AlignCenter; + view.FlexMargin = new Vector4(30.0f, 0.0f, 0.0f, 0.0f); + imageRow.Add(view); + + // Set the initial rating randomly between 1 and 5 + view.Rating = random.Next(1, 6); + } + } + + /// + /// The main entry point for the application. + /// + [STAThread] + static void _Main(string[] args) + { + //System.Runtime.CompilerServices.RuntimeHelpers.RunClassConstructor (typeof(MyCSharpExample.StarRating).TypeHandle); + + Example example = new Example(); + example.Run(args); + } + } +} diff --git a/test/NUITestSample/NUITestSample/examples/dali-test.cs b/test/NUITestSample/NUITestSample/examples/dali-test.cs new file mode 100755 index 000000000..6b6941671 --- /dev/null +++ b/test/NUITestSample/NUITestSample/examples/dali-test.cs @@ -0,0 +1,914 @@ +/* + * Copyright (c) 2017 Samsung Electronics Co., Ltd. + * + * 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; +using Tizen.NUI; +using Tizen.NUI.UIComponents; +using Tizen.NUI.BaseComponents; +using Tizen.NUI.Constants; + +namespace DaliTest +{ + class MyView : View + { + private string _myOwnName; + public int _myCurrentValue; + + public MyView() + { + _myCurrentValue = 0; + } + + public string MyOwnName + { + get + { + return _myOwnName; + } + set + { + _myOwnName = value; + } + } + } + + class MyButton : PushButton + { + private string _myOwnName; + public int _myCurrentValue; + + public MyButton() + { + _myCurrentValue = 0; + } + + public string MyOwnName + { + get + { + return _myOwnName; + } + set + { + _myOwnName = value; + } + } + } + + class MySpin : Spin + { + private string _myOwnName; + public int _myCurrentValue; + + public MySpin() + { + _myCurrentValue = 0; + } + + public string MyOwnName + { + get + { + return _myOwnName; + } + set + { + _myOwnName = value; + } + } + } + + class Example : NUIApplication + { + //private const string _resPath = "/home/owner/apps_rw/NUISamples.TizenTV/res"; + private const string _resPath = "./res"; //for ubuntu + + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + delegate void CallbackDelegate(IntPtr appPtr); // void, void delgate + + public Example() : base() + { + } + + public Example(string stylesheet) : base(stylesheet) + { + } + + public Example(string stylesheet, WindowMode windowMode) : base(stylesheet, windowMode) + { + } + + protected override void OnCreate() + { + base.OnCreate(); + Initialize(); + } + + public void Initialize() + { + DowncastTest(); + + NavigationPropertiesTests(); + + OperatorTests(); + + CustomViewPropertyTest(); + + VisibilityChangeTest(); + + ResourceReadyTest(); + + ViewFocusTest(); + + WindowDevelPropertyTest(); + + Animatable handle = new Animatable(); + int myPropertyIndex = handle.RegisterProperty("myProperty", new PropertyValue(10.0f), PropertyAccessMode.ReadWrite); + float myProperty = 0.0f; + handle.GetProperty(myPropertyIndex).Get(out myProperty); + Tizen.Log.Debug("NUI", "myProperty value: " + myProperty ); + + int myPropertyIndex2 = handle.RegisterProperty("myProperty2", new PropertyValue(new Size(5.0f, 5.0f, 0.0f)), PropertyAccessMode.ReadWrite); + Size2D myProperty2 = new Size2D(0, 0); + handle.GetProperty(myPropertyIndex2).Get(myProperty2); + Tizen.Log.Debug("NUI", "myProperty2 value: " + myProperty2.Width + ", " + myProperty2.Height ); + + View view = new View(); + view.Size2D = new Size2D(200, 200); + view.Name = "MyView"; + //view.MixColor = new Color(1.0f, 0.0f, 1.0f, 0.8f); + Tizen.Log.Debug("NUI", "View size: " + view.Size2D.Width + ", " + view.Size2D.Height); + Tizen.Log.Debug("NUI", "View name: " + view.Name); + + Window window = Window.Instance; + window.BackgroundColor = Color.White; + Size windowSize = new Size(window.Size.Width, window.Size.Height, 0.0f); + Tizen.Log.Debug("NUI", "Window size: " + windowSize.Width + ", " + windowSize.Height); + window.Add(view); + + TextLabel text = new TextLabel("Hello Mono World"); + text.ParentOrigin = ParentOrigin.Center; + text.PivotPoint = PivotPoint.Center; + text.HorizontalAlignment = HorizontalAlignment.Center; + window.Add(text); + + Tizen.Log.Debug("NUI", "Text label text: " + text.Text ); + + Tizen.Log.Debug("NUI", "Text label point size: " + text.PointSize ); + text.PointSize = 32.0f; + Tizen.Log.Debug("NUI", "Text label new point size: " + text.PointSize ); + + RectanglePaddingClassTest(); + + Tizen.Log.Debug("NUI", " *************************" ); + Size Size = new Size(100, 50, 0); + Tizen.Log.Debug("NUI", " Created " + Size ); + Tizen.Log.Debug("NUI", " Size x = " + Size.Width + ", y = " + Size.Height ); + Size += new Size(20, 20, 0); + Tizen.Log.Debug("NUI", " Size x = " + Size.Width + ", y = " + Size.Height ); + Size.Width += 10; + Size.Height += 10; + Tizen.Log.Debug("NUI", " Size width = " + Size.Width + ", height = " + Size.Height ); + + Tizen.Log.Debug("NUI", " *************************" ); + Position Position = new Position(20, 100, 50); + Tizen.Log.Debug("NUI", " Created " + Position ); + Tizen.Log.Debug("NUI", " Position x = " + Position.X + ", y = " + Position.Y + ", z = " + Position.Z ); + Position += new Position(20, 20, 20); + Tizen.Log.Debug("NUI", " Position x = " + Position.X + ", y = " + Position.Y + ", z = " + Position.Z ); + Position.X += 10; + Position.Y += 10; + Position.Z += 10; + Tizen.Log.Debug("NUI", " Position width = " + Position.X + ", height = " + Position.Y + ", depth = " + Position.Z ); + + Tizen.Log.Debug("NUI", " *************************" ); + Color color = new Color(20, 100, 50, 200); + Tizen.Log.Debug("NUI", " Created " + color ); + Tizen.Log.Debug("NUI", " Color R = " + color.R + ", G = " + color.G + ", B = " + color.B + ", A = " + color.A ); + color += new Color(20, 20, 20, 20); + Tizen.Log.Debug("NUI", " Color R = " + color.R + ", G = " + color.G + ", B = " + color.B + ", A = " + color.A ); + color.R += 10; + color.G += 10; + color.B += 10; + color.A += 10; + Tizen.Log.Debug("NUI", " Color r = " + color.R + ", g = " + color.G + ", b = " + color.B + ", a = " + color.A ); + + ViewDownCastTest(); + } + + public void RectanglePaddingClassTest() + { + using (Rectangle r1 = new Rectangle(2, 5, 20, 30)) + { + Tizen.Log.Debug("NUI", " Created " + r1 ); + Tizen.Log.Debug("NUI", " IsEmpty() = " + r1.IsEmpty() ); + Tizen.Log.Debug("NUI", " Left = " + r1.Left() ); + Tizen.Log.Debug("NUI", " Right = " + r1.Right() ); + Tizen.Log.Debug("NUI", " Top = " + r1.Top() ); + Tizen.Log.Debug("NUI", " Bottom = " + r1.Bottom() ); + Tizen.Log.Debug("NUI", " Area = " + r1.Area() ); + } + + Tizen.Log.Debug("NUI", " *************************" ); + + using (Rectangle r2 = new Rectangle(2, 5, 20, 30)) + { + Tizen.Log.Debug("NUI", " Created " + r2 ); + r2.Set(1,1,40,40); + Tizen.Log.Debug("NUI", " IsEmpty() = " + r2.IsEmpty() ); + Tizen.Log.Debug("NUI", " Left = " + r2.Left() ); + Tizen.Log.Debug("NUI", " Right = " + r2.Right() ); + Tizen.Log.Debug("NUI", " Top = " + r2.Top() ); + Tizen.Log.Debug("NUI", " Bottom = " + r2.Bottom() ); + Tizen.Log.Debug("NUI", " Area = " + r2.Area() ); + } + + Tizen.Log.Debug("NUI", " *************************" ); + + Rectangle r3 = new Rectangle(10, 10, 20, 20); + Rectangle r4 = new Rectangle(10, 10, 20, 20); + + if (r3 == r4) + { + Tizen.Log.Debug("NUI", "r3 == r4"); + } + else + { + Tizen.Log.Debug("NUI", "r3 != r4"); + } + + r4 = new Rectangle(12, 10, 20, 20); + + if (r3 == r4) + { + Tizen.Log.Debug("NUI", "r3 == r4"); + } + else + { + Tizen.Log.Debug("NUI", "r3 != r4"); + } + + PaddingType p1 = new PaddingType(10.5f, 10.7f, 20.8f, 20.8f); + PaddingType p2 = new PaddingType(10.5f, 10.7f, 20.8f, 20.8f); + + if (p1 == p2) + { + Tizen.Log.Debug("NUI", "p1 == p2"); + } + else + { + Tizen.Log.Debug("NUI", "p1 != p2"); + } + + p2 = new PaddingType(12.0f, 10.7f, 20.2f, 20.0f); + + if (p1 == p2) + { + Tizen.Log.Debug("NUI", "p1 == p2"); + } + else + { + Tizen.Log.Debug("NUI", "p1 != p2"); + } + } + + public void NavigationPropertiesTests() + { + View view = new View(); + View leftView, rightView, upView, downView, tmpView; + + leftView = new View(); + leftView.Name = "leftView"; + rightView = new View(); + rightView.Name = "rightView"; + upView = new View(); + upView.Name = "upView"; + downView = new View(); + downView.Name = "downView"; + + Window.Instance.Add(leftView); + Window.Instance.Add(rightView); + Window.Instance.Add(upView); + Window.Instance.Add(downView); + + view.LeftFocusableView = leftView; + tmpView = view.LeftFocusableView; + if (string.Compare(tmpView.Name, "leftView") == 0) + { + Tizen.Log.Debug("NUI", "Passed: LeftFocusedView = " + tmpView.Name); + } + else + { + Tizen.Log.Debug("NUI", "Failed: LeftFocusedView = " + tmpView.Name); + } + + view.RightFocusableView = rightView; + tmpView = view.RightFocusableView; + if (string.Compare(tmpView.Name, "rightView") == 0) + { + Tizen.Log.Debug("NUI", "Passed: RightFocusedView = " + tmpView.Name); + } + else + { + Tizen.Log.Debug("NUI", "Failed: RightFocusedView = " + tmpView.Name); + } + + Window.Instance.Add(view); + + view.UpFocusableView = upView; + tmpView = view.UpFocusableView; + if (string.Compare(tmpView.Name, "upView") == 0) + { + Tizen.Log.Debug("NUI", "Passed: UpFocusedView = " + tmpView.Name); + } + else + { + Tizen.Log.Debug("NUI", "Failed: UpFocusedView = " + tmpView.Name); + } + + view.DownFocusableView = downView; + tmpView = view.DownFocusableView; + if (string.Compare(tmpView.Name, "downView") == 0) + { + Tizen.Log.Debug("NUI", "Passed: DownFocusedView = " + tmpView.Name); + } + else + { + Tizen.Log.Debug("NUI", "Failed: DownFocusedView = " + tmpView.Name); + } + + Window.Instance.Remove(leftView); + tmpView = view.LeftFocusableView; + if (!tmpView) + { + Tizen.Log.Debug("NUI", "Passed: NULL LeftFocusedView"); + } + else + { + Tizen.Log.Debug("NUI", "Failed: LeftFocusedView = " + tmpView.Name); + } + } + + public void OperatorTests() + { + View view = new View(); + View differentView = new View(); + View viewSame = view; + View nullView = null; + + // test the true operator + if ( view ) + { + Tizen.Log.Debug("NUI", "BaseHandle Operator true (view) : test passed "); + } + else + { + Tizen.Log.Debug("NUI", "BaseHandle Operator true (view): test failed "); + } + + //View parent = view.Parent; + + //if ( parent ) + //{ + // Tizen.Log.Debug("NUI", "Handle with Empty body :failed "); + //} + //else + //{ + // Tizen.Log.Debug("NUI", "Valid with Empty body :passed "); + //} + + view.Add( differentView ); + + // here we test two different C# objects, which on the native side have the same body/ ref-object + if ( view == differentView.Parent ) + { + Tizen.Log.Debug("NUI", "view == differentView.GetParent() :passed "); + } + else + { + Tizen.Log.Debug("NUI", "view == differentView.GetParent() :failed "); + } + + if ( differentView == differentView.Parent ) + { + Tizen.Log.Debug("NUI", "differentView == differentView.GetParent() :failed "); + } + else + { + Tizen.Log.Debug("NUI", "differentView == differentView.GetParent() :passed "); + } + + if ( nullView ) + { + Tizen.Log.Debug("NUI", "BaseHandle Operator true (nullView) : test failed "); + } + else + { + Tizen.Log.Debug("NUI", "BaseHandle Operator true (nullView): test passed "); + } + + // ! operator + if ( !view ) + { + Tizen.Log.Debug("NUI", "BaseHandle Operator !(view) : test failed "); + } + else + { + Tizen.Log.Debug("NUI", "BaseHandle Operator !(view): test passed "); + } + + if ( !nullView ) + { + Tizen.Log.Debug("NUI", "BaseHandle Operator !(nullView) : test passed "); + } + else + { + Tizen.Log.Debug("NUI", "BaseHandle Operator !(nullView): test failed "); + } + + // Note: operator false only used inside & operator + // test equality operator == + if ( view == viewSame ) + { + Tizen.Log.Debug("NUI", "BaseHandle Operator (view == viewSame) : test passed"); + } + else + { + Tizen.Log.Debug("NUI", "BaseHandle Operator (view == viewSame) : test failed"); + } + + if ( view == differentView ) + { + Tizen.Log.Debug("NUI", "BaseHandle Operator (view == differentView) : test failed"); + } + else + { + Tizen.Log.Debug("NUI", "BaseHandle Operator (view == differentView) : test passed"); + } + + if ( view == nullView ) + { + Tizen.Log.Debug("NUI", "BaseHandle Operator (view == nullView) : test failed"); + } + else + { + Tizen.Log.Debug("NUI", "BaseHandle Operator (view == nullView) : test passed"); + } + + if ( nullView == nullView ) + { + Tizen.Log.Debug("NUI", "BaseHandle Operator (nullView == nullView) : test passed"); + } + else + { + Tizen.Log.Debug("NUI", "BaseHandle Operator (nullView == nullView) : test failed"); + } + + // test || operator + if ( view || viewSame ) + { + Tizen.Log.Debug("NUI", "BaseHandle Operator (view || viewSame) : test passed"); + } + else + { + Tizen.Log.Debug("NUI", "BaseHandle Operator (view || viewSame) : test failed"); + } + + if ( view || nullView ) + { + Tizen.Log.Debug("NUI", "BaseHandle Operator (view || nullView) : test passed"); + } + else + { + Tizen.Log.Debug("NUI", "BaseHandle Operator (view || nullView) : test failed"); + } + + if ( nullView || nullView ) + { + Tizen.Log.Debug("NUI", "BaseHandle Operator (nullView || nullView) : test failed"); + } + else + { + Tizen.Log.Debug("NUI", "BaseHandle Operator (nullView || nullView) : test passed"); + } + + // test && operator + if ( view && viewSame ) + { + Tizen.Log.Debug("NUI", "BaseHandle Operator (view && viewSame) : test passed"); + } + else + { + Tizen.Log.Debug("NUI", "BaseHandle Operator (view && viewSame) : test failed"); + } + + if ( view && nullView ) + { + Tizen.Log.Debug("NUI", "BaseHandle Operator (view && nullView) : test failed"); + } + else + { + Tizen.Log.Debug("NUI", "BaseHandle Operator (view && nullView) : test passed"); + } + + if ( nullView && nullView ) + { + Tizen.Log.Debug("NUI", "BaseHandle Operator (nullView && nullView) : test failed"); + } + else + { + Tizen.Log.Debug("NUI", "BaseHandle Operator (nullView && nullView) : test passed"); + } + } + + + private TextLabel label; + public void VisibilityChangeTest() + { + label = new TextLabel(); + label.Text = "Visibility"; + label.TextColor = Color.Red; + label.PointSize = 30.0f; + label.ParentOrigin = ParentOrigin.TopLeft; + label.PivotPoint = PivotPoint.TopLeft; + label.Position = new Position(0.0f, 50.0f, 0.0f); + Window.Instance.Add(label); + label.VisibilityChanged += (sender, e) => + { + if (e.Visibility) + Tizen.Log.Debug("NUI", "VisibilityChanged, label show."); + else + Tizen.Log.Debug("NUI", "VisibilityChanged, label hide."); + }; + + PushButton button = new PushButton(); + button.LabelText = "Change Visibility"; + button.ParentOrigin = ParentOrigin.TopLeft; + button.PivotPoint = PivotPoint.TopLeft; + Window.Instance.Add(button); + button.Clicked += (sender, e) => + { + if (label.Visible) + { + label.Hide(); + } + else + { + label.Show(); + } + + return true; + }; + } + + public void ResourceReadyTest() + { + ImageView image = new ImageView(); + image.ResourceUrl = _resPath + "/images/dog-anim.gif"; + image.Size2D = new Size2D(150, 150); + image.ParentOrigin = ParentOrigin.TopLeft; + image.PivotPoint = PivotPoint.TopLeft; + image.Position = new Position(0.0f, 150.0f, 0.0f); + image.ResourceReady += (sender, e) => + { + Tizen.Log.Debug("NUI", "Resource is ready!"); + }; + Window.Instance.Add(image); + } + + public void ViewFocusTest() + { + View view1 = new View(); + view1.BackgroundColor = Color.Red; + view1.Size2D = new Size2D(80, 50); + view1.ParentOrigin = ParentOrigin.CenterLeft; + view1.PivotPoint = PivotPoint.CenterLeft; + view1.Position = new Position(10.0f, 50.0f, 0.0f); + view1.Focusable = true; + View view2 = new View(); + view2.BackgroundColor = Color.Cyan; + view2.Size2D = new Size2D(80, 50); + view2.ParentOrigin = ParentOrigin.CenterLeft; + view2.PivotPoint = PivotPoint.CenterLeft; + view2.Position = new Position(100.0f, 50.0f, 0.0f); + view2.Focusable = true; + view1.RightFocusableView = view2; + view2.LeftFocusableView = view1; + Window.Instance.Add(view1); + Window.Instance.Add(view2); + FocusManager.Instance.SetCurrentFocusView(view1); + + PushButton button = new PushButton(); + button.LabelText = "Focus Back"; + button.Size2D = new Size2D(150, 50); + button.ParentOrigin = ParentOrigin.CenterLeft; + button.PivotPoint = PivotPoint.CenterLeft; + button.Position = new Position(190.0f, 50.0f, 0.0f); + + button.Focusable = true; + view2.RightFocusableView = button; + + button.Pressed += (obj, e) => + { + FocusManager.Instance.MoveFocusBackward(); + return true; + }; + Window.Instance.Add(button); + } + + public void WindowDevelPropertyTest() + { + Window window = Window.Instance; + uint count = window.GetSupportedAuxiliaryHintCount(); + if (count > 0) + { + window.BackgroundColor = Color.Blue; + } + uint id = window.AddAuxiliaryHint("wm.policy.win.effect.disable", "1"); + window.RemoveAuxiliaryHint(id); + window.RemoveAuxiliaryHint(2); + + id = window.AddAuxiliaryHint("wm.policy.win.effect.disable", "1"); + window.SetAuxiliaryHintValue(id, "0"); + string value = window.GetAuxiliaryHintValue(id); + if(value.Length > 0) + { + window.BackgroundColor = Color.Red; + } + + window.SetInputRegion(new Rectangle(0, 0, 0, 0)); + WindowType type = window.Type; + Tizen.Log.Debug("NUI", "window type is "+type); + window.Type = WindowType.Notification; + + NotificationLevel level = window.GetNotificationLevel(); + window.SetNotificationLevel(NotificationLevel.High); + level = window.GetNotificationLevel(); + Tizen.Log.Debug("NUI", "window notification level is " + level); + + window.SetOpaqueState(true); + Tizen.Log.Debug("NUI", "window is opaque? " + window.IsOpaqueState()); + + window.SetScreenOffMode(ScreenOffMode.Never); + ScreenOffMode screenMode = window.GetScreenOffMode(); + Tizen.Log.Debug("NUI", "window screen mode is " + screenMode); + + bool ret = window.SetBrightness(50); + int brightness = window.GetBrightness(); + Tizen.Log.Debug("NUI", "window brightness is " + brightness, ", return "+ret); + } + + public void CustomViewPropertyTest() + { + // Create a Spin control + Spin spin = new Spin(); + + // Background property + PropertyMap background = new PropertyMap(); + background.Add( Visual.Property.Type, new PropertyValue((int)Visual.Type.Color) ) + .Add( ColorVisualProperty.MixColor, new PropertyValue(Color.Red) ); + spin.Background = background; + + background = spin.Background; + Color backgroundColor = new Color(); + background.Find(ColorVisualProperty.MixColor, "mixColor")?.Get(backgroundColor); + if( backgroundColor == Color.Red ) + { + Tizen.Log.Debug("NUI", "Custom View Background property : test passed"); + } + else + { + Tizen.Log.Debug("NUI", "Custom View Background property : test failed"); + } + + // BackgroundColor property + spin.BackgroundColor = Color.Yellow; + if(spin.BackgroundColor == Color.Yellow) + { + Tizen.Log.Debug("NUI", "Custom View BackgroundColor property : test passed"); + } + else + { + Tizen.Log.Debug("NUI", "Custom View BackgroundColor property : test failed"); + } + + // BackgroundImage property + spin.BackgroundImage = "background-image.jpg"; + if(spin.BackgroundImage == "background-image.jpg") + { + Tizen.Log.Debug("NUI", "Custom View BackgroundImage property : test passed"); + } + else + { + Tizen.Log.Debug("NUI", "Custom View BackgroundImage property : test failed"); + } + + // StyleName property + spin.StyleName = "MyCustomStyle"; + if(spin.StyleName == "MyCustomStyle") + { + Tizen.Log.Debug("NUI", "Custom View StyleName property : test passed"); + } + else + { + Tizen.Log.Debug("NUI", "Custom View StyleName property : test failed"); + } + } + + public void ViewDownCastTest() + { + View container = new View(); + container.Position = new Position(-800.0f, -800.0f, 0.0f); + Window.Instance.Add(container); + Tizen.Log.Debug("NUI", "winow layer count is "+Window.Instance.LayerCount); + Tizen.Log.Debug("NUI", "winow default layer child at 0 is "+Window.Instance.GetDefaultLayer().GetChildAt(0)); + // Test downcast for native control + TextLabel myLabel = new TextLabel(); + myLabel.Name = "MyLabelName"; + myLabel.Text = "MyText"; + + Tizen.Log.Debug("NUI", "myLabel.Name = " + myLabel.Name + ", Text = " + myLabel.Text); + + container.Add(myLabel); + + View myLabelView = container.FindChildByName("MyLabelName"); + if(myLabelView) + { + TextLabel newLabel = myLabelView as TextLabel; + if(newLabel) + { + Tizen.Log.Debug("NUI", "Downcast to TextLabel successful: newLabel Name = " + newLabel.Name + ", Text = " + newLabel.Text); + } + else + { + Tizen.Log.Debug("NUI", "Downcast to TextLabel failed!"); + } + } + + // Test downcast for class directly inherited from View + MyView myView = new MyView(); + myView.Name = "MyViewName"; + myView.MyOwnName = "MyOwnViewName"; + myView._myCurrentValue = 5; + + Tizen.Log.Debug("NUI", "myView.Name = " + myView.Name + ", MyOwnName = " + myView.MyOwnName + ", myCurrentValue = " + myView._myCurrentValue); + + container.Add(myView); + + View myViewView = container.FindChildByName("MyViewName"); + if(myViewView) + { + MyView newView = myViewView as MyView; + if(newView) + { + Tizen.Log.Debug("NUI", "Downcast to MyView successful: newView Name = " + newView.Name + ", MyOwnName = " + newView.MyOwnName + ", myCurrentValue = " + newView._myCurrentValue); + } + else + { + Tizen.Log.Debug("NUI", "Downcast to MyView failed!"); + } + } + + // Test downcast for class directly inherited from native control + MyButton myButton = new MyButton(); + myButton.Name = "MyButtonName"; + myButton.MyOwnName = "MyOwnViewName"; + myButton.LabelText = "MyLabelText"; + myButton._myCurrentValue = 5; + + Tizen.Log.Debug("NUI", "myButton.Name = " + myButton.Name + ", MyOwnName = " + myButton.MyOwnName + ", LabelText = " + myButton.LabelText + ", myCurrentValue = " + myButton._myCurrentValue); + + container.Add(myButton); + + View myButtonView = container.FindChildByName("MyButtonName"); + if(myButtonView) + { + MyButton newButton = myButtonView as MyButton; + if(newButton) + { + Tizen.Log.Debug("NUI", "Downcast to MyButton successful: newButton Name = " + newButton.Name + ", MyOwnName = " + newButton.MyOwnName + ", LabelText = " + myButton.LabelText + ", myCurrentValue = " + newButton._myCurrentValue); + } + else + { + Tizen.Log.Debug("NUI", "Downcast to MyButton failed!"); + } + } + + // Test downcast for a CustomView + Spin spin = new Spin(); + spin.Name = "SpinName"; + spin.MaxValue = 8888; + + Tizen.Log.Debug("NUI", "spin.Name = " + spin.Name + ", MaxValue = " + spin.MaxValue); + + container.Add(spin); + + View spinView = container.FindChildByName("SpinName"); + if(spinView) + { + Spin newSpin = spinView as Spin; + if(newSpin) + { + Tizen.Log.Debug("NUI", "Downcast to Spin successful: newSpin Name = " + newSpin.Name + ", MaxValue = " + newSpin.MaxValue); + } + else + { + Tizen.Log.Debug("NUI", "Downcast to Spin failed!"); + } + } + + // Test downcast for class inherited from a CustomView + MySpin mySpin = new MySpin(); + mySpin.Name = "MySpinName"; + mySpin.MyOwnName = "MyOwnSpinName"; + mySpin.MaxValue = 8888; + mySpin._myCurrentValue = 5; + + Tizen.Log.Debug("NUI", "mySpin.Name = " + mySpin.Name + ", MyOwnName = " + mySpin.MyOwnName + ", MaxValue = " + mySpin.MaxValue + ", currentValue = " + mySpin._myCurrentValue); + + container.Add(mySpin); + + View mySpinView = container.FindChildByName("MySpinName"); + if(mySpinView) + { + MySpin newSpin = mySpinView as MySpin; + if(newSpin) + { + Tizen.Log.Debug("NUI", "Downcast to MySpin successful: newSpin Name = " + newSpin.Name + ", MyOwnName = " + newSpin.MyOwnName + ", MaxValue = " + newSpin.MaxValue + ", currentValue = " + newSpin._myCurrentValue); + } + else + { + Tizen.Log.Debug("NUI", "Downcast to MySpin failed!"); + } + } + } + + + + public void DowncastTest() + { + //Create a View as a child of parent View, get it use parent.GetChildAt(i), then DownCast to View handle, but call BackgroundColor property will crash. + View parent = new View(); + View[] childs = new View[5]; + + for (int i = 0; i < 5; i++) + { + childs[i] = new View(); + childs[i].Name = "child_view_" + i; + childs[i].BackgroundColor = Color.Red; + parent.Add(childs[i]); + } + + for (uint i = 0; i < parent.ChildCount; i++) + { + View childView = parent.GetChildAt(i); + if (childView) + { + Tizen.Log.Debug("NUI", "Type[" + childView.GetTypeName() + "] BGColor[" + childView.BackgroundColor.R + "]" + " Name[" + childView.Name + "]"); + } + } + + PushButton button = new PushButton(); + button.LabelText = "ButtonTest!"; + button.BackgroundColor = Color.White; + View parentView = new View(); + parentView.Add(button); + PushButton view = parentView.GetChildAt(0) as PushButton; + if (view) + { + Tizen.Log.Debug("NUI", "NUI view GetTypeName= " + view.GetTypeName()); + Tizen.Log.Debug("NUI", "NUI view LabelText= " + view.LabelText); + Tizen.Log.Debug("NUI", "NUI view color= " + view.BackgroundColor.R); + } + } + + + + /// + /// The main entry point for the application. + /// + [STAThread] + static void _Main(string[] args) + { + Tizen.Log.Debug("NUI", "Hello Mono World"); + + Example example = new Example(); + example.Run(args); + } + } +} diff --git a/test/NUITestSample/NUITestSample/examples/date-picker-using-json/ViewRegistryHelper.cs b/test/NUITestSample/NUITestSample/examples/date-picker-using-json/ViewRegistryHelper.cs new file mode 100755 index 000000000..95a86d8de --- /dev/null +++ b/test/NUITestSample/NUITestSample/examples/date-picker-using-json/ViewRegistryHelper.cs @@ -0,0 +1,16 @@ +using System; +using Tizen.NUI; + + +namespace DatePickerUsingJson +{ + public class ViewRegistryHelper + { + static public void Initialize() + { + // Register all views with the type registry + System.Runtime.CompilerServices.RuntimeHelpers.RunClassConstructor (typeof(Spin).TypeHandle); + } + } +} + diff --git a/test/NUITestSample/NUITestSample/examples/date-picker-using-json/date-picker-using-json.cs b/test/NUITestSample/NUITestSample/examples/date-picker-using-json/date-picker-using-json.cs new file mode 100755 index 000000000..56e7ab956 --- /dev/null +++ b/test/NUITestSample/NUITestSample/examples/date-picker-using-json/date-picker-using-json.cs @@ -0,0 +1,172 @@ +/* + * Copyright (c) 2017 Samsung Electronics Co., Ltd. + * + * 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; +using Tizen.NUI; +using Tizen.NUI.BaseComponents; + +namespace DatePickerUsingJson +{ + // A spin control (for continously changing values when users can easily predict a set of values) + + class Example : NUIApplication + { + private Spin _spinYear; // spin control for year + private Spin _spinMonth; // spin control for month + private Spin _spinDay; // spin control for day + //private Builder _builder; // DALi Builder + + //private const string _resPath = "/home/owner/apps_rw/NUISamples.TizenTV/res"; + private const string _resPath = "./res"; //for ubuntu + + public Example() : base() + { + } + + protected override void OnCreate() + { + base.OnCreate(); + Initialize(); + } + + public void Initialize() + { + Window window = Window.Instance; + window.BackgroundColor = Color.White; + + //This is required for the Application which uses JSON theme and style of Dali builder + ViewRegistryHelper.Initialize(); + /* + // load date JSON template... + _builder = new Builder (); + + // Optional constant to see logging information coming out + // of DALi JSON parser (builder) + PropertyMap constants = new PropertyMap(); + constants.Insert( "CONFIG_SCRIPT_LOG_LEVEL", new PropertyValue( "Verbose") ); + _builder.AddConstants( constants ); + + _builder.LoadFromFile(_resPath + "/json/date-picker-template.json" ); + + // create the date-picker from the template in the json file + View actorTree = _builder.Create( "date-picker"); + + window.Add( actorTree ); + + View year = actorTree.FindChildByName("Year"); + View month = actorTree.FindChildByName("Month" ); + View day = actorTree.FindChildByName("Day"); + + // need to get the actual C# Spin object associated with the actor, + _spinYear = year as Spin; + _spinMonth = month as Spin; + _spinDay = day as Spin; + + _spinYear.Value = 2099; + _spinMonth.Value = 5; + _spinDay.Value = 23; + + _spinYear.Focusable = (true); + _spinMonth.Focusable = (true); + _spinDay.Focusable = (true); + + FocusManager keyboardFocusManager = FocusManager.Instance; + keyboardFocusManager.PreFocusChange += OnKeyboardPreFocusChange; + //keyboardFocusManager.FocusedViewActivated += OnFocusedViewActivated; + + StyleManager.Get().ApplyTheme(_resPath + "/json/date-picker-theme.json"); + */ + } + + private View OnKeyboardPreFocusChange(object source, FocusManager.PreFocusChangeEventArgs e) + { + View nextFocusView = e.ProposedView; + + // When nothing has been focused initially, focus the text field in the first spin + if (!e.CurrentView && !e.ProposedView) + { + nextFocusView = _spinYear.SpinText; + } + else if(e.Direction == View.FocusDirection.Left) + { + // Move the focus to the spin in the left of the current focused spin + if(e.CurrentView == _spinMonth.SpinText) + { + nextFocusView = _spinYear.SpinText; + } + else if(e.CurrentView == _spinDay.SpinText) + { + nextFocusView = _spinMonth.SpinText; + } + } + else if(e.Direction == View.FocusDirection.Right) + { + // Move the focus to the spin in the right of the current focused spin + if(e.CurrentView == _spinYear.SpinText) + { + nextFocusView = _spinMonth.SpinText; + } + else if(e.CurrentView == _spinMonth.SpinText) + { + nextFocusView = _spinDay.SpinText; + } + } + + return nextFocusView; + } + /* + private void OnFocusedViewActivated(object source, FocusManager.FocusedViewActivatedEventArgs e) + { + // Make the text field in the current focused spin to take the key input + KeyInputFocusManager manager = KeyInputFocusManager.Get(); + + if (e.View == _spinYear.SpinText) + { + if (manager.GetCurrentFocusControl() != _spinYear.SpinText) + { + manager.SetFocus(_spinYear.SpinText); + } + } + else if (e.View == _spinMonth.SpinText) + { + if (manager.GetCurrentFocusControl() != _spinMonth.SpinText) + { + manager.SetFocus(_spinMonth.SpinText); + } + } + else if (e.View == _spinDay.SpinText) + { + if (manager.GetCurrentFocusControl() != _spinDay.SpinText) + { + manager.SetFocus(_spinDay.SpinText); + } + } + } + */ + + /// + /// The main entry point for the application. + /// + [STAThread] + static void _Main(string[] args) + { + Example example = new Example(); + example.Run(args); + } + } +} diff --git a/test/NUITestSample/NUITestSample/examples/date-picker.cs b/test/NUITestSample/NUITestSample/examples/date-picker.cs new file mode 100755 index 000000000..1163ee4b4 --- /dev/null +++ b/test/NUITestSample/NUITestSample/examples/date-picker.cs @@ -0,0 +1,165 @@ +/* + * Copyright (c) 2017 Samsung Electronics Co., Ltd. + * + * 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; +using Tizen.NUI; +using Tizen.NUI.BaseComponents; +using Tizen.NUI.UIComponents; + + +namespace DatePickerTest +{ + // A spin control (for continously changing values when users can easily predict a set of values) + + class Example : NUIApplication + { + private FlexContainer _container; // Flex container to hold spin controls + private Spin _spinYear; // spin control for year + private Spin _spinMonth; // spin control for month + private Spin _spinDay; // spin control for day + + public Example() : base() + { + + } + + protected override void OnCreate() + { + base.OnCreate(); + Initialize(); + } + + public void Initialize() + { + Window window = Window.Instance; + window.BackgroundColor = Color.White; + + // Create a container for the spins + _container = new FlexContainer(); + + _container.FlexDirection = FlexContainer.FlexDirectionType.Row; + _container.Size2D = new Size2D(480, 150); + + window.Add(_container); + + // Create a Spin control for year + _spinYear = new Spin(); + _spinYear.Flex = 0.3f; + _spinYear.FlexMargin = new Vector4(5.0f, 0.0f, 5.0f, 0.0f); + _container.Add(_spinYear); + + _spinYear.MinValue = 1900; + _spinYear.MaxValue = 2100; + _spinYear.Value = 2016; + _spinYear.Step = 1; + _spinYear.MaxTextLength = 4; + _spinYear.TextPointSize = 15; + _spinYear.TextColor = Color.Red; + _spinYear.Focusable = (true); + _spinYear.Name = "_spinYear"; + + // Create a Spin control for month + _spinMonth = new Spin(); + _spinMonth.Flex = 0.3f; + _spinMonth.FlexMargin = new Vector4(5.0f, 0.0f, 5.0f, 0.0f); + _container.Add(_spinMonth); + + _spinMonth.MinValue = 1; + _spinMonth.MaxValue = 12; + _spinMonth.Value = 10; + _spinMonth.Step = 1; + _spinMonth.MaxTextLength = 2; + _spinMonth.TextPointSize = 15; + _spinMonth.TextColor = Color.Green; + _spinMonth.Focusable = (true); + _spinMonth.Name = "_spinMonth"; + + // Create a Spin control for day + _spinDay = new Spin(); + _spinDay.Flex = 0.3f; + _spinDay.FlexMargin = new Vector4(5.0f, 0.0f, 5.0f, 0.0f); + _container.Add(_spinDay); + + _spinDay.MinValue = 1; + _spinDay.MaxValue = 31; + _spinDay.Value = 26; + _spinDay.Step = 1; + _spinDay.MaxTextLength = 2; + _spinDay.TextPointSize = 15; + _spinDay.TextColor = Color.Blue; + _spinDay.Focusable = (true); + _spinDay.Name = "_spinDay"; + + FocusManager keyboardFocusManager = FocusManager.Instance; + keyboardFocusManager.PreFocusChange += OnKeyboardPreFocusChange; + keyboardFocusManager.FocusedViewActivated += OnFocusedViewActivated; + } + + private View OnKeyboardPreFocusChange(object source, FocusManager.PreFocusChangeEventArgs e) + { + View nextFocusView = e.ProposedView; + + // When nothing has been focused initially, focus the text field in the first spin + if (!e.CurrentView && !e.ProposedView) + { + nextFocusView = _spinYear.SpinText; + } + else if(e.Direction == View.FocusDirection.Left) + { + // Move the focus to the spin in the left of the current focused spin + if(e.CurrentView == _spinMonth.SpinText) + { + nextFocusView = _spinYear.SpinText; + } + else if(e.CurrentView == _spinDay.SpinText) + { + nextFocusView = _spinMonth.SpinText; + } + } + else if(e.Direction == View.FocusDirection.Right) + { + // Move the focus to the spin in the right of the current focused spin + if(e.CurrentView == _spinYear.SpinText) + { + nextFocusView = _spinMonth.SpinText; + } + else if(e.CurrentView == _spinMonth.SpinText) + { + nextFocusView = _spinDay.SpinText; + } + } + + return nextFocusView; + } + + private void OnFocusedViewActivated(object source, FocusManager.FocusedViewActivatedEventArgs e) + { + + } + + /// + /// The main entry point for the application. + /// + [STAThread] + static void _Main(string[] args) + { + Example example = new Example(); + example.Run(args); + } + } +} diff --git a/test/NUITestSample/NUITestSample/examples/dispose-test.cs b/test/NUITestSample/NUITestSample/examples/dispose-test.cs new file mode 100755 index 000000000..fbce64590 --- /dev/null +++ b/test/NUITestSample/NUITestSample/examples/dispose-test.cs @@ -0,0 +1,485 @@ + +using System; +using Tizen.NUI; +using Tizen.NUI.UIComponents; +using Tizen.NUI.BaseComponents; +using System.Collections.Generic; + +namespace DisposeTest +{ + class Example : NUIApplication + { + private static string resourcePath = Tizen.Applications.Application.Current.DirectoryInfo.Resource; + protected override void OnCreate() + { + base.OnCreate(); + ImageDisposeTest(); + AddButtons(); + TimerDisposeTest(); + GcTest(); + } + private ImageView image; + private Timer timer; + private bool flag; + private Animation ani; + private void ImageDisposeTest() + { + Layer layer = new Layer(); + layer.RaiseToTop(); + Window.Instance.AddLayer(layer); + + image = new ImageView(); + image.ResourceUrl = resourcePath + "/images/application-icon-0.png"; + image.Size2D = new Size2D(333, 333); + image.ParentOrigin = ParentOrigin.Center; + image.PivotPoint = PivotPoint.Center; + image.PositionUsesPivotPoint = true; + image.Position = new Position(0, 0, 0); + layer.Add(image); + + timer = new Timer(1000); + timer.Tick += Timer_Tick; + timer.Start(); + + ani = new Animation(); + ani.AnimateTo(image, "Scale", new Size(2.0f, 2.0f, 2.0f), 0, 3000); + ani.AnimateTo(image, "Scale", new Size(1.0f, 1.0f, 1.0f), 3000, 6000); + ani.Finished += Ani_Finished; + ani.Play(); + } + + private void Ani_Finished(object sender, EventArgs e) + { + ////NUILog.Debug("scale animation finished! start again in Finshied callback!"); + ani.Play(); + } + + private bool Timer_Tick(object source, Timer.TickEventArgs e) + { + if (flag) + { + image.ResourceUrl = resourcePath + "/images/gallery-2.jpg"; + PropertyMap map = new PropertyMap(); + map.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.SVG)); + string url = $"{resourcePath}/images/gallery-2.jpg"; + //string url = $"{resourcePath}/3.svg"; + map.Add(ImageVisualProperty.URL, new PropertyValue(url)); + map.Add((int)Visual.Property.MixColor, new PropertyValue(new Color(0.7f, 0.0f, 0.0f, 1.0f))); + //image.ImageMap = map; + + flag = false; + ////NUILog.Debug("flag = false!"); + } + else + { + image.ResourceUrl = resourcePath + "/images/test-image.png"; + flag = true; + ////NUILog.Debug("flag = true!"); + } + return true; + } + + private Window window; + private Layer layer; + PushButton pushButton1, pushButton2; + public void AddButtons() + { + //NUILog.Debug("Customized Application Initialize event handler"); + window = Window.Instance; + window.BackgroundColor = Color.Magenta; + window.TouchEvent += OnWindowTouched; + window.WheelEvent += OnWindowWheelMoved; + window.KeyEvent += OnWindowKeyPressed; + //window.EventProcessingFinished += OnWindowEventProcessingFinished; + + layer = window.GetDefaultLayer(); + + pushButton1 = new PushButton(); + pushButton1.ParentOrigin = ParentOrigin.BottomLeft; + pushButton1.PivotPoint = PivotPoint.BottomLeft; + pushButton1.PositionUsesPivotPoint = true; + pushButton1.LabelText = "start animation"; + pushButton1.Position = new Vector3(0.0f, window.Size.Height * 0.1f, 0.0f); + pushButton1.Clicked += OnPushButtonClicked1; + window.Add(pushButton1); + + pushButton2 = new PushButton(); + pushButton2.ParentOrigin = ParentOrigin.BottomLeft; + pushButton2.PivotPoint = PivotPoint.BottomLeft; + pushButton2.PositionUsesPivotPoint = true; + pushButton2.LabelText = "reload image with same URL"; + pushButton2.Position = new Vector3(0.0f, window.Size.Height * 0.2f, 0.0f); + pushButton2.Clicked += OnPushButtonClicked2; + window.Add(pushButton2); + } + + public bool OnPushButtonClicked1(object sender, EventArgs e) + { + //NUILog.Debug("### push button 1 clicked!"); + return true; + } + + public bool OnPushButtonClicked2(object sender, EventArgs e) + { + //NUILog.Debug("### push button 2 clicked!"); + return true; + } + + public void OnWindowEventProcessingFinished(object sender, EventArgs e) + { + //NUILog.Debug("OnWindowEventProcessingFinished()!"); + if (e != null) + { + //NUILog.Debug("e != null !"); + } + } + + public void OnWindowKeyPressed(object sender, Window.KeyEventArgs e) + { + //NUILog.Debug("OnWindowKeyEventOccured()!"); + //NUILog.Debug("keyPressedName=" + e.Key.KeyPressedName); + //NUILog.Debug("state=" + e.Key.State); + } + + public void OnWindowWheelMoved(object sender, Window.WheelEventArgs e) + { + //NUILog.Debug("OnWindowWheelEventOccured()!"); + //NUILog.Debug("direction=" + e.Wheel.Direction); + //NUILog.Debug("type=" + e.Wheel.Type); + } + + // Callback for window touched signal handling + public void OnWindowTouched(object sender, Window.TouchEventArgs e) + { + //NUILog.Debug("OnWindowTouched()! e.TouchData.GetState(0)=" + e.Touch.GetState(0)); + + distest(null, null); + //NUILog.Debug("### 3 timers are disposed!"); + } + + + List timerList; + void TimerDisposeTest() + { + timerList = new List(); + //NUILog.Debug("TimerDisposeTest()!"); + + for (int i = 0; i < 3; i++) + { + Timer timer = new Timer(100); + if (0 == i) timer.Tick += Timer_Tick0; + if (1 == i) timer.Tick += Timer_Tick1; + if (2 == i) timer.Tick += Timer_Tick2; + timerList.Add(timer); + } + ////NUILog.Debug($"TimerDisposeTest() dp1 timerlist cnt={timerList.Count}"); + + foreach (Timer timer in timerList) + { + timer.Start(); + } + + distest = new DisposeTest(Timer_Tick0); + } + + private delegate bool DisposeTest(object source, Timer.TickEventArgs e); + DisposeTest distest; + + private bool Timer_Tick0(object source, Timer.TickEventArgs e) + { + foreach (Timer timer in timerList) + { + timer?.Dispose(); + } + timerList.Clear(); + ////NUILog.Debug("### Timer_Tick0=> 3 timers are disposed!"); + + for (int i = 0; i < 100; i++) + { + Timer timer = new Timer(100); + if (0 == i%3) timer.Tick += Timer_Tick0; + if (1 == i%3) timer.Tick += Timer_Tick1; + if (2 == i%3) timer.Tick += Timer_Tick2; + timerList.Add(timer); + } + + ////NUILog.Debug($"Timer_Tick0=> timerlist cnt={timerList.Count}"); + foreach (Timer timer in timerList) + { + timer.Start(); + } + return true; + } + + private bool Timer_Tick1(object source, Timer.TickEventArgs e) + { + foreach (Timer timer in timerList) + { + timer?.Dispose(); + } + timerList.Clear(); + ////NUILog.Debug("### Timer_Tick1=> 3 timers are disposed!"); + + for (int i = 0; i < 100; i++) + { + Timer timer = new Timer(100); + if (0 == i % 3) timer.Tick += Timer_Tick0; + if (1 == i % 3) timer.Tick += Timer_Tick1; + if (2 == i % 3) timer.Tick += Timer_Tick2; + timerList.Add(timer); + } + + ////NUILog.Debug($"Timer_Tick1=> timerlist cnt={timerList.Count}"); + foreach (Timer timer in timerList) + { + timer.Start(); + } + return true; + } + + private bool Timer_Tick2(object source, Timer.TickEventArgs e) + { + foreach (Timer timer in timerList) + { + timer?.Dispose(); + } + timerList.Clear(); + //NUILog.Debug("### Timer_Tick2=> 3 timers are disposed!"); + + for (int i = 0; i < 100; i++) + { + Timer timer = new Timer(100); + if (0 == i % 3) timer.Tick += Timer_Tick0; + if (1 == i % 3) timer.Tick += Timer_Tick1; + if (2 == i % 3) timer.Tick += Timer_Tick2; + timerList.Add(timer); + } + + //NUILog.Debug($"Timer_Tick2=> timerlist cnt={timerList.Count}"); + foreach (Timer timer in timerList) + { + timer.Start(); + } + return true; + } + + private Timer myTimer; + private List myViewList; + private const int numberOfObjects = 999; + private Random myRandom; + + void GcTest() + { + myViewList = new List(); + myRandom = new Random(); + for (int i = 0; i < numberOfObjects; i++) + { + View v = new View(); + + float intensity = myRandom.Next(0, 255) / 255.0f; + v.BackgroundColor = new Color(intensity, intensity, intensity, 1); + v.Position = new Position(myRandom.Next(0, 1820), myRandom.Next(0, 980), 0); + v.PivotPoint = PivotPoint.TopLeft; + v.Size2D = new Size2D(100, 100); + + myViewList.Add(v); + + Window.Instance.GetDefaultLayer().Add(v); + } + + myTimer = new Timer(1000); + + myTimer.Tick += MyTimer_Tick; + + myTimer.Start(); + } + + private bool MyTimer_Tick(object source, System.EventArgs e) + { + //Remove current Scene, + foreach (View v in myViewList) + { + Window.Instance.GetDefaultLayer().Remove(v); + } + + myViewList.Clear(); + + ////Add View + + GC.Collect(); + GC.WaitForPendingFinalizers(); + + for (int i = 0; i < 50; i++) + { + TextLabel v = new TextLabel(); + + float intensity = myRandom.Next(0, 255) / 255.0f; + v.BackgroundColor = new Color(intensity, intensity, intensity, 1); + v.Position = new Position(myRandom.Next(0, 1820), myRandom.Next(0, 980), 0); + v.PivotPoint = PivotPoint.TopLeft; + v.Size2D = new Size2D(100, 100); + v.Text = "label " + i; + + myViewList.Add(v); + + Window.Instance.GetDefaultLayer().Add(v); + } + + for (int i = 50; i < 100; i++) + { + PushButton v = new PushButton(); + + float intensity = myRandom.Next(0, 255) / 255.0f; + v.BackgroundColor = new Color(intensity, intensity, intensity, 1); + v.Position = new Position(myRandom.Next(0, 1820), myRandom.Next(0, 980), 0); + v.PivotPoint = PivotPoint.TopLeft; + v.Size2D = new Size2D(100, 100); + v.LabelText = "button " + i; + + myViewList.Add(v); + + Window.Instance.GetDefaultLayer().Add(v); + } + + for (int i = 100; i < 150; i++) + { + ImageView v = new ImageView(); + + float intensity = myRandom.Next(0, 255) / 255.0f; + v.BackgroundColor = new Color(intensity, intensity, intensity, 1); + v.Position = new Position(myRandom.Next(0, 1820), myRandom.Next(0, 980), 0); + v.PivotPoint = PivotPoint.TopLeft; + v.Size2D = new Size2D(100, 100); + v.ResourceUrl = resourcePath + "/images/gallery-3.jpg"; + + myViewList.Add(v); + + Window.Instance.GetDefaultLayer().Add(v); + } + + for (int i = 150; i < 200; i++) + { + //TextEditor v = new TextEditor(); + TextLabel v = new TextLabel("2"); + + float intensity = myRandom.Next(0, 255) / 255.0f; + v.BackgroundColor = new Color(intensity, intensity, intensity, 1); + v.Position = new Position(myRandom.Next(0, 1820), myRandom.Next(0, 980), 0); + v.PivotPoint = PivotPoint.TopLeft; + v.Size2D = new Size2D(100, 100); + v.Text = "editor" + i; + + myViewList.Add(v); + + Window.Instance.GetDefaultLayer().Add(v); + } + + for (int i = 200; i < 250; i++) + { + //TextField v = new TextField(); + TextLabel v = new TextLabel("1"); + + float intensity = myRandom.Next(0, 255) / 255.0f; + v.BackgroundColor = new Color(intensity, intensity, intensity, 1); + v.Position = new Position(myRandom.Next(0, 1820), myRandom.Next(0, 980), 0); + v.PivotPoint = PivotPoint.TopLeft; + v.Size2D = new Size2D(100, 100); + v.Text = "field " + i; + + myViewList.Add(v); + + Window.Instance.GetDefaultLayer().Add(v); + } + + for (int i = 250; i < 300; i++) + { + CheckBoxButton v = new CheckBoxButton(); + + float intensity = myRandom.Next(0, 255) / 255.0f; + v.BackgroundColor = new Color(intensity, intensity, intensity, 1); + v.Position = new Position(myRandom.Next(0, 1820), myRandom.Next(0, 980), 0); + v.PivotPoint = PivotPoint.TopLeft; + v.Size2D = new Size2D(100, 100); + v.LabelText = "check " + i; + + myViewList.Add(v); + + Window.Instance.GetDefaultLayer().Add(v); + } + + for (int i = 300; i < 350; i++) + { + ScrollBar v = new ScrollBar(); + + float intensity = myRandom.Next(0, 255) / 255.0f; + v.BackgroundColor = new Color(intensity, intensity, intensity, 1); + v.Position = new Position(myRandom.Next(0, 1820), myRandom.Next(0, 980), 0); + v.PivotPoint = PivotPoint.TopLeft; + v.Size2D = new Size2D(100, 100); + + myViewList.Add(v); + + Window.Instance.GetDefaultLayer().Add(v); + } + + for (int i = 350; i < 400; i++) + { + Slider v = new Slider(); + + float intensity = myRandom.Next(0, 255) / 255.0f; + v.BackgroundColor = new Color(intensity, intensity, intensity, 1); + v.Position = new Position(myRandom.Next(0, 1820), myRandom.Next(0, 980), 0); + v.PivotPoint = PivotPoint.TopLeft; + v.Size2D = new Size2D(100, 100); + + myViewList.Add(v); + + Window.Instance.GetDefaultLayer().Add(v); + } + + for (int i = 400; i < 450; i++) + { + TableView v = new TableView(1, 1); + + float intensity = myRandom.Next(0, 255) / 255.0f; + v.BackgroundColor = new Color(intensity, intensity, intensity, 1); + v.Position = new Position(myRandom.Next(0, 1820), myRandom.Next(0, 980), 0); + v.PivotPoint = PivotPoint.TopLeft; + v.Size2D = new Size2D(100, 100); + + myViewList.Add(v); + + Window.Instance.GetDefaultLayer().Add(v); + } + + for (int i = 450; i < numberOfObjects; i++) + { + View v = new View(); + + float intensity = myRandom.Next(0, 255) / 255.0f; + v.BackgroundColor = new Color(intensity, intensity, intensity, 1); + v.Position = new Position(myRandom.Next(0, 1820), myRandom.Next(0, 980), 0); + v.PivotPoint = PivotPoint.TopLeft; + v.Size2D = new Size2D(100, 100); + + myViewList.Add(v); + + Window.Instance.GetDefaultLayer().Add(v); + } + + return true; + } + + /// + /// The main entry point for the application. + /// + [STAThread] + static void _Main(string[] args) + { + ////NUILog.Debug("Main() called!"); + + Example example = new Example(); + example.Run(args); + } + } +} diff --git a/test/NUITestSample/NUITestSample/examples/feedkey-test.cs b/test/NUITestSample/NUITestSample/examples/feedkey-test.cs new file mode 100755 index 000000000..01383760a --- /dev/null +++ b/test/NUITestSample/NUITestSample/examples/feedkey-test.cs @@ -0,0 +1,114 @@ +/* +* Copyright (c) 2017 Samsung Electronics Co., Ltd. +* +* 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; +using Tizen.NUI; +using Tizen.NUI.BaseComponents; +using Tizen.NUI.Constants; + +namespace FeedKeyTest +{ + class Example : NUIApplication + { + public Example() : base() + { + } + + public Example(string stylesheet) : base(stylesheet) + { + } + + public Example(string stylesheet, WindowMode windowMode) : base(stylesheet, windowMode) + { + } + + protected override void OnCreate() + { + base.OnCreate(); + Initialize(); + } + + public void Initialize() + { + Window window = Window.Instance; + window.BackgroundColor = Color.White; + + View view1 = new View() + { + Position2D = new Position2D(10, 10), + BackgroundColor = Color.Magenta, + Size2D = new Size2D(200, 200), + Focusable = true + }; + + View view2 = new View() + { + Position2D = new Position2D(10, 240), + BackgroundColor = Color.Red, + Size2D = new Size2D(200, 200), + Focusable = true + }; + + window.Add(view1); + window.Add(view2); + + FocusManager.Instance.SetCurrentFocusView(view1); + view2.UpFocusableView = view1; + view1.DownFocusableView = view2; + + view1.KeyEvent += (obj, e) => + { + if (e.Key.State != Key.StateType.Down) + { + return false; + } + Tizen.Log.Debug("NUI", "View1 KeyPressedName: " + e.Key.KeyPressedName); + Window.FeedKeyEvent(e.Key); + return false; + }; + + view2.KeyEvent += (obj, e) => + { + if (e.Key.State != Key.StateType.Down) + { + // Tizen.Log.Debug("NUI", "View2 key state != Down"); + return false; + } + + // Tizen.Log.Debug("NUI", "View2 KeyPressedName: " + e.Key.KeyPressedName); + View v = obj as View; + if(v == view1) + { + Tizen.Log.Debug("NUI", "View2 received view1 feed event: " + e.Key.KeyPressedName); + } + if (v == view2) + { + Tizen.Log.Debug("NUI", "View2 received event: " + e.Key.KeyPressedName); + } + return false; + }; + } + + [STAThread] + static void _Main(string[] args) + { + Example example = new Example(); + example.Run(args); + } + } +} diff --git a/test/NUITestSample/NUITestSample/examples/flex-container.cs b/test/NUITestSample/NUITestSample/examples/flex-container.cs new file mode 100755 index 000000000..f753255c1 --- /dev/null +++ b/test/NUITestSample/NUITestSample/examples/flex-container.cs @@ -0,0 +1,196 @@ + +using System; +using Tizen.NUI; +using Tizen.NUI.UIComponents; +using Tizen.NUI.BaseComponents; + +namespace FlexContainerTest +{ + public class SampleMain : NUIApplication + { + public readonly static string[] samples = new string[] + { + "AnimationSample", + "BasicElement", + "TextSample", + "ImageViewSample", + "EventSample", + "FlexContainer", + "FrameAnimationSample" + }; + + TextLabel[] label; + FlexContainer container; + View focusIndicator; + int numOfSamples; + PushButton pushButton1, pushButton2; + private int _cnt; + private Animation _ani; + + protected override void OnCreate() + { + base.OnCreate(); + + Window.Instance.BackgroundColor = new Color(0.1f, 0.8f, 0.1f, 1.0f); + + container = new FlexContainer(); + container.Size2D = new Size2D(Window.Instance.Size.Width, Window.Instance.Size.Height); + container.PivotPoint = PivotPoint.TopLeft; + container.Padding = new Vector4(100, 100, 100, 100); + + container.FlexWrap = FlexContainer.WrapType.Wrap; + container.FlexDirection = FlexContainer.FlexDirectionType.Column; + + Window.Instance.Add(container); + + numOfSamples = samples.GetLength(0); + Tizen.Log.Debug("NUI", "NUM = " + numOfSamples); + label = new TextLabel[numOfSamples]; + for (int i = 0; i < numOfSamples; i++) + { + label[i] = new TextLabel(); + label[i].Focusable = true; + label[i].BackgroundColor = Color.Red; + //label[i].Size = new Size(100, 50, 0); + label[i].Text = samples[i]; + label[i].FlexMargin = new Vector4(20, 20, 20, 20); + label[i].PointSize = 10; + label[i].Name = "label" + i.ToString(); + container.Add(label[i]); + } + + //label[3].SetKeyInputFocus(); //removed + FocusManager.Instance.SetCurrentFocusView(label[3]); + + FocusManager.Instance.PreFocusChange += Instance_PreFocusChange; + //added + FocusManager.Instance.FocusChanged += (sender, e) => + { + if(e.CurrentView) Tizen.Log.Debug("NUI", "FocusManager FocusChanged signal callback! e.CurrentView.Name=" + e.CurrentView.Name); + else Tizen.Log.Debug("NUI", "FocusManager FocusChanged signal callback! e.CurrentView is null!"); + if (e.NextView) Tizen.Log.Debug("NUI", "FocusManager FocusChanged signal callback! e.NextView.Name=" + e.NextView.Name); + else Tizen.Log.Debug("NUI", "FocusManager FocusChanged signal callback! e.NextView is null!"); + }; + //added + FocusManager.Instance.FocusedViewActivated += (sender, e) => + { + if (e.View) Tizen.Log.Debug("NUI", "FocusManager FocusedViewEnterKeyPressed signal callback! e.View.Name=" + e.View.Name); + else Tizen.Log.Debug("NUI", "FocusManager FocusChanged signal callback! e.View is null!"); + }; + + //added + Window.Instance.TouchEvent += (sender, e) => + { + Tizen.Log.Debug("NUI", "Window Touch signal callback! To avoid crash, when losing key focus, set here again unless the NextView is null"); + FocusManager.Instance.SetCurrentFocusView(label[3]); + }; + + //added + pushButton1 = new PushButton(); + pushButton1.MinimumSize = new Size2D(400, 200); + pushButton1.LabelText = "+PreFocusChange"; + pushButton1.ParentOrigin = ParentOrigin.TopLeft; + pushButton1.PivotPoint = PivotPoint.TopLeft; + pushButton1.Position2D = new Position2D(200, 800); + pushButton1.Clicked += (sender, e) => + { + Tizen.Log.Debug("NUI", "pushbutton1 clicked! add handler!"); + _cnt++; + FocusManager.Instance.PreFocusChange += Instance_PreFocusChange; + _ani.Finished += _ani_Finished; + pushButton1.LabelText = "Add Handler" + _cnt; + pushButton2.LabelText = "Remove Handler" + _cnt; + return true; + }; + Window.Instance.Add(pushButton1); + + pushButton2 = new PushButton(); + pushButton2.MinimumSize = new Size2D(400, 200); + pushButton2.LabelText = "-PreFocusChange"; + pushButton2.ParentOrigin = ParentOrigin.TopLeft; + pushButton2.PivotPoint = PivotPoint.TopLeft; + pushButton2.Position2D = new Position2D(800, 800); + pushButton2.Clicked += (sender, e) => + { + Tizen.Log.Debug("NUI", "pushbutton2 clicked! remove handler!"); + _cnt--; + FocusManager.Instance.PreFocusChange -= Instance_PreFocusChange; + _ani.Finished -= _ani_Finished; + pushButton1.LabelText = "Add Handler" + _cnt; + pushButton2.LabelText = "Remove Handler" + _cnt; + return true; + }; + Window.Instance.Add(pushButton2); + + //added + _ani = new Animation(2000); + _ani.AnimateTo(pushButton1, "Opacity", 0.0f); + _ani.AnimateTo(pushButton2, "Opacity", 0.0f); + _ani.EndAction = Animation.EndActions.Discard; + _ani.Finished += _ani_Finished; + + } + + private void _ani_Finished(object sender, EventArgs e) + { + Tizen.Log.Debug("NUI", "_ani finished! _cnt=" + _cnt); + } + + private View Instance_PreFocusChange(object source, FocusManager.PreFocusChangeEventArgs e) + { + View nextView; + Tizen.Log.Debug("NUI", "Instance_PreFocusChange = " + e.Direction.ToString()); + + //added + if (e.CurrentView == null) e.CurrentView = label[0]; + if (e.ProposedView == null) e.ProposedView = label[0]; + + int index = Array.FindIndex(label, x => x == e.CurrentView); + + Tizen.Log.Debug("NUI", "index = " + index); + + switch (e.Direction) + { + case View.FocusDirection.Up: + index = (index + numOfSamples - 2) % numOfSamples; //changed + _ani.Play(); + break; + case View.FocusDirection.Down: + index = (index + 2) % numOfSamples; //changed + Tizen.Log.Debug("NUI", "pushbutton1 Visible=" + pushButton1.Visible + " pushbutton2 Visible=" + pushButton2.Visible); //added + break; + case View.FocusDirection.Left: + //added + pushButton1.Show(); + pushButton2.Show(); + break; + case View.FocusDirection.Right: + //added + pushButton1.Hide(); + pushButton2.Hide(); + break; + default: + break; + } + + Tizen.Log.Debug("NUI", "next index = " + index); + nextView = label[index]; + + if (e.CurrentView.HasFocus()) + { + //currentView?.ClearKeyInputFocus(); //removed + } + //nextView?.SetKeyInputFocus(); //removed + + return nextView; + } + + static void _Main(string[] args) + { + + SampleMain sample = new SampleMain(); + sample.Run(args); + } + } +} + diff --git a/test/NUITestSample/NUITestSample/examples/gc-test.cs b/test/NUITestSample/NUITestSample/examples/gc-test.cs new file mode 100755 index 000000000..04c9b29a9 --- /dev/null +++ b/test/NUITestSample/NUITestSample/examples/gc-test.cs @@ -0,0 +1,261 @@ + +using System.Collections.Generic; +using System; +using Tizen.NUI.BaseComponents; +using Tizen.NUI.UIComponents; + +namespace TizenVDUIApplication19 +{ + using Tizen.NUI; + + internal class Program : NUIApplication + { + private Timer myTimer; + private List myViewList; + private const int numberOfObjects = 500; + private Random myRandom; + private const string resources = "/home/owner/apps_rw/NUISamples.TizenTV/res"; + + protected override void OnCreate() + { + base.OnCreate(); + + Window.Instance.BackgroundColor = Color.White; + + myViewList = new List(); + + myRandom = new Random(); + + for (int i = 0; i < numberOfObjects; i++) + { + View v = new View(); + + float intensity = myRandom.Next(0, 255) / 255.0f; + v.BackgroundColor = new Color(intensity, intensity, intensity, 1); + v.Position = new Position(myRandom.Next(0, 1820), myRandom.Next(0, 980), 0); + v.PivotPoint = PivotPoint.TopLeft; + v.Size2D = new Size2D(100, 100); + + myViewList.Add(v); + + Window.Instance.GetDefaultLayer().Add(v); + } + + myTimer = new Timer(1000); + + myTimer.Tick += MyTimer_Tick; + + myTimer.Start(); + } + + private bool MyTimer_Tick(object source, System.EventArgs e) + { + //Remove current Scene, + foreach (View v in myViewList) + { + Window.Instance.GetDefaultLayer().Remove(v); + } + + myViewList.Clear(); + + ////Add View + + GC.Collect(); + GC.WaitForPendingFinalizers(); + + for (int i = 0; i < 50; i++) + { + TextLabel v = new TextLabel(); + + float intensity = myRandom.Next(0, 255) / 255.0f; + v.BackgroundColor = new Color(intensity, intensity, intensity, 1); + v.Position = new Position(myRandom.Next(0, 1820), myRandom.Next(0, 980), 0); + v.PivotPoint = PivotPoint.TopLeft; + v.Size2D = new Size2D(100, 100); + v.Text = "label " + i; + + myViewList.Add(v); + + Window.Instance.GetDefaultLayer().Add(v); + } + + for (int i = 50; i < 100; i++) + { + PushButton v = new PushButton(); + + float intensity = myRandom.Next(0, 255) / 255.0f; + v.BackgroundColor = new Color(intensity, intensity, intensity, 1); + v.Position = new Position(myRandom.Next(0, 1820), myRandom.Next(0, 980), 0); + v.PivotPoint = PivotPoint.TopLeft; + v.Size2D = new Size2D(100, 100); + v.LabelText = "button " + i; + + myViewList.Add(v); + + Window.Instance.GetDefaultLayer().Add(v); + } + + for (int i = 100; i < 150; i++) + { + ImageView v = new ImageView(); + + float intensity = myRandom.Next(0, 255) / 255.0f; + v.BackgroundColor = new Color(intensity, intensity, intensity, 1); + v.Position = new Position(myRandom.Next(0, 1820), myRandom.Next(0, 980), 0); + v.PivotPoint = PivotPoint.TopLeft; + v.Size2D = new Size2D(100, 100); + v.ResourceUrl = resources + "/images/gallery-3.jpg"; + + myViewList.Add(v); + + Window.Instance.GetDefaultLayer().Add(v); + } + + for (int i = 150; i < 200; i++) + { + TextEditor v = new TextEditor(); + + float intensity = myRandom.Next(0, 255) / 255.0f; + v.BackgroundColor = new Color(intensity, intensity, intensity, 1); + v.Position = new Position(myRandom.Next(0, 1820), myRandom.Next(0, 980), 0); + v.PivotPoint = PivotPoint.TopLeft; + v.Size2D = new Size2D(100, 100); + v.Text = "editor" + i; + + myViewList.Add(v); + + Window.Instance.GetDefaultLayer().Add(v); + } + + for (int i = 200; i < 250; i++) + { + TextField v = new TextField(); + + float intensity = myRandom.Next(0, 255) / 255.0f; + v.BackgroundColor = new Color(intensity, intensity, intensity, 1); + v.Position = new Position(myRandom.Next(0, 1820), myRandom.Next(0, 980), 0); + v.PivotPoint = PivotPoint.TopLeft; + v.Size2D = new Size2D(100, 100); + v.Text = "field " + i; + + myViewList.Add(v); + + Window.Instance.GetDefaultLayer().Add(v); + } + + for (int i = 250; i < 300; i++) + { + CheckBoxButton v = new CheckBoxButton(); + + float intensity = myRandom.Next(0, 255) / 255.0f; + v.BackgroundColor = new Color(intensity, intensity, intensity, 1); + v.Position = new Position(myRandom.Next(0, 1820), myRandom.Next(0, 980), 0); + v.PivotPoint = PivotPoint.TopLeft; + v.Size2D = new Size2D(100, 100); + v.LabelText = "check " + i; + + myViewList.Add(v); + + Window.Instance.GetDefaultLayer().Add(v); + } + + for (int i = 300; i < 350; i++) + { + ScrollBar v = new ScrollBar(); + + float intensity = myRandom.Next(0, 255) / 255.0f; + v.BackgroundColor = new Color(intensity, intensity, intensity, 1); + v.Position = new Position(myRandom.Next(0, 1820), myRandom.Next(0, 980), 0); + v.PivotPoint = PivotPoint.TopLeft; + v.Size2D = new Size2D(100, 100); + + myViewList.Add(v); + + Window.Instance.GetDefaultLayer().Add(v); + } + + for (int i = 350; i < 400; i++) + { + Slider v = new Slider(); + + float intensity = myRandom.Next(0, 255) / 255.0f; + v.BackgroundColor = new Color(intensity, intensity, intensity, 1); + v.Position = new Position(myRandom.Next(0, 1820), myRandom.Next(0, 980), 0); + v.PivotPoint = PivotPoint.TopLeft; + v.Size2D = new Size2D(100, 100); + + myViewList.Add(v); + + Window.Instance.GetDefaultLayer().Add(v); + } + + for (int i = 400; i < 450; i++) + { + TableView v = new TableView(1, 1); + + float intensity = myRandom.Next(0, 255) / 255.0f; + v.BackgroundColor = new Color(intensity, intensity, intensity, 1); + v.Position = new Position(myRandom.Next(0, 1820), myRandom.Next(0, 980), 0); + v.PivotPoint = PivotPoint.TopLeft; + v.Size2D = new Size2D(100, 100); + + myViewList.Add(v); + + Window.Instance.GetDefaultLayer().Add(v); + } + + for (int i = 450; i < numberOfObjects; i++) + { + View v = new View(); + + float intensity = myRandom.Next(0, 255) / 255.0f; + v.BackgroundColor = new Color(intensity, intensity, intensity, 1); + v.Position = new Position(myRandom.Next(0, 1820), myRandom.Next(0, 980), 0); + v.PivotPoint = PivotPoint.TopLeft; + v.Size2D = new Size2D(100, 100); + + myViewList.Add(v); + + Window.Instance.GetDefaultLayer().Add(v); + } + + return true; + } + + protected override void OnPause() + { + //This function is called when the window's visibility is changed from visible to invisible. + base.OnPause(); + } + + protected override void OnResume() + { + //This function is called when the window's visibility is changed from invisible to visible. + base.OnResume(); + } + + protected override void OnTerminate() + { + //This function is called when the app exit normally. + base.OnTerminate(); + } + /* + protected override void OnLowMemory(LowMemoryEventArgs e) + { + //This function is called when the system is low on memory. + base.OnLowMemory(e); + } + protected override void OnLocaleChanged(LocaleChangedEventArgs e) + { + //This function is called when the language is changed. + base.OnLocaleChanged(e); + } + */ + private static void _Main(string[] args) + { + //Create an Application + Program myProgram = new Program(); + myProgram.Run(args); + } + } +} \ No newline at end of file diff --git a/test/NUITestSample/NUITestSample/examples/hello-test.cs b/test/NUITestSample/NUITestSample/examples/hello-test.cs new file mode 100755 index 000000000..e67995f2f --- /dev/null +++ b/test/NUITestSample/NUITestSample/examples/hello-test.cs @@ -0,0 +1,124 @@ +/* + * Copyright (c) 2017 Samsung Electronics Co., Ltd. + * + * 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; +using Tizen.NUI; +using Tizen.NUI.UIComponents; +using Tizen.NUI.BaseComponents; +using Tizen.NUI.Constants; +//using Tizen.Applications; + +//------------------------------------------------------------------------------ +// +// +// This file can only run on Tizen target. You should compile it with DaliApplication.cs, and +// add tizen c# application related library as reference. +//------------------------------------------------------------------------------ +namespace HelloTest +{ + class Example : NUIApplication + { + private Animation _animation; + private TextLabel _text; + private Window _window; + + public Example():base() + { + } + + public Example(string stylesheet):base(stylesheet) + { + } + + public Example(string stylesheet, WindowMode windowMode):base(stylesheet, windowMode) + { + } + + protected override void OnCreate() + { + base.OnCreate(); + Initialize(); + } + + private void Initialize() + { + // Connect the signal callback for window touched signal + _window = Window.Instance; + _window.TouchEvent += OnWindowTouched; + + // Add a _text label to the window + _text = new TextLabel("Hello Mono World"); + _text.ParentOrigin = ParentOrigin.Center; + _text.PivotPoint = PivotPoint.Center; + _text.HorizontalAlignment = HorizontalAlignment.Center; + _text.PointSize = 32.0f; + + _window.Add(_text); + } + + // Callback for _animation finished signal handling + private void AnimationFinished(object sender, EventArgs e) + { + if (_animation) + { + Tizen.Log.Debug("NUI", "Duration= " + _animation.Duration); + Tizen.Log.Debug("NUI", "EndAction= " + _animation.EndAction); + } + } + + // Callback for window touched signal handling + private void OnWindowTouched(object sender, Window.TouchEventArgs e) + { + // Only animate the _text label when touch down happens + if (e.Touch.GetState(0) == PointStateType.Down) + { + // Create a new _animation + if (_animation) + { + _animation.Reset(); + } + + _animation = new Animation(1000); // 1 second of duration + + _animation.AnimateTo(_text, "Orientation", new Rotation(new Radian(new Degree(180.0f)), Vector3.XAxis), 0, 500); + _animation.AnimateTo(_text, "Orientation", new Rotation(new Radian(new Degree(0.0f)), Vector3.XAxis), 500, 1000); + _animation.EndAction = Animation.EndActions.Discard; + + // Connect the signal callback for animaiton finished signal + _animation.Finished += AnimationFinished; + + // Play the _animation + _animation.Play(); + } + } + + /// + /// The main entry point for the application. + /// + + [STAThread] + static void _Main(string[] args) + { + Tizen.Log.Debug("NUI", "Hello mono world."); + //Example example = new Example(); + //Example example = new Example("stylesheet"); + Example example = new Example("stylesheet", WindowMode.Transparent); + example.Run(args); + } + } +} diff --git a/test/NUITestSample/NUITestSample/examples/hello-world.cs b/test/NUITestSample/NUITestSample/examples/hello-world.cs new file mode 100755 index 000000000..4fcc6c40a --- /dev/null +++ b/test/NUITestSample/NUITestSample/examples/hello-world.cs @@ -0,0 +1,335 @@ +/* +* Copyright (c) 2017 Samsung Electronics Co., Ltd. +* +* 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.Threading.Tasks; +using Tizen.NUI; +using Tizen.NUI.BaseComponents; + +namespace HelloWorldTest +{ + class Example : NUIApplication + { + private Animation _animation; + private TextLabel _text; + private int cnt; + private View _view; + TextField textFieldPlaceholderTest; + TextLabel keySubclassTest; + + protected override void OnCreate() + { + base.OnCreate(); + Initialize(); + } + + TextLabel pixelLabel; + TextLabel pointLabel; + public void Initialize() + { + Window window = Window.Instance; + window.BackgroundColor = Color.White; + window.TouchEvent += OnWindowTouched; + window.KeyEvent += OnWindowKeyEvent; + window.Resized += (obj, e) => + { + Tizen.Log.Fatal("NUI", "Height: " + e.WindowSize.Height); + Tizen.Log.Fatal("NUI", "Width: " + e.WindowSize.Width); + }; + + pixelLabel = new TextLabel("Test Pixel Size 32.0f"); + pixelLabel.Position2D = new Position2D(10, 10); + pixelLabel.PixelSize = 32.0f; + window.Add(pixelLabel); + + pointLabel = new TextLabel("Test Point Size 32.0f"); + pointLabel.Position2D = new Position2D(10, 70); + pointLabel.PointSize = 32.0f; + window.Add(pointLabel); + + Task.Factory.StartNew(() => + { + try + { + TextLabel ellipsis = new TextLabel("Ellipsis of TextLabel is enabled."); + ellipsis.Size2D = new Size2D(100, 100); + ellipsis.Position2D = new Position2D(10, 250); + ellipsis.PointSize = 20.0f; + ellipsis.Ellipsis = true; + window.Add(ellipsis); + } + catch (Exception e) + { + Tizen.Log.Fatal("NUI", $"exception caught! e={e}"); + } + }).Wait(); + + TextField textFieldEllipsisTest = new TextField(); + textFieldEllipsisTest.Text = "TextField Ellipsis Test, ABCDEFGHIJKLMNOPQRSTUVWXYZ"; + textFieldEllipsisTest.Size2D = new Size2D(200, 100); + textFieldEllipsisTest.Position2D = new Position2D(10, 150); + textFieldEllipsisTest.PointSize = 30.0f; + //textFieldEllipsisTest.Ellipsis = false; + window.Add(textFieldEllipsisTest); + + TextField textFieldEllipsisTest2 = new TextField(); + textFieldEllipsisTest2.Text = "TextField Ellipsis Test, ABCDEFGHIJKLMNOPQRSTUVWXYZ"; + textFieldEllipsisTest2.Size2D = new Size2D(200, 100); + textFieldEllipsisTest2.Position2D = new Position2D(300, 150); + textFieldEllipsisTest2.PointSize = 30.0f; + //textFieldEllipsisTest2.Ellipsis = true; + window.Add(textFieldEllipsisTest2); + + + textFieldPlaceholderTest = new TextField(); + + PropertyMap propertyMap = new PropertyMap(); + propertyMap.Add("placeholderText", new PropertyValue("TextField Placeholder Test")); + propertyMap.Add("placeholderTextFocused", new PropertyValue("Placeholder Text Focused")); + propertyMap.Add("placeholderColor", new PropertyValue(Color.Blue)); + propertyMap.Add("placeholderPointSize", new PropertyValue(20.0f)); + + PropertyMap fontStyleMap = new PropertyMap(); + fontStyleMap.Add("weight", new PropertyValue("bold")); + fontStyleMap.Add("width", new PropertyValue("condensed")); + fontStyleMap.Add("slant", new PropertyValue("italic")); + propertyMap.Add("placeholderFontStyle", new PropertyValue(fontStyleMap)); + + textFieldPlaceholderTest.Size2D = new Size2D(300, 50); + textFieldPlaceholderTest.Position2D = new Position2D(10, 230); + textFieldPlaceholderTest.BackgroundColor = Color.Magenta; + textFieldPlaceholderTest.Placeholder = propertyMap; + textFieldPlaceholderTest.Focusable = true; + window.Add(textFieldPlaceholderTest); + + keySubclassTest = new TextLabel(); + keySubclassTest.Text = "Key Subclass Test!"; + keySubclassTest.Size2D = new Size2D(900, 50); + keySubclassTest.Position2D = new Position2D(10, 300); + keySubclassTest.BackgroundColor = Color.Cyan; + keySubclassTest.PointSize = 20; + keySubclassTest.Focusable = true; + window.Add(keySubclassTest); + + + TextLabel autoScrollStopMode = new TextLabel("AutoScrollStopMode is finish-loop. PointSize=30"); + autoScrollStopMode.Size2D = new Size2D(400, 100); + autoScrollStopMode.Position2D = new Position2D(10, 500); + autoScrollStopMode.PointSize = 30.0f; + autoScrollStopMode.AutoScrollStopMode = AutoScrollStopMode.Immediate; + autoScrollStopMode.AutoScrollLoopDelay = 3.0f; + autoScrollStopMode.EnableAutoScroll = true; + autoScrollStopMode.AutoScrollLoopCount = 0; + window.Add(autoScrollStopMode); + + _text = new TextLabel("Hello NUI World"); + _text.Position2D = new Position2D(10, 500); + _text.HorizontalAlignment = HorizontalAlignment.Center; + _text.PointSize = 20.0f; + _text.TextColor = Color.Magenta; + window.Add(_text); + + _view = new View(); + _view.Size2D = new Size2D(100, 100); + _view.SizeWidth = 50; + Tizen.Log.Fatal("NUI", "[1]_view SizeWidth=" + _view.SizeWidth); + + _animation = new Animation + { + Duration = 2000 + }; + _animation.AnimateTo(_text, "Orientation", new Rotation(new Radian(new Degree(180.0f)), PositionAxis.X), 0, 500); + _animation.AnimateTo(_text, "Orientation", new Rotation(new Radian(new Degree(0.0f)), PositionAxis.X), 500, 1000); + _animation.AnimateBy(_text, "ScaleX", 3, 1000, 1500); + _animation.AnimateBy(_text, "ScaleY", 4.0f, 1500, 2000); + _animation.EndAction = Animation.EndActions.Discard; + _animation.Finished += AnimationFinished; + + _view.SizeWidth = 50; + Tizen.Log.Fatal("NUI", "[2]_view SizeWidth=" + _view.SizeWidth); + + TextLabelLineWrapModeTest(); + ViewLayoutDirectionTest(); + + textFieldPlaceholderTest.DownFocusableView = keySubclassTest; + keySubclassTest.UpFocusableView = textFieldPlaceholderTest; + FocusManager.Instance.SetCurrentFocusView(keySubclassTest); + } + + + private View view1, view11, view12, view111, view121; + public void ViewLayoutDirectionTest() + { + view1 = new View(); + view1.Name = "view 1"; + //view1.LayoutDirection = ViewLayoutDirectionType.RTL; + Window.Instance.GetDefaultLayer().Add(view1); + //view1.LayoutDirectionChanged += View1_LayoutDirectionChanged; + + view11 = new View(); + view11.Name = "view 11"; + //view11.InheritLayoutDirection = true; + view1.Add(view11); + + view12 = new View(); + view12.Name = "view 12"; + //view12.LayoutDirection = ViewLayoutDirectionType.LTR; + view1.Add(view12); + + view111 = new View(); + view111.Name = "view 111"; + //view111.InheritLayoutDirection = true; + view11.Add(view111); + + view121 = new View(); + view121.Name = "view 121"; + //view121.InheritLayoutDirection = true; + view12.Add(view121); + } + + //private void View1_LayoutDirectionChanged(object sender, View.LayoutDirectionChangedEventArgs e) + //{ + // Tizen.Log.Error("NUI", "View1_LayoutDirectionChanged()! e.Type=" + e.Type); + //} + + public void AnimationFinished(object sender, EventArgs e) + { + Tizen.Log.Fatal("NUI", "AnimationFinished()! cnt=" + (cnt)); + if (_animation) + { + Tizen.Log.Fatal("NUI", "Duration= " + _animation.Duration + "EndAction= " + _animation.EndAction); + } + _view.SizeWidth = 50; + Tizen.Log.Fatal("NUI", "[3]_view SizeWidth=" + _view.SizeWidth); + } + + int win_test; + public void OnWindowKeyEvent(object sender, Window.KeyEventArgs e) + { + Tizen.Log.Fatal("NUI", "e.Key.KeyPressedName=" + e.Key.KeyPressedName); + + if (e.Key.State == Key.StateType.Down) + { + //keySubclassTest.Text = $"DeviceSubClass={e.Key.DeviceSubClass}, DeviceClass={e.Key.DeviceClass}, DeviceName={e.Key.DeviceName}, KeyCode={e.Key.KeyCode}"; + + if (e.Key.KeyPressedName == "Up") + { + if (_animation) + { + _animation.Finished += AnimationFinished; + cnt++; + Tizen.Log.Fatal("NUI", "AnimationFinished added!"); + } + //pointLabel.TextColorAnimatable = Color.Blue; + //pixelLabel.TextColorAnimatable = Color.Blue; + + Tizen.Log.Fatal("NUI", $"LineWrapMode 1st={ myTextLabel?.LineWrapMode} 2nd={ myTextLabel2?.LineWrapMode}"); + } + else if (e.Key.KeyPressedName == "Down") + { + if (_animation) + { + _animation.Finished -= AnimationFinished; + cnt--; + Tizen.Log.Fatal("NUI", "AnimationFinished removed!"); + } + //pointLabel.TextColorAnimatable = Color.Red; + //pixelLabel.TextColorAnimatable = Color.Red; + + Window.Instance.SetClass($"Window.SetClass() Test #{win_test++}", ""); + Tizen.Log.Fatal("NUI", $"Check with enlightenment_info -topwins ! Window.SetClass() Test #{win_test}"); + } + else if (e.Key.KeyPressedName == "Return") + { + _animation.Play(); + Tizen.Log.Fatal("NUI", "_animation play here!"); + } + } + } + + public void OnWindowTouched(object sender, Window.TouchEventArgs e) + { + if (e.Touch.GetState(0) == PointStateType.Down) + { + _animation.Play(); + } + } + + private TextLabel myTextLabel; + private TextLabel myTextLabel2; + private TextEditor myTextEditor; + private TextEditor myTextEditor2; + public void TextLabelLineWrapModeTest() + { + Tizen.Log.Fatal("NUI", "WrapModeTest START!"); + myTextLabel = new TextLabel(); + myTextLabel.Position2D = new Position2D(10, 600); + myTextLabel.Size2D = new Size2D(400, 90); + myTextLabel.BackgroundColor = Color.Blue; + myTextLabel.PointSize = 20; + myTextLabel.TextColor = Color.White; + myTextLabel.MultiLine = true; + myTextLabel.LineWrapMode = LineWrapMode.Character; + myTextLabel.Text = $"[TextLabel LineWrapMode.Character] hello ABCDEFGHI is my name, it is very very long beautiful hansome awesome name."; + Window.Instance.GetDefaultLayer().Add(myTextLabel); + + myTextLabel2 = new TextLabel(); + myTextLabel2.Position2D = new Position2D(450, 600); + myTextLabel2.Size2D = new Size2D(400, 90); + myTextLabel2.BackgroundColor = Color.Blue; + myTextLabel2.PointSize = 20; + myTextLabel2.TextColor = Color.White; + myTextLabel2.MultiLine = true; + myTextLabel2.LineWrapMode = LineWrapMode.Word; + myTextLabel2.Text = $"[TextLabel LineWrapMode.Word] hello ABCDEFGHI is my name, it is very very long beautiful hansome awesome name."; + Window.Instance.GetDefaultLayer().Add(myTextLabel2); + + Tizen.Log.Fatal("NUI", $"TextLabel LineWrapMode 1st={ myTextLabel?.LineWrapMode} 2nd={ myTextLabel2?.LineWrapMode}"); + + myTextEditor = new TextEditor(); + myTextEditor.Position2D = new Position2D(10, 700); + myTextEditor.Size2D = new Size2D(400, 90); + myTextEditor.BackgroundColor = Color.Red; + myTextEditor.PointSize = 20; + myTextEditor.TextColor = Color.White; + //myTextEditor.MultiLine = true; + myTextEditor.LineWrapMode = LineWrapMode.Character; + myTextEditor.Text = $"[TextEditor LineWrapMode.Character] hello ABCDEFGHI is my name, it is very very long beautiful hansome awesome name."; + Window.Instance.GetDefaultLayer().Add(myTextEditor); + + myTextEditor2 = new TextEditor(); + myTextEditor2.Position2D = new Position2D(450, 700); + myTextEditor2.Size2D = new Size2D(400, 90); + myTextEditor2.BackgroundColor = Color.Red; + myTextEditor2.PointSize = 20; + myTextEditor2.TextColor = Color.White; + //myTextEditor2.MultiLine = true; + myTextEditor2.LineWrapMode = LineWrapMode.Word; + myTextEditor2.Text = $"[TextEditor LineWrapMode.Word] hello ABCDEFGHI is my name, it is very very long beautiful hansome awesome name."; + Window.Instance.GetDefaultLayer().Add(myTextEditor2); + + Tizen.Log.Fatal("NUI", $"TextEditor LineWrapMode 1st={ myTextEditor?.LineWrapMode} 2nd={ myTextEditor2?.LineWrapMode}"); + } + + [STAThread] + static void _Main(string[] args) + { + Example example = new Example(); + example.Run(args); + } + } +} diff --git a/test/NUITestSample/NUITestSample/examples/image-view.cs b/test/NUITestSample/NUITestSample/examples/image-view.cs new file mode 100755 index 000000000..f073f5f01 --- /dev/null +++ b/test/NUITestSample/NUITestSample/examples/image-view.cs @@ -0,0 +1,288 @@ +/* +* Copyright (c) 2017 Samsung Electronics Co., Ltd. +* +* 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.NUI; +using Tizen.NUI.UIComponents; +using Tizen.NUI.BaseComponents; + +namespace ImageViewTest +{ + class Example : NUIApplication + { + private static string resourcePath = Tizen.Applications.Application.Current.DirectoryInfo.Resource; + private Animation _animation; + private ImageView _imageView; + private bool _isAniFinised = true; + private Layer layer, _layer1, _layer2; + private PushButton _pushButton1, _pushButton2; + private Window window; + private bool urlNullTest = false; + + protected override void OnCreate() + { + base.OnCreate(); + Initialize(); + ImageUrlTest(); + } + + private ImageView image; + private Timer timer; + private bool flag; + private void ImageUrlTest() + { + image = new ImageView(); + image.ResourceUrl = resourcePath + "/images/application-icon-0.png"; + image.Size2D = new Size2D(333, 333); + image.ParentOrigin = ParentOrigin.Center; + image.PivotPoint = PivotPoint.Center; + image.PositionUsesPivotPoint = true; + Window.Instance.Add(image); + + timer = new Timer(1000); + timer.Tick += Timer_Tick; + timer.Start(); + } + + private bool Timer_Tick(object source, Timer.TickEventArgs e) + { + if (flag) + { + image.ResourceUrl = resourcePath + "/images/application-icon-0.png"; + flag = false; + //////NUILog.Debug("flag = false!"); + } + else + { + if (urlNullTest) + { + image.ResourceUrl = ""; + } + else + { + image.ResourceUrl = resourcePath + "/images/image-1.jpg"; + } + flag = true; + ////NUILog.Debug("flag = true!"); + } + return true; + } + + public void Initialize() + { + //////NUILog.Debug("Customized Application Initialize event handler"); + window = Window.Instance; + window.BackgroundColor = Color.Cyan; + window.TouchEvent += OnWindowTouched; + window.WheelEvent += OnWindowWheelMoved; + window.KeyEvent += OnWindowKeyPressed; + //window.EventProcessingFinished += OnWindowEventProcessingFinished; + + layer = window.GetDefaultLayer(); + _layer1 = new Layer(); + _layer2 = new Layer(); + window.AddLayer(_layer1); + window.AddLayer(_layer2); + //////NUILog.Debug("_layer1.Behavior =" + _layer1.Behavior); + if (_layer1.Behavior == Layer.LayerBehavior.LayerUI) + { + _layer1.Behavior = Layer.LayerBehavior.Layer2D; + ////NUILog.Debug("again _layer1.Behavior =" + _layer1.Behavior); + } + // Add a ImageView to the window + // PropertyMap map = new PropertyMap(); + // map.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.NPatch)); + // map.Add(NpatchImageVisualProperty.URL, new PropertyValue(resourcePath+"/images/00_popup_bg.9.png")); + // map.Add(NpatchImageVisualProperty.Border, new PropertyValue(new Rectangle(100, 100, 100, 100))); + _imageView = new ImageView(); + //_imageView.ImageMap = map; + _imageView.ResourceUrl = resourcePath + "/images/gallery-0.jpg"; + //_imageView.Border = new Rectangle(100, 100, 100, 100); + _imageView.ParentOrigin = ParentOrigin.TopLeft; + _imageView.PivotPoint = PivotPoint.TopLeft; + _imageView.Position = new Position(5.0f, 5.0f, 0.0f); + _imageView.PixelArea = new Vector4(0.0f, 0.0f, 0.5f, 0.5f); + _imageView.Size2D = new Size2D(200, 80); + //_imageView.SetResizePolicy(ResizePolicyType.USE_NATURAL_SIZE, DimensionType.ALL_DIMENSIONS); + layer.Add(_imageView); + + _pushButton1 = new PushButton(); + _pushButton1.ParentOrigin = ParentOrigin.BottomLeft; + _pushButton1.PivotPoint = PivotPoint.BottomLeft; + _pushButton1.LabelText = "start animation"; + _pushButton1.Position = new Vector3(0.0f, window.Size.Height * 0.1f, 0.0f); + _pushButton1.Clicked += OnPushButtonClicked1; + _layer1.Add(_pushButton1); + + _pushButton2 = new PushButton(); + _pushButton2.ParentOrigin = ParentOrigin.BottomLeft; + _pushButton2.PivotPoint = PivotPoint.BottomLeft; + _pushButton2.LabelText = "reload image with same URL"; + _pushButton2.Position = new Vector3(0.0f, window.Size.Height * 0.2f, 0.0f); + _pushButton2.Clicked += OnPushButtonClicked2; + _layer2.Add(_pushButton2); + + ImageView syncImage = new ImageView(); + syncImage.ParentOrigin = ParentOrigin.CenterLeft; + syncImage.PivotPoint = PivotPoint.CenterLeft; + syncImage.PositionUsesPivotPoint = true; + syncImage.Size2D = new Size2D(150, 150); + syncImage.ResourceUrl = resourcePath + "/images/gallery-3.jpg"; + syncImage.SynchronosLoading = true; + layer.Add(syncImage); + + PropertyMap _map = new PropertyMap(); + _map.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.NPatch)); + _map.Add(NpatchImageVisualProperty.URL, new PropertyValue(resourcePath + "/images/gallery-4.jpg")); + _map.Add(NpatchImageVisualProperty.SynchronousLoading, new PropertyValue(true)); + ImageView nPatchImage = new ImageView(); + nPatchImage.ParentOrigin = ParentOrigin.BottomLeft; + nPatchImage.PivotPoint = PivotPoint.BottomLeft; + nPatchImage.PositionUsesPivotPoint = true; + nPatchImage.Size2D = new Size2D(300, 100); + nPatchImage.ImageMap = _map; + layer.Add(nPatchImage); + + ImageView syncNineImage = new ImageView(); + syncNineImage.ParentOrigin = ParentOrigin.CenterLeft; + syncNineImage.PivotPoint = PivotPoint.CenterLeft; + syncNineImage.Position2D = new Position2D(0, 200); + syncNineImage.PositionUsesPivotPoint = true; + syncNineImage.Size2D = new Size2D(150, 150); + syncNineImage.ResourceUrl = resourcePath + "/images/gallery-5.jpg"; + syncNineImage.SynchronosLoading = true; + syncNineImage.Border = new Rectangle(0, 0, 0, 0); + layer.Add(syncNineImage); + } + + public bool OnPushButtonClicked2(object sender, EventArgs e) + { + if (_imageView) + { + //////NUILog.Debug("OnPushButtonClicked2()!"); + layer.Remove(_imageView); + _imageView = new ImageView(); + _imageView.ResourceUrl = resourcePath + "/images/gallery-3.jpg"; + _imageView.ParentOrigin = ParentOrigin.Center; + _imageView.PivotPoint = PivotPoint.Center; + _imageView.PixelArea = new Vector4(0.0f, 0.0f, 0.5f, 0.5f); + //_imageView.SetResizePolicy(ResizePolicyType.USE_NATURAL_SIZE, DimensionType.ALL_DIMENSIONS); + layer.Add(_imageView); + } + + return true; + } + + public bool OnPushButtonClicked1(object sender, EventArgs e) + { + if (_isAniFinised == true) + { + _isAniFinised = false; + ////NUILog.Debug("OnPushButtonClicked1()!"); + + // Create a new _animation + if (_animation) + { + //_animation.Stop(Tizen.NUI.Constants.Animation.EndAction.Stop); + _animation.Reset(); + } + + _animation = new Animation(); + _animation.AnimateTo(_imageView, "PixelArea", new Vector4(0.5f, 0.0f, 0.5f, 0.5f), 0, 1000); + _animation.AnimateTo(_imageView, "PixelArea", new Vector4(0.5f, 0.5f, 0.5f, 0.5f), 1000, 2000); + _animation.AnimateTo(_imageView, "PixelArea", new Vector4(0.0f, 0.0f, 1.0f, 1.0f), 2000, 3000); + _animation.AnimateTo(_imageView, "PixelArea", new Vector4(0.5f, 0.5f, 0.5f, 0.5f), 3000, 4000); + + KeyFrames _keyFrames = new KeyFrames(); + _keyFrames.Add(0.0f, new Size(0.0f, 0.0f, 0.0f)); + _keyFrames.Add(0.3f, new Size(window.Size.Width * 0.7f, window.Size.Height * 0.7f, 0.0f)); + _keyFrames.Add(1.0f, new Size(window.Size)); + _animation.AnimateBetween(_imageView, "Size", _keyFrames, 4000, 6000, Animation.Interpolation.Linear); + + _animation.EndAction = Animation.EndActions.Discard; + + // Connect the signal callback for animaiton finished signal + _animation.Finished += AnimationFinished; + _animation.Finished += AnimationFinished2; + + // Play the _animation + _animation.Play(); + } + + return true; + } + + // Callback for _animation finished signal handling + public void AnimationFinished(object sender, EventArgs e) + { + ////NUILog.Debug("AnimationFinished()!"); + } + + // Callback for second _animation finished signal handling + public void AnimationFinished2(object sender, EventArgs e) + { + ////NUILog.Debug("AnimationFinished2()!"); + if (_animation) + { + ////NUILog.Debug("Duration= " + _animation.Duration); + ////NUILog.Debug("EndAction= " + _animation.EndAction); + _isAniFinised = true; + } + } + + public void OnWindowEventProcessingFinished(object sender, EventArgs e) + { + ////NUILog.Debug("OnWindowEventProcessingFinished()!"); + if (e != null) + { + //////NUILog.Debug("e != null !"); + } + } + + public void OnWindowKeyPressed(object sender, Window.KeyEventArgs e) + { + ////NUILog.Debug("OnWindowKeyEventOccured()!"); + ////NUILog.Debug("keyPressedName=" + e.Key.KeyPressedName); + ////NUILog.Debug("state=" + e.Key.State); + } + + public void OnWindowWheelMoved(object sender, Window.WheelEventArgs e) + { + ////NUILog.Debug("OnWindowWheelEventOccured()!"); + ////NUILog.Debug("direction=" + e.Wheel.Direction); + ////NUILog.Debug("type=" + e.Wheel.Type); + } + + // Callback for window touched signal handling + public void OnWindowTouched(object sender, Window.TouchEventArgs e) + { + ////NUILog.Debug("OnWindowTouched()! e.TouchData.GetState(0)=" + e.Touch.GetState(0)); + } + + /// + /// The main entry point for the application. + /// + [STAThread] + static void _Main(string[] args) + { + ////NUILog.Debug("Main() called!"); + + Example example = new Example(); + example.Run(args); + } + } +} diff --git a/test/NUITestSample/NUITestSample/examples/positionUsesPivotPoint-test.cs b/test/NUITestSample/NUITestSample/examples/positionUsesPivotPoint-test.cs new file mode 100755 index 000000000..d2088a2a6 --- /dev/null +++ b/test/NUITestSample/NUITestSample/examples/positionUsesPivotPoint-test.cs @@ -0,0 +1,98 @@ +/* + * Copyright (c) 2017 Samsung Electronics Co., Ltd. + * + * 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; +using Tizen.NUI; +using Tizen.NUI.UIComponents; +using Tizen.NUI.BaseComponents; +using Tizen.NUI.Constants; +//using Tizen.Applications; + +//------------------------------------------------------------------------------ +// +// +// This file can only run on Tizen target. You should compile it with DaliApplication.cs, and +// add tizen c# application related library as reference. +//------------------------------------------------------------------------------ +namespace PositionUsesPivotPointTest +{ + class Example : NUIApplication + { + private TextLabel _text1; + private TextLabel _text2; + private Window _window; + + public Example():base() + { + } + + public Example(string stylesheet):base(stylesheet) + { + } + + public Example(string stylesheet, WindowMode windowMode):base(stylesheet, windowMode) + { + } + + protected override void OnCreate() + { + base.OnCreate(); + Initialize(); + } + + private void Initialize() + { + // Connect the signal callback for window touched signal + _window = Window.Instance; + _text1 = new TextLabel("PositionUsesPivotPoint"); + _text1.ParentOrigin = ParentOrigin.Center; + _text1.PivotPoint = PivotPoint.Center; + _text1.Position = new Position(0, 0, 0); + _text1.PositionUsesPivotPoint = true; + _text1.HorizontalAlignment = HorizontalAlignment.Center; + _text1.Size2D = new Size2D(200, 100); + _text1.PointSize = 10.0f; + _text1.BackgroundColor = Color.Blue; + _window.Add(_text1); + + _text2 = new TextLabel("PositionNotUsesPivotPoint"); + _text2.ParentOrigin = ParentOrigin.Center; + _text2.PivotPoint = PivotPoint.Center; + _text2.Position = new Position(0, 0, 0); + _text2.PositionUsesPivotPoint = false; + _text2.HorizontalAlignment = HorizontalAlignment.Center; + _text2.Size2D = new Size2D(200, 100); + _text2.PointSize = 10.0f; + _text2.BackgroundColor = Color.Red; + _window.Add(_text2); + } + + + + /// + /// The main entry point for the application. + /// + [STAThread] + static void _Main(string[] args) + { + Tizen.Log.Debug("NUI", "Hello mono world."); + Example example = new Example("stylesheet", WindowMode.Transparent); + example.Run(args); + } + } +} diff --git a/test/NUITestSample/NUITestSample/examples/relative-vector.cs b/test/NUITestSample/NUITestSample/examples/relative-vector.cs new file mode 100755 index 000000000..eb27855d6 --- /dev/null +++ b/test/NUITestSample/NUITestSample/examples/relative-vector.cs @@ -0,0 +1,106 @@ +/* + * Copyright (c) 2017 Samsung Electronics Co., Ltd. + * + * 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; +using Tizen.NUI; +using Tizen.NUI.UIComponents; +using Tizen.NUI.BaseComponents; +//using Tizen.Applications; + +//------------------------------------------------------------------------------ +// +// +// This file can only run on Tizen target. You should compile it with DaliApplication.cs, and +// add tizen c# application related library as reference. +//------------------------------------------------------------------------------ +namespace RelativeVectorTest +{ + class Example : NUIApplication + { + private Animation _animation; + private ImageView _imageView; + private Window _window; + private const string resources = "/home/owner/apps_rw/NUISamples.TizenTV/res"; + + public Example():base() + { + } + + public Example(string stylesheet):base(stylesheet) + { + } + + public Example(string stylesheet, WindowMode windowMode):base(stylesheet, windowMode) + { + } + + protected override void OnCreate() + { + base.OnCreate(); + Initialize(); + } + + private void Initialize() + { + _window = Window.Instance; + _window.TouchEvent += OnWindowTouched; + + _imageView = new ImageView(); + _imageView.ResourceUrl = resources+"/images/gallery-3.jpg"; + _imageView.ParentOrigin = ParentOrigin.Center; + _imageView.PivotPoint = PivotPoint.Center; + _imageView.PixelArea = new RelativeVector4(0.0f, 0.0f, 0.0f, 0.0f); + + _window.Add(_imageView); + } + + // Callback for window touched signal handling + private void OnWindowTouched(object sender, Window.TouchEventArgs e) + { + // Only animate the _text label when touch down happens + if (e.Touch.GetState(0) == PointStateType.Down) + { + // Create a new _animation + if (_animation) + { + _animation.Reset(); + } + + _animation = new Animation(1000); // 1 second of duration + _animation.AnimateTo(_imageView, "PixelArea", new RelativeVector4(0.0f, 0.0f, 1.0f, 1.0f), 0, 1000); + _animation.EndAction = Animation.EndActions.Discard; + _animation.PlayRange = new RelativeVector2(0.2f, 0.8f); + + // Play the _animation + _animation.Play(); + } + } + + /// + /// The main entry point for the application. + /// + + [STAThread] + static void _Main(string[] args) + { + Tizen.Log.Debug("NUI", "Hello mono world."); + Example example = new Example("stylesheet", WindowMode.Transparent); + example.Run(args); + } + } +} diff --git a/test/NUITestSample/NUITestSample/examples/scroll-view.cs b/test/NUITestSample/NUITestSample/examples/scroll-view.cs new file mode 100755 index 000000000..15eab9164 --- /dev/null +++ b/test/NUITestSample/NUITestSample/examples/scroll-view.cs @@ -0,0 +1,213 @@ +/* + * Copyright (c) 2017 Samsung Electronics Co., Ltd. + * + * 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; +using Tizen.NUI; +using Tizen.NUI.UIComponents; +using Tizen.NUI.BaseComponents; +using Tizen.NUI.Constants; + +namespace ScrollViewTest +{ + class Example : NUIApplication + { + private const string resources = "/home/owner/apps_rw/NUISamples.TizenTV/res"; + + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + delegate void CallbackDelegate(IntPtr data); + + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + delegate void ActorCallbackDelegate(IntPtr data); + + private ScrollView _scrollView; + private ScrollBar _scrollBar; + private Animation _animation; + private TextLabel _text; + + public Example() : base() + { + } + + public Example(string stylesheet) : base(stylesheet) + { + } + + public Example(string stylesheet, WindowMode windowMode) : base(stylesheet, windowMode) + { + } + + protected override void OnCreate() + { + base.OnCreate(); + Initialize(); + } + + public void Initialize() + { + CreateScrollView(); + } + + private void CreateScrollView() + { + Window window = Window.Instance; + window.BackgroundColor = Color.White; + + // Create a scroll view + _scrollView = new ScrollView(); + Size windowSize = new Size(window.Size.Width, window.Size.Height, 0.0f); + _scrollView.Size2D = new Size2D((int)windowSize.Width, (int)windowSize.Height); + _scrollView.ParentOrigin = ParentOrigin.Center; + _scrollView.PivotPoint = PivotPoint.Center; + window.Add(_scrollView); + + // Add actors to a scroll view with 3 pages + int pageRows = 1; + int pageColumns = 3; + for(int pageRow = 0; pageRow < pageRows; pageRow++) + { + for(int pageColumn = 0; pageColumn < pageColumns; pageColumn++) + { + View pageActor = new View(); + pageActor.WidthResizePolicy = ResizePolicyType.FillToParent; + pageActor.HeightResizePolicy = ResizePolicyType.FillToParent; + pageActor.ParentOrigin = ParentOrigin.Center; + pageActor.PivotPoint = PivotPoint.Center; + pageActor.Position = new Position(pageColumn * windowSize.Width, pageRow * windowSize.Height, 0.0f); + + // Add images in a 3x4 grid layout for each page + int imageRows = 4; + int imageColumns = 3; + float margin = 10.0f; + Position imageSize = new Position((windowSize.Width / imageColumns) - margin, (windowSize.Height / imageRows) - margin, 0.0f); + + for(int row = 0; row < imageRows; row++) + { + for(int column = 0; column < imageColumns;column++) + { + int imageId = (row * imageColumns + column) % 2 + 1; + ImageView imageView = new ImageView(resources+"/images/image-" + imageId + ".jpg"); + imageView.ParentOrigin = ParentOrigin.Center; + imageView.PivotPoint = PivotPoint.Center; + imageView.Size2D = new Size2D((int)imageSize.X, (int)imageSize.Y); + imageView.Position = new Position( margin * 0.5f + (imageSize.X + margin) * column - windowSize.Width * 0.5f + imageSize.X * 0.5f, + margin * 0.5f + (imageSize.Y + margin) * row - windowSize.Height * 0.5f + imageSize.Y * 0.5f, 0.0f ); + pageActor.Add(imageView); + } + } + + _scrollView.Add(pageActor); + } + } + + _scrollView.SetAxisAutoLock(true); + + // Set scroll view to have 3 pages in X axis and allow page snapping, + // and also disable scrolling in Y axis. + PropertyMap rulerMap = new PropertyMap(); + rulerMap.Add((int)ScrollModeType.XAxisScrollEnabled, new PropertyValue(true)); + rulerMap.Add((int)ScrollModeType.XAxisSnapToInterval, new PropertyValue(windowSize.Width)); + rulerMap.Add((int)ScrollModeType.XAxisScrollBoundary, new PropertyValue(windowSize.Width * pageColumns ) ); + rulerMap.Add((int)ScrollModeType.YAxisScrollEnabled, new PropertyValue( false ) ); + _scrollView.ScrollMode = rulerMap; + + // Create a horizontal scroll bar in the bottom of scroll view (which is optional) + _scrollBar = new ScrollBar(ScrollBar.Direction.Horizontal); + _scrollBar.ParentOrigin = ParentOrigin.BottomLeft; + _scrollBar.PivotPoint = PivotPoint.TopLeft; + _scrollBar.WidthResizePolicy = ResizePolicyType.FitToChildren; + _scrollBar.HeightResizePolicy = ResizePolicyType.FillToParent; + _scrollBar.Orientation = new Rotation( new Radian( new Degree( 270.0f ) ), Vector3.ZAxis ); + _scrollView.Add(_scrollBar); + + // Connect to the OnRelayout signal + _scrollView.Relayout += OnScrollViewRelayout; + //_scrollView.Touched += OnTouch; + _scrollView.WheelEvent += Onwheel; + _scrollView.FocusGained += OnKey; + _text = new TextLabel("View Touch Event Handler Test"); + _text.ParentOrigin = ParentOrigin.Center; + _text.PivotPoint = PivotPoint.Center; + _text.HorizontalAlignment = HorizontalAlignment.Center; + _text.PointSize = 20.0f; + + _scrollView.Add(_text); + } + + // Callback for _animation finished signal handling + public void AnimationFinished(object sender, EventArgs e) + { + Tizen.Log.Debug("NUI", "Customized Animation Finished Event handler"); + } + private void OnKey(object source, EventArgs e) + { + Tizen.Log.Debug("NUI", "View Keyevent EVENT callback...."); + } + + private bool Onwheel(object source, View.WheelEventArgs e) + { + Tizen.Log.Debug("NUI", "View Wheel EVENT callback...."); + return true; + } + + private bool OnTouch(object source, View.TouchEventArgs e) + { + Tizen.Log.Debug("NUI", "View TOUCH EVENT callback...."); + + // Only animate the _text label when touch down happens + if( e.Touch.GetState(0) == PointStateType.Down ) + { + Tizen.Log.Debug("NUI", "Customized Window Touch event handler"); + // Create a new _animation + if( _animation ) + { + _animation.Reset(); + } + + _animation = new Animation(1); // 1 second of duration + + _animation.AnimateTo(_text, "Orientation", new Rotation( new Radian( new Degree( 180.0f ) ), Vector3.XAxis ), 0, 500); + _animation.AnimateTo(_text, "Orientation", new Rotation( new Radian( new Degree( 0.0f ) ), Vector3.XAxis ), 500, 1000); + + // Connect the signal callback for animaiton finished signal + _animation.Finished += AnimationFinished; + + // Play the _animation + _animation.Play(); + } + return true; + } + + private void OnScrollViewRelayout(object source, EventArgs e) + { + Tizen.Log.Debug("NUI", "View OnRelayoutEventArgs EVENT callback...."); + + // Set the correct scroll bar size after size negotiation of scroll view is done + _scrollBar.Size2D = new Size2D(0, (int)_scrollView.GetRelayoutSize(DimensionType.Width)); + } + + /// + /// The main entry point for the application. + /// + [STAThread] + static void _Main(string[] args) + { + Example example = new Example(); + example.Run(args); + } + } +} diff --git a/test/NUITestSample/NUITestSample/examples/sibling-order-test.cs b/test/NUITestSample/NUITestSample/examples/sibling-order-test.cs new file mode 100755 index 000000000..eaf9f699a --- /dev/null +++ b/test/NUITestSample/NUITestSample/examples/sibling-order-test.cs @@ -0,0 +1,195 @@ +// Copyright (c) 2017 Samsung Electronics Co., Ltd. +// +// 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.NUI; +using Tizen.NUI.UIComponents; +using Tizen.NUI.BaseComponents; +using System.Collections.Generic; + + +// 1) sibling order test +namespace SiblingOrderTest +{ + class Example : NUIApplication + { + public Example() : base() + { + } + + public Example(string stylesheet) : base(stylesheet) + { + } + + public Example(string stylesheet, WindowMode windowMode) : base(stylesheet, windowMode) + { + } + + protected override void OnCreate() + { + base.OnCreate(); + Initialize(); + } + + Window _window; + + public void Initialize() + { + _window = Window.Instance; + _window.BackgroundColor = Color.White; + + // sibling order test + // By default, the SiblingOrder is 0. + SiblingTest1(); + + // sibling order test + // Set the SiblingOrder 0 -> 9 + SiblingTest2(); + + // sibling order test + // Set the SiblingOrder 10 -> 1 + SiblingTest3(); + + // sibling order test + // Set the SiblingOrder 5 -> 1 & 0 -> 4 + SiblingTest4(); + + // sibling order test + // Set the SiblingOrder 0 -> 4 & 5 -> 1 + SiblingTest5(); + } + + public void SiblingTest1() + { + Position2D _myPos = new Position2D(100, 30); + + for (int i = 0; i < 10; i++) + { + PushButton _view = new PushButton(); + + _view.Name = "sibling" + i; + _view.LabelText = "view" + i; + _view.MinimumSize = new Size2D(100, 50); + _view.ParentOrigin = ParentOrigin.TopLeft; + _view.PivotPoint = PivotPoint.TopLeft; + _view.Position2D = _myPos + new Position2D(20 * i, 10 * i); + + _window.Add(_view); + } + } + + public void SiblingTest2() + { + Position2D _myPos = new Position2D(100, 180); + + for (int i = 0; i < 10; i++) + { + PushButton _view = new PushButton(); + + _view.Name = "sibling" + i; + _view.LabelText = "view" + i; + _view.MinimumSize = new Size2D(100, 50); + _view.ParentOrigin = ParentOrigin.TopLeft; + _view.PivotPoint = PivotPoint.TopLeft; + _view.Position2D = _myPos + new Position2D(20 * i, 10 * i); + + _window.Add(_view); + _view.SiblingOrder = i; + } + } + + public void SiblingTest3() + { + Position2D _myPos = new Position2D(100, 330); + + for (int i = 0; i < 10; i++) + { + PushButton _view = new PushButton(); + + _view.Name = "sibling" + i; + _view.LabelText = "view" + i; + _view.MinimumSize = new Size2D(100, 50); + _view.ParentOrigin = ParentOrigin.TopLeft; + _view.PivotPoint = PivotPoint.TopLeft; + _view.Position2D = _myPos + new Position2D(20 * i, 10 * i); + + _window.Add(_view); + _view.SiblingOrder = 10-i; + } + } + + public void SiblingTest4() + { + Position2D _myPos = new Position2D(100, 480); + + for (int i = 0; i < 10; i++) + { + PushButton _view = new PushButton(); + + _view.Name = "sibling" + i; + _view.LabelText = "view" + i; + _view.MinimumSize = new Size2D(100, 50); + _view.ParentOrigin = ParentOrigin.TopLeft; + _view.PivotPoint = PivotPoint.TopLeft; + _view.Position2D = _myPos + new Position2D(20 * i, 10 * i); + + _window.Add(_view); + + if (i<5) + { + _view.SiblingOrder = 5-i; + } + else + { + _view.SiblingOrder = i-5; + } + } + } + + public void SiblingTest5() + { + Position2D _myPos = new Position2D(100, 630); + + for (int i = 0; i < 10; i++) + { + PushButton _view = new PushButton(); + + _view.Name = "sibling" + i; + _view.LabelText = "view" + i; + _view.MinimumSize = new Size2D(100, 50); + _view.ParentOrigin = ParentOrigin.TopLeft; + _view.PivotPoint = PivotPoint.TopLeft; + _view.Position2D = _myPos + new Position2D(20 * i, 10 * i); + + _window.Add(_view); + + if (i<5) + { + _view.SiblingOrder = i; + } + else + { + _view.SiblingOrder = 10-i; + } + } + } + + static void _Main(string[] args) + { + Example example = new Example(); + example.Run(args); + } + } +} diff --git a/test/NUITestSample/NUITestSample/examples/svg-test.cs b/test/NUITestSample/NUITestSample/examples/svg-test.cs new file mode 100755 index 000000000..35aef4df7 --- /dev/null +++ b/test/NUITestSample/NUITestSample/examples/svg-test.cs @@ -0,0 +1,142 @@ +using Tizen.NUI; +using Tizen.NUI.BaseComponents; + +namespace SvgTest +{ + class Program : NUIApplication + { + protected override void OnCreate() + { + base.OnCreate(); + Initialize(); + } + + string test_url = "/home/owner/apps_rw/org.tizen.example.NUITemplate3/res/3.svg"; + + TextField[] textField = new TextField[5]; + ImageView[] imageView = new ImageView[10]; + int iSVGimage = 50, iSynchronous = 0, iTextColor = 0, iPointSize = 20, iPointSize2 = 20, mImageCombinationIndex = 0; + int resol = 1; + + void Initialize() + { + //NUILog.Debug("### SvgTest => OnCreate()!"); + + Window window = Window.Instance; + window.BackgroundColor = Color.White; + //NUILog.Debug($"### window.Dpi={window.Dpi}"); + + Vector2 dpi = new Vector2(); + dpi = window.Dpi; + //NUILog.Debug($"### window.Dpi x={dpi.X}, y={dpi.Y}"); + + textField[0] = new TextField(); + textField[0].Size2D = new Size2D(300 * resol, 64 * resol); + textField[0].Position2D = new Position2D(10 * resol, 600 * resol); + textField[0].PivotPoint = PivotPoint.TopLeft; + textField[0].BackgroundColor = Color.White; + textField[0].PointSize = iPointSize * resol; + textField[0].PlaceholderText = "imageview setsize X"; + textField[0].TextColor = Color.Red; + + textField[1] = new TextField(); + textField[1].Size2D = new Size2D(350 * resol, 64 * resol); + textField[1].Position2D = new Position2D(400 * resol, 600 * resol); + textField[1].PivotPoint = PivotPoint.TopLeft; + textField[1].BackgroundColor = Color.White; + textField[1].PointSize = iPointSize * resol; + textField[1].PlaceholderText = "imageview setsize 200,400"; + textField[1].TextColor = Color.Red; + + textField[2] = new TextField(); + textField[2].Size2D = new Size2D(350 * resol, 64 * resol); + textField[2].Position2D = new Position2D(750 * resol, 600 * resol); + textField[2].PivotPoint = PivotPoint.TopLeft; + textField[2].BackgroundColor = Color.White; + textField[2].PointSize = iPointSize * resol; + textField[2].PlaceholderText = "imageview setsize 300,300"; + textField[2].TextColor = Color.Red; + + textField[3] = new TextField(); + textField[3].Size2D = new Size2D(350 * resol, 64 * resol); + textField[3].Position2D = new Position2D(1100 * resol, 600 * resol); + textField[3].PivotPoint = PivotPoint.TopLeft; + textField[3].BackgroundColor = Color.White; + textField[3].PointSize = iPointSize * resol; + textField[3].PlaceholderText = "imageview setsize 500,500"; + textField[3].TextColor = Color.Red; + + window.Add(textField[0]); + window.Add(textField[1]); + window.Add(textField[2]); + window.Add(textField[3]); + + PropertyMap map0 = new PropertyMap(); + map0.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.Image)); + string test_url0 = "/home/owner/apps_rw/org.tizen.example.NUITemplate3/res/images/test-image.png"; + map0.Add(ImageVisualProperty.URL, new PropertyValue(test_url0)); + map0.Add(ImageVisualProperty.CropToMask + 3, new PropertyValue(true)); + imageView[0] = new ImageView(); + imageView[0].Position2D = new Position2D(10 * resol, 20 * resol); + imageView[0].PivotPoint = PivotPoint.TopLeft; + imageView[0].ParentOrigin = ParentOrigin.TopLeft; + imageView[0].ImageMap = map0; + imageView[0].BackgroundColor = Color.Black; + window.Add(imageView[0]); + + return; + + PropertyMap map1 = new PropertyMap(); + map1.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.SVG)); + //map1.Add(ImageVisualProperty.URL, new PropertyValue(IMAGE_PATH[iSVGimage])); + map1.Add(ImageVisualProperty.URL, new PropertyValue(test_url)); + map1.Add((int)Visual.Property.MixColor, new PropertyValue(new Color(0.7f, 0.0f, 0.0f, 1.0f))); + imageView[1] = new ImageView(); + imageView[1].Size2D = new Size2D(200 * resol, 400 * resol); + imageView[1].Position2D = new Position2D(400 * resol, 20 * resol); + imageView[1].PivotPoint = PivotPoint.TopLeft; + imageView[1].ParentOrigin = ParentOrigin.TopLeft; + //imageView[1].Image = map1; + imageView[1].BackgroundColor = Color.Black; + // ConnectSignal(imageView[1]); + + PropertyMap map2 = new PropertyMap(); + map2.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.SVG)); + //map2.Add(ImageVisualProperty.URL, new PropertyValue(IMAGE_PATH[iSVGimage])); + map2.Add(ImageVisualProperty.URL, new PropertyValue(test_url)); + imageView[2] = new ImageView(); + imageView[2].Size2D = new Size2D(300 * resol, 300 * resol); + imageView[2].Position2D = new Position2D(700 * resol, 20 * resol); + imageView[2].PivotPoint = PivotPoint.TopLeft; + imageView[2].ParentOrigin = ParentOrigin.TopLeft; + //imageView[2].Image = map2; + imageView[2].BackgroundColor = Color.Black; + // ConnectSignal(imageView[2]); + + PropertyMap map3 = new PropertyMap(); + map3.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.SVG)); + //map3.Add(ImageVisualProperty.URL, new PropertyValue(IMAGE_PATH[iSVGimage])); + map3.Add(ImageVisualProperty.URL, new PropertyValue(test_url)); + imageView[3] = new ImageView(); + imageView[3].Size2D = new Size2D(500 * resol, 500 * resol); + imageView[3].Position2D = new Position2D(1100 * resol, 20 * resol); + imageView[3].PivotPoint = PivotPoint.TopLeft; + imageView[3].ParentOrigin = ParentOrigin.TopLeft; + //imageView[3].Image = map3; + imageView[3].BackgroundColor = Color.Black; + // ConnectSignal(imageView[3]); + + + + window.Add(imageView[1]); + window.Add(imageView[2]); + window.Add(imageView[3]); + } + + static void _Main(string[] args) + { + var app = new Program(); + app.Run(args); + } + } +} diff --git a/test/NUITestSample/NUITestSample/examples/test1.cs b/test/NUITestSample/NUITestSample/examples/test1.cs new file mode 100755 index 000000000..af8b48c16 --- /dev/null +++ b/test/NUITestSample/NUITestSample/examples/test1.cs @@ -0,0 +1,317 @@ +// Copyright (c) 2017 Samsung Electronics Co., Ltd. +// +// 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.NUI; +using Tizen.NUI.UIComponents; +using Tizen.NUI.BaseComponents; +using System.Collections.Generic; + + +// 1) sibling order test +namespace Test1 +{ + class Example : NUIApplication + { + public Example() : base() + { + } + + public Example(string stylesheet) : base(stylesheet) + { + } + + public Example(string stylesheet, WindowMode windowMode) : base(stylesheet, windowMode) + { + } + + protected override void OnCreate() + { + base.OnCreate(); + Initialize(); + } + + Window _window; + StyleManager _style; + + public void Initialize() + { + _window = Window.Instance; + _window.BackgroundColor = Color.White; + + // 1) sibling order test + SiblingTest(); + // 2) text visual test + dali_VisualBase_Creation_test(); + + // 3) visual creation test + VisualTest2(); + + _style = StyleManager.Get(); + //_style.StyleChanged += _style_StyleChanged; + _style.StyleChanged += (obj, e) => + { + Tizen.Log.Debug("NUI", "in stylechanged.. C#side..\n"); + //flag = true; + }; + + _style.ApplyTheme("/home/owner/apps_rw/NUISamples.TizenTV/res/json/date-picker-theme.json"); + Tizen.Log.Debug("NUI", "#### 1) first change!"); + + + AnimatePath_1(); + } + + private void _style_StyleChanged(object sender, StyleManager.StyleChangedEventArgs e) + { + Tizen.Log.Debug("NUI", "style changed event handler comes"); + } + + public void SiblingTest() + { + View _prev = null; + Position2D _myPos = new Position2D(100, 100); + List list_view = new List(); + TextLabel _txt = new TextLabel(); + + for (int i = 0; i < 10; i++) + { + View _view0 = new PushButton(); + PushButton _view = _view0 as PushButton; + + _view.Name = "sibling" + i; + _view.MinimumSize = new Size2D(100, 50); + _view.LabelText = "sibling" + i; + _view.ParentOrigin = ParentOrigin.TopLeft; + _view.PivotPoint = PivotPoint.TopLeft; + _view.Position2D = _myPos + new Position2D(20 * i, 10 * i); + _view.Clicked += (sender, ee) => + { + View curr = sender as View; + Tizen.Log.Debug("NUI", "clicked curr view name=" + curr.Name + " sibling=" + curr.SiblingOrder); + curr.RaiseToTop(); + if (_prev) + { + _prev.LowerToBottom(); + Tizen.Log.Debug("NUI", "raise on top is called!curr sibling=" + curr.SiblingOrder + " prev name=" + _prev.Name + " sibling=" + _prev.SiblingOrder); + } + _prev = curr; + _txt.Text = "on top: " + curr.Name + ", sibling order=" + curr.SiblingOrder; + + _style.ApplyTheme("/home/owner/apps_rw/NUISamples.TizenTV/res/json/style-example-theme-one.json"); + Tizen.Log.Debug("NUI", "#### 2) second change!"); + + return true; + }; + list_view.Add(_view); + } + + for (int i = 0; i < 10; i++) + { + _window.Add(list_view[i]); + Tizen.Log.Debug("NUI", list_view[i].Name + "'s sibling order=" + list_view[i].SiblingOrder); + } + + _txt.ParentOrigin = ParentOrigin.TopLeft; + _txt.PivotPoint = PivotPoint.TopLeft; + _txt.Text = "on top: sibling#, sibling order=?"; + _txt.Position2D = _myPos + new Position2D(-50, 200); + _txt.TextColor = Color.Blue; + _window.Add(_txt); + + } + + public class VisualTest : CustomView + { + private int TextVisualPropertyIndex = -1; + private VisualBase _textVisual; + private string _string; + + public VisualTest() : base(typeof(VisualTest).Name, CustomViewBehaviour.RequiresKeyboardNavigationSupport) + { + } + public string TextVisual + { + get + { + return _string; + } + set + { + _string = value; + + TextVisualPropertyIndex = RegisterProperty("textvisualtest", new PropertyValue("textvisualtest"), PropertyAccessMode.ReadWrite); + + PropertyMap textVisual = new PropertyMap(); + textVisual.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.Text)) + .Add(TextVisualProperty.Text, new PropertyValue(_string)) + .Add(TextVisualProperty.TextColor, new PropertyValue(Color.Blue)) + .Add(TextVisualProperty.PointSize, new PropertyValue(10)) + .Add(TextVisualProperty.HorizontalAlignment, new PropertyValue("CENTER")) + .Add(TextVisualProperty.VerticalAlignment, new PropertyValue("CENTER")); + _textVisual = VisualFactory.Instance.CreateVisual(textVisual); + RegisterVisual(TextVisualPropertyIndex, _textVisual); + _textVisual.DepthIndex = TextVisualPropertyIndex; + } + } + } + + //when use belowing testcase, Time is out and this case is BLOCK + public void dali_VisualBase_Creation_test() + { + try + { + Tizen.Log.Debug("NUI", "##### start! ######"); + + VisualTest _visualTest = new VisualTest(); + _visualTest.TextVisual = "Hello NUI Text Visual!"; + _visualTest.ParentOrigin = ParentOrigin.TopLeft; + _visualTest.PivotPoint = PivotPoint.TopLeft; + _visualTest.Size2D = new Size2D(600, 200); + _visualTest.Position2D = new Position2D(50, 400); + _visualTest.BackgroundColor = Color.Yellow; + _window.Add(_visualTest); + } + catch (Exception e) + { + Tizen.Log.Error("NUI", "##### Caught Exception" + e.ToString()); + throw new System.InvalidOperationException("visual test error!!!"); + } + } + + public void VisualTest2() + { + try + { + Tizen.Log.Debug("NUI", "##### VisualTest2() start! ######"); + + VisualFactory visualfactory = VisualFactory.Instance; + PropertyMap textMap1 = new PropertyMap(); + textMap1.Insert(Visual.Property.Type, new PropertyValue((int)Visual.Type.Text)); + textMap1.Insert(TextVisualProperty.Text, new PropertyValue("Hello")); + textMap1.Insert(TextVisualProperty.PointSize, new PropertyValue(10.0f)); + + PropertyMap textMap2 = new PropertyMap(); + VisualBase textVisual1 = visualfactory.CreateVisual(textMap1); + //textVisual1.Creation = textMap2; + } + catch (Exception e) + { + Tizen.Log.Error("NUI", "Caught Exception" + e.ToString()); + throw new System.InvalidOperationException("visual test2 error!!!"); + //LogUtils.Write(LogUtils.DEBUG, LogUtils.TAG, "Caught Exception" + e.ToString()); + //Assert.IsTrue(e is ArgumentException, "Argument Exception Not Recieved"); + } + } + + //[Property("AUTHOR", "Feng Jin, feng16.jin@samsung.com")] + public void AnimatePath_1() + { + Tizen.Log.Debug("NUI", "#### 1) animate path test !"); + /* TEST CODE */ + View view = new View(); + view.ParentOrigin = ParentOrigin.TopLeft; + view.PivotPoint = PivotPoint.TopLeft; + view.MinimumSize = new Size2D(100, 100); + view.BackgroundColor = Color.Red; + _window.Add(view); + + Position position0 = new Position(200.0f, 200.0f, 0.0f); + Position position1 = new Position(300.0f, 300.0f, 0.0f); + Position position2 = new Position(400.0f, 400.0f, 0.0f); + + Path path = new Path(); + path.AddPoint(position0); + path.AddPoint(position1); + path.AddPoint(position2); + //Control points for first segment + path.AddControlPoint(new Vector3(39.0f, 90.0f, 0.0f)); + path.AddControlPoint(new Vector3(56.0f, 119.0f, 0.0f)); + //Control points for second segment + path.AddControlPoint(new Vector3(78.0f, 120.0f, 0.0f)); + path.AddControlPoint(new Vector3(93.0f, 104.0f, 0.0f)); + + Animation animation = new Animation(); + animation.AnimatePath(view, path, Vector3.XAxis, 0, 5000, new AlphaFunction(AlphaFunction.BuiltinFunctions.Linear)); + animation.Play(); + Vector3 position = new Vector3(); + Vector3 tangent = new Vector3(); + + path.Sample(0.0f, position, tangent); + Rotation rotation = new Rotation(new Radian(new Degree(0.0f)), tangent); + Tizen.Log.Debug("NUI", "################ progress = 0! "); + Tizen.Log.Debug("NUI", "position=(" + position.X + "," + position.Y + "," + position.Z + ")"); + Tizen.Log.Debug("NUI", "view position=(" + view.Position.X + "," + view.Position.Y + "," + view.Position.Z + ")"); + Tizen.Log.Debug("NUI", "view position=(" + view.PositionX + "," + view.PositionY + "," + view.PositionZ + ")"); + Tizen.Log.Debug("NUI", "view cur position=(" + view.CurrentPosition.X + "," + view.CurrentPosition.Y + "," + view.CurrentPosition.Z + ")"); + Tizen.Log.Debug("NUI", "tangent=(" + tangent.X + "," + tangent.Y + "," + tangent.Z + ")"); + Tizen.Log.Debug("NUI", "angle between=" + Rotation.AngleBetween(view.Orientation, rotation) + " view orientation length=" + view.Orientation.Length() + " rotation length=" + rotation.Length()); + //Assert.AreEqual(position.X, view.PositionX, "The actor's PositionX of is not correct"); + //Assert.AreEqual(position.Y, actor.PositionY, "The actor's PositionY of is not correct"); + //Assert.AreEqual(position.Z, actor.PositionZ, "The actor's PositionZ of is not correct"); + //Assert.IsTrue(rotation.Equals(actor.Orientation)); + //await Task.Delay(250); + path.Sample(0.25f, position, tangent); + rotation = new Rotation(new Radian(new Degree(0.0f)), tangent); + Tizen.Log.Debug("NUI", "################ progress = 0.25! "); + Tizen.Log.Debug("NUI", "position=(" + position.X + "," + position.Y + "," + position.Z + ")"); + Tizen.Log.Debug("NUI", "view position=(" + view.Position.X + "," + view.Position.Y + "," + view.Position.Z + ")"); + Tizen.Log.Debug("NUI", "view position=(" + view.PositionX + "," + view.PositionY + "," + view.PositionZ + ")"); + Tizen.Log.Debug("NUI", "view cur position=(" + view.CurrentPosition.X + "," + view.CurrentPosition.Y + "," + view.CurrentPosition.Z + ")"); + Tizen.Log.Debug("NUI", "tangent=(" + tangent.X + "," + tangent.Y + "," + tangent.Z + ")"); + Tizen.Log.Debug("NUI", "angle between=" + Rotation.AngleBetween(view.Orientation, rotation) + " view orientation length=" + view.Orientation.Length() + " rotation length=" + rotation.Length()); + //Assert.AreEqual(position.X, actor.PositionX, "The PositionX of actor is not correct"); + //Assert.AreEqual(position.Y, actor.PositionY, "The PositionY of actor is not correct"); + //Assert.AreEqual(position.Z, actor.PositionZ, "The PositionZ of actor is not correct"); + //Assert.IsTrue(rotation.Equals(actor.Orientation)); + //await Task.Delay(500); + path.Sample(0.75f, position, tangent); + rotation = new Rotation(new Radian(new Degree(0.0f)), tangent); + Tizen.Log.Debug("NUI", "################ progress = 0.75! "); + Tizen.Log.Debug("NUI", "position=(" + position.X + "," + position.Y + "," + position.Z + ")"); + Tizen.Log.Debug("NUI", "view position=(" + view.Position.X + "," + view.Position.Y + "," + view.Position.Z + ")"); + Tizen.Log.Debug("NUI", "view position=(" + view.PositionX + "," + view.PositionY + "," + view.PositionZ + ")"); + Tizen.Log.Debug("NUI", "view cur position=(" + view.CurrentPosition.X + "," + view.CurrentPosition.Y + "," + view.CurrentPosition.Z + ")"); + Tizen.Log.Debug("NUI", "tangent=(" + tangent.X + "," + tangent.Y + "," + tangent.Z + ")"); + Tizen.Log.Debug("NUI", "angle between=" + Rotation.AngleBetween(view.Orientation, rotation) + " view orientation length=" + view.Orientation.Length() + " rotation length=" + rotation.Length()); + //Assert.AreEqual(position.X, actor.PositionX, "The PositionX of actor is not correct here"); + //Assert.AreEqual(position.Y, actor.PositionY, "The PositionY of actor is not correct here"); + //Assert.AreEqual(position.Z, actor.PositionZ, "The PositionZ of actor is not correct here"); + //Assert.IsTrue(rotation.Equals(actor.Orientation)); + + path.Sample(1.0f, position, tangent); + rotation = new Rotation(new Radian(new Degree(0.0f)), tangent); + Tizen.Log.Debug("NUI", "################ progress = 1.0! "); + Tizen.Log.Debug("NUI", "position=(" + position.X + "," + position.Y + "," + position.Z + ")"); + Tizen.Log.Debug("NUI", "view position=(" + view.Position.X + "," + view.Position.Y + "," + view.Position.Z + ")"); + Tizen.Log.Debug("NUI", "view position=(" + view.PositionX + "," + view.PositionY + "," + view.PositionZ + ")"); + Tizen.Log.Debug("NUI", "view cur position=(" + view.CurrentPosition.X + "," + view.CurrentPosition.Y + "," + view.CurrentPosition.Z + ")"); + Tizen.Log.Debug("NUI", "tangent=(" + tangent.X + "," + tangent.Y + "," + tangent.Z + ")"); + Tizen.Log.Debug("NUI", "angle between=" + Rotation.AngleBetween(view.Orientation, rotation) + " view orientation length=" + view.Orientation.Length() + " rotation length=" + rotation.Length()); + + + Tizen.Log.Debug("NUI", "#### 2) animate path test end!"); + } + + + + + static void _Main(string[] args) + { + Example example = new Example(); + example.Run(args); + } + } +} diff --git a/test/NUITestSample/NUITestSample/examples/text-test.cs b/test/NUITestSample/NUITestSample/examples/text-test.cs new file mode 100755 index 000000000..11bc56a8f --- /dev/null +++ b/test/NUITestSample/NUITestSample/examples/text-test.cs @@ -0,0 +1,177 @@ +/* +* Copyright (c) 2017 Samsung Electronics Co., Ltd. +* +* 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; +using Tizen.NUI; +using Tizen.NUI.UIComponents; +using Tizen.NUI.BaseComponents; +using Tizen.NUI.Constants; + +namespace TextTest +{ + class Example : NUIApplication + { + TextLabel _pointLabel; + Boolean _colorToggle; + + public Example() : base() + { + } + + public Example(string stylesheet) : base(stylesheet) + { + } + + public Example(string stylesheet, WindowMode windowMode) : base(stylesheet, windowMode) + { + } + + protected override void OnCreate() + { + base.OnCreate(); + Initialize(); + } + + private bool LabelTouched(object sender, View.TouchEventArgs e) + { + if (e.Touch.GetState(0) == PointStateType.Down) + { + Animation textColorAnimation = new Animation(1000); + if (_colorToggle) + { + textColorAnimation.AnimateTo(_pointLabel, "TextColorAnimatable", Color.Blue ); + _colorToggle = false; + } + else + { + textColorAnimation.AnimateTo(_pointLabel, "TextColorAnimatable", Color.Green ); + _colorToggle = true; + } + textColorAnimation.Play(); + } + return true; + } + + + public void Initialize() + { + Window window = Window.Instance; + window.BackgroundColor = Color.White; + + TextLabel pixelLabel = new TextLabel("Test Pixel Size 32.0f"); + pixelLabel.Position2D = new Position2D(10, 10); + pixelLabel.PixelSize = 32.0f; + pixelLabel.BackgroundColor = Color.Magenta; + window.Add(pixelLabel); + + _pointLabel = new TextLabel("Test Point Size 32.0f"); + _pointLabel.Position2D = new Position2D(10, 100); + _pointLabel.PointSize = 32.0f; + _pointLabel.BackgroundColor = Color.Red; + //_pointLabel.TextColorAnimatable = Color.Green; // Set initial text color using animatable property + _pointLabel.TouchEvent += LabelTouched; + _colorToggle = true; + + window.Add(_pointLabel); + + + TextLabel ellipsis = new TextLabel("Ellipsis of TextLabel is enabled."); + ellipsis.Size2D = new Size2D(100, 80); + ellipsis.Position2D = new Position2D(10, 200); + ellipsis.PointSize = 20.0f; + ellipsis.Ellipsis = true; + ellipsis.BackgroundColor = Color.Cyan; + window.Add(ellipsis); + + TextLabel autoScrollStopMode = new TextLabel("AutoScrollStopMode is finish-loop."); + autoScrollStopMode.Size2D = new Size2D(400, 50); + autoScrollStopMode.Position2D = new Position2D(10, 300); + autoScrollStopMode.PointSize = 15.0f; + autoScrollStopMode.BackgroundColor = Color.Green; + autoScrollStopMode.AutoScrollStopMode = AutoScrollStopMode.FinishLoop; + autoScrollStopMode.EnableAutoScroll = true; + window.Add(autoScrollStopMode); + + TextField field = new TextField(); + field.Size2D = new Size2D(400, 100); + field.Position2D = new Position2D(10, 400); + field.BackgroundColor = Color.Cyan; + field.PlaceholderText = "input someth..."; + field.PlaceholderTextFocused = "input someth... focused"; + field.Focusable = true; + PropertyMap hiddenMap = new PropertyMap(); + hiddenMap.Add(HiddenInputProperty.Mode, new PropertyValue((int)HiddenInputModeType.ShowLastCharacter)); + hiddenMap.Add(HiddenInputProperty.ShowLastCharacterDuration, new PropertyValue(2)); + hiddenMap.Add(HiddenInputProperty.SubstituteCount, new PropertyValue(4)); + hiddenMap.Add(HiddenInputProperty.SubstituteCharacter, new PropertyValue(0x23)); + field.HiddenInputSettings = hiddenMap; + field.EnableSelection = true; + window.Add(field); + + InputMethod inputMethod = new InputMethod(); + inputMethod.PanelLayout = InputMethod.PanelLayoutType.Number; + inputMethod.ActionButton = InputMethod.ActionButtonTitleType.Go; + inputMethod.AutoCapital = InputMethod.AutoCapitalType.Word; + inputMethod.Variation = 1; + + field.InputMethodSettings = inputMethod.OutputMap; + + PropertyMap propertyMap = new PropertyMap(); + propertyMap.Add("placeholderText", new PropertyValue("Placeholder Text")); + propertyMap.Add("placeholderTextFocused", new PropertyValue("Placeholder Text Focused")); + propertyMap.Add("placeholderColor", new PropertyValue(Color.Red)); + propertyMap.Add("placeholderPointSize", new PropertyValue(15.0f)); + + PropertyMap fontStyleMap = new PropertyMap(); + fontStyleMap.Add("weight", new PropertyValue("bold")); + fontStyleMap.Add("width", new PropertyValue("condensed")); + fontStyleMap.Add("slant", new PropertyValue("italic")); + propertyMap.Add("placeholderFontStyle", new PropertyValue(fontStyleMap)); + + TextEditor editor = new TextEditor(); + editor.Size2D = new Size2D(400, 100); + editor.Position2D = new Position2D(10, 550); + editor.BackgroundColor = Color.Magenta; + editor.EnableScrollBar = true; + editor.EnableSelection = true; + editor.Focusable = true; + editor.Placeholder = propertyMap; + window.Add(editor); + editor.TextChanged += (obj, e) => { + Tizen.Log.Debug("NUI", "editor line count: " + e.TextEditor.LineCount); + }; + + editor.ScrollStateChanged += (obj, e)=> { + Tizen.Log.Debug("NUI", "editor scroll state:" + e.ScrollState); + }; + + Tizen.Log.Debug("NUI", "editor id: " + editor.ID); + + FocusManager.Instance.SetCurrentFocusView(editor); + editor.UpFocusableView = field; + field.DownFocusableView = editor; + } + + [STAThread] + static void _Main(string[] args) + { + Example example = new Example(); + example.Run(args); + } + } +} diff --git a/test/NUITestSample/NUITestSample/examples/text-test2.cs b/test/NUITestSample/NUITestSample/examples/text-test2.cs new file mode 100755 index 000000000..023dd726c --- /dev/null +++ b/test/NUITestSample/NUITestSample/examples/text-test2.cs @@ -0,0 +1,225 @@ +/* +* Copyright (c) 2017 Samsung Electronics Co., Ltd. +* +* 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; +using Tizen.NUI; +using Tizen.NUI.UIComponents; +using Tizen.NUI.BaseComponents; +using Tizen.NUI.Constants; + +namespace TextTest2 +{ + class Example : NUIApplication + { + public Example() : base() + { + } + + public Example(string stylesheet) : base(stylesheet) + { + } + + public Example(string stylesheet, WindowMode windowMode) : base(stylesheet, windowMode) + { + } + + protected override void OnCreate() + { + base.OnCreate(); + Initialize(); + } + + private PushButton button; + private TextEditor editor; + private ImfManager imfManager; + + + public void Initialize() + { + Window window = Window.Instance; + window.BackgroundColor = Color.White; + + PropertyMap propertyMap = new PropertyMap(); + propertyMap.Add("placeholderText", new PropertyValue("TextEditor Placeholder Text")); + propertyMap.Add("placeholderColor", new PropertyValue(Color.Red)); + propertyMap.Add("placeholderPointSize", new PropertyValue(12.0f)); + + PropertyMap fontStyleMap = new PropertyMap(); + fontStyleMap.Add("weight", new PropertyValue("bold")); + fontStyleMap.Add("width", new PropertyValue("condensed")); + fontStyleMap.Add("slant", new PropertyValue("italic")); + propertyMap.Add("placeholderFontStyle", new PropertyValue(fontStyleMap)); + + + editor = new TextEditor() + { + Size2D = new Size2D(500, 300), + Position2D = new Position2D(10, 550), + BackgroundColor = Color.Magenta, + Focusable = true, + Placeholder = propertyMap + }; + + window.Add(editor); + + editor.TextChanged += (obj, e) => + { + Tizen.Log.Fatal("NUI", "editor line count: " + e.TextEditor.LineCount); + }; + + editor.ScrollStateChanged += (obj, e) => + { + Tizen.Log.Fatal("NUI", "editor scroll state:" + e.ScrollState); + }; + + editor.KeyEvent += OnKeyEvent; + + + Tizen.Log.Debug("NUI", "editor id: " + editor.ID); + + imfManager = ImfManager.Get(); + imfManager.AutoEnableInputPanel(false); + imfManager.SetInputPanelUserData("layouttype = 1 & entrylimit = 255 & action = clearall_for_voice_commit & caller = org.volt.search - all"); + + + // send privatecommand event + ImfManager.ImfEventData imfevent = new ImfManager.ImfEventData(ImfManager.ImfEvent.PrivateCommand, "", 0, 0); + //imfManager.EventReceived += ImfManager_ImfManagerEventReceived; + + //imfManager.LanguageChanged += ImfManager_LanguageChanged; + + //imfManager.Activated += (obj, e) => + //{ + // Tizen.Log.Debug("NUI", "ImfManager Activated !!!!!"); + //}; + //imfManager.StatusChanged += (obj, e) => { + // Tizen.Log.Debug("NUI", "ImfManager StatusChanged: !!!!!" + e.StatusChanged); + //}; + //imfManager.Resized += (obj, e) => + //{ + // Tizen.Log.Debug("NUI", "ImfManager Resized !!!!!"); + //}; + //imfManager.KeyboardTypeChanged += (obj, e) => { + // Tizen.Log.Debug("NUI", "ImfManager KeyboardTypeChanged: !!!!!" + e.KeyboardType); + //}; + + button = new PushButton() + { + LabelText = "Button", + Size2D = new Size2D(400, 200), + Position2D = new Position2D(10, -10), + ParentOrigin = ParentOrigin.BottomLeft, + PivotPoint = PivotPoint.BottomLeft, + PositionUsesPivotPoint = true, + Focusable = true + }; + + window.Add(button); + + button.UpFocusableView = editor; + editor.DownFocusableView = button; + + FocusManager.Instance.SetCurrentFocusView(button); + } + + private bool OnKeyEvent(object source, View.KeyEventArgs e) + { + Tizen.Log.Debug("NUI", "KeyEvent called !!!!!"); + if (e.Key.State != Key.StateType.Down || editor.Focusable == false) + { + Tizen.Log.Debug("NUI", "KeyEvent ignored !!!!!"); + return false; + } + switch (e.Key.KeyPressedName) + { + case "Return": + Tizen.Log.Debug("NUI", "KeyPressedName: Return !!!!!"); + ShowImf(); + return true; + case "Select": + Tizen.Log.Debug("NUI", "KeyPressedName: Select !!!!!"); + HideImf(); + return true; + case "Cancel": + Tizen.Log.Debug("NUI", "KeyPressedName: Cancel !!!!!"); + HideImf(); + return true; + case "Down": + Tizen.Log.Debug("NUI", "KeyPressedName: Down !!!!!"); + HideImf(); + return MoveFocusTo(button); + } + return false; + } + + private void ShowImf() + { + imfManager.Activate(); + imfManager.ShowInputPanel(); + Tizen.Log.Debug("NUI", "IME showed !!!!!"); + } + + private bool MoveFocusTo(View view) + { + if (view == null) return false; + return FocusManager.Instance.SetCurrentFocusView(view); + } + + private void HideImf() + { + imfManager.Deactivate(); + imfManager.HideInputPanel(); + Tizen.Log.Debug("NUI", "IME hided !!!!!"); + } + + //public ImfManager.ImfCallbackData ImfManager_ImfManagerEventReceived(object sender, ImfManager.EventReceivedEventArgs e) + //{ + // Tizen.Log.Debug("NUI", "ImfManager_ImfManagerEventReceived()!"); + + // Tizen.Log.Debug("NUI", "e.ImfEventData.PredictiveString= " + e?.ImfEventData?.PredictiveString); + // Tizen.Log.Debug("NUI", "e.ImfEventData.CursorOffset= " + e?.ImfEventData?.CursorOffset); + // Tizen.Log.Debug("NUI", "e.ImfEventData.EventName= " + e?.ImfEventData?.EventName); + // Tizen.Log.Debug("NUI", "e.ImfEventData.NumberOfChars= " + e?.ImfEventData?.NumberOfChars); + + // //Be able to compare VD specific private command with ImfEventData.predictiveString + // if (e.ImfEventData.PredictiveString == "IME_F31") + // { + // ImfManager.Get().Deactivate(); + // ImfManager.Get().HideInputPanel(); + // // Do Something the user wants + // Tizen.Log.Debug("NUI", "ImfManager ImfEventData.PredictiveString: IME_F31!!!"); + // } + // ImfManager.ImfCallbackData callbackData = new ImfManager.ImfCallbackData(true, 0, e.ImfEventData.PredictiveString, false); + // Tizen.Log.Debug("NUI", "ImfManager return callbackData!!!"); + // return callbackData; + //} + + public void ImfManager_LanguageChanged(object sender, EventArgs args) + { + Tizen.Log.Debug("NUI", "ImfManager LanguageChanged!!!"); + return; + } + + [STAThread] + static void _Main(string[] args) + { + Example example = new Example(); + example.Run(args); + } + } +} diff --git a/test/NUITestSample/NUITestSample/examples/timer-test.cs b/test/NUITestSample/NUITestSample/examples/timer-test.cs new file mode 100755 index 000000000..6b408e7a5 --- /dev/null +++ b/test/NUITestSample/NUITestSample/examples/timer-test.cs @@ -0,0 +1,112 @@ +using System; +using Tizen.NUI; +using Tizen.NUI.BaseComponents; +using Tizen.NUI.UIComponents; +using Tizen.NUI.Constants; + +namespace TimerTest +{ + // An example of Visual View control. + class Example : NUIApplication + { + private static int i = 0; + + public Example() : base() + { + } + + protected override void OnCreate() + { + base.OnCreate(); + Initialize(); + } + + public void Initialize() + { + Window window = Window.Instance; + window.BackgroundColor = Color.White; + + TextLabel label = new TextLabel() + { + Text = "Steps: 0", + Size2D = new Size2D(460, 80), + Position2D = new Position2D(10, 10) + }; + + RadioButton radio1 = new RadioButton() + { + LabelText = "Set interval 500", + Size2D = new Size2D(300, 50), + Position2D = new Position2D(10, 100), + }; + RadioButton radio2 = new RadioButton() + { + LabelText = "Set interval 1000", + Size2D = new Size2D(300, 50), + Position2D = new Position2D(10, 160), + Selected = true + }; + RadioButton radio3 = new RadioButton() + { + LabelText = "Set interval 3000", + Size2D = new Size2D(300, 50), + Position2D = new Position2D(10, 220), + }; + + PushButton button1 = new PushButton() + { + LabelText = "Start", + Size2D = new Size2D(100, 50), + Position2D = new Position2D(10, 300), + Focusable = true + }; + + PushButton button2 = new PushButton() + { + LabelText = "Stop", + Size2D = new Size2D(100, 50), + Position2D = new Position2D(140, 300), + Focusable = true + }; + + window.Add(label); + window.Add(radio1); + window.Add(radio2); + window.Add(radio3); + window.Add(button1); + window.Add(button2); + + FocusManager.Instance.SetCurrentFocusView(button1); + button1.LeftFocusableView = button1.RightFocusableView = button2; + button2.RightFocusableView = button2.LeftFocusableView = button1; + button1.UpFocusableView = button2.UpFocusableView = radio3; + radio3.UpFocusableView = radio2; + radio2.UpFocusableView = radio1; + radio1.DownFocusableView = radio2; + radio2.DownFocusableView = radio3; + radio3.DownFocusableView = button1; + + Timer timer = new Timer(1000); + timer.Tick += (obj, e) => + { + Tizen.Log.Fatal("NUI", "NUI Timer tick called!"); + label.Text = "Steps: " + (i++); + return true; + }; + + button1.Clicked += (obj, e) => + { + if (radio1.Selected == true) timer.Interval = 500; + if (radio2.Selected == true) timer.Interval = 1000; + if (radio3.Selected == true) timer.Interval = 3000; + timer.Start(); + return true; + }; + button2.Clicked += (obj, e) => + { + timer.Stop(); + return true; + }; + } + } +} diff --git a/test/NUITestSample/NUITestSample/examples/ttsplayer-test.cs b/test/NUITestSample/NUITestSample/examples/ttsplayer-test.cs new file mode 100755 index 000000000..e0807ce35 --- /dev/null +++ b/test/NUITestSample/NUITestSample/examples/ttsplayer-test.cs @@ -0,0 +1,68 @@ +/* +* Copyright (c) 2017 Samsung Electronics Co., Ltd. +* +* 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.NUI; + +namespace TTSPlayerTest +{ + class Example : NUIApplication + { + public Example() : base() + { + } + + public Example(string stylesheet) : base(stylesheet) + { + } + + public Example(string stylesheet, WindowMode windowMode) : base(stylesheet, windowMode) + { + } + + protected override void OnCreate() + { + base.OnCreate(); + Initialize(); + } + + public void Initialize() + { + Window window = Window.Instance; + window.BackgroundColor = Color.White; + + TTSPlayer ttsPlayer = TTSPlayer.Get(TTSPlayer.TTSMode.Default); + ttsPlayer.Play("tts player test"); + + ttsPlayer.StateChanged += (s, e) => + { + Tizen.Log.Debug("NUI", "TTS state changed!!!"); + }; + ttsPlayer.Pause(); + ttsPlayer.Resume(); + ttsPlayer.Stop(); + Tizen.Log.Debug("NUI", "TTS state: " + ttsPlayer.GetState()); + } + + [STAThread] + static void _Main(string[] args) + { + Example example = new Example(); + example.Run(args); + } + } +} diff --git a/test/NUITestSample/NUITestSample/examples/user-alphafunction.cs b/test/NUITestSample/NUITestSample/examples/user-alphafunction.cs new file mode 100755 index 000000000..f805af021 --- /dev/null +++ b/test/NUITestSample/NUITestSample/examples/user-alphafunction.cs @@ -0,0 +1,203 @@ +/* +* Copyright (c) 2017 Samsung Electronics Co., Ltd. +* +* 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; +using Tizen.NUI; +using Tizen.NUI.UIComponents; +using Tizen.NUI.BaseComponents; +using Tizen.NUI.Constants; + +namespace UserAlphaFunctionTest +{ + class Example : NUIApplication + { + private Animation _animation; + private TextLabel _text; + private View _view1, _view2, _view3; + private UserAlphaFunctionDelegate _user_alpha_func; + private int myCount; + + public static void Log(string str) + { + Tizen.Log.Debug("NUI", "[DALI C# SAMPLE] " + str); + } + + public Example() : base() + { + } + + public Example(string stylesheet) : base(stylesheet) + { + } + + public Example(string stylesheet, WindowMode windowMode) : base(stylesheet, windowMode) + { + } + + protected override void OnCreate() + { + base.OnCreate(); + Initialize(); + } + + // Declare user alpha function delegate + [UnmanagedFunctionPointer(CallingConvention.StdCall)] + delegate float UserAlphaFunctionDelegate(float progress); + + public void Initialize() + { + Log("Initialize() is called!"); + Window window = Window.Instance; + window.BackgroundColor = Color.White; + window.TouchEvent += OnWindowTouched; + window.TouchEvent += OnWindowTouched2; + //window.EventProcessingFinished += OnEventProcessingFinished; + window.WheelEvent += OnWindowWheelEvent; + + // Add a _text label to the window + _text = new TextLabel("Hello Mono World"); + _text.ParentOrigin = ParentOrigin.BottomCenter; + _text.PivotPoint = PivotPoint.BottomCenter; + _text.HorizontalAlignment = HorizontalAlignment.Center; + _text.PointSize = 32.0f; + window.Add(_text); + + _view1 = new View(); + _view1.Size2D = new Size2D(200, 200); + _view1.BackgroundColor = Color.Green; + _view1.ParentOrigin = ParentOrigin.Center; + _view1.PivotPoint = PivotPoint.Center; + _view1.WidthResizePolicy = ResizePolicyType.Fixed; + _view1.HeightResizePolicy = ResizePolicyType.Fixed; + _view1.AddedToWindow += OnWindow; + window.Add(_view1); + + _view2 = new View(); + _view2.BackgroundColor = Color.Red; + _view2.Size2D = new Size2D(50, 50); + _view2.ParentOrigin = ParentOrigin.TopLeft; + _view2.PivotPoint = PivotPoint.TopLeft; + _view2.WidthResizePolicy = ResizePolicyType.Fixed; + _view2.HeightResizePolicy = ResizePolicyType.Fixed; + _view1.Add(_view2); + + _view3 = new View(); + _view3.BackgroundColor = Color.Blue; + _view3.Size2D = new Size2D(50, 50); + _view3.ParentOrigin = ParentOrigin.TopLeft; + _view3.PivotPoint = PivotPoint.TopLeft; + _view3.WidthResizePolicy = ResizePolicyType.Fixed; + _view3.HeightResizePolicy = ResizePolicyType.Fixed; + _view1.Add(_view3); + + _user_alpha_func = new UserAlphaFunctionDelegate(body); + + MyAnimating(); + } + + // User defines alpha function as custom alpha function + // Important Notification : when this custom alpha-function is implemented, + // the other function call nor other data excess is prevented. + // this method must be implemented to calculate the values of input and output purely. + // unless, this will cause application crash. + float body(float progress) + { + if (progress > 0.2f && progress < 0.7f) + { + return progress + 0.8f; + } + return progress; + } + + // Callback for _animation finished signal handling + public void AnimationFinished(object sender, EventArgs e) + { + Log("AnimationFinished() is called!"); + myCount = 0; + } + + public void MyAnimating() + { + // Create a new _animation + if (_animation) + { + _animation.Clear(); + _animation.Reset(); + } + + _animation = new Animation(10000); // 10000 milli-second of duration + _animation.AnimateTo(_view2, "Position", new Vector3(150.0f, 150.0f, 0.0f), 5000, 10000, new AlphaFunction(_user_alpha_func)); + // Connect the signal callback for animaiton finished signal + _animation.Finished += AnimationFinished; + _animation.EndAction = Animation.EndActions.Discard; + // Play the _animation + _animation.Play(); + } + + // Callback for window touched signal handling + public void OnWindowTouched(object source, Window.TouchEventArgs e) + { + // Only animate the _text label when touch down happens + if (e.Touch.GetState(0) == PointStateType.Down) + { + Log("OnWindowTouched() is called! PointStateType.DOWN came!"); + myCount++; + if (myCount > 1) + { + _animation.Stop(); + Log("_animation.Stop() is called!"); + } + } + } + + // Callback for window touched signal handling + public void OnWindowTouched2(object source, Window.TouchEventArgs e) + { + Log("OnWindowTouched2() is called!state=" + e.Touch.GetState(0)); + } + + public void OnEventProcessingFinished(object source) + { + Log("OnEventProcessingFinished() is called!"); + } + + public void OnWindowWheelEvent(object source, Window.WheelEventArgs e) + { + Log("OnWindowWheelEvent() is called!"); + //Log("OnWindowWheelEvent() is called!direction="+ e.WheelEvent.direction + " timeStamp=" + e.WheelEvent.timeStamp ); + } + + + public void OnWindow(object source, EventArgs e) + { + Log("OnWindow() is called!"); + } + + [STAThread] + static void _Main(string[] args) + { + Log("Main() is called!"); + + Example example = new Example(); + example.Run(args); + + Log("After MainLoop()"); + } + } +} + diff --git a/test/NUITestSample/NUITestSample/examples/view-navi-property.cs b/test/NUITestSample/NUITestSample/examples/view-navi-property.cs new file mode 100755 index 000000000..ce68ed0f7 --- /dev/null +++ b/test/NUITestSample/NUITestSample/examples/view-navi-property.cs @@ -0,0 +1,180 @@ +/* + * Copyright (c) 2017 Samsung Electronics Co., Ltd. + * + * 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.NUI; +using Tizen.NUI.BaseComponents; + +namespace MyCSharpExample +{ + class Example : NUIApplication + { + const int num = 2; + View[] view; + + View lastFocusedView; + + protected override void OnCreate() + { + base.OnCreate(); + Initialize(); + } + + public void Initialize() + { + view = new View[2]; + + for (int i = 0; i < num; i++) + { + view[i] = new View(); + view[i].Size2D = new Size2D(200, 200); + view[i].BackgroundColor = Color.Blue; + view[i].Position = new Position(300 + i * 300, 300, 0); + view[i].Name = "MyView" + i; + view[i].Focusable = true; + Window.Instance.Add(view[i]); + view[i].FocusGained += FocusNavigationSample_FocusGained; + view[i].FocusLost += FocusNavigationSample_FocusLost; + view[i].KeyEvent += FocusNavigationSample_KeyEvent; + } + + view[0].RightFocusableView = view[1]; + view[0].LeftFocusableView = view[1]; + view[1].RightFocusableView = view[0]; + view[1].LeftFocusableView = view[0]; + + FocusManager.Instance.SetCurrentFocusView(view[0]); + FocusManager.Instance.PreFocusChange += Instance_PreFocusChange; + + Window.Instance.TouchEvent += Instance_Touch; + } + + private void Instance_Touch(object sender, Window.TouchEventArgs e) + { + Tizen.Log.Debug("NUI", "window touched! set key focus as view[0]!"); + FocusManager.Instance.SetCurrentFocusView(view[0]); + } + + private bool FocusNavigationSample_KeyEvent(object source, View.KeyEventArgs e) + { + Tizen.Log.Debug("NUI", "..."); + View view = source as View; + + Tizen.Log.Debug("NUI", "NUI-1 " + "View-" + view.Name + ", Pressed-" + e.Key.KeyPressedName + e.Key.State.ToString()); + + return false; + } + + private void FocusNavigationSample_FocusLost(object sender, EventArgs e) + { + Tizen.Log.Debug("NUI", "..."); + View view = sender as View; + view.BackgroundColor = Color.Blue; + view.Scale = new Vector3(1.0f, 1.0f, 1.0f); + + Tizen.Log.Debug("NUI", "NUI-2 " + "FocusLost-" + view.Name); + } + + private void FocusNavigationSample_FocusGained(object sender, EventArgs e) + { + Tizen.Log.Debug("NUI", "..."); + View view = sender as View; + view.BackgroundColor = Color.Red; + view.Scale = new Vector3(1.2f, 1.2f, 1.0f); + + Tizen.Log.Debug("NUI", "NUI-3 " + "FocusGained-" + view.Name); + } + + private View Instance_PreFocusChange(object source, FocusManager.PreFocusChangeEventArgs e) + { + Tizen.Log.Debug("NUI", "..."); + View currentView = (e.CurrentView) ?? lastFocusedView; + View nextView = null; + + Tizen.Log.Debug("NUI", "NUI-4 " + "PreFocusChange-" + e.Direction); + + if (currentView != null && currentView.HasBody()) + Tizen.Log.Debug("NUI", "NUI-5 " + " Current-" + currentView.Name); + + if (currentView) + { + switch (e.Direction) + { + case View.FocusDirection.Left: + nextView = currentView.LeftFocusableView; + if (nextView == null) + Tizen.Log.Debug("NUI", "NUI-6 " + "LeftFocusableView is NULL!!!!"); + else + Tizen.Log.Debug("NUI", "NUI-7 " + currentView.Name + ".LeftFocusableView =" + nextView.Name); + break; + case View.FocusDirection.Right: + nextView = currentView.RightFocusableView; + if (nextView == null) + Tizen.Log.Debug("NUI", "NUI-8 " + "RightFocusableView is NULL!!!!"); + else + Tizen.Log.Debug("NUI", "NUI-9 " + currentView.Name + ".RightFocusableView =" + nextView.Name); + break; + case View.FocusDirection.Up: + nextView = currentView.UpFocusableView; + if (nextView == null) + Tizen.Log.Debug("NUI", "NUI-10 " + "UpFocusableView is NULL!!!!"); + else + Tizen.Log.Debug("NUI", "NUI-11 " + currentView.Name + ".UpFocusableView =" + nextView.Name); + break; + case View.FocusDirection.Down: + nextView = currentView.DownFocusableView; + if (nextView == null) + Tizen.Log.Debug("NUI", "NUI-12 " + "DownFocusableView is NULL!!!!"); + else + Tizen.Log.Debug("NUI", "NUI-13 " + currentView.Name + ".DownFocusableView =" + nextView.Name); + break; + default: + nextView = null; //added + break; + } + } + + if (e.ProposedView == null) + { + Tizen.Log.Debug("NUI", "NUI-14 " + "ProposedView in NULL!!"); + } + else if (e.ProposedView.HasBody()) + { + Tizen.Log.Debug("NUI", "NUI-15 " + "ProposedView-" + e.ProposedView.Name); + } + else + { + Tizen.Log.Debug("NUI", "NUI-16 " + "ProposedView does NOT have body!!!" + e.ProposedView); + } + + nextView = nextView ?? (e.ProposedView) ?? currentView; + lastFocusedView = nextView; + + if (nextView != null && nextView.HasBody()) + Tizen.Log.Debug("NUI", "NUI-17 " + "Next-" + nextView.Name); + + return nextView; + } + + [STAThread] + static void _Main(string[] args) + { + Example example = new Example(); + example.Run(args); + } + } +} \ No newline at end of file diff --git a/test/NUITestSample/NUITestSample/examples/visual-animation-test2.cs b/test/NUITestSample/NUITestSample/examples/visual-animation-test2.cs new file mode 100755 index 000000000..92528c0cb --- /dev/null +++ b/test/NUITestSample/NUITestSample/examples/visual-animation-test2.cs @@ -0,0 +1,278 @@ +/* + * Copyright (c) 2017 Samsung Electronics Co., Ltd. + * + * 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; +using Tizen.NUI; +using Tizen.NUI.UIComponents; +using Tizen.NUI.BaseComponents; +using Tizen.NUI.Constants; + +namespace VisaulAnimationExample +{ + class Example2 : NUIApplication + { + private VisualView _contentView1; + private VisualView _contentView2; + private VisualView _contentView3; + private TextLabel _title; + private PushButton _shadowButton1; + private PushButton _shadowButton2; + private PushButton _shadowButton3; + private bool _active1 = false; + private bool _active2 = false; + private bool _active3 = false; + private const string _resPath = "/home/owner/apps_rw/NUISamples.TizenTV/res"; + + private Animation _animation; + private bool _transitionInProgress = false; + + public Example2() : base() + { + } + + public Example2(string stylesheet) : base(stylesheet) + { + } + + public Example2(string stylesheet, WindowMode windowMode) : base(stylesheet, windowMode) + { + } + + protected override void OnCreate() + { + base.OnCreate(); + Initialize(); + } + + public void Initialize() + { + Window window = Window.Instance; + window.BackgroundColor = Color.White; + + TableView titleLayout = new TableView(2, 1); + titleLayout.Name = ("TitleLayout"); + titleLayout.PivotPoint = PivotPoint.TopLeft; + titleLayout.Position2D = new Position2D(10, 10); + titleLayout.Size2D = new Size2D((int)(window.Size.Width * 0.9f), (int)(window.Size.Height * 0.9f)); + titleLayout.SetCellPadding(new Size2D(10, 10)); + titleLayout.BackgroundColor = Color.Cyan; + window.Add(titleLayout); + + _title = new TextLabel("Visual Transition Example"); + _title.Name = ("Title"); + _title.SetStyleName("Title"); + _title.WidthResizePolicy = ResizePolicyType.FillToParent; + _title.HeightResizePolicy = ResizePolicyType.UseNaturalSize; + _title.HorizontalAlignment = HorizontalAlignment.Center; + titleLayout.AddChild(_title, new TableView.CellPosition(0, 0)); + titleLayout.SetFitHeight(0); + + TableView contentLayout = new TableView(3, 2); + contentLayout.Name = ("ContentLayout"); + contentLayout.WidthResizePolicy = ResizePolicyType.FillToParent; + contentLayout.HeightResizePolicy = ResizePolicyType.FillToParent; + contentLayout.PivotPoint = PivotPoint.TopLeft; + contentLayout.SetCellPadding(new Size2D(10, 10)); + contentLayout.BackgroundColor = Color.Magenta; + titleLayout.AddChild(contentLayout, new TableView.CellPosition(1, 0)); + + ////////////////////////////////////////////////////////////////////// + // make visual position animation + _contentView1 = new VisualView(); + _contentView1.WidthResizePolicy = ResizePolicyType.SizeRelativeToParent; + _contentView1.HeightResizePolicy = ResizePolicyType.SizeRelativeToParent; + //_contentView.Size2D = new Size2D(250, 250); + _contentView1.BackgroundImage = _resPath + "/images/background-blocks.jpg"; + + ImageVisual _icon = new ImageVisual(); + _icon.URL = _resPath + "/images/application-icon-0.png"; + _icon.DepthIndex = 1; + _icon.Size = new Size2D(50, 50); + _icon.SizePolicy = VisualTransformPolicyType.Absolute; + _icon.Position = new Position2D(5, 5); + _icon.PositionPolicy = VisualTransformPolicyType.Absolute; + _icon.Origin = Visual.AlignType.TopBegin; + _icon.AnchorPoint = Visual.AlignType.TopBegin; + _icon.MixColor = new Color(0, 1, 0, 0.5f); + _icon.Opacity = 0.5f; + _contentView1.AddVisual("icon_visual1", _icon); + + contentLayout.AddChild(_contentView1, new TableView.CellPosition(0, 0)); + + _shadowButton1 = new PushButton(); + _shadowButton1.LabelText = "Toggle Transition Position"; + _shadowButton1.Name = ("ToggleTransition"); + _shadowButton1.ParentOrigin = ParentOrigin.Center; + _shadowButton1.PivotPoint = PivotPoint.Center; + _shadowButton1.Clicked += (obj, ev) => + { + _active1 = !_active1; + StartTransition(_contentView1, _icon, "Position", _active1); + return true; + }; + _shadowButton1.WidthResizePolicy = ResizePolicyType.FillToParent; + _shadowButton1.HeightResizePolicy = ResizePolicyType.FillToParent; + contentLayout.AddChild(_shadowButton1, new TableView.CellPosition(0, 1)); + + ////////////////////////////////////////////////////////////////////// + // make visual opacity animation + _contentView2 = new VisualView(); + _contentView2.WidthResizePolicy = ResizePolicyType.SizeRelativeToParent; + _contentView2.HeightResizePolicy = ResizePolicyType.SizeRelativeToParent; + //_contentView.Size2D = new Size2D(250, 250); + _contentView2.BackgroundImage = _resPath + "/images/background-blocks.jpg"; + + ImageVisual _icon2 = new ImageVisual(); + _icon2.URL = _resPath + "/images/application-icon-0.png"; + _icon2.DepthIndex = 1; + _icon2.Size = new Size2D(50, 50); + _icon2.SizePolicy = VisualTransformPolicyType.Absolute; + _icon2.Position = new Position2D(5, 5); + _icon2.PositionPolicy = VisualTransformPolicyType.Absolute; + _icon2.Origin = Visual.AlignType.TopBegin; + _icon2.AnchorPoint = Visual.AlignType.TopBegin; + _icon2.MixColor = new Color(0, 1, 0, 0.5f); + _icon2.Opacity = 0.5f; + _contentView2.AddVisual("icon_visual2", _icon2); + + contentLayout.AddChild(_contentView2, new TableView.CellPosition(1, 0)); + + _shadowButton2 = new PushButton(); + _shadowButton2.LabelText = "Toggle Transition Opacity"; + _shadowButton2.Name = ("ToggleTransition"); + _shadowButton2.ParentOrigin = ParentOrigin.Center; + _shadowButton2.PivotPoint = PivotPoint.Center; + _shadowButton2.Clicked += (obj, ev) => + { + _active2 = !_active2; + StartTransition(_contentView2, _icon2, "Opacity", _active2); + return true; + }; + _shadowButton2.WidthResizePolicy = ResizePolicyType.FillToParent; + _shadowButton2.HeightResizePolicy = ResizePolicyType.FillToParent; + contentLayout.AddChild(_shadowButton2, new TableView.CellPosition(1, 1)); + + ////////////////////////////////////////////////////////////////////// + // make AnimatedImage visual test + _contentView3 = new VisualView(); + _contentView3.WidthResizePolicy = ResizePolicyType.SizeRelativeToParent; + _contentView3.HeightResizePolicy = ResizePolicyType.SizeRelativeToParent; + //_contentView.Size2D = new Size2D(250, 250); + _contentView3.BackgroundImage = _resPath + "/images/background-blocks.jpg"; + + ImageVisual _icon3 = new ImageVisual(); + _icon3.URL = _resPath + "/images/application-icon-0.png"; + _icon3.DepthIndex = 1; + _icon3.Size = new Size2D(50, 50); + _icon3.SizePolicy = VisualTransformPolicyType.Absolute; + _icon3.Position = new Position2D(5, 5); + _icon3.PositionPolicy = VisualTransformPolicyType.Absolute; + _icon3.Origin = Visual.AlignType.TopBegin; + _icon3.AnchorPoint = Visual.AlignType.TopBegin; + _icon3.MixColor = new Color(0, 1, 0, 0.5f); + _icon3.Opacity = 0.5f; + _contentView3.AddVisual("icon_visual3", _icon3); + + contentLayout.AddChild(_contentView3, new TableView.CellPosition(2, 0)); + + _shadowButton3 = new PushButton(); + _shadowButton3.LabelText = "Toggle Transition MixColor"; + _shadowButton3.Name = ("ToggleTransition"); + _shadowButton3.ParentOrigin = ParentOrigin.Center; + _shadowButton3.PivotPoint = PivotPoint.Center; + _shadowButton3.Clicked += (obj, ev) => + { + _active3 = !_active3; + StartTransition(_contentView3, _icon3, "MixColor", _active3); + return true; + }; + _shadowButton3.WidthResizePolicy = ResizePolicyType.FillToParent; + _shadowButton3.HeightResizePolicy = ResizePolicyType.FillToParent; + contentLayout.AddChild(_shadowButton3, new TableView.CellPosition(2, 1)); + } + + private void StartTransition(VisualView view, VisualMap target, string property, bool activate) + { + if (_animation) + { + _animation.Stop(); + _animation.Finished += OnTransitionFinished; + } + + if (activate) + { + if (property == "Position") + { + _animation = view.AnimateVisual(target, property, new Position2D(20, 20), 0, 1000, AlphaFunction.BuiltinFunctions.Linear, new Position2D(40, 40)); + } + else if (property == "Opacity") + { + _animation = view.AnimateVisual(target, property, 0.0f, 0, 1000, AlphaFunction.BuiltinFunctions.Linear); + } + else if (property == "MixColor") + { + _animation = view.AnimateVisual(target, property, Color.Green, 0, 1000, AlphaFunction.BuiltinFunctions.Linear); + } + } + else + { + if (property == "Position") + { + _animation = view.AnimateVisual(target, property, new Position2D(5, 5), 0, 1000); + } + else if (property == "Opacity") + { + _animation = view.AnimateVisual(target, property, 1.0f, 0, 1000); + } + else if (property == "MixColor") + { + _animation = view.AnimateVisual(target, property, Color.Red, 0, 1000); + } + } + + if (_animation) + { + _animation.Finished += OnTransitionFinished; + _transitionInProgress = true; + _animation.Play(); + } + } + private void OnTransitionFinished(object sender, EventArgs e) + { + _transitionInProgress = false; + if (_animation) + { + _animation.Finished += OnTransitionFinished; + _animation.Reset(); + } + } + + + /// + /// The main entry point for the application. + /// + [STAThread] + static void _Main(string[] args) + { + Example example = new Example(); + example.Run(args); + } + + + } +} diff --git a/test/NUITestSample/NUITestSample/examples/visual-animation-test3.cs b/test/NUITestSample/NUITestSample/examples/visual-animation-test3.cs new file mode 100755 index 000000000..f356c54a3 --- /dev/null +++ b/test/NUITestSample/NUITestSample/examples/visual-animation-test3.cs @@ -0,0 +1,233 @@ +/* + * Copyright (c) 2017 Samsung Electronics Co., Ltd. + * + * 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; +using Tizen.NUI; +using Tizen.NUI.UIComponents; +using Tizen.NUI.BaseComponents; +using Tizen.NUI.Constants; + +namespace VisaulAnimationExample +{ + class Example3 : NUIApplication + { + private VisualView _contentView1; + private VisualView _contentView2; + private VisualView _contentView3; + private TextLabel _title; + private PushButton _shadowButton1; + private PushButton _shadowButton2; + private PushButton _shadowButton3; + private bool _active1 = false; + private bool _active2 = false; + private bool _active3 = false; + //private const string _resPath = "/home/owner/apps_rw/NUISamples.TizenTV/res"; + private const string _resPath = "./res"; //for ubuntu + + private Animation _animation; + private ImageVisual _icon; + private ImageVisual _icon2; + private ImageVisual _icon3; + private ImageVisual _icon4; + private bool _transitionInProgress = false; + + public Example3() : base() + { + } + + public Example3(string stylesheet) : base(stylesheet) + { + } + + public Example3(string stylesheet, WindowMode windowMode) : base(stylesheet, windowMode) + { + } + + protected override void OnCreate() + { + base.OnCreate(); + Initialize(); + } + + public void Initialize() + { + Window window = Window.Instance; + window.BackgroundColor = Color.White; + + TableView titleLayout = new TableView(2, 1); + titleLayout.Name = ("TitleLayout"); + titleLayout.PivotPoint = PivotPoint.TopLeft; + titleLayout.Position2D = new Position2D(10, 10); + titleLayout.Size2D = new Size2D((int)(window.Size.Width * 0.9f), (int)(window.Size.Height * 0.9f)); + titleLayout.SetCellPadding(new Size2D(10, 10)); + titleLayout.BackgroundColor = Color.Cyan; + window.Add(titleLayout); + + _title = new TextLabel("Visual Transition Example"); + _title.Name = ("Title"); + _title.SetStyleName("Title"); + _title.WidthResizePolicy = ResizePolicyType.FillToParent; + _title.HeightResizePolicy = ResizePolicyType.UseNaturalSize; + _title.HorizontalAlignment = HorizontalAlignment.Center; + titleLayout.AddChild(_title, new TableView.CellPosition(0, 0)); + titleLayout.SetFitHeight(0); + + TableView contentLayout = new TableView(2, 1); + contentLayout.Name = ("ContentLayout"); + contentLayout.WidthResizePolicy = ResizePolicyType.FillToParent; + contentLayout.HeightResizePolicy = ResizePolicyType.FillToParent; + contentLayout.PivotPoint = PivotPoint.TopLeft; + contentLayout.SetCellPadding(new Size2D(10, 10)); + contentLayout.BackgroundColor = Color.Magenta; + titleLayout.AddChild(contentLayout, new TableView.CellPosition(1, 0)); + + // make visual position animation + _contentView1 = new VisualView(); + _contentView1.WidthResizePolicy = ResizePolicyType.SizeRelativeToParent; + _contentView1.HeightResizePolicy = ResizePolicyType.SizeRelativeToParent; + //_contentView.Size2D = new Size2D(250, 250); + _contentView1.BackgroundImage = _resPath + "/images/background-blocks.jpg"; + + _icon = new ImageVisual(); + _icon.URL = _resPath + "/images/application-icon-0.png"; + _icon.DepthIndex = 1; + _icon.Size = new Size2D(50, 50); + _icon.SizePolicy = VisualTransformPolicyType.Absolute; + _icon.Position = new Position2D(5, 5); + _icon.PositionPolicy = VisualTransformPolicyType.Absolute; + _icon.Origin = Visual.AlignType.TopBegin; + _icon.AnchorPoint = Visual.AlignType.TopBegin; + _icon.MixColor = new Color(0, 1, 0, 0.5f); + _icon.Opacity = 0.5f; + _contentView1.AddVisual("icon_visual1", _icon); + + _icon2 = new ImageVisual(); + _icon2.URL = _resPath + "/images/application-icon-0.png"; + _icon2.DepthIndex = 1; + _icon2.Size = new Size2D(50, 50); + _icon2.SizePolicy = VisualTransformPolicyType.Absolute; + _icon2.Position = new Position2D(200, 5); + _icon2.PositionPolicy = VisualTransformPolicyType.Absolute; + _icon2.Origin = Visual.AlignType.TopBegin; + _icon2.AnchorPoint = Visual.AlignType.TopBegin; + _icon2.MixColor = new Color(0, 1, 0, 0.5f); + _icon2.Opacity = 0.5f; + _contentView1.AddVisual("icon_visual2", _icon2); + + _icon3 = new ImageVisual(); + _icon3.URL = _resPath + "/images/application-icon-0.png"; + _icon3.DepthIndex = 1; + _icon3.Size = new Size2D(50, 50); + _icon3.SizePolicy = VisualTransformPolicyType.Absolute; + _icon3.Position = new Position2D(5, 200); + _icon3.PositionPolicy = VisualTransformPolicyType.Absolute; + _icon3.Origin = Visual.AlignType.TopBegin; + _icon3.AnchorPoint = Visual.AlignType.TopBegin; + _icon3.MixColor = new Color(0, 1, 0, 0.5f); + _icon3.Opacity = 0.5f; + _contentView1.AddVisual("icon_visual3", _icon3); + + _icon4 = new ImageVisual(); + _icon4.URL = _resPath + "/images/application-icon-0.png"; + _icon4.DepthIndex = 1; + _icon4.Size = new Size2D(50, 50); + _icon4.SizePolicy = VisualTransformPolicyType.Absolute; + _icon4.Position = new Position2D(200, 200); + _icon4.PositionPolicy = VisualTransformPolicyType.Absolute; + _icon4.Origin = Visual.AlignType.TopBegin; + _icon4.AnchorPoint = Visual.AlignType.TopBegin; + _icon4.MixColor = new Color(0, 1, 0, 0.5f); + _icon4.Opacity = 0.5f; + _contentView1.AddVisual("icon_visual4", _icon4); + + contentLayout.AddChild(_contentView1, new TableView.CellPosition(0, 0)); + + _shadowButton1 = new PushButton(); + _shadowButton1.LabelText = "Toggle Transition Position"; + _shadowButton1.Name = ("ToggleTransition"); + _shadowButton1.ParentOrigin = ParentOrigin.Center; + _shadowButton1.PivotPoint = PivotPoint.Center; + _shadowButton1.Clicked += (obj, ev) => + { + _active1 = !_active1; + StartTransition(_contentView1, _active1); + return true; + }; + _shadowButton1.WidthResizePolicy = ResizePolicyType.FillToParent; + _shadowButton1.HeightResizePolicy = ResizePolicyType.UseNaturalSize; + contentLayout.AddChild(_shadowButton1, new TableView.CellPosition(1, 0)); + contentLayout.SetFitHeight(1); + } + + private void StartTransition(VisualView view, bool activate) + { + if (_animation) + { + _animation.Stop(); + _animation.Finished += OnTransitionFinished; + } + + if (activate) + { + view.AnimateVisualAdd(_icon, "Position", new Position2D(80, 80), 0, 2000, AlphaFunction.BuiltinFunctions.Linear, new Position2D(5, 5)); + view.AnimateVisualAdd(_icon2, "Opacity", 0.0f, 0, 2000, AlphaFunction.BuiltinFunctions.Linear); + view.AnimateVisualAdd(_icon3, "MixColor", Color.Green, 0, 2000, AlphaFunction.BuiltinFunctions.Linear); + view.AnimateVisualAdd(_icon4, "Size", new Size2D(150, 150), 0, 2000, AlphaFunction.BuiltinFunctions.Linear); + _animation = view.AnimateVisualAddFinish(); + } + else + { + view.AnimateVisualAdd(_icon, "Position", new Position2D(5, 5), 0, 2000, AlphaFunction.BuiltinFunctions.Linear, new Position2D(80, 80)); + view.AnimateVisualAdd(_icon2, "Opacity", 1.0f, 0, 2000); + view.AnimateVisualAdd(_icon3, "MixColor", Color.Red, 0, 2000); + view.AnimateVisualAdd(_icon4, "Size", new Size2D(50, 50), 0, 2000, AlphaFunction.BuiltinFunctions.Linear); + _animation = view.AnimateVisualAddFinish(); + } + + if (_animation) + { + _animation.Finished += OnTransitionFinished; + _animation.EndAction = Animation.EndActions.StopFinal; + _transitionInProgress = true; + _animation.Play(); + } + } + + private void OnTransitionFinished(object sender, EventArgs e) + { + _transitionInProgress = false; + if (_animation) + { + _animation.Finished += OnTransitionFinished; + _animation.Reset(); + } + } + + /// + /// The main entry point for the application. + /// + [STAThread] + static void _Main(string[] args) + { + Example3 example = new Example3(); + example.Run(args); + } + + + } +} diff --git a/test/NUITestSample/NUITestSample/examples/visual-view-test.cs b/test/NUITestSample/NUITestSample/examples/visual-view-test.cs new file mode 100755 index 000000000..6c199d3ab --- /dev/null +++ b/test/NUITestSample/NUITestSample/examples/visual-view-test.cs @@ -0,0 +1,297 @@ +/* + * Copyright (c) 2017 Samsung Electronics Co., Ltd. + * + * 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; +using Tizen.NUI; +using Tizen.NUI.BaseComponents; +using Tizen.NUI.Constants; + +namespace VisualViewTest +{ + // An example of Visual View control. + class Example : NUIApplication + { + private VisualView _visualView = null; + private const string resources = "/home/owner/apps_rw/NUISamples.TizenTV/res"; + private Window _window; + + public Example() : base() + { + } + + public Example(string stylesheet) : base(stylesheet) + { + } + + public Example(string stylesheet, WindowMode windowMode) : base(stylesheet, windowMode) + { + } + + protected override void OnCreate() + { + base.OnCreate(); + Initialize(); + } + + private ImageVisual imageVisualMap1; + private TextVisual textVisualMap1; + private NPatchVisual npatchImageVisualMap1; + private BorderVisual borderVisualMap1; + private int cnt; + + public void Initialize() + { + Window window = Window.Instance; + + /* Create a visual view. */ + _visualView = new VisualView(); + _visualView.ParentOrigin = ParentOrigin.TopLeft; + _visualView.PivotPoint = PivotPoint.TopLeft; + _visualView.Size2D = new Size2D((int)window.Size.Width, (int)window.Size.Height); + + /* color visual */ + ColorVisual colorVisualMap1 = new ColorVisual(); + colorVisualMap1.Color = Color.Green; + _visualView.Background = colorVisualMap1.OutputVisualMap; + + window.Add(_visualView); + + /* image visual 1. */ + imageVisualMap1 = new ImageVisual(); + imageVisualMap1.URL = resources + "/images/image-1.jpg"; + imageVisualMap1.Size = new Vector2(200.0f, 200.0f); + imageVisualMap1.Position = new Vector2(10.0f, 10.0f); + imageVisualMap1.PositionPolicy = VisualTransformPolicyType.Absolute; + Console.WriteLine("PositionPolicy:{0}",imageVisualMap1.PositionPolicy); + imageVisualMap1.SizePolicy = VisualTransformPolicyType.Absolute; + Console.WriteLine("SizePolicy:{0}",imageVisualMap1.SizePolicy); + imageVisualMap1.Origin = Visual.AlignType.TopBegin; + imageVisualMap1.AnchorPoint = Visual.AlignType.TopBegin; + _visualView.AddVisual("imageVisual1", imageVisualMap1); + imageVisualMap1.URL = resources + "/images/image-3.jpg"; + + /* image visual 2. */ + ImageVisual imageVisualMap2 = new ImageVisual(); + imageVisualMap2.URL = resources + "/images/image-2.jpg"; + imageVisualMap2.Size = new Vector2(250.0f, 200.0f); + imageVisualMap2.Position = new Vector2(220.0f, 10.0f); + imageVisualMap2.PositionPolicy = VisualTransformPolicyType.Absolute; + imageVisualMap2.SizePolicy = VisualTransformPolicyType.Absolute; + imageVisualMap2.Origin = Visual.AlignType.TopBegin; + imageVisualMap2.AnchorPoint = Visual.AlignType.TopBegin; + _visualView.AddVisual("imageVisual2", imageVisualMap2); + + /* text visual. */ + textVisualMap1 = new TextVisual(); + textVisualMap1.Text = "Hello Goodbye"; + textVisualMap1.PointSize = 20.0f; + + textVisualMap1.Size = new Vector2(900.0f, 250.0f); + textVisualMap1.Position = new Vector2(10.0f, 220.0f); + textVisualMap1.PositionPolicy = VisualTransformPolicyType.Absolute; + textVisualMap1.SizePolicy = VisualTransformPolicyType.Absolute; + textVisualMap1.Origin = Visual.AlignType.TopBegin; + textVisualMap1.AnchorPoint = Visual.AlignType.TopBegin; + _visualView.AddVisual("textVisual1", textVisualMap1); + + /* border visual */ + borderVisualMap1 = new BorderVisual(); + borderVisualMap1.Color = Color.Red; + borderVisualMap1.BorderSize = 5.0f; + + borderVisualMap1.Size = new Vector2(100.0f, 100.0f); + borderVisualMap1.Position = new Vector2(10.0f, 380.0f); + borderVisualMap1.PositionPolicy = VisualTransformPolicyType.Absolute; + borderVisualMap1.SizePolicy = VisualTransformPolicyType.Absolute; + borderVisualMap1.Origin = Visual.AlignType.TopBegin; + borderVisualMap1.AnchorPoint = Visual.AlignType.TopBegin; + _visualView.AddVisual("borderVisual1", borderVisualMap1); + + /* gradient visual */ + GradientVisual gradientVisualMap1 = new GradientVisual(); + PropertyArray stopPosition = new PropertyArray(); + stopPosition.Add(new PropertyValue(0.0f)); + stopPosition.Add(new PropertyValue(0.3f)); + stopPosition.Add(new PropertyValue(0.6f)); + stopPosition.Add(new PropertyValue(0.8f)); + stopPosition.Add(new PropertyValue(1.0f)); + gradientVisualMap1.StopOffset = stopPosition; + PropertyArray stopColor = new PropertyArray(); + stopColor.Add(new PropertyValue(new Vector4(129.0f, 198.0f, 193.0f, 255.0f) / 255.0f)); + stopColor.Add(new PropertyValue(new Vector4(196.0f, 198.0f, 71.0f, 122.0f) / 255.0f)); + stopColor.Add(new PropertyValue(new Vector4(214.0f, 37.0f, 139.0f, 191.0f) / 255.0f)); + stopColor.Add(new PropertyValue(new Vector4(129.0f, 198.0f, 193.0f, 150.0f) / 255.0f)); + stopColor.Add(new PropertyValue(Color.Yellow)); + gradientVisualMap1.StopColor = stopColor; + gradientVisualMap1.StartPosition = new Vector2(0.5f, 0.5f); + gradientVisualMap1.EndPosition = new Vector2(-0.5f, -0.5f); + gradientVisualMap1.Center = new Vector2(0.5f, 0.5f); + gradientVisualMap1.Radius = 1.414f; + + gradientVisualMap1.Size = new Vector2(100.0f, 100.0f); + gradientVisualMap1.Position = new Vector2(120.0f, 380.0f); + gradientVisualMap1.PositionPolicy = VisualTransformPolicyType.Absolute; + gradientVisualMap1.SizePolicy = VisualTransformPolicyType.Absolute; + gradientVisualMap1.Origin = Visual.AlignType.TopBegin; + gradientVisualMap1.AnchorPoint = Visual.AlignType.TopBegin; + _visualView.AddVisual("gradientVisual1", gradientVisualMap1); + + /* primitive visual: Cone */ + PrimitiveVisual primitiveVisualMap1 = new PrimitiveVisual(); + primitiveVisualMap1.Shape = PrimitiveVisualShapeType.Cone; + primitiveVisualMap1.BevelPercentage = 0.3f; + primitiveVisualMap1.BevelSmoothness = 0.0f; + primitiveVisualMap1.ScaleDimensions = new Vector3(1.0f, 1.0f, 0.3f); + primitiveVisualMap1.MixColor = new Vector4((245.0f / 255.0f), (188.0f / 255.0f), (73.0f / 255.0f), 1.0f); + + primitiveVisualMap1.Size = new Vector2(100.0f, 100.0f); + primitiveVisualMap1.Position = new Vector2(230.0f, 380.0f); + primitiveVisualMap1.PositionPolicy = VisualTransformPolicyType.Absolute; + primitiveVisualMap1.SizePolicy = VisualTransformPolicyType.Absolute; + primitiveVisualMap1.Origin = Visual.AlignType.TopBegin; + primitiveVisualMap1.AnchorPoint = Visual.AlignType.TopBegin; + _visualView.AddVisual("primitiveVisual1", primitiveVisualMap1); + + /* primitive visual: Sphere */ + PrimitiveVisual primitiveVisualMap2 = new PrimitiveVisual(); + primitiveVisualMap2.Shape = PrimitiveVisualShapeType.Sphere; + primitiveVisualMap2.BevelPercentage = 0.3f; + primitiveVisualMap2.BevelSmoothness = 0.0f; + primitiveVisualMap2.ScaleDimensions = new Vector3(1.0f, 1.0f, 0.3f); + primitiveVisualMap2.MixColor = new Vector4((245.0f / 255.0f), (188.0f / 255.0f), (73.0f / 255.0f), 1.0f); + + primitiveVisualMap2.Size = new Vector2(100.0f, 100.0f); + primitiveVisualMap2.Position = new Vector2(340.0f, 380.0f); + primitiveVisualMap2.PositionPolicy = VisualTransformPolicyType.Absolute; + primitiveVisualMap2.SizePolicy = VisualTransformPolicyType.Absolute; + primitiveVisualMap2.Origin = Visual.AlignType.TopBegin; + primitiveVisualMap2.AnchorPoint = Visual.AlignType.TopBegin; + _visualView.AddVisual("primitiveVisual2", primitiveVisualMap2); + + /* primitive visual: Cylinder */ + PrimitiveVisual primitiveVisualMap3 = new PrimitiveVisual(); + primitiveVisualMap3.Shape = PrimitiveVisualShapeType.Cylinder; + primitiveVisualMap3.BevelPercentage = 0.3f; + primitiveVisualMap3.BevelSmoothness = 0.0f; + primitiveVisualMap3.ScaleDimensions = new Vector3(1.0f, 1.0f, 0.3f); + primitiveVisualMap3.MixColor = new Vector4((245.0f / 255.0f), (188.0f / 255.0f), (73.0f / 255.0f), 1.0f); + + primitiveVisualMap3.Size = new Vector2(100.0f, 100.0f); + primitiveVisualMap3.Position = new Vector2(10.0f, 490.0f); + primitiveVisualMap3.PositionPolicy = VisualTransformPolicyType.Absolute; + primitiveVisualMap3.SizePolicy = VisualTransformPolicyType.Absolute; + primitiveVisualMap3.Origin = Visual.AlignType.TopBegin; + primitiveVisualMap3.AnchorPoint = Visual.AlignType.TopBegin; + _visualView.AddVisual("primitiveVisual3", primitiveVisualMap3); + + /* primitive visual: ConicalFrustrum */ + PrimitiveVisual primitiveVisualMap4 = new PrimitiveVisual(); + primitiveVisualMap4.Shape = PrimitiveVisualShapeType.ConicalFrustrum; + primitiveVisualMap4.BevelPercentage = 0.3f; + primitiveVisualMap4.BevelSmoothness = 0.0f; + primitiveVisualMap4.ScaleDimensions = new Vector3(1.0f, 1.0f, 0.3f); + primitiveVisualMap4.MixColor = new Vector4((245.0f / 255.0f), (188.0f / 255.0f), (73.0f / 255.0f), 1.0f); + + primitiveVisualMap4.Size = new Vector2(100.0f, 100.0f); + primitiveVisualMap4.Position = new Vector2(120.0f, 490.0f); + primitiveVisualMap4.PositionPolicy = VisualTransformPolicyType.Absolute; + primitiveVisualMap4.SizePolicy = VisualTransformPolicyType.Absolute; + primitiveVisualMap4.Origin = Visual.AlignType.TopBegin; + primitiveVisualMap4.AnchorPoint = Visual.AlignType.TopBegin; + _visualView.AddVisual("primitiveVisual4", primitiveVisualMap4); + + /* primitive visual: Cube */ + PrimitiveVisual primitiveVisualMap5 = new PrimitiveVisual(); + primitiveVisualMap5.Shape = PrimitiveVisualShapeType.Cube; + primitiveVisualMap5.BevelPercentage = 0.3f; + primitiveVisualMap5.BevelSmoothness = 0.0f; + primitiveVisualMap5.ScaleDimensions = new Vector3(1.0f, 1.0f, 0.3f); + primitiveVisualMap5.MixColor = new Vector4((245.0f / 255.0f), (188.0f / 255.0f), (73.0f / 255.0f), 1.0f); + + primitiveVisualMap5.Size = new Vector2(100.0f, 100.0f); + primitiveVisualMap5.Position = new Vector2(230.0f, 490.0f); + primitiveVisualMap5.PositionPolicy = VisualTransformPolicyType.Absolute; + primitiveVisualMap5.SizePolicy = VisualTransformPolicyType.Absolute; + primitiveVisualMap5.Origin = Visual.AlignType.TopBegin; + primitiveVisualMap5.AnchorPoint = Visual.AlignType.TopBegin; + _visualView.AddVisual("primitiveVisual5", primitiveVisualMap5); + + /* mesh visual nothing show. */ + MeshVisual meshVisualMap1 = new MeshVisual(); + meshVisualMap1.ObjectURL = resources + "/models/Dino.obj"; + meshVisualMap1.MaterialtURL = resources + "/models/Dino.mtl"; + meshVisualMap1.TexturesPath = resources + "/images/"; + meshVisualMap1.ShadingMode = MeshVisualShadingModeValue.TexturedWithSpecularLighting; + + meshVisualMap1.Size = new Size2D(400, 400); + meshVisualMap1.Position = new Position2D(-50, 600); + meshVisualMap1.PositionPolicy = VisualTransformPolicyType.Absolute; + meshVisualMap1.SizePolicy = VisualTransformPolicyType.Absolute; + meshVisualMap1.Origin = Visual.AlignType.TopBegin; + meshVisualMap1.AnchorPoint = Visual.AlignType.TopBegin; + _visualView.AddVisual("meshVisual1", meshVisualMap1); + + /* n-patch image visual 1. */ + npatchImageVisualMap1 = new NPatchVisual(); + npatchImageVisualMap1.URL = resources + "/images/gallery-4.jpg"; + npatchImageVisualMap1.Size = new Size2D(400, 400); + npatchImageVisualMap1.Position = new Position2D(300, 600); + npatchImageVisualMap1.PositionPolicyX = VisualTransformPolicyType.Absolute; + npatchImageVisualMap1.PositionPolicyY = VisualTransformPolicyType.Absolute; + npatchImageVisualMap1.SizePolicyWidth = VisualTransformPolicyType.Absolute; + npatchImageVisualMap1.SizePolicyHeight = VisualTransformPolicyType.Absolute; + npatchImageVisualMap1.Origin = Visual.AlignType.TopBegin; + npatchImageVisualMap1.AnchorPoint = Visual.AlignType.TopBegin; + npatchImageVisualMap1.Border = new Rectangle(100, 100, 100, 100); + _visualView.AddVisual("npatchImageVisual1", npatchImageVisualMap1); + + _window = Window.Instance; + _window.FocusChanged += (sender, ee) => + { + cnt++; + Tizen.Log.Debug("NUI", "[WindowFocusTest] WindowFocusChanged event comes! focus gained=" + ee.FocusGained); + imageVisualMap1.Size += new Size2D(50, 50); + imageVisualMap1.Position += new Vector2(20.0f, 20.0f); + + textVisualMap1.Text = "Hello Goodbye" + cnt; + textVisualMap1.PointSize = 10.0f + (float)(cnt); + + npatchImageVisualMap1.URL = resources + "/images/gallery-" + (cnt % 5) + ".jpg"; + + borderVisualMap1.BorderSize = 1.0f + (float)cnt; + }; + + Tizen.Log.Debug("NUI", "[WindowFocusTest] is focus acceptable=" + _window.IsFocusAcceptable()); + _window.SetAcceptFocus(false); + Tizen.Log.Debug("NUI", "[WindowFocusTest] set focus acceptable=false!!!"); + Tizen.Log.Debug("NUI", "[WindowFocusTest] is focus acceptable=" + _window.IsFocusAcceptable()); + _window.SetAcceptFocus(true); + Tizen.Log.Debug("NUI", "[WindowFocusTest] set focus acceptable=true!!!"); + Tizen.Log.Debug("NUI", "[WindowFocusTest] is focus acceptable=" + _window.IsFocusAcceptable()); + + + } + + [STAThread] + static void _Main(string[] args) + { + Example example = new Example(); + example.Run(args); + } + } +} \ No newline at end of file diff --git a/test/NUITestSample/NUITestSample/examples/visual-view-test2.cs b/test/NUITestSample/NUITestSample/examples/visual-view-test2.cs new file mode 100755 index 000000000..659e9ba0b --- /dev/null +++ b/test/NUITestSample/NUITestSample/examples/visual-view-test2.cs @@ -0,0 +1,289 @@ +using System; +using Tizen.NUI; +using Tizen.NUI.UIComponents; +using Tizen.NUI.BaseComponents; + +namespace VisualViewTest2 +{ + public class VisualSample : NUIApplication + { + const int num = 2; + VisualView[] view; + + TextLabel guide; + ImageVisual imageMap; + ImageVisual imageMap2; + + ImageVisual highlightImageMap; + ImageVisual dimImageMap; + + TextVisual textMap1; + TextVisual textMap2; + + Window _window; + + int imgIndex; + + readonly string resourcePath = "/home/owner/apps_rw/NUISamples.TizenTV/res/images/"; + + protected override void OnCreate() + { + base.OnCreate(); + + view = new VisualView[2]; + + for (int i = 0; i < num; i++) + { + view[i] = new VisualView(); + view[i].Size2D = new Size2D(600, 600); + view[i].BackgroundColor = Color.Blue; + view[i].Position = new Position(400 + i * 800, 600, 0); + view[i].Focusable = true; + view[i].Name = "MyView" + i; + Window.Instance.Add(view[i]); + view[i].FocusGained += VisualSample_FocusGained; + view[i].FocusLost += VisualSample_FocusLost; + view[i].KeyEvent += VisualSample_KeyEvent; + } + + view[0].RightFocusableView = view[1]; + view[1].LeftFocusableView = view[0]; + + imageMap = new ImageVisual(); + imageMap.URL = resourcePath + "gallery-" + imgIndex++ + ".jpg"; + imageMap.AnchorPoint = Visual.AlignType.TopBegin; + imageMap.Origin = Visual.AlignType.TopBegin; + imageMap.Position = new Vector2(0, 0); + imageMap.PositionPolicy = VisualTransformPolicyType.Absolute; + imageMap.Size = new Size2D(500, 500); + imageMap.SizePolicy = VisualTransformPolicyType.Absolute; + imageMap.DepthIndex = 0; + view[0].AddVisual("bgVisual", imageMap); + + + highlightImageMap = new ImageVisual(); + highlightImageMap.URL = resourcePath + "star-highlight.png"; + highlightImageMap.AnchorPoint = Visual.AlignType.TopBegin; + highlightImageMap.Origin = Visual.AlignType.TopBegin; + highlightImageMap.Size = new Vector2(40, 40); + highlightImageMap.SizePolicy = VisualTransformPolicyType.Absolute; + highlightImageMap.Position = new Vector2(10, 10); + highlightImageMap.PositionPolicy = VisualTransformPolicyType.Absolute; + highlightImageMap.DepthIndex = 1; + view[0].AddVisual("iconVisual", highlightImageMap); + + + textMap1 = new TextVisual(); + textMap1.Text = "Hello"; + textMap1.AnchorPoint = Visual.AlignType.TopBegin; + textMap1.Origin = Visual.AlignType.TopBegin; + textMap1.PointSize = 20; + textMap1.Position = new Vector2(60, 210); + textMap1.PositionPolicy = VisualTransformPolicyType.Absolute; + textMap1.Size = new Vector2(600, 200); + textMap1.SizePolicy = VisualTransformPolicyType.Absolute; + textMap1.TextColor = Color.Red; + textMap1.DepthIndex = 5; + view[0].AddVisual("textVisual", textMap1); + + + + imageMap2 = new ImageVisual(); + imageMap2.URL = resourcePath + "gallery-" + imgIndex + ".jpg"; + imageMap2.AnchorPoint = Visual.AlignType.TopBegin; + imageMap2.Origin = Visual.AlignType.TopBegin; + imageMap2.Position = new Vector2(0, 0); + imageMap2.PositionPolicy = VisualTransformPolicyType.Absolute; + imageMap2.Size = new Vector2(500, 500); + imageMap2.SizePolicy = VisualTransformPolicyType.Absolute; + imageMap2.DepthIndex = 0; + view[1].AddVisual("bgVisual", imageMap2); + + dimImageMap = new ImageVisual(); + dimImageMap.URL = resourcePath + "star-dim.png"; + dimImageMap.Size = new Vector2(40, 40); + dimImageMap.SizePolicy = VisualTransformPolicyType.Absolute; + dimImageMap.AnchorPoint = Visual.AlignType.TopBegin; + dimImageMap.Origin = Visual.AlignType.TopBegin; + dimImageMap.Position = new Vector2(10, 10); + dimImageMap.PositionPolicy = VisualTransformPolicyType.Absolute; + dimImageMap.DepthIndex = 1; + view[1].AddVisual("iconVisual", dimImageMap); + + textMap2 = new TextVisual(); + textMap2.Text = "I'm"; + textMap2.PointSize = 20; + textMap2.AnchorPoint = Visual.AlignType.TopBegin; + textMap2.Origin = Visual.AlignType.TopBegin; + textMap2.Position = new Vector2(60, 210); + textMap2.PositionPolicy = VisualTransformPolicyType.Absolute; + textMap2.Size = new Vector2(600, 200); + textMap2.SizePolicy = VisualTransformPolicyType.Absolute; + textMap2.TextColor = Color.Black; + textMap2.DepthIndex = 5; + view[1].AddVisual("textVisual", textMap2); + + + guide = new TextLabel(); + guide.PivotPoint = PivotPoint.TopLeft; + guide.Size2D = new Size2D(800, 200); + guide.Padding = new Vector4(50, 50, 50, 50); + guide.MultiLine = true; + guide.BackgroundColor = Color.Magenta; + guide.PointSize = 10; + guide.TextColor = Color.Black; + guide.Text = "Left/Right - Move focus\n" + + "Up/Down - Change Text\n" + + "Enter - Change BG image\n"; + Window.Instance.Add(guide); + + Window.Instance.KeyEvent += Instance_Key; + FocusManager.Instance.SetCurrentFocusView(view[0]); + Window.Instance.TouchEvent += Instance_Touch; + _window = Window.Instance; + _window.FocusChanged += _window_WindowFocusChanged; + + } + + private void _window_WindowFocusChanged(object sender, Window.FocusChangedEventArgs e) + { + Tizen.Log.Fatal("NUI", "window focus changed!() focus gained=" + e.FocusGained); + } + + private void Instance_Touch(object sender, Window.TouchEventArgs e) + { + FocusManager.Instance.SetCurrentFocusView(view[0]); + } + + private bool VisualSample_KeyEvent(object source, View.KeyEventArgs e) + { + Tizen.Log.Fatal("NUI", "View_KeyEvent" + e.Key.State.ToString() + ", Pressed-" + e.Key.KeyPressedName); + + if (e.Key.State == Key.StateType.Down) + { + if (source.Equals(view[0])) + { + if (e.Key.KeyPressedName == "Up") + { + textMap1.PointSize = 14; + textMap1.TextColor = Color.Red; + textMap1.Text = "Hello NY!"; + //this.VersionCheckTest(); + /* + DALI_KEY_VOLUME_UP = 200, ///< Volume up key @SINCE_1_0.0 + DALI_KEY_VOLUME_DOWN = 201, ///< Volume down key @SINCE_1_0.0 + */ + try + { + Tizen.Log.Fatal("NUI", "GrabKeyTopmost (200==vol up) ret=" + _window.GrabKeyTopmost(200)); + } + catch (Exception except) + { + Tizen.Log.Fatal("NUI", "Exception!!! GrabKeyTopmost (200==vol up) msg=" + except.Message); + } + + } + else if (e.Key.KeyPressedName == "Down") + { + textMap1.PointSize = 17; + textMap1.TextColor = Color.Blue; + textMap1.Text = "Goodbye NY."; + + Tizen.Log.Fatal("NUI", "UngrabKeyTopmost (200==vol up) ret=" + _window.UngrabKeyTopmost(200)); + + } + else if (e.Key.KeyPressedName == "Return") + { + imgIndex = (imgIndex + 1) % 6; + imageMap.URL = resourcePath + "gallery-" + imgIndex + ".jpg"; + //Tizen.Log.Fatal("NUI", "get native ecore wayland hander=" + _window.GetNativeWindowHandler()); + } + + } + else + { + if (e.Key.KeyPressedName == "Up") + { + textMap2.PointSize = 14; + textMap2.TextColor = Color.Red; + textMap2.Text = "I'm happy!"; + Tizen.Log.Fatal("NUI", "grab key (201==vol down) ret=" + _window.GrabKey(201, Window.KeyGrabMode.Topmost)); + } + + if (e.Key.KeyPressedName == "Down") + { + textMap2.PointSize = 17; + textMap2.TextColor = Color.Blue; + textMap2.Text = "I'm unhappy"; + Tizen.Log.Fatal("NUI", "ungrab key (201==vol down) ret=" + _window.UngrabKey(201)); + } + else if (e.Key.KeyPressedName == "Return") + { + imgIndex = (imgIndex + 1) % 6; + imageMap2.URL = resourcePath + "gallery-" + imgIndex + ".jpg"; + //Tizen.Log.Fatal("NUI", "get native ecore wayland hander=" + _window.GetNativeWindowHandler()); + } + } + } + return false; + } + + private void Instance_Key(object sender, Window.KeyEventArgs e) + { + View currentFocusView = FocusManager.Instance.GetCurrentFocusView(); + + Tizen.Log.Fatal("NUI", "Window_KeyEvent" + e.Key.State.ToString() + ", Pressed-" + e.Key.KeyPressedName); + //Tizen.Log.Fatal("NUI", " CurrentFocusView : " + currentFocusView.HasBody() + currentFocusView?.Name); + } + + private void VisualSample_FocusLost(object sender, EventArgs e) + { + VisualView view = sender as VisualView; + view.BackgroundColor = Color.Green; + view.Scale = new Vector3(1.0f, 1.0f, 1.0f); + + view.AddVisual("iconVisual", dimImageMap); + + if (view.Name == "MyView1") + { + imageMap2.MixColor = new Color(1, 0, 0, 0.5f); + imageMap2.Opacity = 0.5f; + } + else if (view.Name == "MyView0") + { + imageMap.MixColor = new Color(1, 0, 0, 0.5f); + imageMap.Opacity = 0.5f; + } + + Tizen.Log.Fatal("NUI", "FocusLost-" + view.Name); + } + + private void VisualSample_FocusGained(object sender, EventArgs e) + { + VisualView view = sender as VisualView; + view.BackgroundColor = Color.Yellow; + view.Scale = new Vector3(1.2f, 1.2f, 1.0f); + + view.AddVisual("iconVisual", highlightImageMap); + + if (view.Name == "MyView1") + { + imageMap2.MixColor = new Color(1, 1, 1, 1); + imageMap2.Opacity = 1.0f; + } + else if (view.Name == "MyView0") + { + imageMap.MixColor = new Color(1, 1, 1, 1); + imageMap.Opacity = 1.0f; + } + + Tizen.Log.Fatal("NUI", "FocusGained-" + view.Name); + } + + static void _Main(string[] args) + { + VisualSample sample = new VisualSample(); + sample.Run(args); + } + } +} \ No newline at end of file diff --git a/test/NUITestSample/NUITestSample/examples/visual-view-test3.cs b/test/NUITestSample/NUITestSample/examples/visual-view-test3.cs new file mode 100755 index 000000000..ea9205ab2 --- /dev/null +++ b/test/NUITestSample/NUITestSample/examples/visual-view-test3.cs @@ -0,0 +1,119 @@ +/* + * Copyright (c) 2017 Samsung Electronics Co., Ltd. + * + * 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; +using Tizen.NUI; +using Tizen.NUI.Constants; +using Tizen.NUI.BaseComponents; + +namespace VisualViewTest3 +{ + // An example of Visual View control. + class Example : NUIApplication + { + private VisualView _visualView = null; + private const string resources = "/home/owner/apps_rw/NUISamples.TizenTV/res"; + private Window _window; + + public Example() : base() + { + } + + public Example(string stylesheet) : base(stylesheet) + { + } + + public Example(string stylesheet, WindowMode windowMode) : base(stylesheet, windowMode) + { + } + + protected override void OnCreate() + { + base.OnCreate(); + Initialize(); + } + + private ImageVisual imageVisualMap1; + private ImageVisual imageVisualMap2; + private int cnt; + + public void Initialize() + { + Window window = Window.Instance; + + /* Create a visual view. */ + _visualView = new VisualView(); + _visualView.ParentOrigin = ParentOrigin.TopLeft; + _visualView.PivotPoint = PivotPoint.TopLeft; + _visualView.Size2D = new Size2D(window.Size.Width, window.Size.Height); + + /* color visual */ + ColorVisual colorVisualMap1 = new ColorVisual(); + colorVisualMap1.Color = Color.Green; + _visualView.Background = colorVisualMap1.OutputVisualMap; + + window.Add(_visualView); + + /* image visual 1. No transform setting case. */ + imageVisualMap1 = new ImageVisual(); + imageVisualMap1.URL = resources + "/images/image-1.jpg"; + imageVisualMap1.DepthIndex = 1; + //_visualView.AddVisual("imageVisual1", imageVisualMap1); + + /* image visual 2. Using RelativePosition and SizePolicyWidth setting case. */ + imageVisualMap2 = new ImageVisual(); + imageVisualMap2.URL = resources + "/images/image-2.jpg"; + /* Using Size, you can set SizePolicyWidth and SizePolicyHeight separately, default by relative. */ + imageVisualMap2.Size = new Vector2(400.0f, 0.3f); + /* Using RelativePosition, then PositionPolicyX and PositionPolicyY will be relative. */ + imageVisualMap2.RelativePosition = new Vector2(0.1f, 0.1f); + imageVisualMap2.SizePolicyWidth = VisualTransformPolicyType.Absolute; + imageVisualMap2.Origin = Visual.AlignType.TopBegin; + imageVisualMap2.AnchorPoint = Visual.AlignType.TopBegin; + /* Ensure imageVisual show */ + imageVisualMap2.DepthIndex = 9; + _visualView.AddVisual("imageVisual2", imageVisualMap2); + /* If imageVisual2 added first, the it will be covered by imageVisual1. + so, we need to set their depth index to ensure they all can be showed. + */ + _visualView.AddVisual("imageVisual1", imageVisualMap1); + + _window = Window.Instance; + _window.FocusChanged += (sender, ee) => + { + cnt++; + Tizen.Log.Debug("NUI", "[WindowFocusTest] WindowFocusChanged event comes! focus gained=" + ee.FocusGained); + }; + + Tizen.Log.Debug("NUI", "[WindowFocusTest] is focus acceptable=" + _window.IsFocusAcceptable()); + _window.SetAcceptFocus(false); + Tizen.Log.Debug("NUI", "[WindowFocusTest] set focus acceptable=false!!!"); + Tizen.Log.Debug("NUI", "[WindowFocusTest] is focus acceptable=" + _window.IsFocusAcceptable()); + _window.SetAcceptFocus(true); + Tizen.Log.Debug("NUI", "[WindowFocusTest] set focus acceptable=true!!!"); + Tizen.Log.Debug("NUI", "[WindowFocusTest] is focus acceptable=" + _window.IsFocusAcceptable()); + } + + [STAThread] + static void _Main(string[] args) + { + Example example = new Example(); + example.Run(args); + } + } +} diff --git a/test/NUITestSample/NUITestSample/examples/visuals-example.cs b/test/NUITestSample/NUITestSample/examples/visuals-example.cs new file mode 100755 index 000000000..8c0a724ba --- /dev/null +++ b/test/NUITestSample/NUITestSample/examples/visuals-example.cs @@ -0,0 +1,150 @@ +/* + * Copyright (c) 2017 Samsung Electronics Co., Ltd. + * + * 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.NUI; +using Tizen.NUI.Constants; +using Tizen.NUI.BaseComponents; + +namespace VisualsExampleTest +{ + class Example : NUIApplication + { + private TextLabel _title; + private const string resources = "/home/owner/apps_rw/NUISamples.TizenTV/res"; + + public Example() : base() + { + } + + public Example(string stylesheet) : base(stylesheet) + { + } + + public Example(string stylesheet, WindowMode windowMode) : base(stylesheet, windowMode) + { + } + + protected override void OnCreate() + { + base.OnCreate(); + Initialize(); + } + + public void Initialize() + { + Window window = Window.Instance; + window.BackgroundColor = Color.White; + + TableView contentLayout = new TableView(4, 1); + contentLayout.Name = ("ContentLayout"); + contentLayout.WidthResizePolicy = ResizePolicyType.FillToParent; + contentLayout.HeightResizePolicy = ResizePolicyType.FillToParent; + + contentLayout.SetCellPadding(new Size2D(0, 5)); + contentLayout.BackgroundColor = Color.Red;//new Color(0.949f, 0.949f, 0.949f, 1.0f); + + window.Add(contentLayout); + + _title = new TextLabel("Visuals Example"); + _title.Name = "Title"; + _title.StyleName = "Title"; + _title.WidthResizePolicy = ResizePolicyType.FillToParent; + _title.HeightResizePolicy = ResizePolicyType.UseNaturalSize; + _title.HorizontalAlignment = HorizontalAlignment.Center; + _title.BackgroundColor = Color.Yellow; + contentLayout.Add(_title); + contentLayout.SetFitHeight(0); + + // Color Visual example + ImageView colorView = new ImageView(); + //colorView.WidthResizePolicy = ResizePolicyType.SizeRelativeToParent; + //colorView.HeightResizePolicy = ResizePolicyType.SizeRelativeToParent; + // PropertyMap colorVisual = new PropertyMap(); + // colorVisual.Add( Visual.Property.Type, new PropertyValue( (int)Visual.Type.Color )) + // .Add( ColorVisualProperty.MixColor, new PropertyValue( Color.Green )); + //colorView.Background = colorVisual; + colorView.Size2D = new Size2D(500, 200); + colorView.ResourceUrl = resources+"/images/00_popup_bg.9.png"; + colorView.Border = new Rectangle(100, 100, 100, 100); + // colorView. + // PropertyMap _map = new PropertyMap(); + // _map.Add(Visual.Property.Type, new PropertyValue((int)Visual.Type.NPatch)); + // _map.Add(NpatchImageVisualProperty.URL, new PropertyValue(resources+"/images/00_popup_bg.9.png")); + // _map.Add(NpatchImageVisualProperty.Border, new PropertyValue(new Rectangle(100, 100, 100, 100))); + //_map.Add(NpatchImageVisualProperty.BorderOnly, new PropertyValue(true)); + //colorView.Background = _map; + contentLayout.Add(colorView); + + // Image Visual example + View imageView = new View(); + imageView.WidthResizePolicy = ResizePolicyType.UseNaturalSize; + imageView.HeightResizePolicy = ResizePolicyType.UseNaturalSize; + PropertyMap imageVisual = new PropertyMap(); + imageVisual.Add( Visual.Property.Type, new PropertyValue( (int)Visual.Type.Image )); + imageVisual.Add(ImageVisualProperty.URL, new PropertyValue( resources + "/images/gallery-0.jpg" )); + imageView.Background = imageVisual; + contentLayout.SetCellAlignment(new TableView.CellPosition(2, 0), HorizontalAlignmentType.Center, VerticalAlignmentType.Center); + contentLayout.Add(imageView); + for(int i =1; i<=5; i++) + { + PropertyMap imageVisual1 = new PropertyMap(); + imageVisual1.Add( Visual.Property.Type, new PropertyValue( (int)Visual.Type.Image )); + imageVisual1.Add(ImageVisualProperty.URL, new PropertyValue( resources + "/images/gallery-"+i+".jpg" )); + imageView.Background = imageVisual1; + } + + // Primitive Visual example + View primitiveView = new View(); + primitiveView.WidthResizePolicy = ResizePolicyType.SizeRelativeToParent; + primitiveView.HeightResizePolicy = ResizePolicyType.SizeRelativeToParent; + PropertyMap primitiveVisual = new PropertyMap(); + primitiveVisual.Add( Visual.Property.Type, new PropertyValue( (int)Visual.Type.Primitive )) + .Add( PrimitiveVisualProperty.Shape, new PropertyValue((int)PrimitiveVisualShapeType.BevelledCube)) + .Add( PrimitiveVisualProperty.BevelPercentage, new PropertyValue(0.3f)) + .Add( PrimitiveVisualProperty.BevelSmoothness, new PropertyValue(0.0f)) + .Add( PrimitiveVisualProperty.ScaleDimensions, new PropertyValue(new Vector3(1.0f,1.0f,0.3f))) + .Add( PrimitiveVisualProperty.MixColor, new PropertyValue(new Vector4(0.7f, 0.5f, 0.05f, 1.0f))); + primitiveView.Background = primitiveVisual; + Radian rad = new Radian(new Degree(45.0f)); + primitiveView.Orientation = new Rotation(rad, Vector3.YAxis); + contentLayout.Add(primitiveView); + + // Text Visual example + View textView = new View(); + textView.WidthResizePolicy = ResizePolicyType.SizeRelativeToParent; + textView.HeightResizePolicy = ResizePolicyType.SizeRelativeToParent; + PropertyMap textVisual = new PropertyMap(); + textVisual.Add( Visual.Property.Type, new PropertyValue( (int)Visual.Type.Text )) + .Add( TextVisualProperty.Text, new PropertyValue("I am text visual")) + .Add( TextVisualProperty.TextColor, new PropertyValue(Color.Blue)) + .Add( TextVisualProperty.PointSize, new PropertyValue(20)); + textView.Background = textVisual; + contentLayout.Add(textView); + } + + /// + /// The main entry point for the application. + /// + [STAThread] + static void _Main(string[] args) + { + Example example = new Example( resources + "/json/style-example-theme-one.json"); + example.Run(args); + } + } +} diff --git a/test/NUITestSample/NUITestSample/examples/visuals-using-custom-view/ContactData.cs b/test/NUITestSample/NUITestSample/examples/visuals-using-custom-view/ContactData.cs new file mode 100755 index 000000000..9a3b9a8c9 --- /dev/null +++ b/test/NUITestSample/NUITestSample/examples/visuals-using-custom-view/ContactData.cs @@ -0,0 +1,131 @@ +/* + * Copyright (c) 2017 Samsung Electronics Co., Ltd. + * + * 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.NUI; +using Tizen.NUI.Constants; + +namespace VisualsUsingCustomView +{ + // The collection of contacts + static class ContactsList + { + private const string resources = "/home/SERILOCAL/david.steele/Git/Tizen/nui/NUISamples/NUISamples/NUISamples.TizenTV/res"; + + public static readonly ContactItem[] s_contactData = new ContactItem[] + { + new ContactItem ("Emmett Yates", resources + "/images/gallery-small-43.jpg", + resources + "/images/mask.png", + new Color((73.0f/255.0f),(182.0f/255.0f), (245.0f/255.0f), 1.0f), + (int)PrimitiveVisualShapeType.Cone), + new ContactItem ("Leslie Wong", resources+ "/images/gallery-2.jpg", + resources + "/images/mask.png", + new Color((51.0f/255.0f), (51.0f/255.0f), (102.0f/255.0f), 1.0f), + (int)PrimitiveVisualShapeType.Sphere), + new ContactItem ("Walter Jensen", resources+ "/images/gallery-0.jpg", + resources + "/images/mask.png", + new Color((151.0f/255.0f), (214.0f/255.0f), (240.0f/255.0f), 1.0f), + (int)PrimitiveVisualShapeType.Cylinder), + new ContactItem ("Dan Haynes", resources+"/images/gallery-1.jpg", + resources + "/images/mask.png", + new Color((102.0f/255.0f), (251.0f/255.0f), (102.0f/255.0f), 1.0f), + (int)PrimitiveVisualShapeType.ConicalFrustrum), + new ContactItem ("Mable Hodges", resources+"/images/gallery-3.jpg", + resources + "/images/mask.png", + new Color((255.0f/255.0f), (102.0f/255.0f), (102.0f/255.0f), 1.0f), + (int)PrimitiveVisualShapeType.Cube) + }; + } + + // The information for an individual contact + class ContactItem + { + private string _name; + private string _imageURL; + private Color _color; + private int _shape; + private string _maskURL; + + public ContactItem(string name, string imageURL, string maskURL, Color color, int shape) + { + _name = name; + _imageURL = imageURL; + _maskURL = maskURL; + _color = color; + _shape = shape; + } + + public string ImageURL + { + get + { + return _imageURL; + } + set + { + _imageURL = value; + } + } + public string MaskURL + { + get + { + return _maskURL; + } + set + { + _maskURL = value; + } + } + + public string Name + { + get + { + return _name; + } + set + { + _name = value; + } + } + + public Color Color + { + get + { + return _color; + } + set + { + _color = value; + } + } + + public int Shape + { + get + { + return _shape; + } + set + { + _shape = value; + } + } + } +} diff --git a/test/NUITestSample/NUITestSample/examples/visuals-using-custom-view/ContactView.cs b/test/NUITestSample/NUITestSample/examples/visuals-using-custom-view/ContactView.cs new file mode 100755 index 000000000..52995a74f --- /dev/null +++ b/test/NUITestSample/NUITestSample/examples/visuals-using-custom-view/ContactView.cs @@ -0,0 +1,241 @@ +/* + * Copyright (c) 2017 Samsung Electronics Co., Ltd. + * + * 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.NUI; +using Tizen.NUI.Constants; +using Tizen.NUI.BaseComponents; + +// A ContactView is a Custom View which consists of four visuals (Image, Primitive, Text and Color). +// All of these visuals can be configured via properties - ImageURL (Image), Shape (Primitive), Name (Text) and Color. +// Tap gesture is also enabled on the ContactView which changes the color visual to some random color when ContactView is tapped. + +namespace VisualsUsingCustomView +{ + public class ContactView : CustomView + { + private VisualBase _imageVisual; + private VisualBase _primitiveVisual; + private VisualBase _textVisual; + private int _shape; + private string _imageURL; + private string _maskURL; + private string _name; + private Color _color; + + static CustomView CreateInstance() + { + return new ContactView(); + } + + static ContactView() + { + CustomViewRegistry.Instance.Register( CreateInstance, typeof(ContactView)); + } + + public ContactView() : base( typeof(ContactView).FullName, CustomViewBehaviour.RequiresKeyboardNavigationSupport) + { + } + + public string MaskURL + { + get { return _maskURL; } + set { _maskURL=value; } + } + + [ScriptableProperty()] + public string ImageURL + { + get + { + return _imageURL; + } + set + { + _imageURL = value; + + ImageVisual imageVisual = new ImageVisual(); + imageVisual.URL = value; + imageVisual.AlphaMaskURL = _maskURL; + //imageVisual.MaskContentScale = 1.6f; + //imageVisual.CropToMask = true; + ImageVisual = imageVisual.OutputVisualMap; + } + } + + [ScriptableProperty()] + public PropertyMap ImageVisual + { + //get + //{ + // return _imageVisual.Creation; + //} + set + { + _imageVisual = VisualFactory.Instance.CreateVisual( value ); + RegisterVisual( GetPropertyIndex("ImageVisual"), _imageVisual ); + + // Set the depth index for Image visual + _imageVisual.DepthIndex = 30; + } + } + + [ScriptableProperty()] + public string NameField + { + get + { + return _name; + } + set + { + _name = value; + + // Create and Register Text Visual + TextVisual textVisual = new TextVisual(); + textVisual.Text = _name; + textVisual.TextColor = Color.Black; + textVisual.PointSize = 12; + textVisual.HorizontalAlignment = HorizontalAlignment.Center; + textVisual.VerticalAlignment = VerticalAlignment.Center; + NameVisual = textVisual.OutputVisualMap; + } + } + + [ScriptableProperty()] + public PropertyMap NameVisual + { + //get + //{ + // return _textVisual.Creation; + //} + set + { + _textVisual = VisualFactory.Instance.CreateVisual( value ); + RegisterVisual( GetPropertyIndex("NameVisual"), _textVisual ); + + // Set the depth index for Text visual + _textVisual.DepthIndex = 30; + } + } + + [ScriptableProperty()] + public Color Color + { + get + { + return _color; + } + set + { + _color = value; + BackgroundColor = value; + } + } + + [ScriptableProperty()] + public int Shape + { + get + { + return _shape; + } + set + { + _shape = value; + + // Create and Register Primitive Visual + var primitiveVisual = new PrimitiveVisual(); + primitiveVisual.Shape = (PrimitiveVisualShapeType)_shape; + primitiveVisual.BevelPercentage = 0.3f; + primitiveVisual.BevelSmoothness = 0.0f; + primitiveVisual.ScaleDimensions = new Vector3( 1.0f, 1.0f, 0.3f ); + primitiveVisual.MixColor = new Vector4( (245.0f/255.0f), (188.0f/255.0f), (73.0f/255.0f), 1.0f); + + ShapeVisual = primitiveVisual.OutputVisualMap; + } + } + + [ScriptableProperty()] + public PropertyMap ShapeVisual + { + //get + //{ + // return _primitiveVisual.Creation; + //} + set + { + _primitiveVisual = VisualFactory.Instance.CreateVisual( value ); + RegisterVisual( GetPropertyIndex("ShapeVisual"), _primitiveVisual ); + + // Set the depth index for Primitive visual + _primitiveVisual.DepthIndex = 30; + } + } + + public override void OnInitialize() + { + // Enable Tap gesture on ContactView + EnableGestureDetection(Gesture.GestureType.Tap); + } + + public override void OnTap(TapGesture tap) + { + // Change the Color visual of ContactView with some random color + Random random = new Random(); + float nextRed = (random.Next(0, 256) / 255.0f); + float nextGreen = (random.Next(0, 256) / 255.0f); + float nextBlue = (random.Next(0, 256) / 255.0f); + Animation anim = AnimateBackgroundColor( new Color( nextRed, nextGreen, nextBlue, 1.0f), 0, 2000 ); + if( anim ) + anim.Play(); + } + + public override void OnRelayout(Vector2 size, RelayoutContainer container) + { + // Configure the transform and size of Image visual. + PropertyMap imageVisualTransform = new PropertyMap(); + imageVisualTransform.Add((int)VisualTransformPropertyType.Offset, new PropertyValue(new Vector2(10.0f, 0.0f))) + .Add((int)VisualTransformPropertyType.OffsetPolicy, new PropertyValue(new Vector2((int)VisualTransformPolicyType.Absolute, (int)VisualTransformPolicyType.Absolute))) + .Add((int)VisualTransformPropertyType.SizePolicy, new PropertyValue(new Vector2((int)VisualTransformPolicyType.Absolute, (int)VisualTransformPolicyType.Absolute))) + .Add((int)VisualTransformPropertyType.Size, new PropertyValue(new Vector2(40.0f, 40.0f))) + .Add((int)VisualTransformPropertyType.Origin, new PropertyValue((int)Visual.AlignType.CenterBegin)) + .Add((int)VisualTransformPropertyType.AnchorPoint, new PropertyValue((int)Visual.AlignType.CenterBegin)); + _imageVisual.SetTransformAndSize(imageVisualTransform, size); + + // Configure the transform and size of Text visual. + PropertyMap textVisualTransform = new PropertyMap(); + textVisualTransform.Add((int)VisualTransformPropertyType.Offset, new PropertyValue(new Vector2(0.0f, 0.0f))) + .Add((int)VisualTransformPropertyType.OffsetPolicy, new PropertyValue(new Vector2((int)VisualTransformPolicyType.Relative, (int)VisualTransformPolicyType.Relative))) + .Add((int)VisualTransformPropertyType.SizePolicy, new PropertyValue(new Vector2((int)VisualTransformPolicyType.Absolute, (int)VisualTransformPolicyType.Absolute))) + .Add((int)VisualTransformPropertyType.Size, new PropertyValue(new Vector2(size.X - 100.0f, 50.0f))) + .Add((int)VisualTransformPropertyType.Origin, new PropertyValue((int)Visual.AlignType.Center)) + .Add((int)VisualTransformPropertyType.AnchorPoint, new PropertyValue((int)Visual.AlignType.Center)); + _textVisual.SetTransformAndSize(textVisualTransform, size); + + // Configure the transform and size of Primitive visual. + PropertyMap primitiveVisualTransform = new PropertyMap(); + primitiveVisualTransform.Add((int)VisualTransformPropertyType.Offset, new PropertyValue(new Vector2(size.X - 60.0f, 0.0f))) + .Add((int)VisualTransformPropertyType.OffsetPolicy, new PropertyValue(new Vector2((int)VisualTransformPolicyType.Absolute, (int)VisualTransformPolicyType.Absolute))) + .Add((int)VisualTransformPropertyType.SizePolicy, new PropertyValue(new Vector2((int)VisualTransformPolicyType.Absolute, (int)VisualTransformPolicyType.Absolute))) + .Add((int)VisualTransformPropertyType.Size, new PropertyValue(new Vector2(40.0f, 40.0f))) + .Add((int)VisualTransformPropertyType.Origin, new PropertyValue((int)Visual.AlignType.CenterBegin)) + .Add((int)VisualTransformPropertyType.AnchorPoint, new PropertyValue((int)Visual.AlignType.CenterBegin)); + _primitiveVisual.SetTransformAndSize(primitiveVisualTransform, size); + } + } +} diff --git a/test/NUITestSample/NUITestSample/examples/visuals-using-custom-view/visuals-using-custom-view.cs b/test/NUITestSample/NUITestSample/examples/visuals-using-custom-view/visuals-using-custom-view.cs new file mode 100755 index 000000000..be327fe06 --- /dev/null +++ b/test/NUITestSample/NUITestSample/examples/visuals-using-custom-view/visuals-using-custom-view.cs @@ -0,0 +1,100 @@ +/* + * Copyright (c) 2017 Samsung Electronics Co., Ltd. + * + * 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.NUI; +using Tizen.NUI.UIComponents; +using Tizen.NUI.BaseComponents; +using Tizen.NUI.Constants; + +namespace VisualsUsingCustomView +{ + class VisualsExample : NUIApplication + { + public VisualsExample() : base() + { + } + + public VisualsExample(string stylesheet) : base(stylesheet) + { + } + + public VisualsExample(string stylesheet, WindowMode windowMode) : base(stylesheet, windowMode) + { + } + + protected override void OnCreate() + { + base.OnCreate(); + Initialize(); + } + + private void Initialize() + { + Window window = Window.Instance; + window.BackgroundColor = Color.White; + + TableView contentLayout = new TableView(14, 1); + contentLayout.Name = "ContentLayout"; + //contentLayout.WidthResizePolicy = ResizePolicyType.FillToParent; + //contentLayout.HeightResizePolicy = ResizePolicyType.FillToParent; + contentLayout.PivotPoint = PivotPoint.TopLeft; + contentLayout.ParentOrigin = ParentOrigin.TopLeft; + contentLayout.Size2D = new Vector2(window.Size.Width, window.Size.Height); + contentLayout.SetCellPadding(new Size2D(5, 5)); + contentLayout.BackgroundColor = new Color(0.949f, 0.949f, 0.949f, 1.0f); + + window.Add(contentLayout); + + TextLabel title = new TextLabel("Contacts List with Visuals"); + title.Name = "Title"; + title.StyleName = "Title"; + title.WidthResizePolicy = ResizePolicyType.FillToParent; + title.HeightResizePolicy = ResizePolicyType.UseNaturalSize; + title.HorizontalAlignment = HorizontalAlignment.Center; + contentLayout.Add(title); + contentLayout.SetFitHeight(0); + + // Create ContactView(s) from ContactItem(s) in ContactsList and add them to TableView + ContactView contactView; + foreach (ContactItem contact in ContactsList.s_contactData) + { + contactView = new ContactView(); + contactView.WidthResizePolicy = ResizePolicyType.FillToParent; + contactView.HeightResizePolicy = ResizePolicyType.FillToParent; + + // Configure visuals of ContactView via properties + contactView.NameField = contact.Name; + contactView.MaskURL = contact.MaskURL; + contactView.ImageURL = contact.ImageURL; + contactView.Color = contact.Color; + contactView.Shape = contact.Shape; + contentLayout.Add(contactView); + } + } + + /// + /// The main entry point for the application. + /// + [STAThread] + static void _Main(string[] args) + { + VisualsExample visualsExample = new VisualsExample(); + visualsExample.Run(args); + } + } +} diff --git a/test/NUITestSample/NUITestSample/examples/widget-view-test.cs b/test/NUITestSample/NUITestSample/examples/widget-view-test.cs new file mode 100755 index 000000000..521e376ed --- /dev/null +++ b/test/NUITestSample/NUITestSample/examples/widget-view-test.cs @@ -0,0 +1,105 @@ +using System; +using Tizen.NUI; +using Tizen.NUI.UIComponents; +using Tizen.NUI.BaseComponents; + +namespace WidgetViewTest +{ + class Example : NUIApplication + { + private PushButton _widgetButton; + private PushButton _deletedButton; + private WidgetView _widgetView; + private WidgetViewManager _widgetViewManager; + private View _container; + private string _instanceID; + + protected override void OnCreate() + { + base.OnCreate(); + Initialize(); + } + + protected override void OnTerminate() + { + //This function is called when the app exit normally. + base.OnTerminate(); + } + + public void Initialize() + { + Window window = Window.Instance; + window.BackgroundColor = Color.White; + + Tizen.Log.Debug("NUI", "### DP1"); + Layer layer = new Layer(); + layer.Behavior = Layer.LayerBehavior.Layer3D; + window.AddLayer(layer); + Tizen.Log.Debug("NUI", "### DP2"); + _container = new View(); + _container.ParentOrigin = ParentOrigin.Center; + _container.PivotPoint = PivotPoint.Center; + _container.Size2D = new Size2D(400, 400); + Tizen.Log.Debug("NUI", "### DP3"); + _widgetButton = new PushButton(); + _widgetButton.LabelText = "Widget"; + _widgetButton.ParentOrigin = ParentOrigin.BottomLeft; + _widgetButton.PivotPoint = PivotPoint.BottomLeft; + _widgetButton.PositionUsesAnchorPoint = true; + _widgetButton.Size2D = new Size2D(200, 100); + window.Add(_widgetButton); + _widgetButton.Clicked += (obj, e) => + { + _widgetView = _widgetViewManager.AddWidget("widget-efl.example", "", 450, 700, -1); + //_widgetView.PositionUsesPivotPoint = true; + //_widgetView.ParentOrigin = ParentOrigin.Center; + _widgetView.PivotPoint = PivotPoint.TopLeft; + _widgetView.PositionUsesAnchorPoint = true; + _widgetView.BackgroundColor = Color.Yellow; + _widgetView.WidgetAdded += (sender, eargs) => + { + _widgetButton.LabelText = "Quit"; + window.Add(_widgetView); + }; + _widgetView.WidgetDeleted += (sender, eargs) => + { + window.Remove(_widgetView); + _widgetButton.LabelText = "Button"; + }; + _instanceID = _widgetView.InstanceID; + return false; + }; + + _deletedButton = new PushButton(); + _deletedButton.LabelText = "Buton"; + _deletedButton.ParentOrigin = ParentOrigin.BottomRight; + _deletedButton.PivotPoint = PivotPoint.BottomRight; + _deletedButton.PositionUsesAnchorPoint = true; + _deletedButton.Size2D = new Size2D(200, 100); + window.Add(_deletedButton); + _deletedButton.Clicked += (obj, e) => + { + OnTerminate(); + return true; + }; + + layer.Add(_container); + Tizen.Log.Debug("NUI", "### widget view manager create start"); + _widgetViewManager = new WidgetViewManager(this, "org.tizen.example.NUISamples.TizenTV"); + if (!_widgetViewManager) + { + Tizen.Log.Fatal("NUI", "### Widget is not enabled!"); + } + + Tizen.Log.Debug("NUI", "### widget view manager create sucess"); + } + + [STAThread] + static void _Main(string[] args) + { + Example example = new Example(); + example.Run(args); + } + } +} + diff --git a/test/NUITestSample/NUITestSample/res/images/Dino-Painted_lambert2SG_color.png b/test/NUITestSample/NUITestSample/res/images/Dino-Painted_lambert2SG_color.png new file mode 100755 index 000000000..3930181f8 Binary files /dev/null and b/test/NUITestSample/NUITestSample/res/images/Dino-Painted_lambert2SG_color.png differ diff --git a/test/NUITestSample/NUITestSample/res/images/Dino-Painted_lambert2SG_gloss.png b/test/NUITestSample/NUITestSample/res/images/Dino-Painted_lambert2SG_gloss.png new file mode 100755 index 000000000..0e6c95838 Binary files /dev/null and b/test/NUITestSample/NUITestSample/res/images/Dino-Painted_lambert2SG_gloss.png differ diff --git a/test/NUITestSample/NUITestSample/res/images/Dino-Painted_lambert2SG_nmap.png b/test/NUITestSample/NUITestSample/res/images/Dino-Painted_lambert2SG_nmap.png new file mode 100755 index 000000000..c2d4bf4e9 Binary files /dev/null and b/test/NUITestSample/NUITestSample/res/images/Dino-Painted_lambert2SG_nmap.png differ diff --git a/test/NUITestSample/NUITestSample/res/images/Dino2_lambert2SG_color.png b/test/NUITestSample/NUITestSample/res/images/Dino2_lambert2SG_color.png new file mode 100755 index 000000000..5ee5d2c7b Binary files /dev/null and b/test/NUITestSample/NUITestSample/res/images/Dino2_lambert2SG_color.png differ diff --git a/test/NUITestSample/NUITestSample/res/images/Dino2_lambert2SG_nmap.png b/test/NUITestSample/NUITestSample/res/images/Dino2_lambert2SG_nmap.png new file mode 100755 index 000000000..361603cfd Binary files /dev/null and b/test/NUITestSample/NUITestSample/res/images/Dino2_lambert2SG_nmap.png differ diff --git a/test/NUITestSample/NUITestSample/res/images/Kid1.svg b/test/NUITestSample/NUITestSample/res/images/Kid1.svg new file mode 100755 index 000000000..b7d547678 --- /dev/null +++ b/test/NUITestSample/NUITestSample/res/images/Kid1.svg @@ -0,0 +1,491 @@ + + + +image/svg+xml diff --git a/test/NUITestSample/NUITestSample/res/images/Mail.svg b/test/NUITestSample/NUITestSample/res/images/Mail.svg new file mode 100755 index 000000000..63fdd1f5b --- /dev/null +++ b/test/NUITestSample/NUITestSample/res/images/Mail.svg @@ -0,0 +1,170 @@ + + + +image/svg+xml \ No newline at end of file diff --git a/test/NUITestSample/NUITestSample/res/images/World.svg b/test/NUITestSample/NUITestSample/res/images/World.svg new file mode 100755 index 000000000..91aef1351 --- /dev/null +++ b/test/NUITestSample/NUITestSample/res/images/World.svg @@ -0,0 +1,284 @@ + + + +image/svg+xml \ No newline at end of file diff --git a/test/NUITestSample/NUITestSample/res/images/application-icon-0.png b/test/NUITestSample/NUITestSample/res/images/application-icon-0.png new file mode 100755 index 000000000..339b19ca5 Binary files /dev/null and b/test/NUITestSample/NUITestSample/res/images/application-icon-0.png differ diff --git a/test/NUITestSample/NUITestSample/res/images/arrow.png b/test/NUITestSample/NUITestSample/res/images/arrow.png new file mode 100755 index 000000000..87abefddf Binary files /dev/null and b/test/NUITestSample/NUITestSample/res/images/arrow.png differ diff --git a/test/NUITestSample/NUITestSample/res/images/background-blocks.jpg b/test/NUITestSample/NUITestSample/res/images/background-blocks.jpg new file mode 100755 index 000000000..d8fed652c Binary files /dev/null and b/test/NUITestSample/NUITestSample/res/images/background-blocks.jpg differ diff --git a/test/NUITestSample/NUITestSample/res/images/dali-logo-anim.gif b/test/NUITestSample/NUITestSample/res/images/dali-logo-anim.gif new file mode 100755 index 000000000..9a085ba95 Binary files /dev/null and b/test/NUITestSample/NUITestSample/res/images/dali-logo-anim.gif differ diff --git a/test/NUITestSample/NUITestSample/res/images/dog-anim.gif b/test/NUITestSample/NUITestSample/res/images/dog-anim.gif new file mode 100755 index 000000000..ddc331286 Binary files /dev/null and b/test/NUITestSample/NUITestSample/res/images/dog-anim.gif differ diff --git a/test/NUITestSample/NUITestSample/res/images/echo.gif b/test/NUITestSample/NUITestSample/res/images/echo.gif new file mode 100755 index 000000000..31b8040cf Binary files /dev/null and b/test/NUITestSample/NUITestSample/res/images/echo.gif differ diff --git a/test/NUITestSample/NUITestSample/res/images/gallery-0.jpg b/test/NUITestSample/NUITestSample/res/images/gallery-0.jpg new file mode 100755 index 000000000..e42dba762 Binary files /dev/null and b/test/NUITestSample/NUITestSample/res/images/gallery-0.jpg differ diff --git a/test/NUITestSample/NUITestSample/res/images/gallery-1.jpg b/test/NUITestSample/NUITestSample/res/images/gallery-1.jpg new file mode 100755 index 000000000..6a427adf6 Binary files /dev/null and b/test/NUITestSample/NUITestSample/res/images/gallery-1.jpg differ diff --git a/test/NUITestSample/NUITestSample/res/images/gallery-2.jpg b/test/NUITestSample/NUITestSample/res/images/gallery-2.jpg new file mode 100755 index 000000000..30b1a51ab Binary files /dev/null and b/test/NUITestSample/NUITestSample/res/images/gallery-2.jpg differ diff --git a/test/NUITestSample/NUITestSample/res/images/gallery-3.jpg b/test/NUITestSample/NUITestSample/res/images/gallery-3.jpg new file mode 100755 index 000000000..2da2ceba5 Binary files /dev/null and b/test/NUITestSample/NUITestSample/res/images/gallery-3.jpg differ diff --git a/test/NUITestSample/NUITestSample/res/images/gallery-4.jpg b/test/NUITestSample/NUITestSample/res/images/gallery-4.jpg new file mode 100755 index 000000000..902b711cb Binary files /dev/null and b/test/NUITestSample/NUITestSample/res/images/gallery-4.jpg differ diff --git a/test/NUITestSample/NUITestSample/res/images/gallery-5.jpg b/test/NUITestSample/NUITestSample/res/images/gallery-5.jpg new file mode 100755 index 000000000..490fb5669 Binary files /dev/null and b/test/NUITestSample/NUITestSample/res/images/gallery-5.jpg differ diff --git a/test/NUITestSample/NUITestSample/res/images/gallery-small-43.jpg b/test/NUITestSample/NUITestSample/res/images/gallery-small-43.jpg new file mode 100755 index 000000000..c59b841d1 Binary files /dev/null and b/test/NUITestSample/NUITestSample/res/images/gallery-small-43.jpg differ diff --git a/test/NUITestSample/NUITestSample/res/images/image-1.jpg b/test/NUITestSample/NUITestSample/res/images/image-1.jpg new file mode 100755 index 000000000..155ab30bc Binary files /dev/null and b/test/NUITestSample/NUITestSample/res/images/image-1.jpg differ diff --git a/test/NUITestSample/NUITestSample/res/images/image-2.jpg b/test/NUITestSample/NUITestSample/res/images/image-2.jpg new file mode 100755 index 000000000..e855ecfdb Binary files /dev/null and b/test/NUITestSample/NUITestSample/res/images/image-2.jpg differ diff --git a/test/NUITestSample/NUITestSample/res/images/image-3.jpg b/test/NUITestSample/NUITestSample/res/images/image-3.jpg new file mode 100755 index 000000000..8dee462e2 Binary files /dev/null and b/test/NUITestSample/NUITestSample/res/images/image-3.jpg differ diff --git a/test/NUITestSample/NUITestSample/res/images/mask.png b/test/NUITestSample/NUITestSample/res/images/mask.png new file mode 100755 index 000000000..b3e423c96 Binary files /dev/null and b/test/NUITestSample/NUITestSample/res/images/mask.png differ diff --git a/test/NUITestSample/NUITestSample/res/images/not_yet_sign.png b/test/NUITestSample/NUITestSample/res/images/not_yet_sign.png new file mode 100755 index 000000000..12b48c1d1 Binary files /dev/null and b/test/NUITestSample/NUITestSample/res/images/not_yet_sign.png differ diff --git a/test/NUITestSample/NUITestSample/res/images/star-dim.png b/test/NUITestSample/NUITestSample/res/images/star-dim.png new file mode 100755 index 000000000..38cc674e4 Binary files /dev/null and b/test/NUITestSample/NUITestSample/res/images/star-dim.png differ diff --git a/test/NUITestSample/NUITestSample/res/images/star-highlight.png b/test/NUITestSample/NUITestSample/res/images/star-highlight.png new file mode 100755 index 000000000..f99ee25bb Binary files /dev/null and b/test/NUITestSample/NUITestSample/res/images/star-highlight.png differ diff --git a/test/NUITestSample/NUITestSample/res/images/star-mod.png b/test/NUITestSample/NUITestSample/res/images/star-mod.png new file mode 100755 index 000000000..2e3212e66 Binary files /dev/null and b/test/NUITestSample/NUITestSample/res/images/star-mod.png differ diff --git a/test/NUITestSample/NUITestSample/res/images/test-image0.png b/test/NUITestSample/NUITestSample/res/images/test-image0.png new file mode 100755 index 000000000..27abbc66d Binary files /dev/null and b/test/NUITestSample/NUITestSample/res/images/test-image0.png differ diff --git a/test/NUITestSample/NUITestSample/res/images/test-image1.png b/test/NUITestSample/NUITestSample/res/images/test-image1.png new file mode 100755 index 000000000..27abbc66d Binary files /dev/null and b/test/NUITestSample/NUITestSample/res/images/test-image1.png differ diff --git a/test/NUITestSample/NUITestSample/res/images/test-image2.jpg b/test/NUITestSample/NUITestSample/res/images/test-image2.jpg new file mode 100755 index 000000000..c5273bf5c Binary files /dev/null and b/test/NUITestSample/NUITestSample/res/images/test-image2.jpg differ diff --git a/test/NUITestSample/NUITestSample/res/images/test-image3.jpg b/test/NUITestSample/NUITestSample/res/images/test-image3.jpg new file mode 100755 index 000000000..c5273bf5c Binary files /dev/null and b/test/NUITestSample/NUITestSample/res/images/test-image3.jpg differ diff --git a/test/NUITestSample/NUITestSample/res/json/control-dashboard.json b/test/NUITestSample/NUITestSample/res/json/control-dashboard.json new file mode 100755 index 000000000..c2609c423 --- /dev/null +++ b/test/NUITestSample/NUITestSample/res/json/control-dashboard.json @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2017 Samsung Electronics Co., Ltd. + * + * This file is part of Dali Toolkit + * + * 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. + */ + +{ + "styles": + { + "ProgressBar": + { + } + } +} diff --git a/test/NUITestSample/NUITestSample/res/json/date-picker-template.json b/test/NUITestSample/NUITestSample/res/json/date-picker-template.json new file mode 100755 index 000000000..79ab9a2dd --- /dev/null +++ b/test/NUITestSample/NUITestSample/res/json/date-picker-template.json @@ -0,0 +1,75 @@ +/* + * Copyright (c) 2017 Samsung Electronics Co., Ltd. + * + * 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. + * + */ +{ + // Data picker loaded directly on to the stage + // + "templates": { + "date-picker": + { + "type":"FlexContainer", + "name":"exampleDatePicker", + "flexDirection":"ROW", + "size":[480.0, 150, 0 ], + "actors": [ + { + + "type": "Spin", + "name": "Year", + "Value":2017, + "MinValue":1900, + "MaxValue":2100, + "Step":1, + "TextColor":[0.0,0.0,1.0,1.0], + "properties": { // properties registered dynamically + "flex":0.3, + "flexMargin": [5.0,0.0,5.0,0.0] + } + }, + { + + "type": "Spin", + "name": "Month", + "Value":10, + "Step":1, + "MinValue":1, + "MaxValue":12, + "TextColor":[1.0,1.0,1.0,1.0], + "properties": { // properties registered dynamically + "flex":0.3, + "flexMargin": [5.0,0.0,5.0,0.0] + } + + }, + { + + "type": "Spin", + "name": "Day", + "Value":1, + "MinValue":1, + "MaxValue":31, + "TextColor":[1.0,0.0,0.0,1.0], + "properties": { // properties registered dynamically + "flex":0.3, + "flexMargin": [5.0,0.0,5.0,0.0] + } + }] + + } +} + +} + diff --git a/test/NUITestSample/NUITestSample/res/json/date-picker-theme.json b/test/NUITestSample/NUITestSample/res/json/date-picker-theme.json new file mode 100755 index 000000000..6424a38e2 --- /dev/null +++ b/test/NUITestSample/NUITestSample/res/json/date-picker-theme.json @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2017 Samsung Electronics Co., Ltd. + * + * This file is part of Dali Toolkit + * + * 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. + */ + +{ + "styles": { + "Spin": { + "MinValue": 0, + "MaxValue": 100, + "Value": 50, + "Step": 1, + "TextColor": [ 1.0, 0.0, 0.0, 1.0 ] + } + } +} diff --git a/test/NUITestSample/NUITestSample/res/json/date-picker.json b/test/NUITestSample/NUITestSample/res/json/date-picker.json new file mode 100755 index 000000000..3126aa39b --- /dev/null +++ b/test/NUITestSample/NUITestSample/res/json/date-picker.json @@ -0,0 +1,82 @@ +/* + * Copyright (c) 2014 Samsung Electronics Co., Ltd. + * + * 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. + * + */ +{ + // Data picker loaded directly on to the stage + // + "stage": [{ + + "type":"FlexContainer", + "name":"exampleDatePicker", + "parentOrigin": "CENTER", + "anchorPoint": "CENTER", + "flexDirection":"ROW", + "size":[480.0, 150, 0 ], + "actors": [ + { + + "type": "Spin", + "name": "Year", + "parentOrigin": "CENTER", + "anchorPoint": "CENTER", + "MinValue":1900, + "MaxValue":2100, + "Value":2017, + "Step":1, + "TextColor":[0.0,0.0,1.0,1.0], + "properties": { // properties registered dynamically + "flex":0.3, + "flexMargin": [5.0,0.0,5.0,0.0] + } + }, + { + + "type": "Spin", + "name": "Month", + "parentOrigin": "CENTER", + "anchorPoint": "CENTER", + "parentOrigin": "CENTER", + "Step":1, + "MinValue":1, + "MaxValue":12, + "Value":10, + "TextColor":[1.0,1.0,1.0,1.0], + "properties": { // properties registered dynamically + "flex":0.3, + "flexMargin": [5.0,0.0,5.0,0.0] + } + + }, + { + + "type": "Spin", + "name": "Day", + "parentOrigin": "CENTER", + "anchorPoint": "CENTER", + "MinValue":1, + "MaxValue":31, + "Value":1, + "TextColor":[1.0,0.0,0.0,1.0], + "properties": { // properties registered dynamically + "flex":0.3, + "flexMargin": [5.0,0.0,5.0,0.0] + } + }] + +}] + +} + diff --git a/test/NUITestSample/NUITestSample/res/json/spin.json b/test/NUITestSample/NUITestSample/res/json/spin.json new file mode 100755 index 000000000..df9b10caf --- /dev/null +++ b/test/NUITestSample/NUITestSample/res/json/spin.json @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2014 Samsung Electronics Co., Ltd. + * + * 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. + * + */ +{ + // a tree of actors + "stage": [ + // You can add an array of Actors / Views here + // Lets add a spin to the stage + { + "type":"Spin", + "parentOrigin":"CENTER", + "size":[120,120,0] + // now lets use the C# app json-loader.exe to load it + } + + ] +} diff --git a/test/NUITestSample/NUITestSample/res/json/style-example-theme-one.json b/test/NUITestSample/NUITestSample/res/json/style-example-theme-one.json new file mode 100755 index 000000000..5f0ef9467 --- /dev/null +++ b/test/NUITestSample/NUITestSample/res/json/style-example-theme-one.json @@ -0,0 +1,407 @@ +{ + "constants": { + "STYLE_DIR": "{APPLICATION_RESOURCE_PATH}/style" + }, + "styles": { + "Title": { + "textColor": "#0000ff", + "background": { + "visualType": "COLOR", + "mixColor": [ 1.0, 1.0, 1.0, 1.0 ] + } + }, + "TableView": { + "background": { + "visualType": "COLOR", + "mixColor": [ 1.0, 1.0, 1.0, 0.03 ] + } + }, + "FlexContainer": { + "background": { + "visualType": "COLOR", + "mixColor": [ 1.0, 1.0, 1.0, 0.1 ] + } + }, + "RadioButton": { + "label": { + "textColor": [ 1, 1, 1, 1 ] + } + }, + "CheckBoxButton": { + "label": { + "textColor": [ 1, 1, 1, 1 ] + } + }, + "ColorLabel1": { + "textColor": [ 1, 0, 0, 1 ] + }, + "ColorLabel2": { + "textColor": [ 0, 1, 0, 1 ] + }, + "ColorLabel3": { + "textColor": [ 0.3, 0.3, 1, 1 ] + }, + "ThemeLabel": { + "textColor": [ 0, 1, 1, 1 ] + }, + "PopupTitle": { + "textColor": [ 1, 1, 1, 1 ] + }, + "PopupBody": { + "textColor": [ 1, 1, 0, 1 ] + }, + "TextLabel": { + "textColor": [ 0, 0, 0, 1 ] + }, + "ColorSlider1": { + "styles": [ "Slider" ] + }, + "ColorSlider2": { + "styles": [ "slider" ] + }, + "ColorSlider3": { + "styles": [ "slider" ] + }, + "ImageChannelControl": { + "enableVisibilityTransition": [ + { + "target": "imageVisual", + "property": "opacity", + "initialValue": 0, + "targetValue": 1, + "animator": { + "alphaFunction": "EASE_IN_OUT", + "timePeriod": { + "duration": 0.25, + "delay": 0 + } + } + }, + { + "target": "imageVisual", + "property": "size", + "targetValue": [ 1, 1 ] + } + ], + "disableVisibilityTransition": [ + { + "target": "imageVisual", + "property": "opacity", + "targetValue": 0, + "animator": { + "alphaFunction": "EASE_IN_OUT", + "timePeriod": { + "duration": 0.25, + "delay": 0 + } + } + }, + { + "target": "imageVisual", + "property": "size", + "targetValue": [ 1, 1, 1 ] + } + ] + }, + "ShadowButton": { + "backgroundVisual": { + "visualType": "IMAGE", + "url": "{STYLE_DIR}/images/shadowButtonBg.9.png", + "mixColor": [ 1, 1, 1, 0 ] + }, + "checkboxBgVisual": { + "visualType": "IMAGE", + "url": "{STYLE_DIR}/images/CheckBg.png", + "transform": { + "size": [ 0.09, 0.28 ], + "offset": [ 30, 0 ], + "offsetSizeMode": [ 1, 1, 0, 0 ], + "origin": "CENTER_BEGIN", + "anchorPoint": "CENTER_BEGIN" + } + }, + "checkboxFgVisual": { + "visualType": "IMAGE", + "url": "{STYLE_DIR}/images/Tick.png", + "transform": { + "size": [ 0.09, 0.28 ], + "offset": [ 30, 0 ], + "offsetSizeMode": [ 1, 1, 0, 0 ], + "origin": "CENTER_BEGIN", + "anchorPoint": "CENTER_BEGIN" + } + }, + "labelVisual": { + "visualType": "TEXT", + "text": "Don't show again", + "pointSize": 20, + "horizontalAlignment": "END", + "verticalAlignment": "CENTER", + "textColor": [ 1, 1, 1, 1 ], + "mixColor": [ 0.3, 0.3, 0.3, 1 ], + "transform": { + "size": [ 0.9, 0.9 ], + "offset": [ -30, 0 ], + "offsetSizeMode": [ 1, 1, 0, 0 ], + "origin": "CENTER_END", + "anchorPoint": "CENTER_END" + } + }, + "activeTransition": [ + { + "target": "checkboxBgVisual", + "property": "size", + "initialValue": [ 0.09, 0.28 ], + "targetValue": [ 0.12, 0.37 ], + "animator": { + "alphaFunction": "EASE_OUT_BACK", + "timePeriod": { + "duration": 0.8, + "delay": 0 + } + } + }, + { + "target": "backgroundVisual", + "property": "mixColor", + "initialValue": [ 1, 1, 1, 0 ], + "targetValue": [ 1, 1, 1, 1 ], + "animator": { + "alphaFunction": "EASE_OUT_BACK", + "timePeriod": { + "duration": 0.8, + "delay": 0 + } + } + }, + { + "target": "backgroundVisual", + "property": "size", + "initialValue": [ 0.9, 0.9 ], + "targetValue": [ 1, 1 ], + "animator": { + "alphaFunction": "EASE_OUT_BACK", + "timePeriod": { + "duration": 0.8, + "delay": 0 + } + } + }, + { + "target": "checkboxFgVisual", + "property": "size", + "initialValue": [ 0.09, 0.28 ], + "targetValue": [ 0.12, 0.37 ], + "animator": { + "alphaFunction": "EASE_OUT_BACK", + "timePeriod": { + "duration": 0.8, + "delay": 0 + } + } + }, + { + "target": "labelVisual", + "property": "mixColor", + "initialValue": [ 0.2, 0.2, 0.2, 1.0 ], + "targetValue": [ 0, 0, 0, 1 ], + "animator": { + "alphaFunction": "EASE_OUT_BACK", + "timePeriod": { + "duration": 0.8, + "delay": 0 + } + } + } + ], + "inactiveTransition": [ + { + "target": "checkboxBgVisual", + "property": "size", + "initialValue": [ 0.12, 0.37 ], + "targetValue": [ 0.09, 0.28 ], + "animator": { + "alphaFunction": "EASE_OUT_BACK", + "timePeriod": { + "duration": 0.8, + "delay": 0 + } + } + }, + { + "target": "backgroundVisual", + "property": "mixColor", + "targetValue": [ 1, 1, 1, 0 ], + "animator": { + "alphaFunction": "EASE_OUT_BACK", + "timePeriod": { + "duration": 0.8, + "delay": 0 + } + } + }, + { + "target": "checkboxFgVisual", + "property": "size", + "initialValue": [ 0.12, 0.37 ], + "targetValue": [ 0.09, 0.28 ], + "animator": { + "alphaFunction": "EASE_OUT_BACK", + "timePeriod": { + "duration": 0.8, + "delay": 0 + } + } + }, + { + "target": "labelVisual", + "property": "mixColor", + "targetValue": [ 0.4, 0.4, 0.4, 1.0 ], + "animator": { + "alphaFunction": "EASE_OUT_BACK", + "timePeriod": { + "duration": 0.8, + "delay": 0 + } + } + }, + { + "target": "backgroundVisual", + "property": "size", + "targetValue": [ 0.9, 0.9 ], + "animator": { + "alphaFunction": "EASE_OUT_BACK", + "timePeriod": { + "duration": 0.8, + "delay": 0 + } + } + } + ], + "checkTransition": [ + { + "target": "checkboxFgVisual", + "property": "pixelArea", + "initialValue": [ 0.0, 0.0, 0.0, 1.0 ], + "targetValue": [ 0.0, 0.0, 1.0, 1.0 ], + "animator": { + "alphaFunction": "EASE_IN", + "timePeriod": { + "duration": 0.4, + "delay": 0 + } + } + }, + { + "target": "checkboxFgVisual", + "property": "size", + "initialValue": [ 0.0, 0.37 ], + "targetValue": [ 0.12, 0.37 ], + "animator": { + "alphaFunction": "EASE_IN", + "timePeriod": { + "duration": 0.4, + "delay": 0 + } + } + } + ], + "uncheckTransition": [ + { + "target": "checkboxFgVisual", + "property": "pixelArea", + "initialValue": [ 0.0, 0.0, 1.0, 1.0 ], + "targetValue": [ 0.0, 0.0, 0.0, 1.0 ], + "animator": { + "alphaFunction": "EASE_OUT", + "timePeriod": { + "duration": 0.4, + "delay": 0 + } + } + }, + { + "target": "checkboxFgVisual", + "property": "size", + "targetValue": [ 0.0, 0.37 ], + "animator": { + "alphaFunction": "EASE_OUT", + "timePeriod": { + "duration": 0.4, + "delay": 0 + } + } + } + ] + }, + "BeatControl": { + "beatVisual": { + "visualType": "IMAGE", + "url": "{APPLICATION_RESOURCE_PATH}/images/Logo-for-demo.png" + }, + + "bounceTransition": [ + { + "target": "beatVisual", + "property": "size", + "initialValue": [ 0.5, 0.5 ], + "targetValue": [ 0.75, 0.75 ], + "animator": { + "alphaFunction": "BOUNCE", + "timePeriod": { + "duration": 0.5, + "delay": 0 + } + } + } + ], + + "leftTransition": [ + { + "target": "beatVisual", + "property": "offset", + "initialValue": [ 0, 0 ], + "targetValue": [ 0.25, 0 ], + "animator": { + "alphaFunction": "BOUNCE", + "timePeriod": { + "duration": 0.5, + "delay": 0 + } + } + } + ], + + "upTransition": [ + { + "target": "beatVisual", + "property": "offset", + "initialValue": [ 0, 0 ], + "targetValue": [ 0, 0.25 ], + "animator": { + "alphaFunction": "BOUNCE", + "timePeriod": { + "duration": 0.5, + "delay": 0 + } + } + } + ], + + "fadeTransition": [ + { + "target": "beatVisual", + "property": "opacity", + "targetValue": 0, + "animator": { + "alphaFunction": "BOUNCE", + "timePeriod": { + "duration": 0.8, + "delay": 0 + } + } + } + ] + } + } +} \ No newline at end of file diff --git a/test/NUITestSample/NUITestSample/res/models/Dino.mtl b/test/NUITestSample/NUITestSample/res/models/Dino.mtl new file mode 100755 index 000000000..049595a66 --- /dev/null +++ b/test/NUITestSample/NUITestSample/res/models/Dino.mtl @@ -0,0 +1,11 @@ +newmtl lambert2SG +illum 4 +Kd 0.00 0.00 0.00 +Ka 0.00 0.00 0.00 +Tf 1.00 1.00 1.00 +map_Kd Dino-Painted_lambert2SG_color.png +bump Dino-Painted_lambert2SG_nmap.png -bm 0.05 +Ni 1.00 +Ks 0.00 0.00 0.00 +map_Ks Dino-Painted_lambert2SG_gloss.png +Ns 100.00 diff --git a/test/Tizen.Tapitest/CallgsmPage.cs b/test/Tizen.Tapitest/CallgsmPage.cs deleted file mode 100755 index 2e0deea99..000000000 --- a/test/Tizen.Tapitest/CallgsmPage.cs +++ /dev/null @@ -1,727 +0,0 @@ -using System; -using Xamarin.Forms; -using Tizen; -using Tizen.Tapi; -using System.Threading.Tasks; -using System.Collections.Generic; -using System.Linq; - -namespace XamarinForTizen.Tizen -{ - public class CallPage : ContentPage - { - Call call = null; - uint incomingCallHandle = 0; - uint activeCallHandle = 0; - uint heldCallHandle = 0; - Entry entry; - string num; - - Notification[] arrNoti = { Notification.NetworkDefaultSubscription, Notification.IdleVoiceCall , Notification.ActiveVoiceCall, Notification.HeldVoiceCall, Notification.DialingVoiceCall, - Notification.AlertVoiceCall, Notification.IncomingVoiceCall, Notification.HeldCallInfo, Notification.ActiveCallInfo, - Notification.JoinedCallInfo, Notification.CallSoundRingbackTone, Notification.CallSoundWbamr, Notification.CallSoundPath, Notification.CallPreferredVoiceSubscription}; - public CallPage() - { - try - { - call = new Call(Globals.handleModem0); - RegisterNotiCallEvents(Globals.handleModem0); - } - - catch(Exception ex) - { - Log.Debug(Globals.LogTag, "Call constructor throws exception = " + ex.ToString()); - } - - var dialCallBtn = new Button - { - Text = "DialCall", - VerticalOptions = LayoutOptions.Start, - HorizontalOptions = LayoutOptions.FillAndExpand - }; - dialCallBtn.Clicked += DialCallBtn_Clicked; - - var ansCallBtn = new Button - { - Text = "AnswerCall", - VerticalOptions = LayoutOptions.Start, - HorizontalOptions = LayoutOptions.FillAndExpand - }; - ansCallBtn.Clicked += AnsCallBtn_Clicked; - - var endCallBtn = new Button - { - Text = "EndCall", - VerticalOptions = LayoutOptions.Start, - HorizontalOptions = LayoutOptions.FillAndExpand - }; - endCallBtn.Clicked += EndCallBtn_Clicked; - - var holdCallBtn = new Button - { - Text = "HoldCall", - VerticalOptions = LayoutOptions.Start, - HorizontalOptions = LayoutOptions.FillAndExpand - }; - holdCallBtn.Clicked += HoldCallBtn_Clicked; - - var activeCallBtn = new Button - { - Text = "ActiveCall", - VerticalOptions = LayoutOptions.Start, - HorizontalOptions = LayoutOptions.FillAndExpand - }; - activeCallBtn.Clicked += ActiveCallBtn_Clicked; - - var swapCallBtn = new Button - { - Text = "SwapCall", - VerticalOptions = LayoutOptions.Start, - HorizontalOptions = LayoutOptions.FillAndExpand - }; - swapCallBtn.Clicked += SwapCallBtn_Clicked; - - var joinCallBtn = new Button - { - Text = "JoinCall", - VerticalOptions = LayoutOptions.Start, - HorizontalOptions = LayoutOptions.FillAndExpand - }; - joinCallBtn.Clicked += JoinCallBtn_Clicked; - - var splitCallBtn = new Button - { - Text = "SplitCall", - VerticalOptions = LayoutOptions.Start, - HorizontalOptions = LayoutOptions.FillAndExpand - }; - splitCallBtn.Clicked += SplitCallBtn_Clicked; - - var transferCallBtn = new Button - { - Text = "TransferCall", - VerticalOptions = LayoutOptions.Start, - HorizontalOptions = LayoutOptions.FillAndExpand - }; - transferCallBtn.Clicked += TransferCallBtn_Clicked; - - var setMuteStBtn = new Button - { - Text = "SetCallMuteStatus", - VerticalOptions = LayoutOptions.Start, - HorizontalOptions = LayoutOptions.FillAndExpand - }; - setMuteStBtn.Clicked += SetMuteStBtn_Clicked; - - var getMuteStBtn = new Button - { - Text = "GetCallMuteStatus", - VerticalOptions = LayoutOptions.Start, - HorizontalOptions = LayoutOptions.FillAndExpand - }; - getMuteStBtn.Clicked += GetMuteStBtn_Clicked; - - var setVolumeInfoBtn = new Button - { - Text = "SetCallVolumeInfo", - VerticalOptions = LayoutOptions.Start, - HorizontalOptions = LayoutOptions.FillAndExpand - }; - setVolumeInfoBtn.Clicked += SetVolumeInfoBtn_Clicked; - - var getVolumeInfoBtn = new Button - { - Text = "GetCallVolumeInfo", - VerticalOptions = LayoutOptions.Start, - HorizontalOptions = LayoutOptions.FillAndExpand - }; - getVolumeInfoBtn.Clicked += GetVolumeInfoBtn_Clicked; - - var setSoundPathBtn = new Button - { - Text = "SetCallSoundPath", - VerticalOptions = LayoutOptions.Start, - HorizontalOptions = LayoutOptions.FillAndExpand - }; - setSoundPathBtn.Clicked += SetSoundPathBtn_Clicked; - - var getCallBtn = new Button - { - Text = "GetCallStatus", - VerticalOptions = LayoutOptions.Start, - HorizontalOptions = LayoutOptions.FillAndExpand - }; - getCallBtn.Clicked += GetCallBtn_Clicked; - - var getAllCallBtn = new Button - { - Text = "GetAllCallStatus", - VerticalOptions = LayoutOptions.Start, - HorizontalOptions = LayoutOptions.FillAndExpand - }; - getAllCallBtn.Clicked += GetAllCallBtn_Clicked; - - var startstopContDtmfBtn = new Button - { - Text = "StartStopContDtmf", - VerticalOptions = LayoutOptions.Start, - HorizontalOptions = LayoutOptions.FillAndExpand - }; - startstopContDtmfBtn.Clicked += StartStopContDtmfBtn_Clicked; - - var sendBurstDtmfBtn = new Button - { - Text = "SendBurstDtmf", - VerticalOptions = LayoutOptions.Start, - HorizontalOptions = LayoutOptions.FillAndExpand - }; - sendBurstDtmfBtn.Clicked += SendBurstDtmfBtn_Clicked; - - var preferredCallSubscriptionBtn = new Button - { - Text = "SetGetPreferredVoicesubscription", - VerticalOptions = LayoutOptions.Start, - HorizontalOptions = LayoutOptions.FillAndExpand - }; - preferredCallSubscriptionBtn.Clicked += PreferredSubscriptionBtn_Clicked; - - entry = new Entry - { - IsVisible = false, - Keyboard = Keyboard.Telephone, - Placeholder = "Enter phone number", - HeightRequest = 80, - BackgroundColor = new Color(255,255,255) - }; - entry.Completed += Entry_Completed; - - ScrollView scrollView = new ScrollView() - { - Content = new StackLayout - { - VerticalOptions = LayoutOptions.Center, - Children = { - getCallBtn, getAllCallBtn, preferredCallSubscriptionBtn, dialCallBtn, entry, ansCallBtn, endCallBtn, holdCallBtn, activeCallBtn, swapCallBtn, joinCallBtn, transferCallBtn, - startstopContDtmfBtn, sendBurstDtmfBtn, splitCallBtn, setMuteStBtn, getMuteStBtn, setVolumeInfoBtn, getVolumeInfoBtn, setSoundPathBtn - } - }, - VerticalOptions = LayoutOptions.Center - }; - - Content = scrollView; - } - - private async void ActiveCallBtn_Clicked(object sender, EventArgs e) - { - try - { - Log.Debug(Globals.LogTag, "Activate call start"); - uint x = await call.ActiveCall(heldCallHandle); - Log.Debug(Globals.LogTag, "Activate call end, call id = " + x); - } - - catch (Exception ex) - { - Log.Debug(Globals.LogTag, "Activate call ,exception = " + ex.ToString()); - } - } - - private async void HoldCallBtn_Clicked(object sender, EventArgs e) - { - try - { - Log.Debug(Globals.LogTag, "Hold call start"); - uint x = await call.HoldCall(activeCallHandle); - Log.Debug(Globals.LogTag, "Hold call end, call id = " + x); - } - - catch (Exception ex) - { - Log.Debug(Globals.LogTag, "Hold call ,exception = " + ex.ToString()); - } - } - - private async void EndCallBtn_Clicked(object sender, EventArgs e) - { - try - { - var action = await DisplayActionSheet("Operation", "Cancel", null, Enum.GetNames(typeof(CallEndType))); - Log.Debug(Globals.LogTag, "Action: " + action); - if (action != null) - { - Log.Debug(Globals.LogTag, "End call start"); - CallEndType type = (CallEndType)Enum.Parse(typeof(CallEndType), action); - CallEndData data = await call.EndCall(activeCallHandle, type); - Log.Debug(Globals.LogTag, "End call success, call id = " + data.Id + ", end type = " + data.Type); - } - } - - catch (Exception ex) - { - Log.Debug(Globals.LogTag, "End call ,exception = " + ex.ToString()); - } - } - - private async void AnsCallBtn_Clicked(object sender, EventArgs e) - { - try - { - var action = await DisplayActionSheet("Operation", "Cancel", null, Enum.GetNames(typeof(CallAnswerType))); - Log.Debug(Globals.LogTag, "Action: " + action); - if (action != null) - { - Log.Debug(Globals.LogTag, "Answer call start .. incoming call id = "+incomingCallHandle); - CallAnswerType type = (CallAnswerType)Enum.Parse(typeof(CallAnswerType), action); - uint x = await call.AnswerCall(incomingCallHandle, type); - Log.Debug(Globals.LogTag, "Answer call end, call id = " + x); - } - } - - catch(Exception ex) - { - Log.Debug(Globals.LogTag, "AnswerCall ,exception = " + ex.ToString()); - } - } - - private void DialCallBtn_Clicked(object sender, EventArgs e) - { - try - { - Log.Debug(Globals.LogTag, "Dial call start"); - entry.IsVisible = true; - } - - catch (Exception ex) - { - Log.Debug(Globals.LogTag, "Dial call ,exception = " + ex.ToString()); - } - } - - private async void Entry_Completed(object sender, EventArgs e) - { - try - { - num = entry.Text; - entry.IsVisible = false; - entry.ClearValue(Entry.TextProperty); - Log.Debug(Globals.LogTag, "Phone Number entered = " + num); - var action = await DisplayActionSheet("Operation", "Cancel", null, Enum.GetNames(typeof(CallType))); - Log.Debug(Globals.LogTag, "Action: " + action); - if (action != null) - { - CallType type = (CallType)Enum.Parse(typeof(CallType), action); - CallInformation info = new CallInformation(type, EmergencyType.Default, num); - await call.DialCall(info); - Log.Debug(Globals.LogTag, "Dial call end"); - } - } - - catch(Exception ex) - { - Log.Debug(Globals.LogTag, "Entry_Completed Dial call ,exception = " + ex.ToString()); - } - } - - private void GetCallBtn_Clicked(object sender, EventArgs e) - { - try - { - Log.Debug(Globals.LogTag, "GetCallStatus call start"); - CallStatus data = call.GetCallStatus((int)activeCallHandle); - Log.Debug(Globals.LogTag, "GetCallStatus call end, callstatus, id = " + data.CallHandle + ",number = " + data.PhoneNumber + ",volte call =" + data.IsVolteCall + - ",state = " + data.State + ",type = " + data.Type + ",conference call = " + data.IsConferenceState + ",Mo call = " + data.IsMoCall); - } - - catch(Exception ex) - { - Log.Debug(Globals.LogTag, "GetCallStatus ,exception = " + ex.ToString()); - } - } - - private void GetAllCallBtn_Clicked(object sender, EventArgs e) - { - try - { - Log.Debug(Globals.LogTag, "GetAllCallStatus call start"); - List callStatusList = call.GetAllCallStatus().ToList(); - if (callStatusList.Count > 0) - { - foreach (CallStatus stat in callStatusList) - { - Log.Debug(Globals.LogTag, "isconference = " + stat.IsConferenceState + ", handle =" + stat.CallHandle + ", type =" + stat.Type); - Log.Debug(Globals.LogTag, "ismocall = " + stat.IsMoCall + ", isvoltecall =" + stat.IsVolteCall); - Log.Debug(Globals.LogTag, "number = " + stat.PhoneNumber + ", state =" + stat.State); - } - } - - else - { - Log.Debug(Globals.LogTag, "There are no current calls !!"); - } - - Log.Debug(Globals.LogTag, "GetAllCallStatus call end"); - } - - catch(Exception ex) - { - Log.Debug(Globals.LogTag, "GetAllCallStatus ,exception = " + ex.ToString()); - } - } - - private async void SwapCallBtn_Clicked(object sender, EventArgs e) - { - try - { - Log.Debug(Globals.LogTag, "Swap call start"); - uint p = activeCallHandle; - uint q = heldCallHandle; - uint x = await call.SwapCall(activeCallHandle, heldCallHandle); - await Task.Delay(3000); - if (p == heldCallHandle && q == activeCallHandle) - { - Log.Debug(Globals.LogTag, "Swap call ends with success, call id = "+x); - } - - else - { - Log.Debug(Globals.LogTag, "Swap call gets failed"); - } - } - - catch (Exception ex) - { - Log.Debug(Globals.LogTag, "Swap call ,exception = " + ex.ToString()); - } - } - - private async void JoinCallBtn_Clicked(object sender, EventArgs e) - { - try - { - Log.Debug(Globals.LogTag, "Join call start"); - uint x = await call.JoinCall(activeCallHandle, heldCallHandle); - Log.Debug(Globals.LogTag, "Join call ends with success, call id = "+x); - } - - catch (Exception ex) - { - Log.Debug(Globals.LogTag, "Join call ,exception = " + ex.ToString()); - } - } - - private async void SplitCallBtn_Clicked(object sender, EventArgs e) - { - try - { - Log.Debug(Globals.LogTag, "Split call start"); - var action = await DisplayActionSheet("Operation", "Cancel", null, "Active call", "Held Call"); - Log.Debug(Globals.LogTag, "Action: " + action); - if (action != null) - { - uint handle; - if (action == "Active call") - handle = activeCallHandle; - else - handle = heldCallHandle; - uint x = await call.SplitCall(handle); - Log.Debug(Globals.LogTag, "Split call ends with success, call id = " + x); - } - } - - catch (Exception ex) - { - Log.Debug(Globals.LogTag, "Split call ,exception = " + ex.ToString()); - } - } - - private async void TransferCallBtn_Clicked(object sender, EventArgs e) - { - try - { - Log.Debug(Globals.LogTag, "Transfer call starts"); - uint x = await call.TransferCall(activeCallHandle); - Log.Debug(Globals.LogTag, "Transfer call ends with success, call id = " + x); - } - - catch (Exception ex) - { - Log.Debug(Globals.LogTag, "Transfer call ,exception = " + ex.ToString()); - } - } - - private async void SetVolumeInfoBtn_Clicked(object sender, EventArgs e) - { - try - { - Log.Debug(Globals.LogTag, "Set call volume info start"); - var actionDev = await DisplayActionSheet("Device", "Cancel", null, Enum.GetNames(typeof(SoundDevice))); - var actionType = await DisplayActionSheet("Type", "Cancel", null, Enum.GetNames(typeof(SoundType))); - var actionVolume = await DisplayActionSheet("Volume", "Cancel", null, Enum.GetNames(typeof(SoundVolume))); - Log.Debug(Globals.LogTag, "Action: Device = " + actionDev + ", type = " + actionType +", Volume = " + actionVolume); - if (actionDev != null && actionType != null && actionVolume != null) - { - SoundDevice device = (SoundDevice)Enum.Parse(typeof(SoundDevice), actionDev); - SoundType type = (SoundType)Enum.Parse(typeof(SoundType), actionType); - SoundVolume volume = (SoundVolume)Enum.Parse(typeof(SoundVolume), actionVolume); - CallVolumeRecord volumeRecord = new CallVolumeRecord(device, type, volume); - await call.SetCallVolumeInfo(volumeRecord); - Log.Debug(Globals.LogTag, "Set call volume info ends with success"); - } - } - - catch (Exception ex) - { - Log.Debug(Globals.LogTag, "Set call volume info ,exception = " + ex.ToString()); - } - } - - private async void GetVolumeInfoBtn_Clicked(object sender, EventArgs e) - { - try - { - Log.Debug(Globals.LogTag, "Get call volume info start"); - var actionDev = await DisplayActionSheet("Device", "Cancel", null, Enum.GetNames(typeof(SoundDevice))); - var actionType = await DisplayActionSheet("Type", "Cancel", null, Enum.GetNames(typeof(SoundType))); - Log.Debug(Globals.LogTag, "Action: Device = " + actionDev + ", type = " + actionType); - if (actionDev != null && actionType != null) - { - SoundDevice device = (SoundDevice)Enum.Parse(typeof(SoundDevice), actionDev); - SoundType type = (SoundType)Enum.Parse(typeof(SoundType), actionType); - CallVolumeInfo info = await call.GetCallVolumeInfo(device, type); - Log.Debug(Globals.LogTag, "Get call volume info ends with success, id = "+info.RecordId); - var list = info.Records.ToList(); - if(list != null) - { - foreach(CallVolumeRecord record in list) - { - Log.Debug(Globals.LogTag, "Callvolumerecord: device = " + record.Device + ",type = "+record.Type +", volume = "+ record.Volume); - } - } - } - } - - catch (Exception ex) - { - Log.Debug(Globals.LogTag, "Get call volume info ,exception = " + ex.ToString()); - } - } - - private async void SetMuteStBtn_Clicked(object sender, EventArgs e) - { - try - { - Log.Debug(Globals.LogTag, "Set call mute status start"); - var actionPath = await DisplayActionSheet("Path", "Cancel", null, Enum.GetNames(typeof(SoundMutePath))); - var actionSt = await DisplayActionSheet("Mute Status", "Cancel", null, Enum.GetNames(typeof(SoundMuteStatus))); - Log.Debug(Globals.LogTag, "Action: path = " + actionPath + ", mute status = "+ actionSt); - if (actionPath != null && actionSt != null) - { - SoundMutePath path = (SoundMutePath)Enum.Parse(typeof(SoundMutePath), actionPath); - SoundMuteStatus status = (SoundMuteStatus)Enum.Parse(typeof(SoundMuteStatus), actionSt); - CallMuteStatusRecord record = new CallMuteStatusRecord(path, status); - await call.SetCallMuteStatus(record); - Log.Debug(Globals.LogTag, "Set call mute status ends"); - } - } - - catch (Exception ex) - { - Log.Debug(Globals.LogTag, "Set mute status, exception = " + ex.ToString()); - } - } - - private async void GetMuteStBtn_Clicked(object sender, EventArgs e) - { - try - { - Log.Debug(Globals.LogTag, "Get call mute status start"); - CallMuteStatusRecord record = await call.GetCallMuteStatus(); - Log.Debug(Globals.LogTag, "Get call mute status ends, mute status = "+ record.Status + ", mute path = " + record.Path); - } - - catch (Exception ex) - { - Log.Debug(Globals.LogTag, "Get mute status, exception = " + ex.ToString()); - } - } - - private async void StartStopContDtmfBtn_Clicked(object sender, EventArgs e) - { - try - { - Log.Debug(Globals.LogTag, "Continuous Dtmf starts"); - await call.StartContDtmfCall(1); - await Task.Delay(15000); - await call.StopContDtmfCall(); - Log.Debug(Globals.LogTag, "Continuous Dtmf stops"); - } - - catch (Exception ex) - { - Log.Debug(Globals.LogTag, "Start and stop continuous Dtmf, exception = " + ex.ToString()); - } - } - - private async void SendBurstDtmfBtn_Clicked(object sender, EventArgs e) - { - try - { - Log.Debug(Globals.LogTag, "Send burst Dtmf starts"); - var actionWidth = await DisplayActionSheet("Width", "Cancel", null, Enum.GetNames(typeof(CallDtmfPulseWidth))); - var actionInterval = await DisplayActionSheet("Interval", "Cancel", null, Enum.GetNames(typeof(CallDtmfDigitInterval))); - Log.Debug(Globals.LogTag, "Action: width = " + actionWidth + ", interval = " + actionInterval); - if (actionWidth != null && actionInterval != null) - { - CallDtmfPulseWidth width = (CallDtmfPulseWidth)Enum.Parse(typeof(CallDtmfPulseWidth), actionWidth); - CallDtmfDigitInterval interval = (CallDtmfDigitInterval)Enum.Parse(typeof(CallDtmfDigitInterval), actionInterval); - CallBurstDtmfData data = new CallBurstDtmfData("12345", width, interval); - await call.SendBurstDtmfCall(data); - Log.Debug(Globals.LogTag, "Send burst Dtmf ends"); - } - } - - catch (Exception ex) - { - Log.Debug(Globals.LogTag, "Send burst Dtmf, exception = " + ex.ToString()); - } - } - - private async void SetSoundPathBtn_Clicked(object sender, EventArgs e) - { - try - { - Log.Debug(Globals.LogTag, "Set call sound path start"); - var actionPath = await DisplayActionSheet("Operation", "Cancel", null, Enum.GetNames(typeof(SoundPath))); - var actionVolume = await DisplayActionSheet("Operation", "Cancel", null, Enum.GetNames(typeof(ExtraVolume))); - Log.Debug(Globals.LogTag, "Action: Path = " + actionPath + ", Volume = "+ actionVolume); - if (actionPath != null && actionVolume != null) - { - SoundPath path = (SoundPath)Enum.Parse(typeof(SoundPath), actionPath); - ExtraVolume volume = (ExtraVolume)Enum.Parse(typeof(ExtraVolume), actionVolume); - CallSoundPathInfo pathInfo = new CallSoundPathInfo(path, volume); - await call.SetCallSoundPath(pathInfo); - Log.Debug(Globals.LogTag, "Set call sound path ends with success"); - } - } - - catch (Exception ex) - { - Log.Debug(Globals.LogTag, "Set call sound path,exception = " + ex.ToString()); - } - } - - public async void PreferredSubscriptionBtn_Clicked(object sender, EventArgs e) - { - try - { - var action = await DisplayActionSheet("Operation", "Cancel", null, Enum.GetNames(typeof(CallPreferredVoiceSubscription))); - Log.Debug(Globals.LogTag, "Action: " + action); - if (action != null) - { - CallPreferredVoiceSubscription subscription = (CallPreferredVoiceSubscription)Enum.Parse(typeof(CallPreferredVoiceSubscription), action); - Log.Debug(Globals.LogTag, "CallPreferredVoiceSubscription start -- Set subscription to "+ subscription); - await call.SetCallPreferredVoiceSubscription(subscription); - CallPreferredVoiceSubscription subs = call.GetCallPreferredVoiceSubscription(); - Log.Debug(Globals.LogTag, "Current CallPreferredVoiceSubscription = " + subs); - if (subs == subscription) - Log.Debug(Globals.LogTag, "CallPreferredVoiceSubscription set and get subscription is successful"); - else - Log.Debug(Globals.LogTag, "CallPreferredVoiceSubscription set and get subscription has failed"); - } - } - - catch (Exception ex) - { - Log.Debug(Globals.LogTag, "PreferredVoiceSubscription ,exception = " + ex.ToString()); - } - } - - private void RegisterNotiCallEvents(TapiHandle handle) - { - handle.PropertyChanged += Handle_CallPropertyChanged; - - handle.NotificationChanged += Handle_CallNotificationChanged; - foreach (Notification i in arrNoti) - { - handle.RegisterNotiEvent(i); - } - handle.RegisterPropEvent(Property.NetworkPsType); - } - - private void Handle_CallPropertyChanged(object sender, PropertyChangedEventArgs e) - { - Log.Debug(Globals.LogTag, "Handle_CallPropertyChanged event receive, " + e.Property + e.Data); - } - - private void Handle_CallNotificationChanged(object sender, NotificationChangedEventArgs e) - { - try - { - Notification id = e.Id; - Log.Debug(Globals.LogTag, "Handle_CallNotificationChanged event receive, Notification Value = " + id); - switch (id) - { - case Notification.NetworkDefaultSubscription: - Log.Debug(Globals.LogTag, "Notification.NetworkDefaultSubscription event receive , data =" +e.Data); - break; - case Notification.IdleVoiceCall: - Log.Debug(Globals.LogTag, "Notification.IdleVoiceCall event receive"); - CallIdleStatusNotificationData status = (CallIdleStatusNotificationData)e.Data; - Log.Debug(Globals.LogTag, "CallIdleStatusNotificationData , notiid = " + status.NotiId + ", end cause = " + status.EndCause); - break; - case Notification.ActiveVoiceCall: - activeCallHandle = (uint)e.Data; - Log.Debug(Globals.LogTag, "Notification.ActiveVoiceCall event receive, notiid = " + e.Id + ", callid= " + activeCallHandle); - break; - case Notification.HeldVoiceCall: - heldCallHandle = (uint)e.Data; - Log.Debug(Globals.LogTag, "Notification.HeldVoiceCall event receive, notiid = " + e.Id + ", callid= " + heldCallHandle); - break; - case Notification.AlertVoiceCall: - Log.Debug(Globals.LogTag, "Notification.AlertVoiceCall event receive, notiid = " + e.Id + ", callid= " + e.Data); - break; - case Notification.DialingVoiceCall: - Log.Debug(Globals.LogTag, "Notification.DialingVoiceCall event receive, notiid = " + e.Id + ", callid= " + e.Data); - break; - case Notification.IncomingVoiceCall: - Log.Debug(Globals.LogTag, "Notification.IncomingVoiceCall event receive"); - CallIncomingInfo info = (CallIncomingInfo)e.Data; - incomingCallHandle = info.CallHandle; - Log.Debug(Globals.LogTag, "CallIncomingInfo data , callid = " + incomingCallHandle + ", callernumber = " + info.CallerNumber + ", calltype= " + info.CallType - + ", callmode = " + info.CliMode + ", active line = " + info.ActiveLine + ", nocli cause = " + info.CliCause + ",isfwded = " + info.IsForwarded - + ", name = " + info.NameInfo.Name + ", namemode = " + info.NameInfo.NameMode); - break; - case Notification.HeldCallInfo: - Log.Debug(Globals.LogTag, "Notification.HeldCallInfo event receive, notiid = " + e.Id + ", data= " + e.Data); - break; - case Notification.ActiveCallInfo: - Log.Debug(Globals.LogTag, "Notification.ActiveCallInfo event receive, notiid = " + e.Id + ", data= " + e.Data); - break; - case Notification.JoinedCallInfo: - Log.Debug(Globals.LogTag, "Notification.JoinedCallInfo event receive, notiid = " + e.Id + ", data= " + e.Data); - break; - case Notification.CallSoundRingbackTone: - Log.Debug(Globals.LogTag, "Notification.CallSoundRingbackTone event receive, notiid = " + e.Id + ", data= " + e.Data); - break; - case Notification.CallPreferredVoiceSubscription: - Log.Debug(Globals.LogTag, "Notification.CallPreferredVoiceSubscription event receive, notiid = " + e.Id + ", data= " + e.Data); - break; - case Notification.CallSoundWbamr: - Log.Debug(Globals.LogTag, "Notification.CallSoundWbamr event receive, notiid = " + e.Id + ", data= " + e.Data); - break; - case Notification.CallSoundPath: - Log.Debug(Globals.LogTag, "Notification.CallSoundPath event receive, notiid = " + e.Id + ", data= " + e.Data); - break; - } - - Log.Debug(Globals.LogTag, "Handle_CallNotificationChanged event receive end"); - } - - catch (Exception ex) - { - Log.Debug(Globals.LogTag, "Handle_CallNotificationChanged event exception = "+ex.ToString()); - } - } - - } -} diff --git a/test/Tizen.Tapitest/CommonPage.cs b/test/Tizen.Tapitest/CommonPage.cs deleted file mode 100755 index 338a0af19..000000000 --- a/test/Tizen.Tapitest/CommonPage.cs +++ /dev/null @@ -1,259 +0,0 @@ -using System; -using System.Collections.Generic; -using Xamarin.Forms; -using Tizen.Tapi; -using Tizen; -using System.Linq; - -namespace XamarinForTizen.Tizen -{ - public class CommonPage : ContentPage - { - List cplist = new List(); - public CommonPage() - { - var cpNameBtn = new Button - { - Text = "CPName", - VerticalOptions = LayoutOptions.Start, - HorizontalOptions = LayoutOptions.FillAndExpand - }; - cpNameBtn.Clicked += cpNameBtn_Clicked; - - var initBtn0 = new Button - { - Text = "InitTapimodem0", - VerticalOptions = LayoutOptions.Start, - HorizontalOptions = LayoutOptions.FillAndExpand - }; - initBtn0.Clicked += initBtn0_Clicked; - - var initBtn1 = new Button - { - Text = "InitTapimodem1", - VerticalOptions = LayoutOptions.Start, - HorizontalOptions = LayoutOptions.FillAndExpand - }; - initBtn1.Clicked += initBtn1_Clicked; - - var deinitBtn0 = new Button - { - Text = "DeinitTapimodem0", - VerticalOptions = LayoutOptions.Start, - HorizontalOptions = LayoutOptions.FillAndExpand - }; - deinitBtn0.Clicked += deinitBtn0_Clicked; - - var deinitBtn1 = new Button - { - Text = "DeinitTapimodem1", - VerticalOptions = LayoutOptions.Start, - HorizontalOptions = LayoutOptions.FillAndExpand - }; - deinitBtn1.Clicked += deinitBtn1_Clicked; - - var getIntPropBtn = new Button - { - Text = "GetIntProperty", - VerticalOptions = LayoutOptions.Start, - HorizontalOptions = LayoutOptions.FillAndExpand - }; - getIntPropBtn.Clicked += GetIntPropBtn_Clicked; - - var getStrPropBtn = new Button - { - Text = "GetStringProperty", - VerticalOptions = LayoutOptions.Start, - HorizontalOptions = LayoutOptions.FillAndExpand - }; - getStrPropBtn.Clicked += GetStrPropBtn_Clicked; - - var getReadyBtn = new Button - { - Text = "GetReadyState", - VerticalOptions = LayoutOptions.Start, - HorizontalOptions = LayoutOptions.FillAndExpand - }; - getReadyBtn.Clicked += GetReadyBtn_Clicked; - - Content = new StackLayout - { - VerticalOptions = LayoutOptions.Center, - Children = { - cpNameBtn, initBtn0, deinitBtn0, initBtn1, deinitBtn1, getIntPropBtn, getStrPropBtn, getReadyBtn - } - }; - } - - private void GetReadyBtn_Clicked(object sender, EventArgs e) - { - //Get the state of Tapi - int s = TapiManager.State; - if (s == 0) - Log.Debug(Globals.LogTag, "Tapi state, result = false"); - else if (s == 1) - Log.Debug(Globals.LogTag, "Tapi state, result = true"); - else - Log.Debug(Globals.LogTag, "Tapi state, result = " + s); - } - - private async void GetStrPropBtn_Clicked(object sender, EventArgs e) - { - try - { - var action = await DisplayActionSheet("Operation", "Cancel", null, "Network Name", "Network Spn Name", "Network Name Option"); - Log.Debug(Globals.LogTag, "Action: " + action); - if (action != null) - { - Property p = Property.NetworkPlmn; - if (action == "Network Name") - p = Property.NetworkName; - else if (action == "Network Spn Name") - p = Property.NetworkSpnName; - else if (action == "Network Name Option") - p = Property.NetworkNameOption; - if (Globals.handleModem0 != null) - { - string val = Globals.handleModem0.GetStringProperty(p); - Log.Debug(Globals.LogTag, "String property result = " + val); - } - else if (Globals.handleModem1 != null) - { - string val = Globals.handleModem1.GetStringProperty(p); - Log.Debug(Globals.LogTag, "String property result = " + val); - } - } - } - - catch (Exception ex) - { - Log.Debug(Globals.LogTag, "GetStringProperty tapi exception = " + ex.ToString()); - } - } - - private async void GetIntPropBtn_Clicked(object sender, EventArgs e) - { - try - { - var action = await DisplayActionSheet("Operation", "Cancel", null, "Ps Type", "Power", "Dongle Status"); - Log.Debug(Globals.LogTag, "Action: " + action); - if (action != null) - { - Property p = Property.NetworkPlmn; - if (action == "Ps Type") - p = Property.NetworkPsType; - else if (action == "Power") - p = Property.ModemPower; - else if (action == "Dongle Status") - p = Property.ModemDongleStatus; - if (Globals.handleModem0 != null) - { - int val = Globals.handleModem0.GetIntProperty(p); - Log.Debug(Globals.LogTag, "Int property result = " + val); - } - else if (Globals.handleModem1 != null) - { - int val = Globals.handleModem1.GetIntProperty(p); - Log.Debug(Globals.LogTag, "Int property result = " + val); - } - } - } - - catch (Exception ex) - { - Log.Debug(Globals.LogTag, "GetIntProperty tapi exception = " + ex.ToString()); - } - } - - private void deinitBtn1_Clicked(object sender, EventArgs e) - { - try - { - if (Globals.handleModem1 != null) - { - TapiManager.DeinitTapi(Globals.handleModem1); - Log.Debug(Globals.LogTag, "Deinit tapi is successful"); - } - else - Log.Debug(Globals.LogTag, "TapiHandle is null"); - } - - catch (Exception ex) - { - Log.Debug(Globals.LogTag, "inside deinit tapi exception = " + ex.ToString()); - } - } - - private void deinitBtn0_Clicked(object sender, EventArgs e) - { - try - { - if (Globals.handleModem0 != null) - { - TapiManager.DeinitTapi(Globals.handleModem0); - Log.Debug(Globals.LogTag, "Deinit tapi is successful"); - } - else - Log.Debug(Globals.LogTag, "TapiHandle is null"); - } - - catch (Exception ex) - { - Log.Debug(Globals.LogTag, "inside deinit tapi exception = " + ex.ToString()); - } - } - - private void initBtn1_Clicked(object sender, EventArgs e) - { - try - { - Globals.handleModem1 = TapiManager.InitTapi(cplist[1]); - if (Globals.handleModem1 == null) - Log.Debug(Globals.LogTag, "Init tapi is not successful and TapiHandle is null"); - else - Log.Debug(Globals.LogTag, "Init tapi is successful"); - } - - catch (Exception ex) - { - Log.Debug(Globals.LogTag, "inside init tapi exception = " + ex.ToString()); - } - } - - private void initBtn0_Clicked(object sender, EventArgs e) - { - try - { - Globals.handleModem0 = TapiManager.InitTapi(cplist[0]); - if (Globals.handleModem0 == null) - Log.Debug(Globals.LogTag, "Init tapi is not successful and TapiHandle is null"); - else - Log.Debug(Globals.LogTag, "Init tapi is successful"); - } - - catch (Exception ex) - { - Log.Debug(Globals.LogTag, "inside init tapi exception = " + ex.ToString()); - } - } - - private void cpNameBtn_Clicked(object sender, EventArgs e) - { - try - { - cplist = TapiManager.GetCpNames().ToList(); - if (cplist != null) - { - Log.Debug(Globals.LogTag, "inside common button clicked "); - for (int i = 0; i < cplist.Count; i++) - Log.Debug(Globals.LogTag, "Cp name = " + cplist[i]); - } - } - - catch (Exception ex) - { - Log.Debug(Globals.LogTag, "Getcpnames throw exception = " + ex.ToString()); - } - } - } -} diff --git a/test/Tizen.Tapitest/MainPage.cs b/test/Tizen.Tapitest/MainPage.cs deleted file mode 100755 index ca3d1e283..000000000 --- a/test/Tizen.Tapitest/MainPage.cs +++ /dev/null @@ -1,110 +0,0 @@ -using System; -using Xamarin.Forms; - -namespace XamarinForTizen.Tizen -{ - public class MainPage : ContentPage - { - public MainPage() - { - var commonBtn = new Button - { - Text = "Common", - VerticalOptions = LayoutOptions.Start, - HorizontalOptions = LayoutOptions.FillAndExpand - }; - commonBtn.Clicked += CommonBtn_Clicked; - - var callgsmBtn = new Button - { - Text = "Call-Gsm", - VerticalOptions = LayoutOptions.Start, - HorizontalOptions = LayoutOptions.FillAndExpand - }; - callgsmBtn.Clicked += CallgsmBtn_Clicked; - - var modemBtn = new Button - { - Text = "Modem", - VerticalOptions = LayoutOptions.Start, - HorizontalOptions = LayoutOptions.FillAndExpand - }; - modemBtn.Clicked += ModemBtn_Clicked; - - var nwBtn = new Button - { - Text = "Network", - VerticalOptions = LayoutOptions.Start, - HorizontalOptions = LayoutOptions.FillAndExpand - }; - nwBtn.Clicked += NwBtn_Clicked; - - var simBtn = new Button - { - Text = "Sim", - VerticalOptions = LayoutOptions.Start, - HorizontalOptions = LayoutOptions.FillAndExpand - }; - simBtn.Clicked += simBtn_Clicked; - - var phonebookBtn = new Button - { - Text = "Phonebook", - VerticalOptions = LayoutOptions.Start, - HorizontalOptions = LayoutOptions.FillAndExpand - }; - phonebookBtn.Clicked += phonebookBtn_Clicked; - - var ssBtn = new Button - { - Text = "Ss", - VerticalOptions = LayoutOptions.Start, - HorizontalOptions = LayoutOptions.FillAndExpand - }; - ssBtn.Clicked += ssBtn_Clicked; - - Content = new StackLayout - { - VerticalOptions = LayoutOptions.Center, - Children = { - commonBtn, callgsmBtn, modemBtn, nwBtn, simBtn, phonebookBtn, ssBtn - } - }; - } - - private async void ssBtn_Clicked(object sender, EventArgs e) - { - await Navigation.PushAsync(new SsPage()); - } - - private async void phonebookBtn_Clicked(object sender, EventArgs e) - { - await Navigation.PushAsync(new PhonebookPage()); - } - - private async void simBtn_Clicked(object sender, EventArgs e) - { - await Navigation.PushAsync(new SimPage()); - } - - private async void NwBtn_Clicked(object sender, EventArgs e) - { - await Navigation.PushAsync(new NetworkPage()); - } - - private async void CallgsmBtn_Clicked(object sender, EventArgs e) - { - await Navigation.PushAsync(new CallPage()); - } - - private async void ModemBtn_Clicked(object sender, EventArgs e) - { - await Navigation.PushAsync(new ModemPage()); - } - - private async void CommonBtn_Clicked(object sender, EventArgs e) - { - await Navigation.PushAsync(new CommonPage()); - } - } -} diff --git a/test/Tizen.Tapitest/ModemPage.cs b/test/Tizen.Tapitest/ModemPage.cs deleted file mode 100755 index 451d424a1..000000000 --- a/test/Tizen.Tapitest/ModemPage.cs +++ /dev/null @@ -1,294 +0,0 @@ -using System; -using Xamarin.Forms; -using Tizen; -using Tizen.Tapi; -using System.Threading.Tasks; - -namespace XamarinForTizen.Tizen -{ - public class ModemPage : ContentPage - { - Modem modem = null; - public ModemPage() - { - try - { - modem = new Modem(Globals.handleModem0); - } - - catch(Exception ex) - { - Log.Debug(Globals.LogTag, "Modem constructor throws exception = " + ex.ToString()); - } - - var processPowerCommandBtn = new Button - { - Text = "ProcessPowerCommand", - VerticalOptions = LayoutOptions.Start, - HorizontalOptions = LayoutOptions.FillAndExpand - }; - processPowerCommandBtn.Clicked += processPowerBtn_Clicked; - - var flightModeBtn = new Button - { - Text = "SetGetFlightMode", - VerticalOptions = LayoutOptions.Start, - HorizontalOptions = LayoutOptions.FillAndExpand - }; - flightModeBtn.Clicked += FlightModeBtn_Clicked; - - var miscMeVersionBtn = new Button - { - Text = "GetMiscMeVersion_async_and_sync", - VerticalOptions = LayoutOptions.Start, - HorizontalOptions = LayoutOptions.FillAndExpand - }; - miscMeVersionBtn.Clicked += MiscVersionBtn_Clicked; - - var miscMeSnBtn = new Button - { - Text = "GetMiscMeSn_async_and_sync", - VerticalOptions = LayoutOptions.Start, - HorizontalOptions = LayoutOptions.FillAndExpand - }; - miscMeSnBtn.Clicked += MiscMeSnBtn_Clicked; - - var miscMeImeiBtn = new Button - { - Text = "GetMiscMeImei_async_and_sync", - VerticalOptions = LayoutOptions.Start, - HorizontalOptions = LayoutOptions.FillAndExpand - }; - miscMeImeiBtn.Clicked += MiscMeImeiBtn_Clicked; - - var checkPowerBtn = new Button - { - Text = "CheckPowerStatus", - VerticalOptions = LayoutOptions.Start, - HorizontalOptions = LayoutOptions.FillAndExpand - }; - checkPowerBtn.Clicked += CheckPowerBtn_Clicked; - - var deviceInfoBtn = new Button - { - Text = "GetDeviceInfo", - VerticalOptions = LayoutOptions.Start, - HorizontalOptions = LayoutOptions.FillAndExpand - }; - deviceInfoBtn.Clicked += DeviceInfoBtn_Clicked; - - Content = new StackLayout - { - VerticalOptions = LayoutOptions.Center, - Children = { - processPowerCommandBtn, flightModeBtn, miscMeVersionBtn, miscMeSnBtn, miscMeImeiBtn, checkPowerBtn, deviceInfoBtn - } - }; - } - - private async void DeviceInfoBtn_Clicked(object sender, EventArgs e) - { - try - { - Log.Debug(Globals.LogTag, "GetDeviceInfo call start"); - MiscDeviceInfo info = await modem.GetDeviceInfo(); - if (info!= null) - { - Log.Debug(Globals.LogTag, "MiscDeviceInfo data is -- "); - Log.Debug(Globals.LogTag, "DeviceName = " + info.DeviceName); - Log.Debug(Globals.LogTag, "VendorName = " + info.VendorName); - } - Log.Debug(Globals.LogTag, "GetDeviceInfo call end"); - } - - catch (Exception ex) - { - Log.Debug(Globals.LogTag, "Getdeviceinfo ,exception = " + ex.ToString()); - } - } - - private void CheckPowerBtn_Clicked(object sender, EventArgs e) - { - try - { - Log.Debug(Globals.LogTag, "CheckPowerStatus call start"); - PhonePowerStatus status = modem.CheckPowerStatus(); - Log.Debug(Globals.LogTag, "power status = " + status); - Log.Debug(Globals.LogTag, "CheckPowerStatus call end"); - } - - catch (Exception ex) - { - Log.Debug(Globals.LogTag, "CheckPowerStatus ,exception = " + ex.ToString()); - } - } - - private async void MiscMeImeiBtn_Clicked(object sender, EventArgs e) - { - try - { - Log.Debug(Globals.LogTag, "GetMiscMeImei async call start"); - string info = await modem.GetMiscMeImei(); - if (info != null) - { - Log.Debug(Globals.LogTag, "MiscImei number is -- " + info); - } - - Log.Debug(Globals.LogTag, "GetMiscMeImei async call end"); - Log.Debug(Globals.LogTag, "GetMiscMeImei sync call start"); - string infosync = modem.MiscMeImeiSync; - if (infosync != null) - { - Log.Debug(Globals.LogTag, "MiscImei number is -- " +infosync); - } - - Log.Debug(Globals.LogTag, "GetMiscMeImei sync call end"); - } - - catch (Exception ex) - { - Log.Debug(Globals.LogTag, "GetMiscMeImei ,exception = " + ex.ToString()); - } - } - - private async void MiscMeSnBtn_Clicked(object sender, EventArgs e) - { - try - { - Log.Debug(Globals.LogTag, "GetMiscMeSn async call start"); - MiscSerialNumberInformation info = await modem.GetMiscMeSn(); - if (info != null) - { - Log.Debug(Globals.LogTag, "MiscSerialNumberInformation data is -- "); - Log.Debug(Globals.LogTag, "Esn = " + info.Esn); - Log.Debug(Globals.LogTag, "Imei = " + info.Imei); - Log.Debug(Globals.LogTag, "ImeiSv = " + info.ImeiSv); - Log.Debug(Globals.LogTag, "Meid = " + info.MeId); - } - - Log.Debug(Globals.LogTag, "GetMiscMeSn async call end"); - Log.Debug(Globals.LogTag, "GetMiscMeSn sync call start"); - MiscSerialNumberInformation infosync = modem.MiscMeSnSync; - if (infosync != null) - { - Log.Debug(Globals.LogTag, "MiscSerialNumberInformation data is -- "); - Log.Debug(Globals.LogTag, "Esn = " + infosync.Esn); - Log.Debug(Globals.LogTag, "Imei = " + infosync.Imei); - Log.Debug(Globals.LogTag, "ImeiSv = " + infosync.ImeiSv); - Log.Debug(Globals.LogTag, "Meid = " + infosync.MeId); - } - - Log.Debug(Globals.LogTag, "GetMiscMeSn sync call end"); - } - - catch (Exception ex) - { - Log.Debug(Globals.LogTag, "GetMiscMeSn ,exception = " + ex.ToString()); - } - } - - private async void FlightModeBtn_Clicked(object sender, EventArgs e) - { - try - { - Log.Debug(Globals.LogTag, "Modem flightmode call start"); - await modem.SetFlightMode(PowerFlightModeRequest.Enter); - Log.Debug(Globals.LogTag, "Modem flightmode set Enter success"); - bool isFlightMode = await modem.GetFlightMode(); - Log.Debug(Globals.LogTag, "Modem flightmode get success , flightmode = "+ isFlightMode); - await modem.SetFlightMode(PowerFlightModeRequest.Leave); - Log.Debug(Globals.LogTag, "Modem flightmode set Leave success"); - isFlightMode = await modem.GetFlightMode(); - Log.Debug(Globals.LogTag, "Modem flightmode get success , flightmode = " + isFlightMode); - } - - catch (Exception ex) - { - Log.Debug(Globals.LogTag, "Modem flightmode ,exception = " + ex.ToString()); - } - } - - private async void processPowerBtn_Clicked(object sender, EventArgs e) - { - TapiHandle handle = Globals.handleModem0; - try - { - handle.NotificationChanged += Handle_NotiPowerStatusChanged; - handle.RegisterNotiEvent(Notification.ModemPower); - Log.Debug(Globals.LogTag, "Modem powercommand call start"); - await modem.ProcessPowerCommand(PhonePowerCommand.Off); - Log.Debug(Globals.LogTag, "Modem powercommand call off success"); - } - - catch(Exception ex) - { - Log.Debug(Globals.LogTag, "Modem processpower command ,exception = " + ex.ToString()); - } - - finally - { - handle.DeregisterNotiEvent(Notification.ModemPower); - handle.NotificationChanged -= Handle_NotiPowerStatusChanged; - } - } - - private async void MiscVersionBtn_Clicked(object sender, EventArgs e) - { - try - { - Log.Debug(Globals.LogTag, "GetMiscMeVersion async call start"); - MiscVersionInformation info = await modem.GetMiscMeVersion(); - if (info!=null) - { - Log.Debug(Globals.LogTag, "MiscVersionInformation data is -- "); - Log.Debug(Globals.LogTag, "Version = " + info.VersionMask.ToString()); - Log.Debug(Globals.LogTag, "CalculationDate = " + info.CalculationDate); - Log.Debug(Globals.LogTag, "Erinam = " + info.EriNam.ToString()); - Log.Debug(Globals.LogTag, "EriVersion = " + info.EriVersion); - Log.Debug(Globals.LogTag, "Hwversion = " + info.HwVersion); - Log.Debug(Globals.LogTag, "Swversion = " + info.SwVersion); - Log.Debug(Globals.LogTag, "ModelId = " + info.ModelId); - Log.Debug(Globals.LogTag, "Prlnam = " + info.PrlNam.ToString()); - Log.Debug(Globals.LogTag, "Prlversion = " + info.PrlVersion); - Log.Debug(Globals.LogTag, "Productcode = " + info.ProductCode); - } - - Log.Debug(Globals.LogTag, "GetMiscMeVersion async call end"); - Log.Debug(Globals.LogTag, "GetMiscMeVersion sync call start"); - MiscVersionInformation infosync = modem.MiscMeVersionSync; - if (infosync != null) - { - Log.Debug(Globals.LogTag, "MiscVersionInformation data is -- "); - Log.Debug(Globals.LogTag, "Version = " + infosync.VersionMask.ToString()); - Log.Debug(Globals.LogTag, "CalculationDate = " + infosync.CalculationDate); - Log.Debug(Globals.LogTag, "Erinam = " + infosync.EriNam.ToString()); - Log.Debug(Globals.LogTag, "EriVersion = " + infosync.EriVersion); - Log.Debug(Globals.LogTag, "Hwversion = " + infosync.HwVersion); - Log.Debug(Globals.LogTag, "Swversion = " + infosync.SwVersion); - Log.Debug(Globals.LogTag, "ModelId = " + infosync.ModelId); - Log.Debug(Globals.LogTag, "Prlnam = " + infosync.PrlNam.ToString()); - Log.Debug(Globals.LogTag, "Prlversion = " + infosync.PrlVersion); - Log.Debug(Globals.LogTag, "Productcode = " + infosync.ProductCode); - } - - Log.Debug(Globals.LogTag, "GetMiscMeVersion sync call end"); - } - - catch(Exception ex) - { - Log.Debug(Globals.LogTag, "GetMiscMeVersion ,exception = " + ex.ToString()); - } - } - - private void Handle_PropertyPowerStatusChanged(object sender, PropertyChangedEventArgs e) - { - Log.Debug(Globals.LogTag, "Handle_PropertyPowerStatusChanged event receive"); - //Log.Debug(Globals.LogTag, "Handle_PropertyPowerStatusChanged event receive, status = " + e.Data + e.Property); - } - - private void Handle_NotiPowerStatusChanged(object sender, NotificationChangedEventArgs e) - { - Log.Debug(Globals.LogTag, "Handle_NotiPowerStatusChanged event receive, status = " + e.Data + ", Notification Value = " +e.Id); - } - } -} diff --git a/test/Tizen.Tapitest/NetworkPage.cs b/test/Tizen.Tapitest/NetworkPage.cs deleted file mode 100755 index 3b7174b67..000000000 --- a/test/Tizen.Tapitest/NetworkPage.cs +++ /dev/null @@ -1,602 +0,0 @@ -using Xamarin.Forms; -using Tizen.Tapi; -using System; -using Tizen; -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; - -namespace XamarinForTizen.Tizen -{ - public class NetworkPage : ContentPage - { - Network network = null; - double height = 62.0; - Notification[] arrNoti = { Notification.NetworkCellInfo, Notification.NetworkRegistrationStatus, Notification.NetworkIdentity, Notification.NetworkChange, Notification.NetworkDefaultDataSubscription, Notification.NetworkDefaultSubscription }; - Property[] arrProp = { Property.NetworkCellId, Property.NetworkSignalLevel, Property.NetworkPsType, Property.NetworkName, Property.NetworkCircuitStatus, - Property.NetworkNameOption, Property.NetworkPlmn, Property.NetworkServiceType, Property.NetworkPacketStatus}; - public NetworkPage() - { - try - { - network = new Network(Globals.handleModem0); - RegisterNwEvents(Globals.handleModem0); - } - - catch (Exception ex) - { - Log.Debug(Globals.LogTag, "Network constructor throws exception = " + ex.ToString()); - } - - var searchNwBtn = new Button - { - Text = "SearchNetwork", - VerticalOptions = LayoutOptions.Start, - HorizontalOptions = LayoutOptions.FillAndExpand, - HeightRequest = height - }; - searchNwBtn.Clicked += SearchNwBtn_Clicked; - - var selectAutoNwBtn = new Button - { - Text = "SelectAutoNetwork", - VerticalOptions = LayoutOptions.Start, - HorizontalOptions = LayoutOptions.FillAndExpand, - HeightRequest = height - }; - selectAutoNwBtn.Clicked += SelectAutoNwBtn_Clicked; - - var selectManualNwBtn = new Button - { - Text = "SelectManualNetwork", - VerticalOptions = LayoutOptions.Start, - HorizontalOptions = LayoutOptions.FillAndExpand, - HeightRequest = height - }; - selectManualNwBtn.Clicked += SelectManualNwBtn_Clicked; - - var getNwModeBtn = new Button - { - Text = "GetNetworkSelectionMode", - VerticalOptions = LayoutOptions.Start, - HorizontalOptions = LayoutOptions.FillAndExpand, - HeightRequest = height - }; - getNwModeBtn.Clicked += GetNwModeBtn_Clicked; - - var getPrefPlmnBtn = new Button - { - Text = "GetPreferredPlmn", - VerticalOptions = LayoutOptions.Start, - HorizontalOptions = LayoutOptions.FillAndExpand, - HeightRequest = height - }; - getPrefPlmnBtn.Clicked += GetPrefPlmnBtn_Clicked; - - var setPrefPlmnBtn = new Button - { - Text = "SetPreferredPlmn", - VerticalOptions = LayoutOptions.Start, - HorizontalOptions = LayoutOptions.FillAndExpand, - HeightRequest = height - }; - setPrefPlmnBtn.Clicked += SetPrefPlmnBtn_Clicked; - - var cancelSearchBtn = new Button - { - Text = "CancelSearch", - VerticalOptions = LayoutOptions.Start, - HorizontalOptions = LayoutOptions.FillAndExpand, - HeightRequest = height - }; - cancelSearchBtn.Clicked += CancelSearchBtn_Clicked; - - var getServBtn = new Button - { - Text = "GetNetworkServing", - VerticalOptions = LayoutOptions.Start, - HorizontalOptions = LayoutOptions.FillAndExpand, - HeightRequest = height - }; - getServBtn.Clicked += GetServBtn_Clicked; - - var setgetModeBtn = new Button - { - Text = "SetGetNetworkMode", - VerticalOptions = LayoutOptions.Start, - HorizontalOptions = LayoutOptions.FillAndExpand, - HeightRequest = height - }; - setgetModeBtn.Clicked += SetGetModeBtn_Clicked; - - var getNeighborBtn = new Button - { - Text = "GetNeighborCell", - VerticalOptions = LayoutOptions.Start, - HorizontalOptions = LayoutOptions.FillAndExpand, - HeightRequest = height - }; - getNeighborBtn.Clicked += GetNeighborBtn_Clicked; - - var setemergencyBtn = new Button - { - Text = "SetEmergency", - VerticalOptions = LayoutOptions.Start, - HorizontalOptions = LayoutOptions.FillAndExpand, - HeightRequest = height - }; - setemergencyBtn.Clicked += SetEmergencyModeBtn_Clicked; - - var setgetRoamPrefBtn = new Button - { - Text = "SetGetRoamPreference", - VerticalOptions = LayoutOptions.Start, - HorizontalOptions = LayoutOptions.FillAndExpand, - HeightRequest = height - }; - setgetRoamPrefBtn.Clicked += SetGetRoamPrefBtn_Clicked; - - var setgetDataSubsBtn = new Button - { - Text = "SetGetDefaultDataSubscription", - VerticalOptions = LayoutOptions.Start, - HorizontalOptions = LayoutOptions.FillAndExpand, - HeightRequest = height - }; - setgetDataSubsBtn.Clicked += SetGetDataSubsBtn_Clicked; - - var setgetNwSubsBtn = new Button - { - Text = "SetGetDefaultSubscription", - VerticalOptions = LayoutOptions.Start, - HorizontalOptions = LayoutOptions.FillAndExpand, - HeightRequest = height - }; - setgetNwSubsBtn.Clicked += SetGetNwSubsBtn_Clicked; - - Content = new StackLayout - { - VerticalOptions = LayoutOptions.Center, - Children = { - searchNwBtn, selectAutoNwBtn, selectManualNwBtn, getNwModeBtn, getPrefPlmnBtn, setPrefPlmnBtn, cancelSearchBtn , getServBtn , - setgetModeBtn, getNeighborBtn, setemergencyBtn, setgetRoamPrefBtn, setgetDataSubsBtn, setgetNwSubsBtn - } - }; - } - - private void RegisterNwEvents(TapiHandle handle) - { - handle.PropertyChanged += Handle_NwPropertyChanged; - - handle.NotificationChanged += Handle_NwNotificationChanged; - foreach (Notification i in arrNoti) - { - handle.RegisterNotiEvent(i); - } - - foreach (Property i in arrProp) - { - handle.RegisterPropEvent(i); - } - } - - private void Handle_NwNotificationChanged(object sender, NotificationChangedEventArgs e) - { - try - { - Log.Debug(Globals.LogTag, "Handle_NwNotificationChanged event receive, Notification Value = " + e.Id); - switch (e.Id) - { - case Notification.NetworkCellInfo: - NetworkCellNoti data = (NetworkCellNoti)e.Data; - Log.Debug(Globals.LogTag, "NetworkCellInfo event receive, Lac = " + data.Lac + ", cell id = " + data.CellId); - break; - case Notification.NetworkRegistrationStatus: - NetworkRegistrationStatus status = (NetworkRegistrationStatus)e.Data; - Log.Debug("NetworkRegistrationStatus event receive , circuit status = ", status.CircuitStatus + ", isroaming = " + status.IsRoaming + ", packetstatus = " + status.PacketStatus + ", type = " + status.Type); - break; - case Notification.NetworkIdentity: - NetworkIdentityNoti noti = (NetworkIdentityNoti)e.Data; - Log.Debug("NetworkIdentity event receive , fullname = ", noti.FullName + ", plmn = " + noti.Plmn + ", shortname = " + noti.ShortName); - break; - case Notification.NetworkChange: - NetworkChangeNoti changeNoti = (NetworkChangeNoti)e.Data; - Log.Debug("NetworkChange event receive , plmn = ", changeNoti.Plmn + ", act = " + changeNoti.Act); - break; - case Notification.NetworkDefaultDataSubscription: - Log.Debug(Globals.LogTag, "NetworkDefaultDataSubscription event receive, data = " + e.Data); - break; - case Notification.NetworkDefaultSubscription: - Log.Debug(Globals.LogTag, "NetworkDefaultSubscription event receive, data = " + e.Data); - break; - } - } - - catch (Exception ex) - { - Log.Debug(Globals.LogTag, "Handle_NwNotificationChanged event exception = " + ex.ToString()); - } - } - - private void Handle_NwPropertyChanged(object sender, PropertyChangedEventArgs e) - { - try - { - Log.Debug(Globals.LogTag, "Handle_NwPropertyChanged property receive, Property Value = " + e.Property); - switch (e.Property) - { - case Property.NetworkSignalLevel: - Log.Debug(Globals.LogTag, "NetworkSignalLevel property receive, data = " + e.Data); - break; - case Property.NetworkPsType: - Log.Debug(Globals.LogTag, "NetworkPsType property receive, data = " + e.Data); - break; - case Property.NetworkCellId: - Log.Debug(Globals.LogTag, "NetworkCellId property receive, data = " + (uint)e.Data); - break; - case Property.NetworkCircuitStatus: - Log.Debug(Globals.LogTag, "NetworkCircuitStatus property receive, data = " + e.Data); - break; - case Property.NetworkPacketStatus: - Log.Debug(Globals.LogTag, "NetworkPacketStatus property receive, data = " + e.Data); - break; - case Property.NetworkPlmn: - Log.Debug(Globals.LogTag, "NetworkPacketStatus property receive, data = " + e.Data); - break; - case Property.NetworkName: - Log.Debug(Globals.LogTag, "NetworkName property receive, data = " + e.Data); - break; - case Property.NetworkNameOption: - Log.Debug(Globals.LogTag, "NetworkNameOption property receive, data = " + e.Data); - break; - case Property.NetworkServiceType: - Log.Debug(Globals.LogTag, "NetworkServiceType property receive, data = " + e.Data); - break; - } - } - - catch (Exception ex) - { - Log.Debug(Globals.LogTag, "Handle_NwPropertyChanged event exception = " + ex.ToString()); - } - } - - private async void SearchNwBtn_Clicked(object sender, EventArgs e) - { - try - { - Log.Debug(Globals.LogTag, "SearchNetwork start"); - NetworkPlmnList list = await network.SearchNetwork(); - if (list != null) - { - Log.Debug(Globals.LogTag, "SearchNetwork list is not null"); - Log.Debug(Globals.LogTag, "nwcount = " + list.NetworkCount); - List idList = list.NetworkList.ToList(); - foreach (NetworkIdentity i in idList) - { - Log.Debug(Globals.LogTag, "name = " + i.Name); - Log.Debug(Globals.LogTag, "plmn = " + i.Plmn); - Log.Debug(Globals.LogTag, "plmnid = " + i.PlmnId); - Log.Debug(Globals.LogTag, "plmntype = " + i.PlmnType); - Log.Debug(Globals.LogTag, "serviceprovidername = " + i.ServiceProviderName); - Log.Debug(Globals.LogTag, "system type = " + i.SystemType); - } - } - - Log.Debug(Globals.LogTag, "SearchNetwork end"); - } - - catch (Exception ex) - { - Log.Debug(Globals.LogTag, "SearchNetwork ,exception = " + ex.ToString()); - } - } - - private async void SetPrefPlmnBtn_Clicked(object sender, EventArgs e) - { - try - { - Log.Debug(Globals.LogTag, "SetNetworkPreferredPlmn start"); - var action = await DisplayActionSheet("Operation", "Cancel", null, Enum.GetNames(typeof(NetworkPreferredPlmnOp))); - Log.Debug(Globals.LogTag, "Action: " + action); - if (action != null) - { - NetworkPreferredPlmnOp operation = (NetworkPreferredPlmnOp)Enum.Parse(typeof(NetworkPreferredPlmnOp), action); - if (operation == NetworkPreferredPlmnOp.Add) - { - NetworkPreferredPlmnInfo info = new NetworkPreferredPlmnInfo(); - info.Index = 0; - info.Plmn = "45000"; - info.SystemType = NetworkSystemType.Gsm; - info.NetworkName = "AAA"; - info.ServiceProviderName = "A"; - await network.SetNetworkPreferredPlmn(operation, info); - } - else - { - IEnumerable infoList = await network.GetNetworkPreferredPlmn(); - if (infoList.Count() > 0) - { - NetworkPreferredPlmnInfo info = infoList.First(); - await network.SetNetworkPreferredPlmn(operation, info); - } - } - } - - Log.Debug(Globals.LogTag, "SetNetworkPreferredPlmn end"); - } - - catch (Exception ex) - { - Log.Debug(Globals.LogTag, "SetNetworkPreferredPlmn ,exception = " + ex.ToString()); - } - } - - private async void GetPrefPlmnBtn_Clicked(object sender, EventArgs e) - { - try - { - Log.Debug(Globals.LogTag, "GetNetworkPreferredPlmn start"); - IEnumerable infoList = await network.GetNetworkPreferredPlmn(); - Log.Debug(Globals.LogTag, "GetNetworkPreferredPlmn count = " + infoList.Count()); - if (infoList.Count() > 0) - { - List data = infoList.ToList(); - foreach (NetworkPreferredPlmnInfo info in data) - { - Log.Debug(Globals.LogTag, "plmn = " + info.Plmn + " index = " + info.Index + " type = " + info.SystemType + " nwname = " + info.NetworkName); - } - } - - Log.Debug(Globals.LogTag, "GetNetworkPreferredPlmn end"); - } - - catch (Exception ex) - { - Log.Debug(Globals.LogTag, "GetNetworkPreferredPlmn ,exception = " + ex.ToString()); - } - } - - private async void GetNwModeBtn_Clicked(object sender, EventArgs e) - { - try - { - Log.Debug(Globals.LogTag, "GetNetworkSelectionMode start"); - NetworkSelectionMode mode = await network.GetNetworkSelectionMode(); - Log.Debug(Globals.LogTag, "GetNetworkSelectionMode end , mode = " + mode); - } - - catch (Exception ex) - { - Log.Debug(Globals.LogTag, "GetNetworkSelectionMode ,exception = " + ex.ToString()); - } - } - - private async void SelectManualNwBtn_Clicked(object sender, EventArgs e) - { - try - { - string plmn = Globals.handleModem0.GetStringProperty(Property.NetworkPlmn); - int act = Globals.handleModem0.GetIntProperty(Property.NetworkAct); - - Log.Debug(Globals.LogTag, "SelectNetworkManual start --" + plmn + " , " + act); - await network.SelectNetworkManual(plmn, act); - Log.Debug(Globals.LogTag, "SelectNetworkManual end"); - } - - catch (Exception ex) - { - Log.Debug(Globals.LogTag, "SelectNetworkManual ,exception = " + ex.ToString()); - } - } - - private async void SelectAutoNwBtn_Clicked(object sender, EventArgs e) - { - try - { - Log.Debug(Globals.LogTag, "SelectNetworkAutomatic start"); - await network.SelectNetworkAutomatic(); - Log.Debug(Globals.LogTag, "SelectNetworkAutomatic end"); - } - - catch (Exception ex) - { - Log.Debug(Globals.LogTag, "SelectNetworkAutomatic ,exception = " + ex.ToString()); - } - } - - private async void GetServBtn_Clicked(object sender, EventArgs e) - { - try - { - Log.Debug(Globals.LogTag, "GetNetworkServing start"); - NetworkServing serving = await network.GetNetworkServing(); - Log.Debug(Globals.LogTag, "GetNetworkServing , plmn = "+serving.Plmn + ",type = "+serving.SystemType); - NetworkAreaInfo info = serving.AreaInfo; - Log.Debug(Globals.LogTag, "areainfo , Lac = " + info.Lac); - NetworkCdmaSysInfo cdmaInfo = info.CdmaInfo; - if (cdmaInfo != null) - { - Log.Debug(Globals.LogTag, "cdmainfo, basestationid = " + cdmaInfo.BaseStationId + ",basestnlati= "+ cdmaInfo.BaseStationLatitude + ",basestnlongi= " + cdmaInfo.BaseStationLongitude+ ",carrier= " + cdmaInfo.Carrier + - ",id= " + cdmaInfo.NetworkId + ",regzone= " + cdmaInfo.RegistrationZone + ",sysid= " + cdmaInfo.SystemId + ",offset= " + cdmaInfo.PilotOffset); - } - } - - catch (Exception ex) - { - Log.Debug(Globals.LogTag, "GetNetworkServing ,exception = " + ex.ToString()); - } - } - - private async void SetGetModeBtn_Clicked(object sender, EventArgs e) - { - try - { - Log.Debug(Globals.LogTag, "Set and get NetworkMode start"); - var action = await DisplayActionSheet("Operation", "Cancel", null, Enum.GetNames(typeof(NetworkMode))); - Log.Debug(Globals.LogTag, "Action: " + action); - if (action != null) - { - NetworkMode mode = (NetworkMode)Enum.Parse(typeof(NetworkMode), action); - await network.SetNetworkMode(mode); - NetworkMode curMode = await network.GetNetworkMode(); - if (curMode == mode) - { - Log.Debug(Globals.LogTag, "Set and get NetworkMode is success, currentmode = " + curMode); - } - - else - { - Log.Debug(Globals.LogTag, "Set and get NetworkMode has failed, currentmode = " + curMode + ", while the network mode was set to " +mode); - } - } - - } - - catch (Exception ex) - { - Log.Debug(Globals.LogTag, "Set and Get NetworkMode ,exception = " + ex.ToString()); - } - } - - private async void GetNeighborBtn_Clicked(object sender, EventArgs e) - { - try - { - Log.Debug(Globals.LogTag, "GetNeighborCellNetwork start"); - NetworkNeighboringCell cell = await network.GetNeighborCellNetwork(); - NetworkServingCell servcell = cell.ServingCell; - List geranlist = cell.GeranList.ToList(); - List ltelist = cell.LteList.ToList(); - List umtslist = cell.UmtsList.ToList(); - Log.Debug(Globals.LogTag, "NetworkServingCell, type = " + servcell.SystemType + ",mobilecountrycode = " + servcell.MobileCountryCode + ",mobilenetworkcode = " + servcell.MobileNetworkCode); - global::Tizen.Tapi.Cell info = servcell.CellInfo; - if (info != null) - { - Log.Debug(Globals.LogTag, "geraninfo, lac = " + info.GeranCell.Lac + ",cellid= " + info.GeranCell.CellId + ",bsic= " + info.GeranCell.Bsic + - ",rxlev= " + info.GeranCell.Rxlev + ",bcch= " + info.GeranCell.Bcch); - Log.Debug(Globals.LogTag, "lteinfo, earfcn = " + info.LteCell.Earfcn + ",cellid= " + info.LteCell.CellId + ",physicalid= " + info.LteCell.PhysicalId + - ",rssi= " + info.LteCell.Rssi + ",tac = " + info.LteCell.Tac); - Log.Debug(Globals.LogTag, "umtsinfo, arfcn = " + info.UmtsCell.Arfcn + ",cellid= " + info.UmtsCell.CellId + ",lac= " + info.UmtsCell.Lac + - ",psc= " + info.UmtsCell.Psc + ",rscp= " + info.UmtsCell.Rscp); - } - - foreach (NetworkGeranCell c in geranlist) - { - Log.Debug(Globals.LogTag, "geraninfo, lac = " + c.Lac + ",cellid= " + c.CellId + ",bsic= " + c.Bsic + ",rxlev= " + c.Rxlev + ",bcch= " + c.Bcch); - } - foreach (NetworkLteCell c in ltelist) - { - Log.Debug(Globals.LogTag, "lteinfo, earfcn = " + c.Earfcn + ",cellid= " + c.CellId + ",physicalid= " + c.PhysicalId + - ",rssi= " + c.Rssi + ",tac = " + c.Tac); - } - foreach (NetworkUmtsCell c in umtslist) - { - Log.Debug(Globals.LogTag, "umtsinfo, arfcn = " + c.Arfcn + ",cellid= " + c.CellId + ",lac= " + c.Lac + - ",psc= " + c.Psc + ",rscp= " + c.Rscp); - } - } - - catch (Exception ex) - { - Log.Debug(Globals.LogTag, "GetNeighborCellNetwork ,exception = " + ex.ToString()); - } - } - private async void CancelSearchBtn_Clicked(object sender, EventArgs e) - { - try - { - Log.Debug(Globals.LogTag, "CancelNetworkManualSearch start"); - await network.CancelNetworkManualSearch(); - Log.Debug(Globals.LogTag, "CancelNetworkManualSearch end"); - } - - catch (Exception ex) - { - Log.Debug(Globals.LogTag, "CancelNetworkManualSearch ,exception = " + ex.ToString()); - } - } - - private async void SetEmergencyModeBtn_Clicked(object sender, EventArgs e) - { - try - { - Log.Debug(Globals.LogTag, "SetEmergencyCallbackMode start"); - var action = await DisplayActionSheet("Operation", "Cancel", null, Enum.GetNames(typeof(NetworkEmergencyCallbackMode))); - Log.Debug(Globals.LogTag, "Action: " + action); - if (action != null) - { - NetworkEmergencyCallbackMode mode = (NetworkEmergencyCallbackMode)Enum.Parse(typeof(NetworkEmergencyCallbackMode), action); - await network.SetEmergencyCallbackMode(mode); - Log.Debug(Globals.LogTag, "SetEmergencyCallbackMode ends"); - } - } - - catch (Exception ex) - { - Log.Debug(Globals.LogTag, "SetEmergencyCallbackMode ,exception = " + ex.ToString()); - } - } - private async void SetGetRoamPrefBtn_Clicked(object sender, EventArgs e) - { - try - { - Log.Debug(Globals.LogTag, "Set and get roaming preference start"); - var action = await DisplayActionSheet("Operation", "Cancel", null, Enum.GetNames(typeof(NetworkPreferred))); - Log.Debug(Globals.LogTag, "Action: " + action); - if (action != null) - { - NetworkPreferred mode = (NetworkPreferred)Enum.Parse(typeof(NetworkPreferred), action); - await network.SetRoamingPreference(mode); - NetworkPreferred curMode = await network.GetRoamingPreference(); - if (curMode == mode) - { - Log.Debug(Globals.LogTag, "Set and get roaming preference is success, currentmode = " + curMode); - } - - else - { - Log.Debug(Globals.LogTag, "Set and get roaming preference has failed, currentmode = " + curMode + ", while the network mode was set to " + mode); - } - } - - } - - catch (Exception ex) - { - Log.Debug(Globals.LogTag, "Set and Get roaming preference ,exception = " + ex.ToString()); - } - } - private async void SetGetNwSubsBtn_Clicked(object sender, EventArgs e) - { - try - { - Log.Debug(Globals.LogTag, "Set and get default subscription start"); - await network.SetNetworkDefaultSubscription(); - NetworkDefaultSubscription subs = network.GetNetworkDefaultSubscription(); - Log.Debug(Globals.LogTag, "Set and get default subscription ends, Default subscription is = " + subs); - } - - catch (Exception ex) - { - Log.Debug(Globals.LogTag, "Set and get default subscription, exception = " + ex.ToString()); - } - } - - private async void SetGetDataSubsBtn_Clicked(object sender, EventArgs e) - { - try - { - Log.Debug(Globals.LogTag, "Set and get default data subscription start"); - await network.SetDefaultDataSubscription(); - NetworkDefaultDataSubscription subs = network.GetDefaultDataSubscription(); - Log.Debug(Globals.LogTag, "Set and get default data subscription ends, Default subscription is = " + subs); - } - - catch (Exception ex) - { - Log.Debug(Globals.LogTag, "Set and get default data subscription, exception = " + ex.ToString()); - } - } - } -} diff --git a/test/Tizen.Tapitest/PhonebookPage.cs b/test/Tizen.Tapitest/PhonebookPage.cs deleted file mode 100755 index 18a5e0537..000000000 --- a/test/Tizen.Tapitest/PhonebookPage.cs +++ /dev/null @@ -1,322 +0,0 @@ -using System; -using Xamarin.Forms; -using Tizen; -using Tizen.Tapi; -using System.Collections.Generic; -using System.Linq; - -namespace XamarinForTizen.Tizen -{ - public class PhonebookPage : ContentPage - { - Phonebook pb = null; - TapiHandle handle = Globals.handleModem0; - public PhonebookPage() - { - try - { - pb = new Phonebook(handle); - handle.RegisterNotiEvent(Notification.PhonebookContactChange); - handle.NotificationChanged += Handle_ContactChanged_NotiEvent; - } - - catch (Exception ex) - { - Log.Debug(Globals.LogTag, "Pb constructor throws exception = " + ex.ToString()); - } - - var PhonebookInitInfoBtn = new Button - { - Text = "PhonebookInitInfo", - VerticalOptions = LayoutOptions.Start, - HorizontalOptions = LayoutOptions.FillAndExpand - }; - PhonebookInitInfoBtn.Clicked += PhonebookInitInfoBtn_Clicked; - - var PhonebookStorageBtn = new Button - { - Text = "Get Phonebook Storage", - VerticalOptions = LayoutOptions.Start, - HorizontalOptions = LayoutOptions.FillAndExpand - }; - PhonebookStorageBtn.Clicked += PhonebookStorageBtn_Clicked; - - var PhonebookMetaInfoBtn = new Button - { - Text = "Get Phonebook MetaInfo", - VerticalOptions = LayoutOptions.Start, - HorizontalOptions = LayoutOptions.FillAndExpand - }; - PhonebookMetaInfoBtn.Clicked += PhonebookMetaInfoBtn_Clicked; - - var PhonebookMetaInfo3GBtn = new Button - { - Text = "Get Phonebook MetaInfo3G", - VerticalOptions = LayoutOptions.Start, - HorizontalOptions = LayoutOptions.FillAndExpand - }; - PhonebookMetaInfo3GBtn.Clicked += PhonebookMetaInfo3GBtn_Clicked; - - var PhonebookReadRecordGBtn = new Button - { - Text = "Read Phonebook record", - VerticalOptions = LayoutOptions.Start, - HorizontalOptions = LayoutOptions.FillAndExpand - }; - PhonebookReadRecordGBtn.Clicked += PhonebookReadRecordGBtn_Clicked; - - var PhonebookUpdateRecordGBtn = new Button - { - Text = "Update Phonebook record", - VerticalOptions = LayoutOptions.Start, - HorizontalOptions = LayoutOptions.FillAndExpand - }; - PhonebookUpdateRecordGBtn.Clicked += PhonebookUpdateRecordGBtn_Clicked; - - var PhonebookDeleteRecordGBtn = new Button - { - Text = "Delete Phonebook record", - VerticalOptions = LayoutOptions.Start, - HorizontalOptions = LayoutOptions.FillAndExpand - }; - PhonebookDeleteRecordGBtn.Clicked += PhonebookDeleteRecordGBtn_Clicked; - - Content = new StackLayout - { - VerticalOptions = LayoutOptions.Center, - Children = { - PhonebookInitInfoBtn, PhonebookStorageBtn, PhonebookMetaInfoBtn, PhonebookMetaInfo3GBtn, - PhonebookReadRecordGBtn, PhonebookUpdateRecordGBtn, PhonebookDeleteRecordGBtn - } - }; - } - - private void Handle_ContactChanged_NotiEvent(object sender, NotificationChangedEventArgs e) - { - PhonebookContactChangeInfo info = (PhonebookContactChangeInfo)e.Data; - Log.Debug(Globals.LogTag, "Pb contact change noti event received"); - Log.Debug(Globals.LogTag, "Pb Type: " + info.Type); - Log.Debug(Globals.LogTag, "Pb index: " + info.Index); - Log.Debug(Globals.LogTag, "Pb operation: " + info.Operation); - } - - private async void PhonebookDeleteRecordGBtn_Clicked(object sender, EventArgs e) - { - try - { - Log.Debug(Globals.LogTag, "Pb delete record call start"); - bool b = await pb.DeletePhonebookRecord(PhonebookType.Usim, 1); - if (b) - { - Log.Debug(Globals.LogTag, "Pb record deleted successfully"); - } - } - - catch (Exception ex) - { - Log.Debug(Globals.LogTag, "Pb delete record exception: " + ex.ToString()); - } - } - - private async void PhonebookUpdateRecordGBtn_Clicked(object sender, EventArgs e) - { - try - { - Log.Debug(Globals.LogTag, "Pb update record call start"); - PhonebookRecord pbRec = await pb.ReadPhonebookRecord(PhonebookType.Usim, 1); - Log.Debug(Globals.LogTag, "Read record Index: " + pbRec.Index); - Log.Debug(Globals.LogTag, "Read record Name: " + pbRec.Name); - Log.Debug(Globals.LogTag, "Read record Number: " + pbRec.Number); - PhonebookRecord rec = new PhonebookRecord(); - rec.Type = PhonebookType.Usim; - rec.Index = 1; - rec.Name = "NewName"; - rec.Number = "999999"; - bool b = await pb.UpdatePhonebookRecord(rec); - if (b) - { - Log.Debug(Globals.LogTag, "Pb record updated successfully"); - } - - PhonebookRecord pbUpdt = await pb.ReadPhonebookRecord(PhonebookType.Usim, rec.Index); - Log.Debug(Globals.LogTag, "Updated record Name: " + pbUpdt.Name); - Log.Debug(Globals.LogTag, "Updated record Number: " + pbUpdt.Number); - Log.Debug(Globals.LogTag, "Updated update record call success"); - } - - catch (Exception ex) - { - Log.Debug(Globals.LogTag, "Pb update record exception: " + ex.ToString()); - } - } - - private async void PhonebookReadRecordGBtn_Clicked(object sender, EventArgs e) - { - try - { - Log.Debug(Globals.LogTag, "Pb read record call start"); - PhonebookRecord pbRec = await pb.ReadPhonebookRecord(PhonebookType.Usim, 1); - Log.Debug(Globals.LogTag, "Type: " + pbRec.Type); - Log.Debug(Globals.LogTag, "Index: " + pbRec.Index); - Log.Debug(Globals.LogTag, "NextIndex: " + pbRec.NextIndex); - Log.Debug(Globals.LogTag, "Name: " + pbRec.Name); - Log.Debug(Globals.LogTag, "Dcs: " + pbRec.Dcs); - Log.Debug(Globals.LogTag, "Number: " + pbRec.Number); - Log.Debug(Globals.LogTag, "Ton: " + pbRec.Ton); - Log.Debug(Globals.LogTag, "Anr1: " + pbRec.Anr1); - Log.Debug(Globals.LogTag, "Anr1Ton: " + pbRec.Anr1Ton); - Log.Debug(Globals.LogTag, "Anr2: " + pbRec.Anr2); - Log.Debug(Globals.LogTag, "Anr2Ton: " + pbRec.Anr2Ton); - Log.Debug(Globals.LogTag, "Anr3: " + pbRec.Anr3); - Log.Debug(Globals.LogTag, "Anr3Ton: " + pbRec.Anr3Ton); - Log.Debug(Globals.LogTag, "Email1: " + pbRec.Email1); - Log.Debug(Globals.LogTag, "Email2: " + pbRec.Email2); - Log.Debug(Globals.LogTag, "Email3: " + pbRec.Email3); - Log.Debug(Globals.LogTag, "Email4: " + pbRec.Email4); - Log.Debug(Globals.LogTag, "Group index: " + pbRec.GroupIndex); - Log.Debug(Globals.LogTag, "Pbcontrol: " + pbRec.PbControl); - - Log.Debug(Globals.LogTag, "Pb read record call success"); - } - - catch (Exception ex) - { - Log.Debug(Globals.LogTag, "Pb read record exception: " + ex.ToString()); - } - } - - private void PhonebookInitInfoBtn_Clicked(object sender, EventArgs e) - { - try - { - Log.Debug(Globals.LogTag, "Pb init info call start"); - SimPhonebookStatus pbStatus = pb.GetPhonebookInitInfo(); - if (pbStatus == null) - { - Log.Debug(Globals.LogTag, "pbStatus is null"); - return; - } - - Log.Debug(Globals.LogTag, "pbStatus.isinitcompleted: " + pbStatus.IsInitCompleted); - Log.Debug(Globals.LogTag, "pbStatus.pblist: " + pbStatus.PbList.Fdn + " " + pbStatus.PbList.Adn + " " + pbStatus.PbList.Sdn + " " + pbStatus.PbList.Usim + " " + pbStatus.PbList.Aas + " " + pbStatus.PbList.Gas); - Log.Debug(Globals.LogTag, "Pb init info call success"); - } - - catch(Exception ex) - { - Log.Debug(Globals.LogTag, "Pb get init info exception: " + ex.ToString()); - } - } - - private async void PhonebookMetaInfoBtn_Clicked(object sender, EventArgs e) - { - try - { - Log.Debug(Globals.LogTag, "Pb get meta info call start"); - foreach (PhonebookType type in Enum.GetValues(typeof(PhonebookType))) - { - if (type == PhonebookType.Unknown) - { - break; - } - - PhonebookMetaInfo info = await pb.GetPhonebookMetaInfo(type); - if (info == null) - { - Log.Debug(Globals.LogTag, "Pb meta info for " + type.ToString() + "is null"); - continue; - } - - Log.Debug(Globals.LogTag, "Pb meta type for " + type.ToString() + ": " + info.Type); - Log.Debug(Globals.LogTag, "Pb min index for " + type.ToString() + ": " + info.MinIndex); - Log.Debug(Globals.LogTag, "Pb max index for " + type.ToString() + ": " + info.MaxIndex); - Log.Debug(Globals.LogTag, "Pb max number length for " + type.ToString() + ": " + info.NumberMaxLength); - Log.Debug(Globals.LogTag, "Pb max text length for " + type.ToString() + ": " + info.TextMaxLength); - Log.Debug(Globals.LogTag, "Pb used count for " + type.ToString() + ": " + info.UsedCount); - } - - Log.Debug(Globals.LogTag, "Pb get meta info success"); - } - - catch (Exception ex) - { - Log.Debug(Globals.LogTag, "Pb get meta info exception: " + ex.ToString()); - } - } - - private async void PhonebookStorageBtn_Clicked(object sender, EventArgs e) - { - try - { - foreach (PhonebookType type in Enum.GetValues(typeof(PhonebookType))) - { - if (type == PhonebookType.Unknown) - { - break; - } - - Log.Debug(Globals.LogTag, "Pb get storage start"); - PhonebookStorageInfo info = await pb.GetPhonebookStorage(type); - Log.Debug(Globals.LogTag, "Pb get storage success"); - if (info == null) - { - Log.Debug(Globals.LogTag, "Pb storage info for " + type.ToString() + "is null"); - continue; - } - - Log.Debug(Globals.LogTag, "Pb storage type for " + type.ToString() + ": " + info.Type); - Log.Debug(Globals.LogTag, "Pb total record for " + type.ToString() + ": " + info.TotalRecord); - Log.Debug(Globals.LogTag, "Pb used record for " + type.ToString() + ": " + info.UsedRecord); - } - } - - catch (Exception ex) - { - Log.Debug(Globals.LogTag, "Pb get storage info exception: " + ex.ToString()); - } - } - - private async void PhonebookMetaInfo3GBtn_Clicked(object sender, EventArgs e) - { - try - { - Log.Debug(Globals.LogTag, "Pb get meta info 3G start"); - PhonebookMetaInfo3G info = await pb.GetPhonebookMetaInfo3G(); - Log.Debug(Globals.LogTag, "Pb get meta info 3G success"); - if (info == null) - { - Log.Debug(Globals.LogTag, "Pb meta info 3G is null"); - return; - } - - Log.Debug(Globals.LogTag, "Pb file type count: " + info.FileTypeCount); - List infoList = new List(); - if (infoList == null) - { - Log.Debug(Globals.LogTag, "File type info list is null"); - return; - } - - infoList = info.FileTypeInfo.ToList(); - for (int i = 0; i < info.FileTypeCount; i++) - { - Log.Debug(Globals.LogTag, "capa.FileTypeInfo[" + i + "].FileType: " + infoList[i].FileType); - Log.Debug(Globals.LogTag, "capa.FileTypeInfo[" + i + "].MaxIndex: " + infoList[i].MaxIndex); - Log.Debug(Globals.LogTag, "capa.FileTypeInfo[" + i + "].TextMaxLength: " + infoList[i].TextMaxLength); - Log.Debug(Globals.LogTag, "capa.FileTypeInfo[" + i + "].UsedCount: " + infoList[i].UsedCount); - } - } - - catch (Exception ex) - { - Log.Debug(Globals.LogTag, "Pb get meta info 3G exception: " + ex.ToString()); - } - } - - ~PhonebookPage() - { - handle.DeregisterNotiEvent(Notification.PhonebookContactChange); - handle.NotificationChanged -= Handle_ContactChanged_NotiEvent; - } - } -} diff --git a/test/Tizen.Tapitest/Program.cs b/test/Tizen.Tapitest/Program.cs deleted file mode 100755 index 493955b19..000000000 --- a/test/Tizen.Tapitest/Program.cs +++ /dev/null @@ -1,89 +0,0 @@ -/* - * 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 Xamarin.Forms; -using Tizen; -using Tizen.System; -using Tizen.Tapi; - -namespace XamarinForTizen.Tizen -{ - internal class Globals - { - internal static string LogTag = "Tapitest"; - - internal static TapiHandle handleModem0 = null; - internal static TapiHandle handleModem1 = null; - } - public class App : Application - { - private static bool s_isTapiSupported = false; - public App() - { - SystemInfo.TryGetValue("http://tizen.org/feature/network.telephony", out s_isTapiSupported); - if (s_isTapiSupported) - { - Log.Debug(Globals.LogTag, "tapi feature check = " + s_isTapiSupported); - MainPage = new NavigationPage(new MainPage()); - } - - else - { - Log.Debug(Globals.LogTag, "tapi feature is not supported"); - } - } - - protected override void OnStart() - { - // Handle when your app starts - } - - protected override void OnSleep() - { - // Handle when your app sleeps - } - - protected override void OnResume() - { - // Handle when your app resumes - } - } - - class Program : global::Xamarin.Forms.Platform.Tizen.FormsApplication - { - private static App _app; - protected override void OnCreate() - { - base.OnCreate(); - - Log.Debug(Globals.LogTag, "OnCreate()"); - _app = new App(); - LoadApplication(_app); - } - - public static App getApp() - { - return _app; - } - static void Main(string[] args) - { - Log.Debug(Globals.LogTag, "inside main"); - var app = new Program(); - global::Xamarin.Forms.Platform.Tizen.Forms.Init(app); - app.Run(args); - } - } -} \ No newline at end of file diff --git a/test/Tizen.Tapitest/Properties/AssemblyInfo.cs b/test/Tizen.Tapitest/Properties/AssemblyInfo.cs deleted file mode 100755 index eba0bf0b1..000000000 --- a/test/Tizen.Tapitest/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("Tizen.Tapitest")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Samsung Electronics")] -[assembly: AssemblyProduct("Tizen.Tapitest")] -[assembly: AssemblyCopyright("Copyright © Samsung Electronics 2016")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("F2650ABF-4EC2-42A2-AF37-43216A3AC15E")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/test/Tizen.Tapitest/SimPage.cs b/test/Tizen.Tapitest/SimPage.cs deleted file mode 100755 index 6afd3411b..000000000 --- a/test/Tizen.Tapitest/SimPage.cs +++ /dev/null @@ -1,818 +0,0 @@ -using System; -using Xamarin.Forms; -using Tizen; -using Tizen.Tapi; -using System.Collections.Generic; -using System.Linq; -using System.Text; - -namespace XamarinForTizen.Tizen -{ - public class SimPage : ContentPage - { - Sim sim = null; - public SimPage() - { - try - { - sim = new Sim(Globals.handleModem0); - } - - catch(Exception ex) - { - Log.Debug(Globals.LogTag, "Sim constructor throws exception = " + ex.ToString()); - } - - var SimInitInfoBtn = new Button - { - Text = "SimInitInfo", - VerticalOptions = LayoutOptions.Start, - HorizontalOptions = LayoutOptions.FillAndExpand - }; - SimInitInfoBtn.Clicked += SimInitInfoBtn_Clicked; - - var SimPropertiesBtn = new Button - { - Text = "Get sim properties(Type, Imsi, Ecc)", - VerticalOptions = LayoutOptions.Start, - HorizontalOptions = LayoutOptions.FillAndExpand - }; - SimPropertiesBtn.Clicked += SimPropertiesBtn_Clicked; - - var appListBtn = new Button - { - Text = "Get sim application list", - VerticalOptions = LayoutOptions.Start, - HorizontalOptions = LayoutOptions.FillAndExpand - }; - appListBtn.Clicked += appListBtn_Clicked; - - var iccIdBtn = new Button - { - Text = "Get sim ICCID", - VerticalOptions = LayoutOptions.Start, - HorizontalOptions = LayoutOptions.FillAndExpand - }; - iccIdBtn.Clicked += iccIdBtn_Clicked; - - var langPrefBtn = new Button - { - Text = "Set & get sim language preference", - VerticalOptions = LayoutOptions.Start, - HorizontalOptions = LayoutOptions.FillAndExpand - }; - langPrefBtn.Clicked += langPrefBtn_Clicked; - - var getCfBtn = new Button - { - Text = "Get call forward info", - VerticalOptions = LayoutOptions.Start, - HorizontalOptions = LayoutOptions.FillAndExpand - }; - getCfBtn.Clicked += getCfBtn_Clicked; - - var getMwBtn = new Button - { - Text = "Get message waiting info", - VerticalOptions = LayoutOptions.Start, - HorizontalOptions = LayoutOptions.FillAndExpand - }; - getMwBtn.Clicked += getMwBtn_Clicked; - - var getMbBtn = new Button - { - Text = "Get mailbox info", - VerticalOptions = LayoutOptions.Start, - HorizontalOptions = LayoutOptions.FillAndExpand - }; - getMbBtn.Clicked += getMbBtn_Clicked; - - var getCphsBtn = new Button - { - Text = "Get CPHS info", - VerticalOptions = LayoutOptions.Start, - HorizontalOptions = LayoutOptions.FillAndExpand - }; - getCphsBtn.Clicked += getCphsBtn_Clicked; - - var getCphsNetNameBtn = new Button - { - Text = "Get CPHS operator name", - VerticalOptions = LayoutOptions.Start, - HorizontalOptions = LayoutOptions.FillAndExpand - }; - getCphsNetNameBtn.Clicked += getCphsNetNameBtn_Clicked; - - var getFacilityBtn = new Button - { - Text = "Get sim facility", - VerticalOptions = LayoutOptions.Start, - HorizontalOptions = LayoutOptions.FillAndExpand - }; - getFacilityBtn.Clicked += getFacilityBtn_Clicked; - - var getLockInfoBtn = new Button - { - Text = "Get sim lock status", - VerticalOptions = LayoutOptions.Start, - HorizontalOptions = LayoutOptions.FillAndExpand - }; - getLockInfoBtn.Clicked += getLockInfoBtn_Clicked; - - var getImpiBtn = new Button - { - Text = "Get sim IMPI", - VerticalOptions = LayoutOptions.Start, - HorizontalOptions = LayoutOptions.FillAndExpand - }; - getImpiBtn.Clicked += getImpiBtn_Clicked; - - var getImpuBtn = new Button - { - Text = "Get sim IMPU", - VerticalOptions = LayoutOptions.Start, - HorizontalOptions = LayoutOptions.FillAndExpand - }; - getImpuBtn.Clicked += getImpuBtn_Clicked; - - var getDomainBtn = new Button - { - Text = "Get sim domain", - VerticalOptions = LayoutOptions.Start, - HorizontalOptions = LayoutOptions.FillAndExpand - }; - getDomainBtn.Clicked += getDomainBtn_Clicked; - - var getPcscfBtn = new Button - { - Text = "Get sim P-CSCF", - VerticalOptions = LayoutOptions.Start, - HorizontalOptions = LayoutOptions.FillAndExpand - }; - getPcscfBtn.Clicked += getPcscfBtn_Clicked; - - var getIsimSvcTableBtn = new Button - { - Text = "Get ISIM service table", - VerticalOptions = LayoutOptions.Start, - HorizontalOptions = LayoutOptions.FillAndExpand - }; - getIsimSvcTableBtn.Clicked += getIsimSvcTableBtn_Clicked; - - var msisdnBtn = new Button - { - Text = "Get sim MSISDN", - VerticalOptions = LayoutOptions.Start, - HorizontalOptions = LayoutOptions.FillAndExpand - }; - msisdnBtn.Clicked += msisdnBtn_Clicked; - - var oplmnwactBtn = new Button - { - Text = "Get sim OPLMNWACT", - VerticalOptions = LayoutOptions.Start, - HorizontalOptions = LayoutOptions.FillAndExpand - }; - oplmnwactBtn.Clicked += oplmnwactBtn_Clicked; - - var spnBtn = new Button - { - Text = "Get sim SPN", - VerticalOptions = LayoutOptions.Start, - HorizontalOptions = LayoutOptions.FillAndExpand - }; - spnBtn.Clicked += spnBtn_Clicked; - - var autnBtn = new Button - { - Text = "Sim authentication", - VerticalOptions = LayoutOptions.Start, - HorizontalOptions = LayoutOptions.FillAndExpand - }; - autnBtn.Clicked += autnBtn_Clicked; - - var powerBtn = new Button - { - Text = "Sim change power state", - VerticalOptions = LayoutOptions.Start, - HorizontalOptions = LayoutOptions.FillAndExpand - }; - powerBtn.Clicked += powerBtn_Clicked; - - var apduBtn = new Button - { - Text = "Sim APDU", - VerticalOptions = LayoutOptions.Start, - HorizontalOptions = LayoutOptions.FillAndExpand - }; - apduBtn.Clicked += apduBtn_Clicked; - - var atrBtn = new Button - { - Text = "Sim ATR", - VerticalOptions = LayoutOptions.Start, - HorizontalOptions = LayoutOptions.FillAndExpand - }; - atrBtn.Clicked += atrBtn_Clicked; - - ScrollView scrollView = new ScrollView() - { - Content = new StackLayout - { - VerticalOptions = LayoutOptions.Center, - Children = { - SimInitInfoBtn, SimPropertiesBtn, appListBtn, iccIdBtn, langPrefBtn, getCfBtn, getCphsBtn, getMbBtn, - getMwBtn, getCphsNetNameBtn, getFacilityBtn, getLockInfoBtn, getImpiBtn, getImpuBtn, getDomainBtn, - getPcscfBtn, getIsimSvcTableBtn, msisdnBtn, oplmnwactBtn, spnBtn, autnBtn, powerBtn, apduBtn, atrBtn - } - }, - VerticalOptions = LayoutOptions.Center - }; - Content = scrollView; - } - - private async void atrBtn_Clicked(object sender, EventArgs e) - { - try - { - Log.Debug(Globals.LogTag, "Sim request ATR call start"); - SimAtrResponse resp = await sim.SimRequestAtr(); - Log.Debug(Globals.LogTag, "Atr response length: " + resp.AtrRespLength); - for (int i = 0; i < resp.AtrRespLength; i++) - { - Log.Debug(Globals.LogTag, "[" + i + "]'s byte: [0x" + resp.AtrResponse[i] + "]"); - } - - Log.Debug(Globals.LogTag, "Sim request ATR call success"); - } - - catch (Exception ex) - { - Log.Debug(Globals.LogTag, "Sim request ATR exception: " + ex.ToString()); - } - } - - private async void apduBtn_Clicked(object sender, EventArgs e) - { - try - { - Log.Debug(Globals.LogTag, "Sim request APDU call start"); - SimApdu apdu = new SimApdu(Encoding.ASCII.GetBytes("0070000000")); - SimApduResponse resp = await sim.SimRequestApdu(apdu); - Log.Debug(Globals.LogTag, "Apdu response length: " + resp.ApduLength); - for (int i = 0; i < resp.ApduLength; i++) - { - Log.Debug(Globals.LogTag, "[" + i + "]'s byte: [0x" + resp.ApduResponse[i] + "]"); - } - - Log.Debug(Globals.LogTag, "Sim request APDU call success"); - } - - catch (Exception ex) - { - Log.Debug(Globals.LogTag, "Sim request APDU exception: " + ex.ToString()); - } - } - - private async void powerBtn_Clicked(object sender, EventArgs e) - { - TapiHandle handle = Globals.handleModem0; - try - { - Log.Debug(Globals.LogTag, "Sim set power state call start"); - handle.NotificationChanged += Handle_NotiPowerStateChanged; - handle.RegisterNotiEvent(Notification.SimStatus); - bool state = await sim.SimSetPowerState(SimPowerState.Off); - if (state) - { - await sim.SimSetPowerState(SimPowerState.On); - } - - Log.Debug(Globals.LogTag, "Sim set power state call success"); - } - - catch (Exception ex) - { - Log.Debug(Globals.LogTag, "Sim set power state exception: " + ex.ToString()); - } - - finally - { - handle.DeregisterNotiEvent(Notification.SimStatus); - handle.NotificationChanged -= Handle_NotiPowerStateChanged; - } - } - - private void Handle_NotiPowerStateChanged(object sender, NotificationChangedEventArgs e) - { - Log.Debug(Globals.LogTag, "Sim status noti event received, Status: " + e.Data + " Noti value: " + e.Id); - } - - private async void autnBtn_Clicked(object sender, EventArgs e) - { - try - { - SimAuthenticationData authData = new SimAuthenticationData(SimAuthenticationType.Auth3G, 4, 4, Encoding.ASCII.GetBytes("qwerty"), Encoding.ASCII.GetBytes("asdf")); - Log.Debug(Globals.LogTag, "Sim execute authentication call start"); - SimAuthenticationResponse authResp = await sim.SimExecuteAuthentication(authData); - Log.Debug(Globals.LogTag, "Response auth type: " + authResp.AuthType); - Log.Debug(Globals.LogTag, "Response auth result: " + authResp.AuthResult); - Log.Debug(Globals.LogTag, "Response data: " + authResp.ResponseData); - Log.Debug(Globals.LogTag, "Auth key: " + authResp.AuthKey); - Log.Debug(Globals.LogTag, "Cipher data: " + authResp.CipherData); - Log.Debug(Globals.LogTag, "Integrity data: " + authResp.IntegrityData); - Log.Debug(Globals.LogTag, "Sim execute authentication call success"); - } - - catch (Exception ex) - { - Log.Debug(Globals.LogTag, "Sim get SPN exception: " + ex.ToString()); - } - } - - private async void spnBtn_Clicked(object sender, EventArgs e) - { - try - { - Log.Debug(Globals.LogTag, "Sim get SPN call start"); - SimSpn spn = await sim.SimGetSpn(); - Log.Debug(Globals.LogTag, "SPN display condition: " + spn.DisplayCondition); - Log.Debug(Globals.LogTag, "SPN name: " + spn.Spn); - Log.Debug(Globals.LogTag, "Sim get SPN call success"); - } - - catch (Exception ex) - { - Log.Debug(Globals.LogTag, "Sim get SPN exception: " + ex.ToString()); - } - } - - private async void oplmnwactBtn_Clicked(object sender, EventArgs e) - { - try - { - Log.Debug(Globals.LogTag, "Sim get oplmnwact call start"); - SimOplmnwactList oplmnwact = await sim.SimGetOplmnwact(); - Log.Debug(Globals.LogTag, "Sim OPLMNWACT count: " + oplmnwact.Count); - List oplmnList = oplmnwact.List.ToList(); - for (int i = 0; i < oplmnwact.Count; i++) - { - Log.Debug(Globals.LogTag, "Oplmn.list[" + i + "].Plmn: " + oplmnList[i].Plmn); - Log.Debug(Globals.LogTag, "Oplmn.list[" + i + "].IsUmt: " + oplmnList[i].IsUmts); - Log.Debug(Globals.LogTag, "Oplmn.list[" + i + "].IsGsm: " + oplmnList[i].IsGsm); - } - - Log.Debug(Globals.LogTag, "Sim get oplmnwact call success"); - } - - catch (Exception ex) - { - Log.Debug(Globals.LogTag, "Sim get oplmnwact exception: " + ex.ToString()); - } - } - - private async void msisdnBtn_Clicked(object sender, EventArgs e) - { - try - { - Log.Debug(Globals.LogTag, "Sim get msisdn call start"); - SimMsisdnList msisdn = await sim.SimGetMsisdn(); - Log.Debug(Globals.LogTag, "Sim MSISDN count: " + msisdn.Count); - List subs = msisdn.List.ToList(); - for (int i = 0; i < msisdn.Count; i++) - { - Log.Debug(Globals.LogTag, "Msisdn.list[" + i + "].Number: " + subs[i].Number); - Log.Debug(Globals.LogTag, "Msisdn.list[" + i + "].Name: " +subs[i].Name); - } - - Log.Debug(Globals.LogTag, "Sim get msisdn call success"); - } - - catch (Exception ex) - { - Log.Debug(Globals.LogTag, "Sim get msisdn exception: " + ex.ToString()); - } - } - - private async void getIsimSvcTableBtn_Clicked(object sender, EventArgs e) - { - try - { - Log.Debug(Globals.LogTag, "Sim get ISIM service table start"); - Log.Debug(Globals.LogTag, "ISIM service: " + Encoding.UTF8.GetString(await sim.SimGetIsimServiceTable())); - Log.Debug(Globals.LogTag, "Sim get ISIM service table success"); - } - - catch (Exception ex) - { - Log.Debug(Globals.LogTag, "Sim get ISIM service table exception: " + ex.ToString()); - } - } - - private async void getPcscfBtn_Clicked(object sender, EventArgs e) - { - try - { - Log.Debug(Globals.LogTag, "Sim get P-CSCF start"); - SimPcscfList pcsf = await sim.SimGetPcscf(); - Log.Debug(Globals.LogTag, "Data count: " + pcsf.Count); - List list = pcsf.List.ToList(); - for (int i = 0; i < pcsf.Count; i++) - { - Log.Debug(Globals.LogTag, "PcscfList[" + i + "].Type: " + list[i].Type); - Log.Debug(Globals.LogTag, "PcscfList[" + i + "].Data: " + list[i].Pcscf); - } - - Log.Debug(Globals.LogTag, "Sim get P-CSCF success"); - } - - catch (Exception ex) - { - Log.Debug(Globals.LogTag, "Sim get P-CSCF exception: " + ex.ToString()); - } - } - - private async void getDomainBtn_Clicked(object sender, EventArgs e) - { - try - { - Log.Debug(Globals.LogTag, "Sim get domain start"); - Log.Debug(Globals.LogTag, "Domain: " + await sim.SimGetDomain()); - Log.Debug(Globals.LogTag, "Sim get domain success"); - } - - catch (Exception ex) - { - Log.Debug(Globals.LogTag, "Sim get domain exception: " + ex.ToString()); - } - } - - private async void getImpuBtn_Clicked(object sender, EventArgs e) - { - try - { - Log.Debug(Globals.LogTag, "Sim get IMPU start"); - SimImpuList impu = await sim.SimGetImpu(); - Log.Debug(Globals.LogTag, "Data count: " + impu.Count); - List list = impu.List.ToList(); - for (int i = 0; i < impu.Count; i++) - { - Log.Debug(Globals.LogTag, "Data count[" + i + "]: " + list[i]); - } - - Log.Debug(Globals.LogTag, "Sim get IMPU success"); - } - - catch (Exception ex) - { - Log.Debug(Globals.LogTag, "Sim get IMPU exception: " + ex.ToString()); - } - } - - private async void getImpiBtn_Clicked(object sender, EventArgs e) - { - try - { - Log.Debug(Globals.LogTag, "Sim get IMPI start"); - string impi = await sim.SimGetImpi(); - Log.Debug(Globals.LogTag, "IMPI: " + impi); - Log.Debug(Globals.LogTag, "Sim get IMPI success"); - } - - catch (Exception ex) - { - Log.Debug(Globals.LogTag, "Sim get IMPI exception: " + ex.ToString()); - } - } - - private async void getLockInfoBtn_Clicked(object sender, EventArgs e) - { - try - { - Log.Debug(Globals.LogTag, "Sim get lock status start"); - SimLockInfo info = await sim.SimGetLockInfo(SimLockType.PS); - Log.Debug(Globals.LogTag, "Lock type: " + info.Type); - Log.Debug(Globals.LogTag, "Status: " + info.Status); - Log.Debug(Globals.LogTag, "Retry counts: " + info.RetryCount); - Log.Debug(Globals.LogTag, "Sim get lock status success"); - } - - catch (Exception ex) - { - Log.Debug(Globals.LogTag, "Sim get lock status exception: " + ex.ToString()); - } - } - - private async void getFacilityBtn_Clicked(object sender, EventArgs e) - { - try - { - Log.Debug(Globals.LogTag, "Sim get facility start"); - SimFacilityInfo info = await sim.SimGetFacility(SimLockType.PS); - Log.Debug(Globals.LogTag, "Lock type: " + info.Type); - Log.Debug(Globals.LogTag, "Status: " + info.Status); - Log.Debug(Globals.LogTag, "Sim get facility success"); - } - - catch (Exception ex) - { - Log.Debug(Globals.LogTag, "Sim get facility exception: " + ex.ToString()); - } - } - - private async void getCphsNetNameBtn_Clicked(object sender, EventArgs e) - { - try - { - Log.Debug(Globals.LogTag, "Sim get CPHS net name start"); - SimCphsNetName name = await sim.SimGetCphsNetName(); - Log.Debug(Globals.LogTag, "Full name: " + name.FullName); - Log.Debug(Globals.LogTag, "Short name: " + name.ShortName); - Log.Debug(Globals.LogTag, "Sim get CPHS net name success"); - } - - catch (Exception ex) - { - Log.Debug(Globals.LogTag, "Sim get CPHS net name exception: " + ex.ToString()); - } - } - - private async void getCphsBtn_Clicked(object sender, EventArgs e) - { - try - { - Log.Debug(Globals.LogTag, "Sim get CPHS info start"); - SimCphsInfo info = await sim.SimGetCphsInfo(); - Log.Debug(Globals.LogTag, "CPHS phase: " + info.CphsPhase); - Log.Debug(Globals.LogTag, "CPHS CSP: " + info.CphsServiceTable.CustomerServiceProfile); - Log.Debug(Globals.LogTag, "CPHS SST: " + info.CphsServiceTable.ServiceStringTable); - Log.Debug(Globals.LogTag, "CPHS Mailboxnumbers: " + info.CphsServiceTable.MailboxNumbers); - Log.Debug(Globals.LogTag, "CPHS Operator short form name: " + info.CphsServiceTable.OperatorNameShortForm); - Log.Debug(Globals.LogTag, "CPHS information numbers: " + info.CphsServiceTable.InformationNumbers); - Log.Debug(Globals.LogTag, "Sim get CPHS info success"); - } - - catch (Exception ex) - { - Log.Debug(Globals.LogTag, "Sim get CPHS info exception: " + ex.ToString()); - } - } - - private async void getMbBtn_Clicked(object sender, EventArgs e) - { - try - { - Log.Debug(Globals.LogTag, "Sim get mailbox info start"); - SimMailboxList mbList = await sim.SimGetMailboxInfo(); - Log.Debug(Globals.LogTag, "Mb count: " + mbList.Count); - List list = mbList.List.ToList(); - for (int i = 0; i < mbList.Count; i++) - { - Log.Debug(Globals.LogTag, "MbList[" + i + "].IsCphs: " + list[i].IsCphs); - Log.Debug(Globals.LogTag, "MbList[" + i + "].RecIndex: " + list[i].RecIndex); - Log.Debug(Globals.LogTag, "MbList[" + i + "].ProfileNumber: " + list[i].ProfileNumber); - Log.Debug(Globals.LogTag, "MbList[" + i + "].MbType: " + list[i].MbType); - Log.Debug(Globals.LogTag, "MbList[" + i + "].AlphaMaxLength: " + list[i].AlphaMaxLength); - Log.Debug(Globals.LogTag, "MbList[" + i + "].AlphaId: " + list[i].AlphaId); - Log.Debug(Globals.LogTag, "MbList[" + i + "].Ton: " + list[i].Ton); - Log.Debug(Globals.LogTag, "MbList[" + i + "].Npi: " + list[i].Npi); - Log.Debug(Globals.LogTag, "MbList[" + i + "].Number: " + list[i].Number); - Log.Debug(Globals.LogTag, "MbList[" + i + "].CcId: " + list[i].CcId); - Log.Debug(Globals.LogTag, "MbList[" + i + "].Ext1Id: " + list[i].Ext1Id); - } - - Log.Debug(Globals.LogTag, "Sim get mailbox info success"); - } - - catch (Exception ex) - { - Log.Debug(Globals.LogTag, "Sim get mailbox info exception: " + ex.ToString()); - } - } - - private async void getMwBtn_Clicked(object sender, EventArgs e) - { - try - { - Log.Debug(Globals.LogTag, "Sim get message waiting info start"); - SimMessageWaitingResponse resp = await sim.SimGetMessageWaitingInfo(); - Log.Debug(Globals.LogTag, "Is CPHS: " + resp.IsCphs); - Log.Debug(Globals.LogTag, "MWIS profile count: " + resp.MwList.ProfileCount); - List mwis = resp.MwList.MwList.ToList(); - for (int i = 0; i < resp.MwList.ProfileCount; i++) - { - Log.Debug(Globals.LogTag, "MWisList[" + i + "].RecIndex: " + mwis[i].RecIndex); - Log.Debug(Globals.LogTag, "MWisList[" + i + "].IndicatorStatus: " + mwis[i].IndicatorStatus); - Log.Debug(Globals.LogTag, "MWisList[" + i + "].VoiceCount: " + mwis[i].VoiceCount); - Log.Debug(Globals.LogTag, "MWisList[" + i + "].FaxCount: " + mwis[i].FaxCount); - Log.Debug(Globals.LogTag, "MWisList[" + i + "].EmailCount: " + mwis[i].EmailCount); - Log.Debug(Globals.LogTag, "MWisList[" + i + "].OtherCount: " + mwis[i].OtherCount); - Log.Debug(Globals.LogTag, "MWisList[" + i + "].VideoCount: " + mwis[i].VideoCount); - } - - Log.Debug(Globals.LogTag, "CPHSMW.Voice1: " + resp.CphsMw.IsVoice1); - Log.Debug(Globals.LogTag, "CPHSMW.Voice2: " + resp.CphsMw.IsVoice2); - Log.Debug(Globals.LogTag, "CPHSMW.Fax: " + resp.CphsMw.IsFax); - Log.Debug(Globals.LogTag, "CPHSMW.Data: " + resp.CphsMw.IsData); - Log.Debug(Globals.LogTag, "Sim get message waiting info success"); - } - - catch (Exception ex) - { - Log.Debug(Globals.LogTag, "Sim get message waiting info exception: " + ex.ToString()); - } - } - - private async void getCfBtn_Clicked(object sender, EventArgs e) - { - try - { - Log.Debug(Globals.LogTag, "Sim get call forward info start"); - SimCallForwardResponse resp = await sim.SimGetCallForwardInfo(); - Log.Debug(Globals.LogTag, "Is CPHS: " + resp.IsCphs); - Log.Debug(Globals.LogTag, "CFIS profile count: " + resp.CfList.ProfileCount); - List cfis = resp.CfList.CfisList.ToList(); - for (int i = 0; i < resp.CfList.ProfileCount; i++) - { - Log.Debug(Globals.LogTag, "CfisList[" + i + "].RecIndex: " + cfis[i].RecIndex); - Log.Debug(Globals.LogTag, "CfisList[" + i + "].MspNum: " + cfis[i].MspNum); - Log.Debug(Globals.LogTag, "CfisList[" + i + "].CfuStatus: " + cfis[i].CfuStatus); - Log.Debug(Globals.LogTag, "CfisList[" + i + "].Ton: " + cfis[i].Ton); - Log.Debug(Globals.LogTag, "CfisList[" + i + "].Npi: " + cfis[i].Npi); - Log.Debug(Globals.LogTag, "CfisList[" + i + "].CfuNum: " + cfis[i].CfuNum); - Log.Debug(Globals.LogTag, "CfisList[" + i + "].Cc2Id: " + cfis[i].Cc2Id); - Log.Debug(Globals.LogTag, "CfisList[" + i + "].Ext7Id: " + cfis[i].Ext7Id); - } - - Log.Debug(Globals.LogTag, "CPHSCF.Line1: " + resp.CphsCf.Line1); - Log.Debug(Globals.LogTag, "CPHSCF.Line2: " + resp.CphsCf.Line2); - Log.Debug(Globals.LogTag, "CPHSCF.Fax: " + resp.CphsCf.Fax); - Log.Debug(Globals.LogTag, "CPHSCF.Data: " + resp.CphsCf.Data); - Log.Debug(Globals.LogTag, "Sim get call forward info success"); - } - - catch (Exception ex) - { - Log.Debug(Globals.LogTag, "Sim get call forward info exception: " + ex.ToString()); - } - } - - private async void langPrefBtn_Clicked(object sender, EventArgs e) - { - SimLanguagePreference current = await sim.SimGetLanguagePreference(); - try - { - Log.Debug(Globals.LogTag, "Sim get language preference call start"); - foreach (SimLanguagePreference pref in Enum.GetValues(typeof(SimLanguagePreference))) - { - if (pref == SimLanguagePreference.Unspecified) - { - break; - } - - Log.Debug(Globals.LogTag, "Setting sim language preference with " + pref); - bool setFlag = await sim.SimSetLanguagePreference(pref); - if (setFlag) - { - Log.Debug(Globals.LogTag, "Current sim language preference: " + await sim.SimGetLanguagePreference()); - } - } - - Log.Debug(Globals.LogTag, "Sim get language preference call success"); - } - - catch (Exception ex) - { - Log.Debug(Globals.LogTag, "Sim get language preference exception: " + ex.ToString()); - } - - finally - { - await sim.SimSetLanguagePreference(current); - } - } - - private async void iccIdBtn_Clicked(object sender, EventArgs e) - { - try - { - Log.Debug(Globals.LogTag, "Sim get ICC ID call start"); - SimIccIdInfo info = await sim.SimGetIccId(); - if (info == null) - { - Log.Debug(Globals.LogTag, "Sim icc id info is null"); - return; - } - - Log.Debug(Globals.LogTag, "Sim ICC ID length: " + info.IccLength); - Log.Debug(Globals.LogTag, "Sim ICC ID: " + info.IccNumber); - Log.Debug(Globals.LogTag, "Sim get ICC ID call success"); - } - - catch (Exception ex) - { - Log.Debug(Globals.LogTag, "Sim get ICC ID exception: " + ex.ToString()); - } - } - - private void appListBtn_Clicked(object sender, EventArgs e) - { - try - { - Log.Debug(Globals.LogTag, "Sim get app list call start"); - byte app = sim.SimGetApplicationList(); - Log.Debug(Globals.LogTag, "Sim app list: " + app); - if ((app & (byte)SimAppType.Sim) != 0) - { - Log.Debug(Globals.LogTag, "[SIM]"); - } - - if ((app & (byte)SimAppType.Usim) != 0) - { - Log.Debug(Globals.LogTag, "[USIM]"); - } - - if ((app & (byte)SimAppType.Csim) != 0) - { - Log.Debug(Globals.LogTag, "[CSIM]"); - } - - if ((app & (byte)SimAppType.Isim) != 0) - { - Log.Debug(Globals.LogTag, "[ISIM]"); - } - - Log.Debug(Globals.LogTag, "Sim get app list call success"); - } - - catch (Exception ex) - { - Log.Debug(Globals.LogTag, "Sim get app list exception: " + ex.ToString()); - } - } - - private void SimPropertiesBtn_Clicked(object sender, EventArgs e) - { - try - { - Log.Debug(Globals.LogTag, "Sim type call start"); - Log.Debug(Globals.LogTag, "Sim card type: " + sim.SimType); - Log.Debug(Globals.LogTag, "Sim type call success"); - - Log.Debug(Globals.LogTag, "Sim imsi info call start"); - SimImsiInfo imsi = sim.Imsi; - if (imsi == null) - { - Log.Debug(Globals.LogTag, "Imsi info is null"); - return; - } - - Log.Debug(Globals.LogTag, "Sim Mcc: " + imsi.Mcc); - Log.Debug(Globals.LogTag, "Sim Mnc: " + imsi.Mnc); - Log.Debug(Globals.LogTag, "Sim Msin: " + imsi.Msin); - Log.Debug(Globals.LogTag, "Sim imsi info call success"); - - Log.Debug(Globals.LogTag, "Sim ecc info call start"); - SimEccInfoList eccList = sim.Ecc; - Log.Debug(Globals.LogTag, "Sim ECC count: " + eccList.Count); - List ecc = eccList.EccList.ToList(); - for (int i = 0; i < eccList.Count; i++) - { - Log.Debug(Globals.LogTag, "EccList.list[" + i + "].Name: " + ecc[i].Name); - Log.Debug(Globals.LogTag, "EccList.list[" + i + "].Number: " + ecc[i].Number); - Log.Debug(Globals.LogTag, "EccList.list[" + i + "].Category: " + ecc[i].Category); - } - - Log.Debug(Globals.LogTag, "Sim ecc info call success"); - } - - catch (Exception ex) - { - Log.Debug(Globals.LogTag, "Sim get properties exception: " + ex.ToString()); - } - } - - private void SimInitInfoBtn_Clicked(object sender, EventArgs e) - { - try - { - Log.Debug(Globals.LogTag, "Sim init info call start"); - SimInitInfo info = sim.InitInfo; - if (info == null) - { - Log.Debug(Globals.LogTag, "Sim init info is null"); - return; - } - - Log.Debug(Globals.LogTag, "Sim status: " + info.Status); - Log.Debug(Globals.LogTag, "Sim card changed flag: " + info.IsCardChanged); - Log.Debug(Globals.LogTag, "Sim init info call success"); - } - - catch(Exception ex) - { - Log.Debug(Globals.LogTag, "Sim init info exception: " + ex.ToString()); - } - } - } -} diff --git a/test/Tizen.Tapitest/SsPage.cs b/test/Tizen.Tapitest/SsPage.cs deleted file mode 100755 index ad34a12cb..000000000 --- a/test/Tizen.Tapitest/SsPage.cs +++ /dev/null @@ -1,421 +0,0 @@ -using System; -using Xamarin.Forms; -using Tizen; -using Tizen.Tapi; -using System.Collections.Generic; -using System.Linq; - -namespace XamarinForTizen.Tizen -{ - public class SsPage : ContentPage - { - Ss ss = null; - public SsPage() - { - try - { - ss = new Ss(Globals.handleModem0); - } - - catch (Exception ex) - { - Log.Debug(Globals.LogTag, "Ss constructor throws exception = " + ex.ToString()); - } - - var setCfBtn = new Button - { - Text = "Set SS call forward", - VerticalOptions = LayoutOptions.Start, - HorizontalOptions = LayoutOptions.FillAndExpand - }; - setCfBtn.Clicked += setCfBtn_Clicked; - - var getCfBtn = new Button - { - Text = "Get SS call forward status", - VerticalOptions = LayoutOptions.Start, - HorizontalOptions = LayoutOptions.FillAndExpand - }; - getCfBtn.Clicked += getCfBtn_Clicked; - - var setcwBtn = new Button - { - Text = "Set SS call waiting", - VerticalOptions = LayoutOptions.Start, - HorizontalOptions = LayoutOptions.FillAndExpand - }; - setcwBtn.Clicked += setcwBtn_Clicked; - - var getcwBtn = new Button - { - Text = "Get SS call waiting status", - VerticalOptions = LayoutOptions.Start, - HorizontalOptions = LayoutOptions.FillAndExpand - }; - getcwBtn.Clicked += getcwBtn_Clicked; - - var setCliBtn = new Button - { - Text = "Set SS CLI status", - VerticalOptions = LayoutOptions.Start, - HorizontalOptions = LayoutOptions.FillAndExpand - }; - setCliBtn.Clicked += setCliBtn_Clicked; - - var getCliBtn = new Button - { - Text = "Get SS CLI status", - VerticalOptions = LayoutOptions.Start, - HorizontalOptions = LayoutOptions.FillAndExpand - }; - getCliBtn.Clicked += getCliBtn_Clicked; - - var setBarringBtn = new Button - { - Text = "Set SS barring", - VerticalOptions = LayoutOptions.Start, - HorizontalOptions = LayoutOptions.FillAndExpand - }; - setBarringBtn.Clicked += setBarringBtn_Clicked; - - var getBarringBtn = new Button - { - Text = "Get SS barring status", - VerticalOptions = LayoutOptions.Start, - HorizontalOptions = LayoutOptions.FillAndExpand - }; - getBarringBtn.Clicked += getBarringBtn_Clicked; - - var changeBarringPwBtn = new Button - { - Text = "Change SS barring password", - VerticalOptions = LayoutOptions.Start, - HorizontalOptions = LayoutOptions.FillAndExpand - }; - changeBarringPwBtn.Clicked += changeBarringPwBtn_Clicked; - - var sendUssdBtn = new Button - { - Text = "Ss send USSD request", - VerticalOptions = LayoutOptions.Start, - HorizontalOptions = LayoutOptions.FillAndExpand - }; - sendUssdBtn.Clicked += sendUssdBtn_Clicked; - - Content = new StackLayout - { - VerticalOptions = LayoutOptions.Center, - Children = { - setCfBtn, getCfBtn, setcwBtn, getcwBtn, setCliBtn, getCliBtn, setBarringBtn, getBarringBtn, - changeBarringPwBtn, sendUssdBtn - } - }; - } - - private async void sendUssdBtn_Clicked(object sender, EventArgs e) - { - try - { - Log.Debug(Globals.LogTag, "Ss send ussd request start"); - SsUssdMsgInfo info = new SsUssdMsgInfo(); - info.Type = SsUssdType.UserInit; - info.UssdString = "*123#"; - info.Length = info.UssdString.Length; - SsUssdResponse resp = await ss.SsSendUssdRequest(info); - Log.Debug(Globals.LogTag, "Type: " + resp.Type); - Log.Debug(Globals.LogTag, "String: " + resp.UssdString); - Log.Debug(Globals.LogTag, "Ss send ussd request success"); - } - - catch (Exception ex) - { - Log.Debug(Globals.LogTag, "Ss send ussd request exception: " + ex.ToString()); - } - } - - private async void changeBarringPwBtn_Clicked(object sender, EventArgs e) - { - try - { - Log.Debug(Globals.LogTag, "Ss change barring password start"); - bool b = await ss.SsChangeBarringPassword("1111", "'1234", "1234"); - if (b) - { - Log.Debug(Globals.LogTag, "Ss barring password changed successfully"); - } - } - - catch (Exception ex) - { - Log.Debug(Globals.LogTag, "Ss change barring password exception: " + ex.ToString()); - } - } - - private async void getBarringBtn_Clicked(object sender, EventArgs e) - { - try - { - Log.Debug(Globals.LogTag, "Ss get barring status start"); - SsBarringResponse resp = await ss.SsGetBarringStatus(SsClass.AllTele, SsBarringType.Aob); - Log.Debug(Globals.LogTag, "Record number: " + resp.RecordNumber); - List rec = resp.Record.ToList(); - for (int i = 0; i < resp.RecordNumber; i++) - { - Log.Debug(Globals.LogTag, "[" + i + "] Class: " + rec[i].Class); - Log.Debug(Globals.LogTag, "[" + i + "] Type: " + rec[i].BarringType); - Log.Debug(Globals.LogTag, "[" + i + "] Status: " + rec[i].Status); - } - - Log.Debug(Globals.LogTag, "Ss get barring status success"); - } - - catch (Exception ex) - { - Log.Debug(Globals.LogTag, "Ss set barring exception: " + ex.ToString()); - } - } - - private async void setBarringBtn_Clicked(object sender, EventArgs e) - { - TapiHandle handle = Globals.handleModem0; - try - { - Log.Debug(Globals.LogTag, "Ss set barring start"); - handle.RegisterNotiEvent(Notification.SsNotifyBarring); - handle.NotificationChanged += Handle_Barring_NotiEvent; - SsBarringInfo info = new SsBarringInfo(SsClass.Voice, SsBarringMode.Activate, SsBarringType.Aob, "0000"); - SsBarringResponse resp = await ss.SsSetBarring(info); - Log.Debug(Globals.LogTag, "Record number: " + resp.RecordNumber); - List rec = resp.Record.ToList(); - for (int i = 0; i < resp.RecordNumber; i++) - { - Log.Debug(Globals.LogTag, "[" + i + "] Class: " + rec[i].Class); - Log.Debug(Globals.LogTag, "[" + i + "] Type: " + rec[i].BarringType); - Log.Debug(Globals.LogTag, "[" + i + "] Status: " + rec[i].Status); - } - - Log.Debug(Globals.LogTag, "Ss set barring success"); - } - - catch (Exception ex) - { - Log.Debug(Globals.LogTag, "Ss set barring exception: " + ex.ToString()); - } - - finally - { - handle.DeregisterNotiEvent(Notification.SsNotifyBarring); - handle.NotificationChanged -= Handle_Barring_NotiEvent; - } - } - - private void Handle_Barring_NotiEvent(object sender, NotificationChangedEventArgs e) - { - Log.Debug(Globals.LogTag, "Ss barring noti event received"); - SsBarringResponse resp = (SsBarringResponse)e.Data; - Log.Debug(Globals.LogTag, "Record number: " + resp.RecordNumber); - List rec = resp.Record.ToList(); - for (int i = 0; i < resp.RecordNumber; i++) - { - Log.Debug(Globals.LogTag, "[" + i + "] Class: " + rec[i].Class); - Log.Debug(Globals.LogTag, "[" + i + "] Type: " + rec[i].BarringType); - Log.Debug(Globals.LogTag, "[" + i + "] Status: " + rec[i].Status); - } - } - - private async void getCliBtn_Clicked(object sender, EventArgs e) - { - try - { - Log.Debug(Globals.LogTag, "Ss get CLI status start"); - SsCliResponse resp = await ss.SsGetCliStatus(SsCliType.Clip); - Log.Debug(Globals.LogTag, "Type: " + resp.Type); - Log.Debug(Globals.LogTag, "Status: " + resp.Status); - Log.Debug(Globals.LogTag, "Ss get CLI status success"); - } - - catch (Exception ex) - { - Log.Debug(Globals.LogTag, "Ss get CLI status exception: " + ex.ToString()); - } - } - - private async void setCliBtn_Clicked(object sender, EventArgs e) - { - try - { - Log.Debug(Globals.LogTag, "Ss set CLI start"); - bool b = await ss.SsSetCliStatus(SsCliType.Clip, SsCliStatus.Activated); - if (b) - { - Log.Debug(Globals.LogTag, "Ss set CLI status is success"); - } - } - - catch (Exception ex) - { - Log.Debug(Globals.LogTag, "Ss set CLI exception: " + ex.ToString()); - } - } - - private async void getcwBtn_Clicked(object sender, EventArgs e) - { - try - { - Log.Debug(Globals.LogTag, "Ss get call waiting start"); - SsWaitingResponse resp = await ss.SsGetWaitingInfo(SsClass.Voice); - Log.Debug(Globals.LogTag, "Record number: " + resp.RecordNumber); - List rec = resp.Record.ToList(); - for (int i = 0; i < resp.RecordNumber; i++) - { - Log.Debug(Globals.LogTag, "[" + i + "] Class: " + rec[i].Class); - Log.Debug(Globals.LogTag, "[" + i + "] Status: " + rec[i].Status); - } - - Log.Debug(Globals.LogTag, "Ss get call waiting success"); - } - - catch (Exception ex) - { - Log.Debug(Globals.LogTag, "Ss get call waiting exception: " + ex.ToString()); - } - } - - private async void setcwBtn_Clicked(object sender, EventArgs e) - { - TapiHandle handle = Globals.handleModem0; - try - { - Log.Debug(Globals.LogTag, "Ss set call waiting start"); - handle.RegisterNotiEvent(Notification.SsNotifyWaiting); - handle.NotificationChanged += Handle_CallWaitingNoti; - SsWaitingInfo info = new SsWaitingInfo(SsClass.Voice, SsCallWaitingMode.Activate); - SsWaitingResponse resp = await ss.SsSetWaitingInfo(info); - Log.Debug(Globals.LogTag, "Record number: " + resp.RecordNumber); - List rec = resp.Record.ToList(); - for (int i = 0; i < resp.RecordNumber; i++) - { - Log.Debug(Globals.LogTag, "[" + i + "] Class: " + rec[i].Class); - Log.Debug(Globals.LogTag, "[" + i + "] Status: " + rec[i].Status); - } - - Log.Debug(Globals.LogTag, "Ss set call waiting success"); - } - - catch (Exception ex) - { - Log.Debug(Globals.LogTag, "Ss set call waiting exception: " + ex.ToString()); - } - - finally - { - handle.DeregisterNotiEvent(Notification.SsNotifyWaiting); - handle.NotificationChanged -= Handle_CallWaitingNoti; - } - } - - private void Handle_CallWaitingNoti(object sender, NotificationChangedEventArgs e) - { - Log.Debug(Globals.LogTag, "Ss call waiting noti event is received"); - SsWaitingResponse resp = (SsWaitingResponse)e.Data; - Log.Debug(Globals.LogTag, "Record number: " + resp.RecordNumber); - List rec = resp.Record.ToList(); - for (int i = 0; i < resp.RecordNumber; i++) - { - Log.Debug(Globals.LogTag, "[" + i + "] Class: " + rec[i].Class); - Log.Debug(Globals.LogTag, "[" + i + "] Status: " + rec[i].Status); - } - } - - private async void getCfBtn_Clicked(object sender, EventArgs e) - { - try - { - Log.Debug(Globals.LogTag, "Ss get call forward start"); - SsForwardResponse resp = await ss.SsGetForwardStatus(SsClass.Voice, SsForwardCondition.NotReachable); - Log.Debug(Globals.LogTag, "Record num: " + resp.RecordNumber); - List rec = resp.Record.ToList(); - for (int i = 0; i < resp.RecordNumber; i++) - { - Log.Debug(Globals.LogTag, "[" + i + "] Class: " + rec[i].Class); - Log.Debug(Globals.LogTag, "[" + i + "] Status: " + rec[i].Status); - Log.Debug(Globals.LogTag, "[" + i + "] ForwardCondition: " + rec[i].ForwardCondition); - Log.Debug(Globals.LogTag, "[" + i + "] IsFwNumPresent: " + rec[i].IsForwardingNumberPresent); - Log.Debug(Globals.LogTag, "[" + i + "] NoReplyTime:: " + rec[i].NoReplyTime); - Log.Debug(Globals.LogTag, "[" + i + "] Ton: " + rec[i].Ton); - Log.Debug(Globals.LogTag, "[" + i + "] Npi: " + rec[i].Npi); - Log.Debug(Globals.LogTag, "[" + i + "] Number: " + rec[i].ForwardingNumber); - } - - Log.Debug(Globals.LogTag, "Ss get call forward success"); - } - - catch (Exception ex) - { - Log.Debug(Globals.LogTag, "Ss get call forward exception: " + ex.ToString()); - } - } - - private async void setCfBtn_Clicked(object sender, EventArgs e) - { - TapiHandle handle = Globals.handleModem0; - try - { - Log.Debug(Globals.LogTag, "Ss set call forward start"); - handle.RegisterNotiEvent(Notification.SsNotifyForwarding); - handle.NotificationChanged += Handle_CallForwardNotiEvent; - SsForwardInfo cfInfo = new SsForwardInfo(SsClass.Voice, SsForwardMode.Enable, SsForwardCondition.NotReachable, SsNoReplyTime.Time5Secs, SsForwardTypeOfNumber.National, SsForwardNumberingPlanIdentity.National, "9589874552"); - SsForwardResponse resp = await ss.SsSetForwardInfo(cfInfo); - Log.Debug(Globals.LogTag, "Record num: " + resp.RecordNumber); - List rec = resp.Record.ToList(); - for (int i = 0; i < resp.RecordNumber; i++) - { - Log.Debug(Globals.LogTag, "[" + i + "] Class: " + rec[i].Class); - Log.Debug(Globals.LogTag, "[" + i + "] Status: " + rec[i].Status); - Log.Debug(Globals.LogTag, "[" + i + "] ForwardCondition: " + rec[i].ForwardCondition); - Log.Debug(Globals.LogTag, "[" + i + "] IsFwNumPresent: " + rec[i].IsForwardingNumberPresent); - Log.Debug(Globals.LogTag, "[" + i + "] NoReplyTime:: " + rec[i].NoReplyTime); - Log.Debug(Globals.LogTag, "[" + i + "] Ton: " + rec[i].Ton); - Log.Debug(Globals.LogTag, "[" + i + "] Npi: " + rec[i].Npi); - Log.Debug(Globals.LogTag, "[" + i + "] Number: " + rec[i].ForwardingNumber); - } - - Log.Debug(Globals.LogTag, "Ss set call forward success"); - } - - catch(Exception ex) - { - Log.Debug(Globals.LogTag, "Ss set call forward exception: " + ex.ToString()); - } - - finally - { - handle.DeregisterNotiEvent(Notification.SsNotifyForwarding); - handle.NotificationChanged -= Handle_CallForwardNotiEvent; - } - } - - private void Handle_CallForwardNotiEvent(object sender, NotificationChangedEventArgs e) - { - Log.Debug(Globals.LogTag, "Call forward noti event received"); - SsForwardResponse resp = (SsForwardResponse)e.Data; - Log.Debug(Globals.LogTag, "Record number: " + resp.RecordNumber); - List rec = resp.Record.ToList(); - for (int i = 0; i < resp.RecordNumber; i++) - { - Log.Debug(Globals.LogTag, "[" + i + "] Class: " + rec[i].Class); - Log.Debug(Globals.LogTag, "[" + i + "] Status: " + rec[i].Status); - Log.Debug(Globals.LogTag, "[" + i + "] ForwardCondition: " + rec[i].ForwardCondition); - Log.Debug(Globals.LogTag, "[" + i + "] IsFwNumPresent: " + rec[i].IsForwardingNumberPresent); - Log.Debug(Globals.LogTag, "[" + i + "] NoReplyTime:: " + rec[i].NoReplyTime); - Log.Debug(Globals.LogTag, "[" + i + "] Ton: " + rec[i].Ton); - Log.Debug(Globals.LogTag, "[" + i + "] Npi: " + rec[i].Npi); - Log.Debug(Globals.LogTag, "[" + i + "] Number: " + rec[i].ForwardingNumber); - } - } - - ~SsPage() - { - } - } -} diff --git a/test/Tizen.Tapitest/Tizen.Tapitest.csproj b/test/Tizen.Tapitest/Tizen.Tapitest.csproj deleted file mode 100755 index 7d0d7390f..000000000 --- a/test/Tizen.Tapitest/Tizen.Tapitest.csproj +++ /dev/null @@ -1,124 +0,0 @@ - - - - 14.0 - Debug - AnyCPU - 8.0.30703 - 2.0 - {2F98DAC9-6F16-457B-AED7-D43CAC379341};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - {BC2C461D-A67A-47FF-8AAA-D584BD379226} - Exe - Properties - Tizen.Tapitest - Tizen.Tapitest - 512 - en-US - - - .NETCoreApp - v1.0 - false - .NETCoreApp,Version=v1.0 - .NETCoreApp,Version=v1.0 - true - $(NoWarn);1701 - false - - - true - full - false - bin\Debug\ - DEBUG;TRACE - prompt - 4 - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - - - - - - - - - - - - - - - - - - - - - {5bf0618d-32ca-4356-b25b-11bdfd0e6119} - Tizen.Tapi - - - - - - - - - <_TargetFrameworkDirectories>$(MSBuildThisFileDirectory) - <_FullFrameworkReferenceAssemblyPaths>$(MSBuildThisFileDirectory) - true - - - - $(MSBuildExtensionsPath)\Tizen - $(TizenBuildPath)\bin - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/test/Tizen.Tapitest/Tizen.Tapitest.project.json b/test/Tizen.Tapitest/Tizen.Tapitest.project.json deleted file mode 100755 index d6b7a9be3..000000000 --- a/test/Tizen.Tapitest/Tizen.Tapitest.project.json +++ /dev/null @@ -1,27 +0,0 @@ -{ - "buildOptions": { - "emitEntryPoint": true, - "debugType": "portable", - "platform": "AnyCPU", - "preserveCompilationContext": true - }, - "dependencies": { - "ElmSharp": "1.2.0-beta-001", - "Microsoft.NETCore.App": "1.1.1", - "Tizen.Applications.UI": "1.5.8", - "Xamarin.Forms": "2.3.5.239-pre3", - "Xamarin.Forms.Platform.Tizen": "2.3.5-r233-008" - }, - "runtimes": { - "win": {}, - "linux": {} - }, - "frameworks": { - "netcoreapp1.0": { - "imports": [ - "portable-net45+wp80+win81+wpa81", - "netstandard1.6" - ] - } - } -} \ No newline at end of file diff --git a/test/Tizen.Tapitest/shared/res/Tizen.Tapitest.png b/test/Tizen.Tapitest/shared/res/Tizen.Tapitest.png deleted file mode 100755 index 9765b1bda..000000000 Binary files a/test/Tizen.Tapitest/shared/res/Tizen.Tapitest.png and /dev/null differ diff --git a/test/Tizen.Tapitest/tizen-manifest.xml b/test/Tizen.Tapitest/tizen-manifest.xml deleted file mode 100755 index c94aac16b..000000000 --- a/test/Tizen.Tapitest/tizen-manifest.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - Tizen.Tapitest.png - - - - - http://tizen.org/privilege/telephony - http://tizen.org/privilege/telephony.admin - - diff --git a/test/Tizen.WebView.Test/Properties/AssemblyInfo.cs b/test/Tizen.WebView.Test/Properties/AssemblyInfo.cs deleted file mode 100644 index 193c2d836..000000000 --- a/test/Tizen.WebView.Test/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,36 +0,0 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; - -// General Information about an assembly is controlled through the following -// set of attributes. Change these attribute values to modify the information -// associated with an assembly. -[assembly: AssemblyTitle("Tizen.WebView.Test")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Samsung Electronics")] -[assembly: AssemblyProduct("Tizen.WebView.Test")] -[assembly: AssemblyCopyright("Copyright © Samsung Electronics 2017")] -[assembly: AssemblyTrademark("")] -[assembly: AssemblyCulture("")] - -// Setting ComVisible to false makes the types in this assembly not visible -// to COM components. If you need to access a type in this assembly from -// COM, set the ComVisible attribute to true on that type. -[assembly: ComVisible(false)] - -// The following GUID is for the ID of the typelib if this project is exposed to COM -[assembly: Guid("b57dafa3-b566-4ebf-a6f0-ecd2224a748d")] - -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/test/Tizen.WebView.Test/SimpleWebviewApp.cs b/test/Tizen.WebView.Test/SimpleWebviewApp.cs deleted file mode 100644 index ffa3eeb23..000000000 --- a/test/Tizen.WebView.Test/SimpleWebviewApp.cs +++ /dev/null @@ -1,278 +0,0 @@ -/* - * Copyright (c) 2017 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.Collections.Generic; -using System.Linq; -using System.Text; - -using ElmSharp; -using Tizen.Applications; -using Tizen.WebView; - - -namespace Tizen.WebView.Test -{ - public class SimpleWebviewApp : CoreUIApplication - { - private const string LogTag = "WebViewApp"; - - private const string _windowName = "Simple WebView App"; - private const string _defaultUrl = "http://www.google.com"; - private WebView _webview; - private Entry _addressEntry; - private Button _reloadButton; - - public SimpleWebviewApp() - { - - } - - protected override void OnCreate() - { - base.OnCreate(); - Chromium.Initialize(); - // Create webview and toolbox - CreateUI(); - } - - protected override void OnTerminate() - { - Chromium.Shutdown(); - base.OnTerminate(); - } - - private void CreateUI() - { - // Create Window - Window window = new Window(_windowName); - window.Show(); - - // Create Box for main window - Box mainBox = CreateBaseUI(window); - - // Create top bar - Box topBar = CreateTopBar(window); - - // Create Webview - _webview = new WebView(window) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1 - }; - _webview.Show(); - - // Create bottom bar - Box bottomBar = CreateBottomBar(window); - - mainBox.PackEnd(topBar); - mainBox.PackEnd(_webview); - mainBox.PackEnd(bottomBar); - - InitializeWebView(); - - // Load default URL - _webview.LoadUrl(_defaultUrl); - } - - private Box CreateBaseUI(Window window) - { - // Create Background - Background background = new Background(window) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - Color = Color.White - }; - background.Show(); - window.AddResizeObject(background); - - // Create Conformant - Conformant conformant = new Conformant(window); - conformant.Show(); - - // Create Box for all contents - Box box = new Box(window) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1 - }; - box.Show(); - conformant.SetContent(box); - - return box; - } - - private Box CreateTopBar(Window window) - { - // Create Box for address bar - Box topBar = new Box(window) - { - AlignmentX = -1, - AlignmentY = 0, - WeightX = 1, - WeightY = 0, - IsHorizontal = true - }; - topBar.Show(); - - // Create address entry - _addressEntry = new Entry(window) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 1, - WeightY = 1, - IsSingleLine = true, - Scrollable = true, - Text = _defaultUrl - }; - _addressEntry.SetInputPanelLayout(InputPanelLayout.Url); - _addressEntry.Activated += (s, e) => - { - _webview.LoadUrl(((Entry)s).Text); - }; - _addressEntry.Show(); - - // Create reload button - _reloadButton = new Button(window) - { - AlignmentX = -1, - AlignmentY = -1, - WeightX = 0.3, - WeightY = 1, - Text = "Reload" - }; - _reloadButton.Clicked += (s, e) => - { - if (_reloadButton.Text.Equals("Reload")) - { - _webview.Reload(); - } - else if (_reloadButton.Text.Equals("Stop")) - { - _webview.StopLoading(); - } - }; - _reloadButton.Show(); - - topBar.PackEnd(_addressEntry); - topBar.PackEnd(_reloadButton); - - return topBar; - } - - private Box CreateBottomBar(Window window) - { - // Create Box for bottom bar - Box bottomBar = new Box(window) - { - AlignmentX = -1, - AlignmentY = 1, - WeightX = 1, - WeightY = 0, - IsHorizontal = true - }; - bottomBar.Show(); - - // Create back/forward buttons - Button backButton = new Button(window) - { - AlignmentX = -1, - AlignmentY = 0.5, - WeightX = 1, - WeightY = 1, - Text = "Back" - - }; - backButton.Clicked += (s, e) => - { - if (_webview.CanGoBack()) - _webview.GoBack(); - }; - backButton.Show(); - - Button forwardButton = new Button(window) - { - AlignmentX = -1, - AlignmentY = 0.5, - WeightX = 1, - WeightY = 1, - Text = "Forward" - - }; - forwardButton.Clicked += (s, e) => - { - if (_webview.CanGoForward()) - _webview.GoForward(); - }; - forwardButton.Show(); - - bottomBar.PackEnd(backButton); - bottomBar.PackEnd(forwardButton); - - return bottomBar; - } - - private void InitializeWebView() - { - _webview.LoadStarted += (s, e) => - { - Log.Info(LogTag, "Load started"); - _reloadButton.Text = "Stop"; - }; - - _webview.LoadFinished += (s, e) => - { - Log.Info(LogTag, "Load finished"); - _reloadButton.Text = "Reload"; - }; - - _webview.LoadError += (s, e) => - { - Log.Info(LogTag, "Load error(" + e.Code + "): " + e.Description); - }; - - _webview.UrlChanged += (s, e) => - { - Log.Info(LogTag, "Url changed: " + e.GetAsString()); - _addressEntry.Text = e.GetAsString(); - }; - - CookieManager cookieManager = _webview.GetContext().GetCookieManager(); - if (cookieManager != null) - { - cookieManager.SetCookieAcceptPolicy(CookieAcceptPolicy.Always); - cookieManager.SetPersistentStorage(DirectoryInfo.Data, CookiePersistentStorage.SqlLite); - } - } - - static void Main(string[] args) - { - Elementary.Initialize(); - Elementary.ThemeOverlay(); - - SimpleWebviewApp app = new Test.SimpleWebviewApp(); - app.Run(args); - } - } -} diff --git a/test/Tizen.WebView.Test/Tizen.WebView.Test.csproj b/test/Tizen.WebView.Test/Tizen.WebView.Test.csproj deleted file mode 100755 index 9a6ebb1a1..000000000 --- a/test/Tizen.WebView.Test/Tizen.WebView.Test.csproj +++ /dev/null @@ -1,98 +0,0 @@ - - - - 14.0 - Debug - AnyCPU - 8.0.30703 - 2.0 - {2F98DAC9-6F16-457B-AED7-D43CAC379341};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} - {B57DAFA3-B566-4EBF-A6F0-ECD2224A748D} - Exe - Properties - Tizen.WebView.Test - Tizen.WebView.Test - 512 - en-US - - - DNXCore - v5.0 - false - .NETCoreApp,Version=v1.0 - true - $(NoWarn);1701 - false - - - true - full - true - bin\Debug\ - DEBUG;TRACE - prompt - 4 - ;1701;1702 - true - - - pdbonly - true - bin\Release\ - TRACE - prompt - 4 - true - ;1701;1702 - true - - - - - - - - - - - - - - - - - {8405e84f-b920-4aac-9ad5-001b9debc9ca} - Tizen.WebView - - - - - - - - <_TargetFrameworkDirectories>$(MSBuildThisFileDirectory) - <_FullFrameworkReferenceAssemblyPaths>$(MSBuildThisFileDirectory) - true - - - - - - - - - - - - diff --git a/test/Tizen.WebView.Test/Tizen.WebView.Test.project.json b/test/Tizen.WebView.Test/Tizen.WebView.Test.project.json deleted file mode 100644 index b330acf03..000000000 --- a/test/Tizen.WebView.Test/Tizen.WebView.Test.project.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "dependencies": { - "ElmSharp": "1.2.0-*", - "Microsoft.NETCore.App": "1.0.0", - "Tizen": "1.0.3", - "Tizen.Applications": "1.3.2" - }, - "frameworks": { - "netcoreapp1.0": {} - }, - "runtimes": { - "win": {} - } -} diff --git a/test/Tizen.WebView.Test/shared/res/Tizen.WebView.Test.png b/test/Tizen.WebView.Test/shared/res/Tizen.WebView.Test.png deleted file mode 100644 index 9765b1bda..000000000 Binary files a/test/Tizen.WebView.Test/shared/res/Tizen.WebView.Test.png and /dev/null differ diff --git a/test/Tizen.WebView.Test/tizen-manifest.xml b/test/Tizen.WebView.Test/tizen-manifest.xml deleted file mode 100644 index 513985e22..000000000 --- a/test/Tizen.WebView.Test/tizen-manifest.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - Tizen.WebView.Test.png - - - - http://tizen.org/privilege/mediastorage - http://tizen.org/privilege/externalstorage - http://tizen.org/privilege/network.get - http://tizen.org/privilege/internet - - diff --git a/tools/GenAPI/GenAPI.exe b/tools/GenAPI/GenAPI.exe deleted file mode 100755 index 53b147303..000000000 Binary files a/tools/GenAPI/GenAPI.exe and /dev/null differ diff --git a/tools/GenAPI/GenAPI.runtimeconfig.json b/tools/GenAPI/GenAPI.runtimeconfig.json deleted file mode 100644 index d5ff8e270..000000000 --- a/tools/GenAPI/GenAPI.runtimeconfig.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "runtimeOptions": { - "tfm": "netcoreapp2.0", - "framework": { - "name": "Microsoft.NETCore.App", - "version": "2.0.0" - } - } -} diff --git a/tools/GenAPI/Microsoft.Cci.Extensions.dll b/tools/GenAPI/Microsoft.Cci.Extensions.dll deleted file mode 100644 index 2ce23b69e..000000000 Binary files a/tools/GenAPI/Microsoft.Cci.Extensions.dll and /dev/null differ diff --git a/tools/GenAPI/Microsoft.Cci.dll b/tools/GenAPI/Microsoft.Cci.dll deleted file mode 100755 index 0956d9a96..000000000 Binary files a/tools/GenAPI/Microsoft.Cci.dll and /dev/null differ diff --git a/tools/NuGet.exe b/tools/NuGet.exe deleted file mode 100644 index ec1309c7a..000000000 Binary files a/tools/NuGet.exe and /dev/null differ diff --git a/tools/add_module.sh b/tools/add_module.sh deleted file mode 100755 index 57ea615fc..000000000 --- a/tools/add_module.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash - -SCRIPT_FILE=$(readlink -f $0) -SCRIPT_DIR=$(dirname $SCRIPT_FILE) -ROOT_DIR=$(readlink -f $SCRIPT_DIR/..) - -MODULE_NAME=$1; shift - -if [ -z "$MODULE_NAME" ]; then - echo "No module name specified." - exit 1 -fi - -if [ -d "$ROOT_DIR/src/$MODULE_NAME" ]; then - echo "The module '$MODULE_NAME' already exists." -fi - -mkdir -p $ROOT_DIR/src/$MODULE_NAME -cp -f $SCRIPT_DIR/module.csproj.template $ROOT_DIR/src/$MODULE_NAME/$MODULE_NAME.csproj -cd $ROOT_DIR/src/$MODULE_NAME -dotnet new sln -dotnet sln add $MODULE_NAME.csproj - -echo "New module [$ROOT_DIR/src/$MODULE_NAME] has been created." \ No newline at end of file diff --git a/tools/module.csproj.template b/tools/module.csproj.template deleted file mode 100644 index 30cd5a42e..000000000 --- a/tools/module.csproj.template +++ /dev/null @@ -1,8 +0,0 @@ - - - - netstandard2.0 - - - - diff --git a/tools/retry.sh b/tools/retry.sh deleted file mode 100755 index b6add9dcc..000000000 --- a/tools/retry.sh +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/bash - -retry_count=3 -cmd="${@}" - -n=0 -until [ $n -ge $retry_count ]; do - if [ $n -gt 0 ]; then - echo "(Failed! Retry $[$n+1]/$retry_count) $cmd" - sleep 2 - fi - $cmd - RET=$? - if [ $RET -eq 0 ]; then - break - else - n=$[$n+1] - fi -done - -exit $RET diff --git a/tools/timeout.sh b/tools/timeout.sh deleted file mode 100755 index c7273d029..000000000 --- a/tools/timeout.sh +++ /dev/null @@ -1,58 +0,0 @@ -#!/bin/sh - -# Execute a command with a timeout - -# License: LGPLv2 -# Author: -# http://www.pixelbeat.org/ -# Notes: -# Note there is a timeout command packaged with coreutils since v7.0 -# If the timeout occurs the exit status is 124. -# There is an asynchronous (and buggy) equivalent of this -# script packaged with bash (under /usr/share/doc/ in my distro), -# which I only noticed after writing this. -# I noticed later again that there is a C equivalent of this packaged -# with satan by Wietse Venema, and copied to forensics by Dan Farmer. -# Changes: -# V1.0, Nov 3 2006, Initial release -# V1.1, Nov 20 2007, Brad Greenlee -# Make more portable by using the 'CHLD' -# signal spec rather than 17. -# V1.3, Oct 29 2009, Ján Sáreník -# Even though this runs under dash,ksh etc. -# it doesn't actually timeout. So enforce bash for now. -# Also change exit on timeout from 128 to 124 -# to match coreutils. -# V2.0, Oct 30 2009, Ján Sáreník -# Rewritten to cover compatibility with other -# Bourne shell implementations (pdksh, dash) - -if [ "$#" -lt "2" ]; then - echo "Usage: `basename $0` timeout_in_seconds command" >&2 - echo "Example: `basename $0` 2 sleep 3 || echo timeout" >&2 - exit 1 -fi - -cleanup() -{ - trap - ALRM #reset handler to default - kill -ALRM $a 2>/dev/null #stop timer subshell if running - kill $! 2>/dev/null && #kill last job - exit 124 #exit with 124 if it was running -} - -watchit() -{ - trap "cleanup" ALRM - sleep $1& wait - kill -ALRM $$ -} - -watchit $1& a=$! #start the timeout -shift #first param was timeout for sleep -trap "cleanup" ALRM INT #cleanup after timeout -"$@"& wait $!; RET=$? #start the job wait for it and save its return value -kill -ALRM $a #send ALRM signal to watchit -wait $a #wait for watchit to finish cleanup -exit $RET #return the value -